ntp-4.2.6p5/0000755000175000017500000000000011710605402011605 5ustar peterpeterntp-4.2.6p5/packageinfo.sh0000644000175000017500000000550611675460255014435 0ustar peterpeter# # packageinfo.sh - set shell variables with version components # # This file is sourced by other scripts and does not need execute # permission or the #! shell selector. # # Most changes to this file are fully or semi-automated using the # UpdatePoint script on the ntp.org tarball build machine. Changes # required by the typical ntp.org release sequences are below. # ## DEV: # # To bump the -dev point (p) number, UpdatePoint needs no changes here. # # To start a -RC cycle in -dev leading to the next -stable release, # set prerelease=rc. # # To move from dev -RC to new -stable and -dev major/minor version, set # minor and/or major to the new version, repotype to match the new # minor version, empty prerelease, and set point=NEW. UpdatePoint # will empty point and rcpoint, and set betapoint=0. # ## STABLE: # # To start a -stable beta cycle, which normally occurs before a -stable # -RC1 during the runup to a -stable point release, UpdatePoint needs # no changes here. Both betapoint and point will be incremented, and # prerelease will be set to beta. # # To move on from -stable beta to RC set prerelease=rc. # # To fall back from -stable RC to beta set prerelease=beta. # # To skip over -stable beta1 directly to -RC1, set prerelease=rc. # # To skip all -stable prereleases and move from one primary or point # release directly to the next point release, or to go from RC to # release, set rcpoint=GO. # ## # # 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 # # repotype must be stable or dev repotype=stable # version=Protocol.Major.Minor # odd minor numbers are for -dev, even minor numbers are for -stable # UpdatePoint will fail if repotype is inconsistent with minor. proto=4 major=2 minor=6 version=${proto}.${major}.${minor} # Special. Normally unused. A suffix. #special=ag special= # prerelease can be empty, 'beta', or 'rc'. prerelease= # ChangeLog starting tag (see also CommitLog-4.1.0) CLTAG=NTP_4_2_0 ### Point number, after "p", normally modified by script. # 3 cases: # - Numeric values increment # - empty 'increments' to 1 # - NEW 'increments' to empty point=5 ### betapoint is normally modified by script. # ntp-stable Beta number (betapoint) # Should be zeroed at release, and left at zero until first beta. # The first beta is -beta1. # betapoint is always zero in ntp-dev. betapoint=0 ### rcpoint is normally modified by script except for GO. # RC number (rcpoint) # for ntp-dev, always empty as RC numbers are not used, nor is GO. # For ntp-stable: # if prerelease is 'rc': # - Numeric values increment # - GO triggers a release # - - rcpoint is emptied # - - betapoint is set to 0 # - - prerelease is emptied # else (not in RC) # - rcpoint is empty and unused (for now). rcpoint= ntp-4.2.6p5/depcomp0000755000175000017500000003710010377564353013204 0ustar peterpeter#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # 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 2, 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ntp-4.2.6p5/NEWS0000644000175000017500000003100111675457660012324 0ustar peterpeter--- NTP 4.2.6p5 (Harlan Stenn , 2011/12/24) Focus: Bug fixes Severity: Medium This is a recommended upgrade. This release updates sys_rootdisp and sys_jitter calculations to match the RFC specification, fixes a potential IPv6 address matching error for the "nic" and "interface" configuration directives, suppresses the creation of extraneous ephemeral associations for certain broadcastclient and multicastclient configurations, cleans up some ntpq display issues, and includes improvements to orphan mode, minor bugs fixes and code clean-ups. New features / changes in this release: ntpd * Updated "nic" and "interface" IPv6 address handling to prevent mismatches with localhost [::1] and wildcard [::] which resulted from using the address/prefix format (e.g. fe80::/64) * Fix orphan mode stratum incorrectly counting to infinity * Orphan parent selection metric updated to includes missing ntohl() * Non-printable stratum 16 refid no longer sent to ntp * Duplicate ephemeral associations suppressed for broadcastclient and multicastclient without broadcastdelay * Exclude undetermined sys_refid from use in loopback TEST12 * Exclude MODE_SERVER responses from KoD rate limiting * Include root delay in clock_update() sys_rootdisp calculations * get_systime() updated to exclude sys_residual offset (which only affected bits "below" sys_tick, the precision threshold) * sys.peer jitter weighting corrected in sys_jitter calculation ntpq * -n option extended to include the billboard "server" column * IPv6 addresses in the local column truncated to prevent overruns --- NTP 4.2.6p4 (Harlan Stenn , 2011/09/22) Focus: Bug fixes and portability improvements Severity: Medium This is a recommended upgrade. This release includes build infrastructure updates, code clean-ups, minor bug fixes, fixes for a number of minor ref-clock issues, and documentation revisions. Portability improvements affect AIX, HP-UX, Linux, OS X and 64-bit time_t. New features / changes in this release: Build system * Fix checking for struct rtattr * Update config.guess and config.sub for AIX * Upgrade required version of autogen and libopts for building from our source code repository ntpd * Back-ported several fixes for Coverity warnings from ntp-dev * Fix a rare boundary condition in UNLINK_EXPR_SLIST() * Allow "logconfig =allall" configuration directive * Bind tentative IPv6 addresses on Linux * Correct WWVB/Spectracom driver to timestamp CR instead of LF * Improved tally bit handling to prevent incorrect ntpq peer status reports * Exclude the Undisciplined Local Clock and ACTS drivers from the initial candidate list unless they are designated a "prefer peer" * Prevent the consideration of Undisciplined Local Clock or ACTS drivers for selection during the 'tos orphanwait' period * Prefer an Orphan Mode Parent over the Undisciplined Local Clock or ACTS drivers * Improved support of the Parse Refclock trusttime flag in Meinberg mode * Back-port utility routines from ntp-dev: mprintf(), emalloc_zero() * Added the NTPD_TICKADJ_PPM environment variable for specifying baseline clock slew on Microsoft Windows * Code cleanup in libntpq ntpdc * Fix timerstats reporting ntpdate * Reduce time required to set clock * Allow a timeout greater than 2 seconds sntp * Backward incompatible command-line option change: -l/--filelog changed -l/--logfile (to be consistent with ntpd) Documentation * Update html2man. Fix some tags in the .html files * Distribute ntp-wait.html --- NTP 4.2.6p3 (Harlan Stenn , 2011/01/03) Focus: Bug fixes and portability improvements Severity: Medium This is a recommended upgrade. This release includes build infrastructure updates, code clean-ups, minor bug fixes, fixes for a number of minor ref-clock issues, and documentation revisions. Portability improvements in this release affect AIX, Atari FreeMiNT, FreeBSD4, Linux and Microsoft Windows. New features / changes in this release: Build system * Use lsb_release to get information about Linux distributions. * 'test' is in /usr/bin (instead of /bin) on some systems. * Basic sanity checks for the ChangeLog file. * Source certain build files with ./filename for systems without . in PATH. * IRIX portability fix. * Use a single copy of the "libopts" code. * autogen/libopts upgrade. * configure.ac m4 quoting cleanup. ntpd * Do not bind to IN6_IFF_ANYCAST addresses. * Log the reason for exiting under Windows. * Multicast fixes for Windows. * Interpolation fixes for Windows. * IPv4 and IPv6 Multicast fixes. * Manycast solicitation fixes and general repairs. * JJY refclock cleanup. * NMEA refclock improvements. * Oncore debug message cleanup. * Palisade refclock now builds under Linux. * Give RAWDCF more baud rates. * Support Truetime Satellite clocks under Windows. * Support Arbiter 1093C Satellite clocks under Windows. * Make sure that the "filegen" configuration command defaults to "enable". * Range-check the status codes (plus other cleanup) in the RIPE-NCC driver. * Prohibit 'includefile' directive in remote configuration command. * Fix 'nic' interface bindings. * Fix the way we link with openssl if openssl is installed in the base system. ntp-keygen * Fix -V coredump. * OpenSSL version display cleanup. ntpdc * Many counters should be treated as unsigned. ntpdate * Do not ignore replies with equal receive and transmit timestamps. ntpq * libntpq warning cleanup. ntpsnmpd * Correct SNMP type for "precision" and "resolution". * Update the MIB from the draft version to RFC-5907. sntp * Display timezone offset when showing time for sntp in the local timezone. * Pay proper attention to RATE KoD packets. * Fix a miscalculation of the offset. * Properly parse empty lines in the key file. * Logging cleanup. * Use tv_usec correctly in set_time(). * Documentation cleanup. --- NTP 4.2.6p2 (Harlan Stenn , 2010/07/08) Focus: Bug fixes and portability improvements Severity: Medium This is a recommended upgrade. This release includes build infrastructure updates, code clean-ups, minor bug fixes, fixes for a number of minor ref-clock issues, improved KOD handling, OpenSSL related updates and documentation revisions. Portability improvements in this release affect Irix, Linux, Mac OS, Microsoft Windows, OpenBSD and QNX6 New features / changes in this release: ntpd * Range syntax for the trustedkey configuration directive * Unified IPv4 and IPv6 restrict lists ntpdate * Rate limiting and KOD handling ntpsnmpd * default connection to net-snmpd via a unix-domain socket * command-line 'socket name' option ntpq / ntpdc * support for the "passwd ..." syntax * key-type specific password prompts sntp * MD5 authentication of an ntpd * Broadcast and crypto * OpenSSL support --- NTP 4.2.6p1 (Harlan Stenn , 2010/04/09) Focus: Bug fixes, portability fixes, and documentation improvements Severity: Medium This is a recommended upgrade. --- NTP 4.2.6 (Harlan Stenn , 2009/12/08) Focus: enhancements and bug fixes. --- NTP 4.2.4p8 (Harlan Stenn , 2009/12/08) Focus: Security Fixes Severity: HIGH This release fixes the following high-severity vulnerability: * [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. See http://support.ntp.org/security for more information. NTP mode 7 (MODE_PRIVATE) is used by the ntpdc query and control utility. In contrast, ntpq uses NTP mode 6 (MODE_CONTROL), while routine NTP time transfers use modes 1 through 5. Upon receipt of an incorrect mode 7 request or a mode 7 error response from an address which is not listed in a "restrict ... noquery" or "restrict ... ignore" statement, ntpd will reply with a mode 7 error response (and log a message). In this case: * If an attacker spoofs the source address of ntpd host A in a mode 7 response packet sent to ntpd host B, both A and B will continuously send each other error responses, for as long as those packets get through. * If an attacker spoofs an address of ntpd host A in a mode 7 response packet sent to ntpd host A, A will respond to itself endlessly, consuming CPU and logging excessively. Credit for finding this vulnerability goes to Robin Park and Dmitri Vinokurov of Alcatel-Lucent. THIS IS A STRONGLY RECOMMENDED UPGRADE. --- ntpd now syncs to refclocks right away. Backward-Incompatible changes: ntpd no longer accepts '-v name' or '-V name' to define internal variables. Use '--var name' or '--dvar name' instead. (Bug 817) --- NTP 4.2.4p7 (Harlan Stenn , 2009/05/04) Focus: Security and Bug Fixes Severity: HIGH This release fixes the following high-severity vulnerability: * [Sec 1151] Remote exploit if autokey is enabled. CVE-2009-1252 See http://support.ntp.org/security for more information. If autokey is enabled (if ntp.conf contains a "crypto pw whatever" line) then a carefully crafted packet sent to the machine will cause a buffer overflow and possible execution of injected code, running with the privileges of the ntpd process (often root). Credit for finding this vulnerability goes to Chris Ries of CMU. This release fixes the following low-severity vulnerabilities: * [Sec 1144] limited (two byte) buffer overflow in ntpq. CVE-2009-0159 Credit for finding this vulnerability goes to Geoff Keating of Apple. * [Sec 1149] use SO_EXCLUSIVEADDRUSE on Windows Credit for finding this issue goes to Dave Hart. This release fixes a number of bugs and adds some improvements: * Improved logging * Fix many compiler warnings * Many fixes and improvements for Windows * Adds support for AIX 6.1 * Resolves some issues under MacOS X and Solaris THIS IS A STRONGLY RECOMMENDED UPGRADE. --- NTP 4.2.4p6 (Harlan Stenn , 2009/01/07) Focus: Security Fix Severity: Low This release fixes oCERT.org's CVE-2009-0021, a vulnerability affecting the OpenSSL library relating to the incorrect checking of the return value of EVP_VerifyFinal function. Credit for finding this issue goes to the Google Security Team for finding the original issue with OpenSSL, and to ocert.org for finding the problem in NTP and telling us about it. This is a recommended upgrade. --- NTP 4.2.4p5 (Harlan Stenn , 2008/08/17) Focus: Minor Bugfixes This release fixes a number of Windows-specific ntpd bugs and platform-independent ntpdate bugs. A logging bugfix has been applied to the ONCORE driver. The "dynamic" keyword and is now obsolete and deferred binding to local interfaces is the new default. The minimum time restriction for the interface update interval has been dropped. A number of minor build system and documentation fixes are included. This is a recommended upgrade for Windows. --- NTP 4.2.4p4 (Harlan Stenn , 2007/09/10) Focus: Minor Bugfixes This release updates certain copyright information, fixes several display bugs in ntpdc, avoids SIGIO interrupting malloc(), cleans up file descriptor shutdown in the parse refclock driver, removes some lint from the code, stops accessing certain buffers immediately after they were freed, fixes a problem with non-command-line specification of -6, and allows the loopback interface to share addresses with other interfaces. --- NTP 4.2.4p3 (Harlan Stenn , 2007/06/29) Focus: Minor Bugfixes This release fixes a bug in Windows that made it difficult to terminate ntpd under windows. This is a recommended upgrade for Windows. --- NTP 4.2.4p2 (Harlan Stenn , 2007/06/19) Focus: Minor Bugfixes This release fixes a multicast mode authentication problem, an error in NTP packet handling on Windows that could lead to ntpd crashing, and several other minor bugs. Handling of multicast interfaces and logging configuration were improved. The required versions of autogen and libopts were incremented. This is a recommended upgrade for Windows and multicast users. --- NTP 4.2.4 (Harlan Stenn , 2006/12/31) Focus: enhancements and bug fixes. Dynamic interface rescanning was added to simplify the use of ntpd in conjunction with DHCP. GNU AutoGen is used for its command-line options processing. Separate PPS devices are supported for PARSE refclocks, MD5 signatures are now provided for the release files. Drivers have been added for some new ref-clocks and have been removed for some older ref-clocks. This release also includes other improvements, documentation and bug fixes. K&R C is no longer supported as of NTP-4.2.4. We are now aiming for ANSI C support. --- NTP 4.2.0 (Harlan Stenn , 2003/10/15) Focus: enhancements and bug fixes. ntp-4.2.6p5/flock-build0000755000175000017500000000570211336477343013751 0ustar peterpeter#! /bin/sh IAM=`hostname || uname -n` MYNAME=`IFS=. ; set $IAM ; echo $1` case "$1" in '--one'|'-1') shift FB_FIRSTONLY=1 LIST=$MYNAME ;; *) FB_FIRSTONLY=0 esac BUILD_ARGS="$@" PARSE="--enable-parse-clocks" #PARSE= STD="--enable-simulator" case "$SIMUL::$FB_FIRSTONLY" in ::*) PARALLEL_BUILDS=1 ;; *::0) PARALLEL_BUILDS=$SIMUL ;; *) PARALLEL_BUILDS=1 esac case "$PARALLEL_BUILDS" in 1) ;; *) echo Launching $PARALLEL_BUILDS parallel builds on each machine esac # Backroom: # barnstable freebsd-6.1 # beauregard freebsd-6.0 # X churchy alpha-dec-osf5.1 # deacon sparc-sun-solaris2.10 # grundoon freebsd-6.2 # howland freebsd-6.1 # o macabre freebsd-6.1-STABLE # o mort freebsd-6.1 # whimsy sparc-sun-solaris2.10 # Campus: # * baldwin sparc-sun-solaris2.10 # * bridgeport sparc-sun-solaris2.10 # * malarky sparc-sun-solaris2.10 # * pogo sparc-sun-solaris2.10 # * rackety freebsd-6.1 # HMS: we need $PWD because solaris produces /deacon/backroom when # we are in /backroom and in general there is no /deacon/backroom. c_d=${PWD:-`pwd`} SIG=`perl -e 'print rand'` case "$LIST" in '') LIST="malarky rackety" ;; esac for i in $LIST do SKIPTHIS=0 [ -f .buildkey-$i ] && SKIPTHIS=1 case "$SKIPTHIS" in 1) echo flock-build running on $i? check LIST, skipping ;; 0) echo $i echo $SIG > .buildkey-$i case "1" in 0) ssh $i "cd $c_d ; ./build $SIG $PARSE $STD $BUILD_ARGS" & ssh $i "cd $c_d ; ./build $SIG $PARSE $STD --without-crypto $BUILD_ARGS" & ssh $i "cd $c_d ; ./build $SIG $STD --disable-all-clocks $BUILD_ARGS" & ;; 1) cat > .flockbuild-$i-$SIG <<-ENDQUOT #!/bin/sh # script uses job control and expects to be invoked # in a ssh session started with the -tt option, # which forces a pseudo-tty to be used. cd $c_d COUNT=0 ./build $SIG $PARSE $STD $BUILD_ARGS & COUNT=\`expr \$COUNT + 1\` echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait case $FB_FIRSTONLY in '0') ./build $SIG $PARSE $STD --disable-debugging $BUILD_ARGS & COUNT=\`expr \$COUNT + 1\` echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait ./build $SIG $PARSE $STD --without-crypto $BUILD_ARGS & COUNT=\`expr \$COUNT + 1\` echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait ./build $SIG $STD --disable-all-clocks $BUILD_ARGS & COUNT=\`expr \$COUNT + 1\` echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 wait esac echo \`date -u '+%H:%M:%S'\` $i flock-build $c_d done. rm .buildkey-$i ENDQUOT chmod +x .flockbuild-$i-$SIG ssh -tt $i "$c_d/.flockbuild-$i-$SIG ; \ rm $c_d/.flockbuild-$i-$SIG" 2>/dev/null & esac esac done echo `date -u '+%H:%M:%S'` flock-build launched ntp-4.2.6p5/libparse/0000755000175000017500000000000011710605402013406 5ustar peterpeterntp-4.2.6p5/libparse/data_mbg.c0000644000175000017500000002730211307651604015323 0ustar peterpeter/* * /src/NTP/REPOSITORY/ntp4-dev/libparse/data_mbg.c,v 4.8 2006/06/22 18:40:01 kardel RELEASE_20060622_A * * data_mbg.c,v 4.8 2006/06/22 18:40:01 kardel RELEASE_20060622_A * * $Created: Sun Jul 20 12:08:14 1997 $ * * Copyright (c) 1997-2005 by Frank Kardel ntp.org> * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #ifdef PARSESTREAM #define NEED_BOPS #include "ntp_string.h" #else #include #endif #include "ntp_types.h" #include "ntp_stdlib.h" #include "ntp_fp.h" #include "mbg_gps166.h" #include "binio.h" #include "ieee754io.h" static void get_mbg_tzname (unsigned char **, char *); static void mbg_time_status_str (char **, unsigned int, int); #if 0 /* no actual floats on Meinberg binary interface */ static offsets_t mbg_float = { 1, 0, 3, 2, 0, 0, 0, 0 }; /* byte order for meinberg floats */ #endif static offsets_t mbg_double = { 1, 0, 3, 2, 5, 4, 7, 6 }; /* byte order for meinberg doubles */ static int32 rad2deg_i = 57; static u_int32 rad2deg_f = 0x4BB834C7; /* 57.2957795131 == 180/PI */ void put_mbg_header( unsigned char **bufpp, 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); } void get_mbg_sw_rev( unsigned char **bufpp, SW_REV *sw_revp ) { sw_revp->code = get_lsb_short(bufpp); memcpy(sw_revp->name, *bufpp, sizeof(sw_revp->name)); *bufpp += sizeof(sw_revp->name); } void get_mbg_ascii_msg( unsigned char **bufpp, ASCII_MSG *ascii_msgp ) { ascii_msgp->csum = get_lsb_short(bufpp); ascii_msgp->valid = get_lsb_short(bufpp); memcpy(ascii_msgp->s, *bufpp, sizeof(ascii_msgp->s)); *bufpp += sizeof(ascii_msgp->s); } void get_mbg_svno( unsigned char **bufpp, SVNO *svnop ) { *svnop = get_lsb_short(bufpp); } void get_mbg_health( unsigned char **bufpp, HEALTH *healthp ) { *healthp = get_lsb_short(bufpp); } void get_mbg_cfg( unsigned char **bufpp, CFG *cfgp ) { *cfgp = get_lsb_short(bufpp); } void get_mbg_tgps( unsigned char **bufpp, T_GPS *tgpsp ) { tgpsp->wn = get_lsb_short(bufpp); tgpsp->sec = get_lsb_long(bufpp); tgpsp->tick = get_lsb_long(bufpp); } void get_mbg_tm( unsigned char **buffpp, TM *tmp ) { tmp->year = get_lsb_short(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->offs_from_utc = get_lsb_long(buffpp); tmp->status= get_lsb_short(buffpp); } void get_mbg_ttm( unsigned char **buffpp, TTM *ttmp ) { ttmp->channel = get_lsb_short(buffpp); get_mbg_tgps(buffpp, &ttmp->t); get_mbg_tm(buffpp, &ttmp->tm); } void get_mbg_synth( unsigned char **buffpp, SYNTH *synthp ) { synthp->freq = get_lsb_short(buffpp); synthp->range = get_lsb_short(buffpp); synthp->phase = get_lsb_short(buffpp); } static void get_mbg_tzname( unsigned char **buffpp, char *tznamep ) { strncpy(tznamep, (char *)*buffpp, sizeof(TZ_NAME)); *buffpp += sizeof(TZ_NAME); } void get_mbg_tzdl( unsigned char **buffpp, TZDL *tzdlp ) { tzdlp->offs = get_lsb_long(buffpp); tzdlp->offs_dl = get_lsb_long(buffpp); get_mbg_tm(buffpp, &tzdlp->tm_on); get_mbg_tm(buffpp, &tzdlp->tm_off); get_mbg_tzname(buffpp, (char *)tzdlp->name[0]); get_mbg_tzname(buffpp, (char *)tzdlp->name[1]); } void get_mbg_antinfo( unsigned char **buffpp, ANT_INFO *antinfop ) { antinfop->status = get_lsb_short(buffpp); get_mbg_tm(buffpp, &antinfop->tm_disconn); get_mbg_tm(buffpp, &antinfop->tm_reconn); antinfop->delta_t = get_lsb_long(buffpp); } static void mbg_time_status_str( char **buffpp, unsigned int status, int size ) { static struct state { int flag; /* bit flag */ const char *string; /* bit name */ } states[] = { { TM_UTC, "UTC CORR" }, { TM_LOCAL, "LOCAL TIME" }, { TM_DL_ANN, "DST WARN" }, { TM_DL_ENB, "DST" }, { TM_LS_ANN, "LEAP WARN" }, { TM_LS_ENB, "LEAP SEC" }, { 0, "" } }; if (status) { char *start, *p; struct state *s; start = p = *buffpp; for (s = states; s->flag; s++) { if (s->flag & status) { if (p != *buffpp) { strncpy(p, ", ", size - (p - start)); p += 2; } strncpy(p, s->string, size - (p - start)); p += strlen(p); } } *buffpp = p; } } void mbg_tm_str( char **buffpp, TM *tmp, int size ) { 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->offs_from_utc < 0) ? '-' : '+', abs(tmp->offs_from_utc) / 3600, (abs(tmp->offs_from_utc) / 60) % 60); *buffpp += strlen(*buffpp); mbg_time_status_str(buffpp, tmp->status, size - (*buffpp - s)); } void mbg_tgps_str( char **buffpp, T_GPS *tgpsp, int size ) { snprintf(*buffpp, size, "week %d + %ld days + %ld.%07ld sec", tgpsp->wn, tgpsp->sec / 86400, tgpsp->sec % 86400, tgpsp->tick); *buffpp += strlen(*buffpp); } void get_mbg_cfgh( unsigned char **buffpp, CFGH *cfghp ) { int i; cfghp->csum = get_lsb_short(buffpp); cfghp->valid = get_lsb_short(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++) { get_mbg_cfg(buffpp, &cfghp->cfg[i]); } for (i = MIN_SVNO; i <= MAX_SVNO; i++) { get_mbg_health(buffpp, &cfghp->health[i]); } } void get_mbg_utc( unsigned char **buffpp, UTC *utcp ) { utcp->csum = get_lsb_short(buffpp); utcp->valid = get_lsb_short(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->delta_tls = *(*buffpp)++; utcp->delta_tlsf = *(*buffpp)++; } void get_mbg_lla( unsigned char **buffpp, LLA lla ) { int i; for (i = LAT; i <= ALT; i++) { if (fetch_ieee754(buffpp, IEEE_DOUBLE, &lla[i], mbg_double) != IEEE_OK) { L_CLR(&lla[i]); } else if (i != ALT) { /* convert to degrees (* 180/PI) */ mfp_mul(&lla[i].l_i, &lla[i].l_uf, lla[i].l_i, lla[i].l_uf, rad2deg_i, rad2deg_f); } } } void get_mbg_xyz( unsigned char **buffpp, XYZ xyz ) { int i; for (i = XP; i <= ZP; i++) { if (fetch_ieee754(buffpp, IEEE_DOUBLE, &xyz[i], mbg_double) != IEEE_OK) { L_CLR(&xyz[i]); } } } static void get_mbg_comparam( unsigned char **buffpp, COM_PARM *comparamp ) { int 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); } void get_mbg_portparam( unsigned char **buffpp, PORT_PARM *portparamp ) { int i; for (i = 0; i < N_COM; i++) { get_mbg_comparam(buffpp, &portparamp->com[i]); } for (i = 0; i < N_COM; i++) { portparamp->mode[i] = *(*buffpp)++; } } #define FETCH_DOUBLE(src, addr) \ if (fetch_ieee754(src, IEEE_DOUBLE, addr, mbg_double) != IEEE_OK) \ { \ 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); get_mbg_tgps(buffpp, &ephp->tt); get_mbg_tgps(buffpp, &ephp->t0c); get_mbg_tgps(buffpp, &ephp->t0e); FETCH_DOUBLE(buffpp, &ephp->sqrt_A); FETCH_DOUBLE(buffpp, &ephp->e); FETCH_DOUBLE(buffpp, &ephp->M0); FETCH_DOUBLE(buffpp, &ephp->omega); FETCH_DOUBLE(buffpp, &ephp->OMEGA0); FETCH_DOUBLE(buffpp, &ephp->OMEGADOT); FETCH_DOUBLE(buffpp, &ephp->deltan); FETCH_DOUBLE(buffpp, &ephp->i0); FETCH_DOUBLE(buffpp, &ephp->idot); FETCH_DOUBLE(buffpp, &ephp->crc); FETCH_DOUBLE(buffpp, &ephp->crs); FETCH_DOUBLE(buffpp, &ephp->cuc); FETCH_DOUBLE(buffpp, &ephp->cus); FETCH_DOUBLE(buffpp, &ephp->cic); FETCH_DOUBLE(buffpp, &ephp->cis); FETCH_DOUBLE(buffpp, &ephp->af0); FETCH_DOUBLE(buffpp, &ephp->af1); FETCH_DOUBLE(buffpp, &ephp->af2); FETCH_DOUBLE(buffpp, &ephp->tgd); ephp->URA = get_lsb_short(buffpp); ephp->L2code = *(*buffpp)++; ephp->L2flag = *(*buffpp)++; } void get_mbg_alm( unsigned char **buffpp, ALM *almp ) { almp->csum = get_lsb_short(buffpp); almp->valid = get_lsb_short(buffpp); almp->health = get_lsb_short(buffpp); get_mbg_tgps(buffpp, &almp->t0a); FETCH_DOUBLE(buffpp, &almp->sqrt_A); FETCH_DOUBLE(buffpp, &almp->e); FETCH_DOUBLE(buffpp, &almp->M0); FETCH_DOUBLE(buffpp, &almp->omega); FETCH_DOUBLE(buffpp, &almp->OMEGA0); FETCH_DOUBLE(buffpp, &almp->OMEGADOT); FETCH_DOUBLE(buffpp, &almp->deltai); FETCH_DOUBLE(buffpp, &almp->af0); FETCH_DOUBLE(buffpp, &almp->af1); } void get_mbg_iono( unsigned char **buffpp, IONO *ionop ) { ionop->csum = get_lsb_short(buffpp); ionop->valid = get_lsb_short(buffpp); FETCH_DOUBLE(buffpp, &ionop->alpha_0); FETCH_DOUBLE(buffpp, &ionop->alpha_1); FETCH_DOUBLE(buffpp, &ionop->alpha_2); FETCH_DOUBLE(buffpp, &ionop->alpha_3); FETCH_DOUBLE(buffpp, &ionop->beta_0); FETCH_DOUBLE(buffpp, &ionop->beta_1); FETCH_DOUBLE(buffpp, &ionop->beta_2); FETCH_DOUBLE(buffpp, &ionop->beta_3); } /* * data_mbg.c,v * Revision 4.8 2006/06/22 18:40:01 kardel * clean up signedness (gcc 4) * * Revision 4.7 2005/10/07 22:11:10 kardel * bounded buffer implementation * * Revision 4.6.2.1 2005/09/25 10:23:06 kardel * support bounded buffers * * Revision 4.6 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.5 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.3 1999/02/21 12:17:42 kardel * 4.91f reconcilation * * Revision 4.2 1998/06/14 21:09:39 kardel * Sun acc cleanup * * Revision 4.1 1998/05/24 08:02:06 kardel * trimmed version log * * Revision 4.0 1998/04/10 19:45:33 kardel * Start 4.0 release version numbering */ ntp-4.2.6p5/libparse/parse.c0000644000175000017500000005021611307651604014677 0ustar peterpeter/* * /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 * * PARSEKERNEL define switches between two personalities of the module * if PARSEKERNEL is defined this module can be used * as kernel module. In this case the time stamps will be * a struct timeval. * when PARSEKERNEL is not defined NTP time stamps will be used. * * Copyright (c) 1995-2005 by Frank Kardel ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #ifdef HAVE_CONFIG_H # include #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) #if !(defined(lint) || defined(__GNUC__)) static char rcsid[] = "parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A"; #endif #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "ntp_stdlib.h" #include "ntp_machine.h" #include "ntp.h" /* (get Y2KFixes definitions) Y2KFixes */ #include "parse.h" #ifndef PARSESTREAM # include #else # include "sys/parsestreams.h" #endif extern clockformat_t *clockformats[]; extern unsigned short nformats; static u_long timepacket (parse_t *); /* * strings support usually not in kernel - duplicated, but what the heck */ static int Strlen( register const char *s ) { register int c; c = 0; if (s) { while (*s++) { c++; } } return c; } static int Strcmp( register const char *s, register const char *t ) { register int c = 0; if (!s || !t || (s == t)) { return 0; } while (!(c = *s++ - *t++) && *s && *t) /* empty loop */; return c; } int parse_timedout( parse_t *parseio, timestamp_t *tstamp, struct timeval *del ) { struct timeval delta; #ifdef PARSEKERNEL delta.tv_sec = tstamp->tv.tv_sec - parseio->parse_lastchar.tv.tv_sec; delta.tv_usec = tstamp->tv.tv_usec - parseio->parse_lastchar.tv.tv_usec; if (delta.tv_usec < 0) { delta.tv_sec -= 1; delta.tv_usec += 1000000; } #else extern long tstouslo[]; extern long tstousmid[]; extern long tstoushi[]; l_fp delt; delt = tstamp->fp; L_SUB(&delt, &parseio->parse_lastchar.fp); TSTOTV(&delt, &delta); #endif if (timercmp(&delta, del, >)) { parseprintf(DD_PARSE, ("parse: timedout: TRUE\n")); return 1; } else { parseprintf(DD_PARSE, ("parse: timedout: FALSE\n")); return 0; } } /*ARGSUSED*/ int parse_ioinit( register parse_t *parseio ) { 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; parseio->parse_badformat = 0; parseio->parse_ioflags = PARSE_IO_CS7; /* usual unix default */ parseio->parse_index = 0; parseio->parse_ldsize = 0; return 1; } /*ARGSUSED*/ void parse_ioend( register parse_t *parseio ) { parseprintf(DD_PARSE, ("parse_ioend\n")); if (parseio->parse_pdata) FREE(parseio->parse_pdata, parseio->parse_plen); if (parseio->parse_data) FREE(parseio->parse_data, (unsigned)(parseio->parse_dsize * 2 + 2)); } unsigned int parse_restart( parse_t *parseio, unsigned int ch ) { unsigned int updated = PARSE_INP_SKIP; /* * re-start packet - timeout - overflow - start symbol */ if (parseio->parse_index) { /* * filled buffer - thus not end character found * do processing now */ parseio->parse_data[parseio->parse_index] = '\0'; memcpy(parseio->parse_ldata, parseio->parse_data, (unsigned)(parseio->parse_index+1)); 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 ) { /* * add to buffer */ if (parseio->parse_index < parseio->parse_dsize) { /* * collect into buffer */ parseprintf(DD_PARSE, ("parse: parse_addchar: buffer[%d] = 0x%x\n", parseio->parse_index, ch)); parseio->parse_data[parseio->parse_index++] = (char)ch; return PARSE_INP_SKIP; } else /* * buffer overflow - attempt to make the best of it */ return parse_restart(parseio, ch); } unsigned int parse_end( parse_t *parseio ) { /* * message complete processing */ parseio->parse_data[parseio->parse_index] = '\0'; memcpy(parseio->parse_ldata, parseio->parse_data, (unsigned)(parseio->parse_index+1)); parseio->parse_ldsize = parseio->parse_index; parseio->parse_index = 0; parseprintf(DD_PARSE, ("parse: parse_end: buffer end\n")); return PARSE_INP_TIME; } /*ARGSUSED*/ int parse_ioread( register parse_t *parseio, register unsigned int ch, register timestamp_t *tstamp ) { register unsigned 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. */ switch (parseio->parse_ioflags & PARSE_IO_CSIZE) { case PARSE_IO_CS5: ch &= 0x1F; break; case PARSE_IO_CS6: ch &= 0x3F; break; case PARSE_IO_CS7: ch &= 0x7F; break; case PARSE_IO_CS8: ch &= 0xFF; break; } parseprintf(DD_PARSE, ("parse_ioread(0x%lx, char=0x%x, ..., ...)\n", (unsigned long)parseio, ch & 0xFF)); if (!clockformats[parseio->parse_lformat]->convert) { parseprintf(DD_PARSE, ("parse_ioread: input dropped.\n")); return CVT_NONE; } if (clockformats[parseio->parse_lformat]->input) { unsigned long input_status; input_status = clockformats[parseio->parse_lformat]->input(parseio, ch, tstamp); if (input_status & PARSE_INP_SYNTH) { updated = CVT_OK; } if (input_status & PARSE_INP_TIME) /* time sample is available */ { updated = timepacket(parseio); } if (input_status & PARSE_INP_DATA) /* got additional data */ { updated |= CVT_ADDITIONAL; } } /* * remember last character time */ parseio->parse_lastchar = *tstamp; #ifdef DEBUG if ((updated & CVT_MASK) != CVT_NONE) { parseprintf(DD_PARSE, ("parse_ioread: time sample accumulated (status=0x%x)\n", updated)); } #endif parseio->parse_dtime.parse_status = updated; return (((updated & CVT_MASK) != CVT_NONE) || ((updated & CVT_ADDITIONAL) != 0)); } /* * parse_iopps * * take status line indication and derive synchronisation information * from it. * It can also be used to decode a serial serial data format (such as the * ONE, ZERO, MINUTE sync data stream from DCF77) */ /*ARGSUSED*/ int parse_iopps( register parse_t *parseio, register int status, register timestamp_t *ptime ) { register unsigned updated = CVT_NONE; /* * PPS pulse information will only be delivered to ONE clock format * this is either the last successful conversion module with a ppssync * routine, or a fixed format with a ppssync routine */ parseprintf(DD_PARSE, ("parse_iopps: STATUS %s\n", (status == SYNC_ONE) ? "ONE" : "ZERO")); if (clockformats[parseio->parse_lformat]->syncpps) { updated = clockformats[parseio->parse_lformat]->syncpps(parseio, status == SYNC_ONE, ptime); parseprintf(DD_PARSE, ("parse_iopps: updated = 0x%x\n", updated)); } return (updated & CVT_MASK) != CVT_NONE; } /* * parse_iodone * * clean up internal status for new round */ /*ARGSUSED*/ void parse_iodone( register parse_t *parseio ) { /* * we need to clean up certain flags for the next round */ parseprintf(DD_PARSE, ("parse_iodone: DONE\n")); parseio->parse_dtime.parse_state = 0; /* no problems with ISRs */ } /*---------- conversion implementation --------------------*/ /* * convert a struct clock to UTC since Jan, 1st 1970 0:00 (the UNIX EPOCH) */ #define days_per_year(x) ((x) % 4 ? 365 : ((x % 400) ? ((x % 100) ? 366 : 365) : 366)) time_t parse_to_unixtime( register clocktime_t *clock_time, register u_long *cvtrtc ) { #define SETRTC(_X_) { if (cvtrtc) *cvtrtc = (_X_); } 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 */ if ( clock_time->year < YEAR_PIVOT ) /* Y2KFixes [ */ clock_time->year += 100; /* convert 20xx%100 to 20xx-1900 */ if ( clock_time->year < YEAR_BREAK ) /* expand to full four-digits */ clock_time->year += 1900; if (clock_time->year < 1970 ) /* Y2KFixes ] */ { 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 */ if (clock_time->month <= 0 || clock_time->month > 12) { SETRTC(CVT_FAIL|CVT_BADDATE); return -1; /* bad month */ } #if 0 /* Y2KFixes */ /* adjust leap year */ if (clock_time->month < 3 && days_per_year(clock_time->year) == 366) t--; #else /* Y2KFixes [ */ if ( clock_time->month >= 3 && isleap_4(clock_time->year) ) t++; /* add one more if within leap year */ #endif /* Y2KFixes ] */ for (i = 1; i < clock_time->month; i++) { t += days_of_month[i]; } /* day */ if (clock_time->day < 1 || ((clock_time->month == 2 && days_per_year(clock_time->year) == 366) ? clock_time->day > 29 : clock_time->day > days_of_month[clock_time->month])) { SETRTC(CVT_FAIL|CVT_BADDATE); return -1; /* bad day */ } t += clock_time->day - 1; /* hour */ if (clock_time->hour < 0 || clock_time->hour >= 24) { SETRTC(CVT_FAIL|CVT_BADTIME); return -1; /* bad hour */ } t = TIMES24(t) + clock_time->hour; /* min */ if (clock_time->minute < 0 || clock_time->minute > 59) { SETRTC(CVT_FAIL|CVT_BADTIME); return -1; /* bad min */ } t = TIMES60(t) + clock_time->minute; /* sec */ if (clock_time->second < 0 || clock_time->second > 60) /* allow for LEAPs */ { SETRTC(CVT_FAIL|CVT_BADTIME); return -1; /* bad sec */ } t = TIMES60(t) + clock_time->second; t += clock_time->utcoffset; /* warp to UTC */ /* done */ clock_time->utctime = t; /* documentray only */ return t; } /*--------------- format conversion -----------------------------------*/ int Stoi( const unsigned char *s, long *zp, int cnt ) { char unsigned const *b = s; int f,z,v; char unsigned c; f=z=v=0; while(*s == ' ') s++; if (*s == '-') { s++; v = 1; } else if (*s == '+') s++; for(;;) { c = *s++; if (c == '\0' || c < '0' || c > '9' || (cnt && ((s-b) > cnt))) { if (f == 0) { return(-1); } if (v) z = -z; *zp = z; return(0); } z = (z << 3) + (z << 1) + ( c - '0' ); f=1; } } int Strok( const unsigned char *s, const unsigned char *m ) { if (!s || !m) return 0; while(*s && *m) { if ((*m == ' ') ? 1 : (*s == *m)) { s++; m++; } else { return 0; } } return !*m; } u_long updatetimeinfo( register parse_t *parseio, register u_long flags ) { #ifdef PARSEKERNEL { 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, parseio->parse_dtime.parse_time.tv.tv_sec)); #else 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... */ } /* * syn_simple * * handle a sync time stamp */ /*ARGSUSED*/ void syn_simple( register parse_t *parseio, register timestamp_t *ts, register struct format *format, register u_long why ) { parseio->parse_dtime.parse_stime = *ts; } /* * pps_simple * * handle a pps time stamp */ /*ARGSUSED*/ u_long pps_simple( register parse_t *parseio, register int status, register timestamp_t *ptime ) { parseio->parse_dtime.parse_ptime = *ptime; parseio->parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS; return CVT_NONE; } /* * pps_one * * handle a pps time stamp in ONE edge */ /*ARGSUSED*/ u_long pps_one( register parse_t *parseio, register int status, register timestamp_t *ptime ) { if (status) return pps_simple(parseio, status, ptime); return CVT_NONE; } /* * pps_zero * * handle a pps time stamp in ZERO edge */ /*ARGSUSED*/ u_long pps_zero( register parse_t *parseio, register int status, register timestamp_t *ptime ) { if (!status) return pps_simple(parseio, status, ptime); return CVT_NONE; } /* * timepacket * * process a data packet */ static u_long timepacket( register parse_t *parseio ) { register unsigned short format; 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) { 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; default: /* shouldn't happen */ #ifndef PARSEKERNEL msyslog(LOG_WARNING, "parse: INTERNAL error: bad return code of convert routine \"%s\"\n", clockformats[format]->name); #endif return CVT_FAIL|cvtrtc; } if ((t = parse_to_unixtime(&clock_time, &cvtrtc)) == -1) { return CVT_FAIL|cvtrtc; } /* * time stamp */ #ifdef PARSEKERNEL 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; TVUTOTSF(clock_time.usecond, parseio->parse_dtime.parse_time.fp.l_uf); #endif parseio->parse_dtime.parse_format = format; return updatetimeinfo(parseio, clock_time.flags); } /*ARGSUSED*/ int parse_timecode( parsectl_t *dct, parse_t *parse ) { dct->parsegettc.parse_state = parse->parse_lstate; dct->parsegettc.parse_format = parse->parse_lformat; /* * move out current bad packet count * user program is expected to sum these up * this is not a problem, as "parse" module are * exclusive open only */ dct->parsegettc.parse_badformat = parse->parse_badformat; parse->parse_badformat = 0; if (parse->parse_ldsize <= PARSE_TCMAX) { dct->parsegettc.parse_count = parse->parse_ldsize; memcpy(dct->parsegettc.parse_buffer, parse->parse_ldata, dct->parsegettc.parse_count); return 1; } else { return 0; } } /*ARGSUSED*/ int parse_setfmt( parsectl_t *dct, parse_t *parse ) { if (dct->parseformat.parse_count <= PARSE_TCMAX) { if (dct->parseformat.parse_count) { register unsigned short i; for (i = 0; i < nformats; i++) { if (!Strcmp(dct->parseformat.parse_buffer, clockformats[i]->name)) { 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) { parse->parse_pdata = MALLOC(parse->parse_plen); if (!parse->parse_pdata) { parseprintf(DD_PARSE, ("set format failed: malloc for private data area failed\n")); return 0; } memset((char *)parse->parse_pdata, 0, parse->parse_plen); } 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)); if (!parse->parse_data) { 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; } } } } return 0; } /*ARGSUSED*/ int parse_getfmt( parsectl_t *dct, parse_t *parse ) { 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; memcpy(dct->parseformat.parse_buffer, clockformats[dct->parseformat.parse_format]->name, dct->parseformat.parse_count); return 1; } else { return 0; } } /*ARGSUSED*/ int parse_setcs( parsectl_t *dct, parse_t *parse ) { parse->parse_ioflags &= ~PARSE_IO_CSIZE; parse->parse_ioflags |= dct->parsesetcs.parse_cs & PARSE_IO_CSIZE; return 1; } #else /* not (REFCLOCK && CLOCK_PARSE) */ int parse_bs; #endif /* not (REFCLOCK && CLOCK_PARSE) */ /* * History: * * parse.c,v * Revision 4.20 2005/08/06 17:39:40 kardel * cleanup size handling wrt/ to buffer boundaries * * Revision 4.19 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.18 2004/11/14 16:11:05 kardel * update Id tags * * Revision 4.17 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.14 1999/11/28 09:13:52 kardel * RECON_4_0_98F * * Revision 4.13 1999/02/28 11:50:20 kardel * (timepacket): removed unecessary code * * Revision 4.12 1999/02/21 12:17:44 kardel * 4.91f reconcilation * * Revision 4.11 1999/02/21 11:09:47 kardel * unified debug output * * Revision 4.10 1998/12/20 23:45:30 kardel * fix types and warnings * * Revision 4.9 1998/08/09 22:26:06 kardel * Trimble TSIP support * * Revision 4.8 1998/06/14 21:09:39 kardel * Sun acc cleanup * * Revision 4.7 1998/06/13 15:19:13 kardel * fix mem*() to b*() function macro emulation * * Revision 4.6 1998/06/13 13:24:13 kardel * printf fmt * * Revision 4.5 1998/06/13 13:01:10 kardel * printf fmt * * Revision 4.4 1998/06/13 12:12:10 kardel * bcopy/memcpy cleanup * fix SVSV name clash * * Revision 4.3 1998/06/12 15:22:30 kardel * fix prototypes * * Revision 4.2 1998/06/12 09:13:27 kardel * conditional compile macros fixed * printf prototype * * Revision 4.1 1998/05/24 09:39:55 kardel * implementation of the new IO handling model * * Revision 4.0 1998/04/10 19:45:36 kardel * Start 4.0 release version numbering * * from V3 3.46 log info deleted 1998/04/11 kardel */ ntp-4.2.6p5/libparse/clk_trimtaip.c0000644000175000017500000001522311307651603016245 0ustar peterpeter/* * /src/NTP/ntp4-dev/libparse/clk_trimtaip.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * clk_trimtaip.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * Trimble SV6 clock support - several collected codepieces * * Copyright (c) 1995-2005 by Frank Kardel ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #ifdef HAVE_CONFIG_H # include #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_TRIMTAIP) #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "parse.h" #ifndef PARSESTREAM #include "ntp_stdlib.h" #include #else #include "sys/parsestreams.h" extern int printf (const char *, ...); #endif /* 0000000000111111111122222222223333333 / char * 0123456789012345678901234567890123456 \ posn * >RTMhhmmssdddDDMMYYYYoodnnvrrrrr;*xx< Actual * ----33445566600112222BB7__-_____--99- Parse * >RTM 1 ;* <", Check */ #define hexval(x) (('0' <= (x) && (x) <= '9') ? (x) - '0' : \ ('a' <= (x) && (x) <= 'f') ? (x) - 'a' + 10 : \ ('A' <= (x) && (x) <= 'F') ? (x) - 'A' + 10 : \ -1) #define O_USEC O_WDAY #define O_GPSFIX O_FLAGS #define O_CHKSUM O_UTCHOFFSET static struct format trimsv6_fmt = { { { 13, 2 }, {15, 2}, { 17, 4}, /* Day, Month, Year */ { 4, 2 }, { 6, 2}, { 8, 2}, /* Hour, Minute, Second */ { 10, 3 }, {23, 1}, { 0, 0}, /* uSec, FIXes (WeekDAY, FLAGS, ZONE) */ { 34, 2 }, { 0, 0}, { 21, 2}, /* cksum, -, utcS (UTC[HMS]OFFSET) */ }, (const unsigned char *)">RTM 1 ;* <", 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 *); clockformat_t clock_trimtaip = { inp_trimtaip, /* no input handling */ cvt_trimtaip, /* Trimble conversion */ pps_one, /* easy PPS monitoring */ (void *)&trimsv6_fmt, /* conversion configuration */ "Trimble TAIP", 37, /* string buffer */ 0 /* no private data */ }; static unsigned long cvt_trimtaip( unsigned char *buffer, int size, struct format *format, clocktime_t *clock_time, void *local ) { long gpsfix; u_char calc_csum = 0; long recv_csum; int i; if (!Strok(buffer, format->fixed_string)) return CVT_NONE; #define OFFS(x) format->field_offsets[(x)].offset #define STOI(x, y) \ Stoi(&buffer[OFFS(x)], y, \ format->field_offsets[(x)].length) if ( STOI(O_DAY, &clock_time->day) || STOI(O_MONTH, &clock_time->month) || STOI(O_YEAR, &clock_time->year) || STOI(O_HOUR, &clock_time->hour) || STOI(O_MIN, &clock_time->minute) || STOI(O_SEC, &clock_time->second) || STOI(O_USEC, &clock_time->usecond)|| STOI(O_GPSFIX, &gpsfix) ) return CVT_FAIL|CVT_BADFMT; clock_time->usecond *= 1000; /* Check that the checksum is right */ for (i=OFFS(O_CHKSUM)-1; i >= 0; i--) calc_csum ^= buffer[i]; recv_csum = (hexval(buffer[OFFS(O_CHKSUM)]) << 4) | hexval(buffer[OFFS(O_CHKSUM)+1]); if (recv_csum < 0) return CVT_FAIL|CVT_BADTIME; if (((u_char) recv_csum) != calc_csum) return CVT_FAIL|CVT_BADTIME; clock_time->utcoffset = 0; /* What should flags be set to ? */ clock_time->flags = PARSEB_UTC; /* if the current GPS fix is 9 (unknown), reject */ if (0 > gpsfix || gpsfix > 9) clock_time->flags |= PARSEB_POWERUP; return CVT_OK; } /* * inp_trimtaip * * grep data from input stream */ static u_long inp_trimtaip( parse_t *parseio, unsigned int 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) return parse_end(parseio); else return rtc; default: return parse_addchar(parseio, ch); } } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_TRIMTAIP) */ int clk_trimtaip_bs; #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_TRIMTAIP) */ /* * History: * * clk_trimtaip.c,v * Revision 4.11 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.10 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.7 1999/11/28 09:13:51 kardel * RECON_4_0_98F * * Revision 4.6 1998/08/16 18:46:27 kardel * (clock_trimtaip =): changed format name * * Revision 4.5 1998/06/14 21:09:38 kardel * Sun acc cleanup * * Revision 4.4 1998/06/13 12:06:57 kardel * fix SYSV clock name clash * * Revision 4.3 1998/06/12 15:22:29 kardel * fix prototypes * * Revision 4.2 1998/06/12 09:13:26 kardel * conditional compile macros fixed * printf prototype * * Revision 4.1 1998/05/24 09:39:54 kardel * implementation of the new IO handling model * * Revision 4.0 1998/04/10 19:45:31 kardel * Start 4.0 release version numbering * * from V3 1.4 log info deleted 1998/04/11 kardel */ ntp-4.2.6p5/libparse/mkinfo_rcmd.sed0000644000175000017500000000033510017034562016376 0ustar peterpeter1i\ \ cmd_info_t trimble_rcmds[] = { s!^#define[ ][ ]*\(CMD_R[^ ]*\)[ ][ ]*\([^ ]*\)[ ][ ]*/\*[ ][ ]*\(.*\)[ ]*:\([^:]*\):\([^:]*\)[ ][ ]*\*/! { \1, "\1", "\3 (\2)", "\4", \5 },!p $a\ { 0xFF, "", "" }\ };\ ntp-4.2.6p5/libparse/binio.c0000644000175000017500000000753710441361236014672 0ustar peterpeter/* * /src/NTP/ntp4-dev/libntp/binio.c,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * binio.c,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * $Created: Sun Jul 20 12:55:33 1997 $ * * Copyright (c) 1997-2005 by Frank Kardel ntp.org> * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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 "binio.h" long get_lsb_short( unsigned char **bufpp ) { long retval; retval = *((*bufpp)++); retval |= *((*bufpp)++) << 8; return (retval & 0x8000) ? (~0xFFFF | retval) : retval; } void put_lsb_short( unsigned char **bufpp, long val ) { *((*bufpp)++) = (unsigned char) (val & 0xFF); *((*bufpp)++) = (unsigned char) ((val >> 8) & 0xFF); } long get_lsb_long( unsigned char **bufpp ) { long retval; retval = *((*bufpp)++); retval |= *((*bufpp)++) << 8; retval |= *((*bufpp)++) << 16; retval |= *((*bufpp)++) << 24; return retval; } void put_lsb_long( unsigned char **bufpp, long val ) { *((*bufpp)++) = (unsigned char)(val & 0xFF); *((*bufpp)++) = (unsigned char)((val >> 8) & 0xFF); *((*bufpp)++) = (unsigned char)((val >> 16) & 0xFF); *((*bufpp)++) = (unsigned char)((val >> 24) & 0xFF); } long get_msb_short( unsigned char **bufpp ) { long retval; retval = *((*bufpp)++) << 8; retval |= *((*bufpp)++); return (retval & 0x8000) ? (~0xFFFF | retval) : retval; } void put_msb_short( unsigned char **bufpp, long val ) { *((*bufpp)++) = (unsigned char)((val >> 8) & 0xFF); *((*bufpp)++) = (unsigned char)( val & 0xFF); } long get_msb_long( unsigned char **bufpp ) { long retval; retval = *((*bufpp)++) << 24; retval |= *((*bufpp)++) << 16; retval |= *((*bufpp)++) << 8; retval |= *((*bufpp)++); return retval; } void put_msb_long( unsigned char **bufpp, long val ) { *((*bufpp)++) = (unsigned char)((val >> 24) & 0xFF); *((*bufpp)++) = (unsigned char)((val >> 16) & 0xFF); *((*bufpp)++) = (unsigned char)((val >> 8 ) & 0xFF); *((*bufpp)++) = (unsigned char)( val & 0xFF); } /* * binio.c,v * Revision 4.2 1999/02/21 12:17:34 kardel * 4.91f reconcilation * * Revision 4.1 1998/06/28 16:47:50 kardel * added {get,put}_msb_{short,long} functions * * Revision 4.0 1998/04/10 19:46:16 kardel * Start 4.0 release version numbering * * Revision 1.1 1998/04/10 19:27:46 kardel * initial NTP VERSION 4 integration of PARSE with GPS166 binary support * * Revision 1.1 1997/10/06 21:05:46 kardel * new parse structure * */ ntp-4.2.6p5/libparse/trim_info.c0000644000175000017500000000462710441361246015556 0ustar peterpeter/* * /src/NTP/ntp4-dev/libparse/trim_info.c,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * trim_info.c,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * $Created: Sun Aug 2 20:20:34 1998 $ * * Copyright (c) 1995-2005 by Frank Kardel ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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 "ntp_types.h" #include "trimble.h" cmd_info_t * trimble_convert( unsigned int cmd, cmd_info_t *tbl ) { int i; for (i = 0; tbl[i].cmd != 0xFF; i++) { if (tbl[i].cmd == cmd) return &tbl[i]; } return 0; } /* * trim_info.c,v * Revision 4.5 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.4 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.2 1998/12/20 23:45:31 kardel * fix types and warnings * * Revision 4.1 1998/08/09 22:27:48 kardel * Trimble TSIP support * */ ntp-4.2.6p5/libparse/Makefile.in0000644000175000017500000006377611675460277015521 0ustar peterpeter# 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@ EXTRA_PROGRAMS = parsestreams$(EXEEXT) parsesolaris$(EXEEXT) DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depsver.mf subdir = libparse ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/define_dir.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_cacheversion.m4 \ $(top_srcdir)/m4/ntp_dir_sep.m4 \ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \ $(top_srcdir)/m4/ntp_openssl.m4 \ $(top_srcdir)/m4/ntp_vpathhack.m4 \ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libparse_a_AR = $(AR) $(ARFLAGS) libparse_a_LIBADD = am__objects_1 = am_libparse_a_OBJECTS = parse.$(OBJEXT) parse_conf.$(OBJEXT) \ clk_meinberg.$(OBJEXT) clk_schmid.$(OBJEXT) \ clk_rawdcf.$(OBJEXT) clk_trimtsip.$(OBJEXT) \ clk_dcf7000.$(OBJEXT) clk_trimtaip.$(OBJEXT) \ clk_rcc8000.$(OBJEXT) clk_hopf6021.$(OBJEXT) \ clk_computime.$(OBJEXT) clk_wharton.$(OBJEXT) \ clk_varitext.$(OBJEXT) data_mbg.$(OBJEXT) \ info_trimble.$(OBJEXT) trim_info.$(OBJEXT) binio.$(OBJEXT) \ ieee754io.$(OBJEXT) mfp_mul.$(OBJEXT) gpstolfp.$(OBJEXT) \ $(am__objects_1) libparse_a_OBJECTS = $(am_libparse_a_OBJECTS) libparse_kernel_a_AR = $(AR) $(ARFLAGS) am__DEPENDENCIES_1 = libparse_kernel_a_DEPENDENCIES = kparse.o kparse_conf.o \ kclk_computime.o kclk_dcf7000.o kclk_hopf6021.o \ kclk_meinberg.o kclk_rawdcf.o kclk_rcc8000.o kclk_schmid.o \ kclk_trimtaip.o kclk_trimtsip.o kclk_varitext.o kclk_wharton.o \ kbinio.o kieee754io.o kmfp_mul.o kgpstolfp.o \ $(am__DEPENDENCIES_1) am_libparse_kernel_a_OBJECTS = libparse_kernel_a_OBJECTS = $(am_libparse_kernel_a_OBJECTS) PROGRAMS = $(noinst_PROGRAMS) parsesolaris_SOURCES = parsesolaris.c parsesolaris_OBJECTS = parsesolaris.$(OBJEXT) parsesolaris_LDADD = $(LDADD) parsestreams_SOURCES = parsestreams.c parsestreams_OBJECTS = parsestreams.$(OBJEXT) parsestreams_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libparse_a_SOURCES) $(libparse_kernel_a_SOURCES) \ parsesolaris.c parsestreams.c DIST_SOURCES = $(libparse_a_SOURCES) $(libparse_kernel_a_SOURCES) \ parsesolaris.c parsestreams.c ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ 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@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SH = @PATH_SH@ PATH_TEST = @PATH_TEST@ POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CFLAGS = @SNMP_CFLAGS@ SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ SNMP_LIBS = @SNMP_LIBS@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ VERSION = @VERSION@ 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_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 = #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies AUTOMAKE_OPTIONS = BUILT_SOURCES = .deps-ver noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@ EXTRA_LIBRARIES = libparse.a libparse_kernel.a noinst_PROGRAMS = @MAKE_PARSEKMODULE@ CLEANFILES = libparse.a libparse_kernel.a info_trimble.c .deps-ver K_CFLAGS = -DPARSESTREAM -DNTP_NEED_BOPS libparse_a_SOURCES = parse.c \ parse_conf.c \ clk_meinberg.c \ clk_schmid.c \ clk_rawdcf.c \ clk_trimtsip.c \ clk_dcf7000.c \ clk_trimtaip.c \ clk_rcc8000.c \ clk_hopf6021.c \ clk_computime.c \ clk_wharton.c \ clk_varitext.c \ data_mbg.c \ info_trimble.c \ trim_info.c \ binio.c \ ieee754io.c \ mfp_mul.c \ gpstolfp.c \ $(NULL) libparse_kernel_a_SOURCES = libparse_kernel_a_LIBADD = \ kparse.o \ kparse_conf.o \ kclk_computime.o \ kclk_dcf7000.o \ kclk_hopf6021.o \ kclk_meinberg.o \ kclk_rawdcf.o \ kclk_rcc8000.o \ kclk_schmid.o \ kclk_trimtaip.o \ kclk_trimtsip.o \ kclk_varitext.o \ kclk_wharton.o \ kbinio.o \ kieee754io.o \ kmfp_mul.o \ kgpstolfp.o \ $(NULL) INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include -I$(top_srcdir)/kernel ETAGS_ARGS = Makefile.am EXTRA_DIST = parsesolaris.c parsestreams.c mkinfo_scmd.sed mkinfo_rcmd.sed info_trimble.c all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(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 libparse/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libparse/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): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libparse.a: $(libparse_a_OBJECTS) $(libparse_a_DEPENDENCIES) -rm -f libparse.a $(libparse_a_AR) libparse.a $(libparse_a_OBJECTS) $(libparse_a_LIBADD) $(RANLIB) libparse.a libparse_kernel.a: $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_DEPENDENCIES) -rm -f libparse_kernel.a $(libparse_kernel_a_AR) libparse_kernel.a $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_LIBADD) $(RANLIB) libparse_kernel.a clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list parsesolaris$(EXEEXT): $(parsesolaris_OBJECTS) $(parsesolaris_DEPENDENCIES) @rm -f parsesolaris$(EXEEXT) $(LINK) $(parsesolaris_OBJECTS) $(parsesolaris_LDADD) $(LIBS) parsestreams$(EXEEXT): $(parsestreams_OBJECTS) $(parsestreams_DEPENDENCIES) @rm -f parsestreams$(EXEEXT) $(LINK) $(parsestreams_OBJECTS) $(parsestreams_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_computime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_dcf7000.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_hopf6021.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_meinberg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_rawdcf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_rcc8000.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_schmid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_trimtaip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_trimtsip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_varitext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_wharton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_mbg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpstolfp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ieee754io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info_trimble.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mfp_mul.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_conf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsesolaris.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsestreams.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trim_info.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES clean-noinstPROGRAMS ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am # # create info_trimble.c # info_trimble.c: $(top_srcdir)/include/trimble.h mkinfo_rcmd.sed mkinfo_scmd.sed @rm -f $@ sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > $@ || rm -f $@ sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> $@ || rm -f $@ kieee754io.o: ieee754io.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/ieee754io.c -o $@ kmfp_mul.o: mfp_mul.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/mfp_mul.c -o $@ kgpstolfp.o: gpstolfp.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/gpstolfp.c -o $@ kbinio.o: binio.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/binio.c -o $@ kclk_computime.o: clk_computime.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_computime.c -o $@ kclk_computime_.o: clk_computime_.c $(COMPILE) $(K_CFLAGS) -c clk_computime_.c -o $@ kclk_dcf7000.o: clk_dcf7000.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_dcf7000.c -o $@ kclk_dcf7000_.o: clk_dcf7000_.c $(COMPILE) $(K_CFLAGS) -c clk_dcf7000_.c -o $@ kclk_hopf6021.o: clk_hopf6021.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_hopf6021.c -o $@ kclk_hopf6021_.o: clk_hopf6021_.c $(COMPILE) $(K_CFLAGS) -c clk_hopf6021_.c -o $@ kclk_meinberg.o: clk_meinberg.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_meinberg.c -o $@ kclk_meinberg_.o: clk_meinberg_.c $(COMPILE) $(K_CFLAGS) -c clk_meinberg_.c -o $@ kclk_rawdcf.o: clk_rawdcf.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_rawdcf.c -o $@ kclk_rawdcf_.o: clk_rawdcf_.c $(COMPILE) $(K_CFLAGS) -c clk_rawdcf_.c -o $@ kclk_rcc8000.o: clk_rcc8000.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_rcc8000.c -o $@ kclk_rcc8000_.o: clk_rcc8000_.c $(COMPILE) $(K_CFLAGS) -c clk_rcc8000_.c -o $@ kclk_schmid.o: clk_schmid.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_schmid.c -o $@ kclk_schmid_.o: clk_schmid_.c $(COMPILE) $(K_CFLAGS) -c clk_schmid_.c -o $@ kclk_trimtaip.o: clk_trimtaip.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_trimtaip.c -o $@ kclk_trimtaip_.o: clk_trimtaip_.c $(COMPILE) $(K_CFLAGS) -c clk_trimtaip_.c -o $@ kclk_trimtsip.o: clk_trimtsip.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_trimtsip.c -o $@ kclk_trimtsip_.o: clk_trimtsip_.c $(COMPILE) $(K_CFLAGS) -c clk_trimtsip_.c -o $@ kclk_varitext.o: clk_varitext.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_varitext.c -o $@ kclk_varitext_.o: clk_varitext_.c $(COMPILE) $(K_CFLAGS) -c clk_varitext_.c -o $@ kclk_wharton.o: clk_wharton.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_wharton.c -o $@ kclk_wharton_.o: clk_wharton_.c $(COMPILE) $(K_CFLAGS) -c clk_wharton_.c -o $@ kparse.o: parse.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/parse.c -o $@ kparse_.o: parse_.c $(COMPILE) $(K_CFLAGS) -c parse_.c -o $@ kparse_conf.o: parse_conf.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/parse_conf.c -o $@ kparse_conf_.o: parse_conf_.c $(COMPILE) $(K_CFLAGS) -c parse_conf_.c -o $@ parsestreams.loadable_module.o: $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a $(LD) -r -o $@ $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a parse: $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a $(LD) -r -o $@ $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a ../libntp/libntp.a: cd ../libntp && $(MAKE) parsesolaris.o: sys/systm.h sys/systm.h: mkdir sys && \ sed -e '/ffs(.*)/d' < /usr/include/sys/systm.h > sys/systm.h $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ chmod ug+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ $(MAKE) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ mkdir $(DEPDIR) && \ case "$(top_builddir)" in \ .) \ ./config.status Makefile depfiles \ ;; \ ..) \ cd .. && \ ./config.status $(subdir)/Makefile depfiles && \ cd $(subdir) \ ;; \ *) \ echo 'Fatal: depsver.mf Automake fragment limited' \ 'to immediate subdirectories.' && \ echo "top_builddir: $(top_builddir)" && \ echo "subdir: $(subdir)" && \ exit 1 \ ;; \ esac && \ echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver @touch $@ # # depsver.mf included in Makefile.am for directories with .deps # # When building in the same directory with sources that change over # time, such as when tracking using bk, the .deps files can become # stale with respect to moved, deleted, or superceded headers. Most # commonly, this would exhibit as make reporting a failure to make a # header file which is no longer in the location given. To address # this issue, we use a deps-ver file which is updated with each change # that breaks old .deps files. A copy of deps-ver is made into # $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present # with different contents than deps-ver, we make clean to ensure all # .o files built before the incompatible change are rebuilt along with # their updated .deps files, then remove $(DEPDIR) and recreate it as # empty stubs. # # It is normal when configured with --disable-dependency-tracking for # the DEPDIR to not have been created. For this reason, we use the # intermediate target .deps-ver, which invokes make recursively if # DEPDIR exists. # # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # # This comment block follows rather than leads the related code so that # it stays with it in the generated Makefile.in and Makefile. # # 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: ntp-4.2.6p5/libparse/clk_trimtsip.c0000644000175000017500000003264211307651603016273 0ustar peterpeter/* * /src/NTP/REPOSITORY/ntp4-dev/libparse/clk_trimtsip.c,v 4.19 2009/11/01 10:47:49 kardel RELEASE_20091101_A * * clk_trimtsip.c,v 4.19 2009/11/01 10:47:49 kardel RELEASE_20091101_A * * Trimble TSIP support * Thanks to Sven Dietrich for providing test hardware * * Copyright (c) 1995-2009 by Frank Kardel ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #ifdef HAVE_CONFIG_H # include #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_TRIMTSIP) #include "ntp_syslog.h" #include "ntp_types.h" #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "ntp_machine.h" #include "ntp_stdlib.h" #include "parse.h" #ifndef PARSESTREAM # include #else # include "sys/parsestreams.h" #endif #include "ascii.h" #include "binio.h" #include "ieee754io.h" #include "trimble.h" /* * Trimble low level TSIP parser / time converter * * The receiver uses a serial message protocol called Trimble Standard * Interface Protocol (it can support others but this driver only supports * TSIP). Messages in this protocol have the following form: * * ... ... * * Any bytes within the portion of value 10 hex () are doubled * on transmission and compressed back to one on reception. Otherwise * the values of data bytes can be anything. The serial interface is RS-422 * asynchronous using 9600 baud, 8 data bits with odd party (**note** 9 bits * in total!), and 1 stop bit. The protocol supports byte, integer, single, * and double datatypes. Integers are two bytes, sent most significant first. * Singles are IEEE754 single precision floating point numbers (4 byte) sent * sign & exponent first. Doubles are IEEE754 double precision floating point * numbers (8 byte) sent sign & exponent first. * The receiver supports a large set of messages, only a very small subset of * which is used here. * * From this module the following are recognised: * * ID Description * * 41 GPS Time * 46 Receiver health * 4F UTC correction data (used to get leap second warnings) * * All others are accepted but ignored for time conversion - they are passed up to higher layers. * */ static offsets_t trim_offsets = { 0, 1, 2, 3, 4, 5, 6, 7 }; struct trimble { u_char t_in_pkt; /* first DLE received */ u_char t_dle; /* subsequent DLE received */ u_short t_week; /* GPS week */ u_short t_weekleap; /* GPS week of next/last week */ u_short t_dayleap; /* day in week */ u_short t_gpsutc; /* GPS - UTC offset */ u_short t_gpsutcleap; /* offset at next/last leap */ u_char t_operable; /* receiver feels OK */ u_char t_mode; /* actual operating mode */ u_char t_leap; /* possible leap warning */ u_char t_utcknown; /* utc offset known */ }; #define STATUS_BAD 0 /* BAD or UNINITIALIZED receiver status */ #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 cvt_trimtsip (unsigned char *, int, struct format *, clocktime_t *, void *); struct clockformat clock_trimtsip = { inp_tsip, /* Trimble TSIP input handler */ cvt_trimtsip, /* Trimble TSIP conversion */ pps_one, /* easy PPS monitoring */ 0, /* no configuration data */ "Trimble TSIP", 400, /* input buffer */ sizeof(struct trimble) /* private data */ }; #define ADDSECOND 0x01 #define DELSECOND 0x02 static unsigned long inp_tsip( parse_t *parseio, unsigned int ch, timestamp_t *tstamp ) { struct trimble *t = (struct trimble *)parseio->parse_pdata; if (!t) return PARSE_INP_SKIP; /* local data not allocated - sigh! */ if (!t->t_in_pkt && ch != DLE) { /* wait for start of packet */ return PARSE_INP_SKIP; } if ((parseio->parse_index >= (parseio->parse_dsize - 2)) || (parseio->parse_dtime.parse_msglen >= (sizeof(parseio->parse_dtime.parse_msg) - 2))) { /* OVERFLOW - DROP! */ t->t_in_pkt = t->t_dle = 0; parseio->parse_index = 0; parseio->parse_dtime.parse_msglen = 0; return PARSE_INP_SKIP; } switch (ch) { case DLE: if (!t->t_in_pkt) { t->t_dle = 0; t->t_in_pkt = 1; parseio->parse_index = 0; parseio->parse_data[parseio->parse_index++] = ch; parseio->parse_dtime.parse_msglen = 0; parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch; parseio->parse_dtime.parse_stime = *tstamp; /* pick up time stamp at packet start */ } else if (t->t_dle) { /* Double DLE -> insert a DLE */ t->t_dle = 0; parseio->parse_data[parseio->parse_index++] = DLE; parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = DLE; } else t->t_dle = 1; break; case ETX: if (t->t_dle) { /* 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; 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; t->t_in_pkt = t->t_dle = 0; return PARSE_INP_TIME|PARSE_INP_DATA; } /*FALLTHROUGH*/ default: /* collect data */ t->t_dle = 0; parseio->parse_data[parseio->parse_index++] = ch; parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch; } return PARSE_INP_SKIP; } static int getshort( unsigned char *p ) { return get_msb_short(&p); } /* * cvt_trimtsip * * convert TSIP type format */ static unsigned long cvt_trimtsip( unsigned char *buffer, int size, struct format *format, clocktime_t *clock_time, void *local ) { register struct trimble *t = (struct trimble *)local; /* get local data space */ #define mb(_X_) (buffer[2+(_X_)]) /* shortcut for buffer access */ register u_char cmd; clock_time->flags = 0; if (!t) { return CVT_NONE; /* local data not allocated - sigh! */ } if ((size < 4) || (buffer[0] != DLE) || (buffer[size-1] != ETX) || (buffer[size-2] != DLE)) { printf("TRIMBLE BAD packet, size %d:\n", size); return CVT_NONE; } else { unsigned char *bp; cmd = buffer[1]; switch(cmd) { case CMD_RCURTIME: { /* GPS time */ l_fp secs; int week = getshort((unsigned char *)&mb(4)); l_fp utcoffset; l_fp gpstime; 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; } /* time OK */ /* fetch UTC offset */ 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, secs.l_ui, &gpstime); gpstime.l_uf = secs.l_uf; clock_time->utctime = gpstime.l_ui - JAN_1970; TSFTOTVU(gpstime.l_uf, clock_time->usecond); 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: clock_time->flags &= ~(PARSEB_POWERUP|PARSEB_NOSYNC); break; case STATUS_UNSAFE: clock_time->flags |= PARSEB_NOSYNC; break; case STATUS_BAD: 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 */ case CMD_RRECVHEALTH: { /* TRIMBLE health */ u_char status = mb(0); switch (status) { case 0x00: /* position fixes */ t->t_operable = STATUS_SYNC; break; case 0x09: /* 1 satellite */ case 0x0A: /* 2 satellites */ case 0x0B: /* 3 satellites */ t->t_operable = STATUS_UNSAFE; break; default: t->t_operable = STATUS_BAD; break; } t->t_mode = status; } break; case CMD_RUTCPARAM: { 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 */ 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 = 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 */ { /* generate a leap warning */ if (tlsf > tls) t->t_leap = ADDSECOND; else t->t_leap = DELSECOND; } else { t->t_leap = 0; } } break; default: /* it's validly formed, but we don't care about it! */ break; } } return CVT_SKIP; } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_TRIMTSIP && !PARSESTREAM) */ int clk_trimtsip_bs; #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_TRIMTSIP && !PARSESTREAM) */ /* * History: * * clk_trimtsip.c,v * Revision 4.19 2009/11/01 10:47:49 kardel * de-P() * * Revision 4.18 2009/11/01 08:46:46 kardel * clarify case FALLTHROUGH * * Revision 4.17 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.16 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.13 1999/11/28 09:13:51 kardel * RECON_4_0_98F * * Revision 4.12 1999/02/28 13:00:08 kardel * *** empty log message *** * * Revision 4.11 1999/02/28 11:47:54 kardel * (struct trimble): new member t_utcknown * (cvt_trimtsip): fixed status monitoring, bad receiver states are * now recognized * * Revision 4.10 1999/02/27 15:57:15 kardel * use mmemcpy instead of bcopy * * Revision 4.9 1999/02/21 12:17:42 kardel * 4.91f reconcilation * * Revision 4.8 1998/11/15 20:27:58 kardel * Release 4.0.73e13 reconcilation * * Revision 4.7 1998/08/16 18:49:20 kardel * (cvt_trimtsip): initial kernel capable version (no more floats) * (clock_trimtsip =): new format name * * Revision 4.6 1998/08/09 22:26:05 kardel * Trimble TSIP support * * Revision 4.5 1998/08/02 10:37:05 kardel * working TSIP parser * * Revision 4.4 1998/06/28 16:50:40 kardel * (getflt): fixed ENDIAN issue * (getdbl): fixed ENDIAN issue * (getint): use get_msb_short() * (cvt_trimtsip): use gpstolfp() for conversion * * Revision 4.3 1998/06/13 12:07:31 kardel * fix SYSV clock name clash * * Revision 4.2 1998/06/12 15:22:30 kardel * fix prototypes * * Revision 4.1 1998/05/24 09:39:54 kardel * implementation of the new IO handling model * * Revision 4.0 1998/04/10 19:45:32 kardel * Start 4.0 release version numbering * * from V3 1.8 loginfo deleted 1998/04/11 kardel */ ntp-4.2.6p5/libparse/clk_dcf7000.c0000644000175000017500000001374111307651603015462 0ustar peterpeter/* * /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 ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #ifdef HAVE_CONFIG_H # include #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_DCF7000) #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "parse.h" #ifndef PARSESTREAM #include "ntp_stdlib.h" #include #else #include "sys/parsestreams.h" extern int printf (const char *, ...); #endif static struct format dcf7000_fmt = { /* ELV DCF7000 */ { { 6, 2}, { 3, 2}, { 0, 2}, { 12, 2}, { 15, 2}, { 18, 2}, { 9, 2}, { 21, 2}, }, (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 *); clockformat_t clock_dcf7000 = { inp_dcf7000, /* DCF7000 input handling */ cvt_dcf7000, /* ELV DCF77 conversion */ 0, /* no direct PPS monitoring */ (void *)&dcf7000_fmt, /* conversion configuration */ "ELV DCF7000", /* ELV clock */ 24, /* string buffer */ 0 /* no private data (complete pakets) */ }; /* * cvt_dcf7000 * * convert dcf7000 type format */ static u_long cvt_dcf7000( unsigned char *buffer, int size, struct format *format, clocktime_t *clock_time, void *local ) { if (!Strok(buffer, format->fixed_string)) { return CVT_NONE; } else { if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day, format->field_offsets[O_DAY].length) || Stoi(&buffer[format->field_offsets[O_MONTH].offset], &clock_time->month, format->field_offsets[O_MONTH].length) || Stoi(&buffer[format->field_offsets[O_YEAR].offset], &clock_time->year, format->field_offsets[O_YEAR].length) || Stoi(&buffer[format->field_offsets[O_HOUR].offset], &clock_time->hour, format->field_offsets[O_HOUR].length) || 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)) { return CVT_FAIL|CVT_BADFMT; } else { unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset]; long flags; clock_time->flags = 0; clock_time->usecond = 0; if (Stoi(f, &flags, format->field_offsets[O_FLAGS].length)) { return CVT_FAIL|CVT_BADFMT; } else { if (flags & 0x1) clock_time->utcoffset = -2*60*60; else clock_time->utcoffset = -1*60*60; if (flags & 0x2) clock_time->flags |= PARSEB_ANNOUNCE; if (flags & 0x4) clock_time->flags |= PARSEB_NOSYNC; } return CVT_OK; } } } /* * inp_dcf700 * * grep data from input stream */ static u_long inp_dcf7000( parse_t *parseio, unsigned int ch, timestamp_t *tstamp ) { unsigned int rtc; parseprintf(DD_PARSE, ("inp_dcf7000(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); switch (ch) { case '\r': parseprintf(DD_PARSE, ("inp_dcf7000: EOL seen\n")); parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP) return parse_end(parseio); else return rtc; default: return parse_addchar(parseio, ch); } } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_DCF7000) */ int clk_dcf7000_bs; #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_DCF7000) */ /* * History: * * clk_dcf7000.c,v * Revision 4.10 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.9 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.6 1999/11/28 09:13:49 kardel * RECON_4_0_98F * * Revision 4.5 1998/06/14 21:09:34 kardel * Sun acc cleanup * * Revision 4.4 1998/06/13 12:01:59 kardel * fix SYSV clock name clash * * Revision 4.3 1998/06/12 15:22:27 kardel * fix prototypes * * Revision 4.2 1998/06/12 09:13:24 kardel * conditional compile macros fixed * printf prototype * * Revision 4.1 1998/05/24 09:39:51 kardel * implementation of the new IO handling model * * Revision 4.0 1998/04/10 19:45:28 kardel * Start 4.0 release version numbering * * from V3 3.18 log info deleted 1998/04/11 kardel */ ntp-4.2.6p5/libparse/info_trimble.c0000644000175000017500000001543211567111624016240 0ustar peterpeter/* * Automatically generated - do not modify */ #include "ntp_types.h" #include "ntpd.h" #include "trimble.h" cmd_info_t trimble_scmds[] = { { CMD_CCLROSC, "CMD_CCLROSC", "clear oscillator offset (0x1D)", "", 0 }, { CMD_CCLRRST, "CMD_CCLRRST", "clear battery backup and RESET (0x1E)", "", 0 }, { CMD_CVERSION, "CMD_CVERSION", "return software version (0x1F)", "", 0 }, { CMD_CALMANAC, "CMD_CALMANAC", "almanac (0x20)", "", 0 }, { CMD_CCURTIME, "CMD_CCURTIME", "current time (0x21)", "", 0 }, { CMD_CMODESEL, "CMD_CMODESEL", "mode select (2-d, 3-D, auto) (0x22)", "", 0 }, { CMD_CINITPOS, "CMD_CINITPOS", "initial position (0x23)", "", 0 }, { CMD_CRECVPOS, "CMD_CRECVPOS", "receiver position fix mode (0x24)", "", 0 }, { CMD_CRESET, "CMD_CRESET", "soft reset & selftest (0x25)", "", 0 }, { CMD_CRECVHEALTH, "CMD_CRECVHEALTH", "receiver health (0x26)", "", 0 }, { CMD_CSIGNALLV, "CMD_CSIGNALLV", "signal levels (0x27)", "", 0 }, { CMD_CMESSAGE, "CMD_CMESSAGE", "GPS system message (0x28)", "", 0 }, { CMD_CALMAHEALTH, "CMD_CALMAHEALTH", "almanac healt page (0x29)", "", 0 }, { CMD_C2DALTITUDE, "CMD_C2DALTITUDE", "altitude for 2-D mode (0x2A)", "", 0 }, { CMD_CINITPOSLLA, "CMD_CINITPOSLLA", "initial position LLA (0x2B)", "", 0 }, { CMD_COPERPARAM, "CMD_COPERPARAM", "operating parameters (0x2C)", "", 0 }, { CMD_COSCOFFSET, "CMD_COSCOFFSET", "oscillator offset (0x2D)", "", 0 }, { CMD_CSETGPSTIME, "CMD_CSETGPSTIME", "set GPS time (0x2E)", "", 0 }, { CMD_CUTCPARAM, "CMD_CUTCPARAM", "UTC parameters (0x2F)", "", 0 }, { CMD_CACCPOSXYZ, "CMD_CACCPOSXYZ", "accurate initial position (XYZ/ECEF) (0x31)", "", 0 }, { CMD_CACCPOS, "CMD_CACCPOS", "accurate initial position (0x32)", "", 0 }, { CMD_CANALOGDIG, "CMD_CANALOGDIG", "analog to digital (0x33)", "", 0 }, { CMD_CSAT1SAT, "CMD_CSAT1SAT", "satellite for 1-Sat mode (0x34)", "", 0 }, { CMD_CIOOPTIONS, "CMD_CIOOPTIONS", "I/O options (0x35)", "", 0 }, { CMD_CVELOCAID, "CMD_CVELOCAID", "velocity aiding of acquisition (0x36)", "", 0 }, { CMD_CSTATLSTPOS, "CMD_CSTATLSTPOS", "status and values of last pos. and vel. (0x37)", "", 0 }, { CMD_CLOADSSATDT, "CMD_CLOADSSATDT", "load satellite system data (0x38)", "", 0 }, { CMD_CSATDISABLE, "CMD_CSATDISABLE", "satellite disable (0x39)", "", 0 }, { CMD_CLASTRAW, "CMD_CLASTRAW", "last raw measurement (0x3A)", "", 0 }, { CMD_CSTATSATEPH, "CMD_CSTATSATEPH", "satellite ephemeris status (0x3B)", "", 0 }, { CMD_CSTATTRACK, "CMD_CSTATTRACK", "tracking status (0x3C)", "", 0 }, { CMD_CCHANADGPS, "CMD_CCHANADGPS", "configure channel A for differential GPS (0x3D)", "", 0 }, { CMD_CADDITFIX, "CMD_CADDITFIX", "additional fix data (0x3E)", "", 0 }, { CMD_CDGPSFIXMD, "CMD_CDGPSFIXMD", "set/request differential GPS position fix mode (0x62)", "", 0 }, { CMD_CDGPSCORR, "CMD_CDGPSCORR", "differential correction status (0x65)", "", 0 }, { CMD_CPOSFILT, "CMD_CPOSFILT", "position filter parameters (0x71)", "", 0 }, { CMD_CHEIGHTFILT, "CMD_CHEIGHTFILT", "height filter control (0x73)", "", 0 }, { CMD_CHIGH8CNT, "CMD_CHIGH8CNT", "high-8 (best 4) / high-6 (overdetermined) control (0x75)", "", 0 }, { CMD_CMAXDGPSCOR, "CMD_CMAXDGPSCOR", "maximum rate of DGPS corrections (0x77)", "", 0 }, { CMD_CSUPER, "CMD_CSUPER", "super paket (0x8E)", "", 0 }, { 0xFF, "", "" } }; cmd_info_t trimble_rcmds[] = { { CMD_RDATAA, "CMD_RDATAA", "data channel A configuration (0x3D)", "trimble_channelA", RO }, { CMD_RALMANAC, "CMD_RALMANAC", "almanac data for sat (0x40)", "gps_almanac", RO }, { CMD_RCURTIME, "CMD_RCURTIME", "GPS time (0x41)", "gps_time", RO }, { CMD_RSPOSXYZ, "CMD_RSPOSXYZ", "single precision XYZ position (0x42)", "gps_position(XYZ)", RO|DEF }, { CMD_RVELOXYZ, "CMD_RVELOXYZ", "velocity fix (XYZ ECEF) (0x43)", "gps_velocity(XYZ)", RO|DEF }, { CMD_RBEST4, "CMD_RBEST4", "best 4 satellite selection (0x44)", "trimble_best4", RO|DEF }, { CMD_RVERSION, "CMD_RVERSION", "software version (0x45)", "trimble_version", RO|DEF }, { CMD_RRECVHEALTH, "CMD_RRECVHEALTH", "receiver health (0x46)", "trimble_receiver_health", RO|DEF }, { CMD_RSIGNALLV, "CMD_RSIGNALLV", "signal levels of all satellites (0x47)", "trimble_signal_levels", RO }, { CMD_RMESSAGE, "CMD_RMESSAGE", "GPS system message (0x48)", "gps-message", RO|DEF }, { CMD_RALMAHEALTH, "CMD_RALMAHEALTH", "almanac health page for all satellites (0x49)", "gps_almanac_health", RO }, { CMD_RSLLAPOS, "CMD_RSLLAPOS", "single LLA position (0x4A)", "gps_position(LLA)", RO|DEF }, { CMD_RMACHSTAT, "CMD_RMACHSTAT", "machine code / status (0x4B)", "trimble_status", RO|DEF }, { CMD_ROPERPARAM, "CMD_ROPERPARAM", "operating parameters (0x4C)", "trimble_opparam", RO }, { CMD_ROSCOFFSET, "CMD_ROSCOFFSET", "oscillator offset (0x4D)", "trimble_oscoffset", RO }, { CMD_RSETGPSTIME, "CMD_RSETGPSTIME", "response to set GPS time (0x4E)", "trimble_setgpstime", RO }, { CMD_RUTCPARAM, "CMD_RUTCPARAM", "UTC parameters (0x4F)", "gps_utc_correction", RO|DEF }, { CMD_RANALOGDIG, "CMD_RANALOGDIG", "analog to digital (0x53)", "trimble_analogdigital", RO }, { CMD_RSAT1BIAS, "CMD_RSAT1BIAS", "one-satellite bias & bias rate (0x54)", "trimble_sat1bias", RO }, { CMD_RIOOPTIONS, "CMD_RIOOPTIONS", "I/O options (0x55)", "trimble_iooptions", RO }, { CMD_RSTATLSTFIX, "CMD_RSTATLSTFIX", "status and values of last pos. and vel. (0x57)", "trimble_status_lastpos", RO }, { CMD_RLOADSSATDT, "CMD_RLOADSSATDT", "response to load satellite system data (0x58)", "trimble_loaddata", RO }, { CMD_RSATDISABLE, "CMD_RSATDISABLE", "satellite disable (0x59)", "trimble_satdisble", RO }, { CMD_RLASTRAW, "CMD_RLASTRAW", "last raw measurement (0x5A)", "trimble_lastraw", RO }, { CMD_RSTATSATEPH, "CMD_RSTATSATEPH", "satellite ephemeris status (0x5B)", "trimble_ephstatus", RO }, { CMD_RSTATTRACK, "CMD_RSTATTRACK", "tracking status (0x5C)", "trimble_tracking_status", RO|DEF }, { CMD_RADDITFIX, "CMD_RADDITFIX", "additional fix data (0x5E)", "trimble_addfix", RO }, { CMD_RALLINVIEW, "CMD_RALLINVIEW", "all in view satellite selection (0x6D)", "trimble_satview", RO|DEF }, { CMD_RPOSFILT, "CMD_RPOSFILT", "position filter parameters (0x72)", "trimble_posfilt", RO }, { CMD_RHEIGHTFILT, "CMD_RHEIGHTFILT", "height filter control (0x74)", "trimble_heightfilt", RO }, { CMD_RHIGH8CNT, "CMD_RHIGH8CNT", "high-8 (best 4) / high-6 (overdetermined) control (0x76)", "trimble_high8control", RO }, { CMD_RMAXAGE, "CMD_RMAXAGE", "DC MaxAge (0x78)", "trimble_dgpsmaxage", RO }, { CMD_RDGPSFIX, "CMD_RDGPSFIX", "differential position fix mode (0x82)", "trimble_dgpsfixmode", RO }, { CMD_RDOUBLEXYZ, "CMD_RDOUBLEXYZ", "double precision XYZ (0x83)", "gps_position_ext(XYZ)", RO|DEF }, { CMD_RDOUBLELLA, "CMD_RDOUBLELLA", "double precision LLA (0x84)", "gps_position_ext(LLA)", RO|DEF }, { CMD_RDGPSSTAT, "CMD_RDGPSSTAT", "differential correction status (0x85)", "trimble_dgpsstatus", RO }, { CMD_RSUPER, "CMD_RSUPER", "super paket (0x8F)", "", 0 }, { 0xFF, "", "" } }; ntp-4.2.6p5/libparse/clk_hopf6021.c0000644000175000017500000001572211307651604015666 0ustar peterpeter/* * /src/NTP/ntp4-dev/libparse/clk_hopf6021.c,v 4.10 2004/11/14 15:29:41 kardel RELEASE_20050508_A * * clk_hopf6021.c,v 4.10 2004/11/14 15:29:41 kardel RELEASE_20050508_A * * Radiocode Clocks HOPF Funkuhr 6021 mit serieller Schnittstelle * base code version from 24th Nov 1995 - history at end * * Created by F.Schnekenbuehl from clk_rcc8000.c * Nortel DASA Network Systems GmbH, Department: ND250 * A Joint venture of Daimler-Benz Aerospace and Nortel * * 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. * */ #ifdef HAVE_CONFIG_H # include #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_HOPF6021) #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "ascii.h" #include "parse.h" #ifndef PARSESTREAM #include "ntp_stdlib.h" #include #else #include "sys/parsestreams.h" extern int printf (const char *, ...); #endif /* * hopf Funkuhr 6021 * used with 9600,8N1, * UTC ueber serielle Schnittstelle * Sekundenvorlauf ON * ETX zum Sekundenvorlauf ON * Datenstring 6021 * Ausgabe Uhrzeit und Datum * Senden mit Steuerzeichen * Senden sekuendlich */ /* * Type 6021 Serial Output format * * 000000000011111111 / char * 012345678901234567 \ position * sABHHMMSSDDMMYYnre Actual * C4110046231195 Parse * s enr Check * * s = STX (0x02), e = ETX (0x03) * n = NL (0x0A), r = CR (0x0D) * * A B - Status and weekday * * A - Status * * 8 4 2 1 * x x x 0 - no announcement * x x x 1 - Summertime - wintertime - summertime announcement * x x 0 x - Wintertime * x x 1 x - Summertime * 0 0 x x - Time/Date invalid * 0 1 x x - Internal clock used * 1 0 x x - Radio clock * 1 1 x x - Radio clock highprecision * * B - 8 4 2 1 * 0 x x x - MESZ/MEZ * 1 x x x - UTC * x 0 0 1 - Monday * x 0 1 0 - Tuesday * x 0 1 1 - Wednesday * x 1 0 0 - Thursday * x 1 0 1 - Friday * x 1 1 0 - Saturday * x 1 1 1 - Sunday */ #define HOPF_DSTWARN 0x01 /* DST switch warning */ #define HOPF_DST 0x02 /* DST in effect */ #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_RADIOHP 0x0C /* high precision radio clock */ #define HOPF_UTC 0x08 /* time code in UTC */ #define HOPF_WMASK 0x07 /* mask for weekday code */ static struct format hopf6021_fmt = { { { 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 }; #define OFFS(x) format->field_offsets[(x)].offset #define STOI(x, y) Stoi(&buffer[OFFS(x)], y, format->field_offsets[(x)].length) #define hexval(x) (('0' <= (x) && (x) <= '9') ? (x) - '0' : \ ('a' <= (x) && (x) <= 'f') ? (x) - 'a' + 10 : \ ('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 *); clockformat_t clock_hopf6021 = { inp_hopf6021, /* HOPF 6021 input handling */ cvt_hopf6021, /* Radiocode clock conversion */ 0, /* no direct PPS monitoring */ (void *)&hopf6021_fmt, /* conversion configuration */ "hopf Funkuhr 6021", /* clock format name */ 19, /* string buffer */ 0 /* private data length, no private data */ }; static unsigned long cvt_hopf6021( unsigned char *buffer, int size, struct format *format, clocktime_t *clock_time, void *local ) { unsigned char status,weekday; if (!Strok(buffer, format->fixed_string)) { return CVT_NONE; } if ( STOI(O_DAY, &clock_time->day) || STOI(O_MONTH, &clock_time->month) || STOI(O_YEAR, &clock_time->year) || STOI(O_HOUR, &clock_time->hour) || STOI(O_MIN, &clock_time->minute) || STOI(O_SEC, &clock_time->second) ) { return CVT_FAIL|CVT_BADFMT; } clock_time->usecond = 0; clock_time->utcoffset = 0; status = hexval(buffer[OFFS(O_FLAGS)]); weekday= hexval(buffer[OFFS(O_WDAY)]); if ((status == 0xFF) || (weekday == 0xFF)) { return CVT_FAIL|CVT_BADFMT; } clock_time->flags = 0; if (weekday & HOPF_UTC) { clock_time->flags |= PARSEB_UTC; } else { if (status & HOPF_DST) { clock_time->flags |= PARSEB_DST; clock_time->utcoffset = -2*60*60; /* MET DST */ } else { clock_time->utcoffset = -1*60*60; /* MET */ } } clock_time->flags |= (status & HOPF_DSTWARN) ? PARSEB_ANNOUNCE : 0; switch (status & HOPF_MODE) { case HOPF_INVALID: /* Time/Date invalid */ clock_time->flags |= PARSEB_POWERUP; break; case HOPF_INTERNAL: /* internal clock */ clock_time->flags |= PARSEB_NOSYNC; break; case HOPF_RADIO: /* Radio clock */ case HOPF_RADIOHP: /* Radio clock high precision */ break; default: return CVT_FAIL|CVT_BADFMT; } return CVT_OK; } /* * inp_hopf6021 * * grep data from input stream */ static u_long inp_hopf6021( parse_t *parseio, unsigned int ch, timestamp_t *tstamp ) { unsigned int rtc; parseprintf(DD_PARSE, ("inp_hopf6021(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); switch (ch) { case ETX: parseprintf(DD_PARSE, ("inp_hopf6021: EOL seen\n")); parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP) return parse_end(parseio); else return rtc; default: return parse_addchar(parseio, ch); } } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_HOPF6021) */ int clk_hopf6021_bs; #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_HOPF6021) */ /* * History: * * clk_hopf6021.c,v * Revision 4.10 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.7 1999/11/28 09:13:49 kardel * RECON_4_0_98F * * Revision 4.6 1998/11/15 20:27:57 kardel * Release 4.0.73e13 reconcilation * * Revision 4.5 1998/06/14 21:09:35 kardel * Sun acc cleanup * * Revision 4.4 1998/06/13 12:02:38 kardel * fix SYSV clock name clash * * Revision 4.3 1998/06/12 15:22:27 kardel * fix prototypes * * Revision 4.2 1998/06/12 09:13:25 kardel * conditional compile macros fixed * printf prototype * * Revision 4.1 1998/05/24 09:39:52 kardel * implementation of the new IO handling model * * Revision 4.0 1998/04/10 19:45:29 kardel * Start 4.0 release version numbering * * from V3 3.6 log info deleted 1998/04/11 kardel */ ntp-4.2.6p5/libparse/mfp_mul.c0000644000175000017500000001455710441361244015230 0ustar peterpeter/* * /src/NTP/ntp4-dev/libparse/mfp_mul.c,v 4.9 2005/07/17 20:34:40 kardel RELEASE_20050717_A * * mfp_mul.c,v 4.9 2005/07/17 20:34:40 kardel RELEASE_20050717_A * * $Created: Sat Aug 16 20:35:08 1997 $ * * Copyright (c) 1997-2005 by Frank Kardel ntp.org> * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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 #include "ntp_stdlib.h" #include "ntp_types.h" #include "ntp_fp.h" #define LOW_MASK (u_int32)((1<<(FRACTION_PREC/2))-1) #define HIGH_MASK (u_int32)(LOW_MASK << (FRACTION_PREC/2)) /* * for those who worry about overflows (possibly triggered by static analysis tools): * * Largest value of a 2^n bit number is 2^n-1. * Thus the result is: (2^n-1)*(2^n-1) = 2^2n - 2^n - 2^n + 1 < 2^2n * Here overflow can not happen for 2 reasons: * 1) the code actually multiplies the absolute values of two signed * 64bit quantities.thus effectively multiplying 2 63bit quantities. * 2) Carry propagation is from low to high, building principle is * addition, so no storage for the 2^2n term from above is needed. */ void mfp_mul( int32 *o_i, u_int32 *o_f, int32 a_i, u_int32 a_f, int32 b_i, u_int32 b_f ) { int32 i, j; u_int32 f; u_long a[4]; /* operand a */ u_long b[4]; /* operand b */ u_long c[5]; /* result c - 5 items for performance - see below */ u_long carry; int neg = 0; if (a_i < 0) /* examine sign situation */ { neg = 1; M_NEG(a_i, a_f); } if (b_i < 0) /* examine sign situation */ { neg = !neg; M_NEG(b_i, b_f); } a[0] = a_f & LOW_MASK; /* prepare a operand */ a[1] = (a_f & HIGH_MASK) >> (FRACTION_PREC/2); a[2] = a_i & LOW_MASK; a[3] = (a_i & HIGH_MASK) >> (FRACTION_PREC/2); b[0] = b_f & LOW_MASK; /* prepare b operand */ b[1] = (b_f & HIGH_MASK) >> (FRACTION_PREC/2); b[2] = b_i & LOW_MASK; b[3] = (b_i & HIGH_MASK) >> (FRACTION_PREC/2); c[0] = c[1] = c[2] = c[3] = c[4] = 0; for (i = 0; i < 4; i++) /* we do assume 32 * 32 = 64 bit multiplication */ for (j = 0; j < 4; j++) { u_long result_low, result_high; int low_index = (i+j)/2; /* formal [0..3] - index for low long word */ int mid_index = 1+low_index; /* formal [1..4]! - index for high long word will generate unecessary add of 0 to c[4] but save 15 'if (result_high) expressions' */ int high_index = 1+mid_index; /* formal [2..5]! - index for high word overflow - only assigned on overflow (limits range to 2..3) */ result_low = (u_long)a[i] * (u_long)b[j]; /* partial product */ if ((i+j) & 1) /* splits across two result registers */ { result_high = result_low >> (FRACTION_PREC/2); result_low <<= FRACTION_PREC/2; carry = (unsigned)1<<(FRACTION_PREC/2); } else { /* stays in a result register - except for overflows */ result_high = 0; carry = 1; } if (((c[low_index] >> 1) + (result_low >> 1) + ((c[low_index] & result_low & carry) != 0)) & (u_int32)((unsigned)1<<(FRACTION_PREC - 1))) { result_high++; /* propagate overflows */ } c[low_index] += result_low; /* add up partial products */ if (((c[mid_index] >> 1) + (result_high >> 1) + ((c[mid_index] & result_high & 1) != 0)) & (u_int32)((unsigned)1<<(FRACTION_PREC - 1))) { c[high_index]++; /* propagate overflows of high word sum */ } c[mid_index] += result_high; /* will add a 0 to c[4] once but saves 15 if conditions */ } #ifdef DEBUG if (debug > 6) printf("mfp_mul: 0x%04lx%04lx%04lx%04lx * 0x%04lx%04lx%04lx%04lx = 0x%08lx%08lx%08lx%08lx\n", a[3], a[2], a[1], a[0], b[3], b[2], b[1], b[0], c[3], c[2], c[1], c[0]); #endif if (c[3]) /* overflow */ { i = ((unsigned)1 << (FRACTION_PREC-1)) - 1; f = ~(unsigned)0; } else { /* take produkt - discarding extra precision */ i = c[2]; f = c[1]; } if (neg) /* recover sign */ { M_NEG(i, f); } *o_i = i; *o_f = f; #ifdef DEBUG if (debug > 6) printf("mfp_mul: %s * %s => %s\n", mfptoa((u_long)a_i, a_f, 6), mfptoa((u_long)b_i, b_f, 6), mfptoa((u_long)i, f, 6)); #endif } /* * History: * * mfp_mul.c,v * Revision 4.9 2005/07/17 20:34:40 kardel * correct carry propagation implementation * * Revision 4.8 2005/07/12 16:17:26 kardel * add explanation why we do not write into c[4] * * Revision 4.7 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.6 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.3 1999/02/21 12:17:37 kardel * 4.91f reconcilation * * Revision 4.2 1998/12/20 23:45:28 kardel * fix types and warnings * * Revision 4.1 1998/05/24 07:59:57 kardel * conditional debug support * * Revision 4.0 1998/04/10 19:46:38 kardel * Start 4.0 release version numbering * * Revision 1.1 1998/04/10 19:27:47 kardel * initial NTP VERSION 4 integration of PARSE with GPS166 binary support * * Revision 1.1 1997/10/06 21:05:46 kardel * new parse structure * */ ntp-4.2.6p5/libparse/Makefile.am0000644000175000017500000001133011313332147015442 0ustar peterpeterNULL= #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies AUTOMAKE_OPTIONS = BUILT_SOURCES = noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@ EXTRA_LIBRARIES = libparse.a libparse_kernel.a EXTRA_PROGRAMS = parsestreams parsesolaris noinst_PROGRAMS = @MAKE_PARSEKMODULE@ CLEANFILES = libparse.a libparse_kernel.a info_trimble.c K_CFLAGS = -DPARSESTREAM -DNTP_NEED_BOPS libparse_a_SOURCES = parse.c \ parse_conf.c \ clk_meinberg.c \ clk_schmid.c \ clk_rawdcf.c \ clk_trimtsip.c \ clk_dcf7000.c \ clk_trimtaip.c \ clk_rcc8000.c \ clk_hopf6021.c \ clk_computime.c \ clk_wharton.c \ clk_varitext.c \ data_mbg.c \ info_trimble.c \ trim_info.c \ binio.c \ ieee754io.c \ mfp_mul.c \ gpstolfp.c \ $(NULL) libparse_kernel_a_SOURCES = libparse_kernel_a_LIBADD = \ kparse.o \ kparse_conf.o \ kclk_computime.o \ kclk_dcf7000.o \ kclk_hopf6021.o \ kclk_meinberg.o \ kclk_rawdcf.o \ kclk_rcc8000.o \ kclk_schmid.o \ kclk_trimtaip.o \ kclk_trimtsip.o \ kclk_varitext.o \ kclk_wharton.o \ kbinio.o \ kieee754io.o \ kmfp_mul.o \ kgpstolfp.o \ $(NULL) INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include -I$(top_srcdir)/kernel ETAGS_ARGS = Makefile.am EXTRA_DIST = parsesolaris.c parsestreams.c mkinfo_scmd.sed mkinfo_rcmd.sed info_trimble.c # # create info_trimble.c # info_trimble.c: $(top_srcdir)/include/trimble.h mkinfo_rcmd.sed mkinfo_scmd.sed @rm -f $@ sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > $@ || rm -f $@ sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> $@ || rm -f $@ kieee754io.o: ieee754io.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/ieee754io.c -o $@ kmfp_mul.o: mfp_mul.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/mfp_mul.c -o $@ kgpstolfp.o: gpstolfp.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/gpstolfp.c -o $@ kbinio.o: binio.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/binio.c -o $@ kclk_computime.o: clk_computime.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_computime.c -o $@ kclk_computime_.o: clk_computime_.c $(COMPILE) $(K_CFLAGS) -c clk_computime_.c -o $@ kclk_dcf7000.o: clk_dcf7000.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_dcf7000.c -o $@ kclk_dcf7000_.o: clk_dcf7000_.c $(COMPILE) $(K_CFLAGS) -c clk_dcf7000_.c -o $@ kclk_hopf6021.o: clk_hopf6021.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_hopf6021.c -o $@ kclk_hopf6021_.o: clk_hopf6021_.c $(COMPILE) $(K_CFLAGS) -c clk_hopf6021_.c -o $@ kclk_meinberg.o: clk_meinberg.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_meinberg.c -o $@ kclk_meinberg_.o: clk_meinberg_.c $(COMPILE) $(K_CFLAGS) -c clk_meinberg_.c -o $@ kclk_rawdcf.o: clk_rawdcf.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_rawdcf.c -o $@ kclk_rawdcf_.o: clk_rawdcf_.c $(COMPILE) $(K_CFLAGS) -c clk_rawdcf_.c -o $@ kclk_rcc8000.o: clk_rcc8000.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_rcc8000.c -o $@ kclk_rcc8000_.o: clk_rcc8000_.c $(COMPILE) $(K_CFLAGS) -c clk_rcc8000_.c -o $@ kclk_schmid.o: clk_schmid.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_schmid.c -o $@ kclk_schmid_.o: clk_schmid_.c $(COMPILE) $(K_CFLAGS) -c clk_schmid_.c -o $@ kclk_trimtaip.o: clk_trimtaip.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_trimtaip.c -o $@ kclk_trimtaip_.o: clk_trimtaip_.c $(COMPILE) $(K_CFLAGS) -c clk_trimtaip_.c -o $@ kclk_trimtsip.o: clk_trimtsip.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_trimtsip.c -o $@ kclk_trimtsip_.o: clk_trimtsip_.c $(COMPILE) $(K_CFLAGS) -c clk_trimtsip_.c -o $@ kclk_varitext.o: clk_varitext.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_varitext.c -o $@ kclk_varitext_.o: clk_varitext_.c $(COMPILE) $(K_CFLAGS) -c clk_varitext_.c -o $@ kclk_wharton.o: clk_wharton.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_wharton.c -o $@ kclk_wharton_.o: clk_wharton_.c $(COMPILE) $(K_CFLAGS) -c clk_wharton_.c -o $@ kparse.o: parse.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/parse.c -o $@ kparse_.o: parse_.c $(COMPILE) $(K_CFLAGS) -c parse_.c -o $@ kparse_conf.o: parse_conf.c $(COMPILE) $(K_CFLAGS) -c $(srcdir)/parse_conf.c -o $@ kparse_conf_.o: parse_conf_.c $(COMPILE) $(K_CFLAGS) -c parse_conf_.c -o $@ parsestreams.loadable_module.o: $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a $(LD) -r -o $@ $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a parse: $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a $(LD) -r -o $@ $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a ../libntp/libntp.a: cd ../libntp && $(MAKE) parsesolaris.o: sys/systm.h sys/systm.h: mkdir sys && \ sed -e '/ffs(.*)/d' < /usr/include/sys/systm.h > sys/systm.h include $(top_srcdir)/depsver.mf ntp-4.2.6p5/libparse/clk_rcc8000.c0000644000175000017500000001217611307651603015477 0ustar peterpeter/* * /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 * * Created by R.E.Broughton from clk_trimtaip.c * * 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. * */ #if HAVE_CONFIG_H # include #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_RCC8000) #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "parse.h" #ifndef PARSESTREAM #include "ntp_stdlib.h" #include #else #include "sys/parsestreams.h" extern int printf (const char *, ...); #endif /* Type II Serial Output format * * 0000000000111111111122222222223 / char * 0123456789012345678901234567890 \ posn * HH:MM:SS.XYZ DD/MM/YY DDD W Prn Actual * 33 44 55 666 00 11 22 7 Parse * : : . / / rn Check * "15:50:36.534 30/09/94 273 5 A\x0d\x0a" * * DDD - Day of year number * W - Day of week number (Sunday is 0) * P is the Status. See comment below for details. */ #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 */ { 9, 3 }, {28, 1}, { 0, 0}, /* uSec, Status (Valid,Reject,BST,Leapyear) */ }, (const unsigned char *)" : : . / / \r\n", /*"15:50:36.534 30/09/94 273 5 A\x0d\x0a" */ 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 *); clockformat_t clock_rcc8000 = { inp_rcc8000, /* no input handling */ cvt_rcc8000, /* Radiocode clock conversion */ 0, /* no direct PPS monitoring */ (void *)&rcc8000_fmt, /* conversion configuration */ "Radiocode RCC8000", 31, /* string buffer */ 0 /* no private data */ }; static unsigned long cvt_rcc8000( unsigned char *buffer, int size, struct format *format, clocktime_t *clock_time, void *local ) { if (!Strok(buffer, format->fixed_string)) return CVT_NONE; #define OFFS(x) format->field_offsets[(x)].offset #define STOI(x, y) Stoi(&buffer[OFFS(x)], y, format->field_offsets[(x)].length) if ( STOI(O_DAY, &clock_time->day) || STOI(O_MONTH, &clock_time->month) || STOI(O_YEAR, &clock_time->year) || STOI(O_HOUR, &clock_time->hour) || STOI(O_MIN, &clock_time->minute) || STOI(O_SEC, &clock_time->second) || STOI(O_USEC, &clock_time->usecond) ) return CVT_FAIL|CVT_BADFMT; clock_time->usecond *= 1000; clock_time->utcoffset = 0; #define RCCP buffer[28] /* * buffer[28] is the ASCII representation of a hex character ( 0 through F ) * The four bits correspond to: * 8 - Valid Time * 4 - Reject Code * 2 - British Summer Time (receiver set to emit GMT all year.) * 1 - Leap year */ #define RCC8000_VALID 0x8 #define RCC8000_REJECT 0x4 #define RCC8000_BST 0x2 #define RCC8000_LEAPY 0x1 clock_time->flags = 0; if ( (RCCP >= '0' && RCCP <= '9') || (RCCP >= 'A' && RCCP <= 'F') ) { register int flag; flag = (RCCP >= '0' && RCCP <= '9' ) ? RCCP - '0' : RCCP - 'A' + 10; if (!(flag & RCC8000_VALID)) clock_time->flags |= PARSEB_POWERUP; clock_time->flags |= PARSEB_UTC; /* British special - guess why 8-) */ /* other flags not used */ } return CVT_OK; } /* * inp_rcc8000 * * grep data from input stream */ static u_long inp_rcc8000( parse_t *parseio, unsigned int ch, timestamp_t *tstamp ) { unsigned int rtc; parseprintf(DD_PARSE, ("inp_rcc8000(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); switch (ch) { case '\n': parseprintf(DD_PARSE, ("inp_rcc8000: EOL seen\n")); if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP) return parse_end(parseio); else return rtc; default: if (parseio->parse_index == 0) /* take sample at start of message */ { parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ } return parse_addchar(parseio, ch); } } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_RCC8000) */ int clk_rcc8000_bs; #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_RCC8000) */ /* * History: * * clk_rcc8000.c,v * Revision 4.9 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.6 1999/11/28 09:13:51 kardel * RECON_4_0_98F * * Revision 4.5 1998/06/14 21:09:38 kardel * Sun acc cleanup * * Revision 4.4 1998/06/13 12:05:02 kardel * fix SYSV clock name clash * * Revision 4.3 1998/06/12 15:22:29 kardel * fix prototypes * * Revision 4.2 1998/06/12 09:13:25 kardel * conditional compile macros fixed * printf prototype * * Revision 4.1 1998/05/24 09:39:53 kardel * implementation of the new IO handling model * * Revision 4.0 1998/04/10 19:45:30 kardel * Start 4.0 release version numbering * * from V3 3.5 log info deleted 1998/04/11 kardel */ ntp-4.2.6p5/libparse/README0000644000175000017500000001014110441361236014267 0ustar peterpeterPARSE reference clock driver: This directory contains the files making up the parser for the parse refclock driver. For reasonably sane clocks this refclock drivers allows a refclock implementation by just providing a conversion routine and the appropriate NTP parameters. Refclock support can run as low a 3k code with the parse refclock driver. The modules in here are designed to live in two worlds. In userlevel as part of the xntp daemon and in kernel land as part of a STREAMS module or, if someone gets to it, as part of a line discipline. Currently only SunOS4.x/SunOS5.x STREAMS are supported (volunteers for other vendors like HP?). This structure means, that refclock_parse can work with or without kernel support. Kernelsupport increases accuracy tremendingly. The current restriction of the parse driver is that it only supports SYSV type ttys and that kernel support is only available for Suns right now. Three kernel modules are part of this directory. These work only on SunOS (SunOS4 and SunOS5). SunOS4 (aka Solaris 1.x): parsestreams.loadable_module.o - standard parse module for SunOS 4 Both modules can be loaded via modload . SunOS5 (aka Solaris 2.x): parse - auto loadable streams module To install just drop "parse" into /kernel/strmod and start the daemon (SunOS5 will do the rest). The structure of the parse reference clock driver is as follows: ntpd - contains NTP implementation and calls a reference clock 127.127.8.x which is implemented by refclock_parse.c - which contains several refclock decriptions. These are selected by the x part of the refclock address. The lower two bits specify the device to use. Thus the value (x % 4) determines the device to open (/dev/refclock-0 - /dev/refclock-3). The kind of clock is selected by the mode parameter. This parameter selects the clock type which deterimines how I/O is done, the tty parameters and the NTP parameters. refclock_parse operates on an abstract reference clock that delivers time stamps and stati. Offsets and sychron- isation information is derived from this data and passed on to refclock_receive of xntp which uses that data for syncronisation. The abstract reference clock is generated by the parse* routines. They parse the incoming data stream from the clock and convert it to the appropriate time stamps. The data is also mapped int the abstract clock states POWERUP - clock has no valid phase and time code information NOSYNC - Time code is not confirmed, phase is probably ok. SYNC - Time code and phase are correct. A clock is trusted for a certain time (type parameter) when it leaves the SYNC state. This is derived from the observation that quite a few clocks can still generate good time code information when losing contact to their synchronisation source. When the clock does not reagain synchronisation in that trust period it will be deemed unsynchronised until it regains synchronisation. The same will happen if xntp sees the clock unsynchronised at startup. The upper bit of x specifies that all samples delivered from the clock should be used to discipline the NTP loopfilter. For clock with accurate once a second time information this means big improvements for time keeping. A prerequisite for passing on the time stamps to the loopfilter is, that the clock is in synchronised state. parse.c These are the general routines to parse the incoming data stream. Usually these routines should not require modification. clk_*.c These files hole the conversion code for the time stamps and the description how the time code can be parsed and where the time stamps are to be taken. If you want to add a new clock type this is the file you need to write in addition to mention it in parse_conf.c and setting up the NTP and TTY parameters in refclock_parse.c. Further information can be found in parse/README.parse and the various source files. Frank Kardel ntp-4.2.6p5/libparse/parsesolaris.c0000644000175000017500000006745711307651604016313 0ustar peterpeter/* * /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 ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #define _KERNEL /* it is a _KERNEL module */ #ifndef lint static char rcsid[] = "parsesolaris.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A"; #endif #include #include #include #include #include #include #include #include #include #include #include #ifdef __GNUC__ /* makes it compile on Solaris 2.6 - acc doesn't like it -- GREAT! */ #include #endif #include "ntp_fp.h" #include "parse.h" #include /*--------------- loadable driver section -----------------------------*/ static struct streamtab parseinfo; static struct fmodsw fmod_templ = { "parse", /* module name */ &parseinfo, /* module information */ D_NEW|D_MP|D_MTQPAIR, /* exclusive for q pair */ /* lock ptr */ }; extern struct mod_ops mod_strmodops; static struct modlstrmod modlstrmod = { &mod_strmodops, /* a STREAMS module */ "PARSE - NTP reference", /* name this baby - keep room for revision number */ &fmod_templ }; static struct modlinkage modlinkage = { MODREV_1, { &modlstrmod, NULL } }; /* * module management routines */ /*ARGSUSED*/ int _init( void ) { static char revision[] = "4.6"; char *s, *S; char *t; #ifndef lint t = rcsid; #endif /* * copy RCS revision into Drv_name * * are we forcing RCS here to do things it was not built for ? */ s = revision; if (*s == '$') { /* * skip "$Revision: " * if present. - not necessary on a -kv co (cvs export) */ while (*s && (*s != ' ')) { s++; } if (*s == ' ') s++; } 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)) { (void) strncpy(t, s, (unsigned)(S - s)); } } return (mod_install(&modlinkage)); } /*ARGSUSED*/ int _info( struct modinfo *modinfop ) { return (mod_info(&modlinkage, modinfop)); } /*ARGSUSED*/ int _fini( void ) { if (mod_remove(&modlinkage) != DDI_SUCCESS) { return EBUSY; } else return DDI_SUCCESS; } /*--------------- stream module definition ----------------------------*/ static int parseopen (queue_t *, dev_t *, int, int, cred_t *); static int parseclose (queue_t *, int); static int parsewput (queue_t *, mblk_t *); static int parserput (queue_t *, mblk_t *); static int parsersvc (queue_t *); static struct module_info driverinfo = { 0, /* module ID number */ fmod_templ.f_name, /* module name - why repeated here ? compat ?*/ 0, /* minimum accepted packet size */ INFPSZ, /* maximum accepted packet size */ 1, /* high water mark - flow control */ 0 /* low water mark - flow control */ }; static struct qinit rinit = /* read queue definition */ { parserput, /* put procedure */ parsersvc, /* service procedure */ parseopen, /* open procedure */ parseclose, /* close procedure */ NULL, /* admin procedure - NOT USED FOR NOW */ &driverinfo, /* information structure */ NULL /* statistics */ }; static struct qinit winit = /* write queue definition */ { parsewput, /* put procedure */ NULL, /* service procedure */ NULL, /* open procedure */ NULL, /* close procedure */ NULL, /* admin procedure - NOT USED FOR NOW */ &driverinfo, /* information structure */ NULL /* statistics */ }; static struct streamtab parseinfo = /* stream info element for parse driver */ { &rinit, /* read queue */ &winit, /* write queue */ NULL, /* read mux */ NULL /* write mux */ }; /*--------------- driver data structures ----------------------------*/ /* * we usually have an inverted signal - but you * can change this to suit your needs */ int cd_invert = 1; /* invert status of CD line - PPS support via CD input */ #ifdef PARSEDEBUG int parsedebug = ~0; #else int parsedebug = 0; #endif /*--------------- module implementation -----------------------------*/ #define TIMEVAL_USADD(_X_, _US_) do {\ (_X_)->tv_usec += (_US_);\ if ((_X_)->tv_usec >= 1000000)\ {\ (_X_)->tv_sec++;\ (_X_)->tv_usec -= 1000000;\ }\ } while (0) static int init_linemon (queue_t *); static void close_linemon (queue_t *, queue_t *); #define M_PARSE 0x0001 #define M_NOPARSE 0x0002 void ntp_memset( char *a, int x, int c ) { while (c-- > 0) *a++ = x; } static void pprintf( int lev, char *form, ... ) { va_list ap; va_start(ap, form); if (lev & parsedebug) vcmn_err(CE_CONT, form, ap); va_end(ap); } static int setup_stream( queue_t *q, int mode ) { register mblk_t *mp; pprintf(DD_OPEN,"parse: SETUP_STREAM - setting up stream for q=%x\n", q); mp = allocb(sizeof(struct stroptions), BPRI_MED); if (mp) { struct stroptions *str = (struct stroptions *)mp->b_wptr; str->so_flags = SO_READOPT|SO_HIWAT|SO_LOWAT|SO_ISNTTY; str->so_readopt = (mode == M_PARSE) ? RMSGD : RNORM; str->so_hiwat = (mode == M_PARSE) ? sizeof(parsetime_t) : 256; str->so_lowat = 0; mp->b_datap->db_type = M_SETOPTS; mp->b_wptr += sizeof(struct stroptions); if (!q) panic("NULL q - strange"); putnext(q, mp); return putctl1(WR(q)->q_next, M_CTL, (mode == M_PARSE) ? MC_SERVICEIMM : MC_SERVICEDEF); } else { pprintf(DD_OPEN, "parse: setup_stream - FAILED - no MEMORY for allocb\n"); return 0; } } /*ARGSUSED*/ static int parseopen( queue_t *q, dev_t *dev, int flag, int sflag, cred_t *credp ) { register parsestream_t *parse; static int notice = 0; 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"); return EIO; } if (q->q_ptr != (caddr_t)NULL) { pprintf(DD_OPEN, "parse: OPEN - FAILED - EXCLUSIVE ONLY\n"); return EBUSY; } q->q_ptr = (caddr_t)kmem_alloc(sizeof(parsestream_t), KM_SLEEP); if (q->q_ptr == (caddr_t)0) { return ENOMEM; } 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); parse = (parsestream_t *) q->q_ptr; bzero((caddr_t)parse, sizeof(*parse)); parse->parse_queue = q; parse->parse_status = PARSE_ENABLE; parse->parse_ppsclockev.tv.tv_sec = 0; parse->parse_ppsclockev.tv.tv_usec = 0; parse->parse_ppsclockev.serial = 0; qprocson(q); pprintf(DD_OPEN, "parse: OPEN - initializing io subsystem q=%x\n", q); if (!parse_ioinit(&parse->parse_io)) { /* * ok guys - beat it */ qprocsoff(q); kmem_free((caddr_t)parse, sizeof(parsestream_t)); return EIO; } 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"); /* * I know that you know the delete key, but you didn't write this * code, did you ? - So, keep the message in here. */ if (!notice) { cmn_err(CE_CONT, "?%s: Copyright (c) 1993-2005, Frank Kardel\n", modlstrmod.strmod_linkinfo); notice = 1; } return 0; } else { qprocsoff(q); kmem_free((caddr_t)parse, sizeof(parsestream_t)); return EIO; } } /*ARGSUSED*/ static int parseclose( queue_t *q, int flags ) { 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)); q->q_ptr = (caddr_t)NULL; WR(q)->q_ptr = (caddr_t)NULL; return 0; } /* * move unrecognized stuff upward */ static int parsersvc( queue_t *q ) { mblk_t *mp; while ((mp = getq(q))) { if (canputnext(q) || (mp->b_datap->db_type > QPCTL)) { putnext(q, mp); pprintf(DD_RSVC, "parse: RSVC - putnext\n"); } else { putbq(q, mp); pprintf(DD_RSVC, "parse: RSVC - flow control wait\n"); break; } } return 0; } /* * do ioctls and * send stuff down - dont care about * flow control */ static int parsewput( queue_t *q, mblk_t *mp ) { register int ok = 1; 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 = (struct iocblk *)mp->b_rptr; switch (iocp->ioc_cmd) { default: pprintf(DD_WPUT, "parse: parsewput - forward M_IOCTL\n"); putnext(q, mp); break; case CIOGETEV: /* * taken from Craig Leres ppsclock module (and modified) */ datap = allocb(sizeof(struct ppsclockev), BPRI_MED); if (datap == NULL || mp->b_cont) { mp->b_datap->db_type = M_IOCNAK; iocp->ioc_error = (datap == NULL) ? ENOMEM : EINVAL; if (datap != NULL) freeb(datap); qreply(q, mp); break; } mp->b_cont = datap; *(struct ppsclockev *)datap->b_wptr = parse->parse_ppsclockev; datap->b_wptr += sizeof(struct ppsclockev) / sizeof(*datap->b_wptr); mp->b_datap->db_type = M_IOCACK; iocp->ioc_count = sizeof(struct ppsclockev); qreply(q, mp); break; case PARSEIOC_ENABLE: case PARSEIOC_DISABLE: { parse->parse_status = (parse->parse_status & (unsigned)~PARSE_ENABLE) | (iocp->ioc_cmd == PARSEIOC_ENABLE) ? PARSE_ENABLE : 0; if (!setup_stream(RD(q), (parse->parse_status & PARSE_ENABLE) ? M_PARSE : M_NOPARSE)) { mp->b_datap->db_type = M_IOCNAK; } else { mp->b_datap->db_type = M_IOCACK; } qreply(q, mp); break; } case PARSEIOC_TIMECODE: case PARSEIOC_SETFMT: case PARSEIOC_GETFMT: case PARSEIOC_SETCS: if (iocp->ioc_count == sizeof(parsectl_t)) { parsectl_t *dct = (parsectl_t *)mp->b_cont->b_rptr; switch (iocp->ioc_cmd) { case PARSEIOC_TIMECODE: 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); break; case PARSEIOC_GETFMT: pprintf(DD_WPUT, "parse: parsewput - PARSEIOC_GETFMT\n"); ok = parse_getfmt(dct, &parse->parse_io); break; case PARSEIOC_SETCS: pprintf(DD_WPUT, "parse: parsewput - PARSEIOC_SETCS\n"); ok = parse_setcs(dct, &parse->parse_io); break; } mp->b_datap->db_type = ok ? M_IOCACK : M_IOCNAK; } else { mp->b_datap->db_type = M_IOCNAK; } pprintf(DD_WPUT, "parse: parsewput qreply - %s\n", (mp->b_datap->db_type == M_IOCNAK) ? "M_IOCNAK" : "M_IOCACK"); qreply(q, mp); break; } } return 0; } /* * read characters from streams buffers */ static unsigned long rdchar( mblk_t **mp ) { while (*mp != (mblk_t *)NULL) { if ((*mp)->b_wptr - (*mp)->b_rptr) { return (unsigned long)(*(unsigned char *)((*mp)->b_rptr++)); } else { register mblk_t *mmp = *mp; *mp = (*mp)->b_cont; freeb(mmp); } } return (unsigned long)~0; } /* * convert incoming data */ static int parserput( queue_t *q, mblk_t *imp ) { register unsigned char type; mblk_t *mp = imp; switch (type = mp->b_datap->db_type) { default: /* * anything we don't know will be put on queue * the service routine will move it to the next one */ pprintf(DD_RPUT, "parse: parserput - forward type 0x%x\n", type); if (canputnext(q) || (mp->b_datap->db_type > QPCTL)) { putnext(q, mp); } else putq(q, mp); break; case M_BREAK: case M_DATA: { register parsestream_t * parse = (parsestream_t *)q->q_ptr; register mblk_t *nmp; register unsigned long ch; timestamp_t c_time; timespec_t hres_time; /* * get time on packet delivery */ gethrestime(&hres_time); c_time.tv.tv_sec = hres_time.tv_sec; c_time.tv.tv_usec = hres_time.tv_nsec / 1000; if (!(parse->parse_status & PARSE_ENABLE)) { pprintf(DD_RPUT, "parse: parserput - parser disabled - forward type 0x%x\n", type); if (canputnext(q) || (mp->b_datap->db_type > QPCTL)) { putnext(q, mp); } else putq(q, mp); } else { pprintf(DD_RPUT, "parse: parserput - M_%s\n", (type == M_DATA) ? "DATA" : "BREAK"); if (type == M_DATA) { /* * parse packet looking for start an end characters */ while (mp != (mblk_t *)NULL) { ch = rdchar(&mp); if (ch != ~0 && parse_ioread(&parse->parse_io, (unsigned int)ch, &c_time)) { /* * up up and away (hopefully ...) * don't press it if resources are tight or nobody wants it */ nmp = (mblk_t *)NULL; if (canputnext(parse->parse_queue) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED))) { bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t)); nmp->b_wptr += sizeof(parsetime_t); putnext(parse->parse_queue, nmp); } else if (nmp) freemsg(nmp); parse_iodone(&parse->parse_io); } } } else { if (parse_ioread(&parse->parse_io, (unsigned int)0, &c_time)) { /* * up up and away (hopefully ...) * don't press it if resources are tight or nobody wants it */ nmp = (mblk_t *)NULL; if (canputnext(parse->parse_queue) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED))) { bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t)); nmp->b_wptr += sizeof(parsetime_t); putnext(parse->parse_queue, nmp); } else if (nmp) freemsg(nmp); parse_iodone(&parse->parse_io); } freemsg(mp); } break; } } /* * CD PPS support for non direct ISR hack */ case M_HANGUP: case M_UNHANGUP: { register parsestream_t * parse = (parsestream_t *)q->q_ptr; timestamp_t c_time; timespec_t hres_time; register mblk_t *nmp; register int status = cd_invert ^ (type == M_UNHANGUP); 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) && parse_iopps(&parse->parse_io, status ? SYNC_ONE : SYNC_ZERO, &c_time)) { nmp = (mblk_t *)NULL; if (canputnext(parse->parse_queue) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED))) { bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t)); nmp->b_wptr += sizeof(parsetime_t); putnext(parse->parse_queue, nmp); } else if (nmp) freemsg(nmp); parse_iodone(&parse->parse_io); freemsg(mp); } else if (canputnext(q) || (mp->b_datap->db_type > QPCTL)) { putnext(q, mp); } else putq(q, mp); if (status) { parse->parse_ppsclockev.tv = c_time.tv; ++(parse->parse_ppsclockev.serial); } } } return 0; } static int init_zs_linemon (queue_t *, queue_t *); /* handle line monitor for "zs" driver */ static void close_zs_linemon (queue_t *, queue_t *); /*-------------------- CD isr status monitor ---------------*/ static int init_linemon( queue_t *q ) { register queue_t *dq; dq = WR(q); /* * we ARE doing very bad things down here (basically stealing ISR * hooks) * * so we chase down the STREAMS stack searching for the driver * and if this is a known driver we insert our ISR routine for * status changes in to the ExternalStatus handling hook */ while (dq->q_next) { dq = dq->q_next; /* skip down to driver */ } /* * find appropriate driver dependent routine */ if (dq->q_qinfo && dq->q_qinfo->qi_minfo) { register char *dname = dq->q_qinfo->qi_minfo->mi_idname; pprintf(DD_INSTALL, "init_linemon: driver is \"%s\"\n", dname); #ifdef sun if (dname && !strcmp(dname, "zs")) { return init_zs_linemon(dq, q); } else #endif { pprintf(DD_INSTALL, "init_linemon: driver \"%s\" not suitable for CD monitoring\n", dname); return 0; } } pprintf(DD_INSTALL, "init_linemon: cannot find driver\n"); return 0; } static void close_linemon( queue_t *q, queue_t *my_q ) { /* * find appropriate driver dependent routine */ if (q->q_qinfo && q->q_qinfo->qi_minfo) { register char *dname = q->q_qinfo->qi_minfo->mi_idname; #ifdef sun if (dname && !strcmp(dname, "zs")) { close_zs_linemon(q, my_q); return; } pprintf(DD_INSTALL, "close_linemon: cannot find driver close routine for \"%s\"\n", dname); #endif } pprintf(DD_INSTALL, "close_linemon: cannot find driver name\n"); } #ifdef sun #include #include #include #include static void zs_xsisr (struct zscom *); /* zs external status interupt handler */ /* * there should be some docs telling how to get to * sz:zs_usec_delay and zs:initzsops() */ #define zs_usec_delay 5 struct savedzsops { struct zsops zsops; struct zsops *oldzsops; }; static struct zsops *emergencyzs; static int init_zs_linemon( queue_t *q, queue_t *my_q ) { register struct zscom *zs; register struct savedzsops *szs; register parsestream_t *parsestream = (parsestream_t *)my_q->q_ptr; /* * we expect the zsaline pointer in the q_data pointer * from there on we insert our on EXTERNAL/STATUS ISR routine * into the interrupt path, before the standard handler */ zs = ((struct asyncline *)q->q_ptr)->za_common; if (!zs) { /* * well - not found on startup - just say no (shouldn't happen though) */ return 0; } else { /* * we do a direct replacement, in case others fiddle also * if somebody else grabs our hook and we disconnect * we are in DEEP trouble - panic is likely to be next, sorry */ szs = (struct savedzsops *) kmem_alloc(sizeof(struct savedzsops), KM_SLEEP); if (szs == (struct savedzsops *)0) { pprintf(DD_INSTALL, "init_zs_linemon: CD monitor NOT installed - no memory\n"); return 0; } else { parsestream->parse_data = (void *)szs; mutex_enter(zs->zs_excl); parsestream->parse_dqueue = q; /* remember driver */ szs->zsops = *zs->zs_ops; 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() * - 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"); return 1; } } } /* * unregister our ISR routine - must call under splhigh() (or * whatever block ZS status interrupts) */ static void close_zs_linemon( queue_t *q, queue_t *my_q ) { register struct zscom *zs; register parsestream_t *parsestream = (parsestream_t *)my_q->q_ptr; zs = ((struct asyncline *)q->q_ptr)->za_common; if (!zs) { /* * well - not found on startup - just say no (shouldn't happen though) */ return; } else { register struct savedzsops *szs = (struct savedzsops *)parsestream->parse_data; mutex_enter(zs->zs_excl); zs->zs_ops = szs->oldzsops; /* reset to previous handler functions */ /* * XXX: revert xsint (usually done via zsopinit() - have still to find * a way to call that bugger */ zs->zs_xsint = zs->zs_ops->zsop_xsint; mutex_exit(zs->zs_excl); kmem_free((caddr_t)szs, sizeof (struct savedzsops)); pprintf(DD_INSTALL, "close_zs_linemon: CD monitor deleted\n"); return; } } #define ZSRR0_IGNORE (ZSRR0_CD|ZSRR0_SYNC|ZSRR0_CTS) #define MAXDEPTH 50 /* maximum allowed stream crawl */ /* * take external status interrupt (only CD interests us) */ static void zs_xsisr( struct zscom *zs ) { register struct asyncline *za = (struct asyncline *)zs->zs_priv; register queue_t *q; register unsigned char zsstatus; register int loopcheck; register unsigned char cdstate; register const char *dname = "-UNKNOWN-"; timespec_t hres_time; /* * pick up current state */ zsstatus = SCC_READ0(); if (za->za_rr0 ^ (cdstate = zsstatus & ZSRR0_CD)) { timestamp_t cdevent; register int status; /* * time stamp */ gethrestime(&hres_time); cdevent.tv.tv_sec = hres_time.tv_sec; cdevent.tv.tv_usec = hres_time.tv_nsec / 1000; q = za->za_ttycommon.t_readq; /* * logical state */ status = cd_invert ? cdstate == 0 : cdstate != 0; /* * ok - now the hard part - find ourself */ loopcheck = MAXDEPTH; while (q) { if (q->q_qinfo && q->q_qinfo->qi_minfo) { dname = q->q_qinfo->qi_minfo->mi_idname; if (!strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname)) { /* * back home - phew (hopping along stream queues might * prove dangerous to your health) */ if ((((parsestream_t *)q->q_ptr)->parse_status & PARSE_ENABLE) && parse_iopps(&((parsestream_t *)q->q_ptr)->parse_io, status ? SYNC_ONE : SYNC_ZERO, &cdevent)) { /* * XXX - currently we do not pass up the message, as * we should. * for a correct behaviour wee need to block out * processing until parse_iodone has been posted via * a softcall-ed routine which does the message pass-up * right now PPS information relies on input being * received */ parse_iodone(&((parsestream_t *)q->q_ptr)->parse_io); } if (status) { ((parsestream_t *)q->q_ptr)->parse_ppsclockev.tv = cdevent.tv; ++(((parsestream_t *)q->q_ptr)->parse_ppsclockev.serial); } pprintf(DD_ISR, "zs_xsisr: CD event %s has been posted for \"%s\"\n", status ? "ONE" : "ZERO", dname); break; } } q = q->q_next; if (!loopcheck--) { panic("zs_xsisr: STREAMS Queue corrupted - CD event"); } } if (cdstate) /* fake CARRIER status - XXX currently not coordinated */ za->za_flags |= ZAS_CARR_ON; else za->za_flags &= ~ZAS_CARR_ON; /* * only pretend that CD and ignored transistion (SYNC,CTS) * have been handled */ za->za_rr0 = (za->za_rr0 & ~ZSRR0_IGNORE) | (zsstatus & ZSRR0_IGNORE); if (((za->za_rr0 ^ zsstatus) & ~ZSRR0_IGNORE) == 0) { /* * all done - kill status indication and return */ SCC_WRITE0(ZSWR0_RESET_STATUS); /* might kill other conditions here */ return; } } 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 * interrupts. * any CD events have also been handled and shouldn't be processed * by the original routine (unless we have a VERY busy port pin) * some initializations are done here, which could have been done before for * both code paths but have been avioded for minimum path length to * the uniq_time routine */ dname = (char *) 0; q = za->za_ttycommon.t_readq; loopcheck = MAXDEPTH; /* * the real thing for everything else ... */ while (q) { if (q->q_qinfo && q->q_qinfo->qi_minfo) { dname = q->q_qinfo->qi_minfo->mi_idname; 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) */ if ((zsisr = ((struct savedzsops *)((parsestream_t *)q->q_ptr)->parse_data)->oldzsops->zsop_xsint)) 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 ... */ return; } } q = q->q_next; if (!loopcheck--) { panic("zs_xsisr: STREAMS Queue corrupted - non CD event"); } } /* * last resort - shouldn't even come here as it indicates * 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 panic("zs_xsisr: no emergency ISR handler"); } #endif /* sun */ /* * History: * * parsesolaris.c,v * Revision 4.11 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.10 2004/11/14 16:06:08 kardel * update Id tags * * Revision 4.9 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.6 1998/11/15 21:56:08 kardel * ntp_memset not necessary * * Revision 4.5 1998/11/15 21:23:37 kardel * ntp_memset() replicated in Sun kernel files * * Revision 4.4 1998/06/14 21:09:40 kardel * Sun acc cleanup * * Revision 4.3 1998/06/13 12:14:59 kardel * more prototypes * fix name clashes * allow for ansi2knr * * Revision 4.2 1998/06/12 15:23:08 kardel * fix prototypes * adjust for ansi2knr * * Revision 4.1 1998/05/24 09:38:46 kardel * streams initiated iopps calls (M_xHANGUP) are now consistent with the * respective calls from zs_xsisr() * simulation of CARRIER status to avoid unecessary M_xHANGUP messages * * Revision 4.0 1998/04/10 19:45:38 kardel * Start 4.0 release version numbering * * from V3 3.28 log info deleted 1998/04/11 kardel */ ntp-4.2.6p5/libparse/parse_conf.c0000644000175000017500000001101210441361245015670 0ustar peterpeter/* * /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 * * STREAM define switches between two personalities of the module * if STREAM is defined this module can be used with dcf77sync.c as * a STREAMS kernel module. In this case the time stamps will be * a struct timeval. * when STREAM is not defined NTP time stamps will be used. * * Copyright (c) 1995-2005 by Frank Kardel ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #ifdef HAVE_CONFIG_H # include #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "parse.h" #ifdef CLOCK_SCHMID extern clockformat_t clock_schmid; #endif #ifdef CLOCK_DCF7000 extern clockformat_t clock_dcf7000; #endif #ifdef CLOCK_MEINBERG extern clockformat_t clock_meinberg[]; #endif #ifdef CLOCK_RAWDCF extern clockformat_t clock_rawdcf; #endif #ifdef CLOCK_TRIMTAIP extern clockformat_t clock_trimtaip; #endif #ifdef CLOCK_TRIMTSIP extern clockformat_t clock_trimtsip; #endif #ifdef CLOCK_RCC8000 extern clockformat_t clock_rcc8000; #endif #ifdef CLOCK_HOPF6021 extern clockformat_t clock_hopf6021; #endif #ifdef CLOCK_COMPUTIME extern clockformat_t clock_computime; #endif #ifdef CLOCK_WHARTON_400A extern clockformat_t clock_wharton_400a; #endif #ifdef CLOCK_VARITEXT extern clockformat_t clock_varitext; #endif /* * format definitions */ clockformat_t *clockformats[] = { #ifdef CLOCK_MEINBERG &clock_meinberg[0], &clock_meinberg[1], &clock_meinberg[2], #endif #ifdef CLOCK_DCF7000 &clock_dcf7000, #endif #ifdef CLOCK_SCHMID &clock_schmid, #endif #ifdef CLOCK_RAWDCF &clock_rawdcf, #endif #ifdef CLOCK_TRIMTAIP &clock_trimtaip, #endif #ifdef CLOCK_TRIMTSIP &clock_trimtsip, #endif #ifdef CLOCK_RCC8000 &clock_rcc8000, #endif #ifdef CLOCK_HOPF6021 &clock_hopf6021, #endif #ifdef CLOCK_COMPUTIME &clock_computime, #endif #ifdef CLOCK_WHARTON_400A &clock_wharton_400a, #endif #ifdef CLOCK_VARITEXT &clock_varitext, #endif 0}; unsigned short nformats = sizeof(clockformats) / sizeof(clockformats[0]) - 1; #else /* not (REFCLOCK && CLOCK_PARSE) */ int parse_conf_bs; #endif /* not (REFCLOCK && CLOCK_PARSE) */ /* * History: * * parse_conf.c,v * Revision 4.9 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.8 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.5 1999/11/28 09:13:53 kardel * RECON_4_0_98F * * Revision 4.4 1999/02/28 15:27:25 kardel * wharton clock integration * * Revision 4.3 1998/08/16 18:52:15 kardel * (clockformats): Trimble TSIP driver now also * available for kernel operation * * Revision 4.2 1998/06/12 09:13:48 kardel * conditional compile macros fixed * * Revision 4.1 1998/05/24 09:40:49 kardel * adjustments of log messages * * * from V3 3.24 log info deleted 1998/04/11 kardel */ ntp-4.2.6p5/libparse/clk_rawdcf.c0000644000175000017500000003776211307651603015676 0ustar peterpeter/* * /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 ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #ifdef HAVE_CONFIG_H # include #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_RAWDCF) #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "parse.h" #ifdef PARSESTREAM # include #endif #ifndef PARSEKERNEL # include "ntp_stdlib.h" #endif /* * DCF77 raw time code * * From "Zur Zeit", Physikalisch-Technische Bundesanstalt (PTB), Braunschweig * und Berlin, Maerz 1989 * * Timecode transmission: * AM: * time marks are send every second except for the second before the * next minute mark * time marks consist of a reduction of transmitter power to 25% * of the nominal level * the falling edge is the time indication (on time) * time marks of a 100ms duration constitute a logical 0 * time marks of a 200ms duration constitute a logical 1 * FM: * see the spec. (basically a (non-)inverted psuedo random phase shift) * * Encoding: * Second Contents * 0 - 10 AM: free, FM: 0 * 11 - 14 free * 15 R - alternate antenna * 16 A1 - expect zone change (1 hour before) * 17 - 18 Z1,Z2 - time zone * 0 0 illegal * 0 1 MEZ (MET) * 1 0 MESZ (MED, MET DST) * 1 1 illegal * 19 A2 - expect leap insertion/deletion (1 hour before) * 20 S - start of time code (1) * 21 - 24 M1 - BCD (lsb first) Minutes * 25 - 27 M10 - BCD (lsb first) 10 Minutes * 28 P1 - Minute Parity (even) * 29 - 32 H1 - BCD (lsb first) Hours * 33 - 34 H10 - BCD (lsb first) 10 Hours * 35 P2 - Hour Parity (even) * 36 - 39 D1 - BCD (lsb first) Days * 40 - 41 D10 - BCD (lsb first) 10 Days * 42 - 44 DW - BCD (lsb first) day of week (1: Monday -> 7: Sunday) * 45 - 49 MO - BCD (lsb first) Month * 50 MO0 - 10 Months * 51 - 53 Y1 - BCD (lsb first) Years * 54 - 57 Y10 - BCD (lsb first) 10 Years * 58 P3 - Date Parity (even) * 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 *); typedef struct last_tcode { time_t tcode; /* last converted time code */ } last_tcode_t; #define BUFFER_MAX 61 clockformat_t clock_rawdcf = { inp_rawdcf, /* DCF77 input handling */ cvt_rawdcf, /* raw dcf input conversion */ pps_rawdcf, /* examining PPS information */ 0, /* no private configuration data */ "RAW DCF77 Timecode", /* direct decoding / time synthesis */ BUFFER_MAX, /* bit buffer */ sizeof(last_tcode_t) }; static struct dcfparam { unsigned char *onebits; unsigned char *zerobits; } dcfparameter = { (unsigned char *)"###############RADMLS1248124P124812P1248121241248112481248P??", /* 'ONE' representation */ (unsigned char *)"--------------------s-------p------p----------------------p__" /* 'ZERO' representation */ }; static struct rawdcfcode { char offset; /* start bit */ } rawdcfcode[] = { { 0 }, { 15 }, { 16 }, { 17 }, { 19 }, { 20 }, { 21 }, { 25 }, { 28 }, { 29 }, { 33 }, { 35 }, { 36 }, { 40 }, { 42 }, { 45 }, { 49 }, { 50 }, { 54 }, { 58 }, { 59 } }; #define DCF_M 0 #define DCF_R 1 #define DCF_A1 2 #define DCF_Z 3 #define DCF_A2 4 #define DCF_S 5 #define DCF_M1 6 #define DCF_M10 7 #define DCF_P1 8 #define DCF_H1 9 #define DCF_H10 10 #define DCF_P2 11 #define DCF_D1 12 #define DCF_D10 13 #define DCF_DW 14 #define DCF_MO 15 #define DCF_MO0 16 #define DCF_Y1 17 #define DCF_Y10 18 #define DCF_P3 19 static struct partab { char offset; /* start bit of parity field */ } partab[] = { { 21 }, { 29 }, { 36 }, { 59 } }; #define DCF_P_P1 0 #define DCF_P_P2 1 #define DCF_P_P3 2 #define DCF_Z_MET 0x2 #define DCF_Z_MED 0x1 static u_long ext_bf( unsigned char *buf, int idx, unsigned char *zero ) { u_long sum = 0; int i, first; first = rawdcfcode[idx].offset; for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--) { sum <<= 1; sum |= (buf[i] != zero[i]); } return sum; } static unsigned pcheck( unsigned char *buf, int idx, unsigned char *zero ) { int i,last; unsigned psum = 1; last = partab[idx+1].offset; for (i = partab[idx].offset; i < last; i++) psum ^= (buf[i] != zero[i]); return psum; } static u_long convert_rawdcf( unsigned char *buffer, int size, struct dcfparam *dcfprm, clocktime_t *clock_time ) { unsigned char *s = buffer; unsigned char *b = dcfprm->onebits; unsigned char *c = dcfprm->zerobits; int i; parseprintf(DD_RAWDCF,("parse: convert_rawdcf: \"%s\"\n", buffer)); if (size < 57) { #ifndef PARSEKERNEL msyslog(LOG_ERR, "parse: convert_rawdcf: INCOMPLETE DATA - time code only has %d bits\n", size); #endif return CVT_NONE; } for (i = 0; i < size; i++) { if ((*s != *b) && (*s != *c)) { /* * we only have two types of bytes (ones and zeros) */ #ifndef PARSEKERNEL msyslog(LOG_ERR, "parse: convert_rawdcf: BAD DATA - no conversion"); #endif return CVT_NONE; } if (*b) b++; if (*c) c++; s++; } /* * check Start and Parity bits */ if ((ext_bf(buffer, DCF_S, dcfprm->zerobits) == 1) && pcheck(buffer, DCF_P_P1, dcfprm->zerobits) && pcheck(buffer, DCF_P_P2, dcfprm->zerobits) && pcheck(buffer, DCF_P_P3, dcfprm->zerobits)) { /* * buffer OK */ parseprintf(DD_RAWDCF,("parse: convert_rawdcf: parity check passed\n")); clock_time->flags = PARSEB_S_ANTENNA|PARSEB_S_LEAP; clock_time->utctime= 0; clock_time->usecond= 0; clock_time->second = 0; clock_time->minute = ext_bf(buffer, DCF_M10, dcfprm->zerobits); clock_time->minute = TIMES10(clock_time->minute) + ext_bf(buffer, DCF_M1, dcfprm->zerobits); clock_time->hour = ext_bf(buffer, DCF_H10, dcfprm->zerobits); clock_time->hour = TIMES10(clock_time->hour) + ext_bf(buffer, DCF_H1, dcfprm->zerobits); clock_time->day = ext_bf(buffer, DCF_D10, dcfprm->zerobits); clock_time->day = TIMES10(clock_time->day) + ext_bf(buffer, DCF_D1, dcfprm->zerobits); clock_time->month = ext_bf(buffer, DCF_MO0, dcfprm->zerobits); clock_time->month = TIMES10(clock_time->month) + ext_bf(buffer, DCF_MO, dcfprm->zerobits); clock_time->year = ext_bf(buffer, DCF_Y10, dcfprm->zerobits); clock_time->year = TIMES10(clock_time->year) + ext_bf(buffer, DCF_Y1, dcfprm->zerobits); switch (ext_bf(buffer, DCF_Z, dcfprm->zerobits)) { case DCF_Z_MET: clock_time->utcoffset = -1*60*60; break; case DCF_Z_MED: clock_time->flags |= PARSEB_DST; clock_time->utcoffset = -2*60*60; break; default: parseprintf(DD_RAWDCF,("parse: convert_rawdcf: BAD TIME ZONE\n")); return CVT_FAIL|CVT_BADFMT; } if (ext_bf(buffer, DCF_A1, dcfprm->zerobits)) clock_time->flags |= PARSEB_ANNOUNCE; if (ext_bf(buffer, DCF_A2, dcfprm->zerobits)) clock_time->flags |= PARSEB_LEAPADD; /* default: DCF77 data format deficiency */ if (ext_bf(buffer, DCF_R, dcfprm->zerobits)) clock_time->flags |= PARSEB_ALTERNATE; 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, (u_long)clock_time->flags)); return CVT_OK; } else { /* * bad format - not for us */ #ifndef PARSEKERNEL msyslog(LOG_ERR, "parse: convert_rawdcf: parity check FAILED for \"%s\"\n", buffer); #endif return CVT_FAIL|CVT_BADFMT; } } /* * raw dcf input routine - needs to fix up 50 baud * characters for 1/0 decision */ static u_long cvt_rawdcf( unsigned char *buffer, int size, struct format *param, clocktime_t *clock_time, void *local ) { last_tcode_t *t = (last_tcode_t *)local; unsigned char *s = (unsigned char *)buffer; unsigned char *e = s + size; unsigned char *b = dcfparameter.onebits; unsigned char *c = dcfparameter.zerobits; u_long rtc = CVT_NONE; unsigned int i, lowmax, highmax, cutoff, span; #define BITS 9 unsigned char histbuf[BITS]; /* * the input buffer contains characters with runs of consecutive * bits set. These set bits are an indication of the DCF77 pulse * length. We assume that we receive the pulse at 50 Baud. Thus * a 100ms pulse would generate a 4 bit train (20ms per bit and * start bit) * a 200ms pulse would create all zeroes (and probably a frame error) */ for (i = 0; i < BITS; i++) { histbuf[i] = 0; } cutoff = 0; lowmax = 0; while (s < e) { unsigned int ch = *s ^ 0xFF; /* * these lines are left as an excercise to the reader 8-) */ if (!((ch+1) & ch) || !*s) { for (i = 0; ch; i++) { ch >>= 1; } *s = i; histbuf[i]++; cutoff += i; lowmax++; } else { parseprintf(DD_RAWDCF,("parse: cvt_rawdcf: character check for 0x%x@%d FAILED\n", *s, (int)(s - (unsigned char *)buffer))); *s = (unsigned char)~0; rtc = CVT_FAIL|CVT_BADFMT; } s++; } if (lowmax) { cutoff /= lowmax; } else { cutoff = 4; /* doesn't really matter - it'll fail anyway, but gives error output */ } parseprintf(DD_RAWDCF,("parse: cvt_rawdcf: average bit count: %d\n", cutoff)); lowmax = 0; highmax = 0; parseprintf(DD_RAWDCF,("parse: cvt_rawdcf: histogram:")); for (i = 0; i <= cutoff; i++) { lowmax+=histbuf[i] * i; highmax += histbuf[i]; parseprintf(DD_RAWDCF,(" %d", histbuf[i])); } parseprintf(DD_RAWDCF, (" ")); lowmax += highmax / 2; if (highmax) { lowmax /= highmax; } else { lowmax = 0; } highmax = 0; cutoff = 0; for (; i < BITS; i++) { highmax+=histbuf[i] * i; cutoff +=histbuf[i]; parseprintf(DD_RAWDCF,(" %d", histbuf[i])); } parseprintf(DD_RAWDCF,("\n")); if (cutoff) { highmax /= cutoff; } else { highmax = BITS-1; } span = cutoff = lowmax; for (i = lowmax; i <= highmax; i++) { if (histbuf[cutoff] > histbuf[i]) { cutoff = i; span = i; } else if (histbuf[cutoff] == histbuf[i]) { span = i; } } cutoff = (cutoff + span) / 2; parseprintf(DD_RAWDCF,("parse: cvt_rawdcf: lower maximum %d, higher maximum %d, cutoff %d\n", lowmax, highmax, cutoff)); s = (unsigned char *)buffer; while (s < e) { if (*s == (unsigned char)~0) { *s = '?'; } else { *s = (*s >= cutoff) ? *b : *c; } s++; if (*b) b++; if (*c) c++; } if (rtc == CVT_NONE) { rtc = convert_rawdcf(buffer, size, &dcfparameter, clock_time); if (rtc == CVT_OK) { time_t newtime; newtime = parse_to_unixtime(clock_time, &rtc); if ((rtc == CVT_OK) && t) { if ((newtime - t->tcode) == 60) /* guard against multi bit errors */ { clock_time->utctime = newtime; } else { rtc = CVT_FAIL|CVT_BADTIME; } t->tcode = newtime; } } } return rtc; } /* * pps_rawdcf * * currently a very stupid version - should be extended to decode * also ones and zeros (which is easy) */ /*ARGSUSED*/ static u_long pps_rawdcf( parse_t *parseio, int status, timestamp_t *ptime ) { if (!status) /* negative edge for simpler wiring (Rx->DCD) */ { parseio->parse_dtime.parse_ptime = *ptime; parseio->parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS; } return CVT_NONE; } static u_long snt_rawdcf( parse_t *parseio, timestamp_t *ptime ) { if ((parseio->parse_dtime.parse_status & CVT_MASK) == CVT_OK) { parseio->parse_dtime.parse_stime = *ptime; #ifdef PARSEKERNEL parseio->parse_dtime.parse_time.tv.tv_sec++; #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 * * grab DCF77 data from input stream */ static u_long inp_rawdcf( parse_t *parseio, unsigned int 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)) { parseprintf(DD_PARSE, ("inp_rawdcf: time out seen\n")); (void) parse_end(parseio); (void) parse_addchar(parseio, ch); return PARSE_INP_TIME; } else { unsigned int rtc; rtc = parse_addchar(parseio, ch); if (rtc == PARSE_INP_SKIP) { if (snt_rawdcf(parseio, tstamp) == CVT_OK) return PARSE_INP_SYNTH; } return rtc; } } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_RAWDCF) */ int clk_rawdcf_bs; #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_RAWDCF) */ /* * History: * * clk_rawdcf.c,v * Revision 4.18 2006/06/22 18:40:01 kardel * clean up signedness (gcc 4) * * Revision 4.17 2006/01/22 16:01:55 kardel * update version information * * Revision 4.16 2006/01/22 15:51:22 kardel * generate reasonable timecode output on invalid input * * Revision 4.15 2005/08/06 19:17:06 kardel * clean log output * * Revision 4.14 2005/08/06 17:39:40 kardel * cleanup size handling wrt/ to buffer boundaries * * Revision 4.13 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.12 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.9 1999/12/06 13:42:23 kardel * transfer correctly converted time codes always into tcode * * Revision 4.8 1999/11/28 09:13:50 kardel * RECON_4_0_98F * * Revision 4.7 1999/04/01 20:07:20 kardel * added checking for minutie increment of timestamps in clk_rawdcf.c * * Revision 4.6 1998/06/14 21:09:37 kardel * Sun acc cleanup * * Revision 4.5 1998/06/13 12:04:16 kardel * fix SYSV clock name clash * * Revision 4.4 1998/06/12 15:22:28 kardel * fix prototypes * * Revision 4.3 1998/06/06 18:33:36 kardel * simplified condidional compile expression * * Revision 4.2 1998/05/24 11:04:18 kardel * triggering PPS on negative edge for simpler wiring (Rx->DCD) * * Revision 4.1 1998/05/24 09:39:53 kardel * implementation of the new IO handling model * * Revision 4.0 1998/04/10 19:45:30 kardel * Start 4.0 release version numbering * * from V3 3.24 log info deleted 1998/04/11 kardel * */ ntp-4.2.6p5/libparse/mkinfo_scmd.sed0000644000175000017500000000047210017034562016401 0ustar peterpeter1i\ /*\ * Automatically generated - do not modify\ */\ \ #include "ntp_types.h"\ #include "ntpd.h"\ #include "trimble.h"\ \ cmd_info_t trimble_scmds[] = { s!^#define[ ][ ]*\(CMD_C[^ ]*\)[ ][ ]*\([^ ]*\)[ ][ ]*/\*[ ][ ]*\(.*\)[ ][ ]*\*/! { \1, "\1", "\3 (\2)", "", 0 },!p $a\ { 0xFF, "", "" }\ };\ ntp-4.2.6p5/libparse/clk_computime.c0000644000175000017500000001463611307651603016425 0ustar peterpeter#ifdef HAVE_CONFIG_H # include #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_COMPUTIME) /* * /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 * * Copyright (c) 1995-2005 by Frank Kardel ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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 "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "ntp_stdlib.h" #include "parse.h" #ifndef PARSESTREAM #include #else #include "sys/parsestreams.h" extern int printf (const char *, ...); #endif /* * The Computime receiver sends a datagram in the following format every minute * * 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 * SS Second * CR Carriage return * LF Linefeed * */ static struct format computime_fmt = { { {8, 2}, {5, 2}, {2, 2}, /* day, month, year */ {14, 2}, {17, 2}, {20, 2}, /* hour, minute, second */ {11, 2}, /* dayofweek, */ }, (const unsigned char *)"T: : : : : : : \r\n", 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 *); clockformat_t clock_computime = { inp_computime, /* Computime input handling */ cvt_computime, /* Computime conversion */ 0, /* no PPS monitoring */ (void *)&computime_fmt, /* conversion configuration */ "Diem's Computime Radio Clock", /* Computime Radio Clock */ 24, /* string buffer */ 0 /* no private data (complete pakets) */ }; /* * cvt_computime * * convert simple type format */ static u_long cvt_computime( unsigned char *buffer, int size, struct format *format, clocktime_t *clock_time, void *local ) { if (!Strok(buffer, format->fixed_string)) { return CVT_NONE; } else { if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day, format->field_offsets[O_DAY].length) || Stoi(&buffer[format->field_offsets[O_MONTH].offset], &clock_time->month, format->field_offsets[O_MONTH].length) || Stoi(&buffer[format->field_offsets[O_YEAR].offset], &clock_time->year, format->field_offsets[O_YEAR].length) || Stoi(&buffer[format->field_offsets[O_HOUR].offset], &clock_time->hour, format->field_offsets[O_HOUR].length) || 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)) { return CVT_FAIL | CVT_BADFMT; } else { clock_time->flags = 0; clock_time->utcoffset = 0; /* We have UTC time */ return CVT_OK; } } } /* * inp_computime * * grep data from input stream */ static u_long inp_computime( parse_t *parseio, unsigned int 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) return parse_end(parseio); else return rtc; default: return parse_addchar(parseio, ch); } } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_COMPUTIME) */ int clk_computime_bs; #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_COMPUTIME) */ /* * clk_computime.c,v * Revision 4.10 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.9 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.6 1999/11/28 09:13:49 kardel * RECON_4_0_98F * * Revision 4.5 1998/06/14 21:09:34 kardel * Sun acc cleanup * * Revision 4.4 1998/06/13 12:00:38 kardel * fix SYSV clock name clash * * Revision 4.3 1998/06/12 15:22:26 kardel * fix prototypes * * Revision 4.2 1998/06/12 09:13:24 kardel * conditional compile macros fixed * printf prototype * * Revision 4.1 1998/05/24 09:39:51 kardel * implementation of the new IO handling model * * Revision 4.0 1998/04/10 19:45:27 kardel * Start 4.0 release version numbering * * from V3 1.8 log info deleted 1998/04/11 kardel */ ntp-4.2.6p5/libparse/parsestreams.c0000644000175000017500000007517111307651603016304 0ustar peterpeter/* * /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 ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #define KERNEL /* MUST */ #define VDDRV /* SHOULD */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifndef lint static char rcsid[] = "parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A"; #endif #ifndef KERNEL #include "Bletch: MUST COMPILE WITH KERNEL DEFINE" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef VDDRV #include #endif #include "ntp_stdlib.h" #include "ntp_fp.h" /* * just make checking compilers more silent */ extern int printf (const char *, ...); extern int putctl1 (queue_t *, int, int); extern int canput (queue_t *); extern void putbq (queue_t *, mblk_t *); extern void freeb (mblk_t *); extern void qreply (queue_t *, mblk_t *); extern void freemsg (mblk_t *); extern void panic (const char *, ...); extern void usec_delay (int); #include "parse.h" #include "sys/parsestreams.h" /* * use microtime instead of uniqtime if advised to */ #ifdef MICROTIME #define uniqtime microtime #endif #ifdef VDDRV static unsigned int parsebusy = 0; /*--------------- loadable driver section -----------------------------*/ extern struct streamtab parseinfo; #ifdef PPS_SYNC static char mnam[] = "PARSEPPS "; /* name this baby - keep room for revision number */ #else static char mnam[] = "PARSE "; /* name this baby - keep room for revision number */ #endif struct vdldrv parsesync_vd = { VDMAGIC_PSEUDO, /* nothing like a real driver - a STREAMS module */ mnam, }; /* * strings support usually not in kernel */ static int Strlen( register const char *s ) { register int c; c = 0; if (s) { while (*s++) { c++; } } return c; } static void Strncpy( register char *t, register char *s, register int c ) { if (s && t) { while ((c-- > 0) && (*t++ = *s++)) ; } } static int Strcmp( register const char *s, register const char *t ) { register int c = 0; if (!s || !t || (s == t)) { return 0; } while (!(c = *s++ - *t++) && *s && *t) /* empty loop */; return c; } static int Strncmp( register char *s, register char *t, register int n ) { register int c = 0; if (!s || !t || (s == t)) { return 0; } while (n-- && !(c = *s++ - *t++) && *s && *t) /* empty loop */; return c; } void ntp_memset( char *a, int x, int c ) { while (c-- > 0) *a++ = x; } /* * driver init routine * since no mechanism gets us into and out of the fmodsw, we have to * do it ourselves */ /*ARGSUSED*/ int xxxinit( unsigned int fc, struct vddrv *vdp, addr_t vdin, struct vdstat *vds ) { 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: vdp->vdd_vdtab = (struct vdlinkage *)&parsesync_vd; /* * now, jog along fmodsw scanning for an empty slot * and deposit our name there */ while (fm <= fmend) { if (!Strncmp(fm->f_name, mname, FMNAMESZ)) { printf("vddrinit[%s]: STREAMS module already loaded.\n", mname); return(EBUSY); } else if ((ifm == (struct fmodsw *)0) && (fm->f_name[0] == '\0') && (fm->f_str == (struct streamtab *)0)) { /* * got one - so move in */ ifm = fm; break; } fm++; } if (ifm == (struct fmodsw *)0) { printf("vddrinit[%s]: no slot free for STREAMS module\n", mname); return (ENOSPC); } else { static char revision[] = "4.7"; char *s, *S, *t; s = rcsid; /* NOOP - keep compilers happy */ Strncpy(ifm->f_name, mname, FMNAMESZ); ifm->f_name[FMNAMESZ] = '\0'; ifm->f_str = &parseinfo; /* * copy RCS revision into Drv_name * * are we forcing RCS here to do things it was not built for ? */ s = revision; if (*s == '$') { /* * skip "$Revision: " * if present. - not necessary on a -kv co (cvs export) */ while (*s && (*s != ' ')) { s++; } if (*s == ' ') s++; } 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)) { (void) Strncpy(t, s, S - s); } } return (0); } break; case VDUNLOAD: if (parsebusy > 0) { printf("vddrinit[%s]: STREAMS module has still %d instances active.\n", mname, parsebusy); return (EBUSY); } else { while (fm <= fmend) { if (!Strncmp(fm->f_name, mname, FMNAMESZ)) { /* * got it - kill entry */ fm->f_name[0] = '\0'; fm->f_str = (struct streamtab *)0; fm++; break; } fm++; } if (fm > fmend) { printf("vddrinit[%s]: cannot find entry for STREAMS module\n", mname); return (ENXIO); } else return (0); } case VDSTAT: return (0); default: return (EIO); } return EIO; } #endif /*--------------- stream module definition ----------------------------*/ static int parseopen (queue_t *, dev_t, int, int); static int parseclose (queue_t *, int); static int parsewput (queue_t *, mblk_t *); static int parserput (queue_t *, mblk_t *); static int parsersvc (queue_t *); static char mn[] = "parse"; static struct module_info driverinfo = { 0, /* module ID number */ mn, /* module name */ 0, /* minimum accepted packet size */ INFPSZ, /* maximum accepted packet size */ 1, /* high water mark - flow control */ 0 /* low water mark - flow control */ }; static struct qinit rinit = /* read queue definition */ { parserput, /* put procedure */ parsersvc, /* service procedure */ parseopen, /* open procedure */ parseclose, /* close procedure */ NULL, /* admin procedure - NOT USED FOR NOW */ &driverinfo, /* information structure */ NULL /* statistics */ }; static struct qinit winit = /* write queue definition */ { parsewput, /* put procedure */ NULL, /* service procedure */ NULL, /* open procedure */ NULL, /* close procedure */ NULL, /* admin procedure - NOT USED FOR NOW */ &driverinfo, /* information structure */ NULL /* statistics */ }; struct streamtab parseinfo = /* stream info element for dpr driver */ { &rinit, /* read queue */ &winit, /* write queue */ NULL, /* read mux */ NULL, /* write mux */ NULL /* module auto push */ }; /*--------------- driver data structures ----------------------------*/ /* * we usually have an inverted signal - but you * can change this to suit your needs */ int cd_invert = 1; /* invert status of CD line - PPS support via CD input */ int parsedebug = ~0; extern void uniqtime (struct timeval *); /*--------------- module implementation -----------------------------*/ #define TIMEVAL_USADD(_X_, _US_) {\ (_X_)->tv_usec += (_US_);\ if ((_X_)->tv_usec >= 1000000)\ {\ (_X_)->tv_sec++;\ (_X_)->tv_usec -= 1000000;\ }\ } while (0) static int init_linemon (queue_t *); static void close_linemon (queue_t *, queue_t *); #define M_PARSE 0x0001 #define M_NOPARSE 0x0002 static int setup_stream( queue_t *q, int mode ) { mblk_t *mp; mp = allocb(sizeof(struct stroptions), BPRI_MED); if (mp) { struct stroptions *str = (struct stroptions *)(void *)mp->b_rptr; str->so_flags = SO_READOPT|SO_HIWAT|SO_LOWAT; str->so_readopt = (mode == M_PARSE) ? RMSGD : RNORM; str->so_hiwat = (mode == M_PARSE) ? sizeof(parsetime_t) : 256; str->so_lowat = 0; mp->b_datap->db_type = M_SETOPTS; mp->b_wptr += sizeof(struct stroptions); putnext(q, mp); return putctl1(WR(q)->q_next, M_CTL, (mode == M_PARSE) ? MC_SERVICEIMM : MC_SERVICEDEF); } else { parseprintf(DD_OPEN,("parse: setup_stream - FAILED - no MEMORY for allocb\n")); return 0; } } /*ARGSUSED*/ static int parseopen( queue_t *q, dev_t dev, int flag, int sflag ) { register parsestream_t *parse; static int notice = 0; parseprintf(DD_OPEN,("parse: OPEN\n")); if (sflag != MODOPEN) { /* open only for modules */ 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")); 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")); #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; parse->parse_status = PARSE_ENABLE; parse->parse_ppsclockev.tv.tv_sec = 0; parse->parse_ppsclockev.tv.tv_usec = 0; parse->parse_ppsclockev.serial = 0; if (!parse_ioinit(&parse->parse_io)) { /* * ok guys - beat it */ kmem_free((caddr_t)parse, sizeof(parsestream_t)); #ifdef VDDRV parsebusy--; #endif return OPENFAIL; } if (setup_stream(q, M_PARSE)) { (void) init_linemon(q); /* hook up PPS ISR routines if possible */ parseprintf(DD_OPEN,("parse: OPEN - SUCCEEDED\n")); /* * I know that you know the delete key, but you didn't write this * code, did you ? - So, keep the message in here. */ if (!notice) { #ifdef VDDRV printf("%s: Copyright (C) 1991-2005, Frank Kardel\n", parsesync_vd.Drv_name); #else printf("%s: Copyright (C) 1991-2005, Frank Kardel\n", "parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A"); #endif notice = 1; } return MODOPEN; } else { kmem_free((caddr_t)parse, sizeof(parsestream_t)); #ifdef VDDRV parsebusy--; #endif return OPENFAIL; } } /*ARGSUSED*/ static int parseclose( queue_t *q, int flags ) { 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)); q->q_ptr = (caddr_t)NULL; WR(q)->q_ptr = (caddr_t)NULL; #ifdef VDDRV parsebusy--; #endif return 0; } /* * move unrecognized stuff upward */ static int parsersvc( queue_t *q ) { mblk_t *mp; while ((mp = getq(q))) { if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL)) { putnext(q, mp); parseprintf(DD_RSVC,("parse: RSVC - putnext\n")); } else { putbq(q, mp); parseprintf(DD_RSVC,("parse: RSVC - flow control wait\n")); break; } } return 0; } /* * do ioctls and * send stuff down - dont care about * flow control */ static int parsewput( queue_t *q, register mblk_t *mp ) { register int ok = 1; 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) { default: parseprintf(DD_WPUT,("parse: parsewput - forward M_IOCTL\n")); putnext(q, mp); break; case CIOGETEV: /* * taken from Craig Leres ppsclock module (and modified) */ datap = allocb(sizeof(struct ppsclockev), BPRI_MED); if (datap == NULL || mp->b_cont) { mp->b_datap->db_type = M_IOCNAK; iocp->ioc_error = (datap == NULL) ? ENOMEM : EINVAL; if (datap != NULL) freeb(datap); qreply(q, mp); break; } mp->b_cont = datap; *(struct ppsclockev *)(void *)datap->b_wptr = parse->parse_ppsclockev; datap->b_wptr += sizeof(struct ppsclockev) / sizeof(*datap->b_wptr); mp->b_datap->db_type = M_IOCACK; iocp->ioc_count = sizeof(struct ppsclockev); qreply(q, mp); break; case PARSEIOC_ENABLE: case PARSEIOC_DISABLE: { parse->parse_status = (parse->parse_status & (unsigned)~PARSE_ENABLE) | (iocp->ioc_cmd == PARSEIOC_ENABLE) ? PARSE_ENABLE : 0; if (!setup_stream(RD(q), (parse->parse_status & PARSE_ENABLE) ? M_PARSE : M_NOPARSE)) { mp->b_datap->db_type = M_IOCNAK; } else { mp->b_datap->db_type = M_IOCACK; } qreply(q, mp); break; } case PARSEIOC_TIMECODE: case PARSEIOC_SETFMT: case PARSEIOC_GETFMT: case PARSEIOC_SETCS: if (iocp->ioc_count == sizeof(parsectl_t)) { parsectl_t *dct = (parsectl_t *)(void *)mp->b_cont->b_rptr; switch (iocp->ioc_cmd) { case PARSEIOC_TIMECODE: 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); break; case PARSEIOC_GETFMT: parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_GETFMT\n")); ok = parse_getfmt(dct, &parse->parse_io); break; case PARSEIOC_SETCS: parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_SETCS\n")); ok = parse_setcs(dct, &parse->parse_io); break; } mp->b_datap->db_type = ok ? M_IOCACK : M_IOCNAK; } else { mp->b_datap->db_type = M_IOCNAK; } parseprintf(DD_WPUT,("parse: parsewput qreply - %s\n", (mp->b_datap->db_type == M_IOCNAK) ? "M_IOCNAK" : "M_IOCACK")); qreply(q, mp); break; } } return 0; } /* * read characters from streams buffers */ static unsigned long rdchar( register mblk_t **mp ) { while (*mp != (mblk_t *)NULL) { if ((*mp)->b_wptr - (*mp)->b_rptr) { return (unsigned long)(*(unsigned char *)((*mp)->b_rptr++)); } else { register mblk_t *mmp = *mp; *mp = (*mp)->b_cont; freeb(mmp); } } return (unsigned)~0; } /* * convert incoming data */ static int parserput( queue_t *q, mblk_t *mp ) { unsigned char type; switch (type = mp->b_datap->db_type) { default: /* * anything we don't know will be put on queue * the service routine will move it to the next one */ parseprintf(DD_RPUT,("parse: parserput - forward type 0x%x\n", type)); if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL)) { putnext(q, mp); } else putq(q, mp); break; case M_BREAK: case M_DATA: { register parsestream_t * parse = (parsestream_t *)(void *)q->q_ptr; register mblk_t *nmp; register unsigned long ch; timestamp_t ctime; /* * get time on packet delivery */ uniqtime(&ctime.tv); if (!(parse->parse_status & PARSE_ENABLE)) { parseprintf(DD_RPUT,("parse: parserput - parser disabled - forward type 0x%x\n", type)); if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL)) { putnext(q, mp); } else putq(q, mp); } else { parseprintf(DD_RPUT,("parse: parserput - M_%s\n", (type == M_DATA) ? "DATA" : "BREAK")); if (type == M_DATA) { /* * parse packet looking for start an end characters */ while (mp != (mblk_t *)NULL) { ch = rdchar(&mp); if (ch != ~0 && parse_ioread(&parse->parse_io, (unsigned int)ch, &ctime)) { /* * up up and away (hopefully ...) * don't press it if resources are tight or nobody wants it */ nmp = (mblk_t *)NULL; if (canput(parse->parse_queue->q_next) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED))) { bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t)); nmp->b_wptr += sizeof(parsetime_t); putnext(parse->parse_queue, nmp); } else if (nmp) freemsg(nmp); parse_iodone(&parse->parse_io); } } } else { if (parse_ioread(&parse->parse_io, (unsigned int)0, &ctime)) { /* * up up and away (hopefully ...) * don't press it if resources are tight or nobody wants it */ nmp = (mblk_t *)NULL; if (canput(parse->parse_queue->q_next) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED))) { bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t)); nmp->b_wptr += sizeof(parsetime_t); putnext(parse->parse_queue, nmp); } else if (nmp) freemsg(nmp); parse_iodone(&parse->parse_io); } freemsg(mp); } break; } } /* * CD PPS support for non direct ISR hack */ case M_HANGUP: case M_UNHANGUP: { register parsestream_t * parse = (parsestream_t *)(void *)q->q_ptr; timestamp_t ctime; register mblk_t *nmp; 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) && parse_iopps(&parse->parse_io, (int)(status ? SYNC_ONE : SYNC_ZERO), &ctime)) { nmp = (mblk_t *)NULL; if (canput(parse->parse_queue->q_next) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED))) { bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t)); nmp->b_wptr += sizeof(parsetime_t); putnext(parse->parse_queue, nmp); } else if (nmp) freemsg(nmp); parse_iodone(&parse->parse_io); freemsg(mp); } else if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL)) { putnext(q, mp); } else putq(q, mp); if (status) { parse->parse_ppsclockev.tv = ctime.tv; ++(parse->parse_ppsclockev.serial); } } } return 0; } static int init_zs_linemon (queue_t *, queue_t *); /* handle line monitor for "zs" driver */ static void close_zs_linemon (queue_t *, queue_t *); /*-------------------- CD isr status monitor ---------------*/ static int init_linemon( register queue_t *q ) { register queue_t *dq; dq = WR(q); /* * we ARE doing very bad things down here (basically stealing ISR * hooks) * * so we chase down the STREAMS stack searching for the driver * and if this is a known driver we insert our ISR routine for * status changes in to the ExternalStatus handling hook */ while (dq->q_next) { dq = dq->q_next; /* skip down to driver */ } /* * find appropriate driver dependent routine */ if (dq->q_qinfo && dq->q_qinfo->qi_minfo) { register char *dname = dq->q_qinfo->qi_minfo->mi_idname; parseprintf(DD_INSTALL, ("init_linemon: driver is \"%s\"\n", dname)); #ifdef sun if (dname && !Strcmp(dname, "zs")) { return init_zs_linemon(dq, q); } else #endif { parseprintf(DD_INSTALL, ("init_linemon: driver \"%s\" not suitable for CD monitoring\n", dname)); return 0; } } parseprintf(DD_INSTALL, ("init_linemon: cannot find driver\n")); return 0; } static void close_linemon( register queue_t *q, register queue_t *my_q ) { /* * find appropriate driver dependent routine */ if (q->q_qinfo && q->q_qinfo->qi_minfo) { register char *dname = q->q_qinfo->qi_minfo->mi_idname; #ifdef sun if (dname && !Strcmp(dname, "zs")) { close_zs_linemon(q, my_q); return; } parseprintf(DD_INSTALL, ("close_linemon: cannot find driver close routine for \"%s\"\n", dname)); #endif } parseprintf(DD_INSTALL, ("close_linemon: cannot find driver name\n")); } #ifdef sun #include #include #include static unsigned long cdmask = ZSRR0_CD; struct savedzsops { struct zsops zsops; struct zsops *oldzsops; }; struct zsops *emergencyzs; extern void zsopinit (struct zscom *, struct zsops *); static int zs_xsisr (struct zscom *); /* zs external status interupt handler */ static int init_zs_linemon( register queue_t *q, register queue_t *my_q ) { register struct zscom *zs; register struct savedzsops *szs; register parsestream_t *parsestream = (parsestream_t *)(void *)my_q->q_ptr; /* * we expect the zsaline pointer in the q_data pointer * from there on we insert our on EXTERNAL/STATUS ISR routine * into the interrupt path, before the standard handler */ zs = ((struct zsaline *)(void *)q->q_ptr)->za_common; if (!zs) { /* * well - not found on startup - just say no (shouldn't happen though) */ return 0; } else { unsigned long s; /* * we do a direct replacement, in case others fiddle also * if somebody else grabs our hook and we disconnect * we are in DEEP trouble - panic is likely to be next, sorry */ szs = (struct savedzsops *)(void *)kmem_alloc(sizeof(struct savedzsops)); if (szs == (struct savedzsops *)0) { parseprintf(DD_INSTALL, ("init_zs_linemon: CD monitor NOT installed - no memory\n")); return 0; } else { parsestream->parse_data = (void *)szs; s = splhigh(); parsestream->parse_dqueue = q; /* remember driver */ szs->zsops = *zs->zs_ops; 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")); return 1; } } } /* * unregister our ISR routine - must call under splhigh() */ static void close_zs_linemon( register queue_t *q, register queue_t *my_q ) { register struct zscom *zs; register parsestream_t *parsestream = (parsestream_t *)(void *)my_q->q_ptr; zs = ((struct zsaline *)(void *)q->q_ptr)->za_common; if (!zs) { /* * well - not found on startup - just say no (shouldn't happen though) */ return; } 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; } } #define MAXDEPTH 50 /* maximum allowed stream crawl */ #ifdef PPS_SYNC extern void hardpps (struct timeval *, long); #ifdef PPS_NEW extern struct timeval timestamp; #else extern struct timeval pps_time; #endif #endif /* * take external status interrupt (only CD interests us) */ static int zs_xsisr( struct zscom *zs ) { register struct zsaline *za = (struct zsaline *)(void *)zs->zs_priv; register struct zscc_device *zsaddr = zs->zs_addr; register queue_t *q; register unsigned char zsstatus; register int loopcheck; register char *dname; #ifdef PPS_SYNC register unsigned int s; register long usec; #endif /* * pick up current state */ zsstatus = zsaddr->zscc_control; if ((za->za_rr0 ^ zsstatus) & (cdmask)) { timestamp_t cdevent; register int status; za->za_rr0 = (za->za_rr0 & ~(cdmask)) | (zsstatus & (cdmask)); #ifdef PPS_SYNC s = splclock(); #ifdef PPS_NEW usec = timestamp.tv_usec; #else usec = pps_time.tv_usec; #endif #endif /* * time stamp */ uniqtime(&cdevent.tv); #ifdef PPS_SYNC (void)splx(s); #endif /* * logical state */ status = cd_invert ? (zsstatus & cdmask) == 0 : (zsstatus & cdmask) != 0; #ifdef PPS_SYNC if (status) { usec = cdevent.tv.tv_usec - usec; if (usec < 0) usec += 1000000; hardpps(&cdevent.tv, usec); } #endif q = za->za_ttycommon.t_readq; /* * ok - now the hard part - find ourself */ loopcheck = MAXDEPTH; while (q) { if (q->q_qinfo && q->q_qinfo->qi_minfo) { dname = q->q_qinfo->qi_minfo->mi_idname; if (!Strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname)) { /* * back home - phew (hopping along stream queues might * prove dangerous to your health) */ if ((((parsestream_t *)(void *)q->q_ptr)->parse_status & PARSE_ENABLE) && parse_iopps(&((parsestream_t *)(void *)q->q_ptr)->parse_io, (int)(status ? SYNC_ONE : SYNC_ZERO), &cdevent)) { /* * XXX - currently we do not pass up the message, as * we should. * for a correct behaviour wee need to block out * processing until parse_iodone has been posted via * a softcall-ed routine which does the message pass-up * right now PPS information relies on input being * received */ parse_iodone(&((parsestream_t *)(void *)q->q_ptr)->parse_io); } if (status) { ((parsestream_t *)(void *)q->q_ptr)->parse_ppsclockev.tv = cdevent.tv; ++(((parsestream_t *)(void *)q->q_ptr)->parse_ppsclockev.serial); } parseprintf(DD_ISR, ("zs_xsisr: CD event %s has been posted for \"%s\"\n", status ? "ONE" : "ZERO", dname)); break; } } q = q->q_next; if (!loopcheck--) { panic("zs_xsisr: STREAMS Queue corrupted - CD event"); } } /* * only pretend that CD has been handled */ ZSDELAY(2); if (!((za->za_rr0 ^ zsstatus) & ~(cdmask))) { /* * all done - kill status indication and return */ 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. * any CD events have also been handled and shouldn't be processed * by the original routine (unless we have a VERY busy port pin) * some initializations are done here, which could have been done before for * both code paths but have been avoided for minimum path length to * the uniq_time routine */ dname = (char *) 0; q = za->za_ttycommon.t_readq; loopcheck = MAXDEPTH; /* * the real thing for everything else ... */ while (q) { if (q->q_qinfo && q->q_qinfo->qi_minfo) { dname = q->q_qinfo->qi_minfo->mi_idname; 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) */ if ((zsisr = ((struct savedzsops *)((parsestream_t *)(void *)q->q_ptr)->parse_data)->oldzsops->zsop_xsint)) 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 ... */ return 0; } } q = q->q_next; if (!loopcheck--) { panic("zs_xsisr: STREAMS Queue corrupted - non CD event"); } } /* * last resort - shouldn't even come here as it indicates * 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 panic("zs_xsisr: no emergency ISR handler"); return 0; } #endif /* sun */ /* * History: * * parsestreams.c,v * Revision 4.11 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.10 2004/11/14 16:06:08 kardel * update Id tags * * Revision 4.9 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.7 1999/11/28 09:13:53 kardel * RECON_4_0_98F * * Revision 4.6 1998/12/20 23:45:31 kardel * fix types and warnings * * Revision 4.5 1998/11/15 21:23:38 kardel * ntp_memset() replicated in Sun kernel files * * Revision 4.4 1998/06/13 12:15:59 kardel * superfluous variable removed * * Revision 4.3 1998/06/12 15:23:08 kardel * fix prototypes * adjust for ansi2knr * * Revision 4.2 1998/05/24 18:16:22 kardel * moved copy of shadow status to the beginning * * Revision 4.1 1998/05/24 09:38:47 kardel * streams initiated iopps calls (M_xHANGUP) are now consistent with the * respective calls from zs_xsisr() * simulation of CARRIER status to avoid unecessary M_xHANGUP messages * * Revision 4.0 1998/04/10 19:45:38 kardel * Start 4.0 release version numbering * * from V3 3.37 log info deleted 1998/04/11 kardel */ ntp-4.2.6p5/libparse/ieee754io.c0000644000175000017500000003141111307651604015260 0ustar peterpeter/* * /src/NTP/ntp4-dev/libntp/ieee754io.c,v 4.12 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * ieee754io.c,v 4.12 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * $Created: Sun Jul 13 09:12:02 1997 $ * * Copyright (c) 1997-2005 by Frank Kardel ntp.org> * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "l_stdlib.h" #include "ntp_stdlib.h" #include "ntp_fp.h" #include "ieee754io.h" static unsigned char get_byte (unsigned char *, offsets_t, int *); #ifdef __not_yet__ static void put_byte (unsigned char *, offsets_t, int *, unsigned char); #endif #ifdef LIBDEBUG #include "lib_strbuf.h" static char * fmt_blong( unsigned long val, int cnt ) { char *buf, *s; int i = cnt; val <<= 32 - cnt; LIB_GETBUF(buf); s = buf; while (i--) { if (val & 0x80000000) { *s++ = '1'; } else { *s++ = '0'; } val <<= 1; } *s = '\0'; return buf; } static char * fmt_flt( unsigned int sign, unsigned long mh, unsigned long ml, unsigned long ch ) { char *buf; LIB_GETBUF(buf); sprintf(buf, "%c %s %s %s", sign ? '-' : '+', fmt_blong(ch, 11), fmt_blong(mh, 20), fmt_blong(ml, 32)); return buf; } static char * fmt_hex( unsigned char *bufp, int length ) { char *buf; int i; LIB_GETBUF(buf); for (i = 0; i < length; i++) { sprintf(buf+i*2, "%02x", bufp[i]); } return buf; } #endif static unsigned char get_byte( unsigned char *bufp, offsets_t offset, int *fieldindex ) { unsigned char val; val = *(bufp + offset[*fieldindex]); #ifdef LIBDEBUG if (debug > 4) printf("fetchieee754: getbyte(0x%08x, %d) = 0x%02x\n", (unsigned int)(bufp)+offset[*fieldindex], *fieldindex, val); #endif (*fieldindex)++; return val; } #ifdef __not_yet__ static void put_byte( unsigned char *bufp, offsets_t offsets, int *fieldindex, unsigned char val ) { *(bufp + offsets[*fieldindex]) = val; (*fieldindex)++; } #endif /* * make conversions to and from external IEEE754 formats and internal * NTP FP format. */ int fetch_ieee754( unsigned char **buffpp, int size, l_fp *lfpp, offsets_t offsets ) { unsigned char *bufp = *buffpp; unsigned int sign; unsigned int bias; unsigned int maxexp; int mbits; u_long mantissa_low; u_long mantissa_high; u_long characteristic; long exponent; #ifdef LIBDEBUG int length; #endif unsigned char val; int fieldindex = 0; switch (size) { case IEEE_DOUBLE: #ifdef LIBDEBUG length = 8; #endif mbits = 52; bias = 1023; maxexp = 2047; break; case IEEE_SINGLE: #ifdef LIBDEBUG length = 4; #endif mbits = 23; bias = 127; maxexp = 255; break; default: return IEEE_BADCALL; } val = get_byte(bufp, offsets, &fieldindex); /* fetch sign byte & first part of characteristic */ sign = (val & 0x80) != 0; characteristic = (val & 0x7F); val = get_byte(bufp, offsets, &fieldindex); /* fetch rest of characteristic and start of mantissa */ switch (size) { case IEEE_SINGLE: characteristic <<= 1; characteristic |= (val & 0x80) != 0; /* grab last characteristic bit */ mantissa_high = 0; mantissa_low = (val &0x7F) << 16; mantissa_low |= get_byte(bufp, offsets, &fieldindex) << 8; mantissa_low |= get_byte(bufp, offsets, &fieldindex); break; case IEEE_DOUBLE: characteristic <<= 4; characteristic |= (val & 0xF0) >> 4; /* grab lower characteristic bits */ mantissa_high = (val & 0x0F) << 16; mantissa_high |= get_byte(bufp, offsets, &fieldindex) << 8; mantissa_high |= get_byte(bufp, offsets, &fieldindex); mantissa_low = get_byte(bufp, offsets, &fieldindex) << 24; mantissa_low |= get_byte(bufp, offsets, &fieldindex) << 16; mantissa_low |= get_byte(bufp, offsets, &fieldindex) << 8; mantissa_low |= get_byte(bufp, offsets, &fieldindex); break; default: return IEEE_BADCALL; } #ifdef LIBDEBUG if (debug > 4) { double d; float f; if (size == IEEE_SINGLE) { int i; for (i = 0; i < length; i++) { *((unsigned char *)(&f)+i) = *(*buffpp + offsets[i]); } d = f; } else { int i; for (i = 0; i < length; i++) { *((unsigned char *)(&d)+i) = *(*buffpp + offsets[i]); } } printf("fetchieee754: FP: %s -> %s -> %e(=%s)\n", fmt_hex(*buffpp, length), fmt_flt(sign, mantissa_high, mantissa_low, characteristic), d, fmt_hex((unsigned char *)&d, length)); } #endif *buffpp += fieldindex; /* * detect funny numbers */ if (characteristic == maxexp) { /* * NaN or Infinity */ if (mantissa_low || mantissa_high) { /* * NaN */ return IEEE_NAN; } else { /* * +Inf or -Inf */ return sign ? IEEE_NEGINFINITY : IEEE_POSINFINITY; } } else { /* * collect real numbers */ L_CLR(lfpp); /* * check for overflows */ exponent = characteristic - bias; if (exponent > 31) /* sorry - hardcoded */ { /* * overflow only in respect to NTP-FP representation */ return sign ? IEEE_NEGOVERFLOW : IEEE_POSOVERFLOW; } else { int frac_offset; /* where the fraction starts */ frac_offset = mbits - exponent; if (characteristic == 0) { /* * de-normalized or tiny number - fits only as 0 */ return IEEE_OK; } else { /* * adjust for implied 1 */ if (mbits > 31) mantissa_high |= 1 << (mbits - 32); else mantissa_low |= 1 << mbits; /* * take mantissa apart - if only all machine would support * 64 bit operations 8-( */ if (frac_offset > mbits) { lfpp->l_ui = 0; /* only fractional number */ frac_offset -= mbits + 1; /* will now contain right shift count - 1*/ if (mbits > 31) { lfpp->l_uf = mantissa_high << (63 - mbits); lfpp->l_uf |= mantissa_low >> (mbits - 33); lfpp->l_uf >>= frac_offset; } else { lfpp->l_uf = mantissa_low >> frac_offset; } } else { if (frac_offset > 32) { /* * must split in high word */ lfpp->l_ui = mantissa_high >> (frac_offset - 32); lfpp->l_uf = (mantissa_high & ((1 << (frac_offset - 32)) - 1)) << (64 - frac_offset); lfpp->l_uf |= mantissa_low >> (frac_offset - 32); } else { /* * must split in low word */ lfpp->l_ui = mantissa_high << (32 - frac_offset); lfpp->l_ui |= (mantissa_low >> frac_offset) & ((1 << (32 - frac_offset)) - 1); lfpp->l_uf = (mantissa_low & ((1 << frac_offset) - 1)) << (32 - frac_offset); } } /* * adjust for sign */ if (sign) { L_NEG(lfpp); } return IEEE_OK; } } } } int put_ieee754( unsigned char **bufpp, int size, l_fp *lfpp, offsets_t offsets ) { l_fp outlfp; #ifdef LIBDEBUG unsigned int sign; unsigned int bias; #endif /*unsigned int maxexp;*/ int mbits; int msb; u_long mantissa_low = 0; u_long mantissa_high = 0; #ifdef LIBDEBUG u_long characteristic = 0; long exponent; #endif /*int length;*/ unsigned long mask; outlfp = *lfpp; switch (size) { case IEEE_DOUBLE: /*length = 8;*/ mbits = 52; #ifdef LIBDEBUG bias = 1023; #endif /*maxexp = 2047;*/ break; case IEEE_SINGLE: /*length = 4;*/ mbits = 23; #ifdef LIBDEBUG bias = 127; #endif /*maxexp = 255;*/ break; default: return IEEE_BADCALL; } /* * find sign */ if (L_ISNEG(&outlfp)) { L_NEG(&outlfp); #ifdef LIBDEBUG sign = 1; #endif } else { #ifdef LIBDEBUG sign = 0; #endif } if (L_ISZERO(&outlfp)) { #ifdef LIBDEBUG exponent = mantissa_high = mantissa_low = 0; /* true zero */ #endif } else { /* * find number of significant integer bits */ mask = 0x80000000; if (outlfp.l_ui) { msb = 63; while (mask && ((outlfp.l_ui & mask) == 0)) { mask >>= 1; msb--; } } else { msb = 31; while (mask && ((outlfp.l_uf & mask) == 0)) { mask >>= 1; msb--; } } switch (size) { case IEEE_SINGLE: mantissa_high = 0; if (msb >= 32) { mantissa_low = (outlfp.l_ui & ((1 << (msb - 32)) - 1)) << (mbits - (msb - 32)); mantissa_low |= outlfp.l_uf >> (mbits - (msb - 32)); } else { mantissa_low = (outlfp.l_uf << (mbits - msb)) & ((1 << mbits) - 1); } break; case IEEE_DOUBLE: if (msb >= 32) { mantissa_high = (outlfp.l_ui << (mbits - msb)) & ((1 << (mbits - 32)) - 1); mantissa_high |= outlfp.l_uf >> (32 - (mbits - msb)); mantissa_low = (outlfp.l_ui & ((1 << (msb - mbits)) - 1)) << (32 - (msb - mbits)); mantissa_low |= outlfp.l_uf >> (msb - mbits); } else { mantissa_high = outlfp.l_uf << (mbits - 32 - msb); mantissa_low = outlfp.l_uf << (mbits - 32); } } #ifdef LIBDEBUG exponent = msb - 32; characteristic = exponent + bias; if (debug > 4) printf("FP: %s\n", fmt_flt(sign, mantissa_high, mantissa_low, characteristic)); #endif } return IEEE_OK; } #if defined(DEBUG) && defined(LIBDEBUG) int main( int argc, char **argv ) { static offsets_t native_off = { 0, 1, 2, 3, 4, 5, 6, 7 }; double f = 1.0; double *f_p = &f; l_fp fp; if (argc == 2) { if (sscanf(argv[1], "%lf", &f) != 1) { printf("cannot convert %s to a float\n", argv[1]); return 1; } } printf("double: %s %s\n", fmt_blong(*(unsigned long *)&f, 32), fmt_blong(*(unsigned long *)((char *)(&f)+4), 32)); printf("fetch from %f = %d\n", f, fetch_ieee754((void *)&f_p, IEEE_DOUBLE, &fp, native_off)); printf("fp [%s %s] = %s\n", fmt_blong(fp.l_ui, 32), fmt_blong(fp.l_uf, 32), mfptoa(fp.l_ui, fp.l_uf, 15)); f_p = &f; put_ieee754((void *)&f_p, IEEE_DOUBLE, &fp, native_off); return 0; } #endif /* * History: * * ieee754io.c,v * Revision 4.12 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.11 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.8 1999/02/21 12:17:36 kardel * 4.91f reconcilation * * Revision 4.7 1999/02/21 11:26:03 kardel * renamed index to fieldindex to avoid index() name clash * * Revision 4.6 1998/11/15 20:27:52 kardel * Release 4.0.73e13 reconcilation * * Revision 4.5 1998/08/16 19:01:51 kardel * debug information only compile for LIBDEBUG case * * Revision 4.4 1998/08/09 09:39:28 kardel * Release 4.0.73e2 reconcilation * * Revision 4.3 1998/06/13 11:56:19 kardel * disabled putbute() for the time being * * Revision 4.2 1998/06/12 15:16:58 kardel * ansi2knr compatibility * * Revision 4.1 1998/05/24 07:59:56 kardel * conditional debug support * * Revision 4.0 1998/04/10 19:46:29 kardel * Start 4.0 release version numbering * * Revision 1.1 1998/04/10 19:27:46 kardel * initial NTP VERSION 4 integration of PARSE with GPS166 binary support * * Revision 1.1 1997/10/06 21:05:45 kardel * new parse structure * */ ntp-4.2.6p5/libparse/clk_schmid.c0000644000175000017500000001576711307651603015700 0ustar peterpeter/* * /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 ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #if HAVE_CONFIG_H # include #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_SCHMID) #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "parse.h" #ifndef PARSESTREAM #include "ntp_stdlib.h" #include #else #include "sys/parsestreams.h" extern int printf (const char *, ...); #endif /* * Description courtesy of Adam W. Feigin et. al (Swisstime iis.ethz.ch) * * 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) * Bit 3: time zone, 1 byte, 0=MET, 1=MEST. (unused here) * Bit 4: clock status, 1 byte, 0=time invalid, * 1=time from crystal backup, * 3=time from DCF77 * Bit 5: transmitter status, 1 byte, * bit 0: backup antenna * bit 1: time zone change within 1h * bit 3,2: TZ 01=MEST, 10=MET * bit 4: leap second will be * added within one hour * bits 5-7: Zero * Bit 6: time in backup mode, units of 5 minutes (unused here) * */ #define WS_TIME 0x01 #define WS_SIGNAL 0x02 #define WS_ALTERNATE 0x01 #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 *); clockformat_t clock_schmid = { inp_schmid, /* no input handling */ cvt_schmid, /* Schmid conversion */ 0, /* not direct PPS monitoring */ 0, /* conversion configuration */ "Schmid", /* Schmid receiver */ 12, /* binary data buffer */ 0, /* no private data (complete messages) */ }; static u_long cvt_schmid( unsigned char *buffer, int size, struct format *format, clocktime_t *clock_time, void *local ) { if ((size != 11) || (buffer[10] != (unsigned char)'\375')) { return CVT_NONE; } else { if (buffer[0] > 23 || buffer[1] > 59 || buffer[2] > 59 || buffer[3] > 9) /* Time */ { return CVT_FAIL|CVT_BADTIME; } else if (buffer[4] < 1 || buffer[4] > 31 || buffer[5] < 1 || buffer[5] > 12 || buffer[6] > 99) { return CVT_FAIL|CVT_BADDATE; } else { clock_time->hour = buffer[0]; clock_time->minute = buffer[1]; clock_time->second = buffer[2]; clock_time->usecond = buffer[3] * 100000; clock_time->day = buffer[4]; clock_time->month = buffer[5]; clock_time->year = buffer[6]; clock_time->flags = 0; switch (buffer[8] & WS_TZ) { case WS_MET: clock_time->utcoffset = -1*60*60; break; case WS_MEST: clock_time->utcoffset = -2*60*60; clock_time->flags |= PARSEB_DST; break; default: return CVT_FAIL|CVT_BADFMT; } if (!(buffer[7] & WS_TIME)) { clock_time->flags |= PARSEB_POWERUP; } if (!(buffer[7] & WS_SIGNAL)) { clock_time->flags |= PARSEB_NOSYNC; } if (buffer[7] & WS_SIGNAL) { if (buffer[8] & WS_ALTERNATE) { clock_time->flags |= PARSEB_ALTERNATE; } if (buffer[8] & WS_ANNOUNCE) { clock_time->flags |= PARSEB_ANNOUNCE; } if (buffer[8] & WS_LEAP) { clock_time->flags |= PARSEB_LEAPADD; /* default: DCF77 data format deficiency */ } } clock_time->flags |= PARSEB_S_LEAP|PARSEB_S_ANTENNA; return CVT_OK; } } } /* * inp_schmid * * grep data from input stream */ static u_long inp_schmid( parse_t *parseio, unsigned int ch, timestamp_t *tstamp ) { unsigned int rtc; parseprintf(DD_PARSE, ("inp_schmid(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); switch (ch) { case 0xFD: /* */ parseprintf(DD_PARSE, ("mbg_input: ETX seen\n")); if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP) return parse_end(parseio); else return rtc; default: return parse_addchar(parseio, ch); } } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_SCHMID) */ int clk_schmid_bs; #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_SCHMID) */ /* * History: * * clk_schmid.c,v * Revision 4.9 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.8 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.5 1999/11/28 09:13:51 kardel * RECON_4_0_98F * * Revision 4.4 1998/06/13 12:06:03 kardel * fix SYSV clock name clash * * Revision 4.3 1998/06/12 15:22:29 kardel * fix prototypes * * Revision 4.2 1998/06/12 09:13:26 kardel * conditional compile macros fixed * printf prototype * * Revision 4.1 1998/05/24 09:39:53 kardel * implementation of the new IO handling model * * Revision 4.0 1998/04/10 19:45:31 kardel * Start 4.0 release version numbering * * from V3 3.22 log info deleted 1998/04/11 kardel */ ntp-4.2.6p5/libparse/gpstolfp.c0000644000175000017500000000527411307651604015427 0ustar peterpeter/* * /src/NTP/ntp4-dev/libntp/gpstolfp.c,v 4.8 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * gpstolfp.c,v 4.8 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * $Created: Sun Jun 28 16:30:38 1998 $ * * Copyright (c) 1998-2005 by Frank Kardel ntp.org> * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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 "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 */ void gpstolfp( int weeks, int days, unsigned long seconds, l_fp * lfp ) { if (weeks < GPSWRAP) { weeks += 1024; } lfp->l_ui = weeks * SECSPERWEEK + days * 86400 + seconds + GPSORIGIN; /* convert to NTP time */ lfp->l_uf = 0; } /* * History: * * gpstolfp.c,v * Revision 4.8 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.7 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.3 1999/02/28 11:42:44 kardel * (GPSWRAP): update GPS rollover to 990 weeks * * Revision 4.2 1998/07/11 10:05:25 kardel * Release 4.0.73d reconcilation * * Revision 4.1 1998/06/28 16:47:15 kardel * added gpstolfp() function */ ntp-4.2.6p5/libparse/clk_meinberg.c0000644000175000017500000005503411307651605016212 0ustar peterpeter/* * /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 ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #ifdef HAVE_CONFIG_H # include #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_MEINBERG) #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "ntp_machine.h" #include "parse.h" #ifndef PARSESTREAM #include #else #include "sys/parsestreams.h" #endif #include "ntp_stdlib.h" #include "ntp_stdlib.h" #include "mbg_gps166.h" #include "binio.h" #include "ascii.h" /* * The Meinberg receiver every second sends a datagram of the following form * (Standard Format) * * D:
..;T:;U:::; * 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 * = '\002' ASCII start of text * = '\003' ASCII end of text *
,, = day, month, year(2 digits!!) * = day of week (sunday= 0) * ,, = hour, minute, second * = '#' if never synced since powerup for DCF C51 * = '#' if not PZF sychronisation available for PZF 535/509 * = ' ' if ok * = '*' if time comes from internal quartz * = ' ' if completely synched * = 'S' if daylight saving time is active * = 'U' if time is represented in UTC * = ' ' if no special condition exists * = '!' during the hour preceeding an daylight saving time * start/end change * = 'A' leap second insert warning * = ' ' if no special condition exists * * Extended data format (PZFUERL for PZF type clocks) * *
..; ; ::; * pos: 0 00 0 00 0 00 11 1 11 11 1 11 2 22 22 2 2 2 2 2 3 3 3 * 1 23 4 56 7 89 01 2 34 56 7 89 0 12 34 5 6 7 8 9 0 1 2 * = '\002' ASCII start of text * = '\003' ASCII end of text *
,, = day, month, year(2 digits!!) * = day of week (sunday= 0) * ,, = hour, minute, second * = 'U' UTC time display * = '#' if never synced since powerup else ' ' for DCF C51 * '#' if not PZF sychronisation available else ' ' for PZF 535/509 * = '*' if time comes from internal quartz else ' ' * = 'S' if daylight saving time is active else ' ' * = '!' during the hour preceeding an daylight saving time * start/end change * = 'A' LEAP second announcement * = 'R' alternate antenna * * Meinberg GPS166 receiver * * You must get the Uni-Erlangen firmware for the GPS receiver support * to work to full satisfaction ! * *
..; ; ::; <+/-><00:00>; ; * * 000000000111111111122222222223333333333444444444455555555556666666 * 123456789012345678901234567890123456789012345678901234567890123456 * \x0209.07.93; 5; 08:48:26; +00:00; #*S!A L; 49.5736N 11.0280E 373m\x03 * * * = '\002' ASCII start of text * = '\003' ASCII end of text *
,, = day, month, year(2 digits!!) * = day of week (sunday= 0) * ,, = hour, minute, second * <+/->,<00:00> = offset to UTC * = '#' if never synced since powerup else ' ' * = '*' if position is not confirmed else ' ' * = 'S' if daylight saving time is active else ' ' * = '!' during the hour preceeding an daylight saving time * start/end change * = 'A' LEAP second announcement * = 'R' alternate antenna (reminiscent of PZF535) usually ' ' * = 'L' on 23:59:60 * * Binary messages have a lead in for a fixed header of SOH */ /*--------------------------------------------------------------*/ /* Name: csum() */ /* */ /* Purpose: Compute a checksum about a number of bytes */ /* */ /* Input: uchar *p address of the first byte */ /* short n the number of bytes */ /* */ /* Output: -- */ /* */ /* Ret val: the checksum */ /*+-------------------------------------------------------------*/ unsigned long mbg_csum( unsigned char *p, unsigned int n ) { unsigned long sum = 0; short i; for ( i = 0; i < n; i++ ) sum += *p++; return( sum ); } /* csum */ void get_mbg_header( unsigned char **bufpp, 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); } static struct format meinberg_fmt[] = { { { { 3, 2}, { 6, 2}, { 9, 2}, { 18, 2}, { 21, 2}, { 24, 2}, { 14, 1}, { 27, 4}, { 29, 1}, }, (const unsigned char *)"\2D: . . ;T: ;U: . . ; \3", 0 }, { /* special extended FAU Erlangen extended format */ { { 1, 2}, { 4, 2}, { 7, 2}, { 14, 2}, { 17, 2}, { 20, 2}, { 11, 1}, { 25, 4}, { 27, 1}, }, (const unsigned char *)"\2 . . ; ; : : ; \3", MBG_EXTENDED }, { /* special extended FAU Erlangen GPS format */ { { 1, 2}, { 4, 2}, { 7, 2}, { 14, 2}, { 17, 2}, { 20, 2}, { 11, 1}, { 32, 7}, { 35, 1}, { 25, 2}, { 28, 2}, { 24, 1} }, (const unsigned char *)"\2 . . ; ; : : ; : ; ; . . ", 0 } }; 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 *); struct msg_buf { unsigned short len; /* len to fill */ unsigned short phase; /* current input phase */ }; #define MBG_NONE 0 /* no data input */ #define MBG_HEADER 1 /* receiving header */ #define MBG_DATA 2 /* receiving data */ #define MBG_STRING 3 /* receiving standard data message */ clockformat_t clock_meinberg[] = { { mbg_input, /* normal input handling */ cvt_meinberg, /* Meinberg conversion */ pps_one, /* easy PPS monitoring */ 0, /* conversion configuration */ "Meinberg Standard", /* Meinberg simple format - beware */ 32, /* string buffer */ 0 /* no private data (complete pakets) */ }, { mbg_input, /* normal input handling */ cvt_meinberg, /* Meinberg conversion */ pps_one, /* easy PPS monitoring */ 0, /* conversion configuration */ "Meinberg Extended", /* Meinberg enhanced format */ 32, /* string buffer */ 0 /* no private data (complete pakets) */ }, { gps_input, /* no input handling */ cvt_mgps, /* Meinberg GPS166 conversion */ pps_one, /* easy PPS monitoring */ (void *)&meinberg_fmt[2], /* conversion configuration */ "Meinberg GPS Extended", /* Meinberg FAU GPS format */ 512, /* string buffer */ sizeof(struct msg_buf) /* no private data (complete pakets) */ } }; /* * cvt_meinberg * * convert simple type format */ static u_long cvt_meinberg( unsigned char *buffer, int size, struct format *unused, clocktime_t *clock_time, void *local ) { struct format *format; /* * select automagically correct data format */ if (Strok(buffer, meinberg_fmt[0].fixed_string)) { format = &meinberg_fmt[0]; } else { if (Strok(buffer, meinberg_fmt[1].fixed_string)) { format = &meinberg_fmt[1]; } else { return CVT_FAIL|CVT_BADFMT; } } /* * collect data */ if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day, format->field_offsets[O_DAY].length) || Stoi(&buffer[format->field_offsets[O_MONTH].offset], &clock_time->month, format->field_offsets[O_MONTH].length) || Stoi(&buffer[format->field_offsets[O_YEAR].offset], &clock_time->year, format->field_offsets[O_YEAR].length) || Stoi(&buffer[format->field_offsets[O_HOUR].offset], &clock_time->hour, format->field_offsets[O_HOUR].length) || 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)) { return CVT_FAIL|CVT_BADFMT; } else { unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset]; clock_time->usecond = 0; clock_time->flags = PARSEB_S_LEAP; if (clock_time->second == 60) clock_time->flags |= PARSEB_LEAPSECOND; /* * in the extended timecode format we have also the * indication that the timecode is in UTC * for compatibilty reasons we start at the USUAL * offset (POWERUP flag) and know that the UTC indication * is the character before the powerup flag */ if ((format->flags & MBG_EXTENDED) && (f[-1] == 'U')) { /* * timecode is in UTC */ clock_time->utcoffset = 0; /* UTC */ clock_time->flags |= PARSEB_UTC; } else { /* * only calculate UTC offset if MET/MED is in time code * or we have the old time code format, where we do not * know whether it is UTC time or MET/MED * pray that nobody switches to UTC in the *old* standard time code * ROMS !!!! The new ROMS have 'U' at the ZONE field - good. */ switch (buffer[format->field_offsets[O_ZONE].offset]) { case ' ': clock_time->utcoffset = -1*60*60; /* MET */ break; case 'S': clock_time->utcoffset = -2*60*60; /* MED */ break; case 'U': /* * timecode is in UTC */ 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 * expected to speed up */ 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; } return CVT_OK; } } /* * mbg_input * * grep data from input stream */ static u_long mbg_input( parse_t *parseio, unsigned int 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) return parse_end(parseio); else return rtc; default: return parse_addchar(parseio, ch); } } /* * cvt_mgps * * convert Meinberg GPS format */ static u_long cvt_mgps( unsigned char *buffer, int size, struct format *format, clocktime_t *clock_time, void *local ) { if (!Strok(buffer, format->fixed_string)) { return cvt_meinberg(buffer, size, format, clock_time, local); } else { if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day, format->field_offsets[O_DAY].length) || Stoi(&buffer[format->field_offsets[O_MONTH].offset], &clock_time->month, format->field_offsets[O_MONTH].length) || Stoi(&buffer[format->field_offsets[O_YEAR].offset], &clock_time->year, format->field_offsets[O_YEAR].length) || Stoi(&buffer[format->field_offsets[O_HOUR].offset], &clock_time->hour, format->field_offsets[O_HOUR].length) || 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)) { return CVT_FAIL|CVT_BADFMT; } else { 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; /* * calculate UTC offset */ if (Stoi(&buffer[format->field_offsets[O_UTCHOFFSET].offset], &h, format->field_offsets[O_UTCHOFFSET].length)) { return CVT_FAIL|CVT_BADFMT; } else { if (Stoi(&buffer[format->field_offsets[O_UTCMOFFSET].offset], &clock_time->utcoffset, format->field_offsets[O_UTCMOFFSET].length)) { return CVT_FAIL|CVT_BADFMT; } clock_time->utcoffset += TIMES60(h); clock_time->utcoffset = TIMES60(clock_time->utcoffset); if (buffer[format->field_offsets[O_UTCSOFFSET].offset] != '-') { 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) */ if (f[1] == '*') clock_time->flags |= PARSEB_NOSYNC; 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 * expected to speed up */ 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 */ if ((f[6] == 'L') || (clock_time->second == 60)) clock_time->flags |= PARSEB_LEAPSECOND; return CVT_OK; } } } /* * gps_input * * grep binary data from input stream */ static u_long gps_input( parse_t *parseio, unsigned int 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; case STX: parseprintf(DD_PARSE, ("gps_input: STX seen\n")); msg_buf->len = 0; msg_buf->phase = MBG_STRING; /* prepare to receive ASCII ETX delimited message */ parseio->parse_index = 1; parseio->parse_data[0] = ch; break; default: return PARSE_INP_SKIP; /* keep searching */ } parseio->parse_dtime.parse_msglen = 1; /* reset buffer pointer */ parseio->parse_dtime.parse_msg[0] = ch; /* fill in first character */ parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */ return PARSE_INP_SKIP; } /* SOH/STX has already been received */ /* save incoming character in both buffers if needbe */ 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)) { msg_buf->phase = MBG_NONE; /* buffer overflow - discard */ parseio->parse_data[parseio->parse_index] = '\0'; memcpy(parseio->parse_ldata, parseio->parse_data, (unsigned)(parseio->parse_index+1)); parseio->parse_ldsize = parseio->parse_index; return PARSE_INP_DATA; } switch (msg_buf->phase) { case MBG_HEADER: case MBG_DATA: msg_buf->len--; if ( msg_buf->len ) /* transfer not complete */ return PARSE_INP_SKIP; parseprintf(DD_PARSE, ("gps_input: %s complete\n", (msg_buf->phase == MBG_DATA) ? "data" : "header")); break; case MBG_STRING: if ((ch == ETX) || (parseio->parse_index >= parseio->parse_dsize)) { msg_buf->phase = MBG_NONE; parseprintf(DD_PARSE, ("gps_input: string complete\n")); parseio->parse_data[parseio->parse_index] = '\0'; memcpy(parseio->parse_ldata, parseio->parse_data, (unsigned)(parseio->parse_index+1)); parseio->parse_ldsize = parseio->parse_index; parseio->parse_index = 0; return PARSE_INP_TIME; } else { return PARSE_INP_SKIP; } } /* cnt == 0, so the header or the whole message is complete */ 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)); calc_csum = mbg_csum( (unsigned char *) parseio->parse_dtime.parse_msg + 1, (unsigned short)6 ); if ( calc_csum != header.gps_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 */ { msg_buf->phase = MBG_NONE; /* back to hunting mode */ return (header.gps_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 */ 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 */ msg_buf->phase = MBG_NONE; /* back to hunting mode */ return PARSE_INP_DATA; /* message complete, must be evaluated */ } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_MEINBERG) */ int clk_meinberg_bs; #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_MEINBERG) */ /* * History: * * clk_meinberg.c,v * Revision 4.12.2.1 2005/09/25 10:22:35 kardel * cleanup buffer bounds * * Revision 4.12 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.11 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * Revision 4.8 1999/11/28 09:13:50 kardel * RECON_4_0_98F * * Revision 4.7 1999/02/21 11:09:14 kardel * cleanup * * Revision 4.6 1998/06/14 21:09:36 kardel * Sun acc cleanup * * Revision 4.5 1998/06/13 15:18:54 kardel * fix mem*() to b*() function macro emulation * * Revision 4.4 1998/06/13 12:03:23 kardel * fix SYSV clock name clash * * Revision 4.3 1998/06/12 15:22:28 kardel * fix prototypes * * Revision 4.2 1998/05/24 16:14:42 kardel * support current Meinberg standard data formats * * Revision 4.1 1998/05/24 09:39:52 kardel * implementation of the new IO handling model * * Revision 4.0 1998/04/10 19:45:29 kardel * Start 4.0 release version numbering * * from V3 3.23 - log info deleted 1998/04/11 kardel * */ ntp-4.2.6p5/libparse/clk_varitext.c0000644000175000017500000002024311307651604016261 0ustar peterpeter#ifdef HAVE_CONFIG_H # include #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_VARITEXT) /* * /src/NTP/ntp4-dev/libparse/clk_varitext.c,v 1.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A * * 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 ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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 "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "parse.h" #ifndef PARSESTREAM # include "ntp_stdlib.h" # include #else # include "sys/parsestreams.h" extern int printf (const char *, ...); #endif static const u_char VT_INITIALISED = 0x01; static const u_char VT_SYNCHRONISED = 0x02; static const u_char VT_ALARM_STATE = 0x04; static const u_char VT_BST = 0x08; static const u_char VT_SEASON_CHANGE = 0x10; 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 * 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 * 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 5 - Set= Last MSF telegram was OK; Reset= Last telegram was in error; * Bit 6 - Always set * Bit 7 - Unused * XXX Checksum calculated using Fletcher's method (ignored for now). */ static struct format varitext_fmt = { { {8, 2}, {5, 2}, {2, 2}, /* day, month, year */ {14, 2}, {17, 2}, {20, 2}, /* hour, minute, second */ {11, 2}, {24, 1} /* dayofweek, status */ }, (const unsigned char*)"T: : : : : : : \r\n ", 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 *); struct varitext { unsigned char start_found; unsigned char end_found; unsigned char end_count; unsigned char previous_ch; timestamp_t tstamp; }; clockformat_t clock_varitext = { inp_varitext, /* Because of the strange format we need to parse it ourselves */ cvt_varitext, /* Varitext conversion */ 0, /* no PPS monitoring */ (void *)&varitext_fmt, /* conversion configuration */ "Varitext Radio Clock", /* Varitext Radio Clock */ 30, /* string buffer */ sizeof(struct varitext), /* Private data size required to hold current parse state */ }; /* * cvt_varitext * * convert simple type format */ static u_long cvt_varitext( unsigned char *buffer, int size, struct format *format, clocktime_t *clock_time, void *local ) { if (!Strok(buffer, format->fixed_string)) { return CVT_NONE; } else { if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day, format->field_offsets[O_DAY].length) || Stoi(&buffer[format->field_offsets[O_MONTH].offset], &clock_time->month, format->field_offsets[O_MONTH].length) || Stoi(&buffer[format->field_offsets[O_YEAR].offset], &clock_time->year, format->field_offsets[O_YEAR].length) || Stoi(&buffer[format->field_offsets[O_HOUR].offset], &clock_time->hour, format->field_offsets[O_HOUR].length) || 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)) { return CVT_FAIL | CVT_BADFMT; } else { u_char *f = (u_char*) &buffer[format->field_offsets[O_FLAGS].offset]; clock_time->flags = 0; clock_time->utcoffset = 0; if (((*f) & VT_BST)) /* BST flag is set so set to indicate daylight saving time is active and utc offset */ { clock_time->utcoffset = -1*60*60; clock_time->flags |= PARSEB_DST; } /* if (!((*f) & VT_INITIALISED)) Clock not initialised clock_time->flags |= PARSEB_POWERUP; if (!((*f) & VT_SYNCHRONISED)) Clock not synchronised clock_time->flags |= PARSEB_NOSYNC; if (((*f) & VT_SEASON_CHANGE)) Seasonal change expected in the next hour clock_time->flags |= PARSEB_ANNOUNCE; */ return CVT_OK; } } } static u_long inp_varitext( parse_t *parseio, unsigned int ch, timestamp_t *tstamp ) { struct varitext *t = (struct varitext *)parseio->parse_pdata; int rtc; parseprintf(DD_PARSE, ("inp_varitext(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); if (!t) return PARSE_INP_SKIP; /* local data not allocated - sigh! */ if (ch == 'T') t->tstamp = *tstamp; if ((t->previous_ch == 'T') && (ch == ':')) { parseprintf(DD_PARSE, ("inp_varitext: START seen\n")); parseio->parse_data[0] = 'T'; parseio->parse_index=1; parseio->parse_dtime.parse_stime = t->tstamp; /* Time stamp at packet start */ t->start_found = 1; t->end_found = 0; t->end_count = 0; } if (t->start_found) { if ((rtc = parse_addchar(parseio, ch)) != PARSE_INP_SKIP) { parseprintf(DD_PARSE, ("inp_varitext: ABORTED due to too many characters\n")); memset(t, 0, sizeof(struct varitext)); return rtc; } if (t->end_found) { if (++(t->end_count) == 4) /* Finally found the end of the message */ { parseprintf(DD_PARSE, ("inp_varitext: END seen\n")); memset(t, 0, sizeof(struct varitext)); if ((rtc = parse_addchar(parseio, 0)) == PARSE_INP_SKIP) return parse_end(parseio); else return rtc; } } if ((t->previous_ch == '\r') && (ch == '\n')) { t->end_found = 1; } } t->previous_ch = ch; return PARSE_INP_SKIP; } #else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_VARITEXT) */ int clk_varitext_bs; #endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_VARITEXT) */ /* * History: * * clk_varitext.c,v * Revision 1.5 2005/04/16 17:32:10 kardel * update copyright * * Revision 1.4 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * * * Revision 1.0 1997/06/02 13:16:30 McConnell * File created * */ ntp-4.2.6p5/TODO0000644000175000017500000000542410441361167012311 0ustar peterpeter *** IF YOU CAN HELP FIX ANY OF THESE THINGS, PLEASE DO! *** 010402: Look harder at -lm and -lelf - they are needed less and less... 970711: Look Real Hard at changing the key stuff from u_long to u_int32. 970711: Make sure it's safe to convert proto_config's 2nd argument from u_long to u_int32. Watch "set" in ntp_request.c:setclr_flags(). 970318: in hourly_stats(?), squawk if the magnitude of the drift is, say, >400. 970301: Implement the utmp/wtmp timestamping on time steps. 970210: Find a way to dump the current configuration to either syslog or a file. Problems that need to be fixed: - Get rid of the old SYS_* macros: (It's worth noting that any code that would have been "enabled" by any of these macros has not been used since 5.83, and there have been very few complaints...) SYS_44BSD: authstuff/md5driver.c SYS_BSDI: authstuff/md5driver.c SYS_DECOSF1: util/ntptime.c SYS_DOMAINOS: parseutil/dcfd.c xntpd/ntpd.c SYS_HPUX: kernel/sys/ppsclock.h ntpdate/ntpdate.c ntptrace/ntptrace.c SYS_PTX: libntp/machines.c SYS_SOLARIS: libparse/parse.c libparse/clk_trimtsip.c xntpd/ntp_io.c xntpd/ntp_refclock.c xntpd/ntpd.c SYS_SUNOS4: libparse/parse.c libparse/clk_trimsip.c SYS_WINNT: include/ntp.h include/ntp_fp.h include/ntp_if.h include/ntp_machine.h include/ntp_select.h include/ntp_syslog.h include/ntp_unixtime.h include/ntpd.h libntp/libntp.mak libntp/machines.c libntp/mexit.c libntp/msyslog.c libntp/systime.c ntpdate/ntpdate.c ntpdate/ntpdate.mak ntpq/ntpq.c ntpq/ntpq.mak ntpq/ntpq_ops.c ntptrace/ntptrace.c ntptrace/ntptrace.mak xntpd/ntp_config.c xntpd/ntp_filegen.c xntpd/ntp_intres.c xntpd/ntp_io.c xntpd/ntp_loopfilter.c xntpd/ntp_peer.c xntpd/ntp_proto.c xntpd/ntp_refclock.c xntpd/ntp_timer.c xntpd/ntp_unixclock.c xntpd/ntp_util.c xntpd/ntpd.c xntpd/xntpd.mak xntpdc/ntpdc.c xntpdc/xntpdc.mak - config.guess might need help to identify: Fujitsu's UXP --enable-adjtime-is-accurate --enable-step-slew Unixware --enable-adjtime-is-accurate --enable-tick=10000 --enable-tickadj=80 --enable-udp-wildcard --disable-step-slew DomainOS --enable-adjtime-is-accurate --disable-kmem --enable-tick=1000000 OpenVMS --enable-slew-always --enable-hourly-todr-sync Is adjtime accurate on ALL sysv4* machines? Can we identify DomainOS with *-apollo-* ? Do we catch all Unixware machines with *-univel-sysv* ? - Combine enable-step-slew and enable-ntpdate-step - Make sure enable-hourly-todr-sync is always disabled What about NextStep and OpenVMS, where hourly TODR sync used to be enabled? - Check dcfd.c for variables that need to be volatile. ntp-4.2.6p5/CommitLog-4.1.00000644000175000017500000057522710555347762014124 0ustar peterpeter2001-08-01 Harlan Stenn * configure.in: 4.1.0 2001-07-27 Harlan Stenn * ntpd/refclock_oncore.c (oncore_start): Set pps_enable=1, just like the atom driver does. From: reg@dwf.com * ntpd/refclock_nmea.c (nmea_ppsapi): Set pps_enable=1, just like the atom driver does. From: Scott Allendorf * ntpd/ntp_config.c (getconfig): CONF_CLOCK_PANIC was using the wrong config flag. From: 2001-07-10 Harlan Stenn * configure.in: 4.0.99m-rc3 2001-07-06 Harlan Stenn * ntp_update: COPYRIGHT needs a touch. From: Mike Stump 2001-07-04 Harlan Stenn * html/config.htm: Major cleanup. From: Martin Janzen * configure.in (rt library check): Don't look for -lrt under Linux. Under glibc-2.1.2 and -2.2.2 (at least), the POSIX- compatibility real-time library does strange things with threads as other processes and we're getting lots of complaints about it. Reported by: Juha Sarlin 2001-06-30 Harlan Stenn * html/driver35.htm: Update email address. 2001-06-25 Harlan Stenn * ntpd/refclock_oncore.c (oncore_msg_BaEaHa): Fix wrong offset for rsm.bad_almanac From: Reynir Siik 2001-06-12 Harlan Stenn * configure.in: 4.0.99m-rc2 2001-06-10 Harlan Stenn * ntpd/ntp_config.c: * include/ntp_config.h: includefile config keyword support From: Dean Gibson 2001-06-08 Harlan Stenn * configure.in: 4.0.99m-rc1b * ntpd/refclock_true.c (true_debug): Bump some buffer sizes to reduce/eliminate chance of buffer overflow. Use snprintf() instead of sprintf(). Do a better job of opening the debug file. * ntpd/ntp_control.c (ctl_getitem): Count overflow packets as bad and return a BADFMT. * ntpd/ntp_config.c (save_resolve): call fdopen() with the correct mode. From: Bela Lubkin 2001-06-03 Harlan Stenn * include/ntp.h (RES_ALLFLAGS): Add RES_DEMOBILIZE. From: Dean Gibson * configure.in: 4.0.99m-rc1a 2001-06-02 Harlan Stenn * ntpd/ntp_refclock.c (refclock_open): Add O_NOCTTY to the open() flags when opening a serial port. Reported by: joseph lang 2001-05-31 Harlan Stenn * html/notes.htm: Typo fix. From: John Stone * configure.in: 4.0.99m-rc1 * html/monopt.htm: Typo fix. * html/confopt.htm: Cruft removal. From: John Stone 2001-05-30 Harlan Stenn * README.cvs: More updates and cleanup. * ntpd/ntp_loopfilter.c (loop_config): Check against STA_NANO instead of (NTP_API > 3) to catch kernels that were rolled while the spec was evolving. From: John.Hay@icomtek.csir.co.za * README.cvs: Note that we want to check out NTP into a clean subdir. Reported by jrd@cc.usu.edu (Joe Doupnik) 2001-05-27 Harlan Stenn * configure.in: 4.0.99k40 * include/ntp_refclock.h: Median Filter (SAMPLE - macro) - change to use most recent MAXSTAGE entries when the filter overflows (ie driver poking say once per second with poll > MAXSTAGE) rather than blocking after MAXSTAGE entries (turf oldest rather than turf most recent). From: John Woolner * ntpd/refclock_true.c: a. Don't cream pp->a_lastcode when we get a pair b. Fix up pp->leap handling to work correctly c. clear CEVNT_BADTIME etc warnings when we get good clock CEVNT_NOMINAL. From: John Woolner * kernel/sys/pcl720.h: Add support for the XL clock to refclock_true.c From: Paul A Vixie * ntpd/ntp_loopfilter.c (local_clock): One more attempt at "improving" the panic message. 2001-05-26 Harlan Stenn * configure.in (ac_cv_func_ctty_for_f_setown): BSDI3 needs a ctty for F_SETOWN, too. From: Paul A Vixie 2001-05-24 Harlan Stenn * html/ntpd.htm: Typo. From: John Stone 2001-05-23 Harlan Stenn * configure.in: 4.0.99k39 * ntpd/ntp_loopfilter.c (local_clock): huffpuff cleanup/improvements. (huffpuff): Cleanup/improvements. (loop_config): huffpuff initialization cleanup/improvements. From: Dave Mills, Terje, Mark, and John? 2001-05-22 Harlan Stenn * html/release.htm: * html/ntpd.htm: * html/miscopt.htm: From: Dave Mills: Updates. 2001-05-21 Harlan Stenn * configure.in: 4.0.99k38 * ntpd/ntp_proto.c (clock_filter): Huff-n-Puff and Popcorn improvements. * ntpd/ntp_loopfilter.c (local_clock): Debug cleanup From: Dave Mills. * include/ntp_syscall.h (ntp_gettime): Updated patch from Ulrich. My original attempt was not backwards compatible. 2001-05-17 Harlan Stenn * include/ntp_syscall.h (ntp_gettime): Fill in the tai member. From: Ulrich Windl * configure.in: 4.0.99k37 * ntpd/ntp_proto.c (clock_filter): Lose "off", xtemp and ytemp, and some obsoleted calculations. Set the peer->offset and peer->delay from the filter stages. * ntpd/ntp_loopfilter.c: Comment/document improvements. (local_clock): correct the offset by one-half the difference between the sample delay and minimum delay. Lose "mu" from the debug message. From: Dave Mills. 2001-05-15 Harlan Stenn * configure.in: 4.0.99k36 * ntpd/ntp_loopfilter.c: Huff-n-puff cleanup From: Dave Mills. 2001-05-14 Harlan Stenn * configure.in: 4.0.99k35 * ntpd/refclock_atom.c (atom_ppsapi): set pps_enable=1 if enb_hardpps. * ntpd/ntp_timer.c: huffpuff support. (init_timer): huffpuff support. (timer): huffpuff support. * ntpd/ntp_proto.c (init_proto): Initialize pps_enable to 0, not 1. * ntpd/ntp_loopfilter.c (CLOCK_HUFFPUFF): Added. Add huff-n-puff filter variables. (local_clock): Lose "pps sync enabled" log noise. (huffpuff): Added. (loop_config): LOOP_MINPOLL and LOOP_ALLAN were missing the trailing break; add LOOP_HUFFPUFF. * ntpd/ntp_config.c: tinker huffpuff added. (getconfig): CONF_CLOCK_HUFFPUFF support. * include/ntpd.h: huffpuff() declaration. * include/ntp_config.h (CONF_CLOCK_HUFFPUFF): Added. * include/ntp.h (HUFFPUFF): Added. (LOOP_HUFFPUFF): Added. From: Dave Mills. 2001-05-11 Harlan Stenn * html/driver20.htm: Reality check. * ntpd/refclock_nmea.c: Comment cleanup From: John Woolner * html/release.htm: Cleanup (at least). * html/refclock.htm: Cleanup (at least). * html/kern.htm: Cleanup (at least). * html/index.htm: Cleanup (at least). * html/extern.htm: Cleanup (at least). * html/driver1.htm: Cleanup (at least). * html/debug.htm: Cleanp (at least). * html/accopt.htm: KoD documentation update. From: Dave Mills. * configure.in: 4.0.99k34 * ntpd/ntp_util.c (record_loop_stats): values are now passed in. * ntpd/ntp_loopfilter.c (local_clock): pass the values to record_loop_stats(). * include/ntpd.h: Pass the parameters in to record_loop_stats(). With the discipline loop opened (disable ntp) the local clock updates were not being sent to loopstats. That now is. From: Dave Mills. 2001-05-10 Harlan Stenn * configure.in: 4.0.99k33 * ntpd/ntp_proto.c (receive): Validate the source port. Lose NTPv1 support. * ntpd/ntp_loopfilter.c (local_clock): Sanity check sys_poll earlier instead of later. From: Dave Mills. * ntpd/refclock_oncore.c (oncore_msg_any): We don't always have GETTIMEOFDAY(). 2001-05-09 Harlan Stenn * ntpd/refclock_shm.c (shm_poll): Apply JAN_1970 correction after calling TVTOTS(), just like everybody else does. From: David Malone * ntpd/refclock_ulink.c: fixed 33x quality flag, added more debugging stuff, updated 33x time code explanation. From: s.l.smith (via j.c.lang). 2001-05-08 Harlan Stenn * configure.in: 4.0.99k32 * ntpd/ntp_loopfilter.c: rstclock now takes a 3rd argument, the last offset. (init_loopfilter): Use it. (local_clock): Use it. Clean up the code. (loop_config): Use it. (rstclock): Implement it. Clean up the code. From Dave Mills. 2001-05-06 Harlan Stenn * configure.in: 4.0.99k31 * ntpdc/ntpdc_ops.c (sysstats): That's 'bad packet format' (instead of '... length'), and 'packets rejected' (instead of 'limitation rejects'. * ntpd/ntp_proto.c (receive): PUBKEY fixes. Move KoD stuff to process_packet(). (process_packet): Move KoD stuff here... (peer_clear): Unspec the stratum, too. (clock_filter): Don't update peer->epoch here. Fix the filter test when checking the epoch. (fast_xmit): Send back STRATUM_UNSPEC on a KoD packet. (init_proto): Initialize sys_jitter. * ntpd/ntp_loopfilter.c: rstclock() takes 2 parameters now. (init_loopfilter): Use it... (local_clock): Ditto, and change the "mu" calculation. Improve the jitter test in S_SYNC. Use peer->epoch (not current_time) to update the last_time. Update debug info. (rstclock): 2nd arg - the epoch to use. Use it. (loop_config): update call to rstclock. From: Dave Mills. 2001-05-01 Harlan Stenn * ports/winnt/ntpd/ntpd.dsp: Add cmd_args.c From: Wink Saville 2001-04-29 Harlan Stenn * ntpq/ntpq.c (tstflags): 11 now. From: John Cochran * ntpd/ntp_proto.c (receive): KoD updates. Improve the comments. Lose the AM_PROCPKT restrictions test. (peer_xmit): Check/report on no encryption key in packet. (fast_xmit): Use peer_xmit's new packet length check code. From Dave Mills. 2001-04-28 Harlan Stenn * configure.in: 4.0.99k30 2001-04-27 Harlan Stenn * ntpdc/ntpdc_ops.c: Added "kod", lost "demobilize". * ntpd/ntp_config.c: Added "kod" keyword. Lose "demobilize" keyword. * html/release.htm: Updated. * html/accopt.htm: Updated. From: Dave Mills. * ntpq/ntpq.c: Reorder and add some TEST flag bits. * ntpd/ntp_proto.c (transmit): Also bail if access denied. (receive): Lose RES_DEMOBILIZE and (some?) RES_DONTSERVE and RES_LIMITIED stuff. Update Kiss-Of-Death (KoD) docs. Call fast_xmit with new 3rd parameter (restrict_mask). Before checking for an authentic packet, check the restrict_mask for RES_{DONTSERVE,LIMITED,NOPEER}. Check restrictions in AM_PROCPKT case. (peer_clear): Don't lose the stratum if the peer->flags don't indicate FLAG_REFCLOCK. (fast_xmit): Take restrict mask as a new argument, and handle KoD. Reorder some code. From: Dave Mills. 2001-04-26 Harlan Stenn * ntpdc/ntpdc_ops.c: restrict/unrestrict support for version and demobilize. Implement demobilze. * ntpd/ntp_proto.c (receive): Improve version testing, including RES_DEMOBILIZE support. (fast_xmit): Patches to kiss-of-death packet. * ntpd/ntp_loopfilter.c (local_clock): S_SYNC case now also checks abs(clock_offset) against CLOCK_PGATE*sys_jitter. * ntpd/ntp_config.c: CONF_RES_DEMOBILIZE/demobilize support. * include/ntp_config.h (CONF_RES_DEMOBILIZE): Added. * include/ntp.h (RES_DEMOBILIZE): Added. From Dave Mills. 2001-04-25 Harlan Stenn * html/accopt.htm: Document the "version" parameter From Dave Mills. * ntpd/ntp_proto.c (fast_xmit): Implement DENY mode. From Dave Mills. * ntpd/ntp_config.c: Add the "allan" tinker variable. From: Juha Sarlin * ntpd/refclock_hopfpci.c (hopfpci_start): Lose the "correct_any" stuff - it's both obsolete and wrong. * ntpd/ntp_proto.c (receive): Keep track of packet versions. Implement RES_LIMITED. * include/ntp_config.h (CONF_RES_LIMITED): * include/ntp.h (RES_LIMITED): Leave the bits in the original order. From Dave Mills. * util/timetrim.c: * util/Makefile.am: * ntpdc/ntpdc_ops.c: * ntpd/refclock_nmea.c: * libntp/snprintf.c: * configure.in: * configure: * config.h.in: * aclocal.m4: * acconfig.h: Lint cleanup from: Marc Brett * ntpd/ntp_config.c: Add "version" support. (getconfig): version support. * include/ntp_config.h (CONF_RES_VERSION): Added. * include/ntp.h (RES_VERSION): Added. From: Dave Mills. * include/ntp_machine.h (ifreq): WinNT cleanup 2001-04-23 Harlan Stenn * configure.in: 4.0.99k29 * html/miscopt.htm: Document the "allan" tinker variable. * ntpd/ntp_proto.c (clock_filter): Update comments. Lose etemp; we now use allan_xpt for this. * ntpd/ntp_loopfilter.c: Added allan_xpt as a tinker variable. Reorganize variables and improve comments. (local_clock): Improve comments, use (new) allan_xpt instead of CLOCK_ALLAN. Fix test in S_SYNC state. Update debug info. (rstclock): No longer force allan_xpt to CVLOCK_ALLAN in S_FREQ, S_SYNC, or default case. (loop_config): Document dangerous tinker variables, and add LOOP_ALLAN to the list. * include/ntp_config.h (CONF_CLOCK_ALLAN): Added. * include/ntp.h (LOOP_ALLAN): Added. Allan intercept fixes from Dave Mills. * scripts/mkver.in: Use the C locale so the dates come out in a consistent format. From: ASANO Naoyuki * build: Run "config.status" before the "make" because it probably saves time and trouble. Probably... * flock-build: Try building sequentially. 2001-04-22 Harlan Stenn * configure.in (ac_cv_make_tickadj): Fix it right... * util/ntp-genkeys.c: extern config_netinfo, too. * util/hist.c: * ntptrace/ntptrace.c: * ntpq/ntpq.c: * ntpdc/ntpdc.c: * ntpdate/ntptimeset.c: * ntpdate/ntpdate.c: * ntpd/refclock_parse.c: * ntpd/refclock_msfees.c: * ntpd/refclock_jupiter.c: * ntpd/ntp_refclock.c: * ntpd/ntp_io.c: * libparse/clk_wharton.c: * libparse/clk_varitext.c: * libparse/clk_trimtaip.c: * libparse/clk_schmid.c: * libparse/clk_rcc8000.c: * libparse/clk_rawdcf.c: * libparse/clk_meinberg.c: * libparse/clk_hopf6021.c: * libparse/clk_dcf7000.c: * libparse/clk_computime.c: Lint. From: Simon Burge 2001-04-21 Harlan Stenn * ntpd/refclock_nmea.c (nmea_receive): Fixes. From: John Woolner * util/ntp-genkeys.c: Declare check_netinfo, don't define it. From: Jack Bryans * configure.in (RSASRCS): rsaref2 needs digit.h (I thought I fixed this already). * configure.in (CFLAGS): Disable -Wconversion, enable -Wmissing-prototypes, and allow for -Werror. From: Simon Burge * util/ntp-genkeys.c (main): Reset the standard mask so the symlinks are created with the standard mask. * configure.in: 4.0.99k28 * ntpd/ntpd.c (ntpdmain): Use mode_t for umask value. * util/ntp-genkeys.c: Create files with the right umask. * util/ntp-genkeys.c: config_file should be declared, not defined. * ntpd/refclock_mx4200.c (mx4200_pps): debug cleanup. * ntpd/refclock_hopfser.c: If we're not using it, provide the _bs. * ntpd/refclock_heath.c (heath_receive): Add missing "break" statements. * ntpd/ntp_proto.c: Lose extra definition of mode_ntpdate. * librsaref/Makefile.am (nodist_librsaref_a_SOURCES): Put RSASRCS on the same line as rsaref.h to improve portability. * libntp/msyslog.c: Lint cleanup. From: Marc.Brett@westerngeco.com * util/ntp-genkeys.c: * ntpdate/ntpdate.c: * ntpd/ntp_config.c: Netinfo header reorder. From: Jack Bryans * configure.in: timespec can be found by looking in goofy places under SunOS. 2001-04-20 Harlan Stenn * ntpd/refclock_nmea.c: PPSAPI cleanup, default to RMC sentences, handle milliseconds, multiple sentences, other good stuff. From: John Woolner , Marc.Brett@westerngeco.com, John.Hay@icomtek.csir.co.za * ntpd/ntp_proto.c (receive): In the AM_NEWBCL case, return in all cases at the end. * ntpd/ntp_peer.c (newpeer): Check cast_flags against MDF_BCLNT, not against MDF_BCAST. * ntpd/ntp_loopfilter.c (local_clock): Lose debug info. * ntpd/ntp_crypto.c (crypto_recv): Bugfix. From: Dave Mills. * configure.in: 4.0.99k27 * ntpd/ntp_loopfilter.c (local_clock): Check clock_panic > 0. Check clock_max > 0. * html/ntpd.htm: Cleanup. * html/miscopt.htm: Cleanup. * html/confopt.htm: Cleanup minpoll documentation. From: Dave Mills. 2001-04-19 Harlan Stenn * ntpd/cmd_args.c (getstartup): check_netinfo needs an extern declaration. Reported by: Jack Bryans * configure.in (ac_cv_make_timetrim): Added. * util/Makefile.am (bin_PROGRAMS): MAKE_TIMETRIM Requested by: Jack Bryans * configure.in: 4.0.99k26 * util/ntp-genkeys.c: * ntpd/refclock_oncore.c: * ntpd/ntp_peer.c: * libntp/msyslog.c: * libntp/audio.c: Lint cleanup. From: Simon Burge * ntpd/ntp_loopfilter.c (local_clock): debug message improvements from Dave Mills. * libntp/emalloc.c (emalloc): Tell people we are exiting if we log an out-of-memory condition. * util/ntp-genkeys.c (main): Don't allow '#' in a generated MD5 key. Reported by: Dave Tyson 2001-04-18 Harlan Stenn * ntpd/ntp_proto.c (clock_update): minpoll cleanup. (clock_select): minpoll cleanup. (clock_filter): Bugfixes from Mark Martinec * ntpd/ntp_loopfilter.c (rstclock): minpoll cleanup. Debug cleanup. * ntpd/ntp_config.c (getconfig): Initialize/bounds check minpoll using NTP_MINDPOLL insted of sys_minpoll. From: Dave Mills. 2001-04-17 Harlan Stenn * libntp/msyslog.c: * ElectricFence/page.c (stringErrorReport): Follow Rainer's lead and use strerror(). * ntpd/refclock_shm.c (shm_start): Always use strerror. * libntp/msyslog.c (msyslog): Use strerror if present. From: Rainer Orth * libparse/parsesolaris.c (rdchar): Cast ~0 to unsigned long. * libntp/buftvtots.c (buftvtots): Allow for 8-byte tv_sec, tv_usec in struct timeval. From: Rainer Orth 2001-04-16 Harlan Stenn * ntpd/ntp_config.c (getconfig): move "tinker" so it's generally available. 2001-04-15 Harlan Stenn * configure.in: Look for getclock(). * ntpd/ntp_config.c (getconfig): Squawk if provided minpoll or maxpoll values are out of range. * ntpd/ntp_proto.c (poll_update): Some operations can only be done if we're compiling with some REFCLOCKs. From Dave Mills. * configure.in (RSASRCS): Added. * librsaref/Makefile.am (nodist_librsaref_a_SOURCES): Use RSASRCS. * configure.in: Limit the DECL_HSTRERROR_0 to aix4.3.*. RSN, we could also limit it to xlc... * configure.in: 4.0.99k25 * html/leap.htm: Added. * html/index.htm: Update. * html/driver7.htm: Update. * html/driver6.htm: Update. * html/driver36.htm: Update. * html/audio.htm: Update. * html/y2k.htm: Removed. From Dave Mills. 2001-04-14 Harlan Stenn * acconfig.h: Lose extra declarations of PACKAGE and VERSION. * acconfig.h: * configure.in: * include/l_stdlib.h: DECL_HSTRERROR_0 needed for xlc under AIX 4.3.2. Reported by: Harald Barth * ntpd/ntp_proto.c (proto_config): cal_enable (PROTO_CAL) is invalid if no refclocks are present. From: Frodo Looijaard * README.cvs: On some systems, the -C option fails. * ntpd/refclock_nmea.c: * ntpd/ntp_refclock.c: * html/driver20.htm: PPSAPI patches for NMEA driver. From: John.Hay@icomtek.csir.co.za * README.rsa: Describe RSAEuro support, provide alternate rsa.c patch. * configure.in: Check for rsaeuro1, RSAOBJS, RSADIR respectively. * html/build.htm: Hint at rsaeuro1 directory. * include/global.h (BYTE): Define. * librsaref/Makefile.am (nodist_librsaref_a_SOURCES): Removed rsaref2 specific sources. (librsaref_a_LIBADD): Add appropriate objects. (librsaref_a_DEPENDENCIES): Work around automake limitation. (stamp-rsaref): Use RSADIR. * scripts/README: Document ntp-close. * scripts/Makefile.am (EXTRA_DIST): Distribute it. * Makefile.am (DISTCLEANFILES): Remove .warning. * librsaref/Makefile.am (DISTCLEANFILES): Remove copied/touched librsaref sources, stamp-rsaref. * ntpdate/Makefile.am (DISTCLEANFILES): Remove version.c. * ntpq/Makefile.am (DISTCLEANFILES): Likewise. * parseutil/Makefile.am (DISTCLEANFILES): Remove $(EXTRA_PROGRAMS). Rainer Orth * ntpd/ntp_control.c: Header cleanup 2001-04-13 Harlan Stenn * configure.in: Properly align --help output. Explain ElectricFence. From: Rainer Orth * ntpd/ntp_loopfilter.c (local_clock): Lose debugging statements. * ntpd/ntp_proto.c (clock_filter): Rewrite. From: Dave Mills * ntpd/ntp_control.c (ctl_getitem): msyslog() possible buffer overflow exploit. * configure.in: 4.0.99k24 * html/pic/radio2.jpg: * html/release.htm: * html/refclock.htm: * html/pps.htm: * html/ntpd.htm: * html/miscopt.htm: * html/driver22.htm: * html/confopt.htm: Updated documentation from Dave Mills. * util/ntp-genkeys.c: sys_minpoll. * ntpd/refclock_atom.c: Comment additions. * ntpd/ntp_proto.c: mode_ntpdate and peer_ntpdate added. (transmit): We want 3, not 2, consecutive polls. hpoll logic cleanup. mode_ntpdate changes. (receive): When setting up a newpeer, use our sys_minpoll, not the peer->ppoll. (clock_update): sys_minpoll changes. Reorder some case 1 code. Don't exit in case 2. (poll_update): hpoll cleanup. (peer_clear): u_rand. Use u_rand to randomize the initial poll. * ntpd/ntp_peer.c (newpeer): Bump peer_ntpdate if we're in mode_ntpdate. * ntpd/ntp_loopfilter.c: Initialize sys_poll and sys_minpoll to NTP_MINDPOLL. (local_clock): Clean up some debug/info messages. (rstclock): Use sys_minpoll. (loop_config): KERNEL_PLL sanity checks. LOOP_MINPOLL support. * ntpd/ntp_crypto.c (crypto_recv): Turn off FLAG_AUTOKEY when we turn off TEST10. * ntpd/ntp_control.c (ctl_getitem): Buffer overflow check. Clean up some loop logic. * ntpd/ntp_config.c: Added "tinker" and "minpoll". Use sys_minpoll now, instead of old manifest constant. (save_resolve): Print keyid using decimal, not hex. From Lars-Owe Ivarsson * include/ntpd.h: Added peer_ntpdate and sys_minpoll. * include/ntp_config.h (CONF_CLOCK_MINPOLL): Added. * include/ntp.h: keyid cleanup. LOOP_* cleanup. From Dave Mills. 2001-04-03 Harlan Stenn * ntpd/ntp_proto.c (clock_filter): Swell stuff. From: Mark Martinec * ports/winnt/ntpd/ntpd.dsp: * ports/winnt/ntpd/hopf_PCI_io.c: * ports/winnt/include/hopf_PCI_io.h: * ports/winnt/include/config.h: * ntpd/refclock_hopfser.c: * ntpd/refclock_hopfpci.c: * ntpd/refclock_conf.c: * ntpd/ntp_control.c: * ntpd/Makefile.am: * libntp/clocktypes.c: * include/ntp.h: * include/hopf6039.h: * include/Makefile.in: * include/Makefile.am: * html/pic/fg6039.jpg: * html/refclock.htm: * html/driver39.htm: * html/driver38.htm: * html/copyright.htm: Updated Oncore dudes. * configure.in: HOPF drivers and documentation. From: Bernd Altmeier (with some light hacking from Harlan to clean up indentation and lose the // comments) * ntpd/refclock_oncore.c: * ntpd/refclock_conf.c: Make it go. From: Reg Clemens * configure.in (openssl): Publish and default to RSAREF; hide openssl, and only use it if explicitly requested (at least until we work with it). 2001-04-02 Harlan Stenn * html/y2k.htm: * html/tickadj.htm: * html/release.htm: * html/refclock.htm: * html/quick.htm: * html/pps.htm: * html/ntptrace.htm: * html/ntptime.htm: * html/ntpq.htm: * html/ntpdc.htm: * html/ntpdate.htm: * html/ntpd.htm: * html/miscopt.htm: * html/index.htm: * html/genkeys.htm: * html/exec.htm: * html/driver7.htm: * html/driver22.htm: * html/copyright.htm: * html/confopt.htm: * html/build.htm: * html/authopt.htm: * html/assoc.htm: Updates from Dave Mills. 2001-04-01 Harlan Stenn * configure.in (OPENSSL): Just use -lcrypto. Reported by Dave Mills. 2001-03-31 Harlan Stenn * configure.in: 4.0.99k20 * ntpd/refclock_heath.c: Add support for GC-1000 II. From Dave Mills. * ntpd/ntp_proto.c (transmit): Check peer->unreach. (peer_clear): peer->outdate is a f(BURST_INTERVAL1), not NTP_MINPOLL. * ntpd/ntp_loopfilter.c (local_clock): mode_ntpdate stuff. * ntpd/ntp_crypto.c: OpenSSL/RSAREF support. * ntpd/cmd_args.c: Use -q, not -z, for mode_ntpdate. (getstartup): nofork on mode_ntpdate. Usage update. * include/ntp_crypto.h: OpenSSL/RSAREF support. From: Dave Mills. * configure.in (rsaref): Buglet. 2001-03-30 Harlan Stenn * ntpd/ntp_proto.c (clock_update): mode_ntpdate support. * ntpd/ntp_loopfilter.c (local_clock): mode_ntpdate support. * ntpd/cmd_args.c: Added -z (mode_ntpdate). * include/ntpd.h: mode_ntpdate added. * include/ntp_crypto.h: RSAREF/OPENSSL cleanup. From: Dave Mills. 2001-03-29 Harlan Stenn * config.h.in: * aclocal.m4: * configure.in: Prepare for OpenSSL support 2001-03-28 Harlan Stenn * README.rsa: Note that RSAEURO will not work. Reported by: pieter.delacourt@banksys.be 2001-03-25 Harlan Stenn * include/ntp_if.h: * include/ntp_machine.h: * include/ntp_unixtime.h: * libntp/humandate.c: * libntp/iosignal.c: * libntp/mktime.c: * libntp/prettydate.c: * libntp/systime.c: * libntp/tvtoa.c: * libntp/uglydate.c: * libntp/utvtoa.c: * libparse/clk_computime.c: * libparse/clk_dcf7000.c: * libparse/clk_hopf6021.c: * libparse/clk_meinberg.c: * libparse/clk_rawdcf.c: * libparse/clk_rcc8000.c: * libparse/clk_schmid.c: * libparse/clk_trimtaip.c: * libparse/clk_trimtsip.c: * libparse/clk_varitext.c: * libparse/parse.c: * libparse/parse_conf.c: * ntpd/check_y2k.c: * ntpd/ntp_config.c: * ntpd/ntp_control.c: * ntpd/ntp_intres.c: * ntpd/ntp_io.c: * ntpd/ntp_loopfilter.c: * ntpd/ntp_monitor.c: * ntpd/ntp_proto.c: * ntpd/ntp_refclock.c: * ntpd/ntp_request.c: * ntpd/ntp_resolver.c: * ntpd/ntp_timer.c: * ntpd/ntp_util.c: * ntpd/ntpd.c: * ntpd/refclock_acts.c: * ntpd/refclock_arbiter.c: * ntpd/refclock_arc.c: * ntpd/refclock_as2201.c: * ntpd/refclock_atom.c: * ntpd/refclock_bancomm.c: * ntpd/refclock_chronolog.c: * ntpd/refclock_chu.c: * ntpd/refclock_datum.c: * ntpd/refclock_dumbclock.c: * ntpd/refclock_fg.c: * ntpd/refclock_gpsvme.c: * ntpd/refclock_heath.c: * ntpd/refclock_hpgps.c: * ntpd/refclock_irig.c: * ntpd/refclock_jupiter.c: * ntpd/refclock_leitch.c: * ntpd/refclock_local.c: * ntpd/refclock_msfees.c: * ntpd/refclock_mx4200.c: * ntpd/refclock_nmea.c: * ntpd/refclock_oncore.c: * ntpd/refclock_pcf.c: * ntpd/refclock_pst.c: * ntpd/refclock_shm.c: * ntpd/refclock_tpro.c: * ntpd/refclock_trak.c: * ntpd/refclock_true.c: * ntpd/refclock_ulink.c: * ntpd/refclock_usno.c: * ntpd/refclock_wwv.c: * ntpd/refclock_wwvb.c: * ntpdate/ntpdate.c: * ntpdate/ntptime_config.c: * ntpdate/ntptimeset.c: * ntpdc/ntpdc.c: * ntpdc/ntpdc_ops.c: * ntpq/ntpq.c: * ntpq/ntpq_ops.c: * ntptrace/ntptrace.c: * parseutil/testdcf.c: * util/hist.c: * util/ntp-genkeys.c: * util/ntptime.c: * util/precision.c: * util/tickadj.c: time.h and sys/time.h cleanup. 2001-03-24 Harlan Stenn * configure.in: '99k19 * ntpd/refclock_atom.c (atom_ppsapi): PPS API RFC alignment patches. From: Ulrich Windl * util/ntptime.c: MNT options From: Ulrich Windl * ntpd/ntp_refclock.c (refclock_newpeer): Lose "extra" free(). From: Ulrich Windl * configure.in: 4.0.99k18 and auto* upgrade 2001-03-14 Harlan Stenn * ntpdc/ntpdc_ops.c (printpeer): No more "valid". * ntpd/ntp_request.c (peer_info): No more "valid". * ntpd/ntp_refclock.c (refclock_transmit): valid/hpoll cleanup. * ntpd/ntp_proto.c (transmit): valid/hpoll and peer->ttl cleanup. peer->valid/oreach cleanup. (receive): Call newpeer() with the pkt->ppoll, not NTP_MINDPOLL (in several places). In AM_NEWPASS, if we have a NULL peer, return. (poll_update): Added xpoll definition, fixed oldpoll definition. Algorithmic improvements. * ntpd/ntp_peer.c (newpeer): Better minpoll/maxpoll initialization. (resetmanycast): That's a poll_update() on an MDF_ACAST, not a poll_clear(). * ntpd/ntp_crypto.c: include . (crypto_recv): Leave the crypto_flags alone when wiggling the peer-> stuff. (crypto_cert): Make room for daddy. Do a real open() on the cert file. Read the cert. Initial hack and slash. Better debug info. * ntpd/ntp_control.c: CP_VALID now does "unreach". (ctl_putpeer): Ditto. * include/ntp_request.h: info_peer gets a placeholder for "valid". * include/ntp_crypto.h (CRYPTO_FLAG_CERT): Comment update. * include/ntp.h: Lose "valid" from struct peer. From: Dave Mills. 2001-03-05 Harlan Stenn * ntpd/ntp_proto.c (transmit): hpoll calc logic cleanup. (receive): New cert stuff. (poll_update): Improvements. (peer_clear): New cert stuff. (peer_xmit): New cert stuff. * ntpd/ntp_crypto.c: New cert stuff, documentation cleanup. Lose extraneous poll_uopdate()s. * ntpd/ntp_control.c: Deal with new cert stuff. * ntpd/ntp_config.c (getconfig): Handle CONF_CRYPTO_CERT. * include/ntp_crypto.h (CRYPTO_FLAG_CERT): Added. (CRYPTO_CERT): Added. (CRYPTO_CONF_CERT): Added. Add declaration for struct value certif. * include/ntp_control.h (CS_CERTIF): Added. (CP_CERTIF): Added. * include/ntp_config.h (CONF_CRYPTO_CERT): Added. * include/ntp.h (TEST10,TEST11): New meaning. Add certif to struct peer. (FLAG_PROVEN): Added. (MAX_EXT_LEN): Removed. exten grew from 672/4 to 5000/4 for PUBKEY. From: Dave Mills. 2001-03-03 Harlan Stenn * ntpd/ntp_proto.c (transmit): Documentation cleanup. (receive): Watch for NULL peer->pubkey.ptr (TEST11). (poll_update): peer->nextdate, not ->outdate. More cleanup around the disabled PUBKEY chunk. * ntpd/ntp_crypto.c (make_keylist): ltemp might be smaller than sys_automax - check peer->kpoll, too. Other ltemp cleanup. (crypto_recv): fstamp is a PUBKEY-only variable. * include/ntp.h (NTP_AUTOMAX): 13, not 12. From: Dave Mills. 2001-03-01 Harlan Stenn * ntpd/ntp_proto.c (transmit): hpoll cleanup. Call clock_select() after calling poll_update, not before. (receive): Call poll_update after crypto_recv if FLAG_SKEY. (process_packet): Set peer->ppoll Later. (poll_update): peer->hpoll sanity checking. Set peer->outdate, not ->nextate, when burst > 0. MDF_ACAST cleanup. (clock_select): Fix hpoll typo in call to poll_update(). * ntpd/ntp_crypto.c (crypto_xmit): tstamp's value is a function of PUBKEY. * include/ntp.h (clear_to_zero): #define value is a function of AUTOKEY. From: Dave Mills. 2001-02-28 Harlan Stenn * ntpd/ntp_proto.c (transmit): Documentation/code update. (poll_update): Sanity check peer->hpoll. Improve debug info. (peer_clear): Improve debug info. Turn off FLAG_ASSOC in addition to FLAG_AUTOKEY. (clock_select): peer->status is CTL_PST_SEL_DISTSYSPEER, and don't call poll_update(). Make each entry in the peer_list a CTL_PST_SEL_SELCAND sooner, too. Rework similar logic later on. Change debug level on some info. (peer_xmit): Check peer->flags using FLAG_ASSOC, not CRYPTO_FLAG_AUTO in a couple places. Don't call poll_update() if sendlen > LEN_PKT_NOMAC. * ntpd/ntp_loopfilter.c (local_clock): Improve debug info. Sanity-check sys_poll sooner. * ntpd/ntp_crypto.c: New artwork. (COOKIE_LEN,AUTOKEY_LEN,VALUE_LEN): New. (make_keylist): More debug info. Use FLAG_ASSOC, not CRYPTO_FLAG_ASSOC. (crypto_recv): More debug info. Clean up/improve sanity checks on CRYPTO_ASSOC and CRYPTO_RESP packets, and in other places. (crypto_xmit): Clean up/improve sanity checks on CRYPTO_ASSOC and CRYPTO_RESP packets. Use FLAG_ASSOC, not CRYPTO_FLAG_ASSOC. More debug info. * include/ntp.h (NTP_CANLOCK): Lose it. (clear_to_zero): is now "assoc". (FLAG_ASSOC): Added. From: Dave Mills 2001-02-23 Harlan Stenn * ntpdate/ntpdate.h (NTP_MAXAGE): Added. * ntpd/ntp_refclock.c (refclock_receive): Cleanup. * ntpd/ntp_proto.c (transmit): Don't reset peer->ppoll in one case. Update peer->hpoll based on CTL_PST_SEL_CORRECT, not FLAG_SYSPEER. Don't update peer->ppoll based on MDF_[BM]CAST. (peer_clear): ppoll is initialized to maxpoll. (clock_select): call poll_update(peer->hpoll) earlier. (peer_xmit): Call poll_update later. * ntpd/ntp_peer.c (peer_config): Rework initial values of [hkp]poll. * ntpd/ntp_loopfilter.c (CLOCK_PHI): Added. Deal with other (allow_*) stuff. Treat Windows/NT the same as others regarding panic steps. Deal with tinker stuff. * ntpd/ntp_config.c: Tinker stuff. * ntpd/cmd_args.c (getCmdOpts): -g now wiggles "allow_panic" (renamed from "correct_any"). -x now wiggles "allow_step" (renamed from "allow_step_backward"). * include/ntpd.h: Add tinker variables. Rename/rework variables associated with "permission to step" and "permission to make a panic correction" * include/ntp_config.h (CONFIG_TINKER): Added. (CONF_CLOCK_MAX): Tinker keyword (CONF_CLOCK_PANIC): Tinker keyword (CONF_CLOCK_PHI): Tinker keyword (CONF_CLOCK_MINSTEP): Tinker keyword * include/ntp.h (NTP_MINCLOCK): Tinker and other cleanup. From: Dave Mills 2001-02-19 Harlan Stenn * ntpd/ntp_proto.c (transmit): Don't peer_clear() and reset minpoll unconditionally; make sure the peer is configured. (poll_update): When updating peer->ppoll, check on BCAST and MCAST, not ACAST (peer_clear): PUBKEY cleanup. Zero out the peer structure earlier. Initialization cleanup/fixes. (peer_xmit): CRYPTO_FLAG_AUTO is in peer->flags now. (key_expire): Debug output. * ntpd/ntp_peer.c (unpeer): PUBKEY cleanup. (newpeer): peer variable setup cleanup. * ntpd/ntp_crypto.c (make_keylist): Keep CRYPTO_FLAG_AUTO in peer->flags, not crypto_flags. (crypto_xmit): Ditto. (crypto_recv): Fix up RV_TSP logic (several places). * include/ntp.h (clear_to_zero): Moved... From: Dave Mills. 2001-02-14 Harlan Stenn * ntpd/ntp_proto.c (peer_xmit): Crypto-related fixes From Dave Mills. * ntpd/ntp_crypto.c (crypto_recv): Allocate space for the trailing NUL on the keystr. 2001-01-28 Harlan Stenn * configure.in: 4.0.99k17 * ntpd/refclock_local.c (STRATUM): 3 -> 5 * ntpd/ntp_proto.c: sys_maxd -> sys_selerr, sys_epsil -> sys_syserr. various cleanups and improvements. From: Dave Mills. 2001-01-19 Harlan Stenn * configure.in: 4.0.99k16 * config.h.in: Regenerated - became empty somehow. Reported by John.Hay@icomtek.csir.co.za * ntpd/ntp_proto.c (clock_select): Fix sdisp calculation. From Dave Mills. * util/ntp-genkeys.c: * ntpd/refclock_chu.c: * ntpd/refclock_atom.c: * ntpd/ntpd.c: * ntpd/ntp_loopfilter.c: * ntpd/ntp_io.c: * ntpd/cmd_args.c: * libntp/audio.c: * include/l_stdlib.h: * html/copyright.htm: Lint fixes (Thanks bunches!) From: Marc.Brett@westerngeco.com 2001-01-18 Harlan Stenn * configure.in: 4.0.99k15 * ntpd/ntp_proto.c (clock_select): Track error[] items sooner. Typo grabbing the dtemp value and in the sdisp calculation. From Dave Mills. 2001-01-17 Harlan Stenn * configure.in: 4.0.99k14 * ntpd/ntp_proto.c: Change description of sys_rootdelay and sys_rootdispersion. (process_packet): Fix p_del test (bad distance). (process_packet): Fix bad synch distance test. (process_packet): Fix call to clock_filter (p_disp) (clock_update): Fix sys_rootdelay calculation. (clock_filter): Initialize jit to f(sys_precision) (clock_filter): Update jit using distance[i] instead of SQUARE(). peer->jitter uses dtemp instead of SQUARE(). (clock_filter): Updated CLOCK_SGATE checks. When printing debug info, show jitter along with popcorn spike. (clock_select): New sdisp calc. (root_distance): New return value calc. (peer_xmit): xpkt.rootdispersion value change. * include/ntp.h (CLOCK_SGATE): Popcorn spike gate (Whoa, Molly!) From Dave Mills. 2001-01-13 Harlan Stenn * config.sub (Repository): Updated. * config.guess (Repository): Updated. * ntpd/ntp_loopfilter.c (local_clock): Just use sys_jitter in the calculation for rootdispersion. From Dave Mills. 2001-01-02 Harlan Stenn * ntpd/ntp_proto.c (transmit): Fix documentation. Set peer->outdate and call poll_update in a new place. Sanity checks in the MODE_BROADCAST case. (clock_select): Track the old peer. Use the old peer in subsequent checks, where appropriate. Clean up unpeer() logic. From Dave Mills. 2001-01-01 Harlan Stenn * ntpd/refclock_chu.c: Start using HAVE_AUDIO. * ntpd/ntp_proto.c (clock_select): If about to discard an ephemeral association, do it only if not the system peer. From Dave Mills. * html/pic/wingdorothy.gif: * html/pic/bustardfly.gif: * html/pic/boom3a.gif: * html/pic/tonea.gif: * html/pic/stack1a.jpg: * html/pic/pogoa.gif: * html/pic/pogo8.gif: * html/pic/pogo6.gif: * html/pic/pogo5.gif: * html/pic/pogo4.gif: * html/pic/pogo3.gif: * html/pic/pogo1.gif: * html/pic/oz2.gif: * html/pic/flatheads.gif: * html/pic/boom4.gif: * html/pic/boom3.gif: * html/pic/appletree.gif: * html/pic/alice51.gif: * html/pic/alice44.gif: * html/pic/alice35.gif: * html/pic/alice31.gif: * html/pic/alice15b.gif: * html/pic/alice13.gif: * html/pic/alice11.gif: * html/release.htm: * html/rdebug.htm: * html/prefer.htm: * html/porting.htm: * html/ntptrace.htm: * html/ntpq.htm: * html/ntpdate.htm: * html/monopt.htm: * html/kernpps.htm: * html/index.htm: * html/hints.htm: * html/gadget.htm: * html/driver7.htm: * html/copyright.htm: * html/config.htm: * html/build.htm: * html/authopt.htm: * html/assoc.htm: * html/accopt.htm: Cleanup from Dave Mills. 2000-12-30 Harlan Stenn * configure.in: 4.0.99k13 * ntpd/refclock_wwv.c (wwv_start): Call audio_init with DEVICE_AUDIO. * ntpd/refclock_irig.c (irig_start): Call audio_init with DEVICE_AUDIO. * ntpd/refclock_chu.c: Documentation cleanup. (DEVICE_AUDIO): Added. (fd_audio): Added. (chu_start): Separate audio from serial device. (chu_receive): Rewrite - get data from serial or audio device as appropriate. (chu_audio_receive): Renamed (from chu_receive) to allow both audio and serial capability. (chu_serial_receive): Ditto. (chu_decode): Do the Right Thing based on audio/serial data. * ntpd/ntp_refclock.c (refclock_open): Check for failure using <0 instead of ==-1. * libntp/audio.c: Header cleanup, and remove HAVE_STRUCT_AUDIO_INFO_* related fields. (audio_init): Func arg is device to attempt to open. * include/audio.h (audio_init): Now takes a char * argument. From Dave Mills. * configure.in (ntp_refclock): HAVE_AUDIO added. Remove HAVE_STRUCT_AUDIO_INFO_* stuff; Dave rewrote the audio stuff. 2000-12-28 Harlan Stenn * configure.in: 4.0.99k12 2000-12-27 Harlan Stenn * html/release.htm: * html/patches.htm: * html/measure.htm: * html/confopt.htm: * html/clockopt.htm: * html/biblio.htm: * html/authopt.htm: * html/assoc.htm: Updates from Dave Mills. * include/ntp_crypto.h: Make sure crypto_flags is visible. From Dave Mills. 2000-12-14 Harlan Stenn * ntpd/ntp_proto.c (process_packet): pleap/pstratum. (peer_xmit): Use CRYPTO_FLAG_AUTO. * ntpd/ntp_crypto.c (make_keylist): Use CRYPTO_FLAG_AUTO. Only sign host name and timestamps if the clock is synched. * include/ntp_crypto.h (CRYPTO_FLAG_AUTO): Added. From: Dave Mills 2000-12-11 Harlan Stenn * ntpd/ntp_proto.c (transmit): Call clock_select in a few new places. BURST/IBURST cleanup. Don't turn off FLAG_BURST at the EOburst. (receive): Set peer->unreach = 0 before we call process_packet(). (process_packet): ditto, before calling poll_update(). Lose some debugging, MODE_BCLIENT/CLIENT cleanup. (poll_update): Bump nextupdate on FLAG_REFCLOCK, not _REFCLOCK or _IBURST. (peer_clear): Don't set IBURST on MDF_BCLNT. From: Dave Mills. * ntpdate/ntpdate.c (alarming): Appease ansi2knr. 2000-12-10 Harlan Stenn * ntpd/ntp_control.c (ctl_putpeer): CP_TTL and CP_TTLMAX MDF_ACAST and MDF_MCAST cleanup. * ntpd/refclock_wwv.c (wwv_start): ttlmax/ttl cleanup. * ntpd/refclock_usno.c (usno_timeout): ttlmax/ttl cleanup. * ntpd/refclock_parse.c (CLK_REALTYPE): ttlmax/ttl cleanup. * ntpd/refclock_chu.c (chu_start): ttlmax/ttl cleanup. * ntpd/refclock_acts.c (acts_timeout): ttlmax/ttl cleanup. * ntpd/ntp_refclock.c (refclock_newpeer): Don't do the any_interface -> loopback_interface trick. * ntpd/ntp_proto.c (transmit): Broadcast/manycast cleanup. * ntpd/ntp_peer.c: Cleanup. * ntpd/ntp_io.c: Cleanup. * ntpd/ntp_crypto.c (crypto_recv): AUTOKEY based on BCLNT, not MCAST2. * include/ntpd.h: Declare findbcastinter(). * include/ntp.h: struct peer's ttlmax is now max ttl/refclock mode. ttl is now ttl for manycast mode. (FLAG_MCAST): Reworked several FLAG_ bits. From Dave Mills. 2000-12-05 Harlan Stenn * ntpq/ntpq.c: CP_TTLMAX support. * ntpd/ntp_proto.c (transmit): MDF_ACAST ttl fixes. * ntpd/ntp_peer.c (resetmanycast): Reset ttl if MDF_ACAST. (peer_config): Save max ttl in ttlmax. * ntpd/ntp_control.c: ttlmax support. * include/ntp_control.h (CP_TTLMAX): Added. * include/ntp.h: Added ttlmax to struct peer. Dave Mills. 2000-12-03 Harlan Stenn * ntpd/ntp_proto.c (receive): That any_interface is now an rbufp->dstadr. Various other doc and code cleanup. * ntpd/ntp_peer.c (findmanycastpeer): Fixes From Dave Mills 2000-12-02 Harlan Stenn * ntpd/ntp_request.c (do_conf): call peer_config with any_interface, not 0. * ntpd/ntp_proto.c (transmit): Manycast cleanup * ntpd/ntp_peer.c (findmanycastpeer): manycast cleanup * ntpd/ntp_io.c (sendpkt): Only check ttl if we have a ttl (findinterface): Cleanup * ntpd/ntp_control.c: cleanup * include/ntpd.h: Added resetmanycast. * include/ntp_control.h (CP_TTL): disp -> ttl * ntpq/ntpq.c: disp -> ttl From Dave Mills 2000-11-26 Harlan Stenn * configure.in: 4.0.99k11 * ntpd/ntp_proto.c (transmit): * ntpd/ntp_peer.c: * ntpd/ntp_io.c: * ntpd/ntp_control.c (ctl_putpeer): * ntpd/ntp_config.c (getconfig): * include/ntpd.h: mcast/ucast interface cleanup. From: Dave Mills * include/ntp_request.h: Put data[] as MAXFILENAME+16. This will fix the conf_peer requests again, but re-break compatibility with old versions of the daemon. Sigh. * util/ntp-genkeys.c (cleanlinks): Don't do it if nosymlinks. 2000-11-19 Harlan Stenn * ntpd/refclock_parse.c (rawdcf_init_1): make Linux happier with some modem control stuff. From: Wolfram Pienkoss (via Frank Kardel) * ntpd/refclock_pcf.c (pcf_poll): isdst fix From: Andreas Voegele 2000-10-28 Harlan Stenn * configure.in: 4.0.99k10 * ntpd/refclock_wwvb.c (wwvb_start): Cosmetic reorder. * ntpd/refclock_atom.c (RANGEGATE): Cleanup. Add ASTAGE. Add ppsparams to struct ppsunit. (atom_start): Init peer->burst to ASTAGE. (atom_shutdown): Multi-handle (atom_pps): Multi-handle (atom_pps): RANGEGATE cleanup (atom_poll): Poll count cleanup. Error check cleanup. Burst cleanup. * ntpd/ntp_refclock.c (refclock_transmit): Lose the pre-burst check poll_update(). (refclock_sample): Fix the jitter calc. (refclock_receive): Pass the jitter to the clock_filter(). * ntpd/ntp_proto.c (clock_update): If we lose sync, reset the poll to NTP_MINDPOLL. (poll_update): Poll wiggles. Make sure peer->nextdate is timely. (clock_select): If we lose sync, reset the poll to NTP_MINDPOLL. * ntpd/ntp_loopfilter.c (local_clock): Show the asocid in debug output. popcorn debug message changes. Clamp the poll interval if the system peer has changed. PPS wiggle changes. From Dave Mills. 2000-10-16 Harlan Stenn * ntpd/refclock_pcf.c (pcf_start): * html/driver35.htm: The radio clock transmits 69 bits with a period of 2.5 milliseconds per bit. Thus the driver now sets the default calibration offset to 0.1725 (69 * 2.5 = 172.5). Its now possible to disable the check of the radio clock's synchronisation status bit. Several users requested this option. From: Andreas Voegele * html/refclock.htm: * html/rdebug.htm: * html/prefer.htm: * html/pps.htm: * html/ntpdc.htm: * html/miscopt.htm: * html/ldisc.htm: * html/kern.htm: * html/index.htm: * html/exec.htm: * html/driver22.htm: * html/clockopt.htm: Updates from Dave Mills * ntpd/ntp_intres.c (request): Sanity check the size of the response 2000-10-15 Harlan Stenn * ntpq/ntpq_ops.c (dopeers): Dave didn't like the patch to show the units on the times... * ntpdc/ntpdc_ops.c (doset): SYS_FLAG_PPS cleanup * ntpd/refclock_wwv.c (wwv_newchan): Update the peer refid if we're talking to a stratum 0 source * ntpd/refclock_trak.c: Needs PPS * ntpd/refclock_oncore.c: Disable for now * ntpd/refclock_mx4200.c: Needs PPSAPI, not PPS Header cleanup. PPS interface cleanup. Process sentences with a switch Cleanup and sanity checks * ntpd/refclock_datum.c: header cleanup, light body cleanup * ntpd/refclock_conf.c: CLOCK_TRAK needs PPS MX4200 needs PPSAPI, not PPS Disable ONCORE for now * ntpd/refclock_bancomm.c: Surgery * ntpd/refclock_atom.c: Cleanup (atom_control): added (atom_ppsapi): added * ntpd/ntp_request.c (setclr_flags): SYS_FLAG_PPS cleanup * ntpd/ntp_refclock.c: stropts.h back in in TTYCLK and HAVE_SYS_CLKDEFS_H Get ntp_syscall if KERNEL_PLL Define cal_enable (refclock_receive): Cleanup (refclock_control): sanity check procptr * ntpd/ntp_proto.c (init_proto): pps_enable (proto_config): Turn on/off PPS discipline * ntpd/ntp_loopfilter.c: pps_enable (local_clock): record_loop_stats() if !ntp_enable (local_clock): Turn off PPS if it's not enabled Other cleanup/fixes * ntpd/ntp_config.c: pps and calibrate keywords. Initialize pps_assert to 0, not 1 (swap assert/clear?) * include/ntpd.h: We have pll_status if KERNEL_PLL Added pps_enable and cal_enable * include/ntp_request.h (SYS_FLAG_PPS): Renamed from SYS_FLAG_AUTHENTICATE * include/ntp.h (PROTO_PPS): Added (PROTO_CAL): Added From: Dave Mills 2000-09-23 Harlan Stenn * include/ntp_refclock.h (stropts.h, sys/clkdefs.h): Harmful and useless file include's turned off. * libntp/iosignal.c (netinet/in.h, sys/sockio.h): Duplicate file include's turned off. * ntpd/ntp_refclock.c (ntp_tty.h): File included. (refclock_open, refclock_ioctl): Use `TTY' from ntp_tty.h. * ntpd/refclock_atom.c: Grab a few headers regardless; if we don't CLOCK_ATOM we provide a stub pps_sample() routine so the WHARTON can be compiled/used. * ntpq/ntpq_ops.c (dopeers, doopeers): Print the units for each column header. Tue Sep 12 16:25:51 2000 Philippe De Muyter * ntpd/refclock_atom.c (atom_start): Lose "temp", because we now initially either CAPTUREASSERT or CAPTURECLEAR. (atom_pps): pps_info_t is our friend. Update comments to reflect reality. DTRT with pps_info. Do some overflow checks. From: Dave Mills. 2000-09-21 Harlan Stenn * configure.in: Much improved Solaris patch-level check for the FLL bug test. From: Marc.Brett@westgeo.com 2000-09-19 Harlan Stenn * include/Makefile.am (noinst_HEADERS): Added ntp_tty.h Reported by Dave Mills 2000-09-16 Harlan Stenn * ntptrace/ntptrace.c: * ntpdate/ntptimeset.c (receive): * ntpdate/ntpdate.c (receive): STRATUM cleanup * ntpd/refclock_atom.c (atom_poll): Autostratum. Lose the leap. * ntpd/ntp_proto.c: sys_prefer (process_packet): stratum cleanup (clock_select): Autostratum the ATOM * ntpd/ntp_loopfilter.c: pps_update/pps_stratum wiggle. * include/ntpd.h: Lose pps_update, gain sys_prefer * include/ntp.h: STRATUM variable cleanup From Dave Mills 2000-09-13 Harlan Stenn * ntpd/refclock_oncore.c (oncore_get_timestamp): Print debug messages being aware of HAVE_STRUCT_TIMESPEC. * ntpd/refclock_atom.c: Have pps_params tag along in the ppsunit structure, where it really belongs. (atom_pps): Use PPS_CAPTURE{ASSERT,CLEAR} From: Dave Mills. 2000-09-12 Harlan Stenn * configure.in (ac_cv_var_atom_ok): Cleanup ATOM/PPSAPI stuff... * scripts/ntp-close: Find "close" ntp servers. From: Neal McBurnett * ntpd/refclock_conf.c: * ntpd/refclock_oncore.c: Re-enabled oncore driver for HAVE_PPSAPI case only. 2000-09-12 Philippe De Muyter * ntpd/refclock_parse.c (we400a_pollinfo): Useless variable removed. [WHARTON slot]: Set NO_POLL, NO_INIT and NO_DATA; fix `fixed format' and `offset' fields. * include/ntp_tty.h: New file * libntp/icom.c: Use it. * ntp_update (UPDATE_OPTIONS): Use -d, too. Fix Pass 1 comment. 2000-09-12 Harlan Stenn * ntpd/refclock_oncore.c: shmem_fname added. oncore_init_shmem() updated. (oncore_start): Comment cleanup (oncore_read_config): Move call to oncore_shmem_init() (oncore_init_shmem): Prototype change (oncore_init_shmem): Don't exit on errors (oncore_msg_any): timespec/timeval cleanup (oncore_msg_Cj_id): shmem_fname changes (oncore_msg_BaEaHa): saw_At bugfix (oncore_get_timestamp): Added current_mode/current_params. Commented. Added time_pps_getcap() calls. From: Reg Clemens * ntpd/ntp_io.c (input_handler): Better recvfrom() error message From: Dean Gibson * ntpdc/ntpdc.c (passwd): Get them working again. From: Benjamin Greenwald 2000-09-11 Harlan Stenn * ntpd/refclock_atom.c: (atom_start): * ntpd/ntp_refclock.c: Comment cleanup. PPS/PPSAPI cleanup (refclock_open): PPS/PPSAPI cleanup From: Dave Mills * ntpd/refclock_oncore.c: * ntpd/refclock_mx4200.c: HAVE_TIMESPEC -> HAVE_STRUCT_TIMESPEC * configure.in: ATOM requires struct timespec, not PPSAPI. Clean up dependencies accordingly. 2000-09-09 Harlan Stenn * configure.in (ac_cv_var_atom_ok): Improve ATOM configure message PARSE requires ATOM. * ntpd/ntpd.c (set_process_priority): Clean up debug messages. 2000-09-07 Harlan Stenn * configure.in: ac_cv_atom_ok, depends on HAVE_PPSAPI. I notice the PARSE clocks require ATOM. Could be interesting... 2000-09-06 Harlan Stenn * Makefile.in (distdir): Seems to be a bug in an automake library somewhere... 2000-09-05 Harlan Stenn * ntpd/ntp_loopfilter.c (loop_config): V3 API needs MOD_BITS when initializing ntv.modes. Initialize ntv.{maxerror,esterror,status} earlier. Clean up KERNEL_PLL code. 2000-09-04 Harlan Stenn * ntpq/ntpq.c: report offset as "offset", not "phase". Lose compliance. * ntpd/refclock_local.c (local_poll): variance -> jitter * ntpd/refclock_chu.c (chu_major): Lose variance. * ntpd/ntp_util.c (hourly_stats): sys_error -> sys_jitter (record_loop_stats): ditto * ntpd/ntp_request.c (peer_info): variance -> jitter * ntpd/ntp_refclock.c (refclock_sample): variance -> jitter (refclock_receive): variance -> jitter * ntpd/ntp_proto.c (process_packet): variance -> jitter (clock_filter): variance -> jitter (clock_select): variance -> jitter (root_distance): variance -> jitter * ntpd/ntp_peer.c (newpeer): variance -> jitter * ntpd/ntp_loopfilter.c: Cleanup pll_nano selection bogon. Centralize the kernel API data. (local_clock): Lose sys_error. (loop_config): Code cleanup. * ntpd/ntp_control.c: Call offset "offset" and not "phase". Lose CS_COMPLIANCE. Deal with variance/jitter rename. * include/ntp_refclock.h: Rename variance to jitter in struct refclockproc. * include/ntp_control.h (CS_COMPLIANCE): Lose it. * include/ntp.h: Rename variance to jitter in struct peer. From: Dave Mills 2000-09-01 Harlan Stenn * ntpd/refclock_atom.c: Use the new ppsunit. Cleanup and improve documentation. * ntpd/ntp_refclock.c (refclock_sample): Don't accumulate variance. From Dave Mills 2000-08-31 Harlan Stenn * html/driver22.htm: Update the docs. * ntpd/refclock_atom.c (atom_start): Open the device if it hasn't been opened already. (pps_sample): Make it more visible. From Dave Mills. * configure.in: 4.0.99k8 Revert to the older automake. * configure.in: The PPSAPI headers use "inline", so require a STDC compiler. * ntpd/refclock_atom.c (atom_shutdown): Typo From Dave Mills * configure.in: Convert to autoconf-2.49 * ntpd/refclock_atom.c: Header cleanup Comment cleanup. Lose the TTYCLK stuff. Convert to PPSAPI. * ntpd/ntp_refclock.c (refclock_newpeer): Move refclock_unpeer(). From: Dave Mills 2000-08-29 Harlan Stenn * configure: Fix the autoconf problem... 2000-08-20 Harlan Stenn * configure.in: 99k7 * util/ntptime.c (main): Report TAI stuff * ntpq/ntpq.c: CS_COMPLIANCE/CS_JITTER cleanup * ntpd/ntp_loopfilter.c (local_clock): sys_error/sys_jitter cleanup. kernel PPL cleanup. * ntpd/ntp_crypto.c: Check NTP_API if we're doing KERNEL_PLL so we can get the TAI stuff. * ntpd/ntp_control.c: CS_COMPLIANCE now reports "error" instead of "jitter". CS_JITTER now reports jitter. * include/ntpd.h: Added sys_jitter * include/ntp_control.h (CS_JITTER): Added From: Dave Mills * ntpd/cmd_args.c (getCmdOpts): Crack -N at pre-scan, as we do the priority wiggle before the final scan. From: Tom Smith We might do better to move the priority wiggle to after the final scan. Especially if we want to permit command-line options to have decent control over the priority. When we rewrite the config file stuff we might go to a multi-scan to solve some of these problems. 2000-08-19 Harlan Stenn * configure.in: '99k6, and manually fix configure. * include/ntp_request.h (NTP_MAXHOSTNAME): 144 -> 32 2000-08-18 Harlan Stenn * util/ntp-genkeys.c (main): Don't call fclose if stream is NULL. 2000-08-17 Harlan Stenn * html/driver35.htm: * ntpd/refclock_pcf.c: Updates and improvements From: Andreas Voegele * configure.in (ac_cv_struct_ntptimeval): Lose the TAI check - we don't need it since we can check NTP_API. Re-hack the generated configure script. * configure: Manual hack to the ntptimeval.time.tv_nsec stuff because we're running an old autoconf. 2000-08-16 Harlan Stenn * util/ntptime.c: Use: HAVE_STRUCT_NTPTIMEVAL_TIME_TV_NSEC, it's the standard name. * configure.in: Look for struct ntptimeval.tai in sys/timex.h Cleanup struct tptimeval member tests. * util/ntp-genkeys.c: New command-line arguments 2000-08-14 Harlan Stenn * util/ntp-genkeys.c (main): More small steps... 2000-08-13 Harlan Stenn * ntpd/ntp_crypto.c (crypto_rsa): Now that we're using NTP_KEYSDIR, make sure there is a '/ between the dir and the file. * util/ntp-genkeys.c (main): More small steps... 2000-08-12 Harlan Stenn * util/ntp-genkeys.c (main): Another small step... * configure.in: 99k5 * include/ntp_request.h: Make data[] member of req_pkt 32 again. Bump the version number... * ntpd/ntp_loopfilter.c (local_clock): Change 0. to 0 in a couple of places. From Dave Mills 2000-08-11 Harlan Stenn * util/ntp-genkeys.c (main): Minimal progress... 2000-08-06 Harlan Stenn * ntpd/check_y2k.c: Make debug definition match ntpd.h's declaration * ntpd/Makefile.am (check-local): Use test in favor of [ 2000-08-05 Harlan Stenn * configure.in (NTP_KEYSDIR): Typo 2000-08-04 Harlan Stenn * ElectricFence/Makefile.am (check-local): use test instead of [ * configure.in: AC_REPLACE_FUNCS(strdup) * libntp/strdup.c (strdup): Added. * libntp/Makefile.am (EXTRA_libntp_a_SOURCES): Added strdup.c * util/Makefile.am (ntp_genkeys_DEPENDENCIES): Use $U on .o files (ntp_genkeys_LDADD): ditto. * ntpd/ntp_crypto.c: Use NTP_KEYSDIR * util/ntp-genkeys.c (snifflink): Ignore ENOENT, too. * ntpd/ntp_proto.c (peer_xmit): Crypto cleanup * ntpd/ntp_crypto.c: Cleanup * ntpd/ntp_control.c: Join the club * ntpd/ntp_config.c: Call crypto_config() instead; we got rid of crypto_flags. * include/ntp_crypto.h (CRYPTO_FLAG_ENAB): New crypto flags, rework * include/ntp_control.h (CS_FLAGS): Wiggle in. * include/ntp.h: Added crypto peer status to struct peer From Dave Mills 2000-08-03 Harlan Stenn * util/ntp-genkeys.c: Initialize path_keysdir to NTP_KEYSDIR. * configure.in (NTP_KEYSDIR): Added * acinclude.m4: Added AC_DEFINE_DIR macro * util/ntp-genkeys.c (main): Sanity checks on the file paths. 2000-08-02 Harlan Stenn * util/ntp-genkeys.c (crypto_config): Only #ifdef PUBKEY (PATH_MAX): Try harder... 2000-08-01 Harlan Stenn * util/ntp-genkeys.c (main): Use snifflink() (snifflink): Implement... * configure.in: Check for readlink() 2000-07-31 Harlan Stenn * util/ntp-genkeys.c (main): Use strdup on the tokens returned from ntp_config... (crypto_config): Fix a typo... (crypto_config): Even more... (usage): Flesh it out. * include/ntp_config.h: * ntpd/ntp_config.c: Move a whack of #defines to ntp_config.h so ntp-genkeys.c can see them, too. * util/ntp-genkeys.c: Add stubs to work with ../ntpd/ntp_config.o, start hooking things up. (main): debugging (crypto_config): better implementation * ntpd/ntp_config.c (getconfig): * ntpd/ntpd.c: Initialize "debug" here, not in ntp_config.c * util/Makefile.am (ntp_genkeys_LDADD): Added ../ntpd/ntp_config.o * util/Makefile.am (ntp_genkeys_DEPENDENCIES): Added. 2000-07-30 Harlan Stenn * configure.in: 4.0.99k4 * util/ntp-genkeys.c: Start hacking for new functionality. * include/Makefile.am (noinst_HEADERS): Added ntp_cmdargs.h and ntp_config.h . * ntpd/ntp_config.c: Grab ntp_cmdargs.h. Make some new globals (ugh), move ntpd-specific variables and code to cmd_args.c . * ntpd/cmd_args.c: Move command argument processing functions from ntp_config.c to this file. * ntpd/Makefile.am (ntpd_SOURCES): Added cmd_args.c * include/ntpd.h: Move getstartup() to ntp_cmdargs.h * include/ntp_cmdargs.h: New file Begin the hacking fest to make it easier for ntp-genkeys to use ntpd's config processing code. I really hope this is the lesser of the evils... 2000-07-28 Harlan Stenn * util/ntp-genkeys.c (usage): Added. * ntpd/ntp_crypto.c: Cleanup * ntpd/ntp_proto.c (transmit): Add some parens. (peer_xmit): Add ntohl when grabbing sndauto.seq for broadcast. * ntpd/ntp_peer.c (findpeer): Cleanup * ntpd/ntp_loopfilter.c (local_clock): Typo From Dave Mills * include/ntp_config.h: Created * util/ntp-genkeys.c: Always build, but realize we may not have RSAREF. Compile parts appropriately. * util/Makefile.am (bin_PROGRAMS): Always make ntp-genkeys (ntp-genkeys_LDADD): Use $LIBRSAREF instead of the "real path" * configure.in: Lose MAKE_NTP_GENKEYS * configure.in: * util/ntp-genkeys.c: * util/Makefile.am: Renamed ntp_genkeys to ntp-genkeys. 2000-07-27 Harlan Stenn * ntpdate/ntpdate.c (ntpdatemain): Cleanup error message. * ntpdate/ntpdate.c (ntpdatemain): Add missing authtrust() call From: Jason Heiss * ntpd/refclock_ulink.c (ulink_receive): * ntpd/ntp_crypto.c: * libntp/authparity.c: Lint/noise cleanup From: Marc Brett * ntpd/ntp_proto.c: Specifically track manycastserver and survivors From: Dave Mills 2000-07-26 Sven Dietrich * ntpd/ntpd.c: remove WINNT priority adjustment to the ports/winnt area where it does not clutter up the main distribution. 2000-07-24 Harlan Stenn * ntpd/ntp_proto.c (receive): dstadr_sin needs higher visibility From: Dave Mills * flock-build: Added baldwin * ntpd/ntp_request.c: * ntpd/ntp_proto.c: * ntpd/ntp_peer.c: * ntpd/ntp_io.c: * ntpd/ntp_intres.c: * ntpd/ntp_crypto.c (make_keylist): * ntpd/ntp_control.c: * ntpd/ntp_config.c (CONF_MOD_IBURST, save_resolve): * include/ntpd.h (findpeerbyassoc, newpeer, peer_config, *_interface): * include/ntp_request.h (CONF_FLAG_IBURST): * include/ntp_crypto.h (crypto_xmit, make_keylist): * include/ntp.h (FLAG_IBURST): * html/release.htm: * html/confopt.htm: * html/assoc.htm: Add iburst option, fix broadcast/multicast and some types. From: Dave Mills 2000-07-20 Harlan Stenn * scripts/Makefile.am (bin_SCRIPTS): Install ntp-wait * configure.in: 4.0.99k 2000-07-19 Harlan Stenn * ntpd/ntp_proto.c (peer_xmit): PUBKEY cleanup 2000-07-18 Harlan Stenn * configure.in: 4.0.99j5 * html/ntpd.htm (HREF): Document other missing command-line options * html/ntpd.htm (HREF): Document * html/confopt.htm (href): Undocument * ntpd/ntp_config.c (getconfig): -N high for high-priority. Lose the ntp.conf way of setting priority. * ntpd/ntp_crypto.c: PUBKEY/AUTOKEY cleanup From Dave Mills 2000-07-17 Harlan Stenn * html/confopt.htm (href): Document it. * ntpd/ntp_config.c (getconfig): CONFIG_PRIORITY support * ntpd/ntpd.c (set_process_priority): Use it. * ntpd/ntp_crypto.c: Crypto key stuff * ntpd/ntp_proto.c: pubkey -> pubkey.ptr * ntpd/ntp_control.c (ctl_putpeer): fstamp -> pubkey.fstamp * ntpd/ntp_peer.c: * include/ntpd.h: * include/ntp_types.h: * include/ntp_request.h: * include/ntp_crypto.h: * include/ntp_control.h: * include/ntp.h: Type cleanup From: Dave Mills 2000-07-14 Harlan Stenn * ElectricFence/Makefile.am (check-local): Don't run the tests if we didn't build the programs... (check-local): Same, but watch the return codes... * ElectricFence/page.c: #include config.h if it's there. Properly handle the sys_errlist declaration. * html/ntpq.htm: * html/index.htm: * html/debug.htm: * html/authopt.htm: Reality check. From Dave Mills 2000-07-13 Harlan Stenn * Makefile.am (SUBDIRS): Added ElectricFence * configure.in (AC_CONFIG_FILES): Added ElectricFence support * ElectricFence: Imporpted. 2000-07-12 Harlan Stenn * util/ntp_genkeys.c (main): Cleanup * ntpd/refclock_wwv.c (wwv_qrz): sqrt -> SQRT * ntpd/refclock_chu.c (chu_rf): sqrt -> SQRT * ntpd/ntpd.c (set_process_priority): Disable high-priority for now. PUBKEY cleanup. * ntpd/ntp_timer.c: sys_revoketime cleanup. * ntpd/ntp_proto.c (receive): PUBKEY cleanup. Comment and code cleanup. (process_packet): Comment and code (PUBKEY) cleanup. (peer_xmit): Comment and code cleanup. (fast_xmit): Comment and code cleanup. * ntpd/ntp_peer.c (expire_all): revoketime cleanup. PUBKEY cleanup. * ntpd/ntp_crypto.c: Comment reorg. DH parameters are now file-static instead of local to subroutines. (make_keylist): peer->pcookie.key cleanup/fix (crypto_recv): Subroutine documentation cleanup, other cleanup (crypto_xmit): Cleanup/document. (crypto_setup): Cleanup/document. (crypto_agree): Cleanup/document. (crypto_rsa): now static (crypto_dh): now static. Comment cleanup. Code cleanup. (crypto_tai): now static. Code and comment cleanup. (crypto_config): Deal with CRYPTO_CONF_LEAP. * ntpd/ntp_control.c (CS_DHPARAMS): Rename corresponding token to "params". Remove CS_TAI from def_sys_var[]. (ctl_putsys): CS_HOST, CS_DHPARAMSm CS_REVTIME, and CS_LEAPTIME bugfix. CS_TAI cleanup. * ntpd/ntp_config.c (CONF_CRYPTO_LEAP): Added (getconfig): Added CONF_CRYPTO_LEAP support. * include/ntp_syslog.h: Lose GIZMO stuff. * include/ntp_crypto.h (CRYPTO_CONF_LEAP): Added * include/ntp.h: struct autokey, cookie,value, and pkt changes for signature field. Update the inline docs on pkt's exten field. From: Dave Mills 2000-07-08 Harlan Stenn * ntpd/ntp_util.c (stats_config): If we read a bogus old_drift, use 0 instead of failing. 2000-07-03 Harlan Stenn * README.cvs: Cleanup. * ntpd/refclock_datum.c (datum_pts_poll): index -> unit_index * ntpd/ntp_resolver.c (findhostaddr): const cleanup * libntp/recvbuff.c: * libntp/msyslog.c: * libntp/emalloc.c: * libntp/authreadkeys.c: Fix header order. From: Simon Burge * ntpd/ntp_util.c (stats_config): Use HAVE_FINITE and HAVE_ISFINITE * configure.in (ac_cv_struct_ntptimeval_timespec): isfinite() checks for HP-UX11. From: Albert Chin-A-Young 2000-07-02 Harlan Stenn * flock-build (LIST): Lose malarky, update some machine/OS descriptions * configure.in: 4.0.99j4 * ntpq/ntpq.c: Lose PUBKEY stuff - older ntpq's will complain when they see the info in a packet. * ntpd/ntp_proto.c (peer_xmit): TAI changes. * ntpd/ntp_crypto.c: Fix host/network byteorder stuff. Follow global->struct changes. TAI changes. Bugfixes. * ntpd/ntp_control.c: Follow field reorder/rename. * include/ntp_crypto.h: Move crypto stuff from separate globals into structs. * include/ntp_control.h (CS_HOST): Reorder/rename some fields From: Dave Mills 2000-06-30 Harlan Stenn * ntpd/ntp_peer.c (unpeer): Moved keystr cleanup inside ifdef PUBKEY * configure.in: 4.0.99j3 * html/release.htm: * html/ntpq.htm: * html/authopt.htm: Updates from Dave Mills * ntpd/ntp_request.c (dns_a): Don't call crypto_public for now... * ntpd/ntp_proto.c (receive): Follow the TEST wiggles (peer_xmit): TAI support * ntpd/ntp_crypto.c: TAI support * ntpd/ntp_control.c: CS_VERSION and CS_TAI support * include/ntp_crypto.h (CRYPTO_FLAG_TAI): Added. * include/ntp_control.h (CS_VERSION): Added. * include/ntp.h (TEST4,TEST5,TEST8,TEST9): Wiggle. From: Dave Mills * ntpd/Makefile.am (ntpd_SOURCES): Lose refclock_ulink331.c because the new refclock_ulink.c handles it. 2000-06-28 Harlan Stenn * ntpd/ntp_config.c (getconfig): Sanity check the right variable From: Dave Mills. 2000-06-25 Harlan Stenn * configure.in: 4.0.99j2 * ntpd/ntp_proto.c: * ntpd/ntp_peer.c: * ntpd/ntp_crypto.c: * include/ntp_crypto.h: * include/ntp.h: AUTOKEY/PUBKEY/DH/crypto changes From: Dave Mills 2000-06-23 Harlan Stenn * html/driver34.htm: * ntpd/refclock_ulink.c: * ntpd/refclock_ulink331.c: (removed) Updated for 320/330 series refclocks From: joseph lang * ntpd/refclock_oncore.c: Patches/improvements * html/driver30.htm: New release From: Reg Clemens 2000-06-17 Harlan Stenn * configure.in: 4.0.99j1 * ntpdc/ntpdc.c (getcmds): * configure.in: Readline support. From: Aaron Sherman * ntpd/refclock_ulink331.c: Added. Sent in by Doug Grosso * ntpd/Makefile.am (ntpd_SOURCES): Added refclock_ulink331.c * libntp/snprintf.c: Added stdio.h From: Marc Brett * include/ntp.h: struct autokey's siglen is u_int32. So is the siglen in struct cookie. So is siglen and value length in struct value. Add fstamp to struct peer. Resize the exten AUTOKEY field in struct pkt. * include/ntp_crypto.h: crypto_enable -> crypto_flags and a variety of other cleanups. * ntpd/ntp_config.c: crypto_enable -> crypto_flags, and some key/fudge cleanup. * ntpd/ntp_control.c: Much cleanup. * ntpd/ntp_crypto.c: Many changes that Harlan is too tired to properly document. * ntpd/ntp_peer.c: crypto_enable -> crypto_flags (peer_config): Hold off on crypto_public() until some resolver issue is fixed. * ntpd/ntp_proto.c (receive): Disable the reverse DNS lookup for now. (process_packet): Don't record_raw_stats() for now. crypto_enable was renamed to crypto_flags. (peer_xmit): In MODE_ACTIVE or MODE_PASSIVE, only call crypto_xmit() if the peer->cmmd is not CRYPTO_AUTO. Reset peer->cmmd to 0 when we're thru. Don't reset peer->cmmd to 0 until the end of MODE_CLIENT. * ntpd/ntpd.c: Lose the call to crypto_init(). Instead, call crypto_setup() later on if we have crypto_flags. * util/ntp_genkeys.c: Lose GENLEN; use PRIMELEN/2 . From Dave Mills. * ntpd/ntp_crypto.c (crypto_rsa): (crypto_dh): Do some debug logging if readlink() fails with something other than EINVAL (file isn't a symlink). 2000-06-04 James R. Van Zandt * html/miscopt.htm (trap): punctuation * html/ntpd.htm (-g): typo * html/miscopt.htm (logconfig): List the "clock" event class. "allprefix" should be two words. 2000-05-31 Harlan Stenn * ntpd/ntp_timer.c: Protect 2000-05-30 Harlan Stenn * ntpd/Makefile.am: Document what we expect from -lm 2000-05-29 Harlan Stenn * configure.in: 4.0.99j 2000-05-22 Harlan Stenn * html/ntptime.htm: More fixes From: Kazu TAKAMUNE 2000-05-16 Harlan Stenn * build (KEYSUF): * flock-build: * configure.in: Lose the "md5" options from the --with-crypto check; Dave hates it. * ntpd/ntp_util.c (stats_config): * ntpd/ntp_loopfilter.c (loop_config): * libntp/systime.c (adj_systime): * include/ntp_proto.h (NTP_MAXFREQ): Renamed MAX_FREQ to NTP_MAXFREQ * ntpd/ntpd.c (ntpdmain): * ntpd/ntp_proto.c (receive): (poll_update): * ntpd/ntp_intres.c (addentry): * ntpd/ntp_config.c (getconfig): Lint cleanup From: Marc Brett * include/ntp_stdlib.h: * libntp/systime.c (adj_systime): * ntpd/ntp_loopfilter.c (loop_config): * ntpd/ntp_util.c (stats_config): * ports/winnt/ntpd/nt_clockstuff.c (adj_systime): MAXFREQ -> MAX_FREQ * include/ntp_proto.h: Define MAX_FREQ 2000-05-15 Harlan Stenn * include/ntp_stdlib.h: * libntp/systime.c (adj_systime): * ntpd/ntp_loopfilter.c (loop_config): * ntpd/ntp_util.c (stats_config): * ports/winnt/ntpd/nt_clockstuff.c (adj_systime): sys_maxfreq -> MAXFREQ Per Dave Mills. 2000-05-14 Harlan Stenn * acinclude.m4: Typo... 2000-05-13 Harlan Stenn * libntp/gpstolfp.c (GPSORIGIN): Try new ULONG_CONST macro * ntpdate/ntptimeset.c: * ntpdate/ntpdate.h: * ntpd/refclock_oncore.c (oncore_msg_En): * ntpd/ntp_util.c (stats_config): * ntpd/ntp_request.c: * ntpd/ntp_intres.c (findhostaddr): * ntpd/ntp_config.c (getconfig): * libntp/systime.c (adj_systime): * libntp/lib_strbuf.c: * libntp/authparity.c: * libntp/audio.c: Header/lint cleanup From/reported by: Simon Burge * ntpd/ntp_resolver.c (findhostaddr): Compiler noise cleanup * ntpd/ntp_intres.c: Compiler noise cleanup * html/ntptime.htm: Document reality check From: Kazu TAKAMUNE 2000-05-12 Harlan Stenn * ntpd/ntp_intres.c (ntp_intres): Quiet some debug messages Reported by: Brian Bergstrand 2000-05-11 Harlan Stenn * scripts/mkver.in (ConfStr): Use -r if we're using RSAREF, otherwise use -a if we're using autokey, otherwise use no extra suffix. 2000-05-11 Sven Dietrich * ports/winnt/include/config.h: New defines to support AUTOKEY * ports/winnt/include/unistd.h: Added another dummy placeholder.h * ports/winnt/ntpd/ntpd.dsp: Added ntp_crypt.c to makefile * ports/winnt/ntpd/ntpd.c: service_main needs a local hostname[] * html/hints/winnt.htm: Add remark about 4.0.99i not compiling. These changes got WINNT running again. No idea if the keys stuff works however. 2000-05-10 Harlan Stenn * configure.in: 4.0.99i9 * ntpd/ntp_crypto.c: tstamp and autokey cleanup From: Dave Mills * ntpd/ntp_proto.c (clock_update): Only call expire_all() if AUTOKEY From many folks, including Reg Clemens 2000-05-07 Harlan Stenn * configure.in: 4.0.99i8 * flock-build: Use new --with-crypto choices * build (KEYSUF): Deal with new --with-crypto * configure.in: --with-crypto={md5,autokey,rsaref}; lose --enable-autokey 2000-05-06 Harlan Stenn * build (KEYSUF): Catch --disable-autokey first. 2000-05-05 Harlan Stenn * flock-build: If we don't use autokey, don't use rsaref either. * configure.in: 4.0.99i7 * build (KEYSUF): * flock-build: It's --disable-autokey now * configure.in: MD5 is not optional (but AUTOKEY is) * include/ntp_stdlib.h: * libntp/a_md5encrypt.c: * libntp/authkeys.c: (authhavekey): (MD5auth_setkey): (auth_delkeys): (authencrypt): (authdecrypt): * libntp/authreadkeys.c: (authreadkeys): * ntpd/ntp_proto.c (init_proto): * libntp/authusekey.c: MD5 is required. 2000-05-04 Harlan Stenn * configure.in: 4.0.99i6 * ntpd/ntp_proto.c (transmit): Fix up the UNREACH code. (receive): Lose some debug code. (clock_update): expire_all() if LEAP_NOTINSYNC crypto_xmit() a CRYPTO_AUTO if !FLAG_AUTOKEY instead of recauto.tstamp crypto_xmit() a CRYPTO_PRIV (not CRYPTO_AUTO) based on pcookie.tstamp crypto_xmit() a CRYPTO_AUTO (not CRYPTO_PRIV) based on FLAG_MCAST2 and !FLAG_AUTOKEY * ntpd/ntp_crypto.c (crypto_recv): Clean up debug output. Don't AUTOKEY if FLAG_MCAST2 From: Dave Mills * flock-build: Also make obe withouyt md5 (no AUTOKEY) * build (BDIR): Handle -noautokey build directory suffix * configure.in: Prepare for AUTOKEY in mkver.in * scripts/mkver.in (ConfStr): Indicate in the version string if we're not using AUTOKEY. 2000-05-03 Harlan Stenn * scripts/ntp-wait.in: Fun things with backspaces * configure.in: 4.0.99i5 * ntptrace/ntptrace.c: Protect sys/ioctl.h; grab config.h * ntpd/ntp_proto.c (transmit): AUTOKEY and tstamp fixes. (clock_update): Check oleap against LEAP_NOTINSYNC (peer_clear): Free pubkey when we're done Check peer's keynumber against the seq in MODE_BROADCAST. Reorder tstamp changes. * ntpd/ntp_crypto.c (crypto_recv): Check the packet if we get a CRYPTO_RESP and reorder the update of tstamp. (crypto_recv): Don't expire the peer until we're thru with it. * include/ntp.h: AUTOKEY and pkeyid changes From Dave Mills * ntpdate/ntpdate.c: Protect sys/ioctl.h 2000-05-01 Harlan Stenn * configure.in: 4.0.99i4 * include/ntp.h: * include/ntp_crypto.h: * include/ntpd.h: * ntpd/ntp_crypto.c: * ntpd/ntp_proto.c: * ntpd/ntpd.c: * util/ntp_genkeys.c: Dave Mills closed some potential vulnerabilities in the key protocol. 2000-04-28 Harlan Stenn * configure.in: 4.0.99i3 * ntpd/ntp_proto.c: Just check tstamp, forget about sndauto.seq * ntpd/ntp_crypto.c (crypto_recv): Lose inappropriate ntohl() conversion on tstamp. AUTOKEY if tstamp>0, not != Stash tstamp before we check pcookie.key (several places) * ntpd/ntp_control.c (ctl_putpeer): In CP_INITSEQ, check recauto.key, not keylist. From: Dave Mills 2000-04-27 Harlan Stenn * configure.in: 4.0.99i2 * ntpq/ntpq.c: PUBKEY stuff * ntpd/ntp_proto.c (clock_select): nreach, and better survivor pick. * ntpd/ntp_peer.c (newpeer): Better nextdate choice. * ntpd/ntp_control.c (ctl_putsys): Buglet in CS_HOSTNAM code. From Dave Mills. 2000-04-24 Harlan Stenn * build (IAM): Show hostname if we trip a buildkey check. 2000-04-23 Harlan Stenn * build: deal with optional 1st argument (SIG), which must match the contents of .buildkey * flock-build: Generalize, implement SIG and .buildkey, and drive list from LIST, which the user can override. 2000-04-21 Harlan Stenn * configure.in: 4.0.99i1 Dave updated some docs, implemented the kpoll variable, and wiggled a host/network byte order thing in the crypto key code. 2000-04-16 Harlan Stenn * ntpd/refclock_wwvb.c (wwvb_receive): Grab any character (instead of just a space) before the DSTchar. From: Dave Mills 2000-04-11 Harlan Stenn * configure.in: 4.0.99i Dave made some documentation updates. 2000-04-08 Harlan Stenn * flock-build: Add malarky. By default, --enable-parse-clocks. Start 2 builds, one with and the other without rsaref. * configure.in: 4.0.99h6 Dave improved the crypto stuff some more. 2000-04-05 Harlan Stenn * ntpd/refclock_acts.c (acts_receive): Do a better job with year conversions and leap-year checks. The PTB stuff caught this. Reported by: Daniel.Aeby@eam.admin.ch 2000-04-02 Harlan Stenn * ntpd/refclock_atom.c (atom_pps): Bugfix From: Philippe Charnier 2000-03-30 Harlan Stenn * libparse/clk_wharton.c (cvt_wharton_400a): Do not return CVT_NONE when receiving the early warning bit set. From: Philippe De Muyter * configure.in: 4.0.99h5 Dave made more changes to the auth key stuff. 2000-03-29 Harlan Stenn * configure.in: 4.0.99h4 Dave made a bunch of changes/fixes to the auth key stuff. 2000-03-22 Harlan Stenn * ntpd/ntp_resolver.c: Typos. 2000-03-21 Harlan Stenn * configure.in: 4.0.99h3 * ntpd/ntp_intres.c: Use LOG_INFO instead of LOG_DEBUG. * ntpd/ntp_resolver.c: Ditto. 2000-03-20 Harlan Stenn * util/Makefile.am (ntp_genkeys_LDADD): Might need snprintf (-lntp) * librsaref/Makefile.am (stamp-rsaref): nodist_HEADERS are not supoprted yet. Hack around it. * ntpd/ntp_resolver.c (findhostaddr): hstrerror isn't always available. * configure.in: Look for hstrerror. * util/ntp_genkeys.c (main): Use snprintf, not sprintf. * ntpd/ntp_crypto.c: Use gethostname, not uname * util/ntp_genkeys.c: Ditto From: Dave Mills 2000-03-19 Harlan Stenn * ntpd/ntp_proto.c (receive): Rename ntp_res_send() to ntp_res_name() and adjust the number of arguments. * ntpd/ntp_resolver.c (ntp_res_name): Ditto * include/ntpd.h: Ditto * ntpd/ntp_resolver.c: Add de_done to the dns_entry structure. 2000-03-18 Harlan Stenn * configure.in: 4.0.99h2 * libparse/Makefile.am (info_trimble.c): Use $(srcdir)/foo.sed instead of foo.sed . * librsaref/Makefile.am (stamp-rsaref): Copy each file to the build directory, not to the source directory. This sucks; it wastes space (but it's more portable). * configure.in (ac_busted_vpath_in_make): Add FreeBSD. I bet all systems that use pmake will need this. (ac_busted_vpath_in_make): Remove FreeBSD - I found a workaround. * Makefile.am: General cleanup * configure.in: 4.0.99h1 * ntpd/ntp_resolver.c: Lose unneeded header. 2000-03-17 Harlan Stenn * libntp/snprintf.c: #include * libntp/Makefile.am (EXTRA_libntp_a_SOURCES): Use it correctly... 2000-03-16 Harlan Stenn * libntp/Makefile.am (EXTRA_DIST): Added snprintf.c * configure.in: Look for (and provide if it's missing) snprintf() * ntpd/ntp_request.c (dns_a): Call crypto_public with the resolved name and the peer pointer. (dns_a): crypto_public() is only available if PUBKEY is #defined. * ntpd/ntp_crypto.c (crypto_public): sprintf is Evil. Use snprintf. (crypto_setup): Ditto (crypto_read): Ditto * ntpd/ntp_resolver.c (ntp_res_send): Lose some debugging noise. * ntpd/ntp_config.c (getconfig): Lose testing code. * ntpd/ntp_request.c (dns_a): Fix buglet in hostname length check. 2000-03-16 Harlan Stenn * ntpd/ntp_request.c (dns_a): Start cracking the returned information. 2000-03-15 Harlan Stenn * ntpd/ntp_resolver.c (ntp_res): Authenticate the keyid. * ntpd/ntp_crypto.c (crypto_line): Fix definition (crypto_read): Ditto. * ntpd/ntp_config.c (getconfig): Move req_keyid generation here. * librsaref/Makefile.am (BUILT_SOURCES): Cleanup more nodist_ stuff. 2000-03-14 Harlan Stenn * build (RSASUF): If we have rsaref2/ and are building --without-rsaref, note it as a build-directory suffix. * configure.in: 4.0.99h Crypto merge * librsaref/Makefile.am (nodist_librsaref_a_SOURCES): Added nodist_ 2000-02-28 Harlan Stenn * configure.in: Lose the changequote calls and fix the quoting. Reported by: Akim Demaille * ntpd/ntp_request.c: Log various error conditions. 2000-02-27 Harlan Stenn * configure.in: 4.0.99g * ntpd/ntpd.c: Only log EINTR if debug > 2. 2000-02-25 Harlan Stenn * scripts/mkver.in (ConfStr): Use `-r' when configured with crypto. * ntpd/refclock_wwvb.c (wwvb_receive): Undo the previous chagne. 2000-02-24 Harlan Stenn * ntpd/refclock_wwvb.c (wwvb_receive): LENWWVB0 can return 6 or 7 fields. From: Michael Sinatra with a cleanup from Ulrich. * scripts/mkver.in (ConfStr): Make RSAREF appear as part of the version. 2000-02-21 Sven Dietrich * ports/winnt/include/config.h: Enable MD5 and RANDOM by default * ports/winnt/libntp/SetSystemTime.c: Fix warning and const declaration From: Carl Byington 2000-02-21 Harlan Stenn * Makefile.am (SUBDIRS): Make librsaref right after includes so we can copy any needed header files over. * libntp/Makefile.am (INCLUDES): Also look in librsaref for des.h * ntpd/Makefile.am (INCLUDES): Ditto * util/Makefile.am (INCLUDES): Ditto * librsaref/Makefile.am (librsaref_a_SOURCES): Use the des.h from the rsaref2 distribution. * include/Makefile.am (noinst_HEADERS): No, we don't want des.h 2000-02-20 Harlan Stenn * include/Makefile.am (noinst_HEADERS): Add des.h 2000-02-19 Harlan Stenn * ntpd/ntp_config.c (do_resolve_internal): Try Real Hard to generate a full random key. From: Carl Byington * include/ntp.h: Now we know we have either mrand48() or random(). * configure.in: If we have mrand48, use it. Otherwise, use (and provide if necessary) random(). * libntp/Makefile.am (EXTRA_DIST): random.c * libntp/random.c: Added. 2000-02-18 Harlan Stenn * librsaref/Makefile.am (stamp-rsaref): Typo * configure.in (ac_cv_func_ctty_for_f_setown): Yes for OpenBSD (ac_cv_var_ntp_syscalls): Fix quoting of description From: Jonathan Rozes * librsaref/Makefile.am: Fix stamp-rsaref dependency order. * configure.in: 4.0.99f 2000-02-17 Harlan Stenn * ntpd/refclock_mx4200.c: Remove the DOP-weighted position averaging code and revert to a simple mean average. The weighted average consistently produced a *worse* result. Go figure. * html/mx4200data.htm: Cleanup, reflect current reality. * html/driver9.htm: Cleanup, reflect current reality. * html/copyright.htm: Cleanup, and credit where credit is due. From: Marc.Brett@westgeo.com * ntpd/refclock_oncore.c: Cleanup/fixes * html/driver30.htm: Cleanup * html/Oncore-SHMEM.htm: Cleanup From: Reg Clemens 2000-02-16 Sven Dietrich * winnt/scripts/mkver.bat: Frederick Czajka [w2k@austin.rr.com] winnt/ntpq/ntpq.dsp: modified mkver.bat to eliminate the winnt/ntpd/ntpd.dsp: need to have Perl installed and the winnt/ntpdc/ntpdc.dsp: PERL environment variable to be set. winnt/ntpdate/ntpdate.dsp: winnt/ntptrace/ntptrace.dsp: Thanks, Frederick! * ntpd/refclock_nmea.c: Correctly interpret the quality indicator. 2000-02-15 Harlan Stenn * ntpd/refclock_nmea.c: Correctly interpret the quality indicator. Deal with the time supplied in centiseconds. GPGCA/GPGGA cleanup. From: Andrew Hood * libparse/Makefile.am (K_CFLAGS): Use instead. Add NEED_NTP_BOPS. 2000-02-10 Harlan Stenn * scripts/ntp-wait.in: Intensify, including some suggestions from Ulrich. * configure.in: 4.0.99e * scripts/ntp-wait.in: Lose cruft, sleep after each try. * scripts/ntp-restart: It's ntpd now. Also, call ntp-wait. * configure.in (AC_CONFIG_*): New scripts that use PATH_PERL * scripts/Makefile.am (noinst_SCRIPTS): Added ntp-wait (noinst_SCRIPTS): Added all of the scripts that now use PATH_PERL * configure.in: Get the path to perl (AC_CONFIG_*): Added scripts/ntp-wait * ntptrace/ntptrace.c (DoTrace): If the server's srcadr is 0.0.0.0 then we haven't synced yet. Note and punt. Reported by: Bdale Garbee ,http://bugs.debian.org/56551 2000-02-09 Harlan Stenn * ports/winnt/include/config.h: Typo (CLOCK_PALISADE comment) From: Carl Byington * configure.in: Disable kernel_fll_bug for Generic_105181-17 under Solaris-2.6 From: Juergen Georgi 2000-02-07 Harlan Stenn * configure.in: 4.0.99d * html/Oncore-SHMEM.htm: New document * html/driver30.htm: Cleanup and improvements From: Reg Clemens 2000-01-30 Harlan Stenn * ntpd/refclock_oncore.c: Patches/improvements From: Reg Clemens 2000-01-29 Harlan Stenn * configure.in: 4.0.99c 2000-01-28 Harlan Stenn * configure.in: Autoconf update... * ntpdate/ntpdate.c (ntpdatemain): Typo From: Jack Bryans * Makefile.am (EXTRA_DIST): Add flock-build. Probably UDel specific... 2000-01-23 Harlan Stenn * ntpd/check_y2k.c (main): Reformat for ansi2knr * configure.in (AC_OUTPUT): Revert to obsolete form until automake catches up. 2000-01-22 Harlan Stenn * configure.in: Use AC_CHECK_TYPES((s_char)) instead of AC_CHECK_TYPE. (ac_cv_var_kernel_fll_bug): Generic_106541-08 is apparently OK, too. * scripts/Makefile.am (EXTRA_DIST): Need to explicitly distribute mkver.in and ntpver.in now, apparently. * configure.in: Search for the various audio_info members so the printing in audio_show is less of a circus. This required an autoconf upgrade. Major sigh. * libntp/audio.c (audio_show): Clean up (more) properly. 2000-01-21 Sven Dietrich * Add pointer to html/hints/winnt.htm to INSTALL file * Fix NT makefiles to accomodate at least one weird version of Visual C that can't handle the LFs without the DOS CR also. 2000-01-20 Sven Dietrich * Update Copyright in Palisade driver to 2000 * Fix Palisade MIN & MAX POLL to optimal values 2000-01-19 Harlan Stenn * html/driver7.htm: Patches from Dave Mills * html/driver36.htm: Patches from Dave Mills * html/copyright.htm: Added Kamal Mostafa 2000-01-19 Harlan Stenn * configure.in: 4.0.99b 2000-01-18 Harlan Stenn * ntpd/refclock_chu.c: NCHAN is used with generic ICOM. * ntpd/refclock_wwv.c: Use new audio stuff * ntpd/refclock_irig.c: Use new audio stuff * ntpd/refclock_chu.c: Use new audio stuff * ntpd/ntp_proto.c: Clean up * ntpd/ntp_loopfilter.c (local_clock): Clean up error message * include/icom.h: Number of arguments changed * libntp/Makefile.am (libntp_a_SOURCES): Added audio.c * libntp/audio.c: New file * include/Makefile.am (noinst_HEADERS): audio.h added * include/audio.h: New file From: Dave Mills * scripts/freq_adj: Added. FreeBSD frequency adjustment script. * configure.in: Do a better job on my oncore_ok check for SCO. 2000-01-15 Harlan Stenn * configure.in: 4.0.99a * scripts/ntpsweep: New version * html/copyright.htm: Added Hans Lambermont From: Hans Lambermont 2000-01-14 Harlan Stenn * ntpd/refclock_oncore.c (oncore_start): Only dance with the pps_device if it's there. From: reg@dwf.com * configure.in: ONCORE is OK if ac_cv_hdr_def_tiocdcdtimestamp=yes * build: Just overwrite the log file each time; sometimes NFS goes a little goofy. * ntpd/refclock_fg.c: Syntax/punctuation cleanup 2000-01-13 Harlan Stenn * scripts/ntpsweep: New version From: Hans Lambermont * ntpd/refclock_fg.c: New version * html/driver37.htm: New version From: Dmitry Smirnov 2000-01-12 Harlan Stenn * README.des: Cleanup 2000-01-12 Harlan Stenn * configure.in: 4.0.99 * html/driver36.htm: Cleanup * html/monopt.htm: Ditto From: Dave Mills * ntpd/ntp_intres.c (ntp_intres): Put "NTP_INTRES running" at a higher debug level 2000-01-11 Harlan Stenn * ntpd/refclock_wwv.c: More improvements From: Dave Mills 2000-01-10 Harlan Stenn * ntpd/refclock_wwv.c: Bugfixes/improvements From: Dave Mills * configure.in: Get the quoting right on the sys_errlist check. From documentation by: Akim Demaille 2000-01-08 Harlan Stenn * configure.in: cannot be detected... * ntpd/ntp_io.h: ...but every OS has it * ntpd/refclock_oncore.c: Lint removal * ntpq/ntpq_ops.c: Lint removal * ntpq/refclock_chu.c: chu_major() is not an audio routine (?), lint * libntp/icom.c: AIX doesn't have From: Marc.Brett@westgeo.com * ntpd/refclock_chu.c: NetBSD needs sys/ioctl.h (chu_debug): NetBSD-specific debug output. From: Frederick Bruckman 2000-01-06 Harlan Stenn * configure.in: 4.0.98m I skipped `l' - it looks like a `1'. * html/driver7.htm: Doc update * html/driver36.htm: Ditto * html/audio.htm: Ditto * ntpd/refclock_wwv.c: Dvae snuck another fix/change in on me. * configure.in: 4.0.98k * ntpd/refclock_chu.c (chu_start): Call icom_init with the speed * ntpd/refclock_wwv.c (wwv_start): Ditto, plus other improvements. * libntp/icom.c (icom_init): Add speed parameter * include/icom.h: Update declaration From: Dave Mills * include/Makefile.am (noinst_HEADERS): Added icom.h From: Frederick Bruckman 2000-01-05 Harlan Stenn * configure.in: 4.0.98j * ntpd/refclock_wwv.c (timecode): Make definition == declaration (wwv_newchan): Ditto (wwv_corr4): Dave fixed the declaration. * flock-build: Add rackety to the flock - it runs SunOS 4.1.3/cc * ntpd/refclock_wwv.c: Undo that declaration cleanup for now... * ntpd/ntp_io.c (open_socket): TOS support From: Marc.Brett@westgeo.com 2000-01-04 Harlan Stenn * ntpd/refclock_wwv.c: Declaration cleanup * ntpd/refclock_fg.c (fg_receive): Not all sprintf's are created equal... From: Marc.Brett@westgeo.com * ntpd/refclock_wwv.c: Dave Cleaned and Improved things. * ntpd/ntp_loopfilter.c (local_clock): Dave fixed something. * ntpd/refclock_wwv.c: Rename max to p_max or s_max as appropriate to avoid native SunOS compiler collision. (wwv_epoch): Make declaration == definition (wwv_rsec): Ditto (wwv_newchan): Ditto (wwv_qsy): Ditto (timecode): Ditto * ntpd/refclock_oncore.c (oncore_init_shmem): Use a cast to widen mmap's NIL offset. * ntpd/refclock_chu.c (chu_rf): Make declaration == definition. Rename min/max to es_min/es_max to avoid native SunOS compiler collision. (chu_uart): Make declaration == definition. * libntp/icom.c (sndpkt): Make declaration and definition equivalent. (doublefreq): Ditto. * ntpd/refclock_oncore.c (MAP_FAILED): Some systems do not #define this. * ntpd/refclock_wwv.c: * ntpd/refclock_chu.c: * libntp/icom.c: * libntp/Makefile.am: * include/icom.h: * html/driver7.htm: * html/driver36.htm: Support for ICOM. The WWV/H driver, by the way, is getting truly awesome. The CHU autotune function works okay as it is. I'd like to find somebody else to test the audio drivers just to make sure I haven't done something stupid. There is a new define ICOM intended for the driver autotune function; however, I crafted the thing in much the same way as the refclock_atom.c thing - it tries to open /dev/icom and, if that fails, goes quietly to sleep. From: Dave Mills 2000-01-03 Harlan Stenn * ntpd/refclock_oncore.c (oncore_read_config): Patches and cleanup From: Poul-Henning Kamp more isascii() stuff from HMS. * ntpd/refclock_fg.c (fg_receive): Cast. From: Tom Smith * ntpd/map_vme.c (map_vme): tx.access_result indicates failure on < 0, not <= 0. A fix that apparently did not get brought over from the ntp3 base. From: Michael Barone * configure.in: Move the ONCORE_SHMEM_STATUS check and definition here. * ntpd/refclock_oncore.c (oncore_init_shmem): Some systems do not have MAP_HASSEMAPHORE. * ntpd/refclock_oncore.c: Drive ONCORE_SHMEM_STATUS based on HAVE_SYS_MMAN_H . If this needs finer checks, do it in configure.in . (oncore_read_config): Add the isascii() checks; older versions of Unix don't guarantee correct behavior of is*() without it. * ntpd/refclock_oncore.c: Add proof-of-concept support for delivering receiver data stream to other processes through a memory-mapped file. From: Poul-Henning Kamp 2000-01-02 Harlan Stenn * configure.in (ac_refclock_chu): Provide the CHU driver by default, and by default prefer the AUDIO version. We used to limit this to SunOS or Solaris; now we drive by the availability of the audioio header file. Select the IRIG and WWV audio drivers the same way. * flock-build: build ignores the -l flag; lose it. (BUILD_ARGS): added. * build: Remove unused -l stuff (LOG variable). * ntpd/ntp_refclock.c: HAVE_PPSAPI header cleanup From: Reg Clemens 2000-01-01 Harlan Stenn * configure.in (CLOCK_WWV): Require or 1999-12-29 Harlan Stenn * configure.in: 4.0.98i * ntpd/refclock_gpsvme.c: Fixes From: Michael Barone Patch severely hacked by HMS to "make it conform". I hope I didn't break anything. * scripts/ntpsweep: Nifty utility From: Hans.Lambermont@nl.origin-it.com * ntpd/refclock_fg.c: * ntpd/refclock_conf.c: * ntpd/ntp_control.c: * ntpd/Makefile.am: * libntp/clocktypes.c: * include/ntp.h: * html/refclock.htm: * html/driver37.htm: * configure.in: * acconfig.h: Forum Graphic GPS clock support From: Dmitry Smirnov * configure.in: Default to compile the IRIG, CHU and WWV/H drivers and compile the CHU driver for audio, not modem. Requested by Dave Mills. * html/audio.htm: * html/driver36.htm: * html/qth.htm: Dave wrote these to go along with the changes I checked in yesterday. 1999-12-28 Harlan Stenn * ntpd/refclock_wwv.c: * ntpd/refclock_conf.c: * ntpd/refclock_chu.c: * ntpd/ntp_refclock.c: * ntpd/ntp_loopfilter.c: * html/refclock.htm: * html/pps.htm: * html/index.htm: * html/driver7.htm: * html/driver6.htm: * html/copyright.htm: I indulged an old agenda to polish up some programs originally written for a DSP evaluation board. The result is a really hot audio driver for the NIST WWV/WWVH time/frequency station plus a makeover for the CHU audio driver. Currently, they and their IRIG audio driver buddy use the SunOS/Solaris audio interface, which is clean and simple. I hook the line in jack to a shortwave radio and these drivers (driver 7 for CHU and driver 36 for WWV) and the drivers do the rest. The WWV/H driver is really hot - I am currently watching the ionosphere move from the doppler that shows up on the tick modulation tracked by the program. During midday when the F2 layer settles down, the program closes in on a few tens of microseconds of spare jitter and wander. This watch on whichever 15/20 MHz signal sounds the best. At night on 5/10 MHz and even 2.5 HMz where the multipath, interference and noise are much worse, the driver bangs around somewhat more. The CHU driver makeover discovered a few broken bones after all these years, but its majority decoder is back in business. For various reasons to icky to reveal here, its 103-modem demodulator is not quite as good as the chip, but it comes close and hey, 2025/2125 FSK is just not a good idea for HF radio. This driver is not nearly as sophisitcated as the WWV/H driver, but here a few hundred miles south of Ottawa, it does a passably good job. I tell you this in the hopes of getting somebody interested in porting the audio interface to other machines, in particular Linux, FreeBSD and anything else with a sound card. When the ionosphere stays cool, the WWV/H driver is as good as anything else around here and with much less jitter than a serial port. The only downside is all the audio drivers chew up a modest fraction of cycles for the DSP routines - a few percent on the newer silicon, up to half the cycles on an old Sparc IPC. Whattheheck, these old machines aren't doing anything else around here except serving time, and even when sucking cycles for DSP they still mind the PPS microseconds. The audio driver documentation had a makeover, too. From: Dave Mills 1999-12-20 Harlan Stenn * configure.in: 4.0.98h 1999-12-19 Harlan Stenn * libntp/syssignal.c: Small cleanup to Marc's patch. * ntpd/ntp_refclock.c: * ntpd/refclock_atom.c: Header cleanup * html/driver30.htm: Cleanup and improvements. From: Reg Clemens * ntpd/ntp_refclock.c: * ntpd/refclock_jupiter.c: * ntpd/refclock_msfees.c: * ntpd/refclock_mx4200.c: Portability (Solaris) patches * ntpd/refclock_mx4200.c: Self-survey improvements, cleanup for, PPS re-activation * libntp/syssignal.c: Fix for "interrupted system call" (EINTR) failure of the PPS ioctl(TIOCGPPSEV) call in Solaris. Not sure why it was interrupted, but this works around the failure. Not sure if the (now silent) interrupt affects the timing accuracy. THERE IS A CHANCE THIS PART OF THE PATCH MAY ADVERSELY AFFECT OTHER SYSTEMS! * scripts/ntp-status: Added. From: Marc.Brett@westgeo.com * ntpdate/ntpdate.c: Deal with multiple addresses. From: Jeffrey C Honig * ntpd/refclock_conf.c: Replaced macro SHM with CLOCK_SHM. * ntpd/refclock_shm.c (shm_poll): Take clock time in UTC. pp->day starts at 1, t->tm_yday starts at 0. From: Jakob Stoklund Olesen 1999-12-16 Harlan Stenn * NEWS: Updated ONCORE instructions From: Kamal A Mostafa 1999-12-13 Harlan Stenn * configure.in: 4.0.98g * ntpd/refclock_oncore.c: Cleanup and fixes From: Reg Clemens and Kamal A Mostafa 1999-12-11 Harlan Stenn * ntpd/refclock_wwv.c: Cleanup/checkin of the current state of affairs. From: Dave Mills * ntpd/refclock_oncore.c: #elif conversion. I can only hope I did it right. * ntpd/refclock_oncore.c: Various patches From: Reg Clemens and Kamal A Mostafa 1999-12-09 Harlan Stenn * ntpd/ntp_proto.c (default_get_precision): Use the right arg type to pass "sizeof freq" to sysctlbyname(). From: Ollivier Robert * ntpd/refclock_wwv.c: Cleanup and fixes. From: Dave Mills 1999-12-08 Harlan Stenn * ntpd/refclock_wwv.c: Cleanup and fixes * ntpd/refclock_conf.c: WWV declaration cleanup. From: Dave Mills 1999-12-07 Harlan Stenn * libparse/clk_rawdcf.c (cvt_rawdcf): Buglet. From: Frank Kardel acm.org> 1999-12-06 Harlan Stenn * ntpd/Makefile.am (ntpd_SOURCES): Added refclock_wwv.c * ntpd/refclock_wwvb.c: * ntpd/refclock_wwv.c: * ntpd/refclock_conf.c: * ntpd/refclock_chu.c: * libntp/clocktypes.c: * include/ntp.h: Dave cleaned some things up Dave cleaned some things up (WWVB -> SPECTRACOM, CHU -> CHU_AUDIO, WWV_AUDIO) * acconfig.h: REFCLOCK_WWVB -> REFCLOCK_SPECTRACOM, added REFCLOCK_WWV * configure.in: Deal with it. 1999-12-05 Harlan Stenn * ntpd/ntp_refclock.c (refclock_open): More PPS cleanup From: Dave Mills * ntpq/ntpq.c: * ntpq/ntpq_ops.c: Make `ntpq -pn' independent of DNS, ad advertised. From: Kamal A Mostafa * ntpd/refclock_mx4200.c (mx4200_start): make missing 3rd parameter a 0. 1999-12-04 Harlan Stenn * ntpd/ntp_refclock.c (refclock_open): "flags" processing cleanup (refclock_open): PPS device initialization cleanup * include/ntp_refclock.h (LDISC_CHU): (LDISC_PPS): Clean up comments From: Dave Mills 1999-12-03 Sven Dietrich * libntp/mexit.c: Moved WINNT port specific file to ports/winnt/libntp * ports/winnt/libntp/libntp.dsp: Fix WinNT makefile for new source loc. 1999-12-03 Harlan Stenn * libntp/Makefile.am (libntp_a_SOURCES): Lose mexit.c - Sven will move it to the winnt port area. 1999-12-03 Sven Dietrich * libntp/systime.c: Removed adjtime hack for WINNT * ports/winnt/ntpd/nt_clockstuff.c: Winnt double precision adjtime * ports/winnt/inlcude/clockstuff.h: Remove no longer needed externs 1999-12-02 Harlan Stenn * libparse/Makefile.in: Manually hacked to remove the libparse_kernel.a.[co] cruft * libparse/Makefile.am (k*.o): Generate these form the Makefile, not from separate .c files * html/tickadj.htm: * html/notes.htm: * html/hints/solaris.html: Point to the new dosynctodr report. * html/hints/solaris.xtra.S99ntpd: Update. Should be rewritten to take advantage of the new -g switch and perhaps a loop to wait until ntpd hits a reasonable "state". * html/hints/solaris-dosynctodr.html: New information From: "John W. Sopko Jr." 1999-12-01 Harlan Stenn * libntp/authkeys.c (auth_moremem): Clear memory allocated for sk. From: Hugo Mildenberger 1999-12-01 Sven Dietrich * libntp/recvbuff.c: Unused functions cleanup * ntpd/ntpd.c: ProcessorAffinity, IO cleanup * ports/winnt/instsrv/instsrv.c: Service name changed to NTP NT port shouldn;t hop between CPUs. Set affinity to first processor. Service name was NetworkTimeProtocol. Too long. Now NTP. 1999-12-01 Harlan Stenn * scripts/plot_summary.pl: Improved option parsing. Fixed one minor Perl compatibility error. * scripts/summary.pl: Official revision for NTPv4: Parse new statistic file formats correctly, provide error checking for bad input files, and guard against negative arguments to sqrt() because of numeric effects. Use one pattern to select valid statistic files. Add selectable output directory (``--output-directory'') and improved option parsing. Directory with statistic files (now settable also with ``--input-directory'') defaults to ``/var/log/ntp''. From: Ulrich Windl * html/driver8.htm: * libparse/clk_computime.c: * libparse/clk_dcf7000.c: * libparse/clk_hopf6021.c: * libparse/clk_meinberg.c: * libparse/clk_rawdcf.c: * libparse/clk_rcc8000.c: * libparse/clk_schmid.c: * libparse/clk_trimtaip.c: * libparse/clk_trimtsip.c: * libparse/data_mbg.c: * libparse/kclk_computime.c: * libparse/kclk_dcf7000.c: * libparse/kclk_hopf6021.c: * libparse/kclk_meinberg.c: * libparse/kclk_rawdcf.c: * libparse/kclk_rcc8000.c: * libparse/kclk_schmid.c: * libparse/kclk_trimtaip.c: * libparse/kclk_trimtsip.c: * libparse/kparse.c: * libparse/kparse_conf.c: * libparse/parse.c: * libparse/parse_conf.c: * libparse/parsesolaris.c: * libparse/parsestreams.c: * ntpd/refclock_parse.c: Mods and updates From: Frank Kardel acm.org> * acconfig.h: PCF refclock * configure.in: * html/driver35.htm: * html/refclock.htm: * include/ntp.h: * libntp/clocktypes.c: * ntpd/Makefile.am: * ntpd/ntp_control.c: * ntpd/refclock_conf.c: * ntpd/refclock_pcf.c: From: Andreas Voegele * acconfig.h: DECL_STIME_1 * configure.in (iCFLAGS): Use -std1 for alpha*-dec-osf* if we are using "cc". Reported by: Tom Smith 1999-11-30 Harlan Stenn * include/l_stdlib.h: DECL_SYSTIME_1 --- a long * * configure.in: Use it for DEC OSF[45] Reported by: Tom Smith * ntpd/refclock_parse.c: Add missing declarations * ntptrace/ntptrace.c: Ditto * ntpd/ntp_proto.c: Ditto * ntpd/refclock_palisade.c: Ditto From: Jonathan Stone 1999-11-18 Sven Dietrich * Win NT port updates * ntpd.dsp: makefile only builds supported refclocks * config.h: cleanup, undefine unsupported clock_atom * win32_io, clock_NMEA: foundation for future refclock support * recvbuff, transmitbuff, IOcompletionport: streamline packet handler * html/hints/winnt.htm: Added up-to-date html docs for WINNT 1999-11-17 Harlan Stenn * html/copyright.htm: Credit Jack for his work. * html/pic/*: Save a *ton* of space on the pictures. From: Jack Sasportas 1999-11-16 Harlan Stenn * configure.in : changequote for osf[45] test. Reported by: Tom Smith * ntp_update: Ignore stuff in any A.* directory. 1999-11-15 Harlan Stenn * configure.in: Clean up header checks for sys/syssgi.h and sys/select.h . Originally, we did not check for sys/select.h under some versions of SCO (see xntp3-5). Somewhere in ntp4 we dropped the SCO check and added the check for sys/syssgi.h, exclusive of checking for sys/select.h. Marc Brett can't think of a reason why we should not be checking for sys/select.h, so let's look for it now. 1999-11-13 Harlan Stenn * ntpdate/ntpdate.c: Add the ability for ntpdate to query a multicast address. We use the response to the multicast address to learn new servers which we then add to the peer list and query. In changing this I made the list of peers a linked list. To be complete I should detect a broadcast address and make it behave the same way. But that requires a scan of the interface list which is more complicated that I want to deal with... Fix a bug, allowing ntpdate to compile if SLEWALWAYS and STEP_SLEW are both defined. From: Jeffrey C Honig * ntpd/ntp_refclock.c: sys/sio.h and SCO5_CLOCK cleanup From: Kamal A Mostafa * ntpd/ntp_loopfilter.c: Let -g do a "correct any" for the first time adjustment. From: Dave Mills * configure.in: sys/sio.h needs to be checked independently. Reported by: Kamal A Mostafa 1999-11-11 Harlan Stenn * configure.in: 4.0.98f * configure.in: DECL_PLOCK_0 and DECL_STIME_0 are for dec-osf5*, too * ntpd/ntpd.c: DEC OSF cleanup (editorial comments by HMS) From: Tom Smith * ntpd/ntp_refclock.c: MAXUNIT bugfix From: Marc.Brett@westgeo.com * ntpd/ntp_refclock.c: * ntpd/ntpd.c: * ntpd/refclock_arc.c: * ntpd/refclock_as2201.c: * ntpd/refclock_atom.c: * ntpdc/ntpdc.c: * ntpq/ntpq.c: Code cleanup. From: Marc.Brett@westgeo.com * include/ntp_stdlib.h: * libntp/systime.c: * ntpd/ntp_proto.c: Replaced the 'sco5_oldclock' variable with 'systime_10ms_ticks'. Cleared libntp/systime.c and include/ntp_stdlib.h of references to SCO5_CLOCK and RELIANTUNIX_CLOCK (moved to ntpd/ntp_proto.c). From: Kamal A Mostafa * configure.in: alpha-dec-osf4* -> alpha*-dec-osf4*|alpha*-dec-osf5* From: Tom Smith * configure.in: Look for . If TIOCDCDTIMESTAMP is there, we have TTYCLK. * acconfig.h: Lose old AIOCTIMESTAMP stuff Reported by: Kamal A Mostafa 1999-11-10 Harlan Stenn * ntpd/ntpd.c (set_process_priority): Clean up nice() and setpriority() 1999-11-09 Harlan Stenn * Makefile.am (EXTRA_DIST): Added README.cvs Reported by: Kamal A Mostafa 1999-11-08 Harlan Stenn * configure.in: 4.0.98e 1999-11-07 Harlan Stenn * configure.in: Lose AIOCTIMESTAMP tests * ntpd/ntpd.c: lose select() EINTR debug warning * ntpd/ntp_refclock.c: AIOCTIMESTAMP -> TIOCDCDTIMESTAMP. Watch CLK_SETSTR. * ntpd/refclock_atom.c: fdpps is only there for PPS or PPSAPI. AIOCTIMESTAMP is gone now. From: Kamal A Mostafa * configure.in (HAVE_MLOCKALL): Deal with dec-osf5 realities * ntpd/refclock_ulink.c (ulink_poll): Fix cast. * libntp/machines.c (ntp_set_tod): Use a long* for the argument to stime(). Reported by: Tom Smith * ntpd/ntpd.c (set_process_priority): Use whatever we have until something works. * ntpd/ntp_loopfilter.c: Keep clock_frequency changes in a temp variable so we can record it to loopstats (near as HMS can tell). From: Dave Mills 1999-11-06 Harlan Stenn * acconfig.h: RELIANTUNIX_CLOCK * configure.in (ac_cv_var_tickadj): RELIANTUNIX_CLOCK * libntp/systime.c (adj_systime): Reliant patches From: Andrej Borsenkow 1999-11-05 Harlan Stenn * ntpd/refclock_parse.c (parse_start): ASYNC_PPS_CD_NEG cleanup * configure.in (ac_cv_make_ntptime): OK on Linux From: * configure.in: NetBSD has PPSAPI now F_SETOWN is needed for NetBSD From: Jonathan Stone 1999-11-02 Harlan Stenn * configure.in: 4.0.98d * ntpd/refclock_parse.c: Cleanup/fixes From: John Hay * ntpd/refclock_parse.c: Lose #include "ntp_select.h" * ntpd/ntpd.c: Lose #include "ntp_select.h" * ntpd/ntp_io.c: Lose #include "ntp_select.h" * ntpd/ntp_intres.c: Lose #include "ntp_select.h" * libntp/iosignal.c: Lose #include "ntp_select.h" * include/ntpd.h: #include "ntp_select.h" for declaration of activefds Reported by: Christian Krackowizer 1999-11-01 Harlan Stenn * configure.in: 4.0.98c * libntp/syssignal.c: Don't warn about SA_RESTART * libntp/recvbuff.c: Fix free buffer count From: Jeffrey C Honig * html/pps.htm: * html/howto.htm: * html/confopt.htm: * html/clockopt.htm: * html/uthopt.htm: Updates. From: Dave Mills * ntpd/refclock_wwvb.c: burst fixes * ntpd/refclock_ulink.c: burst fixes * ntpd/refclock_tpro.c: burst and NSTAGE fixes * ntpd/refclock_pst.c: burst fixes * ntpd/refclock_irig.c: SAMPLE -> SAMPLES * ntpd/refclock_heath.c: burst fixes * ntpd/refclock_dumbclock.c: burst fixes * ntpd/refclock_chronolog.c: burst fixes * ntpd/refclock_bancomm.c: burst fixes * ntpd/refclock_atom.c: burst fixes * ntpd/refclock_as2201.c: burst fixes * ntpd/ntp_refclock.c: PPSAPI, code, and comment cleanup/fixes * ntpd/ntp_proto.c: Broadcast/restrict cleanup * ntpd/ntp_loopfilter.c: Cleanup and fixes * libntp/gpstolfp.c: Lose the UL qualifiers - old compilers hate them From: Dave Mills 1999-10-31 Harlan Stenn * configure.in: TIOCSPPS cleanup 1999-10-20 Harlan Stenn * configure.in: 4.0.98b * ntpd/refclock_atom.c: AIOCTIMESTAMP patch * ntpd/ntpd.c: SCO clock patch * ntpd/ntp_request.c: noselect patch * ntpd/ntp_refclock.c: AIOCTIMESTAMP patch * ntpd/ntp_proto.c: noselect patch * ntpd/ntp_intres.c: noselect patch * ntpd/ntp_config.c: noselect patch * include/ntp_request.h: noselect patch * include/ntp.h: noselect patch From: Kamal A Mostafa * configure.in: * acconfig.h: TTYCLK_AIOCTIMESTAMP Stuff for Kamal * ntpd/refclock_atom.c (atom_pps): make "result" initialization uglier, but more bulletproof. * configure.in (sys/timepps.h): Fixed. From: John Hay 1999-10-19 Harlan Stenn * ntpd/refclock_oncore.c: Rename instance.state to instance.o_state * refclock_oncore.c: * refclock_mx4200.c: * refclock_chu.c: * refclock_atom.c: * ntp_refclock.c: * ntp_peer.c: * ntp_loopfilter.c: * include/ntp_refclock.h: Various cleanup and fixes From: Dave Mills 1999-10-17 Harlan Stenn * ntpd/ntp_config.c (CONFIG_FILE): NT changes From: Sven Dietrich 1999-10-16 Harlan Stenn * configure.in: sys/timepps.h verification changes * ntpd/refclock_atom.c (atom_poll): PPS cleanup From: Dave Mills (atom_pps): Portability patch From: John Hay * libntp/msyslog.c: * libntp/gpstolfp.c: Lint cleanup From: Jonathan Stone * parseutil/dcfd.c: abs() -> l_abs(), time.h (AIX 4.3.2 patches) From: Dana Kaempen * ntpd/refclock_oncore.c: * ntpd/refclock_atom.c: * ntpd/ntp_refclock.c: PPS cleanup From: John.Hay@mikom.csir.co.za * util/ntptime.c: * ntpdate/ntptimeset.c: * ntpdate/ntpdate.c: * ntpd/refclock_trak.c: * ntpd/refclock_oncore.c: * ntpd/refclock_mx4200.c: * ntpd/refclock_msfees.c: * ntpd/refclock_atom.c: * ntpd/ntp_control.c: * ntpd/ntp_config.c: * configure.in: * configure: PPS, Solaris 7, cleanup patches From: Marc.Brett@westgeo.com * ports/winnt/ntptrace/ntptrace.dsp: * ports/winnt/ntpq/ntpq.dsp: * ports/winnt/ntpdc/ntpdc.dsp: * ports/winnt/ntpdate/ntpdate.dsp: * ports/winnt/ntpd/refclock_trimbledc.c: * ports/winnt/ntpd/ntpd.dsp: * ports/winnt/ntpd/ntp_iocompletionport.c: * ports/winnt/ntpd/nt_clockstuff.c: * ports/winnt/libntp/util_clockstuff.c: * ports/winnt/libntp/libntp.dsp: * ports/winnt/libntp/SetSystemTime.c: * ports/winnt/instsrv/instsrv.c: * ports/winnt/include/sys/ioctl.h: * ports/winnt/include/termios.h: * ports/winnt/include/config.h: * ports/winnt/include/clockstuff.h: * ports/winnt/ntp.dsw: * ntpd/refclock_shm.c: * ntpd/refclock_palisade.c: * ntpd/ntpd.c: * ntpd/ntp_timer.c: * ntpd/ntp_refclock.c: * libntp/systime.c: * libntp/machines.c: NT patches From: Sven Dietrich 1999-10-15 Harlan Stenn * ntpd/refclock_wwvb.c: * ntpd/refclock_usno.c: * ntpd/refclock_ulink.c: * ntpd/refclock_tpro.c: * ntpd/refclock_pst.c: * ntpd/refclock_parse.c: * ntpd/refclock_palisade.c: * ntpd/refclock_oncore.c: * ntpd/refclock_mx4200.c: * ntpd/refclock_msfees.c: * ntpd/refclock_jupiter.c: * ntpd/refclock_irig.c: * ntpd/refclock_heath.c: * ntpd/refclock_chu.c: * ntpd/refclock_atom.c: * ntpd/refclock_as2201.c: * ntpd/refclock_arc.c: * ntpd/refclock_arbiter.c: * ntpd/refclock_acts.c: * ntpd/ntp_refclock.c: * include/ntp_refclock.h: Bunches of fixes. From: Dave Mills 1999-10-10 Harlan Stenn * html/driver16.htm: New version * ntpd/refclock_bancomm.c: New version From: "Cliff, Gary" "Ramasivan, Ganesh" * ntpd/refclock_ulink.c (ulink_receive): Cleanup (ulink_poll): Cleanup * ntpd/refclock_atom.c (atom_pps): SunOS timespec/timeval cleanup From: Marc.Brett@westgeo.com * INSTALL: Point NT folks at ports/winnt Reported by: Stephen Gildea * include/ntp_stdlib.h: Noise abatement * include/ntpd.h: Noise abatement Reported by: "W. David Higgins" * configure.in: DECL_STDIO_0 with gcc under solaris. * include/l_stdlib.h: DECL_TOUPPER_0 DECL_STRERROR_0 * configure.in: Fix a bunch of implicit declarations for SunOS * html/release.htm: cleanup - we still provide MD5. Reported by: Winslowe Lacesso 1999-10-09 Harlan Stenn * ntpd/refclock_oncore.c: * ntpd/refclock_atom.c: * ntpd/ntp_refclock.c: PPS API code updated to the current spec From: Dave Mills * configure.in (ac_cv_make_tickadj): Don't make tickadj starting with solaris2.5 Requested by: Dave Mills 1999-10-04 Harlan Stenn * configure.in: We might need -lsocket for the -lnsl check. 1999-09-19 Harlan Stenn * ntpd/refclock_ulink.c: Typos in C++ comment Reported by: Thomas.Tornblom@Sun.SE * configure.in: 4.0.98a * ntpd/ntp_config.c (getconfig): Fix typo. From: "David E. Myers" From: David Godfrey From: Geoffrey Sisson 1999-09-17 Harlan Stenn * configure.in: 4.0.98 NetInfo support: * config.guess * config.sub Add Mac OS (versions 10 and up). * acconfig.h * config.h.in * configure.in Check for NetInfo API; add HAVE_NETINFO macro and friends. * include/ntp.h * ntpd/ntp_config.c * ntpdate/ntpdate.c Add support for reading configuration from NetInfo. * ntpd/ntp_config.c Get rid of unnecessary eol variable in tokenizer. * html/notes.htm * html/ntpd.htm * html/ntpdate.htm Document NetInfo functionality. * util/tickadj.c Use HAVE_KVM_OPEN conditional around kvm.h include. From: Wilfredo Sanchez 1999-09-15 Harlan Stenn * acconfig.h: * config.h.in: * configure.in: * html/driver34.htm: * html/refclock.htm: * include/ntp.h: * libntp/clocktypes.c: * ntpd/Makefile.am: * ntpd/ntp_control.c: * ntpd/refclock_conf.c: * ntpd/refclock_ulink.c: Ultralink driver From: Dave Strout 1999-09-14 Harlan Stenn * configure.in: ReliantUNIX patches From: Andrej Borsenkow * ntpd/refclock_atom.c: PPS cleanup * ntpd/ntp_refclock.c (refclock_ioctl): PPS cleanup From: Dave Mills * ntptrace/ntptrace.c (ReceiveBuf): addserver() can return NIL. Reported by: "Alan J. Wylie" * libntp/ieee754io.c: * ntpd/ntp_proto.c: * ntpd/ntp_refclock.c: Lint cleanup. From: Marc.Brett@westgeo.com 1999-09-12 Harlan Stenn * ntpd/ntp_refclock.c (refclock_ioctl): Declaration cleanup. * ntpd/ntp_proto.c (init_proto): msyslog kern_enable at LOG_DEBUG. * ntpd/refclock_atom.c: Add missing declaration. 1999-09-11 Harlan Stenn * configure.in (ac_cv_make_ntptime): Just look for struct ntptimeval, not timespec or nsec (Solaris 2.7 should get ntptime and it uses msec). (ac_cv_var_oncore_ok): Reorder so it's a "normal" clock * configure.in: Solaris Kernel FLL bug fixed in 106541-07 1999-09-02 Harlan Stenn * configure.in: 4.0.97f * ntptrace/ntptrace.c: * ntpdate/ntptimeset.c: * ntpdate/ntptime_config.c: * ntpdate/ntpdate.c: * util/ntptime.c: * parseutil/dcfd.c: * libparse/parsestreams.c: * libparse/parse_conf.c: * libparse/parse.c: * libparse/clk_varitext.c: * libparse/clk_trimtsip.c: * libparse/clk_trimtaip.c: * libparse/clk_schmid.c: * libparse/clk_rcc8000.c: * libparse/clk_rawdcf.c: * libparse/clk_meinberg.c: * libparse/clk_hopf6021.c: * libparse/clk_dcf7000.c: * libparse/clk_computime.c: * libntp/msyslog.c: * libntp/iosignal.c: * libntp/syssignal.c: * adjtimed/adjtimed.c: * ntpd/refclock_shm.c: * ntpd/refclock_parse.c: * ntpd/refclock_palisade.c: * ntpd/refclock_mx4200.c: * ntpd/refclock_jupiter.c: * ntpd/refclock_datum.c: * ntpd/ntpd.c: * ntpd/ntp_util.c: * ntpd/ntp_timer.c: * ntpd/ntp_request.c: * ntpd/ntp_refclock.c: * ntpd/ntp_monitor.c: * ntpd/ntp_loopfilter.c: * ntpd/ntp_io.c: * ntpd/ntp_intres.c: * ntpd/ntp_filegen.c: * include/l_stdlib.h: and errno declaration cleanup. * ntpd/map_vme.c: cleanup some spacing. 1999-09-01 Harlan Stenn * configure.in: 4.0.97e * configure.in (ac_cv_struct_sigaction_has_sa_sigaction): * acconfig.h: Ditto * parseutil/dcfd.c (main): Use it. From: HOSAKA Eiichi 1999-08-29 Harlan Stenn * configure.in: 4.0.97d * include/ntp_stdlib.h: Clean up previous NeXT patch. From: Jack Bryans * ntpd/refclock_parse.c: Permit RTS to power a DCF77. From: Carsten Paeth * ntpd/refclock_oncore.c (oncore_start): This makes the Oncore run on systems without hardpps(). From: Poul-Henning Kamp 1999-08-28 Harlan Stenn * configure.in: 4.0.97c * configure.in (ac_cv_make_ntptime): Typo. From: Ulrich Windl 1999-08-26 Harlan Stenn * configure.in: 4.0.97b * libntp/iosignal.c: * ntpd/ntp_peer.c: * ntpd/refclock_nmea.c: * ntpdate/ntptime_config.c: * ntpdate/ntptimeset.c: AIX, Irix, and SunOS lint cleanup From: Marc.Brett@westgeo.com 1999-08-24 Harlan Stenn * configure.in 4.0.97a * configure.in (AC_OUTPUT): added scripts/Makefile * Makefile.am (SUBDIRS): Added scripts * scripts/Makefile.am: Added 1999-08-23 Harlan Stenn * ntpd/refclock_nmea.c: Patches for: Trimble OEM Ace-II receiver. Low cost PCB with single voltage input, external active antenna and two serial ports with either NMEA and ITAPs output. Programmable to be tuned for 'time' accuracy in fixed station config. From: Nick Hibma 1999-08-21 Harlan Stenn * ntpd/ntp_config.c: Added listen_to_virtual_ips support (-L flag) * ntpd/ntp_io.c: Ditto 1999-08-19 Harlan Stenn * ntpd/ntp_intres.c (request): Lint cleanup * ntpd/ntp_control.c (ctl_putclock): Ditto * libntp/recvbuff.c (getrecvbufs): Ditto (get_free_recv_buffer): Ditto * libntp/systime.c (adj_systime): Ditto 1999-08-18 Harlan Stenn * configure.in: 4.0.97 * libntp/systime.c: * ntpd/ntp_loopfilter.c: * ntpd/ntpd.c: * ports/winnt/libntp/nt_clockstuff.c: From: Sven Dietrich * README.cvs: Updated. * configure.in: * include/ntp_machine.h: * libntp/mexit.c: * ntpd/ntp_config.c: * ntpd/ntp_peer.c: * ntpd/ntp_restrict.c: * ntpd/refclock_arc.c: * ntpdate/ntpdate.c: Irix, SunOS, AIX, lint patches From: Marc.Brett@westgeo.com * util/ansi2knr.c: New release (fix for bug reported by Marc Brett) From: "L. Peter Deutsch" * include/ntp_stdlib.h: NeXT portability patch From: Jack Bryans * configure.in: * dot.emacs: (cleanup) * ntpdate/Makefile.am: * ntpdate/ntpdate.h: * ntpdate/ntptime_config.c: * ntpdate/ntptimeset.c: ntptimeset patches. From: Jeffrey Hutzelman * ntpd/refclock_parse.c (local_input): ts.l_ui -> ts.fp.l_ui 1999-08-11 Harlan Stenn * configure.in: 4.0.96p1 * ntpd/ntpd.c (sys/resource.h): Include this file only #if HAVE_SYS_RESOURCE_H. (set_process_priority): Use TIOCNOTTY only if it is #define'd. * ntpd/refclock_parse.c (STREAM): STREAM does not imply HAVE_TERMIOS. (termios.h, termio.h, fcntl.h): Do not include those files here; they are already included by ntp_refclock.h or ntp_io.h. * ntpd/refclock_leitch.c (sgtty.h, termios.h, termio.h): Do not include those files here; they are already included by ntp_refclock.h. * ntpdate/ntpdate.c (sys/resource.h) : Include that file only #if HAVE_RESOURCE_H. From: Philippe De Muyter * ntptrace/ntptrace.c (input_handler): Make it a "normal" function definition. Reported by: GIANNI_CATANIA@hp-italy-om6.om.hp.com * configure.in: pc-cygwin32 -> pc-cygwin* because of a change in B20. From: Stephen Gildea 1999-08-09 Harlan Stenn * configure.in: 4.0.96 * parseutil/dcfd.c (main): Replace SA_ONSTACK and SV_ONSTACK with HAVE_SIGACTION and HAVE_SIGVEC, respectively. HP-UX provides both of the former but only one of the latter... 1999-08-08 Harlan Stenn * configure.in: Better tests for -lnsl and -lsocket From: Albert Chin-A-Young Works for me - handle openlog() and -lgen the same way. * Makefile.am (EXTRA_DIST): Add in the y2k notes * parseutil/dcfd.c: Renamed drift_comp to accum_drift * configure.in: Added MAKE_CHECK_Y2K support; check_y2k needs libparse. * ntpd/Makefile.am (check_PROGRAMS): Use MAKE_CHECK_Y2K * ntpd/Makefile.am (check-local): Added. * parseutil/Makefile.am (check-local): Added. * include/ntp.h: Y2KFixes * libparse/parse.c: Ditto * ntpd/Makefile.am (check_PROGRAMS): Ditto * ntpd/refclock_acts.c: Ditto * ntpd/refclock_arc.c (arc_receive): Ditto * ntpd/refclock_heath.c: Ditto * ntpd/refclock_hpgps.c: Ditto * parseutil/Makefile.am (check-local): Ditto * parseutil/dcfd.c (check_y2k): Ditto * NOTES.y2kfixes: Ditto * readme.y2kfixes: Ditto * results.y2kfixes: Ditto * ntpd/check_y2k.c: Ditto From: y2k@y2k.labs.att.com 1999-08-07 Harlan Stenn * configure.in: Look for sys/ppstime.h. 1999-07-31 Harlan Stenn * ntpd/ntp_io.c (create_sockets): Typo. From: Doug Wells 1999-07-29 Harlan Stenn * configure.in (ac_cv_struct_ntptimeval): Explicitly look for struct ntptimeval. (ac_cv_var_kernel_pll): Require struct ntptimeval. Linux. Grrr. Reported by: Ronald Kuetemeier 1999-07-27 Harlan Stenn * configure.in: 4.0.95 * ports/winnt: New release From: Sven Dietrich 1999-07-26 Harlan Stenn * libntp/machines.c (ntp_set_tod): Bugfix From: Andrej Borsenkow 1999-07-25 Harlan Stenn * configure.in: 4.0.94b * acconfig.h: * configure.in: * libparse/Makefile.am: * libparse/parse_conf.c: * libparse/clk_varitext.c: * libparse/kclk_varitext.c: * ntpd/refclock_parse.c: VARITEXT parse clock * ntpdate/ntpdate.c: bugfix From: Tony McConnell 1999-07-24 Harlan Stenn * include/ntp_syscall.h (ntp_gettime): Make it static * configure.in: Added AC_C_INLINE Reported by: "Charles C. Fu" 1999-07-23 Harlan Stenn * include/ntpd.h: * libntp/machines.c: * libntp/systime.c: * ntpd/ntp_config.c: * ntpd/ntp_filegen.c: * ntpd/ntp_io.c: * ntpd/ntp_proto.c: * ntpd/ntp_timer.c: * ntpdate/ntpdate.c: Windows NT port cleanup From: Sven Dietrich 1999-07-22 Harlan Stenn * libntp/authkeys.c: * libntp/ieee754io.c: * libntp/iosignal.c: * libntp/machines.c: * libntp/mexit.c: * libntp/recvbuff.c: * ntpd/ntp_filegen.c: * ntpd/ntp_loopfilter.c: * ntpd/ntp_request.c: * ntpd/ntp_timer.c: * ntpd/ntpd.c: Compile/lint cleanup From: Allen Smith 1999-07-21 Harlan Stenn * configure.in: 4.0.94a * configure.in (ac_cv_make_ntptime): Add tv_nsec check. * include/Makefile.am (noinst_HEADERS): Forgot ntp_syscall.h From: John.Hay@mikom.csir.co.za * configure.in: 4.0.94 * Makefile.am (SUBDIRS): librsaref (dist-hook): Lose CVS subdirs in the distribution tarball * include/Makefile.am (noinst_HEADERS): Added iosignal.h, recvbuff.h * Makefile.am (dist-hook): Don't call dos2unix anymore 1999-07-20 Harlan Stenn * acconfig.h: * util/ntptime.c: FreeBSD nano patches From: Per Hedeland and Allen Smith * include/ntp.h: include/ntp_fp.h: include/ntp_io.h: include/ntp_machine.h: include/ntp_refclock.h: include/ntp_stdlib.h: include/ntpd.h: libntp/Makefile.am: libntp/emalloc.c: libntp/machines.c: libntp/mexit.c: libntp/msyslog.c: libntp/statestr.c: libntp/syssignal.c: libntp/systime.c: libparse/parse.c: libparse/parse_conf.c: ntpd/ntp_control.c: ntpd/ntp_intres.c: ntpd/ntp_io.c: ntpd/ntp_proto.c: ntpd/ntp_refclock.c: ntpd/ntp_request.c: ntpd/ntp_timer.c: ntpd/ntp_util.c: ntpd/ntpd.c: ntpd/refclock_nmea.c: ntpd/refclock_palisade.c: ntpd/refclock_palisade.h: ntpd/refclock_shm.c: ntpdate/ntpdate.c: ntptrace/ntptrace.c: Cleanup * libntp/recvbuff.c: libntp/iosignal.c: include/iosignal.h: include/recvbuff.h: Added From: Sven_Dietrich@Trimble.COM * README: Add README.cvs * configure.in (ac_cv_var_struct_ntptime_val_timespec): Typo. From: John Hay 1999-07-19 Harlan Stenn * Makefile.am (EXTRA_DIST): Lose ntpmak; "build" does a better job. * ntpq/Makefile.am (version.o): Use mkver * ntptrace/Makefile.am (version.o): Ditto * ntpdate/Makefile.am (version.o): Ditto * ntpd/Makefile.am (version.o): Ditto * ntpdc/Makefile.am (version.o): Ditto * configure.in (AC_OUTPUT): scripts/mkver * scripts/mkver.in: Created. Note RSAREF in the version string 1999-07-18 Harlan Stenn * README.des: Updated. * ntpq/Makefile.am (LDADD): Add LIBRSAREF * ntpdc/Makefile.am (LDADD): Add LIBRSAREF * ntpdate/Makefile.am (LDADD): Add LIBRSAREF * ntpd/Makefile.am (LDADD): Add LIBRSAREF * configure.in (AC_OUTPUT): Added librsaref/Makefile Added tests for making/using librsaref.a Lose old DES stuff; AC_DEFINE(DES) if we find the rsaref stuff. 1999-07-11 Harlan Stenn * ntpd/refclock_trak.c (trak_receive): disambiguate expression. At least now it is unambiguous. It may even still be correct. Reported by: Tom Smith * ntp_update (UPDATE_OPTIONS): Typo. 1999-07-07 Harlan Stenn * ntp_update: Check out copyright.htm before COPYRIGHT * ntpd/ntp_config.c: Support for PPS assert/clear/hardpps * ntpd/ntp_refclock.c (refclock_ioctl): Ditto (refclock_gtlin): Ditto * html/clockopt.htm: Document. From: John Hay * html/monopt.htm: We have four types of files now * ntpd/refclock_oncore.c: If debug is on, tell when we are waiting for a valid almanac From: Poul-Henning Kamp * include/ntp_machine.h (HAVE_TERMIOS): STREAMS does not imply HAVE_TERMIOS !!! * include/parse.h (timercmp): Macro defined if needed. * ntpd/ntp_config.c (SIGCHLD): Macro defined as SIGCLD if needed. (sys/wait.h): File included only if HAVE_SYS_WAIT_H. * configure.in (sys/wait.h): File added to AC_CHECK_HEADERS list. From: Philippe De Muyter 1999-06-23 Harlan Stenn * ntpd/refclock_irig.c (irig_debug): NetBSD patches From: Frederick Bruckman * util/ntptime.c (main): ntx.freq bugfix (-f option) From: Frederick Bruckman 1999-06-22 Harlan Stenn * configure.in: Fix typo with DECL_H_ERRNO test * ntpd/ntp_loopfilter.c: Lose syscall decl, it's handled in l_stdlib.h now. * ntpd/ntp_request.c: Ditto * util/ntptime.c: Ditto Mon May 31 18:49:49 1999 Rainer Orth * ntpd/ntp_proto.c (proto_config): Don't set sys_bclient on PROTO_MULTICAST_ADD, only caller can decide; remove wrong set on PROTO_MULTICAST_DEL. Mon May 31 18:49:49 1999 Rainer Orth * ntpd/refclock_parse.c (stream_receive): Cast size_t to int to match format. (local_receive): Likewise. (trimbletaip_event): Likewise. (stream_receive): Cast struct timeval members to long to match format. (local_receive): Likewise. * ntpd/ntp_util.c (stats_config): Cast size_t to int to match format. * libparse/clk_rawdcf.c (cvt_rawdcf): Cast ptr difference to int to match format. * ntpd/refclock_parse.c (gps16x_poll): Likewise. * ntpd/ntp_filegen.c (filegen_open): Use long format, cast arg to match. * ntpd/refclock_parse.c (list_err): Use long format to match arg. (parse_statistics): Likewise. (gps16x_message): Likewise. (cvt_ts): Use long format, cast args to match. (parse_start): Add missing arg. (gps16x_message): Swap args to match format. * ntpd/ntpd.c (ntpdmain): Cast uid to long, adapt format. * ntpd/ntp_intres.c (readconf): Use long format to match arg. * ntpd/ntp_io.c (getrecvbufs): Likewise. * ntpd/ntp_proto.c (default_get_precision): Likewise. * ntpd/ntp_loopfilter.c (local_clock): Cast clock_panic to int to match format. * ntpd/ntp_io.c (io_multicast_add): Print s_addr member, not struct in_addr, to match format. * include/ntp_stdlib.h: Declare msyslog() as printf-like for gcc format checking. Fri May 28 16:39:35 1999 Rainer Orth * ntpdc/ntpdc_ops.c (iostats): Align timereset line. * ntpq/ntpq_ops.c (doopeers): Properly align header. * ntpdc/ntpdc_ops.c (debug): Removed declaration, already in ntp_stdlib.h. * ntpq/ntpq_ops.c: Likewise. * ntpdate/ntpdate.c (debug): Declare volatile to match ntp_stdlib.h. * ntpdc/ntpdc.c, ntpq/ntpq.c, ntptrace/ntptrace.c, util/tickadj.c, util/ntptime.c: Likewise. * include/parse.h (debug): Don't declare to avoid clash with ntp_stdlib.h. * include/Makefile.am (noinst_HEADERS): Add new ntp_syscall.h. * configure.in: Also check for -lrt for POSIX.1c functions. Wed May 26 21:03:30 1999 Rainer Orth * configure.in: Removed -Wwrite-strings from CFLAGS. * ntpdc/ntpdc.c (help): Remove superfluous cast. * ntpq/ntpq.c (help): Likewise. Tue May 25 18:00:49 1999 Rainer Orth * ntpq/ntpq_ops.c (struct varlist): name cannot be const char * since it may be malloc'ed. * ntpdc/ntpdc.c (sendrequest): Declare pass as const char *, don't lose const in cast. * ntpq/ntpq.c (sendrequest): Likewise. * ntpd/ntp_control.c (ctl_getitem): Remove superfluous cast. * include/ntpd.h (struct ctl_var): text cannot be const char * since it's malloc'ed. 1999-06-22 Harlan Stenn * include/l_stdlib.h: Don't include , add forward declaration of struct in_addr instead. From: Rainer Orth Patch: * include/l_stdlib.h: Fixed syscall() declaration. * configure.in: Updated test to match. * configure.in: Check if we need to declare errno and h_errno. Check for which may provide a h_errno declaration and which the latter needs. * acconfig.h: Provide the necessary templates. * include/ntp_syscall.h: New file, hides various implementations of ntp_adjtime() and ntp_gettime() syscalls. * ntpd/ntp_loopfilter.c: Use it. * ntpd/ntp_request.c: Likewise. * ntpd/refclock_local.c: Likewise. * util/ntptime.c: Likewise. * include/l_stdlib.h: Include , declare inet_ntoa if necessary. Moved syscall() declaration here. * kernel/sys/parsestreams.h: Include for it's definition of struct ppsclockev. Include unconditionally for definition of CIOGETEV via TIOCGPPSEV. * kernel/sys/ppsclock.h: Protect struct ppsclockev from redefinition. * include/ntp_refclock.h: Protect it from multiple inclusion. * include/ntp_fp.h: Likewise. * include/ntp.h: Likewise. * include/ntpd.h: Include ntp_refclock.h for MAXDIAL declaration. * libntp/authkeys.c: Include ntpd.h for current_time declaration. * include/ntpd.h (getauthkeys, auth_agekeys, rereadkeys): Moved prototypes to ntp_stdlib.h * include/ntp_stdlib.h: Declare variables exported by libntp. * include/ntpd.h: Likewise for ntpd. * libntp/authkeys.c (key_hash, authnokey, authfreekeys, cache_flags): Made static. * libntp/systime.c (tvu_maxslew, tsf_maxslew, sys_clock_offset, sys_residual): Likewise. * ntpd/ntp_intres.c (confentries): Likewise. * ntpd/ntp_loopfilter.c (clock_offset, clock_panic): Likewise. (pll_nano): Likewise. Removed duplicate definition. * ntpd/ntp_peer.c (peer_free, current_association_ID, assocpeer_calls, init_peer_starttime): Likewise. * ntpd/ntp_proto.c (sys_offset, sys_authdly): Likewise. * ntpd/ntp_request.c (numrequests, numresppkts, errorcounter): Likewise. * ntpd/ntp_restrict.c (res_calls, res_found, res_not_found, res_timereset, res_limited_refcnt): Likewise. * ntpd/ntpd.c (was_alarmed, worker_thread): Likewise. * ntpq/ntpq_ops.c: Moved declaration of external variable from ntpq.c to file scope. * adjtimed/adjtimed.c: Moved declarations of external variables to ntpd.h and ntp_stdlib.h. * clockstuff/propdelay.c: Likewise. * libntp/a_md5encrypt.c, libntp/authencrypt.c, libntp/authkeys.c, libntp/mfp_mul.c, libntp/msyslog.c, libntp/systime.c: Likewise. * ntpd/ntp_config.c, ntpd/ntp_control.c, ntpd/ntp_filegen.c, ntpd/ntp_intres.c, ntpd/ntp_io.c, ntpd/ntp_loopfilter.c, ntpd/ntp_monitor.c, ntpd/ntp_peer.c, ntpd/ntp_proto.c, ntpd/ntp_refclock.c, ntpd/ntp_request.c, ntpd/ntp_restrict.c, ntpd/ntp_timer.c, ntpd/ntp_util.c, ntpd/ntpd.c, ntpd/refclock_acts.c, ntpd/refclock_arbiter.c, ntpd/refclock_arc.c, ntpd/refclock_as2201.c, ntpd/refclock_atom.c, ntpd/refclock_bancomm.c, ntpd/refclock_chronolog.c, ntpd/refclock_chu.c, ntpd/refclock_datum.c, ntpd/refclock_dumbclock.c, ntpd/refclock_gpsvme.c, ntpd/refclock_heath.c, ntpd/refclock_hpgps.c, ntpd/refclock_irig.c, ntpd/refclock_jupiter.c, ntpd/refclock_leitch.c, ntpd/refclock_local.c, ntpd/refclock_msfees.c, ntpd/refclock_mx4200.c, ntpd/refclock_nmea.c, ntpd/refclock_oncore.c, ntpd/refclock_palisade.h, ntpd/refclock_parse.c, ntpd/refclock_pst.c, ntpd/refclock_shm.c, ntpd/refclock_tpro.c, ntpd/refclock_trak.c, ntpd/refclock_true.c, ntpd/refclock_usno.c, ntpd/refclock_wwvb.c: Likewise. * ntpdate/ntpdate.c: Likewise. * ntpdc/ntpdc.c, ntpdc/ntpdc_ops.c: Likewise. * ntpq/ntpq.c: Likewise. * ntptrace/ntptrace.c: Likewise. * util/ntptime.c, til/tickadj.c: Likewise. From: Rainer Orth * include/ntp_machine.h: Removed superfluous yy/mm/dd comments. * include/ntpd.h: Likewise. * libntp/authencrypt.c: Likewise. * libntp/a_md5encrypt.c: Likewise. * libntp/caljulian.c: Likewise. * libntp/ymd2yd.c: Likewise. * libntp/syssignal.c: Likewise. * libntp/ymd2yd.c: Likewise. * ntpd/ntp_control.c: Likewise. * ntpd/ntp_io.c: Likewise. * ntpd/ntp_timer.c: Likewise. * ntpdate/ntpdate.c: Likewise. * ntpq/ntpq_ops.c: Likewise. * ntpd/ntp_peer.c (findpeer): Wrap debug output in DEBUG/debug. From: Rainer Orth * dot.emacs: Removed wrong indentation of substatements. Wrap in c-style. From: Rainer Orth * ntpd/refclock_palisade.c: Patches from Marc Brett * ntpd/refclock_palisade.h: Ditto. * util/hist.c: Ditto. Tue Jun 1 00:40:04 1999 Harlan Stenn * build: mips-dec-ultrix4.4 hates "set -e" * flock-build: Created * build: added -l option Mon May 31 20:28:40 1999 Harlan Stenn * README: Removed auto{make,conf}.patch files Tue May 25 01:20:53 1999 Harlan Stenn * Makefile.am ($(srcdir)/COPYRIGHT): Added (EXTRA_DIST): Remove auto*.patches Thu May 20 01:03:00 1999 Harlan Stenn * Makefile.am (dist-hook): Call dos2unix on the .htm files * ntpd/refclock_palisade.h: Clean up declarations. * configure.in (ac_cv_struct_ntptimeval_timespec): Added. (ac_cv_make_ntptime): Only if ntptimeval does not use timespec. * util/tickadj.c: Linux Patches From: Reg Clemens Wed May 19 01:18:24 1999 Harlan Stenn * configure.in: 4.0.93a * ntpd/refclock_palisade.h: Restore some lost patches From: Kamal A Mostafa Sun May 16 13:18:32 1999 Philippe De Muyter * libparse/clk_wharton.c (cvt_wharton_400a, inp_wharton_400a): Expect serial output format number 1, not 5. (clock_wharton_400a) : Likewise. * ntpd/refclock_parse.c (parse_clockinfo): For Wharton 400a clock, do not poll, but expect a message every second. * html/parsedata.htm : Entry added for Wharton 400a clock. * html/driver8.htm : Entry fixed for Wharton 400a clock. Sun May 16 02:59:46 1999 Harlan Stenn * configure.in: 4.0.93 Sat May 15 18:53:47 1999 Harlan Stenn * configure.in (ntp_refclock): ONCORE requires PPSAPI, CIOGETEV, or TIOCGPPSEV. Reported by: Reg Clemens Fri May 14 23:58:35 1999 Harlan Stenn * configure.in: 4.0.92h2 * configure.in (ac_cv_make_ntptime): Not under Linux. Yes, it works for some people. We're tired of the complaints from the others. Fri May 14 18:58:59 1999 Rainer Orth * libntp/authreadkeys.c (authreadkeys): Reject autokey keys. Include ntp.h for NTP_MAXKEY definition, ntp_fp.h for types used in ntp.h. Wed May 12 23:02:22 1999 Rainer Orth * libntp/authkeys.c (auth_delkeys): Don't remove autokey keys, leave info on KEY_TRUSTED flag alone. Include ntp.h for NTP_MAXKEY definition. Thu May 13 02:19:02 1999 Harlan Stenn * configure.in: 4.0.92h1 * configure.in: patch for ReliantUNIX From: Andrej Borsenkow * ntpd/refclock_oncore.c: Patches From: Reg Clemens Thu Apr 29 14:01:04 1999 Rainer Orth * html/*.htm: Remove unnecessary  . Cleanup

	sections.

	* configure.in: Properly align configure --help output.
	* html/config.htm: Include this version, removing Netscape  
	cruft.

Wed Apr 28 15:08:55 1999  Rainer Orth  

	* kernel/sys/parsestreams.h: Only include  if
	struct ppsclockev is missing from system headers.

	* util/tickadj.c (getoffsets): Define kernels[] only if used.
	(openfile): Rename fd to avoid shadowing global fd.
	(writevar): Likewise.
	(readvar): Likewise.

	* parseutil/dcfd.c (read_drift): drift_file is const char *.
	(update_drift): Likewise.
	(adjust_clock): Likewise.
	(main): Likewise.

	* ntpd/refclock_parse.c (gps16x_poll): Adapt format to match
	parse->localstate type.

	* ntpd/ntp_refclock.c (refclock_gtlin): Only define gotit label
	if used.

	* include/l_stdlib.h (openlog, syslog): char * args are const.

	* configure.in (*-*-osf4*): Enable declaration of stime().

	* ntpd/refclock_oncore.c (oncore_msg_any): Cast args to long to
	match prototype.
	(oncore_msg_En): Likewise.

	* include/ntp_refclock.h (struct refclockstat): Declare p_lastcode
	as const char *.

	* ntpq/ntpq_ops.c (struct varlist): Define name as const.

	* ntpdc/ntpdc.c (tokenize): Define cp as const char *, remove
	wrong cast instead.

	* ntpd/ntp_util.c (record_clock_stats): Make text arg const.
	* include/ntpd.h (record_clock_stats): Adapt declaration.
	* ntpd/refclock_oncore.c (oncore_start): Removed superfluous casts.
	(oncore_msg_Cf): Likewise.
	(oncore_msg_Fa): Likewise.
	(oncore_msg_Cj): Likewise.
	(oncore_msg_Ea): Likewise.
	(oncore_msg_Bj): Likewise.

	* configure.in (*-*-solaris2.4): Enable declarations of
	gettimeofday(), settimeofday(); they are `protected' by
	__cplusplus in .

Tue Apr 27 21:14:47 1999  Rainer Orth  

	* scripts/summary.pl: Use . as default statsdir.
	(do_loop): Accept new loopstats format with additional sys_error
	and clock_stability fields.
	(do_peer): Accept new peerstats format with additional skew field.

Mon Apr 26 01:50:38 1999  Harlan Stenn  

	* Upgraded automake (1.4a) and autoconf (2.14.1)

	* configure.in (ac_refclock_irig): We no longer need stropts.h.
	* ntpd/refclock_irig.c: Ditto

Mon Apr 26 17:33:33 1999  Rainer Orth  

	* configure.in (*-*-irix6*): Don't pass MIPSpro cc-only flag -n32
	to gcc.

Thu Apr 22 15:06:40 1999  Rainer Orth  

	* ntpd/ntp_config.c (getconfig): IN_CLASSD() expects address in
	host byte order, but struct sockaddr_in.s_addr is in network byte
	order.
	* ntpd/ntp_io.c (io_multicast_del): Likewise.

Sat Apr 24 01:00:53 1999  Harlan Stenn  

	* configure.in: 4.0.92h

	* ntptrace/ntptrace.c: -m maxhost patch
	From: "R. Gary Cutbill" 

	* util/ntptime.c: Patches.
	From: Ulrich Windl 

	* html/accopt.htm, html/assoc.htm, html/authopt.htm,
	html/biblio.htm, html/build.htm, html/clockopt.htm,
	html/confopt.htm, html/copyright.htm, html/debug.htm,
	html/exec.htm, html/extern.htm, html/hints.htm, html/index.htm,
	html/kern.htm, html/miscopt.htm, html/monopt.htm, html/notes.htm,
	html/ntpd.htm, html/ntpdate.htm, html/ntpdc.htm, html/ntpq.htm,
	html/ntptime.htm, html/ntptrace.htm, html/patches.htm,
	html/porting.htm, html/pps.htm, html/rdebug.htm,
	html/refclock.htm, html/release.htm, html/tickadj.htm,
	html/hints/solaris.html: Fixed many typos and problems.
	* acconfig.h (DECL_CFSETISPEED_0, DECL_MRAND48_0, DECL_NLIST_0,
	DECL_SRAND48_0, DECL_STIME_0): New templates.
	* include/l_stdlib.h: Include termios.h to get definition of
	speed_t.
	(cfsetispeed, cfsetospeed, mrand48, nlist, srand48, stime): New
	declarations.
	(openlog): Declare 2- or 3-argument form.
	* configure.in: Enable declarations of functions missing from
	Ultrix V4.3 system headers.
	* ntpd/refclock_oncore.c: Include , Ultrix V4.3
	 needs it for dev_t.
	From: Rainer Orth 

	* ntpdc/ntpdc_ops.c: Reality checks.

	* configure.in: netbsd has stubs for the timer_* stuff and doesn't
	support PPSAPI.  IRIG requires  .
	From: Frederick Bruckman 

	* ntpdc/ntpdc_ops.c: (kerninfo)  Report in seconds regardless of
	kernel precision.  Report kernel flags as text.
	From: Poul-Henning Kamp 

Sun Apr 18 14:26:51 1999  Harlan Stenn  

	* configure.in: 4.0.92g

	* ntpd/ntp_refclock.c (refclock_ioctl): We don't want
	PPS_HARDPPSONASSERT by default.
	* ntpd/refclock_oncore.c: Prefer timepps.h over sys/timepps.h
	From: Poul-Henning Kamp 

Tue Apr 13 17:32:35 1999  Harlan Stenn  

	* configure.in: 4.0.92f

	* ntpd/ntp_refclock.c (refclock_open): VMIN should be 1, not 0
	From: Reg Clemens 

Sun Apr 11 18:26:44 1999  Harlan Stenn  

	* ntpd/refclock_mx4200.c: Patches/improvements
	* ntpd/ntpd.c (set_process_priority): Lint
	From: Marc.Brett@westgeo.com

	* util/ntptime.c: Lint, bit definition cleanup
	From: Ulrich Windl 

Wed Apr  7 03:02:23 1999  Harlan Stenn  

	* ntpd/refclock_oncore.c: Use timepps.h or sys/timepps.h
	* configure.in: Look for either timepps.h or sys/timepps.h
	From: Poul-Henning Kamp 

	* ntpd/ntp_io.c (create_sockets): Don't warn about ENXIO.
	(Several places)
	From: Andrej Borsenkow 

	* libntp/mfp_mul.c (mfp_mul): Lint.
	Marc.Brett@westgeo.com

Sun Apr  4 03:23:53 1999  Harlan Stenn  

	* configure.in: 4.0.92e
	Dave redesigned the clock state machine.

1999-02-28  Frank Kardel   acm.org>

	* parseutil/dcfd.c: added DCF77 module powersetup

	* ntpd/refclock_parse.c (parse_control): using gmprettydate instead of prettydate()
	(mk_utcinfo): new function for formatting GPS derived UTC information
	(gps16x_message): changed to use mk_utcinfo()
	(trimbletsip_message): changed to use mk_utcinfo()
	ignoring position information in unsynchronized mode
	(parse_start): augument linux support for optional ASYNC_LOW_LATENCY

	* ntpd/ntp_control.c (ctl_putclock): cleanup of end of buffer handling

	* libparse/parse.c (timepacket): removed unnecessary code

	* libparse/clk_trimtsip.c (struct trimble): new member t_utcknown
	(cvt_trimtsip): fixed status monitoring, bad receiver states are
 	now recognized

	* libntp/prettydate.c (gmprettydate): new function for format date
 	and time with respect to UTC

	* libntp/gpstolfp.c (GPSWRAP): update GPS rollover to 990 weeks

	* include/trimble.h (CMD_RUTCPARAM): control variable name unification

	* include/ntp_fp.h: added prototype for gmprettydate()

Sat Feb 27 00:03:16 1999  Harlan Stenn  

	* libntp/systime.c: definition
	* ntpd/ntp_proto.c: sco5_oldclock declaration
	* configure.in: SCO5_CLOCK for *-*-sco3.2v5*
	* util/tickadj.c (main): SCO5_OLDCLOCK -> SCO5_CLOCK
	From: Kees Hendrikse 

	* ntpd/ntp_config.c (getconfig): Indentation cleanup
	Deal with 'P' case better
	* ntpd/ntpd.c: Declare set_process_priority()
	* ntpd/refclock_dumbclock.c: Lint cleanup
	From: Marc.Brett@westgeo.com

Wed Feb 24 10:22:51 1999  Harlan Stenn  

	* configure.in: 4.0.92d

	* configure.in: Dave says we can't enable PARSE clocks by default.
	Also, Solaris 2.7 still has its kernel bug - disable kernel FLL
	there.
	Reported by: Dave Mills 

Tue Feb 23 23:37:44 1999  Harlan Stenn  

	* libparse/Makefile.am (parsesolaris.o): Devious hack to deal
	with bug in sys/systm.h .
	Suggested by: Chaim Frenkel 

Tue Feb 23 20:46:31 1999  Frank Kardel   acm.org>

	* ntpd/refclock_parse.c: fixed #endifs
	(stream_receive): fixed formats

Mon Feb 22 00:35:06 1999  Harlan Stenn  

	* configure.in: 4.0.92c

	* ntpd/refclock_chronolog.c: Lint
	* ntpd/refclock_dumbclock.c: Ditto
	* ntpd/refclock_oncore.c: Ditto
	From: Marc.Brett@westgeo.com

	* ntpd/refclock_oncore.c (oncore_msg_any): Call GETTIMEOFDAY, not
	gettimeofday().
	From: david.higgins@mail.ccur.com

	* configure.in (MCAST): Not in i386-sequent-sysv4
	Reported by: Joseph Geter 

	* util/ntptime.c: Linux cleanup.
	From: Reg Clemens 

	* configure.in: Rename SCO5_OLDCLOCK to SCO5_CLOCK
	* acconfig.h: Ditto

	* ntpd/ntp_proto.c: SCO5_CLOCK stuff
	(init_proto): Use the SCO5_CLOCK stuff
	* libntp/systime.c: SCO5_CLOCK stuff
	(get_systime): Use the SCO5_CLOCK stuff
	(adj_systime): Use the SCO5_CLOCK stuff
	From: Kees Hendrikse 

	* ntpd/ntp_config.c: Added -P option and associated baggage.
	(getstartup): Update help text
	(getconfig): Process -P option
	(getconfig): Update help text
	* ntpd/ntpd.c (set_process_priority): Created.
	(service_main): remove process priority stuff - we want to do at
	after we start up the resolver, so call set_process_priority()
	after getconfig().
	From: Kamal A Mostafa 

1999-02-21  Frank Kardel   acm.org>

	* ntpd/ntp_util.c (hourly_stats): removed unused variable

	* libntp/ieee754io.c: renamed index to fieldindex to avoid index() name clash

	* ntpd/refclock_parse.c (parse_start): add initialization for Linux PPSkit

Sun Feb 21 17:53:33 1999  Harlan Stenn  

	* ntpd/ntp_io.c (create_sockets): Skip interfaces that are really
	just aliases.
	From: "Erik R. Leo" 

	* configure.in: 4.0.92b

	* ntpd/ntpd.c (service_main): Check for an error return from
	sched_get_priority_max().

Wed Feb 17 03:48:47 1999  Harlan Stenn  

	* configure.in: 4.0.92a

	* configure.in: configure.in requires autoconf 2.13 or later.
	Reported by Ulrich Windl 

Wed Feb 17 00:12:11 1999  Harlan Stenn  

	* acconfig.h: TERMIOS_NEEDS__SVID3
	* configure.in: Ditto
	* ntpd/refclock_palisade.h: Ditto
	* include/ntp_refclock.h: Ditto
	* ntpd/ntpd.c (service_main): We want sched_get_priority_max().
	From: Kamal A Mostafa 

	* ntpd/ntp_refclock.c (refclock_open): Zero the entire c_cc[] array.
	From: Reg Clemens 

Tue Feb 16 23:37:49 1999  Harlan Stenn  

	* Updated ansi2knr
	Reported by: Marc Brett

Mon Feb 15 02:55:28 1999  Harlan Stenn  

	* configure.in: 4.0.92

	* ntpd/ntp_refclock.c: Added refclock_chronolog and
	refclock_dumbclock.
	From: Robert McMillin 

Sun Feb 14 15:57:53 1999  Harlan Stenn  

	* dropped SCO3 support #defines.
	* changed SCO5_TICKADJ #define to SCO5_OLDCLOCK
	* Added code in libntp/systime.c to accumulate changes until a whole
	  tick can be added or dropped. Adjusted gettimeofday() output
	  to include the contents of the accumulator.
	* cleaned up util/tickadj.c; tickadj -As now does the right thing.
	From: Kees Hendrikse 

	* ntpq/ntpq.c: Rename delay() to auth_delay()
	Reported by: Andrej Borsenkow 

	* ntpd/refclock_palisade.h: Cleanup.
	From: Marc.Brett@westgeo.com

	* ntpd/ntp_refclock.c (refclock_ioctl): Typo.
	From: Reg Clemens 

	* ntpd/ntp_io.c (create_sockets): Only bind a given network once.
	From: Wolfgang Rupprecht 

Sat Jan 30 11:48:37 1999  Harlan Stenn  

	* configure.in: 4.0.91f

Thu Jan 28 22:58:40 1999  Harlan Stenn  

	* ntpd/refclock_parse.c (CLK_REALTYPE): We really want ttl, not hmode.
	* ntpd/ntp_config.c (getconfig): "mode" really should update the
	ttl member, not the hmode member.

	* ntpd/refclock_local.c: More offset cleanup from Dave.

Thu Jan 28 00:15:20 1999  Harlan Stenn  

	* configure.in: 4.0.91e

	* ntpd/refclock_local.c: Bugfix.
	From: Dave Mills

	* ntpd/refclock_palisade.c: Lint/IRIX portability cleanup
	* ntpd/refclock_palisade.h: Re-enable the declaration of float()
	* ntpd/ntp_io.c (create_sockets): Initialize size to 0
	From: Marc.Brett@westgeo.com

	* ntpd/refclock_parse.c (CLK_REALTYPE): Use hmode, not ttl.
	* configure.in (ac_cv_var_no_parenb_ignpar): Not under Linux.
	Reported by: Thomas Quinot 

	* ntpdc/ntpdc.c (my_delay): Renamed, from delay.
	Reported by: Andrej Borsenkow 

Tue Jan 26 00:56:10 1999  Harlan Stenn  

	* configure.in: 4.0.91d

	* ntpq/ntpq.c: Y2K patches
	From: Marc.Brett@westgeo.com

	* html/driver29.htm: New version
	* ntpd/refclock_palisade.c: Ditto
	* ntpd/refclock_palisade.h: Ditto
	From: Sven_Dietrich@Trimble.COM

	* upgrade ansi2knr.c

	* Some stuff that Dave did.

	* configure.in: 4.0.91c

	* ntpd/refclock_oncore.c: Prototype cleanup.  Enum cleanup.
	* ntpd/ntp_proto.c (clock_select): Fix memory leak.
	* configure.in (ac_cv_struct_ppsclockev): Might need sys/time.h to
	check for struct clockppsev.  Return pce->serial, not 0;
	From: Marc.Brett@westgeo.com

	* ntpd/refclock_oncore.c (oncore_msg_En): Clean up.
	From: John.Hay@mikom.csir.co.za

Mon Jan 25 11:50:29 1999  Philippe De Muyter  

	* libparse/parse_conf.c (clockformats): Entry added for
 	clock_wharton_400a.
	* libparse/clk_wharton.c: New file.
	* libparse/Makefile.am (libparse_a_SOURCES): clk_wharton.c added;
	(libparse_kernel_a_SOURCES): kclk_wharton.c added.
	(kclk_wharton.o): New dependency rule.
	* ntpd/refclock_parse.c (parse_clockinfo): Entry added for the
	WHARTON clock (mode 15).
	* acconfig.h (CLOCK_WHARTON_400A): New configuration macro.
	* configure.in (CLOCK_WHARTON_400A): Macro defined like other
	CLOCK_xxx macros.

Sun Jan 24 13:51:30 1999  Harlan Stenn  

	* ntpd/ntp_config.c (do_resolve_internal): Missing #ifdef DEBUG
	From: Sven Dietrich 

	* Makefile.am (SUBDIRS): Lose authstuff
	* configure.in: Ditto

Sat Jan 23 15:28:03 1999  Harlan Stenn  

	* configure.in: 4.0.91b

Sat Jan 23 15:02:25 1999  Harlan Stenn  

	* ntpd/refclock_oncore.c: use HAVE_STRUCT_PPSCLOCKEV
	* acconfig.h: HAVE_STRUCT_PPSCLOCKEV
	* configure.in (ac_cv_struct_ppsclockev): Added test

Thu Jan 21 15:35:25 1999  Harlan Stenn  

	* configure.in: 4.0.91a

	* ntpd/refclock_nmea.c (nmea_receive): Call refclock_process()
	every second (or each time a nmea string is received).
	From: John Hay 

	* ntpd/ntp_refclock.c (refclock_ioctl): Use TIOCPPS if we have it.
	(refclock_ioctl): Use LDISC_CLKPPS, not LDISC_PPS when deciding
	how to set str.
	* ntpd/ntp_loopfilter.c: Lose unused ntp_gettime() stuff.
	* ntpd/ntp_request.c: Ditto.
	* ntpd/refclock_local.c: Ditto.
	* ntpd/refclock_shm.c (shm_poll): Fix the refclock_process() call.
	* ntpd/refclock_oncore.c: patches and cleanup
	* configure.in: ioctl/PPS checks, ONCORE cleanup
	* acconfig.h: ONCORE cleanup
	From: Reg Clemens 

	* configure.in (CFLAGS): cc on Sequent wants -Wc,+abi-socket.
	We also need to figure out why -lsocket isn't being detected;
	-lsocket is needed.
	From: Dana Kaempen 

	* include/ntp_stdlib.h: AIX portability patches, header cleanup.
	* ntptrace/ntptrace.c: Ditto.
	* ntpdate/ntpdate.c: Ditto.
	* ntpd/refclock_true.c: Ditto.
	* ntpd/refclock_mx4200.c: Ditto.
	* ntpd/refclock_jupiter.c: Ditto.
	* libntp/msyslog.c: Ditto.
	From: Marc.Brett@waii.com

Sun Jan 10 15:15:07 1999  Harlan Stenn  

	* configure.in: 4.0.91

Sat Jan  9 00:11:34 1999  Harlan Stenn  

	* include/ntp_stdlib.h: msyslog() is declared differently if we're
	not __STDC__.

	* include/ntp_types.h: It's HAVE_PROTOTYPES, not USE_PROTOTYPES.
	* include/ntp_machine.h: Ditto.

Fri Jan  8 20:47:10 1999  Harlan Stenn  

	* configure.in: Upgrade to autoconf-2.13
	Do the prototypes check much earlier, as it might alter CFLAGS and
 	things which will affect other tests.

	* ntpd/ntp_request.c (do_conf): The problem was with a template
	for "version" on an IRIX C compiler...
	From: Marc.Brett@waii.com

	* libntp/authkeys.c: #include config.h first.
	Reported by: brian.bumpass@funb.com

Thu Jan  7 00:24:35 1999  Harlan Stenn  

	* util/tickadj.c (main): return() instead of exit().
	* ntpd/ntp_request.c (do_conf): Disambiguate ||.
	* ntpd/ntp_proto.c (clock_select): Initialize variables.
	From: Marc.Brett@waii.com

	* scripts/ntpver.in: Use PATH_SH

	* configure.in (PATH_SH): Added.

Tue Jan  5 19:02:51 1999  Harlan Stenn  

	* configure.in: 4.0.90h

	* html/driver30.htm: Updated.
	* html/refclock.htm: Refer to driver30
	* ntpd/refclock_oncore.c: Vastly improve and make less FreeBSD centric,
	From: Poul-Henning Kamp  and
		Reg.Clemens 

	* include/ntp.h: Portability/lint patches
	* libntp/binio.c: Ditto.
	* libntp/caljulian.c: Ditto.
	* libntp/caltontp.c: Ditto.
	* libntp/ieee754io.c: Ditto.
	* libntp/md5c.c: Ditto.
	* libntp/mfp_mul.c: Ditto.
	* libntp/msyslog.c: Ditto.
	* libntp/statestr.c: Ditto.
	* libntp/systime.c: Ditto.
	* libparse/clk_trimtsip.c: Ditto.
	* libparse/data_mbg.c: Ditto.
	* libparse/parse.c: Ditto.
	* ntpd/ntp_control.c: Ditto.
	* ntpd/ntp_filegen.c: Ditto.
	* ntpd/ntp_intres.c: Ditto.
	* ntpd/ntp_io.c: Ditto.
	* ntpd/ntp_peer.c: Ditto.
	* ntpd/ntp_proto.c: Ditto.
	* ntpd/ntp_util.c: Ditto.
	* ntpd/ntpd.c: Ditto.
	* ntpd/refclock_arc.c: Ditto.
	* ntpd/refclock_chu.c: Ditto.
	* ntpd/refclock_datum.c: Ditto.
	* ntpd/refclock_leitch.c: Ditto.
	* ntpd/refclock_parse.c: Ditto.
	* ntpd/refclock_usno.c: Ditto.
	* ntpq/ntpq.c: Ditto.
	* util/tickadj.c: Ditto.
	From: Marc.Brett@waii.com

Mon Jan  4 00:56:55 1999  Harlan Stenn  

	* configure.in: 4.0.90g

	* ntpd/ntp_config.c (getconfig): MODE was setting ttl, not hmode.
	Reported by: Carsten Emde 

Fri Dec  4 01:01:14 1998  Harlan Stenn  

	* configure.in: 4.0.90f

	* ntpd/refclock_mx4200.c: New version
	From: Marc.Brett@waii.com

1998-12-02  Harlan Stenn  

	* ntpd/ntp_config.c (do_resolve_internal): If fork fails, say why.
	Reported by: Jeff_Dennison@admin.tc.faa.gov

	* ntpd/ntpd.c (ntpdmain):  fork() can return a -1.  Someday we'll
	report this condition...

1998-12-02  Harlan Stenn  

	* configure.in: 4.0.90e

	* ntpd/refclock_palisade.c: Reformat code so ansi2knr will work
	* ntpd/refclock_palisade.h: Ditto
	From: Marc.Brett@waii.com

Sun Nov 29 21:00:53 1998  Harlan Stenn  

	* configure.in: 4.0.90d

	* configure.in (CFLAGS): Use "-O2 -g3 -n32" by default for Irix6.2
	and later.
	Reported by: Jack Bryans 

1998-11-29  Harlan Stenn  

	* configure.in: 4.0.90c

	* ntpd/refclock_oncore.c (oncore_msg_En): Convert to nano
	From: John Hay 

	* include/ntp_request.h (RM_VN_MODE): Add version parameter, so
	xntpdc will work across v3 and v4.
	* ntpd/ntp_request.c: Track requested version
	(req_ack): Use requested version in RM_VN_MODE
	(more_pkt): Ditto
	(flush_pkt): Ditto
	(process_private): Get requested version
	* ntpd/ntp_intres.c (request): Use default version
	* ntpdc/ntpdc.c (sendrequest): Ditto
	From: John Hay 

Fri Nov 27 14:27:21 1998  Harlan Stenn  

	* ntpd/refclock_palisade.c: Lint cleanup
	* ntpd/refclock_palisade.h: Ditto.
	From: Marc Brett 

Mon Nov 23 04:45:03 1998  Harlan Stenn  

	* configure.in: 4.0.90b

	* New code and cleanup for the NT stuff
	From: Carl Byington 

Sat Nov 21 21:21:45 1998  Harlan Stenn  

	* configure.in: 4.0.90a

	* libntp/systime.c (step_systime): net_set_tod calls clock_settime.
	* libntp/machines.c (ntp_set_tod): Take a 2nd arg for NT.
	* include/ntp_machine.h: ntp_set_tod() has 2 args always.
	* ports/winnt/bldrel.bat: Typo.
	From: Carl Byington 

	* ntpd/ntp_intres.c (findhostaddr): h_errno is a #define under AIX.
	* configure.in:  clock_settime is a stub in AIX4.
	From: Perry Ross 

	* libntp/Makefile.am (EXTRA_DIST): Lose libntp.mak
	* ntpd/Makefile.am (EXTRA_DIST): Ditto.
	* ntpdate/Makefile.am (EXTRA_DIST): Ditto.
	* ntpdc/Makefile.am (EXTRA_DIST): Ditto.
	* ntpq/Makefile.am (EXTRA_DIST): Ditto.
	From: Greg Schueman 

Sat Nov 21 12:33:16 1998  Harlan Stenn  

	* configure.in: 4.0.90

	Nano changes from Dave Mills.

Thu Nov 19 04:23:46 1998  Harlan Stenn  

	* include/ntp_machine.h: STREAM also needs HAVE_SYS_STREAM_H
	Reported by: Ronald Cole 

Mon Nov 16 19:17:34 1998  Harlan Stenn  

	* configure.in: 4.0.73e14

	* util/ntptime.c (main): Protect STA_NANO

	* ntpd/refclock_oncore.c: General overhaul and simplifications.
	The new manual clarifies a lot of fine points, and the driver has
	been suitably simplified.  Uses Site Survey if possible, otherwise
	does it by hand.  Should also work with non-UT models, as long as
	they talk the Motorola Binary Protocol.  The driver Doesn't (need
	to) know where the author lives anymore.
	From: Poul-Henning Kamp 

	* ntpd/refclock_palisade.h: New version.
	* ntpd/refclock_palisade.c: New version.
	From: Sven Dietrich 

Sat Oct 24 01:19:21 1998  Harlan Stenn  

	* configure.in: 4.0.73e13

	* ntpdc/ntpdc_ops.c (clkbug): Patches
	* ntpd/ntp_refclock.c (refclock_buginfo): Patches
	From: Marc.Brett@waii.com

Sat Oct 10 20:13:14 1998  Harlan Stenn  

	* configure.in: 4.0.73e12

	* ntpd/ntp_util.c (hourly_stats): Added prio_set stuff.

	* ntpd/ntpd.c (ntpdmain): HAVE_SETPGRP_0 typo.
	* parseutil/dcfd.c (detach): Ditto.
	* ntpd/ntp_control.c (ctl_putpeer): Sometimes, peer->dstadr is
	NIL.
	From: Perry Ross 

	* ntpd/ntpd.c:
	Some systems use sys/sched.h, not sched.h (Irix)
	* configure.in (CFLAGS): nextstep needs -posix.
	Reported by: Jack Bryans 

Sat Oct  3 02:32:46 1998  Harlan Stenn  

	* configure.in: 4.0.73e11

	* configure.in (ac_refclock_palisade): Needs termios.

	* libntp/mktime.c: Some systems need sys/types.h

	* configure.in: Added AC_TYPE_SIZE_T and AC_CHECK_TYPE(time_t, long)
	The time_t stuff should only be needed on Older machines, so the
	fact that I'm using a long shouldn't be a problem (hollow laugh).

	* include/l_stdlib.h: Sometimes we need to #include 

	* libntp/Makefile.am (../include/des.h): Typo.

Fri Oct  2 20:52:47 1998  Harlan Stenn  

	* ntpd/ntp_intres.c (request): Accept responses back thru V2.

Thu Oct  1 00:11:16 1998  Harlan Stenn  

	* configure.in: 4.0.73e9

	* ntpd/ntpd.c (catch_danger): Added.
	(ntpdmain): AIX SIGDANGER stuff
	From: Lars-Owe Ivarsson 

	* configure.in:
	* include/ntp_machine.h:
	* include/ntp_string.h:
	* libntp/machines.c:
	* libparse/clk_hopf6021.c:
	* libparse/clk_trimtsip.c:
	* ntpd/refclock_leitch.c:
	* ntpd/refclock_palisade.c:
	* ntpd/refclock_parse.c:
	Here are some patches to suppress warnings from various compilers
	(IRIX 5.3, MipsPro C 7.1 on IRIX 6.4, AIX 4.1) and loaders (IRIX
	5.3, IRIX 6.4).  Shouldn't affect functionality at all.
	From: Marc Brett 
	(I got similar patches for AIX from Lars-Owe Ivarsson
	)

Thu Sep 24 21:33:50 1998  Harlan Stenn  

	* configure.in: '73e8

	* configure.in: AIX4 stubs the POSIX timer_ stuff,
	sched_setscheduler, and mlockall.
	Reported by: Lars-Owe Ivarsson 

	* configure.in: OpenBSD stubs the POSIX timer_ stuff.
	Reported by:  sidney august cammeresi iv 
	(and several other folks whose names I can't find at the moment)

Mon Sep 21 15:35:23 1998  Harlan Stenn  

	* configure.in: '73e7

	* ntpd/refclock_parse.c: Missing declaration
	From: Marc Brett 

	* include/README: Remove old MCAST descriptions

	* include/Makefile.am (noinst_HEADERS): Lose sun-in.h .

Mon Sep 21 14:50:12 1998  Harlan Stenn  

	* ntpdate/ntpdate.c (timer): Properly format the definition.

Sun Sep 20 23:02:50 1998  Harlan Stenn  

	* configure.in: '73e6

	* include/Makefile.am (noinst_HEADERS): Renamed in.h to sun-in.h

Fri Sep 18 01:05:55 1998  Harlan Stenn  

	* configure.in: '73e5

	* ntpd/refclock_palisade.c: SCO patch
	From: Kamal A Mostafa 

	* libparse/clk_trimtsip.c (cvt_trimtsip): Fix rollover bug.
	From: "Michael J. Tubby B.Sc. G8TIC" 

	* libntp/authencrypt.c:
	* libntp/systime.c:
	* ntpd/refclock_acts.c:
	* ntpd/refclock_arbiter.c:
	* ntpd/refclock_arc.c:
	* ntpd/refclock_as2201.c:
	* ntpd/refclock_atom.c:
	* ntpd/refclock_chu.c:
	* ntpd/refclock_conf.c:
	* ntpd/refclock_datum.c:
	* ntpd/refclock_heath.c:
	* ntpd/refclock_hpgps.c:
	* ntpd/refclock_irig.c:
	* ntpd/refclock_leitch.c:
	* ntpd/refclock_nmea.c:
	* ntpd/refclock_palisade.c:
	* ntpd/refclock_parse.c:
	* ntpd/refclock_pst.c:
	* ntpd/refclock_trak.c:
	* ntpd/refclock_true.c:
	* ntpd/refclock_usno.c:
	* ntpd/refclock_wwvb.c:
	Typos, cleanup, and bugfixes
	From: Marc Brett 

	* ntpd/ntp_timer.c (timer): Typo.
	* include/ntp_refclock.h: in refclockstat, clockdesc should be const.
	* ntpd/ntp_io.c (create_sockets): Typo.
	* ntpd/ntp_control.c (free_varlist): Use the appropriate cast when
	calling free().
	(set_var): Use char *td for non-const char data.
	(ctl_getitem): Use char * for non-const data.
	(Many of these reported by Marc Brett)

Sun Sep 13 19:19:09 1998  Harlan Stenn  

	* ntpd/ntpd.c: Added nofork declaration.
	(ntpdmain): Initialize it...
	* ntpd/ntp_config.c: added nofork.
	Updated ntp_options.
	(getstartup): Updated "usage" string.  Deal with -n flag.
	(getconfig): Ditto.
	From: Jeffrey Hutzelman 

	* ntpd/ntp_io.c (open_socket): Use ntoa() to print out the address
	when bind() fails. (in 2 places)
	Reported by: "Markus W. Fehr" 
	Only soft-fail if an interface is unavailable.
	(create_sockets):  Don't SO_REUSEADDR if the interface is unavailable.
	From: "Markus W. Fehr" 

	* configure.in:  If we --disable-all-clocks, then don't enable
	parse clocks by default.
	Reported by: Marion Hakanson 

Sat Aug 22 23:58:14 1998  Frank Kardel   acm.org>

	* ntpd/refclock_parse.c (local_input): fixed IO handling for non-STREAM IO

Sun Aug 16 20:13:32 1998  Frank Kardel   acm.org>

	* libntp/ieee754io.c: debug information only compile for LIBDEBUG case

	* ntpd/refclock_parse.c (gps16x_message): reduced UTC parameter information (dropped A0,A1)
	made uval a local variable (killed one of the last globals)
	(sendetx): added logging of messages when in debug mode
	(trimble_check): added periodic checks to facilitate re-initialization
	(trimbletsip_init): made use of EOL character if in non-kernel operation
	(trimbletsip_message): extended message interpretation
	(getdbl): fixed data conversion

	* libparse/parse_conf.c (clockformats): Trimble TSIP driver now also
	available for kernel operation

	* libparse/info_trimble.c: re-generated

	* libparse/clk_trimtsip.c (cvt_trimtsip): initial kernel capable version (no more floats)
	(clock_trimtsip =): new format name

	* libparse/clk_trimtaip.c (clock_trimtaip =): changed format name

	* include/trimble.h (CMD_RSTATTRACK): renamed mode 6 variable name

	* scripts/monitoring/ntploopwatch: moved emacs mode selector

Mon Aug 10 15:32:48 1998  Harlan Stenn  

	* ntpd/refclock_acts.c: Patch cleanup
	* ntpd/ntp_refclock.c: Patch cleanup
	* ntpd/ntp_timer.c: Patch cleanup
	From: qli@huey.udel.edu

Wed Jul 29 15:23:21 1998  Harlan Stenn  

	* libntp/machines.c: IRIX needs time.h
	Reported by: Judith E Bush 

	* ntpd/ntpd.c (service_main): Better AIX PROCLOCK fix.
	From: Matt Ladendorf  and
	Grover Davidson 

Wed Jul 29 01:36:48 1998  Harlan Stenn  

	* include/ntpd.h (MAXINTERFACES): Moved here...
	* ntpd/ntp_io.c: From here...
	(create_sockets): Only deal with MAXINTERFACES.
	(create_sockets): Only deal with specified interfaces.

	* ntpd/ntp_config.c (CONFIG_LISTEN): Added
	Added ifnum and listenaddrs[]
	(getconfig): Added defn for "addr"
	(getconfig): Initialize ifnum.

	* ntpd/ntpd.c (service_main): call init_io after getconfig
	From: Vebjorn Ljosa 

Wed Jul 29 00:42:28 1998  Harlan Stenn  

	* ntpd/refclock_palisade.c: Use NEED_HPUX9_TIOCM_STUFF

	* acconfig.h (NEED_HPUX9_TIOCM_STUFF):  Added.

	* configure.in (REFCLOCK_PALISADE): Needs termio*.h
	(NEED_HPUX9_TIOCM_STUFF): Added.

	* ntpd/ntp_io.c (create_sockets): Use strchr instead of strstr.

	* libntp/mktime.c: #include 

	* libntp/ieee754io.c: #include 

Wed Jul 29 00:24:22 1998  Harlan Stenn  

	* ntpd/refclock_acts.c (ACTS_MAXPOLL): 14 -> 18.
	Import current_nextdate
	(acts_receive): Update peer->nextdate with current_nextdate
	(acts_poll): Call acts_timeout() (debugging)

	* ntpd/ntp_refclock.c: Export current_nextdate.
	(refclock_transmit): Check peer->valid >= NTP_SHIFT - 2, not >.
	(refclock_transmit): hpoll wiggles, update current_nextdate

	* ntpd/ntp_timer.c: #include "ntp_refclock.h"
	(MODE_MANUAL): Added.
	(timer): MODE_MANUAL stuff

	From: qli@huey.udel.edu

Tue Jul 28 23:23:15 1998  Harlan Stenn  

	* configure.in: Check for inet_ntoa in -lbind .

	* ntpd/ntpd.c: #undef PROCLOCK for AIX.

Mon Jul 20 01:06:24 1998  Harlan Stenn  

	* configure.in (AC_TYPE_SIZE_T): Added.

Sat Jul 11 09:38:30 1998  Harlan Stenn  

	* configure.in: 4.0.73e

	* ports/winnt/: Replaced with new code (no SHM or PALISADE)
	From: Greg Schueman 

Fri Jul 10 12:12:59 1998  Harlan Stenn  

	* configure.in: 4.0.73d

	* include/ntp_machine.h (HAVE_SRANDOM): VxWorks patches
	(HAVE_RANDOM): Ditto.
	(CALL): Ditto.
	From: Casey Crellin 

	* ntpd/refclock_parse.c (local_input): Typo.
	Reported by: Tony Li 

Wed Jul  8 01:49:01 1998  Harlan Stenn  

	* configure.in: 4.0.73c

	* PARSE patches from Frank Kardel

	* libntp/machines.c (ntp_set_tod): Get it right.

Sun Jul  5 22:15:34 1998  Harlan Stenn  

	* configure.in: 4.0.73a

	* kernel/sys/timex.h (MOD_CANSCALE): Add rest of patch to handle
	scaling.
	From: Poul-Henning Kamp 

Wed Jun 10 21:16:01 1998  Harlan Stenn  

	* configure.in: 4.0.73

	* ntpd/ntp_loopfilter.c (local_clock): MOD_CANSCALE patches, and
	be careful with the integration if we're nearly perfect.
	From: Poul-Henning Kamp 

	* util/tickadj.c (main): Typo fix...
	From: Marion Hakanson 

	* ntpd/ntp_io.c (create_sockets): Attempt to ignore alias
	interfaces.
	From: Kenneth Maupin 

	* ntpd/ntp_refclock.c: PPS fixes
	* ntpd/refclock_msfees.c (msfees_start): Portability fixes and
	PPS/STREAM enhancements
	From: John Hay 

	* ntpd/ntp_refclock.c (refclock_gtlin): Patch...
	From: Jonathan Stone 

Sun Jun 28 18:43:30 1998  Frank Kardel   acm.org>

	* libntp/buftvtots.c (buftvtots): using WORD_BIGENDIAN instead of XNTP_BIG_ENDIAN

	* libparse/clk_trimtsip.c (getflt): fixed ENDIAN issue
	(getdbl): fixed ENDIAN issue
	(getint): use get_msb_short()
	(cvt_trimtsip): use gpstolfp() for conversion

	* libntp/Makefile.am (libntp_a_SOURCES): added gpstolfp.c source

	* libntp/binio.c: added {get,put}_msb_{short,long}() functions

	* include/ntp_fp.h: added gpstolfp() prototype

	* include/binio.h: added binio MSB prototypes

Sat Jun 13 13:48:17 1998  Frank Kardel   acm.org>

	* parseutil/testdcf.c: signed/unsigned
	SYSV clock name clash fixed

	* parseutil/dcfd.c: signed/unsigned
	SYSV clock name clash fixed
	year wrapping at 1998
	ctype macros take ints as args

	* ntptrace/ntptrace.c (decodeipaddr): ctype macros take ints as args

	* ntpq/ntpq_ops.c (doprintpeers): signed/unsigned

	* ntpq/ntpq.c: ctype macros take ints as args
	signed/unsigned

	* ntpdc/ntpdc.c: signed/unsigned

	* ntpd/refclock_usno.c: signed/unsigned

	* ntpd/refclock_true.c (true_send): signed/unsigned, name clashes

	* ntpd/refclock_parse.c: signed/unsigned, name clashes

	* ntpd/refclock_nmea.c (nmea_receive): ctype macros take ints as args

	* ntpd/refclock_heath.c (heath_receive): prototypes (signed/unsigned issues)

	* ntpd/refclock_arc.c: prototypes (signed/unsigned issues)

	* ntpd/refclock_acts.c: prototypes (signed/unsigned issues)

	* ntpd/ntpd.c: prototypes (signed/unsigned issues)

	* ntpd/ntp_util.c (getauthkeys): prototypes (signed/unsigned issues)
	fix SYSV clock name clash

	* ntpd/ntp_request.c: prototypes (signed/unsigned issues)
	fix SYSV clock name clash

	* ntpd/ntp_io.c (input_handler): variable naming, signed/unsigned

	* ntpd/ntp_intres.c (readconf): signed/unsigned issues

	* ntpd/ntp_control.c: prototypes (signed/unsigned issues)
	fix SYSV clock name clash

	* ntpd/ntp_config.c: fix SYSV clock name clash
        ctype macros take ints as args

	* libparse/parsestreams.c: dirt (debug) removed

	* libparse/parsesolaris.c: more prototypes
	fix name clashes
	allow for ansi2knr

	* libparse/parse.c: bcopy/memcpy cleanup
	fix SYSV clock name clash

	* libparse/clk_trimtsip.c (cvt_trimtsip): fix SYSV clock name clash

	* libparse/clk_trimtaip.c (cvt_trimtaip): fix SYSV clock name clash

	* libparse/clk_schmid.c (cvt_schmid): fix SYSV clock name clash

	* libparse/clk_rcc8000.c (cvt_rcc8000): fix SYSV clock name clash

	* libparse/clk_rawdcf.c (cvt_rawdcf): fix SYSV clock name clash

	* libparse/clk_hopf6021.c (cvt_hopf6021): fix SYSV clock name clash

	* libparse/clk_dcf7000.c (cvt_dcf7000): fix SYSV clock name clash

	* libparse/clk_computime.c: fix SYSV clock name clash

	* libntp/octtoint.c (octtoint): ctype macros take ints as args

	* libntp/mstolfp.c (mstolfp): ctype macros take ints as args

	* libntp/hextolfp.c (hextolfp): ctype macros take ints as args

	* libntp/hextoint.c (hextoint): ctype macros take ints as args

	* libntp/decodenetnum.c (decodenetnum): ctype macros take ints as args

	* libntp/atouint.c (atouint): ctype macros take ints as args

	* libntp/atolfp.c (atolfp): ctype macros take ints as args

	* libntp/atoint.c (atoint): ctype macros take ints as args

	* kernel/sys/parsestreams.h:  STREAM macro gone in favor of HAVE_SYS_STREAM_H

	* include/parse.h: STREAM macro gone in favor of HAVE_SYS_STREAM_H

Fri Jun 12 11:08:53 1998  Frank Kardel   acm.org>

	* ntpd/ntp_timer.c: prototype fixes (ansi2knr/knr compiler)

	* ntpd/ntp_proto.c (make_keylist): type cast for e(!!!)malloc()

	* libparse/Makefile.am: adjust for ansi2knr

	* libntp/ieee754io.c: ansi2knr compatibility

	* include/ntp_refclock.h: added pps_sample() extern declaration
	added refclock_process_offset() extern declaration

	* include/ntp.h: fixed function * prototypes

	* ntpd/refclock_parse.c (bind): added input routine
	(local_input): added input routine

	* ntpd/ntp_io.c (input_handler): direct input processing for
	refclocks to save input recv buffers

	* include/ntp_refclock.h: added int io_input(struct recvbuf *)
	pointer to allow direct processing of read refclock data in
	order to save many bug recv buffers on single character input
	(problem with "fast" machines)

	* parse_conf.c:  conditional compile macros fixed

	* parse.c:  conditional compile macros fixed
	printf prototype

	* clk_trimtaip.c:  conditional compile macros fixed
	printf prototype

	* clk_schmid.c:  conditional compile macros fixed
	printf prototype

	* clk_rcc8000.c:  conditional compile macros fixed
	printf prototype

	* clk_hopf6021.c:  conditional compile macros fixed
	printf prototype

	* clk_dcf7000.c: conditional compile macros fixed
	printf prototype

	* clk_computime.c: conditional compile macros fixed
	printf prototype

Sat Jun  6 07:41:54 1998  Frank Kardel   acm.org>

	* ntpd/refclock_palisade.c: fixed termio.h / termios.h inclusion

	* include/ntp_refclock.h: made refclockproc/clockdesc const

	* ntpd/ntp_control.c (ctl_putpeer): avoided ambigous 'else' (gcc)

	* ntpd/refclock_parse.c (parse_start): added BURST mode initialisation

	* scripts/stats/summary.sh (CLOCK): allow for Y2K log files

	* libparse/clk_rawdcf.c: simplified condidional compile expression

Wed May 27 08:10:43 1998  Frank Kardel   acm.org>

	* include/Makefile.am (noinst_HEADERS): added new header files
	mbg_gps166.h binio.h ascii.h ieee754io.h

	* ntpdc/ntpdc.c (sendrequest): fixed info_auth_keyid setting it
	got accidentally trashed every other round

Mon May 25 22:55:07 1998  Frank Kardel   acm.org>

	* configure.in: PARSE clocks are enabled by default whenever
	possible (termio.h or termios.h present)
	removed RAWDCF_SETDTR feature

	* acconfig.h: removed RAWDCF_SETDTR option (now implicit by
	compilation and run time configuration)

	* ntpd/refclock_parse.c (rawdcf_init): offer a RAWDCF clock (type 14)
	that attempts to set the DTR modem line for receiver power

	* libparse/clk_meinberg.c (cvt_meinberg): support current standard
	Meinberg data formats

Sun May 24 09:43:19 1998  Frank Kardel   acm.org>

	* libparse/clk_rawdcf.c (pps_rawdcf): trigger pps on zero going
	edge - that is simpler wiring (Rx->DCD).

	* parseutil/testdcf.c (wday): const keyword

	* parseutil/dcfd.c (cvt_rawdcf): sign issues and calling interfaces

	* ntpq/ntpq.c (MAXVARLEN): adjusted internal buffer length for
	variable values

	* ntpd/refclock_parse.c: adjust to new io handling (fixed formats
	only)
	(mkreadable): don't include >"< in readable ASCII output (-> ntpq
	parsing)
	output debug messages to stdout instead of msyslog()
	fixed version information string

	* ntpd/refclock_atom.c (pps_sample): new auxiliary pps interface

	* libparse/parsestreams.c (parserput): get event status consistent
	with direct calls
	(zs_xsisr): simulate CARRIER status to avoid unnecessary M_xHANGUP
	events

	* libparse/parsesolaris.c (parserput): get event status consistent
	with direct calls
	(zs_xsisr): simulate CARRIER status to avoid unnecessary M_xHANGUP
	events

	* libparse/parse.c: removed old input cruft
	(parse_restart): new generic input help function
	(parse_addchar): ditto
	(parse_end): ditto
	(pps_one): new generic pps help function
	(pps_zero): ditto

	* libparse/clk_trimtsip.c (clock_trimtsip =): new input handling

	* libparse/clk_trimtaip.c (clock_trimtaip =): new input handling
	(inp_trimtaip): new input handler

	* libparse/clk_schmid.c (clock_schmid =): new input handling
	(inp_schmid): new input handler

	* libparse/clk_rcc8000.c (clock_rcc8000 =): new input handling
	(inp_rcc8000): new input handler

	* libparse/clk_rawdcf.c (clock_rawdcf =): new input handling
	(snt_rawdcf): adjusted to new input handling
	(inp_rawdcf): new input handler

	* libparse/clk_meinberg.c (clock_meinberg): new input handling
	(gps_input): new input handler
	(mbg_input): new input handler

	* libparse/clk_hopf6021.c (clock_hopf6021 =): new input handling
	(inp_hopf6021): new input handler

	* libparse/clk_dcf7000.c (clock_dcf7000 =): new input handling
	(inp_dcf7000): new input handler

	* libparse/clk_computime.c (clock_computime =): new input handling
	(inp_computime): new input handler

	* libparse/Makefile.am: link kernel module with libntp.a

	* include/parse.h (struct parse): removed old data structure cruft
	(new input model) new PARSE_INP* macros for input handling
	removed old SYNC_* macros from old input model
	(struct clockformat): removed old parse functions in favor of the
	new input model
	updated prototypes

	* include/ntp_refclock.h: prototype for refclock_atom pps_sample()
	interface

	* acconfig.h: added PPS_SAMPLE define
	* configure.in (LIBPARSE): added PPS_SAMPLE configuration
	

	* libntp/systime.c (adj_systime): debug output (> level 6) for
	adjtime results

	* libntp/mfp_mul.c (mfp_mul): controlled debug output

	* libntp/ieee754io.c (get_byte): controlled debug output
	(fetch_ieee754): ditto
	(put_ieee754): ditto

Tue May  5 20:09:51 1998  Harlan Stenn  

	* configure.in: document DES is not usually present.

Wed Apr 29 22:00:22 1998  Harlan Stenn  

	* configure.in: 4.0.72h

	* authstuff/Makefile.am (check-local-rsn): check-local doesn't
	work with RSAREF...
	Reported by: "Auteria Wally Winzer Jr." 

	* libntp/machines.c: the settime() choices were ordered badly.
	Reported by: Michael Joosten 

Sat Apr 25 00:35:53 1998  Harlan Stenn  

	* configure.in (ac_cv_var_no_parenb_ignpar): Undo the kernel PLL
	block I just installed - Dave wants to control this via
	KERNEL_FLL_BUG.

Fri Apr 24 20:35:57 1998  Harlan Stenn  

	* libntp/Makefile.am (libntp_a_DEPENDENCIES): Set per libntp_a_LIBADD

	* configure.in: Do a better job of blocking kernel PLL under
	solaris2.6.

Fri Apr 24 00:41:12 1998  Harlan Stenn  

	* configure.in: 4.0.72f
	(ac_cv_struct_nlist_n_un): Don't look for ntp_adjtime or
	ntp_gettime under solaris2.6.

	* ntpd/ntp_proto.c (process_packet): Give verbose error messages

	* include/global.h (PROTOTYPES): Drive via HAVE_PROTOTYPES.

Wed Apr 22 16:55:55 1998  Harlan Stenn  

	* configure.in (ac_cv_var_use_des): Added. 4.0.72e.
	* libntp/Makefile.am (libntp_a_LIBADD): Added DESOBJS

Tue Apr 21 02:08:06 1998  Harlan Stenn  

	* ntpd/refclock_arc.c (arc_receive): Typo...
	From: Sam Steingold 

Fri Apr 10 03:05:35 1998  Harlan Stenn  

	* configure.in (ac_refclock_chu): AUDIO_CHU support.  Disabled by
	default, and currently only supported on SunOS and Solaris.
	* acconfig.h: AUDIO_CHU

Wed Apr  8 19:53:53 1998  Harlan Stenn  

	* libntp/Makefile.am (EXTRA_DIST): Added mktime.c

	* configure.in:  AC_REPLACE_FUNCS(mktime).
	(--enable-dst-minutes=60): Added, for (missing) mktime().

	* ntpd/refclock_heath.c (heath_receive): Use mktime() instead of
	the old hack.

Tue Apr  7 21:15:14 1998  Harlan Stenn  

	* configure.in (LIBOBJS): Hack it before AC_OUTPUT to deal with
	ANSI2KNR-filtering rules.
	From: Jim Meyering 

Mon Apr  6 01:40:45 1998  Harlan Stenn  

	* libntp/strerror.c: ANSIfy strerror's definition.

Thu Mar 12 20:24:45 1998  Harlan Stenn  

	* libntp/statestr.c: Only #include  if HAVE_CONFIG_H is
	#define'd.
	From: Sven Dietrich 

Wed Mar 11 00:27:32 1998  Harlan Stenn  

	* configure.in: Cygwin needs to check for the advapi32 library.
	NT doesn't support a root user, so don't bother with getuid().
	Also, don't bother with umask().

	* ntpd/ntp_io.c: cygwin32 patches
	* ntpd/ntp_proto.c: Ditto.
	* ntpd/ntpd.c: Ditto.
	* ntpd/ntp_timer.c: Ditto.
	* ntpdate/ntpdate.c: Ditto.
	* libntp/machines.c: Ditto.
	* libntp/systime.c: Ditto.
	* include/ntp_machine.h: Ditto.
	* include/ntp_unixtime.h: Ditto.
	From: Sven Dietrich 

Tue Mar 10 22:26:14 1998  Harlan Stenn  

	* configure.in (ac_cv_make_tickadj): Added.
	Now that tickadj is the only(?) utility that cares about tick and
	tickadj, we don't need to have NOKMEM and no PRESET_* be fatal.

Sat Mar  7 02:57:17 1998  Harlan Stenn  

	* ntpd/ntp_loopfilter.c (local_clock): Patch STA_FLL check
	From: Poul-Henning Kamp 

	* various: Renamed ACTS to CLOCK_ACTS, ARBITER to CLOCK_ARBITER,
	ARCRON_MSF to CLOCK_ARCRON_MSF, AS2201 to CLOCK_AS2201, BANC to
	CLOCK_BANC, DATUM to CLOCK_DATUM, GPSVME to CLOCK_GPSVME, HEATH to
	CLOCK_HEATH, HPGPS to CLOCK_HPGPS, IRIG to CLOCK_IRIG, JUPITER to
	CLOCK_JUPITER, LEITCH to CLOCK_LEITCH, MSFEES to CLOCK_MSFEES,
	MX4200 to CLOCK_MX4200, NMEA to CLOCK_NMEA, PALISADE to
	CLOCK_PALISADE, PARSE to CLOCK_PARSE, PPS720 to CLOCK_PPS720, PST
	to CLOCK_PST, PTBACTS to CLOCK_PTBACTS, SHM_CLOCK to CLOCK_SHM,
	ONCORE to CLOCK_ONCORE, TPRO to CLOCK_TPRO, TRAK to CLOCK_TRAK,
	TRUETIME to CLOCK_TRUETIME, USNO to CLOCK_USNO, WWVB to CLOCK_WWVB

	* Makefile.am (ETAGS_ARGS): Added acconfig.h

	* various: Renamed LOCAL_CLOCK to CLOCK_LOCAL.

	* configure.in: First cut at  *-pc-cygwin32 support
	Requested by: Sven Dietrich 

	* configure.in: gdt-surveying code is gone.  Sigh.
	Reported by: Poul-Henning Kamp 

Wed Mar  4 21:41:06 1998  Harlan Stenn  

	* many places: Renamed ATOM to CLOCK_ATOM

Tue Mar  3 03:18:13 1998  Harlan Stenn  

	* ntpd/ntp_timer.c (timer): Only call refclock_transmit if
	REFCLOCK is #define'd.
	Reported by a bunch of folks.

Mon Mar  2 03:46:07 1998  Harlan Stenn  

	* configure.in (ntp_refclock): Use CLOCK_CHU, which no longer
	needs any special headers.
	* ntpd/refclock_chu.c: Call it CLOCK_CHU
	(chu_receive): Define it correctly.

	* include/winnt/sys/time.h (gettimeofday): Prototypes are OK.
	(settimeofday): Prototypes are OK.
	From: JJEVNISEK@qgraph.com

	* ntpq/ntpq_ops.c: varlist name and value aren't const.
	* ntpdc/ntpdc_ops.c (fudge): The flags are u_val, not val.
	* ntpdc/ntpdc.c: const cleanup, exit cleanup.
	* ntpd/refclock_wwvb.c (wwvb_receive): Move the definition of tz
	somewhere more normal.
	* ntpd/ntp_request.c (do_trustkey): kp gets u_long data, not
	u_int32 (but Harlan thinks this patch may be wrong).
	* ntpd/ntp_refclock.c (refclock_process): clocktime needs
	offset.l_ui, not offset.l_i .
	* ntpd/ntp_control.c (set_var): t isn't const.
	* libntp/a_md5encrypt.c (session_key): Cast 2nd arg to MD5auth_setkey.
	* include/ntpd.h: ctl_var's text field isn't const.
	* include/ntp_refclock.h: clockdesc isn't const.
	From: Marc Brett 

	* ntpd/ntp_loopfilter.c (local_clock): Limit ntv.constant to
	MAXTC, and log error returns from ntp_adjtime.
	From: Juha Sarlin 

Mon Mar  2 03:05:23 1998  Harlan Stenn  

	* configure.in (ac_cv_var_kernel_fll_bug): KERNEL_FLL_BUG
	* acconfig.h: KERNEL_FLL_BUG: added.
	* ntpd/ntp_loopfilter.c (local_clock): Only avoid STA_FLL if
	KERNEL_FLL_BUG is #define'd (Solaris2.6)

Sat Feb 21 00:45:10 1998  Harlan Stenn  

	* automake-1.2d.patches: Added ansi2knr.o rules.

	* ntpd/refclock_tpro.c: P() stuff

Fri Feb 20 20:10:20 1998  Harlan Stenn  

	* configure.in: Improve the ${CC} -pipe test (cygwin-32's gcc -pipe
	silently does nothing).
	Reported by: Sven Dietrich 

Wed Feb 18 00:51:08 1998  Harlan Stenn  

* configure.in: 4.0.72 released.

* configure.in:AC_REPLACE_FUNCS(strerror), check for poll.h, and deal
  with the --enable-JUPITER stuff.
* libntp/Makefile.am (libntp_a_LIBADD): Added (for strerror support).
* libntp/clocktypes.c: Added REFCLK_GPS_JUPITER.
* ntpdate/ntpdate.c: poll() support
* ntpd/Makefile.am: Add refclock_jupiter.c
* ntpd/refclock_conf.c: Added refclock_jupiter
* ntpd/refclock_mx4200.c (mx4200_pps): Bugfixes.
* include/ntp.h (REFCLK_GPS_JUPITER): Added, and bumped REFCLK_MAX.
  From: Craig Leres 

Mon Feb 16 21:02:42 1998  Harlan Stenn  

	* ntpd/ntp_proto.c: P()

Mon Feb 16 12:43:11 1998  Harlan Stenn  

* include/ntp_types.h: Added P() prototyping hack back in.
* include/parse.h: Ditto.
* include/ntpd.h:  Ditto.
* include/ntp_unixtime.h:  Ditto.
* include/ntp_stdlib.h: Ditto.
* include/ntp_select.h: Ditto.
* include/ntp_refclock.h: Ditto.
* include/ntp_fp.h: Ditto.
* include/md5.h: Ditto.
* include/ntp_filegen.h: Ditto.
* include/ntp_calendar.h: Ditto.
* include/l_stdlib.h: Ditto.

	* configure.in (ACTS): Sometimes, TIOCMBIS is in sys/ioctl.h
	  Reported by Kenneth Jaldehag 
	* configure.in (HEATH): Ditto.
	* configure.in (PTBACTS): Ditto.
	* configure.in (USNO): Ditto.

Sat Feb 14 00:02:14 1998  Harlan Stenn  

	* ntpd/refclock_irig.c (irig_rf): Rename sincos[] to sin_cos[].

Fri Feb 13 22:22:08 1998  Harlan Stenn  

	* include/ntp.h (RANDPOLL): Use random or mrand48.
	* ntpd/ntp_config.c (do_resolve_internal): Ditto.
	* ntpd/ntp_peer.c (unpeer): Ditto.
	* ntpd/ntp_proto.c (make_keylist): Ditto.

	* ntpd/ntpd.c (xntpdmain): Use srandom or srand48.

	* configure.in: Look for {s,}random() and [ms]rand48().

Wed Feb 11 22:50:24 1998  Harlan Stenn  

	* ntpd/ntp_restrict.c (hack_restrict): Renamed restrict()
	* include/ntpd.h: Ditto
	* ntpd/ntp_request.c (do_restrict): Ditto
	* ntpd/ntp_config.c (getconfig):
	* ntpd/ntp_io.c (create_sockets): Ditto.

1998-01-23  Harlan Stenn  

	* ntpd/refclock_irig.c: Allow either  or
	 .  From Dave Mills.

	* configure.in: Under SunOS, it's sun/audioio.h .

1998-01-22  Harlan Stenn  

	* html/driver6.html: Updated header file info
	* html/irig.html: Ditto.
	* configure.in: sys/bsd_audioirig.h replaced with sys/audioio.h
	for new irig driver that Dave installed.

1998-01-08  Harlan Stenn  

	* Many places: Lose the P(()) prototype stuff

	* util/tickadj.c (writevar): Make offset an off_t
	(readvar): Ditto
	(getoffsets): Make offsets off_t

	* adjtimed/adjtimed.c (GetClockRate): Fix lseek arg 2.
	(SetClockRate): Ditto

	* Many things in many places from many people.

	* configure.in: Added AC_TYPE_OFF_T

1997-11-26  Harlan Stenn  

	* ntpd/refclock_palisade.c: ANSIfied.

Wed Sep  3 23:51:44 1997  Harlan Stenn  

	* configure.in (AM_C_PROTOTYPES): Added.

	* Makefile.am (AUTOMAKE_OPTIONS): Added ansi2knr.

ntp-4.2.6p5/build0000755000175000017500000000664711505336023012651 0ustar  peterpeter#! /bin/sh

LOGF=make.log
IAM=`hostname || uname -n`
MYNAME=`IFS=. ; set $IAM ; echo $1`
SIG=

case "$1" in
 0.*)
    SIG=$1
    shift
    CONFIG_ARGS="$@"
    KEY=`sed -e q < .buildkey-$MYNAME`
    case "$SIG" in
     $KEY) ;;
     *)
	echo "Wrong directory for build on host $IAM"
	echo "This is <`pwd`>"
	echo "SIG is <$SIG>"
	echo "KEY is <$KEY>"
	exit 1
	;;
    esac
    ;;
 *)
    CONFIG_ARGS="$@"
    ;;
esac

#set -e
#set -x

# scripts/cvo.sh invokes config.guess, and we want it to use the copy
# in the top directory (alongside build) if there's not another
# config.guess earlier on the path, so we invoke it using env to append
# . to the PATH.

CVO=`env PATH="$PATH:." scripts/cvo.sh @cvo@`
case "$CVO" in
 *-*-*-*) echo "scripts/cvo.sh returned <$CVO>, which makes no sense to me."
    exit 1
    ;;
 *-*-*) ;;
 *) echo "scripts/cvo.sh returned <$CVO>, which makes no sense to me."
    exit 1
    ;;
esac

case "$NTP_BDIR" in
 '')
    case "$IAM" in
     *.ntp.org)
	NTP_BDIR=host
	;;
     *.udel.edu)
	NTP_BDIR=host
	# HMS: --enable-local-libopts is the default now...
	#CONFIG_ARGS="$CONFIG_ARGS --enable-local-libopts"
	case "$CVO" in
	 *-*-ultrix*)
	    CONFIG_ARGS="$CONFIG_ARGS --with-libregex=/usr/local"
	    ;;
	esac
	;;
     *)
	NTP_BDIR=cvo
	;;
     esac
     ;;
esac

case "$NTP_BDIR" in
 host) 
    BASEDIR=A.$MYNAME
    ;;
 cvo)
    BASEDIR=A.$CVO
    ;;
 *)
    echo "build: NTP_BDIR must be either 'cvo' or 'host'!" 1>&2
    exit 1
    ;;
esac

KEYSUF=""

case "$CONFIG_ARGS" in
 *--with-crypto=autokey*)
    KEYSUF="-autokey"
    ;;
 *--without-crypto*)
    KEYSUF="-noopenssl"
    ;;
esac

case "$CONFIG_ARGS" in
 *--disable-all-clocks*)
    KEYSUF="$KEYSUF-no-refclocks"
    ;;
esac

case "$CONFIG_ARGS" in
 *--disable-debugging*)
    KEYSUF="$KEYSUF-nodebug"
    ;;
esac

case "$CC" in
 '')
    CCSUF=""
    ;;
 *)
    CCSUF="-`echo $CC | sed -e 's: :_:g' -e's:/:+:g'`"
    ;;
esac

BDIR="$BASEDIR$KEYSUF$CCSUF"

[ -d "$BDIR" ] || mkdir $BDIR
[ -f "$BDIR/.buildcvo" ] || echo $CVO > $BDIR/.buildcvo
[ -f "$BDIR/.buildhost" ] || echo $IAM > $BDIR/.buildhost


cd $BDIR

#
# Make sure we have a nice that works.
# To disable use of nice, setenv NO_NICE_BUILD=1
#
NICEB=
[ "$NO_NICE_BUILD" != "1" ] && nice true && NICEB=nice
[ -z "$NICEB" ] && {
	NICEB="./.nicebuild-$MYNAME-$SIG"
	cat > $NICEB <<-HEREDOC
		#! /bin/sh
		shift
		\$*
HEREDOC
	chmod +x $NICEB
}

#
# Find a test which supports -nt, unlike Solaris /bin/sh builtin.
#
TEST="${TEST-}"
if [ -z "$TEST" ] ; then
    for try in test /bin/test /usr/bin/test ; do
	case `$try config.status -nt ../configure 2>&1` in
	 '')
	    TEST="$try"
	    # echo "Using $TEST"
	    break
	    ;;
	esac		
    done
    if [ -z "$TEST" ] ; then
	echo "build: need help finding test binary" 1>&2
	exit 1
    fi
fi

CONFIGURE="../configure --cache-file=../config.cache-$IAM$CCSUF $CONFIG_ARGS"

(	# This sequence of commands is logged to make.log.
	# If config.status is newer than ../configure, and the same
	# is true for sntp, we do not need to re-run configure.
	# Solaris /bin/sh doesn't grok -nt.

	( "$TEST" config.status -nt ../configure &&
		$TEST sntp/config.status -nt ../sntp/configure ) ||
		"$NICEB" -7 $CONFIGURE
	"$NICEB" -5 ./config.status &&
		( cd sntp && "$NICEB" -5 ./config.status ) &&
		"$NICEB" -14 ${MAKE-make} &&
		"$NICEB" -11 ${MAKE-make} check
) > $LOGF 2>&1

EXITCODE=$?

# clean up if we made a dummy nice script
case "$NICEB" in
 nice)
    ;;
 *)
    rm "$NICEB"
    ;;
esac

exit $EXITCODE
ntp-4.2.6p5/version0000644000175000017500000000000711675461337013233 0ustar  peterpeter1.2349
ntp-4.2.6p5/scripts/0000755000175000017500000000000011710605402013274 5ustar  peterpeterntp-4.2.6p5/scripts/ntp-wait.in0000644000175000017500000000256011307651604015401 0ustar  peterpeter#! @PATH_PERL@ -w

die "perl5 needed\n" unless ($] > 5);

use Getopt::Std;

$opt_n = 1000;			# How many tries before we give up? (10 min+)
$opt_s = 6;			# Seconds to sleep between tries (6s = 10/min)
$opt_v = 0;			# Be verbose?

getopts('n:s:v');

$cmd = 'ntpq -c "rv 0"';

$| = 1;				# Autoflush output.

print "Waiting for ntpd to synchronize...  " if ($opt_v);
for ($i = 0; $i < $opt_n; ++$i) {
    open(Q, $cmd." 2>&1 |") || die "Can't start ntpq: $!";
    while() {
      chomp;
      # the first line should be similar to:
      # associd=0 status=0645 leap_none, sync_ntp, ...
      if (/^associd=0 status=(\S{4}) (\S+), (\S+),/) {
	my $status = $1;
	my $leap = $2;
	my $sync = $3;
	# print $_;
	# print "status <$status>, leap <$leap>, sync <$sync>\n";
	last if ($leap =~ /(sync|leap)_alarm/);
	if ($leap =~ /leap_(none|((add|del)_sec))/) {
	  # We could check $sync here to make sure we like the source...
	  print "\bOK!\n" if ($opt_v);
	  exit 0;
	}
	print "\bUnexpected 'leap' status <$leap>\n";
	exit 1;
      }

      if (/Connection refused/) {
	print "\bntpd is not running!\n" if ($opt_v);
	exit 1;
      }

      # Otherwise, we have a bigger problem.
      print "\bUnexpected first line <$_>\n";
      exit 1;
    }
    close(Q);
    print "\b".substr("*+:.", $i % 4, 1) if ($opt_v);
    sleep($opt_s);
}
print "\bNo!\nntpd did not synchronize.\n" if ($opt_v);
exit 1;
ntp-4.2.6p5/scripts/checktime.in0000644000175000017500000000430610017034601015557 0ustar  peterpeter#! @PATH_PERL@
#! @PATH_PERL@ -d
# 
# This script compares the time of several machines with the
# time on the local host.
#
# Use or modify it as you wish. 
#
# As the original author is only expecting 14 minutes of fame, 
# leaving his name attached would be appreciated.
#
# R. Gary Cutbill 
# 21 April 1999
#
$tol=2.0;
$|=1;
print "Time Check";

open(HOSTS,"ypcat hosts.byaddr |");  # get a list of hosts from the yp server.

while ($line=) { # loop for each host getting the offset compared to localhost
	($addr,$host,$aliases)=split(/\s+/,$line,3);
        $res=`/usr/local/bin/ntptrace -m 1 -r 1 -t 1 $host`;
	print ".";
	chop $res;
        push (@results,$res);
}
print "\n";


#
# Sort the list of hosts, and print out there offsets
# from the local host.  
#
@list=sort appropriately @results;
foreach $i ( @list ) {

   @dargs=split(/\s+/,$i);
   if ( $dargs[1] eq "\*Timeout\*" ) { 
     print "$i\n";
     chop $dargs[0];
     push(@down,$dargs[0]);
   } else {
     printf "%-25s %7s %3s %6s %10s %5s %8s %8s\n",@dargs;
     if ( ( $dargs[4] > $tol ) || ( $dargs[4] < -$tol ) ) { 
	 chop $dargs[0];
         push(@toofarout,$dargs[0]); }
   }
}
#
# When the above list finishes, hosts that are different by +/- $tol (two seconds)
# are in @toofarout.  Hosts that are down are in @down. They are treated the same
# way here, but you might want to do something different depending on your site.
#
# print a set of suggested rsh commands to run on the hosts that 
# don't have "good" time.   "restartntp" is left as an excersize to the reader.
# I usually use it to kill a running xntpd, ntpdate some server, and the start xntp
# again.
# 
print "\nConsider:\n";
foreach $i ( (@down,@toofarout) ) {
    print "  rsh $i sudo restartntp\n";
}


#
# sort the results from the list.  First by stratum, then by time deviation
# Put hosts that didn't respond (timed out) on the bottom.
#
sub appropriately {
    @af=split(/\s+/,$a);
    @bf=split(/\s+/,$b);
    $aba= ($af[4]<0)?-$af[4]:$af[4];
    $abb= ($bf[4]<0)?-$bf[4]:$bf[4];

        ( $af[1] ne $bf[1] ) ? $bf[1] cmp $af[1] :
	   ( ( $af[2] != $bf[2] ) ? ( $bf[2] <=> $af[2] ) :
	     ( ( $aba != $abb )  ? ( $abb <=> $aba ) : ($af[0] cmp $bf[0] ) ) );
}
ntp-4.2.6p5/scripts/rc1/0000755000175000017500000000000011675461367014005 5ustar  peterpeterntp-4.2.6p5/scripts/rc1/preinstall0000644000175000017500000000011310017034603016052 0ustar  peterpeter#!/bin/sh
if [ -x /etc/init.d/xntp ]
then
	/etc/init.d/xntp stop
fi
exit 0
ntp-4.2.6p5/scripts/rc1/postinstall0000644000175000017500000000004110017034603016251 0ustar  peterpeter#!/bin/sh
/etc/init.d/xntp start
ntp-4.2.6p5/scripts/rc1/preremove0000644000175000017500000000005010017034603015701 0ustar  peterpeter#!/bin/sh
/etc/init.d/xntp stop

exit 0
ntp-4.2.6p5/scripts/rc1/xntp0000644000175000017500000000100110017034603014663 0ustar  peterpeter#!/bin/sh

killproc() {	# kill named processes
	pid=`/usr/bin/ps -e |
		/usr/bin/grep $1 |
		/usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
	[ "$pid" != "" ] && kill $pid
}

case "$1" in
'start')
	ps -e | grep xntpd > /dev/null 2>&1
	if [ $? -eq 0 ]
	then
		echo "ntp daemon already running. ntp start aborted"
		exit 0
	fi
	if [ -f /etc/inet/ntp.conf -a -x /usr/sbin/xntpd ]
	then
		/usr/sbin/xntpd -c /etc/inet/ntp.conf
	fi
	;;
'stop')
	killproc xntpd
	;;
*)
	echo "Usage: /etc/init.d/xntp { start | stop }"
	;;
esac
ntp-4.2.6p5/scripts/rc1/prototype0000644000175000017500000000152210017034603015747 0ustar  peterpeter!default 755 root bin
i pkginfo
i preinstall
i postinstall
i preremove
f none /etc/init.d/xntp=xntp 0755 root other
l none /etc/rc2.d/S79xntp=/etc/init.d/xntp
l none /etc/rc1.d/K79xntp=/etc/init.d/xntp
l none /etc/rc0.d/K79xntp=/etc/init.d/xntp
f none /usr/sbin/xntpd=xntpd/xntpd 0555 root other
f none /usr/sbin/xntpdc=xntpdc/xntpdc 0555 root other
f none /usr/sbin/ntpq=ntpq/ntpq 0555 root other
f none /usr/sbin/ntptrace=ntptrace/ntptrace 0555 root other
f none /usr/sbin/ntpdate=ntpdate/ntpdate 0555 root other
f none /usr/share/man/man1m/xntpd.1m=doc/xntpd.8 0444 root other
f none /usr/share/man/man1m/xntpdc.1m=doc/xntpdc.8 0444 root other
f none /usr/share/man/man1m/ntpdate.1m=doc/ntpdate.8 0444 root other
f none /usr/share/man/man1m/ntpq.1m=doc/ntpq.8 0444 root other
f none /usr/share/man/man1m/ntptrace.1m=doc/ntptrace.8 0444 root other
ntp-4.2.6p5/scripts/freq_adj.in0000644000175000017500000000442210017034601015375 0ustar  peterpeter#! @PATH_PERL@ -w

die "perl5 needed\n" unless ($] > 5);

use Getopt::Std;
use vars qw($opt_n);

getopts('d:nt:');

#chop($ncpu = `sysctl -n hw.ncpu`);
#die "Found $ncpu CPUs; can only be run on systems with 1 CPU.\n" if ($ncpu > 1);

$driftfile = "/etc/ntp.drift";
$driftfile = $opt_d if defined($opt_d);

chop($timer = `sysctl -n kern.timecounter.hardware 2> /dev/null`);

$timer =~ tr/\U/\L/;

if ($timer eq '') {
  open(DM, "/var/run/dmesg.boot");
  while() {
    # Timecounter "i8254"  frequency 1193182 Hz
    if (/^Timecounter "(\w+)"\s+/) {
      $timer = $1;
      last;
    }
  }
  close(DM);
}

$opt_t = $timer if !defined($opt_t);

if ($timer ne '') {		# $timer found...
  if ($opt_t ne  '') {		# - and $opt_t found
    if ($timer ne $opt_t) {	# - - and they differ
      warn "You specified a $opt_t timer but I detected a $timer timer.\n";
      usage();
      exit 1;
    } else {			# - - and they are the same
      ;
    }
  } else {			# - but no $opt_t specified; this is OK
    ;
  }
} else {			# No $timer found...
  if ($opt_t ne '') {		# - but $opt_t was specified
    $timer = $opt_t;		# - - so use it.
  } else {			# - and neither was $opt_t
    warn "I can't tell what timer you have.  Please specify one.\n";
    usage();
    exit 1;
  }
}

open(DF, $driftfile) || die "Can't open driftfile ($driftfile): $!\n";
while() {
    chop;
    if (/^(-?\d+\.\d+)(\s\d)?$/) {
	$drift = $1;
    } else {
	die "Bogus value in driftfile $driftfile: <$_>\n";
    }
}
close(DF);

print "NTP drift is <$drift>\n";

# Convert from NTP's idea of PPM to a decimal equivalent
$freq_adj = int ( $drift * ( 10 ** 6 / 2 ** 20) );
print "normalized freq_adj  is <$freq_adj>\n";

$freq_adj = int ( ( $freq_adj - 1 ) / 2 );
print "Applying freq_adj of <".-$freq_adj.">\n";

$sysctl = "machdep.".$timer."_freq";

chop($mach_freq = `sysctl -n $sysctl`);

print "$sysctl is <$mach_freq>\n";

$n_mach_freq = $mach_freq - $freq_adj;

if (defined($opt_n)) {
  print "$sysctl $mach_freq -> $n_mach_freq\n";
} else {
  print "i8254: ".`sysctl -w $sysctl=$n_mach_freq`;
}

sub usage {
  print STDERR < /tmp/version.m4+
    cmp -s /tmp/version.m4+ version.m4
    rc=$?
    case "$force$rc" in
     00)
	rm -f /tmp/version.m4+
	;;
     *)
	mv /tmp/version.m4+ version.m4
	;;
    esac
    ;;
esac

case "$outputs" in
 *version.def*)
    echo "version = '${dversion}';" > /tmp/version.def+
    cmp -s /tmp/version.def+ include/version.def
    rc=$?
    case "$force$rc" in
     00)
	rm -f /tmp/version.def+
	;;
     *)
	mv /tmp/version.def+ include/version.def
	;;
    esac
    ;;
esac

case "$outputs" in
 *version.texi*)
    echo "@set UPDATED `date +'%d %B %Y'`"	>  /tmp/version.texi+
    echo "@set EDITION $dversion"		>> /tmp/version.texi+
    echo "@set VERSION $dversion"		>> /tmp/version.texi+
    cmp -s /tmp/version.texi+ include/version.texi
    rc=$?
    case "$force$rc" in
     00)
	rm -f /tmp/version.texi+
	;;
     *)
	mv /tmp/version.texi+ include/version.texi
	;;
    esac
    ;;
esac
ntp-4.2.6p5/scripts/html2man.in0000755000175000017500000001444111606456561015373 0ustar  peterpeter#! @PATH_PERL@ -w
#
# html2man: Converts the NTP HTML documentation to man page format
#
# This file require the Perl HTML::TokeParser module:
# http://search.cpan.org/search?module=HTML::TokeParser
#
# Depending on where this is run from, you might need to modify $MANDIR below.
#
# Hacked together by Peter Boettcher 
# Last modified: 

require HTML::TokeParser;

# use strict;		# I can dream...

$MANDIR = "./man";

# HTML files to convert.  Also include per-file info here: 
#   name of man page, man section, 'see also' section
%manfiles = (
	     'ntpd' => ['ntpd', 8, 'ntp.conf(5), ntpq(8), ntpdc(8)'],
	     'ntpq' => ['ntpq', 8, 'ntp_decode(5), ntpd(8), ntpdc(8)'],
	     'ntpdate' => ['ntpdate', 8, 'ntpd(8)'],
	     'ntpdc' => ['ntpdc', 8, 'ntpd(8)'],
	     'ntptime' => ['ntptime', 8, 'ntpd(8), ntpdate(8)'],
	     'ntptrace' => ['ntptrace', 8, 'ntpd(8)'],
	     'ntp-wait' => ['ntp-wait', 8, 'ntpd(8)'],
	     'keygen' => ['ntp-keygen', 8, 'ntpd(8), ntp_auth(5)'],
	     'tickadj' => ['tickadj', 8, 'ntpd(8)'],
	     'confopt' => ['ntp.conf', 5, 'ntpd(8), ntp_auth(5), ntp_mon(5), ntp_acc(5), ntp_clock(5), ntp_misc(5)'],
	     'authopt' => ['ntp_auth', 5, 'ntp.conf(5), ntpd(8)'],
	     'monopt' => ['ntp_mon', 5, 'ntp.conf(5), ntp_decode(5)'],
	     'accopt' => ['ntp_acc', 5, 'ntp.conf(5)'],
	     'clockopt' => ['ntp_clock', 5, 'ntp.conf(5)'],
	     'decode' => ['ntp_decode', 5, 'ntpq(8), ntp_mon(5)'],
	     'miscopt' => ['ntp_misc', 5, 'ntp.conf(5)']);

%table_headers = (
    'ntpd' => 'l l l l.',
    'ntpq' => 'l l.',
    'monopt' => 'l l l.',
    'decode' => 'l l l l.',
    'authopt' => 'c c c c c c.'
);

# Disclaimer to go in SEE ALSO section of the man page
$seealso_disclaimer = "The official HTML documentation.\n\n" .
    "This file was automatically generated from HTML source.\n";

mkdir $MANDIR, 0777;
mkdir "$MANDIR/man8", 0777;
mkdir "$MANDIR/man5", 0777;

# Do the actual processing
foreach $file (keys %manfiles) {
    process($file);
}
# End of main function



# Do the real work
sub process {
    my($filename) = @_;
    $fileinfo = $manfiles{$filename};

    $p = HTML::TokeParser->new("$filename.html") || die "Can't open $filename.html: $!";
    $fileout = "$MANDIR/man$fileinfo->[1]/$fileinfo->[0].$fileinfo->[1]";
    open(MANOUT, ">$fileout")
	|| die "Can't open: $!";

    $p->get_tag("title");
    $name = $p->get_text("/title");
    $p->get_tag("hr");		# Skip past image and quote, hopefully

    # Setup man header
    print MANOUT ".TH " . $fileinfo->[0] . " " . $fileinfo->[1] .  "\n";
    print MANOUT ".SH NAME\n";
    $pat = $fileinfo->[0];
    if ($name =~ /$pat/) {
    } else {
	# Add the manpage name, if not in the HTML title already
	print MANOUT "$fileinfo->[0] - ";
    }
    print MANOUT "$name\n.SH \\ \n\n";

    @fontstack = ();
    $deflevel = 0;
    $pre = 0;
    $ignore = 0;
    $first_td = 1;
    # Now start scanning.  We basically print everything after translating some tags.
    # $token->[0] has "T", "S", "E" for Text, Start, End
    # $token->[1] has the tag name, or text (for "T" case)
    #  Theres lots more in the world of tokens, but who cares?
    while (my $token = $p->get_token) {
	if($token->[0] eq "T") {
	    my $text = $token->[1];
	    if (!$pre) {
		if($tag) {
		    $text =~ s/^[\n\t ]*//;
		}
		$text =~ s/^[\n\t ][\n\t ]+$//;
		$text =~ s/[\n\t ]+/ /g;
		$text =~ s/ \;/ /g;
		$text =~ s/>\;/>/g;
		$text =~ s/<\;/[0] eq "S") {
	    if($token->[1] eq "h4") {
		my $text = uc($p->get_trimmed_text("/h4"));
		# ignore these sections in ntpd.html
		if ($filename eq "ntpd" &&
		    ($text eq "CONFIGURATION OPTIONS")) {
			$ignore = 1;
			close(MANOUT);
			open(MANOUT, ">/dev/null");
		} elsif ($ignore) {
		    $ignore = 0;
		    close(MANOUT);
		    open(MANOUT, ">>$fileout");
		}
		print MANOUT "\n\n.SH $text\n";
	    }
	    if($token->[1] eq "tt") {
		push @fontstack, "tt";
		print MANOUT "\\fB";
	    }
	    if($token->[1] eq "i") {
		push @fontstack, "i";
		print MANOUT "\\fI";
	    }
	    if($token->[1] eq "address") {
		my $text = $p->get_trimmed_text("/address");
		print MANOUT "\n.SH AUTHOR\n$text\n";
	    }
	    if($token->[1] eq "dt" || $token->[1] eq "br" && $deflevel > 0) {
		print MANOUT "\n.TP 8\n";
		$tag = 1;
	    }
	    if($token->[1] eq "dd") {
		print MANOUT "\n";
		$tag = 1;
	    }
	    if($token->[1] eq "dl") {
		$deflevel+=1;
		if ($deflevel > 0) {
		    print MANOUT "\n.RS ", $deflevel > 1 ? 8 : 0;
		}
	    }
	    if($token->[1] eq "p") {
		print MANOUT "\n";
	    }
	    if($token->[1] eq "pre") {
		print MANOUT "\n.nf";
		$pre = 1;
	    }
	    if($token->[1] eq "table") {
		print MANOUT "\n.TS\n";
		print MANOUT "expand allbox tab(%);\n";
		print MANOUT $table_headers{$filename};
		print MANOUT "\n";
	    }
	    if($token->[1] eq "td") {
		if ($first_td == 0) {
		    print MANOUT " % ";
		}
		$first_td = 0;
	    }
	}
	elsif($token->[0] eq "E") {
	    if($token->[1] eq "h4") {
		$tag = 1;
	    }
	    if($token->[1] eq "tt") {
		$f = pop @fontstack;
		if($f ne "tt") {
		    warn "Oops, mismatched font!  Trying to continue\n";
		}
		if ($#fontstack < 0) { $fontswitch = "\\fR"; }
		elsif ($fontstack[$#fontstack] eq "tt") { $fontswitch = "\\fB"; }
		else { $fontswitch = "\\fI"; }
		print MANOUT "$fontswitch";
	    }
	    if($token->[1] eq "i") {
		$f = pop @fontstack;
		if($f ne "i") {
		    warn "Oops, mismatched font!  Trying to continue\n";
		}
		if ($#fontstack < 0) { $fontswitch = "\\fR"; }
		elsif ($fontstack[$#fontstack] eq "tt") { $fontswitch = "\\fB"; }
		else { $fontswitch = "\\fI"; }
		print MANOUT "$fontswitch";
	    }
	    if($token->[1] eq "dl") {
		if ($deflevel > 0) {
		    print MANOUT "\n.RE";
		}
		print MANOUT "\n";
		$deflevel-=1;
	    }
	    if($token->[1] eq "p") {
		print MANOUT "\n";
		$tag = 1;
	    }
	    if($token->[1] eq "pre") {
		print MANOUT "\n.fi";
		$pre = 0;
	    }
	    if($token->[1] eq "table") {
		print MANOUT ".TE\n";
	    }
	    if($token->[1] eq "tr") {
		print MANOUT "\n";
		$first_td = 1;
	    }
	}
    }
    if ($ignore) {
	close(MANOUT);
	open(MANOUT, ">>$fileout");
    }
    print MANOUT "\n.SH SEE ALSO\n\n";
    print MANOUT "$fileinfo->[2]\n\n";
    print MANOUT "$seealso_disclaimer\n";
    close(MANOUT);
}
ntp-4.2.6p5/scripts/ntp-restart0000755000175000017500000000041210017034602015477 0ustar  peterpeter#!/bin/sh
#
# This script can be used to kill and restart the NTP daemon. Edit the
# /usr/local/bin/ntpd line to fit.
#
kill -INT `ps -ax | egrep "ntpd" | egrep -v "egrep" | sed 's/^\([ 0-9]*\) .*/\1'/`
sleep 10
/usr/local/bin/ntpd -g
/usr/local/bin/ntp-wait
exit 0
ntp-4.2.6p5/scripts/ntp-close0000755000175000017500000000033510017034602015124 0ustar  peterpeter#! /bin/sh

lynx -source http://www.eecis.udel.edu/~mills/ntp/clock2.htm |
	sed -n -e 's,).*,,' -e' /([0-9.]*$/s/.*(//p' |
	xargs ntpdate -q |
	sort -n +7 > /tmp/ntp-close

# From: Neal McBurnett 
ntp-4.2.6p5/scripts/mkver.in0000644000175000017500000000113011327015213014742 0ustar  peterpeter#!@PATH_SH@
PROG=${1-UNKNOWN}

ConfStr="$PROG"

ConfStr="$ConfStr @VERSION@"

case "$CSET" in
 '') ;;
 *) ConfStr="$ConfStr@$CSET" ;;
esac

case "@LCRYPTO@" in
 '') ;;
 -lcrypto)
    ConfStr="${ConfStr}-o" ;;
 *) ConfStr="${ConfStr}-?" ;;
esac

ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`"

if [ ! -f .version ]; then
  echo 0 > .version
fi
RUN="`cat .version`"
RUN="`expr $RUN + 1`"
echo $RUN > .version

ConfStr="$ConfStr (${RUN})"

echo "Version <${ConfStr}>";

rm -f version.c
cat > version.c << -EoF-
/*
 * version file for $PROG
 */
#include 
const char * Version = "${ConfStr}";
-EoF-
ntp-4.2.6p5/scripts/ntpsweep.in0000644000175000017500000001704110572523463015507 0ustar  peterpeter#! @PATH_PERL@ -w
#
# $Id$
#
# DISCLAIMER
# 
# Copyright (C) 1999,2000 Hans Lambermont and Origin B.V.
# 
# Permission to use, copy, modify and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appears in all copies and
# that both the copyright notice and this permission notice appear in
# supporting documentation. This software is supported as is and without
# any express or implied warranties, including, without limitation, the
# implied warranties of merchantability and fitness for a particular
# purpose. The name Origin B.V. must not be used to endorse or promote
# products derived from this software without prior written permission.
#
# Hans Lambermont 

require 5.0;		# But actually tested on 5.004 ;)
use Getopt::Long;       # GetOptions()
use strict;

my $version = 1.3;
(my $program = $0) =~ s%.*/(.+?)(.pl)?$%$1%;

# Hardcoded paths/program names
my $ntpdate = "ntpdate";
my $ntpq = "ntpq";

# no STDOUT buffering
$| = 1;

my ($help, $single_host, $showpeers, $maxlevel, $strip, $askversion);
my $res = GetOptions("help!"      => \$help,
		     "host=s"     => \$single_host,
		     "peers!"     => \$showpeers,
		     "maxlevel=s" => \$maxlevel,
		     "strip=s"    => \$strip,
		     "version!"   => \$askversion);

if ($askversion) {
    print("$version\n");
    exit 0;
}

if ($help || ((@ARGV != 1) && !$single_host)) {
    warn <|--maxlevel |--version] \\
    |[--host ]

Description:
  $program prints per host given in  the NTP stratum level, the
  clock offset in seconds, the daemon version, the operating system and
  the processor. Optionally recursing through all peers.

Options:
--help
    Print this short help text and exit.
--version
    Print version ($version) and exit.

    Specify hosts file. File format is one hostname or ip number per line.
    Lines beginning with # are considered as comment.
--host 
    Speficy a single host, bypassing the need for a hosts file.
--peers
    Recursively list all peers a host synchronizes to.
    An '= ' before a peer means a loop. Recursion stops here.
--maxlevel 
    Traverse peers up to this level (4 is a reasonable number).
--strip 
    Strip  from hostnames.

Examples:
    $program myhosts.txt --strip .foo.com
    $program --host some.host --peers --maxlevel 4
EOF
    exit 1;
}

my $hostsfile = shift;
my (@hosts, @known_hosts);
my (%known_host_info, %known_host_peers);

sub read_hosts()
{
    local *HOSTS;
    open (HOSTS, $hostsfile) ||
	die "$program: FATAL: unable to read $hostsfile: $!\n";
    while () {
	next if /^\s*(#|$)/; # comment/empty
	chomp;
	push(@hosts, $_);
    }
    close(HOSTS);
}

# translate IP to hostname if possible
sub ip2name {
    my($ip) = @_;
    my($addr, $name, $aliases, $addrtype, $length, @addrs);
    $addr = pack('C4', split(/\./, $ip));
    ($name, $aliases, $addrtype, $length, @addrs) = gethostbyaddr($addr, 2);
    if ($name) {
        # return lower case name
	return("\L$name");
    } else {
	return($ip);
    }
}

# item_in_list($item, @list): returns 1 if $item is in @list, 0 if not
sub item_in_list {
    my($item, @list) = @_;
    my($i);
    foreach $i (@list) {
	return 1 if ($item eq $i);
    }
    return 0;
}

sub scan_host($;$;$) {
    my($host, $level, @trace) = @_;
    my $stratum = 0;
    my $offset = 0;
    my $daemonversion = "";
    my $system = "";
    my $processor = "";
    my @peers;
    my $known_host = 0;

    if (&item_in_list($host, @known_hosts)) {
	$known_host = 1;
    } else {
	# ntpdate part
	open(NTPDATE, "$ntpdate -bd $host 2>/dev/null |") ||
    	die "Cannot open ntpdate pipe: $!\n";
	while () {
	    /^stratum\s+(\d+).*$/ && do {
		$stratum = $1;
	    };
	    /^offset\s+([0-9.-]+)$/ && do {
		$offset = $1;
	    };
	}
	close(NTPDATE);
    
	# got answers ? If so, go on.
	if ($stratum) {
	    # ntpq part
	    my $ntpqparams = "-c 'rv 0 processor,system,daemon_version'";
	    open(NTPQ, "$ntpq $ntpqparams $host 2>/dev/null |") ||
		die "Cannot open ntpq pipe: $!\n";
	    while () {
		/daemon_version="(.*)"/ && do {
		    $daemonversion = $1;
		};
		/system="([^"]*)"/ && do {
		    $system = $1;
		};
		/processor="([^"]*)"/ && do {
		    $processor = $1;
		};
	    }
	    close(NTPQ);
	    
	    # Shorten daemon_version string.
	    $daemonversion =~ s/(;|Mon|Tue|Wed|Thu|Fri|Sat|Sun).*$//;
	    $daemonversion =~ s/version=//;
	    $daemonversion =~ s/(x|)ntpd //;
	    $daemonversion =~ s/(\(|\))//g;
	    $daemonversion =~ s/beta/b/;
	    $daemonversion =~ s/multicast/mc/;
	
	    # Shorten system string
	    $system =~ s/UNIX\///;
	    $system =~ s/RELEASE/r/;
	    $system =~ s/CURRENT/c/;

	    # Shorten processor string
	    $processor =~ s/unknown//;
	}
    
	# got answers ? If so, go on.
	if ($daemonversion) {
	    # ntpq again, find out the peers this time
	    if ($showpeers) {
		my $ntpqparams = "-pn";
		open(NTPQ, "$ntpq $ntpqparams $host 2>/dev/null |") ||
		    die "Cannot open ntpq pipe: $!\n";
		while () {
		    /^No association ID's returned$/ && do {
			last;
		    };
		    /^     remote/ && do {
			next;
		    };
		    /^==/ && do {
			next;
		    };
		    /^( |x|\.|-|\+|#|\*|o)([^ ]+)/ && do {
			push(@peers, ip2name($2));
			next;
		    };
		    print "ERROR: $_";
		}
		close(NTPQ);
	    }
	}
    
	# Add scanned host to known_hosts array
	push(@known_hosts, $host);
	if ($stratum) {
	    $known_host_info{$host} = sprintf("%2d %9.3f %-11s %-12s %s",
		$stratum, $offset, substr($daemonversion,0,11),
		substr($system,0,12), substr($processor,0,9));
	} else {
	    # Stratum level 0 is consider invalid
	    $known_host_info{$host} = sprintf(" ?");
	}
	$known_host_peers{$host} = [@peers];
    }

    if ($stratum || $known_host) { # Valid or known host
	my $printhost = ' ' x $level . $host;
	# Shorten host string
	if ($strip) {
	    $printhost =~ s/$strip//;
	}
	# append number of peers in brackets if requested and valid
	if ($showpeers && ($known_host_info{$host} ne " ?")) {
	    $printhost .= " (" . @{$known_host_peers{$host}} . ")";
	}
	# Finally print complete host line
	printf("%-32s %s\n",
	    substr($printhost,0,32), $known_host_info{$host});
	if ($showpeers && (eval($maxlevel ? $level < $maxlevel : 1))) {
	    my $peer;
	    push(@trace, $host);
	    # Loop through peers
	    foreach $peer (@{$known_host_peers{$host}}) {
		if (&item_in_list($peer, @trace)) {
		    # we've detected a loop !
		    $printhost = ' ' x ($level + 1) . "= " . $peer;
		    # Shorten host string
		    if ($strip) {
			$printhost =~ s/$strip//;
		    }
		    printf("%-32s %s\n",
			substr($printhost,0,32));
		} else {
		    if (substr($peer,0,3) ne "127") {
			&scan_host($peer, $level + 1, @trace);
		    }
		}
	    }
	}
    } else { # We did not get answers from this host
	my $printhost = ' ' x $level . $host;
	# Shorten host string
	if ($strip) {
	    $printhost =~ s/$strip//;
	}
	printf("%-32s  ?\n", substr($printhost,0,32));
    }
}

sub scan_hosts()
{
    my $host;
    for $host (@hosts) {
	my @trace;
	push(@trace, $host);
	scan_host($host, 0, @trace);
    }
}

# Main program

if ($single_host) {
    push(@hosts, $single_host);
} else {
    &read_hosts($hostsfile);
}

# Print header
print < /dev/null 2>&1
    if [ $? -ne 0 ]
    then
        echo "$host not registered in DNS"
        continue
    fi

    ping $host 64 1 > /dev/null 2>&1 
    if [ $? -ne 0 ]
    then
        echo "$host not responding to ping"
	continue
    fi
    
    # Attempt to contact with version 3 ntp, then try version 2.
    for version in 3 2
    do

        ntpq -c "ntpversion $version" -p $host > $ntpqlog 2>&1

        if fgrep -s 'Connection refused' $ntpqlog
        then
            echo "$host refused ntpq connection"
            break
        fi

        responding=1
        fgrep -s 'timed out, nothing received' $ntpqlog > /dev/null && responding=0

        if   [ $responding -eq 1 ]
        then
	    ntpq -c "ntpversion $version" -c rl $host > $ntpqlog

            # First we extract the reference ID (usually a host or a clock)
            synchost=`fgrep "refid=" $ntpqlog`
            #synchost=${synchost##*refid=} # strip off the beginning of the line
            #synchost=${synchost%%,*}      # strip off the end  
	    synchost=`expr "$synchost" : '.*refid=\([^,]*\),.*'`

            # Next, we get the stratum
            stratum=`fgrep "stratum=" $ntpqlog`
            #stratum=${stratum##*stratum=}
            #stratum=${stratum%%,*}
	    stratum=`expr "$stratum" : '.*stratum=\([^,]*\),.*'`

	    echo "$host answers NTP version $version, stratum: $stratum, ref: $synchost"
            break;
        fi

	if [ $version -eq 2 -a $responding -eq 0 ]
        then
            echo "$host not responding to NTP"
        fi
    done
done
)
# ) >> $logfile

if [ -f $ntpqlog ]; then
    rm $ntpqlog
fi
ntp-4.2.6p5/scripts/genCommitLog0000755000175000017500000000050411510477207015615 0ustar  peterpeter#! /bin/sh

set -e

GCL_REMOVEWRITE=0
. ./packageinfo.sh
if [ ! -w . ] ; then
        GCL_REMOVEWRITE=1
        chmod u+w .
        [ -f CommitLog -a ! -w CommitLog ] && chmod u+w CommitLog
fi
bk changes -v -m -r${CLTAG}.. > CommitLog.new
mv CommitLog.new CommitLog
case "$GCL_REMOVEWRITE" in
 1) chmod a-w CommitLog .
esac
ntp-4.2.6p5/scripts/stats/0000755000175000017500000000000011675461367014456 5ustar  peterpeterntp-4.2.6p5/scripts/stats/peer.awk0000755000175000017500000000423110017034605016074 0ustar  peterpeter# awk program to scan peerstats files and report errors/statistics
#
# usage: awk -f peer.awk peerstats
#
# format of peerstats record
#  MJD    sec    ident   stat  offset (s)  delay (s)  disp (s)
# 49235 11.632 128.4.2.7 f414  -0.000041    0.21910   0.00084
#
# format of output dataset (time values in milliseconds)
# peerstats.19960706
#        ident     cnt     mean     rms      max     delay     dist     disp
# ==========================================================================
# 140.173.112.2     85   -0.509    1.345    4.606   80.417   49.260    1.092
# 128.4.1.20      1364    0.058    0.364    4.465    3.712   10.540    1.101
# 140.173.16.1    1415   -0.172    0.185    1.736    3.145    5.020    0.312
#...
#
BEGIN {
	n = 0
	MAXDISTANCE = 1.0
}
#
# scan all records in file
#
# we toss out all distances greater than one second on the assumption the
# peer is in initial acquisition
#
{
	if (NF >= 7 && ($7 + $6 / 2) < MAXDISTANCE) {
		i = n
		for (j = 0; j < n; j++) {
			if ($3 == peer_ident[j])
				i = j
		}
		if (i == n) {
			peer_ident[i] = $3
			peer_tmax[i] = peer_dist[i] = -1e9
			peer_tmin[i] = 1e9
			n++
		}
		peer_count[i]++
		if ($5 > peer_tmax[i])
			peer_tmax[i] = $5
		if ($5 < peer_tmin[i])
			peer_tmin[i] = $5
		dist = $7 + $6 / 2
		if (dist > peer_dist[i])
			peer_dist[i] = dist
		peer_time[i] += $5
		peer_time_rms[i] += $5 * $5
		peer_delay[i] += $6
		peer_disp[i] +=  $7
	}
} END {
	printf "       ident     cnt     mean     rms      max     delay     dist     disp\n"
	printf "==========================================================================\n"
	for (i = 0; i < n; i++) {
		peer_time[i] /= peer_count[i]
                peer_time_rms[i] = sqrt(peer_time_rms[i] / peer_count[i] - peer_time[i] * peer_time[i])
		peer_delay[i] /= peer_count[i]
		peer_disp[i] /= peer_count[i]
		peer_tmax[i] = peer_tmax[i] - peer_time[i]
		peer_tmin[i] = peer_time[i] - peer_tmin[i]
		if (peer_tmin[i] > peer_tmax[i])
			peer_tmax[i] = peer_tmin[i]
		printf "%-15s%5d%9.3f%9.3f%9.3f%9.3f%9.3f%9.3f\n", peer_ident[i], peer_count[i], peer_time[i] * 1e3, peer_time_rms[i] * 1e3, peer_tmax[i] * 1e3, peer_delay[i] * 1e3, peer_dist[i] * 1e3, peer_disp[i] * 1e3
	}
}
ntp-4.2.6p5/scripts/stats/ensemble.S0000755000175000017500000000057110017034604016355 0ustar  peterpeterensemble <- scan(file1, list(day=0, sec=0, gps=0, gpsw=0, loran=0, loranw=0, ensemble=0, std=0))
str <- paste("eps/", file1, ".eps", sep="")
postscript(str,  ,  ,  , 5, pointsize=18)
par(mgp=c(1, 0, 0), tck = 0.03, mar = c(2, 2, 1, 1))
plot(ensemble$sec, ensemble$ensemble, type="l", xlab=paste("MJD", ensemble$day, "Time (s)"), ylab="Ensemble Offset (ns)", ylim=c(-400, 400))
ntp-4.2.6p5/scripts/stats/etf.S0000755000175000017500000000133210017034604015335 0ustar  peterpeteroptions(digits=4)
file2 <- "etf_summary"
etf <- scan(file1, list(day=0, sec=0, offset=0, stab=0))
r <- lsfit(etf$sec, etf$offset)
count<-length(etf$sec)
mean<-r$coef[[1]]
std<-sqrt(var(r$residuals))
slope<-r$coef[[2]] * 1000 
cat("\n", file=file2 , append=TRUE, fill=FALSE, sep="")
cat(file1, "\n", file=file2, append=TRUE, fill=FALSE, sep="")
cat("etf1 ",  count, ", T ", mean, " ns, R ", slope, " ps/s, std ", std, " us\n", file=file2, append=TRUE, fill=FALSE, sep="")
str <- paste("eps/", file1, ".eps", sep="")
postscript(str,  ,  ,  , 5, pointsize=18)
par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1))
plot(etf$sec, etf$offset, type="l", xlab=paste("MJD", etf$day, "Time (s)"), ylab="External Offset (ns)", ylim=c(-400, 400))
ntp-4.2.6p5/scripts/stats/clock.awk0000755000175000017500000002433010017034604016235 0ustar  peterpeter# awk program to scan clockstat files and report errors/statistics
#
# usage: awk -f check.awk clockstats
#
# This program works for the following radios:
# PST/Traconex 1020 WWV reciever
# Arbiter 1088 GPS receiver
# Spectracom 8170/Netclock-2 WWVB receiver
# IRIG audio decoder
# Austron 2200A/2201A GPS receiver (see README.austron file)
#
BEGIN {
	etf_min = osc_vmin = osc_tmin = 1e9
	etf_max = osc_vmax = osc_tmax = -1e9
}
#
# scan all records in file
#
{
	#
	# select PST/Traconex WWV records
	# 00:00:37.234  96/07/08/190 O6@0:5281825C07510394
	#
	if (NF >= 4 && $3 == "127.127.3.1") {
		if (substr($6, 14, 4) > "0010")
			wwv_sync++
		if (substr($6, 13, 1) == "C")
			wwv_wwv++
		if (substr($6, 13, 1) == "H")
			wwv_wwvh++
		x = substr($6, 12, 1)
		if (x == "1")
			wwv_2.5++
		else if (x == "2")
			wwv_5++
		else if (x == "3")
			wwv_10++
		else if (x == "4")
			wwv_15++
		else if (x == "5")
			wwv_20++
		continue
	}
	#
	# select Arbiter GPS records
	# 96 190 00:00:37.000 0 V=08 S=44 T=3 P=10.6 E=00
	# N39:42:00.951 W075:46:54.880 210.55      2.50 0.00
	#
	if (NF >= 4 && $3 == "127.127.11.1") {
		if (NF > 8) {
			arb_count++
			if ($7 != 0)
				arb_sync++
			x = substr($10, 3, 1)
			if (x == "0")
				arb_0++
			else if (x == "1")
				arb_1++
			else if (x == "2")
				arb_2++
			else if (x == "3")
				arb_3++
			else if (x == "4")
				arb_4++
			else if (x == "5")
				arb_5++
			else if (x == "6")
			arb_6++
		} else if (NF == 8) {
			arbn++
			arb_mean += $7
			arb_rms += $7 * $7
			if (arbn > 0) {
				x = $7 - arb_val
				arb_var += x * x
			}
			arb_val = $7
		}
		continue
	}
	#
	# select Spectracom WWVB records
	# see summary for decode
	#   96 189 23:59:32.248  D
	#
	if (NF >= 4 && $3 == "127.127.4.1") {
		if ($4 == "SIGNAL" || NF > 7)
			printf "%s\n", $0
		else {
			wwvb_count++
			if ($4 ~ /\?/)
				wwvb_x++
			else if ($4 ~ /A/)
				wwvb_a++
			else if ($4 ~ /B/)
				wwvb_b++
			else if ($4 ~ /C/)
				wwvb_c++
			else if ($4 ~ /D/)
				wwvb_d++
		}
		continue
	}
	#
	# select IRIG audio decoder records
	# see summary for decode
	#
	if (NF >= 4 && $3 == "127.127.6.0") {
		irig_count++
		if ($5 ~ /\?/)
			irig_error++
		continue
	}
	#
	# select Austron GPS LORAN ENSEMBLE records
	# see summary for decode
	#
	else if (NF >= 13 && $6 == "ENSEMBLE") {
		ensemble_count++
		if ($9 <= 0)
			ensemble_badgps++
		else if ($12 <= 0)
			ensemble_badloran++
		else {
			if ($13 > 200e-9 || $13 < -200e-9)
				ensemble_200++
			else if ($13 > 100e-9 || $13 < -100e-9)
				ensemble_100++
			ensemble_mean += $13
			ensemble_rms += $13 * $13
		}
		continue
	}
	#
	# select Austron LORAN TDATA records
	# see summary for decode; note that signal quality log is simply
	# copied to output
	#
	else if (NF >= 7 && $6 == "TDATA") {
                tdata_count++
                for (i = 7; i < NF; i++) {
                        if ($i == "M" && $(i+1) == "OK") {
                                i += 5
                                m += $i
                		tdata_m++
		        }
                        else if ($i == "W" && $(i+1) == "OK") {
                                i += 5
                                w += $i
                        	tdata_w++
			}
                        else if ($i == "X" && $(i+1) == "OK") {
                                i += 5
                                x += $i
                        	tdata_x++
			}
                        else if ($i == "Y" && $(i+1) == "OK") {
                                i += 5
                                y += $i
                        	tdata_y++
			}
                        else if ($i == "Z" && $(i+1) == "OK") {
                                i += 5
                                z += $i
                        	tdata_z++
			}
		}	
		continue
	}
	#
	# select Austron ITF records
	# see summary for decode
	#
	else if (NF >= 13 && $5 == "ITF" && $12 >= 100) {
		itf_count++
		if ($9 > 200e-9 || $9 < -200e-9)
			itf_200++
		else if ($9 > 100e-9 || $9 < -100e-9)
			itf_100++
		itf_mean += $9
		itf_rms += $9 * $9
		itf_var += $10 * $10
		continue
	}
	#
	# select Austron ETF records
	# see summary for decode
	#
	else if (NF >= 13 && $5 == "ETF" && $13 >= 100) {
		etf_count++
		if ($6 > etf_max)
			etf_max = $6
		else if ($6 < etf_min)
			etf_min = $6
		etf_mean += $6
		etf_rms += $6 * $6
		etf_var += $9 * $9
		continue
	}
	#
	# select Austron TRSTAT records
	# see summary for decode
	#
	else if (NF >= 5 && $5 == "TRSTAT") {
		trstat_count++
		j = 0
		for (i = 6; i <= NF; i++)
			if ($i == "T")
				j++
		trstat_sat[j]++
		continue
	}
	#
	# select Austron ID;OPT;VER records
	#
	# config GPS 2201A TTY1 TC1 LORAN IN OUT1 B.00 B.00 28-Apr-93
	#
	# GPS 2201A	receiver model
	# TTY1		rs232 moduel
	# TC1		IRIG module
	# LORAN		LORAN assist module
	# IN		input module
	# OUT1		output module
	# B.00 B.00	firmware revision
	# 28-Apr-9	firmware date3
        #
	else if (NF >= 5 && $5 == "ID;OPT;VER") {
		id_count++
		id_temp = ""
		for (i = 6; i <= NF; i++)
			id_temp = id_temp " " $i
		if (id_string != id_temp)
			printf "config%s\n", id_temp
		id_string = id_temp
		continue	
	}
	#
	# select Austron POS;PPS;PPSOFF records
	#
	# position +39:40:48.425 -075:45:02.392 +74.09 Stored UTC 0 200 0
	#
	# +39:40:48.425	position north latitude
	# -075:45:02.392 position east longitude
	# +74.09	elevation (meters)
	# Stored	position is stored
	# UTC		time is relative to UTC
	# 0 200 0	PPS offsets
	#
	else if (NF >= 5 && $5 == "POS;PPS;PPSOFF") {
		pos_count++
		pos_temp = ""
		for (i = 6; i <= NF; i++)
			pos_temp = pos_temp " " $i
		if (pos_string != pos_temp)
			printf "position%s\n", pos_temp
		pos_string = pos_temp
	continue
	}
	#
	# select Austron OSC;ET;TEMP records
	#
	# loop 1121 Software Control Locked
	#
	# 1121		oscillator type
	# Software Control loop is under software control
	# Locked	loop is locked
	#
	else if (NF >= 5 && $5 == "OSC;ET;TEMP") {
		osc_count++
		osc_temp = $6 " " $7 " " $8 " " $9
		if (osc_status != osc_temp)
			printf "loop %s\n", osc_temp
		osc_status = osc_temp
		if ($10 > osc_vmax)
			osc_vmax = $10
		if ($10 < osc_vmin)
			osc_vmin = $10
		if ($11 > osc_tmax)
			osc_tmax = $11
		if ($11 < osc_tmin)
			osc_tmin = $11
	continue
	}
	#
	# select Austron UTC records
	# these ain't ready yet
	#
	else if (NF >= 5 && $5 == "UTC") {
		utc_count++
		utc_temp = ""
		for (i = 6; i <= NF; i++)
			utc_temp = utc_temp " " $i
		if (utc_string != utc_temp)
#			printf "utc%s\n", utc_temp
                utc_string = utc_temp
	continue
	}
} END {
#
# PST/Traconex WWV summary data
#
	if (wwv_wwv + wwv_wwvh > 0)
		printf "wwv %d, wwvh %d, err %d, MHz (2.5) %d, (5) %d, (10) %d, (15) %d, (20) %d\n", wwv_wwv, wwv_wwvh, wwv_sync, wwv_2.5, wwv_5, wwv_10, wwv_15, wwv_20
#
# Arbiter 1088 summary data
#
# gps		record count
# err		error count
# sats(0-6)	satellites tracked
# mean		1 PPS mean (us)
# rms		1 PPS rms error (us)
# var		1 PPS Allan variance
#
	if (arb_count > 0) {
		printf "gps %d, err %d, sats(0-6) %d %d %d %d %d %d %d", arb_count, arb_sync, arb_0, arb_1, arb_2, arb_3, arb_4, arb_5, arb_6
		if (arbn > 1) {
			arb_mean /= arbn
			arb_rms = sqrt(arb_rms / arbn - arb_mean * arb_mean)
			arb_var = sqrt(arb_var / (2 * (arbn - 1)))
			printf ", mean %.2f, rms %.2f, var %.2e\n", arb_mean, arb_rms, arb_var * 1e-6
		} else {
			printf "\n"
		}
	}
#
# ensemble summary data
#
# ensemble	record count
# badgps	gps data unavailable
# badloran	loran data unavailable
# rms		ensemble rms error (ns)
# >200		ensemble error >200 ns
# >100		100 ns < ensemble error < 200 ns
#
	if (ensemble_count > 0) {
		ensemble_mean /= ensemble_count
		ensemble_rms = sqrt(ensemble_rms / ensemble_count - ensemble_mean * ensemble_mean) * 1e9 
		printf "ensemble %d, badgps %d, badloran %d, rms %.1f, >200 %d, >100 %d\n", ensemble_count, ensemble_badgps, ensemble_badloran, ensemble_rms, ensemble_200, ensemble_100
	}
#
# wwvb summary data
#
# wwvb		record count
# ?		unsynchronized
# >1		error > 1 ms
# >10		error > 10 ms
# >100		error > 100 ms
# >500		error > 500 ms
#
	if (wwvb_count > 0)
		printf "wwvb %d, ? %d, >1 %d, >10 %d, >100 %d, >500 %d\n", wwvb_count, wwvb_x, wwvb_a, wwvb_b, wwvb_c, wwvb_d
#
# irig summary data
#
# irig		record count
# err		error count
#
	if (irig_count > 0)
		printf "irig %d, err %d\n", irig_count, irig_error
#
# tdata summary data
#
# tdata		record count
# m		M master OK-count, mean level (dB)
# w		W slave OK-count, mean level (dB)
# x		X slave OK-count, mean level (dB)
# y		Y slave OK-count, mean level (dB)
# z		Z slave OK-count, mean level (dB)
#
	if (tdata_count > 0 ) {
		if (tdata_m > 0)
			m /= tdata_count
		if (tdata_x > 0)
			w /= tdata_count
		if (tdata_x > 0)
			x /= tdata_count
		if (tdata_y > 0)
			y /= tdata_count
		if (tdata_z > 0)
			z /= tdata_count
		printf "tdata %d, m %d %.1f, w %d %.1f, x %d %.1f, y %d %.1f, z %d %.1f\n", tdata_count, tdata_m, m, tdata_w, w, tdata_x, x, tdata_y, y, tdata_z, z
	}
#
# itf summary data
#
# itf		record count
# rms		itf rms error (ns)
# >200		itf error > 200 ns
# >100		itf error > 100 ns
# var		Allan variance
#
	if (itf_count > 1) { 
		itf_mean /= itf_count
		itf_rms = sqrt(itf_rms / itf_count - itf_mean * itf_mean) * 1e9
		itf_var = sqrt(itf_var / (2 * (itf_count - 1)))
		printf "itf %d, rms %.1f, >200 %d, >100 %d, var %.2e\n", itf_count, itf_rms, itf_200, itf_100, itf_var
	}
#
# etf summary data
#
# etf		record count
# mean		etf mean (ns)
# rms		etf rms error (ns)
# max		etf maximum (ns)
# min		etf minimum (ns)
# var		Allan variance
#
	if (etf_count > 0) {
                etf_mean /= etf_count
		etf_rms = sqrt(etf_rms / etf_count - etf_mean * etf_mean)
		etf_var = sqrt(etf_var / (2 * (etf_count - 1)))
		printf "etf %d, mean %.1f, rms %.1f, max %d, min %d, var %.2e\n", etf_count, etf_mean, etf_rms, etf_max, etf_min, etf_var
	}
#
# trstat summary data
#
# trstat	record count
# sat		histogram of tracked satellites (0 - 7)
#
	if (trstat_count > 0)
		printf "trstat %d, sat %d %d %d %d %d %d %d %d\n", trstat_count, trstat_sat[0], trstat_sat[1], trstat_sat[2], trstat_sat[2], trstat_sat[3], trstat_sat[4], trstat_sat[5], trstat_sat[6], trstat_sat[7]
#
# osc summary data
#
# osc		record count
# control	control midrange (V) +/- deviation (mV)
# temp		oven temperature midrange +/- deviation (deg C)
#
	if (osc_count > 0)
		printf "osc %d, control %.3f+/-%.3f, temp %.1f+/-%.2f\n", osc_count, (osc_vmax + osc_vmin) / 2, (osc_vmax - osc_vmin) / 2 * 1e3, (osc_tmax + osc_tmin) / 2, (osc_tmax - osc_tmin) / 2
}
ntp-4.2.6p5/scripts/stats/README.timecodes0000644000175000017500000001330010017034604017261 0ustar  peterpeterRadio Timecode Formats (README.timecodes)

Following are examples of the serial timecode formats used by various
timecode receivers as given in the instruction manuals. These examples
are intended only for illustration and not as the basis of system
design. The following symbols are used to identify the timecode
character that begins a subfield. The values given after this symbol
represent the character offset from the beginning of the timecode string
as edited to remove control characters.

C         on-time character (start bit)
Y         year of century
T         time of day
D         day of year or month/day
A         alarm indicator (format specific)
Q         quality indicator (format specific)
      ASCII line feed (hex 0a)
      ASCII carriage return (hex 0d)
      ASCII space (hex 20)

In order to promote uniform behavior in the various implementations, it
is useful to have a common interpretation of alarm conditions and signal
quality. When the alarm indicator it on, the receiver is not operating
correctly or has never synchronized to the broadcast signal. When the
alarm indicator is off and the quality indicator is on, the receiver has
synchronized to the broadcast signal, then lost the signal and is
coasting on its internal oscillator.

In the following uppercase letters, punctuation marks and spaces 
stand for themselves; lowercase letters stand for fields as described.
Special characters other than ,  and  are preceded by ^.

Spectracom 8170 and Netclock/2 WWV Synchonized Clock (format 0)

"i  ddd hh:mm:ss  TZ=zz"
 C       A  D   T

     poll: ?; offsets: Y = none, D = 3, T = 7, A = 0, Q = none
     i = synchronization flag ( = in synch, ? = out synch)
     ddd = day of year
     hh:mm:ss = hours, minutes, seconds
     zz = timezone offset (hours from UTC)

     Note: alarm condition is indicated by other than  at A, which
     occurs during initial synchronization and when received signal has
     been lost for about ten hours

     example: "   216 15:36:43  TZ=0"
               A  D   T

Netclock/2 WWV Synchonized Clock (format 2)

"iqyy ddd hh:mm:ss.fff ld"
 C       AQY  D   T

     poll: ?; offsets: Y = 2, D = 5, T = 9, A = 0, Q = 1
     i = synchronization flag ( = in synch, ? = out synch)
     q = quality indicator ( < 1ms, A < 10 ms, B < 100 ms, C < 500
     ms, D > 500 ms)
     yy = year (as broadcast)
     ddd = day of year
     hh:mm:ss.fff = hours, minutes, seconds, milliseconds of day
     l = leap-second warning (L indicates leap at end of month)
     d = standard/daylight time indicator ( standard, D daylight)

     Note: alarm condition is indicated by other than  at A, which
     occurs during initial synchronization and when received signal has
     been lost for about ten hours; unlock condition is indicated by
     other than  at Q, with time since last lock indicated by the
     letter code A < 13 min, B < 1.5 hr, C < 7 hr, D > 7 hr.

     example: "  92 216 15:36:43.640  D"
               AQ   D   T

TrueTime 468-DC Satellite Synchronized Clock (and other TrueTime
receivers)

"<^A>ddd:hh:mm:ssq"
              D   T       QC

     poll: none; offsets: Y = none, D = 0, T = 4, A = 12, Q = 12
     hh:mm:ss = hours, minutes, seconds
     q = quality/alarm indicator ( = locked, ? = alarm)

     Note: alarm condition is indicated by ? at A, which occurs during
     initial synchronization and when received signal is lost for an
     extended period; unlock condition is indicated by other than 
     at Q

     example: "216:15:36:43 "
               D   T       Q

Heath GC-1000 Most Accurate Clock (WWV/H)

"hh:mm:ss.f     dd/mm/yy"
 C   T        A     D

     poll: none; offsets: Y = none, D = 15, T = 0, A = 9, Q = none
     hh:mm:ss = hours, minutes, seconds
     f = deciseconds (? when out of spec)
     dd/mm = day, month
     yy = year of century (from DIPswitches)

     Note: 0?:??:??.? is displayed before synch is first established and
     hh:mm:ss.? once synch is established and then lost again for about
     a day.

     example: "15:36:43.6     04/08/91"
               T        A     D     Y

PST/Traconex 1020 Time Source (WWV/H) (firmware revision V4.01)

"frdzycchhSSFTttttuuxx" "ahh:mm:ss.fffs" "yy/dd/mm/ddd"
          A   Q               T                   Y  D

     poll: "QMQDQT"; offsets: Y = 0, D = 3 T = 1,, A = 11, Q = 13
     f = frequency enable (O = all frequencies enabled)
     r = baud rate (3 = 1200, 6 = 9600)
     d = features indicator (@ = month/day display enabled)
     z = time zone (0 = UTC)
     y = year (5 = 1991)
     cc = WWV propagation delay (52 = 22 ms)
     hh = WWVH propagation delay (81 = 33 ms)
     SS = status (80 or 82 = operating correctly)
     F = current receive frequency (1-5 = 2.5, 5, 10, 15, 20 MHz)
     T = transmitter (C = WWV, H = WWVH)
     tttt = time since last update (minutes)
     uu = flush character (03 = ^C)
     xx = 94 (unknown) (firmware revision X4.01.999 only)

     a = AM/PM indicator (A = AM, P = PM,  - 24-hour format)
     hh:mm:ss.fff = hours, minutes, seconds, milliseconds of day
     s = daylight-saving indicator ( standard, D daylight)

     yy = year of century (from DIPswitches)
     dd/mm/ddd = day of month, month of year, day of year

     Note: The alarm condition is indicated by other than ? at A, which
     occurs during initial synchronization and when received signal is
     lost for an extended period. A receiver unlock condition is
     indicated by other than "0000" in the tttt subfield at Q.

     example: "O3@055281824C00000394 91/08/04/216  15:36:43.640"
                             T       Y        D    T

David L. Mills
University of Delaware
mills@udel.edu
23 October 1993
ntp-4.2.6p5/scripts/stats/loop_summary0000755000175000017500000000002210017034605017100 0ustar  peterpeter 
loopstats.[1-9]
ntp-4.2.6p5/scripts/stats/ensemble.awk0000755000175000017500000000131510017034604016732 0ustar  peterpeter# program to produce loran ensemble statistics from clockstats files
#
# usage: awk -f ensemble.awk clockstats
#
# format of input record (time values in seconds)
# 49165 8.628 127.127.10.1 93:178:00:00:07.241 LORAN ENSEMBLE
# -6.43E-08 +5.02E-08 .091 +5.98E-08 +1.59E-08 .909 +4.85E-08 +3.52E-08
#
# format of output record (time values in nanoseconds)
#  MJD       sec     GPS    wgt    LORAN   wgt      avg   sigma
# 49165     8.628   -64.3  0.091    59.8  0.909    48.5    35.2
#
# select LORAN ENSEMBLE records with valid format and weights
{
	if (NF >= 14 && $6 == "ENSEMBLE" && $9 > 0 && $12 > 0)
		printf "%5s %9.3f %7.1f %6.3f %7.1f %6.3f %7.1f %7.1f\n", $1, $2, $7*1e9, $9, $10*1e9, $12, $13*1e9, $14*1e9
}
ntp-4.2.6p5/scripts/stats/summary.sh0000755000175000017500000000343310017034605016471 0ustar  peterpeter#!/bin/sh
#
# Script to summarize ipeerstats, loopstats and clockstats files
#
# This script can be run from a cron job once per day, week or month. It
# runs the file-specific summary script and appends the summary data to 
# designated files.
#
DATE=`date +20%y%m%d`
S=/usr/local/bin/S
SIN=S.in
SOUT=S.out
LOOP=loop_summary
PEER=peer_summary
CLOCK=clock_summary

rm -f $SIN $SOUT

#
# Summarize loopstats files
#
for f in loopstats.[12][0-9][0-9][0-9][0-1][0-9][0-3][0-9]; do
	d=`echo $f | cut -f2 -d.`
	if [ -f $f ] && [ $DATE != $d ]; then
		echo " " >>$LOOP
		echo $f >>$LOOP
		awk -f loop.awk $f >>$LOOP
		if [ -f $S ]; then
			echo "file1<-"\"${f}\" >>$SIN
			echo "source("\""loop.S"\"")" >>$SIN
			echo "unix("\""rm ${f}"\"")" >>$SIN
		else
			rm -f $f
		fi
	fi
done

#
# Summarize peerstats files
#
for f in peerstats.199[4-9][0-1][0-9][0-3][0-9]; do
	d=`echo $f | cut -f2 -d.`
	if [ -f $f ] && [ $DATE != $d ]; then
		echo " " >>$PEER
		echo $f >>$PEER
		awk -f peer.awk $f >>$PEER
		rm -f $f
	fi
done

#
# Summarize clockstats files
#
for f in clockstats.199[4-9][0-1][0-9][0-3][0-9]; do
	d=`echo $f | cut -f2 -d.`
	if [ -f $f ] && [ $DATE != $d ]; then
		echo " " >>$CLOCK
		echo $f >>$CLOCK
		awk -f clock.awk $f >>$CLOCK
		if [ -f /dev/gps[0-9] ]; then
			awk -f itf.awk $f >itf.$d
			awk -f etf.awk $f >etf.$d
			awk -f ensemble.awk $f >ensemble.$d
			awk -f tdata.awk $f >tdata.$d
		fi
		rm -f $f
	fi
done

#
# Process clockstat files with S and generate PostScript plots
#
for f in itf etf ensemble tdata; do
	for d in ${f}.199[4-9][0-1][0-9][0-3][0-9]; do
		if [ -f $d ]; then
			if [ -f $S ]; then
				echo "file1<-"\"${d}\" >>$SIN
				echo "source("\"${f}.S\"")" >>$SIN
				echo "unix("\""rm ${d}"\"")" >>$SIN
			else
				rm -f $d
			fi
		fi
	done
done
if [ -f $SIN ]; then
	$S BATCH $SIN $SOUT
fi
ntp-4.2.6p5/scripts/stats/loop.S0000755000175000017500000000056410017034604015536 0ustar  peterpeteroptions(digits=4)
loop <- scan(file1, list(day=0, sec=0, offset=0, freq=0, tc=0))
loop$offset <- loop$offset * 1e6
str <- paste("eps/", file1, ".eps", sep="")
postscript(str,  ,  ,  , 5, pointsize=18)
par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1))
plot(loop$sec, loop$offset, type="l", xlab=paste("MJD", loop$day, "Time (s)"), ylab="PLL Offset (us)", ylim=c(-400, 400))
ntp-4.2.6p5/scripts/stats/dupe.awk0000755000175000017500000000011710017034604016074 0ustar  peterpeter#
# delete duplicate lines
#
{
	if (old != $0)
		printf "%s\n", $0
	old = $0
}
ntp-4.2.6p5/scripts/stats/README.stats0000644000175000017500000002222710017034604016453 0ustar  peterpeterStatistics file formats (README.stats)

The xntp3 daemon can produce a variety of statistics files which are
useful for maintenance, evaluation and retrospective calibration
purposes. See the xntpd.8 man page for instructions on how to configure
this feature. Since these files can become rather large and cumbersome,
they are ordinarily reduced to summary form by running the summary.sh
shell script once per day, week or month, as appropriate. There are
three file collections presently defined: peerstats, loopstats and
clockstats, each of which is described in this note.

peerstats

The following data are collected in the peerstats files. The files are
reduced to summary data using the peer.sh shell script. See the peer.awk
script for further information. A line in the file is produced upon
reception of each valid update from a configured peer.

  49236 30.756 140.173.96.1 9474 0.000603 0.37532

  49236             modified Julian day number
  30.756            time of day (s) past midnight UTC
  140.173.96.1      peer identifier (IP address or receiver identifier)
  9474              peer status word (hex) (see NTP specification)
  0.000603          offset (s)
  0.08929           delay (s)
  0.37532           dispersion (s)

loopstats

The following data are collected in the loopstats files. The files are
reduced to summary data using the loop.sh shell script. See the loop.awk
script for further information. A line in the file is produced at each
valid update of the local clock.

  49236 11.897 -0.000004 -35.9384 0

  49236             modified Julian day number
  11.897            time of day (s) past midnight UTC
  -0.000004         time offset (s)
  -35.9384          frequency offset (ppm)
  0                 phase-lock loop time constant

clockstats

The following data are collected in the clockstats files. The files are
reduced to summary data using the clock.sh shell script, which also
updates the ensemble, etf, itf and tdata data files as well. See the
clock.awk, ensemble.awk, etf.awk, itf.awk and tdta.awk scripts for
further information. A line in the file is produced at each valid update
received from a configured radio clock. Data are at present recorded for
several radios. The first part of each data line is similar for all
radios, e.g.:

  49234 60517.826 127.127.4.1   93 247 16:48:21.814

  49234             modified Julian day number
  60517.826         time of day (s) past midnight UTC
  127.127.4.1       receiver identifier (Spectracom 8170/Netclock-2)
  93 247 16:48:21.814  timecode (format varies)

In the case of the Austron GPS receiver, a good deal of additional
information is extracted from the radio, as described below. The formats
shown consist of one line with all the fields shown in order. The
timecode formats specific to each radio follow. See the file
README.timecodes for detailed information on the timecode formats used
by these radios.

Spectracom 8170/Netclock-2 WWVB receiver

  49234 60517.826 127.127.4.1 ?A93 247 16:48:21.814

  The '?' and 'A' characters are present only when the receiver is
  unsynchronized; otherwise, they are replaced by space ' ' characters.

IRIG audio decoder

  49234 60517.826 127.127.6.0 247 16:48:21?

  The '?' character is present only when the receiver is unsynchronized.

Austron 2200A/2201A GPS receiver

  49234 60580.843 127.127.10.1 93:247:16:49:24.814?

  The '?' character is present only when the receiver is unsynchronized.

Depending on the installed options, the Austron 2200A/2201A recognizes a
number of special commands that report various data items. See the
refclock_as2201.c source module for a list of the commands used. These
data are collected only if the following line is included in the
configuration file ntp.conf:

  fudge 127.127.10.1 flag4 1    # enable extended statistics collection

The format of each data line returned is summarized in the following
list.

External time/frequency data (requires input buffer option IN)

These data determine the deviations of external time/frequency inputs
relative to receiver oscillator time. The following data are typical
using an external cesium oscillator PPS and 5-MHz outputs.

  49234 60580.843 127.127.10.1 93:247:16:49:24.814 ETF

  -85.9             time interval (ns)
  -89.0             average time interval (ns)
  4.0               time interval sigma (ns)
  +1.510E-11        time interval rate
  -4.500E-11        deltaf/f
  +1.592E-11        average deltaf/f
  5.297E-13         sigma deltaf/f
  500               number of samples

Model and option identifiers

These data show the receiver model number and option configuration.

  49234 60708.848 127.127.10.1 93:247:16:51:32.817 ID;OPT;VER

  GPS 2201A         model ident (must be "GPS 2200A" or "GPS 2201A")
  TTY1              rs232 option present (required)
  TC1               IRIG option present (optional)
  LORAN             LORAN assist option present (optional)
  IN                input buffer option present (optional)
  OUT1              output buffer option present (required)
  B.00              data processor software version ("B.00" or later)
  B.00              signal processor software version ("B.00" or later)
  28-Apr-93         software version date ("28-Apr-93" or later)

Internal time/frequency data

These data determine the deviations of the receiver oscillator with
respect to satellite time.

  49234 60564.846 127.127.10.1 93:247:16:49:08.816 ITF

  COCO              current mode (must be "COCO")
  0                 code coast mode (must be zero)
  +6.6152E-08       code sigma (s)
  -3.5053E-08       code delta t (s)
  -4.0361E-11       deltat/t
  -6.4746E-11       oscillator ageing rate
  500.00            loop time constant
  4.984072          electrical tuning (V)

GPS/LORAN ensemble data (requires LORAN assist option LORAN)

These data determine the deviations and weights to calculate ensemble
time from GPS and LORAN data.

  49234 60596.852 127.127.10.1 93:247:16:49:40.812 LORAN ENSEMBLE

  +9.06E-08         GPS t (s)
  +3.53E-08         GPS sigma (s)
  .532              GPS weight
  +3.71E-08         LORAN t (s)
  +3.76E-08         LORAN sigma (s)
  .468              LORAN weight
  +6.56E-08         ensemble t
  +6.94E-08         ensemble sigma (s)

LORAN stationkeeping data (requires LORAN assist option LORAN)

These data determine which stations of the LORAN chain are being
tracked, together with individual signal/noise ratios, deviations and
weights.

  49234 60532.850 127.127.10.1 93:247:16:48:36.820 LORAN TDATA

  M                 station identifier; data follows
  OK                status (must be "OK" for tracking)
  0                 cw flag
  0                 sw flag
  1162.17           time of arrival
  -4.6              snr (-30.0 if not "OK" status)
  1.67E-07          2-sample phase-time deviation
  .507              weight (included only if "OK" status)
  W AQ 0 0 3387.80 -31.0  station identifier and data
  X OK 0 0 1740.27 -11.2 2.20E-07 .294  station identifier and data
  Y OK 0 0 2180.71 -4.6 2.68E-07 .198  station identifier and data
  Z CV 0 0 3392.94 -30.0  station identifier and data

Oscillator status and environment

These data determine the receiver oscillator type, mode, status and
environment. Nominal operating conditions are shown below.

  49234 60628.847 127.127.10.1 93:247:16:50:12.817 OSC;ET;TEMP

  1121 Software     Control  oscillator model and mode (must be
                    "Software Control")
  Locked            status (must be "Locked")
  4.979905          electrical tuning (V)
  44.81             oscillator cavity temperature

Receiver position, status and offsets

These data determine the receiver position and elevation, together with
programmable delay corrections for the antenna cable and receiver.

  49234 60788.847 127.127.10.1 93:247:16:52:52.817 POS;PPS;PPSOFF

  +39:40:48.425     receiver latitude (N)
  -075:45:02.392    receiver longitude (E)
  +74.09            receiver elevation (m)
  Stored            position status (must be "Stored")
  UTC               PPS/PPM alignment (must be "UTC")
  0                 receiver delay (ns) (should be zero for calibrated
                    receiver)
  200               cable delay (ns)
  0                 user time bias (ns) (must be zero)

Satellite tracking status

These data determine how many satellites are being tracked. At the
present state of constellation development, there should be at least
three visible satellites in view. Much of the time the maximum of
seven are being tracked; rarely this number drops to two.

  49234 60612.850 127.127.10.1 93:247:16:49:56.820 TRSTAT

  24 T              satellite prn and status (T = track, A = acquire)
  16 A 13 T 20 T 18 T 07 T 12 T  list continued

UTC leap-second information

These data determine when the next leap second is to occur. The exact
method to use is obscure.

  49234 60548.847 127.127.10.1 93:247:16:48:52.818 UTC

  -1.2107E-08       A0 term (s)
  -1.2790E-13       A1 term (s)
  +9.0000E+00       current leap seconds (s)
  +2.0480E+05       time for leap seconds (s)
  +2.0100E+02       week number for delta leap (weeks)
  +1.9100E+02       week number for future leap (weeks)
  +4.0000E+00       day number for future leap (days)
  +9.0000E+00       future leap seconds (s)

David L. Mills
University of Delaware
mills@udel.edu
23 October 1993
ntp-4.2.6p5/scripts/stats/tdata.S0000755000175000017500000000045710017034605015664 0ustar  peterpetertdata <- scan(file1, list(day=0, sec=0, m=0, w=0, x=0, y=0, z=0))
str <- paste("eps/", file1, ".eps", sep="")
postscript(str,  ,  ,  , 5, pointsize=18)
par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1))
plot(tdata$sec, tdata$m, type="l", xlab=paste("MJD", tdata$day, "Time (s)"), ylab="LORAN-M SNR (dB)")
ntp-4.2.6p5/scripts/stats/etf.awk0000755000175000017500000000101110017034604015707 0ustar  peterpeter# program to produce external time/frequence statistics from clockstats files
#
# usage: awk -f etf.awk clockstats
#
# format of input record
# 49165 40.473 127.127.10.1 93:178:00:00:39.238 ETF
# +175.0 +176.8 2.0 +3.729E-11 +1.000E-10 +3.511E-11 4.005E-13 500
#
# format of output record (time values in nanoseconds)
#  MJD      sec      time    freq
# 49165    40.473   175.0  3.729e-11
#
# select ETF records with valid format
{
	if (NF >= 9 && $5 == "ETF") {
		printf "%5s %9.3f %7.1f %10.3e\n", $1, $2, $6, $9
	}
}

ntp-4.2.6p5/scripts/stats/psummary.awk0000755000175000017500000000655510017034605017031 0ustar  peterpeter# program to scan peer_summary file and produce summary of daily summaries
#
# usage: awk -f psummary.awk peer_summary
#
# format of input records
# peerstats.19960706
#        ident     cnt     mean     rms      max     delay     dist     disp
# ==========================================================================
# 140.173.112.2     85   -0.509    1.345    4.606   80.417   49.260    1.092
# 128.4.1.20      1364    0.058    0.364    4.465    3.712   10.540    1.101
# ...
#
# format of output records (actual data from rackety.udel.edu)
#        host     days     mean       rms       max   >1  >5 >10 >50
# ==================================================================
# 127.127.22.1    1090     0.001     0.401    99.800  19  14  13  10
# 127.0.0.1       1188     0.060     1.622   105.004  78  65  51  32
# 127.127.4.1      586     0.000     0.000     0.000   0   0   0   0
# 140.173.64.1     975    -0.010     2.552   257.595 399 192 114   8
# 128.175.1.3     1121     0.447     8.637   204.123 479 460 397 147
# 140.173.16.1    1106     0.027     1.014   267.857 242  38  31  23
# 128.4.1.4       1119     0.023     1.037   267.748 223  41  34  23
# 128.4.1.2        850     1.202     1.654   267.704 196  53  45  34
# 128.4.1.20      1101     0.088     1.139   268.322 430 111  83  16
# 140.173.32.1     979    -0.949     2.344   257.671 396 217 136   7
# 140.173.112.2   1066     0.040     2.111   152.969 442 315 152  16
# 140.173.80.1    1059     0.019     1.858    87.690 438 348 150   9
# 140.173.96.1    1015     0.110     2.007   266.744 399 314 170  17
# 140.173.128.1   1103    -0.002     2.600   257.672 465 262 132  13
# 140.222.135.1    347    -4.626     8.804   196.394 135 135 134  95
# 140.173.128.2   1081    -0.046     2.967   261.448 463 342 172  17
# 140.222.141.1    354     0.820     8.809   195.333 142 141 139 100
# 140.173.144.2   1058    -0.107     2.805   270.498 448 341 163  17
# 140.222.134.1    354    -0.056     8.479   172.458 142 141 141 100
# 140.222.144.1    415    -1.456     9.964   191.684 161 161 161 123
# 140.222.136.1    234     0.902     7.707   182.431  62  62  62  48
# 128.175.1.1      774     0.890     4.838   266.799 358 291 200  83
# 127.127.10.1    1086    -0.002     1.462   231.128 240 239  60  57
# 140.173.48.2     576     0.016     4.092   350.512 213 126  88  16
# 128.4.1.11         3     0.000     0.000     0.000   0   0   0   0
# 128.4.1.26       386    -1.363    20.251   341.284 164 164 161 132
#
# select table beginning with "ident"
{
	if (NF < 8 || $1 == "ident")
		continue
	i = n
	for (j = 0; j < n; j++) {
		if ($1 == peer_ident[j])
			i = j
	}
	if (i == n) {
		peer_ident[i] = $1
		n++
	}
	peer_count[i]++
	if (($7 - $6 / 2) < 400) {
		peer_count[i]++
		peer_mean[i] += $3
		peer_var[i] += $4 * $4
		if ($5 > peer_max[i])
			peer_max[i] = $5
		if ($5 > 1)
			peer_1[i]++
		if ($5 > 5)
			peer_2[i]++
		if ($5 > 10)
			peer_3[i]++
		if ($5 > 50)
			peer_4[i]++
	}
} END {
	printf "       host     days    mean       rms       max   >1  >5 >10 >50\n"
	printf "==================================================================\n"
	for (i = 0; i < n; i++) {
		if (peer_count[i] <= 0)
			continue
		peer_mean[i] /= peer_count[i]
		peer_var[i] = sqrt(peer_var[i] / peer_count[i])
		printf "%-15s%4d%10.3f%10.3f%10.3f%4d%4d%4d%4d\n", peer_ident[i], peer_count[i], peer_mean[i], peer_var[i], peer_max[i], peer_1[i], peer_2[i], peer_3[i], peer_4[i]
	}
}
ntp-4.2.6p5/scripts/stats/itf.S0000755000175000017500000000047410017034604015347 0ustar  peterpeteritf <- scan(file1, list(day=0, sec=0, offset=0, stab=0))
str <- paste("eps/", file1, ".eps", sep="")
postscript(str,  ,  ,  , 5, pointsize=18)
par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1))
plot(itf$sec, itf$offset, type="l", xlab=paste("MJD", itf$day, "Time (s)"), ylab="Internal Offset (ns)", ylim=c(-400, 400))
ntp-4.2.6p5/scripts/stats/README0000644000175000017500000000353610017034603015317 0ustar  peterpeterStatistics processing scripts (README)

This directory contains a number of scripts for use with the filegen
facility. Those files ending in .awk are for the Unix awk utility, while
those ending in .sh are for the csh utility. Normally, the summary.sh
script is called from a cron job once per day. This script processes the
daily loopstats, peerstats and clockstats files produced by the daemon,
updates the loop_summary, peer_summary and clock_summary archive files,
and deletes the daily files.

In the case of the Austron 2201A GPS receiver, the clockstats file
contains a wealth of additional monitoring data. These data are summarized
and writted to the clock_summary file, then a series of special files are
constructed for later processing by the S utility.

The summary.sh script invokes a number of awk scripts to actually produce
the data. This may result in multiple scans of the same input file.
The input file is deleted after processing. In fact, the shell scripts will
process all input files found of the correct type in chronological order,
deleting each one as it is scanned, except the current day file.

The summary.sh script can produce input files for the S utility, if it
is found on the search path. This utility makes PostScript graphs of the
loopstats data for each day, as well as various statistics produced by
the Austorn 220aA GPS receiver. The S utility is automatically run
as a background job. Its control files have the .S extension.

The psummary.awk script can be used to scan the peer_summary file and
construct an historical reprise of the daily summaries. 

The file formats are documented in the README.stats file and in the
scripts themselves. Further detail on the radio clock ASCII timecode
formats and related data are in the README.timecode file.

David L. Mills
University of Delaware
mills@udel.edu
1 November 1993
Revised 12 April 1994 
ntp-4.2.6p5/scripts/stats/itf.awk0000755000175000017500000000104210017034604015717 0ustar  peterpeter# program to produce intewrnal time/frequence statistics from clockstats files
#
# usage: awk -f itf.awk clockstats
#
# format of input record
# 49227 67.846 127.127.10.1 93:240:00:00:51.816 ITF
# COCO 0 +2.0579E-07 -3.1037E-08 -7.7723E-11 +6.5455E-10 500.00 4.962819
#
# format of output record (time values in nanoseconds)
#  MJD      sec      time        freq
# 49227   67.846  +2.0579E-07  -7.7723E-11
#
# select ITF records with valid format
{
	if (NF >= 10 && $5 == "ITF") {
		printf "%5s %9.3f %7.1f %10.3e\n", $1, $2, $8 * 1e9, $10
	}
}

ntp-4.2.6p5/scripts/stats/tdata.awk0000755000175000017500000000217110017034605016237 0ustar  peterpeter# program to produce loran tdata statistics from clockstats files
#
# usage: awk -f tdata.awk clockstats
#
# format of input record (missing replaced by -40.0)
# 49228 36.852 127.127.10.1 93:241:00:00:20.812 LORAN TDATA
# M OK 0 0 1169.14 -7.4 3.16E-07 .424
# W CV 0 0 3329.30 -16.4 1.81E-06 
# X OK 0 0 1737.19 -10.5 3.44E-07 .358
# Y OK 0 0 2182.07 -9.0 4.41E-07 .218
#
# format of output record (time in nanoseconds, signal values in dB)
#  MJD      sec      time     M      W      X      Y      Z
# 49228    36.852   175.0   -7.4  -16.4  -10.5   -9.0
#
# select LORAN TDATA records with valid format
{
	if (NF >= 7 && $6 == "TDATA") {
		m = w = x = y = z = -40.0
		for (i = 7; i < NF - 5; i++) {
			if ($i == "M" && $(i+1) == "OK") {
				i += 5
				m = $i
			}
			else if ($i == "W" && $(i+1) == "OK") {
				i += 5
				w = $i
			}
			else if ($i == "X" && $(i+1) == "OK") {
				i += 5
				x = $i
			}
			else if ($i == "Y" && $(i+1) == "OK") {
				i += 5
				y = $i
			}
			else if ($i == "Z" && $(i+1) == "OK") {
				i += 5
				z = $i
			}
                }
		printf "%5s %9.3f %6.1f %6.1f %6.1f %6.1f %6.1f\n", $1, $2, m, w, x, y, z
	}
}

ntp-4.2.6p5/scripts/stats/loop.awk0000755000175000017500000000236010017034604016112 0ustar  peterpeter# awk program to scan loopstats files and report errors/statistics
#
# usage: awk -f loop.awk loopstats
#
# format of loopstats record
#  MJD    sec   time (s)  freq (ppm)  poll
# 49235  3.943  0.000016   22.4716    6
#
# format of output dataset (time values in milliseconds, freq in ppm)
# loopstats.19960706
# loop 1180, 0+/-11.0, rms 2.3, freq -24.45+/-0.045, var 0.019
#
BEGIN {
	loop_tmax = loop_fmax = -1e9
	loop_tmin = loop_fmin = 1e9
}
#
# scan all records in file
#
{
	if (NF >= 5) {
		loop_count++
		if ($3 > loop_tmax)
			loop_tmax = $3
		if ($3 < loop_tmin)
			loop_tmin = $3
		if ($4 > loop_fmax)
			loop_fmax = $4
		if ($4 < loop_fmin)
			loop_fmin = $4
		loop_time += $3
		loop_time_rms += $3 * $3
		loop_freq += $4
		loop_freq_rms += $4 * $4
	}
} END {
	if (loop_count > 0) {
		loop_time /= loop_count
                loop_time_rms = sqrt(loop_time_rms / loop_count - loop_time * loop_time)
		loop_freq /= loop_count
		loop_freq_rms = sqrt(loop_freq_rms / loop_count - loop_freq * loop_freq)
		printf "loop %d, %.0f+/-%.1f, rms %.1f, freq %.2f+/-%0.3f, var %.3f\n", loop_count, (loop_tmax + loop_tmin) / 2 * 1e6, (loop_tmax - loop_tmin) / 2 * 1e6, loop_time_rms * 1e6, (loop_fmax + loop_fmin) / 2, (loop_fmax - loop_fmin) / 2, loop_freq_rms
	}
}

ntp-4.2.6p5/scripts/cvo.sh0000755000175000017500000000631311455531713014436 0ustar  peterpeter#! /bin/sh

# Copyright 2002, 2009, 2010 Harlan Stenn.  Used by NTP with permission.
# Author: Harlan Stenn 

# Possible output formats:
#
# CVO=...		Shell variable
# CVO=... ; export CVO	Old-style exported envariable
# export CVO=...	New-style exported envariable
# setenv CVO ...	csh-style exported envariable

TS="$*"

CVO_raw=`config.guess`
CVO=$CVO_raw

set 1 `echo $CVO | tr '-' ' '`
shift

case "$#" in
 4) # eg: i686-pc-linux-gnu
    CVO_CPU=$1
    CVO_VENDOR=$2
    cvo_KERN=$3			# Note the capitalization...
    CVO_OS=$4
    case "$cvo_KERN" in
     linux)			# Braindamage.  We want OS, not kernel info
	if lsb_release > /dev/null 2>&1
	then
	    CVO_OS=`lsb_release --id --short | tr '[:upper:]' '[:lower:]'`
	    CVO_OS="$CVO_OS`lsb_release --release --short`"
	elif test -f /etc/debian_version
	then
	    set `cat /etc/debian_version`
	    CVO_OS=debian$1
	    CVO_KOSVER=`uname -r`
	elif test -f /etc/mandrake-release
	then
	    set `cat /etc/mandrake-release`
	    CVO_OS=mandrake$4
	    CVO_KOSVER=`uname -r`
	elif test -f /etc/redhat-release
	then
	    set `cat /etc/redhat-release`
	    case "$1" in
	     CentOS)
	        CVO_OS=centos$3
	        ;;
	     Fedora)
	        CVO_OS=fedora$3
	        ;;
	    *)
		case "$3" in
		 Enterprise)
		    CVO_OS=redhat$7.E
		    ;;
		 Linux)
		    CVO_OS=redhat$5
		    ;;
		esac
		;;
	    esac
	    CVO_KOSVER=`uname -r`
	elif test -f /etc/slackware-version
	then
	    set `cat /etc/slackware-version`
	    CVO_OS=slackware$2
	    CVO_KOSVER=`uname -r`
	elif test -f /etc/SuSE-release
	then
	    set `cat /etc/SuSE-release`
	    CVO_OS=suse$9
	    CVO_KOSVER=`uname -r`
	else
	    CVO_OS=$cvo_KERN`uname -r`

	fi
	;;
     nto)	# QNX
	CVO_KOSVER=`uname -r`
	;;
     *)
	echo "gronk - I don't understand <$CVO>!"
	exit 1
	;;
    esac
    ;;
 3) CVO_CPU=$1
    CVO_VENDOR=$2
    CVO_OS=$3
    ;;
 *) echo "gronk - config.guess returned $# pieces, not 3 pieces!"
    exit 1
    ;;
esac

case "$CVO_OS" in
 cygwin)
    # Decisions, decisions.
    # uname -r is the cygwin version #, eg: 1.3.3(0.46/3/2)
    # uname -s returns something like CYGWIN_NT-5.0
    CVO_OS="$CVO_OS`uname -r | sed 's/(.*//'`"
    ;;
esac
set `echo $CVO_OS | sed 's/\([0-9]\)/ \1/'`

case "$#" in
 2) ;;
 *) echo "gronk - <$CVO_OS> expanded to $#, not 2 pieces!"
    exit 1
    ;;
esac

CVO_OSNAME=$1
CVO_OSVER=$2

case "$CVO_OSNAME" in
 solaris)
    CVO_KOSVER=`uname -v`
    ;;
esac

CVO=$CVO_CPU-$CVO_VENDOR-$CVO_OS

case "$TS" in
 '')
    set | grep CVO
    ;;
 *)
    # keys['cvo'] = "cvo.CVO['CVO']"
    TS=`echo $TS | sed -e s/@cvo@/$CVO/g`
    # keys['cpu'] = "cvo.CVO['CVO_CPU']"
    TS=`echo $TS | sed -e s/@cpu@/$CVO_CPU/g`
    # keys['kosver'] = "cvo.CVO['CVO_KOSVER']"
    TS=`echo $TS | sed -e s/@kosver@/$CVO_KOSVER/g`
    # keys['os'] = "cvo.CVO['CVO_OS']"
    TS=`echo $TS | sed -e s/@os@/$CVO_OS/g`
    # keys['osname'] = "cvo.CVO['CVO_OSNAME']"
    TS=`echo $TS | sed -e s/@osname@/$CVO_OSNAME/g`
    # keys['osver'] = "cvo.CVO['CVO_OSVER']"
    TS=`echo $TS | sed -e s/@osver@/$CVO_OSVER/g`
    # keys['vendor'] = "cvo.CVO['CVO_VENDOR']"
    TS=`echo $TS | sed -e s/@vendor@/$CVO_VENDOR/g`
    # keys['raw'] = "cvo.CVO['CVO_raw']"
    TS=`echo $TS | sed -e s/@raw@/$CVO_raw/g`

    echo $TS
    ;;
esac
ntp-4.2.6p5/scripts/fixautomakedepsmagic0000644000175000017500000000062210017034601017405 0ustar  peterpeter#!/bin/sh

prog=`basename $0`


t=/tmp/$prog.$$

trap 'rm -f ${t} ; exit 1' 1 3 15

while [ $# -gt 0 ]; do
        f=$1
	shift
	sed -e '/^DEPS_MAGIC :=/,/^-include \$/s/^/#/' $f > $t
	c="diff $f $t"
	echo $c
	$c
	tstatus=$?
	if [ $tstatus = 0 ]; then
		echo "$prog":" $f not modified"
	elif [ ! -w $f ]; then
		echo "$prog":" $f not not writable"
	else
		c="cp $t $f"
		echo $c
		$c
	fi
	rm -f $t
done
ntp-4.2.6p5/scripts/Makefile.in0000644000175000017500000004210011675460301015345 0ustar  peterpeter# 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
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
	$(srcdir)/calc_tickadj.in $(srcdir)/checktime.in \
	$(srcdir)/freq_adj.in $(srcdir)/html2man.in $(srcdir)/mkver.in \
	$(srcdir)/ntp-wait.in $(srcdir)/ntpsweep.in \
	$(srcdir)/ntptrace.in $(srcdir)/ntpver.in \
	$(srcdir)/plot_summary.in $(srcdir)/summary.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
	$(top_srcdir)/m4/define_dir.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_cacheversion.m4 \
	$(top_srcdir)/m4/ntp_dir_sep.m4 \
	$(top_srcdir)/m4/ntp_lineeditlibs.m4 \
	$(top_srcdir)/m4/ntp_openssl.m4 \
	$(top_srcdir)/m4/ntp_vpathhack.m4 \
	$(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 = calc_tickadj checktime freq_adj html2man mkver \
	ntp-wait ntpsweep ntptrace ntpver plot_summary summary
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)$(sbindir)"
SCRIPTS = $(bin_SCRIPTS) $(noinst_SCRIPTS) $(sbin_SCRIPTS)
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINSUBDIR = @BINSUBDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
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@
EF_LIBS = @EF_LIBS@
EF_PROGS = @EF_PROGS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_INLINE = @HAVE_INLINE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LCRYPTO = @LCRYPTO@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
LIBOPTS_DIR = @LIBOPTS_DIR@
LIBOPTS_LDADD = @LIBOPTS_LDADD@
LIBPARSE = @LIBPARSE@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
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@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENSSL = @OPENSSL@
OPENSSL_INC = @OPENSSL_INC@
OPENSSL_LIB = @OPENSSL_LIB@
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_SH = @PATH_SH@
PATH_TEST = @PATH_TEST@
POSIX_SHELL = @POSIX_SHELL@
PROPDELAY = @PROPDELAY@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SNMP_CFLAGS = @SNMP_CFLAGS@
SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
SNMP_LIBS = @SNMP_LIBS@
STRIP = @STRIP@
TESTDCF = @TESTDCF@
VERSION = @VERSION@
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_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 = 
@NTP_BINSUBDIR_IS_BIN_TRUE@bin_SCRIPTS = ntp-wait ntptrace
@NTP_BINSUBDIR_IS_BIN_FALSE@sbin_SCRIPTS = ntp-wait ntptrace
noinst_SCRIPTS = \
	calc_tickadj		\
	checktime		\
	freq_adj		\
	html2man		\
	mkver			\
	ntpsweep		\
	ntpver			\
	plot_summary		\
	summary			\
	$(NULL)

EXTRA_DIST = \
	check--help		\
	checkChangeLog		\
	cvo.sh			\
	fixautomakedepsmagic	\
	genCommitLog		\
	genver			\
	hpadjtime.sh		\
	monitoring		\
	ntp-close		\
	ntp-groper		\
	ntp-restart		\
	ntp-status		\
	rc1			\
	rc2			\
	stats			\
	UpdatePoint		\
	VersionName		\
	$(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/Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --foreign scripts/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):
calc_tickadj: $(top_builddir)/config.status $(srcdir)/calc_tickadj.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
checktime: $(top_builddir)/config.status $(srcdir)/checktime.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
freq_adj: $(top_builddir)/config.status $(srcdir)/freq_adj.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
html2man: $(top_builddir)/config.status $(srcdir)/html2man.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mkver: $(top_builddir)/config.status $(srcdir)/mkver.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
ntp-wait: $(top_builddir)/config.status $(srcdir)/ntp-wait.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
ntpsweep: $(top_builddir)/config.status $(srcdir)/ntpsweep.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
ntptrace: $(top_builddir)/config.status $(srcdir)/ntptrace.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
ntpver: $(top_builddir)/config.status $(srcdir)/ntpver.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
plot_summary: $(top_builddir)/config.status $(srcdir)/plot_summary.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
summary: $(top_builddir)/config.status $(srcdir)/summary.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
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-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
tags: TAGS
TAGS:

ctags: CTAGS
CTAGS:


distdir: $(DISTFILES)
	@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)
installdirs:
	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; 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)

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-dvi: install-dvi-am

install-dvi-am:

install-exec-am: install-binSCRIPTS install-sbinSCRIPTS

install-html: install-html-am

install-html-am:

install-info: install-info-am

install-info-am:

install-man:

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-sbinSCRIPTS

.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-info install-info-am install-man \
	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-sbinSCRIPTS


# 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:
ntp-4.2.6p5/scripts/ntptrace.in0000755000175000017500000000375311307651603015465 0ustar  peterpeter#! @PATH_PERL@ -w

# John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org

use Socket;
use Getopt::Std;
use vars qw($opt_n $opt_m);

$ntpq = "ntpq";

$Getopt::Std::STANDARD_HELP_VERSION=1;
getopts('nm:');

$dodns = 1;
$dodns = 0 if (defined($opt_n));

$max_hosts = (defined($opt_m) ? $opt_m :  99);
$max_hosts = 0 if ( $max_hosts !~ /^\d+$/ );
$nb_host = 1;

$host = shift;
$host ||= "127.0.0.1";

for (;;) {
	$nb_host++;
	$rootdelay = 0;
	$rootdispersion = 0;
	$stratum = 255;
	$cmd = "$ntpq -n -c rv $host";
	open(PH, $cmd . "|") || die "failed to start command $cmd: $!";
	while () {
		$stratum = $1 if (/stratum=(\d+)/);
		$peer = $1 if (/peer=(\d+)/);
		# Very old servers report phase and not offset.
		$offset = $1 if (/(?:offset|phase)=([^\s,]+)/);
		$rootdelay = $1 if (/rootdelay=([^\s,]+)/);
		$rootdispersion = $1 if (/rootdispersion=([^\s,]+)/);
		$refid = $1 if (/refid=([^\s,]+)/);
	}
	close(PH) || die "$cmd failed";
	last if ($stratum == 255);
	$offset /= 1000;
	$syncdistance = ($rootdispersion + ($rootdelay / 2)) / 1000;
	$dhost = $host;
	# Only do lookups of IPv4 addresses. The standard lookup functions
	# of perl only do IPv4 and I don't know if we should require extras.
	if ($dodns && $host =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/) {
		$iaddr = inet_aton($host);
		$name = (gethostbyaddr($iaddr, AF_INET))[0];
		$dhost = $name if (defined($name));
	}
	printf("%s: stratum %d, offset %f, synch distance %f",
	    $dhost, $stratum, $offset, $syncdistance);
	printf(", refid '%s'", $refid) if ($stratum == 1);
	printf("\n");
	last if ($stratum == 0 || $stratum == 1 || $stratum == 16);
	last if ($refid =~ /^127\.127\.\d{1,3}\.\d{1,3}$/);
	last if ($nb_host > $max_hosts);

	$cmd = "$ntpq -n -c \"pstat $peer\" $host";
	open(PH, $cmd . "|") || die "failed to start command $cmd: $!";
	$thost = "";
	while () {
		$thost = $1, last if (/srcadr=(\S+),/);
	}
	close(PH) || die "$cmd failed";
	last if ($thost eq "");
	last if ($thost =~ /^127\.127\.\d{1,3}\.\d{1,3}$/);
	$host = $thost;
}

ntp-4.2.6p5/scripts/checkChangeLog0000755000175000017500000000070511474355436016071 0ustar  peterpeter#! /bin/sh

. ./packageinfo.sh

# HMS: Irix doesn't have 'head'...
cl1=`head -1 ChangeLog || sed -e 1q ChangeLog`

case "$repotype" in
 dev) ;;
 stable) ;;
 *) echo "Unexpected repotype <$repotype>"
    exit 1
    ;;
esac

case "$repotype$cl1" in
 dev---)
    echo "Dev repo ChangeLog must not begin with '---'!"
    exit 1
    ;;
 dev*)
    ;;
 stable---)
    ;;
 stable*)
    echo "Stable repo Changelog must begin with '---'!"
    exit 1
    ;;
esac
ntp-4.2.6p5/scripts/monitoring/0000755000175000017500000000000011710605402015461 5ustar  peterpeterntp-4.2.6p5/scripts/monitoring/timelocal.pl0000644000175000017500000000475510017034603020000 0ustar  peterpeter;# timelocal.pl
;#
;# Usage:
;#	$time = timelocal($sec,$min,$hours,$mday,$mon,$year,$junk,$junk,$isdst);
;#	$time = timegm($sec,$min,$hours,$mday,$mon,$year);

;# These routines are quite efficient and yet are always guaranteed to agree
;# with localtime() and gmtime().  We manage this by caching the start times
;# of any months we've seen before.  If we know the start time of the month,
;# we can always calculate any time within the month.  The start times
;# themselves are guessed by successive approximation starting at the
;# current time, since most dates seen in practice are close to the
;# current date.  Unlike algorithms that do a binary search (calling gmtime
;# once for each bit of the time value, resulting in 32 calls), this algorithm
;# calls it at most 6 times, and usually only once or twice.  If you hit
;# the month cache, of course, it doesn't call it at all.

;# timelocal is implemented using the same cache.  We just assume that we're
;# translating a GMT time, and then fudge it when we're done for the timezone
;# and daylight savings arguments.  The timezone is determined by examining
;# the result of localtime(0) when the package is initialized.  The daylight
;# savings offset is currently assumed to be one hour.

CONFIG: {
    package timelocal;
    
    @epoch = localtime(0);
    $tzmin = $epoch[2] * 60 + $epoch[1];	# minutes east of GMT
    if ($tzmin > 0) {
	$tzmin = 24 * 60 - $tzmin;		# minutes west of GMT
	$tzmin -= 24 * 60 if $epoch[5] == 70;	# account for the date line
    }

    $SEC = 1;
    $MIN = 60 * $SEC;
    $HR = 60 * $MIN;
    $DAYS = 24 * $HR;
    $YearFix = ((gmtime(946684800))[5] == 100) ? 100 : 0;
}

sub timegm {
    package timelocal;

    $ym = pack(C2, @_[5,4]);
    $cheat = $cheat{$ym} || &cheat;
    $cheat + $_[0] * $SEC + $_[1] * $MIN + $_[2] * $HR + ($_[3]-1) * $DAYS;
}

sub timelocal {
    package timelocal;

    $ym = pack(C2, @_[5,4]);
    $cheat = $cheat{$ym} || &cheat;
    $cheat + $_[0] * $SEC + $_[1] * $MIN + $_[2] * $HR + ($_[3]-1) * $DAYS
	+ $tzmin * $MIN - 60 * 60 * ($_[8] != 0);
}

package timelocal;

sub cheat {
    $year = $_[5];
    $month = $_[4];
    $guess = $^T;
    @g = gmtime($guess);
    $year += $YearFix if $year < $epoch[5];
    while ($diff = $year - $g[5]) {
	$guess += $diff * (364 * $DAYS);
	@g = gmtime($guess);
    }
    while ($diff = $month - $g[4]) {
	$guess += $diff * (28 * $DAYS);
	@g = gmtime($guess);
    }
    $g[3]--;
    $guess -= $g[0] * $SEC + $g[1] * $MIN + $g[2] * $HR + $g[3] * $DAYS;
    $cheat{$ym} = $guess;
}
ntp-4.2.6p5/scripts/monitoring/loopwatch.config.SAMPLE0000644000175000017500000000533310017034602021631 0ustar  peterpeter# sample configuration and control file for ntploowatch
#
# delay:	sampling interval in seconds
delay=60
# samples:	use only last # samples
samples=600
# DO NOT USE srcprefix in shared config files
# srcprefix:	name of file to read samples from
#  		current time suffix (month name) is appended
#		defaults to "./var@$STATHOST/loopstats."
#		The string "$STATHOST"is replaced by the name of the host
#		being monitored
#srcprefix=./var@$STATHOST/loopstats.
#
# showoffs:	yes/no control display of offset values
showoffs=yes
#
# showfreq:	yes/no control display of frequency values
showfreq=yes
#
# showcmpl:	yes/no control display of compliance values
showcmpl=no
#
# showoreg:	yes/no control display of linear regression of offset values
showoreg=no
#
# showfreg:	yes/no control display of linear regression of frequency values
showfreg=no
#
# timebase:	dynamic/ISO_DATE_TIME point of zero for linear regression
#		ISO_DATE_TIME:  yyyy-mm-dd_hh:mm:ss.ms
#		values are interpreted using local time zone
#		parts omitted from front default to current date/time
#		parts omitted from end  default to lowest permitted values
#		to get aa:bb being interpreted as minutes:seconds use aa:bb.0
#		for dynamic '00:00:00.0 of current day' is used
timebase=dynamic
#
# freqbase:	dynamic/ 
#		if a number is given, subtract this from sampling values for display
#		if dynamic is selected, freqbase is adjusted to fit into the range of
#		offset values
freqbase=dynamic
#
# cmplscale:	dynamic/
#		if a number is given, the sampling values are divided by this number
#		if dynamic is selected, cmplscale is adjusted to fit into the range of
#		offset values
cmplscale=dynamic
#
# DumbScale:	0/1
#		0 enables dynamic adjust of value ranges for freqbase and cmplscale
#		  timescale is labeled with human readable times
#		1 only uses explicit scaling for numbers
#		  timescale is labeled with hours relative to timebase
DumbScale=0
#
# StartTime:	none/ISO_DATE_TIME
#		ignore any samples before the specified date
StartTime=none
#
# EndTime:	none/ISO_DATE_TIME
#		ignore any samples after the specified date
#
#		if both StartTime and EndTime are specified
#		the value specified for samples is ignored
EndTime=none
#
# MaxOffs:	none/
#		limit display (y-axis) to values not larger than 
MaxOffset=none
#
# MinOffs:	none/
#		limit display (y-axis) to values not smaller than 
MinOffset=none

#
# verbose:	
# 		specify level for debugging 
#		default is 0 for printing and 1 for monitoring
#		level 1 will just print a timestamp for any display update
#		(this is every delay seconds)
verbose=1
#
# deltaT:	
#		mark `holes' in the sample data grater than 
#		by a break in the plot
#		default: 512 seconds
deltaT=512
ntp-4.2.6p5/scripts/monitoring/README0000644000175000017500000001255310017034602016344 0ustar  peterpeterThis directory contains support for monitoring the local clock of xntp daemons.

WARNING: The scripts and routines contained in this directory are beta
	 release!  Do not depend on their correct operation. They are,
	 however, in regular use at University of Erlangen-Nuernberg.
	 No severe problems are known for this code.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
PLEASE THINK TWICE BEFORE STARTING MONITORING REMOTE XNTP DEAMONS !!!!
MONITORING MAY INCREASE THE LOAD OF THE DEAMON MONITORED AND MAY
INCREASE THE NETWORK LOAD SIGNIFICANTLY
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


Files are:

README:
	This file

ntptrap:
	perl script to log ntp mode 6 trap messages.

	It sends a set_trap request to each server given and dumps the
	trap messages received. It handles refresh of set_trap.
	Currently it handles only NTP V2, however the NTP V3 servers
	also accept v2 requests. It will not interpret v3 system and
	peer stati correctly.

	usage:
	  ntptrap [-n] [-p ] [-l ] servers...
	
	-n:		do not send set_trap requests

	port:		port to listen for responses
			useful if you have a configured trap

	debug-output:	file to write trace output to (for debugging)

	This script convinced me that ntp trap messages are only of
	little use.

ntploopstat:
	perl script to gather loop info statistics from xntpd via mode 7
	LOOP_INFO requests.

	This script collects data to allow monitoring of remote xntp servers
	where it is not possible to directly access the loopstats file
	produced by xntpd itself. Of course, it can be used to sample
	a local server if it is not configured to produce a loopstats file.

	Please note, this program poses a high load on the server as
	a communication takes place every delay seconds ! USE WITH CARE !

	usage:
	  ntploopstat [-d] [-t] [-l ] [-v] [ntpserver]
	
	delay:		number of seconds to wait between samples
			default: 60 seconds
	timeout:	number of seconds to wait for reply
			default 12 seconds
	logfile:	file to log samples to
			default: loopstats::
			(note the trailing colon)
			This name actually is a prefix.
			The file name is dynamically derived by appending
			the name of the month the sample belongs to.
			Thus all samples of a month end up in the same file.

	the format of the files generated is identical to the format used by
	xntpd with the loopstats file:
		MJD  offset frequency compliance
	
	if a timeout occurs the next sample is tried after delay/2 seconds

	The script will terminate after MAX_FAIL (currently 60)
	consecutive errors.

	Errors are counted for:
		- error on send call
		- error on select call
		- error on recv call
		- short packet received
		- bad packet 
		- error on open for logfile

ntploopwatch:
	perl script to display loop filter statistics collected by ntploopstat
	or dumped directly by xntpd.

	Gnuplot is used to produce a graphical representation of the sample
	values, that have been preprocessed and analysed by this script.

	It can either be called to produce a printout of specific data set or
	used to continously monitor the values. Monitoring is achieved by 
	periodically reprocessing the logfiles, which are updated regularly
	either by a running ntploopstat process or by the running xntpd.

	usage:
	  to watch statistics permanently:
	     ntploopwatch [-v[]] [-c ] [-d ]

	  to get a single print out specify also
			  -P [-s]
				      [-S ] [-E ]
				      [-O ] [-o ]
	
	level:		level of verbosity for debugging
	config-file:	file to read configurable settings from
			On each iteration it is checked and reread
			if it has been changed
			default: loopwatch.config
	working-dir:	specify working directory for process, affects
			interpretation of relative file names
	
	All other flags are only useful with printing plots, as otherwise
	command line values would be replaced by settings from the config file.

	printer:	specify printer to print plot
			BSD print systems semantics apply; if printer
			is omitted the name "ps" is used; plots are
			prepared using PostScript, thus the printer
			should best accept postscript input

	For the following see also the comments in loopwatch.config.SAMPLE

	samples:	use last # samples from input data
	start-time:	ignore input samples before this date
	end-time:	ignore input samples after this date
			if both start-time and end-time are specified
			a given samples value is ignored
	MaxOffs:
	MinOffs:	restrict value range 

loopwatch.config.SAMPLE:
	sample config file for ntploopwatch
	each configurable option is explained there

lr.pl:
	linear regression package used by ntploopwatch to compute
	linear approximations for frequency and offset values
	within display range

timelocal.pl:

	used during conversion of ISO_DATE_TIME values specified in
	loopwatch config files to unix epoch values (seconds since
	1970-01-01_00:00_00 UTC)

	A version of this file is distributed with perl-4.x, however,
	it has a bug related to dates crossing 1970, causing endless loops..
	The version contained here has been fixed.

ntp.pl:
	perl support for ntp v2 mode 6 message handling
	WARNING: This code is beta level - it triggers a memory leak;
		 as for now it is not quite clear, wether this is caused by a
		 bug in perl or by bad usage of perl within this script.

ntp-4.2.6p5/scripts/plot_summary.in0000644000175000017500000002466710017034602016373 0ustar  peterpeter#! @PATH_PERL@ -w
# $Id$
#
# Use Gnuplot to display data in summary files produced by summary.pl.
# This script requires GNUPLOT 3.7!
#
# Copyright (c) 1997, 1999 by Ulrich Windl 
#
# 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 2 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, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

require 5.003; # "never tested with any other version of Perl"
use strict;

use Time::Local;
use Getopt::Long;

# parse command line
my $summary_dir = "/tmp";
my $identifier = "host " . `hostname`;	# origin of these data
chomp $identifier;			# remove newline
my $offset_limit = 0.128;		# limit of absolute offset
my $output_file = "";			# output file defaults to stdout
my $output_file_number = 1;		# numbering of output files
my $gnuplot_terminal = $ENV{DISPLAY} ? "x11" : "dumb";
my $wait_after_plot = 1;
my @peer_list = ();

my %options = ("directory|input-directory=s" => \$summary_dir,
	       "identifier=s" => \$identifier,
	       "offset-limit=f" => \$offset_limit,
	       "output-file=s" => \$output_file,
	       "peer=s@" => \@peer_list,
	       "plot-term|gnuplot-term=s" => \$gnuplot_terminal,
	       "wait-after-plot!" => \$wait_after_plot,
	       );

if ( !GetOptions(%options) )
{
    print STDERR "valid options for $0 are:\n";
    my $opt;
    foreach $opt (sort(keys %options)) {
	print STDERR "\t--$opt\t(default is ";
	if ( ref($options{$opt}) eq "ARRAY" ) {
	    print STDERR join(", ",  map { "'$_'" } @{$options{$opt}});
	} else {
	    print STDERR "'${$options{$opt}}'";
	}
	print STDERR ")\n";
    }
    print STDERR "\n";
    die;
}

chomp $identifier;
die "illegal offset-limit: $offset_limit" unless $offset_limit > 0.0;
$offset_limit *= 1e6;			# scale to microseconds

# return the smallest value in the given list
sub min
{
    my ($result, @rest) = @_;
    map { $result = $_ if ($_ < $result) } @rest;
    return($result);
}

# return the largest value in the given list
sub max
{
    my ($result, @rest) = @_;
    map { $result = $_ if ($_ > $result) } @rest;
    return($result);
}

# maybe open alternate output file
sub open_output
{
    my $file;
    if ($output_file) {
	while ( -r ($file = "$output_file$output_file_number") ) {
	    ++$output_file_number;
	}
	open TOUCH, ">$file" and close TOUCH or die "$file: $!";
	print "set output \"$file\"\n";
    }
}

# make Gnuplot wait
sub maybe_add_pause
{
    print "pause -1 \"Press key to continue...\"\n" if $wait_after_plot;
}

# plot data from loop summary
sub do_loop
{
    my $fname = shift;
    my $line;
    my $out_file = "/tmp/tempdata$$";
    my $cmd_file = "/tmp/tempcmd$$";
    my ($first_day, $day_out) = ("", 0);
    my ($lower_bound, $upper_bound, $rms);
    my ($min_offs, $max_offs) = (1e9, -1e9);
    my ($min_rms, $max_rms) = (1e9, -1e9);
    open INPUT, "$fname" or die "$fname: $!";
    open OUTPUT, ">$out_file" or die "$out_file: $!";
    my @Fld;
    while () {
	chop;	# strip record separator
	@Fld = split;
	if ($#Fld == 0) {
# loops.19960405
	    $_ = $Fld[0]; s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
	    m/(\d{4})(\d{2})(\d{2})/;
	    $line = timegm(59, 59, 23, $3, $2 - 1, $1 - 1900, 0, 0, 0);
	    $line = int $line / 86400;	# days relative to 1970
	    $first_day = "$1-$2-$3 ($line)" unless $day_out;
	    next;
	}
	if ($#Fld != 8) {
	    warn "Illegal number of fields in file $fname, line $.";
	    next;
	}
# loop 216, 856106+/-874041.5, rms 117239.8, freq 67.52+/-10.335, var 4.850
	$_ = $Fld[1]; s/,/ /; $line .= " $_";
	$_ = $Fld[2]; m:(.+?)\+/-(.+),:;
	$lower_bound = $1 - $2;
	$upper_bound = $1 + $2;
	$line .= "$1 $lower_bound $upper_bound";
	$min_offs = min($min_offs, $lower_bound);
	$max_offs = max($max_offs, $upper_bound);
	$_ = $Fld[4]; s/,/ /; $rms = $_;
	$min_rms = min($min_rms, $rms);
	$max_rms = max($max_rms, $rms);
	$line .= " $rms";
	$_ = $Fld[6]; m:(.+?)\+/-(.+),:;
	$line .= " $1 " . ($1-$2) . " " . ($1+$2);
	$line .= " $Fld[8]";
	print OUTPUT "$line\n";
	$day_out = 1;
# 9621 216 856106 -17935.5 1730147.5 117239.8  67.52 57.185 77.855 4.850
    }
    close INPUT;
    close OUTPUT or die "close failed on $out_file: $!";
    my $ylimit = "[";
    if ($min_offs < -$offset_limit) {
	$ylimit .= "-$offset_limit";
    }
    $ylimit .= ":";
    if ($max_offs > $offset_limit) {
	$ylimit .= "$offset_limit";
    }
    if ( $ylimit eq "[:" ) {
	$ylimit = "";
    } else {
	$ylimit = "[] $ylimit]";
    }
# build command file for GNUplot
    open OUTPUT, "> $cmd_file" or die "$cmd_file: $!";
    my $oldfh = select OUTPUT;
    print "set term $gnuplot_terminal\n";
    open_output;
    print "set grid\n";
    print "set title \"Loop Summary for $identifier: " .
	"Daily mean values since $first_day\\n" .
	"(Offset limit is $offset_limit microseconds)\"\n";
    print "set ylabel \"[us]\"\n";
    print "set data style yerrorbars\n";
    print "set multiplot\n";
    print "set size 1, 0.5\n";
    print "set lmargin 8\n";
    print "set origin 0, 0.5\n";
    print "plot $ylimit \"$out_file\"" .
	" using 1:3:4:5 title \"mean offset\", ";
    print "\"$out_file\" using 1:(\$3-\$6/2) " .
	"title \"(sigma low)\" with lines, ";
    print "\"$out_file\" using 1:3 smooth bezier " .
	"title \"(Bezier med)\" with lines, ";
    print "\"$out_file\" using 1:(\$3+\$6/2) " .
	"title \"(sigma high)\" with lines\n";
    print "set ylabel \"[ppm]\"\n";
    print "set origin 0, 0.0\n";
    print "set title\n";
    print "set xlabel \"Days relative to 1970\"\n";
    print "plot \"$out_file\" using 1:7:8:9 title \"mean frequency\", ";
    print "\"$out_file\" using 1:(\$7-\$10/2) " .
	"title \"(sigma low)\" with lines, ";
    print "\"$out_file\" using 1:7 smooth bezier " .
	"title \"(Bezier med)\" with lines, ";
    print "\"$out_file\" using 1:(\$7+\$10/2) " .
	"title \"(sigma high)\" with lines\n";
    print "set nomultiplot\n";
    maybe_add_pause;

    $ylimit = "[";
    if ($min_rms < -$offset_limit) {
	$ylimit .= "-$offset_limit";
    }
    $ylimit .= ":";
    if ($max_rms > $offset_limit) {
	$ylimit .= "$offset_limit";
    }
    if ( $ylimit eq "[:" ) {
	$ylimit ="";
    } else {
	$ylimit = "[] $ylimit]";
    }

    open_output;
    print "set title \"Loop Summary for $identifier: " .
	"Standard deviation since $first_day\\n" .
	"(Offset limit is $offset_limit microseconds)\"\n";
    print "set xlabel\n";
    print "set ylabel \"[us]\"\n";
    print "set origin 0, 0.5\n";
    print "set data style linespoints\n";
    print "set multiplot\n";
    print "plot $ylimit \"$out_file\" using 1:6 title \"Offset\", ";
    print "\"$out_file\" using 1:6 smooth bezier " .
	"title \"(Bezier)\" with lines\n";
    print "set title\n";
    print "set origin 0, 0.0\n";
    print "set xlabel \"Days relative to 1970\"\n";
    print "set ylabel \"[ppm]\"\n";
    print "plot \"$out_file\" using 1:10 title \"Frequency\", ";
    print "\"$out_file\" using 1:10 smooth bezier " .
	"title \"(Bezier)\" with lines\n";
    print "set nomultiplot\n";
    maybe_add_pause;

    close OUTPUT or die "close failed on $cmd_file: $!";
    select $oldfh;
    print `gnuplot $cmd_file`;
    unlink $cmd_file;
    unlink $out_file;
}

# plot data form peer summary
sub do_peer
{
    my $fname = shift;
    my $peer = shift;
    my $out_file = "/tmp/tempdata$$";
    my $cmd_file = "/tmp/tempcmd$$";
    my $line;
    my ($first_day, $day_out) = ("", 0);
    open INPUT, "$fname" or die "$fname: $!";
    open OUTPUT, ">$out_file" or die "$out_file: $!";
    my @Fld;
    while () {
	chop;	# strip record separator
	@Fld = split;
	if ($#Fld == 0) {
# peers.19960405
	    $_ = $Fld[0]; s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
	    m/(\d{4})(\d{2})(\d{2})/ or next;
	    $line = timegm(59, 59, 23, $3, $2 - 1, $1 - 1900, 0, 0, 0);
	    $line = int $line / 86400;	# days relative to 1970
	    $first_day = "$1-$2-$3 ($line)" unless $day_out;
	    next;
	}
	if ($#Fld != 7) {
	    warn "Illegal number of fields in file $fname, line $.";
	    next;
	}
	next if ($Fld[0] ne $peer);
#       ident     cnt     mean     rms      max     delay     dist     disp
# 127.127.8.1       38   30.972  189.867 1154.607    0.000  879.760  111.037
	$Fld[0] = $line;
	print OUTPUT join(' ', @Fld) . "\n";
# 9969 38 30.972 189.867 1154.607 0.000 879.760 111.037
	$day_out = 1;
    }
    close INPUT;
    close OUTPUT or die "close failed on $out_file: $!";
    die "no data found for peer $peer" if !$day_out;
    open OUTPUT, "> $cmd_file" or die "$cmd_file: $!";
    my $oldfh = select OUTPUT;
    print "set term $gnuplot_terminal\n";
    open_output;
    print "set grid\n";
    print "set multiplot\n";
    print "set lmargin 8\n";
    print "set size 1, 0.34\n";
    print "set origin 0, 0.66\n";
    print "set title " .
	"\"Peer Summary for $peer on $identifier since $first_day\"\n";
    print "set data style linespoints\n";
    print "set ylabel \"[us]\"\n";
    print "plot \"$out_file\" using 1:3 title \"mean offset\", ";
    print "\"$out_file\" using 1:3 smooth bezier " .
	"title \"(Bezier)\" with lines, ";
    print "\"$out_file\" using 1:(\$3-\$7/2) " .
	"title \"(sigma low)\" with lines, ";
    print "\"$out_file\" using 1:(\$3+\$7/2) " .
	"title \"(sigma high)\" with lines\n";
    print "set title\n";
    print "set origin 0, 0.34\n";
    print "set size 1, 0.32\n";
    print "set ylabel\n";
    print "plot \"$out_file\" using 1:7 title \"dist\", ";
    print "\"$out_file\" using 1:7 smooth bezier " .
	"title \"(Bezier)\" with lines\n";
    print "set origin 0, 0.00\n";
    print "set size 1, 0.35\n";
    print "set xlabel \"Days relative to 1970\"\n";
    print "plot \"$out_file\" using 1:8 title \"disp\", ";
    print "\"$out_file\" using 1:8 smooth bezier " .
	"title \"(Bezier)\" with lines\n";
    print "set nomultiplot\n";
    maybe_add_pause;

    select $oldfh;
    close OUTPUT or die "close failed on $cmd_file: $!";
    print `gnuplot $cmd_file`;
    unlink $cmd_file;
    unlink $out_file;
}


my $loop_summary ="$summary_dir/loop_summary";
my $peer_summary ="$summary_dir/peer_summary";
my $clock_summary="$summary_dir/clock_summary";

do_loop $loop_summary;
map { do_peer $peer_summary, $_ } @peer_list;
ntp-4.2.6p5/scripts/hpadjtime.sh0000755000175000017500000000045610017034601015601 0ustar  peterpeter#! /bin/sh
val=1
if [ -f /bin/uname -o -f /usr/bin/uname ]; then
	set `uname -a | tr '[A-Z]' '[a-z]'`
	case "$1" in
		hp-ux)  case "$3" in
			*.10.*) val=1 ;;
			*.09.03 | *.09.10) case "$5" in
				9000/3*) val=1 ;;
				*)       val=0 ;;
				esac ;;
			*) val=0 ;;
			esac
			;;
	*)
	esac
fi
exit $val
ntp-4.2.6p5/scripts/ntp-status0000755000175000017500000000202210017034602015335 0ustar  peterpeter#!/bin/sh

# From: Marc Brett 

# Here's a quick hack which can give you the stratum, delay, offset
# for any number of ntp servers.

NTPDATE=/usr/local/bin/ntpdate
NSLOOKUP=/usr/sbin/nslookup
EGREP=/bin/egrep
AWK=/bin/awk
RM=/bin/rm
FILE=/tmp/ntp.$$

USAGE="Usage: $0 hostname [hostname ...]"

if [ $# -le 0 ]
then
	echo $USAGE 2>&1
	exit 1
fi

trap '$RM -f $FILE; exit' 1 2 3 4 13 15

for HOST in $*
do
    HOSTNAME=`$NSLOOKUP $HOST | $EGREP "Name:" | $AWK '{print $2}'`
    if [ -n "$HOSTNAME" ]
    then
	$NTPDATE -d $HOST 2>/dev/null | $EGREP '^stratum|^delay|^offset|^originate' > $FILE
	STRATUM=`$EGREP '^stratum' $FILE | $AWK '{print $2}'`
	OFFSET=`$EGREP '^offset' $FILE | $AWK '{print $2}'`
	DELAY=`$EGREP '^delay' $FILE | $AWK '{print $2}'`
	TIMESTAMP=`$EGREP '^originate' $FILE | $AWK '{print $4 " " $5 " " $6 " " $7 " " $8}'`
	if [ "$STRATUM" -ne 0 ]
	then
		echo "$HOSTNAME: stratum:$STRATUM delay:$DELAY offset:$OFFSET  $TIMESTAMP"
	else
		echo $HOSTNAME: Not running NTP
	fi
    fi

done

$RM -f $FILE
ntp-4.2.6p5/scripts/Makefile.am0000644000175000017500000000103411510477207015336 0ustar  peterpeterNULL=

if NTP_BINSUBDIR_IS_BIN
bin_SCRIPTS =	ntp-wait ntptrace
else
sbin_SCRIPTS =	ntp-wait ntptrace
endif

noinst_SCRIPTS =		\
	calc_tickadj		\
	checktime		\
	freq_adj		\
	html2man		\
	mkver			\
	ntpsweep		\
	ntpver			\
	plot_summary		\
	summary			\
	$(NULL)

EXTRA_DIST =			\
	check--help		\
	checkChangeLog		\
	cvo.sh			\
	fixautomakedepsmagic	\
	genCommitLog		\
	genver			\
	hpadjtime.sh		\
	monitoring		\
	ntp-close		\
	ntp-groper		\
	ntp-restart		\
	ntp-status		\
	rc1			\
	rc2			\
	stats			\
	UpdatePoint		\
	VersionName		\
	$(NULL)
ntp-4.2.6p5/scripts/summary.in0000644000175000017500000002674610017034602015335 0ustar  peterpeter#! @PATH_PERL@ -w
# $Id$
# Perl version of (summary.sh, loop.awk, peer.awk):
# Create summaries from xntpd's loop and peer statistics.
#
# Copyright (c) 1997, 1999 by Ulrich Windl 
#
# 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 2 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, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

require 5.003; # "never tested with any other version of Perl"
use strict;

use Getopt::Long;

my $log_date_pattern = '[12]\d{3}[01]\d[0-3]\d';
my $statsdir = "/var/log/ntp";		# directory with input files
my $outputdir = "/tmp";			# directory for output files
my $skip_time_steps = 3600.0;		# ignore time offsets larger that this
my $startdate = "19700101";		# first data file to use (YYYYMMDD)
my $enddate=`date -u +%Y%m%d`; chomp $enddate; --$enddate;
my $peer_dist_limit = 400.0;

my %options = ("directory|input-directory=s" => \$statsdir,
	       "output-directory=s" => \$outputdir,
	       "skip-time-steps:f" => \$skip_time_steps,
	       "start-date=s" => \$startdate,
	       "end-date=s" => \$enddate,
	       "peer-dist-limit=f" => \$peer_dist_limit);

if ( !GetOptions(%options) )
{
    print STDERR "valid options for $0 are:\n";
    my $opt;
    foreach $opt (sort(keys %options)) {
	print STDERR "\t--$opt\t(default is ";
	if ( ref($options{$opt}) eq "ARRAY" ) {
	    print STDERR join(", ",  map { "'$_'" } @{$options{$opt}});
	} else {
	    print STDERR "'${$options{$opt}}'";
	}
	print STDERR ")\n";
    }
    print STDERR "\n";
    die;
}

# check possibly current values of options
die "$statsdir: no such directory" unless (-d $statsdir);
die "$outputdir: no such directory" unless (-d $outputdir);
die "$skip_time_steps: skip-time-steps must be positive"
    unless ($skip_time_steps >= 0.0);
die "$startdate: invalid start date|$`|$&|$'"
    unless ($startdate =~ m/.*$log_date_pattern$/);
die "$enddate: invalid end date"
    unless ($enddate =~ m/.*$log_date_pattern$/);

$skip_time_steps = 0.128 if ($skip_time_steps == 0);

sub min
{
    my ($result, @rest) = @_;
    map { $result = $_ if ($_ < $result) } @rest;
    return($result);
}

sub max
{
    my ($result, @rest) = @_;
    map { $result = $_ if ($_ > $result) } @rest;
    return($result);
}

# calculate mean, range, and standard deviation for offset and frequency
sub do_loop
{
    my ($directory, $fname, $out_file) = @_;
    print "$directory/$fname\n";
    open INPUT, "$directory/$fname" or warn "can't open $directory/$fname: $!";
    open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
    print OUTPUT "$fname\n";
    my ($loop_tmax, $loop_fmax) = (-1e9, -1e9);
    my ($loop_tmin, $loop_fmin) = (1e9, 1e9);
    my ($loop_time_rms, $loop_freq_rms) = (0, 0);
    my $loop_count = 0;
    my $loop_time = 0;
    my $loop_freq = 0;
    my ($freq, $offs);
    my @Fld;
    while () {
	chop;	# strip record separator
	@Fld = split;
	next if ($#Fld < 4);
#NTPv3: 50529 74356.259 -0.000112 16.1230 8
#NTPv3: day, sec.msec, offset, drift_comp, sys_poll
#NTPv4: 51333 54734.582 0.000001648 16.981964 0.000001094 0.020938 6
#NTPv4: day, sec.msec, offset, drift_comp, sys_error, clock_stabil, sys_poll
	if ($Fld[2] > $skip_time_steps || $Fld[2] < -$skip_time_steps) {
	    warn "ignoring loop offset $Fld[2] (file $fname, line $.)\n";
	    next
	}
	$loop_count++;
	($offs, $freq) = ($Fld[2], $Fld[3]);
	$loop_tmax = max($loop_tmax, $offs);
	$loop_tmin = min($loop_tmin, $offs);
	$loop_fmax = max($loop_fmax, $freq);
	$loop_fmin = min($loop_fmin, $freq);
	$loop_time += $offs;
	$loop_time_rms += $offs * $offs;
	$loop_freq += $freq;
	$loop_freq_rms += $freq * $freq;
    }
    close INPUT;
    if ($loop_count > 1) {
	$loop_time /= $loop_count;
	$loop_time_rms = $loop_time_rms / $loop_count - $loop_time * $loop_time;
	if ($loop_time_rms < 0) {
	    warn "loop_time_rms: $loop_time_rms < 0";
	    $loop_time_rms = 0;
	}
	$loop_time_rms = sqrt($loop_time_rms);
	$loop_freq /= $loop_count;
	$loop_freq_rms = $loop_freq_rms / $loop_count - $loop_freq * $loop_freq;
	if ($loop_freq_rms < 0) {
	    warn "loop_freq_rms: $loop_freq_rms < 0";
	    $loop_freq_rms = 0;
	}
	$loop_freq_rms = sqrt($loop_freq_rms);
	printf OUTPUT
	    ("loop %d, %.0f+/-%.1f, rms %.1f, freq %.2f+/-%0.3f, var %.3f\n",
	     $loop_count, ($loop_tmax + $loop_tmin) / 2 * 1e6,
	     ($loop_tmax - $loop_tmin) / 2 * 1e6, $loop_time_rms * 1e6,
	     ($loop_fmax + $loop_fmin) / 2, ($loop_fmax - $loop_fmin) / 2,
	     $loop_freq_rms);
    }
    else {
	warn "no valid lines in $directory/$fname";
    }
    close OUTPUT
}

# calculate mean, standard deviation, maximum offset, mean dispersion,
# and maximum distance for each peer
sub do_peer
{
    my ($directory, $fname, $out_file) = @_;
    print "$directory/$fname\n";
    open INPUT, "$directory/$fname" or warn "can't open $directory/$fname: $!";
    open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
    print OUTPUT "$fname\n";
# we toss out all distances greater than one second on the assumption the
# peer is in initial acquisition
    my ($n, $MAXDISTANCE) = (0, 1.0);
    my %peer_time;
    my %peer_time_rms;
    my %peer_count;
    my %peer_delay;
    my %peer_disp;
    my %peer_dist;
    my %peer_ident;
    my %peer_tmin;
    my %peer_tmax;
    my @Fld;
    my ($i, $j);
    my ($dist, $offs);
    while () {
	chop;	# strip record separator
	@Fld = split;
	next if ($#Fld < 6);
#NTPv3: 50529 83316.249 127.127.8.1 9674 0.008628 0.00000 0.00700
#NTPv3: day, sec.msec, addr, status, offset, delay, dispersion
#NTPv4: 51333 56042.037 127.127.8.1 94f5 -0.000014657 0.000000000 0.000000000 0.000013214
#NTPv4: day, sec.msec, addr, status, offset, delay, dispersion, skew

	$dist = $Fld[6] + $Fld[5] / 2;
	next if ($dist > $MAXDISTANCE);
	$offs = $Fld[4];
	if ($offs > $skip_time_steps || $offs < -$skip_time_steps) {
	    warn "ignoring peer offset $offs (file $fname, line $.)\n";
	    next
	}
	$i = $n;
	for ($j = 0; $j < $n; $j++) {
	    if ($Fld[2] eq $peer_ident{$j}) {
		$i = $j;		# peer found
		last;
	    }
	}
	if ($i == $n) {		# add new peer
	    $peer_ident{$i} = $Fld[2];
	    $peer_tmax{$i} = $peer_dist{$i} = -1e9;
	    $peer_tmin{$i} = 1e9;
	    $peer_time{$i} = $peer_time_rms{$i} = 0;
	    $peer_delay{$i} = $peer_disp{$i} = 0;
	    $peer_count{$i} = 0;
	    $n++;
	}
	$peer_count{$i}++;
	$peer_tmax{$i} = max($peer_tmax{$i}, $offs);
	$peer_tmin{$i} = min($peer_tmin{$i}, $offs);
	$peer_dist{$i} = max($peer_dist{$i}, $dist);
	$peer_time{$i} += $offs;
	$peer_time_rms{$i} += $offs * $offs;
	$peer_delay{$i} += $Fld[5];
	$peer_disp{$i} += $Fld[6];
    }
    close INPUT;
    print OUTPUT
"       ident     cnt     mean     rms      max     delay     dist     disp\n";
    print OUTPUT
"==========================================================================\n";
    my @lines = ();
    for ($i = 0; $i < $n; $i++) {
	next if $peer_count{$i} < 2;
	$peer_time{$i} /= $peer_count{$i};
	eval { $peer_time_rms{$i} = sqrt($peer_time_rms{$i} / $peer_count{$i} -
					 $peer_time{$i} * $peer_time{$i}); };
	$peer_time_rms{$i} = 0, warn $@ if $@;
	$peer_delay{$i} /= $peer_count{$i};
	$peer_disp{$i} /= $peer_count{$i};
	$peer_tmax{$i} = $peer_tmax{$i} - $peer_time{$i};
	$peer_tmin{$i} = $peer_time{$i} - $peer_tmin{$i};
	if ($peer_tmin{$i} > $peer_tmax{$i}) {	# can this happen at all?
	    $peer_tmax{$i} = $peer_tmin{$i};
	}
	push @lines, sprintf
	    "%-15s %4d %8.3f %8.3f %8.3f %8.3f %8.3f %8.3f\n",
	    $peer_ident{$i}, $peer_count{$i}, $peer_time{$i} * 1e3,
	    $peer_time_rms{$i} * 1e3, $peer_tmax{$i} * 1e3,
	    $peer_delay{$i} * 1e3, $peer_dist{$i} * 1e3, $peer_disp{$i} * 1e3;
    }
    print OUTPUT sort @lines;
    close OUTPUT;
}

sub do_clock
{
    my ($directory, $fname, $out_file) = @_;
    print "$directory/$fname\n";
    open INPUT, "$directory/$fname";
    open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
    print OUTPUT "$fname\n";
    close INPUT;
    close OUTPUT;
}

sub peer_summary
{
    my $in_file = shift;
    my ($i, $j, $n);
    my (%peer_ident, %peer_count, %peer_mean, %peer_var, %peer_max);
    my (%peer_1, %peer_2, %peer_3, %peer_4);
    my $dist;
    my $max;
    open INPUT, "<$in_file" or die "can't open $in_file: $!";
    my @Fld;
    $n = 0;
    while () {
	chop;	# strip record separator
	@Fld = split;
	next if ($#Fld < 7 || $Fld[0] eq 'ident');
	$i = $n;
	for ($j = 0; $j < $n; $j++) {
	    if ($Fld[0] eq $peer_ident{$j}) {
		$i = $j;
		last;			# peer found
	    }
	}
	if ($i == $n) {			# add new peer
	    $peer_count{$i} = $peer_mean{$i} = $peer_var{$i} = 0;
	    $peer_max{$i} = 0;
 	    $peer_1{$i} = $peer_2{$i} = $peer_3{$i} = $peer_4{$i} = 0;
	    $peer_ident{$i} = $Fld[0];
	    ++$n;
	}
	$dist = $Fld[6] - $Fld[5] / 2;
	if ($dist < $peer_dist_limit) {
	    $peer_count{$i}++;
	    $peer_mean{$i} += $Fld[2];
	    $peer_var{$i} += $Fld[3] * $Fld[3];
	    $max = $Fld[4];
	    $peer_max{$i} = max($peer_max{$i}, $max);
	    if ($max > 1) {
		$peer_1{$i}++;
		if ($max > 5) {
		    $peer_2{$i}++;
		    if ($max > 10) {
			$peer_3{$i}++;
			if ($max > 50) {
			    $peer_4{$i}++;
			}
		    }
		}
	    }
	}
	else {
	    warn "dist exceeds limit: $dist (file $in_file, line $.)\n";
	}
    }
    close INPUT;
    my @lines = ();
    print
	"       host     days    mean       rms       max   >1  >5 >10 >50\n";
    print
	"==================================================================\n";
    for ($i = 0; $i < $n; $i++) {
	next if ($peer_count{$i} < 2);
	$peer_mean{$i} /= $peer_count{$i};
	eval { $peer_var{$i} = sqrt($peer_var{$i} / $peer_count{$i} -
				    $peer_mean{$i} * $peer_mean{$i}); };
	$peer_var{$i} = 0, warn $@ if $@;
	push @lines, sprintf
	    "%-15s %3d %9.3f% 9.3f %9.3f %3d %3d %3d %3d\n",
	    $peer_ident{$i}, $peer_count{$i}, $peer_mean{$i}, $peer_var{$i},
	    $peer_max{$i}, $peer_1{$i}, $peer_2{$i}, $peer_3{$i}, $peer_4{$i};
    }
    print sort @lines;
}

my $loop_summary="$outputdir/loop_summary";
my $peer_summary="$outputdir/peer_summary";
my $clock_summary="$outputdir/clock_summary";
my (@loopfiles, @peerfiles, @clockfiles);

print STDERR "Creating summaries from $statsdir ($startdate to $enddate)\n";

opendir SDIR, $statsdir or die "directory ${statsdir}: $!";
rewinddir SDIR;
@loopfiles=sort grep /loop.*$log_date_pattern/, readdir SDIR;
rewinddir SDIR;
@peerfiles=sort grep /peer.*$log_date_pattern/, readdir SDIR;
rewinddir SDIR;
@clockfiles=sort grep /clock.*$log_date_pattern/, readdir SDIR;
closedir SDIR;

# remove old summary files
map { unlink $_ if -f $_ } ($loop_summary, $peer_summary, $clock_summary);

my $date;
map {
    $date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
    if ($date ge $startdate && $date le $enddate) {
	do_loop $statsdir, $_, $loop_summary;
    }
} @loopfiles;

map {
    $date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
    if ($date ge $startdate && $date le $enddate) {
	do_peer $statsdir, $_, $peer_summary;
    }
} @peerfiles;

map {
    $date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
    if ($date ge $startdate && $date le $enddate) {
	do_clock $statsdir, $_, $clock_summary;
    }
} @clockfiles;

print STDERR "Creating peer summary with limit $peer_dist_limit\n";
peer_summary $peer_summary if (-f $peer_summary);
ntp-4.2.6p5/scripts/check--help0000755000175000017500000000060011510477207015306 0ustar  peterpeter#! /bin/sh

# Look at the file specified in $1 to see if it contains 'no --help'.
# If it does:
# - Squawk
# - rename the file to ($1)-
# - exit with a non-zero status.
# otherwise:
# - exit with a 0 status.

if test ! -f $1
then
	echo "$0: $1 is not a regular file!" 2>&3
	exit 1
fi

if grep -q 'no --help' $1
then
	echo "$0: $1 contains 'no --help'!" 2>&3
	mv ${1} ${1}-
	exit 1
fi
ntp-4.2.6p5/scripts/README0000644000175000017500000000306610017034601014155 0ustar  peterpeterREADME file for directory ./scripts of the NTP Version 4 distribution

This directory contains shell and perl script files for the configuration,
monitoring and support of NTP installations. See the README and RELNOTES
files in the parent directory for directions on how to use these files.

calc_tickadj	Calculates "optimal" value for tick given ntp.drift file

freq_adj	Calculates and optionally sets the clock frequency
		based on ntp.drift .  For FreeBSD systems.

mkver.in	script to create new version numbers for all sources

monitoring      directory containing perl scripts useful for monitoring
                operations

rc1		start/stop scripts for NTP

rc2		start/stop script for NTP

ntp-close	find public stratum 2 servers that don't respond

ntp-groper	script useful for reaching out and rattling the cages of
		NTP peers to see if animals are inside the bars

ntp-restart	script useful for killing and restarting the NTP daemon

ntp-wait	Blocks until ntpd is in state 4 (synchronized).
		Hopefully useful at boot time, to delay the boot sequence
		until after "ntpd -g" has set the time.

ntpsweep	prints per host given in  the NTP stratum level, the
		clock offset in seconds, the daemon version, the operating
		system and the processor.

ntpver		What version of the NTP daemon is running?

stats		directory containing awk and shell scripts useful for
		maintaining statistics summaries of clockstats, loopstats
		and peerstats files

support         directory containing shell and perl scripts useful for
                configuration and monitoring of NTP subnets
ntp-4.2.6p5/scripts/rc2/0000755000175000017500000000000011675461367014006 5ustar  peterpeterntp-4.2.6p5/scripts/rc2/local.ntpd0000644000175000017500000000206710017034603015746 0ustar  peterpeter#! /usr/bin/perl -w
# 980904 Harlan Stenn - created

# vvv CHANGE THESE vvv

$ps = "/bin/ps x |";

$ntp_conf = "/etc/ntp.conf";
$ntpd = "/usr/local/bin/xntpd";
$ntpdate = "/usr/local/bin/ntpdate -b -s 10.0.0.1 10.0.0.2";

# ^^^ CHANGE THESE ^^^

{
  if (0)
    {
    }
  elsif ($ARGV[0] eq "start")
    {
      @pidlist = pidlist($ntpd);
      if (defined(@pidlist))
        {
	  warn "NTP is already running\n";
        }
      else
        {
	  if ( -f $ntp_conf && -x $ntpd )
	    {
	       system ($ntpdate);
	       system ($ntpd." -c ".$ntp_conf);
	    }
        }
    }
  elsif ($ARGV[0] eq "stop")
    {
      @pidlist = pidlist($ntpd);
      kill 'TERM', @pidlist if (scalar(@pidlist) > 0);
    }
  else
    {
      die "Usage: $0 {start,stop}\n";
    }
}

sub pidlist ($)
  {
    my ($target) = @_;
    my ($qt) = quotemeta($target);
    my @pids;

    open(PS, $ps) || die "Can't run ps: $!\n";
    while ()
      {
	chomp;
	next unless (/$qt/);
	print "Got <$_>\n";
	if (/^\s*(\d+)\s+/)
	  {
	    push @pids, $1;
	  }
      }
    close(PS);
    return @pids;
  }
ntp-4.2.6p5/scripts/UpdatePoint0000755000175000017500000001277411314114376015476 0ustar  peterpeter#! /bin/sh

# showusage is set to 1 on any command-line syntax error
showusage=0
# are we playing by stable or dev rules?
repo=
# test is set to 1 if -t/--test is given to prevent modifications
test=0

case "$#" in
 1) repo=$1
    ;;
 2) repo=$2
    case $1 in
     -t|--test)
	test=1
	;;
     *)
	showusage=1
	;;
    esac
    ;;
 *) showusage=1
    ;;
esac

case "$repo" in
 dev|stable)
    ;;
 '')
    showusage=1
    ;;
 *) echo "Unexpected repo type: <$repo>!"
    showusage=1
    ;;
esac

case "$showusage" in
 1) echo "Usage: $0 [-t] "
    echo "No changes are made to packageinfo.sh if -t is given."
    exit 1
    ;;
esac


set -e
 
. ./packageinfo.sh

case "$repotype" in
 $repo)
    ;;
 *) echo "You indicated repo type <$repo> but packageinfo.sh"
    echo "indicates <$repotype>."
    exit 1
    ;;
esac

ver_repo_mismatch=1

case "$minor" in
 1|3|5|7|9)
    case "$repo" in
     dev)
	ver_repo_mismatch=0
	;;
     stable)
	;;
    esac
    ;;
 0|2|4|6|8)
    case "$repo" in
     dev)
	;;
     stable)
	ver_repo_mismatch=0
	;;
    esac
    ;;
esac

case "$ver_repo_mismatch" in
 1) echo "Minor version <$minor> mismatches repotype <$repo>."
    exit 1
    ;;
esac

# Do we want to bump the point?
bp=1
# Do we want to bump the beta point?
bbp=0
# Do we want to change the RC point? (n=no, z=empty rcpoint and zero
# betapoint, i=incr)
crcp=n
# Do we want to change the prerelease value?
setpr=0

# for stable:
# if we are not in a beta or RC state, enter beta unless point is NEW.
# if we are in a beta state:
# - bump the beta point
# else if we are in an RC state:
# - if rcpoint is GO:
# - - set rcpoint= (empty)
# - - set prerelease= (empty)
# - - set betapoint=0
# - else
# - - if rcpoint==(empty)
# - - - (bump-point) and set rcpoint to 0 (and fall thru, so -RC1 is first)
# - - bump the RC point

# for dev, we only want to bump-point and possibly clear prerelease, 
# but we do not modify rcpoint nor betapoint.

case "$repo" in
 dev)
    case "$point" in
     [Nn][Ee][Ww])
	crcp=z
	;;
     *)
	# crcp=n
	;;
    esac
    # bp=1
    ;;
 stable)
    case "$prerelease" in
     '')
	case "$betapoint::$rcpoint::$point" in
	 *::*::NEW)
	    # new minor release (no p)
	    crcp=z
	    # bp=1
	    ;;
	 0::::*)
	    # start of first beta cycle for the next point release
	    setpr=1
	    newpr=beta
	    # bp=1
	    bbp=1
	    ;;
	 0::[Gg][Oo]::*)
	    # skip all -beta and -RC prereleases to the next point.
	    crcp=z
	    setpr=1
	    newpr=
	    # bp=1
	    # bbp=0
	    ;;
	 *) echo "betapoint is <$betapoint>, rcpoint is <$rcpoint>"
	    echo "betapoint must be 0 and rcpoint must be empty to start the"
	    echo "beta cycle."
	    exit 1
	    ;;
	esac
	;;
     beta)
	case "$betapoint::$rcpoint" in
	 [1-9]*::*)
	    bp=0
	    bbp=1
	    ;;
	 0::) echo "betapoint is 0, rcpoint emtpy, and prerelease is beta."
	    echo "You probably intended prerelease=  (that is, empty).  It"
	    echo "will then be changed to beta by this script, starting the"
	    echo "first beta for the next point release."
	    exit 1
	    ;;
	 *)
	    bp=0
	    bbp=1
	    ;;
	esac
	case "$rcpoint" in
	 [Gg][Oo])
	    echo "prerelease is beta, rcpoint is GO, disallowed."
	    echo "rcpoint GO is allowed only when prerelease is RC or empty."
	    exit 1
	    ;;
	esac
	;;
     rc|RC)
	case "$rcpoint" in
	 '')
	    case "$betapoint" in
	     0) # bp=1
		;;
	     *) bp=0
		;;
	    esac
	    crcp=i
	    ;;
	 [1-9]*)
	    bp=0
	    crcp=i
	    ;;
	 [Gg][Oo])
	    bp=0
	    crcp=z
	    setpr=1
	    newpr=
	    ;;
	 *) echo "Unexpected value for 'rcpoint' <$rcpoint>!"
	    exit 1
	    ;;
	esac
	;;
     *)
	echo "prerelease <$prerelease> unexpected"
	exit 1
	;;
    esac
    ;;
 *) echo "impossible: repo <$repo>!"
    exit 1
    ;;
esac

case "$bp::$point" in
 0::*)
    newpoint=$point
    ;;
 1::[1-9]*)
    newpoint=`expr $point + 1`
    ;;
 1::)
    newpoint=1
    ;;
 1::[Nn][Ee][Ww])
    newpoint=
    ;;
 *) echo "Unexpected value for 'point' <$point>!"
    exit 1
    ;;
esac

case "$bbp::$betapoint" in
 0::*)
    newbetapoint=$betapoint
    ;;
 1::[0-9]*)
    newbetapoint=`expr $betapoint + 1`
    ;;
 *) echo "Unexpected value for 'betapoint' <$betapoint>!"
    exit 1
    ;;
esac

case "$crcp::$rcpoint" in
 n::*)
    newrcpoint=$rcpoint
    ;;
 i::)
    newrcpoint=1
    ;;
 i::[0-9]*)
    newrcpoint=`expr $rcpoint + 1`
    ;;
 z::*)
    newrcpoint=
    newbetapoint=0
    ;;
 *) echo "Unexpected value for 'crcp::rcpoint' <$crcp::$rcpoint>!"
    exit 1
    ;;
esac

case "$setpr" in
 0)
    newpr=$prerelease
esac

# display results
printf "prerelease		$prerelease"
case "$newpr" in
 $prerelease)
    printf "\n"
    ;;
 *) printf " -> $newpr\n"
    ;;
esac
printf "point			$point"
case "$newpoint" in
 $point)
    printf "\n"
    ;;
 *) printf " -> $newpoint\n"
    ;;
esac
printf "betapoint		$betapoint"
case "$newbetapoint" in
 $betapoint)
    printf "\n"
    ;;
 *) printf " -> $newbetapoint\n"
    ;;
esac
printf "rcpoint			$rcpoint"
case "$newrcpoint" in
 $rcpoint)
    printf "\n"
    ;;
 *) printf " -> $newrcpoint\n"
    ;;
esac

printf "Previous version: "
scripts/VersionName

# apply packageinfo.sh changes

sed -e "s/^point=.*/point=$newpoint/"			\
    -e "s/^betapoint=.*/betapoint=$newbetapoint/"	\
    -e "s/^rcpoint=.*/rcpoint=$newrcpoint/"		\
    -e "s/^prerelease=.*/prerelease=$newpr/"		\
	< packageinfo.sh					\
	> packageinfo.sh+

case "$test" in
 0)
    mv packageinfo.sh+ packageinfo.sh
    printf "Updated version: "
    scripts/VersionName
    ;;
 *)
    printf "Next version would be: "
    scripts/VersionName -p ./packageinfo.sh+
    rm packageinfo.sh+
    ;;
esac
ntp-4.2.6p5/scripts/VersionName0000755000175000017500000000153311314114377015460 0ustar  peterpeter#! /bin/sh
 
packageinfo='./packageinfo.sh'
case "$#" in
 2)
    case "$1" in
     -p|--packageinfo)
	packageinfo="$2"
    esac
    ;;
 0)
    ;;
 *) echo "Usage: $0 [-p packageinfo.sh]"
    exit 1
    ;;
esac

# This script must be executed from the TLD of the source tree...
. "$packageinfo"

NAME="$version"
case $point in
 [1-9]*)
    NAME="${NAME}p${point}"
    ;;
 NEW) ;;
 '') ;;
 *) echo "Unexpected value for 'point' <$point>!"
    exit 1
    ;;
esac

case $special in
 '') ;;
 *) NAME="${NAME}-${special}" ;;
esac

case "$prerelease::$repotype" in
 ''::*)
    ;;
 beta::stable)
    NAME="${NAME}-beta${betapoint}"
    ;;
 rc::dev|RC::dev)
    NAME="${NAME}-RC"
    ;;
 rc::stable|RC::stable)
    NAME="${NAME}-RC${rcpoint}"
    ;;
 *) echo "Unexpected value for 'prerelease::repotype' <$prerelease::$repotype>!"
    exit 1
    ;;
esac

echo "$NAME"
ntp-4.2.6p5/scripts/calc_tickadj.in0000644000175000017500000000125510017034601016216 0ustar  peterpeter#! @PATH_PERL@
#
# drift of 104.8576 -> +1 tick.  Base  of 10000 ticks.
#
# 970306 HMS Deal with nanoseconds.  Fix sign of adjustments.

$df="/etc/ntp.drift";
# Assumes a 100Hz box with "tick" of 10000
# Someday, we might call "tickadj" for better values...
$base=10000;	# tick: 1,000,000 / HZ
$cvt=104.8576;	# 2 ** 20 / $base
$v1=0.;
$v2="";

if (open(DF, $df))
  {
    if ($_=)
      {
        ($v1, $v2) = split;
      }

    while ($v1 < 0)
      {
        $v1 += $cvt;
        $base--;
      }

    while ($v1 > $cvt)
      {
        $v1 -= $cvt;
        $base++;
      }
  }

printf("%.3f (drift)\n", $v1);

printf("%d usec; %d nsec\n", $base, ($base + ($v1/$cvt)) * 1000);

ntp-4.2.6p5/config.guess0000755000175000017500000012673111606457142014151 0ustar  peterpeter#! /bin/sh
# Attempt to guess a canonical system name.
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
#   2011 Free Software Foundation, Inc.

timestamp='2011-06-03'

# This file 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 2 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.


# Originally written by Per Bothner.  Please send patches (context
# diff format) to  and include a ChangeLog
# entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub.  If it succeeds, it prints the system name on stdout, and
# exits with 0.  Otherwise, it exits with 1.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD

me=`echo "$0" | sed -e 's,.*/,,'`

usage="\
Usage: $0 [OPTION]

Output the configuration name of the system \`$me' is run on.

Operation modes:
  -h, --help         print this help, then exit
  -t, --time-stamp   print date of last modification, then exit
  -v, --version      print version number, then exit

Report bugs and patches to ."

version="\
GNU config.guess ($timestamp)

Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."

help="
Try \`$me --help' for more information."

# Parse command line
while test $# -gt 0 ; do
  case $1 in
    --time-stamp | --time* | -t )
       echo "$timestamp" ; exit ;;
    --version | -v )
       echo "$version" ; exit ;;
    --help | --h* | -h )
       echo "$usage"; exit ;;
    -- )     # Stop option processing
       shift; break ;;
    - )	# Use stdin as input.
       break ;;
    -* )
       echo "$me: invalid option $1$help" >&2
       exit 1 ;;
    * )
       break ;;
  esac
done

if test $# != 0; then
  echo "$me: too many arguments$help" >&2
  exit 1
fi

trap 'exit 1' 1 2 15

# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.

# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.

# Portable tmp directory creation inspired by the Autoconf team.

set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
 ,,)    echo "int x;" > $dummy.c ;
	for c in cc gcc c89 c99 ; do
	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
	     CC_FOR_BUILD="$c"; break ;
	  fi ;
	done ;
	if test x"$CC_FOR_BUILD" = x ; then
	  CC_FOR_BUILD=no_compiler_found ;
	fi
	;;
 ,,*)   CC_FOR_BUILD=$CC ;;
 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'

# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
	PATH=$PATH:/.attbin ; export PATH
fi

UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown

# Note: order is significant - the case branches are not exclusive.

case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
    *:NetBSD:*:*)
	# NetBSD (nbsd) targets should (where applicable) match one or
	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
	# switched to ELF, *-*-netbsd* would select the old
	# object file format.  This provides both forward
	# compatibility and a consistent mechanism for selecting the
	# object file format.
	#
	# Note: NetBSD doesn't particularly care about the vendor
	# portion of the name.  We always set it to "unknown".
	sysctl="sysctl -n hw.machine_arch"
	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
	case "${UNAME_MACHINE_ARCH}" in
	    armeb) machine=armeb-unknown ;;
	    arm*) machine=arm-unknown ;;
	    sh3el) machine=shl-unknown ;;
	    sh3eb) machine=sh-unknown ;;
	    sh5el) machine=sh5le-unknown ;;
	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
	esac
	# The Operating System including object format, if it has switched
	# to ELF recently, or will in the future.
	case "${UNAME_MACHINE_ARCH}" in
	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
		eval $set_cc_for_build
		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
			| grep -q __ELF__
		then
		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
		    # Return netbsd for either.  FIX?
		    os=netbsd
		else
		    os=netbsdelf
		fi
		;;
	    *)
		os=netbsd
		;;
	esac
	# The OS release
	# Debian GNU/NetBSD machines have a different userland, and
	# thus, need a distinct triplet. However, they do not need
	# kernel version information, so it can be replaced with a
	# suitable tag, in the style of linux-gnu.
	case "${UNAME_VERSION}" in
	    Debian*)
		release='-gnu'
		;;
	    *)
		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
		;;
	esac
	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
	# contains redundant information, the shorter form:
	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
	echo "${machine}-${os}${release}"
	exit ;;
    *:OpenBSD:*:*)
	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
	exit ;;
    *:ekkoBSD:*:*)
	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
	exit ;;
    *:SolidBSD:*:*)
	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
	exit ;;
    macppc:MirBSD:*:*)
	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
	exit ;;
    *:MirBSD:*:*)
	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
	exit ;;
    alpha:OSF1:*:*)
	case $UNAME_RELEASE in
	*4.0)
		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
		;;
	*5.*)
		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
		;;
	esac
	# According to Compaq, /usr/sbin/psrinfo has been available on
	# OSF/1 and Tru64 systems produced since 1995.  I hope that
	# covers most systems running today.  This code pipes the CPU
	# types through head -n 1, so we only detect the type of CPU 0.
	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
	case "$ALPHA_CPU_TYPE" in
	    "EV4 (21064)")
		UNAME_MACHINE="alpha" ;;
	    "EV4.5 (21064)")
		UNAME_MACHINE="alpha" ;;
	    "LCA4 (21066/21068)")
		UNAME_MACHINE="alpha" ;;
	    "EV5 (21164)")
		UNAME_MACHINE="alphaev5" ;;
	    "EV5.6 (21164A)")
		UNAME_MACHINE="alphaev56" ;;
	    "EV5.6 (21164PC)")
		UNAME_MACHINE="alphapca56" ;;
	    "EV5.7 (21164PC)")
		UNAME_MACHINE="alphapca57" ;;
	    "EV6 (21264)")
		UNAME_MACHINE="alphaev6" ;;
	    "EV6.7 (21264A)")
		UNAME_MACHINE="alphaev67" ;;
	    "EV6.8CB (21264C)")
		UNAME_MACHINE="alphaev68" ;;
	    "EV6.8AL (21264B)")
		UNAME_MACHINE="alphaev68" ;;
	    "EV6.8CX (21264D)")
		UNAME_MACHINE="alphaev68" ;;
	    "EV6.9A (21264/EV69A)")
		UNAME_MACHINE="alphaev69" ;;
	    "EV7 (21364)")
		UNAME_MACHINE="alphaev7" ;;
	    "EV7.9 (21364A)")
		UNAME_MACHINE="alphaev79" ;;
	esac
	# A Pn.n version is a patched version.
	# A Vn.n version is a released version.
	# A Tn.n version is a released field test version.
	# A Xn.n version is an unreleased experimental baselevel.
	# 1.2 uses "1.2" for uname -r.
	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
	exitcode=$?
	trap '' 0
	exit $exitcode ;;
    Alpha\ *:Windows_NT*:*)
	# How do we know it's Interix rather than the generic POSIX subsystem?
	# Should we change UNAME_MACHINE based on the output of uname instead
	# of the specific Alpha model?
	echo alpha-pc-interix
	exit ;;
    21064:Windows_NT:50:3)
	echo alpha-dec-winnt3.5
	exit ;;
    Amiga*:UNIX_System_V:4.0:*)
	echo m68k-unknown-sysv4
	exit ;;
    *:[Aa]miga[Oo][Ss]:*:*)
	echo ${UNAME_MACHINE}-unknown-amigaos
	exit ;;
    *:[Mm]orph[Oo][Ss]:*:*)
	echo ${UNAME_MACHINE}-unknown-morphos
	exit ;;
    *:OS/390:*:*)
	echo i370-ibm-openedition
	exit ;;
    *:z/VM:*:*)
	echo s390-ibm-zvmoe
	exit ;;
    *:OS400:*:*)
	echo powerpc-ibm-os400
	exit ;;
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
	echo arm-acorn-riscix${UNAME_RELEASE}
	exit ;;
    arm:riscos:*:*|arm:RISCOS:*:*)
	echo arm-unknown-riscos
	exit ;;
    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
	echo hppa1.1-hitachi-hiuxmpp
	exit ;;
    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
	if test "`(/bin/universe) 2>/dev/null`" = att ; then
		echo pyramid-pyramid-sysv3
	else
		echo pyramid-pyramid-bsd
	fi
	exit ;;
    NILE*:*:*:dcosx)
	echo pyramid-pyramid-svr4
	exit ;;
    DRS?6000:unix:4.0:6*)
	echo sparc-icl-nx6
	exit ;;
    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
	case `/usr/bin/uname -p` in
	    sparc) echo sparc-icl-nx7; exit ;;
	esac ;;
    s390x:SunOS:*:*)
	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
	exit ;;
    sun4H:SunOS:5.*:*)
	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
	exit ;;
    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
	exit ;;
    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
	echo i386-pc-auroraux${UNAME_RELEASE}
	exit ;;
    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
	eval $set_cc_for_build
	SUN_ARCH="i386"
	# If there is a compiler, see if it is configured for 64-bit objects.
	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
	# This test works for both compilers.
	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
		grep IS_64BIT_ARCH >/dev/null
	    then
		SUN_ARCH="x86_64"
	    fi
	fi
	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
	exit ;;
    sun4*:SunOS:6*:*)
	# According to config.sub, this is the proper way to canonicalize
	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
	# it's likely to be more like Solaris than SunOS4.
	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
	exit ;;
    sun4*:SunOS:*:*)
	case "`/usr/bin/arch -k`" in
	    Series*|S4*)
		UNAME_RELEASE=`uname -v`
		;;
	esac
	# Japanese Language versions have a version number like `4.1.3-JL'.
	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
	exit ;;
    sun3*:SunOS:*:*)
	echo m68k-sun-sunos${UNAME_RELEASE}
	exit ;;
    sun*:*:4.2BSD:*)
	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
	case "`/bin/arch`" in
	    sun3)
		echo m68k-sun-sunos${UNAME_RELEASE}
		;;
	    sun4)
		echo sparc-sun-sunos${UNAME_RELEASE}
		;;
	esac
	exit ;;
    aushp:SunOS:*:*)
	echo sparc-auspex-sunos${UNAME_RELEASE}
	exit ;;
    # The situation for MiNT is a little confusing.  The machine name
    # can be virtually everything (everything which is not
    # "atarist" or "atariste" at least should have a processor
    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
    # to the lowercase version "mint" (or "freemint").  Finally
    # the system name "TOS" denotes a system which is actually not
    # MiNT.  But MiNT is downward compatible to TOS, so this should
    # be no problem.
    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
	echo m68k-atari-mint${UNAME_RELEASE}
	exit ;;
    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
	echo m68k-atari-mint${UNAME_RELEASE}
	exit ;;
    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
	echo m68k-atari-mint${UNAME_RELEASE}
	exit ;;
    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
	echo m68k-milan-mint${UNAME_RELEASE}
	exit ;;
    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
	echo m68k-hades-mint${UNAME_RELEASE}
	exit ;;
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
	echo m68k-unknown-mint${UNAME_RELEASE}
	exit ;;
    m68k:machten:*:*)
	echo m68k-apple-machten${UNAME_RELEASE}
	exit ;;
    powerpc:machten:*:*)
	echo powerpc-apple-machten${UNAME_RELEASE}
	exit ;;
    RISC*:Mach:*:*)
	echo mips-dec-mach_bsd4.3
	exit ;;
    RISC*:ULTRIX:*:*)
	echo mips-dec-ultrix${UNAME_RELEASE}
	exit ;;
    VAX*:ULTRIX*:*:*)
	echo vax-dec-ultrix${UNAME_RELEASE}
	exit ;;
    2020:CLIX:*:* | 2430:CLIX:*:*)
	echo clipper-intergraph-clix${UNAME_RELEASE}
	exit ;;
    mips:*:*:UMIPS | mips:*:*:RISCos)
	eval $set_cc_for_build
	sed 's/^	//' << EOF >$dummy.c
#ifdef __cplusplus
#include   /* for printf() prototype */
	int main (int argc, char *argv[]) {
#else
	int main (argc, argv) int argc; char *argv[]; {
#endif
	#if defined (host_mips) && defined (MIPSEB)
	#if defined (SYSTYPE_SYSV)
	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
	#endif
	#if defined (SYSTYPE_SVR4)
	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
	#endif
	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
	#endif
	#endif
	  exit (-1);
	}
EOF
	$CC_FOR_BUILD -o $dummy $dummy.c &&
	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
	  SYSTEM_NAME=`$dummy $dummyarg` &&
	    { echo "$SYSTEM_NAME"; exit; }
	echo mips-mips-riscos${UNAME_RELEASE}
	exit ;;
    Motorola:PowerMAX_OS:*:*)
	echo powerpc-motorola-powermax
	exit ;;
    Motorola:*:4.3:PL8-*)
	echo powerpc-harris-powermax
	exit ;;
    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
	echo powerpc-harris-powermax
	exit ;;
    Night_Hawk:Power_UNIX:*:*)
	echo powerpc-harris-powerunix
	exit ;;
    m88k:CX/UX:7*:*)
	echo m88k-harris-cxux7
	exit ;;
    m88k:*:4*:R4*)
	echo m88k-motorola-sysv4
	exit ;;
    m88k:*:3*:R3*)
	echo m88k-motorola-sysv3
	exit ;;
    AViiON:dgux:*:*)
	# DG/UX returns AViiON for all architectures
	UNAME_PROCESSOR=`/usr/bin/uname -p`
	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
	then
	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
	       [ ${TARGET_BINARY_INTERFACE}x = x ]
	    then
		echo m88k-dg-dgux${UNAME_RELEASE}
	    else
		echo m88k-dg-dguxbcs${UNAME_RELEASE}
	    fi
	else
	    echo i586-dg-dgux${UNAME_RELEASE}
	fi
	exit ;;
    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
	echo m88k-dolphin-sysv3
	exit ;;
    M88*:*:R3*:*)
	# Delta 88k system running SVR3
	echo m88k-motorola-sysv3
	exit ;;
    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
	echo m88k-tektronix-sysv3
	exit ;;
    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
	echo m68k-tektronix-bsd
	exit ;;
    *:IRIX*:*:*)
	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
	exit ;;
    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
    i*86:AIX:*:*)
	echo i386-ibm-aix
	exit ;;
    ia64:AIX:*:*)
	if [ -x /usr/bin/oslevel ] ; then
		IBM_REV=`/usr/bin/oslevel`
	else
		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
	fi
	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
	exit ;;
    *:AIX:2:3)
	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
		eval $set_cc_for_build
		sed 's/^		//' << EOF >$dummy.c
		#include 

		main()
			{
			if (!__power_pc())
				exit(1);
			puts("powerpc-ibm-aix3.2.5");
			exit(0);
			}
EOF
		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
		then
			echo "$SYSTEM_NAME"
		else
			echo rs6000-ibm-aix3.2.5
		fi
	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
		echo rs6000-ibm-aix3.2.4
	else
		echo rs6000-ibm-aix3.2
	fi
	exit ;;
    *:AIX:*:[4567])
	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
		IBM_ARCH=rs6000
	else
		IBM_ARCH=powerpc
	fi
	if [ -x /usr/bin/oslevel ] ; then
		IBM_REV=`/usr/bin/oslevel`
	else
		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
	fi
	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
	exit ;;
    *:AIX:*:*)
	echo rs6000-ibm-aix
	exit ;;
    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
	echo romp-ibm-bsd4.4
	exit ;;
    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
	exit ;;                             # report: romp-ibm BSD 4.3
    *:BOSX:*:*)
	echo rs6000-bull-bosx
	exit ;;
    DPX/2?00:B.O.S.:*:*)
	echo m68k-bull-sysv3
	exit ;;
    9000/[34]??:4.3bsd:1.*:*)
	echo m68k-hp-bsd
	exit ;;
    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
	echo m68k-hp-bsd4.4
	exit ;;
    9000/[34678]??:HP-UX:*:*)
	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
	case "${UNAME_MACHINE}" in
	    9000/31? )            HP_ARCH=m68000 ;;
	    9000/[34]?? )         HP_ARCH=m68k ;;
	    9000/[678][0-9][0-9])
		if [ -x /usr/bin/getconf ]; then
		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
		    case "${sc_cpu_version}" in
		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
		      532)                      # CPU_PA_RISC2_0
			case "${sc_kernel_bits}" in
			  32) HP_ARCH="hppa2.0n" ;;
			  64) HP_ARCH="hppa2.0w" ;;
			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
			esac ;;
		    esac
		fi
		if [ "${HP_ARCH}" = "" ]; then
		    eval $set_cc_for_build
		    sed 's/^		//' << EOF >$dummy.c

		#define _HPUX_SOURCE
		#include 
		#include 

		int main ()
		{
		#if defined(_SC_KERNEL_BITS)
		    long bits = sysconf(_SC_KERNEL_BITS);
		#endif
		    long cpu  = sysconf (_SC_CPU_VERSION);

		    switch (cpu)
			{
			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
			case CPU_PA_RISC2_0:
		#if defined(_SC_KERNEL_BITS)
			    switch (bits)
				{
				case 64: puts ("hppa2.0w"); break;
				case 32: puts ("hppa2.0n"); break;
				default: puts ("hppa2.0"); break;
				} break;
		#else  /* !defined(_SC_KERNEL_BITS) */
			    puts ("hppa2.0"); break;
		#endif
			default: puts ("hppa1.0"); break;
			}
		    exit (0);
		}
EOF
		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
		    test -z "$HP_ARCH" && HP_ARCH=hppa
		fi ;;
	esac
	if [ ${HP_ARCH} = "hppa2.0w" ]
	then
	    eval $set_cc_for_build

	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
	    # generating 64-bit code.  GNU and HP use different nomenclature:
	    #
	    # $ CC_FOR_BUILD=cc ./config.guess
	    # => hppa2.0w-hp-hpux11.23
	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
	    # => hppa64-hp-hpux11.23

	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
		grep -q __LP64__
	    then
		HP_ARCH="hppa2.0w"
	    else
		HP_ARCH="hppa64"
	    fi
	fi
	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
	exit ;;
    ia64:HP-UX:*:*)
	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
	echo ia64-hp-hpux${HPUX_REV}
	exit ;;
    3050*:HI-UX:*:*)
	eval $set_cc_for_build
	sed 's/^	//' << EOF >$dummy.c
	#include 
	int
	main ()
	{
	  long cpu = sysconf (_SC_CPU_VERSION);
	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
	     results, however.  */
	  if (CPU_IS_PA_RISC (cpu))
	    {
	      switch (cpu)
		{
		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
		  default: puts ("hppa-hitachi-hiuxwe2"); break;
		}
	    }
	  else if (CPU_IS_HP_MC68K (cpu))
	    puts ("m68k-hitachi-hiuxwe2");
	  else puts ("unknown-hitachi-hiuxwe2");
	  exit (0);
	}
EOF
	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
		{ echo "$SYSTEM_NAME"; exit; }
	echo unknown-hitachi-hiuxwe2
	exit ;;
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
	echo hppa1.1-hp-bsd
	exit ;;
    9000/8??:4.3bsd:*:*)
	echo hppa1.0-hp-bsd
	exit ;;
    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
	echo hppa1.0-hp-mpeix
	exit ;;
    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
	echo hppa1.1-hp-osf
	exit ;;
    hp8??:OSF1:*:*)
	echo hppa1.0-hp-osf
	exit ;;
    i*86:OSF1:*:*)
	if [ -x /usr/sbin/sysversion ] ; then
	    echo ${UNAME_MACHINE}-unknown-osf1mk
	else
	    echo ${UNAME_MACHINE}-unknown-osf1
	fi
	exit ;;
    parisc*:Lites*:*:*)
	echo hppa1.1-hp-lites
	exit ;;
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
	echo c1-convex-bsd
	exit ;;
    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
	if getsysinfo -f scalar_acc
	then echo c32-convex-bsd
	else echo c2-convex-bsd
	fi
	exit ;;
    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
	echo c34-convex-bsd
	exit ;;
    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
	echo c38-convex-bsd
	exit ;;
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
	echo c4-convex-bsd
	exit ;;
    CRAY*Y-MP:*:*:*)
	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
	exit ;;
    CRAY*[A-Z]90:*:*:*)
	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
	      -e 's/\.[^.]*$/.X/'
	exit ;;
    CRAY*TS:*:*:*)
	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
	exit ;;
    CRAY*T3E:*:*:*)
	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
	exit ;;
    CRAY*SV1:*:*:*)
	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
	exit ;;
    *:UNICOS/mp:*:*)
	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
	exit ;;
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
	exit ;;
    5000:UNIX_System_V:4.*:*)
	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
	exit ;;
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
	exit ;;
    sparc*:BSD/OS:*:*)
	echo sparc-unknown-bsdi${UNAME_RELEASE}
	exit ;;
    *:BSD/OS:*:*)
	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
	exit ;;
    *:FreeBSD:*:*)
	case ${UNAME_MACHINE} in
	    pc98)
		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
	    amd64)
		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
	    *)
		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
	esac
	exit ;;
    i*:CYGWIN*:*)
	echo ${UNAME_MACHINE}-pc-cygwin
	exit ;;
    *:MINGW*:*)
	echo ${UNAME_MACHINE}-pc-mingw32
	exit ;;
    i*:windows32*:*)
	# uname -m includes "-pc" on this system.
	echo ${UNAME_MACHINE}-mingw32
	exit ;;
    i*:PW*:*)
	echo ${UNAME_MACHINE}-pc-pw32
	exit ;;
    *:Interix*:*)
	case ${UNAME_MACHINE} in
	    x86)
		echo i586-pc-interix${UNAME_RELEASE}
		exit ;;
	    authenticamd | genuineintel | EM64T)
		echo x86_64-unknown-interix${UNAME_RELEASE}
		exit ;;
	    IA64)
		echo ia64-unknown-interix${UNAME_RELEASE}
		exit ;;
	esac ;;
    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
	echo i${UNAME_MACHINE}-pc-mks
	exit ;;
    8664:Windows_NT:*)
	echo x86_64-pc-mks
	exit ;;
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
	# How do we know it's Interix rather than the generic POSIX subsystem?
	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
	# UNAME_MACHINE based on the output of uname instead of i386?
	echo i586-pc-interix
	exit ;;
    i*:UWIN*:*)
	echo ${UNAME_MACHINE}-pc-uwin
	exit ;;
    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
	echo x86_64-unknown-cygwin
	exit ;;
    p*:CYGWIN*:*)
	echo powerpcle-unknown-cygwin
	exit ;;
    prep*:SunOS:5.*:*)
	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
	exit ;;
    *:GNU:*:*)
	# the GNU system
	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
	exit ;;
    *:GNU/*:*:*)
	# other systems with GNU libc and userland
	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
	exit ;;
    i*86:Minix:*:*)
	echo ${UNAME_MACHINE}-pc-minix
	exit ;;
    alpha:Linux:*:*)
	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
	  EV5)   UNAME_MACHINE=alphaev5 ;;
	  EV56)  UNAME_MACHINE=alphaev56 ;;
	  PCA56) UNAME_MACHINE=alphapca56 ;;
	  PCA57) UNAME_MACHINE=alphapca56 ;;
	  EV6)   UNAME_MACHINE=alphaev6 ;;
	  EV67)  UNAME_MACHINE=alphaev67 ;;
	  EV68*) UNAME_MACHINE=alphaev68 ;;
	esac
	objdump --private-headers /bin/sh | grep -q ld.so.1
	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
	exit ;;
    arm*:Linux:*:*)
	eval $set_cc_for_build
	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
	    | grep -q __ARM_EABI__
	then
	    echo ${UNAME_MACHINE}-unknown-linux-gnu
	else
	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
		| grep -q __ARM_PCS_VFP
	    then
		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
	    else
		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
	    fi
	fi
	exit ;;
    avr32*:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    cris:Linux:*:*)
	echo cris-axis-linux-gnu
	exit ;;
    crisv32:Linux:*:*)
	echo crisv32-axis-linux-gnu
	exit ;;
    frv:Linux:*:*)
	echo frv-unknown-linux-gnu
	exit ;;
    i*86:Linux:*:*)
	LIBC=gnu
	eval $set_cc_for_build
	sed 's/^	//' << EOF >$dummy.c
	#ifdef __dietlibc__
	LIBC=dietlibc
	#endif
EOF
	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
	exit ;;
    ia64:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    m32r*:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    m68*:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    mips:Linux:*:* | mips64:Linux:*:*)
	eval $set_cc_for_build
	sed 's/^	//' << EOF >$dummy.c
	#undef CPU
	#undef ${UNAME_MACHINE}
	#undef ${UNAME_MACHINE}el
	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
	CPU=${UNAME_MACHINE}el
	#else
	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
	CPU=${UNAME_MACHINE}
	#else
	CPU=
	#endif
	#endif
EOF
	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
	;;
    or32:Linux:*:*)
	echo or32-unknown-linux-gnu
	exit ;;
    padre:Linux:*:*)
	echo sparc-unknown-linux-gnu
	exit ;;
    parisc64:Linux:*:* | hppa64:Linux:*:*)
	echo hppa64-unknown-linux-gnu
	exit ;;
    parisc:Linux:*:* | hppa:Linux:*:*)
	# Look for CPU level
	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
	  *)    echo hppa-unknown-linux-gnu ;;
	esac
	exit ;;
    ppc64:Linux:*:*)
	echo powerpc64-unknown-linux-gnu
	exit ;;
    ppc:Linux:*:*)
	echo powerpc-unknown-linux-gnu
	exit ;;
    s390:Linux:*:* | s390x:Linux:*:*)
	echo ${UNAME_MACHINE}-ibm-linux
	exit ;;
    sh64*:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    sh*:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    sparc:Linux:*:* | sparc64:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    tile*:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    vax:Linux:*:*)
	echo ${UNAME_MACHINE}-dec-linux-gnu
	exit ;;
    x86_64:Linux:*:*)
	echo x86_64-unknown-linux-gnu
	exit ;;
    xtensa*:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    i*86:DYNIX/ptx:4*:*)
	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
	# earlier versions are messed up and put the nodename in both
	# sysname and nodename.
	echo i386-sequent-sysv4
	exit ;;
    i*86:UNIX_SV:4.2MP:2.*)
	# Unixware is an offshoot of SVR4, but it has its own version
	# number series starting with 2...
	# I am not positive that other SVR4 systems won't match this,
	# I just have to hope.  -- rms.
	# Use sysv4.2uw... so that sysv4* matches it.
	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
	exit ;;
    i*86:OS/2:*:*)
	# If we were able to find `uname', then EMX Unix compatibility
	# is probably installed.
	echo ${UNAME_MACHINE}-pc-os2-emx
	exit ;;
    i*86:XTS-300:*:STOP)
	echo ${UNAME_MACHINE}-unknown-stop
	exit ;;
    i*86:atheos:*:*)
	echo ${UNAME_MACHINE}-unknown-atheos
	exit ;;
    i*86:syllable:*:*)
	echo ${UNAME_MACHINE}-pc-syllable
	exit ;;
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
	echo i386-unknown-lynxos${UNAME_RELEASE}
	exit ;;
    i*86:*DOS:*:*)
	echo ${UNAME_MACHINE}-pc-msdosdjgpp
	exit ;;
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
	else
		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
	fi
	exit ;;
    i*86:*:5:[678]*)
	# UnixWare 7.x, OpenUNIX and OpenServer 6.
	case `/bin/uname -X | grep "^Machine"` in
	    *486*)	     UNAME_MACHINE=i486 ;;
	    *Pentium)	     UNAME_MACHINE=i586 ;;
	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
	esac
	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
	exit ;;
    i*86:*:3.2:*)
	if test -f /usr/options/cb.name; then
		UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
			&& UNAME_MACHINE=i586
		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
			&& UNAME_MACHINE=i686
		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
			&& UNAME_MACHINE=i686
		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
	else
		echo ${UNAME_MACHINE}-pc-sysv32
	fi
	exit ;;
    pc:*:*:*)
	# Left here for compatibility:
	# uname -m prints for DJGPP always 'pc', but it prints nothing about
	# the processor, so we play safe by assuming i586.
	# Note: whatever this is, it MUST be the same as what config.sub
	# prints for the "djgpp" host, or else GDB configury will decide that
	# this is a cross-build.
	echo i586-pc-msdosdjgpp
	exit ;;
    Intel:Mach:3*:*)
	echo i386-pc-mach3
	exit ;;
    paragon:*:*:*)
	echo i860-intel-osf1
	exit ;;
    i860:*:4.*:*) # i860-SVR4
	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
	else # Add other i860-SVR4 vendors below as they are discovered.
	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
	fi
	exit ;;
    mini*:CTIX:SYS*5:*)
	# "miniframe"
	echo m68010-convergent-sysv
	exit ;;
    mc68k:UNIX:SYSTEM5:3.51m)
	echo m68k-convergent-sysv
	exit ;;
    M680?0:D-NIX:5.3:*)
	echo m68k-diab-dnix
	exit ;;
    M68*:*:R3V[5678]*:*)
	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
	OS_REL=''
	test -r /etc/.relid \
	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
	  && { echo i486-ncr-sysv4; exit; } ;;
    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
	OS_REL='.3'
	test -r /etc/.relid \
	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
	echo m68k-unknown-lynxos${UNAME_RELEASE}
	exit ;;
    mc68030:UNIX_System_V:4.*:*)
	echo m68k-atari-sysv4
	exit ;;
    TSUNAMI:LynxOS:2.*:*)
	echo sparc-unknown-lynxos${UNAME_RELEASE}
	exit ;;
    rs6000:LynxOS:2.*:*)
	echo rs6000-unknown-lynxos${UNAME_RELEASE}
	exit ;;
    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
	echo powerpc-unknown-lynxos${UNAME_RELEASE}
	exit ;;
    SM[BE]S:UNIX_SV:*:*)
	echo mips-dde-sysv${UNAME_RELEASE}
	exit ;;
    RM*:ReliantUNIX-*:*:*)
	echo mips-sni-sysv4
	exit ;;
    RM*:SINIX-*:*:*)
	echo mips-sni-sysv4
	exit ;;
    *:SINIX-*:*:*)
	if uname -p 2>/dev/null >/dev/null ; then
		UNAME_MACHINE=`(uname -p) 2>/dev/null`
		echo ${UNAME_MACHINE}-sni-sysv4
	else
		echo ns32k-sni-sysv
	fi
	exit ;;
    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
			# says 
	echo i586-unisys-sysv4
	exit ;;
    *:UNIX_System_V:4*:FTX*)
	# From Gerald Hewes .
	# How about differentiating between stratus architectures? -djm
	echo hppa1.1-stratus-sysv4
	exit ;;
    *:*:*:FTX*)
	# From seanf@swdc.stratus.com.
	echo i860-stratus-sysv4
	exit ;;
    i*86:VOS:*:*)
	# From Paul.Green@stratus.com.
	echo ${UNAME_MACHINE}-stratus-vos
	exit ;;
    *:VOS:*:*)
	# From Paul.Green@stratus.com.
	echo hppa1.1-stratus-vos
	exit ;;
    mc68*:A/UX:*:*)
	echo m68k-apple-aux${UNAME_RELEASE}
	exit ;;
    news*:NEWS-OS:6*:*)
	echo mips-sony-newsos6
	exit ;;
    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
	if [ -d /usr/nec ]; then
		echo mips-nec-sysv${UNAME_RELEASE}
	else
		echo mips-unknown-sysv${UNAME_RELEASE}
	fi
	exit ;;
    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
	echo powerpc-be-beos
	exit ;;
    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
	echo powerpc-apple-beos
	exit ;;
    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
	echo i586-pc-beos
	exit ;;
    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
	echo i586-pc-haiku
	exit ;;
    SX-4:SUPER-UX:*:*)
	echo sx4-nec-superux${UNAME_RELEASE}
	exit ;;
    SX-5:SUPER-UX:*:*)
	echo sx5-nec-superux${UNAME_RELEASE}
	exit ;;
    SX-6:SUPER-UX:*:*)
	echo sx6-nec-superux${UNAME_RELEASE}
	exit ;;
    SX-7:SUPER-UX:*:*)
	echo sx7-nec-superux${UNAME_RELEASE}
	exit ;;
    SX-8:SUPER-UX:*:*)
	echo sx8-nec-superux${UNAME_RELEASE}
	exit ;;
    SX-8R:SUPER-UX:*:*)
	echo sx8r-nec-superux${UNAME_RELEASE}
	exit ;;
    Power*:Rhapsody:*:*)
	echo powerpc-apple-rhapsody${UNAME_RELEASE}
	exit ;;
    *:Rhapsody:*:*)
	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
	exit ;;
    *:Darwin:*:*)
	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
	case $UNAME_PROCESSOR in
	    i386)
		eval $set_cc_for_build
		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
		      grep IS_64BIT_ARCH >/dev/null
		  then
		      UNAME_PROCESSOR="x86_64"
		  fi
		fi ;;
	    unknown) UNAME_PROCESSOR=powerpc ;;
	esac
	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
	exit ;;
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
	UNAME_PROCESSOR=`uname -p`
	if test "$UNAME_PROCESSOR" = "x86"; then
		UNAME_PROCESSOR=i386
		UNAME_MACHINE=pc
	fi
	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
	exit ;;
    *:QNX:*:4*)
	echo i386-pc-qnx
	exit ;;
    NEO-?:NONSTOP_KERNEL:*:*)
	echo neo-tandem-nsk${UNAME_RELEASE}
	exit ;;
    NSE-?:NONSTOP_KERNEL:*:*)
	echo nse-tandem-nsk${UNAME_RELEASE}
	exit ;;
    NSR-?:NONSTOP_KERNEL:*:*)
	echo nsr-tandem-nsk${UNAME_RELEASE}
	exit ;;
    *:NonStop-UX:*:*)
	echo mips-compaq-nonstopux
	exit ;;
    BS2000:POSIX*:*:*)
	echo bs2000-siemens-sysv
	exit ;;
    DS/*:UNIX_System_V:*:*)
	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
	exit ;;
    *:Plan9:*:*)
	# "uname -m" is not consistent, so use $cputype instead. 386
	# is converted to i386 for consistency with other x86
	# operating systems.
	if test "$cputype" = "386"; then
	    UNAME_MACHINE=i386
	else
	    UNAME_MACHINE="$cputype"
	fi
	echo ${UNAME_MACHINE}-unknown-plan9
	exit ;;
    *:TOPS-10:*:*)
	echo pdp10-unknown-tops10
	exit ;;
    *:TENEX:*:*)
	echo pdp10-unknown-tenex
	exit ;;
    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
	echo pdp10-dec-tops20
	exit ;;
    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
	echo pdp10-xkl-tops20
	exit ;;
    *:TOPS-20:*:*)
	echo pdp10-unknown-tops20
	exit ;;
    *:ITS:*:*)
	echo pdp10-unknown-its
	exit ;;
    SEI:*:*:SEIUX)
	echo mips-sei-seiux${UNAME_RELEASE}
	exit ;;
    *:DragonFly:*:*)
	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
	exit ;;
    *:*VMS:*:*)
	UNAME_MACHINE=`(uname -p) 2>/dev/null`
	case "${UNAME_MACHINE}" in
	    A*) echo alpha-dec-vms ; exit ;;
	    I*) echo ia64-dec-vms ; exit ;;
	    V*) echo vax-dec-vms ; exit ;;
	esac ;;
    *:XENIX:*:SysV)
	echo i386-pc-xenix
	exit ;;
    i*86:skyos:*:*)
	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
	exit ;;
    i*86:rdos:*:*)
	echo ${UNAME_MACHINE}-pc-rdos
	exit ;;
    i*86:AROS:*:*)
	echo ${UNAME_MACHINE}-pc-aros
	exit ;;
esac

#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2

eval $set_cc_for_build
cat >$dummy.c <
# include 
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
     I don't know....  */
  printf ("mips-sony-bsd\n"); exit (0);
#else
#include 
  printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
	"4"
#else
	""
#endif
	); exit (0);
#endif
#endif

#if defined (__arm) && defined (__acorn) && defined (__unix)
  printf ("arm-acorn-riscix\n"); exit (0);
#endif

#if defined (hp300) && !defined (hpux)
  printf ("m68k-hp-bsd\n"); exit (0);
#endif

#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
  int version;
  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  if (version < 4)
    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
  else
    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
  exit (0);
#endif

#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
  printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
  printf ("ns32k-encore-mach\n"); exit (0);
#else
  printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif

#if defined (__386BSD__)
  printf ("i386-pc-bsd\n"); exit (0);
#endif

#if defined (sequent)
#if defined (i386)
  printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
  printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif

#if defined (_SEQUENT_)
    struct utsname un;

    uname(&un);

    if (strncmp(un.version, "V2", 2) == 0) {
	printf ("i386-sequent-ptx2\n"); exit (0);
    }
    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
	printf ("i386-sequent-ptx1\n"); exit (0);
    }
    printf ("i386-sequent-ptx\n"); exit (0);

#endif

#if defined (vax)
# if !defined (ultrix)
#  include 
#  if defined (BSD)
#   if BSD == 43
      printf ("vax-dec-bsd4.3\n"); exit (0);
#   else
#    if BSD == 199006
      printf ("vax-dec-bsd4.3reno\n"); exit (0);
#    else
      printf ("vax-dec-bsd\n"); exit (0);
#    endif
#   endif
#  else
    printf ("vax-dec-bsd\n"); exit (0);
#  endif
# else
    printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif

#if defined (alliant) && defined (i860)
  printf ("i860-alliant-bsd\n"); exit (0);
#endif

  exit (1);
}
EOF

$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
	{ echo "$SYSTEM_NAME"; exit; }

# Apollos put the system type in the environment.

test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }

# Convex versions that predate uname can use getsysinfo(1)

if [ -x /usr/convex/getsysinfo ]
then
    case `getsysinfo -f cpu_type` in
    c1*)
	echo c1-convex-bsd
	exit ;;
    c2*)
	if getsysinfo -f scalar_acc
	then echo c32-convex-bsd
	else echo c2-convex-bsd
	fi
	exit ;;
    c34*)
	echo c34-convex-bsd
	exit ;;
    c38*)
	echo c38-convex-bsd
	exit ;;
    c4*)
	echo c4-convex-bsd
	exit ;;
    esac
fi

cat >&2 < in order to provide the needed
information to handle your system.

config.guess timestamp = $timestamp

uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`

/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`

hostinfo               = `(hostinfo) 2>/dev/null`
/bin/universe          = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch              = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`

UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM  = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF

exit 1

# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
ntp-4.2.6p5/include/0000755000175000017500000000000011710605402013230 5ustar  peterpeterntp-4.2.6p5/include/icom.h0000644000175000017500000000451011307651605014340 0ustar  peterpeter/*
 * Header file for ICOM radios
 */
#include "ntp_types.h"

/*
 * Common definitions
 */
#define P_ERMSG	0x1		/* trace bus error messages */
#define P_TRACE 0x2		/* trace CI-V messges */
#define RETRY	3		/* max packet retries */
#define IBAUD	B1200		/* autotune port speed */

/*
 * Radio identifier codes
 */
#define IC1271	0x24
#define IC1275	0x18
#define IC271	0x20
#define IC275	0x10
#define IC375	0x12
#define IC471	0x22
#define IC475	0x14
#define IC575	0x16
#define IC725	0x28
#define IC726	0x30
#define IC735	0x04
#define IC751	0x1c
#define IC761	0x1e
#define IC765	0x2c
#define IC775	0x46
#define IC781	0x26
#define IC970	0x2e
#define R7000	0x08
#define R71	0x1a
#define R7100	0x34
#define R72	0x32
#define R8500	0x4a
#define R9000	0x2a

/*
 * CI-V frame codes
 */
#define PR	0xfe		/* preamble */
#define TX	0xe0		/* controller address */
#define FI	0xfd		/* end of message */
#define ACK	0xfb		/* controller normal reply */
#define NAK	0xfa		/* controller error reply */
#define PAD	0xff		/* transmit padding */

/*
 * CI-V controller commands
 */
#define V_FREQT	0x00		/* freq set (transceive) */
#define V_MODET	0x01		/* set mode (transceive) */
#define V_RBAND	0x02		/* read band edge */
#define V_RFREQ	0x03		/* read frequency */
#define V_RMODE	0x04		/* read mode */
#define V_SFREQ	0x05		/* set frequency */
#define V_SMODE	0x06		/* set mode */
#define V_SVFO	0x07		/* select vfo */
#define V_SMEM	0x08		/* select channel/bank */
#define V_WRITE	0x09		/* write channel */
#define V_VFOM	0x0a		/* memory -> vfo */
#define V_CLEAR	0x0b		/* clear channel */
#define V_ROFFS	0x0c		/* read tx offset */
#define V_SOFFS	0x0d		/* write tx offset */
#define V_SCAN	0x0e		/* scan control */
#define V_SPLIT	0x0f		/* split control */
#define V_DIAL	0x10		/* set dial tuning step */
#define V_ATTEN	0x11		/* set attenuator */
#define V_SANT	0x12		/* select antenna */
#define V_ANNC	0x13		/* announce control */
#define V_WRCTL	0x14		/* write controls */
#define V_RDCTL	0x15		/* read controls */
#define V_TOGL	0x16		/* set switches */
#define V_ASCII	0x17		/* send CW message */
#define V_POWER	0x18		/* power control */
#define V_RDID	0x19		/* read model ID */
#define V_SETW	0x1a		/* read/write channel/bank data */
#define V_CTRL	0x7f		/* miscellaneous control */

/*
 * Function prototypes
 */
int	icom_init		(char *, int, int);
int	icom_freq		(int, int, double);
ntp-4.2.6p5/include/ntp_refclock.h0000644000175000017500000002017511665566225016101 0ustar  peterpeter/*
 * ntp_refclock.h - definitions for reference clock support
 */

#ifndef NTP_REFCLOCK_H
#define NTP_REFCLOCK_H

#include "ntp_types.h"

#if defined(HAVE_BSD_TTYS)
#include 
#endif /* HAVE_BSD_TTYS */

#if defined(HAVE_SYSV_TTYS)
#include 
#endif /* HAVE_SYSV_TTYS */

#if defined(HAVE_TERMIOS)
# ifdef TERMIOS_NEEDS__SVID3
#  define _SVID3
# endif
# include 
# ifdef TERMIOS_NEEDS__SVID3
#  undef _SVID3
# endif
#endif

#if defined(HAVE_SYS_MODEM_H)
#include 
#endif

#if 0 /* If you need that, include ntp_io.h instead */
#if defined(STREAM)
#include 
#if defined(CLK) /* This is never defined, except perhaps by a system header file */
#include 
#endif /* CLK */
#endif /* STREAM */
#endif

#include "recvbuff.h"

#if !defined(SYSV_TTYS) && !defined(STREAM) & !defined(BSD_TTYS)
#define BSD_TTYS
#endif /* SYSV_TTYS STREAM BSD_TTYS */

#define SAMPLE(x)	pp->coderecv = (pp->coderecv + 1) % MAXSTAGE; \
			pp->filter[pp->coderecv] = (x); \
			if (pp->coderecv == pp->codeproc) \
				pp->codeproc = (pp->codeproc + 1) % MAXSTAGE;

/*
 * Macros to determine the clock type and unit numbers from a
 * 127.127.t.u address
 */
#define	REFCLOCKTYPE(srcadr)	((SRCADR(srcadr) >> 8) & 0xff)
#define REFCLOCKUNIT(srcadr)	(SRCADR(srcadr) & 0xff)

/*
 * List of reference clock names and descriptions. These must agree with
 * lib/clocktypes.c and ntpd/refclock_conf.c.
 */
struct clktype {
	int code;		/* driver "major" number */
	const char *clocktype;	/* long description */
	const char *abbrev;	/* short description */
};
extern struct clktype clktypes[];

/*
 * Configuration flag values
 */
#define	CLK_HAVETIME1	0x1
#define	CLK_HAVETIME2	0x2
#define	CLK_HAVEVAL1	0x4
#define	CLK_HAVEVAL2	0x8

#define	CLK_FLAG1	0x1
#define	CLK_FLAG2	0x2
#define	CLK_FLAG3	0x4
#define	CLK_FLAG4	0x8

#define	CLK_HAVEFLAG1	0x10
#define	CLK_HAVEFLAG2	0x20
#define	CLK_HAVEFLAG3	0x40
#define	CLK_HAVEFLAG4	0x80

/*
 * Constant for disabling event reporting in
 * refclock_receive. ORed in leap
 * parameter
 */
#define REFCLOCK_OWN_STATES	0x80

/*
 * Structure for returning clock status
 */
struct refclockstat {
	u_char	type;		/* clock type */
	u_char	flags;		/* clock flags */
	u_char	haveflags;	/* bit array of valid flags */
	u_short	lencode;	/* length of last timecode */
	const char *p_lastcode;	/* last timecode received */
	u_int32	polls;		/* transmit polls */
	u_int32	noresponse;	/* no response to poll */
	u_int32	badformat;	/* bad format timecode received */
	u_int32	baddata;	/* invalid data timecode received */
	u_int32	timereset;	/* driver resets */
	const char *clockdesc;	/* ASCII description */
	double	fudgetime1;	/* configure fudge time1 */
	double	fudgetime2;	/* configure fudge time2 */
	int32	fudgeval1;	/* configure fudge value1 */
	u_int32	fudgeval2;	/* configure fudge value2 */
	u_char	currentstatus;	/* clock status */
	u_char	lastevent;	/* last exception event */
	u_char	leap;		/* leap bits */
	struct	ctl_var *kv_list; /* additional variables */
};

/*
 * Reference clock I/O structure.  Used to provide an interface between
 * the reference clock drivers and the I/O module.
 */
struct refclockio {
	struct	refclockio *next; /* link to next structure */
	void	(*clock_recv) (struct recvbuf *); /* completion routine */
	int 	(*io_input)   (struct recvbuf *); /* input routine -
				to avoid excessive buffer use
				due to small bursts
				of refclock input data */
	caddr_t	srcclock;	/* pointer to clock structure */
	int	datalen;	/* lenth of data */
	int	fd;		/* file descriptor */
	u_long	recvcount;	/* count of receive completions */
};

/*
 * Structure for returning debugging info
 */
#define	NCLKBUGVALUES	16
#define	NCLKBUGTIMES	32

struct refclockbug {
	u_char	nvalues;	/* values following */
	u_char	ntimes;		/* times following */
	u_short	svalues;	/* values format sign array */
	u_int32	stimes;		/* times format sign array */
	u_int32	values[NCLKBUGVALUES]; /* real values */
	l_fp	times[NCLKBUGTIMES]; /* real times */
};

/*
 * Structure interface between the reference clock support
 * ntp_refclock.c and the driver utility routines
 */
#define MAXSTAGE	60	/* max median filter stages  */
#define NSTAGE		5	/* default median filter stages */
#define BMAX		128	/* max timecode length */
#define GMT		0	/* I hope nobody sees this */
#define MAXDIAL		60	/* max length of modem dial strings */

/*
 * Line discipline flags. These require line discipline or streams
 * modules to be installed/loaded in the kernel. If specified, but not
 * installed, the code runs as if unspecified.
 */
#define LDISC_STD	0x00	/* standard */
#define LDISC_CLK	0x01	/* tty_clk \n intercept */
#define LDISC_CLKPPS	0x02	/* tty_clk \377 intercept */
#define LDISC_ACTS	0x04	/* tty_clk #* intercept */
#define LDISC_CHU	0x08	/* depredated */
#define LDISC_PPS	0x10	/* ppsclock, ppsapi */
#define LDISC_RAW	0x20	/* raw binary */
#define LDISC_ECHO	0x40	/* enable echo */
#define	LDISC_REMOTE	0x80	/* remote mode */
#define	LDISC_7O1      0x100    /* 7-bit, odd parity for Z3801A */

struct refclockproc {
	struct	refclockio io;	/* I/O handler structure */
	void *	unitptr;	/* pointer to unit structure */
	u_char	leap;		/* leap/synchronization code */
	u_char	currentstatus;	/* clock status */
	u_char	lastevent;	/* last exception event */
	u_char	type;		/* clock type */
	const char *clockdesc;	/* clock description */

	char	a_lastcode[BMAX]; /* last timecode received */
	int	lencode;	/* length of last timecode */

	int	year;		/* year of eternity */
	int	day;		/* day of year */
	int	hour;		/* hour of day */
	int	minute;		/* minute of hour */
	int	second;		/* second of minute */
	long	nsec;		/* nanosecond of second */
	u_long	yearstart;	/* beginning of year */
	int	coderecv;	/* put pointer */
	int	codeproc;	/* get pointer */
	l_fp	lastref;	/* reference timestamp */
	l_fp	lastrec;	/* receive timestamp */
	double	offset;		/* mean offset */
	double	disp;		/* sample dispersion */
	double	jitter;		/* jitter (mean squares) */
	double	filter[MAXSTAGE]; /* median filter */

	/*
	 * Configuration data
	 */
	double	fudgetime1;	/* fudge time1 */
	double	fudgetime2;	/* fudge time2 */
	u_char	stratum;	/* server stratum */
	u_int32	refid;		/* reference identifier */
	u_char	sloppyclockflag; /* fudge flags */

	/*
	 * Status tallies
 	 */
	u_long	timestarted;	/* time we started this */
	u_long	polls;		/* polls sent */
	u_long	noreply;	/* no replies to polls */
	u_long	badformat;	/* bad format reply */
	u_long	baddata;	/* bad data reply */
};

/*
 * Structure interface between the reference clock support
 * ntp_refclock.c and particular clock drivers. This must agree with the
 * structure defined in the driver.
 */
#define	noentry	0		/* flag for null routine */
#define	NOFLAGS	0		/* flag for null flags */

struct refclock {
	int (*clock_start)	(int, struct peer *);
	void (*clock_shutdown)	(int, struct peer *);
	void (*clock_poll)	(int, struct peer *);
	void (*clock_control)	(int, struct refclockstat *,
				    struct refclockstat *, struct peer *);
	void (*clock_init)	(void);
	void (*clock_buginfo)	(int, struct refclockbug *, struct peer *);
	void (*clock_timer)	(int, struct peer *);
};

/*
 * Function prototypes
 */
/*
 * auxiliary PPS interface (implemented by refclock_atom())
 */
extern	int	pps_sample (l_fp *);
extern	int	io_addclock_simple (struct refclockio *);
extern	int	io_addclock	(struct refclockio *);
extern	void	io_closeclock	(struct refclockio *);

#ifdef REFCLOCK
extern	void	refclock_buginfo (sockaddr_u *,
				    struct refclockbug *);
extern	void	refclock_control (sockaddr_u *,
				    struct refclockstat *,
				    struct refclockstat *);
extern	int	refclock_open	(char *, u_int, u_int);
extern	int	refclock_setup	(int, u_int, u_int);
extern	void	refclock_timer	(struct peer *);
extern	void	refclock_transmit (struct peer *);
extern	int	refclock_ioctl	(int, u_int);
extern 	int	refclock_process (struct refclockproc *);
extern 	int	refclock_process_f (struct refclockproc *, double);
extern 	void	refclock_process_offset (struct refclockproc *, l_fp, l_fp, double);
extern	void	refclock_report	(struct peer *, int);
extern	int	refclock_gtlin	(struct recvbuf *, char *, int, l_fp *);
extern	int	refclock_gtraw  (struct recvbuf *, char *, int, l_fp *);
#endif /* REFCLOCK */

#endif /* NTP_REFCLOCK_H */
ntp-4.2.6p5/include/ntp_datum.h0000644000175000017500000000210410017034543015372 0ustar  peterpeterstruct btfp_time                /* Structure for reading 5 time words   */
                                /* in one ioctl(2) operation.           */
{
  unsigned short btfp_time[5];  /* Time words 0,1,2,3, and 4. (16bit)*/
};

/***** Simple ioctl commands *****/

#define RUNLOCK   _IO('X',19)                   /* Release Capture Lockout */
#define RCR0      _IOR('X',22,unsigned int)     /* Read control register */
#define WCR0      _IOW('X',23,unsigned int)     /* Write control register */

/***** Compound ioctl commands *****/

/* Read all 5 time words in one call.   */
#define READTIME        _IOR('X',32,struct btfp_time)
#define VMEFD "/dev/btfp0"

 struct vmedate {               /* structure returned by get_vmetime.c */
         unsigned short year;
         unsigned short doy;
         unsigned short hr;
         unsigned short mn;
         unsigned short sec;
         unsigned long frac;
         unsigned short status;
         };

#define PRIO    120               /* set the realtime priority */
#define NREGS 7                    /* number of registers we will use */
ntp-4.2.6p5/include/hopf6039.h0000644000175000017500000000701510017034542014662 0ustar  peterpeter/****************************************************************************/
/*      hopf6039.h                                                          */     
/*      hopf Elektronik 6039 PCI radio clock header                         */
/*      (c) 1999, 2000 Bernd Altmeier                  */
/*      Rev. 1.00 Date 25.03.2000                                           */
/*      History:                                                            */
/****************************************************************************/

#ifndef _hopf6039_H_
#define _hopf6039_H_

#define HOPF_MAXVERSION			8
#define	HOPF_CNTR_MEM_LEN		0x7f
#define	HOPF_DATA_MEM_LEN		0x3ff	/* this is our memory size */

/* macros and definition for 32 to 16 to 8 bit conversion */

typedef unsigned long       DWORD;
typedef unsigned char       BYTE;
typedef unsigned short      WORD;

#define LOWORD(l)     ((WORD)(l))
#define HIWORD(l)     ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
#define LOBYTE(w)     ((BYTE)(w))
#define HIBYTE(w)     ((BYTE)(((WORD)(w) >> 8) & 0xFF))

/* iocntl codes for driver access */

#define HOPF_CLOCK_CMD_MASK 0xff000

#define HOPF_CLOCK_GET_LOCAL		0x10000 
#define HOPF_CLOCK_GET_UTC		0x20000
#define HOPF_CLOCK_GET_ANTENNA		0x30000
#define HOPF_CLOCK_GET_DIFFERENCE	0x40000
#define HOPF_CLOCK_GET_VERSION		0x50000
#define HOPF_CLOCK_GET_POSITION		0x60000
#define HOPF_CLOCK_GET_SATDATA		0x70000
#define HOPF_CLOCK_GET_SYSTEMBYTE	0x80000
#define HOPF_CLOCK_GET_IRIG		0x90000

#define HOPF_CLOCK_SET_DIFFERENCE	0x01000
#define HOPF_CLOCK_SET_ANTENNA		0x02000
#define HOPF_CLOCK_SET_TIME 		0x03000
#define HOPF_CLOCK_SET_POSITION		0x04000
#define HOPF_CLOCK_SET_SATMODE		0x05000
#define HOPF_CLOCK_SET_SYSTEMBYTE	0x06000
#define HOPF_CLOCK_SET_RESET		0x07000
#define HOPF_CLOCK_SET_IRIG		0x08000

/* clock command codes */

#define HOPF_CLOCK_HARDRESET		0x00008000
#define HOPF_CLOCK_SOFTRESET		0x00004000

/* sat-information */

typedef struct SatStat{    
	BYTE wVisible;    
	BYTE wMode;
	BYTE wSat0;
	BYTE wRat0;
	BYTE wSat1;
	BYTE wRat1;
	BYTE wSat2;
	BYTE wRat2;
	BYTE wSat3;
	BYTE wRat3;
	BYTE wSat4;
	BYTE wRat4;
	BYTE wSat5;
	BYTE wRat5;
	BYTE wSat6;
	BYTE wRat6;
	BYTE wSat7;
	BYTE wRat7;
} SatStat;

/* GPS position */

typedef struct GPSPos {  /* Position */
	long wAltitude;   
	long wLongitude;   
	long wLatitude;    
} GPSPos;

/* clock hardware version */

typedef struct ClockVersion {    
	char cVersion[255];  /* Hardware Version like " DCF-RECEIVER,   VERSION 01.01, DAT: 23.NOV.1999" */
	char dVersion[255];  /* Driver Version */
} ClockVersion;

/* hopftime what you think */

typedef struct HOPFTIME { 
    unsigned int wYear; 
    unsigned int wMonth; 
    unsigned int wDayOfWeek; 
    unsigned int wDay; 
    unsigned int wHour; 
    unsigned int wMinute; 
    unsigned int wSecond; 
    unsigned int wMilliseconds; 
    unsigned int wStatus; 
} HOPFTIME; 

/* DCF77 antenna alignment */

typedef struct DcfAntenne {    
	BYTE bStatus;    
	BYTE bStatus1;    
	WORD wAntValue;    
} DcfAntenne;

/* hopf PCI clock */

typedef struct hopfCard {
	char name[32];
	unsigned irq;
	unsigned long membase; /* without mmap */
	unsigned int port;

	int versionlen;
	char versionbuf[1024];
	char *version[HOPF_MAXVERSION];
	char cardname[32];
	int interrupt;
	void *mbase;		   /* this will be our memory base address */

} hopfCard;

typedef struct cardparams {
	unsigned int port;
	unsigned irq;
	int cardtype;
	int cardnr;
	unsigned int membase;
} cardparams;


#define WRITE_REGISTER		0x00
#define READ_REGISTER		0x01

#endif /* _hopf6039_H_ */
ntp-4.2.6p5/include/ntp_config.h0000644000175000017500000001273411362536523015550 0ustar  peterpeter#ifndef NTP_CONFIG_H
#define NTP_CONFIG_H

#include "ntp_machine.h"
#include "ntp_data_structures.h"
#include "ntpsim.h"


/*
 * Configuration file name
 */
#ifndef CONFIG_FILE
# ifndef SYS_WINNT
#  define	CONFIG_FILE "/etc/ntp.conf"
# else /* SYS_WINNT */
#  define	CONFIG_FILE	"%windir%\\system32\\drivers\\etc\\ntp.conf"
#  define	ALT_CONFIG_FILE "%windir%\\ntp.conf"
#  define	NTP_KEYSDIR	"%windir%\\system32\\drivers\\etc"
# endif /* SYS_WINNT */
#endif /* not CONFIG_FILE */

#ifdef HAVE_IPTOS_SUPPORT
/* 
 * "qos" modified keywords 
 */
#define	CONF_QOS_LOWDELAY		1
#define CONF_QOS_THROUGHPUT		2
#define CONF_QOS_RELIABILITY		3
#define CONF_QOS_MINCOST		4

#ifdef 		IPTOS_PREC_INTERNETCONTROL
#define CONF_QOS_CS0			5
#define CONF_QOS_CS1			6
#define CONF_QOS_CS2			7
#define CONF_QOS_CS3			8
#define CONF_QOS_CS4			9
#define CONF_QOS_CS5			10
#define CONF_QOS_CS6			11
#define CONF_QOS_CS7			12
#endif		/* IPTOS_PREC_INTERNETCONTROL */

#endif	/* HAVE_IPTOS_SUPPORT */


/*
 * We keep config trees around for possible saveconfig use.  When
 * built with configure --disable-saveconfig, and when built with
 * debugging enabled, include the free_config_*() routines.  In the
 * DEBUG case, they are used in an atexit() cleanup routine to make
 * postmortem leak check reports more interesting.
 */
#if !defined(FREE_CFG_T) && (!defined(SAVECONFIG) || defined(DEBUG))
#define FREE_CFG_T
#endif

/* Limits */
#define MAXLINE 1024

/* Configuration sources */

#define CONF_SOURCE_FILE		0
#define CONF_SOURCE_NTPQ		1


/* Structure for storing an attribute-value pair  */
struct attr_val {
    int attr;
    union val {
 	double	d;
 	int	i;
	u_int	u;
 	char *	s;
	void *	p;
    } value;
    int type;
};

/* Structure for nodes on the syntax tree */
struct address_node {
    char *address;
    int type;
};

struct restrict_node {
    struct address_node *addr;
    struct address_node *mask;
    queue *flags;
    int line_no;
};

struct peer_node {
    int host_mode;
    struct address_node *addr;
    queue *peerflags;
    int minpoll;
    int maxpoll;
    int ttl;
    int peerversion;
    int peerkey;
    double bias;
};

struct unpeer_node {
	u_int			assocID;
	struct address_node *	addr;
};

struct auth_node {
    int control_key;
    int cryptosw;
    queue *crypto_cmd_list;
    char *keys;
    char *keysdir;
    int request_key;
    int revoke;
    queue *trusted_key_list;
    char *ntp_signd_socket;
};

struct filegen_node {
	int	filegen_token;
	queue *	options;
};

struct setvar_node {
	char *	var;
	char *	val;
	int	isdefault;
};

typedef struct nic_rule_node_tag {
    int match_class;
    char *if_name;	/* interface name or numeric address */
    int action;
} nic_rule_node;

struct addr_opts_node {
    struct address_node *addr;
    queue *options;
};

struct sim_node {
    queue *init_opts;
    queue *servers;
};


/* The syntax tree */
struct config_tree {
    struct config_tree *link;

    struct attr_val source;
    time_t timestamp;

    queue *peers;
    queue *unpeers;

    /* Other Modes */
    int broadcastclient;
    queue *manycastserver;
    queue *multicastclient;

    queue *orphan_cmds;

    /* Monitoring Configuration */
    queue *stats_list;
    char *stats_dir;
    queue *filegen_opts;

    /* Access Control Configuration */
    queue *discard_opts;
    queue *restrict_opts;

    queue *fudge;
    queue *tinker;
    queue *enable_opts;
    queue *disable_opts;
    struct auth_node auth;

    queue *logconfig;
    queue *qos;
    queue *phone;
    queue *setvar;
    queue *ttl;
    queue *trap;
    queue *vars;
    queue *nic_rules;

    struct sim_node *sim_details;
};


/* Structure for holding a remote configuration command */
struct REMOTE_CONFIG_INFO {
	char buffer[MAXLINE];
	char err_msg[MAXLINE];
	int pos;
	int err_pos;
	int no_errors;
};

/* get text from T_ tokens */
const char * token_name(int token);

struct peer_node *create_peer_node(int hmode,
				   struct address_node *addr,
				   queue *options);
struct unpeer_node *create_unpeer_node(struct address_node *addr);
struct address_node *create_address_node(char *addr, int type);
void destroy_address_node(struct address_node *my_node);
queue *enqueue_in_new_queue(void *my_node);
struct attr_val *create_attr_dval(int attr, double value);
struct attr_val *create_attr_ival(int attr, int value);
struct attr_val *create_attr_shorts(int, ntp_u_int16_t, ntp_u_int16_t);
struct attr_val *create_attr_sval(int attr, char *s);
struct attr_val *create_attr_pval(int attr, void *s);
struct filegen_node *create_filegen_node(int filegen_token, queue *options);
void **create_pval(void *val);
struct restrict_node *create_restrict_node(struct address_node *addr,
					   struct address_node *mask,
					   queue *flags, int line_no);
int *create_ival(int val);
struct addr_opts_node *create_addr_opts_node(struct address_node *addr,
					     queue *options);
struct sim_node *create_sim_node(queue *init_opts, queue *servers);
struct setvar_node *create_setvar_node(char *var, char *val,
				       int isdefault);
nic_rule_node *create_nic_rule_node(int match_class, char *if_name,
				    int action);

script_info *create_sim_script_info(double duration,
				    queue *script_queue);
server_info *create_sim_server(struct address_node *addr,
			       double server_offset, queue *script);

extern struct REMOTE_CONFIG_INFO remote_config;
void config_remotely(sockaddr_u *);

#ifdef SAVECONFIG
int dump_config_tree(struct config_tree *ptree, FILE *df, int comment);
int dump_all_config_trees(FILE *df, int comment);
#endif


#endif	/* !defined(NTP_CONFIG_H) */
ntp-4.2.6p5/include/ntp_proto.h0000644000175000017500000000022610017034544015427 0ustar  peterpeter#ifndef __ntp_proto_h
#define __ntp_proto_h

#ifdef HAVE_CONFIG_H
#include 
#endif

#define NTP_MAXFREQ	500e-6
 
#endif /* __ntp_proto_h */
ntp-4.2.6p5/include/ntp_sprintf.h0000644000175000017500000000052510017034544015753 0ustar  peterpeter/*
 * Handle ancient char* *s*printf*() systems
 */

#ifdef SPRINTF_CHAR
# define SPRINTF(x)	strlen(sprintf/**/x)
# define SNPRINTF(x)	strlen(snprintf/**/x)
# define VSNPRINTF(x)	strlen(vsnprintf/**/x)
#else
# define SPRINTF(x)	((size_t)sprintf x)
# define SNPRINTF(x)	((size_t)snprintf x)
# define VSNPRINTF(x)	((size_t)vsnprintf x)
#endif
ntp-4.2.6p5/include/audio.h0000644000175000017500000000042511307651603014511 0ustar  peterpeter/*
 * Header file for audio drivers
 */
#include "ntp_types.h"

#define MAXGAIN		255	/* max codec gain */
#define	MONGAIN		127	/* codec monitor gain */

/*
 * Function prototypes
 */
int	audio_init		(char *, int, int);
int	audio_gain		(int, int, int);
void	audio_show		(void);
ntp-4.2.6p5/include/ntp_tty.h0000644000175000017500000000177610441361223015115 0ustar  peterpeter/*
 * ntp_tty.h - header file for serial lines handling
 */

#ifndef NTP_TTY_H
#define NTP_TTY_H

#if defined(HAVE_BSD_TTYS)
#include 
#define TTY	struct sgttyb
#endif /* HAVE_BSD_TTYS */

#if defined(HAVE_SYSV_TTYS)
#include 
#define TTY	struct termio
#ifndef tcsetattr
#define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)
#endif
#ifndef TCSANOW
#define TCSANOW	TCSETA
#endif
#ifndef TCIFLUSH
#define TCIFLUSH 0
#endif
#ifndef TCOFLUSH
#define TCOFLUSH 1
#endif
#ifndef TCIOFLUSH
#define TCIOFLUSH 2
#endif
#ifndef tcflush
#define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)
#endif
#endif /* HAVE_SYSV_TTYS */

#if defined(HAVE_TERMIOS)
# ifdef TERMIOS_NEEDS__SVID3
#  define _SVID3
# endif
# include 
# ifdef TERMIOS_NEEDS__SVID3
#  undef _SVID3
# endif
#define TTY	struct termios
#endif

#if defined(HAVE_SYS_MODEM_H)
#include 
#endif

#if !defined(SYSV_TTYS) && !defined(STREAM) & !defined(BSD_TTYS)
#define BSD_TTYS
#endif /* SYSV_TTYS STREAM BSD_TTYS */

#endif /* NTP_TTY_H */
ntp-4.2.6p5/include/homerc.def0000644000175000017500000000022110610132705015157 0ustar  peterpeter/* -*- Mode: Text -*- */

#ifndef __windows__
rcfile         = ".ntprc";
#else
rcfile         = "ntp.ini";
#endif

homerc         =  $HOME, ".";
ntp-4.2.6p5/include/ntp_string.h0000644000175000017500000000177211307651603015605 0ustar  peterpeter/*
 * Define string ops: strchr strrchr memcmp memmove memset 
 */

#ifndef  _ntp_string_h
#define  _ntp_string_h

#ifdef HAVE_CONFIG_H
#include 
#endif

#ifdef HAVE_MEMORY_H
# include 
#endif

#ifdef HAVE_STRING_H
# include 
#endif

#ifdef HAVE_BSTRING_H
# include 
#endif

#ifndef STDC_HEADERS
# ifndef HAVE_STRCHR
#  include 
#  define strchr index
#  define strrchr rindex
# endif
# ifndef __GNUC__
char *strchr(), *strrchr();
# endif
# ifndef HAVE_MEMCPY
#  define NTP_NEED_BOPS
# endif
#endif /* STDC_HEADERS */

#ifdef NTP_NEED_BOPS

#ifdef HAVE_STRINGS_H
# include 		/* bcmp, bcopy, bzero */
#endif

void	ntp_memset	(char *, int, int);

#define memcmp(a, b, c)		bcmp(a, b, (int)(c))
#define memmove(t, f, c)	bcopy(f, t, (int)(c))
#define memcpy(t, f, c)		bcopy(f, t, (int)(c))
#define memset(a, x, c)		if (0 == (x)) \
					bzero(a, (int)(c)); \
				else \
					ntp_memset((char *)(a), x, c)
#endif /*  NTP_NEED_BOPS */

#endif /* _ntp_string_h */
ntp-4.2.6p5/include/ntp_libopts.h0000644000175000017500000000041711505336022015741 0ustar  peterpeter/*
 * ntp_libopts.h
 *
 * Common code interfacing with Autogen's libopts command-line option
 * processing.
 */
#ifndef NTP_LIBOPTS_H
# define NTP_LIBOPTS_H
# include "autoopts/options.h"

extern	int	ntpOptionProcess(tOptions *pOpts, int argc,
				 char ** argv);
#endif
ntp-4.2.6p5/include/debug-opt.def0000644000175000017500000000136511307651603015611 0ustar  peterpeter
include        = <<- _EOF_
	#ifdef __windows
	  extern int atoi(const char*);
	#else
	# include 
	#endif
	_EOF_;

flag = {
    name      = debug-level;
    value     = d;
    max       = NOLIMIT;
    nopreset;
    descrip   = "Increase output debug message level";
    doc = <<-  _EndOfDoc_
	Increase the debugging message output level.
	_EndOfDoc_;
};

flag = {
    name      = set-debug-level;
    value     = D;
    max       = NOLIMIT;
    descrip   = "Set the output debug message level";
    arg-type  = string;
    flag-code = 'DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );';
    doc = <<-  _EndOfDoc_
	Set the output debugging level.  Can be supplied multiple times,
	but each overrides the previous value(s).
	_EndOfDoc_;
};
ntp-4.2.6p5/include/ntp_unixtime.h0000644000175000017500000000740011307651603016133 0ustar  peterpeter/*
 * ntp_unixtime.h - contains constants and macros for converting between
 *		    NTP time stamps (l_fp) and Unix times (struct timeval)
 */

#include "ntp_types.h"

#ifdef SIM
#include "ntpsim.h"
#endif

#ifdef SIM
#   define GETTIMEOFDAY(a, b) (node_gettime(&ntp_node, a))
#   define SETTIMEOFDAY(a, b) (node_settime(&ntp_node, a))
#   define ADJTIMEOFDAY(a, b) (node_adjtime(&ntp_node, a, b))
#else
#   define ADJTIMEOFDAY(a, b) (adjtime(a, b))
/* gettimeofday() takes two args in BSD and only one in SYSV */
# if defined(HAVE_SYS_TIMERS_H) && defined(HAVE_GETCLOCK)
#  include 
int getclock (int clock_type, struct timespec *tp);
/* Don't #define GETTIMEOFDAY because we shouldn't be using it in this case. */
#   define SETTIMEOFDAY(a, b) (settimeofday(a, b))
# else /* not (HAVE_SYS_TIMERS_H && HAVE_GETCLOCK) */
#  ifdef SYSV_TIMEOFDAY
#   define GETTIMEOFDAY(a, b) (gettimeofday(a))
#   define SETTIMEOFDAY(a, b) (settimeofday(a))
#  else /* ! SYSV_TIMEOFDAY */
#if defined SYS_CYGWIN32
#   define GETTIMEOFDAY(a, b) (gettimeofday(a, b))
#   define SETTIMEOFDAY(a, b) (settimeofday_NT(a))
#else
#   define GETTIMEOFDAY(a, b) (gettimeofday(a, b))
#   define SETTIMEOFDAY(a, b) (settimeofday(a, b))
#endif
#  endif /* SYSV_TIMEOFDAY */
# endif /* not (HAVE_SYS_TIMERS_H && HAVE_GETCLOCK) */
#endif /* SIM */

/*
 * Time of day conversion constant.  Ntp's time scale starts in 1900,
 * Unix in 1970.
 */
#define	JAN_1970	0x83aa7e80	/* 2208988800 1970 - 1900 in seconds */

/*
 * These constants are used to round the time stamps computed from
 * a struct timeval to the microsecond (more or less).  This keeps
 * things neat.
 */
#define	TS_MASK		0xfffff000	/* mask to usec, for time stamps */
#define	TS_ROUNDBIT	0x00000800	/* round at this bit */


/*
 * Convert usec to a time stamp fraction.  If you use this the program
 * must include the following declarations:
 */
extern u_long ustotslo[];
extern u_long ustotsmid[];
extern u_long ustotshi[];

#define	TVUTOTSF(tvu, tsf) \
	(tsf) = ustotslo[(tvu) & 0xff] \
	    + ustotsmid[((tvu) >> 8) & 0xff] \
	    + ustotshi[((tvu) >> 16) & 0xf]

/*
 * Convert a struct timeval to a time stamp.
 */
#define TVTOTS(tv, ts) \
	do { \
		(ts)->l_ui = (u_long)(tv)->tv_sec; \
		TVUTOTSF((tv)->tv_usec, (ts)->l_uf); \
	} while(0)

#define sTVTOTS(tv, ts) \
	do { \
		int isneg = 0; \
		long usec; \
		(ts)->l_ui = (tv)->tv_sec; \
		usec = (tv)->tv_usec; \
		if (((tv)->tv_sec < 0) || ((tv)->tv_usec < 0)) { \
			usec = -usec; \
			(ts)->l_ui = -(ts)->l_ui; \
			isneg = 1; \
		} \
		TVUTOTSF(usec, (ts)->l_uf); \
		if (isneg) { \
			L_NEG((ts)); \
		} \
	} while(0)

/*
 * TV_SHIFT is used to turn the table result into a usec value.  To round,
 * add in TV_ROUNDBIT before shifting
 */
#define	TV_SHIFT	3
#define	TV_ROUNDBIT	0x4


/*
 * Convert a time stamp fraction to microseconds.  The time stamp
 * fraction is assumed to be unsigned.  To use this in a program, declare:
 */
extern long tstouslo[];
extern long tstousmid[];
extern long tstoushi[];

#define	TSFTOTVU(tsf, tvu) \
	(tvu) = (tstoushi[((tsf) >> 24) & 0xff] \
	    + tstousmid[((tsf) >> 16) & 0xff] \
	    + tstouslo[((tsf) >> 9) & 0x7f] \
	    + TV_ROUNDBIT) >> TV_SHIFT
/*
 * Convert a time stamp to a struct timeval.  The time stamp
 * has to be positive.
 */
#define	TSTOTV(ts, tv) \
	do { \
		(tv)->tv_sec = (ts)->l_ui; \
		TSFTOTVU((ts)->l_uf, (tv)->tv_usec); \
		if ((tv)->tv_usec == 1000000) { \
			(tv)->tv_sec++; \
			(tv)->tv_usec = 0; \
		} \
	} while (0)

/*
 * Convert milliseconds to a time stamp fraction.  This shouldn't be
 * here, but it is convenient since the guys who use the definition will
 * often be including this file anyway.
 */
extern u_long msutotsflo[];
extern u_long msutotsfhi[];

#define	MSUTOTSF(msu, tsf) \
	(tsf) = msutotsfhi[((msu) >> 5) & 0x1f] + msutotsflo[(msu) & 0x1f]
ntp-4.2.6p5/include/ntp_stdlib.h0000644000175000017500000001610311567107101015547 0ustar  peterpeter/*
 * ntp_stdlib.h - Prototypes for NTP lib.
 */
#ifndef NTP_STDLIB_H
#define NTP_STDLIB_H

#include 
#ifdef HAVE_SYS_SOCKET_H
#include 
#endif

#include "l_stdlib.h"
#include "ntp_rfc2553.h"
#include "ntp_types.h"
#include "ntp_malloc.h"
#include "ntp_string.h"
#include "ntp_net.h"
#include "ntp_syslog.h"


/*
 * Handle gcc __attribute__ if available.
 */
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later.  */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (defined(__STRICT_ANSI__))
#  define __attribute__(Spec) /* empty */
# endif
/* The __-protected variants of `format' and `printf' attributes
   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
#  define __format__ format
#  define __printf__ printf
# endif
#endif

extern	int	mprintf(const char *, ...)
			__attribute__((__format__(__printf__, 1, 2)));
extern	int	mfprintf(FILE *, const char *, ...)
			__attribute__((__format__(__printf__, 2, 3)));
extern	int	mvfprintf(FILE *, const char *, va_list)
			__attribute__((__format__(__printf__, 2, 0)));
extern	int	mvsnprintf(char *, size_t, const char *, va_list)
			__attribute__((__format__(__printf__, 3, 0)));
extern	int	msnprintf(char *, size_t, const char *, ...)
			__attribute__((__format__(__printf__, 3, 4)));
extern	void	msyslog(int, const char *, ...)
				__attribute__((__format__(__printf__, 2, 3)));

/*
 * When building without OpenSSL, use a few macros of theirs to
 * minimize source differences in NTP.
 */
#ifndef OPENSSL
#define NID_md5	4	/* from openssl/objects.h */
/* from openssl/evp.h */
#define EVP_MAX_MD_SIZE	64	/* longest known is SHA512 */
#endif

/* authkeys.c */
extern	void	auth_delkeys	(void);
extern	int	auth_havekey	(keyid_t);
extern	int	authdecrypt	(keyid_t, u_int32 *, int, int);
extern	int	authencrypt	(keyid_t, u_int32 *, int);
extern	int	authhavekey	(keyid_t);
extern	int	authistrusted	(keyid_t);
extern	int	authreadkeys	(const char *);
extern	void	authtrust	(keyid_t, u_long);
extern	int	authusekey	(keyid_t, int, const u_char *);

extern	u_long	calyearstart	(u_long);
extern	const char *clockname	(int);
extern	int	clocktime	(int, int, int, int, int, u_long, u_long *, u_int32 *);
extern	int	ntp_getopt	(int, char **, const char *);
extern	void	init_auth	(void);
extern	void	init_lib	(void);
extern	struct savekey *auth_findkey (keyid_t);
extern	int	auth_moremem	(void);
extern	int	ymd2yd		(int, int, int);

/* a_md5encrypt.c */
extern	int	MD5authdecrypt	(int, u_char *, u_int32 *, int, int);
extern	int	MD5authencrypt	(int, u_char *, u_int32 *, int);
extern	void	MD5auth_setkey	(keyid_t, int, const u_char *, const int);
extern	u_int32	addr2refid	(sockaddr_u *);

/* emalloc.c */
#ifndef EREALLOC_CALLSITE	/* ntp_malloc.h defines */
extern	void *	ereallocz	(void *, size_t, size_t, int);
#define	erealloczsite(p, n, o, z, f, l) ereallocz(p, n, o, (z))
extern	void *	emalloc		(size_t);
#define	emalloc_zero(c)		ereallocz(NULL, (c), 0, TRUE)
#define	erealloc(p, c)		ereallocz(p, (c), 0, FALSE)
#define erealloc_zero(p, n, o)	ereallocz(p, n, (o), TRUE)
extern	char *	estrdup_impl	(const char *);
#define	estrdup(s)		estrdup_impl(s)
#else
extern	void *	ereallocz	(void *, size_t, size_t, int,
				 const char *, int);
#define erealloczsite		ereallocz
#define	emalloc(c)		ereallocz(NULL, (c), 0, FALSE, \
					  __FILE__, __LINE__)
#define	emalloc_zero(c)		ereallocz(NULL, (c), 0, TRUE, \
					  __FILE__, __LINE__)
#define	erealloc(p, c)		ereallocz(p, (c), 0, FALSE, \
					  __FILE__, __LINE__)
#define	erealloc_zero(p, n, o)	ereallocz(p, n, (o), TRUE, \
					  __FILE__, __LINE__)
extern	char *	estrdup_impl	(const char *, const char *, int);
#define	estrdup(s) estrdup_impl((s), __FILE__, __LINE__)
#endif


extern	int	atoint		(const char *, long *);
extern	int	atouint		(const char *, u_long *);
extern	int	hextoint	(const char *, u_long *);
extern	char *	humanlogtime	(void);
extern	char *	inttoa		(long);
extern	char *	mfptoa		(u_long, u_long, short);
extern	char *	mfptoms		(u_long, u_long, short);
extern	const char * modetoa	(int);
extern  const char * eventstr	(int);
extern  const char * ceventstr	(int);
extern	char *	statustoa	(int, int);
extern  const char * sysstatstr (int);
extern  const char * peerstatstr (int);
extern  const char * clockstatstr (int);
extern	sockaddr_u * netof	(sockaddr_u *);
extern	char *	numtoa		(u_int32);
extern	char *	numtohost	(u_int32);
extern	char *	socktoa		(const sockaddr_u *);
extern	char *	socktohost	(const sockaddr_u *);
extern	int	octtoint	(const char *, u_long *);
extern	u_long	ranp2		(int);
extern	char *	refnumtoa	(sockaddr_u *);
extern	int	tsftomsu	(u_long, int);
extern	char *	uinttoa		(u_long);

extern	int	decodenetnum	(const char *, sockaddr_u *);

extern	const char * FindConfig	(const char *);

extern	void	signal_no_reset (int, RETSIGTYPE (*func)(int));

extern	void	getauthkeys 	(const char *);
extern	void	auth_agekeys	(void);
extern	void	rereadkeys	(void);

/*
 * Variable declarations for libntp.
 */

/*
 * Defined by any program.
 */
extern volatile int debug;		/* debugging flag */

/* authkeys.c */
extern u_long	authkeynotfound;	/* keys not found */
extern u_long	authkeylookups;		/* calls to lookup keys */
extern u_long	authnumkeys;		/* number of active keys */
extern u_long	authkeyexpired;		/* key lifetime expirations */
extern u_long	authkeyuncached;	/* cache misses */
extern u_long	authencryptions;	/* calls to encrypt */
extern u_long	authdecryptions;	/* calls to decrypt */

extern int	authnumfreekeys;

/*
 * The key cache. We cache the last key we looked at here.
 */
extern keyid_t	cache_keyid;		/* key identifier */
extern u_char *	cache_key;		/* key pointer */
extern int	cache_type;		/* key type */
extern u_int	cache_keylen;		/* key length */

/* getopt.c */
extern char *	ntp_optarg;		/* global argument pointer */
extern int	ntp_optind;		/* global argv index */

/* lib_strbuf.c */
extern int	ipv4_works;
extern int	ipv6_works;

/* machines.c */
typedef void (*pset_tod_using)(const char *);
extern pset_tod_using	set_tod_using;

/* ssl_init.c */
#ifdef OPENSSL
extern	void	ssl_init		(void);
extern	void	ssl_check_version	(void);
extern	int	ssl_init_done;
#define	INIT_SSL()				\
	do {					\
		if (!ssl_init_done)		\
			ssl_init();		\
	} while (0)
#else	/* !OPENSSL follows */
#define	INIT_SSL()		do {} while (0)
#endif
extern	int	keytype_from_text	(const char *,	size_t *);
extern	const char *keytype_name	(int);
extern	char *	getpass_keytype		(int);


/* lib/isc/win32/strerror.c
 *
 * To minimize Windows-specific changes to the rest of the NTP code,
 * particularly reference clocks, we hijack calls to strerror() to deal
 * with our mixture of error codes from the  C runtime (open, write)
 * and Windows (sockets, serial ports).  This is an ugly hack because
 * both use the lowest values differently, but particularly for ntpd,
 * it's not a problem.
 */
#ifdef NTP_REDEFINE_STRERROR
#define	strerror(e)	ntp_strerror(e)
extern char *	ntp_strerror	(int e);
#endif

/* systime.c */
extern double	sys_tick;		/* adjtime() resolution */

/* version.c */
extern const char *Version;		/* version declaration */

#endif	/* NTP_STDLIB_H */
ntp-4.2.6p5/include/parse.h0000644000175000017500000003450311307651605014530 0ustar  peterpeter/*
 * /src/NTP/REPOSITORY/ntp4-dev/include/parse.h,v 4.12 2007/01/14 08:36:03 kardel RELEASE_20070114_A
 *
 * parse.h,v 4.12 2007/01/14 08:36:03 kardel RELEASE_20070114_A
 *
 * Copyright (c) 1995-2005 by Frank Kardel  ntp.org>
 * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
 *
 * 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.
 * 3. Neither the name of the author nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * 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.
 *
 */

#ifndef __PARSE_H__
#define __PARSE_H__
#if	!(defined(lint) || defined(__GNUC__))
  static char parsehrcsid[]="parse.h,v 4.12 2007/01/14 08:36:03 kardel RELEASE_20070114_A";
#endif

#include "ntp_types.h"

#include "parse_conf.h"

/*
 * we use the following datastructures in two modes
 * either in the NTP itself where we use NTP time stamps at some places
 * or in the kernel, where only struct timeval will be used.
 */
#undef PARSEKERNEL
#if defined(KERNEL) || defined(_KERNEL)
#ifndef PARSESTREAM
#define PARSESTREAM
#endif
#endif
#if defined(PARSESTREAM) && defined(HAVE_SYS_STREAM_H)
#define PARSEKERNEL
#endif
#ifdef PARSEKERNEL
#ifndef _KERNEL
extern caddr_t kmem_alloc (unsigned int);
extern caddr_t kmem_free (caddr_t, unsigned int);
extern unsigned int splx (unsigned int);
extern unsigned int splhigh (void);
extern unsigned int splclock (void);
#define MALLOC(_X_) (char *)kmem_alloc(_X_)
#define FREE(_X_, _Y_) kmem_free((caddr_t)_X_, _Y_)
#else
#include 
#define MALLOC(_X_) (char *)kmem_alloc(_X_, KM_SLEEP)
#define FREE(_X_, _Y_) kmem_free((caddr_t)_X_, _Y_)
#endif
#else
#define MALLOC(_X_) malloc(_X_)
#define FREE(_X_, _Y_) free(_X_)
#endif

#if defined(PARSESTREAM) && defined(HAVE_SYS_STREAM_H)
#include 
#include 
#else	/* STREAM */
#include 
#include "ntp_syslog.h"
#ifdef	DEBUG
#define DD_PARSE 5
#define DD_RAWDCF 4
#define parseprintf(LEVEL, ARGS) if (debug > LEVEL) printf ARGS
#else	/* DEBUG */
#define parseprintf(LEVEL, ARGS)
#endif	/* DEBUG */
#endif	/* PARSESTREAM */

#if defined(timercmp) && defined(__GNUC__)
#undef timercmp
#endif

#if !defined(timercmp)
#define	timercmp(tvp, uvp, cmp)	\
	((tvp)->tv_sec cmp (uvp)->tv_sec || \
	 ((tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec))
#endif

#ifndef TIMES10
#define TIMES10(_X_)	(((_X_) << 3) + ((_X_) << 1))
#endif

/*
 * state flags
 */
#define PARSEB_POWERUP            0x00000001 /* no synchronisation */
#define PARSEB_NOSYNC             0x00000002 /* timecode currently not confirmed */

/*
 * time zone information
 */
#define PARSEB_ANNOUNCE           0x00000010 /* switch time zone warning (DST switch) */
#define PARSEB_DST                0x00000020 /* DST in effect */
#define PARSEB_UTC		  0x00000040 /* UTC time */

/*
 * leap information
 */
#define PARSEB_LEAPDEL		  0x00000100 /* LEAP deletion warning */
#define PARSEB_LEAPADD		  0x00000200 /* LEAP addition warning */
#define PARSEB_LEAPS		  0x00000300 /* LEAP warnings */
#define PARSEB_LEAPSECOND	  0x00000400 /* actual leap second */
/*
 * optional status information
 */
#define PARSEB_ALTERNATE	  0x00001000 /* alternate antenna used */
#define PARSEB_POSITION		  0x00002000 /* position available */
#define PARSEB_MESSAGE            0x00004000 /* addtitional message data */
/*
 * feature information
 */
#define PARSEB_S_LEAP		  0x00010000 /* supports LEAP */
#define PARSEB_S_ANTENNA	  0x00020000 /* supports antenna information */
#define PARSEB_S_PPS     	  0x00040000 /* supports PPS time stamping */
#define PARSEB_S_POSITION	  0x00080000 /* supports position information (GPS) */

/*
 * time stamp availability
 */
#define PARSEB_TIMECODE		  0x10000000 /* valid time code sample */
#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_S_LOCATION|PARSEB_TIMECODE|PARSEB_MESSAGE)

#define PARSE_POWERUP(x)        ((x) & PARSEB_POWERUP)
#define PARSE_NOSYNC(x)         (((x) & (PARSEB_POWERUP|PARSEB_NOSYNC)) == PARSEB_NOSYNC)
#define PARSE_SYNC(x)           (((x) & (PARSEB_POWERUP|PARSEB_NOSYNC)) == 0)
#define PARSE_ANNOUNCE(x)       ((x) & PARSEB_ANNOUNCE)
#define PARSE_DST(x)            ((x) & PARSEB_DST)
#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_LEAPSECOND(x)	(PARSE_SYNC(x) && ((x) & PARSEB_LEAP_SECOND))

#define PARSE_S_LEAP(x)		((x) & PARSEB_S_LEAP)
#define PARSE_S_ANTENNA(x)	((x) & PARSEB_S_ANTENNA)
#define PARSE_S_PPS(x)		((x) & PARSEB_S_PPS)
#define PARSE_S_POSITION(x)	((x) & PARSEB_S_POSITION)

#define PARSE_TIMECODE(x)	((x) & PARSEB_TIMECODE)
#define PARSE_PPS(x)		((x) & PARSEB_PPS)
#define PARSE_POSITION(x)	((x) & PARSEB_POSITION)
#define PARSE_MESSAGE(x)	((x) & PARSEB_MESSAGE)

/*
 * operation flags - lower nibble contains fudge flags
 */
#define PARSE_TRUSTTIME     CLK_FLAG1  /* use flag1 to indicate the time2 references mean the trust time */
#define PARSE_CLEAR         CLK_FLAG2  /* use flag2 to control pps on assert */
#define PARSE_PPSKERNEL     CLK_FLAG3  /* use flag3 to bind PPS to kernel */
#define PARSE_LEAP_DELETE   CLK_FLAG4  /* use flag4 to force leap deletion - only necessary when earth slows down */

#define PARSE_FIXED_FMT     0x10  /* fixed format */
#define PARSE_PPSCLOCK      0x20  /* try to get PPS time stamp via ppsclock ioctl */

/*
 * size of buffers
 */
#define PARSE_TCMAX	    400	  /* maximum addition data size */

typedef union
{
  struct timeval tv;		/* timeval - kernel view */
  l_fp           fp;		/* fixed point - ntp view */
} timestamp_t;

/*
 * standard time stamp structure
 */
struct parsetime
{
  u_long  parse_status;	/* data status - CVT_OK, CVT_NONE, CVT_FAIL ... */
  timestamp_t	 parse_time;	/* PARSE timestamp */
  timestamp_t	 parse_stime;	/* telegram sample timestamp */
  timestamp_t	 parse_ptime;	/* PPS time stamp */
  long           parse_usecerror;	/* sampled usec error */
  u_long	 parse_state;	/* current receiver state */
  unsigned short parse_format;	/* format code */
  unsigned short parse_msglen;	/* length of message */
  unsigned char  parse_msg[PARSE_TCMAX]; /* original messages */
};

typedef struct parsetime parsetime_t;

/*---------- STREAMS interface ----------*/

#ifdef HAVE_SYS_STREAM_H
/*
 * ioctls
 */
#define PARSEIOC_ENABLE		(('D'<<8) + 'E')
#define PARSEIOC_DISABLE	(('D'<<8) + 'D')
#define PARSEIOC_SETFMT         (('D'<<8) + 'f')
#define PARSEIOC_GETFMT	        (('D'<<8) + 'F')
#define PARSEIOC_SETCS	        (('D'<<8) + 'C')
#define PARSEIOC_TIMECODE	(('D'<<8) + 'T')

#endif

/*------ IO handling flags (sorry) ------*/

#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 

/*
 * ioctl structure
 */
union parsectl 
{
  struct parsegettc
    {
      u_long         parse_state;	/* last state */
      u_long         parse_badformat; /* number of bad packets since last query */
      unsigned short parse_format;/* last decoded format */
      unsigned short parse_count;	/* count of valid time code bytes */
      char           parse_buffer[PARSE_TCMAX+1]; /* timecode buffer */
    } parsegettc;

  struct parseformat
    {
      unsigned short parse_format;/* number of examined format */
      unsigned short parse_count;	/* count of valid string bytes */
      char           parse_buffer[PARSE_TCMAX+1]; /* format code string */
    } parseformat;

  struct parsesetcs
    {
      u_long         parse_cs;	/* character size (needed for stripping) */
    } parsesetcs;
};
  
typedef union parsectl parsectl_t;

/*------ for conversion routines --------*/

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) */

  /*
   * private data - fixed format only
   */
  unsigned short parse_plen;	/* length of private data */
  void          *parse_pdata;	/* private data pointer */

  /*
   * time code input buffer (from RS232 or PPS)
   */
  unsigned short parse_index;	/* current buffer index */
  char          *parse_data;    /* data buffer */
  unsigned short parse_dsize;	/* size of data buffer */
  unsigned short parse_lformat;	/* last format used */
  u_long         parse_lstate;	/* last state code */
  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 */
};

typedef struct parse parse_t;

struct clocktime		/* clock time broken up from time code */
{
  long day;
  long month;
  long year;
  long hour;
  long minute;
  long second;
  long usecond;
  long utcoffset;	/* in seconds */
  time_t utctime;	/* the actual time - alternative to date/time */
  u_long flags;		/* current clock status */
};

typedef struct clocktime clocktime_t;

/*
 * parser related return/error codes
 */
#define CVT_MASK	 (unsigned)0x0000000F /* conversion exit code */
#define   CVT_NONE	 (unsigned)0x00000001 /* format not applicable */
#define   CVT_FAIL	 (unsigned)0x00000002 /* conversion failed - error code returned */
#define   CVT_OK	 (unsigned)0x00000004 /* conversion succeeded */
#define   CVT_SKIP	 (unsigned)0x00000008 /* conversion succeeded */
#define CVT_ADDITIONAL   (unsigned)0x00000010 /* additional data is available */
#define CVT_BADFMT	 (unsigned)0x00000100 /* general format error - (unparsable) */
#define CVT_BADDATE      (unsigned)0x00000200 /* date field incorrect */
#define CVT_BADTIME	 (unsigned)0x00000400 /* time field incorrect */

/*
 * return codes used by special input parsers
 */
#define PARSE_INP_SKIP  0x00	/* discard data - may have been consumed */
#define PARSE_INP_TIME  0x01	/* time code assembled */
#define PARSE_INP_PARSE 0x02	/* parse data using normal algorithm */
#define PARSE_INP_DATA  0x04	/* additional data to pass up */
#define PARSE_INP_SYNTH 0x08	/* just pass up synthesized time */

/*
 * PPS edge info
 */
#define SYNC_ZERO	0x00
#define SYNC_ONE	0x01

struct clockformat
{
  /* special input protocol - implies fixed format */
  u_long	(*input)   (parse_t *, unsigned int, timestamp_t *);
  /* conversion routine */
  u_long        (*convert) (unsigned char *, int, struct format *, clocktime_t *, void *);
  /* routine for handling RS232 sync events (time stamps) */
  /* PPS input routine */
  u_long        (*syncpps) (parse_t *, int, timestamp_t *);
  /* time code synthesizer */

  void           *data;		/* local parameters */
  const char     *name;		/* clock format name */
  unsigned short  length;	/* maximum length of data packet */
  unsigned short  plen;		/* length of private data - implies fixed format */
};

typedef struct clockformat clockformat_t;

/*
 * parse interface
 */
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_iopps (parse_t *, int, timestamp_t *);
extern void parse_iodone (parse_t *);
extern int  parse_timecode (parsectl_t *, parse_t *);
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_end (parse_t *);

extern int Strok (const unsigned char *, const unsigned char *);
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 int parse_timedout (parse_t *, timestamp_t *, struct timeval *);

#endif

/*
 * History:
 *
 * parse.h,v
 * Revision 4.12  2007/01/14 08:36:03  kardel
 * make timestamp union anonymous to avoid conflicts with
 * some OSes that choose to create a nameing conflic here.
 *
 * Revision 4.11  2005/06/25 10:58:45  kardel
 * add missing log keywords
 *
 * Revision 4.5  1998/08/09 22:23:32  kardel
 * 4.0.73e2 adjustments
 *
 * Revision 4.4  1998/06/14 21:09:27  kardel
 * Sun acc cleanup
 *
 * Revision 4.3  1998/06/13 11:49:25  kardel
 * STREAM macro gone in favor of HAVE_SYS_STREAM_H
 *
 * Revision 4.2  1998/06/12 15:14:25  kardel
 * fixed prototypes
 *
 * Revision 4.1  1998/05/24 10:07:59  kardel
 * removed old data structure cruft (new input model)
 * new PARSE_INP* macros for input handling
 * removed old SYNC_* macros from old input model
 * (struct clockformat): removed old parse functions in favor of the
 * new input model
 * updated prototypes
 *
 * form V3 3.31 - log info deleted 1998/04/11 kardel
 */
ntp-4.2.6p5/include/ntp_random.h0000644000175000017500000000047511307651603015556 0ustar  peterpeter
#include 

long ntp_random (void);
void ntp_srandom (unsigned long);
void ntp_srandomdev (void);
char * ntp_initstate (unsigned long, 	/* seed for R.N.G. */
			char *,		/* pointer to state array */
			long		/* # bytes of state info */
			);
char * ntp_setstate (char *);	/* pointer to state array */



ntp-4.2.6p5/include/ntp_assert.h0000644000175000017500000000506511567107101015574 0ustar  peterpeter/*
 * ntp_assert.h - design by contract stuff
 *
 * example:
 *
 * int foo(char *a) {
 *	int result;
 *	int value;
 *
 *	REQUIRE(a != NULL);
 *	...
 *	bar(&value);
 *	INSIST(value > 2);
 *	...
 *
 *	ENSURE(result != 12);
 *	return result;
 * }
 *
 * open question: when would we use INVARIANT()?
 *
 * For cases where the overhead for non-debug builds is deemed too high,
 * use DEBUG_REQUIRE(), DEBUG_INSIST(), DEBUG_ENSURE(), and/or
 * DEBUG_INVARIANT().
 */

#ifndef NTP_ASSERT_H
#define NTP_ASSERT_H

# ifdef CALYSTO 

extern void calysto_assume(unsigned char cnd); /* assume this always holds */ 
extern void calysto_assert(unsigned char cnd); /* check whether this holds */ 
#define ALWAYS_REQUIRE(x)	calysto_assert(x)
#define ALWAYS_INSIST(x)	calysto_assume(x) /* DLH calysto_assert()? */
#define ALWAYS_INVARIANT(x)	calysto_assume(x)
#define ALWAYS_ENSURE(x)	calysto_assert(x)

/* # elif defined(__COVERITY__) */
/*
 * DH: try letting coverity scan our actual assertion macros, now that
 * isc_assertioncallback_t is marked __attribute__ __noreturn__.
 */

/*
 * Coverity has special knowledge that assert(x) terminates the process
 * if x is not true.  Rather than teach it about our assertion macros,
 * just use the one it knows about for Coverity Prevent scans.  This
 * means our assertion code (and ISC's) escapes Coverity analysis, but
 * that seems to be a reasonable trade-off.
 */

/*
#define ALWAYS_REQUIRE(x)	assert(x)
#define ALWAYS_INSIST(x)	assert(x)
#define ALWAYS_INVARIANT(x)	assert(x)
#define ALWAYS_ENSURE(x)	assert(x)
*/

# else	/* neither Coverity nor Calysto */

#include "isc/assertions.h"

#define ALWAYS_REQUIRE(x)	ISC_REQUIRE(x)
#define ALWAYS_INSIST(x)	ISC_INSIST(x)
#define ALWAYS_INVARIANT(x)	ISC_INVARIANT(x)
#define ALWAYS_ENSURE(x)	ISC_ENSURE(x)

# endif /* neither Coverity nor Calysto */

#define	REQUIRE(x)		ALWAYS_REQUIRE(x)
#define	INSIST(x)		ALWAYS_INSIST(x)
#define	INVARIANT(x)		ALWAYS_INVARIANT(x)
#define	ENSURE(x)		ALWAYS_ENSURE(x)

/*
 * We initially used NTP_REQUIRE() instead of REQUIRE() etc, but that
 * is unneccesarily verbose, as libisc use of REQUIRE() etc shows.
 */
#define	NTP_REQUIRE(x)		REQUIRE(x)
#define	NTP_INSIST(x)		INSIST(x)
#define	NTP_INVARIANT(x)	INVARIANT(x)
#define	NTP_ENSURE(x)		ENSURE(x)

# ifdef DEBUG
#define	DEBUG_REQUIRE(x)	REQUIRE(x)
#define	DEBUG_INSIST(x)		INSIST(x)
#define	DEBUG_INVARIANT(x)	INVARIANT(x)
#define	DEBUG_ENSURE(x)		ENSURE(x)
# else
#define	DEBUG_REQUIRE(x)	(void)(x)
#define	DEBUG_INSIST(x)		(void)(x)
#define	DEBUG_INVARIANT(x)	(void)(x)
#define	DEBUG_ENSURE(x)		(void)(x)
# endif

#endif	/* NTP_ASSERT_H */
ntp-4.2.6p5/include/ieee754io.h0000644000175000017500000000570311307651604015114 0ustar  peterpeter/*
 * /src/NTP/ntp4-dev/include/ieee754io.h,v 4.3 2005/04/16 17:32:10 kardel RELEASE_20050508_A
 *
 * ieee754io.h,v 4.3 2005/04/16 17:32:10 kardel RELEASE_20050508_A
 *
 * $Created: Sun Jul 13 12:22:11 1997 $
 *
 * Copyright (c) 1997-2005 by Frank Kardel  ntp.org>
 *
 * 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.
 * 3. Neither the name of the author nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * 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.
 *
 */
#ifndef IEEE754IO_H
#define IEEE754IO_H

#define IEEE_SINGLE 1
#define IEEE_DOUBLE 2

#define IEEE_MSB 1
#define IEEE_LSB 2

#define IEEE_OK          0	/* conversion ok */
#define IEEE_BADCALL     1	/* bad call parameters */
#define IEEE_NAN         2	/* found an NaN */
#define IEEE_POSINFINITY 3	/* positive infinity */
#define IEEE_NEGINFINITY 4	/* negative infinity */
#define IEEE_POSOVERFLOW 5	/* positive overflow */
#define IEEE_NEGOVERFLOW 6	/* negative overflow */

#define IEEE_OFFSETS     8	/* number of byte positions */
typedef unsigned char offsets_t[IEEE_OFFSETS];

int fetch_ieee754 (unsigned char **bufp, int size, l_fp *lfpp, offsets_t offsets);
int put_ieee754 (unsigned char **bufpp, int size, l_fp *lfpp, offsets_t offsets);

#endif
/*
 * History:
 *
 * ieee754io.h,v
 * Revision 4.3  2005/04/16 17:32:10  kardel
 * update copyright
 *
 * Revision 4.2  2004/11/14 15:29:41  kardel
 * support PPSAPI, upgrade Copyright to Berkeley style
 *
 * Revision 4.0  1998/04/10 19:50:40  kardel
 * Start 4.0 release version numbering
 *
 * Revision 1.1  1998/04/10 19:27:33  kardel
 * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
 *
 * Revision 1.1  1997/10/06 20:55:37  kardel
 * new parse structure
 *
 */
ntp-4.2.6p5/include/ntp_fp.h0000644000175000017500000002617311460751117014707 0ustar  peterpeter/*
 * ntp_fp.h - definitions for NTP fixed/floating-point arithmetic
 */

#ifndef NTP_FP_H
#define NTP_FP_H

#include "ntp_types.h"

/*
 * 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) = htonl(hi); (nf) = htonl(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)	(((x_i) >= 0x00010000) ? 0x7fffffff : \
				(((x_i) <= -0x00010000) ? 0x80000000 : \
				(((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_RSHIFTU((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
 */
extern	char *	dofptoa		(u_fp, int, short, int);
extern	char *	dolfptoa	(u_long, u_long, int, short, int);

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);

extern	struct tm * ntp2unix_tm (u_long ntp, int local);

#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 stoa(addr)		socktoa(addr)
#define	ntoa(addr)		stoa(addr)
#define stohost(addr)		socktohost(addr)

#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)

#endif /* NTP_FP_H */
ntp-4.2.6p5/include/ntpsim.h0000644000175000017500000000764411327015211014723 0ustar  peterpeter/* ntpsim.h
 *
 * The header file for the ntp discrete event simulator. 
 *
 * Written By:	Sachin Kamboj
 *		University of Delaware
 *		Newark, DE 19711
 * Copyright (c) 2006
 */

#ifndef NTPSIM_H
#define NTPSIM_H

#include 
#include 
#ifdef HAVE_SYS_SOCKET_H
#include 
#endif
#include 
#include "ntp_syslog.h"
#include "ntp_fp.h"
#include "ntp.h"
#include "ntp_select.h"
#include "ntp_malloc.h"
#include "ntp_refclock.h"
#include "recvbuff.h"
#include "ntp_io.h"
#include "ntp_stdlib.h"

#include "ntp_data_structures.h"

/* CONSTANTS */

#ifdef PI
# undef PI
#endif
#define PI 3.1415926535         /* The world's most famous constant */
#define SIM_TIME 86400		/* end simulation time */
#define NET_DLY .001            /* network delay */
#define PROC_DLY .001		/* processing delay */
#define BEEP_DLY 3600           /* beep interval (s) */


/* Discrete Event Queue
 * --------------------
 * The NTP simulator is a discrete event simulator.
 *
 * Central to this simulator is an event queue which is a priority queue
 * in which the "priority" is given by the time of arrival of the event.
 *
 * A discrete set of events can happen and are stored in the queue to arrive
 * at a particular time.
 */

/* Possible Discrete Events */

typedef enum {
    BEEP,          /* Event to record simulator stats */
    CLOCK,         /* Event to advance the clock to the specified time */
    TIMER,         /* Event that designates a timer interrupt. */
    PACKET         /* Event that designates arrival of a packet */
} funcTkn;


/* Event information */

typedef struct {
    double time;       /* Time at which event occurred */
    funcTkn function;  /* Type of event that occured */
    union {
        struct pkt evnt_pkt;
        struct recvbuf evnt_buf;
    } buffer;          /* Other data associated with the event */
#define ntp_pkt buffer.evnt_pkt
#define rcv_buf buffer.evnt_buf
} Event;


/* Server Script Information */

typedef struct {
    double duration;
    double freq_offset;
    double wander;
    double jitter; 
    double prop_delay;
    double proc_delay;
} script_info;   



/* Server Structures */

typedef struct {
    double server_time;             /* Server time */
    sockaddr_u *addr;  		    /* Server Address */
    queue *script;                  /* Server Script */
    script_info *curr_script;       /* Current Script */
} server_info;


/* Simulation control information */

typedef struct Sim_Info {
    double sim_time;      /* Time in the simulation */
    double end_time;      /* Time at which simulation needs to be ended */
    double beep_delay;    /* Delay between simulation "beeps" at which
                             simulation  stats are recorded. */
    int num_of_servers;   /* Number of servers in the simulation */
    server_info *servers; /* Pointer to array of servers */
} sim_info;


/* Local Clock (Client) Variables */

typedef struct Local_Clock_Info {
    double local_time;     /* Client disciplined time */
    double adj;            /* Remaining time correction */
    double slew;           /* Correction Slew Rate */
    double last_read_time; /* Last time the clock was read */
} local_clock_info;

extern local_clock_info simclock;   /* Local Clock Variables */
extern sim_info simulation;         /* Simulation Control Variables */

/* Function Prototypes */

int	 ntpsim			 (int argc, char *argv[]);
Event    *event                  (double t, funcTkn f);
void     sim_event_timer         (Event *e);
int      simulate_server         (sockaddr_u *serv_addr,
				  struct interface *inter,
				  struct pkt *rpkt);
void     sim_update_clocks       (Event *e);
void     sim_event_recv_packet   (Event *e);
void     sim_event_beep          (Event *e);
void     abortsim                (char *errmsg);
double	 gauss		         (double, double);
double	 poisson		 (double, double);
int      yyparse                 (void);
void     create_server_associations (void);

#endif	/* NTPSIM_H */
ntp-4.2.6p5/include/ntp_cmdargs.h0000644000175000017500000000014611307651604015712 0ustar  peterpeter#include "ntp_types.h"

extern	void	getstartup	(int, char **);
extern	void	getCmdOpts	(int, char **);
ntp-4.2.6p5/include/ntp_machine.h0000644000175000017500000003022011466411656015701 0ustar  peterpeter/*
 * Collect all machine dependent idiosyncrasies in one place.
 */

#ifndef NTP_MACHINE_H
#define NTP_MACHINE_H

#ifdef HAVE_CONFIG_H
# include 
#endif

#ifdef TIME_WITH_SYS_TIME
# include 
# include 
#else
# ifdef HAVE_SYS_TIME_H
#  include 
# else
#  include 
# endif
#endif

#include "ntp_proto.h"

/*

			 HEY!  CHECK THIS OUT!

  The first half of this file is obsolete, and is only there to help
  reconcile "what went before" with "current behavior".

  The per-system SYS_* #defins ARE NO LONGER USED, with the temporary
  exception of SYS_WINNT.

  If you find a hunk of code that is bracketed by a SYS_* macro and you
  *know* that it is still needed, please let us know.  In many cases the
  code fragment is now handled somewhere else by autoconf choices.

*/

/*

INFO ON NEW KERNEL PLL SYS CALLS

  NTP_SYSCALLS_STD	- use the "normal" ones
  NTP_SYSCALL_GET	- SYS_ntp_gettime id
  NTP_SYSCALL_ADJ	- SYS_ntp_adjtime id
  NTP_SYSCALLS_LIBC - ntp_adjtime() and ntp_gettime() are in libc.

HOW TO GET IP INTERFACE INFORMATION

  Some UNIX V.4 machines implement a sockets library on top of
  streams. For these systems, you must use send the SIOCGIFCONF down
  the stream in an I_STR ioctl. This ususally also implies
  USE_STREAMS_DEVICE FOR IF_CONFIG. Dell UNIX is a notable exception.

WHAT DOES IOCTL(SIOCGIFCONF) RETURN IN THE BUFFER

  UNIX V.4 machines implement a sockets library on top of streams.
  When requesting the IP interface configuration with an ioctl(2) calll,
  an array of ifreq structures are placed in the provided buffer.  Some
  implementations also place the length of the buffer information in
  the first integer position of the buffer.

  SIZE_RETURNED_IN_BUFFER - size integer is in the buffer

WILL IOCTL(SIOCGIFCONF) WORK ON A SOCKET

  Some UNIX V.4 machines do not appear to support ioctl() requests for the
  IP interface configuration on a socket.  They appear to require the use
  of the streams device instead.

  USE_STREAMS_DEVICE_FOR_IF_CONFIG - use the /dev/ip device for configuration

MISC

  DOSYNCTODR		- Resync TODR clock  every hour.
  RETSIGTYPE		- Define signal function type.
  NO_SIGNED_CHAR_DECL - No "signed char" see include/ntp.h
  LOCK_PROCESS		- Have plock.
*/

#if !defined(HAVE_NTP_ADJTIME) && defined(HAVE___ADJTIMEX)
# define ntp_adjtime __adjtimex
#endif

#if 0

/*
 * IRIX 4.X and IRIX 5.x
 */
#if defined(SYS_IRIX4)||defined(SYS_IRIX5)
# define ADJTIME_IS_ACCURATE
# define LOCK_PROCESS
#endif

/*
 * Ultrix
 * Note: posix version has NTP_POSIX_SOURCE and HAVE_SIGNALED_IO
 */
#if defined(SYS_ULTRIX)
# define S_CHAR_DEFINED
# define NTP_SYSCALLS_STD
# define HAVE_MODEM_CONTROL
#endif

/*
 * AUX
 */
#if defined(SYS_AUX2) || defined(SYS_AUX3)
# define NO_SIGNED_CHAR_DECL
# define LOCK_PROCESS
# define NTP_POSIX_SOURCE
/*
 * This requires that _POSIX_SOURCE be forced on the
 * compiler command flag. We can't do it here since this
 * file is included _after_ the system header files and we
 * need to let _them_ know we're POSIX. We do this in
 * compilers/aux3.gcc...
 */
# define LOG_NTP LOG_LOCAL1
#endif

/*
 * HPUX
 */
#if defined(SYS_HPUX)
# define getdtablesize() sysconf(_SC_OPEN_MAX)
# define setlinebuf(f) setvbuf(f, NULL, _IOLBF, 0)
# define NO_SIGNED_CHAR_DECL
# define LOCK_PROCESS
#endif

/*
 * BSD/OS 2.0 and above
 */
#if defined(SYS_BSDI)
# define USE_FSETOWNCTTY	/* this funny system demands a CTTY for FSETOWN */
#endif

/*
 * FreeBSD 2.0 and above
 */
#ifdef SYS_FREEBSD
# define KERNEL_PLL
#endif

/*
 * Linux
 */
#if defined(SYS_LINUX)
# define ntp_adjtime __adjtimex
#endif

/*
 * PTX
 */
#if defined(SYS_PTX)
# define LOCK_PROCESS
struct timezone { int __0; };	/* unused placebo */
/*
 * no comment !@!
 */
typedef unsigned int u_int;
# ifndef	_NETINET_IN_SYSTM_INCLUDED	/* i am about to comment... */
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned long u_long;
# endif
#endif

/*
 * UNIX V.4 on and NCR 3000
 */
#if defined(SYS_SVR4)
# define STREAM
# define LOCK_PROCESS
# define SIZE_RETURNED_IN_BUFFER
#endif

/*
 * (Univel/Novell) Unixware1 SVR4 on intel x86 processor
 */
#if defined(SYS_UNIXWARE1)
/* #define _POSIX_SOURCE */
# define STREAM
# define STREAMS
# undef STEP_SLEW		/* TWO step */
# define LOCK_PROCESS
# define SIZE_RETURNED_IN_BUFFER
# include 
# include 
# include 
#endif

/*
 * DomainOS
 */
#if defined(SYS_DOMAINOS)
# define NTP_SYSCALLS_STD
/* older versions of domain/os don't have class D */
# ifndef IN_CLASSD
#  define IN_CLASSD(i)		(((long)(i) & 0xf0000000) == 0xe0000000)
#  define IN_CLASSD_NET 	0xf0000000
#  define IN_CLASSD_NSHIFT	28
#  define IN_CLASSD_HOST	0xfffffff
#  define IN_MULTICAST(i)	IN_CLASSD(i)
# endif
#endif

/*
 * Fujitsu UXP/V
 */
#if defined(SYS_UXPV)
# define LOCK_PROCESS
# define SIZE_RETURNED_IN_BUFFER
#endif


#endif /* 0 */

/*
 * Define these here for non-Windows NT systems
 * SOCKET and INVALID_SOCKET are native macros
 * on Windows NT and since they have different
 * requirements we use them in the code and
 * make them macros for everyone else
 */
#ifndef SYS_WINNT
typedef int SOCKET;
# define INVALID_SOCKET	-1
# define SOCKET_ERROR	-1
# define socket_errno()		(errno)
# define closesocket(fd)	close(fd)
#else	/* SYS_WINNT follows */
# define socket_errno()		(errno = WSAGetLastError())
#endif

int ntp_set_tod (struct timeval *tvp, void *tzp);

#if defined (SYS_CYGWIN32)
#include 
#define __int64 long long
#endif

/*casey Tue May 27 15:45:25 SAT 1997*/
#ifdef SYS_VXWORKS

/* casey's new defines */
#define NO_MAIN_ALLOWED 	1
#define NO_NETDB			1
#define NO_RENAME			1

/* in vxWorks we use FIONBIO, but the others are defined for old systems, so
 * all hell breaks loose if we leave them defined we define USE_FIONBIO to
 * undefine O_NONBLOCK FNDELAY O_NDELAY where necessary.
 */
#define USE_FIONBIO 		1
/* end my new defines */

#define TIMEOFDAY		0x0 	/* system wide realtime clock */
#define HAVE_GETCLOCK		1	/* configure does not set this ... */
#define HAVE_NO_NICE		1	/* configure does not set this ... */
#define HAVE_RANDOM		1	/* configure does not set this ...  */
#define HAVE_SRANDOM		1	/* configure does not set this ... */

#define NODETACH		1

/* vxWorks specific additions to take care of its
 * unix (non)complicance
 */

#include "vxWorks.h"
#include "ioLib.h"
#include "taskLib.h"
#include "time.h"

extern int sysClkRateGet ();

/* usrtime.h
 * Bob Herlien's excellent time code find it at:
 * ftp://ftp.atd.ucar.edu/pub/vxworks/vx/usrTime.shar
 * I would recommend this instead of clock_[g|s]ettime() plus you get
 * adjtime() too ... casey
 */
/*
extern int	  gettimeofday ( struct timeval *tp, struct timezone *tzp );
extern int	  settimeofday (struct timeval *, struct timezone *);
extern int	  adjtime ( struct timeval *delta, struct timeval *olddelta );
 */

/* in  machines.c */
extern void sleep (int seconds);
extern void alarm (int seconds);
/* machines.c */


/*		this is really this 	*/
#define getpid		taskIdSelf
#define getclock	clock_gettime
#define fcntl		ioctl
#define _getch		getchar

/* define this away for vxWorks */
#define openlog(x,y)
/* use local defines for these */
#undef min
#undef max

#endif /* SYS_VXWORKS */

#ifdef NO_NETDB
/* These structures are needed for gethostbyname() etc... */
/* structures used by netdb.h */
struct	hostent {
	char	*h_name;				/* official name of host */
	char	**h_aliases;			/* alias list */
	int h_addrtype; 				/* host address type */
	int h_length;					/* length of address */
	char	**h_addr_list;			/* list of addresses from name server */
#define 	h_addr h_addr_list[0]	/* address, for backward compatibility */
};

struct	servent {
	char	*s_name;				/* official service name */
	char	**s_aliases;			/* alias list */
	int s_port; 					/* port # */
	char	*s_proto;				/* protocol to use */
};
extern int h_errno;

#define TRY_AGAIN	2

struct hostent *gethostbyname (char * netnum);
struct hostent *gethostbyaddr (char * netnum, int size, int addr_type);
/* type is the protocol */
struct servent *getservbyname (char *name, char *type);
#endif	/* NO_NETDB */

#ifdef NO_MAIN_ALLOWED
/* we have no main routines so lets make a plan */
#define CALL(callname, progname, callmain) \
	extern int callmain (int,char**); \
	void callname (a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
		char *a0;  \
		char *a1;  \
		char *a2;  \
		char *a3;  \
		char *a4;  \
		char *a5;  \
		char *a6;  \
		char *a7;  \
		char *a8;  \
		char *a9;  \
		char *a10; \
	{ \
	  char *x[11]; \
	  int argc; \
	  char *argv[] = {progname,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; \
	  int i; \
	  for (i=0;i<11;i++) \
	   x[i] = NULL; \
	  x[0] = a0; \
	  x[1] = a1; \
	  x[2] = a2; \
	  x[3] = a3; \
	  x[4] = a4; \
	  x[5] = a5; \
	  x[6] = a6; \
	  x[7] = a7; \
	  x[8] = a8; \
	  x[9] = a9; \
	  x[10] = a10; \
	  argc=1; \
	  for (i=0; i<11;i++) \
		if (x[i]) \
		{ \
		  argv[argc++] = x[i];	\
		} \
	 callmain(argc,argv);  \
	}
#endif /* NO_MAIN_ALLOWED */
/*casey Tue May 27 15:45:25 SAT 1997*/

/*
 * Here's where autoconfig starts to take over
 */
#ifdef HAVE_SYS_STROPTS_H
# ifdef HAVE_SYS_STREAM_H
#  define STREAM
# endif
#endif

#ifndef RETSIGTYPE
# if defined(NTP_POSIX_SOURCE)
#  define	RETSIGTYPE	void
# else
#  define	RETSIGTYPE	int
# endif
#endif

#ifdef	NTP_SYSCALLS_STD
# ifndef	NTP_SYSCALL_GET
#  define	NTP_SYSCALL_GET 235
# endif
# ifndef	NTP_SYSCALL_ADJ
#  define	NTP_SYSCALL_ADJ 236
# endif
#endif	/* NTP_SYSCALLS_STD */

#ifdef MPE
# include 
# include 
# include 
# include 

/* missing functions that are easily renamed */

# define _getch getchar

/* special functions that require MPE-specific wrappers */

# define bind	__ntp_mpe_bind
# define fcntl	__ntp_mpe_fcntl

/* standard macros missing from MPE include files */

# define IN_CLASSD(i)	((((long)(i))&0xf0000000)==0xe0000000)
# define IN_MULTICAST IN_CLASSD
# define ITIMER_REAL 0
# define MAXHOSTNAMELEN 64

/* standard structures missing from MPE include files */

struct itimerval { 
        struct timeval it_interval;    /* timer interval */
        struct timeval it_value;       /* current value */
};

/* various declarations to make gcc stop complaining */

extern int __filbuf(FILE *);
extern int __flsbuf(int, FILE *);
extern int gethostname(char *, int);
extern unsigned long inet_addr(char *);
extern char *strdup(const char *);

/* miscellaneous NTP macros */

# define HAVE_NO_NICE
#endif /* MPE */

#ifdef HAVE_RTPRIO
# define HAVE_NO_NICE
#else
# ifdef HAVE_SETPRIORITY
#  define HAVE_BSD_NICE
# else
#  ifdef HAVE_NICE
#	define HAVE_ATT_NICE
#  endif
# endif
#endif

#if !defined(HAVE_ATT_NICE) \
	&& !defined(HAVE_BSD_NICE) \
	&& !defined(HAVE_NO_NICE)
#include "ERROR: You must define one of the HAVE_xx_NICE defines!"
#endif

/*
 * use only one tty model - no use in initialising
 * a tty in three ways
 * HAVE_TERMIOS is preferred over HAVE_SYSV_TTYS over HAVE_BSD_TTYS
 */

#ifdef HAVE_TERMIOS_H
# define HAVE_TERMIOS
#else
# ifdef HAVE_TERMIO_H
#  define HAVE_SYSV_TTYS
# else
#  ifdef HAVE_SGTTY_H
#	define HAVE_BSD_TTYS
#  endif
# endif
#endif

#ifdef HAVE_TERMIOS
# undef HAVE_BSD_TTYS
# undef HAVE_SYSV_TTYS
#endif

#ifndef HAVE_TIMEGM
extern time_t	timegm		(struct tm *);
#endif

#ifdef HAVE_SYSV_TTYS
# undef HAVE_BSD_TTYS
#endif

#if !defined(SYS_WINNT) && !defined(VMS) && !defined(SYS_VXWORKS)
# if	!defined(HAVE_SYSV_TTYS) \
	&& !defined(HAVE_BSD_TTYS) \
	&& !defined(HAVE_TERMIOS)
#include "ERROR: no tty type defined!"
# endif
#endif /* SYS_WINNT || VMS	|| SYS_VXWORKS*/

#ifdef	WORDS_BIGENDIAN
# define	XNTP_BIG_ENDIAN 1
#else
# define	XNTP_LITTLE_ENDIAN	1
#endif

/*
 * Byte order woes.
 * This used to be resolved by calling ntohl() and htonl() to swap things
 * around, but this turned out to be quite costly on Vaxes where those
 * things are actual functions.  The code now straightens out byte
 * order troubles on its own, with no performance penalty for little
 * end first machines, but at great expense to cleanliness.
 */
#if !defined(XNTP_BIG_ENDIAN) && !defined(XNTP_LITTLE_ENDIAN)
	/*
	 * Pick one or the other.
	 */
	BYTE_ORDER_NOT_DEFINED_FOR_AUTHENTICATION
#endif

#if defined(XNTP_BIG_ENDIAN) && defined(XNTP_LITTLE_ENDIAN)
	/*
	 * Pick one or the other.
	 */
	BYTE_ORDER_NOT_DEFINED_FOR_AUTHENTICATION
#endif

#endif	/* NTP_MACHINE_H */
ntp-4.2.6p5/include/version.texi0000644000175000017500000000011011675460442015615 0ustar  peterpeter@set UPDATED 24 December 2011
@set EDITION 4.2.6p5
@set VERSION 4.2.6p5
ntp-4.2.6p5/include/ascii.h0000644000175000017500000000543210441361220014472 0ustar  peterpeter/*
 * /src/NTP/ntp4-dev/include/ascii.h,v 4.4 2005/04/16 17:32:10 kardel RELEASE_20050508_A
 *
 * ascii.h,v 4.4 2005/04/16 17:32:10 kardel RELEASE_20050508_A
 *
 * $Created: Sun Jul 20 11:42:53 1997 $
 *
 * Copyright (c) 1997-2005 by Frank Kardel  ntp.org>
 *
 * 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.
 * 3. Neither the name of the author nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * 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.
 *
 */
#ifndef ASCII_H
#define ASCII_H

/*
 * just name the common ASCII control codes
 */
#define NUL	  0
#define SOH	  1
#define STX	  2
#define ETX	  3
#define EOT	  4
#define ENQ	  5
#define ACK	  6
#define BEL	  7
#define BS	  8
#define HT	  9
#define NL	 10
#define VT	 11
#define NP	 12
#define CR	 13
#define SO	 14
#define SI	 15
#define DLE	 16
#define DC1	 17
#define DC2	 18
#define DC3	 19
#define DC4	 20
#define NAK	 21
#define SYN	 22
#define ETB	 23
#define CAN	 24
#define EM	 25
#define SUB	 26
#define ESC	 27
#define FS	 28
#define GS	 29
#define RS	 30
#define US	 31
#define SP	 32
#define DEL	127

#endif
/*
 * History:
 *
 * ascii.h,v
 * Revision 4.4  2005/04/16 17:32:10  kardel
 * update copyright
 *
 * Revision 4.3  2004/11/14 15:29:41  kardel
 * support PPSAPI, upgrade Copyright to Berkeley style
 *
 * Revision 4.1  1998/07/11 10:05:22  kardel
 * Release 4.0.73d reconcilation
 *
 * Revision 4.0  1998/04/10 19:50:38  kardel
 * Start 4.0 release version numbering
 *
 * Revision 4.0  1998/04/10 19:50:38  kardel
 * Start 4.0 release version numbering
 *
 */
ntp-4.2.6p5/include/refclock_atom.h0000644000175000017500000000066611307651603016227 0ustar  peterpeter/*
 * Definitions for the atom driver and its friends
 */
#define NANOSECOND	1000000000 /* one second (ns) */
#define RANGEGATE	500000  /* range gate (ns) */

struct refclock_atom {
	pps_handle_t handle;
	pps_params_t pps_params;
	struct timespec ts;
};

extern	int	refclock_ppsapi(int, struct refclock_atom *);
extern	int	refclock_params(int, struct refclock_atom *);
extern	int	refclock_pps(struct peer *, struct refclock_atom *, int);
ntp-4.2.6p5/include/ntp_lists.h0000644000175000017500000003014411616416167015437 0ustar  peterpeter/*
 * ntp_lists.h - linked lists common code
 *
 * SLIST: singly-linked lists
 * ==========================
 *
 * These macros implement a simple singly-linked list template.  Both
 * the listhead and per-entry next fields are declared as pointers to
 * the list entry struct type.  Initialization to NULL is typically
 * implicit (for globals and statics) or handled by zeroing of the
 * containing structure.
 *
 * The name of the next link field is passed as an argument to allow
 * membership in several lists at once using multiple next link fields.
 *
 * When possible, placing the link field first in the entry structure
 * allows slightly smaller code to be generated on some platforms.
 *
 * LINK_SLIST(listhead, pentry, nextlink)
 *	add entry at head
 *
 * LINK_TAIL_SLIST(listhead, pentry, nextlink, entrytype)
 *	add entry at tail.  This is O(n), if this is a common
 *	operation the FIFO template may be more appropriate.
 *
 * LINK_SORT_SLIST(listhead, pentry, beforecur, nextlink, entrytype)
 *	add entry in sorted order.  beforecur is an expression comparing
 *	pentry with the current list entry.  The current entry can be
 *	referenced within beforecur as L_S_S_CUR(), which is short for
 *	LINK_SORT_SLIST_CUR().  beforecur is nonzero if pentry sorts
 *	before L_S_S_CUR().
 *
 * UNLINK_HEAD_SLIST(punlinked, listhead, nextlink)
 *	unlink first entry and point punlinked to it, or set punlinked
 *	to NULL if the list is empty.
 *
 * UNLINK_SLIST(punlinked, listhead, ptounlink, nextlink, entrytype)
 *	unlink entry pointed to by ptounlink.  punlinked is set to NULL
 *	if the entry is not found on the list, otherwise it is set to
 *	ptounlink.
 *
 * UNLINK_EXPR_SLIST(punlinked, listhead, expr, nextlink, entrytype)
 *	unlink entry where expression expr is nonzero.  expr can refer
 *	to the entry being tested using UNLINK_EXPR_SLIST_CURRENT(),
 *	alias U_E_S_CUR().  See the implementation of UNLINK_SLIST()
 *	below for an example. U_E_S_CUR() is NULL iff the list is empty.
 *	punlinked is pointed to the removed entry or NULL if none
 *	satisfy expr.
 *
 * FIFO: singly-linked lists plus tail pointer
 * ===========================================
 *
 * This is the same as FreeBSD's sys/queue.h STAILQ -- a singly-linked
 * list implementation with tail-pointer maintenance, so that adding
 * at the tail for first-in, first-out access is O(1).
 *
 * DECL_FIFO_ANCHOR(entrytype)
 *	provides the type specification portion of the declaration for
 *	a variable to refer to a FIFO queue (similar to listhead).  The
 *	anchor contains the head and indirect tail pointers.  Example:
 *
 *		#include "ntp_lists.h"
 *
 *		typedef struct myentry_tag myentry;
 *		struct myentry_tag {
 *			myentry *next_link;
 *			...
 *		};
 *
 *		DECL_FIFO_ANCHOR(myentry) my_fifo;
 *
 *		void somefunc(myentry *pentry)
 *		{
 *			LINK_FIFO(my_fifo, pentry, next_link);
 *		}
 *
 *	If DECL_FIFO_ANCHOR is used with stack or heap storage, it
 *	should be initialized to NULL pointers using a = { NULL };
 *	initializer or memset.
 *
 * HEAD_FIFO(anchor)
 * TAIL_FIFO(anchor)
 *	Pointer to first/last entry, NULL if FIFO is empty.
 *
 * LINK_FIFO(anchor, pentry, nextlink)
 *	add entry at tail.
 *
 * UNLINK_FIFO(punlinked, anchor, nextlink)
 *	unlink head entry and point punlinked to it, or set punlinked
 *	to NULL if the list is empty.
 *
 * CONCAT_FIFO(q1, q2, nextlink)
 *	empty fifoq q2 moving its nodes to q1 following q1's existing
 *	nodes.
 *
 * DLIST: doubly-linked lists
 * ==========================
 *
 * Elements on DLISTs always have non-NULL forward and back links,
 * because both link chains are circular.  The beginning/end is marked
 * by the listhead, which is the same type as elements for simplicity.
 * An empty list's listhead has both links set to its own address.
 *
 *
 */
#ifndef NTP_LISTS_H
#define NTP_LISTS_H

#include "ntp_types.h"		/* TRUE and FALSE */
#include "ntp_assert.h"

#ifdef DEBUG
# define NTP_DEBUG_LISTS_H
#endif

/*
 * If list debugging is not enabled, save a little time by not clearing
 * an entry's link pointer when it is unlinked, as the stale pointer
 * is harmless as long as it is ignored when the entry is not in a
 * list.
 */
#ifndef NTP_DEBUG_LISTS_H
#define MAYBE_Z_LISTS(p)	do { } while (FALSE)
#else
#define MAYBE_Z_LISTS(p)	(p) = NULL
#endif

#define LINK_SLIST(listhead, pentry, nextlink)			\
do {								\
	(pentry)->nextlink = (listhead);			\
	(listhead) = (pentry);					\
} while (FALSE)

#define LINK_TAIL_SLIST(listhead, pentry, nextlink, entrytype)	\
do {								\
	entrytype **pptail;					\
								\
	pptail = &(listhead);					\
	while (*pptail != NULL)					\
		pptail = &((*pptail)->nextlink);		\
								\
	(pentry)->nextlink = NULL;				\
	*pptail = (pentry);					\
} while (FALSE)

#define LINK_SORT_SLIST_CURRENT()	(*ppentry)
#define	L_S_S_CUR()			LINK_SORT_SLIST_CURRENT()

#define LINK_SORT_SLIST(listhead, pentry, beforecur, nextlink,	\
			entrytype)				\
do {								\
	entrytype **ppentry;					\
								\
	ppentry = &(listhead);					\
	while (TRUE) {						\
		if (NULL == *ppentry || (beforecur)) {		\
			(pentry)->nextlink = *ppentry;		\
			*ppentry = (pentry);			\
			break;					\
		}						\
		ppentry = &((*ppentry)->nextlink);		\
		if (NULL == *ppentry) {				\
			(pentry)->nextlink = NULL;		\
			*ppentry = (pentry);			\
			break;					\
		}						\
	}							\
} while (FALSE)

#define UNLINK_HEAD_SLIST(punlinked, listhead, nextlink)	\
do {								\
	(punlinked) = (listhead);				\
	if (NULL != (punlinked)) {				\
		(listhead) = (punlinked)->nextlink;		\
		MAYBE_Z_LISTS((punlinked)->nextlink);		\
	}							\
} while (FALSE)

#define UNLINK_EXPR_SLIST_CURRENT()	(*ppentry)
#define	U_E_S_CUR()			UNLINK_EXPR_SLIST_CURRENT()

#define UNLINK_EXPR_SLIST(punlinked, listhead, expr, nextlink,	\
			  entrytype)				\
do {								\
	entrytype **ppentry;					\
								\
	ppentry = &(listhead);					\
								\
	while (!(expr))						\
		if (*ppentry != NULL &&				\
		    (*ppentry)->nextlink != NULL) {		\
			ppentry = &((*ppentry)->nextlink);	\
		} else {					\
			ppentry = NULL;				\
			break;					\
		}						\
								\
	if (ppentry != NULL) {					\
		(punlinked) = *ppentry;				\
		*ppentry = (punlinked)->nextlink;		\
		MAYBE_Z_LISTS((punlinked)->nextlink);		\
	} else {						\
		(punlinked) = NULL;				\
	}							\
} while (FALSE)

#define UNLINK_SLIST(punlinked, listhead, ptounlink, nextlink,	\
		     entrytype)					\
	UNLINK_EXPR_SLIST(punlinked, listhead, (ptounlink) ==	\
	    U_E_S_CUR(), nextlink, entrytype)

#define CHECK_SLIST(listhead, nextlink, entrytype)		\
do {								\
	entrytype *pentry;					\
								\
	for (pentry = (listhead);				\
	     pentry != NULL;					\
	     pentry = pentry->nextlink){			\
		NTP_INSIST(pentry != pentry->nextlink);		\
		NTP_INSIST((listhead) != pentry->nextlink);	\
	}							\
} while (FALSE)

/*
 * FIFO
 */

#define DECL_FIFO_ANCHOR(entrytype)				\
struct {							\
	entrytype *	phead;	/* NULL if list empty */	\
	entrytype **	pptail;	/* NULL if list empty */	\
}

#define HEAD_FIFO(anchor)	((anchor).phead)
#define TAIL_FIFO(anchor)	((NULL == (anchor).pptail)	\
					? NULL			\
					: *((anchor).pptail))

/*
 * For DEBUG builds only, verify both or neither of the anchor pointers
 * are NULL with each operation.
 */
#if !defined(NTP_DEBUG_LISTS_H)
#define	CHECK_FIFO_CONSISTENCY(anchor)	do { } while (FALSE)
#else
#define	CHECK_FIFO_CONSISTENCY(anchor)				\
	check_gen_fifo_consistency(&(anchor))
void	check_gen_fifo_consistency(void *fifo);
#endif

/*
 * generic FIFO element used to access any FIFO where each element
 * begins with the link pointer
 */
typedef struct gen_node_tag gen_node;
struct gen_node_tag {
	gen_node *	link;
};

/* generic FIFO */
typedef DECL_FIFO_ANCHOR(gen_node) gen_fifo;


#define LINK_FIFO(anchor, pentry, nextlink)			\
do {								\
	CHECK_FIFO_CONSISTENCY(anchor);				\
								\
	(pentry)->nextlink = NULL;				\
	if (NULL != (anchor).pptail) {				\
		(*((anchor).pptail))->nextlink = (pentry);	\
		(anchor).pptail =				\
		    &(*((anchor).pptail))->nextlink;		\
	} else {						\
		(anchor).phead = (pentry);			\
		(anchor).pptail = &(anchor).phead;		\
	}							\
								\
	CHECK_FIFO_CONSISTENCY(anchor);				\
} while (FALSE)

#define UNLINK_FIFO(punlinked, anchor, nextlink)		\
do {								\
	CHECK_FIFO_CONSISTENCY(anchor);				\
								\
	(punlinked) = (anchor).phead;				\
	if (NULL != (punlinked)) {				\
		(anchor).phead = (punlinked)->nextlink;		\
		if (NULL == (anchor).phead)			\
			(anchor).pptail = NULL;			\
		else if ((anchor).pptail ==			\
			 &(punlinked)->nextlink)		\
			(anchor).pptail = &(anchor).phead;	\
		MAYBE_Z_LISTS((punlinked)->nextlink);		\
		CHECK_FIFO_CONSISTENCY(anchor);			\
	}							\
} while (FALSE)

#define UNLINK_MID_FIFO(punlinked, anchor, tounlink, nextlink,	\
			entrytype)				\
do {								\
	entrytype **ppentry;					\
								\
	CHECK_FIFO_CONSISTENCY(anchor);				\
								\
	ppentry = &(anchor).phead;				\
								\
	while ((tounlink) != *ppentry)				\
		if ((*ppentry)->nextlink != NULL) {		\
			ppentry = &((*ppentry)->nextlink);	\
		} else {					\
			ppentry = NULL;				\
			break;					\
		}						\
								\
	if (ppentry != NULL) {					\
		(punlinked) = *ppentry;				\
		*ppentry = (punlinked)->nextlink;		\
		if (NULL == *ppentry)				\
			(anchor).pptail = NULL;			\
		else if ((anchor).pptail ==			\
			 &(punlinked)->nextlink)		\
			(anchor).pptail = &(anchor).phead;	\
		MAYBE_Z_LISTS((punlinked)->nextlink);		\
		CHECK_FIFO_CONSISTENCY(anchor);			\
	} else {						\
		(punlinked) = NULL;				\
	}							\
} while (FALSE)

#define CONCAT_FIFO(f1, f2, nextlink)				\
do {								\
	CHECK_FIFO_CONSISTENCY(f1);				\
	CHECK_FIFO_CONSISTENCY(f2);				\
								\
	if ((f2).pptail != NULL) {				\
		if ((f1).pptail != NULL) {			\
			(*(f1).pptail)->nextlink = (f2).phead;	\
			if ((f2).pptail == &(f2).phead)		\
				(f1).pptail =			\
				    &(*(f1).pptail)->nextlink;	\
			else					\
				(f1).pptail = (f2).pptail;	\
			CHECK_FIFO_CONSISTENCY(f1);		\
		} else	{					\
			(f1) = (f2);				\
		}						\
		MAYBE_Z_LISTS((f2).phead);			\
		MAYBE_Z_LISTS((f2).pptail);			\
	}							\
} while (FALSE)

/*
 * DLIST
 */
#define DECL_DLIST_LINK(entrytype, link)			\
struct {							\
	entrytype *	b;					\
	entrytype *	f;					\
} link

#define INIT_DLIST(listhead, link)				\
do {								\
	(listhead).link.f = &(listhead);			\
	(listhead).link.b = &(listhead);			\
} while (FALSE)

#define HEAD_DLIST(listhead, link)				\
	(							\
		(&(listhead) != (listhead).link.f)		\
		    ? (listhead).link.f				\
		    : NULL					\
	)

#define TAIL_DLIST(listhead, link)				\
	(							\
		(&(listhead) != (listhead).link.b)		\
		    ? (listhead).link.b				\
		    : NULL					\
	)

#define NEXT_DLIST(listhead, entry, link)			\
	(							\
		(&(listhead) != (entry)->link.f)		\
		    ? (entry)->link.f				\
		    : NULL					\
	)

#define PREV_DLIST(listhead, entry, link)			\
	(							\
		(&(listhead) != (entry)->link.b)		\
		    ? (entry)->link.b				\
		    : NULL					\
	)

#define LINK_DLIST(listhead, pentry, link)			\
do {								\
	(pentry)->link.f = (listhead).link.f;			\
	(pentry)->link.b = &(listhead);				\
	(listhead).link.f->link.b = (pentry);			\
	(listhead).link.f = (pentry);				\
} while (FALSE)

#define LINK_TAIL_DLIST(listhead, pentry, link)			\
do {								\
	(pentry)->link.b = (listhead).link.b;			\
	(pentry)->link.f = &(listhead);				\
	(listhead).link.b->link.f = (pentry);			\
	(listhead).link.b = (pentry);				\
} while (FALSE)

#define UNLINK_DLIST(ptounlink, link)				\
do {								\
	(ptounlink)->link.b->link.f = (ptounlink)->link.f;	\
	(ptounlink)->link.f->link.b = (ptounlink)->link.b;	\
	MAYBE_Z_LISTS((ptounlink)->link.b);			\
	MAYBE_Z_LISTS((ptounlink)->link.f);			\
} while (FALSE)

#define ITER_DLIST_BEGIN(listhead, iter, link, entrytype)	\
{								\
	entrytype *i_dl_nextiter;				\
								\
	for ((iter) = (listhead).link.f;			\
	     (iter) != &(listhead)				\
	     && ((i_dl_nextiter = (iter)->link.f), TRUE);	\
	     (iter) = i_dl_nextiter) {
#define ITER_DLIST_END()					\
	}							\
}

#define REV_ITER_DLIST_BEGIN(listhead, iter, link, entrytype)	\
{								\
	entrytype *i_dl_nextiter;				\
								\
	for ((iter) = (listhead).link.b;			\
	     (iter) != &(listhead)				\
	     && ((i_dl_nextiter = (iter)->link.b), TRUE);	\
	     (iter) = i_dl_nextiter) {
#define REV_ITER_DLIST_END()					\
	}							\
}

#endif	/* NTP_LISTS_H */
ntp-4.2.6p5/include/recvbuff.h0000644000175000017500000000645511505336023015217 0ustar  peterpeter#ifndef RECVBUFF_H
#define RECVBUFF_H

#ifdef HAVE_CONFIG_H
# include 
#endif

#include "ntp.h"
#include "ntp_fp.h"
#include "ntp_lists.h"

#include 

/*
 * recvbuf memory management
 */
#define RECV_INIT	10	/* 10 buffers initially */
#define RECV_LOWAT	3	/* when we're down to three buffers get more */
#define RECV_INC	5	/* get 5 more at a time */
#define RECV_TOOMANY	40	/* this is way too many buffers */

#if defined HAVE_IO_COMPLETION_PORT
# include "ntp_iocompletionport.h"
#include "ntp_timer.h"

# define RECV_BLOCK_IO()	EnterCriticalSection(&RecvCritSection)
# define RECV_UNBLOCK_IO()	LeaveCriticalSection(&RecvCritSection)

/*  Return the event which is set when items are added to the full list
 */
extern HANDLE	get_recv_buff_event (void);
#else
# define RECV_BLOCK_IO()	
# define RECV_UNBLOCK_IO()	
#endif


/*
 * Format of a recvbuf.  These are used by the asynchronous receive
 * routine to store incoming packets and related information.
 */

/*
 *  the maximum length NTP packet contains the NTP header, one Autokey
 *  request, one Autokey response and the MAC. Assuming certificates don't
 *  get too big, the maximum packet length is set arbitrarily at 1000.
 */   
#define	RX_BUFF_SIZE	1000		/* hail Mary */


typedef struct recvbuf recvbuf_t;

struct recvbuf {
	ISC_LINK(recvbuf_t)	link;	/* next in list */
	union {
		sockaddr_u X_recv_srcadr;
		caddr_t X_recv_srcclock;
		struct peer *X_recv_peer;
	} X_from_where;
#define recv_srcadr	X_from_where.X_recv_srcadr
#define	recv_srcclock	X_from_where.X_recv_srcclock
#define recv_peer	X_from_where.X_recv_peer
#ifndef HAVE_IO_COMPLETION_PORT
	sockaddr_u srcadr;		/* where packet came from */
#else
	int recv_srcadr_len;		/* filled in on completion */
#endif
	endpt *	dstadr;			/* address pkt arrived on */
	SOCKET	fd;			/* fd on which it was received */
	int msg_flags;			/* Flags received about the packet */
	l_fp recv_time;			/* time of arrival */
	void (*receiver) (struct recvbuf *); /* routine to receive buffer */
	int recv_length;		/* number of octets received */
	union {
		struct pkt X_recv_pkt;
		u_char X_recv_buffer[RX_BUFF_SIZE];
	} recv_space;
#define	recv_pkt	recv_space.X_recv_pkt
#define	recv_buffer	recv_space.X_recv_buffer
	int used;			/* reference count */
};

extern	void	init_recvbuff	(int);

/* freerecvbuf - make a single recvbuf available for reuse
 */
extern	void	freerecvbuf (struct recvbuf *);

/*  Get a free buffer (typically used so an async
 *  read can directly place data into the buffer
 *
 *  The buffer is removed from the free list. Make sure
 *  you put it back with freerecvbuf() or 
 */
extern	struct recvbuf *get_free_recv_buffer (void); /* signal safe - no malloc */
extern	struct recvbuf *get_free_recv_buffer_alloc (void); /* signal unsafe - may malloc */

/*   Add a buffer to the full list
 */
extern	void	add_full_recv_buffer	 (struct recvbuf *);

/*extern	void	process_recv_buffers	 (void); */

/* number of recvbufs on freelist */
extern u_long free_recvbuffs (void);		
extern u_long full_recvbuffs (void);		
extern u_long total_recvbuffs (void);
extern u_long lowater_additions (void);
		
/*  Returns the next buffer in the full list.
 *
 */
extern	struct recvbuf *get_full_recv_buffer (void);

/*
 * Checks to see if there are buffers to process
 */
extern isc_boolean_t has_full_recv_buffer (void);

#endif	/* RECVBUFF_H */
ntp-4.2.6p5/include/ntp_control.h0000644000175000017500000001660011505336022015746 0ustar  peterpeter/*
 * ntp_control.h - definitions related to NTP mode 6 control messages
 */

#include "ntp_types.h"

struct ntp_control {
	u_char li_vn_mode;		/* leap, version, mode */
	u_char r_m_e_op;		/* response, more, error, opcode */
	u_short sequence;		/* sequence number of request */
	u_short status;			/* status word for association */
	associd_t associd;		/* association ID */
	u_short offset;			/* offset of this batch of data */
	u_short count;			/* count of data in this packet */
	u_char data[(480 + MAX_MAC_LEN)]; /* data + auth */
};

/*
 * Length of the control header, in octets
 */
#define	CTL_HEADER_LEN		(offsetof(struct ntp_control, data))
#define	CTL_MAX_DATA_LEN	468


/*
 * Limits and things
 */
#define	CTL_MAXTRAPS	3		/* maximum number of traps we allow */
#define	CTL_TRAPTIME	(60*60)		/* time out traps in 1 hour */
#define	CTL_MAXAUTHSIZE	64		/* maximum size of an authen'ed req */

/*
 * Decoding for the r_m_e_op field
 */
#define	CTL_RESPONSE	0x80
#define	CTL_ERROR	0x40
#define	CTL_MORE	0x20
#define	CTL_OP_MASK	0x1f

#define	CTL_ISRESPONSE(r_m_e_op)	(((r_m_e_op) & 0x80) != 0)
#define	CTL_ISMORE(r_m_e_op)	(((r_m_e_op) & 0x20) != 0)
#define	CTL_ISERROR(r_m_e_op)	(((r_m_e_op) & 0x40) != 0)
#define	CTL_OP(r_m_e_op)	((r_m_e_op) & CTL_OP_MASK)

/*
 * Opcodes
 */
#define	CTL_OP_UNSPEC		0	/* unspeciffied */
#define	CTL_OP_READSTAT		1	/* read status */
#define	CTL_OP_READVAR		2	/* read variables */
#define	CTL_OP_WRITEVAR		3	/* write variables */
#define	CTL_OP_READCLOCK	4	/* read clock variables */
#define	CTL_OP_WRITECLOCK	5	/* write clock variables */
#define	CTL_OP_SETTRAP		6	/* set trap address */
#define	CTL_OP_ASYNCMSG		7	/* asynchronous message */
#define CTL_OP_CONFIGURE	8	/* runtime configuration */
#define CTL_OP_SAVECONFIG	9	/* save config to file */
#define	CTL_OP_UNSETTRAP	31	/* unset trap */

/*
 * {En,De}coding of the system status word
 */
#define	CTL_SST_TS_UNSPEC	0	/* unspec */
#define	CTL_SST_TS_ATOM		1	/* pps */
#define	CTL_SST_TS_LF		2	/* lf radio */
#define	CTL_SST_TS_HF		3	/* hf radio */
#define	CTL_SST_TS_UHF		4	/* uhf radio */
#define	CTL_SST_TS_LOCAL	5	/* local */
#define	CTL_SST_TS_NTP		6	/* ntp */
#define	CTL_SST_TS_UDPTIME	7	/* other */
#define	CTL_SST_TS_WRSTWTCH	8	/* wristwatch */
#define	CTL_SST_TS_TELEPHONE	9	/* telephone */

#define	CTL_SYS_MAXEVENTS	15

#define	CTL_SYS_STATUS(li, source, nevnt, evnt) \
		(((((unsigned short)(li))<< 14)&0xc000) | \
		(((source)<<8)&0x3f00) | \
		(((nevnt)<<4)&0x00f0) | \
		((evnt)&0x000f))

#define	CTL_SYS_LI(status)	(((status)>>14) & 0x3)
#define	CTL_SYS_SOURCE(status)	(((status)>>8) & 0x3f)
#define	CTL_SYS_NEVNT(status)	(((status)>>4) & 0xf)
#define	CTL_SYS_EVENT(status)	((status) & 0xf)

/*
 * {En,De}coding of the peer status word
 */
#define	CTL_PST_CONFIG		0x80
#define	CTL_PST_AUTHENABLE	0x40
#define	CTL_PST_AUTHENTIC	0x20
#define	CTL_PST_REACH		0x10
#define	CTL_PST_BCAST		0x08

#define	CTL_PST_SEL_REJECT	0	/*   reject */
#define	CTL_PST_SEL_SANE	1	/* x falsetick */
#define	CTL_PST_SEL_CORRECT	2	/* . excess */
#define	CTL_PST_SEL_SELCAND	3	/* - outlyer */
#define	CTL_PST_SEL_SYNCCAND	4	/* + candidate */
#define	CTL_PST_SEL_EXCESS	5	/* # backup */
#define	CTL_PST_SEL_SYSPEER	6	/* * sys.peer */
#define	CTL_PST_SEL_PPS		7	/* o pps.peer */

#define	CTL_PEER_MAXEVENTS	15

#define	CTL_PEER_STATUS(status, nevnt, evnt) \
		((((status)<<8) & 0xff00) | \
		(((nevnt)<<4) & 0x00f0) | \
		((evnt) & 0x000f))

#define	CTL_PEER_STATVAL(status)(((status)>>8) & 0xff)
#define	CTL_PEER_NEVNT(status)	(((status)>>4) & 0xf)
#define	CTL_PEER_EVENT(status)	((status) & 0xf)

/*
 * {En,De}coding of the clock status word
 */
#define	CTL_CLK_OKAY		0
#define	CTL_CLK_NOREPLY		1
#define	CTL_CLK_BADFORMAT	2
#define	CTL_CLK_FAULT		3
#define	CTL_CLK_PROPAGATION	4
#define	CTL_CLK_BADDATE		5
#define	CTL_CLK_BADTIME		6

#define	CTL_CLK_STATUS(status, event) \
		((((status)<<8) & 0xff00) | \
		((event) & 0x00ff))

/*
 * Error code responses returned when the E bit is set.
 */
#define	CERR_UNSPEC	0
#define	CERR_PERMISSION	1
#define	CERR_BADFMT	2
#define	CERR_BADOP	3
#define	CERR_BADASSOC	4
#define	CERR_UNKNOWNVAR	5
#define	CERR_BADVALUE	6
#define	CERR_RESTRICT	7

#define	CERR_NORESOURCE	CERR_PERMISSION	/* wish there was a different code */


/*
 * System variables we understand
 */
#define	CS_LEAP		1
#define	CS_STRATUM	2
#define	CS_PRECISION	3
#define	CS_ROOTDELAY	4
#define	CS_ROOTDISPERSION	5
#define	CS_REFID	6
#define	CS_REFTIME	7
#define	CS_POLL		8
#define	CS_PEERID	9
#define	CS_OFFSET	10
#define	CS_DRIFT	11
#define CS_JITTER	12
#define CS_ERROR	13
#define	CS_CLOCK	14
#define	CS_PROCESSOR	15
#define	CS_SYSTEM	16
#define CS_VERSION	17
#define	CS_STABIL	18
#define CS_VARLIST	19
#define CS_TAI          20
#define CS_LEAPTAB      21
#define CS_LEAPEND      22
#define	CS_RATE		23
#ifdef OPENSSL
#define CS_FLAGS	24
#define CS_HOST		25
#define CS_PUBLIC	26
#define	CS_CERTIF	27
#define	CS_SIGNATURE	28
#define	CS_REVTIME	29
#define	CS_GROUP	30
#define CS_DIGEST	31
#define	CS_MAXCODE	CS_DIGEST
#else
#define	CS_MAXCODE	CS_RATE
#endif /* OPENSSL */

/*
 * Peer variables we understand
 */
#define	CP_CONFIG	1
#define	CP_AUTHENABLE	2
#define	CP_AUTHENTIC	3
#define	CP_SRCADR	4
#define	CP_SRCPORT	5
#define	CP_DSTADR	6
#define	CP_DSTPORT	7
#define	CP_LEAP		8
#define	CP_HMODE	9
#define	CP_STRATUM	10
#define	CP_PPOLL	11
#define	CP_HPOLL	12
#define	CP_PRECISION	13
#define	CP_ROOTDELAY	14
#define	CP_ROOTDISPERSION	15
#define	CP_REFID	16
#define	CP_REFTIME	17
#define	CP_ORG		18
#define	CP_REC		19
#define	CP_XMT		20
#define	CP_REACH	21
#define	CP_UNREACH	22
#define	CP_TIMER	23
#define	CP_DELAY	24
#define	CP_OFFSET	25
#define CP_JITTER	26
#define	CP_DISPERSION	27
#define	CP_KEYID	28
#define	CP_FILTDELAY	29
#define	CP_FILTOFFSET	30
#define	CP_PMODE	31
#define	CP_RECEIVED	32
#define	CP_SENT		33
#define	CP_FILTERROR	34
#define	CP_FLASH	35
#define CP_TTL		36
#define CP_VARLIST	37
#define	CP_IN		38
#define	CP_OUT		39
#define	CP_RATE		40
#define	CP_BIAS		41
#ifdef OPENSSL
#define CP_FLAGS	42
#define CP_HOST		43
#define CP_VALID	44
#define	CP_INITSEQ	45
#define	CP_INITKEY	46
#define	CP_INITTSP	47
#define	CP_SIGNATURE	48
#define	CP_MAXCODE	CP_SIGNATURE
#else
#define	CP_MAXCODE	CP_BIAS
#endif /* OPENSSL */

/*
 * Clock variables we understand
 */
#define	CC_TYPE		1
#define	CC_TIMECODE	2
#define	CC_POLL		3
#define	CC_NOREPLY	4
#define	CC_BADFORMAT	5
#define	CC_BADDATA	6
#define	CC_FUDGETIME1	7
#define	CC_FUDGETIME2	8
#define	CC_FUDGEVAL1	9
#define	CC_FUDGEVAL2	10
#define	CC_FLAGS	11
#define	CC_DEVICE	12
#define CC_VARLIST	13
#define	CC_MAXCODE	CC_VARLIST

/*
 * Definition of the structure used internally to hold trap information.
 * ntp_request.c wants to see this.
 */
struct ctl_trap {
	sockaddr_u tr_addr;		/* address of trap recipient */
	struct interface *tr_localaddr;	/* interface to send this through */
	u_long tr_settime;		/* time trap was set */
	u_long tr_count;		/* async messages sent to this guy */
	u_long tr_origtime;		/* time trap was originally set */
	u_long tr_resets;		/* count of resets for this trap */
	u_short tr_sequence;		/* trap sequence id */
	u_char tr_flags;		/* trap flags */
	u_char tr_version;		/* version number of trapper */
};
extern struct ctl_trap ctl_trap[];

/*
 * Flag bits
 */
#define	TRAP_INUSE	0x1		/* this trap is active */
#define	TRAP_NONPRIO	0x2		/* this trap is non-priority */
#define	TRAP_CONFIGURED	0x4		/* this trap was configured */

/*
 * Types of things we may deal with
 * shared between ntpq and library
 */
#define	TYPE_SYS	1
#define	TYPE_PEER	2
#define	TYPE_CLOCK	3
ntp-4.2.6p5/include/ntp_crypto.h0000644000175000017500000001471311307651604015617 0ustar  peterpeter/*
 * ntp_crypto.h - definitions for cryptographic operations
 */
#ifndef NTP_CRYPTO_H
#define NTP_CRYPTO_H

/*
 * Configuration codes (also needed for parser without OPENSSL)
 */
#define CRYPTO_CONF_NONE  0	/* nothing doing */
#define CRYPTO_CONF_PRIV  1	/* host keys file name */
#define CRYPTO_CONF_SIGN  2	/* signature keys file name */
#define CRYPTO_CONF_CERT  3	/* certificate file name */
#define CRYPTO_CONF_RAND  4	/* random seed file name */
#define CRYPTO_CONF_IFFPAR 5	/* IFF parameters file name */
#define CRYPTO_CONF_GQPAR 6	/* GQ parameters file name */
#define	CRYPTO_CONF_MVPAR 7	/* MV parameters file name */
#define CRYPTO_CONF_PW	  8	/* private key password */
#define	CRYPTO_CONF_IDENT 9	/* specify identity scheme */
#define	CRYPTO_CONF_NID   10	/* specify digest name */

#ifdef OPENSSL
#include "openssl/evp.h"

/*
 * The following bits are set by the CRYPTO_ASSOC message from
 * the server and are not modified by the client.
 */
#define CRYPTO_FLAG_ENAB  0x0001 /* crypto enable */
#define CRYPTO_FLAG_TAI   0x0002 /* leapseconds table */

#define CRYPTO_FLAG_PRIV  0x0010 /* PC identity scheme */
#define CRYPTO_FLAG_IFF   0x0020 /* IFF identity scheme */
#define CRYPTO_FLAG_GQ	  0x0040 /* GQ identity scheme */
#define	CRYPTO_FLAG_MV	  0x0080 /* MV identity scheme */
#define CRYPTO_FLAG_MASK  0x00f0 /* identity scheme mask */
	
/*
 * The following bits are used by the client during the protocol
 * exchange.
 */
#define CRYPTO_FLAG_CERT  0x0100 /* public key verified */
#define CRYPTO_FLAG_VRFY  0x0200 /* identity verified */
#define CRYPTO_FLAG_PROV  0x0400 /* signature verified */
#define CRYPTO_FLAG_COOK  0x0800 /* cookie verifed */
#define CRYPTO_FLAG_AUTO  0x1000 /* autokey verified */
#define CRYPTO_FLAG_SIGN  0x2000 /* certificate signed */
#define CRYPTO_FLAG_LEAP  0x4000 /* leapsecond values verified */
#define	CRYPTO_FLAG_ALL   0x7f00 /* all mask */

/*
 * Flags used for certificate management
 */
#define	CERT_TRUST	0x01	/* certificate is trusted */
#define CERT_SIGN	0x02	/* certificate is signed */
#define CERT_VALID	0x04	/* certificate is valid */
#define CERT_PRIV	0x08	/* certificate is private */
#define CERT_ERROR	0x80	/* certificate has errors */

/*
 * Extension field definitions
 */
#define	CRYPTO_MAXLEN	1024	/* max extension field length */
#define CRYPTO_VN	2	/* current protocol version number */
#define CRYPTO_CMD(x)	(((CRYPTO_VN << 8) | (x)) << 16)
#define CRYPTO_NULL	CRYPTO_CMD(0) /* no operation */
#define CRYPTO_ASSOC	CRYPTO_CMD(1) /* association */
#define CRYPTO_CERT	CRYPTO_CMD(2) /* certificate */
#define CRYPTO_COOK	CRYPTO_CMD(3) /* cookie value */
#define CRYPTO_AUTO	CRYPTO_CMD(4) /* autokey values */
#define CRYPTO_LEAP	CRYPTO_CMD(5) /* leapsecond values */
#define	CRYPTO_SIGN	CRYPTO_CMD(6) /* certificate sign */
#define CRYPTO_IFF	CRYPTO_CMD(7) /* IFF identity scheme */
#define CRYPTO_GQ	CRYPTO_CMD(8) /* GQ identity scheme */
#define	CRYPTO_MV	CRYPTO_CMD(9) /* MV identity scheme */
#define CRYPTO_RESP	0x80000000 /* response */
#define CRYPTO_ERROR	0x40000000 /* error */

/*
 * Autokey event codes
 */
#define XEVNT_CMD(x)	(CRPT_EVENT | (x))
#define XEVNT_OK	XEVNT_CMD(0) /* success */
#define XEVNT_LEN	XEVNT_CMD(1) /* bad field format or length */
#define XEVNT_TSP	XEVNT_CMD(2) /* bad timestamp */
#define XEVNT_FSP	XEVNT_CMD(3) /* bad filestamp */
#define XEVNT_PUB	XEVNT_CMD(4) /* bad or missing public key */
#define XEVNT_MD	XEVNT_CMD(5) /* unsupported digest type */
#define XEVNT_KEY	XEVNT_CMD(6) /* unsupported identity type */
#define XEVNT_SGL	XEVNT_CMD(7) /* bad signature length */
#define XEVNT_SIG	XEVNT_CMD(8) /* signature not verified */
#define XEVNT_VFY	XEVNT_CMD(9) /* certificate not verified */
#define XEVNT_PER	XEVNT_CMD(10) /* host certificate expired */
#define XEVNT_CKY	XEVNT_CMD(11) /* bad or missing cookie */
#define XEVNT_DAT	XEVNT_CMD(12) /* bad or missing leapseconds */
#define XEVNT_CRT	XEVNT_CMD(13) /* bad or missing certificate */
#define XEVNT_ID	XEVNT_CMD(14) /* bad or missing group key */
#define	XEVNT_ERR	XEVNT_CMD(15) /* protocol error */

/*
 * Miscellaneous crypto stuff
 */
#define NTP_MAXSESSION	100	/* maximum session key list entries */
#define	NTP_MAXEXTEN	2048	/* maximum extension field size */
#define	NTP_AUTOMAX	12	/* default key list timeout (log2 s) */
#define	KEY_REVOKE	17	/* default key revoke timeout (log2 s) */
#define	NTP_REFRESH	19	/* default restart timeout (log2 s) */
#define	NTP_MAXKEY	65535	/* maximum symmetric key ID */

/*
 * The autokey structure holds the values used to authenticate key IDs.
 */
struct autokey {		/* network byte order */
	keyid_t	key;		/* key ID */
	int32	seq;		/* key number */
};

/*
 * The value structure holds variable length data such as public
 * key, agreement parameters, public valule and leapsecond table.
 * They are in network byte order.
 */
struct value {			/* network byte order */
	tstamp_t tstamp;	/* timestamp */
	tstamp_t fstamp;	/* filestamp */
	u_int32	vallen;		/* value length */
	u_char	*ptr;		/* data pointer (various) */
	u_int32	siglen;		/* signature length */
	u_char	*sig;		/* signature */
};

/*
 * The packet extension field structures are used to hold values
 * and signatures in network byte order.
 */
struct exten {
	u_int32	opcode;		/* opcode */
	u_int32	associd;	/* association ID */
	u_int32	tstamp;		/* timestamp */
	u_int32	fstamp;		/* filestamp */
	u_int32	vallen;		/* value length */
	u_int32	pkt[1];		/* start of value field */
};

/*
 * The certificate info/value structure
 */
struct cert_info {
	struct cert_info *link;	/* forward link */
	u_int	flags;		/* flags that wave */
	EVP_PKEY *pkey;		/* generic key */
	long	version;	/* X509 version */
	int	nid;		/* signature/digest ID */
	const EVP_MD *digest;	/* message digest algorithm */
	u_long	serial;		/* serial number */
	tstamp_t first;		/* not valid before */
	tstamp_t last;		/* not valid after */
	char	*subject;	/* subject common name */
	char	*issuer;	/* issuer common name */
	BIGNUM	*grpkey;	/* GQ group key */
	struct value cert;	/* certificate/value */
};

/*
 * The keys info/value structure
 */
struct pkey_info {
	struct pkey_info *link; /* forward link */
	EVP_PKEY *pkey;		/* generic key */
	char	*name;		/* file name */
	tstamp_t fstamp;	/* filestamp */
};

/*
 * Cryptographic values
 */
extern	u_int	crypto_flags;	/* status word */
extern	int	crypto_nid;	/* digest nid */
extern	struct value hostval;	/* host name/value */
extern	struct cert_info *cinfo; /* host certificate information */
extern	struct value tai_leap;	/* leapseconds table */
#endif /* OPENSSL */
#endif /* NTP_CRYPTO_H */
ntp-4.2.6p5/include/ntp_malloc.h0000644000175000017500000000227311567107101015540 0ustar  peterpeter/*
 * Define malloc and friends.
 */
#ifndef NTP_MALLOC_H
#define NTP_MALLOC_H

#ifdef HAVE_STDLIB_H
# include 
#else
# ifdef HAVE_MALLOC_H
#  include 
# endif
#endif

/*
 * Deal with platform differences declaring alloca()
 * This comes nearly verbatim from:
 *
 * http://www.gnu.org/software/autoconf/manual/autoconf.html#Particular-Functions
 *
 * The only modifications were to remove C++ support and guard against
 * redefining alloca.
 */
#ifdef HAVE_ALLOCA_H
# include 
#elif defined __GNUC__
# ifndef alloca
#  define alloca __builtin_alloca
# endif
#elif defined _AIX
# ifndef alloca
#  define alloca __alloca
# endif
#elif defined _MSC_VER
# include 
# ifndef alloca
#  define alloca _alloca
# endif
#else
# include 
void * alloca(size_t);
#endif

#ifdef EREALLOC_IMPL
# define EREALLOC_CALLSITE	/* preserve __FILE__ and __LINE__ */
#else
# define EREALLOC_IMPL(ptr, newsz, filenm, loc) \
	 realloc(ptr, (newsz))
#endif

#ifdef HAVE_STRINGS_H
# include 
# define zero_mem(p, s)		bzero(p, s)
#endif

#ifndef zero_mem
# define zero_mem(p, s)		memset(p, 0, s)
#endif
#define ZERO(var)		zero_mem(&(var), sizeof(var))

#endif	/* NTP_MALLOC_H */
ntp-4.2.6p5/include/ssl_applink.c0000644000175000017500000000302511307651603015721 0ustar  peterpeter/*
 * include/ssl_applink.c -- common NTP code for openssl/applink.c
 *
 * Each program which uses OpenSSL should include this file in _one_
 * of its source files and call ssl_applink() before any OpenSSL
 * functions.
 */

#if defined(OPENSSL) && defined(SYS_WINNT)
# ifdef _MSC_VER
#  pragma warning(push)
#  pragma warning(disable: 4152)
# endif
# include 
# ifdef _MSC_VER
#  pragma warning(pop)
# endif
#endif

#if defined(OPENSSL) && defined(_MSC_VER) && defined(_DEBUG)
#define WRAP_DBG_MALLOC
#endif

#ifdef WRAP_DBG_MALLOC
void *wrap_dbg_malloc(size_t s, const char *f, int l);
void *wrap_dbg_realloc(void *p, size_t s, const char *f, int l);
void wrap_dbg_free(void *p);
#endif


#if defined(OPENSSL) && defined(SYS_WINNT)
void ssl_applink(void);

void
ssl_applink(void)
{
#ifdef WRAP_DBG_MALLOC
	CRYPTO_set_mem_ex_functions(wrap_dbg_malloc, wrap_dbg_realloc, wrap_dbg_free);
#else
	CRYPTO_malloc_init();
#endif
}
#else	/* !OPENSSL || !SYS_WINNT */
#define ssl_applink()	do {} while (0)
#endif


#ifdef WRAP_DBG_MALLOC
/*
 * OpenSSL malloc overriding uses different parameters
 * for DEBUG malloc/realloc/free (lacking block type).
 * Simple wrappers convert.
 */
void *wrap_dbg_malloc(size_t s, const char *f, int l)
{
	void *ret;

	ret = _malloc_dbg(s, _NORMAL_BLOCK, f, l);
	return ret;
}

void *wrap_dbg_realloc(void *p, size_t s, const char *f, int l)
{
	void *ret;

	ret = _realloc_dbg(p, s, _NORMAL_BLOCK, f, l);
	return ret;
}

void wrap_dbg_free(void *p)
{
	_free_dbg(p, _NORMAL_BLOCK);
}
#endif	/* WRAP_DBG_MALLOC */
ntp-4.2.6p5/include/ntp_types.h0000644000175000017500000000622211665566225015452 0ustar  peterpeter/*
 *  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
 */
#ifndef NTP_TYPES_H
#define NTP_TYPES_H

#include 
#include "ntp_machine.h"

#ifndef TRUE
# define	TRUE	1
#endif
#ifndef FALSE
# define	FALSE	0
#endif

/*
 * This is another naming conflict.
 * On NetBSD for MAC the macro "mac" is defined as 1
 * this is fun for us as a packet structure contains an
 * optional "mac" member - severe confusion results 8-)
 * As we hopefully do not have to rely on that macro we
 * just undefine that.
 */
#ifdef mac
#undef mac
#endif

/*
 * used to quiet compiler warnings
 */
#ifndef UNUSED_ARG
#define UNUSED_ARG(arg)	((void)(arg))
#endif

/*
 * COUNTOF(array) - size of array in elements
 */
#define COUNTOF(arr)	(sizeof(arr) / sizeof((arr)[0]))

/*
 * 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 
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
#  ifndef INT32_MIN
#   define INT32_MIN INT_MIN
#  endif
#  ifndef INT32_MAX
#   define INT32_MAX INT_MAX
#  endif
# endif
# ifndef u_int32
#  define u_int32 unsigned int
#  ifndef U_INT32_MAX
#   define U_INT32_MAX UINT_MAX
#  endif
# endif
#else /* not sizeof(int) == 4 */
# if (SIZEOF_LONG == 4)
#  ifndef int32
#   define int32 long
#   ifndef INT32_MIN
#    define INT32_MIN LONG_MIN
#   endif
#   ifndef INT32_MAX
#    define INT32_MAX LONG_MAX
#   endif
#  endif
#  ifndef u_int32
#   define u_int32 unsigned long
#   ifndef U_INT32_MAX
#    define U_INT32_MAX ULONG_MAX
#   endif
#  endif
# else /* not sizeof(long) == 4 */
#  include "Bletch: what's 32 bits on this machine?"
# endif /* not sizeof(long) == 4 */
#endif /* not sizeof(int) == 4 */

typedef u_char		ntp_u_int8_t;
typedef u_short		ntp_u_int16_t;
typedef u_int32		ntp_u_int32_t;

typedef struct ntp_uint64_t { u_int32 val[2]; } ntp_uint64_t;

typedef unsigned short associd_t; /* association ID */
typedef u_int32 keyid_t;	/* cryptographic key ID */
typedef u_int32 tstamp_t;	/* NTP seconds timestamp */

/*
 * On Unix struct sock_timeval is equivalent to struct timeval.
 * On Windows built with 64-bit time_t, sock_timeval.tv_sec is a long
 * as required by Windows' socket() interface timeout argument, while
 * timeval.tv_sec is time_t for the more common use as a UTC time 
 * within NTP.
 */
#ifndef SYS_WINNT
#define	sock_timeval	timeval
#endif

/*
 * On Unix open() works for tty (serial) devices just fine, while on
 * Windows refclock serial devices are opened using CreateFile, a lower
 * level than the CRT-provided descriptors, because the C runtime lacks
 * tty APIs.  For refclocks which wish to use open() as well as or 
 * instead of refclock_open(), tty_open() is equivalent to open() on
 * Unix and  implemented in the Windows port similarly to
 * refclock_open().
 */
#ifndef SYS_WINNT
#define tty_open(f, a, m)	open(f, a, m)
#endif


#endif	/* NTP_TYPES_H */
ntp-4.2.6p5/include/ntp_filegen.h0000644000175000017500000000333311307651604015704 0ustar  peterpeter/*
 * ntp_filegen.h,v 3.9 1996/12/01 16:02:45 kardel Exp
 *
 * definitions for NTP file generations support
 *
 *
 * Copyright (C) 1992, 1996 by Rainer Pruy
 * Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
 *
 * This code may be modified and used freely
 * provided the credits remain intact.
 */

#include "ntp_types.h"

/*
 * supported file generation types
 */

#define FILEGEN_NONE	255	/* no generations - use plain file name */
#define FILEGEN_PID	1	/* one filegen per process incarnation */
#define FILEGEN_DAY	2	/* one filegen per day */
#define FILEGEN_WEEK	3	/* one filegen per week */
#define FILEGEN_MONTH	4	/* one filegen per month */
#define FILEGEN_YEAR	5	/* one filegen per year */
#define FILEGEN_AGE     6	/* change filegen each FG_AGE_SECS */

/*
 * supported file generation flags
 */

#define FGEN_FLAG_LINK		0x01 /* make a link to base name */

#define FGEN_FLAG_ENABLED	0x80 /* set this to really create files   */
				     /* without this, open is suppressed */

typedef struct FILEGEN
{
	FILE *	     fp;	/* file referring to current generation */
	const char * prefix;	/* filename prefix and basename to be used*/
	char *	     basename;	/* for constructing filename of generation file */
				/* WARNING: must be malloced !!! will be fed to free()*/
	u_long	     id;	/* id of current generation */
	u_char	     type;	/* type of file generation */
	u_char	     flag;	/* flags modifying processing of file generation */
}	FILEGEN;

extern	void	filegen_setup	(FILEGEN *, u_long);
extern	void	filegen_config	(FILEGEN *, const char *, u_int, u_int);
extern	FILEGEN *filegen_get	(const char *);
extern	void	filegen_register (const char *, const char *, FILEGEN *);
#ifdef DEBUG
extern	void	filegen_unregister(char *);
#endif
ntp-4.2.6p5/include/Makefile.in0000644000175000017500000004570411675460275015330 0ustar  peterpeter# 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 = include
DIST_COMMON = README $(noinst_HEADERS) $(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)/m4/define_dir.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_cacheversion.m4 \
	$(top_srcdir)/m4/ntp_dir_sep.m4 \
	$(top_srcdir)/m4/ntp_lineeditlibs.m4 \
	$(top_srcdir)/m4/ntp_openssl.m4 \
	$(top_srcdir)/m4/ntp_vpathhack.m4 \
	$(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
	html-recursive info-recursive install-data-recursive \
	install-dvi-recursive install-exec-recursive \
	install-html-recursive install-info-recursive \
	install-pdf-recursive install-ps-recursive install-recursive \
	installcheck-recursive installdirs-recursive pdf-recursive \
	ps-recursive uninstall-recursive
HEADERS = $(noinst_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
  distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
	distdir
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
  dir0=`pwd`; \
  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
  sed_rest='s,^[^/]*/*,,'; \
  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
  sed_butlast='s,/*[^/]*$$,,'; \
  while test -n "$$dir1"; do \
    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
    if test "$$first" != "."; then \
      if test "$$first" = ".."; then \
        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
      else \
        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
        if test "$$first2" = "$$first"; then \
          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
        else \
          dir2="../$$dir2"; \
        fi; \
        dir0="$$dir0"/"$$first"; \
      fi; \
    fi; \
    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
  done; \
  reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINSUBDIR = @BINSUBDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
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@
EF_LIBS = @EF_LIBS@
EF_PROGS = @EF_PROGS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_INLINE = @HAVE_INLINE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LCRYPTO = @LCRYPTO@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
LIBOPTS_DIR = @LIBOPTS_DIR@
LIBOPTS_LDADD = @LIBOPTS_LDADD@
LIBPARSE = @LIBPARSE@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
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@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENSSL = @OPENSSL@
OPENSSL_INC = @OPENSSL_INC@
OPENSSL_LIB = @OPENSSL_LIB@
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_SH = @PATH_SH@
PATH_TEST = @PATH_TEST@
POSIX_SHELL = @POSIX_SHELL@
PROPDELAY = @PROPDELAY@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SNMP_CFLAGS = @SNMP_CFLAGS@
SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
SNMP_LIBS = @SNMP_LIBS@
STRIP = @STRIP@
TESTDCF = @TESTDCF@
VERSION = @VERSION@
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_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 = 
AUTOMAKE_OPTIONS = 
ETAGS_ARGS = $(srcdir)/Makefile.am
EXTRA_DIST = autogen-version.def copyright.def debug-opt.def homerc.def version.def version.texi
SUBDIRS = isc
noinst_HEADERS = \
	adjtime.h	\
	audio.h		\
	ascii.h		\
	audio.h		\
	binio.h		\
	gps.h		\
	hopf6039.h	\
	icom.h		\
	ieee754io.h	\
	iosignal.h	\
	l_stdlib.h	\
	lib_strbuf.h	\
	mbg_gps166.h	\
	mx4200.h	\
	ntif.h		\
	ntp.h		\
	ntp_assert.h	\
	ntp_calendar.h	\
	ntp_cmdargs.h	\
	ntp_config.h	\
	ntp_control.h	\
	ntp_crypto.h	\
	ntp_data_structures.h	\
	ntp_datum.h	\
	ntp_debug.h	\
	ntp_filegen.h	\
	ntp_fp.h	\
	ntp_if.h	\
	ntp_intres.h	\
	ntp_io.h	\
	ntp_libopts.h	\
	ntp_lineedit.h	\
	ntp_lists.h	\
	ntp_machine.h	\
	ntp_malloc.h	\
	ntp_md5.h	\
	ntp_net.h	\
	ntp_proto.h	\
	ntp_random.h	\
	ntp_refclock.h	\
	ntp_request.h	\
	ntp_rfc2553.h	\
	ntp_select.h	\
	ntp_sprintf.h	\
	ntp_stdlib.h	\
	ntp_string.h	\
	ntp_syscall.h	\
	ntp_syslog.h	\
	ntp_tty.h	\
	ntp_types.h	\
	ntp_unixtime.h	\
	ntpd.h		\
	ntpsim.h	\
	parse.h		\
	parse_conf.h	\
	recvbuff.h	\
	refclock_atom.h	\
	ssl_applink.c	\
	timepps-SCO.h	\
	timepps-Solaris.h	\
	timepps-SunOS.h	\
	trimble.h	\
	$(NULL)

all: all-recursive

.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 include/Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --foreign include/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):

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs

# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
#     (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
	@fail= failcom='exit 1'; \
	for f in x $$MAKEFLAGS; do \
	  case $$f in \
	    *=* | --[!k]*);; \
	    *k*) failcom='fail=yes';; \
	  esac; \
	done; \
	dot_seen=no; \
	target=`echo $@ | sed s/-recursive//`; \
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  echo "Making $$target in $$subdir"; \
	  if test "$$subdir" = "."; then \
	    dot_seen=yes; \
	    local_target="$$target-am"; \
	  else \
	    local_target="$$target"; \
	  fi; \
	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
	  || eval $$failcom; \
	done; \
	if test "$$dot_seen" = "no"; then \
	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
	fi; test -z "$$fail"

$(RECURSIVE_CLEAN_TARGETS):
	@fail= failcom='exit 1'; \
	for f in x $$MAKEFLAGS; do \
	  case $$f in \
	    *=* | --[!k]*);; \
	    *k*) failcom='fail=yes';; \
	  esac; \
	done; \
	dot_seen=no; \
	case "$@" in \
	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
	  *) list='$(SUBDIRS)' ;; \
	esac; \
	rev=''; for subdir in $$list; do \
	  if test "$$subdir" = "."; then :; else \
	    rev="$$subdir $$rev"; \
	  fi; \
	done; \
	rev="$$rev ."; \
	target=`echo $@ | sed s/-recursive//`; \
	for subdir in $$rev; do \
	  echo "Making $$target in $$subdir"; \
	  if test "$$subdir" = "."; then \
	    local_target="$$target-am"; \
	  else \
	    local_target="$$target"; \
	  fi; \
	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
	  || eval $$failcom; \
	done && test -z "$$fail"
tags-recursive:
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
	done
ctags-recursive:
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
	done

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	set x; \
	here=`pwd`; \
	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
	  include_option=--etags-include; \
	  empty_fix=.; \
	else \
	  include_option=--include; \
	  empty_fix=; \
	fi; \
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    test ! -f $$subdir/TAGS || \
	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
	  fi; \
	done; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	shift; \
	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  if test $$# -gt 0; then \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      "$$@" $$unique; \
	  else \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      $$unique; \
	  fi; \
	fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && $(am__cd) $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) "$$here"

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@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
	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    test -d "$(distdir)/$$subdir" \
	    || $(MKDIR_P) "$(distdir)/$$subdir" \
	    || exit 1; \
	  fi; \
	done
	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
	    $(am__relativize); \
	    new_distdir=$$reldir; \
	    dir1=$$subdir; dir2="$(top_distdir)"; \
	    $(am__relativize); \
	    new_top_distdir=$$reldir; \
	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
	    ($(am__cd) $$subdir && \
	      $(MAKE) $(AM_MAKEFLAGS) \
	        top_distdir="$$new_top_distdir" \
	        distdir="$$new_distdir" \
		am__remove_distdir=: \
		am__skip_length_check=: \
		am__skip_mode_fix=: \
	        distdir) \
	      || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-recursive
all-am: Makefile $(HEADERS)
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-recursive
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)

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-recursive

clean-am: clean-generic clean-libtool mostlyclean-am

distclean: distclean-recursive
	-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags

dvi: dvi-recursive

dvi-am:

html: html-recursive

html-am:

info: info-recursive

info-am:

install-data-am:

install-dvi: install-dvi-recursive

install-dvi-am:

install-exec-am:

install-html: install-html-recursive

install-html-am:

install-info: install-info-recursive

install-info-am:

install-man:

install-pdf: install-pdf-recursive

install-pdf-am:

install-ps: install-ps-recursive

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-recursive
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-recursive

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-recursive

pdf-am:

ps: ps-recursive

ps-am:

uninstall-am:

.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
	install-am install-strip tags-recursive

.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
	all all-am check check-am clean clean-generic clean-libtool \
	ctags ctags-recursive distclean distclean-generic \
	distclean-libtool distclean-tags distdir dvi dvi-am html \
	html-am info info-am install install-am install-data \
	install-data-am install-dvi install-dvi-am install-exec \
	install-exec-am install-html install-html-am install-info \
	install-info-am install-man install-pdf install-pdf-am \
	install-ps install-ps-am install-strip installcheck \
	installcheck-am installdirs installdirs-am maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-generic \
	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
	uninstall uninstall-am


# 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:
ntp-4.2.6p5/include/parse_conf.h0000644000175000017500000000537310441361224015531 0ustar  peterpeter/*
 * /src/NTP/ntp4-dev/include/parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A
 *
 * parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A
 *
 * Copyright (c) 1995-2005 by Frank Kardel  ntp.org>
 * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
 *
 * 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.
 * 3. Neither the name of the author nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * 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.
 *
 */

#ifndef __PARSE_CONF_H__
#define __PARSE_CONF_H__
#if	!(defined(lint) || defined(__GNUC__))
  static char prshrcsid[] = "parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A";
#endif

/*
 * field location structure
 */
#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_FLAGS 7
#define O_ZONE  8
#define O_UTCHOFFSET 9
#define O_UTCMOFFSET 10
#define O_UTCSOFFSET 11
#define O_COUNT (O_UTCSOFFSET+1)

#define MBG_EXTENDED	0x00000001

/*
 * see below for field offsets
 */

struct format
{
  struct foff
    {
      unsigned short offset;		/* offset into buffer */
      unsigned short length;		/* length of field */
    }         field_offsets[O_COUNT];
  const unsigned char *fixed_string;		/* string with must be chars (blanks = wildcards) */
  u_long      flags;
};
#endif

/*
 * History:
 *
 * parse_conf.h,v
 * Revision 4.7  2005/06/25 10:58:45  kardel
 * add missing log keywords
 *
 */
ntp-4.2.6p5/include/version.def0000644000175000017500000000002511675460442015407 0ustar  peterpeterversion = '4.2.6p5';
ntp-4.2.6p5/include/ntp_intres.h0000644000175000017500000000057711315077754015615 0ustar  peterpeter#ifndef NTP_INTRES_H
#define NTP_INTRES_H

/*
 * Some systems do not support fork() and don't have an alternate
 * threads implementation of ntp_intres.  Such systems are limited
 * to using numeric IP addresses.
 */
#if defined(VMS) || defined (SYS_VXWORKS) || \
    (!defined(HAVE_WORKING_FORK) && !defined(SYS_WINNT))
#define NO_INTRES
#endif

#endif	/* !defined(NTP_INTRES_H) */
ntp-4.2.6p5/include/ntif.h0000644000175000017500000000556010017034543014350 0ustar  peterpeter/* this is a hacked version of if.h from unix to contain the stuff we need only to build named (bind) with
   the minimal amount of changes... by l. kahn */

   /*
 * Copyright (c) 1982, 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 */

#ifndef	_NET_IF_H
#define	_NET_IF_H


/* #pragma ident	"@(#)if.h	1.3	93/06/30 SMI"
/* if.h 1.26 90/05/29 SMI; from UCB 7.1 6/4/86		*/

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * Structures defining a network interface, providing a packet
 * transport mechanism (ala level 0 of the PUP protocols).
 *
 * Each interface accepts output datagrams of a specified maximum
 * length, and provides higher level routines with input datagrams
 * received from its medium.
 *
 * Output occurs when the routine if_output is called, with three parameters:
 *	(*ifp->if_output)(ifp, m, dst)
 * Here m is the mbuf chain to be sent and dst is the destination address.
 * The output routine encapsulates the supplied datagram if necessary,
 * and then transmits it on its medium.
 *
 * On input, each interface unwraps the data received by it, and either
 * places it on the input queue of a internetwork datagram routine
 * and posts the associated software interrupt, or passes the datagram to a raw
 * packet input routine.
 *
 * Routines exist for locating interfaces by their addresses
 * or for locating a interface on a certain network, as well as more general
 * routing and gateway routines maintaining information used to locate
 * interfaces.  These routines live in the files if.c and route.c
 */

/*
 * Structure defining a queue for a network interface.
 *
 * (Would like to call this struct ``if'', but C isn't PL/1.)
 */
/*
 * Interface request structure used for socket
 * ioctl's.  All interface ioctl's must have parameter
 * definitions which begin with ifr_name.  The
 * remainder may be interface specific.
 */
#ifdef FD_SETSIZE
#undef FD_SETSIZE
#endif
#define FD_SETSIZE 512
#include 
typedef char *caddr_t;

int get_winnt_interfaces();

struct	ifreq {
#define	IFNAMSIZ	16
	char	ifr_name[IFNAMSIZ];		/* if name, e.g. "en0" */
	struct	sockaddr ifru_addr;
    char    nt_mask[IFNAMSIZ];      /* new field to store mask returned from nt lookup l. kahn */

#define	ifr_addr	ifru_addr	/* address */
#define	ifr_mask	nt_mask	    /* nt mask in character form */

};

/*
 * Structure used in SIOCGIFCONF request.
 * Used to retrieve interface configuration
 * for machine (useful for programs which
 * must know all networks accessible).
 */
struct	ifconf {
	int	ifc_len;		/* size of associated buffer */
	union {
		caddr_t	ifcu_buf;
		struct	ifreq *ifcu_req;
	} ifc_ifcu;
#define	ifc_buf	ifc_ifcu.ifcu_buf	/* buffer address */
#define	ifc_req	ifc_ifcu.ifcu_req	/* array of structures returned */
};

#ifdef	__cplusplus
}
#endif

#endif	/* _NET_IF_H */

ntp-4.2.6p5/include/ntp_data_structures.h0000644000175000017500000000234711307651603017512 0ustar  peterpeter/* ntp_data_structures.h
 *
 * This file contains the structures and function prototypes for the data 
 * structures used by the ntp configuration code and the discrete event 
 * simulator.
 *
 * Written By: Sachin Kamboj
 *             University of Delaware
 *             Newark, DE 19711
 * Copyright (c) 2006
 */

#ifndef __NTP_DATA_STRUCTURES_H__
#define __NTP_DATA_STRUCTURES_H__


/* Structures for storing a priority queue 
 * ---------------------------------------
 */

typedef struct node {
	union {
		struct node *next;
		double d;
	} nodeu;
} node;
#define node_next nodeu.next
    
typedef struct Queue {
    int (*get_order)(void *, void *);
    node *front;
    int no_of_elements;
} queue;


/* FUNCTION PROTOTYPES
 * -------------------
 */
queue *create_priority_queue(int (*get_order)(void *, void *));
void destroy_queue(queue *my_queue);
void *get_node(size_t size);
void free_node(void *my_node);
void *next_node(void *my_node);
int empty(queue *my_queue);
void *queue_head(queue *my_queue);
queue *enqueue(queue *my_queue, void *my_node);
void *dequeue(queue *my_queue);
int get_no_of_elements(queue *my_queue);
void append_queue(queue *q1, queue *q2);
int get_fifo_order(void *el1, void *el2);
queue *create_queue(void);

#endif
ntp-4.2.6p5/include/ntp_md5.h0000644000175000017500000000135411372205556014764 0ustar  peterpeter/*
 * ntp_md5.h: deal with md5.h headers
 *
 * Use the system MD5 if available, otherwise libisc's.
 */
#if defined HAVE_MD5_H && defined HAVE_MD5INIT
# include 
#else
# include "isc/md5.h"
  typedef isc_md5_t		MD5_CTX;
# define MD5Init(c)		isc_md5_init(c)
# define MD5Update(c, p, s)	isc_md5_update(c, p, s)
# define MD5Final(d, c)		isc_md5_final((c), (d))	/* swapped */
#endif

/*
 * Provide OpenSSL-alike MD5 API if we're not using OpenSSL
 */
#ifndef OPENSSL
  typedef MD5_CTX			EVP_MD_CTX;
# define EVP_get_digestbynid(t)		NULL
# define EVP_DigestInit(c, dt)		MD5Init(c)
# define EVP_DigestUpdate(c, p, s)	MD5Update(c, p, s)
# define EVP_DigestFinal(c, d, pdl)	\
	do {				\
		MD5Final((d), (c));	\
		*(pdl) = 16;		\
	} while (0)
#endif
ntp-4.2.6p5/include/ntp_syscall.h0000644000175000017500000000245411307651605015751 0ustar  peterpeter/*
 * ntp_syscall.h - various ways to perform the ntp_adjtime() and ntp_gettime()
 * 		   system calls.
 */

#ifndef NTP_SYSCALL_H
#define NTP_SYSCALL_H

#ifdef HAVE_CONFIG_H
#include 
#endif

#ifdef HAVE_SYS_TIMEX_H
# include 
#endif

#ifndef NTP_SYSCALLS_LIBC
#ifdef NTP_SYSCALLS_STD
# define ntp_adjtime(t)		syscall(SYS_ntp_adjtime, (t))
# define ntp_gettime(t)		syscall(SYS_ntp_gettime, (t))
#else /* !NTP_SYSCALLS_STD */
# ifdef HAVE___ADJTIMEX
extern	int	__adjtimex	(struct timex *);

#  define ntp_adjtime(t)	__adjtimex((t))

#ifndef HAVE_STRUCT_NTPTIMEVAL
struct ntptimeval
{
  struct timeval time;  /* current time (ro) */
  long int maxerror;    /* maximum error (us) (ro) */
  long int esterror;    /* estimated error (us) (ro) */
};
#endif

static inline int
ntp_gettime(
	struct ntptimeval *ntv
	)
{
	struct timex tntx;
	int result;

	tntx.modes = 0;
	result = __adjtimex (&tntx);
	ntv->time = tntx.time;
	ntv->maxerror = tntx.maxerror;
	ntv->esterror = tntx.esterror;
#ifdef NTP_API
# if NTP_API > 3
	ntv->tai = tntx.tai;
# endif
#endif
	return(result);
}
# else /* !HAVE__ADJTIMEX */
#  ifdef HAVE___NTP_GETTIME
#   define ntp_gettime(t)	__ntp_gettime((t))
#  endif
# endif /* !HAVE_ADJTIMEX */
#endif /* !NTP_SYSCALLS_STD */
#endif /* !NTP_SYSCALLS_LIBC */

#endif /* NTP_SYSCALL_H */
ntp-4.2.6p5/include/ntp_request.h0000644000175000017500000007460011665566225016003 0ustar  peterpeter/*
 * ntp_request.h - definitions for the ntpd remote query facility
 */

#ifndef NTP_REQUEST_H
#define NTP_REQUEST_H

#include "stddef.h"
#include "ntp_types.h"
#include "recvbuff.h"

/*
 * A mode 7 packet is used exchanging data between an NTP server
 * and a client for purposes other than time synchronization, e.g.
 * monitoring, statistics gathering and configuration.  A mode 7
 * packet has the following format:
 *
 *    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
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |R|M| VN  | Mode|A|  Sequence   | Implementation|   Req Code    |
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |  Err  | Number of data items  |  MBZ  |   Size of data item   |
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |								     |
 *   |            Data (Minimum 0 octets, maximum 500 octets)        |
 *   |								     |
 *                            [...]
 *   |								     |
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |               Encryption Keyid (when A bit set)               |
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |								     |
 *   |          Message Authentication Code (when A bit set)         |
 *   |								     |
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *
 * where the fields are (note that the client sends requests, the server
 * responses):
 *
 * Response Bit:  This packet is a response (if clear, packet is a request).
 *
 * More Bit:	Set for all packets but the last in a response which
 *		requires more than one packet.
 *
 * Version Number: 2 for current version
 *
 * Mode:	Always 7
 *
 * Authenticated bit: If set, this packet is authenticated.
 *
 * Sequence number: For a multipacket response, contains the sequence
 *		number of this packet.  0 is the first in the sequence,
 *		127 (or less) is the last.  The More Bit must be set in
 *		all packets but the last.
 *
 * Implementation number: The number of the implementation this request code
 *		is defined by.  An implementation number of zero is used
 *		for requst codes/data formats which all implementations
 *		agree on.  Implementation number 255 is reserved (for
 *		extensions, in case we run out).
 *
 * Request code: An implementation-specific code which specifies the
 *		operation to be (which has been) performed and/or the
 *		format and semantics of the data included in the packet.
 *
 * Err:		Must be 0 for a request.  For a response, holds an error
 *		code relating to the request.  If nonzero, the operation
 *		requested wasn't performed.
 *
 *		0 - no error
 *		1 - incompatable implementation number
 *		2 - unimplemented request code
 *		3 - format error (wrong data items, data size, packet size etc.)
 *		4 - no data available (e.g. request for details on unknown peer)
 *		5-6 I don't know
 *		7 - authentication failure (i.e. permission denied)
 *
 * Number of data items: number of data items in packet.  0 to 500
 *
 * MBZ:		A reserved data field, must be zero in requests and responses.
 *
 * Size of data item: size of each data item in packet.  0 to 500
 *
 * Data:	Variable sized area containing request/response data.  For
 *		requests and responses the size in octets must be greater
 *		than or equal to the product of the number of data items
 *		and the size of a data item.  For requests the data area
 *		must be exactly 40 octets in length.  For responses the
 *		data area may be any length between 0 and 500 octets
 *		inclusive.
 *
 * Message Authentication Code: Same as NTP spec, in definition and function.
 *		May optionally be included in requests which require
 *		authentication, is never included in responses.
 *
 * The version number, mode and keyid have the same function and are
 * in the same location as a standard NTP packet.  The request packet
 * is the same size as a standard NTP packet to ease receive buffer
 * management, and to allow the same encryption procedure to be used
 * both on mode 7 and standard NTP packets.  The mac is included when
 * it is required that a request be authenticated, the keyid should be
 * zero in requests in which the mac is not included.
 *
 * The data format depends on the implementation number/request code pair
 * and whether the packet is a request or a response.  The only requirement
 * is that data items start in the octet immediately following the size
 * word and that data items be concatenated without padding between (i.e.
 * if the data area is larger than data_items*size, all padding is at
 * the end).  Padding is ignored, other than for encryption purposes.
 * Implementations using encryption might want to include a time stamp
 * or other data in the request packet padding.  The key used for requests
 * is implementation defined, but key 15 is suggested as a default.
 */

/*
 * union of raw addresses to save space
 */
union addrun
{
	struct in6_addr addr6;
	struct in_addr  addr;
};

/*
 * A request packet.  These are almost a fixed length.
 */
struct req_pkt {
	u_char rm_vn_mode;		/* response, more, version, mode */
	u_char auth_seq;		/* key, sequence number */
	u_char implementation;		/* implementation number */
	u_char request;			/* request number */
	u_short err_nitems;		/* error code/number of data items */
	u_short mbz_itemsize;		/* item size */
	char data[MAXFILENAME + 48];	/* data area [32 prev](176 byte max) */
					/* struct conf_peer must fit */
	l_fp tstamp;			/* time stamp, for authentication */
	keyid_t keyid;			/* (optional) encryption key */
	char mac[MAX_MAC_LEN-sizeof(keyid_t)]; /* (optional) auth code */
};

/*
 * The req_pkt_tail structure is used by ntpd to adjust for different
 * packet sizes that may arrive.
 */
struct req_pkt_tail {
	l_fp tstamp;			/* time stamp, for authentication */
	keyid_t keyid;			/* (optional) encryption key */
	char mac[MAX_MAC_LEN-sizeof(keyid_t)]; /* (optional) auth code */
};

/* MODE_PRIVATE request packet header length before optional items. */
#define	REQ_LEN_HDR	(offsetof(struct req_pkt, data))
/* MODE_PRIVATE request packet fixed length without MAC. */
#define	REQ_LEN_NOMAC	(offsetof(struct req_pkt, keyid))
/* MODE_PRIVATE req_pkt_tail minimum size (16 octet digest) */
#define REQ_TAIL_MIN	\
	(sizeof(struct req_pkt_tail) - (MAX_MAC_LEN - MAX_MD5_LEN))

/*
 * A MODE_PRIVATE response packet.  The length here is variable, this
 * is a maximally sized one.  Note that this implementation doesn't
 * authenticate responses.
 */
#define	RESP_HEADER_SIZE	(offsetof(struct resp_pkt, data))
#define	RESP_DATA_SIZE		(500)

struct resp_pkt {
	u_char rm_vn_mode;		/* response, more, version, mode */
	u_char auth_seq;		/* key, sequence number */
	u_char implementation;		/* implementation number */
	u_char request;			/* request number */
	u_short err_nitems;		/* error code/number of data items */
	u_short mbz_itemsize;		/* item size */
	char data[RESP_DATA_SIZE];	/* data area */
};


/*
 * Information error codes
 */
#define	INFO_OKAY	0
#define	INFO_ERR_IMPL	1	/* incompatable implementation */
#define	INFO_ERR_REQ	2	/* unknown request code */
#define	INFO_ERR_FMT	3	/* format error */
#define	INFO_ERR_NODATA	4	/* no data for this request */
#define	INFO_ERR_AUTH	7	/* authentication failure */

/*
 * Maximum sequence number.
 */
#define	MAXSEQ	127


/*
 * Bit setting macros for multifield items.
 */
#define	RESP_BIT	0x80
#define	MORE_BIT	0x40

#define	ISRESPONSE(rm_vn_mode)	(((rm_vn_mode)&RESP_BIT)!=0)
#define	ISMORE(rm_vn_mode)	(((rm_vn_mode)&MORE_BIT)!=0)
#define INFO_VERSION(rm_vn_mode) ((u_char)(((rm_vn_mode)>>3)&0x7))
#define	INFO_MODE(rm_vn_mode)	((rm_vn_mode)&0x7)

#define	RM_VN_MODE(resp, more, version)		\
				((u_char)(((resp)?RESP_BIT:0)\
				|((more)?MORE_BIT:0)\
				|((version?version:(NTP_OLDVERSION+1))<<3)\
				|(MODE_PRIVATE)))

#define	INFO_IS_AUTH(auth_seq)	(((auth_seq) & 0x80) != 0)
#define	INFO_SEQ(auth_seq)	((auth_seq)&0x7f)
#define	AUTH_SEQ(auth, seq)	((u_char)((((auth)!=0)?0x80:0)|((seq)&0x7f)))

#define	INFO_ERR(err_nitems)	((u_short)((ntohs(err_nitems)>>12)&0xf))
#define	INFO_NITEMS(err_nitems)	((u_short)(ntohs(err_nitems)&0xfff))
#define	ERR_NITEMS(err, nitems)	(htons((u_short)((((u_short)(err)<<12)&0xf000)\
				|((u_short)(nitems)&0xfff))))

#define	INFO_MBZ(mbz_itemsize)	((ntohs(mbz_itemsize)>>12)&0xf)
#define	INFO_ITEMSIZE(mbz_itemsize)	((u_short)(ntohs(mbz_itemsize)&0xfff))
#define	MBZ_ITEMSIZE(itemsize)	(htons((u_short)(itemsize)))


/*
 * Implementation numbers.  One for universal use and one for ntpd.
 */
#define	IMPL_UNIV	0
#define	IMPL_XNTPD_OLD	2	/* Used by pre ipv6 ntpdc */
#define	IMPL_XNTPD	3	/* Used by post ipv6 ntpdc */

/*
 * Some limits related to authentication.  Frames which are
 * authenticated must include a time stamp which differs from
 * the receive time stamp by no more than 10 seconds.
 */
#define	INFO_TS_MAXSKEW	10.

/*
 * Universal request codes go here.  There aren't any.
 */

/*
 * NTPD request codes go here.
 */
#define	REQ_PEER_LIST		0	/* return list of peers */
#define	REQ_PEER_LIST_SUM	1	/* return summary info for all peers */
#define	REQ_PEER_INFO		2	/* get standard information on peer */
#define	REQ_PEER_STATS		3	/* get statistics for peer */
#define	REQ_SYS_INFO		4	/* get system information */
#define	REQ_SYS_STATS		5	/* get system stats */
#define	REQ_IO_STATS		6	/* get I/O stats */
#define REQ_MEM_STATS		7	/* stats related to peer list maint */
#define	REQ_LOOP_INFO		8	/* info from the loop filter */
#define	REQ_TIMER_STATS		9	/* get timer stats */
#define	REQ_CONFIG		10	/* configure a new peer */
#define	REQ_UNCONFIG		11	/* unconfigure an existing peer */
#define	REQ_SET_SYS_FLAG	12	/* set system flags */
#define	REQ_CLR_SYS_FLAG	13	/* clear system flags */
#define	REQ_MONITOR		14	/* (not used) */
#define	REQ_NOMONITOR		15	/* (not used) */
#define	REQ_GET_RESTRICT	16	/* return restrict list */
#define	REQ_RESADDFLAGS		17	/* add flags to restrict list */
#define	REQ_RESSUBFLAGS		18	/* remove flags from restrict list */
#define	REQ_UNRESTRICT		19	/* remove entry from restrict list */
#define	REQ_MON_GETLIST		20	/* return data collected by monitor */
#define	REQ_RESET_STATS		21	/* reset stat counters */
#define	REQ_RESET_PEER		22	/* reset peer stat counters */
#define	REQ_REREAD_KEYS		23	/* reread the encryption key file */
#define	REQ_DO_DIRTY_HACK	24	/* (not used) */
#define	REQ_DONT_DIRTY_HACK	25	/* (not used) */
#define	REQ_TRUSTKEY		26	/* add a trusted key */
#define	REQ_UNTRUSTKEY		27	/* remove a trusted key */
#define	REQ_AUTHINFO		28	/* return authentication info */
#define REQ_TRAPS		29	/* return currently set traps */
#define	REQ_ADD_TRAP		30	/* add a trap */
#define	REQ_CLR_TRAP		31	/* clear a trap */
#define	REQ_REQUEST_KEY		32	/* define a new request keyid */
#define	REQ_CONTROL_KEY		33	/* define a new control keyid */
#define	REQ_GET_CTLSTATS	34	/* get stats from the control module */
#define	REQ_GET_LEAPINFO	35	/* (not used) */
#define	REQ_GET_CLOCKINFO	36	/* get clock information */
#define	REQ_SET_CLKFUDGE	37	/* set clock fudge factors */
#define REQ_GET_KERNEL		38	/* get kernel pll/pps information */
#define	REQ_GET_CLKBUGINFO	39	/* get clock debugging info */
#define	REQ_SET_PRECISION	41	/* (not used) */
#define	REQ_MON_GETLIST_1	42	/* return collected v1 monitor data */
#define	REQ_HOSTNAME_ASSOCID	43	/* Here is a hostname + assoc_id */
#define REQ_IF_STATS		44	/* get interface statistics */
#define REQ_IF_RELOAD		45	/* reload interface list */

/* Determine size of pre-v6 version of structures */
#define v4sizeof(type)		offsetof(type, v6_flag)

/*
 * Flags in the peer information returns
 */
#define	INFO_FLAG_CONFIG	0x1
#define	INFO_FLAG_SYSPEER	0x2
#define INFO_FLAG_BURST		0x4
#define	INFO_FLAG_REFCLOCK	0x8
#define	INFO_FLAG_PREFER	0x10
#define	INFO_FLAG_AUTHENABLE	0x20
#define	INFO_FLAG_SEL_CANDIDATE	0x40
#define	INFO_FLAG_SHORTLIST	0x80
#define	INFO_FLAG_IBURST	0x100

/*
 * Flags in the system information returns
 */
#define INFO_FLAG_BCLIENT	0x1
#define INFO_FLAG_AUTHENTICATE	0x2
#define INFO_FLAG_NTP		0x4
#define INFO_FLAG_KERNEL	0x8
#define INFO_FLAG_MONITOR	0x40
#define INFO_FLAG_FILEGEN	0x80
#define INFO_FLAG_CAL		0x10
#define INFO_FLAG_PPS_SYNC	0x20

/*
 * Peer list structure.  Used to return raw lists of peers.  It goes
 * without saying that everything returned is in network byte order.
 * Well, it *would* have gone without saying, but somebody said it.
 */
struct info_peer_list {
	u_int32 addr;		/* address of peer */
	u_short port;		/* port number of peer */
	u_char hmode;		/* mode for this peer */
	u_char flags;		/* flags (from above) */
	u_int v6_flag;		/* is this v6 or not */
	u_int unused1;		/* (unused) padding for addr6 */
	struct in6_addr addr6;	/* v6 address of peer */
};


/*
 * Peer summary structure.  Sort of the info that ntpdc returns by default.
 */
struct info_peer_summary {
	u_int32 dstadr;		/* local address (zero for undetermined) */
	u_int32 srcadr;		/* source address */
	u_short srcport;	/* source port */
	u_char stratum;		/* stratum of peer */
	s_char hpoll;		/* host polling interval */
	s_char ppoll;		/* peer polling interval */
	u_char reach;		/* reachability register */
	u_char flags;		/* flags, from above */
	u_char hmode;		/* peer mode */
	s_fp delay;		/* peer.estdelay */
	l_fp offset;		/* peer.estoffset */
	u_fp dispersion;	/* peer.estdisp */
	u_int v6_flag;			/* is this v6 or not */
	u_int unused1;			/* (unused) padding for dstadr6 */
	struct in6_addr dstadr6;	/* local address (v6) */
	struct in6_addr srcadr6;	/* source address (v6) */
};


/*
 * Peer information structure.
 */
struct info_peer {
	u_int32 dstadr;		/* local address */
	u_int32	srcadr;		/* source address */
	u_short srcport;	/* remote port */
	u_char flags;		/* peer flags */
	u_char leap;		/* peer.leap */
	u_char hmode;		/* peer.hmode */
	u_char pmode;		/* peer.pmode */
	u_char stratum;		/* peer.stratum */
	u_char ppoll;		/* peer.ppoll */
	u_char hpoll;		/* peer.hpoll */
	s_char precision;	/* peer.precision */
	u_char version;		/* peer.version */
	u_char unused8;
	u_char reach;		/* peer.reach */
	u_char unreach;		/* peer.unreach */
	u_char flash;		/* old peer.flash */
	u_char ttl;		/* peer.ttl */
	u_short flash2;		/* new peer.flash */
	associd_t associd;	/* association ID */
	keyid_t keyid;		/* peer.keyid */
	u_int32 pkeyid;		/* unused */
	u_int32 refid;		/* peer.refid */
	u_int32 timer;		/* peer.timer */
	s_fp rootdelay;		/* peer.delay */
	u_fp rootdispersion;	/* peer.dispersion */
	l_fp reftime;		/* peer.reftime */
	l_fp org;		/* peer.org */
	l_fp rec;		/* peer.rec */
	l_fp xmt;		/* peer.xmt */
	s_fp filtdelay[NTP_SHIFT];	/* delay shift register */
	l_fp filtoffset[NTP_SHIFT];	/* offset shift register */
	u_char order[NTP_SHIFT];	/* order of peers from last filter */
	s_fp delay;		/* peer.estdelay */
	u_fp dispersion;	/* peer.estdisp */
	l_fp offset;		/* peer.estoffset */
	u_fp selectdisp;	/* peer select dispersion */
	int32 unused1;		/* (obsolete) */
	int32 unused2;
	int32 unused3;
	int32 unused4;
	int32 unused5;
	int32 unused6;
	int32 unused7;
	s_fp estbdelay;		/* broadcast offset */
	u_int v6_flag;			/* is this v6 or not */
	u_int unused9;			/* (unused) padding for dstadr6 */
	struct in6_addr dstadr6; 	/* local address (v6-like) */
	struct in6_addr srcadr6; 	/* sources address (v6-like) */
};


/*
 * Peer statistics structure
 */
struct info_peer_stats {
	u_int32 dstadr;		/* local address */
	u_int32 srcadr;		/* remote address */
	u_short srcport;	/* remote port */
	u_short flags;		/* peer flags */
	u_int32 timereset;	/* time counters were reset */
	u_int32 timereceived;	/* time since a packet received */
	u_int32 timetosend;	/* time until a packet sent */
	u_int32 timereachable;	/* time peer has been reachable */
	u_int32 sent;		/* number sent */
	u_int32 unused1;	/* (unused) */
	u_int32 processed;	/* number processed */
	u_int32 unused2;	/* (unused) */
	u_int32 badauth;	/* bad authentication */
	u_int32 bogusorg;	/* bogus origin */
	u_int32 oldpkt;		/* duplicate */
	u_int32 unused3;	/* (unused) */
	u_int32 unused4;	/* (unused) */
	u_int32 seldisp;	/* bad dispersion */
	u_int32 selbroken;	/* bad reference time */
	u_int32 unused5;	/* (unused) */
	u_char candidate;	/* select order */
	u_char unused6;		/* (unused) */
	u_char unused7;		/* (unused) */
	u_char unused8;		/* (unused) */
	u_int v6_flag;			/* is this v6 or not */
	u_int unused9;			/* (unused) padding for dstadr6 */
	struct in6_addr dstadr6;	/* local address */
	struct in6_addr srcadr6;	/* remote address */
};


/*
 * Loop filter variables
 */
struct info_loop {
	l_fp last_offset;
	l_fp drift_comp;
	u_int32 compliance;
	u_int32 watchdog_timer;
};


/*
 * System info.  Mostly the sys.* variables, plus a few unique to
 * the implementation.
 */
struct info_sys {
	u_int32 peer;		/* system peer address (v4) */
	u_char peer_mode;	/* mode we are syncing to peer in */
	u_char leap;		/* system leap bits */
	u_char stratum;		/* our stratum */
	s_char precision;	/* local clock precision */
	s_fp rootdelay;		/* delay from sync source */
	u_fp rootdispersion;	/* dispersion from sync source */
	u_int32 refid;		/* reference ID of sync source */
	l_fp reftime;		/* system reference time */
	u_int32 poll;		/* system poll interval */
	u_char flags;		/* system flags */
	u_char unused1;		/* unused */
	u_char unused2;		/* unused */
	u_char unused3;		/* unused */
	s_fp bdelay;		/* default broadcast offset */
	s_fp frequency;		/* frequency residual (scaled ppm)  */
	l_fp authdelay;		/* default authentication delay */
	u_fp stability;		/* clock stability (scaled ppm) */
	u_int v6_flag;		/* is this v6 or not */
	u_int unused4;		/* unused, padding for peer6 */
	struct in6_addr peer6;	/* system peer address (v6) */
};


/*
 * System stats.  These are collected in the protocol module
 */
struct info_sys_stats {
	u_int32 timeup;		/* time since restart */
	u_int32 timereset;	/* time since reset */
	u_int32 denied;		/* access denied */
	u_int32 oldversionpkt;	/* recent version */
	u_int32 newversionpkt;	/* current version */
	u_int32 unknownversion;	/* bad version */
	u_int32 badlength;	/* bad length or format */
	u_int32 processed;	/* packets processed */
	u_int32 badauth;	/* bad authentication */
	u_int32 received;	/* packets received */
	u_int32 limitrejected;	/* rate exceeded */
};


/*
 * System stats - old version
 */
struct old_info_sys_stats {
	u_int32 timeup;		/* time since restart */
	u_int32 timereset;	/* time since reset */
	u_int32 denied;		/* access denied */
	u_int32 oldversionpkt;	/* recent version */
	u_int32 newversionpkt;	/* current version */
	u_int32 unknownversion;	/* bad version */
	u_int32 badlength;	/* bad length or format */
	u_int32 processed;	/* packets processed */
	u_int32 badauth;	/* bad authentication */
	u_int32 wanderhold;	/* (not used) */
};


/*
 * Peer memory statistics.  Collected in the peer module.
 */
struct info_mem_stats {
	u_int32 timereset;	/* time since reset */
	u_short totalpeermem;
	u_short freepeermem;
	u_int32 findpeer_calls;
	u_int32 allocations;
	u_int32 demobilizations;
	u_char hashcount[NTP_HASH_SIZE];
};


/*
 * I/O statistics.  Collected in the I/O module
 */
struct info_io_stats {
	u_int32 timereset;	/* time since reset */
	u_short totalrecvbufs;	/* total receive bufs */
	u_short freerecvbufs;	/* free buffers */
	u_short fullrecvbufs;	/* full buffers */
	u_short lowwater;	/* number of times we've added buffers */
	u_int32 dropped;	/* dropped packets */
	u_int32 ignored;	/* ignored packets */
	u_int32 received;	/* received packets */
	u_int32 sent;		/* packets sent */
	u_int32 notsent;	/* packets not sent */
	u_int32 interrupts;	/* interrupts we've handled */
	u_int32 int_received;	/* received by interrupt handler */
};


/*
 * Timer stats.  Guess where from.
 */
struct info_timer_stats {
	u_int32 timereset;	/* time since reset */
	u_int32 alarms;		/* alarms we've handled */
	u_int32 overflows;	/* timer overflows */
	u_int32 xmtcalls;	/* calls to xmit */
};


/*
 * Structure for passing peer configuration information
 */
struct old_conf_peer {
	u_int32 peeraddr;	/* address to poll */
	u_char hmode;		/* mode, either broadcast, active or client */
	u_char version;		/* version number to poll with */
	u_char minpoll;		/* min host poll interval */
	u_char maxpoll;		/* max host poll interval */
	u_char flags;		/* flags for this request */
	u_char ttl;		/* time to live (multicast) or refclock mode */
	u_short unused;		/* unused */
	keyid_t keyid;		/* key to use for this association */
};

struct conf_peer {
	u_int32 peeraddr;	/* address to poll */
	u_char hmode;		/* mode, either broadcast, active or client */
	u_char version;		/* version number to poll with */
	u_char minpoll;		/* min host poll interval */
	u_char maxpoll;		/* max host poll interval */
	u_char flags;		/* flags for this request */
	u_char ttl;		/* time to live (multicast) or refclock mode */
	u_short unused1;	/* unused */
	keyid_t keyid;		/* key to use for this association */
	char keystr[MAXFILENAME]; /* public key file name*/
	u_int v6_flag;		/* is this v6 or not */
	u_int unused2;			/* unused, padding for peeraddr6 */
	struct in6_addr peeraddr6;	/* ipv6 address to poll */
};

#define	CONF_FLAG_AUTHENABLE	0x01
#define CONF_FLAG_PREFER	0x02
#define CONF_FLAG_BURST		0x04
#define CONF_FLAG_IBURST	0x08
#define CONF_FLAG_NOSELECT	0x10
#define CONF_FLAG_SKEY		0x20

/*
 * Structure for passing peer deletion information.  Currently
 * we only pass the address and delete all configured peers with
 * this addess.
 */
struct conf_unpeer {
	u_int32 peeraddr;		/* address of peer */
	u_int v6_flag;			/* is this v6 or not */
	struct in6_addr peeraddr6;	/* address of peer (v6) */
};

/*
 * Structure for carrying system flags.
 */
struct conf_sys_flags {
	u_int32 flags;
};

/*
 * System flags we can set/clear
 */
#define	SYS_FLAG_BCLIENT	0x01
#define	SYS_FLAG_PPS		0x02
#define SYS_FLAG_NTP		0x04
#define SYS_FLAG_KERNEL		0x08
#define SYS_FLAG_MONITOR	0x10
#define SYS_FLAG_FILEGEN	0x20
#define SYS_FLAG_AUTH		0x40
#define SYS_FLAG_CAL		0x80

/*
 * Structure used for returning restrict entries
 */
struct info_restrict {
	u_int32 addr;		/* match address */
	u_int32 mask;		/* match mask */
	u_int32 count;		/* number of packets matched */
	u_short flags;		/* restrict flags */
	u_short mflags;		/* match flags */
	u_int v6_flag;		/* is this v6 or not */
	u_int unused1;		/* unused, padding for addr6 */
	struct in6_addr addr6;	/* match address (v6) */
	struct in6_addr mask6; 	/* match mask (v6) */
};


/*
 * Structure used for specifying restrict entries
 */
struct conf_restrict {
	u_int32	addr;		/* match address */
	u_int32 mask;		/* match mask */
	u_short flags;		/* restrict flags */
	u_short mflags;		/* match flags */
	u_int v6_flag;		/* is this v6 or not */
	struct in6_addr addr6; 	/* match address (v6) */
	struct in6_addr mask6; 	/* match mask (v6) */
};


/*
 * Structure used for returning monitor data
 */
struct info_monitor_1 {	
	u_int32 lasttime;	/* last packet from this host */
	u_int32 firsttime;	/* first time we received a packet */
	u_int32 restr;		/* restrict bits (was named lastdrop) */
	u_int32 count;		/* count of packets received */
	u_int32 addr;		/* host address V4 style */
	u_int32 daddr;		/* destination host address */
	u_int32 flags;		/* flags about destination */
	u_short port;		/* port number of last reception */
	u_char mode;		/* mode of last packet */
	u_char version;		/* version number of last packet */
	u_int v6_flag;		/* is this v6 or not */
	u_int unused1;		/* unused, padding for addr6 */
	struct in6_addr addr6;	/* host address V6 style */
	struct in6_addr daddr6;	/* host address V6 style */
};


/*
 * Structure used for returning monitor data
 */
struct info_monitor {	
	u_int32 lasttime;	/* last packet from this host */
	u_int32 firsttime;	/* first time we received a packet */
	u_int32 restr;		/* restrict bits (was named lastdrop) */
	u_int32 count;		/* count of packets received */
	u_int32 addr;		/* host address */
	u_short port;		/* port number of last reception */
	u_char mode;		/* mode of last packet */
	u_char version;		/* version number of last packet */
	u_int v6_flag;		/* is this v6 or not */
	u_int unused1;		/* unused, padding for addr6 */
	struct in6_addr addr6;	/* host v6 address */
};

/*
 * Structure used for returning monitor data (old format)
 */
struct old_info_monitor {	
	u_int32 lasttime;	/* last packet from this host */
	u_int32 firsttime;	/* first time we received a packet */
	u_int32 count;		/* count of packets received */
	u_int32 addr;		/* host address */
	u_short port;		/* port number of last reception */
	u_char mode;		/* mode of last packet */
	u_char version;		/* version number of last packet */
	u_int v6_flag;		/* is this v6 or not */
	struct in6_addr addr6;	/* host address  (v6)*/
};

/*
 * Structure used for passing indication of flags to clear
 */
struct reset_flags {
	u_int32 flags;
};

#define	RESET_FLAG_ALLPEERS	0x01
#define	RESET_FLAG_IO		0x02
#define	RESET_FLAG_SYS		0x04
#define	RESET_FLAG_MEM		0x08
#define	RESET_FLAG_TIMER	0x10
#define	RESET_FLAG_AUTH		0x20
#define	RESET_FLAG_CTL		0x40

#define	RESET_ALLFLAGS \
	(RESET_FLAG_ALLPEERS|RESET_FLAG_IO|RESET_FLAG_SYS \
	|RESET_FLAG_MEM|RESET_FLAG_TIMER|RESET_FLAG_AUTH|RESET_FLAG_CTL)

/*
 * Structure used to return information concerning the authentication
 * module.
 */
struct info_auth {
	u_int32 timereset;	/* time counters were reset */
	u_int32 numkeys;	/* number of keys we know */
	u_int32 numfreekeys;	/* number of free keys */
	u_int32 keylookups;	/* calls to authhavekey() */
	u_int32 keynotfound;	/* requested key unknown */
	u_int32 encryptions;	/* number of encryptions */
	u_int32 decryptions;	/* number of decryptions */
	u_int32 expired;	/* number of expired keys */
	u_int32 keyuncached;	/* calls to encrypt/decrypt with uncached key */
};


/*
 * Structure used to pass trap information to the client
 */
struct info_trap {
	u_int32 local_address;	/* local interface addres (v4) */
	u_int32 trap_address;	/* remote client's addres (v4) */
	u_short trap_port;	/* remote port number */
	u_short sequence;	/* sequence number */
	u_int32 settime;	/* time trap last set */
	u_int32 origtime;	/* time trap originally set */
	u_int32 resets;		/* number of resets on this trap */
	u_int32 flags;		/* trap flags, as defined in ntp_control.h */
	u_int v6_flag;			/* is this v6 or not */
	struct in6_addr local_address6;	/* local interface address (v6) */
	struct in6_addr trap_address6;	/* remote client's address (v6) */
};

/*
 * Structure used to pass add/clear trap information to the client
 */
struct conf_trap {
	u_int32 local_address;	/* remote client's address */
	u_int32 trap_address;	/* local interface address */
	u_short trap_port;	/* remote client's port */
	u_short unused;		/* (unused) */
	u_int v6_flag;			/* is this v6 or not */
	struct in6_addr local_address6;	/* local interface address (v6) */
	struct in6_addr trap_address6;	/* remote client's address (v6) */
};


/*
 * Structure used to return statistics from the control module
 */
struct info_control {
	u_int32 ctltimereset;
	u_int32 numctlreq;	/* number of requests we've received */
	u_int32 numctlbadpkts;	/* number of bad control packets */
	u_int32 numctlresponses;	/* # resp packets sent */
	u_int32 numctlfrags;	/* # of fragments sent */
	u_int32 numctlerrors;	/* number of error responses sent */
	u_int32 numctltooshort;	/* number of too short input packets */
	u_int32 numctlinputresp;	/* number of responses on input */
	u_int32 numctlinputfrag;	/* number of fragments on input */
	u_int32 numctlinputerr;	/* # input pkts with err bit set */
	u_int32 numctlbadoffset;	/* # input pkts with nonzero offset */
	u_int32 numctlbadversion;	/* # input pkts with unknown version */
	u_int32 numctldatatooshort;	/* data too short for count */
	u_int32 numctlbadop;	/* bad op code found in packet */
	u_int32 numasyncmsgs;		/* # async messages we've sent */
};


/*
 * Structure used to return clock information
 */
struct info_clock {
	u_int32 clockadr;
	u_char type;
	u_char flags;
	u_char lastevent;
	u_char currentstatus;
	u_int32 polls;
	u_int32 noresponse;
	u_int32 badformat;
	u_int32 baddata;
	u_int32 timestarted;
	l_fp fudgetime1;
	l_fp fudgetime2;
	int32 fudgeval1;
	u_int32 fudgeval2;
};


/*
 * Structure used for setting clock fudge factors
 */
struct conf_fudge {
	u_int32 clockadr;
	u_int32 which;
	l_fp fudgetime;
	u_int32 fudgeval_flags;
};

#define	FUDGE_TIME1	1
#define	FUDGE_TIME2	2
#define	FUDGE_VAL1	3
#define	FUDGE_VAL2	4
#define	FUDGE_FLAGS	5


/*
 * Structure used for returning clock debugging info
 */
#define	NUMCBUGVALUES	16
#define	NUMCBUGTIMES	32

struct info_clkbug {
	u_int32 clockadr;
	u_char nvalues;
	u_char ntimes;
	u_short svalues;
	u_int32 stimes;
	u_int32 values[NUMCBUGVALUES];
	l_fp times[NUMCBUGTIMES];
};

/*
 * Structure used for returning kernel pll/PPS information
 */
struct info_kernel {
	int32 offset;
	int32 freq;
	int32 maxerror;
	int32 esterror;
	u_short status;
	u_short shift;
	int32 constant;
	int32 precision;
	int32 tolerance;

/*
 * Variables used only if PPS signal discipline is implemented
 */
	int32 ppsfreq;
	int32 jitter;
	int32 stabil;
	int32 jitcnt;
	int32 calcnt;
	int32 errcnt;
	int32 stbcnt;
};

/*
 * interface statistics
 */
struct info_if_stats {
	union addrun unaddr;            /* address */
        union addrun unbcast;	        /* broadcast */
	union addrun unmask;	        /* mask */
	u_int32 v6_flag;                /* is this v6 */
	char name[32];			/* name of interface */
	int32 flags;			/* interface flags */
	int32 last_ttl;			/* last TTL specified */
	int32 num_mcast;		/* No. of IP addresses in multicast socket */
        int32 received;	                /* number of incoming packets */
	int32 sent;			/* number of outgoing packets */
	int32 notsent;			/* number of send failures */
	int32 uptime;		        /* number of seconds this interface was active */
	u_int32 scopeid;		/* Scope used for Multicasting */
	u_int32 ifindex;		/* interface index - from system */
	u_int32 ifnum;		        /* sequential interface number */
        u_int32 peercnt;		/* number of peers referencinf this interface - informational only */
	u_short family;			/* Address family */
	u_char ignore_packets;	        /* Specify whether the packet should be ignored */
        u_char action;		        /* reason the item is listed */
	int32 _filler0;		        /* pad to a 64 bit size boundary */
};

#define IFS_EXISTS	1	/* just exists */
#define IFS_CREATED	2	/* was just created */
#define IFS_DELETED	3	/* was just delete */

/*
 * Info returned with IP -> hostname lookup
 */
/* 144 might need to become 32, matching data[] member of req_pkt */
#define NTP_MAXHOSTNAME (32 - sizeof(u_int32) - sizeof(u_short))
struct info_dns_assoc {
	u_int32 peeraddr;	/* peer address (HMS: being careful...) */
	associd_t associd;	/* association ID */
	char hostname[NTP_MAXHOSTNAME];	/* hostname */
};

/*
 * function declarations
 */
int get_packet_mode(struct recvbuf *rbufp); /* Return packet mode */

#endif /* NTP_REQUEST_H */
ntp-4.2.6p5/include/ntp.h0000644000175000017500000007430411665566225014234 0ustar  peterpeter/*
 * ntp.h - NTP definitions for the masses
 */
#ifndef NTP_H
#define NTP_H

#include 
#include 

#include 
#include 
#include 
#ifdef OPENSSL
#include 
#endif /* OPENSSL */
#include 
#include 

#include 

/*
 * Calendar arithmetic - contributed by G. Healton
 */
#define YEAR_BREAK 500		/* years < this are tm_year values:
				 * Break < AnyFourDigitYear && Break >
				 * Anytm_yearYear */

#define YEAR_PIVOT 98		/* 97/98: years < this are year 2000+
				 * FYI: official UNIX pivot year is
				 * 68/69 */

/*
 * Number of Days since 1 BC Gregorian to 1 January of given year
 */
#define julian0(year)	(((year) * 365 ) + ((year) > 0 ? (((year) + 3) \
			    / 4 - ((year - 1) / 100) + ((year - 1) / \
			    400)) : 0))

/*
 * Number of days since start of NTP time to 1 January of given year
 */
#define ntp0(year)	(julian0(year) - julian0(1900))

/*
 * Number of days since start of UNIX time to 1 January of given year
 */
#define unix0(year)	(julian0(year) - julian0(1970))

/*
 * LEAP YEAR test for full 4-digit years (e.g, 1999, 2010)
 */
#define isleap_4(y)	((y) % 4 == 0 && !((y) % 100 == 0 && !(y % \
			    400 == 0)))

/*
 * LEAP YEAR test for tm_year (struct tm) years (e.g, 99, 110)
 */
#define isleap_tm(y)	((y) % 4 == 0 && !((y) % 100 == 0 && !(((y) \
			    + 1900) % 400 == 0)))

/*
 * to convert simple two-digit years to tm_year style years:
 *
 *	if (year < YEAR_PIVOT)
 *		year += 100;
 *
 * to convert either two-digit OR tm_year years to four-digit years:
 *
 *	if (year < YEAR_PIVOT)
 *		year += 100;
 *
 *	if (year < YEAR_BREAK)
 *		year += 1900;
 */

/*
 * How to get signed characters.  On machines where signed char works,
 * use it. On machines where signed char doesn't work, char had better
 * be signed.
 */
#ifdef NEED_S_CHAR_TYPEDEF
# if SIZEOF_SIGNED_CHAR
typedef signed char s_char;
# else
typedef char s_char;
# endif
  /* XXX: Why is this sequent bit INSIDE this test? */
# ifdef sequent
#  undef SO_RCVBUF
#  undef SO_SNDBUF
# endif
#endif
#ifndef TRUE
# define TRUE 1
#endif /* TRUE */
#ifndef FALSE
# define FALSE 0
#endif /* FALSE */

/*
 * NTP protocol parameters.  See section 3.2.6 of the specification.
 */
#define	NTP_VERSION	((u_char)4) /* current version number */
#define	NTP_OLDVERSION	((u_char)1) /* oldest credible version */
#define	NTP_PORT	123	/* included for non-unix machines */

/*
 * Poll interval parameters
 */
#define NTP_UNREACH	10	/* poll unreach threshold */
#define	NTP_MINPOLL	3	/* log2 min poll interval (8 s) */
#define NTP_MINDPOLL	6	/* log2 default min poll (64 s) */
#define NTP_MAXDPOLL	10	/* log2 default max poll (~17 m) */
#define	NTP_MAXPOLL	17	/* log2 max poll interval (~36 h) */
#define	NTP_RETRY	3	/* max packet retries */
#define	NTP_MINPKT	1	/* log2 min interburst interval (2 s) */

/*
 * Clock filter algorithm tuning parameters
 */
#define MAXDISPERSE	16.	/* max dispersion */
#define	NTP_SHIFT	8	/* clock filter stages */
#define NTP_FWEIGHT	.5	/* clock filter weight */

/*
 * Selection algorithm tuning parameters
 */
#define	NTP_MINCLOCK	3	/* min survivors */
#define	NTP_MAXCLOCK	10	/* max candidates */
#define	NTP_MAXASSOC	50	/* max associations */
#define MINDISPERSE	.001	/* min distance */
#define MAXDISTANCE	1.5	/* max root distance (select threshold) */
#define CLOCK_SGATE	3.	/* popcorn spike gate */
#define HUFFPUFF	900	/* huff-n'-puff sample interval (s) */
#define MAXHOP		2	/* anti-clockhop threshold */
#define MAX_TTL		8	/* max ttl mapping vector size */
#define	BEACON		7200	/* manycast beacon interval */
#define NTP_MAXEXTEN	2048	/* max extension field size */

/*
 * Miscellaneous stuff
 */
#define NTP_MAXKEY	65535	/* max authentication key number */
#define	KEY_TYPE_MD5	NID_md5	/* MD5 digest NID */
/*
 * Limits of things
 */
#define	MAXFILENAME	128	/* max length of file name */
#define MAXHOSTNAME	512	/* max length of host/node name */
#define NTP_MAXSTRLEN	256	/* max string length */

/*
 * Operations for jitter calculations (these use doubles).
 *
 * Note that we carefully separate the jitter component from the
 * dispersion component (frequency error plus precision). The frequency
 * error component is computed as CLOCK_PHI times the difference between
 * the epoch of the time measurement and the reference time. The
 * precision component is computed as the square root of the mean of the
 * squares of a zero-mean, uniform distribution of unit maximum
 * amplitude. Whether this makes statistical sense may be arguable.
 */
#define SQUARE(x) ((x) * (x))
#define SQRT(x) (sqrt(x))
#define DIFF(x, y) (SQUARE((x) - (y)))
#define LOGTOD(a)	((a) < 0 ? 1. / (1L << -(a)) : \
			    1L << (int)(a)) /* log2 to double */
#define UNIVAR(x)	(SQUARE(.28867513 * LOGTOD(x))) /* std uniform distr */
#define ULOGTOD(a)	(1L << (int)(a)) /* ulog2 to double */

#define	EVENT_TIMEOUT	0	/* one second, that is */


/*
 * The interface structure is used to hold the addresses and socket
 * numbers of each of the local network addresses we are using.
 * Because "interface" is a reserved word in C++ and has so many
 * varied meanings, a change to "endpt" (via typedef) is under way.
 * Eventually the struct tag will change from interface to endpt_tag.
 * endpt is unrelated to the select algorithm's struct endpoint.
 */
typedef struct interface endpt;
struct interface {
	endpt *		elink;		/* endpt list link */
	endpt *		mclink;		/* per-AF_* multicast list */
	SOCKET		fd;		/* socket descriptor */
	SOCKET		bfd;		/* for receiving broadcasts */
	u_int32		ifnum;		/* endpt instance count */
	sockaddr_u	sin;		/* unicast address */
	sockaddr_u	mask;		/* subnet mask */
	sockaddr_u	bcast;		/* broadcast address */
	char		name[32];	/* name of interface */
	u_short		family;		/* AF_INET/AF_INET6 */
	u_short		phase;		/* phase in update cycle */
	u_int32		flags;		/* interface flags */
	int		last_ttl;	/* last TTL specified */
	u_int32		addr_refid;	/* IPv4 addr or IPv6 hash */
	int		num_mcast;	/* mcast addrs enabled */
	u_long		starttime;	/* current_time at creation */
	volatile long	received;	/* number of incoming packets */
	long		sent;		/* number of outgoing packets */
	long		notsent;	/* number of send failures */
	u_int		ifindex;	/* for IPV6_MULTICAST_IF */
	isc_boolean_t	ignore_packets; /* listen-read-drop this? */
	struct peer *	peers;		/* list of peers using endpt */
	u_int		peercnt;	/* count of same */
};

/*
 * Flags for interfaces
 */
#define INT_UP		0x001	/* Interface is up */
#define	INT_PPP		0x002	/* Point-to-point interface */
#define	INT_LOOPBACK	0x004	/* the loopback interface */
#define	INT_BROADCAST	0x008	/* can broadcast out this interface */
#define INT_MULTICAST	0x010	/* can multicast out this interface */
#define	INT_BCASTOPEN	0x020	/* broadcast socket is open */
#define INT_MCASTOPEN	0x040	/* multicasting enabled */
#define INT_WILDCARD	0x080	/* wildcard interface - usually skipped */
#define INT_MCASTIF	0x100	/* bound directly to MCAST address */
#define INT_PRIVACY	0x200	/* RFC 4941 IPv6 privacy address */

/*
 * Define flasher bits (tests 1 through 11 in packet procedure)
 * These reveal the state at the last grumble from the peer and are
 * most handy for diagnosing problems, even if not strictly a state
 * variable in the spec. These are recorded in the peer structure.
 *
 * Packet errors
 */
#define TEST1		0X0001	/* duplicate packet */
#define TEST2		0x0002	/* bogus packet */
#define TEST3		0x0004	/* protocol unsynchronized */
#define TEST4		0x0008	/* access denied */
#define TEST5		0x0010	/* bad authentication */
#define TEST6		0x0020	/* bad synch or stratum */
#define TEST7		0x0040	/* bad header */
#define TEST8		0x0080  /* bad autokey */
#define TEST9		0x0100	/* bad crypto */
#define	PKT_TEST_MASK	(TEST1 | TEST2 | TEST3 | TEST4 | TEST5 |\
			TEST6 | TEST7 | TEST8 | TEST9)
/*
 * Peer errors
 */
#define TEST10		0x0200	/* peer bad synch or stratum */
#define	TEST11		0x0400	/* peer distance exceeded */
#define TEST12		0x0800	/* peer synchronization loop */
#define TEST13		0x1000	/* peer unreacable */
#define	PEER_TEST_MASK	(TEST10 | TEST11 | TEST12 | TEST13)

/*
 * The peer structure. Holds state information relating to the guys
 * we are peering with. Most of this stuff is from section 3.2 of the
 * spec.
 */
struct peer {
	struct peer *next;	/* link pointer in peer hash */
	struct peer *ass_next;	/* link pointer in associd hash */
	struct peer *ilink;	/* list of peers for interface */
	sockaddr_u srcadr;	/* address of remote host */
	endpt *	dstadr;		/* local address */
	associd_t associd;	/* association ID */
	u_char	version;	/* version number */
	u_char	hmode;		/* local association mode */
	u_char	hpoll;		/* local poll interval */
	u_char	minpoll;	/* min poll interval */
	u_char	maxpoll;	/* max poll interval */
	u_int	flags;		/* association flags */
	u_char	cast_flags;	/* additional flags */
	u_char	last_event;	/* last peer error code */
	u_char	num_events;	/* number of error events */
	u_char	ttl;		/* ttl/refclock mode */

	/*
	 * Variables used by reference clock support
	 */
#ifdef REFCLOCK
	struct refclockproc *procptr; /* refclock structure pointer */
	u_char	refclktype;	/* reference clock type */
	u_char	refclkunit;	/* reference clock unit number */
	u_char	sstclktype;	/* clock type for system status word */
#endif /* REFCLOCK */

	/*
	 * Variables set by received packet
	 */
	u_char	leap;		/* local leap indicator */
	u_char	pmode;		/* remote association mode */
	u_char	stratum;	/* remote stratum */
	u_char	ppoll;		/* remote poll interval */
	s_char	precision;	/* remote clock precision */
	double	rootdelay;	/* roundtrip delay to primary source */
	double	rootdisp;	/* dispersion to primary source */
	u_int32	refid;		/* remote reference ID */
	l_fp	reftime;	/* update epoch */

	/*
	 * Variables used by authenticated client
	 */
	keyid_t keyid;		/* current key ID */
#ifdef OPENSSL
#define clear_to_zero opcode
	u_int32	opcode;		/* last request opcode */
	associd_t assoc;	/* peer association ID */
	u_int32	crypto;		/* peer status word */
	EVP_PKEY *pkey;		/* public key */
	const EVP_MD *digest;	/* message digest algorithm */
	char	*subject;	/* certificate subject name */
	char	*issuer;	/* certificate issuer name */
	struct cert_info *xinfo; /* issuer certificate */
	keyid_t	pkeyid;		/* previous key ID */
	keyid_t	hcookie;	/* host cookie */
	keyid_t	pcookie;	/* peer cookie */
	const struct pkey_info *ident_pkey; /* identity key */
	BIGNUM	*iffval;	/* identity challenge (IFF, GQ, MV) */
	const BIGNUM *grpkey;	/* identity challenge key (GQ) */
	struct value cookval;	/* receive cookie values */
	struct value recval;	/* receive autokey values */
	struct exten *cmmd;	/* extension pointer */
	u_long	refresh;	/* next refresh epoch */

	/*
	 * Variables used by authenticated server
	 */
	keyid_t	*keylist;	/* session key ID list */
	int	keynumber;	/* current key number */
	struct value encrypt;	/* send encrypt values */
	struct value sndval;	/* send autokey values */
#else /* OPENSSL */
#define clear_to_zero status
#endif /* OPENSSL */

	/*
	 * Ephemeral state variables
	 */
	u_char	status;		/* peer status */
	u_char	new_status;	/* under-construction status */
	u_char	reach;		/* reachability register */
	int	flash;		/* protocol error test tally bits */
	u_long	epoch;		/* reference epoch */
	int	burst;		/* packets remaining in burst */
	int	retry;		/* retry counter */
	int	flip;		/* interleave mode control */
	int	filter_nextpt;	/* index into filter shift register */
	double	filter_delay[NTP_SHIFT]; /* delay shift register */
	double	filter_offset[NTP_SHIFT]; /* offset shift register */
	double	filter_disp[NTP_SHIFT]; /* dispersion shift register */
	u_long	filter_epoch[NTP_SHIFT]; /* epoch shift register */
	u_char	filter_order[NTP_SHIFT]; /* filter sort index */
	l_fp	rec;		/* receive time stamp */
	l_fp	xmt;		/* transmit time stamp */
	l_fp	dst;		/* destination timestamp */
	l_fp	aorg;		/* origin timestamp */
	l_fp	borg;		/* alternate origin timestamp */
	double	offset;		/* peer clock offset */
	double	delay;		/* peer roundtrip delay */
	double	jitter;		/* peer jitter (squares) */
	double	disp;		/* peer dispersion */
	double	xleave;		/* interleave delay */
	double	bias;		/* bias for NIC asymmetry */

	/*
	 * Variables used to correct for packet length and asymmetry.
	 */
	double	t21;		/* outbound packet delay */
	int	t21_bytes;	/* outbound packet length */
	int	t21_last;	/* last outbound packet length */
	double	r21;		/* outbound data rate */
	double	t34;		/* inbound packet delay */
	int	t34_bytes;	/* inbound packet length */
	double	r34;		/* inbound data rate */

	/*
	 * End of clear-to-zero area
	 */
	u_long	update;		/* receive epoch */
#define end_clear_to_zero update
	int	unreach;	/* watchdog counter */
	int	throttle;	/* rate control */
	u_long	outdate;	/* send time last packet */
	u_long	nextdate;	/* send time next packet */
	u_long	nextaction;	/* peer local activity timeout (refclocks) */
	void (*action) (struct peer *); /* action timeout function */

	/*
	 * Statistic counters
	 */
	u_long	timereset;	/* time stat counters were reset */
	u_long	timereceived;	/* last packet received time */
	u_long	timereachable;	/* last reachable/unreachable time */

	u_long	sent;		/* packets sent */
	u_long	received;	/* packets received */
	u_long	processed;	/* packets processed */
	u_long	badauth;	/* bad authentication (TEST5) */
	u_long	bogusorg;	/* bogus origin (TEST2, TEST3) */
	u_long	oldpkt;		/* old duplicate (TEST1) */
	u_long	seldisptoolarge; /* bad header (TEST6, TEST7) */
	u_long	selbroken;	/* KoD received */
};

/*
 * Values for peer.leap, sys_leap
 */
#define	LEAP_NOWARNING	0x0	/* normal, no leap second warning */
#define	LEAP_ADDSECOND	0x1	/* last minute of day has 61 seconds */
#define	LEAP_DELSECOND	0x2	/* last minute of day has 59 seconds */
#define	LEAP_NOTINSYNC	0x3	/* overload, clock is free running */

/*
 * Values for peer mode and packet mode. Only the modes through
 * MODE_BROADCAST and MODE_BCLIENT appear in the transition
 * function. MODE_CONTROL and MODE_PRIVATE can appear in packets,
 * but those never survive to the transition function.
 * is a
 */
#define	MODE_UNSPEC	0	/* unspecified (old version) */
#define	MODE_ACTIVE	1	/* symmetric active mode */
#define	MODE_PASSIVE	2	/* symmetric passive mode */
#define	MODE_CLIENT	3	/* client mode */
#define	MODE_SERVER	4	/* server mode */
#define	MODE_BROADCAST	5	/* broadcast mode */
/*
 * These can appear in packets
 */
#define	MODE_CONTROL	6	/* control mode */
#define	MODE_PRIVATE	7	/* private mode */
/*
 * This is a madeup mode for broadcast client.
 */
#define	MODE_BCLIENT	6	/* broadcast client mode */

/*
 * Values for peer.stratum, sys_stratum
 */
#define	STRATUM_REFCLOCK ((u_char)0) /* default stratum */
/* A stratum of 0 in the packet is mapped to 16 internally */
#define	STRATUM_PKT_UNSPEC ((u_char)0) /* unspecified in packet */
#define	STRATUM_UNSPEC	((u_char)16) /* unspecified */

/*
 * Values for peer.flags
 */
#define	FLAG_CONFIG	0x0001	/* association was configured */
#define	FLAG_PREEMPT	0x0002	/* preemptable association */
#define	FLAG_AUTHENTIC	0x0004	/* last message was authentic */
#define	FLAG_REFCLOCK	0x0008	/* this is actually a reference clock */
#define	FLAG_BC_VOL	0x0010	/* broadcast client volleying */
#define	FLAG_PREFER	0x0020	/* prefer peer */
#define	FLAG_BURST	0x0040	/* burst mode */
#define	FLAG_PPS	0x0080	/* steered by PPS */
#define	FLAG_IBURST	0x0100	/* initial burst mode */
#define	FLAG_NOSELECT	0x0200	/* never select */
#define	FLAG_TRUE	0x0400	/* force truechimer */
#define	FLAG_SKEY	0x0800  /* autokey authentication */
#define	FLAG_XLEAVE	0x1000	/* interleaved protocol */
#define	FLAG_XB		0x2000	/* interleaved broadcast */
#define	FLAG_XBOGUS	0x4000	/* interleaved bogus packet */
#ifdef	OPENSSL
#define FLAG_ASSOC	0x8000	/* autokey request */
#endif /* OPENSSL */

/*
 * Definitions for the clear() routine.  We use memset() to clear
 * the parts of the peer structure which go to zero.  These are
 * used to calculate the start address and length of the area.
 */
#define	CLEAR_TO_ZERO(p)	((char *)&((p)->clear_to_zero))
#define	END_CLEAR_TO_ZERO(p)	((char *)&((p)->end_clear_to_zero))
#define	LEN_CLEAR_TO_ZERO	(END_CLEAR_TO_ZERO((struct peer *)0) \
				    - CLEAR_TO_ZERO((struct peer *)0))
#define CRYPTO_TO_ZERO(p)	((char *)&((p)->clear_to_zero))
#define END_CRYPTO_TO_ZERO(p)	((char *)&((p)->end_clear_to_zero))
#define LEN_CRYPTO_TO_ZERO	(END_CRYPTO_TO_ZERO((struct peer *)0) \
				    - CRYPTO_TO_ZERO((struct peer *)0))

/*
 * Reference clock identifiers (for pps signal)
 */
#define PPSREFID (u_int32)"PPS "	/* used when pps controls stratum>1 */

/*
 * Reference clock types.  Added as necessary.
 */
#define	REFCLK_NONE		0	/* unknown or missing */
#define	REFCLK_LOCALCLOCK	1	/* external (e.g., lockclock) */
#define	REFCLK_GPS_TRAK		2	/* TRAK 8810 GPS Receiver */
#define	REFCLK_WWV_PST		3	/* PST/Traconex 1020 WWV/H */
#define	REFCLK_SPECTRACOM	4	/* Spectracom (generic) Receivers */
#define	REFCLK_TRUETIME		5	/* TrueTime (generic) Receivers */
#define REFCLK_IRIG_AUDIO	6	/* IRIG-B/W audio decoder */
#define	REFCLK_CHU_AUDIO	7	/* CHU audio demodulator/decoder */
#define REFCLK_PARSE		8	/* generic driver (usually DCF77,GPS,MSF) */
#define	REFCLK_GPS_MX4200	9	/* Magnavox MX4200 GPS */
#define REFCLK_GPS_AS2201	10	/* Austron 2201A GPS */
#define	REFCLK_GPS_ARBITER	11	/* Arbiter 1088A/B/ GPS */
#define REFCLK_IRIG_TPRO	12	/* KSI/Odetics TPRO-S IRIG */
#define REFCLK_ATOM_LEITCH	13	/* Leitch CSD 5300 Master Clock */
#define REFCLK_MSF_EES		14	/* EES M201 MSF Receiver */
#define	REFCLK_GPSTM_TRUE	15	/* OLD TrueTime GPS/TM-TMD Receiver */
#define REFCLK_IRIG_BANCOMM	16	/* Bancomm GPS/IRIG Interface */
#define REFCLK_GPS_DATUM	17	/* Datum Programmable Time System */
#define REFCLK_ACTS		18	/* Generic Auto Computer Time Service */
#define REFCLK_WWV_HEATH	19	/* Heath GC1000 WWV/WWVH Receiver */
#define REFCLK_GPS_NMEA		20	/* NMEA based GPS clock */
#define REFCLK_GPS_VME		21	/* TrueTime GPS-VME Interface */
#define REFCLK_ATOM_PPS		22	/* 1-PPS Clock Discipline */
#define REFCLK_PTB_ACTS		23	/* replaced by REFCLK_ACTS */
#define REFCLK_USNO		24	/* replaced by REFCLK_ACTS */
#define REFCLK_GPS_HP		26	/* HP 58503A Time/Frequency Receiver */
#define REFCLK_ARCRON_MSF	27	/* ARCRON MSF radio clock. */
#define REFCLK_SHM		28	/* clock attached thru shared memory */
#define REFCLK_PALISADE		29	/* Trimble Navigation Palisade GPS */
#define REFCLK_ONCORE		30	/* Motorola UT Oncore GPS */
#define REFCLK_GPS_JUPITER	31	/* Rockwell Jupiter GPS receiver */
#define REFCLK_CHRONOLOG	32	/* Chrono-log K WWVB receiver */
#define REFCLK_DUMBCLOCK	33	/* Dumb localtime clock */
#define REFCLK_ULINK		34	/* Ultralink M320 WWVB receiver */
#define REFCLK_PCF		35	/* Conrad parallel port radio clock */
#define REFCLK_WWV_AUDIO	36	/* WWV/H audio demodulator/decoder */
#define REFCLK_FG		37	/* Forum Graphic GPS */
#define REFCLK_HOPF_SERIAL	38	/* hopf DCF77/GPS serial receiver  */
#define REFCLK_HOPF_PCI		39	/* hopf DCF77/GPS PCI receiver  */
#define REFCLK_JJY		40	/* JJY receiver  */
#define	REFCLK_TT560		41	/* TrueTime 560 IRIG-B decoder */
#define REFCLK_ZYFER		42	/* Zyfer GPStarplus receiver  */
#define REFCLK_RIPENCC		43	/* RIPE NCC Trimble driver */
#define REFCLK_NEOCLOCK4X	44	/* NeoClock4X DCF77 or TDF receiver */
#define REFCLK_MAX		44	/* NeoClock4X DCF77 or TDF receiver */


/*
 * NTP packet format.  The mac field is optional.  It isn't really
 * an l_fp either, but for now declaring it that way is convenient.
 * See Appendix A in the specification.
 *
 * Note that all u_fp and l_fp values arrive in network byte order
 * and must be converted (except the mac, which isn't, really).
 */
struct pkt {
	u_char	li_vn_mode;	/* peer leap indicator */
	u_char	stratum;	/* peer stratum */
	u_char	ppoll;		/* peer poll interval */
	s_char	precision;	/* peer clock precision */
	u_fp	rootdelay;	/* roundtrip delay to primary source */
	u_fp	rootdisp;	/* dispersion to primary source*/
	u_int32	refid;		/* reference id */
	l_fp	reftime;	/* last update time */
	l_fp	org;		/* originate time stamp */
	l_fp	rec;		/* receive time stamp */
	l_fp	xmt;		/* transmit time stamp */

#define	LEN_PKT_NOMAC	(12 * sizeof(u_int32)) /* min header length */
#define MIN_MAC_LEN	(1 * sizeof(u_int32))	/* crypto_NAK */
#define MAX_MD5_LEN	(5 * sizeof(u_int32))	/* MD5 */
#define	MAX_MAC_LEN	(6 * sizeof(u_int32))	/* SHA */

	/*
	 * The length of the packet less MAC must be a multiple of 64
	 * with an RSA modulus and Diffie-Hellman prime of 256 octets
	 * and maximum host name of 128 octets, the maximum autokey
	 * command is 152 octets and maximum autokey response is 460
	 * octets. A packet can contain no more than one command and one
	 * response, so the maximum total extension field length is 864
	 * octets. But, to handle humungus certificates, the bank must
	 * be broke.
	 */
#ifdef OPENSSL
	u_int32	exten[NTP_MAXEXTEN / 4]; /* max extension field */
#else /* OPENSSL */
	u_int32	exten[1];	/* misused */
#endif /* OPENSSL */
	u_char	mac[MAX_MAC_LEN]; /* mac */
};

/*
 * Stuff for extracting things from li_vn_mode
 */
#define	PKT_MODE(li_vn_mode)	((u_char)((li_vn_mode) & 0x7))
#define	PKT_VERSION(li_vn_mode)	((u_char)(((li_vn_mode) >> 3) & 0x7))
#define	PKT_LEAP(li_vn_mode)	((u_char)(((li_vn_mode) >> 6) & 0x3))

/*
 * Stuff for putting things back into li_vn_mode
 */
#define	PKT_LI_VN_MODE(li, vn, md) \
	((u_char)((((li) << 6) & 0xc0) | (((vn) << 3) & 0x38) | ((md) & 0x7)))


/*
 * Dealing with stratum.  0 gets mapped to 16 incoming, and back to 0
 * on output.
 */
#define	PKT_TO_STRATUM(s)	((u_char)(((s) == (STRATUM_PKT_UNSPEC)) ?\
				(STRATUM_UNSPEC) : (s)))

#define	STRATUM_TO_PKT(s)	((u_char)(((s) == (STRATUM_UNSPEC)) ?\
				(STRATUM_PKT_UNSPEC) : (s)))

/*
 * Event codes. Used for reporting errors/events to the control module
 */
#define	PEER_EVENT	0x080	/* this is a peer event */
#define CRPT_EVENT	0x100	/* this is a crypto event */

/*
 * System event codes
 */
#define	EVNT_UNSPEC	0	/* unspecified */
#define	EVNT_NSET	1	/* freq not set */
#define	EVNT_FSET	2	/* freq set */
#define	EVNT_SPIK	3	/* spike detect */
#define	EVNT_FREQ	4	/* freq mode */
#define	EVNT_SYNC	5	/* clock sync */
#define	EVNT_SYSRESTART	6	/* restart */
#define	EVNT_SYSFAULT	7	/* panic stop */
#define	EVNT_NOPEER	8	/* no sys peer */
#define	EVNT_ARMED	9	/* leap armed */
#define	EVNT_DISARMED	10	/* leap disarmed */
#define	EVNT_LEAP	11	/* leap event */
#define	EVNT_CLOCKRESET	12	/* clock step */
#define	EVNT_KERN	13	/* kernel event */
#define	EVNT_TAI	14	/* TAI */
#define	EVNT_LEAPVAL	15	/* stale leapsecond values */
#define	EVNT_CLKHOP	16	/* clockhop */

/*
 * Peer event codes
 */
#define	PEVNT_MOBIL	(1 | PEER_EVENT) /* mobilize */
#define	PEVNT_DEMOBIL	(2 | PEER_EVENT) /* demobilize */
#define	PEVNT_UNREACH	(3 | PEER_EVENT) /* unreachable */
#define	PEVNT_REACH	(4 | PEER_EVENT) /* reachable */
#define	PEVNT_RESTART	(5 | PEER_EVENT) /* restart */
#define	PEVNT_REPLY	(6 | PEER_EVENT) /* no reply */
#define	PEVNT_RATE	(7 | PEER_EVENT) /* rate exceeded */
#define	PEVNT_DENY	(8 | PEER_EVENT) /* access denied */
#define PEVNT_ARMED	(9 | PEER_EVENT) /* leap armed */
#define	PEVNT_NEWPEER	(10 | PEER_EVENT) /* sys peer */
#define	PEVNT_CLOCK	(11 | PEER_EVENT) /* clock event */
#define	PEVNT_AUTH	(12 | PEER_EVENT) /* bad auth */
#define	PEVNT_POPCORN	(13 | PEER_EVENT) /* popcorn */
#define	PEVNT_XLEAVE	(14 | PEER_EVENT) /* interleave mode */
#define	PEVNT_XERR	(15 | PEER_EVENT) /* interleave error */
#define	PEVNT_TAI	(16 | PEER_EVENT) /* TAI */

/*
 * Clock event codes
 */
#define	CEVNT_NOMINAL	0	/* unspecified */
#define	CEVNT_TIMEOUT	1	/* no reply */
#define	CEVNT_BADREPLY	2	/* bad format */
#define	CEVNT_FAULT	3	/* fault */
#define	CEVNT_PROP	4	/* bad signal */
#define	CEVNT_BADDATE	5	/* bad date */
#define	CEVNT_BADTIME	6	/* bad time */
#define CEVNT_MAX	CEVNT_BADTIME

/*
 * Very misplaced value.  Default port through which we send traps.
 */
#define	TRAPPORT	18447


/*
 * To speed lookups, peers are hashed by the low order bits of the
 * remote IP address. These definitions relate to that.
 */
#define	NTP_HASH_SIZE	128
#define	NTP_HASH_MASK	(NTP_HASH_SIZE-1)
#define	NTP_HASH_ADDR(src)	sock_hash(src)

/*
 * min, min3 and max.  Makes it easier to transliterate the spec without
 * thinking about it.
 */
#define	min(a,b)	(((a) < (b)) ? (a) : (b))
#define	max(a,b)	(((a) > (b)) ? (a) : (b))
#define	min3(a,b,c)	min(min((a),(b)), (c))


/*
 * Configuration items.  These are for the protocol module (proto_config())
 */
#define	PROTO_BROADCLIENT	1
#define	PROTO_PRECISION		2	/* (not used) */
#define	PROTO_AUTHENTICATE	3
#define	PROTO_BROADDELAY	4
#define	PROTO_AUTHDELAY		5	/* (not used) */
#define PROTO_MULTICAST_ADD	6
#define PROTO_MULTICAST_DEL	7
#define PROTO_NTP		8
#define PROTO_KERNEL		9
#define PROTO_MONITOR		10
#define PROTO_FILEGEN		11
#define	PROTO_PPS		12
#define PROTO_CAL		13
#define PROTO_MINCLOCK		14
#define	PROTO_MAXCLOCK		15
#define PROTO_MINSANE		16
#define PROTO_FLOOR		17
#define PROTO_CEILING		18
#define PROTO_COHORT		19
#define PROTO_CALLDELAY		20
#define PROTO_MINDISP		21
#define PROTO_MAXDIST		22
#define PROTO_ADJ		23
#define	PROTO_MAXHOP		24
#define	PROTO_BEACON		25
#define	PROTO_ORPHAN		26

/*
 * Configuration items for the loop filter
 */
#define	LOOP_DRIFTINIT		1	/* set initial frequency offset */
#define LOOP_DRIFTCOMP		2	/* set 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_KERN_CLEAR		11	/* reset kernel pll parameters */
#define LOOP_CODEC		12	/* set audio codec frequency */
#define	LOOP_LEAP		13	/* insert leap after second 23:59 */

/*
 * Configuration items for the stats printer
 */
#define	STATS_FREQ_FILE		1	/* configure drift file */
#define STATS_STATSDIR		2	/* directory prefix for stats files */
#define	STATS_PID_FILE		3	/* configure ntpd PID file */
#define	STATS_LEAP_FILE		4	/* configure ntpd leapseconds file */

#define MJD_1900		15020	/* MJD for 1 Jan 1900 */

/*
 * Default parameters.  We use these in the absence of something better.
 */
#define INADDR_NTP	0xe0000101	/* NTP multicast address 224.0.1.1 */

/*
 * Structure used optionally for monitoring when this is turned on.
 */
struct mon_data {
	struct mon_data *hash_next;	/* next structure in hash list */
	struct mon_data *mru_next;	/* next structure in MRU list */
	struct mon_data *mru_prev;	/* previous structure in MRU list */
	int	flags;			/* restrict flags */
	int	leak;			/* leaky bucket accumulator */
	int	count;			/* total packet count */
	u_long	firsttime;		/* first time found */
	u_long	lasttime;		/* last time found */
	sockaddr_u rmtadr;		/* address of remote host */
	struct interface *interface;	/* interface on which this arrived */
	u_short	rmtport;		/* remote port last came from */
	u_char	mode;			/* packet mode */
	u_char	version;		/* packet version */
	u_char	cast_flags;		/* flags MDF_?CAST */
};

/*
 * Values for cast_flags
 */
#define	MDF_UCAST	0x01		/* unicast */
#define	MDF_MCAST	0x02		/* multicast */
#define	MDF_BCAST	0x04		/* broadcast */
#define	MDF_LCAST	0x08		/* localcast */
#define MDF_ACAST	0x10		/* manycast */
#define	MDF_BCLNT	0x20		/* broadcast client */
#define MDF_ACLNT	0x40		/* manycast client */

/*
 * Values used with mon_enabled to indicate reason for enabling monitoring
 */
#define MON_OFF    0x00			/* no monitoring */
#define MON_ON     0x01			/* monitoring explicitly enabled */
#define MON_RES    0x02			/* implicit monitoring for RES_LIMITED */
/*
 * Structure used for restrictlist entries
 */
typedef struct res_addr4_tag {
	u_int32		addr;		/* IPv4 addr (host order) */
	u_int32		mask;		/* IPv4 mask (host order) */
} res_addr4;

typedef struct res_addr6_tag {
	struct in6_addr addr;		/* IPv6 addr (net order) */
	struct in6_addr mask;		/* IPv6 mask (net order) */
} res_addr6;

typedef struct restrict_u_tag	restrict_u;
struct restrict_u_tag {
	restrict_u *		link;	/* link to next entry */
	u_int32			count;	/* number of packets matched */
	u_short			flags;	/* accesslist flags */
	u_short			mflags;	/* match flags */
	union {				/* variant starting here */
		res_addr4 v4;
		res_addr6 v6;
	} u;
};
#define	V4_SIZEOF_RESTRICT_U	(offsetof(restrict_u, u)	\
				 + sizeof(res_addr4))
#define	V6_SIZEOF_RESTRICT_U	(offsetof(restrict_u, u)	\
				 + sizeof(res_addr6))


/*
 * Access flags
 */
#define	RES_IGNORE		0x0001	/* ignore packet */
#define	RES_DONTSERVE		0x0002	/* access denied */
#define	RES_DONTTRUST		0x0004	/* authentication required */
#define	RES_VERSION		0x0008	/* version mismatch */
#define	RES_NOPEER		0x0010	/* new association denied */
#define RES_LIMITED		0x0020	/* packet rate exceeded */
#define RES_FLAGS		(RES_IGNORE | RES_DONTSERVE |\
				    RES_DONTTRUST | RES_VERSION |\
				    RES_NOPEER | RES_LIMITED)

#define	RES_NOQUERY		0x0040	/* mode 6/7 packet denied */
#define	RES_NOMODIFY		0x0080	/* mode 6/7 modify denied */
#define	RES_NOTRAP		0x0100	/* mode 6/7 set trap denied */
#define	RES_LPTRAP		0x0200	/* mode 6/7 low priority trap */

#define RES_KOD			0x0400	/* send kiss of death packet */
#define	RES_MSSNTP		0x0800	/* enable MS-SNTP authentication */
#define RES_TIMEOUT		0x1000	/* timeout this entry */

#define	RES_ALLFLAGS		(RES_FLAGS | RES_NOQUERY |\
				    RES_NOMODIFY | RES_NOTRAP |\
				    RES_LPTRAP | RES_KOD |\
				    RES_MSSNTP | RES_TIMEOUT)

/*
 * Match flags
 */
#define	RESM_INTERFACE		0x1000	/* this is an interface */
#define	RESM_NTPONLY		0x2000	/* match ntp port only */

/*
 * Restriction configuration ops
 */
#define	RESTRICT_FLAGS		1	/* add flags to restrict entry */
#define	RESTRICT_UNFLAG		2	/* remove flags from restrict entry */
#define	RESTRICT_REMOVE		3	/* remove a restrict entry */
#define	RESTRICT_REMOVEIF       4	/* remove an interface restrict entry */

/*
 * Endpoint structure for the select algorithm
 */
struct endpoint {
	double	val;			/* offset of endpoint */
	int	type;			/* interval entry/exit */
};

/*
 * Association matching AM[] return codes
 */
#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_FXMIT	3		/* client packet */
#define AM_MANYCAST	4		/* manycast packet */
#define AM_NEWPASS	5		/* new passive */
#define AM_NEWBCL	6		/* new broadcast */
#define	AM_POSSBCL	7		/* discard broadcast */

/* NetInfo configuration locations */
#ifdef HAVE_NETINFO
#define NETINFO_CONFIG_DIR "/config/ntp"
#endif

#endif /* NTP_H */
ntp-4.2.6p5/include/binio.h0000644000175000017500000000540511307651604014514 0ustar  peterpeter/*
 * /src/NTP/ntp4-dev/include/binio.h,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
 *
 * binio.h,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
 *
 * $Created: Sun Jul 20 13:03:05 1997 $
 *
 * Copyright (c) 1997-2005 by Frank Kardel  ntp.org>
 *
 * 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.
 * 3. Neither the name of the author nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * 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.
 *
 */
#ifndef BINIO_H
#define BINIO_H

#include "ntp_stdlib.h"

long get_lsb_short (unsigned char **);
void put_lsb_short (unsigned char **, long);
long get_lsb_long (unsigned char **);
void put_lsb_long (unsigned char **, long);

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);

#endif
/*
 * History:
 *
 * binio.h,v
 * Revision 4.5  2005/04/16 17:32:10  kardel
 * update copyright
 *
 * Revision 4.4  2004/11/14 15:29:41  kardel
 * support PPSAPI, upgrade Copyright to Berkeley style
 *
 * Revision 4.2  1998/06/28 16:52:15  kardel
 * added binio MSB prototypes for {get,put}_msb_{short,long}
 *
 * Revision 4.1  1998/06/12 15:07:40  kardel
 * fixed prototyping
 *
 * Revision 4.0  1998/04/10 19:50:38  kardel
 * Start 4.0 release version numbering
 *
 * Revision 1.1  1998/04/10 19:27:32  kardel
 * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
 *
 * Revision 1.1  1997/10/06 20:55:37  kardel
 * new parse structure
 *
 */
ntp-4.2.6p5/include/trimble.h0000644000175000017500000002001511307651605015045 0ustar  peterpeter/*
 * /src/NTP/ntp4-dev/include/trimble.h,v 4.6 2005/04/16 17:32:10 kardel RELEASE_20050508_A
 *
 * trimble.h,v 4.6 2005/04/16 17:32:10 kardel RELEASE_20050508_A
 *
 * $Created: Sun Aug  2 16:16:49 1998 $
 *
 * Copyright (c) 1998-2005 by Frank Kardel  ntp.org>
 *
 * 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.
 * 3. Neither the name of the author nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * 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.
 *
 */
#ifndef TRIMBLE_H
#define TRIMBLE_H

/*
 * Trimble packet command codes - commands being sent/received
 * keep comments formatted as shown - they are used to generate
 * translation tables
 */
#define CMD_CCLROSC	0x1D	/* clear oscillator offset */
#define CMD_CCLRRST	0x1E	/* clear battery backup and RESET */
#define CMD_CVERSION	0x1F	/* return software version */
#define CMD_CALMANAC	0x20	/* almanac */
#define CMD_CCURTIME	0x21	/* current time */
#define CMD_CMODESEL	0x22	/* mode select (2-d, 3-D, auto) */
#define CMD_CINITPOS	0x23	/* initial position */
#define	CMD_CRECVPOS	0x24	/* receiver position fix mode */
#define CMD_CRESET	0x25	/* soft reset & selftest */
#define CMD_CRECVHEALTH	0x26	/* receiver health */
#define CMD_CSIGNALLV	0x27	/* signal levels */
#define CMD_CMESSAGE	0x28	/* GPS system message */
#define CMD_CALMAHEALTH	0x29	/* almanac healt page */
#define CMD_C2DALTITUDE	0x2A	/* altitude for 2-D mode */
#define CMD_CINITPOSLLA	0x2B	/* initial position LLA */
#define CMD_COPERPARAM	0x2C	/* operating parameters */
#define CMD_COSCOFFSET	0x2D	/* oscillator offset */
#define CMD_CSETGPSTIME	0x2E	/* set GPS time */
#define CMD_CUTCPARAM	0x2F	/* UTC parameters */
#define CMD_CACCPOSXYZ	0x31	/* accurate initial position (XYZ/ECEF) */
#define CMD_CACCPOS	0x32	/* accurate initial position */
#define CMD_CANALOGDIG	0x33	/* analog to digital */
#define CMD_CSAT1SAT	0x34	/* satellite for 1-Sat mode */
#define CMD_CIOOPTIONS	0x35	/* I/O options */
#define CMD_CVELOCAID	0x36	/* velocity aiding of acquisition */
#define CMD_CSTATLSTPOS	0x37	/* status and values of last pos. and vel. */
#define CMD_CLOADSSATDT	0x38	/* load satellite system data */
#define CMD_CSATDISABLE	0x39	/* satellite disable */
#define CMD_CLASTRAW	0x3A	/* last raw measurement */
#define CMD_CSTATSATEPH	0x3B	/* satellite ephemeris status */
#define CMD_CSTATTRACK	0x3C	/* tracking status */
#define CMD_CCHANADGPS	0x3D	/* configure channel A for differential GPS */
#define CMD_CADDITFIX	0x3E	/* additional fix data */
#define CMD_CDGPSFIXMD	0x62	/* set/request differential GPS position fix mode */
#define CMD_CDGPSCORR	0x65	/* differential correction status */
#define CMD_CPOSFILT	0x71	/* position filter parameters */
#define CMD_CHEIGHTFILT	0x73	/* height filter control */
#define CMD_CHIGH8CNT	0x75	/* high-8 (best 4) / high-6 (overdetermined) control */
#define CMD_CMAXDGPSCOR	0x77	/* maximum rate of DGPS corrections */
#define CMD_CSUPER	0x8E	/* super paket */

#define CMD_RDATAA	0x3D	/* data channel A configuration:trimble_channelA:RO */
#define CMD_RALMANAC	0x40	/* almanac data for sat:gps_almanac:RO */
#define CMD_RCURTIME	0x41	/* GPS time:gps_time:RO */
#define CMD_RSPOSXYZ	0x42	/* single precision XYZ position:gps_position(XYZ):RO|DEF */
#define CMD_RVELOXYZ	0x43	/* velocity fix (XYZ ECEF):gps_velocity(XYZ):RO|DEF */
#define	CMD_RBEST4	0x44	/* best 4 satellite selection:trimble_best4:RO|DEF */
#define CMD_RVERSION	0x45	/* software version:trimble_version:RO|DEF */
#define CMD_RRECVHEALTH	0x46	/* receiver health:trimble_receiver_health:RO|DEF */
#define CMD_RSIGNALLV	0x47	/* signal levels of all satellites:trimble_signal_levels:RO */
#define CMD_RMESSAGE	0x48	/* GPS system message:gps-message:RO|DEF */
#define CMD_RALMAHEALTH	0x49	/* almanac health page for all satellites:gps_almanac_health:RO */
#define CMD_RSLLAPOS	0x4A	/* single LLA position:gps_position(LLA):RO|DEF */
#define CMD_RMACHSTAT	0x4B	/* machine code / status:trimble_status:RO|DEF */
#define CMD_ROPERPARAM	0x4C	/* operating parameters:trimble_opparam:RO */
#define CMD_ROSCOFFSET	0x4D	/* oscillator offset:trimble_oscoffset:RO */
#define CMD_RSETGPSTIME	0x4E	/* response to set GPS time:trimble_setgpstime:RO */
#define CMD_RUTCPARAM	0x4F	/* UTC parameters:gps_utc_correction:RO|DEF */
#define CMD_RANALOGDIG	0x53	/* analog to digital:trimble_analogdigital:RO */
#define CMD_RSAT1BIAS	0x54	/* one-satellite bias & bias rate:trimble_sat1bias:RO */
#define CMD_RIOOPTIONS	0x55	/* I/O options:trimble_iooptions:RO */
#define CMD_RVELOCFIX	0x56	/* velocity fix (ENU):trimble_velocfix */
#define CMD_RSTATLSTFIX	0x57	/* status and values of last pos. and vel.:trimble_status_lastpos:RO */
#define CMD_RLOADSSATDT	0x58	/* response to load satellite system data:trimble_loaddata:RO */
#define CMD_RSATDISABLE	0x59	/* satellite disable:trimble_satdisble:RO */
#define CMD_RLASTRAW	0x5A	/* last raw measurement:trimble_lastraw:RO */
#define CMD_RSTATSATEPH	0x5B	/* satellite ephemeris status:trimble_ephstatus:RO */
#define CMD_RSTATTRACK	0x5C	/* tracking status:trimble_tracking_status:RO|DEF */
#define CMD_RADDITFIX	0x5E	/* additional fix data:trimble_addfix:RO */
#define CMD_RALLINVIEW	0x6D	/* all in view satellite selection:trimble_satview:RO|DEF */
#define CMD_RPOSFILT	0x72	/* position filter parameters:trimble_posfilt:RO */
#define CMD_RHEIGHTFILT	0x74	/* height filter control:trimble_heightfilt:RO */
#define CMD_RHIGH8CNT	0x76	/* high-8 (best 4) / high-6 (overdetermined) control:trimble_high8control:RO */
#define CMD_RMAXAGE	0x78	/* DC MaxAge:trimble_dgpsmaxage:RO */
#define CMD_RDGPSFIX	0x82	/* differential position fix mode:trimble_dgpsfixmode:RO */
#define CMD_RDOUBLEXYZ	0x83	/* double precision XYZ:gps_position_ext(XYZ):RO|DEF */
#define CMD_RDOUBLELLA	0x84	/* double precision LLA:gps_position_ext(LLA):RO|DEF */
#define CMD_RDGPSSTAT	0x85	/* differential correction status:trimble_dgpsstatus:RO */
#define CMD_RSUPER	0x8F	/* super paket::0 */

typedef struct cmd_info
{
  unsigned char cmd;		/* command code */
  const char   *cmdname;	/* command name */
  const char   *cmddesc;	/* command description */
  const char   *varname;	/* name of variable */
  int           varmode;	/* mode of variable */
} cmd_info_t;

extern cmd_info_t trimble_rcmds[];
extern cmd_info_t trimble_scmds[];

extern cmd_info_t *trimble_convert (unsigned int cmd, cmd_info_t *tbl);

#endif
/*
 * History:
 *
 * trimble.h,v
 * Revision 4.6  2005/04/16 17:32:10  kardel
 * update copyright
 *
 * Revision 4.5  2004/11/14 15:29:41  kardel
 * support PPSAPI, upgrade Copyright to Berkeley style
 *
 * Revision 4.4  1999/02/28 11:41:11  kardel
 * (CMD_RUTCPARAM): control variable name unification
 *
 * Revision 4.3  1998/12/20 23:45:25  kardel
 * fix types and warnings
 *
 * Revision 4.2  1998/08/16 18:45:05  kardel
 * (CMD_RSTATTRACK): renamed mode 6 variable name
 *
 * Revision 4.1  1998/08/09 22:24:35  kardel
 * Trimble TSIP support
 *
 */
ntp-4.2.6p5/include/ntp_net.h0000644000175000017500000001525711505336022015063 0ustar  peterpeter/*
 * ntp_net.h - definitions for NTP network stuff
 */

#ifndef NTP_NET_H
#define NTP_NET_H

#include 
#ifdef HAVE_SYS_SOCKET_H
#include 
#endif
#ifdef HAVE_NET_IF_H
#include 
#endif
#ifdef HAVE_NETINET_IN_H
#include 
#endif
#ifdef HAVE_NET_IF_VAR_H
#include 
#endif
#ifdef HAVE_NETINET_IN_VAR_H
#include 
#endif

#include "ntp_rfc2553.h"

typedef union {
	struct sockaddr		sa;
	struct sockaddr_in	sa4;
	struct sockaddr_in6	sa6;
} sockaddr_u;

/*
 * Utilities for manipulating sockaddr_u v4/v6 unions
 */
#define SOCK_ADDR4(psau)	((psau)->sa4.sin_addr)
#define SOCK_ADDR6(psau)	((psau)->sa6.sin6_addr)

#define PSOCK_ADDR4(psau)	(&SOCK_ADDR4(psau))
#define PSOCK_ADDR6(psau)	(&SOCK_ADDR6(psau))

#define AF(psau)		((psau)->sa.sa_family)

#define IS_IPV4(psau)		(AF_INET == AF(psau))
#define IS_IPV6(psau)		(AF_INET6 == AF(psau))

/* sockaddr_u v4 address in network byte order */
#define	NSRCADR(psau)		(SOCK_ADDR4(psau).s_addr)

/* sockaddr_u v4 address in host byte order */
#define	SRCADR(psau)		(ntohl(NSRCADR(psau)))

/* sockaddr_u v6 address in network byte order */
#define NSRCADR6(psau)		(SOCK_ADDR6(psau).s6_addr)

/* assign sockaddr_u v4 address from host byte order */
#define	SET_ADDR4(psau, addr4)	(NSRCADR(psau) = htonl(addr4))

/* assign sockaddr_u v4 address from network byte order */
#define SET_ADDR4N(psau, addr4n) (NSRCADR(psau) = (addr4n));

/* assign sockaddr_u v6 address from network byte order */
#define SET_ADDR6N(psau, s6_addr)				\
	(SOCK_ADDR6(psau) = (s6_addr))

/* sockaddr_u v4/v6 port in network byte order */
#define	NSRCPORT(psau)		((psau)->sa4.sin_port)

/* sockaddr_u v4/v6 port in host byte order */
#define	SRCPORT(psau)		(ntohs(NSRCPORT(psau)))

/* assign sockaddr_u v4/v6 port from host byte order */
#define SET_PORT(psau, port)	(NSRCPORT(psau) = htons(port))

/* sockaddr_u v6 scope */
#define SCOPE_VAR(psau)		((psau)->sa6.sin6_scope_id)

#ifdef ISC_PLATFORM_HAVESCOPEID
/* v4/v6 scope (always zero for v4) */
# define SCOPE(psau)		(IS_IPV4(psau)			\
				    ? 0				\
				    : SCOPE_VAR(psau))

/* are two v6 sockaddr_u scopes equal? */
# define SCOPE_EQ(psau1, psau2)					\
	(SCOPE_VAR(psau1) == SCOPE_VAR(psau2))

/* assign scope if supported */
# define SET_SCOPE(psau, s)					\
	do							\
		if (IS_IPV6(psau))				\
			SCOPE_VAR(psau) = (s);			\
	while (0)
#else	/* ISC_PLATFORM_HAVESCOPEID not defined */
# define SCOPE(psau)		(0)
# define SCOPE_EQ(psau1, psau2)	(1)
# define SET_SCOPE(psau, s)	do { } while (0)
#endif	/* ISC_PLATFORM_HAVESCOPEID */

/* v4/v6 is multicast address */
#define IS_MCAST(psau)						\
	(IS_IPV4(psau)						\
	    ? IN_CLASSD(SRCADR(psau))				\
	    : IN6_IS_ADDR_MULTICAST(PSOCK_ADDR6(psau)))

/* v6 is interface ID scope universal, as with MAC-derived addresses */
#define IS_IID_UNIV(psau)					\
	(!!(0x02 & NSRCADR6(psau)[8]))

#define SIZEOF_INADDR(fam)					\
	((AF_INET == (fam))					\
	    ? sizeof(struct in_addr)				\
	    : sizeof(struct in6_addr))

#define SIZEOF_SOCKADDR(fam)					\
	((AF_INET == (fam))					\
	    ? sizeof(struct sockaddr_in)			\
	    : sizeof(struct sockaddr_in6))

#define SOCKLEN(psau)						\
	(IS_IPV4(psau)						\
	    ? sizeof((psau)->sa4)				\
	    : sizeof((psau)->sa6))

#define ZERO_SOCK(psau)						\
	memset((psau), 0, sizeof(*(psau)))

/* blast a byte value across sockaddr_u v6 address */
#define	MEMSET_ADDR6(psau, v)					\
	memset((psau)->sa6.sin6_addr.s6_addr, (v),		\
		sizeof((psau)->sa6.sin6_addr.s6_addr))

#define SET_ONESMASK(psau)					\
	do {							\
		if (IS_IPV6(psau))				\
			MEMSET_ADDR6((psau), 0xff);		\
		else						\
			NSRCADR(psau) = 0xffffffff;		\
	} while(0)

/* zero sockaddr_u, fill in family and all-ones (host) mask */
#define SET_HOSTMASK(psau, family)				\
	do {							\
		ZERO_SOCK(psau);				\
		AF(psau) = (family);				\
		SET_ONESMASK(psau);				\
	} while (0)

/* 
 * compare two in6_addr returning negative, 0, or positive.
 * ADDR6_CMP is negative if *pin6A is lower than *pin6B, zero if they
 * are equal, positive if *pin6A is higher than *pin6B.  IN6ADDR_ANY
 * is the lowest address (128 zero bits).
 */
#define	ADDR6_CMP(pin6A, pin6B)					\
	memcmp((pin6A)->s6_addr, (pin6B)->s6_addr,		\
	       sizeof(pin6A)->s6_addr)

/* compare two in6_addr for equality only */
#if !defined(SYS_WINNT) || !defined(in_addr6)
#define ADDR6_EQ(pin6A, pin6B)					\
	(!ADDR6_CMP(pin6A, pin6B))
#else
#define ADDR6_EQ(pin6A, pin6B)					\
	IN6_ADDR_EQUAL(pin6A, pin6B)
#endif

/* compare a in6_addr with socket address */
#define	S_ADDR6_EQ(psau, pin6)					\
	ADDR6_EQ(&(psau)->sa6.sin6_addr, pin6)

/* are two sockaddr_u's addresses equal? (port excluded) */
#define SOCK_EQ(psau1, psau2)					\
	((AF(psau1) != AF(psau2))				\
	     ? 0						\
	     : IS_IPV4(psau1)					\
		   ? (NSRCADR(psau1) == NSRCADR(psau2))		\
		   : (S_ADDR6_EQ((psau1), PSOCK_ADDR6(psau2))	\
		      && SCOPE_EQ((psau1), (psau2))))

/* are two sockaddr_u's addresses and ports equal? */
#define ADDR_PORT_EQ(psau1, psau2)				\
	((NSRCPORT(psau1) != NSRCPORT(psau2)			\
	     ? 0						\
	     : SOCK_EQ((psau1), (psau2))))

/* is sockaddr_u address unspecified? */
#define SOCK_UNSPEC(psau)					\
	(IS_IPV4(psau)						\
	    ? !NSRCADR(psau)					\
	    : IN6_IS_ADDR_UNSPECIFIED(PSOCK_ADDR6(psau)))

/* just how unspecified do you mean? (scope 0/unspec too) */
#define SOCK_UNSPEC_S(psau)					\
	(SOCK_UNSPEC(psau) && !SCOPE(psau))

/* choose a default net interface (struct interface) for v4 or v6 */
#define ANY_INTERFACE_BYFAM(family)				\
	((AF_INET == family)					\
	     ? any_interface					\
	     : any6_interface)

/* choose a default interface for addresses' protocol (addr family) */
#define ANY_INTERFACE_CHOOSE(psau)				\
	ANY_INTERFACE_BYFAM(AF(psau))


/*
 * We tell reference clocks from real peers by giving the reference
 * clocks an address of the form 127.127.t.u, where t is the type and
 * u is the unit number.  We define some of this here since we will need
 * some sanity checks to make sure this address isn't interpretted as
 * that of a normal peer.
 */
#define	REFCLOCK_ADDR	0x7f7f0000	/* 127.127.0.0 */
#define	REFCLOCK_MASK	0xffff0000	/* 255.255.0.0 */

#ifdef REFCLOCK
#define	ISREFCLOCKADR(srcadr)					\
	(IS_IPV4(srcadr) &&					\
	 (SRCADR(srcadr) & REFCLOCK_MASK) == REFCLOCK_ADDR)
#else
#define ISREFCLOCKADR(srcadr)		(0)
#endif

/*
 * Macro for checking for invalid addresses.  This is really, really
 * gross, but is needed so no one configures a host on net 127 now that
 * we're encouraging it the the configuration file.
 */
#define	LOOPBACKADR	0x7f000001
#define	LOOPNETMASK	0xff000000

#define	ISBADADR(srcadr)					\
	(IS_IPV4(srcadr)					\
	 && ((SRCADR(srcadr) & LOOPNETMASK)			\
	     == (LOOPBACKADR & LOOPNETMASK))			\
	 && SRCADR(srcadr) != LOOPBACKADR)


#endif /* NTP_NET_H */
ntp-4.2.6p5/include/ntp_calendar.h0000644000175000017500000000617011307651603016045 0ustar  peterpeter/*
 * ntp_calendar.h - definitions for the calendar time-of-day routine
 */
#ifndef NTP_CALENDAR_H
#define NTP_CALENDAR_H

#include "ntp_types.h"

struct calendar {
	u_short year;		/* year (A.D.) */
	u_short yearday;	/* day of year, 1 = January 1 */
	u_char month;		/* month, 1 = January */
	u_char monthday;	/* day of month */
	u_char hour;		/* hour of day, midnight = 0 */
	u_char minute;		/* minute of hour */
	u_char second;		/* second of minute */
};

/*
 * Days in each month.  30 days hath September...
 */
#define	JAN	31
#define	FEB	28
#define	FEBLEAP	29
#define	MAR	31
#define	APR	30
#define	MAY	31
#define	JUN	30
#define	JUL	31
#define	AUG	31
#define	SEP	30
#define	OCT	31
#define	NOV	30
#define	DEC	31

/*
 * We deal in a 4 year cycle starting at March 1, 1900.  We assume
 * we will only want to deal with dates since then, and not to exceed
 * the rollover day in 2036.
 */
#define	SECSPERMIN	(60)			/* seconds per minute */
#define	MINSPERHR	(60)			/* minutes per hour */
#define	HRSPERDAY	(24)			/* hours per day */
#define	DAYSPERYEAR	(365)			/* days per year */

#define	SECSPERDAY	(SECSPERMIN*MINSPERHR*HRSPERDAY)
#define	SECSPERYEAR	(365 * SECSPERDAY)	/* regular year */
#define	SECSPERLEAPYEAR	(366 * SECSPERDAY)	/* leap year */

#define	MAR1900		((JAN+FEB) * SECSPERDAY) /* no leap year in 1900 */
#define	DAYSPERCYCLE	(365+365+365+366)	/* 3 normal years plus leap */
#define	SECSPERCYCLE	(DAYSPERCYCLE*SECSPERDAY)
#define	YEARSPERCYCLE	4

/*
 * Gross hacks.  I have illicit knowlege that there won't be overflows
 * here, the compiler often can't tell this.
 */
#define	TIMES60(val)	((((val)<<4) - (val))<<2)	/* *(16 - 1) * 4 */
#define	TIMES24(val)	(((val)<<4) + ((val)<<3))	/* *16 + *8 */
#define	TIMES7(val)	(((val)<<3) - (val))		/* *8  - *1 */
#define	TIMESDPERC(val)	(((val)<<10) + ((val)<<8) \
			+ ((val)<<7) + ((val)<<5) \
			+ ((val)<<4) + ((val)<<2) + (val))	/* *big* hack */

/*
 * Another big hack.  Cycle 22 started on March 1, 1988.  This is
 * STARTCYCLE22 seconds after the start of cycle 0.
 */
#define	CYCLE22		(22)
#define	STARTCYCLE22	(u_long)(0xa586b500)	/* 2777068800 */
#define	MAR1988		(u_long)(STARTCYCLE22 + (u_long)MAR1900)

/*
 * The length of January + February in leap and non-leap years.
 */
#define	JANFEBNOLEAP	((JAN+FEB) * SECSPERDAY)
#define	JANFEBLEAP	((JAN+FEBLEAP) * SECSPERDAY)


extern	void	caljulian	(u_long, struct calendar *);
extern	u_long	caltontp	(const struct calendar *);

/*
 * Additional support stuff for Ed Rheingold's calendrical calculations
 */

/*
 * Start day of NTP time as days past the imaginary date 12/1/1 BC.
 * (This is the beginning of the Christian Era, or BCE.)
 */
#define	DAY_NTP_STARTS 693596
/*
 * The Gregorian calendar is based on a 400 year cycle.  This is the number
 * of days in each cycle.
 */
#define	GREGORIAN_CYCLE_DAYS 146097

/*
 * Days in a normal 100 year leap year calendar.  We lose a leap year day
 * in years evenly divisible by 100 but not by 400.
 */
#define	GREGORIAN_NORMAL_CENTURY_DAYS 36524

/*
 * Days in a normal 4 year leap year calendar cycle.
 */
#define	GREGORIAN_NORMAL_LEAP_CYCLE_DAYS 1461

#define	is_leapyear(y)	(!((y) % 4) && !(!((y) % 100) && (y) % 400))

#endif
ntp-4.2.6p5/include/lib_strbuf.h0000644000175000017500000000106411307651603015543 0ustar  peterpeter/*
 * lib_strbuf.h - definitions for routines which use the common string buffers
 */

#include 

/*
 * Sizes of things
 */
#define	LIB_NUMBUFS	200
#define	LIB_BUFLENGTH	80

/*
 * Macro to get a pointer to the next buffer
 */
#define	LIB_GETBUF(buf) \
	do { \
		if (!lib_inited) \
			init_lib(); \
		buf = &lib_stringbuf[lib_nextbuf][0]; \
		if (++lib_nextbuf >= LIB_NUMBUFS) \
			lib_nextbuf = 0; \
		memset(buf, 0, LIB_BUFLENGTH); \
	} while (0)

extern char lib_stringbuf[LIB_NUMBUFS][LIB_BUFLENGTH];
extern int lib_nextbuf;
extern int lib_inited;
ntp-4.2.6p5/include/Makefile.am0000644000175000017500000000216311505336024015271 0ustar  peterpeterNULL =
AUTOMAKE_OPTIONS = 
ETAGS_ARGS = $(srcdir)/Makefile.am
EXTRA_DIST = autogen-version.def copyright.def debug-opt.def homerc.def version.def version.texi

SUBDIRS = isc

noinst_HEADERS =	\
	adjtime.h	\
	audio.h		\
	ascii.h		\
	audio.h		\
	binio.h		\
	gps.h		\
	hopf6039.h	\
	icom.h		\
	ieee754io.h	\
	iosignal.h	\
	l_stdlib.h	\
	lib_strbuf.h	\
	mbg_gps166.h	\
	mx4200.h	\
	ntif.h		\
	ntp.h		\
	ntp_assert.h	\
	ntp_calendar.h	\
	ntp_cmdargs.h	\
	ntp_config.h	\
	ntp_control.h	\
	ntp_crypto.h	\
	ntp_data_structures.h	\
	ntp_datum.h	\
	ntp_debug.h	\
	ntp_filegen.h	\
	ntp_fp.h	\
	ntp_if.h	\
	ntp_intres.h	\
	ntp_io.h	\
	ntp_libopts.h	\
	ntp_lineedit.h	\
	ntp_lists.h	\
	ntp_machine.h	\
	ntp_malloc.h	\
	ntp_md5.h	\
	ntp_net.h	\
	ntp_proto.h	\
	ntp_random.h	\
	ntp_refclock.h	\
	ntp_request.h	\
	ntp_rfc2553.h	\
	ntp_select.h	\
	ntp_sprintf.h	\
	ntp_stdlib.h	\
	ntp_string.h	\
	ntp_syscall.h	\
	ntp_syslog.h	\
	ntp_tty.h	\
	ntp_types.h	\
	ntp_unixtime.h	\
	ntpd.h		\
	ntpsim.h	\
	parse.h		\
	parse_conf.h	\
	recvbuff.h	\
	refclock_atom.h	\
	ssl_applink.c	\
	timepps-SCO.h	\
	timepps-Solaris.h	\
	timepps-SunOS.h	\
	trimble.h	\
	$(NULL)

ntp-4.2.6p5/include/ntp_debug.h0000644000175000017500000000066111164123367015363 0ustar  peterpeter/*
 * $Header$
 *
 * $Created: Sat Aug 20 14:23:01 2005 $
 *
 * Copyright (C) 2005 by Frank Kardel
 */
#ifndef NTP_DEBUG_H
#define NTP_DEBUG_H

/*
 * macros for debugging output - cut down on #ifdef pollution in the code
 */

#ifdef DEBUG
#define DPRINTF(_lvl_, _arg_)				\
	do { 						\
		if (debug >= (_lvl_))			\
			printf _arg_;			\
	} while (0)
#else
#define DPRINTF(_lvl_, _arg_)	do {} while (0)
#endif

#endif
/*
 * $Log$
 */
ntp-4.2.6p5/include/README0000644000175000017500000000023510017034541014107 0ustar  peterpeterREADME file for directory ./include of the NTP Version 4 distribution

This directory contains the include files used by most programs in this
distribution.
ntp-4.2.6p5/include/iosignal.h0000644000175000017500000000075311307651604015222 0ustar  peterpeter#if !defined _ntp_iosignaled_h
#define _ntp_iosignaled_h

#include "ntp_refclock.h"

#if defined(HAVE_SIGNALED_IO)
extern void		block_sigio	(void);
extern void		unblock_sigio	(void);
extern int		init_clock_sig	(struct refclockio *);
extern void		init_socket_sig	(int);
extern void		set_signal	(void);
RETSIGTYPE		sigio_handler	(int);

# define BLOCKIO()	block_sigio()
# define UNBLOCKIO()	unblock_sigio()

#else

# define BLOCKIO()
# define UNBLOCKIO()
#endif /* HAVE_SIGNALED_IO */

#endif
ntp-4.2.6p5/include/autogen-version.def0000644000175000017500000000011211564122255017036 0ustar  peterpeter#assert (version-compare >= autogen-version "5.11.9")
guard-option-names;
ntp-4.2.6p5/include/mbg_gps166.h0000644000175000017500000006224711334231164015271 0ustar  peterpeter/*
 * /src/NTP/REPOSITORY/ntp4-dev/include/mbg_gps166.h,v 4.7 2006/06/22 18:41:43 kardel RELEASE_20060622_A
 *
 * mbg_gps166.h,v 4.7 2006/06/22 18:41:43 kardel RELEASE_20060622_A
 *
 * $Created: Sun Jul 20 09:20:50 1997 $
 *
 * File GPSSERIO.H Copyright (c) by Meinberg Funkuhren (www.meinberg.de)
 *
 * Linkage to PARSE:
 * Copyright (c) 1997-2005 by Frank Kardel  ntp.org>
 *
 * 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.
 * 3. Neither the name of the author nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * 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.
 *
 */
#ifndef MBG_GPS166_H
#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.                                                             */
/*                                                                         */
/***************************************************************************/

/* 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 */

#define GPS_CTRL_MSK  0xF000   /* masks control code from command */


/* The codes below specify commands/types of data to be supplied to GPS166: */

/*                            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 */

  /* 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 */
};

/*
 * modelled after GPSDEFS.H Revision 1.5
 */
/***************************************************************************/
/*                                                                         */
/*   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 */

#ifndef _CSUM_DEFINED
  typedef unsigned short CSUM;
#  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;
} 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 */
} 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;

#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 */


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. */

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. */

#ifndef _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;

  /* 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 _TM_DEFINED
#endif


/* the status flags below are defined starting with rev. 1.32 */

#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 */

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;



/* Two types of variables used to store a position. Type XYZ is */
/* used with a position in earth centered, earth fixed (ECEF) */
/* coordinates whereas type LLA holds such a position converted */
/* 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 };

  /* a type of array holding a cartesian position */
  typedef l_fp XYZ[N_XYZ];      /* values are in [m] */

#  define _XYZ_DEFINED
#endif


#ifndef _LLA_DEFINED
  /* sequence and number of components of a geographic position */
  enum { LAT, LON, ALT, N_LLA };  /* latitude, longitude, altitude */

  /* 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

/* 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. */

/* 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. */

/* 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) */

/* 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   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;



/* Time zone/daylight saving parameters. */

/* 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. */

#define DL_AUTO_FLAG  0x8000

/* 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 */




/* 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. */

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;


/* 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 */
};


/* Summary of configuration and health data of all SVs. */

typedef struct {
  CSUM csum;               /* checksum of the remaining bytes */
  short valid;             /* flag data are valid */

  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 */

  CFG cfg[N_SVNO];         /* SV configuration from page 63 */
  HEALTH health[N_SVNO];   /* SV health from pages 51, 63 */
} CFGH;



/* UTC correction parameters */

typedef struct {
  CSUM csum;       /*    checksum of the remaining bytes                  */
  short valid;     /*    flag data are valid                              */

  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; /*                                                     */

} UTC;

/* a struct used to hold the settings of a serial port */

#ifndef _COM_PARM_DEFINED
  typedef long BAUD_RATE;

  /* indices used to identify a parameter in the framing string */
  enum { F_DBITS, F_PRTY, F_STBITS };

  /* types of handshake */
  enum { HS_NONE, HS_XONXOFF, HS_RTSCTS };

  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;

#define _COM_PARM_DEFINED
#endif



/* the codes below define what has to comes out of the serial ports */

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 */
     };


#define N_COM   2  /* the number of serial ports */

/* the structure used to store the modes of both serial ports */

typedef struct {
  COM_PARM com[N_COM];    /* COM0 and COM1 settings */
  u_char mode[N_COM];      /* COM0 and COM1 output mode */
} PORT_PARM;

/* 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                              */

  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   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]  */

  u_short URA;      /*    predicted User Range Accuracy                    */

  u_char L2code;    /*    code on L2 channel                         [---] */
  u_char 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] */

  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] */
} ALM;


/* ionospheric correction parameters */

typedef struct {
  CSUM csum;       /*    checksum of the remaining bytes                  */
  short 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   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_tgps_str (char **, T_GPS *, int);
void get_mbg_header (unsigned char **, GPS_MSG_HDR *);
void put_mbg_header (unsigned char **, GPS_MSG_HDR *);
void get_mbg_sw_rev (unsigned char **, SW_REV *);
void get_mbg_ascii_msg (unsigned char **, ASCII_MSG *);
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_ttm (unsigned char **, TTM *);
void get_mbg_synth (unsigned char **, SYNTH *);
void get_mbg_tzdl (unsigned char **, TZDL *);
void get_mbg_antinfo (unsigned char **, ANT_INFO *);
void get_mbg_cfgh (unsigned char **, CFGH *);
void get_mbg_utc (unsigned char **, UTC *);
void get_mbg_lla (unsigned char **, LLA);
void get_mbg_xyz (unsigned char **, XYZ);
void get_mbg_portparam (unsigned char **, PORT_PARM *);
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);

#endif
/*
 * History:
 *
 * mbg_gps166.h,v
 * Revision 4.7  2006/06/22 18:41:43  kardel
 * clean up signedness (gcc 4)
 *
 * Revision 4.6  2005/10/07 22:11:56  kardel
 * bounded buffer implementation
 *
 * Revision 4.5.2.1  2005/09/25 10:23:48  kardel
 * support bounded buffers
 *
 * Revision 4.5  2005/06/25 10:58:45  kardel
 * add missing log keywords
 *
 * Revision 4.1  1998/06/12 15:07:30  kardel
 * fixed prototyping
 *
 * Revision 4.0  1998/04/10 19:50:42  kardel
 * Start 4.0 release version numbering
 *
 * Revision 1.1  1998/04/10 19:27:34  kardel
 * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
 *
 * Revision 1.1  1997/10/06 20:55:38  kardel
 * new parse structure
 *
 */
ntp-4.2.6p5/include/mx4200.h0000644000175000017500000000422710017034542014340 0ustar  peterpeter
/* records transmitted from extern CDU to MX 4200 */
#define PMVXG_S_INITMODEA	0	/* initialization/mode part A */
#define PMVXG_S_INITMODEB	1	/* initialization/mode part B*/
#define PMVXG_S_SATHEALTH	2	/* satellite health control */
#define PMVXG_S_DIFFNAV		3	/* differential navigation control */
#define PMVXG_S_PORTCONF	7	/* control port configuration */
#define PMVXG_S_GETSELFTEST	13	/* self test (request results) */
#define PMVXG_S_RTCMCONF	16	/* RTCM port configuration */
#define PMVXG_S_PASSTHRU	17	/* equipment port pass-thru config */
#define PMVXG_S_RESTART		18	/* restart control */
#define PMVXG_S_OSCPARAM	19	/* oscillator parameter */
#define PMVXG_S_DOSELFTEST	20	/* self test (activate a test) */
#define PMVXG_S_TRECOVCONF	23	/* time recovery configuration */
#define PMVXG_S_RAWDATASEL	24	/* raw data port data selection */
#define PMVXG_S_EQUIPCONF	26	/* equipment port configuration */
#define PMVXG_S_RAWDATACONF	27	/* raw data port configuration */

/* records transmitted from MX 4200 to external CDU */
#define PMVXG_D_STATUS		0	/* status */
#define PMVXG_D_POSITION	1	/* position */
#define PMVXG_D_OPDOPS		3	/* (optimum) DOPs */
#define PMVXG_D_MODEDATA	4	/* mode data */
#define PMVXG_D_SATPRED		5	/* satellite predictions */
#define PMVXG_D_SATHEALTH	6	/* satellite health status */
#define PMVXG_D_UNRECOG		7	/* unrecognized request response */
#define PMVXG_D_SIGSTRLOC	8	/* sig strength & location (sats 1-4) */
#define PMVXG_D_SPEEDHEAD	11	/* speed/heading data */
#define PMVXG_D_OSELFTEST	12	/* (old) self-test results */
#define PMVXG_D_SIGSTRLOC2	18	/* sig strength & location (sats 5-8) */
#define PMVXG_D_OSCPARAM	19	/* oscillator parameter */
#define PMVXG_D_SELFTEST	20	/* self test results */
#define PMVXG_D_PHV		21	/* position, height & velocity */
#define PMVXG_D_DOPS		22	/* DOPs */
#define PMVXG_D_SOFTCONF	30	/* software configuration */
#define PMVXG_D_DIFFGPSMODE	503	/* differential gps moding */
#define PMVXG_D_TRECOVUSEAGE	523	/* time recovery usage */
#define PMVXG_D_RAWDATAOUT	524	/* raw data port data output */
#define PMVXG_D_TRECOVRESULT	828	/* time recovery results */
#define PMVXG_D_TRECOVOUT	830	/* time recovery output message */
ntp-4.2.6p5/include/ntp_rfc2553.h0000644000175000017500000001766511616416167015407 0ustar  peterpeter/*
 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
 * 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.
 * 3. Neither the name of the project nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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.
 */

/*
 * Copyright (c) 1982, 1986, 1990, 1993
 *	The Regents of the University of California.  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.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
 *
 *	@(#)in.h	8.3 (Berkeley) 1/3/94
 */

/*
 * Compatability shims with the rfc2553 API to simplify ntp.
 */
#ifndef NTP_RFC2553_H
#define NTP_RFC2553_H

/*
 * Ensure that we include the configuration file before we check
 * for IPV6
 */
#include 
#include 
#include 

#include "ntp_types.h"


/*
 * If various macros are not defined we need to define them
 */

#ifndef AF_INET6
# define AF_INET6	AF_MAX
# define PF_INET6	AF_INET6
#endif

#if !defined(_SS_MAXSIZE) && !defined(_SS_ALIGNSIZE)

# define	_SS_MAXSIZE	128
# define	_SS_ALIGNSIZE	(sizeof(ntp_uint64_t))
# ifdef ISC_PLATFORM_HAVESALEN
#  define	_SS_PAD1SIZE	(_SS_ALIGNSIZE - sizeof(u_char) - sizeof(ntp_u_int8_t))
#  define	_SS_PAD2SIZE	(_SS_MAXSIZE - sizeof(u_char) - sizeof(ntp_u_int8_t) - \
				_SS_PAD1SIZE - _SS_ALIGNSIZE)
# else
#  define	_SS_PAD1SIZE	(_SS_ALIGNSIZE - sizeof(short))
#  define	_SS_PAD2SIZE	(_SS_MAXSIZE - sizeof(short) - \
				_SS_PAD1SIZE - _SS_ALIGNSIZE)
# endif /* ISC_PLATFORM_HAVESALEN */
#endif

#ifndef INET6_ADDRSTRLEN
# define	INET6_ADDRSTRLEN	46	/* max len of IPv6 addr in ascii */
#endif

/*
 * If we don't have the sockaddr_storage structure
 * we need to define it
 */

#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
struct sockaddr_storage {
#ifdef ISC_PLATFORM_HAVESALEN
	ntp_u_int8_t	ss_len;		/* address length */
	ntp_u_int8_t	ss_family;	/* address family */
#else
	short		ss_family;	/* address family */
#endif
	char		__ss_pad1[_SS_PAD1SIZE];
	ntp_uint64_t	__ss_align;	/* force desired structure storage alignment */
	char		__ss_pad2[_SS_PAD2SIZE];
};
#endif

/*
 * Finally if the platform doesn't support IPv6 we need some
 * additional definitions
 */

/*
 * Flag values for getaddrinfo()
 */
#ifndef AI_PASSIVE
#define	AI_PASSIVE	0x00000001 /* get address to use bind() */
#define	AI_CANONNAME	0x00000002 /* fill ai_canonname */
#define	AI_NUMERICHOST	0x00000004 /* prevent name resolution */
/* valid flags for addrinfo */
#define AI_MASK \
    (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_ADDRCONFIG)

#define	AI_ADDRCONFIG	0x00000400 /* only if any address is assigned */
#endif	/* !AI_PASSIVE */

#ifndef AI_NUMERICHOST		/* such as AIX 4.3 */
# define Z_AI_NUMERICHOST	0
#else
# define Z_AI_NUMERICHOST	AI_NUMERICHOST
#endif

#ifndef AI_NUMERICSERV		/* not in RFC 2553 */
# define Z_AI_NUMERICSERV	0
#else
# define Z_AI_NUMERICSERV	AI_NUMERICSERV
#endif

#ifndef ISC_PLATFORM_HAVEIPV6

#ifdef SYS_WINNT
# define in6_addr in_addr6
#endif

struct addrinfo {
	int	ai_flags;	/* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
	int	ai_family;	/* PF_xxx */
	int	ai_socktype;	/* SOCK_xxx */
	int	ai_protocol;	/* 0 or IPPROTO_xxx for IPv4 and IPv6 */
	size_t	ai_addrlen;	/* length of ai_addr */
	char	*ai_canonname;	/* canonical name for hostname */
	struct	sockaddr *ai_addr;	/* binary address */
	struct	addrinfo *ai_next;	/* next structure in linked list */
};

/*
 * Error return codes from getaddrinfo()
 */
#define	EAI_ADDRFAMILY	 1	/* address family for hostname not supported */
#define	EAI_AGAIN	 2	/* temporary failure in name resolution */
#define	EAI_BADFLAGS	 3	/* invalid value for ai_flags */
#define	EAI_FAIL	 4	/* non-recoverable failure in name resolution */
#define	EAI_FAMILY	 5	/* ai_family not supported */
#define	EAI_MEMORY	 6	/* memory allocation failure */
#define	EAI_NODATA	 7	/* no address associated with hostname */
#define	EAI_NONAME	 8	/* hostname nor servname provided, or not known */
#define	EAI_SERVICE	 9	/* servname not supported for ai_socktype */
#define	EAI_SOCKTYPE	10	/* ai_socktype not supported */
#define	EAI_SYSTEM	11	/* system error returned in errno */
#define	EAI_BADHINTS	12
#define	EAI_PROTOCOL	13
#define	EAI_MAX		14


int	getaddrinfo (const char *, const char *,
			 const struct addrinfo *, struct addrinfo **);
int	getnameinfo (const struct sockaddr *, u_int, char *,
			 size_t, char *, size_t, int);
void	freeaddrinfo (struct addrinfo *);
char	*gai_strerror (int);

/*
 * Constants for getnameinfo()
 */
#ifndef NI_MAXHOST
#define	NI_MAXHOST	1025
#define	NI_MAXSERV	32
#endif

/*
 * Flag values for getnameinfo()
 */
#ifndef NI_NUMERICHOST
#define	NI_NOFQDN	0x00000001
#define	NI_NUMERICHOST	0x00000002
#define	NI_NAMEREQD	0x00000004
#define	NI_NUMERICSERV	0x00000008
#define	NI_DGRAM	0x00000010
#define NI_WITHSCOPEID	0x00000020
#endif

#endif /* !ISC_PLATFORM_HAVEIPV6 */

/* 
 * Set up some macros to look for IPv6 and IPv6 multicast
 */

#if defined(ISC_PLATFORM_HAVEIPV6) && defined(WANT_IPV6)
# define INCLUDE_IPV6_SUPPORT
# if defined(IPV6_JOIN_GROUP) && defined(IPV6_LEAVE_GROUP)
#  define INCLUDE_IPV6_MULTICAST_SUPPORT
# endif	/* IPV6 Multicast Support */
#endif  /* IPv6 Support */

#endif /* !NTP_RFC2553_H */
ntp-4.2.6p5/include/ntpd.h0000644000175000017500000004271711665566225014403 0ustar  peterpeter/*
 * ntpd.h - Prototypes for ntpd.
 */

#include "ntp.h"
#include "ntp_debug.h"
#include "ntp_syslog.h"
#include "ntp_select.h"
#include "ntp_malloc.h"
#include "ntp_refclock.h"
#include "recvbuff.h"

/* ntp_config.c */

#define	TAI_1972	10	/* initial TAI offset (s) */
extern	char	*keysdir;	/* crypto keys and leaptable directory */
extern	char *	saveconfigdir;	/* ntpq saveconfig output directory */

extern	void	getconfig	(int, char **);
extern	void	ctl_clr_stats	(void);
extern	int	ctlclrtrap	(sockaddr_u *, struct interface *, int);
extern	u_short ctlpeerstatus	(struct peer *);
extern	int	ctlsettrap	(sockaddr_u *, struct interface *, int, int);
extern	u_short ctlsysstatus	(void);
extern	void	init_control	(void);
extern	void	init_logging	(char const *, int);
extern	void	setup_logfile	(void);
extern	void	process_control (struct recvbuf *, int);
extern	void	report_event	(int, struct peer *, const char *);

/* ntp_control.c */
/*
 * Structure for translation tables between internal system
 * variable indices and text format.
 */
struct ctl_var {
	u_short code;
	u_short flags;
	char *text;
};
/*
 * Flag values
 */
#define	CAN_READ	0x01
#define	CAN_WRITE	0x02

#define DEF		0x20
#define	PADDING		0x40
#define	EOV		0x80

#define	RO	(CAN_READ)
#define	WO	(CAN_WRITE)
#define	RW	(CAN_READ|CAN_WRITE)

extern  char *  add_var (struct ctl_var **, u_long, u_short);
extern  void    free_varlist (struct ctl_var *);
extern  void    set_var (struct ctl_var **, const char *, u_long, u_short);
extern  void    set_sys_var (const char *, u_long, u_short);

/* ntp_intres.c */
extern	void	ntp_res_name	(sockaddr_u, u_short);
extern	void	ntp_res_recv	(void);
extern	void	ntp_intres	(void);
#ifdef SYS_WINNT
extern	unsigned WINAPI	ntp_intres_thread	(void *);
#endif

/* ntp_io.c */
typedef struct interface_info {
	endpt *	ep;
	u_char	action;
} interface_info_t;

typedef void	(*interface_receiver_t)	(void *, interface_info_t *);

extern  int	disable_dynamic_updates;

extern	void	interface_enumerate	(interface_receiver_t, void *);
extern	endpt *	findinterface		(sockaddr_u *);
extern	endpt *	findbcastinter		(sockaddr_u *);
extern	void	enable_broadcast	(endpt *, sockaddr_u *);
extern	void	enable_multicast_if	(endpt *, sockaddr_u *);
extern	void	interface_update	(interface_receiver_t, void *);

extern	void	init_io 	(void);
extern	void	io_open_sockets	(void);
extern	void	input_handler	(l_fp *);
extern	void	io_clr_stats	(void);
extern	void	io_setbclient	(void);
extern	void	io_unsetbclient	(void);
extern	void	io_multicast_add(sockaddr_u *);
extern	void	io_multicast_del(sockaddr_u *);
extern	void	sendpkt 	(sockaddr_u *, struct interface *, int, struct pkt *, int);
#ifndef SYS_WINNT
extern	void	kill_asyncio	(int);
#endif
#ifdef DEBUG
extern	void	collect_timing  (struct recvbuf *, const char *, int, l_fp *);
#endif
#ifdef HAVE_SIGNALED_IO
extern	void	wait_for_signal		(void);
extern	void	unblock_io_and_alarm	(void);
extern	void	block_io_and_alarm	(void);
#define UNBLOCK_IO_AND_ALARM()		unblock_io_and_alarm()
#define BLOCK_IO_AND_ALARM()		block_io_and_alarm()
#else
#define UNBLOCK_IO_AND_ALARM()
#define BLOCK_IO_AND_ALARM()
#endif
#define		latoa(pif)	localaddrtoa(pif)
extern const char * localaddrtoa(endpt *);

/* ntp_loopfilter.c */
extern	void	init_loopfilter(void);
extern	int 	local_clock(struct peer *, double);
extern	void	adj_host_clock(void);
extern	void	loop_config(int, double);
extern	void	huffpuff(void);
extern	u_long	sys_clocktime;
extern	u_int	sys_tai;

/* ntp_monitor.c */
extern	void	init_mon	(void);
extern	void	mon_start	(int);
extern	void	mon_stop	(int);
extern	int	ntp_monitor	(struct recvbuf *, int);
extern  void    ntp_monclearinterface (struct interface *interface);

/* ntp_peer.c */
extern	void	init_peer	(void);
extern	struct peer *findexistingpeer (sockaddr_u *, struct peer *, int, u_char);
extern	struct peer *findpeer	(struct recvbuf *, int, int *);
extern	struct peer *findpeerbyassoc (u_int);
extern  void	set_peerdstadr	(struct peer *peer, struct interface *interface);
extern	struct peer *newpeer	(sockaddr_u *, struct interface *, int, int, int, int, u_int, u_char, int, keyid_t);
extern	void	peer_all_reset	(void);
extern	void	peer_clr_stats	(void);
extern	struct peer *peer_config (sockaddr_u *, struct interface *, int, int, int, int, u_int, int, keyid_t, u_char *);
extern	void	peer_reset	(struct peer *);
extern	void	refresh_all_peerinterfaces (void);
extern	void	unpeer		(struct peer *);
extern	void	clear_all	(void);
extern	int	score_all	(struct peer *);
extern	struct	peer *findmanycastpeer	(struct recvbuf *);

/* ntp_crypto.c */
#ifdef OPENSSL
extern	int	crypto_recv	(struct peer *, struct recvbuf *);
extern	int	crypto_xmit	(struct peer *, struct pkt *,
				    struct recvbuf *, int,
				    struct exten *, keyid_t);
extern	keyid_t	session_key	(sockaddr_u *, sockaddr_u *, keyid_t,
				    keyid_t, u_long);
extern	int	make_keylist	(struct peer *, struct interface *);
extern	void	key_expire	(struct peer *);
extern	void	crypto_update	(void);
extern	void	crypto_config	(int, char *);
extern	void	crypto_setup	(void);
extern	u_int	crypto_ident	(struct peer *);
extern	struct exten *crypto_args (struct peer *, u_int, associd_t, char *);
extern	int	crypto_public	(struct peer *, u_char *, u_int);
extern	void	value_free	(struct value *);
extern	char	*iffpar_file;
extern	EVP_PKEY *iffpar_pkey;
extern	char	*gqpar_file;
extern	EVP_PKEY *gqpar_pkey;
extern	char	*mvpar_file;
extern	EVP_PKEY *mvpar_pkey;
extern struct value tai_leap;
#endif /* OPENSSL */

/* ntp_proto.c */
extern	void	transmit	(struct peer *);
extern	void	receive 	(struct recvbuf *);
extern	void	peer_clear	(struct peer *, char *);
extern	void 	process_packet	(struct peer *, struct pkt *, u_int);
extern	void	clock_select	(void);

extern	int	leap_tai;	/* TAI at next leap */
extern	u_long	leap_sec;	/* next scheduled leap from file */
extern	u_long	leap_peers;	/* next scheduled leap from peers */
extern	u_long	leapsec;	/* seconds to next leap */
extern	u_long	leap_expire;	/* leap information expiration */
extern	int	sys_orphan;
extern	double	sys_mindisp;
extern	double	sys_maxdist;

/*
 * there seems to be a bug in the IRIX 4 compiler which prevents
 * u_char from beeing used in prototyped functions.
 * This is also true AIX compiler.
 * So give up and define it to be int. WLJ
 */
extern	void	poll_update (struct peer *, int);

extern	void	clear		(struct peer *);
extern	void	clock_filter	(struct peer *, double, double, double);
extern	void	init_proto	(void);
extern	void	proto_config	(int, u_long, double, sockaddr_u *);
extern	void	proto_clr_stats (void);

#ifdef	REFCLOCK
/* ntp_refclock.c */
extern	int	refclock_newpeer (struct peer *);
extern	void	refclock_unpeer (struct peer *);
extern	void	refclock_receive (struct peer *);
extern	void	refclock_transmit (struct peer *);
extern	void	init_refclock	(void);
#endif	/* REFCLOCK */

/* ntp_request.c */
extern	void	init_request	(void);
extern	void	process_private (struct recvbuf *, int);

/* ntp_restrict.c */
extern	void	init_restrict	(void);
extern	u_short	restrictions	(sockaddr_u *);
extern	void	hack_restrict	(int, sockaddr_u *, sockaddr_u *, u_short, u_short);

/* ntp_timer.c */
extern	void	init_timer	(void);
extern	void	reinit_timer	(void);
extern	void	timer		(void);
extern	void	timer_clr_stats (void);
extern  void    timer_interfacetimeout (u_long);
extern  volatile int interface_interval;
#ifdef OPENSSL
extern	char	*sys_hostname;	/* host name */
extern	char	*sys_groupname;	/* group name */
extern	char	*group_name;	/* group name */
extern u_long	sys_revoke;	/* keys revoke timeout */
extern u_long	sys_automax;	/* session key timeout */
#endif /* OPENSSL */

/* ntp_util.c */
extern	void	init_util	(void);
extern	void	write_stats	(void);
extern	void	stats_config	(int, const char *);
extern	void	record_peer_stats (sockaddr_u *, int, double, double, double, double);
extern	void	record_proto_stats (char *);
extern	void	record_loop_stats (double, double, double, double, int);
extern	void	record_clock_stats (sockaddr_u *, const char *);
extern	void	record_raw_stats (sockaddr_u *, sockaddr_u *, l_fp *, l_fp *, l_fp *, l_fp *);
extern	u_long	leap_month(u_long);
extern	void	record_crypto_stats (sockaddr_u *, const char *);
#ifdef DEBUG
extern	void	record_timing_stats (const char *);
#endif
extern  u_short	sock_hash (sockaddr_u *);
extern	char *	fstostr(time_t);	/* NTP timescale seconds */
extern	double	old_drift;
extern	int	drift_file_sw;
extern	double	wander_threshold;
extern	double	wander_resid;

/*
 * Variable declarations for ntpd.
 */
/* ntp_config.c */
extern char const *	progname;
extern char	*sys_phone[];		/* ACTS phone numbers */
#if defined(HAVE_SCHED_SETSCHEDULER)
extern int	config_priority_override;
extern int	config_priority;
#endif
extern char *ntp_signd_socket;
extern struct config_tree *cfg_tree_history;

#ifdef BC_LIST_FRAMEWORK_NOT_YET_USED
/*
 * backwards compatibility flags
 */
typedef struct bc_entry_tag {
	int	token;
	int	enabled;
} bc_entry;

extern bc_entry bc_list[];
#endif

/* ntp_control.c */
extern int	num_ctl_traps;
extern keyid_t	ctl_auth_keyid;		/* keyid used for authenticating write requests */

/*
 * Statistic counters to keep track of requests and responses.
 */
extern u_long	ctltimereset;		/* time stats reset */
extern u_long	numctlreq;		/* number of requests we've received */
extern u_long	numctlbadpkts;		/* number of bad control packets */
extern u_long	numctlresponses; 	/* number of resp packets sent with data */
extern u_long	numctlfrags; 		/* number of fragments sent */
extern u_long	numctlerrors;		/* number of error responses sent */
extern u_long	numctltooshort;		/* number of too short input packets */
extern u_long	numctlinputresp; 	/* number of responses on input */
extern u_long	numctlinputfrag; 	/* number of fragments on input */
extern u_long	numctlinputerr;		/* number of input pkts with err bit set */
extern u_long	numctlbadoffset; 	/* number of input pkts with nonzero offset */
extern u_long	numctlbadversion;	/* number of input pkts with unknown version */
extern u_long	numctldatatooshort;	/* data too short for count */
extern u_long	numctlbadop; 		/* bad op code found in packet */
extern u_long	numasyncmsgs;		/* number of async messages we've sent */

/* ntp_intres.c */
extern keyid_t	req_keyid;		/* request keyid */
extern int	req_keytype;		/* OpenSSL NID such as NID_md5 */
extern size_t	req_hashlen;		/* digest size for req_keytype */
extern char *	req_file;		/* name of the file with configuration info */
#ifdef SYS_WINNT
extern HANDLE ResolverEventHandle;
#else
extern int resolver_pipe_fd[2];  /* used to let the resolver process alert the parent process */
#endif /* SYS_WINNT */

/*
 * Other statistics of possible interest
 */
extern volatile u_long packets_dropped;	/* total number of packets dropped on reception */
extern volatile u_long packets_ignored;	/* packets received on wild card interface */
extern volatile u_long packets_received;/* total number of packets received */
extern u_long	packets_sent;		/* total number of packets sent */
extern u_long	packets_notsent; 	/* total number of packets which couldn't be sent */

extern volatile u_long handler_calls;	/* number of calls to interrupt handler */
extern volatile u_long handler_pkts;	/* number of pkts received by handler */
extern u_long	io_timereset;		/* time counters were reset */

/*
 * Interface stuff
 */
extern endpt *	any_interface;		/* IPv4 wildcard */
extern endpt *	any6_interface;		/* IPv6 wildcard */
extern endpt *	loopback_interface;	/* IPv4 loopback for refclocks */

/*
 * File descriptor masks etc. for call to select
 */
extern fd_set	activefds;
extern int	maxactivefd;

/* 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_panic;		/* max offset before panic (s) */
extern double	clock_phi;		/* dispersion rate (s/s) */
extern double	clock_minstep;		/* step timeout (s) */
extern double	clock_codec;		/* codec frequency */
#ifdef KERNEL_PLL
extern int	pll_status;		/* status bits for kernel pll */
#endif /* KERNEL_PLL */

/*
 * Clock state machine control flags
 */
extern int	ntp_enable;		/* clock discipline enabled */
extern int	pll_control;		/* kernel support available */
extern int	kern_enable;		/* kernel support enabled */
extern int	pps_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	peer_ntpdate;		/* count of ntpdate peers */

/*
 * Clock state machine variables
 */
extern u_char	sys_poll;		/* system poll interval (log2 s) */
extern int	state;			/* clock discipline state */
extern int	tc_counter;		/* poll-adjust counter */
extern u_long	last_time;		/* time of last clock update (s) */
extern double	last_offset;		/* last clock offset (s) */
extern u_char	allan_xpt;		/* Allan intercept (log2 s) */
extern double	clock_jitter;		/* clock jitter (s) */
extern double	sys_offset;		/* system offset (s) */
extern double	sys_jitter;		/* system jitter (s) */

/* ntp_monitor.c */
extern struct mon_data mon_mru_list;
extern struct mon_data mon_fifo_list;
extern int	mon_enabled;

/* ntp_peer.c */
extern struct peer *peer_hash[];	/* peer hash table */
extern int	peer_hash_count[];	/* count of peers in each bucket */
extern struct peer *assoc_hash[];	/* association ID hash table */
extern int	assoc_hash_count[];
extern int	peer_free_count;

/*
 * Miscellaneous statistic counters which may be queried.
 */
extern u_long	peer_timereset;		/* time stat counters were zeroed */
extern u_long	findpeer_calls;		/* number of calls to findpeer */
extern u_long	assocpeer_calls;	/* number of calls to findpeerbyassoc */
extern u_long	peer_allocations;	/* number of allocations from the free list */
extern u_long	peer_demobilizations;	/* number of structs freed to free list */
extern int	total_peer_structs;	/* number of peer structs in circulation */
extern int	peer_associations;	/* mobilized associations */
extern int	peer_preempt;		/* preemptable associations */
/* ntp_proto.c */
/*
 * System variables are declared here.	See Section 3.2 of the
 * specification.
 */
extern u_char	sys_leap;		/* system leap indicator */
extern u_char	sys_stratum;		/* system stratum */
extern s_char	sys_precision;		/* local clock precision */
extern double	sys_rootdelay;		/* roundtrip delay to primary source */
extern double	sys_rootdisp;		/* dispersion to primary source */
extern u_int32	sys_refid;		/* reference id */
extern l_fp	sys_reftime;		/* last update time */
extern struct peer *sys_peer;		/* current peer */

/*
 * Nonspecified system state variables.
 */
extern int	sys_bclient;		/* we set our time to broadcasts */
extern double	sys_bdelay; 		/* broadcast client default delay */
extern int	sys_authenticate;	/* requre authentication for config */
extern l_fp	sys_authdelay;		/* authentication delay */
extern keyid_t	sys_private;		/* private value for session seed */
extern int	sys_manycastserver;	/* respond to manycast client pkts */
extern int	sys_minclock;		/* minimum survivors */
extern int	sys_minsane;		/* minimum candidates */
extern int	sys_floor;		/* cluster stratum floor */
extern int	sys_ceiling;		/* cluster stratum ceiling */
extern u_char	sys_ttl[MAX_TTL];	/* ttl mapping vector */
extern int	sys_ttlmax;		/* max ttl mapping vector index */

/*
 * Statistics counters
 */
extern u_long	sys_stattime;		/* time since reset */
extern u_long	sys_received;		/* packets received */
extern u_long	sys_processed;		/* packets for this host */
extern u_long	sys_restricted;	 	/* restricted packets */
extern u_long	sys_newversion;		/* current version  */
extern u_long	sys_oldversion;		/* old version */
extern u_long	sys_restricted;		/* access denied */
extern u_long	sys_badlength;		/* bad length or format */
extern u_long	sys_badauth;		/* bad authentication */
extern u_long	sys_declined;		/* declined */
extern u_long	sys_limitrejected;	/* rate exceeded */
extern u_long	sys_kodsent;		/* KoD sent */

/* ntp_refclock.c */
#ifdef REFCLOCK
#ifdef PPS
extern int	fdpps;			/* pps file descriptor */
#endif /* PPS */
#endif

/* ntp_request.c */
extern keyid_t	info_auth_keyid;	/* keyid used to authenticate requests */

/* ntp_restrict.c */
extern restrict_u *	restrictlist4;	/* IPv4 restriction list */
extern restrict_u *	restrictlist6;	/* IPv6 restriction list */
extern int	ntp_minpkt;
extern int	ntp_minpoll;
extern int	mon_age;		/* monitor preempt age */

/* ntp_timer.c */
extern volatile int alarm_flag;		/* alarm flag */
extern volatile u_long alarm_overflow;
extern u_long	current_time;		/* current time (s) */
extern u_long	timer_timereset;
extern u_long	timer_overflows;
extern u_long	timer_xmtcalls;

/* ntp_util.c */
extern int	stats_control;		/* write stats to fileset? */
extern int	stats_write_period;	/* # of seconds between writes. */
extern double	stats_write_tolerance;

/* ntpd.c */
extern volatile int debug;		/* debugging flag */
extern int	nofork;			/* no-fork flag */
extern int 	initializing;		/* initializing flag */
#ifdef HAVE_DROPROOT
extern int droproot;			/* flag: try to drop root privileges after startup */
extern char *user;			/* user to switch to */
extern char *group;			/* group to switch to */
extern const char *chrootdir;		/* directory to chroot to */
#endif

/* refclock_conf.c */
#ifdef REFCLOCK
/* refclock configuration table */
extern struct refclock * const refclock_conf[];
extern u_char	num_refclock_conf;
#endif

/* ntp_signd.c */
#ifdef HAVE_NTP_SIGND
extern void 
send_via_ntp_signd(
	struct recvbuf *rbufp,	/* receive packet pointer */
	int	xmode,
	keyid_t	xkeyid, 
	int flags,
	struct pkt  *xpkt
	);
#endif
ntp-4.2.6p5/include/gps.h0000644000175000017500000000553410017034542014201 0ustar  peterpeter/****************************************************************************/
/*      gps.h                                                            */     
/*      TrueTime GPS-VME and VME-SG                                     */
/*      VME controller hardware commands and parameters.                */
/*      created 010694 res                                              */
/*      History:        revised for 747i 3/94                           */
/****************************************************************************/


#define GPS_VME "/dev/vme2"    /* the device file for the GPS board */
                               /* change it to whatever yours is */
#define PRIO    120               /* set the realtime priority */
#define NREGS 7                   /* number of registers we will use */

#define GFRZ1   0x0020          /* freeze cmd addr gen reg. 1 */
#define GREG1A  0x0021  /* Gen reg. 1 Word A (units microsec to 0.001 sec) */
#define GREG1B  0x0040  /* Gen reg. 1 Word B (units 0.01 sec to tens sec ) */
#define GREG1C  0x0041  /* Gen reg  1 Word C (units mins and hours) */
#define GREG1D  0x0042  /* Gen reg. 1 Word D (units days and status) */
#define GREG1E  0x0043  /* Gen reg. 1 Word E (units Years ) */
#define GUFRZ1  0x0022  /* unfreeze cmd addr gen reg 1 */

#define MASKDAY 0x0FFF  /* mask for units days */
#define MASKHI  0xFF00
#define MASKLO  0x00FF
/* Use the following ASCII hex values: N(0x004e),S(0x0053),E(0x0045),
        W(0x0057), +(0x002B), - (0x002D)   */

#define LAT1    0x0048  /* Lat (degrees) */
#define LAT2    0x0049  /* Lat (min, sec) */
#define LAT3    0x004A  /* Lat (N/S, tenths sec) */
#define LON1    0x004B  /* Lon (degrees) */
#define LON2    0x004C  /* Lon (min, sec) */
#define LON3    0x004D  /* Lon (E/W, tenths sec) */
#define ELV1    0x004E  /* Elev. (sign, 10,000 and 1000 ) */
#define ELV2    0x004F  /* Elev. (100, 10s, units, and .1) */

#define CFREG1  0x0050  /* config. register 1 */
#define CFREG2  0x00A0  /* config. register 2 */
#define PMODE   0x00A4  /* Position mode */
#define LOCAL   0x0051  /* Local hours offset */
#define RATE    0x0054  /* Pulse rate output select */
#define DAC     0x0055  /* OSC Control (DAC) select */

#define PUMS    0x0056  /* Gen. preset register unit millisec */
#define PMS     0x0057  /* Gen. preset register units hundreds and tens ms */
#define PSEC    0x0058  /* Gen. preset register units tens and unit seconds */
#define PMIN    0x0059  /* Gen. preset register units tens and unit minutes */
#define PHRS    0x005A  /* Gen. preset register units tens and unit hours */
#define PDYS1   0x005B  /* Gen. preset register units tens and unit days */
#define PDYS2   0x005C  /* Gen. preset register units hundreds days */
#define PYRS1   0x005D  /* Gen. preset register units tens and unit years */
#define PYRS2   0x005E  /* Gen. preset reg. units thousands and hundreds yrs */
ntp-4.2.6p5/include/ntp_syslog.h0000644000175000017500000000511511636775106015624 0ustar  peterpeter/*
 * A hack for platforms which require specially built syslog facilities
 */

#ifndef NTP_SYSLOG_H
#define NTP_SYSLOG_H

#include 		/* u_int32 type */

# ifdef VMS
extern void msyslog();
# else
#   ifndef SYS_VXWORKS
#   include 
#   endif
# endif /* VMS */
# include 

extern int syslogit;
extern int msyslog_term;	/* duplicate to stdout/err */
extern FILE *syslog_file;	/* if syslogit is FALSE, log to 
				   this file and not syslog */

#if defined(VMS) || defined (SYS_VXWORKS)
#define	LOG_EMERG	0	/* system is unusable */
#define	LOG_ALERT	1	/* action must be taken immediately */
#define	LOG_CRIT	2	/* critical conditions */
#define	LOG_ERR		3	/* error conditions */
#define	LOG_WARNING	4	/* warning conditions */
#define	LOG_NOTICE	5	/* normal but signification condition */
#define	LOG_INFO	6	/* informational */
#define	LOG_DEBUG	7	/* debug-level messages */
#endif /* VMS || VXWORKS */

/*
 * syslog output control
 */
#define NLOG_INFO		0x00000001
#define NLOG_EVENT		0x00000002
#define NLOG_STATUS		0x00000004
#define NLOG_STATIST		0x00000008

#define NLOG_OSYS			 0 /* offset for system flags */
#define NLOG_SYSMASK		0x0000000F /* system log events */
#define NLOG_SYSINFO		0x00000001 /* system info log events */
#define NLOG_SYSEVENT		0x00000002 /* system events */
#define NLOG_SYSSTATUS		0x00000004 /* system status (sync/unsync) */
#define NLOG_SYSSTATIST		0x00000008 /* system statistics output */

#define NLOG_OPEER			 4 /* offset for peer flags */
#define NLOG_PEERMASK		0x000000F0 /* peer log events */
#define NLOG_PEERINFO		0x00000010 /* peer info log events */
#define NLOG_PEEREVENT		0x00000020 /* peer events */
#define NLOG_PEERSTATUS		0x00000040 /* peer status (sync/unsync) */
#define NLOG_PEERSTATIST	0x00000080 /* peer statistics output */

#define NLOG_OCLOCK			 8 /* offset for clock flags */
#define NLOG_CLOCKMASK		0x00000F00 /* clock log events */
#define NLOG_CLOCKINFO		0x00000100 /* clock info log events */
#define NLOG_CLOCKEVENT		0x00000200 /* clock events */
#define NLOG_CLOCKSTATUS	0x00000400 /* clock status (sync/unsync) */
#define NLOG_CLOCKSTATIST	0x00000800 /* clock statistics output */

#define NLOG_OSYNC			12 /* offset for sync flags */
#define NLOG_SYNCMASK		0x0000F000 /* sync log events */
#define NLOG_SYNCINFO		0x00001000 /* sync info log events */
#define NLOG_SYNCEVENT		0x00002000 /* sync events */
#define NLOG_SYNCSTATUS		0x00004000 /* sync status (sync/unsync) */
#define NLOG_SYNCSTATIST	0x00008000 /* sync statistics output */

extern u_int32 ntp_syslogmask;
#define NLOG(_X_)	if (ntp_syslogmask & (_X_))

#endif /* NTP_SYSLOG_H */
ntp-4.2.6p5/include/ntp_if.h0000644000175000017500000000121310017034543014656 0ustar  peterpeter/*
 * Sockets are not standard.
 * So hide uglyness in include file.
 */
/* was: defined(SYS_CONVEXOS9) */
#if defined(HAVE__SYS_SYNC_QUEUE_H) && defined(HAVE__SYS_SYNC_SEMA_H)
# include "/sys/sync/queue.h"
# include "/sys/sync/sema.h"
#endif

/* was: (defined(SYS_SOLARIS) && !defined(bsd)) || defined(SYS_SUNOS4) */
/* was: defined(SYS_UNIXWARE1) */
#ifdef HAVE_SYS_SOCKIO_H
# include 
#endif

/* was: #if defined(SYS_PTX) || defined(SYS_SINIXM) */
#ifdef HAVE_SYS_STREAM_H
# include 
#endif
#ifdef HAVE_SYS_STROPTS_H
# include 
#endif

#ifdef HAVE_NET_IF_H
# include 
#endif /* HAVE_NET_IF_H */
ntp-4.2.6p5/include/isc/0000755000175000017500000000000011675461355014027 5ustar  peterpeterntp-4.2.6p5/include/isc/Makefile.in0000644000175000017500000003115211675460275016076 0ustar  peterpeter# 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 = include/isc
DIST_COMMON = $(noinst_HEADERS) $(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)/m4/define_dir.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_cacheversion.m4 \
	$(top_srcdir)/m4/ntp_dir_sep.m4 \
	$(top_srcdir)/m4/ntp_lineeditlibs.m4 \
	$(top_srcdir)/m4/ntp_openssl.m4 \
	$(top_srcdir)/m4/ntp_vpathhack.m4 \
	$(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 =
SOURCES =
DIST_SOURCES =
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINSUBDIR = @BINSUBDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
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@
EF_LIBS = @EF_LIBS@
EF_PROGS = @EF_PROGS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_INLINE = @HAVE_INLINE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LCRYPTO = @LCRYPTO@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
LIBOPTS_DIR = @LIBOPTS_DIR@
LIBOPTS_LDADD = @LIBOPTS_LDADD@
LIBPARSE = @LIBPARSE@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
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@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENSSL = @OPENSSL@
OPENSSL_INC = @OPENSSL_INC@
OPENSSL_LIB = @OPENSSL_LIB@
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_SH = @PATH_SH@
PATH_TEST = @PATH_TEST@
POSIX_SHELL = @POSIX_SHELL@
PROPDELAY = @PROPDELAY@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SNMP_CFLAGS = @SNMP_CFLAGS@
SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
SNMP_LIBS = @SNMP_LIBS@
STRIP = @STRIP@
TESTDCF = @TESTDCF@
VERSION = @VERSION@
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_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 = 
AUTOMAKE_OPTIONS = 
ETAGS_ARGS = $(srcdir)/Makefile.am
noinst_HEADERS = \
	mem.h		\
	$(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 include/isc/Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --foreign include/isc/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):

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	set x; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	shift; \
	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  if test $$# -gt 0; then \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      "$$@" $$unique; \
	  else \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      $$unique; \
	  fi; \
	fi
ctags: CTAGS
CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && $(am__cd) $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) "$$here"

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@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 $(HEADERS)
installdirs:
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)

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 distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

html-am:

info: info-am

info-am:

install-data-am:

install-dvi: install-dvi-am

install-dvi-am:

install-exec-am:

install-html: install-html-am

install-html-am:

install-info: install-info-am

install-info-am:

install-man:

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:

.MAKE: install-am install-strip

.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
	clean-libtool ctags distclean distclean-generic \
	distclean-libtool distclean-tags distdir dvi dvi-am html \
	html-am info info-am install install-am install-data \
	install-data-am install-dvi install-dvi-am install-exec \
	install-exec-am install-html install-html-am install-info \
	install-info-am install-man install-pdf install-pdf-am \
	install-ps install-ps-am install-strip installcheck \
	installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-generic \
	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
	uninstall-am


# 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:
ntp-4.2.6p5/include/isc/Makefile.am0000644000175000017500000000014511307651604016051 0ustar  peterpeterNULL =
AUTOMAKE_OPTIONS = 
ETAGS_ARGS = $(srcdir)/Makefile.am

noinst_HEADERS =	\
	mem.h		\
	$(NULL)
ntp-4.2.6p5/include/isc/mem.h0000644000175000017500000000423611505336023014744 0ustar  peterpeter/*
 * libntp local override of isc/mem.h to stub it out.
 *
 * include/isc is searched before any of the lib/isc include
 * directories and should be used only for replacement NTP headers
 * overriding headers of the same name under lib/isc.
 *
 * NOTE: this assumes the system malloc is thread-safe and does
 *	 not use any normal lib/isc locking.
 */

/*
 * Copyright (C) 2004-2009  Internet Systems Consortium, Inc. ("ISC")
 * Copyright (C) 1997-2001  Internet Software Consortium.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

/* $Id: mem.h,v 1.78.120.3 2009/02/11 03:07:01 jinmei Exp $ */

#ifndef ISC_MEM_H
#define ISC_MEM_H 1

#include 

#include 
#include 
#include 
#include 
#include 

#include 


#define ISC_MEM_UNUSED_ARG(a)		((void)(a))

#define isc_mem_allocate(c, cnt)	isc_mem_get(c, cnt)
#define isc_mem_get(c, cnt)		\
	( ISC_MEM_UNUSED_ARG(c),	emalloc(cnt) )

#define isc_mem_reallocate(c, mem, cnt)	\
	( ISC_MEM_UNUSED_ARG(c),	erealloc((mem), cnt) )

#define isc_mem_put(c, mem, cnt)	\
	( ISC_MEM_UNUSED_ARG(cnt),	isc_mem_free(c, (mem)) )

#define isc_mem_free(c, mem)		\
	( ISC_MEM_UNUSED_ARG(c),	free(mem) )

#define isc_mem_strdup(c, str)		\
	( ISC_MEM_UNUSED_ARG(c),	estrdup(str) )

#define isc_mem_attach(src, ptgt)	do { *(ptgt) = (src); } while (0)
#define isc_mem_detach(c)		ISC_MEM_UNUSED_ARG(c)
#define isc_mem_printallactive(s)	fprintf((s), \
					"isc_mem_printallactive() stubbed.\n")

#endif /* ISC_MEM_H */
ntp-4.2.6p5/include/ntp_select.h0000644000175000017500000000205411307651604015551 0ustar  peterpeter/*
 * Not all machines define FD_SET in sys/types.h
 */ 
#ifndef NTP_SELECT_H
#define NTP_SELECT_H

/* Was: (defined(RS6000)||defined(SYS_PTX))&&!defined(_BSD) */
/* Could say: !defined(FD_SET) && defined(HAVE_SYS_SELECT_H) */
#if defined(HAVE_SYS_SELECT_H) && !defined(_BSD)
#ifndef SYS_VXWORKS
#include 
#else
#include 
extern int  select (int width, fd_set *pReadFds, fd_set *pWriteFds,
		    fd_set *pExceptFds, struct timeval *pTimeOut);

#endif
#endif

#if !defined(FD_SET)
#define NFDBITS         32
#define FD_SETSIZE      32
#define FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p)      memset((char *)(p), 0, sizeof(*(p)))
#endif

#if defined(VMS)
typedef struct {
    unsigned int fds_bits[1];
} fd_set;
#endif

#ifdef SYS_WINNT
/* ports/winnt/libntp/setpriority.c */
extern	void	InitSockets(void);
#endif

#endif	/* NTP_SELECT_H */
ntp-4.2.6p5/include/l_stdlib.h0000644000175000017500000001167511307651603015215 0ustar  peterpeter/*
 * Proto types for machines that are not ANSI and POSIX	 compliant.
 * This is optional
 */

#ifndef _l_stdlib_h
#define _l_stdlib_h

#ifdef HAVE_CONFIG_H
#include 
#endif

#ifdef HAVE_STDLIB_H
# include 
#endif

#include 
#include 

/* Needed for speed_t. */
#ifdef HAVE_TERMIOS_H
# include 
#endif

#ifdef HAVE_ERRNO_H
# include 
#endif

#include "ntp_types.h"
#include "ntp_proto.h"

/* Let's try to keep this more or less alphabetized... */

#ifdef DECL_ADJTIME_0
struct timeval;
extern	int	adjtime		(struct timeval *, struct timeval *);
#endif

#ifdef DECL_BCOPY_0
#ifndef bcopy
extern	void	bcopy		(const char *, char *, int);
#endif
#endif

#ifdef DECL_BZERO_0
#ifndef bzero
extern	void	bzero		(char *, int);
#endif
#endif

#ifdef DECL_CFSETISPEED_0
struct termios;
extern	int	cfsetispeed	(struct termios *, speed_t);
extern	int	cfsetospeed	(struct termios *, speed_t);
#endif

extern	char *	getpass		(const char *);

#ifdef DECL_HSTRERROR_0
extern	const char * hstrerror	(int);
#endif

#ifdef DECL_INET_NTOA_0
struct in_addr;
extern	char *	inet_ntoa	(struct in_addr);
#endif

#ifdef DECL_IOCTL_0
extern	int	ioctl		(int, u_long, char *);
#endif

#ifdef DECL_IPC_0
struct sockaddr;
extern	int	bind		(int, struct sockaddr *, int);
extern	int	connect		(int, struct sockaddr *, int);
extern	int	recv		(int, char *, int, int);
extern	int	recvfrom	(int, char *, int, int, struct sockaddr *, int *);
extern	int	send		(int, char *, int, int);
extern	int	sendto		(int, char *, int, int, struct sockaddr *, int);
extern	int	setsockopt	(int, int, int, char *, int);
extern	int	socket		(int, int, int);
#endif

#ifdef DECL_MEMMOVE_0
extern	void *	memmove		(void *, const void *, size_t);
#endif

#ifdef DECL_MEMSET_0
extern	char *	memset		(char *, int, int);
#endif

#ifdef DECL_MKSTEMP_0
extern	int	mkstemp		(char *);
#endif

#ifdef DECL_MKTEMP_0
extern	char   *mktemp		(char *);	
#endif

#ifdef DECL_NLIST_0
struct nlist;
extern int	nlist		(const char *, struct nlist *);
#endif

#ifdef DECL_PLOCK_0
extern	int	plock		(int);
#endif

#ifdef DECL_RENAME_0
extern	int	rename		(const char *, const char *);
#endif

#ifdef DECL_SELECT_0
#ifdef _ntp_select_h
extern	int	select		(int, fd_set *, fd_set *, fd_set *, struct timeval *);
#endif
#endif

#ifdef DECL_SETITIMER_0
struct itimerval;
extern	int	setitimer	(int , struct itimerval *, struct itimerval *);
#endif

#ifdef PRIO_PROCESS
#ifdef DECL_SETPRIORITY_0
extern	int	setpriority	(int, int, int);
#endif
#ifdef DECL_SETPRIORITY_1
extern	int	setpriority	(int, id_t, int);
#endif
#endif

#ifdef DECL_SIGVEC_0
struct sigvec;
extern	int	sigvec		(int, struct sigvec *, struct sigvec *);
#endif

#ifndef HAVE_SNPRINTF
/* PRINTFLIKE3 */
extern	int	snprintf	(char *, size_t, const char *, ...);
#endif

/* HMS: does this need further protection? */
#ifndef HAVE_VSNPRINTF
extern	int	vsnprintf	(char *, size_t, const char *, va_list);
#endif

#ifdef DECL_STDIO_0
#if defined(FILE) || defined(BUFSIZ)
extern	int	_flsbuf		(int, FILE *);
extern	int	_filbuf		(FILE *);
extern	int	fclose		(FILE *);
extern	int	fflush		(FILE *);
extern	int	fprintf		(FILE *, const char *, ...);
extern	int	fscanf		(FILE *, const char *, ...);
extern	int	fputs		(const char *, FILE *);
extern	int	fputc		(int, FILE *);
extern	int	fread		(char *, int, int, FILE *);
extern	void	perror		(const char *);
extern	int	printf		(const char *, ...);
extern	int	setbuf		(FILE *, char *);
# ifdef HAVE_SETLINEBUF
extern	int	setlinebuf	(FILE *);
# endif
extern	int	setvbuf		(FILE *, char *, int, int);
extern	int	scanf		(const char *, ...);
extern	int	sscanf		(const char *, const char *, ...);
extern	int	vfprintf	(FILE *, const char *, ...);
extern	int	vsprintf	(char *, const char *, ...);
#endif
#endif

#ifdef DECL_STIME_0
extern	int	stime		(const time_t *);
#endif

#ifdef DECL_STIME_1
extern	int	stime		(long *);
#endif

#ifdef DECL_STRERROR_0
extern	char *	strerror		(int errnum);
#endif

#ifdef DECL_STRTOL_0
extern	long	strtol		(const char *, char **, int);
#endif

#ifdef DECL_SYSCALL
extern	int	syscall		(int, ...);
#endif

#ifdef DECL_SYSLOG_0
extern	void	closelog	(void);
#ifndef LOG_DAEMON
extern	void	openlog		(const char *, int);
#else
extern	void	openlog		(const char *, int, int);
#endif
extern	int	setlogmask	(int);
extern	void	syslog		(int, const char *, ...);
#endif

#ifdef DECL_TIME_0
extern	time_t	time		(time_t *);
#endif

#ifdef DECL_TIMEOFDAY_0
#ifdef SYSV_TIMEOFDAY
extern	int	gettimeofday	(struct timeval *);
extern	int	settimeofday	(struct timeval *);
#else /* not SYSV_TIMEOFDAY */
struct timezone;
extern	int	gettimeofday	(struct timeval *, struct timezone *);
extern	int	settimeofday	(struct timeval *, void *);
#endif /* not SYSV_TIMEOFDAY */
#endif

#ifdef DECL_TOLOWER_0
extern	int	tolower		(int);
#endif

#ifdef DECL_TOUPPER_0
extern	int	toupper		(int);
#endif

/*
 * Necessary variable declarations.
 */
#ifdef DECL_ERRNO
extern	int	errno;
#endif

#if defined(DECL_H_ERRNO) && !defined(h_errno)
extern	int	h_errno;
#endif

#endif /* l_stdlib_h */
ntp-4.2.6p5/include/ntp_io.h0000644000175000017500000000313711505336022014676 0ustar  peterpeter#ifndef NTP_IO_H
#define NTP_IO_H
/*
 * POSIX says use  to get O_* symbols and 
 * SEEK_SET symbol form .
 */
#ifdef HAVE_CONFIG_H
# include 
#endif

#include 
#ifdef HAVE_UNISTD_H
# include 
#endif
#include 
#ifdef HAVE_SYS_FILE_H
# include 
#endif
#ifdef HAVE_FCNTL_H
# include 
#endif
#if !defined(SEEK_SET) && defined(L_SET)
# define SEEK_SET L_SET
#endif

#ifdef SYS_WINNT
# include 
# include "win32_io.h"
#endif

#include 
#include 

#if defined(HAVE_NETINET_IN_H) && defined(HAVE_NETINET_IP_H)
# include 
# ifdef HAVE_NETINET_IN_SYSTM_H
#  include 
# endif
# include 
#endif

/*
 * Define FNDELAY and FASYNC using O_NONBLOCK and O_ASYNC if we need
 * to (and can).  This is here initially for QNX, but may help for
 * others as well...
 */
#ifndef FNDELAY
# ifdef O_NONBLOCK
#  define FNDELAY O_NONBLOCK
# endif
#endif

#ifndef FASYNC
# ifdef O_ASYNC
#  define FASYNC O_ASYNC
# endif
#endif


/*
 * NIC rule match types
 */
typedef enum {
	MATCH_ALL,
	MATCH_IPV4,
	MATCH_IPV6,
	MATCH_WILDCARD,
	MATCH_IFNAME,
	MATCH_IFADDR
} nic_rule_match;


/*
 * NIC rule actions
 */
typedef enum {
	ACTION_LISTEN,
	ACTION_IGNORE,
	ACTION_DROP
} nic_rule_action;


isc_boolean_t	get_broadcastclient_flag(void);
extern int	is_ip_address(const char *, sockaddr_u *);
extern void	sau_from_netaddr(sockaddr_u *, const isc_netaddr_t *);
extern void add_nic_rule(nic_rule_match match_type, const char *if_name,
			 int prefixlen, nic_rule_action action);

#endif	/* NTP_IO_H */
ntp-4.2.6p5/include/ntp_lineedit.h0000644000175000017500000000037311307651604016071 0ustar  peterpeter
/*
 * ntp_lineedit.h - generic interface to various line editing libs
 */

int		ntp_readline_init(const char *prompt);
void		ntp_readline_uninit(void);

/*
 * strings returned by ntp_readline go home to free()
 */
char *		ntp_readline(int *pcount);

ntp-4.2.6p5/include/copyright.def0000644000175000017500000000106211564122255015726 0ustar  peterpeter/* -*- Mode: Text -*- */

copyright = {
    date  = "1970-2011";
    owner = "David L. Mills and/or others";
    eaddr = "http://bugs.ntp.org, bugs@ntp.org";
    type  = note;
    text  = <<- _EndOfDoc_
	see html/copyright.html

	_EndOfDoc_;
};

long-opts;
config-header  = config.h;
environrc;
no-misuse-usage;

version         = `
eval VERSION=\`sed -e 's/.*,\\[//' -e 's/\\].*//' < ../version.m4\`
[ -z "${VERSION}" ] && echo "Cannot determine VERSION" && kill -TERM $AG_pid
echo $VERSION`;

version-value = '';	/* Don't use -v as a shortcut for --version */
ntp-4.2.6p5/missing0000755000175000017500000002540610377564307013233 0ustar  peterpeter#! /bin/sh
# Common stub for a few missing GNU programs while installing.

scriptversion=2005-06-08.21

# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
#   Free Software Foundation, Inc.
# Originally by Fran,cois Pinard , 1996.

# 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 2, 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.

if test $# -eq 0; then
  echo 1>&2 "Try \`$0 --help' for more information"
  exit 1
fi

run=:

# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
  configure_ac=configure.ac
else
  configure_ac=configure.in
fi

msg="missing on your system"

case "$1" in
--run)
  # Try to run requested program, and just exit if it succeeds.
  run=
  shift
  "$@" && exit 0
  # Exit code 63 means version mismatch.  This often happens
  # when the user try to use an ancient version of a tool on
  # a file that requires a minimum version.  In this case we
  # we should proceed has if the program had been absent, or
  # if --run hadn't been passed.
  if test $? = 63; then
    run=:
    msg="probably too old"
  fi
  ;;

  -h|--h|--he|--hel|--help)
    echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...

Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.

Options:
  -h, --help      display this help and exit
  -v, --version   output version information and exit
  --run           try to run the given command, and emulate it if it fails

Supported PROGRAM values:
  aclocal      touch file \`aclocal.m4'
  autoconf     touch file \`configure'
  autoheader   touch file \`config.h.in'
  automake     touch all \`Makefile.in' files
  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
  flex         create \`lex.yy.c', if possible, from existing .c
  help2man     touch the output file
  lex          create \`lex.yy.c', if possible, from existing .c
  makeinfo     touch the output file
  tar          try tar, gnutar, gtar, then tar without non-portable flags
  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]

Send bug reports to ."
    exit $?
    ;;

  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
    echo "missing $scriptversion (GNU Automake)"
    exit $?
    ;;

  -*)
    echo 1>&2 "$0: Unknown \`$1' option"
    echo 1>&2 "Try \`$0 --help' for more information"
    exit 1
    ;;

esac

# Now exit if we have it, but it failed.  Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
  lex|yacc)
    # Not GNU programs, they don't have --version.
    ;;

  tar)
    if test -n "$run"; then
       echo 1>&2 "ERROR: \`tar' requires --run"
       exit 1
    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
       exit 1
    fi
    ;;

  *)
    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
       # We have it, but it failed.
       exit 1
    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
       # Could not run --version or --help.  This is probably someone
       # running `$TOOL --version' or `$TOOL --help' to check whether
       # $TOOL exists and not knowing $TOOL uses missing.
       exit 1
    fi
    ;;
esac

# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
  aclocal*)
    echo 1>&2 "\
WARNING: \`$1' is $msg.  You should only need it if
         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
         to install the \`Automake' and \`Perl' packages.  Grab them from
         any GNU archive site."
    touch aclocal.m4
    ;;

  autoconf)
    echo 1>&2 "\
WARNING: \`$1' is $msg.  You should only need it if
         you modified \`${configure_ac}'.  You might want to install the
         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
         archive site."
    touch configure
    ;;

  autoheader)
    echo 1>&2 "\
WARNING: \`$1' is $msg.  You should only need it if
         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
         from any GNU archive site."
    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
    test -z "$files" && files="config.h"
    touch_files=
    for f in $files; do
      case "$f" in
      *:*) touch_files="$touch_files "`echo "$f" |
				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
      *) touch_files="$touch_files $f.in";;
      esac
    done
    touch $touch_files
    ;;

  automake*)
    echo 1>&2 "\
WARNING: \`$1' is $msg.  You should only need it if
         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
         You might want to install the \`Automake' and \`Perl' packages.
         Grab them from any GNU archive site."
    find . -type f -name Makefile.am -print |
	   sed 's/\.am$/.in/' |
	   while read f; do touch "$f"; done
    ;;

  autom4te)
    echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
         You might have modified some files without having the
         proper tools for further handling them.
         You can get \`$1' as part of \`Autoconf' from any GNU
         archive site."

    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
    if test -f "$file"; then
	touch $file
    else
	test -z "$file" || exec >$file
	echo "#! /bin/sh"
	echo "# Created by GNU Automake missing as a replacement of"
	echo "#  $ $@"
	echo "exit 0"
	chmod +x $file
	exit 1
    fi
    ;;

  bison|yacc)
    echo 1>&2 "\
WARNING: \`$1' $msg.  You should only need it if
         you modified a \`.y' file.  You may need the \`Bison' package
         in order for those modifications to take effect.  You can get
         \`Bison' from any GNU archive site."
    rm -f y.tab.c y.tab.h
    if [ $# -ne 1 ]; then
        eval LASTARG="\${$#}"
	case "$LASTARG" in
	*.y)
	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
	    if [ -f "$SRCFILE" ]; then
	         cp "$SRCFILE" y.tab.c
	    fi
	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
	    if [ -f "$SRCFILE" ]; then
	         cp "$SRCFILE" y.tab.h
	    fi
	  ;;
	esac
    fi
    if [ ! -f y.tab.h ]; then
	echo >y.tab.h
    fi
    if [ ! -f y.tab.c ]; then
	echo 'main() { return 0; }' >y.tab.c
    fi
    ;;

  lex|flex)
    echo 1>&2 "\
WARNING: \`$1' is $msg.  You should only need it if
         you modified a \`.l' file.  You may need the \`Flex' package
         in order for those modifications to take effect.  You can get
         \`Flex' from any GNU archive site."
    rm -f lex.yy.c
    if [ $# -ne 1 ]; then
        eval LASTARG="\${$#}"
	case "$LASTARG" in
	*.l)
	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
	    if [ -f "$SRCFILE" ]; then
	         cp "$SRCFILE" lex.yy.c
	    fi
	  ;;
	esac
    fi
    if [ ! -f lex.yy.c ]; then
	echo 'main() { return 0; }' >lex.yy.c
    fi
    ;;

  help2man)
    echo 1>&2 "\
WARNING: \`$1' is $msg.  You should only need it if
	 you modified a dependency of a manual page.  You may need the
	 \`Help2man' package in order for those modifications to take
	 effect.  You can get \`Help2man' from any GNU archive site."

    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
    if test -z "$file"; then
	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
    fi
    if [ -f "$file" ]; then
	touch $file
    else
	test -z "$file" || exec >$file
	echo ".ab help2man is required to generate this page"
	exit 1
    fi
    ;;

  makeinfo)
    echo 1>&2 "\
WARNING: \`$1' is $msg.  You should only need it if
         you modified a \`.texi' or \`.texinfo' file, or any other file
         indirectly affecting the aspect of the manual.  The spurious
         call might also be the consequence of using a buggy \`make' (AIX,
         DU, IRIX).  You might want to install the \`Texinfo' package or
         the \`GNU make' package.  Grab either from any GNU archive site."
    # The file to touch is that specified with -o ...
    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
    if test -z "$file"; then
      # ... or it is the one specified with @setfilename ...
      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
      # ... or it is derived from the source name (dir/f.texi becomes f.info)
      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
    fi
    # If the file does not exist, the user really needs makeinfo;
    # let's fail without touching anything.
    test -f $file || exit 1
    touch $file
    ;;

  tar)
    shift

    # We have already tried tar in the generic part.
    # Look for gnutar/gtar before invocation to avoid ugly error
    # messages.
    if (gnutar --version > /dev/null 2>&1); then
       gnutar "$@" && exit 0
    fi
    if (gtar --version > /dev/null 2>&1); then
       gtar "$@" && exit 0
    fi
    firstarg="$1"
    if shift; then
	case "$firstarg" in
	*o*)
	    firstarg=`echo "$firstarg" | sed s/o//`
	    tar "$firstarg" "$@" && exit 0
	    ;;
	esac
	case "$firstarg" in
	*h*)
	    firstarg=`echo "$firstarg" | sed s/h//`
	    tar "$firstarg" "$@" && exit 0
	    ;;
	esac
    fi

    echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
         You may want to install GNU tar or Free paxutils, or check the
         command line arguments."
    exit 1
    ;;

  *)
    echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
         You might have modified some files without having the
         proper tools for further handling them.  Check the \`README' file,
         it often tells you about the needed prerequisites for installing
         this package.  You may also peek at any GNU archive site, in case
         some other package would contain this missing \`$1' program."
    exit 1
    ;;
esac

exit 0

# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
ntp-4.2.6p5/excludes0000644000175000017500000000010110017034517013336 0ustar  peterpeter*.obj *.pch *.bsc *.pdb *.sbr nt*.zip *.tar *.gz *.ilk beta*.zip
ntp-4.2.6p5/README.versions0000644000175000017500000000146110441361167014345 0ustar  peterpeter
NTP uses A.B.C - style release numbers.

At the moment:

 A is 4, for ntp V4.
 B is the major release number.
 C is the minor release number.  Even numbers are 'stable' releases and
 odd numbers are "development" releases.

Following the release number may be the letter 'p' followed by a number.
This indicates a point (or patch) release.

Release candidates have -RC in the release number.

Here are some recent versions numbers as an example:

 4.2.2		A production release (from the ntp-stable repository)
 4.2.2p2	A production release (from the ntp-stable repository)
 4.2.3p12	A development release
 4.2.3p15-rc1	A release candidate for 4.2.4

Note that after the ntp-dev repo produces a production release it will
be copied into the ntp-stable and the cycle will repeat.

Feel free to suggest improvements...

ntp-4.2.6p5/kernel/0000755000175000017500000000000011710605402013065 5ustar  peterpeterntp-4.2.6p5/kernel/tty_clk.c0000644000175000017500000001672110017034550014710 0ustar  peterpeter/* tty_clk.c,v 3.1 1993/07/06 01:07:33 jbj Exp
 * tty_clk.c - Generic line driver for receiving radio clock timecodes
 */

#include "clk.h"
#if NCLK > 0

#include "../h/param.h"
#include "../h/types.h"
#include "../h/systm.h"
#include "../h/dir.h"
#include "../h/user.h"
#include "../h/ioctl.h"
#include "../h/tty.h"
#include "../h/proc.h"
#include "../h/file.h"
#include "../h/conf.h"
#include "../h/buf.h"
#include "../h/uio.h"
#include "../h/clist.h"

/*
 * This line discipline is intended to provide well performing
 * generic support for the reception and time stamping of radio clock
 * timecodes.  Most radio clock devices return a string where a
 * particular character in the code (usually a \r) is on-time
 * synchronized with the clock.  The idea here is to collect characters
 * until (one of) the synchronization character(s) (we allow two) is seen.
 * When the magic character arrives we take a timestamp by calling
 * microtime() and insert the eight bytes of struct timeval into the
 * buffer after the magic character.  We then wake up anyone waiting
 * for the buffer and return the whole mess on the next read.
 *
 * To use this the calling program is expected to first open the
 * port, and then to set the port into raw mode with the speed
 * set appropriately with a TIOCSETP ioctl(), with the erase and kill
 * characters set to those to be considered magic (yes, I know this
 * is gross, but they were so convenient).  If only one character is
 * magic you can set then both the same, or perhaps to the alternate
 * parity versions of said character.  After getting all this set,
 * change the line discipline to CLKLDISC and you are on your way.
 *
 * The only other bit of magic we do in here is to flush the receive
 * buffers on writes if the CRMOD flag is set (hack, hack).
 */

/*
 * We run this very much like a raw mode terminal, with the exception
 * that we store up characters locally until we hit one of the
 * magic ones and then dump it into the rawq all at once.  We keep
 * the buffered data in clists since we can then often move it to
 * the rawq without copying.  For sanity we limit the number of
 * characters between specials, and the total number of characters
 * before we flush the rawq, as follows.
 */
#define	CLKLINESIZE	(256)
#define	NCLKCHARS	(CLKLINESIZE*4)

struct clkdata {
	int inuse;
	struct clist clkbuf;
};
#define	clk_cc	clkbuf.c_cc
#define	clk_cf	clkbuf.c_cf
#define	clk_cl	clkbuf.c_cl

struct clkdata clk_data[NCLK];

/*
 * Routine for flushing the internal clist
 */
#define	clk_bflush(clk)		(ndflush(&((clk)->clkbuf), (clk)->clk_cc))

int clk_debug = 0;

/*ARGSUSED*/
clkopen(dev, tp)
	dev_t dev;
	register struct tty *tp;
{
	register struct clkdata *clk;

	/*
	 * Don't allow multiple opens.  This will also protect us
	 * from someone opening /dev/tty
	 */
	if (tp->t_line == CLKLDISC)
		return (EBUSY);
	ttywflush(tp);
	for (clk = clk_data; clk < &clk_data[NCLK]; clk++)
		if (!clk->inuse)
			break;
	if (clk >= &clk_data[NCLK])
		return (EBUSY);
	clk->inuse++;
	clk->clk_cc = 0;
	clk->clk_cf = clk->clk_cl = NULL;
	tp->T_LINEP = (caddr_t) clk;
	return (0);
}


/*
 * Break down... called when discipline changed or from device
 * close routine.
 */
clkclose(tp)
	register struct tty *tp;
{
	register struct clkdata *clk;
	register int s = spltty();

	clk = (struct clkdata *)tp->T_LINEP;
	if (clk->clk_cc > 0)
		clk_bflush(clk);
	clk->inuse = 0;
	tp->t_line = 0;			/* paranoid: avoid races */
	splx(s);
}


/*
 * Receive a write request.  We pass these requests on to the terminal
 * driver, except that if the CRMOD bit is set in the flags we
 * first flush the input queues.
 */
clkwrite(tp, uio)
	register struct tty *tp;
	struct uio *uio;
{
	if (tp->t_flags & CRMOD) {
		register struct clkdata *clk;
		int s;

		s = spltty();
		if (tp->t_rawq.c_cc > 0)
			ndflush(&tp->t_rawq, tp->t_rawq.c_cc);
		clk = (struct clkdata *) tp->T_LINEP;
		if (clk->clk_cc > 0)
			clk_bflush(clk);
		(void)splx(s);
	}
	ttwrite(tp, uio);
}


/*
 * Low level character input routine.
 * If the character looks okay, grab a time stamp.  If the stuff in
 * the buffer is too old, dump it and start fresh.  If the character is
 * non-BCDish, everything in the buffer too.
 */
clkinput(c, tp)
	register int c;
	register struct tty *tp;
{
	register struct clkdata *clk;
	register int i;
	register long s;
	struct timeval tv;

	/*
	 * Check to see whether this isn't the magic character.  If not,
	 * save the character and return.
	 */
#ifdef ultrix
	if (c != tp->t_cc[VERASE] && c != tp->t_cc[VKILL]) {
#else
	if (c != tp->t_erase && c != tp->t_kill) {
#endif
		clk = (struct clkdata *) tp->T_LINEP;
		if (clk->clk_cc >= CLKLINESIZE)
			clk_bflush(clk);
		if (putc(c, &clk->clkbuf) == -1) {
			/*
			 * Hopeless, no clists.  Flush what we have
			 * and hope things improve.
			 */
			clk_bflush(clk);
		}
		return;
	}

	/*
	 * Here we have a magic character.  Get a timestamp and store
	 * everything.
	 */
	microtime(&tv);
	clk = (struct clkdata *) tp->T_LINEP;

	if (putc(c, &clk->clkbuf) == -1)
		goto flushout;
	
#ifdef CLKLDISC
	/*
	 * STREAMS people started writing timestamps this way.
	 * It's not my fault, I am just going along with the flow...
	 */
	for (i = 0; i < sizeof(struct timeval); i++)
		if (putc(*( ((char*)&tv) + i ), &clk->clkbuf) == -1)
			goto flushout;
#else
	/*
	 * This is a machine independant way of puting longs into
	 * the datastream.  It has fallen into disuse...
	 */
	s = tv.tv_sec;
	for (i = 0; i < sizeof(long); i++) {
		if (putc((s >> 24) & 0xff, &clk->clkbuf) == -1)
			goto flushout;
		s <<= 8;
	}

	s = tv.tv_usec;
	for (i = 0; i < sizeof(long); i++) {
		if (putc((s >> 24) & 0xff, &clk->clkbuf) == -1)
			goto flushout;
		s <<= 8;
	}
#endif

	/*
	 * If the length of the rawq exceeds our sanity limit, dump
	 * all the old crap in there before copying this in.
	 */
	if (tp->t_rawq.c_cc > NCLKCHARS)
		ndflush(&tp->t_rawq, tp->t_rawq.c_cc);
	
	/*
	 * Now copy the buffer in.  There is a special case optimization
	 * here.  If there is nothing on the rawq at present we can
	 * just copy the clists we own over.  Otherwise we must concatenate
	 * the present data on the end.
	 */
	s = (long)spltty();
	if (tp->t_rawq.c_cc <= 0) {
		tp->t_rawq = clk->clkbuf;
		clk->clk_cc = 0;
		clk->clk_cl = clk->clk_cf = NULL;
		(void) splx((int)s);
	} else {
		(void) splx((int)s);
		catq(&clk->clkbuf, &tp->t_rawq);
		clk_bflush(clk);
	}

	/*
	 * Tell the world
	 */
	ttwakeup(tp);
	return;

flushout:
	/*
	 * It would be nice if this never happened.  Flush the
	 * internal clists and hope someone else frees some of them
	 */
	clk_bflush(clk);
	return;
}


/*
 * Handle ioctls.  We reject most tty-style except those that
 * change the line discipline and a couple of others..
 */
clkioctl(tp, cmd, data, flag)
	struct tty *tp;
	int cmd;
	caddr_t data;
	int flag;
{
	int flags;
	struct sgttyb *sg;

	if ((cmd>>8) != 't')
		return (-1);
	switch (cmd) {
	case TIOCSETD:
	case TIOCGETD:
	case TIOCGETP:
	case TIOCGETC:
	case TIOCOUTQ:
		return (-1);

	case TIOCSETP:
		/*
		 * He likely wants to set new magic characters in.
		 * Do this part.
		 */
		sg = (struct sgttyb *)data;
#ifdef ultrix
		tp->t_cc[VERASE] = sg->sg_erase;
		tp->t_cc[VKILL] = sg->sg_kill;
#else
		tp->t_erase = sg->sg_erase;
		tp->t_kill = sg->sg_kill;
#endif
		return (0);

	case TIOCFLUSH:
		flags = *(int *)data;
		if (flags == 0 || (flags & FREAD)) {
			register struct clkdata *clk;

			clk = (struct clkdata *) tp->T_LINEP;
			if (clk->clk_cc > 0)
				clk_bflush(clk);
		}
		return (-1);
	
	default:
		break;
	}
	return (ENOTTY);	/* not quite appropriate */
}
#endif NCLK
ntp-4.2.6p5/kernel/chuinit.c0000644000175000017500000000237410441361226014705 0ustar  peterpeter/*
**	dynamically loadable chu driver
**
**	william robertson   
*/

#include 
#include 
#include 
#include 
#include 

#include 
#include 

extern int findmod();		/* os/str_io.c */

extern struct streamtab chuinfo;

struct vdldrv vd = {
     VDMAGIC_USER,
     "chu"
  };


int
xxxinit(function_code, vdp, vdi, vds)
unsigned int function_code;
struct vddrv *vdp;
addr_t vdi;
struct vdstat *vds;
{
     register int i = 0;
     register int j;

     switch (function_code) {
	case VDLOAD:

	  if (findmod("chu") >= 0) {
	       log(LOG_ERR, "chu stream module already loaded\n");
	       return (EADDRINUSE);
	  }
 
	  i = findmod("\0");

	  if (i == -1 || fmodsw[i].f_name[0] != '\0') 
	    return(-1);

	  for (j = 0; vd.Drv_name[j] != '\0'; j++)	/* XXX check bounds */
	    fmodsw[i].f_name[j] = vd.Drv_name[j];

	  fmodsw[i].f_name[j] = '\0';
	  fmodsw[i].f_str = &chuinfo;

	  vdp->vdd_vdtab = (struct vdlinkage *)  &vd;

	  return(0);

	case VDUNLOAD:
	  if ((i = findmod(vd.Drv_name)) == -1)
	    return(-1);

	  fmodsw[i].f_name[0] = '\0';
	  fmodsw[i].f_str = 0;

	  return(0);
     
	case VDSTAT:
	  return(0);

	default:
	  return(EIO);
     }
}
ntp-4.2.6p5/kernel/Makefile.in0000644000175000017500000004373411675460275015166 0ustar  peterpeter# 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 = kernel
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)/m4/define_dir.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_cacheversion.m4 \
	$(top_srcdir)/m4/ntp_dir_sep.m4 \
	$(top_srcdir)/m4/ntp_lineeditlibs.m4 \
	$(top_srcdir)/m4/ntp_openssl.m4 \
	$(top_srcdir)/m4/ntp_vpathhack.m4 \
	$(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
	html-recursive info-recursive install-data-recursive \
	install-dvi-recursive install-exec-recursive \
	install-html-recursive install-info-recursive \
	install-pdf-recursive install-ps-recursive install-recursive \
	installcheck-recursive installdirs-recursive pdf-recursive \
	ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
  distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
	distdir
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
  dir0=`pwd`; \
  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
  sed_rest='s,^[^/]*/*,,'; \
  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
  sed_butlast='s,/*[^/]*$$,,'; \
  while test -n "$$dir1"; do \
    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
    if test "$$first" != "."; then \
      if test "$$first" = ".."; then \
        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
      else \
        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
        if test "$$first2" = "$$first"; then \
          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
        else \
          dir2="../$$dir2"; \
        fi; \
        dir0="$$dir0"/"$$first"; \
      fi; \
    fi; \
    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
  done; \
  reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINSUBDIR = @BINSUBDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
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@
EF_LIBS = @EF_LIBS@
EF_PROGS = @EF_PROGS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_INLINE = @HAVE_INLINE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LCRYPTO = @LCRYPTO@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
LIBOPTS_DIR = @LIBOPTS_DIR@
LIBOPTS_LDADD = @LIBOPTS_LDADD@
LIBPARSE = @LIBPARSE@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
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@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENSSL = @OPENSSL@
OPENSSL_INC = @OPENSSL_INC@
OPENSSL_LIB = @OPENSSL_LIB@
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_SH = @PATH_SH@
PATH_TEST = @PATH_TEST@
POSIX_SHELL = @POSIX_SHELL@
PROPDELAY = @PROPDELAY@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SNMP_CFLAGS = @SNMP_CFLAGS@
SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
SNMP_LIBS = @SNMP_LIBS@
STRIP = @STRIP@
TESTDCF = @TESTDCF@
VERSION = @VERSION@
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_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@

#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
AUTOMAKE_OPTIONS = 
SUBDIRS = sys
ETAGS_ARGS = Makefile.am
EXTRA_DIST = chuinit.c clkinit.c tty_chu.c tty_chu_STREAMS.c tty_clk.c tty_clk_STREAMS.c
all: all-recursive

.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 kernel/Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --foreign kernel/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):

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs

# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
#     (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
	@fail= failcom='exit 1'; \
	for f in x $$MAKEFLAGS; do \
	  case $$f in \
	    *=* | --[!k]*);; \
	    *k*) failcom='fail=yes';; \
	  esac; \
	done; \
	dot_seen=no; \
	target=`echo $@ | sed s/-recursive//`; \
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  echo "Making $$target in $$subdir"; \
	  if test "$$subdir" = "."; then \
	    dot_seen=yes; \
	    local_target="$$target-am"; \
	  else \
	    local_target="$$target"; \
	  fi; \
	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
	  || eval $$failcom; \
	done; \
	if test "$$dot_seen" = "no"; then \
	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
	fi; test -z "$$fail"

$(RECURSIVE_CLEAN_TARGETS):
	@fail= failcom='exit 1'; \
	for f in x $$MAKEFLAGS; do \
	  case $$f in \
	    *=* | --[!k]*);; \
	    *k*) failcom='fail=yes';; \
	  esac; \
	done; \
	dot_seen=no; \
	case "$@" in \
	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
	  *) list='$(SUBDIRS)' ;; \
	esac; \
	rev=''; for subdir in $$list; do \
	  if test "$$subdir" = "."; then :; else \
	    rev="$$subdir $$rev"; \
	  fi; \
	done; \
	rev="$$rev ."; \
	target=`echo $@ | sed s/-recursive//`; \
	for subdir in $$rev; do \
	  echo "Making $$target in $$subdir"; \
	  if test "$$subdir" = "."; then \
	    local_target="$$target-am"; \
	  else \
	    local_target="$$target"; \
	  fi; \
	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
	  || eval $$failcom; \
	done && test -z "$$fail"
tags-recursive:
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
	done
ctags-recursive:
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
	done

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	set x; \
	here=`pwd`; \
	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
	  include_option=--etags-include; \
	  empty_fix=.; \
	else \
	  include_option=--include; \
	  empty_fix=; \
	fi; \
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    test ! -f $$subdir/TAGS || \
	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
	  fi; \
	done; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	shift; \
	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  if test $$# -gt 0; then \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      "$$@" $$unique; \
	  else \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      $$unique; \
	  fi; \
	fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && $(am__cd) $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) "$$here"

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@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
	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    test -d "$(distdir)/$$subdir" \
	    || $(MKDIR_P) "$(distdir)/$$subdir" \
	    || exit 1; \
	  fi; \
	done
	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
	    $(am__relativize); \
	    new_distdir=$$reldir; \
	    dir1=$$subdir; dir2="$(top_distdir)"; \
	    $(am__relativize); \
	    new_top_distdir=$$reldir; \
	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
	    ($(am__cd) $$subdir && \
	      $(MAKE) $(AM_MAKEFLAGS) \
	        top_distdir="$$new_top_distdir" \
	        distdir="$$new_distdir" \
		am__remove_distdir=: \
		am__skip_length_check=: \
		am__skip_mode_fix=: \
	        distdir) \
	      || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-recursive
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)

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-recursive

clean-am: clean-generic clean-libtool mostlyclean-am

distclean: distclean-recursive
	-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags

dvi: dvi-recursive

dvi-am:

html: html-recursive

html-am:

info: info-recursive

info-am:

install-data-am:

install-dvi: install-dvi-recursive

install-dvi-am:

install-exec-am:

install-html: install-html-recursive

install-html-am:

install-info: install-info-recursive

install-info-am:

install-man:

install-pdf: install-pdf-recursive

install-pdf-am:

install-ps: install-ps-recursive

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-recursive
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-recursive

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-recursive

pdf-am:

ps: ps-recursive

ps-am:

uninstall-am:

.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
	install-am install-strip tags-recursive

.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
	all all-am check check-am clean clean-generic clean-libtool \
	ctags ctags-recursive distclean distclean-generic \
	distclean-libtool distclean-tags distdir dvi dvi-am html \
	html-am info info-am install install-am install-data \
	install-data-am install-dvi install-dvi-am install-exec \
	install-exec-am install-html install-html-am install-info \
	install-info-am install-man install-pdf install-pdf-am \
	install-ps install-ps-am install-strip installcheck \
	installcheck-am installdirs installdirs-am maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-generic \
	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
	uninstall uninstall-am


# 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:
ntp-4.2.6p5/kernel/tty_chu.c0000644000175000017500000001367710017034550014725 0ustar  peterpeter/* tty_chu.c,v 3.1 1993/07/06 01:07:30 jbj Exp
 * tty_chu.c - CHU line driver
 */

#include "chu.h"
#if NCHU > 0

#include "../h/param.h"
#include "../h/types.h"
#include "../h/systm.h"
#include "../h/dir.h"
#include "../h/user.h"
#include "../h/ioctl.h"
#include "../h/tty.h"
#include "../h/proc.h"
#include "../h/file.h"
#include "../h/conf.h"
#include "../h/buf.h"
#include "../h/uio.h"

#include "../h/chudefs.h"

/*
 * Line discipline for receiving CHU time codes.
 * Does elementary noise elimination, takes time stamps after
 * the arrival of each character, returns a buffer full of the
 * received 10 character code and the associated time stamps.
 */
#define	NUMCHUBUFS	3

struct chudata {
	u_char used;		/* Set to 1 when structure in use */
	u_char lastindex;	/* least recently used buffer */
	u_char curindex;	/* buffer to use */
	u_char sleeping;	/* set to 1 when we're sleeping on a buffer */
	struct chucode chubuf[NUMCHUBUFS];
} chu_data[NCHU];

/*
 * Number of microseconds we allow between
 * character arrivals.  The speed is 300 baud
 * so this should be somewhat more than 30 msec
 */
#define	CHUMAXUSEC	(50*1000)	/* 50 msec */

int chu_debug = 0;

/*
 * Open as CHU time discipline.  Called when discipline changed
 * with ioctl, and changes the interpretation of the information
 * in the tty structure.
 */
/*ARGSUSED*/
chuopen(dev, tp)
	dev_t dev;
	register struct tty *tp;
{
	register struct chudata *chu;

	/*
	 * Don't allow multiple opens.  This will also protect us
	 * from someone opening /dev/tty
	 */
	if (tp->t_line == CHULDISC)
		return (EBUSY);
	ttywflush(tp);
	for (chu = chu_data; chu < &chu_data[NCHU]; chu++)
		if (!chu->used)
			break;
	if (chu >= &chu[NCHU])
		return (EBUSY);
	chu->used++;
	chu->lastindex = chu->curindex = 0;
	chu->sleeping = 0;
	chu->chubuf[0].ncodechars = 0;
	tp->T_LINEP = (caddr_t) chu;
	return (0);
}

/*
 * Break down... called when discipline changed or from device
 * close routine.
 */
chuclose(tp)
	register struct tty *tp;
{
	register int s = spl5();

	((struct chudata *) tp->T_LINEP)->used = 0;
	tp->t_cp = 0;
	tp->t_inbuf = 0;
	tp->t_rawq.c_cc = 0;		/* clear queues -- paranoid */
	tp->t_canq.c_cc = 0;
	tp->t_line = 0;			/* paranoid: avoid races */
	splx(s);
}

/*
 * Read a CHU buffer.  Sleep on the current buffer
 */
churead(tp, uio)
	register struct tty *tp;
	struct uio *uio;
{
	register struct chudata *chu;
	register struct chucode *chucode;
	register int s;

	if ((tp->t_state&TS_CARR_ON)==0)
		return (EIO);

	chu = (struct chudata *) (tp->T_LINEP);

	s = spl5();
	chucode = &(chu->chubuf[chu->lastindex]);
	while (chu->curindex == chu->lastindex) {
		chu->sleeping = 1;
		sleep((caddr_t)chucode, TTIPRI);
	}
	chu->sleeping = 0;
	if (++(chu->lastindex) >= NUMCHUBUFS)
		chu->lastindex = 0;
	splx(s);

	return (uiomove((caddr_t)chucode, sizeof(*chucode), UIO_READ, uio));
}

/*
 * Low level character input routine.
 * If the character looks okay, grab a time stamp.  If the stuff in
 * the buffer is too old, dump it and start fresh.  If the character is
 * non-BCDish, everything in the buffer too.
 */
chuinput(c, tp)
	register int c;
	register struct tty *tp;
{
	register struct chudata *chu = (struct chudata *) tp->T_LINEP;
	register struct chucode *chuc;
	register int i;
	long sec, usec;
	struct timeval tv;

	/*
	 * Do a check on the BSDness of the character.  This delays
	 * the time stamp a bit but saves a fair amount of overhead
	 * when the static is bad.
	 */
	if (((c) & 0xf) > 9 || (((c)>>4) & 0xf) > 9) {
		chuc = &(chu->chubuf[chu->curindex]);
		chuc->ncodechars = 0;	/* blow all previous away */
		return;
	}

	/*
	 * Call microtime() to get the current time of day
	 */
	microtime(&tv);

	/*
	 * Compute the difference in this character's time stamp
	 * and the last.  If it exceeds the margin, blow away all
	 * the characters currently in the buffer.
	 */
	chuc = &(chu->chubuf[chu->curindex]);
	i = (int)chuc->ncodechars;
	if (i > 0) {
		sec = tv.tv_sec - chuc->codetimes[i-1].tv_sec;
		usec = tv.tv_usec - chuc->codetimes[i-1].tv_usec;
		if (usec < 0) {
			sec -= 1;
			usec += 1000000;
		}
		if (sec != 0 || usec > CHUMAXUSEC) {
			i = 0;
			chuc->ncodechars = 0;
		}
	}

	/*
	 * Store the character.  If we're done, have to tell someone
	 */
	chuc->codechars[i] = (u_char)c;
	chuc->codetimes[i] = tv;

	if (++i < NCHUCHARS) {
		/*
		 * Not much to do here.  Save the count and wait
		 * for another character.
		 */
		chuc->ncodechars = (u_char)i;
	} else {
		/*
		 * Mark this buffer full and point at next.  If the
		 * next buffer is full we overwrite it by bumping the
		 * next pointer.
		 */
		chuc->ncodechars = NCHUCHARS;
		if (++(chu->curindex) >= NUMCHUBUFS)
			chu->curindex = 0;
		if (chu->curindex == chu->lastindex)
			if (++(chu->lastindex) >= NUMCHUBUFS)
				chu->lastindex = 0;
		chu->chubuf[chu->curindex].ncodechars = 0;

		/*
		 * Wake up anyone sleeping on this.  Also wake up
		 * selectors and/or deliver a SIGIO as required.
		 */
		if (tp->t_rsel) {
			selwakeup(tp->t_rsel, tp->t_state&TS_RCOLL);
			tp->t_state &= ~TS_RCOLL;
			tp->t_rsel = 0;
		}
		if (tp->t_state & TS_ASYNC)
			gsignal(tp->t_pgrp, SIGIO);
		if (chu->sleeping)
			(void) wakeup((caddr_t)chuc);
	}
}

/*
 * Handle ioctls.  We reject all tty-style except those that
 * change the line discipline.
 */
chuioctl(tp, cmd, data, flag)
	struct tty *tp;
	int cmd;
	caddr_t data;
	int flag;
{

	if ((cmd>>8) != 't')
		return (-1);
	switch (cmd) {
	case TIOCSETD:
	case TIOCGETD:
	case TIOCGETP:
	case TIOCGETC:
		return (-1);
	}
	return (ENOTTY);	/* not quite appropriate */
}


chuselect(dev, rw)
	dev_t dev;
	int rw;
{
	register struct tty *tp = &cdevsw[major(dev)].d_ttys[minor(dev)];
	struct chudata *chu;
	int s = spl5();

	chu = (struct chudata *) (tp->T_LINEP);

	switch (rw) {

	case FREAD:
		if (chu->curindex != chu->lastindex)
			goto win;
		if (tp->t_rsel && tp->t_rsel->p_wchan == (caddr_t)&selwait)
			tp->t_state |= TS_RCOLL;
		else
			tp->t_rsel = u.u_procp;
		break;

	case FWRITE:
		goto win;
	}
	splx(s);
	return (0);
win:
	splx(s);
	return (1);
}
#endif NCHU
ntp-4.2.6p5/kernel/clkinit.c0000644000175000017500000000237410441361226014677 0ustar  peterpeter/*
**	dynamically loadable clk driver
**
**	william robertson   
*/

#include 
#include 
#include 
#include 
#include 

#include 
#include 

extern int findmod();		/* os/str_io.c */

extern struct streamtab clkinfo;

struct vdldrv vd = {
     VDMAGIC_USER,
     "clk"
  };


int
xxxinit(function_code, vdp, vdi, vds)
unsigned int function_code;
struct vddrv *vdp;
addr_t vdi;
struct vdstat *vds;
{
     register int i = 0;
     register int j;

     switch (function_code) {
	case VDLOAD:

	  if (findmod("clk") >= 0) {
	       log(LOG_ERR, "clk stream module already loaded\n");
	       return (EADDRINUSE);
	  }
 
	  i = findmod("\0");

	  if (i == -1 || fmodsw[i].f_name[0] != '\0') 
	    return(-1);

	  for (j = 0; vd.Drv_name[j] != '\0'; j++)	/* XXX check bounds */
	    fmodsw[i].f_name[j] = vd.Drv_name[j];

	  fmodsw[i].f_name[j] = '\0';
	  fmodsw[i].f_str = &clkinfo;

	  vdp->vdd_vdtab = (struct vdlinkage *)  &vd;

	  return(0);

	case VDUNLOAD:
	  if ((i = findmod(vd.Drv_name)) == -1)
	    return(-1);

	  fmodsw[i].f_name[0] = '\0';
	  fmodsw[i].f_str = 0;

	  return(0);
     
	case VDSTAT:
	  return(0);

	default:
	  return(EIO);
     }
}
ntp-4.2.6p5/kernel/sys/0000755000175000017500000000000011675461366013726 5ustar  peterpeterntp-4.2.6p5/kernel/sys/chudefs.h0000644000175000017500000000120510017034551015473 0ustar  peterpeter/*
 * Definitions for the CHU line discipline v2.0
 */

/*
 * The CHU time code consists of 10 BCD digits and is repeated
 * twice for a total of 10 characters.  A time is taken after
 * the arrival of each character.  The following structure is
 * used to return this stuff.
 */
#define	NCHUCHARS	(10)

struct chucode {
	u_char codechars[NCHUCHARS];	/* code characters */
	u_char ncodechars;		/* number of code characters */
	u_char chutype;			/* packet type */
	struct timeval codetimes[NCHUCHARS];	/* arrival times */
};

#define CHU_TIME 0		/* second half is equal to first half */
#define CHU_YEAR 1		/* second half is one's complement */

ntp-4.2.6p5/kernel/sys/i8253.h0000644000175000017500000000310010017034551014620 0ustar  peterpeter/* Copyright (c) 1995 Vixie Enterprises
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies, and that
 * the name of Vixie Enterprises not be used in advertising or publicity
 * pertaining to distribution of the document or software without specific,
 * written prior permission.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS" AND VIXIE ENTERPRISES DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL VIXIE ENTERPRISES
 * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 * SOFTWARE.
 */

#ifndef _I8253_DEFINED
#define _I8253_DEFINED

typedef union {
	unsigned char	i;
	struct {
		unsigned int	bcd	: 1;
#define				i8253_binary	0
#define				i8253_bcd	1
		unsigned int	mode	: 3;
#define				i8253_termcnt	0
#define				i8253_oneshot	1
#define				i8253_rategen	2
#define				i8253_sqrwave	3
#define				i8253_softstb	4
#define				i8253_hardstb	5
		unsigned int	rl	: 2;
#define				i8253_latch	0
#define				i8253_lsb	1
#define				i8253_msb	2
#define				i8253_lmb	3
		unsigned int	cntr	: 2;
#define				i8253_cntr_0	0
#define				i8253_cntr_1	1
#define				i8253_cntr_2	2
	} s;
} i8253_ctrl;

#endif /*_I8253_DEFINED*/
ntp-4.2.6p5/kernel/sys/ppsclock.h0000644000175000017500000000513710017034551015700 0ustar  peterpeter/*
 * This software was developed by the Computer Systems Engineering group
 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66.
 *
 * Copyright (c) 1992 The Regents of the University of California.
 * 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.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Lawrence Berkeley Laboratory.
 * 4. The name of the University may not be used to endorse or promote
 *    products derived from this software without specific prior
 *    written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
 */

#ifndef TIOCGPPSEV
#define PPSCLOCKSTR	"ppsclock"

#ifndef HAVE_STRUCT_PPSCLOCKEV
struct ppsclockev {
	struct timeval tv;
	u_int serial;
};
#endif

#if defined(__STDC__) || defined(SYS_HPUX)
#ifdef	_IOR
#define CIOGETEV        _IOR('C', 0, struct ppsclockev)	/* get last pps event */
#else	/* XXX SOLARIS is different */
#define	CIO	('C'<<8)
#define CIOGETEV        (CIO|0)		/* get last pps event */
#endif	/* _IOR */
#else	/* __STDC__ */
#ifdef	_IOR
#define CIOGETEV        _IOR(C, 0, struct ppsclockev)	/* get last pps event */
#else	/* XXX SOLARIS is different */
#define	CIO	('C'<<8)
#define CIOGETEV        (CIO|0)		/* get last pps event */
#endif	/* _IOR */
#endif	/* __STDC__ */
#else
#define CIOGETEV TIOCGPPSEV
#endif
ntp-4.2.6p5/kernel/sys/pcl720.h0000644000175000017500000000576710017034551015102 0ustar  peterpeter/* Copyright (c) 1995 Vixie Enterprises
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies, and that
 * the name of Vixie Enterprises not be used in advertising or publicity
 * pertaining to distribution of the document or software without specific,
 * written prior permission.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS" AND VIXIE ENTERPRISES DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL VIXIE ENTERPRISES
 * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 * SOFTWARE.
 */

#ifndef _PCL720_DEFINED
#define _PCL720_DEFINED

#define	pcl720_data(base,bit)	(base+(bit>>3))
#define pcl720_data_0_7(base)	(base+0)
#define pcl720_data_8_15(base)	(base+1)
#define pcl720_data_16_23(base)	(base+2)
#define pcl720_data_24_31(base)	(base+3)
#define pcl720_cntr(base,cntr)	(base+4+cntr)	/* cntr: 0..2 */
#define pcl720_cntr_0(base)	(base+4)
#define pcl720_cntr_1(base)	(base+5)
#define pcl720_cntr_2(base)	(base+6)
#define pcl720_ctrl(base)	(base+7)

#ifndef DEBUG_PCL720
#define	pcl720_inb(x)		inb(x)
#define	pcl720_outb(x,y)	outb(x,y)
#else
static unsigned char pcl720_inb(int addr) {
	unsigned char x = inb(addr);
	fprintf(DEBUG_PCL720, "inb(0x%x) -> 0x%x\n", addr, x);
	return (x);
}
static void pcl720_outb(int addr, unsigned char x) {
	outb(addr, x);
	fprintf(DEBUG_PCL720, "outb(0x%x, 0x%x)\n", addr, x);
}
#endif

#define	pcl720_load(Base,Cntr,Mode,Val) \
	({	register unsigned int	b = Base, c = Cntr, v = Val; \
		i8253_ctrl ctrl; \
		\
		ctrl.s.bcd = i8253_binary; \
		ctrl.s.mode = Mode; \
		ctrl.s.rl = i8253_lmb; \
		ctrl.s.cntr = c; \
		pcl720_outb(pcl720_ctrl(b), ctrl.i); \
		pcl720_outb(pcl720_cntr(b,c), v); \
		pcl720_outb(pcl720_cntr(b,c), v >> 8); \
		v; \
	})

#define	pcl720_read(Base,Cntr) \
	({	register unsigned int	b = Base, v; \
		i8253_ctrl ctrl; \
		\
		ctrl.s.rl = i8253_latch; \
		ctrl.s.cntr = i8253_cntr_0; \
		pcl720_outb(pcl720_ctrl(b), ctrl.i); \
		v = pcl720_inb(pcl720_cntr_0(b)); \
		v |= (pcl720_inb(pcl720_cntr_0(b)) << 8); \
		v; \
	})

#define	pcl720_input(Base) \
	({	register unsigned int	b = Base, v; \
		\
		v = pcl720_inb(pcl720_data_0_7(b)); \
		v |= (pcl720_inb(pcl720_data_8_15(b)) << 8); \
		v |= (pcl720_inb(pcl720_data_16_23(b)) << 16); \
		v |= (pcl720_inb(pcl720_data_24_31(b)) << 24); \
		v; \
	})

#define	pcl720_output(Base,Value) \
	({	register unsigned int	b = Base, v = Value; \
		\
		pcl720_outb(pcl720_data_0_7(b), v); \
		pcl720_outb(pcl720_data_8_15(b), v << 8); \
		pcl720_outb(pcl720_data_16_23(b), v << 16); \
		pcl720_outb(pcl720_data_24_31(b), v << 24); \
		v; \
	})

#endif /*_PCL720_DEFINED*/
ntp-4.2.6p5/kernel/sys/timex.h0000644000175000017500000002726710017034551015220 0ustar  peterpeter/******************************************************************************
 *                                                                            *
 * Copyright (c) David L. Mills 1993, 1994                                    *
 *                                                                            *
 * Permission to use, copy, modify, and distribute this software and its      *
 * documentation for any purpose and without fee is hereby granted, provided  *
 * that the above copyright notice appears in all copies and that both the    *
 * copyright notice and this permission notice appear in supporting           *
 * documentation, and that the name University of Delaware not be used in     *
 * advertising or publicity pertaining to distribution of the software        *
 * without specific, written prior permission.  The University of Delaware    *
 * makes no representations about the suitability this software for any       *
 * purpose.  It is provided "as is" without express or implied warranty.      *
 *                                                                            *
 ******************************************************************************/

/*
 * Modification history timex.h
 *
 * 26 Sep 94	David L. Mills
 *	Added defines for hybrid phase/frequency-lock loop.
 *
 * 19 Mar 94	David L. Mills
 *	Moved defines from kernel routines to header file and added new
 *	defines for PPS phase-lock loop.
 *
 * 20 Feb 94	David L. Mills
 *	Revised status codes and structures for external clock and PPS
 *	signal discipline.
 *
 * 28 Nov 93	David L. Mills
 *	Adjusted parameters to improve stability and increase poll
 *	interval.
 *
 * 17 Sep 93    David L. Mills
 *      Created file
 */
/*
 * This header file defines the Network Time Protocol (NTP) interfaces
 * for user and daemon application programs. These are implemented using
 * private syscalls and data structures and require specific kernel
 * support.
 *
 * NAME
 *	ntp_gettime - NTP user application interface
 *
 * SYNOPSIS
 *	#include 
 *
 *	int syscall(SYS_ntp_gettime, tptr)
 *
 *	int SYS_ntp_gettime		defined in syscall.h header file
 *	struct ntptimeval *tptr		pointer to ntptimeval structure
 *
 * NAME
 *	ntp_adjtime - NTP daemon application interface
 *
 * SYNOPSIS
 *	#include 
 *
 *	int syscall(SYS_ntp_adjtime, mode, tptr)
 *
 *	int SYS_ntp_adjtime		defined in syscall.h header file
 *	struct timex *tptr		pointer to timex structure
 *
 */
#ifndef _SYS_TIMEX_H_
#define _SYS_TIMEX_H_ 1

#ifndef MSDOS			/* Microsoft specific */
#include 
#endif /* MSDOS */

/*
 * The following defines establish the engineering parameters of the
 * phase-lock loop (PLL) model used in the kernel implementation. These
 * parameters have been carefully chosen by analysis for good stability
 * and wide dynamic range.
 *
 * The hz variable is defined in the kernel build environment. It
 * establishes the timer interrupt frequency, 100 Hz for the SunOS
 * kernel, 256 Hz for the Ultrix kernel and 1024 Hz for the OSF/1
 * kernel. SHIFT_HZ expresses the same value as the nearest power of two
 * in order to avoid hardware multiply operations.
 *
 * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen
 * for a slightly underdamped convergence characteristic. SHIFT_KH
 * establishes the damping of the FLL and is chosen by wisdom and black
 * art.
 *
 * MAXTC establishes the maximum time constant of the PLL. With the
 * SHIFT_KG and SHIFT_KF values given and a time constant range from
 * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours,
 * respectively.
 */
#define SHIFT_HZ 7		/* log2(hz) */
#define SHIFT_KG 6		/* phase factor (shift) */
#define SHIFT_KF 16		/* PLL frequency factor (shift) */
#define SHIFT_KH 2		/* FLL frequency factor (shift) */
#define MAXTC 6			/* maximum time constant (shift) */

/*
 * The following defines establish the scaling of the various variables
 * used by the PLL. They are chosen to allow the greatest precision
 * possible without overflow of a 32-bit word.
 *
 * SHIFT_SCALE defines the scaling (shift) of the time_phase variable,
 * which serves as a an extension to the low-order bits of the system
 * clock variable time.tv_usec.
 *
 * SHIFT_UPDATE defines the scaling (shift) of the time_offset variable,
 * which represents the current time offset with respect to standard
 * time.
 *
 * SHIFT_USEC defines the scaling (shift) of the time_freq and
 * time_tolerance variables, which represent the current frequency
 * offset and maximum frequency tolerance.
 *
 * FINEUSEC is 1 us in SHIFT_UPDATE units of the time_phase variable.
 */
#define SHIFT_SCALE 22		/* phase scale (shift) */
#define SHIFT_UPDATE (SHIFT_KG + MAXTC) /* time offset scale (shift) */
#define SHIFT_USEC 16		/* frequency offset scale (shift) */
#define FINEUSEC (1L << SHIFT_SCALE) /* 1 us in phase units */

/*
 * The following defines establish the performance envelope of the PLL.
 * They insure it operates within predefined limits, in order to satisfy
 * correctness assertions. An excursion which exceeds these bounds is
 * clamped to the bound and operation proceeds accordingly. In practice,
 * this can occur only if something has failed or is operating out of
 * tolerance, but otherwise the PLL continues to operate in a stable
 * mode.
 *
 * MAXPHASE must be set greater than or equal to CLOCK.MAX (128 ms), as
 * defined in the NTP specification. CLOCK.MAX establishes the maximum
 * time offset allowed before the system time is reset, rather than
 * incrementally adjusted. Here, the maximum offset is clamped to
 * MAXPHASE only in order to prevent overflow errors due to defective
 * protocol implementations.
 *
 * MAXFREQ is the maximum frequency tolerance of the CPU clock
 * oscillator plus the maximum slew rate allowed by the protocol. It
 * should be set to at least the frequency tolerance of the oscillator
 * plus 100 ppm for vernier frequency adjustments. If the kernel
 * PPS discipline code is configured (PPS_SYNC), the oscillator time and
 * frequency are disciplined to an external source, presumably with
 * negligible time and frequency error relative to UTC, and MAXFREQ can
 * be reduced.
 *
 * MAXTIME is the maximum jitter tolerance of the PPS signal if the
 * kernel PPS discipline code is configured (PPS_SYNC).
 *
 * MINSEC and MAXSEC define the lower and upper bounds on the interval
 * between protocol updates.
 */
#define MAXPHASE 512000L	/* max phase error (us) */
#ifdef PPS_SYNC
#define MAXFREQ (512L << SHIFT_USEC) /* max freq error (100 ppm) */
#define MAXTIME (200L << PPS_AVG) /* max PPS error (jitter) (200 us) */
#else
#define MAXFREQ (512L << SHIFT_USEC) /* max freq error (200 ppm) */
#endif /* PPS_SYNC */
#define MINSEC 16L		/* min interval between updates (s) */
#define MAXSEC 1200L		/* max interval between updates (s) */

#ifdef PPS_SYNC
/*
 * The following defines are used only if a pulse-per-second (PPS)
 * signal is available and connected via a modem control lead, such as
 * produced by the optional ppsclock feature incorporated in the Sun
 * asynch driver. They establish the design parameters of the frequency-
 * lock loop used to discipline the CPU clock oscillator to the PPS
 * signal.
 *
 * PPS_AVG is the averaging factor for the frequency loop, as well as
 * the time and frequency dispersion.
 *
 * PPS_SHIFT and PPS_SHIFTMAX specify the minimum and maximum
 * calibration intervals, respectively, in seconds as a power of two.
 *
 * PPS_VALID is the maximum interval before the PPS signal is considered
 * invalid and protocol updates used directly instead.
 *
 * MAXGLITCH is the maximum interval before a time offset of more than
 * MAXTIME is believed.
 */
#define PPS_AVG 2		/* pps averaging constant (shift) */
#define PPS_SHIFT 2		/* min interval duration (s) (shift) */
#define PPS_SHIFTMAX 8		/* max interval duration (s) (shift) */
#define PPS_VALID 120		/* pps signal watchdog max (s) */
#define MAXGLITCH 30		/* pps signal glitch max (s) */
#endif /* PPS_SYNC */

/*
 * The following defines and structures define the user interface for
 * the ntp_gettime() and ntp_adjtime() system calls.
 *
 * Control mode codes (timex.modes)
 */
#define MOD_OFFSET	0x0001	/* set time offset */
#define MOD_FREQUENCY	0x0002	/* set frequency offset */
#define MOD_MAXERROR	0x0004	/* set maximum time error */
#define MOD_ESTERROR	0x0008	/* set estimated time error */
#define MOD_STATUS	0x0010	/* set clock status bits */
#define MOD_TIMECONST	0x0020	/* set pll time constant */
#define MOD_CANSCALE	0x0040	/* kernel can scale offset field */
#define MOD_DOSCALE	0x0080	/* userland wants to scale offset field */

/*
 * Status codes (timex.status)
 */
#define STA_PLL		0x0001	/* enable PLL updates (rw) */
#define STA_PPSFREQ	0x0002	/* enable PPS freq discipline (rw) */
#define STA_PPSTIME	0x0004	/* enable PPS time discipline (rw) */
#define STA_FLL		0x0008	/* select frequency-lock mode (rw) */

#define STA_INS		0x0010	/* insert leap (rw) */
#define STA_DEL		0x0020	/* delete leap (rw) */
#define STA_UNSYNC	0x0040	/* clock unsynchronized (rw) */
#define STA_FREQHOLD	0x0080	/* hold frequency (rw) */

#define STA_PPSSIGNAL	0x0100	/* PPS signal present (ro) */
#define STA_PPSJITTER	0x0200	/* PPS signal jitter exceeded (ro) */
#define STA_PPSWANDER	0x0400	/* PPS signal wander exceeded (ro) */
#define STA_PPSERROR	0x0800	/* PPS signal calibration error (ro) */

#define STA_CLOCKERR	0x1000	/* clock hardware fault (ro) */

#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
    STA_PPSERROR | STA_CLOCKERR) /* read-only bits */

/*
 * Clock states (time_state)
 */
#define TIME_OK		0	/* no leap second warning */
#define TIME_INS	1	/* insert leap second warning */
#define TIME_DEL	2	/* delete leap second warning */
#define TIME_OOP	3	/* leap second in progress */
#define TIME_WAIT	4	/* leap second has occurred */
#define TIME_ERROR	5	/* clock not synchronized */

/*
 * NTP user interface (ntp_gettime()) - used to read kernel clock values
 *
 * Note: maximum error = NTP synch distance = dispersion + delay / 2;
 * estimated error = NTP dispersion.
 */
struct ntptimeval {
	struct timeval time;	/* current time (ro) */
	long maxerror;		/* maximum error (us) (ro) */
	long esterror;		/* estimated error (us) (ro) */
};

/*
 * NTP daemon interface - (ntp_adjtime()) used to discipline CPU clock
 * oscillator
 */
struct timex {
	unsigned int modes;	/* clock mode bits (wo) */
	long offset;		/* time offset (us) (rw) */
	long freq;		/* frequency offset (scaled ppm) (rw) */
	long maxerror;		/* maximum error (us) (rw) */
	long esterror;		/* estimated error (us) (rw) */
	int status;		/* clock status bits (rw) */
	long constant;		/* pll time constant (rw) */
	long precision;		/* clock precision (us) (ro) */
	long tolerance;		/* clock frequency tolerance (scaled
				 * ppm) (ro) */
	/*
	 * The following read-only structure members are implemented
	 * only if the PPS signal discipline is configured in the
	 * kernel.
	 */
	long ppsfreq;		/* pps frequency (scaled ppm) (ro) */
	long jitter;		/* pps jitter (us) (ro) */
	int shift;		/* interval duration (s) (shift) (ro) */
	long stabil;		/* pps stability (scaled ppm) (ro) */
	long jitcnt;		/* jitter limit exceeded (ro) */
	long calcnt;		/* calibration intervals (ro) */
	long errcnt;		/* calibration errors (ro) */
	long stbcnt;		/* stability limit exceeded (ro) */

};
#ifdef __FreeBSD__

/*
 * sysctl identifiers underneath kern.ntp_pll
 */
#define NTP_PLL_GETTIME	1	/* used by ntp_gettime() */
#define NTP_PLL_MAXID	2	/* number of valid ids */

#define NTP_PLL_NAMES { \
			  { 0, 0 }, \
			  { "gettime", CTLTYPE_STRUCT }, \
		      }

#ifndef KERNEL
#include 

__BEGIN_DECLS
extern int ntp_gettime        __P((struct ntptimeval *));
extern int ntp_adjtime        __P((struct timex *));
__END_DECLS

#endif /* not KERNEL */

#endif /* __FreeBSD__ */
#endif /* _SYS_TIMEX_H_ */
ntp-4.2.6p5/kernel/sys/clkdefs.h0000644000175000017500000000172110017034551015470 0ustar  peterpeter/*
 * Defines for the "clk" timestamping STREAMS module
 */

#if defined(sun)
#include 
#else
#include 
#endif

/*
 * First, we need to define the maximum size of the set of
 * characters to timestamp. 32 is MORE than enough.
 */

#define CLK_MAXSTRSIZE 32
struct clk_tstamp_charset {		/* XXX to use _IOW not _IOWN */
	char	val[CLK_MAXSTRSIZE];
};

/*
 * ioctl(fd, CLK_SETSTR, (char*)c );
 *
 * will tell the driver that any char in the null-terminated
 * string c should be timestamped. It is possible, though
 * unlikely that this ioctl number could collide with an
 * existing one on your system. If so, change the 'K'
 * to some other letter. However, once you've compiled
 * the kernel with this include file, you should NOT
 * change this file.
 */

#if defined(__STDC__)			/* XXX avoid __STDC__=0 on SOLARIS */
#define CLK_SETSTR _IOW('K', 01, struct clk_tstamp_charset)
#else
#define CLK_SETSTR _IOW(K, 01, struct clk_tstamp_charset)
#endif

ntp-4.2.6p5/kernel/sys/Makefile.in0000644000175000017500000003145611675460276016003 0ustar  peterpeter# 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 = kernel/sys
DIST_COMMON = README $(noinst_HEADERS) $(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)/m4/define_dir.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_cacheversion.m4 \
	$(top_srcdir)/m4/ntp_dir_sep.m4 \
	$(top_srcdir)/m4/ntp_lineeditlibs.m4 \
	$(top_srcdir)/m4/ntp_openssl.m4 \
	$(top_srcdir)/m4/ntp_vpathhack.m4 \
	$(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 =
SOURCES =
DIST_SOURCES =
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINSUBDIR = @BINSUBDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
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@
EF_LIBS = @EF_LIBS@
EF_PROGS = @EF_PROGS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_INLINE = @HAVE_INLINE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LCRYPTO = @LCRYPTO@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
LIBOPTS_DIR = @LIBOPTS_DIR@
LIBOPTS_LDADD = @LIBOPTS_LDADD@
LIBPARSE = @LIBPARSE@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
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@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENSSL = @OPENSSL@
OPENSSL_INC = @OPENSSL_INC@
OPENSSL_LIB = @OPENSSL_LIB@
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_SH = @PATH_SH@
PATH_TEST = @PATH_TEST@
POSIX_SHELL = @POSIX_SHELL@
PROPDELAY = @PROPDELAY@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SNMP_CFLAGS = @SNMP_CFLAGS@
SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
SNMP_LIBS = @SNMP_LIBS@
STRIP = @STRIP@
TESTDCF = @TESTDCF@
VERSION = @VERSION@
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_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@

#AUTOMAKE_OPTIONS = ../../util/ansi2knr no-dependencies
AUTOMAKE_OPTIONS = 
noinst_HEADERS = bsd_audioirig.h chudefs.h clkdefs.h i8253.h parsestreams.h \
 pcl720.h ppsclock.h timex.h tpro.h tt560_api.h

#EXTRA_DIST= TAGS
# HMS: Avoid bug in automake 
#ETAGS_ARGS = ""
ETAGS_ARGS = Makefile.am
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 kernel/sys/Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --foreign kernel/sys/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):

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	set x; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	shift; \
	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  if test $$# -gt 0; then \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      "$$@" $$unique; \
	  else \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      $$unique; \
	  fi; \
	fi
ctags: CTAGS
CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && $(am__cd) $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) "$$here"

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@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 $(HEADERS)
installdirs:
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)

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 distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

html-am:

info: info-am

info-am:

install-data-am:

install-dvi: install-dvi-am

install-dvi-am:

install-exec-am:

install-html: install-html-am

install-html-am:

install-info: install-info-am

install-info-am:

install-man:

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:

.MAKE: install-am install-strip

.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
	clean-libtool ctags distclean distclean-generic \
	distclean-libtool distclean-tags distdir dvi dvi-am html \
	html-am info info-am install install-am install-data \
	install-data-am install-dvi install-dvi-am install-exec \
	install-exec-am install-html install-html-am install-info \
	install-info-am install-man install-pdf install-pdf-am \
	install-ps install-ps-am install-strip installcheck \
	installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-generic \
	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
	uninstall-am


# 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:
ntp-4.2.6p5/kernel/sys/tpro.h0000644000175000017500000000206010017034551015036 0ustar  peterpeter/*
 * Structure for the KSI/Odetics TPRO-S data returned in reponse to a
 * read() call. Note that these are driver-specific and not dependent on
 * 32/64-bit architecture.
 */
struct	tproval {
	u_short	day100;		/* days * 100 */
	u_short	day10;		/* days * 10 */
	u_short	day1;		/* days * 1 */
	u_short	hour10;		/* hours * 10 */
	u_short	hour1;		/* hours * 1 */
	u_short	min10;		/* minutes * 10 */
	u_short	min1;		/* minutes * 1 */
	u_short	sec10;		/* seconds * 10 */
	u_short	sec1;		/* seconds * 1*/
	u_short	ms100;		/* milliseconds * 100 */
	u_short	ms10;		/* milliseconds * 10 */
	u_short	ms1;		/* milliseconds * 1 */
	u_short	usec100;	/* microseconds * 100 */
	u_short	usec10;		/* microseconds * 10 */
	u_short	usec1;		/* microseconds * 1 */
	long tv_sec;		/* seconds */
	long tv_usec;		/* microseconds	*/
	u_short	status;		/* status register */
};

/*
 * Status register bits
 */
#define	TIMEAVAIL 0x0001	/* time available */
#define NOSIGNAL 0x0002		/* insufficient IRIG-B signal */
#define NOSYNC 0x0004		/* local oscillator not synchronized */

/* end of tpro.h */
ntp-4.2.6p5/kernel/sys/parsestreams.h0000644000175000017500000001044610441361226016575 0ustar  peterpeter/*
 * /src/NTP/ntp4-dev/kernel/sys/parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
 *
 * parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
 *
 * Copyright (c) 1995-2005 by Frank Kardel  ntp.org>
 * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
 *
 * 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.
 * 3. Neither the name of the author nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * 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.
 */

#if	!(defined(lint) || defined(__GNUC__))
  static char sysparsehrcsid[] = "parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A";
#endif

#undef PARSEKERNEL
#if defined(KERNEL) || defined(_KERNEL)
#ifndef PARSESTREAM
#define PARSESTREAM
#endif
#endif
#if defined(PARSESTREAM) && defined(HAVE_SYS_STREAM_H)
#define PARSEKERNEL

#ifdef HAVE_SYS_TERMIOS_H
#include 
#endif

#include 

#ifndef NTP_NEED_BOPS
#define NTP_NEED_BOPS
#endif

#if defined(PARSESTREAM) && (defined(_sun) || defined(__sun)) && defined(HAVE_SYS_STREAM_H)
/*
 * Sorry, but in SunOS 4.x AND Solaris 2.x kernels there are no
 * mem* operations. I don't want them - bcopy, bzero
 * are fine in the kernel
 */
#undef HAVE_STRING_H	/* don't include that at kernel level - prototype mismatch in Solaris 2.6 */
#include "ntp_string.h"
#else
#include 
#endif

struct parsestream		/* parse module local data */
{
  queue_t       *parse_queue;	/* read stream for this channel */
  queue_t	*parse_dqueue;	/* driver queue entry (PPS support) */
  unsigned long  parse_status;  /* operation flags */
  void          *parse_data;	/* local data space (PPS support) */
  parse_t	 parse_io;	/* io structure */
  struct ppsclockev parse_ppsclockev; /* copy of last pps event */
};

typedef struct parsestream parsestream_t;

#define PARSE_ENABLE	0x0001

/*--------------- debugging support ---------------------------------*/

#define DD_OPEN    0x00000001
#define DD_CLOSE   0x00000002
#define DD_RPUT    0x00000004
#define DD_WPUT    0x00000008
#define DD_RSVC    0x00000010
#define DD_PARSE   0x00000020
#define DD_INSTALL 0x00000040
#define DD_ISR     0x00000080
#define DD_RAWDCF  0x00000100

extern int parsedebug;

#ifdef DEBUG_PARSE

#define parseprintf(X, Y) if ((X) & parsedebug) printf Y

#else

#define parseprintf(X, Y)

#endif
#endif

/*
 * History:
 *
 * parsestreams.h,v
 * Revision 4.5  2005/06/25 10:52:47  kardel
 * fix version id / add version log
 *
 * Revision 4.4  1998/06/14 21:09:32  kardel
 * Sun acc cleanup
 *
 * Revision 4.3  1998/06/13 18:14:32  kardel
 * make mem*() to b*() mapping magic work on Solaris too
 *
 * Revision 4.2  1998/06/13 15:16:22  kardel
 * fix mem*() to b*() function macro emulation
 *
 * Revision 4.1  1998/06/13 11:50:37  kardel
 * STREAM macro gone in favor of HAVE_SYS_STREAM_H
 *
 * Revision 4.0  1998/04/10 19:51:30  kardel
 * Start 4.0 release version numbering
 *
 * Revision 1.2  1998/04/10 19:27:42  kardel
 * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
 *
 */
ntp-4.2.6p5/kernel/sys/Makefile.am0000644000175000017500000000044411307651603015747 0ustar  peterpeter#AUTOMAKE_OPTIONS = ../../util/ansi2knr no-dependencies
AUTOMAKE_OPTIONS = 
noinst_HEADERS = bsd_audioirig.h chudefs.h clkdefs.h i8253.h parsestreams.h \
 pcl720.h ppsclock.h timex.h tpro.h tt560_api.h
#EXTRA_DIST= TAGS
# HMS: Avoid bug in automake 
#ETAGS_ARGS = ""
ETAGS_ARGS = Makefile.am
ntp-4.2.6p5/kernel/sys/README0000644000175000017500000000106710017034551014567 0ustar  peterpeterREADME file for directory ./kernel/sys of the NTP Version 3 distribution

This directory contains system header files used by the clock discipline
and STREAMS modules in the .. (./kernel) directory.

If the precision-time kernel (KERNEL_PLL define) is configured, the
installation process requires the header file /usr/include/sys/timex.h
for the particular architecture to be in place. The file timex.h included
in this distribution is for Suns; the files for other systems can be
found in the kernel distributions available from the manufacturer's
representatives.
ntp-4.2.6p5/kernel/sys/bsd_audioirig.h0000644000175000017500000000605610017034551016667 0ustar  peterpeter/*
 *	$Header: bsd_audioirig.h,v 1.0 93/08/02 12:42:00
 */

#ifndef _BSD_AUDIOIRIG_H_
#define _BSD_AUDIOIRIG_H_

#include 

/********************************************************************/
/* user interface */

/*
 * irig ioctls
 */
#if defined(__STDC__) || (!defined(sun) && !defined(ibm032) && !defined(__GNUC))
#define AUDIO_IRIG_OPEN         _IO('A', 50)
#define AUDIO_IRIG_CLOSE        _IO('A', 51)
#define AUDIO_IRIG_SETFORMAT    _IOWR('A', 52, int)
#else
#define AUDIO_IRIG_OPEN         _IO(A, 50)
#define AUDIO_IRIG_CLOSE        _IO(A, 51)
#define AUDIO_IRIG_SETFORMAT    _IOWR(A, 52, int)
#endif

/*
 * irig error codes
 */
#define AUDIO_IRIG_BADSIGNAL	0x01
#define AUDIO_IRIG_BADDATA	0x02
#define AUDIO_IRIG_BADSYNC	0x04
#define AUDIO_IRIG_BADCLOCK	0x08
#define AUDIO_IRIG_OLDDATA	0x10

/********************************************************************/

/*
 * auib definitions
 */
#define AUIB_SIZE	(0x0040)
#define AUIB_INC	(0x0008)
#define AUIB_MOD(k)	((k) & 0x0038)
#define AUIB_INIT(ib)	((ib)->ib_head = (ib)->ib_tail = (ib)->ib_lock = \
			 (ib)->phase = (ib)->shi = (ib)->slo = (ib)->high = \
			 (ib)->level0 = (ib)->level1 = \
			 (ib)->shift[0] = (ib)->shift[1] = (ib)->shift[2] = \
			 (ib)->shift[3] = (ib)->sdata[0] = (ib)->sdata[1] = \
			 (ib)->sdata[2] = (ib)->sdata[3] = (ib)->err = 0)
#define AUIB_EMPTY(ib)	((ib)->ib_head == (ib)->ib_tail)
#define AUIB_LEN(ib)	(AUIB_MOD((ib)->ib_tail - (ib)->ib_head))
#define AUIB_LEFT(ib)	(AUIB_MOD((ib)->ib_head - (ib)->ib_tail - 1))
#define IRIGDELAY 3
#define IRIGLEVEL 1355

#ifndef LOCORE
/*
 * irig_time holds IRIG data for one second
 */
struct irig_time {
        struct timeval  stamp;          /* timestamp */
        u_char  bits[13];               /* 100 irig data bits */
	u_char	status;			/* status byte */
        char    time[14];               /* time string */
};

/*
 * auib's are used for IRIG data communication between the trap
 * handler and the software interrupt.
 */
struct auib {
	/* driver variables */
	u_short	active;			/* 0=inactive, else=active */
	u_short	format;			/* time output format */
	struct	irig_time timestr;	/* time structure */
	char	buffer[14];		/* output formation buffer */

	/* hardware interrupt variables */
	struct	timeval tv1,tv2,tv3;	/* time stamps (median filter) */
	int	level0,level1;		/* lo/hi input levels */
	int	level;			/* decision level */
	int	high;			/* recent largest sample */
	int	sl0,sl1;		/* recent sample levels */
	int	lasts;			/* last sample value */
	u_short	scount;			/* sample count */
	u_long	eacc;			/* 10-bit element accumulator */
	u_long	ebit;			/* current bit in element */
	u_char	r_level,mmr1;		/* recording level 0-255 */
	int	shi,slo,phase;		/* AGC variables */
	u_long	err;			/* error status bits */
	int	ecount;			/* count of elements this second */
	long	shift[4];		/* shift register of pos ident */
	long	sdata[4];		/* shift register of symbols */

	int	ib_head;		/* queue head */
	int	ib_tail;		/* queue tail */
	u_short	ib_lock;		/* queue head lock */
	u_long	ib_data[AUIB_SIZE];	/* data buffer */
};
#endif

#endif /* _BSD_AUDIOIRIG_H_ */
ntp-4.2.6p5/kernel/sys/tt560_api.h0000644000175000017500000003255410017034551015600 0ustar  peterpeter/***********************************************************************
 *
 *  Module:  ttime_api.h
 *
 *  Author:  SIS  1998
 *           LM NE&SS 2001
 *
 *  Description
 *
 *      This header file contains data necessary for the API to the
 *      True Time board. This contains all of the structure definitions
 *      for the individual registers.
 *
 ***********************************************************************/
#ifndef TTIME_API_H
#define TTIME_API_H

#ifdef CPP
extern "C" {
#endif

#include 

typedef struct
{
    unsigned int	micro_sec;
    unsigned int	milli_sec;
    struct tm		gps_tm;
} gps_time_t;

typedef struct 
{
    unsigned char reserved_1;
    unsigned unit_ms		: 4;
    unsigned filler_0		: 4;
    unsigned hun_ms		: 4;
    unsigned tens_ms		: 4;
    unsigned tens_sec		: 4;
    unsigned unit_sec		: 4;

    unsigned tens_min		: 4;
    unsigned unit_min		: 4;
    unsigned tens_hour		: 4;
    unsigned unit_hour		: 4;
    unsigned tens_day		: 4;
    unsigned unit_day		: 4;
    unsigned filler_1		: 4;
    unsigned hun_day		: 4;

    unsigned tens_year		: 4;
    unsigned unit_year		: 4;
    unsigned thou_year		: 4;
    unsigned hun_year		: 4;
    unsigned char reserved_2[2];
} preset_time_reg_t;

typedef struct
{
    unsigned n_d0			: 2;
    unsigned antenna_short_stat		: 1; /* 0 = fault */
    unsigned antenna_open_stat		: 1; /* 0 = fault */
    unsigned n_d1			: 1;
    unsigned rate_gen_pulse_stat	: 1;
    unsigned time_cmp_pulse_stat	: 1;
    unsigned ext_event_stat		: 1;

} hw_stat_reg_t;

typedef struct 
{
    unsigned tens_us		: 4;
    unsigned unit_us		: 4;
    unsigned unit_ms		: 4;
    unsigned hun_us		: 4;
    unsigned char hw_stat;	/* hw_stat_reg_t hw_stat; */
    unsigned char reserved_3;

    unsigned hun_ms		: 4;
    unsigned tens_ms		: 4;
    unsigned tens_sec		: 4;
    unsigned unit_sec		: 4;
    unsigned tens_min		: 4;
    unsigned unit_min		: 4;
    unsigned tens_hour		: 4;
    unsigned unit_hour		: 4;

    unsigned tens_day		: 4;
    unsigned unit_day		: 4;
    unsigned status		: 4;
    unsigned hun_day		: 4;
    unsigned tens_year		: 4;
    unsigned unit_year		: 4;
    unsigned thou_year		: 4;
    unsigned hun_year		: 4;
} time_freeze_reg_t;

typedef struct
{
    unsigned char off_low;
    unsigned char off_high;
    unsigned char reserved_4[2];
} sync_gen_off_reg_t;

typedef struct
{
    unsigned tens_min		: 4;
    unsigned unit_min		: 4;
    unsigned tens_hour		: 4;
    unsigned unit_hour		: 4;
    unsigned char sign_ascii;	/* '+' or '-' */
    unsigned char reserved_5;
} local_off_t;

/*
 *  This structure can be used for both the position freeze
 *  and position preset registers.
 */
typedef struct
{
    unsigned lat_tens_degee		: 4;
    unsigned lat_unit_degee		: 4;
    unsigned filler_0			: 4;
    unsigned lat_hun_degree		: 4;
    unsigned lat_tens_min		: 4;
    unsigned lat_unit_min		: 4;
    unsigned char lat_north_south;	/* 'N' or 'S' */

    unsigned filler_1			: 4;
    unsigned lat_tenth_sec		: 4;
    unsigned lat_tens_sec		: 4;
    unsigned lat_unit_sec		: 4;
    unsigned long_tens_degree		: 4;
    unsigned long_unit_degree		: 4;
    unsigned filler_2			: 4;
    unsigned long_hun_degree		: 4;

    unsigned long_tens_min		: 4;
    unsigned long_unit_min		: 4;
    unsigned char long_east_west;	/* 'E' or 'W' */
    unsigned filler_3			: 4;
    unsigned long_tenth_sec		: 4;
    unsigned long_tens_sec		: 4;
    unsigned long_unit_sec		: 4;

    unsigned elv_tens_km		: 4;
    unsigned elv_unit_km		: 4;
    unsigned char elv_sign;		/* '+' or '-' */
    unsigned elv_unit_m			: 4;
    unsigned elv_tenth_m		: 4;
    unsigned elv_hun_m			: 4;
    unsigned elv_tens_m			: 4;
} pos_reg_t;

typedef struct
{
    unsigned char prn1_tens_units;
    unsigned char prn1_reserved;
    unsigned char lvl1_tenths_hundredths;
    unsigned char lvl1_tens_units;

    unsigned char prn2_tens_units;
    unsigned char prn2_reserved;
    unsigned char lvl2_tenths_hundredths;
    unsigned char lvl2_tens_units;

    unsigned char prn3_tens_units;
    unsigned char prn3_reserved;
    unsigned char lvl3_tenths_hundredths;
    unsigned char lvl3_tens_units;

    unsigned char prn4_tens_units;
    unsigned char prn4_reserved;
    unsigned char lvl4_tenths_hundredths;
    unsigned char lvl4_tens_units;

    unsigned char prn5_tens_units;
    unsigned char prn5_reserved;
    unsigned char lvl5_tenths_hundredths;
    unsigned char lvl5_tens_units;

    unsigned char prn6_tens_units;
    unsigned char prn6_reserved;
    unsigned char lvl6_tenths_hundredths;
    unsigned char lvl6_tens_units;

    unsigned char flag;
    unsigned char reserved[3];
} sig_levels_t;

typedef struct
{
    unsigned tens_us		: 4;
    unsigned unit_us		: 4;
    unsigned unit_ms		: 4;
    unsigned hun_us		: 4;
    unsigned hun_ms		: 4;
    unsigned tens_ms		: 4;
    unsigned tens_sec		: 4;
    unsigned unit_sec		: 4;

    unsigned tens_min		: 4;
    unsigned unit_min		: 4;
    unsigned tens_hour		: 4;
    unsigned unit_hour		: 4;
    unsigned tens_day		: 4;
    unsigned unit_day		: 4;
    unsigned stat		: 4;
    unsigned hun_day		: 4;

    unsigned tens_year		: 4;
    unsigned unit_year		: 4;
    unsigned thou_year		: 4;
    unsigned hun_year		: 4;
    unsigned char reserved_5[2]; 
} ext_time_event_reg_t;

typedef struct
{
    unsigned tens_us	: 4;
    unsigned unit_us	: 4;
    unsigned unit_ms	: 4;
    unsigned hun_us	: 4;
    unsigned hun_ms	: 4;
    unsigned tens_ms	: 4;
    unsigned tens_sec	: 4;
    unsigned unit_sec	: 4;

    unsigned tens_min	: 4;
    unsigned unit_min	: 4;
    unsigned tens_hour	: 4;
    unsigned unit_hour	: 4;
    unsigned tens_day	: 4;
    unsigned unit_day	: 4;
    unsigned mask	: 4;
    unsigned hun_day	: 4;
} time_cmp_reg_t;

typedef struct
{
    unsigned char err_stat;
    unsigned char no_def;
    unsigned char oscillator_stat[2];
} diag_reg_t;

typedef struct
{
    unsigned res		:2;
    unsigned rate_int_mask	:1;
    unsigned cmp_int_mask	:1;
    unsigned ext_int_mask	:1;
    unsigned rate_stat_clr	:1;
    unsigned cmp_stat_clr	:1;
    unsigned ext_stat_clr	:1;
    unsigned char reserved[3];
} hw_ctl_reg_t;

typedef struct
{
    unsigned  preset_pos_rdy	:1;
    unsigned  sel_pps_ref	:1;
    unsigned  sel_gps_ref	:1;
    unsigned  sel_time_code	:1;
    unsigned  gen_stp_run	:1;
    unsigned  preset_time_rdy	:1;
    unsigned  dst		:1;
    unsigned  mode_sel		:1;

    unsigned  ctl_am_dc		:1;
    unsigned  reserved		:3;
    unsigned  input_code	:4;

    unsigned char rate_reserved;

    unsigned  rate_flag		:4;
    unsigned  rate_reserved1	:4;
} conf_reg_t;

typedef struct
{
     unsigned char	mem_reserved[0xf8];

     hw_ctl_reg_t	hw_ctl_reg;

     time_freeze_reg_t  time_freeze_reg;

     pos_reg_t		pos_freeze_reg;

     conf_reg_t		conf_reg;

     diag_reg_t		diag_reg;

     local_off_t	local_offset;

     sync_gen_off_reg_t sync_gen_offset;

     unsigned char 	reserved[4];

     unsigned char 	config_reg2_ctl;

     unsigned char      reserved2[11];

     time_cmp_reg_t	time_compare_reg;

     unsigned char 	reserved3[24];

     preset_time_reg_t	preset_time_reg;

     pos_reg_t		preset_pos_reg;

     ext_time_event_reg_t extern_time_event_reg;

     unsigned char 	reserved4[24];

     sig_levels_t	signal_levels_reg;

     unsigned char	reserved5[12];
} tt_mem_space_t;

#define TTIME_MEMORY_SIZE 0x200

/*
 *  Defines for register offsets
 */
#define HW_CTL_REG		0x0f8
#define TIME_FREEZE_REG		0x0fc
#define HW_STAT_REG		0x0fe
#define POS_FREEZE_REG		0x108
#define CONFIG_REG_1		0x118
#define DIAG_REG		0x11c
#define LOCAL_OFF_REG		0x120
#define SYNC_GEN_OFF_REG	0x124
#define CONFIG_REG_2		0x12c
#define TIME_CMP_REG		0x138
#define PRESET_TIME_REG		0x158
#define PRESET_POS_REG		0x164
#define EXT_EVENT_REG		0x174
#define SIG_LVL_PRN1		0x198
#define SIG_LVL_PRN2		0x19c
#define SIG_LVL_PRN3		0x1a0
#define SIG_LVL_PRN4		0x1a4
#define SIG_LVL_PRN5		0x1a8
#define SIG_LVL_PRN6		0x1ac
#define SIG_LVL_FLAG		0x1b0

/*
 *  Defines for accessing the hardware status register.
 */
#define HW_STAT_ANTENNA_SHORT		0	/* access the antenna short bit */
#define HW_STAT_ANTENNA_OPEN		1	/* access the antenna open bit */
#define HW_STAT_RATE_GEN_PULSE_STAT	2	/* access the rate gen pulse bit */
#define HW_STAT_TIME_CMP_PULSE_STAT	3	/* access the time cmp bit */
#define HW_STAT_EXT_EVENT_STAT		4	/* access the external event bit */

/*
 *  Defines for accessing the hardware control register
 */

#define HW_CTL_RATE_INT_MASK		0	/* access rate generator int mask */
#define HW_CTL_CMP_INT_MASK		1	/* access compare interrupt mask */
#define HW_CTL_EXT_INT_MASK		2	/* access external event interrupt mask */
#define HW_CTL_RATE_GEN_INT_CLEAR	3	/* access rate gen. interrupt clear field */
#define HW_CTL_TIME_CMP_INT_CLEAR	4	/* access time cmp interrupt clear field */
#define HW_CTL_EXT_EVENT_INT_CLEAR	5	/* access external event int clear field */

/*
 *  Defines for configuration register bit fields.
 */
#define PRESET_POS_RDY_BIT		0	/* access the preset pos. rdy. bit */
#define SEL_1_PPS_REF_BIT		1	/* access the select 1 pps reference bit */
#define SEL_GPS_REF_BIT			2	/* access the select gps reference bit */
#define SEL_TIME_CODE_REF_BIT		3	/* access the select time code reference bit */
#define GEN_STOP_BIT			4	/* access the generator start/stop bit */
#define PRESET_TIME_RDY_BIT		5	/* access the preset time ready bit */
#define DST_BIT				6	/* access the DST bit */
#define MODE_SEL_BIT			7	/* access the mode select bit */
#define AM_DC_BIT			8	/* access the code bits AM/DC bit */
#define IN_CODE_SEL_BIT			9	/* access the input code select bit */
#define FLAG_BIT			10	/* access the flag bit */

/*
 * The following defines are used to set modes in the 
 * configuration register.
 */

#define CONF_SET_AM			0	/* Set code to AM   */
#define CONF_SET_DC			1	/* Set code to DC   */
#define CONF_SET_IRIG_B			0	/* Set code IRIG B  */
#define CONF_SET_IRIG_A			1	/* Set code IRIG A  */

#define CONF_FLAG_DISABLE		0	/* Disable pulse        */
#define CONF_FLAG_10K_PPS		1	/* Set rate to 10k PPS  */
#define CONF_FLAG_1K_PPS		2	/* Set rate to 1k PPS   */
#define CONF_FLAG_100_PPS		3	/* Set rate to 100 PPS  */
#define CONF_FLAG_10_PPS		4	/* Set rate to 10 PPS   */
#define CONF_FLAG_1_PPS			5	/* Set rate to 1 PPS    */

/*
 *  Defines for read commands
 */

#define TT_RD_FREEZE_REG	0x01
#define TT_RD_HW_CTL_REG	0x02
#define TT_RD_CNFG_REG		0x03
#define TT_RD_DIAG_REG		0x04
#define TT_RD_LCL_OFFSET	0x05
#define TT_RD_SYNC_GEN_OFF	0x06
#define TT_RD_CNFG_REG_2	0x07
#define TT_RD_TIME_CMP_REG	0x08
#define TT_RD_PRESET_REG	0x09
#define TT_RD_EXT_EVNT_REG	0x0a
#define TT_RD_SIG_LVL_REG	0x0b

/*
 *  Defines for write commands
 */
#define TT_WRT_FREEZE_REG	0x0c
#define TT_WRT_HW_CTL_REG	0x0d
#define TT_WRT_CNFG_REG		0x0e
#define TT_WRT_DIAG_REG		0x0f
#define TT_WRT_LCL_OFFSET	0x10
#define TT_WRT_SYNC_GEN_OFF	0x11
#define TT_WRT_CNFG_REG_2	0x12
#define TT_WRT_TIME_CMP_REG	0x13
#define TT_WRT_PRESET_REG	0x14
#define TT_WRT_EXT_EVNT_REG	0x15
#define TT_WRT_SIG_LVL_REG	0x16

/*
 *  Define the length of the buffers to move (in 32 bit words).
 */

#define HW_CTL_REG_LEN		1
#define CNFG_REG_1_LEN		1
#define DIAG_REG_LEN		1
#define LCL_OFFSET_LEN		1
#define SYNC_GEN_OFF_LEN	1
#define CNFG_REG_2_LEN		1

#define TIME_CMP_REG_LEN	2
#define PRESET_TIME_REG_LEN	3
#define PRESET_POS_REG_LEN	4
#define PRESET_REG_LEN		(PRESET_TIME_REG_LEN+PRESET_POS_REG_LEN)
#define TIME_FREEZE_REG_LEN	3
#define POSN_FREEZE_REG_LEN	4
#define FREEZE_REG_LEN		(TIME_FREEZE_REG_LEN+POSN_FREEZE_REG_LEN)
#define EXT_EVNT_REG_LEN	3
#define	SIG_LVL_REG_LEN		7
#define	GPS_TIME_LEN		7

/*
 * Define BCD - INT - BCD macros.
 */

#define BCDTOI(a)	( ( ( ( (a) & 0xf0 ) >> 4 ) * 10 )  + ( (a) & 0x0f ) )
#define ITOBCD(a)	( ( ( (           (a) ) / 10) << 4 ) + ( (           (a) ) % 10) )
#define LTOBCD(a)	( ( ( ( (uint64_t)(a) ) / 10) << 4 ) + ( ( (uint64_t)(a) ) % 10) )

extern int  init_560                  (                      );
extern void close_560                 (                      );
extern int  write_hw_ctl_reg          (hw_ctl_reg_t         *);
extern int  write_hw_ctl_reg_bitfield (int, int              );
extern int  read_conf_reg             (conf_reg_t           *);
extern int  read_conf_reg_bitfield    (int                   );
extern int  write_conf_reg            (conf_reg_t           *);
extern int  write_conf_reg_bitfield   (int, unsigned char    );
extern int  read_hw_stat_reg_bitfield (int                   );
extern int  read_local_offset_reg     (local_off_t          *);
extern int  write_local_offset_reg    (local_off_t          *);
extern int  read_sync_offset_reg      (sync_gen_off_reg_t   *);
extern int  write_sync_offset_reg     (sync_gen_off_reg_t   *);
extern int  read_time_cmp_reg         (time_cmp_reg_t       *);
extern int  write_time_cmp_reg        (time_cmp_reg_t       *);
extern int  read_preset_time_reg      (preset_time_reg_t    *);
extern int  write_preset_time_reg     (preset_time_reg_t    *);
extern int  reset_time                (                      );
extern int  set_new_time              (preset_time_reg_t    *);
extern int  read_preset_position_reg  (pos_reg_t            *);
extern int  write_preset_position_reg (pos_reg_t            *);
extern int  read_external_event_reg   (ext_time_event_reg_t *);
extern int  read_signal_level_reg     (sig_levels_t         *);
extern int  freeze_time               (                      );
extern int  snapshot_time             (time_freeze_reg_t    *);
extern int  read_position_freeze_reg  (pos_reg_t            *);
extern int  read_diag_reg             (diag_reg_t           *);

#ifdef CPP
}
#endif
#endif
ntp-4.2.6p5/kernel/Makefile.am0000644000175000017500000000031111307651603015122 0ustar  peterpeter#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
AUTOMAKE_OPTIONS = 
SUBDIRS = sys
ETAGS_ARGS = Makefile.am
EXTRA_DIST = chuinit.c clkinit.c tty_chu.c tty_chu_STREAMS.c tty_clk.c tty_clk_STREAMS.c
ntp-4.2.6p5/kernel/README0000644000175000017500000002014510017034550013746 0ustar  peterpeterInstalling Line Disciplines and Streams Modules

Description

Most radio and modem clocks used for a primary (stratum-1) NTP server
utilize serial ports operating at speeds of 9600 baud or greater. The
timing jitter contributed by the serial port hardware and software
discipline can accumulate to several milliseconds on a typical Unix
workstation. In order to reduce these errors, a set of special line
disciplines can be configured in the operating system process. These
disciplines intercept special characters or signals provided by the
radio or modem clock and save a local timestamp for later processing.

The disciplines can be compiled in the kernel in older BSD-derived
systems, or installed as System V streams modules and either compiled in
the kernel or dynamically loaded when required. In either case, they
require reconfiguration of the Unix kernel and provisions in the NTP
daemon xntpd. The streams modules can be pushed and popped from the
streams stack using conventional System V streams program primitives.
Note that not all Unix kernels support line disciplines and of those
that do, not all support System V streams. The disciplines here are
known to work correctly with SunOS 4.x kernels, but have not been tested
for other kernels.

There are two line disciplines included in the distribution. Support for
each is enabled by adding flags to the DEFS_LOCAL line of the build
configuration file ./Config.local. This can be done automatically by the
autoconfiguration build procedures, or can be inserted/deleted after the
process has completed.

tty_clk (CLK)

     This discipline intercepts characters received from the serial port
     and passes unchanged all except a set of designated characters to
     the generic serial port discipline. For each of the exception
     characters, the character is inserted in the receiver buffer
     followed by a timestamp in Unix timeval format. Both select() and
     SIGIO are supported by the discipline. The -DCLK flag is used to
     compile support for this disipline in the NTP daemon. This flag is
     included if the clkdefs.h file is found in the /sys/sys directory,
     or it can be added (or deleted) manually.

tty_chu (CHU)

     This discipline is a special purpose line discipline for receiving
     a special timecode broadcast by Canadian time and frequency
     standard station CHU. The radio signal is first demodulated by the
     300-baud modem included in the gadget box, then processed by the
     discipline and finally processed by the Scratchbuilt CHU Receiver
     discipline (type 7). This discipline should be used in raw mode.
     The -DCHU flag is used to compile support for this disipline in the
     NTP daemon. This flag is included if the chudefs.h file is found in
     the /sys/sys directory, or it can be added (or deleted) manually.

There are two sets of line disciplines. The tty_clk.c and chu_clk.c are
designed for use with older BSD systems and are compiled in the kernel.
The tty_clk_STREAMS.c and chu_clk_STREAMS.c are designed for use with
System V streams, in which case they can be either compiled in the
kernel or dynamically loaded. Since these disciplines are small,
unobtrusive, and to nothing unless specifically enabled by an
application program, it probably doesn't matter which method is choosen.

Compiling with the Kernel

The following procedures are for the tty_clk line discipline; for the
chu_clk, change "tty" to "chu".
1.   Copy tty_clk.c into /sys/os and clkdefs.h into /sys/sys.

2.   For SunOS 4.x systems, edit /sys/os/tty_conf.c using some facsimile
     of the following lines:

     #include "clk.h"
     ...
     #if NCLK > 0
     int  clkopen(), clkclose(), clkwrite(), clkinput(), clkioctl();
     #endif
     ...
     #if NCLK > 0
          { clkopen, clkclose, ttread, clkwrite, clkioctl,
            clkinput, nodev, nulldev, ttstart, nullmodem, /* 10 CLK */
            ttselect },
     #else
          { nodev, nodev, nodev, nodev, nodev,
            nodev, nodev, nodev, nodev, nodev,
            nodev },
     #endif

     For Ultrix 4.x systems, edit /sys/data/tty_conf_data.c using some
     facsimile of the following lines:

     #include "clk.h"
     ...
     #if NCLK > 0
     int  clkopen(), clkclose(), clkwrite(), clkinput(), clkioctl();
     #endif
     ...
     #if NCLK > 0
          clkopen, clkclose, ttread, clkwrite, clkioctl, /* 10 CLK */
          clkinput, nodev, nulldev, ttstart, nulldev,
     #else
          nodev, nodev, nodev, nodev, nodev,
          nodev, nodev, nodev, nodev, nodev,
     #endif

     If the kernel doesn't include the ??select() entry in the structure
     (i.e., there are only ten entry points in the structure) just leave
     it out. Also note that the number you give the line discipline (10
     in most kernels) will be specific to that kernel and will depend on
     what is in there already. The entries sould be in order with no
     missing space; that is, if there are only seven disciplines already
     defined and you want to use 10 for good reason, you should define a
     dummy 9th entry like this:

     nodev, nodev, nodev, nodev, nodev, /* 9 CLK */
     nodev, nodev, nodev, nodev, nodev,

3.   Edit /sys/h/ioctl.h and include a line somewhere near where other
     line disciplines are defined like:

     #define  CLKLDISC  10        /* clock line discipline */

     The "10" should match what you used as the number in the preceding
     step.

4.   Edit /sys/conf/files and add a line which looks like:

     sys/tty_clk.c     optional clk

5.   Edit the kernel configuration file to include the following:

     pseudo-device  tty 4  # TTY clock support
6.   Run config, then make clean, then make depend, then make vmunix,
     then reboot the new kernel.

Installing as a streams module

The following procedures are for the tty_clk_STREAMS line discipline;
for the tty_chu_STREAMS, change "clk" to "chu".

1.   Copy your choice to /sys/os, removing the "_STREAMS" in the
     filename.

2.   Copy the clkdefs.h file to /usr/include/sys, then construct a soft
     link to /sys/sys.

3.   Append to /sys/conf.common/files.cmn:

     os/tty_tty.c  optional tty

4.   Edit /sys/sun/str_conf.c. You'll want to add lines in three places.
     It'll be sort of clear where when you see the file.

     #include "tty.h"
     ...
     #if NTTY > 0
     extern struct streamtab ttyinfo;
     #endif
     ...
     #if NTTY > 0
          { "tty", &ttyinfo },
     #endif

5.   Edit /sys/[arch]/conf/[k-name] (substituting the architecture and
     kernel name) to stick in:

     pseudo-device  tty 4  # TTY clock support

     You can change "4" to anything you like. It will limit the number
     of instantiations of the tty discipline you can use at the same
     time.

6.   Run config, then make clean, then make depend, then make vmunix,
     then reboot the new kernel.

Both disciplines can be dynamically loaded using streams procedures
specific to the kernel. Before using the chu_clk discipline, all other
streams modules that may already be on the stack should be popped, then
the discipline should be pushed on the stack.

How to Use the tty_clk Line Discipline

The tty_clk line discipline defines a new ioctl(), CLK_SETSTR, which
takes a pointer to a string of no more than CLK_MAXSTRSIZE characters.
Until the first CLK_SETSTR is performed, the discipline will simply pass
through characters. Once it is passed a string by CLK_SETSTR, any
character in that string will be immediately followed by a timestamp in
Unix timeval format. You can change the string whenever you want by
doing another CLK_SETSTR. The character must be an exact, 8 bit match.
The character '\000' cannot, unfortunately, be used, as it is the string
terminator. Passing an empty string to CLK_SETSTR turns off stamping.
Passing NULL will produce undefined results.

How to Use the tty_chu Line Discipline
The tty_chu line discipline translates data received from the CHU modem
and returns chucode structures, as defined in chudefs.h, and expected by
the Scratchbuilt CHU Receiver reference clock  driver. Depending on the
settings of PEDANTIC and ANAL_RETENTIVE used when compiling the kernel,
some checking of the data may or may not be necessary.

David L. Mills (mills@udel.edu)
ntp-4.2.6p5/ChangeLog0000644000175000017500000024431411675460626013410 0ustar  peterpeter---
(4.2.6p5) 2011/12/24 Released by Harlan Stenn 
(4.2.6p5) 2011/12/24 Released by Harlan Stenn 

---
(4.2.6p5-RC3) 2011/12/08 Released by Harlan Stenn 

* [Bug 2082] 3-char refid sent by ntpd 4.2.6p5-RC2 ends with extra dot.
* [Bug 2085] clock_update() sys_rootdisp calculation omits root delay.
* [Bug 2086] get_systime() should not offset by sys_residual.
* [Bug 2087] sys_jitter calculation overweights sys.peer jitter.
* Ensure NULL peer->dstadr is not accessed in orphan parent selection.

---
(4.2.6p5-RC2) 2011/11/30 Released by Harlan Stenn 

* [Bug 2050] Orphan mode stratum counting to infinity.
* [Bug 2059] optional billboard column "server" does not honor -n.
* [Bug 2066] ntpq lopeers ipv6 "local" column overrun.
* [Bug 2068] ntpd sends nonprintable stratum 16 refid to ntpq.
* [Bug 2069] broadcastclient, multicastclient spin up duplicate
  ephemeral associations without broadcastdelay.
* [Bug 2072] Orphan parent selection metric needs ntohl().
* Exclude not-yet-determined sys_refid from use in loopback TEST12
  (from David Mills).
* Never send KoD rate limiting response to MODE_SERVER response.

---
(4.2.6p5-RC1) 2011/10/18 Released by Harlan Stenn 

* [Bug 2034] Listening address configuration with prefix misapplied.

---
(4.2.6p4) 2011/09/22 Released by Harlan Stenn 

* [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion).
* [Bug 1985] "logconfig =allall" rejected.
* [Bug 2001] ntpdc timerstats reports overruns as handled.
* [Bug 2003] libntpq ntpq_read_assoc_peervars() broken.
* [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be
  consistent with ntpd.
* libopts/file.c fix from Bruce Korb (arg-type=file).

---
(4.2.6p4-RC2) 2011/08/04 Released by Harlan Stenn 

* [Bug 1608] Parse Refclock driver should honor trusttime.
* [Bug 1961] html2man update: distribute ntp-wait.html.
* [Bug 1970] UNLINK_EXPR_SLIST() causes crash if list is empty.
* [Bug 1972] checking for struct rtattr fails.
* [Bug 1975] libntp/mktime.c won't work with 64-bit time_t
* [Bug 1978] [Bug 1134] fix in 4.2.6p4-RC1 doesn't build on older Linux.
* Backport several fixes for Coverity warnings from ntp-dev.
* Backport if_nametoindex() check for hpux.

---
(4.2.6p4-RC1) 2011/07/10 Released by Harlan Stenn 

* [Bug 1134] ntpd fails binding to tentative IPv6 addresses.
* [Bug 1790] Update config.guess and config.sub to detect AIX6.
* [Bug 1961] html2man needs an update.
* Update the NEWS file.

---
(4.2.6p4-beta2) 2011/05/25 Released by Harlan Stenn 

* [Bug 1695] ntpdate takes longer than necessary.
* [Bug 1832] ntpdate doesn't allow timeout > 2s.
* [Bug 1933] WWVB/Spectracom driver timestamps LFs, not CRs.
* Backport utility routines from ntp-dev: mprintf(), emalloc_zero().

---
(4.2.6p4-beta1) 2011/05/16 Released by Harlan Stenn 

* [Bug 1554] peer may stay selected as system peer after becoming
  unreachable.
* [Bug 1921] LOCAL, ACTS drivers with "prefer" excluded from initial
  candidate list.
* [Bug 1923] orphan parent favored over LOCAL, ACTS drivers.
* [Bug 1924] Billboard tally codes sometimes do not match operation,
  variables.
* Enable tickadj-like taming of wildly off-spec Windows clock using
  NTPD_TICKADJ_PPM env. var. specifying baseline slew.
* Upgrade to AutoGen 5.11.9 (and require it).
* Upgrade to libopts 35.0.10 from AutoGen 5.11.9pre8.

---
(4.2.6p3) 2011/01/03 Released by Harlan Stenn 

* [Bug 1764] Palisade driver doesn't build on Linux
* Create and use scripts/check--help when generating .texi files.
* Update bk triggers for the bk-5 release.
* Update genCommitLog for the bk-5 release.
* Update the copyright year.

---
(4.2.6p3-RC12) 2010/12/25 Released by Harlan Stenn 

* [Bug 1458] Can not compile NTP on FreeBSD 4.7.
* [Bug 1510] Add modes 20/21 for driver 8 to support RAWDCF @ 75 baud.
* [Bug 1618] Unreachable code in jjy_start(). (backport from ntp-dev)
* [Bug 1719] ntp-keygen -V crash. (backport)
* [Bug 1740] ntpdc treats many counters as signed. (backport)
* [Bug 1741] Enable multicast reception on each address (Windows).
* [Bug 1742] Fix a typo in an error message in the "build" script.
* [Bug 1743] Display timezone offset when showing time for sntp in the
  local timezone.
* [Bug 1751] Support for Atari FreeMiNT OS.
* [Bug 1754] --version output should be more verbose.
* [Bug 1757] oncore snprintf("%m") doesn't expand %m.
* [Bug 1758] setsockopt IPV6_MULTICAST_IF with wrong ifindex.
* [Bug 1760] ntpd Windows interpolation cannot be disabled.
* [Bug 1762] manycastclient solicitation responses interfere.
* Upgrade to libopts 34.0.9 from AutoGen 5.11.6pre7.
* Relax minimum Automake version to 1.10 with updated libopts.m4.
* Suppress ntp-keygen OpenSSL version display for --help, --version,
  display both build and runtime OpenSSL versions when they differ.
* Clean up m4 quoting in configure.ac, *.m4 files, resolving
  intermittent AC_LANG_PROGRAM possibly undefined errors.
* Clean up the SNTP documentation.
* Other manycastclient repairs:
  Separate handling of scope ID embedded in many in6_addr from ifindex
  used for IPv6 multicasting ioctls.
  Add INT_PRIVACY endpt bit flag for IPv6 RFC 4941 privacy addresses.
  Enable outbound multicast from only one address per interface in the
  same subnet, and in that case prefer embedded MAC address modified
  EUI-64 IPv6 addresses first, then static, and last RFC 4941 privacy
  addresses.
  Use setsockopt(IP[V6]_MULTICAST_IF) before each send to multicast to
  select the local source address, using the correct socket is not
  enough.

---
(4.2.6p3-RC11) 2010/11/28 Released by Harlan Stenn 

* [Bug 1725] ntpd sends multicast from only one address.
* [Bug 1728] In ntp_openssl.m4, don't add -I/usr/include or -L/usr/lib
  to CPPFLAGS or LDFLAGS.
* [Bug 1733] IRIX doesn't have 'head' (affects scripts/checkChangeLog).
* Remove log_msg() and debug_msg() from sntp in favor of msyslog().
* Use a single copy of libopts/, in sntp/.
* Upgrade libopts to 33.3.8.
* Bump minimum Automake version to 1.11, required for AM_COND_IF
  use in LIBOPTS_CHECK.
* Improvements to the 'build' script.

---
(4.2.6p3-RC10) 2010/11/14 Released by Harlan Stenn 

* [Bug 1681] More sntp logging cleanup.
* [Bug 1683] Non-localhost on loopback exempted from nic rules.

---
(4.2.6p3-RC9) 2010/11/10 Released by Harlan Stenn 

* [Bug 1574] sntp:set_time doesn't set tv_usec correctly.
* [Bug 1681] sntp logging cleanup.
* [Bug 1683] Interface binding does not seem to work as intended.
* [Bug 1691] Use first NMEA sentence each second.
* [Bug 1692] packageinfo.sh needs to be "sourced" using ./ .
* [Bug 1709] ntpdate ignores replies with equal receive and transmit
  timestamps.
* Backport sntp from -dev

---
(4.2.6p3-RC8) 2010/10/29 Released by Harlan Stenn 

* [Bug 1685] NMEA driver mode byte confusion.
* First cut at using scripts/checkChangeLog.

---
(4.2.6p3-RC7) 2010/10/25 Released by Harlan Stenn 

* [Bug 1676] NMEA: $GPGLL did not work after fix for Bug 1571.
* Added scripts/checkChangeLog.

---
(4.2.6p3-RC6) 2010/10/24 Released by Harlan Stenn 

* [Bug 1571] NMEA does not relate data to PPS edge.
* [Bug 1572] NMEA time adjustment for GPZDG buggy.
* [Bug 1675] Prohibit includefile remote config.

---
(4.2.6p3-RC5) 2010/10/22 Released by Harlan Stenn 

* [Bug 1649] Require NMEA checksum if $GPRMC or previously seen.
* [Bug 1669] NTP 4.2.6p2 fails to compile on IBM AIX 5.3.

---
(4.2.6p3-RC4) 2010/10/16 Released by Harlan Stenn 

* [Bug 1584] wrong SNMP type for precision, resolution.
* [Bug 1659] Need CLOCK_TRUETIME not CLOCK_TRUE.
* [Bug 1665] is_anycast() u_int32_t should be u_int32.
* ntpsnmpd, libntpq warning cleanup.

---
(4.2.6p3-RC3) 2010/10/14 Released by Harlan Stenn 

* [Bug 750] Non-existing device causes coredump with RIPE-NCC driver.
* [Bug 1080] ntpd on ipv6 routers very chatty.
* [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
* [Bug 1581] printf format string mismatch leftover.
* [Bug 1584] ntpsnmpd OID must be mib-2.197.
* [Bug 1643] Range-check the decoding of the RIPE-NCC status codes.
* [Bug 1644] cvo.sh should use lsb_release to identify linux distros.
* [Bug 1659] Support Truetime Satellite Clocks on Windows.
* [Bug 1660] On some systems, test is in /usr/bin, not /bin.
* [Bug 1661] Re-indent refclock_ripencc.c.

---
(4.2.6p3-RC2) 2010/09/25 Released by Harlan Stenn 

* [Bug 1635] "filegen ... enable" is not default.
* [Bug 1636] yyparse() segfault after denied filegen remote config.

---
(4.2.6p3-RC1) 2010/09/18 Released by Harlan Stenn 

* [Bug 1344] ntpd on Windows exits without logging cause.

---
(4.2.6p3-beta1) 2010/09/11 Released by Harlan Stenn 

* [Bug 1573] Miscalculation of offset in sntp.
* [Bug 1595] empty last line in key file causes duplicate key to be added
* [Bug 1597] packet processing ignores RATE KoD packets, because of
  a bug in string comparison.
* [Bug 1581] ntp_intres.c size_t printf format string mismatch.

---
(4.2.6p2) 2010/07/09 Released by Harlan Stenn 

* [Bug 1581] size_t printf format string mismatches, IRIG string buffers
  undersized.  Mostly backported from earlier ntp-dev fixes by Juergen
  Perlinger.

---
(4.2.6p2-RC7) 2010/06/19 Released by Harlan Stenn 

* [Bug 1570] serial clock drivers get outdated input from kernel tty
  line buffer after startup
* [Bug 1575] use 'snprintf' with LIB_BUFLENGTH in inttoa.c, tvtoa.c and
  utvtoa.c
* [Bug 1576] sys/sysctl.h depends on sys/param.h on OpenBSD.

---
(4.2.6p2-RC6) 2010/06/12 Released by Harlan Stenn 

* [Bug 715] libisc Linux IPv6 interface iteration drops multicast flags.

---
(4.2.6p2-RC5) 2010/06/03 Released by Harlan Stenn 

* [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1.
* [Bug 1565] sntp/crypto.c compile fails on MacOS over vsnprintf().
* Windows port: do not exit in ntp_timestamp_from_counter() without
  first logging the reason.
* Support "passwd blah" syntax in ntpq.

---
(4.2.6p2-RC4) 2010/05/19 Released by Harlan Stenn 

* [Bug 1555] 4.2.6p2-RC3 sntp illegal C (mixed code and declarations).

---
(4.2.6p2-RC3) 2010/05/11 Released by Harlan Stenn 

* [Bug 1325] unreachable code in sntp recv_bcst_data().
* [Bug 1459] sntp MD5 authentication does not work with ntpd.
* [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain
  socket by default.  Provide a command-line 'socket name' option.
* [Bug 1538] update refclock_nmea.c's call to getprotobyname().
* [Bug 1541] Fix wrong keyword for "maxclock".
* [Bug 1552] update and complete broadcast and crypto features in sntp.
* [Bug 1553] sntp/configure.ac OpenSSL support.
* Escape unprintable characters in a refid in ntpq -p billboard.
* Simplify hash client code by providing OpenSSL EVP_*() API when built
  without OpenSSL.  (from ntp-dev)
* Do not depend on ASCII values for ('A' - '0'), ('a' - '0') in sntp.
* Windows compiling hints/winnt.html update from G. Sunil Tej.

---
(4.2.6p2-RC2) 2010/04/27 Released by Harlan Stenn 

* [Bug 1465] Make sure time from TS2100 is not invalid (backport from
  ntp-dev).
* [Bug 1528] Fix EDITLINE_LIBS link order for ntpq and ntpdc.
* [Bug 1534] win32/include/isc/net.h conflicts with VC++ 2010 errno.h.
* [Bug 1535] "restrict -4 default" and "restrict -6 default" ignored.
* Remove --with-arlib from br-flock.

---
(4.2.6p2-RC1) 2010/04/18 Released by Harlan Stenn 

* [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
* [Bug 1504] ntpdate tickles ntpd "discard minimum 1" rate limit if
  "restrict ... limited" is used.
* [Bug 1518] Windows ntpd should lock to one processor more
  conservatively.
* [Bug 1522] Enable range syntax "trustedkey (301 ... 399)".
* Update html/authopt.html controlkey, requestkey, and trustedkey docs.

---
(4.2.6p1) 2010/04/09 Released by Harlan Stenn 
(4.2.6p1-RC6) 2010/03/31 Released by Harlan Stenn 

* [Bug 1514] Typo in ntp_proto.c: fabs(foo < .4) should be fabs(foo) < .4.
* [Bug 1464] synchronization source wrong for refclocks ARCRON_MSF (27)
  and SHM (28).
* Correct Windows port's refclock_open() to return 0 on failure not -1.
* Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
  refclock_open() on failure.
* Correct "SIMUL=4 ./flock-build -1" to prioritize -1/--one.

---
(4.2.6p1-RC5) 2010/02/09 Released by Harlan Stenn 

* [Bug 1140] Clean up debug.html, decode.html, and ntpq.html.
* [Bug 1438] Remove dead code from sntp/networking.c.
* [Bug 1477] 1st non-gmake make in clone w/VPATH can't make COPYRIGHT.
* [Bug 1478] linking fails with undefined reference EVP_MD_pkey_type.
* [Bug 1479] Compilation fails because of not finding readline headers.
* [Bug 1480] snprintf() cleanup caused unterminated refclock IDs.
* [Bug 1484] ushort is not defined in QNX6.

---
(4.2.6p1-RC4) 2010/02/04 Released by Harlan Stenn 

* [Bug 1455] ntpd does not try /etc/ntp.audio as documented.
* [Bug 1467] Fix bogus rebuild of sntp/sntp.html
* [Bug 1470] "make distdir" in $srcdir builds keyword-gen, libntp.a.
* [Bug 1473] "make distcheck" before build can't make sntp/version.m4.
* [Bug 1474] ntp_keygen needs LCRYPTO after libntp.a.
* Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
* Fix widely cut-n-pasted bug in refclock shutdown after failed start.
* Remove some dead code checking for emalloc() returning NULL.
* Remove arlib.

---
(4.2.6p1-RC3) 2010/01/24 Released by Harlan Stenn 

* Use TZ=UTC instead of TZ= when calling date in scripts/mkver.in .
* [Bug 1448] Some macros not correctly conditionally or absolutely defined
  on Windows.
* [Bug 1449] ntpsim.h in ntp_config.c should be used conditionally.
* [Bug 1450] Option to exclude warnings not unconditionally defined on Windows.
* [Bug 1127] Properly check the return of X590_verify() - missed one.
* [Bug 1439] .texi generation must wait until after binary is linked.
* [Bug 1440] Update configure.ac to support kfreebsd.
* [Bug 1445] IRIX does not have -lcap or support linux capabilities.
* [Bug 1451] CID 115: sntp leaks KoD entry when updating existing.
* [Bug 1453] Use $CC in config.cache filename in ./build script.

---
(4.2.6p1-RC2) 2009/12/25 Released by Harlan Stenn 

* [Bug 1411] Fix status messages in refclock_oncore.c.
* [Bug 1416] MAXDNAME undefined on Solaris 2.6.
* [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
* [Bug 1424] Fix check for rtattr (rtnetlink.h).
* [Bug 1425] unpeer by association ID sets up for duplicate free().
* [Bug 1426] scripts/VersionName needs . on the search path.
* [Bug 1427] quote missing in ./build - shows up on NetBSD.
* [Bug 1428] Use AC_HEADER_RESOLV to fix breaks from resolv.h
* [Bug 1429] ntpd -4 option does not reliably force IPv4 resolution.
* [Bug 1431] System headers must come before ntp headers in ntp_intres.c .
* [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some.
* [Bug 1435] sntp: Test for -lresolv using the same tests as in ntp.

---
(4.2.6p1-RC1) 2009/12/20 Released by Harlan Stenn 

* [Bug 1409] Put refclock_neoclock4x.c under the NTP COPYRIGHT notice.
  This should allow debian and other distros to add this refclock driver
  in further distro releases.
  Detect R2 hardware releases.
* [Bug 1412] m4/os_cflags.m4 caches results that depend on $CC.
* [Bug 1413] test OpenSSL headers regarding -Wno-strict-prototypes.
* [Bug 1414] Enable "make distcheck" success with BSD make.
* [Bug 1415] Fix Mac OS X link problem.
* [Bug 1418] building ntpd/ntpdc/ntpq statically with ssl fails.
* Build infrastructure updates to enable beta releases of ntp-stable.

---
(4.2.6) 2009/12/09 Released by Harlan Stenn 
* Include (4.2.4p8) - [Sec 1331] DoS with mode 7 packets - CVE-2009-3563.
* [Bug 508] Fixed leap second handling for Windows.
(4.2.5p250-RC) 2009/11/30 Released by Harlan Stenn 
* sntp documentation updates.
* [Bug 761] internal resolver does not seem to honor -4/-6 qualifiers
* [Bug 1386] Deferred DNS doesn't work on NetBSD
* [Bug 1391] avoid invoking autogen twice for .c and .h files.
* [Bug 1397] shmget() refclock_shm failing because of file mode.
* Pass no_needed to ntp_intres as first part of fixing [Bug 975].
* Add ./configure --enable-force-defer-DNS to help debugging.
(4.2.5p249-RC) 2009/11/28 Released by Harlan Stenn 
* [Bug 1400] An empty KOD DB file causes sntp to coredump.
* sntp: documentation cleanup.
* sntp: clean up some error messages.
* sntp: Use the precision to control how many offset digits are shown.
* sntp: Show root dispersion.
* Cleanup from the automake/autoconf upgrades.
(4.2.5p248-RC) 2009/11/26 Released by Harlan Stenn 
* Prepare for the generation of sntp.html.
* Documentation changes from Dave Mills.
* [Bug 1387] Storage leak in ntp_intres (minor).
* [Bug 1389] buffer overflow in refclock_oncore.c
* [Bug 1391] .texi usage text from installed, not built binaries.
* [Bug 1392] intres retries duplicate assocations endlessly.
* Correct *-opts.h dependency so default 'get' action isn't used.
(4.2.5p247-RC) 2009/11/20 Released by Harlan Stenn 
* [Bug 1142] nodebug builds shed no light on -d, -D option failure.
* [Bug 1179] point out the problem with -i/--jaildir and -u/--user when
  they are disabled by configure.
* [Bug 1308] support systems that lack fork().
* [Bug 1343] sntp doesn't link on Solaris 7, needs -lresolv.
(4.2.5p246-RC) 2009/11/17 Released by Harlan Stenn 
* Upgrade to autogen-5.10
* [Bug 1378] Unnecessary resetting of peers during interface update.
* [Bug 1382] p245 configure --disable-dependency-tracking won't build.
* [Bug 1384] ntpq :config core dumped with a blank password.
(4.2.5p245-RC) 2009/11/14 Released by Harlan Stenn 
* Cleanup from Dave Mills.
* [Bug 1343] sntp illegal C does not compile on Solaris 7.
* [Bug 1381] Version .deps generated include file dependencies to allow
  known dependency-breaking changes to force .deps to be cleaned,
  triggered by changing the contents of deps-ver and/or sntp/deps-ver.
(4.2.5p244-RC) 2009/11/12 Released by Harlan Stenn 
* keygen.html updates from Dave Mills.
* [Bug 1003] ntpdc unconfig command doesn't prompt for keyid.
* [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available
  digest types.
* ntp-keygen, Autokey OpenSSL build vs. run version mismatch is now a
  non-fatal warning.
(4.2.5p243-RC) 2009/11/11 Released by Harlan Stenn 
* [Bug 1226] Fix deferred DNS lookups.
* new crypto signature cleanup.
(4.2.5p242-RC) 2009/11/10 Released by Harlan Stenn 
* [Bug 1363] CID 92 clarify fallthrough case in clk_trimtsip.c
* [Bug 1366] ioctl(TIOCSCTTY, 0) fails on NetBSD *[0-2].* > 3.99.7.
* [Bug 1368] typos in libntp --without-crypto case
* [Bug 1371] deferred DNS lookup failing with INFO_ERR_AUTH.
* CID 87 dead code in ntpq.c atoascii().
* Fix authenticated ntpdc, broken in p240.
* Stub out isc/mem.h, shaving 47k from a MIPS ntpd binary.
* Shrink keyword scanner FSM entries from 64 to 32 bits apiece.
* Documention updates from Dave Mills.
* authkeys.c cleanup from Dave Mills.
(4.2.5p241-RC) 2009/11/07 Released by Harlan Stenn 
* html/authopt.html update from Dave Mills.
* Remove unused file from sntp/Makefile.am's distribution list.
* new crypto signature cleanup.
(4.2.5p240-RC) 2009/11/05 Released by Harlan Stenn 
* [Bug 1364] clock_gettime() not detected, need -lrt on Debian 5.0.3.
* Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2).
(4.2.5p239-RC) 2009/10/30 Released by Harlan Stenn 
* [Bug 1357] bogus assert from refclock_shm.
* [Bug 1359] Debug message cleanup.
* CID 101: more pointer/array cleanup.
* [Bug 1356] core dump from refclock_nmea when can't open /dev/gpsU.
* [Bug 1358] AIX 4.3 sntp/networking.c IPV6_JOIN_GROUP undeclared.
* CID 101: pointer/array cleanup.
(4.2.5p238-RC) 2009/10/27 Released by Harlan Stenn 
* Changes from Dave Mills.
* driver4.html updates from Dave Mills.
* [Bug 1252] PPSAPI cleanup on ntpd/refclock_wwvb.c.
* [Bug 1354] libtool error building after bootstrap with Autoconf 2.64.
* Allow NTP_VPATH_HACK configure test to handle newer gmake versions.
* CIDs 94-99 make it more clearly impossible for sock_hash() to return
  a negative number.
* CID 105, 106 ensure ntpdc arrays are not overrun even if callers
  misbehave.
* CID 113 use va_end() in refclock_true.c true_debug().
* Get rid of configure tests for __ss_family and __ss_len when the more
  common ss_family and ss_len are present.
(4.2.5p237-RC) 2009/10/26 Released by Harlan Stenn 
* [Bug 610] NMEA support for using PPSAPI on a different device.
* [Bug 1238] use only fudge time2 to offset NMEA serial timestamp.
* [Bug 1355] ntp-dev won't compile on OpenBSD 4.6.
(4.2.5p236-RC) 2009/10/22 Released by Harlan Stenn 
* Cleanup from Dave Mills.
* [Bug 1343] ntpd/ntp_io.c close_fd() does not compile on Solaris 7.
* [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix.
* Do not attempt to execute built binaries from ntpd/Makefile when
  cross-compiling (keyword-gen and ntpd --saveconfigquit).
* sntp/main.c: Remove duplicate global adr_buf[] (also defined in
  networking.c) which Piotr Grudzinski identified breaking his build.
* Correct in6addr_any test in configure.ac to attempt link too.
(4.2.5p235-RC) 2009/10/18 Released by Harlan Stenn 
* [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
(4.2.5p234-RC) 2009/10/16 Released by Harlan Stenn 
* [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and
  move #define strerror... to a header not used by lib/isc code.
* [Bug 1345] illegal 'grep' option prevents compilation.
* [Bug 1346] keyword scanner broken where char defaults to unsigned.
* [Bug 1347] ntpd/complete.conf missing multicastclient test case.
(4.2.5p233-RC) 2009/10/15 Released by Harlan Stenn 
* [Bug 1337] cast setsockopt() v4 address pointer to void *.
* [Bug 1342] ignore|drop one IPv6 address on an interface blocks all
  addresses on that interface.
* Documentation cleanup and updates.
(4.2.5p232-RC) 2009/10/14 Released by Harlan Stenn 
* [Bug 1302] OpenSSL under Windows needs applink support.
* [Bug 1337] fix incorrect args to setsockopt(fd, IP_MULTICAST_IF,...).
* [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion.
* [Bug 1341] NMEA driver requires working PPSAPI #ifdef HAVE_PPSAPI.
* Construct ntpd keyword scanner finite state machine at compile time
  rather than at runtime, shrink entries from 40+ to 8 bytes.
* Update documentation for ntpq --old-rv, saveconfig, saveconfigdir,
  ntpd -I -L and -M, and interface/nic rules. (From Dave Hart)
* [Bug 1337] fix incorrect args to setsockopt(fd, IP_MULTICAST_IF,...)
(4.2.5p231-RC) 2009/10/10 Released by Harlan Stenn 
* [Bug 1335] Broadcast client degraded by wildcard default change.
(4.2.5p230-RC) 2009/10/09 Released by Harlan Stenn 
* Start the 4.2.6 Release Candidate cycle.
* Broadcast and transit phase cleanup from Dave Mills.
(4.2.5p229) 2009/10/07 Released by Harlan Stenn 
* [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'.
* Change ntpsnmpd/Makefile.am include file order to fix FreeBSD build.
(4.2.5p228) 2009/10/06 Released by Harlan Stenn 
* Reclaim syntax tree memory after application in ntpd built with
  configure --disable-saveconfig.
* [Bug 1135] ntpq uses sizeof(u_long) where sizeof(u_int32) is meant.
* [Bug 1333] ntpd --interface precedence over --novirtualips lost.
(4.2.5p227) 2009/10/05 Released by Harlan Stenn 
* [Bug 1135] :config fails with "Server disallowed request"
* [Bug 1330] disallow interface/nic rules when --novirtualips or
  --interface are used.
* [Bug 1332] ntpq -c 'rv 0 variablename' returns extra stuff.
* Add test of ntpd --saveconfigquit fidelity using new complete.conf.
* Documentation updates from Dave Hart/Dave Mills.
(4.2.5p226) 2009/10/04 Released by Harlan Stenn 
* [Bug 1318] Allow multiple -g options on ntpd command line.
* [Bug 1327] ntpq, ntpdc, ntp-keygen -d & -D should work with configure
  --disable-debugging.
* Add ntpd --saveconfigquit  option for future build-time
  testing of saveconfig fidelity.
* Clockhop and autokey cleanup from Dave Mills.
* Documentation updates from Dave Mills.
(4.2.5p225) 2009/09/30 Released by Harlan Stenn 
* authopt documentation changes from Dave Mills/Dave Hart.
* [Bug 1324] support bracketed IPv6 numeric addresses for restrict.
(4.2.5p224) 2009/09/29 Released by Harlan Stenn 
* Clockhop and documentation fixes from Dave Mills.
* Remove "tos maxhop" ntp.conf knob.
(4.2.5p223) 2009/09/28 Released by Harlan Stenn 
* [Bug 1321] build doesn't work if . isn't on $PATH.
* [Bug 1323] Implement "revoke #" to match documentation, deprecate
  "crypto revoke #".
(4.2.5p222) 2009/09/27 Released by Harlan Stenn 
* Update libisc code using bind-9.6.1-P1.tar.gz, rearrange our copy to
  mirror the upstream layout (lib/isc/...), and merge in NTP-local
  modifications to libisc.  There is a new procedure to ease future
  libisc merges using a separate "upstream" bk repo.  That will enable
  normal bk pull automerge to handle carrying forward any local changes
  and should enable us to take updated libisc snapshots more often.
* Updated build and flock-build scripts.  flock-build --one is a way
  to perform a flock-build compatible solitary build, handy for a repo
  clone's first build on a machine with autoconf, automake, etc.
* Compiling ntp_parser.y using BSD make correctly places ntp_parser.h
  in the top-level ntpd directory instead of A.*/ntpd.
* bootstrap script updated to remove potentially stale .deps dirs.
* Remove unneeded Makefile.am files from the lib/isc/include tree.
(4.2.5p221) 2009/09/26 Released by Harlan Stenn 
* [Bug 1316] segfault if refclock_nmea can't open file.
* [Bug 1317] Distribute cvo.sh.
(4.2.5p220) 2009/09/25 Released by Harlan Stenn 
* Rearrange libisc code to match the upstream layout in BIND.  This is
  step one of two, changing the layout but keeping our existing libisc.
(4.2.5p219) 2009/09/24 Released by Harlan Stenn 
* [Bug 1315] "interface ignore 0.0.0.0" is ignored.
* add implicit "nic ignore all" rule before any rules from ntp.conf, so
  "nic listen eth0" alone means the same as "-I eth0".
* add wildcard match class for interface/nic rules.
* fix mistaken carryover of prefixlen from one rule to the next.
* Ensure IPv6 localhost address ::1 is included in libisc's Windows IPv6
  address enumeration, allowing ntpq and ntpdc's hardcoding to 127.0.0.1 
  on Windows to end.
(4.2.5p218) 2009/09/21 Released by Harlan Stenn 
* [Bug 1314] saveconfig emits -4 and -6 on when not given.
* correct parsing and processing of setvar directive.
* highlight location of ntpq :config syntax errors with ^.
* clarify (former) NO_ARG, SINGLE_ARG, MULTIPLE_ARG renaming to
  FOLLBY_TOKEN, FOLLBY_STRING, FOLLBY_STRINGS_TO_EOC.
* parser, saveconfig cleanup to store T_ identifiers in syntax tree.
(4.2.5p217) 2009/09/20 Released by Harlan Stenn 
* [Bug 1300] reject remote configuration of dangerous items.
(4.2.5p216) 2009/09/19 Released by Harlan Stenn 
* [Bug 1312] ntpq/ntpdc MD5 passwords truncated to 8 chars on Suns.
* CID 10 missing free(up); in refclock_palisade.c error return, again.
* CID 83 added assertion to demonstrate config_nic_rules() does not
  call strchr(NULL, '/').
(4.2.5p215) 2009/09/18 Released by Harlan Stenn 
* [Bug 1292] Workaround last VC6 unsigned __int64 kink.
(4.2.5p214) 2009/09/17 Released by Harlan Stenn 
* [Bug 1303] remove top-level "autokey" directive.
* use "nic listen 192.168.0.0/16" instead of
  "nic listen 192.168.0.0 prefixlen 16".
(4.2.5p213) 2009/09/16 Released by Harlan Stenn 
* [Bug 1310] fix Thunderbolt mode in refclock_palisade.c
(4.2.5p212) 2009/09/15 Released by Harlan Stenn 
* [Bug 983] add interface [listen | ignore | drop] ... directive.
* [Bug 1243] MD5auth_setkey zero-fills key from first zero octet.
* [Bug 1295] leftover fix, do not crash on exit in free_config_trap()
  when "trap 1.2.3.4" is used without any further options.
* [Bug 1311] 4.2.5p211 doesn't build in no-debug mode.
* document interface (alias nic) and unpeer.
* Correct syntax error line & column numbers.
* CID 79: kod_init_kod_db() fails to fclose(db_s) in two error paths.
* CID 80: attempt to quiet Coverity false positive re: leaking "reason"
  in main().
* Documentation updates from Dave Mills.
* CID 81: savedconfig leaked in save_config().
* Make the code agree with the spec and the book (Dave Mills).
(4.2.5p211) 2009/09/14 Released by Harlan Stenn 
* [Bug 663] respect ntpq -c and -p order on command line.
* [Bug 1292] more VC6 unsigned __int64 workarounds.
* [Bug 1296] Added Support for Trimble Acutime Gold.
(4.2.5p210) 2009/09/06 Released by Harlan Stenn 
* [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros for Windows
  and remove unnecessary reference to applink.c for Windows
* [Bug 1295] trap directive options are not optional.
* [Bug 1297] yylex() must always set yylval before returning.
(4.2.5p209) 2009/09/01 Released by Harlan Stenn 
* [Bug 1290] Fix to use GETTIMEOFDAY macro
* [Bug 1289] Update project files for VC6, VS2003, VS2005, VS 2008
(4.2.5p208) 2009/08/30 Released by Harlan Stenn 
* [Bug 1293] make configuration dumper ready for release, specifically:
* rename ntpq dumpcfg command to "saveconfig".
* require authentication for saveconfig.
* "restrict ... nomodify" prevents saveconfig and :config.
* "saveconfig ." shorthand to save to startup configuration file.
* support strftime() substitution in saveconfig arg to timestamp
  the output filename, for example "saveconfig %Y%m%d-%H%M%S.conf".
* display saveconfig response message from ntpd in ntpq.
* save output filename in "savedconfig" variable, fetched with ntpq -c
  "rv 0 savedconfig".
* document saveconfig in html/ntpq.html.
* add ./configure --disable-saveconfig to build a smaller ntpd.
* log saveconfig failures and successes to syslog.
(4.2.5p207) 2009/08/29 Released by Harlan Stenn 
* [Bug 1292] Minor Windows source tweaks for VC6-era SDK headers.
(4.2.5p206) 2009/08/26 Released by Harlan Stenn 
* accopt.html typo fixes from Dave Mills.
* [Bug 1283] default to remembering KoD in sntp.
* clean up numerous sntp/kod_management.c bugs.
* use all addresses resolved from each DNS name in sntp.
(4.2.5p205) 2009/08/18 Released by Harlan Stenn 
* accopt.html typo fixes from Dave Mills.
* [Bug 1285] Log ntpq :config/config-from-file events.
* [Bug 1286] dumpcfg omits statsdir, mangles filegen.
(4.2.5p204) 2009/08/17 Released by Harlan Stenn 
* [Bug 1284] infinite loop in ntpd dumping more than one trustedkey
(4.2.5p203) 2009/08/16 Released by Harlan Stenn 
* Add ntpq -c dumpcfg, Google Summer of Code project of Max Kuehn
(4.2.5p202) 2009/08/14 Released by Harlan Stenn 
* install the binary and man page for sntp.
(4.2.5p201) 2009/08/13 Released by Harlan Stenn 
* sntp: out with the old, in with the new.
(4.2.5p200) 2009/08/12 Released by Harlan Stenn 
* [Bug 1281] Build ntpd on Windows without big SDK download, burn,
  and install by checking in essentially unchanging messages.mc build
  products to avoid requiring mc.exe, which is not included with VC++
  2008 EE.
(4.2.5p199) 2009/08/09 Released by Harlan Stenn 
* [Bug 1279] Cleanup for warnings from Veracode static analysis.
(4.2.5p198) 2009/08/03 Released by Harlan Stenn 
* Upgrade to autogen-5.9.9-pre5.
(4.2.5p197) 2009/07/30 Released by Harlan Stenn 
* The build script now has . at the end of PATH for config.guess.
(4.2.5p196) 2009/07/29 Released by Harlan Stenn 
* [Bug 1272] gsoc_sntp IPv6 build problems under HP-UX 10.
* [Bug 1273] CID 10: Palisade leaks unit struct in error path.
* [Bug 1274] CID 67: ensure resolve_hosts() output count and pointers
  are consistent.
* [Bug 1275] CID 45: CID 46: old sntp uses uninitialized guesses[0],
  precs[0].
* [Bug 1276] CID 52: crypto_xmit() may call crypto_alice[23]()
  with NULL peer.
(4.2.5p195) 2009/07/27 Released by Harlan Stenn 
* cvo.sh: Add support for CentOS, Fedora, Slackware, SuSE, and QNX.
(4.2.5p194) 2009/07/26 Released by Harlan Stenn 
* Documentation updates from Dave Mills.
* Use scripts/cvo.sh in the build script to get better subdir names.
(4.2.5p193) 2009/07/25 Released by Harlan Stenn 
* [Bug 1261] CID 34: simulate_server() rbuf.msg_flags uninitialized.
* [Bug 1262] CID 35: xpkt.mac uninitialized in simulate_server().
* [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks 
  uninitialized tm_zone (arc, chronolog, dumbclock, pcf).
* [Bug 1264] CID 64: gsoc_sntp on_wire() frees wrong ptr receiving KoD.
* [Bug 1265] CID 65: CID 66: gsoc_sntp on_wire() leaks x_pkt, r_pkt.
* [Bug 1266] CID 39: datum_pts_start() uninitialized arg.c_ospeed.
* [Bug 1267] CID 44: old sntp handle_saving() writes stack garbage to
  file when clearing.
* [Bug 1268] CID 63: resolve_hosts() leaks error message buffer.
* [Bug 1269] CID 74: use assertion to ensure move_fd() does not return
  negative descriptors.
* [Bug 1270] CID 70: gsoc_sntp recv_bcst_data mdevadr.ipv6mr_interface
  uninitialized.
(4.2.5p192) 2009/07/24 Released by Harlan Stenn 
* [Bug 965] CID 42: ss_family uninitialized.
* [Bug 1250] CID 53: kod_init_kod_db() overruns kod_db malloc'd buffer.
* [Bug 1251] CID 68: search_entry() mishandles dst argument.
* [Bug 1252] CID 32: Quiet Coverity warning with assertion.
* [Bug 1253] CID 50: gsoc_sntp/crypto.c auth_init() always returns a 
  list with one entry.
* [Bug 1254] CID 56: tv_to_str() leaks a struct tm each call.
* [Bug 1255] CID 55: pkt_output() leaks a copy of each packet.
* [Bug 1256] CID 51: Coverity doesn't recognize our assertion macros as
  terminal.
* [Bug 1257] CID 57: gsoc_sntp auth_init() fails to fclose(keyfile).
* [Bug 1258] CID 54: gsoc_sntp resolve_hosts() needs simplification.
* [Bug 1259] CID 59: gsoc_sntp recv_bcast_data() fails to free(rdata)
  on error paths.
* [Bug 1260] CID 60: gsoc_sntp recvpkt() fails to free(rdata).
* Updated to AutoGen-5.9.9pre2.
(4.2.5p191) 2009/07/21 Released by Harlan Stenn 
* Updated to AutoGen-5.9.9pre1.
(4.2.5p190) 2009/07/20 Released by Harlan Stenn 
* Updated to AutoGen-5.9.8.
* [Bug 1248] RES_MSSNTP typo in ntp_proto.c.
* [Bug 1246] use a common template for singly-linked lists, convert most
  doubly-linked lists to singly-linked.
* Log warning about signd blocking when restrict mssntp used.
(4.2.5p189) 2009/07/16 Released by Harlan Stenn 
* Documentation cleanup from Dave Mills.
(4.2.5p188) 2009/07/15 Released by Harlan Stenn 
* [Bug 1245] Broken xmt time sent in fast_xmit() of 4.2.5p187.
(4.2.5p187) 2009/07/11 Released by Harlan Stenn 
* [Bug 1042] multicast listeners IPv4+6 ignore new interfaces.
* [Bug 1237] Windows serial code treat CR and LF both as line
  terminators.
* [Bug 1238] use fudge time2 for serial timecode offset in NMEA driver.
* [Bug 1242] Remove --enable-wintime, symmetric workaround is now
  always enabled.
* [Bug 1244] NTP_INSIST(fd != maxactivefd) failure in intres child
* Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills.
(4.2.5p186) 2009/07/08 Released by Harlan Stenn 
* ntp_proto.c cleanup from Dave Mills.
(4.2.5p185) 2009/07/01 Released by Harlan Stenn 
* Documentation updates from Dave Mills.
* [Bug 1234] convert NMEA driver to use common PPSAPI code.
* timepps-Solaris.h pps_handle_t changed from pointer to scalar
* Spectracom refclock added to Windows port of ntpd
* [Bug 1236] Declaration order fixed.
* Bracket private ONCORE debug statements with #if 0 rather than #ifdef
  DEBUG
* Delete ONCORE debug statement that is now handled elsewhere.
(4.2.5p184) 2009/06/24 Released by Harlan Stenn 
* [Bug 1233] atom refclock fudge time1 sign flipped in 4.2.5p164.
(4.2.5p183) 2009/06/23 Released by Harlan Stenn 
* [Bug 1196] setsockopt(SO_EXCLUSIVEADDRUSE) can fail on Windows 2000
  and earlier with WSAINVAL, do not log a complaint in that case.
* [Bug 1210] ONCORE driver terminates ntpd without logging a reason.
* [Bug 1218] Correct comment in refclock_oncore on /etc/ntp.oncore*
  configuration file search order.
* Change ONCORE driver to log using msyslog as well as to any
  clockstats file.
* [Bug 1231] ntpsnmpd build fails after sockaddr union changes.
(4.2.5p182) 2009/06/18 Released by Harlan Stenn 
* Add missing header dependencies to the ntpdc layout verification.
* prefer.html updates from Dave Mills.
* [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows
* [Bug 1215] unpeer by association ID
* [Bug 1225] Broadcast address miscalculated on Windows 4.2.5p180
* [Bug 1229] autokey segfaults in cert_install().
* Use a union for structs sockaddr, sockaddr_storage, sockaddr_in, and
  sockaddr_in6 to remove casts and enable type checking.  Collapse
  some previously separate IPv4/IPv6 paths into a single codepath.
(4.2.5p181) 2009/06/06 Released by Harlan Stenn 
* [Bug 1206] Required compiler changes for Windows
* [Bug 1084] PPSAPI for ntpd on Windows with DLL backends
* [Bug 1204] Unix-style refclock device paths on Windows
* [Bug 1205] partial fix, disable RDTSC use by default on Windows
* [Bug 1208] decodenetnum() buffer overrun on [ with no ]
* [Bug 1211] keysdir free()d twice #ifdef DEBUG
* Enable ONCORE, ARCRON refclocks on Windows (untested)
(4.2.5p180) 2009/05/29 Released by Harlan Stenn 
* [Bug 1200] Enable IPv6 in Windows port
* Lose FLAG_FIXPOLL, from Dave Mills.
(4.2.5p179) 2009/05/23 Released by Harlan Stenn 
* [Bug 1041] xmt -> aorg timestamp cleanup from Dave Mills,
  reported by Dave Hart.
* [Bug 1193] Compile error: conflicting types for emalloc.
* [Bug 1196] VC6 winsock2.h does not define SO_EXCLUSIVEADDRUSE.
* Leap/expire cleanup from Dave Mills.
(4.2.5p178) 2009/05/21 Released by Harlan Stenn 
* Provide erealloc() and estrdup(), a la emalloc().
* Improve ntp.conf's parser error messages.
* [Bug 320] "restrict default ignore" does not affect IPv6.
* [Bug 1192] "restrict -6 ..." reports a syntax error.
(4.2.5p177) 2009/05/18 Released by Harlan Stenn 
* Include (4.2.4p7)
* [Bug 1174] nmea_shutdown assumes that nmea has a unit assigned
* [Bug 1190] NMEA refclock fudge flag4 1 obscures position in timecode
* Update NMEA refclock documentation in html/drivers/driver20.html
(4.2.5p176) 2009/05/13 Released by Harlan Stenn 
* [Bug 1154] mDNS registration should be done later, repeatedly and only
  if asked for. (second try for fix)
(4.2.5p175) 2009/05/12 Released by Harlan Stenn 
* Include (4.2.4p7-RC7)
* [Bug 1180] ntpd won't start with more than ~1000 interfaces
* [Bug 1182] Documentation typos and missing bits.
* [Bug 1183] COM port support should extend past COM3
* [Bug 1184] ntpd is deaf when restricted to second IP on the same net
* Clean up configure.ac NTP_CACHEVERSION interface, display cache
  version when clearing.  Fixes a regression.
(4.2.5p174) 2009/05/09 Released by Harlan Stenn 
* Stale leapsecond file fixes from Dave Mills.
(4.2.5p173) 2009/05/08 Released by Harlan Stenn 
* Include (4.2.4p7-RC6)
(4.2.5p172) 2009/05/06 Released by Harlan Stenn 
* [Bug 1175] Instability in PLL daemon mode.
* [Bug 1176] refclock_parse.c does not compile without PPSAPI.
(4.2.5p171) 2009/05/04 Released by Harlan Stenn 
* Autokey documentation cleanup from Dave Mills.
* [Bug 1171] line editing libs found without headers (Solaris 11)
* [Bug 1173] NMEA refclock fails with Solaris PPSAPI
* Fix problem linking msntp on Solaris when sntp subdir is configured
  before parent caused by different gethostent library search order.
* Do not clear config.cache when it is  empty.
(4.2.5p170) 2009/05/02 Released by Harlan Stenn 
* [Bug 1152] adjust PARSE to new refclock_pps logic
* Include (4.2.4p7-RC5)
* loopfilter FLL/PLL crossover cleanup from Dave Mills.
* Documentation updates from Dave Mills.
* ntp-keygen cleanup from Dave Mills.
* crypto API cleanup from Dave Mills.
* Add NTP_CACHEVERSION mechanism to ignore incompatible config.cache
* Enable gcc -Wstrict-overflow for gsoc_sntp as well
(4.2.5p169) 2009/04/30 Released by Harlan Stenn 
* [Bug 1171] Note that we never look for -lreadline by default.
* [Bug 1090] Fix bogus leap seconds in refclock_hpgps.
(4.2.5p168) 2009/04/29 Released by Harlan Stenn 
* Include (4.2.4p7-RC4)
* [Bug 1169] quiet compiler warnings
* Re-enable gcc -Wstrict-prototypes when not building with OpenSSL
* Enable gcc -Wstrict-overflow
* ntpq/ntpdc emit newline after accepting password on Windows
* Updates from Dave Mills:
* ntp-keygen.c: Updates.
* Fix the error return and syslog function ID in refclock_{param,ppsapi}.
* Make sure syspoll is within the peer's minpoll/maxpoll bounds.
* ntp_crypto.c: Use sign_siglen, not len. sign key filename cleanup.
* Bump NTP_MAXEXTEN from 1024 to 2048, update values for some field lengths.
* m4/ntp_lineeditlibs.m4: fix warnings from newer Autoconf
* [Bug 1166] Remove truncation of position (blanking) code in refclock_nmea.c
(4.2.5p167) 2009/04/26 Released by Harlan Stenn 
* Crypto cleanup from Dave Mills.
(4.2.5p166) 2009/04/25 Released by Harlan Stenn 
* [Bug 1165] Clean up small memory leaks in the  config file parser
* Correct logconfig keyword declaration to MULTIPLE_ARG
* Enable filename and line number leak reporting on Windows when built
  DEBUG for all the typical C runtime allocators such as calloc,
  malloc, and strdup.  Previously only emalloc calls were covered.
* Add DEBUG-only code to free dynamically allocated memory that would
  otherwise remain allocated at ntpd exit, to allow less forgivable
  leaks to stand out in leaks reported after exit.
* Ensure termination of strings in ports/winnt/libisc/isc_strerror.c
  and quiet compiler warnings.
* [Bug 1057] ntpdc unconfig failure
* [Bug 1161] unpeer AKA unconfig command for ntpq :config
* PPS and crypto cleanup in ntp_proto.c from Dave Mills.
(4.2.5p165) 2009/04/23 Released by Harlan Stenn 
* WWVB refclock cleanup from Dave Mills.
* Code cleanup: requested_key -> request_key.
* [Bug 833] ignore whitespace at end of remote configuration lines
* [Bug 1033] ntpdc/ntpq crash prompting for keyid on Windows
* [Bug 1028] Support for W32Time authentication via Samba.
* quiet ntp_parser.c malloc redeclaration warning
* Mitigation and PPS/PPSAPI cleanup from Dave Mills.
* Documentation updates from Dave Mills.
* timepps-Solaris.h patches from Dave Hart.
(4.2.5p164) 2009/04/22 Released by Harlan Stenn 
* Include (4.2.4p7-RC3)
* PPS/PPSAPI cleanup from Dave Mills.
* Documentation updates from Dave Mills.
* [Bug 1125] C runtime per-thread initialization on Windows
* [Bug 1152] temporarily disable refclock_parse, refclock_true until
  maintainers can repair build break from pps_sample()
* [Bug 1153] refclock_nmea should not mix UTC with GPS time
* [Bug 1159] ntpq overlap diagnostic message test buggy
(4.2.5p163) 2009/04/10 Released by Harlan Stenn 
(4.2.5p162) 2009/04/09 Released by Harlan Stenn 
* Documentation updates from Dave Mills.
* Mitigation and PPS cleanup from Dave Mills.
* Include (4.2.4p7-RC2)
* [Bug 216] New interpolation scheme for Windows eliminates 1ms jitter
* remove a bunch of #ifdef SYS_WINNT from portable code
* 64-bit time_t cleanup for building on newer Windows compilers
* Only set CMOS clock during ntpd exit on Windows if the computer is
  shutting down or restarting.
* [Bug 1148] NMEA reference clock improvements
* remove deleted gsoc_sntp/utilities.o from repository so that .o build
  products can be cleaned up without corrupting the repository.
(4.2.5p161) 2009/03/31 Released by Harlan Stenn 
* Documentation updates from Dave Mills.
(4.2.5p160) 2009/03/30 Released by Harlan Stenn 
* [Bug 1141] refclock_report missing braces cause spurious "peer event:
  clock clk_unspec" log entries
* Include (4.2.4p7-RC1)
(4.2.5p159) 2009/03/28 Released by Harlan Stenn 
* "bias" changes from Dave Mills.
(4.2.5p158) 2009/01/30 Released by Harlan Stenn 
* Fix [CID 72], a typo introduced at the latest fix to prettydate.c.
(4.2.5p157) 2009/01/26 Released by Harlan Stenn 
* Cleanup/fixes for ntp_proto.c and ntp_crypto.c from Dave Mills.
(4.2.5p156) 2009/01/19 Released by Harlan Stenn 
* [Bug 1118] Fixed sign extension for 32 bit time_t in caljulian() and prettydate().
  Fixed some compiler warnings about missing prototypes.
  Fixed some other simple compiler warnings.
* [Bug 1119] [CID 52] Avoid a possible null-dereference in ntp_crypto.c.
* [Bug 1120] [CID 51] INSIST that peer is non-null before we dereference it.
* [Bug 1121] [CID 47] double fclose() in ntp-keygen.c.
(4.2.5p155) 2009/01/18 Released by Harlan Stenn 
* Documentation updates from Dave Mills.
* CHU frequency updates.
* Design assertion fixes for ntp_crypto.c from Dave Mills.
(4.2.5p154) 2009/01/13 Released by Harlan Stenn 
* [Bug 992] support interface event change on Linux from
  Miroslav Lichvar.
(4.2.5p153) 2009/01/09 Released by Harlan Stenn 
* Renamed gsoc_sntp/:fetch-stubs to gsoc_sntp/fetch-stubs to avoid
  file name problems under Windows.
  Removed German umlaut from log msg for 4.2.5p142.
(4.2.5p152) 2009/01/08 Released by Harlan Stenn 
* Include (4.2.4p6) 2009/01/08 Released by Harlan Stenn 
(4.2.5p151) 2008/12/23 Released by Harlan Stenn 
* Stats file logging cleanup from Dave Mills.
(4.2.5p150) 2008/12/15 Released by Harlan Stenn 
* [Bug 1099] Fixed wrong behaviour in sntp's crypto.c.
* [Bug 1103] Fix 64-bit issues in the new calendar code.
(4.2.5p149) 2008/12/05 Released by Harlan Stenn 
* Fixed mismatches in data types and OID definitions in ntpSnmpSubAgent.c
* added a premliminary MIB file to ntpsnmpd (ntpv4-mib.mib)
(4.2.5p148) 2008/12/04 Released by Harlan Stenn 
* [Bug 1070] Fix use of ntpq_parsestring() in ntpsnmpd.
(4.2.5p147) 2008/11/27 Released by Harlan Stenn 
* Update gsoc_sntp's GCC warning code.
(4.2.5p146) 2008/11/26 Released by Harlan Stenn 
* Update Solaris CFLAGS for gsoc_sntp.
(4.2.5p145) 2008/11/20 Released by Harlan Stenn 
* Deal with time.h for sntp under linux.
* Provide rpl_malloc() for sntp for systems that need it.
* Handle ss_len and socklen type for sntp.
* Fixes to the sntp configure.ac script.
* Provide INET6_ADDRSTRLEN if it is missing.
* [Bug 1095] overflow in caljulian.c.
(4.2.5p144) 2008/11/19 Released by Harlan Stenn 
* Use int32, not int32_t.
* Avoid the sched*() functions under OSF - link problems.
(4.2.5p143) 2008/11/17 Released by Harlan Stenn 
* sntp cleanup and fixes.
(4.2.5p142) 2008/11/16 Released by Harlan Stenn 
* Imported GSoC SNTP code from Johannes Maximilian Kuehn.
(4.2.5p141) 2008/11/13 Released by Harlan Stenn 
* New caltontp.c and calyearstart.c from Juergen Perlinger.
(4.2.5p140) 2008/11/12 Released by Harlan Stenn 
* Cleanup lint from the ntp_scanner files.
* [Bug 1011] gmtime() returns NULL on windows where it would not under Unix.
* Updated caljulian.c and prettydate.c from Juergen Perlinger.
(4.2.5p139) 2008/11/11 Released by Harlan Stenn 
* Typo fix to driver20.html.
(4.2.5p138) 2008/11/10 Released by Harlan Stenn 
* [Bug 474] --disable-ipv6 is broken.
* IPv6 interfaces were being looked for twice.
* SHM driver grabs more samples, add clockstats
* decode.html and driver20.html updates from Dave Mills.
(4.2.5p137) 2008/11/01 Released by Harlan Stenn 
* [Bug 1069] #undef netsnmp's PACKAGE_* macros.
* [Bug 1068] Older versions of netsnmp do not have netsnmp_daemonize().
(4.2.5p136) 2008/10/27 Released by Harlan Stenn 
* [Bug 1078] statsdir configuration parsing is broken.
(4.2.5p135) 2008/09/23 Released by Harlan Stenn 
* [Bug 1072] clock_update should not allow updates older than sys_epoch.
(4.2.5p134) 2008/09/17 Released by Harlan Stenn 
* Clean up build process for ntpsnmpd.
(4.2.5p133) 2008/09/16 Released by Harlan Stenn 
* Add options processing to ntpsnmpd.
* [Bug 1062] Check net-snmp headers before deciding to build ntpsnmpd.
* Clean up the libntpq.a build.
* Regenerate ntp_parser.[ch] from ntp_parser.y
(4.2.5p132) 2008/09/15 Released by Harlan Stenn 
* [Bug 1067] Multicast DNS service registration must come after the fork
  on Solaris.
* [Bug 1066] Error messages should log as errors.
(4.2.5p131) 2008/09/14 Released by Harlan Stenn 
* [Bug 1065] Re-enable support for the timingstats file.
(4.2.5p130) 2008/09/13 Released by Harlan Stenn 
* [Bug 1064] Implement --with-net-snmp-config=progname
* [Bug 1063] ntpSnmpSubagentObject.h is missing from the distribution.
(4.2.5p129) 2008/09/11 Released by Harlan Stenn 
* Quiet some libntpq-related warnings.
(4.2.5p128) 2008/09/08 Released by Harlan Stenn 
* Import Heiko Gerstung's GSoC2008 NTP MIB daemon.
(4.2.5p127) 2008/09/01 Released by Harlan Stenn 
* Regenerate ntpd/ntp_parser.c
(4.2.5p126) 2008/08/31 Released by Harlan Stenn 
* Stop libtool-1.5 from looking for C++ or Fortran.
* [BUG 610] Documentation update for NMEA reference clock driver.
* [Bug 828] Fix IPv4/IPv6 address parsing.
* Changes from Dave Mills:
  Documentation updates.
  Fix a corner case where a frequency update was reported but not set.
  When LEAP_NOTINSYNC->LEAP_NOWARNING, call crypto_update() if we have
  crypto_flags.
(4.2.5p125) 2008/08/18 Released by Harlan Stenn 
* [Bug 1052] Add linuxPPS support to ONCORE driver.
(4.2.5p124) 2008/08/17 Released by Harlan Stenn 
* Documentation updates from Dave Mills.
* Include (4.2.4p5) 2008/08/17 Released by Harlan Stenn 
* [Bug 861] leap info was not being transmitted.
* [Bug 1046] refnumtoa.c is using the wrong header file.
* [Bug 1047] enable/disable options processing fix.
* header file cleanup.
* [Bug 1037] buffer in subroutine was 1 byte short.
* configure.ac: cleanup, add option for wintime, and lay the groundwork
  for the changes needed for bug 1028.
* Fixes from Dave Mills: 'bias' and 'interleave' work.  Separate
  phase and frequency discipline (for long poll intervals).  Update
  TAI function to match current leapsecond processing.
* Documentation updates from Dave Mills.
* [Bug 1037] Use all 16 of the MD5 passwords generated by ntp-keygen.
* Fixed the incorrect edge parameter being passed to time_pps_kcbind in
  NMEA refclock driver.
* [Bug 399] NMEA refclock driver does not honor time1 offset if flag3 set.
* [Bug 985] Modifications to NMEA reference clock driver to support Accord
  GPS Clock.
* poll time updates from Dave Mills.
* local refclock documentation updates from Dave Mills.
* [Bug 1022] Fix compilation problems with yesterday's commit.
* Updates and cleanup from Dave Mills:
  I've now spent eleven months of a sabbatical year - 7 days a week, 6-10
  hours most days - working on NTP. I have carefully reviewed every major
  algorithm, examined its original design and evolution from that design.
  I've trimmed off dead code and briar patches and did zillions of tests
  contrived to expose evil vulnerabilities. The development article is in
  rather good shape and should be ready for prime time.

  1. The protostats statistics files have been very useful in exposing
  little twitches and turns when something hiccups, like a broken PPS
  signal. Most of what used to be syslog messages are now repackaged as
  protostats messages with optional syslog as well. These can also be sent
  as traps which might be handy to tiggle a beeper or celltext. These, the
  sysstats files and cryptostats files reveal the ambient health of a busy
  server, monitor traffic and error counts and spot crypto attacks.

  2. Close inspection of the clock discipline behavior at long poll
  intervals (36 h) showed it not doing as well as it should. I redesigned
  the FLL loop to improve nominal accuracy from  several tens of
  milliseconds to something less than ten milliseconds.

  3. Autokey (again). The enhanced error checking was becoming a major
  pain. I found a way to toss out gobs of ugly fat code and replace the
  function with a much simpler and more comprehensive scheme. It resists
  bait-and-switch attacks and quickly detect cases when the protocol is
  not correctly synchronized.

  4. The interface code for the kernel PPS signal was not in sync with the
  kernel code itself. Some error checks were duplicated and some
  ineffective. I found none of the PPS-capable drivers, including the atom
  driver, do anything when the prefer peer fails; the kernel PPS signal
  remains in control. The atom driver now disables the kernel PPS when the
  prefer peer comes bum. This is important when the prefer peer is not a
  reference clock but a remote NTP server.

  5. The flake restrict bit turned out to be really interesting,
  especially with symmtric modes and of those especially those using
  Autokey. Small changes in the recovery procedures when packets are lost
  now avoid almost all scenarios which previously required protocol resets.

  6. I've always been a little uncomfortable when using the clock filter
  with long poll intervals because the samples become less and less
  correlated as the sample age exceeds the Allan intercept. Various
  schemes have been used over the years to cope with this fact. The latest
  one and the one that works the best is to use a modified sort metric
  where the delay is used when the age of the sample is less than the
  intercept and the sum of delay and dispersion above that. The net result
  is that, at small poll intervals the algorithm operates as a minimum
  filter, while at larger poll intervals it morphs to FIFO. Left
  unmodified, a sample could be used when twelve days old. This along with
  the FLL modifications has made a dramatic improvement at large poll
  intervals.

- [Backward Incompatible] The 'state' variable is no longer reported or
  available via ntpq output.  The following system status bit names
  have been changed:
  - sync_alarm -> leap_alarm
  - sync_atomic -> sync_pps
  - sync_lf_clock -> sync_lf_radio
  - sync_hf_clock -> sync_hf_radio
  - sync_uhf_clock -> sync_uhf_radio
  - sync_local_proto -> sync_local
  - sync_udp/time -> sync_other
  Other names have been changed as well.  See the change history for
  libntp/statestr.c for more details.
  Other backward-incompatible changes in ntpq include:
  - assID -> associd
  - rootdispersion -> rootdisp
  - pkt_head -> pkt_neader
  See the change history for other details.

* Updates and cleanup from Dave Mills.
* [Bug 995] Remove spurious ; from ntp-keygen.c.
* More cleanup and changes from Dave Mills.
* [Bug 980] Direct help to stdout.
---
(4.2.4p8) 2009/12/08 Released by Harlan Stenn 

* [Sec 1331] DoS with mode 7 packets - CVE-2009-3563.

---
(4.2.4p7) 2009/05/18 Released by Harlan Stenn 

* [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252.
* [Bug 1187] Update the copyright date.
* [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix
  for [Sec 1149].

---
(4.2.4p7-RC7) 2009/05/12 Released by Harlan Stenn 

* ntp.isc.org -> ntp.org cleanup.
* [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime,
  add configure --enable-ignore-dns-errors to be even more stubborn

---
(4.2.4p7-RC6) 2009/05/08 Released by Harlan Stenn 

* [Bug 784] Make --enable-linuxcaps the default when available
* [Bug 1179] error messages for -u/--user and -i lacking droproot
* Updated JJY reference clock driver from Takao Abe
* [Bug 1071] Log a message and exit before trying to use FD_SET with a
  descriptor larger than FD_SETSIZE, which will corrupt memory
* On corruption of the iface list head in add_interface, log and exit

---
(4.2.4p7-RC5) 2009/05/02 Released by Harlan Stenn 

* [Bug 1172] 4.2.4p7-RC{3,4} fail to build on linux.
* flock-build script unportable 'set -m' use removed

---
(4.2.4p7-RC4) 2009/04/29 Released by Harlan Stenn 

* [Bug 1167] use gcc -Winit-self only if it is understood

---
(4.2.4p7-RC3) 2009/04/22 Released by Harlan Stenn 

* [Bug 787] Bug fixes for 64-bit time_t on Windows
* [Bug 813] Conditional naming of Event
* [Bug 1147] System errors should be logged to msyslog()
* [Bug 1155] Fix compile problem on Windows with VS2005
* [Bug 1156] lock_thread_to_processor() should be declared in header
* [Bug 1157] quiet OpenSSL warnings, clean up configure.ac
* [Bug 1158] support for aix6.1
* [Bug 1160] MacOS X is like BSD regarding F_SETOWN

---
(4.2.4p7-RC2) 2009/04/09 Released by Harlan Stenn 

* [Sec 1144] limited buffer overflow in ntpq.  CVE-2009-0159
* [Sec 1149] use SO_EXCLUSIVEADDRUSE on Windows

---
(4.2.4p7-RC1) 2009/03/30 Released by Harlan Stenn 

* [Bug 1131] UDP sockets should not use SIGPOLL on Solaris.
* build system email address cleanup
* [Bug 774] parsesolaris.c does not compile under the new Solaris
* [Bug 873] Windows serial refclock proper TTY line discipline emulation
* [Bug 1014] Enable building with VC9 (in Visual Studio 2008,
  Visual C++ 2008, or SDK)
* [Bug 1117] Deferred interface binding under Windows works only correctly
  if FORCE_DNSRETRY is defined
* [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU
* DPRINTF macro made safer, always evaluates to a statement and will not
  misassociate an else which follows the macro.

---
(4.2.4p6) 2009/01/08 Released by Harlan Stenn 

* [Bug 1113] Fixed build errors with recent versions of openSSL. 
* [Sec 1111] Fix incorrect check of EVP_VerifyFinal()'s return value.
* Update the copyright year.

---
(4.2.4p5) 2008/08/17 Released by Harlan Stenn 

* [BUG 1051] Month off by one in leap second message written to clockstats
  file fixed.
* [Bug 450] Windows only: Under original Windows NT we must not discard the
  wildcard socket to workaround a bug in NT's getsockname().
* [Bug 1038] Built-in getpass() function also prompts for password if
  not built with DEBUG.
* [Bug 841] Obsolete the "dynamic" keyword and make deferred binding
  to local interfaces the default.
  Emit a warning if that keyword is used for configuration.
* [Bug 959] Refclock on Windows not properly releasing recvbuffs.
* [Bug 993] Fix memory leak when fetching system messages.
* much cleanup, fixes, and changes from Dave Mills.
* ntp_control.c: LEAPTAB is a filestamp, not an unsigned.  From Dave Mills.
* ntp_config.c: ntp_minpoll fixes from Dave Mills.
* ntp-keygen updates from Dave Mills.
* refresh epoch, throttle, and leap cleanup from Dave Mills.
* Documentation cleanup from Dave Mills.
* [Bug 918] Only use a native md5.h if MD5Init() is available.
* [Bug 979] Provide ntptimeval if it is not otherwise present.
* [Bug 634] Re-instantiate syslog() and logfiles after the daemon fork.
* [Bug 952] Use md5 code with a friendlier license.
* [Bug 977] Fix mismatching #ifdefs for builds without IPv6.
* [Bug 830] Fix the checking order of the interface options.
* Clean up the logfile/syslog setup.
* [Bug 970] Lose obsolete -g flag to ntp-keygen.
* The -e flag to ntp-keygen can write GQ keys now, too.
* ntp_proto.c: sys_survivors and hpoll cleanup from Dave Mills.
* ntp_loopfilter.c: sys_poll cleanup from Dave Mills.
* refclock_wwv.c: maximum-likelihood digit and DSYNC fixes from Dave Mills.
* [Bug 967] preemptable associations are lost forever on a step.
* ntp_config.c: [CID 48] missing "else" clause.
* [Bug 833] ntpq config keyword is quote-mark unfriendly.
* Rename the ntpq "config" keyword to ":config".
* Dave Mills shifted some orphan processing.
* Fix typos in the [Bug 963] patch.
* bootstrap: squawk if genver fails.  Use -f with cp in case Dave does a chown.
* Remove obsolete simulator command-line options.
* ntp_request.c: [CID 36] zero sin_zero.
* [Bug 963] get_systime() is too noisy.
* [Bug 960] spurious syslog:crypto_setup:spurious crypto command
* [Bug 964] Change *-*-linux* to *-*-*linux* to allow for uclinux.
* Changes from Dave Mills:
  - ntp_util.c: cleanup.
  - ntp_timer.c: watch the non-burst packet rate.
  - ntp_request.c: cleanup.
  - ntp_restrict.c: RES_LIMITED cleanup.
  - ntp_proto.c: RES_LIMITED, rate bucktes, counters, overall cleanup.
  - ntp_peer.c: disallow peer_unconfig().
  - ntp_monitor.c: RES_LIMITED cleanup.
  - ntp_loopfilter.c: poll interval cleanup.
  - ntp_crypto.c: volley -> retry.  Cleanup TAI leap message.
  - ntp_config: average and minimum are ^2 values.
  - ntpdc: unknownversion is really "declined", not "bad version".
  - Packet retry cleanup.
* [Bug 961] refclock_tpro.c:tpro_poll() calls refclock_receive() twice.
* [Bug 957] Windows only: Let command line parameters from the Windows SCM GUI
  override the standard parameters from the ImagePath registry key.
* Added HAVE_INT32_T to the Windows config.h to avoid duplicate definitions.
* Work around a VPATH difference in FreeBSD's 'make' command.
* Update bugreport URL.
* Update -I documentation.
* [Bug 713] Fix bug reporting information.
* A bug in the application of the negative-sawtooth for 12 channel receivers. 
* The removal of unneeded startup code used for the original LinuxPPS, it now
  conforms to the PPSAPI and does not need special code.  
* ntp-keygen.c: Coverity fixes [CID 33,47].
* Volley cleanup from Dave Mills.
* Fuzz cleanup from Dave Mills.
* [Bug 861] Leap second cleanups from Dave Mills.
* ntpsim.c: add missing protypes and fix [CID 34], a nit.
* Upgraded bison at UDel.
* Update br-flock and flock-build machine lists.
* [Bug 752] QoS: add parse/config handling code. 
* Fix the #include order in tickadj.c for picky machines.
* [Bug 752] QoS: On some systems, netinet/ip.h needs netinet/ip_systm.h.
* [Bug 752] Update the QoS tagging (code only - configuration to follow).
* Orphan mode and other protocol cleanup from Dave Mills.
* Documentation cleanup from Dave Mills.
* [Bug 940] ntp-keygen uses -v.  Disallow it as a shortcut for --version.
* more cleanup to ntp_lineeditlibs.m4.
* Documentation updates from Dave Mills.
* -ledit cleanup for ntpdc and ntpq.
* Association and other cleanup from Dave Mills.
* NTP_UNREACH changes from Dave Mills.
* Fix the readline history test.
* [Bug 931] Require -lreadline to be asked for explicitly.
* [Bug 764] When looking for -lreadline support, also try using -lncurses.
* [Bug 909] Fix int32_t errors for ntohl().
* [Bug 376/214] Enhancements to support multiple if names and IP addresses.
* [Bug 929] int32_t is undefined on Windows.  Casting wrong.
* [Bug 928] readlink missing braces.
* [Bug 788] Update macros to support VS 2005.
* ntpd/ntp_timer.c: add missing sys_tai parameter for debug printf
* [Bug 917] config parse leaves files open
* [Bug 912] detect conflicting enable/disable configuration on interfaces
  sharing an IP address
* [Bug 771] compare scopeid if available for IPv6 addresses
* Lose obsolete crypto subcommands (Dave Mills).
* WWV is an HF source, not an LF source (Dave Mills).
* [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT.
* [Bug 916] 'cryptosw' is undefined if built without OpenSSL.
* [Bug 891] 'restrict' config file keyword does not work (partial fix).
* [Bug 890] the crypto command seems to be required now.
* [Bug 915] ntpd cores during processing of x509 certificates.
* Crypto lint cleanup from Dave Mills.
* [Bug 897] Check RAND_status() - we may not need a .rnd file.
* Crypto cleanup from Dave Mills.
* [Bug 911] Fix error message in cmd_args.c.
* [Bug 895] Log assertion failures via syslog(), not stderr.
* Documentation updates from Dave Mills.
* Crypto cleanup from Dave Mills.
* [Bug 905] ntp_crypto.c fails to compile without -DDEBUG.
* Avoid double peer stats logging.
* ntp-keygen cleanup from Dave Mills.
* libopts needs to be built after ElectricFence.
* [Bug 894] Initialize keysdir before calling crypto_setup().
* Calysto cleanup for ntpq.
* ntp-keygen -i takes an arg.
* Cleanup and fixes from Dave Mills.
* [Bug 887] Fix error in ntp_types.h (for sizeof int != 4).
* Bug 880 bug fixes for Windows build
* Improve Calysto support.
* The "revoke" parameter is a crypto command.
* The driftfile wander threshold is a real number.
* [Bug 850] Fix the wander threshold parameter on the driftfile command.
* ntp_io.c: Dead code cleanup - Coverity View 19.
* Leap file related cleanup from Dave Mills.
* ntp_peer.c: Set peer->srcadr before (not after) calling set_peerdstadr().
* Initialize offset in leap_file() - Coverity View 17.
* Use the correct stratum on KISS codes.
* Fuzz bits cleanup.
* Show more digits in some debug printf's.
* Use drift_file_sw internally to control writing the drift file.
* Implement the wander_threshold option for the driftfile config keyword.
* reformat ntp_control.c; do not use c++ // comments.
* [Bug 629] Undo bug #629 fixes as they cause more problems than were  being
  solved
* Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup,
  driftfile write cleanup, packet buffer length checks, documentation updates.
* More assertion checks and malloc()->emalloc(), courtesy of Calysto.
* [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris
* [Bug 862] includefile nesting; preserve phonelist on reconfig.
* [Bug 604] ntpd regularly dies on linux/alpha.
* more leap second infrastructure fixes from Dave Mills.
* [Bug 858] recent leapfile changes broke non-OpenSSL builds.
* Use emalloc() instead of malloc() in refclock_datum.c (Calysto).
* Start using 'design by contract' assertions.
* [Bug 767] Fast sync to refclocks wanted.
* Allow null driftfile.
* Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES.
* [Bug 629] changes to ensure broadcast works including on wildcard addresses
* [Bug 853] get_node() must return a pointer to maximally-aligned memory.
* Initial leap file fixes from Dave Mills.
* [Bug 858] Recent leapfile changes broke without OPENSSL.
* Use a char for DIR_SEP, not a string.
* [Bug 850] driftfile parsing changes.
* driftfile maintenance changes from Dave Mills.  Use clock_phi instead of
  stats_write_tolerance.
* [Bug 828] refid string not being parsed correctly.
* [Bug 846] Correct includefile parsing.
* [Bug 827] New parsing code does not handle "fudge" correctly.
* Enable debugging capability in the config parser.
* [Bug 839] Crypto password not read from ntp.conf.
* Have autogen produce writable output files.
* [Bug 825] Correct logconfig -/+ keyword processing.
* [Bug 828] Correct parsing of " delimited strings.
* Cleanup FILE * usage after fclose() in ntp_filegen.c.
* [Bug 843] Windows Completion port code was incorrectly merged from -stable.
* [Bug 840] do fudge configuration AFTER peers (thus refclocks) have been
  configured.
* [Bug 824] Added new parser modules to the Windows project file.
* [Bug 832] Add libisc/log.c headers to the distribution.
* [Bug 808] Only write the drift file if we are in state 4.
* Initial import of libisc/log.c and friends.
* [Bug 826] Fix redefinition of PI.
* [Bug 825] ntp_scanner.c needs to #include  .
* [Bug 824] New parser code has some build problems with the SIM code.
* [Bug 817] Use longnames for setting ntp variables on the command-line;
  Allowing '-v' with and without an arg to disambiguate usage is error-prone.
* [Bug 822] set progname once, early.
* [Bug 819] remove erroneous #if 0 in Windows completion port code.
* The new config code missed an #ifdef for building without refclocks.
* Distribute some files needed by the new config parsing code.
* [Bug 819] Timeout for WaitForMultipleObjects was 500ms instead of INFINITE
* Use autogen 5.9.1.
* Fix clktest command-line arg processing.'
* Audio documentation updates from Dave Mills.
* New config file parsing code, from Sachin Kamboj.
* fuzz bit cleanup from Dave Mills.
* replay cleanup from Dave Mills.
* [Bug 542] Tolerate missing directory separator at EO statsdir.
* [Bug 812] ntpd should drop supplementary groups.
* [Bug 815] Fix warning compiling 4.2.5p22 under Windows with VC6.
* [Bug 740] Fix kernel/daemon startup drift anomaly.
* refclock_wwv.c fixes from Dave Mills.
* [Bug 810] Fix ntp-keygen documentation.
* [Bug 787] Bug fixes for 64-bit time_t on Windows.
* [Bug 796] Clean up duplicate #defines in ntp_control.c.
* [Bug 569] Use the correct precision for the Leitch CSD-5300.
* [Bug 795] Moved declaration of variable to top of function.
* [Bug 798] ntpq [p typo crashes ntpq/ntpdc.
* [Bug 786] Fix refclock_bancomm.c on Solaris.
* [Bug 774] parsesolaris.c does not compile under the new Solaris.
* [Bug 782] Remove P() macros from Windows files.
* [Bug 778] ntpd fails to lock with drift=+500 when started with drift=-500.
* [Bug 592] Trimble Thunderbolt GPS support.
* IRIG, CHU, WWV, WWVB refclock improvements from Dave Mills.
* [Bug 757] Lose ULONG_CONST().
* [Bug 756] Require ANSI C (function prototypes).
* codec (audio) and ICOM changes from Dave Mills.

---

* [Bug 450] Windows only: Under original Windows NT we must not discard the
  wildcard socket to workaround a bug in NT's getsockname().
* [Bug 1038] Built-in getpass() function also prompts for password if
  not built with DEBUG.
* [Bug 841] Obsolete the "dynamic" keyword and make deferred binding
  to local interfaces the default.
  Emit a warning if that keyword is used for configuration.
* [Bug 959] Refclock on Windows not properly releasing recvbuffs.
* [Bug 993] Fix memory leak when fetching system messages.
* [Bug 987] Wake up the resolver thread/process when a new interface has
  become available.
* Correctly apply negative-sawtooth for oncore 12 channel receiver.
* Startup code for original LinuxPPS removed.  LinuxPPS now conforms to
  the PPSAPI.
* [Bug 1000] allow implicit receive buffer allocation for Windows.
  fixes startup for windows systems with many interfaces.
  reduces dropped packets on network bursts.
  additionally fix timer() starvation during high load.
* [Bug 990] drop minimum time restriction for interface update interval.
* [Bug 977] Fix mismatching #ifdefs for builds without IPv6.
* Update the copyright year.
* Build system cleanup (make autogen-generated files writable).
* [Bug 957] Windows only: Let command line parameters from the Windows SCM GUI
  override the standard parameters from the ImagePath registry key.
* Fixes for ntpdate:
* [Bug 532] nptdate timeout is too long if several servers are supplied.
* [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools.
* [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't.
* [Bug 908] ntpdate crashes sometimes.
* [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set
  (dup of 908).
* [Bug 997] ntpdate buffer too small and unsafe.
* ntpdate.c: Under Windows check whether NTP port in use under same conditions
  as under other OSs.
* ntpdate.c: Fixed some typos and indents (tabs/spaces).

(4.2.4p4) Released by Harlan Stenn 

* [Bug 902] Fix problems with the -6 flag.
* Updated include/copyright.def (owner and year).
* [Bug 878] Avoid ntpdc use of refid value as unterminated string.
* [Bug 881] Corrected display of pll offset on 64bit systems.
* [Bug 886] Corrected sign handling on 64bit in ntpdc loopinfo command.
* [Bug 889] avoid malloc() interrupted by SIGIO risk
* ntpd/refclock_parse.c: cleanup shutdown while the file descriptor is still
  open.
* [Bug 885] use emalloc() to get a message at the end of the memory
  unsigned types cannot be less than 0
  default_ai_family is a short
  lose trailing , from enum list
  clarify ntp_restrict.c for easier automated analysis
* [Bug 884] don't access recv buffers after having them passed to the free
  list.
* [Bug 882] allow loopback interfaces to share addresses with other
  interfaces.

---
(4.2.4p3) Released by Harlan Stenn 

* [Bug 863] unable to stop ntpd on Windows as the handle reference for events
  changed

---
(4.2.4p2) Released by Harlan Stenn 

* [Bug 854] Broadcast address was not correctly set for interface addresses
* [Bug 829] reduce syslog noise, while there fix Enabled/Disable logging
  to reflect the actual configuration.
* [Bug 795] Moved declaration of variable to top of function.
* [Bug 789] Fix multicast client crypto authentication and make sure arriving
  multicast packets do not disturb the autokey dance.
* [Bug 785] improve handling of multicast interfaces
  (multicast routers still need to run a multicast routing software/daemon)
* ntpd/refclock_parse.c: cleanup shutdown while the file descriptor is still
  open.
* [Bug 885] use emalloc() to get a message at the end of the memory
  unsigned types cannot be less than 0
  default_ai_family is a short
  lose trailing , from enum list
* [Bug 884] don't access recv buffers after having them passed to the free list.
* [Bug 882] allow loopback interfaces to share addresses with other interfaces.
* [Bug 527] Don't write from source address length to wrong location
* Upgraded autogen and libopts.
* [Bug 811] ntpd should not read a .ntprc file.

---
(4.2.4p1) (skipped)

---
(4.2.4p0) Released by Harlan Stenn 

* [Bug 793] Update Hans Lambermont's email address in ntpsweep.
* [Bug 776] Remove unimplemented "rate" flag from ntpdate.
* [Bug 586] Avoid lookups if AI_NUMERICHOST is set.
* [Bug 770] Fix numeric parameters to ntp-keygen (Alain Guibert).
* [Bug 768] Fix io_setbclient() error message.
* [Bug 765] Use net_bind_service capability on linux.
* [Bug 760] The background resolver must be aware of the 'dynamic' keyword.
* [Bug 753] make union timestamp anonymous (Philip Prindeville).
* confopt.html: move description for "dynamic" keyword into the right section.
* pick the right type for the recv*() length argument.

---
(4.2.4) Released by Harlan Stenn 

* monopt.html fixes from Dave Mills.
* [Bug 452] Do not report kernel PLL/FLL flips.
* [Bug 746] Expert mouseCLOCK USB v2.0 support added.'
* driver8.html updates.
* [Bug 747] Drop  tags from ntpdc.html.
* sntp now uses the returned precision to control decimal places.
* sntp -u will use an unprivileged port for its queries.
* [Bug 741] "burst" doesn't work with !unfit peers.
* [Bug 735] Fix a make/gmake VPATH issue on Solaris.
* [Bug 739] ntpd -x should not take an argument.
* [Bug 737] Some systems need help providing struct iovec.
* [Bug 717] Fix libopts compile problem.
* [Bug 728] parse documentation fixes.
* [Bug 734] setsockopt(..., IP_MULTICAST_IF, ...) fails on 64-bit platforms.
* [Bug 732] C-DEX JST2000 patch from Hideo Kuramatsu.
* [Bug 721] check for __ss_family and __ss_len separately.
* [Bug 666] ntpq opeers displays jitter rather than dispersion.
* [Bug 718] Use the recommended type for the saddrlen arg to getsockname().
* [Bug 715] Fix a multicast issue under Linux.
* [Bug 690] Fix a Windows DNS lookup buffer overflow.
* [Bug 670] Resolved a Windows issue with the dynamic interface rescan code.
* K&R C support is being deprecated.
* [Bug 714] ntpq -p should conflict with -i, not -c.
* WWV refclock improvements from Dave Mills.
* [Bug 708] Use thread affinity only for the clock interpolation thread.
* [Bug 706] ntpd can be running several times in parallel.
* [Bug 704] Documentation typos.
* [Bug 701] coverity: NULL dereference in ntp_peer.c
* [Bug 695] libopts does not protect against macro collisions.
* [Bug 693] __adjtimex is independent of ntp_{adj,get}time.
* [Bug 692] sys_limitrejected was not being incremented.
* [Bug 691] restrictions() assumption not always valid.
* [Bug 689] Deprecate HEATH GC-1001 II; the driver never worked.
* [Bug 688] Fix documentation typos.
* [Bug 686] Handle leap seconds better under Windows.
* [Bug 685] Use the Windows multimedia timer.
* [Bug 684] Only allow debug options if debugging is enabled.
* [Bug 683] Use the right version string.
* [Bug 680] Fix the generated version string on Windows.
* [Bug 678] Use the correct size for control messages.
* [Bug 677] Do not check uint_t in configure.ac.
* [Bug 676] Use the right value for msg_namelen.
* [Bug 675] Make sure ntpd builds without debugging.
* [Bug 672] Fix cross-platform structure padding/size differences.
* [Bug 660] New TIMESTAMP code fails tp build on Solaris Express.
* [Bug 659] libopts does not build under Windows.
* [Bug 658] HP-UX with cc needs -Wp,-H8166 in CFLAGS.
* [Bug 656] ntpdate doesn't work with multicast address.
* [Bug 638] STREAMS_TLI is deprecated - remove it.
* [Bug 635] Fix tOptions definition.
* [Bug 628] Fallback to ntp discipline not working for large offsets.
* [Bug 622] Dynamic interface tracking for ntpd.
* [Bug 603] Don't link with libelf if it's not needed.
* [Bug 523] ntpd service under Windows does't shut down properly.
* [Bug 500] sntp should always be built.
* [Bug 479] Fix the -P option.
* [Bug 421] Support the bc637PCI-U card.
* [Bug 342] Deprecate broken TRAK refclock driver.
* [Bug 340] Deprecate broken MSF EES refclock driver.
* [Bug 153] Don't do DNS lookups on address masks.
* [Bug 143] Fix interrupted system call on HP-UX.
* [Bug 42] Distribution tarballs should be signed.
* Support separate PPS devices for PARSE refclocks.
* [Bug 637, 51?] Dynamic interface scanning can now be done.
* Options processing now uses GNU AutoGen.

---
(4.2.2p4) Released by Harlan Stenn 

* [Bug 710] compat getnameinfo() has off-by-one error
* [Bug 690] Buffer overflow in Windows when doing DNS Lookups

---
(4.2.2p3) Released by Harlan Stenn 

* Make the ChangeLog file cleaner and easier to read
* [Bug 601] ntpq's decodeint uses an extra level of indirection
* [Bug 657] Different OSes need different sized args for IP_MULTICAST_LOOP
* release engineering/build changes
* Documentation fixes
* Get sntp working under AIX-5

---
(4.2.2p2) (broken)

* Get sntp working under AIX-5

---
(4.2.2p1)

* [Bug 661] Use environment variable to specify the base path to openssl.
* Resolve an ambiguity in the copyright notice
* Added some new documentation files
* URL cleanup in the documentation
* [Bug 657]: IP_MULTICAST_LOOP uses a u_char value/size
* quiet gcc4 complaints
* more Coverity fixes
* [Bug 614] manage file descriptors better
* [Bug 632] update kernel PPS offsets when PPS offset is re-configured
* [Bug 637] Ignore UP in*addr_any interfaces
* [Bug 633] Avoid writing files in srcdir
* release engineering/build changes

---
(4.2.2)

* SNTP
* Many bugfixes
* Implements the current "goal state" of NTPv4
* Autokey improvements
* Much better IPv6 support
* [Bug 360] ntpd loses handles with LAN connection disabled.
* [Bug 239] Fix intermittent autokey failure with multicast clients.
* Rewrite of the multicast code
* New version numbering scheme

---
(4.2.0)

* More stuff than I have time to document
* IPv6 support
* Bugfixes
* call-gap filtering
* wwv and chu refclock improvements
* OpenSSL integration

---
(4.1.2)

* clock state machine bugfix
* Lose the source port check on incoming packets
* (x)ntpdc compatibility patch
* Virtual IP improvements
* ntp_loopfilter fixes and improvements
* ntpdc improvements
* GOES refclock fix
* JJY driver
* Jupiter refclock fixes
* Neoclock4X refclock fixes
* AIX 5 port
* bsdi port fixes
* Cray unicos port upgrade
* HP MPE/iX port
* Win/NT port upgrade
* Dynix PTX port fixes
* Document conversion from CVS to BK
* readline support for ntpq

---
(4.1.0)

* CERT problem fixed (99k23)

* Huff-n-Puff filter
* Preparation for OpenSSL support
* Resolver changes/improvements are not backward compatible with mode 7
  requests (which are implementation-specific anyway)
* leap second stuff
* manycast should work now
* ntp-genkeys does new good things.
* scripts/ntp-close
* PPS cleanup and improvements
* readline support for ntpdc
* Crypto/authentication rewrite
* WINNT builds with MD5 by default
* WINNT no longer requires Perl for building with Visual C++ 6.0
* algorithmic improvements, bugfixes
* Solaris dosynctodr info update
* html/pic/* is *lots* smaller
* New/updated drivers: Forum Graphic GPS, WWV/H, Heath GC-100 II, HOPF
  serial and PCI, ONCORE, ulink331
* Rewrite of the audio drivers

---
(4.0.99)

* Driver updates: CHU, DCF, GPS/VME, Oncore, PCF, Ulink, WWVB, burst
  If you use the ONCORE driver with a HARDPPS kernel module,
  you *must* have a properly specified:
	pps  [assert/clear] [hardpps]
  line in the /etc/ntp.conf file.
* PARSE cleanup
* PPS cleanup
* ntpd, ntpq, ntpdate cleanup and fixes
* NT port improvements
* AIX, BSDI, DEC OSF, FreeBSD, NetBSD, Reliant, SCO, Solaris port improvements

---
(4.0.98)

* Solaris kernel FLL bug is fixed in 106541-07
* Bug/lint cleanup
* PPS cleanup
* ReliantUNIX patches
* NetInfo support
* Ultralink driver
* Trimble OEM Ace-II support
* DCF77 power choices
* Oncore improvements

---
(4.0.97)

* NT patches
* AIX,SunOS,IRIX portability
* NeXT portability
* ntptimeset utility added
* cygwin portability patches

---
(4.0.96)

* -lnsl, -lsocket, -lgen configuration patches
* Y2K patches from AT&T
* Linux portability cruft

---
(4.0.95)

* NT port cleanup/replacement
* a few portability fixes
* VARITEXT Parse clock added

---
(4.0.94)

* PPS updates (including ntp.config options)
* Lose the old DES stuff in favor of the (optional) RSAREF stuff
* html cleanup/updates
* numerous drivers cleaned up
* numerous portability patches and code cleanup

---
(4.0.93)

* Oncore refclock needs PPS or one of two ioctls.
* Don't make ntptime under Linux.  It doesn't compile for too many folks.
* Autokey cleanup
* ReliantUnix patches
* html cleanup
* tickadj cleanup
* PARSE cleanup
* IRIX -n32 cleanup
* byte order cleanup
* ntptrace improvements and patches
* ntpdc improvements and patches
* PPS cleanup
* mx4200 cleanup
* New clock state machine
* SCO cleanup
* Skip alias interfaces

---
(4.0.92)

* chronolog and dumbclock refclocks
* SCO updates
* Cleanup/bugfixes
* Y2K patches
* Updated palisade driver
* Plug memory leak
* wharton kernel clock
* Oncore clock upgrades
* NMEA clock improvements
* PPS improvements
* AIX portability patches

---
(4.0.91)

* New ONCORE driver
* New MX4200 driver
* Palisade improvements
* config file bugfixes and problem reporting
* autoconf upgrade and cleanup
* HP-UX, IRIX lint cleanup
* AIX portability patches
* NT cleanup

---
(4.0.90)

* Nanoseconds
* New palisade driver
* New Oncore driver

---
(4.0.73)

* README.hackers added
* PARSE driver is working again
* Solaris 2.6 has nasty kernel bugs.  DO NOT enable pll!
* DES is out of the distribution.

---
(4.0.72)

* K&R C compiling should work again.
* IRIG patches.
* MX4200 driver patches.
* Jupiter driver added.
* Palisade driver added.  Needs work (ANSI, ntoh/hton, sizeof double, ???)
ntp-4.2.6p5/bootstrap0000755000175000017500000000675211474355435013601 0ustar  peterpeter#! /bin/sh

#  This "bootstrap" script performs various pre-autoreconf actions
#  that are required after pulling fresh sources from the repository.
#
#  --force is supported and will be passed to autoreconf
#
#  NOTE:  THE NTP VERSION NUMBER COMES FROM packageinfo.sh
#
#  all other instances of it anywhere in the source base have propagated
#  from this one source.
#
#  To use the raw sources from the repository, you must have the following
#  tools available to you:
#
#  1.  Autoconf and Automake.
#
#  2.  lynx.  This is used to extract the COPYRIGHT file extracted from
#      the html documentation.
#
#  *** The following are no longer needed for simple builds from the repo
#  3.  AutoGen.  The repository does *not* contain the files generated from
#      the option definition files and it does not contain the libopts
#      tear-off/redistributable library.
#
#      Note: AutoGen needs GNU Guile.
#
#  4.  gunzip.  The tear-off library is a gzipped tarball.

set -e

scripts/genver || { echo scripts/genver failed ; exit 1; }

# autoreconf says:
# The environment variables AUTOCONF, AUTOHEADER, AUTOMAKE, ACLOCAL,
# AUTOPOINT, LIBTOOLIZE, M4 are honored.

AUTORECONF=${AUTORECONF:-autoreconf}

case `hostname` in
 pogo.udel.edu)
    if fgrep -q 4.2.4 version.m4; then
	AUTOCONF=autoconf-2.59
	AUTOHEADER=autoheader-2.59
	AUTOMAKE=automake-1.9
	ACLOCAL=aclocal-1.9
	export AUTOCONF AUTOHEADER AUTOMAKE ACLOCAL
    fi
    ;;
esac

# 20060629: HMS: Let's try checking in libopts and the autogen-generated files
## The copy for ntp...
#rm -rf libopts*
#gunzip -c $(autoopts-config --libsrc) | (
#  tar -xvf -
#  mv libopts-*.*.* libopts )

## The copy for sntp...
#rm -rf sntp/libopts*
#gunzip -c $(autoopts-config --libsrc) | (
#  cd sntp
#  tar -xvf -
#  mv libopts-*.*.* libopts )

def_files=`find [B-Za-z]* -type f -name '*.def' -print | fgrep -v /SCCS/`
prog_opt_files=`grep -l '^prog.name' $def_files`

## AutoGen stuff

#incdir=${PWD}/include

#for f in ${prog_opt_files}
#do
#  ( cd $(dirname ${f})
#    echo "Running autogen on $f..."
#    autogen -L${incdir} $(basename ${f})
#  ) || exit 1
#done

## Non-AutoGen stuff

for i in autogen-version.def version.def version.texi
do
    cmp -s include/$i sntp/$i || cp -fp include/$i sntp/$i
done

# touch the stuff generated by the opt files

for f in ${prog_opt_files}
do
    f=`echo $f | sed -e 's/-opts.def//'`
    l=
    lh=
    for i in `ls -1 $f*`
    do
	case "$i" in
	 *.c|*.h|*.1|*.texi|*.menu)
	    l="$l $i"
	    ;;
	 *.html)
	    lh="$lh $i"
	    ;;
	esac
    done
    case "$l:$lh" in
     ':') ;;
     *) touch $l $lh
	;;
    esac
done

## EOAutoGen stuff

# Yacc/bison files ntp_parser.[ch] so we don't require the tool if
# ntp_parser.y hasn't been updated.  At the same time, keyword-gen-utd
# and ntp_keyword.h which are derived from ntp_parser.h and
# keyword-gen.c.

touch ntpd/ntp_parser.[ch] ntpd/keyword-gen-utd ntpd/ntp_keyword.h

cp bincheck.mf sntp/
cp depsver.mf sntp/

${AUTORECONF} -i -v --no-recursive "$@"

# DH: 20101120: We are back to a single copy of libopts, and
# once again it seems we need to run autoreconf in sntp after
# the top-level run to get a correct sntp/libopts/Makefile.in.
# To reduce redundancy, the top-level autoreconf uses --no-recursive.
#
# HMS: 20060618: Now that we use separate copies of libopts
# we should only need the previous line.
#
## HMS: 20060615: the next line seems to be needed to make sure
## we get the correct srcdir path in sntp/libopts/Makefile.in
#rm -rf sntp/autom4te.cache
#
(cd sntp && ${AUTORECONF} -i -v "$@")
ntp-4.2.6p5/WHERE-TO-START0000644000175000017500000000435211307651604013630 0ustar  peterpeterThe Network Time Protocol (NTP) Version 4 Distribution

This is a distribution of the Network Time Protocol (NTP) Version 4
sources and documentation. NTP can be used by Unix, DEC VMS and
Microsoft Windows NT platforms to synchronize the computer clock to
external sources of time, such as other NTP time servers or a local
radio clock. The daemon included in this distribution can operate as a
server, a client, or a relay from a set of servers to a dependent client
population on a local net. This distribution includes the daemon itself,
plus utility programs and supporting documentation.

You are welcome to the lot, with due consideration of the copyright
information in the COPYRIGHT file. You are also invited to contribute
bugfixes and drivers for new and exotic radios, telephones and sundials.
This distribution is normally available by anonymous ftp as the
compressed tar archive ntp-.tar.gz in the pub/ntp directory on
huey.udel.edu and  is the version number. The current stable
and development version numbers can be found at .

A considerable amount of documentation, including build instructions,
configuration advice, program usage and miscellaneous information is
included in the ./html directory of this distribution. The intended
access method is using a web browser such as netscape; however, the
pages have been formatted so that viewing with an ordinary text editor
is practical. Start the browser on the ./html/index.html page, which
contains additional instructions and hotlinks to the remaining pages.
Some hotlinks for the larger documents, such as related technical
memoranda, reports and papers, lead to other web sites where this
information is stashed. We apologize for the inconvenience this may
cause for users without Internet and World Wide Web access.

If you are an old hand and just want to build the distribution, you
might find the INSTALL file a useful shortcut. A descriptive list of all
files in the base directory of this distribution is in the README file.
A list of "significant" changes for the release is in the NEWS file.

If you're interested in helping us test pre-release versions of ntpd,
please look in .

David L. Mills (mills@udel.edu)
21 June 1998
ntp-4.2.6p5/configure0000755000175000017500000266021211675460305013540 0ustar  peterpeter#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for ntp 4.2.6p5.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
# Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##

# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
  emulate sh
  NULLCMD=:
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
else
  case `(set -o) 2>/dev/null` in #(
  *posix*) :
    set -o posix ;; #(
  *) :
     ;;
esac
fi


as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='print -r --'
  as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='printf %s\n'
  as_echo_n='printf %s'
else
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
    as_echo_n='/usr/ucb/echo -n'
  else
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
    as_echo_n_body='eval
      arg=$1;
      case $arg in #(
      *"$as_nl"*)
	expr "X$arg" : "X\\(.*\\)$as_nl";
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
      esac;
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
    '
    export as_echo_n_body
    as_echo_n='sh -c $as_echo_n_body as_echo'
  fi
  export as_echo_body
  as_echo='sh -c $as_echo_body as_echo'
fi

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  PATH_SEPARATOR=:
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
      PATH_SEPARATOR=';'
  }
fi


# IFS
# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" ""	$as_nl"

# Find who we are.  Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
  *[\\/]* ) as_myself=$0 ;;
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
  done
IFS=$as_save_IFS

     ;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
  as_myself=$0
fi
if test ! -f "$as_myself"; then
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
  exit 1
fi

# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there.  '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '

# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE

# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH

if test "x$CONFIG_SHELL" = x; then
  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
  emulate sh
  NULLCMD=:
  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '\${1+\"\$@\"}'='\"\$@\"'
  setopt NO_GLOB_SUBST
else
  case \`(set -o) 2>/dev/null\` in #(
  *posix*) :
    set -o posix ;; #(
  *) :
     ;;
esac
fi
"
  as_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }

exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :

else
  exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1"
  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test \$(( 1 + 1 )) = 2 || exit 1

  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
    PATH=/empty FPATH=/empty; export PATH FPATH
    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
  if (eval "$as_required") 2>/dev/null; then :
  as_have_required=yes
else
  as_have_required=no
fi
  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :

else
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  as_found=:
  case $as_dir in #(
	 /*)
	   for as_base in sh bash ksh sh5; do
	     # Try only shells that exist, to save several forks.
	     as_shell=$as_dir/$as_base
	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
  CONFIG_SHELL=$as_shell as_have_required=yes
		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
  break 2
fi
fi
	   done;;
       esac
  as_found=false
done
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
  CONFIG_SHELL=$SHELL as_have_required=yes
fi; }
IFS=$as_save_IFS


      if test "x$CONFIG_SHELL" != x; then :
  # We cannot yet assume a decent shell, so we have to provide a
	# neutralization value for shells without unset; and this also
	# works around shells that cannot unset nonexistent variables.
	# Preserve -v and -x to the replacement shell.
	BASH_ENV=/dev/null
	ENV=/dev/null
	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
	export CONFIG_SHELL
	case $- in # ((((
	  *v*x* | *x*v* ) as_opts=-vx ;;
	  *v* ) as_opts=-v ;;
	  *x* ) as_opts=-x ;;
	  * ) as_opts= ;;
	esac
	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
fi

    if test x$as_have_required = xno; then :
  $as_echo "$0: This script requires a shell more modern than all"
  $as_echo "$0: the shells that I found on your system."
  if test x${ZSH_VERSION+set} = xset ; then
    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
  else
    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
  fi
  exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS

## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
  { eval $1=; unset $1;}
}
as_unset=as_fn_unset

# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
  return $1
} # as_fn_set_status

# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
  set +e
  as_fn_set_status $1
  exit $1
} # as_fn_exit

# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{

  case $as_dir in #(
  -*) as_dir=./$as_dir;;
  esac
  test -d "$as_dir" || eval $as_mkdir_p || {
    as_dirs=
    while :; do
      case $as_dir in #(
      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
      *) as_qdir=$as_dir;;
      esac
      as_dirs="'$as_qdir' $as_dirs"
      as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$as_dir" : 'X\(//\)[^/]' \| \
	 X"$as_dir" : 'X\(//\)$' \| \
	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
      test -d "$as_dir" && break
    done
    test -z "$as_dirs" || eval "mkdir $as_dirs"
  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"


} # as_fn_mkdir_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
  eval 'as_fn_append ()
  {
    eval $1+=\$2
  }'
else
  as_fn_append ()
  {
    eval $1=\$$1\$2
  }
fi # as_fn_append

# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
  eval 'as_fn_arith ()
  {
    as_val=$(( $* ))
  }'
else
  as_fn_arith ()
  {
    as_val=`expr "$@" || test $? -eq 1`
  }
fi # as_fn_arith


# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
  as_status=$1; test $as_status -eq 0 && as_status=1
  if test "$4"; then
    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
  fi
  $as_echo "$as_me: error: $2" >&2
  as_fn_exit $as_status
} # as_fn_error

if expr a : '\(a\)' >/dev/null 2>&1 &&
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
  as_expr=expr
else
  as_expr=false
fi

if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
  as_basename=basename
else
  as_basename=false
fi

if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
  as_dirname=dirname
else
  as_dirname=false
fi

as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`

# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits


  as_lineno_1=$LINENO as_lineno_1a=$LINENO
  as_lineno_2=$LINENO as_lineno_2a=$LINENO
  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
  sed -n '
    p
    /[$]LINENO/=
  ' <$as_myself |
    sed '
      s/[$]LINENO.*/&-/
      t lineno
      b
      :lineno
      N
      :loop
      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
      t loop
      s/-\n.*//
    ' >$as_me.lineno &&
  chmod +x "$as_me.lineno" ||
    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }

  # Don't try to exec as it changes $[0], causing all sort of problems
  # (the dirname of $[0] is not the place where we might find the
  # original and so on.  Autoconf is especially sensitive to this).
  . "./$as_me.lineno"
  # Exit status is that of the last command.
  exit
}

ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
  case `echo 'xy\c'` in
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
  xy)  ECHO_C='\c';;
  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
       ECHO_T='	';;
  esac;;
*)
  ECHO_N='-n';;
esac

rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
  rm -f conf$$.dir/conf$$.file
else
  rm -f conf$$.dir
  mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
  if ln -s conf$$.file conf$$ 2>/dev/null; then
    as_ln_s='ln -s'
    # ... but there are two gotchas:
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
    # In both cases, we have to default to `cp -p'.
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
      as_ln_s='cp -p'
  elif ln conf$$.file conf$$ 2>/dev/null; then
    as_ln_s=ln
  else
    as_ln_s='cp -p'
  fi
else
  as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null

if mkdir -p . 2>/dev/null; then
  as_mkdir_p='mkdir -p "$as_dir"'
else
  test -d ./-p && rmdir ./-p
  as_mkdir_p=false
fi

if test -x / >/dev/null 2>&1; then
  as_test_x='test -x'
else
  if ls -dL / >/dev/null 2>&1; then
    as_ls_L_option=L
  else
    as_ls_L_option=
  fi
  as_test_x='
    eval sh -c '\''
      if test -d "$1"; then
	test -d "$1/.";
      else
	case $1 in #(
	-*)set "./$1";;
	esac;
	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
	???[sx]*):;;*)false;;esac;fi
    '\'' sh
  '
fi
as_executable_p=$as_test_x

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"

SHELL=${CONFIG_SHELL-/bin/sh}


test -n "$DJDIR" || exec 7<&0 &1

# Name of the host.
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`

#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=

# Identity of this package.
PACKAGE_NAME='ntp'
PACKAGE_TARNAME='ntp'
PACKAGE_VERSION='4.2.6p5'
PACKAGE_STRING='ntp 4.2.6p5'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

# Factoring default headers for most tests.
ac_includes_default="\
#include 
#ifdef HAVE_SYS_TYPES_H
# include 
#endif
#ifdef HAVE_SYS_STAT_H
# include 
#endif
#ifdef STDC_HEADERS
# include 
# include 
#else
# ifdef HAVE_STDLIB_H
#  include 
# endif
#endif
#ifdef HAVE_STRING_H
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
#  include 
# endif
# include 
#endif
#ifdef HAVE_STRINGS_H
# include 
#endif
#ifdef HAVE_INTTYPES_H
# include 
#endif
#ifdef HAVE_STDINT_H
# include 
#endif
#ifdef HAVE_UNISTD_H
# include 
#endif"

enable_option_checking=no
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
subdirs
SAVECONFIG_ENABLED_FALSE
SAVECONFIG_ENABLED_TRUE
LSCF
MAKE_NTPSNMPD
SNMP_CFLAGS
SNMP_CPPFLAGS
SNMP_LIBS
MAKE_NTPDSIM
MAKE_LIBNTPSIM
MAKE_TIMETRIM
MAKE_TICKADJ
MAKE_NTPTIME
MAKE_ADJTIMED
CLKTEST
CHUTEST
PROPDELAY
MAKE_PARSEKMODULE
DCFD
TESTDCF
MAKE_CHECK_LAYOUT
EF_LIBS
EF_PROGS
LCRYPTO
OPENSSL_LIB
OPENSSL_INC
OPENSSL
MAKE_CHECK_Y2K
MAKE_LIBPARSE_KERNEL
MAKE_LIBPARSE
LIBPARSE
HAVE_INLINE
EDITLINE_LIBS
PATH_NET_SNMP_CONFIG
PATH_TEST
PATH_SH
PATH_PERL
OTOOL64
OTOOL
LIPO
NMEDIT
DSYMUTIL
MANIFEST_TOOL
RANLIB
ac_ct_AR
AR
DLLTOOL
OBJDUMP
LN_S
NM
ac_ct_DUMPBIN
DUMPBIN
LD
FGREP
LIBTOOL
NTP_BINSUBDIR_IS_BIN_FALSE
NTP_BINSUBDIR_IS_BIN_TRUE
BINSUBDIR
NTP_CROSSCOMPILE_FALSE
NTP_CROSSCOMPILE_TRUE
LIBOPTS_DIR
LIBOPTS_CFLAGS
LIBOPTS_LDADD
NEED_LIBOPTS_FALSE
NEED_LIBOPTS_TRUE
INSTALL_LIBOPTS_FALSE
INSTALL_LIBOPTS_TRUE
POSIX_SHELL
SED
VPATH_HACK_FALSE
VPATH_HACK_TRUE
YFLAGS
YACC
EGREP
GREP
CPP
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
am__quote
am__include
DEPDIR
OBJEXT
EXEEXT
ac_ct_CC
CPPFLAGS
LDFLAGS
CFLAGS
CC
host_os
host_vendor
host_cpu
host
build_os
build_vendor
build_cpu
build
am__untar
am__tar
AMTAR
am__leading_dot
SET_MAKE
AWK
mkdir_p
MKDIR_P
INSTALL_STRIP_PROGRAM
STRIP
install_sh
MAKEINFO
AUTOHEADER
AUTOMAKE
AUTOCONF
ACLOCAL
VERSION
PACKAGE
CYGPATH_W
am__isrc
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
target_alias
host_alias
build_alias
LIBS
ECHO_T
ECHO_N
ECHO_C
DEFS
mandir
localedir
libdir
psdir
pdfdir
dvidir
htmldir
infodir
docdir
oldincludedir
includedir
localstatedir
sharedstatedir
sysconfdir
datadir
datarootdir
libexecdir
sbindir
bindir
program_transform_name
prefix
exec_prefix
PACKAGE_URL
PACKAGE_BUGREPORT
PACKAGE_STRING
PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_dependency_tracking
enable_shared
enable_local_libopts
enable_libopts_install
with_autoopts_config
with_binsubdir
with_arlib
with_rpath
enable_static
with_pic
enable_fast_install
with_gnu_ld
with_sysroot
enable_libtool_lock
with_net_snmp_config
with_lineeditlibs
enable_getifaddrs
enable_debugging
enable_debug_timing
enable_dst_minutes
enable_ignore_dns_errors
enable_force_defer_DNS
enable_BANCOMM
enable_GPSVME
enable_all_clocks
enable_ACTS
enable_ARBITER
enable_ARCRON_MSF
enable_AS2201
enable_ATOM
enable_CHRONOLOG
enable_CHU
enable_AUDIO_CHU
enable_DATUM
enable_DUMBCLOCK
enable_FG
enable_HEATH
enable_HOPFSERIAL
enable_HOPFPCI
enable_HPGPS
enable_IRIG
enable_JJY
enable_JUPITER
enable_LEITCH
enable_LOCAL_CLOCK
enable_MX4200
enable_NEOCLOCK4X
enable_NMEA
enable_ONCORE
enable_PALISADE
enable_PCF
enable_PST
enable_RIPENCC
enable_SHM
enable_SPECTRACOM
enable_TPRO
enable_TRUETIME
enable_TT560
enable_ULINK
enable_WWV
enable_ZYFER
enable_parse_clocks
enable_COMPUTIME
enable_DCF7000
enable_HOPF6021
enable_MEINBERG
enable_RAWDCF
enable_RCC8000
enable_SCHMID
enable_TRIMTAIP
enable_TRIMTSIP
enable_WHARTON
enable_VARITEXT
with_openssl_libdir
with_openssl_incdir
with_crypto
with_electricfence
enable_kmem
enable_accurate_adjtime
enable_tick
enable_tickadj
enable_simulator
with_ntpsnmpd
enable_slew_always
enable_step_slew
enable_ntpdate_step
enable_hourly_todr_sync
enable_kernel_fll_bug
enable_bug1243_fix
enable_irig_sawtooth
enable_nist
enable_ntp_signd
enable_clockctl
enable_linuxcaps
enable_ipv6
with_kame
enable_saveconfig
'
      ac_precious_vars='build_alias
host_alias
target_alias
CC
CFLAGS
LDFLAGS
LIBS
CPPFLAGS
CPP
YACC
YFLAGS'
ac_subdirs_all='sntp'

# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
ac_unrecognized_opts=
ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE

# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
libdir='${exec_prefix}/lib'
localedir='${datarootdir}/locale'
mandir='${datarootdir}/man'

ac_prev=
ac_dashdash=
for ac_option
do
  # If the previous option needs an argument, assign it.
  if test -n "$ac_prev"; then
    eval $ac_prev=\$ac_option
    ac_prev=
    continue
  fi

  case $ac_option in
  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
  *=)   ac_optarg= ;;
  *)    ac_optarg=yes ;;
  esac

  # Accept the important Cygnus configure options, so we can diagnose typos.

  case $ac_dashdash$ac_option in
  --)
    ac_dashdash=yes ;;

  -bindir | --bindir | --bindi | --bind | --bin | --bi)
    ac_prev=bindir ;;
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
    bindir=$ac_optarg ;;

  -build | --build | --buil | --bui | --bu)
    ac_prev=build_alias ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    build_alias=$ac_optarg ;;

  -cache-file | --cache-file | --cache-fil | --cache-fi \
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
    ac_prev=cache_file ;;
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
    cache_file=$ac_optarg ;;

  --config-cache | -C)
    cache_file=config.cache ;;

  -datadir | --datadir | --datadi | --datad)
    ac_prev=datadir ;;
  -datadir=* | --datadir=* | --datadi=* | --datad=*)
    datadir=$ac_optarg ;;

  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
  | --dataroo | --dataro | --datar)
    ac_prev=datarootdir ;;
  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
    datarootdir=$ac_optarg ;;

  -disable-* | --disable-*)
    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
      as_fn_error $? "invalid feature name: $ac_useropt"
    ac_useropt_orig=$ac_useropt
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
    case $ac_user_opts in
      *"
"enable_$ac_useropt"
"*) ;;
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
	 ac_unrecognized_sep=', ';;
    esac
    eval enable_$ac_useropt=no ;;

  -docdir | --docdir | --docdi | --doc | --do)
    ac_prev=docdir ;;
  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
    docdir=$ac_optarg ;;

  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
    ac_prev=dvidir ;;
  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
    dvidir=$ac_optarg ;;

  -enable-* | --enable-*)
    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
      as_fn_error $? "invalid feature name: $ac_useropt"
    ac_useropt_orig=$ac_useropt
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
    case $ac_user_opts in
      *"
"enable_$ac_useropt"
"*) ;;
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
	 ac_unrecognized_sep=', ';;
    esac
    eval enable_$ac_useropt=\$ac_optarg ;;

  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  | --exec | --exe | --ex)
    ac_prev=exec_prefix ;;
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  | --exec=* | --exe=* | --ex=*)
    exec_prefix=$ac_optarg ;;

  -gas | --gas | --ga | --g)
    # Obsolete; use --with-gas.
    with_gas=yes ;;

  -help | --help | --hel | --he | -h)
    ac_init_help=long ;;
  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
    ac_init_help=recursive ;;
  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
    ac_init_help=short ;;

  -host | --host | --hos | --ho)
    ac_prev=host_alias ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host_alias=$ac_optarg ;;

  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
    ac_prev=htmldir ;;
  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
  | --ht=*)
    htmldir=$ac_optarg ;;

  -includedir | --includedir | --includedi | --included | --include \
  | --includ | --inclu | --incl | --inc)
    ac_prev=includedir ;;
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  | --includ=* | --inclu=* | --incl=* | --inc=*)
    includedir=$ac_optarg ;;

  -infodir | --infodir | --infodi | --infod | --info | --inf)
    ac_prev=infodir ;;
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
    infodir=$ac_optarg ;;

  -libdir | --libdir | --libdi | --libd)
    ac_prev=libdir ;;
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
    libdir=$ac_optarg ;;

  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  | --libexe | --libex | --libe)
    ac_prev=libexecdir ;;
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  | --libexe=* | --libex=* | --libe=*)
    libexecdir=$ac_optarg ;;

  -localedir | --localedir | --localedi | --localed | --locale)
    ac_prev=localedir ;;
  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
    localedir=$ac_optarg ;;

  -localstatedir | --localstatedir | --localstatedi | --localstated \
  | --localstate | --localstat | --localsta | --localst | --locals)
    ac_prev=localstatedir ;;
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
    localstatedir=$ac_optarg ;;

  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
    ac_prev=mandir ;;
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
    mandir=$ac_optarg ;;

  -nfp | --nfp | --nf)
    # Obsolete; use --without-fp.
    with_fp=no ;;

  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c | -n)
    no_create=yes ;;

  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
    no_recursion=yes ;;

  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  | --oldin | --oldi | --old | --ol | --o)
    ac_prev=oldincludedir ;;
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
    oldincludedir=$ac_optarg ;;

  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    ac_prev=prefix ;;
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    prefix=$ac_optarg ;;

  -program-prefix | --program-prefix | --program-prefi | --program-pref \
  | --program-pre | --program-pr | --program-p)
    ac_prev=program_prefix ;;
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
    program_prefix=$ac_optarg ;;

  -program-suffix | --program-suffix | --program-suffi | --program-suff \
  | --program-suf | --program-su | --program-s)
    ac_prev=program_suffix ;;
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
    program_suffix=$ac_optarg ;;

  -program-transform-name | --program-transform-name \
  | --program-transform-nam | --program-transform-na \
  | --program-transform-n | --program-transform- \
  | --program-transform | --program-transfor \
  | --program-transfo | --program-transf \
  | --program-trans | --program-tran \
  | --progr-tra | --program-tr | --program-t)
    ac_prev=program_transform_name ;;
  -program-transform-name=* | --program-transform-name=* \
  | --program-transform-nam=* | --program-transform-na=* \
  | --program-transform-n=* | --program-transform-=* \
  | --program-transform=* | --program-transfor=* \
  | --program-transfo=* | --program-transf=* \
  | --program-trans=* | --program-tran=* \
  | --progr-tra=* | --program-tr=* | --program-t=*)
    program_transform_name=$ac_optarg ;;

  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
    ac_prev=pdfdir ;;
  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
    pdfdir=$ac_optarg ;;

  -psdir | --psdir | --psdi | --psd | --ps)
    ac_prev=psdir ;;
  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
    psdir=$ac_optarg ;;

  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil)
    silent=yes ;;

  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    ac_prev=sbindir ;;
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  | --sbi=* | --sb=*)
    sbindir=$ac_optarg ;;

  -sharedstatedir | --sharedstatedir | --sharedstatedi \
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  | --sharedst | --shareds | --shared | --share | --shar \
  | --sha | --sh)
    ac_prev=sharedstatedir ;;
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  | --sha=* | --sh=*)
    sharedstatedir=$ac_optarg ;;

  -site | --site | --sit)
    ac_prev=site ;;
  -site=* | --site=* | --sit=*)
    site=$ac_optarg ;;

  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
    ac_prev=srcdir ;;
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
    srcdir=$ac_optarg ;;

  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  | --syscon | --sysco | --sysc | --sys | --sy)
    ac_prev=sysconfdir ;;
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
    sysconfdir=$ac_optarg ;;

  -target | --target | --targe | --targ | --tar | --ta | --t)
    ac_prev=target_alias ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target_alias=$ac_optarg ;;

  -v | -verbose | --verbose | --verbos | --verbo | --verb)
    verbose=yes ;;

  -version | --version | --versio | --versi | --vers | -V)
    ac_init_version=: ;;

  -with-* | --with-*)
    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
      as_fn_error $? "invalid package name: $ac_useropt"
    ac_useropt_orig=$ac_useropt
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
    case $ac_user_opts in
      *"
"with_$ac_useropt"
"*) ;;
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
	 ac_unrecognized_sep=', ';;
    esac
    eval with_$ac_useropt=\$ac_optarg ;;

  -without-* | --without-*)
    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
      as_fn_error $? "invalid package name: $ac_useropt"
    ac_useropt_orig=$ac_useropt
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
    case $ac_user_opts in
      *"
"with_$ac_useropt"
"*) ;;
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
	 ac_unrecognized_sep=', ';;
    esac
    eval with_$ac_useropt=no ;;

  --x)
    # Obsolete; use --with-x.
    with_x=yes ;;

  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  | --x-incl | --x-inc | --x-in | --x-i)
    ac_prev=x_includes ;;
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
    x_includes=$ac_optarg ;;

  -x-libraries | --x-libraries | --x-librarie | --x-librari \
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
    ac_prev=x_libraries ;;
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
    x_libraries=$ac_optarg ;;

  -*) as_fn_error $? "unrecognized option: \`$ac_option'
Try \`$0 --help' for more information"
    ;;

  *=*)
    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
    # Reject names that are not valid shell variable names.
    case $ac_envvar in #(
      '' | [0-9]* | *[!_$as_cr_alnum]* )
      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
    esac
    eval $ac_envvar=\$ac_optarg
    export $ac_envvar ;;

  *)
    # FIXME: should be removed in autoconf 3.0.
    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
    ;;

  esac
done

if test -n "$ac_prev"; then
  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
  as_fn_error $? "missing argument to $ac_option"
fi

if test -n "$ac_unrecognized_opts"; then
  case $enable_option_checking in
    no) ;;
    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
  esac
fi

# Check all directory arguments for consistency.
for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
		datadir sysconfdir sharedstatedir localstatedir includedir \
		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
		libdir localedir mandir
do
  eval ac_val=\$$ac_var
  # Remove trailing slashes.
  case $ac_val in
    */ )
      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
      eval $ac_var=\$ac_val;;
  esac
  # Be sure to have absolute directory names.
  case $ac_val in
    [\\/$]* | ?:[\\/]* )  continue;;
    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
  esac
  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done

# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias

# FIXME: To remove some day.
if test "x$host_alias" != x; then
  if test "x$build_alias" = x; then
    cross_compiling=maybe
    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used" >&2
  elif test "x$build_alias" != "x$host_alias"; then
    cross_compiling=yes
  fi
fi

ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-

test "$silent" = yes && exec 6>/dev/null


ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
  as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
  as_fn_error $? "pwd does not report name of working directory"


# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  ac_srcdir_defaulted=yes
  # Try the directory containing this script, then the parent directory.
  ac_confdir=`$as_dirname -- "$as_myself" ||
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$as_myself" : 'X\(//\)[^/]' \| \
	 X"$as_myself" : 'X\(//\)$' \| \
	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_myself" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
  srcdir=$ac_confdir
  if test ! -r "$srcdir/$ac_unique_file"; then
    srcdir=..
  fi
else
  ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
	pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
  srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
  eval ac_env_${ac_var}_set=\${${ac_var}+set}
  eval ac_env_${ac_var}_value=\$${ac_var}
  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
  eval ac_cv_env_${ac_var}_value=\$${ac_var}
done

#
# Report the --help message.
#
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.6p5 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print \`checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for \`--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or \`..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/ntp]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]
_ACEOF

  cat <<\_ACEOF

Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
_ACEOF
fi

if test -n "$ac_init_help"; then
  case $ac_init_help in
     short | recursive ) echo "Configuration of ntp 4.2.6p5:";;
   esac
  cat <<\_ACEOF

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --disable-dependency-tracking  speeds up one-time build
  --enable-dependency-tracking   do not reject slow dependency extractors
  --enable-shared[=PKGS]  build shared libraries [default=no]
  --enable-local-libopts  Force using the supplied libopts tearoff code
  --disable-libopts-install
                          Do not install libopts with client installation
  --enable-static[=PKGS]  build static libraries [default=yes]
  --enable-fast-install[=PKGS]
                          optimize for fast installation [default=yes]
  --disable-libtool-lock  avoid locking (might break parallel builds)
  --enable-getifaddrs     s Enable the use of getifaddrs() [[yes|no|glibc]].
                          glibc: Use getifaddrs() in glibc if you know it
                          supports IPv6.
  --enable-debugging      + include ntpd debugging code
  --enable-debug-timing   - include processing time debugging code (costs
                          performance)
  --enable-dst-minutes    n minutes per DST adjustment [60]
  --enable-ignore-dns-errors
                          - retry DNS queries on any error
  --enable-force-defer-DNS
                          - force all DNS lookups to take the deferred path
  --enable-BANCOMM        - Datum/Bancomm bc635/VME interface
  --enable-GPSVME         - TrueTime GPS receiver/VME interface
  --enable-all-clocks     + include all suitable non-PARSE clocks:
  --enable-ACTS           s ACTS modem service
  --enable-ARBITER        + Arbiter 1088A/B GPS receiver
  --enable-ARCRON-MSF     + Arcron MSF receiver
  --enable-AS2201         + Austron 2200A/2201A GPS receiver
  --enable-ATOM           s ATOM PPS interface
  --enable-CHRONOLOG      + Chrono-log K-series WWVB receiver
  --enable-CHU            + CHU modem/decoder
  --enable-AUDIO-CHU      s CHU audio/decoder
  --enable-DATUM          s Datum Programmable Time System
  --enable-DUMBCLOCK      + Dumb generic hh:mm:ss local clock
  --enable-FG             + Forum Graphic GPS
  --enable-HEATH          s Heath GC-1000 WWV/WWVH receiver
  --enable-HOPFSERIAL     + hopf serial clock device
  --enable-HOPFPCI        + hopf 6039 PCI board
  --enable-HPGPS          + HP 58503A GPS receiver
  --enable-IRIG           s IRIG audio decoder
  --enable-JJY            + JJY receiver
  --enable-JUPITER        s Rockwell Jupiter GPS receiver
  --enable-LEITCH         + Leitch CSD 5300 Master Clock System Driver
  --enable-LOCAL-CLOCK    + local clock reference
  --enable-MX4200         s Magnavox MX4200 GPS receiver
  --enable-NEOCLOCK4X     + NeoClock4X DCF77 / TDF receiver
  --enable-NMEA           + NMEA GPS receiver
  --enable-ONCORE         s Motorola VP/UT Oncore GPS receiver
  --enable-PALISADE       s Palisade clock
  --enable-PCF            + Conrad parallel port radio clock
  --enable-PST            + PST/Traconex 1020 WWV/WWVH receiver
  --enable-RIPENCC        - RIPENCC specific Trimble driver
  --enable-SHM            s SHM clock attached thru shared memory
  --enable-SPECTRACOM     + Spectracom 8170/Netclock/2 WWVB receiver
  --enable-TPRO           s KSI/Odetics TPRO/S GPS receiver/IRIG interface
  --enable-TRUETIME       s Kinemetrics/TrueTime receivers
  --enable-TT560          - TrueTime 560 IRIG-B decoder
  --enable-ULINK          + Ultralink WWVB receiver
  --enable-WWV            s WWV Audio receiver
  --enable-ZYFER          + Zyfer GPStarplus receiver
  --enable-parse-clocks   - include all suitable PARSE clocks:
  --enable-COMPUTIME      s Diem Computime Radio Clock
  --enable-DCF7000        s ELV/DCF7000 clock
  --enable-HOPF6021       s HOPF 6021 clock
  --enable-MEINBERG       s Meinberg clocks
  --enable-RAWDCF         s DCF77 raw time code
  --enable-RCC8000        s RCC 8000 clock
  --enable-SCHMID         s Schmid DCF77 clock
  --enable-TRIMTAIP       s Trimble GPS receiver/TAIP protocol
  --enable-TRIMTSIP       s Trimble GPS receiver/TSIP protocol
  --enable-WHARTON        s WHARTON 400A Series clock
  --enable-VARITEXT       s VARITEXT clock
  --enable-kmem           s read /dev/kmem for tick and/or tickadj
  --enable-accurate-adjtime
                          s the adjtime() call is accurate
  --enable-tick=VALUE     s force a value for 'tick'
  --enable-tickadj=VALUE  s force a value for 'tickadj'
  --enable-simulator      - build/install the NTPD simulator?
  --enable-slew-always    s always slew the time
  --enable-step-slew      s step and slew the time
  --enable-ntpdate-step   s if ntpdate should step the time
  --enable-hourly-todr-sync
                          s if we should sync TODR hourly
  --enable-kernel-fll-bug s if we should avoid a kernel FLL bug
  --enable-bug1243-fix    + use unmodified autokey session keys
  --enable-irig-sawtooth  s if we should enable the IRIG sawtooth filter
  --enable-nist           - if we should enable the NIST lockclock scheme
  --enable-ntp-signd      - Provide support for Samba's signing daemon,
                          =/var/run/ntp_signd
  --enable-clockctl       s Use /dev/clockctl for non-root clock control
  --enable-linuxcaps      + Use Linux capabilities for non-root clock control
  --enable-ipv6           s use IPv6?

  --enable-saveconfig     + saveconfig mechanism

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-autoopts-config  specify the config-info script
  --with-binsubdir        bin ={bin,sbin}
  --with-arlib            - deprecated, arlib not distributed
  --without-rpath         s Disable auto-added -R linker paths
  --with-pic              try to use only PIC/non-PIC objects [default=use
                          both]
  --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-net-snmp-config  + =net-snmp-config
  --with-lineeditlibs     edit,editline (readline may be specified if desired)
  --with-openssl-libdir   + =/something/reasonable
  --with-openssl-incdir   + =/something/reasonable
  --with-crypto           + =openssl
  --with-electricfence    - compile with ElectricFence malloc debugger
  --with-ntpsnmpd         s Build ntpsnmpd MIB agent?
  --with-kame             - =/usr/local/v6

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L if you have libraries in a
              nonstandard directory 
  LIBS        libraries to pass to the linker, e.g. -l
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I if
              you have headers in a nonstandard directory 
  CPP         C preprocessor
  YACC        The `Yet Another Compiler Compiler' implementation to use.
              Defaults to the first program found out of: `bison -y', `byacc',
              `yacc'.
  YFLAGS      The list of arguments that will be passed by default to $YACC.
              This script will default YFLAGS to the empty string to avoid a
              default value of `-d' given by some make applications.

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to the package provider.
_ACEOF
ac_status=$?
fi

if test "$ac_init_help" = "recursive"; then
  # If there are subdirs, report their specific --help.
  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
    test -d "$ac_dir" ||
      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
      continue
    ac_builddir=.

case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
  # A ".." for each directory in $ac_dir_suffix.
  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
  case $ac_top_builddir_sub in
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
  esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix

case $srcdir in
  .)  # We are building in place.
    ac_srcdir=.
    ac_top_srcdir=$ac_top_builddir_sub
    ac_abs_top_srcdir=$ac_pwd ;;
  [\\/]* | ?:[\\/]* )  # Absolute name.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir
    ac_abs_top_srcdir=$srcdir ;;
  *) # Relative name.
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_build_prefix$srcdir
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix

    cd "$ac_dir" || { ac_status=$?; continue; }
    # Check for guested configure.
    if test -f "$ac_srcdir/configure.gnu"; then
      echo &&
      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
    elif test -f "$ac_srcdir/configure"; then
      echo &&
      $SHELL "$ac_srcdir/configure" --help=recursive
    else
      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
    fi || ac_status=$?
    cd "$ac_pwd" || { ac_status=$?; break; }
  done
fi

test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
  cat <<\_ACEOF
ntp configure 4.2.6p5
generated by GNU Autoconf 2.68

Copyright (C) 2010 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
  exit
fi

## ------------------------ ##
## Autoconf initialization. ##
## ------------------------ ##

# ac_fn_c_try_compile LINENO
# --------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_compile ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  rm -f conftest.$ac_objext
  if { { ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_compile") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    grep -v '^ *+' conftest.err >conftest.er1
    cat conftest.er1 >&5
    mv -f conftest.er1 conftest.err
  fi
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then :
  ac_retval=0
else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_retval=1
fi
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_c_try_compile

# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_cpp ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  if { { ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    grep -v '^ *+' conftest.err >conftest.er1
    cat conftest.er1 >&5
    mv -f conftest.er1 conftest.err
  fi
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } > conftest.i && {
	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
	 test ! -s conftest.err
       }; then :
  ac_retval=0
else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

    ac_retval=1
fi
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_c_try_cpp

# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
# the include files in INCLUDES and setting the cache variable VAR
# accordingly.
ac_fn_c_check_header_mongrel ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  if eval \${$3+:} false; then :
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
  $as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
else
  # Is the header compilable?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
$as_echo_n "checking $2 usability... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_header_compiler=yes
else
  ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
$as_echo "$ac_header_compiler" >&6; }

# Is the header present?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
$as_echo_n "checking $2 presence... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <$2>
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
  ac_header_preproc=yes
else
  ac_header_preproc=no
fi
rm -f conftest.err conftest.i conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
$as_echo "$ac_header_preproc" >&6; }

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
  yes:no: )
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
    ;;
  no:yes:* )
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
    ;;
esac
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
  $as_echo_n "(cached) " >&6
else
  eval "$3=\$ac_header_compiler"
fi
eval ac_res=\$$3
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
fi
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno

} # ac_fn_c_check_header_mongrel

# ac_fn_c_try_run LINENO
# ----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
# that executables *can* be run.
ac_fn_c_try_run ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  if { { ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
  { { case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_try") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; }; then :
  ac_retval=0
else
  $as_echo "$as_me: program exited with status $ac_status" >&5
       $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

       ac_retval=$ac_status
fi
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_c_try_run

# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
# INCLUDES, setting the cache variable VAR accordingly.
ac_fn_c_check_header_compile ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  eval "$3=yes"
else
  eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno

} # ac_fn_c_check_header_compile

# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_link ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  rm -f conftest.$ac_objext conftest$ac_exeext
  if { { ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    grep -v '^ *+' conftest.err >conftest.er1
    cat conftest.er1 >&5
    mv -f conftest.er1 conftest.err
  fi
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext && {
	 test "$cross_compiling" = yes ||
	 $as_test_x conftest$ac_exeext
       }; then :
  ac_retval=0
else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_retval=1
fi
  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
  # interfere with the next link command; also delete a directory that is
  # left behind by Apple's compiler.  We do this before executing the actions.
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_c_try_link

# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
# variable VAR accordingly.
ac_fn_c_check_type ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
  $as_echo_n "(cached) " >&6
else
  eval "$3=no"
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
int
main ()
{
if (sizeof ($2))
	 return 0;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
int
main ()
{
if (sizeof (($2)))
	    return 0;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

else
  eval "$3=yes"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno

} # ac_fn_c_check_type

# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
# --------------------------------------------
# Tries to find the compile-time value of EXPR in a program that includes
# INCLUDES, setting VAR accordingly. Returns whether the value could be
# computed
ac_fn_c_compute_int ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  if test "$cross_compiling" = yes; then
    # Depending upon the size, compute the lo and hi bounds.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
int
main ()
{
static int test_array [1 - 2 * !(($2) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_lo=0 ac_mid=0
  while :; do
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
int
main ()
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_hi=$ac_mid; break
else
  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
			if test $ac_lo -le $ac_mid; then
			  ac_lo= ac_hi=
			  break
			fi
			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
int
main ()
{
static int test_array [1 - 2 * !(($2) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_hi=-1 ac_mid=-1
  while :; do
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
int
main ()
{
static int test_array [1 - 2 * !(($2) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_lo=$ac_mid; break
else
  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
			if test $ac_mid -le $ac_hi; then
			  ac_lo= ac_hi=
			  break
			fi
			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  ac_lo= ac_hi=
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
int
main ()
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_hi=$ac_mid
else
  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in #((
?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
'') ac_retval=1 ;;
esac
  else
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
static long int longval () { return $2; }
static unsigned long int ulongval () { return $2; }
#include 
#include 
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    return 1;
  if (($2) < 0)
    {
      long int i = longval ();
      if (i != ($2))
	return 1;
      fprintf (f, "%ld", i);
    }
  else
    {
      unsigned long int i = ulongval ();
      if (i != ($2))
	return 1;
      fprintf (f, "%lu", i);
    }
  /* Do not output a trailing newline, as this causes \r\n confusion
     on some platforms.  */
  return ferror (f) || fclose (f) != 0;

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  echo >>conftest.val; read $3 &5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
/* Define $2 to an innocuous variant, in case  declares $2.
   For example, HP-UX 11i  declares gettimeofday.  */
#define $2 innocuous_$2

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $2 (); below.
    Prefer  to  if __STDC__ is defined, since
     exists even on freestanding compilers.  */

#ifdef __STDC__
# include 
#else
# include 
#endif

#undef $2

/* 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 $2 ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined __stub_$2 || defined __stub___$2
choke me
#endif

int
main ()
{
return $2 ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  eval "$3=yes"
else
  eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
fi
eval ac_res=\$$3
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno

} # ac_fn_c_check_func

# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
# ----------------------------------------------------
# Tries to find if the field MEMBER exists in type AGGR, after including
# INCLUDES, setting cache variable VAR accordingly.
ac_fn_c_check_member ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
$as_echo_n "checking for $2.$3... " >&6; }
if eval \${$4+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$5
int
main ()
{
static $2 ac_aggr;
if (ac_aggr.$3)
return 0;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  eval "$4=yes"
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$5
int
main ()
{
static $2 ac_aggr;
if (sizeof ac_aggr.$3)
return 0;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  eval "$4=yes"
else
  eval "$4=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$4
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno

} # ac_fn_c_check_member
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.6p5, which was
generated by GNU Autoconf 2.68.  Invocation command line was

  $ $0 $@

_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##

hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`

/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`

/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`

_ASUNAME

as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    $as_echo "PATH: $as_dir"
  done
IFS=$as_save_IFS

} >&5

cat >&5 <<_ACEOF


## ----------- ##
## Core tests. ##
## ----------- ##

_ACEOF


# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
ac_must_keep_next=false
for ac_pass in 1 2
do
  for ac_arg
  do
    case $ac_arg in
    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
    | -silent | --silent | --silen | --sile | --sil)
      continue ;;
    *\'*)
      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
    esac
    case $ac_pass in
    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
    2)
      as_fn_append ac_configure_args1 " '$ac_arg'"
      if test $ac_must_keep_next = true; then
	ac_must_keep_next=false # Got value, back to normal.
      else
	case $ac_arg in
	  *=* | --config-cache | -C | -disable-* | --disable-* \
	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
	  | -with-* | --with-* | -without-* | --without-* | --x)
	    case "$ac_configure_args0 " in
	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
	    esac
	    ;;
	  -* ) ac_must_keep_next=true ;;
	esac
      fi
      as_fn_append ac_configure_args " '$ac_arg'"
      ;;
    esac
  done
done
{ ac_configure_args0=; unset ac_configure_args0;}
{ ac_configure_args1=; unset ac_configure_args1;}

# When interrupted or exit'd, cleanup temporary files, and complete
# config.log.  We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
  # Save into config.log some information that might help in debugging.
  {
    echo

    $as_echo "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
    echo
    # The following way of writing the cache mishandles newlines in values,
(
  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
    eval ac_val=\$$ac_var
    case $ac_val in #(
    *${as_nl}*)
      case $ac_var in #(
      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      esac
      case $ac_var in #(
      _ | IFS | as_nl) ;; #(
      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
      *) { eval $ac_var=; unset $ac_var;} ;;
      esac ;;
    esac
  done
  (set) 2>&1 |
    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
    *${as_nl}ac_space=\ *)
      sed -n \
	"s/'\''/'\''\\\\'\'''\''/g;
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
      ;; #(
    *)
      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
      ;;
    esac |
    sort
)
    echo

    $as_echo "## ----------------- ##
## Output variables. ##
## ----------------- ##"
    echo
    for ac_var in $ac_subst_vars
    do
      eval ac_val=\$$ac_var
      case $ac_val in
      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
      esac
      $as_echo "$ac_var='\''$ac_val'\''"
    done | sort
    echo

    if test -n "$ac_subst_files"; then
      $as_echo "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
      echo
      for ac_var in $ac_subst_files
      do
	eval ac_val=\$$ac_var
	case $ac_val in
	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
	esac
	$as_echo "$ac_var='\''$ac_val'\''"
      done | sort
      echo
    fi

    if test -s confdefs.h; then
      $as_echo "## ----------- ##
## confdefs.h. ##
## ----------- ##"
      echo
      cat confdefs.h
      echo
    fi
    test "$ac_signal" != 0 &&
      $as_echo "$as_me: caught signal $ac_signal"
    $as_echo "$as_me: exit $exit_status"
  } >&5
  rm -f core *.core core.conftest.* &&
    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
    exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
ac_signal=0

# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h

$as_echo "/* confdefs.h */" > confdefs.h

# Predefined preprocessor variables.

cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF

cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF

cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF

cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF

cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF

cat >>confdefs.h <<_ACEOF
#define PACKAGE_URL "$PACKAGE_URL"
_ACEOF


# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
  # We do not want a PATH search for config.site.
  case $CONFIG_SITE in #((
    -*)  ac_site_file1=./$CONFIG_SITE;;
    */*) ac_site_file1=$CONFIG_SITE;;
    *)   ac_site_file1=./$CONFIG_SITE;;
  esac
elif test "x$prefix" != xNONE; then
  ac_site_file1=$prefix/share/config.site
  ac_site_file2=$prefix/etc/config.site
else
  ac_site_file1=$ac_default_prefix/share/config.site
  ac_site_file2=$ac_default_prefix/etc/config.site
fi
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
  test "x$ac_site_file" = xNONE && continue
  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
    sed 's/^/| /' "$ac_site_file" >&5
    . "$ac_site_file" \
      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
  fi
done

if test -r "$cache_file"; then
  # Some versions of bash will fail to source /dev/null (special files
  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
$as_echo "$as_me: loading cache $cache_file" >&6;}
    case $cache_file in
      [\\/]* | ?:[\\/]* ) . "$cache_file";;
      *)                      . "./$cache_file";;
    esac
  fi
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
$as_echo "$as_me: creating cache $cache_file" >&6;}
  >$cache_file
fi

# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in $ac_precious_vars; do
  eval ac_old_set=\$ac_cv_env_${ac_var}_set
  eval ac_new_set=\$ac_env_${ac_var}_set
  eval ac_old_val=\$ac_cv_env_${ac_var}_value
  eval ac_new_val=\$ac_env_${ac_var}_value
  case $ac_old_set,$ac_new_set in
    set,)
      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
      ac_cache_corrupted=: ;;
    ,set)
      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
      ac_cache_corrupted=: ;;
    ,);;
    *)
      if test "x$ac_old_val" != "x$ac_new_val"; then
	# differences in whitespace do not lead to failure.
	ac_old_val_w=`echo x $ac_old_val`
	ac_new_val_w=`echo x $ac_new_val`
	if test "$ac_old_val_w" != "$ac_new_val_w"; then
	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
	  ac_cache_corrupted=:
	else
	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
	  eval $ac_var=\$ac_old_val
	fi
	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
      fi;;
  esac
  # Pass precious variables to config.status.
  if test "$ac_new_set" = set; then
    case $ac_new_val in
    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
    *) ac_arg=$ac_var=$ac_new_val ;;
    esac
    case " $ac_configure_args " in
      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
    esac
  fi
done
if $ac_cache_corrupted; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
## -------------------- ##

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



ac_aux_dir=
for ac_dir in . "$srcdir"/.; do
  if test -f "$ac_dir/install-sh"; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install-sh -c"
    break
  elif test -f "$ac_dir/install.sh"; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install.sh -c"
    break
  elif test -f "$ac_dir/shtool"; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/shtool install -c"
    break
  fi
done
if test -z "$ac_aux_dir"; then
  as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5
fi

# These three variables are undocumented and unsupported,
# and are intended to be withdrawn in a future Autoconf release.
# They can cause serious problems if a builder's source tree is in a directory
# whose full name contains unusual characters.
ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
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.



# Increment ntp_configure_cache_version by one for each change to
# configure.ac or .m4 files which invalidates cached values from
# previous versions.
#
# If the change affects cache variables used only by the main NTP
# configure.ac, then only its version number should be bumped, while
# the subdir configure.ac version numbers should be unchanged.  The
# same is true for a test/variable that is used only by one subdir
# being changed incompatibly; only that subdir's cache version needs
# bumping.
#
# If a change affects variables shared by all NTP configure scripts,
# please bump the version numbers of all three.  If you are not sure,
# the safe choice is to bump all three on any cache-invalidating change.
#
# In order to avoid the risk of version stamp collision between -stable
# and -dev branches, do not simply increment the version, instead use
# the date YYYYMMDD optionally with -HHMM if there is more than one
# bump in a day.

ntp_configure_cache_version=20091117

# When the cache version of config.cache and configure do not
# match, NTP_CACHEVERSION will flush the cache.



    ntp_cache_flush=1

    case "$ntp_cv_main_cache_version" in
     $ntp_configure_cache_version)
	# same version, good
	ntp_cache_flush=0
	;;
     '')
	# No cache, predates ntp_cv_main_cache_version, or is empty.
	case "$cache_file" in
	 /dev/null)
	    ntp_cache_flush=0
	    ;;
	 *)
	    case "$NTP_CACHEVERSION_PARENT" in
	     '')
		# Do not clear the cache immediately after it is created
		# empty as it is noisy.  Differentiate a newly-created
		# config.cache from one predating the cache version
		# mechanism by looking for the first cached variable set
		# by Autoconf
		case "$ac_cv_path_install" in
		 '')
		    # empty config.cache file
		    ntp_cache_flush=0
		esac
		;;
	     *)
		# Parent configure just created cache from empty,
		# flushing would be counterproductive.
		ntp_cache_flush=0;
	    esac
	esac
	;;
     *)
	# configure cache version mismatches config.cache version
    esac

    case "$ntp_cache_flush" in
     1)
	c_version="${ntp_cv_main_cache_version:-(no version found)}"

	# Do we flush all variables or exclude others' version stamps?

	case "$NTP_CACHEVERSION_PARENT" in
	 '')
	    # Clear all *_cv_* variables including our child subdirs'
	    # ntp_cv_*_cache_version variables.  This prevents subdir
	    # configure scripts from noticing a version mismatch just
	    # after the top configure in the invocation cleared and
	    # recreated the cache.

	    c_varname_list=`set |
			    sed -n -e 's/=.*$//' \
				   -e '/_cv_/p'
			   `
	    ;;
	 *)
	    # This is not the top configure this particular invocation.
	    # Clear all *_cv_* variables sparing the version stamps
	    # of other configure scripts, so we don't trigger
	    # useless repeated clearings.

	    c_varname_list=`set |
			    sed -n -e 's/=.*$//' \
				   -e '/ntp_cv_.*_cache_version/d' \
				   -e '/_cv_/p'
			   `
	esac

	for c_varname in $c_varname_list
	do
	    { eval $c_varname=; unset $c_varname;}
	done

	{ $as_echo "$as_me:${as_lineno-$LINENO}: $cache_file saved by another version, ignored." >&5
$as_echo "$as_me: $cache_file saved by another version, ignored." >&6;}
	{ $as_echo "$as_me:${as_lineno-$LINENO}: configure script cache version: $ntp_configure_cache_version" >&5
$as_echo "$as_me: configure script cache version: $ntp_configure_cache_version" >&6;}
	{ $as_echo "$as_me:${as_lineno-$LINENO}: $cache_file version: $c_version" >&5
$as_echo "$as_me: $cache_file version: $c_version" >&6;}
	{ c_varname=; unset c_varname;}
	{ c_varname_list=; unset c_varname_list;}
	{ c_version=; unset c_version;}
    esac

    { ntp_cache_flush=; unset ntp_cache_flush;}

    # save configure version in config.cache for next time
    ntp_cv_main_cache_version="$ntp_configure_cache_version"

    # let any subdir configure.ac NTP_CACHEVERSION invocations
    # know they are not the top level.
    NTP_CACHEVERSION_PARENT='main' ; export NTP_CACHEVERSION_PARENT


am__api_version='1.11'

# Find a good install program.  We prefer a C program (faster),
# so one script is as good as another.  But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
if ${ac_cv_path_install+:} false; then :
  $as_echo_n "(cached) " >&6
else
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    # Account for people who put trailing slashes in PATH elements.
case $as_dir/ in #((
  ./ | .// | /[cC]/* | \
  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
  /usr/ucb/* ) ;;
  *)
    # OSF1 and SCO ODT 3.0 have their own names for install.
    # Don't use installbsd from OSF since it installs stuff as root
    # by default.
    for ac_prog in ginstall scoinst install; do
      for ac_exec_ext in '' $ac_executable_extensions; do
	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
	  if test $ac_prog = install &&
	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
	    # AIX install.  It has an incompatible calling convention.
	    :
	  elif test $ac_prog = install &&
	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
	    # program-specific install script used by HP pwplus--don't use.
	    :
	  else
	    rm -rf conftest.one conftest.two conftest.dir
	    echo one > conftest.one
	    echo two > conftest.two
	    mkdir conftest.dir
	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
	      test -s conftest.one && test -s conftest.two &&
	      test -s conftest.dir/conftest.one &&
	      test -s conftest.dir/conftest.two
	    then
	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
	      break 3
	    fi
	  fi
	fi
      done
    done
    ;;
esac

  done
IFS=$as_save_IFS

rm -rf conftest.one conftest.two conftest.dir

fi
  if test "${ac_cv_path_install+set}" = set; then
    INSTALL=$ac_cv_path_install
  else
    # As a last resort, use the slow shell script.  Don't cache a
    # value for INSTALL within a source directory, because that will
    # break other packages using the cache if that directory is
    # removed, or if the value is a relative name.
    INSTALL=$ac_install_sh
  fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
$as_echo "$INSTALL" >&6; }

# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'

test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'

test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
$as_echo_n "checking whether build environment is sane... " >&6; }
# Just in case
sleep 1
echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name.  Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
  *[\\\"\#\$\&\'\`$am_lf]*)
    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
esac
case $srcdir in
  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
esac

# Do `set' in a subshell so we don't clobber the current shell's
# arguments.  Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
   if test "$*" = "X"; then
      # -L didn't work.
      set X `ls -t "$srcdir/configure" conftest.file`
   fi
   rm -f conftest.file
   if test "$*" != "X $srcdir/configure conftest.file" \
      && test "$*" != "X conftest.file $srcdir/configure"; then

      # If neither matched, then we have a broken ls.  This can happen
      # if, for instance, CONFIG_SHELL is bash and it inherits a
      # broken ls alias from the environment.  This has actually
      # happened.  Such a system could not be considered "sane".
      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
alias in your environment" "$LINENO" 5
   fi

   test "$2" = conftest.file
   )
then
   # Ok.
   :
else
   as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
test "$program_prefix" != NONE &&
  program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
# Double any \ or $.
# By default was `s,x,x', remove it if useless.
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`

# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`

if test x"${MISSING+set}" != xset; then
  case $am_aux_dir in
  *\ * | *\	*)
    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
  *)
    MISSING="\${SHELL} $am_aux_dir/missing" ;;
  esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
  am_missing_run="$MISSING --run "
else
  am_missing_run=
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
fi

if test x"${install_sh}" != xset; then
  case $am_aux_dir in
  *\ * | *\	*)
    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
  *)
    install_sh="\${SHELL} $am_aux_dir/install-sh"
  esac
fi

# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'.  However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
if test "$cross_compiling" != no; then
  if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; 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_STRIP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$STRIP"; then
  ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip"
    $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
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
$as_echo "$STRIP" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_STRIP"; then
  ac_ct_STRIP=$STRIP
  # Extract the first word of "strip", so it can be a program name with args.
set dummy strip; 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_ac_ct_STRIP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_STRIP"; then
  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_ac_ct_STRIP="strip"
    $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
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
$as_echo "$ac_ct_STRIP" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_STRIP" = x; then
    STRIP=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    STRIP=$ac_ct_STRIP
  fi
else
  STRIP="$ac_cv_prog_STRIP"
fi

fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
  if ${ac_cv_path_mkdir+:} false; then :
  $as_echo_n "(cached) " >&6
else
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_prog in mkdir gmkdir; do
	 for ac_exec_ext in '' $ac_executable_extensions; do
	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
	     'mkdir (GNU coreutils) '* | \
	     'mkdir (coreutils) '* | \
	     'mkdir (fileutils) '4.1*)
	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
	       break 3;;
	   esac
	 done
       done
  done
IFS=$as_save_IFS

fi

  test -d ./--version && rmdir ./--version
  if test "${ac_cv_path_mkdir+set}" = set; then
    MKDIR_P="$ac_cv_path_mkdir -p"
  else
    # As a last resort, use the slow shell script.  Don't cache a
    # value for MKDIR_P within a source directory, because that will
    # break other packages using the cache if that directory is
    # removed, or if the value is a relative name.
    MKDIR_P="$ac_install_sh -d"
  fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
$as_echo "$MKDIR_P" >&6; }

mkdir_p="$MKDIR_P"
case $mkdir_p in
  [\\/$]* | ?:[\\/]*) ;;
  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
esac

for ac_prog in gawk mawk nawk awk
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_AWK+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$AWK"; then
  ac_cv_prog_AWK="$AWK" # 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_AWK="$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
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
$as_echo "$AWK" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$AWK" && break
done

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
	@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
  *@@@%%%=?*=@@@%%%*)
    eval ac_cv_prog_make_${ac_make}_set=yes;;
  *)
    eval ac_cv_prog_make_${ac_make}_set=no;;
esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
  SET_MAKE=
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
  SET_MAKE="MAKE=${MAKE-make}"
fi

rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
  am__leading_dot=.
else
  am__leading_dot=_
fi
rmdir .tst 2>/dev/null

if test "`cd $srcdir && pwd`" != "`pwd`"; then
  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
  # is not polluted with repeated "-I."
  am__isrc=' -I$(srcdir)'
  # test to see if srcdir already configured
  if test -f $srcdir/config.status; then
    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
  fi
fi

# test whether we have cygpath
if test -z "$CYGPATH_W"; then
  if (cygpath --version) >/dev/null 2>/dev/null; then
    CYGPATH_W='cygpath -w'
  else
    CYGPATH_W=echo
  fi
fi


# Define the identity of the package.
 PACKAGE='ntp'
 VERSION='4.2.6p5'


cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define VERSION "$VERSION"
_ACEOF

# Some tools Automake needs.

ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}


AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}


AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}


AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}


MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}

# We need awk for the "check" target.  The system "awk" is bad on
# some platforms.
# Always define AMTAR for backward compatibility.

AMTAR=${AMTAR-"${am_missing_run}tar"}

am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'





# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
if ${ac_cv_build+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_build
shift
build_cpu=$1
build_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
build_os=$*
IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
$as_echo_n "checking host system type... " >&6; }
if ${ac_cv_host+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test "x$host_alias" = x; then
  ac_cv_host=$ac_cv_build
else
  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_host
shift
host_cpu=$1
host_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
host_os=$*
IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac



cat >>confdefs.h <<_ACEOF
#define STR_SYSTEM "$host"
_ACEOF

ac_config_headers="$ac_config_headers config.h"


ntp_atom_ok=${ntp_atom_ok=no}
ntp_oncore_ok=${ntp_oncore_ok=no}
ntp_parse_ok=${ntp_parse_ok=no}
ntp_ripe_ncc_ok=${ntp_parse_ok=no}
ntp_jupiter_ok=${ntp_jupiter_ok=no}

DEPDIR="${am__leading_dot}deps"

ac_config_commands="$ac_config_commands depfiles"


am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
	@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from `make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
  am__include=include
  am__quote=
  _am_result=GNU
  ;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
   echo '.include "confinc"' > confmf
   case `$am_make -s -f confmf 2> /dev/null` in #(
   *the\ am__doit\ target*)
     am__include=.include
     am__quote="\""
     _am_result=BSD
     ;;
   esac
fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
$as_echo "$_am_result" >&6; }
rm -f confinc confmf

# Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then :
  enableval=$enable_dependency_tracking;
fi

if test "x$enable_dependency_tracking" != xno; then
  am_depcomp="$ac_aux_dir/depcomp"
  AMDEPBACKSLASH='\'
fi
 if test "x$enable_dependency_tracking" != xno; then
  AMDEP_TRUE=
  AMDEP_FALSE='#'
else
  AMDEP_TRUE='#'
  AMDEP_FALSE=
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
if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; 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_tool_prefix}gcc"
    $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


fi
if test -z "$ac_cv_prog_CC"; then
  ac_ct_CC=$CC
  # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; 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_ac_ct_CC+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_CC"; then
  ac_cv_prog_ac_ct_CC="$ac_ct_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_ac_ct_CC="gcc"
    $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
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_CC" = x; then
    CC=""
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    CC=$ac_ct_CC
  fi
else
  CC="$ac_cv_prog_CC"
fi

if test -z "$CC"; then
          if test -n "$ac_tool_prefix"; then
    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; 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_tool_prefix}cc"
    $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


  fi
fi
if test -z "$CC"; then
  # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; 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
  ac_prog_rejected=no
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
    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
       ac_prog_rejected=yes
       continue
     fi
    ac_cv_prog_CC="cc"
    $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_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_CC
  shift
  if test $# != 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set CC to just the basename; use the full file name.
    shift
    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
  fi
fi
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


fi
if test -z "$CC"; then
  if test -n "$ac_tool_prefix"; then
  for ac_prog in cl.exe
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$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_tool_prefix$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
fi
if test -z "$CC"; then
  ac_ct_CC=$CC
  for ac_prog in cl.exe
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_ac_ct_CC+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_CC"; then
  ac_cv_prog_ac_ct_CC="$ac_ct_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_ac_ct_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
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$ac_ct_CC" && break
done

  if test "x$ac_ct_CC" = x; then
    CC=""
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    CC=$ac_ct_CC
  fi
fi

fi


test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }

# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
  { { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    sed '10a\
... rest of stderr output deleted ...
         10q' conftest.err >conftest.er1
    cat conftest.er1 >&5
  fi
  rm -f conftest.er1 conftest.err
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }
done

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
$as_echo_n "checking whether the C compiler works... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`

# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"

ac_rmfiles=
for ac_file in $ac_files
do
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
  esac
done
rm -f $ac_rmfiles

if { { ac_try="$ac_link_default"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link_default") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then :
  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile.  We should not override ac_cv_exeext if it was cached,
# so that the user can short-circuit this test for compilers unknown to
# Autoconf.
for ac_file in $ac_files ''
do
  test -f "$ac_file" || continue
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
	;;
    [ab].out )
	# We found the default executable, but exeext='' is most
	# certainly right.
	break;;
    *.* )
	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
	then :; else
	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
	fi
	# We set ac_cv_exeext here because the later test for it is not
	# safe: cross compilers may not add the suffix if given an `-o'
	# argument, so we may need to know it at that point already.
	# Even if this section looks crufty: it has the advantage of
	# actually working.
	break;;
    * )
	break;;
  esac
done
test "$ac_cv_exeext" = no && ac_cv_exeext=

else
  ac_file=''
fi
if test -z "$ac_file"; then :
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
$as_echo_n "checking for C compiler default output file name... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext

rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
$as_echo_n "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then :
  # If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
# `rm'.
for ac_file in conftest.exe conftest conftest.*; do
  test -f "$ac_file" || continue
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
	  break;;
    * ) break;;
  esac
done
else
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
$as_echo "$ac_cv_exeext" >&6; }

rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
int
main ()
{
FILE *f = fopen ("conftest.out", "w");
 return ferror (f) || fclose (f) != 0;

  ;
  return 0;
}
_ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run.  If not, either
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
$as_echo_n "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
  { { ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }
  if { ac_try='./conftest$ac_cv_exeext'
  { { case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_try") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; }; then
    cross_compiling=no
  else
    if test "$cross_compiling" = maybe; then
	cross_compiling=yes
    else
	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
    fi
  fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; }

rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
if ${ac_cv_objext+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.o conftest.obj
if { { ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_compile") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then :
  for ac_file in conftest.o conftest.obj conftest.*; do
  test -f "$ac_file" || continue;
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
       break;;
  esac
done
else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
if ${ac_cv_c_compiler_gnu+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{
#ifndef __GNUC__
       choke me
#endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_compiler_gnu=yes
else
  ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
$as_echo "$ac_cv_c_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
  GCC=yes
else
  GCC=
fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
if ${ac_cv_prog_cc_g+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_save_c_werror_flag=$ac_c_werror_flag
   ac_c_werror_flag=yes
   ac_cv_prog_cc_g=no
   CFLAGS="-g"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_prog_cc_g=yes
else
  CFLAGS=""
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

else
  ac_c_werror_flag=$ac_save_c_werror_flag
	 CFLAGS="-g"
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_prog_cc_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   ac_c_werror_flag=$ac_save_c_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
  CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
  if test "$GCC" = yes; then
    CFLAGS="-g -O2"
  else
    CFLAGS="-g"
  fi
else
  if test "$GCC" = yes; then
    CFLAGS="-O2"
  else
    CFLAGS=
  fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
#include 
#include 
#include 
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
     char **p;
     int i;
{
  return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
  char *s;
  va_list v;
  va_start (v,p);
  s = g (p, va_arg (v,int));
  va_end (v);
  return s;
}

/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
   function prototypes and stuff, but not '\xHH' hex character constants.
   These don't provoke an error unfortunately, instead are silently treated
   as 'x'.  The following induces an error, until -std is added to get
   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
   array size at least.  It's necessary to write '\x00'==0 to get something
   that's true only with -std.  */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];

/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
   inside strings and character constants.  */
#define FOO(x) 'x'
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];

int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
  ;
  return 0;
}
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
  CC="$ac_save_CC $ac_arg"
  if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_prog_cc_c89=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext
  test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC

fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
  x)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
  xno)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
  *)
    CC="$CC $ac_cv_prog_cc_c89"
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :

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

depcc="$CC"   am_compiler_list=

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
if ${am_cv_CC_dependencies_compiler_type+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  # We make a subdir and do the tests there.  Otherwise we can end up
  # making bogus files that we don't know about and never remove.  For
  # instance it was reported that on HP-UX the gcc test will end up
  # making a dummy file named `D' -- because `-MD' means `put the output
  # in D'.
  mkdir conftest.dir
  # Copy depcomp to subdir because otherwise we won't find it if we're
  # using a relative directory.
  cp "$am_depcomp" conftest.dir
  cd conftest.dir
  # We will build objects and dependencies in a subdirectory because
  # it helps to detect inapplicable dependency modes.  For instance
  # both Tru64's cc and ICC support -MD to output dependencies as a
  # side effect of compilation, but ICC will put the dependencies in
  # the current directory while Tru64 will put them in the object
  # directory.
  mkdir sub

  am_cv_CC_dependencies_compiler_type=none
  if test "$am_compiler_list" = ""; then
     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
  fi
  am__universal=false
  case " $depcc " in #(
     *\ -arch\ *\ -arch\ *) am__universal=true ;;
     esac

  for depmode in $am_compiler_list; do
    # Setup a source with many dependencies, because some compilers
    # like to wrap large dependency lists on column 80 (with \), and
    # we should not choose a depcomp mode which is confused by this.
    #
    # We need to recreate these files for each test, as the compiler may
    # overwrite some of them when testing with obscure command lines.
    # This happens at least with the AIX C compiler.
    : > sub/conftest.c
    for i in 1 2 3 4 5 6; do
      echo '#include "conftst'$i'.h"' >> sub/conftest.c
      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
      # Solaris 8's {/usr,}/bin/sh.
      touch sub/conftst$i.h
    done
    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf

    # We check with `-c' and `-o' for the sake of the "dashmstdout"
    # mode.  It turns out that the SunPro C++ compiler does not properly
    # handle `-M -o', and we need to detect this.  Also, some Intel
    # versions had trouble with output in subdirs
    am__obj=sub/conftest.${OBJEXT-o}
    am__minus_obj="-o $am__obj"
    case $depmode in
    gcc)
      # This depmode causes a compiler race in universal mode.
      test "$am__universal" = false || continue
      ;;
    nosideeffect)
      # after this tag, mechanisms are not by side-effect, so they'll
      # only be used when explicitly requested
      if test "x$enable_dependency_tracking" = xyes; then
	continue
      else
	break
      fi
      ;;
    msvisualcpp | msvcmsys)
      # This compiler won't grok `-c -o', but also, the minuso test has
      # not run yet.  These depmodes are late enough in the game, and
      # so weak that their functioning should not be impacted.
      am__obj=conftest.${OBJEXT-o}
      am__minus_obj=
      ;;
    none) break ;;
    esac
    if depmode=$depmode \
       source=sub/conftest.c object=$am__obj \
       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
         >/dev/null 2>conftest.err &&
       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
      # icc doesn't choke on unknown options, it will just issue warnings
      # or remarks (even with -Werror).  So we grep stderr for any message
      # that says an option was ignored or not supported.
      # When given -MP, icc 7.0 and 7.1 complain thusly:
      #   icc: Command line warning: ignoring option '-M'; no argument required
      # The diagnosis changed in icc 8.0:
      #   icc: Command line remark: option '-MP' not supported
      if (grep 'ignoring option' conftest.err ||
          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
        am_cv_CC_dependencies_compiler_type=$depmode
        break
      fi
    fi
  done

  cd ..
  rm -rf conftest.dir
else
  am_cv_CC_dependencies_compiler_type=none
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type

 if
  test "x$enable_dependency_tracking" != xno \
  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
  am__fastdepCC_TRUE=
  am__fastdepCC_FALSE='#'
else
  am__fastdepCC_TRUE='#'
  am__fastdepCC_FALSE=
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
  if ${ac_cv_prog_CPP+:} false; then :
  $as_echo_n "(cached) " >&6
else
      # Double quotes because CPP needs to be expanded
    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
    do
      ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # Prefer  to  if __STDC__ is defined, since
  #  exists even on freestanding compilers.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#ifdef __STDC__
# include 
#else
# include 
#endif
		     Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :

else
  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext

  # OK, works on sane cases.  Now check whether nonexistent headers
  # can be detected and how.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
  # Broken: success on invalid input.
continue
else
  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
  break
fi

    done
    ac_cv_prog_CPP=$CPP

fi
  CPP=$ac_cv_prog_CPP
else
  ac_cv_prog_CPP=$CPP
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
$as_echo "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # Prefer  to  if __STDC__ is defined, since
  #  exists even on freestanding compilers.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#ifdef __STDC__
# include 
#else
# include 
#endif
		     Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :

else
  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext

  # OK, works on sane cases.  Now check whether nonexistent headers
  # can be detected and how.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
  # Broken: success on invalid input.
continue
else
  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :

else
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
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


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -z "$GREP"; then
  ac_path_GREP_found=false
  # Loop through the user's path and test for each of PROGNAME-LIST
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_prog in grep ggrep; do
    for ac_exec_ext in '' $ac_executable_extensions; do
      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
# Check for GNU ac_path_GREP and select it if it is found.
  # Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
  ac_count=0
  $as_echo_n 0123456789 >"conftest.in"
  while :
  do
    cat "conftest.in" "conftest.in" >"conftest.tmp"
    mv "conftest.tmp" "conftest.in"
    cp "conftest.in" "conftest.nl"
    $as_echo 'GREP' >> "conftest.nl"
    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    as_fn_arith $ac_count + 1 && ac_count=$as_val
    if test $ac_count -gt ${ac_path_GREP_max-0}; then
      # Best one so far, save it but keep looking for a better one
      ac_cv_path_GREP="$ac_path_GREP"
      ac_path_GREP_max=$ac_count
    fi
    # 10*(2^10) chars as input seems more than enough
    test $ac_count -gt 10 && break
  done
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac

      $ac_path_GREP_found && break 3
    done
  done
  done
IFS=$as_save_IFS
  if test -z "$ac_cv_path_GREP"; then
    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
  fi
else
  ac_cv_path_GREP=$GREP
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
$as_echo "$ac_cv_path_GREP" >&6; }
 GREP="$ac_cv_path_GREP"


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
if ${ac_cv_path_EGREP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
   then ac_cv_path_EGREP="$GREP -E"
   else
     if test -z "$EGREP"; then
  ac_path_EGREP_found=false
  # Loop through the user's path and test for each of PROGNAME-LIST
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_prog in egrep; do
    for ac_exec_ext in '' $ac_executable_extensions; do
      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
# Check for GNU ac_path_EGREP and select it if it is found.
  # Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
*GNU*)
  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
  ac_count=0
  $as_echo_n 0123456789 >"conftest.in"
  while :
  do
    cat "conftest.in" "conftest.in" >"conftest.tmp"
    mv "conftest.tmp" "conftest.in"
    cp "conftest.in" "conftest.nl"
    $as_echo 'EGREP' >> "conftest.nl"
    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    as_fn_arith $ac_count + 1 && ac_count=$as_val
    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
      # Best one so far, save it but keep looking for a better one
      ac_cv_path_EGREP="$ac_path_EGREP"
      ac_path_EGREP_max=$ac_count
    fi
    # 10*(2^10) chars as input seems more than enough
    test $ac_count -gt 10 && break
  done
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac

      $ac_path_EGREP_found && break 3
    done
  done
  done
IFS=$as_save_IFS
  if test -z "$ac_cv_path_EGREP"; then
    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
  fi
else
  ac_cv_path_EGREP=$EGREP
fi

   fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
$as_echo "$ac_cv_path_EGREP" >&6; }
 EGREP="$ac_cv_path_EGREP"


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if ${ac_cv_header_stdc+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
#include 
#include 
#include 

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_header_stdc=yes
else
  ac_cv_header_stdc=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "memchr" >/dev/null 2>&1; then :

else
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "free" >/dev/null 2>&1; then :

else
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  if test "$cross_compiling" = yes; then :
  :
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
#include 
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
		   (('a' <= (c) && (c) <= 'i') \
		     || ('j' <= (c) && (c) <= 'r') \
		     || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif

#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
  int i;
  for (i = 0; i < 256; i++)
    if (XOR (islower (i), ISLOWER (i))
	|| toupper (i) != TOUPPER (i))
      return 2;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :

else
  ac_cv_header_stdc=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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then

$as_echo "#define STDC_HEADERS 1" >>confdefs.h

fi

# On IRIX 5.3, sys/types and inttypes.h are conflicting.
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
		  inttypes.h stdint.h unistd.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$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



  ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
if test "x$ac_cv_header_minix_config_h" = xyes; then :
  MINIX=yes
else
  MINIX=
fi


  if test "$MINIX" = yes; then

$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h


$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h


$as_echo "#define _MINIX 1" >>confdefs.h

  fi


  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
if ${ac_cv_safe_to_define___extensions__+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#	  define __EXTENSIONS__ 1
	  $ac_includes_default
int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_safe_to_define___extensions__=yes
else
  ac_cv_safe_to_define___extensions__=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
  test $ac_cv_safe_to_define___extensions__ = yes &&
    $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h

  $as_echo "#define _ALL_SOURCE 1" >>confdefs.h

  $as_echo "#define _GNU_SOURCE 1" >>confdefs.h

  $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h

  $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h





# 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.
if test "${enable_shared+set}" = set; then :
  enableval=$enable_shared; p=${PACKAGE-default}
    case $enableval in
    yes) enable_shared=yes ;;
    no) enable_shared=no ;;
    *)
      enable_shared=no
      # Look at the argument we got.  We use all the common list separators.
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
      for pkg in $enableval; do
	IFS="$lt_save_ifs"
	if test "X$pkg" = "X$p"; then
	  enable_shared=yes
	fi
      done
      IFS="$lt_save_ifs"
      ;;
    esac
else
  enable_shared=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
if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; 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_tool_prefix}gcc"
    $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


fi
if test -z "$ac_cv_prog_CC"; then
  ac_ct_CC=$CC
  # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; 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_ac_ct_CC+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_CC"; then
  ac_cv_prog_ac_ct_CC="$ac_ct_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_ac_ct_CC="gcc"
    $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
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_CC" = x; then
    CC=""
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    CC=$ac_ct_CC
  fi
else
  CC="$ac_cv_prog_CC"
fi

if test -z "$CC"; then
          if test -n "$ac_tool_prefix"; then
    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; 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_tool_prefix}cc"
    $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


  fi
fi
if test -z "$CC"; then
  # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; 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
  ac_prog_rejected=no
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
    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
       ac_prog_rejected=yes
       continue
     fi
    ac_cv_prog_CC="cc"
    $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_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_CC
  shift
  if test $# != 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set CC to just the basename; use the full file name.
    shift
    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
  fi
fi
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


fi
if test -z "$CC"; then
  if test -n "$ac_tool_prefix"; then
  for ac_prog in cl.exe
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$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_tool_prefix$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
fi
if test -z "$CC"; then
  ac_ct_CC=$CC
  for ac_prog in cl.exe
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_ac_ct_CC+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_CC"; then
  ac_cv_prog_ac_ct_CC="$ac_ct_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_ac_ct_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
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$ac_ct_CC" && break
done

  if test "x$ac_ct_CC" = x; then
    CC=""
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    CC=$ac_ct_CC
  fi
fi

fi


test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }

# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
  { { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    sed '10a\
... rest of stderr output deleted ...
         10q' conftest.err >conftest.er1
    cat conftest.er1 >&5
  fi
  rm -f conftest.er1 conftest.err
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }
done

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
if ${ac_cv_c_compiler_gnu+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{
#ifndef __GNUC__
       choke me
#endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_compiler_gnu=yes
else
  ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
$as_echo "$ac_cv_c_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
  GCC=yes
else
  GCC=
fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
if ${ac_cv_prog_cc_g+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_save_c_werror_flag=$ac_c_werror_flag
   ac_c_werror_flag=yes
   ac_cv_prog_cc_g=no
   CFLAGS="-g"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_prog_cc_g=yes
else
  CFLAGS=""
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

else
  ac_c_werror_flag=$ac_save_c_werror_flag
	 CFLAGS="-g"
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_prog_cc_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   ac_c_werror_flag=$ac_save_c_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
  CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
  if test "$GCC" = yes; then
    CFLAGS="-g -O2"
  else
    CFLAGS="-g"
  fi
else
  if test "$GCC" = yes; then
    CFLAGS="-O2"
  else
    CFLAGS=
  fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
#include 
#include 
#include 
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
     char **p;
     int i;
{
  return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
  char *s;
  va_list v;
  va_start (v,p);
  s = g (p, va_arg (v,int));
  va_end (v);
  return s;
}

/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
   function prototypes and stuff, but not '\xHH' hex character constants.
   These don't provoke an error unfortunately, instead are silently treated
   as 'x'.  The following induces an error, until -std is added to get
   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
   array size at least.  It's necessary to write '\x00'==0 to get something
   that's true only with -std.  */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];

/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
   inside strings and character constants.  */
#define FOO(x) 'x'
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];

int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
  ;
  return 0;
}
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
  CC="$ac_save_CC $ac_arg"
  if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_prog_cc_c89=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext
  test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC

fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
  x)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
  xno)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
  *)
    CC="$CC $ac_cv_prog_cc_c89"
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :

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

depcc="$CC"   am_compiler_list=

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
if ${am_cv_CC_dependencies_compiler_type+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  # We make a subdir and do the tests there.  Otherwise we can end up
  # making bogus files that we don't know about and never remove.  For
  # instance it was reported that on HP-UX the gcc test will end up
  # making a dummy file named `D' -- because `-MD' means `put the output
  # in D'.
  mkdir conftest.dir
  # Copy depcomp to subdir because otherwise we won't find it if we're
  # using a relative directory.
  cp "$am_depcomp" conftest.dir
  cd conftest.dir
  # We will build objects and dependencies in a subdirectory because
  # it helps to detect inapplicable dependency modes.  For instance
  # both Tru64's cc and ICC support -MD to output dependencies as a
  # side effect of compilation, but ICC will put the dependencies in
  # the current directory while Tru64 will put them in the object
  # directory.
  mkdir sub

  am_cv_CC_dependencies_compiler_type=none
  if test "$am_compiler_list" = ""; then
     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
  fi
  am__universal=false
  case " $depcc " in #(
     *\ -arch\ *\ -arch\ *) am__universal=true ;;
     esac

  for depmode in $am_compiler_list; do
    # Setup a source with many dependencies, because some compilers
    # like to wrap large dependency lists on column 80 (with \), and
    # we should not choose a depcomp mode which is confused by this.
    #
    # We need to recreate these files for each test, as the compiler may
    # overwrite some of them when testing with obscure command lines.
    # This happens at least with the AIX C compiler.
    : > sub/conftest.c
    for i in 1 2 3 4 5 6; do
      echo '#include "conftst'$i'.h"' >> sub/conftest.c
      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
      # Solaris 8's {/usr,}/bin/sh.
      touch sub/conftst$i.h
    done
    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf

    # We check with `-c' and `-o' for the sake of the "dashmstdout"
    # mode.  It turns out that the SunPro C++ compiler does not properly
    # handle `-M -o', and we need to detect this.  Also, some Intel
    # versions had trouble with output in subdirs
    am__obj=sub/conftest.${OBJEXT-o}
    am__minus_obj="-o $am__obj"
    case $depmode in
    gcc)
      # This depmode causes a compiler race in universal mode.
      test "$am__universal" = false || continue
      ;;
    nosideeffect)
      # after this tag, mechanisms are not by side-effect, so they'll
      # only be used when explicitly requested
      if test "x$enable_dependency_tracking" = xyes; then
	continue
      else
	break
      fi
      ;;
    msvisualcpp | msvcmsys)
      # This compiler won't grok `-c -o', but also, the minuso test has
      # not run yet.  These depmodes are late enough in the game, and
      # so weak that their functioning should not be impacted.
      am__obj=conftest.${OBJEXT-o}
      am__minus_obj=
      ;;
    none) break ;;
    esac
    if depmode=$depmode \
       source=sub/conftest.c object=$am__obj \
       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
         >/dev/null 2>conftest.err &&
       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
      # icc doesn't choke on unknown options, it will just issue warnings
      # or remarks (even with -Werror).  So we grep stderr for any message
      # that says an option was ignored or not supported.
      # When given -MP, icc 7.0 and 7.1 complain thusly:
      #   icc: Command line warning: ignoring option '-M'; no argument required
      # The diagnosis changed in icc 8.0:
      #   icc: Command line remark: option '-MP' not supported
      if (grep 'ignoring option' conftest.err ||
          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
        am_cv_CC_dependencies_compiler_type=$depmode
        break
      fi
    fi
  done

  cd ..
  rm -rf conftest.dir
else
  am_cv_CC_dependencies_compiler_type=none
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type

 if
  test "x$enable_dependency_tracking" != xno \
  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
  am__fastdepCC_TRUE=
  am__fastdepCC_FALSE='#'
else
  am__fastdepCC_TRUE='#'
  am__fastdepCC_FALSE=
fi


# Ralf Wildenhues: With per-target flags we need CC_C_O
# AM_PROG_CC_C_O supersets AC_PROG_CC_C_O
if test "x$CC" != xcc; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
fi
set dummy $CC; ac_cc=`$as_echo "$2" |
		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
# Make sure it works both with $CC and with simple cc.
# We do the test twice because some compilers refuse to overwrite an
# existing .o file with -o, though they will create one.
ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
rm -f conftest2.*
if { { case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_try") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } &&
   test -f conftest2.$ac_objext && { { case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_try") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; };
then
  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
  if test "x$CC" != xcc; then
    # Test first that cc exists at all.
    if { ac_try='cc -c conftest.$ac_ext >&5'
  { { case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_try") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; }; then
      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
      rm -f conftest2.*
      if { { case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_try") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } &&
	 test -f conftest2.$ac_objext && { { case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_try") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; };
      then
	# cc works too.
	:
      else
	# cc exists but doesn't like -o.
	eval ac_cv_prog_cc_${ac_cc}_c_o=no
      fi
    fi
  fi
else
  eval ac_cv_prog_cc_${ac_cc}_c_o=no
fi
rm -f core conftest*

fi
if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; 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 NO_MINUS_C_MINUS_O 1" >>confdefs.h

fi

# FIXME: we rely on the cache variable name because
# there is no other way.
set dummy $CC
am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
if test "$am_t" != yes; then
   # Losing compiler, so override with the script.
   # FIXME: It is wrong to rewrite CC.
   # But if we don't then we get into trouble of one sort or another.
   # A longer-term fix would be to have automake use am__CC in this case,
   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
   CC="$am_aux_dir/compile $CC"
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
  if ${ac_cv_prog_CPP+:} false; then :
  $as_echo_n "(cached) " >&6
else
      # Double quotes because CPP needs to be expanded
    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
    do
      ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # Prefer  to  if __STDC__ is defined, since
  #  exists even on freestanding compilers.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#ifdef __STDC__
# include 
#else
# include 
#endif
		     Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :

else
  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext

  # OK, works on sane cases.  Now check whether nonexistent headers
  # can be detected and how.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
  # Broken: success on invalid input.
continue
else
  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
  break
fi

    done
    ac_cv_prog_CPP=$CPP

fi
  CPP=$ac_cv_prog_CPP
else
  ac_cv_prog_CPP=$CPP
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
$as_echo "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # Prefer  to  if __STDC__ is defined, since
  #  exists even on freestanding compilers.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#ifdef __STDC__
# include 
#else
# include 
#endif
		     Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :

else
  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext

  # OK, works on sane cases.  Now check whether nonexistent headers
  # can be detected and how.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
  # Broken: success on invalid input.
continue
else
  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :

else
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
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

for ac_prog in 'bison -y' byacc
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_YACC+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$YACC"; then
  ac_cv_prog_YACC="$YACC" # 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_YACC="$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
YACC=$ac_cv_prog_YACC
if test -n "$YACC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5
$as_echo "$YACC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"


# AC_PROG_CC_STDC has two functions.  It attempts to find a compiler
# capable of C99, or failing that, for C89.  CC is set afterward with
# the selected invocation, such as "gcc --std=gnu99".  Also, the
# ac_cv_prog_cc_stdc variable is no if the compiler selected for CC
# does not accept C89.

   case $ac_cv_prog_cc_stdc in #(
  no) :
    ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #(
  *) :
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
if ${ac_cv_prog_cc_c99+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_cv_prog_cc_c99=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
#include 
#include 
#include 
#include 

// Check varargs macros.  These examples are taken from C99 6.10.3.5.
#define debug(...) fprintf (stderr, __VA_ARGS__)
#define showlist(...) puts (#__VA_ARGS__)
#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
static void
test_varargs_macros (void)
{
  int x = 1234;
  int y = 5678;
  debug ("Flag");
  debug ("X = %d\n", x);
  showlist (The first, second, and third items.);
  report (x>y, "x is %d but y is %d", x, y);
}

// Check long long types.
#define BIG64 18446744073709551615ull
#define BIG32 4294967295ul
#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
#if !BIG_OK
  your preprocessor is broken;
#endif
#if BIG_OK
#else
  your preprocessor is broken;
#endif
static long long int bignum = -9223372036854775807LL;
static unsigned long long int ubignum = BIG64;

struct incomplete_array
{
  int datasize;
  double data[];
};

struct named_init {
  int number;
  const wchar_t *name;
  double average;
};

typedef const char *ccp;

static inline int
test_restrict (ccp restrict text)
{
  // See if C++-style comments work.
  // Iterate through items via the restricted pointer.
  // Also check for declarations in for loops.
  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
    continue;
  return 0;
}

// Check varargs and va_copy.
static void
test_varargs (const char *format, ...)
{
  va_list args;
  va_start (args, format);
  va_list args_copy;
  va_copy (args_copy, args);

  const char *str;
  int number;
  float fnumber;

  while (*format)
    {
      switch (*format++)
	{
	case 's': // string
	  str = va_arg (args_copy, const char *);
	  break;
	case 'd': // int
	  number = va_arg (args_copy, int);
	  break;
	case 'f': // float
	  fnumber = va_arg (args_copy, double);
	  break;
	default:
	  break;
	}
    }
  va_end (args_copy);
  va_end (args);
}

int
main ()
{

  // Check bool.
  _Bool success = false;

  // Check restrict.
  if (test_restrict ("String literal") == 0)
    success = true;
  char *restrict newvar = "Another string";

  // Check varargs.
  test_varargs ("s, d' f .", "string", 65, 34.234);
  test_varargs_macros ();

  // Check flexible array members.
  struct incomplete_array *ia =
    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
  ia->datasize = 10;
  for (int i = 0; i < ia->datasize; ++i)
    ia->data[i] = i * 1.234;

  // Check named initializers.
  struct named_init ni = {
    .number = 34,
    .name = L"Test wide string",
    .average = 543.34343,
  };

  ni.number = 58;

  int dynamic_array[ni.number];
  dynamic_array[ni.number - 1] = 543;

  // work around unused variable warnings
  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
	  || dynamic_array[ni.number - 1] != 543);

  ;
  return 0;
}
_ACEOF
for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
do
  CC="$ac_save_CC $ac_arg"
  if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_prog_cc_c99=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext
  test "x$ac_cv_prog_cc_c99" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC

fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c99" in
  x)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
  xno)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
  *)
    CC="$CC $ac_cv_prog_cc_c99"
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c99" != xno; then :
  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
#include 
#include 
#include 
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
     char **p;
     int i;
{
  return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
  char *s;
  va_list v;
  va_start (v,p);
  s = g (p, va_arg (v,int));
  va_end (v);
  return s;
}

/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
   function prototypes and stuff, but not '\xHH' hex character constants.
   These don't provoke an error unfortunately, instead are silently treated
   as 'x'.  The following induces an error, until -std is added to get
   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
   array size at least.  It's necessary to write '\x00'==0 to get something
   that's true only with -std.  */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];

/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
   inside strings and character constants.  */
#define FOO(x) 'x'
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];

int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
  ;
  return 0;
}
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
  CC="$ac_save_CC $ac_arg"
  if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_prog_cc_c89=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext
  test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC

fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
  x)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
  xno)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
  *)
    CC="$CC $ac_cv_prog_cc_c89"
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :
  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
else
  ac_cv_prog_cc_stdc=no
fi

fi
 ;;
esac
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5
$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; }
  if ${ac_cv_prog_cc_stdc+:} false; then :
  $as_echo_n "(cached) " >&6
fi

  case $ac_cv_prog_cc_stdc in #(
  no) :
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;; #(
  '') :
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;; #(
  *) :
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5
$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;;
esac


case "$ac_cv_prog_cc_stdc" in
 no)
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP
		version 4.2.5 and higher." >&5
$as_echo "$as_me: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP
		version 4.2.5 and higher." >&2;}
esac

# HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS
case "$host" in
 *-pc-cygwin*)
    CFLAGS="$CFLAGS -DSYS_CYGWIN32"
    ;;
 i386-sequent-sysv4)
    case "$CC" in
     cc)
	CFLAGS="$CFLAGS -Wc,+abi-socket"
	;;
    esac
    ;;
 *-*-mpeix*)
    CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB"
    LDFLAGS="$LDFLAGS -L/SYSLOG/PUB"
    LIBS="$LIBS -lcurses"
    ;;
 *-*-solaris*)
    # see "man standards".
    # -D_XOPEN_SOURCE=500 is probably OK for c89 and before
    # -D_XOPEN_SOURCE=600 seems OK for c99
    #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
    CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
    libxnet=-lxnet
    ;;
esac


    { $as_echo "$as_me:${as_lineno-$LINENO}: checking additional compiler flags" >&5
$as_echo_n "checking additional compiler flags... " >&6; }
    # allow ntp_os_flags to be preset to skip this stuff
    case "${ntp_os_cflags+set}" in
     set)
	;;
     *)
	ntp_os_cflags=""
	case "$host_os" in
	 aix[1-3]*)
	    ;;
	 aix4.[0-2]*)
	    # turn on additional headers
	    ntp_os_cflags="-D_XOPEN_EXTENDED_SOURCE"
	    ;;
	 aix5.3*)
	    # avoid circular dependencies in yp headers, and more
	    ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE"
	    ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS -D_MSGQSUPPORT"
	    ;;
	 aix*)
	    # avoid circular dependencies in yp headers
	    ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE"
	    ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS"
	    ;;
	 amigaos)
	    ntp_os_cflags="-DSYS_AMIGA"
	    ;;
	 darwin*|macosx*|rhapsody*)
	    ntp_os_cflags="-D_P1003_1B_VISIBLE"
	    ;;
	 hpux10.*)		# at least for hppa2.0-hp-hpux10.20
	    case "$GCC" in
	     yes)
		;;
	     *)
		# use Ansi compiler on HPUX, and some -Wp magic
		ntp_os_cflags="-Ae -Wp,-H18816"
		;;
	    esac
	    ntp_os_cflags="${ntp_os_cflags} -D_HPUX_SOURCE"
	    ;;
	 hpux*)
	    case "$GCC" in
	     yes)
		;;
	     *)
		# use Ansi compiler on HPUX
		ntp_os_cflags="-Ae"
	    esac
	    ntp_os_cflags="${ntp_os_cflags} -D_HPUX_SOURCE"
	    ;;
	 irix6*)
	    case "$CC" in
	     cc)
		# do not use 64-bit compiler
		ntp_os_cflags="-n32 -mips3 -Wl,-woff,84"
	    esac
	    ;;
	 nextstep3)
	    ntp_os_cflags="-posix"
	    ;;
	 solaris1*|solaris2.[0-5]|solaris2.5.*)
	    ;;
	 sunos[34]*|sunos5.[0-5]|sunos5.5.*)
	    ;;
	 solaris2*|sunos5*)
	    # turn on 64-bit file offset interface
	    ntp_os_cflags="-D_LARGEFILE64_SOURCE"
	    ;;
	 vxworks*)
	    case "$build" in
	     $host)
		;;
	     *)
		# Quick and dirty sanity check
		case "$VX_KERNEL" in
		 '')
		    as_fn_error $? "See html/build/hints/vxworks.html" "$LINENO" 5
		esac
		ntp_os_cflags="-DSYS_VXWORKS"
	    esac
	    ;;
	esac
    esac
    case "$ntp_os_flags" in
     '')
	ntp_os_cflags_msg="none needed"
	;;
     *)
	ntp_os_cflags_msg="$ntp_os_cflags"
	CFLAGS="$CFLAGS $ntp_os_cflags"
    esac
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_os_cflags_msg" >&5
$as_echo "$ntp_os_cflags_msg" >&6; }
    { ntp_os_cflags_msg=; unset ntp_os_cflags_msg;}


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory path separator" >&5
$as_echo_n "checking for directory path separator... " >&6; }
if ${ntp_cv_dir_sep+:} false; then :
  $as_echo_n "(cached) " >&6
else

	case "$ntp_cv_dir_sep" in
	 '')
	    case "$target_os" in
	     *djgpp | *mingw32* | *emx*)
		ntp_cv_dir_sep="'\\'"
		;;
	     *)
		ntp_cv_dir_sep="'/'"
		;;
	    esac
	esac


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_dir_sep" >&5
$as_echo "$ntp_cv_dir_sep" >&6; }

cat >>confdefs.h <<_ACEOF
#define DIR_SEP $ntp_cv_dir_sep
_ACEOF



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if we need a VPATH hack" >&5
$as_echo_n "checking to see if we need a VPATH hack... " >&6; }
ntp_vpath_hack="no"
case "$srcdir::$build_os::${force_ntp_vpath_hack+set}" in
 .::*::*)
    ;;
 *::*::set)
    ntp_vpath_hack="yes"
    ;;
 *::freebsd*::)
    case "`${MAKE-make} -v -f /dev/null 2>/dev/null | grep 'GNU Make'`" in
     '')
	ntp_vpath_hack="yes"
    esac
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_vpath_hack" >&5
$as_echo "$ntp_vpath_hack" >&6; }
 if test x$ntp_vpath_hack = xyes; then
  VPATH_HACK_TRUE=
  VPATH_HACK_FALSE='#'
else
  VPATH_HACK_TRUE='#'
  VPATH_HACK_FALSE=
fi



# NTP has (so far) been relying on leading-edge autogen.
# Therefore, by default:
# - use the version we ship with
# - do not install it
# - build a static copy (AC_DISABLE_SHARED - done earlier)
case "${enable_local_libopts+set}" in
 set) ;;
 *) enable_local_libopts=yes ;;
esac
case "${enable_libopts_install+set}" in
 set) ;;
 *) enable_libopts_install=no ;;
esac
ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
if test "x$ac_cv_type_pid_t" = xyes; then :

else

cat >>confdefs.h <<_ACEOF
#define pid_t int
_ACEOF

fi



  ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
  as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
if eval \${$as_ac_Header+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
#include <$ac_hdr>

int
main ()
{
if ((DIR *) 0)
return 0;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  eval "$as_ac_Header=yes"
else
  eval "$as_ac_Header=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$as_ac_Header
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
_ACEOF

ac_header_dirent=$ac_hdr; break
fi

done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
$as_echo_n "checking for library containing opendir... " >&6; }
if ${ac_cv_search_opendir+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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 opendir ();
int
main ()
{
return opendir ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' dir; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_opendir=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_opendir+:} false; then :
  break
fi
done
if ${ac_cv_search_opendir+:} false; then :

else
  ac_cv_search_opendir=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
$as_echo "$ac_cv_search_opendir" >&6; }
ac_res=$ac_cv_search_opendir
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi

else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
$as_echo_n "checking for library containing opendir... " >&6; }
if ${ac_cv_search_opendir+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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 opendir ();
int
main ()
{
return opendir ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' x; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_opendir=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_opendir+:} false; then :
  break
fi
done
if ${ac_cv_search_opendir+:} false; then :

else
  ac_cv_search_opendir=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
$as_echo "$ac_cv_search_opendir" >&6; }
ac_res=$ac_cv_search_opendir
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi

fi


  # =================
  # AC_CHECK_HEADERS
  # =================
  for ac_header in  \
      dlfcn.h      errno.h       fcntl.h       libgen.h     \
      memory.h     netinet/in.h  setjmp.h      sys/mman.h   \
      sys/param.h  sys/poll.h    sys/procset.h sys/select.h \
      sys/socket.h sys/stropts.h sys/time.h    sys/un.h     \
      sys/wait.h   unistd.h      utime.h       sysexits.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


  for ac_header in stdarg.h     varargs.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
 lo_have_arg_hdr=true;break
else
  lo_have_arg_hdr=false
fi

done


  for ac_header in string.h     strings.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
 lo_have_str_hdr=true;break
else
  lo_have_str_hdr=false
fi

done


  for ac_header in limits.h     sys/limits.h  values.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
 lo_have_lim_hdr=true;break
else
  lo_have_lim_hdr=false
fi

done


  for ac_header in inttypes.h   stdint.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
 lo_have_typ_hdr=true;break
else
  lo_have_typ_hdr=false
fi

done


  # ----------------------------------------------------------------------
  # check for various programs used during the build.
  # On OS/X, "wchar.h" needs "runetype.h" to work properly.
  # ----------------------------------------------------------------------
  for ac_header in runetype.h wchar.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
  $ac_includes_default
  #if HAVE_RUNETYPE_H
  # include 
  #endif

"
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


  # --------------------------------------------
  # Verify certain entries from AC_CHECK_HEADERS
  # --------------------------------------------
  for f in sys_types sys_mman sys_param sys_stat sys_wait \
           string errno stdlib memory setjmp
  do eval as_ac_var=\${ac_cv_header_${f}_h+set}
     test "${as_ac_var}" = set || {
       as_fn_error $? "You must have ${f}.h on your system" "$LINENO" 5
     }
  done

  ${lo_have_arg_hdr} || \
    as_fn_error $? "You must have stdarg.h or varargs.h on your system" "$LINENO" 5

  ${lo_have_str_hdr} || \
    as_fn_error $? "You must have string.h or strings.h on your system" "$LINENO" 5

  ${lo_have_lim_hdr} || \
    as_fn_error $? "You must have one of limits.h, sys/limits.h or values.h" "$LINENO" 5

  ${lo_have_typ_hdr} || \
    as_fn_error $? "You must have inttypes.h or stdint.h on your system" "$LINENO" 5

  # ----------------------------------------------------------------------
  # Checks for typedefs
  # ----------------------------------------------------------------------
  ac_fn_c_check_type "$LINENO" "wchar_t" "ac_cv_type_wchar_t" "$ac_includes_default"
if test "x$ac_cv_type_wchar_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_WCHAR_T 1
_ACEOF


fi

  ac_fn_c_check_type "$LINENO" "wint_t" "ac_cv_type_wint_t" "
  $ac_includes_default
  #if HAVE_RUNETYPE_H
  # include 
  #endif
  #if HAVE_WCHAR_H
  # include 
  #endif

"
if test "x$ac_cv_type_wint_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_WINT_T 1
_ACEOF


fi

  ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default"
if test "x$ac_cv_type_int8_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_INT8_T 1
_ACEOF


fi
ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default"
if test "x$ac_cv_type_uint8_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_UINT8_T 1
_ACEOF


fi
ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default"
if test "x$ac_cv_type_int16_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_INT16_T 1
_ACEOF


fi
ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default"
if test "x$ac_cv_type_uint16_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_UINT16_T 1
_ACEOF


fi
ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default"
if test "x$ac_cv_type_int32_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_INT32_T 1
_ACEOF


fi
ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default"
if test "x$ac_cv_type_uint32_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_UINT32_T 1
_ACEOF


fi
ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
if test "x$ac_cv_type_intptr_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_INTPTR_T 1
_ACEOF


fi
ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
if test "x$ac_cv_type_uintptr_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_UINTPTR_T 1
_ACEOF


fi
ac_fn_c_check_type "$LINENO" "uint_t" "ac_cv_type_uint_t" "$ac_includes_default"
if test "x$ac_cv_type_uint_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_UINT_T 1
_ACEOF


fi
ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
if test "x$ac_cv_type_pid_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_PID_T 1
_ACEOF


fi
ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
if test "x$ac_cv_type_size_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_SIZE_T 1
_ACEOF


fi


  # =====
  # sizes
  # =====
  # 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.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char*" >&5
$as_echo_n "checking size of char*... " >&6; }
if ${ac_cv_sizeof_charp+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char*))" "ac_cv_sizeof_charp"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_charp" = yes; then
     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (char*)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_charp=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_charp" >&5
$as_echo "$ac_cv_sizeof_charp" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_CHARP $ac_cv_sizeof_charp
_ACEOF


  # 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.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
$as_echo_n "checking size of int... " >&6; }
if ${ac_cv_sizeof_int+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_int" = yes; then
     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (int)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_int=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
$as_echo "$ac_cv_sizeof_int" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_INT $ac_cv_sizeof_int
_ACEOF


  # 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.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
$as_echo_n "checking size of long... " >&6; }
if ${ac_cv_sizeof_long+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_long" = yes; then
     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (long)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_long=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
$as_echo "$ac_cv_sizeof_long" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG $ac_cv_sizeof_long
_ACEOF


  # 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.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
$as_echo_n "checking size of short... " >&6; }
if ${ac_cv_sizeof_short+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_short" = yes; then
     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (short)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_short=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
$as_echo "$ac_cv_sizeof_short" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_SHORT $ac_cv_sizeof_short
_ACEOF



  # ----------------------------------------------------------------------
  # AC_CHECK_LIB for SVR4 libgen, and use it if it defines pathfind.
  # ----------------------------------------------------------------------
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pathfind in -lgen" >&5
$as_echo_n "checking for pathfind in -lgen... " >&6; }
if ${ac_cv_lib_gen_pathfind+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgen  $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 pathfind ();
int
main ()
{
return pathfind ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_gen_pathfind=yes
else
  ac_cv_lib_gen_pathfind=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_gen_pathfind" >&5
$as_echo "$ac_cv_lib_gen_pathfind" >&6; }
if test "x$ac_cv_lib_gen_pathfind" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGEN 1
_ACEOF

  LIBS="-lgen $LIBS"

fi

  for ac_func in vprintf
do :
  ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
if test "x$ac_cv_func_vprintf" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_VPRINTF 1
_ACEOF

ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
if test "x$ac_cv_func__doprnt" = xyes; then :

$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h

fi

fi
done


  for ac_header in vfork.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
if test "x$ac_cv_header_vfork_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_VFORK_H 1
_ACEOF

fi

done

for ac_func in fork vfork
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 "x$ac_cv_func_fork" = xyes; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
$as_echo_n "checking for working fork... " >&6; }
if ${ac_cv_func_fork_works+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test "$cross_compiling" = yes; then :
  ac_cv_func_fork_works=cross
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{

	  /* By Ruediger Kuhlmann. */
	  return fork () < 0;

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  ac_cv_func_fork_works=yes
else
  ac_cv_func_fork_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

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
$as_echo "$ac_cv_func_fork_works" >&6; }

else
  ac_cv_func_fork_works=$ac_cv_func_fork
fi
if test "x$ac_cv_func_fork_works" = xcross; then
  case $host in
    *-*-amigaos* | *-*-msdosdjgpp*)
      # Override, as these systems have only a dummy fork() stub
      ac_cv_func_fork_works=no
      ;;
    *)
      ac_cv_func_fork_works=yes
      ;;
  esac
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
if test "x$ac_cv_func_vfork" = xyes; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
$as_echo_n "checking for working vfork... " >&6; }
if ${ac_cv_func_vfork_works+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test "$cross_compiling" = yes; then :
  ac_cv_func_vfork_works=cross
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
/* Thanks to Paul Eggert for this test.  */
$ac_includes_default
#include 
#ifdef HAVE_VFORK_H
# include 
#endif
/* On some sparc systems, changes by the child to local and incoming
   argument registers are propagated back to the parent.  The compiler
   is told about this with #include , but some compilers
   (e.g. gcc -O) don't grok .  Test for this by using a
   static variable whose address is put into a register that is
   clobbered by the vfork.  */
static void
#ifdef __cplusplus
sparc_address_test (int arg)
# else
sparc_address_test (arg) int arg;
#endif
{
  static pid_t child;
  if (!child) {
    child = vfork ();
    if (child < 0) {
      perror ("vfork");
      _exit(2);
    }
    if (!child) {
      arg = getpid();
      write(-1, "", 0);
      _exit (arg);
    }
  }
}

int
main ()
{
  pid_t parent = getpid ();
  pid_t child;

  sparc_address_test (0);

  child = vfork ();

  if (child == 0) {
    /* Here is another test for sparc vfork register problems.  This
       test uses lots of local variables, at least as many local
       variables as main has allocated so far including compiler
       temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
       4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
       reuse the register of parent for one of the local variables,
       since it will think that parent can't possibly be used any more
       in this routine.  Assigning to the local variable will thus
       munge parent in the parent process.  */
    pid_t
      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
    /* Convince the compiler that p..p7 are live; otherwise, it might
       use the same hardware register for all 8 local variables.  */
    if (p != p1 || p != p2 || p != p3 || p != p4
	|| p != p5 || p != p6 || p != p7)
      _exit(1);

    /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
       from child file descriptors.  If the child closes a descriptor
       before it execs or exits, this munges the parent's descriptor
       as well.  Test for this by closing stdout in the child.  */
    _exit(close(fileno(stdout)) != 0);
  } else {
    int status;
    struct stat st;

    while (wait(&status) != child)
      ;
    return (
	 /* Was there some problem with vforking?  */
	 child < 0

	 /* Did the child fail?  (This shouldn't happen.)  */
	 || status

	 /* Did the vfork/compiler bug occur?  */
	 || parent != getpid()

	 /* Did the file descriptor bug occur?  */
	 || fstat(fileno(stdout), &st) != 0
	 );
  }
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  ac_cv_func_vfork_works=yes
else
  ac_cv_func_vfork_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

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
$as_echo "$ac_cv_func_vfork_works" >&6; }

fi;
if test "x$ac_cv_func_fork_works" = xcross; then
  ac_cv_func_vfork_works=$ac_cv_func_vfork
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
fi

if test "x$ac_cv_func_vfork_works" = xyes; then

$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h

else

$as_echo "#define vfork fork" >>confdefs.h

fi
if test "x$ac_cv_func_fork_works" = xyes; then

$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h

fi

  for ac_func in mmap canonicalize_file_name snprintf strdup strchr \
                 strrchr strsignal
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
$as_echo_n "checking for a sed that does not truncate output... " >&6; }
if ${ac_cv_path_SED+:} false; then :
  $as_echo_n "(cached) " >&6
else
            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
     for ac_i in 1 2 3 4 5 6 7; do
       ac_script="$ac_script$as_nl$ac_script"
     done
     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
     { ac_script=; unset ac_script;}
     if test -z "$SED"; then
  ac_path_SED_found=false
  # Loop through the user's path and test for each of PROGNAME-LIST
  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_prog in sed gsed; do
    for ac_exec_ext in '' $ac_executable_extensions; do
      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
# Check for GNU ac_path_SED and select it if it is found.
  # Check for GNU $ac_path_SED
case `"$ac_path_SED" --version 2>&1` in
*GNU*)
  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
*)
  ac_count=0
  $as_echo_n 0123456789 >"conftest.in"
  while :
  do
    cat "conftest.in" "conftest.in" >"conftest.tmp"
    mv "conftest.tmp" "conftest.in"
    cp "conftest.in" "conftest.nl"
    $as_echo '' >> "conftest.nl"
    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    as_fn_arith $ac_count + 1 && ac_count=$as_val
    if test $ac_count -gt ${ac_path_SED_max-0}; then
      # Best one so far, save it but keep looking for a better one
      ac_cv_path_SED="$ac_path_SED"
      ac_path_SED_max=$ac_count
    fi
    # 10*(2^10) chars as input seems more than enough
    test $ac_count -gt 10 && break
  done
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac

      $ac_path_SED_found && break 3
    done
  done
  done
IFS=$as_save_IFS
  if test -z "$ac_cv_path_SED"; then
    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
  fi
else
  ac_cv_path_SED=$SED
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
$as_echo "$ac_cv_path_SED" >&6; }
 SED="$ac_cv_path_SED"
  rm -f conftest.sed

  while :
  do
      POSIX_SHELL=`which bash`
      test -x "$POSIX_SHELL" && break
      POSIX_SHELL=`which dash`
      test -x "$POSIX_SHELL" && break
      POSIX_SHELL=/usr/xpg4/bin/sh
      test -x "$POSIX_SHELL" && break
      POSIX_SHELL=`/bin/sh -c '
          exec 2>/dev/null
          if ! true ; then exit 1 ; fi
          echo /bin/sh'`
      test -x "$POSIX_SHELL" && break
      as_fn_error $? "Cannot locate a working POSIX shell" "$LINENO" 5
  done

cat >>confdefs.h <<_ACEOF
#define POSIX_SHELL "${POSIX_SHELL}"
_ACEOF





  LIBOPTS_BUILD_BLOCKED=true


  NEED_LIBOPTS_DIR=''

  # Check whether --enable-local-libopts was given.
if test "${enable_local_libopts+set}" = set; then :
  enableval=$enable_local_libopts;
    if test x$enableval = xyes ; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: Using supplied libopts tearoff" >&5
$as_echo "$as_me: Using supplied libopts tearoff" >&6;}
       LIBOPTS_LDADD='$(top_builddir)/sntp/libopts/libopts.la'
       LIBOPTS_CFLAGS='-I$(top_srcdir)/sntp/libopts'
       NEED_LIBOPTS_DIR=true
    fi
fi


  # Check whether --enable-libopts-install was given.
if test "${enable_libopts_install+set}" = set; then :
  enableval=$enable_libopts_install;
fi

   if test "X${enable_libopts_install}" != Xno; then
  INSTALL_LIBOPTS_TRUE=
  INSTALL_LIBOPTS_FALSE='#'
else
  INSTALL_LIBOPTS_TRUE='#'
  INSTALL_LIBOPTS_FALSE=
fi


  if test -z "${NEED_LIBOPTS_DIR}" ; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config can be found" >&5
$as_echo_n "checking whether autoopts-config can be found... " >&6; }

# Check whether --with-autoopts-config was given.
if test "${with_autoopts_config+set}" = set; then :
  withval=$with_autoopts_config; lo_cv_with_autoopts_config=${with_autoopts_config}
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config is specified" >&5
$as_echo_n "checking whether autoopts-config is specified... " >&6; }
if ${lo_cv_with_autoopts_config+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if autoopts-config --help 2>/dev/null 1>&2
        then lo_cv_with_autoopts_config=autoopts-config
        elif libopts-config --help 2>/dev/null 1>&2
        then lo_cv_with_autoopts_config=libopts-config
        else lo_cv_with_autoopts_config=no ; fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lo_cv_with_autoopts_config" >&5
$as_echo "$lo_cv_with_autoopts_config" >&6; }

fi
 # end of AC_ARG_WITH

     if ${lo_cv_test_autoopts+:} false; then :
  $as_echo_n "(cached) " >&6
else

        if test -z "${lo_cv_with_autoopts_config}" \
                -o X"${lo_cv_with_autoopts_config}" = Xno
        then
           if autoopts-config --help 2>/dev/null 1>&2
           then lo_cv_with_autoopts_config=autoopts-config
           elif libopts-config --help 2>/dev/null 1>&2
           then lo_cv_with_autoopts_config=libopts-config
           else lo_cv_with_autoopts_config=false ; fi
        fi
        lo_cv_test_autoopts=`
            ${lo_cv_with_autoopts_config} --libs` 2> /dev/null
        if test $? -ne 0 -o -z "${lo_cv_test_autoopts}"
        then lo_cv_test_autoopts=no ; fi

fi
 # end of CACHE_VAL
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lo_cv_test_autoopts}" >&5
$as_echo "${lo_cv_test_autoopts}" >&6; }

     if test "X${lo_cv_test_autoopts}" != Xno
     then
        LIBOPTS_LDADD="${lo_cv_test_autoopts}"
        LIBOPTS_CFLAGS="`${lo_cv_with_autoopts_config} --cflags`"
     else
        LIBOPTS_LDADD='$(top_builddir)/sntp/libopts/libopts.la'
        LIBOPTS_CFLAGS='-I$(top_srcdir)/sntp/libopts'
        NEED_LIBOPTS_DIR=true
     fi
  fi # end of if test -z "${NEED_LIBOPTS_DIR}"
  if test -n "${LIBOPTS_BUILD_BLOCKED}" ; then
    NEED_LIBOPTS_DIR=''
  fi
   if test -n "${NEED_LIBOPTS_DIR}"; then
  NEED_LIBOPTS_TRUE=
  NEED_LIBOPTS_FALSE='#'
else
  NEED_LIBOPTS_TRUE='#'
  NEED_LIBOPTS_FALSE=
fi



  LIBOPTS_DIR=sntp/libopts


# end of AC_DEFUN of LIBOPTS_CHECK_COMMON

  # end of AC_DEFUN of LIBOPTS_CHECK_NOBUILD


for ac_header in vfork.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
if test "x$ac_cv_header_vfork_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_VFORK_H 1
_ACEOF

fi

done

for ac_func in fork vfork
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 "x$ac_cv_func_fork" = xyes; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
$as_echo_n "checking for working fork... " >&6; }
if ${ac_cv_func_fork_works+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test "$cross_compiling" = yes; then :
  ac_cv_func_fork_works=cross
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{

	  /* By Ruediger Kuhlmann. */
	  return fork () < 0;

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  ac_cv_func_fork_works=yes
else
  ac_cv_func_fork_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

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
$as_echo "$ac_cv_func_fork_works" >&6; }

else
  ac_cv_func_fork_works=$ac_cv_func_fork
fi
if test "x$ac_cv_func_fork_works" = xcross; then
  case $host in
    *-*-amigaos* | *-*-msdosdjgpp*)
      # Override, as these systems have only a dummy fork() stub
      ac_cv_func_fork_works=no
      ;;
    *)
      ac_cv_func_fork_works=yes
      ;;
  esac
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
if test "x$ac_cv_func_vfork" = xyes; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
$as_echo_n "checking for working vfork... " >&6; }
if ${ac_cv_func_vfork_works+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test "$cross_compiling" = yes; then :
  ac_cv_func_vfork_works=cross
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
/* Thanks to Paul Eggert for this test.  */
$ac_includes_default
#include 
#ifdef HAVE_VFORK_H
# include 
#endif
/* On some sparc systems, changes by the child to local and incoming
   argument registers are propagated back to the parent.  The compiler
   is told about this with #include , but some compilers
   (e.g. gcc -O) don't grok .  Test for this by using a
   static variable whose address is put into a register that is
   clobbered by the vfork.  */
static void
#ifdef __cplusplus
sparc_address_test (int arg)
# else
sparc_address_test (arg) int arg;
#endif
{
  static pid_t child;
  if (!child) {
    child = vfork ();
    if (child < 0) {
      perror ("vfork");
      _exit(2);
    }
    if (!child) {
      arg = getpid();
      write(-1, "", 0);
      _exit (arg);
    }
  }
}

int
main ()
{
  pid_t parent = getpid ();
  pid_t child;

  sparc_address_test (0);

  child = vfork ();

  if (child == 0) {
    /* Here is another test for sparc vfork register problems.  This
       test uses lots of local variables, at least as many local
       variables as main has allocated so far including compiler
       temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
       4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
       reuse the register of parent for one of the local variables,
       since it will think that parent can't possibly be used any more
       in this routine.  Assigning to the local variable will thus
       munge parent in the parent process.  */
    pid_t
      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
    /* Convince the compiler that p..p7 are live; otherwise, it might
       use the same hardware register for all 8 local variables.  */
    if (p != p1 || p != p2 || p != p3 || p != p4
	|| p != p5 || p != p6 || p != p7)
      _exit(1);

    /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
       from child file descriptors.  If the child closes a descriptor
       before it execs or exits, this munges the parent's descriptor
       as well.  Test for this by closing stdout in the child.  */
    _exit(close(fileno(stdout)) != 0);
  } else {
    int status;
    struct stat st;

    while (wait(&status) != child)
      ;
    return (
	 /* Was there some problem with vforking?  */
	 child < 0

	 /* Did the child fail?  (This shouldn't happen.)  */
	 || status

	 /* Did the vfork/compiler bug occur?  */
	 || parent != getpid()

	 /* Did the file descriptor bug occur?  */
	 || fstat(fileno(stdout), &st) != 0
	 );
  }
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  ac_cv_func_vfork_works=yes
else
  ac_cv_func_vfork_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

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
$as_echo "$ac_cv_func_vfork_works" >&6; }

fi;
if test "x$ac_cv_func_fork_works" = xcross; then
  ac_cv_func_vfork_works=$ac_cv_func_vfork
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
fi

if test "x$ac_cv_func_vfork_works" = xyes; then

$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h

else

$as_echo "#define vfork fork" >>confdefs.h

fi
if test "x$ac_cv_func_fork_works" = xyes; then

$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle #warning" >&5
$as_echo_n "checking if $CC can handle #warning... " >&6; }
if ${ntp_cv_cpp_warning+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{
#warning foo
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_cpp_warning=yes
else
  ntp_cv_cpp_warning=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cpp_warning" >&5
$as_echo "$ntp_cv_cpp_warning" >&6; }
case "$ntp_cv_cpp_warning" in
 no)

$as_echo "#define NO_OPTION_NAME_WARNINGS 1" >>confdefs.h

esac

case "$GCC" in
 yes)
    SAVED_CFLAGS_NTP="$CFLAGS"
    CFLAGS="$CFLAGS -Wstrict-overflow"
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Wstrict-overflow" >&5
$as_echo_n "checking if $CC can handle -Wstrict-overflow... " >&6; }
if ${ntp_cv_gcc_Wstrict_overflow+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_gcc_Wstrict_overflow=yes
else
  ntp_cv_gcc_Wstrict_overflow=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Wstrict_overflow" >&5
$as_echo "$ntp_cv_gcc_Wstrict_overflow" >&6; }
    #
    # $ntp_cv_gcc_Wstrict_overflow is tested later to add the
    # flag to CFLAGS.
    #
    CFLAGS="$SAVED_CFLAGS_NTP -Winit-self"
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Winit-self" >&5
$as_echo_n "checking if $CC can handle -Winit-self... " >&6; }
if ${ntp_cv_gcc_Winit_self+:} false; then :
  $as_echo_n "(cached) " >&6
else

	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_gcc_Winit_self=yes
else
  ntp_cv_gcc_Winit_self=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Winit_self" >&5
$as_echo "$ntp_cv_gcc_Winit_self" >&6; }
    CFLAGS="$SAVED_CFLAGS_NTP"
    { SAVED_CFLAGS_NTP=; unset SAVED_CFLAGS_NTP;}
    #
    # $ntp_cv_gcc_Winit_self is tested later to add the
    # flag to CFLAGS.
    #
esac

# Expose a cross-compilation indicator to makefiles
 if test $build != $host; then
  NTP_CROSSCOMPILE_TRUE=
  NTP_CROSSCOMPILE_FALSE='#'
else
  NTP_CROSSCOMPILE_TRUE='#'
  NTP_CROSSCOMPILE_FALSE=
fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bin subdirectory" >&5
$as_echo_n "checking for bin subdirectory... " >&6; }

# Check whether --with-binsubdir was given.
if test "${with_binsubdir+set}" = set; then :
  withval=$with_binsubdir; use_binsubdir="$withval"
else
  use_binsubdir="bin"

fi

case "$use_binsubdir" in
 bin)
    ;;
 sbin)
    ;;
 *)
    as_fn_error $? "<$use_binsubdir> is illegal - must be \"bin\" or \"sbin\"" "$LINENO" 5
    ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_binsubdir" >&5
$as_echo "$use_binsubdir" >&6; }

BINSUBDIR=$use_binsubdir

 if test "bin" = "$BINSUBDIR"; then
  NTP_BINSUBDIR_IS_BIN_TRUE=
  NTP_BINSUBDIR_IS_BIN_FALSE='#'
else
  NTP_BINSUBDIR_IS_BIN_TRUE='#'
  NTP_BINSUBDIR_IS_BIN_FALSE=
fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for deprecated --with-arlib" >&5
$as_echo_n "checking for deprecated --with-arlib... " >&6; }

# Check whether --with-arlib was given.
if test "${with_arlib+set}" = set; then :
  withval=$with_arlib; ans=$withval
else
  ans=no
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ans" in
 yes)
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please do not use --with-arlib, arlib is no longer included.  In the future, --with-arlib will not be recognized." >&5
$as_echo "$as_me: WARNING: Please do not use --with-arlib, arlib is no longer included.  In the future, --with-arlib will not be recognized." >&2;}
esac


# Check whether --with-rpath was given.
if test "${with_rpath+set}" = set; then :
  withval=$with_rpath; ans=$withval
else
  ans=x
fi

case "$ans" in
 no)
    need_dash_r=
    ;;
 yes)
    need_dash_r=1
    ;;
esac
# HMS: Why isn't this $build?
# Well, that depends on if we need this for the build toolchain or
# for info in the host executable...
# I still have no idea which way this should go, but nobody has complained.
case "$host" in
 *-*-netbsd*)
    case "$need_dash_r" in
     no) ;;
     *)  need_dash_r=1
	 ;;
    esac
    ;;
 *-*-solaris*)
    case "$need_dash_r" in
     no) ;;
     *)  need_dash_r=1
	 ;;
    esac
    ;;
esac

for ac_prog in gawk mawk nawk awk
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_AWK+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$AWK"; then
  ac_cv_prog_AWK="$AWK" # 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_AWK="$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
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
$as_echo "$AWK" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$AWK" && break
done

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
	@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
  *@@@%%%=?*=@@@%%%*)
    eval ac_cv_prog_make_${ac_make}_set=yes;;
  *)
    eval ac_cv_prog_make_${ac_make}_set=no;;
esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
  SET_MAKE=
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
  SET_MAKE="MAKE=${MAKE-make}"
fi


rm -f conftest*

case "$GCC" in
 yes)
    CFLAGS="$CFLAGS -Wall"
    # CFLAGS="$CFLAGS -Wcast-align"
    CFLAGS="$CFLAGS -Wcast-qual"
    # CFLAGS="$CFLAGS -Wconversion"
    # CFLAGS="$CFLAGS -Werror"
    # CFLAGS="$CFLAGS -Wextra"
    # CFLAGS="$CFLAGS -Wfloat-equal"
    CFLAGS="$CFLAGS -Wmissing-prototypes"
    CFLAGS="$CFLAGS -Wpointer-arith"
    CFLAGS="$CFLAGS -Wshadow"
    # CFLAGS="$CFLAGS -Wtraditional"
    # CFLAGS="$CFLAGS -Wwrite-strings"
    case "$ntp_cv_gcc_Winit_self" in
     yes)
	CFLAGS="$CFLAGS -Winit-self"
    esac
    case "$ntp_cv_gcc_Wstrict_overflow" in
     yes)
	CFLAGS="$CFLAGS -Wstrict-overflow"
    esac
    # -W[no-]strict-prototypes is added later depending on OpenSSL
esac

ac_busted_vpath_in_make=no

case "$build" in
 *-*-irix6.1*)	# 64 bit only
    # busted vpath?
    ;;
 *-*-irix6*)	# 6.2 (and later?)
    ac_busted_vpath_in_make=yes
    ;;
 *-*-solaris2.5.1)
    ac_busted_vpath_in_make=yes
    ;;
 *-*-unicosmp*)
    ac_busted_vpath_in_make=yes
    ;;
esac

case "$ac_busted_vpath_in_make$srcdir" in
 no*) ;;
 yes.) ;;
 *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
     '')
	as_fn_error $? "building outside of the main directory requires GNU make" "$LINENO" 5
	;;
     *) ;;
    esac
    ;;
esac




case `pwd` in
  *\ * | *\	*)
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
esac



macro_version='2.4'
macro_revision='1.3293'













ltmain="$ac_aux_dir/ltmain.sh"

# Backslashify metacharacters that are still active within
# double-quoted strings.
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'

# Same as above, but do not quote variable references.
double_quote_subst='s/\(["`\\]\)/\\\1/g'

# Sed substitution to delay expansion of an escaped shell variable in a
# double_quote_subst'ed string.
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'

# Sed substitution to delay expansion of an escaped single quote.
delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'

# Sed substitution to avoid accidental globbing in evaled expressions
no_glob_subst='s/\*/\\\*/g'

ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
$as_echo_n "checking how to print strings... " >&6; }
# Test print first, because it will be a builtin if present.
if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
  ECHO='print -r --'
elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
  ECHO='printf %s\n'
else
  # Use this function as a fallback that always works.
  func_fallback_echo ()
  {
    eval 'cat <<_LTECHO_EOF
$1
_LTECHO_EOF'
  }
  ECHO='func_fallback_echo'
fi

# func_echo_all arg...
# Invoke $ECHO with all args, space-separated.
func_echo_all ()
{
    $ECHO ""
}

case "$ECHO" in
  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
$as_echo "printf" >&6; } ;;
  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
$as_echo "print -r" >&6; } ;;
  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
$as_echo "cat" >&6; } ;;
esac














{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
$as_echo_n "checking for a sed that does not truncate output... " >&6; }
if ${ac_cv_path_SED+:} false; then :
  $as_echo_n "(cached) " >&6
else
            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
     for ac_i in 1 2 3 4 5 6 7; do
       ac_script="$ac_script$as_nl$ac_script"
     done
     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
     { ac_script=; unset ac_script;}
     if test -z "$SED"; then
  ac_path_SED_found=false
  # Loop through the user's path and test for each of PROGNAME-LIST
  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_prog in sed gsed; do
    for ac_exec_ext in '' $ac_executable_extensions; do
      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
# Check for GNU ac_path_SED and select it if it is found.
  # Check for GNU $ac_path_SED
case `"$ac_path_SED" --version 2>&1` in
*GNU*)
  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
*)
  ac_count=0
  $as_echo_n 0123456789 >"conftest.in"
  while :
  do
    cat "conftest.in" "conftest.in" >"conftest.tmp"
    mv "conftest.tmp" "conftest.in"
    cp "conftest.in" "conftest.nl"
    $as_echo '' >> "conftest.nl"
    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    as_fn_arith $ac_count + 1 && ac_count=$as_val
    if test $ac_count -gt ${ac_path_SED_max-0}; then
      # Best one so far, save it but keep looking for a better one
      ac_cv_path_SED="$ac_path_SED"
      ac_path_SED_max=$ac_count
    fi
    # 10*(2^10) chars as input seems more than enough
    test $ac_count -gt 10 && break
  done
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac

      $ac_path_SED_found && break 3
    done
  done
  done
IFS=$as_save_IFS
  if test -z "$ac_cv_path_SED"; then
    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
  fi
else
  ac_cv_path_SED=$SED
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
$as_echo "$ac_cv_path_SED" >&6; }
 SED="$ac_cv_path_SED"
  rm -f conftest.sed

test -z "$SED" && SED=sed
Xsed="$SED -e 1s/^X//"











{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
$as_echo_n "checking for fgrep... " >&6; }
if ${ac_cv_path_FGREP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
   then ac_cv_path_FGREP="$GREP -F"
   else
     if test -z "$FGREP"; then
  ac_path_FGREP_found=false
  # Loop through the user's path and test for each of PROGNAME-LIST
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_prog in fgrep; do
    for ac_exec_ext in '' $ac_executable_extensions; do
      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
# Check for GNU ac_path_FGREP and select it if it is found.
  # Check for GNU $ac_path_FGREP
case `"$ac_path_FGREP" --version 2>&1` in
*GNU*)
  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
*)
  ac_count=0
  $as_echo_n 0123456789 >"conftest.in"
  while :
  do
    cat "conftest.in" "conftest.in" >"conftest.tmp"
    mv "conftest.tmp" "conftest.in"
    cp "conftest.in" "conftest.nl"
    $as_echo 'FGREP' >> "conftest.nl"
    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    as_fn_arith $ac_count + 1 && ac_count=$as_val
    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
      # Best one so far, save it but keep looking for a better one
      ac_cv_path_FGREP="$ac_path_FGREP"
      ac_path_FGREP_max=$ac_count
    fi
    # 10*(2^10) chars as input seems more than enough
    test $ac_count -gt 10 && break
  done
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac

      $ac_path_FGREP_found && break 3
    done
  done
  done
IFS=$as_save_IFS
  if test -z "$ac_cv_path_FGREP"; then
    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
  fi
else
  ac_cv_path_FGREP=$FGREP
fi

   fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
$as_echo "$ac_cv_path_FGREP" >&6; }
 FGREP="$ac_cv_path_FGREP"


test -z "$GREP" && GREP=grep



















# Check whether --with-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then :
  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
else
  with_gnu_ld=no
fi

ac_prog=ld
if test "$GCC" = yes; then
  # Check if gcc -print-prog-name=ld gives a path.
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
$as_echo_n "checking for ld used by $CC... " >&6; }
  case $host in
  *-*-mingw*)
    # gcc leaves a trailing carriage return which upsets mingw
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  *)
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  esac
  case $ac_prog in
    # Accept absolute paths.
    [\\/]* | ?:[\\/]*)
      re_direlt='/[^/][^/]*/\.\./'
      # Canonicalize the pathname of ld
      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
      done
      test -z "$LD" && LD="$ac_prog"
      ;;
  "")
    # If it fails, then pretend we aren't using GCC.
    ac_prog=ld
    ;;
  *)
    # If it is relative, then search for the first ld in PATH.
    with_gnu_ld=unknown
    ;;
  esac
elif test "$with_gnu_ld" = yes; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
$as_echo_n "checking for GNU ld... " >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
$as_echo_n "checking for non-GNU ld... " >&6; }
fi
if ${lt_cv_path_LD+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -z "$LD"; then
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  for ac_dir in $PATH; do
    IFS="$lt_save_ifs"
    test -z "$ac_dir" && ac_dir=.
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
      lt_cv_path_LD="$ac_dir/$ac_prog"
      # Check to see if the program is GNU ld.  I'd rather use --version,
      # but apparently some variants of GNU ld only accept -v.
      # Break only if it was the GNU/non-GNU ld that we prefer.
      case `"$lt_cv_path_LD" -v 2>&1 &5
$as_echo "$LD" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
if ${lt_cv_prog_gnu_ld+:} false; then :
  $as_echo_n "(cached) " >&6
else
  # I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 &5
$as_echo "$lt_cv_prog_gnu_ld" >&6; }
with_gnu_ld=$lt_cv_prog_gnu_ld









{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
if ${lt_cv_path_NM+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$NM"; then
  # Let the user override the test.
  lt_cv_path_NM="$NM"
else
  lt_nm_to_check="${ac_tool_prefix}nm"
  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
    lt_nm_to_check="$lt_nm_to_check nm"
  fi
  for lt_tmp_nm in $lt_nm_to_check; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
      tmp_nm="$ac_dir/$lt_tmp_nm"
      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
	# Check to see if the nm accepts a BSD-compat flag.
	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
	#   nm: unknown option "B" ignored
	# Tru64's nm complains that /dev/null is an invalid object file
	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
	*/dev/null* | *'Invalid file or object type'*)
	  lt_cv_path_NM="$tmp_nm -B"
	  break
	  ;;
	*)
	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
	  */dev/null*)
	    lt_cv_path_NM="$tmp_nm -p"
	    break
	    ;;
	  *)
	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
	    continue # so that we can try to find one that supports BSD flags
	    ;;
	  esac
	  ;;
	esac
      fi
    done
    IFS="$lt_save_ifs"
  done
  : ${lt_cv_path_NM=no}
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
$as_echo "$lt_cv_path_NM" >&6; }
if test "$lt_cv_path_NM" != "no"; then
  NM="$lt_cv_path_NM"
else
  # Didn't find any BSD compatible name lister, look for dumpbin.
  if test -n "$DUMPBIN"; then :
    # Let the user override the test.
  else
    if test -n "$ac_tool_prefix"; then
  for ac_prog in dumpbin "link -dump"
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$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_DUMPBIN+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$DUMPBIN"; then
  ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_DUMPBIN="$ac_tool_prefix$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
DUMPBIN=$ac_cv_prog_DUMPBIN
if test -n "$DUMPBIN"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
$as_echo "$DUMPBIN" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


    test -n "$DUMPBIN" && break
  done
fi
if test -z "$DUMPBIN"; then
  ac_ct_DUMPBIN=$DUMPBIN
  for ac_prog in dumpbin "link -dump"
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_ac_ct_DUMPBIN+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_DUMPBIN"; then
  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_ac_ct_DUMPBIN="$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
ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
if test -n "$ac_ct_DUMPBIN"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
$as_echo "$ac_ct_DUMPBIN" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$ac_ct_DUMPBIN" && break
done

  if test "x$ac_ct_DUMPBIN" = x; then
    DUMPBIN=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    DUMPBIN=$ac_ct_DUMPBIN
  fi
fi

    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
    *COFF*)
      DUMPBIN="$DUMPBIN -symbols"
      ;;
    *)
      DUMPBIN=:
      ;;
    esac
  fi

  if test "$DUMPBIN" != ":"; then
    NM="$DUMPBIN"
  fi
fi
test -z "$NM" && NM=nm






{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
$as_echo_n "checking the name lister ($NM) interface... " >&6; }
if ${lt_cv_nm_interface+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_nm_interface="BSD nm"
  echo "int some_variable = 0;" > conftest.$ac_ext
  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
  (eval "$ac_compile" 2>conftest.err)
  cat conftest.err >&5
  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
  cat conftest.err >&5
  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
  cat conftest.out >&5
  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
    lt_cv_nm_interface="MS dumpbin"
  fi
  rm -f conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
$as_echo "$lt_cv_nm_interface" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
$as_echo_n "checking whether ln -s works... " >&6; }
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; 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, using $LN_S" >&5
$as_echo "no, using $LN_S" >&6; }
fi

# find the maximum length of command line arguments
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
$as_echo_n "checking the maximum length of command line arguments... " >&6; }
if ${lt_cv_sys_max_cmd_len+:} false; then :
  $as_echo_n "(cached) " >&6
else
    i=0
  teststring="ABCD"

  case $build_os in
  msdosdjgpp*)
    # On DJGPP, this test can blow up pretty badly due to problems in libc
    # (any single argument exceeding 2000 bytes causes a buffer overrun
    # during glob expansion).  Even if it were fixed, the result of this
    # check would be larger than it should be.
    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
    ;;

  gnu*)
    # Under GNU Hurd, this test is not required because there is
    # no limit to the length of command line arguments.
    # Libtool will interpret -1 as no limit whatsoever
    lt_cv_sys_max_cmd_len=-1;
    ;;

  cygwin* | mingw* | cegcc*)
    # On Win9x/ME, this test blows up -- it succeeds, but takes
    # about 5 minutes as the teststring grows exponentially.
    # Worse, since 9x/ME are not pre-emptively multitasking,
    # you end up with a "frozen" computer, even though with patience
    # the test eventually succeeds (with a max line length of 256k).
    # Instead, let's just punt: use the minimum linelength reported by
    # all of the supported platforms: 8192 (on NT/2K/XP).
    lt_cv_sys_max_cmd_len=8192;
    ;;

  mint*)
    # On MiNT this can take a long time and run out of memory.
    lt_cv_sys_max_cmd_len=8192;
    ;;

  amigaos*)
    # On AmigaOS with pdksh, this test takes hours, literally.
    # So we just punt and use a minimum line length of 8192.
    lt_cv_sys_max_cmd_len=8192;
    ;;

  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
    # This has been around since 386BSD, at least.  Likely further.
    if test -x /sbin/sysctl; then
      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
    elif test -x /usr/sbin/sysctl; then
      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
    else
      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
    fi
    # And add a safety zone
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
    ;;

  interix*)
    # We know the value 262144 and hardcode it with a safety zone (like BSD)
    lt_cv_sys_max_cmd_len=196608
    ;;

  osf*)
    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
    # nice to cause kernel panics so lets avoid the loop below.
    # First set a reasonable default.
    lt_cv_sys_max_cmd_len=16384
    #
    if test -x /sbin/sysconfig; then
      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
        *1*) lt_cv_sys_max_cmd_len=-1 ;;
      esac
    fi
    ;;
  sco3.2v5*)
    lt_cv_sys_max_cmd_len=102400
    ;;
  sysv5* | sco5v6* | sysv4.2uw2*)
    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
    if test -n "$kargmax"; then
      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[	 ]//'`
    else
      lt_cv_sys_max_cmd_len=32768
    fi
    ;;
  *)
    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
    if test -n "$lt_cv_sys_max_cmd_len"; then
      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
    else
      # Make teststring a little bigger before we do anything with it.
      # a 1K string should be a reasonable start.
      for i in 1 2 3 4 5 6 7 8 ; do
        teststring=$teststring$teststring
      done
      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
      # If test is not a shell built-in, we'll probably end up computing a
      # maximum length that is only half of the actual maximum length, but
      # we can't tell.
      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
	      test $i != 17 # 1/2 MB should be enough
      do
        i=`expr $i + 1`
        teststring=$teststring$teststring
      done
      # Only check the string length outside the loop.
      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
      teststring=
      # Add a significant safety factor because C++ compilers can tack on
      # massive amounts of additional arguments before passing them to the
      # linker.  It appears as though 1/2 is a usable value.
      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
    fi
    ;;
  esac

fi

if test -n $lt_cv_sys_max_cmd_len ; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
fi
max_cmd_len=$lt_cv_sys_max_cmd_len






: ${CP="cp -f"}
: ${MV="mv -f"}
: ${RM="rm -f"}

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
# Try some XSI features
xsi_shell=no
( _lt_dummy="a/b/c"
  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
      = c,a/b,b/c, \
    && eval 'test $(( 1 + 1 )) -eq 2 \
    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
  && xsi_shell=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
$as_echo "$xsi_shell" >&6; }


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
lt_shell_append=no
( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
    >/dev/null 2>&1 \
  && lt_shell_append=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
$as_echo "$lt_shell_append" >&6; }


if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
  lt_unset=unset
else
  lt_unset=false
fi





# test EBCDIC or ASCII
case `echo X|tr X '\101'` in
 A) # ASCII based system
    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
  lt_SP2NL='tr \040 \012'
  lt_NL2SP='tr \015\012 \040\040'
  ;;
 *) # EBCDIC based system
  lt_SP2NL='tr \100 \n'
  lt_NL2SP='tr \r\n \100\100'
  ;;
esac









{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
if ${lt_cv_to_host_file_cmd+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $host in
  *-*-mingw* )
    case $build in
      *-*-mingw* ) # actually msys
        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
        ;;
      *-*-cygwin* )
        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
        ;;
      * ) # otherwise, assume *nix
        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
        ;;
    esac
    ;;
  *-*-cygwin* )
    case $build in
      *-*-mingw* ) # actually msys
        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
        ;;
      *-*-cygwin* )
        lt_cv_to_host_file_cmd=func_convert_file_noop
        ;;
      * ) # otherwise, assume *nix
        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
        ;;
    esac
    ;;
  * ) # unhandled hosts (and "normal" native builds)
    lt_cv_to_host_file_cmd=func_convert_file_noop
    ;;
esac

fi

to_host_file_cmd=$lt_cv_to_host_file_cmd
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
$as_echo "$lt_cv_to_host_file_cmd" >&6; }





{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
if ${lt_cv_to_tool_file_cmd+:} false; then :
  $as_echo_n "(cached) " >&6
else
  #assume ordinary cross tools, or native build.
lt_cv_to_tool_file_cmd=func_convert_file_noop
case $host in
  *-*-mingw* )
    case $build in
      *-*-mingw* ) # actually msys
        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
        ;;
    esac
    ;;
esac

fi

to_tool_file_cmd=$lt_cv_to_tool_file_cmd
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
$as_echo "$lt_cv_to_tool_file_cmd" >&6; }





{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
$as_echo_n "checking for $LD option to reload object files... " >&6; }
if ${lt_cv_ld_reload_flag+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_ld_reload_flag='-r'
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
$as_echo "$lt_cv_ld_reload_flag" >&6; }
reload_flag=$lt_cv_ld_reload_flag
case $reload_flag in
"" | " "*) ;;
*) reload_flag=" $reload_flag" ;;
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
  cygwin* | mingw* | pw32* | cegcc*)
    if test "$GCC" != yes; then
      reload_cmds=false
    fi
    ;;
  darwin*)
    if test "$GCC" = yes; then
      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
    else
      reload_cmds='$LD$reload_flag -o $output$reload_objs'
    fi
    ;;
esac









if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$OBJDUMP"; then
  ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump"
    $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
OBJDUMP=$ac_cv_prog_OBJDUMP
if test -n "$OBJDUMP"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
$as_echo "$OBJDUMP" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_OBJDUMP"; then
  ac_ct_OBJDUMP=$OBJDUMP
  # Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; 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_ac_ct_OBJDUMP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_OBJDUMP"; then
  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_ac_ct_OBJDUMP="objdump"
    $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
ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
if test -n "$ac_ct_OBJDUMP"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
$as_echo "$ac_ct_OBJDUMP" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_OBJDUMP" = x; then
    OBJDUMP="false"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    OBJDUMP=$ac_ct_OBJDUMP
  fi
else
  OBJDUMP="$ac_cv_prog_OBJDUMP"
fi

test -z "$OBJDUMP" && OBJDUMP=objdump









{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
$as_echo_n "checking how to recognize dependent libraries... " >&6; }
if ${lt_cv_deplibs_check_method+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
lt_cv_deplibs_check_method='unknown'
# Need to set the preceding variable on all platforms that support
# interlibrary dependencies.
# 'none' -- dependencies not supported.
# `unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
# which responds to the $file_magic_cmd with a given extended regex.
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.

case $host_os in
aix[4-9]*)
  lt_cv_deplibs_check_method=pass_all
  ;;

beos*)
  lt_cv_deplibs_check_method=pass_all
  ;;

bsdi[45]*)
  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
  lt_cv_file_magic_cmd='/usr/bin/file -L'
  lt_cv_file_magic_test_file=/shlib/libc.so
  ;;

cygwin*)
  # func_win32_libid is a shell function defined in ltmain.sh
  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
  lt_cv_file_magic_cmd='func_win32_libid'
  ;;

mingw* | pw32*)
  # Base MSYS/MinGW do not provide the 'file' command needed by
  # func_win32_libid shell function, so use a weaker test based on 'objdump',
  # unless we find 'file', for example because we are cross-compiling.
  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
    lt_cv_file_magic_cmd='func_win32_libid'
  else
    # Keep this pattern in sync with the one in func_win32_libid.
    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
    lt_cv_file_magic_cmd='$OBJDUMP -f'
  fi
  ;;

cegcc*)
  # use the weaker test based on 'objdump'. See mingw*.
  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
  lt_cv_file_magic_cmd='$OBJDUMP -f'
  ;;

darwin* | rhapsody*)
  lt_cv_deplibs_check_method=pass_all
  ;;

freebsd* | dragonfly*)
  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
    case $host_cpu in
    i*86 )
      # Not sure whether the presence of OpenBSD here was a mistake.
      # Let's accept both of them until this is cleared up.
      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
      lt_cv_file_magic_cmd=/usr/bin/file
      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
      ;;
    esac
  else
    lt_cv_deplibs_check_method=pass_all
  fi
  ;;

gnu*)
  lt_cv_deplibs_check_method=pass_all
  ;;

haiku*)
  lt_cv_deplibs_check_method=pass_all
  ;;

hpux10.20* | hpux11*)
  lt_cv_file_magic_cmd=/usr/bin/file
  case $host_cpu in
  ia64*)
    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
    ;;
  hppa*64*)
    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
    ;;
  *)
    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
    lt_cv_file_magic_test_file=/usr/lib/libc.sl
    ;;
  esac
  ;;

interix[3-9]*)
  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
  ;;

irix5* | irix6* | nonstopux*)
  case $LD in
  *-32|*"-32 ") libmagic=32-bit;;
  *-n32|*"-n32 ") libmagic=N32;;
  *-64|*"-64 ") libmagic=64-bit;;
  *) libmagic=never-match;;
  esac
  lt_cv_deplibs_check_method=pass_all
  ;;

# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
  lt_cv_deplibs_check_method=pass_all
  ;;

netbsd*)
  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  else
    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
  fi
  ;;

newos6*)
  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
  lt_cv_file_magic_cmd=/usr/bin/file
  lt_cv_file_magic_test_file=/usr/lib/libnls.so
  ;;

*nto* | *qnx*)
  lt_cv_deplibs_check_method=pass_all
  ;;

openbsd*)
  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
  else
    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
  fi
  ;;

osf3* | osf4* | osf5*)
  lt_cv_deplibs_check_method=pass_all
  ;;

rdos*)
  lt_cv_deplibs_check_method=pass_all
  ;;

solaris*)
  lt_cv_deplibs_check_method=pass_all
  ;;

sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  lt_cv_deplibs_check_method=pass_all
  ;;

sysv4 | sysv4.3*)
  case $host_vendor in
  motorola)
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
    ;;
  ncr)
    lt_cv_deplibs_check_method=pass_all
    ;;
  sequent)
    lt_cv_file_magic_cmd='/bin/file'
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
    ;;
  sni)
    lt_cv_file_magic_cmd='/bin/file'
    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
    lt_cv_file_magic_test_file=/lib/libc.so
    ;;
  siemens)
    lt_cv_deplibs_check_method=pass_all
    ;;
  pc)
    lt_cv_deplibs_check_method=pass_all
    ;;
  esac
  ;;

tpf*)
  lt_cv_deplibs_check_method=pass_all
  ;;
esac

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
$as_echo "$lt_cv_deplibs_check_method" >&6; }

file_magic_glob=
want_nocaseglob=no
if test "$build" = "$host"; then
  case $host_os in
  mingw* | pw32*)
    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
      want_nocaseglob=yes
    else
      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
    fi
    ;;
  esac
fi

file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown






















if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$DLLTOOL"; then
  ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool"
    $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
DLLTOOL=$ac_cv_prog_DLLTOOL
if test -n "$DLLTOOL"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
$as_echo "$DLLTOOL" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_DLLTOOL"; then
  ac_ct_DLLTOOL=$DLLTOOL
  # Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; 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_ac_ct_DLLTOOL+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_DLLTOOL"; then
  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_ac_ct_DLLTOOL="dlltool"
    $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
ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
if test -n "$ac_ct_DLLTOOL"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
$as_echo "$ac_ct_DLLTOOL" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_DLLTOOL" = x; then
    DLLTOOL="false"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    DLLTOOL=$ac_ct_DLLTOOL
  fi
else
  DLLTOOL="$ac_cv_prog_DLLTOOL"
fi

test -z "$DLLTOOL" && DLLTOOL=dlltool










{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_sharedlib_from_linklib_cmd='unknown'

case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
  # two different shell functions defined in ltmain.sh
  # decide which to use based on capabilities of $DLLTOOL
  case `$DLLTOOL --help 2>&1` in
  *--identify-strict*)
    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
    ;;
  *)
    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
    ;;
  esac
  ;;
*)
  # fallback: assume linklib IS sharedlib
  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
  ;;
esac

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO







if test -n "$ac_tool_prefix"; then
  for ac_prog in ar
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$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_AR+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$AR"; then
  ac_cv_prog_AR="$AR" # 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_AR="$ac_tool_prefix$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
AR=$ac_cv_prog_AR
if test -n "$AR"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
$as_echo "$AR" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


    test -n "$AR" && break
  done
fi
if test -z "$AR"; then
  ac_ct_AR=$AR
  for ac_prog in ar
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_ac_ct_AR+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_AR"; then
  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_ac_ct_AR="$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
ac_ct_AR=$ac_cv_prog_ac_ct_AR
if test -n "$ac_ct_AR"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
$as_echo "$ac_ct_AR" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$ac_ct_AR" && break
done

  if test "x$ac_ct_AR" = x; then
    AR="false"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    AR=$ac_ct_AR
  fi
fi

: ${AR=ar}
: ${AR_FLAGS=cru}











{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
$as_echo_n "checking for archiver @FILE support... " >&6; }
if ${lt_cv_ar_at_file+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_ar_at_file=no
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  echo conftest.$ac_objext > conftest.lst
      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
  (eval $lt_ar_try) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }
      if test "$ac_status" -eq 0; then
	# Ensure the archiver fails upon bogus file names.
	rm -f conftest.$ac_objext libconftest.a
	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
  (eval $lt_ar_try) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }
	if test "$ac_status" -ne 0; then
          lt_cv_ar_at_file=@
        fi
      fi
      rm -f conftest.* libconftest.a

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
$as_echo "$lt_cv_ar_at_file" >&6; }

if test "x$lt_cv_ar_at_file" = xno; then
  archiver_list_spec=
else
  archiver_list_spec=$lt_cv_ar_at_file
fi







if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; 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_STRIP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$STRIP"; then
  ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip"
    $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
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
$as_echo "$STRIP" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_STRIP"; then
  ac_ct_STRIP=$STRIP
  # Extract the first word of "strip", so it can be a program name with args.
set dummy strip; 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_ac_ct_STRIP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_STRIP"; then
  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_ac_ct_STRIP="strip"
    $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
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
$as_echo "$ac_ct_STRIP" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_STRIP" = x; then
    STRIP=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    STRIP=$ac_ct_STRIP
  fi
else
  STRIP="$ac_cv_prog_STRIP"
fi

test -z "$STRIP" && STRIP=:






if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib"
    $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
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
$as_echo "$RANLIB" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_RANLIB"; then
  ac_ct_RANLIB=$RANLIB
  # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; 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_ac_ct_RANLIB+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_RANLIB"; then
  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_ac_ct_RANLIB="ranlib"
    $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
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
$as_echo "$ac_ct_RANLIB" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_RANLIB" = x; then
    RANLIB=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    RANLIB=$ac_ct_RANLIB
  fi
else
  RANLIB="$ac_cv_prog_RANLIB"
fi

test -z "$RANLIB" && RANLIB=:






# Determine commands to create old-style static archives.
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=

if test -n "$RANLIB"; then
  case $host_os in
  openbsd*)
    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
    ;;
  *)
    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
    ;;
  esac
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi

case $host_os in
  darwin*)
    lock_old_archive_extraction=yes ;;
  *)
    lock_old_archive_extraction=no ;;
esac







































# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}

# If no C compiler flags were specified, use CFLAGS.
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}

# Allow CC to be a program name with arguments.
compiler=$CC


# Check for command to grab the raw symbol name followed by C symbol from nm.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
if ${lt_cv_sys_global_symbol_pipe+:} false; then :
  $as_echo_n "(cached) " >&6
else

# These are sane defaults that work on at least a few old systems.
# [They come from Ultrix.  What could be older than Ultrix?!! ;)]

# Character class describing NM global symbol codes.
symcode='[BCDEGRST]'

# Regexp to match symbols that can be accessed directly from C.
sympat='\([_A-Za-z][_A-Za-z0-9]*\)'

# Define system-specific variables.
case $host_os in
aix*)
  symcode='[BCDT]'
  ;;
cygwin* | mingw* | pw32* | cegcc*)
  symcode='[ABCDGISTW]'
  ;;
hpux*)
  if test "$host_cpu" = ia64; then
    symcode='[ABCDEGRST]'
  fi
  ;;
irix* | nonstopux*)
  symcode='[BCDEGRST]'
  ;;
osf*)
  symcode='[BCDEGQRST]'
  ;;
solaris*)
  symcode='[BDRT]'
  ;;
sco3.2v5*)
  symcode='[DT]'
  ;;
sysv4.2uw2*)
  symcode='[DT]'
  ;;
sysv5* | sco5v6* | unixware* | OpenUNIX*)
  symcode='[ABDT]'
  ;;
sysv4)
  symcode='[DFNSTU]'
  ;;
esac

# If we're using GNU nm, then use its standard symbol codes.
case `$NM -V 2>&1` in
*GNU* | *'with BFD'*)
  symcode='[ABCDGIRSTW]' ;;
esac

# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"

# Transform an extracted symbol line into symbol name and symbol address
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"

# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
mingw*)
  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
  ;;
esac

# Try without a prefix underscore, then with it.
for ac_symprfx in "" "_"; do

  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
  symxfrm="\\1 $ac_symprfx\\2 \\2"

  # Write the raw and C identifiers.
  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
    # Fake it for dumpbin and say T for any non-static function
    # and D for any global variable.
    # Also find C++ and __fastcall symbols from MSVC++,
    # which start with @ or ?.
    lt_cv_sys_global_symbol_pipe="$AWK '"\
"     {last_section=section; section=\$ 3};"\
"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
"     \$ 0!~/External *\|/{next};"\
"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
"     {if(hide[section]) next};"\
"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
"     ' prfx=^$ac_symprfx"
  else
    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
  fi
  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"

  # Check to see that the pipe works correctly.
  pipe_works=no

  rm -f conftest*
  cat > conftest.$ac_ext <<_LT_EOF
#ifdef __cplusplus
extern "C" {
#endif
char nm_test_var;
void nm_test_func(void);
void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func();return(0);}
_LT_EOF

  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then
    # Now try to grab the symbols.
    nlist=conftest.nm
    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && test -s "$nlist"; then
      # Try sorting and uniquifying the output.
      if sort "$nlist" | uniq > "$nlist"T; then
	mv -f "$nlist"T "$nlist"
      else
	rm -f "$nlist"T
      fi

      # Make sure that we snagged all the symbols we need.
      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
	  cat <<_LT_EOF > conftest.$ac_ext
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
/* DATA imports from DLLs on WIN32 con't be const, because runtime
   relocations are performed -- see ld's documentation on pseudo-relocs.  */
# define LT_DLSYM_CONST
#elif defined(__osf__)
/* This system does not cope well with relocations in const data.  */
# define LT_DLSYM_CONST
#else
# define LT_DLSYM_CONST const
#endif

#ifdef __cplusplus
extern "C" {
#endif

_LT_EOF
	  # Now generate the symbol file.
	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'

	  cat <<_LT_EOF >> conftest.$ac_ext

/* The mapping between symbol names and symbols.  */
LT_DLSYM_CONST struct {
  const char *name;
  void       *address;
}
lt__PROGRAM__LTX_preloaded_symbols[] =
{
  { "@PROGRAM@", (void *) 0 },
_LT_EOF
	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
	  cat <<\_LT_EOF >> conftest.$ac_ext
  {0, (void *) 0}
};

/* This works around a problem in FreeBSD linker */
#ifdef FREEBSD_WORKAROUND
static const void *lt_preloaded_setup() {
  return lt__PROGRAM__LTX_preloaded_symbols;
}
#endif

#ifdef __cplusplus
}
#endif
_LT_EOF
	  # Now try linking the two files.
	  mv conftest.$ac_objext conftstm.$ac_objext
	  lt_globsym_save_LIBS=$LIBS
	  lt_globsym_save_CFLAGS=$CFLAGS
	  LIBS="conftstm.$ac_objext"
	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
	    pipe_works=yes
	  fi
	  LIBS=$lt_globsym_save_LIBS
	  CFLAGS=$lt_globsym_save_CFLAGS
	else
	  echo "cannot find nm_test_func in $nlist" >&5
	fi
      else
	echo "cannot find nm_test_var in $nlist" >&5
      fi
    else
      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
    fi
  else
    echo "$progname: failed program was:" >&5
    cat conftest.$ac_ext >&5
  fi
  rm -rf conftest* conftst*

  # Do not use the global_symbol_pipe unless it works.
  if test "$pipe_works" = yes; then
    break
  else
    lt_cv_sys_global_symbol_pipe=
  fi
done

fi

if test -z "$lt_cv_sys_global_symbol_pipe"; then
  lt_cv_sys_global_symbol_to_cdecl=
fi
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
$as_echo "failed" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
fi

# Response file support.
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
  nm_file_list_spec='@'
elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
  nm_file_list_spec='@'
fi



























{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
$as_echo_n "checking for sysroot... " >&6; }

# Check whether --with-sysroot was given.
if test "${with_sysroot+set}" = set; then :
  withval=$with_sysroot;
else
  with_sysroot=no
fi


lt_sysroot=
case ${with_sysroot} in #(
 yes)
   if test "$GCC" = yes; then
     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
   fi
   ;; #(
 /*)
   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
   ;; #(
 no|'')
   ;; #(
 *)
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
$as_echo "${with_sysroot}" >&6; }
   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
   ;;
esac

 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
$as_echo "${lt_sysroot:-no}" >&6; }





# Check whether --enable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then :
  enableval=$enable_libtool_lock;
fi

test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes

# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case $host in
ia64-*-hpux*)
  # Find out which ABI we are using.
  echo 'int i;' > conftest.$ac_ext
  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then
    case `/usr/bin/file conftest.$ac_objext` in
      *ELF-32*)
	HPUX_IA64_MODE="32"
	;;
      *ELF-64*)
	HPUX_IA64_MODE="64"
	;;
    esac
  fi
  rm -rf conftest*
  ;;
*-*-irix6*)
  # Find out which ABI we are using.
  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then
    if test "$lt_cv_prog_gnu_ld" = yes; then
      case `/usr/bin/file conftest.$ac_objext` in
	*32-bit*)
	  LD="${LD-ld} -melf32bsmip"
	  ;;
	*N32*)
	  LD="${LD-ld} -melf32bmipn32"
	  ;;
	*64-bit*)
	  LD="${LD-ld} -melf64bmip"
	;;
      esac
    else
      case `/usr/bin/file conftest.$ac_objext` in
	*32-bit*)
	  LD="${LD-ld} -32"
	  ;;
	*N32*)
	  LD="${LD-ld} -n32"
	  ;;
	*64-bit*)
	  LD="${LD-ld} -64"
	  ;;
      esac
    fi
  fi
  rm -rf conftest*
  ;;

x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
  # Find out which ABI we are using.
  echo 'int i;' > conftest.$ac_ext
  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then
    case `/usr/bin/file conftest.o` in
      *32-bit*)
	case $host in
	  x86_64-*kfreebsd*-gnu)
	    LD="${LD-ld} -m elf_i386_fbsd"
	    ;;
	  x86_64-*linux*)
	    LD="${LD-ld} -m elf_i386"
	    ;;
	  ppc64-*linux*|powerpc64-*linux*)
	    LD="${LD-ld} -m elf32ppclinux"
	    ;;
	  s390x-*linux*)
	    LD="${LD-ld} -m elf_s390"
	    ;;
	  sparc64-*linux*)
	    LD="${LD-ld} -m elf32_sparc"
	    ;;
	esac
	;;
      *64-bit*)
	case $host in
	  x86_64-*kfreebsd*-gnu)
	    LD="${LD-ld} -m elf_x86_64_fbsd"
	    ;;
	  x86_64-*linux*)
	    LD="${LD-ld} -m elf_x86_64"
	    ;;
	  ppc*-*linux*|powerpc*-*linux*)
	    LD="${LD-ld} -m elf64ppc"
	    ;;
	  s390*-*linux*|s390*-*tpf*)
	    LD="${LD-ld} -m elf64_s390"
	    ;;
	  sparc*-*linux*)
	    LD="${LD-ld} -m elf64_sparc"
	    ;;
	esac
	;;
    esac
  fi
  rm -rf conftest*
  ;;

*-*-sco3.2v5*)
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  SAVE_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS -belf"
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
if ${lt_cv_cc_needs_belf+:} false; then :
  $as_echo_n "(cached) " >&6
else
  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.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  lt_cv_cc_needs_belf=yes
else
  lt_cv_cc_needs_belf=no
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext 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

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
$as_echo "$lt_cv_cc_needs_belf" >&6; }
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
    CFLAGS="$SAVE_CFLAGS"
  fi
  ;;
sparc*-*solaris*)
  # Find out which ABI we are using.
  echo 'int i;' > conftest.$ac_ext
  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then
    case `/usr/bin/file conftest.o` in
    *64-bit*)
      case $lt_cv_prog_gnu_ld in
      yes*) LD="${LD-ld} -m elf64_sparc" ;;
      *)
	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
	  LD="${LD-ld} -64"
	fi
	;;
      esac
      ;;
    esac
  fi
  rm -rf conftest*
  ;;
esac

need_locks="$enable_libtool_lock"

if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$MANIFEST_TOOL"; then
  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_MANIFEST_TOOL="${ac_tool_prefix}mt"
    $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
MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
if test -n "$MANIFEST_TOOL"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
$as_echo "$MANIFEST_TOOL" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
  # Extract the first word of "mt", so it can be a program name with args.
set dummy mt; 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_ac_ct_MANIFEST_TOOL+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_MANIFEST_TOOL"; then
  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_ac_ct_MANIFEST_TOOL="mt"
    $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
ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
if test -n "$ac_ct_MANIFEST_TOOL"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_MANIFEST_TOOL" = x; then
    MANIFEST_TOOL=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
  fi
else
  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
fi

test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
if ${lt_cv_path_mainfest_tool+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_path_mainfest_tool=no
  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
  cat conftest.err >&5
  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
    lt_cv_path_mainfest_tool=yes
  fi
  rm -f conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
$as_echo "$lt_cv_path_mainfest_tool" >&6; }
if test "x$lt_cv_path_mainfest_tool" != xyes; then
  MANIFEST_TOOL=:
fi






  case $host_os in
    rhapsody* | darwin*)
    if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$DSYMUTIL"; then
  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_DSYMUTIL="${ac_tool_prefix}dsymutil"
    $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
DSYMUTIL=$ac_cv_prog_DSYMUTIL
if test -n "$DSYMUTIL"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
$as_echo "$DSYMUTIL" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_DSYMUTIL"; then
  ac_ct_DSYMUTIL=$DSYMUTIL
  # Extract the first word of "dsymutil", so it can be a program name with args.
set dummy dsymutil; 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_ac_ct_DSYMUTIL+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_DSYMUTIL"; then
  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_ac_ct_DSYMUTIL="dsymutil"
    $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
ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
if test -n "$ac_ct_DSYMUTIL"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
$as_echo "$ac_ct_DSYMUTIL" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_DSYMUTIL" = x; then
    DSYMUTIL=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    DSYMUTIL=$ac_ct_DSYMUTIL
  fi
else
  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
fi

    if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$NMEDIT"; then
  ac_cv_prog_NMEDIT="$NMEDIT" # 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_NMEDIT="${ac_tool_prefix}nmedit"
    $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
NMEDIT=$ac_cv_prog_NMEDIT
if test -n "$NMEDIT"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
$as_echo "$NMEDIT" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_NMEDIT"; then
  ac_ct_NMEDIT=$NMEDIT
  # Extract the first word of "nmedit", so it can be a program name with args.
set dummy nmedit; 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_ac_ct_NMEDIT+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_NMEDIT"; then
  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_ac_ct_NMEDIT="nmedit"
    $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
ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
if test -n "$ac_ct_NMEDIT"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
$as_echo "$ac_ct_NMEDIT" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_NMEDIT" = x; then
    NMEDIT=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    NMEDIT=$ac_ct_NMEDIT
  fi
else
  NMEDIT="$ac_cv_prog_NMEDIT"
fi

    if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
set dummy ${ac_tool_prefix}lipo; 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_LIPO+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$LIPO"; then
  ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ac_tool_prefix}lipo"
    $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
LIPO=$ac_cv_prog_LIPO
if test -n "$LIPO"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
$as_echo "$LIPO" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_LIPO"; then
  ac_ct_LIPO=$LIPO
  # Extract the first word of "lipo", so it can be a program name with args.
set dummy lipo; 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_ac_ct_LIPO+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_LIPO"; then
  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_ac_ct_LIPO="lipo"
    $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
ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
if test -n "$ac_ct_LIPO"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
$as_echo "$ac_ct_LIPO" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_LIPO" = x; then
    LIPO=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    LIPO=$ac_ct_LIPO
  fi
else
  LIPO="$ac_cv_prog_LIPO"
fi

    if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
set dummy ${ac_tool_prefix}otool; 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_OTOOL+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$OTOOL"; then
  ac_cv_prog_OTOOL="$OTOOL" # 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_OTOOL="${ac_tool_prefix}otool"
    $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
OTOOL=$ac_cv_prog_OTOOL
if test -n "$OTOOL"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
$as_echo "$OTOOL" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_OTOOL"; then
  ac_ct_OTOOL=$OTOOL
  # Extract the first word of "otool", so it can be a program name with args.
set dummy otool; 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_ac_ct_OTOOL+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_OTOOL"; then
  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_ac_ct_OTOOL="otool"
    $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
ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
if test -n "$ac_ct_OTOOL"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
$as_echo "$ac_ct_OTOOL" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_OTOOL" = x; then
    OTOOL=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    OTOOL=$ac_ct_OTOOL
  fi
else
  OTOOL="$ac_cv_prog_OTOOL"
fi

    if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$OTOOL64"; then
  ac_cv_prog_OTOOL64="$OTOOL64" # 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_OTOOL64="${ac_tool_prefix}otool64"
    $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
OTOOL64=$ac_cv_prog_OTOOL64
if test -n "$OTOOL64"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
$as_echo "$OTOOL64" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_OTOOL64"; then
  ac_ct_OTOOL64=$OTOOL64
  # Extract the first word of "otool64", so it can be a program name with args.
set dummy otool64; 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_ac_ct_OTOOL64+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_OTOOL64"; then
  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_ac_ct_OTOOL64="otool64"
    $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
ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
if test -n "$ac_ct_OTOOL64"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
$as_echo "$ac_ct_OTOOL64" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_OTOOL64" = x; then
    OTOOL64=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    OTOOL64=$ac_ct_OTOOL64
  fi
else
  OTOOL64="$ac_cv_prog_OTOOL64"
fi



























    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
$as_echo_n "checking for -single_module linker flag... " >&6; }
if ${lt_cv_apple_cc_single_mod+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_apple_cc_single_mod=no
      if test -z "${LT_MULTI_MODULE}"; then
	# By default we will add the -single_module flag. You can override
	# by either setting the environment variable LT_MULTI_MODULE
	# non-empty at configure time, or by adding -multi_module to the
	# link flags.
	rm -rf libconftest.dylib*
	echo "int foo(void){return 1;}" > conftest.c
	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c" >&5
	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
        _lt_result=$?
	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
	  lt_cv_apple_cc_single_mod=yes
	else
	  cat conftest.err >&5
	fi
	rm -rf libconftest.dylib*
	rm -f conftest.*
      fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
if ${lt_cv_ld_exported_symbols_list+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_ld_exported_symbols_list=no
      save_LDFLAGS=$LDFLAGS
      echo "_main" > conftest.sym
      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  lt_cv_ld_exported_symbols_list=yes
else
  lt_cv_ld_exported_symbols_list=no
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
	LDFLAGS="$save_LDFLAGS"

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
$as_echo_n "checking for -force_load linker flag... " >&6; }
if ${lt_cv_ld_force_load+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_ld_force_load=no
      cat > conftest.c << _LT_EOF
int forced_loaded() { return 2;}
_LT_EOF
      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
      echo "$AR cru libconftest.a conftest.o" >&5
      $AR cru libconftest.a conftest.o 2>&5
      echo "$RANLIB libconftest.a" >&5
      $RANLIB libconftest.a 2>&5
      cat > conftest.c << _LT_EOF
int main() { return 0;}
_LT_EOF
      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
      _lt_result=$?
      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
	lt_cv_ld_force_load=yes
      else
	cat conftest.err >&5
      fi
        rm -f conftest.err libconftest.a conftest conftest.c
        rm -rf conftest.dSYM

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
$as_echo "$lt_cv_ld_force_load" >&6; }
    case $host_os in
    rhapsody* | darwin1.[012])
      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
    darwin1.*)
      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
    darwin*) # darwin 5.x on
      # if running on 10.5 or later, the deployment target defaults
      # to the OS version, if on x86, and 10.4, the deployment
      # target defaults to 10.4. Don't you love it?
      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
	10.[012]*)
	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
	10.*)
	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
      esac
    ;;
  esac
    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
      _lt_dar_single_mod='$single_module'
    fi
    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
    else
      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
    fi
    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
      _lt_dsymutil='~$DSYMUTIL $lib || :'
    else
      _lt_dsymutil=
    fi
    ;;
  esac

for ac_header in dlfcn.h
do :
  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
"
if test "x$ac_cv_header_dlfcn_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_DLFCN_H 1
_ACEOF

fi

done





# Set options



        enable_dlopen=no


  enable_win32_dll=no



  # Check whether --enable-static was given.
if test "${enable_static+set}" = set; then :
  enableval=$enable_static; p=${PACKAGE-default}
    case $enableval in
    yes) enable_static=yes ;;
    no) enable_static=no ;;
    *)
     enable_static=no
      # Look at the argument we got.  We use all the common list separators.
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
      for pkg in $enableval; do
	IFS="$lt_save_ifs"
	if test "X$pkg" = "X$p"; then
	  enable_static=yes
	fi
      done
      IFS="$lt_save_ifs"
      ;;
    esac
else
  enable_static=yes
fi










# Check whether --with-pic was given.
if test "${with_pic+set}" = set; then :
  withval=$with_pic; pic_mode="$withval"
else
  pic_mode=default
fi


test -z "$pic_mode" && pic_mode=default







  # Check whether --enable-fast-install was given.
if test "${enable_fast_install+set}" = set; then :
  enableval=$enable_fast_install; p=${PACKAGE-default}
    case $enableval in
    yes) enable_fast_install=yes ;;
    no) enable_fast_install=no ;;
    *)
      enable_fast_install=no
      # Look at the argument we got.  We use all the common list separators.
      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
      for pkg in $enableval; do
	IFS="$lt_save_ifs"
	if test "X$pkg" = "X$p"; then
	  enable_fast_install=yes
	fi
      done
      IFS="$lt_save_ifs"
      ;;
    esac
else
  enable_fast_install=yes
fi











# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ltmain"

# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'


























test -z "$LN_S" && LN_S="ln -s"














if test -n "${ZSH_VERSION+set}" ; then
   setopt NO_GLOB_SUBST
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
$as_echo_n "checking for objdir... " >&6; }
if ${lt_cv_objdir+:} false; then :
  $as_echo_n "(cached) " >&6
else
  rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
  lt_cv_objdir=.libs
else
  # MS-DOS does not allow filenames that begin with a dot.
  lt_cv_objdir=_libs
fi
rmdir .libs 2>/dev/null
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
$as_echo "$lt_cv_objdir" >&6; }
objdir=$lt_cv_objdir





cat >>confdefs.h <<_ACEOF
#define LT_OBJDIR "$lt_cv_objdir/"
_ACEOF




case $host_os in
aix3*)
  # AIX sometimes has problems with the GCC collect2 program.  For some
  # reason, if we set the COLLECT_NAMES environment variable, the problems
  # vanish in a puff of smoke.
  if test "X${COLLECT_NAMES+set}" != Xset; then
    COLLECT_NAMES=
    export COLLECT_NAMES
  fi
  ;;
esac

# Global variables:
ofile=libtool
can_build_shared=yes

# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a

with_gnu_ld="$lt_cv_prog_gnu_ld"

old_CC="$CC"
old_CFLAGS="$CFLAGS"

# Set sane defaults for various variables
test -z "$CC" && CC=cc
test -z "$LTCC" && LTCC=$CC
test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
test -z "$LD" && LD=ld
test -z "$ac_objext" && ac_objext=o

for cc_temp in $compiler""; do
  case $cc_temp in
    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
    \-*) ;;
    *) break;;
  esac
done
cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`


# Only perform the check for file, if the check method requires it
test -z "$MAGIC_CMD" && MAGIC_CMD=file
case $deplibs_check_method in
file_magic*)
  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
if ${lt_cv_path_MAGIC_CMD+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $MAGIC_CMD in
[\\/*] |  ?:[\\/]*)
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
  ;;
*)
  lt_save_MAGIC_CMD="$MAGIC_CMD"
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
  for ac_dir in $ac_dummy; do
    IFS="$lt_save_ifs"
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/${ac_tool_prefix}file; then
      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
      if test -n "$file_magic_test_file"; then
	case $deplibs_check_method in
	"file_magic "*)
	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
	    $EGREP "$file_magic_regex" > /dev/null; then
	    :
	  else
	    cat <<_LT_EOF 1>&2

*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
*** The result is that libtool may fail to recognize shared libraries
*** as such.  This will affect the creation of libtool libraries that
*** depend on shared libraries, but programs linked with such libtool
*** libraries will work regardless of this problem.  Nevertheless, you
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org

_LT_EOF
	  fi ;;
	esac
      fi
      break
    fi
  done
  IFS="$lt_save_ifs"
  MAGIC_CMD="$lt_save_MAGIC_CMD"
  ;;
esac
fi

MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
$as_echo "$MAGIC_CMD" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi





if test -z "$lt_cv_path_MAGIC_CMD"; then
  if test -n "$ac_tool_prefix"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
$as_echo_n "checking for file... " >&6; }
if ${lt_cv_path_MAGIC_CMD+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $MAGIC_CMD in
[\\/*] |  ?:[\\/]*)
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
  ;;
*)
  lt_save_MAGIC_CMD="$MAGIC_CMD"
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
  for ac_dir in $ac_dummy; do
    IFS="$lt_save_ifs"
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/file; then
      lt_cv_path_MAGIC_CMD="$ac_dir/file"
      if test -n "$file_magic_test_file"; then
	case $deplibs_check_method in
	"file_magic "*)
	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
	    $EGREP "$file_magic_regex" > /dev/null; then
	    :
	  else
	    cat <<_LT_EOF 1>&2

*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
*** The result is that libtool may fail to recognize shared libraries
*** as such.  This will affect the creation of libtool libraries that
*** depend on shared libraries, but programs linked with such libtool
*** libraries will work regardless of this problem.  Nevertheless, you
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org

_LT_EOF
	  fi ;;
	esac
      fi
      break
    fi
  done
  IFS="$lt_save_ifs"
  MAGIC_CMD="$lt_save_MAGIC_CMD"
  ;;
esac
fi

MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
$as_echo "$MAGIC_CMD" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  else
    MAGIC_CMD=:
  fi
fi

  fi
  ;;
esac

# Use C for the default configuration in the libtool script

lt_save_CC="$CC"
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


# Source file extension for C test sources.
ac_ext=c

# Object file extension for compiled C test sources.
objext=o
objext=$objext

# Code to be used in simple compile tests
lt_simple_compile_test_code="int some_variable = 0;"

# Code to be used in simple link tests
lt_simple_link_test_code='int main(){return(0);}'







# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}

# If no C compiler flags were specified, use CFLAGS.
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}

# Allow CC to be a program name with arguments.
compiler=$CC

# Save the default compiler, since it gets overwritten when the other
# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
compiler_DEFAULT=$CC

# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$RM conftest*

ac_outfile=conftest.$ac_objext
echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
$RM -r conftest*


## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
## the running order or otherwise move them around unless you know exactly
## what you are doing...
if test -n "$compiler"; then

lt_prog_compiler_no_builtin_flag=

if test "$GCC" = yes; then
  case $cc_basename in
  nvcc*)
    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
  *)
    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
  esac

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_prog_compiler_rtti_exceptions=no
   ac_outfile=conftest.$ac_objext
   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
   lt_compiler_flag="-fno-rtti -fno-exceptions"
   # Insert the option either (1) after the last *FLAGS variable, or
   # (2) before a word containing "conftest.", or (3) at the end.
   # Note that $ac_compile itself does not contain backslashes and begins
   # with a dollar sign (not a hyphen), so the echo should work correctly.
   # The option is referenced via a variable to avoid confusing sed.
   lt_compile=`echo "$ac_compile" | $SED \
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   -e 's:$: $lt_compiler_flag:'`
   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
   (eval "$lt_compile" 2>conftest.err)
   ac_status=$?
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   if (exit $ac_status) && test -s "$ac_outfile"; then
     # The compiler can only warn and ignore the option if not recognized
     # So say no if there are warnings other than the usual output.
     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
       lt_cv_prog_compiler_rtti_exceptions=yes
     fi
   fi
   $RM conftest*

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }

if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
else
    :
fi

fi






  lt_prog_compiler_wl=
lt_prog_compiler_pic=
lt_prog_compiler_static=


  if test "$GCC" = yes; then
    lt_prog_compiler_wl='-Wl,'
    lt_prog_compiler_static='-static'

    case $host_os in
      aix*)
      # All AIX code is PIC.
      if test "$host_cpu" = ia64; then
	# AIX 5 now supports IA64 processor
	lt_prog_compiler_static='-Bstatic'
      fi
      ;;

    amigaos*)
      case $host_cpu in
      powerpc)
            # see comment about AmigaOS4 .so support
            lt_prog_compiler_pic='-fPIC'
        ;;
      m68k)
            # FIXME: we need at least 68020 code to build shared libraries, but
            # adding the `-m68020' flag to GCC prevents building anything better,
            # like `-m68040'.
            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
        ;;
      esac
      ;;

    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
      # PIC is the default for these OSes.
      ;;

    mingw* | cygwin* | pw32* | os2* | cegcc*)
      # This hack is so that the source file can tell whether it is being
      # built for inclusion in a dll (and should export symbols for example).
      # Although the cygwin gcc ignores -fPIC, still need this for old-style
      # (--disable-auto-import) libraries
      lt_prog_compiler_pic='-DDLL_EXPORT'
      ;;

    darwin* | rhapsody*)
      # PIC is the default on this platform
      # Common symbols not allowed in MH_DYLIB files
      lt_prog_compiler_pic='-fno-common'
      ;;

    haiku*)
      # PIC is the default for Haiku.
      # The "-static" flag exists, but is broken.
      lt_prog_compiler_static=
      ;;

    hpux*)
      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
      # sets the default TLS model and affects inlining.
      case $host_cpu in
      hppa*64*)
	# +Z the default
	;;
      *)
	lt_prog_compiler_pic='-fPIC'
	;;
      esac
      ;;

    interix[3-9]*)
      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
      # Instead, we relocate shared libraries at runtime.
      ;;

    msdosdjgpp*)
      # Just because we use GCC doesn't mean we suddenly get shared libraries
      # on systems that don't support them.
      lt_prog_compiler_can_build_shared=no
      enable_shared=no
      ;;

    *nto* | *qnx*)
      # QNX uses GNU C++, but need to define -shared option too, otherwise
      # it will coredump.
      lt_prog_compiler_pic='-fPIC -shared'
      ;;

    sysv4*MP*)
      if test -d /usr/nec; then
	lt_prog_compiler_pic=-Kconform_pic
      fi
      ;;

    *)
      lt_prog_compiler_pic='-fPIC'
      ;;
    esac

    case $cc_basename in
    nvcc*) # Cuda Compiler Driver 2.2
      lt_prog_compiler_wl='-Xlinker '
      lt_prog_compiler_pic='-Xcompiler -fPIC'
      ;;
    esac
  else
    # PORTME Check for flag to pass linker flags through the system compiler.
    case $host_os in
    aix*)
      lt_prog_compiler_wl='-Wl,'
      if test "$host_cpu" = ia64; then
	# AIX 5 now supports IA64 processor
	lt_prog_compiler_static='-Bstatic'
      else
	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
      fi
      ;;

    mingw* | cygwin* | pw32* | os2* | cegcc*)
      # This hack is so that the source file can tell whether it is being
      # built for inclusion in a dll (and should export symbols for example).
      lt_prog_compiler_pic='-DDLL_EXPORT'
      ;;

    hpux9* | hpux10* | hpux11*)
      lt_prog_compiler_wl='-Wl,'
      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
      # not for PA HP-UX.
      case $host_cpu in
      hppa*64*|ia64*)
	# +Z the default
	;;
      *)
	lt_prog_compiler_pic='+Z'
	;;
      esac
      # Is there a better lt_prog_compiler_static that works with the bundled CC?
      lt_prog_compiler_static='${wl}-a ${wl}archive'
      ;;

    irix5* | irix6* | nonstopux*)
      lt_prog_compiler_wl='-Wl,'
      # PIC (with -KPIC) is the default.
      lt_prog_compiler_static='-non_shared'
      ;;

    linux* | k*bsd*-gnu | kopensolaris*-gnu)
      case $cc_basename in
      # old Intel for x86_64 which still supported -KPIC.
      ecc*)
	lt_prog_compiler_wl='-Wl,'
	lt_prog_compiler_pic='-KPIC'
	lt_prog_compiler_static='-static'
        ;;
      # icc used to be incompatible with GCC.
      # ICC 10 doesn't accept -KPIC any more.
      icc* | ifort*)
	lt_prog_compiler_wl='-Wl,'
	lt_prog_compiler_pic='-fPIC'
	lt_prog_compiler_static='-static'
        ;;
      # Lahey Fortran 8.1.
      lf95*)
	lt_prog_compiler_wl='-Wl,'
	lt_prog_compiler_pic='--shared'
	lt_prog_compiler_static='--static'
	;;
      nagfor*)
	# NAG Fortran compiler
	lt_prog_compiler_wl='-Wl,-Wl,,'
	lt_prog_compiler_pic='-PIC'
	lt_prog_compiler_static='-Bstatic'
	;;
      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
        # Portland Group compilers (*not* the Pentium gcc compiler,
	# which looks to be a dead project)
	lt_prog_compiler_wl='-Wl,'
	lt_prog_compiler_pic='-fpic'
	lt_prog_compiler_static='-Bstatic'
        ;;
      ccc*)
        lt_prog_compiler_wl='-Wl,'
        # All Alpha code is PIC.
        lt_prog_compiler_static='-non_shared'
        ;;
      xl* | bgxl* | bgf* | mpixl*)
	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
	lt_prog_compiler_wl='-Wl,'
	lt_prog_compiler_pic='-qpic'
	lt_prog_compiler_static='-qstaticlink'
	;;
      *)
	case `$CC -V 2>&1 | sed 5q` in
	*Sun\ F* | *Sun*Fortran*)
	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
	  lt_prog_compiler_pic='-KPIC'
	  lt_prog_compiler_static='-Bstatic'
	  lt_prog_compiler_wl=''
	  ;;
	*Sun\ C*)
	  # Sun C 5.9
	  lt_prog_compiler_pic='-KPIC'
	  lt_prog_compiler_static='-Bstatic'
	  lt_prog_compiler_wl='-Wl,'
	  ;;
	esac
	;;
      esac
      ;;

    newsos6)
      lt_prog_compiler_pic='-KPIC'
      lt_prog_compiler_static='-Bstatic'
      ;;

    *nto* | *qnx*)
      # QNX uses GNU C++, but need to define -shared option too, otherwise
      # it will coredump.
      lt_prog_compiler_pic='-fPIC -shared'
      ;;

    osf3* | osf4* | osf5*)
      lt_prog_compiler_wl='-Wl,'
      # All OSF/1 code is PIC.
      lt_prog_compiler_static='-non_shared'
      ;;

    rdos*)
      lt_prog_compiler_static='-non_shared'
      ;;

    solaris*)
      lt_prog_compiler_pic='-KPIC'
      lt_prog_compiler_static='-Bstatic'
      case $cc_basename in
      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
	lt_prog_compiler_wl='-Qoption ld ';;
      *)
	lt_prog_compiler_wl='-Wl,';;
      esac
      ;;

    sunos4*)
      lt_prog_compiler_wl='-Qoption ld '
      lt_prog_compiler_pic='-PIC'
      lt_prog_compiler_static='-Bstatic'
      ;;

    sysv4 | sysv4.2uw2* | sysv4.3*)
      lt_prog_compiler_wl='-Wl,'
      lt_prog_compiler_pic='-KPIC'
      lt_prog_compiler_static='-Bstatic'
      ;;

    sysv4*MP*)
      if test -d /usr/nec ;then
	lt_prog_compiler_pic='-Kconform_pic'
	lt_prog_compiler_static='-Bstatic'
      fi
      ;;

    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
      lt_prog_compiler_wl='-Wl,'
      lt_prog_compiler_pic='-KPIC'
      lt_prog_compiler_static='-Bstatic'
      ;;

    unicos*)
      lt_prog_compiler_wl='-Wl,'
      lt_prog_compiler_can_build_shared=no
      ;;

    uts4*)
      lt_prog_compiler_pic='-pic'
      lt_prog_compiler_static='-Bstatic'
      ;;

    *)
      lt_prog_compiler_can_build_shared=no
      ;;
    esac
  fi

case $host_os in
  # For platforms which do not support PIC, -DPIC is meaningless:
  *djgpp*)
    lt_prog_compiler_pic=
    ;;
  *)
    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
    ;;
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
if ${lt_cv_prog_compiler_pic+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
$as_echo "$lt_cv_prog_compiler_pic" >&6; }
lt_prog_compiler_pic=$lt_cv_prog_compiler_pic

#
# Check to make sure the PIC flag actually works.
#
if test -n "$lt_prog_compiler_pic"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
if ${lt_cv_prog_compiler_pic_works+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_prog_compiler_pic_works=no
   ac_outfile=conftest.$ac_objext
   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
   # Insert the option either (1) after the last *FLAGS variable, or
   # (2) before a word containing "conftest.", or (3) at the end.
   # Note that $ac_compile itself does not contain backslashes and begins
   # with a dollar sign (not a hyphen), so the echo should work correctly.
   # The option is referenced via a variable to avoid confusing sed.
   lt_compile=`echo "$ac_compile" | $SED \
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   -e 's:$: $lt_compiler_flag:'`
   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
   (eval "$lt_compile" 2>conftest.err)
   ac_status=$?
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   if (exit $ac_status) && test -s "$ac_outfile"; then
     # The compiler can only warn and ignore the option if not recognized
     # So say no if there are warnings other than the usual output.
     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
       lt_cv_prog_compiler_pic_works=yes
     fi
   fi
   $RM conftest*

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }

if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
    case $lt_prog_compiler_pic in
     "" | " "*) ;;
     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
     esac
else
    lt_prog_compiler_pic=
     lt_prog_compiler_can_build_shared=no
fi

fi











#
# Check to make sure the static flag actually works.
#
wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
if ${lt_cv_prog_compiler_static_works+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_prog_compiler_static_works=no
   save_LDFLAGS="$LDFLAGS"
   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
   echo "$lt_simple_link_test_code" > conftest.$ac_ext
   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
     # The linker can only warn and ignore the option if not recognized
     # So say no if there are warnings
     if test -s conftest.err; then
       # Append any errors to the config.log.
       cat conftest.err 1>&5
       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
       if diff conftest.exp conftest.er2 >/dev/null; then
         lt_cv_prog_compiler_static_works=yes
       fi
     else
       lt_cv_prog_compiler_static_works=yes
     fi
   fi
   $RM -r conftest*
   LDFLAGS="$save_LDFLAGS"

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
$as_echo "$lt_cv_prog_compiler_static_works" >&6; }

if test x"$lt_cv_prog_compiler_static_works" = xyes; then
    :
else
    lt_prog_compiler_static=
fi







  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
if ${lt_cv_prog_compiler_c_o+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_prog_compiler_c_o=no
   $RM -r conftest 2>/dev/null
   mkdir conftest
   cd conftest
   mkdir out
   echo "$lt_simple_compile_test_code" > conftest.$ac_ext

   lt_compiler_flag="-o out/conftest2.$ac_objext"
   # Insert the option either (1) after the last *FLAGS variable, or
   # (2) before a word containing "conftest.", or (3) at the end.
   # Note that $ac_compile itself does not contain backslashes and begins
   # with a dollar sign (not a hyphen), so the echo should work correctly.
   lt_compile=`echo "$ac_compile" | $SED \
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   -e 's:$: $lt_compiler_flag:'`
   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
   (eval "$lt_compile" 2>out/conftest.err)
   ac_status=$?
   cat out/conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
   then
     # The compiler can only warn and ignore the option if not recognized
     # So say no if there are warnings
     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
       lt_cv_prog_compiler_c_o=yes
     fi
   fi
   chmod u+w . 2>&5
   $RM conftest*
   # SGI C++ compiler will create directory out/ii_files/ for
   # template instantiation
   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
   $RM out/* && rmdir out
   cd ..
   $RM -r conftest
   $RM conftest*

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
$as_echo "$lt_cv_prog_compiler_c_o" >&6; }






  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
if ${lt_cv_prog_compiler_c_o+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_prog_compiler_c_o=no
   $RM -r conftest 2>/dev/null
   mkdir conftest
   cd conftest
   mkdir out
   echo "$lt_simple_compile_test_code" > conftest.$ac_ext

   lt_compiler_flag="-o out/conftest2.$ac_objext"
   # Insert the option either (1) after the last *FLAGS variable, or
   # (2) before a word containing "conftest.", or (3) at the end.
   # Note that $ac_compile itself does not contain backslashes and begins
   # with a dollar sign (not a hyphen), so the echo should work correctly.
   lt_compile=`echo "$ac_compile" | $SED \
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   -e 's:$: $lt_compiler_flag:'`
   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
   (eval "$lt_compile" 2>out/conftest.err)
   ac_status=$?
   cat out/conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
   then
     # The compiler can only warn and ignore the option if not recognized
     # So say no if there are warnings
     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
       lt_cv_prog_compiler_c_o=yes
     fi
   fi
   chmod u+w . 2>&5
   $RM conftest*
   # SGI C++ compiler will create directory out/ii_files/ for
   # template instantiation
   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
   $RM out/* && rmdir out
   cd ..
   $RM -r conftest
   $RM conftest*

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
$as_echo "$lt_cv_prog_compiler_c_o" >&6; }




hard_links="nottested"
if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
  # do not overwrite the value of need_locks provided by the user
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
$as_echo_n "checking if we can lock with hard links... " >&6; }
  hard_links=yes
  $RM conftest*
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
  touch conftest.a
  ln conftest.a conftest.b 2>&5 || hard_links=no
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
$as_echo "$hard_links" >&6; }
  if test "$hard_links" = no; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
    need_locks=warn
  fi
else
  need_locks=no
fi






  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }

  runpath_var=
  allow_undefined_flag=
  always_export_symbols=no
  archive_cmds=
  archive_expsym_cmds=
  compiler_needs_object=no
  enable_shared_with_static_runtimes=no
  export_dynamic_flag_spec=
  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
  hardcode_automatic=no
  hardcode_direct=no
  hardcode_direct_absolute=no
  hardcode_libdir_flag_spec=
  hardcode_libdir_flag_spec_ld=
  hardcode_libdir_separator=
  hardcode_minus_L=no
  hardcode_shlibpath_var=unsupported
  inherit_rpath=no
  link_all_deplibs=unknown
  module_cmds=
  module_expsym_cmds=
  old_archive_from_new_cmds=
  old_archive_from_expsyms_cmds=
  thread_safe_flag_spec=
  whole_archive_flag_spec=
  # include_expsyms should be a list of space-separated symbols to be *always*
  # included in the symbol list
  include_expsyms=
  # exclude_expsyms can be an extended regexp of symbols to exclude
  # it will be wrapped by ` (' and `)$', so one must not match beginning or
  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  # as well as any symbol that contains `d'.
  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
  # platforms (ab)use it in PIC code, but their linkers get confused if
  # the symbol is explicitly referenced.  Since portable code cannot
  # rely on this symbol name, it's probably fine to never include it in
  # preloaded symbol tables.
  # Exclude shared library initialization/finalization symbols.
  extract_expsyms_cmds=

  case $host_os in
  cygwin* | mingw* | pw32* | cegcc*)
    # FIXME: the MSVC++ port hasn't been tested in a loooong time
    # When not using gcc, we currently assume that we are using
    # Microsoft Visual C++.
    if test "$GCC" != yes; then
      with_gnu_ld=no
    fi
    ;;
  interix*)
    # we just hope/assume this is gcc and not c89 (= MSVC++)
    with_gnu_ld=yes
    ;;
  openbsd*)
    with_gnu_ld=no
    ;;
  esac

  ld_shlibs=yes

  # On some targets, GNU ld is compatible enough with the native linker
  # that we're better off using the native interface for both.
  lt_use_gnu_ld_interface=no
  if test "$with_gnu_ld" = yes; then
    case $host_os in
      aix*)
	# The AIX port of GNU ld has always aspired to compatibility
	# with the native linker.  However, as the warning in the GNU ld
	# block says, versions before 2.19.5* couldn't really create working
	# shared libraries, regardless of the interface used.
	case `$LD -v 2>&1` in
	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
	  *)
	    lt_use_gnu_ld_interface=yes
	    ;;
	esac
	;;
      *)
	lt_use_gnu_ld_interface=yes
	;;
    esac
  fi

  if test "$lt_use_gnu_ld_interface" = yes; then
    # If archive_cmds runs LD, not CC, wlarc should be empty
    wlarc='${wl}'

    # Set some defaults for GNU ld with shared library support. These
    # are reset later if shared libraries are not supported. Putting them
    # here allows them to be overridden if necessary.
    runpath_var=LD_RUN_PATH
    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
    export_dynamic_flag_spec='${wl}--export-dynamic'
    # ancient GNU ld didn't support --whole-archive et. al.
    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
    else
      whole_archive_flag_spec=
    fi
    supports_anon_versioning=no
    case `$LD -v 2>&1` in
      *GNU\ gold*) supports_anon_versioning=yes ;;
      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
      *\ 2.11.*) ;; # other 2.11 versions
      *) supports_anon_versioning=yes ;;
    esac

    # See if GNU ld supports shared libraries.
    case $host_os in
    aix[3-9]*)
      # On AIX/PPC, the GNU linker is very broken
      if test "$host_cpu" != ia64; then
	ld_shlibs=no
	cat <<_LT_EOF 1>&2

*** Warning: the GNU linker, at least up to release 2.19, is reported
*** to be unable to reliably create shared libraries on AIX.
*** Therefore, libtool is disabling shared libraries support.  If you
*** really care for shared libraries, you may want to install binutils
*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
*** You will then need to restart the configuration process.

_LT_EOF
      fi
      ;;

    amigaos*)
      case $host_cpu in
      powerpc)
            # see comment about AmigaOS4 .so support
            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
            archive_expsym_cmds=''
        ;;
      m68k)
            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
            hardcode_libdir_flag_spec='-L$libdir'
            hardcode_minus_L=yes
        ;;
      esac
      ;;

    beos*)
      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
	allow_undefined_flag=unsupported
	# Joseph Beckenbach  says some releases of gcc
	# support --undefined.  This deserves some investigation.  FIXME
	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
      else
	ld_shlibs=no
      fi
      ;;

    cygwin* | mingw* | pw32* | cegcc*)
      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
      # as there is no search path for DLLs.
      hardcode_libdir_flag_spec='-L$libdir'
      export_dynamic_flag_spec='${wl}--export-all-symbols'
      allow_undefined_flag=unsupported
      always_export_symbols=no
      enable_shared_with_static_runtimes=yes
      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'

      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
	# If the export-symbols file already is a .def file (1st line
	# is EXPORTS), use it as is; otherwise, prepend...
	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
	  cp $export_symbols $output_objdir/$soname.def;
	else
	  echo EXPORTS > $output_objdir/$soname.def;
	  cat $export_symbols >> $output_objdir/$soname.def;
	fi~
	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
      else
	ld_shlibs=no
      fi
      ;;

    haiku*)
      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
      link_all_deplibs=yes
      ;;

    interix[3-9]*)
      hardcode_direct=no
      hardcode_shlibpath_var=no
      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
      export_dynamic_flag_spec='${wl}-E'
      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
      # Instead, shared libraries are loaded at an image base (0x10000000 by
      # default) and relocated if they conflict, which is a slow very memory
      # consuming and fragmenting process.  To avoid this, we pick a random,
      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
      ;;

    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
      tmp_diet=no
      if test "$host_os" = linux-dietlibc; then
	case $cc_basename in
	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
	esac
      fi
      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
	 && test "$tmp_diet" = no
      then
	tmp_addflag=' $pic_flag'
	tmp_sharedflag='-shared'
	case $cc_basename,$host_cpu in
        pgcc*)				# Portland Group C compiler
	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
	  tmp_addflag=' $pic_flag'
	  ;;
	pgf77* | pgf90* | pgf95* | pgfortran*)
					# Portland Group f77 and f90 compilers
	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
	  tmp_addflag=' $pic_flag -Mnomain' ;;
	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
	  tmp_addflag=' -i_dynamic' ;;
	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
	  tmp_addflag=' -i_dynamic -nofor_main' ;;
	ifc* | ifort*)			# Intel Fortran compiler
	  tmp_addflag=' -nofor_main' ;;
	lf95*)				# Lahey Fortran 8.1
	  whole_archive_flag_spec=
	  tmp_sharedflag='--shared' ;;
	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
	  tmp_sharedflag='-qmkshrobj'
	  tmp_addflag= ;;
	nvcc*)	# Cuda Compiler Driver 2.2
	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
	  compiler_needs_object=yes
	  ;;
	esac
	case `$CC -V 2>&1 | sed 5q` in
	*Sun\ C*)			# Sun C 5.9
	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
	  compiler_needs_object=yes
	  tmp_sharedflag='-G' ;;
	*Sun\ F*)			# Sun Fortran 8.3
	  tmp_sharedflag='-G' ;;
	esac
	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'

        if test "x$supports_anon_versioning" = xyes; then
          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
	    echo "local: *; };" >> $output_objdir/$libname.ver~
	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
        fi

	case $cc_basename in
	xlf* | bgf* | bgxlf* | mpixlf*)
	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
	  hardcode_libdir_flag_spec=
	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
	  if test "x$supports_anon_versioning" = xyes; then
	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
	      echo "local: *; };" >> $output_objdir/$libname.ver~
	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
	  fi
	  ;;
	esac
      else
        ld_shlibs=no
      fi
      ;;

    netbsd*)
      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
	wlarc=
      else
	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
      fi
      ;;

    solaris*)
      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
	ld_shlibs=no
	cat <<_LT_EOF 1>&2

*** Warning: The releases 2.8.* of the GNU linker cannot reliably
*** create shared libraries on Solaris systems.  Therefore, libtool
*** is disabling shared libraries support.  We urge you to upgrade GNU
*** binutils to release 2.9.1 or newer.  Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.

_LT_EOF
      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
      else
	ld_shlibs=no
      fi
      ;;

    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
      case `$LD -v 2>&1` in
        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
	ld_shlibs=no
	cat <<_LT_EOF 1>&2

*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
*** reliably create shared libraries on SCO systems.  Therefore, libtool
*** is disabling shared libraries support.  We urge you to upgrade GNU
*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.

_LT_EOF
	;;
	*)
	  # For security reasons, it is highly recommended that you always
	  # use absolute paths for naming shared libraries, and exclude the
	  # DT_RUNPATH tag from executables and libraries.  But doing so
	  # requires that you compile everything twice, which is a pain.
	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
	  else
	    ld_shlibs=no
	  fi
	;;
      esac
      ;;

    sunos4*)
      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
      wlarc=
      hardcode_direct=yes
      hardcode_shlibpath_var=no
      ;;

    *)
      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
      else
	ld_shlibs=no
      fi
      ;;
    esac

    if test "$ld_shlibs" = no; then
      runpath_var=
      hardcode_libdir_flag_spec=
      export_dynamic_flag_spec=
      whole_archive_flag_spec=
    fi
  else
    # PORTME fill in a description of your system's linker (not GNU ld)
    case $host_os in
    aix3*)
      allow_undefined_flag=unsupported
      always_export_symbols=yes
      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
      # Note: this linker hardcodes the directories in LIBPATH if there
      # are no directories specified by -L.
      hardcode_minus_L=yes
      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
	# Neither direct hardcoding nor static linking is supported with a
	# broken collect2.
	hardcode_direct=unsupported
      fi
      ;;

    aix[4-9]*)
      if test "$host_cpu" = ia64; then
	# On IA64, the linker does run time linking by default, so we don't
	# have to do anything special.
	aix_use_runtimelinking=no
	exp_sym_flag='-Bexport'
	no_entry_flag=""
      else
	# If we're using GNU nm, then we don't want the "-C" option.
	# -C means demangle to AIX nm, but means don't demangle with GNU nm
	# Also, AIX nm treats weak defined symbols like other global
	# defined symbols, whereas GNU nm marks them as "W".
	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
	else
	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
	fi
	aix_use_runtimelinking=no

	# Test if we are trying to use run time linking or normal
	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
	# need to do runtime linking.
	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
	  for ld_flag in $LDFLAGS; do
	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
	    aix_use_runtimelinking=yes
	    break
	  fi
	  done
	  ;;
	esac

	exp_sym_flag='-bexport'
	no_entry_flag='-bnoentry'
      fi

      # When large executables or shared objects are built, AIX ld can
      # have problems creating the table of contents.  If linking a library
      # or program results in "error TOC overflow" add -mminimal-toc to
      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.

      archive_cmds=''
      hardcode_direct=yes
      hardcode_direct_absolute=yes
      hardcode_libdir_separator=':'
      link_all_deplibs=yes
      file_list_spec='${wl}-f,'

      if test "$GCC" = yes; then
	case $host_os in aix4.[012]|aix4.[012].*)
	# We only want to do this on AIX 4.2 and lower, the check
	# below for broken collect2 doesn't work under 4.3+
	  collect2name=`${CC} -print-prog-name=collect2`
	  if test -f "$collect2name" &&
	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
	  then
	  # We have reworked collect2
	  :
	  else
	  # We have old collect2
	  hardcode_direct=unsupported
	  # It fails to find uninstalled libraries when the uninstalled
	  # path is not listed in the libpath.  Setting hardcode_minus_L
	  # to unsupported forces relinking
	  hardcode_minus_L=yes
	  hardcode_libdir_flag_spec='-L$libdir'
	  hardcode_libdir_separator=
	  fi
	  ;;
	esac
	shared_flag='-shared'
	if test "$aix_use_runtimelinking" = yes; then
	  shared_flag="$shared_flag "'${wl}-G'
	fi
      else
	# not using gcc
	if test "$host_cpu" = ia64; then
	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
	# chokes on -Wl,-G. The following line is correct:
	  shared_flag='-G'
	else
	  if test "$aix_use_runtimelinking" = yes; then
	    shared_flag='${wl}-G'
	  else
	    shared_flag='${wl}-bM:SRE'
	  fi
	fi
      fi

      export_dynamic_flag_spec='${wl}-bexpall'
      # It seems that -bexpall does not export symbols beginning with
      # underscore (_), so it is better to generate a list of symbols to export.
      always_export_symbols=yes
      if test "$aix_use_runtimelinking" = yes; then
	# Warning - without using the other runtime loading flags (-brtl),
	# -berok will link without error, but may produce a broken library.
	allow_undefined_flag='-berok'
        # Determine the default libpath from the value encoded in an
        # empty executable.
        if test "${lt_cv_aix_libpath+set}" = set; then
  aix_libpath=$lt_cv_aix_libpath
else
  if ${lt_cv_aix_libpath_+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :

  lt_aix_libpath_sed='
      /Import File Strings/,/^$/ {
	  /^0/ {
	      s/^0  *\([^ ]*\) *$/\1/
	      p
	  }
      }'
  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
  # Check for a 64-bit object if we didn't find anything.
  if test -z "$lt_cv_aix_libpath_"; then
    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
  fi
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
  if test -z "$lt_cv_aix_libpath_"; then
    lt_cv_aix_libpath_="/usr/lib:/lib"
  fi

fi

  aix_libpath=$lt_cv_aix_libpath_
fi

        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
      else
	if test "$host_cpu" = ia64; then
	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
	  allow_undefined_flag="-z nodefs"
	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
	else
	 # Determine the default libpath from the value encoded in an
	 # empty executable.
	 if test "${lt_cv_aix_libpath+set}" = set; then
  aix_libpath=$lt_cv_aix_libpath
else
  if ${lt_cv_aix_libpath_+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :

  lt_aix_libpath_sed='
      /Import File Strings/,/^$/ {
	  /^0/ {
	      s/^0  *\([^ ]*\) *$/\1/
	      p
	  }
      }'
  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
  # Check for a 64-bit object if we didn't find anything.
  if test -z "$lt_cv_aix_libpath_"; then
    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
  fi
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
  if test -z "$lt_cv_aix_libpath_"; then
    lt_cv_aix_libpath_="/usr/lib:/lib"
  fi

fi

  aix_libpath=$lt_cv_aix_libpath_
fi

	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
	  # Warning - without using the other run time loading flags,
	  # -berok will link without error, but may produce a broken library.
	  no_undefined_flag=' ${wl}-bernotok'
	  allow_undefined_flag=' ${wl}-berok'
	  if test "$with_gnu_ld" = yes; then
	    # We only use this code for GNU lds that support --whole-archive.
	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
	  else
	    # Exported symbols can be pulled into shared objects from archives
	    whole_archive_flag_spec='$convenience'
	  fi
	  archive_cmds_need_lc=yes
	  # This is similar to how AIX traditionally builds its shared libraries.
	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
	fi
      fi
      ;;

    amigaos*)
      case $host_cpu in
      powerpc)
            # see comment about AmigaOS4 .so support
            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
            archive_expsym_cmds=''
        ;;
      m68k)
            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
            hardcode_libdir_flag_spec='-L$libdir'
            hardcode_minus_L=yes
        ;;
      esac
      ;;

    bsdi[45]*)
      export_dynamic_flag_spec=-rdynamic
      ;;

    cygwin* | mingw* | pw32* | cegcc*)
      # When not using gcc, we currently assume that we are using
      # Microsoft Visual C++.
      # hardcode_libdir_flag_spec is actually meaningless, as there is
      # no search path for DLLs.
      case $cc_basename in
      cl*)
	# Native MSVC
	hardcode_libdir_flag_spec=' '
	allow_undefined_flag=unsupported
	always_export_symbols=yes
	file_list_spec='@'
	# Tell ltmain to make .lib files, not .a files.
	libext=lib
	# Tell ltmain to make .dll files, not .so files.
	shrext_cmds=".dll"
	# FIXME: Setting linknames here is a bad hack.
	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
	  else
	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
	  fi~
	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
	  linknames='
	# The linker will not automatically build a static lib if we build a DLL.
	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
	enable_shared_with_static_runtimes=yes
	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
	# Don't use ranlib
	old_postinstall_cmds='chmod 644 $oldlib'
	postlink_cmds='lt_outputfile="@OUTPUT@"~
	  lt_tool_outputfile="@TOOL_OUTPUT@"~
	  case $lt_outputfile in
	    *.exe|*.EXE) ;;
	    *)
	      lt_outputfile="$lt_outputfile.exe"
	      lt_tool_outputfile="$lt_tool_outputfile.exe"
	      ;;
	  esac~
	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
	    $RM "$lt_outputfile.manifest";
	  fi'
	;;
      *)
	# Assume MSVC wrapper
	hardcode_libdir_flag_spec=' '
	allow_undefined_flag=unsupported
	# Tell ltmain to make .lib files, not .a files.
	libext=lib
	# Tell ltmain to make .dll files, not .so files.
	shrext_cmds=".dll"
	# FIXME: Setting linknames here is a bad hack.
	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
	# The linker will automatically build a .lib file if we build a DLL.
	old_archive_from_new_cmds='true'
	# FIXME: Should let the user specify the lib program.
	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
	enable_shared_with_static_runtimes=yes
	;;
      esac
      ;;

    darwin* | rhapsody*)


  archive_cmds_need_lc=no
  hardcode_direct=no
  hardcode_automatic=yes
  hardcode_shlibpath_var=unsupported
  if test "$lt_cv_ld_force_load" = "yes"; then
    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
  else
    whole_archive_flag_spec=''
  fi
  link_all_deplibs=yes
  allow_undefined_flag="$_lt_dar_allow_undefined"
  case $cc_basename in
     ifort*) _lt_dar_can_shared=yes ;;
     *) _lt_dar_can_shared=$GCC ;;
  esac
  if test "$_lt_dar_can_shared" = "yes"; then
    output_verbose_link_cmd=func_echo_all
    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"

  else
  ld_shlibs=no
  fi

      ;;

    dgux*)
      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_shlibpath_var=no
      ;;

    freebsd1*)
      ld_shlibs=no
      ;;

    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
    # support.  Future versions do this automatically, but an explicit c++rt0.o
    # does not break anything, and helps significantly (at the cost of a little
    # extra space).
    freebsd2.2*)
      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      hardcode_shlibpath_var=no
      ;;

    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
    freebsd2*)
      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
      hardcode_direct=yes
      hardcode_minus_L=yes
      hardcode_shlibpath_var=no
      ;;

    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
    freebsd* | dragonfly*)
      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      hardcode_shlibpath_var=no
      ;;

    hpux9*)
      if test "$GCC" = yes; then
	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
      else
	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
      fi
      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
      hardcode_libdir_separator=:
      hardcode_direct=yes

      # hardcode_minus_L: Not really in the search PATH,
      # but as the default location of the library.
      hardcode_minus_L=yes
      export_dynamic_flag_spec='${wl}-E'
      ;;

    hpux10*)
      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
      else
	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
      fi
      if test "$with_gnu_ld" = no; then
	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
	hardcode_libdir_flag_spec_ld='+b $libdir'
	hardcode_libdir_separator=:
	hardcode_direct=yes
	hardcode_direct_absolute=yes
	export_dynamic_flag_spec='${wl}-E'
	# hardcode_minus_L: Not really in the search PATH,
	# but as the default location of the library.
	hardcode_minus_L=yes
      fi
      ;;

    hpux11*)
      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
	case $host_cpu in
	hppa*64*)
	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
	  ;;
	ia64*)
	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
	  ;;
	*)
	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
	  ;;
	esac
      else
	case $host_cpu in
	hppa*64*)
	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
	  ;;
	ia64*)
	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
	  ;;
	*)

	  # Older versions of the 11.00 compiler do not understand -b yet
	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
$as_echo_n "checking if $CC understands -b... " >&6; }
if ${lt_cv_prog_compiler__b+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_prog_compiler__b=no
   save_LDFLAGS="$LDFLAGS"
   LDFLAGS="$LDFLAGS -b"
   echo "$lt_simple_link_test_code" > conftest.$ac_ext
   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
     # The linker can only warn and ignore the option if not recognized
     # So say no if there are warnings
     if test -s conftest.err; then
       # Append any errors to the config.log.
       cat conftest.err 1>&5
       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
       if diff conftest.exp conftest.er2 >/dev/null; then
         lt_cv_prog_compiler__b=yes
       fi
     else
       lt_cv_prog_compiler__b=yes
     fi
   fi
   $RM -r conftest*
   LDFLAGS="$save_LDFLAGS"

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
$as_echo "$lt_cv_prog_compiler__b" >&6; }

if test x"$lt_cv_prog_compiler__b" = xyes; then
    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi

	  ;;
	esac
      fi
      if test "$with_gnu_ld" = no; then
	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
	hardcode_libdir_separator=:

	case $host_cpu in
	hppa*64*|ia64*)
	  hardcode_direct=no
	  hardcode_shlibpath_var=no
	  ;;
	*)
	  hardcode_direct=yes
	  hardcode_direct_absolute=yes
	  export_dynamic_flag_spec='${wl}-E'

	  # hardcode_minus_L: Not really in the search PATH,
	  # but as the default location of the library.
	  hardcode_minus_L=yes
	  ;;
	esac
      fi
      ;;

    irix5* | irix6* | nonstopux*)
      if test "$GCC" = yes; then
	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
	# Try to use the -exported_symbol ld option, if it does not
	# work, assume that -exports_file does not work either and
	# implicitly export all symbols.
	# This should be the same for all languages, so no per-tag cache variable.
	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
if ${lt_cv_irix_exported_symbol+:} false; then :
  $as_echo_n "(cached) " >&6
else
  save_LDFLAGS="$LDFLAGS"
	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
int foo (void) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  lt_cv_irix_exported_symbol=yes
else
  lt_cv_irix_exported_symbol=no
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
           LDFLAGS="$save_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
$as_echo "$lt_cv_irix_exported_symbol" >&6; }
	if test "$lt_cv_irix_exported_symbol" = yes; then
          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
	fi
      else
	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
      fi
      archive_cmds_need_lc='no'
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      inherit_rpath=yes
      link_all_deplibs=yes
      ;;

    netbsd*)
      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
      else
	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
      fi
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      hardcode_shlibpath_var=no
      ;;

    newsos6)
      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
      hardcode_direct=yes
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      hardcode_shlibpath_var=no
      ;;

    *nto* | *qnx*)
      ;;

    openbsd*)
      if test -f /usr/libexec/ld.so; then
	hardcode_direct=yes
	hardcode_shlibpath_var=no
	hardcode_direct_absolute=yes
	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
	  export_dynamic_flag_spec='${wl}-E'
	else
	  case $host_os in
	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
	     hardcode_libdir_flag_spec='-R$libdir'
	     ;;
	   *)
	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
	     ;;
	  esac
	fi
      else
	ld_shlibs=no
      fi
      ;;

    os2*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_minus_L=yes
      allow_undefined_flag=unsupported
      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
      ;;

    osf3*)
      if test "$GCC" = yes; then
	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
      else
	allow_undefined_flag=' -expect_unresolved \*'
	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
      fi
      archive_cmds_need_lc='no'
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;

    osf4* | osf5*)	# as osf3* with the addition of -msym flag
      if test "$GCC" = yes; then
	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      else
	allow_undefined_flag=' -expect_unresolved \*'
	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'

	# Both c and cxx compiler support -rpath directly
	hardcode_libdir_flag_spec='-rpath $libdir'
      fi
      archive_cmds_need_lc='no'
      hardcode_libdir_separator=:
      ;;

    solaris*)
      no_undefined_flag=' -z defs'
      if test "$GCC" = yes; then
	wlarc='${wl}'
	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
      else
	case `$CC -V 2>&1` in
	*"Compilers 5.0"*)
	  wlarc=''
	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
	  ;;
	*)
	  wlarc='${wl}'
	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
	  ;;
	esac
      fi
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_shlibpath_var=no
      case $host_os in
      solaris2.[0-5] | solaris2.[0-5].*) ;;
      *)
	# The compiler driver will combine and reorder linker options,
	# but understands `-z linker_flag'.  GCC discards it without `$wl',
	# but is careful enough not to reorder.
	# Supported since Solaris 2.6 (maybe 2.5.1?)
	if test "$GCC" = yes; then
	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
	else
	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
	fi
	;;
      esac
      link_all_deplibs=yes
      ;;

    sunos4*)
      if test "x$host_vendor" = xsequent; then
	# Use $CC to link under sequent, because it throws in some extra .o
	# files that make .init and .fini sections work.
	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
      else
	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
      fi
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_direct=yes
      hardcode_minus_L=yes
      hardcode_shlibpath_var=no
      ;;

    sysv4)
      case $host_vendor in
	sni)
	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
	  hardcode_direct=yes # is this really true???
	;;
	siemens)
	  ## LD is ld it makes a PLAMLIB
	  ## CC just makes a GrossModule.
	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
	  reload_cmds='$CC -r -o $output$reload_objs'
	  hardcode_direct=no
        ;;
	motorola)
	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
	;;
      esac
      runpath_var='LD_RUN_PATH'
      hardcode_shlibpath_var=no
      ;;

    sysv4.3*)
      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
      hardcode_shlibpath_var=no
      export_dynamic_flag_spec='-Bexport'
      ;;

    sysv4*MP*)
      if test -d /usr/nec; then
	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
	hardcode_shlibpath_var=no
	runpath_var=LD_RUN_PATH
	hardcode_runpath_var=yes
	ld_shlibs=yes
      fi
      ;;

    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
      no_undefined_flag='${wl}-z,text'
      archive_cmds_need_lc=no
      hardcode_shlibpath_var=no
      runpath_var='LD_RUN_PATH'

      if test "$GCC" = yes; then
	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
      else
	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
      fi
      ;;

    sysv5* | sco3.2v5* | sco5v6*)
      # Note: We can NOT use -z defs as we might desire, because we do not
      # link with -lc, and that would cause any symbols used from libc to
      # always be unresolved, which means just about no library would
      # ever link correctly.  If we're not using GNU ld we use -z text
      # though, which does catch some bad symbols but isn't as heavy-handed
      # as -z defs.
      no_undefined_flag='${wl}-z,text'
      allow_undefined_flag='${wl}-z,nodefs'
      archive_cmds_need_lc=no
      hardcode_shlibpath_var=no
      hardcode_libdir_flag_spec='${wl}-R,$libdir'
      hardcode_libdir_separator=':'
      link_all_deplibs=yes
      export_dynamic_flag_spec='${wl}-Bexport'
      runpath_var='LD_RUN_PATH'

      if test "$GCC" = yes; then
	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
      else
	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
      fi
      ;;

    uts4*)
      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_shlibpath_var=no
      ;;

    *)
      ld_shlibs=no
      ;;
    esac

    if test x$host_vendor = xsni; then
      case $host in
      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
	export_dynamic_flag_spec='${wl}-Blargedynsym'
	;;
      esac
    fi
  fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
$as_echo "$ld_shlibs" >&6; }
test "$ld_shlibs" = no && can_build_shared=no

with_gnu_ld=$with_gnu_ld















#
# Do we need to explicitly link libc?
#
case "x$archive_cmds_need_lc" in
x|xyes)
  # Assume -lc should be added
  archive_cmds_need_lc=yes

  if test "$enable_shared" = yes && test "$GCC" = yes; then
    case $archive_cmds in
    *'~'*)
      # FIXME: we may have to deal with multi-command sequences.
      ;;
    '$CC '*)
      # Test whether the compiler implicitly links with -lc since on some
      # systems, -lgcc has to come before -lc. If gcc already passes -lc
      # to ld, don't add -lc before -lgcc.
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
if ${lt_cv_archive_cmds_need_lc+:} false; then :
  $as_echo_n "(cached) " >&6
else
  $RM conftest*
	echo "$lt_simple_compile_test_code" > conftest.$ac_ext

	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } 2>conftest.err; then
	  soname=conftest
	  lib=conftest
	  libobjs=conftest.$ac_objext
	  deplibs=
	  wl=$lt_prog_compiler_wl
	  pic_flag=$lt_prog_compiler_pic
	  compiler_flags=-v
	  linker_flags=-v
	  verstring=
	  output_objdir=.
	  libname=conftest
	  lt_save_allow_undefined_flag=$allow_undefined_flag
	  allow_undefined_flag=
	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }
	  then
	    lt_cv_archive_cmds_need_lc=no
	  else
	    lt_cv_archive_cmds_need_lc=yes
	  fi
	  allow_undefined_flag=$lt_save_allow_undefined_flag
	else
	  cat conftest.err 1>&5
	fi
	$RM conftest*

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
      ;;
    esac
  fi
  ;;
esac





























































































































































  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
$as_echo_n "checking dynamic linker characteristics... " >&6; }

if test "$GCC" = yes; then
  case $host_os in
    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
    *) lt_awk_arg="/^libraries:/" ;;
  esac
  case $host_os in
    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
    *) lt_sed_strip_eq="s,=/,/,g" ;;
  esac
  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
  case $lt_search_path_spec in
  *\;*)
    # if the path contains ";" then we assume it to be the separator
    # otherwise default to the standard path separator (i.e. ":") - it is
    # assumed that no part of a normal pathname contains ";" but that should
    # okay in the real world where ";" in dirpaths is itself problematic.
    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
    ;;
  *)
    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
    ;;
  esac
  # Ok, now we have the path, separated by spaces, we can step through it
  # and add multilib dir if necessary.
  lt_tmp_lt_search_path_spec=
  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
  for lt_sys_path in $lt_search_path_spec; do
    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
    else
      test -d "$lt_sys_path" && \
	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
    fi
  done
  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
BEGIN {RS=" "; FS="/|\n";} {
  lt_foo="";
  lt_count=0;
  for (lt_i = NF; lt_i > 0; lt_i--) {
    if ($lt_i != "" && $lt_i != ".") {
      if ($lt_i == "..") {
        lt_count++;
      } else {
        if (lt_count == 0) {
          lt_foo="/" $lt_i lt_foo;
        } else {
          lt_count--;
        }
      }
    }
  }
  if (lt_foo != "") { lt_freq[lt_foo]++; }
  if (lt_freq[lt_foo] == 1) { print lt_foo; }
}'`
  # AWK program above erroneously prepends '/' to C:/dos/paths
  # for these hosts.
  case $host_os in
    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
  esac
  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
else
  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi
library_names_spec=
libname_spec='lib$name'
soname_spec=
shrext_cmds=".so"
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
finish_eval=
shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
need_lib_prefix=unknown
hardcode_into_libs=no

# when you set need_version to no, make sure it does not cause -set_version
# flags to be left without arguments
need_version=unknown

case $host_os in
aix3*)
  version_type=linux
  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
  shlibpath_var=LIBPATH

  # AIX 3 has no versioning support, so we append a major version to the name.
  soname_spec='${libname}${release}${shared_ext}$major'
  ;;

aix[4-9]*)
  version_type=linux
  need_lib_prefix=no
  need_version=no
  hardcode_into_libs=yes
  if test "$host_cpu" = ia64; then
    # AIX 5 supports IA64
    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
    shlibpath_var=LD_LIBRARY_PATH
  else
    # With GCC up to 2.95.x, collect2 would create an import file
    # for dependence libraries.  The import file would start with
    # the line `#! .'.  This would cause the generated library to
    # depend on `.', always an invalid library.  This was fixed in
    # development snapshots of GCC prior to 3.0.
    case $host_os in
      aix4 | aix4.[01] | aix4.[01].*)
      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
	   echo ' yes '
	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
	:
      else
	can_build_shared=no
      fi
      ;;
    esac
    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
    # soname into executable. Probably we can add versioning support to
    # collect2, so additional links can be useful in future.
    if test "$aix_use_runtimelinking" = yes; then
      # If using run time linking (on AIX 4.2 or later) use lib.so
      # instead of lib.a to let people know that these are not
      # typical AIX shared libraries.
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
    else
      # We preserve .a as extension for shared libraries through AIX4.2
      # and later when we are not doing run time linking.
      library_names_spec='${libname}${release}.a $libname.a'
      soname_spec='${libname}${release}${shared_ext}$major'
    fi
    shlibpath_var=LIBPATH
  fi
  ;;

amigaos*)
  case $host_cpu in
  powerpc)
    # Since July 2007 AmigaOS4 officially supports .so libraries.
    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
    ;;
  m68k)
    library_names_spec='$libname.ixlibrary $libname.a'
    # Create ${libname}_ixlibrary.a entries in /sys/libs.
    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
    ;;
  esac
  ;;

beos*)
  library_names_spec='${libname}${shared_ext}'
  dynamic_linker="$host_os ld.so"
  shlibpath_var=LIBRARY_PATH
  ;;

bsdi[45]*)
  version_type=linux
  need_version=no
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  soname_spec='${libname}${release}${shared_ext}$major'
  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
  shlibpath_var=LD_LIBRARY_PATH
  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  # the default ld.so.conf also contains /usr/contrib/lib and
  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  # libtool to hard-code these into programs
  ;;

cygwin* | mingw* | pw32* | cegcc*)
  version_type=windows
  shrext_cmds=".dll"
  need_version=no
  need_lib_prefix=no

  case $GCC,$cc_basename in
  yes,*)
    # gcc
    library_names_spec='$libname.dll.a'
    # DLL is installed to $(libdir)/../bin by postinstall_cmds
    postinstall_cmds='base_file=`basename \${file}`~
      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
      dldir=$destdir/`dirname \$dlpath`~
      test -d \$dldir || mkdir -p \$dldir~
      $install_prog $dir/$dlname \$dldir/$dlname~
      chmod a+x \$dldir/$dlname~
      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
      fi'
    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
      dlpath=$dir/\$dldll~
       $RM \$dlpath'
    shlibpath_overrides_runpath=yes

    case $host_os in
    cygwin*)
      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'

      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
      ;;
    mingw* | cegcc*)
      # MinGW DLLs use traditional 'lib' prefix
      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
      ;;
    pw32*)
      # pw32 DLLs use 'pw' prefix rather than 'lib'
      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
      ;;
    esac
    dynamic_linker='Win32 ld.exe'
    ;;

  *,cl*)
    # Native MSVC
    libname_spec='$name'
    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
    library_names_spec='${libname}.dll.lib'

    case $build_os in
    mingw*)
      sys_lib_search_path_spec=
      lt_save_ifs=$IFS
      IFS=';'
      for lt_path in $LIB
      do
        IFS=$lt_save_ifs
        # Let DOS variable expansion print the short 8.3 style file name.
        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
      done
      IFS=$lt_save_ifs
      # Convert to MSYS style.
      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
      ;;
    cygwin*)
      # Convert to unix form, then to dos form, then back to unix form
      # but this time dos style (no spaces!) so that the unix form looks
      # like /cygdrive/c/PROGRA~1:/cygdr...
      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
      ;;
    *)
      sys_lib_search_path_spec="$LIB"
      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
        # It is most probably a Windows format PATH.
        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
      else
        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
      fi
      # FIXME: find the short name or the path components, as spaces are
      # common. (e.g. "Program Files" -> "PROGRA~1")
      ;;
    esac

    # DLL is installed to $(libdir)/../bin by postinstall_cmds
    postinstall_cmds='base_file=`basename \${file}`~
      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
      dldir=$destdir/`dirname \$dlpath`~
      test -d \$dldir || mkdir -p \$dldir~
      $install_prog $dir/$dlname \$dldir/$dlname'
    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
      dlpath=$dir/\$dldll~
       $RM \$dlpath'
    shlibpath_overrides_runpath=yes
    dynamic_linker='Win32 link.exe'
    ;;

  *)
    # Assume MSVC wrapper
    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
    dynamic_linker='Win32 ld.exe'
    ;;
  esac
  # FIXME: first we should search . and the directory the executable is in
  shlibpath_var=PATH
  ;;

darwin* | rhapsody*)
  dynamic_linker="$host_os dyld"
  version_type=darwin
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
  soname_spec='${libname}${release}${major}$shared_ext'
  shlibpath_overrides_runpath=yes
  shlibpath_var=DYLD_LIBRARY_PATH
  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'

  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
  ;;

dgux*)
  version_type=linux
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
  soname_spec='${libname}${release}${shared_ext}$major'
  shlibpath_var=LD_LIBRARY_PATH
  ;;

freebsd1*)
  dynamic_linker=no
  ;;

freebsd* | dragonfly*)
  # DragonFly does not have aout.  When/if they implement a new
  # versioning mechanism, adjust this.
  if test -x /usr/bin/objformat; then
    objformat=`/usr/bin/objformat`
  else
    case $host_os in
    freebsd[123]*) objformat=aout ;;
    *) objformat=elf ;;
    esac
  fi
  version_type=freebsd-$objformat
  case $version_type in
    freebsd-elf*)
      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
      need_version=no
      need_lib_prefix=no
      ;;
    freebsd-*)
      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
      need_version=yes
      ;;
  esac
  shlibpath_var=LD_LIBRARY_PATH
  case $host_os in
  freebsd2*)
    shlibpath_overrides_runpath=yes
    ;;
  freebsd3.[01]* | freebsdelf3.[01]*)
    shlibpath_overrides_runpath=yes
    hardcode_into_libs=yes
    ;;
  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
    shlibpath_overrides_runpath=no
    hardcode_into_libs=yes
    ;;
  *) # from 4.6 on, and DragonFly
    shlibpath_overrides_runpath=yes
    hardcode_into_libs=yes
    ;;
  esac
  ;;

gnu*)
  version_type=linux
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
  soname_spec='${libname}${release}${shared_ext}$major'
  shlibpath_var=LD_LIBRARY_PATH
  hardcode_into_libs=yes
  ;;

haiku*)
  version_type=linux
  need_lib_prefix=no
  need_version=no
  dynamic_linker="$host_os runtime_loader"
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
  soname_spec='${libname}${release}${shared_ext}$major'
  shlibpath_var=LIBRARY_PATH
  shlibpath_overrides_runpath=yes
  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
  hardcode_into_libs=yes
  ;;

hpux9* | hpux10* | hpux11*)
  # Give a soname corresponding to the major version so that dld.sl refuses to
  # link against other versions.
  version_type=sunos
  need_lib_prefix=no
  need_version=no
  case $host_cpu in
  ia64*)
    shrext_cmds='.so'
    hardcode_into_libs=yes
    dynamic_linker="$host_os dld.so"
    shlibpath_var=LD_LIBRARY_PATH
    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    if test "X$HPUX_IA64_MODE" = X32; then
      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
    else
      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
    fi
    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
    ;;
  hppa*64*)
    shrext_cmds='.sl'
    hardcode_into_libs=yes
    dynamic_linker="$host_os dld.sl"
    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
    ;;
  *)
    shrext_cmds='.sl'
    dynamic_linker="$host_os dld.sl"
    shlibpath_var=SHLIB_PATH
    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    ;;
  esac
  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
  postinstall_cmds='chmod 555 $lib'
  # or fails outright, so override atomically:
  install_override_mode=555
  ;;

interix[3-9]*)
  version_type=linux
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
  soname_spec='${libname}${release}${shared_ext}$major'
  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=no
  hardcode_into_libs=yes
  ;;

irix5* | irix6* | nonstopux*)
  case $host_os in
    nonstopux*) version_type=nonstopux ;;
    *)
	if test "$lt_cv_prog_gnu_ld" = yes; then
		version_type=linux
	else
		version_type=irix
	fi ;;
  esac
  need_lib_prefix=no
  need_version=no
  soname_spec='${libname}${release}${shared_ext}$major'
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
  case $host_os in
  irix5* | nonstopux*)
    libsuff= shlibsuff=
    ;;
  *)
    case $LD in # libtool.m4 will add one of these switches to LD
    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
      libsuff= shlibsuff= libmagic=32-bit;;
    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
      libsuff=32 shlibsuff=N32 libmagic=N32;;
    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
      libsuff=64 shlibsuff=64 libmagic=64-bit;;
    *) libsuff= shlibsuff= libmagic=never-match;;
    esac
    ;;
  esac
  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  shlibpath_overrides_runpath=no
  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
  hardcode_into_libs=yes
  ;;

# No shared lib support for Linux oldld, aout, or coff.
linux*oldld* | linux*aout* | linux*coff*)
  dynamic_linker=no
  ;;

# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
  version_type=linux
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  soname_spec='${libname}${release}${shared_ext}$major'
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=no

  # Some binutils ld are patched to set DT_RUNPATH
  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
  $as_echo_n "(cached) " >&6
else
  lt_cv_shlibpath_overrides_runpath=no
    save_LDFLAGS=$LDFLAGS
    save_libdir=$libdir
    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
  lt_cv_shlibpath_overrides_runpath=yes
fi
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
    LDFLAGS=$save_LDFLAGS
    libdir=$save_libdir

fi

  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath

  # This implies no fast_install, which is unacceptable.
  # Some rework will be needed to allow for fast_install
  # before this can be enabled.
  hardcode_into_libs=yes

  # Append ld.so.conf contents to the search path
  if test -f /etc/ld.so.conf; then
    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
  fi

  # We used to test for /lib/ld.so.1 and disable shared libraries on
  # powerpc, because MkLinux only supported shared libraries with the
  # GNU dynamic linker.  Since this was broken with cross compilers,
  # most powerpc-linux boxes support dynamic linking these days and
  # people can always --disable-shared, the test was removed, and we
  # assume the GNU/Linux dynamic linker is in use.
  dynamic_linker='GNU/Linux ld.so'
  ;;

netbsd*)
  version_type=sunos
  need_lib_prefix=no
  need_version=no
  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
    dynamic_linker='NetBSD (a.out) ld.so'
  else
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    dynamic_linker='NetBSD ld.elf_so'
  fi
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=yes
  hardcode_into_libs=yes
  ;;

newsos6)
  version_type=linux
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=yes
  ;;

*nto* | *qnx*)
  version_type=qnx
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  soname_spec='${libname}${release}${shared_ext}$major'
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=no
  hardcode_into_libs=yes
  dynamic_linker='ldqnx.so'
  ;;

openbsd*)
  version_type=sunos
  sys_lib_dlsearch_path_spec="/usr/lib"
  need_lib_prefix=no
  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
  case $host_os in
    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
    *)				need_version=no  ;;
  esac
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  shlibpath_var=LD_LIBRARY_PATH
  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
    case $host_os in
      openbsd2.[89] | openbsd2.[89].*)
	shlibpath_overrides_runpath=no
	;;
      *)
	shlibpath_overrides_runpath=yes
	;;
      esac
  else
    shlibpath_overrides_runpath=yes
  fi
  ;;

os2*)
  libname_spec='$name'
  shrext_cmds=".dll"
  need_lib_prefix=no
  library_names_spec='$libname${shared_ext} $libname.a'
  dynamic_linker='OS/2 ld.exe'
  shlibpath_var=LIBPATH
  ;;

osf3* | osf4* | osf5*)
  version_type=osf
  need_lib_prefix=no
  need_version=no
  soname_spec='${libname}${release}${shared_ext}$major'
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  shlibpath_var=LD_LIBRARY_PATH
  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  ;;

rdos*)
  dynamic_linker=no
  ;;

solaris*)
  version_type=linux
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  soname_spec='${libname}${release}${shared_ext}$major'
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=yes
  hardcode_into_libs=yes
  # ldd complains unless libraries are executable
  postinstall_cmds='chmod +x $lib'
  ;;

sunos4*)
  version_type=sunos
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=yes
  if test "$with_gnu_ld" = yes; then
    need_lib_prefix=no
  fi
  need_version=yes
  ;;

sysv4 | sysv4.3*)
  version_type=linux
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  soname_spec='${libname}${release}${shared_ext}$major'
  shlibpath_var=LD_LIBRARY_PATH
  case $host_vendor in
    sni)
      shlibpath_overrides_runpath=no
      need_lib_prefix=no
      runpath_var=LD_RUN_PATH
      ;;
    siemens)
      need_lib_prefix=no
      ;;
    motorola)
      need_lib_prefix=no
      need_version=no
      shlibpath_overrides_runpath=no
      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
      ;;
  esac
  ;;

sysv4*MP*)
  if test -d /usr/nec ;then
    version_type=linux
    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
    soname_spec='$libname${shared_ext}.$major'
    shlibpath_var=LD_LIBRARY_PATH
  fi
  ;;

sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  version_type=freebsd-elf
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
  soname_spec='${libname}${release}${shared_ext}$major'
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=yes
  hardcode_into_libs=yes
  if test "$with_gnu_ld" = yes; then
    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
  else
    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
    case $host_os in
      sco3.2v5*)
        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
	;;
    esac
  fi
  sys_lib_dlsearch_path_spec='/usr/lib'
  ;;

tpf*)
  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
  version_type=linux
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=no
  hardcode_into_libs=yes
  ;;

uts4*)
  version_type=linux
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  soname_spec='${libname}${release}${shared_ext}$major'
  shlibpath_var=LD_LIBRARY_PATH
  ;;

*)
  dynamic_linker=no
  ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
$as_echo "$dynamic_linker" >&6; }
test "$dynamic_linker" = no && can_build_shared=no

variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi

if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
fi
if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
fi




























































































  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
hardcode_action=
if test -n "$hardcode_libdir_flag_spec" ||
   test -n "$runpath_var" ||
   test "X$hardcode_automatic" = "Xyes" ; then

  # We can hardcode non-existent directories.
  if test "$hardcode_direct" != no &&
     # If the only mechanism to avoid hardcoding is shlibpath_var, we
     # have to relink, otherwise we might link with an installed library
     # when we should be linking with a yet-to-be-installed one
     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
     test "$hardcode_minus_L" != no; then
    # Linking always hardcodes the temporary library directory.
    hardcode_action=relink
  else
    # We can link without hardcoding, and we can hardcode nonexisting dirs.
    hardcode_action=immediate
  fi
else
  # We cannot hardcode anything, or else we can only hardcode existing
  # directories.
  hardcode_action=unsupported
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
$as_echo "$hardcode_action" >&6; }

if test "$hardcode_action" = relink ||
   test "$inherit_rpath" = yes; then
  # Fast installation is not supported
  enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes ||
     test "$enable_shared" = no; then
  # Fast installation is not necessary
  enable_fast_install=needless
fi






  if test "x$enable_dlopen" != xyes; then
  enable_dlopen=unknown
  enable_dlopen_self=unknown
  enable_dlopen_self_static=unknown
else
  lt_cv_dlopen=no
  lt_cv_dlopen_libs=

  case $host_os in
  beos*)
    lt_cv_dlopen="load_add_on"
    lt_cv_dlopen_libs=
    lt_cv_dlopen_self=yes
    ;;

  mingw* | pw32* | cegcc*)
    lt_cv_dlopen="LoadLibrary"
    lt_cv_dlopen_libs=
    ;;

  cygwin*)
    lt_cv_dlopen="dlopen"
    lt_cv_dlopen_libs=
    ;;

  darwin*)
  # if libdl is installed we need to link against it
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if ${ac_cv_lib_dl_dlopen+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl  $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 dlopen ();
int
main ()
{
return dlopen ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_dl_dlopen=yes
else
  ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else

    lt_cv_dlopen="dyld"
    lt_cv_dlopen_libs=
    lt_cv_dlopen_self=yes

fi

    ;;

  *)
    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
if test "x$ac_cv_func_shl_load" = xyes; then :
  lt_cv_dlopen="shl_load"
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
$as_echo_n "checking for shl_load in -ldld... " >&6; }
if ${ac_cv_lib_dld_shl_load+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld  $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 shl_load ();
int
main ()
{
return shl_load ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_dld_shl_load=yes
else
  ac_cv_lib_dld_shl_load=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_dld_shl_load" >&5
$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
else
  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
if test "x$ac_cv_func_dlopen" = xyes; then :
  lt_cv_dlopen="dlopen"
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if ${ac_cv_lib_dl_dlopen+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl  $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 dlopen ();
int
main ()
{
return dlopen ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_dl_dlopen=yes
else
  ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
$as_echo_n "checking for dlopen in -lsvld... " >&6; }
if ${ac_cv_lib_svld_dlopen+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lsvld  $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 dlopen ();
int
main ()
{
return dlopen ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_svld_dlopen=yes
else
  ac_cv_lib_svld_dlopen=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_svld_dlopen" >&5
$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
$as_echo_n "checking for dld_link in -ldld... " >&6; }
if ${ac_cv_lib_dld_dld_link+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld  $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 dld_link ();
int
main ()
{
return dld_link ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_dld_dld_link=yes
else
  ac_cv_lib_dld_dld_link=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_dld_dld_link" >&5
$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
fi


fi


fi


fi


fi


fi

    ;;
  esac

  if test "x$lt_cv_dlopen" != xno; then
    enable_dlopen=yes
  else
    enable_dlopen=no
  fi

  case $lt_cv_dlopen in
  dlopen)
    save_CPPFLAGS="$CPPFLAGS"
    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"

    save_LDFLAGS="$LDFLAGS"
    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"

    save_LIBS="$LIBS"
    LIBS="$lt_cv_dlopen_libs $LIBS"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
$as_echo_n "checking whether a program can dlopen itself... " >&6; }
if ${lt_cv_dlopen_self+:} false; then :
  $as_echo_n "(cached) " >&6
else
  	  if test "$cross_compiling" = yes; then :
  lt_cv_dlopen_self=cross
else
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  lt_status=$lt_dlunknown
  cat > conftest.$ac_ext <<_LT_EOF
#line $LINENO "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
#include 
#endif

#include 

#ifdef RTLD_GLOBAL
#  define LT_DLGLOBAL		RTLD_GLOBAL
#else
#  ifdef DL_GLOBAL
#    define LT_DLGLOBAL		DL_GLOBAL
#  else
#    define LT_DLGLOBAL		0
#  endif
#endif

/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
   find out it does not work in some platform. */
#ifndef LT_DLLAZY_OR_NOW
#  ifdef RTLD_LAZY
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
#  else
#    ifdef DL_LAZY
#      define LT_DLLAZY_OR_NOW		DL_LAZY
#    else
#      ifdef RTLD_NOW
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
#      else
#        ifdef DL_NOW
#          define LT_DLLAZY_OR_NOW	DL_NOW
#        else
#          define LT_DLLAZY_OR_NOW	0
#        endif
#      endif
#    endif
#  endif
#endif

/* When -fvisbility=hidden is used, assume the code has been annotated
   correspondingly for the symbols needed.  */
#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
#endif

int fnord () { return 42; }
int main ()
{
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  int status = $lt_dlunknown;

  if (self)
    {
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
      else
        {
	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
          else puts (dlerror ());
	}
      /* dlclose (self); */
    }
  else
    puts (dlerror ());

  return status;
}
_LT_EOF
  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
    (./conftest; exit; ) >&5 2>/dev/null
    lt_status=$?
    case x$lt_status in
      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
    esac
  else :
    # compilation failed
    lt_cv_dlopen_self=no
  fi
fi
rm -fr conftest*


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
$as_echo "$lt_cv_dlopen_self" >&6; }

    if test "x$lt_cv_dlopen_self" = xyes; then
      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
if ${lt_cv_dlopen_self_static+:} false; then :
  $as_echo_n "(cached) " >&6
else
  	  if test "$cross_compiling" = yes; then :
  lt_cv_dlopen_self_static=cross
else
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  lt_status=$lt_dlunknown
  cat > conftest.$ac_ext <<_LT_EOF
#line $LINENO "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
#include 
#endif

#include 

#ifdef RTLD_GLOBAL
#  define LT_DLGLOBAL		RTLD_GLOBAL
#else
#  ifdef DL_GLOBAL
#    define LT_DLGLOBAL		DL_GLOBAL
#  else
#    define LT_DLGLOBAL		0
#  endif
#endif

/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
   find out it does not work in some platform. */
#ifndef LT_DLLAZY_OR_NOW
#  ifdef RTLD_LAZY
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
#  else
#    ifdef DL_LAZY
#      define LT_DLLAZY_OR_NOW		DL_LAZY
#    else
#      ifdef RTLD_NOW
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
#      else
#        ifdef DL_NOW
#          define LT_DLLAZY_OR_NOW	DL_NOW
#        else
#          define LT_DLLAZY_OR_NOW	0
#        endif
#      endif
#    endif
#  endif
#endif

/* When -fvisbility=hidden is used, assume the code has been annotated
   correspondingly for the symbols needed.  */
#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
#endif

int fnord () { return 42; }
int main ()
{
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  int status = $lt_dlunknown;

  if (self)
    {
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
      else
        {
	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
          else puts (dlerror ());
	}
      /* dlclose (self); */
    }
  else
    puts (dlerror ());

  return status;
}
_LT_EOF
  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
    (./conftest; exit; ) >&5 2>/dev/null
    lt_status=$?
    case x$lt_status in
      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
    esac
  else :
    # compilation failed
    lt_cv_dlopen_self_static=no
  fi
fi
rm -fr conftest*


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
$as_echo "$lt_cv_dlopen_self_static" >&6; }
    fi

    CPPFLAGS="$save_CPPFLAGS"
    LDFLAGS="$save_LDFLAGS"
    LIBS="$save_LIBS"
    ;;
  esac

  case $lt_cv_dlopen_self in
  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  *) enable_dlopen_self=unknown ;;
  esac

  case $lt_cv_dlopen_self_static in
  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  *) enable_dlopen_self_static=unknown ;;
  esac
fi

















striplib=
old_striplib=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
$as_echo_n "checking whether stripping libraries is possible... " >&6; }
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
# FIXME - insert some real tests, host_os isn't really good enough
  case $host_os in
  darwin*)
    if test -n "$STRIP" ; then
      striplib="$STRIP -x"
      old_striplib="$STRIP -S"
      { $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; }
    fi
    ;;
  *)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
    ;;
  esac
fi












  # Report which library types will actually be built
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
$as_echo_n "checking if libtool supports shared libraries... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
$as_echo "$can_build_shared" >&6; }

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
$as_echo_n "checking whether to build shared libraries... " >&6; }
  test "$can_build_shared" = "no" && enable_shared=no

  # On AIX, shared libraries and static libraries use the same namespace, and
  # are all built from PIC.
  case $host_os in
  aix3*)
    test "$enable_shared" = yes && enable_static=no
    if test -n "$RANLIB"; then
      archive_cmds="$archive_cmds~\$RANLIB \$lib"
      postinstall_cmds='$RANLIB $lib'
    fi
    ;;

  aix[4-9]*)
    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
      test "$enable_shared" = yes && enable_static=no
    fi
    ;;
  esac
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
$as_echo "$enable_shared" >&6; }

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
$as_echo_n "checking whether to build static libraries... " >&6; }
  # Make sure either enable_shared or enable_static is yes.
  test "$enable_shared" = yes || enable_static=yes
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
$as_echo "$enable_static" >&6; }




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

CC="$lt_save_CC"













        ac_config_commands="$ac_config_commands libtool"




# Only expand once:



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
$as_echo_n "checking whether ln -s works... " >&6; }
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; 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, using $LN_S" >&5
$as_echo "no, using $LN_S" >&6; }
fi

if test $ac_cv_c_compiler_gnu = yes; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
$as_echo_n "checking whether $CC needs -traditional... " >&6; }
if ${ac_cv_prog_gcc_traditional+:} false; then :
  $as_echo_n "(cached) " >&6
else
    ac_pattern="Autoconf.*'x'"
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
Autoconf TIOCGETP
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "$ac_pattern" >/dev/null 2>&1; then :
  ac_cv_prog_gcc_traditional=yes
else
  ac_cv_prog_gcc_traditional=no
fi
rm -f conftest*


  if test $ac_cv_prog_gcc_traditional = no; then
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
Autoconf TCGETA
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "$ac_pattern" >/dev/null 2>&1; then :
  ac_cv_prog_gcc_traditional=yes
fi
rm -f conftest*

  fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
  if test $ac_cv_prog_gcc_traditional = yes; then
    CC="$CC -traditional"
  fi
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5
$as_echo_n "checking for working volatile... " >&6; }
if ${ac_cv_c_volatile+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

volatile int x;
int * volatile y = (int *) 0;
return !x && !y;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_c_volatile=yes
else
  ac_cv_c_volatile=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5
$as_echo "$ac_cv_c_volatile" >&6; }
if test $ac_cv_c_volatile = no; then

$as_echo "#define volatile /**/" >>confdefs.h

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
$as_echo_n "checking for library containing strerror... " >&6; }
if ${ac_cv_search_strerror+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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 strerror ();
int
main ()
{
return strerror ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' cposix; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_strerror=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_strerror+:} false; then :
  break
fi
done
if ${ac_cv_search_strerror+:} false; then :

else
  ac_cv_search_strerror=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
$as_echo "$ac_cv_search_strerror" >&6; }
ac_res=$ac_cv_search_strerror
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi


# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; 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_path_PATH_PERL+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $PATH_PERL in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_PATH_PERL="$PATH_PERL" # Let the user override the test with a path.
  ;;
  *)
  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_path_PATH_PERL="$as_dir/$ac_word$ac_exec_ext"
    $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

  ;;
esac
fi
PATH_PERL=$ac_cv_path_PATH_PERL
if test -n "$PATH_PERL"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_PERL" >&5
$as_echo "$PATH_PERL" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


# Extract the first word of "sh", so it can be a program name with args.
set dummy sh; 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_path_PATH_SH+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $PATH_SH in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_PATH_SH="$PATH_SH" # Let the user override the test with a path.
  ;;
  *)
  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_path_PATH_SH="$as_dir/$ac_word$ac_exec_ext"
    $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

  ;;
esac
fi
PATH_SH=$ac_cv_path_PATH_SH
if test -n "$PATH_SH"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_SH" >&5
$as_echo "$PATH_SH" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


# Extract the first word of "test", so it can be a program name with args.
set dummy test; 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_path_PATH_TEST+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $PATH_TEST in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_PATH_TEST="$PATH_TEST" # Let the user override the test with a path.
  ;;
  *)
  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_path_PATH_TEST="$as_dir/$ac_word$ac_exec_ext"
    $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

  ;;
esac
fi
PATH_TEST=$ac_cv_path_PATH_TEST
if test -n "$PATH_TEST"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TEST" >&5
$as_echo "$PATH_TEST" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi




# Check whether --with-net-snmp-config was given.
if test "${with_net_snmp_config+set}" = set; then :
  withval=$with_net_snmp_config; ans=$withval
else
  ans=yes

fi

case "$ans" in
 no)
    ;;
 yes)
    ans=net-snmp-config
    ;;
 /*)
    ;;
 */*)
    as_fn_error $? "--with-net-snmp-config takes either a name or an absolute path" "$LINENO" 5
    ;;
 *)
    ;;
esac
PROG_NET_SNMP_CONFIG=$ans
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for net-snmp-config path" >&5
$as_echo_n "checking for net-snmp-config path... " >&6; }
case "$PROG_NET_SNMP_CONFIG" in
 no) ;;
 /*)
    PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG
    ;;
 *)
    # Extract the first word of "$PROG_NET_SNMP_CONFIG", so it can be a program name with args.
set dummy $PROG_NET_SNMP_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_path_PATH_NET_SNMP_CONFIG+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $PATH_NET_SNMP_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_PATH_NET_SNMP_CONFIG="$PATH_NET_SNMP_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  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_path_PATH_NET_SNMP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    $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

  ;;
esac
fi
PATH_NET_SNMP_CONFIG=$ac_cv_path_PATH_NET_SNMP_CONFIG
if test -n "$PATH_NET_SNMP_CONFIG"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_NET_SNMP_CONFIG" >&5
$as_echo "$PATH_NET_SNMP_CONFIG" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


    ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_NET_SNMP_CONFIG" >&5
$as_echo "$PATH_NET_SNMP_CONFIG" >&6; }

case "$host" in
 *-*-vxworks*)
    ac_link="$ac_link $VX_KERNEL"
    ;;
esac



ac_fn_c_check_func "$LINENO" "gethostent" "ac_cv_func_gethostent"
if test "x$ac_cv_func_gethostent" = xyes; then :

else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostent" >&5
$as_echo_n "checking for library containing gethostent... " >&6; }
if ${ac_cv_search_gethostent+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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 gethostent ();
int
main ()
{
return gethostent ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' nsl; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib $libxnet -lsocket $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_gethostent=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_gethostent+:} false; then :
  break
fi
done
if ${ac_cv_search_gethostent+:} false; then :

else
  ac_cv_search_gethostent=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostent" >&5
$as_echo "$ac_cv_search_gethostent" >&6; }
ac_res=$ac_cv_search_gethostent
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi

fi

ac_fn_c_check_func "$LINENO" "openlog" "ac_cv_func_openlog"
if test "x$ac_cv_func_openlog" = xyes; then :

else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openlog" >&5
$as_echo_n "checking for library containing openlog... " >&6; }
if ${ac_cv_search_openlog+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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 openlog ();
int
main ()
{
return openlog ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' gen; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_openlog=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_openlog+:} false; then :
  break
fi
done
if ${ac_cv_search_openlog+:} false; then :

else
  ac_cv_search_openlog=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_openlog" >&5
$as_echo "$ac_cv_search_openlog" >&6; }
ac_res=$ac_cv_search_openlog
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openlog" >&5
$as_echo_n "checking for library containing openlog... " >&6; }
if ${ac_cv_search_openlog+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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 openlog ();
int
main ()
{
return openlog ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' syslog; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib $libxnet -lsocket $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_openlog=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_openlog+:} false; then :
  break
fi
done
if ${ac_cv_search_openlog+:} false; then :

else
  ac_cv_search_openlog=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_openlog" >&5
$as_echo "$ac_cv_search_openlog" >&6; }
ac_res=$ac_cv_search_openlog
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi

fi

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing MD5Init" >&5
$as_echo_n "checking for library containing MD5Init... " >&6; }
if ${ac_cv_search_MD5Init+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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 MD5Init ();
int
main ()
{
return MD5Init ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' md5 md; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_MD5Init=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_MD5Init+:} false; then :
  break
fi
done
if ${ac_cv_search_MD5Init+:} false; then :

else
  ac_cv_search_MD5Init=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_MD5Init" >&5
$as_echo "$ac_cv_search_MD5Init" >&6; }
ac_res=$ac_cv_search_MD5Init
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi

for ac_func in MD5Init
do :
  ac_fn_c_check_func "$LINENO" "MD5Init" "ac_cv_func_MD5Init"
if test "x$ac_cv_func_MD5Init" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_MD5INIT 1
_ACEOF

fi
done



    NTP_ORIG_LIBS="$LIBS"

# Check whether --with-lineeditlibs was given.
if test "${with_lineeditlibs+set}" = set; then :
  withval=$with_lineeditlibs; use_lineeditlibs="$withval"
else
  use_lineeditlibs="edit,editline"

fi

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking line editing libraries" >&5
$as_echo_n "checking line editing libraries... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_lineeditlibs" >&5
$as_echo "$use_lineeditlibs" >&6; }
    case "$use_lineeditlibs" in
     no)
	ntp_lib_lineedit=no
	;;
     *)
	for lineedit_lib in `echo $use_lineeditlibs | sed -e 's/,/ /'`; do
	    for term_lib in "" termcap curses ncurses; do
		case "$term_lib" in
		 '')
		    TRY_LIB="-l$lineedit_lib"
		    ;;
		 *)
		    TRY_LIB="-l$lineedit_lib -l$term_lib"
		    ;;
		esac
		LIBS="$NTP_ORIG_LIBS $TRY_LIB"
		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline() with $TRY_LIB" >&5
$as_echo_n "checking for readline() with $TRY_LIB... " >&6; }
		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 readline ();
int
main ()
{
return readline ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ntp_lib_lineedit="$TRY_LIB"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
		case "$ntp_lib_lineedit" in
		 '')
		    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
		    ;;
		 *)
		    # Use readline()
		    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
		    break
		esac
		case "$term_lib" in
		 '')
		    # do not try el_gets without a terminal library
		    ;;
		 *)
		    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for el_gets() with $TRY_LIB" >&5
$as_echo_n "checking for el_gets() with $TRY_LIB... " >&6; }
		    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 el_gets ();
int
main ()
{
return el_gets ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ntp_lib_lineedit="$TRY_LIB"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
		    case "$ntp_lib_lineedit" in
		     '')
			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
			;;
		     *) # Use el_gets()
			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
			break
			;;
		    esac	# $ntp_lib_lineedit
		esac		# $term_lib
	    done
	    case "$ntp_lib_lineedit" in
	     '')
		;;
	     *)
		break
		;;
	    esac
	done
	LIBS="$NTP_ORIG_LIBS"
	;;
    esac	# $use_lineeditlibs

    case "$ntp_lib_lineedit" in
     '')
	ntp_lib_lineedit="no"
	;;
     no)
	;;
     *)
	EDITLINE_LIBS="$ntp_lib_lineedit"

	;;
    esac	# $ntp_lib_lineedit

    case "$ntp_lib_lineedit" in
     no)
	;;
     *)
	for ac_header in readline.h readline/readline.h histedit.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

	for ac_header in history.h readline/history.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 "$ac_cv_header_histedit_h" in
	 yes)
	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments to el_init()" >&5
$as_echo_n "checking number of arguments to el_init()... " >&6; }
if ${ntp_cv_el_init_args+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

			    #include 
			    #include 

int
main ()
{

			    el_init("conftest", stdin, stdout, stderr);


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_el_init_args=4
else
  ntp_cv_el_init_args=3

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_el_init_args" >&5
$as_echo "$ntp_cv_el_init_args" >&6; }

cat >>confdefs.h <<_ACEOF
#define EL_INIT_ARGS $ntp_cv_el_init_args
_ACEOF

	esac

	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline supports history" >&5
$as_echo_n "checking whether readline supports history... " >&6; }

	ntp_lib_lineedit_history="no"
	ORIG_LIBS="$LIBS"
	LIBS="$ORIG_LIBS $ntp_lib_lineedit"
	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 add_history ();
int
main ()
{
return add_history ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ntp_lib_lineedit_history="yes"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
	LIBS="$ORIG_LIBS"

	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_lib_lineedit_history" >&5
$as_echo "$ntp_lib_lineedit_history" >&6; }

	case "$ntp_lib_lineedit_history" in
	 yes)

$as_echo "#define HAVE_READLINE_HISTORY 1" >>confdefs.h

	esac
    esac	# $ntp_lib_lineedit
    { NTP_ORIG_LIBS=; unset NTP_ORIG_LIBS;}
    { ORIG_LIBS=; unset ORIG_LIBS;}
    { TRY_LIB=; unset TRY_LIB;}
    { use_lineeditlibs=; unset use_lineeditlibs;}



case "$host" in
 *-*-*linux*) ;;
 *-*-osf4*) ;;
 *-*-osf5*) ;;
 *)
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_setscheduler in -lrt" >&5
$as_echo_n "checking for sched_setscheduler in -lrt... " >&6; }
if ${ac_cv_lib_rt_sched_setscheduler+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lrt  $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 sched_setscheduler ();
int
main ()
{
return sched_setscheduler ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_rt_sched_setscheduler=yes
else
  ac_cv_lib_rt_sched_setscheduler=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_rt_sched_setscheduler" >&5
$as_echo "$ac_cv_lib_rt_sched_setscheduler" >&6; }
if test "x$ac_cv_lib_rt_sched_setscheduler" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBRT 1
_ACEOF

  LIBS="-lrt $LIBS"

else
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_setscheduler in -lposix4" >&5
$as_echo_n "checking for sched_setscheduler in -lposix4... " >&6; }
if ${ac_cv_lib_posix4_sched_setscheduler+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lposix4  $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 sched_setscheduler ();
int
main ()
{
return sched_setscheduler ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_posix4_sched_setscheduler=yes
else
  ac_cv_lib_posix4_sched_setscheduler=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_posix4_sched_setscheduler" >&5
$as_echo "$ac_cv_lib_posix4_sched_setscheduler" >&6; }
if test "x$ac_cv_lib_posix4_sched_setscheduler" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPOSIX4 1
_ACEOF

  LIBS="-lposix4 $LIBS"

fi

fi

    ;;
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5
$as_echo_n "checking for library containing setsockopt... " >&6; }
if ${ac_cv_search_setsockopt+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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 setsockopt ();
int
main ()
{
return setsockopt ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' socket xnet; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_setsockopt=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_setsockopt+:} false; then :
  break
fi
done
if ${ac_cv_search_setsockopt+:} false; then :

else
  ac_cv_search_setsockopt=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setsockopt" >&5
$as_echo "$ac_cv_search_setsockopt" >&6; }
ac_res=$ac_cv_search_setsockopt
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_init" >&5
$as_echo_n "checking for library containing res_init... " >&6; }
if ${ac_cv_search_res_init+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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 res_init ();
int
main ()
{
return res_init ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' resolv; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib -lsocket -lnsl $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_res_init=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_res_init+:} false; then :
  break
fi
done
if ${ac_cv_search_res_init+:} false; then :

else
  ac_cv_search_res_init=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_init" >&5
$as_echo "$ac_cv_search_res_init" >&6; }
ac_res=$ac_cv_search_res_init
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi

case "$host" in
 *-*-darwin*)
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_9_init in -lresolv" >&5
$as_echo_n "checking for res_9_init in -lresolv... " >&6; }
if ${ac_cv_lib_resolv_res_9_init+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lresolv  $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 res_9_init ();
int
main ()
{
return res_9_init ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_resolv_res_9_init=yes
else
  ac_cv_lib_resolv_res_9_init=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_resolv_res_9_init" >&5
$as_echo "$ac_cv_lib_resolv_res_9_init" >&6; }
if test "x$ac_cv_lib_resolv_res_9_init" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBRESOLV 1
_ACEOF

  LIBS="-lresolv $LIBS"

fi

    ;;
esac
for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H
#  include 
#endif
#ifdef HAVE_NETINET_IN_H
#  include    /* inet_ functions / structs */
#endif
#ifdef HAVE_ARPA_NAMESER_H
#  include  /* DNS HEADER struct */
#endif
#ifdef HAVE_NETDB_H
#  include 
#endif
"
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


for ac_func in res_init __res_init
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


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if ${ac_cv_header_stdc+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
#include 
#include 
#include 

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_header_stdc=yes
else
  ac_cv_header_stdc=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "memchr" >/dev/null 2>&1; then :

else
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "free" >/dev/null 2>&1; then :

else
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  if test "$cross_compiling" = yes; then :
  :
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
#include 
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
		   (('a' <= (c) && (c) <= 'i') \
		     || ('j' <= (c) && (c) <= 'r') \
		     || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif

#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
  int i;
  for (i = 0; i < 256; i++)
    if (XOR (islower (i), ISLOWER (i))
	|| toupper (i) != TOUPPER (i))
      return 2;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :

else
  ac_cv_header_stdc=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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then

$as_echo "#define STDC_HEADERS 1" >>confdefs.h

fi

for ac_header in bstring.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "bstring.h" "ac_cv_header_bstring_h" "$ac_includes_default"
if test "x$ac_cv_header_bstring_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_BSTRING_H 1
_ACEOF

fi

done

ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default"
if test "x$ac_cv_header_dns_sd_h" = xyes; then :
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DNSServiceRegister in -ldns_sd" >&5
$as_echo_n "checking for DNSServiceRegister in -ldns_sd... " >&6; }
if ${ac_cv_lib_dns_sd_DNSServiceRegister+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldns_sd  $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 DNSServiceRegister ();
int
main ()
{
return DNSServiceRegister ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_dns_sd_DNSServiceRegister=yes
else
  ac_cv_lib_dns_sd_DNSServiceRegister=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_dns_sd_DNSServiceRegister" >&5
$as_echo "$ac_cv_lib_dns_sd_DNSServiceRegister" >&6; }
if test "x$ac_cv_lib_dns_sd_DNSServiceRegister" = xyes; then :

$as_echo "#define HAVE_DNSREGISTRATION 1" >>confdefs.h


fi


fi


case "$ac_cv_lib_dns_sd_DNSServiceRegister" in
 yes)
    LIBS="-ldns_sd $LIBS"
esac
for ac_header in errno.h fcntl.h ieeefp.h kvm.h math.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


for ac_header in md5.h
do :
  ac_fn_c_check_header_compile "$LINENO" "md5.h" "ac_cv_header_md5_h" "
	#ifdef HAVE_SYS_TYPES_H
	# include 
	#endif


"
if test "x$ac_cv_header_md5_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_MD5_H 1
_ACEOF

fi

done

for ac_header in memory.h netdb.h poll.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

for ac_header in sgtty.h stdlib.h string.h termio.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

for ac_header in termios.h timepps.h timex.h unistd.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 "$host" in
 *-*-aix*)
    for ac_header in utmpx.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "utmpx.h" "ac_cv_header_utmpx_h" "$ac_includes_default"
if test "x$ac_cv_header_utmpx_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_UTMPX_H 1
_ACEOF

fi

done

    case "$ac_cv_header_utmpx_h" in
     yes)
	;;
     *)
	for ac_header in utmp.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "utmp.h" "ac_cv_header_utmp_h" "$ac_includes_default"
if test "x$ac_cv_header_utmp_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_UTMP_H 1
_ACEOF

fi

done

	;;
    esac
    ;;
 *)
    for ac_header in utmp.h utmpx.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

    ;;
esac

#
# On Suns only (so far) getpass() truncates the typed password to 8
# characters, but getpassphrase() allows up to 257.  Most systems'
# getpass() does not truncate, at least not so as to affect ntpq and
# ntpdc password prompts.
#
# So check for getpassphrase(), but only on Sun operating systems.
#
case "$host" in
 *-*-sunos*|*-*-solaris*)
    for ac_func in getpassphrase
do :
  ac_fn_c_check_func "$LINENO" "getpassphrase" "ac_cv_func_getpassphrase"
if test "x$ac_cv_func_getpassphrase" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_GETPASSPHRASE 1
_ACEOF

fi
done

esac

for ac_header in arpa/nameser.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "arpa/nameser.h" "ac_cv_header_arpa_nameser_h" "$ac_includes_default"
if test "x$ac_cv_header_arpa_nameser_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_ARPA_NAMESER_H 1
_ACEOF

fi

done

for ac_header in sys/socket.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_socket_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_SOCKET_H 1
_ACEOF

fi

done


#
case "$host" in
 *-hp-hpux*)
    for ac_header in net/netmp.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "net/netmp.h" "ac_cv_header_net_netmp_h" "$ac_includes_default"
if test "x$ac_cv_header_net_netmp_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_NET_NETMP_H 1
_ACEOF
 netmp_h_works=yes
else
  netmp_h_works=no

fi

done

    case "$netmp_h_works" in
     no)
	cat >>confdefs.h <<_ACEOF
#ifndef MPINFOU_PREDECLARED
# define MPINFOU_PREDECLARED
typedef union mpinfou {		/* For lint */
	struct pdk_mpinfo *pdkptr;
	struct mpinfo *pikptr;
} mpinfou_t;
#endif
_ACEOF

	;;
    esac
    ;;
esac

case "$host" in
 *-linux*)
    for ac_header in linux/if_addr.h
do :
  ac_fn_c_check_header_compile "$LINENO" "linux/if_addr.h" "ac_cv_header_linux_if_addr_h" "
	#ifdef HAVE_SYS_SOCKET_H
	# include 
	#endif

"
if test "x$ac_cv_header_linux_if_addr_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LINUX_IF_ADDR_H 1
_ACEOF

fi

done

esac

for ac_header in net/if.h
do :
  ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#ifdef HAVE_SYS_SOCKET_H
#include 
#endif

"
if test "x$ac_cv_header_net_if_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_NET_IF_H 1
_ACEOF

fi

done

for ac_header in net/if6.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "net/if6.h" "ac_cv_header_net_if6_h" "$ac_includes_default"
if test "x$ac_cv_header_net_if6_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_NET_IF6_H 1
_ACEOF

fi

done

for ac_header in net/route.h
do :
  ac_fn_c_check_header_compile "$LINENO" "net/route.h" "ac_cv_header_net_route_h" "
#include 
#include 
#include 

"
if test "x$ac_cv_header_net_route_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_NET_ROUTE_H 1
_ACEOF

fi

done

for ac_header in netinet/in_system.h netinet/in_systm.h netinet/in.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

for ac_header in net/if_var.h
do :
  ac_fn_c_check_header_compile "$LINENO" "net/if_var.h" "ac_cv_header_net_if_var_h" "#if HAVE_SYS_TYPES_H
#include 
#endif
#ifdef HAVE_SYS_SOCKET_H
#include 
#endif
#ifdef HAVE_NETINET_IN_H
#include 
#endif
#ifdef HAVE_NET_IF_H
#include 
#endif

"
if test "x$ac_cv_header_net_if_var_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_NET_IF_VAR_H 1
_ACEOF

fi

done

for ac_header in netinet/ip.h netinet/in_var.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H
#include 
#endif
#ifdef HAVE_SYS_SOCKET_H
#include 
#endif
#ifdef HAVE_NET_IF_H
#include 
#endif
#ifdef HAVE_NETINET_IN_H
#include 
#endif
#ifdef HAVE_NET_IF_VAR_H
#include 
#endif
#ifdef HAVE_NETINET_IN_SYSTM_H
#include 
#endif

"
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


# Check for IPTOS_PREC
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IPPROTO_IP IP_TOS IPTOS_LOWDELAY" >&5
$as_echo_n "checking IPPROTO_IP IP_TOS IPTOS_LOWDELAY... " >&6; }
if ${ntp_cv_ip_tos+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

	    #ifdef HAVE_SYS_TYPES_H
	    # include 
	    #endif
	    #ifdef HAVE_NETINET_IP_H
	    # include 
	    # include 
	    #endif
	    #if defined(IPPROTO_IP) && defined(IP_TOS) && defined(IPTOS_LOWDELAY)
		yes
	    #endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then :
  ntp_cv_ip_tos=yes
else
  ntp_cv_ip_tos=no

fi
rm -f conftest*


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_ip_tos" >&5
$as_echo "$ntp_cv_ip_tos" >&6; }
case "$ntp_cv_ip_tos" in
 yes)

$as_echo "#define HAVE_IPTOS_SUPPORT 1" >>confdefs.h

esac

for ac_header in netinfo/ni.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "netinfo/ni.h" "ac_cv_header_netinfo_ni_h" "$ac_includes_default"
if test "x$ac_cv_header_netinfo_ni_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_NETINFO_NI_H 1
_ACEOF

fi

done

case "$ac_cv_header_netinfo_ni_h" in
 yes)

$as_echo "#define HAVE_NETINFO 1" >>confdefs.h

esac
for ac_header in sun/audioio.h sys/audioio.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

for ac_header in sys/clkdefs.h sys/file.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 "$host" in
 *-*-sunos4*)
    ;;
 *)
    for ac_header in sys/ioctl.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_ioctl_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_IOCTL_H 1
_ACEOF

fi

done

    ;;
esac
for ac_header in sys/ipc.h sys/lock.h sys/mman.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

for ac_header in sys/modem.h sys/param.h sys/ppsclock.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

# HMS: Check sys/proc.h and sys/resource.h after some others
for ac_header in sys/ppstime.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
_ACEOF

fi

done

case "$ac_cv_header_sched_h" in
 yes)
    ;;
 *)
    for ac_header in sys/sched.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "sys/sched.h" "ac_cv_header_sys_sched_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_sched_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_SCHED_H 1
_ACEOF

fi

done

    ;;
esac
case "$host" in
 *-*-sco*)
    for ac_header in sys/sio.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "sys/sio.h" "ac_cv_header_sys_sio_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_sio_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_SIO_H 1
_ACEOF

fi

done

    ;;
esac
# HMS: Check sys/shm.h after some others
for ac_header in sys/select.h sys/signal.h sys/sockio.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

# HMS: Checked sys/socket.h earlier
case "$host" in
 *-*-netbsd*)
    ;;
 *)
    for ac_header in machine/soundcard.h sys/soundcard.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

    ;;
esac
for ac_header in sys/stat.h sys/stream.h sys/stropts.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

# sys/sysctl.h depends on sys/param.h on OpenBSD - Bug 1576
for ac_header in sys/sysctl.h
do :
  ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "#if defined HAVE_SYS_PARAM_H
# include 
#endif
"
if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_SYSCTL_H 1
_ACEOF

fi

done

for ac_header in sys/syssgi.h sys/systune.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

for ac_header in sys/termios.h sys/time.h sys/signal.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

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

	#ifdef HAVE_SYS_TIME_H
	# include 
	#endif
	#ifdef HAVE_ERRNO_H
	# include 
	#endif
	#include 
	#ifdef PPS_API_VERS_1
	    yes
	#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then :
  for ac_header in sys/timepps.h
do :
  ac_fn_c_check_header_compile "$LINENO" "sys/timepps.h" "ac_cv_header_sys_timepps_h" "
	    #ifdef HAVE_SYS_TIME_H
	    # include 
	    #endif
	    #ifdef HAVE_ERRNO_H
	    # include 
	    #endif


"
if test "x$ac_cv_header_sys_timepps_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_TIMEPPS_H 1
_ACEOF

fi

done


fi
rm -f conftest*

for ac_header in sys/timers.h sys/tpro.h sys/types.h sys/wait.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

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
if ${ac_cv_header_time+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
#include 
#include 

int
main ()
{
if ((struct tm *) 0)
return 0;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_header_time=yes
else
  ac_cv_header_time=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
$as_echo "$ac_cv_header_time" >&6; }
if test $ac_cv_header_time = yes; then

$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h

fi

case "$host" in
*-convex-*)
    for ac_header in /sys/sync/queue.h /sys/sync/sema.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

    ;;
*-*-bsdi*)
    for ac_header in machine/inline.h sys/pcl720.h sys/i8253.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

    ;;
esac

case "$host" in
 *-*-*linux*)
    for ac_func in __adjtimex __ntp_gettime
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

    ;;
esac
case "$ac_cv_func___adjtimex" in
 yes)
    ;;
 *)
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nlist in -lelf" >&5
$as_echo_n "checking for nlist in -lelf... " >&6; }
if ${ac_cv_lib_elf_nlist+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lelf  $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 nlist ();
int
main ()
{
return nlist ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_elf_nlist=yes
else
  ac_cv_lib_elf_nlist=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_elf_nlist" >&5
$as_echo "$ac_cv_lib_elf_nlist" >&6; }
if test "x$ac_cv_lib_elf_nlist" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBELF 1
_ACEOF

  LIBS="-lelf $LIBS"

fi
	        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lkvm" >&5
$as_echo_n "checking for main in -lkvm... " >&6; }
if ${ac_cv_lib_kvm_main+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lkvm  $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */


int
main ()
{
return main ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_kvm_main=yes
else
  ac_cv_lib_kvm_main=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_kvm_main" >&5
$as_echo "$ac_cv_lib_kvm_main" >&6; }
if test "x$ac_cv_lib_kvm_main" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBKVM 1
_ACEOF

  LIBS="-lkvm $LIBS"

fi
		    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nlist in -lld" >&5
$as_echo_n "checking for nlist in -lld... " >&6; }
if ${ac_cv_lib_ld_nlist+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lld  $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 nlist ();
int
main ()
{
return nlist ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_ld_nlist=yes
else
  ac_cv_lib_ld_nlist=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_ld_nlist" >&5
$as_echo "$ac_cv_lib_ld_nlist" >&6; }
if test "x$ac_cv_lib_ld_nlist" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBLD 1
_ACEOF

  LIBS="-lld $LIBS"

fi

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nlist in -lmld" >&5
$as_echo_n "checking for nlist in -lmld... " >&6; }
if ${ac_cv_lib_mld_nlist+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lmld  $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 nlist ();
int
main ()
{
return nlist ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_mld_nlist=yes
else
  ac_cv_lib_mld_nlist=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_mld_nlist" >&5
$as_echo "$ac_cv_lib_mld_nlist" >&6; }
if test "x$ac_cv_lib_mld_nlist" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBMLD 1
_ACEOF

  LIBS="-lmld $LIBS"

fi

    for ac_header in nlist.h sys/var.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 "$ac_cv_header_nlist_h" in
     yes)

$as_echo "#define NLIST_STRUCT 1" >>confdefs.h

    esac
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for n_un in struct nlist" >&5
$as_echo_n "checking for n_un in struct nlist... " >&6; }
if ${ntp_cv_struct_nlist_n_un+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		    #include 

int
main ()
{

		    struct nlist n;
		    n.n_un.n_name = 0;


  ;
  return 0;
}
	    ntp_cv_struct_nlist_n_un=yes
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_struct_nlist_n_un=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_nlist_n_un" >&5
$as_echo "$ntp_cv_struct_nlist_n_un" >&6; }
    case "$ntp_cv_struct_nlist_n_un" in
     yes)

$as_echo "#define NLIST_NAME_UNION 1" >>confdefs.h

    esac
    ;;
esac

for ac_header in sys/proc.h
do :
  ac_fn_c_check_header_compile "$LINENO" "sys/proc.h" "ac_cv_header_sys_proc_h" "#ifdef HAVE_SYS_TYPES_H
# include 
#endif
#ifdef HAVE_SYS_TIME_H
# include 
#endif

"
if test "x$ac_cv_header_sys_proc_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_PROC_H 1
_ACEOF

fi

done


for ac_header in sys/resource.h
do :
  ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "#ifdef HAVE_SYS_TIME_H
# include 
#endif

"
if test "x$ac_cv_header_sys_resource_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_RESOURCE_H 1
_ACEOF

fi

done


for ac_header in sys/shm.h
do :
  ac_fn_c_check_header_compile "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "#ifdef HAVE_SYS_TYPES_H
# include 
#endif
#ifdef HAVE_SYS_IPC_H
# include 
#endif

"
if test "x$ac_cv_header_sys_shm_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_SHM_H 1
_ACEOF

fi

done


for ac_header in sys/timex.h
do :
  ac_fn_c_check_header_compile "$LINENO" "sys/timex.h" "ac_cv_header_sys_timex_h" "#if HAVE_SYS_TIME_H
# include 
#endif

"
if test "x$ac_cv_header_sys_timex_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_TIMEX_H 1
_ACEOF

fi

done


for ac_header in resolv.h
do :
  ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "#ifdef HAVE_SYS_TYPES_H
#include 
#endif
#ifdef HAVE_NETINET_IN_H
#include 
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include 
#endif

"
if test "x$ac_cv_header_resolv_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_RESOLV_H 1
_ACEOF

fi

done


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for basic volatile support" >&5
$as_echo_n "checking for basic volatile support... " >&6; }
if ${ntp_cv_c_volatile+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */


int
main ()
{

		volatile int x;


  ;
  return 0;
}
	ntp_cv_c_volatile=yes
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_c_volatile=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_c_volatile" >&5
$as_echo "$ntp_cv_c_volatile" >&6; }
case "$ntp_cv_c_volatile" in
 yes)
    ;;
 *)

$as_echo "#define volatile /**/" >>confdefs.h

    ;;
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
if ${ac_cv_c_const+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{
/* FIXME: Include the comments suggested by Paul. */
#ifndef __cplusplus
  /* Ultrix mips cc rejects this.  */
  typedef int charset[2];
  const charset cs;
  /* SunOS 4.1.1 cc rejects this.  */
  char const *const *pcpcc;
  char **ppc;
  /* NEC SVR4.0.2 mips cc rejects this.  */
  struct point {int x, y;};
  static struct point const zero = {0,0};
  /* AIX XL C 1.02.0.0 rejects this.
     It does not let you subtract one const X* pointer from another in
     an arm of an if-expression whose if-part is not a constant
     expression */
  const char *g = "string";
  pcpcc = &g + (g ? g-g : 0);
  /* HPUX 7.0 cc rejects these. */
  ++pcpcc;
  ppc = (char**) pcpcc;
  pcpcc = (char const *const *) ppc;
  { /* SCO 3.2v4 cc rejects this.  */
    char *t;
    char const *s = 0 ? (char *) 0 : (char const *) 0;

    *t++ = 0;
    if (s) return 0;
  }
  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
    int x[] = {25, 17};
    const int *foo = &x[0];
    ++foo;
  }
  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
    typedef const int *iptr;
    iptr p = 0;
    ++p;
  }
  { /* AIX XL C 1.02.0.0 rejects this saying
       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
    struct s { int j; const int *ap[3]; };
    struct s *b; b->j = 5;
  }
  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
    const int foo = 10;
    if (!foo) return 0;
  }
  return !cs[0] && !zero.x;
#endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_c_const=yes
else
  ac_cv_c_const=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
$as_echo "$ac_cv_c_const" >&6; }
if test $ac_cv_c_const = no; then

$as_echo "#define const /**/" >>confdefs.h

fi

 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
if ${ac_cv_c_bigendian+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_cv_c_bigendian=unknown
    # See if we're dealing with a universal compiler.
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#ifndef __APPLE_CC__
	       not a universal capable compiler
	     #endif
	     typedef int dummy;

_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

	# Check for potential -arch flags.  It is not universal unless
	# there are at least two -arch flags with different values.
	ac_arch=
	ac_prev=
	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
	 if test -n "$ac_prev"; then
	   case $ac_word in
	     i?86 | x86_64 | ppc | ppc64)
	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
		 ac_arch=$ac_word
	       else
		 ac_cv_c_bigendian=universal
		 break
	       fi
	       ;;
	   esac
	   ac_prev=
	 elif test "x$ac_word" = "x-arch"; then
	   ac_prev=arch
	 fi
       done
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    if test $ac_cv_c_bigendian = unknown; then
      # See if sys/param.h defines the BYTE_ORDER macro.
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
	     #include 

int
main ()
{
#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
		     && LITTLE_ENDIAN)
	      bogus endian macros
	     #endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  # It does; now see whether it defined to BIG_ENDIAN or not.
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
		#include 

int
main ()
{
#if BYTE_ORDER != BIG_ENDIAN
		 not big endian
		#endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_c_bigendian=yes
else
  ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    fi
    if test $ac_cv_c_bigendian = unknown; then
      # See if  defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 

int
main ()
{
#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
	      bogus endian macros
	     #endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  # It does; now see whether it defined to _BIG_ENDIAN or not.
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 

int
main ()
{
#ifndef _BIG_ENDIAN
		 not big endian
		#endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_c_bigendian=yes
else
  ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    fi
    if test $ac_cv_c_bigendian = unknown; then
      # Compile a test program.
      if test "$cross_compiling" = yes; then :
  # Try to guess by grepping values from an object file.
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
short int ascii_mm[] =
		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
		short int ascii_ii[] =
		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
		int use_ascii (int i) {
		  return ascii_mm[i] + ascii_ii[i];
		}
		short int ebcdic_ii[] =
		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
		short int ebcdic_mm[] =
		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
		int use_ebcdic (int i) {
		  return ebcdic_mm[i] + ebcdic_ii[i];
		}
		extern int foo;

int
main ()
{
return use_ascii (foo) == use_ebcdic (foo);
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
	      ac_cv_c_bigendian=yes
	    fi
	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
	      if test "$ac_cv_c_bigendian" = unknown; then
		ac_cv_c_bigendian=no
	      else
		# finding both strings is unlikely to happen, but who knows?
		ac_cv_c_bigendian=unknown
	      fi
	    fi
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{

	     /* Are we little or big endian?  From Harbison&Steele.  */
	     union
	     {
	       long int l;
	       char c[sizeof (long int)];
	     } u;
	     u.l = 1;
	     return u.c[sizeof (long int) - 1] == 1;

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  ac_cv_c_bigendian=no
else
  ac_cv_c_bigendian=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
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
$as_echo "$ac_cv_c_bigendian" >&6; }
 case $ac_cv_c_bigendian in #(
   yes)
     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
;; #(
   no)
      ;; #(
   universal)

$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h

     ;; #(
   *)
     as_fn_error $? "unknown endianness
 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
 esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
$as_echo_n "checking return type of signal handlers... " >&6; }
if ${ac_cv_type_signal+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
#include 

int
main ()
{
return *(signal (0, 0)) (0) == 1;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_type_signal=int
else
  ac_cv_type_signal=void
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
$as_echo "$ac_cv_type_signal" >&6; }

cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
_ACEOF


ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
if test "x$ac_cv_type_off_t" = xyes; then :

else

cat >>confdefs.h <<_ACEOF
#define off_t long int
_ACEOF

fi

ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
if test "x$ac_cv_type_size_t" = xyes; then :

else

cat >>confdefs.h <<_ACEOF
#define size_t unsigned int
_ACEOF

fi

ac_fn_c_check_type "$LINENO" "time_t" "ac_cv_type_time_t" "$ac_includes_default"
if test "x$ac_cv_type_time_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_TIME_T 1
_ACEOF


fi
ac_fn_c_check_type "$LINENO" "long" "ac_cv_type_long" "$ac_includes_default"
if test "x$ac_cv_type_long" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_LONG 1
_ACEOF


fi
ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
if test "x$ac_cv_type_uintptr_t" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_UINTPTR_T 1
_ACEOF


fi

# 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.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
$as_echo_n "checking size of time_t... " >&6; }
if ${ac_cv_sizeof_time_t+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_time_t" = yes; then
     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (time_t)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_time_t=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5
$as_echo "$ac_cv_sizeof_time_t" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
_ACEOF





{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
if ${ac_cv_struct_tm+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 
#include 

int
main ()
{
struct tm tm;
				     int *p = &tm.tm_sec;
				     return !p;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_struct_tm=time.h
else
  ac_cv_struct_tm=sys/time.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
$as_echo "$ac_cv_struct_tm" >&6; }
if test $ac_cv_struct_tm = sys/time.h; then

$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int8_t" >&5
$as_echo_n "checking for u_int8_t... " >&6; }
if ${ntp_cv_type_u_int8_t+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif

int
main ()
{

		u_int8_t len = 42;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_type_u_int8_t=yes
else
  ntp_cv_type_u_int8_t=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_u_int8_t" >&5
$as_echo "$ntp_cv_type_u_int8_t" >&6; }
case "$ntp_cv_type_u_int8_t" in
 yes)

$as_echo "#define HAVE_TYPE_U_INT8_T 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int64_t" >&5
$as_echo_n "checking for u_int64_t... " >&6; }
if ${ntp_cv_type_u_int64_t+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif

int
main ()
{

		u_int64_t len = 42;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_type_u_int64_t=yes
else
  ntp_cv_type_u_int64_t=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_u_int64_t" >&5
$as_echo "$ntp_cv_type_u_int64_t" >&6; }
case "$ntp_cv_type_u_int64_t" in
 yes)

$as_echo "#define HAVE_TYPE_U_INT64_T 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a fallback value for HZ" >&5
$as_echo_n "checking for a fallback value for HZ... " >&6; }
if ${ntp_cv_default_hz+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ntp_cv_default_hz=100
	case "$host" in
	 alpha*-dec-osf4*|alpha*-dec-osf5*)
	    ntp_cv_default_hz=1024
	    ;;
	 mips-dec-ultrix4*)
	    ntp_cv_default_hz=256
	    ;;
	esac


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_default_hz" >&5
$as_echo "$ntp_cv_default_hz" >&6; }

cat >>confdefs.h <<_ACEOF
#define DEFAULT_HZ $ntp_cv_default_hz
_ACEOF


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to override the system's value for HZ" >&5
$as_echo_n "checking if we need to override the system's value for HZ... " >&6; }
if ${ntp_cv_override_hz+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ntp_cv_override_hz=no
	case "$host" in
	 alpha*-dec-osf4*|alpha*-dec-osf5*)
	    ntp_cv_override_hz=yes
	    ;;
	 mips-dec-ultrix4*)
	    ntp_cv_override_hz=yes
	    ;;
	 *-*-freebsd*)
	    ntp_cv_override_hz=yes
	    ;;
	 *-*-sunos4*)
	    ntp_cv_override_hz=yes
	    ;;
	 *-*-kfreebsd*)
	    ntp_cv_override_hz=yes
	    ;;
	esac


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_override_hz" >&5
$as_echo "$ntp_cv_override_hz" >&6; }
case "$ntp_cv_override_hz" in
 yes)

$as_echo "#define OVERRIDE_HZ 1" >>confdefs.h

esac



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct rt_msghdr" >&5
$as_echo_n "checking for struct rt_msghdr... " >&6; }
if ${ntp_cv_struct_rt_msghdr+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 
		#include 
		#include 
		#include 

int
main ()
{

		struct rt_msghdr p;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_struct_rt_msghdr=yes
else
  ntp_cv_struct_rt_msghdr=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_rt_msghdr" >&5
$as_echo "$ntp_cv_struct_rt_msghdr" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct rtattr" >&5
$as_echo_n "checking for struct rtattr... " >&6; }
if ${ntp_cv_rtattr+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 
		#include 
		#include 

int
main ()
{

		struct rtattr p;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_rtattr=yes
else
  ntp_cv_rtattr=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rtattr" >&5
$as_echo "$ntp_cv_rtattr" >&6; }

case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in
 *yes*)

$as_echo "#define HAS_ROUTING_SOCKET 1" >>confdefs.h

    case "$ntp_cv_rtattr" in
     yes)

$as_echo "#define HAVE_RTNETLINK 1" >>confdefs.h

    esac
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sigaction for sa_sigaction" >&5
$as_echo_n "checking struct sigaction for sa_sigaction... " >&6; }
if ${ntp_cv_struct_sigaction_has_sa_sigaction+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 

int
main ()
{

		struct sigaction act;
		act.sa_sigaction = 0;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_struct_sigaction_has_sa_sigaction=yes
else
  ntp_cv_struct_sigaction_has_sa_sigaction=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_sigaction_has_sa_sigaction" >&5
$as_echo "$ntp_cv_struct_sigaction_has_sa_sigaction" >&6; }
case "$ntp_cv_struct_sigaction_has_sa_sigaction" in
 yes)

$as_echo "#define HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ppsclockev" >&5
$as_echo_n "checking for struct ppsclockev... " >&6; }
if ${ntp_cv_struct_ppsclockev+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
		#ifdef HAVE_SYS_TERMIOS_H
		# include 
		#endif
		#ifdef HAVE_SYS_TIME_H
		# include 
		#endif
		#ifdef HAVE_SYS_PPSCLOCK_H
		# include 
		#endif

int
main ()
{

		extern struct ppsclockev *pce;
		return pce->serial;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_struct_ppsclockev=yes
else
  ntp_cv_struct_ppsclockev=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_ppsclockev" >&5
$as_echo "$ntp_cv_struct_ppsclockev" >&6; }
case "$ntp_cv_struct_ppsclockev" in
 yes)

$as_echo "#define HAVE_STRUCT_PPSCLOCKEV 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5
$as_echo_n "checking for struct sockaddr_storage... " >&6; }
if ${ntp_cv_sockaddr_storage+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
		#ifdef HAVE_SYS_SOCKET_H
		# include 
		#endif
		#ifdef HAVE_NETINET_IN_H
		# include 
		#endif

int
main ()
{

		struct sockaddr_storage n;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_sockaddr_storage=yes
else
  ntp_cv_sockaddr_storage=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_sockaddr_storage" >&5
$as_echo "$ntp_cv_sockaddr_storage" >&6; }
case "$ntp_cv_sockaddr_storage" in
 yes)

$as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.ss_family" >&5
$as_echo_n "checking for sockaddr_storage.ss_family... " >&6; }
if ${ntp_cv_have_ss_family+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
		#ifdef HAVE_SYS_SOCKET_H
		# include 
		#endif
		#ifdef HAVE_NETINET_IN_H
		# include 
		#endif

int
main ()
{

		struct sockaddr_storage s;
		s.ss_family = 1;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_have_ss_family=yes
else
  ntp_cv_have_ss_family=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have_ss_family" >&5
$as_echo "$ntp_cv_have_ss_family" >&6; }

case "$ntp_cv_have_ss_family" in
 no)
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.__ss_family" >&5
$as_echo_n "checking for sockaddr_storage.__ss_family... " >&6; }
if ${ntp_cv_have___ss_family+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		    #ifdef HAVE_SYS_TYPES_H
		    # include 
		    #endif
		    #ifdef HAVE_SYS_SOCKET_H
		    # include 
		    #endif
		    #ifdef HAVE_NETINET_IN_H
		    # include 
		    #endif

int
main ()
{

		    struct sockaddr_storage s;
		    s.__ss_family = 1;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_have___ss_family=yes
else
  ntp_cv_have___ss_family=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have___ss_family" >&5
$as_echo "$ntp_cv_have___ss_family" >&6; }
    case "$ntp_cv_have___ss_family" in
     yes)

$as_echo "#define HAVE___SS_FAMILY_IN_SS 1" >>confdefs.h

    esac
esac



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.ss_len" >&5
$as_echo_n "checking for sockaddr_storage.ss_len... " >&6; }
if ${ntp_cv_have_ss_len+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
		#ifdef HAVE_SYS_SOCKET_H
		# include 
		#endif
		#ifdef HAVE_NETINET_IN_H
		# include 
		#endif

int
main ()
{

		struct sockaddr_storage s;
		s.ss_len = 1;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_have_ss_len=yes
else
  ntp_cv_have_ss_len=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have_ss_len" >&5
$as_echo "$ntp_cv_have_ss_len" >&6; }

case "$ntp_cv_have_ss_len" in
 no)
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.__ss_len" >&5
$as_echo_n "checking for sockaddr_storage.__ss_len... " >&6; }
if ${ntp_cv_have___ss_len+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		    #ifdef HAVE_SYS_TYPES_H
		    # include 
		    #endif
		    #ifdef HAVE_SYS_SOCKET_H
		    # include 
		    #endif
		    #ifdef HAVE_NETINET_IN_H
		    # include 
		    #endif

int
main ()
{

		    struct sockaddr_storage s;
		    s.__ss_len = 1;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_have___ss_len=yes
else
  ntp_cv_have___ss_len=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have___ss_len" >&5
$as_echo "$ntp_cv_have___ss_len" >&6; }
    case "$ntp_cv_have___ss_len" in
     yes)

$as_echo "#define HAVE___SS_LEN_IN_SS 1" >>confdefs.h

    esac
esac



#
# Look for in_port_t.
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_port_t" >&5
$as_echo_n "checking for in_port_t... " >&6; }
if ${isc_cv_have_in_port_t+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 
		#include 

int
main ()
{

		in_port_t port = 25;
		return (0);


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  isc_cv_have_in_port_t=yes
else
  isc_cv_have_in_port_t=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in_port_t" >&5
$as_echo "$isc_cv_have_in_port_t" >&6; }
case "$isc_cv_have_in_port_t" in
 no)

$as_echo "#define ISC_PLATFORM_NEEDPORTT 1" >>confdefs.h

esac

case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
  *yes*)
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct snd_size" >&5
$as_echo_n "checking for struct snd_size... " >&6; }
if ${ntp_cv_struct_snd_size+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		    #ifdef HAVE_MACHINE_SOUNDCARD_H
		    # include 
		    #endif
		    #ifdef HAVE_SYS_SOUNDCARD_H
		    # include 
		    #endif

int
main ()
{

		    extern struct snd_size *ss;
		    return ss->rec_size;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_struct_snd_size=yes
else
  ntp_cv_struct_snd_size=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_snd_size" >&5
$as_echo "$ntp_cv_struct_snd_size" >&6; }
    case "$ntp_cv_struct_snd_size" in
     yes)

$as_echo "#define HAVE_STRUCT_SND_SIZE 1" >>confdefs.h

    esac
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct clockinfo for hz" >&5
$as_echo_n "checking struct clockinfo for hz... " >&6; }
if ${ntp_cv_struct_clockinfo_has_hz+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 

int
main ()
{

		extern struct clockinfo *pc;
		return pc->hz;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_struct_clockinfo_has_hz=yes
else
  ntp_cv_struct_clockinfo_has_hz=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_clockinfo_has_hz" >&5
$as_echo "$ntp_cv_struct_clockinfo_has_hz" >&6; }
case "$ntp_cv_struct_clockinfo_has_hz" in
 yes)

$as_echo "#define HAVE_HZ_IN_STRUCT_CLOCKINFO 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct clockinfo for tickadj" >&5
$as_echo_n "checking struct clockinfo for tickadj... " >&6; }
if ${ntp_cv_struct_clockinfo_has_hz+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 

int
main ()
{

		extern struct clockinfo *pc;
		return pc->tickadj;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_struct_clockinfo_has_hz=yes
else
  ntp_cv_struct_clockinfo_has_hz=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_clockinfo_has_hz" >&5
$as_echo "$ntp_cv_struct_clockinfo_has_hz" >&6; }
case "$ntp_cv_struct_clockinfo_has_hz" in
 yes)

$as_echo "#define HAVE_TICKADJ_IN_STRUCT_CLOCKINFO 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec" >&5
$as_echo_n "checking for struct timespec... " >&6; }
if ${ntp_cv_struct_timespec+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 
		/* Under SunOS, timespec is in sys/timepps.h,
		   which needs errno.h and FRAC */
		#ifdef HAVE_ERRNO_H
		# include 
		#endif
		#ifdef HAVE_SYS_TIMEPPS_H
		# define FRAC 4294967296
		# include 
		#endif

int
main ()
{

		struct timespec n;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_struct_timespec=yes
else
  ntp_cv_struct_timespec=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_timespec" >&5
$as_echo "$ntp_cv_struct_timespec" >&6; }
case "$ntp_cv_struct_timespec" in
 yes)

$as_echo "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ntptimeval" >&5
$as_echo_n "checking for struct ntptimeval... " >&6; }
if ${ntp_cv_struct_ntptimeval+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 
		#include 

int
main ()
{

		struct ntptimeval n;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_struct_ntptimeval=yes
else
  ntp_cv_struct_ntptimeval=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_ntptimeval" >&5
$as_echo "$ntp_cv_struct_ntptimeval" >&6; }
case "$ntp_cv_struct_ntptimeval" in
 yes)

$as_echo "#define HAVE_STRUCT_NTPTIMEVAL 1" >>confdefs.h

esac

ac_fn_c_check_member "$LINENO" "struct ntptimeval" "time.tv_nsec" "ac_cv_member_struct_ntptimeval_time_tv_nsec" "
	#ifdef HAVE_SYS_TIME_H
	#include 
	#else
	# ifdef HAVE_TIME_H
	#  include 
	# endif
	#endif
	#ifdef HAVE_SYS_TIMEX_H
	# include 
	#else
	# ifdef HAVE_TIMEX_H
	#  include 
	# endif
	#endif


"
if test "x$ac_cv_member_struct_ntptimeval_time_tv_nsec" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_NTPTIMEVAL_TIME_TV_NSEC 1
_ACEOF


fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
$as_echo_n "checking for inline... " >&6; }
if ${ac_cv_c_inline+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#ifndef __cplusplus
typedef int foo_t;
static $ac_kw foo_t static_foo () {return 0; }
$ac_kw foo_t foo () {return 0; }
#endif

_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_c_inline=$ac_kw
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  test "$ac_cv_c_inline" != no && break
done

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
$as_echo "$ac_cv_c_inline" >&6; }

case $ac_cv_c_inline in
  inline | yes) ;;
  *)
    case $ac_cv_c_inline in
      no) ac_val=;;
      *) ac_val=$ac_cv_c_inline;;
    esac
    cat >>confdefs.h <<_ACEOF
#ifndef __cplusplus
#define inline $ac_val
#endif
_ACEOF
    ;;
esac


case "$ac_cv_c_inline" in
 '')
    ;;
 *)

$as_echo "#define HAVE_INLINE 1" >>confdefs.h


esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5
$as_echo_n "checking whether char is unsigned... " >&6; }
if ${ac_cv_c_char_unsigned+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((char) -1) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_c_char_unsigned=no
else
  ac_cv_c_char_unsigned=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5
$as_echo "$ac_cv_c_char_unsigned" >&6; }
if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
  $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h

fi
		# 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.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed char" >&5
$as_echo_n "checking size of signed char... " >&6; }
if ${ac_cv_sizeof_signed_char+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed char))" "ac_cv_sizeof_signed_char"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_signed_char" = yes; then
     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (signed char)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_signed_char=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_char" >&5
$as_echo "$ac_cv_sizeof_signed_char" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
_ACEOF


ac_fn_c_check_type "$LINENO" "s_char" "ac_cv_type_s_char" "$ac_includes_default"
if test "x$ac_cv_type_s_char" = xyes; then :

cat >>confdefs.h <<_ACEOF
#define HAVE_S_CHAR 1
_ACEOF


fi

# 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.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
$as_echo_n "checking size of int... " >&6; }
if ${ac_cv_sizeof_int+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_int" = yes; then
     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (int)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_int=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
$as_echo "$ac_cv_sizeof_int" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_INT $ac_cv_sizeof_int
_ACEOF


# 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.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
$as_echo_n "checking size of long... " >&6; }
if ${ac_cv_sizeof_long+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_long" = yes; then
     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (long)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_long=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
$as_echo "$ac_cv_sizeof_long" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG $ac_cv_sizeof_long
_ACEOF



case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
 *yes)
    # We have a typedef for s_char.  Might as well believe it...
    ;;
 no0no)
    # We have signed chars, can't say 'signed char', no s_char typedef.

$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h

    ;;
 no1no)
    # We have signed chars, can say 'signed char', no s_char typedef.

$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h

    ;;
 yes0no)
    # We have unsigned chars, can't say 'signed char', no s_char typedef.
    as_fn_error $? "No way to specify a signed character!" "$LINENO" 5
    ;;
 yes1no)
    # We have unsigned chars, can say 'signed char', no s_char typedef.

$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h

    ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
if ${ac_cv_type_uid_t+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include 

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "uid_t" >/dev/null 2>&1; then :
  ac_cv_type_uid_t=yes
else
  ac_cv_type_uid_t=no
fi
rm -f conftest*

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
$as_echo "$ac_cv_type_uid_t" >&6; }
if test $ac_cv_type_uid_t = no; then

$as_echo "#define uid_t int" >>confdefs.h


$as_echo "#define gid_t int" >>confdefs.h

fi


case "$host" in
 *-*-aix[456]*)
	# (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
	# (returning ENOSYS).  I didn't check 4.2.  If, in the future,
	# IBM pulls its thumbs out long enough to implement clock_settime,
	# this conditional will need to change.  Maybe use AC_TRY_RUN
	# instead to try to set the time to itself and check errno.
    ;;
 *)
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
$as_echo_n "checking for library containing clock_gettime... " >&6; }
if ${ac_cv_search_clock_gettime+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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 clock_gettime ();
int
main ()
{
return clock_gettime ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' rt; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_clock_gettime=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_clock_gettime+:} false; then :
  break
fi
done
if ${ac_cv_search_clock_gettime+:} false; then :

else
  ac_cv_search_clock_gettime=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
$as_echo "$ac_cv_search_clock_gettime" >&6; }
ac_res=$ac_cv_search_clock_gettime
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi

    for ac_func in clock_gettime clock_settime
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

    ;;
esac
for ac_func in daemon
do :
  ac_fn_c_check_func "$LINENO" "daemon" "ac_cv_func_daemon"
if test "x$ac_cv_func_daemon" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_DAEMON 1
_ACEOF

fi
done

for ac_func in finite
do :
  ac_fn_c_check_func "$LINENO" "finite" "ac_cv_func_finite"
if test "x$ac_cv_func_finite" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_FINITE 1
_ACEOF

else
  for ac_func in isfinite
do :
  ac_fn_c_check_func "$LINENO" "isfinite" "ac_cv_func_isfinite"
if test "x$ac_cv_func_isfinite" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_ISFINITE 1
_ACEOF

else

	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isfinite with " >&5
$as_echo_n "checking for isfinite with ... " >&6; }
	    _libs=$LIBS
	    LIBS="$LIBS -lm"
	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

			#include 

int
main ()
{

			float f = 0.0;
			isfinite(f);


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ans=yes
else
  ans=no

fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
	    LIBS=$_libs
	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }
	    case "$ans" in
	     yes)
		$as_echo "#define HAVE_ISFINITE 1" >>confdefs.h

	    esac


fi
done


fi
done


for ac_func in getbootfile getclock getdtablesize
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


# Check whether --enable-getifaddrs was given.
if test "${enable_getifaddrs+set}" = set; then :
  enableval=$enable_getifaddrs; want_getifaddrs="$enableval"
else
  want_getifaddrs="yes"

fi


case $want_getifaddrs in
 yes|glibc)
    #
    # Do we have getifaddrs() ?
    #
    case $host in
     *-*linux*)
	# Some recent versions of glibc support getifaddrs() which does not
	# provide AF_INET6 addresses while the function provided by the USAGI
	# project handles the AF_INET6 case correctly.  We need to avoid
	# using the former but prefer the latter unless overridden by
	# --enable-getifaddrs=glibc.
	case "$want_getifaddrs" in
	 glibc)
	    for ac_func in getifaddrs
do :
  ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs"
if test "x$ac_cv_func_getifaddrs" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_GETIFADDRS 1
_ACEOF

fi
done

	    ;;
	 *)
	    save_LIBS="$LIBS"
	    LIBS="-L/usr/local/v6/lib $LIBS"
	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getifaddrs in -linet6" >&5
$as_echo_n "checking for getifaddrs in -linet6... " >&6; }
if ${ac_cv_lib_inet6_getifaddrs+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-linet6  $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 getifaddrs ();
int
main ()
{
return getifaddrs ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_inet6_getifaddrs=yes
else
  ac_cv_lib_inet6_getifaddrs=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_inet6_getifaddrs" >&5
$as_echo "$ac_cv_lib_inet6_getifaddrs" >&6; }
if test "x$ac_cv_lib_inet6_getifaddrs" = xyes; then :
  ans=yes
else
  ans=no

fi

	    case "$ans" in
	     yes)
		LIBS="$LIBS -linet6"
		$as_echo "#define HAVE_GETIFADDRS 1" >>confdefs.h

		;;
	     *)
		LIBS=${save_LIBS}
		;;
	    esac
	    ;;
	esac
	;;
    esac
    ;;
 *)
    for ac_func in getifaddrs
do :
  ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs"
if test "x$ac_cv_func_getifaddrs" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_GETIFADDRS 1
_ACEOF

fi
done

    ;;
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of socklen arg for getsockname()" >&5
$as_echo_n "checking type of socklen arg for getsockname()... " >&6; }
if ${ntp_cv_getsockname_socklen_type+:} false; then :
  $as_echo_n "(cached) " >&6
else

    getsockname_socklen_type_found=no
    for getsockname_arg2 in 'struct sockaddr *' 'void *'; do
	for ntp_cv_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do
	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

			#ifdef HAVE_SYS_TYPES_H
			# include 
			#endif
			#ifdef HAVE_SYS_SOCKET_H
			# include 
			#endif

int
main ()
{

			extern
			getsockname(int, $getsockname_arg2,
				$ntp_cv_getsockname_socklen_type *);


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  getsockname_socklen_type_found=yes ; break 2
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
	done
    done
    case "$getsockname_socklen_type_found" in
     no)
	ntp_cv_getsockname_socklen_type='socklen_t'
    esac
    { getsockname_arg2=; unset getsockname_arg2;}
    { getsockname_socklen_type_found=; unset getsockname_socklen_type_found;}


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_getsockname_socklen_type" >&5
$as_echo "$ntp_cv_getsockname_socklen_type" >&6; }

cat >>confdefs.h <<_ACEOF
#define GETSOCKNAME_SOCKLEN_TYPE $ntp_cv_getsockname_socklen_type
_ACEOF


for ac_func in getuid getrusage hstrerror
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

ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
if test "x$ac_cv_func_gettimeofday" = xyes; then :

else

case "$host" in
  *-*-mpeix*) ac_cv_func_gettimeofday=yes
    ;;
esac
fi


#
# Check for if_nametoindex() for IPv6 scoped addresses support
#
case "$host" in
 *-hp-hpux*)
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing if_nametoindex" >&5
$as_echo_n "checking for library containing if_nametoindex... " >&6; }
if ${ac_cv_search_if_nametoindex+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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 if_nametoindex ();
int
main ()
{
return if_nametoindex ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' ipv6; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_if_nametoindex=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_if_nametoindex+:} false; then :
  break
fi
done
if ${ac_cv_search_if_nametoindex+:} false; then :

else
  ac_cv_search_if_nametoindex=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_if_nametoindex" >&5
$as_echo "$ac_cv_search_if_nametoindex" >&6; }
ac_res=$ac_cv_search_if_nametoindex
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi

esac
for ac_func in if_nametoindex
do :
  ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex"
if test "x$ac_cv_func_if_nametoindex" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_IF_NAMETOINDEX 1
_ACEOF

fi
done

case "$ac_cv_func_if_nametoindex" in
 yes)

$as_echo "#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
$as_echo_n "checking for library containing inet_ntop... " >&6; }
if ${ac_cv_search_inet_ntop+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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 inet_ntop ();
int
main ()
{
return inet_ntop ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' resolv; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib -lsocket -lnsl $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_inet_ntop=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_inet_ntop+:} false; then :
  break
fi
done
if ${ac_cv_search_inet_ntop+:} false; then :

else
  ac_cv_search_inet_ntop=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
$as_echo "$ac_cv_search_inet_ntop" >&6; }
ac_res=$ac_cv_search_inet_ntop
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi

ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
if test "x$ac_cv_func_inet_ntop" = xyes; then :

else

$as_echo "#define ISC_PLATFORM_NEEDNTOP 1" >>confdefs.h

fi

ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
if test "x$ac_cv_func_inet_pton" = xyes; then :

else

$as_echo "#define ISC_PLATFORM_NEEDPTON 1" >>confdefs.h

fi


case "$ac_cv_header_kvm_h" in
 yes)
    for ac_func in kvm_open
do :
  ac_fn_c_check_func "$LINENO" "kvm_open" "ac_cv_func_kvm_open"
if test "x$ac_cv_func_kvm_open" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_KVM_OPEN 1
_ACEOF

fi
done

    ;;
esac

for ac_func in memcpy memmove memset
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

case "$host" in
 *-*-sco3.2v5.0.*)
    # Just stubs.  Idiots.
    ;;
 *) for ac_func in mkstemp
do :
  ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp"
if test "x$ac_cv_func_mkstemp" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_MKSTEMP 1
_ACEOF

fi
done

    ;;
esac
for ac_func in mktime
do :
  ac_fn_c_check_func "$LINENO" "mktime" "ac_cv_func_mktime"
if test "x$ac_cv_func_mktime" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_MKTIME 1
_ACEOF

fi
done

case "$host" in
 *-*-aix[456]*)
    # Just a stub.  Idiots.
    ;;
 *-*-irix[45]*)
    # Just a stub in "old" Irix.  Idiots.
    ;;
 *-*-*linux*)
    # there, but more trouble than it is worth for now (resolver problems)
    ;;
 *-*-qnx*)
    # Apparently there but not working in QNX.  Idiots?
    ;;
 *-*-sco3.2v5.0.*)
    # Just a stub.  Idiots.
    ;;
 alpha*-dec-osf4*|alpha*-dec-osf5*)
    # mlockall is there, as a #define calling memlk via 
    # Not easy to test for - cheat.
    for ac_func in memlk
do :
  ac_fn_c_check_func "$LINENO" "memlk" "ac_cv_func_memlk"
if test "x$ac_cv_func_memlk" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_MEMLK 1
_ACEOF
 ac_cv_func_mlockall=yes
fi
done

    for ac_func in mlockall
do :
  ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall"
if test "x$ac_cv_func_mlockall" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_MLOCKALL 1
_ACEOF

fi
done

    ;;
 *) for ac_func in mlockall
do :
  ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall"
if test "x$ac_cv_func_mlockall" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_MLOCKALL 1
_ACEOF

fi
done

    ;;
esac
for ac_func in nice nlist
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

case "$host" in
 *-*-solaris2.6)
    # Broken...
    ;;
 *) for ac_func in ntp_adjtime ntp_gettime
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

    ;;
esac
for ac_func in plock pututline pututxline readlink recvmsg rtprio
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

case "$host" in
 *-*-aix[456]*)
    # Just a stub in AIX 4.  Idiots.
    ;;
 *-*-solaris2.5*)
    # Just stubs in solaris2.5.  Idiots.
    ;;
 *) for ac_func in sched_setscheduler
do :
  ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler"
if test "x$ac_cv_func_sched_setscheduler" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SCHED_SETSCHEDULER 1
_ACEOF

fi
done

    ;;
esac
for ac_func in setlinebuf setpgid setpriority setsid
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 setrlimit
do :
  ac_fn_c_check_func "$LINENO" "setrlimit" "ac_cv_func_setrlimit"
if test "x$ac_cv_func_setrlimit" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SETRLIMIT 1
_ACEOF

fi
done

for ac_func in settimeofday
do :
  ac_fn_c_check_func "$LINENO" "settimeofday" "ac_cv_func_settimeofday"
if test "x$ac_cv_func_settimeofday" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SETTIMEOFDAY 1
_ACEOF

else

case "$host" in
  *-*-mpeix*) ac_cv_func_settimeofday=yes
    ;;
esac
fi
done

for ac_func in setvbuf sigaction sigvec sigset sigsuspend stime strchr
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 sysconf sysctl snprintf strdup strerror strstr timegm
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

case "$host" in
 *-*-aix[456]*)
    # Just stubs.  Idiots.
    ;;
 *-*-netbsd1*)
    # Just stubs.  Idiots.
    ;;
 *-*-netbsdelf1*)
    # Just stubs.  Idiots.
    ;;
 *-*-openbsd*)
    # Just stubs.  Idiots.
    ;;
 *) for ac_func in timer_create timer_settime
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

    ;;
esac
for ac_func in umask uname updwtmp updwtmpx vsnprintf vsprintf
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


###

# http://bugs.ntp.org/737
case "$ac_cv_func_recvmsg" in
 yes)
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need extra help to define struct iovec" >&5
$as_echo_n "checking if we need extra help to define struct iovec... " >&6; }
if ${ntp_cv_struct_iovec_help+:} false; then :
  $as_echo_n "(cached) " >&6
else

	    compiled=no
	    for ntp_cv_struct_iovec_help in '0' '1'; do
		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

			    #ifdef HAVE_SYS_TYPES_H
			    # include 
			    #endif
			    #ifdef HAVE_SYS_SOCKET_H
			    # include 
			    #endif
			    #if $ntp_cv_struct_iovec_help
			    # include 
			    #endif

int
main ()
{

			    void foo(void) {
				ssize_t x;
				int s = 0;
				struct iovec iov;
				struct msghdr mh;
				int flags = 0;

				mh.msg_iov = &iov;
				x = recvmsg(s, &mh, flags);
			    }


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  compiled=yes ; break 1
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
	    done
	    case "$compiled" in
	     no)
		ntp_cv_struct_iovec_help=0
	    esac
	    { compiled=; unset compiled;}


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_iovec_help" >&5
$as_echo "$ntp_cv_struct_iovec_help" >&6; }
    case "$ntp_cv_struct_iovec_help" in
     1)

$as_echo "#define HAVE_SYS_UIO_H 1" >>confdefs.h

    esac
esac

case "$host" in
 *-*-sunos4*)

$as_echo "#define SPRINTF_CHAR 1" >>confdefs.h

    ;;
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments to gettimeofday()" >&5
$as_echo_n "checking number of arguments to gettimeofday()... " >&6; }
if ${ntp_cv_func_Xettimeofday_nargs+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 

int
main ()
{

		gettimeofday(0, 0);
		settimeofday(0, 0);


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_func_Xettimeofday_nargs=2
else
  ntp_cv_func_Xettimeofday_nargs=1

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_Xettimeofday_nargs" >&5
$as_echo "$ntp_cv_func_Xettimeofday_nargs" >&6; }
case "$ntp_cv_func_Xettimeofday_nargs" in
 1)

$as_echo "#define SYSV_TIMEOFDAY 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments taken by setpgrp()" >&5
$as_echo_n "checking number of arguments taken by setpgrp()... " >&6; }
if ${ntp_cv_func_setpgrp_nargs+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
		#ifdef HAVE_UNISTD_H
		# include 
		#endif

int
main ()
{

		setpgrp(0, 0);


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_func_setpgrp_nargs=2
else
  ntp_cv_func_setpgrp_nargs=0

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_setpgrp_nargs" >&5
$as_echo "$ntp_cv_func_setpgrp_nargs" >&6; }
case "$ntp_cv_func_setpgrp_nargs" in
 0)

$as_echo "#define HAVE_SETPGRP_0 1" >>confdefs.h

esac


$as_echo "#define QSORT_USES_VOID_P 1" >>confdefs.h


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to declare 'errno'" >&5
$as_echo_n "checking if we need to declare 'errno'... " >&6; }
if ${ntp_cv_decl_errno+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#ifdef HAVE_ERRNO_H
		# include 
		#endif

int
main ()
{

		errno = 0;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_decl_errno=no
else
  ntp_cv_decl_errno=yes

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_decl_errno" >&5
$as_echo "$ntp_cv_decl_errno" >&6; }
case "$ntp_cv_decl_errno" in
 yes)

$as_echo "#define DECL_ERRNO 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we may declare 'h_errno'" >&5
$as_echo_n "checking if we may declare 'h_errno'... " >&6; }
if ${ntp_cv_decl_h_errno+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 
		#ifdef HAVE_NETINET_IN_H
		# include 
		#endif
		#ifdef HAVE_ARPA_NAMESER_H
		# include 
		#endif
		#ifdef HAVE_NETDB_H
		# include 
		#endif
		#ifdef HAVE_RESOLV_H
		# include 
		#endif

int
main ()
{

		extern int h_errno;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_decl_h_errno=yes
else
  ntp_cv_decl_h_errno=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_decl_h_errno" >&5
$as_echo "$ntp_cv_decl_h_errno" >&6; }
case "$ntp_cv_decl_h_errno" in
 yes)

$as_echo "#define DECL_H_ERRNO 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if declaring 'syscall()' is ok" >&5
$as_echo_n "checking if declaring 'syscall()' is ok... " >&6; }
if ${ntp_cv_decl_syscall+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
		#ifdef HAVE_UNISTD_H
		# include 
		#endif

int
main ()
{

		extern int syscall (int, ...);


  ;
  return 0;
}
	ntp_cv_decl_syscall=yes
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_decl_syscall=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_decl_syscall" >&5
$as_echo "$ntp_cv_decl_syscall" >&6; }
case "$ntp_cv_decl_syscall" in
 yes)

$as_echo "#define DECL_SYSCALL 1" >>confdefs.h

esac

case "$host" in
 *-*-aix4.3.*)

$as_echo "#define DECL_HSTRERROR_0 1" >>confdefs.h
		# Needed for XLC under AIX 4.3.2
    ;;
 *-*-mpeix*)

$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h


$as_echo "#define DECL_INET_NTOA_0 1" >>confdefs.h


$as_echo "#define DECL_MKTEMP_0 1" >>confdefs.h


$as_echo "#define DECL_SELECT_0 1" >>confdefs.h


$as_echo "#define DECL_SETITIMER_0 1" >>confdefs.h


$as_echo "#define DECL_SYSLOG_0 1" >>confdefs.h


$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h

    ;;
 *-*-osf[45]*)

$as_echo "#define DECL_PLOCK_0 1" >>confdefs.h


$as_echo "#define DECL_STIME_1 1" >>confdefs.h

    ;;
 *-*-qnx*)

$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h

    ;;
 *-*-riscos4*)

$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h


$as_echo "#define DECL_BZERO_0 1" >>confdefs.h


$as_echo "#define DECL_IOCTL_0 1" >>confdefs.h


$as_echo "#define DECL_IPC_0 1" >>confdefs.h


$as_echo "#define DECL_MEMMOVE_0 1" >>confdefs.h


$as_echo "#define DECL_MKTEMP_0 1" >>confdefs.h


$as_echo "#define DECL_RENAME_0 1" >>confdefs.h


$as_echo "#define DECL_SELECT_0 1" >>confdefs.h


$as_echo "#define DECL_SETITIMER_0 1" >>confdefs.h


$as_echo "#define DECL_SETPRIORITY_0 1" >>confdefs.h


$as_echo "#define DECL_STDIO_0 1" >>confdefs.h


$as_echo "#define DECL_STRTOL_0 1" >>confdefs.h


$as_echo "#define DECL_SYSLOG_0 1" >>confdefs.h


$as_echo "#define DECL_TIME_0 1" >>confdefs.h


$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h


$as_echo "#define DECL_TOLOWER_0 1" >>confdefs.h

    ;;
 *-*-solaris2*)

$as_echo "#define DECL_MKSTEMP_0 1" >>confdefs.h


$as_echo "#define DECL_SETPRIORITY_1 1" >>confdefs.h

    case "$host" in
     *-*-solaris2.4)

$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h

	;;
    esac
    ;;
 *-*-sunos4*)

$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h


$as_echo "#define DECL_BCOPY_0 1" >>confdefs.h


$as_echo "#define DECL_BZERO_0 1" >>confdefs.h


$as_echo "#define DECL_IOCTL_0 1" >>confdefs.h


$as_echo "#define DECL_IPC_0 1" >>confdefs.h


$as_echo "#define DECL_MEMMOVE_0 1" >>confdefs.h


$as_echo "#define DECL_MKTEMP_0 1" >>confdefs.h


$as_echo "#define DECL_MKSTEMP_0 1" >>confdefs.h


$as_echo "#define DECL_RENAME_0 1" >>confdefs.h


$as_echo "#define DECL_SELECT_0 1" >>confdefs.h


$as_echo "#define DECL_SETITIMER_0 1" >>confdefs.h


$as_echo "#define DECL_SETPRIORITY_0 1" >>confdefs.h


$as_echo "#define DECL_SIGVEC_0 1" >>confdefs.h

    case "`basename $ac_cv_prog_CC`" in
     acc*) ;;
     *)
$as_echo "#define DECL_STDIO_0 1" >>confdefs.h

	;;
    esac

$as_echo "#define DECL_STRTOL_0 1" >>confdefs.h


$as_echo "#define DECL_SYSLOG_0 1" >>confdefs.h


$as_echo "#define DECL_TIME_0 1" >>confdefs.h


$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h


$as_echo "#define DECL_TOLOWER_0 1" >>confdefs.h


$as_echo "#define DECL_TOUPPER_0 1" >>confdefs.h


$as_echo "#define DECL_STRERROR_0 1" >>confdefs.h

    ;;
 *-*-ultrix4*)

$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h


$as_echo "#define DECL_BZERO_0 1" >>confdefs.h


$as_echo "#define DECL_CFSETISPEED_0 1" >>confdefs.h


$as_echo "#define DECL_IOCTL_0 1" >>confdefs.h


$as_echo "#define DECL_IPC_0 1" >>confdefs.h


$as_echo "#define DECL_MKTEMP_0 1" >>confdefs.h


$as_echo "#define DECL_NLIST_0 1" >>confdefs.h


$as_echo "#define DECL_PLOCK_0 1" >>confdefs.h


$as_echo "#define DECL_SELECT_0 1" >>confdefs.h


$as_echo "#define DECL_SETITIMER_0 1" >>confdefs.h


$as_echo "#define DECL_SETPRIORITY_0 1" >>confdefs.h


$as_echo "#define DECL_STIME_0 1" >>confdefs.h


$as_echo "#define DECL_SYSLOG_0 1" >>confdefs.h


$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h

    ;;
esac

case "$host" in
 *-*-sco3.2*)

$as_echo "#define TERMIOS_NEEDS__SVID3 1" >>confdefs.h

    ;;
esac

case "$host" in
 *-*-hpux[567]*)

$as_echo "#define NEED_RCVBUF_SLOP 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we will open the broadcast socket" >&5
$as_echo_n "checking if we will open the broadcast socket... " >&6; }
if ${ntp_cv_var_open_bcast_socket+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ans=yes
	case "$host" in
	 *-*-domainos)
	    ans=no
	esac
	ntp_cv_var_open_bcast_socket=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_open_bcast_socket" >&5
$as_echo "$ntp_cv_var_open_bcast_socket" >&6; }
case "$ntp_cv_var_open_bcast_socket" in
 yes)

$as_echo "#define OPEN_BCAST_SOCKET 1" >>confdefs.h

esac

case "$host" in
 *-*-hpux*)

$as_echo "#define NEED_HPUX_FINDCONFIG 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if process groups are set with -pid" >&5
$as_echo_n "checking if process groups are set with -pid... " >&6; }
if ${ntp_cv_arg_setpgrp_negpid+:} false; then :
  $as_echo_n "(cached) " >&6
else

	case "$host" in
	 *-*-hpux[567]*)
	    ans=no
	    ;;
	 *-*-hpux*)
	    ans=yes
	    ;;
	 *-*-*linux*)
	    ans=yes
	    ;;
	 *-*-sunos3*)
	    ans=yes
	    ;;
	 *-*-ultrix2*)
	    ans=yes
	    ;;
	 *)
	    ans=no
	    ;;
	esac
	ntp_cv_arg_setpgrp_negpid=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_arg_setpgrp_negpid" >&5
$as_echo "$ntp_cv_arg_setpgrp_negpid" >&6; }
case "$ntp_cv_arg_setpgrp_negpid" in
 yes)

$as_echo "#define UDP_BACKWARDS_SETOWN 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need a ctty for F_SETOWN" >&5
$as_echo_n "checking if we need a ctty for F_SETOWN... " >&6; }
if ${ntp_cv_func_ctty_for_f_setown+:} false; then :
  $as_echo_n "(cached) " >&6
else

	case "$host" in
	 *-*-bsdi23*)
	    ans=yes
	    ;;
	 *-*-freebsd*)
	    ans=yes
	    ;;
	# NetBSD versions prior to 3.99.8 require a CTTY for F_SETOWN,
	# while later versions will fail a ioctl(TIOCSCTTY, 0) call in
	# some cases and so should not have USE_FSETOWNCTTY.  "netbsd"
	# in $host may be followed by "aout", "ecoff", or "elf".
	 *-*-netbsd*a-z3.0-8*|*-*-netbsd*a-z0-2.*|*-*-netbsd*a-z3.99.0-7)
	    ans=yes
	    ;;
	 *-*-netbsd3.0-8*|*-*-netbsd0-2.*|*-*-netbsd3.99.0-7)
	    ans=yes
	    ;;
	 *-*-openbsd*)
	    ans=yes
	    ;;
	 *-*-osf*)
	    ans=yes
	    ;;
	 *-*-darwin*)
	    ans=yes
	    ;;
	 *)
	    ans=no
	    ;;
	esac
	ntp_cv_func_ctty_for_f_setown=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_ctty_for_f_setown" >&5
$as_echo "$ntp_cv_func_ctty_for_f_setown" >&6; }
case "$ntp_cv_func_ctty_for_f_setown" in
 yes)

$as_echo "#define USE_FSETOWNCTTY 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the OS clears cached routes when more specifics become available" >&5
$as_echo_n "checking if the OS clears cached routes when more specifics become available... " >&6; }
if ${ntp_cv_os_routeupdates+:} false; then :
  $as_echo_n "(cached) " >&6
else

	case "$host" in
	 *-*-netbsd*)
	    ans=yes
	    ;;
	 *)
	    ans=no
	    ;;
	esac
	ntp_cv_os_routeupdates=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_os_routeupdates" >&5
$as_echo "$ntp_cv_os_routeupdates" >&6; }
case "$ntp_cv_os_routeupdates" in
 yes)

$as_echo "#define OS_MISSES_SPECIFIC_ROUTE_UPDATES 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the wildcard socket needs REUSEADDR to bind other addresses" >&5
$as_echo_n "checking if the wildcard socket needs REUSEADDR to bind other addresses... " >&6; }
if ${ntp_cv_os_wildcardreuse+:} false; then :
  $as_echo_n "(cached) " >&6
else

	case "$host" in
	 *-*-*linux*)
	    ans=yes
	    ;;
	 *) ans=no
	    ;;
	esac
	ntp_cv_os_wildcardreuse=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_os_wildcardreuse" >&5
$as_echo "$ntp_cv_os_wildcardreuse" >&6; }
case "$ntp_cv_os_wildcardreuse" in
 yes)

$as_echo "#define OS_NEEDS_REUSEADDR_FOR_IFADDRBIND 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we'll use clock_settime or settimeofday or stime" >&5
$as_echo_n "checking if we'll use clock_settime or settimeofday or stime... " >&6; }
ntp_warning='GRONK'
ans=none
case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
 yes*)
    ntp_warning=''
    ans='clock_settime()'
    ;;
 noyes*)
    ntp_warning='But clock_settime() would be better (if we had it)'
    ans='settimeofday()'
    ;;
 nonoyes)
    ntp_warning='Which is the worst of the three'
    ans='stime()'
    ;;
 *)
    case "$build" in
     $host)
	ntp_warning='Which leaves us with nothing to use!'
    esac
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }
case "$ntp_warning" in
 '')
    ;;
 *)
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** $ntp_warning ***" >&5
$as_echo "$as_me: WARNING: *** $ntp_warning ***" >&2;}
    ;;
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGIO" >&5
$as_echo_n "checking for SIGIO... " >&6; }
if ${ntp_cv_hdr_def_sigio+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

	    #include 

	    #ifdef SIGIO
		yes
	    #endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then :
  ntp_cv_hdr_def_sigio=yes
else
  ntp_cv_hdr_def_sigio=no

fi
rm -f conftest*


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigio" >&5
$as_echo "$ntp_cv_hdr_def_sigio" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to use signalled IO" >&5
$as_echo_n "checking if we want to use signalled IO... " >&6; }
if ${ntp_cv_var_signalled_io+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ans=no
	case "$ntp_cv_hdr_def_sigio" in
	 yes)
	    ans=yes
	    case "$host" in
	     alpha*-dec-osf4*|alpha*-dec-osf5*)
		ans=no
		;;
	     *-convex-*)
		ans=no
		;;
	     *-dec-*)
		ans=no
		;;
	     *-pc-cygwin*)
		ans=no
		;;
	     *-sni-sysv*)
		ans=no
		;;
	     *-univel-sysv*)
		ans=no
		;;
	     *-*-irix6*)
		ans=no
		;;
	     *-*-freebsd*)
		ans=no
		;;
	     *-*-*linux*)
		ans=no
		;;
	     *-*-unicosmp*)
		ans=no
		;;
	     *-*-kfreebsd*)
		ans=no
		;;
	     m68k-*-mint*)
		ans=no
		;;
	    esac
	    ;;
	esac
	ntp_cv_var_signalled_io=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_signalled_io" >&5
$as_echo "$ntp_cv_var_signalled_io" >&6; }
case "$ntp_cv_var_signalled_io" in
 yes)

$as_echo "#define HAVE_SIGNALED_IO 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGPOLL" >&5
$as_echo_n "checking for SIGPOLL... " >&6; }
if ${ntp_cv_hdr_def_sigpoll+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

	    #include 

	    #ifdef SIGPOLL
		yes
	    #endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then :
  ntp_cv_hdr_def_sigpoll=yes
else
  ntp_cv_hdr_def_sigpoll=no

fi
rm -f conftest*


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigpoll" >&5
$as_echo "$ntp_cv_hdr_def_sigpoll" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGSYS" >&5
$as_echo_n "checking for SIGSYS... " >&6; }
if ${ntp_cv_hdr_def_sigsys+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

	    #include 

	    #ifdef SIGSYS
		yes
	    #endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then :
  ntp_cv_hdr_def_sigsys=yes
else
  ntp_cv_hdr_def_sigsys=no

fi
rm -f conftest*


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigsys" >&5
$as_echo "$ntp_cv_hdr_def_sigsys" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for UDP I/O" >&5
$as_echo_n "checking if we can use SIGPOLL for UDP I/O... " >&6; }
if ${ntp_cv_var_use_udp_sigpoll+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ans=no
	case "$ntp_cv_hdr_def_sigpoll" in
	 yes)
	    case "$host" in
	     mips-sgi-irix*)
		ans=no
		;;
	     vax-dec-bsd)
		ans=no
		;;
	     *-pc-cygwin*)
		ans=no
		;;
	     *-sni-sysv*)
		ans=no
		;;
	     *-*-aix[456]*)
		ans=no
		;;
	     *-*-hpux*)
		ans=no
		;;
	     *-*-*linux*)
		ans=no
		;;
	     *-*-osf*)
		ans=no
		;;
	     *-*-qnx*)
		ans=no
		;;
	     *-*-sunos*)
		ans=no
		;;
	     *-*-solaris*)
		ans=no
		;;
	     *-*-ultrix*)
		ans=no
		;;
	     *-*-unicosmp*)
		ans=no
		;;
	     *-*-kfreebsd*)
		ans=no
		;;
	     *) ans=yes
		;;
	    esac
	    ;;
	esac
	ntp_cv_var_use_udp_sigpoll=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_use_udp_sigpoll" >&5
$as_echo "$ntp_cv_var_use_udp_sigpoll" >&6; }
case "$ntp_cv_var_use_udp_sigpoll" in
 yes)

$as_echo "#define USE_UDP_SIGPOLL 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for TTY I/O" >&5
$as_echo_n "checking if we can use SIGPOLL for TTY I/O... " >&6; }
if ${ntp_cv_var_use_tty_sigpoll+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ans=no
	case "$ntp_cv_hdr_def_sigpoll" in
	 yes)
	    case "$host" in
	     mips-sgi-irix*)
		ans=no
		;;
	     vax-dec-bsd)
		ans=no
		;;
	     *-pc-cygwin*)
		ans=no
		;;
	     *-sni-sysv*)
		ans=no
		;;
	     *-*-aix[456]*)
		ans=no
		;;
	     *-*-hpux*)
		ans=no
		;;
	     *-*-*linux*)
		ans=no
		;;
	     *-*-osf*)
		ans=no
		;;
	     *-*-sunos*)
		ans=no
		;;
	     *-*-ultrix*)
		ans=no
		;;
	     *-*-qnx*)
		ans=no
		;;
	     *-*-unicosmp*)
		ans=no
		;;
	     *-*-kfreebsd*)
		ans=no
		;;
	     *) ans=yes
		;;
	    esac
	    ;;
	esac
	ntp_cv_var_use_tty_sigpoll=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_use_tty_sigpoll" >&5
$as_echo "$ntp_cv_var_use_tty_sigpoll" >&6; }
case "$ntp_cv_var_use_tty_sigpoll" in
 yes)

$as_echo "#define USE_TTY_SIGPOLL 1" >>confdefs.h

esac

case "$host" in
 *-*-aix*)

$as_echo "#define NLIST_EXTRA_INDIRECTION 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a minimum recommended value of tickadj" >&5
$as_echo_n "checking for a minimum recommended value of tickadj... " >&6; }
if ${ntp_cv_var_min_rec_tickadj+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ans=no
	case "$host" in
	 *-*-aix*)
	    ans=40
	    ;;
	esac
	ntp_cv_var_min_rec_tickadj=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_min_rec_tickadj" >&5
$as_echo "$ntp_cv_var_min_rec_tickadj" >&6; }
case "$ntp_cv_var_min_rec_tickadj" in
 ''|no)
    ;;
 *)

cat >>confdefs.h <<_ACEOF
#define MIN_REC_TICKADJ $ntp_cv_var_min_rec_tickadj
_ACEOF

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the TTY code permits PARENB and IGNPAR" >&5
$as_echo_n "checking if the TTY code permits PARENB and IGNPAR... " >&6; }
if ${ntp_cv_no_parenb_ignpar+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ans=no
	case "$host" in
	 i?86-*-*linux*)
	    ans=yes
	    ;;
	 mips-sgi-irix*)
	    ans=yes
	    ;;
	 i?86-*-freebsd[123].*)
	    ;;
	 i?86-*-freebsd*)
	    ans=yes
	    ;;
	 *-*-unicosmp*)
	    ans=yes
	    ;;
	esac
	ntp_cv_no_parenb_ignpar=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_no_parenb_ignpar" >&5
$as_echo "$ntp_cv_no_parenb_ignpar" >&6; }
case "$ntp_cv_no_parenb_ignpar" in
 yes)

$as_echo "#define NO_PARENB_IGNPAR 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we're including ntpd debugging code" >&5
$as_echo_n "checking if we're including ntpd debugging code... " >&6; }
# Check whether --enable-debugging was given.
if test "${enable_debugging+set}" = set; then :
  enableval=$enable_debugging; ntp_ok=$enableval
else
  ntp_ok=yes

fi

case "$ntp_ok" in
 yes)

$as_echo "#define DEBUG 1" >>confdefs.h

esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we're including processing time debugging code" >&5
$as_echo_n "checking if we're including processing time debugging code... " >&6; }
# Check whether --enable-debug-timing was given.
if test "${enable_debug_timing+set}" = set; then :
  enableval=$enable_debug_timing; ntp_ok=$enableval
else
  ntp_ok=no

fi

case "$ntp_ok" in
 yes)

$as_echo "#define DEBUG_TIMING 1" >>confdefs.h

esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a the number of minutes in a DST adjustment" >&5
$as_echo_n "checking for a the number of minutes in a DST adjustment... " >&6; }
# Check whether --enable-dst-minutes was given.
if test "${enable_dst_minutes+set}" = set; then :
  enableval=$enable_dst_minutes; ans=$enableval
else
  ans=60

fi


cat >>confdefs.h <<_ACEOF
#define DSTMINUTES $ans
_ACEOF

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ntpd will retry permanent DNS failures" >&5
$as_echo_n "checking if ntpd will retry permanent DNS failures... " >&6; }
# Check whether --enable-ignore-dns-errors was given.
if test "${enable_ignore_dns_errors+set}" = set; then :
  enableval=$enable_ignore_dns_errors; ans=$enableval
else
  ans=no

fi

case "$ans" in
 yes)

$as_echo "#define IGNORE_DNS_ERRORS 1" >>confdefs.h

esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ntpd will use the deferred DNS lookup path" >&5
$as_echo_n "checking if ntpd will use the deferred DNS lookup path... " >&6; }
# Check whether --enable-force-defer-DNS was given.
if test "${enable_force_defer_DNS+set}" = set; then :
  enableval=$enable_force_defer_DNS; ans=$enableval
else
  ans=no

fi

case "$ans" in
 yes)

$as_echo "#define FORCE_DEFER_DNS 1" >>confdefs.h

esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ac_cv_header_sys_sio_h" in
 yes)
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sio.h for TIOCDCDTIMESTAMP" >&5
$as_echo_n "checking sys/sio.h for TIOCDCDTIMESTAMP... " >&6; }
if ${ntp_cv_hdr_def_tiocdcdtimestamp+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 

		#ifdef TIOCDCDTIMESTAMP
		    yes
		#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then :
  ntp_cv_hdr_def_tiocdcdtimestamp=yes
else
  ntp_cv_hdr_def_tiocdcdtimestamp=no

fi
rm -f conftest*


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_tiocdcdtimestamp" >&5
$as_echo "$ntp_cv_hdr_def_tiocdcdtimestamp" >&6; }
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have the tty_clk line discipline/streams module" >&5
$as_echo_n "checking if we have the tty_clk line discipline/streams module... " >&6; }
if ${ntp_cv_tty_clk+:} false; then :
  $as_echo_n "(cached) " >&6
else

	case "$ac_cv_header_sys_clkdefs_h$ntp_cv_hdr_def_tiocdcdtimestamp" in
	 *yes*)
	    ntp_cv_tty_clk=yes
	    ;;
	 *)
	    ntp_cv_tty_clk=no
	    ;;
	esac


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_tty_clk" >&5
$as_echo "$ntp_cv_tty_clk" >&6; }
case "$ntp_cv_tty_clk" in
 yes)

$as_echo "#define TTYCLK 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the ppsclock streams module" >&5
$as_echo_n "checking for the ppsclock streams module... " >&6; }
case "$ntp_cv_struct_ppsclockev" in
 yes)
    ans=yes

$as_echo "#define PPS 1" >>confdefs.h

    ;;
 *)
    ans=no
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for multicast IP support" >&5
$as_echo_n "checking for multicast IP support... " >&6; }
if ${ntp_cv_multicast+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ntp_cv_multicast=no
	case "$host" in
	 i386-sequent-sysv4)
	    ;;
	 *)
	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

			#ifdef HAVE_NETINET_IN_H
			#include 
			#endif

int
main ()
{

			struct ip_mreq ipmr;
			ipmr.imr_interface.s_addr = 0;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_multicast=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
	esac


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_multicast" >&5
$as_echo "$ntp_cv_multicast" >&6; }
case "$ntp_cv_multicast" in
 yes)

$as_echo "#define MCAST 1" >>confdefs.h

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking arg type needed for setsockopt() IP*_MULTICAST_LOOP" >&5
$as_echo_n "checking arg type needed for setsockopt() IP*_MULTICAST_LOOP... " >&6; }
if ${ntp_cv_typeof_ip_multicast_loop+:} false; then :
  $as_echo_n "(cached) " >&6
else

	    case "$host" in
	     *-*-netbsd*|*-*-*linux*)
		ntp_cv_typeof_ip_multicast_loop=u_int
		;;
	     *)
		ntp_cv_typeof_ip_multicast_loop=u_char
	    esac


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_typeof_ip_multicast_loop" >&5
$as_echo "$ntp_cv_typeof_ip_multicast_loop" >&6; }

cat >>confdefs.h <<_ACEOF
#define TYPEOF_IP_MULTICAST_LOOP $ntp_cv_typeof_ip_multicast_loop
_ACEOF

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking availability of ntp_{adj,get}time()" >&5
$as_echo_n "checking availability of ntp_{adj,get}time()... " >&6; }
if ${ntp_cv_var_ntp_syscalls+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ntp_cv_var_ntp_syscalls=no
	case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
	 yesyes*)
	    ntp_cv_var_ntp_syscalls=libc
	    ;;
	 *yes)
	    ntp_cv_var_ntp_syscalls=inline
	    ;;
	 *)
	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		    #include 

		    #if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
			yes
		    #endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then :
  ntp_cv_var_ntp_syscalls=kernel

fi
rm -f conftest*

	    ;;
	 esac


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_ntp_syscalls" >&5
$as_echo "$ntp_cv_var_ntp_syscalls" >&6; }
case "$ntp_cv_var_ntp_syscalls" in
 libc)

$as_echo "#define NTP_SYSCALLS_LIBC 1" >>confdefs.h

    ;;
 kernel)

$as_echo "#define NTP_SYSCALLS_STD 1" >>confdefs.h

    ;;
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sys/timex.h has STA_FLL" >&5
$as_echo_n "checking if sys/timex.h has STA_FLL... " >&6; }
if ${ntp_cv_var_sta_fll+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

	    #include 

	    #ifdef STA_FLL
		yes
	    #endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then :
  ntp_cv_var_sta_fll=yes
else
  ntp_cv_var_sta_fll=no

fi
rm -f conftest*


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_sta_fll" >&5
$as_echo "$ntp_cv_var_sta_fll" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have kernel PLL support" >&5
$as_echo_n "checking if we have kernel PLL support... " >&6; }
if ${ntp_cv_var_kernel_pll+:} false; then :
  $as_echo_n "(cached) " >&6
else
  	case "$ac_cv_header_sys_timex_h$ntp_cv_struct_ntptimeval$ntp_cv_var_sta_fll$ntp_cv_var_ntp_syscalls" in
	 *no*)
	    ntp_cv_var_kernel_pll=no
	    ;;
	 *) ntp_cv_var_kernel_pll=yes
	    ;;
	esac


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_kernel_pll" >&5
$as_echo "$ntp_cv_var_kernel_pll" >&6; }
case "$ntp_cv_var_kernel_pll" in
 yes)

$as_echo "#define KERNEL_PLL 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if SIOCGIFCONF returns buffer size in the buffer" >&5
$as_echo_n "checking if SIOCGIFCONF returns buffer size in the buffer... " >&6; }
if ${ntp_cv_size_returned_in_buffer+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ans=no
	case "$host" in
	 *-fujitsu-uxp*)
	    ans=yes
	    ;;
	 *-ncr-sysv4*)
	    ans=yes
	    ;;
	 *-univel-sysv*)
	    ans=yes
	    ;;
	esac
	ntp_cv_size_returned_in_buffer=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_size_returned_in_buffer" >&5
$as_echo "$ntp_cv_size_returned_in_buffer" >&6; }
case "$ntp_cv_size_returned_in_buffer" in
 yes)

$as_echo "#define SIZE_RETURNED_IN_BUFFER 1" >>confdefs.h

esac

# Check for ioctls TIOCGPPSEV
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTY PPS ioctl TIOCGPPSEV" >&5
$as_echo_n "checking for TTY PPS ioctl TIOCGPPSEV... " >&6; }
case "$ac_cv_header_termios_h" in
 yes)
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

	    #include 

	    #ifdef TIOCGPPSEV
		yes
	    #endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then :
  ntp_ok=yes
else
  ntp_ok=no

fi
rm -f conftest*

    ;;
 *)
    ntp_ok=no
    ;;
esac
case "$ntp_ok" in
 yes)

$as_echo "#define HAVE_TIOCGPPSEV 1" >>confdefs.h

esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

# Check for ioctls TIOCSPPS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTY PPS ioctl TIOCSPPS" >&5
$as_echo_n "checking for TTY PPS ioctl TIOCSPPS... " >&6; }
case "$ac_cv_header_termios_h" in
 yes)
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

	    #include 

	    #ifdef TIOCSPPS
		yes
	    #endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then :
  ntp_ok=yes
else
  ntp_ok=no

fi
rm -f conftest*

    ;;
 *)
    ntp_ok=no
    ;;
esac
case "$ntp_ok" in
 yes)

$as_echo "#define HAVE_TIOCSPPS 1" >>confdefs.h

esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

# Check for ioctls CIOGETEV
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTY PPS ioctl CIOGETEV" >&5
$as_echo_n "checking for TTY PPS ioctl CIOGETEV... " >&6; }
case "$ac_cv_header_sys_ppsclock_h" in
 yes)
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

	    #include 

	    #ifdef CIOGETEV
		yes
	    #endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then :
  ntp_ok=yes
else
  ntp_ok=no

fi
rm -f conftest*

    ;;
 *)
    ntp_ok=no
    ;;
esac
case "$ntp_ok" in
 yes)

$as_echo "#define HAVE_CIOGETEV 1" >>confdefs.h

esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

# ATOM/PPSAPI stuff.

ntp_atom_ok=yes

# Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.

# The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
# The PPSAPI needs struct timespec.
# The PPSAPI also needs a timepps header.

case "$ac_cv_c_inline$ntp_cv_struct_timespec" in
 inlineyes)
    case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
     *yes* | *sunos* | *solaris* | *sco* | *netbsd* )

$as_echo "#define HAVE_PPSAPI 1" >>confdefs.h

	ntp_jupiter_ok=yes
	ntp_oncore_ok=yes
	ntp_parse_ok=yes
	ntp_ripe_ncc_ok=yes
	;;
    esac
    ;;
esac

# Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
ac_fn_c_check_header_mongrel "$LINENO" "linux/serial.h" "ac_cv_header_linux_serial_h" "$ac_includes_default"
if test "x$ac_cv_header_linux_serial_h" = xyes; then :

fi


case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
  yesyes)
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG" >&5
$as_echo_n "checking ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG... " >&6; }
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

	    #include 
	    typedef int u_int;
	    #include 
	    #include 

	    #ifdef TIOCGSERIAL
	    #ifdef TIOCSSERIAL
	    #ifdef ASYNC_PPS_CD_POS
	    #ifdef ASYNC_PPS_CD_NEG
	    #ifdef CIOGETEV
		 yes
	    #endif
	    #endif
	    #endif
	    #endif
	    #endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then :
  ntp_ok=yes
else
  ntp_ok=no

fi
rm -f conftest*

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
    ;;
  *)
    ntp_ok=no
    ;;
esac
case "$ntp_ok" in
 yes)

$as_echo "#define HAVE_TIO_SERIAL_STUFF 1" >>confdefs.h

esac

# Check for SHMEM_STATUS support
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SHMEM_STATUS support" >&5
$as_echo_n "checking SHMEM_STATUS support... " >&6; }
case "$ac_cv_header_sys_mman_h" in
 yes)
    ntp_ok=yes
    ;;
 *)
    ntp_ok=no
    ;;
esac
case "$ntp_ok" in
 yes)

$as_echo "#define ONCORE_SHMEM_STATUS 1" >>confdefs.h

esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

ntp_refclock=no

# HPUX only, and by explicit request
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Datum/Bancomm bc635/VME interface" >&5
$as_echo_n "checking Datum/Bancomm bc635/VME interface... " >&6; }
# Check whether --enable-BANCOMM was given.
if test "${enable_BANCOMM+set}" = set; then :
  enableval=$enable_BANCOMM; ntp_ok=$enableval
else
  ntp_ok=no

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_BANC 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$host" in
 yes*-*-hpux*) ;;
 yes*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} ;;
esac

#HPUX only, and only by explicit request
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking TrueTime GPS receiver/VME interface" >&5
$as_echo_n "checking TrueTime GPS receiver/VME interface... " >&6; }
# Check whether --enable-GPSVME was given.
if test "${enable_GPSVME+set}" = set; then :
  enableval=$enable_GPSVME; ntp_ok=$enableval
else
  ntp_ok=no

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_GPSVME 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$host" in
 yes*-*-hpux*) ;;
 yes*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} ;;
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCL720 clock support" >&5
$as_echo_n "checking for PCL720 clock support... " >&6; }
case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
 yesyesyes)

$as_echo "#define CLOCK_PPS720 1" >>confdefs.h

    ans=yes
    ;;
 *)
    ans=no
    ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for default inclusion of all suitable non-PARSE clocks" >&5
$as_echo_n "checking for default inclusion of all suitable non-PARSE clocks... " >&6; }
# Check whether --enable-all-clocks was given.
if test "${enable_all_clocks+set}" = set; then :
  enableval=$enable_all_clocks; ntp_eac=$enableval
else
  ntp_eac=yes

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_eac" >&5
$as_echo "$ntp_eac" >&6; }

# HMS: Should we also require ntp_parse_ok?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have support for PARSE clocks" >&5
$as_echo_n "checking if we have support for PARSE clocks... " >&6; }
case "$ntp_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
 yes*yes*)
    ntp_canparse=yes
    ;;
 *) ntp_canparse=no
    ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_canparse" >&5
$as_echo "$ntp_canparse" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have support for audio clocks" >&5
$as_echo_n "checking if we have support for audio clocks... " >&6; }
case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
 *yes*)
    ntp_canaudio=yes

$as_echo "#define HAVE_AUDIO /**/" >>confdefs.h

    ;;
 *) ntp_canaudio=no ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_canaudio" >&5
$as_echo "$ntp_canaudio" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have support for the SHM refclock interface" >&5
$as_echo_n "checking if we have support for the SHM refclock interface... " >&6; }
case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
 yesyes)
    ntp_canshm=yes
    ;;
 *) ntp_canshm=no ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_canshm" >&5
$as_echo "$ntp_canshm" >&6; }

# Test for termios TIOCMBIS modem control (ACTS, Heath, Palisade)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for termios modem control" >&5
$as_echo_n "checking for termios modem control... " >&6; }
if ${ntp_cv_modem_control+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#ifdef HAVE_UNISTD_H
		# include 
		#endif
		#ifdef HAVE_TERMIOS_H
		# include 
		#endif
		#ifdef HAVE_SYS_IOCTL_H
		# include 
		#endif

int
main ()
{

		int	dtr = TIOCM_DTR;

		ioctl(1, TIOCMBIS, (char *)&dtr);


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ntp_cv_modem_control=yes
else
  ntp_cv_modem_control=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_modem_control" >&5
$as_echo "$ntp_cv_modem_control" >&6; }
case "$ntp_eac::$ntp_cv_modem_control" in
 yes::yes)
    ntp_enable_all_modem_control_clocks=yes
    ;;
 *)
    ntp_enable_all_modem_control_clocks=no
    ;;
esac

# Requires modem control
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ACTS modem service" >&5
$as_echo_n "checking ACTS modem service... " >&6; }
# Check whether --enable-ACTS was given.
if test "${enable_ACTS+set}" = set; then :
  enableval=$enable_ACTS; ntp_ok=$enableval
else
  ntp_ok=$ntp_enable_all_modem_control_clocks

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_ACTS 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Arbiter 1088A/B GPS receiver" >&5
$as_echo_n "checking Arbiter 1088A/B GPS receiver... " >&6; }
# Check whether --enable-ARBITER was given.
if test "${enable_ARBITER+set}" = set; then :
  enableval=$enable_ARBITER; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_ARBITER 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Arcron MSF receiver" >&5
$as_echo_n "checking Arcron MSF receiver... " >&6; }
# Check whether --enable-ARCRON_MSF was given.
if test "${enable_ARCRON_MSF+set}" = set; then :
  enableval=$enable_ARCRON_MSF; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_ARCRON_MSF 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Austron 2200A/2201A GPS receiver" >&5
$as_echo_n "checking Austron 2200A/2201A GPS receiver... " >&6; }
# Check whether --enable-AS2201 was given.
if test "${enable_AS2201+set}" = set; then :
  enableval=$enable_AS2201; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_AS2201 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ATOM PPS interface" >&5
$as_echo_n "checking ATOM PPS interface... " >&6; }
# Check whether --enable-ATOM was given.
if test "${enable_ATOM+set}" = set; then :
  enableval=$enable_ATOM; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

case "$ntp_atom_ok" in
 no) ntp_ok=no ;;
esac
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_ATOM 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Chrono-log K-series WWVB receiver" >&5
$as_echo_n "checking Chrono-log K-series WWVB receiver... " >&6; }
# Check whether --enable-CHRONOLOG was given.
if test "${enable_CHRONOLOG+set}" = set; then :
  enableval=$enable_CHRONOLOG; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_CHRONOLOG 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CHU modem/decoder" >&5
$as_echo_n "checking CHU modem/decoder... " >&6; }
# Check whether --enable-CHU was given.
if test "${enable_CHU+set}" = set; then :
  enableval=$enable_CHU; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_CHU 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
ntp_refclock_chu=$ntp_ok

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CHU audio/decoder" >&5
$as_echo_n "checking CHU audio/decoder... " >&6; }
# Check whether --enable-AUDIO-CHU was given.
if test "${enable_AUDIO_CHU+set}" = set; then :
  enableval=$enable_AUDIO_CHU; ntp_ok=$enableval
else

	case "$ntp_eac$ntp_refclock_chu$ntp_canaudio" in
	 *no*)	ntp_ok=no  ;;
	 *)	ntp_ok=yes ;;
	esac


fi

if test "$ntp_ok" = "yes"; then

$as_echo "#define AUDIO_CHU 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
# We used to check for sunos/solaris target...
case "$ntp_ok$ntp_refclock_chu$ntp_canaudio" in
 yes*no*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is...no ***" >&5
$as_echo "$as_me: WARNING: *** But the expected answer is...no ***" >&2;}
esac

# Not under HP-UX
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Datum Programmable Time System" >&5
$as_echo_n "checking Datum Programmable Time System... " >&6; }
# Check whether --enable-DATUM was given.
if test "${enable_DATUM+set}" = set; then :
  enableval=$enable_DATUM; ntp_ok=$enableval
else

	case "$ac_cv_header_termios_h" in
	 yes)
	    ntp_ok=$ntp_eac
	    ;;
	 *) ntp_ok=no
	    ;;
	esac


fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_DATUM 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Dumb generic hh:mm:ss local clock" >&5
$as_echo_n "checking Dumb generic hh:mm:ss local clock... " >&6; }
# Check whether --enable-DUMBCLOCK was given.
if test "${enable_DUMBCLOCK+set}" = set; then :
  enableval=$enable_DUMBCLOCK; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_DUMBCLOCK 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Forum Graphic GPS" >&5
$as_echo_n "checking Forum Graphic GPS... " >&6; }
# Check whether --enable-FG was given.
if test "${enable_FG+set}" = set; then :
  enableval=$enable_FG; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_FG 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

# Requires modem control
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Heath GC-1000 WWV/WWVH receiver" >&5
$as_echo_n "checking Heath GC-1000 WWV/WWVH receiver... " >&6; }
# Check whether --enable-HEATH was given.
if test "${enable_HEATH+set}" = set; then :
  enableval=$enable_HEATH; ntp_ok=$enableval
else
  ntp_ok=$ntp_enable_all_modem_control_clocks

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_HEATH 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hopf serial clock device" >&5
$as_echo_n "checking for hopf serial clock device... " >&6; }
# Check whether --enable-HOPFSERIAL was given.
if test "${enable_HOPFSERIAL+set}" = set; then :
  enableval=$enable_HOPFSERIAL; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_HOPF_SERIAL 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hopf PCI clock 6039" >&5
$as_echo_n "checking for hopf PCI clock 6039... " >&6; }
# Check whether --enable-HOPFPCI was given.
if test "${enable_HOPFPCI+set}" = set; then :
  enableval=$enable_HOPFPCI; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_HOPF_PCI 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking HP 58503A GPS receiver" >&5
$as_echo_n "checking HP 58503A GPS receiver... " >&6; }
# Check whether --enable-HPGPS was given.
if test "${enable_HPGPS+set}" = set; then :
  enableval=$enable_HPGPS; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_HPGPS 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IRIG audio decoder" >&5
$as_echo_n "checking IRIG audio decoder... " >&6; }
# Check whether --enable-IRIG was given.
if test "${enable_IRIG+set}" = set; then :
  enableval=$enable_IRIG; ntp_ok=$enableval
else

	case "$ntp_eac$ntp_canaudio" in
	 *no*)	ntp_ok=no  ;;
	 *)	ntp_ok=yes ;;
	esac


fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_IRIG 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canaudio" in
 yesno) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;}
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JJY receiver" >&5
$as_echo_n "checking for JJY receiver... " >&6; }
# Check whether --enable-JJY was given.
if test "${enable_JJY+set}" = set; then :
  enableval=$enable_JJY; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_JJY 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Rockwell Jupiter GPS receiver" >&5
$as_echo_n "checking Rockwell Jupiter GPS receiver... " >&6; }
# Check whether --enable-JUPITER was given.
if test "${enable_JUPITER+set}" = set; then :
  enableval=$enable_JUPITER; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac
fi

case "$ntp_jupiter_ok" in
 no) ntp_ok=no ;;
esac
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_JUPITER 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Leitch CSD 5300 Master Clock System Driver" >&5
$as_echo_n "checking Leitch CSD 5300 Master Clock System Driver... " >&6; }
# Check whether --enable-LEITCH was given.
if test "${enable_LEITCH+set}" = set; then :
  enableval=$enable_LEITCH; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_LEITCH 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking local clock reference" >&5
$as_echo_n "checking local clock reference... " >&6; }
# Check whether --enable-LOCAL-CLOCK was given.
if test "${enable_LOCAL_CLOCK+set}" = set; then :
  enableval=$enable_LOCAL_CLOCK; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_LOCAL 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }


# Not Ultrix
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Magnavox MX4200 GPS receiver" >&5
$as_echo_n "checking Magnavox MX4200 GPS receiver... " >&6; }
# Check whether --enable-MX4200 was given.
if test "${enable_MX4200+set}" = set; then :
  enableval=$enable_MX4200; ntp_ok=$enableval
else

	case "$ac_cv_var_ppsclock" in
	 yes)
	    ntp_ok=$ntp_eac
	    ;;
	 *)
	    ntp_ok=no
	    ;;
	esac


fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_MX4200 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$host" in
 yes*-*-ultrix*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;}
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NeoClock4X receiver" >&5
$as_echo_n "checking for NeoClock4X receiver... " >&6; }
# Check whether --enable-NEOCLOCK4X was given.
if test "${enable_NEOCLOCK4X+set}" = set; then :
  enableval=$enable_NEOCLOCK4X; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_NEOCLOCK4X 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking NMEA GPS receiver" >&5
$as_echo_n "checking NMEA GPS receiver... " >&6; }
# Check whether --enable-NMEA was given.
if test "${enable_NMEA+set}" = set; then :
  enableval=$enable_NMEA; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_NMEA 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ONCORE Motorola VP/UT Oncore GPS" >&5
$as_echo_n "checking for ONCORE Motorola VP/UT Oncore GPS... " >&6; }
# Check whether --enable-ONCORE was given.
if test "${enable_ONCORE+set}" = set; then :
  enableval=$enable_ONCORE; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

case "$ntp_oncore_ok" in
 no) ntp_ok=no ;;
esac
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_ONCORE 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

# Requires modem control
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Palisade clock" >&5
$as_echo_n "checking for Palisade clock... " >&6; }
# Check whether --enable-PALISADE was given.
if test "${enable_PALISADE+set}" = set; then :
  enableval=$enable_PALISADE; ntp_ok=$enableval
else
  ntp_ok=$ntp_enable_all_modem_control_clocks

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_PALISADE 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Conrad parallel port radio clock" >&5
$as_echo_n "checking Conrad parallel port radio clock... " >&6; }
# Check whether --enable-PCF was given.
if test "${enable_PCF+set}" = set; then :
  enableval=$enable_PCF; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_PCF 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking PST/Traconex 1020 WWV/WWVH receiver" >&5
$as_echo_n "checking PST/Traconex 1020 WWV/WWVH receiver... " >&6; }
# Check whether --enable-PST was given.
if test "${enable_PST+set}" = set; then :
  enableval=$enable_PST; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_PST 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RIPENCC specific Trimble driver" >&5
$as_echo_n "checking RIPENCC specific Trimble driver... " >&6; }
# Check whether --enable-RIPENCC was given.
if test "${enable_RIPENCC+set}" = set; then :
  enableval=$enable_RIPENCC; ntp_ok=$enableval
else
  ntp_ok=no

fi

# 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
case "$ntp_ripe_ncc_ok" in
 no) ntp_ok=no ;;
esac
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_RIPENCC /**/" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

# Danny Meyer says SHM compiles (with a few warnings) under Win32.
# For *IX, we need sys/ipc.h and sys/shm.h.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHM clock attached thru shared memory" >&5
$as_echo_n "checking for SHM clock attached thru shared memory... " >&6; }
# Check whether --enable-SHM was given.
if test "${enable_SHM+set}" = set; then :
  enableval=$enable_SHM; ntp_ok=$enableval
else

	case "$ntp_eac$ntp_canshm" in
	 *no*)	ntp_ok=no  ;;
	 *)	ntp_ok=yes ;;
	esac


fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_SHM 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Spectracom 8170/Netclock/2 WWVB receiver" >&5
$as_echo_n "checking Spectracom 8170/Netclock/2 WWVB receiver... " >&6; }
# Check whether --enable-SPECTRACOM was given.
if test "${enable_SPECTRACOM+set}" = set; then :
  enableval=$enable_SPECTRACOM; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_SPECTRACOM 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking KSI/Odetics TPRO/S GPS receiver/IRIG interface" >&5
$as_echo_n "checking KSI/Odetics TPRO/S GPS receiver/IRIG interface... " >&6; }
# Check whether --enable-TPRO was given.
if test "${enable_TPRO+set}" = set; then :
  enableval=$enable_TPRO; ntp_ok=$enableval
else

	case "$ac_cv_header_sys_tpro_h" in
	 yes)
	    ntp_ok=$ntp_eac
	    ;;
	 *)
	    ntp_ok=no
	    ;;
	esac


fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_TPRO 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ac_cv_header_sys_tpro" in
 yesno) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;}
esac


# Not on a vax-dec-bsd
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Kinemetrics/TrueTime receivers" >&5
$as_echo_n "checking Kinemetrics/TrueTime receivers... " >&6; }
# Check whether --enable-TRUETIME was given.
if test "${enable_TRUETIME+set}" = set; then :
  enableval=$enable_TRUETIME; ntp_ok=$enableval
else

	case "$host" in
	 vax-dec-bsd)
	    ntp_ok=no
	    ;;
	 *)
	    ntp_ok=$ntp_eac
	    ;;
	esac


fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_TRUETIME 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$host" in
 yesvax-dec-bsd) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;}
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking TrueTime 560 IRIG-B decoder" >&5
$as_echo_n "checking TrueTime 560 IRIG-B decoder... " >&6; }
# Check whether --enable-TT560 was given.
if test "${enable_TT560+set}" = set; then :
  enableval=$enable_TT560; ntp_ok=$enableval
else
  ntp_ok=no

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_TT560 /**/" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Ultralink M320 WWVB receiver" >&5
$as_echo_n "checking Ultralink M320 WWVB receiver... " >&6; }
# Check whether --enable-ULINK was given.
if test "${enable_ULINK+set}" = set; then :
  enableval=$enable_ULINK; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_ULINK 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking WWV receiver" >&5
$as_echo_n "checking WWV receiver... " >&6; }
# Check whether --enable-WWV was given.
if test "${enable_WWV+set}" = set; then :
  enableval=$enable_WWV; ntp_ok=$enableval
else

	case "$ntp_eac$ntp_canaudio" in
	 *no*)	ntp_ok=no  ;;
	 *)	ntp_ok=yes ;;
	esac


fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_WWV 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canaudio" in
 yesno) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;}
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Zyfer receiver" >&5
$as_echo_n "checking for Zyfer receiver... " >&6; }
# Check whether --enable-ZYFER was given.
if test "${enable_ZYFER+set}" = set; then :
  enableval=$enable_ZYFER; ntp_ok=$enableval
else
  ntp_ok=$ntp_eac

fi

if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes

$as_echo "#define CLOCK_ZYFER 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for default inclusion of all suitable PARSE clocks" >&5
$as_echo_n "checking for default inclusion of all suitable PARSE clocks... " >&6; }
# Check whether --enable-parse-clocks was given.
if test "${enable_parse_clocks+set}" = set; then :
  enableval=$enable_parse_clocks; ntp_eapc=$enableval
else

	case "$ntp_eac" in
	 yes)	ntp_eapc=$ntp_canparse ;;
	 *)	ntp_eapc=no ;;
	esac
	# Delete the next line one of these days
	ntp_eapc=no


fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_eapc" >&5
$as_echo "$ntp_eapc" >&6; }

case "$ntp_eac$ntp_eapc$ntp_canparse" in
 noyes*)
    as_fn_error $? "\"--enable-parse-clocks\" requires \"--enable-all-clocks\"." "$LINENO" 5
    ;;
 yesyesno)
    as_fn_error $? "You said \"--enable-parse-clocks\" but PARSE isn't supported on this platform!" "$LINENO" 5
    ;;
esac

ntp_libparse=no
ntp_parseutil=no
ntp_rawdcf=no

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Diem Computime Radio Clock" >&5
$as_echo_n "checking Diem Computime Radio Clock... " >&6; }
# Check whether --enable-COMPUTIME was given.
if test "${enable_COMPUTIME+set}" = set; then :
  enableval=$enable_COMPUTIME; ntp_ok=$enableval
else
  ntp_ok=$ntp_eapc

fi

if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes

$as_echo "#define CLOCK_COMPUTIME 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canparse" in
 yesno)
    as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ELV/DCF7000 clock" >&5
$as_echo_n "checking ELV/DCF7000 clock... " >&6; }
# Check whether --enable-DCF7000 was given.
if test "${enable_DCF7000+set}" = set; then :
  enableval=$enable_DCF7000; ntp_ok=$enableval
else
  ntp_ok=$ntp_eapc

fi

if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes

$as_echo "#define CLOCK_DCF7000 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canparse" in
 yesno)
    as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking HOPF 6021 clock" >&5
$as_echo_n "checking HOPF 6021 clock... " >&6; }
# Check whether --enable-HOPF6021 was given.
if test "${enable_HOPF6021+set}" = set; then :
  enableval=$enable_HOPF6021; ntp_ok=$enableval
else
  ntp_ok=$ntp_eapc

fi

if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes

$as_echo "#define CLOCK_HOPF6021 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canparse" in
 yesno)
    as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Meinberg clocks" >&5
$as_echo_n "checking Meinberg clocks... " >&6; }
# Check whether --enable-MEINBERG was given.
if test "${enable_MEINBERG+set}" = set; then :
  enableval=$enable_MEINBERG; ntp_ok=$enableval
else
  ntp_ok=$ntp_eapc

fi

if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes

$as_echo "#define CLOCK_MEINBERG 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canparse" in
 yesno)
    as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking DCF77 raw time code" >&5
$as_echo_n "checking DCF77 raw time code... " >&6; }
# Check whether --enable-RAWDCF was given.
if test "${enable_RAWDCF+set}" = set; then :
  enableval=$enable_RAWDCF; ntp_ok=$enableval
else
  ntp_ok=$ntp_eapc

fi

if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_parseutil=yes
    ntp_refclock=yes
    ntp_rawdcf=yes

$as_echo "#define CLOCK_RAWDCF 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canparse" in
 yesno)
    as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
esac

case "$ntp_rawdcf" in
 yes)
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we must enable parity for RAWDCF" >&5
$as_echo_n "checking if we must enable parity for RAWDCF... " >&6; }
if ${ntp_cv_rawdcf_parity+:} false; then :
  $as_echo_n "(cached) " >&6
else

	    ans=no
	    case "$host" in
	     *-*-*linux*)
		ans=yes
		;;
	    esac
	    ntp_cv_rawdcf_parity=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rawdcf_parity" >&5
$as_echo "$ntp_cv_rawdcf_parity" >&6; }
    case "$ntp_cv_rawdcf_parity" in
     yes)

$as_echo "#define RAWDCF_NO_IGNPAR 1" >>confdefs.h
 ;;
    esac
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RCC 8000 clock" >&5
$as_echo_n "checking RCC 8000 clock... " >&6; }
# Check whether --enable-RCC8000 was given.
if test "${enable_RCC8000+set}" = set; then :
  enableval=$enable_RCC8000; ntp_ok=$enableval
else
  ntp_ok=$ntp_eapc

fi

if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes

$as_echo "#define CLOCK_RCC8000 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canparse" in
 yesno)
    as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Schmid DCF77 clock" >&5
$as_echo_n "checking Schmid DCF77 clock... " >&6; }
# Check whether --enable-SCHMID was given.
if test "${enable_SCHMID+set}" = set; then :
  enableval=$enable_SCHMID; ntp_ok=$enableval
else
  ntp_ok=$ntp_eapc

fi

if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes

$as_echo "#define CLOCK_SCHMID 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canparse" in
 yesno)
    as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Trimble GPS receiver/TAIP protocol" >&5
$as_echo_n "checking Trimble GPS receiver/TAIP protocol... " >&6; }
# Check whether --enable-TRIMTAIP was given.
if test "${enable_TRIMTAIP+set}" = set; then :
  enableval=$enable_TRIMTAIP; ntp_ok=$enableval
else
  ntp_ok=$ntp_eapc

fi

if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes

$as_echo "#define CLOCK_TRIMTAIP 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canparse" in
 yesno)
    as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Trimble GPS receiver/TSIP protocol" >&5
$as_echo_n "checking Trimble GPS receiver/TSIP protocol... " >&6; }
# Check whether --enable-TRIMTSIP was given.
if test "${enable_TRIMTSIP+set}" = set; then :
  enableval=$enable_TRIMTSIP; ntp_ok=$enableval
else
  ntp_ok=$ntp_eapc

fi

if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes

$as_echo "#define CLOCK_TRIMTSIP 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canparse" in
 yesno)
    as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking WHARTON 400A Series clock" >&5
$as_echo_n "checking WHARTON 400A Series clock... " >&6; }
# Check whether --enable-WHARTON was given.
if test "${enable_WHARTON+set}" = set; then :
  enableval=$enable_WHARTON; ntp_ok=$enableval
else
  ntp_ok=$ntp_eapc

fi

if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes

$as_echo "#define CLOCK_WHARTON_400A 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canparse" in
 yesno)
    as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking VARITEXT clock" >&5
$as_echo_n "checking VARITEXT clock... " >&6; }
# Check whether --enable-VARITEXT was given.
if test "${enable_VARITEXT+set}" = set; then :
  enableval=$enable_VARITEXT; ntp_ok=$enableval
else
  ntp_ok=$ntp_eapc

fi

if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes

$as_echo "#define CLOCK_VARITEXT 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }
case "$ntp_ok$ntp_canparse" in
 yesno)
    as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
esac






{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to make and use the parse libraries" >&5
$as_echo_n "checking if we need to make and use the parse libraries... " >&6; }
ans=no
case "$ntp_libparse" in
 yes)
    ans=yes

$as_echo "#define CLOCK_PARSE 1" >>confdefs.h

    LIBPARSE=../libparse/libparse.a
    MAKE_LIBPARSE=libparse.a
    # HMS: check_y2k trips the 34 year problem now...
    false && MAKE_CHECK_Y2K=check_y2k
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }







{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl library directory" >&5
$as_echo_n "checking for openssl library directory... " >&6; }

# Check whether --with-openssl-libdir was given.
if test "${with_openssl_libdir+set}" = set; then :
  withval=$with_openssl_libdir; ans=$withval
else

	case "$build" in
	 $host) ans=yes ;;
	 *)     ans=no ;;
	esac


fi

case "$ans" in
 no)
    ;;
 yes) # Look in:
    ans="/usr/lib /usr/lib/openssl /usr/sfw/lib /usr/local/lib /usr/local/ssl/lib /lib"
    ;;
 *) # Look where they said
    ;;
esac
case "$ans" in
 no)
    ;;
 *) # Look for libcrypto.a and libssl.a:
    for i in $ans no
    do
	case "$host" in
	 *-*-darwin*)
	    test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
	    ;;
	 *)
	    test -f $i/libcrypto.so -a -f $i/libssl.so && break
	    test -f $i/libcrypto.a -a -f $i/libssl.a && break
	    ;;
	esac
    done
    case "$i" in
     no)
	ans=no
	OPENSSL_LIB=
	;;
     *) ans=$i
	OPENSSL_LIB=$ans
	;;
    esac
    ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl include directory" >&5
$as_echo_n "checking for openssl include directory... " >&6; }

# Check whether --with-openssl-incdir was given.
if test "${with_openssl_incdir+set}" = set; then :
  withval=$with_openssl_incdir; ans=$withval
else

	case "$build" in
	 $host) ans=yes ;;
	 *)     ans=no ;;
	esac


fi

case "$ans" in
 no)
    ;;
 yes) # look in:
    ans="/usr/include /usr/sfw/include /usr/local/include /usr/local/ssl/include"
    ;;
 *) # Look where they said
    ;;
esac
case "$ans" in
 no)
    ;;
 *) # look for openssl/opensslconf.h:
    for i in $ans no
    do
	test -f $i/openssl/opensslconf.h && break
    done
    case "$i" in
     no)
	ans=no
	OPENSSL_INC=
	;;
     *) ans=$i
	OPENSSL_INC=$ans
	;;
    esac
    ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we will use crypto" >&5
$as_echo_n "checking if we will use crypto... " >&6; }

# Check whether --with-crypto was given.
if test "${with_crypto+set}" = set; then :
  withval=$with_crypto; ans=$withval
else
  ans=yes

fi

case "$ans" in
 no)
    ;;
 yes|openssl)
    if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC"
    then
	ans=no
    else
	ans=yes
    fi
esac
ntp_openssl=$ans
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ntp_openssl" in
 yes)
    # We have OpenSSL inc/lib - use them.
    case "$OPENSSL_INC" in
     /usr/include)
	;;
     *)
	CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC"
	;;
    esac
    case "$OPENSSL_LIB" in
     /usr/lib)
	;;
     *)
	LDFLAGS="$LDFLAGS -L$OPENSSL_LIB"
	case "$need_dash_r" in
	 1)
	    LDFLAGS="$LDFLAGS -R$OPENSSL_LIB"
	esac
	;;
    esac
    LCRYPTO=-lcrypto


$as_echo "#define OPENSSL 1" >>confdefs.h

esac

#
# check for linking with -lcrypto failure, and try -lz -lcrypto.
# Helps m68k-atari-mint
#
case "$ntp_openssl" in
 yes)
    NTPO_SAVED_LIBS="$LIBS"
    LIBS="$NTPO_SAVED_LIBS $LCRYPTO"
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with $LCRYPTO alone works" >&5
$as_echo_n "checking if linking with $LCRYPTO alone works... " >&6; }
if ${ntp_cv_bare_lcrypto+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		    #include "openssl/err.h"
		    #include "openssl/evp.h"

int
main ()
{

		    ERR_load_crypto_strings();
		    OpenSSL_add_all_algorithms();


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ntp_cv_bare_lcrypto=yes
else
  ntp_cv_bare_lcrypto=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: $ntp_cv_bare_lcrypto" >&5
$as_echo "$ntp_cv_bare_lcrypto" >&6; }
    case "$ntp_cv_bare_lcrypto" in
     no)
	LIBS="$NTPO_SAVED_LIBS $LCRYPTO -lz"
	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with $LCRYPTO -lz works" >&5
$as_echo_n "checking if linking with $LCRYPTO -lz works... " >&6; }
if ${ntp_cv_lcrypto_lz+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

			#include "openssl/err.h"
			#include "openssl/evp.h"

int
main ()
{

			ERR_load_crypto_strings();
			OpenSSL_add_all_algorithms();


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ntp_cv_lcrypto_lz=yes
else
  ntp_cv_lcrypto_lz=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: $ntp_cv_lcrypto_lz" >&5
$as_echo "$ntp_cv_lcrypto_lz" >&6; }
	case "$ntp_cv_lcrypto_lz" in
	 yes)
	     LCRYPTO="$LCRYPTO -lz"
	esac
    esac
    LIBS="$NTPO_SAVED_LIBS"
    { NTPO_SAVED_LIBS=; unset NTPO_SAVED_LIBS;}
esac

#
# Older OpenSSL headers have a number of callback prototypes inside
# other function prototypes which trigger copious warnings with gcc's
# -Wstrict-prototypes, which is included in -Wall.
#
# An example:
#
# int i2d_RSA_NET(const RSA *a, unsigned char **pp,
#		  int (*cb)(), int sgckey);
#		  ^^^^^^^^^^^
#
#
#
openssl_triggers_warnings=unknown
SAVED_CFLAGS="$CFLAGS"

case "$GCC$ntp_openssl" in
 yesyes)
    CFLAGS="$CFLAGS -Werror"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */


int
main ()
{

		/* see if -Werror breaks gcc */


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  gcc_handles_Werror=yes
else
  gcc_handles_Werror=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    case "$gcc_handles_Werror" in
     no)
	# if this gcc doesn't do -Werror go ahead and use
	# -Wstrict-prototypes.
	openssl_triggers_warnings=yes
	;;
     yes)
	CFLAGS="$CFLAGS -Wstrict-prototypes"
	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		    #include "openssl/asn1_mac.h"
		    #include "openssl/bn.h"
		    #include "openssl/err.h"
		    #include "openssl/evp.h"
		    #include "openssl/pem.h"
		    #include "openssl/rand.h"
		    #include "openssl/x509v3.h"

int
main ()
{

		    /* empty body */


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  openssl_triggers_warnings=no
else
  openssl_triggers_warnings=yes

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    esac
    case "$openssl_triggers_warnings" in
     yes)
	CFLAGS="$SAVED_CFLAGS -Wno-strict-prototypes"
	;;
     *)
	CFLAGS="$SAVED_CFLAGS -Wstrict-prototypes"
    esac
    ;;
 yesno)
    # gcc without OpenSSL
    CFLAGS="$SAVED_CFLAGS -Wstrict-prototypes"
esac



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to compile with ElectricFence" >&5
$as_echo_n "checking if we want to compile with ElectricFence... " >&6; }

# Check whether --with-electricfence was given.
if test "${with_electricfence+set}" = set; then :
  withval=$with_electricfence; ans=$withval
else
  ans=no

fi

case "$ans" in
 no) ;;
 *)
    LIBS="$LIBS \${top_builddir}/ElectricFence/libefence.a"
    EF_PROGS="eftest tstheap"

    EF_LIBS=libefence.a

    ans=yes
    ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to run check-layout" >&5
$as_echo_n "checking if we want to run check-layout... " >&6; }
case "$cross_compiling$PATH_PERL" in
 no/*)
    MAKE_CHECK_LAYOUT=check-layout
    ans=yes
    ;;
 *)
    ans=no
    ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can make dcf parse utilities" >&5
$as_echo_n "checking if we can make dcf parse utilities... " >&6; }
ans=no
if test "$ntp_parseutil" = "yes"; then
    case "$host" in
     *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*)
	ans="dcfd testdcf"
	DCFD=dcfd
        TESTDCF=testdcf
    esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can build kernel streams modules for parse" >&5
$as_echo_n "checking if we can build kernel streams modules for parse... " >&6; }
ans=no
case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
 yesyes)
    case "$host" in
     sparc-*-sunos4*)
        case "$ntp_cv_var_kernel_pll" in
	yes)

$as_echo "#define PPS_SYNC 1" >>confdefs.h

	    ;;
	esac
	ans=parsestreams
	MAKE_PARSEKMODULE=parsestreams.loadable_module.o
	;;
     sparc-*-solaris2*)
	ans=parsesolaris
	MAKE_PARSEKMODULE=parse
	for ac_header in strings.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default"
if test "x$ac_cv_header_strings_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_STRINGS_H 1
_ACEOF

fi

done

	;;
    esac
    ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need basic refclock support" >&5
$as_echo_n "checking if we need basic refclock support... " >&6; }
if test "$ntp_refclock" = "yes"; then

$as_echo "#define REFCLOCK 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_refclock" >&5
$as_echo "$ntp_refclock" >&6; }



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want HP-UX adjtimed support" >&5
$as_echo_n "checking if we want HP-UX adjtimed support... " >&6; }
case "$host" in
 *-*-hpux[56789]*)
    ans=yes
    ;;
 *) ans=no
    ;;
esac
if test "$ans" = "yes"; then
    MAKE_ADJTIMED=adjtimed

$as_echo "#define NEED_HPUX_ADJTIME 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want QNX adjtime support" >&5
$as_echo_n "checking if we want QNX adjtime support... " >&6; }
case "$host" in
 *-*-qnx*)
    ans=yes
    ;;
 *) ans=no
    ;;
esac
if test "$ans" = "yes"; then

$as_echo "#define NEED_QNX_ADJTIME 1" >>confdefs.h

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can read kmem" >&5
$as_echo_n "checking if we can read kmem... " >&6; }

#  the default is to enable it if the system has the capability

case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
 *yes*)
    ans=yes
    ;;
 *) ans=no
esac

case "$host" in
 *-*-domainos)	# Won't be found...
    ans=no
    ;;
 *-*-hpux*)
    #ans=no
    ;;
 *-*-irix[456]*)
    ans=no
    ;;
 *-*-*linux*)
    ans=no
    ;;
 *-*-winnt3.5)
    ans=no
    ;;
 *-*-unicosmp*)
    ans=no
    ;;
esac

# --enable-kmem / --disable-kmem controls if present
# Check whether --enable-kmem was given.
if test "${enable_kmem+set}" = set; then :
  enableval=$enable_kmem; ans=$enableval

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ans" in
 yes)
    can_kmem=yes
    ;;
 *)
    can_kmem=no

$as_echo "#define NOKMEM 1" >>confdefs.h

esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if adjtime is accurate" >&5
$as_echo_n "checking if adjtime is accurate... " >&6; }

# target-dependent defaults

case "$host" in
 i386-sequent-ptx*)
    ans=no
    ;;
 i386-unknown-osf1*)
    ans=yes
    ;;
 mips-sgi-irix[456]*)
    ans=yes
    ;;
 *-fujitsu-uxp*)
    ans=yes
    ;;
 *-ibm-aix[456]*)
    ans=yes
    ;;
 *-*-*linux*)
    ans=yes
    ;;
 *-*-solaris2.[01])
    ans=no
    ;;
 *-*-solaris2*)
    ans=yes
    ;;
 *-*-unicosmp*)
    ans=yes
    ;;
 *) ans=no
esac

# --enable-accurate-adjtime / --disable-accurate-adjtime
# override the default
# Check whether --enable-accurate-adjtime was given.
if test "${enable_accurate_adjtime+set}" = set; then :
  enableval=$enable_accurate_adjtime; ans=$enableval

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ans" in
 yes)

$as_echo "#define ADJTIME_IS_ACCURATE 1" >>confdefs.h

    adjtime_is_accurate=yes
    ;;
 *)
    adjtime_is_accurate=no
    ;;
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name of 'tick' in the kernel" >&5
$as_echo_n "checking the name of 'tick' in the kernel... " >&6; }
if ${ntp_cv_nlist_tick+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ans=_tick
	case "$host" in
	 m68*-hp-hpux*) # HP9000/300?
	    ans=_old_tick
	    ;;
	 *-apple-aux[23]*)
	    ans=tick
	    ;;
	 *-hp-hpux*)
	    ans=old_tick
	    ;;
	 *-ibm-aix[3456]*)
	    ans=no
	    ;;
	 *-*-mpeix*)
	    ans=no
	    ;;
	 *-*-ptx*)
	    ans=tick
	    ;;
	 *-*-sco3.2v[45]*)
	    ans=no
	    ;;
	 *-*-solaris2*)
	    ans=nsec_per_tick
	    ;;
	 *-*-sysv4*)
	    ans=tick
	    ;;
	esac
	ntp_cv_nlist_tick=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_tick" >&5
$as_echo "$ntp_cv_nlist_tick" >&6; }
case "$ntp_cv_nlist_tick" in
 ''|no)
    ;;	# HMS: I think we can only get 'no' here...
 *)

cat >>confdefs.h <<_ACEOF
#define K_TICK_NAME "$ntp_cv_nlist_tick"
_ACEOF

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the units of 'tick'" >&5
$as_echo_n "checking for the units of 'tick'... " >&6; }
if ${ntp_cv_tick_nano+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ans=usec
	case "$host" in
	 *-*-solaris2*)
	    ans=nsec
	    ;;
	esac
	ntp_cv_tick_nano=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_tick_nano" >&5
$as_echo "$ntp_cv_tick_nano" >&6; }
case "$ntp_cv_tick_nano" in
 nsec)

$as_echo "#define TICK_NANO 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name of 'tickadj' in the kernel" >&5
$as_echo_n "checking the name of 'tickadj' in the kernel... " >&6; }
if ${ntp_cv_nlist_tickadj+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ans=_tickadj
	case "$host" in
	 m68*-hp-hpux*) # HP9000/300?
	    ans=_tickadj
	    ;;
	 *-apple-aux[23]*)
	    ans=tickadj
	    ;;
	 *-hp-hpux10*)
	    ans=no
	    ;;
	 *-hp-hpux9*)
	    ans=no
	    ;;
	 *-hp-hpux*)
	    ans=tickadj
	    ;;
	 *-*-aix*)
	    ans=tickadj
	    ;;
	 *-*-mpeix*)
	    ans=no
	    ;;
	 *-*-ptx*)
	    ans=tickadj
	    ;;
	 *-*-sco3.2v4*)
	    ans=no
	    ;;
	 *-*-sco3.2v5.0*)
	    ans=clock_drift
	    ;;
	 *-*-solaris2*)
	    ans=no	# hrestime_adj
	    ;;
	 *-*-sysv4*)
	    ans=tickadj
	    ;;
	esac
	ntp_cv_nlist_tickadj=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_tickadj" >&5
$as_echo "$ntp_cv_nlist_tickadj" >&6; }
case "$ntp_cv_nlist_tickadj" in
 ''|no)
    ;;	# HMS: I think we can only get 'no' here...
 *)

cat >>confdefs.h <<_ACEOF
#define K_TICKADJ_NAME "$ntp_cv_nlist_tickadj"
_ACEOF

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the units of 'tickadj'" >&5
$as_echo_n "checking for the units of 'tickadj'... " >&6; }
if ${ntp_cv_tickadj_nano+:} false; then :
  $as_echo_n "(cached) " >&6
else

	ans=usec
	case "$host" in
	 *-*-solaris2*)
	    ans=nsec
	    ;;
	esac
	ntp_cv_tickadj_nano=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_tickadj_nano" >&5
$as_echo "$ntp_cv_tickadj_nano" >&6; }
case "$ntp_cv_tickadj_nano" in
 nsec)

$as_echo "#define TICKADJ_NANO 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking half-heartedly for 'dosynctodr' in the kernel" >&5
$as_echo_n "checking half-heartedly for 'dosynctodr' in the kernel... " >&6; }
if ${ntp_cv_nlist_dosynctodr+:} false; then :
  $as_echo_n "(cached) " >&6
else

	case "$host" in
	 *-apple-aux[23]*)
	    ans=no
	    ;;
	 *-sni-sysv*)
	    ans=dosynctodr
	    ;;
	 *-*-aix*)
	    ans=dosynctodr
	    ;;
	 *-*-hpux*)
	    ans=no
	    ;;
	 *-*-mpeix*)
	    ans=no
	    ;;
	 *-*-nextstep*)
	    ans=_dosynctodr
	    ;;
	 *-*-ptx*)
	    ans=doresettodr
	    ;;
	 *-*-sco3.2v4*)
	    ans=no
	    ;;
	 *-*-sco3.2v5*)
	    ans=track_rtc
	    ;;
	 *-*-solaris2*)
	    ans=dosynctodr
	    ;;
	 *-*-sysv4*)
	    ans=doresettodr
	    ;;
	 *)
	    ans=_dosynctodr
	    ;;
	esac
	ntp_cv_nlist_dosynctodr=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_dosynctodr" >&5
$as_echo "$ntp_cv_nlist_dosynctodr" >&6; }
case "$ntp_cv_nlist_dosynctodr" in
 no)
    ;;
 *)

cat >>confdefs.h <<_ACEOF
#define K_DOSYNCTODR_NAME "$ntp_cv_nlist_dosynctodr"
_ACEOF

    ;;
esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking half-heartedly for 'noprintf' in the kernel" >&5
$as_echo_n "checking half-heartedly for 'noprintf' in the kernel... " >&6; }
if ${ntp_cv_nlist_noprintf+:} false; then :
  $as_echo_n "(cached) " >&6
else

	case "$host" in
	 *-apple-aux[23]*)
	    ans=no
	    ;;
	 *-sni-sysv*)
	    ans=noprintf
	    ;;
	 *-*-aix*)
	    ans=noprintf
	    ;;
	 *-*-hpux*)
	    ans=no
	    ;;
	 *-*-mpeix*)
	    ans=no
	    ;;
	 *-*-ptx*)
	    ans=noprintf
	    ;;
	 *-*-nextstep*)
	    ans=_noprintf
	    ;;
	 *-*-solaris2*)
	    ans=noprintf
	    ;;
	 *-*-sysv4*)
	    ans=noprintf
	    ;;
	 *)
	    ans=_noprintf
	    ;;
	esac
	ntp_cv_nlist_noprintf=$ans


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_noprintf" >&5
$as_echo "$ntp_cv_nlist_noprintf" >&6; }
case "$ntp_cv_nlist_noprintf" in
 no)
    ;;
 *)

cat >>confdefs.h <<_ACEOF
#define K_NOPRINTF_NAME "$ntp_cv_nlist_noprintf"
_ACEOF

    ;;
esac




{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a default value for 'tick'" >&5
$as_echo_n "checking for a default value for 'tick'... " >&6; }

# target-dependent default for tick

case "$host" in
 *-*-pc-cygwin*)
    as_fn_error $? "tick needs work for cygwin" "$LINENO" 5
    ;;
 *-univel-sysv*)
    ans=10000
    ;;
 *-*-irix*)
    ans=10000
    ;;
 *-*-*linux*)
    ans=txc.tick
    ;;
 *-*-mpeix*)
    ans=no
    ;;
 *-*-winnt3.5)
    ans='(every / 10)'
    ;;
 *-*-unicosmp*)
    ans=10000
    ;;
 *)
    ans='1000000L/hz'
    ;;
esac

# Check whether --enable-tick was given.
if test "${enable_tick+set}" = set; then :
  enableval=$enable_tick; ans=$enableval

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ans" in
 ''|no)
    ;;	# HMS: I think we can only get 'no' here...
 *)

cat >>confdefs.h <<_ACEOF
#define PRESET_TICK $ans
_ACEOF

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a default value for 'tickadj'" >&5
$as_echo_n "checking for a default value for 'tickadj'... " >&6; }

# target-specific default
ans='500/hz'
case "$host" in
 *-fujitsu-uxp*)
    case "$adjtime_is_accurate" in
     yes)
	ans='tick/16'
    esac
    ;;
 *-univel-sysv*)
    ans=80
    ;;
 *-*-aix*)
    case "$can_kmem" in
     no)
	ans=1000
    esac
    ;;
 *-*-domainos)	# Skippy: won't be found...
    case "$can_kmem" in
     no)
	ans=668
    esac
    ;;
 *-*-hpux*)
    case "$adjtime_is_accurate" in
     yes)
	ans='tick/16'
    esac
    ;;
 *-*-irix*)
    ans=150
    ;;
 *-*-mpeix*)
    ans=no
    ;;
 *-*-sco3.2v5.0*)
    ans=10000L/hz
    ;;
 *-*-winnt3.5)
    ans=50
    ;;
 *-*-unicosmp*)
    ans=150
esac

# Check whether --enable-tickadj was given.
if test "${enable_tickadj+set}" = set; then :
  enableval=$enable_tickadj; ans=$enableval

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

default_tickadj=$ans

case "$default_tickadj" in
 ''|no)
    ;;	# HMS: I think we can only get 'no' here...
 *)

cat >>confdefs.h <<_ACEOF
#define PRESET_TICKADJ $default_tickadj
_ACEOF
 ;;
esac

# Newer versions of ReliantUNIX round adjtime() values down to
# 1/100s (system tick). Sigh ...
# Unfortunately, there is no easy way to know if particular release
# has this "feature" or any obvious way to test for it.
case "$host" in
 mips-sni-sysv4*)

$as_echo "#define RELIANTUNIX_CLOCK 1" >>confdefs.h

esac

case "$host" in
 *-*-sco3.2v5*)

$as_echo "#define SCO5_CLOCK 1" >>confdefs.h

esac

ntp_cv_make_tickadj=yes
case "$can_kmem$ac_cv_var_tick$default_tickadj" in
 nonono)	# Don't read KMEM, no presets.  Bogus.
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't read kmem, no PRESET_TICK or PRESET_TICKADJ.  No tickadj." >&5
$as_echo "$as_me: WARNING: Can't read kmem, no PRESET_TICK or PRESET_TICKADJ.  No tickadj." >&2;}
    ntp_cv_make_tickadj=no
    ;;
 nono*)		# Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ.  Bogus.
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't read kmem but no PRESET_TICK.  No tickadj." >&5
$as_echo "$as_me: WARNING: Can't read kmem but no PRESET_TICK.  No tickadj." >&2;}
    ntp_cv_make_tickadj=no
    ;;
 no*no)		# Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ.  Bogus.
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't read kmem but no PRESET_TICKADJ.  No tickadj." >&5
$as_echo "$as_me: WARNING: Can't read kmem but no PRESET_TICKADJ.  No tickadj." >&2;}
    ntp_cv_make_tickadj=no
    ;;
 no*)		# Don't read KMEM, PRESET_TICK and PRESET_TICKADJ.  Cool.
    ;;
 yesnono)	# Read KMEM, no presets.  Cool.
    ;;
 yesno*)	# Read KMEM, no PRESET_TICK but PRESET_TICKADJ.  Bogus.
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PRESET_TICKADJ is defined but not PRESET_TICK.  Please report this." >&5
$as_echo "$as_me: WARNING: PRESET_TICKADJ is defined but not PRESET_TICK.  Please report this." >&2;}
    ;;
 yes*no)	# Read KMEM, PRESET_TICK but no PRESET_TICKADJ.  Cool.
    ;;
 yes*)		# READ KMEM, PRESET_TICK and PRESET_TICKADJ.
    ;;
 *)		# Generally bogus.
    as_fn_error $? "This shouldn't happen." "$LINENO" 5
    ;;
esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want and can make the ntptime utility" >&5
$as_echo_n "checking if we want and can make the ntptime utility... " >&6; }
if ${ac_cv_make_ntptime+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case "$host" in
 *) case "$ntp_cv_struct_ntptimeval$ntp_cv_var_kernel_pll" in
     yesyes)
	ans=yes
	;;
     *)
	ans=no
	;;
    esac
    ;;
esac
ac_cv_make_ntptime=$ans
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_make_ntptime" >&5
$as_echo "$ac_cv_make_ntptime" >&6; }
case "$ac_cv_make_ntptime" in
 yes)
    MAKE_NTPTIME=ntptime
    ;;
esac


case "$host" in
 mips-sni-sysv4*)
    # tickadj is pretty useless on newer versions of ReliantUNIX
    # Do not bother
    ntp_cv_make_tickadj=no
    ;;
 *-*-irix*)
    ntp_cv_make_tickadj=no
    ;;
 *-*-solaris2*)
    # DLM says tickadj is a no-no starting with solaris2.5
    case "$host" in
     *-*-solaris2.1[0-9]*)
	ntp_cv_make_tickadj=no
	;;
     *-*-solaris2.[0-4]*) ;;
     *) ntp_cv_make_tickadj=no ;;
    esac
    ;;
 *-*-unicosmp*)
    ntp_cv_make_tickadj=no
    ;;
esac

#
# Despite all the above, we always make tickadj.  Setting
# ntp_cv_make_tickadj before AC_CACHE_CHECK will cause a false
# report that the configuration variable was cached.  It may
# be better to simply remove the hunk above, I did not want
# to remove it if there is hope it will be used again.
#
{ ntp_cv_make_tickadj=; unset ntp_cv_make_tickadj;}

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want and can make the tickadj utility" >&5
$as_echo_n "checking if we want and can make the tickadj utility... " >&6; }
if ${ntp_cv_make_tickadj+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ntp_cv_make_tickadj=yes

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_make_tickadj" >&5
$as_echo "$ntp_cv_make_tickadj" >&6; }
case "$ntp_cv_make_tickadj" in
 yes)
    MAKE_TICKADJ=tickadj
esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want and can make the timetrim utility" >&5
$as_echo_n "checking if we want and can make the timetrim utility... " >&6; }
if ${ntp_cv_make_timetrim+:} false; then :
  $as_echo_n "(cached) " >&6
else

	case "$host" in
	 *-*-irix*)
	    ntp_cv_make_timetrim=yes
	    ;;
	 *-*-unicosmp*)
	    ntp_cv_make_timetrim=yes
	    ;;
	 *)
	    ntp_cv_make_timetrim=no
	    ;;
	esac


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_make_timetrim" >&5
$as_echo "$ntp_cv_make_timetrim" >&6; }
case "$ntp_cv_make_timetrim" in
 yes)
    MAKE_TIMETRIM=timetrim
esac




{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to build the NTPD simulator" >&5
$as_echo_n "checking if we want to build the NTPD simulator... " >&6; }
# Check whether --enable-simulator was given.
if test "${enable_simulator+set}" = set; then :
  enableval=$enable_simulator; ans=$enableval
else
  ans=no

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }
case "$ans" in
 yes)
    MAKE_NTPDSIM=ntpdsim
    MAKE_LIBNTPSIM=libntpsim.a
esac

case "$build" in
 $host)
    ;;
 *) case "$host" in
     *-*-vxworks*)
	LDFLAGS="$LDFLAGS -r"
	;;
    esac
    ;;
esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to build ntpsnmpd" >&5
$as_echo_n "checking if we want to build ntpsnmpd... " >&6; }

# Check whether --with-ntpsnmpd was given.
if test "${with_ntpsnmpd+set}" = set; then :
  withval=$with_ntpsnmpd; ans=$withval
else

	case "$PATH_NET_SNMP_CONFIG" in
	 /*)	ans=yes ;;
	 *)	ans=no  ;;
	esac


fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }
case "$ans" in
 yes)
    case "$PATH_NET_SNMP_CONFIG" in
     /*)
	SNMP_LIBS=`$PATH_NET_SNMP_CONFIG --agent-libs`

	# HMS: we really want to separate CPPFLAGS and CFLAGS
	foo=`$PATH_NET_SNMP_CONFIG --cflags`
	SNMP_CPPFLAGS=
	SNMP_CFLAGS=
	for i in $foo; do
	    case "$i" in
	     -D*|-U*|-I*)
		SNMP_CPPFLAGS="$SNMP_CPPFLAGS $i"
		;;
	    *)	SNMP_CFLAGS="$SNMP_CFLAGS $i"
		;;
	    esac
	done



	save_CFLAGS=$CFLAGS
	save_CPPFLAGS=$CPPFLAGS
	save_LIBS=$LIBS
	CFLAGS=$SNMP_CFLAGS
	CPPFLAGS=$SNMP_CPPFLAGS

	ac_fn_c_check_header_mongrel "$LINENO" "net-snmp/net-snmp-config.h" "ac_cv_header_net_snmp_net_snmp_config_h" "$ac_includes_default"
if test "x$ac_cv_header_net_snmp_net_snmp_config_h" = xyes; then :
  MAKE_NTPSNMPD=ntpsnmpd
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: net-snmp-config present but net-snmp headers are not available!" >&5
$as_echo "$as_me: WARNING: net-snmp-config present but net-snmp headers are not available!" >&2;}

fi



	# Do this last, as we're messing up LIBS.
	# check -lnetsnmp for netsnmp_daemonize
	LIBS=`$PATH_NET_SNMP_CONFIG --libs`
	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for netsnmp_daemonize in -lnetsnmp" >&5
$as_echo_n "checking for netsnmp_daemonize in -lnetsnmp... " >&6; }
if ${ac_cv_lib_netsnmp_netsnmp_daemonize+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lnetsnmp  $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 netsnmp_daemonize ();
int
main ()
{
return netsnmp_daemonize ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_netsnmp_netsnmp_daemonize=yes
else
  ac_cv_lib_netsnmp_netsnmp_daemonize=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_netsnmp_netsnmp_daemonize" >&5
$as_echo "$ac_cv_lib_netsnmp_netsnmp_daemonize" >&6; }
if test "x$ac_cv_lib_netsnmp_netsnmp_daemonize" = xyes; then :
  ans=yes
else
  ans=no

fi

	case "$ans" in
	 no)

$as_echo "#define NEED_NETSNMP_DAEMONIZE 1" >>confdefs.h

	esac

	CFLAGS=$save_CFLAGS
	CPPFLAGS=$save_CPPFLAGS
	LIBS=$save_LIBS
	;;
     *)
	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot build ntpsnmpd - net-snmp-config cannot be found" >&5
$as_echo "$as_me: WARNING: Cannot build ntpsnmpd - net-snmp-config cannot be found" >&2;}
	;;
    esac
    ;;
esac



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should always slew the time" >&5
$as_echo_n "checking if we should always slew the time... " >&6; }

# target-specific defaults

case "$host" in
 *-apple-aux[23]*)
    ans=yes
    ;;
 *-*-bsdi[012]*)
    ans=no
    ;;
 *-*-bsdi*)
    ans=yes
    ;;
 *-*-openvms*)	# HMS: won't be found
    ans=yes
    ;;
 *) ans=no
    ;;
esac

# --enable-slew-always / --disable-slew-always overrides default

# Check whether --enable-slew-always was given.
if test "${enable_slew_always+set}" = set; then :
  enableval=$enable_slew_always; ans=$enableval

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ans" in
 yes)

$as_echo "#define SLEWALWAYS 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should step and slew the time" >&5
$as_echo_n "checking if we should step and slew the time... " >&6; }

case "$host" in
 *-sni-sysv*)
    ans=yes
    ;;
 *-univel-sysv*)
    ans=no
    ;;
 *-*-ptx*)
    ans=yes
    ;;
 *-*-solaris2.1[0-9]*)
    ans=no
    ;;
 *-*-solaris2.[012]*)
    ans=yes
    ;;
 *-*-sysv4*)	# HMS: Does this catch Fujitsu UXP?
    ans=yes
    ;;
 *) ans=no
    ;;
esac

# Check whether --enable-step-slew was given.
if test "${enable_step_slew+set}" = set; then :
  enableval=$enable_step_slew; ans=$enableval

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ans" in
 yes)

$as_echo "#define STEP_SLEW 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ntpdate should step the time" >&5
$as_echo_n "checking if ntpdate should step the time... " >&6; }

case "$host" in
 *-apple-aux[23]*)
    ans=yes
    ;;
 *) ans=no
esac

# Check whether --enable-ntpdate-step was given.
if test "${enable_ntpdate_step+set}" = set; then :
  enableval=$enable_ntpdate_step; ans=$enableval

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ans" in
 yes)

$as_echo "#define FORCE_NTPDATE_STEP 1" >>confdefs.h

esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should sync TODR clock every hour" >&5
$as_echo_n "checking if we should sync TODR clock every hour... " >&6; }

case "$host" in
 *-*-nextstep*)
    ans=yes
    ;;
 *-*-openvms*)	# HMS: won't be found
    ans=yes
    ;;
 *)
    ans=no
esac

# Check whether --enable-hourly-todr-sync was given.
if test "${enable_hourly_todr_sync+set}" = set; then :
  enableval=$enable_hourly_todr_sync; ans=$enableval

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ac_cv_var_sync_todr" in
 yes)

$as_echo "#define DOSYNCTODR 1" >>confdefs.h
 ;;
esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should avoid kernel FLL bug" >&5
$as_echo_n "checking if we should avoid kernel FLL bug... " >&6; }

case "$host" in
 *-*-solaris2.6)
    unamev=`uname -v`
    case "$unamev" in
     Generic_105181-*)
	old_IFS="$IFS"
	IFS="-"
	set $unamev
	IFS="$old_IFS"
	if test "$2" -ge 17
	then
	    # Generic_105181-17 and higher
	    ans=no
	else
	    ans=yes
	fi
	;;
     *)
	ans=yes
    esac
    ;;
 *-*-solaris2.7)
    unamev=`uname -v`
    case "$unamev" in
     Generic_106541-*)
	old_IFS="$IFS"
	IFS="-"
	set $unamev
	IFS="$old_IFS"
	if test "$2" -ge 07
	then
	    # Generic_106541-07 and higher
	    ans=no
	else
	    ans=yes
	fi
	;;
     *)
	ans=yes
    esac
    ;;
 *)
    ans=no
esac

# Check whether --enable-kernel-fll-bug was given.
if test "${enable_kernel_fll_bug+set}" = set; then :
  enableval=$enable_kernel_fll_bug; ans=$enableval

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ans" in
 yes)

$as_echo "#define KERNEL_FLL_BUG 1" >>confdefs.h

esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want new session key behavior" >&5
$as_echo_n "checking if we want new session key behavior... " >&6; }
# Check whether --enable-bug1243-fix was given.
if test "${enable_bug1243_fix+set}" = set; then :
  enableval=$enable_bug1243_fix; ans=$enableval
else
  ans=yes

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }
case "$ans" in
 no)

$as_echo "#define DISABLE_BUG1243_FIX 1" >>confdefs.h

esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use the IRIG sawtooth filter" >&5
$as_echo_n "checking if we should use the IRIG sawtooth filter... " >&6; }

case "$host" in
 *-*-solaris2.[89])
    ans=yes
    ;;
 *-*-solaris2.1[0-9]*)
    ans=yes
    ;;
 *) ans=no
esac

# Check whether --enable-irig-sawtooth was given.
if test "${enable_irig_sawtooth+set}" = set; then :
  enableval=$enable_irig_sawtooth; ans=$enableval

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ans" in
 yes)

$as_echo "#define IRIG_SUCKS 1" >>confdefs.h

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
else
  ans=no

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ans" in
 yes)

$as_echo "#define LOCKCLOCK 1" >>confdefs.h
 ;;
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
else
  ans=no

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }

case "$ans" in
 no)
    ntp_signd_path=
    ;;
 yes)
    ntp_signd_path=/var/run/ntp_signd
    ;;
 *)
    ntp_signd_path="$ans"
esac

case "$ntp_signd_path" in
 '')
    ;;
 *)

$as_echo "#define HAVE_NTP_SIGND 1" >>confdefs.h


cat >>confdefs.h <<_ACEOF
#define NTP_SIGND_PATH "$ntp_signd_path"
_ACEOF

esac


for ac_header in sys/clockctl.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "sys/clockctl.h" "ac_cv_header_sys_clockctl_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_clockctl_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_CLOCKCTL_H 1
_ACEOF

fi

done


case "$host" in
 *-*-netbsd*)
    ans=yes
    ;;
 *) ans=no
    ;;
esac

# Check whether --enable-clockctl was given.
if test "${enable_clockctl+set}" = set; then :
  enableval=$enable_clockctl; ntp_use_dev_clockctl=$enableval
else
  ntp_use_dev_clockctl=$ac_cv_header_sys_clockctl_h

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use /dev/clockctl" >&5
$as_echo_n "checking if we should use /dev/clockctl... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_use_dev_clockctl" >&5
$as_echo "$ntp_use_dev_clockctl" >&6; }


for ac_header in sys/capability.h sys/prctl.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


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have linux capabilities (libcap)" >&5
$as_echo_n "checking if we have linux capabilities (libcap)... " >&6; }

case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in
 yesyes)
    case "$host" in
     mips-sgi-irix*)
	ntp_have_linuxcaps=no
	;;
     *) ntp_have_linuxcaps=yes
	;;
    esac
    ;;
 *)
    ntp_have_linuxcaps=no
    ;;
esac

# Check whether --enable-linuxcaps was given.
if test "${enable_linuxcaps+set}" = set; then :
  enableval=$enable_linuxcaps; ntp_have_linuxcaps=$enableval

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_have_linuxcaps" >&5
$as_echo "$ntp_have_linuxcaps" >&6; }

case "$ntp_have_linuxcaps" in
 yes)

$as_echo "#define HAVE_LINUX_CAPABILITIES 1" >>confdefs.h

    LIBS="$LIBS -lcap"
esac

case "$ntp_use_dev_clockctl$ntp_have_linuxcaps" in
 *yes*)

$as_echo "#define HAVE_DROPROOT 1" >>confdefs.h

esac


for ac_header in libscf.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "libscf.h" "ac_cv_header_libscf_h" "$ac_includes_default"
if test "x$ac_cv_header_libscf_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBSCF_H 1
_ACEOF

fi

done

LSCF=
case "$ac_cv_header_libscf_h" in
 yes)
    LSCF='-lscf'
esac


ac_fn_c_check_func "$LINENO" "setppriv" "ac_cv_func_setppriv"
if test "x$ac_cv_func_setppriv" = xyes; then :
  ans=yes
else
  ans=no

fi

case "$ans" in
 yes)

$as_echo "#define HAVE_SOLARIS_PRIVS 1" >>confdefs.h

esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr for sa_len" >&5
$as_echo_n "checking struct sockaddr for sa_len... " >&6; }
if ${isc_cv_platform_havesalen+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 
		#include 

int
main ()
{

		extern struct sockaddr *ps;
		return ps->sa_len;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  isc_cv_platform_havesalen=yes
else
  isc_cv_platform_havesalen=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_platform_havesalen" >&5
$as_echo "$isc_cv_platform_havesalen" >&6; }
case "$isc_cv_platform_havesalen" in
 yes)

$as_echo "#define ISC_PLATFORM_HAVESALEN 1" >>confdefs.h

esac

# Check whether --enable-ipv6 was given.
if test "${enable_ipv6+set}" = set; then :
  enableval=$enable_ipv6;
fi


case "$enable_ipv6" in
 yes|''|autodetect)
    case "$host" in
     powerpc-ibm-aix4*)
	;;
     *)

$as_echo "#define WANT_IPV6 1" >>confdefs.h

	;;
    esac
    ;;
 no)
    ;;
esac


case "$host" in
 *-*-darwin*)

$as_echo "#define __APPLE_USE_RFC_3542 1" >>confdefs.h

esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 structures" >&5
$as_echo_n "checking for IPv6 structures... " >&6; }
if ${isc_cv_found_ipv6+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 
		#include 
		#include 

int
main ()
{

		struct sockaddr_in6 sin6;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  isc_cv_found_ipv6=yes
else
  isc_cv_found_ipv6=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_found_ipv6" >&5
$as_echo "$isc_cv_found_ipv6" >&6; }

#
# See whether IPv6 support is provided via a Kame add-on.
# This is done before other IPv6 linking tests so LIBS is properly set.
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kame IPv6 support" >&5
$as_echo_n "checking for Kame IPv6 support... " >&6; }

# Check whether --with-kame was given.
if test "${with_kame+set}" = set; then :
  withval=$with_kame; use_kame="$withval"
else
  use_kame="no"

fi

case "$use_kame" in
 no)
    ;;
 yes)
    kame_path=/usr/local/v6
    ;;
 *)
    kame_path="$use_kame"
    ;;
esac
case "$use_kame" in
 no)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
    ;;
 *)
    if test -f $kame_path/lib/libinet6.a; then
	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kame_path/lib/libinet6.a" >&5
$as_echo "$kame_path/lib/libinet6.a" >&6; }
	LIBS="-L$kame_path/lib -linet6 $LIBS"
    else
	as_fn_error $? "$kame_path/lib/libinet6.a not found.

Please choose the proper path with the following command:

    configure --with-kame=PATH
" "$LINENO" 5
    fi
    ;;
esac

#
# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
# Including it on Kame-using platforms is very bad, though, because
# Kame uses #error against direct inclusion.   So include it on only
# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
# This is done before the in6_pktinfo check because that's what
# netinet6/in6.h is needed for.
#
case "$host" in
 *-bsdi4.[01]*)

$as_echo "#define ISC_PLATFORM_NEEDNETINET6IN6H 1" >>confdefs.h

    isc_netinet6in6_hack="#include "
    ;;
 *)
    isc_netinet6in6_hack=""
    ;;
esac

#
# This is similar to the netinet6/in6.h issue.
#
case "$host" in
 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)

$as_echo "#define ISC_PLATFORM_FIXIN6ISADDR 1" >>confdefs.h

    isc_netinetin6_hack="#include "
    ;;
 *)
    isc_netinetin6_hack=""
    ;;
esac


case "$isc_cv_found_ipv6" in
 yes)

$as_echo "#define ISC_PLATFORM_HAVEIPV6 1" >>confdefs.h

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6_pktinfo" >&5
$as_echo_n "checking for in6_pktinfo... " >&6; }
if ${isc_cv_have_in6_pktinfo+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		    #include 
		    #include 
		    #include 
		    $isc_netinetin6_hack
		    $isc_netinet6in6_hack

int
main ()
{

		    struct in6_pktinfo xyzzy;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  isc_cv_have_in6_pktinfo=yes
else
  isc_cv_have_in6_pktinfo=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in6_pktinfo" >&5
$as_echo "$isc_cv_have_in6_pktinfo" >&6; }
    case "$isc_cv_have_in6_pktinfo" in
     yes)

$as_echo "#define ISC_PLATFORM_HAVEIN6PKTINFO 1" >>confdefs.h

    esac


    # HMS: Use HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead?
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_in6.sin6_scope_id" >&5
$as_echo_n "checking for sockaddr_in6.sin6_scope_id... " >&6; }
if ${isc_cv_have_sin6_scope_id+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		    #include 
		    #include 
		    #include 
		    $isc_netinetin6_hack
		    $isc_netinet6in6_hack

int
main ()
{

		    struct sockaddr_in6 xyzzy;
		    xyzzy.sin6_scope_id = 0;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  isc_cv_have_sin6_scope_id=yes
else
  isc_cv_have_sin6_scope_id=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_sin6_scope_id" >&5
$as_echo "$isc_cv_have_sin6_scope_id" >&6; }

    case "$isc_cv_have_sin6_scope_id" in
     yes)

$as_echo "#define ISC_PLATFORM_HAVESCOPEID 1" >>confdefs.h

    esac
esac


# We need this check run even without isc_cv_found_ipv6=yes

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6addr_any" >&5
$as_echo_n "checking for in6addr_any... " >&6; }
if ${isc_cv_have_in6addr_any+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 
		#include 
		#include 
		$isc_netinetin6_hack
		$isc_netinet6in6_hack

int
main ()
{

		struct in6_addr in6;
		in6 = in6addr_any;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  isc_cv_have_in6addr_any=yes
else
  isc_cv_have_in6addr_any=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: $isc_cv_have_in6addr_any" >&5
$as_echo "$isc_cv_have_in6addr_any" >&6; }

case "$isc_cv_have_in6addr_any" in
 no)

$as_echo "#define ISC_PLATFORM_NEEDIN6ADDRANY 1" >>confdefs.h

esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrconf" >&5
$as_echo_n "checking for struct if_laddrconf... " >&6; }
if ${isc_cv_struct_if_laddrconf+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 
		#include 

int
main ()
{

		struct if_laddrconf a;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  isc_cv_struct_if_laddrconf=yes
else
  isc_cv_struct_if_laddrconf=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_struct_if_laddrconf" >&5
$as_echo "$isc_cv_struct_if_laddrconf" >&6; }

case "$isc_cv_struct_if_laddrconf" in
 yes)

$as_echo "#define ISC_PLATFORM_HAVEIF_LADDRCONF 1" >>confdefs.h

esac

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrreq" >&5
$as_echo_n "checking for struct if_laddrreq... " >&6; }
if ${isc_cv_struct_if_laddrreq+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

		#include 
		#include 

int
main ()
{

		struct if_laddrreq a;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  isc_cv_struct_if_laddrreq=yes
else
  isc_cv_struct_if_laddrreq=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_struct_if_laddrreq" >&5
$as_echo "$isc_cv_struct_if_laddrreq" >&6; }

case "$isc_cv_struct_if_laddrreq" in
 yes)

$as_echo "#define ISC_PLATFORM_HAVEIF_LADDRREQ 1" >>confdefs.h

esac

#
# Look for a sysctl call to get the list of network interfaces.
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for interface list sysctl" >&5
$as_echo_n "checking for interface list sysctl... " >&6; }
if ${ntp_cv_iflist_sysctl+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

	    #include 
	    #include 
	    #include 
	    #ifdef NET_RT_IFLIST
		found_rt_iflist
	    #endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "found_rt_iflist" >/dev/null 2>&1; then :
  ntp_cv_iflist_sysctl=yes
else
  ntp_cv_iflist_sysctl=no

fi
rm -f conftest*


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_iflist_sysctl" >&5
$as_echo "$ntp_cv_iflist_sysctl" >&6; }
case "$ntp_cv_iflist_sysctl" in
 yes)

$as_echo "#define HAVE_IFLIST_SYSCTL 1" >>confdefs.h

esac

###

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want the saveconfig mechanism" >&5
$as_echo_n "checking if we want the saveconfig mechanism... " >&6; }
# Check whether --enable-saveconfig was given.
if test "${enable_saveconfig+set}" = set; then :
  enableval=$enable_saveconfig; ntp_ok=$enableval
else
  ntp_ok=yes

fi

ntp_saveconfig_enabled=0
if test "$ntp_ok" = "yes"; then
    ntp_saveconfig_enabled=1

$as_echo "#define SAVECONFIG 1" >>confdefs.h

fi
 if test x$ntp_saveconfig_enabled = x1; then
  SAVECONFIG_ENABLED_TRUE=
  SAVECONFIG_ENABLED_FALSE='#'
else
  SAVECONFIG_ENABLED_TRUE='#'
  SAVECONFIG_ENABLED_FALSE=
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
$as_echo "$ntp_ok" >&6; }

###


	ac_expanded=`(
	    test "x$prefix" = xNONE && prefix="$ac_default_prefix"
	    test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
	    eval echo \""$sysconfdir"\"
	)`

cat >>confdefs.h <<_ACEOF
#define NTP_KEYSDIR "$ac_expanded"
_ACEOF



ac_config_files="$ac_config_files Makefile"

ac_config_files="$ac_config_files ElectricFence/Makefile"

ac_config_files="$ac_config_files adjtimed/Makefile"

ac_config_files="$ac_config_files clockstuff/Makefile"

ac_config_files="$ac_config_files include/Makefile"

ac_config_files="$ac_config_files include/isc/Makefile"

ac_config_files="$ac_config_files kernel/Makefile"

ac_config_files="$ac_config_files kernel/sys/Makefile"

ac_config_files="$ac_config_files libntp/Makefile"

ac_config_files="$ac_config_files libparse/Makefile"

ac_config_files="$ac_config_files ntpd/Makefile"

ac_config_files="$ac_config_files ntpdate/Makefile"

ac_config_files="$ac_config_files ntpdc/Makefile"

ac_config_files="$ac_config_files ntpdc/nl.pl"

ac_config_files="$ac_config_files ntpq/Makefile"

ac_config_files="$ac_config_files ntpsnmpd/Makefile"

ac_config_files="$ac_config_files parseutil/Makefile"

ac_config_files="$ac_config_files scripts/Makefile"

ac_config_files="$ac_config_files scripts/calc_tickadj"

ac_config_files="$ac_config_files scripts/checktime"

ac_config_files="$ac_config_files scripts/freq_adj"

ac_config_files="$ac_config_files scripts/html2man"

ac_config_files="$ac_config_files scripts/mkver"

ac_config_files="$ac_config_files scripts/ntp-wait"

ac_config_files="$ac_config_files scripts/ntpsweep"

ac_config_files="$ac_config_files scripts/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 util/Makefile"




subdirs="$subdirs sntp"


cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems.  If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.

_ACEOF

# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
    eval ac_val=\$$ac_var
    case $ac_val in #(
    *${as_nl}*)
      case $ac_var in #(
      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      esac
      case $ac_var in #(
      _ | IFS | as_nl) ;; #(
      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
      *) { eval $ac_var=; unset $ac_var;} ;;
      esac ;;
    esac
  done

  (set) 2>&1 |
    case $as_nl`(ac_space=' '; set) 2>&1` in #(
    *${as_nl}ac_space=\ *)
      # `set' does not quote correctly, so add quotes: double-quote
      # substitution turns \\\\ into \\, and sed turns \\ into \.
      sed -n \
	"s/'/'\\\\''/g;
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
      ;; #(
    *)
      # `set' quotes correctly as required by POSIX, so do not add quotes.
      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
      ;;
    esac |
    sort
) |
  sed '
     /^ac_cv_env_/b end
     t clear
     :clear
     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
     t end
     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
     :end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
  if test -w "$cache_file"; then
    if test "x$cache_file" != "x/dev/null"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
      if test ! -f "$cache_file" || test -h "$cache_file"; then
	cat confcache >"$cache_file"
      else
        case $cache_file in #(
        */* | ?:*)
	  mv -f confcache "$cache_file"$$ &&
	  mv -f "$cache_file"$$ "$cache_file" ;; #(
        *)
	  mv -f confcache "$cache_file" ;;
	esac
      fi
    fi
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
  fi
fi
rm -f confcache

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

DEFS=-DHAVE_CONFIG_H

ac_libobjs=
ac_ltlibobjs=
U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
  # 1. Remove the extension, and $U if already installed.
  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
  #    will be set to the directory where LIBOBJS objects are built.
  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs

LTLIBOBJS=$ac_ltlibobjs


 if test -n "$EXEEXT"; then
  am__EXEEXT_TRUE=
  am__EXEEXT_FALSE='#'
else
  am__EXEEXT_TRUE='#'
  am__EXEEXT_FALSE=
fi

if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
  as_fn_error $? "conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
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 "${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 "${VPATH_HACK_TRUE}" && test -z "${VPATH_HACK_FALSE}"; then
  as_fn_error $? "conditional \"VPATH_HACK\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${INSTALL_LIBOPTS_TRUE}" && test -z "${INSTALL_LIBOPTS_FALSE}"; then
  as_fn_error $? "conditional \"INSTALL_LIBOPTS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${NEED_LIBOPTS_TRUE}" && test -z "${NEED_LIBOPTS_FALSE}"; then
  as_fn_error $? "conditional \"NEED_LIBOPTS\" 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
fi
if test -z "${NTP_BINSUBDIR_IS_BIN_TRUE}" && test -z "${NTP_BINSUBDIR_IS_BIN_FALSE}"; then
  as_fn_error $? "conditional \"NTP_BINSUBDIR_IS_BIN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi

if test -z "${SAVECONFIG_ENABLED_TRUE}" && test -z "${SAVECONFIG_ENABLED_FALSE}"; then
  as_fn_error $? "conditional \"SAVECONFIG_ENABLED\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi

: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.

debug=false
ac_cs_recheck=false
ac_cs_silent=false

SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##

# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
  emulate sh
  NULLCMD=:
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
else
  case `(set -o) 2>/dev/null` in #(
  *posix*) :
    set -o posix ;; #(
  *) :
     ;;
esac
fi


as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='print -r --'
  as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='printf %s\n'
  as_echo_n='printf %s'
else
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
    as_echo_n='/usr/ucb/echo -n'
  else
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
    as_echo_n_body='eval
      arg=$1;
      case $arg in #(
      *"$as_nl"*)
	expr "X$arg" : "X\\(.*\\)$as_nl";
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
      esac;
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
    '
    export as_echo_n_body
    as_echo_n='sh -c $as_echo_n_body as_echo'
  fi
  export as_echo_body
  as_echo='sh -c $as_echo_body as_echo'
fi

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  PATH_SEPARATOR=:
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
      PATH_SEPARATOR=';'
  }
fi


# IFS
# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" ""	$as_nl"

# Find who we are.  Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
  *[\\/]* ) as_myself=$0 ;;
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
  done
IFS=$as_save_IFS

     ;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
  as_myself=$0
fi
if test ! -f "$as_myself"; then
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
  exit 1
fi

# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there.  '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '

# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE

# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH


# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
  as_status=$1; test $as_status -eq 0 && as_status=1
  if test "$4"; then
    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
  fi
  $as_echo "$as_me: error: $2" >&2
  as_fn_exit $as_status
} # as_fn_error


# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
  return $1
} # as_fn_set_status

# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
  set +e
  as_fn_set_status $1
  exit $1
} # as_fn_exit

# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
  { eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
  eval 'as_fn_append ()
  {
    eval $1+=\$2
  }'
else
  as_fn_append ()
  {
    eval $1=\$$1\$2
  }
fi # as_fn_append

# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
  eval 'as_fn_arith ()
  {
    as_val=$(( $* ))
  }'
else
  as_fn_arith ()
  {
    as_val=`expr "$@" || test $? -eq 1`
  }
fi # as_fn_arith


if expr a : '\(a\)' >/dev/null 2>&1 &&
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
  as_expr=expr
else
  as_expr=false
fi

if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
  as_basename=basename
else
  as_basename=false
fi

if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
  as_dirname=dirname
else
  as_dirname=false
fi

as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`

# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits

ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
  case `echo 'xy\c'` in
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
  xy)  ECHO_C='\c';;
  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
       ECHO_T='	';;
  esac;;
*)
  ECHO_N='-n';;
esac

rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
  rm -f conf$$.dir/conf$$.file
else
  rm -f conf$$.dir
  mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
  if ln -s conf$$.file conf$$ 2>/dev/null; then
    as_ln_s='ln -s'
    # ... but there are two gotchas:
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
    # In both cases, we have to default to `cp -p'.
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
      as_ln_s='cp -p'
  elif ln conf$$.file conf$$ 2>/dev/null; then
    as_ln_s=ln
  else
    as_ln_s='cp -p'
  fi
else
  as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null


# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{

  case $as_dir in #(
  -*) as_dir=./$as_dir;;
  esac
  test -d "$as_dir" || eval $as_mkdir_p || {
    as_dirs=
    while :; do
      case $as_dir in #(
      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
      *) as_qdir=$as_dir;;
      esac
      as_dirs="'$as_qdir' $as_dirs"
      as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$as_dir" : 'X\(//\)[^/]' \| \
	 X"$as_dir" : 'X\(//\)$' \| \
	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
      test -d "$as_dir" && break
    done
    test -z "$as_dirs" || eval "mkdir $as_dirs"
  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"


} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
  as_mkdir_p='mkdir -p "$as_dir"'
else
  test -d ./-p && rmdir ./-p
  as_mkdir_p=false
fi

if test -x / >/dev/null 2>&1; then
  as_test_x='test -x'
else
  if ls -dL / >/dev/null 2>&1; then
    as_ls_L_option=L
  else
    as_ls_L_option=
  fi
  as_test_x='
    eval sh -c '\''
      if test -d "$1"; then
	test -d "$1/.";
      else
	case $1 in #(
	-*)set "./$1";;
	esac;
	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
	???[sx]*):;;*)false;;esac;fi
    '\'' sh
  '
fi
as_executable_p=$as_test_x

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"


exec 6>&1
## ----------------------------------- ##
## Main body of $CONFIG_STATUS script. ##
## ----------------------------------- ##
_ASEOF
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# 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.6p5, which was
generated by GNU Autoconf 2.68.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 $@

on `(hostname || uname -n) 2>/dev/null | sed 1q`
"

_ACEOF

case $ac_config_files in *"
"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac

case $ac_config_headers in *"
"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
esac


cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_headers="$ac_config_headers"
config_commands="$ac_config_commands"

_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files and other configuration actions
from templates according to the current configuration.  Unless the files
and actions are specified as TAGs, all are instantiated by default.

Usage: $0 [OPTION]... [TAG]...

  -h, --help       print this help, then exit
  -V, --version    print version number and configuration settings, then exit
      --config     print configuration, then exit
  -q, --quiet, --silent
                   do not print progress messages
  -d, --debug      don't remove temporary files
      --recheck    update $as_me by reconfiguring in the same conditions
      --file=FILE[:TEMPLATE]
                   instantiate the configuration file FILE
      --header=FILE[:TEMPLATE]
                   instantiate the configuration header FILE

Configuration files:
$config_files

Configuration headers:
$config_headers

Configuration commands:
$config_commands

Report bugs to the package provider."

_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.6p5
configured by $0, generated by GNU Autoconf 2.68,
  with options \\"\$ac_cs_config\\"

Copyright (C) 2010 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."

ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
MKDIR_P='$MKDIR_P'
AWK='$AWK'
test -n "\$AWK" || AWK=awk
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
  case $1 in
  --*=?*)
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
    ac_shift=:
    ;;
  --*=)
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
    ac_optarg=
    ac_shift=:
    ;;
  *)
    ac_option=$1
    ac_optarg=$2
    ac_shift=shift
    ;;
  esac

  case $ac_option in
  # Handling of the options.
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    ac_cs_recheck=: ;;
  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
    $as_echo "$ac_cs_version"; exit ;;
  --config | --confi | --conf | --con | --co | --c )
    $as_echo "$ac_cs_config"; exit ;;
  --debug | --debu | --deb | --de | --d | -d )
    debug=: ;;
  --file | --fil | --fi | --f )
    $ac_shift
    case $ac_optarg in
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
    '') as_fn_error $? "missing file argument" ;;
    esac
    as_fn_append CONFIG_FILES " '$ac_optarg'"
    ac_need_defaults=false;;
  --header | --heade | --head | --hea )
    $ac_shift
    case $ac_optarg in
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
    esac
    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
    ac_need_defaults=false;;
  --he | --h)
    # Conflict between --help and --header
    as_fn_error $? "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
  --help | --hel | -h )
    $as_echo "$ac_cs_usage"; exit ;;
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil | --si | --s)
    ac_cs_silent=: ;;

  # This is an error.
  -*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;

  *) as_fn_append ac_config_targets " $1"
     ac_need_defaults=false ;;

  esac
  shift
done

ac_configure_extra_args=

if $ac_cs_silent; then
  exec 6>/dev/null
  ac_configure_extra_args="$ac_configure_extra_args --silent"
fi

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
  shift
  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
  CONFIG_SHELL='$SHELL'
  export CONFIG_SHELL
  exec "\$@"
fi

_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
  echo
  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
  $as_echo "$ac_log"
} >&5

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"


# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH

sed_quote_subst='$sed_quote_subst'
double_quote_subst='$double_quote_subst'
delay_variable_subst='$delay_variable_subst'
enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'

LTCC='$LTCC'
LTCFLAGS='$LTCFLAGS'
compiler='$compiler_DEFAULT'

# A function that is used when there is no print builtin or printf.
func_fallback_echo ()
{
  eval 'cat <<_LTECHO_EOF
\$1
_LTECHO_EOF'
}

# Quote evaled strings.
for var in SHELL \
ECHO \
SED \
GREP \
EGREP \
FGREP \
LD \
NM \
LN_S \
lt_SP2NL \
lt_NL2SP \
reload_flag \
OBJDUMP \
deplibs_check_method \
file_magic_cmd \
file_magic_glob \
want_nocaseglob \
DLLTOOL \
sharedlib_from_linklib_cmd \
AR \
AR_FLAGS \
archiver_list_spec \
STRIP \
RANLIB \
CC \
CFLAGS \
compiler \
lt_cv_sys_global_symbol_pipe \
lt_cv_sys_global_symbol_to_cdecl \
lt_cv_sys_global_symbol_to_c_name_address \
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
nm_file_list_spec \
lt_prog_compiler_no_builtin_flag \
lt_prog_compiler_pic \
lt_prog_compiler_wl \
lt_prog_compiler_static \
lt_cv_prog_compiler_c_o \
need_locks \
MANIFEST_TOOL \
DSYMUTIL \
NMEDIT \
LIPO \
OTOOL \
OTOOL64 \
shrext_cmds \
export_dynamic_flag_spec \
whole_archive_flag_spec \
compiler_needs_object \
with_gnu_ld \
allow_undefined_flag \
no_undefined_flag \
hardcode_libdir_flag_spec \
hardcode_libdir_flag_spec_ld \
hardcode_libdir_separator \
exclude_expsyms \
include_expsyms \
file_list_spec \
variables_saved_for_relink \
libname_spec \
library_names_spec \
soname_spec \
install_override_mode \
finish_eval \
old_striplib \
striplib; do
    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
    *[\\\\\\\`\\"\\\$]*)
      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
      ;;
    *)
      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
      ;;
    esac
done

# Double-quote double-evaled strings.
for var in reload_cmds \
old_postinstall_cmds \
old_postuninstall_cmds \
old_archive_cmds \
extract_expsyms_cmds \
old_archive_from_new_cmds \
old_archive_from_expsyms_cmds \
archive_cmds \
archive_expsym_cmds \
module_cmds \
module_expsym_cmds \
export_symbols_cmds \
prelink_cmds \
postlink_cmds \
postinstall_cmds \
postuninstall_cmds \
finish_cmds \
sys_lib_search_path_spec \
sys_lib_dlsearch_path_spec; do
    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
    *[\\\\\\\`\\"\\\$]*)
      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
      ;;
    *)
      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
      ;;
    esac
done

ac_aux_dir='$ac_aux_dir'
xsi_shell='$xsi_shell'
lt_shell_append='$lt_shell_append'

# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes INIT.
if test -n "\${ZSH_VERSION+set}" ; then
   setopt NO_GLOB_SUBST
fi


    PACKAGE='$PACKAGE'
    VERSION='$VERSION'
    TIMESTAMP='$TIMESTAMP'
    RM='$RM'
    ofile='$ofile'




_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1

# Handling of arguments.
for ac_config_target in $ac_config_targets
do
  case $ac_config_target in
    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
    "ElectricFence/Makefile") CONFIG_FILES="$CONFIG_FILES ElectricFence/Makefile" ;;
    "adjtimed/Makefile") CONFIG_FILES="$CONFIG_FILES adjtimed/Makefile" ;;
    "clockstuff/Makefile") CONFIG_FILES="$CONFIG_FILES clockstuff/Makefile" ;;
    "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
    "include/isc/Makefile") CONFIG_FILES="$CONFIG_FILES include/isc/Makefile" ;;
    "kernel/Makefile") CONFIG_FILES="$CONFIG_FILES kernel/Makefile" ;;
    "kernel/sys/Makefile") CONFIG_FILES="$CONFIG_FILES kernel/sys/Makefile" ;;
    "libntp/Makefile") CONFIG_FILES="$CONFIG_FILES libntp/Makefile" ;;
    "libparse/Makefile") CONFIG_FILES="$CONFIG_FILES libparse/Makefile" ;;
    "ntpd/Makefile") CONFIG_FILES="$CONFIG_FILES ntpd/Makefile" ;;
    "ntpdate/Makefile") CONFIG_FILES="$CONFIG_FILES ntpdate/Makefile" ;;
    "ntpdc/Makefile") CONFIG_FILES="$CONFIG_FILES ntpdc/Makefile" ;;
    "ntpdc/nl.pl") CONFIG_FILES="$CONFIG_FILES ntpdc/nl.pl" ;;
    "ntpq/Makefile") CONFIG_FILES="$CONFIG_FILES ntpq/Makefile" ;;
    "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/calc_tickadj") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj" ;;
    "scripts/checktime") CONFIG_FILES="$CONFIG_FILES scripts/checktime" ;;
    "scripts/freq_adj") CONFIG_FILES="$CONFIG_FILES scripts/freq_adj" ;;
    "scripts/html2man") CONFIG_FILES="$CONFIG_FILES scripts/html2man" ;;
    "scripts/mkver") CONFIG_FILES="$CONFIG_FILES scripts/mkver" ;;
    "scripts/ntp-wait") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait" ;;
    "scripts/ntpsweep") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep" ;;
    "scripts/ntptrace") CONFIG_FILES="$CONFIG_FILES scripts/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" ;;
    "util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;;

  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
  esac
done


# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used.  Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
fi

# Have a temporary directory for convenience.  Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
  tmp= ac_tmp=
  trap 'exit_status=$?
  : "${ac_tmp:=$tmp}"
  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
  trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.

{
  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
  test -d "$tmp"
}  ||
{
  tmp=./conf$$-$RANDOM
  (umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
ac_tmp=$tmp

# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then


ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
# point, so we can use a bashism as a fallback.
if test "x$ac_cr" = x; then
  eval ac_cr=\$\'\\r\'
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
  ac_cs_awk_cr='\\r'
else
  ac_cs_awk_cr=$ac_cr
fi

echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF


{
  echo "cat >conf$$subs.awk <<_ACEOF" &&
  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
  echo "_ACEOF"
} >conf$$subs.sh ||
  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
  . ./conf$$subs.sh ||
    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5

  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
  if test $ac_delim_n = $ac_delim_num; then
    break
  elif $ac_last_try; then
    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
  else
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
  fi
done
rm -f conf$$subs.sh

cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
s/^/S["/; s/!.*/"]=/
p
g
s/^[^!]*!//
:repl
t repl
s/'"$ac_delim"'$//
t delim
:nl
h
s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
n
b repl
:more1
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t nl
:delim
h
s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
b
:more2
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t delim
' >$CONFIG_STATUS || ac_write_fail=1
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
  for (key in S) S_is_set[key] = 1
  FS = ""

}
{
  line = $ 0
  nfields = split(line, field, "@")
  substed = 0
  len = length(field[1])
  for (i = 2; i < nfields; i++) {
    key = field[i]
    keylen = length(key)
    if (S_is_set[key]) {
      value = S[key]
      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
      len += length(value) + length(field[++i])
      substed = 1
    } else
      len += 1 + keylen
  }

  print line
}

_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
  cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF

# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
h
s///
s/^/:/
s/[	 ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[	 ]*\).*/\1/
G
s/\n//
s/^[^=]*=[	 ]*$//
}'
fi

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"

# Set up the scripts for CONFIG_HEADERS section.
# No need to generate them if there are no CONFIG_HEADERS.
# This happens for instance with `./config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF

# Transform confdefs.h into an awk script `defines.awk', embedded as
# here-document in config.status, that substitutes the proper values into
# config.h.in to produce config.h.

# Create a delimiter string that does not exist in confdefs.h, to ease
# handling of long lines.
ac_delim='%!_!# '
for ac_last_try in false false :; do
  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
  if test -z "$ac_tt"; then
    break
  elif $ac_last_try; then
    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
  else
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
  fi
done

# For the awk script, D is an array of macro values keyed by name,
# likewise P contains macro parameters if any.  Preserve backslash
# newline sequences.

ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
sed -n '
s/.\{148\}/&'"$ac_delim"'/g
t rset
:rset
s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
t def
d
:def
s/\\$//
t bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3"/p
s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
d
:bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3\\\\\\n"\\/p
t cont
s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
t cont
d
:cont
n
s/.\{148\}/&'"$ac_delim"'/g
t clear
:clear
s/\\$//
t bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/"/p
d
:bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
b cont
' >$CONFIG_STATUS || ac_write_fail=1

cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  for (key in D) D_is_set[key] = 1
  FS = ""
}
/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
  line = \$ 0
  split(line, arg, " ")
  if (arg[1] == "#") {
    defundef = arg[2]
    mac1 = arg[3]
  } else {
    defundef = substr(arg[1], 2)
    mac1 = arg[2]
  }
  split(mac1, mac2, "(") #)
  macro = mac2[1]
  prefix = substr(line, 1, index(line, defundef) - 1)
  if (D_is_set[macro]) {
    # Preserve the white space surrounding the "#".
    print prefix "define", macro P[macro] D[macro]
    next
  } else {
    # Replace #undef with comments.  This is necessary, for example,
    # in the case of _POSIX_SOURCE, which is predefined and required
    # on some systems where configure will not decide to define it.
    if (defundef == "undef") {
      print "/*", prefix defundef, macro, "*/"
      next
    }
  }
}
{ print }
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
fi # test -n "$CONFIG_HEADERS"


eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
shift
for ac_tag
do
  case $ac_tag in
  :[FHLC]) ac_mode=$ac_tag; continue;;
  esac
  case $ac_mode$ac_tag in
  :[FHL]*:*);;
  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
  :[FH]-) ac_tag=-:-;;
  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
  esac
  ac_save_IFS=$IFS
  IFS=:
  set x $ac_tag
  IFS=$ac_save_IFS
  shift
  ac_file=$1
  shift

  case $ac_mode in
  :L) ac_source=$1;;
  :[FH])
    ac_file_inputs=
    for ac_f
    do
      case $ac_f in
      -) ac_f="$ac_tmp/stdin";;
      *) # Look for the file first in the build tree, then in the source tree
	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
	 # because $ac_f cannot contain `:'.
	 test -f "$ac_f" ||
	   case $ac_f in
	   [\\/$]*) false;;
	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
	   esac ||
	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
      esac
      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
      as_fn_append ac_file_inputs " '$ac_f'"
    done

    # Let's still pretend it is `configure' which instantiates (i.e., don't
    # use $as_me), people would be surprised to read:
    #    /* config.h.  Generated by config.status.  */
    configure_input='Generated from '`
	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
	`' by configure.'
    if test x"$ac_file" != x-; then
      configure_input="$ac_file.  $configure_input"
      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
$as_echo "$as_me: creating $ac_file" >&6;}
    fi
    # Neutralize special characters interpreted by sed in replacement strings.
    case $configure_input in #(
    *\&* | *\|* | *\\* )
       ac_sed_conf_input=`$as_echo "$configure_input" |
       sed 's/[\\\\&|]/\\\\&/g'`;; #(
    *) ac_sed_conf_input=$configure_input;;
    esac

    case $ac_tag in
    *:-:* | *:-) cat >"$ac_tmp/stdin" \
      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
    esac
    ;;
  esac

  ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$ac_file" : 'X\(//\)[^/]' \| \
	 X"$ac_file" : 'X\(//\)$' \| \
	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$ac_file" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
  as_dir="$ac_dir"; as_fn_mkdir_p
  ac_builddir=.

case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
  # A ".." for each directory in $ac_dir_suffix.
  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
  case $ac_top_builddir_sub in
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
  esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix

case $srcdir in
  .)  # We are building in place.
    ac_srcdir=.
    ac_top_srcdir=$ac_top_builddir_sub
    ac_abs_top_srcdir=$ac_pwd ;;
  [\\/]* | ?:[\\/]* )  # Absolute name.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir
    ac_abs_top_srcdir=$srcdir ;;
  *) # Relative name.
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_build_prefix$srcdir
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix


  case $ac_mode in
  :F)
  #
  # CONFIG_FILE
  #

  case $INSTALL in
  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
  esac
  ac_MKDIR_P=$MKDIR_P
  case $MKDIR_P in
  [\\/$]* | ?:[\\/]* ) ;;
  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
  esac
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
ac_sed_dataroot='
/datarootdir/ {
  p
  q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  ac_datarootdir_hack='
  s&@datadir@&$datadir&g
  s&@docdir@&$docdir&g
  s&@infodir@&$infodir&g
  s&@localedir@&$localedir&g
  s&@mandir@&$mandir&g
  s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF

# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
s&@MKDIR_P@&$ac_MKDIR_P&;t t
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5

test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
      "$ac_tmp/out"`; test -z "$ac_out"; } &&
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined.  Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined.  Please make sure it is defined" >&2;}

  rm -f "$ac_tmp/stdin"
  case $ac_file in
  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
  esac \
  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 ;;
  :H)
  #
  # CONFIG_HEADER
  #
  if test x"$ac_file" != x-; then
    {
      $as_echo "/* $configure_input  */" \
      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
    } >"$ac_tmp/config.h" \
      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
$as_echo "$as_me: $ac_file is unchanged" >&6;}
    else
      rm -f "$ac_file"
      mv "$ac_tmp/config.h" "$ac_file" \
	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
    fi
  else
    $as_echo "/* $configure_input  */" \
      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
      || as_fn_error $? "could not create -" "$LINENO" 5
  fi
# Compute "$ac_file"'s index in $config_headers.
_am_arg="$ac_file"
_am_stamp_count=1
for _am_header in $config_headers :; do
  case $_am_header in
    $_am_arg | $_am_arg:* )
      break ;;
    * )
      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  esac
done
echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$_am_arg" : 'X\(//\)[^/]' \| \
	 X"$_am_arg" : 'X\(//\)$' \| \
	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$_am_arg" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`/stamp-h$_am_stamp_count
 ;;

  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
$as_echo "$as_me: executing $ac_file commands" >&6;}
 ;;
  esac


  case $ac_file$ac_mode in
    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
  # Autoconf 2.62 quotes --file arguments for eval, but not when files
  # are listed without --file.  Let's play safe and only enable the eval
  # if we detect the quoting.
  case $CONFIG_FILES in
  *\'*) eval set x "$CONFIG_FILES" ;;
  *)   set x $CONFIG_FILES ;;
  esac
  shift
  for mf
  do
    # Strip MF so we end up with the name of the file.
    mf=`echo "$mf" | sed -e 's/:.*$//'`
    # Check whether this is an Automake generated Makefile or not.
    # We used to match only the files named `Makefile.in', but
    # some people rename them; so instead we look at the file content.
    # Grep'ing the first line is not enough: some people post-process
    # each Makefile.in and add a new line on top of each file to say so.
    # Grep'ing the whole file is not good either: AIX grep has a line
    # limit of 2048, but all sed's we know have understand at least 4000.
    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
      dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$mf" : 'X\(//\)[^/]' \| \
	 X"$mf" : 'X\(//\)$' \| \
	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$mf" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
    else
      continue
    fi
    # Extract the definition of DEPDIR, am__include, and am__quote
    # from the Makefile without running `make'.
    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
    test -z "$DEPDIR" && continue
    am__include=`sed -n 's/^am__include = //p' < "$mf"`
    test -z "am__include" && continue
    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
    # When using ansi2knr, U may be empty or an underscore; expand it
    U=`sed -n 's/^U = //p' < "$mf"`
    # Find all dependency output files, they are included files with
    # $(DEPDIR) in their names.  We invoke sed twice because it is the
    # simplest approach to changing $(DEPDIR) to its actual value in the
    # expansion.
    for file in `sed -n "
      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
      # Make sure the directory exists.
      test -f "$dirpart/$file" && continue
      fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$file" : 'X\(//\)[^/]' \| \
	 X"$file" : 'X\(//\)$' \| \
	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$file" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
      as_dir=$dirpart/$fdir; as_fn_mkdir_p
      # echo "creating $dirpart/$file"
      echo '# dummy' > "$dirpart/$file"
    done
  done
}
 ;;
    "libtool":C)

    # See if we are running on zsh, and set the options which allow our
    # commands through without removal of \ escapes.
    if test -n "${ZSH_VERSION+set}" ; then
      setopt NO_GLOB_SUBST
    fi

    cfgfile="${ofile}T"
    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
    $RM "$cfgfile"

    cat <<_LT_EOF >> "$cfgfile"
#! $SHELL

# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
#                 Inc.
#   Written by Gordon Matzigkeit, 1996
#
#   This file is part of GNU Libtool.
#
# GNU Libtool 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 2 of
# the License, or (at your option) any later version.
#
# As a special exception to the GNU General Public License,
# if you distribute this file as part of a program or library that
# is built using GNU Libtool, you may include this file under the
# same distribution terms that you use for the rest of that program.
#
# GNU Libtool 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 GNU Libtool; see the file COPYING.  If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
# obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


# The names of the tagged configurations supported by this script.
available_tags=""

# ### BEGIN LIBTOOL CONFIG

# Whether or not to build shared libraries.
build_libtool_libs=$enable_shared

# Which release of libtool.m4 was used?
macro_version=$macro_version
macro_revision=$macro_revision

# Whether or not to build static libraries.
build_old_libs=$enable_static

# What type of objects to build.
pic_mode=$pic_mode

# Whether or not to optimize for fast installation.
fast_install=$enable_fast_install

# Shell to use when invoking shell scripts.
SHELL=$lt_SHELL

# An echo program that protects backslashes.
ECHO=$lt_ECHO

# The host system.
host_alias=$host_alias
host=$host
host_os=$host_os

# The build system.
build_alias=$build_alias
build=$build
build_os=$build_os

# A sed program that does not truncate output.
SED=$lt_SED

# Sed that helps us avoid accidentally triggering echo(1) options like -n.
Xsed="\$SED -e 1s/^X//"

# A grep program that handles long lines.
GREP=$lt_GREP

# An ERE matcher.
EGREP=$lt_EGREP

# A literal string matcher.
FGREP=$lt_FGREP

# A BSD- or MS-compatible name lister.
NM=$lt_NM

# Whether we need soft or hard links.
LN_S=$lt_LN_S

# What is the maximum length of a command?
max_cmd_len=$max_cmd_len

# Object file suffix (normally "o").
objext=$ac_objext

# Executable file suffix (normally "").
exeext=$exeext

# whether the shell understands "unset".
lt_unset=$lt_unset

# turn spaces into newlines.
SP2NL=$lt_lt_SP2NL

# turn newlines into spaces.
NL2SP=$lt_lt_NL2SP

# convert \$build file names to \$host format.
to_host_file_cmd=$lt_cv_to_host_file_cmd

# convert \$build files to toolchain format.
to_tool_file_cmd=$lt_cv_to_tool_file_cmd

# An object symbol dumper.
OBJDUMP=$lt_OBJDUMP

# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method

# Command to use when deplibs_check_method = "file_magic".
file_magic_cmd=$lt_file_magic_cmd

# How to find potential files when deplibs_check_method = "file_magic".
file_magic_glob=$lt_file_magic_glob

# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
want_nocaseglob=$lt_want_nocaseglob

# DLL creation program.
DLLTOOL=$lt_DLLTOOL

# Command to associate shared and link libraries.
sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd

# The archiver.
AR=$lt_AR

# Flags to create an archive.
AR_FLAGS=$lt_AR_FLAGS

# How to feed a file listing to the archiver.
archiver_list_spec=$lt_archiver_list_spec

# A symbol stripping program.
STRIP=$lt_STRIP

# Commands used to install an old-style archive.
RANLIB=$lt_RANLIB
old_postinstall_cmds=$lt_old_postinstall_cmds
old_postuninstall_cmds=$lt_old_postuninstall_cmds

# Whether to use a lock for old archive extraction.
lock_old_archive_extraction=$lock_old_archive_extraction

# A C compiler.
LTCC=$lt_CC

# LTCC compiler flags.
LTCFLAGS=$lt_CFLAGS

# Take the output of nm and produce a listing of raw symbols and C names.
global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe

# Transform the output of nm in a proper C declaration.
global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl

# Transform the output of nm in a C name address pair.
global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address

# Transform the output of nm in a C name address pair when lib prefix is needed.
global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix

# Specify filename containing input files for \$NM.
nm_file_list_spec=$lt_nm_file_list_spec

# The root where to search for dependent libraries,and in which our libraries should be installed.
lt_sysroot=$lt_sysroot

# The name of the directory that contains temporary libtool files.
objdir=$objdir

# Used to examine libraries when file_magic_cmd begins with "file".
MAGIC_CMD=$MAGIC_CMD

# Must we lock files when doing compilation?
need_locks=$lt_need_locks

# Manifest tool.
MANIFEST_TOOL=$lt_MANIFEST_TOOL

# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
DSYMUTIL=$lt_DSYMUTIL

# Tool to change global to local symbols on Mac OS X.
NMEDIT=$lt_NMEDIT

# Tool to manipulate fat objects and archives on Mac OS X.
LIPO=$lt_LIPO

# ldd/readelf like tool for Mach-O binaries on Mac OS X.
OTOOL=$lt_OTOOL

# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
OTOOL64=$lt_OTOOL64

# Old archive suffix (normally "a").
libext=$libext

# Shared library suffix (normally ".so").
shrext_cmds=$lt_shrext_cmds

# The commands to extract the exported symbol list from a shared archive.
extract_expsyms_cmds=$lt_extract_expsyms_cmds

# Variables whose values should be saved in libtool wrapper scripts and
# restored at link time.
variables_saved_for_relink=$lt_variables_saved_for_relink

# Do we need the "lib" prefix for modules?
need_lib_prefix=$need_lib_prefix

# Do we need a version for libraries?
need_version=$need_version

# Library versioning type.
version_type=$version_type

# Shared library runtime path variable.
runpath_var=$runpath_var

# Shared library path variable.
shlibpath_var=$shlibpath_var

# Is shlibpath searched before the hard-coded library search path?
shlibpath_overrides_runpath=$shlibpath_overrides_runpath

# Format of library name prefix.
libname_spec=$lt_libname_spec

# List of archive names.  First name is the real one, the rest are links.
# The last name is the one that the linker finds with -lNAME
library_names_spec=$lt_library_names_spec

# The coded name of the library, if different from the real name.
soname_spec=$lt_soname_spec

# Permission mode override for installation of shared libraries.
install_override_mode=$lt_install_override_mode

# Command to use after installation of a shared archive.
postinstall_cmds=$lt_postinstall_cmds

# Command to use after uninstallation of a shared archive.
postuninstall_cmds=$lt_postuninstall_cmds

# Commands used to finish a libtool library installation in a directory.
finish_cmds=$lt_finish_cmds

# As "finish_cmds", except a single script fragment to be evaled but
# not shown.
finish_eval=$lt_finish_eval

# Whether we should hardcode library paths into libraries.
hardcode_into_libs=$hardcode_into_libs

# Compile-time system search path for libraries.
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec

# Run-time system search path for libraries.
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec

# Whether dlopen is supported.
dlopen_support=$enable_dlopen

# Whether dlopen of programs is supported.
dlopen_self=$enable_dlopen_self

# Whether dlopen of statically linked programs is supported.
dlopen_self_static=$enable_dlopen_self_static

# Commands to strip libraries.
old_striplib=$lt_old_striplib
striplib=$lt_striplib


# The linker used to build libraries.
LD=$lt_LD

# How to create reloadable object files.
reload_flag=$lt_reload_flag
reload_cmds=$lt_reload_cmds

# Commands used to build an old-style archive.
old_archive_cmds=$lt_old_archive_cmds

# A language specific compiler.
CC=$lt_compiler

# Is the compiler the GNU compiler?
with_gcc=$GCC

# Compiler flag to turn off builtin functions.
no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag

# Additional compiler flags for building library objects.
pic_flag=$lt_lt_prog_compiler_pic

# How to pass a linker flag through the compiler.
wl=$lt_lt_prog_compiler_wl

# Compiler flag to prevent dynamic linking.
link_static_flag=$lt_lt_prog_compiler_static

# Does compiler simultaneously support -c and -o options?
compiler_c_o=$lt_lt_cv_prog_compiler_c_o

# Whether or not to add -lc for building shared libraries.
build_libtool_need_lc=$archive_cmds_need_lc

# Whether or not to disallow shared libs when runtime libs are static.
allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes

# Compiler flag to allow reflexive dlopens.
export_dynamic_flag_spec=$lt_export_dynamic_flag_spec

# Compiler flag to generate shared objects directly from archives.
whole_archive_flag_spec=$lt_whole_archive_flag_spec

# Whether the compiler copes with passing no objects directly.
compiler_needs_object=$lt_compiler_needs_object

# Create an old-style archive from a shared archive.
old_archive_from_new_cmds=$lt_old_archive_from_new_cmds

# Create a temporary old-style archive to link instead of a shared archive.
old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds

# Commands used to build a shared archive.
archive_cmds=$lt_archive_cmds
archive_expsym_cmds=$lt_archive_expsym_cmds

# Commands used to build a loadable module if different from building
# a shared archive.
module_cmds=$lt_module_cmds
module_expsym_cmds=$lt_module_expsym_cmds

# Whether we are building with GNU ld or not.
with_gnu_ld=$lt_with_gnu_ld

# Flag that allows shared libraries with undefined symbols to be built.
allow_undefined_flag=$lt_allow_undefined_flag

# Flag that enforces no undefined symbols.
no_undefined_flag=$lt_no_undefined_flag

# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist
hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec

# If ld is used when linking, flag to hardcode \$libdir into a binary
# during linking.  This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld

# Whether we need a single "-rpath" flag with a separated argument.
hardcode_libdir_separator=$lt_hardcode_libdir_separator

# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
# DIR into the resulting binary.
hardcode_direct=$hardcode_direct

# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
# DIR into the resulting binary and the resulting library dependency is
# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
# library is relocated.
hardcode_direct_absolute=$hardcode_direct_absolute

# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
# into the resulting binary.
hardcode_minus_L=$hardcode_minus_L

# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
# into the resulting binary.
hardcode_shlibpath_var=$hardcode_shlibpath_var

# Set to "yes" if building a shared library automatically hardcodes DIR
# into the library and all subsequent libraries and executables linked
# against it.
hardcode_automatic=$hardcode_automatic

# Set to yes if linker adds runtime paths of dependent libraries
# to runtime path list.
inherit_rpath=$inherit_rpath

# Whether libtool must link a program against all its dependency libraries.
link_all_deplibs=$link_all_deplibs

# Set to "yes" if exported symbols are required.
always_export_symbols=$always_export_symbols

# The commands to list exported symbols.
export_symbols_cmds=$lt_export_symbols_cmds

# Symbols that should not be listed in the preloaded symbols.
exclude_expsyms=$lt_exclude_expsyms

# Symbols that must always be exported.
include_expsyms=$lt_include_expsyms

# Commands necessary for linking programs (against libraries) with templates.
prelink_cmds=$lt_prelink_cmds

# Commands necessary for finishing linking programs.
postlink_cmds=$lt_postlink_cmds

# Specify filename containing input files.
file_list_spec=$lt_file_list_spec

# How to hardcode a shared library path into an executable.
hardcode_action=$hardcode_action

# ### END LIBTOOL CONFIG

_LT_EOF

  case $host_os in
  aix3*)
    cat <<\_LT_EOF >> "$cfgfile"
# AIX sometimes has problems with the GCC collect2 program.  For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
  COLLECT_NAMES=
  export COLLECT_NAMES
fi
_LT_EOF
    ;;
  esac


ltmain="$ac_aux_dir/ltmain.sh"


  # We use sed instead of cat because bash on DJGPP gets confused if
  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
  # text mode, it properly converts lines to CR/LF.  This bash problem
  # is reportedly fixed, but why not run on old versions too?
  sed '$q' "$ltmain" >> "$cfgfile" \
     || (rm -f "$cfgfile"; exit 1)

  if test x"$xsi_shell" = xyes; then
  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
func_dirname ()\
{\
\    case ${1} in\
\      */*) func_dirname_result="${1%/*}${2}" ;;\
\      *  ) func_dirname_result="${3}" ;;\
\    esac\
} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
  && mv -f "$cfgfile.tmp" "$cfgfile" \
    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:


  sed -e '/^func_basename ()$/,/^} # func_basename /c\
func_basename ()\
{\
\    func_basename_result="${1##*/}"\
} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
  && mv -f "$cfgfile.tmp" "$cfgfile" \
    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:


  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
func_dirname_and_basename ()\
{\
\    case ${1} in\
\      */*) func_dirname_result="${1%/*}${2}" ;;\
\      *  ) func_dirname_result="${3}" ;;\
\    esac\
\    func_basename_result="${1##*/}"\
} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
  && mv -f "$cfgfile.tmp" "$cfgfile" \
    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:


  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
func_stripname ()\
{\
\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
\    # positional parameters, so assign one to ordinary parameter first.\
\    func_stripname_result=${3}\
\    func_stripname_result=${func_stripname_result#"${1}"}\
\    func_stripname_result=${func_stripname_result%"${2}"}\
} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
  && mv -f "$cfgfile.tmp" "$cfgfile" \
    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:


  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
func_split_long_opt ()\
{\
\    func_split_long_opt_name=${1%%=*}\
\    func_split_long_opt_arg=${1#*=}\
} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
  && mv -f "$cfgfile.tmp" "$cfgfile" \
    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:


  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
func_split_short_opt ()\
{\
\    func_split_short_opt_arg=${1#??}\
\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
  && mv -f "$cfgfile.tmp" "$cfgfile" \
    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:


  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
func_lo2o ()\
{\
\    case ${1} in\
\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
\      *)    func_lo2o_result=${1} ;;\
\    esac\
} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
  && mv -f "$cfgfile.tmp" "$cfgfile" \
    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:


  sed -e '/^func_xform ()$/,/^} # func_xform /c\
func_xform ()\
{\
    func_xform_result=${1%.*}.lo\
} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
  && mv -f "$cfgfile.tmp" "$cfgfile" \
    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:


  sed -e '/^func_arith ()$/,/^} # func_arith /c\
func_arith ()\
{\
    func_arith_result=$(( $* ))\
} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
  && mv -f "$cfgfile.tmp" "$cfgfile" \
    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:


  sed -e '/^func_len ()$/,/^} # func_len /c\
func_len ()\
{\
    func_len_result=${#1}\
} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
  && mv -f "$cfgfile.tmp" "$cfgfile" \
    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:

fi

if test x"$lt_shell_append" = xyes; then
  sed -e '/^func_append ()$/,/^} # func_append /c\
func_append ()\
{\
    eval "${1}+=\\${2}"\
} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
  && mv -f "$cfgfile.tmp" "$cfgfile" \
    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:


  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
func_append_quoted ()\
{\
\    func_quote_for_eval "${2}"\
\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
  && mv -f "$cfgfile.tmp" "$cfgfile" \
    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:


  # Save a `func_append' function call where possible by direct use of '+='
  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
    && mv -f "$cfgfile.tmp" "$cfgfile" \
      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
  test 0 -eq $? || _lt_function_replace_fail=:
else
  # Save a `func_append' function call even when '+=' is not available
  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
    && mv -f "$cfgfile.tmp" "$cfgfile" \
      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
  test 0 -eq $? || _lt_function_replace_fail=:
fi

if test x"$_lt_function_replace_fail" = x":"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
fi


   mv -f "$cfgfile" "$ofile" ||
    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
  chmod +x "$ofile"

 ;;
    "ntpdc/nl.pl":F) chmod +x ntpdc/nl.pl ;;
    "scripts/calc_tickadj":F) chmod +x scripts/calc_tickadj ;;
    "scripts/checktime":F) chmod +x scripts/checktime ;;
    "scripts/freq_adj":F) chmod +x scripts/freq_adj ;;
    "scripts/html2man":F) chmod +x scripts/html2man ;;
    "scripts/mkver":F) chmod +x scripts/mkver ;;
    "scripts/ntp-wait":F) chmod +x scripts/ntp-wait ;;
    "scripts/ntpsweep":F) chmod +x scripts/ntpsweep ;;
    "scripts/ntptrace":F) chmod +x scripts/ntptrace ;;
    "scripts/ntpver":F) chmod +x scripts/ntpver ;;
    "scripts/plot_summary":F) chmod +x scripts/plot_summary ;;
    "scripts/summary":F) chmod +x scripts/summary ;;

  esac
done # for ac_tag


as_fn_exit 0
_ACEOF
ac_clean_files=$ac_clean_files_save

test $ac_write_fail = 0 ||
  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5


# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded.  So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status.  When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
  ac_cs_success=:
  ac_config_status_args=
  test "$silent" = yes &&
    ac_config_status_args="$ac_config_status_args --quiet"
  exec 5>/dev/null
  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
  exec 5>>config.log
  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
  # would make configure fail if this is the last instruction.
  $ac_cs_success || as_fn_exit 1
fi

#
# CONFIG_SUBDIRS section.
#
if test "$no_recursion" != yes; then

  # Remove --cache-file, --srcdir, and --disable-option-checking arguments
  # so they do not pile up.
  ac_sub_configure_args=
  ac_prev=
  eval "set x $ac_configure_args"
  shift
  for ac_arg
  do
    if test -n "$ac_prev"; then
      ac_prev=
      continue
    fi
    case $ac_arg in
    -cache-file | --cache-file | --cache-fil | --cache-fi \
    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
      ac_prev=cache_file ;;
    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
    | --c=*)
      ;;
    --config-cache | -C)
      ;;
    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
      ac_prev=srcdir ;;
    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
      ;;
    -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
      ac_prev=prefix ;;
    -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
      ;;
    --disable-option-checking)
      ;;
    *)
      case $ac_arg in
      *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
      esac
      as_fn_append ac_sub_configure_args " '$ac_arg'" ;;
    esac
  done

  # Always prepend --prefix to ensure using the same prefix
  # in subdir configurations.
  ac_arg="--prefix=$prefix"
  case $ac_arg in
  *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
  esac
  ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"

  # Pass --silent
  if test "$silent" = yes; then
    ac_sub_configure_args="--silent $ac_sub_configure_args"
  fi

  # Always prepend --disable-option-checking to silence warnings, since
  # different subdirs can have different --enable and --with options.
  ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"

  ac_popdir=`pwd`
  for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue

    # Do not complain, so a configure script can configure whichever
    # parts of a large source tree are present.
    test -d "$srcdir/$ac_dir" || continue

    ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
    $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5
    $as_echo "$ac_msg" >&6
    as_dir="$ac_dir"; as_fn_mkdir_p
    ac_builddir=.

case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
  # A ".." for each directory in $ac_dir_suffix.
  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
  case $ac_top_builddir_sub in
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
  esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix

case $srcdir in
  .)  # We are building in place.
    ac_srcdir=.
    ac_top_srcdir=$ac_top_builddir_sub
    ac_abs_top_srcdir=$ac_pwd ;;
  [\\/]* | ?:[\\/]* )  # Absolute name.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir
    ac_abs_top_srcdir=$srcdir ;;
  *) # Relative name.
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_build_prefix$srcdir
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix


    cd "$ac_dir"

    # Check for guested configure; otherwise get Cygnus style configure.
    if test -f "$ac_srcdir/configure.gnu"; then
      ac_sub_configure=$ac_srcdir/configure.gnu
    elif test -f "$ac_srcdir/configure"; then
      ac_sub_configure=$ac_srcdir/configure
    elif test -f "$ac_srcdir/configure.in"; then
      # This should be Cygnus configure.
      ac_sub_configure=$ac_aux_dir/configure
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5
$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
      ac_sub_configure=
    fi

    # The recursion is here.
    if test -n "$ac_sub_configure"; then
      # Make the cache file name correct relative to the subdirectory.
      case $cache_file in
      [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
      *) # Relative name.
	ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
      esac

      { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
      # The eval makes quoting arguments work.
      eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
	   --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
	as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
    fi

    cd "$ac_popdir"
  done
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi

ntp-4.2.6p5/install-sh0000755000175000017500000002202110377564307013626 0ustar  peterpeter#!/bin/sh
# install - install a program, script, or datafile

scriptversion=2005-05-14.22

# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.  It can only install one file at a time, a restriction
# shared with many OS's install programs.

# set DOITPROG to echo to test this script

# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"

# put in absolute paths if you don't have them in your path; or use env. vars.

mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"

chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=

usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
   or: $0 [OPTION]... SRCFILES... DIRECTORY
   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
   or: $0 [OPTION]... -d DIRECTORIES...

In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.

Options:
-c         (ignored)
-d         create directories instead of installing files.
-g GROUP   $chgrpprog installed files to GROUP.
-m MODE    $chmodprog installed files to MODE.
-o USER    $chownprog installed files to USER.
-s         $stripprog installed files.
-t DIRECTORY  install into DIRECTORY.
-T         report an error if DSTFILE is a directory.
--help     display this help and exit.
--version  display version info and exit.

Environment variables override the default commands:
  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"

while test -n "$1"; do
  case $1 in
    -c) shift
        continue;;

    -d) dir_arg=true
        shift
        continue;;

    -g) chgrpcmd="$chgrpprog $2"
        shift
        shift
        continue;;

    --help) echo "$usage"; exit $?;;

    -m) chmodcmd="$chmodprog $2"
        shift
        shift
        continue;;

    -o) chowncmd="$chownprog $2"
        shift
        shift
        continue;;

    -s) stripcmd=$stripprog
        shift
        continue;;

    -t) dstarg=$2
	shift
	shift
	continue;;

    -T) no_target_directory=true
	shift
	continue;;

    --version) echo "$0 $scriptversion"; exit $?;;

    *)  # When -d is used, all remaining arguments are directories to create.
	# When -t is used, the destination is already specified.
	test -n "$dir_arg$dstarg" && break
        # Otherwise, the last argument is the destination.  Remove it from $@.
	for arg
	do
          if test -n "$dstarg"; then
	    # $@ is not empty: it contains at least $arg.
	    set fnord "$@" "$dstarg"
	    shift # fnord
	  fi
	  shift # arg
	  dstarg=$arg
	done
	break;;
  esac
done

if test -z "$1"; then
  if test -z "$dir_arg"; then
    echo "$0: no input file specified." >&2
    exit 1
  fi
  # It's OK to call `install-sh -d' without argument.
  # This can happen when creating conditional directories.
  exit 0
fi

for src
do
  # Protect names starting with `-'.
  case $src in
    -*) src=./$src ;;
  esac

  if test -n "$dir_arg"; then
    dst=$src
    src=

    if test -d "$dst"; then
      mkdircmd=:
      chmodcmd=
    else
      mkdircmd=$mkdirprog
    fi
  else
    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
    # might cause directories to be created, which would be especially bad
    # if $src (and thus $dsttmp) contains '*'.
    if test ! -f "$src" && test ! -d "$src"; then
      echo "$0: $src does not exist." >&2
      exit 1
    fi

    if test -z "$dstarg"; then
      echo "$0: no destination specified." >&2
      exit 1
    fi

    dst=$dstarg
    # Protect names starting with `-'.
    case $dst in
      -*) dst=./$dst ;;
    esac

    # If destination is a directory, append the input filename; won't work
    # if double slashes aren't ignored.
    if test -d "$dst"; then
      if test -n "$no_target_directory"; then
	echo "$0: $dstarg: Is a directory" >&2
	exit 1
      fi
      dst=$dst/`basename "$src"`
    fi
  fi

  # This sed command emulates the dirname command.
  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`

  # Make sure that the destination directory exists.

  # Skip lots of stat calls in the usual case.
  if test ! -d "$dstdir"; then
    defaultIFS='
	 '
    IFS="${IFS-$defaultIFS}"

    oIFS=$IFS
    # Some sh's can't handle IFS=/ for some reason.
    IFS='%'
    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
    shift
    IFS=$oIFS

    pathcomp=

    while test $# -ne 0 ; do
      pathcomp=$pathcomp$1
      shift
      if test ! -d "$pathcomp"; then
        $mkdirprog "$pathcomp"
	# mkdir can fail with a `File exist' error in case several
	# install-sh are creating the directory concurrently.  This
	# is OK.
	test -d "$pathcomp" || exit
      fi
      pathcomp=$pathcomp/
    done
  fi

  if test -n "$dir_arg"; then
    $doit $mkdircmd "$dst" \
      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }

  else
    dstfile=`basename "$dst"`

    # Make a couple of temp file names in the proper directory.
    dsttmp=$dstdir/_inst.$$_
    rmtmp=$dstdir/_rm.$$_

    # Trap to clean up those temp files at exit.
    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
    trap '(exit $?); exit' 1 2 13 15

    # Copy the file name to the temp name.
    $doit $cpprog "$src" "$dsttmp" &&

    # and set any options; do chmod last to preserve setuid bits.
    #
    # If any of these fail, we abort the whole thing.  If we want to
    # ignore errors from any of these, just make sure not to ignore
    # errors from the above "$doit $cpprog $src $dsttmp" command.
    #
    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&

    # Now rename the file to the real destination.
    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
      || {
	   # The rename failed, perhaps because mv can't rename something else
	   # to itself, or perhaps because mv is so ancient that it does not
	   # support -f.

	   # Now remove or move aside any old file at destination location.
	   # We try this two ways since rm can't unlink itself on some
	   # systems and the destination file might be busy for other
	   # reasons.  In this case, the final cleanup might fail but the new
	   # file should still install successfully.
	   {
	     if test -f "$dstdir/$dstfile"; then
	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
	       || {
		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
		 (exit 1); exit 1
	       }
	     else
	       :
	     fi
	   } &&

	   # Now rename the file to the real destination.
	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
	 }
    }
  fi || { (exit 1); exit 1; }
done

# The final little trick to "correctly" pass the exit status to the exit trap.
{
  (exit 0); exit 0
}

# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
ntp-4.2.6p5/ports/0000755000175000017500000000000010017034466012761 5ustar  peterpeterntp-4.2.6p5/ports/winnt/0000755000175000017500000000000011307651603014121 5ustar  peterpeterntp-4.2.6p5/ports/winnt/vs2003/0000755000175000017500000000000011675461367015074 5ustar  peterpeterntp-4.2.6p5/ports/winnt/vs2003/ntpdate.vcproj0000644000175000017500000001430211307651605017744 0ustar  peterpeter

	
		
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
		
		
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2003/Instsrv.vcproj0000644000175000017500000001153511307651604017761 0ustar  peterpeter

	
		
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
		
		
		
		
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2003/libntp.vcproj0000644000175000017500000015334011505336024017576 0ustar  peterpeter

	
		
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
		
		
			
				
					
				
				
					
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2003/ntpd.vcproj0000644000175000017500000015421711474355436017274 0ustar  peterpeter

	
		
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
		
		
			
			
		
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
				
			
			
				
			
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2003/ntp.sln0000644000175000017500000001005611307651604016400 0ustar  peterpeterMicrosoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "instsrv", "Instsrv.vcproj", "{E78B2865-843A-4EBA-9434-C8BE86647E12}"
	ProjectSection(ProjectDependencies) = postProject
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libntp", "libntp.vcproj", "{C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55}"
	ProjectSection(ProjectDependencies) = postProject
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpd", "ntpd.vcproj", "{2E4BB1C7-E8FE-48CF-904A-B105F1169626}"
	ProjectSection(ProjectDependencies) = postProject
		{C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55} = {C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55}
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpdate", "ntpdate.vcproj", "{647A3E3F-D70E-47C2-9392-830FFC84EF8A}"
	ProjectSection(ProjectDependencies) = postProject
		{C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55} = {C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55}
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpdc", "ntpdc.vcproj", "{1D7C732A-A1D6-43F5-978D-69CE390161C6}"
	ProjectSection(ProjectDependencies) = postProject
		{C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55} = {C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55}
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpkeygen", "ntpkeygen.vcproj", "{48A390CC-217F-4462-9A0B-53D791ACCEF6}"
	ProjectSection(ProjectDependencies) = postProject
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpq", "ntpq.vcproj", "{0B4DE997-6C90-481F-8A92-554A155D1314}"
	ProjectSection(ProjectDependencies) = postProject
		{C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55} = {C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55}
	EndProjectSection
EndProject
Global
	GlobalSection(SolutionConfiguration) = preSolution
		Debug = Debug
		Release = Release
	EndGlobalSection
	GlobalSection(ProjectConfiguration) = postSolution
		{E78B2865-843A-4EBA-9434-C8BE86647E12}.Debug.ActiveCfg = Debug|Win32
		{E78B2865-843A-4EBA-9434-C8BE86647E12}.Debug.Build.0 = Debug|Win32
		{E78B2865-843A-4EBA-9434-C8BE86647E12}.Release.ActiveCfg = Release|Win32
		{E78B2865-843A-4EBA-9434-C8BE86647E12}.Release.Build.0 = Release|Win32
		{C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55}.Debug.ActiveCfg = Debug|Win32
		{C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55}.Debug.Build.0 = Debug|Win32
		{C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55}.Release.ActiveCfg = Release|Win32
		{C0DB2E48-1AF2-40D0-8F8A-CC73C47FFE55}.Release.Build.0 = Release|Win32
		{2E4BB1C7-E8FE-48CF-904A-B105F1169626}.Debug.ActiveCfg = Debug|Win32
		{2E4BB1C7-E8FE-48CF-904A-B105F1169626}.Debug.Build.0 = Debug|Win32
		{2E4BB1C7-E8FE-48CF-904A-B105F1169626}.Release.ActiveCfg = Release|Win32
		{2E4BB1C7-E8FE-48CF-904A-B105F1169626}.Release.Build.0 = Release|Win32
		{647A3E3F-D70E-47C2-9392-830FFC84EF8A}.Debug.ActiveCfg = Debug|Win32
		{647A3E3F-D70E-47C2-9392-830FFC84EF8A}.Debug.Build.0 = Debug|Win32
		{647A3E3F-D70E-47C2-9392-830FFC84EF8A}.Release.ActiveCfg = Release|Win32
		{647A3E3F-D70E-47C2-9392-830FFC84EF8A}.Release.Build.0 = Release|Win32
		{1D7C732A-A1D6-43F5-978D-69CE390161C6}.Debug.ActiveCfg = Debug|Win32
		{1D7C732A-A1D6-43F5-978D-69CE390161C6}.Debug.Build.0 = Debug|Win32
		{1D7C732A-A1D6-43F5-978D-69CE390161C6}.Release.ActiveCfg = Release|Win32
		{1D7C732A-A1D6-43F5-978D-69CE390161C6}.Release.Build.0 = Release|Win32
		{48A390CC-217F-4462-9A0B-53D791ACCEF6}.Debug.ActiveCfg = Debug|Win32
		{48A390CC-217F-4462-9A0B-53D791ACCEF6}.Debug.Build.0 = Debug|Win32
		{48A390CC-217F-4462-9A0B-53D791ACCEF6}.Release.ActiveCfg = Release|Win32
		{48A390CC-217F-4462-9A0B-53D791ACCEF6}.Release.Build.0 = Release|Win32
		{0B4DE997-6C90-481F-8A92-554A155D1314}.Debug.ActiveCfg = Debug|Win32
		{0B4DE997-6C90-481F-8A92-554A155D1314}.Debug.Build.0 = Debug|Win32
		{0B4DE997-6C90-481F-8A92-554A155D1314}.Release.ActiveCfg = Release|Win32
		{0B4DE997-6C90-481F-8A92-554A155D1314}.Release.Build.0 = Release|Win32
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
	EndGlobalSection
	GlobalSection(ExtensibilityAddIns) = postSolution
	EndGlobalSection
EndGlobal
ntp-4.2.6p5/ports/winnt/vs2003/ntpkeygen.vcproj0000644000175000017500000002072211505336022020305 0ustar  peterpeter

	
		
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
		
		
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2003/ntpq.vcproj0000644000175000017500000001632611474355436017307 0ustar  peterpeter

	
		
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
		
		
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2003/ntpdc.vcproj0000644000175000017500000001651111474355436017431 0ustar  peterpeter

	
		
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
		
		
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/instsrv/0000755000175000017500000000000011675461367015647 5ustar  peterpeterntp-4.2.6p5/ports/winnt/instsrv/instsrv.c0000644000175000017500000003215110017034576017510 0ustar  peterpeter/*
 *  File: instsrv.c
 *  Purpose: To install a new service and to insert registry entries.
 *
 */
#ifndef __RPCASYNC_H__
#define __RPCASYNC_H__	/* Skip asynch rpc inclusion */
#endif

#include 
#include 

#define PERR(api) printf("\n%s: Error %d from %s on line %d",  \
    __FILE__, GetLastError(), api, __LINE__);

#define MSG_FOR_ACCESS_DENIED "You aren't authorized to do this - please see your system Administrator"
#define MSG_1_FOR_BAD_PATH "The fully qualified path name to the .exe must be given, and"
#define MSG_2_FOR_BAD_PATH "  the drive letter must be for a fixed disk (e.g., not a net drive)"

SC_HANDLE schService;
SC_HANDLE schSCManager;
int ok2;

VOID DisplayHelp(VOID);

/* --------------------------------------------------------------------------------------- */

int InstallService(LPCTSTR serviceName, LPCTSTR displayName, LPCTSTR serviceExe)
{
  LPCTSTR lpszBinaryPathName = serviceExe;
  TCHAR lpszRootPathName[] ="?:\\";

  if ( (':' != *(lpszBinaryPathName+1)) || ('\\' != *(lpszBinaryPathName+2)) )
  { printf("\n%s",MSG_1_FOR_BAD_PATH);
    printf("\n%s\n",MSG_2_FOR_BAD_PATH);
    return 1;
  }

  #define DRIVE_TYPE_INDETERMINATE 0
  #define ROOT_DIR_DOESNT_EXIST    1

  *lpszRootPathName = *(lpszBinaryPathName+0) ;

  switch (  GetDriveType(lpszRootPathName)  )
  {
    case DRIVE_FIXED :
    { // OK
      break;
    }
    case  ROOT_DIR_DOESNT_EXIST :
    { printf("\n%s",MSG_1_FOR_BAD_PATH);
      printf("\n  the root directory where the .exe is specified to be must exist, and");
      printf("\n%s\n",MSG_2_FOR_BAD_PATH);
      return 1;
    }
    case  DRIVE_TYPE_INDETERMINATE :
    case  DRIVE_REMOVABLE          :
    case  DRIVE_REMOTE             :
    case  DRIVE_CDROM              :
    case  DRIVE_RAMDISK            :
    { printf("\n%s",MSG_1_FOR_BAD_PATH);
      printf("\n%s\n",MSG_2_FOR_BAD_PATH);
      return 1;
    }
    default :
    { printf("\n%s",MSG_1_FOR_BAD_PATH);
      printf("\n%s\n",MSG_2_FOR_BAD_PATH);
      return 1;
    }
  }

  if (INVALID_HANDLE_VALUE == CreateFile(lpszBinaryPathName,
                                         GENERIC_READ,
                                         FILE_SHARE_READ,
                                         NULL,
                                         OPEN_EXISTING,
                                         FILE_ATTRIBUTE_NORMAL,
                                         NULL))
  { 
    printf("\n%s",MSG_1_FOR_BAD_PATH);
    printf("\n  the file must exist, and");
    printf("\n%s\n",MSG_2_FOR_BAD_PATH);
    return 1;
  }

  schService = CreateService(
        schSCManager,               // SCManager database
        serviceName,                // name of service
        displayName,                // name to display
        SERVICE_ALL_ACCESS,         // desired access
        SERVICE_WIN32_OWN_PROCESS,  // service type
        SERVICE_AUTO_START,         // start type
        SERVICE_ERROR_NORMAL,       // error control type
        lpszBinaryPathName,         // service's binary
        NULL,                       // no load ordering group
        NULL,                       // no tag identifier
        NULL,                       // no dependencies
        NULL,                       // Local System account
        NULL);                      // null password

  if (NULL == schService)
  { switch (GetLastError())
    {
      case ERROR_ACCESS_DENIED :
      { printf("\n%s",MSG_FOR_ACCESS_DENIED);
        break;
      }
      case ERROR_SERVICE_EXISTS :
      { printf("\nThe %s service is already installed",serviceName);
        printf("\nRemove it first if you need to re-install a new version\n");
        break;
      }
      default :
      { PERR("CreateService");
      }
    }
    return 1;
  }
  else

  CloseServiceHandle(schService);
  return 0;
}

/* --------------------------------------------------------------------------------------- */

int RemoveService(LPCTSTR serviceName)
{
  {
    #define                                     SZ_ENUM_BUF 4096
    ENUM_SERVICE_STATUS        essServiceStatus[SZ_ENUM_BUF];
    DWORD   dwBufSize = sizeof(essServiceStatus);
    DWORD   dwBytesNeeded      = 0;
    DWORD   dwServicesReturned = 0;
    DWORD   dwResumeHandle     = 0;
    DWORD   dwI                = 0;
    BOOLEAN bFound = FALSE;

    if (!EnumServicesStatus(schSCManager,
                            SERVICE_WIN32,
                            SERVICE_ACTIVE,
                            (LPENUM_SERVICE_STATUS)&essServiceStatus,
                            dwBufSize,
                            &dwBytesNeeded,
                            &dwServicesReturned,
                            &dwResumeHandle))
    { switch (GetLastError())
      {
        case ERROR_ACCESS_DENIED :
        { printf("\n%s",MSG_FOR_ACCESS_DENIED);
          break;
        }
        default :
        { PERR("EnumServicesStatus");
        }
      }
      return 1;
    }

    for (dwI=0; dwI 256)
    {
      printf("\nThe service name cannot be longer than 256 characters\n");
      return(1);
    }



  bRemovingService = (!stricmp(argv[1], "remove"));
  schSCManager = OpenSCManager(
                      NULL,                   // machine (NULL == local)
                      NULL,                   // database (NULL == default)
                      SC_MANAGER_ALL_ACCESS); // access required

  if (NULL == schSCManager)
  { switch (GetLastError())
    {
      case ERROR_ACCESS_DENIED :
      { printf("\n%s",MSG_FOR_ACCESS_DENIED);
        break;
      }
      default :
      { PERR("OpenSCManager");
      }
    }
    return (0);
  }
   
  if (bRemovingService)
  {
   ok = RemoveService(lpszServName);
  }
  else
  {
   /* get the exe name */
   strcpy(lpszExeName,argv[1]);
   ok = InstallService(lpszServName, lpszDispName, lpszExeName);
  }

  CloseServiceHandle(schSCManager);

  if (!bRemovingService)
    {
  if (ok == 0)
   { /* Set the Event-ID message-file name. */
    ok = addSourceToRegistry("NTP", lpszExeName);
    if (ok == 0)
      ok = addKeysToRegistry();
    else return ok;

    if (ok == 0)
    {
      printf("\nThe \"Network Time Protocol\" service was successfully created.\n");
      printf("\nDon't forget!!! You must now go to the Control Panel and");
      printf("\n  use the Services applet to change the account name and");
      printf("\n  password that the NTP Service will use when");
      printf("\n  it starts.");
      printf("\nTo do this: use the Startup button in the Services applet,");
      printf("\n  and (for example) specify the desired account and");
      printf("\n  correct password.");
      printf("\nAlso, use the Services applet to ensure this newly installed");
      printf("\n  service starts automatically on bootup.\n");
     return 0;
    }
   }
  else return ok;
  }
 return 0;
}

/* --------------------------------------------------------------------------------------- */

VOID DisplayHelp(VOID)
{
    printf("Installs or removes the NTP service.\n");
    printf("To install the NTP service,\n");
    printf("type INSTSRV  \n");
    printf("Where:\n");
    printf("    path    Absolute path to the NTP service, name.exe.  You must\n");
    printf("            use a fully qualified path and the drive letter must be for a\n");
    printf("            fixed, local drive.\n\n");
    printf("For example, INSTSRV i:\\winnt\\system32\\ntpd.exe\n");
    printf("To remove the NTP service,\n");
    printf("type INSTSRV remove \n");

}

/* EOF */
ntp-4.2.6p5/ports/winnt/scripts/0000755000175000017500000000000011675461367015626 5ustar  peterpeterntp-4.2.6p5/ports/winnt/scripts/mkver.bat0000755000175000017500000004065511314114377017441 0ustar  peterpeter@echo off
GOTO PROG

see notes/remarks directly below this header:
######################################################################
#
# Revision: mkver.bat
# Author:   Frederick Czajka
# Date:     02/10/2000
# Purpose:  Provide a NT Shell script to replace the perl script 
#           that replaced the UNIX mkver shell script.
#           
# 
#
# Notes:  I had two goals with this script one to only use native
#         NT Shell commands and two was too emulate the PERL style
#         output. This required some work for the DATE format as 
#         you will see and TIME was really tricky to get a format 
#         matching PERLs!
#
#
# Changes:
# 12/21/2009	Dave Hart
#				- packageinfo.sh uses prerelease= now not
#				  releasecandidate=
# 08/28/2009	Dave Hart	
#				- support for building using per-compiler subdirs of winnt
# 08/08/2006	Heiko Gerstung
#				- bugfixed point / rcpoint errors leading to a wrong
#				  version string 
#				- added a few cases for uppercase strings
# 03/09/2005	Heiko Gerstung
#				- added UTC offset to version time information
#				- bugfixed several issues preventing this script to be used on NT4 
#				- removed an obsolete warning
#
# 03/08/2005	Danny Mayer
#				- bugfixed NOBK label position
#
# 03/08/2005	Heiko Gerstung
#				- bugfixed BK detection and support for multiple ChangeSets 
#				
# 02/24/2005	Heiko Gerstung
#				- check if BK is installed and do not try to call it if not
#
#
# 02/03/2005	Heiko Gerstung
#				- now getting NTP version from version.m4 (not configure)
#				- added BK ChangeSet revision and Openssl-Indicator (-o) 
#				  to the version number
#				- major rework of the time and date recognition routines
#				  in order to reflect international settings and OS-
#				  dependand formats
#
######################################################################

Notes/Howtos:

If you spot an error stating that bk.exe could not be found or executed
although it is installed on your computer, you should try to add the path 
to your BK binary in your IDE configuration (for VisualStudio see 
Tools/Options/Directories/Executables).

Alternatively you can create a file called 'version' in the root path of 
your ntp source tree which holds a string that is added to the version number.


:PROG
IF {%1} == {} GOTO USAGE
IF {%1} == {-H} GOTO USAGE
IF {%2} == {} GOTO USAGE
IF {%1} == {-P} GOTO BEGIN



REM *****************************************************************************************************************
REM For any other bizarre permutation...
REM *****************************************************************************************************************
GOTO USAGE

:BEGIN

SET GENERATED_PROGRAM=%2

REM *****************************************************************************************************************
REM Reimplemented from orginal Unix Shell script
REM *****************************************************************************************************************
	IF NOT EXIST .version ECHO 0 > .version
	FOR /F %%i IN (.version) do @SET RUN=%%i
	SET /A RUN=%RUN%+1
	ECHO %RUN% > .version

REM *****************************************************************************************************************
REM Resetting variables
REM *****************************************************************************************************************
	SET VER=
	SET CSET=
	SET SSL=
	SET MYDATE=
	SET MYTIME=
	SET DAY=99
	SET NMM=99
	SET YEAR=0
	SET HOUR=
	SET MIN=
	SET MMIN=
	SET SEC=
	SET SUBSEC=
	SET DATEDELIM=
	SET TIMEDELIM=
	SET DATEFORMAT=
	SET TIMEFORMAT=
	SET UTC=
	SET ACTIVEBIAS=

REM *****************************************************************************************************************
REM Check if DATE and TIME environment variables are available
REM *****************************************************************************************************************

	SET MYDATE=%DATE%
	SET MYTIME=%TIME%

	REM ** Not available (huh? Are you older than NT4SP6A, grandpa?)
	IF "%MYDATE%" == "" FOR /F "TOKENS=1 DELIMS=" %%a IN ('date/t') DO SET MYDATE=%%a
	IF "%MYTIME%" == "" FOR /F "TOKENS=1 DELIMS=" %%a IN ('time/t') DO SET MYTIME=%%a

REM *****************************************************************************************************************
REM Try to find out UTC offset 
REM *****************************************************************************************************************

	REM *** Start with setting a dummy value which is used when we are not able to find out the real UTC offset
	SET UTC=(LOCAL TIME)
	SET UTC_HR=
	SET UTC_MIN=
	SET UTC_SIGN=
	
	REM *** Now get the timezone settings from the registry
	regedit /e %TEMP%\TZ-%GENERATED_PROGRAM%.TMP "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation"
	IF NOT EXIST %TEMP%\TZ-%GENERATED_PROGRAM%.TMP GOTO NOTZINFO

	for /f "Tokens=1* Delims==" %%a in ('type %TEMP%\TZ-%GENERATED_PROGRAM%.TMP') do if %%a == "ActiveTimeBias" SET ACTIVEBIAS=%%b
	for /f "Tokens=1* Delims=:" %%a in ('echo %ACTIVEBIAS%') do ( SET ACTIVEBIAS=%%b & SET PARTYP=%%a )
	
	REM *** Clean up temporary file
	IF EXIST %TEMP%\TZ-%GENERATED_PROGRAM%.TMP DEL %TEMP%\TZ-%GENERATED_PROGRAM%.TMP
	
	REM *** Check if we really got a dword value from the registry ...
	IF NOT "%PARTYP%"=="dword " goto NOTZINFO

	REM *** Check if we are in UTC timezone, then we can avoid some stress...
	if "%ACTIVEBIAS%" == "00000000" SET UTC=(UTC) & GOTO NOTZINFO
	
	SET HI=0x%ACTIVEBIAS:~0,4%
	SET LO=0x%ACTIVEBIAS:~4,4%
	
	if "%HI%"=="0xffff" ( SET /A ACTIVEBIAS=%LO% - %HI% - 1 ) ELSE ( SET /A ACTIVEBIAS=%LO%)
	SET /A UTC_HR="%ACTIVEBIAS%/60"
	SET /A UTC_MIN="%ACTIVEBIAS% %% 60"
	SET UTC_SIGN=%ACTIVEBIAS:~0,1%

	REM *** check the direction in which the local timezone alters UTC time
	IF NOT "%UTC_SIGN%"=="-" SET UTC_SIGN=+
	IF "%UTC_SIGN%"=="-" SET UTC_HR=%UTC_HR:~1,2%

	REM *** Now turn the direction, because we need to know it from the viewpoint of UTC
	IF "%UTC_SIGN%"=="+" (SET UTC_SIGN=-) ELSE (SET UTC_SIGN=+)

	REM *** Put the values in a "00" format
	IF %UTC_HR% LEQ 9 SET UTC_HR=0%UTC_HR%
	IF %UTC_MIN% LEQ 9 SET UTC_MIN=0%UTC_MIN%
			
	REM *** Set up UTC offset string used in version string
	SET UTC=(UTC%UTC_SIGN%%UTC_HR%:%UTC_MIN%)
	
	
:NOTZINFO
echo off

REM *****************************************************************************************************************
REM Now grab the Version number out of the source code (using the packageinfo.sh file...)
REM *****************************************************************************************************************

	REM First, get the main NTP version number. In recent versions this must be extracted 
	REM from a packageinfo.sh file while in earlier versions the info was available from 
	REM a version.m4 file.
	SET F_PACKAGEINFO_SH=..\..\..\..\packageinfo.sh
	IF EXIST %F_PACKAGEINFO_SH% goto VER_FROM_PACKAGE_INFO
	REM next two lines can go away when all windows compilers are building under
	rem ports\winnt\\ (ports\winnt\vs2008\ntpd)
	rem rather than ports\winnt\ (ports\winnt\ntpd)
	SET F_PACKAGEINFO_SH=..\..\..\packageinfo.sh
	IF EXIST %F_PACKAGEINFO_SH% goto VER_FROM_PACKAGE_INFO
        goto ERRNOVERF

:VER_FROM_PACKAGE_INFO
	REM Get version from packageinfo.sh file, which contains lines reading e.g.
	
	TYPE %F_PACKAGEINFO_SH% | FIND /V "rcpoint=" | FIND /V "betapoint=" | FIND "point=" > point.txt
	SET F_POINT_SH=point.txt
	
	FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr  "proto=" %%F_PACKAGEINFO_SH%%') DO SET PROTO=%%a
	FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr  "major=" %%F_PACKAGEINFO_SH%%') DO SET MAJOR=%%a
	FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr  "minor=" %%F_PACKAGEINFO_SH%%') DO SET MINOR=%%a

	FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr  "point=" %%F_POINT_SH%%') DO SET POINT=%%a
	IF "%POINT%"=="NEW" set POINT=
	IF NOT "%POINT%"=="" set POINT=p%POINT%

	FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr  "betapoint=" %%F_PACKAGEINFO_SH%%') DO SET BETAPOINT=%%a
	
	FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr  "rcpoint=" %%F_PACKAGEINFO_SH%%') DO SET RCPOINT=%%a

	FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr  "special=" %%F_PACKAGEINFO_SH%%') DO SET SPECIAL=%%a
	IF NOT "%SPECIAL%"=="" set SPECIAL=-%SPECIAL%

	FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr  "prerelease=" %%F_PACKAGEINFO_SH%%') DO SET PRERELEASE=%%a
	IF /I "%PRERELEASE%"=="beta" set PR_SUF=-beta
	IF /I "%PRERELEASE%"=="rc" set PR_SUF=-RC

	FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr  "repotype=" %%F_PACKAGEINFO_SH%%') DO SET REPOTYPE=%%a
	IF /I "%REPOTYPE%"=="stable" set REPOTYPE=STABLE
	
	IF NOT "%REPOTYPE%"=="STABLE" SET RCPOINT=
	IF "%PR_SUF%"=="-RC" set PR_POINT=%RCPOINT%
	IF "%PR_SUF%"=="-beta" set PR_POINT=%BETAPOINT%

	SET VER=%PROTO%.%MAJOR%.%MINOR%%POINT%%SPECIAL%%PR_SUF%%PR_POINT%
	
	REM Now we have the version info, try to add a BK ChangeSet version number
	
	REM ** Check if BK is installed ...
	bk -R prs -hr+ -nd:I: ChangeSet 2> NUL > NUL
	IF ERRORLEVEL 1 GOTO NOBK

	REM ** Try to get the CSet rev directly from BK
	FOR /F "TOKENS=1 DELIMS==" %%a IN ('bk.exe -R prs -hr+ -nd:I: ChangeSet') DO @SET CSET=%%a

:NOBK
	REM ** If that was not successful, we'll take a look into a version file, if available
	IF EXIST ..\..\..\..\version ( 
		IF "%CSET%"=="" FOR /F "TOKENS=1" %%a IN ('type ..\..\..\..\version') DO @SET CSET=%%a
	)
	REM next if block can go away once all windows compilers are building in
	REM ports\winnt\\ (ports\winnt\vs2008\ntpd)
	IF EXIST ..\..\..\version ( 
		IF "%CSET%"=="" FOR /F "TOKENS=1" %%a IN ('type ..\..\..\version') DO @SET CSET=%%a
	)

	REM ** Now, expand our version number with the CSet revision, if we managed to get one
	IF NOT "%CSET%"=="" SET VER=%VER%@%CSET%
		
	REM We can add a "crypto" identifier (-o) if we see that Crypto support is included in our build
	REM we always include openssl on windows...
	SET VER=%VER%-o


REM *****************************************************************************************************************
REM Check for user settings regarding the time and date format, we use the registry to find out...
REM *****************************************************************************************************************


	REM Any temporary files left from a previous run? Go where you belong...
	IF exist userset.reg del userset.reg
	IF exist userset.txt del userset.txt
	
	regedit /E userset.reg "HKEY_CURRENT_USER\Control Panel\International"
	IF not exist userset.reg goto ERRNOREG

	rem *** convert from unicode to ascii if necessary
	type userset.reg > userset.txt


	FOR /F "TOKENS=1-9 DELIMS== " %%a IN ('findstr "iDate" userset.txt') DO SET DATEFORMAT=%%b
	FOR /F "TOKENS=1-9 DELIMS== " %%a IN ('findstr "iTime" userset.txt') DO SET TIMEFORMAT=%%b

	FOR /F "TOKENS=1-9 DELIMS== " %%a IN ('findstr /R "sDate\>" userset.txt') DO SET DATEDELIM=%%b
	FOR /F "TOKENS=1-9 DELIMS== " %%a IN ('findstr /R "sTime\>" userset.txt') DO SET TIMEDELIM=%%b
	
	IF "%TIMEFORMAT%"=="" GOTO ERRNOTIME
	IF "%DATEFORMAT%"=="" GOTO ERRNODATE
	IF "%TIMEDELIM%"=="" GOTO ERRNOTIME
	IF "%DATEDELIM%"=="" GOTO ERRNODATE

	SET TIMEDELIM=%TIMEDELIM:~1,1%
	SET DATEDELIM=%DATEDELIM:~1,1%
	SET TIMEFORMAT=%TIMEFORMAT:~1,1%
	SET DATEFORMAT=%DATEFORMAT:~1,1%
	
REM *****************************************************************************************************************
REM Well, well. Its time to look at the time and format it in a standard way (if possible)
REM *****************************************************************************************************************


	FOR /F "TOKENS=1-4 DELIMS=%TIMEDELIM% " %%a IN ('echo %MYTIME%') DO SET AA=%%a&SET BB=%%b&SET CC=%%c&SET DD=%%d

	REM 12H Format
	IF "%TIMEFORMAT%" == "0" (
		SET HOUR=%AA%
		SET MIN=%BB%
		FOR /F "USEBACKQ TOKENS=1 DELIMS=ap" %%a IN ('%BB%') DO SET MMIN=%%a
		SET SEC=%CC%
		SET SUBSEC=%DD%
	)

	REM Get rid of the "a" or "p" if we have one of these in our minute string
	IF NOT "%MMIN%"=="%MIN%" FOR /F "USEBACKQ TOKENS=1 DELIMS=ap " %%a IN ('%MIN%') DO SET MIN=%%a

	REM 24H Format
	IF "%TIMEFORMAT%" == "1" (
		SET HOUR=%AA%
		SET MIN=%BB%
		SET SEC=%CC%
		SET SUBSEC=%DD%
	)

	IF "%HOUR%"=="" GOTO ERRNOTIME
	IF "%MIN%"=="" GOTO ERRNOTIME
	
	IF "%SEC%"=="" SET SEC=00
	IF "%SUBSEC%"=="" SET SUBSEC=00


REM *****************************************************************************************************************
REM It's time to format the date :-)
REM *****************************************************************************************************************


	FOR /F "TOKENS=1-4 DELIMS=./- " %%a IN ('ECHO %MYDATE%') DO SET AA=%%a&SET BB=%%b&SET CC=%%c&SET DD=%%d

	IF "%DD%" == "" (
		REM No Day of Week in Date
		( IF "%DATEFORMAT%" == "0" SET DOW=_&SET DAY=%BB%&SET NMM=%AA%&SET YEAR=%CC% )
		( IF "%DATEFORMAT%" == "1" SET DOW=_&SET DAY=%AA%&SET NMM=%BB%&SET YEAR=%CC% )
		( IF "%DATEFORMAT%" == "2" SET DOW=_&SET DAY=%CC%&SET NMM=%BB%&SET YEAR=%AA% )
	) ELSE (
		( IF "%DATEFORMAT%" == "0" SET DOW=%AA%&SET DAY=%CC%&SET NMM=%BB%&SET YEAR=%DD% )
		( IF "%DATEFORMAT%" == "1" SET DOW=%AA%&SET DAY=%BB%&SET NMM=%CC%&SET YEAR=%DD% )
		( IF "%DATEFORMAT%" == "2" SET DOW=%AA%&SET DAY=%DD%&SET NMM=%CC%&SET YEAR=%BB% )
	)
	
	REM Something went wrong, we weren't able to get a valid date
	IF NOT "%YEAR%" == "0" GOTO DATEOK
	goto ERRNODATE

:DATEOK

	REM Clean up any temporary files we may have created...
	REM IF exist userset.reg del userset.reg
	REM IF exist userset.txt del userset.txt

	IF "%NMM%" == "01" SET MONTH=Jan
	IF "%NMM%" == "02" SET MONTH=Feb
	IF "%NMM%" == "03" SET MONTH=Mar
	IF "%NMM%" == "04" SET MONTH=Apr
	IF "%NMM%" == "05" SET MONTH=May
	IF "%NMM%" == "06" SET MONTH=Jun
	IF "%NMM%" == "07" SET MONTH=Jul
	IF "%NMM%" == "08" SET MONTH=Aug
	IF "%NMM%" == "09" SET MONTH=Sep
	IF "%NMM%" == "10" SET MONTH=Oct
	IF "%NMM%" == "11" SET MONTH=Nov
	IF "%NMM%" == "12" SET MONTH=Dec

	IF NOT {%MONTH%} == {} GOTO DATE_OK

	REM *** Not US date format! Assume ISO: yyyy-mm-dd

	FOR /F "TOKENS=1-4 DELIMS=/- " %%a IN ('date/t') DO SET DAY=%%a&SET yyyy=%%b&SET nmm=%%c&SET dd=%%d

	echo a=%%a b=%%b c=%%c d=%%d
	IF "%NMM%" == "01" SET MONTH=Jan
	IF "%NMM%" == "02" SET MONTH=Feb
	IF "%NMM%" == "03" SET MONTH=Mar
	IF "%NMM%" == "04" SET MONTH=Apr
	IF "%NMM%" == "05" SET MONTH=May
	IF "%NMM%" == "06" SET MONTH=Jun
	IF "%NMM%" == "07" SET MONTH=Jul
	IF "%NMM%" == "08" SET MONTH=Aug
	IF "%NMM%" == "09" SET MONTH=Sep
	IF "%NMM%" == "10" SET MONTH=Oct
	IF "%NMM%" == "11" SET MONTH=Nov
	IF "%NMM%" == "12" SET MONTH=Dec

:DATE_OK
	IF "%SS" == "" SET SS="00"


REM *****************************************************************************************************************
REM Now create a valid version.c file ...
REM *****************************************************************************************************************

	ECHO Version %VER% Build %RUN% date %MONTH%/%DAY%/%YEAR% time %HOUR%:%MIN%:%SEC% %UTC%
	ECHO char * Version = "%GENERATED_PROGRAM% %VER% %MONTH% %DAY% %HOUR%:%MIN%:%SEC% %UTC% %YEAR% (%RUN%)" ; > version.c
	GOTO EOF


REM *****************************************************************************************************************
REM Here are the error messages I know
REM *****************************************************************************************************************
:ERRNOREG
   ECHO "Error: Registry could not be read (check if regedit.exe is available and works as expected)"
   GOTO EOF


:ERRNODATE
    ECHO "Error: Dateformat unknown (check if contents of userset.txt are correctly, especially for iDate and sDate)"
	GOTO EOF

:ERRNOTIME
    ECHO "Error: Timeformat unknown (check if contents of userset.txt are correctly, especially for iTime and sTime)"
	GOTO EOF

:ERRNOVERF
    ECHO "Error: Version file not found (searching for ..\..\..\..\packageinfo.sh)"
	GOTO EOF


REM *****************************************************************************************************************
REM Show'em how to run (me)
REM *****************************************************************************************************************
:USAGE

   ECHO Usage: mkver.bat [ -P  -H ]
   ECHO   -P          Database Name
   ECHO   -H          Help on options

REM *****************************************************************************************************************
REM All good things come to an end someday. Time to leave
REM *****************************************************************************************************************
:EOF

REM *** Cleaning up 
IF EXIST point.txt DEL point.txt
IF EXIST userset.txt DEL userset.txt
IF EXIST userset.reg DEL userset.reg
ntp-4.2.6p5/ports/winnt/include/0000755000175000017500000000000011710605402015536 5ustar  peterpeterntp-4.2.6p5/ports/winnt/include/syslog.h0000644000175000017500000000443711307651604017246 0ustar  peterpeter/*
 * Copyright (C) 2001  Internet Software Consortium.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/* From BIND 9 lib/isc/include/isc/: syslog.h,v 1.4 2002/08/01 03:43:31 mayer */

#ifndef _SYSLOG_H
#define _SYSLOG_H

#include 

/* Constant definitions for openlog() */
#define LOG_PID		1
#define LOG_CONS	2
/* NT event log does not support facility level */
#define LOG_KERN	0
#define LOG_USER	0
#define LOG_MAIL	0
#define LOG_DAEMON	0
#define LOG_AUTH	0
#define LOG_SYSLOG	0
#define LOG_LPR		0
#define LOG_LOCAL0	0
#define LOG_LOCAL1	0
#define LOG_LOCAL2	0
#define LOG_LOCAL3	0
#define LOG_LOCAL4	0
#define LOG_LOCAL5	0
#define LOG_LOCAL6	0
#define LOG_LOCAL7	0

#define LOG_EMERG       0       /* system is unusable */
#define LOG_ALERT       1       /* action must be taken immediately */
#define LOG_CRIT        2       /* critical conditions */
#define LOG_ERR         3       /* error conditions */
#define LOG_WARNING     4       /* warning conditions */
#define LOG_NOTICE      5       /* normal but signification condition */
#define LOG_INFO        6       /* informational */
#define LOG_DEBUG       7       /* debug-level messages */

/*
 * These are ignored on NT
 */
#define LOG_NDELAY	0	/* Open the connection to syslogd immediately */

#define LOG_UPTO(pri)   ((1 << ((pri)+1)) - 1)  /* all priorities through pri */

void
syslog(int level, const char *fmt, ...);

void
openlog(const char *, int, ...);

void
closelog(void);

void
ModifyLogLevel(int level);

int
setlogmask(int maskpri);

void
InitNTLogging(FILE *, int);

void
NTReportError(const char *, const char *);

#endif
ntp-4.2.6p5/ports/winnt/include/arpa/0000755000175000017500000000000011675461367016505 5ustar  peterpeterntp-4.2.6p5/ports/winnt/include/arpa/inet.h0000644000175000017500000000031710017034575017600 0ustar  peterpeter/**************************************************************
 * Dummy Header for Unix to Windows NT portability
 * Created for NTP package
 **************************************************************/
ntp-4.2.6p5/ports/winnt/include/win32_io.h0000644000175000017500000001043511307651604017352 0ustar  peterpeter#ifndef WIN32_IO_H
#define WIN32_IO_H

/*  Flag definitions for compatibility
 *  ==================================
*/

#include 

#define NCCS	18	/* refclock_arc.c uses VTIME (17) */
#define VEOL	3
typedef unsigned char	cc_t;
typedef unsigned int	speed_t;
typedef unsigned int	tcflag_t;

struct termios
{
	tcflag_t	c_iflag;	/* input mode flags */
	tcflag_t	c_oflag;	/* output mode flags */
	tcflag_t	c_cflag;	/* control mode flags */
	tcflag_t	c_lflag;	/* local mode flags */
	cc_t		c_line;		/* line discipline */
	cc_t		c_cc[NCCS];	/* control characters */ 
	speed_t		c_ispeed;	/* input speed */
	speed_t		c_ospeed;	/* output speed */
};

/* c_cc characters 
#define VINTR 0
#define VQUIT 1
#define VERASE 2
#define VKILL 3
#define VEOF 4
#define VTIME 5
#define VMIN 6
#define VSWTC 7
#define VSTART 8
#define VSTOP 9
#define VSUSP 10
#define VEOL 11
#define VREPRINT 12
#define VDISCARD 13
#define VWERASE 14
#define VLNEXT 15
#define VEOL2 16
*/

/* c_iflag bits */
#define IGNBRK	0000001
#define BRKINT	0000002
#define IGNPAR	0000004
#define PARMRK	0000010
#define INPCK	0000020
#define ISTRIP	0000040
#define INLCR	0000100
#define IGNCR	0000200
#define ICRNL	0000400
#define IUCLC	0001000
#define IXON	0002000
#define IXANY	0004000
#define IXOFF	0010000
#define IMAXBEL	0020000

/* c_oflag bits */
#define OPOST	0000001
#define OLCUC	0000002
#define ONLCR	0000004
#define OCRNL	0000010
#define ONOCR	0000020
#define ONLRET	0000040
#define OFILL	0000100
#define OFDEL	0000200

#define NLDLY	0000400
#define NL0	0000000
#define NL1	0000400

#define CRDLY	0003000
#define CR0	0000000
#define CR1	0001000
#define CR2	0002000
#define CR3	0003000

#define TABDLY	0014000
#define TAB0	0000000
#define TAB1	0004000
#define TAB2	0010000
#define TAB3	0014000
#define XTABS	0014000

#define BSDLY	0020000
#define BS0	0000000
#define BS1	0020000

#define VTDLY	0040000
#define VT0	0000000
#define VT1	0040000

#define FFDLY	0100000
#define FF0	0000000
#define FF1	0100000

/* c_cflag bit meaning */
#define CBAUD	0010017
#define B0	0000000		/* hang up */
#define B50	0000001
#define B75	0000002
#define B110	0000003
#define B134	0000004
#define B150	0000005
#define B200	0000006
#define B300	0000007
#define B600	0000010
#define B1200	0000011
#define B1800	0000012
#define B2400	0000013
#define B4800	0000014
#define B9600	0000015
#define B19200	0000016
#define B38400	0000017

#define EXTA	B19200
#define EXTB	B38400

#define CSIZE	0000060
#define CS5	0000000
#define CS6	0000020
#define CS7	0000040
#define CS8	0000060

#define CSTOPB	0000100
#define CREAD	0000200
#define PARENB	0000400
#define PARODD	0001000
#define HUPCL	0002000
#define CLOCAL	0004000

#define CBAUDEX 0010000
#define B57600  0010001
#define B115200 0010002
#define B230400 0010003
#define B460800 0010004

#define CIBAUD	002003600000	/* input baud rate (not used) */
#define CRTSCTS	020000000000	/* flow control */

/* c_lflag bits */
#define ISIG	0000001
#define ICANON	0000002
#define XCASE	0000004
#define ECHO	0000010
#define ECHOE	0000020
#define ECHOK	0000040
#define ECHONL	0000100
#define NOFLSH	0000200
#define TOSTOP	0000400
#define ECHOCTL	0001000
#define ECHOPRT	0002000
#define ECHOKE	0004000
#define FLUSHO	0010000
#define PENDIN	0040000
#define IEXTEN	0100000

/* tcflow() and TCXONC use these */
#define	TCOOFF		0
#define	TCOON		1
#define	TCIOFF		2
#define	TCION		3

/* tcflush() and TCFLSH use these */
#define	TCIFLUSH	0
#define	TCOFLUSH	1
#define	TCIOFLUSH	2

/* tcsetattr uses these */
#define	TCSANOW		0
#define	TCSADRAIN	1
#define	TCSAFLUSH	2
#define	VMIN		16
#define VTIME		17

/* modem lines */
#define TIOCM_LE	0x001
#define TIOCM_DTR	0x002
#define TIOCM_RTS	0x004
#define TIOCM_ST	0x008
#define TIOCM_SR	0x010
#define TIOCM_CTS	0x020
#define TIOCM_CAR	0x040
#define TIOCM_RNG	0x080
#define TIOCM_DSR	0x100
#define TIOCM_CD	TIOCM_CAR
#define TIOCM_RI	TIOCM_RNG
#define TIOCM_OUT1	0x2000
#define TIOCM_OUT2	0x4000

/* ioctl */
#define TIOCMGET	0x5415
#define TIOCMSET	0x5418

/* NOP cfsetospeed() and cfsetispeed() for now */
#define cfsetospeed(dcb, spd)	(0)
#define cfsetispeed(dcb, spd)	(0)



#if 0
extern	BOOL	TTY_GETATTR (int fd, DCB *tio);
extern	BOOL	TTY_SETATTR (int fd, const DCB *tio);
#endif

extern	int	ioctl		(int, int, int *);
extern	int	tcsetattr	(int, int, const struct termios *);
extern	int	tcgetattr	(int, struct termios *);

#endif /* defined WIN32_IO_H */
ntp-4.2.6p5/ports/winnt/include/clockstuff.h0000644000175000017500000000243711307651603020066 0ustar  peterpeter#ifndef _CLOCKSTUFF_H
#define _CLOCKSTUFF_H

#include 
#include 

#include "ntp_fp.h"
#include "ntp_syslog.h"


void init_winnt_time(void);
void reset_winnt_time(void);
void lock_thread_to_processor(HANDLE);

/* 100ns intervals between 1/1/1601 and 1/1/1970 as reported by
 * SystemTimeToFileTime()
 */

#define FILETIME_1970     0x019db1ded53e8000
#define HECTONANOSECONDS  10000000

/*
 * Multimedia Timer
 */

void set_mm_timer(int);

enum {
	MM_TIMER_LORES,
	MM_TIMER_HIRES
};

/*
 * Optional callback from libntp ntp_set_tod() to Windows ntpd code
 * in nt_clockstuff that needs to know.  Optional because other
 * libntp clients like ntpdate don't use it.
 */

typedef void (*time_stepped_callback)(void);
extern time_stepped_callback	step_callback;

/*
 * get_sys_time_as_filetime is a function pointer to
 * either GetSystemTimeAsFileTime provided by Windows
 * or ntpd's interpolating replacement.
 */

typedef void (WINAPI *PGSTAFT)(LPFILETIME pft);
extern PGSTAFT get_sys_time_as_filetime;

void lock_thread_to_processor(HANDLE);

#ifdef HAVE_PPSAPI
/*
 * ntp_timestamp_from_counter provides an interface for 
 * serialpps.sys counterstamps to be converted to 
 * interpolated timestamps.
 */

extern void ntp_timestamp_from_counter(l_fp *, ULONGLONG, ULONGLONG);
#endif

#endif
ntp-4.2.6p5/ports/winnt/include/config.h0000644000175000017500000002766011567107101017172 0ustar  peterpeter/* config.h for Windows NT */

#ifndef CONFIG_H
#define CONFIG_H

/*
 * For newer compilers we may we want newer prototypes from Windows
 * so we target _WIN32_WINNT at WINXP, but we also want our binary to
 * run on NT 4, so newer functions are runtime linked and the linker
 * /version:0x0400 * switch is used to override the .exe file minimum
 * version. For older compilers we leave it at NT 4.0.
 */
#ifndef _WIN32_WINNT
#if _MSC_VER > 1400		/* At least VS 2005 */
#define _WIN32_WINNT 0x0501
#else				/* NT 4.0 */
#define _WIN32_WINNT 0x0400 
#endif
#endif


#define _CRT_SECURE_NO_DEPRECATE 1
/*
 * ANSI C compliance enabled
 */
#define __STDC__ 1

/*
 * Enable the debug build of MS C runtime to dump leaks
 * at exit time (currently only if run under a debugger).
 */
#if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include 
#include 
#include 
/* #define MALLOC_LINT */	/* defers free() */
# define EREALLOC_IMPL(ptr, newsz, filenm, loc) \
	 _realloc_dbg(ptr, newsz, _NORMAL_BLOCK, filenm, loc)
#endif

/*
 * We need to include stdio.h first before we #define snprintf
 * otherwise we can get errors during the build
 */
#include 

/* Prevent inclusion of winsock.h in windows.h */
#ifndef _WINSOCKAPI_
#define _WINSOCKAPI_  
#endif

#ifndef __RPCASYNC_H__
#define __RPCASYNC_H__
#endif

/*
 * VS.NET's version of wspiapi.h has a bug in it
 * where it assigns a value to a variable inside
 * an if statement. It should be comparing them.
 * We prevent inclusion since we are not using this
 * code so we don't have to see the warning messages
 */
#ifndef _WSPIAPI_H_
/* #define _WSPIAPI_H_ */ /* need these wrappers for ntpd.exe to load on w2k */
#endif

/*
 * On Unix struct sock_timeval is equivalent to struct timeval.
 * On Windows built with 64-bit time_t, sock_timeval.tv_sec is a long
 * as required by Windows' socket() interface timeout argument, while
 * timeval.tv_sec is time_t for the more common use as a UTC time 
 * within NTP.
 *
 * winsock.h unconditionally defines struct timeval with long tv_sec
 * instead of time_t tv_sec.  We redirect its declaration to struct 
 * sock_timeval instead of struct timeval with a #define.
 */
#define	timeval sock_timeval

/* Include Windows headers */
#include 
#include 
#include 

#undef timeval	/* see sock_timeval #define and comment above */

/*
 * Some definitions we are using are missing in the headers
 * shipping with VC6. However, if the SDK is installed then the 
 * SDK's headers may declare the missing types. This is at least 
 * the case in the Oct 2001 SDK. That SDK and all subsequent 
 * versions also define the symbol _W64, so we can use that one
 * to determine whether some types need to be defined, or not.
 */
#ifdef _W64
/* VC6 can include wspiapi.h only if the SDK is installed */
#include 
#endif

#undef interface
#include 
#include 		/* time_t for timeval decl */

/* ---------------------------------------------------------------------
 * Above this line are #include lines and the few #define lines
 * needed before including headers.
 */

struct timeval {
	time_t	tv_sec;
	long	tv_usec;
};

/*
 * On Unix open() works for tty (serial) devices just fine, while on
 * Windows refclock serial devices are opened using CreateFile, a lower
 * level than the CRT-provided descriptors, because the C runtime lacks
 * tty APIs.  For refclocks which wish to use open() as well as or 
 * instead of refclock_open(), tty_open() is equivalent to open() on
 * Unix and  implemented in the Windows port similarly to
 * refclock_open().
 */
extern int tty_open(char *, int, int);

/*
 * disable use of __declspec(dllexport) by libisc routines
 */
#define ISC_STATIC_WIN	1

/*
 * ntp_rfc2553.h has cruft under #ifdef SYS_WINNT which is
 * appropriate for older Microsoft IPv6 definitions, such
 * as in_addr6 being the struct type.  We can differentiate
 * the RFC2553-compliant newer headers because they have
 *   #define in_addr6 in6_addr
 * for backward compatibility.  With the newer headers,
 * we define ISC_PLATFORM_HAVEIPV6 and disable the cruft.
 */
#ifdef in_addr6
#define WANT_IPV6
#define ISC_PLATFORM_HAVEIPV6
#define ISC_PLATFORM_HAVESCOPEID
#define HAVE_STRUCT_SOCKADDR_STORAGE
#define ISC_PLATFORM_HAVEIN6PKTINFO
#endif	/* in_addr6 / RFC2553-compliant IPv6 headers */

#define NO_OPTION_NAME_WARNINGS

#if !defined( _W64 )
  /*
   * if ULONG_PTR needs to be defined then the build environment
   * is pure 32 bit Windows. Since ULONG_PTR and DWORD have 
   * the same size in 32 bit Windows we can safely define
   * a replacement.
   */
typedef DWORD ULONG_PTR;
/* VC6 doesn't know about socklen_t, except if the SDK is installed */
typedef int socklen_t;
#endif	/* _W64 */

#define ISC_PLATFORM_NEEDIN6ADDRANY
#define HAVE_SOCKADDR_IN6

/*
 * The type of the socklen_t defined for getnameinfo() and getaddrinfo()
 * is int for VS compilers on Windows but the type is already declared 
 */
#define GETSOCKNAME_SOCKLEN_TYPE socklen_t

/*
 * Older SDKs do not define SO_EXCLUSIVEADDRUSE in winsock2.h
 */
#ifndef SO_EXCLUSIVEADDRUSE
#define SO_EXCLUSIVEADDRUSE ((int)(~SO_REUSEADDR))
#endif

/*
 * Define this macro to control the behavior of connection
 * resets on UDP sockets.  See Microsoft KnowledgeBase Article Q263823
 * for details.
 * Based on that article, it is surprising that a much newer winsock2.h
 * does not define SIO_UDP_CONNRESET (the one that comes with VS 2008).
 * NOTE: This requires that Windows 2000 systems install Service Pack 2
 * or later.
 */
#ifndef SIO_UDP_CONNRESET 
#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12) 
#endif

#if defined _MSC_VER && _MSC_VER < 1400
/*
 * Use 32-bit time definitions for versions prior to VS 2005
 * VS 2005 defaults to 64-bit time
 */
# define SIZEOF_TIME_T 4
#else
# define SIZEOF_TIME_T 8
#endif


/*
 * An attempt to cut down the number of warnings generated during compilation.
 * All of these should be benign to disable.
 */

#pragma warning(disable: 4100) /* unreferenced formal parameter */
#pragma warning(disable: 4127) /* conditional expression is constant */
#pragma warning(disable: 4996) /* more secure replacement available */

/*
 * Windows NT Configuration Values
 */
#if defined _DEBUG /* Use VC standard macro definitions */
# define DEBUG 1
#endif

#define __windows__ 1
/* Define if you have the ANSI C header files.  */
#define STDC_HEADERS 1

#define OPEN_BCAST_SOCKET		1	/* for ntp_io.c */
#define TYPEOF_IP_MULTICAST_LOOP	BOOL
#define SETSOCKOPT_ARG_CAST		(const char *)
#define HAVE_RANDOM 
#define MAXHOSTNAMELEN			64
#define AUTOKEY
#define SAVECONFIG			1

/*
 * Multimedia timer enable
 */
#define USE_MM_TIMER

/* Enable OpenSSL */
#define OPENSSL 1

/*
 * Keywords and functions that Microsoft maps
 * to other names
 */
#define inline		__inline
#define vsnprintf	_vsnprintf
#define snprintf	_snprintf
#define stricmp		_stricmp
#define strcasecmp	_stricmp
#define isascii		__isascii
#define finite		_finite
#define random		rand
#define srandom		srand
#define fdopen		_fdopen
#define read		_read
#define open		_open
#ifndef close
#define close		_close
#endif
#define write		_write
#define strdup		_strdup
#define stat		_stat		/*struct stat from   */
#define fstat		_fstat
#define unlink		_unlink
/*
 * punt on fchmod on Windows
 */
#define fchmod(x,y)	{}
#define lseek		_lseek
#define pipe		_pipe
#define dup2		_dup2
/*
 * scale, unix sleep is seconds, Windows Sleep is msec
 */
#define sleep(x)	Sleep((unsigned)(x) * 1000)
#define fileno		_fileno
#define isatty		_isatty
#define mktemp		_mktemp
#define getpid		_getpid
#define timegm		_mkgmtime

typedef int pid_t;		/* PID is an int */
typedef int ssize_t;		/* ssize is an int */
typedef __int32 int32_t;	/* define a typedef for int32_t */
#define HAVE_INT32_T   1

/*
 * Map the stream to the file number
 */
#define STDOUT_FILENO	_fileno(stdout)
#define STDERR_FILENO	_fileno(stderr)

/*
 * To minimize Windows-specific changes to the rest of the NTP code,
 * particularly reference clocks, ntp_stdlib.h will
 *
 * #define strerror(e) ntp_strerror(e)
 *
 * to deal with our mixture of C runtime (open, write) and Windows
 * (sockets, serial ports) error codes.  This is an ugly hack because
 * both use the lowest values differently, but particularly for ntpd,
 * it's not a problem.
 */
#define NTP_REDEFINE_STRERROR

# define MCAST				/* Enable Multicast Support */
# define MULTICAST_NONEWSOCKET		/* Don't create a new socket for mcast address */

# define REFCLOCK			/* from ntpd.mak */

/* # define CLOCK_PARSE  */
# define CLOCK_ARBITER
# define CLOCK_ARCRON_MSF
# define OWN_PPS_NTP_TIMESTAMP_FROM_COUNTER	/* timepps.h */
# define HAVE_TIMEPPS_H
# define HAVE_PPSAPI
# define CLOCK_ATOM
# define CLOCK_CHRONOLOG
# define CLOCK_DUMBCLOCK
# define CLOCK_HOPF_SERIAL	/* device 38, hopf DCF77/GPS serial line receiver  */
# define CLOCK_HOPF_PCI		/* device 39, hopf DCF77/GPS PCI-Bus receiver  */
# define CLOCK_JUPITER
# define CLOCK_LOCAL
# define CLOCK_NMEA
# define CLOCK_ONCORE
# define CLOCK_PALISADE		/* from ntpd.mak */
/* # define CLOCK_SHM */
# define CLOCK_SPECTRACOM	/* refclock_wwvb.c */
# define CLOCK_TRIMBLEDC
# define CLOCK_TRIMTSIP 1
# define CLOCK_TRUETIME

# define NTP_LITTLE_ENDIAN		/* from libntp.mak */
# define NTP_POSIX_SOURCE

# define SYSLOG_FILE			/* from libntp.mak */
# define HAVE_GETCLOCK

# define SIZEOF_SIGNED_CHAR	1
# define SIZEOF_INT		4	/* for ntp_types.h */

# define QSORT_USES_VOID_P
# define HAVE_SETVBUF
# define HAVE_VSPRINTF
# define HAVE_SNPRINTF
# define HAVE_VSNPRINTF
# define HAVE_PROTOTYPES		/* from ntpq.mak */
# define HAVE_MEMMOVE
# define HAVE_TERMIOS_H
# define HAVE_ERRNO_H
# define HAVE_STDARG_H
# define HAVE_NO_NICE
# define HAVE_MKTIME
# define HAVE_TIMEGM		1	/* actually _mkgmtime */
# define HAVE_STRUCT_TIMESPEC
# define TIME_WITH_SYS_TIME
# define HAVE_IO_COMPLETION_PORT
# define ISC_PLATFORM_NEEDNTOP
# define ISC_PLATFORM_NEEDPTON
# define HAVE_VPRINTF

#define HAVE_LIMITS_H	1
#define HAVE_STRDUP	1
#define HAVE_STRCHR	1
#define HAVE_FCNTL_H	1
#define HAVE_SYS_RESOURCE_H
#define HAVE_BSD_NICE			/* emulate BSD setpriority() */

typedef char *caddr_t;

#ifdef _WCTYPE_T_DEFINED	/* see vc/include/crtdefs.h */
#define HAVE_WINT_T
#endif

#ifndef _INTPTR_T_DEFINED
typedef long intptr_t;
#define _INTPTR_T_DEFINED
#endif
#define HAVE_INTPTR_T

#ifndef _UINTPTR_T_DEFINED
typedef unsigned long uintptr_t;
#define _UINTPTR_T_DEFINED
#endif
#define HAVE_UINTPTR_T

#if !defined( _W64 )
  /*
   * if DWORD_PTR needs to be defined then the build environment
   * is pure 32 bit Windows. Since DWORD_PTR and DWORD have 
   * the same size in 32 bit Windows we can safely define
   * a replacement.
   */
  typedef DWORD DWORD_PTR;
#endif

#define NEED_S_CHAR_TYPEDEF

#define USE_PROTOTYPES 		/* for ntp_types.h */

/* Directory separator, usually / or \ */
#define	DIR_SEP	'\\'

#define	POSIX_SHELL	"/bin/sh"	/* libopts/makeshell.c */

#define ULONG_CONST(a) a ## UL

#define NOKMEM
#define RETSIGTYPE void

#ifndef STR_SYSTEM
#define STR_SYSTEM "Windows"
#endif

#ifndef STR_PROCESSOR

#define STRINGIZE(arg)	#arg

#ifdef _M_IX86
#ifndef _M_IX86_FP
#define STR_PROCESSOR "x86"
#else
#if !_M_IX86_FP 
#define STR_PROCESSOR "x86"
#else 
#if _M_IX86_FP > 2
#define STR_PROCESSOR "x86-FP-" STRINGIZE(_M_IX86_FP)
#else
#if _M_IX86_FP == 2
#define STR_PROCESSOR "x86-SSE2"
#else
#define STR_PROCESSOR "x86-SSE"
#endif /* _M_IX86 == 2 */
#endif /* _M_IX86_FP > 2 */
#endif /* !_M_IX86_FP */
#endif /* !defined(_M_IX86_FP) */
#endif /* !defined(_M_IX86) */

#ifdef _M_IA64
#define STR_PROCESSOR "Itanium"
#endif

#ifdef _M_X64
#define STR_PROCESSOR "x64"
#endif

#endif /* !defined(STR_PROCESSOR) */

#define  SIOCGIFFLAGS SIO_GET_INTERFACE_LIST /* used in ntp_io.c */
/*
 * Below this line are includes which must happen after the bulk of
 * config.h is processed.  If you need to add another #include to this
 * file the preferred location is near the top, above the similar
 * line of hyphens.
 * ---------------------------------------------------------------------
 */

/*
 * Include standard stat information
 */
#include 

#endif /* CONFIG_H */
ntp-4.2.6p5/ports/winnt/include/netdb.h0000644000175000017500000000031710017034574017011 0ustar  peterpeter/**************************************************************
 * Dummy Header for Unix to Windows NT portability
 * Created for NTP package
 **************************************************************/
ntp-4.2.6p5/ports/winnt/include/termios.h0000644000175000017500000000013310017034574017373 0ustar  peterpeter#ifndef _TERMIOS_H
#define _TERMIOS_H

#include "win32_io.h"
/* Dummy for Winnt */

#endif
ntp-4.2.6p5/ports/winnt/include/ntservice.h0000644000175000017500000000237511307651603017726 0ustar  peterpeter/*
 * Copyright (C) 1999-2001  Internet Software Consortium.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/* $Id: ntservice.h,v 1.2 2002/08/03 01:31:48 mayer Exp $ */

#ifndef NTSERVICE_H
#define NTSERVICE_H

#include 

#define NTP_DISPLAY_NAME "NetworkTimeProtocol"
#define NTP_SERVICE_NAME "ntpd"

void ntservice_init();
void UpdateSCM(DWORD);
void WINAPI ServiceControl(DWORD dwCtrlCode);
void ntservice_shutdown();
BOOL ntservice_isservice();
BOOL ntservice_systemisshuttingdown();
BOOL WINAPI OnConsoleEvent(DWORD dwCtrlType);

#endifntp-4.2.6p5/ports/winnt/include/unistd.h0000644000175000017500000000031710017034574017223 0ustar  peterpeter/**************************************************************
 * Dummy Header for Unix to Windows NT portability
 * Created for NTP package
 **************************************************************/
ntp-4.2.6p5/ports/winnt/include/ntp_timer.h0000644000175000017500000000024611307651603017720 0ustar  peterpeter#if !defined(__NTP_TIMER_H_)
#define __NTP_TIMER_H_

extern	void	timer_clr_stats(void);

#if defined(SYS_WINNT)
extern	HANDLE	get_timer_handle(void);
#endif



#endifntp-4.2.6p5/ports/winnt/include/timepps.h0000644000175000017500000004767511307651603017421 0ustar  peterpeter/***********************************************************************
 *								       *
 * Copyright (c) David L. Mills 1999-2009			       *
 *								       *
 * Permission to use, copy, modify, and distribute this software and   *
 * its documentation for any purpose and without fee is hereby	       *
 * granted, provided that the above copyright notice appears in all    *
 * copies and that both the copyright notice and this permission       *
 * notice appear in supporting documentation, and that the name        *
 * University of Delaware not be used in advertising or publicity      *
 * pertaining to distribution of the software without specific,        *
 * written prior permission. The University of Delaware makes no       *
 * representations about the suitability this software for any	       *
 * purpose. It is provided "as is" without express or implied          *
 * warranty.							       *
 *								       *
 ***********************************************************************
 *								       *
 * This header file complies with "Pulse-Per-Second API for UNIX-like  *
 * Operating Systems, Version 1.0", rfc2783. Credit is due Jeff Mogul  *
 * and Marc Brett, from whom much of this code was shamelessly stolen. *
 *								       *
 * This modified timepps.h can be used to provide a PPSAPI interface   *
 * to a machine running Windows with one or more backend provider DLLs *
 * implementing the provider interfaces defined herein.		       *
 *								       *
 * This Windows version was derived by Dave Hart		       *
 *  from Mills' timepps-Solaris.h	       *
 *								       *
 ***********************************************************************
 *								       *
 * Some of this include file					       *
 * Copyright (c) 1999 by Ulrich Windl,				       *
 *	based on code by Reg Clemens 		       *
 *		based on code by Poul-Henning Kamp    *
 *								       *
 ***********************************************************************
 *								       *
 * "THE BEER-WARE LICENSE" (Revision 42):			       *
 *  wrote this file.  As long as you retain this      *
 * notice you can do whatever you want with this stuff. If we meet some*
 * day, and you think this stuff is worth it, you can buy me a beer    *
 * in return.	Poul-Henning Kamp				       *
 *								       *
 **********************************************************************/

#ifndef TIMEPPS_H
#define TIMEPPS_H

#include "sys/time.h"	/* in ntp ref source declares struct timespec */

/*
 * The following definitions are architecture independent
 */

#define PPS_API_VERS_1		1		/* API version number */
#define PPS_JAN_1970		2208988800UL	/* 1970 - 1900 in seconds */
#define PPS_NANOSECOND		1000000000L	/* one nanosecond in decimal */
#define PPS_FRAC		4294967296.	/* 2^32 as a double */
#define PPS_HECTONANOSECONDS	10000000	/* 100ns units in a second */
#define PPS_FILETIME_1970	0x019db1ded53e8000 /* unix epoch to Windows */

#define PPS_NORMALIZE(x)	/* normalize timespec */ \
	do { \
		if ((x).tv_nsec >= PPS_NANOSECOND) { \
			(x).tv_nsec -= PPS_NANOSECOND; \
			(x).tv_sec++; \
		} else if ((x).tv_nsec < 0) { \
			(x).tv_nsec += PPS_NANOSECOND; \
			(x).tv_sec--; \
		} \
	} while (0)

#define PPS_TSPECTONTP(x)	/* convert timespec to ntp_fp */	\
	do {								\
		double d_frac;						\
									\
		d_frac = ((struct timespec)&(x))->tv_nsec		\
			 * PPS_FRAC / PPS_NANOSECOND;			\
		(x).integral = ((struct timespec)&(x))->tv_sec		\
				+ PPS_JAN_1970;				\
		(x).fractional = (unsigned int)d_frac;			\
		if (d_frac >= PPS_FRAC)					\
			(x).integral++;					\
	} while (0)

#define PPS_NTPTOTSPEC(x)	/* convert ntp_fp to timespec */	\
	do {								\
		double d_frac;						\
									\
		/* careful, doing in place and tv_sec may be 64bit */	\
		d_frac = (double)((ntp_fp_t *)&(x))->fractional		\
			* PPS_NANOSECOND / PPS_FRAC;			\
		(x).tv_sec = ((ntp_fp_t *)&(x))->integral		\
			     - (time_t)PPS_JAN_1970;			\
		(x).tv_nsec = (long)d_frac;				\
	} while (0) 


/*
 * Device/implementation parameters (mode)
 */

#define PPS_CAPTUREASSERT	0x01	/* capture assert events */
#define PPS_CAPTURECLEAR	0x02	/* capture clear events */
#define PPS_CAPTUREBOTH 	0x03	/* capture assert and clear events */

#define PPS_OFFSETASSERT	0x10	/* apply compensation for assert ev. */
#define PPS_OFFSETCLEAR 	0x20	/* apply compensation for clear ev. */
#define PPS_OFFSETBOTH		0x30	/* apply compensation for both */

#define PPS_CANWAIT		0x100	/* Can we wait for an event? */
#define PPS_CANPOLL		0x200	/* "This bit is reserved for */

/*
 * Kernel actions (mode)
 */

#define PPS_ECHOASSERT		0x40	/* feed back assert event to output */
#define PPS_ECHOCLEAR		0x80	/* feed back clear event to output */

/*
 * Timestamp formats (tsformat)
 */

#define PPS_TSFMT_TSPEC		0x1000	/* select timespec format */
#define PPS_TSFMT_NTPFP		0x2000	/* select NTP format */
#define PPS_TSFMT_BOTH		(PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)

/*
 * Kernel discipline actions (not used in Windows yet)
 */

#define PPS_KC_HARDPPS		0	/* enable kernel consumer */
#define PPS_KC_HARDPPS_PLL	1	/* phase-lock mode */
#define PPS_KC_HARDPPS_FLL	2	/* frequency-lock mode */

/*
 * Type definitions
 */

typedef unsigned long pps_seq_t;	/* sequence number */

#pragma warning(push)
#pragma warning(disable: 201)		/* nonstd extension nameless union */

typedef struct ntp_fp {
	union ntp_fp_sec {
		unsigned int	integral;
		int		s_integral;
	};
	unsigned int	fractional;
} ntp_fp_t;				/* NTP-compatible time stamp */

#pragma warning(pop)

typedef union pps_timeu {		/* timestamp format */
	struct timespec tspec;
	ntp_fp_t	ntpfp;
	unsigned long	longpad[3];
} pps_timeu_t;				/* generic data type to represent time stamps */

/* addition of NTP fixed-point format */

#define NTPFP_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	NTPFP_L_ADDS(r, a)	NTPFP_M_ADD((r)->integral, (r)->fractional, \
					    (a)->s_integral, (a)->fractional)


/*
 * Timestamp information structure
 */

typedef struct pps_info {
	pps_seq_t	assert_sequence;	/* seq. num. of assert event */
	pps_seq_t	clear_sequence; 	/* seq. num. of clear event */
	pps_timeu_t	assert_tu;		/* time of assert event */
	pps_timeu_t	clear_tu;		/* time of clear event */
	int		current_mode;		/* current mode bits */
} pps_info_t;

#define assert_timestamp	assert_tu.tspec
#define clear_timestamp 	clear_tu.tspec

#define assert_timestamp_ntpfp	assert_tu.ntpfp
#define clear_timestamp_ntpfp	clear_tu.ntpfp

/*
 * Parameter structure
 */

typedef struct pps_params {
	int		api_version;	/* API version # */
	int		mode;		/* mode bits */
	pps_timeu_t	assert_off_tu;	/* offset compensation for assert */
	pps_timeu_t	clear_off_tu;	/* offset compensation for clear */
} pps_params_t;

#define assert_offset		assert_off_tu.tspec
#define clear_offset		clear_off_tu.tspec

#define assert_offset_ntpfp	assert_off_tu.ntpfp
#define clear_offset_ntpfp	clear_off_tu.ntpfp

/*
 *------ Here begins the implementation-specific part! ------
 */

#include 
#include 
#include 	/* offsetof() */
#include 		/* _get_osfhandle() */

#ifndef EOPNOTSUPP
#define EOPNOTSUPP 45
#endif

typedef UINT_PTR pps_handle_t;	/* pps handlebars */

#ifndef inline
#define inline __inline
#endif

/*
 * ntpd on Windows is typically distributed as a binary as few users
 * have the tools needed to build from source.  Rather than build
 * a single timepps.h for Windows which knows how to talk to all
 * PPS implementations frozen in time as of compiling, this timepps.h
 * allows one or more backend providers to be used by naming a DLL
 * which exports the provider interfaces defined here.
 */
typedef enum ppsapi_magic_tag {
	PPSAPI_MAGIC_UNIT = 0x70707355,	/* ppsU */
} ppsapi_magic;

typedef struct {
	struct pps_provider_tag *provider;
	void *		context;/* provider's unit pointer */
	ppsapi_magic	magic;	/* to detect invalid handles */
	pps_params_t	params;	/* PPS parameters set by user */
} pps_unit_t;

typedef void (*ppps_ntp_timestamp_from_counter)(
	ntp_fp_t	*result, 
	ULONGLONG	Timestamp, 
	ULONGLONG	Counterstamp
	);

typedef pps_handle_t (*pcreate_pps_handle)(
	void *	prov_context
	);

/*
 * ppsapi_prov_init() - exported by backend DLLs
 *
 * Return value is pps capabilities available to PPSAPI consumers
 * via time_pps_getcaps().
 */
#define PPSAPI_TIMEPPS_PROV_VER		2

typedef int (WINAPI *pppsapi_prov_init)(
	int	ppsapi_timepps_prov_ver,
	pcreate_pps_handle	create_pps_handle,
	ppps_ntp_timestamp_from_counter ntp_timestamp_from_counter,
	char *	short_name_buf,
	size_t	short_name_size,
	char *	full_name_buf,
	size_t	full_name_size
	);

typedef int (WINAPI *provtime_pps_create)(
	HANDLE winhandle,	/* user device handle */
	pps_handle_t *phandle	/* returned handle */
	);

typedef int (WINAPI *provtime_pps_destroy)(
	pps_unit_t *	unit,
	void *		context
	);

typedef int (WINAPI *provtime_pps_setparams)(
	pps_unit_t *		unit,
	void *			context,
	const pps_params_t *	params
	);

typedef int (WINAPI *provtime_pps_fetch)(
	pps_unit_t *		unit,
	void *			context,
	const int		tsformat,
	pps_info_t *		pinfo,
	const struct timespec *	timeout
	);

typedef int (WINAPI *provtime_pps_kcbind)(
	pps_unit_t *	unit,
	void *		context,
	const int	kernel_consumer,
	const int	edge, 
	const int	tsformat
	);

typedef struct pps_provider_tag {
	struct pps_provider_tag *next;
	int			caps;
	char *			short_name;
	char *			full_name;
	provtime_pps_create	ptime_pps_create;
	provtime_pps_destroy	ptime_pps_destroy;
	provtime_pps_setparams	ptime_pps_setparams;
	provtime_pps_fetch	ptime_pps_fetch;
	provtime_pps_kcbind	ptime_pps_kcbind;
} ppsapi_provider;

static ppsapi_provider *	g_provider_list;
static ppsapi_provider *	g_curr_provider;


static inline pps_handle_t
internal_create_pps_handle(
	void *	prov_context
	)
{
	pps_unit_t *	punit;

	if (NULL == g_curr_provider) {
		fprintf(stderr, "create_pps_handle: provider backend called me outside time_pps_create\n");
		punit = NULL;
	}	else
		punit = malloc(sizeof(*punit));
	if (punit != NULL) {
		punit->provider = g_curr_provider;
		punit->context = prov_context;
		punit->magic = PPSAPI_MAGIC_UNIT;
		memset(&punit->params, 0, sizeof(punit->params));
	}
	return (pps_handle_t)punit;
}

static inline pps_unit_t *
unit_from_ppsapi_handle(
	pps_handle_t	handle
	)
{
	pps_unit_t *punit;

	punit = (pps_unit_t *)handle;
	if (PPSAPI_MAGIC_UNIT != punit->magic)
		punit = NULL;
	return punit;
}

/*
 * ntpd on Windows only looks to errno after finding
 * GetLastError returns NO_ERROR.  To accomodate its
 * use of msyslog in portable code such as refclock_atom.c,
 * this implementation always clears the Windows
 * error code using SetLastError(NO_ERROR) when
 * returning an errno.  This is also a good idea
 * for any non-ntpd clients as they should rely only
 * the errno for PPSAPI functions.
 */
#define	RETURN_PPS_ERRNO(e)	\
do {				\
	SetLastError(NO_ERROR);	\
	errno = (e);		\
	return -1;		\
} while (0)


#ifdef OWN_PPS_NTP_TIMESTAMP_FROM_COUNTER
extern void pps_ntp_timestamp_from_counter(ntp_fp_t *, ULONGLONG, ULONGLONG);
#else
/*
 * helper routine for serialpps.sys ioctl which returns 
 * performance counter "timestamp" as well as a system
 * FILETIME timestamp.  Converts one of the inputs to
 * NTP fixed-point format.
 *
 * You will probably want to supply your own and #define
 * OWN_PPS_NTP_TIMESTAMP_FROM_COUNTER, as this stub
 * converts only the low-resolution system timestamp.
 *
 * When implementing a provider, use the pointer to this
 * conversion function supplied to your prov_init(), as
 * the copy in your DLL will likely be the stub below,
 * where you want the one provided by the PPSAPI client
 * such as ntpd.
 */
static inline void 
pps_ntp_timestamp_from_counter(
	ntp_fp_t	*result, 
	ULONGLONG	Timestamp, 
	ULONGLONG	Counterstamp)
{
	ULONGLONG BiasedTimestamp;

	/* convert from 100ns units to NTP fixed point format */

	BiasedTimestamp = Timestamp - PPS_FILETIME_1970;
	result->integral = PPS_JAN_1970 + 
		(unsigned)(BiasedTimestamp / PPS_HECTONANOSECONDS);
	result->fractional = 
		(unsigned) ((BiasedTimestamp % PPS_HECTONANOSECONDS) *
		(PPS_FRAC / PPS_HECTONANOSECONDS));
}
#endif


static inline int
load_pps_provider(
	char *	dllpath
	)
{
	char			short_name[16];
	char			full_name[64];
	ppsapi_provider *	prov;
	HMODULE			hmod;
	pppsapi_prov_init	pprov_init;

	prov = malloc(sizeof(*prov));
	if (NULL == prov)
		return ENOMEM;

	hmod = LoadLibrary(dllpath);
	if (NULL == hmod) {
		fprintf(stderr, "load_pps_provider: LoadLibrary(%s) error %u\n", dllpath, GetLastError());
		free(prov);
		return ENOENT;
	}

	pprov_init = (pppsapi_prov_init)GetProcAddress(hmod, "ppsapi_prov_init");
	if (NULL == pprov_init) {
		fprintf(stderr, "load_pps_provider: entrypoint ppsapi_prov_init not found in %s\n", dllpath);
		free(prov);
		FreeLibrary(hmod);
		return EFAULT;
	}

	prov->caps = (*pprov_init)(PPSAPI_TIMEPPS_PROV_VER,
	    &internal_create_pps_handle,
	    &pps_ntp_timestamp_from_counter,
	    short_name,  sizeof(short_name),
	    full_name, sizeof(full_name));

	if (!prov->caps) {
		free(prov);
		FreeLibrary(hmod);
		return EACCES;
	}

	prov->short_name = _strdup(short_name);
	prov->full_name = _strdup(full_name);

	if (NULL == prov->short_name || !prov->short_name[0]
	    || NULL == prov->full_name || !prov->full_name[0]) {

		if (prov->short_name)
			free(prov->short_name);
		if (prov->full_name)
			free(prov->full_name);
		free(prov);
		FreeLibrary(hmod);
		return EINVAL;
	}

	prov->ptime_pps_create = (provtime_pps_create)
		GetProcAddress(hmod, "prov_time_pps_create");
	prov->ptime_pps_destroy = (provtime_pps_destroy)
		GetProcAddress(hmod, "prov_time_pps_destroy");
	prov->ptime_pps_setparams = (provtime_pps_setparams)
		GetProcAddress(hmod, "prov_time_pps_setparams");
	prov->ptime_pps_fetch = (provtime_pps_fetch)
		GetProcAddress(hmod, "prov_time_pps_fetch");
	prov->ptime_pps_kcbind = (provtime_pps_kcbind)
		GetProcAddress(hmod, "prov_time_pps_kcbind");

	if (NULL == prov->ptime_pps_create
	    || NULL == prov->ptime_pps_destroy
	    || NULL == prov->ptime_pps_setparams
	    || NULL == prov->ptime_pps_fetch
	    || NULL == prov->ptime_pps_kcbind) {

		fprintf(stderr, "PPSAPI provider %s missing entrypoint\n",
			prov->short_name);
		free(prov->short_name);
		free(prov->full_name);
		free(prov);
		FreeLibrary(hmod);
		return EINVAL;
	}

	fprintf(stderr, "loaded PPSAPI provider %s caps 0x%x provider %p\n", 
		prov->full_name, prov->caps, prov);

	prov->next = g_provider_list;
	g_provider_list = prov;

	return 0;
}


/*
 * time_pps_create - create PPS handle from file descriptor
 *
 * This is the initial entrypoint of PPSAPI from the client.  Note
 * to maintain source compatibility with Unix, the input file
 * descriptor really is a descriptor from the C runtime low-numbered
 * descriptor namespace, though it may have been converted from a
 * native Windows HANDLE using _open_osfhandle().
 */
static inline int
time_pps_create(
	int		filedes,/* device file descriptor */
	pps_handle_t *	phandle	/* returned handle */
	)
{
	HANDLE			winhandle;
	char *			dlls;
	char *			dll;
	char *			pch;
	ppsapi_provider *	prov;
	pps_handle_t		ppshandle;
	int			err;

	if (NULL == phandle)
		RETURN_PPS_ERRNO(EFAULT);

	winhandle = (HANDLE)_get_osfhandle(filedes);
	fprintf(stderr, "time_pps_create(%d) got winhandle %p\n", filedes, winhandle);
	if (INVALID_HANDLE_VALUE == winhandle)
		RETURN_PPS_ERRNO(EBADF);

	/*
	 * For initial testing the list of PPSAPI backend
	 * providers is provided by the environment variable
	 * PPSAPI_DLLS, separated by semicolons such as
	 * PPSAPI_DLLS=c:\ntp\serial_ppsapi.dll;..\parport_ppsapi.dll
	 * There are a million better ways, such as a well-known
	 * registry key under which a value is created for each
	 * provider DLL installed, or even a platform-specific
	 * ntp.conf directive or command-line switch.
	 */
	dlls = getenv("PPSAPI_DLLS");
	if (dlls != NULL && NULL == g_provider_list) {
		dlls = dll = _strdup(dlls);
		fprintf(stderr, "getenv(PPSAPI_DLLS) gives %s\n", dlls);
	} else
		dlls = dll = NULL;

	while (dll != NULL && dll[0]) {
		pch = strchr(dll, ';');
		if (pch != NULL)
			*pch = 0;
		err = load_pps_provider(dll);
		if (err) {
			fprintf(stderr, "load_pps_provider(%s) got errno %d\n", dll, err);
			RETURN_PPS_ERRNO(err);
		}
		dll = (NULL == pch)
			  ? NULL
			  : pch + 1;
	}

	if (NULL != dlls)
		free(dlls);
	dlls = dll = NULL;

	/*
	 * Hand off to each provider in turn until one returns a PPS
	 * handle or they've all declined.
	 */
	for (prov = g_provider_list; prov != NULL; prov = prov->next) {
		ppshandle = 0;
		g_curr_provider = prov;
		err = (*prov->ptime_pps_create)(winhandle, &ppshandle);
		g_curr_provider = NULL;
		fprintf(stderr, "%s prov_time_pps_create(%p) returned %d\n",
			prov->short_name, winhandle, err);
		if (!err && ppshandle) {
			*phandle = ppshandle;
			return 0;
		}
	}

	fprintf(stderr, "PPSAPI provider list %p\n", g_provider_list);

	RETURN_PPS_ERRNO(ENOEXEC);
}


/*
 * release PPS handle
 */

static inline int
time_pps_destroy(
	pps_handle_t handle
	)
{
	pps_unit_t *	punit;
	int err;

	if (!handle)
		RETURN_PPS_ERRNO(EBADF);

	punit = unit_from_ppsapi_handle(handle);

	if (NULL == punit)
		RETURN_PPS_ERRNO(EBADF);

	err = (*punit->provider->ptime_pps_destroy)(punit, punit->context);

	free(punit);

	if (err)
		RETURN_PPS_ERRNO(err);
	else
		return 0;
}

/*
 * set parameters for handle
 */

static inline int
time_pps_setparams(
	pps_handle_t handle,
	const pps_params_t *params
	)
{
	pps_unit_t *	punit;
	int		err;

	/*
	 * Check for valid arguments and set parameters.
	 */
	if (!handle)
		RETURN_PPS_ERRNO(EBADF);

	punit = unit_from_ppsapi_handle(handle);

	if (NULL == punit)
		RETURN_PPS_ERRNO(EBADF);

	if (NULL == params)
		RETURN_PPS_ERRNO(EFAULT);

	err = (*punit->provider->ptime_pps_setparams)(punit, punit->context, params);

	if (err)
		RETURN_PPS_ERRNO(err);
	else
		return 0;
}

/*
 * get parameters for handle
 */

static inline int
time_pps_getparams(
	pps_handle_t handle,
	pps_params_t *params_buf
	)
{
	pps_unit_t *	punit;

	/*
	 * Check for valid arguments and get parameters.
	 */
	if (!handle)
		RETURN_PPS_ERRNO(EBADF);

	punit = unit_from_ppsapi_handle(handle);

	if (NULL == punit)
		RETURN_PPS_ERRNO(EBADF);

	if (NULL == params_buf)
		RETURN_PPS_ERRNO(EFAULT);

	*params_buf = punit->params;
	return 0;
}


/* 
 * time_pps_getcap - get capabilities for handle
 */
static inline int
time_pps_getcap(
	pps_handle_t handle,
	int *pmode
	)
{
	pps_unit_t *	punit;

	/*
	 * Check for valid arguments and get capabilities.
	 */
	if (!handle)
		RETURN_PPS_ERRNO(EBADF);

	punit = unit_from_ppsapi_handle(handle);

	if (NULL == punit)
		RETURN_PPS_ERRNO(EBADF);

	if (NULL == pmode)
		RETURN_PPS_ERRNO(EFAULT);

	*pmode = punit->provider->caps;
	return 0;
}

/*
 * Fetch timestamps
 */

static inline int
time_pps_fetch(
	pps_handle_t		handle,
	const int		tsformat,
	pps_info_t *		pinfo,
	const struct timespec *	ptimeout
	)
{
	pps_unit_t *	punit;
	int		err;

	/*
	 * Check for valid arguments and fetch timestamps
	 */
	if (!handle)
		RETURN_PPS_ERRNO(EBADF);

	if (NULL == pinfo)
		RETURN_PPS_ERRNO(EFAULT);

	punit = unit_from_ppsapi_handle(handle);

	if (NULL == punit)
		RETURN_PPS_ERRNO(EBADF);

	err = (*punit->provider->ptime_pps_fetch)(punit,
						  punit->context, 
						  tsformat, 
						  pinfo, 
						  ptimeout);

	if (err)
		RETURN_PPS_ERRNO(err);
	else
		return 0;
}

/*
 * time_pps_kcbind - specify kernel consumer
 *
 * Not supported so far by Windows.
 */

static inline int
time_pps_kcbind(
	pps_handle_t handle,
	const int kernel_consumer,
	const int edge, const int tsformat
	)
{
	pps_unit_t *	punit;
	int		err;

	if (!handle)
		RETURN_PPS_ERRNO(EBADF);

	punit = unit_from_ppsapi_handle(handle);

	if (NULL == punit)
		RETURN_PPS_ERRNO(EBADF);

	err = (*punit->provider->ptime_pps_kcbind)(
		punit,
		punit->context,
		kernel_consumer,
		edge,
		tsformat);

	if (err)
		RETURN_PPS_ERRNO(err);
	else
		return 0;
}


#endif /* TIMEPPS_H */
ntp-4.2.6p5/ports/winnt/include/sys/0000755000175000017500000000000011675461367016400 5ustar  peterpeterntp-4.2.6p5/ports/winnt/include/sys/ioctl.h0000644000175000017500000000042010017034576017642 0ustar  peterpeter/**************************************************************
 * Dummy Header for Unix to Windows NT portability
 * Created for NTP package
 **************************************************************/

#ifndef _IOCTL_H
#define _IOCTL_H

#include "win32_io.h"

#endifntp-4.2.6p5/ports/winnt/include/sys/wait.h0000644000175000017500000000031710017034576017501 0ustar  peterpeter/**************************************************************
 * Dummy Header for Unix to Windows NT portability
 * Created for NTP package
 **************************************************************/
ntp-4.2.6p5/ports/winnt/include/sys/param.h0000644000175000017500000000031710017034576017635 0ustar  peterpeter/**************************************************************
 * Dummy Header for Unix to Windows NT portability
 * Created for NTP package
 **************************************************************/
ntp-4.2.6p5/ports/winnt/include/sys/time.h0000644000175000017500000000101211307651603017463 0ustar  peterpeter/*
 * ports/winnt/include/sys/time.h
 *
 * routines declared in Unix systems' sys/time.h
 */

#ifndef SYS_TIME_H
#define SYS_TIME_H

#include 
#include 
#include "ntp_types.h"
#include 
#include 

typedef struct timespec {
	time_t	tv_sec;
	long	tv_nsec;
} timespec_t;

#define TIMEOFDAY	0	/* getclock() clktyp arg */
extern int getclock(int, struct timespec *ts);
extern int gettimeofday(struct timeval *, int);
extern int settimeofday(struct timeval *);

#endif /* SYS_TIME_H */
ntp-4.2.6p5/ports/winnt/include/sys/signal.h0000644000175000017500000000031710017034576020012 0ustar  peterpeter/**************************************************************
 * Dummy Header for Unix to Windows NT portability
 * Created for NTP package
 **************************************************************/
ntp-4.2.6p5/ports/winnt/include/sys/resource.h0000644000175000017500000000032711307651604020365 0ustar  peterpeter/*
 * ports/winnt/include/sys/resource.h
 *
 * routines declared in Unix systems' sys/resource.h
 */

#define	PRIO_PROCESS	0
#define	NTP_PRIO	(-12)

int setpriority(int, int, int);		/* winnt\libntp\setpriority.c */
ntp-4.2.6p5/ports/winnt/include/ntp_iocompletionport.h0000644000175000017500000000125411474355436022220 0ustar  peterpeter#if !defined __ntp_iocompletionport_h
# define __ntp_iocompletionport_h

#include "ntp_fp.h"
#include "ntp.h"
#include "clockstuff.h"

# if defined(HAVE_IO_COMPLETION_PORT)

extern	void	init_io_completion_port(void);
extern	void	uninit_io_completion_port(void);

extern	int	io_completion_port_add_socket(SOCKET fd, struct interface *);

struct refclockio; /* in ntp_refclock.h but inclusion here triggers problems */
extern	int	io_completion_port_add_clock_io(struct refclockio *rio);
extern	int	io_completion_port_sendto(int, void *, size_t, sockaddr_u *);

extern	HANDLE	get_io_event(void);
extern	HANDLE	get_exit_event(void);

extern	int	GetReceivedBuffers(void);

# endif

#endif
ntp-4.2.6p5/ports/winnt/include/transmitbuff.h0000644000175000017500000000167311307651605020432 0ustar  peterpeter#ifndef TRANSMITBUFF_H
#define TRANSMITBUFF_H

#include "ntp.h"
#include 

/*
 * Format of a transmitbuf.  These are used by the asynchronous receive
 * routine to store outgoing packets and related information.
 */

typedef struct transmitbuf transmitbuf_t;

typedef struct transmitbuf {
	ISC_LINK(transmitbuf_t)	link;

	time_t	ts;		/* Time stamp for the request */

	/*
	 * union {
	 *	struct	pkt		pkt;
	 *	struct	ntp_control	ctlpkt;
	 *} pkt;
	 */
	char pkt[512];

} transmitbuf;


extern	void	init_transmitbuff	(void);


/* freetransmitbuf - make a single transmitbuf available for reuse
 */
extern	void	free_transmit_buffer	(transmitbuf_t *);

/*  Get a free buffer (typically used so an async
 *  read can directly place data into the buffer
 *
 *  The buffer is removed from the free list. Make sure
 *  you put it back with freetransmitbuf() or 
 */
extern transmitbuf_t *get_free_transmit_buffer (void);

#endif /* TRANSMITBUFF_H */

ntp-4.2.6p5/ports/winnt/ntptrace/0000755000175000017500000000000011675461367015757 5ustar  peterpeterntp-4.2.6p5/ports/winnt/ntptrace/ntptrace.dsp0000644000175000017500000001205610450460656020301 0ustar  peterpeter# Microsoft Developer Studio Project File - Name="ntptrace" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Console Application" 0x0103

CFG=ntptrace - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE 
!MESSAGE NMAKE /f "ntptrace.mak".
!MESSAGE 
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE /f "ntptrace.mak" CFG="ntptrace - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "ntptrace - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ntptrace - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE 

# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/ntp/dev/ports/winnt/ntptrace", AXBAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
RSC=rc.exe

!IF  "$(CFG)" == "ntptrace - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W4 /GX /O2 /I "\\" /I "$(OPENSSL)\inc32" /I "." /I "..\include" /I "..\..\..\include" /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _WIN32_WINNT=0x400 /YX"windows.h" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib /nologo /subsystem:console /machine:I386

!ELSEIF  "$(CFG)" == "ntptrace - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "." /I "..\include" /I "..\..\..\include" /I "$(OPENSSL)\inc32" /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _WIN32_WINNT=0x400 /FR /YX"windows.h" /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../bin/Debug/ntptrace.exe" /pdbtype:sept

!ENDIF 

# Begin Target

# Name "ntptrace - Win32 Release"
# Name "ntptrace - Win32 Debug"
# Begin Group "Source Files"

# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File

SOURCE=..\..\..\ntptrace\ntptrace.c
# End Source File
# Begin Source File

SOURCE=..\libntp\util_clockstuff.c
# End Source File
# Begin Source File

SOURCE=.\version.c
# End Source File
# End Group
# Begin Group "Header Files"

# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File

SOURCE=..\include\sys\ioctl.h
# End Source File
# Begin Source File

SOURCE=..\..\..\ntptrace\ntptrace.h
# End Source File
# Begin Source File

SOURCE=..\include\sys\resource.h
# End Source File
# End Group
# Begin Group "Resource Files"

# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# Begin Source File

SOURCE=..\..\..\configure

!IF  "$(CFG)" == "ntptrace - Win32 Release"

# Begin Custom Build
ProjDir=.
InputPath=..\..\..\configure

"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
	echo Using NT Shell Script to generate version.c 
	..\scripts\mkver.bat -P ntptrace 
	
# End Custom Build

!ELSEIF  "$(CFG)" == "ntptrace - Win32 Debug"

# Begin Custom Build
ProjDir=.
InputPath=..\..\..\configure

"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
	echo Using NT Shell Script to generate version.c 
	..\scripts\mkver.bat -P ntptrace 
	
# End Custom Build

!ENDIF 

# End Source File
# End Target
# End Project
ntp-4.2.6p5/ports/winnt/ntpd/0000755000175000017500000000000011675461367015104 5ustar  peterpeterntp-4.2.6p5/ports/winnt/ntpd/hopf_PCI_io.c0000644000175000017500000001417511332473273017363 0ustar  peterpeter/* 
 * hopf_PCI_io.c
 * Read data from a hopf PCI clock using the ATLSoft WinNT driver.
 *
 * Date: 21.03.2000 Revision: 01.10 
 *
 * Copyright (C) 1999, 2000 by Bernd Altmeier altmeier@ATLSoft.de
 * 
 */

/*
 * Ignore nonstandard extension warning.
 * This happens when including winioctl.h
 */
#pragma warning(disable: 4201)
#define _FILESYSTEMFSCTL_

#include 
#include 
#include 
#include 
#include 
#include 
#include "hopf_PCI_io.h"


#define ATL_PASSTHROUGH_READ_TOSIZE	(3 * sizeof(ULONG))
#define ATL_PASSTHROUGH_READ_FROMSIZE	0
#define IOCTL_ATLSOFT_PASSTHROUGH_READ	CTL_CODE(			\
						FILE_DEVICE_UNKNOWN,	\
						0x805,			\
						METHOD_BUFFERED,	\
						FILE_ANY_ACCESS)


HANDLE	hDevice = NULL;	// this is the handle to the PCI Device

HANDLE		hRdEvent;
OVERLAPPED	Rdoverlapped;
OVERLAPPED *	pRdOverlapped;

ULONG		iobuffer[256];
DWORD		cbReturned;
BOOL		HaveBoard = FALSE;

struct {
	ULONG	region;
	ULONG	offset;
	ULONG	count;
} io_params;


BOOL
OpenHopfDevice(void)
{
	OSVERSIONINFO	VersionInfo;
	ULONG		deviceNumber;
	CHAR		deviceName[255];
			
	VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
	GetVersionEx(&VersionInfo);
	switch (VersionInfo.dwPlatformId) {

	case VER_PLATFORM_WIN32_WINDOWS:	// Win95/98
		return FALSE;	// "NTP does not support Win 95-98."
		break;

	case VER_PLATFORM_WIN32_NT:	// WinNT
		deviceNumber = 0;
		snprintf(deviceName, sizeof(deviceName),
			 "\\\\.\\hclk6039%d", deviceNumber + 1);
		hDevice = CreateFile(
			deviceName,
			GENERIC_WRITE | GENERIC_READ,
			FILE_SHARE_WRITE | FILE_SHARE_READ,
			NULL,
			OPEN_EXISTING,
			FILE_FLAG_DELETE_ON_CLOSE | FILE_FLAG_OVERLAPPED,
			NULL);
		break;

	default:
		hDevice = INVALID_HANDLE_VALUE;
		break;
	} // end switch

	if (INVALID_HANDLE_VALUE == hDevice) // the system didn't return a handle
		return FALSE;  //"A handle to the driver could not be obtained properly"

	// an event to be used for async transfers
	hRdEvent = CreateEvent(
		NULL,
		TRUE,
		FALSE,
		NULL);	

	if (INVALID_HANDLE_VALUE == hRdEvent) 
		return FALSE;  // the system didn't return a handle

	pRdOverlapped = &Rdoverlapped;
	pRdOverlapped->hEvent = hRdEvent;

	HaveBoard = TRUE; // board installed and we have access

	return TRUE;
} // end of OpenHopfDevice()


BOOL
CloseHopfDevice(void)
{
	CloseHandle(hRdEvent);// When done, close the handle to the driver

	return CloseHandle(hDevice);
} // end of CloseHopfDevice()


void
ReadHopfDevice(void)
{
	if (!HaveBoard)
		return;

	DeviceIoControl(
		hDevice,
		IOCTL_ATLSOFT_PASSTHROUGH_READ,
		&io_params,
		ATL_PASSTHROUGH_READ_TOSIZE,
		iobuffer,
		ATL_PASSTHROUGH_READ_FROMSIZE
		 + io_params.count * sizeof(ULONG),
		&cbReturned, 
		pRdOverlapped
		);
}


void
GetHardwareData(
	LPDWORD	Data32,
	WORD	Ofs
	)
{
	io_params.region = 1;
	io_params.offset = Ofs;
	io_params.count = 1;
	ReadHopfDevice();
	*Data32 = iobuffer[0];
}


void
GetHopfTime(
	LPHOPFTIME	Data,
	DWORD		Offset
	)
{
	io_params.region = 1;
	io_params.offset = Offset;
	io_params.count = 4;

	ReadHopfDevice();

	Data->wHour = 0;
	Data->wMinute = 0;
	Data->wSecond = 0;
	while (iobuffer[0] >= 60 * 60 * 1000) {
		iobuffer[0] = iobuffer[0] - 60 * 60 * 1000;
		Data->wHour++;
	}
	while (iobuffer[0] >= 60 * 1000) {
		iobuffer[0] = iobuffer[0] - 60 * 1000;
		Data->wMinute++;
	}
	while (iobuffer[0] >= 1000) {
		iobuffer[0] = iobuffer[0] - 1000;
		Data->wSecond++;
	}
	Data->wMilliseconds = LOWORD(iobuffer[0]);
	Data->wDay = HIBYTE(HIWORD(iobuffer[1]));
	Data->wMonth = LOBYTE(HIWORD(iobuffer[1]));
	Data->wYear = LOWORD(iobuffer[1]);
	Data->wDayOfWeek = HIBYTE(HIWORD(iobuffer[2]));
	if (Data->wDayOfWeek == 7) // Dow Korrektur
		Data->wDayOfWeek = 0;
	
 	io_params.region = 1;
	io_params.offset += 0x08;
	io_params.count = 1;

	ReadHopfDevice();

	Data->wStatus = LOBYTE(HIWORD(iobuffer[0]));
}


void
GetHopfLocalTime(
	LPHOPFTIME Data
	)
{
	DWORD Offset = 0;

	GetHopfTime(Data, Offset);
}


void
GetHopfSystemTime(
	LPHOPFTIME Data
	)
{
	DWORD Offset = 0x10;

	GetHopfTime(Data,Offset);
}


void
GetSatData(
	LPSATSTAT Data
	)
{
	io_params.region = 1;
	io_params.offset = 0xb0;
	io_params.count = 5;

	ReadHopfDevice();
				
	Data->wVisible	= HIBYTE(HIWORD(iobuffer[0]));
	Data->wMode	= LOBYTE(LOWORD(iobuffer[0]));
	Data->wSat0	= HIBYTE(HIWORD(iobuffer[1]));
	Data->wRat0	= LOBYTE(HIWORD(iobuffer[1]));
	Data->wSat1	= HIBYTE(LOWORD(iobuffer[1]));
	Data->wRat1	= LOBYTE(LOWORD(iobuffer[1]));
	Data->wSat2	= HIBYTE(HIWORD(iobuffer[2]));
	Data->wRat2	= LOBYTE(HIWORD(iobuffer[2]));
	Data->wSat3	= HIBYTE(LOWORD(iobuffer[2]));
	Data->wRat3	= LOBYTE(LOWORD(iobuffer[2]));
	Data->wSat4	= HIBYTE(HIWORD(iobuffer[3]));
	Data->wRat4	= LOBYTE(HIWORD(iobuffer[3]));
	Data->wSat5	= HIBYTE(LOWORD(iobuffer[3]));
	Data->wRat5	= LOBYTE(LOWORD(iobuffer[3]));
	Data->wSat6	= HIBYTE(HIWORD(iobuffer[4]));
	Data->wRat6	= LOBYTE(HIWORD(iobuffer[4]));
	Data->wSat7	= HIBYTE(LOWORD(iobuffer[4]));
	Data->wRat7	= LOBYTE(LOWORD(iobuffer[4]));
}


void
GetDiffTime(
	LPLONG Data
	)
{
	io_params.region = 1;
	io_params.offset = 0x0c;
	io_params.count = 1;

	ReadHopfDevice();

	*Data = iobuffer[0];
}


void
GetPosition(
	LPGPSPOS Data
	)
{
	io_params.region = 1;
	io_params.offset = 0x90; // Positionsdaten Länge
	io_params.count  = 1;

	ReadHopfDevice();

	Data->wLongitude = iobuffer[0]; //in Millisekunden
	io_params.region = 1;
	io_params.offset = 0xa0; // Positionsdaten Breite
	io_params.count  = 1;

	ReadHopfDevice();

	Data->wLatitude	= iobuffer[0];
	Data->wAltitude	= 0;
}


void
GetHardwareVersion(
	LPCLOCKVER Data
	)
{
	int i;

	io_params.region = 1;
	io_params.offset = 0x50;
	io_params.count = 12;

	ReadHopfDevice();
				
	Data->cVersion[0] = '\0';
	iobuffer[13] = 0;
	for (i = 0; i < 13; i++) {
		Data->cVersion[i * 4    ] = HIBYTE(HIWORD(iobuffer[i]));
		Data->cVersion[i * 4 + 1] = LOBYTE(HIWORD(iobuffer[i]));
		Data->cVersion[i * 4 + 2] = HIBYTE(LOWORD(iobuffer[i]));
		Data->cVersion[i * 4 + 3] = LOBYTE(LOWORD(iobuffer[i]));
	}
}


void
GetDCFAntenne(
	LPDCFANTENNE Data
	)
{
	io_params.region = 1;
	io_params.offset = 0xcc;
	io_params.count = 1;

	ReadHopfDevice();
	Data->bStatus1	= HIBYTE(HIWORD(iobuffer[0]));
	Data->bStatus	= LOBYTE(HIWORD(iobuffer[0]));
	Data->wAntValue	= LOWORD(iobuffer[0]);
}

ntp-4.2.6p5/ports/winnt/ntpd/nt_clockstuff.c0000644000175000017500000012260111564122255020101 0ustar  peterpeter/* Windows NT Clock Routines
 *
 * Created by Sven Dietrich  sven@inter-yacht.com
 *
 * New interpolation scheme by Dave Hart  February 2009
 * overcomes 500us-1ms inherent jitter with the older scheme, first identified
 * by Peter Rosin (nee Ekberg)  in 2003 [Bug 216].
 */


#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include 	/* our private version */

#if defined(_MSC_VER) && _MSC_VER >= 1400	/* VS 2005 */
#include 				/* for __rdtsc() */
#endif

#ifdef HAVE_PPSAPI
#include 
/*
 * ports/winnt/include/timepps.h defines EOPNOTSUPP for compatibility
 * with PPSAPI on other platforms.  ports/winnt/include/isc/net.h has
 * #define EOPNOTSUPP WSAEOPNOTSUPP, so to avoid a macro redefinition
 * warning undefine it.
 */
#undef EOPNOTSUPP
#endif	/* HAVE_PPSAPI */

#include "ntp_stdlib.h"
#include "ntp_unixtime.h"
#include "ntp_timer.h"
#include "ntp_assert.h"
#include "clockstuff.h"
#include "ntservice.h"
#include "ntpd.h"
#include "../../../ntpd/ntpd-opts.h"

extern double sys_residual;	/* residual from previous adjustment */

/*
 * Include code to possibly modify the MM timer while the service is active. 
 */

/*
 * Whether or not MM timer modifications takes place is still controlled 
 * by the variable below which is initialized by a default value but 
 * might be changed depending on a command line switch.
 */
static int modify_mm_timer = MM_TIMER_LORES;

#define MM_TIMER_INTV   1  /* the interval we'd want to set the MM timer to [ms] */

static UINT wTimerRes;

BOOL init_randfile();

static long last_Adj = 0;

#define LS_CORR_INTV_SECS  2   /* seconds to apply leap second correction */
#define LS_CORR_INTV   ( (LONGLONG) HECTONANOSECONDS * LS_CORR_INTV_SECS )  
#define LS_CORR_LIMIT  ( (LONGLONG) HECTONANOSECONDS / 2 )  // half a second

typedef union ft_ull {
	FILETIME ft;
	ULONGLONG ull;
	LONGLONG ll;
	LARGE_INTEGER li;
} FT_ULL;

/* leap second stuff */
static FT_ULL ls_ft;
static DWORD ls_time_adjustment;
static ULONGLONG ls_ref_perf_cnt;
static LONGLONG ls_elapsed;

static BOOL winnt_time_initialized = FALSE;
static BOOL winnt_use_interpolation = FALSE;
static ULONGLONG last_interp_time;
static unsigned clock_thread_id;


void WINAPI GetInterpTimeAsFileTime(LPFILETIME pft);
static void StartClockThread(void);
static void tune_ctr_freq(LONGLONG, LONGLONG);
void StopClockThread(void);
void atexit_revert_mm_timer(void);
void time_stepped(void);

static HANDLE clock_thread = NULL;
static HANDLE TimerThreadExitRequest = NULL;

/*
 * interp_time estimates time in 100ns units
 * based on a performance counter value given.
 * The 2nd parameter indicates if this is
 * part of a current time-of-day calculation.
 */
ULONGLONG interp_time(ULONGLONG, BOOL);

/*
 * add_counter_time_pair is called by the
 * high priority clock thread with a new
 * sample.
 */
void add_counter_time_pair(ULONGLONG, LONGLONG);

/*
 * globals used by the above two functions to 
 * implement the counter/time history
 */
#define BASELINES_TOT	256
#define BASELINES_USED	64

static volatile int	newest_baseline = 0;
static volatile int	newest_baseline_gen = 0;
static ULONGLONG	baseline_counts[BASELINES_TOT] = {0};
static LONGLONG		baseline_times[BASELINES_TOT] = {0};

static int		clock_backward_count;
static ULONGLONG	clock_backward_max;


/*
 * clockperiod is the period used for SetSystemTimeAdjustment 
 * slewing calculations but does not necessarily correspond
 * to the precision of the OS clock.  Prior to Windows Vista
 * (6.0) the two were identical.  In 100ns units.
 */
static DWORD clockperiod;

/*
 * os_clock_precision is the observed precision of the OS
 * clock, meaning the increment between discrete values. This
 * is currently calculated once at startup.  100ns units.
 */
static ULONGLONG os_clock_precision;

/*
 * NomPerfCtrFreq is from QueryPerformanceFrequency and is the 
 * number of performance counter beats per second.  PerfCtrFreq
 * starts from NomPerfCtrFreq but is maintained using a sliding
 * window average based on actual performance counter behavior,
 * to allow us to better tolerate powersaving measures that
 * alter the effective frequency of the processor cycle counter
 * (TSC) which sometimes underlies QueryPerformanceCounter.
 *
 * Note that the OS is unlikely to be so subtle in its internal
 * scheduling of waitable timers, presumably done using the
 * performance counter.  Therefore our calculations for
 * interpolated time should be based on PerfCtrFreq but our
 * calculations for SetWaitableTimer should assume the OS will
 * convert from FILETIME 100ns units to performance counter
 * beats using the nominal frequency.
 */

volatile ULONGLONG PerfCtrFreq = 0;
	 ULONGLONG NomPerfCtrFreq = 0;

/* 
 * If we're using RDTSC beating at the same rate as
 * QueryPerformanceCounter, there is a systemic
 * offset we need to account for when using
 * counterstamps from serialpps.sys, which are
 * always from QPC (actually KeQueryPerformanceCounter).
 */
static LONGLONG QPC_offset = 0;

/*
 * Substitute RDTSC for QueryPerformanceCounter()?
 */
static int use_pcc = -1;

/*
 * Restrict threads that call QPC/RDTSC to one CPU?
 */
static int lock_interp_threads = -1;

static void	choose_interp_counter(void);
static int	is_qpc_built_on_pcc(void);

/*
 * ppm_per_adjust_unit is parts per million effect on the OS
 * clock per slewing adjustment unit per second.  Per haps.
 */
static DOUBLE ppm_per_adjust_unit = 0.0;

/*
 * wintickadj emulates the functionality provided by unix tickadj,
 * providing a baseline clock correction if needed to get the
 * clock within a few hundred PPM of correct frequency.
 */
static long wintickadj;

/*
 * performance counter frequency observations
 */
#define TUNE_CTR_DEPTH		3	/* running avg depth */

static HANDLE		ctr_freq_timer = INVALID_HANDLE_VALUE;
static ULONGLONG	tune_ctr_freq_max_interval;
static unsigned		tune_ctr_period;
void start_ctr_freq_timer(ULONGLONG now_time);
void reset_ctr_freq_timer(ULONGLONG when, ULONGLONG now);
void reset_ctr_freq_timer_abs(ULONGLONG when);

/* round a Windows time to the next bottom of the second */

#define ROUND_TO_NEXT_SEC_BOTTOM(t)	\
do {	\
	(t) += 3 * HECTONANOSECONDS / 2 - 1;	\
	(t) /= HECTONANOSECONDS;	\
	(t) *= HECTONANOSECONDS;	\
	(t) -= HECTONANOSECONDS / 2;	\
} while (0)

/*
 * workaround for VC6 inability to convert unsigned __int64 to double
 */
#define	LL_HNS	((LONGLONG)HECTONANOSECONDS)

/*
 * NT native time format is 100's of nanoseconds since 1601-01-01.
 * Helpers for converting between "hectonanoseconds" and the 
 * performance counter scale from which interpolated time is
 * derived.
 *
 * Once support for VC6 is dropped, the cast of PerfCtrFreq to
 * LONGLONG can come out of PERF2HNS().  It avoids the VC6 error
 * message:
 * 
 * conversion from unsigned __int64 to double not implemented, use
 * signed __int64
 */
#define HNS2PERF(hns)	((hns) * PerfCtrFreq / LL_HNS)
#define PERF2HNS(ctr)	((ctr) * LL_HNS / (LONGLONG)PerfCtrFreq)


#if defined(_MSC_VER) && _MSC_VER >= 1400	/* VS 2005 */
#define	get_pcc()	__rdtsc()
#else
/*
 * something like this can be used for a compiler without __rdtsc()
 */
ULONGLONG __forceinline 
get_pcc(void)
{
	/* RDTSC returns in EDX:EAX, same as C compiler */
	__asm {
		RDTSC
	}
}
#endif


/*
 * perf_ctr() returns the current performance counter value, 
 * from QueryPerformanceCounter or RDTSC.
 */
ULONGLONG WINAPI 
perf_ctr(void)
{
	FT_ULL ft;

	if (use_pcc)
		return get_pcc();
	else {
		QueryPerformanceCounter(&ft.li);
		return ft.ull;
	}
}


/*
 * choose_interp_counter - select between QueryPerformanceCounter and
 *			   the x86 processor cycle counter (TSC).
 */
static void
choose_interp_counter(void)
{
	const char *	ntpd_pcc_freq_text;
	int		qpc_built_on_pcc;

	/*
	 * Regardless of whether we actually use RDTSC, first determine
	 * if QueryPerformanceCounter is built on it, so that we can
	 * decide whether it's prudent to lock QPC-consuming threads to
	 * a particular CPU.
	 */
	qpc_built_on_pcc = is_qpc_built_on_pcc();
	lock_interp_threads = qpc_built_on_pcc;

	/*
	 * It's time to make some more permanent knobs,
	 * but for right now the RDTSC aka PCC dance on x86 is:
	 *
	 * 1.  With none of these variables defined, only QPC
	 *     is used because there is no reliable way to
	 *     detect counter frequency variation after ntpd
	 *     startup implemented.
	 * 2.  We need a better knob, but for now if you know
	 *     your RDTSC / CPU frequency is invariant, set
	 *     NTPD_PCC and assuming your QPC is based on the
	 *     PCC as well, RDTSC will be substituted.
	 * 3.  More forcefully, you can jam in a desired exact
	 *     processor frequency, expressed in cycles per
	 *     second by setting NTPD_PCC_FREQ=398125000, for
	 *     example, if yor actual known CPU frequency is
	 *     398.125 MHz, and NTPD_PCC doesn't work because
	 *     QueryPerformanceCounter is implemented using
	 *     another counter.  It is very easy to make ntpd
	 *     fall down if the NTPD_PCC_FREQ value isn't very
	 *     close to the observed RDTSC units per second.
	 *
	 * Items 2 and 3 could probably best be combined into one
	 * new windows-specific command line switch such as
	 *   ntpd --pcc
	 * or
	 *   ntpd --pcc=398125000
	 *
	 * They are currently tied to Windows because that is
	 * the only ntpd port with its own interpolation, and
	 * to x86/x64 because no one has ported the Windows
	 * ntpd port to the sole remaining alternative, Intel
	 * Itanium.
	 */
	if (HAVE_OPT(PCCFREQ))
		ntpd_pcc_freq_text = OPT_ARG(PCCFREQ);
	else
		ntpd_pcc_freq_text = getenv("NTPD_PCC_FREQ");

	if (!HAVE_OPT(USEPCC)
	    && NULL == ntpd_pcc_freq_text
	    && NULL == getenv("NTPD_PCC")) {
		use_pcc = 0;
		return;
	}

	if (!qpc_built_on_pcc && NULL == ntpd_pcc_freq_text) {
		use_pcc = 0;
		return;
	}

	use_pcc = 1;
	if (ntpd_pcc_freq_text != NULL)
		sscanf(ntpd_pcc_freq_text, 
		       "%I64u", 
		       &NomPerfCtrFreq);

	NLOG(NLOG_CLOCKINFO)
		msyslog(LOG_INFO, 
			"using processor cycle counter "
			"%.3f MHz", 
			(LONGLONG)NomPerfCtrFreq / 1e6);
	return;
}


/*
 * is_qpc_built_on_pcc - test if QueryPerformanceCounter runs at the
 *			 same rate as the processor cycle counter (TSC).
 */
static int
is_qpc_built_on_pcc(void)
{
	LONGLONG	offset;
	FT_ULL		ft1;
	FT_ULL		ft2;
	FT_ULL		ft3;
	FT_ULL		ft4;
	FT_ULL		ft5;

	NTP_REQUIRE(NomPerfCtrFreq != 0);

	QueryPerformanceCounter(&ft1.li);
	ft2.ull = get_pcc();
	Sleep(1);
	QueryPerformanceCounter(&ft3.li);
	Sleep(1);
	ft4.ull = get_pcc();
	Sleep(1);
	QueryPerformanceCounter(&ft5.li);

	offset = ft2.ull - ft1.ull;
	ft3.ull += offset;
	ft5.ull += offset;

	if (ft2.ull <= ft3.ull &&
	    ft3.ull <= ft4.ull &&
	    ft4.ull <= ft5.ull) {

		QPC_offset = offset;
		return TRUE;
	}

	return FALSE;
}


/*
 * Request Multimedia Timer
 */
void
set_mm_timer(
	int timerres
	)
{
	modify_mm_timer = timerres;
}

/*
 * adj_systime - called once every second to make system time adjustments.
 * Returns 1 if okay, 0 if trouble.
 */
int
adj_systime(
	double now
	)
{
	double dtemp;
	u_char isneg = 0;
	int rc;
	long TimeAdjustment;

	/*
	 * Add the residual from the previous adjustment to the new
	 * adjustment, bound and round.
	 */
	dtemp = sys_residual + now;
	sys_residual = 0;
	if (dtemp < 0)
	{
		isneg = 1;
		dtemp = -dtemp;
	}

	if (dtemp > NTP_MAXFREQ)
		dtemp = NTP_MAXFREQ;

	dtemp = dtemp * 1e6;

	if (isneg)
		dtemp = -dtemp;

	/* 
	 * dtemp is in micro seconds. NT uses 100 ns units,
	 * so a unit change in TimeAdjustment corresponds
	 * to slewing 10 ppm on a 100 Hz system. Calculate
	 * the number of 100ns units to add, using OS tick
	 * frequency as per suggestion from Harry Pyle,
	 * and leave the remainder in dtemp
	 */
	TimeAdjustment = (long) (dtemp / ppm_per_adjust_unit + (isneg ? -0.5 : 0.5));
	dtemp -= (double) TimeAdjustment * ppm_per_adjust_unit;	


	/*
	 * If a leap second is pending then determine the UTC time stamp 
	 * of when the insertion must take place 
	 */
	if (leapsec > 0)
	{
		if ( ls_ft.ull == 0 )  /* time stamp has not yet been computed */
		{
			SYSTEMTIME st;

			GetSystemTime(&st);

 			/*
			 * Accept leap announcement only 1 month in advance,
			 * for end of March, June, September, or December.
			 */
			if ( ( st.wMonth % 3 ) == 0 )
			{
				/*
				 * The comparison time stamp is computed according 
				 * to 0:00h UTC of the following day 
				 */
				if ( ++st.wMonth > 12 )
				{
					st.wMonth -= 12;
					st.wYear++;
				}
				
				st.wDay = 1;
				st.wHour = 0;
				st.wMinute = 0;
				st.wSecond = 0;
				st.wMilliseconds = 0;

				SystemTimeToFileTime(&st, &ls_ft.ft);
				msyslog(LOG_NOTICE,
					"Detected positive leap second announcement "
					"for %04d-%02d-%02d %02d:%02d:%02d UTC",
					st.wYear, st.wMonth, st.wDay,
					st.wHour, st.wMinute, st.wSecond);
			}
		}
	}
	else
	{
		if ( ls_ft.ull )  /* Leap second has been armed before */
		{
			/*
			 * Disarm leap second only if the leap second
			 * is not already in progress.
			 */
			if ( !ls_time_adjustment )
			{
				ls_ft.ull = 0;
				msyslog( LOG_NOTICE, "Leap second announcement disarmed" );
			}
		}
	}


	/*
	 * If the time stamp for the next leap second has been set
	 * then check if the leap second must be handled
	 */
	if ( ls_ft.ull )
	{
		ULONGLONG this_perf_count;

		this_perf_count = perf_ctr();

		if ( ls_time_adjustment == 0 ) /* has not yet been scheduled */
		{
			FT_ULL curr_ft;

	 		GetSystemTimeAsFileTime(&curr_ft.ft);   
			if ( curr_ft.ull >= ls_ft.ull )
			{
				ls_time_adjustment = clockperiod / LS_CORR_INTV_SECS;
				ls_ref_perf_cnt = this_perf_count;
				ls_elapsed = 0;
				msyslog(LOG_NOTICE, "Inserting positive leap second.");
			}
		}
		else  /* leap sec adjustment has been scheduled previously */
		{
			ls_elapsed = ( this_perf_count - ls_ref_perf_cnt ) 
				       * HECTONANOSECONDS / PerfCtrFreq;
		}

		if ( ls_time_adjustment )  /* leap second adjustment is currently active */
		{
			if ( ls_elapsed > ( LS_CORR_INTV - LS_CORR_LIMIT ) )
			{
				ls_time_adjustment = 0;  /* leap second adjustment done */
				ls_ft.ull = 0;
			}

			/* 
			 * NOTE: While the system time is slewed during the leap second 
			 * the interpolation function which is based on the performance 
			 * counter does not account for the slew.
			*/
			TimeAdjustment -= ls_time_adjustment;
		}
	}


	/* only adjust the clock if adjustment changes */
	TimeAdjustment += wintickadj;
	if (last_Adj != TimeAdjustment) {
		last_Adj = TimeAdjustment;
		DPRINTF(1, ("SetSystemTimeAdjustment(%+ld)\n", TimeAdjustment));
		rc = !SetSystemTimeAdjustment(clockperiod + TimeAdjustment, FALSE);
	}
	else rc = 0;
	if (rc)
	{
		msyslog(LOG_ERR, "Can't adjust time: %m");
		return 0;
	}
	else {
		sys_residual = dtemp / 1e6;
	}

	DPRINTF(6, ("adj_systime: adj %.9f -> remaining residual %.9f\n", 
		    now, sys_residual));

	return 1;
}


void 
init_winnt_time(void)
{
	static const char settod[] = "settimeofday=\"SetSystemTime\"";
	char szMsgPath[MAX_PATH+1];
	HANDLE hToken = INVALID_HANDLE_VALUE;
	TOKEN_PRIVILEGES tkp;
	TIMECAPS tc;
	BOOL noslew;
	DWORD adjclockperiod;
	LARGE_INTEGER Freq;
	FT_ULL initial_hectonanosecs;
	FT_ULL next_hectonanosecs;
	double adjppm;
	double rawadj;
	char * pch;

	if (winnt_time_initialized)
		return;

	/*
	 * Make sure the service is initialized
	 * before we do anything else
	 */
	ntservice_init();

	/* Set up the Console Handler */
	if (!SetConsoleCtrlHandler(OnConsoleEvent, TRUE))
	{
		msyslog(LOG_ERR, "Can't set console control handler: %m");
	}

	/* Set the Event-ID message-file name. */
	if (!GetModuleFileName(NULL, szMsgPath, sizeof(szMsgPath))) 
	{
		msyslog(LOG_ERR, "GetModuleFileName(PGM_EXE_FILE) failed: %m\n");
		exit(1);
	}

	/* Initialize random file before OpenSSL checks */
	if (!init_randfile())
		msyslog(LOG_ERR, "Unable to initialize .rnd file\n");

#pragma warning(push)
#pragma warning(disable: 4127) /* conditional expression is constant */

#ifdef DEBUG
	if (SIZEOF_TIME_T != sizeof(time_t)
	    || SIZEOF_INT != sizeof(int)
	    || SIZEOF_SIGNED_CHAR != sizeof(char)) {
	
		msyslog(LOG_ERR, "config.h SIZEOF_* macros wrong, fatal");
		exit(1);
	}
#endif

#pragma warning(pop)

	/*
	 * Get privileges needed for fiddling with the clock
	 */

	/* get the current process token handle */
	if (!OpenProcessToken(GetCurrentProcess(),
	     TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) 
	{
		msyslog(LOG_ERR, "OpenProcessToken failed: %m");
		exit(-1);
	}
	/* get the LUID for system-time privilege. */
	LookupPrivilegeValue(NULL, SE_SYSTEMTIME_NAME, &tkp.Privileges[0].Luid);
	tkp.PrivilegeCount = 1;  /* one privilege to set */
	tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;

	/* get set-time privilege for this process. */
	AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,
	 	(PTOKEN_PRIVILEGES) NULL, 0);

	/* cannot use return value of AdjustTokenPrivileges. */
	/* (success does not indicate all privileges were set) */
	if (GetLastError() != ERROR_SUCCESS) 
	{
		msyslog(LOG_ERR, "AdjustTokenPrivileges failed: %m");
	 	/* later set time call will probably fail */
	}

	CloseHandle(hToken);
	hToken = INVALID_HANDLE_VALUE;

	/*
	 * Say how we're setting the time of day
	 */
	set_sys_var(settod, sizeof(settod), RO);

	/*
	 * ntpd on Windows has always raised its priority, without
	 * requiring -N as on Unix.  Since Windows ntpd doesn't share
	 * the history of unix ntpd of once having no -N and therefore
	 * needing to be invoked under nice, there is no reason to
	 * bring it in line with the Unix version in this regard.
	 * Instsrv assumes ntpd is invoked with no arguments, and
	 * upgrading users would be negatively surprised by the 
	 * poor timekeeping if they failed to add -N as part of 
	 * upgrading were we to correct this platform difference.
	 */
	if (-1 == setpriority(PRIO_PROCESS, 0, NTP_PRIO))
		exit(-1);

	/*
	 * register with libntp ntp_set_tod() to call us back
	 * when time is stepped.
	 */
	step_callback = time_stepped;

	/* 
	 * before we start looking at clock period, do any multimedia
	 * timer manipulation requested via -M option.
	 */
	if (modify_mm_timer) {

		if (timeGetDevCaps(&tc, sizeof(tc)) == TIMERR_NOERROR) {

			wTimerRes = min(max(tc.wPeriodMin, MM_TIMER_INTV), tc.wPeriodMax);
			timeBeginPeriod(wTimerRes);
			atexit(atexit_revert_mm_timer);
			
			msyslog(LOG_INFO, "MM timer resolution: %u..%u msec, set to %u msec",
				tc.wPeriodMin, tc.wPeriodMax, wTimerRes );
		} else
			msyslog(LOG_ERR, "Multimedia timer unavailable");
	}
	
	/* get the performance counter ticks per second */
	if (!QueryPerformanceFrequency(&Freq) || !Freq.QuadPart)
	{
		msyslog(LOG_ERR, "QueryPerformanceFrequency failed: %m\n");
		exit(-1);
	}

	NomPerfCtrFreq = PerfCtrFreq = Freq.QuadPart;
	/*
	 * the cast to LONGLONG is for VC6 compatibility:
	 * nt_clockstuff.c(586) : error C2520: conversion from
	 * unsigned __int64 to double not implemented, use signed 
	 * __int64
	 */
	msyslog(LOG_INFO, 
		"Performance counter frequency %.3f MHz", 
		(LONGLONG)PerfCtrFreq / 1e6);

	/* Determine the existing system time slewing */
	if (!GetSystemTimeAdjustment(&adjclockperiod, &clockperiod, &noslew))
	{
		msyslog(LOG_ERR, "GetSystemTimeAdjustment failed: %m\n");
		exit(-1);
	}

	/*
	 * If there is no slewing before ntpd, adjclockperiod and clockperiod
	 * will be equal.  Any difference is carried into adj_systime's first
	 * pass as the previous adjustment.
	 */
	last_Adj = adjclockperiod - clockperiod;
	
	if (last_Adj)
		msyslog(LOG_INFO, 
			"Clock interrupt period %.3f msec "
			"(startup slew %.1f usec/period)",
			clockperiod / 1e4,
			last_Adj / 10.);
	else
		msyslog(LOG_INFO, 
			"Clock interrupt period %.3f msec", 
			clockperiod / 1e4);

	/*
	 * Calculate the time adjustment resulting from incrementing
	 * units per tick by 1 unit for 1 second 
	 */
	ppm_per_adjust_unit = 1e6 / clockperiod;

	/*
	 * Spin on GetSystemTimeAsFileTime to determine its
	 * granularity.  Prior to Windows Vista this is 
	 * typically the same as the clock period.
	 */
	GetSystemTimeAsFileTime(&initial_hectonanosecs.ft);
	do {
		GetSystemTimeAsFileTime(&next_hectonanosecs.ft);
	} while (initial_hectonanosecs.ull == next_hectonanosecs.ull);

	os_clock_precision = next_hectonanosecs.ull -
		initial_hectonanosecs.ull;

	msyslog(LOG_INFO,
		"Windows clock precision %.3f msec, min. slew %.3f ppm/s",
		(LONGLONG)os_clock_precision / 1e4, 
		ppm_per_adjust_unit);

	pch = getenv("NTPD_TICKADJ_PPM");
	if (pch != NULL && 1 == sscanf(pch, "%lf", &adjppm)) {
		rawadj = adjppm / ppm_per_adjust_unit;
		rawadj += (rawadj < 0)
			      ? -0.5
			      : 0.5;
		wintickadj = (long)rawadj;
		msyslog(LOG_INFO,
			"Using NTPD_TICKADJ_PPM %+g ppm (%+ld)",
			adjppm, wintickadj);
	}

	winnt_time_initialized = TRUE;

	choose_interp_counter();

	if (getenv("NTPD_USE_SYSTEM_CLOCK") ||
	    (os_clock_precision < 4 * 10000 &&
	     !getenv("NTPD_USE_INTERP_DANGEROUS"))) {
		msyslog(LOG_INFO, "using Windows clock directly");
	} else {
		winnt_use_interpolation = TRUE;
		get_sys_time_as_filetime = GetInterpTimeAsFileTime;
		StartClockThread();
	}
}


void
atexit_revert_mm_timer(void)
{
	timeEndPeriod(wTimerRes); 
	DPRINTF(1, ("MM timer resolution reset\n"));
}


void 
reset_winnt_time(void)
{
	SYSTEMTIME st;

	/*
	 * If we're in the 2-second slew right after a leap second, 
	 * we don't want to continue that extreme slew, in that case
	 * disable our slewing and return clock discipline to the 
	 * kernel.  Similarly if we are not yet synchronized, 
	 * our current slew may not be a good ongoing trim.
	 * Otherwise, our leave in place the last SetSystemTimeAdjustment
	 * as an ongoing frequency correction, better than nothing.
	 * TODO:
	 * Verify this will not call SetSystemTimeAdjustment if
	 * ntpd is running in ntpdate mode.
	 */
	if (sys_leap == LEAP_NOTINSYNC || ls_time_adjustment)
		SetSystemTimeAdjustment(0, TRUE);	 

	/*
	 * Read the current system time, and write it back to
	 * force CMOS update, only if we are exiting because
	 * the computer is shutting down and we are already
	 * synchronized.
	 */
	 if (ntservice_systemisshuttingdown() && sys_leap != LEAP_NOTINSYNC) {
		GetSystemTime(&st);
		SetSystemTime(&st);
		NLOG(NLOG_SYSEVENT | NLOG_CLOCKINFO)
			msyslog(LOG_NOTICE, "system is shutting down, CMOS time reset.");
	}
}


/*
 * GetSystemTimeAsFileTime() interface clone is used by getclock() in ntpd.
 */

void WINAPI 
GetInterpTimeAsFileTime(
	LPFILETIME pft
	)
{
	FT_ULL now_time;
	FT_ULL now_count;

	/*  Mark a mark ASAP. The latency to here should
	 *  be reasonably deterministic
	*/

	now_count.ull = perf_ctr();
	now_time.ull = interp_time(now_count.ull, TRUE);

	if (last_interp_time > now_time.ull) {

		clock_backward_count++;
		if (last_interp_time - now_time.ull > clock_backward_max)
			clock_backward_max = last_interp_time - now_time.ull;
		now_time.ull = last_interp_time;
	} else
		last_interp_time = now_time.ull;

	*pft = now_time.ft;
	return;
}


/*
 * TimerApcFunction is invoked on the high-priority clock
 * thread to capture a new  baseline system time and
 * performance counter correlation every 43 msec (64Hz 
 * OS clock precision).
 */
static void CALLBACK
TimerApcFunction(
	LPVOID lpArgToCompletionRoutine,
	DWORD dwTimerLowValue,
	DWORD dwTimerHighValue
	)
{
	static BOOL		ctr_freq_timer_started = FALSE;
	static ULONGLONG	prev_count;
	ULONGLONG		now_time;
	FT_ULL			now_count;

	/* Grab the counter first of all */
	now_count.ull = perf_ctr();

	now_time = (((ULONGLONG)dwTimerHighValue << 32) |
				dwTimerLowValue);

	/*
	 * Save this correlation in the history.
	 */
	add_counter_time_pair(now_count.ull, now_time);

	/*
	 * Once we're synchronized start the counter frequency
	 * tuning timer.
	 */
	if (INVALID_HANDLE_VALUE == ctr_freq_timer &&
	    LEAP_NOTINSYNC != sys_leap)

		start_ctr_freq_timer(now_time);
}


unsigned WINAPI 
ClockThread(
	void *arg
	)
{
	LARGE_INTEGER	DueTime;
	HANDLE		timer;
	double		HZ;
	double		TimerHz;
	DWORD		timer_period_msec;
	DWORD		res;
	char		*ntpd_int_int_text;

	UNUSED_ARG(arg);

	timer = CreateWaitableTimer(NULL, FALSE, NULL);

	ntpd_int_int_text = getenv("NTPD_INT_INT");

	HZ = (double)HECTONANOSECONDS / clockperiod;

	if (HZ > 63 && HZ < 65) {
		timer_period_msec = 43;
	} else if (HZ > 98 && HZ < 102) {
		timer_period_msec = 27;
		if (!ntpd_int_int_text)
			msyslog(LOG_WARNING, 
				"%.3f Hz system clock may benefit from "
				"custom NTPD_INT_INT env var timer interval "
				"override between approx. 20 and 50 msecs.",
				HZ);
	} else {
		timer_period_msec = (DWORD)(0.5 + (2.752 * clockperiod / 10000));
		if (!ntpd_int_int_text)
			msyslog(LOG_WARNING, 
				"unfamiliar %.3f Hz system clock may benefit "
				"from custom NTPD_INT_INT env var timer "
				"interval override between approx. 20 and 50 "
				"msecs.",
				HZ);
	}

	if (ntpd_int_int_text) {
		timer_period_msec = atoi(ntpd_int_int_text);
		timer_period_msec = max(9, timer_period_msec);
		msyslog(LOG_NOTICE, 
			"using NTPD_INT_INT env var override %u", 
			timer_period_msec);
	}

	TimerHz = 1e3 / timer_period_msec;
	msyslog(LOG_NOTICE, "HZ %.3f using %u msec timer %.3f Hz %d deep", 
		HZ,
		timer_period_msec,
		TimerHz,
		BASELINES_USED);

	/* negative DueTime means relative to now */
	DueTime.QuadPart = -(int)timer_period_msec;

	SetWaitableTimer(
		timer, 
		&DueTime,		/* first fire */
		timer_period_msec,	/* period thereafter */
		TimerApcFunction,	/* callback routine */
		&timer,			/* context for callback */
		FALSE);			/* do not interfere with power saving */

	/*
	 * The clock thread spends the rest of its life in the TimerApcFunction
	 * and ctr_freq_timer_fired timer APC callbacks, which can only occur 
	 * while this thread is in an alertable wait.  Note the Ex on 
	 * WaitForSingleObjectEx and TRUE for fAlertable.  The wait will return 
	 * after each APC callback in which case we simply wait again.  We will
	 * break out of the loop when StopClockThread signals our exit event.
	 */
	do res = WaitForSingleObjectEx(
			TimerThreadExitRequest, 
			INFINITE, 
			TRUE);
	while (WAIT_OBJECT_0 != res);

	CloseHandle(timer);

	if (ctr_freq_timer != INVALID_HANDLE_VALUE) {
		CloseHandle(ctr_freq_timer);
		ctr_freq_timer = INVALID_HANDLE_VALUE;
	}

	return 0;
}


static void 
StartClockThread(void)
{
	static BOOL done_once = FALSE;
	FT_ULL StartTime;

	/* init variables with the time now */
	GetSystemTimeAsFileTime(&StartTime.ft);
	baseline_times[0] = StartTime.ull;
	baseline_counts[0] = perf_ctr();

	/* init sync objects */
	TimerThreadExitRequest = CreateEvent(NULL, FALSE, FALSE, NULL);

	clock_thread = 
		(HANDLE)_beginthreadex(
			NULL, 
			0, 
			ClockThread, 
			NULL, 
			CREATE_SUSPENDED, 
			&clock_thread_id);

	if (clock_thread != NULL) {
		/* remember the thread priority is only within the process class */
		if (!SetThreadPriority(clock_thread, THREAD_PRIORITY_TIME_CRITICAL)) {
			DPRINTF(1, ("Error setting thread priority\n"));
		}

		lock_thread_to_processor(clock_thread);
		ResumeThread(clock_thread);

		if (FALSE == done_once) {
			done_once = TRUE;
			lock_thread_to_processor(GetCurrentThread());
			atexit( StopClockThread );
		}

		/*
		 * Give the clock thread time to fill its counter/time
		 * sample buffer.  This will underfill the buffer a
		 * bit for sample periods over 43 msec.
		 */
		Sleep(BASELINES_USED * 43);
	}
}


void 
StopClockThread(void)
{
	/*
	 * if the clock thread exit()s this routine
	 * will be called on the clock thread and
	 * we need not (and can't) use the normal
	 * TimerThreadExitRequest event.
	 */
	if (GetCurrentThreadId() != clock_thread_id) {

		if (!SetEvent(TimerThreadExitRequest) ||
		    WaitForSingleObject(clock_thread, 2 * 1000) != 
		    WAIT_OBJECT_0) {
			msyslog(LOG_ERR, "Failed to stop clock thread.");
		}
	}
	CloseHandle(TimerThreadExitRequest);
	TimerThreadExitRequest = NULL;
	CloseHandle(clock_thread);
	clock_thread = NULL;
}


void
lock_thread_to_processor(HANDLE thread)
{
	static	DWORD_PTR	ProcessAffinityMask;
	static	DWORD_PTR	ThreadAffinityMask;
	DWORD_PTR		SystemAffinityMask;
	char			*cputext;
	unsigned int		cpu;

	if ( ! winnt_time_initialized) {
		DPRINTF(1, ("init_winnt_time() must be called before "
				"lock_thread_to_processor(), exiting\n"));
		exit(-1);
	}

	if ( ! winnt_use_interpolation)
		return;
	
	if (-1 == lock_interp_threads) {
		DPRINTF(1, ("choose_interp_counter() is not called "
			    "before lock_thread_to_processor()\n"));
		exit(-1);
	} else if (!lock_interp_threads)
		return;

	/*
	 * Calculate the ThreadAffinityMask we'll use once on the
	 * first invocation.
	 */
	if ( ! ProcessAffinityMask) {

		/*
		 * Choose which processor to nail the main and clock threads to.
		 * If we have more than one, we simply choose the 2nd.
		 * Randomly choosing from 2 to n would be better, but in
		 * either case with clock and network interrupts more likely
		 * to be serviced by the first procecssor, let's stay away 
		 * from it.  QueryPerformanceCounter is not necessarily
		 * consistent across CPUs, hence the need to nail the two
		 * threads involved in QPC-based interpolation to the same
		 * CPU.
		 */

		GetProcessAffinityMask(
			GetCurrentProcess(), 
			&ProcessAffinityMask,
			&SystemAffinityMask);

		/*
		 * respect NTPD_CPU environment variable if present
		 * for testing.  NTPD_CPU=0 means use all CPUs, 1-64
		 * means lock threads involved in interpolation to
		 * that CPU.  Default to 2nd if more than 1.
		 */

		cpu = 2;
		cputext = getenv("NTPD_CPU");
		if (cputext) {
			cpu = (unsigned int) atoi(cputext);
			cpu = min((8 * sizeof(DWORD_PTR)), cpu);
		}

		/* 
		 * Clear all bits except the 2nd.  If we have only one proc
		 * that leaves ThreadAffinityMask zeroed and we won't bother
		 * with SetThreadAffinityMask.
		 */

		ThreadAffinityMask = (0 == cpu) ? 0 : (1 << (cpu - 1));

		if (ThreadAffinityMask && 
			!(ThreadAffinityMask & ProcessAffinityMask)) 

			DPRINTF(1, ("Selected CPU %u (mask %x) is outside "
					"process mask %x, using all CPUs.\n",
					cpu, ThreadAffinityMask, 
					ProcessAffinityMask));
		else
			DPRINTF(1, ("Wiring to processor %u (0 means all) "
					"affinity mask %x\n",	
					cpu, ThreadAffinityMask));

		ThreadAffinityMask &= ProcessAffinityMask;
	}

	if (ThreadAffinityMask && 
	    !SetThreadAffinityMask(thread, ThreadAffinityMask))

		msyslog(LOG_ERR, 
			"Unable to wire thread to mask %x: %m\n", 
			ThreadAffinityMask);
}


#ifdef HAVE_PPSAPI
/*
 * helper routine for serial PPS which returns QueryPerformanceCounter
 * timestamp and needs to interpolate it to an NTP timestamp.
 */
void 
pps_ntp_timestamp_from_counter(
	ntp_fp_t	*result, 
	ULONGLONG	Timestamp, 
	ULONGLONG	Counterstamp
	)
{
	/*
	 * convert between equivalent l_fp and PPSAPI ntp_fp_t
	 */
	ntp_timestamp_from_counter(
		(l_fp *)result,
		Timestamp,
		Counterstamp);
}


void 
ntp_timestamp_from_counter(
	l_fp *result, 
	ULONGLONG Timestamp, 
	ULONGLONG Counterstamp
	)
{
#ifdef DEBUG
	FT_ULL		Now;
#endif
	ULONGLONG	InterpTimestamp;

	if (winnt_use_interpolation) {
		InterpTimestamp = interp_time(Counterstamp + QPC_offset, FALSE);

#ifdef DEBUG
		/* sanity check timestamp is within 1 minute of now */
		GetSystemTimeAsFileTime(&Now.ft);
		Now.ll -= InterpTimestamp;
		if (debug &&
		    Now.ll > 60 * HECTONANOSECONDS || 
		    Now.ll < -60 * (LONGLONG) HECTONANOSECONDS) {
			DPRINTF(1, ("ntp_timestamp_from_counter interpolated time %.6fs from current\n",
					Now.ll / (double)LL_HNS));
			DPRINTF(1, ("interpol time %llx from  %llx\n",
					InterpTimestamp,
					Counterstamp));
			msyslog(LOG_ERR,
				"ntp_timestamp_from_counter interpolated time %.6fs from current\n",
				Now.ll / (double)LL_HNS);
			exit(-1);
		}
#endif
	} else {  /* ! winnt_use_interpolation */
		/* have to simply use the driver's system time timestamp */
		InterpTimestamp = Timestamp;
#ifdef DEBUG
		/* sanity check timestamp is within 1 minute of now */
		GetSystemTimeAsFileTime(&Now.ft);
		Now.ll -= InterpTimestamp;
		if (Now.ll > 60 * HECTONANOSECONDS || 
		    Now.ll < -60 * (LONGLONG) HECTONANOSECONDS) {
			DPRINTF(1, ("ntp_timestamp_from_counter serial driver system time %.6fs from current\n",
				    Now.ll / (double)LL_HNS));
			msyslog(LOG_ERR,
				"ntp_timestamp_from_counter serial driver system time %.6fs from current\n",
				Now.ll / (double)LL_HNS);
			exit(-1);
		}
#endif
	}

	/* convert from 100ns units to NTP fixed point format */

	InterpTimestamp -= FILETIME_1970;
	result->l_ui = JAN_1970 + (u_int32)(InterpTimestamp / HECTONANOSECONDS);
	result->l_uf = (u_int32)((InterpTimestamp % HECTONANOSECONDS) *
				 (ULONGLONG)FRAC / HECTONANOSECONDS);
}
#endif  /* HAVE_PPSAPI */


void 
time_stepped(void)
{
	/*
	 * called back by ntp_set_tod after the system
	 * time has been stepped (set).
	 *
	 * We normally prevent the reported time from going backwards
	 * but need to allow it in this case.
	 */
	if (FALSE == winnt_use_interpolation)
		return;


	/*
	 * Restart the clock thread to get a new baseline
	 * time/counter correlation.
	 */
	StopClockThread();

	/*
	 * newest_baseline_gen is a generation counter
	 * incremented once each time newest_baseline
	 * is reset.
	 */
	newest_baseline_gen++;

	last_interp_time = 
		clock_backward_max = 
		clock_backward_count = 
		newest_baseline = 0;

	memset(baseline_counts, 0, sizeof(baseline_counts));
	memset(baseline_times, 0, sizeof(baseline_times));

	StartClockThread();
}


/*
 * log2ull - log base 2 of a unsigned 64-bit number
 */
int 
log2ull(
	ULONGLONG n
	)
{
	const ULONGLONG one = 1;
	int log = 0;

	if (n >= one<<32) { n >>= 32; log += 32; }
	if (n >= one<<16) { n >>= 16; log += 16; }
	if (n >= one<< 8) { n >>=  8; log +=  8; }
	if (n >= one<< 4) { n >>=  4; log +=  4; }
	if (n >= one<< 2) { n >>=  2; log +=  2; }
	if (n >= one<< 1) {	      log +=  1; }

	return (n) ? log : (-1);
}


/*
 * ctr_freq_timer_fired is called once a few seconds before
 * tune_ctr_period seconds have elapsed, to reset the timer
 * and hopefully minimize error due to the system using the
 * nominal performance counter frequency to set the timer
 * internally, which is typically dozens of PPM from the
 * actual performance counter rate.  A few seconds later
 * it is called again to observe the counter and estimate the
 * counter frequency.
 */
static void CALLBACK
ctr_freq_timer_fired(
	LPVOID arg,
	DWORD dwTimeLow,
	DWORD dwTimeHigh
	)
{
	static	FT_ULL		begin_time = {0};
	static	FT_ULL		begin_count = {0};
	static	ULONGLONG	next_period_time = 0;
	static	ULONGLONG	report_systemtime = 0;
	const	ULONGLONG	five_minutes = 5ui64 * 60 * HECTONANOSECONDS;
	FT_ULL			now_time;
	FT_ULL			now_count;

	if (!begin_time.ull) {
		begin_count.ull = perf_ctr();
		begin_time.ft.dwLowDateTime = dwTimeLow;
		begin_time.ft.dwHighDateTime = dwTimeHigh;

		/*
		 * adapt perf ctr observation interval to the
		 * counter frequency
		 */
		tune_ctr_period = 22680 / log2ull(NomPerfCtrFreq);

		/*
		 * reset timer 2s before period ends to minimize
		 * error from OS timer routines using nominal 
		 * performance frequency internally.
		 */
		tune_ctr_freq_max_interval = tune_ctr_period - 2;

		next_period_time = begin_time.ull + 
			(ULONGLONG)tune_ctr_period * HECTONANOSECONDS;

		ROUND_TO_NEXT_SEC_BOTTOM(next_period_time);

		reset_ctr_freq_timer(next_period_time, begin_time.ull);

		return;
	}

	now_time.ft.dwLowDateTime = dwTimeLow;
	now_time.ft.dwHighDateTime = dwTimeHigh;

	if (now_time.ull >= next_period_time) {

		now_count.ull = perf_ctr();
		tune_ctr_freq(
			now_count.ull - begin_count.ull,
			now_time.ull - begin_time.ull);

		next_period_time += (ULONGLONG)tune_ctr_period * HECTONANOSECONDS;
		begin_count.ull = now_count.ull;
		begin_time.ull = now_time.ull;
	}

	/* 
	 * Log clock backward events no more often than 5 minutes.
	 */
	if (!report_systemtime) 

		report_systemtime = now_time.ull + five_minutes;

	else if (report_systemtime <= now_time.ull) {

		report_systemtime +=  five_minutes;

		if (clock_backward_count) {
			msyslog(LOG_WARNING, 
				"clock would have gone backward %d times, "
				"max %.1f usec",
				clock_backward_count, 
				(LONGLONG)clock_backward_max / 10.);

			clock_backward_max = clock_backward_count = 0;
		}
	}

	reset_ctr_freq_timer(next_period_time, now_time.ull);
}


void
reset_ctr_freq_timer_abs(
	ULONGLONG when
	)
{
	FT_ULL	fire_time;

	fire_time.ull = when; 

	SetWaitableTimer(
		ctr_freq_timer,
		&fire_time.li,		/* first fire */
		0,			/* not periodic */
		ctr_freq_timer_fired,	/* callback routine */
		NULL,			/* context for callback */
		FALSE);			/* do not interfere with power saving */
}


void
reset_ctr_freq_timer(
	ULONGLONG when,
	ULONGLONG now
	)
{
	if (when - now > 
	    (tune_ctr_freq_max_interval * HECTONANOSECONDS + HECTONANOSECONDS))

		when = now + tune_ctr_freq_max_interval * HECTONANOSECONDS;

	reset_ctr_freq_timer_abs(when);
}


void
start_ctr_freq_timer(
	ULONGLONG now_time
	)
{
	ULONGLONG when;

	ctr_freq_timer = CreateWaitableTimer(NULL, FALSE, NULL);

	when = now_time;
	ROUND_TO_NEXT_SEC_BOTTOM(when);

	reset_ctr_freq_timer_abs(when);
}


/*
 * tune_ctr_freq is called once per tune_ctr_period seconds
 * with a counter difference and time difference.
 */
void 
tune_ctr_freq(
	LONGLONG ctr_delta,
	LONGLONG time_delta
	)
{
	static unsigned count = 0;
	static unsigned dispcount = 0;
	static unsigned report_at_count = 0;
	static int disbelieved = 0;
	static int i = 0;
	static double nom_freq = 0;
	static LONGLONG diffs[TUNE_CTR_DEPTH] = {0};
	static LONGLONG sum = 0;

	LONGLONG delta;
	LONGLONG deltadiff;
	ULONGLONG ObsPerfCtrFreq;
	double obs_freq;
	double this_freq;
	int isneg;

	/* one-time initialization */
	if (!report_at_count) {
		report_at_count = 24 * 60 * 60 / tune_ctr_period;
		nom_freq = (LONGLONG)NomPerfCtrFreq / 1e6;
	}

	/* delta is the per-second observed frequency this time */
	delta = (LONGLONG)((double)ctr_delta * HECTONANOSECONDS /
			   time_delta);

	/* disbelieve any delta more than +/- 976 PPM from nominal */
	deltadiff = delta - NomPerfCtrFreq;
	if (0 > deltadiff) {
		isneg = 1;
		deltadiff = -deltadiff;
	} else
		isneg = 0;

	if ((ULONGLONG)deltadiff > (NomPerfCtrFreq / 1024)) {
		disbelieved++;
		dispcount++;
#ifdef DEBUG
		msyslog(LOG_DEBUG, "ctr delta %s%lld exceeds limit %llu",
				   (isneg) ? "-" : "",
				   deltadiff,
				   NomPerfCtrFreq / 1024);
#endif
	} else {

		/*
		 * collect average over TUNE_CTR_DEPTH samples
		 * for our PerfCtrFreq trimming.
		 */

		if (isneg)
			deltadiff = -deltadiff;
		sum -= diffs[i];
		diffs[i] = deltadiff;
		sum += deltadiff;
		i = (i + 1) % COUNTOF(diffs);
		count++;
		dispcount++;
	}

	this_freq = delta / 1e6;

	ObsPerfCtrFreq = NomPerfCtrFreq + (sum / COUNTOF(diffs));

#if 1	/* #if 0 to disable changing freq used */
	/* get rid of ObsPerfCtrFreq when removing the #ifdef */
	PerfCtrFreq = ObsPerfCtrFreq;
#endif
	obs_freq = (LONGLONG)ObsPerfCtrFreq / 1e6;

	/* 
	 * report observed ctr freq each time the estimate used during
	 * startup moves toward the observed freq from the nominal, 
	 * and once a day afterward.
	 */

	if (count > COUNTOF(diffs) &&
	    /* (count % COUNTOF(diffs)) && */	/* enables reporting each */
	    dispcount < report_at_count)	/* TUNE_CTR_DEPTH samples */
		return;

	NLOG(NLOG_CLOCKINFO)
		if (count <= COUNTOF(diffs))
			/* moving to observed freq. from nominal (startup) */
			msyslog(LOG_INFO,
				(obs_freq > 100)
				 ? "ctr %.3f MHz %+6.2f PPM using "
				       "%.3f MHz %+6.2f PPM"
				 : "ctr %.6f MHz %+6.2f PPM using "
				       "%.6f MHz %+6.2f PPM",
				this_freq,
				1e6 * (this_freq - nom_freq) / nom_freq,
				obs_freq, 
				1e6 * (obs_freq - nom_freq) / nom_freq);
		else
			/* steady state */
			msyslog(LOG_INFO,
				(obs_freq > 100)
				 ? "ctr %.3f MHz %+.2f PPM"
				 : "ctr %.6f MHz %+.2f PPM",
				obs_freq, 
				1e6 * (obs_freq - nom_freq) / nom_freq);

	if (disbelieved) {
		msyslog(LOG_ERR, 
			"%d ctr samples exceed +/- 976 PPM range gate",
			disbelieved);
		disbelieved = 0;
	}

	dispcount = 0;
}


/*
 * add_counter_time_pair is called by the
 * high priority clock thread with each new
 * baseline counter/time correlation.
 */
void
add_counter_time_pair(
	ULONGLONG ctr,
	LONGLONG time
	)
{
	int i;

	i = (newest_baseline + 1) % BASELINES_TOT;

	baseline_counts[i] = ctr;
	baseline_times[i] = time;

	newest_baseline = i;
}


/*
 * interp_time estimates NT time in 100ns units
 * based on a performance counter value given.
 * This must tolerate recent historical counters
 * as well as current.  When current is FALSE
 * we can't assume ctr is the latest/highest
 * seen.
 */
ULONGLONG
interp_time(
	ULONGLONG ctr,
	BOOL current
	)
{
	static __declspec(thread) int		last_newest = -1;
	static __declspec(thread) int		last_newest_gen;
	static __declspec(thread) int		best_index;
	ULONGLONG	this_ctr;
	LONGLONG	this_time;
	LONGLONG	latest_time;
	LONGLONG	ctr_diff;
	int		i;
	int		i_gen;
	int		c;

	/*
	 * Use the system time (roughly synchronised to the tick, and
	 * extrapolated using the system performance counter.
	 *
	 * Cache the results per thread and only repeat the
	 * calculation when new data has arrived.
	 */
	i = newest_baseline;
	i_gen = newest_baseline_gen;

	if (last_newest == i && last_newest_gen == i_gen) {
		this_time = baseline_times[best_index];
		ctr_diff = ctr - baseline_counts[best_index];
		this_time += (LONGLONG)PERF2HNS((double)ctr_diff);

		return this_time;
	}

	last_newest = i;
	last_newest_gen = i_gen;

	latest_time = 0;

	/*
	 * Run through the history calculating the interpolated 
	 * time based on each counter/time correlation in turn,
	 * and believe the latest one.  This is akin to the NTP
	 * protocol minimum delay clock filter.  Errors due to 
	 * counter/time correlations with stale time are all 
	 * negative.
	 */
	for (c = 0; c < BASELINES_USED; c++) {
		 if (baseline_times[i]) {
			this_time = baseline_times[i];
			this_ctr = baseline_counts[i];

			ctr_diff = ctr - this_ctr;

			if (current && ctr_diff < 0) {
				/* 
				 * The performance counter apparently went 
				 * backwards without rolling over.  It might 
				 * be nice to complain but we don't want 
				 * to do it repeatedly.
				 */
				ctr_diff = 0;
			}

			this_time += (LONGLONG)PERF2HNS((double)ctr_diff);

			if (this_time > latest_time) {
				latest_time = this_time;
				best_index = i;
			}
		}
		i = i ? (i - 1) : (BASELINES_TOT - 1);
	}

	return latest_time;
}
ntp-4.2.6p5/ports/winnt/ntpd/ntservice.c0000644000175000017500000001763211474355436017257 0ustar  peterpeter/*
 * Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
 * Copyright (C) 1999-2002  Internet Software Consortium.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

/* $Id: ntservice.c,v 1.3.2.1.10.3 2004/03/08 04:04:22 marka Exp $ */

#ifdef HAVE_CONFIG_H
# include 
#endif

#include 

#include 
#include 
#include "syslog.h"
#include "ntservice.h"
#include "clockstuff.h"
#include "ntp_iocompletionport.h"
#include "isc/win32os.h"
#include 


/*
 * Globals
 */
static SERVICE_STATUS_HANDLE hServiceStatus = 0;
static BOOL foreground = FALSE;
static BOOL computer_shutting_down = FALSE;
static int glb_argc;
static char **glb_argv;
HANDLE hServDoneEvent = NULL;
extern volatile int debug;
extern int accept_wildcard_if_for_winnt;

/*
 * Forward declarations
 */
void uninit_io_completion_port();
int ntpdmain(int argc, char *argv[]);
void WINAPI ServiceControl(DWORD dwCtrlCode);
void ntservice_exit(void);

#ifdef WRAP_DBG_MALLOC
void *wrap_dbg_malloc(size_t s, const char *f, int l);
void *wrap_dbg_realloc(void *p, size_t s, const char *f, int l);
void wrap_dbg_free(void *p);
#endif

void WINAPI service_main( DWORD argc, LPTSTR *argv )
{
	if ( argc > 1 )
	{
		/*
		 * Let command line parameters from the Windows SCM GUI
		 * override the standard parameters from the ImagePath registry key.
		 */
		glb_argc = argc;
		glb_argv = argv;
	}

	ntpdmain( glb_argc, glb_argv );
}


/*
 * This is the entry point for the executable 
 * We can call ntpdmain() explicitly or via StartServiceCtrlDispatcher()
 * as we need to.
 */
int main( int argc, char *argv[] )
{
	int rc;
	int i = 1;


	ssl_applink();

	/* Save the command line parameters */
	glb_argc = argc;
	glb_argv = argv;

	/* Under original Windows NT we must not discard the wildcard */
	/* socket to workaround a bug in NT's getsockname(). */
	if (isc_win32os_majorversion() <= 4)
		accept_wildcard_if_for_winnt = TRUE;

	/*
	 * This is a hack in the Windows port of ntpd.  Before the
	 * portable ntpd libopts processing of the command line, we
	 * need to know if we're "daemonizing" (attempting to start as
	 * a service).  There is undoubtedly a better way.  Legitimate
	 * option combinations are broken by this code , such as:
	 *   ntpd -nc debug.conf
	 */
	while (argv[i]) {
		if (!_strnicmp(argv[i], "-d", 2)
		    || !strcmp(argv[i], "--debug_level")
		    || !strcmp(argv[i], "--set-debug_level")
		    || !strcmp(argv[i], "-q")
		    || !strcmp(argv[i], "--quit")
		    || !strcmp(argv[i], "-?")
		    || !strcmp(argv[i], "--help")
		    || !_strnicmp(argv[i], "-n", 2)
		    || !strcmp(argv[i], "--nofork")
		    || !strcmp(argv[i], "--saveconfigquit")) {
			foreground = TRUE;
			break;
		}
		i++;
	}

	if (foreground)			/* run in console window */
		rc = ntpdmain(argc, argv);
	else {
		/* Start up as service */

		SERVICE_TABLE_ENTRY dispatchTable[] = {
			{ TEXT(NTP_DISPLAY_NAME), service_main },
			{ NULL, NULL }
		};

		rc = StartServiceCtrlDispatcher(dispatchTable);
		if (rc)
			rc = 0; 
		else {
			rc = GetLastError();
#ifdef DEBUG
			fprintf(stderr, "%s: unable to start as service, rc: %i\n\n", argv[0], rc);
#endif
			fprintf(stderr, "\nUse -d, -q, --help or -n to run from the command line.\n");
		}
	}
	return rc;
}

/*
 * Initialize the Service by registering it.
 */
void
ntservice_init() {
	char ConsoleTitle[256];

	if (!foreground) {
		/* Register handler with the SCM */
		hServiceStatus = RegisterServiceCtrlHandler(NTP_DISPLAY_NAME,
					ServiceControl);
		if (!hServiceStatus) {
			NTReportError(NTP_SERVICE_NAME,
				"could not register service control handler");
			exit(1);
		}
		UpdateSCM(SERVICE_RUNNING);
	} else {
		strcpy(ConsoleTitle, "NTP Version ");
		strcat(ConsoleTitle, Version);
		SetConsoleTitle(ConsoleTitle);
	}

#ifdef _CRTDBG_MAP_ALLOC
		/* ask the runtime to dump memory leaks at exit */
		_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF
			       | _CRTDBG_LEAK_CHECK_DF		/* report on leaks at exit */
			       | _CRTDBG_CHECK_ALWAYS_DF	/* Check heap every alloc/dealloc */
#ifdef MALLOC_LINT
			       | _CRTDBG_DELAY_FREE_MEM_DF	/* Don't actually free memory */
#endif
			       );
#ifdef DOES_NOT_WORK
			/*
			 * hart: I haven't seen this work, running ntpd.exe -n from a shell
			 * to both a file and the debugger output window.  Docs indicate it
			 * should cause leak report to go to stderr, but it's only seen if
			 * ntpd runs under a debugger (in the debugger's output), even with
			 * this block of code enabled.
			 */
			_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
			_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
#endif
#endif /* using MS debug C runtime heap, _CRTDBG_MAP_ALLOC */

	atexit( ntservice_exit );
}

/*
 * Routine to check if this is a service or a foreground program
 */
BOOL
ntservice_isservice() {
	return(!foreground);
}

/*
 * Routine to check if the service is stopping
 * because the computer is shutting down
 */
BOOL
ntservice_systemisshuttingdown() {
	return computer_shutting_down;
}

void
ntservice_exit( void )
{
	uninit_io_completion_port();
	Sleep( 200 );  	//##++ 

	reset_winnt_time();

	msyslog(LOG_INFO, "ntservice: The Network Time Protocol Service is stopping.");

	if (!foreground) {
		/* service mode, need to have the service_main routine
		 * register with the service control manager that the 
		 * service has stopped running, before exiting
		 */
		UpdateSCM(SERVICE_STOPPED);
	}
}

/* 
 * ServiceControl(): Handles requests from the SCM and passes them on
 * to the service.
 */
void WINAPI
ServiceControl(DWORD dwCtrlCode) {
	/* Handle the requested control code */
	HANDLE exitEvent = get_exit_event();

	switch(dwCtrlCode) {

	case SERVICE_CONTROL_SHUTDOWN:
		computer_shutting_down = TRUE;
		/* fall through to stop case */

	case SERVICE_CONTROL_STOP:
		if (exitEvent != NULL) {
			SetEvent(exitEvent);
			UpdateSCM(SERVICE_STOP_PENDING);
			Sleep( 100 );  //##++
		}
		return;

	case SERVICE_CONTROL_PAUSE:
	case SERVICE_CONTROL_CONTINUE:
	case SERVICE_CONTROL_INTERROGATE:
	default:
		break;
	}
	UpdateSCM(SERVICE_RUNNING);
}

/*
 * Tell the Service Control Manager the state of the service.
 */
void UpdateSCM(DWORD state) {
	SERVICE_STATUS ss;
	static DWORD dwState = SERVICE_STOPPED;

	if (hServiceStatus) {
		if (state)
			dwState = state;

		memset(&ss, 0, sizeof(SERVICE_STATUS));
		ss.dwServiceType |= SERVICE_WIN32_OWN_PROCESS;
		ss.dwCurrentState = dwState;
		ss.dwControlsAccepted = SERVICE_ACCEPT_STOP |
					SERVICE_ACCEPT_SHUTDOWN;
		ss.dwCheckPoint = 0;
		ss.dwServiceSpecificExitCode = 0;
		ss.dwWin32ExitCode = NO_ERROR;
		ss.dwWaitHint = dwState == SERVICE_STOP_PENDING ? 5000 : 1000;

		SetServiceStatus(hServiceStatus, &ss);
	}
}

BOOL WINAPI 
OnConsoleEvent(  
	DWORD dwCtrlType
	)
{
	HANDLE exitEvent = get_exit_event();

	switch (dwCtrlType) {
#ifdef DEBUG
		case CTRL_BREAK_EVENT:
			if (debug > 0) {
				debug <<= 1;
			}
			else {
				debug = 1;
			}
			if (debug > 8) {
				debug = 0;
			}
			msyslog(LOG_DEBUG, "debug level %d", debug);
			break;
#else
		case CTRL_BREAK_EVENT:
			break;
#endif

		case CTRL_C_EVENT:
		case CTRL_CLOSE_EVENT:
		case CTRL_SHUTDOWN_EVENT:
			if (exitEvent != NULL) {
				SetEvent(exitEvent);
				Sleep( 100 );  //##++
			}
			break;

		default :
			/* pass to next handler */
			return FALSE; 
	}

	/* we've handled it, no more handlers should be called */
	return TRUE;
}

ntp-4.2.6p5/ports/winnt/ntpd/refclock_trimbledc.h0000644000175000017500000000457710017034600021056 0ustar  peterpeter/*
 * refclock_trimbledc - clock driver for the Trimble Data Collector compatible
 * GPS receivers (4000, 4700, 4800, 7400, ...)
 *
 * Greg Brackley (greg@trimble.co.nz)
 */

#ifndef _REFCLOCK_TRIMBLEDC_H
#define _REFCLOCK_TRIMBLEDC_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#if defined HAVE_SYS_MODEM_H
#include 
#define TIOCMSET MCSETA
#define TIOCMGET MCGETA
#define TIOCM_RTS MRTS
#endif

#ifdef HAVE_TERMIOS_H
#include 
#endif

#ifdef HAVE_SYS_IOCTL_H
#include 
#endif

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_control.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"

/*
 * GPS Definitions
 */
#define	DESCRIPTION	"Trimble Data Collector GPS" /* Long name */
#define	PRECISION	(-20)	/* precision assumed (about 1 us) */
#define	REFID		"GPS\0"	/* reference ID */
#define NSAMPLES		1
#define NSKEEP			1
#define TRIMBLEDC_MINPOLL	4
#define TRIMBLEDC_MAXPOLL	4

/*
 * I/O Definitions
 */
#if !defined SYS_WINNT
#define	DEVICE		"/dev/trimbledc%d" 	/* device name and unit */
#else
#define	DEVICE		"\\\\.\\COM%d" 		/* device name and unit */
#endif
#define	SPEED232	B9600		  	/* uart speed (9600 baud) */

#define POLL_AVG	10  /* number of samples to average code delay */
#define DC_IO_BUFSIZE	512 /* IO buffer */
#define DC_MAXLEN	260  /* maximum length TSIP packet */

/* 
 * Leap-Insert and Leap-Delete are encoded as follows:
 * 	PALISADE_UTC_TIME set   and PALISADE_LEAP_PENDING set: INSERT leap
 * 	PALISADE_UTC_TIME clear and PALISADE_LEAP_PENDING set: DELETE leap
 */

#define PALISADE_LEAP_WARNING    0x04 /* GPS Leap Warning (see ICD-200) */
#define PALISADE_LEAP_PENDING    0x02 /* Leap Pending (24 hours) */
#define PALISADE_UTC_TIME        0x01 /* UTC time available */

#define mb(_X_) (up->rpt_buf[(_X_ + 1)]) /* shortcut for buffer access */

/* Conversion Definitions */
#define GPS_PI 		(3.1415926535898)
#define	R2D		(180.0/GPS_PI)

typedef enum TrimbleDcParseState {

  TrimbleParseStateAck,
  TrimbleParseStateNak,
  TrimbleParseStateData,

} TrimbleDcParseState;

struct trimbledc_unit {
	int		unit;		/* NTP refclock unit number */
	int 		polled;		/* flag to detect noreplies */
	char		leap_status;	/* leap second flag */
	TrimbleDcParseState		rpt_status;	
	short 		rpt_cnt;	
	char 		rpt_buf[DC_MAXLEN]; 	
	char		io_buf[DC_IO_BUFSIZE];
	short 		io_ptr[2];	/* 0 = head, 1 = tail */
};

#endif /* _REFCLOCK_TRIMBLEDC_H */
ntp-4.2.6p5/ports/winnt/ntpd/refclock_trimbledc.c0000644000175000017500000001350410017034600021037 0ustar  peterpeter#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#if defined(REFCLOCK) && defined(CLOCK_TRIMBLEDC)

#include "refclock_trimbledc.h"
extern int debug;

static	int	trimbledc_start		(int, struct peer *);
static	void	trimbledc_shutdown	(int, struct peer *);
static	void	trimbledc_receive	(struct recvbuf *);
static	void	trimbledc_poll		(int, struct peer *);
static	void	trimbledc_io		(char, int, unsigned char *, l_fp*, struct trimbledc_unit *);


/*
 * Transfer vector
 */
struct refclock refclock_trimbledc = {
	trimbledc_start,	/* start up driver */
	trimbledc_shutdown,	/* shut down driver */
	trimbledc_poll,		/* transmit poll message */
	noentry,		/* not used  */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used */
	NOFLAGS			/* not used */
};


/*
 * trimbledc_start - open the devices and initialize data for processing
 */
static int
trimbledc_start (
	int unit,
	struct peer *peer
	)
{
	register struct trimbledc_unit *up;
	struct refclockproc *pp;
	int fd;
	char gpsdev[20];

	struct termios tio;
#ifdef SYS_WINNT
	(void) sprintf(gpsdev, DEVICE, unit);
#else
	(void) sprintf(gpsdev, DEVICE, unit + 1);
#endif
	/*
	 * Open serial port. 
	 */
	fd = refclock_open(gpsdev, SPEED232, LDISC_RAW);
	if (fd == -1) {
		msyslog(LOG_ERR,"Trimble (%d) start: open %s failed: %m",
			unit, gpsdev);
		return 0;
	}

	msyslog(LOG_NOTICE, "Trimble (%d) fd: %d dev: %s", unit, fd, gpsdev);

        if (tcgetattr(fd, &tio) < 0) {
                msyslog(LOG_ERR, 
			"Trimble (%d) tcgetattr(fd, &tio): %m",unit);
                return (0);
        }

        tio.c_cflag |= (PARENB|PARODD);
        tio.c_iflag &= ~ICRNL;

	if (tcsetattr(fd, TCSANOW, &tio) == -1) {
                msyslog(LOG_ERR, "Trimble (%d) tcsetattr(fd, &tio): %m",unit);
                return 0;
        }

	/*
	 * Allocate and initialize unit structure
	 */
	if (!(up = (struct trimbledc_unit *)
	      emalloc(sizeof(struct trimbledc_unit)))) {
		(void) close(fd);
		return (0);
	}
	memset((char *)up, 0, sizeof(struct trimbledc_unit));

	pp = peer->procptr;
	pp->io.clock_recv = trimbledc_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;

	if (!io_addclock(&pp->io)) {
		(void) close(fd);
		free(up);
		return (0);
	}

	/*
	 * Initialize miscellaneous variables
	 */
	pp->unitptr = (caddr_t)up;
	pp->clockdesc = DESCRIPTION;

	peer->precision = PRECISION;
	peer->sstclktype = CTL_SST_TS_UHF;
	peer->minpoll = TRIMBLEDC_MINPOLL;
	peer->maxpoll = TRIMBLEDC_MAXPOLL;
	memcpy((char *)&pp->refid, REFID, 4);

	up->leap_status = 0;
	up->unit = unit;
	up->io_ptr[0] = up->io_ptr[1] = 0;

	return 1;
}


/*
 * trimbledc_shutdown - shut down the clock
 */
static void
trimbledc_shutdown (
	int unit,
	struct peer *peer
	)
{
	register struct trimbledc_unit *up;
	struct refclockproc *pp;
	pp = peer->procptr;
	up = (struct trimbledc_unit *)pp->unitptr;
	io_closeclock(&pp->io);
	free(up);
}



/* 
 * TSIP_decode - decode the TSIP data packets 
 */
static int
trimbledc_decode (
	struct peer *peer
	)
{
#ifdef DEBUG
	double lat, lon, alt;
#endif
	int st, ts;
	long   secint;
	double secs;
	double secfrac;
	unsigned short event = 0;

	register struct trimbledc_unit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct trimbledc_unit *)pp->unitptr;

	/*
	 * Check the time packet, decode its contents. 
	 * If the timecode has invalid length or is not in
	 * proper format, declare bad format and exit.
	 */

	if (up->rpt_buf[0] ==0x41) 
	/* standard time packet - GPS time and GPS week number */
		return 0;	


	refclock_report(peer, CEVNT_BADREPLY);
	up->polled = -1;
#ifdef DEBUG
	if (debug)
	printf("TRIMBLEDC_decode: unit %d: bad packet %02x-%02x event %d len %d\n", 
		   up->unit, up->rpt_buf[0] & 0xff, mb(0) & 0xff, 
			event, up->rpt_cnt);
#endif
	return 0;
}

/*
 * trimbledc__receive - receive data from the serial interface
 */

static void
trimbledc_receive (
	struct recvbuf *rbufp
	)
{
	register struct trimbledc_unit *up;
	struct refclockproc *pp;
	struct peer *peer;

	/*
	 * Initialize pointers and read the timecode and timestamp.
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct trimbledc_unit *)pp->unitptr;

	
	for (;FALSE;) {
		trimbledc_io(pp->sloppyclockflag & CLK_FLAG2, rbufp->recv_length,
			    &rbufp->recv_buffer, &pp->lastrec, up);       




		(void) sprintf(pp->a_lastcode,"%4d %03d %02d:%02d:%02d.%06ld",
				pp->year,pp->day,pp->hour,pp->minute, pp->second,pp->usec); 
				pp->lencode = 24;

		if (!refclock_process(pp)) {
			refclock_report(peer, CEVNT_BADTIME);

#ifdef DEBUG
			if (debug)
			printf("trimbledc_receive: unit %d: refclock_process failed!\n",
				up->unit);
#endif
			continue;
		}

		record_clock_stats(&peer->srcadr, pp->a_lastcode); 

#ifdef DEBUG
		if (debug)
			if (debug)
			printf("trimbledc_receive: unit %d: %s\n",
			   up->unit, prettydate(&pp->lastrec));
#endif

		refclock_receive(peer);
	}
}


/*
 * trimbledc_poll - called by the transmit procedure
 *
 */
static void
trimbledc_poll (
	int unit,
	struct peer *peer
	)
{
	struct trimbledc_unit *up;
	struct refclockproc *pp;
	
	pp = peer->procptr;
	up = (struct trimbledc_unit *)pp->unitptr;

	pp->polls++;
	if (up->polled > 0) /* last reply never arrived or error */ 
	    refclock_report(peer, CEVNT_TIMEOUT);

	up->polled = 2; /* synchronous packet + 1 event */
	
#ifdef DEBUG
	if (debug)
	    printf("trimbledc_poll: unit %d: polling %s\n", unit,
		   (pp->sloppyclockflag & CLK_FLAG2) ? 
			"synchronous packet" : "event");
#endif 

	if (pp->sloppyclockflag & CLK_FLAG2) 
	    return;  /* using synchronous packet input */

//	if (HW_poll(pp) < 0) 
	    refclock_report(peer, CEVNT_FAULT); 
}


static void
trimbledc_io (
	char noevents,
	int buflen,			/* bytes in buffer to process */
	unsigned char *bufp,		/* receive buffer */
	l_fp* t_in,			/* receive time stamp */
	struct trimbledc_unit *up	/* pointer to unit data structure   */
	)
{
	
}




#endif /* REFCLOCK */
ntp-4.2.6p5/ports/winnt/ntpd/ntp_iocompletionport.c0000644000175000017500000005413311474355435021540 0ustar  peterpeter#ifdef HAVE_CONFIG_H
# include 
#endif

#if defined (HAVE_IO_COMPLETION_PORT)

#include 
#include 
#include 
#include 

#include "ntp_stdlib.h"
#include "ntp_machine.h"
#include "ntp_fp.h"
#include "ntp.h"
#include "ntpd.h"
#include "ntp_refclock.h"
#include "ntp_iocompletionport.h"
#include "transmitbuff.h"
#include "ntp_request.h"
#include "ntp_assert.h"
#include "clockstuff.h"
#include "ntp_io.h"
#include "ntp_lists.h"
#include "clockstuff.h"

/*
 * Request types
 */
enum {
	SOCK_RECV,
	SOCK_SEND,
	SERIAL_WAIT,
	SERIAL_READ,
	SERIAL_WRITE
};

#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 201)		/* nonstd extension nameless union */
#endif

typedef struct IoCompletionInfo {
	OVERLAPPED		overlapped;	/* must be first */
	int			request_type;
	union {
		recvbuf_t *	recv_buf;
		transmitbuf_t *	trans_buf;
	};
#ifdef DEBUG
	struct IoCompletionInfo *link;
#endif
} IoCompletionInfo;

#ifdef _MSC_VER
# pragma warning(pop)
#endif

/*
 * local function definitions
 */
static int QueueSerialWait(struct refclockio *, recvbuf_t *buff, IoCompletionInfo *lpo, BOOL clear_timestamp);

static int OnSocketRecv(ULONG_PTR, IoCompletionInfo *, DWORD, int);
static int OnSerialWaitComplete(ULONG_PTR, IoCompletionInfo *, DWORD, int);
static int OnSerialReadComplete(ULONG_PTR, IoCompletionInfo *, DWORD, int);
static int OnWriteComplete(ULONG_PTR, IoCompletionInfo *, DWORD, int);

/* keep a list to traverse to free memory on debug builds */
#ifdef DEBUG
static void free_io_completion_port_mem(void);
IoCompletionInfo *	compl_info_list;
CRITICAL_SECTION	compl_info_lock;
#define LOCK_COMPL()	EnterCriticalSection(&compl_info_lock);
#define UNLOCK_COMPL()	LeaveCriticalSection(&compl_info_lock);
#endif

/* #define USE_HEAP */

#ifdef USE_HEAP
static HANDLE hHeapHandle = NULL;
#endif

static HANDLE hIoCompletionPort = NULL;

static HANDLE WaitableIoEventHandle = NULL;
static HANDLE WaitableExitEventHandle = NULL;

#ifdef NTPNEEDNAMEDHANDLE
#define WAITABLEIOEVENTHANDLE "WaitableIoEventHandle"
#else
#define WAITABLEIOEVENTHANDLE NULL
#endif

#define MAXHANDLES 3
HANDLE WaitHandles[MAXHANDLES] = { NULL, NULL, NULL };

IoCompletionInfo *
GetHeapAlloc(char *fromfunc)
{
	IoCompletionInfo *lpo;

#ifdef USE_HEAP
	lpo = HeapAlloc(hHeapHandle,
			HEAP_ZERO_MEMORY,
			sizeof(IoCompletionInfo));
#else
	lpo = emalloc(sizeof(*lpo));
	memset(lpo, 0, sizeof(*lpo));
#endif
	DPRINTF(3, ("Allocation %d memory for %s, ptr %x\n", sizeof(IoCompletionInfo), fromfunc, lpo));

#ifdef DEBUG
	LOCK_COMPL();
	LINK_SLIST(compl_info_list, lpo, link);
	UNLOCK_COMPL();
#endif

	return (lpo);
}

void
FreeHeap(IoCompletionInfo *lpo, char *fromfunc)
{
#ifdef DEBUG
	IoCompletionInfo *unlinked;

	DPRINTF(3, ("Freeing memory for %s, ptr %x\n", fromfunc, lpo));

	LOCK_COMPL();
	UNLINK_SLIST(unlinked, compl_info_list, lpo, link,
	    IoCompletionInfo);
	UNLOCK_COMPL();
#endif

#ifdef USE_HEAP
	HeapFree(hHeapHandle, 0, lpo);
#else
	free(lpo);
#endif
}

transmitbuf_t *
get_trans_buf()
{
	transmitbuf_t *tb  = emalloc(sizeof(*tb));
	return (tb);
}

void
free_trans_buf(transmitbuf_t *tb)
{
	free(tb);
}

HANDLE
get_io_event()
{
	return( WaitableIoEventHandle );
}
HANDLE
get_exit_event()
{
	return( WaitableExitEventHandle );
}

/*  This function will add an entry to the I/O completion port
 *  that will signal the I/O thread to exit (gracefully)
 */
static void
signal_io_completion_port_exit()
{
	if (!PostQueuedCompletionStatus(hIoCompletionPort, 0, 0, 0)) {
		msyslog(LOG_ERR, "Can't request service thread to exit: %m");
		exit(1);
	}
}

static unsigned WINAPI
iocompletionthread(void *NotUsed)
{
	BOOL bSuccess = FALSE;
	int errstatus = 0;
	DWORD BytesTransferred = 0;
	ULONG_PTR Key = 0;
	IoCompletionInfo * lpo = NULL;
	u_long time_next_ifscan_after_error = 0;

	UNUSED_ARG(NotUsed);

	/*
	 *	socket and refclock receive call gettimeofday()
	 *	so the I/O thread needs to be on the same 
	 *	processor as the main and timing threads
	 *	to ensure consistent QueryPerformanceCounter()
	 *	results.
	 */
	lock_thread_to_processor(GetCurrentThread());

	/*	Set the thread priority high enough so I/O will
	 *	preempt normal recv packet processing, but not
	 * 	higher than the timer sync thread.
	 */
	if (!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL)) {
		msyslog(LOG_ERR, "Can't set thread priority: %m");
	}

	while (TRUE) {
		bSuccess = GetQueuedCompletionStatus(
					hIoCompletionPort, 
					&BytesTransferred, 
					&Key, 
					(LPOVERLAPPED *) &lpo, 
					INFINITE);
		if (lpo == NULL)
		{
			DPRINTF(2, ("Overlapped IO Thread Exiting\n"));
			break; /* fail */
		}
		
		/*
		 * Deal with errors
		 */
		if (bSuccess)
			errstatus = 0;
		else
		{
			errstatus = GetLastError();
			if (BytesTransferred == 0)
			{
				if (WSA_OPERATION_ABORTED == errstatus) {
					DPRINTF(4, ("Transfer Operation aborted\n"));
				} else if (ERROR_UNEXP_NET_ERR == errstatus) {
					/*
					 * We get this error when trying to send an the network
					 * interface is gone or has lost link.  Rescan interfaces
					 * to catch on sooner, but no more than once per minute.
					 * Once ntp is able to detect changes without polling
					 * this should be unneccessary
					 */
					if (time_next_ifscan_after_error < current_time) {
						time_next_ifscan_after_error = current_time + 60;
						timer_interfacetimeout(current_time);
					}
					DPRINTF(4, ("sendto unexpected network error, interface may be down\n"));
				}
			}
			else
			{
				msyslog(LOG_ERR, "sendto error after %d bytes: %m", BytesTransferred);
			}
		}

		/*
		 * Invoke the appropriate function based on
		 * the value of the request_type
		 */
		switch(lpo->request_type)
		{
		case SERIAL_WAIT:
			OnSerialWaitComplete(Key, lpo, BytesTransferred, errstatus);
			break;
		case SERIAL_READ:
			OnSerialReadComplete(Key, lpo, BytesTransferred, errstatus);
			break;
		case SOCK_RECV:
			OnSocketRecv(Key, lpo, BytesTransferred, errstatus);
			break;
		case SOCK_SEND:
		case SERIAL_WRITE:
			OnWriteComplete(Key, lpo, BytesTransferred, errstatus);
			break;
		default:
			DPRINTF(1, ("Unknown request type %d found in completion port\n",
				    lpo->request_type));
			break;
		}
	}

	return 0;
}

/*  Create/initialise the I/O creation port
 */
void
init_io_completion_port(
	void
	)
{
	unsigned tid;
	HANDLE thread;

#ifdef DEBUG
	InitializeCriticalSection(&compl_info_lock);
	atexit(&free_io_completion_port_mem);
#endif

#ifdef USE_HEAP
	/*
	 * Create a handle to the Heap
	 */
	hHeapHandle = HeapCreate(0, 20*sizeof(IoCompletionInfo), 0);
	if (hHeapHandle == NULL)
	{
		msyslog(LOG_ERR, "Can't initialize Heap: %m");
		exit(1);
	}
#endif

#if 0	/* transmitbuff.c unused, no need to initialize it */
	init_transmitbuff();
#endif

	/* Create the event used to signal an IO event
	 */
	WaitableIoEventHandle = CreateEvent(NULL, FALSE, FALSE, WAITABLEIOEVENTHANDLE);
	if (WaitableIoEventHandle == NULL) {
		msyslog(LOG_ERR,
		"Can't create I/O event handle: %m - another process may be running - EXITING");
		exit(1);
	}
	/* Create the event used to signal an exit event
	 */
	WaitableExitEventHandle = CreateEvent(NULL, FALSE, FALSE, NULL);
	if (WaitableExitEventHandle == NULL) {
		msyslog(LOG_ERR,
		"Can't create exit event handle: %m - EXITING");
		exit(1);
	}

	/* Create the IO completion port
	 */
	hIoCompletionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
	if (hIoCompletionPort == NULL) {
		msyslog(LOG_ERR, "Can't create I/O completion port: %m");
		exit(1);
	}

	/*
	 * Initialize the Wait Handles
	 */
	WaitHandles[0] = WaitableIoEventHandle;
	WaitHandles[1] = WaitableExitEventHandle; /* exit request */
	WaitHandles[2] = get_timer_handle();

	/* Have one thread servicing I/O - there were 4, but this would 
	 * somehow cause NTP to stop replying to ntpq requests; TODO
 	 */
	thread = (HANDLE)_beginthreadex(
		NULL, 
		0, 
		iocompletionthread, 
		NULL, 
		CREATE_SUSPENDED, 
		&tid);
	ResumeThread(thread);
	CloseHandle(thread);
}
	

#ifdef DEBUG
static void
free_io_completion_port_mem(
	void
	)
{
	IoCompletionInfo *	pci;

#if defined(_MSC_VER) && defined (_DEBUG)
	_CrtCheckMemory();
#endif
	LOCK_COMPL();
	while ((pci = compl_info_list) != NULL) {

#if 0	/* sockaddr with received-from address in recvbuf */
	/* is sometimes modified by system after we free it  */
	/* triggering heap corruption warning -- find a */
	/* better way to free it after I/O is surely done */
		/* this handles both xmit and recv buffs */
		if (pci->recv_buf != NULL) {
			DPRINTF(1, ("freeing xmit/recv buff %p\n", pci->recv_buf));
			free(pci->recv_buf);
		}
#endif

		FreeHeap(pci, "free_io_completion_port_mem");
		/* FreeHeap() removed this item from compl_info_list */
	}
	UNLOCK_COMPL()

#if defined(_MSC_VER) && defined (_DEBUG)
	_CrtCheckMemory();
#endif
}
#endif	/* DEBUG */


void
uninit_io_completion_port(
	void
	)
{
	if (hIoCompletionPort != NULL) {
		/*  Get each of the service threads to exit
		*/
		signal_io_completion_port_exit();
	}
}


static int
QueueSerialWait(
	struct refclockio *	rio,
	recvbuf_t *		buff,
	IoCompletionInfo *	lpo,
	BOOL			clear_timestamp
	)
{
	lpo->request_type = SERIAL_WAIT;
	lpo->recv_buf = buff;

	if (clear_timestamp)
		memset(&buff->recv_time, 0, sizeof(buff->recv_time));

	buff->fd = _get_osfhandle(rio->fd);
	if (!WaitCommEvent((HANDLE) buff->fd, (DWORD *)&buff->recv_buffer, (LPOVERLAPPED) lpo)) {
		if (ERROR_IO_PENDING != GetLastError()) {
			msyslog(LOG_ERR, "Can't wait on Refclock: %m");
			freerecvbuf(buff);
			return 0;
		}
	}
	return 1;
}


static int 
OnSerialWaitComplete(ULONG_PTR i, IoCompletionInfo *lpo, DWORD Bytes, int errstatus)
{
	recvbuf_t *buff;
	struct refclockio * rio = (struct refclockio *) i;
	struct peer *pp;
	l_fp arrival_time;
	DWORD comm_mask;
	DWORD modem_status;
	static const l_fp zero_time = { 0 };
	BOOL rc;

	get_systime(&arrival_time);

	/*
	 * Get the recvbuf pointer from the overlapped buffer.
	 */
	buff = lpo->recv_buf;
	comm_mask = (*(DWORD *)&buff->recv_buffer);
#ifdef DEBUG
		if (errstatus || comm_mask & ~(EV_RXFLAG | EV_RLSD)) {
			msyslog(LOG_ERR, "WaitCommEvent returned unexpected mask %x errstatus %d",
				comm_mask, errstatus);
			exit(-1);
		}
#endif
		if (comm_mask & EV_RLSD) { 
			modem_status = 0;
			GetCommModemStatus((HANDLE)buff->fd, &modem_status);
			if (modem_status & MS_RLSD_ON) {
				/*
				 * Use the timestamp from this PPS CD not
				 * the later end of line.
				 */
				buff->recv_time = arrival_time;
			}

			if (!(comm_mask & EV_RXFLAG)) {
				/*
				 * if we didn't see an end of line yet
				 * issue another wait for it.
				 */
				QueueSerialWait(rio, buff, lpo, FALSE);
				return 1;
			}
		}

		/*
		 * We've detected the end of line of serial input.
		 * Use this timestamp unless we already have a CD PPS
		 * timestamp in buff->recv_time.
		 */
		if (memcmp(&buff->recv_time, &zero_time, sizeof buff->recv_time)) {
			/*
			 * We will first see a user PPS timestamp here on either
			 * the first or second line of text.  Log a one-time
			 * message while processing the second line.
			 */
			if (1 == rio->recvcount) {
				pp = (struct peer *)rio->srcclock;
				msyslog(LOG_NOTICE, "Using user-mode PPS timestamp for %s",
					refnumtoa(&pp->srcadr));
			}
		} else {
			buff->recv_time = arrival_time;
		}

		/*
		 * Now that we have a complete line waiting, read it.
		 * There is still a race here, but we're likely to win.
		 */

		lpo->request_type = SERIAL_READ;

		rc = ReadFile(
			(HANDLE)buff->fd,
			buff->recv_buffer,
			sizeof(buff->recv_buffer),
			NULL,
			(LPOVERLAPPED)lpo);

		if (!rc && ERROR_IO_PENDING != GetLastError()) {
			msyslog(LOG_ERR, "Can't read from Refclock: %m");
			freerecvbuf(buff);
			return 0;
		}

	return 1;
}

/* Return 1 on Successful Read */
static int 
OnSerialReadComplete(ULONG_PTR i, IoCompletionInfo *lpo, DWORD Bytes, int errstatus)
{
	recvbuf_t *		buff;
	l_fp			cr_time;
	struct refclockio *	rio;

	rio = (struct refclockio *)i;
	/*
	 * Get the recvbuf pointer from the overlapped buffer.
	 */
	buff = lpo->recv_buf;

	/*
	 * ignore 0 bytes read due to timeout's and closure on fd
	 */
	if (!errstatus && Bytes) {
		buff->recv_length = (int) Bytes;
		buff->receiver = rio->clock_recv;
		buff->dstadr = NULL;
		buff->recv_srcclock = rio->srcclock;
		packets_received++;
		/*
		 * Eat the first line of input as it's possibly
		 * partial and if a PPS is present, it may not 
		 * have fired since the port was opened.
		 */
		if (rio->recvcount++) {
			cr_time = buff->recv_time;
			add_full_recv_buffer(buff);
			/*
			 * Mimic Unix line discipline and assume CR/LF
			 * line termination.  On Unix the CR terminates
			 * the line containing the timecode, and
			 * immediately after the LF terminates an empty
			 * line.  So synthesize the empty LF-terminated
			 * line using the same CR timestamp.  Both CR
			 * and LF are stripped by refclock_gtlin().
			 */
			buff = get_free_recv_buffer_alloc();
			buff->recv_time = cr_time;
			buff->recv_length = 0;
			buff->fd = _get_osfhandle(rio->fd);
			buff->receiver = rio->clock_recv;
			buff->dstadr = NULL;
			buff->recv_srcclock = rio->srcclock;
			add_full_recv_buffer(buff);
			/*
			 * Now signal we have something to process
			 */
			SetEvent(WaitableIoEventHandle);
			buff = get_free_recv_buffer_alloc();
		}
	}

	QueueSerialWait(rio, buff, lpo, TRUE);

	return 1;
}

/*  Add a reference clock data structures I/O handles to
 *  the I/O completion port. Return 1 if any error.
 */  
int
io_completion_port_add_clock_io(
	struct refclockio *rio
	)
{
	IoCompletionInfo *lpo;
	recvbuf_t *buff;

	if (NULL == CreateIoCompletionPort(
			(HANDLE)_get_osfhandle(rio->fd), 
			hIoCompletionPort, 
			(ULONG_PTR)rio,
			0)) {
		msyslog(LOG_ERR, "Can't add COM port to i/o completion port: %m");
		return 1;
	}

	lpo = GetHeapAlloc("io_completion_port_add_clock_io");
	if (NULL == lpo) {
		msyslog(LOG_ERR, "Can't allocate heap for completion port: %m");
		return 1;
	}

	buff = get_free_recv_buffer_alloc();
	QueueSerialWait(rio, buff, lpo, TRUE);
	return 0;
}

/*
 * Queue a receiver on a socket. Returns 0 if no buffer can be queued 
 *
 *  Note: As per the winsock documentation, we use WSARecvFrom. Using
 *	  ReadFile() is less efficient.
 */
static unsigned long 
QueueSocketRecv(
	SOCKET s,
	recvbuf_t *buff,
	IoCompletionInfo *lpo
	)
{
	WSABUF wsabuf;
	DWORD Flags;
	DWORD Result;

	lpo->request_type = SOCK_RECV;
	lpo->recv_buf = buff;

	if (buff != NULL) {
		Flags = 0;
		buff->fd = s;
		buff->recv_srcadr_len = sizeof(buff->recv_srcadr);
		wsabuf.buf = (char *)buff->recv_buffer;
		wsabuf.len = sizeof(buff->recv_buffer);

		if (SOCKET_ERROR == WSARecvFrom(buff->fd, &wsabuf, 1, 
						NULL, &Flags, 
						&buff->recv_srcadr.sa, 
						&buff->recv_srcadr_len, 
						(LPOVERLAPPED)lpo, NULL)) {
			Result = GetLastError();
			switch (Result) {
				case NO_ERROR :
				case WSA_IO_PENDING :
					break ;

				case WSAENOTSOCK :
					msyslog(LOG_ERR, "Can't read from non-socket fd %d: %m", (int)buff->fd);
					/* return the buffer */
					freerecvbuf(buff);
					return 0;
					break;

				case WSAEFAULT :
					msyslog(LOG_ERR, "The buffers parameter is incorrect: %m");
					/* return the buffer */
					freerecvbuf(buff);
					return 0;
				break;

				default :
				  /* nop */ ;
			}
		}
	}
	else 
		return 0;
	return 1;
}


/* Returns 0 if any Error */
static int 
OnSocketRecv(ULONG_PTR i, IoCompletionInfo *lpo, DWORD Bytes, int errstatus)
{
	struct recvbuf *buff = NULL;
	recvbuf_t *newbuff;
	l_fp arrival_time;
	struct interface * inter = (struct interface *) i;
	
	get_systime(&arrival_time);

	NTP_REQUIRE(NULL != lpo);
	NTP_REQUIRE(NULL != lpo->recv_buf);

	/*
	 * Convert the overlapped pointer back to a recvbuf pointer.
	 */
	buff = lpo->recv_buf;

	/*
	 * If the socket is closed we get an Operation Aborted error
	 * Just clean up
	 */
	if (errstatus == WSA_OPERATION_ABORTED)
	{
		freerecvbuf(buff);
		lpo->recv_buf = NULL;
		FreeHeap(lpo, "OnSocketRecv: Socket Closed");
		return (1);
	}

	/*
	 * Get a new recv buffer for the replacement socket receive
	 */
	newbuff = get_free_recv_buffer_alloc();
	QueueSocketRecv(inter->fd, newbuff, lpo);

	DPRINTF(4, ("%sfd %d %s recv packet mode is %d\n", 
		    (MODE_BROADCAST == get_packet_mode(buff))
			? " **** Broadcast "
			: "",
		    (int)buff->fd, stoa(&buff->recv_srcadr),
		    get_packet_mode(buff)));

	/*
	 * If we keep it add some info to the structure
	 */
	if (Bytes && !inter->ignore_packets) {
		memcpy(&buff->recv_time, &arrival_time, sizeof buff->recv_time);	
		buff->recv_length = (int) Bytes;
		buff->receiver = receive; 
		buff->dstadr = inter;

		DPRINTF(2, ("Received %d bytes fd %d in buffer %p from %s\n", 
			    Bytes, (int)buff->fd, buff, stoa(&buff->recv_srcadr)));

		packets_received++;
		inter->received++;
		add_full_recv_buffer(buff);
		/*
		 * Now signal we have something to process
		 */
		SetEvent(WaitableIoEventHandle);
	} else
		freerecvbuf(buff);

	return 1;
}


/*  Add a socket handle to the I/O completion port, and send 
 *  NTP_RECVS_PER_SOCKET recv requests to the kernel.
 */
extern int
io_completion_port_add_socket(SOCKET fd, struct interface *inter)
{
	IoCompletionInfo *lpo;
	recvbuf_t *buff;
	int n;

	if (fd != INVALID_SOCKET) {
		if (NULL == CreateIoCompletionPort((HANDLE)fd, 
		    hIoCompletionPort, (ULONG_PTR)inter, 0)) {
			msyslog(LOG_ERR, "Can't add socket to i/o completion port: %m");
			return 1;
		}
	}

	/*
	 * Windows 2000 bluescreens with bugcheck 0x76
	 * PROCESS_HAS_LOCKED_PAGES at ntpd process
	 * termination when using more than one pending
	 * receive per socket.  A runtime version test
	 * would allow using more on newer versions
	 * of Windows.
	 */

#define WINDOWS_RECVS_PER_SOCKET 1

	for (n = 0; n < WINDOWS_RECVS_PER_SOCKET; n++) {

		buff = get_free_recv_buffer_alloc();
		lpo = (IoCompletionInfo *) GetHeapAlloc("io_completion_port_add_socket");
		if (lpo == NULL)
		{
			msyslog(LOG_ERR, "Can't allocate heap for completion port: %m");
			return 1;
		}

		QueueSocketRecv(fd, buff, lpo);

	}
	return 0;
}

static int 
OnWriteComplete(ULONG_PTR i, IoCompletionInfo *lpo, DWORD Bytes, int errstatus)
{
	transmitbuf_t *buff;
	struct interface *inter;

	UNUSED_ARG(Bytes);

	buff = lpo->trans_buf;

	free_trans_buf(buff);
	lpo->trans_buf = NULL;

	if (SOCK_SEND == lpo->request_type) {
		switch (errstatus) {
		case WSA_OPERATION_ABORTED:
		case NO_ERROR:
			break;

		default:
			inter = (struct interface *)i;
			packets_notsent++;
			inter->notsent++;
			break;
		}
	}

	if (errstatus == WSA_OPERATION_ABORTED)
		FreeHeap(lpo, "OnWriteComplete: Socket Closed");
	else
		FreeHeap(lpo, "OnWriteComplete");
	return 1;
}


/*
 * mimic sendto() interface
 */
int
io_completion_port_sendto(
	int		fd,
	void  *		pkt,
	size_t		len,
	sockaddr_u *	dest
	)
{
	WSABUF			wsabuf;
	transmitbuf_t *		buff;
	DWORD			Result;
	int			errval;
	int			AddrLen;
	IoCompletionInfo *	lpo;
	DWORD			Flags;

	Result = ERROR_SUCCESS;
	lpo = (IoCompletionInfo *)GetHeapAlloc("io_completion_port_sendto");
	if (lpo == NULL) {
		SetLastError(ERROR_OUTOFMEMORY);
		return -1;
	}

	if (len <= sizeof(buff->pkt)) {
		buff = get_trans_buf();

		if (buff == NULL) {
			msyslog(LOG_ERR, "No more transmit buffers left - data discarded");
			FreeHeap(lpo, "io_completion_port_sendto");
			SetLastError(ERROR_OUTOFMEMORY);
			return -1;
		}

		memcpy(&buff->pkt, pkt, len);
		wsabuf.buf = buff->pkt;
		wsabuf.len = len;

		AddrLen = SOCKLEN(dest);
		lpo->request_type = SOCK_SEND;
		lpo->trans_buf = buff;
		Flags = 0;

		Result = WSASendTo(fd, &wsabuf, 1, NULL, Flags,
				   &dest->sa, AddrLen,
				   (LPOVERLAPPED)lpo, NULL);
		if (Result == SOCKET_ERROR) {
			errval = WSAGetLastError();
			switch (errval) {

			case NO_ERROR :
			case WSA_IO_PENDING :
				Result = ERROR_SUCCESS;
				break ;

			/*
			 * Something bad happened
			 */
			default :
				msyslog(LOG_ERR,
					"WSASendTo(%s) error %d: %s",
					stoa(dest), errval, strerror(errval));
				free_trans_buf(buff);
				lpo->trans_buf = NULL;
				FreeHeap(lpo, "io_completion_port_sendto");
				break;
			}
		}
#ifdef DEBUG
		if (debug > 3)
			printf("WSASendTo - %d bytes to %s : %d\n", len, stoa(dest), Result);
#endif
		if (ERROR_SUCCESS == Result)
			return len;
		SetLastError(Result);
		return -1;
	} else {
#ifdef DEBUG
		if (debug) printf("Packet too large: %d Bytes\n", len);
#endif
		SetLastError(ERROR_INSUFFICIENT_BUFFER);
		return -1;
	}
}


/*
 * async_write, clone of write(), used by some reflock drivers
 */
int	
async_write(
	int fd,
	const void *data,
	unsigned int count
	)
{
	transmitbuf_t *buff;
	IoCompletionInfo *lpo;
	DWORD BytesWritten;

	if (count > sizeof buff->pkt) {
#ifdef DEBUG
		if (debug) {
			printf("async_write: %d bytes too large, limit is %d\n",
				count, sizeof buff->pkt);
			exit(-1);
		}
#endif
		errno = ENOMEM;
		return -1;
	}

	buff = get_trans_buf();
	lpo = (IoCompletionInfo *) GetHeapAlloc("async_write");

	if (! buff || ! lpo) {
		if (buff) {
			free_trans_buf(buff);
			DPRINTF(1, ("async_write: out of memory\n"));
		} else
			msyslog(LOG_ERR, "No more transmit buffers left - data discarded");

		errno = ENOMEM;
		return -1;
	}

	lpo->request_type = SERIAL_WRITE;
	lpo->trans_buf = buff;
	memcpy(&buff->pkt, data, count);

	if (!WriteFile((HANDLE)_get_osfhandle(fd), buff->pkt, count,
		&BytesWritten, (LPOVERLAPPED)lpo)
		&& ERROR_IO_PENDING != GetLastError()) {

		msyslog(LOG_ERR, "async_write - error %m");
		free_trans_buf(buff);
		lpo->trans_buf = NULL;
		FreeHeap(lpo, "async_write");
		errno = EBADF;
		return -1;
	}

	return count;
}


/*
 * GetReceivedBuffers
 * Note that this is in effect the main loop for processing requests
 * both send and receive. This should be reimplemented
 */
int GetReceivedBuffers()
{
	isc_boolean_t have_packet = ISC_FALSE;
	while (!have_packet) {
		DWORD Index = WaitForMultipleObjects(MAXHANDLES, WaitHandles, FALSE, INFINITE);
		switch (Index) {
		case WAIT_OBJECT_0 + 0 : /* Io event */
# ifdef DEBUG
			if ( debug > 3 )
			{
				printf( "IoEvent occurred\n" );
			}
# endif
			have_packet = ISC_TRUE;
			break;
		case WAIT_OBJECT_0 + 1 : /* exit request */
			exit(0);
			break;
		case WAIT_OBJECT_0 + 2 : /* timer */
			timer();
			break;
		case WAIT_IO_COMPLETION : /* loop */
		case WAIT_TIMEOUT :
			break;
		case WAIT_FAILED:
			msyslog(LOG_ERR, "ntpd: WaitForMultipleObjects Failed: Error: %m");
			break;

			/* For now do nothing if not expected */
		default:
			break;		
				
		} /* switch */
	}

	return (full_recvbuffs());	/* get received buffers */
}

#else
  static int NonEmptyCompilationUnit;
#endif

ntp-4.2.6p5/ports/winnt/ntpd/win32_io.c0000644000175000017500000002576311336477343016711 0ustar  peterpeter/* This file implements system calls that are not compatible with UNIX */

#include 
#include 
#include 
#include "ntp_machine.h"
#include "ntp_stdlib.h"
#include "ntp_syslog.h"
#include "ntp_assert.h"
#include "ntp_debug.h"
#include "ntp_fp.h"
#include "ntp.h"
#include "ntp_refclock.h"
#include "win32_io.h"

#define MAX_SERIAL 255	/* COM1: - COM255: */


/*
 * common_serial_open ensures duplicate opens of the same port
 * work by duplicating the handle for the 2nd open, allowing
 * refclock_atom to share a GPS refclock's comm port.
 */

HANDLE common_serial_open(
	char *	dev,
	char **	pwindev
	)
{
	static HANDLE *	hnds = NULL;	/* handle array */
	static int	c_hnd = 0;	/* current array size */
	static char	windev[32];	/* return pointer into this */
	HANDLE		handle;
	int		unit;
	int		prev_c_hnd;
	char *		pch;

	/*
	 * This is odd, but we'll take any unix device path
	 * by looking for the initial '/' and strip off everything
	 * before the final digits, then translate that to COM__:
	 * maintaining backward compatibility with NTP practice of
	 * mapping unit 0 to the nonfunctional COM0:
	 *
	 * To ease the job of taking the windows COMx: device names
	 * out of reference clocks, we'll also work with those
	 * equanimously.
	 */

	DPRINTF(1, ("common_serial_open given %s\n", dev));

	pch = NULL;
	if ('/' == dev[0]) {
		pch = dev + strlen(dev) - 1;

		//DPRINTF(1, ("common_serial_open initial %s\n", pch));
		if (isdigit(pch[0])) {
			while (isdigit(pch[0])) {
				pch--;
				//DPRINTF(1, ("common_serial_open backed up to %s\n", pch));
			}
			pch++;
		}
		DPRINTF(1, ("common_serial_open skipped to ending digits leaving %s\n", pch));
	} else if ('c' == tolower(dev[0])
		   && 'o' == tolower(dev[1])
		   && 'm' == tolower(dev[2])) {
		pch = dev + 3;
		DPRINTF(1, ("common_serial_open skipped COM leaving %s\n", pch));
	}

	if (!pch || !isdigit(pch[0])) {
		DPRINTF(1, ("not a digit: %s\n", pch ? pch : "[NULL]"));
		return INVALID_HANDLE_VALUE;
	}

	if (1 != sscanf(pch, "%d", &unit) 
	    || unit > MAX_SERIAL
	    || unit < 0) {
		DPRINTF(1, ("sscanf failure of %s\n", pch));
		return INVALID_HANDLE_VALUE;
	}


	if (c_hnd < unit + 1) {
		prev_c_hnd = c_hnd;
		c_hnd = unit + 1;
		/* round up to closest multiple of 4 to avoid churn */
		c_hnd = (c_hnd + 3) & ~3;
		hnds = erealloc(hnds, c_hnd * sizeof hnds[0]);
		memset(&hnds[prev_c_hnd], 0, 
		       (c_hnd - prev_c_hnd) * sizeof hnds[0]);
	}

	if (NULL == hnds[unit]) {
		snprintf(windev, sizeof(windev), "\\\\.\\COM%d", unit);
		DPRINTF(1, ("windows device %s\n", windev));
		*pwindev = windev;
		hnds[unit] = CreateFile(
				windev,
				GENERIC_READ | GENERIC_WRITE,
				0, /* sharing prohibited */
				NULL, /* default security */
				OPEN_EXISTING,
				FILE_ATTRIBUTE_NORMAL
				    | FILE_FLAG_OVERLAPPED,
				NULL);
	}

	if (INVALID_HANDLE_VALUE == hnds[unit]) {
		hnds[unit] = NULL;
		handle = INVALID_HANDLE_VALUE;
	} else
		DuplicateHandle(
			GetCurrentProcess(),
			hnds[unit],
			GetCurrentProcess(),
			&handle,
			0,
			FALSE,
			DUPLICATE_SAME_ACCESS
			);

	return handle;
}

/*
 * tty_open - open serial port for refclock special uses
 *
 * This routine opens a serial port for and returns the 
 * file descriptor if success and -1 if failure.
 */
int tty_open(
	char *dev,		/* device name pointer */
	int access,		/* O_RDWR */
	int mode		/* unused */
	)
{
	HANDLE	Handle;
	char *	windev;

	/*
	 * open communication port handle
	 */
	windev = NULL;
	Handle = common_serial_open(dev, &windev);
	windev = (windev) ? windev : dev;

	if (Handle == INVALID_HANDLE_VALUE) {  
		msyslog(LOG_ERR, "tty_open: device %s CreateFile error: %m", windev);
		errno = EMFILE; /* lie, lacking conversion from GetLastError() */
		return -1;
	}

	return (int) _open_osfhandle((int)Handle, _O_TEXT);
}

/*
 * refclock_open - open serial port for reference clock
 *
 * This routine opens a serial port for I/O and sets default options. It
 * returns the file descriptor or 0 indicating failure.
 */
int refclock_open(
	char *	dev,		/* device name pointer */
	u_int	speed,		/* serial port speed (code) */
	u_int	flags		/* line discipline flags */
	)
{
	char *		windev;
	HANDLE		h;
	COMMTIMEOUTS	timeouts;
	DCB		dcb;
	int		fd;

	/*
	 * open communication port handle
	 */
	windev = NULL;
	h = common_serial_open(dev, &windev);
	windev = (windev) ? windev : dev;

	if (INVALID_HANDLE_VALUE == h) {  
		msyslog(LOG_ERR, "Device %s CreateFile error: %m", windev);
		return 0;
	}

	/* Change the input/output buffers to be large. */
	if (!SetupComm(h, 1024, 1024)) {
		msyslog(LOG_ERR, "Device %s SetupComm error: %m", windev);
		return 0;
	}

	dcb.DCBlength = sizeof(dcb);

	if (!GetCommState(h, &dcb)) {
		msyslog(LOG_ERR, "Device %s GetCommState error: %m",
				 windev);
		return 0;
	}

	switch (speed) {

	case B300:
		dcb.BaudRate = 300;
		break;

	case B1200:  
		dcb.BaudRate = 1200;
		break;

	case B2400:
		dcb.BaudRate = 2400;
		break;

	case B4800:
		dcb.BaudRate = 4800;
		break;

	case B9600:
		dcb.BaudRate = 9600;
		break;

	case B19200:
		dcb.BaudRate = 19200;
		break;

	case B38400:
		dcb.BaudRate = 38400;
		break;

	case B57600:
		dcb.BaudRate = 57600;
		break;

	case B115200:
		dcb.BaudRate = 115200;
		break;

	default:
		msyslog(LOG_ERR, "Device %s unsupported baud rate "
				 "code %u", windev, speed);
		return 0;
	}


	dcb.fBinary = TRUE;
	dcb.fParity = TRUE;
	dcb.fOutxCtsFlow = 0;
	dcb.fOutxDsrFlow = 0;
	dcb.fDtrControl = DTR_CONTROL_DISABLE;
	dcb.fDsrSensitivity = 0;
	dcb.fTXContinueOnXoff = TRUE;
	dcb.fOutX = 0; 
	dcb.fInX = 0;
	dcb.fErrorChar = 0;
	dcb.fNull = 0;
	dcb.fRtsControl = RTS_CONTROL_DISABLE;
	dcb.fAbortOnError = 0;
	dcb.ByteSize = 8;
	dcb.StopBits = ONESTOPBIT;
	dcb.Parity = NOPARITY;
	dcb.ErrorChar = 0;
	dcb.EvtChar = 13; /* CR */
	dcb.EofChar = 0;

	if (!SetCommState(h, &dcb)) {
		msyslog(LOG_ERR, "Device %s SetCommState error: %m", windev);
		return 0;
	}

	/* watch out for CR (dcb.EvtChar) as well as the CD line */
	if (!SetCommMask(h, EV_RXFLAG | EV_RLSD)) {
		msyslog(LOG_ERR, "Device %s SetCommMask error: %m", windev);
		return 0;
	}

	/* configure the handle to never block */
	timeouts.ReadIntervalTimeout = MAXDWORD;
	timeouts.ReadTotalTimeoutMultiplier = 0;
	timeouts.ReadTotalTimeoutConstant = 0;
	timeouts.WriteTotalTimeoutMultiplier = 0;
	timeouts.WriteTotalTimeoutConstant = 0;

	if (!SetCommTimeouts(h, &timeouts)) {
		msyslog(LOG_ERR, "Device %s SetCommTimeouts error: %m", windev);
		return 0;
	}

	fd = _open_osfhandle((int)h, _O_TEXT);
	if (fd < 0)
		return 0;
	NTP_INSIST(fd != 0);
	return fd;
}


int
ioctl_tiocmget(
	HANDLE h,
	int *pi
	)
{
	DWORD	dw;

	if (!GetCommModemStatus(h, &dw)) {
		errno = ENOTTY;
		return -1;
	}

	*pi = ((dw & MS_CTS_ON)  ? TIOCM_CTS : 0)
	    | ((dw & MS_DSR_ON)  ? TIOCM_DSR : 0)
	    | ((dw & MS_RLSD_ON) ? TIOCM_CAR : 0)
	    | ((dw & MS_RING_ON) ? TIOCM_RI  : 0);

	return 0;
}


int
ioctl_tiocmset(
	HANDLE h,
	int *pi
	)
{
	BOOL	failed;
	int	result;
	
	failed = EscapeCommFunction(
			h, 
			(*pi & TIOCM_RTS) 
			    ? SETRTS
			    : CLRRTS
			);

	if (!failed)
		failed = EscapeCommFunction(
				h, 
				(*pi & TIOCM_DTR) 
				    ? SETDTR
				    : CLRDTR
				);

	if (failed) {
		errno = ENOTTY;
		result = -1;
	} else
		result = 0;

	return result;
}


int 
ioctl(
	int fd,
	int op,
	int *pi
	)
{
	HANDLE	h;
	int	result;
	
	h = (HANDLE)_get_osfhandle(fd);

	if (INVALID_HANDLE_VALUE == h) {
		/* errno already set */
		return -1;
	}

	switch (op) {

	case TIOCMGET:
		result = ioctl_tiocmget(h, pi);
		break;

	case TIOCMSET:
		result = ioctl_tiocmset(h, pi);
		break;

	default:
		errno = EINVAL;
		result = -1;
	}

	return result;
}


int	
tcsetattr(
	int			fd, 
	int			optional_actions, 
	const struct termios *	tios
	)
{
	DCB dcb;
	HANDLE h;

	UNUSED_ARG(optional_actions);

	h = (HANDLE)_get_osfhandle(fd);

	if (INVALID_HANDLE_VALUE == h) {
		/* errno already set */
		return -1;
	}

	dcb.DCBlength = sizeof(dcb);
	if (!GetCommState(h, &dcb)) {
		errno = ENOTTY;
		return -1;
	}

	switch (max(tios->c_ospeed, tios->c_ispeed)) {

	case B300:
		dcb.BaudRate = 300;
		break;

	case B1200:
		dcb.BaudRate = 1200;
		break;

	case B2400:
		dcb.BaudRate = 2400;
		break;

	case B4800:
		dcb.BaudRate = 4800;
		break;

	case B9600:
		dcb.BaudRate = 9600;
		break;

	case B19200:
		dcb.BaudRate = 19200;
		break;

	case B38400:
		dcb.BaudRate = 38400;
		break;

	case B57600:
		dcb.BaudRate = 57600;
		break;

	case B115200:
		dcb.BaudRate = 115200;
		break;

	default:
		msyslog(LOG_ERR, "unsupported serial baud rate");
		errno = EINVAL;
		return -1;
	}

	switch (tios->c_cflag & CSIZE) {

	case CS5:
		dcb.ByteSize = 5;
		break;

	case CS6:
		dcb.ByteSize = 6;
		break;

	case CS7:
		dcb.ByteSize = 7;
		break;

	case CS8:
		dcb.ByteSize = 8;
		break;

	default:
		msyslog(LOG_ERR, "unsupported serial word size");
		errno = EINVAL;
		return FALSE;
	}

	if (PARENB & tios->c_cflag) {
		dcb.fParity = TRUE;
		dcb.Parity = (tios->c_cflag & PARODD)
				? ODDPARITY
				: EVENPARITY;
	} else {
		dcb.fParity = FALSE;
		dcb.Parity = NOPARITY;
	}

	dcb.StopBits = (CSTOPB & tios->c_cflag)
			? TWOSTOPBITS
			: ONESTOPBIT;

	if (!SetCommState(h, &dcb)) {
		errno = ENOTTY;
		return -1;
	}

	return 0;
}


int
tcgetattr(
	int		fd,
	struct termios *tios
	)
{
	DCB	dcb;
	HANDLE	h;

	h = (HANDLE)_get_osfhandle(fd);

	if (INVALID_HANDLE_VALUE == h) {
		/* errno already set */
		return -1;
	}

	dcb.DCBlength = sizeof(dcb);

	if (!GetCommState(h, &dcb)) {
		errno = ENOTTY;
		return -1;
	}

	/*  Set c_ispeed & c_ospeed */

	switch (dcb.BaudRate) {

	case 300:
		tios->c_ispeed = tios->c_ospeed = B300;
		break;

	case 1200: 
		tios->c_ispeed = tios->c_ospeed = B1200;
		break;

	case 2400:
		tios->c_ispeed = tios->c_ospeed = B2400;
		break;

	case 4800: 
		tios->c_ispeed = tios->c_ospeed = B4800;
		break;

	case 9600:
		tios->c_ispeed = tios->c_ospeed = B9600;
		break;

	case 19200:
		tios->c_ispeed = tios->c_ospeed = B19200;
		break;

	case 38400:
		tios->c_ispeed = tios->c_ospeed = B38400;
		break;

	case 57600:
		tios->c_ispeed = tios->c_ospeed = B57600;
		break;

	case 115200:
		tios->c_ispeed = tios->c_ospeed = B115200;
		break;

	default:
		tios->c_ispeed = tios->c_ospeed = B9600;
	}
	

	switch (dcb.ByteSize) {
		case 5:
			tios->c_cflag = CS5;
			break;

		case 6:
			tios->c_cflag = CS6;
			break;

		case 7: 
			tios->c_cflag = CS7; 
			break;

		case 8:
		default:
			tios->c_cflag = CS8;
	}

	if (dcb.fParity) {
		tios->c_cflag |= PARENB;

		if (ODDPARITY == dcb.Parity)
			tios->c_cflag |= PARODD;
	}

	if (TWOSTOPBITS == dcb.StopBits)
		tios->c_cflag |= CSTOPB;

	tios->c_iflag = 0;
	tios->c_lflag = 0;
	tios->c_line = 0;
	tios->c_oflag = 0;

	return 0;
}


int
tcflush(
	int fd,
	int mode
	)
{
	HANDLE	h;
	BOOL	success;
	DWORD	flags;
	int	result;

	h = (HANDLE)_get_osfhandle(fd);

	if (INVALID_HANDLE_VALUE == h) {
		/* errno already set */
		return -1;
	}

	switch (mode) {

	case TCIFLUSH:
		flags = PURGE_RXCLEAR;
		break;

	case TCOFLUSH:
		flags = PURGE_TXABORT;
		break;

	case TCIOFLUSH:
		flags = PURGE_RXCLEAR | PURGE_TXABORT;
		break;

	default:
		errno = EINVAL;
		return -1;
	}

	success = PurgeComm(h, flags);

	if (success)
		result = 0;
	else {
		errno = ENOTTY;
		result = -1;
	}

	return result;
}

ntp-4.2.6p5/ports/winnt/vs2005/0000755000175000017500000000000011675461367015076 5ustar  peterpeterntp-4.2.6p5/ports/winnt/vs2005/ntpdate.vcproj0000644000175000017500000001552711307651603017756 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
		
		
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2005/Instsrv.vcproj0000644000175000017500000001274711307651603017770 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
		
		
		
		
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2005/libntp.vcproj0000644000175000017500000014050211505336022017572 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
		
		
			
				
					
				
				
					
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2005/ntpd.vcproj0000644000175000017500000013660011474355436017272 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
		
		
			
			
		
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
				
			
			
				
			
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2005/ntp.sln0000644000175000017500000001002711307651603016377 0ustar  peterpeter
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "instsrv", "Instsrv.vcproj", "{EAA8D0C8-A8AF-4C40-BF14-4A94570DE033}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libntp", "libntp.vcproj", "{ECDDC7EE-5805-4603-B38D-804C09BDC910}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpd", "ntpd.vcproj", "{F6F7E7C0-AE5E-4D7C-A17E-A3043FE68664}"
	ProjectSection(ProjectDependencies) = postProject
		{ECDDC7EE-5805-4603-B38D-804C09BDC910} = {ECDDC7EE-5805-4603-B38D-804C09BDC910}
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpdate", "ntpdate.vcproj", "{9BF928B1-8A1A-4A0D-BE6D-38EDAD29F416}"
	ProjectSection(ProjectDependencies) = postProject
		{ECDDC7EE-5805-4603-B38D-804C09BDC910} = {ECDDC7EE-5805-4603-B38D-804C09BDC910}
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpdc", "ntpdc.vcproj", "{C82634BB-AC80-4796-B2AF-2903C665ED17}"
	ProjectSection(ProjectDependencies) = postProject
		{ECDDC7EE-5805-4603-B38D-804C09BDC910} = {ECDDC7EE-5805-4603-B38D-804C09BDC910}
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpkeygen", "ntpkeygen.vcproj", "{9B768B99-2BC8-4A4C-AC0D-A7DA9C695825}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpq", "ntpq.vcproj", "{EA10E04E-946B-44A6-B0AB-B5B93A160744}"
	ProjectSection(ProjectDependencies) = postProject
		{ECDDC7EE-5805-4603-B38D-804C09BDC910} = {ECDDC7EE-5805-4603-B38D-804C09BDC910}
	EndProjectSection
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Win32 = Debug|Win32
		Release|Win32 = Release|Win32
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{EAA8D0C8-A8AF-4C40-BF14-4A94570DE033}.Debug|Win32.ActiveCfg = Debug|Win32
		{EAA8D0C8-A8AF-4C40-BF14-4A94570DE033}.Debug|Win32.Build.0 = Debug|Win32
		{EAA8D0C8-A8AF-4C40-BF14-4A94570DE033}.Release|Win32.ActiveCfg = Release|Win32
		{EAA8D0C8-A8AF-4C40-BF14-4A94570DE033}.Release|Win32.Build.0 = Release|Win32
		{ECDDC7EE-5805-4603-B38D-804C09BDC910}.Debug|Win32.ActiveCfg = Debug|Win32
		{ECDDC7EE-5805-4603-B38D-804C09BDC910}.Debug|Win32.Build.0 = Debug|Win32
		{ECDDC7EE-5805-4603-B38D-804C09BDC910}.Release|Win32.ActiveCfg = Release|Win32
		{ECDDC7EE-5805-4603-B38D-804C09BDC910}.Release|Win32.Build.0 = Release|Win32
		{F6F7E7C0-AE5E-4D7C-A17E-A3043FE68664}.Debug|Win32.ActiveCfg = Debug|Win32
		{F6F7E7C0-AE5E-4D7C-A17E-A3043FE68664}.Debug|Win32.Build.0 = Debug|Win32
		{F6F7E7C0-AE5E-4D7C-A17E-A3043FE68664}.Release|Win32.ActiveCfg = Release|Win32
		{F6F7E7C0-AE5E-4D7C-A17E-A3043FE68664}.Release|Win32.Build.0 = Release|Win32
		{9BF928B1-8A1A-4A0D-BE6D-38EDAD29F416}.Debug|Win32.ActiveCfg = Debug|Win32
		{9BF928B1-8A1A-4A0D-BE6D-38EDAD29F416}.Debug|Win32.Build.0 = Debug|Win32
		{9BF928B1-8A1A-4A0D-BE6D-38EDAD29F416}.Release|Win32.ActiveCfg = Release|Win32
		{9BF928B1-8A1A-4A0D-BE6D-38EDAD29F416}.Release|Win32.Build.0 = Release|Win32
		{C82634BB-AC80-4796-B2AF-2903C665ED17}.Debug|Win32.ActiveCfg = Debug|Win32
		{C82634BB-AC80-4796-B2AF-2903C665ED17}.Debug|Win32.Build.0 = Debug|Win32
		{C82634BB-AC80-4796-B2AF-2903C665ED17}.Release|Win32.ActiveCfg = Release|Win32
		{C82634BB-AC80-4796-B2AF-2903C665ED17}.Release|Win32.Build.0 = Release|Win32
		{9B768B99-2BC8-4A4C-AC0D-A7DA9C695825}.Debug|Win32.ActiveCfg = Debug|Win32
		{9B768B99-2BC8-4A4C-AC0D-A7DA9C695825}.Debug|Win32.Build.0 = Debug|Win32
		{9B768B99-2BC8-4A4C-AC0D-A7DA9C695825}.Release|Win32.ActiveCfg = Release|Win32
		{9B768B99-2BC8-4A4C-AC0D-A7DA9C695825}.Release|Win32.Build.0 = Release|Win32
		{EA10E04E-946B-44A6-B0AB-B5B93A160744}.Debug|Win32.ActiveCfg = Debug|Win32
		{EA10E04E-946B-44A6-B0AB-B5B93A160744}.Debug|Win32.Build.0 = Debug|Win32
		{EA10E04E-946B-44A6-B0AB-B5B93A160744}.Release|Win32.ActiveCfg = Release|Win32
		{EA10E04E-946B-44A6-B0AB-B5B93A160744}.Release|Win32.Build.0 = Release|Win32
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal
ntp-4.2.6p5/ports/winnt/vs2005/ntpkeygen.vcproj0000644000175000017500000002150211505336024020306 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
		
		
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2005/ntpq.vcproj0000644000175000017500000001731611474355435017310 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
		
		
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2005/ntpdc.vcproj0000644000175000017500000001736211474355436017440 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
		
		
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2008/0000755000175000017500000000000011675461367015101 5ustar  peterpeterntp-4.2.6p5/ports/winnt/vs2008/instsrv/0000755000175000017500000000000011675461367016611 5ustar  peterpeterntp-4.2.6p5/ports/winnt/vs2008/instsrv/instsrv.vcproj0000644000175000017500000001315511307651616021541 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
		
		
		
		
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2008/ntp-keygen/0000755000175000017500000000000011675461367017162 5ustar  peterpeterntp-4.2.6p5/ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj0000644000175000017500000001761411505336022022456 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
		
		
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2008/ntpd/0000755000175000017500000000000011675461367016046 5ustar  peterpeterntp-4.2.6p5/ports/winnt/vs2008/ntpd/ntpd.vcproj0000644000175000017500000013761211505336022020227 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
		
		
			
			
		
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
			
			
				
					
				
				
					
				
			
			
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
				
			
			
				
			
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2008/ntp.sln0000644000175000017500000001035411307651616016411 0ustar  peterpeter
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpd", "ntpd\ntpd.vcproj", "{CB61F8BF-9637-495C-9087-E8664B400CE0}"
	ProjectSection(ProjectDependencies) = postProject
		{400FBFCB-462E-40D0-B06B-3B74E3FFFD00} = {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "instsrv", "instsrv\instsrv.vcproj", "{C3534C4D-6DF1-498E-9904-4337878A1515}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libntp", "libntp\libntp.vcproj", "{400FBFCB-462E-40D0-B06B-3B74E3FFFD00}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpdate", "ntpdate\ntpdate.vcproj", "{2789A62E-3F46-44F1-AAF0-816CD23C2911}"
	ProjectSection(ProjectDependencies) = postProject
		{400FBFCB-462E-40D0-B06B-3B74E3FFFD00} = {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpdc", "ntpdc\ntpdc.vcproj", "{8011C820-B3D5-4034-86EA-FFC30AE6764B}"
	ProjectSection(ProjectDependencies) = postProject
		{400FBFCB-462E-40D0-B06B-3B74E3FFFD00} = {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntp-keygen", "ntp-keygen\ntp-keygen.vcproj", "{C88C1FBF-59D2-447F-BF57-0BCA8889028F}"
	ProjectSection(ProjectDependencies) = postProject
		{400FBFCB-462E-40D0-B06B-3B74E3FFFD00} = {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpq", "ntpq\ntpq.vcproj", "{6A92BF14-8931-48B1-A571-DEBE9F190616}"
	ProjectSection(ProjectDependencies) = postProject
		{400FBFCB-462E-40D0-B06B-3B74E3FFFD00} = {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}
	EndProjectSection
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Win32 = Debug|Win32
		Release|Win32 = Release|Win32
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{C3534C4D-6DF1-498E-9904-4337878A1515}.Debug|Win32.ActiveCfg = Debug|Win32
		{C3534C4D-6DF1-498E-9904-4337878A1515}.Debug|Win32.Build.0 = Debug|Win32
		{C3534C4D-6DF1-498E-9904-4337878A1515}.Release|Win32.ActiveCfg = Release|Win32
		{C3534C4D-6DF1-498E-9904-4337878A1515}.Release|Win32.Build.0 = Release|Win32
		{400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Debug|Win32.ActiveCfg = Debug|Win32
		{400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Debug|Win32.Build.0 = Debug|Win32
		{400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Release|Win32.ActiveCfg = Release|Win32
		{400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Release|Win32.Build.0 = Release|Win32
		{CB61F8BF-9637-495C-9087-E8664B400CE0}.Debug|Win32.ActiveCfg = Debug|Win32
		{CB61F8BF-9637-495C-9087-E8664B400CE0}.Debug|Win32.Build.0 = Debug|Win32
		{CB61F8BF-9637-495C-9087-E8664B400CE0}.Release|Win32.ActiveCfg = Release|Win32
		{CB61F8BF-9637-495C-9087-E8664B400CE0}.Release|Win32.Build.0 = Release|Win32
		{2789A62E-3F46-44F1-AAF0-816CD23C2911}.Debug|Win32.ActiveCfg = Debug|Win32
		{2789A62E-3F46-44F1-AAF0-816CD23C2911}.Debug|Win32.Build.0 = Debug|Win32
		{2789A62E-3F46-44F1-AAF0-816CD23C2911}.Release|Win32.ActiveCfg = Release|Win32
		{2789A62E-3F46-44F1-AAF0-816CD23C2911}.Release|Win32.Build.0 = Release|Win32
		{8011C820-B3D5-4034-86EA-FFC30AE6764B}.Debug|Win32.ActiveCfg = Debug|Win32
		{8011C820-B3D5-4034-86EA-FFC30AE6764B}.Debug|Win32.Build.0 = Debug|Win32
		{8011C820-B3D5-4034-86EA-FFC30AE6764B}.Release|Win32.ActiveCfg = Release|Win32
		{8011C820-B3D5-4034-86EA-FFC30AE6764B}.Release|Win32.Build.0 = Release|Win32
		{C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Debug|Win32.ActiveCfg = Debug|Win32
		{C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Debug|Win32.Build.0 = Debug|Win32
		{C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Release|Win32.ActiveCfg = Release|Win32
		{C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Release|Win32.Build.0 = Release|Win32
		{6A92BF14-8931-48B1-A571-DEBE9F190616}.Debug|Win32.ActiveCfg = Debug|Win32
		{6A92BF14-8931-48B1-A571-DEBE9F190616}.Debug|Win32.Build.0 = Debug|Win32
		{6A92BF14-8931-48B1-A571-DEBE9F190616}.Release|Win32.ActiveCfg = Release|Win32
		{6A92BF14-8931-48B1-A571-DEBE9F190616}.Release|Win32.Build.0 = Release|Win32
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal
ntp-4.2.6p5/ports/winnt/vs2008/ntpdate/0000755000175000017500000000000011675461367016540 5ustar  peterpeterntp-4.2.6p5/ports/winnt/vs2008/ntpdate/ntpdate.vcproj0000644000175000017500000002027511307651616021420 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2008/ntpq/0000755000175000017500000000000011675461367016063 5ustar  peterpeterntp-4.2.6p5/ports/winnt/vs2008/ntpq/ntpq.vcproj0000644000175000017500000002026411474355436020272 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
			
			
		
		
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2008/ntpdc/0000755000175000017500000000000011675461367016211 5ustar  peterpeterntp-4.2.6p5/ports/winnt/vs2008/ntpdc/ntpdc.vcproj0000644000175000017500000002066511474355436020553 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
			
				
					
				
				
					
				
			
		
		
			
			
			
			
			
			
		
		
		
		
			
				
			
			
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vs2008/libntp/0000755000175000017500000000000011675461367016371 5ustar  peterpeterntp-4.2.6p5/ports/winnt/vs2008/libntp/libntp.vcproj0000644000175000017500000004321711505336023021073 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
		
		
			
				
					
				
				
					
				
			
		
	
	
	

ntp-4.2.6p5/ports/winnt/vc6/0000755000175000017500000000000011675461367014635 5ustar  peterpeterntp-4.2.6p5/ports/winnt/vc6/ntpdate.dsp0000644000175000017500000001277411307651603017001 0ustar  peterpeter# Microsoft Developer Studio Project File - Name="ntpdate" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Console Application" 0x0103

CFG=ntpdate - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE 
!MESSAGE NMAKE /f "ntpdate.mak".
!MESSAGE 
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE /f "ntpdate.mak" CFG="ntpdate - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "ntpdate - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ntpdate - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE 

# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/ntp/dev/ports/winnt/ntpdate", OWBAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
RSC=rc.exe

!IF  "$(CFG)" == "ntpdate - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ntpdate\Release"
# PROP BASE Intermediate_Dir "ntpdate\Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ntpdate\Release"
# PROP Intermediate_Dir "ntpdate\Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W4 /GX /O2 /I "." /I "..\include" /I "..\..\..\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /I "$(OPENSSL_INC)" /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(OPENSSL_LIB)\libeay32.lib /nologo /subsystem:console /pdb:"bin/Release/ntpdate.pdb" /machine:I386 /out:"bin/Release/ntpdate.exe" /pdbtype:sept

!ELSEIF  "$(CFG)" == "ntpdate - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "ntpdate\Debug"
# PROP BASE Intermediate_Dir "ntpdate\Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "ntpdate\Debug"
# PROP Intermediate_Dir "ntpdate\Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "." /I "..\include" /I "..\..\..\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /I "$(OPENSSL_INC)" /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(OPENSSL_LIB)\libeay32.lib /nologo /subsystem:console /pdb:"bin/Debug/ntpdate.pdb" /debug /machine:I386 /out:"bin/Debug/ntpdate.exe" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none

!ENDIF 

# Begin Target

# Name "ntpdate - Win32 Release"
# Name "ntpdate - Win32 Debug"
# Begin Group "Source Files"

# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File

SOURCE=..\..\..\ntpdate\ntpdate.c
# End Source File
# Begin Source File

SOURCE=.\version.c
# End Source File
# End Group
# Begin Group "Header Files"

# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File

SOURCE=..\..\..\ntpdate\ntpdate.h
# End Source File
# End Group
# Begin Group "Resource Files"

# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# Begin Source File

SOURCE=..\..\..\configure

!IF  "$(CFG)" == "ntpdate - Win32 Release"

# Begin Custom Build
ProjDir=.
InputPath=..\..\..\configure

"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
	echo Using NT Shell Script to generate version.c 
	..\scripts\mkver.bat -P ntpdate 
	
# End Custom Build

!ELSEIF  "$(CFG)" == "ntpdate - Win32 Debug"

# Begin Custom Build
ProjDir=.
InputPath=..\..\..\configure

"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
	echo Using NT Shell Script to generate version.c 
	..\scripts\mkver.bat -P ntpdate 
	
# End Custom Build

!ENDIF 

# End Source File
# End Target
# End Project
ntp-4.2.6p5/ports/winnt/vc6/ntp.dsw0000644000175000017500000000374311307651604016147 0ustar  peterpeterMicrosoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!

###############################################################################

Project: "instsrv"=".\Instsrv.dsp" - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Project: "libntp"=".\libntp.dsp" - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Project: "ntpd"=".\ntpd.dsp" - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
    Begin Project Dependency
    Project_Dep_Name libntp
    End Project Dependency
}}}

###############################################################################

Project: "ntpdate"=".\ntpdate.dsp" - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
    Begin Project Dependency
    Project_Dep_Name libntp
    End Project Dependency
}}}

###############################################################################

Project: "ntpdc"=".\ntpdc.dsp" - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
    Begin Project Dependency
    Project_Dep_Name libntp
    End Project Dependency
}}}

###############################################################################

Project: "ntpkeygen"=".\ntpkeygen.dsp" - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Project: "ntpq"=".\ntpq.dsp" - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
    Begin Project Dependency
    Project_Dep_Name libntp
    End Project Dependency
}}}

###############################################################################

Global:

Package=<5>
{{{
}}}

Package=<3>
{{{
}}}

###############################################################################

ntp-4.2.6p5/ports/winnt/vc6/ntpq.dsp0000644000175000017500000001312111474355435016320 0ustar  peterpeter# Microsoft Developer Studio Project File - Name="ntpq" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Console Application" 0x0103

CFG=ntpq - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE 
!MESSAGE NMAKE /f "ntpq.mak".
!MESSAGE 
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE /f "ntpq.mak" CFG="ntpq - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "ntpq - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ntpq - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE 

# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/ntp/dev/ports/winnt/ntpq", WWBAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
RSC=rc.exe

!IF  "$(CFG)" == "ntpq - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ntpq\Release"
# PROP BASE Intermediate_Dir "ntpq\Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ntpq\Release"
# PROP Intermediate_Dir "ntpq\Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W4 /GX /O2 /I "." /I "..\include" /I "..\..\..\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /I "$(OPENSSL_INC)" /I "..\..\..\sntp\libopts" /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib ws2_32.lib advapi32.lib $(OPENSSL_LIB)\libeay32.lib /nologo /subsystem:console /pdb:"bin/Release/ntpq.pdb" /machine:I386 /out:"bin/Release/ntpq.exe" /pdbtype:sept

!ELSEIF  "$(CFG)" == "ntpq - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "ntpq\Debug"
# PROP BASE Intermediate_Dir "ntpq\Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "ntpq\Debug"
# PROP Intermediate_Dir "ntpq\Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "." /I "..\include" /I "..\..\..\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /I "$(OPENSSL_INC)" /I "..\..\..\sntp\libopts" /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib ws2_32.lib advapi32.lib $(OPENSSL_LIB)\libeay32.lib /nologo /subsystem:console /pdb:"bin/Debug/ntpq.pdb" /debug /machine:I386 /out:"bin/Debug/ntpq.exe" /pdbtype:sept

!ENDIF 

# Begin Target

# Name "ntpq - Win32 Release"
# Name "ntpq - Win32 Debug"
# Begin Group "Source Files"

# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File

SOURCE="..\..\..\ntpq\ntpq-opts.c"
# End Source File
# Begin Source File

SOURCE="..\..\..\ntpq\ntpq-subs.c"
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpq\ntpq.c
# End Source File
# Begin Source File

SOURCE=.\version.c
# End Source File
# End Group
# Begin Group "Header Files"

# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File

SOURCE=..\..\..\ntpq\ntpq.h
# End Source File
# End Group
# Begin Group "Resource Files"

# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# Begin Source File

SOURCE=..\..\..\configure

!IF  "$(CFG)" == "ntpq - Win32 Release"

# Begin Custom Build
ProjDir=.
InputPath=..\..\..\configure

"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
	echo Using NT Shell Script to generate version.c 
	..\scripts\mkver.bat -P ntpq 
	
# End Custom Build

!ELSEIF  "$(CFG)" == "ntpq - Win32 Debug"

# Begin Custom Build
ProjDir=.
InputPath=..\..\..\configure

"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
	echo Using NT Shell Script to generate version.c 
	..\scripts\mkver.bat -P ntpq 
	
# End Custom Build

!ENDIF 

# End Source File
# End Target
# End Project
ntp-4.2.6p5/ports/winnt/vc6/Instsrv.dsp0000644000175000017500000001067111327015213016775 0ustar  peterpeter# Microsoft Developer Studio Project File - Name="instsrv" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Console Application" 0x0103

CFG=instsrv - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE 
!MESSAGE NMAKE /f "Instsrv.mak".
!MESSAGE 
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE /f "Instsrv.mak" CFG="instsrv - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "instsrv - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "instsrv - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE 

# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/ntp/dev/ports/winnt/instsrv", VVBAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
RSC=rc.exe

!IF  "$(CFG)" == "instsrv - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "instsrv\Release"
# PROP BASE Intermediate_Dir "instsrv\Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "instsrv\Release"
# PROP Intermediate_Dir "instsrv\Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\..\..\include" /I "..\include" /I "." /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _WIN32_WINNT=0x400 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /YX"windows.h" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /machine:I386 /out:"bin/Release/Instsrv.exe"

!ELSEIF  "$(CFG)" == "instsrv - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "instsrv\Debug"
# PROP BASE Intermediate_Dir "instsrv\Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "instsrv\Debug"
# PROP Intermediate_Dir "instsrv\Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\..\..\include" /I "..\include" /I "." /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _WIN32_WINNT=0x400 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /FR /FD /GZ /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /out:"bin/Debug/Instsrv.exe" /pdbtype:sept

!ENDIF 

# Begin Target

# Name "instsrv - Win32 Release"
# Name "instsrv - Win32 Debug"
# Begin Group "Source Files"

# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File

SOURCE=..\instsrv\instsrv.c
# End Source File
# End Group
# Begin Group "Header Files"

# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"

# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
ntp-4.2.6p5/ports/winnt/vc6/libntp.dsp0000644000175000017500000003733211505336022016622 0ustar  peterpeter# Microsoft Developer Studio Project File - Name="libntp" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Static Library" 0x0104

CFG=libntp - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE 
!MESSAGE NMAKE /f "libntp.mak".
!MESSAGE 
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE /f "libntp.mak" CFG="libntp - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "libntp - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "libntp - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE 

# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/ntp/dev/ports/winnt/libntp", AWBAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
RSC=rc.exe

!IF  "$(CFG)" == "libntp - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "libntp\Release"
# PROP BASE Intermediate_Dir "libntp\Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "libntp\Release"
# PROP Intermediate_Dir "libntp\Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /W4 /GX /O2 /I "." /I "..\include" /I "..\..\..\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /I "$(OPENSSL_INC)" /I "..\..\..\sntp\libopts" /D "NDEBUG" /D "_LIB" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _WIN32_WINNT=0x400 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo

!ELSEIF  "$(CFG)" == "libntp - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "libntp\Debug"
# PROP BASE Intermediate_Dir "libntp\Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "libntp\Debug"
# PROP Intermediate_Dir "libntp\Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "." /I "..\include" /I "..\..\..\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /I "$(OPENSSL_INC)" /I "..\..\..\sntp\libopts" /D "_DEBUG" /D "_LIB" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _WIN32_WINNT=0x400 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /FR /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo

!ENDIF 

# Begin Target

# Name "libntp - Win32 Release"
# Name "libntp - Win32 Debug"
# Begin Group "Source Files"

# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File

SOURCE=..\..\..\libntp\a_md5encrypt.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\adjtime.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\assertions.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\atoint.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\atolfp.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\atouint.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\authkeys.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\authreadkeys.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\authusekey.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\buffer.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\buftvtots.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\caljulian.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\caltontp.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\calyearstart.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\clocktime.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\clocktypes.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\win32\condition.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\decodenetnum.c
# End Source File
# Begin Source File

SOURCE=..\libntp\dnslookup.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\dofptoa.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\dolfptoa.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\emalloc.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\error.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\event.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\findconfig.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\fptoa.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\fptoms.c
# End Source File
# Begin Source File

SOURCE=..\libntp\getclock.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\getopt.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\hextoint.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\hextolfp.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\humandate.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\inet_aton.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\inet_ntop.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\inet_pton.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\win32\interfaceiter.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\inttoa.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\iosignal.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\lib.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\lib_strbuf.c
# End Source File
# Begin Source File

SOURCE=..\..\..\sntp\libopts\libopts.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\log.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\machines.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\md5.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\memmove.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\mfptoa.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\mfptoms.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\mktime.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\modetoa.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\nls\msgcat.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\mstolfp.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\msutotsf.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\msyslog.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\win32\net.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\netaddr.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\netof.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\netscope.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\ntp_libopts.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\ntp_lineedit.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\ntp_random.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\ntp_rfc2553.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\numtoa.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\numtohost.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\octtoint.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\win32\once.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\ondestroy.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\prettydate.c
# End Source File
# Begin Source File

SOURCE=..\libntp\randfile.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\recvbuff.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\refnumtoa.c
# End Source File
# Begin Source File

SOURCE=..\libntp\setpriority.c
# End Source File
# Begin Source File

SOURCE=..\libntp\SetSystemTime.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\sockaddr.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\socktoa.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\socktohost.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\ssl_init.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\statestr.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\win32\strerror.c
# End Source File
# Begin Source File

SOURCE=..\libntp\syslog.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\syssignal.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\systime.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\task.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\win32\thread.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\win32\time.c
# End Source File
# Begin Source File

SOURCE=..\libntp\transmitbuff.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\tsftomsu.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\tstotv.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\tvtots.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\uglydate.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\uinttoa.c
# End Source File
# Begin Source File

SOURCE=..\libntp\util_clockstuff.c
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\win32\win32os.c
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\ymd2yd.c
# End Source File
# End Group
# Begin Group "Header Files"

# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File

SOURCE=..\..\..\include\binio.h
# End Source File
# Begin Source File

SOURCE=..\include\clockstuff.h
# End Source File
# Begin Source File

SOURCE=..\include\config.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\global.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ieee754io.h
# End Source File
# Begin Source File

SOURCE=..\include\netinet\in.h
# End Source File
# Begin Source File

SOURCE=..\include\arpa\inet.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\isc\interfaceiter.h
# End Source File
# Begin Source File

SOURCE=..\include\inttypes.h
# End Source File
# Begin Source File

SOURCE=..\include\sys\ioctl.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\iosignal.h
# End Source File
# Begin Source File

SOURCE=..\include\isc\ipv6.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\l_stdlib.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\lib_strbuf.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\md5.h
# End Source File
# Begin Source File

SOURCE=..\include\isc\net.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\isc\netaddr.h
# End Source File
# Begin Source File

SOURCE=..\include\netdb.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\isc\netscope.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_calendar.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_control.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_fp.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_if.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_io.h
# End Source File
# Begin Source File

SOURCE=..\include\ntp_iocompletionport.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_lineedit.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_lists.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_machine.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_malloc.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_proto.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_random.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_refclock.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_rfc2553.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_select.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_stdlib.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_string.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_syslog.h
# End Source File
# Begin Source File

SOURCE=..\include\ntp_timer.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_types.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_unixtime.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntpd.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\recvbuff.h
# End Source File
# Begin Source File

SOURCE=..\include\sys\signal.h
# End Source File
# Begin Source File

SOURCE=..\include\sys\socket.h
# End Source File
# Begin Source File

SOURCE=..\include\syslog.h
# End Source File
# Begin Source File

SOURCE=..\include\termios.h
# End Source File
# Begin Source File

SOURCE=..\include\sys\time.h
# End Source File
# Begin Source File

SOURCE=..\include\transmitbuff.h
# End Source File
# Begin Source File

SOURCE=..\include\win32_io.h
# End Source File
# Begin Source File

SOURCE=..\include\isc\win32os.h
# End Source File
# End Group
# Begin Group "Generated Files"

# PROP Default_Filter ""
# Begin Source File

SOURCE=..\libntp\messages.h
# End Source File
# End Group
# Begin Group "Resource Files"

# PROP Default_Filter ""
# Begin Source File

SOURCE=..\libntp\messages.mc

!IF  "$(CFG)" == "libntp - Win32 Release"

# PROP Ignore_Default_Tool 1
# Begin Custom Build - Message Compiler
InputDir=.
InputPath=..\libntp\messages.mc
InputName=messages

BuildCmds= \
	mc -h $(InputDir) -r $(InputDir) -e h $(InputPath)

"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
   $(BuildCmds)

"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
   $(BuildCmds)

"$(InputDir)\msg00001.bin" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
   $(BuildCmds)
# End Custom Build

!ELSEIF  "$(CFG)" == "libntp - Win32 Debug"

# PROP Ignore_Default_Tool 1
# Begin Custom Build - Message Compiler
InputDir=\ntp-4.2.6p1-RC2\ports\winnt\libntp
InputPath=..\libntp\messages.mc
InputName=messages

BuildCmds= \
	mc -h $(InputDir) -r $(InputDir) -e h $(InputPath)

"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
   $(BuildCmds)

"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
   $(BuildCmds)

"$(InputDir)\msg00001.bin" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
   $(BuildCmds)
# End Custom Build

!ENDIF 

# End Source File
# End Group
# End Target
# End Project
ntp-4.2.6p5/ports/winnt/vc6/ntpkeygen.dsp0000644000175000017500000001370011505336024017331 0ustar  peterpeter# Microsoft Developer Studio Project File - Name="ntpkeygen" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Console Application" 0x0103

CFG=ntpkeygen - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE 
!MESSAGE NMAKE /f "ntpkeygen.mak".
!MESSAGE 
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE /f "ntpkeygen.mak" CFG="ntpkeygen - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "ntpkeygen - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ntpkeygen - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE 

# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/ntp/dev/ports/winnt/ntpkeygen", OWBAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
RSC=rc.exe

!IF  "$(CFG)" == "ntpkeygen - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ntp-keygen\Release"
# PROP BASE Intermediate_Dir "ntp-keygen\Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ntp-keygen\Release"
# PROP Intermediate_Dir "ntp-keygen\Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W4 /GX /O2 /I "." /I "..\include" /I "..\..\..\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /I "$(OPENSSL_INC)" /I "..\..\..\sntp\libopts" /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _WIN32_WINNT=0x400 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(OPENSSL_LIB)\libeay32.lib libntp\Release\libntp.lib /nologo /subsystem:console /pdb:"bin/Release/ntp-keygen.pdb" /machine:I386 /out:"bin/Release/ntp-keygen.exe" /pdbtype:sept

!ELSEIF  "$(CFG)" == "ntpkeygen - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "ntp-keygen\Debug"
# PROP BASE Intermediate_Dir "ntp-keygen\Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "ntp-keygen\Debug"
# PROP Intermediate_Dir "ntp-keygen\Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "." /I "..\include" /I "..\..\..\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /I "$(OPENSSL_INC)" /I "..\..\..\sntp\libopts" /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _WIN32_WINNT=0x400 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(OPENSSL_LIB)\libeay32.lib libntp\Debug\libntp.lib /nologo /subsystem:console /pdb:"bin/Debug/ntp-keygen.pdb" /debug /machine:I386 /out:"bin/Debug/ntp-keygen.exe" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none

!ENDIF 

# Begin Target

# Name "ntpkeygen - Win32 Release"
# Name "ntpkeygen - Win32 Debug"
# Begin Group "Source Files"

# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File

SOURCE=..\..\..\libntp\getopt.c
# End Source File
# Begin Source File

SOURCE="..\..\..\util\ntp-keygen-opts.c"
# End Source File
# Begin Source File

SOURCE="..\..\..\util\ntp-keygen.c"
# End Source File
# Begin Source File

SOURCE=..\..\..\libntp\ntp_random.c
# End Source File
# Begin Source File

SOURCE=..\libntp\randfile.c
# End Source File
# Begin Source File

SOURCE=.\version.c
# End Source File
# End Group
# Begin Group "Header Files"

# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"

# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# Begin Source File

SOURCE=..\..\..\configure

!IF  "$(CFG)" == "ntpkeygen - Win32 Release"

# Begin Custom Build
ProjDir=.
InputPath=..\..\..\configure

"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
	echo Using NT Shell Script to generate version.c 
	..\scripts\mkver.bat -P ntp-keygen 
	
# End Custom Build

!ELSEIF  "$(CFG)" == "ntpkeygen - Win32 Debug"

# Begin Custom Build
ProjDir=.
InputPath=..\..\..\configure

"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
	echo Using NT Shell Script to generate version.c 
	..\scripts\mkver.bat -P ntp-keygen 
	
# End Custom Build

!ENDIF 

# End Source File
# End Target
# End Project
ntp-4.2.6p5/ports/winnt/vc6/ntpdc.dsp0000644000175000017500000001321111474355436016447 0ustar  peterpeter# Microsoft Developer Studio Project File - Name="ntpdc" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Console Application" 0x0103

CFG=ntpdc - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE 
!MESSAGE NMAKE /f "ntpdc.mak".
!MESSAGE 
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE /f "ntpdc.mak" CFG="ntpdc - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "ntpdc - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ntpdc - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE 

# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/ntp/dev/ports/winnt/ntpdc", SWBAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
RSC=rc.exe

!IF  "$(CFG)" == "ntpdc - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ntpdc\Release"
# PROP BASE Intermediate_Dir "ntpdc\Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ntpdc\Release"
# PROP Intermediate_Dir "ntpdc\Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W4 /GX /O2 /I "." /I "..\include" /I "..\..\..\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /I "$(OPENSSL_INC)" /I "..\..\..\sntp\libopts" /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /YX"windows.h" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console  /machine:I386
# ADD LINK32 kernel32.lib user32.lib ws2_32.lib advapi32.lib $(OPENSSL_LIB)\libeay32.lib /nologo /subsystem:console /pdb:"bin/Release/ntpdc.pdb" /machine:I386 /out:"bin/Release/ntpdc.exe" /pdbtype:sept

!ELSEIF  "$(CFG)" == "ntpdc - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "ntpdc\Debug"
# PROP BASE Intermediate_Dir "ntpdc\Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "ntpdc\Debug"
# PROP Intermediate_Dir "ntpdc\Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "." /I "..\include" /I "..\..\..\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /I "$(OPENSSL_INC)" /I "..\..\..\sntp\libopts" /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /FR /YX"windows.h" /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib ws2_32.lib advapi32.lib $(OPENSSL_LIB)\libeay32.lib /nologo /subsystem:console /pdb:"bin/Debug/ntpdc.pdb" /debug /machine:I386 /out:"bin/Debug/ntpdc.exe" /pdbtype:sept

!ENDIF 

# Begin Target

# Name "ntpdc - Win32 Release"
# Name "ntpdc - Win32 Debug"
# Begin Group "Source Files"

# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File

SOURCE="..\..\..\ntpdc\ntpdc-opts.c"
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpdc\ntpdc.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpdc\ntpdc_ops.c
# End Source File
# Begin Source File

SOURCE=.\version.c
# End Source File
# End Group
# Begin Group "Header Files"

# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File

SOURCE=..\..\..\ntpdc\ntpdc.h
# End Source File
# End Group
# Begin Group "Resource Files"

# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# Begin Source File

SOURCE=..\..\..\configure

!IF  "$(CFG)" == "ntpdc - Win32 Release"

# Begin Custom Build
ProjDir=.
InputPath=..\..\..\configure

"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
	echo Using NT Shell Script to generate version.c 
	..\scripts\mkver.bat -P ntpdc 
	
# End Custom Build

!ELSEIF  "$(CFG)" == "ntpdc - Win32 Debug"

# Begin Custom Build
ProjDir=.
InputPath=..\..\..\configure

"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
	echo Using NT Shell Script to generate version.c 
	..\scripts\mkver.bat -P ntpdc 
	
# End Custom Build

!ENDIF 

# End Source File
# End Target
# End Project
ntp-4.2.6p5/ports/winnt/vc6/ntpd.dsp0000644000175000017500000004360611474355436016317 0ustar  peterpeter# Microsoft Developer Studio Project File - Name="ntpd" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Console Application" 0x0103

CFG=ntpd - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE 
!MESSAGE NMAKE /f "ntpd.mak".
!MESSAGE 
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE /f "ntpd.mak" CFG="ntpd - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "ntpd - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ntpd - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE 

# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/ntp/dev/ports/winnt/ntpd", JWBAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
RSC=rc.exe

!IF  "$(CFG)" == "ntpd - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ntpd\Release"
# PROP BASE Intermediate_Dir "ntpd\Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ntpd\Release"
# PROP Intermediate_Dir "ntpd\Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W4 /GX /O2 /I "." /I "..\include" /I "..\..\..\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /I "$(OPENSSL_INC)" /I "..\..\..\libopts" /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /FR /YX"windows.h" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib winmm.lib $(OPENSSL_LIB)\libeay32.lib /nologo /subsystem:console /pdb:"bin/Release/ntpd.pdb" /machine:I386 /out:"bin/Release/ntpd.exe" /pdbtype:sept

!ELSEIF  "$(CFG)" == "ntpd - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "ntpd\Debug"
# PROP BASE Intermediate_Dir "ntpd\Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "ntpd\Debug"
# PROP Intermediate_Dir "ntpd\Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\include" /I "..\..\..\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /I "$(OPENSSL_INC)" /I "..\..\..\libopts" /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 /D "_CRT_SECURE_NO_DEPRECATE" /FR /FD /GZ /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib winmm.lib $(OPENSSL_LIB)\libeay32.lib /nologo /subsystem:console /pdb:"bin/Debug/ntpd.pdb" /debug /machine:I386 /out:"bin/Debug/ntpd.exe" /pdbtype:sept

!ENDIF 

# Begin Target

# Name "ntpd - Win32 Release"
# Name "ntpd - Win32 Debug"
# Begin Group "Source Files"

# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File

SOURCE=..\..\..\ntpd\cmd_args.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\ntpd\nt_clockstuff.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_config.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_control.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_crypto.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_data_structures.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_filegen.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_intres.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_io.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\ntpd\ntp_iocompletionport.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_loopfilter.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_monitor.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_parser.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_peer.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_proto.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_refclock.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_request.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_restrict.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_scanner.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_timer.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntp_util.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE="..\..\..\ntpd\ntpd-opts.c"
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\ntpd.c
# SUBTRACT CPP /YX
# End Source File
# Begin Source File

SOURCE=..\ntpd\ntservice.c
# End Source File
# Begin Source File

SOURCE=..\ntpd\win32_io.c
# SUBTRACT CPP /YX
# End Source File
# End Group
# Begin Group "Header Files"

# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File

SOURCE=..\..\..\include\ascii.h
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\include\isc\assertions.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\binio.h
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\include\isc\boolean.h
# End Source File
# Begin Source File

SOURCE=..\include\clockstuff.h
# End Source File
# Begin Source File

SOURCE=..\include\config.h
# End Source File
# Begin Source File

SOURCE=..\include\hopf_PCI_io.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ieee754io.h
# End Source File
# Begin Source File

SOURCE=..\include\netinet\in.h
# End Source File
# Begin Source File

SOURCE=..\include\arpa\inet.h
# End Source File
# Begin Source File

SOURCE=..\include\isc\int.h
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\include\isc\interfaceiter.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\iosignal.h
# End Source File
# Begin Source File

SOURCE=..\include\isc\ipv6.h
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\jupiter.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\l_stdlib.h
# End Source File
# Begin Source File

SOURCE=..\..\..\sntp\libntp\log.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\mbg_gps166.h
# End Source File
# Begin Source File

SOURCE=..\include\isc\net.h
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\include\isc\netaddr.h
# End Source File
# Begin Source File

SOURCE=..\include\netdb.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_calendar.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_cmdargs.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_config.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_control.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_debug.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_filegen.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_fp.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_if.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_io.h
# End Source File
# Begin Source File

SOURCE=..\include\ntp_iocompletionport.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_machine.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_malloc.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_proto.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_random.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_refclock.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_request.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_rfc2553.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_select.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_stdlib.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_string.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_syslog.h
# End Source File
# Begin Source File

SOURCE=..\include\ntp_timer.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_tty.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_types.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntp_unixtime.h
# End Source File
# Begin Source File

SOURCE="..\..\..\ntpd\ntpd-opts.h"
# End Source File
# Begin Source File

SOURCE=..\..\..\include\ntpd.h
# End Source File
# Begin Source File

SOURCE=..\include\ntservice.h
# End Source File
# Begin Source File

SOURCE=..\include\isc\offset.h
# End Source File
# Begin Source File

SOURCE=..\..\..\libopts\autoopts\options.h
# End Source File
# Begin Source File

SOURCE=..\include\sys\param.h
# End Source File
# Begin Source File

SOURCE=..\include\isc\platform.h
# End Source File
# Begin Source File

SOURCE=..\..\..\include\recvbuff.h
# End Source File
# Begin Source File

SOURCE=..\..\..\lib\isc\include\isc\result.h
# End Source File
# Begin Source File

SOURCE=..\include\sys\socket.h
# End Source File
# Begin Source File

SOURCE=..\include\syslog.h
# End Source File
# Begin Source File

SOURCE=..\include\termios.h
# End Source File
# Begin Source File

SOURCE=..\include\transmitbuff.h
# End Source File
# Begin Source File

SOURCE=..\include\sys\wait.h
# End Source File
# Begin Source File

SOURCE=..\include\win32_io.h
# End Source File
# Begin Source File

SOURCE=..\include\isc\win32os.h
# End Source File
# End Group
# Begin Group "Generated Files"

# PROP Default_Filter ""
# Begin Source File

SOURCE=..\sntp\libntp\messages.rc
# End Source File
# Begin Source File

SOURCE=..\sntp\libntp\MSG00001.bin
# End Source File
# Begin Source File

SOURCE=.\version.c
# End Source File
# End Group
# Begin Group "Resource Files"

# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File

SOURCE=..\sntp\libntp\messages.mc
# End Source File
# End Group
# Begin Group "Reference Clock"

# PROP Default_Filter ""
# Begin Source File

SOURCE=..\ntpd\hopf_PCI_io.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_acts.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_arbiter.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_arc.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_as2201.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_atom.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_bancomm.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_chu.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_conf.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_chronolog.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_datum.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_dumbclock.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_gpsvme.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_heath.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_hopfpci.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_hopfser.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_hpgps.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_irig.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_jupiter.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_leitch.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_local.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_msfees.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_mx4200.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_nmea.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_oncore.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_palisade.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_palisade.h
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_parse.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_pst.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_ptbacts.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_shm.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_tpro.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_trak.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_true.c
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_usno.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\ntpd\refclock_wwvb.c
# End Source File
# End Group
# Begin Group "Parse Lib"

# PROP Default_Filter ""
# Begin Source File

SOURCE=..\..\..\libparse\clk_computime.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\libparse\clk_dcf7000.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\libparse\clk_hopf6021.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\libparse\clk_meinberg.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\libparse\clk_rawdcf.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\libparse\clk_rcc8000.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\libparse\clk_schmid.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\libparse\clk_trimtaip.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\libparse\clk_trimtsip.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\libparse\data_mbg.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\libparse\parse.c
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File

SOURCE=..\..\..\libparse\parse_conf.c
# PROP Exclude_From_Build 1
# End Source File
# End Group
# Begin Source File

SOURCE=..\..\..\configure

!IF  "$(CFG)" == "ntpd - Win32 Release"

USERDEP__CONFI="..\scripts\mkver.bat"	
# Begin Custom Build
ProjDir=.
InputPath=..\..\..\configure

"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
	echo Using NT Shell Script to generate version.c 
	..\scripts\mkver.bat -P ntpd 
	
# End Custom Build

!ELSEIF  "$(CFG)" == "ntpd - Win32 Debug"

USERDEP__CONFI="..\scripts\mkver.bat"	
# Begin Custom Build
ProjDir=.
InputPath=..\..\..\configure

"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
	echo Using NT Shell Script to generate version.c 
	..\scripts\mkver.bat -P ntpd 
	
# End Custom Build

!ENDIF 

# End Source File
# Begin Source File

SOURCE=..\scripts\mkver.bat
# PROP Exclude_From_Build 1
# End Source File
# End Target
# End Project
ntp-4.2.6p5/ports/winnt/libntp/0000755000175000017500000000000011710605402015403 5ustar  peterpeterntp-4.2.6p5/ports/winnt/libntp/SetSystemTime.c0000644000175000017500000000106111307651603020332 0ustar  peterpeter
#include "clockstuff.h"
#include "ntp_stdlib.h"

pset_tod_using		set_tod_using = NULL;

time_stepped_callback	step_callback = NULL;

int
ntp_set_tod(
	struct timeval *tv,
	void *tzp
	)
{
	SYSTEMTIME st;
	union {
		FILETIME ft;
		ULONGLONG ull;
	} t;

	UNUSED_ARG(tzp);

	t.ull = FILETIME_1970 +
		(ULONGLONG)tv->tv_sec * 10 * 1000 * 1000 +
		(ULONGLONG)tv->tv_usec * 10;

	if (!FileTimeToSystemTime(&t.ft, &st) || !SetSystemTime(&st)) {
		msyslog(LOG_ERR, "SetSystemTime failed: %m\n");
		return -1;
	}

	if (step_callback)
		(*step_callback)();

	return 0;
}
ntp-4.2.6p5/ports/winnt/libntp/transmitbuff.c0000644000175000017500000000606011307651603020263 0ustar  peterpeter/*
 * DEAD CODE ALERT  --  for whatever reason all this wonderful stuff is
 *			unused.  The initialization was the only code
 *			exercised as of May 2009 when that was nipped.
 */


#ifdef HAVE_CONFIG_H
# include 
#endif

#include 
#include "ntp_machine.h"
#include "ntp_fp.h"
#include "ntp_stdlib.h"
#include "ntp_syslog.h"

#include 
#include "transmitbuff.h"

/*
 * transmitbuf memory management
 */
#define TRANSMIT_INIT		10	/* 10 buffers initially */
#define TRANSMIT_LOWAT		 3	/* when we're down to three buffers get more */
#define TRANSMIT_INC		 5	/* get 5 more at a time */
#define TRANSMIT_TOOMANY	40	/* this is way too many buffers */

/*
 * Memory allocation
 */
static volatile u_long full_transmitbufs = 0;	/* number of transmitbufs on fulllist */
static volatile u_long free_transmitbufs = 0;	/* number of transmitbufs on freelist */

ISC_LIST(transmitbuf_t)	free_transmit_list;	/* Currently used transmit buffers */
ISC_LIST(transmitbuf_t)	full_transmit_list;	/* Currently used transmit buffers */

static u_long total_transmitbufs = 0;		/* total transmitbufs currently in use */
static u_long lowater_additions = 0;		/* number of times we have added memory */

static CRITICAL_SECTION TransmitLock;
# define LOCK(lock)	EnterCriticalSection(lock)
# define UNLOCK(lock)	LeaveCriticalSection(lock)

static inline void 
initialise_buffer(transmitbuf *buff)
{
	memset(buff, 0, sizeof(*buff));
}

static void
add_buffer_to_freelist(transmitbuf *tb)
{
	ISC_LIST_APPEND(free_transmit_list, tb, link);
	free_transmitbufs++;
}

static void
create_buffers(int nbufs)
{
	transmitbuf_t *buf;
	int i;

	buf = emalloc(nbufs * sizeof(*buf));
	for (i = 0; i < nbufs; i++)
	{
		initialise_buffer(buf);
		add_buffer_to_freelist(buf);
		total_transmitbufs++;
		buf++;
	}

	lowater_additions++;
}

extern void
init_transmitbuff(void)
{
	/*
	 * Init buffer free list and stat counters
	 */
	ISC_LIST_INIT(full_transmit_list);
	ISC_LIST_INIT(free_transmit_list);
	free_transmitbufs = total_transmitbufs = 0;
	full_transmitbufs = lowater_additions = 0;
	create_buffers(TRANSMIT_INIT);

	InitializeCriticalSection(&TransmitLock);
}

static void
delete_buffer_from_full_list(transmitbuf_t *tb) {

	transmitbuf_t *next = NULL;
	transmitbuf_t *lbuf = ISC_LIST_HEAD(full_transmit_list);

	while (lbuf != NULL) {
		next = ISC_LIST_NEXT(lbuf, link);
		if (lbuf == tb) {
			ISC_LIST_DEQUEUE(full_transmit_list, lbuf, link);
			break;
		}
		else
			lbuf = next;
	}
	full_transmitbufs--;
}

extern void
free_transmit_buffer(transmitbuf_t *rb)
{
	LOCK(&TransmitLock);
	delete_buffer_from_full_list(rb);
	add_buffer_to_freelist(rb);
	UNLOCK(&TransmitLock);
}


extern transmitbuf *
get_free_transmit_buffer(void)
{

	transmitbuf_t * buffer = NULL;
	LOCK(&TransmitLock);
	if (free_transmitbufs <= 0) {
		create_buffers(TRANSMIT_INC);
	}
	buffer = ISC_LIST_HEAD(free_transmit_list);
	if (buffer != NULL)
	{
		ISC_LIST_DEQUEUE(free_transmit_list, buffer, link);
		free_transmitbufs--;
		ISC_LIST_APPEND(full_transmit_list, buffer, link);
		full_transmitbufs++;
	}
	UNLOCK(&TransmitLock);
	return (buffer);
}

ntp-4.2.6p5/ports/winnt/libntp/mexit.c0000644000175000017500000000106010017034577016702 0ustar  peterpeter/*
 * mexit - Used to exit the NTPD daemon
 * 
 */

#include 
#include 

HANDLE hServDoneEvent = NULL;

void
service_exit(
	int status
	)
{
	extern int debug;

	if (debug) /* did not become a service, simply exit */
	    ExitThread((DWORD)status);
	else {
		/* service mode, need to have the service_main routine
		 * register with the service control manager that the 
		 * service has stopped running, before exiting
		 */
		if ((status > 0) && (hServDoneEvent != NULL))
		    SetEvent(hServDoneEvent);
		ExitThread((DWORD)status);
	}
}

ntp-4.2.6p5/ports/winnt/libntp/MSG00001.bin0000644000175000017500000000015011307651604017107 0ustar  peterpeter@@(€€DÀÀX%1







%1



%1

ntp-4.2.6p5/ports/winnt/libntp/setpriority.c0000644000175000017500000000533311307651603020156 0ustar  peterpeter#include 
#include 
#include 
#include 	/* our private version */
#include "ntp_machine.h"
#include "ntp_stdlib.h"
#include "ntp_syslog.h"
#include "ntp_debug.h"
#include "ntp_fp.h"
#include "ntp.h"
#include "clockstuff.h"


/*
 * setpriority
 *
 * to reduce the #ifdef forest in the portable code,
 * we emulate the BSD setpriority interface:
 *
 * 		if (-1 == setpriority(PRIO_PROCESS, 0, NTP_PRIO))
 * 			msyslog(LOG_ERR, "setpriority() error: %m");
 *
 * However, since the Windows port of ntpd has always raised its
 * priority (to realtime if allowed, or silently downgraded to 
 * high by the system if not) with or without -N.  Changing that
 * now would endanger users who upgrade the binary without adding
 * -N to its invocation.  Instsrv assumes ntpd.exe is installed
 * with no command-line arguments.
 *
 * This routine is used by utilities as well as ntpd itself, so
 * it checks if the priority is already high or realtime and 
 * logs no complaints in that case, to avoid duplicating.  ntpd
 * will have raised the priority to one of those in
 * init_winnt_time, while the utilities will rely on this
 * code.
 *
 */

int setpriority(
		int which,
		int who,
		int prio
		)
{
	BOOL success;
	DWORD prio_class;

	if (PRIO_PROCESS != which || who || NTP_PRIO != prio) {
		DPRINTF(1,("windows setpriority() clone needs work.\n"));
	}

	prio_class = GetPriorityClass(GetCurrentProcess());
	
	if (HIGH_PRIORITY_CLASS == prio_class ||
	    REALTIME_PRIORITY_CLASS == prio_class)
		return 0;

	success = SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);

	if (!success) {
		msyslog(LOG_ERR, "Unable to raise priority: %m"); 
		errno = EPERM;
		return -1;
	}

	prio_class = GetPriorityClass(GetCurrentProcess());

	if (REALTIME_PRIORITY_CLASS == prio_class)
		msyslog(LOG_INFO, "Raised to realtime priority class");
	else if (HIGH_PRIORITY_CLASS == prio_class)
		msyslog(LOG_ERR,  "Raised to high priority class, realtime "
				  "requires Increase Scheduling Priority "
				  "privilege (enabled with secpol.msc).");
	else
		msyslog(LOG_ERR,  "Unexpected process priority class %d",
				 prio_class);

	return 0; 
}

/*
 * InitSockets -- once known as Win32InitSockets()
 *
 * This doesn't have much to do with setpriority but we
 * want the routine in libntp and this is a convenient
 * existing Windows-only libntp source file.
 */
void
InitSockets(
	void
	)
{
	WORD wVersionRequested;
	WSADATA wsaData;
	int err;

	/* Need Winsock 2.0 or better */
	wVersionRequested = MAKEWORD(2, 0);
 
	err = WSAStartup(wVersionRequested, &wsaData);
	if ( err != 0 ) {
		fprintf(stderr, "No useable winsock.dll: %s\n", strerror(err));
		SetLastError(err);
		msyslog(LOG_ERR, "No usable winsock.dll: %m");
		exit(1);
	}
}
ntp-4.2.6p5/ports/winnt/libntp/getclock.c0000644000175000017500000000172711307651605017361 0ustar  peterpeter/*
 * getclock.c - Emulate Unix getclock(3) nanosecond interface for libntp/ntpd
 */
#include "config.h"
#include "clockstuff.h"
#include "ntp_stdlib.h"

/*
 * getclock() is in libntp.  To use interpolation, 
 * ports/winnt/ntpd/nt_clockstuff.c overrides GetSystemTimeAsFileTime 
 * via the pointer get_sys_time_as_filetime.
 */
PGSTAFT get_sys_time_as_filetime;

int
getclock(
	int		clktyp,
	struct timespec *ts
	)
{
	union {
		FILETIME ft;
		ULONGLONG ull;
	} uNow;

	if (clktyp != TIMEOFDAY) {
#ifdef DEBUG
		if (debug) {
			printf("getclock() supports only TIMEOFDAY clktyp\n");
		}
#endif
		errno = EINVAL;
		return -1;
	}

	if (! get_sys_time_as_filetime)
		get_sys_time_as_filetime = GetSystemTimeAsFileTime;

	(*get_sys_time_as_filetime)(&uNow.ft);

	/* 
	 * Convert the hecto-nano second time to timespec format
	 */
	uNow.ull -= FILETIME_1970;
	ts->tv_sec = (time_t)( uNow.ull / HECTONANOSECONDS);
	ts->tv_nsec = (long)(( uNow.ull % HECTONANOSECONDS) * 100);

	return 0;
}
ntp-4.2.6p5/ports/winnt/libntp/util_clockstuff.c0000644000175000017500000000050311307651605020755 0ustar  peterpeter#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "ntp_syslog.h"
#include "ntp_stdlib.h"
#include "clockstuff.h"

int
gettimeofday(
	struct timeval *tv,
	int ignored
	)
{
	struct timespec ts;

	UNUSED_ARG(ignored);

	getclock(TIMEOFDAY, &ts);

	tv->tv_sec = ts.tv_sec;
	tv->tv_usec = ts.tv_nsec / 10;

	return 0;
}
ntp-4.2.6p5/ports/winnt/libntp/randfile.c0000644000175000017500000000467211307651603017352 0ustar  peterpeter/*
 * Make sure that there is a good source of random characters
 * so that OpenSSL can work properly and securely.
 */

#include 
#include 

#include 

unsigned int	getrandom_chars(int desired, unsigned char *buf, int lenbuf);
BOOL		create_random_file(char *filename);

BOOL
init_randfile()
{
	FILE *rf;
	char *randfile;
	char *homedir;
	char tmp[256];
	/* See if the environmental variable RANDFILE is defined
	 * and the file exists
	 */
	randfile = getenv("RANDFILE");
	if (randfile != NULL) {
		rf = fopen(randfile, "rb");
		if (rf != NULL) {
			fclose(rf);
			return (TRUE);
		}
		else {
			/* The environmental variable exists but not the file */
			return (create_random_file(randfile));
		}
	}
	/*
	 * If the RANDFILE environmental variable does not exist,
	 * see if the HOME enviromental variable exists and
	 * a .rnd file is in there.
	 */
	homedir = getenv("HOME");
	if (homedir != NULL &&
	    (strlen(homedir) + 5 /* \.rnd */) < sizeof(tmp)) {
		strncpy(tmp, homedir, sizeof(tmp));
		strcat(tmp, "\\.rnd");
		rf = fopen(tmp, "rb");
		if (rf != NULL) {
			fclose(rf);
			return (TRUE);
		}
		else {
			/* The HOME environmental variable exists but not the file */
			return (create_random_file(tmp));
		}
	}
	/*
	 * Final try. Look for it on the C:\ directory
	 * NOTE: This is a really bad place for it security-wise
	 * However, OpenSSL looks for it there if it can't find it elsewhere
	 */
	rf = fopen("C:\\.rnd", "rb");
	if (rf != NULL) {
		fclose(rf);
		return (TRUE);
	}
	/* The file does not exist */
	return (create_random_file("C:\\.rnd"));
}
/*
 * Routine to create the random file with 1024 random characters
 */
BOOL
create_random_file(char *filename) {
	FILE *rf;
	int nchars;
	unsigned char buf[1025];

	nchars = getrandom_chars(1024, buf, sizeof(buf));
	rf = fopen(filename, "wb");
	if (rf == NULL)
		return (FALSE);
	fwrite(buf, sizeof(unsigned char), nchars, rf);
	fclose(rf);
	return (TRUE);
}

unsigned int
getrandom_chars(int desired, unsigned char *buf, int lenbuf) {
	HCRYPTPROV hcryptprov;
	BOOL err;

	if (buf == NULL || lenbuf <= 0 || desired > lenbuf)
		return (0);
	/*
	 * The first time we just try to acquire the context
	 */
	err = CryptAcquireContext(&hcryptprov, NULL, NULL, PROV_RSA_FULL,
				  CRYPT_VERIFYCONTEXT);
	if (!err){
		return (0);
	}
	if (!CryptGenRandom(hcryptprov, desired, buf)) {
		CryptReleaseContext(hcryptprov, 0);
		return (0);
	}

	CryptReleaseContext(hcryptprov, 0);
	return (desired);
}

ntp-4.2.6p5/ports/winnt/libntp/syslog.c0000644000175000017500000001141711307651603017101 0ustar  peterpeter/*
 * Copyright (C) 2001  Internet Software Consortium.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/* From BIND 9 lib/isc/win32/: syslog.c,v 1.6 2002/08/03 01:34:14 mayer */

#include 

#include 
#include 
#include 
#include 
#include 

#include 

#include "messages.h"

static HANDLE hAppLog = NULL;
static FILE *log_stream;
static int debug_level = 0;
static char progname[51] = "NTP";
static int logmask = 0;

static struct dsn_c_pvt_sfnt {
	int val;
	const char *strval;
} facilities[] = {
	{ LOG_KERN,		"kern" },
	{ LOG_USER,		"user" },
	{ LOG_MAIL,		"mail" },
	{ LOG_DAEMON,		"daemon" },
	{ LOG_AUTH,		"auth" },
	{ LOG_SYSLOG,		"syslog" },
	{ LOG_LPR,		"lpr" },
#ifdef LOG_NEWS
	{ LOG_NEWS,		"news" },
#endif
#ifdef LOG_UUCP
	{ LOG_UUCP,		"uucp" },
#endif
#ifdef LOG_CRON
	{ LOG_CRON,		"cron" },
#endif
#ifdef LOG_AUTHPRIV
	{ LOG_AUTHPRIV,		"authpriv" },
#endif
#ifdef LOG_FTP
	{ LOG_FTP,		"ftp" },
#endif
	{ LOG_LOCAL0,		"local0"},
	{ LOG_LOCAL1,		"local1"},
	{ LOG_LOCAL2,		"local2"},
	{ LOG_LOCAL3,		"local3"},
	{ LOG_LOCAL4,		"local4"},
	{ LOG_LOCAL5,		"local5"},
	{ LOG_LOCAL6,		"local6"},
	{ LOG_LOCAL7,		"local7"},
	{ 0,			NULL }
};

#if 0
BOOL
isc_syslog_facilityfromstring(const char *str, int *facilityp) {
	int i;

	REQUIRE(str != NULL);
	REQUIRE(facilityp != NULL);

	for (i = 0 ; facilities[i].strval != NULL ; i++) {
		if (strcasecmp(facilities[i].strval, str) == 0) {
			*facilityp = facilities[i].val;
			return (TRUE);
		}
	}
	return (FALSE);
}
#endif
/*
 * Log to the NT Event Log
 */
void
syslog(int level, const char *fmt, ...) {
	va_list ap;
	char buf[1024];
	char *str[1];

	str[0] = buf;

	va_start(ap, fmt);
	vsprintf(buf, fmt, ap);
	va_end(ap);

	/* Make sure that the channel is open to write the event */
	if (hAppLog == NULL) {
		openlog(progname, LOG_PID);
	}
	switch (level) {
		case LOG_INFO:
		case LOG_NOTICE:
		case LOG_DEBUG:
			ReportEvent(hAppLog, EVENTLOG_INFORMATION_TYPE, 0,
				    NTP_INFO, NULL, 1, 0, str, NULL);
			break;
		case LOG_WARNING:
			ReportEvent(hAppLog, EVENTLOG_WARNING_TYPE, 0,
				    NTP_WARNING, NULL, 1, 0, str, NULL);
			break;
		default:
			ReportEvent(hAppLog, EVENTLOG_ERROR_TYPE, 0,
				    NTP_ERROR, NULL, 1, 0, str, NULL);
			break;
		}
}

/*
 * Initialize event logging
 */
void
openlog(const char *name, int flags, ...) {
	/* Get a handle to the Application event log */
	hAppLog = RegisterEventSource(NULL, progname);
	strncpy(progname, name, sizeof(progname));
	progname[sizeof(progname) - 1] = 0;
}

/*
 * Close the Handle to the application Event Log
 * We don't care whether or not we succeeded so ignore return values
 * In fact if we failed then we would have nowhere to put the message
 */
void
closelog() {
	DeregisterEventSource(hAppLog);
}

/*
 * Keep event logging synced with the current debug level
 */
void
ModifyLogLevel(int level) {
	debug_level = level;	
}
/*
 * Set the log priority mask to the given value.
 * Return the previous priority mask
 * Note that this setting is ignored in Win32
 */
int
setlogmask(int maskpri) {
	int temp = logmask;
	logmask = maskpri;
	return (temp);
}

/*
 * Initialize logging for the port section of libbind.
 * Piggyback onto stream given.
 */
void
InitNTLogging(FILE *stream, int debug) {
	log_stream = stream;
	ModifyLogLevel(debug);
}
/*
 * This function is for reporting errors to the application
 * event log in case the regular syslog is not available
 * mainly during startup. It should not be used under normal
 * circumstances.
 */
void
NTReportError(const char *name, const char *str) {
	HANDLE hNTAppLog = NULL;
	const char *buf[1];

	buf[0] = str;

	hNTAppLog = RegisterEventSource(NULL, name);

	ReportEvent(hNTAppLog, EVENTLOG_ERROR_TYPE, 0,
		    NTP_ERROR, NULL, 1, 0, buf, NULL);

	DeregisterEventSource(hNTAppLog);
}


/*
 * ntp_strerror() - provide strerror()-compatible wrapper for libisc's
 *		    isc__strerror(), which knows about Windows as well as
 *		    C runtime error messages.
 */

char *
ntp_strerror(
	int code
	)
{
	static char msgbuf[128];

	isc__strerror(code, msgbuf, sizeof(msgbuf));

	return msgbuf;
}
ntp-4.2.6p5/ports/winnt/libntp/messages.h0000644000175000017500000001444711307651603017403 0ustar  peterpeter /*
 Microsoft Developer Support
 Copyright (c) 1992 Microsoft Corporation

 This file contains the message definitions for the Win32
 syslog support messages for the nntp firewall
-------------------------------------------------------------------------
 HEADER SECTION

 The header section defines names and language identifiers for use
 by the message definitions later in this file. The MessageIdTypedef,
 SeverityNames, FacilityNames, and LanguageNames keywords are
 optional and not required.



 The MessageIdTypedef keyword gives a typedef name that is used in a
 type cast for each message code in the generated include file. Each
 message code appears in the include file with the format: #define
 name ((type) 0xnnnnnnnn) The default value for type is empty, and no
 type cast is generated. It is the programmer's responsibility to
 specify a typedef statement in the application source code to define
 the type. The type used in the typedef must be large enough to
 accomodate the entire 32-bit message code.



 The SeverityNames keyword defines the set of names that are allowed
 as the value of the Severity keyword in the message definition. The
 set is delimited by left and right parentheses. Associated with each
 severity name is a number that, when shifted left by 30, gives the
 bit pattern to logical-OR with the Facility value and MessageId
 value to form the full 32-bit message code. The default value of
 this keyword is:

 SeverityNames=(
   Success=0x0
   Informational=0x1
   Warning=0x2
   Error=0x3
   )

 Severity values occupy the high two bits of a 32-bit message code.
 Any severity value that does not fit in two bits is an error. The
 severity codes can be given symbolic names by following each value
 with :name


FacilityNames=(System=0x0:FACILITY_SYSTEM
               Runtime=0x2:FACILITY_RUNTIME
               Stubs=0x3:FACILITY_STUBS
               Io=0x4:FACILITY_IO_ERROR_CODE
              )

 The FacilityNames keyword defines the set of names that are allowed
 as the value of the Facility keyword in the message definition. The
 set is delimited by left and right parentheses. Associated with each
 facility name is a number that, when shift it left by 16 bits, gives
 the bit pattern to logical-OR with the Severity value and MessageId
 value to form the full 32-bit message code. The default value of
 this keyword is:

 FacilityNames=(
   System=0x0FF
   Application=0xFFF
   )

 Facility codes occupy the low order 12 bits of the high order
 16-bits of a 32-bit message code. Any facility code that does not
 fit in 12 bits is an error. This allows for 4,096 facility codes.
 The first 256 codes are reserved for use by the system software. The
 facility codes can be given symbolic names by following each value
 with :name


 The LanguageNames keyword defines the set of names that are allowed
 as the value of the Language keyword in the message definition. The
 set is delimited by left and right parentheses. Associated with each
 language name is a number and a file name that are used to name the
 generated resource file that contains the messages for that
 language. The number corresponds to the language identifier to use
 in the resource table. The number is separated from the file name
 with a colon. The initial value of LanguageNames is:

 LanguageNames=(English=1:MSG00001)

 Any new names in the source file which don't override the built-in
 names are added to the list of valid languages. This allows an
 application to support private languages with descriptive names.


-------------------------------------------------------------------------
 MESSAGE DEFINITION SECTION

 Following the header section is the body of the Message Compiler
 source file. The body consists of zero or more message definitions.
 Each message definition begins with one or more of the following
 statements:

 MessageId = [number|+number]
 Severity = severity_name
 Facility = facility_name
 SymbolicName = name

 The MessageId statement marks the beginning of the message
 definition. A MessageID statement is required for each message,
 although the value is optional. If no value is specified, the value
 used is the previous value for the facility plus one. If the value
 is specified as +number then the value used is the previous value
 for the facility, plus the number after the plus sign. Otherwise, if
 a numeric value is given, that value is used. Any MessageId value
 that does not fit in 16 bits is an error.

 The Severity and Facility statements are optional. These statements
 specify additional bits to OR into the final 32-bit message code. If
 not specified they default to the value last specified for a message
 definition. The initial values prior to processing the first message
 definition are:

 Severity=Success
 Facility=Application

 The value associated with Severity and Facility must match one of
 the names given in the FacilityNames and SeverityNames statements in
 the header section. The SymbolicName statement allows you to
 associate a C/C++ symbolic constant with the final 32-bit message
 code.
 */
//
//  Values are 32 bit values laid out as follows:
//
//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
//  +---+-+-+-----------------------+-------------------------------+
//  |Sev|C|R|     Facility          |               Code            |
//  +---+-+-+-----------------------+-------------------------------+
//
//  where
//
//      Sev - is the severity code
//
//          00 - Success
//          01 - Informational
//          10 - Warning
//          11 - Error
//
//      C - is the Customer code flag
//
//      R - is a reserved bit
//
//      Facility - is the facility code
//
//      Code - is the facility's status code
//
//
// Define the facility codes
//


//
// Define the severity codes
//
#define STATUS_SEVERITY_WARNING          0x2
#define STATUS_SEVERITY_SUCCESS          0x0
#define STATUS_SEVERITY_INFORMATIONAL    0x1
#define STATUS_SEVERITY_ERROR            0x3


//
// MessageId: NTP_ERROR
//
// MessageText:
//
// %1
//
#define NTP_ERROR                        ((DWORD)0xC0000001L)

//
// MessageId: NTP_WARNING
//
// MessageText:
//
// %1
// 
//
#define NTP_WARNING                      ((DWORD)0x80000002L)

//
// MessageId: NTP_INFO
//
// MessageText:
//
// %1
// 
// 
// 
//
#define NTP_INFO                         ((DWORD)0x40000003L)

ntp-4.2.6p5/ports/winnt/libntp/messages.rc0000644000175000017500000000004511307651603017545 0ustar  peterpeterLANGUAGE 0x9,0x1
1 11 "MSG00001.bin"
ntp-4.2.6p5/ports/winnt/libntp/dnslookup.c0000644000175000017500000001115010544731257017577 0ustar  peterpeter/*
 * Copyright (C) 2006  Internet Systems Consortium, Inc. ("ISC")
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * This module uses Windows lookup facilities to get the address information
 * wherever it resides. This avoids calling the Internet standard funcction
 * gethostbyname and gives us more control over the results since the
 * Microsoft implementation seems to return the wrong error code for some
 * conditions.
 */

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

/*
 * Set this Macro to force retries even if it fails
 * the lookup
 */
#ifdef FORCE_DNSRETRY

#undef EAI_NONAME
#define EAI_NONAME EAI_AGAIN

#endif

typedef struct hostent hostent_t;

int ReturnCode(int errcode)
{
	int retcode;

	switch (errcode)
	{
	case 0:
		return (0);
	case WSAEINVAL:
		return (EAI_BADFLAGS);
	case WSANO_DATA:
		return (EAI_NONAME);
	case WSANOTINITIALISED:
	case WSASERVICE_NOT_FOUND:
		return (EAI_FAIL);
	case WSA_NOT_ENOUGH_MEMORY:
		return (EAI_MEMORY);
	default:
		return (EAI_FAIL);
	}
}

int
AddToAddresses(char **Addresses, int *cnt, CSADDR_INFO *csaddr)
{

	int csize;
	struct in_addr *sinaddr;
	char *addr;
	struct in_addr *addr_list;
	struct sockaddr_in *sin;
	sin = (struct sockaddr_in *) csaddr->RemoteAddr.lpSockaddr;
	if (*Addresses != NULL)
	{
		csize = _msize(*Addresses);
		addr_list = realloc(*Addresses, csize + sizeof(struct in_addr));
	}
	else
	{
		csize = 0;
		addr_list = malloc(sizeof(struct in_addr));
	}
	addr = (char *) addr_list;
	sinaddr = &((struct in_addr*) addr)[(*cnt)];
	memset(sinaddr, 0, sizeof(sinaddr));
	memcpy(sinaddr, &sin->sin_addr, sizeof(struct in_addr));
	
	(*cnt)++;
	*Addresses = (char *) addr_list;
	return 0;
}

int
DNSlookup_name(
	const char *name,
	int ai_family,
	struct hostent **Addresses
)
{
	char buffer[sizeof(WSAQUERYSET) + 2048];
	WSAQUERYSET query;
	struct hostent *addr = NULL;
	char *bufaddr = NULL;
	char ** addrlist = &bufaddr;
	int addrcnt = 0;
	WSAQUERYSET *results = (WSAQUERYSET *) buffer;
	GUID	HostnameGUID = SVCID_INET_HOSTADDRBYNAME;
	HANDLE	handle;
	DWORD dwLength;
	int err = 0;
	int retcode = 0;
	int errcode = 0;
	DWORD i;

	/*
	 * First we must create a query set
	 */
	memset(&query, 0, sizeof(query));
	query.dwSize = sizeof(query);
	query.lpszServiceInstanceName = (char *)name;
	query.dwNameSpace = NS_DNS;
	query.lpServiceClassId = &HostnameGUID;

	err = WSALookupServiceBegin(&query,
                                 LUP_RETURN_NAME | LUP_RETURN_BLOB | LUP_RETURN_ADDR,
                                 &handle);

	if(err == SOCKET_ERROR)
	{
		/*
		 * Convert the error code and return
		 */
		return (ReturnCode(WSAGetLastError()));
	}

	/*
	 * Initially none
	 * Change if we get something
	 */
	retcode = EAI_NONAME;
	dwLength = sizeof(buffer);

	while(err == 0)		/* Drop out when error */
	{
		memset(&buffer, 0, dwLength);
		err = WSALookupServiceNext(
			                handle,
			                0,
			                &dwLength,
			                results);
		errcode = WSAGetLastError();
		if (results->dwNumberOfCsAddrs > 0)
		{
			if (addr == NULL)
			{
				addr = (struct hostent *) malloc(sizeof(struct hostent));
				memset(addr, 0, sizeof(struct hostent));
				addr->h_addrtype = (short) results->lpcsaBuffer->iSocketType;
				addr->h_length = sizeof(struct in_addr); /* Only passing back the address */
				addrlist = malloc(sizeof(char *));
				*addrlist = NULL;
			}
			for (i = 0; i < results->dwNumberOfCsAddrs; i++)
			{
				AddToAddresses(addrlist, &addrcnt, &results->lpcsaBuffer[i]);
			}
		}

	}
	if (addr != NULL)
	{
		addr->h_name = (char *) name;
		addr->h_addr_list = addrlist;
		retcode = 0;
		*Addresses = addr;
	}
	else
	{
#ifdef FORCE_DNSRETRY
		/*
		 * We do this or the error would never be logged
		 */
		if (errcode == WSANO_DATA)
			msyslog(LOG_ERR, "Address not found for %s", name);
#endif
		retcode = ReturnCode(errcode);
	}
	WSALookupServiceEnd(handle);
	return (retcode);
}

ntp-4.2.6p5/ports/winnt/ppsapi/0000755000175000017500000000000011307651602015414 5ustar  peterpeterntp-4.2.6p5/ports/winnt/ppsapi/skelprov/0000755000175000017500000000000011675461367017300 5ustar  peterpeterntp-4.2.6p5/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.sln0000644000175000017500000000146311307651604024753 0ustar  peterpeter
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skeleton-ppsapi-provider", "skeleton-ppsapi-provider.vcproj", "{F7842ACD-EB61-4D65-9999-AFB0E77E63EA}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Win32 = Debug|Win32
		Release|Win32 = Release|Win32
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{F7842ACD-EB61-4D65-9999-AFB0E77E63EA}.Debug|Win32.ActiveCfg = Debug|Win32
		{F7842ACD-EB61-4D65-9999-AFB0E77E63EA}.Debug|Win32.Build.0 = Debug|Win32
		{F7842ACD-EB61-4D65-9999-AFB0E77E63EA}.Release|Win32.ActiveCfg = Release|Win32
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal
ntp-4.2.6p5/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.c0000644000175000017500000002310511307651605024377 0ustar  peterpeter/*
 * skeleton-ppsapi-provider.c - structure but no useful function
 */

/***********************************************************************
 *								       *
 * Copyright (c) David L. Mills 1999-2009			       *
 *								       *
 * Permission to use, copy, modify, and distribute this software and   *
 * its documentation for any purpose and without fee is hereby	       *
 * granted, provided that the above copyright notice appears in all    *
 * copies and that both the copyright notice and this permission       *
 * notice appear in supporting documentation, and that the name        *
 * University of Delaware not be used in advertising or publicity      *
 * pertaining to distribution of the software without specific,        *
 * written prior permission. The University of Delaware makes no       *
 * representations about the suitability this software for any	       *
 * purpose. It is provided "as is" without express or implied          *
 * warranty.							       *
 *								       *
 ***********************************************************************
 *								       *
 * This header file complies with "Pulse-Per-Second API for UNIX-like  *
 * Operating Systems, Version 1.0", rfc2783. Credit is due Jeff Mogul  *
 * and Marc Brett, from whom much of this code was shamelessly stolen. *
 *								       *
 * This skeleton-ppsapi-provider.c implements the PPSAPI provider DLL  *
 * interface but has no actual timestamp-fetching code.  It is	       *
 * derived from serialpps-ppsapi-provider.c which was derived from     *
 * David L. Mills' timepps.h for Solaris.			       *
 *								       *
 ***********************************************************************
 *								       *
 * Some of this include file					       *
 * Copyright (c) 1999 by Ulrich Windl,				       *
 *	based on code by Reg Clemens 		       *
 *		based on code by Poul-Henning Kamp    *
 *								       *
 ***********************************************************************
 *								       *
 * "THE BEER-WARE LICENSE" (Revision 42):			       *
 *  wrote this file.  As long as you retain this      *
 * notice you can do whatever you want with this stuff. If we meet some*
 * day, and you think this stuff is worth it, you can buy me a beer    *
 * in return.	Poul-Henning Kamp				       *
 *								       *
 **********************************************************************/


#include "skeleton-ppsapi-provider.h"

pcreate_pps_handle		p_create_pps_handle;
ppps_ntp_timestamp_from_counter	p_ntp_timestamp_from_counter;

#define SKELPPS_CAPS	(PPS_CAPTUREASSERT | PPS_OFFSETASSERT	\
			 | PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)
#define SKELPPS_RO	(PPS_CANWAIT | PPS_CANPOLL)


/*
 * The ntp_timestamp_from_counter callback into timepps.h routines in
 * the host is saved in each unit separately, so that binaries that
 * inline timepps.h into multiple source files (such as refclock_atom.c
 * and a number of other ntpd refclocks including refclock_nmea.c) will
 * get called back in the correct instance for each unit.  This assumes 
 * that ppsapi_prov_init for subsequent instances happens only after the
 * first instance has completed all time_pps_create() calls it will
 * invoke, which is a safe assumption at least for ntpd.
 */
typedef struct skel_unit_tag {
	HANDLE				device;
	ppps_ntp_timestamp_from_counter	p_ntp_timestamp_from_counter;
} skel_unit;


/*
 * DllMain - DLL entrypoint, no-op.
 */
BOOL APIENTRY DllMain(
	HMODULE	hModule,
	DWORD	ul_reason_for_call,
	LPVOID	lpReserved
	)
{
	UNUSED(hModule);
	UNUSED(ul_reason_for_call);
	UNUSED(lpReserved);

	return TRUE;
}


/*
 * prov_time_pps_create - create PPS handle given underlying device
 */
int WINAPI
prov_time_pps_create(
	HANDLE		device,	/* underlying device */
	pps_handle_t *	handle	/* returned handle */
	)
{
	skel_unit *	pskelunit;
	pps_unit_t *	punit;

	/*
	 * Allocate and initialize unit structure.
	 */

	pskelunit = malloc(sizeof(*pskelunit));
	if (NULL == pskelunit)
		return ENOMEM;

	pskelunit->device = device;
	pskelunit->p_ntp_timestamp_from_counter = p_ntp_timestamp_from_counter;

	*handle = (*p_create_pps_handle)(pskelunit);
	if (*handle) {
		punit = (pps_unit_t *)*handle;
		punit->params.api_version = PPS_API_VERS_1;
		punit->params.mode = PPS_CAPTUREASSERT | PPS_TSFMT_TSPEC;
	}

	return (*handle)
		   ? 0
		   : ENOMEM;
}


/*
 * prov_time_pps_destroy - release PPS handle
 */
int WINAPI
prov_time_pps_destroy(
	pps_unit_t *	unit,
	void *		context
	)
{
	skel_unit *pskelunit;

	UNUSED(unit);

	pskelunit = context;
	free(pskelunit);

	return 0;
}


/*
 * prov_time_pps_setparams - set parameters for handle
 */
int WINAPI
prov_time_pps_setparams(
	pps_unit_t *		unit,
	void *			context,
	const pps_params_t *	params
	)
{
	skel_unit *pskelunit;
	int	mode, mode_in;

	pskelunit = context;

	/*
	 * There was no reasonable consensus in the API working group.
	 * I require `api_version' to be set!
	 */

	if (params->api_version != PPS_API_VERS_1)
		return EINVAL;

	/*
	 * The only settable modes are PPS_CAPTUREASSERT,
	 * PPS_OFFSETASSERT, and the timestamp formats.
	 */

	mode_in = params->mode;

	/*
	 * Only one of the time formats may be selected
	 * if a nonzero assert offset is supplied.
	 */
	if ((mode_in & (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP))
	    == (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)) {

		if (params->assert_offset.tv_sec ||
		    params->assert_offset.tv_nsec) 
			return EINVAL;

		/*
		 * If no offset was specified but both time
		 * format flags are used consider it harmless
		 * but turn off PPS_TSFMT_NTPFP so getparams
		 * will not show both formats lit.
		 */
		mode_in &= ~PPS_TSFMT_NTPFP;
	}

	/* turn off read-only bits */

	mode_in &= ~SKELPPS_RO;

	/*
	 * test remaining bits, should only have captureassert, 
	 * offsetassert, and/or timestamp format bits.
	 */

	if (mode_in & ~(PPS_CAPTUREASSERT | PPS_OFFSETASSERT |
			PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP))
		return EOPNOTSUPP;

	/*
	 * ok, ready to go.
	 */

	mode = unit->params.mode;
	unit->params = *params;
	unit->params.mode = mode | mode_in;

	return 0;
}


/*
 * prov_time_pps_fetch - Fetch timestamps
 */

int WINAPI
prov_time_pps_fetch(
	pps_unit_t *		unit,
	void *			context,
	const int		tsformat,
	pps_info_t *		pinfo,
	const struct timespec *	timeout
	)
{
	ULONGLONG WindowsTimestamp;
	ULONGLONG Counterstamp;
	skel_unit *pskelunit;
	pps_info_t infobuf;

	/*
	 * nb. PPS_CANWAIT is NOT set by the implementation, we can totally
	 * ignore the timeout variable.
	 */
	UNUSED(timeout);
	pskelunit = context;

	memset(&infobuf, 0, sizeof(infobuf));

	/*
	 * if not captureassert, nothing to return.
	 */

	if (!(unit->params.mode & PPS_CAPTUREASSERT)) {
		*pinfo = infobuf;
		return 0;
	}

	/*
	 * ADD CODE to retrieve timestamp here.
	 */
	WindowsTimestamp = Counterstamp = 0;
	/*
	 * ADD CODE to retrieve timestamp here.
	 */

	/*
	 * pps_ntp_timestamp_from_counter takes the two flavors
	 * of timestamp we have (counter and system time) and
	 * uses whichever it can to give the best NTP fixed-point
	 * conversion.  In ntpd the Counterstamp is typically
	 * used.  A stub implementation in timepps.h simply
	 * converts from Windows timestamp to NTP fixed-point.
	 * We call through a pointer to get ntpd's version.
	 */
	(*pskelunit->p_ntp_timestamp_from_counter)(
		&infobuf.assert_timestamp_ntpfp, 
		WindowsTimestamp, 
		Counterstamp);

	/*
	 * Note that only assert timestamps
	 * are captured by this interface.
	 */
	infobuf.assert_sequence = 0; /* ADD CODE */

	/*
	 * Apply offset and translate to specified format
	 */
	switch (tsformat) {
	case PPS_TSFMT_NTPFP:	/* NTP format requires no translation */
		if (unit->params.mode & PPS_OFFSETASSERT) {
			NTPFP_L_ADDS(&infobuf.assert_timestamp_ntpfp, 
				     &unit->params.assert_offset_ntpfp);
		}
		break;		

	case PPS_TSFMT_TSPEC:	/* timespec format requires conversion to nsecs form */
		PPS_NTPTOTSPEC(infobuf.assert_timestamp);
		if (unit->params.mode & PPS_OFFSETASSERT) {
			infobuf.assert_timestamp.tv_sec  += 
				unit->params.assert_offset.tv_sec;
			infobuf.assert_timestamp.tv_nsec += 
				unit->params.assert_offset.tv_nsec;
			PPS_NORMALIZE(infobuf.assert_timestamp);
		}
		break;

	default:
		return EINVAL;
	}

	infobuf.current_mode = unit->params.mode;
	*pinfo = infobuf;
	return (0);
}


/*
 * prov_time_pps_kcbind - specify kernel consumer
 *
 * Not supported so far by Windows.
 */
int WINAPI
prov_time_pps_kcbind(
	pps_unit_t *	punit,
	void *		context,
	const int	kernel_consumer,
	const int	edge,
	const int	tsformat
	)
{
	UNUSED(punit);
	UNUSED(context);
	UNUSED(kernel_consumer);
	UNUSED(edge);
	UNUSED(tsformat);

	return EOPNOTSUPP;
}


/*
 * prov_init - returns capabilities and provider name
 */
int WINAPI
ppsapi_prov_init(
	int				ppsapi_timepps_prov_ver,
	pcreate_pps_handle		create_pps_handle,
	ppps_ntp_timestamp_from_counter ntp_timestamp_from_counter,
	char *				short_name_buf,
	size_t				short_name_size,
	char *				full_name_buf,
	size_t				full_name_size
	)
{
	ppsapi_provider test_prov;

	if (ppsapi_timepps_prov_ver < PPSAPI_TIMEPPS_PROV_VER)
		return 0;

	p_create_pps_handle = create_pps_handle;
	p_ntp_timestamp_from_counter = ntp_timestamp_from_counter;

	strncpy(short_name_buf, "skeleton", short_name_size);
	strncpy(full_name_buf, 
		"skeleton, ADD CODE to make useful",
		full_name_size);

	/*
	 * Use function pointer prototypes from timepps.h to verify
	 * our prototypes match with some otherwise pointless code.
	 */
	test_prov.ptime_pps_create = &prov_time_pps_create;
	test_prov.ptime_pps_destroy = &prov_time_pps_destroy;
	test_prov.ptime_pps_fetch = &prov_time_pps_fetch;
	test_prov.ptime_pps_kcbind = &prov_time_pps_kcbind;
	test_prov.ptime_pps_setparams = &prov_time_pps_setparams;
	
	return SKELPPS_CAPS;
}
ntp-4.2.6p5/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.vcproj0000644000175000017500000001110611307651603025454 0ustar  peterpeter

	
		
	
	
	
	
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		
	
	
	
	
		
			
				
					
				
			
		
		
			
			
			
			
			
			
		
		
		
	
	
	

ntp-4.2.6p5/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.def0000644000175000017500000000030411307651603024705 0ustar  peterpeterLIBRARY	"skeleton-ppsapi-provider.dll"

EXPORTS
    ppsapi_prov_init
    prov_time_pps_create
    prov_time_pps_destroy
    prov_time_pps_fetch
    prov_time_pps_kcbind
    prov_time_pps_setparamsntp-4.2.6p5/ports/winnt/ppsapi/skelprov/sys/0000755000175000017500000000000011675461367020116 5ustar  peterpeterntp-4.2.6p5/ports/winnt/ppsapi/skelprov/sys/time.h0000644000175000017500000000054311307651603021211 0ustar  peterpeter/*
 * This sys/time.h is part of ppsapi-prov skeleton sample source code
 * for a Windows PPSAPI provider DLL.  It was adapted from
 * ports/winnt/include/sys/time.h in ntpd.
 */

#ifndef SYS_TIME_H
#define SYS_TIME_H

#include 
#include 

typedef struct timespec {
	time_t	tv_sec;
	long	tv_nsec;
} timespec_t;

#endif /* SYS_TIME_H */
ntp-4.2.6p5/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h0000644000175000017500000000102011307651603024372 0ustar  peterpeter//
// serialpps-ppsapi-provider.h
//
// For this tiny project the single header serves as a precompiled header
// as well, meaning all the bulky headers are included before or within it.
// Within, in this case.
//

#define _CRT_SECURE_NO_WARNINGS
#include 
/* Prevent inclusion of winsock.h in windows.h */
#ifndef _WINSOCKAPI_
#define _WINSOCKAPI_  
#endif
#include 
typedef DWORD u_int32;
#include "sys/time.h"
#include "../../include/timepps.h"

#ifndef UNUSED
#define UNUSED(item)	((void)(item))
#endif
ntp-4.2.6p5/configure.ac0000644000175000017500000034606511636775105014130 0ustar  peterpeterdnl -*-fundamental-*-
dnl Process this file with autoconf to produce a configure script.
m4_include([version.m4])
AC_PREREQ([2.61])
AC_INIT([ntp], [VERSION_NUMBER])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([.])

# Increment ntp_configure_cache_version by one for each change to
# configure.ac or .m4 files which invalidates cached values from
# previous versions.
#
# If the change affects cache variables used only by the main NTP
# configure.ac, then only its version number should be bumped, while
# the subdir configure.ac version numbers should be unchanged.  The
# same is true for a test/variable that is used only by one subdir
# being changed incompatibly; only that subdir's cache version needs
# bumping.
#
# If a change affects variables shared by all NTP configure scripts,
# please bump the version numbers of all three.  If you are not sure,
# the safe choice is to bump all three on any cache-invalidating change.
#
# In order to avoid the risk of version stamp collision between -stable
# and -dev branches, do not simply increment the version, instead use
# the date YYYYMMDD optionally with -HHMM if there is more than one
# bump in a day.

ntp_configure_cache_version=20091117

# When the cache version of config.cache and configure do not
# match, NTP_CACHEVERSION will flush the cache.

NTP_CACHEVERSION([main], [$ntp_configure_cache_version])

AM_INIT_AUTOMAKE
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
dnl the 'build' machine is where we run configure and compile
dnl the 'host' machine is where the resulting stuff runs.
AC_DEFINE_UNQUOTED([STR_SYSTEM], ["$host"],
    [canonical system (cpu-vendor-os) of where we should run])
AM_CONFIG_HEADER([config.h])
dnl AC_ARG_PROGRAM

ntp_atom_ok=${ntp_atom_ok=no}
ntp_oncore_ok=${ntp_oncore_ok=no}
ntp_parse_ok=${ntp_parse_ok=no}
ntp_ripe_ncc_ok=${ntp_parse_ok=no}
ntp_jupiter_ok=${ntp_jupiter_ok=no}

dnl check these early to avoid autoconf warnings
AC_AIX
AC_MINIX

# 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.
AC_DISABLE_SHARED

dnl  we need to check for cross compile tools for vxWorks here
AC_PROG_CC
# Ralf Wildenhues: With per-target flags we need CC_C_O
# AM_PROG_CC_C_O supersets AC_PROG_CC_C_O
AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_YACC

# AC_PROG_CC_STDC has two functions.  It attempts to find a compiler
# capable of C99, or failing that, for C89.  CC is set afterward with
# the selected invocation, such as "gcc --std=gnu99".  Also, the
# ac_cv_prog_cc_stdc variable is no if the compiler selected for CC
# does not accept C89.

AC_PROG_CC_STDC

case "$ac_cv_prog_cc_stdc" in
 no)
    AC_MSG_WARN([ANSI C89/ISO C90 is the minimum to compile NTP ]
		[version 4.2.5 and higher.])
esac

# HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS
case "$host" in
 *-pc-cygwin*)
    CFLAGS="$CFLAGS -DSYS_CYGWIN32"
    ;;
 i386-sequent-sysv4)
    case "$CC" in
     cc)
	CFLAGS="$CFLAGS -Wc,+abi-socket"
	;;
    esac
    ;;
 *-*-mpeix*)
    CPPFLAGS="$CPPFLAGS -DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB"
    LDFLAGS="$LDFLAGS -L/SYSLOG/PUB"
    LIBS="$LIBS -lcurses"
    ;;
 *-*-solaris*)
    # see "man standards".
    # -D_XOPEN_SOURCE=500 is probably OK for c89 and before
    # -D_XOPEN_SOURCE=600 seems OK for c99
    #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
    CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
    libxnet=-lxnet
    ;;
esac

NTP_OS_CFLAGS
NTP_DIR_SEP
NTP_VPATH_HACK

# NTP has (so far) been relying on leading-edge autogen.
# Therefore, by default:
# - use the version we ship with
# - do not install it
# - build a static copy (AC_DISABLE_SHARED - done earlier)
case "${enable_local_libopts+set}" in
 set) ;;
 *) enable_local_libopts=yes ;;
esac
case "${enable_libopts_install+set}" in
 set) ;;
 *) enable_libopts_install=no ;;
esac
LIBOPTS_CHECK_NOBUILD([sntp/libopts])

AC_FUNC_FORK

AC_CACHE_CHECK(
    [if $CC can handle @%:@warning],
    [ntp_cv_cpp_warning],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM([[]], [[#warning foo]])],
	[ntp_cv_cpp_warning=yes],
	[ntp_cv_cpp_warning=no]
    )]
)
case "$ntp_cv_cpp_warning" in
 no)
    AC_DEFINE([NO_OPTION_NAME_WARNINGS], [1],
	[Should we avoid @%:@warning on option name collisions?])
esac

case "$GCC" in
 yes)
    SAVED_CFLAGS_NTP="$CFLAGS"
    CFLAGS="$CFLAGS -Wstrict-overflow"
    AC_CACHE_CHECK(
	[if $CC can handle -Wstrict-overflow], 
	[ntp_cv_gcc_Wstrict_overflow], 
	[AC_COMPILE_IFELSE(
	    [AC_LANG_PROGRAM([[]], [[]])],
	    [ntp_cv_gcc_Wstrict_overflow=yes],
	    [ntp_cv_gcc_Wstrict_overflow=no]
	)	]
    )
    #
    # $ntp_cv_gcc_Wstrict_overflow is tested later to add the 
    # flag to CFLAGS.
    #
    CFLAGS="$SAVED_CFLAGS_NTP -Winit-self"
    AC_CACHE_CHECK(
	[if $CC can handle -Winit-self], 
	[ntp_cv_gcc_Winit_self],
	[
	    AC_COMPILE_IFELSE(
		[AC_LANG_PROGRAM([[]], [[]])],
		[ntp_cv_gcc_Winit_self=yes],
		[ntp_cv_gcc_Winit_self=no]
	    )
	]
    )
    CFLAGS="$SAVED_CFLAGS_NTP"
    AS_UNSET([SAVED_CFLAGS_NTP])
    #
    # $ntp_cv_gcc_Winit_self is tested later to add the 
    # flag to CFLAGS.
    #
esac

# Expose a cross-compilation indicator to makefiles
AM_CONDITIONAL([NTP_CROSSCOMPILE], [test $build != $host])

AC_MSG_CHECKING([for bin subdirectory])
AC_ARG_WITH(
    [binsubdir],
    [AS_HELP_STRING(
	[--with-binsubdir],
	[bin ={bin,sbin}]
    )],
    [use_binsubdir="$withval"],
    [use_binsubdir="bin"]
)
case "$use_binsubdir" in
 bin)
    ;;
 sbin)
    ;;
 *)
    AC_MSG_ERROR([<$use_binsubdir> is illegal - must be "bin" or "sbin"])
    ;;
esac
AC_MSG_RESULT([$use_binsubdir])

BINSUBDIR=$use_binsubdir
AC_SUBST([BINSUBDIR])
AM_CONDITIONAL([NTP_BINSUBDIR_IS_BIN], [test "bin" = "$BINSUBDIR"])

AC_MSG_CHECKING([for deprecated --with-arlib])
AC_ARG_WITH([arlib],
	AS_HELP_STRING([--with-arlib], [- deprecated, arlib not distributed]),
	[ans=$withval], [ans=no])
AC_MSG_RESULT([$ans])

case "$ans" in
 yes)
    AC_MSG_WARN([Please do not use --with-arlib, arlib is no longer included.  In the future, --with-arlib will not be recognized.])
esac

AC_ARG_WITH(rpath,
	AS_HELP_STRING([--without-rpath], [s Disable auto-added -R linker paths]),
[ans=$withval], [ans=x])
case "$ans" in
 no)
    need_dash_r=
    ;;
 yes)
    need_dash_r=1
    ;;
esac
# HMS: Why isn't this $build?
# Well, that depends on if we need this for the build toolchain or
# for info in the host executable...
# I still have no idea which way this should go, but nobody has complained.
case "$host" in
 *-*-netbsd*)
    case "$need_dash_r" in
     no) ;;
     *)  need_dash_r=1
	 ;;
    esac
    ;;
 *-*-solaris*)
    case "$need_dash_r" in
     no) ;;
     *)  need_dash_r=1
	 ;;
    esac
    ;;
esac

dnl  we need to check for cross compile tools for vxWorks here
AC_PROG_AWK
AC_PROG_MAKE_SET

rm -f conftest*

case "$GCC" in
 yes)
    CFLAGS="$CFLAGS -Wall"
    # CFLAGS="$CFLAGS -Wcast-align"
    CFLAGS="$CFLAGS -Wcast-qual"
    # CFLAGS="$CFLAGS -Wconversion"
    # CFLAGS="$CFLAGS -Werror"
    # CFLAGS="$CFLAGS -Wextra"
    # CFLAGS="$CFLAGS -Wfloat-equal"
    CFLAGS="$CFLAGS -Wmissing-prototypes"
    CFLAGS="$CFLAGS -Wpointer-arith"
    CFLAGS="$CFLAGS -Wshadow"
    # CFLAGS="$CFLAGS -Wtraditional"
    # CFLAGS="$CFLAGS -Wwrite-strings"
    case "$ntp_cv_gcc_Winit_self" in
     yes)
	CFLAGS="$CFLAGS -Winit-self"
    esac
    case "$ntp_cv_gcc_Wstrict_overflow" in
     yes)
	CFLAGS="$CFLAGS -Wstrict-overflow"
    esac
    # -W[no-]strict-prototypes is added later depending on OpenSSL
esac

ac_busted_vpath_in_make=no

case "$build" in
 *-*-irix6.1*)	# 64 bit only
    # busted vpath?
    ;;
 *-*-irix6*)	# 6.2 (and later?)
    ac_busted_vpath_in_make=yes
    ;;
 *-*-solaris2.5.1)
    ac_busted_vpath_in_make=yes
    ;;
 *-*-unicosmp*)
    ac_busted_vpath_in_make=yes
    ;;
esac

case "$ac_busted_vpath_in_make$srcdir" in
 no*) ;;
 yes.) ;;
 *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | sed -e 's/GNU Make version \(1-9.]*\).*/\1/' -e q`" in
     '')
	AC_MSG_ERROR([building outside of the main directory requires GNU make])
	;;
     *) ;;
    esac
    ;;
esac

AC_SUBST([CFLAGS])
AC_SUBST([LDFLAGS])

AC_PROG_LIBTOOL

AC_PROG_LN_S
AC_PROG_GCC_TRADITIONAL
AC_C_VOLATILE
AC_ISC_POSIX

AC_PATH_PROG([PATH_PERL], [perl])
AC_PATH_PROG([PATH_SH], [sh])
AC_PATH_PROG([PATH_TEST], [test])

AC_ARG_WITH(
    [net-snmp-config],
    [AS_HELP_STRING(
	[--with-net-snmp-config],
	[+ =net-snmp-config]
    )],
    [ans=$withval],
    [ans=yes]
)
case "$ans" in
 no)
    ;;
 yes)
    ans=net-snmp-config
    ;;
 /*)
    ;;
 */*)
    AC_MSG_ERROR([--with-net-snmp-config takes either a name or an absolute path])
    ;;
 *)
    ;;
esac
PROG_NET_SNMP_CONFIG=$ans
AC_MSG_CHECKING([for net-snmp-config path])
case "$PROG_NET_SNMP_CONFIG" in
 no) ;;
 /*)
    PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG
    ;;
 *)
    AC_PATH_PROG([PATH_NET_SNMP_CONFIG], [$PROG_NET_SNMP_CONFIG])
    ;;
esac
AC_MSG_RESULT([$PATH_NET_SNMP_CONFIG])

case "$host" in
 *-*-vxworks*)
    ac_link="$ac_link $VX_KERNEL"
    ;;
esac

AC_PROG_INSTALL

AC_CHECK_FUNC([gethostent], ,
  AC_SEARCH_LIBS([gethostent], [nsl], , , [$libxnet -lsocket]))
AC_CHECK_FUNC([openlog], , 
  AC_SEARCH_LIBS([openlog], [gen], , 
  AC_SEARCH_LIBS([openlog], [syslog], , , [$libxnet -lsocket])))
AC_SEARCH_LIBS([MD5Init], [md5 md])
AC_CHECK_FUNCS(MD5Init)

NTP_LINEEDITLIBS

dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
dnl so only use one of them.  Linux (glibc-2.1.2 and -2.2.2, at least)
dnl does Strange Things with extra processes using the Posix-compatibility
dnl real-time library, so we don't want to use it.
dnl
dnl 081118 Harlan got tired of looking for a way to get the sched*()
dnl functions to link OK with either cc or gcc.

case "$host" in
 *-*-*linux*) ;;
 *-*-osf4*) ;;
 *-*-osf5*) ;;
 *)
    AC_CHECK_LIB([rt], [sched_setscheduler], [],
	[AC_CHECK_LIB([posix4], [sched_setscheduler])])
    ;;
esac

AC_SEARCH_LIBS([setsockopt], [socket xnet])
AC_SEARCH_LIBS([res_init], [resolv], [], [], [-lsocket -lnsl])
case "$host" in
 *-*-darwin*)
    AC_CHECK_LIB([resolv],[res_9_init])
    ;;
esac
AC_HEADER_RESOLV
AC_CHECK_FUNCS([res_init __res_init])

AC_HEADER_STDC
AC_CHECK_HEADERS([bstring.h])
AC_CHECK_HEADER(
    [dns_sd.h],
    [AC_CHECK_LIB(
	[dns_sd],
	[DNSServiceRegister],
	[AC_DEFINE([HAVE_DNSREGISTRATION], [1],
	    [Use Rendezvous/DNS-SD registration])]
    )]
)
case "$ac_cv_lib_dns_sd_DNSServiceRegister" in
 yes)
    LIBS="-ldns_sd $LIBS"
esac
AC_CHECK_HEADERS([errno.h fcntl.h ieeefp.h kvm.h math.h])

AC_CHECK_HEADERS(
    [md5.h],
    [],
    [],
    [
	#ifdef HAVE_SYS_TYPES_H
	# include 
	#endif
    ]
)
AC_CHECK_HEADERS([memory.h netdb.h poll.h])
AC_CHECK_HEADERS([sgtty.h stdlib.h string.h termio.h])
AC_CHECK_HEADERS([termios.h timepps.h timex.h unistd.h])

case "$host" in
 *-*-aix*)
    AC_CHECK_HEADERS([utmpx.h])
    case "$ac_cv_header_utmpx_h" in
     yes)
	;;
     *)
	AC_CHECK_HEADERS([utmp.h])
	;;
    esac
    ;;
 *) 
    AC_CHECK_HEADERS([utmp.h utmpx.h])
    ;;
esac

#
# On Suns only (so far) getpass() truncates the typed password to 8
# characters, but getpassphrase() allows up to 257.  Most systems'
# getpass() does not truncate, at least not so as to affect ntpq and
# ntpdc password prompts.
#
# So check for getpassphrase(), but only on Sun operating systems.
#
case "$host" in
 *-*-sunos*|*-*-solaris*)
    AC_CHECK_FUNCS([getpassphrase])
esac

AC_CHECK_HEADERS([arpa/nameser.h])
AC_CHECK_HEADERS([sys/socket.h])

dnl  HP-UX 11.31 on HPPA has a net/if.h that can't be compiled with gcc4
dnl  due to an incomplete type (a union) mpinfou used in an array.  gcc3
dnl  compiles it without complaint.  The mpinfou union is defined later
dnl  in the resulting preprocessed source than the spu_info array in
dnl  /usr/include/machine/sys/getppdp.h:
dnl	extern union mpinfou spu_info[];
dnl  triggering the error.  Our strategy is on HP-UX only, test for
dnl  net/netmp.h, which is the file included by net/if.h that leads to
dnl  getppdp.h.  If it is present but can't be compiled, try adding
dnl  a duplicate definition of mpinfou, which should then allow the
dnl  following net/if.h and net/if6.h tests to proceed normally.
dnl  Using net/netmp.h allows us to avoid polluting test results for
dnl  net/if.h.
#
case "$host" in
 *-hp-hpux*)
    AC_CHECK_HEADERS(
	[net/netmp.h],
	[netmp_h_works=yes],
	[netmp_h_works=no]
    )
    case "$netmp_h_works" in
     no)
	cat >>confdefs.h <<_ACEOF
#ifndef MPINFOU_PREDECLARED
# define MPINFOU_PREDECLARED
typedef union mpinfou {		/* For lint */
	struct pdk_mpinfo *pdkptr;
	struct mpinfo *pikptr;
} mpinfou_t;
#endif
_ACEOF
	AH_BOTTOM([
#ifndef MPINFOU_PREDECLARED
# define MPINFOU_PREDECLARED
typedef union mpinfou {		/* For lint */
	struct pdk_mpinfo *pdkptr;
	struct mpinfo *pikptr;
} mpinfou_t;
#endif
])
	;;
    esac
    ;;
esac

case "$host" in
 *-linux*)
    AC_CHECK_HEADERS([linux/if_addr.h], [], [], [
	#ifdef HAVE_SYS_SOCKET_H
	# include 
	#endif
    ])
esac

AC_CHECK_HEADERS([net/if.h], [], [],
[#ifdef HAVE_SYS_SOCKET_H
#include 
#endif
])
AC_CHECK_HEADERS([net/if6.h])
AC_CHECK_HEADERS([net/route.h], [], [], [
#include 
#include 
#include 
])
AC_CHECK_HEADERS([netinet/in_system.h netinet/in_systm.h netinet/in.h])
AC_CHECK_HEADERS([net/if_var.h], [], [],
[#if HAVE_SYS_TYPES_H
#include 
#endif
#ifdef HAVE_SYS_SOCKET_H
#include 
#endif
#ifdef HAVE_NETINET_IN_H
#include 
#endif
#ifdef HAVE_NET_IF_H
#include 
#endif
])
AC_CHECK_HEADERS([netinet/ip.h netinet/in_var.h], [], [],
[#ifdef HAVE_SYS_TYPES_H
#include 
#endif
#ifdef HAVE_SYS_SOCKET_H
#include 
#endif
#ifdef HAVE_NET_IF_H
#include 
#endif
#ifdef HAVE_NETINET_IN_H
#include 
#endif
#ifdef HAVE_NET_IF_VAR_H
#include 
#endif
#ifdef HAVE_NETINET_IN_SYSTM_H
#include 
#endif
])

# Check for IPTOS_PREC
AC_CACHE_CHECK(
    [IPPROTO_IP IP_TOS IPTOS_LOWDELAY],
    [ntp_cv_ip_tos],
    [AC_EGREP_CPP(
	[yes],
	[
	    #ifdef HAVE_SYS_TYPES_H
	    # include 
	    #endif
	    #ifdef HAVE_NETINET_IP_H
	    # include 
	    # include 
	    #endif
	    #if defined(IPPROTO_IP) && defined(IP_TOS) && defined(IPTOS_LOWDELAY)
		yes
	    #endif
	],
	[ntp_cv_ip_tos=yes],
	[ntp_cv_ip_tos=no]
    )]
)
case "$ntp_cv_ip_tos" in
 yes)
    AC_DEFINE([HAVE_IPTOS_SUPPORT], [1], [Do we have IPTOS support?])
esac

AC_CHECK_HEADERS([netinfo/ni.h])
case "$ac_cv_header_netinfo_ni_h" in
 yes)
    AC_DEFINE([HAVE_NETINFO], [1], [NetInfo support?])
esac
AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h])
dnl AC_CHECK_HEADERS([sys/chudefs.h])
AC_CHECK_HEADERS([sys/clkdefs.h sys/file.h])
case "$host" in
 *-*-sunos4*)
    ;;
 *) 
    AC_CHECK_HEADERS([sys/ioctl.h])
    ;;
esac
AC_CHECK_HEADERS([sys/ipc.h sys/lock.h sys/mman.h])
AC_CHECK_HEADERS([sys/modem.h sys/param.h sys/ppsclock.h])
# HMS: Check sys/proc.h and sys/resource.h after some others
AC_CHECK_HEADERS([sys/ppstime.h sched.h])
case "$ac_cv_header_sched_h" in
 yes)
    ;;
 *) 
    AC_CHECK_HEADERS([sys/sched.h])
    ;;
esac
case "$host" in
 *-*-sco*)
    AC_CHECK_HEADERS([sys/sio.h])
    ;;
esac
# HMS: Check sys/shm.h after some others
AC_CHECK_HEADERS([sys/select.h sys/signal.h sys/sockio.h])
# HMS: Checked sys/socket.h earlier
case "$host" in
 *-*-netbsd*)
    ;;
 *) 
    AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h])
    ;;
esac
AC_CHECK_HEADERS([sys/stat.h sys/stream.h sys/stropts.h])
# sys/sysctl.h depends on sys/param.h on OpenBSD - Bug 1576
AC_CHECK_HEADERS([sys/sysctl.h], [], [],
[#if defined HAVE_SYS_PARAM_H
# include 
#endif])
AC_CHECK_HEADERS([sys/syssgi.h sys/systune.h])
AC_CHECK_HEADERS([sys/termios.h sys/time.h sys/signal.h])
AC_EGREP_CPP(
    [yes],
    [
	#ifdef HAVE_SYS_TIME_H
	# include 
	#endif
	#ifdef HAVE_ERRNO_H
	# include 
	#endif
	#include 
	#ifdef PPS_API_VERS_1
	    yes
	#endif
    ],
    [AC_CHECK_HEADERS(
	[sys/timepps.h],
	[],
	[],
	[
	    #ifdef HAVE_SYS_TIME_H
	    # include 
	    #endif
	    #ifdef HAVE_ERRNO_H
	    # include 
	    #endif
	]
    )]
)
AC_CHECK_HEADERS([sys/timers.h sys/tpro.h sys/types.h sys/wait.h])
AC_HEADER_TIME
case "$host" in
*-convex-*)
    AC_CHECK_HEADERS([/sys/sync/queue.h /sys/sync/sema.h])
    ;;
*-*-bsdi*)
    AC_CHECK_HEADERS([machine/inline.h sys/pcl720.h sys/i8253.h])
    ;;
esac

case "$host" in
 *-*-*linux*)
    AC_CHECK_FUNCS([__adjtimex __ntp_gettime])
    ;;
esac
case "$ac_cv_func___adjtimex" in
 yes)
    ;;
 *)
    AC_CHECK_LIB([elf], [nlist])	dnl Only needed for tickadj...
    dnl AC_CHECK_LIB(kvm, main, , , -lelf)
    AC_CHECK_LIB([kvm], [main])		dnl We already know about -lelf here...
    AC_CHECK_LIB([ld], [nlist])
    AC_CHECK_LIB([mld], [nlist])
    AC_CHECK_HEADERS([nlist.h sys/var.h])
    case "$ac_cv_header_nlist_h" in
     yes)
	AC_DEFINE([NLIST_STRUCT], [1], [nlist stuff])
    esac
    AC_CACHE_CHECK(
	[for n_un in struct nlist],
	[ntp_cv_struct_nlist_n_un],
	[AC_COMPILE_IFELSE(
	    [AC_LANG_PROGRAM(
		[[
		    #include 
		]],
		[[
		    struct nlist n;
		    n.n_un.n_name = 0;
		]]
	    )]
	    [ntp_cv_struct_nlist_n_un=yes],
	    [ntp_cv_struct_nlist_n_un=no]
	)]
    )
    case "$ntp_cv_struct_nlist_n_un" in
     yes)
	AC_DEFINE([NLIST_NAME_UNION], [1],
	    [does struct nlist use a name union?])
    esac
    ;;
esac

AC_CHECK_HEADERS([sys/proc.h], [], [],
[#ifdef HAVE_SYS_TYPES_H
# include 
#endif
#ifdef HAVE_SYS_TIME_H
# include 
#endif
])

AC_CHECK_HEADERS([sys/resource.h], [], [],
[#ifdef HAVE_SYS_TIME_H
# include 
#endif
])

AC_CHECK_HEADERS([sys/shm.h], [], [],
[#ifdef HAVE_SYS_TYPES_H
# include 
#endif
#ifdef HAVE_SYS_IPC_H
# include 
#endif
])

AC_CHECK_HEADERS([sys/timex.h], [], [],
[#if HAVE_SYS_TIME_H
# include 
#endif
])

AC_CHECK_HEADERS([resolv.h], [], [],
[#ifdef HAVE_SYS_TYPES_H
#include 
#endif
#ifdef HAVE_NETINET_IN_H
#include 
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include 
#endif
])

AC_CACHE_CHECK(
    [for basic volatile support],
    [ntp_cv_c_volatile],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
	    ]],
	    [[
		volatile int x;
	    ]]
	)]
	[ntp_cv_c_volatile=yes],
	[ntp_cv_c_volatile=no]
    )]
)
case "$ntp_cv_c_volatile" in
 yes)
    ;;
 *)
    AC_DEFINE([volatile], [], [define away volatile?])
    ;;
esac

AC_C_CONST
AC_C_BIGENDIAN
AC_TYPE_SIGNAL
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_CHECK_TYPES([time_t, long, uintptr_t])
AC_CHECK_SIZEOF([time_t])
 
AH_VERBATIM([TYPEDEF_UINTPTR_T],
[/* Provide a typedef for uintptr_t? */
#ifndef HAVE_UINTPTR_T
typedef unsigned int	uintptr_t;
#define HAVE_UINTPTR_T	1
#endif])

AC_STRUCT_TM

AC_CACHE_CHECK(
    [for u_int8_t],
    [ntp_cv_type_u_int8_t],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
	    ]],
	    [[
		u_int8_t len = 42;
	    ]]
	)],
	[ntp_cv_type_u_int8_t=yes],
	[ntp_cv_type_u_int8_t=no]
    )]
)
case "$ntp_cv_type_u_int8_t" in
 yes)
    AC_DEFINE([HAVE_TYPE_U_INT8_T], [1], [Does u_int8_t exist?])
esac

AC_CACHE_CHECK(
    [for u_int64_t],
    [ntp_cv_type_u_int64_t],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
	    ]],
	    [[
		u_int64_t len = 42;
	    ]]
	)],
	[ntp_cv_type_u_int64_t=yes],
	[ntp_cv_type_u_int64_t=no]
    )]
)
case "$ntp_cv_type_u_int64_t" in
 yes)
    AC_DEFINE([HAVE_TYPE_U_INT64_T], [1], [Does u_int64_t exist?])
esac

AC_CACHE_CHECK(
    [for a fallback value for HZ],
    [ntp_cv_default_hz],
    [
	ntp_cv_default_hz=100
	case "$host" in
	 alpha*-dec-osf4*|alpha*-dec-osf5*)
	    ntp_cv_default_hz=1024
	    ;;
	 mips-dec-ultrix4*)
	    ntp_cv_default_hz=256
	    ;;
	esac
    ]
)
AC_DEFINE_UNQUOTED([DEFAULT_HZ], [$ntp_cv_default_hz],
    [What is the fallback value for HZ?])

AC_CACHE_CHECK(
    [if we need to override the system's value for HZ],
    [ntp_cv_override_hz],
    [
	ntp_cv_override_hz=no
	case "$host" in
	 alpha*-dec-osf4*|alpha*-dec-osf5*)
	    ntp_cv_override_hz=yes
	    ;;
	 mips-dec-ultrix4*)
	    ntp_cv_override_hz=yes
	    ;;
	 *-*-freebsd*)
	    ntp_cv_override_hz=yes
	    ;;
	 *-*-sunos4*)
	    ntp_cv_override_hz=yes
	    ;;
	 *-*-kfreebsd*)
	    ntp_cv_override_hz=yes
	    ;;
	esac
    ]
)
case "$ntp_cv_override_hz" in
 yes)
    AC_DEFINE([OVERRIDE_HZ], [1],
	[Do we need to override the system's idea of HZ?])
esac

dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
dnl [AC_TRY_LINK([#include 
dnl #include ], [struct utmp ut; ut.ut_host;],
dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
dnl if test $su_cv_func_ut_host_in_utmp = yes; then
dnl   AC_DEFINE(HAVE_UT_HOST)
dnl fi

dnl AC_MSG_CHECKING(if we can get the system boot time)
dnl AC_CACHE_VAL(su_cv_have_boot_time,
dnl [AC_EGREP_CPP(yes,
dnl [#ifdef HAVE_UTMPX_H
dnl #include 
dnl #else
dnl #include 
dnl #endif
dnl #ifdef BOOT_TIME
dnl yes
dnl #endif
dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
dnl AC_MSG_RESULT($su_cv_have_boot_time)

AC_CACHE_CHECK(
    [for struct rt_msghdr],
    [ntp_cv_struct_rt_msghdr],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
		#include 
		#include 
		#include 
	    ]],
	    [[
		struct rt_msghdr p;
	    ]]
	)],
	[ntp_cv_struct_rt_msghdr=yes],
	[ntp_cv_struct_rt_msghdr=no]
    )]
)

AC_CACHE_CHECK(
    [for struct rtattr],
    [ntp_cv_rtattr],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
		#include 
		#include 
	    ]],
	    [[
		struct rtattr p;
	    ]]
	)],
	[ntp_cv_rtattr=yes],
	[ntp_cv_rtattr=no]
    )]
)

case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in
 *yes*)
    AC_DEFINE([HAS_ROUTING_SOCKET], [1],
	[Do we have a routing socket (rt_msghdr or rtattr)?])
    case "$ntp_cv_rtattr" in
     yes)
	AC_DEFINE([HAVE_RTNETLINK], [1],
	    [Do we have Linux routing socket?])
    esac
esac

AC_CACHE_CHECK(
    [struct sigaction for sa_sigaction],
    [ntp_cv_struct_sigaction_has_sa_sigaction],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
	    ]],
	    [[
		struct sigaction act;
		act.sa_sigaction = 0;
	    ]]
	)],
	[ntp_cv_struct_sigaction_has_sa_sigaction=yes],
	[ntp_cv_struct_sigaction_has_sa_sigaction=no]
    )]
)
case "$ntp_cv_struct_sigaction_has_sa_sigaction" in
 yes)
    AC_DEFINE([HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION], [1], [Obvious])
esac

AC_CACHE_CHECK(
    [for struct ppsclockev],
    [ntp_cv_struct_ppsclockev],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
		#ifdef HAVE_SYS_TERMIOS_H
		# include 
		#endif
		#ifdef HAVE_SYS_TIME_H
		# include 
		#endif
		#ifdef HAVE_SYS_PPSCLOCK_H
		# include 
		#endif
	    ]],
	    [[
		extern struct ppsclockev *pce;
		return pce->serial;
	    ]]
	)],
	[ntp_cv_struct_ppsclockev=yes],
	[ntp_cv_struct_ppsclockev=no]
    )]
)
case "$ntp_cv_struct_ppsclockev" in
 yes)
    AC_DEFINE([HAVE_STRUCT_PPSCLOCKEV], [1],
	[Does a system header define struct ppsclockev?])
esac

AC_CACHE_CHECK(
    [for struct sockaddr_storage],
    [ntp_cv_sockaddr_storage],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
		#ifdef HAVE_SYS_SOCKET_H
		# include 
		#endif
		#ifdef HAVE_NETINET_IN_H
		# include 
		#endif
	    ]],
	    [[
		struct sockaddr_storage n;
	    ]]
	)],
	[ntp_cv_sockaddr_storage=yes],
	[ntp_cv_sockaddr_storage=no]
    )]
)
case "$ntp_cv_sockaddr_storage" in
 yes)
    AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], [1],
	[Does a system header define struct sockaddr_storage?])
esac

AC_CACHE_CHECK(
    [for sockaddr_storage.ss_family],
    [ntp_cv_have_ss_family],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
		#ifdef HAVE_SYS_SOCKET_H
		# include 
		#endif
		#ifdef HAVE_NETINET_IN_H
		# include 
		#endif
	    ]],
	    [[
		struct sockaddr_storage s;
		s.ss_family = 1;
	    ]]
	)],
	[ntp_cv_have_ss_family=yes],
	[ntp_cv_have_ss_family=no]
    )]
)

case "$ntp_cv_have_ss_family" in
 no)
    AC_CACHE_CHECK(
	[for sockaddr_storage.__ss_family],
	[ntp_cv_have___ss_family],
	[AC_COMPILE_IFELSE(
	    [AC_LANG_PROGRAM(
		[[
		    #ifdef HAVE_SYS_TYPES_H
		    # include 
		    #endif
		    #ifdef HAVE_SYS_SOCKET_H
		    # include 
		    #endif
		    #ifdef HAVE_NETINET_IN_H
		    # include 
		    #endif
		]],
		[[
		    struct sockaddr_storage s;
		    s.__ss_family = 1;
		]]
	    )],
	    [ntp_cv_have___ss_family=yes],
	    [ntp_cv_have___ss_family=no]
	)]
    )
    case "$ntp_cv_have___ss_family" in
     yes)
	AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1],
	    [Does struct sockaddr_storage have __ss_family?])
    esac
esac

AH_VERBATIM(
    [HAVE___SS_FAMILY_IN_SS_VERBATIM],
    [
	/* Handle sockaddr_storage.__ss_family */
	#ifdef HAVE___SS_FAMILY_IN_SS
	# define ss_family __ss_family
	#endif /* HAVE___SS_FAMILY_IN_SS */
    ]
)

AC_CACHE_CHECK(
    [for sockaddr_storage.ss_len],
    [ntp_cv_have_ss_len],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
		#ifdef HAVE_SYS_SOCKET_H
		# include 
		#endif
		#ifdef HAVE_NETINET_IN_H
		# include 
		#endif
	    ]],
	    [[
		struct sockaddr_storage s;
		s.ss_len = 1;
	    ]]
	)],
	[ntp_cv_have_ss_len=yes],
	[ntp_cv_have_ss_len=no]
    )]
)

case "$ntp_cv_have_ss_len" in
 no)
    AC_CACHE_CHECK(
	[for sockaddr_storage.__ss_len],
	[ntp_cv_have___ss_len],
	[AC_COMPILE_IFELSE(
	    [AC_LANG_PROGRAM(
		[[
		    #ifdef HAVE_SYS_TYPES_H
		    # include 
		    #endif
		    #ifdef HAVE_SYS_SOCKET_H
		    # include 
		    #endif
		    #ifdef HAVE_NETINET_IN_H
		    # include 
		    #endif
		]],
		[[
		    struct sockaddr_storage s;
		    s.__ss_len = 1;
		]]
	    )],
	    [ntp_cv_have___ss_len=yes],
	    [ntp_cv_have___ss_len=no]
	)]
    )
    case "$ntp_cv_have___ss_len" in
     yes)
	AC_DEFINE([HAVE___SS_LEN_IN_SS], [1],
	    [Does struct sockaddr_storage have __ss_len?])
    esac
esac

AH_VERBATIM(
    [HAVE___SS_LEN_IN_SS_VERBATIM],
    [
	/* Handle sockaddr_storage.__ss_len */
	#ifdef HAVE___SS_LEN_IN_SS
	# define ss_len __ss_len
	#endif /* HAVE___SS_LEN_IN_SS */
    ]
)

#
# Look for in_port_t.
#
AC_CACHE_CHECK(
    [for in_port_t],
    [isc_cv_have_in_port_t],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
		#include 
	    ]],
	    [[
		in_port_t port = 25; 
		return (0);
	    ]]
	)],
	[isc_cv_have_in_port_t=yes],
	[isc_cv_have_in_port_t=no]
    )]
)
case "$isc_cv_have_in_port_t" in
 no)
	AC_DEFINE([ISC_PLATFORM_NEEDPORTT], [1],
	    [Declare in_port_t?])
esac

case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
  *yes*)
    AC_CACHE_CHECK(
	[for struct snd_size],
	[ntp_cv_struct_snd_size],
	[AC_COMPILE_IFELSE(
	    [AC_LANG_PROGRAM(
		[[
		    #ifdef HAVE_MACHINE_SOUNDCARD_H
		    # include 
		    #endif
		    #ifdef HAVE_SYS_SOUNDCARD_H
		    # include 
		    #endif
		]],
		[[
		    extern struct snd_size *ss;
		    return ss->rec_size;
		]]
	    )],
	    [ntp_cv_struct_snd_size=yes],
	    [ntp_cv_struct_snd_size=no]
        )]
    )
    case "$ntp_cv_struct_snd_size" in
     yes)
	AC_DEFINE([HAVE_STRUCT_SND_SIZE], [1],
	    [Do we have struct snd_size?])
    esac
esac

AC_CACHE_CHECK(
    [struct clockinfo for hz],
    [ntp_cv_struct_clockinfo_has_hz],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
	    ]],
	    [[
		extern struct clockinfo *pc;
		return pc->hz;
	    ]]
	)],
	[ntp_cv_struct_clockinfo_has_hz=yes],
	[ntp_cv_struct_clockinfo_has_hz=no]
    )]
)
case "$ntp_cv_struct_clockinfo_has_hz" in
 yes)
    AC_DEFINE([HAVE_HZ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
esac

AC_CACHE_CHECK(
    [struct clockinfo for tickadj],
    [ntp_cv_struct_clockinfo_has_hz],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
	    ]],
	    [[
		extern struct clockinfo *pc;
		return pc->tickadj;
	    ]]
	)],
	[ntp_cv_struct_clockinfo_has_hz=yes],
	[ntp_cv_struct_clockinfo_has_hz=no]
    )]
)
case "$ntp_cv_struct_clockinfo_has_hz" in
 yes)
    AC_DEFINE([HAVE_TICKADJ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
esac

AC_CACHE_CHECK(
    [for struct timespec],
    [ntp_cv_struct_timespec],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
		/* Under SunOS, timespec is in sys/timepps.h,
		   which needs errno.h and FRAC */
		#ifdef HAVE_ERRNO_H
		# include 
		#endif
		#ifdef HAVE_SYS_TIMEPPS_H
		# define FRAC 4294967296
		# include 
		#endif
	    ]],
	    [[
		struct timespec n;
	    ]]
	)],
	[ntp_cv_struct_timespec=yes],
	[ntp_cv_struct_timespec=no]
    )]
)
case "$ntp_cv_struct_timespec" in
 yes)
    AC_DEFINE([HAVE_STRUCT_TIMESPEC], [1], [struct timespec declared?])
esac

AC_CACHE_CHECK(
    [for struct ntptimeval],
    [ntp_cv_struct_ntptimeval],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
		#include 
	    ]],
	    [[
		struct ntptimeval n;
	    ]]
	)],
	[ntp_cv_struct_ntptimeval=yes],
	[ntp_cv_struct_ntptimeval=no]
    )]
)
case "$ntp_cv_struct_ntptimeval" in
 yes)
    AC_DEFINE([HAVE_STRUCT_NTPTIMEVAL], [1],
	[Do we have struct ntptimeval?])
esac

AC_CHECK_MEMBERS(
    [struct ntptimeval.time.tv_nsec],
    [],
    [],
    [
	#ifdef HAVE_SYS_TIME_H
	#include 
	#else
	# ifdef HAVE_TIME_H
	#  include 
	# endif
	#endif
	#ifdef HAVE_SYS_TIMEX_H
	# include 
	#else
	# ifdef HAVE_TIMEX_H
	#  include 
	# endif
	#endif
    ]
)

AC_C_INLINE

case "$ac_cv_c_inline" in
 '')
    ;;
 *)
    AC_DEFINE([HAVE_INLINE], [1], [inline keyword or macro available])
    AC_SUBST([HAVE_INLINE])
esac

AC_C_CHAR_UNSIGNED		dnl CROSS_COMPILE?
AC_CHECK_SIZEOF([signed char])
AC_CHECK_TYPES([s_char])
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])

case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
 *yes)
    # We have a typedef for s_char.  Might as well believe it...
    ;;
 no0no)
    # We have signed chars, can't say 'signed char', no s_char typedef.
    AC_DEFINE([NEED_S_CHAR_TYPEDEF], [1],
	[Do we need an s_char typedef?])
    ;;
 no1no)
    # We have signed chars, can say 'signed char', no s_char typedef.
    AC_DEFINE([NEED_S_CHAR_TYPEDEF], [1],
	[Do we need an s_char typedef?])
    ;;
 yes0no)
    # We have unsigned chars, can't say 'signed char', no s_char typedef.
    AC_MSG_ERROR([No way to specify a signed character!])
    ;;
 yes1no)
    # We have unsigned chars, can say 'signed char', no s_char typedef.
    AC_DEFINE([NEED_S_CHAR_TYPEDEF], [1],
	[Do we need an s_char typedef?])
    ;;
esac
AC_TYPE_UID_T

case "$host" in
 *-*-aix[[456]]*)
	# (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
	# (returning ENOSYS).  I didn't check 4.2.  If, in the future,
	# IBM pulls its thumbs out long enough to implement clock_settime,
	# this conditional will need to change.  Maybe use AC_TRY_RUN
	# instead to try to set the time to itself and check errno.
    ;;
 *)
    AC_SEARCH_LIBS([clock_gettime], [rt])
    AC_CHECK_FUNCS([clock_gettime clock_settime])
    ;;
esac
AC_CHECK_FUNCS([daemon])
AC_CHECK_FUNCS(
    [finite],
    [],
    [AC_CHECK_FUNCS(
	[isfinite],
	[],
	[
	    AC_MSG_CHECKING([for isfinite with ])
	    _libs=$LIBS
	    LIBS="$LIBS -lm"
	    AC_LINK_IFELSE(
		[AC_LANG_PROGRAM(
		    [[
			#include 
		    ]],
		    [[
			float f = 0.0;
			isfinite(f);
		    ]]
		)],
		[ans=yes],
		[ans=no]
	    )
	    LIBS=$_libs
	    AC_MSG_RESULT([$ans])
	    case "$ans" in
	     yes)
		AC_DEFINE([HAVE_ISFINITE], [1])
	    esac
	]
    )]
)

AC_CHECK_FUNCS([getbootfile getclock getdtablesize])

AC_ARG_ENABLE(
    [getifaddrs],
    [AS_HELP_STRING(
	[--enable-getifaddrs],
	[s Enable the use of getifaddrs() [[yes|no|glibc]].
glibc: Use getifaddrs() in glibc if you know it supports IPv6.]
    )],
    [want_getifaddrs="$enableval"],
    [want_getifaddrs="yes"]
)

case $want_getifaddrs in
 yes|glibc)
    #
    # Do we have getifaddrs() ?
    #
    case $host in
     *-*linux*)
	# Some recent versions of glibc support getifaddrs() which does not
	# provide AF_INET6 addresses while the function provided by the USAGI
	# project handles the AF_INET6 case correctly.  We need to avoid
	# using the former but prefer the latter unless overridden by
	# --enable-getifaddrs=glibc.
	case "$want_getifaddrs" in
	 glibc)
	    AC_CHECK_FUNCS([getifaddrs])
	    ;;
	 *)
	    save_LIBS="$LIBS"
	    LIBS="-L/usr/local/v6/lib $LIBS"
	    AC_CHECK_LIB(
		[inet6],
		[getifaddrs],
		[ans=yes],
		[ans=no]
	    )
	    case "$ans" in
	     yes)
		LIBS="$LIBS -linet6"
		AC_DEFINE([HAVE_GETIFADDRS], [1])
		;;
	     *)
		LIBS=${save_LIBS}
		;;
	    esac
	    ;;
	esac
	;;
    esac
    ;;
 *)
    AC_CHECK_FUNCS([getifaddrs])
    ;;
esac

AC_CACHE_CHECK(
    [type of socklen arg for getsockname()],
    [ntp_cv_getsockname_socklen_type],
    [
    getsockname_socklen_type_found=no
    for getsockname_arg2 in 'struct sockaddr *' 'void *'; do
	for ntp_cv_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do
	    AC_COMPILE_IFELSE(
		[AC_LANG_PROGRAM(
		    [[
			#ifdef HAVE_SYS_TYPES_H
			# include 
			#endif
			#ifdef HAVE_SYS_SOCKET_H
			# include 
			#endif
		    ]], [[
			extern
			getsockname(int, $getsockname_arg2, 
				$ntp_cv_getsockname_socklen_type *);
		    ]]
		)],
		[getsockname_socklen_type_found=yes ; break 2],
		[]
	    )
	done
    done
    case "$getsockname_socklen_type_found" in
     no)
	ntp_cv_getsockname_socklen_type='socklen_t'
    esac
    AS_UNSET([getsockname_arg2])
    AS_UNSET([getsockname_socklen_type_found])
    ]
)
AC_DEFINE_UNQUOTED([GETSOCKNAME_SOCKLEN_TYPE],
		   [$ntp_cv_getsockname_socklen_type],
		   [What is getsockname()'s socklen type?])

AC_CHECK_FUNCS([getuid getrusage hstrerror])
AC_CHECK_FUNC([gettimeofday], [], [
case "$host" in
  *-*-mpeix*) ac_cv_func_gettimeofday=yes
    ;;
esac])

#
# Check for if_nametoindex() for IPv6 scoped addresses support
#
case "$host" in
 *-hp-hpux*)
    AC_SEARCH_LIBS([if_nametoindex], [ipv6])
esac
AC_CHECK_FUNCS([if_nametoindex])
case "$ac_cv_func_if_nametoindex" in
 yes)
	AC_DEFINE([ISC_PLATFORM_HAVEIFNAMETOINDEX], [1],
	    [ISC: do we have if_nametoindex()?])
esac

AC_SEARCH_LIBS([inet_ntop], [resolv], , , [-lsocket -lnsl])
AC_CHECK_FUNC([inet_ntop], [], 
    [AC_DEFINE([ISC_PLATFORM_NEEDNTOP], [1], [ISC: provide inet_ntop()])])
AC_CHECK_FUNC([inet_pton], [],
    [AC_DEFINE([ISC_PLATFORM_NEEDPTON], [1], [ISC: provide inet_pton()])])

case "$ac_cv_header_kvm_h" in
 yes)
    AC_CHECK_FUNCS([kvm_open])
    ;;
esac

AC_CHECK_FUNCS([memcpy memmove memset])
case "$host" in
 *-*-sco3.2v5.0.*)
    # Just stubs.  Idiots.
    ;;
 *) AC_CHECK_FUNCS([mkstemp])
    ;;
esac
AC_CHECK_FUNCS([mktime])
case "$host" in
 *-*-aix[[456]]*)
    # Just a stub.  Idiots.
    ;;
 *-*-irix[[45]]*)
    # Just a stub in "old" Irix.  Idiots.
    ;;
 *-*-*linux*)
    # there, but more trouble than it is worth for now (resolver problems)
    ;;
 *-*-qnx*)
    # Apparently there but not working in QNX.  Idiots?
    ;;
 *-*-sco3.2v5.0.*)
    # Just a stub.  Idiots.
    ;;
 alpha*-dec-osf4*|alpha*-dec-osf5*)
    # mlockall is there, as a #define calling memlk via 
    # Not easy to test for - cheat.
    AC_CHECK_FUNCS([memlk], [ac_cv_func_mlockall=yes])
    AC_CHECK_FUNCS([mlockall])
    ;;
 *) AC_CHECK_FUNCS([mlockall])
    ;;
esac
AC_CHECK_FUNCS([nice nlist])
case "$host" in
 *-*-solaris2.6)
    # Broken...
    ;;
 *) AC_CHECK_FUNCS([ntp_adjtime ntp_gettime])
    ;;
esac
AC_CHECK_FUNCS([plock pututline pututxline readlink recvmsg rtprio])
case "$host" in
 *-*-aix[[456]]*)
    # Just a stub in AIX 4.  Idiots.
    ;;
 *-*-solaris2.5*)
    # Just stubs in solaris2.5.  Idiots.
    ;;
 *) AC_CHECK_FUNCS([sched_setscheduler])
    ;;
esac
AC_CHECK_FUNCS([setlinebuf setpgid setpriority setsid])
AC_CHECK_FUNCS([setrlimit])
AC_CHECK_FUNCS([settimeofday], ,[
case "$host" in
  *-*-mpeix*) ac_cv_func_settimeofday=yes
    ;;
esac])
AC_CHECK_FUNCS([setvbuf sigaction sigvec sigset sigsuspend stime strchr])
AC_CHECK_FUNCS([sysconf sysctl snprintf strdup strerror strstr timegm])
case "$host" in
 *-*-aix[[456]]*)
    # Just stubs.  Idiots.
    ;;
 *-*-netbsd1*)
    # Just stubs.  Idiots.
    ;;
 *-*-netbsdelf1*)
    # Just stubs.  Idiots.
    ;;
 *-*-openbsd*)
    # Just stubs.  Idiots.
    ;;
 *) AC_CHECK_FUNCS([timer_create timer_settime])
    ;;
esac
AC_CHECK_FUNCS([umask uname updwtmp updwtmpx vsnprintf vsprintf])

###

# http://bugs.ntp.org/737
case "$ac_cv_func_recvmsg" in
 yes)
    AC_CACHE_CHECK(
	[if we need extra help to define struct iovec],
	[ntp_cv_struct_iovec_help],
	[
	    compiled=no
	    for ntp_cv_struct_iovec_help in '0' '1'; do
		AC_COMPILE_IFELSE(
		    [AC_LANG_PROGRAM(
			[[
			    #ifdef HAVE_SYS_TYPES_H
			    # include 
			    #endif
			    #ifdef HAVE_SYS_SOCKET_H
			    # include 
			    #endif
			    #if $ntp_cv_struct_iovec_help
			    # include 
			    #endif
			]],
			[[
			    void foo(void) {
				ssize_t x;
				int s = 0;
				struct iovec iov;
				struct msghdr mh;
				int flags = 0;

				mh.msg_iov = &iov;
				x = recvmsg(s, &mh, flags);
			    }
			]]
		    )],
		    [compiled=yes ; break 1],
		    []
		)
	    done
	    case "$compiled" in
	     no)
		ntp_cv_struct_iovec_help=0
	    esac
	    AS_UNSET([compiled])
	]
    )
    case "$ntp_cv_struct_iovec_help" in
     1)
	AC_DEFINE([HAVE_SYS_UIO_H], [1],
	    [Use sys/uio.h for struct iovec help])
    esac
esac

case "$host" in
 *-*-sunos4*)
    AC_DEFINE([SPRINTF_CHAR], [1], [*s*printf() functions are char*])
    ;;
esac

AC_CACHE_CHECK(
    [number of arguments to gettimeofday()],
    [ntp_cv_func_Xettimeofday_nargs],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
	    ]],
	    [[
		gettimeofday(0, 0);
		settimeofday(0, 0);
	    ]]
	)],
	[ntp_cv_func_Xettimeofday_nargs=2],
	[ntp_cv_func_Xettimeofday_nargs=1]
    )]
)
case "$ntp_cv_func_Xettimeofday_nargs" in
 1)
    AC_DEFINE([SYSV_TIMEOFDAY], [1], [Does Xettimeofday take 1 arg?])
esac

AC_CACHE_CHECK(
    [number of arguments taken by setpgrp()],
    [ntp_cv_func_setpgrp_nargs],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
		#ifdef HAVE_UNISTD_H
		# include 
		#endif
	    ]],
	    [[
		setpgrp(0, 0);
	    ]]
	)],
	[ntp_cv_func_setpgrp_nargs=2],
	[ntp_cv_func_setpgrp_nargs=0]
    )]
)
case "$ntp_cv_func_setpgrp_nargs" in
 0)
    AC_DEFINE([HAVE_SETPGRP_0], [1],
	      [define if setpgrp takes 0 arguments])
esac

dnl we require ANSI C which mandates void * here
dnl we should clean up all uses of QSORT_USES_VOID_P so
dnl this can be removed.
AC_DEFINE([QSORT_USES_VOID_P], [1],
    [Does qsort expect to work on "void *" stuff?])

AC_CACHE_CHECK(
    [if we need to declare 'errno'],
    [ntp_cv_decl_errno],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#ifdef HAVE_ERRNO_H
		# include 
		#endif
	    ]],
	    [[
		errno = 0;
	    ]]
	)],
	[ntp_cv_decl_errno=no],
	[ntp_cv_decl_errno=yes]
    )]
)
case "$ntp_cv_decl_errno" in
 yes)
    AC_DEFINE([DECL_ERRNO], [1], [Declare errno?])
esac

dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
dnl MT purposes.  This makes the line "extern int h_errno" choke
dnl the compiler.  Hopefully adding !defined(h_errno) fixes this
dnl without breaking any other platforms.
dnl
AC_CACHE_CHECK(
    [if we may declare 'h_errno'],
    [ntp_cv_decl_h_errno],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
		#ifdef HAVE_NETINET_IN_H
		# include 
		#endif
		#ifdef HAVE_ARPA_NAMESER_H
		# include 
		#endif
		#ifdef HAVE_NETDB_H
		# include 
		#endif
		#ifdef HAVE_RESOLV_H
		# include 
		#endif
	    ]],
	    [[
		extern int h_errno;
	    ]]
	)],
	[ntp_cv_decl_h_errno=yes],
	[ntp_cv_decl_h_errno=no]
    )]
)
case "$ntp_cv_decl_h_errno" in
 yes) 
    AC_DEFINE([DECL_H_ERRNO], [1], [Declare h_errno?])
esac

AC_CACHE_CHECK(
    [if declaring 'syscall()' is ok],
    [ntp_cv_decl_syscall],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#ifdef HAVE_SYS_TYPES_H
		# include 
		#endif
		#ifdef HAVE_UNISTD_H
		# include 
		#endif
	    ]],
	    [[
		extern int syscall (int, ...);
	    ]]
	)]
	[ntp_cv_decl_syscall=yes],
	[ntp_cv_decl_syscall=no]
    )]
)
case "$ntp_cv_decl_syscall" in
 yes)
    AC_DEFINE([DECL_SYSCALL], [1], [Declare syscall()?])
esac

case "$host" in
 *-*-aix4.3.*)
    AC_DEFINE([DECL_HSTRERROR_0], [1], [Declaration style])		# Needed for XLC under AIX 4.3.2
    ;;
 *-*-mpeix*)
    AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
    AC_DEFINE([DECL_INET_NTOA_0], [1], [Declaration style])
    AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
    AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
    AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
    AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
    AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
    ;;
 *-*-osf[[45]]*)
    AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
    AC_DEFINE([DECL_STIME_1], [1], [Declaration style])
    ;;
 *-*-qnx*)
    AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
    ;;
 *-*-riscos4*)
    AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
    AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
    AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
    AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
    AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
    AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
    AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
    AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
    AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
    AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
    AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
    AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
    AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
    AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
    AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
    AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
    ;;
 *-*-solaris2*)
    AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
    AC_DEFINE([DECL_SETPRIORITY_1], [1], [Declaration style])
    case "$host" in
     *-*-solaris2.4)
        AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
	;;
    esac
    ;;
 *-*-sunos4*)
    AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
    AC_DEFINE([DECL_BCOPY_0], [1], [Declaration style])
    AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
    AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
    AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
    AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
    AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
    AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
    AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
    AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
    AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
    AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
    AC_DEFINE([DECL_SIGVEC_0], [1], [Declaration style])
    case "`basename $ac_cv_prog_CC`" in
     acc*) ;;
     *) AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
	;;
    esac
    AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
    AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
    AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
    AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
    AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
    AC_DEFINE([DECL_TOUPPER_0], [1], [Declaration style])
    AC_DEFINE([DECL_STRERROR_0], [1], [Declaration style])
    ;;
 *-*-ultrix4*)
    AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
    AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
    AC_DEFINE([DECL_CFSETISPEED_0], [1], [Declaration style])
    AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
    AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
    AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
    AC_DEFINE([DECL_NLIST_0], [1], [Declaration style])
    AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
    AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
    AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
    AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
    AC_DEFINE([DECL_STIME_0], [1], [Declaration style])
    AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
    AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
    ;;
esac

case "$host" in
 *-*-sco3.2*)
    AC_DEFINE([TERMIOS_NEEDS__SVID3], [1],
	[Do we need to #define _SVID3 when we #include ?])
    ;;
esac

case "$host" in
 *-*-hpux[[567]]*)
    AC_DEFINE([NEED_RCVBUF_SLOP], [1],
	[Do we need extra room for SO_RCVBUF? (HPUX < 8)])
esac

dnl Using AC_CACHE_CHECK to honor preset ntp_cv_var_open_bcast_socket
AC_CACHE_CHECK(
    [if we will open the broadcast socket],
    [ntp_cv_var_open_bcast_socket],
    [
	ans=yes
	case "$host" in
	 *-*-domainos)
	    ans=no
	esac
	ntp_cv_var_open_bcast_socket=$ans
    ]
)
case "$ntp_cv_var_open_bcast_socket" in
 yes)
    AC_DEFINE([OPEN_BCAST_SOCKET], [1],
	[Should we open the broadcast socket?])
esac

case "$host" in
 *-*-hpux*)
    AC_DEFINE([NEED_HPUX_FINDCONFIG], [1],
	[Do we want the HPUX FindConfig()?])
esac

dnl using AC_CACHE_CHECK to honor preset $ntp_cv_arg_setpgrp_negpid
AC_CACHE_CHECK(
    [if process groups are set with -pid],
    [ntp_cv_arg_setpgrp_negpid],
    [
	case "$host" in
	 *-*-hpux[[567]]*)
	    ans=no
	    ;;
	 *-*-hpux*)
	    ans=yes
	    ;;
	 *-*-*linux*)
	    ans=yes
	    ;;
	 *-*-sunos3*)
	    ans=yes
	    ;;
	 *-*-ultrix2*)
	    ans=yes
	    ;;
	 *)
	    ans=no
	    ;;
	esac
	ntp_cv_arg_setpgrp_negpid=$ans
    ]
)
case "$ntp_cv_arg_setpgrp_negpid" in
 yes)
    AC_DEFINE([UDP_BACKWARDS_SETOWN], [1],
	[Do we set process groups with -pid?])
esac

AC_CACHE_CHECK(
    [if we need a ctty for F_SETOWN],
    [ntp_cv_func_ctty_for_f_setown],
    [
	case "$host" in
	 *-*-bsdi[23]*)
	    ans=yes
	    ;;
	 *-*-freebsd*)
	    ans=yes
	    ;;
	# NetBSD versions prior to 3.99.8 require a CTTY for F_SETOWN,
	# while later versions will fail a ioctl(TIOCSCTTY, 0) call in
	# some cases and so should not have USE_FSETOWNCTTY.  "netbsd"
	# in $host may be followed by "aout", "ecoff", or "elf".
	 *-*-netbsd*[a-z]3.[0-8]*|*-*-netbsd*[a-z][0-2].*|*-*-netbsd*[a-z]3.99.[0-7])
	    ans=yes
	    ;;
	 *-*-netbsd3.[0-8]*|*-*-netbsd[0-2].*|*-*-netbsd3.99.[0-7])
	    ans=yes
	    ;;
	 *-*-openbsd*)
	    ans=yes
	    ;;
	 *-*-osf*)
	    ans=yes
	    ;;
	 *-*-darwin*)
	    ans=yes
	    ;;
	 *) 
	    ans=no
	    ;;
	esac
	ntp_cv_func_ctty_for_f_setown=$ans
    ]
)
case "$ntp_cv_func_ctty_for_f_setown" in
 yes)
    AC_DEFINE([USE_FSETOWNCTTY], [1], [Must we have a CTTY for fsetown?])
esac

AC_CACHE_CHECK(
    [if the OS clears cached routes when more specifics become available],
    [ntp_cv_os_routeupdates],
    [
	case "$host" in
	 *-*-netbsd*)
	    ans=yes
	    ;;
	 *) 
	    ans=no
	    ;;
	esac
	ntp_cv_os_routeupdates=$ans
    ]
)
case "$ntp_cv_os_routeupdates" in
 yes)
    AC_DEFINE([OS_MISSES_SPECIFIC_ROUTE_UPDATES], [1],
	[need to recreate sockets on changed routing?])
esac

AC_CACHE_CHECK(
    [if the wildcard socket needs REUSEADDR to bind other addresses],
    [ntp_cv_os_wildcardreuse],
    [
	case "$host" in
	 *-*-*linux*)
	    ans=yes
	    ;;
	 *) ans=no
	    ;;
	esac
	ntp_cv_os_wildcardreuse=$ans
    ]
)
case "$ntp_cv_os_wildcardreuse" in
 yes)
    AC_DEFINE([OS_NEEDS_REUSEADDR_FOR_IFADDRBIND], [1],
	[wildcard socket needs REUSEADDR to bind interface addresses])
esac

AC_MSG_CHECKING([if we'll use clock_settime or settimeofday or stime])
ntp_warning='GRONK'
ans=none
case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
 yes*)
    ntp_warning=''
    ans='clock_settime()'
    ;;
 noyes*)
    ntp_warning='But clock_settime() would be better (if we had it)'
    ans='settimeofday()'
    ;;
 nonoyes)
    ntp_warning='Which is the worst of the three'
    ans='stime()'
    ;;
 *) 
    case "$build" in
     $host) 
	ntp_warning='Which leaves us with nothing to use!'
    esac
esac
AC_MSG_RESULT([$ans])
case "$ntp_warning" in
 '')
    ;;
 *)
    AC_MSG_WARN([*** $ntp_warning ***])
    ;;
esac

AC_CACHE_CHECK(
    [for SIGIO],
    [ntp_cv_hdr_def_sigio],
    [AC_EGREP_CPP(
	[yes],
	[
	    #include 

	    #ifdef SIGIO
		yes
	    #endif
	],
	[ntp_cv_hdr_def_sigio=yes],
	[ntp_cv_hdr_def_sigio=no]
    )]
 )

dnl Override those system that have a losing SIGIO
AC_CACHE_CHECK(
    [if we want to use signalled IO],
    [ntp_cv_var_signalled_io],
    [
	ans=no
	case "$ntp_cv_hdr_def_sigio" in
	 yes)
	    ans=yes
	    case "$host" in
	     alpha*-dec-osf4*|alpha*-dec-osf5*)
		ans=no
		;;
	     *-convex-*)
		ans=no
		;;
	     *-dec-*)
		ans=no
		;;
	     *-pc-cygwin*)
		ans=no
		;;
	     *-sni-sysv*)
		ans=no
		;;
	     *-univel-sysv*)
		ans=no
		;;
	     *-*-irix6*)
		ans=no
		;;
	     *-*-freebsd*)
		ans=no
		;;
	     *-*-*linux*)
		ans=no
		;;
	     *-*-unicosmp*)
		ans=no
		;;
	     *-*-kfreebsd*)
		ans=no
		;;
	     m68k-*-mint*)
		ans=no
		;;
	    esac
	    ;;
	esac
	ntp_cv_var_signalled_io=$ans
    ]
)
case "$ntp_cv_var_signalled_io" in
 yes)
    AC_DEFINE([HAVE_SIGNALED_IO], [1],
	[Can we use SIGIO for tcp and udp IO?])
esac

AC_CACHE_CHECK(
    [for SIGPOLL],
    [ntp_cv_hdr_def_sigpoll],
    [AC_EGREP_CPP(
	[yes],
	[
	    #include 
	    
	    #ifdef SIGPOLL
		yes
	    #endif
	],
	[ntp_cv_hdr_def_sigpoll=yes],
	[ntp_cv_hdr_def_sigpoll=no]
    )]
)

AC_CACHE_CHECK(
    [for SIGSYS],
    [ntp_cv_hdr_def_sigsys],
    [AC_EGREP_CPP(
	[yes],
	[
	    #include 

	    #ifdef SIGSYS
		yes
	    #endif
	],
	[ntp_cv_hdr_def_sigsys=yes],
	[ntp_cv_hdr_def_sigsys=no]
    )]
)

AC_CACHE_CHECK(
    [if we can use SIGPOLL for UDP I/O],
    [ntp_cv_var_use_udp_sigpoll],
    [
	ans=no
	case "$ntp_cv_hdr_def_sigpoll" in
	 yes)
	    case "$host" in
	     mips-sgi-irix*)
		ans=no
		;;
	     vax-dec-bsd)
		ans=no
		;;
	     *-pc-cygwin*)
		ans=no
		;;
	     *-sni-sysv*)
		ans=no
		;;
	     *-*-aix[[456]]*)
		ans=no
		;;
	     *-*-hpux*)
		ans=no
		;;
	     *-*-*linux*)
		ans=no
		;;
	     *-*-osf*)
		ans=no
		;;
	     *-*-qnx*)
		ans=no
		;;
	     *-*-sunos*)
		ans=no
		;;
	     *-*-solaris*)
		ans=no
		;;
	     *-*-ultrix*)
		ans=no
		;;
	     *-*-unicosmp*)
		ans=no
		;;
	     *-*-kfreebsd*)
		ans=no
		;;
	     *) ans=yes
		;;
	    esac
	    ;;
	esac
	ntp_cv_var_use_udp_sigpoll=$ans
    ]
)
case "$ntp_cv_var_use_udp_sigpoll" in
 yes)
    AC_DEFINE([USE_UDP_SIGPOLL], [1], [Can we use SIGPOLL for UDP?])
esac

AC_CACHE_CHECK(
    [if we can use SIGPOLL for TTY I/O],
    [ntp_cv_var_use_tty_sigpoll],
    [
	ans=no
	case "$ntp_cv_hdr_def_sigpoll" in
	 yes)
	    case "$host" in
	     mips-sgi-irix*)
		ans=no
		;;
	     vax-dec-bsd)
		ans=no
		;;
	     *-pc-cygwin*)
		ans=no
		;;
	     *-sni-sysv*)
		ans=no
		;;
	     *-*-aix[[456]]*)
		ans=no
		;;
	     *-*-hpux*)
		ans=no
		;;
	     *-*-*linux*)
		ans=no
		;;
	     *-*-osf*)
		ans=no
		;;
	     *-*-sunos*)
		ans=no
		;;
	     *-*-ultrix*)
		ans=no
		;;
	     *-*-qnx*)
		ans=no
		;;
	     *-*-unicosmp*)
		ans=no
		;;
	     *-*-kfreebsd*)
		ans=no
		;;
	     *) ans=yes
		;;
	    esac
	    ;;
	esac
	ntp_cv_var_use_tty_sigpoll=$ans
    ]
)
case "$ntp_cv_var_use_tty_sigpoll" in
 yes)
    AC_DEFINE([USE_TTY_SIGPOLL], [1], [Can we use SIGPOLL for tty IO?])
esac

case "$host" in
 *-*-aix*)
    AC_DEFINE([NLIST_EXTRA_INDIRECTION], [1],
	[Might nlist() values require an extra level of indirection (AIX)?])
esac

AC_CACHE_CHECK(
    [for a minimum recommended value of tickadj],
    [ntp_cv_var_min_rec_tickadj],
    [
	ans=no
	case "$host" in
	 *-*-aix*)
	    ans=40
	    ;;
	esac
	ntp_cv_var_min_rec_tickadj=$ans
    ]
)
case "$ntp_cv_var_min_rec_tickadj" in
 ''|no)
    ;;
 *)
    AC_DEFINE_UNQUOTED([MIN_REC_TICKADJ], [$ntp_cv_var_min_rec_tickadj],
	[Should we recommend a minimum value for tickadj?])
esac

AC_CACHE_CHECK(
    [if the TTY code permits PARENB and IGNPAR],
    [ntp_cv_no_parenb_ignpar],
    [
	ans=no
	case "$host" in
	 i?86-*-*linux*)
	    ans=yes
	    ;;
	 mips-sgi-irix*)
	    ans=yes
	    ;;
	 i?86-*-freebsd[[123]].*)
	    ;;
	 i?86-*-freebsd*)
	    ans=yes
	    ;;
	 *-*-unicosmp*)
	    ans=yes
	    ;;
	esac
	ntp_cv_no_parenb_ignpar=$ans
    ]
)
case "$ntp_cv_no_parenb_ignpar" in
 yes)
    AC_DEFINE([NO_PARENB_IGNPAR], [1],
	[Is there a problem using PARENB and IGNPAR?])
esac

AC_MSG_CHECKING([if we're including ntpd debugging code])
AC_ARG_ENABLE(
    [debugging],
    [AS_HELP_STRING(
        [--enable-debugging],
        [+ include ntpd debugging code]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=yes]
)
case "$ntp_ok" in
 yes)
    AC_DEFINE([DEBUG], [1], [Enable ntpd debugging code?])
esac
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([if we're including processing time debugging code])
AC_ARG_ENABLE(
    [debug-timing],
    [AS_HELP_STRING(
	[--enable-debug-timing],
	[- include processing time debugging code (costs performance)]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=no]
)
case "$ntp_ok" in
 yes)
    AC_DEFINE([DEBUG_TIMING], [1], [Enable processing time debugging?])
esac
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([for a the number of minutes in a DST adjustment])
AC_ARG_ENABLE(
    [dst-minutes],
    [AS_HELP_STRING(
	[--enable-dst-minutes],
	[n minutes per DST adjustment @<:@60@:>@])   dnl @<:@ is [, @:>@ is ]
    ],
    [ans=$enableval],
    [ans=60]
)
AC_DEFINE_UNQUOTED([DSTMINUTES], [$ans],
    [The number of minutes in a DST adjustment])
AC_MSG_RESULT([$ans])

AC_MSG_CHECKING([if ntpd will retry permanent DNS failures])
AC_ARG_ENABLE(
    [ignore-dns-errors],
    [AS_HELP_STRING(
	[--enable-ignore-dns-errors], 
	[- retry DNS queries on any error]
    )],
    [ans=$enableval],
    [ans=no]
)
case "$ans" in
 yes)
    AC_DEFINE([IGNORE_DNS_ERRORS], [1],
	[Retry queries on _any_ DNS error?])
esac
AC_MSG_RESULT([$ans])

AC_MSG_CHECKING([if ntpd will use the deferred DNS lookup path])
AC_ARG_ENABLE(
    [force-defer-DNS],
    [AS_HELP_STRING(
	[--enable-force-defer-DNS],
	[- force all DNS lookups to take the deferred path]
    )],
    [ans=$enableval],
    [ans=no]
)
case "$ans" in
 yes)
    AC_DEFINE([FORCE_DEFER_DNS], [1], [Force deferred DNS lookups?])
esac
AC_MSG_RESULT([$ans])

case "$ac_cv_header_sys_sio_h" in
 yes)
    AC_CACHE_CHECK(
	[sys/sio.h for TIOCDCDTIMESTAMP],
	[ntp_cv_hdr_def_tiocdcdtimestamp],
	[AC_EGREP_CPP(
	    [yes],
	    [
		#include 

		#ifdef TIOCDCDTIMESTAMP
		    yes
		#endif
	    ],
	    [ntp_cv_hdr_def_tiocdcdtimestamp=yes],
	    [ntp_cv_hdr_def_tiocdcdtimestamp=no]
	)]
    )
esac

AC_CACHE_CHECK(
    [if we have the tty_clk line discipline/streams module],
    [ntp_cv_tty_clk],
    [
	case "$ac_cv_header_sys_clkdefs_h$ntp_cv_hdr_def_tiocdcdtimestamp" in
	 *yes*)
	    ntp_cv_tty_clk=yes
	    ;;
	 *)
	    ntp_cv_tty_clk=no
	    ;;
	esac
    ]
)
case "$ntp_cv_tty_clk" in
 yes)
    AC_DEFINE([TTYCLK], [1],
	[Do we have the tty_clk line discipline/streams module?])
esac

AC_MSG_CHECKING([for the ppsclock streams module])
case "$ntp_cv_struct_ppsclockev" in
 yes)
    ans=yes
    AC_DEFINE([PPS], [1],
	[Do we have the ppsclock streams module?])
    ;;
 *)
    ans=no
esac
AC_MSG_RESULT([$ans])

AC_CACHE_CHECK(
    [for multicast IP support],
    [ntp_cv_multicast],
    [
	ntp_cv_multicast=no
	case "$host" in
	 i386-sequent-sysv4)
	    ;;
	 *)
	    AC_COMPILE_IFELSE(
		[AC_LANG_PROGRAM(
		    [[
			#ifdef HAVE_NETINET_IN_H
			#include 
			#endif
		    ]],
		    [[
			struct ip_mreq ipmr;
			ipmr.imr_interface.s_addr = 0;
		    ]]
		)],
		[ntp_cv_multicast=yes],
		[]
	    )
	esac
    ]
)
case "$ntp_cv_multicast" in
 yes)
    AC_DEFINE([MCAST], [1], [Does the target support multicast IP?])
    AC_CACHE_CHECK(
	[arg type needed for setsockopt() IP*_MULTICAST_LOOP],
	[ntp_cv_typeof_ip_multicast_loop],
	[
	    case "$host" in
	     *-*-netbsd*|*-*-*linux*)
		ntp_cv_typeof_ip_multicast_loop=u_int
		;;
	     *)
		ntp_cv_typeof_ip_multicast_loop=u_char
	    esac
	]
    )
    AC_DEFINE_UNQUOTED([TYPEOF_IP_MULTICAST_LOOP],
	[$ntp_cv_typeof_ip_multicast_loop],
	[What type to use for setsockopt])
esac

AC_CACHE_CHECK(
    [availability of ntp_{adj,get}time()],
    [ntp_cv_var_ntp_syscalls],
    [
	ntp_cv_var_ntp_syscalls=no
	case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
	 yesyes*)
	    ntp_cv_var_ntp_syscalls=libc
	    ;;
	 *yes)
	    ntp_cv_var_ntp_syscalls=inline
	    ;;
	 *) 
	    AC_EGREP_CPP(
		[yes],
		[
		    #include 
		    
		    #if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
			yes
		    #endif
		],
		[ntp_cv_var_ntp_syscalls=kernel]
	    )
	    ;;
	 esac
    ]
)
case "$ntp_cv_var_ntp_syscalls" in
 libc)
    AC_DEFINE([NTP_SYSCALLS_LIBC], [1],
	[Do we have ntp_{adj,get}time in libc?])
    ;;
 kernel)
    AC_DEFINE([NTP_SYSCALLS_STD], [1],
	[Do we have ntp_{adj,get}time in the kernel?])
    ;;
esac

AC_CACHE_CHECK(
    [if sys/timex.h has STA_FLL],
    [ntp_cv_var_sta_fll],
    [AC_EGREP_CPP(
	[yes],
	[
	    #include 

	    #ifdef STA_FLL
		yes
	    #endif
	],
	[ntp_cv_var_sta_fll=yes],
	[ntp_cv_var_sta_fll=no]
    )]
)

AC_CACHE_CHECK(
    [if we have kernel PLL support],
    [ntp_cv_var_kernel_pll],
    [dnl ntp_cv_var_ntp_syscalls is {no,libc,kernel}
	case "$ac_cv_header_sys_timex_h$ntp_cv_struct_ntptimeval$ntp_cv_var_sta_fll$ntp_cv_var_ntp_syscalls" in
	 *no*)
	    ntp_cv_var_kernel_pll=no
	    ;;
	 *) ntp_cv_var_kernel_pll=yes
	    ;;
	esac
    ]
)
case "$ntp_cv_var_kernel_pll" in
 yes)
    AC_DEFINE([KERNEL_PLL], [1],
	[Does the kernel support precision time discipline?])
esac

AC_CACHE_CHECK(
    [if SIOCGIFCONF returns buffer size in the buffer],
    [ntp_cv_size_returned_in_buffer],
    [
	ans=no
	case "$host" in
	 *-fujitsu-uxp*)
	    ans=yes
	    ;;
	 *-ncr-sysv4*)
	    ans=yes
	    ;;
	 *-univel-sysv*)
	    ans=yes
	    ;;
	esac
	ntp_cv_size_returned_in_buffer=$ans
    ]
)
case "$ntp_cv_size_returned_in_buffer" in
 yes)
    AC_DEFINE([SIZE_RETURNED_IN_BUFFER], [1],
	[Does SIOCGIFCONF return size in the buffer?])
esac

# Check for ioctls TIOCGPPSEV
AC_MSG_CHECKING([for TTY PPS ioctl TIOCGPPSEV])
case "$ac_cv_header_termios_h" in
 yes)
    AC_EGREP_CPP(
	[yes],
	[
	    #include 

	    #ifdef TIOCGPPSEV
		yes
	    #endif
	],
	[ntp_ok=yes],
	[ntp_ok=no]
    )
    ;;
 *)
    ntp_ok=no
    ;;
esac
case "$ntp_ok" in
 yes)
    AC_DEFINE([HAVE_TIOCGPPSEV], [1],
	[Do we have the TIOCGPPSEV ioctl (Solaris)?])
esac
AC_MSG_RESULT([$ntp_ok])

# Check for ioctls TIOCSPPS
AC_MSG_CHECKING([for TTY PPS ioctl TIOCSPPS])
case "$ac_cv_header_termios_h" in
 yes)
    AC_EGREP_CPP(
	[yes],
	[
	    #include 

	    #ifdef TIOCSPPS
		yes
	    #endif
	 ],
	 [ntp_ok=yes],
	 [ntp_ok=no]
    )
    ;;
 *)
    ntp_ok=no
    ;;
esac
case "$ntp_ok" in
 yes)
    AC_DEFINE([HAVE_TIOCSPPS], [1],
	[Do we have the TIOCSPPS ioctl (Solaris)?])
esac
AC_MSG_RESULT([$ntp_ok])

# Check for ioctls CIOGETEV
AC_MSG_CHECKING([for TTY PPS ioctl CIOGETEV])
case "$ac_cv_header_sys_ppsclock_h" in
 yes)
    AC_EGREP_CPP(
	[yes],
	[
	    #include 

	    #ifdef CIOGETEV
		yes
	    #endif
	],
	[ntp_ok=yes],
	[ntp_ok=no]
    )
    ;;
 *)
    ntp_ok=no
    ;;
esac
case "$ntp_ok" in
 yes)
    AC_DEFINE([HAVE_CIOGETEV], [1],
	[Do we have the CIOGETEV ioctl (SunOS, Linux)?])
esac
AC_MSG_RESULT([$ntp_ok])

# ATOM/PPSAPI stuff.

ntp_atom_ok=yes

# Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.

# The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
# The PPSAPI needs struct timespec.
# The PPSAPI also needs a timepps header.

case "$ac_cv_c_inline$ntp_cv_struct_timespec" in
 inlineyes)
    case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
     *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
	AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
	ntp_jupiter_ok=yes
	ntp_oncore_ok=yes
	ntp_parse_ok=yes
	ntp_ripe_ncc_ok=yes
	;;
    esac
    ;;
esac

# Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
AC_CHECK_HEADER([linux/serial.h])
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_EGREP_CPP(
	[yes],
	[
	    #include 
	    typedef int u_int;
	    #include 
	    #include 

	    #ifdef TIOCGSERIAL
	    #ifdef TIOCSSERIAL
	    #ifdef ASYNC_PPS_CD_POS
	    #ifdef ASYNC_PPS_CD_NEG
	    #ifdef CIOGETEV
		 yes
	    #endif
	    #endif
	    #endif
	    #endif
	    #endif
	],
	[ntp_ok=yes],
	[ntp_ok=no]
    )
    AC_MSG_RESULT([$ntp_ok])
    ;;
  *)
    ntp_ok=no
    ;;
esac
case "$ntp_ok" in
 yes)
    AC_DEFINE([HAVE_TIO_SERIAL_STUFF], 1,
	[Do we have the TIO serial stuff?])
esac

# Check for SHMEM_STATUS support
AC_MSG_CHECKING([SHMEM_STATUS support])
case "$ac_cv_header_sys_mman_h" in
 yes)
    ntp_ok=yes
    ;;
 *)
    ntp_ok=no
    ;;
esac
case "$ntp_ok" in
 yes)
    AC_DEFINE([ONCORE_SHMEM_STATUS], [1],
	[Do we have support for SHMEM_STATUS?])
esac
AC_MSG_RESULT([$ntp_ok])

ntp_refclock=no

# HPUX only, and by explicit request
AC_MSG_CHECKING([Datum/Bancomm bc635/VME interface])
AC_ARG_ENABLE(
    [BANCOMM],
    [AS_HELP_STRING(
	[--enable-BANCOMM], 
	[- Datum/Bancomm bc635/VME interface]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=no]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_BANC], [1], [Datum/Bancomm bc635/VME interface?])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$host" in
 yes*-*-hpux*) ;;
 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
esac

#HPUX only, and only by explicit request
AC_MSG_CHECKING([TrueTime GPS receiver/VME interface])
AC_ARG_ENABLE(
    [GPSVME],
    [AS_HELP_STRING(
	[--enable-GPSVME],
	[- TrueTime GPS receiver/VME interface]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=no]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_GPSVME], 1, [TrueTime GPS receiver/VME interface?])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$host" in
 yes*-*-hpux*) ;;
 yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
esac

AC_MSG_CHECKING([for PCL720 clock support])
case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
 yesyesyes)
    AC_DEFINE([CLOCK_PPS720], 1, [PCL 720 clock support])
    ans=yes
    ;;
 *)
    ans=no
    ;;
esac
AC_MSG_RESULT([$ans])

AC_MSG_CHECKING([for default inclusion of all suitable non-PARSE clocks])
AC_ARG_ENABLE(
    [all-clocks],
    [AS_HELP_STRING(
	[--enable-all-clocks],
	[+ include all suitable non-PARSE clocks:]
    )],
    [ntp_eac=$enableval],
    [ntp_eac=yes]
)
AC_MSG_RESULT([$ntp_eac])

# HMS: Should we also require ntp_parse_ok?
AC_MSG_CHECKING([if we have support for PARSE clocks])
case "$ntp_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
 yes*yes*)
    ntp_canparse=yes
    ;;
 *) ntp_canparse=no
    ;;
esac
AC_MSG_RESULT([$ntp_canparse])

AC_MSG_CHECKING([if we have support for audio clocks])
case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
 *yes*)
    ntp_canaudio=yes
    AC_DEFINE([HAVE_AUDIO], [], [Do we have audio support?])
    ;;
 *) ntp_canaudio=no ;;
esac
AC_MSG_RESULT([$ntp_canaudio])

AC_MSG_CHECKING([if we have support for the SHM refclock interface])
case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
 yesyes)
    ntp_canshm=yes
    ;;
 *) ntp_canshm=no ;;
esac
AC_MSG_RESULT([$ntp_canshm])

# Test for termios TIOCMBIS modem control (ACTS, Heath, Palisade)
AC_CACHE_CHECK(
    [for termios modem control],
    [ntp_cv_modem_control],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#ifdef HAVE_UNISTD_H
		# include 
		#endif
		#ifdef HAVE_TERMIOS_H
		# include 
		#endif
		#ifdef HAVE_SYS_IOCTL_H
		# include 
		#endif
	    ]],
	    [[
		int	dtr = TIOCM_DTR;
		
		ioctl(1, TIOCMBIS, (char *)&dtr);
	    ]]
	)],
	[ntp_cv_modem_control=yes],
	[ntp_cv_modem_control=no]
    )]
)
case "$ntp_eac::$ntp_cv_modem_control" in
 yes::yes)
    ntp_enable_all_modem_control_clocks=yes
    ;;
 *)
    ntp_enable_all_modem_control_clocks=no
    ;;
esac

# Requires modem control
AC_MSG_CHECKING([ACTS modem service])
AC_ARG_ENABLE(
    [ACTS],
    [AS_HELP_STRING(
	[--enable-ACTS],
	[s ACTS modem service]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_enable_all_modem_control_clocks]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_ACTS], [1], [ACTS modem service])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([Arbiter 1088A/B GPS receiver])
AC_ARG_ENABLE(
    [ARBITER],
    [AS_HELP_STRING(
	[--enable-ARBITER],
	[+ Arbiter 1088A/B GPS receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_ARBITER], [1], [Arbiter 1088A/B GPS receiver])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([Arcron MSF receiver])
AC_ARG_ENABLE(
    [ARCRON_MSF],
    [AS_HELP_STRING(
	[--enable-ARCRON-MSF], 
	[+ Arcron MSF receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_ARCRON_MSF], [1], [ARCRON support?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([Austron 2200A/2201A GPS receiver])
AC_ARG_ENABLE(
    [AS2201],
    [AS_HELP_STRING(
	[--enable-AS2201],
	[+ Austron 2200A/2201A GPS receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_AS2201], [1], [Austron 2200A/2201A GPS receiver?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([ATOM PPS interface])
AC_ARG_ENABLE(
    [ATOM],
    [AS_HELP_STRING(
	[--enable-ATOM],
	[s ATOM PPS interface]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
case "$ntp_atom_ok" in
 no) ntp_ok=no ;;
esac
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_ATOM], [1], [PPS interface?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([Chrono-log K-series WWVB receiver])
AC_ARG_ENABLE(
    [CHRONOLOG],
    [AS_HELP_STRING(
	[--enable-CHRONOLOG],
	[+ Chrono-log K-series WWVB receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_CHRONOLOG], [1], [Chronolog K-series WWVB receiver?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([CHU modem/decoder])
AC_ARG_ENABLE(
    [CHU],
    [AS_HELP_STRING(
	[--enable-CHU],
	[+ CHU modem/decoder]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_CHU], [1], [CHU modem/decoder])
fi
AC_MSG_RESULT([$ntp_ok])
ntp_refclock_chu=$ntp_ok

AC_MSG_CHECKING([CHU audio/decoder])
AC_ARG_ENABLE(
    [AUDIO-CHU],
    [AS_HELP_STRING(
	[--enable-AUDIO-CHU],
	[s CHU audio/decoder]
    )],
    [ntp_ok=$enableval],
    [
	case "$ntp_eac$ntp_refclock_chu$ntp_canaudio" in
	 *no*)	ntp_ok=no  ;;
	 *)	ntp_ok=yes ;;
	esac
    ]
)
if test "$ntp_ok" = "yes"; then
    AC_DEFINE([AUDIO_CHU], [1], [CHU audio/decoder?])
fi
AC_MSG_RESULT([$ntp_ok])
# We used to check for sunos/solaris target...
case "$ntp_ok$ntp_refclock_chu$ntp_canaudio" in
 yes*no*) AC_MSG_WARN([*** But the expected answer is...no ***])
esac

# Not under HP-UX
AC_MSG_CHECKING([Datum Programmable Time System])
AC_ARG_ENABLE(
    [DATUM],
    [AS_HELP_STRING(
	[--enable-DATUM],
	[s Datum Programmable Time System]
    )],
    [ntp_ok=$enableval],
    [
	case "$ac_cv_header_termios_h" in
	 yes)
	    ntp_ok=$ntp_eac
	    ;;
	 *) ntp_ok=no
	    ;;
	esac
    ]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_DATUM], [1], [Datum Programmable Time System?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([Dumb generic hh:mm:ss local clock])
AC_ARG_ENABLE(
    [DUMBCLOCK],
    [AS_HELP_STRING(
	[--enable-DUMBCLOCK],
	[+ Dumb generic hh:mm:ss local clock]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_DUMBCLOCK], [1], [Dumb generic hh:mm:ss local clock?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([Forum Graphic GPS])
AC_ARG_ENABLE(
    [FG],
    [AS_HELP_STRING(
	[--enable-FG],
	[+ Forum Graphic GPS]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_FG], [1], [Forum Graphic GPS datating station driver?])
fi
AC_MSG_RESULT([$ntp_ok])

# Requires modem control
AC_MSG_CHECKING([Heath GC-1000 WWV/WWVH receiver])
AC_ARG_ENABLE(
    [HEATH],
    [AS_HELP_STRING(
	[--enable-HEATH],
	[s Heath GC-1000 WWV/WWVH receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_enable_all_modem_control_clocks]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_HEATH], [1], [Heath GC-1000 WWV/WWVH receiver?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([for hopf serial clock device])
AC_ARG_ENABLE(
    [HOPFSERIAL],
    [AS_HELP_STRING(
	[--enable-HOPFSERIAL],
	[+ hopf serial clock device]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_HOPF_SERIAL], [1], [HOPF serial clock device?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([for hopf PCI clock 6039])
AC_ARG_ENABLE(
    [HOPFPCI],
    [AS_HELP_STRING(
	[--enable-HOPFPCI],
	[+ hopf 6039 PCI board]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_HOPF_PCI], [1], [HOPF PCI clock device?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([HP 58503A GPS receiver])
AC_ARG_ENABLE(
    [HPGPS],
    [AS_HELP_STRING(
	[--enable-HPGPS],
	[+ HP 58503A GPS receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_HPGPS], 1, [HP 58503A GPS receiver?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([IRIG audio decoder])
AC_ARG_ENABLE(
    [IRIG],
    [AS_HELP_STRING(
	[--enable-IRIG],
	[s IRIG audio decoder]
    )],
    [ntp_ok=$enableval],
    [
	case "$ntp_eac$ntp_canaudio" in
	 *no*)	ntp_ok=no  ;;
	 *)	ntp_ok=yes ;;
	esac
    ]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_IRIG], [1], [IRIG audio decoder?])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canaudio" in
 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
esac

AC_MSG_CHECKING([for JJY receiver])
AC_ARG_ENABLE(
    [JJY],
    [AS_HELP_STRING(
	[--enable-JJY],
	[+ JJY receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_JJY], [1], [JJY receiver?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([Rockwell Jupiter GPS receiver])
AC_ARG_ENABLE(
    [JUPITER],
    [AS_HELP_STRING(
	[--enable-JUPITER],
	[s Rockwell Jupiter GPS receiver]
    )],
    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
case "$ntp_jupiter_ok" in
 no) ntp_ok=no ;;
esac
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_JUPITER], [1], [Rockwell Jupiter GPS clock?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([Leitch CSD 5300 Master Clock System Driver])
AC_ARG_ENABLE(
    [LEITCH],
    [AS_HELP_STRING(
	[--enable-LEITCH],
	[+ Leitch CSD 5300 Master Clock System Driver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_LEITCH], [1],
	[Leitch CSD 5300 Master Clock System Driver?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([local clock reference])
AC_ARG_ENABLE(
    [LOCAL-CLOCK],
    [AS_HELP_STRING(
	[--enable-LOCAL-CLOCK],
	[+ local clock reference]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_LOCAL], [1], [local clock reference?])
fi
AC_MSG_RESULT([$ntp_ok])

dnl Bug 340: longstanding unfixed bugs
dnl AC_MSG_CHECKING([EES M201 MSF receiver])
dnl AC_ARG_ENABLE([MSFEES],
dnl     [AS_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver])],
dnl     [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
dnl if test "$ntp_ok" = "yes"; then
dnl     ntp_refclock=yes
dnl     AC_DEFINE([CLOCK_MSFEES], [1], [EES M201 MSF receiver])
dnl fi
dnl AC_MSG_RESULT([$ntp_ok])

# Not Ultrix
AC_MSG_CHECKING([Magnavox MX4200 GPS receiver])
AC_ARG_ENABLE(
    [MX4200],
    [AS_HELP_STRING(
	[--enable-MX4200 ],
	[s Magnavox MX4200 GPS receiver]
    )],
    [ntp_ok=$enableval],
    [
	case "$ac_cv_var_ppsclock" in
	 yes)
	    ntp_ok=$ntp_eac
	    ;;
	 *)
	    ntp_ok=no
	    ;;
	esac
    ]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_MX4200], [1], [Magnavox MX4200 GPS receiver])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$host" in
 yes*-*-ultrix*) AC_MSG_WARN([*** But the expected answer is... no ***])
esac

AC_MSG_CHECKING([for NeoClock4X receiver])
AC_ARG_ENABLE(
    [NEOCLOCK4X],
    [AS_HELP_STRING(
	[--enable-NEOCLOCK4X],
	[+ NeoClock4X DCF77 / TDF receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_NEOCLOCK4X], [1], [NeoClock4X])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([NMEA GPS receiver])
AC_ARG_ENABLE(
    [NMEA],
    [AS_HELP_STRING(
	[--enable-NMEA],
	[+ NMEA GPS receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_NMEA], [1], [NMEA GPS receiver])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([for ONCORE Motorola VP/UT Oncore GPS])
AC_ARG_ENABLE(
    [ONCORE],
    [AS_HELP_STRING(
	[--enable-ONCORE],
	[s Motorola VP/UT Oncore GPS receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
case "$ntp_oncore_ok" in
 no) ntp_ok=no ;;
esac
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_ONCORE], 1, [Motorola UT Oncore GPS])
fi
AC_MSG_RESULT([$ntp_ok])

# Requires modem control
AC_MSG_CHECKING([for Palisade clock])
AC_ARG_ENABLE(
    [PALISADE],
    [AS_HELP_STRING(
	[--enable-PALISADE],
	[s Palisade clock]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_enable_all_modem_control_clocks]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_PALISADE], [1], [Palisade clock])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([Conrad parallel port radio clock])
AC_ARG_ENABLE(
    [PCF],
    [AS_HELP_STRING(
	[--enable-PCF ],
	[+ Conrad parallel port radio clock]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_PCF], [1], [Conrad parallel port radio clock])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([PST/Traconex 1020 WWV/WWVH receiver])
AC_ARG_ENABLE(
    [PST],
    [AS_HELP_STRING(
	[--enable-PST],
	[+ PST/Traconex 1020 WWV/WWVH receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_PST], [1], [PST/Traconex 1020 WWV/WWVH receiver])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([RIPENCC specific Trimble driver])
AC_ARG_ENABLE(
    [RIPENCC],
    [AS_HELP_STRING(
	[--enable-RIPENCC],
	[- RIPENCC specific Trimble driver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=no]
)
# 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
case "$ntp_ripe_ncc_ok" in
 no) ntp_ok=no ;;
esac
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_RIPENCC], [],[RIPE NCC Trimble clock])
fi
AC_MSG_RESULT([$ntp_ok])

# Danny Meyer says SHM compiles (with a few warnings) under Win32.
# For *IX, we need sys/ipc.h and sys/shm.h.
AC_MSG_CHECKING([for SHM clock attached thru shared memory])
AC_ARG_ENABLE(
    [SHM],
    [AS_HELP_STRING(
	[--enable-SHM],
	[s SHM clock attached thru shared memory]
    )],
    [ntp_ok=$enableval],
    [
	case "$ntp_eac$ntp_canshm" in
	 *no*)	ntp_ok=no  ;;
	 *)	ntp_ok=yes ;;
	esac
    ]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_SHM], [1], [clock thru shared memory])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([Spectracom 8170/Netclock/2 WWVB receiver])
AC_ARG_ENABLE(
    [SPECTRACOM],
    [AS_HELP_STRING(
	[--enable-SPECTRACOM],
	[+ Spectracom 8170/Netclock/2 WWVB receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_SPECTRACOM], [1],
	[Spectracom 8170/Netclock/2 WWVB receiver])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([KSI/Odetics TPRO/S GPS receiver/IRIG interface])
AC_ARG_ENABLE(
    [TPRO],
    [AS_HELP_STRING(
	[--enable-TPRO],
	[s KSI/Odetics TPRO/S GPS receiver/IRIG interface]
    )],
    [ntp_ok=$enableval],
    [
	case "$ac_cv_header_sys_tpro_h" in
	 yes)
	    ntp_ok=$ntp_eac
	    ;;
	 *)
	    ntp_ok=no
	    ;;
	esac
    ]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_TPRO], [1],
	[KSI/Odetics TPRO/S GPS receiver/IRIG interface])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ac_cv_header_sys_tpro" in
 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
esac

dnl Bug 342: longstanding unfixed bugs
dnl AC_MSG_CHECKING([TRAK 8810 GPS receiver])
dnl AC_ARG_ENABLE([TRAK],
dnl     [AS_HELP_STRING([--enable-TRAK], [+ TRAK 8810 GPS receiver])],
dnl     [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
dnl if test "$ntp_ok" = "yes"; then
dnl     ntp_refclock=yes
dnl     AC_DEFINE([CLOCK_TRAK], [1], [TRAK 8810 GPS receiver])
dnl fi
dnl AC_MSG_RESULT([$ntp_ok])

# Not on a vax-dec-bsd
AC_MSG_CHECKING([Kinemetrics/TrueTime receivers])
AC_ARG_ENABLE(
    [TRUETIME],
    [AS_HELP_STRING(
	[--enable-TRUETIME],
	[s Kinemetrics/TrueTime receivers]
    )],
    [ntp_ok=$enableval],
    [
	case "$host" in
	 vax-dec-bsd)
	    ntp_ok=no
	    ;;
	 *)
	    ntp_ok=$ntp_eac
	    ;;
	esac
    ]
)    
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_TRUETIME], [1], [Kinemetrics/TrueTime receivers])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$host" in
 yesvax-dec-bsd) AC_MSG_WARN([*** But the expected answer is... no ***])
esac

AC_MSG_CHECKING([TrueTime 560 IRIG-B decoder])
AC_ARG_ENABLE(
    [TT560],
    [AS_HELP_STRING(
	[--enable-TT560],
	[- TrueTime 560 IRIG-B decoder]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=no]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_TT560], [], [TrueTime 560 IRIG-B decoder?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([Ultralink M320 WWVB receiver])
AC_ARG_ENABLE(
    [ULINK],
    [AS_HELP_STRING(
	[--enable-ULINK],
	[+ Ultralink WWVB receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_ULINK], [1], [Ultralink M320 WWVB receiver?])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([WWV receiver])
AC_ARG_ENABLE(
    [WWV],
    [AS_HELP_STRING(
	[--enable-WWV],
	[s WWV Audio receiver]
    )],
    [ntp_ok=$enableval],
    [
	case "$ntp_eac$ntp_canaudio" in
	 *no*)	ntp_ok=no  ;;
	 *)	ntp_ok=yes ;;
	esac
    ]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_WWV], [1], [WWV audio driver])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canaudio" in
 yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
esac

AC_MSG_CHECKING([for Zyfer receiver])
AC_ARG_ENABLE(
    [ZYFER],
    [AS_HELP_STRING(
	[--enable-ZYFER],
	[+ Zyfer GPStarplus receiver]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eac]
)
if test "$ntp_ok" = "yes"; then
    ntp_refclock=yes
    AC_DEFINE([CLOCK_ZYFER], [1], [Zyfer GPStarplus])
fi
AC_MSG_RESULT([$ntp_ok])

AC_MSG_CHECKING([for default inclusion of all suitable PARSE clocks])
AC_ARG_ENABLE(
    [parse-clocks],
    [AS_HELP_STRING(
	[--enable-parse-clocks],
	[- include all suitable PARSE clocks:]
    )],
    [ntp_eapc=$enableval],
    [
	case "$ntp_eac" in
	 yes)	ntp_eapc=$ntp_canparse ;;
	 *)	ntp_eapc=no ;;
	esac
	# Delete the next line one of these days
	ntp_eapc=no
    ]
)
AC_MSG_RESULT($ntp_eapc)

case "$ntp_eac$ntp_eapc$ntp_canparse" in
 noyes*)
    AC_MSG_ERROR(["--enable-parse-clocks" requires "--enable-all-clocks".])
    ;;
 yesyesno)
    AC_MSG_ERROR([You said "--enable-parse-clocks" but PARSE isn't supported on this platform!])
    ;;
esac

ntp_libparse=no
ntp_parseutil=no
ntp_rawdcf=no

AC_MSG_CHECKING([Diem Computime Radio Clock])
AC_ARG_ENABLE(
    [COMPUTIME],
    [AS_HELP_STRING(
	[--enable-COMPUTIME],
	[s Diem Computime Radio Clock]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eapc]
)
if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes
    AC_DEFINE([CLOCK_COMPUTIME], [1], [Diems Computime Radio Clock?])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canparse" in
 yesno)
    AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
esac

AC_MSG_CHECKING([ELV/DCF7000 clock])
AC_ARG_ENABLE(
    [DCF7000],
    [AS_HELP_STRING(
	[--enable-DCF7000],
	[s ELV/DCF7000 clock]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eapc]
)
if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes
    AC_DEFINE([CLOCK_DCF7000], [1], [ELV/DCF7000 clock?])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canparse" in
 yesno)
    AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
esac

AC_MSG_CHECKING([HOPF 6021 clock])
AC_ARG_ENABLE(
    [HOPF6021],
    [AS_HELP_STRING(
	[--enable-HOPF6021],
	[s HOPF 6021 clock]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eapc]
)
if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes
    AC_DEFINE([CLOCK_HOPF6021], [1], [HOPF 6021 clock?])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canparse" in
 yesno)
    AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
esac

AC_MSG_CHECKING([Meinberg clocks])
AC_ARG_ENABLE(
    [MEINBERG],
    [AS_HELP_STRING(
	[--enable-MEINBERG],
	[s Meinberg clocks]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eapc]
)
if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes
    AC_DEFINE([CLOCK_MEINBERG], [1], [Meinberg clocks])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canparse" in
 yesno)
    AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
esac

AC_MSG_CHECKING([DCF77 raw time code])
AC_ARG_ENABLE(
    [RAWDCF],
    [AS_HELP_STRING(
	[--enable-RAWDCF],
	[s DCF77 raw time code]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eapc]
)
if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_parseutil=yes
    ntp_refclock=yes
    ntp_rawdcf=yes
    AC_DEFINE([CLOCK_RAWDCF], [1], [DCF77 raw time code])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canparse" in
 yesno)
    AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
esac

case "$ntp_rawdcf" in
 yes)
    AC_CACHE_CHECK([if we must enable parity for RAWDCF],
	[ntp_cv_rawdcf_parity],
	[
	    ans=no
	    case "$host" in
	     *-*-*linux*)
		ans=yes
		;;
	    esac
	    ntp_cv_rawdcf_parity=$ans
	]
    )
    case "$ntp_cv_rawdcf_parity" in
     yes)
	AC_DEFINE([RAWDCF_NO_IGNPAR], [1],
	    [Should we not IGNPAR (Linux)?]) ;;
    esac
esac

AC_MSG_CHECKING([RCC 8000 clock])
AC_ARG_ENABLE(
    [RCC8000],
    [AS_HELP_STRING(
	[--enable-RCC8000],
	[s RCC 8000 clock]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eapc]
)
if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes
    AC_DEFINE([CLOCK_RCC8000], [1], [RCC 8000 clock])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canparse" in
 yesno)
    AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
esac

AC_MSG_CHECKING([Schmid DCF77 clock])
AC_ARG_ENABLE(
    [SCHMID],
    [AS_HELP_STRING(
	[--enable-SCHMID ],
	[s Schmid DCF77 clock]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eapc]
)
if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes
    AC_DEFINE([CLOCK_SCHMID], [1], [Schmid DCF77 clock])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canparse" in
 yesno)
    AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
esac

AC_MSG_CHECKING([Trimble GPS receiver/TAIP protocol])
AC_ARG_ENABLE(
    [TRIMTAIP],
    [AS_HELP_STRING(
	[--enable-TRIMTAIP],
	[s Trimble GPS receiver/TAIP protocol]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eapc]
)
if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes
    AC_DEFINE([CLOCK_TRIMTAIP], [1],
	[Trimble GPS receiver/TAIP protocol])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canparse" in
 yesno)
    AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
esac

AC_MSG_CHECKING([Trimble GPS receiver/TSIP protocol])
AC_ARG_ENABLE(
    [TRIMTSIP],
    [AS_HELP_STRING(
	[--enable-TRIMTSIP],
	[s Trimble GPS receiver/TSIP protocol]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eapc]
)
if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes
    AC_DEFINE([CLOCK_TRIMTSIP], [1],
	[Trimble GPS receiver/TSIP protocol])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canparse" in
 yesno)
    AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
esac

AC_MSG_CHECKING([WHARTON 400A Series clock])
AC_ARG_ENABLE(
    [WHARTON],
    [AS_HELP_STRING(
	[--enable-WHARTON],
	[s WHARTON 400A Series clock]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eapc]
)
if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes
    AC_DEFINE([CLOCK_WHARTON_400A], [1], [WHARTON 400A Series clock])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canparse" in
 yesno)
    AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
esac

AC_MSG_CHECKING([VARITEXT clock])
AC_ARG_ENABLE(
    [VARITEXT],
    [AS_HELP_STRING(
	[--enable-VARITEXT],
	[s VARITEXT clock]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=$ntp_eapc]
)
if test "$ntp_ok" = "yes"; then
    ntp_libparse=yes
    ntp_refclock=yes
    AC_DEFINE([CLOCK_VARITEXT], [1], [VARITEXT clock])
fi
AC_MSG_RESULT([$ntp_ok])
case "$ntp_ok$ntp_canparse" in
 yesno)
    AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
esac

AC_SUBST([LIBPARSE])
AC_SUBST([MAKE_LIBPARSE])
AC_SUBST([MAKE_LIBPARSE_KERNEL])
AC_SUBST([MAKE_CHECK_Y2K])

AC_MSG_CHECKING([if we need to make and use the parse libraries])
ans=no
case "$ntp_libparse" in
 yes)
    ans=yes
    AC_DEFINE([CLOCK_PARSE], [1], [PARSE driver interface])
    LIBPARSE=../libparse/libparse.a
    MAKE_LIBPARSE=libparse.a
    # HMS: check_y2k trips the 34 year problem now...
    false && MAKE_CHECK_Y2K=check_y2k
esac
AC_MSG_RESULT([$ans])

NTP_OPENSSL

AC_MSG_CHECKING([if we want to compile with ElectricFence])
AC_ARG_WITH(
    [electricfence],
    [AS_HELP_STRING(
	[--with-electricfence],
	[- compile with ElectricFence malloc debugger]
    )],
    [ans=$withval],
    [ans=no]
)
case "$ans" in
 no) ;;
 *)
    LIBS="$LIBS \${top_builddir}/ElectricFence/libefence.a"
    EF_PROGS="eftest tstheap"
    AC_SUBST([EF_PROGS])
    EF_LIBS=libefence.a
    AC_SUBST([EF_LIBS])
    ans=yes
    ;;
esac
AC_MSG_RESULT([$ans])

AC_SUBST([MAKE_CHECK_LAYOUT])
AC_MSG_CHECKING([if we want to run check-layout])
case "$cross_compiling$PATH_PERL" in
 no/*)
    MAKE_CHECK_LAYOUT=check-layout
    ans=yes
    ;;
 *)
    ans=no
    ;;
esac
AC_MSG_RESULT([$ans])

AC_SUBST([TESTDCF])
AC_SUBST([DCFD])
AC_MSG_CHECKING([if we can make dcf parse utilities])
ans=no
if test "$ntp_parseutil" = "yes"; then
    case "$host" in
     *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*)
	ans="dcfd testdcf"
	DCFD=dcfd
        TESTDCF=testdcf
    esac
fi
AC_MSG_RESULT([$ans])

AC_SUBST([MAKE_PARSEKMODULE])
AC_MSG_CHECKING([if we can build kernel streams modules for parse])
ans=no
case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
 yesyes)
    case "$host" in
     sparc-*-sunos4*)
        case "$ntp_cv_var_kernel_pll" in
	yes)
	    AC_DEFINE([PPS_SYNC], [1], [PARSE kernel PLL PPS support])
	    ;;
	esac
	ans=parsestreams
	MAKE_PARSEKMODULE=parsestreams.loadable_module.o
	;;
     sparc-*-solaris2*)
	ans=parsesolaris
	MAKE_PARSEKMODULE=parse
	AC_CHECK_HEADERS([strings.h])
	;;
    esac
    ;;
esac
AC_MSG_RESULT([$ans])

AC_MSG_CHECKING([if we need basic refclock support])
if test "$ntp_refclock" = "yes"; then
    AC_DEFINE([REFCLOCK], [1], [Basic refclock support?])
fi
AC_MSG_RESULT($ntp_refclock)

dnl Things that can be made in clockstuff/
AC_SUBST([PROPDELAY])	dnl Set to "propdelay"
AC_SUBST([CHUTEST])	dnl Set to "chutest"
AC_SUBST([CLKTEST])	dnl Set to "clktest"

AC_SUBST([MAKE_ADJTIMED])
AC_MSG_CHECKING([if we want HP-UX adjtimed support])
case "$host" in
 *-*-hpux[[56789]]*)
    ans=yes
    ;;
 *) ans=no
    ;;
esac
if test "$ans" = "yes"; then
    MAKE_ADJTIMED=adjtimed
    AC_DEFINE([NEED_HPUX_ADJTIME], [1],
	[Do we need HPUX adjtime() library support?])
fi
AC_MSG_RESULT([$ans])

AC_MSG_CHECKING([if we want QNX adjtime support])
case "$host" in
 *-*-qnx*)
    ans=yes
    ;;
 *) ans=no
    ;;
esac
if test "$ans" = "yes"; then
    AC_DEFINE([NEED_QNX_ADJTIME], [1],
	[Do we need the qnx adjtime call?])
fi
AC_MSG_RESULT([$ans])

AC_MSG_CHECKING([if we can read kmem])

#  the default is to enable it if the system has the capability

case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
 *yes*)
    ans=yes
    ;;
 *) ans=no
esac

case "$host" in
 *-*-domainos)	# Won't be found...
    ans=no
    ;;
 *-*-hpux*)
    #ans=no
    ;;
 *-*-irix[[456]]*)
    ans=no
    ;;
 *-*-*linux*)
    ans=no
    ;;
 *-*-winnt3.5)
    ans=no
    ;;
 *-*-unicosmp*)
    ans=no
    ;;
esac

# --enable-kmem / --disable-kmem controls if present
AC_ARG_ENABLE(
    [kmem],
    [AS_HELP_STRING(
	[--enable-kmem],
	[s read /dev/kmem for tick and/or tickadj]
    )],
    [ans=$enableval]
)

AC_MSG_RESULT([$ans])

case "$ans" in
 yes)
    can_kmem=yes
    ;;
 *) 
    can_kmem=no
    AC_DEFINE([NOKMEM], [1], [Should we NOT read /dev/kmem?])
esac


AC_MSG_CHECKING([if adjtime is accurate])

# target-dependent defaults

case "$host" in
 i386-sequent-ptx*)
    ans=no
    ;;
 i386-unknown-osf1*)
    ans=yes
    ;;
 mips-sgi-irix[[456]]*)
    ans=yes
    ;;
 *-fujitsu-uxp*)
    ans=yes
    ;;
 *-ibm-aix[[456]]*)
    ans=yes
    ;;
 *-*-*linux*)
    ans=yes
    ;;
 *-*-solaris2.[[01]])
    ans=no
    ;;
 *-*-solaris2*)
    ans=yes
    ;;
 *-*-unicosmp*)
    ans=yes
    ;;
 *) ans=no
esac

# --enable-accurate-adjtime / --disable-accurate-adjtime
# override the default
AC_ARG_ENABLE(
    [accurate-adjtime],
    [AS_HELP_STRING(
	[--enable-accurate-adjtime], 
	[s the adjtime() call is accurate]
    )],
    [ans=$enableval]
)

AC_MSG_RESULT([$ans])

case "$ans" in
 yes) 
    AC_DEFINE([ADJTIME_IS_ACCURATE], [1], [Is adjtime() accurate?])
    adjtime_is_accurate=yes
    ;;
 *)
    adjtime_is_accurate=no
    ;;
esac

AC_CACHE_CHECK(
    [the name of 'tick' in the kernel],
    [ntp_cv_nlist_tick],
    [
	ans=_tick
	case "$host" in
	 m68*-hp-hpux*) # HP9000/300?
	    ans=_old_tick
	    ;;
	 *-apple-aux[[23]]*)
	    ans=tick
	    ;;
	 *-hp-hpux*)
	    ans=old_tick
	    ;;
	 *-ibm-aix[[3456]]*)
	    ans=no
	    ;;
	 *-*-mpeix*)
	    ans=no
	    ;;
	 *-*-ptx*)
	    ans=tick
	    ;;
	 *-*-sco3.2v[[45]]*)
	    ans=no
	    ;;
	 *-*-solaris2*)
	    ans=nsec_per_tick
	    ;;
	 *-*-sysv4*)
	    ans=tick
	    ;;
	esac
	ntp_cv_nlist_tick=$ans
    ]
)
case "$ntp_cv_nlist_tick" in
 ''|no)
    ;;	# HMS: I think we can only get 'no' here...
 *) 
    AC_DEFINE_UNQUOTED([K_TICK_NAME], ["$ntp_cv_nlist_tick"],
	[What is the name of TICK in the kernel?])
esac

AC_CACHE_CHECK(
    [for the units of 'tick'],
    [ntp_cv_tick_nano],
    [
	ans=usec
	case "$host" in
	 *-*-solaris2*)
	    ans=nsec
	    ;;
	esac
	ntp_cv_tick_nano=$ans
    ]
)
case "$ntp_cv_tick_nano" in
 nsec)
    AC_DEFINE([TICK_NANO], [1], [Is K_TICK_NAME in nanoseconds?])
esac

AC_CACHE_CHECK(
    [the name of 'tickadj' in the kernel],
    [ntp_cv_nlist_tickadj],
    [
	ans=_tickadj
	case "$host" in
	 m68*-hp-hpux*) # HP9000/300?
	    ans=_tickadj
	    ;;
	 *-apple-aux[[23]]*)
	    ans=tickadj
	    ;;
	 *-hp-hpux10*)
	    ans=no
	    ;;
	 *-hp-hpux9*)
	    ans=no
	    ;;
	 *-hp-hpux*)
	    ans=tickadj
	    ;;
	 *-*-aix*)
	    ans=tickadj
	    ;;
	 *-*-mpeix*)
	    ans=no
	    ;;
	 *-*-ptx*)
	    ans=tickadj
	    ;;
	 *-*-sco3.2v4*)
	    ans=no
	    ;;
	 *-*-sco3.2v5.0*)
	    ans=clock_drift
	    ;;
	 *-*-solaris2*)
	    ans=no	# hrestime_adj
	    ;;
	 *-*-sysv4*)
	    ans=tickadj
	    ;;
	esac
	ntp_cv_nlist_tickadj=$ans
    ]
)
case "$ntp_cv_nlist_tickadj" in
 ''|no)
    ;;	# HMS: I think we can only get 'no' here...
 *) 
    AC_DEFINE_UNQUOTED([K_TICKADJ_NAME], ["$ntp_cv_nlist_tickadj"],
	[What is the name of TICKADJ in the kernel?])
esac

AC_CACHE_CHECK(
    [for the units of 'tickadj'],
    [ntp_cv_tickadj_nano],
    [
	ans=usec
	case "$host" in
	 *-*-solaris2*)
	    ans=nsec
	    ;;
	esac
	ntp_cv_tickadj_nano=$ans
    ]
)
case "$ntp_cv_tickadj_nano" in
 nsec)
    AC_DEFINE([TICKADJ_NANO], [1], [Is K_TICKADJ_NAME in nanoseconds?])
esac

AC_CACHE_CHECK(
    [half-heartedly for 'dosynctodr' in the kernel],
    [ntp_cv_nlist_dosynctodr],
    [
	case "$host" in
	 *-apple-aux[[23]]*)
	    ans=no
	    ;;
	 *-sni-sysv*)
	    ans=dosynctodr
	    ;;
	 *-*-aix*)
	    ans=dosynctodr
	    ;;
	 *-*-hpux*)
	    ans=no
	    ;;
	 *-*-mpeix*)
	    ans=no
	    ;;
	 *-*-nextstep*)
	    ans=_dosynctodr
	    ;;
	 *-*-ptx*)
	    ans=doresettodr
	    ;;
	 *-*-sco3.2v4*)
	    ans=no
	    ;;
	 *-*-sco3.2v5*)
	    ans=track_rtc
	    ;;
	 *-*-solaris2*)
	    ans=dosynctodr
	    ;;
	 *-*-sysv4*)
	    ans=doresettodr
	    ;;
	 *)
	    ans=_dosynctodr
	    ;;
	esac
	ntp_cv_nlist_dosynctodr=$ans
    ]
)
case "$ntp_cv_nlist_dosynctodr" in
 no)
    ;;
 *)
    AC_DEFINE_UNQUOTED([K_DOSYNCTODR_NAME], ["$ntp_cv_nlist_dosynctodr"],
	[What is (probably) the name of DOSYNCTODR in the kernel?])
    ;;
esac

AC_CACHE_CHECK(
    [half-heartedly for 'noprintf' in the kernel],
    [ntp_cv_nlist_noprintf],
    [
	case "$host" in
	 *-apple-aux[[23]]*)
	    ans=no
	    ;;
	 *-sni-sysv*)
	    ans=noprintf
	    ;;
	 *-*-aix*)
	    ans=noprintf
	    ;;
	 *-*-hpux*)
	    ans=no
	    ;;
	 *-*-mpeix*)
	    ans=no
	    ;;
	 *-*-ptx*)
	    ans=noprintf
	    ;;
	 *-*-nextstep*)
	    ans=_noprintf
	    ;;
	 *-*-solaris2*)
	    ans=noprintf
	    ;;
	 *-*-sysv4*)
	    ans=noprintf
	    ;;
	 *)
	    ans=_noprintf
	    ;;
	esac
	ntp_cv_nlist_noprintf=$ans
    ]
)
case "$ntp_cv_nlist_noprintf" in
 no)
    ;;
 *)
    AC_DEFINE_UNQUOTED([K_NOPRINTF_NAME], ["$ntp_cv_nlist_noprintf"],
	[What is (probably) the name of NOPRINTF in the kernel?])
    ;;
esac

dnl The tick/tickadj sections were written by Skippy, who never learned
dnl that it's impolite (horridly gross) to show your guts in public.

dnl	tick		tickadj	
dnl	10000		80	    Unixware
dnl	1000000L/hz	tick/16     (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
dnl	10000		150	    sgi IRIX
dnl	1000000L/hz	1000	    RS6000 && NOKMEM
dnl	1000000L/hz	668	    DOMAINOS && NOKMEM
dnl	1000000L/hz	500/HZ	    other && NOKMEM
dnl	txc.tick	1	    Linux
dnl	(every / 10)	50	    WinNT - tickadj is roughly 500/hz
dnl	1000000L/hz	(nlist)     (Solaris && !ADJTIME_IS_ACCURATE),
dnl				    (RS6000 && !NOKMEM), SINIX MIPS

dnl But we'll only use these "values" if we can't find anything else.

AC_MSG_CHECKING([for a default value for 'tick'])

# target-dependent default for tick

case "$host" in
 *-*-pc-cygwin*)
    AC_MSG_ERROR([tick needs work for cygwin])
    ;;
 *-univel-sysv*)
    ans=10000
    ;;
 *-*-irix*)
    ans=10000
    ;;
 *-*-*linux*)
    ans=txc.tick
    ;;
 *-*-mpeix*)
    ans=no
    ;;
 *-*-winnt3.5)
    ans='(every / 10)'
    ;;
 *-*-unicosmp*)
    ans=10000
    ;;
 *)
    ans='1000000L/hz'
    ;;
esac

AC_ARG_ENABLE(
    [tick],
    [AS_HELP_STRING(
	[--enable-tick=VALUE],
	[s force a value for 'tick']
    )],
    [ans=$enableval]
)

AC_MSG_RESULT([$ans])

case "$ans" in
 ''|no)
    ;;	# HMS: I think we can only get 'no' here...
 *)
    AC_DEFINE_UNQUOTED([PRESET_TICK], [$ans],
	[Preset a value for 'tick'?])
esac

AC_MSG_CHECKING([for a default value for 'tickadj'])

# target-specific default
ans='500/hz'
case "$host" in
 *-fujitsu-uxp*)
    case "$adjtime_is_accurate" in
     yes)
	ans='tick/16'
    esac
    ;;
 *-univel-sysv*)
    ans=80
    ;;
 *-*-aix*)
    case "$can_kmem" in
     no)
	ans=1000
    esac
    ;;
 *-*-domainos)	# Skippy: won't be found...
    case "$can_kmem" in
     no)
	ans=668
    esac
    ;;
 *-*-hpux*)
    case "$adjtime_is_accurate" in
     yes)
	ans='tick/16'
    esac
    ;;
 *-*-irix*)
    ans=150
    ;;
 *-*-mpeix*)
    ans=no
    ;;
 *-*-sco3.2v5.0*)
    ans=10000L/hz
    ;;
 *-*-winnt3.5)
    ans=50
    ;;
 *-*-unicosmp*)
    ans=150
esac

AC_ARG_ENABLE(
    [tickadj],
    [AS_HELP_STRING(
	[--enable-tickadj=VALUE],
	[s force a value for 'tickadj']
    )],
    [ans=$enableval]
)

AC_MSG_RESULT([$ans])

default_tickadj=$ans

case "$default_tickadj" in
 ''|no)
    ;;	# HMS: I think we can only get 'no' here...
 *)
    AC_DEFINE_UNQUOTED([PRESET_TICKADJ], [$default_tickadj],
	[Preset a value for 'tickadj'?]) ;;
esac

# Newer versions of ReliantUNIX round adjtime() values down to
# 1/100s (system tick). Sigh ...
# Unfortunately, there is no easy way to know if particular release
# has this "feature" or any obvious way to test for it.
case "$host" in
 mips-sni-sysv4*)
    AC_DEFINE([RELIANTUNIX_CLOCK], [1],
	[Do we want the ReliantUNIX clock hacks?])
esac

case "$host" in
 *-*-sco3.2v5*)
    AC_DEFINE([SCO5_CLOCK], [1], [Do we want the SCO clock hacks?])
esac

ntp_cv_make_tickadj=yes
case "$can_kmem$ac_cv_var_tick$default_tickadj" in
 nonono)	# Don't read KMEM, no presets.  Bogus.
    AC_MSG_WARN([Can't read kmem, no PRESET_TICK or PRESET_TICKADJ.  No tickadj.])
    ntp_cv_make_tickadj=no
    ;;
 nono*)		# Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ.  Bogus.
    AC_MSG_WARN([Can't read kmem but no PRESET_TICK.  No tickadj.])
    ntp_cv_make_tickadj=no
    ;;
 no*no)		# Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ.  Bogus.
    AC_MSG_WARN([Can't read kmem but no PRESET_TICKADJ.  No tickadj.])
    ntp_cv_make_tickadj=no
    ;;
 no*)		# Don't read KMEM, PRESET_TICK and PRESET_TICKADJ.  Cool.
    ;;
 yesnono)	# Read KMEM, no presets.  Cool.
    ;;
 yesno*)	# Read KMEM, no PRESET_TICK but PRESET_TICKADJ.  Bogus.
    AC_MSG_WARN([PRESET_TICKADJ is defined but not PRESET_TICK.  Please report this.])
    ;;
 yes*no)	# Read KMEM, PRESET_TICK but no PRESET_TICKADJ.  Cool.
    ;;
 yes*)		# READ KMEM, PRESET_TICK and PRESET_TICKADJ.
    ;;
 *)		# Generally bogus.
    AC_MSG_ERROR([This shouldn't happen.])
    ;;
esac

AC_SUBST(MAKE_NTPTIME)
AC_CACHE_CHECK([if we want and can make the ntptime utility], ac_cv_make_ntptime,
[case "$host" in
 *) case "$ntp_cv_struct_ntptimeval$ntp_cv_var_kernel_pll" in
     yesyes)
	ans=yes
	;;
     *)
	ans=no
	;;
    esac
    ;;
esac
ac_cv_make_ntptime=$ans])
case "$ac_cv_make_ntptime" in
 yes)
    MAKE_NTPTIME=ntptime
    ;;
esac

AC_SUBST([MAKE_TICKADJ])
case "$host" in
 mips-sni-sysv4*)
    # tickadj is pretty useless on newer versions of ReliantUNIX
    # Do not bother
    ntp_cv_make_tickadj=no
    ;;
 *-*-irix*)
    ntp_cv_make_tickadj=no
    ;;
 *-*-solaris2*)
    # DLM says tickadj is a no-no starting with solaris2.5
    case "$host" in
     *-*-solaris2.1[[0-9]]*)
	ntp_cv_make_tickadj=no
	;;
     *-*-solaris2.[[0-4]]*) ;;
     *) ntp_cv_make_tickadj=no ;;
    esac
    ;;
 *-*-unicosmp*)
    ntp_cv_make_tickadj=no
    ;;
esac

#
# Despite all the above, we always make tickadj.  Setting
# ntp_cv_make_tickadj before AC_CACHE_CHECK will cause a false
# report that the configuration variable was cached.  It may
# be better to simply remove the hunk above, I did not want
# to remove it if there is hope it will be used again.
#
AS_UNSET([ntp_cv_make_tickadj])

AC_CACHE_CHECK(
    [if we want and can make the tickadj utility],
    [ntp_cv_make_tickadj],
    [ntp_cv_make_tickadj=yes]
)
case "$ntp_cv_make_tickadj" in
 yes)
    MAKE_TICKADJ=tickadj
esac

AC_SUBST([MAKE_TIMETRIM])
AC_CACHE_CHECK(
    [if we want and can make the timetrim utility],
    [ntp_cv_make_timetrim],
    [
	case "$host" in
	 *-*-irix*)
	    ntp_cv_make_timetrim=yes
	    ;;
	 *-*-unicosmp*)
	    ntp_cv_make_timetrim=yes
	    ;;
	 *)
	    ntp_cv_make_timetrim=no
	    ;;
	esac
    ]
)
case "$ntp_cv_make_timetrim" in
 yes)
    MAKE_TIMETRIM=timetrim
esac

AC_SUBST([MAKE_LIBNTPSIM])
AC_SUBST([MAKE_NTPDSIM])

AC_MSG_CHECKING([if we want to build the NTPD simulator])
AC_ARG_ENABLE(
    [simulator],
    [AS_HELP_STRING(
	[--enable-simulator],
	[- build/install the NTPD simulator?]
    )],
    [ans=$enableval], 
    [ans=no]
)
AC_MSG_RESULT([$ans])
case "$ans" in
 yes)
    MAKE_NTPDSIM=ntpdsim
    MAKE_LIBNTPSIM=libntpsim.a
esac

case "$build" in
 $host)
    ;;
 *) case "$host" in
     *-*-vxworks*)
	LDFLAGS="$LDFLAGS -r"
	;;
    esac
    ;;
esac


AC_MSG_CHECKING([if we want to build ntpsnmpd])
AC_ARG_WITH(
    [ntpsnmpd],
    [AS_HELP_STRING(
	[--with-ntpsnmpd],
	[s Build ntpsnmpd MIB agent?]
    )],
    [ans=$withval],
    [
	case "$PATH_NET_SNMP_CONFIG" in
	 /*)	ans=yes ;;
	 *)	ans=no  ;;
	esac
    ]
)
AC_MSG_RESULT([$ans])
case "$ans" in
 yes)
    case "$PATH_NET_SNMP_CONFIG" in
     /*)
	SNMP_LIBS=`$PATH_NET_SNMP_CONFIG --agent-libs`
	AC_SUBST([SNMP_LIBS])
	# HMS: we really want to separate CPPFLAGS and CFLAGS
	foo=`$PATH_NET_SNMP_CONFIG --cflags`
	SNMP_CPPFLAGS=
	SNMP_CFLAGS=
	for i in $foo; do
	    case "$i" in
	     -D*|-U*|-I*)
		SNMP_CPPFLAGS="$SNMP_CPPFLAGS $i"
		;;
	    *)	SNMP_CFLAGS="$SNMP_CFLAGS $i"
		;;
	    esac
	done
	AC_SUBST([SNMP_CPPFLAGS])
	AC_SUBST([SNMP_CFLAGS])

	save_CFLAGS=$CFLAGS
	save_CPPFLAGS=$CPPFLAGS
	save_LIBS=$LIBS
	CFLAGS=$SNMP_CFLAGS
	CPPFLAGS=$SNMP_CPPFLAGS

	AC_CHECK_HEADER(
	    [net-snmp/net-snmp-config.h],
	    [MAKE_NTPSNMPD=ntpsnmpd],
	    [AC_MSG_WARN([net-snmp-config present but net-snmp headers are not available!])]
	)

	# Do this last, as we're messing up LIBS.
	# check -lnetsnmp for netsnmp_daemonize
	LIBS=`$PATH_NET_SNMP_CONFIG --libs`
	AC_CHECK_LIB(
	    [netsnmp],
	    [netsnmp_daemonize],
	    [ans=yes],
	    [ans=no]
	)
	case "$ans" in
	 no)
	    AC_DEFINE([NEED_NETSNMP_DAEMONIZE], [1],
		[We need to provide netsnmp_daemonize()])
	esac
	
	CFLAGS=$save_CFLAGS
	CPPFLAGS=$save_CPPFLAGS
	LIBS=$save_LIBS
	;;
     *) 
	AC_MSG_WARN([Cannot build ntpsnmpd - net-snmp-config cannot be found])
	;;
    esac
    ;;
esac
AC_SUBST([MAKE_NTPSNMPD])


AC_MSG_CHECKING([if we should always slew the time])

# target-specific defaults

case "$host" in
 *-apple-aux[[23]]*)
    ans=yes
    ;;
 *-*-bsdi[[012]]*)
    ans=no
    ;;
 *-*-bsdi*)
    ans=yes
    ;;
 *-*-openvms*)	# HMS: won't be found
    ans=yes
    ;;
 *) ans=no
    ;;
esac

# --enable-slew-always / --disable-slew-always overrides default

AC_ARG_ENABLE(
    [slew-always],
    [AS_HELP_STRING(
	[--enable-slew-always],
	[s always slew the time]
    )],
    [ans=$enableval]
)

AC_MSG_RESULT([$ans])

case "$ans" in
 yes)
    AC_DEFINE([SLEWALWAYS], [1], [Slew always?])
esac

AC_MSG_CHECKING([if we should step and slew the time])

case "$host" in
 *-sni-sysv*)
    ans=yes
    ;;
 *-univel-sysv*)
    ans=no
    ;;
 *-*-ptx*)
    ans=yes
    ;;
 *-*-solaris2.1[[0-9]]*)
    ans=no
    ;;
 *-*-solaris2.[[012]]*)
    ans=yes
    ;;
 *-*-sysv4*)	# HMS: Does this catch Fujitsu UXP?
    ans=yes
    ;;
 *) ans=no
    ;;
esac

AC_ARG_ENABLE(
    [step-slew],
    [AS_HELP_STRING(
	[--enable-step-slew],
	[s step and slew the time]
    )],
    [ans=$enableval]
)

AC_MSG_RESULT([$ans])

case "$ans" in
 yes)
    AC_DEFINE([STEP_SLEW], [1], [Step, then slew the clock?])
esac

AC_MSG_CHECKING([if ntpdate should step the time])

case "$host" in
 *-apple-aux[[23]]*)
    ans=yes
    ;;
 *) ans=no
esac

AC_ARG_ENABLE(
    [ntpdate-step],
    [AS_HELP_STRING(
	[--enable-ntpdate-step],
	[s if ntpdate should step the time]
    )],
    [ans=$enableval]
)

AC_MSG_RESULT([$ans])

case "$ans" in
 yes)
    AC_DEFINE([FORCE_NTPDATE_STEP], [1],
	[force ntpdate to step the clock if !defined(STEP_SLEW) ?])
esac


AC_MSG_CHECKING([if we should sync TODR clock every hour])

case "$host" in
 *-*-nextstep*)
    ans=yes
    ;;
 *-*-openvms*)	# HMS: won't be found
    ans=yes
    ;;
 *)
    ans=no
esac

AC_ARG_ENABLE(
    [hourly-todr-sync],
    [AS_HELP_STRING(
	[--enable-hourly-todr-sync],
	[s if we should sync TODR hourly]
    )],
    [ans=$enableval]
)

AC_MSG_RESULT([$ans])

case "$ac_cv_var_sync_todr" in
 yes)
    AC_DEFINE([DOSYNCTODR], [1], [synch TODR hourly?]) ;;
esac


AC_MSG_CHECKING([if we should avoid kernel FLL bug])

case "$host" in
 *-*-solaris2.6)
    unamev=`uname -v`
    case "$unamev" in
     Generic_105181-*)
	old_IFS="$IFS"
	IFS="-"
	set $unamev
	IFS="$old_IFS"
	if test "$2" -ge 17
	then
	    # Generic_105181-17 and higher
	    ans=no
	else
	    ans=yes
	fi
	;;
     *) 
	ans=yes
    esac
    ;;
 *-*-solaris2.7)
    unamev=`uname -v`
    case "$unamev" in
     Generic_106541-*)
	old_IFS="$IFS"
	IFS="-"
	set $unamev
	IFS="$old_IFS"
	if test "$2" -ge 07
	then
	    # Generic_106541-07 and higher
	    ans=no
	else
	    ans=yes
	fi
	;;
     *)
	ans=yes
    esac
    ;;
 *)
    ans=no
esac

AC_ARG_ENABLE(
    [kernel-fll-bug],
    [AS_HELP_STRING(
	[--enable-kernel-fll-bug],
	[s if we should avoid a kernel FLL bug]
    )],
    [ans=$enableval]
)

AC_MSG_RESULT([$ans])

case "$ans" in
 yes)
    AC_DEFINE([KERNEL_FLL_BUG], [1], [Does the kernel have an FLL bug?])
esac


AC_MSG_CHECKING([if we want new session key behavior])
AC_ARG_ENABLE(
    [bug1243-fix],
    [AS_HELP_STRING(
	[--enable-bug1243-fix],
	[+ use unmodified autokey session keys]
    )],
    [ans=$enableval],
    [ans=yes]
)
AC_MSG_RESULT([$ans])
case "$ans" in
 no)
    AC_DEFINE([DISABLE_BUG1243_FIX], [1],
	[use old autokey session key behavior?])
esac


AC_MSG_CHECKING([if we should use the IRIG sawtooth filter])

case "$host" in
 *-*-solaris2.[[89]])
    ans=yes
    ;;
 *-*-solaris2.1[[0-9]]*)
    ans=yes
    ;;
 *) ans=no
esac

AC_ARG_ENABLE(
    [irig-sawtooth], 
    [AS_HELP_STRING(
	[--enable-irig-sawtooth],
	[s if we should enable the IRIG sawtooth filter]
    )],
    [ans=$enableval]
)

AC_MSG_RESULT([$ans])

case "$ans" in
 yes)
    AC_DEFINE([IRIG_SUCKS], [1],
	[Should we use the IRIG sawtooth filter?])
esac


AC_MSG_CHECKING([if we should enable NIST lockclock scheme])

AC_ARG_ENABLE(
	[nist], 
	[AS_HELP_STRING(
	    [--enable-nist],
	    [- if we should enable the NIST lockclock scheme]
	)],
	[ans=$enableval],
	[ans=no]
)

AC_MSG_RESULT([$ans])

case "$ans" in
 yes)
    AC_DEFINE([LOCKCLOCK], [1],
	[Should we align with the NIST lockclock scheme?]) ;;
esac


AC_MSG_CHECKING([if we want support for Samba's signing daemon])

AC_ARG_ENABLE(
    [ntp-signd],
    [AS_HELP_STRING(
	[--enable-ntp-signd],
	[- Provide support for Samba's signing daemon, =/var/run/ntp_signd]
    )],
    [ans=$enableval],
    [ans=no]
)

AC_MSG_RESULT([$ans])

case "$ans" in
 no)
    ntp_signd_path=
    ;;
 yes)
    ntp_signd_path=/var/run/ntp_signd
    ;;
 *)
    ntp_signd_path="$ans"
esac

case "$ntp_signd_path" in
 '')
    ;;
 *)
    AC_DEFINE([HAVE_NTP_SIGND], [1],
	[Do we want support for Samba's signing daemon?])
    AC_DEFINE_UNQUOTED([NTP_SIGND_PATH], ["$ntp_signd_path"],
	[Path to sign daemon rendezvous socket])
esac


AC_CHECK_HEADERS([sys/clockctl.h])

case "$host" in
 *-*-netbsd*)
    ans=yes
    ;;
 *) ans=no
    ;;
esac

AC_ARG_ENABLE(
    [clockctl],
    [AS_HELP_STRING(
	[--enable-clockctl],
	[s Use /dev/clockctl for non-root clock control]
    )],
    [ntp_use_dev_clockctl=$enableval],
    [ntp_use_dev_clockctl=$ac_cv_header_sys_clockctl_h]
)

AC_MSG_CHECKING([[if we should use /dev/clockctl]])
AC_MSG_RESULT([$ntp_use_dev_clockctl])


AC_CHECK_HEADERS([sys/capability.h sys/prctl.h])

AC_MSG_CHECKING([if we have linux capabilities (libcap)])

case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in
 yesyes)
    case "$host" in
     mips-sgi-irix*)
	ntp_have_linuxcaps=no
	;;
     *) ntp_have_linuxcaps=yes
	;;
    esac
    ;;
 *)
    ntp_have_linuxcaps=no
    ;;
esac

AC_ARG_ENABLE(
    [linuxcaps],
    [AS_HELP_STRING(
	[--enable-linuxcaps],
	[+ Use Linux capabilities for non-root clock control]
    )],
    [ntp_have_linuxcaps=$enableval]
)

AC_MSG_RESULT([$ntp_have_linuxcaps])

case "$ntp_have_linuxcaps" in
 yes)
    AC_DEFINE([HAVE_LINUX_CAPABILITIES], [1],
	[Do we have Linux capabilities?])
    LIBS="$LIBS -lcap"
esac

case "$ntp_use_dev_clockctl$ntp_have_linuxcaps" in
 *yes*)
    AC_DEFINE([HAVE_DROPROOT], [1],
	[Can we drop root privileges?])
esac


AC_CHECK_HEADERS([libscf.h])
LSCF=
case "$ac_cv_header_libscf_h" in
 yes)
    LSCF='-lscf'
esac
AC_SUBST([LSCF])

AC_CHECK_FUNC(
    [setppriv],
    [ans=yes],
    [ans=no]
)
case "$ans" in
 yes)
    AC_DEFINE([HAVE_SOLARIS_PRIVS], [1],
	[Are Solaris privileges available?])
esac


AC_CACHE_CHECK(
    [struct sockaddr for sa_len],
    [isc_cv_platform_havesalen],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
		#include 
	    ]],
	    [[
		extern struct sockaddr *ps;
		return ps->sa_len;
	    ]]
	)],
	[isc_cv_platform_havesalen=yes],
	[isc_cv_platform_havesalen=no]
    )]
)
case "$isc_cv_platform_havesalen" in
 yes)
    AC_DEFINE([ISC_PLATFORM_HAVESALEN], [1],
	 [struct sockaddr has sa_len?])
esac

AC_ARG_ENABLE(
    [ipv6],
    [AS_HELP_STRING(
	[--enable-ipv6],
	[s use IPv6?]
    )]
)

case "$enable_ipv6" in
 yes|''|autodetect)
    case "$host" in
     powerpc-ibm-aix4*)
	;;
     *)
	AC_DEFINE([WANT_IPV6], [1], [configure --enable-ipv6])
	;;
    esac
    ;;
 no)
    ;;
esac


dnl [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion)
case "$host" in
 *-*-darwin*)
    AC_DEFINE([__APPLE_USE_RFC_3542], [1], [Are we _special_?])
esac


AC_CACHE_CHECK(
    [for IPv6 structures],
    [isc_cv_found_ipv6],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
		#include 
		#include 
	    ]],
	    [[
		struct sockaddr_in6 sin6;
	    ]]
	)],
	[isc_cv_found_ipv6=yes],
	[isc_cv_found_ipv6=no]
    )]
)

#
# See whether IPv6 support is provided via a Kame add-on.
# This is done before other IPv6 linking tests so LIBS is properly set.
#
AC_MSG_CHECKING([for Kame IPv6 support])
AC_ARG_WITH(
    [kame],
    [AS_HELP_STRING(
	[--with-kame],
	[- =/usr/local/v6]
    )],
    [use_kame="$withval"],
    [use_kame="no"]
)
case "$use_kame" in
 no)
    ;;
 yes)
    kame_path=/usr/local/v6
    ;;
 *)
    kame_path="$use_kame"
    ;;
esac
case "$use_kame" in
 no)
    AC_MSG_RESULT([no])
    ;;
 *)
    if test -f $kame_path/lib/libinet6.a; then
	AC_MSG_RESULT([$kame_path/lib/libinet6.a])
	LIBS="-L$kame_path/lib -linet6 $LIBS"
    else
	AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.

Please choose the proper path with the following command:

    configure --with-kame=PATH
])
    fi
    ;;
esac

#
# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
# Including it on Kame-using platforms is very bad, though, because
# Kame uses #error against direct inclusion.   So include it on only
# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
# This is done before the in6_pktinfo check because that's what
# netinet6/in6.h is needed for.
#
case "$host" in
 *-bsdi4.[[01]]*)
    AC_DEFINE([ISC_PLATFORM_NEEDNETINET6IN6H], [1],
	[Do we need netinet6/in6.h?])
    isc_netinet6in6_hack="#include "
    ;;
 *)
    isc_netinet6in6_hack=""
    ;;
esac

#
# This is similar to the netinet6/in6.h issue.
#
case "$host" in
 *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
    AC_DEFINE([ISC_PLATFORM_FIXIN6ISADDR], [1],
	[Do we need to fix in6isaddr?])
    isc_netinetin6_hack="#include "
    ;;
 *)
    isc_netinetin6_hack=""
    ;;
esac


case "$isc_cv_found_ipv6" in
 yes)
    AC_DEFINE([ISC_PLATFORM_HAVEIPV6], [1], [have IPv6?])
    AC_CACHE_CHECK(
	[for in6_pktinfo],
	[isc_cv_have_in6_pktinfo],
	[AC_COMPILE_IFELSE(
	    [AC_LANG_PROGRAM(
		[[
		    #include 
		    #include 
		    #include 
		    $isc_netinetin6_hack
		    $isc_netinet6in6_hack
		]],
		[[
		    struct in6_pktinfo xyzzy;
		]]
	    )],
	    [isc_cv_have_in6_pktinfo=yes],
	    [isc_cv_have_in6_pktinfo=no]
	)]
    )
    case "$isc_cv_have_in6_pktinfo" in
     yes)
	AC_DEFINE([ISC_PLATFORM_HAVEIN6PKTINFO], [1],
		[have struct in6_pktinfo?])
    esac


    # HMS: Use HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead?
    AC_CACHE_CHECK(
	[for sockaddr_in6.sin6_scope_id],
	[isc_cv_have_sin6_scope_id],
	[AC_COMPILE_IFELSE(
	    [AC_LANG_PROGRAM(
		[[
		    #include 
		    #include 
		    #include 
		    $isc_netinetin6_hack
		    $isc_netinet6in6_hack
		]],
		[[
		    struct sockaddr_in6 xyzzy;
		    xyzzy.sin6_scope_id = 0;
		]]
	    )],
	    [isc_cv_have_sin6_scope_id=yes],
	    [isc_cv_have_sin6_scope_id=no]
	)]
    )

    case "$isc_cv_have_sin6_scope_id" in
     yes)
	AC_DEFINE([ISC_PLATFORM_HAVESCOPEID], [1], [sin6_scope_id?])
    esac
esac


# We need this check run even without isc_cv_found_ipv6=yes

AC_CACHE_CHECK(
    [for in6addr_any],
    [isc_cv_have_in6addr_any],
    [AC_LINK_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
		#include 
		#include 
		$isc_netinetin6_hack
		$isc_netinet6in6_hack
	    ]],
	    [[
		struct in6_addr in6; 
		in6 = in6addr_any;
	    ]]
	)],
	[isc_cv_have_in6addr_any=yes],
	[isc_cv_have_in6addr_any=no]
    )]
)

case "$isc_cv_have_in6addr_any" in
 no)
    AC_DEFINE([ISC_PLATFORM_NEEDIN6ADDRANY], [1], [missing in6addr_any?])
esac


AC_CACHE_CHECK(
    [for struct if_laddrconf],
    [isc_cv_struct_if_laddrconf],
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
		#include 
	    ]],
	    [[
		struct if_laddrconf a;
	    ]]
	)],
	[isc_cv_struct_if_laddrconf=yes],
	[isc_cv_struct_if_laddrconf=no]
    )]
)

case "$isc_cv_struct_if_laddrconf" in
 yes)
    AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRCONF], [1],
	[have struct if_laddrconf?])
esac

AC_CACHE_CHECK(
    [for struct if_laddrreq],
    isc_cv_struct_if_laddrreq,
    [AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM(
	    [[
		#include 
		#include 
	    ]],
	    [[
		struct if_laddrreq a;
	    ]]
	)],
	[isc_cv_struct_if_laddrreq=yes],
	[isc_cv_struct_if_laddrreq=no]
    )]
)

case "$isc_cv_struct_if_laddrreq" in
 yes)
    AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRREQ], [1],
	[have struct if_laddrreq?])
esac

#
# Look for a sysctl call to get the list of network interfaces.
#
AC_CACHE_CHECK(
    [for interface list sysctl],
    [ntp_cv_iflist_sysctl],
    [AC_EGREP_CPP(
	[found_rt_iflist], 
	[
	    #include 
	    #include 
	    #include 
	    #ifdef NET_RT_IFLIST  
		found_rt_iflist
	    #endif
	],
	[ntp_cv_iflist_sysctl=yes],
	[ntp_cv_iflist_sysctl=no]
    )]
)
case "$ntp_cv_iflist_sysctl" in
 yes)
    AC_DEFINE([HAVE_IFLIST_SYSCTL], [1], [have iflist_sysctl?])
esac

###

AC_MSG_CHECKING([if we want the saveconfig mechanism])
AC_ARG_ENABLE(
    [saveconfig],
    [AS_HELP_STRING(
	[--enable-saveconfig],
	[+ saveconfig mechanism]
    )],
    [ntp_ok=$enableval],
    [ntp_ok=yes]
)
ntp_saveconfig_enabled=0
if test "$ntp_ok" = "yes"; then
    ntp_saveconfig_enabled=1
    AC_DEFINE([SAVECONFIG], [1], [saveconfig mechanism])
fi
AM_CONDITIONAL([SAVECONFIG_ENABLED], [test x$ntp_saveconfig_enabled = x1])
AC_MSG_RESULT([$ntp_ok])

###

AC_DEFINE_DIR([NTP_KEYSDIR], [sysconfdir],
    [Default location of crypto key info])

AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([ElectricFence/Makefile])
AC_CONFIG_FILES([adjtimed/Makefile])
AC_CONFIG_FILES([clockstuff/Makefile])
AC_CONFIG_FILES([include/Makefile])
AC_CONFIG_FILES([include/isc/Makefile])
AC_CONFIG_FILES([kernel/Makefile])
AC_CONFIG_FILES([kernel/sys/Makefile])
AC_CONFIG_FILES([libntp/Makefile])
AC_CONFIG_FILES([libparse/Makefile])
AC_CONFIG_FILES([ntpd/Makefile])
AC_CONFIG_FILES([ntpdate/Makefile])
AC_CONFIG_FILES([ntpdc/Makefile])
AC_CONFIG_FILES([ntpdc/nl.pl],		[chmod +x ntpdc/nl.pl])
AC_CONFIG_FILES([ntpq/Makefile])
AC_CONFIG_FILES([ntpsnmpd/Makefile])
AC_CONFIG_FILES([parseutil/Makefile])
AC_CONFIG_FILES([scripts/Makefile])
AC_CONFIG_FILES([scripts/calc_tickadj],	[chmod +x scripts/calc_tickadj])
AC_CONFIG_FILES([scripts/checktime],	[chmod +x scripts/checktime])
AC_CONFIG_FILES([scripts/freq_adj],	[chmod +x scripts/freq_adj])
AC_CONFIG_FILES([scripts/html2man],	[chmod +x scripts/html2man])
AC_CONFIG_FILES([scripts/mkver],	[chmod +x scripts/mkver])
AC_CONFIG_FILES([scripts/ntp-wait],	[chmod +x scripts/ntp-wait])
AC_CONFIG_FILES([scripts/ntpsweep],	[chmod +x scripts/ntpsweep])
AC_CONFIG_FILES([scripts/ntptrace],	[chmod +x scripts/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([util/Makefile])

AC_CONFIG_SUBDIRS([sntp])

AC_OUTPUT
ntp-4.2.6p5/depsver.mf0000644000175000017500000000460511307651603013614 0ustar  peterpeter$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
	@[ -f $@ ] ||							\
		cp $(top_srcdir)/deps-ver $@
	@[ -w $@ ] ||							\
		chmod ug+w $@
	@cmp $(top_srcdir)/deps-ver $@ > /dev/null || (			\
		$(MAKE) clean &&					\
		echo -n "Prior $(subdir)/$(DEPDIR) version " &&		\
		cat $@ &&						\
		rm -rf $(DEPDIR) &&					\
		mkdir $(DEPDIR) && 					\
		case "$(top_builddir)" in				\
		 .)							\
		    ./config.status Makefile depfiles			\
		    ;;							\
		 ..)							\
			cd .. &&					\
			./config.status $(subdir)/Makefile depfiles &&	\
			cd $(subdir)					\
		    ;;							\
		 *)							\
		    echo 'Fatal: depsver.mf Automake fragment limited'	\
			 'to immediate subdirectories.'	&&		\
		    echo "top_builddir:	$(top_builddir)" &&		\
		    echo "subdir:	$(subdir)" &&			\
		    exit 1						\
		    ;;							\
		esac &&							\
		echo -n "Cleaned $(subdir)/$(DEPDIR) version " &&	\
		cat $(top_srcdir)/deps-ver				\
	)
	cp $(top_srcdir)/deps-ver $@

.deps-ver: $(top_srcdir)/deps-ver
	@[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver
	@touch $@

BUILT_SOURCES += .deps-ver
CLEANFILES += .deps-ver

#
# depsver.mf	included in Makefile.am for directories with .deps
#
# When building in the same directory with sources that change over
# time, such as when tracking using bk, the .deps files can become
# stale with respect to moved, deleted, or superceded headers.  Most
# commonly, this would exhibit as make reporting a failure to make a
# header file which is no longer in the location given.  To address
# this issue, we use a deps-ver file which is updated with each change
# that breaks old .deps files.  A copy of deps-ver is made into
# $(DEPDIR) if not already present.  If $(DEPDIR)/deps-ver is present
# with different contents than deps-ver, we make clean to ensure all
# .o files built before the incompatible change are rebuilt along with
# their updated .deps files, then remove $(DEPDIR) and recreate it as
# empty stubs.
#
# It is normal when configured with --disable-dependency-tracking for
# the DEPDIR to not have been created.  For this reason, we use the
# intermediate target .deps-ver, which invokes make recursively if
# DEPDIR exists.
#
# If you modify depsver.mf, please make the changes to the master
# copy, the one in sntp is copied by the bootstrap script from it.
#
# This comment block follows rather than leads the related code so that
# it stays with it in the generated Makefile.in and Makefile.
#
ntp-4.2.6p5/deps-ver0000644000175000017500000000003511474355436013273 0ustar  peterpeterTue Nov 16 19:50:15 UTC 2010
ntp-4.2.6p5/ntpd/0000755000175000017500000000000011675461363012572 5ustar  peterpeterntp-4.2.6p5/ntpd/refclock_arbiter.c0000644000175000017500000003005011455531713016225 0ustar  peterpeter/*
 * refclock_arbiter - clock driver for Arbiter 1088A/B Satellite
 *	Controlled Clock
 */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_ARBITER)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"

#include 
#include 

#ifdef SYS_WINNT
extern int async_write(int, const void *, unsigned int);
#undef write
#define write(fd, data, octets)	async_write(fd, data, octets)
#endif

/*
 * This driver supports the Arbiter 1088A/B Satellite Controlled Clock.
 * The claimed accuracy of this clock is 100 ns relative to the PPS
 * output when receiving four or more satellites.
 *
 * The receiver should be configured before starting the NTP daemon, in
 * order to establish reliable position and operating conditions. It
 * does not initiate surveying or hold mode. For use with NTP, the
 * daylight savings time feature should be disables (D0 command) and the
 * broadcast mode set to operate in UTC (BU command).
 *
 * The timecode format supported by this driver is selected by the poll
 * sequence "B5", which initiates a line in the following format to be
 * repeated once per second until turned off by the "B0" poll sequence.
 *
 * Format B5 (24 ASCII printing characters):
 *
 * i yy ddd hh:mm:ss.000bbb  
 *
 *	on-time = 
 *	i = synchronization flag (' ' = locked, '?' = unlocked)
 *	yy = year of century
 *	ddd = day of year
 *	hh:mm:ss = hours, minutes, seconds
 *	.000 = fraction of second (not used)
 *	bbb = tailing spaces for fill
 *
 * The alarm condition is indicated by a '?' at i, which indicates the
 * receiver is not synchronized. In normal operation, a line consisting
 * of the timecode followed by the time quality character (TQ) followed
 * by the receiver status string (SR) is written to the clockstats file.
 * The time quality character is encoded in IEEE P1344 standard:
 *
 * Format TQ (IEEE P1344 estimated worst-case time quality)
 *
 *	0	clock locked, maximum accuracy
 *	F	clock failure, time not reliable
 *	4	clock unlocked, accuracy < 1 us
 *	5	clock unlocked, accuracy < 10 us
 *	6	clock unlocked, accuracy < 100 us
 *	7	clock unlocked, accuracy < 1 ms
 *	8	clock unlocked, accuracy < 10 ms
 *	9	clock unlocked, accuracy < 100 ms
 *	A	clock unlocked, accuracy < 1 s
 *	B	clock unlocked, accuracy < 10 s
 *
 * The status string is encoded as follows:
 *
 * Format SR (25 ASCII printing characters)
 *
 *	V=vv S=ss T=t P=pdop E=ee
 *
 *	vv = satellites visible
 *	ss = relative signal strength
 *	t = satellites tracked
 *	pdop = position dilution of precision (meters)
 *	ee = hardware errors
 *
 * If flag4 is set, an additional line consisting of the receiver
 * latitude (LA), longitude (LO), elevation (LH) (meters), and data
 * buffer (DB) is written to this file. If channel B is enabled for
 * deviation mode and connected to a 1-PPS signal, the last two numbers
 * on the line are the deviation and standard deviation averaged over
 * the last 15 seconds.
 *
 * PPS calibration fudge time1 .001240
 */

/*
 * Interface definitions
 */
#define	DEVICE		"/dev/gps%d" /* device name and unit */
#define	SPEED232	B9600	/* uart speed (9600 baud) */
#define	PRECISION	(-20)	/* precision assumed (about 1 us) */
#define	REFID		"GPS "	/* reference ID */
#define	DESCRIPTION	"Arbiter 1088A/B GPS Receiver" /* WRU */
#define	LENARB		24	/* format B5 timecode length */
#define MAXSTA		40	/* max length of status string */
#define MAXPOS		80	/* max length of position string */

#ifdef PRE_NTP420
#define MODE ttlmax
#else
#define MODE ttl
#endif

#define COMMAND_HALT_BCAST ( (peer->MODE % 2) ? "O0" : "B0" )
#define COMMAND_START_BCAST ( (peer->MODE % 2) ? "O5" : "B5" )

/*
 * ARB unit control structure
 */
struct arbunit {
	l_fp	laststamp;	/* last receive timestamp */
	int	tcswitch;	/* timecode switch/counter */
	char	qualchar;	/* IEEE P1344 quality (TQ command) */
	char	status[MAXSTA];	/* receiver status (SR command) */
	char	latlon[MAXPOS];	/* receiver position (lat/lon/alt) */
};

/*
 * Function prototypes
 */
static	int	arb_start	(int, struct peer *);
static	void	arb_shutdown	(int, struct peer *);
static	void	arb_receive	(struct recvbuf *);
static	void	arb_poll	(int, struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_arbiter = {
	arb_start,		/* start up driver */
	arb_shutdown,		/* shut down driver */
	arb_poll,		/* transmit poll message */
	noentry,		/* not used (old arb_control) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old arb_buginfo) */
	NOFLAGS			/* not used */
};


/*
 * arb_start - open the devices and initialize data for processing
 */
static int
arb_start(
	int unit,
	struct peer *peer
	)
{
	register struct arbunit *up;
	struct refclockproc *pp;
	int fd;
	char device[20];

	/*
	 * Open serial port. Use CLK line discipline, if available.
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
	if (!(fd = refclock_open(device, SPEED232, LDISC_CLK)))
		return (0);

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp = peer->procptr;
	pp->io.clock_recv = arb_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		pp->io.fd = -1;
		free(up);
		return (0);
	}
	pp->unitptr = (caddr_t)up;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	if (peer->MODE > 1) {
		msyslog(LOG_NOTICE, "ARBITER: Invalid mode %d", peer->MODE);
		close(fd);
		pp->io.fd = -1;
		free(up);
		return (0);
	}
#ifdef DEBUG
	if(debug) { printf("arbiter: mode = %d.\n", peer->MODE); }
#endif
	write(pp->io.fd, COMMAND_HALT_BCAST, 2);
	return (1);
}


/*
 * arb_shutdown - shut down the clock
 */
static void
arb_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct arbunit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct arbunit *)pp->unitptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}


/*
 * arb_receive - receive data from the serial interface
 */
static void
arb_receive(
	struct recvbuf *rbufp
	)
{
	register struct arbunit *up;
	struct refclockproc *pp;
	struct peer *peer;
	l_fp trtmp;
	int temp;
	u_char	syncchar;		/* synch indicator */
	char	tbuf[BMAX];		/* temp buffer */

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct arbunit *)pp->unitptr;
	temp = refclock_gtlin(rbufp, tbuf, BMAX, &trtmp);

	/*
	 * Note we get a buffer and timestamp for both a  and ,
	 * but only the  timestamp is retained. The program first
	 * sends a TQ and expects the echo followed by the time quality
	 * character. It then sends a B5 starting the timecode broadcast
	 * and expects the echo followed some time later by the on-time
	 * character  and then the  beginning the timecode
	 * itself. Finally, at the  beginning the next timecode at
	 * the next second, the program sends a B0 shutting down the
	 * timecode broadcast.
	 *
	 * If flag4 is set, the program snatches the latitude, longitude
	 * and elevation and writes it to the clockstats file.
	 */
	if (temp == 0)
		return;

	pp->lastrec = up->laststamp;
	up->laststamp = trtmp;
	if (temp < 3)
		return;

	if (up->tcswitch == 0) {

		/*
		 * Collect statistics. If nothing is recogized, just
		 * ignore; sometimes the clock doesn't stop spewing
		 * timecodes for awhile after the B0 command.
		 *
		 * If flag4 is not set, send TQ, SR, B5. If flag4 is
		 * sset, send TQ, SR, LA, LO, LH, DB, B5. When the
		 * median filter is full, send B0.
		 */
		if (!strncmp(tbuf, "TQ", 2)) {
			up->qualchar = tbuf[2];
			write(pp->io.fd, "SR", 2);
			return;

		} else if (!strncmp(tbuf, "SR", 2)) {
			strcpy(up->status, tbuf + 2);
			if (pp->sloppyclockflag & CLK_FLAG4)
				write(pp->io.fd, "LA", 2);
			else
				write(pp->io.fd, COMMAND_START_BCAST, 2);
			return;

		} else if (!strncmp(tbuf, "LA", 2)) {
			strcpy(up->latlon, tbuf + 2);
			write(pp->io.fd, "LO", 2);
			return;

		} else if (!strncmp(tbuf, "LO", 2)) {
			strcat(up->latlon, " ");
			strcat(up->latlon, tbuf + 2);
			write(pp->io.fd, "LH", 2);
			return;

		} else if (!strncmp(tbuf, "LH", 2)) {
			strcat(up->latlon, " ");
			strcat(up->latlon, tbuf + 2);
			write(pp->io.fd, "DB", 2);
			return;

		} else if (!strncmp(tbuf, "DB", 2)) {
			strcat(up->latlon, " ");
			strcat(up->latlon, tbuf + 2);
			record_clock_stats(&peer->srcadr, up->latlon);
#ifdef DEBUG
			if (debug)
				printf("arbiter: %s\n", up->latlon);
#endif
			write(pp->io.fd, COMMAND_START_BCAST, 2);
		}
	}

	/*
	 * We get down to business, check the timecode format and decode
	 * its contents. If the timecode has valid length, but not in
	 * proper format, we declare bad format and exit. If the
	 * timecode has invalid length, which sometimes occurs when the
	 * B0 amputates the broadcast, we just quietly steal away. Note
	 * that the time quality character and receiver status string is
	 * tacked on the end for clockstats display. 
	 */
	up->tcswitch++;
	if (up->tcswitch <= 1 || temp < LENARB)
		return;

	/*
	 * Timecode format B5: "i yy ddd hh:mm:ss.000   "
	 */
	strncpy(pp->a_lastcode, tbuf, BMAX);
	pp->a_lastcode[LENARB - 2] = up->qualchar;
	strcat(pp->a_lastcode, up->status);
	pp->lencode = strlen(pp->a_lastcode);
	syncchar = ' ';
	if (sscanf(pp->a_lastcode, "%c%2d %3d %2d:%2d:%2d",
	    &syncchar, &pp->year, &pp->day, &pp->hour,
	    &pp->minute, &pp->second) != 6) {
		refclock_report(peer, CEVNT_BADREPLY);
		write(pp->io.fd, COMMAND_HALT_BCAST, 2);
		return;
	}

	/*
	 * We decode the clock dispersion from the time quality
	 * character.
	 */
	switch (up->qualchar) {

	    case '0':		/* locked, max accuracy */
		pp->disp = 1e-7;
		pp->lastref = pp->lastrec;
		break;

	    case '4':		/* unlock accuracy < 1 us */
		pp->disp = 1e-6;
		break;

	    case '5':		/* unlock accuracy < 10 us */
		pp->disp = 1e-5;
		break;

	    case '6':		/* unlock accuracy < 100 us */
		pp->disp = 1e-4;
		break;

	    case '7':		/* unlock accuracy < 1 ms */
		pp->disp = .001;
		break;

	    case '8':		/* unlock accuracy < 10 ms */
		pp->disp = .01;
		break;

	    case '9':		/* unlock accuracy < 100 ms */
		pp->disp = .1;
		break;

	    case 'A':		/* unlock accuracy < 1 s */
		pp->disp = 1;
		break;

	    case 'B':		/* unlock accuracy < 10 s */
		pp->disp = 10;
		break;

	    case 'F':		/* clock failure */
		pp->disp = MAXDISPERSE;
		refclock_report(peer, CEVNT_FAULT);
		write(pp->io.fd, COMMAND_HALT_BCAST, 2);
		return;

	    default:
		pp->disp = MAXDISPERSE;
		refclock_report(peer, CEVNT_BADREPLY);
		write(pp->io.fd, COMMAND_HALT_BCAST, 2);
		return;
	}
	if (syncchar != ' ')
		pp->leap = LEAP_NOTINSYNC;
	else
		pp->leap = LEAP_NOWARNING;

	/*
	 * Process the new sample in the median filter and determine the
	 * timecode timestamp.
	 */
	if (!refclock_process(pp))
		refclock_report(peer, CEVNT_BADTIME);
	else if (peer->disp > MAXDISTANCE)
		refclock_receive(peer);

	/* if (up->tcswitch >= MAXSTAGE) { */
	write(pp->io.fd, COMMAND_HALT_BCAST, 2);
	/* } */
}


/*
 * arb_poll - called by the transmit procedure
 */
static void
arb_poll(
	int unit,
	struct peer *peer
	)
{
	register struct arbunit *up;
	struct refclockproc *pp;

	/*
	 * Time to poll the clock. The Arbiter clock responds to a "B5"
	 * by returning a timecode in the format specified above.
	 * Transmission occurs once per second, unless turned off by a
	 * "B0". Note there is no checking on state, since this may not
	 * be the only customer reading the clock. Only one customer
	 * need poll the clock; all others just listen in.
	 */
	pp = peer->procptr;
	up = (struct arbunit *)pp->unitptr;
	pp->polls++;
	up->tcswitch = 0;
	if (write(pp->io.fd, "TQ", 2) != 2)
		refclock_report(peer, CEVNT_FAULT);

	/*
	 * Process median filter samples. If none received, declare a
	 * timeout and keep going.
	 */
	if (pp->coderecv == pp->codeproc) {
		refclock_report(peer, CEVNT_TIMEOUT);
		return;
	}
	refclock_receive(peer);
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
#ifdef DEBUG
	if (debug)
		printf("arbiter: timecode %d %s\n",
		   pp->lencode, pp->a_lastcode);
#endif
}

#else
int refclock_arbiter_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_jupiter.c0000644000175000017500000007231611332473274016273 0ustar  peterpeter/*
 * Copyright (c) 1997, 1998, 2003
 *	The Regents of the University of California.  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.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Lawrence Berkeley Laboratory.
 * 4. The name of the University may not be used to endorse or promote
 *    products derived from this software without specific prior
 *    written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_JUPITER) && defined(HAVE_PPSAPI)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"

#include 
#include 

#include "jupiter.h"

#ifdef HAVE_PPSAPI
# include "ppsapi_timepps.h"
#endif

#ifdef XNTP_BIG_ENDIAN
#define getshort(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff))
#define putshort(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff))
#else
#define getshort(s) (s)
#define putshort(s) (s)
#endif

/* XXX */
#ifdef sun
char *strerror(int);
#endif

/*
 * This driver supports the Rockwell Jupiter GPS Receiver board
 * adapted to precision timing applications.  It requires the
 * ppsclock line discipline or streams module described in the
 * Line Disciplines and Streams Drivers page. It also requires a
 * gadget box and 1-PPS level converter, such as described in the
 * Pulse-per-second (PPS) Signal Interfacing page.
 *
 * It may work (with minor modifications) with other Rockwell GPS
 * receivers such as the CityTracker.
 */

/*
 * GPS Definitions
 */
#define	DEVICE		"/dev/gps%d"	/* device name and unit */
#define	SPEED232	B9600		/* baud */

/*
 * Radio interface parameters
 */
#define	PRECISION	(-18)	/* precision assumed (about 4 us) */
#define	REFID	"GPS\0"		/* reference id */
#define	DESCRIPTION	"Rockwell Jupiter GPS Receiver" /* who we are */
#define	DEFFUDGETIME	0	/* default fudge time (ms) */

/* Unix timestamp for the GPS epoch: January 6, 1980 */
#define GPS_EPOCH 315964800

/* Double short to unsigned int */
#define DS2UI(p) ((getshort((p)[1]) << 16) | getshort((p)[0]))

/* Double short to signed int */
#define DS2I(p) ((getshort((p)[1]) << 16) | getshort((p)[0]))

/* One week's worth of seconds */
#define WEEKSECS (7 * 24 * 60 * 60)

/*
 * Jupiter unit control structure.
 */
struct instance {
	struct peer *peer;		/* peer */
	u_int  pollcnt;			/* poll message counter */
	u_int  polled;			/* Hand in a time sample? */
#ifdef HAVE_PPSAPI
	pps_params_t pps_params;	/* pps parameters */
	pps_info_t pps_info;		/* last pps data */
	pps_handle_t pps_handle;	/* pps handle */
	u_int assert;			/* pps edge to use */
	u_int hardpps;			/* enable kernel mode */
	struct timespec ts;		/* last timestamp */
#endif
	l_fp limit;
	u_int gpos_gweek;		/* Current GPOS GPS week number */
	u_int gpos_sweek;		/* Current GPOS GPS seconds into week */
	u_int gweek;			/* current GPS week number */
	u_int32 lastsweek;		/* last seconds into GPS week */
	time_t timecode;		/* current ntp timecode */
	u_int32 stime;			/* used to detect firmware bug */
	int wantid;			/* don't reconfig on channel id msg */
	u_int  moving;			/* mobile platform? */
	u_char sloppyclockflag;		/* fudge flags */
	u_short sbuf[512];		/* local input buffer */
	int ssize;			/* space used in sbuf */
};

/*
 * Function prototypes
 */
static	void	jupiter_canmsg	(struct instance *, u_int);
static	u_short	jupiter_cksum	(u_short *, u_int);
static	int	jupiter_config	(struct instance *);
static	void	jupiter_debug	(struct peer *, char *, char *, ...)
    __attribute__ ((format (printf, 3, 4)));
static	char *	jupiter_parse_t	(struct instance *, u_short *);
static	char *	jupiter_parse_gpos	(struct instance *, u_short *);
static	void	jupiter_platform	(struct instance *, u_int);
static	void	jupiter_poll	(int, struct peer *);
static	void	jupiter_control	(int, struct refclockstat *, struct
				    refclockstat *, struct peer *);
#ifdef HAVE_PPSAPI
static	int	jupiter_ppsapi	(struct instance *);
static	int	jupiter_pps	(struct instance *);
#endif /* HAVE_PPSAPI */
static	int	jupiter_recv	(struct instance *);
static	void	jupiter_receive (struct recvbuf *rbufp);
static	void	jupiter_reqmsg	(struct instance *, u_int, u_int);
static	void	jupiter_reqonemsg	(struct instance *, u_int);
static	char *	jupiter_send	(struct instance *, struct jheader *);
static	void	jupiter_shutdown	(int, struct peer *);
static	int	jupiter_start	(int, struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_jupiter = {
	jupiter_start,		/* start up driver */
	jupiter_shutdown,	/* shut down driver */
	jupiter_poll,		/* transmit poll message */
	jupiter_control,	/* (clock control) */
	noentry,		/* (clock init) */
	noentry,		/* (clock buginfo) */
	NOFLAGS			/* not used */
};

/*
 * jupiter_start - open the devices and initialize data for processing
 */
static int
jupiter_start(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	struct instance *instance;
	int fd = -1;
	char gpsdev[20];

	/*
	 * Open serial port
	 */
	snprintf(gpsdev, sizeof(gpsdev), DEVICE, unit);
	fd = refclock_open(gpsdev, SPEED232, LDISC_RAW);
	if (fd == 0) {
		jupiter_debug(peer, "jupiter_start", "open %s: %s",
		    gpsdev, strerror(errno));
		return (0);
	}

	/* Allocate unit structure */
	instance = emalloc(sizeof(*instance));
	memset(instance, 0, sizeof(*instance));
	instance->peer = peer;
	pp = peer->procptr;
	pp->io.clock_recv = jupiter_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		free(instance);
		return (0);
	}
	pp->unitptr = (caddr_t)instance;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);

#ifdef HAVE_PPSAPI
	instance->assert = 1;
	instance->hardpps = 0;
	/*
	 * Start the PPSAPI interface if it is there. Default to use
	 * the assert edge and do not enable the kernel hardpps.
	 */
	if (time_pps_create(fd, &instance->pps_handle) < 0) {
		instance->pps_handle = 0;
		msyslog(LOG_ERR,
			"refclock_jupiter: time_pps_create failed: %m");
	}
	else if (!jupiter_ppsapi(instance))
		goto clean_up;
#endif /* HAVE_PPSAPI */

	/* Ensure the receiver is properly configured */
	if (!jupiter_config(instance))
		goto clean_up;

	return (1);

clean_up:
	jupiter_shutdown(unit, peer);
	pp->unitptr = 0;
	return (0);
}

/*
 * jupiter_shutdown - shut down the clock
 */
static void
jupiter_shutdown(int unit, struct peer *peer)
{
	struct instance *instance;
	struct refclockproc *pp;

	pp = peer->procptr;
	instance = (struct instance *)pp->unitptr;
	if (!instance)
		return;

#ifdef HAVE_PPSAPI
	if (instance->pps_handle) {
		time_pps_destroy(instance->pps_handle);
		instance->pps_handle = 0;
	}
#endif /* HAVE_PPSAPI */

	io_closeclock(&pp->io);
	free(instance);
}

/*
 * jupiter_config - Configure the receiver
 */
static int
jupiter_config(struct instance *instance)
{
	jupiter_debug(instance->peer, "jupiter_config", "init receiver");

	/*
	 * Initialize the unit variables
	 */
	instance->sloppyclockflag = instance->peer->procptr->sloppyclockflag;
	instance->moving = !!(instance->sloppyclockflag & CLK_FLAG2);
	if (instance->moving)
		jupiter_debug(instance->peer, "jupiter_config",
			"mobile platform");

	instance->pollcnt     = 2;
	instance->polled      = 0;
	instance->gpos_gweek = 0;
	instance->gpos_sweek = 0;
	instance->gweek = 0;
	instance->lastsweek = 2 * WEEKSECS;
	instance->timecode = 0;
	instance->stime = 0;
	instance->ssize = 0;

	/* Stop outputting all messages */
	jupiter_canmsg(instance, JUPITER_ALL);

	/* Request the receiver id so we can syslog the firmware version */
	jupiter_reqonemsg(instance, JUPITER_O_ID);

	/* Flag that this the id was requested (so we don't get called again) */
	instance->wantid = 1;

	/* Request perodic time mark pulse messages */
	jupiter_reqmsg(instance, JUPITER_O_PULSE, 1);

	/* Request perodic geodetic position status */
	jupiter_reqmsg(instance, JUPITER_O_GPOS, 1);

	/* Set application platform type */
	if (instance->moving)
		jupiter_platform(instance, JUPITER_I_PLAT_MED);
	else
		jupiter_platform(instance, JUPITER_I_PLAT_LOW);

	return (1);
}

#ifdef HAVE_PPSAPI
/*
 * Initialize PPSAPI
 */
int
jupiter_ppsapi(
	struct instance *instance	/* unit structure pointer */
	)
{
	int capability;

	if (time_pps_getcap(instance->pps_handle, &capability) < 0) {
		msyslog(LOG_ERR,
		    "refclock_jupiter: time_pps_getcap failed: %m");
		return (0);
	}
	memset(&instance->pps_params, 0, sizeof(pps_params_t));
	if (!instance->assert)
		instance->pps_params.mode = capability & PPS_CAPTURECLEAR;
	else
		instance->pps_params.mode = capability & PPS_CAPTUREASSERT;
	if (!(instance->pps_params.mode & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR))) {
		msyslog(LOG_ERR,
		    "refclock_jupiter: invalid capture edge %d",
		    instance->assert);
		return (0);
	}
	instance->pps_params.mode |= PPS_TSFMT_TSPEC;
	if (time_pps_setparams(instance->pps_handle, &instance->pps_params) < 0) {
		msyslog(LOG_ERR,
		    "refclock_jupiter: time_pps_setparams failed: %m");
		return (0);
	}
	if (instance->hardpps) {
		if (time_pps_kcbind(instance->pps_handle, PPS_KC_HARDPPS,
				    instance->pps_params.mode & ~PPS_TSFMT_TSPEC,
				    PPS_TSFMT_TSPEC) < 0) {
			msyslog(LOG_ERR,
			    "refclock_jupiter: time_pps_kcbind failed: %m");
			return (0);
		}
		pps_enable = 1;
	}
/*	instance->peer->precision = PPS_PRECISION; */

#if DEBUG
	if (debug) {
		time_pps_getparams(instance->pps_handle, &instance->pps_params);
		jupiter_debug(instance->peer, "refclock_jupiter",
			"pps capability 0x%x version %d mode 0x%x kern %d",
			capability, instance->pps_params.api_version,
			instance->pps_params.mode, instance->hardpps);
	}
#endif

	return (1);
}

/*
 * Get PPSAPI timestamps.
 *
 * Return 0 on failure and 1 on success.
 */
static int
jupiter_pps(struct instance *instance)
{
	pps_info_t pps_info;
	struct timespec timeout, ts;
	double dtemp;
	l_fp tstmp;

	/*
	 * Convert the timespec nanoseconds field to ntp l_fp units.
	 */ 
	if (instance->pps_handle == 0)
		return 1;
	timeout.tv_sec = 0;
	timeout.tv_nsec = 0;
	memcpy(&pps_info, &instance->pps_info, sizeof(pps_info_t));
	if (time_pps_fetch(instance->pps_handle, PPS_TSFMT_TSPEC, &instance->pps_info,
	    &timeout) < 0)
		return 1;
	if (instance->pps_params.mode & PPS_CAPTUREASSERT) {
		if (pps_info.assert_sequence ==
		    instance->pps_info.assert_sequence)
			return 1;
		ts = instance->pps_info.assert_timestamp;
	} else if (instance->pps_params.mode & PPS_CAPTURECLEAR) {
		if (pps_info.clear_sequence ==
		    instance->pps_info.clear_sequence)
			return 1;
		ts = instance->pps_info.clear_timestamp;
	} else {
		return 1;
	}
	if ((instance->ts.tv_sec == ts.tv_sec) && (instance->ts.tv_nsec == ts.tv_nsec))
		return 1;
	instance->ts = ts;

	tstmp.l_ui = ts.tv_sec + JAN_1970;
	dtemp = ts.tv_nsec * FRAC / 1e9;
	tstmp.l_uf = (u_int32)dtemp;
	instance->peer->procptr->lastrec = tstmp;
	return 0;
}
#endif /* HAVE_PPSAPI */

/*
 * jupiter_poll - jupiter watchdog routine
 */
static void
jupiter_poll(int unit, struct peer *peer)
{
	struct instance *instance;
	struct refclockproc *pp;

	pp = peer->procptr;
	instance = (struct instance *)pp->unitptr;

	/*
	 * You don't need to poll this clock.  It puts out timecodes
	 * once per second.  If asked for a timestamp, take note.
	 * The next time a timecode comes in, it will be fed back.
	 */

	/*
	 * If we haven't had a response in a while, reset the receiver.
	 */
	if (instance->pollcnt > 0) {
		instance->pollcnt--;
	} else {
		refclock_report(peer, CEVNT_TIMEOUT);

		/* Request the receiver id to trigger a reconfig */
		jupiter_reqonemsg(instance, JUPITER_O_ID);
		instance->wantid = 0;
	}

	/*
	 * polled every 64 seconds. Ask jupiter_receive to hand in
	 * a timestamp.
	 */
	instance->polled = 1;
	pp->polls++;
}

/*
 * jupiter_control - fudge control
 */
static void
jupiter_control(
	int unit,		/* unit (not used) */
	struct refclockstat *in, /* input parameters (not used) */
	struct refclockstat *out, /* output parameters (not used) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct instance *instance;
	u_char sloppyclockflag;

	pp = peer->procptr;
	instance = (struct instance *)pp->unitptr;

	DTOLFP(pp->fudgetime2, &instance->limit);
	/* Force positive value. */
	if (L_ISNEG(&instance->limit))
		L_NEG(&instance->limit);

#ifdef HAVE_PPSAPI
	instance->assert = !(pp->sloppyclockflag & CLK_FLAG3);
	jupiter_ppsapi(instance);
#endif /* HAVE_PPSAPI */

	sloppyclockflag = instance->sloppyclockflag;
	instance->sloppyclockflag = pp->sloppyclockflag;
	if ((instance->sloppyclockflag & CLK_FLAG2) !=
	    (sloppyclockflag & CLK_FLAG2)) {
		jupiter_debug(peer,
		    "jupiter_control",
		    "mode switch: reset receiver");
		jupiter_config(instance);
		return;
	}
}

/*
 * jupiter_receive - receive gps data
 * Gag me!
 */
static void
jupiter_receive(struct recvbuf *rbufp)
{
	int bpcnt, cc, size, ppsret;
	time_t last_timecode;
	u_int32 laststime;
	char *cp;
	u_char *bp;
	u_short *sp;
	struct jid *ip;
	struct jheader *hp;
	struct peer *peer;
	struct refclockproc *pp;
	struct instance *instance;
	l_fp tstamp;

	/* Initialize pointers and read the timecode and timestamp */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	instance = (struct instance *)pp->unitptr;

	bp = (u_char *)rbufp->recv_buffer;
	bpcnt = rbufp->recv_length;

	/* This shouldn't happen */
	if (bpcnt > sizeof(instance->sbuf) - instance->ssize)
		bpcnt = sizeof(instance->sbuf) - instance->ssize;

	/* Append to input buffer */
	memcpy((u_char *)instance->sbuf + instance->ssize, bp, bpcnt);
	instance->ssize += bpcnt;

	/* While there's at least a header and we parse an intact message */
	while (instance->ssize > sizeof(*hp) && (cc = jupiter_recv(instance)) > 0) {
		instance->pollcnt = 2;

		tstamp = rbufp->recv_time;
		hp = (struct jheader *)instance->sbuf;
		sp = (u_short *)(hp + 1);
		size = cc - sizeof(*hp);
		switch (getshort(hp->id)) {

		case JUPITER_O_PULSE:
			if (size != sizeof(struct jpulse)) {
				jupiter_debug(peer,
				    "jupiter_receive", "pulse: len %d != %u",
				    size, (int)sizeof(struct jpulse));
				refclock_report(peer, CEVNT_BADREPLY);
				break;
			}

			/*
			 * There appears to be a firmware bug related
			 * to the pulse message; in addition to the one
			 * per second messages, we get an extra pulse
			 * message once an hour (on the anniversary of
			 * the cold start). It seems to come 200 ms
			 * after the one requested. So if we've seen a
			 * pulse message in the last 210 ms, we skip
			 * this one.
			 */
			laststime = instance->stime;
			instance->stime = DS2UI(((struct jpulse *)sp)->stime);
			if (laststime != 0 && instance->stime - laststime <= 21) {
				jupiter_debug(peer, "jupiter_receive", 
				"avoided firmware bug (stime %.2f, laststime %.2f)",
				(double)instance->stime * 0.01, (double)laststime * 0.01);
				break;
			}

			/* Retrieve pps timestamp */
			ppsret = jupiter_pps(instance);

			/*
			 * Add one second if msg received early
			 * (i.e. before limit, a.k.a. fudgetime2) in
			 * the second.
			 */
			L_SUB(&tstamp, &pp->lastrec);
			if (!L_ISGEQ(&tstamp, &instance->limit))
				++pp->lastrec.l_ui;

			/* Parse timecode (even when there's no pps) */
			last_timecode = instance->timecode;
			if ((cp = jupiter_parse_t(instance, sp)) != NULL) {
				jupiter_debug(peer,
				    "jupiter_receive", "pulse: %s", cp);
				break;
			}

			/* Bail if we didn't get a pps timestamp */
			if (ppsret)
				break;

			/* Bail if we don't have the last timecode yet */
			if (last_timecode == 0)
				break;

			/* Add the new sample to a median filter */
			tstamp.l_ui = JAN_1970 + last_timecode;
			tstamp.l_uf = 0;

			refclock_process_offset(pp, tstamp, pp->lastrec, pp->fudgetime1);

			/*
			 * The clock will blurt a timecode every second
			 * but we only want one when polled.  If we
			 * havn't been polled, bail out.
			 */
			if (!instance->polled)
				break;
			instance->polled = 0;

			/*
			 * It's a live one!  Remember this time.
			 */

			pp->lastref = pp->lastrec;
			refclock_receive(peer);

			/*
			 * If we get here - what we got from the clock is
			 * OK, so say so
			 */
			refclock_report(peer, CEVNT_NOMINAL);

			/*
			 * We have succeeded in answering the poll.
			 * Turn off the flag and return
			 */
			instance->polled = 0;
			break;

		case JUPITER_O_GPOS:
			if (size != sizeof(struct jgpos)) {
				jupiter_debug(peer,
				    "jupiter_receive", "gpos: len %d != %u",
				    size, (int)sizeof(struct jgpos));
				refclock_report(peer, CEVNT_BADREPLY);
				break;
			}

			if ((cp = jupiter_parse_gpos(instance, sp)) != NULL) {
				jupiter_debug(peer,
				    "jupiter_receive", "gpos: %s", cp);
				break;
			}
			break;

		case JUPITER_O_ID:
			if (size != sizeof(struct jid)) {
				jupiter_debug(peer,
				    "jupiter_receive", "id: len %d != %u",
				    size, (int)sizeof(struct jid));
				refclock_report(peer, CEVNT_BADREPLY);
				break;
			}
			/*
			 * If we got this message because the Jupiter
			 * just powered instance, it needs to be reconfigured.
			 */
			ip = (struct jid *)sp;
			jupiter_debug(peer,
			    "jupiter_receive", "%s chan ver %s, %s (%s)",
			    ip->chans, ip->vers, ip->date, ip->opts);
			msyslog(LOG_DEBUG,
			    "jupiter_receive: %s chan ver %s, %s (%s)",
			    ip->chans, ip->vers, ip->date, ip->opts);
			if (instance->wantid)
				instance->wantid = 0;
			else {
				jupiter_debug(peer,
				    "jupiter_receive", "reset receiver");
				jupiter_config(instance);
				/*
				 * Restore since jupiter_config() just
				 * zeroed it
				 */
				instance->ssize = cc;
			}
			break;

		default:
			jupiter_debug(peer,
			    "jupiter_receive", "unknown message id %d",
			    getshort(hp->id));
			break;
		}
		instance->ssize -= cc;
		if (instance->ssize < 0) {
			fprintf(stderr, "jupiter_recv: negative ssize!\n");
			abort();
		} else if (instance->ssize > 0)
			memcpy(instance->sbuf, (u_char *)instance->sbuf + cc, instance->ssize);
	}
}

static char *
jupiter_parse_t(struct instance *instance, u_short *sp)
{
	struct tm *tm;
	char *cp;
	struct jpulse *jp;
	u_int32 sweek;
	time_t last_timecode;
	u_short flags;

	jp = (struct jpulse *)sp;

	/* The timecode is presented as seconds into the current GPS week */
	sweek = DS2UI(jp->sweek) % WEEKSECS;

	/*
	 * If we don't know the current GPS week, calculate it from the
	 * current time. (It's too bad they didn't include this
	 * important value in the pulse message). We'd like to pick it
	 * up from one of the other messages like gpos or chan but they
	 * don't appear to be synchronous with time keeping and changes
	 * too soon (something like 10 seconds before the new GPS
	 * week).
	 *
	 * If we already know the current GPS week, increment it when
	 * we wrap into a new week.
	 */
	if (instance->gweek == 0) {
		if (!instance->gpos_gweek) {
			return ("jupiter_parse_t: Unknown gweek");
		}

		instance->gweek = instance->gpos_gweek;

		/*
		 * Fix warps. GPOS has GPS time and PULSE has UTC.
		 * Plus, GPOS need not be completely in synch with
		 * the PPS signal.
		 */
		if (instance->gpos_sweek >= sweek) {
			if ((instance->gpos_sweek - sweek) > WEEKSECS / 2)
				++instance->gweek;
		}
		else {
			if ((sweek - instance->gpos_sweek) > WEEKSECS / 2)
				--instance->gweek;
		}
	}
	else if (sweek == 0 && instance->lastsweek == WEEKSECS - 1) {
		++instance->gweek;
		jupiter_debug(instance->peer,
		    "jupiter_parse_t", "NEW gps week %u", instance->gweek);
	}

	/*
	 * See if the sweek stayed the same (this happens when there is
	 * no pps pulse).
	 *
	 * Otherwise, look for time warps:
	 *
	 *   - we have stored at least one lastsweek and
	 *   - the sweek didn't increase by one and
	 *   - we didn't wrap to a new GPS week
	 *
	 * Then we warped.
	 */
	if (instance->lastsweek == sweek)
		jupiter_debug(instance->peer,
		    "jupiter_parse_t", "gps sweek not incrementing (%d)",
		    sweek);
	else if (instance->lastsweek != 2 * WEEKSECS &&
	    instance->lastsweek + 1 != sweek &&
	    !(sweek == 0 && instance->lastsweek == WEEKSECS - 1))
		jupiter_debug(instance->peer,
		    "jupiter_parse_t", "gps sweek jumped (was %d, now %d)",
		    instance->lastsweek, sweek);
	instance->lastsweek = sweek;

	/* This timecode describes next pulse */
	last_timecode = instance->timecode;
	instance->timecode =
	    GPS_EPOCH + (instance->gweek * WEEKSECS) + sweek;

	if (last_timecode == 0)
		/* XXX debugging */
		jupiter_debug(instance->peer,
		    "jupiter_parse_t", "UTC  (gweek/sweek %u/%u)",
		    instance->gweek, sweek);
	else {
		/* XXX debugging */
		tm = gmtime(&last_timecode);
		cp = asctime(tm);

		jupiter_debug(instance->peer,
		    "jupiter_parse_t", "UTC %.24s (gweek/sweek %u/%u)",
		    cp, instance->gweek, sweek);

		/* Billboard last_timecode (which is now the current time) */
		instance->peer->procptr->year   = tm->tm_year + 1900;
		instance->peer->procptr->day    = tm->tm_yday + 1;
		instance->peer->procptr->hour   = tm->tm_hour;
		instance->peer->procptr->minute = tm->tm_min;
		instance->peer->procptr->second = tm->tm_sec;
	}

	flags = getshort(jp->flags);

	/* Toss if not designated "valid" by the gps */
	if ((flags & JUPITER_O_PULSE_VALID) == 0) {
		refclock_report(instance->peer, CEVNT_BADTIME);
		return ("time mark not valid");
	}

	/* We better be sync'ed to UTC... */
	if ((flags & JUPITER_O_PULSE_UTC) == 0) {
		refclock_report(instance->peer, CEVNT_BADTIME);
		return ("time mark not sync'ed to UTC");
	}

	return (NULL);
}

static char *
jupiter_parse_gpos(struct instance *instance, u_short *sp)
{
	struct jgpos *jg;
	time_t t;
	struct tm *tm;
	char *cp;

	jg = (struct jgpos *)sp;

	if (jg->navval != 0) {
		/*
		 * Solution not valid. Use caution and refuse
		 * to determine GPS week from this message.
		 */
		instance->gpos_gweek = 0;
		instance->gpos_sweek = 0;
		return ("Navigation solution not valid");
	}

	instance->gpos_gweek = jg->gweek;
	instance->gpos_sweek = DS2UI(jg->sweek);
	while(instance->gpos_sweek >= WEEKSECS) {
		instance->gpos_sweek -= WEEKSECS;
		++instance->gpos_gweek;
	}
	instance->gweek = 0;

	t = GPS_EPOCH + (instance->gpos_gweek * WEEKSECS) + instance->gpos_sweek;
	tm = gmtime(&t);
	cp = asctime(tm);

	jupiter_debug(instance->peer,
		"jupiter_parse_g", "GPS %.24s (gweek/sweek %u/%u)",
		cp, instance->gpos_gweek, instance->gpos_sweek);
	return (NULL);
}

/*
 * jupiter_debug - print debug messages
 */
#if defined(__STDC__) || defined(SYS_WINNT)
static void
jupiter_debug(struct peer *peer, char *function, char *fmt, ...)
#else
static void
jupiter_debug(peer, function, fmt, va_alist)
	struct peer *peer;
	char *function;
	char *fmt;
#endif /* __STDC__ */
{
	char buffer[200];
	va_list ap;

#if defined(__STDC__) || defined(SYS_WINNT)
	va_start(ap, fmt);
#else
	va_start(ap);
#endif /* __STDC__ */
	/*
	 * Print debug message to stdout
	 * In the future, we may want to get get more creative...
	 */
	vsnprintf(buffer, sizeof(buffer), fmt, ap);
	record_clock_stats(&(peer->srcadr), buffer);
#ifdef DEBUG
	if (debug) {
		fprintf(stdout, "%s: ", function);
		fprintf(stdout, buffer);
		fprintf(stdout, "\n");
		fflush(stdout);
	}
#endif

	va_end(ap);
}

/* Checksum and transmit a message to the Jupiter */
static char *
jupiter_send(struct instance *instance, struct jheader *hp)
{
	u_int len, size;
	int cc;
	u_short *sp;
	static char errstr[132];

	size = sizeof(*hp);
	hp->hsum = putshort(jupiter_cksum((u_short *)hp,
	    (size / sizeof(u_short)) - 1));
	len = getshort(hp->len);
	if (len > 0) {
		sp = (u_short *)(hp + 1);
		sp[len] = putshort(jupiter_cksum(sp, len));
		size += (len + 1) * sizeof(u_short);
	}

	if ((cc = write(instance->peer->procptr->io.fd, (char *)hp, size)) < 0) {
		snprintf(errstr, sizeof(errstr), "write: %s", strerror(errno));
		return (errstr);
	} else if (cc != size) {
		snprintf(errstr, sizeof(errstr), "short write (%d != %d)", cc, size);
		return (errstr);
	}
	return (NULL);
}

/* Request periodic message output */
static struct {
	struct jheader jheader;
	struct jrequest jrequest;
} reqmsg = {
	{ putshort(JUPITER_SYNC), 0,
	    putshort((sizeof(struct jrequest) / sizeof(u_short)) - 1),
	    0, JUPITER_FLAG_REQUEST | JUPITER_FLAG_NAK |
	    JUPITER_FLAG_CONN | JUPITER_FLAG_LOG, 0 },
	{ 0, 0, 0, 0 }
};

/* An interval of zero means to output on trigger */
static void
jupiter_reqmsg(struct instance *instance, u_int id,
    u_int interval)
{
	struct jheader *hp;
	struct jrequest *rp;
	char *cp;

	hp = &reqmsg.jheader;
	hp->id = putshort(id);
	rp = &reqmsg.jrequest;
	rp->trigger = putshort(interval == 0);
	rp->interval = putshort(interval);
	if ((cp = jupiter_send(instance, hp)) != NULL)
		jupiter_debug(instance->peer, "jupiter_reqmsg", "%u: %s", id, cp);
}

/* Cancel periodic message output */
static struct jheader canmsg = {
	putshort(JUPITER_SYNC), 0, 0, 0,
	JUPITER_FLAG_REQUEST | JUPITER_FLAG_NAK | JUPITER_FLAG_DISC,
	0
};

static void
jupiter_canmsg(struct instance *instance, u_int id)
{
	struct jheader *hp;
	char *cp;

	hp = &canmsg;
	hp->id = putshort(id);
	if ((cp = jupiter_send(instance, hp)) != NULL)
		jupiter_debug(instance->peer, "jupiter_canmsg", "%u: %s", id, cp);
}

/* Request a single message output */
static struct jheader reqonemsg = {
	putshort(JUPITER_SYNC), 0, 0, 0,
	JUPITER_FLAG_REQUEST | JUPITER_FLAG_NAK | JUPITER_FLAG_QUERY,
	0
};

static void
jupiter_reqonemsg(struct instance *instance, u_int id)
{
	struct jheader *hp;
	char *cp;

	hp = &reqonemsg;
	hp->id = putshort(id);
	if ((cp = jupiter_send(instance, hp)) != NULL)
		jupiter_debug(instance->peer, "jupiter_reqonemsg", "%u: %s", id, cp);
}

/* Set the platform dynamics */
static struct {
	struct jheader jheader;
	struct jplat jplat;
} platmsg = {
	{ putshort(JUPITER_SYNC), putshort(JUPITER_I_PLAT),
	    putshort((sizeof(struct jplat) / sizeof(u_short)) - 1), 0,
	    JUPITER_FLAG_REQUEST | JUPITER_FLAG_NAK, 0 },
	{ 0, 0, 0 }
};

static void
jupiter_platform(struct instance *instance, u_int platform)
{
	struct jheader *hp;
	struct jplat *pp;
	char *cp;

	hp = &platmsg.jheader;
	pp = &platmsg.jplat;
	pp->platform = putshort(platform);
	if ((cp = jupiter_send(instance, hp)) != NULL)
		jupiter_debug(instance->peer, "jupiter_platform", "%u: %s", platform, cp);
}

/* Checksum "len" shorts */
static u_short
jupiter_cksum(u_short *sp, u_int len)
{
	u_short sum, x;

	sum = 0;
	while (len-- > 0) {
		x = *sp++;
		sum += getshort(x);
	}
	return (~sum + 1);
}

/* Return the size of the next message (or zero if we don't have it all yet) */
static int
jupiter_recv(struct instance *instance)
{
	int n, len, size, cc;
	struct jheader *hp;
	u_char *bp;
	u_short *sp;

	/* Must have at least a header's worth */
	cc = sizeof(*hp);
	size = instance->ssize;
	if (size < cc)
		return (0);

	/* Search for the sync short if missing */
	sp = instance->sbuf;
	hp = (struct jheader *)sp;
	if (getshort(hp->sync) != JUPITER_SYNC) {
		/* Wasn't at the front, sync up */
		jupiter_debug(instance->peer, "jupiter_recv", "syncing");
		bp = (u_char *)sp;
		n = size;
		while (n >= 2) {
			if (bp[0] != (JUPITER_SYNC & 0xff)) {
				/*
				jupiter_debug(instance->peer, "{0x%x}", bp[0]);
				*/
				++bp;
				--n;
				continue;
			}
			if (bp[1] == ((JUPITER_SYNC >> 8) & 0xff))
				break;
			/*
			jupiter_debug(instance->peer, "{0x%x 0x%x}", bp[0], bp[1]);
			*/
			bp += 2;
			n -= 2;
		}
		/*
		jupiter_debug(instance->peer, "\n");
		*/
		/* Shuffle data to front of input buffer */
		if (n > 0)
			memcpy(sp, bp, n);
		size = n;
		instance->ssize = size;
		if (size < cc || hp->sync != JUPITER_SYNC)
			return (0);
	}

	if (jupiter_cksum(sp, (cc / sizeof(u_short) - 1)) !=
	    getshort(hp->hsum)) {
	    jupiter_debug(instance->peer, "jupiter_recv", "bad header checksum!");
		/* This is drastic but checksum errors should be rare */
		instance->ssize = 0;
		return (0);
	}

	/* Check for a payload */
	len = getshort(hp->len);
	if (len > 0) {
		n = (len + 1) * sizeof(u_short);
		/* Not enough data yet */
		if (size < cc + n)
			return (0);

		/* Check payload checksum */
		sp = (u_short *)(hp + 1);
		if (jupiter_cksum(sp, len) != getshort(sp[len])) {
			jupiter_debug(instance->peer,
			    "jupiter_recv", "bad payload checksum!");
			/* This is drastic but checksum errors should be rare */
			instance->ssize = 0;
			return (0);
		}
		cc += n;
	}
	return (cc);
}

#else /* not (REFCLOCK && CLOCK_JUPITER && HAVE_PPSAPI) */
int refclock_jupiter_bs;
#endif /* not (REFCLOCK && CLOCK_JUPITER && HAVE_PPSAPI) */
ntp-4.2.6p5/ntpd/ntp_loopfilter.c0000644000175000017500000007124611564122255015777 0ustar  peterpeter/*
 * ntp_loopfilter.c - implements the NTP loop filter algorithm
 *
 * ATTENTION: Get approval from Dave Mills on all changes to this file!
 *
 */
#ifdef HAVE_CONFIG_H
# include 
#endif

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"

#include 
#include 

#include 
#include 

#if defined(VMS) && defined(VMS_LOCALUNIT)	/*wjm*/
#include "ntp_refclock.h"
#endif /* VMS */

#ifdef KERNEL_PLL
#include "ntp_syscall.h"
#endif /* KERNEL_PLL */

/*
 * This is an implementation of the clock discipline algorithm described
 * in UDel TR 97-4-3, as amended. It operates as an adaptive parameter,
 * hybrid phase/frequency-lock loop. A number of sanity checks are
 * included to protect against timewarps, timespikes and general mayhem.
 * All units are in s and s/s, unless noted otherwise.
 */
#define CLOCK_MAX	.128	/* default step threshold (s) */
#define CLOCK_MINSTEP	900.	/* default stepout threshold (s) */
#define CLOCK_PANIC	1000.	/* default panic threshold (s) */
#define	CLOCK_PHI	15e-6	/* max frequency error (s/s) */
#define CLOCK_PLL	16.	/* PLL loop gain (log2) */
#define CLOCK_AVG	8.	/* parameter averaging constant */
#define CLOCK_FLL	.25	/* FLL loop gain */
#define	CLOCK_ALLAN	11	/* Allan intercept (log2 s) */
#define CLOCK_DAY	86400.	/* one day in seconds (s) */
#define CLOCK_JUNE	(CLOCK_DAY * 30) /* June in seconds (s) */
#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	DTOFREQ(x)	((int32)((x) * 65536e6)) /* double to NTP */

/*
 * Clock discipline state machine. This is used to control the
 * synchronization behavior during initialization and following a
 * timewarp.
 *
 *	State	< step		> step		Comments
 *	========================================================
 *	NSET	FREQ		step, FREQ	freq not set
 *
 *	FSET	SYNC		step, SYNC	freq set
 *
 *	FREQ	if (mu < 900)	if (mu < 900)	set freq direct
 *		    ignore	    ignore
 *		else		else
 *		    freq, SYNC	    freq, step, SYNC
 *
 *	SYNC	SYNC		SPIK, ignore	adjust phase/freq
 *
 *	SPIK	SYNC		if (mu < 900)	adjust phase/freq
 *				    ignore
 *				step, SYNC
 */
/*
 * Kernel PLL/PPS state machine. This is used with the kernel PLL
 * modifications described in the documentation.
 *
 * If kernel support for the ntp_adjtime() system call is available, the
 * ntp_control flag is set. The ntp_enable and kern_enable flags can be
 * set at configuration time or run time using ntpdc. If ntp_enable is
 * false, the discipline loop is unlocked and no corrections of any kind
 * are made. If both ntp_control and kern_enable are set, the kernel
 * support is used as described above; if false, the kernel is bypassed
 * entirely and the daemon discipline used instead.
 *
 * There have been three versions of the kernel discipline code. The
 * first (microkernel) now in Solaris discipilnes the microseconds. The
 * second and third (nanokernel) disciplines the clock in nanoseconds.
 * These versions are identifed if the symbol STA_PLL is present in the
 * header file /usr/include/sys/timex.h. The third and current version
 * includes TAI offset and is identified by the symbol NTP_API with
 * value 4.
 *
 * Each PPS time/frequency discipline can be enabled by the atom driver
 * or another driver. If enabled, the STA_PPSTIME and STA_FREQ bits are
 * set in the kernel status word; otherwise, these bits are cleared.
 * These bits are also cleard if the kernel reports an error.
 *
 * If an external clock is present, the clock driver sets STA_CLK in the
 * status word. When the local clock driver sees this bit, it updates
 * via this routine, which then calls ntp_adjtime() with the STA_PLL bit
 * set to zero, in which case the system clock is not adjusted. This is
 * also a signal for the external clock driver to discipline the system
 * clock. Unless specified otherwise, all times are in seconds.
 */
/*
 * Program variables that can be tinkered.
 */
double	clock_max = 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) */
u_char	allan_xpt = CLOCK_ALLAN; /* Allan intercept (log2 s) */

/*
 * Program variables
 */
static double clock_offset;	/* offset */
double	clock_jitter;		/* offset jitter */
double	drift_comp;		/* frequency (s/s) */
double	clock_stability;	/* frequency stability (wander) (s/s) */
double	clock_codec;		/* audio codec frequency (samples/s) */
static u_long clock_epoch;	/* last update */
u_int	sys_tai;		/* TAI offset from UTC */
static void rstclock (int, double); /* transition function */
static double direct_freq(double); /* direct set frequency */
static void set_freq(double);	/* set frequency */

#ifdef KERNEL_PLL
static struct timex ntv;	/* ntp_adjtime() parameters */
int	pll_status;		/* last kernel status bits */
#if defined(STA_NANO) && NTP_API == 4
static u_int loop_tai;		/* last TAI offset */
#endif /* STA_NANO */
#endif /* KERNEL_PLL */

/*
 * Clock state machine control flags
 */
int	ntp_enable = 1;		/* clock discipline enabled */
int	pll_control;		/* kernel support available */
int	kern_enable = 1;	/* kernel support enabled */
int	pps_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 */

/*
 * Clock state machine variables
 */
int	state;			/* clock discipline state */
u_char	sys_poll;		/* time constant/poll (log2 s) */
int	tc_counter;		/* jiggle counter */
double	last_offset;		/* last offset (s) */
static u_long last_step;	/* last clock step */

/*
 * Huff-n'-puff filter variables
 */
static double *sys_huffpuff;	/* huff-n'-puff filter */
static int sys_hufflen;		/* huff-n'-puff filter stages */
static int sys_huffptr;		/* huff-n'-puff filter pointer */
static double sys_mindly;	/* huff-n'-puff filter min delay */

#if defined(KERNEL_PLL)
/* Emacs cc-mode goes nuts if we split the next line... */
#define MOD_BITS (MOD_OFFSET | MOD_MAXERROR | MOD_ESTERROR | \
    MOD_STATUS | MOD_TIMECONST)
#ifdef SIGSYS
static void pll_trap (int);	/* configuration trap */
static struct sigaction sigsys;	/* current sigaction status */
static struct sigaction newsigsys; /* new sigaction status */
static sigjmp_buf env;		/* environment var. for pll_trap() */
#endif /* SIGSYS */
#endif /* KERNEL_PLL */

/*
 * init_loopfilter - initialize loop filter data
 */
void
init_loopfilter(void)
{
	/*
	 * Initialize state variables.
	 */
	sys_poll = ntp_minpoll;
	clock_jitter = LOGTOD(sys_precision);
}

/*
 * local_clock - the NTP logical clock loop filter.
 *
 * Return codes:
 * -1	update ignored: exceeds panic threshold
 * 0	update ignored: popcorn or exceeds step threshold
 * 1	clock was slewed
 * 2	clock was stepped
 *
 * LOCKCLOCK: The only thing this routine does is set the
 * sys_rootdisp variable equal to the peer dispersion.
 */
int
local_clock(
	struct	peer *peer,	/* synch source peer structure */
	double	fp_offset	/* clock offset (s) */
	)
{
	int	rval;		/* return code */
	int	osys_poll;	/* old system poll */
	double	mu;		/* interval since last update */
	double	clock_frequency; /* clock frequency */
	double	dtemp, etemp;	/* double temps */
	char	tbuf[80];	/* report buffer */

	/*
	 * If the loop is opened or the NIST LOCKCLOCK is in use,
	 * monitor and record the offsets anyway in order to determine
	 * the open-loop response and then go home.
	 */
#ifdef LOCKCLOCK
	return (0);

#else /* LOCKCLOCK */
	if (!ntp_enable) {
		record_loop_stats(fp_offset, drift_comp, clock_jitter,
		    clock_stability, sys_poll);
		return (0);
	}

	/*
	 * If the clock is way off, panic is declared. The clock_panic
	 * defaults to 1000 s; if set to zero, the panic will never
	 * occur. The allow_panic defaults to FALSE, so the first panic
	 * will exit. It can be set TRUE by a command line option, in
	 * which case the clock will be set anyway and time marches on.
	 * But, allow_panic will be set FALSE when the update is less
	 * than the step threshold; so, subsequent panics will exit.
	 */
	if (fabs(fp_offset) > clock_panic && clock_panic > 0 &&
	    !allow_panic) {
		snprintf(tbuf, sizeof(tbuf),
		    "%+.0f s; set clock manually within %.0f s.",
		    fp_offset, clock_panic);
		report_event(EVNT_SYSFAULT, NULL, tbuf);
		return (-1);
	}

	/*
	 * This section simulates ntpdate. If the offset exceeds the
	 * step threshold (128 ms), step the clock to that time and
	 * exit. Othewise, slew the clock to that time and exit. Note
	 * that the slew will persist and eventually complete beyond the
	 * life of this program. Note that while ntpdate is active, the
	 * terminal does not detach, so the termination message prints
	 * directly to the terminal.
	 */
	if (mode_ntpdate) {
		if (fabs(fp_offset) > clock_max && clock_max > 0) {
			step_systime(fp_offset);
			msyslog(LOG_NOTICE, "ntpd: time set %+.6f s",
	   		    fp_offset);
			printf("ntpd: time set %+.6fs\n", fp_offset);
		} else {
			adj_systime(fp_offset);
			msyslog(LOG_NOTICE, "ntpd: time slew %+.6f s",
			    fp_offset);
			printf("ntpd: time slew %+.6fs\n", fp_offset);
		}
		record_loop_stats(fp_offset, drift_comp, clock_jitter,
		    clock_stability, sys_poll);
		exit (0);
	}

	/*
	 * The huff-n'-puff filter finds the lowest delay in the recent
	 * interval. This is used to correct the offset by one-half the
	 * difference between the sample delay and minimum delay. This
	 * is most effective if the delays are highly assymetric and
	 * clockhopping is avoided and the clock frequency wander is
	 * relatively small.
	 */
	if (sys_huffpuff != NULL) {
		if (peer->delay < sys_huffpuff[sys_huffptr])
			sys_huffpuff[sys_huffptr] = peer->delay;
		if (peer->delay < sys_mindly)
			sys_mindly = peer->delay;
		if (fp_offset > 0)
			dtemp = -(peer->delay - sys_mindly) / 2;
		else
			dtemp = (peer->delay - sys_mindly) / 2;
		fp_offset += dtemp;
#ifdef DEBUG
		if (debug)
			printf(
		    "local_clock: size %d mindly %.6f huffpuff %.6f\n",
			    sys_hufflen, sys_mindly, dtemp);
#endif
	}

	/*
	 * Clock state machine transition function which defines how the
	 * system reacts to large phase and frequency excursion. There
	 * are two main regimes: when the offset exceeds the step
	 * 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. 
	 *
	 * Note the kernel is disabled if step is disabled or greater
	 * than 0.5 s or in ntpdate mode. 
	 */
	osys_poll = sys_poll;
	if (sys_poll < peer->minpoll)
		sys_poll = peer->minpoll;
	if (sys_poll > peer->maxpoll)
		sys_poll = peer->maxpoll;
	mu = current_time - clock_epoch;
	clock_frequency = drift_comp;
	rval = 1;
	if (fabs(fp_offset) > clock_max && clock_max > 0) {
		switch (state) {

		/*
		 * In SYNC state we ignore the first outlyer and switch
		 * to SPIK state.
		 */
		case EVNT_SYNC:
			snprintf(tbuf, sizeof(tbuf), "%+.6f s",
			    fp_offset);
			report_event(EVNT_SPIK, NULL, tbuf);
			state = EVNT_SPIK;
			return (0);

		/*
		 * In FREQ state we ignore outlyers and inlyers. At the
		 * first outlyer after the stepout threshold, compute
		 * the apparent frequency correction and step the phase.
		 */
		case EVNT_FREQ:
			if (mu < clock_minstep)
				return (0);

			clock_frequency = direct_freq(fp_offset);

			/* fall through to S_SPIK */

		/*
		 * In SPIK state we ignore succeeding outlyers until
		 * either an inlyer is found or the stepout threshold is
		 * exceeded.
		 */
		case EVNT_SPIK:
			if (mu < clock_minstep)
				return (0);

			/* fall through to default */

		/*
		 * We get here by default in NSET and FSET states and
		 * from above in FREQ or SPIK states.
		 *
		 * In NSET state an initial frequency correction is not
		 * available, usually because the frequency file has not
		 * yet been written. Since the time is outside the step
		 * threshold, the clock is stepped. The frequency will
		 * be set directly following the stepout interval.
		 *
		 * In FSET state the initial frequency has been set from
		 * the frequency file. Since the time is outside the
		 * step threshold, the clock is stepped immediately,
		 * rather than after the stepout interval. Guys get
		 * nervous if it takes 15 minutes to set the clock for
		 * the first time.
		 *
		 * In FREQ and SPIK states the stepout threshold has
		 * expired and the phase is still above the step
		 * 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);
			report_event(EVNT_CLOCKRESET, NULL, tbuf);
			step_systime(fp_offset);
			reinit_timer();
			tc_counter = 0;
			clock_jitter = LOGTOD(sys_precision);
			rval = 2;
			if (state == EVNT_NSET || (current_time -
			    last_step) < clock_minstep * 2) {
				rstclock(EVNT_FREQ, 0);
				return (rval);
			}
			last_step = current_time;
			break;
		}
		rstclock(EVNT_SYNC, 0);
	} else {

		/*
		 * The offset is less than the step threshold. Calculate
		 * the jitter as the exponentially weighted offset
		 * differences.
 	      	 */
		etemp = SQUARE(clock_jitter);
		dtemp = SQUARE(max(fabs(fp_offset - last_offset),
		    LOGTOD(sys_precision)));
		clock_jitter = SQRT(etemp + (dtemp - etemp) /
		    CLOCK_AVG);
		switch (state) {

		/*
		 * In NSET state this is the first update received and
		 * the frequency has not been initialized. Adjust the
		 * phase, but do not adjust the frequency until after
		 * the stepout threshold.
		 */
		case EVNT_NSET:
			rstclock(EVNT_FREQ, fp_offset);
			break;

		/*
		 * In FSET state this is the first update received and
		 * the frequency has been initialized. Adjust the phase,
		 * but do not adjust the frequency until the next
		 * update.
		 */
		case EVNT_FSET:
			rstclock(EVNT_SYNC, fp_offset);
			break;

		/*
		 * In FREQ state ignore updates until the stepout
		 * threshold. After that, compute the new frequency, but
		 * do not adjust the phase or frequency until the next
		 * update.
		 */
		case EVNT_FREQ:
			if (mu < clock_minstep)
				return (0);

			clock_frequency = direct_freq(fp_offset);
			rstclock(EVNT_SYNC, 0);
			break;


		/*
		 * We get here by default in SYNC and SPIK states. Here
		 * we compute the frequency update due to PLL and FLL
		 * contributions.
		 */
		default:
			allow_panic = FALSE;

			/*
			 * The FLL and PLL frequency gain constants
			 * depend on the time constant and Allan
			 * intercept. The PLL is always used, but
			 * becomes ineffective above the Allan intercept
			 * where the FLL becomes effective.
			 */
			if (sys_poll >= allan_xpt)
				clock_frequency += (fp_offset -
				    clock_offset) /
				    max(ULOGTOD(sys_poll), mu) *
				    CLOCK_FLL;

			/*
			 * The PLL frequency gain (numerator) depends on
			 * the minimum of the update interval and Allan
			 * 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 *
			    dtemp);
			rstclock(EVNT_SYNC, fp_offset);
			break;
		}
	}

#ifdef KERNEL_PLL
	/*
	 * This code segment works when clock adjustments are made using
	 * precision time kernel support and the ntp_adjtime() system
	 * call. This support is available in Solaris 2.6 and later,
	 * Digital Unix 4.0 and later, FreeBSD, Linux and specially
	 * modified kernels for HP-UX 9 and Ultrix 4. In the case of the
	 * DECstation 5000/240 and Alpha AXP, additional kernel
	 * modifications provide a true microsecond clock and nanosecond
	 * clock, respectively.
	 *
	 * Important note: The kernel discipline is used only if the
	 * step threshold is less than 0.5 s, as anything higher can
	 * lead to overflow problems. This might occur if some misguided
	 * lad set the step threshold to something ridiculous.
	 */
	if (pll_control && kern_enable) {

		/*
		 * We initialize the structure for the ntp_adjtime()
		 * system call. We have to convert everything to
		 * microseconds or nanoseconds first. Do not update the
		 * system variables if the ext_enable flag is set. In
		 * this case, the external clock driver will update the
		 * variables, which will be read later by the local
		 * clock driver. Afterwards, remember the time and
		 * frequency offsets for jitter and stability values and
		 * to update the frequency file.
		 */
		memset(&ntv,  0, sizeof(ntv));
		if (ext_enable) {
			ntv.modes = MOD_STATUS;
		} else {
#ifdef STA_NANO
			ntv.modes = MOD_BITS | MOD_NANO;
#else /* STA_NANO */
			ntv.modes = MOD_BITS;
#endif /* STA_NANO */
			if (clock_offset < 0)
				dtemp = -.5;
			else
				dtemp = .5;
#ifdef STA_NANO
			ntv.offset = (int32)(clock_offset * 1e9 +
			    dtemp);
			ntv.constant = sys_poll;
#else /* STA_NANO */
			ntv.offset = (int32)(clock_offset * 1e6 +
			    dtemp);
			ntv.constant = sys_poll - 4;
#endif /* STA_NANO */
			ntv.esterror = (u_int32)(clock_jitter * 1e6);
			ntv.maxerror = (u_int32)((sys_rootdelay / 2 +
			    sys_rootdisp) * 1e6);
			ntv.status = STA_PLL;

			/*
			 * Enable/disable the PPS if requested.
			 */
			if (pps_enable) {
				if (!(pll_status & STA_PPSTIME))
					report_event(EVNT_KERN,
					    NULL, "PPS enabled");
				ntv.status |= STA_PPSTIME | STA_PPSFREQ;
			} else {
				if (pll_status & STA_PPSTIME)
					report_event(EVNT_KERN,
					    NULL, "PPS disabled");
				ntv.status &= ~(STA_PPSTIME |
				    STA_PPSFREQ);
			}
			if (sys_leap == LEAP_ADDSECOND)
				ntv.status |= STA_INS;
			else if (sys_leap == LEAP_DELSECOND)
				ntv.status |= STA_DEL;
		}

		/*
		 * Pass the stuff to the kernel. If it squeals, turn off
		 * the pps. In any case, fetch the kernel offset,
		 * frequency and jitter.
		 */
		if (ntp_adjtime(&ntv) == TIME_ERROR) {
			if (!(ntv.status & STA_PPSSIGNAL))
				report_event(EVNT_KERN, NULL,
				    "PPS no signal");
		}
		pll_status = ntv.status;
#ifdef STA_NANO
		clock_offset = ntv.offset / 1e9;
#else /* STA_NANO */
		clock_offset = ntv.offset / 1e6;
#endif /* STA_NANO */
		clock_frequency = FREQTOD(ntv.freq);

		/*
		 * If the kernel PPS is lit, monitor its performance.
		 */
		if (ntv.status & STA_PPSTIME) {
#ifdef STA_NANO
			clock_jitter = ntv.jitter / 1e9;
#else /* STA_NANO */
			clock_jitter = ntv.jitter / 1e6;
#endif /* STA_NANO */
		}

#if defined(STA_NANO) && NTP_API == 4
		/*
		 * If the TAI changes, update the kernel TAI.
		 */
		if (loop_tai != sys_tai) {
			loop_tai = sys_tai;
			ntv.modes = MOD_TAI;
			ntv.constant = sys_tai;
			ntp_adjtime(&ntv);
		}
#endif /* STA_NANO */
	}
#endif /* KERNEL_PLL */

	/*
	 * Clamp the frequency within the tolerance range and calculate
	 * the frequency difference since the last update.
	 */
	if (fabs(clock_frequency) > NTP_MAXFREQ)
		msyslog(LOG_NOTICE,
		    "frequency error %.0f PPM exceeds tolerance %.0f PPM",
		    clock_frequency * 1e6, NTP_MAXFREQ * 1e6);
	dtemp = SQUARE(clock_frequency - drift_comp);
	if (clock_frequency > NTP_MAXFREQ)
		drift_comp = NTP_MAXFREQ;
	else if (clock_frequency < -NTP_MAXFREQ)
		drift_comp = -NTP_MAXFREQ;
	else
		drift_comp = clock_frequency;

	/*
	 * Calculate the wander as the exponentially weighted RMS
	 * frequency differences. Record the change for the frequency
	 * file update.
	 */
	etemp = SQUARE(clock_stability);
	clock_stability = SQRT(etemp + (dtemp - etemp) / CLOCK_AVG);
	drift_file_sw = TRUE;

	/*
	 * Here we adjust the timeconstan by comparing the current
	 * offset with the clock jitter. If the offset is less than the
	 * clock jitter times a constant, then the averaging interval is
	 * increased, otherwise it is decreased. A bit of hysteresis
	 * helps calm the dance. Works best using burst mode.
	 */
	if (fabs(clock_offset) < CLOCK_PGATE * clock_jitter) {
		tc_counter += sys_poll;
		if (tc_counter > CLOCK_LIMIT) {
			tc_counter = CLOCK_LIMIT;
			if (sys_poll < peer->maxpoll) {
				tc_counter = 0;
				sys_poll++;
			}
		}
	} else {
		tc_counter -= sys_poll << 1;
		if (tc_counter < -CLOCK_LIMIT) {
			tc_counter = -CLOCK_LIMIT;
			if (sys_poll > peer->minpoll) {
				tc_counter = 0;
				sys_poll--;
			}
		}
	}

	/*
	 * If the time constant has changed, update the poll variables.
	 */
	if (osys_poll != sys_poll)
		poll_update(peer, sys_poll);

	/*
	 * Yibbidy, yibbbidy, yibbidy; that'h all folks.
	 */
	record_loop_stats(clock_offset, drift_comp, clock_jitter,
	    clock_stability, sys_poll);
#ifdef DEBUG
	if (debug)
		printf(
		    "local_clock: offset %.9f jit %.9f freq %.3f stab %.3f poll %d\n",
		    clock_offset, clock_jitter, drift_comp * 1e6,
		    clock_stability * 1e6, sys_poll);
#endif /* DEBUG */
	return (rval);
#endif /* LOCKCLOCK */
}


/*
 * adj_host_clock - Called once every second to update the local clock.
 *
 * LOCKCLOCK: The only thing this routine does is increment the
 * sys_rootdisp variable.
 */
void
adj_host_clock(
	void
	)
{
	double	adjustment;

	/*
	 * Update the dispersion since the last update. In contrast to
	 * NTPv3, NTPv4 does not declare unsynchronized after one day,
	 * since the dispersion check serves this function. Also,
	 * since the poll interval can exceed one day, the old test
	 * would be counterproductive.
	 */
	sys_rootdisp += clock_phi;

#ifndef LOCKCLOCK
	/*
	 * If clock discipline is disabled or if the kernel is enabled,
	 * get out of Dodge quick.
	 */
	if (!ntp_enable || mode_ntpdate || (pll_control &&
	    kern_enable))
		return;

	/*
	 * Implement the phase and frequency adjustments. The gain
	 * factor (denominator) increases with poll interval, so is
	 * dominated by the FLL above the Allan intercept.
 	 */
	adjustment = clock_offset / (CLOCK_PLL * ULOGTOD(sys_poll));
	clock_offset -= adjustment;
	adj_systime(adjustment + drift_comp);
#endif /* LOCKCLOCK */
}


/*
 * Clock state machine. Enter new state and set state variables.
 */
static void
rstclock(
	int	trans,		/* new state */
	double	offset		/* new offset */
	)
{
#ifdef DEBUG
	if (debug > 1)
		printf("local_clock: mu %lu state %d poll %d count %d\n",
		    current_time - clock_epoch, trans, sys_poll,
		    tc_counter);
#endif
	if (trans != state && trans != EVNT_FSET)
		report_event(trans, NULL, NULL);
	state = trans;
	last_offset = clock_offset = offset;
	clock_epoch = current_time; 
}

/*
 * calc_freq - calculate frequency directly
 *
 * This is very carefully done. When the offset is first computed at the
 * first update, a residual frequency component results. Subsequently,
 * updates are suppresed until the end of the measurement interval while
 * the offset is amortized. At the end of the interval the frequency is
 * calculated from the current offset, residual offset, length of the
 * interval and residual frequency component. At the same time the
 * frequenchy file is armed for update at the next hourly stats.
 */
static double
direct_freq(
	double	fp_offset
	)
{

#ifdef KERNEL_PLL
	/*
	 * If the kernel is enabled, we need the residual offset to
	 * calculate the frequency correction.
	 */
	if (pll_control && kern_enable) {
		memset(&ntv,  0, sizeof(ntv));
		ntp_adjtime(&ntv);
#ifdef STA_NANO
		clock_offset = ntv.offset / 1e9;
#else /* STA_NANO */
		clock_offset = ntv.offset / 1e6;
#endif /* STA_NANO */
		drift_comp = FREQTOD(ntv.freq);
	}
#endif /* KERNEL_PLL */
	set_freq((fp_offset - clock_offset) / (current_time -
	    clock_epoch) + drift_comp);
	wander_resid = 0;
	return (drift_comp);
}


/*
 * set_freq - set clock frequency
 */
static void
set_freq(
	double	freq		/* frequency update */
	)
{
	char	tbuf[80];

	drift_comp = freq;

#ifdef KERNEL_PLL
	/*
	 * If the kernel is enabled, update the kernel frequency.
	 */
	if (pll_control && kern_enable) {
		memset(&ntv,  0, sizeof(ntv));
		ntv.modes = MOD_FREQUENCY;
		ntv.freq = DTOFREQ(drift_comp);
		ntp_adjtime(&ntv);
		snprintf(tbuf, sizeof(tbuf), "kernel %.3f PPM",
		    drift_comp * 1e6);
		report_event(EVNT_FSET, NULL, tbuf);
	} else {
		snprintf(tbuf, sizeof(tbuf), "ntpd %.3f PPM",
		    drift_comp * 1e6);
		report_event(EVNT_FSET, NULL, tbuf);
	}
#else /* KERNEL_PLL */
	snprintf(tbuf, sizeof(tbuf), "ntpd %.3f PPM", drift_comp *
	    1e6);
	report_event(EVNT_FSET, NULL, tbuf);
#endif /* KERNEL_PLL */
}

/*
 * huff-n'-puff filter
 */
void
huffpuff()
{
	int i;

	if (sys_huffpuff == NULL)
		return;

	sys_huffptr = (sys_huffptr + 1) % sys_hufflen;
	sys_huffpuff[sys_huffptr] = 1e9;
	sys_mindly = 1e9;
	for (i = 0; i < sys_hufflen; i++) {
		if (sys_huffpuff[i] < sys_mindly)
			sys_mindly = sys_huffpuff[i];
	}
}


/*
 * loop_config - configure the loop filter
 *
 * LOCKCLOCK: The LOOP_DRIFTINIT and LOOP_DRIFTCOMP cases are no-ops.
 */
void
loop_config(
	int	item,
	double	freq
	)
{
	int i;

#ifdef DEBUG
	if (debug > 1)
		printf("loop_config: item %d freq %f\n", item, freq);
#endif
	switch (item) {

	/*
	 * We first assume the kernel supports the ntp_adjtime()
	 * syscall. If that syscall works, initialize the kernel time
	 * variables. Otherwise, continue leaving no harm behind.
	 */
	case LOOP_DRIFTINIT:
#ifndef LOCKCLOCK
#ifdef KERNEL_PLL
		if (mode_ntpdate)
			break;

		pll_control = 1;
		memset(&ntv, 0, sizeof(ntv));
		ntv.modes = MOD_BITS;
		ntv.status = STA_PLL;
		ntv.maxerror = MAXDISPERSE;
		ntv.esterror = MAXDISPERSE;
		ntv.constant = sys_poll;
#ifdef SIGSYS
		/*
		 * Use sigsetjmp() to save state and then call
		 * ntp_adjtime(); if it fails, then siglongjmp() is used
		 * to return control
		 */
		newsigsys.sa_handler = pll_trap;
		newsigsys.sa_flags = 0;
		if (sigaction(SIGSYS, &newsigsys, &sigsys)) {
			msyslog(LOG_ERR,
			    "sigaction() fails to save SIGSYS trap: %m");
			pll_control = 0;
		}
		if (sigsetjmp(env, 1) == 0)
			ntp_adjtime(&ntv);
		if ((sigaction(SIGSYS, &sigsys,
		    (struct sigaction *)NULL))) {
			msyslog(LOG_ERR,
			    "sigaction() fails to restore SIGSYS trap: %m");
			pll_control = 0;
		}
#else /* SIGSYS */
		ntp_adjtime(&ntv);
#endif /* SIGSYS */

		/*
		 * Save the result status and light up an external clock
		 * if available.
		 */
		pll_status = ntv.status;
		if (pll_control) {
#ifdef STA_NANO
			if (pll_status & STA_CLK)
				ext_enable = 1;
#endif /* STA_NANO */
			report_event(EVNT_KERN, NULL,
 		  	    "kernel time sync enabled");
		}
#endif /* KERNEL_PLL */
#endif /* LOCKCLOCK */
		break;

	/*
	 * Initialize the frequency. If the frequency file is missing or
	 * broken, set the initial frequency to zero and set the state
	 * to NSET. Otherwise, set the initial frequency to the given
	 * value and the state to FSET.
	 */
	case LOOP_DRIFTCOMP:
#ifndef LOCKCLOCK
		if (freq > NTP_MAXFREQ || freq < -NTP_MAXFREQ) {
			set_freq(0);
			rstclock(EVNT_NSET, 0);
		} else {
			set_freq(freq);
			rstclock(EVNT_FSET, 0);
		}
#endif /* LOCKCLOCK */
		break;

	/*
	 * Disable the kernel at shutdown. The microkernel just abandons
	 * ship. The nanokernel carefully cleans up so applications can
	 * see this. Note the last programmed offset and frequency are
	 * left in place.
	 */
	case LOOP_KERN_CLEAR:
#ifndef LOCKCLOCK
#ifdef KERNEL_PLL
		if (pll_control && kern_enable) {
			memset((char *)&ntv, 0, sizeof(ntv));
			ntv.modes = MOD_STATUS;
			ntv.status = STA_UNSYNC;
			ntp_adjtime(&ntv);
			report_event(EVNT_KERN, NULL,
 		  	    "kernel time sync disabledx");
		   }
#endif /* KERNEL_PLL */
#endif /* LOCKCLOCK */
		break;

	/*
	 * Tinker command variables for Ulrich Windl. Very dangerous.
	 */
	case LOOP_ALLAN:	/* Allan intercept (log2) (allan) */
		allan_xpt = (u_char)freq;
		break;

	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) */	
		set_freq(freq / 1e6);
		rstclock(EVNT_FSET, 0);
		break;

	case LOOP_HUFFPUFF:	/* huff-n'-puff length (huffpuff) */
		if (freq < HUFFPUFF)
			freq = HUFFPUFF;
		sys_hufflen = (int)(freq / HUFFPUFF);
		sys_huffpuff = (double *)emalloc(sizeof(double) *
		    sys_hufflen);
		for (i = 0; i < sys_hufflen; i++)
			sys_huffpuff[i] = 1e9;
		sys_mindly = 1e9;
		break;

	case LOOP_PANIC:	/* panic threshold (panic) */
		clock_panic = freq;
		break;

	case LOOP_MAX:		/* step threshold (step) */
		clock_max = freq;
		if (clock_max == 0 || clock_max > 0.5)
			kern_enable = 0;
		break;

	case LOOP_MINSTEP:	/* stepout threshold (stepout) */
		clock_minstep = freq; 
		break;

	case LOOP_LEAP:		/* not used */
	default:
		msyslog(LOG_NOTICE,
		    "loop_config: unsupported option %d", item);
	}
}


#if defined(KERNEL_PLL) && defined(SIGSYS)
/*
 * _trap - trap processor for undefined syscalls
 *
 * This nugget is called by the kernel when the SYS_ntp_adjtime()
 * syscall bombs because the silly thing has not been implemented in
 * the kernel. In this case the phase-lock loop is emulated by
 * the stock adjtime() syscall and a lot of indelicate abuse.
 */
static RETSIGTYPE
pll_trap(
	int arg
	)
{
	pll_control = 0;
	siglongjmp(env, 1);
}
#endif /* KERNEL_PLL && SIGSYS */
ntp-4.2.6p5/ntpd/ntpd.c0000644000175000017500000007267311675457723013727 0ustar  peterpeter/*
 * ntpd.c - main program for the fixed point NTP daemon
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#include "ntp_machine.h"
#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_stdlib.h"
#include 

#include "ntp_syslog.h"
#include "isc/assertions.h"
#include "isc/error.h"
#include "isc/strerror.h"
#include "isc/formatcheck.h"

#ifdef SIM
# include "ntpsim.h"
#endif

#include "ntp_libopts.h"
#include "ntpd-opts.h"

#ifdef HAVE_UNISTD_H
# include 
#endif
#ifdef HAVE_SYS_STAT_H
# include 
#endif
#include 
#if !defined(VMS)	/*wjm*/
# ifdef HAVE_SYS_PARAM_H
#  include 
# endif
#endif /* VMS */
#ifdef HAVE_SYS_SIGNAL_H
# include 
#else
# include 
#endif
#ifdef HAVE_SYS_IOCTL_H
# include 
#endif /* HAVE_SYS_IOCTL_H */
#ifdef HAVE_SYS_RESOURCE_H
# include 
#endif /* HAVE_SYS_RESOURCE_H */
#if defined(HAVE_RTPRIO)
# ifdef HAVE_SYS_RESOURCE_H
#  include 
# endif
# ifdef HAVE_SYS_LOCK_H
#  include 
# endif
# include 
#else
# ifdef HAVE_PLOCK
#  ifdef HAVE_SYS_LOCK_H
#	include 
#  endif
# endif
#endif
#if defined(HAVE_SCHED_SETSCHEDULER)
# ifdef HAVE_SCHED_H
#  include 
# else
#  ifdef HAVE_SYS_SCHED_H
#   include 
#  endif
# endif
#endif
#if defined(HAVE_SYS_MMAN_H)
# include 
#endif

#ifdef HAVE_TERMIOS_H
# include 
#endif

#ifdef SYS_DOMAINOS
# include 
#endif /* SYS_DOMAINOS */

#include "recvbuff.h"
#include "ntp_cmdargs.h"

#if 0				/* HMS: I don't think we need this. 961223 */
#ifdef LOCK_PROCESS
# ifdef SYS_SOLARIS
#  include 
# else
#  include 
# endif
#endif
#endif

#ifdef _AIX
# include 
#endif /* _AIX */

#ifdef SCO5_CLOCK
# include 
#endif

#ifdef HAVE_DROPROOT
# include 
# include 
# include 
#ifdef HAVE_LINUX_CAPABILITIES
# include 
# include 
#endif
#endif

/*
 * Signals we catch for debugging.	If not debugging we ignore them.
 */
#define MOREDEBUGSIG	SIGUSR1
#define LESSDEBUGSIG	SIGUSR2

/*
 * Signals which terminate us gracefully.
 */
#ifndef SYS_WINNT
# define SIGDIE1	SIGHUP
# define SIGDIE3	SIGQUIT
# define SIGDIE2	SIGINT
# define SIGDIE4	SIGTERM
#endif /* SYS_WINNT */

#ifdef HAVE_DNSREGISTRATION
#include 
DNSServiceRef mdns;
#endif

/*
 * Scheduling priority we run at
 */
#define NTPD_PRIO	(-12)

int priority_done = 2;		/* 0 - Set priority */
				/* 1 - priority is OK where it is */
				/* 2 - Don't set priority */
				/* 1 and 2 are pretty much the same */

#ifdef DEBUG
/*
 * Debugging flag
 */
volatile int debug = 0;		/* No debugging by default */
#endif

int	listen_to_virtual_ips = 1;
const char *specific_interface = NULL;        /* interface name or IP address to bind to */

/*
 * No-fork flag.  If set, we do not become a background daemon.
 */
int nofork = 0;			/* Fork by default */

#ifdef HAVE_DNSREGISTRATION
/*
 * mDNS registration flag. If set, we attempt to register with the mDNS system, but only
 * after we have synched the first time. If the attempt fails, then try again once per 
 * minute for up to 5 times. After all, we may be starting before mDNS.
 */
int mdnsreg = 1;
int mdnstries = 5;
#endif  /* HAVE_DNSREGISTRATION */

#ifdef HAVE_DROPROOT
int droproot = 0;
char *user = NULL;		/* User to switch to */
char *group = NULL;		/* group to switch to */
const char *chrootdir = NULL;	/* directory to chroot to */
int sw_uid;
int sw_gid;
char *endp;
struct group *gr;
struct passwd *pw;
#endif /* HAVE_DROPROOT */

/*
 * Initializing flag.  All async routines watch this and only do their
 * thing when it is clear.
 */
int initializing;

/*
 * Version declaration
 */
extern const char *Version;

char const *progname;

int was_alarmed;

#ifdef DECL_SYSCALL
/*
 * We put this here, since the argument profile is syscall-specific
 */
extern int syscall	(int, ...);
#endif /* DECL_SYSCALL */


#ifdef	SIGDIE2
static	RETSIGTYPE	finish		(int);
#endif	/* SIGDIE2 */

#ifdef	DEBUG
#ifndef SYS_WINNT
static	RETSIGTYPE	moredebug	(int);
static	RETSIGTYPE	lessdebug	(int);
#endif
#else /* not DEBUG */
static	RETSIGTYPE	no_debug	(int);
#endif	/* not DEBUG */

int		ntpdmain		(int, char **);
static void	set_process_priority	(void);
void		init_logging		(char const *, int);
void		setup_logfile		(void);
static void	process_commandline_opts(int *, char ***);

static void	assertion_failed	(const char *file, int line,
	isc_assertiontype_t type, const char *cond);
static void	library_fatal_error	(const char *file, int line,
	const char *format, va_list args) ISC_FORMAT_PRINTF(3, 0);
static void	library_unexpected_error(const char *file, int line,
	const char *format, va_list args) ISC_FORMAT_PRINTF(3, 0);


/*
 * Initialize the logging
 */
void
init_logging(
	char const *name,
	int log_version
	)
{
	const char *cp;

	/*
	 * Logging.  This may actually work on the gizmo board.  Find a name
	 * to log with by using the basename
	 */
	cp = strrchr(name, '/');
	if (cp == 0)
		cp = name;
	else
		cp++;

#if !defined(VMS)

# ifndef LOG_DAEMON
	openlog(cp, LOG_PID);
# else /* LOG_DAEMON */

#  ifndef LOG_NTP
#	define	LOG_NTP LOG_DAEMON
#  endif
	openlog(cp, LOG_PID | LOG_NDELAY, LOG_NTP);
#  ifdef DEBUG
	if (debug)
		setlogmask(LOG_UPTO(LOG_DEBUG));
	else
#  endif /* DEBUG */
		setlogmask(LOG_UPTO(LOG_DEBUG)); /* @@@ was INFO */
# endif /* LOG_DAEMON */
#endif	/* !VMS */

	if (log_version)
	    NLOG(NLOG_SYSINFO) /* 'if' clause for syslog */
		msyslog(LOG_NOTICE, "%s", Version);
}


/*
 * Redirect logging to a file if requested with -l.
 * The ntp.conf logfile directive does not use this code, see
 * config_vars() in ntp_config.c.
 */
void
setup_logfile(
	void
	)
{
	if (HAVE_OPT( LOGFILE )) {
		const char *my_optarg = OPT_ARG( LOGFILE );
		FILE *new_file;

		if(strcmp(my_optarg, "stderr") == 0)
			new_file = stderr;
		else if(strcmp(my_optarg, "stdout") == 0)
			new_file = stdout;
		else
			new_file = fopen(my_optarg, "a");
		if (new_file != NULL) {
			NLOG(NLOG_SYSINFO)
				msyslog(LOG_NOTICE, "logging to file %s", my_optarg);
			if (syslog_file != NULL &&
				fileno(syslog_file) != fileno(new_file))
				(void)fclose(syslog_file);

			syslog_file = new_file;
			syslogit = 0;
		}
		else
			msyslog(LOG_ERR,
				"Cannot open log file %s",
				my_optarg);
	}
}


static void
process_commandline_opts(
	int *pargc,
	char ***pargv
	)
{
	int optct;
	
	optct = ntpOptionProcess(&ntpdOptions, *pargc, *pargv);
	*pargc -= optct;
	*pargv += optct;
}


#ifdef SIM
int
main(
	int argc,
	char *argv[]
	)
{
	process_commandline_opts(&argc, &argv);

	return ntpsim(argc, argv);
}
#else /* SIM */
#ifdef NO_MAIN_ALLOWED
CALL(ntpd,"ntpd",ntpdmain);
#else
#ifndef SYS_WINNT
int
main(
	int argc,
	char *argv[]
	)
{
	return ntpdmain(argc, argv);
}
#endif /* SYS_WINNT */
#endif /* NO_MAIN_ALLOWED */
#endif /* SIM */

#ifdef _AIX
/*
 * OK. AIX is different than solaris in how it implements plock().
 * If you do NOT adjust the stack limit, you will get the MAXIMUM
 * stack size allocated and PINNED with you program. To check the
 * value, use ulimit -a.
 *
 * To fix this, we create an automatic variable and set our stack limit
 * to that PLUS 32KB of extra space (we need some headroom).
 *
 * This subroutine gets the stack address.
 *
 * Grover Davidson and Matt Ladendorf
 *
 */
static char *
get_aix_stack(void)
{
	char ch;
	return (&ch);
}

/*
 * Signal handler for SIGDANGER.
 */
static void
catch_danger(int signo)
{
	msyslog(LOG_INFO, "ntpd: setpgid(): %m");
	/* Make the system believe we'll free something, but don't do it! */
	return;
}
#endif /* _AIX */

/*
 * Set the process priority
 */
static void
set_process_priority(void)
{

#ifdef DEBUG
	if (debug > 1)
		msyslog(LOG_DEBUG, "set_process_priority: %s: priority_done is <%d>",
			((priority_done)
			 ? "Leave priority alone"
			 : "Attempt to set priority"
				),
			priority_done);
#endif /* DEBUG */

#if defined(HAVE_SCHED_SETSCHEDULER)
	if (!priority_done) {
		extern int config_priority_override, config_priority;
		int pmax, pmin;
		struct sched_param sched;

		pmax = sched_get_priority_max(SCHED_FIFO);
		sched.sched_priority = pmax;
		if ( config_priority_override ) {
			pmin = sched_get_priority_min(SCHED_FIFO);
			if ( config_priority > pmax )
				sched.sched_priority = pmax;
			else if ( config_priority < pmin )
				sched.sched_priority = pmin;
			else
				sched.sched_priority = config_priority;
		}
		if ( sched_setscheduler(0, SCHED_FIFO, &sched) == -1 )
			msyslog(LOG_ERR, "sched_setscheduler(): %m");
		else
			++priority_done;
	}
#endif /* HAVE_SCHED_SETSCHEDULER */
#if defined(HAVE_RTPRIO)
# ifdef RTP_SET
	if (!priority_done) {
		struct rtprio srtp;

		srtp.type = RTP_PRIO_REALTIME;	/* was: RTP_PRIO_NORMAL */
		srtp.prio = 0;		/* 0 (hi) -> RTP_PRIO_MAX (31,lo) */

		if (rtprio(RTP_SET, getpid(), &srtp) < 0)
			msyslog(LOG_ERR, "rtprio() error: %m");
		else
			++priority_done;
	}
# else /* not RTP_SET */
	if (!priority_done) {
		if (rtprio(0, 120) < 0)
			msyslog(LOG_ERR, "rtprio() error: %m");
		else
			++priority_done;
	}
# endif /* not RTP_SET */
#endif  /* HAVE_RTPRIO */
#if defined(NTPD_PRIO) && NTPD_PRIO != 0
# ifdef HAVE_ATT_NICE
	if (!priority_done) {
		errno = 0;
		if (-1 == nice (NTPD_PRIO) && errno != 0)
			msyslog(LOG_ERR, "nice() error: %m");
		else
			++priority_done;
	}
# endif /* HAVE_ATT_NICE */
# ifdef HAVE_BSD_NICE
	if (!priority_done) {
		if (-1 == setpriority(PRIO_PROCESS, 0, NTPD_PRIO))
			msyslog(LOG_ERR, "setpriority() error: %m");
		else
			++priority_done;
	}
# endif /* HAVE_BSD_NICE */
#endif /* NTPD_PRIO && NTPD_PRIO != 0 */
	if (!priority_done)
		msyslog(LOG_ERR, "set_process_priority: No way found to improve our priority");
}


/*
 * Main program.  Initialize us, disconnect us from the tty if necessary,
 * and loop waiting for I/O and/or timer expiries.
 */
int
ntpdmain(
	int argc,
	char *argv[]
	)
{
	l_fp now;
	struct recvbuf *rbuf;
#ifdef _AIX			/* HMS: ifdef SIGDANGER? */
	struct sigaction sa;
#endif

	progname = argv[0];
	initializing = 1;		/* mark that we are initializing */
	process_commandline_opts(&argc, &argv);
	init_logging(progname, 1);	/* Open the log file */

#ifdef HAVE_UMASK
	{
		mode_t uv;

		uv = umask(0);
		if(uv)
			(void) umask(uv);
		else
			(void) umask(022);
	}
#endif

#if defined(HAVE_GETUID) && !defined(MPE) /* MPE lacks the concept of root */
	{
		uid_t uid;

		uid = getuid();
		if (uid && !HAVE_OPT( SAVECONFIGQUIT )) {
			msyslog(LOG_ERR, "ntpd: must be run as root, not uid %ld", (long)uid);
			printf("must be run as root, not uid %ld\n", (long)uid);
			exit(1);
		}
	}
#endif

	/* getstartup(argc, argv); / * startup configuration, may set debug */

#ifdef DEBUG
	debug = DESC(DEBUG_LEVEL).optOccCt;
	DPRINTF(1, ("%s\n", Version));
#endif

	/* honor -l/--logfile option to log to a file */
	setup_logfile();

/*
 * Enable the Multi-Media Timer for Windows?
 */
#ifdef SYS_WINNT
	if (HAVE_OPT( MODIFYMMTIMER ))
		set_mm_timer(MM_TIMER_HIRES);
#endif

	if (HAVE_OPT( NOFORK ) || HAVE_OPT( QUIT )
#ifdef DEBUG
	    || debug
#endif
	    || HAVE_OPT( SAVECONFIGQUIT ))
		nofork = 1;

	if (HAVE_OPT( NOVIRTUALIPS ))
		listen_to_virtual_ips = 0;

	/*
	 * --interface, listen on specified interfaces
	 */
	if (HAVE_OPT( INTERFACE )) {
		int		ifacect = STACKCT_OPT( INTERFACE );
		const char**	ifaces  = STACKLST_OPT( INTERFACE );
		sockaddr_u	addr;

		while (ifacect-- > 0) {
			add_nic_rule(
				is_ip_address(*ifaces, &addr)
					? MATCH_IFADDR
					: MATCH_IFNAME,
				*ifaces, -1, ACTION_LISTEN);
			ifaces++;
		}
	}

	if (HAVE_OPT( NICE ))
		priority_done = 0;

#if defined(HAVE_SCHED_SETSCHEDULER)
	if (HAVE_OPT( PRIORITY )) {
		config_priority = OPT_VALUE_PRIORITY;
		config_priority_override = 1;
		priority_done = 0;
	}
#endif

#ifdef SYS_WINNT
	/*
	 * Start interpolation thread, must occur before first
	 * get_systime()
	 */
	init_winnt_time();
#endif
	/*
	 * Initialize random generator and public key pair
	 */
	get_systime(&now);

	ntp_srandom((int)(now.l_i * now.l_uf));

#if !defined(VMS)
# ifndef NODETACH
	/*
	 * Detach us from the terminal.  May need an #ifndef GIZMO.
	 */
	if (!nofork) {

		/*
		 * Install trap handlers to log errors and assertion
		 * failures.  Default handlers print to stderr which 
		 * doesn't work if detached.
		 */
		isc_assertion_setcallback(assertion_failed);
		isc_error_setfatal(library_fatal_error);
		isc_error_setunexpected(library_unexpected_error);

#  ifndef SYS_WINNT
#   ifdef HAVE_DAEMON
		daemon(0, 0);
#   else /* not HAVE_DAEMON */
		if (fork())	/* HMS: What about a -1? */
			exit(0);

		{
#if !defined(F_CLOSEM)
			u_long s;
			int max_fd;
#endif /* !FCLOSEM */
			if (syslog_file != NULL) {
				fclose(syslog_file);
				syslog_file = NULL;
			}
#if defined(F_CLOSEM)
			/*
			 * From 'Writing Reliable AIX Daemons,' SG24-4946-00,
			 * by Eric Agar (saves us from doing 32767 system
			 * calls)
			 */
			if (fcntl(0, F_CLOSEM, 0) == -1)
			    msyslog(LOG_ERR, "ntpd: failed to close open files(): %m");
#else  /* not F_CLOSEM */

# if defined(HAVE_SYSCONF) && defined(_SC_OPEN_MAX)
			max_fd = sysconf(_SC_OPEN_MAX);
# else /* HAVE_SYSCONF && _SC_OPEN_MAX */
			max_fd = getdtablesize();
# endif /* HAVE_SYSCONF && _SC_OPEN_MAX */
			for (s = 0; s < max_fd; s++)
				(void) close((int)s);
#endif /* not F_CLOSEM */
			(void) open("/", 0);
			(void) dup2(0, 1);
			(void) dup2(0, 2);

			init_logging(progname, 0);
			/* we lost our logfile (if any) daemonizing */
			setup_logfile();

#ifdef SYS_DOMAINOS
			{
				uid_$t puid;
				status_$t st;

				proc2_$who_am_i(&puid);
				proc2_$make_server(&puid, &st);
			}
#endif /* SYS_DOMAINOS */
#if defined(HAVE_SETPGID) || defined(HAVE_SETSID)
# ifdef HAVE_SETSID
			if (setsid() == (pid_t)-1)
				msyslog(LOG_ERR, "ntpd: setsid(): %m");
# else
			if (setpgid(0, 0) == -1)
				msyslog(LOG_ERR, "ntpd: setpgid(): %m");
# endif
#else /* HAVE_SETPGID || HAVE_SETSID */
			{
# if defined(TIOCNOTTY)
				int fid;

				fid = open("/dev/tty", 2);
				if (fid >= 0)
				{
					(void) ioctl(fid, (u_long) TIOCNOTTY, (char *) 0);
					(void) close(fid);
				}
# endif /* defined(TIOCNOTTY) */
# ifdef HAVE_SETPGRP_0
				(void) setpgrp();
# else /* HAVE_SETPGRP_0 */
				(void) setpgrp(0, getpid());
# endif /* HAVE_SETPGRP_0 */
			}
#endif /* HAVE_SETPGID || HAVE_SETSID */
#ifdef _AIX
			/* Don't get killed by low-on-memory signal. */
			sa.sa_handler = catch_danger;
			sigemptyset(&sa.sa_mask);
			sa.sa_flags = SA_RESTART;

			(void) sigaction(SIGDANGER, &sa, NULL);
#endif /* _AIX */
		}
#   endif /* not HAVE_DAEMON */
#  endif /* SYS_WINNT */
	}
# endif /* NODETACH */
#endif /* VMS */

#ifdef SCO5_CLOCK
	/*
	 * SCO OpenServer's system clock offers much more precise timekeeping
	 * on the base CPU than the other CPUs (for multiprocessor systems),
	 * so we must lock to the base CPU.
	 */
	{
	    int fd = open("/dev/at1", O_RDONLY);
	    if (fd >= 0) {
		int zero = 0;
		if (ioctl(fd, ACPU_LOCK, &zero) < 0)
		    msyslog(LOG_ERR, "cannot lock to base CPU: %m");
		close( fd );
	    } /* else ...
	       *   If we can't open the device, this probably just isn't
	       *   a multiprocessor system, so we're A-OK.
	       */
	}
#endif

#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) && defined(MCL_FUTURE)
# ifdef HAVE_SETRLIMIT
	/*
	 * Set the stack limit to something smaller, so that we don't lock a lot
	 * of unused stack memory.
	 */
	{
	    struct rlimit rl;

	    /* HMS: must make the rlim_cur amount configurable */
	    if (getrlimit(RLIMIT_STACK, &rl) != -1
		&& (rl.rlim_cur = 50 * 4096) < rl.rlim_max)
	    {
		    if (setrlimit(RLIMIT_STACK, &rl) == -1)
		    {
			    msyslog(LOG_ERR,
				"Cannot adjust stack limit for mlockall: %m");
		    }
	    }
#  ifdef RLIMIT_MEMLOCK
	    /*
	     * The default RLIMIT_MEMLOCK is very low on Linux systems.
	     * Unless we increase this limit malloc calls are likely to
	     * fail if we drop root privlege.  To be useful the value
	     * has to be larger than the largest ntpd resident set size.
	     */
	    rl.rlim_cur = rl.rlim_max = 32*1024*1024;
	    if (setrlimit(RLIMIT_MEMLOCK, &rl) == -1) {
		msyslog(LOG_ERR, "Cannot set RLIMIT_MEMLOCK: %m");
	    }
#  endif /* RLIMIT_MEMLOCK */
	}
# endif /* HAVE_SETRLIMIT */
	/*
	 * lock the process into memory
	 */
	if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0)
		msyslog(LOG_ERR, "mlockall(): %m");
#else /* not (HAVE_MLOCKALL && MCL_CURRENT && MCL_FUTURE) */
# ifdef HAVE_PLOCK
#  ifdef PROCLOCK
#   ifdef _AIX
	/*
	 * set the stack limit for AIX for plock().
	 * see get_aix_stack() for more info.
	 */
	if (ulimit(SET_STACKLIM, (get_aix_stack() - 8*4096)) < 0)
	{
		msyslog(LOG_ERR,"Cannot adjust stack limit for plock on AIX: %m");
	}
#   endif /* _AIX */
	/*
	 * lock the process into memory
	 */
	if (plock(PROCLOCK) < 0)
		msyslog(LOG_ERR, "plock(PROCLOCK): %m");
#  else /* not PROCLOCK */
#   ifdef TXTLOCK
	/*
	 * Lock text into ram
	 */
	if (plock(TXTLOCK) < 0)
		msyslog(LOG_ERR, "plock(TXTLOCK) error: %m");
#   else /* not TXTLOCK */
	msyslog(LOG_ERR, "plock() - don't know what to lock!");
#   endif /* not TXTLOCK */
#  endif /* not PROCLOCK */
# endif /* HAVE_PLOCK */
#endif /* not (HAVE_MLOCKALL && MCL_CURRENT && MCL_FUTURE) */

	/*
	 * Set up signals we pay attention to locally.
	 */
#ifdef SIGDIE1
	(void) signal_no_reset(SIGDIE1, finish);
#endif	/* SIGDIE1 */
#ifdef SIGDIE2
	(void) signal_no_reset(SIGDIE2, finish);
#endif	/* SIGDIE2 */
#ifdef SIGDIE3
	(void) signal_no_reset(SIGDIE3, finish);
#endif	/* SIGDIE3 */
#ifdef SIGDIE4
	(void) signal_no_reset(SIGDIE4, finish);
#endif	/* SIGDIE4 */

#ifdef SIGBUS
	(void) signal_no_reset(SIGBUS, finish);
#endif /* SIGBUS */

#if !defined(SYS_WINNT) && !defined(VMS)
# ifdef DEBUG
	(void) signal_no_reset(MOREDEBUGSIG, moredebug);
	(void) signal_no_reset(LESSDEBUGSIG, lessdebug);
# else
	(void) signal_no_reset(MOREDEBUGSIG, no_debug);
	(void) signal_no_reset(LESSDEBUGSIG, no_debug);
# endif /* DEBUG */
#endif /* !SYS_WINNT && !VMS */

	/*
	 * Set up signals we should never pay attention to.
	 */
#if defined SIGPIPE
	(void) signal_no_reset(SIGPIPE, SIG_IGN);
#endif	/* SIGPIPE */

	/*
	 * Call the init_ routines to initialize the data structures.
	 *
	 * Exactly what command-line options are we expecting here?
	 */
	init_auth();
	init_util();
	init_restrict();
	init_mon();
	init_timer();
	init_lib();
	init_request();
	init_control();
	init_peer();
#ifdef REFCLOCK
	init_refclock();
#endif
	set_process_priority();
	init_proto();		/* Call at high priority */
	init_io();
	init_loopfilter();
	mon_start(MON_ON);	/* monitor on by default now	  */
				/* turn off in config if unwanted */

	/*
	 * Get the configuration.  This is done in a separate module
	 * since this will definitely be different for the gizmo board.
	 */
	getconfig(argc, argv);
	report_event(EVNT_SYSRESTART, NULL, NULL);
	loop_config(LOOP_DRIFTCOMP, old_drift);
	initializing = 0;

#ifdef HAVE_DROPROOT
	if( droproot ) {
		/* Drop super-user privileges and chroot now if the OS supports this */

#ifdef HAVE_LINUX_CAPABILITIES
		/* set flag: keep privileges accross setuid() call (we only really need cap_sys_time): */
		if (prctl( PR_SET_KEEPCAPS, 1L, 0L, 0L, 0L ) == -1) {
			msyslog( LOG_ERR, "prctl( PR_SET_KEEPCAPS, 1L ) failed: %m" );
			exit(-1);
		}
#else
		/* we need a user to switch to */
		if (user == NULL) {
			msyslog(LOG_ERR, "Need user name to drop root privileges (see -u flag!)" );
			exit(-1);
		}
#endif /* HAVE_LINUX_CAPABILITIES */

		if (user != NULL) {
			if (isdigit((unsigned char)*user)) {
				sw_uid = (uid_t)strtoul(user, &endp, 0);
				if (*endp != '\0')
					goto getuser;

				if ((pw = getpwuid(sw_uid)) != NULL) {
					user = strdup(pw->pw_name);
					if (NULL == user) {
						msyslog(LOG_ERR, "strdup() failed: %m");
						exit (-1);
					}
					sw_gid = pw->pw_gid;
				} else {
					errno = 0;
					msyslog(LOG_ERR, "Cannot find user ID %s", user);
					exit (-1);
				}

			} else {
getuser:
				errno = 0;
				if ((pw = getpwnam(user)) != NULL) {
					sw_uid = pw->pw_uid;
					sw_gid = pw->pw_gid;
				} else {
					if (errno)
					    msyslog(LOG_ERR, "getpwnam(%s) failed: %m", user);
					else
					    msyslog(LOG_ERR, "Cannot find user `%s'", user);
					exit (-1);
				}
			}
		}
		if (group != NULL) {
			if (isdigit((unsigned char)*group)) {
				sw_gid = (gid_t)strtoul(group, &endp, 0);
				if (*endp != '\0')
					goto getgroup;
			} else {
getgroup:
				if ((gr = getgrnam(group)) != NULL) {
					sw_gid = gr->gr_gid;
				} else {
					errno = 0;
					msyslog(LOG_ERR, "Cannot find group `%s'", group);
					exit (-1);
				}
			}
		}

		if (chrootdir ) {
			/* make sure cwd is inside the jail: */
			if (chdir(chrootdir)) {
				msyslog(LOG_ERR, "Cannot chdir() to `%s': %m", chrootdir);
				exit (-1);
			}
			if (chroot(chrootdir)) {
				msyslog(LOG_ERR, "Cannot chroot() to `%s': %m", chrootdir);
				exit (-1);
			}
			if (chdir("/")) {
				msyslog(LOG_ERR, "Cannot chdir() to`root after chroot(): %m");
				exit (-1);
			}
		}
		if (user && initgroups(user, sw_gid)) {
			msyslog(LOG_ERR, "Cannot initgroups() to user `%s': %m", user);
			exit (-1);
		}
		if (group && setgid(sw_gid)) {
			msyslog(LOG_ERR, "Cannot setgid() to group `%s': %m", group);
			exit (-1);
		}
		if (group && setegid(sw_gid)) {
			msyslog(LOG_ERR, "Cannot setegid() to group `%s': %m", group);
			exit (-1);
		}
		if (user && setuid(sw_uid)) {
			msyslog(LOG_ERR, "Cannot setuid() to user `%s': %m", user);
			exit (-1);
		}
		if (user && seteuid(sw_uid)) {
			msyslog(LOG_ERR, "Cannot seteuid() to user `%s': %m", user);
			exit (-1);
		}

#ifndef HAVE_LINUX_CAPABILITIES
		/*
		 * for now assume that the privilege to bind to privileged ports
		 * is associated with running with uid 0 - should be refined on
		 * ports that allow binding to NTP_PORT with uid != 0
		 */
		disable_dynamic_updates |= (sw_uid != 0);  /* also notifies routing message listener */
#endif

		if (disable_dynamic_updates && interface_interval) {
			interface_interval = 0;
			msyslog(LOG_INFO, "running in unprivileged mode disables dynamic interface tracking");
		}

#ifdef HAVE_LINUX_CAPABILITIES
		do {
			/*
			 *  We may be running under non-root uid now, but we still hold full root privileges!
			 *  We drop all of them, except for the crucial one or two: cap_sys_time and
			 *  cap_net_bind_service if doing dynamic interface tracking.
			 */
			cap_t caps;
			char *captext = (interface_interval)
				? "cap_sys_time,cap_net_bind_service=ipe"
				: "cap_sys_time=ipe";
			if( ! ( caps = cap_from_text( captext ) ) ) {
				msyslog( LOG_ERR, "cap_from_text() failed: %m" );
				exit(-1);
			}
			if( cap_set_proc( caps ) == -1 ) {
				msyslog( LOG_ERR, "cap_set_proc() failed to drop root privileges: %m" );
				exit(-1);
			}
			cap_free( caps );
		} while(0);
#endif /* HAVE_LINUX_CAPABILITIES */

	}    /* if( droproot ) */
#endif /* HAVE_DROPROOT */

	/*
	 * Use select() on all on all input fd's for unlimited
	 * time.  select() will terminate on SIGALARM or on the
	 * reception of input.	Using select() means we can't do
	 * robust signal handling and we get a potential race
	 * between checking for alarms and doing the select().
	 * Mostly harmless, I think.
	 */
	/* On VMS, I suspect that select() can't be interrupted
	 * by a "signal" either, so I take the easy way out and
	 * have select() time out after one second.
	 * System clock updates really aren't time-critical,
	 * and - lacking a hardware reference clock - I have
	 * yet to learn about anything else that is.
	 */
#if defined(HAVE_IO_COMPLETION_PORT)

	for (;;) {
		GetReceivedBuffers();
#else /* normal I/O */

	BLOCK_IO_AND_ALARM();
	was_alarmed = 0;
	for (;;)
	{
# if !defined(HAVE_SIGNALED_IO)
		extern fd_set activefds;
		extern int maxactivefd;

		fd_set rdfdes;
		int nfound;
# endif

		if (alarm_flag)		/* alarmed? */
		{
			was_alarmed = 1;
			alarm_flag = 0;
		}

		if (!was_alarmed && has_full_recv_buffer() == ISC_FALSE)
		{
			/*
			 * Nothing to do.  Wait for something.
			 */
# ifndef HAVE_SIGNALED_IO
			rdfdes = activefds;
#  if defined(VMS) || defined(SYS_VXWORKS)
			/* make select() wake up after one second */
			{
				struct timeval t1;

				t1.tv_sec = 1; t1.tv_usec = 0;
				nfound = select(maxactivefd+1, &rdfdes, (fd_set *)0,
						(fd_set *)0, &t1);
			}
#  else
			nfound = select(maxactivefd+1, &rdfdes, (fd_set *)0,
					(fd_set *)0, (struct timeval *)0);
#  endif /* VMS */
			if (nfound > 0)
			{
				l_fp ts;

				get_systime(&ts);

				(void)input_handler(&ts);
			}
			else if (nfound == -1 && errno != EINTR)
				msyslog(LOG_ERR, "select() error: %m");
#  ifdef DEBUG
			else if (debug > 5)
				msyslog(LOG_DEBUG, "select(): nfound=%d, error: %m", nfound);
#  endif /* DEBUG */
# else /* HAVE_SIGNALED_IO */

			wait_for_signal();
# endif /* HAVE_SIGNALED_IO */
			if (alarm_flag)		/* alarmed? */
			{
				was_alarmed = 1;
				alarm_flag = 0;
			}
		}

		if (was_alarmed)
		{
			UNBLOCK_IO_AND_ALARM();
			/*
			 * Out here, signals are unblocked.  Call timer routine
			 * to process expiry.
			 */
			timer();
			was_alarmed = 0;
			BLOCK_IO_AND_ALARM();
		}

#endif /* ! HAVE_IO_COMPLETION_PORT */

#ifdef DEBUG_TIMING
		{
			l_fp pts;
			l_fp tsa, tsb;
			int bufcount = 0;

			get_systime(&pts);
			tsa = pts;
#endif
			rbuf = get_full_recv_buffer();
			while (rbuf != NULL)
			{
				if (alarm_flag)
				{
					was_alarmed = 1;
					alarm_flag = 0;
				}
				UNBLOCK_IO_AND_ALARM();

				if (was_alarmed)
				{	/* avoid timer starvation during lengthy I/O handling */
					timer();
					was_alarmed = 0;
				}

				/*
				 * Call the data procedure to handle each received
				 * packet.
				 */
				if (rbuf->receiver != NULL)	/* This should always be true */
				{
#ifdef DEBUG_TIMING
					l_fp dts = pts;

					L_SUB(&dts, &rbuf->recv_time);
					DPRINTF(2, ("processing timestamp delta %s (with prec. fuzz)\n", lfptoa(&dts, 9)));
					collect_timing(rbuf, "buffer processing delay", 1, &dts);
					bufcount++;
#endif
					(rbuf->receiver)(rbuf);
				} else {
					msyslog(LOG_ERR, "receive buffer corruption - receiver found to be NULL - ABORTING");
					abort();
				}

				BLOCK_IO_AND_ALARM();
				freerecvbuf(rbuf);
				rbuf = get_full_recv_buffer();
			}
#ifdef DEBUG_TIMING
			get_systime(&tsb);
			L_SUB(&tsb, &tsa);
			if (bufcount) {
				collect_timing(NULL, "processing", bufcount, &tsb);
				DPRINTF(2, ("processing time for %d buffers %s\n", bufcount, lfptoa(&tsb, 9)));
			}
		}
#endif

		/*
		 * Go around again
		 */

#ifdef HAVE_DNSREGISTRATION
		if (mdnsreg && (current_time - mdnsreg ) > 60 && mdnstries && sys_leap != LEAP_NOTINSYNC) {
			mdnsreg = current_time;
			msyslog(LOG_INFO, "Attempting to register mDNS");
			if ( DNSServiceRegister (&mdns, 0, 0, NULL, "_ntp._udp", NULL, NULL, 
			    htons(NTP_PORT), 0, NULL, NULL, NULL) != kDNSServiceErr_NoError ) {
				if (!--mdnstries) {
					msyslog(LOG_ERR, "Unable to register mDNS, giving up.");
				} else {	
					msyslog(LOG_INFO, "Unable to register mDNS, will try later.");
				}
			} else {
				msyslog(LOG_INFO, "mDNS service registered.");
				mdnsreg = 0;
			}
		}
#endif /* HAVE_DNSREGISTRATION */

	}
	UNBLOCK_IO_AND_ALARM();
	return 1;
}


#ifdef SIGDIE2
/*
 * finish - exit gracefully
 */
static RETSIGTYPE
finish(
	int sig
	)
{
	msyslog(LOG_NOTICE, "ntpd exiting on signal %d", sig);
#ifdef HAVE_DNSREGISTRATION
	if (mdns != NULL)
		DNSServiceRefDeallocate(mdns);
#endif
	switch (sig) {
# ifdef SIGBUS
	case SIGBUS:
		printf("\nfinish(SIGBUS)\n");
		exit(0);
# endif
	case 0:			/* Should never happen... */
		return;

	default:
		exit(0);
	}
}
#endif	/* SIGDIE2 */


/* assertion_failed
 * Redirect trap messages from ISC libraries to syslog.
 * This code was cloned and simplified from BIND.
 */

/*
 * assertion_failed - Handle assertion failures.
 */

static void
assertion_failed(const char *file, int line, isc_assertiontype_t type,
                 const char *cond)
{
	isc_assertion_setcallback(NULL);    /* Avoid recursion */

	msyslog(LOG_ERR, "%s:%d: %s(%s) failed",
		file, line, isc_assertion_typetotext(type), cond);
	msyslog(LOG_ERR, "exiting (due to assertion failure)");

	abort();
}

/*
 * library_fatal_error - Handle fatal errors from our libraries.
 */

static void
library_fatal_error(const char *file, int line, const char *format,
                    va_list args)
{
	char errbuf[256];

	isc_error_setfatal(NULL);  /* Avoid recursion */

	msyslog(LOG_ERR, "%s:%d: fatal error:", file, line);
	vsnprintf(errbuf, sizeof(errbuf), format, args);
	msyslog(LOG_ERR, errbuf);
	msyslog(LOG_ERR, "exiting (due to fatal error in library)");

	abort();
}

/*
 * library_unexpected_error - Handle non fatal errors from our libraries.
 */
#define MAX_UNEXPECTED_ERRORS 100
int unexpected_error_cnt = 0;
static void
library_unexpected_error(const char *file, int line, const char *format,
                         va_list args)
{
	char errbuf[256];

	if (unexpected_error_cnt >= MAX_UNEXPECTED_ERRORS)
		return;	/* avoid clutter in log */

	msyslog(LOG_ERR, "%s:%d: unexpected error:", file, line);
	vsnprintf(errbuf, sizeof(errbuf), format, args);
	msyslog(LOG_ERR, errbuf);

	if (++unexpected_error_cnt == MAX_UNEXPECTED_ERRORS)
	{
		msyslog(LOG_ERR, "Too many errors.  Shutting up.");
	}

}


#ifdef DEBUG
#ifndef SYS_WINNT
/*
 * moredebug - increase debugging verbosity
 */
static RETSIGTYPE
moredebug(
	int sig
	)
{
	int saved_errno = errno;

	if (debug < 255)
	{
		debug++;
		msyslog(LOG_DEBUG, "debug raised to %d", debug);
	}
	errno = saved_errno;
}

/*
 * lessdebug - decrease debugging verbosity
 */
static RETSIGTYPE
lessdebug(
	int sig
	)
{
	int saved_errno = errno;

	if (debug > 0)
	{
		debug--;
		msyslog(LOG_DEBUG, "debug lowered to %d", debug);
	}
	errno = saved_errno;
}
#endif
#else /* not DEBUG */
#ifndef SYS_WINNT
/*
 * no_debug - We don't do the debug here.
 */
static RETSIGTYPE
no_debug(
	int sig
	)
{
	int saved_errno = errno;

	msyslog(LOG_DEBUG, "ntpd not compiled for debugging (signal %d)", sig);
	errno = saved_errno;
}
#endif  /* not SYS_WINNT */
#endif	/* not DEBUG */
ntp-4.2.6p5/ntpd/refclock_fg.c0000644000175000017500000001741111307651603015174 0ustar  peterpeter/*
 * refclock_fg - clock driver for the Forum Graphic GPS datating station
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_FG)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_calendar.h"
#include "ntp_stdlib.h"

/*
 * This driver supports the Forum Graphic GPS dating station.
 * More information about FG GPS is available on http://www.forumgraphic.com
 * Contact das@amt.ru for any question about this driver.
 */

/*
 * Interface definitions
 */
#define	DEVICE		"/dev/fgclock%d"
#define	PRECISION	(-10)	/* precision assumed (about 1 ms) */
#define REFID		"GPS"
#define DESCRIPTION	"Forum Graphic GPS dating station"
#define LENFG		26	/* timecode length */
#define SPEED232        B9600   /* uart speed (9600 baud) */

/*
 * Function prototypes
 */
static	int 	fg_init 	(int);
static	int 	fg_start 	(int, struct peer *);
static	void	fg_shutdown	(int, struct peer *);
static	void	fg_poll		(int, struct peer *);
static  void    fg_receive	(struct recvbuf *);

/* 
 * Forum Graphic unit control structure
 */

struct fgunit {
       int pollnum;	/* Use peer.poll instead? */
       int status; 	/* Hug to check status information on GPS */
       int y2kwarn;		/* Y2K bug */
};

/* 
 * Queries definition
 */
static char fginit[] = { 0x10, 0x48, 0x10, 0x0D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0 };
static char fgdate[] = { 0x10, 0x44, 0x10, 0x0D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0 };

/*
 * Transfer vector
 */
struct  refclock refclock_fg = {
	fg_start,              /* start up driver */
	fg_shutdown,           /* shut down driver */
	fg_poll,               /* transmit poll message */
	noentry,                /* not used */
	noentry,                /* initialize driver (not used) */
	noentry,                /* not used */
	NOFLAGS                 /* not used */
};

/*
 * fg_init - Initialization of FG GPS.
 */

static int
fg_init(
       int fd
       )
{
	if (write(fd, fginit, LENFG) != LENFG)
                return 0;

	return (1);

}

/*
 * fg_start - open the device and initialize data for processing
 */
static int
fg_start(
     	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	struct fgunit *up;
	int fd;
	char device[20];


	/*
	 * Open device file for reading.
	 */
	(void)sprintf(device, DEVICE, unit);

#ifdef DEBUG
	if (debug)
		printf ("starting FG with device %s\n",device);
#endif
	 if (!(fd = refclock_open(device, SPEED232, LDISC_CLK)))
                return (0);
	
        /*
         * Allocate and initialize unit structure
         */

	if (!(up = (struct fgunit *)
              emalloc(sizeof(struct fgunit)))) {
                (void) close(fd);
                return (0);
        }
	memset((char *)up, 0, sizeof(struct fgunit));
	pp = peer->procptr;
	pp->unitptr = (caddr_t)up;
	pp->io.clock_recv = fg_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
 	if (!io_addclock(&pp->io)) {
                (void) close(fd);
                return (0);
        }

	
	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 3);
	up->pollnum = 0;
	
	/* 
	 * Setup dating station to use GPS receiver.
	 * GPS receiver should work before this operation.
         */
	if(!fg_init(pp->io.fd))
		refclock_report(peer, CEVNT_FAULT);

	return (1);
}


/*
 * fg_shutdown - shut down the clock
 */
static void
fg_shutdown(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	struct fgunit *up;
	
	pp = peer->procptr;
	up = (struct fgunit *)pp->unitptr;
        io_closeclock(&pp->io);
	free(up);
}


/*
 * fg_poll - called by the transmit procedure
 */
static void
fg_poll(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	
	pp = peer->procptr;

	 /*
         * Time to poll the clock. The FG clock responds to a
         * "D" by returning a timecode in the format specified
         * above. If nothing is heard from the clock for two polls,
         * declare a timeout and keep going.
         */

	if (write(pp->io.fd, fgdate, LENFG) != LENFG)
                refclock_report(peer, CEVNT_FAULT);
        else
                pp->polls++;

        if (peer->burst > 0)
                return;
	/*
        if (pp->coderecv == pp->codeproc) {
                refclock_report(peer, CEVNT_TIMEOUT);
                return;
        }
	*/
        peer->burst = NSTAGE;

        record_clock_stats(&peer->srcadr, pp->a_lastcode);
        
	
	return;

}

/*
 * fg_receive - receive data from the serial interface
 */
static void
fg_receive(
        struct recvbuf *rbufp
        )
{
        struct refclockproc *pp;
	struct fgunit *up;
        struct peer *peer;
	char *bpt;

        /*
         * Initialize pointers and read the timecode and timestamp
	 * We can't use gtlin function because we need bynary data in buf */

        peer = (struct peer *)rbufp->recv_srcclock;
        pp = peer->procptr;
        up = (struct fgunit *)pp->unitptr;

	/*
         * Below hug to implement receiving of status information
         */
	if(!up->pollnum)
	{
		up->pollnum++;
		return;
	}

	
	if (rbufp->recv_length < (LENFG-2))
	{
		refclock_report(peer, CEVNT_BADREPLY);
            	return; /* The reply is invalid discard it. */
	}

	/* Below I trying to find a correct reply in buffer.
	 * Sometime GPS reply located in the beginnig of buffer,
	 * sometime you can find it with some offset.
	 */

	bpt = (char *)rbufp->recv_space.X_recv_buffer;
	while(*bpt != '')
		bpt++;

#define BP2(x) ( bpt[x] & 15 )
#define BP1(x) (( bpt[x] & 240 ) >> 4)
	
        pp->year = BP1(2)*10 + BP2(2);
	
	if(pp->year == 94)
	{
		refclock_report(peer, CEVNT_BADREPLY);
		if(!fg_init(pp->io.fd))
			refclock_report(peer, CEVNT_FAULT);
            	return;
		 /* GPS is just powered up. The date is invalid -
		 discarding it. Initilize GPS one more time */
		/* Sorry - this driver will broken in 2094 ;) */
	}	
	
	if (pp->year < 99)
                pp->year += 100;

        pp->year +=  1900;
        pp->day = 100 * BP2(3) + 10 * BP1(4) + BP2(4);

/*
   After Jan, 10 2000 Forum Graphic GPS receiver had a very strange
   benahour. It doubles day number for an hours in replys after 10:10:10 UTC
   and doubles min every hour at HH:10:ss for a minute.
   Hope it is a problem of my unit only and not a Y2K problem of FG GPS. 
   Below small code to avoid such situation.
*/
	if(up->y2kwarn > 10)
        	pp->hour = BP1(6)*10 + BP2(6);
	else
        	pp->hour = BP1(5)*10 + BP2(5);

	if((up->y2kwarn > 10) && (pp->hour == 10))
	{
        	pp->minute = BP1(7)*10 + BP2(7);
        	pp->second = BP1(8)*10 + BP2(8);
        	pp->nsec = (BP1(9)*10 + BP2(9)) * 1000000;
        	pp->nsec += BP1(10) * 1000;
	} else {
        	pp->hour = BP1(5)*10 + BP2(5);
        	pp->minute = BP1(6)*10 + BP2(6);
        	pp->second = BP1(7)*10 + BP2(7);
        	pp->nsec = (BP1(8)*10 + BP2(8)) * 1000000;
        	pp->nsec += BP1(9) * 1000;
	}
        
	if((pp->hour == 10) && (pp->minute == 10))
	{
		up->y2kwarn++;
	}

	sprintf(pp->a_lastcode, "%d %d %d %d %d", pp->year, pp->day, pp->hour, pp->minute, pp->second);
	pp->lencode = strlen(pp->a_lastcode);
        /*get_systime(&pp->lastrec);*/

#ifdef DEBUG
        if (debug)
                printf ("fg: time is %04d/%03d %02d:%02d:%02d UTC\n",
                         pp->year, pp->day, pp->hour, pp->minute, pp->second);
#endif
        pp->disp =  (10e-6);
	pp->lastrec = rbufp->recv_time; /* Is it better than get_systime()? */
	/* pp->leap = LEAP_NOWARNING; */

        /*
         * Process the new sample in the median filter and determine the
         * timecode timestamp.
         */

        if (!refclock_process(pp))
                refclock_report(peer, CEVNT_BADTIME);
        pp->lastref = pp->lastrec;
	refclock_receive(peer);
	return;
}


#else
int refclock_fg_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/ntp_scanner.c0000644000175000017500000003173311505336022015240 0ustar  peterpeter
/* ntp_scanner.c
 *
 * The source code for a simple lexical analyzer. 
 *
 * Written By:	Sachin Kamboj
 *		University of Delaware
 *		Newark, DE 19711
 * Copyright (c) 2006
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#include 
#include 
#include 
#include 
#include 

#include "ntp_config.h"
#include "ntpsim.h"
#include "ntp_scanner.h"
#include "ntp_parser.h"
#include "ntp_debug.h"

/* ntp_keyword.h declares finite state machine and token text */
#include "ntp_keyword.h"



/* SCANNER GLOBAL VARIABLES 
 * ------------------------
 */

#define MAX_LEXEME (1024 + 1)	/* The maximum size of a lexeme */
char yytext[MAX_LEXEME];	/* Buffer for storing the input text/lexeme */
extern int input_from_file;




/* CONSTANTS 
 * ---------
 */


/* SCANNER GLOBAL VARIABLES 
 * ------------------------
 */
const char special_chars[] = "{}(),;|=";


/* FUNCTIONS
 * ---------
 */

int get_next_char(void);
static int is_keyword(char *lexeme, follby *pfollowedby);



/*
 * keyword() - Return the keyword associated with token T_ identifier.
 *	       See also token_name() for the string-ized T_ identifier.
 *	       Example: keyword(T_Server) returns "server"
 *			token_name(T_Server) returns "T_Server"
 */
const char *
keyword(
	int token
	)
{
	int i;
	const char *text;

	i = token - LOWEST_KEYWORD_ID;

	if (i >= 0 && i < COUNTOF(keyword_text))
		text = keyword_text[i];
	else
		text = NULL;

	return (text != NULL)
		   ? text
		   : "(keyword not found)";
}


/* FILE INTERFACE
 * --------------
 * We define a couple of wrapper functions around the standard C fgetc
 * and ungetc functions in order to include positional bookkeeping
 */

struct FILE_INFO *
F_OPEN(
	const char *path,
	const char *mode
	)
{
	struct FILE_INFO *my_info;

	my_info = emalloc(sizeof *my_info);

	my_info->line_no = 1;
	my_info->col_no = 0;
	my_info->prev_line_col_no = 0;
	my_info->prev_token_col_no = 0;
	my_info->fname = path;

	my_info->fd = fopen(path, mode);
	if (NULL == my_info->fd) {
		free(my_info);
		return NULL;
	}
	return my_info;
}

int
FGETC(
	struct FILE_INFO *stream
	)
{
	int ch = fgetc(stream->fd);

	++stream->col_no;
	if (ch == '\n') {
		stream->prev_line_col_no = stream->col_no;
		++stream->line_no;
		stream->col_no = 1;
	}
	return ch;
}

/* BUGS: 1. Function will fail on more than one line of pushback
 *       2. No error checking is done to see if ungetc fails
 * SK: I don't think its worth fixing these bugs for our purposes ;-)
 */
int
UNGETC(
	int ch,
	struct FILE_INFO *stream
	)
{
	if (ch == '\n') {
		stream->col_no = stream->prev_line_col_no;
		stream->prev_line_col_no = -1;
		--stream->line_no;
	}
	--stream->col_no;
	return ungetc(ch, stream->fd);
}

int
FCLOSE(
	struct FILE_INFO *stream
	)
{
	int ret_val = fclose(stream->fd);

	if (!ret_val)
		free(stream);
	return ret_val;
}

/* STREAM INTERFACE 
 * ----------------
 * Provide a wrapper for the stream functions so that the
 * stream can either read from a file or from a character
 * array. 
 * NOTE: This is not very efficient for reading from character
 * arrays, but needed to allow remote configuration where the
 * configuration command is provided through ntpq.
 * 
 * The behavior of there two functions is determined by the 
 * input_from_file flag.
 */

int
get_next_char(
	void
	)
{
	char ch;

	if (input_from_file)
		return FGETC(ip_file);
	else {
		if (remote_config.buffer[remote_config.pos] == '\0') 
			return EOF;
		else {
			ip_file->col_no++;
			ch = remote_config.buffer[remote_config.pos++];
			if (ch == '\n') {
				ip_file->prev_line_col_no = ip_file->col_no;
				++ip_file->line_no;
				ip_file->col_no = 1;
			}
			return ch;
		}
	}
}

void
push_back_char(
	int ch
	)
{
	if (input_from_file)
		UNGETC(ch, ip_file);
	else {
		if (ch == '\n') {
			ip_file->col_no = ip_file->prev_line_col_no;
			ip_file->prev_line_col_no = -1;
			--ip_file->line_no;
		}
		--ip_file->col_no;

		remote_config.pos--;
	}
}

 

/* STATE MACHINES 
 * --------------
 */

/* Keywords */
static int
is_keyword(
	char *lexeme,
	follby *pfollowedby
	)
{
	follby fb;
	int curr_s;		/* current state index */
	int token;
	int i;

	curr_s = SCANNER_INIT_S;
	token = 0;

	for (i = 0; lexeme[i]; i++) {
		while (curr_s && (lexeme[i] != SS_CH(sst[curr_s])))
			curr_s = SS_OTHER_N(sst[curr_s]);

		if (curr_s && (lexeme[i] == SS_CH(sst[curr_s]))) {
			if ('\0' == lexeme[i + 1]
			    && FOLLBY_NON_ACCEPTING 
			       != SS_FB(sst[curr_s])) {
				fb = SS_FB(sst[curr_s]);
				*pfollowedby = fb;
				token = curr_s;
				break;
			}
			curr_s = SS_MATCH_N(sst[curr_s]);
		} else
			break;
	}

	return token;
}


/* Integer */
static int
is_integer(
	char *lexeme
	)
{
	int i = 0;

	/* Allow a leading minus sign */
	if (lexeme[i] == '-')
		++i;

	/* Check that all the remaining characters are digits */
	for (; lexeme[i]; ++i) {
		if (!isdigit(lexeme[i]))
			return 0;
	}
	return 1;
}


/* Double */
static int
is_double(
	char *lexeme
	)
{
	u_int num_digits = 0;  /* Number of digits read */
	u_int i;

	i = 0;

	/* Check for an optional '+' or '-' */
	if ('+' == lexeme[i] || '-' == lexeme[i])
		i++;

	/* Read the integer part */
	for (; lexeme[i] && isdigit(lexeme[i]); i++)
		num_digits++;

	/* Check for the required decimal point */
	if ('.' == lexeme[i])
		i++;
	else
		return 0;

	/* Check for any digits after the decimal point */
	for (; lexeme[i] && isdigit(lexeme[i]); i++)
		num_digits++;

	/*
	 * The number of digits in both the decimal part and the
	 * fraction part must not be zero at this point 
	 */
	if (!num_digits)
		return 0;

	/* Check if we are done */
	if (!lexeme[i])
		return 1;

	/* There is still more input, read the exponent */
	if ('e' == tolower(lexeme[i]))
		i++;
	else
		return 0;

	/* Read an optional Sign */
	if ('+' == lexeme[i] || '-' == lexeme[i])
		i++;

	/* Now read the exponent part */
	while (lexeme[i] && isdigit(lexeme[i]))
		i++;

	/* Check if we are done */
	if (!lexeme[i])
		return 1;
	else
		return 0;
}


/* is_special() - Test whether a character is a token */
static inline int
is_special(
	int ch
	)
{
	return (int)strchr(special_chars, ch);
}


static int
is_EOC(
	int ch
	)
{
	if ((old_config_style && (ch == '\n')) ||
	    (!old_config_style && (ch == ';')))
		return 1;
	return 0;
}


char *
quote_if_needed(char *str)
{
	char *ret;
	size_t len;
	size_t octets;

	len = strlen(str);
	octets = len + 2 + 1;
	ret = emalloc(octets);
	if ('"' != str[0] 
	    && (strcspn(str, special_chars) < len 
		|| strchr(str, ' ') != NULL)) {
		snprintf(ret, octets, "\"%s\"", str);
	} else
		strncpy(ret, str, octets);

	return ret;
}


static int
create_string_token(
	char *lexeme
	)
{
	char *pch;

	/*
	 * ignore end of line whitespace
	 */
	pch = lexeme;
	while (*pch && isspace(*pch))
		pch++;

	if (!*pch) {
		yylval.Integer = T_EOC;
		return yylval.Integer;
	}

	yylval.String = estrdup(lexeme);
	return T_String;
}


/*
 * yylex() - function that does the actual scanning.
 * Bison expects this function to be called yylex and for it to take no
 * input and return an int.
 * Conceptually yylex "returns" yylval as well as the actual return
 * value representing the token or type.
 */
int
yylex(
	void
	)
{
	int i, instring = 0;
	int yylval_was_set = 0;
	int token;		/* The return value/the recognized token */
	int ch;
	static follby followedby = FOLLBY_TOKEN;

	do {
		/* Ignore whitespace at the beginning */
		while (EOF != (ch = get_next_char()) &&
		       isspace(ch) &&
		       !is_EOC(ch))
			; /* Null Statement */

		if (EOF == ch) {

			if (!input_from_file || !curr_include_level) 
				return 0;

			FCLOSE(fp[curr_include_level]);
			ip_file = fp[--curr_include_level];
			token = T_EOC;
			goto normal_return;

		} else if (is_EOC(ch)) {

			/* end FOLLBY_STRINGS_TO_EOC effect */
			followedby = FOLLBY_TOKEN;
			token = T_EOC;
			goto normal_return;

		} else if (is_special(ch) && FOLLBY_TOKEN == followedby) {
			/* special chars are their own token values */
			token = ch;
			/*
			 * '=' implies a single string following as in:
			 * setvar Owner = "The Boss" default
			 * This could alternatively be handled by
			 * removing '=' from special_chars and adding
			 * it to the keyword table.
			 */
			if ('=' == ch)
				followedby = FOLLBY_STRING;
			yytext[0] = (char)ch;
			yytext[1] = '\0';
			goto normal_return;
		} else
			push_back_char(ch);

		/* save the position of start of the token */
		ip_file->prev_token_line_no = ip_file->line_no;
		ip_file->prev_token_col_no = ip_file->col_no;

		/* Read in the lexeme */
		i = 0;
		while (EOF != (ch = get_next_char())) {

			yytext[i] = (char)ch;

			/* Break on whitespace or a special character */
			if (isspace(ch) || is_EOC(ch) 
			    || '"' == ch
			    || (FOLLBY_TOKEN == followedby
				&& is_special(ch)))
				break;

			/* Read the rest of the line on reading a start
			   of comment character */
			if ('#' == ch) {
				while (EOF != (ch = get_next_char())
				       && '\n' != ch)
					; /* Null Statement */
				break;
			}

			i++;
			if (i >= COUNTOF(yytext))
				goto lex_too_long;
		}
		/* Pick up all of the string inside between " marks, to
		 * end of line.  If we make it to EOL without a
		 * terminating " assume it for them.
		 *
		 * XXX - HMS: I'm not sure we want to assume the closing "
		 */
		if ('"' == ch) {
			instring = 1;
			while (EOF != (ch = get_next_char()) &&
			       ch != '"' && ch != '\n') {
				yytext[i++] = (char)ch;
				if (i >= COUNTOF(yytext))
					goto lex_too_long;
			}
			/*
			 * yytext[i] will be pushed back as not part of
			 * this lexeme, but any closing quote should
			 * not be pushed back, so we read another char.
			 */
			if ('"' == ch)
				ch = get_next_char();
		}
		/* Pushback the last character read that is not a part
		 * of this lexeme.
		 * If the last character read was an EOF, pushback a
		 * newline character. This is to prevent a parse error
		 * when there is no newline at the end of a file.
		 */
		if (EOF == ch)
			push_back_char('\n');
		else
			push_back_char(ch); 
		yytext[i] = '\0';
	} while (i == 0);

	/* Now return the desired token */
	
	/* First make sure that the parser is *not* expecting a string
	 * as the next token (based on the previous token that was
	 * returned) and that we haven't read a string.
	 */
	
	if (followedby == FOLLBY_TOKEN && !instring) {
		token = is_keyword(yytext, &followedby);
		if (token)
			goto normal_return;
		else if (is_integer(yytext)) {
			yylval_was_set = 1;
			errno = 0;
			if ((yylval.Integer = strtol(yytext, NULL, 10)) == 0
			    && ((errno == EINVAL) || (errno == ERANGE))) {
				msyslog(LOG_ERR, 
					"Integer cannot be represented: %s",
					yytext);
				exit(1);
			} else {
				token = T_Integer;
				goto normal_return;
			}
		}
		else if (is_double(yytext)) {
			yylval_was_set = 1;
			errno = 0;
			if ((yylval.Double = atof(yytext)) == 0 && errno == ERANGE) {
				msyslog(LOG_ERR,
					"Double too large to represent: %s",
					yytext);
				exit(1);
			} else {
				token = T_Double;
				goto normal_return;
			}
		} else {
			/* Default: Everything is a string */
			yylval_was_set = 1;
			token = create_string_token(yytext);
			goto normal_return;
		}
	}

	/*
	 * Either followedby is not FOLLBY_TOKEN or this lexeme is part
	 * of a string.  Hence, we need to return T_String.
	 * 
	 * _Except_ we might have a -4 or -6 flag on a an association
	 * configuration line (server, peer, pool, etc.).
	 *
	 * This is a terrible hack, but the grammar is ambiguous so we
	 * don't have a choice.  [SK]
	 *
	 * The ambiguity is in the keyword scanner, not ntp_parser.y.
	 * We do not require server addresses be quoted in ntp.conf,
	 * complicating the scanner's job.  To avoid trying (and
	 * failing) to match an IP address or DNS name to a keyword,
	 * the association keywords use FOLLBY_STRING in the keyword
	 * table, which tells the scanner to force the next token to be
	 * a T_String, so it does not try to match a keyword but rather
	 * expects a string when -4/-6 modifiers to server, peer, etc.
	 * are encountered.
	 * restrict -4 and restrict -6 parsing works correctly without
	 * this hack, as restrict uses FOLLBY_TOKEN.  [DH]
	 */
	if ('-' == yytext[0]) {
		if ('4' == yytext[1]) {
			token = T_Ipv4_flag;
			goto normal_return;
		} else if ('6' == yytext[1]) {
			token = T_Ipv6_flag;
			goto normal_return;
		}
	}

	instring = 0;
	if (FOLLBY_STRING == followedby)
		followedby = FOLLBY_TOKEN;

	yylval_was_set = 1;
	token = create_string_token(yytext);

normal_return:
	if (T_EOC == token)
		DPRINTF(4,("\t\n"));
	else
		DPRINTF(4, ("yylex: lexeme '%s' -> %s\n", yytext,
			    token_name(token)));

	if (!yylval_was_set)
		yylval.Integer = token;

	return token;

lex_too_long:
	yytext[min(sizeof(yytext) - 1, 50)] = 0;
	msyslog(LOG_ERR, 
		"configuration item on line %d longer than limit of %lu, began with '%s'",
		ip_file->line_no, (u_long)(sizeof(yytext) - 1), yytext);

	/*
	 * If we hit the length limit reading the startup configuration
	 * file, abort.
	 */
	if (input_from_file)
		exit(sizeof(yytext) - 1);

	/*
	 * If it's runtime configuration via ntpq :config treat it as
	 * if the configuration text ended before the too-long lexeme,
	 * hostname, or string.
	 */
	yylval.Integer = 0;
	return 0;
}
ntp-4.2.6p5/ntpd/refclock_shm.c0000644000175000017500000002225711332473277015402 0ustar  peterpeter/*
 * refclock_shm - clock driver for utc via shared memory 
 * - under construction -
 * To add new modes: Extend or union the shmTime-struct. Do not
 * extend/shrink size, because otherwise existing implementations
 * will specify wrong size of shared memory-segment
 * PB 18.3.97
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_SHM)

#include "ntpd.h"
#undef fileno   
#include "ntp_io.h"
#undef fileno   
#include "ntp_refclock.h"
#undef fileno   
#include "ntp_unixtime.h"
#undef fileno   
#include "ntp_stdlib.h"

#undef fileno   
#include 
#undef fileno   

#ifndef SYS_WINNT
# include 
# include 
# include 
# include 
# include 
#endif

/*
 * This driver supports a reference clock attached thru shared memory
 */ 

/* Temp hack to simplify testing of the old mode. */
#define OLDWAY 0

/*
 * SHM interface definitions
 */
#define PRECISION       (-1)    /* precision assumed (0.5 s) */
#define REFID           "SHM"   /* reference ID */
#define DESCRIPTION     "SHM/Shared memory interface"

#define NSAMPLES        3       /* stages of median filter */

/*
 * Function prototypes
 */
static  int     shm_start       (int unit, struct peer *peer);
static  void    shm_shutdown    (int unit, struct peer *peer);
static  void    shm_poll        (int unit, struct peer *peer);
static  void    shm_timer       (int unit, struct peer *peer);
	int	shm_peek	(int unit, struct peer *peer);
	void	shm_clockstats  (int unit, struct peer *peer);

/*
 * Transfer vector
 */
struct  refclock refclock_shm = {
	shm_start,              /* start up driver */
	shm_shutdown,           /* shut down driver */
	shm_poll,		/* transmit poll message */
	noentry,		/* not used: control */
	noentry,		/* not used: init */
	noentry,		/* not used: buginfo */
	shm_timer,              /* once per second */
};

struct shmTime {
	int    mode; /* 0 - if valid set
		      *       use values, 
		      *       clear valid
		      * 1 - if valid set 
		      *       if count before and after read of values is equal,
		      *         use values 
		      *       clear valid
		      */
	int    count;
	time_t clockTimeStampSec;
	int    clockTimeStampUSec;
	time_t receiveTimeStampSec;
	int    receiveTimeStampUSec;
	int    leap;
	int    precision;
	int    nsamples;
	int    valid;
	int    dummy[10]; 
};

struct shmunit {
	struct shmTime *shm;	/* pointer to shared memory segment */

	/* debugging/monitoring counters - reset when printed */
	int ticks;		/* number of attempts to read data*/
	int good;		/* number of valid samples */
	int notready;		/* number of peeks without data ready */
	int bad;		/* number of invalid samples */
	int clash;		/* number of access clashes while reading */
};


struct shmTime *getShmTime(int);

struct shmTime *getShmTime (int unit) {
#ifndef SYS_WINNT
	int shmid=0;

	/* 0x4e545030 is NTP0.
	 * Big units will give non-ascii but that's OK
	 * as long as everybody does it the same way. 
	 */
	shmid=shmget (0x4e545030+unit, sizeof (struct shmTime), 
		      IPC_CREAT|(unit<2?0600:0666));
	if (shmid==-1) { /*error */
		msyslog(LOG_ERR,"SHM shmget (unit %d): %s",unit,strerror(errno));
		return 0;
	}
	else { /* no error  */
		struct shmTime *p=(struct shmTime *)shmat (shmid, 0, 0);
		if ((int)(long)p==-1) { /* error */
			msyslog(LOG_ERR,"SHM shmat (unit %d): %s",unit,strerror(errno));
			return 0;
		}
		return p;
	}
#else
	char buf[10];
	LPSECURITY_ATTRIBUTES psec=0;
	HANDLE shmid=0;
	SECURITY_DESCRIPTOR sd;
	SECURITY_ATTRIBUTES sa;
	snprintf(buf, sizeof(buf), "NTP%d", unit);
	if (unit >= 2) { /* world access */
		if (!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION)) {
			msyslog(LOG_ERR,"SHM InitializeSecurityDescriptor (unit %d): %m",unit);
			return 0;
		}
		if (!SetSecurityDescriptorDacl(&sd,1,0,0)) {
			msyslog(LOG_ERR,"SHM SetSecurityDescriptorDacl (unit %d): %m",unit);
			return 0;
		}
		sa.nLength=sizeof (SECURITY_ATTRIBUTES);
		sa.lpSecurityDescriptor=&sd;
		sa.bInheritHandle=0;
		psec=&sa;
	}
	shmid=CreateFileMapping ((HANDLE)0xffffffff, psec, PAGE_READWRITE,
				 0, sizeof (struct shmTime),buf);
	if (!shmid) { /*error*/
		char buf[1000];
		FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
			       0, GetLastError (), 0, buf, sizeof (buf), 0);
		msyslog(LOG_ERR,"SHM CreateFileMapping (unit %d): %s",unit,buf);
		return 0;
	}
	else {
		struct shmTime *p=(struct shmTime *) MapViewOfFile (shmid, 
								    FILE_MAP_WRITE, 0, 0, sizeof (struct shmTime));
		if (p==0) { /*error*/
			char buf[1000];
			FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
				       0, GetLastError (), 0, buf, sizeof (buf), 0);
			msyslog(LOG_ERR,"SHM MapViewOfFile (unit %d): %s",unit,buf);
			return 0;
		}
		return p;
	}
#endif
}
/*
 * shm_start - attach to shared memory
 */
static int
shm_start(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	struct shmunit *up;

	pp = peer->procptr;
	pp->io.clock_recv = noentry;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = -1;

	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp->unitptr = (caddr_t)up;

	up->shm = getShmTime(unit);

	/*
	 * Initialize miscellaneous peer variables
	 */
	memcpy((char *)&pp->refid, REFID, 4);
	if (up->shm != 0) {
		up->shm->precision = PRECISION;
		peer->precision = up->shm->precision;
		up->shm->valid=0;
		up->shm->nsamples=NSAMPLES;
		pp->clockdesc = DESCRIPTION;
		return (1);
	}
	else {
		return 0;
	}
}


/*
 * shm_shutdown - shut down the clock
 */
static void
shm_shutdown(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	struct shmunit *up;

	pp = peer->procptr;
	up = (struct shmunit *)pp->unitptr;

	if (NULL == up)
		return;
#ifndef SYS_WINNT
	/* HMS: shmdt()wants char* or const void * */
	(void) shmdt ((char *)up->shm);
#else
	UnmapViewOfFile (up->shm);
#endif
	free(up);
}


/*
 * shm_timer - called every second
 */
static  void
shm_timer(int unit, struct peer *peer)
{
	if (OLDWAY)
		return;

	shm_peek(unit, peer);
}


/*
 * shm_poll - called by the transmit procedure
 */
static void
shm_poll(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	int ok;

	pp = peer->procptr;
	
	if (OLDWAY) {
		ok = shm_peek(unit, peer);
		if (!ok) return;
	}

        /*
         * Process median filter samples. If none received, declare a
         * timeout and keep going.
         */
        if (pp->coderecv == pp->codeproc) {
                refclock_report(peer, CEVNT_TIMEOUT);
		shm_clockstats(unit, peer);
                return;
        }
	pp->lastref = pp->lastrec;
	refclock_receive(peer);
	shm_clockstats(unit, peer);
}

/*
 * shm_peek - try to grab a sample
 */
int shm_peek(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	struct shmunit *up;
	struct shmTime *shm;

	/*
	 * This is the main routine. It snatches the time from the shm
	 * board and tacks on a local timestamp.
	 */
	pp = peer->procptr;
	up = (struct shmunit*)pp->unitptr;
	up->ticks++;
	if (up->shm == 0) {
		/* try to map again - this may succeed if meanwhile some-
		body has ipcrm'ed the old (unaccessible) shared mem segment */
		up->shm = getShmTime(unit);
	}
	shm = up->shm;
	if (shm == 0) {
		refclock_report(peer, CEVNT_FAULT);
		return(0);
	}
	if (shm->valid) {
		struct timeval tvr;
		struct timeval tvt;
		struct tm *t;
		int ok=1;
		tvr.tv_sec = 0;
		tvr.tv_usec = 0;
		tvt.tv_sec = 0;
		tvt.tv_usec = 0;
		switch (shm->mode) {
		    case 0: {
			    tvr.tv_sec=shm->receiveTimeStampSec;
			    tvr.tv_usec=shm->receiveTimeStampUSec;
			    tvt.tv_sec=shm->clockTimeStampSec;
			    tvt.tv_usec=shm->clockTimeStampUSec;
		    }
		    break;
		    case 1: {
			    int cnt=shm->count;
			    tvr.tv_sec=shm->receiveTimeStampSec;
			    tvr.tv_usec=shm->receiveTimeStampUSec;
			    tvt.tv_sec=shm->clockTimeStampSec;
			    tvt.tv_usec=shm->clockTimeStampUSec;
			    ok=(cnt==shm->count);
		    }
		    break;
		    default:
			msyslog (LOG_ERR, "SHM: bad mode found in shared memory: %d",shm->mode);
		}
		shm->valid=0;
		if (ok) {
			time_t help;	/* XXX NetBSD has incompatible tv_sec */

			TVTOTS(&tvr,&pp->lastrec);
			pp->lastrec.l_ui += JAN_1970;
			/* pp->lasttime = current_time; */
			pp->polls++;
			help = tvt.tv_sec;
			t = gmtime (&help);
			pp->day=t->tm_yday+1;
			pp->hour=t->tm_hour;
			pp->minute=t->tm_min;
			pp->second=t->tm_sec;
			pp->nsec=tvt.tv_usec * 1000;
			peer->precision=shm->precision;
			pp->leap=shm->leap;
		} 
		else {
			refclock_report(peer, CEVNT_FAULT);
			msyslog (LOG_NOTICE, "SHM: access clash in shared memory");
			up->clash++;
			return(0);
		}
	}
	else {
		refclock_report(peer, CEVNT_TIMEOUT);
		up->notready++;
		return(0);
	}
	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		up->bad++;
		return(0);
	}
	up->good++;
	return(1);
}

/*
 * shm_clockstats - dump and reset counters
 */
void shm_clockstats(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	struct shmunit *up;
	char logbuf[256];

	pp = peer->procptr;
	up = (struct shmunit*)pp->unitptr;

	if (!(pp->sloppyclockflag & CLK_FLAG4)) return;

        snprintf(logbuf, sizeof(logbuf), "%3d %3d %3d %3d %3d",
                up->ticks, up->good, up->notready, up->bad, up->clash);
        record_clock_stats(&peer->srcadr, logbuf);

	up->ticks = up->good = up->notready =up->bad = up->clash = 0;

}

#else
int refclock_shm_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/keyword-gen.c0000644000175000017500000004355311362536523015175 0ustar  peterpeter/*
 * keyword-gen.c -- generate keyword scanner finite state machine and
 *		    keyword_text array.
 *		    This program is run to generate ntp_keyword.h
 */
#include 
#include 
#include 
#include 

#include 
#include 
#include 
#include "ntp_scanner.h"
#include "ntp_parser.h"


#ifdef QSORT_USES_VOID_P
typedef const void *	QSORTP;
#else
typedef char *		QSORTP;
#endif

/* Define a structure to hold a (keyword, token) pair */
struct key_tok {
	char *	key;		/* Keyword */
	int	token;		/* Associated Token */
	follby	followedby;	/* nonzero indicates the next token(s)
				   forced to be string(s) */
};

struct key_tok ntp_keywords[] = {
{ "...",		T_Ellipsis,		FOLLBY_TOKEN },
{ "automax",		T_Automax,		FOLLBY_TOKEN },
{ "broadcast",		T_Broadcast,		FOLLBY_STRING },
{ "broadcastclient",	T_Broadcastclient,	FOLLBY_TOKEN },
{ "broadcastdelay",	T_Broadcastdelay,	FOLLBY_TOKEN },
{ "calldelay",		T_Calldelay,		FOLLBY_TOKEN },
{ "disable",		T_Disable,		FOLLBY_TOKEN },
{ "driftfile",		T_Driftfile,		FOLLBY_STRING },
{ "enable",		T_Enable,		FOLLBY_TOKEN },
{ "end",		T_End,			FOLLBY_TOKEN },
{ "filegen",		T_Filegen,		FOLLBY_TOKEN },
{ "fudge",		T_Fudge,		FOLLBY_STRING },
{ "includefile",	T_Includefile,		FOLLBY_STRING },
{ "leapfile",		T_Leapfile,		FOLLBY_STRING },
{ "logconfig",		T_Logconfig,		FOLLBY_STRINGS_TO_EOC },
{ "logfile",		T_Logfile,		FOLLBY_STRING },
{ "manycastclient",	T_Manycastclient,	FOLLBY_STRING },
{ "manycastserver",	T_Manycastserver,	FOLLBY_STRINGS_TO_EOC },
{ "multicastclient",	T_Multicastclient,	FOLLBY_STRINGS_TO_EOC },
{ "peer",		T_Peer,			FOLLBY_STRING },
{ "phone",		T_Phone,		FOLLBY_STRINGS_TO_EOC },
{ "pidfile",		T_Pidfile,		FOLLBY_STRING },
{ "pool",		T_Pool,			FOLLBY_STRING },
{ "discard",		T_Discard,		FOLLBY_TOKEN },
{ "restrict",		T_Restrict,		FOLLBY_TOKEN },
{ "server",		T_Server,		FOLLBY_STRING },
{ "setvar",		T_Setvar,		FOLLBY_STRING },
{ "statistics",		T_Statistics,		FOLLBY_TOKEN },
{ "statsdir",		T_Statsdir,		FOLLBY_STRING },
{ "tick",		T_Tick,			FOLLBY_TOKEN },
{ "tinker",		T_Tinker,		FOLLBY_TOKEN },
{ "tos",		T_Tos,			FOLLBY_TOKEN },
{ "trap",		T_Trap,			FOLLBY_STRING },
{ "unconfig",		T_Unconfig,		FOLLBY_STRING },
{ "unpeer",		T_Unpeer,		FOLLBY_STRING },
/* authentication_command */
{ "controlkey",		T_ControlKey,		FOLLBY_TOKEN },
{ "crypto",		T_Crypto,		FOLLBY_TOKEN },
{ "keys",		T_Keys,			FOLLBY_STRING },
{ "keysdir",		T_Keysdir,		FOLLBY_STRING },
{ "ntpsigndsocket",	T_NtpSignDsocket,	FOLLBY_STRING },
{ "requestkey",		T_Requestkey,		FOLLBY_TOKEN },
{ "revoke",		T_Revoke,		FOLLBY_TOKEN },
{ "trustedkey",		T_Trustedkey,		FOLLBY_TOKEN },
/* IPv4/IPv6 protocol override flag */
{ "-4",			T_Ipv4_flag,		FOLLBY_TOKEN },
{ "-6",			T_Ipv6_flag,		FOLLBY_TOKEN },
/* option */
{ "autokey",		T_Autokey,		FOLLBY_TOKEN },
{ "bias",		T_Bias,			FOLLBY_TOKEN },
{ "burst",		T_Burst,		FOLLBY_TOKEN },
{ "iburst",		T_Iburst,		FOLLBY_TOKEN },
{ "key",		T_Key,			FOLLBY_TOKEN },
{ "maxpoll",		T_Maxpoll,		FOLLBY_TOKEN },
{ "minpoll",		T_Minpoll,		FOLLBY_TOKEN },
{ "mode",		T_Mode,			FOLLBY_TOKEN },
{ "noselect",		T_Noselect,		FOLLBY_TOKEN },
{ "preempt",		T_Preempt,		FOLLBY_TOKEN },
{ "true",		T_True,			FOLLBY_TOKEN },
{ "prefer",		T_Prefer,		FOLLBY_TOKEN },
{ "ttl",		T_Ttl,			FOLLBY_TOKEN },
{ "version",		T_Version,		FOLLBY_TOKEN },
{ "xleave",		T_Xleave,		FOLLBY_TOKEN },
/* crypto_command */
{ "host",		T_Host,			FOLLBY_STRING },
{ "ident",		T_Ident,		FOLLBY_STRING },
{ "pw",			T_Pw,			FOLLBY_STRING },
{ "randfile",		T_Randfile,		FOLLBY_STRING },
{ "sign",		T_Sign,			FOLLBY_STRING },
{ "digest",		T_Digest,		FOLLBY_STRING },
/*** MONITORING COMMANDS ***/
/* stat */
{ "clockstats",		T_Clockstats,		FOLLBY_TOKEN },
{ "cryptostats",	T_Cryptostats,		FOLLBY_TOKEN },
{ "loopstats",		T_Loopstats,		FOLLBY_TOKEN },
{ "peerstats",		T_Peerstats,		FOLLBY_TOKEN },
{ "rawstats",		T_Rawstats,		FOLLBY_TOKEN },
{ "sysstats", 		T_Sysstats,		FOLLBY_TOKEN },
{ "protostats",		T_Protostats,		FOLLBY_TOKEN },
{ "timingstats",	T_Timingstats,		FOLLBY_TOKEN },
/* filegen_option */
{ "file",		T_File,			FOLLBY_STRING },
{ "link",		T_Link,			FOLLBY_TOKEN },
{ "nolink",		T_Nolink,		FOLLBY_TOKEN },
{ "type",		T_Type,			FOLLBY_TOKEN },
/* filegen_type */
{ "age",		T_Age,			FOLLBY_TOKEN },
{ "day",		T_Day,			FOLLBY_TOKEN },
{ "month",		T_Month,		FOLLBY_TOKEN },
{ "none",		T_None,			FOLLBY_TOKEN },
{ "pid",		T_Pid,			FOLLBY_TOKEN },
{ "week",		T_Week,			FOLLBY_TOKEN },
{ "year",		T_Year,			FOLLBY_TOKEN },
/*** ORPHAN MODE COMMANDS ***/
/* tos_option */
{ "minclock",		T_Minclock,		FOLLBY_TOKEN },
{ "maxclock",		T_Maxclock,		FOLLBY_TOKEN },
{ "minsane",		T_Minsane,		FOLLBY_TOKEN },
{ "floor",		T_Floor,		FOLLBY_TOKEN },
{ "ceiling",		T_Ceiling,		FOLLBY_TOKEN },
{ "cohort",		T_Cohort,		FOLLBY_TOKEN },
{ "mindist",		T_Mindist,		FOLLBY_TOKEN },
{ "maxdist",		T_Maxdist,		FOLLBY_TOKEN },
{ "beacon",		T_Beacon,		FOLLBY_TOKEN },
{ "orphan",		T_Orphan,		FOLLBY_TOKEN },
/* access_control_flag */
{ "default",		T_Default,		FOLLBY_TOKEN },
{ "flake",		T_Flake,		FOLLBY_TOKEN },
{ "ignore",		T_Ignore,		FOLLBY_TOKEN },
{ "limited",		T_Limited,		FOLLBY_TOKEN },
{ "mssntp",		T_Mssntp,		FOLLBY_TOKEN },
{ "kod",		T_Kod,			FOLLBY_TOKEN },
{ "lowpriotrap",	T_Lowpriotrap,		FOLLBY_TOKEN },
{ "mask",		T_Mask,			FOLLBY_TOKEN },
{ "nomodify",		T_Nomodify,		FOLLBY_TOKEN },
{ "nopeer",		T_Nopeer,		FOLLBY_TOKEN },
{ "noquery",		T_Noquery,		FOLLBY_TOKEN },
{ "noserve",		T_Noserve,		FOLLBY_TOKEN },
{ "notrap",		T_Notrap,		FOLLBY_TOKEN },
{ "notrust",		T_Notrust,		FOLLBY_TOKEN },
{ "ntpport",		T_Ntpport,		FOLLBY_TOKEN },
/* discard_option */
{ "average",		T_Average,		FOLLBY_TOKEN },
{ "minimum",		T_Minimum,		FOLLBY_TOKEN },
{ "monitor",		T_Monitor,		FOLLBY_TOKEN },
/* fudge_factor */
{ "flag1",		T_Flag1,		FOLLBY_TOKEN },
{ "flag2",		T_Flag2,		FOLLBY_TOKEN },
{ "flag3",		T_Flag3,		FOLLBY_TOKEN },
{ "flag4",		T_Flag4,		FOLLBY_TOKEN },
{ "refid",		T_Refid,		FOLLBY_STRING },
{ "stratum",		T_Stratum,		FOLLBY_TOKEN },
{ "time1",		T_Time1,		FOLLBY_TOKEN },
{ "time2",		T_Time2,		FOLLBY_TOKEN },
/* system_option */
{ "auth",		T_Auth,			FOLLBY_TOKEN },
{ "bclient",		T_Bclient,		FOLLBY_TOKEN },
{ "calibrate",		T_Calibrate,		FOLLBY_TOKEN },
{ "kernel",		T_Kernel,		FOLLBY_TOKEN },
{ "ntp",		T_Ntp,			FOLLBY_TOKEN },
{ "stats",		T_Stats,		FOLLBY_TOKEN },
/* tinker_option */
{ "step",		T_Step,			FOLLBY_TOKEN },
{ "panic",		T_Panic,		FOLLBY_TOKEN },
{ "dispersion",		T_Dispersion,		FOLLBY_TOKEN },
{ "stepout",		T_Stepout,		FOLLBY_TOKEN },
{ "allan",		T_Allan,		FOLLBY_TOKEN },
{ "huffpuff",		T_Huffpuff,		FOLLBY_TOKEN },
{ "freq",		T_Freq,			FOLLBY_TOKEN },
/* miscellaneous_command */
{ "port",		T_Port,			FOLLBY_TOKEN },
{ "interface",		T_Interface,		FOLLBY_TOKEN },
{ "qos",		T_Qos,			FOLLBY_TOKEN },
{ "saveconfigdir",	T_Saveconfigdir,	FOLLBY_STRING },
/* interface_command (ignore and interface already defined) */
{ "nic",		T_Nic,			FOLLBY_TOKEN },
{ "all",		T_All,			FOLLBY_TOKEN },
{ "ipv4",		T_Ipv4,			FOLLBY_TOKEN },
{ "ipv6",		T_Ipv6,			FOLLBY_TOKEN },
{ "wildcard",		T_Wildcard,		FOLLBY_TOKEN },
{ "listen",		T_Listen,		FOLLBY_TOKEN },
{ "drop",		T_Drop,			FOLLBY_TOKEN },
/* simulator commands */
{ "simulate",		T_Simulate,		FOLLBY_TOKEN },
{ "simulation_duration",T_Sim_Duration,		FOLLBY_TOKEN },
{ "beep_delay",		T_Beep_Delay,		FOLLBY_TOKEN },
{ "duration",		T_Duration,		FOLLBY_TOKEN },
{ "server_offset",	T_Server_Offset,	FOLLBY_TOKEN },
{ "freq_offset",	T_Freq_Offset,		FOLLBY_TOKEN },
{ "wander",		T_Wander,		FOLLBY_TOKEN },
{ "jitter",		T_Jitter,		FOLLBY_TOKEN },
{ "prop_delay",		T_Prop_Delay,		FOLLBY_TOKEN },
{ "proc_delay",		T_Proc_Delay,		FOLLBY_TOKEN },
};


typedef struct big_scan_state_tag {
	char	ch;		/* Character this state matches on */
	char	followedby;	/* Forces next token(s) to T_String */
	u_short	finishes_token;	/* nonzero ID if last keyword char */
	u_short	match_next_s;	/* next state to check matching ch */
	u_short	other_next_s;	/* next state to check if not ch */
} big_scan_state;

/*
 * Note: to increase MAXSTATES beyond 2048, be aware it is currently
 * crammed into 11 bits in scan_state form.  Raising to 4096 would be
 * relatively easy by storing the followedby value in a separate
 * array with one entry per token, and shrinking the char value to
 * 7 bits to free a bit for accepting/non-accepting.  More than 4096
 * states will require expanding scan_state beyond 32 bits each.
 */
#define MAXSTATES 2048

const char *	current_keyword;/* for error reporting */
big_scan_state	sst[MAXSTATES];	/* scanner FSM state entries */
int		sst_highwater;	/* next entry index to consider */
char *		symb[1024];	/* map token ID to symbolic name */

/* for libntp */
const char *	progname = "keyword-gen";
volatile int	debug = 1;

int		main			(int, char **);
static void	generate_preamble	(void);
static void	generate_fsm		(void);
static void	generate_token_text	(void);
static int	create_keyword_scanner	(void);
static int	create_scan_states	(char *, int, follby, int);
int		compare_key_tok_id	(QSORTP, QSORTP);
int		compare_key_tok_text	(QSORTP, QSORTP);
void		populate_symb		(char *);
const char *	symbname		(int);


int main(int argc, char **argv)
{
	if (argc < 2) {
		fprintf(stderr, "Usage:\n%s t_header.h\n", argv[0]);
		exit(1);
	}
	populate_symb(argv[1]);

	generate_preamble();
	generate_token_text();
	generate_fsm();

	return 0;
}


static void
generate_preamble(void)
{
	time_t now;
	char timestamp[128];
	char preamble[] =
"/*\n"
" * ntp_keyword.h\n"
" * \n"
" * NOTE: edit this file with caution, it is generated by keyword-gen.c\n"
" *\t Generated %s UTC	  diff_ignore_line\n"
" *\n"
" */\n"
"#include \"ntp_scanner.h\"\n"
"#include \"ntp_parser.h\"\n"
"\n";

	time(&now);
	if (!strftime(timestamp, sizeof(timestamp),
		      "%Y-%m-%d %H:%M:%S", gmtime(&now)))
		timestamp[0] = '\0';

	printf(preamble, timestamp);
}


static void
generate_fsm(void)
{
	char token_id_comment[128];
	int initial_state;
	int i;
	int token;

	/* 
	 * Sort ntp_keywords in alphabetical keyword order.  This is
	 * not necessary, but minimizes nonfunctional changes in the
	 * generated finite state machine when keywords are modified.
	 */
	qsort(ntp_keywords, COUNTOF(ntp_keywords),
	      sizeof(ntp_keywords[0]), compare_key_tok_text);

	/*
	 * To save space, reserve the state array entry matching each 
	 * token number for its terminal state, so the token identifier
	 * does not need to be stored in each state, but can be
	 * recovered trivially.  To mark the entry reserved,
	 * finishes_token is nonzero.
	 */

	for (i = 0; i < COUNTOF(ntp_keywords); i++) {
		token = ntp_keywords[i].token;
		if (1 > token || token >= COUNTOF(sst)) {
			fprintf(stderr,
				"keyword-gen sst[%u] too small "
				"for keyword '%s' id %d\n",
				COUNTOF(sst),
				ntp_keywords[i].key,
				token);
			exit(4);
		}
		sst[token].finishes_token = token;
	}

	initial_state = create_keyword_scanner();

	fprintf(stderr,
		"%d keywords consumed %d states of %d max.\n",
		(int)COUNTOF(ntp_keywords),
		sst_highwater - 1,
		(int)COUNTOF(sst) - 1);

	printf("#define SCANNER_INIT_S %d\n\n", initial_state);

	printf("const scan_state sst[%d] = {\n"
	       "/*SS_T( ch,\tf-by, match, other ),\t\t\t\t */\n"
	       "  0,\t\t\t\t      /* %5d %-17s */\n",
	       sst_highwater,
	       0, "");

	for (i = 1; i < sst_highwater; i++) {

		/* verify fields will fit */
		if (sst[i].followedby & ~0x3) {
			fprintf(stderr,
				"keyword-gen internal error "
				"sst[%d].followedby %d too big\n",
				i, sst[i].followedby);
			exit(7);
		}

		if (sst_highwater <= sst[i].match_next_s
		    || sst[i].match_next_s & ~0x7ff) {
			fprintf(stderr,
				"keyword-gen internal error "
				"sst[%d].match_next_s %d too big\n",
				i, sst[i].match_next_s);
			exit(8);
		}

		if (sst_highwater <= sst[i].other_next_s
		    || sst[i].other_next_s & ~0x7ff) {
			fprintf(stderr,
				"keyword-gen internal error "
				"sst[%d].other_next_s %d too big\n",
				i, sst[i].other_next_s);
			exit(9);
		}

		if (!sst[i].finishes_token)
			snprintf(token_id_comment,
				 sizeof(token_id_comment), "%5d %-17s",
				 i, (initial_state == i) 
					? "initial state" 
					: "");
		else {
			snprintf(token_id_comment, 
				 sizeof(token_id_comment), "%5d %-17s",
				 i, symbname(sst[i].finishes_token));
			if (i != sst[i].finishes_token) {
				fprintf(stderr,
					"keyword-gen internal error "
					"entry %d finishes token %d\n",
					i, sst[i].finishes_token);
				exit(5);
			}
		}

		printf("  S_ST( '%c',\t%d,    %5u, %5u )%s /* %s */\n",
		       sst[i].ch,
		       sst[i].followedby,
		       sst[i].match_next_s,
		       sst[i].other_next_s,
		       (i + 1 < sst_highwater)
			   ? ","
			   : " ",
		       token_id_comment);
	}

	printf("};\n\n");
}


/* Define a function to create the states of the scanner. This function
 * is used by the create_keyword_scanner function below.
 *
 * This function takes a suffix of a keyword, the token to be returned on
 * recognizing the complete keyword, and any pre-existing state that exists
 * for some other keyword that has the same prefix as the current one.
 */
static int
create_scan_states(
	char *	text, 
	int	token, 
	follby	followedby,
	int	prev_state
	)
{
	int my_state;
	int return_state;
	int prev_char_s;
	int curr_char_s;

	return_state = prev_state;
	curr_char_s = prev_state;
	prev_char_s = 0;

	/* Find the correct position to insert the state. 
	 * All states should be in alphabetical order
	 */
	while (curr_char_s && (text[0] < sst[curr_char_s].ch)) {
		prev_char_s = curr_char_s;
		curr_char_s = sst[curr_char_s].other_next_s;
	}

	/* 
	 * Check if a previously seen keyword has the same prefix as
	 * the current keyword.  If so, simply use the state for that
	 * keyword as my_state, otherwise, allocate a new state.
	 */
	if (curr_char_s && (text[0] == sst[curr_char_s].ch)) {
		my_state = curr_char_s;
		if ('\0' == text[1]) {
			fprintf(stderr,
				"Duplicate entries for keyword '%s' in"
				" keyword_gen.c ntp_keywords[].\n",
				current_keyword);
			exit(2);
		}
	} else {
		do
			my_state = sst_highwater++;
		while (my_state < COUNTOF(sst)
		       && sst[my_state].finishes_token);
		if (my_state >= COUNTOF(sst)) {
			fprintf(stderr,
				"fatal, keyword scanner state array "
				"sst[%d] is too small, modify\n"
				"keyword-gen.c to increase.\n",
				(int)COUNTOF(sst));
			exit(3);
		}
		/* Store the next character of the keyword */
		sst[my_state].ch = text[0]; 
		sst[my_state].other_next_s = curr_char_s;
		sst[my_state].followedby = FOLLBY_NON_ACCEPTING;

		if (prev_char_s)
			sst[prev_char_s].other_next_s = my_state;
		else
			return_state = my_state;
	}

	/* Check if the next character is '\0'.
	 * If yes, we are done with the recognition and this is an accepting
	 * state.
	 * If not, we need to continue scanning
	 */
	if ('\0' == text[1]) {
		sst[my_state].finishes_token = (u_short)token;
		sst[my_state].followedby = (char)followedby;

		if (sst[token].finishes_token != (u_short)token) {
			fprintf(stderr,
				"fatal, sst[%d] not reserved for %s.\n",
				token, symbname(token));
			exit(6);
		}
		/* relocate so token id is sst[] index */
		if (my_state != token) {
			sst[token] = sst[my_state];
			memset(&sst[my_state], 0,
			       sizeof(sst[my_state]));
			do
				sst_highwater--;
			while (sst[sst_highwater].finishes_token);
			my_state = token;
			if (prev_char_s)
				sst[prev_char_s].other_next_s = my_state;
			else
				return_state = my_state;
		}
	} else
		sst[my_state].match_next_s = 
		    create_scan_states(
			&text[1],
			token,
			followedby,
			sst[my_state].match_next_s);

	return return_state;
}


/* Define a function that takes a list of (keyword, token) values and
 * creates a keywords scanner out of it.
 */

static int
create_keyword_scanner(void)
{
	int scanner;
	int i;

	sst_highwater = 1;	/* index 0 invalid, unused */
	scanner = 0;

	for (i = 0; i < COUNTOF(ntp_keywords); i++) {
		current_keyword = ntp_keywords[i].key;
		scanner =
		    create_scan_states(
			ntp_keywords[i].key, 
			ntp_keywords[i].token, 
			ntp_keywords[i].followedby,
			scanner);
	}

	return scanner;
}


static void
generate_token_text(void)
{
	int lowest_id;
	int highest_id;
	int id_count;
	int id;
	int i;

	/* sort ntp_keywords in token ID order */
	qsort(ntp_keywords, COUNTOF(ntp_keywords),
	      sizeof(ntp_keywords[0]), compare_key_tok_id);

	lowest_id = ntp_keywords[0].token;
	highest_id = ntp_keywords[COUNTOF(ntp_keywords) - 1].token;
	id_count = highest_id - lowest_id + 1;

	printf("#define LOWEST_KEYWORD_ID %d\n\n", lowest_id);

	printf("const char * const keyword_text[%d] = {", id_count);

	id = lowest_id;
	i = 0;
	while (i < COUNTOF(ntp_keywords)) {
		while (id < ntp_keywords[i].token) {
			printf(",\n\t/* %-5d %5d %20s */\tNULL",
			       id - lowest_id, id, symbname(id));
			id++;
		}
		if (i > 0)
			printf(",");
		printf("\n\t/* %-5d %5d %20s */\t\"%s\"",
		       id - lowest_id, id, symbname(id), 
		       ntp_keywords[i].key);
		i++;
		id++;
	}

	printf("\n};\n\n");
}

	
int
compare_key_tok_id(
	QSORTP a1,
	QSORTP a2
	)
{
	const struct key_tok *p1 = (const void *)a1;
	const struct key_tok *p2 = (const void *)a2;

	if (p1->token == p2->token)
		return 0;

	if (p1->token < p2->token)
		return -1;
	else
		return 1;
}


int
compare_key_tok_text(
	QSORTP a1,
	QSORTP a2
	)
{
	const struct key_tok *p1 = (const void *)a1;
	const struct key_tok *p2 = (const void *)a2;

	return strcmp(p1->key, p2->key);
}


/*
 * populate_symb() - populate symb[] lookup array with symbolic token
 *		     names such that symb[T_Age] == "T_Age", etc.
 */
void
populate_symb(
	char *header_file
	)
{
	FILE *	yh;
	char	line[128];
	char	name[128];
	int	token;

	yh = fopen(header_file, "r");
	if (NULL == yh) {
		perror("unable to open yacc/bison header file");
		exit(4);
	}

	while (NULL != fgets(line, sizeof(line), yh))
		if (2 == sscanf(line, "#define %s %d", name, &token)
		    && 'T' == name[0] && '_' == name[1] && token >= 0
		    && token < COUNTOF(symb))

			symb[token] = estrdup(name);

	fclose(yh);
}


const char *
symbname(
	int token
	)
{
	char *name;

	if (token >= 0 && token < COUNTOF(symb) && symb[token] != NULL)
		return symb[token];

	LIB_GETBUF(name);
	snprintf(name, LIB_BUFLENGTH, "%d", token);
	return name;
}
ntp-4.2.6p5/ntpd/ntp_monitor.c0000644000175000017500000002410011362536523015275 0ustar  peterpeter/*
 * ntp_monitor - monitor ntpd statistics
 */
#ifdef HAVE_CONFIG_H
# include 
#endif

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_if.h"
#include "ntp_stdlib.h"
#include 

#include 
#include 
#ifdef HAVE_SYS_IOCTL_H
# include 
#endif

/*
 * Record statistics based on source address, mode and version. The
 * receive procedure calls us with the incoming rbufp before it does
 * anything else. While at it, implement rate controls for inbound
 * traffic.
 *
 * Each entry is doubly linked into two lists, a hash table and a most-
 * recently-used (MRU) list. When a packet arrives it is looked up in
 * the hash table. If found, the statistics are updated and the entry
 * relinked at the head of the MRU list. If not found, a new entry is
 * allocated, initialized and linked into both the hash table and at the
 * head of the MRU list.
 *
 * Memory is usually allocated by grabbing a big chunk of new memory and
 * cutting it up into littler pieces. The exception to this when we hit
 * the memory limit. Then we free memory by grabbing entries off the
 * tail for the MRU list, unlinking from the hash table, and
 * reinitializing.
 */
/*
 * Limits on the number of structures allocated.  This limit is picked
 * with the illicit knowlege that we can only return somewhat less than
 * 8K bytes in a mode 7 response packet, and that each structure will
 * require about 20 bytes of space in the response.
 *
 * ... I don't believe the above is true anymore ... jdg
 */
#ifndef MAXMONMEM
#define	MAXMONMEM	600	/* we allocate up to 600 structures */
#endif
#ifndef MONMEMINC
#define	MONMEMINC	40	/* allocate them 40 at a time */
#endif

/*
 * Hashing stuff
 */
#define	MON_HASH_SIZE	NTP_HASH_SIZE
#define	MON_HASH_MASK	NTP_HASH_MASK
#define	MON_HASH(addr)	NTP_HASH_ADDR(addr)

/*
 * Pointers to the hash table, the MRU list and the count table.  Memory
 * for the hash and count tables is only allocated if monitoring is
 * turned on.
 */
static	struct mon_data *mon_hash[MON_HASH_SIZE];  /* list ptrs */
struct	mon_data mon_mru_list;

/*
 * List of free structures structures, and counters of free and total
 * structures. The free structures are linked with the hash_next field.
 */
static  struct mon_data *mon_free;      /* free list or null if none */
static	int mon_total_mem;		/* total structures allocated */
static	int mon_mem_increments;		/* times called malloc() */

/*
 * Parameters of the RES_LIMITED restriction option. We define headway
 * as the idle time between packets. A packet is discarded if the
 * headway is less than the minimum, as well as if the average headway
 * is less than eight times the increment.
 */
int	ntp_minpkt = NTP_MINPKT;	/* minimum (log 2 s) */
int	ntp_minpoll = NTP_MINPOLL;	/* increment (log 2 s) */

/*
 * Initialization state.  We may be monitoring, we may not.  If
 * we aren't, we may not even have allocated any memory yet.
 */
int	mon_enabled;			/* enable switch */
int	mon_age = 3000;			/* preemption limit */
static	int mon_have_memory;
static	void	mon_getmoremem	(void);
static	void	remove_from_hash (struct mon_data *);

/*
 * init_mon - initialize monitoring global data
 */
void
init_mon(void)
{
	/*
	 * Don't do much of anything here.  We don't allocate memory
	 * until someone explicitly starts us.
	 */
	mon_enabled = MON_OFF;
	mon_have_memory = 0;
	mon_total_mem = 0;
	mon_mem_increments = 0;
	mon_free = NULL;
	memset(&mon_hash[0], 0, sizeof mon_hash);
	memset(&mon_mru_list, 0, sizeof mon_mru_list);
}


/*
 * mon_start - start up the monitoring software
 */
void
mon_start(
	int mode
	)
{

	if (mon_enabled != MON_OFF) {
		mon_enabled |= mode;
		return;
	}
	if (mode == MON_OFF)
	    return;
	
	if (!mon_have_memory) {
		mon_total_mem = 0;
		mon_mem_increments = 0;
		mon_free = NULL;
		mon_getmoremem();
		mon_have_memory = 1;
	}

	mon_mru_list.mru_next = &mon_mru_list;
	mon_mru_list.mru_prev = &mon_mru_list;
	mon_enabled = mode;
}


/*
 * mon_stop - stop the monitoring software
 */
void
mon_stop(
	int mode
	)
{
	register struct mon_data *md, *md_next;
	register int i;

	if (mon_enabled == MON_OFF)
		return;
	if ((mon_enabled & mode) == 0 || mode == MON_OFF)
		return;

	mon_enabled &= ~mode;
	if (mon_enabled != MON_OFF)
		return;
	
	/*
	 * Put everything back on the free list
	 */
	for (i = 0; i < MON_HASH_SIZE; i++) {
		md = mon_hash[i];               /* get next list */
		mon_hash[i] = NULL;             /* zero the list head */
		while (md != NULL) {
			md_next = md->hash_next;
			md->hash_next = mon_free;
			mon_free = md;
			md = md_next;
		}
	}
	mon_mru_list.mru_next = &mon_mru_list;
	mon_mru_list.mru_prev = &mon_mru_list;
}

void
ntp_monclearinterface(struct interface *interface)
{
        struct mon_data *md;

	for (md = mon_mru_list.mru_next; md != &mon_mru_list;
	    md = md->mru_next) {
		if (md->interface == interface) {
		      /* dequeue from mru list and put to free list */
		      md->mru_prev->mru_next = md->mru_next;
		      md->mru_next->mru_prev = md->mru_prev;
		      remove_from_hash(md);
		      md->hash_next = mon_free;
		      mon_free = md;
		}
	}
}


/*
 * ntp_monitor - record stats about this packet
 *
 * Returns flags
 */
int
ntp_monitor(
	struct recvbuf *rbufp,
	int	flags
	)
{
	register struct pkt *pkt;
	register struct mon_data *md;
	sockaddr_u addr;
	register u_int hash;
	register int mode;
	int	interval;

	if (mon_enabled == MON_OFF)
		return (flags);

	pkt = &rbufp->recv_pkt;
	memset(&addr, 0, sizeof(addr));
	memcpy(&addr, &(rbufp->recv_srcadr), sizeof(addr));
	hash = MON_HASH(&addr);
	mode = PKT_MODE(pkt->li_vn_mode);
	md = mon_hash[hash];
	while (md != NULL) {
		int	head;		/* headway increment */
		int	leak;		/* new headway */
		int	limit;		/* average threshold */

		/*
		 * Match address only to conserve MRU size.
		 */
		if (SOCK_EQ(&md->rmtadr, &addr)) {
			interval = current_time - md->lasttime;
			md->lasttime = current_time;
			md->count++;
			md->flags = flags;
			md->rmtport = NSRCPORT(&rbufp->recv_srcadr);
			md->mode = (u_char) mode;
			md->version = PKT_VERSION(pkt->li_vn_mode);

			/*
			 * Shuffle to the head of the MRU list.
			 */
			md->mru_next->mru_prev = md->mru_prev;
			md->mru_prev->mru_next = md->mru_next;
			md->mru_next = mon_mru_list.mru_next;
			md->mru_prev = &mon_mru_list;
			mon_mru_list.mru_next->mru_prev = md;
			mon_mru_list.mru_next = md;

			/*
			 * At this point the most recent arrival is
			 * first in the MRU list. Decrease the counter
			 * by the headway, but not less than zero.
			 */
			md->leak -= interval;
			if (md->leak < 0)
				md->leak = 0;
			head = 1 << ntp_minpoll;
			leak = md->leak + head;
			limit = NTP_SHIFT * head;
#ifdef DEBUG
			if (debug > 1)
				printf("restrict: interval %d headway %d limit %d\n",
				    interval, leak, limit);
#endif

			/*
			 * If the minimum and average thresholds are not
			 * exceeded, douse the RES_LIMITED and RES_KOD
			 * bits and increase the counter by the headway
			 * increment. Note that we give a 1-s grace for
			 * the minimum threshold and a 2-s grace for the
			 * headway increment. If one or both thresholds
			 * are exceeded and the old counter is less than
			 * the average threshold, set the counter to the
			 * average threshold plus the inrcrment and
			 * leave the RES_KOD bit lit. Othewise, leave
			 * the counter alone and douse the RES_KOD bit.
			 * This rate-limits the KoDs to no less than the
			 * average headway.
			 */
			if (interval + 1 >= (1 << ntp_minpkt) &&
			    leak < limit) {
				md->leak = leak - 2;
				md->flags &= ~(RES_LIMITED | RES_KOD);
			} else if (md->leak < limit) {
				md->leak = limit + head;
			} else {
				md->flags &= ~RES_KOD;
			}
			return (md->flags);
		}
		md = md->hash_next;
	}

	/*
	 * If we got here, this is the first we've heard of this
	 * guy.  Get him some memory, either from the free list
	 * or from the tail of the MRU list.
	 */
	if (mon_free == NULL && mon_total_mem >= MAXMONMEM) {

		/*
		 * Preempt from the MRU list if old enough.
		 */
		md = mon_mru_list.mru_prev;
		if (ntp_random() / (2. * FRAC) > (double)(current_time
		    - md->lasttime) / mon_age)
			return (flags & ~(RES_LIMITED | RES_KOD));

		md->mru_prev->mru_next = &mon_mru_list;
		mon_mru_list.mru_prev = md->mru_prev;
		remove_from_hash(md);
	} else {
		if (mon_free == NULL)
			mon_getmoremem();
		md = mon_free;
		mon_free = md->hash_next;
	}

	/*
	 * Got one, initialize it
	 */
	md->lasttime = md->firsttime = current_time;
	md->count = 1;
	md->flags = flags & ~(RES_LIMITED | RES_KOD);
	md->leak = 0;
	memset(&md->rmtadr, 0, sizeof(md->rmtadr));
	memcpy(&md->rmtadr, &addr, sizeof(addr));
	md->rmtport = NSRCPORT(&rbufp->recv_srcadr);
	md->mode = (u_char) mode;
	md->version = PKT_VERSION(pkt->li_vn_mode);
	md->interface = rbufp->dstadr;
	md->cast_flags = (u_char)(((rbufp->dstadr->flags &
	    INT_MCASTOPEN) && rbufp->fd == md->interface->fd) ?
	    MDF_MCAST: rbufp->fd == md->interface->bfd ? MDF_BCAST :
	    MDF_UCAST);

	/*
	 * Drop him into front of the hash table. Also put him on top of
	 * the MRU list.
	 */
	md->hash_next = mon_hash[hash];
	mon_hash[hash] = md;
	md->mru_next = mon_mru_list.mru_next;
	md->mru_prev = &mon_mru_list;
	mon_mru_list.mru_next->mru_prev = md;
	mon_mru_list.mru_next = md;
	return (md->flags);
}


/*
 * mon_getmoremem - get more memory and put it on the free list
 */
static void
mon_getmoremem(void)
{
	register struct mon_data *md;
	register int i;
	struct mon_data *freedata;      /* 'old' free list (null) */

	md = (struct mon_data *)emalloc(MONMEMINC *
	    sizeof(struct mon_data));
	freedata = mon_free;
	mon_free = md;
	for (i = 0; i < (MONMEMINC-1); i++) {
		md->hash_next = (md + 1);
		md++;
	}

	/*
	 * md now points at the last.  Link in the rest of the chain.
	 */
	md->hash_next = freedata;
	mon_total_mem += MONMEMINC;
	mon_mem_increments++;
}

static void
remove_from_hash(
	struct mon_data *md
	)
{
	register u_int hash;
	register struct mon_data *md_prev;

	hash = MON_HASH(&md->rmtadr);
	if (mon_hash[hash] == md) {
		mon_hash[hash] = md->hash_next;
	} else {
		md_prev = mon_hash[hash];
		while (md_prev->hash_next != md) {
			md_prev = md_prev->hash_next;
			if (md_prev == NULL) {
				/* logic error */
				return;
			}
		}
		md_prev->hash_next = md->hash_next;
	}
}
ntp-4.2.6p5/ntpd/ntp_proto.c0000644000175000017500000031541311670265725014770 0ustar  peterpeter/*
 * ntp_proto.c - NTP version 4 protocol machinery
 *
 * ATTENTION: Get approval from Dave Mills on all changes to this file!
 *
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#include "ntpd.h"
#include "ntp_stdlib.h"
#include "ntp_unixtime.h"
#include "ntp_control.h"
#include "ntp_string.h"

#include 
#ifdef HAVE_LIBSCF_H
#include 
#include 
#endif /* HAVE_LIBSCF_H */


#if defined(VMS) && defined(VMS_LOCALUNIT)	/*wjm*/
#include "ntp_refclock.h"
#endif

/*
 * This macro defines the authentication state. If x is 1 authentication
 * is required; othewise it is optional.
 */
#define	AUTH(x, y)	((x) ? (y) == AUTH_OK : (y) == AUTH_OK || \
			    (y) == AUTH_NONE)

#define	AUTH_NONE	0	/* authentication not required */
#define	AUTH_OK		1	/* authentication OK */
#define	AUTH_ERROR	2	/* authentication error */
#define	AUTH_CRYPTO	3	/* crypto_NAK */

/*
 * traffic shaping parameters
 */
#define	NTP_IBURST	6	/* packets in iburst */
#define	RESP_DELAY	1	/* refclock burst delay (s) */

/*
 * System variables are declared here. Unless specified otherwise, all
 * times are in seconds.
 */
u_char	sys_leap;		/* system leap indicator */
u_char	sys_stratum;		/* system stratum */
s_char	sys_precision;		/* local clock precision (log2 s) */
double	sys_rootdelay;		/* roundtrip delay to primary source */
double	sys_rootdisp;		/* dispersion to primary source */
u_int32 sys_refid;		/* reference id (network byte order) */
l_fp	sys_reftime;		/* last update time */
struct	peer *sys_peer;		/* current peer */

/*
 * Rate controls. Leaky buckets are used to throttle the packet
 * transmission rates in order to protect busy servers such as at NIST
 * and USNO. There is a counter for each association and another for KoD
 * packets. The association counter decrements each second, but not
 * below zero. Each time a packet is sent the counter is incremented by
 * a configurable value representing the average interval between
 * packets. A packet is delayed as long as the counter is greater than
 * zero. Note this does not affect the time value computations.
 */
/*
 * Nonspecified system state variables
 */
int	sys_bclient;		/* broadcast client enable */
double	sys_bdelay;		/* broadcast client default delay */
int	sys_authenticate;	/* requre authentication for config */
l_fp	sys_authdelay;		/* authentication delay */
double	sys_offset;	/* current local clock offset */
double	sys_mindisp = MINDISPERSE; /* minimum distance (s) */
double	sys_maxdist = MAXDISTANCE; /* selection threshold */
double	sys_jitter;		/* system jitter */
u_long	sys_epoch;		/* last clock update time */
static	double sys_clockhop;	/* clockhop threshold */
int	leap_tai;		/* TAI at next next leap */
u_long	leap_sec;		/* next scheduled leap from file */
u_long	leap_peers;		/* next scheduled leap from peers */
u_long	leap_expire;		/* leap information expiration */
static int leap_vote;		/* leap consensus */
keyid_t	sys_private;		/* private value for session seed */
int	sys_manycastserver;	/* respond to manycast client pkts */
int	peer_ntpdate;		/* active peers in ntpdate mode */
int	sys_survivors;		/* truest of the truechimers */

/*
 * TOS and multicast mapping stuff
 */
int	sys_floor = 0;		/* cluster stratum floor */
int	sys_ceiling = STRATUM_UNSPEC; /* cluster stratum ceiling */
int	sys_minsane = 1;	/* minimum candidates */
int	sys_minclock = NTP_MINCLOCK; /* minimum candidates */
int	sys_maxclock = NTP_MAXCLOCK; /* maximum candidates */
int	sys_cohort = 0;		/* cohort switch */
int	sys_orphan = STRATUM_UNSPEC + 1; /* orphan stratum */
int	sys_beacon = BEACON;	/* manycast beacon interval */
int	sys_ttlmax;		/* max ttl mapping vector index */
u_char	sys_ttl[MAX_TTL];	/* ttl mapping vector */

/*
 * Statistics counters - first the good, then the bad
 */
u_long	sys_stattime;		/* elapsed time */
u_long	sys_received;		/* packets received */
u_long	sys_processed;		/* packets for this host */
u_long	sys_newversion;		/* current version */
u_long	sys_oldversion;		/* old version */
u_long	sys_restricted;		/* access denied */
u_long	sys_badlength;		/* bad length or format */
u_long	sys_badauth;		/* bad authentication */
u_long	sys_declined;		/* declined */
u_long	sys_limitrejected;	/* rate exceeded */
u_long	sys_kodsent;		/* KoD sent */

static	double	root_distance	(struct peer *);
static	void	clock_combine	(struct peer **, int);
static	void	peer_xmit	(struct peer *);
static	void	fast_xmit	(struct recvbuf *, int, keyid_t,
				    int);
static	void	clock_update	(struct peer *);
static	int	default_get_precision (void);
static	int	local_refid	(struct peer *);
static	int	peer_unfit	(struct peer *);


/*
 * transmit - transmit procedure called by poll timeout
 */
void
transmit(
	struct peer *peer	/* peer structure pointer */
	)
{
	int	hpoll;

	/*
	 * The polling state machine. There are two kinds of machines,
	 * those that never expect a reply (broadcast and manycast
	 * server modes) and those that do (all other modes). The dance
	 * is intricate...
	 */
	hpoll = peer->hpoll;

	/*
	 * In broadcast mode the poll interval is never changed from
	 * minpoll.
	 */
	if (peer->cast_flags & (MDF_BCAST | MDF_MCAST)) {
		peer->outdate = current_time;
		if (sys_leap != LEAP_NOTINSYNC)
			peer_xmit(peer);
		poll_update(peer, hpoll);
		return;
	}

	/*
	 * In manycast mode we start with unity ttl. The ttl is
	 * increased by one for each poll until either sys_maxclock
	 * servers have been found or the maximum ttl is reached. When
	 * sys_maxclock servers are found we stop polling until one or
	 * more servers have timed out or until less than minpoll
	 * associations turn up. In this case additional better servers
	 * are dragged in and preempt the existing ones.
	 */
	if (peer->cast_flags & MDF_ACAST) {
		peer->outdate = current_time;
		if (peer->unreach > sys_beacon) {
			peer->unreach = 0;
			peer->ttl = 0;
			peer_xmit(peer);
		} else if (sys_survivors < sys_minclock ||
		    peer_associations < sys_maxclock) {
			if (peer->ttl < sys_ttlmax)
				peer->ttl++;
			peer_xmit(peer);
		}
		peer->unreach++;
		poll_update(peer, hpoll);
		return;
	}

	/*
	 * In unicast modes the dance is much more intricate. It is
	 * desigmed to back off whenever possible to minimize network
	 * traffic.
	 */
	if (peer->burst == 0) {
		u_char oreach;

		/*
		 * Update the reachability status. If not heard for
		 * three consecutive polls, stuff infinity in the clock
		 * filter. 
		 */
		oreach = peer->reach;
		peer->outdate = current_time;
		peer->unreach++;
		peer->reach <<= 1;
		if (!(peer->reach & 0x0f))
			clock_filter(peer, 0., 0., MAXDISPERSE);
		if (!peer->reach) {

			/*
			 * Here the peer is unreachable. If it was
			 * previously reachable raise a trap. Send a
			 * burst if enabled.
			 */
			if (oreach)
				report_event(PEVNT_UNREACH, peer, NULL);
			if ((peer->flags & FLAG_IBURST) &&
			    peer->retry == 0)
				peer->retry = NTP_RETRY;
		} else {

			/*
			 * Here the peer is reachable. Send a burst if
			 * enabled and the peer is fit.
			 */
			hpoll = sys_poll;
			if (!(peer->flags & FLAG_PREEMPT &&
			    peer->hmode == MODE_CLIENT))
				peer->unreach = 0;
			if ((peer->flags & FLAG_BURST) && peer->retry ==
			    0 && !peer_unfit(peer))
				peer->retry = NTP_RETRY;
		}

		/*
		 * Watch for timeout. If preemptable, toss the rascal;
		 * otherwise, bump the poll interval. Note the
		 * poll_update() routine will clamp it to maxpoll.
		 */ 
		if (peer->unreach >= NTP_UNREACH) {
			hpoll++;
			if (peer->flags & FLAG_PREEMPT) {
				report_event(PEVNT_RESTART, peer,
				    "timeout");
				if (peer->hmode != MODE_CLIENT) {
					peer_clear(peer, "TIME");
					unpeer(peer);
					return;
				}
				if (peer_associations > sys_maxclock &&
				    score_all(peer)) {
					peer_clear(peer, "TIME");
					unpeer(peer);
					return;
				}
			}
		}
	} else {
		peer->burst--;
		if (peer->burst == 0) {

			/*
			 * If ntpdate mode and the clock has not been
			 * set and all peers have completed the burst,
			 * we declare a successful failure.
			 */
			if (mode_ntpdate) {
				peer_ntpdate--;
				if (peer_ntpdate == 0) {
					msyslog(LOG_NOTICE,
					    "ntpd: no servers found");
					printf(
					    "ntpd: no servers found\n");
					exit (0);
				}
			}
		}
	}
	if (peer->retry > 0)
		peer->retry--;

	/*
	 * Do not transmit if in broadcast client mode. 
	 */
	if (peer->hmode != MODE_BCLIENT)
		peer_xmit(peer);
	poll_update(peer, hpoll);
}


/*
 * receive - receive procedure called for each packet received
 */
void
receive(
	struct recvbuf *rbufp
	)
{
	register struct peer *peer;	/* peer structure pointer */
	register struct pkt *pkt;	/* receive packet pointer */
	int	hisversion;		/* packet version */
	int	hisleap;		/* packet leap indicator */
	int	hismode;		/* packet mode */
	int	hisstratum;		/* packet stratum */
	int	restrict_mask;		/* restrict bits */
	int	has_mac;		/* length of MAC field */
	int	authlen;		/* offset of MAC field */
	int	is_authentic = 0;	/* cryptosum ok */
	int	retcode = AM_NOMATCH;	/* match code */
	keyid_t	skeyid = 0;		/* key IDs */
	u_int32	opcode = 0;		/* extension field opcode */
	sockaddr_u *dstadr_sin; 	/* active runway */
	struct peer *peer2;		/* aux peer structure pointer */
	endpt *	match_ep;		/* newpeer() local address */
	l_fp	p_org;			/* origin timestamp */
	l_fp	p_rec;			/* receive timestamp */
	l_fp	p_xmt;			/* transmit timestamp */
#ifdef OPENSSL
	struct autokey *ap;		/* autokey structure pointer */
	int	rval;			/* cookie snatcher */
	keyid_t	pkeyid = 0, tkeyid = 0;	/* key IDs */
#endif /* OPENSSL */
#ifdef HAVE_NTP_SIGND
	static unsigned char zero_key[16];
#endif /* HAVE_NTP_SIGND */

	/*
	 * Monitor the packet and get restrictions. Note that the packet
	 * length for control and private mode packets must be checked
	 * by the service routines. Some restrictions have to be handled
	 * later in order to generate a kiss-o'-death packet.
	 */
	/*
	 * Bogus port check is before anything, since it probably
	 * reveals a clogging attack.
	 */
	sys_received++;
	if (SRCPORT(&rbufp->recv_srcadr) < NTP_PORT) {
		sys_badlength++;
		return;				/* bogus port */
	}
	restrict_mask = restrictions(&rbufp->recv_srcadr);
#ifdef DEBUG
	if (debug > 1)
		printf("receive: at %ld %s<-%s flags %x restrict %03x\n",
		    current_time, stoa(&rbufp->dstadr->sin),
		    stoa(&rbufp->recv_srcadr),
		    rbufp->dstadr->flags, restrict_mask);
#endif
	pkt = &rbufp->recv_pkt;
	hisversion = PKT_VERSION(pkt->li_vn_mode);
	hisleap = PKT_LEAP(pkt->li_vn_mode);
	hismode = (int)PKT_MODE(pkt->li_vn_mode);
	hisstratum = PKT_TO_STRATUM(pkt->stratum);
	if (restrict_mask & RES_IGNORE) {
		sys_restricted++;
		return;				/* ignore everything */
	}
	if (hismode == MODE_PRIVATE) {
		if (restrict_mask & RES_NOQUERY) {
			sys_restricted++;
			return;			/* no query private */
		}
		process_private(rbufp, ((restrict_mask &
		    RES_NOMODIFY) == 0));
		return;
	}
	if (hismode == MODE_CONTROL) {
		if (restrict_mask & RES_NOQUERY) {
			sys_restricted++;
			return;			/* no query control */
		}
		process_control(rbufp, restrict_mask);
		return;
	}
	if (restrict_mask & RES_DONTSERVE) {
		sys_restricted++;
		return;				/* no time serve */
	}

	/*
	 * This is for testing. If restricted drop ten percent of
	 * surviving packets.
	 */
	if (restrict_mask & RES_TIMEOUT) {
		if ((double)ntp_random() / 0x7fffffff < .1) {
			sys_restricted++;
			return;			/* no flakeway */
		}
	}
	
	/*
	 * Version check must be after the query packets, since they
	 * intentionally use an early version.
	 */
	if (hisversion == NTP_VERSION) {
		sys_newversion++;		/* new version */
	} else if (!(restrict_mask & RES_VERSION) && hisversion >=
	    NTP_OLDVERSION) {
		sys_oldversion++;		/* previous version */
	} else {
		sys_badlength++;
		return;				/* old version */
	}

	/*
	 * Figure out his mode and validate the packet. This has some
	 * legacy raunch that probably should be removed. In very early
	 * NTP versions mode 0 was equivalent to what later versions
	 * would interpret as client mode.
	 */
	if (hismode == MODE_UNSPEC) {
		if (hisversion == NTP_OLDVERSION) {
			hismode = MODE_CLIENT;
		} else {
			sys_badlength++;
			return;                 /* invalid mode */
		}
	}

	/*
	 * Parse the extension field if present. We figure out whether
	 * an extension field is present by measuring the MAC size. If
	 * the number of words following the packet header is 0, no MAC
	 * is present and the packet is not authenticated. If 1, the
	 * packet is a crypto-NAK; if 3, the packet is authenticated
	 * with DES; if 5, the packet is authenticated with MD5; if 6,
	 * the packet is authenticated with SHA. If 2 or * 4, the packet
	 * is a runt and discarded forthwith. If greater than 6, an
	 * extension field is present, so we subtract the length of the
	 * field and go around again.
	 */
	authlen = LEN_PKT_NOMAC;
	has_mac = rbufp->recv_length - authlen;
	while (has_mac != 0) {
		u_int32	len;

		if (has_mac % 4 != 0 || has_mac < MIN_MAC_LEN) {
			sys_badlength++;
			return;			/* bad length */
		}
		if (has_mac <= MAX_MAC_LEN) {
			skeyid = ntohl(((u_int32 *)pkt)[authlen / 4]);
			break;

		} else {
			opcode = ntohl(((u_int32 *)pkt)[authlen / 4]);
 			len = opcode & 0xffff;
			if (len % 4 != 0 || len < 4 || len + authlen >
			    rbufp->recv_length) {
				sys_badlength++;
				return;		/* bad length */
			}
			authlen += len;
			has_mac -= len;
		}
	}

	/*
	 * If authentication required, a MAC must be present.
	 */
	if (restrict_mask & RES_DONTTRUST && has_mac == 0) {
		sys_restricted++;
		return;				/* access denied */
	}

	/*
	 * Update the MRU list and finger the cloggers. It can be a
	 * little expensive, so turn it off for production use.
	 */
	restrict_mask = ntp_monitor(rbufp, restrict_mask);
	if (restrict_mask & RES_LIMITED) {
		sys_limitrejected++;
		if (!(restrict_mask & RES_KOD) || MODE_BROADCAST ==
		    hismode || MODE_SERVER == hismode)
			return;			/* rate exceeded */

		if (hismode == MODE_CLIENT)
			fast_xmit(rbufp, MODE_SERVER, skeyid,
			    restrict_mask);
		else
			fast_xmit(rbufp, MODE_ACTIVE, skeyid,
			    restrict_mask);
		return;				/* rate exceeded */
	}
	restrict_mask &= ~RES_KOD;

	/*
	 * We have tossed out as many buggy packets as possible early in
	 * the game to reduce the exposure to a clogging attack. now we
	 * have to burn some cycles to find the association and
	 * authenticate the packet if required. Note that we burn only
	 * MD5 cycles, again to reduce exposure. There may be no
	 * matching association and that's okay.
	 *
	 * More on the autokey mambo. Normally the local interface is
	 * found when the association was mobilized with respect to a
	 * designated remote address. We assume packets arriving from
	 * the remote address arrive via this interface and the local
	 * address used to construct the autokey is the unicast address
	 * of the interface. However, if the sender is a broadcaster,
	 * the interface broadcast address is used instead.
	 * Notwithstanding this technobabble, if the sender is a
	 * multicaster, the broadcast address is null, so we use the
	 * unicast address anyway. Don't ask.
	 */
	peer = findpeer(rbufp,  hismode, &retcode);
	dstadr_sin = &rbufp->dstadr->sin;
	NTOHL_FP(&pkt->org, &p_org);
	NTOHL_FP(&pkt->rec, &p_rec);
	NTOHL_FP(&pkt->xmt, &p_xmt);

	/*
	 * Authentication is conditioned by three switches:
	 *
	 * NOPEER  (RES_NOPEER) do not mobilize an association unless
	 *         authenticated
	 * NOTRUST (RES_DONTTRUST) do not allow access unless
	 *         authenticated (implies NOPEER)
	 * enable  (sys_authenticate) master NOPEER switch, by default
	 *         on
	 *
	 * The NOPEER and NOTRUST can be specified on a per-client basis
	 * using the restrict command. The enable switch if on implies
	 * NOPEER for all clients. There are four outcomes:
	 *
	 * NONE    The packet has no MAC.
	 * OK      the packet has a MAC and authentication succeeds
	 * ERROR   the packet has a MAC and authentication fails
	 * CRYPTO  crypto-NAK. The MAC has four octets only.
	 *
	 * Note: The AUTH(x, y) macro is used to filter outcomes. If x
	 * is zero, acceptable outcomes of y are NONE and OK. If x is
	 * one, the only acceptable outcome of y is OK.
	 */

	if (has_mac == 0) {
		restrict_mask &= ~RES_MSSNTP;
		is_authentic = AUTH_NONE; /* not required */
#ifdef DEBUG
		if (debug)
			printf(
			    "receive: at %ld %s<-%s mode %d len %d\n",
			    current_time, stoa(dstadr_sin),
			    stoa(&rbufp->recv_srcadr), hismode,
			    authlen);
#endif
	} else if (has_mac == 4) {
		restrict_mask &= ~RES_MSSNTP;
		is_authentic = AUTH_CRYPTO; /* crypto-NAK */
#ifdef DEBUG
		if (debug)
			printf(
			    "receive: at %ld %s<-%s mode %d keyid %08x len %d auth %d\n",
			    current_time, stoa(dstadr_sin),
			    stoa(&rbufp->recv_srcadr), hismode, skeyid,
			    authlen + has_mac, is_authentic);
#endif

#ifdef HAVE_NTP_SIGND
		/*
		 * 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.  
		 *
		 * This is described in Microsoft's WSPP docs, in MS-SNTP:
		 * http://msdn.microsoft.com/en-us/library/cc212930.aspx
		 */
	} else if (has_mac == MAX_MD5_LEN && (restrict_mask & RES_MSSNTP) &&
	   (retcode == AM_FXMIT || retcode == AM_NEWPASS) &&
	   (memcmp(zero_key, (char *)pkt + authlen + 4, MAX_MD5_LEN - 4) ==
	   0)) {
		is_authentic = AUTH_NONE;
#endif /* HAVE_NTP_SIGND */

	} else {
		restrict_mask &= ~RES_MSSNTP;
#ifdef OPENSSL
		/*
		 * For autokey modes, generate the session key
		 * and install in the key cache. Use the socket
		 * 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.
			 * For broadcast packets, the cookie is public
			 * (zero). For packets that match no
			 * association, the cookie is hashed from the
			 * addresses and private value. For server
			 * packets, the cookie was previously obtained
			 * from the server. For symmetric modes, the
			 * cookie was previously constructed using an
			 * agreement protocol; however, should PKI be
			 * unavailable, we construct a fake agreement as
			 * the EXOR of the peer and host cookies.
			 *
			 * hismode	ephemeral	persistent
			 * =======================================
			 * active	0		cookie#
			 * passive	0%		cookie#
			 * client	sys cookie	0%
			 * server	0%		sys cookie
			 * broadcast	0		0
			 *
			 * # if unsync, 0
			 * % can't happen
			 */
			if (has_mac < MAX_MD5_LEN) {
				sys_badauth++;
				return;
			}
			if (hismode == MODE_BROADCAST) {

				/*
				 * For broadcaster, use the interface
				 * broadcast address when available;
				 * otherwise, use the unicast address
				 * found when the association was
				 * mobilized. However, if this is from
				 * the wildcard interface, game over.
				 */
				if (crypto_flags && rbufp->dstadr ==
				    any_interface) {
					sys_restricted++;
					return;	     /* no wildcard */
				}
				pkeyid = 0;
				if (!SOCK_UNSPEC(&rbufp->dstadr->bcast))
					dstadr_sin =
					    &rbufp->dstadr->bcast;
			} else if (peer == NULL) {
				pkeyid = session_key(
				    &rbufp->recv_srcadr, dstadr_sin, 0,
				    sys_private, 0);
			} else {
				pkeyid = peer->pcookie;
			}

			/*
			 * The session key includes both the public
			 * values and cookie. In case of an extension
			 * field, the cookie used for authentication
			 * purposes is zero. Note the hash is saved for
			 * use later in the autokey mambo.
			 */
			if (authlen > LEN_PKT_NOMAC && pkeyid != 0) {
				session_key(&rbufp->recv_srcadr,
				    dstadr_sin, skeyid, 0, 2);
				tkeyid = session_key(
				    &rbufp->recv_srcadr, dstadr_sin,
				    skeyid, pkeyid, 0);
			} else {
				tkeyid = session_key(
				    &rbufp->recv_srcadr, dstadr_sin,
				    skeyid, pkeyid, 2);
			}

		}
#endif /* OPENSSL */

		/*
		 * Compute the cryptosum. Note a clogging attack may
		 * succeed in bloating the key cache. If an autokey,
		 * purge it immediately, since we won't be needing it
		 * again. If the packet is authentic, it can mobilize an
		 * association. Note that there is no key zero.
		 */
		if (!authdecrypt(skeyid, (u_int32 *)pkt, authlen,
		    has_mac))
			is_authentic = AUTH_ERROR;
		else
			is_authentic = AUTH_OK;
#ifdef OPENSSL
		if (crypto_flags && skeyid > NTP_MAXKEY)
			authtrust(skeyid, 0);
#endif /* OPENSSL */
#ifdef DEBUG
		if (debug)
			printf(
			    "receive: at %ld %s<-%s mode %d keyid %08x len %d auth %d\n",
			    current_time, stoa(dstadr_sin),
			    stoa(&rbufp->recv_srcadr), hismode, skeyid,
			    authlen + has_mac, is_authentic);
#endif
	}

	/*
	 * The association matching rules are implemented by a set of
	 * routines and an association table. A packet matching an
	 * association is processed by the peer process for that
	 * association. If there are no errors, an ephemeral association
	 * is mobilized: a broadcast packet mobilizes a broadcast client
	 * aassociation; a manycast server packet mobilizes a manycast
	 * client association; a symmetric active packet mobilizes a
	 * symmetric passive association.
	 */
	switch (retcode) {

	/*
	 * This is a client mode packet not matching any association. If
	 * an ordinary client, simply toss a server mode packet back
	 * over the fence. If a manycast client, we have to work a
	 * little harder.
	 */
	case AM_FXMIT:

		/*
		 * If authentication OK, send a server reply; otherwise,
		 * send a crypto-NAK.
		 */
		if (!(rbufp->dstadr->flags & INT_MCASTOPEN)) {
			if (AUTH(restrict_mask & RES_DONTTRUST,
			   is_authentic)) {
				fast_xmit(rbufp, MODE_SERVER, skeyid,
				    restrict_mask);
			} else if (is_authentic == AUTH_ERROR) {
				fast_xmit(rbufp, MODE_SERVER, 0,
				    restrict_mask);
				sys_badauth++;
			} else {
				sys_restricted++;
			}
			return;			/* hooray */
		}

		/*
		 * This must be manycast. Do not respond if not
		 * configured as a manycast server.
		 */
		if (!sys_manycastserver) {
			sys_restricted++;
			return;			/* not enabled */
		}

		/*
		 * Do not respond if we are not synchronized or our
		 * stratum is greater than the manycaster or the
		 * manycaster has already synchronized to us.
		 */
		if (sys_leap == LEAP_NOTINSYNC || sys_stratum >=
		    hisstratum || (!sys_cohort && sys_stratum ==
		    hisstratum + 1) || rbufp->dstadr->addr_refid ==
		    pkt->refid) {
			sys_declined++;
			return;			/* no help */
		}

		/*
		 * Respond only if authentication succeeds. Don't do a
		 * crypto-NAK, as that would not be useful.
		 */
		if (AUTH(restrict_mask & RES_DONTTRUST, is_authentic))
			fast_xmit(rbufp, MODE_SERVER, skeyid,
			    restrict_mask);
		return;				/* hooray */

	/*
	 * This is a server mode packet returned in response to a client
	 * mode packet sent to a multicast group address. The origin
	 * timestamp is a good nonce to reliably associate the reply
	 * with what was sent. If there is no match, that's curious and
	 * could be an intruder attempting to clog, so we just ignore
	 * it.
	 *
	 * If the packet is authentic and the manycast association is
	 * found, we mobilize a client association and copy pertinent
	 * variables from the manycast association to the new client
	 * association. If not, just ignore the packet.
	 *
	 * There is an implosion hazard at the manycast client, since
	 * the manycast servers send the server packet immediately. If
	 * the guy is already here, don't fire up a duplicate.
	 */
	case AM_MANYCAST:
		if (!AUTH(sys_authenticate | (restrict_mask &
		    (RES_NOPEER | RES_DONTTRUST)), is_authentic)) {
			sys_restricted++;
			return;			/* access denied */
		}

		/*
		 * Do not respond if unsynchronized or stratum is below
		 * the floor or at or above the ceiling.
		 */
		if (hisleap == LEAP_NOTINSYNC || hisstratum <
		    sys_floor || hisstratum >= sys_ceiling) {
			sys_declined++;
			return;			/* no help */
		}
		if ((peer2 = findmanycastpeer(rbufp)) == NULL) {
			sys_restricted++;
			return;			/* not enabled */
		}
		if ((peer = newpeer(&rbufp->recv_srcadr, rbufp->dstadr,
		    MODE_CLIENT, hisversion, NTP_MINDPOLL, NTP_MAXDPOLL,
		    FLAG_PREEMPT, MDF_UCAST | MDF_ACLNT, 0, skeyid)) ==
		    NULL) {
			sys_declined++;
			return;			/* ignore duplicate  */
		}

		/*
		 * We don't need these, but it warms the billboards.
		 */
		if (peer2->flags & FLAG_IBURST)
			peer->flags |= FLAG_IBURST;
		peer->minpoll = peer2->minpoll;
		peer->maxpoll = peer2->maxpoll;
		break;

	/*
	 * This is the first packet received from a broadcast server. If
	 * the packet is authentic and we are enabled as broadcast
	 * client, mobilize a broadcast client association. We don't
	 * kiss any frogs here.
	 */
	case AM_NEWBCL:
		if (sys_bclient == 0) {
			sys_restricted++;
			return;			/* not enabled */
		}
		if (!AUTH(sys_authenticate | (restrict_mask &
		    (RES_NOPEER | RES_DONTTRUST)), is_authentic)) {
			sys_restricted++;
			return;			/* access denied */
		}

		/*
		 * Do not respond if unsynchronized or stratum is below
		 * the floor or at or above the ceiling.
		 */
		if (hisleap == LEAP_NOTINSYNC || hisstratum <
		    sys_floor || hisstratum >= sys_ceiling) {
			sys_declined++;
			return;			/* no help */
		}

#ifdef OPENSSL
		/*
		 * Do not respond if Autokey and the opcode is not a
		 * CRYPTO_ASSOC response with associationn ID.
		 */
		if (crypto_flags && skeyid > NTP_MAXKEY && (opcode &
		    0xffff0000) != (CRYPTO_ASSOC | CRYPTO_RESP)) {
			sys_declined++;
			return;			/* protocol error */
		}
#endif /* OPENSSL */

		/*
		 * Broadcasts received via a multicast address may
		 * arrive after a unicast volley has begun
		 * with the same remote address.  newpeer() will not
		 * find duplicate associations on other local endpoints
		 * if a non-NULL endpoint is supplied.  multicastclient
		 * ephemeral associations are unique across all local
		 * endpoints.
		 */
		if (!(INT_MCASTOPEN & rbufp->dstadr->flags))
			match_ep = rbufp->dstadr;
		else
			match_ep = NULL;

		/*
		 * Determine whether to execute the initial volley.
		 */
		if (sys_bdelay != 0) {
#ifdef OPENSSL
			/*
			 * If a two-way exchange is not possible,
			 * neither is Autokey.
			 */
			if (crypto_flags && skeyid > NTP_MAXKEY) {
				sys_restricted++;
				return;		/* no autokey */
			}
#endif /* OPENSSL */

			/*
			 * Do not execute the volley. Start out in
			 * broadcast client mode.
			 */
			peer = newpeer(&rbufp->recv_srcadr, match_ep,
			    MODE_BCLIENT, hisversion, pkt->ppoll,
			    pkt->ppoll, FLAG_PREEMPT, MDF_BCLNT, 0,
			    skeyid);
			if (NULL == peer) {
				sys_restricted++;
				return;		/* ignore duplicate */

			} else {
				peer->delay = sys_bdelay;
				peer->bias = -sys_bdelay / 2.;
			}
			break;
		}

		/*
		 * Execute the initial volley in order to calibrate the
		 * propagation delay and run the Autokey protocol.
		 *
		 * Note that the minpoll is taken from the broadcast
		 * packet, normally 6 (64 s) and that the poll interval
		 * is fixed at this value.
		 */
		peer = newpeer(&rbufp->recv_srcadr, match_ep,
		    MODE_CLIENT, hisversion, pkt->ppoll, pkt->ppoll,
		    FLAG_BC_VOL | FLAG_IBURST | FLAG_PREEMPT, MDF_BCLNT,
		    0, skeyid);
		if (NULL == peer) {
			sys_restricted++;
			return;			/* ignore duplicate */
		}
#ifdef OPENSSL
		if (skeyid > NTP_MAXKEY)
			crypto_recv(peer, rbufp);
#endif /* OPENSSL */

		return;				/* hooray */

	/*
	 * This is the first packet received from a symmetric active
	 * peer. If the packet is authentic and the first he sent,
	 * mobilize a passive association. If not, kiss the frog.
	 */
	case AM_NEWPASS:
		if (!AUTH(sys_authenticate | (restrict_mask &
		    (RES_NOPEER | RES_DONTTRUST)), is_authentic)) {

			/*
			 * If authenticated but cannot mobilize an
			 * association, send a symmetric passive
			 * response without mobilizing an association.
			 * This is for drat broken Windows clients. See
			 * Microsoft KB 875424 for preferred workaround.
			 */
			if (AUTH(restrict_mask & RES_DONTTRUST,
			    is_authentic)) {
				fast_xmit(rbufp, MODE_PASSIVE, skeyid,
				    restrict_mask);
				return;			/* hooray */
			}
			if (is_authentic == AUTH_ERROR) {
				fast_xmit(rbufp, MODE_ACTIVE, 0,
				    restrict_mask);
				sys_restricted++;
			}
		}

		/*
		 * Do not respond if synchronized and stratum is either
		 * below the floor or at or above the ceiling. Note,
		 * this allows an unsynchronized peer to synchronize to
		 * us. It would be very strange if he did and then was
		 * nipped, but that could only happen if we were
		 * operating at the top end of the range.
		 */
		if (hisleap != LEAP_NOTINSYNC && (hisstratum <
		    sys_floor || hisstratum >= sys_ceiling)) {
			sys_declined++;
			return;			/* no help */
		}

		/*
		 * The message is correctly authenticated and
		 * allowed. Mobiliae a symmetric passive association.
		 */
		if ((peer = newpeer(&rbufp->recv_srcadr,
		    rbufp->dstadr, MODE_PASSIVE, hisversion, pkt->ppoll,
		    NTP_MAXDPOLL, FLAG_PREEMPT, MDF_UCAST, 0,
		    skeyid)) == NULL) {
			sys_declined++;
			return;			/* ignore duplicate */
		}
		break;


	/*
	 * Process regular packet. Nothing special.
	 */
	case AM_PROCPKT:
		break;

	/*
	 * A passive packet matches a passive association. This is
	 * usually the result of reconfiguring a client on the fly. As
	 * this association might be legitamate and this packet an
	 * attempt to deny service, just ignore it.
	 */
	case AM_ERR:
		sys_declined++;
		return;

	/*
	 * For everything else there is the bit bucket.
	 */
	default:
		sys_declined++;
		return;
	}

#ifdef OPENSSL
	/*
	 * If the association is configured for Autokey, the packet must
	 * have a public key ID; if not, the packet must have a
	 * symmetric key ID.
	 */
	if (is_authentic != AUTH_CRYPTO && (((peer->flags &
	    FLAG_SKEY) && skeyid <= NTP_MAXKEY) || (!(peer->flags &
	    FLAG_SKEY) && skeyid > NTP_MAXKEY))) {
		sys_badauth++;
		return;
	}
#endif /* OPENSSL */
	peer->received++;
	peer->flash &= ~PKT_TEST_MASK;
	if (peer->flags & FLAG_XBOGUS) {
		peer->flags &= ~FLAG_XBOGUS;
		peer->flash |= TEST3;
	}

	/*
	 * Next comes a rigorous schedule of timestamp checking. If the
	 * transmit timestamp is zero, the server has not initialized in
	 * interleaved modes or is horribly broken.
	 */
	if (L_ISZERO(&p_xmt)) {
		peer->flash |= TEST3;			/* unsynch */

	/*
	 * If the transmit timestamp duplicates a previous one, the
	 * packet is a replay. This prevents the bad guys from replaying
	 * the most recent packet, authenticated or not.
	 */
	} else if (L_ISEQU(&peer->xmt, &p_xmt)) {
		peer->flash |= TEST1;			/* duplicate */
		peer->oldpkt++;
		return;

	/*
	 * If this is a broadcast mode packet, skip further checking. If
	 * an intial volley, bail out now and let the client do its
	 * stuff. If the origin timestamp is nonzero, this is an
	 * interleaved broadcast. so restart the protocol.
	 */
	} else if (hismode == MODE_BROADCAST) {
		if (!L_ISZERO(&p_org) && !(peer->flags & FLAG_XB)) {
			peer->flags |= FLAG_XB;
			peer->aorg = p_xmt;
			peer->borg = rbufp->recv_time;
			report_event(PEVNT_XLEAVE, peer, NULL);
			return;
		}

	/*
	 * Check for bogus packet in basic mode. If found, switch to
	 * interleaved mode and resynchronize, but only after confirming
	 * the packet is not bogus in symmetric interleaved mode.
	 */
	} else if (peer->flip == 0) {
		if (!L_ISEQU(&p_org, &peer->aorg)) {
			peer->bogusorg++;
			peer->flash |= TEST2;	/* bogus */
			if (!L_ISZERO(&peer->dst) && L_ISEQU(&p_org,
			    &peer->dst)) {
				peer->flip = 1;
				report_event(PEVNT_XLEAVE, peer, NULL);
			}
		} else {
			L_CLR(&peer->aorg);
		}

	/*
	 * Check for valid nonzero timestamp fields.
	 */
	} else if (L_ISZERO(&p_org) || L_ISZERO(&p_rec) ||
	    L_ISZERO(&peer->dst)) {
		peer->flash |= TEST3;		/* unsynch */

	/*
	 * Check for bogus packet in interleaved symmetric mode. This
	 * can happen if a packet is lost, duplicat or crossed. If
	 * found, flip and resynchronize.
	 */
	} else if (!L_ISZERO(&peer->dst) && !L_ISEQU(&p_org,
		    &peer->dst)) {
			peer->bogusorg++;
			peer->flags |= FLAG_XBOGUS;
			peer->flash |= TEST2;		/* bogus */
	}

	/*
	 * 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.
	 */
	if (is_authentic == AUTH_CRYPTO) {
		report_event(PEVNT_AUTH, peer, "crypto_NAK");
		peer->flash |= TEST5;		/* bad auth */
		peer->badauth++;
		if (peer->flags & FLAG_PREEMPT) {
			unpeer(peer);
			return;
		}
#ifdef OPENSSL
		if (peer->crypto)
			peer_clear(peer, "AUTH");
#endif /* OPENSSL */
		return;

	/* 
	 * If the digest fails, 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)) {
		report_event(PEVNT_AUTH, peer, "digest");
		peer->flash |= TEST5;		/* bad auth */
		peer->badauth++;
		if (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE)
			fast_xmit(rbufp, MODE_ACTIVE, 0, restrict_mask);
		if (peer->flags & FLAG_PREEMPT) {
			unpeer(peer);
			return;
		}
#ifdef OPENSSL
		if (peer->crypto)
			peer_clear(peer, "AUTH");
#endif /* OPENSSL */
		return;
	}

	/*
	 * 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 maximumn and advance the headway to give the sender some
	 * headroom. Very intricate.
	 */
	peer->ppoll = max(peer->minpoll, pkt->ppoll);
	if (hismode == MODE_SERVER && hisleap == LEAP_NOTINSYNC &&
	    hisstratum == STRATUM_UNSPEC && memcmp(&pkt->refid,
	    "RATE", 4) == 0) {
		peer->selbroken++;
		report_event(PEVNT_RATE, peer, NULL);
		if (pkt->ppoll > peer->minpoll)
			peer->minpoll = peer->ppoll;
		peer->burst = peer->retry = 0;
		peer->throttle = (NTP_SHIFT + 1) * (1 << peer->minpoll);
		poll_update(peer, pkt->ppoll);
		return;				/* kiss-o'-death */
	}

	/*
	 * That was hard and I am sweaty, but the packet is squeaky
	 * clean. Get on with real work.
	 */
	peer->timereceived = current_time;
	if (is_authentic == AUTH_OK)
		peer->flags |= FLAG_AUTHENTIC;
	else
		peer->flags &= ~FLAG_AUTHENTIC;

#ifdef OPENSSL
	/*
	 * More autokey dance. The rules of the cha-cha are as follows:
	 *
	 * 1. If there is no key or the key is not auto, do nothing.
	 *
	 * 2. If this packet is in response to the one just previously
	 *    sent or from a broadcast server, do the extension fields.
	 *    Otherwise, assume bogosity and bail out.
	 *
	 * 3. If an extension field contains a verified signature, it is
	 *    self-authenticated and we sit the dance.
	 *
	 * 4. If this is a server reply, check only to see that the
	 *    transmitted key ID matches the received key ID.
	 *
	 * 5. Check to see that one or more hashes of the current key ID
	 *    matches the previous key ID or ultimate original key ID
	 *    obtained from the broadcaster or symmetric peer. If no
	 *    match, sit the dance and call for new autokey values.
	 *
	 * In case of crypto error, fire the orchestra, stop dancing and
	 * restart the protocol.
	 */
	if (peer->flags & FLAG_SKEY) {
		/*
		 * Decrement remaining audokey hashes. This isn't
		 * perfect if a packet is lost, but results in no harm.
		 */
		ap = (struct autokey *)peer->recval.ptr;
		if (ap != NULL) {
			if (ap->seq > 0)
				ap->seq--;
		}
		peer->flash |= TEST8;
		rval = crypto_recv(peer, rbufp);
		if (rval == XEVNT_OK) {
			peer->unreach = 0;
		} else {
			if (rval == XEVNT_ERR) {
				report_event(PEVNT_RESTART, peer,
				    "crypto error");
				peer_clear(peer, "CRYP");
				peer->flash |= TEST9;	/* bad crypt */
				if (peer->flags & FLAG_PREEMPT)
					unpeer(peer);
			}
			return;
		}

		/*
		 * If server mode, verify the receive key ID matches
		 * the transmit key ID.
		 */
		if (hismode == MODE_SERVER) {
			if (skeyid == peer->keyid)
				peer->flash &= ~TEST8;

		/*
		 * If an extension field is present, verify only that it
		 * has been correctly signed. We don't need a sequence
		 * check here, but the sequence continues.
		 */
		} else if (!(peer->flash & TEST8)) {
			peer->pkeyid = skeyid;

		/*
		 * Now the fun part. Here, skeyid is the current ID in
		 * the packet, pkeyid is the ID in the last packet and
		 * tkeyid is the hash of skeyid. If the autokey values
		 * have not been received, this is an automatic error.
		 * If so, check that the tkeyid matches pkeyid. If not,
		 * hash tkeyid and try again. If the number of hashes
		 * exceeds the number remaining in the sequence, declare
		 * a successful failure and refresh the autokey values.
		 */
		} else if (ap != NULL) {
			int i;

			for (i = 0; ; i++) {
				if (tkeyid == peer->pkeyid ||
				    tkeyid == ap->key) {
					peer->flash &= ~TEST8;
					peer->pkeyid = skeyid;
					ap->seq -= i;
					break;
				}
				if (i > ap->seq) {
					peer->crypto &=
					    ~CRYPTO_FLAG_AUTO;
					break;
				}
				tkeyid = session_key(
				    &rbufp->recv_srcadr, dstadr_sin,
				    tkeyid, pkeyid, 0);
			}
			if (peer->flash & TEST8)
				report_event(PEVNT_AUTH, peer, "keylist");
		}
		if (!(peer->crypto & CRYPTO_FLAG_PROV)) /* test 9 */
			peer->flash |= TEST8;	/* bad autokey */

		/*
		 * The maximum lifetime of the protocol is about one
		 * week before restarting the Autokey protocol to
		 * refreshed certificates and leapseconds values.
		 */
		if (current_time > peer->refresh) {
			report_event(PEVNT_RESTART, peer,
			    "crypto refresh");
			peer_clear(peer, "TIME");
			return;
		}
	}
#endif /* OPENSSL */

	/*
	 * The dance is complete and the flash bits have been lit. Toss
	 * the packet over the fence for processing, which may light up
	 * more flashers.
	 */
	process_packet(peer, pkt, rbufp->recv_length);

	/*
	 * In interleaved mode update the state variables. Also adjust the
	 * transmit phase to avoid crossover.
	 */
	if (peer->flip != 0) {
		peer->rec = p_rec;
		peer->dst = rbufp->recv_time;
		if (peer->nextdate - current_time < (1 << min(peer->ppoll,
		    peer->hpoll)) / 2)
			peer->nextdate++;
		else
			peer->nextdate--;
	}
}


/*
 * process_packet - Packet Procedure, a la Section 3.4.4 of the
 *	specification. Or almost, at least. If we're in here we have a
 *	reasonable expectation that we will be having a long term
 *	relationship with this host.
 */
void
process_packet(
	register struct peer *peer,
	register struct pkt *pkt,
	u_int	len
	)
{
	double	t34, t21;
	double	p_offset, p_del, p_disp;
	l_fp	p_rec, p_xmt, p_org, p_reftime, ci;
	u_char	pmode, pleap, pstratum;
	char	statstr[NTP_MAXSTRLEN];
#ifdef ASSYM
	int	itemp;
	double	etemp, ftemp, td;
#endif /* ASSYM */

	sys_processed++;
	peer->processed++;
	p_del = FPTOD(NTOHS_FP(pkt->rootdelay));
	p_offset = 0;
	p_disp = FPTOD(NTOHS_FP(pkt->rootdisp));
	NTOHL_FP(&pkt->reftime, &p_reftime);
	NTOHL_FP(&pkt->org, &p_org);
	NTOHL_FP(&pkt->rec, &p_rec);
	NTOHL_FP(&pkt->xmt, &p_xmt);
	pmode = PKT_MODE(pkt->li_vn_mode);
	pleap = PKT_LEAP(pkt->li_vn_mode);
	pstratum = PKT_TO_STRATUM(pkt->stratum);

	/*
	 * Capture the header values in the client/peer association..
	 */
	record_raw_stats(&peer->srcadr, peer->dstadr ?
	    &peer->dstadr->sin : NULL, &p_org, &p_rec, &p_xmt,
	    &peer->dst);
	peer->leap = pleap;
	peer->stratum = min(pstratum, STRATUM_UNSPEC);
	peer->pmode = pmode;
	peer->precision = pkt->precision;
	peer->rootdelay = p_del;
	peer->rootdisp = p_disp;
	peer->refid = pkt->refid;		/* network byte order */
	peer->reftime = p_reftime;

	/*
	 * First, if either burst mode is armed, enable the burst.
	 * Compute the headway for the next packet and delay if
	 * necessary to avoid exceeding the threshold.
	 */
	if (peer->retry > 0) {
		peer->retry = 0;
		if (peer->reach)
			peer->burst = min(1 << (peer->hpoll -
			    peer->minpoll), NTP_SHIFT) - 1;
		else
			peer->burst = NTP_IBURST - 1;
		if (peer->burst > 0)
			peer->nextdate = current_time;
	}
	poll_update(peer, peer->hpoll);

	/*
	 * Verify the server is synchronized; that is, the leap bits,
	 * stratum and root distance are valid.
	 */
	if (pleap == LEAP_NOTINSYNC ||		/* test 6 */
	    pstratum < sys_floor || pstratum >= sys_ceiling)
		peer->flash |= TEST6;		/* bad synch or strat */
	if (p_del / 2 + p_disp >= MAXDISPERSE)	/* test 7 */
		peer->flash |= TEST7;		/* bad header */

	/*
	 * If any tests fail at this point, the packet is discarded.
	 * Note that some flashers may have already been set in the
	 * receive() routine.
	 */
	if (peer->flash & PKT_TEST_MASK) {
		peer->seldisptoolarge++;
#ifdef DEBUG
		if (debug)
			printf("packet: flash header %04x\n",
			    peer->flash);
#endif
		return;
	}

	/*
	 * 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;
	}
	peer->reach |= 1;

	/*
	 * For a client/server association, calculate the clock offset,
	 * roundtrip delay and dispersion. The equations are reordered
	 * from the spec for more efficient use of temporaries. For a
	 * broadcast association, offset the last measurement by the
	 * computed delay during the client/server volley. Note the
	 * computation of dispersion includes the system precision plus
	 * that due to the frequency error since the origin time.
	 *
	 * It is very important to respect the hazards of overflow. The
	 * only permitted operation on raw timestamps is subtraction,
	 * where the result is a signed quantity spanning from 68 years
	 * in the past to 68 years in the future. To avoid loss of
	 * precision, these calculations are done using 64-bit integer
	 * arithmetic. However, the offset and delay calculations are
	 * sums and differences of these first-order differences, which
	 * if done using 64-bit integer arithmetic, would be valid over
	 * only half that span. Since the typical first-order
	 * differences are usually very small, they are converted to 64-
	 * bit doubles and all remaining calculations done in floating-
	 * double arithmetic. This preserves the accuracy while
	 * retaining the 68-year span.
	 *
	 * There are three interleaving schemes, basic, interleaved
	 * symmetric and interleaved broadcast. The timestamps are
	 * idioscyncratically different. See the onwire briefing/white
	 * paper at www.eecis.udel.edu/~mills for details.
	 *
	 * Interleaved symmetric mode
	 * t1 = peer->aorg/borg, t2 = peer->rec, t3 = p_xmt,
	 * t4 = peer->dst
	 */
	if (peer->flip != 0) {
		ci = p_xmt;				/* t3 - t4 */
		L_SUB(&ci, &peer->dst);
		LFPTOD(&ci, t34);
		ci = p_rec;				/* t2 - t1 */
		if (peer->flip > 0)
			L_SUB(&ci, &peer->borg);
		else
			L_SUB(&ci, &peer->aorg);
		LFPTOD(&ci, t21);
		p_del = t21 - t34;
		p_offset = (t21 + t34) / 2.;
		if (p_del < 0 || p_del > 1.) {
			sprintf(statstr, "t21 %.6f t34 %.6f", t21, t34);
			report_event(PEVNT_XERR, peer, statstr);
			return;
		}

	/*
	 * Broadcast modes
	 */
	} else if (peer->pmode == MODE_BROADCAST) {

		/*
		 * 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 */ 
			L_SUB(&ci, &peer->aorg);
			LFPTOD(&ci, t34);
			ci = p_org;			/* t2 - t1 */
			L_SUB(&ci, &peer->borg);
			LFPTOD(&ci, t21);
			peer->aorg = p_xmt;
			peer->borg = peer->dst;
			if (t34 < 0 || t34 > 1.) {
				sprintf(statstr,
				    "offset %.6f delay %.6f", t21, t34);
				report_event(PEVNT_XERR, peer, statstr);
				return;
			}
			p_offset = t21;
			peer->xleave = t34;

		/*
		 * Basic broadcast - use direct timestamps.
		 * t3 = p_xmt, t4 = peer->dst
		 */
		} else {
			ci = p_xmt;		/* t3 - t4 */
			L_SUB(&ci, &peer->dst);
			LFPTOD(&ci, t34);
			p_offset = t34;
		}

		/*
		 * When calibration is complete and the clock is
		 * synchronized, the bias is calculated as the difference
		 * between the unicast timestamp and the broadcast
		 * timestamp. This works for both basic and interleaved
		 * modes.
		 */
		if (FLAG_BC_VOL & peer->flags) {
			peer->flags &= ~FLAG_BC_VOL;
			peer->delay = (peer->offset - p_offset) * 2;
		}
		p_del = peer->delay;
		p_offset += p_del / 2;


	/*
	 * Basic mode, otherwise known as the old fashioned way.
	 *
	 * t1 = p_org, t2 = p_rec, t3 = p_xmt, t4 = peer->dst
	 */
	} else {
		ci = p_xmt;				/* t3 - t4 */
		L_SUB(&ci, &peer->dst);
		LFPTOD(&ci, t34);
		ci = p_rec;				/* t2 - t1 */
		L_SUB(&ci, &p_org);
		LFPTOD(&ci, t21);
		p_del = fabs(t21 - t34);
		p_offset = (t21 + t34) / 2.;
	}
	p_offset += peer->bias;
	p_disp = LOGTOD(sys_precision) + LOGTOD(peer->precision) +
	    clock_phi * p_del;

#if ASSYM
	/*
	 * This code calculates the outbound and inbound data rates by
	 * measuring the differences between timestamps at different
	 * packet lengths. This is helpful in cases of large asymmetric
	 * delays commonly experienced on deep space communication
	 * links.
	 */
	if (peer->t21_last > 0 && peer->t34_bytes > 0) {
		itemp = peer->t21_bytes - peer->t21_last;
		if (itemp > 25) {
			etemp = t21 - peer->t21;
			if (fabs(etemp) > 1e-6) {
				ftemp = itemp / etemp;
				if (ftemp > 1000.)
					peer->r21 = ftemp;
			}
		}
		itemp = len - peer->t34_bytes;
		if (itemp > 25) {
			etemp = -t34 - peer->t34;
			if (fabs(etemp) > 1e-6) {
				ftemp = itemp / etemp;
				if (ftemp > 1000.)
					peer->r34 = ftemp;
			}
		}
	}

	/*
	 * The following section compensates for different data rates on
	 * the outbound (d21) and inbound (t34) directions. To do this,
	 * it finds t such that r21 * t - r34 * (d - t) = 0, where d is
	 * the roundtrip delay. Then it calculates the correction as a
	 * fraction of d.
	 */
 	peer->t21 = t21;
	peer->t21_last = peer->t21_bytes;
	peer->t34 = -t34;
	peer->t34_bytes = len;
#ifdef DEBUG
	if (debug > 1)
		printf("packet: t21 %.9lf %d t34 %.9lf %d\n", peer->t21,
		    peer->t21_bytes, peer->t34, peer->t34_bytes);
#endif
	if (peer->r21 > 0 && peer->r34 > 0 && p_del > 0) {
		if (peer->pmode != MODE_BROADCAST)
			td = (peer->r34 / (peer->r21 + peer->r34) -
			    .5) * p_del;
		else
			td = 0;

		/*
 		 * Unfortunately, in many cases the errors are
		 * unacceptable, so for the present the rates are not
		 * used. In future, we might find conditions where the
		 * calculations are useful, so this should be considered
		 * a work in progress.
		 */
		t21 -= td;
		t34 -= td;
#ifdef DEBUG
		if (debug > 1)
			printf("packet: del %.6lf r21 %.1lf r34 %.1lf %.6lf\n",
			    p_del, peer->r21 / 1e3, peer->r34 / 1e3,
			    td);
#endif
	} 
#endif /* ASSYM */

	/*
	 * That was awesome. Now hand off to the clock filter.
	 */
	clock_filter(peer, p_offset, p_del, p_disp);

	/*
	 * If we are in broadcast calibrate mode, return to broadcast
	 * client mode when the client is fit and the autokey dance is
	 * complete.
	 */
	if ((FLAG_BC_VOL & peer->flags) && MODE_CLIENT == peer->hmode &&
	    !(TEST11 & peer_unfit(peer))) {	/* distance exceeded */
#ifdef OPENSSL
		if (peer->flags & FLAG_SKEY) {
			if (!(~peer->crypto & CRYPTO_FLAG_ALL))
				peer->hmode = MODE_BCLIENT;
		} else {
			peer->hmode = MODE_BCLIENT;
		}
#else /* OPENSSL */
		peer->hmode = MODE_BCLIENT;
#endif /* OPENSSL */
	}
}


/*
 * clock_update - Called at system process update intervals.
 */
static void
clock_update(
	struct peer *peer	/* peer structure pointer */
	)
{
	double	dtemp;
	l_fp	now;
#ifdef HAVE_LIBSCF_H
	char	*fmri;
#endif /* HAVE_LIBSCF_H */

	/*
	 * Update the system state variables. We do this very carefully,
	 * as the poll interval might need to be clamped differently.
	 */
	sys_peer = peer;
	sys_epoch = peer->epoch;
	if (sys_poll < peer->minpoll)
		sys_poll = peer->minpoll;
	if (sys_poll > peer->maxpoll)
		sys_poll = peer->maxpoll;
	poll_update(peer, sys_poll);
	sys_stratum = min(peer->stratum + 1, STRATUM_UNSPEC);
	if (peer->stratum == STRATUM_REFCLOCK ||
	    peer->stratum == STRATUM_UNSPEC)
		sys_refid = peer->refid;
	else
		sys_refid = addr2refid(&peer->srcadr);
	dtemp = sys_jitter + fabs(sys_offset) + peer->disp +
	    (peer->delay + peer->rootdelay) / 2 + clock_phi *
	    (current_time - peer->update);
	sys_rootdisp = dtemp + peer->rootdisp;
	sys_rootdelay = peer->delay + peer->rootdelay;
	sys_reftime = peer->dst;

#ifdef DEBUG
	if (debug)
		printf(
		    "clock_update: at %lu sample %lu associd %d\n",
		    current_time, peer->epoch, peer->associd);
#endif

	/*
	 * Comes now the moment of truth. Crank the clock discipline and
	 * see what comes out.
	 */
	switch (local_clock(peer, sys_offset)) {

	/*
	 * Clock exceeds panic threshold. Life as we know it ends.
	 */
	case -1:
#ifdef HAVE_LIBSCF_H
		/*
		 * For Solaris enter the maintenance mode.
		 */
		if ((fmri = getenv("SMF_FMRI")) != NULL) {
			if (smf_maintain_instance(fmri, 0) < 0) {
				printf("smf_maintain_instance: %s\n",
				    scf_strerror(scf_error()));
				exit(1);
			}
			/*
			 * Sleep until SMF kills us.
			 */
			for (;;)
				pause();
		}
#endif /* HAVE_LIBSCF_H */
		exit (-1);
		/* not reached */

	/*
	 * Clock was stepped. Flush all time values of all peers.
	 */
	case 2:
		clear_all();
		sys_leap = LEAP_NOTINSYNC;
		sys_stratum = STRATUM_UNSPEC;
		memcpy(&sys_refid, "STEP", 4);
		sys_rootdelay = 0;
		sys_rootdisp = 0;
		L_CLR(&sys_reftime);
		sys_jitter = LOGTOD(sys_precision);
		leapsec = 0;
		break;

	/*
	 * Clock was slewed. Handle the leapsecond stuff.
	 */
	case 1:

		/*
		 * If this is the first time the clock is set, reset the
		 * leap bits. If crypto, the timer will goose the setup
		 * process.
		 */
		if (sys_leap == LEAP_NOTINSYNC) {
			sys_leap = LEAP_NOWARNING;
#ifdef OPENSSL
			if (crypto_flags)
				crypto_update();
#endif /* OPENSSL */
		}

		/*
		 * If the leapseconds values are from file or network
		 * and the leap is in the future, schedule a leap at the
		 * given epoch. Otherwise, if the number of survivor
		 * leap bits is greater than half the number of
		 * survivors, schedule a leap for the end of the current
		 * month.
		 */
		get_systime(&now);
		if (leap_sec > 0) {
			if (leap_sec > now.l_ui) {
				sys_tai = leap_tai - 1;
				if (leapsec == 0)
					report_event(EVNT_ARMED, NULL,
					    NULL);
				leapsec = leap_sec - now.l_ui;
			} else {
				sys_tai = leap_tai;
			}
			break;

		} else if (leap_vote > sys_survivors / 2) {
			leap_peers = now.l_ui + leap_month(now.l_ui);
			if (leap_peers > now.l_ui) {
				if (leapsec == 0)
					report_event(PEVNT_ARMED, peer,
					    NULL);
				leapsec = leap_peers - now.l_ui;
			}
		} else if (leapsec > 0) {
			report_event(EVNT_DISARMED, NULL, NULL);
			leapsec = 0;
		}
		break;

	/*
	 * Popcorn spike or step threshold exceeded. Pretend it never
	 * happened.
	 */
	default:
		break;
	}
}


/*
 * poll_update - update peer poll interval
 */
void
poll_update(
	struct peer *peer,	/* peer structure pointer */
	int	mpoll
	)
{
	int	hpoll, minpkt;
	u_long	next, utemp;

	/*
	 * This routine figures out when the next poll should be sent.
	 * That turns out to be wickedly complicated. One problem is
	 * that sometimes the time for the next poll is in the past when
	 * the poll interval is reduced. We watch out for races here
	 * between the receive process and the poll process.
	 *
	 * First, bracket the poll interval according to the type of
	 * association and options. If a fixed interval is configured,
	 * use minpoll. This primarily is for reference clocks, but
	 * works for any association. Otherwise, clamp the poll interval
	 * between minpoll and maxpoll.
	 */
	if (peer->cast_flags & MDF_BCLNT)
		hpoll = peer->minpoll;
	else
		hpoll = max(min(peer->maxpoll, mpoll), peer->minpoll);

#ifdef OPENSSL
	/*
	 * If during the crypto protocol the poll interval has changed,
	 * the lifetimes in the key list are probably bogus. Purge the
	 * the key list and regenerate it later.
	 */
	if ((peer->flags & FLAG_SKEY) && hpoll != peer->hpoll)
		key_expire(peer);
#endif /* OPENSSL */
	peer->hpoll = hpoll;

	/*
	 * There are three variables important for poll scheduling, the
	 * current time (current_time), next scheduled time (nextdate)
	 * and the earliest time (utemp). The earliest time is 2 s
	 * seconds, but could be more due to rate management. When
	 * sending in a burst, use the earliest time. When not in a
	 * burst but with a reply pending, send at the earliest time
	 * unless the next scheduled time has not advanced. This can
	 * only happen if multiple replies are peinding in the same
	 * response interval. Otherwise, send at the later of the next
	 * scheduled time and the earliest time.
	 *
	 * Now we figure out if there is an override. If a burst is in
	 * progress and we get called from the receive process, just
	 * slink away. If called from the poll process, delay 1 s for a
	 * reference clock, otherwise 2 s.
	 */
	minpkt = 1 << ntp_minpkt;
	utemp = current_time + max(peer->throttle - (NTP_SHIFT - 1) *
	    (1 << peer->minpoll), minpkt);
	if (peer->burst > 0) {
		if (peer->nextdate > current_time)
			return;
#ifdef REFCLOCK
		else if (peer->flags & FLAG_REFCLOCK)
			peer->nextdate = current_time + RESP_DELAY;
#endif /* REFCLOCK */
		else
			peer->nextdate = utemp;

#ifdef OPENSSL
	/*
	 * If a burst is not in progress and a crypto response message
	 * is pending, delay 2 s, but only if this is a new interval.
	 */
	} else if (peer->cmmd != NULL) {
		if (peer->nextdate > current_time) {
			if (peer->nextdate + minpkt != utemp)
				peer->nextdate = utemp;
		} else {
			peer->nextdate = utemp;
		}
#endif /* OPENSSL */

	/*
	 * The ordinary case. If a retry, use minpoll; if unreachable,
	 * use host poll; otherwise, use the minimum of host and peer
	 * polls; In other words, oversampling is okay but
	 * understampling is evil. Use the maximum of this value and the
	 * headway. If the average headway is greater than the headway
	 * threshold, increase the headway by the minimum interval.
	 */
	} else {
		if (peer->retry > 0)
			hpoll = peer->minpoll;
		else if (!(peer->reach))
			hpoll = peer->hpoll;
		else
			hpoll = min(peer->ppoll, peer->hpoll);
#ifdef REFCLOCK
		if (peer->flags & FLAG_REFCLOCK)
			next = 1 << hpoll;
		else
			next = ((0x1000UL | (ntp_random() & 0x0ff)) <<
			    hpoll) >> 12;
#else /* REFCLOCK */
		next = ((0x1000UL | (ntp_random() & 0x0ff)) << hpoll) >>
		    12;
#endif /* REFCLOCK */
		next += peer->outdate;
		if (next > utemp)
			peer->nextdate = next;
		else
			peer->nextdate = utemp;
		hpoll = peer->throttle - (1 << peer->minpoll);
		if (hpoll > 0)
			peer->nextdate += minpkt;
	}
#ifdef DEBUG
	if (debug > 1)
		printf("poll_update: at %lu %s poll %d burst %d retry %d head %d early %lu next %lu\n",
		    current_time, ntoa(&peer->srcadr), peer->hpoll,
		    peer->burst, peer->retry, peer->throttle,
		    utemp - current_time, peer->nextdate -
		    current_time);
#endif
}


/*
 * peer_clear - clear peer filter registers.  See Section 3.4.8 of the
 * spec.
 */
void
peer_clear(
	struct peer *peer,		/* peer structure */
	char	*ident			/* tally lights */
	)
{
	int	i;

#ifdef OPENSSL
	/*
	 * If cryptographic credentials have been acquired, toss them to
	 * Valhalla. Note that autokeys are ephemeral, in that they are
	 * tossed immediately upon use. Therefore, the keylist can be
	 * purged anytime without needing to preserve random keys. Note
	 * that, if the peer is purged, the cryptographic variables are
	 * purged, too. This makes it much harder to sneak in some
	 * unauthenticated data in the clock filter.
	 */
	key_expire(peer);
	if (peer->iffval != NULL)
		BN_free(peer->iffval);
	value_free(&peer->cookval);
	value_free(&peer->recval);
	value_free(&peer->encrypt);
	value_free(&peer->sndval);
	if (peer->cmmd != NULL)
		free(peer->cmmd);
	if (peer->subject != NULL)
		free(peer->subject);
	if (peer->issuer != NULL)
		free(peer->issuer);
#endif /* OPENSSL */

	/*
	 * Clear all values, including the optional crypto values above.
	 */
	memset(CLEAR_TO_ZERO(peer), 0, LEN_CLEAR_TO_ZERO);
	peer->ppoll = peer->maxpoll;
	peer->hpoll = peer->minpoll;
	peer->disp = MAXDISPERSE;
	peer->flash = peer_unfit(peer);
	peer->jitter = LOGTOD(sys_precision);

	/*
	 * If interleave mode, initialize the alternate origin switch.
	 */
	if (peer->flags & FLAG_XLEAVE)
		peer->flip = 1;
	for (i = 0; i < NTP_SHIFT; i++) {
		peer->filter_order[i] = i;
		peer->filter_disp[i] = MAXDISPERSE;
	}
#ifdef REFCLOCK
	if (!(peer->flags & FLAG_REFCLOCK)) {
		peer->leap = LEAP_NOTINSYNC;
		peer->stratum = STRATUM_UNSPEC;
		memcpy(&peer->refid, ident, 4);
	}
#else
	peer->leap = LEAP_NOTINSYNC;
	peer->stratum = STRATUM_UNSPEC;
	memcpy(&peer->refid, ident, 4);
#endif /* REFCLOCK */

	/*
	 * During initialization use the association count to spread out
	 * the polls at one-second intervals. Otherwise, randomize over
	 * the minimum poll interval in order to avoid broadcast
	 * implosion.
	 */
	peer->nextdate = peer->update = peer->outdate = current_time;
	if (initializing) {
		peer->nextdate += peer_associations;
	} else if (peer->hmode == MODE_PASSIVE) {
		peer->nextdate += 1 << ntp_minpkt;
	} else {
		peer->nextdate += ntp_random() % peer_associations;
	}
#ifdef OPENSSL
	peer->refresh = current_time + (1 << NTP_REFRESH);
#endif /* OPENSSL */
#ifdef DEBUG
	if (debug)
		printf(
		    "peer_clear: at %ld next %ld associd %d refid %s\n",
		    current_time, peer->nextdate, peer->associd,
		    ident);
#endif
}


/*
 * clock_filter - add incoming clock sample to filter register and run
 *		  the filter procedure to find the best sample.
 */
void
clock_filter(
	struct peer *peer,		/* peer structure pointer */
	double	sample_offset,		/* clock offset */
	double	sample_delay,		/* roundtrip delay */
	double	sample_disp		/* dispersion */
	)
{
	double	dst[NTP_SHIFT];		/* distance vector */
	int	ord[NTP_SHIFT];		/* index vector */
	int	i, j, k, m;
	double	dtemp, etemp;
	char	tbuf[80];

	/*
	 * A sample consists of the offset, delay, dispersion and epoch
	 * of arrival. The offset and delay are determined by the on-
	 * wire protocol. The dispersion grows from the last outbound
	 * packet to the arrival of this one increased by the sum of the
	 * peer precision and the system precision as required by the
	 * error budget. First, shift the new arrival into the shift
	 * register discarding the oldest one.
	 */
	j = peer->filter_nextpt;
	peer->filter_offset[j] = sample_offset;
	peer->filter_delay[j] = sample_delay;
	peer->filter_disp[j] = sample_disp;
	peer->filter_epoch[j] = current_time;
	j = (j + 1) % NTP_SHIFT;
	peer->filter_nextpt = j;

	/*
	 * Update dispersions since the last update and at the same
	 * time initialize the distance and index lists. Since samples
	 * become increasingly uncorrelated beyond the Allan intercept,
	 * only under exceptional cases will an older sample be used.
	 * Therefore, the distance list uses a compound metric. If the
	 * dispersion is greater than the maximum dispersion, clamp the
	 * distance at that value. If the time since the last update is
	 * less than the Allan intercept use the delay; otherwise, use
	 * the sum of the delay and dispersion.
	 */
	dtemp = clock_phi * (current_time - peer->update);
	peer->update = current_time;
	for (i = NTP_SHIFT - 1; i >= 0; i--) {
		if (i != 0)
			peer->filter_disp[j] += dtemp;
		if (peer->filter_disp[j] >= MAXDISPERSE) { 
			peer->filter_disp[j] = MAXDISPERSE;
			dst[i] = MAXDISPERSE;
		} else if (peer->update - peer->filter_epoch[j] >
		    ULOGTOD(allan_xpt)) {
			dst[i] = peer->filter_delay[j] +
			    peer->filter_disp[j];
		} else {
			dst[i] = peer->filter_delay[j];
		}
		ord[i] = j;
		j = (j + 1) % NTP_SHIFT;
	}

        /*
	 * If the clock discipline has stabilized, sort the samples by
	 * distance.  
	 */
	if (sys_leap != LEAP_NOTINSYNC) {
		for (i = 1; i < NTP_SHIFT; i++) {
			for (j = 0; j < i; j++) {
				if (dst[j] > dst[i]) {
					k = ord[j];
					ord[j] = ord[i];
					ord[i] = k;
					etemp = dst[j];
					dst[j] = dst[i];
					dst[i] = etemp;
				}
			}
		}
	}

	/*
	 * Copy the index list to the association structure so ntpq
	 * can see it later. Prune the distance list to leave only
	 * samples less than the maximum dispersion, which disfavors
	 * uncorrelated samples older than the Allan intercept. To
	 * further improve the jitter estimate, of the remainder leave
	 * only samples less than the maximum distance, but keep at
	 * least two samples for jitter calculation.
	 */
	m = 0;
	for (i = 0; i < NTP_SHIFT; i++) {
		peer->filter_order[i] = (u_char) ord[i];
		if (dst[i] >= MAXDISPERSE || (m >= 2 && dst[i] >=
		    sys_maxdist))
			continue;
		m++;
	}
	
	/*
	 * Compute the dispersion and jitter. The dispersion is weighted
	 * exponentially by NTP_FWEIGHT (0.5) so it is normalized close
	 * to 1.0. The jitter is the RMS differences relative to the
	 * lowest delay sample.
	 */
	peer->disp = peer->jitter = 0;
	k = ord[0];
	for (i = NTP_SHIFT - 1; i >= 0; i--) {
		j = ord[i];
		peer->disp = NTP_FWEIGHT * (peer->disp +
		    peer->filter_disp[j]);
		if (i < m)
			peer->jitter += DIFF(peer->filter_offset[j],
			    peer->filter_offset[k]);
	}

	/*
	 * If no acceptable samples remain in the shift register,
	 * quietly tiptoe home leaving only the dispersion. Otherwise,
	 * save the offset, delay and jitter. Note the jitter must not
	 * be less than the precision.
	 */
	if (m == 0) {
		clock_select();
		return;
	}

	etemp = fabs(peer->offset - peer->filter_offset[k]);
	peer->offset = peer->filter_offset[k];
	peer->delay = peer->filter_delay[k];
	if (m > 1)
		peer->jitter /= m - 1;
	peer->jitter = max(SQRT(peer->jitter), LOGTOD(sys_precision));

	/*
	 * If the the new sample and the current sample are both valid
	 * and the difference between their offsets exceeds CLOCK_SGATE
	 * (3) times the jitter and the interval between them is less
	 * than twice the host poll interval, consider the new sample
	 * a popcorn spike and ignore it.
	 */
	if (peer->disp < sys_maxdist && peer->filter_disp[k] <
	    sys_maxdist && etemp > CLOCK_SGATE * peer->jitter &&
	    peer->filter_epoch[k] - peer->epoch < 2. *
	    ULOGTOD(peer->hpoll)) {
		snprintf(tbuf, sizeof(tbuf), "%.6f s", etemp);
		report_event(PEVNT_POPCORN, peer, tbuf);
		return;
	}

	/*
	 * A new minimum sample is useful only if it is later than the
	 * last one used. In this design the maximum lifetime of any
	 * sample is not greater than eight times the poll interval, so
	 * the maximum interval between minimum samples is eight
	 * packets.
	 */
	if (peer->filter_epoch[k] <= peer->epoch) {
#if DEBUG
	if (debug)
		printf("clock_filter: old sample %lu\n", current_time -
		    peer->filter_epoch[k]);
#endif
		return;
	}
	peer->epoch = peer->filter_epoch[k];

	/*
	 * The mitigated sample statistics are saved for later
	 * processing. If not synchronized or not in a burst, tickle the
	 * clock select algorithm.
	 */
	record_peer_stats(&peer->srcadr, ctlpeerstatus(peer),
	    peer->offset, peer->delay, peer->disp, peer->jitter);
#ifdef DEBUG
	if (debug)
		printf(
		    "clock_filter: n %d off %.6f del %.6f dsp %.6f jit %.6f\n",
		    m, peer->offset, peer->delay, peer->disp,
		    peer->jitter);
#endif
	if (peer->burst == 0 || sys_leap == LEAP_NOTINSYNC)
		clock_select();
}


/*
 * clock_select - find the pick-of-the-litter clock
 *
 * LOCKCLOCK: (1) If the local clock is the prefer peer, it will always
 * be enabled, even if declared falseticker, (2) only the prefer peer
 * caN Be selected as the system peer, (3) if the external source is
 * down, the system leap bits are set to 11 and the stratum set to
 * infinity.
 */
void
clock_select(void)
{
	struct peer *peer;
	int	i, j, k, n;
	int	nlist, nl3;
	int	allow, osurv;
	double	d, e, f, g;
	double	high, low;
	double	seljitter;
	double	synch[NTP_MAXASSOC], error[NTP_MAXASSOC];
	double	orphmet = 2.0 * U_INT32_MAX; /* 2x is greater than */
	struct peer *osys_peer = NULL;
	struct peer *sys_prefer = NULL;	/* prefer peer */
	struct peer *typesystem = NULL;
	struct peer *typeorphan = NULL;
#ifdef REFCLOCK
	struct peer *typeacts = NULL;
	struct peer *typelocal = NULL;
	struct peer *typepps = NULL;
#endif /* REFCLOCK */

	static int list_alloc = 0;
	static struct endpoint *endpoint = NULL;
	static int *indx = NULL;
	static struct peer **peer_list = NULL;
	static u_int endpoint_size = 0;
	static u_int indx_size = 0;
	static u_int peer_list_size = 0;

	/*
	 * Initialize and create endpoint, index and peer lists big
	 * enough to handle all associations.
	 */
	osys_peer = sys_peer;
	osurv = sys_survivors;
	sys_survivors = 0;
#ifdef LOCKCLOCK
	sys_leap = LEAP_NOTINSYNC;
	sys_stratum = STRATUM_UNSPEC;
	memcpy(&sys_refid, "DOWN", 4);
#endif /* LOCKCLOCK */
	nlist = 0;
	for (n = 0; n < NTP_HASH_SIZE; n++)
		nlist += peer_hash_count[n];
	if (nlist > list_alloc) {
		if (list_alloc > 0) {
			free(endpoint);
			free(indx);
			free(peer_list);
		}
		while (list_alloc < nlist) {
			list_alloc += 5;
			endpoint_size += 5 * 3 * sizeof(*endpoint);
			indx_size += 5 * 3 * sizeof(*indx);
			peer_list_size += 5 * sizeof(*peer_list);
		}
		endpoint = (struct endpoint *)emalloc(endpoint_size);
		indx = (int *)emalloc(indx_size);
		peer_list = (struct peer **)emalloc(peer_list_size);
	}

	/*
	 * Initially, we populate the island with all the rifraff peers
	 * that happen to be lying around. Those with seriously
	 * defective clocks are immediately booted off the island. Then,
	 * the falsetickers are culled and put to sea. The truechimers
	 * remaining are subject to repeated rounds where the most
	 * unpopular at each round is kicked off. When the population
	 * has dwindled to sys_minclock, the survivors split a million
	 * bucks and collectively crank the chimes.
	 */
	nlist = nl3 = 0;	/* none yet */
	for (n = 0; n < NTP_HASH_SIZE; n++) {
		for (peer = peer_hash[n]; peer != NULL; peer =
		    peer->next) {
			peer->new_status = CTL_PST_SEL_REJECT;

			/*
			 * Leave the island immediately if the peer is
			 * unfit to synchronize.
			 */
			if (peer_unfit(peer))
				continue;

			/*
			 * If this peer is an orphan parent, elect the
			 * one with the lowest metric defined as the
			 * IPv4 address or the first 64 bits of the
			 * hashed IPv6 address.  To ensure convergence
			 * on the same selected orphan, consider as
			 * well that this system may have the lowest
			 * metric and be the orphan parent.  If this
			 * system wins, sys_peer will be NULL to trigger
			 * orphan mode in timer().
			 */
			if (peer->stratum == sys_orphan) {
				u_int32	localmet;
				u_int32	peermet;

				if (peer->dstadr != NULL)
					localmet = ntohl(peer->dstadr->addr_refid);
				else
					localmet = U_INT32_MAX;
				peermet = ntohl(addr2refid(&peer->srcadr));
				if (peermet < localmet &&
				    peermet < orphmet) {
					typeorphan = peer;
					orphmet = peermet;
				}
				continue;
			}

			/*
			 * If this peer could have the orphan parent
			 * as a synchronization ancestor, exclude it
			 * from selection to avoid forming a 
			 * synchronization loop within the orphan mesh,
			 * triggering stratum climb to infinity 
			 * instability.  Peers at stratum higher than
			 * the orphan stratum could have the orphan
			 * parent in ancestry so are excluded.
			 * See http://bugs.ntp.org/2050
			 */
			if (peer->stratum > sys_orphan)
				continue;
#ifdef REFCLOCK
			/*
			 * The following are special cases. We deal
			 * with them later.
			 */
			if (!(peer->flags & FLAG_PREFER)) {
				switch (peer->refclktype) {
				case REFCLK_LOCALCLOCK:
					if (typelocal == NULL)
						typelocal = peer;
					continue;

				case REFCLK_ACTS:
					if (typeacts == NULL)
						typeacts = peer;
					continue;
				}
			}
#endif /* REFCLOCK */

			/*
			 * If we get this far, the peer can stay on the
			 * island, but does not yet have the immunity
			 * idol.
			 */
			peer->new_status = CTL_PST_SEL_SANE;
			peer_list[nlist++] = peer;

			/*
			 * Insert each interval endpoint on the sorted
			 * list.
			 */
			e = peer->offset;	 /* Upper end */
			f = root_distance(peer);
			e = e + f;
			for (i = nl3 - 1; i >= 0; i--) {
				if (e >= endpoint[indx[i]].val)
					break;

				indx[i + 3] = indx[i];
			}
			indx[i + 3] = nl3;
			endpoint[nl3].type = 1;
			endpoint[nl3++].val = e;

			e = e - f;		/* Center point */
			for (; i >= 0; i--) {
				if (e >= endpoint[indx[i]].val)
					break;

				indx[i + 2] = indx[i];
			}
			indx[i + 2] = nl3;
			endpoint[nl3].type = 0;
			endpoint[nl3++].val = e;

			e = e - f;		/* Lower end */
			for (; i >= 0; i--) {
				if (e >= endpoint[indx[i]].val)
					break;

				indx[i + 1] = indx[i];
			}
			indx[i + 1] = nl3;
			endpoint[nl3].type = -1;
			endpoint[nl3++].val = e;
		}
	}
#ifdef DEBUG
	if (debug > 2)
		for (i = 0; i < nl3; i++)
			printf("select: endpoint %2d %.6f\n",
			   endpoint[indx[i]].type,
			   endpoint[indx[i]].val);
#endif
	/*
	 * This is the actual algorithm that cleaves the truechimers
	 * from the falsetickers. The original algorithm was described
	 * in Keith Marzullo's dissertation, but has been modified for
	 * better accuracy.
	 *
	 * Briefly put, we first assume there are no falsetickers, then
	 * scan the candidate list first from the low end upwards and
	 * then from the high end downwards. The scans stop when the
	 * number of intersections equals the number of candidates less
	 * the number of falsetickers. If this doesn't happen for a
	 * given number of falsetickers, we bump the number of
	 * falsetickers and try again. If the number of falsetickers
	 * becomes equal to or greater than half the number of
	 * candidates, the Albanians have won the Byzantine wars and
	 * correct synchronization is not possible.
	 *
	 * Here, nlist is the number of candidates and allow is the
	 * number of falsetickers. Upon exit, the truechimers are the
	 * survivors with offsets not less than low and not greater than
	 * high. There may be none of them.
	 */
	low = 1e9;
	high = -1e9;
	for (allow = 0; 2 * allow < nlist; allow++) {
		int	found;

		/*
		 * Bound the interval (low, high) as the largest
		 * interval containing points from presumed truechimers.
		 */
		found = 0;
		n = 0;
		for (i = 0; i < nl3; i++) {
			low = endpoint[indx[i]].val;
			n -= endpoint[indx[i]].type;
			if (n >= nlist - allow)
				break;
			if (endpoint[indx[i]].type == 0)
				found++;
		}
		n = 0;
		for (j = nl3 - 1; j >= 0; j--) {
			high = endpoint[indx[j]].val;
			n += endpoint[indx[j]].type;
			if (n >= nlist - allow)
				break;
			if (endpoint[indx[j]].type == 0)
				found++;
		}

		/*
		 * If the number of candidates found outside the
		 * interval is greater than the number of falsetickers,
		 * then at least one truechimer is outside the interval,
		 * so go around again. This is what makes this algorithm
		 * different than Marzullo's.
		 */
		if (found > allow)
			continue;

		/*
		 * If an interval containing truechimers is found, stop.
		 * If not, increase the number of falsetickers and go
		 * around again.
		 */
		if (high > low)
			break;
	}

	/*
	 * Clustering algorithm. Construct candidate list in order first
	 * by stratum then by root distance, but keep only the best
	 * NTP_MAXASSOC of them. Scan the list to find falsetickers, who
	 * leave the island immediately. The TRUE peer is always a
	 * truechimer. We must leave at least one peer to collect the
	 * million bucks.
	 */
	j = 0;
	for (i = 0; i < nlist; i++) {
		peer = peer_list[i];
		if (nlist > 1 && (peer->offset <= low || peer->offset >=
		    high) && !(peer->flags & FLAG_TRUE))
			continue;

#ifdef REFCLOCK
		/*
		 * Eligible PPS peers must survive the intersection
		 * algorithm. Use the first one found, but don't
		 * include any of them in the cluster population.
		 */
		if (peer->flags & FLAG_PPS) {
			if (typepps == NULL) 
				typepps = peer;
			continue;
		}
#endif /* REFCLOCK */

		/*
		 * The metric is the scaled root distance at the next
		 * poll interval plus the peer stratum.
		 */
		d = (root_distance(peer) + clock_phi * (peer->nextdate -
		    current_time)) / sys_maxdist + peer->stratum;
		if (j >= NTP_MAXASSOC) {
			if (d >= synch[j - 1])
				continue;
			else
				j--;
		}
		for (k = j; k > 0; k--) {
			if (d >= synch[k - 1])
				break;

			peer_list[k] = peer_list[k - 1];
			error[k] = error[k - 1];
			synch[k] = synch[k - 1];
		}
		peer_list[k] = peer;
		error[k] = peer->jitter;
		synch[k] = d;
		j++;
	}
	nlist = j;

	/*
	 * 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.
	 */
	if (nlist == 0) {
		error[0] = 0;
		synch[0] = 0;
#ifdef REFCLOCK
		if (typeacts != NULL) {
			peer_list[0] = typeacts;
			nlist = 1;
		} else if (typelocal != NULL) {
			peer_list[0] = typelocal;
			nlist = 1;
		} else
#endif /* REFCLOCK */
		if (typeorphan != NULL) {
			peer_list[0] = typeorphan;
			nlist = 1;
		}
	}

	/*
	 * Mark the candidates at this point as truechimers.
	 */
	for (i = 0; i < nlist; i++) {
		peer_list[i]->new_status = CTL_PST_SEL_SELCAND;
#ifdef DEBUG
		if (debug > 1)
			printf("select: survivor %s %f\n",
			    stoa(&peer_list[i]->srcadr), synch[i]);
#endif
	}

	/*
	 * Now, vote outlyers off the island by select jitter weighted
	 * by root distance. Continue voting as long as there are more
	 * than sys_minclock survivors and the minimum select jitter is
	 * greater than the maximum peer jitter. Stop if we are about to
	 * discard a TRUE or PREFER  peer, who of course has the
	 * immunity idol.
	 */
	seljitter = 0;
	while (1) {
		d = 1e9;
		e = -1e9;
		f = g = 0;
		k = 0;
		for (i = 0; i < nlist; i++) {
			if (error[i] < d)
				d = error[i];
			f = 0;
			if (nlist > 1) {
				for (j = 0; j < nlist; j++)
					f += DIFF(peer_list[j]->offset,
					    peer_list[i]->offset);
				f = SQRT(f / (nlist - 1));
			}
			if (f * synch[i] > e) {
				g = f;
				e = f * synch[i];
				k = i;
			}
		}
		f = max(f, LOGTOD(sys_precision));
		if (nlist <= sys_minsane || nlist <= sys_minclock) {
			break;

		} else if (f <= d || peer_list[k]->flags &
		    (FLAG_TRUE | FLAG_PREFER)) {
			seljitter = f;
			break;
		}
#ifdef DEBUG
		if (debug > 2)
			printf(
			    "select: drop %s seljit %.6f jit %.6f\n",
			    ntoa(&peer_list[k]->srcadr), g, d);
#endif
		if (nlist > sys_maxclock)
			peer_list[k]->new_status = CTL_PST_SEL_EXCESS;
		for (j = k + 1; j < nlist; j++) {
			peer_list[j - 1] = peer_list[j];
			synch[j - 1] = synch[j];
			error[j - 1] = error[j];
		}
		nlist--;
	}

	/*
	 * What remains is a list usually not greater than sys_minclock
	 * peers. Note that the head of the list is the system peer at
	 * the lowest stratum and that unsynchronized peers cannot
	 * survive this far.
	 *
	 * While at it, count the number of leap warning bits found.
	 * This will be used later to vote the system leap warning bit.
	 * If a leap warning bit is found on a reference clock, the vote
	 * is always won.
	 */
	leap_vote = 0;
	for (i = 0; i < nlist; i++) {
		peer = peer_list[i];
		peer->unreach = 0;
		peer->new_status = CTL_PST_SEL_SYNCCAND;
		sys_survivors++;
		if (peer->leap == LEAP_ADDSECOND) {
			if (peer->flags & FLAG_REFCLOCK)
				leap_vote = nlist;
			else 
				leap_vote++;
		}
		if (peer->flags & FLAG_PREFER)
			sys_prefer = peer;
	}

	/*
	 * Unless there are at least sys_misane survivors, leave the
	 * building dark. Otherwise, do a clockhop dance. Ordinarily,
	 * use the first survivor on the survivor list. However, if the
	 * last selection is not first on the list, use it as long as
	 * it doesn't get too old or too ugly.
	 */
	if (nlist > 0 && nlist >= sys_minsane) {
		double	x;

		typesystem = peer_list[0];
		if (osys_peer == NULL || osys_peer == typesystem) {
			sys_clockhop = 0; 
		} else if ((x = fabs(typesystem->offset -
		    osys_peer->offset)) < sys_mindisp) {
			if (sys_clockhop == 0)
				sys_clockhop = sys_mindisp;
			else
				sys_clockhop *= .5;
#ifdef DEBUG
			if (debug)
				printf("select: clockhop %d %.6f %.6f\n",
				    j, x, sys_clockhop);
#endif
			if (fabs(x) < sys_clockhop)
				typesystem = osys_peer;
			else
				sys_clockhop = 0;
		} else {
			sys_clockhop = 0;
		}
	}

	/*
	 * Mitigation rules of the game. We have the pick of the
	 * litter in typesystem if any survivors are left. If
	 * there is a prefer peer, use its offset and jitter.
	 * Otherwise, use the combined offset and jitter of all kitters.
	 */
	if (typesystem != NULL) {
		if (sys_prefer == NULL) {
			typesystem->new_status = CTL_PST_SEL_SYSPEER;
			clock_combine(peer_list, sys_survivors);
			sys_jitter = SQRT(SQUARE(sys_jitter) +
			    SQUARE(seljitter));
		} else {
			typesystem = sys_prefer;
			sys_clockhop = 0;
			typesystem->new_status = CTL_PST_SEL_SYSPEER;
			sys_offset = typesystem->offset;
			sys_jitter = typesystem->jitter;
		}
#ifdef DEBUG
		if (debug)
			printf("select: combine offset %.9f jitter %.9f\n",
			    sys_offset, sys_jitter);
#endif
	}
#ifdef REFCLOCK
	/*
	 * If a PPS driver is lit and the combined offset is less than
	 * 0.4 s, select the driver as the PPS peer and use its offset
	 * and jitter. However, if this is the atom driver, use it only
	 * if there is a prefer peer or there are no survivors and none
	 * are required.
	 */
	if (typepps != NULL && fabs(sys_offset) < 0.4 &&
	    (typepps->refclktype != REFCLK_ATOM_PPS ||
	    (typepps->refclktype == REFCLK_ATOM_PPS && (sys_prefer !=
	    NULL || (typesystem == NULL && sys_minsane == 0))))) {
		typesystem = typepps;
		sys_clockhop = 0;
		typesystem->new_status = CTL_PST_SEL_PPS;
 		sys_offset = typesystem->offset;
		sys_jitter = typesystem->jitter;
#ifdef DEBUG
		if (debug)
			printf("select: pps offset %.9f jitter %.9f\n",
			    sys_offset, sys_jitter);
#endif
	}
#endif /* REFCLOCK */

	/*
	 * If there are no survivors at this point, there is no
	 * system peer. If so and this is an old update, keep the
	 * current statistics, but do not update the clock.
	 */
	if (typesystem == NULL) {
		if (osys_peer != NULL)
			report_event(EVNT_NOPEER, NULL, NULL);
		sys_peer = NULL;			
		for (n = 0; n < NTP_HASH_SIZE; n++)
			for (peer = peer_hash[n]; peer != NULL; peer =
			    peer->next)
				peer->status = peer->new_status;
		return;
	}

	/*
	 * Do not use old data, as this may mess up the clock discipline
	 * stability.
	 */
	if (typesystem->epoch <= sys_epoch)
		return;

	/*
	 * We have found the alpha male. Wind the clock.
	 */
	if (osys_peer != typesystem)
		report_event(PEVNT_NEWPEER, typesystem, NULL);
	for (n = 0; n < NTP_HASH_SIZE; n++)
		for (peer = peer_hash[n]; peer != NULL; peer =
		    peer->next)
			peer->status = peer->new_status;
	clock_update(typesystem);
}


/*
 * clock_combine - compute system offset and jitter from selected peers
 */
static void
clock_combine(
	struct peer **peers,	/* survivor list */
	int	npeers		/* number of survivors */
	)
{
	int	i;
	double	x, y, z, w;

	y = z = w = 0;
	for (i = 0; i < npeers; i++) {
		x = root_distance(peers[i]);
		y += 1. / x;
		z += peers[i]->offset / x;
		w += SQUARE(peers[i]->offset - peers[0]->offset) / x;
	}
	sys_offset = z / y;
	sys_jitter = SQRT(w / y);
}


/*
 * root_distance - compute synchronization distance from peer to root
 */
static double
root_distance(
	struct peer *peer	/* peer structure pointer */
	)
{
	double	dtemp;

	/*
	 * Careful squeak here. The value returned must be greater than
	 * the minimum root dispersion in order to avoid clockhop with
	 * highly precise reference clocks. Note that the root distance
	 * cannot exceed the sys_maxdist, as this is the cutoff by the
	 * selection algorithm.
	 */
	dtemp = (peer->delay + peer->rootdelay) / 2 + peer->disp +
	    peer->rootdisp + clock_phi * (current_time - peer->update) +
	    peer->jitter;
	if (dtemp < sys_mindisp)
		dtemp = sys_mindisp;
	return (dtemp);
}


/*
 * peer_xmit - send packet for persistent association.
 */
static void
peer_xmit(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct pkt xpkt;	/* transmit packet */
	int	sendlen, authlen;
	keyid_t	xkeyid = 0;	/* transmit key ID */
	l_fp	xmt_tx, xmt_ty;

	if (!peer->dstadr)	/* drop peers without interface */
		return;

	xpkt.li_vn_mode = PKT_LI_VN_MODE(sys_leap, peer->version,
	    peer->hmode);
	xpkt.stratum = STRATUM_TO_PKT(sys_stratum);
	xpkt.ppoll = peer->hpoll;
	xpkt.precision = sys_precision;
	xpkt.refid = sys_refid;
	xpkt.rootdelay = HTONS_FP(DTOFP(sys_rootdelay));
	xpkt.rootdisp =  HTONS_FP(DTOUFP(sys_rootdisp));
	HTONL_FP(&sys_reftime, &xpkt.reftime);
	HTONL_FP(&peer->rec, &xpkt.org);
	HTONL_FP(&peer->dst, &xpkt.rec);

	/*
	 * If the received packet contains a MAC, the transmitted packet
	 * is authenticated and contains a MAC. If not, the transmitted
	 * packet is not authenticated.
	 *
	 * It is most important when autokey is in use that the local
	 * interface IP address be known before the first packet is
	 * sent. Otherwise, it is not possible to compute a correct MAC
	 * the recipient will accept. Thus, the I/O semantics have to do
	 * a little more work. In particular, the wildcard interface
	 * might not be usable.
	 */
	sendlen = LEN_PKT_NOMAC;
#ifdef OPENSSL
	if (!(peer->flags & FLAG_SKEY) && peer->keyid == 0) {
#else
	if (peer->keyid == 0) {
#endif /* OPENSSL */

		/*
		 * Transmit a-priori timestamps
		 */
		get_systime(&xmt_tx);
		if (peer->flip == 0) {	/* basic mode */
			peer->aorg = xmt_tx;
			HTONL_FP(&xmt_tx, &xpkt.xmt);
		} else {		/* interleaved modes */
			if (peer->hmode == MODE_BROADCAST) { /* bcst */
				HTONL_FP(&xmt_tx, &xpkt.xmt);
				if (peer->flip > 0)
					HTONL_FP(&peer->borg,
					    &xpkt.org);
				else
					HTONL_FP(&peer->aorg,
					    &xpkt.org);
			} else {	/* symmetric */
				if (peer->flip > 0)
					HTONL_FP(&peer->borg,
					    &xpkt.xmt);
				else
					HTONL_FP(&peer->aorg,
					    &xpkt.xmt);
			}
		}
		peer->t21_bytes = sendlen;
		sendpkt(&peer->srcadr, peer->dstadr, sys_ttl[peer->ttl],
		    &xpkt, sendlen);
		peer->sent++;
		peer->throttle += (1 << peer->minpoll) - 2;

		/*
		 * Capture a-posteriori timestamps
		 */
		get_systime(&xmt_ty);
		if (peer->flip != 0) {		/* interleaved modes */
			if (peer->flip > 0)
				peer->aorg = xmt_ty;
			else
				peer->borg = xmt_ty;
			peer->flip = -peer->flip;
		}
		L_SUB(&xmt_ty, &xmt_tx);
		LFPTOD(&xmt_ty, peer->xleave);
#ifdef DEBUG
		if (debug)
			printf("transmit: at %ld %s->%s mode %d len %d\n",
		    	    current_time, peer->dstadr ?
			    stoa(&peer->dstadr->sin) : "-",
		            stoa(&peer->srcadr), peer->hmode, sendlen);
#endif
		return;
	}

	/*
	 * Authentication is enabled, so the transmitted packet must be
	 * authenticated. If autokey is enabled, fuss with the various
	 * modes; otherwise, symmetric key cryptography is used.
	 */
#ifdef OPENSSL
	if (peer->flags & FLAG_SKEY) {
		struct exten *exten;	/* extension field */

		/*
		 * The Public Key Dance (PKD): Cryptographic credentials
		 * are contained in extension fields, each including a
		 * 4-octet length/code word followed by a 4-octet
		 * association ID and optional additional data. Optional
		 * data includes a 4-octet data length field followed by
		 * the data itself. Request messages are sent from a
		 * configured association; response messages can be sent
		 * from a configured association or can take the fast
		 * path without ever matching an association. Response
		 * messages have the same code as the request, but have
		 * a response bit and possibly an error bit set. In this
		 * implementation, a message may contain no more than
		 * one command and one or more responses.
		 *
		 * Cryptographic session keys include both a public and
		 * a private componet. Request and response messages
		 * using extension fields are always sent with the
		 * private component set to zero. Packets without
		 * extension fields indlude the private component when
		 * the session key is generated.
		 */
		while (1) {
		
			/*
			 * Allocate and initialize a keylist if not
			 * already done. Then, use the list in inverse
			 * order, discarding keys once used. Keep the
			 * latest key around until the next one, so
			 * clients can use client/server packets to
			 * compute propagation delay.
			 *
			 * Note that once a key is used from the list,
			 * it is retained in the key cache until the
			 * next key is used. This is to allow a client
			 * to retrieve the encrypted session key
			 * identifier to verify authenticity.
			 *
			 * If for some reason a key is no longer in the
			 * key cache, a birthday has happened or the key
			 * has expired, so the pseudo-random sequence is
			 * broken. In that case, purge the keylist and
			 * regenerate it.
			 */
			if (peer->keynumber == 0)
				make_keylist(peer, peer->dstadr);
			else
				peer->keynumber--;
			xkeyid = peer->keylist[peer->keynumber];
			if (authistrusted(xkeyid))
				break;
			else
				key_expire(peer);
		}
		peer->keyid = xkeyid;
		exten = NULL;
		switch (peer->hmode) {

		/*
		 * In broadcast server mode the autokey values are
		 * required by the broadcast clients. Push them when a
		 * new keylist is generated; otherwise, push the
		 * association message so the client can request them at
		 * other times.
		 */
		case MODE_BROADCAST:
			if (peer->flags & FLAG_ASSOC)
				exten = crypto_args(peer, CRYPTO_AUTO |
				    CRYPTO_RESP, peer->associd, NULL);
			else
				exten = crypto_args(peer, CRYPTO_ASSOC |
				    CRYPTO_RESP, peer->associd, NULL);
			break;

		/*
		 * 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
		 * peer has synchronized, so the certificate exchange
		 * might loop until then. If a peer finds a broken
		 * autokey sequence, it uses the autokey exchange to
		 * retrieve the autokey values. In any case, if a new
		 * keylist is generated, the autokey values are pushed.
		 */
		case MODE_ACTIVE:
		case MODE_PASSIVE:

			/*
			 * Parameter, certificate and identity.
			 */
			if (!peer->crypto)
				exten = crypto_args(peer, CRYPTO_ASSOC,
				    peer->associd, sys_hostname);
			else if (!(peer->crypto & CRYPTO_FLAG_CERT))
				exten = crypto_args(peer, CRYPTO_CERT,
				    peer->associd, peer->issuer);
			else if (!(peer->crypto & CRYPTO_FLAG_VRFY))
				exten = crypto_args(peer,
				    crypto_ident(peer), peer->associd,
				    NULL);

			/*
			 * Cookie and autokey. We request the cookie
			 * only when the this peer and the other peer
			 * are synchronized. But, this peer needs the
			 * autokey values when the cookie is zero. Any
			 * time we regenerate the key list, we offer the
			 * autokey values without being asked. If for
			 * some reason either peer finds a broken
			 * autokey sequence, the autokey exchange is
			 * used to retrieve the autokey values.
			 */
			else if (sys_leap != LEAP_NOTINSYNC &&
			    peer->leap != LEAP_NOTINSYNC &&
			    !(peer->crypto & CRYPTO_FLAG_COOK))
				exten = crypto_args(peer, CRYPTO_COOK,
				    peer->associd, NULL);
			else if (!(peer->crypto & CRYPTO_FLAG_AUTO))
				exten = crypto_args(peer, CRYPTO_AUTO,
				    peer->associd, NULL);
			else if (peer->flags & FLAG_ASSOC &&
			    peer->crypto & CRYPTO_FLAG_SIGN)
				exten = crypto_args(peer, CRYPTO_AUTO |
				    CRYPTO_RESP, peer->assoc, NULL);

			/*
			 * Wait for clock sync, then sign the
			 * certificate and retrieve the leapsecond
			 * values.
			 */
			else if (sys_leap == LEAP_NOTINSYNC)
				break;

			else if (!(peer->crypto & CRYPTO_FLAG_SIGN))
				exten = crypto_args(peer, CRYPTO_SIGN,
				    peer->associd, sys_hostname);
			else if (!(peer->crypto & CRYPTO_FLAG_LEAP))
				exten = crypto_args(peer, CRYPTO_LEAP,
				    peer->associd, NULL);
			break;

		/*
		 * In client mode the parameter, certificate, identity,
		 * cookie and sign exchanges are required. The
		 * leapsecond exchange is optional. If broadcast client
		 * mode the same exchanges are required, except that the
		 * autokey exchange is substitutes for the cookie
		 * exchange, since the cookie is always zero. If the
		 * broadcast client finds a broken autokey sequence, it
		 * uses the autokey exchange to retrieve the autokey
		 * values.
		 */
		case MODE_CLIENT:

			/*
			 * Parameter, certificate and identity.
			 */
			if (!peer->crypto)
				exten = crypto_args(peer, CRYPTO_ASSOC,
				    peer->associd, sys_hostname);
			else if (!(peer->crypto & CRYPTO_FLAG_CERT))
				exten = crypto_args(peer, CRYPTO_CERT,
				    peer->associd, peer->issuer);
			else if (!(peer->crypto & CRYPTO_FLAG_VRFY))
				exten = crypto_args(peer,
				    crypto_ident(peer), peer->associd,
				    NULL);

			/*
			 * Cookie and autokey. These are requests, but
			 * we use the peer association ID with autokey
			 * rather than our own.
			 */
			else if (!(peer->crypto & CRYPTO_FLAG_COOK))
				exten = crypto_args(peer, CRYPTO_COOK,
				    peer->associd, NULL);
			else if (!(peer->crypto & CRYPTO_FLAG_AUTO))
				exten = crypto_args(peer, CRYPTO_AUTO,
				    peer->assoc, NULL);

			/*
			 * Wait for clock sync, then sign the
			 * certificate and retrieve the leapsecond
			 * values.
			 */
			else if (sys_leap == LEAP_NOTINSYNC)
				break;

			else if (!(peer->crypto & CRYPTO_FLAG_SIGN))
				exten = crypto_args(peer, CRYPTO_SIGN,
				    peer->associd, sys_hostname);
			else if (!(peer->crypto & CRYPTO_FLAG_LEAP))
				exten = crypto_args(peer, CRYPTO_LEAP,
				    peer->associd, NULL);
			break;
		}

		/*
		 * Add a queued extension field if present. This is
		 * always a request message, so the reply ID is already
		 * in the message. If an error occurs, the error bit is
		 * lit in the response.
		 */
		if (peer->cmmd != NULL) {
			u_int32 temp32;

			temp32 = CRYPTO_RESP;
			peer->cmmd->opcode |= htonl(temp32);
			sendlen += crypto_xmit(peer, &xpkt, NULL,
			    sendlen, peer->cmmd, 0);
			free(peer->cmmd);
			peer->cmmd = NULL;
		}

		/*
		 * Add an extension field created above. All but the
		 * autokey response message are request messages.
		 */
		if (exten != NULL) {
			if (exten->opcode != 0)
				sendlen += crypto_xmit(peer, &xpkt,
				    NULL, sendlen, exten, 0);
			free(exten);
		}

		/*
		 * Calculate the next session key. Since extension
		 * fields are present, the cookie value is zero.
		 */
		if (sendlen > LEN_PKT_NOMAC) {
			session_key(&peer->dstadr->sin, &peer->srcadr,
			    xkeyid, 0, 2);
		}
	} 
#endif /* OPENSSL */

	/*
	 * Transmit a-priori timestamps
	 */
	get_systime(&xmt_tx);
	if (peer->flip == 0) {		/* basic mode */
		peer->aorg = xmt_tx;
		HTONL_FP(&xmt_tx, &xpkt.xmt);
	} else {			/* interleaved modes */
		if (peer->hmode == MODE_BROADCAST) { /* bcst */
			HTONL_FP(&xmt_tx, &xpkt.xmt);
			if (peer->flip > 0)
				HTONL_FP(&peer->borg, &xpkt.org);
			else
				HTONL_FP(&peer->aorg, &xpkt.org);
		} else {		/* symmetric */
			if (peer->flip > 0)
				HTONL_FP(&peer->borg, &xpkt.xmt);
			else
				HTONL_FP(&peer->aorg, &xpkt.xmt);
		}
	}
	xkeyid = peer->keyid;
	authlen = authencrypt(xkeyid, (u_int32 *)&xpkt, sendlen);
	if (authlen == 0) {
		report_event(PEVNT_AUTH, peer, "no key");
		peer->flash |= TEST5;		/* auth error */
		peer->badauth++;
		return;
	}
	sendlen += authlen;
#ifdef OPENSSL
	if (xkeyid > NTP_MAXKEY)
		authtrust(xkeyid, 0);
#endif /* OPENSSL */
	if (sendlen > sizeof(xpkt)) {
		msyslog(LOG_ERR, "proto: buffer overflow %u", sendlen);
		exit (-1);
	}
	peer->t21_bytes = sendlen;
	sendpkt(&peer->srcadr, peer->dstadr, sys_ttl[peer->ttl], &xpkt,
	    sendlen);
	peer->sent++;
	peer->throttle += (1 << peer->minpoll) - 2;

	/*
	 * Capture a-posteriori timestamps
	 */
	get_systime(&xmt_ty);
	if (peer->flip != 0) {			/* interleaved modes */
		if (peer->flip > 0)
			peer->aorg = xmt_ty;
		else
			peer->borg = xmt_ty;
		peer->flip = -peer->flip;
	}
	L_SUB(&xmt_ty, &xmt_tx);
	LFPTOD(&xmt_ty, peer->xleave);
#ifdef OPENSSL
#ifdef DEBUG
	if (debug)
		printf("transmit: at %ld %s->%s mode %d keyid %08x len %d index %d\n",
		    current_time, peer->dstadr ?
		    ntoa(&peer->dstadr->sin) : "-",
	 	    ntoa(&peer->srcadr), peer->hmode, xkeyid, sendlen,
		    peer->keynumber);
#endif
#else /* OPENSSL */
#ifdef DEBUG
	if (debug)
		printf("transmit: at %ld %s->%s mode %d keyid %08x len %d\n",
		    current_time, peer->dstadr ?
		    ntoa(&peer->dstadr->sin) : "-",
		    ntoa(&peer->srcadr), peer->hmode, xkeyid, sendlen);
#endif
#endif /* OPENSSL */
}


/*
 * fast_xmit - Send packet for nonpersistent association. Note that
 * neither the source or destination can be a broadcast address.
 */
static void
fast_xmit(
	struct recvbuf *rbufp,	/* receive packet pointer */
	int	xmode,		/* receive mode */
	keyid_t	xkeyid,		/* transmit key ID */
	int	flags		/* restrict mask */
	)
{
	struct pkt xpkt;	/* transmit packet structure */
	struct pkt *rpkt;	/* receive packet structure */
	l_fp	xmt_tx, xmt_ty;
	int	sendlen;
#ifdef OPENSSL
	u_int32	temp32;
#endif

	/*
	 * Initialize transmit packet header fields from the receive
	 * buffer provided. We leave the fields intact as received, but
	 * set the peer poll at the maximum of the receive peer poll and
	 * the system minimum poll (ntp_minpoll). This is for KoD rate
	 * control and not strictly specification compliant, but doesn't
	 * break anything.
	 *
	 * If the gazinta was from a multicast address, the gazoutta
	 * must go out another way.
	 */
	rpkt = &rbufp->recv_pkt;
	if (rbufp->dstadr->flags & INT_MCASTOPEN)
		rbufp->dstadr = findinterface(&rbufp->recv_srcadr);

	/*
	 * If this is a kiss-o'-death (KoD) packet, show leap
	 * unsynchronized, stratum zero, reference ID the four-character
	 * kiss code and system root delay. Note we don't reveal the
	 * local time, so these packets can't be used for
	 * synchronization.
	 */
	if (flags & RES_KOD) {
		sys_kodsent++;
		xpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC,
		    PKT_VERSION(rpkt->li_vn_mode), xmode);
		xpkt.stratum = STRATUM_PKT_UNSPEC;
		xpkt.ppoll = max(rpkt->ppoll, ntp_minpoll);
		memcpy(&xpkt.refid, "RATE", 4);
		xpkt.org = rpkt->xmt;
		xpkt.rec = rpkt->xmt;
		xpkt.xmt = rpkt->xmt;

	/*
	 * This is a normal packet. Use the system variables.
	 */
	} else {
		xpkt.li_vn_mode = PKT_LI_VN_MODE(sys_leap,
		    PKT_VERSION(rpkt->li_vn_mode), xmode);
		xpkt.stratum = STRATUM_TO_PKT(sys_stratum);
		xpkt.ppoll = max(rpkt->ppoll, ntp_minpoll);
		xpkt.precision = sys_precision;
		xpkt.refid = sys_refid;
		xpkt.rootdelay = HTONS_FP(DTOFP(sys_rootdelay));
		xpkt.rootdisp = HTONS_FP(DTOUFP(sys_rootdisp));
		HTONL_FP(&sys_reftime, &xpkt.reftime);
		xpkt.org = rpkt->xmt;
		HTONL_FP(&rbufp->recv_time, &xpkt.rec);
		get_systime(&xmt_tx);
		HTONL_FP(&xmt_tx, &xpkt.xmt);
	}

#ifdef HAVE_NTP_SIGND
	if (flags & RES_MSSNTP) {
		send_via_ntp_signd(rbufp, xmode, xkeyid, flags, &xpkt);
		return;
	}
#endif /* HAVE_NTP_SIGND */

	/*
	 * If the received packet contains a MAC, the transmitted packet
	 * is authenticated and contains a MAC. If not, the transmitted
	 * packet is not authenticated.
	 */
	sendlen = LEN_PKT_NOMAC;
	if (rbufp->recv_length == sendlen) {
		sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, 0, &xpkt,
		    sendlen);
#ifdef DEBUG
		if (debug)
			printf(
			    "transmit: at %ld %s->%s mode %d len %d\n",
			    current_time, stoa(&rbufp->dstadr->sin),
			    stoa(&rbufp->recv_srcadr), xmode, sendlen);
#endif
		return;
	}

	/*
	 * The received packet contains a MAC, so the transmitted packet
	 * must be authenticated. For symmetric key cryptography, use
	 * the predefined and trusted symmetric keys to generate the
	 * cryptosum. For autokey cryptography, use the server private
	 * value to generate the cookie, which is unique for every
	 * source-destination-key ID combination.
	 */
#ifdef OPENSSL
	if (xkeyid > NTP_MAXKEY) {
		keyid_t cookie;

		/*
		 * The only way to get here is a reply to a legitimate
		 * client request message, so the mode must be
		 * MODE_SERVER. If an extension field is present, there
		 * can be only one and that must be a command. Do what
		 * needs, but with private value of zero so the poor
		 * jerk can decode it. If no extension field is present,
		 * use the cookie to generate the session key.
		 */
		cookie = session_key(&rbufp->recv_srcadr,
		    &rbufp->dstadr->sin, 0, sys_private, 0);
		if (rbufp->recv_length > sendlen + MAX_MAC_LEN) {
			session_key(&rbufp->dstadr->sin,
			    &rbufp->recv_srcadr, xkeyid, 0, 2);
			temp32 = CRYPTO_RESP;
			rpkt->exten[0] |= htonl(temp32);
			sendlen += crypto_xmit(NULL, &xpkt, rbufp,
			    sendlen, (struct exten *)rpkt->exten,
			    cookie);
		} else {
			session_key(&rbufp->dstadr->sin,
			    &rbufp->recv_srcadr, xkeyid, cookie, 2);
		}
	}
#endif /* OPENSSL */
	get_systime(&xmt_tx);
	sendlen += authencrypt(xkeyid, (u_int32 *)&xpkt, sendlen);
#ifdef OPENSSL
	if (xkeyid > NTP_MAXKEY)
		authtrust(xkeyid, 0);
#endif /* OPENSSL */
	sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, 0, &xpkt, sendlen);
	get_systime(&xmt_ty);
	L_SUB(&xmt_ty, &xmt_tx);
	sys_authdelay = xmt_ty;
#ifdef DEBUG
	if (debug)
		printf(
		    "transmit: at %ld %s->%s mode %d keyid %08x len %d\n",
		    current_time, ntoa(&rbufp->dstadr->sin),
		    ntoa(&rbufp->recv_srcadr), xmode, xkeyid, sendlen);
#endif
}


#ifdef OPENSSL
/*
 * key_expire - purge the key list
 */
void
key_expire(
	struct peer *peer	/* peer structure pointer */
	)
{
	int i;

	if (peer->keylist != NULL) {
		for (i = 0; i <= peer->keynumber; i++)
			authtrust(peer->keylist[i], 0);
		free(peer->keylist);
		peer->keylist = NULL;
	}
	value_free(&peer->sndval);
	peer->keynumber = 0;
	peer->flags &= ~FLAG_ASSOC;
#ifdef DEBUG
	if (debug)
		printf("key_expire: at %lu associd %d\n", current_time,
		    peer->associd);
#endif
}
#endif /* OPENSSL */


/*
 * local_refid(peer) - check peer refid to avoid selecting peers
 *		       currently synced to this ntpd.
 */
static int
local_refid(
	struct peer *	p
	)
{
	endpt *	unicast_ep;

	if (p->dstadr != NULL && !(INT_MCASTIF & p->dstadr->flags))
		unicast_ep = p->dstadr;
	else
		unicast_ep = findinterface(&p->srcadr);

	if (unicast_ep != NULL && p->refid == unicast_ep->addr_refid)
		return TRUE;
	else
		return FALSE;
}


/*
 * Determine if the peer is unfit for synchronization
 *
 * A peer is unfit for synchronization if
 * > TEST10 bad leap or stratum below floor or at or above ceiling
 * > TEST11 root distance exceeded for remote peer
 * > TEST12 a direct or indirect synchronization loop would form
 * > TEST13 unreachable or noselect
 */
int				/* FALSE if fit, TRUE if unfit */
peer_unfit(
	struct peer *peer	/* peer structure pointer */
	)
{
	int	rval = 0;

	/*
	 * A stratum error occurs if (1) the server has never been
	 * synchronized, (2) the server stratum is below the floor or
	 * greater than or equal to the ceiling.
	 */
	if (peer->leap == LEAP_NOTINSYNC || peer->stratum < sys_floor ||
	    peer->stratum >= sys_ceiling)
		rval |= TEST10;		/* bad synch or stratum */

	/*
	 * A distance error for a remote peer occurs if the root
	 * distance is greater than or equal to the distance threshold
	 * plus the increment due to one host poll interval.
	 */
	if (!(peer->flags & FLAG_REFCLOCK) && root_distance(peer) >=
	    sys_maxdist + clock_phi * ULOGTOD(peer->hpoll))
		rval |= TEST11;		/* distance exceeded */

	/*
	 * A loop error occurs if the remote peer is synchronized to the
	 * local peer or if the remote peer is synchronized to the same
	 * server as the local peer but only if the remote peer is
	 * neither a reference clock nor an orphan.
	 */
	if (peer->stratum > 1 && local_refid(peer))
		rval |= TEST12;		/* synchronization loop */

	/*
	 * An unreachable error occurs if the server is unreachable or
	 * the noselect bit is set.
	 */
	if (!peer->reach || (peer->flags & FLAG_NOSELECT))
		rval |= TEST13;		/* unreachable */

	peer->flash &= ~PEER_TEST_MASK;
	peer->flash |= rval;
	return (rval);
}


/*
 * Find the precision of this particular machine
 */
#define MINSTEP 100e-9		/* minimum clock increment (s) */
#define MAXSTEP 20e-3		/* maximum clock increment (s) */
#define MINLOOPS 5		/* minimum number of step samples */

/*
 * This routine measures the system precision defined as the minimum of
 * a sequence of differences between successive readings of the system
 * clock. However, if a difference is less than MINSTEP, the clock has
 * been read more than once during a clock tick and the difference is
 * ignored. We set MINSTEP greater than zero in case something happens
 * like a cache miss.
 */
int
default_get_precision(void)
{
	l_fp	val;		/* current seconds fraction */
	l_fp	last;		/* last seconds fraction */
	l_fp	diff;		/* difference */
	double	tick;		/* computed tick value */
	double	dtemp;		/* scratch */
	int	i;		/* log2 precision */

	/*
	 * Loop to find precision value in seconds.
	 */
	tick = MAXSTEP;
	i = 0;
	get_systime(&last);
	while (1) {
		get_systime(&val);
		diff = val;
		L_SUB(&diff, &last);
		last = val;
		LFPTOD(&diff, dtemp);
		if (dtemp < MINSTEP)
			continue;

		if (dtemp < tick)
			tick = dtemp;
		if (++i >= MINLOOPS)
			break;
	}
	sys_tick = tick;

	/*
	 * Find the nearest power of two.
	 */
	msyslog(LOG_NOTICE, "proto: precision = %.3f usec", tick * 1e6);
	for (i = 0; tick <= 1; i++)
		tick *= 2;
	if (tick - 1 > 1 - tick / 2)
		i--;
	return (-i);
}


/*
 * init_proto - initialize the protocol module's data
 */
void
init_proto(void)
{
	l_fp	dummy;
	int	i;

	/*
	 * Fill in the sys_* stuff.  Default is don't listen to
	 * broadcasting, require authentication.
	 */
	sys_leap = LEAP_NOTINSYNC;
	sys_stratum = STRATUM_UNSPEC;
	memcpy(&sys_refid, "INIT", 4);
	sys_peer = NULL;
	sys_rootdelay = 0;
	sys_rootdisp = 0;
	L_CLR(&sys_reftime);
	sys_jitter = 0;
	sys_precision = (s_char)default_get_precision();
	get_systime(&dummy);
	sys_survivors = 0;
	sys_manycastserver = 0;
	sys_bclient = 0;
	sys_bdelay = 0;
	sys_authenticate = 1;
	sys_stattime = current_time;
	proto_clr_stats();
	for (i = 0; i < MAX_TTL; i++) {
		sys_ttl[i] = (u_char)((i * 256) / MAX_TTL);
		sys_ttlmax = i;
	}
	pps_enable = 0;
	stats_control = 1;
}


/*
 * proto_config - configure the protocol module
 */
void
proto_config(
	int	item,
	u_long	value,
	double	dvalue,
	sockaddr_u *svalue
	)
{
	/*
	 * Figure out what he wants to change, then do it
	 */
	DPRINTF(2, ("proto_config: code %d value %lu dvalue %lf\n",
		    item, value, dvalue));

	switch (item) {

	/*
	 * enable and disable commands - arguments are Boolean.
	 */
	case PROTO_AUTHENTICATE: /* authentication (auth) */
		sys_authenticate = value;
		break;

	case PROTO_BROADCLIENT: /* broadcast client (bclient) */
		sys_bclient = (int)value;
		if (sys_bclient == 0)
			io_unsetbclient();
		else
			io_setbclient();
		break;

#ifdef REFCLOCK
	case PROTO_CAL:		/* refclock calibrate (calibrate) */
		cal_enable = value;
		break;
#endif /* REFCLOCK */

	case PROTO_KERNEL:	/* kernel discipline (kernel) */
		kern_enable = value;
		break;

	case PROTO_MONITOR:	/* monitoring (monitor) */
		if (value)
			mon_start(MON_ON);
		else
			mon_stop(MON_ON);
		break;

	case PROTO_NTP:		/* NTP discipline (ntp) */
		ntp_enable = value;
		break;

	case PROTO_PPS:		/* PPS discipline (pps) */
		pps_enable = value;
		break;

	case PROTO_FILEGEN:	/* statistics (stats) */
		stats_control = value;
		break;

	/*
	 * tos command - arguments are double, sometimes cast to int
	 */
	case PROTO_BEACON:	/* manycast beacon (beacon) */
		sys_beacon = (int)dvalue;
		break;

	case PROTO_BROADDELAY:	/* default broadcast delay (bdelay) */
		sys_bdelay = dvalue;
		break;

	case PROTO_CEILING:	/* stratum ceiling (ceiling) */
		sys_ceiling = (int)dvalue;
		break;

	case PROTO_COHORT:	/* cohort switch (cohort) */
		sys_cohort = (int)dvalue;
		break;

	case PROTO_FLOOR:	/* stratum floor (floor) */
		sys_floor = (int)dvalue;
		break;

	case PROTO_MAXCLOCK:	/* maximum candidates (maxclock) */
		sys_maxclock = (int)dvalue;
		break;

	case PROTO_MAXDIST:	/* select threshold (maxdist) */
		sys_maxdist = dvalue;
		break;

	case PROTO_CALLDELAY:	/* modem call delay (mdelay) */
		break;		/* NOT USED */

	case PROTO_MINCLOCK:	/* minimum candidates (minclock) */
		sys_minclock = (int)dvalue;
		break;

	case PROTO_MINDISP:	/* minimum distance (mindist) */
		sys_mindisp = dvalue;
		break;

	case PROTO_MINSANE:	/* minimum survivors (minsane) */
		sys_minsane = (int)dvalue;
		break;

	case PROTO_ORPHAN:	/* orphan stratum (orphan) */
		sys_orphan = (int)dvalue;
		break;

	case PROTO_ADJ:		/* tick increment (tick) */
		sys_tick = dvalue;
		break;

	/*
	 * Miscellaneous commands
	 */
	case PROTO_MULTICAST_ADD: /* add group address */
		if (svalue != NULL)
			io_multicast_add(svalue);
		sys_bclient = 1;
		break;

	case PROTO_MULTICAST_DEL: /* delete group address */
		if (svalue != NULL)
			io_multicast_del(svalue);
		break;

	default:
		msyslog(LOG_NOTICE,
		    "proto: unsupported option %d", item);
	}
}


/*
 * proto_clr_stats - clear protocol stat counters
 */
void
proto_clr_stats(void)
{
	sys_stattime = current_time;
	sys_received = 0;
	sys_processed = 0;
	sys_newversion = 0;
	sys_oldversion = 0;
	sys_declined = 0;
	sys_restricted = 0;
	sys_badlength = 0;
	sys_badauth = 0;
	sys_limitrejected = 0;
}
ntp-4.2.6p5/ntpd/refclock_wwvb.c0000644000175000017500000003740211567107101015564 0ustar  peterpeter/*
 * refclock_wwvb - clock driver for Spectracom WWVB and GPS receivers
 */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_SPECTRACOM)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_calendar.h"
#include "ntp_stdlib.h"

#include 
#include 

#ifdef HAVE_PPSAPI
#include "ppsapi_timepps.h"
#include "refclock_atom.h"
#endif /* HAVE_PPSAPI */

/*
 * This driver supports the Spectracom Model 8170 and Netclock/2 WWVB
 * Synchronized Clocks and the Netclock/GPS Master Clock. Both the WWVB
 * and GPS clocks have proven reliable sources of time; however, the
 * WWVB clocks have proven vulnerable to high ambient conductive RF
 * interference. The claimed accuracy of the WWVB clocks is 100 us
 * relative to the broadcast signal, while the claimed accuracy of the
 * GPS clock is 50 ns; however, in most cases the actual accuracy is
 * limited by the resolution of the timecode and the latencies of the
 * serial interface and operating system.
 *
 * The WWVB and GPS clocks should be configured for 24-hour display,
 * AUTO DST off, time zone 0 (UTC), data format 0 or 2 (see below) and
 * baud rate 9600. If the clock is to used as the source for the IRIG
 * Audio Decoder (refclock_irig.c in this distribution), it should be
 * configured for AM IRIG output and IRIG format 1 (IRIG B with
 * signature control). The GPS clock can be configured either to respond
 * to a 'T' poll character or left running continuously. 
 *
 * There are two timecode formats used by these clocks. Format 0, which
 * is available with both the Netclock/2 and 8170, and format 2, which
 * is available only with the Netclock/2, specially modified 8170 and
 * GPS.
 *
 * Format 0 (22 ASCII printing characters):
 *
 * i  ddd hh:mm:ss TZ=zz
 *
 *	on-time = first 
 *	hh:mm:ss = hours, minutes, seconds
 *	i = synchronization flag (' ' = in synch, '?' = out of synch)
 *
 * The alarm condition is indicated by other than ' ' at i, which occurs
 * during initial synchronization and when received signal is lost for
 * about ten hours.
 *
 * Format 2 (24 ASCII printing characters):
 *
 * iqyy ddd hh:mm:ss.fff ld
 *
 *	on-time = 
 *	i = synchronization flag (' ' = in synch, '?' = out of synch)
 *	q = quality indicator (' ' = locked, 'A'...'D' = unlocked)
 *	yy = year (as broadcast)
 *	ddd = day of year
 *	hh:mm:ss.fff = hours, minutes, seconds, milliseconds
 *
 * The alarm condition is indicated by other than ' ' at i, which occurs
 * during initial synchronization and when received signal is lost for
 * about ten hours. The unlock condition is indicated by other than ' '
 * at q.
 *
 * The q is normally ' ' when the time error is less than 1 ms and a
 * character in the set 'A'...'D' when the time error is less than 10,
 * 100, 500 and greater than 500 ms respectively. The l is normally ' ',
 * but is set to 'L' early in the month of an upcoming UTC leap second
 * and reset to ' ' on the first day of the following month. The d is
 * set to 'S' for standard time 'I' on the day preceding a switch to
 * daylight time, 'D' for daylight time and 'O' on the day preceding a
 * switch to standard time. The start bit of the first  is
 * synchronized to the indicated time as returned.
 *
 * This driver does not need to be told which format is in use - it
 * figures out which one from the length of the message. The driver
 * makes no attempt to correct for the intrinsic jitter of the radio
 * itself, which is a known problem with the older radios.
 *
 * PPS Signal Processing
 *
 * When PPS signal processing is enabled, and when the system clock has
 * been set by this or another driver and the PPS signal offset is
 * within 0.4 s of the system clock offset, the PPS signal replaces the
 * timecode for as long as the PPS signal is active. If for some reason
 * the PPS signal fails for one or more poll intervals, the driver
 * reverts to the timecode. If the timecode fails for one or more poll
 * intervals, the PPS signal is disconnected.
 *
 * Fudge Factors
 *
 * This driver can retrieve a table of quality data maintained
 * internally by the Netclock/2 clock. If flag4 of the fudge
 * configuration command is set to 1, the driver will retrieve this
 * table and write it to the clockstats file when the first timecode
 * message of a new day is received.
 *
 * PPS calibration fudge time 1: format 0 .003134, format 2 .004034
 */
/*
 * Interface definitions
 */
#define	DEVICE		"/dev/wwvb%d" /* device name and unit */
#define	SPEED232	B9600	/* uart speed (9600 baud) */
#define	PRECISION	(-13)	/* precision assumed (about 100 us) */
#define	PPS_PRECISION	(-13)	/* precision assumed (about 100 us) */
#define	REFID		"WWVB"	/* reference ID */
#define	DESCRIPTION	"Spectracom WWVB/GPS Receiver" /* WRU */

#define	LENWWVB0	22	/* format 0 timecode length */
#define	LENWWVB2	24	/* format 2 timecode length */
#define LENWWVB3	29	/* format 3 timecode length */
#define MONLIN		15	/* number of monitoring lines */

/*
 * WWVB unit control structure
 */
struct wwvbunit {
#ifdef HAVE_PPSAPI
	struct refclock_atom atom; /* PPSAPI structure */
	int	ppsapi_tried;	/* attempt PPSAPI once */
	int	ppsapi_lit;	/* time_pps_create() worked */
	int	tcount;		/* timecode sample counter */
	int	pcount;		/* PPS sample counter */
#endif /* HAVE_PPSAPI */
	l_fp	laststamp;	/* last  timestamp */
	int	prev_eol_cr;	/* was last EOL  (not )? */
	u_char	lasthour;	/* last hour (for monitor) */
	u_char	linect;		/* count ignored lines (for monitor */
};

/*
 * Function prototypes
 */
static	int	wwvb_start	(int, struct peer *);
static	void	wwvb_shutdown	(int, struct peer *);
static	void	wwvb_receive	(struct recvbuf *);
static	void	wwvb_poll	(int, struct peer *);
static	void	wwvb_timer	(int, struct peer *);
#ifdef HAVE_PPSAPI
static	void	wwvb_control	(int, const struct refclockstat *,
				 struct refclockstat *, struct peer *);
#define		WWVB_CONTROL	wwvb_control
#else
#define		WWVB_CONTROL	noentry
#endif /* HAVE_PPSAPI */

/*
 * Transfer vector
 */
struct	refclock refclock_wwvb = {
	wwvb_start,		/* start up driver */
	wwvb_shutdown,		/* shut down driver */
	wwvb_poll,		/* transmit poll message */
	WWVB_CONTROL,		/* fudge set/change notification */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old wwvb_buginfo) */
	wwvb_timer		/* called once per second */
};


/*
 * wwvb_start - open the devices and initialize data for processing
 */
static int
wwvb_start(
	int unit,
	struct peer *peer
	)
{
	register struct wwvbunit *up;
	struct refclockproc *pp;
	int fd;
	char device[20];

	/*
	 * Open serial port. Use CLK line discipline, if available.
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
	fd = refclock_open(device, SPEED232, LDISC_CLK);
	if (fd <= 0)
		return (0);

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc_zero(sizeof(*up));
	pp = peer->procptr;
	pp->io.clock_recv = wwvb_receive;
	pp->io.srcclock = (void *)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		pp->io.fd = -1;
		free(up);
		return (0);
	}
	pp->unitptr = up;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy(&pp->refid, REFID, 4);
	return (1);
}


/*
 * wwvb_shutdown - shut down the clock
 */
static void
wwvb_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct wwvbunit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = pp->unitptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}


/*
 * wwvb_receive - receive data from the serial interface
 */
static void
wwvb_receive(
	struct recvbuf *rbufp
	)
{
	struct wwvbunit *up;
	struct refclockproc *pp;
	struct peer *peer;

	l_fp	trtmp;		/* arrival timestamp */
	int	tz;		/* time zone */
	int	day, month;	/* ddd conversion */
	int	temp;		/* int temp */
	char	syncchar;	/* synchronization indicator */
	char	qualchar;	/* quality indicator */
	char	leapchar;	/* leap indicator */
	char	dstchar;	/* daylight/standard indicator */
	char	tmpchar;	/* trashbin */

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = rbufp->recv_peer;
	pp = peer->procptr;
	up = pp->unitptr;
	temp = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);

	/*
	 * Note we get a buffer and timestamp for both a  and ,
	 * but only the  timestamp is retained. Note: in format 0 on
	 * a Netclock/2 or upgraded 8170 the start bit is delayed 100
	 * +-50 us relative to the pps; however, on an unmodified 8170
	 * the start bit can be delayed up to 10 ms. In format 2 the
	 * reading precision is only to the millisecond. Thus, unless
	 * you have a PPS gadget and don't have to have the year, format
	 * 0 provides the lowest jitter.
	 * Save the timestamp of each  in up->laststamp.  Lines with
	 * no characters occur for every , and for some s when
	 * format 0 is used. Format 0 starts and ends each cycle with a
	 *  pair, format 2 starts each cycle with its only pair.
	 * The preceding  is the on-time character for both formats.
	 * The timestamp provided with non-empty lines corresponds to
	 * the  following the timecode, which is ultimately not used
	 * with format 0 and is used for the following timecode for
	 * format 2.
	 */
	if (temp == 0) {
		if (up->prev_eol_cr) {
			DPRINTF(2, ("wwvb:  @ %s\n",
				    prettydate(&trtmp)));
		} else {
			up->laststamp = trtmp;
			DPRINTF(2, ("wwvb:  @ %s\n", 
				    prettydate(&trtmp)));
		}
		up->prev_eol_cr = !up->prev_eol_cr;
		return;
	}
	pp->lencode = temp;
	pp->lastrec = up->laststamp;
	up->laststamp = trtmp;
	up->prev_eol_cr = TRUE;
	DPRINTF(2, ("wwvb: code @ %s\n"
		    "       using %s minus one char\n",
		    prettydate(&trtmp), prettydate(&pp->lastrec)));
	if (L_ISZERO(&pp->lastrec))
		return;

	/*
	 * We get down to business, check the timecode format and decode
	 * its contents. This code uses the timecode length to determine
	 * format 0, 2 or 3. If the timecode has invalid length or is
	 * not in proper format, we declare bad format and exit.
	 */
	syncchar = qualchar = leapchar = dstchar = ' ';
	tz = 0;
	switch (pp->lencode) {

	case LENWWVB0:

		/*
		 * Timecode format 0: "I  ddd hh:mm:ss DTZ=nn"
		 */
		if (sscanf(pp->a_lastcode,
		    "%c %3d %2d:%2d:%2d%c%cTZ=%2d",
		    &syncchar, &pp->day, &pp->hour, &pp->minute,
		    &pp->second, &tmpchar, &dstchar, &tz) == 8) {
			pp->nsec = 0;
			break;
		}
		goto bad_format;

	case LENWWVB2:

		/*
		 * Timecode format 2: "IQyy ddd hh:mm:ss.mmm LD" */
		if (sscanf(pp->a_lastcode,
		    "%c%c %2d %3d %2d:%2d:%2d.%3ld %c",
		    &syncchar, &qualchar, &pp->year, &pp->day,
		    &pp->hour, &pp->minute, &pp->second, &pp->nsec,
		    &leapchar) == 9) {
			pp->nsec *= 1000000;
			break;
		}
		goto bad_format;

	case LENWWVB3:

		/*
		 * Timecode format 3: "0003I yyyymmdd hhmmss+0000SL#"
		 * WARNING: Undocumented, and the on-time character # is
		 * not yet handled correctly by this driver.  It may be
		 * as simple as compensating for an additional 1/960 s.
		 */
		if (sscanf(pp->a_lastcode,
		    "0003%c %4d%2d%2d %2d%2d%2d+0000%c%c",
		    &syncchar, &pp->year, &month, &day, &pp->hour,
		    &pp->minute, &pp->second, &dstchar, &leapchar) == 8)
		    {
			pp->day = ymd2yd(pp->year, month, day);
			pp->nsec = 0;
			break;
		}
		goto bad_format;

	default:
	bad_format:

		/*
		 * Unknown format: If dumping internal table, record
		 * stats; otherwise, declare bad format.
		 */
		if (up->linect > 0) {
			up->linect--;
			record_clock_stats(&peer->srcadr,
			    pp->a_lastcode);
		} else {
			refclock_report(peer, CEVNT_BADREPLY);
		}
		return;
	}

	/*
	 * Decode synchronization, quality and leap characters. If
	 * unsynchronized, set the leap bits accordingly and exit.
	 * Otherwise, set the leap bits according to the leap character.
	 * Once synchronized, the dispersion depends only on the
	 * quality character.
	 */
	switch (qualchar) {

	    case ' ':
		pp->disp = .001;
		pp->lastref = pp->lastrec;
		break;

	    case 'A':
		pp->disp = .01;
		break;

	    case 'B':
		pp->disp = .1;
		break;

	    case 'C':
		pp->disp = .5;
		break;

	    case 'D':
		pp->disp = MAXDISPERSE;
		break;

	    default:
		pp->disp = MAXDISPERSE;
		refclock_report(peer, CEVNT_BADREPLY);
		break;
	}
	if (syncchar != ' ')
		pp->leap = LEAP_NOTINSYNC;
	else if (leapchar == 'L')
		pp->leap = LEAP_ADDSECOND;
	else
		pp->leap = LEAP_NOWARNING;

	/*
	 * Process the new sample in the median filter and determine the
	 * timecode timestamp, but only if the PPS is not in control.
	 */
#ifdef HAVE_PPSAPI
	up->tcount++;
	if (peer->flags & FLAG_PPS)
		return;

#endif /* HAVE_PPSAPI */
	if (!refclock_process_f(pp, pp->fudgetime2))
		refclock_report(peer, CEVNT_BADTIME);
}


/*
 * wwvb_timer - called once per second by the transmit procedure
 */
static void
wwvb_timer(
	int unit,
	struct peer *peer
	)
{
	register struct wwvbunit *up;
	struct refclockproc *pp;
	char	pollchar;	/* character sent to clock */
	l_fp	now;

	/*
	 * Time to poll the clock. The Spectracom clock responds to a
	 * 'T' by returning a timecode in the format(s) specified above.
	 * Note there is no checking on state, since this may not be the
	 * only customer reading the clock. Only one customer need poll
	 * the clock; all others just listen in.
	 */
	pp = peer->procptr;
	up = pp->unitptr;
	if (up->linect > 0)
		pollchar = 'R';
	else
		pollchar = 'T';
	if (write(pp->io.fd, &pollchar, 1) != 1)
		refclock_report(peer, CEVNT_FAULT);
#ifdef DEBUG
	get_systime(&now);
	if (debug)
		printf("%c poll at %s\n", pollchar, prettydate(&now));
#endif
#ifdef HAVE_PPSAPI
	if (up->ppsapi_lit &&
	    refclock_pps(peer, &up->atom, pp->sloppyclockflag) > 0) {
		up->pcount++,
		peer->flags |= FLAG_PPS;
		peer->precision = PPS_PRECISION;
	}
#endif /* HAVE_PPSAPI */
}


/*
 * wwvb_poll - called by the transmit procedure
 */
static void
wwvb_poll(
	int unit,
	struct peer *peer
	)
{
	register struct wwvbunit *up;
	struct refclockproc *pp;

	/*
	 * Sweep up the samples received since the last poll. If none
	 * are received, declare a timeout and keep going.
	 */
	pp = peer->procptr;
	up = pp->unitptr;
	pp->polls++;

	/*
	 * If the monitor flag is set (flag4), we dump the internal
	 * quality table at the first timecode beginning the day.
	 */
	if (pp->sloppyclockflag & CLK_FLAG4 && pp->hour <
	    (int)up->lasthour)
		up->linect = MONLIN;
	up->lasthour = (u_char)pp->hour;

	/*
	 * Process median filter samples. If none received, declare a
	 * timeout and keep going.
	 */
#ifdef HAVE_PPSAPI
	if (up->pcount == 0) {
		peer->flags &= ~FLAG_PPS;
		peer->precision = PRECISION;
	}
	if (up->tcount == 0) {
		pp->coderecv = pp->codeproc;
		refclock_report(peer, CEVNT_TIMEOUT);
		return;
	}
	up->pcount = up->tcount = 0;
#else /* HAVE_PPSAPI */
	if (pp->coderecv == pp->codeproc) {
		refclock_report(peer, CEVNT_TIMEOUT);
		return;
	}
#endif /* HAVE_PPSAPI */
	refclock_receive(peer);
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
#ifdef DEBUG
	if (debug)
		printf("wwvb: timecode %d %s\n", pp->lencode,
		    pp->a_lastcode);
#endif
}


/*
 * wwvb_control - fudge parameters have been set or changed
 */
#ifdef HAVE_PPSAPI
static void
wwvb_control(
	int unit,
	const struct refclockstat *in_st,
	struct refclockstat *out_st,
	struct peer *peer
	)
{
	register struct wwvbunit *up;
	struct refclockproc *pp;
	
	pp = peer->procptr;
	up = pp->unitptr;

	if (!(pp->sloppyclockflag & CLK_FLAG1)) {
		if (!up->ppsapi_tried)
			return;
		up->ppsapi_tried = 0;
		if (!up->ppsapi_lit)
			return;
		peer->flags &= ~FLAG_PPS;
		peer->precision = PRECISION;
		time_pps_destroy(up->atom.handle);
		up->atom.handle = 0;
		up->ppsapi_lit = 0;
		return;
	}

	if (up->ppsapi_tried)
		return;
	/*
	 * Light up the PPSAPI interface.
	 */
	up->ppsapi_tried = 1;
	if (refclock_ppsapi(pp->io.fd, &up->atom)) {
		up->ppsapi_lit = 1;
		return;
	}

	NLOG(NLOG_CLOCKINFO)
		msyslog(LOG_WARNING, "%s flag1 1 but PPSAPI fails",
			refnumtoa(&peer->srcadr));
}
#endif	/* HAVE_PPSAPI */

#else
int refclock_wwvb_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_local.c0000644000175000017500000001457011307651604015676 0ustar  peterpeter
/*
 * refclock_local - local pseudo-clock driver
 *
 * wjm 17-aug-1995: add a hook for special treatment of VMS_LOCALUNIT
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#ifdef REFCLOCK

#include "ntpd.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"

#include 
#include 

#ifdef KERNEL_PLL
#include "ntp_syscall.h"
#endif

/*
 * This is a hack to allow a machine to use its own system clock as a
 * reference clock, i.e., to free-run using no outside clock discipline
 * source. Note that the clock selection algorithm will not select this
 * driver unless all other sources of synchronization have been lost.
 * This is useful if you want to use NTP in an isolated environment
 * with no radio clock or NIST modem available. Pick a machine that you
 * figure has a good clock oscillator and configure it with this
 * driver. Set the clock using the best means available, like
 * eyeball-and-wristwatch. Then, point all the other machines at this
 * one or use broadcast (not multicast) mode to distribute time.
 *
 * Another application for this driver is if you want to use a
 * particular server's clock as the clock of last resort when all other
 * normal synchronization sources have gone away. This is especially
 * useful if that server has an ovenized oscillator. However, the
 * preferred was to do this is using orphan mode. See the documentation.
 *
 * A third application for this driver is when an external discipline
 * source is available, such as the NIST "lockclock" program, which
 * synchronizes the local clock via a telephone modem and the NIST
 * Automated Computer Time Service (ACTS), or the Digital Time
 * Synchronization Service (DTSS), which runs on DCE machines. In this
 * case the stratum should be set at zero, indicating a bona fide
 * stratum-1 source. Exercise some caution with this, since there is no
 * easy way to telegraph via NTP that something might be wrong in the
 * discipline source itself. In the case of DTSS, the local clock can
 * have a rather large jitter, depending on the interval between
 * corrections and the intrinsic frequency error of the clock
 * oscillator. In extreme cases, this can cause clients to exceed the
 * 128-ms slew window and drop off the NTP subnet.
 *
 * Fudge Factors
 *
 * If fudge flag1 is lit, the leap second bit is set in the peer
 * status word. It should be set early in the day of a leap second
 * event and set dark on the day after the event.
 *
 * Note the fudge time1 and time2 have been deprecated. The fudge time1
 * was intended to apply a bias offset. This can be done using the Unix
 * date command. The fudge time2 was intended to apply a bias frequency.
 * This can be done using the frequency file and/or the freq
 * configuration command.
 */
/*
 * Local interface definitions
 */
#define PRECISION	(-7)	/* about 10 ms precision */
#define DESCRIPTION "Undisciplined local clock" /* WRU */
#define STRATUM 	5	/* default stratum */
#define DISPERSION	.01	/* default dispersion (10 ms) */

/*
 * Imported from the timer module
 */
extern u_long current_time;

/*
 * Imported from ntp_proto
 */
extern s_char sys_precision;

/*
 * Function prototypes
 */
static	int local_start (int, struct peer *);
static	void	local_poll	(int, struct peer *);

/*
 * Local variables
 */
static	u_long poll_time;	/* last time polled */
	
/*
 * Transfer vector
 */
struct	refclock refclock_local = {
	local_start,		/* start up driver */
	noentry,		/* shut down driver (not used) */
	local_poll,	 	/* transmit poll message */
	noentry,		/* not used (old lcl_control) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old lcl_buginfo) */
	NOFLAGS 		/* not used */
};


/*
 * local_start - start up the clock
 */
static int
local_start(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;

	pp = peer->procptr;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = sys_precision;
	pp->leap = LEAP_NOTINSYNC;
	peer->stratum = STRATUM;
	pp->stratum = STRATUM;
	pp->clockdesc = DESCRIPTION;
	memcpy(&pp->refid, "LOCL", 4);
	poll_time = current_time;
	return (1);
}


/*
 * local_poll - called by the transmit procedure
 *
 * LOCKCLOCK: If the kernel supports the nanokernel or microkernel
 * system calls, the leap bits are extracted from the kernel. If there
 * is a kernel error or the kernel leap bits are set to 11, the NTP leap
 * bits are set to 11 and the stratum is set to infinity. Otherwise, the
 * NTP leap bits are set to the kernel leap bits and the stratum is set
 * as fudged. This behavior does not faithfully follow the
 * specification, but is probably more appropriate in a multiple-server
 * national laboratory network.
 */
static void
local_poll(
	int unit,
	struct peer *peer
	)
{
#if defined(KERNEL_PLL) && defined(LOCKCLOCK)
	struct timex ntv;
#endif /* KERNEL_PLL LOCKCLOCK */
	struct refclockproc *pp;

	/*
	 * Do no evil unless the house is dark or lit with our own lamp.
	 */
	if (!(sys_peer == NULL || sys_peer == peer))
		return;

#if defined(VMS) && defined(VMS_LOCALUNIT)
	if (unit == VMS_LOCALUNIT) {
		extern void vms_local_poll(struct peer *);

		vms_local_poll(peer);
		return;
	}
#endif /* VMS && VMS_LOCALUNIT */

	pp = peer->procptr;
	pp->polls++;

	/*
	 * Ramble through the usual filtering and grooming code, which
	 * is essentially a no-op and included mostly for pretty
	 * billboards. We allow a one-time time adjustment using fudge
	 * time1 (s) and a continuous frequency adjustment using fudge
	 * time 2 (ppm).
	 */
	poll_time = current_time;
	refclock_process_offset(pp, pp->lastrec, pp->lastrec, 0);

	/*
	 * If another process is disciplining the system clock, we set
	 * the leap bits and quality indicators from the kernel.
	 */
#if defined(KERNEL_PLL) && defined(LOCKCLOCK)
	memset(&ntv,  0, sizeof ntv);
	switch (ntp_adjtime(&ntv)) {
	case TIME_OK:
		pp->leap = LEAP_NOWARNING;
		peer->stratum = pp->stratum;
		break;

	case TIME_INS:
		pp->leap = LEAP_ADDSECOND;
		peer->stratum = pp->stratum;
		break;

	case TIME_DEL:
		pp->leap = LEAP_DELSECOND;
		peer->stratum = pp->stratum;
		break;

	default:
		pp->leap = LEAP_NOTINSYNC;
		peer->stratum = STRATUM_UNSPEC;
	}
	pp->disp = 0;
	pp->jitter = 0;
#else /* KERNEL_PLL LOCKCLOCK */
	if (pp->sloppyclockflag & CLK_FLAG1)
		pp->leap = LEAP_ADDSECOND;
	else
		pp->leap = LEAP_NOWARNING;
	pp->disp = DISPERSION;
	pp->jitter = 0;
#endif /* KERNEL_PLL LOCKCLOCK */
	pp->lastref = pp->lastrec;
	refclock_receive(peer);
}
#else
int refclock_local_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/jupiter.h0000644000175000017500000002215110017034563014411 0ustar  peterpeter/* @(#) $Header$ (LBL) */

/*
 * Rockwell Jupiter GPS receiver definitions
 *
 * This is all based on the "Zodiac GPS Receiver Family Designer's
 * Guide" (dated 12/96)
 */

#define JUPITER_SYNC		0x81ff	/* sync word (book says 0xff81 !?!?) */
#define JUPITER_ALL		0xffff	/* disable all output messages */

/* Output messages (sent by the Jupiter board) */
#define JUPITER_O_GPOS		1000	/* geodetic position status */
#define JUPITER_O_EPOS		1001	/* ECEF position status */
#define JUPITER_O_CHAN		1002	/* channel summary */
#define JUPITER_O_VIS		1003	/* visible satellites */
#define JUPITER_O_DGPS		1005	/* differential GPS status */
#define JUPITER_O_MEAS		1007	/* channel measurement */
#define JUPITER_O_ID		1011	/* receiver id */
#define JUPITER_O_USER		1012	/* user-settings output */
#define JUPITER_O_TEST		1100	/* built-in test results */
#define JUPITER_O_MARK		1102	/* measurement time mark */
#define JUPITER_O_PULSE		1108	/* UTC time mark pulse output */
#define JUPITER_O_PORT		1130	/* serial port com parameters in use */
#define JUPITER_O_EUP		1135	/* EEPROM update */
#define JUPITER_O_ESTAT		1136	/* EEPROM status */

/* Input messages (sent to the Jupiter board) */
#define JUPITER_I_PVTINIT	1200	/* geodetic position and velocity */
#define JUPITER_I_USER		1210	/* user-defined datum */
#define JUPITER_I_MAPSEL	1211	/* map datum select */
#define JUPITER_I_ELEV		1212	/* satellite elevation mask control */
#define JUPITER_I_CAND		1213	/* satellite candidate select */
#define JUPITER_I_DGPS		1214	/* differential GPS control */
#define JUPITER_I_COLD		1216	/* cold start control */
#define JUPITER_I_VALID		1217	/* solution validity criteria */
#define JUPITER_I_ALT		1219	/* user-entered altitude input */
#define JUPITER_I_PLAT		1220	/* application platform control */
#define JUPITER_I_NAV		1221	/* nav configuration */
#define JUPITER_I_TEST		1300	/* preform built-in test command */
#define JUPITER_I_RESTART	1303	/* restart command */
#define JUPITER_I_PORT		1330	/* serial port com parameters */
#define JUPITER_I_PROTO		1331	/* message protocol control */
#define JUPITER_I_RDGPS		1351	/* raw DGPS RTCM SC-104 data */

struct jheader {
	u_short sync;		/* (JUPITER_SYNC) */
	u_short id;		/* message id */
	u_short len;		/* number of data short wordss (w/o cksum) */
	u_char reqid;		/* JUPITER_REQID_MASK bits available as id */
	u_char flags;		/* flags */
	u_short hsum;		/* header cksum */
};

#define JUPITER_REQID_MASK	0x3f	/* bits available as id */
#define JUPITER_FLAG_NAK	0x01	/* negative acknowledgement */
#define JUPITER_FLAG_ACK	0x02	/* acknowledgement */
#define JUPITER_FLAG_REQUEST	0x04	/* request ACK or NAK */
#define JUPITER_FLAG_QUERY	0x08	/* request one shot output message */
#define JUPITER_FLAG_LOG	0x20	/* request periodic output message */
#define JUPITER_FLAG_CONN	0x40	/* enable periodic message */
#define JUPITER_FLAG_DISC	0x80	/* disable periodic message */

#define JUPITER_H_FLAG_BITS \
    "\020\1NAK\2ACK\3REQUEST\4QUERY\5MBZ\6LOG\7CONN\10DISC"

/* Log request messages (data payload when using JUPITER_FLAG_LOG) */
struct jrequest {
	u_short trigger;		/* if 0, trigger on time trigger on
					   update (e.g. new almanac) */
	u_short interval;		/* frequency in seconds */
	u_short offset;			/* offset into minute */
	u_short dsum;			/* checksum */
};

/* JUPITER_O_GPOS (1000) */
struct jgpos {
	u_short stime[2];		/* set time (10 ms ticks) */
	u_short seq;			/* sequence number */
	u_short sseq;			/* sat measurement sequence number */
	u_short navval;			/* navigation soltuion validity */
	u_short navtype;		/* navigation solution type */
	u_short nmeas;			/* # of measurements used in solution */
	u_short polar;			/* if 1 then polar navigation */
	u_short gweek;			/* GPS week number */
	u_short sweek[2];		/* GPS seconds into week */
	u_short nsweek[2];		/* GPS nanoseconds into second */
	u_short utcday;			/* 1 to 31 */
	u_short utcmon;			/* 1 to 12 */
	u_short utcyear;		/* 1980 to 2079 */
	u_short utchour;		/* 0 to 23 */
	u_short utcmin;			/* 0 to 59 */
	u_short utcsec;			/* 0 to 59 */
	u_short utcnsec[2];		/* 0 to 999999999 */
	u_short lat[2];			/* latitude (radians) */
	u_short lon[2];			/* longitude (radians) */
	u_short height[2];		/* height (meters) */
	u_short gsep;			/* geoidal separation */
	u_short speed[2];		/* ground speed (meters/sec) */
	u_short course;			/* true course (radians) */
	u_short mvar;
	u_short climb;
	u_short mapd;
	u_short herr[2];
	u_short verr[2];
	u_short terr[2];
	u_short hverr;
	u_short bias[2];
	u_short biassd[2];
	u_short drift[2];
	u_short driftsd[2];
	u_short dsum;			/* checksum */
};
#define JUPITER_O_GPOS_NAV_NOALT	0x01	/* altitude used */
#define JUPITER_O_GPOS_NAV_NODGPS	0x02	/* no differential GPS */
#define JUPITER_O_GPOS_NAV_NOSAT	0x04	/* not enough satellites */
#define JUPITER_O_GPOS_NAV_MAXH		0x08	/* exceeded max EHPE */
#define JUPITER_O_GPOS_NAV_MAXV		0x10	/* exceeded max EVPE */

/* JUPITER_O_CHAN (1002) */
struct jchan {
	u_short stime[2];		/* set time (10 ms ticks) */
	u_short seq;			/* sequence number */
	u_short sseq;			/* sat measurement sequence number */
	u_short gweek;			/* GPS week number */
	u_short sweek[2];		/* GPS seconds into week */
	u_short gpsns[2];		/* GPS nanoseconds from epoch */
	struct jchan2 {
		u_short flags;		/* flags */
		u_short prn;		/* satellite PRN */
		u_short chan;		/* channel number */
	} sat[12];
	u_short dsum;
};

/* JUPITER_O_VIS (1003) */
struct jvis {
	u_short stime[2];		/* set time (10 ms ticks) */
	u_short seq;			/* sequence number */
	u_short gdop;			/* best possible GDOP */
	u_short pdop;			/* best possible PDOP */
	u_short hdop;			/* best possible HDOP */
	u_short vdop;			/* best possible VDOP */
	u_short tdop;			/* best possible TDOP */
	u_short nvis;			/* number of visible satellites */
	struct jvis2 {
		u_short prn;		/* satellite PRN */
		u_short azi;		/* satellite azimuth (radians) */
		u_short elev;		/* satellite elevation (radians) */
	} sat[12];
	u_short dsum;			/* checksum */
};

/* JUPITER_O_ID (1011) */
struct jid {
	u_short stime[2];		/* set time (10 ms ticks) */
	u_short seq;			/* sequence number */
	char chans[20];			/* number of channels (ascii) */
	char vers[20];			/* software version (ascii) */
	char date[20];			/* software date (ascii) */
	char opts[20];			/* software options (ascii) */
	char reserved[20];
	u_short dsum;			/* checksum */
};

/* JUPITER_O_USER (1012) */
struct juser {
	u_short stime[2];		/* set time (10 ms ticks) */
	u_short seq;			/* sequence number */
	u_short status;			/* operatinoal status */
	u_short coldtmo;		/* cold start time-out */
	u_short dgpstmo;		/* DGPS correction time-out*/
	u_short emask;			/* elevation mask */
	u_short selcand[2];		/* selected candidate */
	u_short solflags;		/* solution validity criteria */
	u_short nsat;			/* number of satellites in track */
	u_short herr[2];		/* minimum expected horizontal error */
	u_short verr[2];		/* minimum expected vertical error */
	u_short platform;		/* application platform */
	u_short dsum;			/* checksum */
};

/* JUPITER_O_PULSE (1108) */
struct jpulse {
	u_short stime[2];		/* set time (10 ms ticks) */
	u_short seq;			/* sequence number */
	u_short reserved[5];
	u_short sweek[2];		/* GPS seconds into week */
	short offs;			/* GPS to UTC time offset (seconds) */
	u_short offns[2];		/* GPS to UTC offset (nanoseconds) */
	u_short flags;			/* flags */
	u_short dsum;			/* checksum */
};
#define JUPITER_O_PULSE_VALID		0x1	/* time mark validity */
#define JUPITER_O_PULSE_UTC		0x2	/* GPS/UTC sync */

/* JUPITER_O_EUP (1135) */
struct jeup {
	u_short stime[2];		/* set time (10 ms ticks) */
	u_short seq;			/* sequence number */
	u_char dataid;			/* data id */
	u_char prn;			/* satellite PRN */
	u_short dsum;			/* checksum */
};

/* JUPITER_I_RESTART (1303) */
struct jrestart {
	u_short seq;			/* sequence number */
	u_short flags;
	u_short dsum;			/* checksum */
};
#define JUPITER_I_RESTART_INVRAM	0x01
#define JUPITER_I_RESTART_INVEEPROM	0x02
#define JUPITER_I_RESTART_INVRTC	0x04
#define JUPITER_I_RESTART_COLD		0x80

/* JUPITER_I_PVTINIT (1200) */
struct jpvtinit {
	u_short flags;
	u_short gweek;			/* GPS week number */
	u_short sweek[2];		/* GPS seconds into week */
	u_short utcday;			/* 1 to 31 */
	u_short utcmon;			/* 1 to 12 */
	u_short utcyear;		/* 1980 to 2079 */
	u_short utchour;		/* 0 to 23 */
	u_short utcmin;			/* 0 to 59 */
	u_short utcsec;			/* 0 to 59 */
	u_short lat[2];			/* latitude (radians) */
	u_short lon[2];			/* longitude (radians) */
	u_short height[2];		/* height (meters) */
	u_short speed[2];		/* ground speed (meters/sec) */
	u_short course;			/* true course (radians) */
	u_short climb;
	u_short dsum;
};
#define JUPITER_I_PVTINIT_FORCE		0x01
#define JUPITER_I_PVTINIT_GPSVAL	0x02
#define JUPITER_I_PVTINIT_UTCVAL	0x04
#define JUPITER_I_PVTINIT_POSVAL	0x08
#define JUPITER_I_PVTINIT_ALTVAL	0x10
#define JUPITER_I_PVTINIT_SPDVAL	0x12
#define JUPITER_I_PVTINIT_MAGVAL	0x14
#define JUPITER_I_PVTINIT_CLIMBVAL	0x18

/* JUPITER_I_PLAT (1220) */
struct jplat {
	u_short seq;			/* sequence number */
	u_short platform;		/* application platform */
	u_short dsum;
};
#define JUPITER_I_PLAT_DEFAULT		0	/* default dynamics */
#define JUPITER_I_PLAT_LOW		2	/* pedestrian */
#define JUPITER_I_PLAT_MED		5	/* land (e.g. automobile) */
#define JUPITER_I_PLAT_HIGH		6	/* air */
ntp-4.2.6p5/ntpd/refclock_irig.c0000644000175000017500000007447111415050142015532 0ustar  peterpeter/*
 * refclock_irig - audio IRIG-B/E demodulator/decoder
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_IRIG)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_calendar.h"
#include "ntp_stdlib.h"

#include 
#include 
#include 
#ifdef HAVE_SYS_IOCTL_H
#include 
#endif /* HAVE_SYS_IOCTL_H */

#include "audio.h"

/*
 * Audio IRIG-B/E demodulator/decoder
 *
 * This driver synchronizes the computer time using data encoded in
 * IRIG-B/E signals commonly produced by GPS receivers and other timing
 * devices. The IRIG signal is an amplitude-modulated carrier with
 * pulse-width modulated data bits. For IRIG-B, the carrier frequency is
 * 1000 Hz and bit rate 100 b/s; for IRIG-E, the carrier frequenchy is
 * 100 Hz and bit rate 10 b/s. The driver automatically recognizes which
 & format is in use.
 *
 * The driver requires an audio codec or sound card with sampling rate 8
 * kHz and mu-law companding. This is the same standard as used by the
 * telephone industry and is supported by most hardware and operating
 * systems, including Solaris, SunOS, FreeBSD, NetBSD and Linux. In this
 * implementation, only one audio driver and codec can be supported on a
 * single machine.
 *
 * The program processes 8000-Hz mu-law companded samples using separate
 * signal filters for IRIG-B and IRIG-E, a comb filter, envelope
 * detector and automatic threshold corrector. Cycle crossings relative
 * to the corrected slice level determine the width of each pulse and
 * its value - zero, one or position identifier.
 *
 * The data encode 20 BCD digits which determine the second, minute,
 * hour and day of the year and sometimes the year and synchronization
 * condition. The comb filter exponentially averages the corresponding
 * samples of successive baud intervals in order to reliably identify
 * the reference carrier cycle. A type-II phase-lock loop (PLL) performs
 * additional integration and interpolation to accurately determine the
 * zero crossing of that cycle, which determines the reference
 * timestamp. A pulse-width discriminator demodulates the data pulses,
 * which are then encoded as the BCD digits of the timecode.
 *
 * The timecode and reference timestamp are updated once each second
 * with IRIG-B (ten seconds with IRIG-E) and local clock offset samples
 * saved for later processing. At poll intervals of 64 s, the saved
 * samples are processed by a trimmed-mean filter and used to update the
 * system clock.
 *
 * An automatic gain control feature provides protection against
 * overdriven or underdriven input signal amplitudes. It is designed to
 * maintain adequate demodulator signal amplitude while avoiding
 * occasional noise spikes. In order to assure reliable capture, the
 * decompanded input signal amplitude must be greater than 100 units and
 * the codec sample frequency error less than 250 PPM (.025 percent).
 *
 * Monitor Data
 *
 * The timecode format used for debugging and data recording includes
 * data helpful in diagnosing problems with the IRIG signal and codec
 * connections. The driver produces one line for each timecode in the
 * following format:
 *
 * 00 00 98 23 19:26:52 2782 143 0.694 10 0.3 66.5 3094572411.00027
 *
 * If clockstats is enabled, the most recent line is written to the
 * clockstats file every 64 s. If verbose recording is enabled (fudge
 * flag 4) each line is written as generated.
 *
 * The first field containes the error flags in hex, where the hex bits
 * are interpreted as below. This is followed by the year of century,
 * day of year and time of day. Note that the time of day is for the
 * previous minute, not the current time. The status indicator and year
 * are not produced by some IRIG devices and appear as zeros. Following
 * these fields are the carrier amplitude (0-3000), codec gain (0-255),
 * modulation index (0-1), time constant (4-10), carrier phase error
 * +-.5) and carrier frequency error (PPM). The last field is the on-
 * time timestamp in NTP format.
 *
 * The error flags are defined as follows in hex:
 *
 * x01	Low signal. The carrier amplitude is less than 100 units. This
 *	is usually the result of no signal or wrong input port.
 * x02	Frequency error. The codec frequency error is greater than 250
 *	PPM. This may be due to wrong signal format or (rarely)
 *	defective codec.
 * x04	Modulation error. The IRIG modulation index is less than 0.5.
 *	This is usually the result of an overdriven codec, wrong signal
 *	format or wrong input port.
 * x08	Frame synch error. The decoder frame does not match the IRIG
 *	frame. This is usually the result of an overdriven codec, wrong
 *	signal format or noisy IRIG signal. It may also be the result of
 *	an IRIG signature check which indicates a failure of the IRIG
 *	signal synchronization source.
 * x10	Data bit error. The data bit length is out of tolerance. This is
 *	usually the result of an overdriven codec, wrong signal format
 *	or noisy IRIG signal.
 * x20	Seconds numbering discrepancy. The decoder second does not match
 *	the IRIG second. This is usually the result of an overdriven
 *	codec, wrong signal format or noisy IRIG signal.
 * x40	Codec error (overrun). The machine is not fast enough to keep up
 *	with the codec.
 * x80	Device status error (Spectracom).
 *
 *
 * Once upon a time, an UltrSPARC 30 and Solaris 2.7 kept the clock
 * within a few tens of microseconds relative to the IRIG-B signal.
 * Accuracy with IRIG-E was about ten times worse. Unfortunately, Sun
 * broke the 2.7 audio driver in 2.8, which has a 10-ms sawtooth
 * modulation.
 *
 * Unlike other drivers, which can have multiple instantiations, this
 * one supports only one. It does not seem likely that more than one
 * audio codec would be useful in a single machine. More than one would
 * probably chew up too much CPU time anyway.
 *
 * Fudge factors
 *
 * Fudge flag4 causes the dubugging output described above to be
 * recorded in the clockstats file. Fudge flag2 selects the audio input
 * port, where 0 is the mike port (default) and 1 is the line-in port.
 * It does not seem useful to select the compact disc player port. Fudge
 * flag3 enables audio monitoring of the input signal. For this purpose,
 * the monitor gain is set t a default value. Fudgetime2 is used as a
 * frequency vernier for broken codec sample frequency.
 *
 * Alarm codes
 *
 * CEVNT_BADTIME	invalid date or time
 * CEVNT_TIMEOUT	no IRIG data since last poll
 */
/*
 * Interface definitions
 */
#define	DEVICE_AUDIO	"/dev/audio" /* audio device name */
#define	PRECISION	(-17)	/* precision assumed (about 10 us) */
#define	REFID		"IRIG"	/* reference ID */
#define	DESCRIPTION	"Generic IRIG Audio Driver" /* WRU */
#define	AUDIO_BUFSIZ	320	/* audio buffer size (40 ms) */
#define SECOND		8000	/* nominal sample rate (Hz) */
#define BAUD		80	/* samples per baud interval */
#define OFFSET		128	/* companded sample offset */
#define SIZE		256	/* decompanding table size */
#define CYCLE		8	/* samples per bit */
#define SUBFLD		10	/* bits per frame */
#define FIELD		100	/* bits per second */
#define MINTC		2	/* min PLL time constant */
#define MAXTC		10	/* max PLL time constant max */
#define	MAXAMP		3000.	/* maximum signal amplitude */
#define	MINAMP		2000.	/* minimum signal amplitude */
#define DRPOUT		100.	/* dropout signal amplitude */
#define MODMIN		0.5	/* minimum modulation index */
#define MAXFREQ		(250e-6 * SECOND) /* freq tolerance (.025%) */

/*
 * The on-time synchronization point is the positive-going zero crossing
 * of the first cycle of the second. The IIR baseband filter phase delay
 * is 1.03 ms for IRIG-B and 3.47 ms for IRIG-E. The fudge value 2.68 ms
 * due to the codec and other causes was determined by calibrating to a
 * PPS signal from a GPS receiver.
 *
 * The results with a 2.4-GHz P4 running FreeBSD 6.1 are generally
 * within .02 ms short-term with .02 ms jitter. The processor load due
 * to the driver is 0.51 percent.
 */
#define IRIG_B	((1.03 + 2.68) / 1000)	/* IRIG-B system delay (s) */
#define IRIG_E	((3.47 + 2.68) / 1000)	/* IRIG-E system delay (s) */

/*
 * Data bit definitions
 */
#define BIT0		0	/* zero */
#define BIT1		1	/* one */
#define BITP		2	/* position identifier */

/*
 * Error flags
 */
#define IRIG_ERR_AMP	0x01	/* low carrier amplitude */
#define IRIG_ERR_FREQ	0x02	/* frequency tolerance exceeded */
#define IRIG_ERR_MOD	0x04	/* low modulation index */
#define IRIG_ERR_SYNCH	0x08	/* frame synch error */
#define IRIG_ERR_DECODE	0x10	/* frame decoding error */
#define IRIG_ERR_CHECK	0x20	/* second numbering discrepancy */
#define IRIG_ERR_ERROR	0x40	/* codec error (overrun) */
#define IRIG_ERR_SIGERR	0x80	/* IRIG status error (Spectracom) */

static	char	hexchar[] = "0123456789abcdef";

/*
 * IRIG unit control structure
 */
struct irigunit {
	u_char	timecode[2 * SUBFLD + 1]; /* timecode string */
	l_fp	timestamp;	/* audio sample timestamp */
	l_fp	tick;		/* audio sample increment */
	l_fp	refstamp;	/* reference timestamp */
	l_fp	chrstamp;	/* baud timestamp */
	l_fp	prvstamp;	/* previous baud timestamp */
	double	integ[BAUD];	/* baud integrator */
	double	phase, freq;	/* logical clock phase and frequency */
	double	zxing;		/* phase detector integrator */
	double	yxing;		/* cycle phase */
	double	exing;		/* envelope phase */
	double	modndx;		/* modulation index */
	double	irig_b;		/* IRIG-B signal amplitude */
	double	irig_e;		/* IRIG-E signal amplitude */
	int	errflg;		/* error flags */
	/*
	 * Audio codec variables
	 */
	double	comp[SIZE];	/* decompanding table */
	double	signal;		/* peak signal for AGC */
	int	port;		/* codec port */
	int	gain;		/* codec gain */
	int	mongain;	/* codec monitor gain */
	int	seccnt;		/* second interval counter */

	/*
	 * RF variables
	 */
	double	bpf[9];		/* IRIG-B filter shift register */
	double	lpf[5];		/* IRIG-E filter shift register */
	double	envmin, envmax;	/* envelope min and max */
	double	slice;		/* envelope slice level */
	double	intmin, intmax;	/* integrated envelope min and max */
	double	maxsignal;	/* integrated peak amplitude */
	double	noise;		/* integrated noise amplitude */
	double	lastenv[CYCLE];	/* last cycle amplitudes */
	double	lastint[CYCLE];	/* last integrated cycle amplitudes */
	double	lastsig;	/* last carrier sample */
	double	fdelay;		/* filter delay */
	int	decim;		/* sample decimation factor */
	int	envphase;	/* envelope phase */
	int	envptr;		/* envelope phase pointer */
	int	envsw;		/* envelope state */
	int	envxing;	/* envelope slice crossing */
	int	tc;		/* time constant */
	int	tcount;		/* time constant counter */
	int	badcnt;		/* decimation interval counter */

	/*
	 * Decoder variables
	 */
	int	pulse;		/* cycle counter */
	int	cycles;		/* carrier cycles */
	int	dcycles;	/* data cycles */
	int	lastbit;	/* last code element */
	int	second;		/* previous second */
	int	bitcnt;		/* bit count in frame */
	int	frmcnt;		/* bit count in second */
	int	xptr;		/* timecode pointer */
	int	bits;		/* demodulated bits */
};

/*
 * Function prototypes
 */
static	int	irig_start	(int, struct peer *);
static	void	irig_shutdown	(int, struct peer *);
static	void	irig_receive	(struct recvbuf *);
static	void	irig_poll	(int, struct peer *);

/*
 * More function prototypes
 */
static	void	irig_base	(struct peer *, double);
static	void	irig_rf		(struct peer *, double);
static	void	irig_baud	(struct peer *, int);
static	void	irig_decode	(struct peer *, int);
static	void	irig_gain	(struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_irig = {
	irig_start,		/* start up driver */
	irig_shutdown,		/* shut down driver */
	irig_poll,		/* transmit poll message */
	noentry,		/* not used (old irig_control) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old irig_buginfo) */
	NOFLAGS			/* not used */
};


/*
 * irig_start - open the devices and initialize data for processing
 */
static int
irig_start(
	int	unit,		/* instance number (used for PCM) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct irigunit *up;

	/*
	 * Local variables
	 */
	int	fd;		/* file descriptor */
	int	i;		/* index */
	double	step;		/* codec adjustment */

	/*
	 * Open audio device
	 */
	fd = audio_init(DEVICE_AUDIO, AUDIO_BUFSIZ, unit);
	if (fd < 0)
		return (0);
#ifdef DEBUG
	if (debug)
		audio_show();
#endif

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp = peer->procptr;
	pp->unitptr = (caddr_t)up;
	pp->io.clock_recv = irig_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		pp->io.fd = -1;
		free(up);
		pp->unitptr = NULL;
		return (0);
	}

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	up->tc = MINTC;
	up->decim = 1;
	up->gain = 127;

	/*
	 * The companded samples are encoded sign-magnitude. The table
	 * contains all the 256 values in the interest of speed.
	 */
	up->comp[0] = up->comp[OFFSET] = 0.;
	up->comp[1] = 1; up->comp[OFFSET + 1] = -1.;
	up->comp[2] = 3; up->comp[OFFSET + 2] = -3.;
	step = 2.;
	for (i = 3; i < OFFSET; i++) {
		up->comp[i] = up->comp[i - 1] + step;
		up->comp[OFFSET + i] = -up->comp[i];
		if (i % 16 == 0)
			step *= 2.;
	}
	DTOLFP(1. / SECOND, &up->tick);
	return (1);
}


/*
 * irig_shutdown - shut down the clock
 */
static void
irig_shutdown(
	int	unit,		/* instance number (not used) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct irigunit *up;

	pp = peer->procptr;
	up = (struct irigunit *)pp->unitptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}


/*
 * irig_receive - receive data from the audio device
 *
 * This routine reads input samples and adjusts the logical clock to
 * track the irig clock by dropping or duplicating codec samples.
 */
static void
irig_receive(
	struct recvbuf *rbufp	/* receive buffer structure pointer */
	)
{
	struct peer *peer;
	struct refclockproc *pp;
	struct irigunit *up;

	/*
	 * Local variables
	 */
	double	sample;		/* codec sample */
	u_char	*dpt;		/* buffer pointer */
	int	bufcnt;		/* buffer counter */
	l_fp	ltemp;		/* l_fp temp */

	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct irigunit *)pp->unitptr;

	/*
	 * Main loop - read until there ain't no more. Note codec
	 * samples are bit-inverted.
	 */
	DTOLFP((double)rbufp->recv_length / SECOND, <emp);
	L_SUB(&rbufp->recv_time, <emp);
	up->timestamp = rbufp->recv_time;
	dpt = rbufp->recv_buffer;
	for (bufcnt = 0; bufcnt < rbufp->recv_length; bufcnt++) {
		sample = up->comp[~*dpt++ & 0xff];

		/*
		 * Variable frequency oscillator. The codec oscillator
		 * runs at the nominal rate of 8000 samples per second,
		 * or 125 us per sample. A frequency change of one unit
		 * results in either duplicating or deleting one sample
		 * per second, which results in a frequency change of
		 * 125 PPM.
		 */
		up->phase += (up->freq + clock_codec) / SECOND;
		up->phase += pp->fudgetime2 / 1e6;
		if (up->phase >= .5) {
			up->phase -= 1.;
		} else if (up->phase < -.5) {
			up->phase += 1.;
			irig_rf(peer, sample);
			irig_rf(peer, sample);
		} else {
			irig_rf(peer, sample);
		}
		L_ADD(&up->timestamp, &up->tick);
		sample = fabs(sample);
		if (sample > up->signal)
			up->signal = sample;
			up->signal += (sample - up->signal) /
			    1000;

		/*
		 * Once each second, determine the IRIG format and gain.
		 */
		up->seccnt = (up->seccnt + 1) % SECOND;
		if (up->seccnt == 0) {
			if (up->irig_b > up->irig_e) {
				up->decim = 1;
				up->fdelay = IRIG_B;
			} else {
				up->decim = 10;
				up->fdelay = IRIG_E;
			}
			up->irig_b = up->irig_e = 0;
			irig_gain(peer);

		}
	}

	/*
	 * Set the input port and monitor gain for the next buffer.
	 */
	if (pp->sloppyclockflag & CLK_FLAG2)
		up->port = 2;
	else
		up->port = 1;
	if (pp->sloppyclockflag & CLK_FLAG3)
		up->mongain = MONGAIN;
	else
		up->mongain = 0;
}


/*
 * irig_rf - RF processing
 *
 * This routine filters the RF signal using a bandass filter for IRIG-B
 * and a lowpass filter for IRIG-E. In case of IRIG-E, the samples are
 * decimated by a factor of ten. Note that the codec filters function as
 * roofing filters to attenuate both the high and low ends of the
 * passband. IIR filter coefficients were determined using Matlab Signal
 * Processing Toolkit.
 */
static void
irig_rf(
	struct peer *peer,	/* peer structure pointer */
	double	sample		/* current signal sample */
	)
{
	struct refclockproc *pp;
	struct irigunit *up;

	/*
	 * Local variables
	 */
	double	irig_b, irig_e;	/* irig filter outputs */

	pp = peer->procptr;
	up = (struct irigunit *)pp->unitptr;

	/*
	 * IRIG-B filter. Matlab 4th-order IIR elliptic, 800-1200 Hz
	 * bandpass, 0.3 dB passband ripple, -50 dB stopband ripple,
	 * phase delay 1.03 ms.
	 */
	irig_b = (up->bpf[8] = up->bpf[7]) * 6.505491e-001;
	irig_b += (up->bpf[7] = up->bpf[6]) * -3.875180e+000;
	irig_b += (up->bpf[6] = up->bpf[5]) * 1.151180e+001;
	irig_b += (up->bpf[5] = up->bpf[4]) * -2.141264e+001;
	irig_b += (up->bpf[4] = up->bpf[3]) * 2.712837e+001;
	irig_b += (up->bpf[3] = up->bpf[2]) * -2.384486e+001;
	irig_b += (up->bpf[2] = up->bpf[1]) * 1.427663e+001;
	irig_b += (up->bpf[1] = up->bpf[0]) * -5.352734e+000;
	up->bpf[0] = sample - irig_b;
	irig_b = up->bpf[0] * 4.952157e-003
	    + up->bpf[1] * -2.055878e-002
	    + up->bpf[2] * 4.401413e-002
	    + up->bpf[3] * -6.558851e-002
	    + up->bpf[4] * 7.462108e-002
	    + up->bpf[5] * -6.558851e-002
	    + up->bpf[6] * 4.401413e-002
	    + up->bpf[7] * -2.055878e-002
	    + up->bpf[8] * 4.952157e-003;
	up->irig_b += irig_b * irig_b;

	/*
	 * IRIG-E filter. Matlab 4th-order IIR elliptic, 130-Hz lowpass,
	 * 0.3 dB passband ripple, -50 dB stopband ripple, phase delay
	 * 3.47 ms.
	 */
	irig_e = (up->lpf[4] = up->lpf[3]) * 8.694604e-001;
	irig_e += (up->lpf[3] = up->lpf[2]) * -3.589893e+000;
	irig_e += (up->lpf[2] = up->lpf[1]) * 5.570154e+000;
	irig_e += (up->lpf[1] = up->lpf[0]) * -3.849667e+000;
	up->lpf[0] = sample - irig_e;
	irig_e = up->lpf[0] * 3.215696e-003
	    + up->lpf[1] * -1.174951e-002
	    + up->lpf[2] * 1.712074e-002
	    + up->lpf[3] * -1.174951e-002
	    + up->lpf[4] * 3.215696e-003;
	up->irig_e += irig_e * irig_e;

	/*
	 * Decimate by a factor of either 1 (IRIG-B) or 10 (IRIG-E).
	 */
	up->badcnt = (up->badcnt + 1) % up->decim;
	if (up->badcnt == 0) {
		if (up->decim == 1)
			irig_base(peer, irig_b);
		else
			irig_base(peer, irig_e);
	}
}

/*
 * irig_base - baseband processing
 *
 * This routine processes the baseband signal and demodulates the AM
 * carrier using a synchronous detector. It then synchronizes to the
 * data frame at the baud rate and decodes the width-modulated data
 * pulses.
 */
static void
irig_base(
	struct peer *peer,	/* peer structure pointer */
	double	sample		/* current signal sample */
	)
{
	struct refclockproc *pp;
	struct irigunit *up;

	/*
	 * Local variables
	 */
	double	lope;		/* integrator output */
	double	env;		/* envelope detector output */
	double	dtemp;
	int	carphase;	/* carrier phase */

	pp = peer->procptr;
	up = (struct irigunit *)pp->unitptr;

	/*
	 * Synchronous baud integrator. Corresponding samples of current
	 * and past baud intervals are integrated to refine the envelope
	 * amplitude and phase estimate. We keep one cycle (1 ms) of the
	 * raw data and one baud (10 ms) of the integrated data.
	 */
	up->envphase = (up->envphase + 1) % BAUD;
	up->integ[up->envphase] += (sample - up->integ[up->envphase]) /
	    (5 * up->tc);
	lope = up->integ[up->envphase];
	carphase = up->envphase % CYCLE;
	up->lastenv[carphase] = sample;
	up->lastint[carphase] = lope;

	/*
	 * Phase detector. Find the negative-going zero crossing
	 * relative to sample 4 in the 8-sample sycle. A phase change of
	 * 360 degrees produces an output change of one unit.
	 */ 
	if (up->lastsig > 0 && lope <= 0)
		up->zxing += (double)(carphase - 4) / CYCLE;
	up->lastsig = lope;

	/*
	 * End of the baud. Update signal/noise estimates and PLL
	 * phase, frequency and time constant.
	 */
	if (up->envphase == 0) {
		up->maxsignal = up->intmax; up->noise = up->intmin;
		up->intmin = 1e6; up->intmax = -1e6;
		if (up->maxsignal < DRPOUT)
			up->errflg |= IRIG_ERR_AMP;
		if (up->maxsignal > 0)
			up->modndx = (up->maxsignal - up->noise) /
			    up->maxsignal;
 		else
			up->modndx = 0;
		if (up->modndx < MODMIN)
			up->errflg |= IRIG_ERR_MOD;
		if (up->errflg & (IRIG_ERR_AMP | IRIG_ERR_FREQ |
		   IRIG_ERR_MOD | IRIG_ERR_SYNCH)) {
			up->tc = MINTC;
			up->tcount = 0;
		}

		/*
		 * Update PLL phase and frequency. The PLL time constant
		 * is set initially to stabilize the frequency within a
		 * minute or two, then increases to the maximum. The
		 * frequency is clamped so that the PLL capture range
		 * cannot be exceeded.
		 */
		dtemp = up->zxing * up->decim / BAUD;
		up->yxing = dtemp;
		up->zxing = 0.;
		up->phase += dtemp / up->tc;
		up->freq += dtemp / (4. * up->tc * up->tc);
		if (up->freq > MAXFREQ) {
			up->freq = MAXFREQ;
			up->errflg |= IRIG_ERR_FREQ;
		} else if (up->freq < -MAXFREQ) {
			up->freq = -MAXFREQ;
			up->errflg |= IRIG_ERR_FREQ;
		}
	}

	/*
	 * Synchronous demodulator. There are eight samples in the cycle
	 * and ten cycles in the baud. Since the PLL has aligned the
	 * negative-going zero crossing at sample 4, the maximum
	 * amplitude is at sample 2 and minimum at sample 6. The
	 * beginning of the data pulse is determined from the integrated
	 * samples, while the end of the pulse is determined from the
	 * raw samples. The raw data bits are demodulated relative to
	 * the slice level and left-shifted in the decoding register.
	 */
	if (carphase != 7)
		return;

	lope = (up->lastint[2] - up->lastint[6]) / 2.;
	if (lope > up->intmax)
		up->intmax = lope;
	if (lope < up->intmin)
		up->intmin = lope;

	/*
	 * Pulse code demodulator and reference timestamp. The decoder
	 * looks for a sequence of ten bits; the first two bits must be
	 * one, the last two bits must be zero. Frame synch is asserted
	 * when three correct frames have been found.
	 */
	up->pulse = (up->pulse + 1) % 10;
	up->cycles <<= 1;
	if (lope >= (up->maxsignal + up->noise) / 2.)
		up->cycles |= 1;
	if ((up->cycles & 0x303c0f03) == 0x300c0300) {
		if (up->pulse != 0)
			up->errflg |= IRIG_ERR_SYNCH;
		up->pulse = 0;
	}

	/*
	 * Assemble the baud and max/min to get the slice level for the
	 * next baud. The slice level is based on the maximum over the
	 * first two bits and the minimum over the last two bits, with
	 * the slice level halfway between the maximum and minimum.
	 */
	env = (up->lastenv[2] - up->lastenv[6]) / 2.;
	up->dcycles <<= 1;
	if (env >= up->slice)
		up->dcycles |= 1;
	switch(up->pulse) {

	case 0:
		irig_baud(peer, up->dcycles);
		if (env < up->envmin)
			up->envmin = env;
		up->slice = (up->envmax + up->envmin) / 2;
		up->envmin = 1e6; up->envmax = -1e6;
		break;

	case 1:
		up->envmax = env;
		break;

	case 2:
		if (env > up->envmax)
			up->envmax = env;
		break;

	case 9:
		up->envmin = env;
		break;
	}
}

/*
 * irig_baud - update the PLL and decode the pulse-width signal
 */
static void
irig_baud(
	struct peer *peer,	/* peer structure pointer */
	int	bits		/* decoded bits */
	)
{
	struct refclockproc *pp;
	struct irigunit *up;
	double	dtemp;
	l_fp	ltemp;

        pp = peer->procptr;
	up = (struct irigunit *)pp->unitptr;

	/*
	 * The PLL time constant starts out small, in order to
	 * sustain a frequency tolerance of 250 PPM. It
	 * gradually increases as the loop settles down. Note
	 * that small wiggles are not believed, unless they
	 * persist for lots of samples.
	 */
	up->exing = -up->yxing;
	if (fabs(up->envxing - up->envphase) <= 1) {
		up->tcount++;
		if (up->tcount > 20 * up->tc) {
			up->tc++;
			if (up->tc > MAXTC)
				up->tc = MAXTC;
			up->tcount = 0;
			up->envxing = up->envphase;
		} else {
			up->exing -= up->envxing - up->envphase;
		}
	} else {
		up->tcount = 0;
		up->envxing = up->envphase;
	}

	/*
	 * Strike the baud timestamp as the positive zero crossing of
	 * the first bit, accounting for the codec delay and filter
	 * delay.
	 */
	up->prvstamp = up->chrstamp;
	dtemp = up->decim * (up->exing / SECOND) + up->fdelay;
	DTOLFP(dtemp, <emp);
	up->chrstamp = up->timestamp;
	L_SUB(&up->chrstamp, <emp);

	/*
	 * The data bits are collected in ten-bit bauds. The first two
	 * bits are not used. The resulting patterns represent runs of
	 * 0-1 bits (0), 2-4 bits (1) and 5-7 bits (PI). The remaining
	 * 8-bit run represents a soft error and is treated as 0.
	 */
	switch (up->dcycles & 0xff) {

	case 0x00:		/* 0-1 bits (0) */
	case 0x80:
		irig_decode(peer, BIT0);
		break;

	case 0xc0:		/* 2-4 bits (1) */
	case 0xe0:
	case 0xf0:
		irig_decode(peer, BIT1);
		break;

	case 0xf8:		/* (5-7 bits (PI) */
	case 0xfc:
	case 0xfe:
		irig_decode(peer, BITP);
		break;

	default:		/* 8 bits (error) */
		irig_decode(peer, BIT0);
		up->errflg |= IRIG_ERR_DECODE;
	}
}


/*
 * irig_decode - decode the data
 *
 * This routine assembles bauds into digits, digits into frames and
 * frames into the timecode fields. Bits can have values of zero, one
 * or position identifier. There are four bits per digit, ten digits per
 * frame and ten frames per second.
 */
static void
irig_decode(
	struct	peer *peer,	/* peer structure pointer */
	int	bit		/* data bit (0, 1 or 2) */
	)
{
	struct refclockproc *pp;
	struct irigunit *up;

	/*
	 * Local variables
	 */
	int	syncdig;	/* sync digit (Spectracom) */
	char	sbs[6 + 1];	/* binary seconds since 0h */
	char	spare[2 + 1];	/* mulligan digits */
	int	temp;

	pp = peer->procptr;
	up = (struct irigunit *)pp->unitptr;

	/*
	 * Assemble frame bits.
	 */
	up->bits >>= 1;
	if (bit == BIT1) {
		up->bits |= 0x200;
	} else if (bit == BITP && up->lastbit == BITP) {

		/*
		 * Frame sync - two adjacent position identifiers, which
		 * mark the beginning of the second. The reference time
		 * is the beginning of the second position identifier,
		 * so copy the character timestamp to the reference
		 * timestamp.
		 */
		if (up->frmcnt != 1)
			up->errflg |= IRIG_ERR_SYNCH;
		up->frmcnt = 1;
		up->refstamp = up->prvstamp;
	}
	up->lastbit = bit;
	if (up->frmcnt % SUBFLD == 0) {

		/*
		 * End of frame. Encode two hexadecimal digits in
		 * little-endian timecode field. Note frame 1 is shifted
		 * right one bit to account for the marker PI.
		 */
		temp = up->bits;
		if (up->frmcnt == 10)
			temp >>= 1;
		if (up->xptr >= 2) {
			up->timecode[--up->xptr] = hexchar[temp & 0xf];
			up->timecode[--up->xptr] = hexchar[(temp >> 5) &
			    0xf];
		}
		if (up->frmcnt == 0) {

			/*
			 * End of second. Decode the timecode and wind
			 * the clock. Not all IRIG generators have the
			 * year; if so, it is nonzero after year 2000.
			 * Not all have the hardware status bit; if so,
			 * it is lit when the source is okay and dim
			 * when bad. We watch this only if the year is
			 * nonzero. Not all are configured for signature
			 * control. If so, all BCD digits are set to
			 * zero if the source is bad. In this case the
			 * refclock_process() will reject the timecode
			 * as invalid.
			 */
			up->xptr = 2 * SUBFLD;
			if (sscanf((char *)up->timecode,
			   "%6s%2d%1d%2s%3d%2d%2d%2d", sbs, &pp->year,
			    &syncdig, spare, &pp->day, &pp->hour,
			    &pp->minute, &pp->second) != 8)
				pp->leap = LEAP_NOTINSYNC;
			else
				pp->leap = LEAP_NOWARNING;
			up->second = (up->second + up->decim) % 60;

			/*
			 * Raise an alarm if the day field is zero,
			 * which happens when signature control is
			 * enabled and the device has lost
			 * synchronization. Raise an alarm if the year
			 * field is nonzero and the sync indicator is
			 * zero, which happens when a Spectracom radio
			 * has lost synchronization. Raise an alarm if
			 * the expected second does not agree with the
			 * decoded second, which happens with a garbled
			 * IRIG signal. We are very particular.
			 */
			if (pp->day == 0 || (pp->year != 0 && syncdig ==
			    0))
				up->errflg |= IRIG_ERR_SIGERR;
			if (pp->second != up->second)
				up->errflg |= IRIG_ERR_CHECK;
			up->second = pp->second;

			/*
			 * Wind the clock only if there are no errors
			 * and the time constant has reached the
			 * maximum.
			 */
			if (up->errflg == 0 && up->tc == MAXTC) {
				pp->lastref = pp->lastrec;
				pp->lastrec = up->refstamp;
				if (!refclock_process(pp))
					refclock_report(peer,
					    CEVNT_BADTIME);
			}
			snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
			    "%02x %02d %03d %02d:%02d:%02d %4.0f %3d %6.3f %2d %6.2f %6.1f %s",
			    up->errflg, pp->year, pp->day,
			    pp->hour, pp->minute, pp->second,
			    up->maxsignal, up->gain, up->modndx,
			    up->tc, up->exing * 1e6 / SECOND, up->freq *
			    1e6 / SECOND, ulfptoa(&pp->lastrec, 6));
			pp->lencode = strlen(pp->a_lastcode);
			up->errflg = 0;
			if (pp->sloppyclockflag & CLK_FLAG4) {
				record_clock_stats(&peer->srcadr,
				    pp->a_lastcode);
#ifdef DEBUG
				if (debug)
					printf("irig %s\n",
					    pp->a_lastcode);
#endif /* DEBUG */
			}
		}
	}
	up->frmcnt = (up->frmcnt + 1) % FIELD;
}


/*
 * irig_poll - called by the transmit procedure
 *
 * This routine sweeps up the timecode updates since the last poll. For
 * IRIG-B there should be at least 60 updates; for IRIG-E there should
 * be at least 6. If nothing is heard, a timeout event is declared. 
 */
static void
irig_poll(
	int	unit,		/* instance number (not used) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct irigunit *up;

	pp = peer->procptr;
	up = (struct irigunit *)pp->unitptr;

	if (pp->coderecv == pp->codeproc) {
		refclock_report(peer, CEVNT_TIMEOUT);
		return;

	}
	refclock_receive(peer);
	if (!(pp->sloppyclockflag & CLK_FLAG4)) {
		record_clock_stats(&peer->srcadr, pp->a_lastcode);
#ifdef DEBUG
		if (debug)
			printf("irig %s\n", pp->a_lastcode);
#endif /* DEBUG */
	}
	pp->polls++;
	
}


/*
 * irig_gain - adjust codec gain
 *
 * This routine is called at the end of each second. It uses the AGC to
 * bradket the maximum signal level between MINAMP and MAXAMP to avoid
 * hunting. The routine also jiggles the input port and selectively
 * mutes the monitor.
 */
static void
irig_gain(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct irigunit *up;

	pp = peer->procptr;
	up = (struct irigunit *)pp->unitptr;

	/*
	 * Apparently, the codec uses only the high order bits of the
	 * gain control field. Thus, it may take awhile for changes to
	 * wiggle the hardware bits.
	 */
	if (up->maxsignal < MINAMP) {
		up->gain += 4;
		if (up->gain > MAXGAIN)
			up->gain = MAXGAIN;
	} else if (up->maxsignal > MAXAMP) {
		up->gain -= 4;
		if (up->gain < 0)
			up->gain = 0;
	}
	audio_gain(up->gain, up->mongain, up->port);
}


#else
int refclock_irig_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/ntp_control.c0000644000175000017500000021272211670265725015304 0ustar  peterpeter/*
 * ntp_control.c - respond to control messages and send async traps
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_control.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"
#include "ntp_config.h"
#include "ntp_crypto.h"
#include "ntp_assert.h"

#include 
#include 
#include 
#include 

#ifdef HAVE_NETINET_IN_H
#include 
#endif
#include 

/*
 * Structure to hold request procedure information
 */

struct ctl_proc {
	short control_code;		/* defined request code */
#define NO_REQUEST	(-1)
	u_short flags;			/* flags word */
	/* Only one flag.  Authentication required or not. */
#define NOAUTH	0
#define AUTH	1
	void (*handler) (struct recvbuf *, int); /* handle request */
};


/*
 * Request processing routines
 */
static	void	ctl_error	(int);
#ifdef REFCLOCK
static	u_short ctlclkstatus	(struct refclockstat *);
#endif
static	void	ctl_flushpkt	(int);
static	void	ctl_putdata	(const char *, unsigned int, int);
static	void	ctl_putstr	(const char *, const char *,
				 unsigned int);
static	void	ctl_putdbl	(const char *, double);
static	void	ctl_putuint	(const char *, u_long);
static	void	ctl_puthex	(const char *, u_long);
static	void	ctl_putint	(const char *, long);
static	void	ctl_putts	(const char *, l_fp *);
static	void	ctl_putadr	(const char *, u_int32,
				 sockaddr_u *);
static	void	ctl_putrefid	(const char *, u_int32);
static	void	ctl_putarray	(const char *, double *, int);
static	void	ctl_putsys	(int);
static	void	ctl_putpeer	(int, struct peer *);
static	void	ctl_putfs	(const char *, tstamp_t);
#ifdef REFCLOCK
static	void	ctl_putclock	(int, struct refclockstat *, int);
#endif	/* REFCLOCK */
static	struct ctl_var *ctl_getitem (struct ctl_var *, char **);
static	u_long count_var	(struct ctl_var *);
static	void	control_unspec	(struct recvbuf *, int);
static	void	read_status	(struct recvbuf *, int);
static	void	read_variables	(struct recvbuf *, int);
static	void	write_variables (struct recvbuf *, int);
static	void	read_clock_status (struct recvbuf *, int);
static	void	write_clock_status (struct recvbuf *, int);
static	void	set_trap	(struct recvbuf *, int);
static	void	unset_trap	(struct recvbuf *, int);
static	void	configure	(struct recvbuf *, int);
static	void	save_config	(struct recvbuf *, int);
static	struct ctl_trap *ctlfindtrap (sockaddr_u *,
				      struct interface *);

static	struct ctl_proc control_codes[] = {
	{ CTL_OP_UNSPEC,	NOAUTH, control_unspec },
	{ CTL_OP_READSTAT,	NOAUTH, read_status },
	{ CTL_OP_READVAR,	NOAUTH, read_variables },
	{ CTL_OP_WRITEVAR,	AUTH,	write_variables },
	{ CTL_OP_READCLOCK,	NOAUTH, read_clock_status },
	{ CTL_OP_WRITECLOCK,	NOAUTH, write_clock_status },
	{ CTL_OP_SETTRAP,	NOAUTH, set_trap },
	{ CTL_OP_UNSETTRAP,	NOAUTH, unset_trap },
	{ CTL_OP_SAVECONFIG,	AUTH,	save_config },
	{ CTL_OP_CONFIGURE,	AUTH,	configure },
	{ NO_REQUEST,		0 }
};

/*
 * System variable values. The array can be indexed by the variable
 * index to find the textual name.
 */
static struct ctl_var sys_var[] = {
	{ 0,		PADDING, "" },		/* 0 */
	{ CS_LEAP,	RW, "leap" },		/* 1 */
	{ CS_STRATUM,	RO, "stratum" },	/* 2 */
	{ CS_PRECISION, RO, "precision" },	/* 3 */
	{ CS_ROOTDELAY, RO, "rootdelay" },	/* 4 */
	{ CS_ROOTDISPERSION, RO, "rootdisp" },	/* 5 */
	{ CS_REFID,	RO, "refid" },		/* 6 */
	{ CS_REFTIME,	RO, "reftime" },	/* 7 */
	{ CS_POLL,	RO, "tc" },		/* 8 */
	{ CS_PEERID,	RO, "peer" },		/* 9 */
	{ CS_OFFSET,	RO, "offset" },		/* 10 */
	{ CS_DRIFT,	RO, "frequency" },	/* 11 */
	{ CS_JITTER,	RO, "sys_jitter" },	/* 12 */
	{ CS_ERROR,	RO, "clk_jitter" },	/* 13 */
	{ CS_CLOCK,	RO, "clock" },		/* 14 */
	{ CS_PROCESSOR, RO, "processor" },	/* 15 */
	{ CS_SYSTEM,	RO, "system" },		/* 16 */
	{ CS_VERSION,	RO, "version" },	/* 17 */
	{ CS_STABIL,	RO, "clk_wander" },	/* 18 */
	{ CS_VARLIST,	RO, "sys_var_list" },	/* 19 */
	{ CS_TAI,	RO, "tai" },		/* 20 */
	{ CS_LEAPTAB,	RO, "leapsec" },	/* 21 */
	{ CS_LEAPEND,	RO, "expire" },		/* 22 */
	{ CS_RATE,	RO, "mintc" },		/* 23 */
#ifdef OPENSSL
	{ CS_FLAGS,	RO, "flags" },		/* 24 */
	{ CS_HOST,	RO, "host" },		/* 25 */
	{ CS_PUBLIC,	RO, "update" },		/* 26 */
	{ CS_CERTIF,	RO, "cert" },		/* 27 */
	{ CS_SIGNATURE,	RO, "signature" },	/* 28 */
	{ CS_REVTIME,	RO, "until" },		/* 29 */
	{ CS_GROUP,	RO, "group" },		/* 30 */
	{ CS_DIGEST,	RO, "digest" },		/* 31 */
#endif /* OPENSSL */
	{ 0,		EOV, "" }		/* 24/3 2*/
};

static struct ctl_var *ext_sys_var = (struct ctl_var *)0;

/*
 * System variables we print by default (in fuzzball order,
 * more-or-less)
 */
static	u_char def_sys_var[] = {
	CS_VERSION,
	CS_PROCESSOR,
	CS_SYSTEM,
	CS_LEAP,
	CS_STRATUM,
	CS_PRECISION,
	CS_ROOTDELAY,
	CS_ROOTDISPERSION,
	CS_REFID,
	CS_REFTIME,
	CS_CLOCK,
	CS_PEERID,
	CS_POLL,
	CS_RATE,
	CS_OFFSET,
	CS_DRIFT,
	CS_JITTER,
	CS_ERROR,
	CS_STABIL,
	CS_TAI,
	CS_LEAPTAB,
	CS_LEAPEND,
#ifdef OPENSSL
	CS_HOST,
	CS_GROUP,
	CS_FLAGS,
	CS_DIGEST,
	CS_SIGNATURE,
	CS_PUBLIC,
	CS_CERTIF,
#endif /* OPENSSL */
	0
};


/*
 * Peer variable list
 */
static struct ctl_var peer_var[] = {
	{ 0,		PADDING, "" },		/* 0 */
	{ CP_CONFIG,	RO, "config" },		/* 1 */
	{ CP_AUTHENABLE, RO,	"authenable" },	/* 2 */
	{ CP_AUTHENTIC, RO, "authentic" }, 	/* 3 */
	{ CP_SRCADR,	RO, "srcadr" },		/* 4 */
	{ CP_SRCPORT,	RO, "srcport" },	/* 5 */
	{ CP_DSTADR,	RO, "dstadr" },		/* 6 */
	{ CP_DSTPORT,	RO, "dstport" },	/* 7 */
	{ CP_LEAP,	RO, "leap" },		/* 8 */
	{ CP_HMODE,	RO, "hmode" },		/* 9 */
	{ CP_STRATUM,	RO, "stratum" },	/* 10 */
	{ CP_PPOLL,	RO, "ppoll" },		/* 11 */
	{ CP_HPOLL,	RO, "hpoll" },		/* 12 */
	{ CP_PRECISION,	RO, "precision" },	/* 13 */
	{ CP_ROOTDELAY,	RO, "rootdelay" },	/* 14 */
	{ CP_ROOTDISPERSION, RO, "rootdisp" },	/* 15 */
	{ CP_REFID,	RO, "refid" },		/* 16 */
	{ CP_REFTIME,	RO, "reftime" },	/* 17 */
	{ CP_ORG,	RO, "org" },		/* 18 */
	{ CP_REC,	RO, "rec" },		/* 19 */
	{ CP_XMT,	RO, "xleave" },		/* 20 */
	{ CP_REACH,	RO, "reach" },		/* 21 */
	{ CP_UNREACH,	RO, "unreach" },	/* 22 */
	{ CP_TIMER,	RO, "timer" },		/* 23 */
	{ CP_DELAY,	RO, "delay" },		/* 24 */
	{ CP_OFFSET,	RO, "offset" },		/* 25 */
	{ CP_JITTER,	RO, "jitter" },		/* 26 */
	{ CP_DISPERSION, RO, "dispersion" },	/* 27 */
	{ CP_KEYID,	RO, "keyid" },		/* 28 */
	{ CP_FILTDELAY,	RO, "filtdelay=" },	/* 29 */
	{ CP_FILTOFFSET, RO, "filtoffset=" },	/* 30 */
	{ CP_PMODE,	RO, "pmode" },		/* 31 */
	{ CP_RECEIVED,	RO, "received"},	/* 32 */
	{ CP_SENT,	RO, "sent" },		/* 33 */
	{ CP_FILTERROR,	RO, "filtdisp=" },	/* 34 */
	{ CP_FLASH,	RO, "flash" },		/* 35 */
	{ CP_TTL,	RO, "ttl" },		/* 36 */
	{ CP_VARLIST,	RO, "peer_var_list" },	/* 37 */
	{ CP_IN,	RO, "in" },		/* 38 */
	{ CP_OUT,	RO, "out" },		/* 39 */
	{ CP_RATE,	RO, "headway" },	/* 40 */
	{ CP_BIAS,	RO, "bias" },		/* 41 */
#ifdef OPENSSL
	{ CP_FLAGS,	RO, "flags" },		/* 42 */
	{ CP_HOST,	RO, "host" },		/* 43 */
	{ CP_VALID,	RO, "valid" },		/* 44 */
	{ CP_INITSEQ,	RO, "initsequence" },   /* 45 */
	{ CP_INITKEY,	RO, "initkey" },	/* 46 */
	{ CP_INITTSP,	RO, "timestamp" },	/* 47 */
	{ CP_SIGNATURE,	RO, "signature" },	/* 48 */
#endif /* OPENSSL */
	{ 0,		EOV, "" }		/* 42/49 */
};


/*
 * Peer variables we print by default
 */
static u_char def_peer_var[] = {
	CP_SRCADR,
	CP_SRCPORT,
	CP_DSTADR,
	CP_DSTPORT,
	CP_OUT,
	CP_IN,
	CP_LEAP,
	CP_STRATUM,
	CP_PRECISION,
	CP_ROOTDELAY,
	CP_ROOTDISPERSION,
	CP_REFID,
	CP_REFTIME,
	CP_REC,
	CP_REACH,
	CP_UNREACH,
	CP_HMODE,
	CP_PMODE,
	CP_HPOLL,
	CP_PPOLL,
	CP_RATE,
	CP_FLASH,
	CP_KEYID,
	CP_TTL,
	CP_OFFSET,
	CP_DELAY,
	CP_DISPERSION,
	CP_JITTER,
	CP_XMT,
	CP_BIAS,
	CP_FILTDELAY,
	CP_FILTOFFSET,
	CP_FILTERROR,
#ifdef OPENSSL
	CP_HOST,
	CP_FLAGS,
	CP_SIGNATURE,
	CP_VALID,
	CP_INITSEQ,
#endif /* OPENSSL */
	0
};


#ifdef REFCLOCK
/*
 * Clock variable list
 */
static struct ctl_var clock_var[] = {
	{ 0,		PADDING, "" },		/* 0 */
	{ CC_TYPE,	RO, "type" },		/* 1 */
	{ CC_TIMECODE,	RO, "timecode" },	/* 2 */
	{ CC_POLL,	RO, "poll" },		/* 3 */
	{ CC_NOREPLY,	RO, "noreply" },	/* 4 */
	{ CC_BADFORMAT, RO, "badformat" },	/* 5 */
	{ CC_BADDATA,	RO, "baddata" },	/* 6 */
	{ CC_FUDGETIME1, RO, "fudgetime1" },	/* 7 */
	{ CC_FUDGETIME2, RO, "fudgetime2" },	/* 8 */
	{ CC_FUDGEVAL1, RO, "stratum" },	/* 9 */
	{ CC_FUDGEVAL2, RO, "refid" },		/* 10 */
	{ CC_FLAGS,	RO, "flags" },		/* 11 */
	{ CC_DEVICE,	RO, "device" },		/* 12 */
	{ CC_VARLIST,	RO, "clock_var_list" },	/* 13 */
	{ 0,		EOV, ""  }		/* 14 */
};


/*
 * Clock variables printed by default
 */
static u_char def_clock_var[] = {
	CC_DEVICE,
	CC_TYPE,	/* won't be output if device = known */
	CC_TIMECODE,
	CC_POLL,
	CC_NOREPLY,
	CC_BADFORMAT,
	CC_BADDATA,
	CC_FUDGETIME1,
	CC_FUDGETIME2,
	CC_FUDGEVAL1,
	CC_FUDGEVAL2,
	CC_FLAGS,
	0
};
#endif


/*
 * System and processor definitions.
 */
#ifndef HAVE_UNAME
# ifndef STR_SYSTEM
#  define		STR_SYSTEM	"UNIX"
# endif
# ifndef STR_PROCESSOR
#  define		STR_PROCESSOR	"unknown"
# endif

static char str_system[] = STR_SYSTEM;
static char str_processor[] = STR_PROCESSOR;
#else
# include 
static struct utsname utsnamebuf;
#endif /* HAVE_UNAME */

/*
 * Trap structures. We only allow a few of these, and send a copy of
 * each async message to each live one. Traps time out after an hour, it
 * is up to the trap receipient to keep resetting it to avoid being
 * timed out.
 */
/* ntp_request.c */
struct ctl_trap ctl_trap[CTL_MAXTRAPS];
int num_ctl_traps;

/*
 * Type bits, for ctlsettrap() call.
 */
#define TRAP_TYPE_CONFIG	0	/* used by configuration code */
#define TRAP_TYPE_PRIO		1	/* priority trap */
#define TRAP_TYPE_NONPRIO	2	/* nonpriority trap */


/*
 * List relating reference clock types to control message time sources.
 * Index by the reference clock type. This list will only be used iff
 * the reference clock driver doesn't set peer->sstclktype to something
 * different than CTL_SST_TS_UNSPEC.
 */
static u_char clocktypes[] = {
	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_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_GOES_TRAK (6) IRIG_AUDIO? */
	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_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_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_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_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_JUPITER (31) */
	CTL_SST_TS_LF,		/* REFCLK_CHRONOLOG (32) */
	CTL_SST_TS_LF,		/* REFCLK_DUMBCLOCK (33) */
	CTL_SST_TS_LF,		/* REFCLK_ULINK (34) */
	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_PCI (39) */
	CTL_SST_TS_LF,		/* REFCLK_JJY (40) */
	CTL_SST_TS_UHF,		/* REFCLK_TT560 (41) */
	CTL_SST_TS_UHF,		/* REFCLK_ZYFER (42) */
	CTL_SST_TS_UHF,		/* REFCLK_RIPENCC (43) */
	CTL_SST_TS_UHF,		/* REFCLK_NEOCLOCK4X (44) */
};


/*
 * Keyid used for authenticating write requests.
 */
keyid_t ctl_auth_keyid;

/*
 * We keep track of the last error reported by the system internally
 */
static	u_char ctl_sys_last_event;
static	u_char ctl_sys_num_events;


/*
 * Statistic counters to keep track of requests and responses.
 */
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 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 numctlinputerr;		/* number of input pkts with err bit set */
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 numasyncmsgs;		/* number of async messages we've sent */

/*
 * Response packet used by these routines. Also some state information
 * so that we can handle packet formatting within a common set of
 * subroutines.  Note we try to enter data in place whenever possible,
 * but the need to set the more bit correctly means we occasionally
 * use the extra buffer and copy.
 */
static struct ntp_control rpkt;
static u_char	res_version;
static u_char	res_opcode;
static associd_t res_associd;
static int	res_offset;
static u_char * datapt;
static u_char * dataend;
static int	datalinelen;
static int	datanotbinflag;
static sockaddr_u *rmt_addr;
static struct interface *lcl_inter;

static u_char	res_authenticate;
static u_char	res_authokay;
static keyid_t	res_keyid;

#define MAXDATALINELEN	(72)

static u_char	res_async;	/* set to 1 if this is async trap response */

/*
 * Pointers for saving state when decoding request packets
 */
static	char *reqpt;
static	char *reqend;

/*
 * init_control - initialize request data
 */
void
init_control(void)
{
	int i;

#ifdef HAVE_UNAME
	uname(&utsnamebuf);
#endif /* HAVE_UNAME */

	ctl_clr_stats();

	ctl_auth_keyid = 0;
	ctl_sys_last_event = EVNT_UNSPEC;
	ctl_sys_num_events = 0;

	num_ctl_traps = 0;
	for (i = 0; i < CTL_MAXTRAPS; i++)
		ctl_trap[i].tr_flags = 0;
}


/*
 * ctl_error - send an error response for the current request
 */
static void
ctl_error(
	int errcode
	)
{
	DPRINTF(3, ("sending control error %d\n", errcode));

	/*
	 * 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|(res_opcode &
							  CTL_OP_MASK));
	rpkt.status = htons((u_short) ((errcode<<8) & 0xff00));
	rpkt.count = 0;

	/*
	 * send packet and bump counters
	 */
	if (res_authenticate && sys_authenticate) {
		int maclen;

		maclen = authencrypt(res_keyid, (u_int32 *)&rpkt,
				     CTL_HEADER_LEN);
		sendpkt(rmt_addr, lcl_inter, -2, (struct pkt *)&rpkt,
			CTL_HEADER_LEN + maclen);
	} else {
		sendpkt(rmt_addr, lcl_inter, -3, (struct pkt *)&rpkt,
			CTL_HEADER_LEN);
	}
	numctlerrors++;
}

/* 
 * save_config - Implements ntpq -c "saveconfig "
 *		 Writes current configuration including any runtime
 *		 changes by ntpq's :config or config-from-file
 */
void
save_config(
	struct recvbuf *rbufp,
	int restrict_mask
	)
{
	char reply[128];
#ifdef SAVECONFIG
	char filespec[128];
	char filename[128];
	char fullpath[512];
	const char savedconfig_eq[] = "savedconfig=";
	char savedconfig[sizeof(savedconfig_eq) + sizeof(filename)];
	time_t now;
	int fd;
	FILE *fptr;
#endif

	if (restrict_mask & RES_NOMODIFY) {
		snprintf(reply, sizeof(reply),
			 "saveconfig prohibited by restrict ... nomodify");
		ctl_putdata(reply, strlen(reply), 0);
		ctl_flushpkt(0);
		msyslog(LOG_NOTICE,
			"saveconfig from %s rejected due to nomodify restriction",
			stoa(&rbufp->recv_srcadr));
		return;
	}

#ifdef SAVECONFIG
	if (NULL == saveconfigdir) {
		snprintf(reply, sizeof(reply),
			 "saveconfig prohibited, no saveconfigdir configured");
		ctl_putdata(reply, strlen(reply), 0);
		ctl_flushpkt(0);
		msyslog(LOG_NOTICE,
			"saveconfig from %s rejected, no saveconfigdir",
			stoa(&rbufp->recv_srcadr));
		return;
	}

	if (0 == reqend - reqpt)
		return;

	strncpy(filespec, reqpt, sizeof(filespec));
	filespec[sizeof(filespec) - 1] = '\0';

	time(&now);

	/*
	 * allow timestamping of the saved config filename with
	 * strftime() format such as:
	 *   ntpq -c "saveconfig ntp-%Y%m%d-%H%M%S.conf"
	 */
	if (0 == strftime(filename, sizeof(filename), filespec,
			       localtime(&now)))
		strncpy(filename, filespec, sizeof(filename));

	filename[sizeof(filename) - 1] = '\0';
	
	if (strchr(filename, '\\') || strchr(filename, '/')) {
		snprintf(reply, sizeof(reply),
			 "saveconfig does not allow directory in filename");
		ctl_putdata(reply, strlen(reply), 0);
		ctl_flushpkt(0);
		msyslog(LOG_NOTICE,
			"saveconfig with path from %s rejected",
			stoa(&rbufp->recv_srcadr));
		return;
	}

	snprintf(fullpath, sizeof(fullpath), "%s%s",
		 saveconfigdir, filename);

	fd = open(fullpath, O_CREAT | O_TRUNC | O_WRONLY,
		  S_IRUSR | S_IWUSR);
	if (-1 == fd)
		fptr = NULL;
	else
		fptr = fdopen(fd, "w");

	if (NULL == fptr || -1 == dump_all_config_trees(fptr, 1)) {
		snprintf(reply, sizeof(reply),
			 "Unable to save configuration to file %s",
			 filename);
		msyslog(LOG_ERR,
			"saveconfig %s from %s failed", filename,
			stoa(&rbufp->recv_srcadr));
	} else {
		snprintf(reply, sizeof(reply),
			 "Configuration saved to %s", filename);
		msyslog(LOG_NOTICE,
			"Configuration saved to %s (requested by %s)",
			fullpath, stoa(&rbufp->recv_srcadr));
		/*
		 * save the output filename in system variable
		 * savedconfig, retrieved with:
		 *   ntpq -c "rv 0 savedconfig"
		 */
		snprintf(savedconfig, sizeof(savedconfig), "%s%s",
			 savedconfig_eq, filename);
		set_sys_var(savedconfig, strlen(savedconfig) + 1, RO);
	}

	if (NULL != fptr)
		fclose(fptr);
#else	/* !SAVECONFIG follows */
	snprintf(reply, sizeof(reply),
		 "saveconfig unavailable, configured with --disable-saveconfig");
#endif

	ctl_putdata(reply, strlen(reply), 0);
	ctl_flushpkt(0);
}


/*
 * process_control - process an incoming control message
 */
void
process_control(
	struct recvbuf *rbufp,
	int restrict_mask
	)
{
	register struct ntp_control *pkt;
	register int req_count;
	register int req_data;
	register struct ctl_proc *cc;
	int properlen;
	int maclen;

	DPRINTF(3, ("in process_control()\n"));

	/*
	 * Save the addresses for error responses
	 */
	numctlreq++;
	rmt_addr = &rbufp->recv_srcadr;
	lcl_inter = rbufp->dstadr;
	pkt = (struct ntp_control *)&rbufp->recv_pkt;

	/*
	 * If the length is less than required for the header, or
	 * it is a response or a fragment, ignore this.
	 */
	if (rbufp->recv_length < CTL_HEADER_LEN
	    || pkt->r_m_e_op & (CTL_RESPONSE|CTL_MORE|CTL_ERROR)
	    || pkt->offset != 0) {
		DPRINTF(1, ("invalid format in control packet\n"));
		if (rbufp->recv_length < CTL_HEADER_LEN)
			numctltooshort++;
		if (pkt->r_m_e_op & CTL_RESPONSE)
			numctlinputresp++;
		if (pkt->r_m_e_op & CTL_MORE)
			numctlinputfrag++;
		if (pkt->r_m_e_op & CTL_ERROR)
			numctlinputerr++;
		if (pkt->offset != 0)
			numctlbadoffset++;
		return;
	}
	res_version = PKT_VERSION(pkt->li_vn_mode);
	if (res_version > NTP_VERSION || res_version < NTP_OLDVERSION) {
		DPRINTF(1, ("unknown version %d in control packet\n",
			    res_version));
		numctlbadversion++;
		return;
	}

	/*
	 * Pull enough data from the packet to make intelligent
	 * responses
	 */
	rpkt.li_vn_mode = PKT_LI_VN_MODE(sys_leap, res_version,
					 MODE_CONTROL);
	res_opcode = pkt->r_m_e_op;
	rpkt.sequence = pkt->sequence;
	rpkt.associd = pkt->associd;
	rpkt.status = 0;
	res_offset = 0;
	res_associd = htons(pkt->associd);
	res_async = 0;
	res_authenticate = 0;
	res_keyid = 0;
	res_authokay = 0;
	req_count = (int)ntohs(pkt->count);
	datanotbinflag = 0;
	datalinelen = 0;
	datapt = rpkt.data;
	dataend = &(rpkt.data[CTL_MAX_DATA_LEN]);

	if ((rbufp->recv_length & 0x3) != 0)
		DPRINTF(3, ("Control packet length %d unrounded\n",
			    rbufp->recv_length));

	/*
	 * We're set up now. Make sure we've got at least enough
	 * incoming data space to match the count.
	 */
	req_data = rbufp->recv_length - CTL_HEADER_LEN;
	if (req_data < req_count || rbufp->recv_length & 0x3) {
		ctl_error(CERR_BADFMT);
		numctldatatooshort++;
		return;
	}

	properlen = req_count + CTL_HEADER_LEN;
	/* round up proper len to a 8 octet boundary */

	properlen = (properlen + 7) & ~7;
	maclen = rbufp->recv_length - properlen;
	if ((rbufp->recv_length & 3) == 0 &&
	    maclen >= MIN_MAC_LEN && maclen <= MAX_MAC_LEN &&
	    sys_authenticate) {
		res_authenticate = 1;
		res_keyid = ntohl(*(u_int32 *)((u_char *)pkt +
					       properlen));

		DPRINTF(3, ("recv_len %d, properlen %d, wants auth with keyid %08x, MAC length=%d\n",
			    rbufp->recv_length, properlen, res_keyid,
			    maclen));

		if (!authistrusted(res_keyid))
			DPRINTF(3, ("invalid keyid %08x\n", res_keyid));
		else if (authdecrypt(res_keyid, (u_int32 *)pkt,
				     rbufp->recv_length - maclen,
				     maclen)) {
			DPRINTF(3, ("authenticated okay\n"));
			res_authokay = 1;
		} else {
			DPRINTF(3, ("authentication failed\n"));
			res_keyid = 0;
		}
	}

	/*
	 * Set up translate pointers
	 */
	reqpt = (char *)pkt->data;
	reqend = reqpt + req_count;

	/*
	 * Look for the opcode processor
	 */
	for (cc = control_codes; cc->control_code != NO_REQUEST; cc++) {
		if (cc->control_code == res_opcode) {
			DPRINTF(3, ("opcode %d, found command handler\n",
				    res_opcode));
			if (cc->flags == AUTH
			    && (!res_authokay
				|| res_keyid != ctl_auth_keyid)) {
				ctl_error(CERR_PERMISSION);
				return;
			}
			(cc->handler)(rbufp, restrict_mask);
			return;
		}
	}

	/*
	 * Can't find this one, return an error.
	 */
	numctlbadop++;
	ctl_error(CERR_BADOP);
	return;
}


/*
 * ctlpeerstatus - return a status word for this peer
 */
u_short
ctlpeerstatus(
	register struct peer *peer
	)
{
	u_short status;

	status = peer->status;
	if (!(peer->flags & FLAG_PREEMPT))
		status |= CTL_PST_CONFIG;
	if (peer->keyid != 0)
		status |= CTL_PST_AUTHENABLE;
	if (peer->flags & FLAG_AUTHENTIC)
		status |= CTL_PST_AUTHENTIC;
	if (peer->reach != 0)
		status |= CTL_PST_REACH;
	if (peer->cast_flags & (MDF_BCAST | MDF_MCAST | MDF_ACAST))
		status |= CTL_PST_BCAST;
	return (u_short)CTL_PEER_STATUS(status, peer->num_events,
	    peer->last_event);
}


/*
 * ctlclkstatus - return a status word for this clock
 */
#ifdef REFCLOCK
static u_short
ctlclkstatus(
	struct refclockstat *this_clock
	)
{
	return (u_short)CTL_PEER_STATUS(0, this_clock->lastevent,
	    this_clock->currentstatus);
}
#endif


/*
 * ctlsysstatus - return the system status word
 */
u_short
ctlsysstatus(void)
{
	register u_char this_clock;

	this_clock = CTL_SST_TS_UNSPEC;
#ifdef REFCLOCK
	if (sys_peer != 0) {
		if (sys_peer->sstclktype != CTL_SST_TS_UNSPEC) {
			this_clock = sys_peer->sstclktype;
		} else {
			if (sys_peer->refclktype < sizeof(clocktypes))
				this_clock =
				    clocktypes[sys_peer->refclktype];
		}
	}
#else /* REFCLOCK */
	if (sys_peer != 0)
		this_clock = CTL_SST_TS_NTP;
#endif /* REFCLOCK */
	return (u_short)CTL_SYS_STATUS(sys_leap, this_clock,
	    ctl_sys_num_events, ctl_sys_last_event);
}


/*
 * ctl_flushpkt - write out the current packet and prepare
 *		  another if necessary.
 */
static void
ctl_flushpkt(
	int more
	)
{
	int dlen;
	int sendlen;

	if (!more && datanotbinflag) {
		/*
		 * Big hack, output a trailing \r\n
		 */
		*datapt++ = '\r';
		*datapt++ = '\n';
	}
	dlen = datapt - (u_char *)rpkt.data;
	sendlen = dlen + CTL_HEADER_LEN;

	/*
	 * Pad to a multiple of 32 bits
	 */
	while (sendlen & 0x3) {
		*datapt++ = '\0';
		sendlen++;
	}

	/*
	 * Fill in the packet with the current info
	 */
	rpkt.r_m_e_op = (u_char)(CTL_RESPONSE|more|(res_opcode &
						    CTL_OP_MASK));
	rpkt.count = htons((u_short) dlen);
	rpkt.offset = htons( (u_short) res_offset);
	if (res_async) {
		register int i;

		for (i = 0; i < CTL_MAXTRAPS; i++) {
			if (ctl_trap[i].tr_flags & TRAP_INUSE) {
				rpkt.li_vn_mode =
				    PKT_LI_VN_MODE(sys_leap,
						   ctl_trap[i].tr_version,
						   MODE_CONTROL);
				rpkt.sequence =
				    htons(ctl_trap[i].tr_sequence);
				sendpkt(&ctl_trap[i].tr_addr,
					ctl_trap[i].tr_localaddr, -4,
					(struct pkt *)&rpkt, sendlen);
				if (!more)
					ctl_trap[i].tr_sequence++;
				numasyncmsgs++;
			}
		}
	} else {
		if (res_authenticate && sys_authenticate) {
			int maclen;
			int totlen = sendlen;
			keyid_t keyid = htonl(res_keyid);

			/*
			 * If we are going to authenticate, then there
			 * is an additional requirement that the MAC
			 * begin on a 64 bit boundary.
			 */
			while (totlen & 7) {
				*datapt++ = '\0';
				totlen++;
			}
			memcpy(datapt, &keyid, sizeof keyid);
			maclen = authencrypt(res_keyid,
					     (u_int32 *)&rpkt, totlen);
			sendpkt(rmt_addr, lcl_inter, -5,
				(struct pkt *)&rpkt, totlen + maclen);
		} else {
			sendpkt(rmt_addr, lcl_inter, -6,
				(struct pkt *)&rpkt, sendlen);
		}
		if (more)
			numctlfrags++;
		else
			numctlresponses++;
	}

	/*
	 * Set us up for another go around.
	 */
	res_offset += dlen;
	datapt = (u_char *)rpkt.data;
}


/*
 * ctl_putdata - write data into the packet, fragmenting and starting
 * another if this one is full.
 */
static void
ctl_putdata(
	const char *dp,
	unsigned int dlen,
	int bin 		/* set to 1 when data is binary */
	)
{
	int overhead;

	overhead = 0;
	if (!bin) {
		datanotbinflag = 1;
		overhead = 3;
		if (datapt != rpkt.data) {
			*datapt++ = ',';
			datalinelen++;
			if ((dlen + datalinelen + 1) >= MAXDATALINELEN)
			{
				*datapt++ = '\r';
				*datapt++ = '\n';
				datalinelen = 0;
			} else {
				*datapt++ = ' ';
				datalinelen++;
			}
		}
	}

	/*
	 * Save room for trailing junk
	 */
	if (dlen + overhead + datapt > dataend) {
		/*
		 * Not enough room in this one, flush it out.
		 */
		ctl_flushpkt(CTL_MORE);
	}
	memmove((char *)datapt, dp, (unsigned)dlen);
	datapt += dlen;
	datalinelen += dlen;
}


/*
 * ctl_putstr - write a tagged string into the response packet
 */
static void
ctl_putstr(
	const char *tag,
	const char *data,
	unsigned int len
	)
{
	register char *cp;
	register const char *cq;
	char buffer[400];

	cp = buffer;
	cq = tag;
	while (*cq != '\0')
		*cp++ = *cq++;
	if (len > 0) {
		*cp++ = '=';
		*cp++ = '"';
		if (len > (int) (sizeof(buffer) - (cp - buffer) - 1))
			len = sizeof(buffer) - (cp - buffer) - 1;
		memmove(cp, data, (unsigned)len);
		cp += len;
		*cp++ = '"';
	}
	ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
}


/*
 * ctl_putdbl - write a tagged, signed double into the response packet
 */
static void
ctl_putdbl(
	const char *tag,
	double ts
	)
{
	register char *cp;
	register const char *cq;
	char buffer[200];

	cp = buffer;
	cq = tag;
	while (*cq != '\0')
		*cp++ = *cq++;
	*cp++ = '=';
	NTP_INSIST((cp - buffer) < sizeof(buffer));
	snprintf(cp, sizeof(buffer) - (cp - buffer), "%.3f", ts);
	cp += strlen(cp);
	ctl_putdata(buffer, (unsigned)(cp - buffer), 0);
}

/*
 * ctl_putuint - write a tagged unsigned integer into the response
 */
static void
ctl_putuint(
	const char *tag,
	u_long uval
	)
{
	register char *cp;
	register const char *cq;
	char buffer[200];

	cp = buffer;
	cq = tag;
	while (*cq != '\0')
		*cp++ = *cq++;

	*cp++ = '=';
	NTP_INSIST((cp - buffer) < sizeof(buffer));
	snprintf(cp, sizeof(buffer) - (cp - buffer), "%lu", uval);
	cp += strlen(cp);
	ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
}

/*
 * ctl_putfs - write a decoded filestamp into the response
 */
static void
ctl_putfs(
	const char *tag,
	tstamp_t uval
	)
{
	register char *cp;
	register const char *cq;
	char buffer[200];
	struct tm *tm = NULL;
	time_t fstamp;

	cp = buffer;
	cq = tag;
	while (*cq != '\0')
		*cp++ = *cq++;

	*cp++ = '=';
	fstamp = uval - JAN_1970;
	tm = gmtime(&fstamp);
	if (NULL ==  tm)
		return;
	NTP_INSIST((cp - buffer) < sizeof(buffer));
	snprintf(cp, sizeof(buffer) - (cp - buffer),
		 "%04d%02d%02d%02d%02d", tm->tm_year + 1900,
		 tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min);
	cp += strlen(cp);
	ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
}


/*
 * ctl_puthex - write a tagged unsigned integer, in hex, into the
 * response
 */
static void
ctl_puthex(
	const char *tag,
	u_long uval
	)
{
	register char *cp;
	register const char *cq;
	char buffer[200];

	cp = buffer;
	cq = tag;
	while (*cq != '\0')
		*cp++ = *cq++;

	*cp++ = '=';
	NTP_INSIST((cp - buffer) < sizeof(buffer));
	snprintf(cp, sizeof(buffer) - (cp - buffer), "0x%lx", uval);
	cp += strlen(cp);
	ctl_putdata(buffer,(unsigned)( cp - buffer ), 0);
}


/*
 * ctl_putint - write a tagged signed integer into the response
 */
static void
ctl_putint(
	const char *tag,
	long ival
	)
{
	register char *cp;
	register const char *cq;
	char buffer[200];

	cp = buffer;
	cq = tag;
	while (*cq != '\0')
		*cp++ = *cq++;

	*cp++ = '=';
	NTP_INSIST((cp - buffer) < sizeof(buffer));
	snprintf(cp, sizeof(buffer) - (cp - buffer), "%ld", ival);
	cp += strlen(cp);
	ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
}


/*
 * ctl_putts - write a tagged timestamp, in hex, into the response
 */
static void
ctl_putts(
	const char *tag,
	l_fp *ts
	)
{
	register char *cp;
	register const char *cq;
	char buffer[200];

	cp = buffer;
	cq = tag;
	while (*cq != '\0')
		*cp++ = *cq++;

	*cp++ = '=';
	NTP_INSIST((cp - buffer) < sizeof(buffer));
	snprintf(cp, sizeof(buffer) - (cp - buffer), "0x%08lx.%08lx",
		 ts->l_ui & 0xffffffffUL, ts->l_uf & 0xffffffffUL);
	cp += strlen(cp);
	ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
}


/*
 * ctl_putadr - write an IP address into the response
 */
static void
ctl_putadr(
	const char *tag,
	u_int32 addr32,
	sockaddr_u *addr
	)
{
	register char *cp;
	register const char *cq;
	char buffer[200];

	cp = buffer;
	cq = tag;
	while (*cq != '\0')
		*cp++ = *cq++;

	*cp++ = '=';
	if (NULL == addr)
		cq = numtoa(addr32);
	else
		cq = stoa(addr);
	NTP_INSIST((cp - buffer) < sizeof(buffer));
	snprintf(cp, sizeof(buffer) - (cp - buffer), "%s", cq);
	cp += strlen(cp);
	ctl_putdata(buffer, (unsigned)(cp - buffer), 0);
}


/*
 * ctl_putrefid - send a u_int32 refid as printable text
 */
static void
ctl_putrefid(
	const char *	tag,
	u_int32		refid
	)
{
	char	output[16];
	char *	optr;
	char *	oplim;
	char *	iptr;
	char *	iplim;
	char *	past_eq;

	optr = output;
	oplim = output + sizeof(output);
	while (optr < oplim && '\0' != *tag)
		*optr++ = *tag++;
	if (optr < oplim) {
		*optr++ = '=';
		past_eq = optr;
	}
	if (!(optr < oplim))
		return;
	iptr = (char *)&refid;
	iplim = iptr + sizeof(refid);
	for ( ; optr < oplim && iptr < iplim && '\0' != *iptr; 
	     iptr++, optr++)
		if (isprint(*iptr))
			*optr = *iptr;
		else
			*optr = '.';
	if (!(optr <= oplim))
		optr = past_eq;
	ctl_putdata(output, (u_int)(optr - output), FALSE);
}


/*
 * ctl_putarray - write a tagged eight element double array into the response
 */
static void
ctl_putarray(
	const char *tag,
	double *arr,
	int start
	)
{
	register char *cp;
	register const char *cq;
	char buffer[200];
	int i;
	cp = buffer;
	cq = tag;
	while (*cq != '\0')
		*cp++ = *cq++;
	i = start;
	do {
		if (i == 0)
			i = NTP_SHIFT;
		i--;
		NTP_INSIST((cp - buffer) < sizeof(buffer));
		snprintf(cp, sizeof(buffer) - (cp - buffer),
			 " %.2f", arr[i] * 1e3);
		cp += strlen(cp);
	} while(i != start);
	ctl_putdata(buffer, (unsigned)(cp - buffer), 0);
}


/*
 * ctl_putsys - output a system variable
 */
static void
ctl_putsys(
	int varid
	)
{
	l_fp tmp;
	char str[256];
#ifdef OPENSSL
	struct cert_info *cp;
	char cbuf[256];
#endif /* OPENSSL */

	switch (varid) {

	    case CS_LEAP:
		ctl_putuint(sys_var[CS_LEAP].text, sys_leap);
		break;

	    case CS_STRATUM:
		ctl_putuint(sys_var[CS_STRATUM].text, sys_stratum);
		break;

	    case CS_PRECISION:
		ctl_putint(sys_var[CS_PRECISION].text, sys_precision);
		break;

	    case CS_ROOTDELAY:
		ctl_putdbl(sys_var[CS_ROOTDELAY].text, sys_rootdelay *
			   1e3);
		break;

	    case CS_ROOTDISPERSION:
		ctl_putdbl(sys_var[CS_ROOTDISPERSION].text,
			   sys_rootdisp * 1e3);
		break;

	    case CS_REFID:
		if (sys_stratum > 1 && sys_stratum < STRATUM_UNSPEC)
			ctl_putadr(sys_var[varid].text, sys_refid, NULL);
		else
			ctl_putrefid(sys_var[varid].text, sys_refid);
		break;

	    case CS_REFTIME:
		ctl_putts(sys_var[CS_REFTIME].text, &sys_reftime);
		break;

	    case CS_POLL:
		ctl_putuint(sys_var[CS_POLL].text, sys_poll);
		break;

	    case CS_PEERID:
		if (sys_peer == NULL)
			ctl_putuint(sys_var[CS_PEERID].text, 0);
		else
			ctl_putuint(sys_var[CS_PEERID].text,
				    sys_peer->associd);
		break;

	    case CS_OFFSET:
		ctl_putdbl(sys_var[CS_OFFSET].text, last_offset * 1e3);
		break;

	    case CS_DRIFT:
		ctl_putdbl(sys_var[CS_DRIFT].text, drift_comp * 1e6);
		break;

	    case CS_JITTER:
		ctl_putdbl(sys_var[CS_JITTER].text, sys_jitter * 1e3);
		break;

	    case CS_ERROR:
		ctl_putdbl(sys_var[CS_ERROR].text, clock_jitter * 1e3);
		break;

	    case CS_CLOCK:
		get_systime(&tmp);
		ctl_putts(sys_var[CS_CLOCK].text, &tmp);
		break;

	    case CS_PROCESSOR:
#ifndef HAVE_UNAME
		ctl_putstr(sys_var[CS_PROCESSOR].text, str_processor,
			   sizeof(str_processor) - 1);
#else
		ctl_putstr(sys_var[CS_PROCESSOR].text,
			   utsnamebuf.machine, strlen(utsnamebuf.machine));
#endif /* HAVE_UNAME */
		break;

	    case CS_SYSTEM:
#ifndef HAVE_UNAME
		ctl_putstr(sys_var[CS_SYSTEM].text, str_system,
			   sizeof(str_system) - 1);
#else
		snprintf(str, sizeof(str), "%s/%s", utsnamebuf.sysname,
			 utsnamebuf.release);
		ctl_putstr(sys_var[CS_SYSTEM].text, str, strlen(str));
#endif /* HAVE_UNAME */
		break;

	    case CS_VERSION:
		ctl_putstr(sys_var[CS_VERSION].text, Version,
			   strlen(Version));
		break;

	    case CS_STABIL:
		ctl_putdbl(sys_var[CS_STABIL].text, clock_stability *
			   1e6);
		break;

	    case CS_VARLIST:
	    {
		    char buf[CTL_MAX_DATA_LEN];
		    register char *s, *t, *be;
		    register const char *ss;
		    register int i;
		    register struct ctl_var *k;

		    s = buf;
		    be = buf + sizeof(buf);
		    if (s + strlen(sys_var[CS_VARLIST].text) + 4 > be)
			    break;	/* really long var name */

		    snprintf(s, sizeof(buf), "%s=\"",
			sys_var[CS_VARLIST].text);
		    s += strlen(s);
		    t = s;
		    for (k = sys_var; !(k->flags & EOV); k++) {
			    if (k->flags & PADDING)
				    continue;
			    i = strlen(k->text);
			    if (s+i+1 >= be)
				    break;

			    if (s != t)
				    *s++ = ',';
			    memcpy(s, k->text, i);
			    s += i;
		    }

		    for (k = ext_sys_var; k && !(k->flags & EOV);
			 k++) {
			    if (k->flags & PADDING)
				    continue;

			    ss = k->text;
			    if (!ss)
				    continue;

			    while (*ss && *ss != '=')
				    ss++;
			    i = ss - k->text;
			    if (s + i + 1 >= be)
				    break;

			    if (s != t)
				    *s++ = ',';
			    memcpy(s, k->text,
				    (unsigned)i);
			    s += i;
		    }
		    if (s+2 >= be)
			    break;

		    *s++ = '"';
		    *s = '\0';

		    ctl_putdata(buf, (unsigned)( s - buf ),
			0);
	    }
	    break;

	    case CS_TAI:
		if (sys_tai > 0)
			ctl_putuint(sys_var[CS_TAI].text, sys_tai);
		break;

	    case CS_LEAPTAB:
		if (leap_sec > 0)
			ctl_putfs(sys_var[CS_LEAPTAB].text,
			    leap_sec);
		break;

	    case CS_LEAPEND:
		if (leap_expire > 0)
			ctl_putfs(sys_var[CS_LEAPEND].text,
			    leap_expire);
		break;

	    case CS_RATE:
		ctl_putuint(sys_var[CS_RATE].text, ntp_minpoll);
		break;

#ifdef OPENSSL
	    case CS_FLAGS:
		if (crypto_flags)
			ctl_puthex(sys_var[CS_FLAGS].text,
			    crypto_flags);
		break;

	    case CS_DIGEST:
		if (crypto_flags) {
			strcpy(str, OBJ_nid2ln(crypto_nid));
			ctl_putstr(sys_var[CS_DIGEST].text, str,
			    strlen(str));
		}
		break;

	    case CS_SIGNATURE:
		if (crypto_flags) {
			const EVP_MD *dp;

			dp = EVP_get_digestbynid(crypto_flags >> 16);
			strcpy(str, OBJ_nid2ln(EVP_MD_pkey_type(dp)));
			ctl_putstr(sys_var[CS_SIGNATURE].text, str,
			    strlen(str));
		}
		break;

	    case CS_HOST:
		if (sys_hostname != NULL)
			ctl_putstr(sys_var[CS_HOST].text, sys_hostname,
			    strlen(sys_hostname));
		break;

	    case CS_GROUP:
		if (sys_groupname != NULL)
			ctl_putstr(sys_var[CS_GROUP].text, sys_groupname,
			    strlen(sys_groupname));
		break;

	    case CS_CERTIF:
		for (cp = cinfo; cp != NULL; cp = cp->link) {
			snprintf(cbuf, sizeof(cbuf), "%s %s 0x%x",
			    cp->subject, cp->issuer, cp->flags);
			ctl_putstr(sys_var[CS_CERTIF].text, cbuf,
			    strlen(cbuf));
			ctl_putfs(sys_var[CS_REVTIME].text, cp->last);
		}
		break;

	    case CS_PUBLIC:
		if (hostval.tstamp != 0)
			ctl_putfs(sys_var[CS_PUBLIC].text,
			    ntohl(hostval.tstamp));
		break;
#endif /* OPENSSL */
	}
}


/*
 * ctl_putpeer - output a peer variable
 */
static void
ctl_putpeer(
	int varid,
	struct peer *peer
	)
{
	int temp;
#ifdef OPENSSL
	char str[256];
	struct autokey *ap;
#endif /* OPENSSL */

	switch (varid) {

	    case CP_CONFIG:
		ctl_putuint(peer_var[CP_CONFIG].text,
		    (unsigned)((peer->flags & FLAG_PREEMPT) == 0));
		break;

	    case CP_AUTHENABLE:
		ctl_putuint(peer_var[CP_AUTHENABLE].text,
		    (unsigned)(peer->keyid != 0));
		break;

	    case CP_AUTHENTIC:
		ctl_putuint(peer_var[CP_AUTHENTIC].text,
		    (unsigned)((peer->flags & FLAG_AUTHENTIC) != 0));
		break;

	    case CP_SRCADR:
		ctl_putadr(peer_var[CP_SRCADR].text, 0,
		    &peer->srcadr);
		break;

	    case CP_SRCPORT:
		ctl_putuint(peer_var[CP_SRCPORT].text,
		    ntohs(((struct sockaddr_in*)&peer->srcadr)->sin_port));
		break;

	    case CP_DSTADR:
		if (peer->dstadr) {
			ctl_putadr(peer_var[CP_DSTADR].text, 0,
				   &(peer->dstadr->sin));
		} else {
			ctl_putadr(peer_var[CP_DSTADR].text, 0,
				   NULL);
		}
		break;

	    case CP_DSTPORT:
		ctl_putuint(peer_var[CP_DSTPORT].text,
		    (u_long)(peer->dstadr ?
		    ntohs(((struct sockaddr_in*)&peer->dstadr->sin)->sin_port) : 0));
		break;

	    case CP_IN:
		if (peer->r21 > 0)
			ctl_putdbl(peer_var[CP_IN].text,
				   peer->r21 / 1e3);
		break;

	    case CP_OUT:
		if (peer->r34 >0)
			ctl_putdbl(peer_var[CP_OUT].text,
				   peer->r34 / 1e3);
		break;

	    case CP_RATE:
		ctl_putuint(peer_var[CP_RATE].text, peer->throttle);
		break;

	    case CP_LEAP:
		ctl_putuint(peer_var[CP_LEAP].text, peer->leap);
		break;

	    case CP_HMODE:
		ctl_putuint(peer_var[CP_HMODE].text, peer->hmode);
		break;

	    case CP_STRATUM:
		ctl_putuint(peer_var[CP_STRATUM].text, peer->stratum);
		break;

	    case CP_PPOLL:
		ctl_putuint(peer_var[CP_PPOLL].text, peer->ppoll);
		break;

	    case CP_HPOLL:
		ctl_putuint(peer_var[CP_HPOLL].text, peer->hpoll);
		break;

	    case CP_PRECISION:
		ctl_putint(peer_var[CP_PRECISION].text,
			peer->precision);
		break;

	    case CP_ROOTDELAY:
		ctl_putdbl(peer_var[CP_ROOTDELAY].text,
			   peer->rootdelay * 1e3);
		break;

	    case CP_ROOTDISPERSION:
		ctl_putdbl(peer_var[CP_ROOTDISPERSION].text,
			   peer->rootdisp * 1e3);
		break;

	    case CP_REFID:
#ifdef REFCLOCK
		if (peer->flags & FLAG_REFCLOCK) {
			ctl_putrefid(peer_var[varid].text, peer->refid);
			break;
		}
#endif
		if (peer->stratum > 1 && peer->stratum < STRATUM_UNSPEC)
			ctl_putadr(peer_var[varid].text, peer->refid,
				   NULL);
		else
			ctl_putrefid(peer_var[varid].text, peer->refid);
		break;

	    case CP_REFTIME:
		ctl_putts(peer_var[CP_REFTIME].text, &peer->reftime);
		break;

	    case CP_ORG:
		ctl_putts(peer_var[CP_ORG].text, &peer->aorg);
		break;

	    case CP_REC:
		ctl_putts(peer_var[CP_REC].text, &peer->dst);
		break;

	    case CP_XMT:
		if (peer->xleave != 0)
			ctl_putdbl(peer_var[CP_XMT].text, peer->xleave *
			    1e3);
		break;

	    case CP_BIAS:
		if (peer->bias != 0)
			ctl_putdbl(peer_var[CP_BIAS].text, peer->bias *
			    1e3);
		break;

	    case CP_REACH:
		ctl_puthex(peer_var[CP_REACH].text, peer->reach);
		break;

	    case CP_FLASH:
		temp = peer->flash;
		ctl_puthex(peer_var[CP_FLASH].text, temp);
		break;

	    case CP_TTL:
		if (peer->ttl > 0)
			ctl_putint(peer_var[CP_TTL].text,
			    sys_ttl[peer->ttl]);
		break;

	    case CP_UNREACH:
		ctl_putuint(peer_var[CP_UNREACH].text, peer->unreach);
		break;

	    case CP_TIMER:
		ctl_putuint(peer_var[CP_TIMER].text,
		    peer->nextdate - current_time);
		break;

	    case CP_DELAY:
		ctl_putdbl(peer_var[CP_DELAY].text, peer->delay * 1e3);
		break;

	    case CP_OFFSET:
		ctl_putdbl(peer_var[CP_OFFSET].text, peer->offset *
		   1e3);
		break;

	    case CP_JITTER:
		ctl_putdbl(peer_var[CP_JITTER].text, peer->jitter *
		    1e3);
		break;

	    case CP_DISPERSION:
		ctl_putdbl(peer_var[CP_DISPERSION].text, peer->disp *
		   1e3);
		break;

	    case CP_KEYID:
		if (peer->keyid > NTP_MAXKEY)
			ctl_puthex(peer_var[CP_KEYID].text,
			    peer->keyid);
		else
			ctl_putuint(peer_var[CP_KEYID].text,
			    peer->keyid);
		break;

	    case CP_FILTDELAY:
		ctl_putarray(peer_var[CP_FILTDELAY].text,
		    peer->filter_delay, (int)peer->filter_nextpt);
		break;

	    case CP_FILTOFFSET:
		ctl_putarray(peer_var[CP_FILTOFFSET].text,
		    peer->filter_offset, (int)peer->filter_nextpt);
		break;

	    case CP_FILTERROR:
		ctl_putarray(peer_var[CP_FILTERROR].text,
		    peer->filter_disp, (int)peer->filter_nextpt);
		break;

	    case CP_PMODE:
		ctl_putuint(peer_var[CP_PMODE].text, peer->pmode);
		break;

	    case CP_RECEIVED:
		ctl_putuint(peer_var[CP_RECEIVED].text, peer->received);
		break;

	    case CP_SENT:
		ctl_putuint(peer_var[CP_SENT].text, peer->sent);
		break;

	    case CP_VARLIST:
	    {
		    char buf[CTL_MAX_DATA_LEN];
		    register char *s, *t, *be;
		    register int i;
		    register struct ctl_var *k;

		    s = buf;
		    be = buf + sizeof(buf);
		    if (s + strlen(peer_var[CP_VARLIST].text) + 4 > be)
			    break;	/* really long var name */

		    snprintf(s, sizeof(buf), "%s=\"",
			peer_var[CP_VARLIST].text);
		    s += strlen(s);
		    t = s;
		    for (k = peer_var; !(k->flags & EOV); k++) {
			    if (k->flags & PADDING)
				    continue;

			    i = strlen(k->text);
			    if (s + i + 1 >= be)
				    break;

			    if (s != t)
				    *s++ = ',';
			    memcpy(s, k->text, i);
			    s += i;
		    }
		    if (s+2 >= be)
			    break;

		    *s++ = '"';
		    *s = '\0';
		    ctl_putdata(buf, (unsigned)(s - buf), 0);
	    }
	    break;
#ifdef OPENSSL
	    case CP_FLAGS:
		if (peer->crypto)
			ctl_puthex(peer_var[CP_FLAGS].text, peer->crypto);
		break;

	    case CP_SIGNATURE:
		if (peer->crypto) {
			const EVP_MD *dp;

			dp = EVP_get_digestbynid(peer->crypto >> 16);
			strcpy(str, OBJ_nid2ln(EVP_MD_pkey_type(dp)));
			ctl_putstr(peer_var[CP_SIGNATURE].text, str,
			    strlen(str));
		}
		break;

	    case CP_HOST:
		if (peer->subject != NULL)
			ctl_putstr(peer_var[CP_HOST].text,
			    peer->subject, strlen(peer->subject));
		break;

	    case CP_VALID:		/* not used */
		break;

	    case CP_INITSEQ:
		if ((ap = (struct autokey *)peer->recval.ptr) == NULL)
			break;

		ctl_putint(peer_var[CP_INITSEQ].text, ap->seq);
		ctl_puthex(peer_var[CP_INITKEY].text, ap->key);
		ctl_putfs(peer_var[CP_INITTSP].text,
			  ntohl(peer->recval.tstamp));
		break;
#endif /* OPENSSL */
	}
}


#ifdef REFCLOCK
/*
 * ctl_putclock - output clock variables
 */
static void
ctl_putclock(
	int varid,
	struct refclockstat *clock_stat,
	int mustput
	)
{
	switch(varid) {

	    case CC_TYPE:
		if (mustput || clock_stat->clockdesc == NULL
		    || *(clock_stat->clockdesc) == '\0') {
			ctl_putuint(clock_var[CC_TYPE].text, clock_stat->type);
		}
		break;
	    case CC_TIMECODE:
		ctl_putstr(clock_var[CC_TIMECODE].text,
			   clock_stat->p_lastcode,
			   (unsigned)clock_stat->lencode);
		break;

	    case CC_POLL:
		ctl_putuint(clock_var[CC_POLL].text, clock_stat->polls);
		break;

	    case CC_NOREPLY:
		ctl_putuint(clock_var[CC_NOREPLY].text,
			    clock_stat->noresponse);
		break;

	    case CC_BADFORMAT:
		ctl_putuint(clock_var[CC_BADFORMAT].text,
			    clock_stat->badformat);
		break;

	    case CC_BADDATA:
		ctl_putuint(clock_var[CC_BADDATA].text,
			    clock_stat->baddata);
		break;

	    case CC_FUDGETIME1:
		if (mustput || (clock_stat->haveflags & CLK_HAVETIME1))
			ctl_putdbl(clock_var[CC_FUDGETIME1].text,
				   clock_stat->fudgetime1 * 1e3);
		break;

	    case CC_FUDGETIME2:
		if (mustput || (clock_stat->haveflags & CLK_HAVETIME2))
			ctl_putdbl(clock_var[CC_FUDGETIME2].text,
				   clock_stat->fudgetime2 * 1e3);
		break;

	    case CC_FUDGEVAL1:
		if (mustput || (clock_stat->haveflags & CLK_HAVEVAL1))
			ctl_putint(clock_var[CC_FUDGEVAL1].text,
				   clock_stat->fudgeval1);
		break;

	    case CC_FUDGEVAL2:
		if (mustput || (clock_stat->haveflags & CLK_HAVEVAL2)) {
			if (clock_stat->fudgeval1 > 1)
				ctl_putadr(clock_var[CC_FUDGEVAL2].text,
					   clock_stat->fudgeval2, NULL);
			else
				ctl_putrefid(clock_var[CC_FUDGEVAL2].text,
					     clock_stat->fudgeval2);
		}
		break;

	    case CC_FLAGS:
		if (mustput || (clock_stat->haveflags &	(CLK_HAVEFLAG1 |
							 CLK_HAVEFLAG2 | CLK_HAVEFLAG3 | CLK_HAVEFLAG4)))
			ctl_putuint(clock_var[CC_FLAGS].text,
				    clock_stat->flags);
		break;

	    case CC_DEVICE:
		if (clock_stat->clockdesc == NULL ||
		    *(clock_stat->clockdesc) == '\0') {
			if (mustput)
				ctl_putstr(clock_var[CC_DEVICE].text,
					   "", 0);
		} else {
			ctl_putstr(clock_var[CC_DEVICE].text,
				   clock_stat->clockdesc,
				   strlen(clock_stat->clockdesc));
		}
		break;

	    case CC_VARLIST:
	    {
		    char buf[CTL_MAX_DATA_LEN];
		    register char *s, *t, *be;
		    register const char *ss;
		    register int i;
		    register struct ctl_var *k;

		    s = buf;
		    be = buf + sizeof(buf);
		    if (s + strlen(clock_var[CC_VARLIST].text) + 4 >
			be)
			    break;	/* really long var name */

		    snprintf(s, sizeof(buf), "%s=\"", 
		        clock_var[CC_VARLIST].text);
		    s += strlen(s);
		    t = s;

		    for (k = clock_var; !(k->flags & EOV); k++) {
			    if (k->flags & PADDING)
				    continue;

			    i = strlen(k->text);
			    if (s + i + 1 >= be)
				    break;

			    if (s != t)
				    *s++ = ',';
			    memcpy(s, k->text, i);
			    s += i;
		    }

		    for (k = clock_stat->kv_list; k && !(k->flags &
							 EOV); k++) {
			    if (k->flags & PADDING)
				    continue;

			    ss = k->text;
			    if (!ss)
				    continue;

			    while (*ss && *ss != '=')
				    ss++;
			    i = ss - k->text;
			    if (s+i+1 >= be)
				    break;

			    if (s != t)
				    *s++ = ',';
			    memcpy(s, k->text, (unsigned)i);
			    s += i;
			    *s = '\0';
		    }
		    if (s+2 >= be)
			    break;

		    *s++ = '"';
		    *s = '\0';
		    ctl_putdata(buf, (unsigned)( s - buf ), 0);
	    }
	    break;
	}
}
#endif



/*
 * ctl_getitem - get the next data item from the incoming packet
 */
static struct ctl_var *
ctl_getitem(
	struct ctl_var *var_list,
	char **data
	)
{
	register struct ctl_var *v;
	register char *cp;
	register char *tp;
	static struct ctl_var eol = { 0, EOV, };
	static char buf[128];

	/*
	 * Delete leading commas and white space
	 */
	while (reqpt < reqend && (*reqpt == ',' ||
				  isspace((unsigned char)*reqpt)))
		reqpt++;
	if (reqpt >= reqend)
		return (0);

	if (var_list == (struct ctl_var *)0)
		return (&eol);

	/*
	 * Look for a first character match on the tag.  If we find
	 * one, see if it is a full match.
	 */
	v = var_list;
	cp = reqpt;
	while (!(v->flags & EOV)) {
		if (!(v->flags & PADDING) && *cp == *(v->text)) {
			tp = v->text;
			while (*tp != '\0' && *tp != '=' && cp <
			       reqend && *cp == *tp) {
				cp++;
				tp++;
			}
			if ((*tp == '\0') || (*tp == '=')) {
				while (cp < reqend && isspace((unsigned char)*cp))
					cp++;
				if (cp == reqend || *cp == ',') {
					buf[0] = '\0';
					*data = buf;
					if (cp < reqend)
						cp++;
					reqpt = cp;
					return v;
				}
				if (*cp == '=') {
					cp++;
					tp = buf;
					while (cp < reqend && isspace((unsigned char)*cp))
						cp++;
					while (cp < reqend && *cp != ',') {
						*tp++ = *cp++;
						if (tp >= buf + sizeof(buf)) {
							ctl_error(CERR_BADFMT);
							numctlbadpkts++;
#if 0	/* Avoid possible DOS attack */
/* If we get a smarter msyslog we can re-enable this */
							msyslog(LOG_WARNING,
								"Possible 'ntpdx' exploit from %s:%d (possibly spoofed)\n",
								stoa(rmt_addr), SRCPORT(rmt_addr)
								);
#endif
							return (0);
						}
					}
					if (cp < reqend)
						cp++;
					*tp-- = '\0';
					while (tp >= buf) {
						if (!isspace((unsigned int)(*tp)))
							break;
						*tp-- = '\0';
					}
					reqpt = cp;
					*data = buf;
					return (v);
				}
			}
			cp = reqpt;
		}
		v++;
	}
	return v;
}


/*
 * control_unspec - response to an unspecified op-code
 */
/*ARGSUSED*/
static void
control_unspec(
	struct recvbuf *rbufp,
	int restrict_mask
	)
{
	struct peer *peer;

	/*
	 * What is an appropriate response to an unspecified op-code?
	 * I return no errors and no data, unless a specified assocation
	 * doesn't exist.
	 */
	if (res_associd != 0) {
		if ((peer = findpeerbyassoc(res_associd)) == 0) {
			ctl_error(CERR_BADASSOC);
			return;
		}
		rpkt.status = htons(ctlpeerstatus(peer));
	} else {
		rpkt.status = htons(ctlsysstatus());
	}
	ctl_flushpkt(0);
}


/*
 * read_status - return either a list of associd's, or a particular
 * peer's status.
 */
/*ARGSUSED*/
static void
read_status(
	struct recvbuf *rbufp,
	int restrict_mask
	)
{
	register int i;
	register struct peer *peer;
	u_short ass_stat[CTL_MAX_DATA_LEN / sizeof(u_short)];

#ifdef DEBUG
	if (debug > 2)
		printf("read_status: ID %d\n", res_associd);
#endif
	/*
	 * Two choices here. If the specified association ID is
	 * zero we return all known assocation ID's.  Otherwise
	 * we return a bunch of stuff about the particular peer.
	 */
	if (res_associd == 0) {
		register int n;

		n = 0;
		rpkt.status = htons(ctlsysstatus());
		for (i = 0; i < NTP_HASH_SIZE; i++) {
			for (peer = assoc_hash[i]; peer != 0;
			     peer = peer->ass_next) {
				ass_stat[n++] = htons(peer->associd);
				ass_stat[n++] =
				    htons(ctlpeerstatus(peer));
				if (n ==
				    CTL_MAX_DATA_LEN/sizeof(u_short)) {
					ctl_putdata((char *)ass_stat,
						    n * sizeof(u_short), 1);
					n = 0;
				}
			}
		}

		if (n != 0)
			ctl_putdata((char *)ass_stat, n *
				    sizeof(u_short), 1);
		ctl_flushpkt(0);
	} else {
		peer = findpeerbyassoc(res_associd);
		if (peer == 0) {
			ctl_error(CERR_BADASSOC);
		} else {
			register u_char *cp;

			rpkt.status = htons(ctlpeerstatus(peer));
			if (res_authokay)
				peer->num_events = 0;
			/*
			 * For now, output everything we know about the
			 * peer. May be more selective later.
			 */
			for (cp = def_peer_var; *cp != 0; cp++)
				ctl_putpeer((int)*cp, peer);
			ctl_flushpkt(0);
		}
	}
}


/*
 * read_variables - return the variables the caller asks for
 */
/*ARGSUSED*/
static void
read_variables(
	struct recvbuf *rbufp,
	int restrict_mask
	)
{
	register struct ctl_var *v;
	register int i;
	char *valuep;
	u_char *wants;
	unsigned int gotvar = (CS_MAXCODE > CP_MAXCODE) ? (CS_MAXCODE +
							   1) : (CP_MAXCODE + 1);
	if (res_associd == 0) {
		/*
		 * Wants system variables. Figure out which he wants
		 * and give them to him.
		 */
		rpkt.status = htons(ctlsysstatus());
		if (res_authokay)
			ctl_sys_num_events = 0;
		gotvar += count_var(ext_sys_var);
		wants = (u_char *)emalloc(gotvar);
		memset((char *)wants, 0, gotvar);
		gotvar = 0;
		while ((v = ctl_getitem(sys_var, &valuep)) != 0) {
			if (v->flags & EOV) {
				if ((v = ctl_getitem(ext_sys_var,
						     &valuep)) != 0) {
					if (v->flags & EOV) {
						ctl_error(CERR_UNKNOWNVAR);
						free((char *)wants);
						return;
					}
					wants[CS_MAXCODE + 1 +
					      v->code] = 1;
					gotvar = 1;
					continue;
				} else {
					break; /* shouldn't happen ! */
				}
			}
			wants[v->code] = 1;
			gotvar = 1;
		}
		if (gotvar) {
			for (i = 1; i <= CS_MAXCODE; i++)
				if (wants[i])
					ctl_putsys(i);
			for (i = 0; ext_sys_var &&
				 !(ext_sys_var[i].flags & EOV); i++)
				if (wants[i + CS_MAXCODE + 1])
					ctl_putdata(ext_sys_var[i].text,
						    strlen(ext_sys_var[i].text),
						    0);
		} else {
			register u_char *cs;
			register struct ctl_var *kv;

			for (cs = def_sys_var; *cs != 0; cs++)
				ctl_putsys((int)*cs);
			for (kv = ext_sys_var; kv && !(kv->flags & EOV);
			     kv++)
				if (kv->flags & DEF)
					ctl_putdata(kv->text,
						    strlen(kv->text), 0);
		}
		free((char *)wants);
	} else {
		register struct peer *peer;

		/*
		 * Wants info for a particular peer. See if we know
		 * the guy.
		 */
		peer = findpeerbyassoc(res_associd);
		if (peer == 0) {
			ctl_error(CERR_BADASSOC);
			return;
		}
		rpkt.status = htons(ctlpeerstatus(peer));
		if (res_authokay)
			peer->num_events = 0;
		wants = (u_char *)emalloc(gotvar);
		memset((char*)wants, 0, gotvar);
		gotvar = 0;
		while ((v = ctl_getitem(peer_var, &valuep)) != 0) {
			if (v->flags & EOV) {
				ctl_error(CERR_UNKNOWNVAR);
				free((char *)wants);
				return;
			}
			wants[v->code] = 1;
			gotvar = 1;
		}
		if (gotvar) {
			for (i = 1; i <= CP_MAXCODE; i++)
				if (wants[i])
					ctl_putpeer(i, peer);
		} else {
			register u_char *cp;

			for (cp = def_peer_var; *cp != 0; cp++)
				ctl_putpeer((int)*cp, peer);
		}
		free((char *)wants);
	}
	ctl_flushpkt(0);
}


/*
 * write_variables - write into variables. We only allow leap bit
 * writing this way.
 */
/*ARGSUSED*/
static void
write_variables(
	struct recvbuf *rbufp,
	int restrict_mask
	)
{
	register struct ctl_var *v;
	register int ext_var;
	char *valuep;
	long val = 0;

	/*
	 * If he's trying to write into a peer tell him no way
	 */
	if (res_associd != 0) {
		ctl_error(CERR_PERMISSION);
		return;
	}

	/*
	 * Set status
	 */
	rpkt.status = htons(ctlsysstatus());

	/*
	 * Look through the variables. Dump out at the first sign of
	 * trouble.
	 */
	while ((v = ctl_getitem(sys_var, &valuep)) != 0) {
		ext_var = 0;
		if (v->flags & EOV) {
			if ((v = ctl_getitem(ext_sys_var, &valuep)) !=
			    0) {
				if (v->flags & EOV) {
					ctl_error(CERR_UNKNOWNVAR);
					return;
				}
				ext_var = 1;
			} else {
				break;
			}
		}
		if (!(v->flags & CAN_WRITE)) {
			ctl_error(CERR_PERMISSION);
			return;
		}
		if (!ext_var && (*valuep == '\0' || !atoint(valuep,
							    &val))) {
			ctl_error(CERR_BADFMT);
			return;
		}
		if (!ext_var && (val & ~LEAP_NOTINSYNC) != 0) {
			ctl_error(CERR_BADVALUE);
			return;
		}

		if (ext_var) {
			char *s = (char *)emalloc(strlen(v->text) +
						  strlen(valuep) + 2);
			const char *t;
			char *tt = s;

			t = v->text;
			while (*t && *t != '=')
				*tt++ = *t++;

			*tt++ = '=';
			strcat(tt, valuep);
			set_sys_var(s, strlen(s)+1, v->flags);
			free(s);
		} else {
			/*
			 * This one seems sane. Save it.
			 */
			switch(v->code) {

			    case CS_LEAP:
			    default:
				ctl_error(CERR_UNSPEC); /* really */
				return;
			}
		}
	}

	/*
	 * If we got anything, do it. xxx nothing to do ***
	 */
	/*
	  if (leapind != ~0 || leapwarn != ~0) {
	  if (!leap_setleap((int)leapind, (int)leapwarn)) {
	  ctl_error(CERR_PERMISSION);
	  return;
	  }
	  }
	*/
	ctl_flushpkt(0);
}

/*
 * configure() processes ntpq :config/config-from-file, allowing
 *		generic runtime reconfiguration.
 */
static void configure(
	struct recvbuf *rbufp,
	int restrict_mask
	)
{
	size_t data_count;
	int retval;
	int replace_nl;

	/* I haven't yet implemented changes to an existing association.
	 * Hence check if the association id is 0
	 */
	if (res_associd != 0) {
		ctl_error(CERR_BADVALUE);
		return;
	}

	if (restrict_mask & RES_NOMODIFY) {
		snprintf(remote_config.err_msg,
			 sizeof(remote_config.err_msg),
			 "runtime configuration prohibited by restrict ... nomodify");
		ctl_putdata(remote_config.err_msg, 
			    strlen(remote_config.err_msg), 0);
		ctl_flushpkt(0);
		msyslog(LOG_NOTICE,
			"runtime config from %s rejected due to nomodify restriction",
			stoa(&rbufp->recv_srcadr));
		return;
	}

	/* Initialize the remote config buffer */
	data_count = reqend - reqpt;
	memcpy(remote_config.buffer, reqpt, data_count);
	if (data_count > 0
	    && '\n' != remote_config.buffer[data_count - 1])
		remote_config.buffer[data_count++] = '\n';
	remote_config.buffer[data_count] = '\0';
	remote_config.pos = 0;
	remote_config.err_pos = 0;
	remote_config.no_errors = 0;

	/* do not include terminating newline in log */
	if (data_count > 0
	    && '\n' == remote_config.buffer[data_count - 1]) {
		remote_config.buffer[data_count - 1] = '\0';
		replace_nl = 1;
	} else
		replace_nl = 0;

	DPRINTF(1, ("Got Remote Configuration Command: %s\n",
		remote_config.buffer));
	msyslog(LOG_NOTICE, "%s config: %s",
		stoa(&rbufp->recv_srcadr),
		remote_config.buffer);

	if (replace_nl)
		remote_config.buffer[data_count - 1] = '\n';

	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.
	 */
	if (0 == remote_config.no_errors) {
		retval = snprintf(remote_config.err_msg,
				  sizeof(remote_config.err_msg),
				  "Config Succeeded");
		if (retval > 0) 
			remote_config.err_pos += retval;
	}
	
	ctl_putdata(remote_config.err_msg, remote_config.err_pos, 0);
	ctl_flushpkt(0);

	DPRINTF(1, ("Reply: %s\n", remote_config.err_msg));

	if (remote_config.no_errors > 0)
		msyslog(LOG_NOTICE, "%d error in %s config",
			remote_config.no_errors,
			stoa(&rbufp->recv_srcadr));
}


/*
 * read_clock_status - return clock radio status
 */
/*ARGSUSED*/
static void
read_clock_status(
	struct recvbuf *rbufp,
	int restrict_mask
	)
{
#ifndef REFCLOCK
	/*
	 * If no refclock support, no data to return
	 */
	ctl_error(CERR_BADASSOC);
#else
	register struct ctl_var *v;
	register int i;
	register struct peer *peer;
	char *valuep;
	u_char *wants;
	unsigned int gotvar;
	struct refclockstat clock_stat;

	if (res_associd == 0) {

		/*
		 * Find a clock for this jerk.	If the system peer
		 * is a clock use it, else search the hash tables
		 * for one.
		 */
		if (sys_peer != 0 && (sys_peer->flags & FLAG_REFCLOCK))
		{
			peer = sys_peer;
		} else {
			peer = 0;
			for (i = 0; peer == 0 && i < NTP_HASH_SIZE; i++) {
				for (peer = assoc_hash[i]; peer != 0;
				     peer = peer->ass_next) {
					if (peer->flags & FLAG_REFCLOCK)
						break;
				}
			}
			if (peer == 0) {
				ctl_error(CERR_BADASSOC);
				return;
			}
		}
	} else {
		peer = findpeerbyassoc(res_associd);
		if (peer == 0 || !(peer->flags & FLAG_REFCLOCK)) {
			ctl_error(CERR_BADASSOC);
			return;
		}
	}

	/*
	 * If we got here we have a peer which is a clock. Get his
	 * status.
	 */
	clock_stat.kv_list = (struct ctl_var *)0;
	refclock_control(&peer->srcadr, (struct refclockstat *)0,
			 &clock_stat);

	/*
	 * Look for variables in the packet.
	 */
	rpkt.status = htons(ctlclkstatus(&clock_stat));
	gotvar = CC_MAXCODE + 1 + count_var(clock_stat.kv_list);
	wants = (u_char *)emalloc(gotvar);
	memset((char*)wants, 0, gotvar);
	gotvar = 0;
	while ((v = ctl_getitem(clock_var, &valuep)) != 0) {
		if (v->flags & EOV) {
			if ((v = ctl_getitem(clock_stat.kv_list,
					     &valuep)) != 0) {
				if (v->flags & EOV) {
					ctl_error(CERR_UNKNOWNVAR);
					free((char*)wants);
					free_varlist(clock_stat.kv_list);
					return;
				}
				wants[CC_MAXCODE + 1 + v->code] = 1;
				gotvar = 1;
				continue;
			} else {
				break; /* shouldn't happen ! */
			}
		}
		wants[v->code] = 1;
		gotvar = 1;
	}

	if (gotvar) {
		for (i = 1; i <= CC_MAXCODE; i++)
			if (wants[i])
				ctl_putclock(i, &clock_stat, 1);
		for (i = 0; clock_stat.kv_list &&
			 !(clock_stat.kv_list[i].flags & EOV); i++)
			if (wants[i + CC_MAXCODE + 1])
				ctl_putdata(clock_stat.kv_list[i].text,
					    strlen(clock_stat.kv_list[i].text),
					    0);
	} else {
		register u_char *cc;
		register struct ctl_var *kv;

		for (cc = def_clock_var; *cc != 0; cc++)
			ctl_putclock((int)*cc, &clock_stat, 0);
		for (kv = clock_stat.kv_list; kv && !(kv->flags & EOV);
		     kv++)
			if (kv->flags & DEF)
				ctl_putdata(kv->text, strlen(kv->text),
					    0);
	}

	free((char*)wants);
	free_varlist(clock_stat.kv_list);

	ctl_flushpkt(0);
#endif
}


/*
 * write_clock_status - we don't do this
 */
/*ARGSUSED*/
static void
write_clock_status(
	struct recvbuf *rbufp,
	int restrict_mask
	)
{
	ctl_error(CERR_PERMISSION);
}

/*
 * Trap support from here on down. We send async trap messages when the
 * upper levels report trouble. Traps can by set either by control
 * messages or by configuration.
 */
/*
 * set_trap - set a trap in response to a control message
 */
static void
set_trap(
	struct recvbuf *rbufp,
	int restrict_mask
	)
{
	int traptype;

	/*
	 * See if this guy is allowed
	 */
	if (restrict_mask & RES_NOTRAP) {
		ctl_error(CERR_PERMISSION);
		return;
	}

	/*
	 * Determine his allowed trap type.
	 */
	traptype = TRAP_TYPE_PRIO;
	if (restrict_mask & RES_LPTRAP)
		traptype = TRAP_TYPE_NONPRIO;

	/*
	 * Call ctlsettrap() to do the work.  Return
	 * an error if it can't assign the trap.
	 */
	if (!ctlsettrap(&rbufp->recv_srcadr, rbufp->dstadr, traptype,
			(int)res_version))
		ctl_error(CERR_NORESOURCE);
	ctl_flushpkt(0);
}


/*
 * unset_trap - unset a trap in response to a control message
 */
static void
unset_trap(
	struct recvbuf *rbufp,
	int restrict_mask
	)
{
	int traptype;

	/*
	 * We don't prevent anyone from removing his own trap unless the
	 * trap is configured. Note we also must be aware of the
	 * possibility that restriction flags were changed since this
	 * guy last set his trap. Set the trap type based on this.
	 */
	traptype = TRAP_TYPE_PRIO;
	if (restrict_mask & RES_LPTRAP)
		traptype = TRAP_TYPE_NONPRIO;

	/*
	 * Call ctlclrtrap() to clear this out.
	 */
	if (!ctlclrtrap(&rbufp->recv_srcadr, rbufp->dstadr, traptype))
		ctl_error(CERR_BADASSOC);
	ctl_flushpkt(0);
}


/*
 * ctlsettrap - called to set a trap
 */
int
ctlsettrap(
	sockaddr_u *raddr,
	struct interface *linter,
	int traptype,
	int version
	)
{
	register struct ctl_trap *tp;
	register struct ctl_trap *tptouse;

	/*
	 * See if we can find this trap.  If so, we only need update
	 * the flags and the time.
	 */
	if ((tp = ctlfindtrap(raddr, linter)) != NULL) {
		switch (traptype) {

		    case TRAP_TYPE_CONFIG:
			tp->tr_flags = TRAP_INUSE|TRAP_CONFIGURED;
			break;

		    case TRAP_TYPE_PRIO:
			if (tp->tr_flags & TRAP_CONFIGURED)
				return (1); /* don't change anything */
			tp->tr_flags = TRAP_INUSE;
			break;

		    case TRAP_TYPE_NONPRIO:
			if (tp->tr_flags & TRAP_CONFIGURED)
				return (1); /* don't change anything */
			tp->tr_flags = TRAP_INUSE|TRAP_NONPRIO;
			break;
		}
		tp->tr_settime = current_time;
		tp->tr_resets++;
		return (1);
	}

	/*
	 * First we heard of this guy.	Try to find a trap structure
	 * for him to use, clearing out lesser priority guys if we
	 * have to. Clear out anyone who's expired while we're at it.
	 */
	tptouse = NULL;
	for (tp = ctl_trap; tp < &ctl_trap[CTL_MAXTRAPS]; tp++) {
		if ((tp->tr_flags & TRAP_INUSE) &&
		    !(tp->tr_flags & TRAP_CONFIGURED) &&
		    ((tp->tr_settime + CTL_TRAPTIME) > current_time)) {
			tp->tr_flags = 0;
			num_ctl_traps--;
		}
		if (!(tp->tr_flags & TRAP_INUSE)) {
			tptouse = tp;
		} else if (!(tp->tr_flags & TRAP_CONFIGURED)) {
			switch (traptype) {

			    case TRAP_TYPE_CONFIG:
				if (tptouse == NULL) {
					tptouse = tp;
					break;
				}
				if (tptouse->tr_flags & TRAP_NONPRIO &&
				    !(tp->tr_flags & TRAP_NONPRIO))
					break;

				if (!(tptouse->tr_flags & TRAP_NONPRIO)
				    && tp->tr_flags & TRAP_NONPRIO) {
					tptouse = tp;
					break;
				}
				if (tptouse->tr_origtime <
				    tp->tr_origtime)
					tptouse = tp;
				break;

			    case TRAP_TYPE_PRIO:
				if (tp->tr_flags & TRAP_NONPRIO) {
					if (tptouse == NULL ||
					    (tptouse->tr_flags &
					     TRAP_INUSE &&
					     tptouse->tr_origtime <
					     tp->tr_origtime))
						tptouse = tp;
				}
				break;

			    case TRAP_TYPE_NONPRIO:
				break;
			}
		}
	}

	/*
	 * If we don't have room for him return an error.
	 */
	if (tptouse == NULL)
		return (0);

	/*
	 * Set up this structure for him.
	 */
	tptouse->tr_settime = tptouse->tr_origtime = current_time;
	tptouse->tr_count = tptouse->tr_resets = 0;
	tptouse->tr_sequence = 1;
	tptouse->tr_addr = *raddr;
	tptouse->tr_localaddr = linter;
	tptouse->tr_version = (u_char) version;
	tptouse->tr_flags = TRAP_INUSE;
	if (traptype == TRAP_TYPE_CONFIG)
		tptouse->tr_flags |= TRAP_CONFIGURED;
	else if (traptype == TRAP_TYPE_NONPRIO)
		tptouse->tr_flags |= TRAP_NONPRIO;
	num_ctl_traps++;
	return (1);
}


/*
 * ctlclrtrap - called to clear a trap
 */
int
ctlclrtrap(
	sockaddr_u *raddr,
	struct interface *linter,
	int traptype
	)
{
	register struct ctl_trap *tp;

	if ((tp = ctlfindtrap(raddr, linter)) == NULL)
		return (0);

	if (tp->tr_flags & TRAP_CONFIGURED
	    && traptype != TRAP_TYPE_CONFIG)
		return (0);

	tp->tr_flags = 0;
	num_ctl_traps--;
	return (1);
}


/*
 * ctlfindtrap - find a trap given the remote and local addresses
 */
static struct ctl_trap *
ctlfindtrap(
	sockaddr_u *raddr,
	struct interface *linter
	)
{
	register struct ctl_trap *tp;

	for (tp = ctl_trap; tp < &ctl_trap[CTL_MAXTRAPS]; tp++) {
		if ((tp->tr_flags & TRAP_INUSE)
		    && (NSRCPORT(raddr) == NSRCPORT(&tp->tr_addr))
		    && SOCK_EQ(raddr, &tp->tr_addr)
	 	    && (linter == tp->tr_localaddr) )
			return (tp);
	}
	return (struct ctl_trap *)NULL;
}


/*
 * report_event - report an event to the trappers
 */
void
report_event(
	int	err,		/* error code */
	struct peer *peer,	/* peer structure pointer */
	const char *str		/* protostats string */
	)
{
	char	statstr[NTP_MAXSTRLEN];
	int	i;
	size_t	len;

	/*
	 * Report the error to the protostats file, system log and
	 * trappers.
	 */
	if (peer == NULL) {

		/*
		 * Discard a system report if the number of reports of
		 * the same type exceeds the maximum.
		 */
		if (ctl_sys_last_event != (u_char)err)
			ctl_sys_num_events= 0;
		if (ctl_sys_num_events >= CTL_SYS_MAXEVENTS)
			return;

		ctl_sys_last_event = (u_char)err;
		ctl_sys_num_events++;
		snprintf(statstr, NTP_MAXSTRLEN,
		    "0.0.0.0 %04x %02x %s",
		    ctlsysstatus(), err, eventstr(err));
		if (str != NULL) {
			len = strlen(statstr);
			snprintf(statstr + len, sizeof(statstr) - len,
			    " %s", str);
		}
		NLOG(NLOG_SYSEVENT)
		    msyslog(LOG_INFO, statstr);
	} else {

		/*
		 * Discard a peer report if the number of reports of
		 * the same type exceeds the maximum for that peer.
		 */
		char	*src;
		u_char	errlast;

		errlast = (u_char)err & ~PEER_EVENT; 
		if (peer->last_event == errlast)
			peer->num_events = 0;
		if (peer->num_events >= CTL_PEER_MAXEVENTS)
			return;

		peer->last_event = errlast;
		peer->num_events++;
		if (ISREFCLOCKADR(&peer->srcadr))
			src = refnumtoa(&peer->srcadr);
		else
			src = stoa(&peer->srcadr);

		snprintf(statstr, NTP_MAXSTRLEN,
		    "%s %04x %02x %s", src,
		    ctlpeerstatus(peer), err, eventstr(err));
		if (str != NULL) {
			len = strlen(statstr);
			snprintf(statstr + len, sizeof(statstr) - len,
			    " %s", str);
		}
		NLOG(NLOG_PEEREVENT)
		    msyslog(LOG_INFO, statstr);
	}
	record_proto_stats(statstr);
#if DEBUG
	if (debug)
		printf("event at %lu %s\n", current_time, statstr);
#endif

	/*
	 * If no trappers, return.
	 */
	if (num_ctl_traps <= 0)
		return;

	/*
	 * Set up the outgoing packet variables
	 */
	res_opcode = CTL_OP_ASYNCMSG;
	res_offset = 0;
	res_async = 1;
	res_authenticate = 0;
	datapt = rpkt.data;
	dataend = &(rpkt.data[CTL_MAX_DATA_LEN]);
	if (!(err & PEER_EVENT)) {
		rpkt.associd = 0;
		rpkt.status = htons(ctlsysstatus());

		/*
		 * For now, put everything we know about system
		 * variables. Don't send crypto strings.
		 */
		for (i = 1; i <= CS_MAXCODE; i++) {
#ifdef OPENSSL
			if (i > CS_VARLIST)
				continue;
#endif /* OPENSSL */
			ctl_putsys(i);
		}
	} else {
		NTP_INSIST(peer != NULL);
		rpkt.associd = htons(peer->associd);
		rpkt.status = htons(ctlpeerstatus(peer));

		/*
		 * Dump it all. Later, maybe less.
		 */
		for (i = 1; i <= CP_MAXCODE; i++) {
#ifdef OPENSSL
			if (i > CP_VARLIST)
				continue;
#endif /* OPENSSL */
			ctl_putpeer(i, peer);
		}
#ifdef REFCLOCK
		/*
		 * for clock exception events: add clock variables to
		 * reflect info on exception
		 */
		if (err == PEVNT_CLOCK) {
			struct refclockstat clock_stat;
			struct ctl_var *kv;

			clock_stat.kv_list = (struct ctl_var *)0;
			refclock_control(&peer->srcadr,
					 (struct refclockstat *)0, &clock_stat);

			ctl_puthex("refclockstatus",
				   ctlclkstatus(&clock_stat));

			for (i = 1; i <= CC_MAXCODE; i++)
				ctl_putclock(i, &clock_stat, 0);
			for (kv = clock_stat.kv_list; kv &&
				 !(kv->flags & EOV); kv++)
				if (kv->flags & DEF)
					ctl_putdata(kv->text,
						    strlen(kv->text), 0);
			free_varlist(clock_stat.kv_list);
		}
#endif /* REFCLOCK */
	}

	/*
	 * We're done, return.
	 */
	ctl_flushpkt(0);
}


/*
 * ctl_clr_stats - clear stat counters
 */
void
ctl_clr_stats(void)
{
	ctltimereset = current_time;
	numctlreq = 0;
	numctlbadpkts = 0;
	numctlresponses = 0;
	numctlfrags = 0;
	numctlerrors = 0;
	numctlfrags = 0;
	numctltooshort = 0;
	numctlinputresp = 0;
	numctlinputfrag = 0;
	numctlinputerr = 0;
	numctlbadoffset = 0;
	numctlbadversion = 0;
	numctldatatooshort = 0;
	numctlbadop = 0;
	numasyncmsgs = 0;
}

static u_long
count_var(
	struct ctl_var *k
	)
{
	register u_long c;

	if (!k)
		return (0);

	c = 0;
	while (!(k++->flags & EOV))
		c++;
	return (c);
}

char *
add_var(
	struct ctl_var **kv,
	u_long size,
	u_short def
	)
{
	register u_long c;
	register struct ctl_var *k;

	c = count_var(*kv);

	k = *kv;
	*kv  = (struct ctl_var *)emalloc((c+2)*sizeof(struct ctl_var));
	if (k) {
		memmove((char *)*kv, (char *)k,
			sizeof(struct ctl_var)*c);
		free((char *)k);
	}
	(*kv)[c].code  = (u_short) c;
	(*kv)[c].text  = (char *)emalloc(size);
	(*kv)[c].flags = def;
	(*kv)[c+1].code  = 0;
	(*kv)[c+1].text  = (char *)0;
	(*kv)[c+1].flags = EOV;
	return (char *)(*kv)[c].text;
}

void
set_var(
	struct ctl_var **kv,
	const char *data,
	u_long size,
	u_short def
	)
{
	register struct ctl_var *k;
	register const char *s;
	register const char *t;
	char *td;

	if (!data || !size)
		return;

	k = *kv;
	if (k != NULL) {
		while (!(k->flags & EOV)) {
			s = data;
			t = k->text;
			if (t)	{
				while (*t != '=' && *s - *t == 0) {
					s++;
					t++;
				}
				if (*s == *t && ((*t == '=') || !*t)) {
					free((void *)k->text);
					td = (char *)emalloc(size);
					memmove(td, data, size);
					k->text =td;
					k->flags = def;
					return;
				}
			} else {
				td = (char *)emalloc(size);
				memmove(td, data, size);
				k->text = td;
				k->flags = def;
				return;
			}
			k++;
		}
	}
	td = add_var(kv, size, def);
	memmove(td, data, size);
}

void
set_sys_var(
	const char *data,
	u_long size,
	u_short def
	)
{
	set_var(&ext_sys_var, data, size, def);
}

void
free_varlist(
	struct ctl_var *kv
	)
{
	struct ctl_var *k;
	if (kv) {
		for (k = kv; !(k->flags & EOV); k++)
			free((void *)k->text);
		free((void *)kv);
	}
}
ntp-4.2.6p5/ntpd/ntp_parser.c0000644000175000017500000033444511675457724015136 0ustar  peterpeter/* A Bison parser, made by GNU Bison 2.4.3.  */

/* Skeleton implementation for Bison's Yacc-like parsers in C
   
      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
   2009, 2010 Free Software Foundation, Inc.
   
   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 .  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.
   
   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

/* C LALR(1) parser skeleton written by Richard Stallman, by
   simplifying the original so-called "semantic" parser.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Identify Bison output.  */
#define YYBISON 1

/* Bison version.  */
#define YYBISON_VERSION "2.4.3"

/* Skeleton name.  */
#define YYSKELETON_NAME "yacc.c"

/* Pure parsers.  */
#define YYPURE 0

/* Push parsers.  */
#define YYPUSH 0

/* Pull parsers.  */
#define YYPULL 1

/* Using locations.  */
#define YYLSP_NEEDED 0



/* Copy the first part of user declarations.  */

/* Line 189 of yacc.c  */
#line 11 "ntp_parser.y"

  #ifdef HAVE_CONFIG_H
  # include 
  #endif

  #include "ntp.h"
  #include "ntpd.h"
  #include "ntp_machine.h"
  #include "ntp_stdlib.h"
  #include "ntp_filegen.h"
  #include "ntp_data_structures.h"
  #include "ntp_scanner.h"
  #include "ntp_config.h"
  #include "ntp_crypto.h"

  #include "ntpsim.h"		/* HMS: Do we really want this all the time? */
				/* SK: It might be a good idea to always
				   include the simulator code. That way
				   someone can use the same configuration file
				   for both the simulator and the daemon
				*/


  struct FILE_INFO *ip_file;   /* Pointer to the configuration file stream */

  #define YYMALLOC	emalloc
  #define YYFREE	free
  #define YYERROR_VERBOSE
  #define YYMAXDEPTH	1000   /* stop the madness sooner */
  void yyerror(const char *msg);
  extern int input_from_file;  /* 0=input from ntpq :config */


/* Line 189 of yacc.c  */
#line 106 "ntp_parser.c"

/* Enabling traces.  */
#ifndef YYDEBUG
# define YYDEBUG 1
#endif

/* Enabling verbose error messages.  */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif

/* Enabling the token table.  */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 1
#endif


/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     T_Age = 258,
     T_All = 259,
     T_Allan = 260,
     T_Auth = 261,
     T_Autokey = 262,
     T_Automax = 263,
     T_Average = 264,
     T_Bclient = 265,
     T_Beacon = 266,
     T_Bias = 267,
     T_Broadcast = 268,
     T_Broadcastclient = 269,
     T_Broadcastdelay = 270,
     T_Burst = 271,
     T_Calibrate = 272,
     T_Calldelay = 273,
     T_Ceiling = 274,
     T_Clockstats = 275,
     T_Cohort = 276,
     T_ControlKey = 277,
     T_Crypto = 278,
     T_Cryptostats = 279,
     T_Day = 280,
     T_Default = 281,
     T_Digest = 282,
     T_Disable = 283,
     T_Discard = 284,
     T_Dispersion = 285,
     T_Double = 286,
     T_Driftfile = 287,
     T_Drop = 288,
     T_Ellipsis = 289,
     T_Enable = 290,
     T_End = 291,
     T_False = 292,
     T_File = 293,
     T_Filegen = 294,
     T_Flag1 = 295,
     T_Flag2 = 296,
     T_Flag3 = 297,
     T_Flag4 = 298,
     T_Flake = 299,
     T_Floor = 300,
     T_Freq = 301,
     T_Fudge = 302,
     T_Host = 303,
     T_Huffpuff = 304,
     T_Iburst = 305,
     T_Ident = 306,
     T_Ignore = 307,
     T_Includefile = 308,
     T_Integer = 309,
     T_Interface = 310,
     T_Ipv4 = 311,
     T_Ipv4_flag = 312,
     T_Ipv6 = 313,
     T_Ipv6_flag = 314,
     T_Kernel = 315,
     T_Key = 316,
     T_Keys = 317,
     T_Keysdir = 318,
     T_Kod = 319,
     T_Mssntp = 320,
     T_Leapfile = 321,
     T_Limited = 322,
     T_Link = 323,
     T_Listen = 324,
     T_Logconfig = 325,
     T_Logfile = 326,
     T_Loopstats = 327,
     T_Lowpriotrap = 328,
     T_Manycastclient = 329,
     T_Manycastserver = 330,
     T_Mask = 331,
     T_Maxclock = 332,
     T_Maxdist = 333,
     T_Maxpoll = 334,
     T_Minclock = 335,
     T_Mindist = 336,
     T_Minimum = 337,
     T_Minpoll = 338,
     T_Minsane = 339,
     T_Mode = 340,
     T_Monitor = 341,
     T_Month = 342,
     T_Multicastclient = 343,
     T_Nic = 344,
     T_Nolink = 345,
     T_Nomodify = 346,
     T_None = 347,
     T_Nopeer = 348,
     T_Noquery = 349,
     T_Noselect = 350,
     T_Noserve = 351,
     T_Notrap = 352,
     T_Notrust = 353,
     T_Ntp = 354,
     T_Ntpport = 355,
     T_NtpSignDsocket = 356,
     T_Orphan = 357,
     T_Panic = 358,
     T_Peer = 359,
     T_Peerstats = 360,
     T_Phone = 361,
     T_Pid = 362,
     T_Pidfile = 363,
     T_Pool = 364,
     T_Port = 365,
     T_Preempt = 366,
     T_Prefer = 367,
     T_Protostats = 368,
     T_Pw = 369,
     T_Qos = 370,
     T_Randfile = 371,
     T_Rawstats = 372,
     T_Refid = 373,
     T_Requestkey = 374,
     T_Restrict = 375,
     T_Revoke = 376,
     T_Saveconfigdir = 377,
     T_Server = 378,
     T_Setvar = 379,
     T_Sign = 380,
     T_Statistics = 381,
     T_Stats = 382,
     T_Statsdir = 383,
     T_Step = 384,
     T_Stepout = 385,
     T_Stratum = 386,
     T_String = 387,
     T_Sysstats = 388,
     T_Tick = 389,
     T_Time1 = 390,
     T_Time2 = 391,
     T_Timingstats = 392,
     T_Tinker = 393,
     T_Tos = 394,
     T_Trap = 395,
     T_True = 396,
     T_Trustedkey = 397,
     T_Ttl = 398,
     T_Type = 399,
     T_Unconfig = 400,
     T_Unpeer = 401,
     T_Version = 402,
     T_WanderThreshold = 403,
     T_Week = 404,
     T_Wildcard = 405,
     T_Xleave = 406,
     T_Year = 407,
     T_Flag = 408,
     T_Void = 409,
     T_EOC = 410,
     T_Simulate = 411,
     T_Beep_Delay = 412,
     T_Sim_Duration = 413,
     T_Server_Offset = 414,
     T_Duration = 415,
     T_Freq_Offset = 416,
     T_Wander = 417,
     T_Jitter = 418,
     T_Prop_Delay = 419,
     T_Proc_Delay = 420
   };
#endif
/* Tokens.  */
#define T_Age 258
#define T_All 259
#define T_Allan 260
#define T_Auth 261
#define T_Autokey 262
#define T_Automax 263
#define T_Average 264
#define T_Bclient 265
#define T_Beacon 266
#define T_Bias 267
#define T_Broadcast 268
#define T_Broadcastclient 269
#define T_Broadcastdelay 270
#define T_Burst 271
#define T_Calibrate 272
#define T_Calldelay 273
#define T_Ceiling 274
#define T_Clockstats 275
#define T_Cohort 276
#define T_ControlKey 277
#define T_Crypto 278
#define T_Cryptostats 279
#define T_Day 280
#define T_Default 281
#define T_Digest 282
#define T_Disable 283
#define T_Discard 284
#define T_Dispersion 285
#define T_Double 286
#define T_Driftfile 287
#define T_Drop 288
#define T_Ellipsis 289
#define T_Enable 290
#define T_End 291
#define T_False 292
#define T_File 293
#define T_Filegen 294
#define T_Flag1 295
#define T_Flag2 296
#define T_Flag3 297
#define T_Flag4 298
#define T_Flake 299
#define T_Floor 300
#define T_Freq 301
#define T_Fudge 302
#define T_Host 303
#define T_Huffpuff 304
#define T_Iburst 305
#define T_Ident 306
#define T_Ignore 307
#define T_Includefile 308
#define T_Integer 309
#define T_Interface 310
#define T_Ipv4 311
#define T_Ipv4_flag 312
#define T_Ipv6 313
#define T_Ipv6_flag 314
#define T_Kernel 315
#define T_Key 316
#define T_Keys 317
#define T_Keysdir 318
#define T_Kod 319
#define T_Mssntp 320
#define T_Leapfile 321
#define T_Limited 322
#define T_Link 323
#define T_Listen 324
#define T_Logconfig 325
#define T_Logfile 326
#define T_Loopstats 327
#define T_Lowpriotrap 328
#define T_Manycastclient 329
#define T_Manycastserver 330
#define T_Mask 331
#define T_Maxclock 332
#define T_Maxdist 333
#define T_Maxpoll 334
#define T_Minclock 335
#define T_Mindist 336
#define T_Minimum 337
#define T_Minpoll 338
#define T_Minsane 339
#define T_Mode 340
#define T_Monitor 341
#define T_Month 342
#define T_Multicastclient 343
#define T_Nic 344
#define T_Nolink 345
#define T_Nomodify 346
#define T_None 347
#define T_Nopeer 348
#define T_Noquery 349
#define T_Noselect 350
#define T_Noserve 351
#define T_Notrap 352
#define T_Notrust 353
#define T_Ntp 354
#define T_Ntpport 355
#define T_NtpSignDsocket 356
#define T_Orphan 357
#define T_Panic 358
#define T_Peer 359
#define T_Peerstats 360
#define T_Phone 361
#define T_Pid 362
#define T_Pidfile 363
#define T_Pool 364
#define T_Port 365
#define T_Preempt 366
#define T_Prefer 367
#define T_Protostats 368
#define T_Pw 369
#define T_Qos 370
#define T_Randfile 371
#define T_Rawstats 372
#define T_Refid 373
#define T_Requestkey 374
#define T_Restrict 375
#define T_Revoke 376
#define T_Saveconfigdir 377
#define T_Server 378
#define T_Setvar 379
#define T_Sign 380
#define T_Statistics 381
#define T_Stats 382
#define T_Statsdir 383
#define T_Step 384
#define T_Stepout 385
#define T_Stratum 386
#define T_String 387
#define T_Sysstats 388
#define T_Tick 389
#define T_Time1 390
#define T_Time2 391
#define T_Timingstats 392
#define T_Tinker 393
#define T_Tos 394
#define T_Trap 395
#define T_True 396
#define T_Trustedkey 397
#define T_Ttl 398
#define T_Type 399
#define T_Unconfig 400
#define T_Unpeer 401
#define T_Version 402
#define T_WanderThreshold 403
#define T_Week 404
#define T_Wildcard 405
#define T_Xleave 406
#define T_Year 407
#define T_Flag 408
#define T_Void 409
#define T_EOC 410
#define T_Simulate 411
#define T_Beep_Delay 412
#define T_Sim_Duration 413
#define T_Server_Offset 414
#define T_Duration 415
#define T_Freq_Offset 416
#define T_Wander 417
#define T_Jitter 418
#define T_Prop_Delay 419
#define T_Proc_Delay 420




#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{

/* Line 214 of yacc.c  */
#line 50 "ntp_parser.y"

    char   *String;
    double  Double;
    int     Integer;
    void   *VoidPtr;
    queue  *Queue;
    struct attr_val *Attr_val;
    struct address_node *Address_node;
    struct setvar_node *Set_var;

    /* Simulation types */
    server_info *Sim_server;
    script_info *Sim_script;



/* Line 214 of yacc.c  */
#line 489 "ntp_parser.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif


/* Copy the second part of user declarations.  */


/* Line 264 of yacc.c  */
#line 501 "ntp_parser.c"

#ifdef short
# undef short
#endif

#ifdef YYTYPE_UINT8
typedef YYTYPE_UINT8 yytype_uint8;
#else
typedef unsigned char yytype_uint8;
#endif

#ifdef YYTYPE_INT8
typedef YYTYPE_INT8 yytype_int8;
#elif (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
typedef signed char yytype_int8;
#else
typedef short int yytype_int8;
#endif

#ifdef YYTYPE_UINT16
typedef YYTYPE_UINT16 yytype_uint16;
#else
typedef unsigned short int yytype_uint16;
#endif

#ifdef YYTYPE_INT16
typedef YYTYPE_INT16 yytype_int16;
#else
typedef short int yytype_int16;
#endif

#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
#  define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
#  define YYSIZE_T size_t
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
#  include  /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
# else
#  define YYSIZE_T unsigned int
# endif
#endif

#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)

#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
#  if ENABLE_NLS
#   include  /* INFRINGES ON USER NAME SPACE */
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
#  endif
# endif
# ifndef YY_
#  define YY_(msgid) msgid
# endif
#endif

/* Suppress unused-variable warnings by "using" E.  */
#if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e) /* empty */
#endif

/* Identity function, used to suppress warnings about constant conditions.  */
#ifndef lint
# define YYID(n) (n)
#else
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static int
YYID (int yyi)
#else
static int
YYID (yyi)
    int yyi;
#endif
{
  return yyi;
}
#endif

#if ! defined yyoverflow || YYERROR_VERBOSE

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# ifdef YYSTACK_USE_ALLOCA
#  if YYSTACK_USE_ALLOCA
#   ifdef __GNUC__
#    define YYSTACK_ALLOC __builtin_alloca
#   elif defined __BUILTIN_VA_ARG_INCR
#    include  /* INFRINGES ON USER NAME SPACE */
#   elif defined _AIX
#    define YYSTACK_ALLOC __alloca
#   elif defined _MSC_VER
#    include  /* INFRINGES ON USER NAME SPACE */
#    define alloca _alloca
#   else
#    define YYSTACK_ALLOC alloca
#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
#     include  /* INFRINGES ON USER NAME SPACE */
#     ifndef _STDLIB_H
#      define _STDLIB_H 1
#     endif
#    endif
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's `empty if-body' warning.  */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
#  ifndef YYSTACK_ALLOC_MAXIMUM
    /* The OS might guarantee only one guard page at the bottom of the stack,
       and a page size can be as small as 4096 bytes.  So we cannot safely
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
       to allow for a few compiler-allocated temporary stack slots.  */
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
#  endif
# else
#  define YYSTACK_ALLOC YYMALLOC
#  define YYSTACK_FREE YYFREE
#  ifndef YYSTACK_ALLOC_MAXIMUM
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
#  endif
#  if (defined __cplusplus && ! defined _STDLIB_H \
       && ! ((defined YYMALLOC || defined malloc) \
	     && (defined YYFREE || defined free)))
#   include  /* INFRINGES ON USER NAME SPACE */
#   ifndef _STDLIB_H
#    define _STDLIB_H 1
#   endif
#  endif
#  ifndef YYMALLOC
#   define YYMALLOC malloc
#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
#  ifndef YYFREE
#   define YYFREE free
#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
# endif
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */


#if (! defined yyoverflow \
     && (! defined __cplusplus \
	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  yytype_int16 yyss_alloc;
  YYSTYPE yyvs_alloc;
};

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
      + YYSTACK_GAP_MAXIMUM)

/* Copy COUNT objects from FROM to TO.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if defined __GNUC__ && 1 < __GNUC__
#   define YYCOPY(To, From, Count) \
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
#  else
#   define YYCOPY(To, From, Count)		\
      do					\
	{					\
	  YYSIZE_T yyi;				\
	  for (yyi = 0; yyi < (Count); yyi++)	\
	    (To)[yyi] = (From)[yyi];		\
	}					\
      while (YYID (0))
#  endif
# endif

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
    do									\
      {									\
	YYSIZE_T yynewbytes;						\
	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
	Stack = &yyptr->Stack_alloc;					\
	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
	yyptr += yynewbytes / sizeof (*yyptr);				\
      }									\
    while (YYID (0))

#endif

/* YYFINAL -- State number of the termination state.  */
#define YYFINAL  168
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   630

/* YYNTOKENS -- Number of terminals.  */
#define YYNTOKENS  171
/* YYNNTS -- Number of nonterminals.  */
#define YYNNTS  89
/* YYNRULES -- Number of rules.  */
#define YYNRULES  267
/* YYNRULES -- Number of states.  */
#define YYNSTATES  375

/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
#define YYUNDEFTOK  2
#define YYMAXUTOK   420

#define YYTRANSLATE(YYX)						\
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
static const yytype_uint8 yytranslate[] =
{
       0,     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,
     167,   168,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,   166,     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,   169,     2,   170,     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,     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,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
      85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
     115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
     135,   136,   137,   138,   139,   140,   141,   142,   143,   144,
     145,   146,   147,   148,   149,   150,   151,   152,   153,   154,
     155,   156,   157,   158,   159,   160,   161,   162,   163,   164,
     165
};

#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
   YYRHS.  */
static const yytype_uint16 yyprhs[] =
{
       0,     0,     3,     5,     9,    12,    15,    16,    18,    20,
      22,    24,    26,    28,    30,    32,    34,    36,    38,    40,
      44,    47,    49,    51,    53,    55,    57,    59,    62,    64,
      66,    68,    71,    73,    75,    77,    80,    82,    84,    86,
      88,    90,    92,    94,    96,    98,   101,   103,   105,   107,
     109,   111,   113,   116,   118,   120,   122,   125,   128,   131,
     134,   137,   140,   143,   146,   149,   152,   155,   156,   159,
     162,   165,   167,   169,   171,   173,   175,   177,   180,   183,
     185,   188,   191,   194,   196,   198,   200,   202,   204,   206,
     208,   210,   212,   215,   218,   222,   225,   227,   229,   231,
     233,   235,   237,   239,   241,   243,   244,   247,   250,   253,
     255,   257,   259,   261,   263,   265,   267,   269,   271,   273,
     275,   277,   279,   282,   286,   290,   295,   300,   306,   307,
     310,   312,   314,   316,   318,   320,   322,   324,   326,   328,
     330,   332,   334,   336,   338,   341,   343,   346,   348,   350,
     352,   356,   359,   361,   364,   367,   370,   373,   375,   377,
     379,   381,   383,   385,   388,   391,   394,   396,   398,   400,
     402,   404,   406,   408,   410,   412,   415,   418,   420,   423,
     425,   427,   429,   431,   433,   435,   437,   439,   442,   445,
     448,   452,   454,   457,   460,   463,   466,   469,   472,   476,
     479,   481,   483,   485,   487,   489,   491,   493,   495,   498,
     499,   504,   506,   507,   510,   512,   515,   518,   521,   523,
     525,   529,   533,   535,   537,   539,   541,   543,   545,   547,
     549,   551,   554,   556,   559,   561,   563,   565,   571,   574,
     576,   579,   581,   583,   585,   587,   589,   591,   597,   599,
     603,   606,   610,   614,   617,   619,   625,   630,   634,   637,
     639,   646,   650,   653,   657,   661,   665,   669
};

/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
static const yytype_int16 yyrhs[] =
{
     172,     0,    -1,   173,    -1,   173,   174,   155,    -1,   174,
     155,    -1,     1,   155,    -1,    -1,   175,    -1,   186,    -1,
     188,    -1,   189,    -1,   198,    -1,   206,    -1,   193,    -1,
     212,    -1,   217,    -1,   221,    -1,   225,    -1,   248,    -1,
     176,   177,   180,    -1,   176,   177,    -1,   123,    -1,   109,
      -1,   104,    -1,    13,    -1,    74,    -1,   178,    -1,   179,
     132,    -1,   132,    -1,    57,    -1,    59,    -1,   180,   181,
      -1,   181,    -1,   182,    -1,   184,    -1,    12,   247,    -1,
     183,    -1,     7,    -1,    16,    -1,    50,    -1,    95,    -1,
     111,    -1,   112,    -1,   141,    -1,   151,    -1,   185,    54,
      -1,    61,    -1,    83,    -1,    79,    -1,   143,    -1,    85,
      -1,   147,    -1,   187,   177,    -1,   145,    -1,   146,    -1,
      14,    -1,    75,   245,    -1,    88,   245,    -1,     8,    54,
      -1,    22,    54,    -1,    23,   190,    -1,    62,   132,    -1,
      63,   132,    -1,   119,    54,    -1,   121,    54,    -1,   142,
     241,    -1,   101,   132,    -1,    -1,   190,   191,    -1,   192,
     132,    -1,   121,    54,    -1,    48,    -1,    51,    -1,   114,
      -1,   116,    -1,   125,    -1,    27,    -1,   139,   194,    -1,
     194,   195,    -1,   195,    -1,   196,    54,    -1,   197,   247,
      -1,    21,   246,    -1,    19,    -1,    45,    -1,   102,    -1,
      84,    -1,    11,    -1,    81,    -1,    78,    -1,    80,    -1,
      77,    -1,   126,   199,    -1,   128,   132,    -1,    39,   200,
     201,    -1,   199,   200,    -1,   200,    -1,    20,    -1,    24,
      -1,    72,    -1,   105,    -1,   117,    -1,   133,    -1,   137,
      -1,   113,    -1,    -1,   201,   202,    -1,    38,   132,    -1,
     144,   205,    -1,   203,    -1,   204,    -1,    68,    -1,    90,
      -1,    35,    -1,    28,    -1,    92,    -1,   107,    -1,    25,
      -1,   149,    -1,    87,    -1,   152,    -1,     3,    -1,    29,
     209,    -1,   120,   177,   207,    -1,   120,    26,   207,    -1,
     120,    57,    26,   207,    -1,   120,    59,    26,   207,    -1,
     120,   178,    76,   178,   207,    -1,    -1,   207,   208,    -1,
      44,    -1,    52,    -1,    64,    -1,    65,    -1,    67,    -1,
      73,    -1,    91,    -1,    93,    -1,    94,    -1,    96,    -1,
      97,    -1,    98,    -1,   100,    -1,   147,    -1,   209,   210,
      -1,   210,    -1,   211,    54,    -1,     9,    -1,    82,    -1,
      86,    -1,    47,   177,   213,    -1,   213,   214,    -1,   214,
      -1,   215,   247,    -1,   216,   246,    -1,   131,    54,    -1,
     118,   132,    -1,   135,    -1,   136,    -1,    40,    -1,    41,
      -1,    42,    -1,    43,    -1,    35,   218,    -1,    28,   218,
      -1,   218,   219,    -1,   219,    -1,   220,    -1,   127,    -1,
       6,    -1,    10,    -1,    17,    -1,    60,    -1,    86,    -1,
      99,    -1,   138,   222,    -1,   222,   223,    -1,   223,    -1,
     224,   247,    -1,     5,    -1,    30,    -1,    46,    -1,    49,
      -1,   103,    -1,   129,    -1,   130,    -1,   236,    -1,   226,
     247,    -1,   227,   132,    -1,   228,   132,    -1,    53,   132,
     174,    -1,    36,    -1,    18,    54,    -1,    32,   229,    -1,
      70,   234,    -1,   106,   244,    -1,   124,   230,    -1,   140,
     178,    -1,   140,   178,   232,    -1,   143,   240,    -1,    15,
      -1,   134,    -1,    66,    -1,   108,    -1,   115,    -1,    71,
      -1,   122,    -1,   132,    -1,   132,    31,    -1,    -1,   132,
     166,   132,   231,    -1,    26,    -1,    -1,   232,   233,    -1,
     233,    -1,   110,    54,    -1,    55,   178,    -1,   234,   235,
      -1,   235,    -1,   132,    -1,   237,   239,   238,    -1,   237,
     239,   132,    -1,    55,    -1,    89,    -1,     4,    -1,    56,
      -1,    58,    -1,   150,    -1,    69,    -1,    52,    -1,    33,
      -1,   240,    54,    -1,    54,    -1,   241,   242,    -1,   242,
      -1,    54,    -1,   243,    -1,   167,    54,    34,    54,   168,
      -1,   244,   132,    -1,   132,    -1,   245,   177,    -1,   177,
      -1,    54,    -1,   141,    -1,    37,    -1,    54,    -1,    31,
      -1,   249,   169,   250,   252,   170,    -1,   156,    -1,   250,
     251,   155,    -1,   251,   155,    -1,   157,   166,   247,    -1,
     158,   166,   247,    -1,   252,   253,    -1,   253,    -1,   255,
     169,   254,   256,   170,    -1,   159,   166,   247,   155,    -1,
     123,   166,   177,    -1,   256,   257,    -1,   257,    -1,   160,
     166,   247,   169,   258,   170,    -1,   258,   259,   155,    -1,
     259,   155,    -1,   161,   166,   247,    -1,   162,   166,   247,
      -1,   163,   166,   247,    -1,   164,   166,   247,    -1,   165,
     166,   247,    -1
};

/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
static const yytype_uint16 yyrline[] =
{
       0,   318,   318,   322,   323,   324,   338,   339,   340,   341,
     342,   343,   344,   345,   346,   347,   348,   349,   350,   358,
     364,   373,   374,   375,   376,   377,   381,   382,   387,   392,
     394,   399,   400,   404,   405,   406,   411,   416,   417,   418,
     419,   420,   421,   422,   423,   427,   432,   433,   434,   435,
     436,   437,   447,   455,   456,   466,   468,   470,   481,   483,
     485,   490,   492,   494,   496,   498,   500,   506,   507,   517,
     519,   531,   532,   533,   534,   535,   536,   545,   550,   551,
     555,   557,   559,   564,   565,   566,   567,   568,   572,   573,
     574,   575,   584,   586,   595,   603,   604,   608,   609,   610,
     611,   612,   613,   614,   615,   620,   621,   631,   641,   650,
     665,   670,   671,   675,   676,   680,   681,   682,   683,   684,
     685,   686,   695,   699,   704,   709,   722,   735,   744,   745,
     750,   751,   752,   753,   754,   755,   756,   757,   758,   759,
     760,   761,   762,   763,   767,   769,   774,   779,   780,   781,
     790,   795,   797,   802,   804,   806,   808,   813,   814,   818,
     819,   820,   821,   830,   832,   837,   844,   854,   856,   868,
     869,   870,   871,   872,   873,   882,   886,   887,   891,   896,
     897,   898,   899,   900,   901,   902,   911,   912,   919,   926,
     942,   961,   966,   968,   970,   972,   974,   976,   978,   980,
     985,   986,   990,   991,   992,   996,   997,  1001,  1003,  1007,
    1011,  1016,  1018,  1022,  1024,  1028,  1029,  1033,  1034,  1038,
    1053,  1058,  1066,  1067,  1071,  1072,  1073,  1074,  1078,  1079,
    1080,  1090,  1091,  1095,  1097,  1102,  1104,  1108,  1113,  1114,
    1118,  1119,  1123,  1132,  1133,  1137,  1138,  1147,  1162,  1166,
    1167,  1171,  1172,  1176,  1177,  1181,  1186,  1190,  1194,  1195,
    1199,  1204,  1205,  1209,  1211,  1213,  1215,  1217
};
#endif

#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
static const char *const yytname[] =
{
  "$end", "error", "$undefined", "T_Age", "T_All", "T_Allan", "T_Auth",
  "T_Autokey", "T_Automax", "T_Average", "T_Bclient", "T_Beacon", "T_Bias",
  "T_Broadcast", "T_Broadcastclient", "T_Broadcastdelay", "T_Burst",
  "T_Calibrate", "T_Calldelay", "T_Ceiling", "T_Clockstats", "T_Cohort",
  "T_ControlKey", "T_Crypto", "T_Cryptostats", "T_Day", "T_Default",
  "T_Digest", "T_Disable", "T_Discard", "T_Dispersion", "T_Double",
  "T_Driftfile", "T_Drop", "T_Ellipsis", "T_Enable", "T_End", "T_False",
  "T_File", "T_Filegen", "T_Flag1", "T_Flag2", "T_Flag3", "T_Flag4",
  "T_Flake", "T_Floor", "T_Freq", "T_Fudge", "T_Host", "T_Huffpuff",
  "T_Iburst", "T_Ident", "T_Ignore", "T_Includefile", "T_Integer",
  "T_Interface", "T_Ipv4", "T_Ipv4_flag", "T_Ipv6", "T_Ipv6_flag",
  "T_Kernel", "T_Key", "T_Keys", "T_Keysdir", "T_Kod", "T_Mssntp",
  "T_Leapfile", "T_Limited", "T_Link", "T_Listen", "T_Logconfig",
  "T_Logfile", "T_Loopstats", "T_Lowpriotrap", "T_Manycastclient",
  "T_Manycastserver", "T_Mask", "T_Maxclock", "T_Maxdist", "T_Maxpoll",
  "T_Minclock", "T_Mindist", "T_Minimum", "T_Minpoll", "T_Minsane",
  "T_Mode", "T_Monitor", "T_Month", "T_Multicastclient", "T_Nic",
  "T_Nolink", "T_Nomodify", "T_None", "T_Nopeer", "T_Noquery",
  "T_Noselect", "T_Noserve", "T_Notrap", "T_Notrust", "T_Ntp", "T_Ntpport",
  "T_NtpSignDsocket", "T_Orphan", "T_Panic", "T_Peer", "T_Peerstats",
  "T_Phone", "T_Pid", "T_Pidfile", "T_Pool", "T_Port", "T_Preempt",
  "T_Prefer", "T_Protostats", "T_Pw", "T_Qos", "T_Randfile", "T_Rawstats",
  "T_Refid", "T_Requestkey", "T_Restrict", "T_Revoke", "T_Saveconfigdir",
  "T_Server", "T_Setvar", "T_Sign", "T_Statistics", "T_Stats",
  "T_Statsdir", "T_Step", "T_Stepout", "T_Stratum", "T_String",
  "T_Sysstats", "T_Tick", "T_Time1", "T_Time2", "T_Timingstats",
  "T_Tinker", "T_Tos", "T_Trap", "T_True", "T_Trustedkey", "T_Ttl",
  "T_Type", "T_Unconfig", "T_Unpeer", "T_Version", "T_WanderThreshold",
  "T_Week", "T_Wildcard", "T_Xleave", "T_Year", "T_Flag", "T_Void",
  "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", "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", "fudge_command", "fudge_factor_list",
  "fudge_factor", "fudge_factor_dbl_keyword", "fudge_factor_bool_keyword",
  "system_option_command", "system_option_list", "system_option",
  "system_option_flag_keyword", "tinker_command", "tinker_option_list",
  "tinker_option", "tinker_option_keyword", "miscellaneous_command",
  "misc_cmd_dbl_keyword", "misc_cmd_str_keyword",
  "misc_cmd_str_lcl_keyword", "drift_parm", "variable_assign",
  "t_default_or_zero", "trap_option_list", "trap_option",
  "log_config_list", "log_config_command", "interface_command",
  "interface_nic", "nic_rule_class", "nic_rule_action", "integer_list",
  "integer_list_range", "integer_list_range_elt", "integer_range",
  "string_list", "address_list", "boolean", "number", "simulate_command",
  "sim_conf_start", "sim_init_statement_list", "sim_init_statement",
  "sim_server_list", "sim_server", "sim_server_offset", "sim_server_name",
  "sim_act_list", "sim_act", "sim_act_stmt_list", "sim_act_stmt", 0
};
#endif

# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
   token YYLEX-NUM.  */
static const yytype_uint16 yytoknum[] =
{
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
     355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
     365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
     375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
     385,   386,   387,   388,   389,   390,   391,   392,   393,   394,
     395,   396,   397,   398,   399,   400,   401,   402,   403,   404,
     405,   406,   407,   408,   409,   410,   411,   412,   413,   414,
     415,   416,   417,   418,   419,   420,    61,    40,    41,   123,
     125
};
# endif

/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
static const yytype_uint16 yyr1[] =
{
       0,   171,   172,   173,   173,   173,   174,   174,   174,   174,
     174,   174,   174,   174,   174,   174,   174,   174,   174,   175,
     175,   176,   176,   176,   176,   176,   177,   177,   178,   179,
     179,   180,   180,   181,   181,   181,   182,   183,   183,   183,
     183,   183,   183,   183,   183,   184,   185,   185,   185,   185,
     185,   185,   186,   187,   187,   188,   188,   188,   189,   189,
     189,   189,   189,   189,   189,   189,   189,   190,   190,   191,
     191,   192,   192,   192,   192,   192,   192,   193,   194,   194,
     195,   195,   195,   196,   196,   196,   196,   196,   197,   197,
     197,   197,   198,   198,   198,   199,   199,   200,   200,   200,
     200,   200,   200,   200,   200,   201,   201,   202,   202,   202,
     202,   203,   203,   204,   204,   205,   205,   205,   205,   205,
     205,   205,   206,   206,   206,   206,   206,   206,   207,   207,
     208,   208,   208,   208,   208,   208,   208,   208,   208,   208,
     208,   208,   208,   208,   209,   209,   210,   211,   211,   211,
     212,   213,   213,   214,   214,   214,   214,   215,   215,   216,
     216,   216,   216,   217,   217,   218,   218,   219,   219,   220,
     220,   220,   220,   220,   220,   221,   222,   222,   223,   224,
     224,   224,   224,   224,   224,   224,   225,   225,   225,   225,
     225,   225,   225,   225,   225,   225,   225,   225,   225,   225,
     226,   226,   227,   227,   227,   228,   228,   229,   229,   229,
     230,   231,   231,   232,   232,   233,   233,   234,   234,   235,
     236,   236,   237,   237,   238,   238,   238,   238,   239,   239,
     239,   240,   240,   241,   241,   242,   242,   243,   244,   244,
     245,   245,   246,   246,   246,   247,   247,   248,   249,   250,
     250,   251,   251,   252,   252,   253,   254,   255,   256,   256,
     257,   258,   258,   259,   259,   259,   259,   259
};

/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
static const yytype_uint8 yyr2[] =
{
       0,     2,     1,     3,     2,     2,     0,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     3,
       2,     1,     1,     1,     1,     1,     1,     2,     1,     1,
       1,     2,     1,     1,     1,     2,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     2,     1,     1,     1,     1,
       1,     1,     2,     1,     1,     1,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     0,     2,     2,
       2,     1,     1,     1,     1,     1,     1,     2,     2,     1,
       2,     2,     2,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     2,     2,     3,     2,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     0,     2,     2,     2,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     2,     3,     3,     4,     4,     5,     0,     2,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     2,     1,     2,     1,     1,     1,
       3,     2,     1,     2,     2,     2,     2,     1,     1,     1,
       1,     1,     1,     2,     2,     2,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     2,     2,     1,     2,     1,
       1,     1,     1,     1,     1,     1,     1,     2,     2,     2,
       3,     1,     2,     2,     2,     2,     2,     2,     3,     2,
       1,     1,     1,     1,     1,     1,     1,     1,     2,     0,
       4,     1,     0,     2,     1,     2,     2,     2,     1,     1,
       3,     3,     1,     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,     3,     2,     1,     5,     4,     3,     2,     1,
       6,     3,     2,     3,     3,     3,     3,     3
};

/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
   means the default is an error.  */
static const yytype_uint16 yydefact[] =
{
       0,     0,     0,    24,    55,   200,     0,     0,    67,     0,
       0,   209,     0,   191,     0,     0,     0,   222,     0,     0,
     202,     0,   205,    25,     0,     0,   223,     0,    23,     0,
     203,    22,   204,     0,     0,     0,   206,    21,     0,     0,
       0,   201,     0,     0,     0,     0,     0,    53,    54,   248,
       0,     2,     0,     7,     0,     8,     0,     9,    10,    13,
      11,    12,    14,    15,    16,    17,     0,     0,     0,   186,
       0,    18,     0,     5,    58,   192,    59,    60,   169,   170,
     171,   172,   173,   174,   168,   164,   166,   167,   147,   148,
     149,   122,   145,     0,   207,   193,   163,    97,    98,    99,
     100,   104,   101,   102,   103,   105,    29,    30,    28,     0,
      26,     0,     6,    61,    62,   219,   194,   218,   241,    56,
      57,    66,   239,   195,    63,   128,    29,    30,   128,    26,
      64,     0,   196,    92,    96,    93,   179,   180,   181,   182,
     183,   184,   185,   175,   177,     0,    87,    83,     0,    84,
      91,    89,    90,    88,    86,    85,    77,    79,     0,     0,
     197,   235,     0,    65,   234,   236,   232,   199,     1,     0,
       4,    20,    52,   246,   245,   187,   188,   189,   230,   229,
     228,     0,     0,    76,    71,    72,    73,    74,     0,    75,
      68,     0,   165,   144,   146,   208,    94,   159,   160,   161,
     162,     0,     0,   157,   158,   150,   152,     0,     0,    27,
     190,   217,   240,   238,   124,   128,   128,   123,     0,     0,
      95,   176,   178,   244,   242,   243,    82,    78,    80,    81,
       0,     0,   198,   214,     0,   233,   231,     3,    37,     0,
      38,    39,    46,    48,    47,    50,    40,    41,    42,    43,
      49,    51,    44,    19,    32,    33,    36,    34,     0,   224,
     225,   226,   221,   227,   220,     0,     0,     0,     0,    70,
      69,   114,   113,     0,   111,   112,     0,   106,   109,   110,
     156,   155,   151,   153,   154,   130,   131,   132,   133,   134,
     135,   136,   137,   138,   139,   140,   141,   142,   143,   129,
     125,   126,   128,   212,   216,   215,   213,     0,    35,    31,
      45,     0,     0,     0,     0,     0,   254,     0,   250,   107,
     121,   117,   119,   115,   116,   118,   120,   108,   127,   211,
     210,     0,   251,   252,     0,   249,   247,   253,     0,   237,
     257,     0,     0,     0,     0,     0,   259,     0,     0,   255,
     258,   256,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   260,     0,   262,   263,
     264,   265,   266,   267,   261
};

/* YYDEFGOTO[NTERM-NUM].  */
static const yytype_int16 yydefgoto[] =
{
      -1,    50,    51,    52,    53,    54,   118,   110,   111,   253,
     254,   255,   256,   257,   258,    55,    56,    57,    58,    77,
     190,   191,    59,   156,   157,   158,   159,    60,   133,   105,
     196,   277,   278,   279,   327,    61,   214,   299,    91,    92,
      93,    62,   205,   206,   207,   208,    63,    85,    86,    87,
      64,   143,   144,   145,    65,    66,    67,    68,    95,   132,
     330,   232,   233,   116,   117,    69,    70,   264,   181,   167,
     163,   164,   165,   123,   119,   226,   175,    71,    72,   267,
     268,   315,   316,   342,   317,   345,   346,   359,   360
};

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
#define YYPACT_NINF -145
static const yytype_int16 yypact[] =
{
     126,  -121,   -19,  -145,  -145,  -145,    -2,    -1,  -145,     8,
      20,   -95,     8,  -145,    47,   -46,   -78,  -145,   -76,   -73,
    -145,   -72,  -145,  -145,   -46,   -46,  -145,   -71,  -145,   -67,
    -145,  -145,  -145,    12,   -17,    19,  -145,  -145,   -58,    47,
     -56,  -145,     0,   295,   -55,   -47,    24,  -145,  -145,  -145,
      80,   262,   -70,  -145,   -46,  -145,   -46,  -145,  -145,  -145,
    -145,  -145,  -145,  -145,  -145,  -145,   -10,   -50,   -49,  -145,
       3,  -145,   -85,  -145,  -145,  -145,  -145,   142,  -145,  -145,
    -145,  -145,  -145,  -145,  -145,     8,  -145,  -145,  -145,  -145,
    -145,    20,  -145,    33,    58,  -145,     8,  -145,  -145,  -145,
    -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,   168,
    -145,   -36,   398,  -145,  -145,  -145,   -72,  -145,  -145,   -46,
     -46,  -145,  -145,   -34,  -145,  -145,    71,    73,  -145,    25,
    -145,   -57,  -145,    47,  -145,  -145,  -145,  -145,  -145,  -145,
    -145,  -145,  -145,     0,  -145,   -10,  -145,  -145,    -9,  -145,
    -145,  -145,  -145,  -145,  -145,  -145,   295,  -145,    57,   -10,
     -35,  -145,    59,   -47,  -145,  -145,  -145,    63,  -145,   -37,
    -145,    31,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,
    -145,     6,  -126,  -145,  -145,  -145,  -145,  -145,    74,  -145,
    -145,   -20,  -145,  -145,  -145,  -145,   -11,  -145,  -145,  -145,
    -145,     4,    77,  -145,  -145,   168,  -145,   -10,    -9,  -145,
    -145,  -145,  -145,  -145,   483,  -145,  -145,   483,   -55,     5,
    -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,
     -55,    91,   -35,  -145,   112,  -145,  -145,  -145,  -145,   -10,
    -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,
    -145,  -145,  -145,    31,  -145,  -145,  -145,  -145,    93,  -145,
    -145,  -145,  -145,  -145,  -145,    -7,    -3,  -107,    -4,  -145,
    -145,  -145,  -145,    34,  -145,  -145,     1,  -145,  -145,  -145,
    -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,
    -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,
     483,   483,  -145,   131,  -145,  -145,  -145,   116,  -145,  -145,
    -145,   -10,   -10,     9,    16,  -100,  -145,     7,  -145,  -145,
    -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,   483,  -145,
    -145,    15,  -145,  -145,   -46,  -145,  -145,  -145,    26,  -145,
    -145,    21,    35,   -10,    28,  -112,  -145,    36,   -10,  -145,
    -145,  -145,    37,   -40,    39,    41,    46,    50,    62,    61,
      48,   -10,   -10,   -10,   -10,   -10,  -145,    78,  -145,  -145,
    -145,  -145,  -145,  -145,  -145
};

/* YYPGOTO[NTERM-NUM].  */
static const yytype_int16 yypgoto[] =
{
    -145,  -145,  -145,   -43,  -145,  -145,   -15,   -32,  -145,  -145,
     -51,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,  -145,
    -145,  -145,  -145,  -145,    81,  -145,  -145,  -145,  -145,   -33,
    -145,  -145,  -145,  -145,  -145,  -145,  -125,  -145,  -145,   122,
    -145,  -145,  -145,    38,  -145,  -145,  -145,   217,   -63,  -145,
    -145,  -145,    95,  -145,  -145,  -145,  -145,  -145,  -145,  -145,
    -145,  -145,    10,  -145,   120,  -145,  -145,  -145,  -145,  -145,
    -145,    76,  -145,  -145,   215,    43,  -144,  -145,  -145,  -145,
     -23,  -145,   -62,  -145,  -145,  -145,   -90,  -145,  -102
};

/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
   positive, shift that token.  If negative, reduce the rule which
   number is the opposite.  If zero, do what YYDEFACT says.
   If YYTABLE_NINF, syntax error.  */
#define YYTABLE_NINF -7
static const yytype_int16 yytable[] =
{
     109,   222,   129,   217,   320,   136,   134,   161,   169,   125,
     259,   106,   160,   107,    78,   229,   313,   271,    79,   128,
     230,   173,   192,   313,   272,    80,   321,   273,   223,    88,
     137,   265,   266,   192,    73,    74,   178,    94,   238,   171,
     126,   172,   127,   239,   174,   224,   138,   240,   344,   139,
     265,   266,    75,    76,   112,   179,   113,   274,   349,   114,
     115,   121,   260,   283,   261,   122,   124,    97,    81,   210,
     336,    98,   180,   130,   131,   231,   135,   108,   166,   275,
     168,   241,   176,   177,   182,   170,   108,   194,   322,   195,
     300,   301,   242,   323,    82,   308,   209,   215,   213,   216,
     220,   218,    89,   140,   212,   212,    90,    83,   324,   219,
     243,   228,   270,   234,   244,   108,   245,   236,   237,    99,
     162,   354,   355,   356,   357,   358,   246,     1,   269,   141,
     142,   281,   225,   276,     2,    84,   280,   303,   262,     3,
       4,     5,   247,   248,     6,   305,   307,   310,     7,     8,
     325,   318,   100,   326,     9,    10,   263,   329,    11,   311,
     101,    12,    13,   312,   102,    14,   319,   332,   333,   183,
     331,   335,   249,    15,   250,   334,   338,   328,   251,    16,
     103,    17,   252,   339,   104,   341,   302,   343,    18,    19,
     184,   351,    20,   185,   348,   344,    21,    22,   304,   347,
      23,    24,   309,   368,   352,   361,   353,   362,   197,   198,
     199,   200,   363,   193,    25,    26,   364,   369,   370,   371,
     372,   373,   354,   355,   356,   357,   358,    27,   365,    96,
      28,   366,    29,   374,    30,    31,   211,   227,   221,   235,
     120,    32,   306,   282,   314,    33,    34,    35,    36,    37,
      38,   284,    39,   337,    40,   350,   186,   367,   187,     0,
      41,     0,     0,   188,    42,    43,    44,   189,    45,    46,
       2,    47,    48,     0,     0,     3,     4,     5,     0,     0,
       6,    -6,    49,     0,     7,     8,   201,     0,     0,     0,
       9,    10,     0,     0,    11,     0,     0,    12,    13,   202,
       0,    14,     0,   203,   204,     0,   146,     0,     0,    15,
       0,     0,     0,     0,   147,    16,   148,    17,     0,   340,
       0,     0,     0,     0,    18,    19,     0,     0,    20,     0,
       0,     0,    21,    22,     0,     0,    23,    24,     0,     0,
     149,     0,     0,     0,     0,     0,     0,     0,     0,     0,
      25,    26,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,    27,     0,     0,    28,     0,    29,     0,
      30,    31,   150,   151,     0,   152,   153,    32,     0,   154,
       0,    33,    34,    35,    36,    37,    38,     0,    39,     0,
      40,     0,     0,     0,     0,     0,    41,   155,     0,     0,
      42,    43,    44,     0,    45,    46,     2,    47,    48,     0,
       0,     3,     4,     5,     0,     0,     6,    -6,    49,     0,
       7,     8,     0,     0,     0,     0,     9,    10,     0,     0,
      11,     0,     0,    12,    13,     0,     0,    14,     0,     0,
       0,     0,     0,     0,     0,    15,     0,     0,     0,     0,
       0,    16,     0,    17,     0,     0,     0,     0,     0,     0,
      18,    19,     0,     0,    20,     0,     0,     0,    21,    22,
       0,     0,    23,    24,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,    25,    26,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,    27,
       0,     0,    28,     0,    29,     0,    30,    31,     0,     0,
       0,     0,     0,    32,     0,     0,     0,    33,    34,    35,
      36,    37,    38,     0,    39,     0,    40,   285,     0,     0,
       0,     0,    41,     0,     0,   286,    42,    43,    44,     0,
      45,    46,     0,    47,    48,     0,     0,   287,   288,     0,
     289,     0,     0,     0,    49,     0,   290,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,   291,     0,   292,   293,     0,   294,
     295,   296,     0,   297,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     298
};

static const yytype_int16 yycheck[] =
{
      15,   145,    34,   128,     3,     5,    39,    54,    51,    26,
       4,    57,    44,    59,     6,   159,   123,    28,    10,    34,
      55,    31,    85,   123,    35,    17,    25,    38,    37,     9,
      30,   157,   158,    96,   155,    54,    33,   132,     7,    54,
      57,    56,    59,    12,    54,    54,    46,    16,   160,    49,
     157,   158,    54,    54,   132,    52,   132,    68,   170,   132,
     132,   132,    56,   207,    58,   132,    54,    20,    60,   112,
     170,    24,    69,    54,   132,   110,   132,   132,    54,    90,
       0,    50,   132,   132,   169,   155,   132,    54,    87,    31,
     215,   216,    61,    92,    86,   239,   132,    26,   132,    26,
     133,    76,    82,   103,   119,   120,    86,    99,   107,   166,
      79,    54,   132,    54,    83,   132,    85,    54,   155,    72,
     167,   161,   162,   163,   164,   165,    95,     1,    54,   129,
     130,    54,   141,   144,     8,   127,   132,   132,   132,    13,
      14,    15,   111,   112,    18,    54,    34,    54,    22,    23,
     149,   155,   105,   152,    28,    29,   150,    26,    32,   166,
     113,    35,    36,   166,   117,    39,   132,   311,   312,    27,
      54,   155,   141,    47,   143,   166,   169,   302,   147,    53,
     133,    55,   151,   168,   137,   159,   218,   166,    62,    63,
      48,   155,    66,    51,   166,   160,    70,    71,   230,   343,
      74,    75,   253,   155,   348,   166,   169,   166,    40,    41,
      42,    43,   166,    91,    88,    89,   166,   361,   362,   363,
     364,   365,   161,   162,   163,   164,   165,   101,   166,    12,
     104,   170,   106,   155,   108,   109,   116,   156,   143,   163,
      25,   115,   232,   205,   267,   119,   120,   121,   122,   123,
     124,   208,   126,   315,   128,   345,   114,   359,   116,    -1,
     134,    -1,    -1,   121,   138,   139,   140,   125,   142,   143,
       8,   145,   146,    -1,    -1,    13,    14,    15,    -1,    -1,
      18,   155,   156,    -1,    22,    23,   118,    -1,    -1,    -1,
      28,    29,    -1,    -1,    32,    -1,    -1,    35,    36,   131,
      -1,    39,    -1,   135,   136,    -1,    11,    -1,    -1,    47,
      -1,    -1,    -1,    -1,    19,    53,    21,    55,    -1,   334,
      -1,    -1,    -1,    -1,    62,    63,    -1,    -1,    66,    -1,
      -1,    -1,    70,    71,    -1,    -1,    74,    75,    -1,    -1,
      45,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      88,    89,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   101,    -1,    -1,   104,    -1,   106,    -1,
     108,   109,    77,    78,    -1,    80,    81,   115,    -1,    84,
      -1,   119,   120,   121,   122,   123,   124,    -1,   126,    -1,
     128,    -1,    -1,    -1,    -1,    -1,   134,   102,    -1,    -1,
     138,   139,   140,    -1,   142,   143,     8,   145,   146,    -1,
      -1,    13,    14,    15,    -1,    -1,    18,   155,   156,    -1,
      22,    23,    -1,    -1,    -1,    -1,    28,    29,    -1,    -1,
      32,    -1,    -1,    35,    36,    -1,    -1,    39,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    47,    -1,    -1,    -1,    -1,
      -1,    53,    -1,    55,    -1,    -1,    -1,    -1,    -1,    -1,
      62,    63,    -1,    -1,    66,    -1,    -1,    -1,    70,    71,
      -1,    -1,    74,    75,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    88,    89,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   101,
      -1,    -1,   104,    -1,   106,    -1,   108,   109,    -1,    -1,
      -1,    -1,    -1,   115,    -1,    -1,    -1,   119,   120,   121,
     122,   123,   124,    -1,   126,    -1,   128,    44,    -1,    -1,
      -1,    -1,   134,    -1,    -1,    52,   138,   139,   140,    -1,
     142,   143,    -1,   145,   146,    -1,    -1,    64,    65,    -1,
      67,    -1,    -1,    -1,   156,    -1,    73,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    91,    -1,    93,    94,    -1,    96,
      97,    98,    -1,   100,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
     147
};

/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
   symbol of state STATE-NUM.  */
static const yytype_uint16 yystos[] =
{
       0,     1,     8,    13,    14,    15,    18,    22,    23,    28,
      29,    32,    35,    36,    39,    47,    53,    55,    62,    63,
      66,    70,    71,    74,    75,    88,    89,   101,   104,   106,
     108,   109,   115,   119,   120,   121,   122,   123,   124,   126,
     128,   134,   138,   139,   140,   142,   143,   145,   146,   156,
     172,   173,   174,   175,   176,   186,   187,   188,   189,   193,
     198,   206,   212,   217,   221,   225,   226,   227,   228,   236,
     237,   248,   249,   155,    54,    54,    54,   190,     6,    10,
      17,    60,    86,    99,   127,   218,   219,   220,     9,    82,
      86,   209,   210,   211,   132,   229,   218,    20,    24,    72,
     105,   113,   117,   133,   137,   200,    57,    59,   132,   177,
     178,   179,   132,   132,   132,   132,   234,   235,   177,   245,
     245,   132,   132,   244,    54,    26,    57,    59,   177,   178,
      54,   132,   230,   199,   200,   132,     5,    30,    46,    49,
     103,   129,   130,   222,   223,   224,    11,    19,    21,    45,
      77,    78,    80,    81,    84,   102,   194,   195,   196,   197,
     178,    54,   167,   241,   242,   243,    54,   240,     0,   174,
     155,   177,   177,    31,    54,   247,   132,   132,    33,    52,
      69,   239,   169,    27,    48,    51,   114,   116,   121,   125,
     191,   192,   219,   210,    54,    31,   201,    40,    41,    42,
      43,   118,   131,   135,   136,   213,   214,   215,   216,   132,
     174,   235,   177,   132,   207,    26,    26,   207,    76,   166,
     200,   223,   247,    37,    54,   141,   246,   195,    54,   247,
      55,   110,   232,   233,    54,   242,    54,   155,     7,    12,
      16,    50,    61,    79,    83,    85,    95,   111,   112,   141,
     143,   147,   151,   180,   181,   182,   183,   184,   185,     4,
      56,    58,   132,   150,   238,   157,   158,   250,   251,    54,
     132,    28,    35,    38,    68,    90,   144,   202,   203,   204,
     132,    54,   214,   247,   246,    44,    52,    64,    65,    67,
      73,    91,    93,    94,    96,    97,    98,   100,   147,   208,
     207,   207,   178,   132,   178,    54,   233,    34,   247,   181,
      54,   166,   166,   123,   251,   252,   253,   255,   155,   132,
       3,    25,    87,    92,   107,   149,   152,   205,   207,    26,
     231,    54,   247,   247,   166,   155,   170,   253,   169,   168,
     177,   159,   254,   166,   160,   256,   257,   247,   166,   170,
     257,   155,   247,   169,   161,   162,   163,   164,   165,   258,
     259,   166,   166,   166,   166,   166,   170,   259,   155,   247,
     247,   247,   247,   247,   155
};

#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
#define YYEMPTY		(-2)
#define YYEOF		0

#define YYACCEPT	goto yyacceptlab
#define YYABORT		goto yyabortlab
#define YYERROR		goto yyerrorlab


/* Like YYERROR except do call yyerror.  This remains here temporarily
   to ease the transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  However,
   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
   discussed.  */

#define YYFAIL		goto yyerrlab
#if defined YYFAIL
  /* This is here to suppress warnings from the GCC cpp's
     -Wunused-macros.  Normally we don't worry about that warning, but
     some users do, and we want to make it easy for users to remove
     YYFAIL uses, which will produce warnings from Bison 2.5.  */
#endif

#define YYRECOVERING()  (!!yyerrstatus)

#define YYBACKUP(Token, Value)					\
do								\
  if (yychar == YYEMPTY && yylen == 1)				\
    {								\
      yychar = (Token);						\
      yylval = (Value);						\
      yytoken = YYTRANSLATE (yychar);				\
      YYPOPSTACK (1);						\
      goto yybackup;						\
    }								\
  else								\
    {								\
      yyerror (YY_("syntax error: cannot back up")); \
      YYERROR;							\
    }								\
while (YYID (0))


#define YYTERROR	1
#define YYERRCODE	256


/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
   If N is 0, then set CURRENT to the empty location which ends
   the previous symbol: RHS[0] (always defined).  */

#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N)				\
    do									\
      if (YYID (N))                                                    \
	{								\
	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
	}								\
      else								\
	{								\
	  (Current).first_line   = (Current).last_line   =		\
	    YYRHSLOC (Rhs, 0).last_line;				\
	  (Current).first_column = (Current).last_column =		\
	    YYRHSLOC (Rhs, 0).last_column;				\
	}								\
    while (YYID (0))
#endif


/* YY_LOCATION_PRINT -- Print the location on the stream.
   This macro was not mandated originally: define only if we know
   we won't break user code: when these are the locations we know.  */

#ifndef YY_LOCATION_PRINT
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
#  define YY_LOCATION_PRINT(File, Loc)			\
     fprintf (File, "%d.%d-%d.%d",			\
	      (Loc).first_line, (Loc).first_column,	\
	      (Loc).last_line,  (Loc).last_column)
# else
#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
#endif


/* YYLEX -- calling `yylex' with the right arguments.  */

#ifdef YYLEX_PARAM
# define YYLEX yylex (YYLEX_PARAM)
#else
# define YYLEX yylex ()
#endif

/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include  /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)			\
do {						\
  if (yydebug)					\
    YYFPRINTF Args;				\
} while (YYID (0))

# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
do {									  \
  if (yydebug)								  \
    {									  \
      YYFPRINTF (stderr, "%s ", Title);					  \
      yy_symbol_print (stderr,						  \
		  Type, Value); \
      YYFPRINTF (stderr, "\n");						  \
    }									  \
} while (YYID (0))


/*--------------------------------.
| Print this symbol on YYOUTPUT.  |
`--------------------------------*/

/*ARGSUSED*/
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
#else
static void
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
    FILE *yyoutput;
    int yytype;
    YYSTYPE const * const yyvaluep;
#endif
{
  if (!yyvaluep)
    return;
# ifdef YYPRINT
  if (yytype < YYNTOKENS)
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# else
  YYUSE (yyoutput);
# endif
  switch (yytype)
    {
      default:
	break;
    }
}


/*--------------------------------.
| Print this symbol on YYOUTPUT.  |
`--------------------------------*/

#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
#else
static void
yy_symbol_print (yyoutput, yytype, yyvaluep)
    FILE *yyoutput;
    int yytype;
    YYSTYPE const * const yyvaluep;
#endif
{
  if (yytype < YYNTOKENS)
    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  else
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);

  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
  YYFPRINTF (yyoutput, ")");
}

/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included).                                                   |
`------------------------------------------------------------------*/

#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else
static void
yy_stack_print (yybottom, yytop)
    yytype_int16 *yybottom;
    yytype_int16 *yytop;
#endif
{
  YYFPRINTF (stderr, "Stack now");
  for (; yybottom <= yytop; yybottom++)
    {
      int yybot = *yybottom;
      YYFPRINTF (stderr, " %d", yybot);
    }
  YYFPRINTF (stderr, "\n");
}

# define YY_STACK_PRINT(Bottom, Top)				\
do {								\
  if (yydebug)							\
    yy_stack_print ((Bottom), (Top));				\
} while (YYID (0))


/*------------------------------------------------.
| Report that the YYRULE is going to be reduced.  |
`------------------------------------------------*/

#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
#else
static void
yy_reduce_print (yyvsp, yyrule)
    YYSTYPE *yyvsp;
    int yyrule;
#endif
{
  int yynrhs = yyr2[yyrule];
  int yyi;
  unsigned long int yylno = yyrline[yyrule];
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
	     yyrule - 1, yylno);
  /* The symbols being reduced.  */
  for (yyi = 0; yyi < yynrhs; yyi++)
    {
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
		       &(yyvsp[(yyi + 1) - (yynrhs)])
		       		       );
      YYFPRINTF (stderr, "\n");
    }
}

# define YY_REDUCE_PRINT(Rule)		\
do {					\
  if (yydebug)				\
    yy_reduce_print (yyvsp, Rule); \
} while (YYID (0))

/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */


/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef	YYINITDEPTH
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif



#if YYERROR_VERBOSE

# ifndef yystrlen
#  if defined __GLIBC__ && defined _STRING_H
#   define yystrlen strlen
#  else
/* Return the length of YYSTR.  */
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
yystrlen (const char *yystr)
#else
static YYSIZE_T
yystrlen (yystr)
    const char *yystr;
#endif
{
  YYSIZE_T yylen;
  for (yylen = 0; yystr[yylen]; yylen++)
    continue;
  return yylen;
}
#  endif
# endif

# ifndef yystpcpy
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
#   define yystpcpy stpcpy
#  else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
   YYDEST.  */
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static char *
yystpcpy (char *yydest, const char *yysrc)
#else
static char *
yystpcpy (yydest, yysrc)
    char *yydest;
    const char *yysrc;
#endif
{
  char *yyd = yydest;
  const char *yys = yysrc;

  while ((*yyd++ = *yys++) != '\0')
    continue;

  return yyd - 1;
}
#  endif
# endif

# ifndef yytnamerr
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
   quotes and backslashes, so that it's suitable for yyerror.  The
   heuristic is that double-quoting is unnecessary unless the string
   contains an apostrophe, a comma, or backslash (other than
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
   null, do not copy; instead, return the length of what the result
   would have been.  */
static YYSIZE_T
yytnamerr (char *yyres, const char *yystr)
{
  if (*yystr == '"')
    {
      YYSIZE_T yyn = 0;
      char const *yyp = yystr;

      for (;;)
	switch (*++yyp)
	  {
	  case '\'':
	  case ',':
	    goto do_not_strip_quotes;

	  case '\\':
	    if (*++yyp != '\\')
	      goto do_not_strip_quotes;
	    /* Fall through.  */
	  default:
	    if (yyres)
	      yyres[yyn] = *yyp;
	    yyn++;
	    break;

	  case '"':
	    if (yyres)
	      yyres[yyn] = '\0';
	    return yyn;
	  }
    do_not_strip_quotes: ;
    }

  if (! yyres)
    return yystrlen (yystr);

  return yystpcpy (yyres, yystr) - yyres;
}
# endif

/* Copy into YYRESULT an error message about the unexpected token
   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
   including the terminating null byte.  If YYRESULT is null, do not
   copy anything; just return the number of bytes that would be
   copied.  As a special case, return 0 if an ordinary "syntax error"
   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
   size calculation.  */
static YYSIZE_T
yysyntax_error (char *yyresult, int yystate, int yychar)
{
  int yyn = yypact[yystate];

  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
    return 0;
  else
    {
      int yytype = YYTRANSLATE (yychar);
      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
      YYSIZE_T yysize = yysize0;
      YYSIZE_T yysize1;
      int yysize_overflow = 0;
      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
      int yyx;

# if 0
      /* This is so xgettext sees the translatable formats that are
	 constructed on the fly.  */
      YY_("syntax error, unexpected %s");
      YY_("syntax error, unexpected %s, expecting %s");
      YY_("syntax error, unexpected %s, expecting %s or %s");
      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
# endif
      char *yyfmt;
      char const *yyf;
      static char const yyunexpected[] = "syntax error, unexpected %s";
      static char const yyexpecting[] = ", expecting %s";
      static char const yyor[] = " or %s";
      char yyformat[sizeof yyunexpected
		    + sizeof yyexpecting - 1
		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
		       * (sizeof yyor - 1))];
      char const *yyprefix = yyexpecting;

      /* Start YYX at -YYN if negative to avoid negative indexes in
	 YYCHECK.  */
      int yyxbegin = yyn < 0 ? -yyn : 0;

      /* Stay within bounds of both yycheck and yytname.  */
      int yychecklim = YYLAST - yyn + 1;
      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
      int yycount = 1;

      yyarg[0] = yytname[yytype];
      yyfmt = yystpcpy (yyformat, yyunexpected);

      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
	  {
	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
	      {
		yycount = 1;
		yysize = yysize0;
		yyformat[sizeof yyunexpected - 1] = '\0';
		break;
	      }
	    yyarg[yycount++] = yytname[yyx];
	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
	    yysize_overflow |= (yysize1 < yysize);
	    yysize = yysize1;
	    yyfmt = yystpcpy (yyfmt, yyprefix);
	    yyprefix = yyor;
	  }

      yyf = YY_(yyformat);
      yysize1 = yysize + yystrlen (yyf);
      yysize_overflow |= (yysize1 < yysize);
      yysize = yysize1;

      if (yysize_overflow)
	return YYSIZE_MAXIMUM;

      if (yyresult)
	{
	  /* Avoid sprintf, as that infringes on the user's name space.
	     Don't have undefined behavior even if the translation
	     produced a string with the wrong number of "%s"s.  */
	  char *yyp = yyresult;
	  int yyi = 0;
	  while ((*yyp = *yyf) != '\0')
	    {
	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
		{
		  yyp += yytnamerr (yyp, yyarg[yyi++]);
		  yyf += 2;
		}
	      else
		{
		  yyp++;
		  yyf++;
		}
	    }
	}
      return yysize;
    }
}
#endif /* YYERROR_VERBOSE */


/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

/*ARGSUSED*/
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#else
static void
yydestruct (yymsg, yytype, yyvaluep)
    const char *yymsg;
    int yytype;
    YYSTYPE *yyvaluep;
#endif
{
  YYUSE (yyvaluep);

  if (!yymsg)
    yymsg = "Deleting";
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);

  switch (yytype)
    {

      default:
	break;
    }
}

/* Prevent warnings from -Wmissing-prototypes.  */
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */


/* The lookahead symbol.  */
int yychar;

/* The semantic value of the lookahead symbol.  */
YYSTYPE yylval;

/* Number of syntax errors so far.  */
int yynerrs;



/*-------------------------.
| yyparse or yypush_parse.  |
`-------------------------*/

#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
int
yyparse (void *YYPARSE_PARAM)
#else
int
yyparse (YYPARSE_PARAM)
    void *YYPARSE_PARAM;
#endif
#else /* ! YYPARSE_PARAM */
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
int
yyparse (void)
#else
int
yyparse ()

#endif
#endif
{


    int yystate;
    /* Number of tokens to shift before error messages enabled.  */
    int yyerrstatus;

    /* The stacks and their tools:
       `yyss': related to states.
       `yyvs': related to semantic values.

       Refer to the stacks thru separate pointers, to allow yyoverflow
       to reallocate them elsewhere.  */

    /* The state stack.  */
    yytype_int16 yyssa[YYINITDEPTH];
    yytype_int16 *yyss;
    yytype_int16 *yyssp;

    /* The semantic value stack.  */
    YYSTYPE yyvsa[YYINITDEPTH];
    YYSTYPE *yyvs;
    YYSTYPE *yyvsp;

    YYSIZE_T yystacksize;

  int yyn;
  int yyresult;
  /* Lookahead token as an internal (translated) token number.  */
  int yytoken;
  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;

#if YYERROR_VERBOSE
  /* Buffer for error messages, and its allocated size.  */
  char yymsgbuf[128];
  char *yymsg = yymsgbuf;
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif

#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))

  /* The number of symbols on the RHS of the reduced rule.
     Keep to zero when no symbol should be popped.  */
  int yylen = 0;

  yytoken = 0;
  yyss = yyssa;
  yyvs = yyvsa;
  yystacksize = YYINITDEPTH;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY; /* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */
  yyssp = yyss;
  yyvsp = yyvs;

  goto yysetstate;

/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
 yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed.  So pushing a state here evens the stacks.  */
  yyssp++;

 yysetstate:
  *yyssp = yystate;

  if (yyss + yystacksize - 1 <= yyssp)
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYSIZE_T yysize = yyssp - yyss + 1;

#ifdef yyoverflow
      {
	/* Give user a chance to reallocate the stack.  Use copies of
	   these so that the &'s don't force the real ones into
	   memory.  */
	YYSTYPE *yyvs1 = yyvs;
	yytype_int16 *yyss1 = yyss;

	/* Each stack pointer address is followed by the size of the
	   data in use in that stack, in bytes.  This used to be a
	   conditional around just the two extra args, but that might
	   be undefined if yyoverflow is a macro.  */
	yyoverflow (YY_("memory exhausted"),
		    &yyss1, yysize * sizeof (*yyssp),
		    &yyvs1, yysize * sizeof (*yyvsp),
		    &yystacksize);

	yyss = yyss1;
	yyvs = yyvs1;
      }
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
      goto yyexhaustedlab;
# else
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
	goto yyexhaustedlab;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
	yystacksize = YYMAXDEPTH;

      {
	yytype_int16 *yyss1 = yyss;
	union yyalloc *yyptr =
	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
	if (! yyptr)
	  goto yyexhaustedlab;
	YYSTACK_RELOCATE (yyss_alloc, yyss);
	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#  undef YYSTACK_RELOCATE
	if (yyss1 != yyssa)
	  YYSTACK_FREE (yyss1);
      }
# endif
#endif /* no yyoverflow */

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;

      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
		  (unsigned long int) yystacksize));

      if (yyss + yystacksize - 1 <= yyssp)
	YYABORT;
    }

  YYDPRINTF ((stderr, "Entering state %d\n", yystate));

  if (yystate == YYFINAL)
    YYACCEPT;

  goto yybackup;

/*-----------.
| yybackup.  |
`-----------*/
yybackup:

  /* Do appropriate processing given the current state.  Read a
     lookahead token if we need one and don't already have one.  */

  /* First try to decide what to do without reference to lookahead token.  */
  yyn = yypact[yystate];
  if (yyn == YYPACT_NINF)
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token: "));
      yychar = YYLEX;
    }

  if (yychar <= YYEOF)
    {
      yychar = yytoken = YYEOF;
      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else
    {
      yytoken = YYTRANSLATE (yychar);
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yyn == 0 || yyn == YYTABLE_NINF)
	goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  /* Shift the lookahead token.  */
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);

  /* Discard the shifted token.  */
  yychar = YYEMPTY;

  yystate = yyn;
  *++yyvsp = yylval;

  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- Do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     `$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];


  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
        case 5:

/* Line 1464 of yacc.c  */
#line 325 "ntp_parser.y"
    {
			/* I will need to incorporate much more fine grained
			 * error messages. The following should suffice for
			 * the time being.
			 */
			msyslog(LOG_ERR, 
				"syntax error in %s line %d, column %d",
				ip_file->fname,
				ip_file->err_line_no,
				ip_file->err_col_no);
		}
    break;

  case 19:

/* Line 1464 of yacc.c  */
#line 359 "ntp_parser.y"
    {
			struct peer_node *my_node =  create_peer_node((yyvsp[(1) - (3)].Integer), (yyvsp[(2) - (3)].Address_node), (yyvsp[(3) - (3)].Queue));
			if (my_node)
				enqueue(cfgt.peers, my_node);
		}
    break;

  case 20:

/* Line 1464 of yacc.c  */
#line 365 "ntp_parser.y"
    {
			struct peer_node *my_node = create_peer_node((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Address_node), NULL);
			if (my_node)
				enqueue(cfgt.peers, my_node);
		}
    break;

  case 27:

/* Line 1464 of yacc.c  */
#line 383 "ntp_parser.y"
    { (yyval.Address_node) = create_address_node((yyvsp[(2) - (2)].String), (yyvsp[(1) - (2)].Integer)); }
    break;

  case 28:

/* Line 1464 of yacc.c  */
#line 388 "ntp_parser.y"
    { (yyval.Address_node) = create_address_node((yyvsp[(1) - (1)].String), 0); }
    break;

  case 29:

/* Line 1464 of yacc.c  */
#line 393 "ntp_parser.y"
    { (yyval.Integer) = AF_INET; }
    break;

  case 30:

/* Line 1464 of yacc.c  */
#line 395 "ntp_parser.y"
    { (yyval.Integer) = AF_INET6; }
    break;

  case 31:

/* Line 1464 of yacc.c  */
#line 399 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Attr_val)); }
    break;

  case 32:

/* Line 1464 of yacc.c  */
#line 400 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Attr_val)); }
    break;

  case 35:

/* Line 1464 of yacc.c  */
#line 407 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); }
    break;

  case 36:

/* Line 1464 of yacc.c  */
#line 412 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); }
    break;

  case 45:

/* Line 1464 of yacc.c  */
#line 428 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
    break;

  case 52:

/* Line 1464 of yacc.c  */
#line 448 "ntp_parser.y"
    {
			struct unpeer_node *my_node = create_unpeer_node((yyvsp[(2) - (2)].Address_node));
			if (my_node)
				enqueue(cfgt.unpeers, my_node);
		}
    break;

  case 55:

/* Line 1464 of yacc.c  */
#line 467 "ntp_parser.y"
    { cfgt.broadcastclient = 1; }
    break;

  case 56:

/* Line 1464 of yacc.c  */
#line 469 "ntp_parser.y"
    { append_queue(cfgt.manycastserver, (yyvsp[(2) - (2)].Queue)); }
    break;

  case 57:

/* Line 1464 of yacc.c  */
#line 471 "ntp_parser.y"
    { append_queue(cfgt.multicastclient, (yyvsp[(2) - (2)].Queue)); }
    break;

  case 58:

/* Line 1464 of yacc.c  */
#line 482 "ntp_parser.y"
    { enqueue(cfgt.vars, create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer))); }
    break;

  case 59:

/* Line 1464 of yacc.c  */
#line 484 "ntp_parser.y"
    { cfgt.auth.control_key = (yyvsp[(2) - (2)].Integer); }
    break;

  case 60:

/* Line 1464 of yacc.c  */
#line 486 "ntp_parser.y"
    { 
			cfgt.auth.cryptosw++;
			append_queue(cfgt.auth.crypto_cmd_list, (yyvsp[(2) - (2)].Queue));
		}
    break;

  case 61:

/* Line 1464 of yacc.c  */
#line 491 "ntp_parser.y"
    { cfgt.auth.keys = (yyvsp[(2) - (2)].String); }
    break;

  case 62:

/* Line 1464 of yacc.c  */
#line 493 "ntp_parser.y"
    { cfgt.auth.keysdir = (yyvsp[(2) - (2)].String); }
    break;

  case 63:

/* Line 1464 of yacc.c  */
#line 495 "ntp_parser.y"
    { cfgt.auth.request_key = (yyvsp[(2) - (2)].Integer); }
    break;

  case 64:

/* Line 1464 of yacc.c  */
#line 497 "ntp_parser.y"
    { cfgt.auth.revoke = (yyvsp[(2) - (2)].Integer); }
    break;

  case 65:

/* Line 1464 of yacc.c  */
#line 499 "ntp_parser.y"
    { cfgt.auth.trusted_key_list = (yyvsp[(2) - (2)].Queue); }
    break;

  case 66:

/* Line 1464 of yacc.c  */
#line 501 "ntp_parser.y"
    { cfgt.auth.ntp_signd_socket = (yyvsp[(2) - (2)].String); }
    break;

  case 67:

/* Line 1464 of yacc.c  */
#line 506 "ntp_parser.y"
    { (yyval.Queue) = create_queue(); }
    break;

  case 68:

/* Line 1464 of yacc.c  */
#line 508 "ntp_parser.y"
    { 
			if ((yyvsp[(2) - (2)].Attr_val) != NULL)
				(yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Attr_val));
			else
				(yyval.Queue) = (yyvsp[(1) - (2)].Queue);
		}
    break;

  case 69:

/* Line 1464 of yacc.c  */
#line 518 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); }
    break;

  case 70:

/* Line 1464 of yacc.c  */
#line 520 "ntp_parser.y"
    {
			(yyval.Attr_val) = NULL;
			cfgt.auth.revoke = (yyvsp[(2) - (2)].Integer);
			msyslog(LOG_WARNING,
				"'crypto revoke %d' is deprecated, "
				"please use 'revoke %d' instead.",
				cfgt.auth.revoke, cfgt.auth.revoke);
		}
    break;

  case 77:

/* Line 1464 of yacc.c  */
#line 546 "ntp_parser.y"
    { append_queue(cfgt.orphan_cmds,(yyvsp[(2) - (2)].Queue)); }
    break;

  case 78:

/* Line 1464 of yacc.c  */
#line 550 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Attr_val)); }
    break;

  case 79:

/* Line 1464 of yacc.c  */
#line 551 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Attr_val)); }
    break;

  case 80:

/* Line 1464 of yacc.c  */
#line 556 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (double)(yyvsp[(2) - (2)].Integer)); }
    break;

  case 81:

/* Line 1464 of yacc.c  */
#line 558 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); }
    break;

  case 82:

/* Line 1464 of yacc.c  */
#line 560 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (double)(yyvsp[(2) - (2)].Integer)); }
    break;

  case 92:

/* Line 1464 of yacc.c  */
#line 585 "ntp_parser.y"
    { append_queue(cfgt.stats_list, (yyvsp[(2) - (2)].Queue)); }
    break;

  case 93:

/* Line 1464 of yacc.c  */
#line 587 "ntp_parser.y"
    {
			if (input_from_file) {
				cfgt.stats_dir = (yyvsp[(2) - (2)].String);
			} else {
				YYFREE((yyvsp[(2) - (2)].String));
				yyerror("statsdir remote configuration ignored");
			}
		}
    break;

  case 94:

/* Line 1464 of yacc.c  */
#line 596 "ntp_parser.y"
    {
			enqueue(cfgt.filegen_opts,
				create_filegen_node((yyvsp[(2) - (3)].Integer), (yyvsp[(3) - (3)].Queue)));
		}
    break;

  case 95:

/* Line 1464 of yacc.c  */
#line 603 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), create_ival((yyvsp[(2) - (2)].Integer))); }
    break;

  case 96:

/* Line 1464 of yacc.c  */
#line 604 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue(create_ival((yyvsp[(1) - (1)].Integer))); }
    break;

  case 105:

/* Line 1464 of yacc.c  */
#line 620 "ntp_parser.y"
    { (yyval.Queue) = create_queue(); }
    break;

  case 106:

/* Line 1464 of yacc.c  */
#line 622 "ntp_parser.y"
    {
			if ((yyvsp[(2) - (2)].Attr_val) != NULL)
				(yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Attr_val));
			else
				(yyval.Queue) = (yyvsp[(1) - (2)].Queue);
		}
    break;

  case 107:

/* Line 1464 of yacc.c  */
#line 632 "ntp_parser.y"
    {
			if (input_from_file) {
				(yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String));
			} else {
				(yyval.Attr_val) = NULL;
				YYFREE((yyvsp[(2) - (2)].String));
				yyerror("filegen file remote config ignored");
			}
		}
    break;

  case 108:

/* Line 1464 of yacc.c  */
#line 642 "ntp_parser.y"
    {
			if (input_from_file) {
				(yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer));
			} else {
				(yyval.Attr_val) = NULL;
				yyerror("filegen type remote config ignored");
			}
		}
    break;

  case 109:

/* Line 1464 of yacc.c  */
#line 651 "ntp_parser.y"
    {
			const char *err;
			
			if (input_from_file) {
				(yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer));
			} else {
				(yyval.Attr_val) = NULL;
				if (T_Link == (yyvsp[(1) - (1)].Integer))
					err = "filegen link remote config ignored";
				else
					err = "filegen nolink remote config ignored";
				yyerror(err);
			}
		}
    break;

  case 110:

/* Line 1464 of yacc.c  */
#line 666 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); }
    break;

  case 122:

/* Line 1464 of yacc.c  */
#line 696 "ntp_parser.y"
    {
			append_queue(cfgt.discard_opts, (yyvsp[(2) - (2)].Queue));
		}
    break;

  case 123:

/* Line 1464 of yacc.c  */
#line 700 "ntp_parser.y"
    {
			enqueue(cfgt.restrict_opts,
				create_restrict_node((yyvsp[(2) - (3)].Address_node), NULL, (yyvsp[(3) - (3)].Queue), ip_file->line_no));
		}
    break;

  case 124:

/* Line 1464 of yacc.c  */
#line 705 "ntp_parser.y"
    {
			enqueue(cfgt.restrict_opts,
				create_restrict_node(NULL, NULL, (yyvsp[(3) - (3)].Queue), ip_file->line_no));
		}
    break;

  case 125:

/* Line 1464 of yacc.c  */
#line 710 "ntp_parser.y"
    {
			enqueue(cfgt.restrict_opts,
				create_restrict_node(
					create_address_node(
						estrdup("0.0.0.0"), 
						AF_INET),
					create_address_node(
						estrdup("0.0.0.0"), 
						AF_INET),
					(yyvsp[(4) - (4)].Queue), 
					ip_file->line_no));
		}
    break;

  case 126:

/* Line 1464 of yacc.c  */
#line 723 "ntp_parser.y"
    {
			enqueue(cfgt.restrict_opts,
				create_restrict_node(
					create_address_node(
						estrdup("::"), 
						AF_INET6),
					create_address_node(
						estrdup("::"), 
						AF_INET6),
					(yyvsp[(4) - (4)].Queue), 
					ip_file->line_no));
		}
    break;

  case 127:

/* Line 1464 of yacc.c  */
#line 736 "ntp_parser.y"
    {
			enqueue(cfgt.restrict_opts,
				create_restrict_node((yyvsp[(2) - (5)].Address_node), (yyvsp[(4) - (5)].Address_node), (yyvsp[(5) - (5)].Queue), ip_file->line_no));
		}
    break;

  case 128:

/* Line 1464 of yacc.c  */
#line 744 "ntp_parser.y"
    { (yyval.Queue) = create_queue(); }
    break;

  case 129:

/* Line 1464 of yacc.c  */
#line 746 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), create_ival((yyvsp[(2) - (2)].Integer))); }
    break;

  case 144:

/* Line 1464 of yacc.c  */
#line 768 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Attr_val)); }
    break;

  case 145:

/* Line 1464 of yacc.c  */
#line 770 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Attr_val)); }
    break;

  case 146:

/* Line 1464 of yacc.c  */
#line 775 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
    break;

  case 150:

/* Line 1464 of yacc.c  */
#line 791 "ntp_parser.y"
    { enqueue(cfgt.fudge, create_addr_opts_node((yyvsp[(2) - (3)].Address_node), (yyvsp[(3) - (3)].Queue))); }
    break;

  case 151:

/* Line 1464 of yacc.c  */
#line 796 "ntp_parser.y"
    { enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Attr_val)); }
    break;

  case 152:

/* Line 1464 of yacc.c  */
#line 798 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Attr_val)); }
    break;

  case 153:

/* Line 1464 of yacc.c  */
#line 803 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); }
    break;

  case 154:

/* Line 1464 of yacc.c  */
#line 805 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
    break;

  case 155:

/* Line 1464 of yacc.c  */
#line 807 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
    break;

  case 156:

/* Line 1464 of yacc.c  */
#line 809 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); }
    break;

  case 163:

/* Line 1464 of yacc.c  */
#line 831 "ntp_parser.y"
    { append_queue(cfgt.enable_opts, (yyvsp[(2) - (2)].Queue));  }
    break;

  case 164:

/* Line 1464 of yacc.c  */
#line 833 "ntp_parser.y"
    { append_queue(cfgt.disable_opts, (yyvsp[(2) - (2)].Queue));  }
    break;

  case 165:

/* Line 1464 of yacc.c  */
#line 838 "ntp_parser.y"
    {
			if ((yyvsp[(2) - (2)].Attr_val) != NULL)
				(yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Attr_val));
			else
				(yyval.Queue) = (yyvsp[(1) - (2)].Queue);
		}
    break;

  case 166:

/* Line 1464 of yacc.c  */
#line 845 "ntp_parser.y"
    {
			if ((yyvsp[(1) - (1)].Attr_val) != NULL)
				(yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Attr_val));
			else
				(yyval.Queue) = create_queue();
		}
    break;

  case 167:

/* Line 1464 of yacc.c  */
#line 855 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); }
    break;

  case 168:

/* Line 1464 of yacc.c  */
#line 857 "ntp_parser.y"
    { 
			if (input_from_file) {
				(yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer));
			} else {
				(yyval.Attr_val) = NULL;
				yyerror("enable/disable stats remote config ignored");
			}
		}
    break;

  case 175:

/* Line 1464 of yacc.c  */
#line 882 "ntp_parser.y"
    { append_queue(cfgt.tinker, (yyvsp[(2) - (2)].Queue)); }
    break;

  case 176:

/* Line 1464 of yacc.c  */
#line 886 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Attr_val)); }
    break;

  case 177:

/* Line 1464 of yacc.c  */
#line 887 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Attr_val)); }
    break;

  case 178:

/* Line 1464 of yacc.c  */
#line 892 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); }
    break;

  case 187:

/* Line 1464 of yacc.c  */
#line 913 "ntp_parser.y"
    {
			struct attr_val *av;
			
			av = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double));
			enqueue(cfgt.vars, av);
		}
    break;

  case 188:

/* Line 1464 of yacc.c  */
#line 920 "ntp_parser.y"
    {
			struct attr_val *av;
			
			av = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String));
			enqueue(cfgt.vars, av);
		}
    break;

  case 189:

/* Line 1464 of yacc.c  */
#line 927 "ntp_parser.y"
    {
			char error_text[64];
			struct attr_val *av;

			if (input_from_file) {
				av = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String));
				enqueue(cfgt.vars, av);
			} else {
				YYFREE((yyvsp[(2) - (2)].String));
				snprintf(error_text, sizeof(error_text),
					 "%s remote config ignored",
					 keyword((yyvsp[(1) - (2)].Integer)));
				yyerror(error_text);
			}
		}
    break;

  case 190:

/* Line 1464 of yacc.c  */
#line 943 "ntp_parser.y"
    {
			if (!input_from_file) {
				yyerror("remote includefile ignored");
				break;
			}
			if (curr_include_level >= MAXINCLUDELEVEL) {
				fprintf(stderr, "getconfig: Maximum include file level exceeded.\n");
				msyslog(LOG_ERR, "getconfig: Maximum include file level exceeded.\n");
			} else {
				fp[curr_include_level + 1] = F_OPEN(FindConfig((yyvsp[(2) - (3)].String)), "r");
				if (fp[curr_include_level + 1] == NULL) {
					fprintf(stderr, "getconfig: Couldn't open <%s>\n", FindConfig((yyvsp[(2) - (3)].String)));
					msyslog(LOG_ERR, "getconfig: Couldn't open <%s>\n", FindConfig((yyvsp[(2) - (3)].String)));
				} else {
					ip_file = fp[++curr_include_level];
				}
			}
		}
    break;

  case 191:

/* Line 1464 of yacc.c  */
#line 962 "ntp_parser.y"
    {
			while (curr_include_level != -1)
				FCLOSE(fp[curr_include_level--]);
		}
    break;

  case 192:

/* Line 1464 of yacc.c  */
#line 967 "ntp_parser.y"
    { enqueue(cfgt.vars, create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer))); }
    break;

  case 193:

/* Line 1464 of yacc.c  */
#line 969 "ntp_parser.y"
    { /* Null action, possibly all null parms */ }
    break;

  case 194:

/* Line 1464 of yacc.c  */
#line 971 "ntp_parser.y"
    { append_queue(cfgt.logconfig, (yyvsp[(2) - (2)].Queue)); }
    break;

  case 195:

/* Line 1464 of yacc.c  */
#line 973 "ntp_parser.y"
    { append_queue(cfgt.phone, (yyvsp[(2) - (2)].Queue)); }
    break;

  case 196:

/* Line 1464 of yacc.c  */
#line 975 "ntp_parser.y"
    { enqueue(cfgt.setvar, (yyvsp[(2) - (2)].Set_var)); }
    break;

  case 197:

/* Line 1464 of yacc.c  */
#line 977 "ntp_parser.y"
    { enqueue(cfgt.trap, create_addr_opts_node((yyvsp[(2) - (2)].Address_node), NULL)); }
    break;

  case 198:

/* Line 1464 of yacc.c  */
#line 979 "ntp_parser.y"
    { enqueue(cfgt.trap, create_addr_opts_node((yyvsp[(2) - (3)].Address_node), (yyvsp[(3) - (3)].Queue))); }
    break;

  case 199:

/* Line 1464 of yacc.c  */
#line 981 "ntp_parser.y"
    { append_queue(cfgt.ttl, (yyvsp[(2) - (2)].Queue)); }
    break;

  case 207:

/* Line 1464 of yacc.c  */
#line 1002 "ntp_parser.y"
    { enqueue(cfgt.vars, create_attr_sval(T_Driftfile, (yyvsp[(1) - (1)].String))); }
    break;

  case 208:

/* Line 1464 of yacc.c  */
#line 1004 "ntp_parser.y"
    { enqueue(cfgt.vars, create_attr_dval(T_WanderThreshold, (yyvsp[(2) - (2)].Double)));
			  enqueue(cfgt.vars, create_attr_sval(T_Driftfile, (yyvsp[(1) - (2)].String))); }
    break;

  case 209:

/* Line 1464 of yacc.c  */
#line 1007 "ntp_parser.y"
    { enqueue(cfgt.vars, create_attr_sval(T_Driftfile, "\0")); }
    break;

  case 210:

/* Line 1464 of yacc.c  */
#line 1012 "ntp_parser.y"
    { (yyval.Set_var) = create_setvar_node((yyvsp[(1) - (4)].String), (yyvsp[(3) - (4)].String), (yyvsp[(4) - (4)].Integer)); }
    break;

  case 212:

/* Line 1464 of yacc.c  */
#line 1018 "ntp_parser.y"
    { (yyval.Integer) = 0; }
    break;

  case 213:

/* Line 1464 of yacc.c  */
#line 1023 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Attr_val)); }
    break;

  case 214:

/* Line 1464 of yacc.c  */
#line 1024 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Attr_val)); }
    break;

  case 215:

/* Line 1464 of yacc.c  */
#line 1028 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
    break;

  case 216:

/* Line 1464 of yacc.c  */
#line 1029 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_pval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Address_node)); }
    break;

  case 217:

/* Line 1464 of yacc.c  */
#line 1033 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Attr_val)); }
    break;

  case 218:

/* Line 1464 of yacc.c  */
#line 1034 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Attr_val)); }
    break;

  case 219:

/* Line 1464 of yacc.c  */
#line 1039 "ntp_parser.y"
    {
			char prefix = (yyvsp[(1) - (1)].String)[0];
			char *type = (yyvsp[(1) - (1)].String) + 1;
			
			if (prefix != '+' && prefix != '-' && prefix != '=') {
				yyerror("Logconfig prefix is not '+', '-' or '='\n");
			}
			else
				(yyval.Attr_val) = create_attr_sval(prefix, estrdup(type));
			YYFREE((yyvsp[(1) - (1)].String));
		}
    break;

  case 220:

/* Line 1464 of yacc.c  */
#line 1054 "ntp_parser.y"
    {
			enqueue(cfgt.nic_rules,
				create_nic_rule_node((yyvsp[(3) - (3)].Integer), NULL, (yyvsp[(2) - (3)].Integer)));
		}
    break;

  case 221:

/* Line 1464 of yacc.c  */
#line 1059 "ntp_parser.y"
    {
			enqueue(cfgt.nic_rules,
				create_nic_rule_node(0, (yyvsp[(3) - (3)].String), (yyvsp[(2) - (3)].Integer)));
		}
    break;

  case 231:

/* Line 1464 of yacc.c  */
#line 1090 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), create_ival((yyvsp[(2) - (2)].Integer))); }
    break;

  case 232:

/* Line 1464 of yacc.c  */
#line 1091 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue(create_ival((yyvsp[(1) - (1)].Integer))); }
    break;

  case 233:

/* Line 1464 of yacc.c  */
#line 1096 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Attr_val)); }
    break;

  case 234:

/* Line 1464 of yacc.c  */
#line 1098 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Attr_val)); }
    break;

  case 235:

/* Line 1464 of yacc.c  */
#line 1103 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_ival('i', (yyvsp[(1) - (1)].Integer)); }
    break;

  case 237:

/* Line 1464 of yacc.c  */
#line 1109 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_shorts('-', (yyvsp[(2) - (5)].Integer), (yyvsp[(4) - (5)].Integer)); }
    break;

  case 238:

/* Line 1464 of yacc.c  */
#line 1113 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), create_pval((yyvsp[(2) - (2)].String))); }
    break;

  case 239:

/* Line 1464 of yacc.c  */
#line 1114 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue(create_pval((yyvsp[(1) - (1)].String))); }
    break;

  case 240:

/* Line 1464 of yacc.c  */
#line 1118 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Address_node)); }
    break;

  case 241:

/* Line 1464 of yacc.c  */
#line 1119 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Address_node)); }
    break;

  case 242:

/* Line 1464 of yacc.c  */
#line 1124 "ntp_parser.y"
    {
			if ((yyvsp[(1) - (1)].Integer) != 0 && (yyvsp[(1) - (1)].Integer) != 1) {
				yyerror("Integer value is not boolean (0 or 1). Assuming 1");
				(yyval.Integer) = 1;
			} else {
				(yyval.Integer) = (yyvsp[(1) - (1)].Integer);
			}
		}
    break;

  case 243:

/* Line 1464 of yacc.c  */
#line 1132 "ntp_parser.y"
    { (yyval.Integer) = 1; }
    break;

  case 244:

/* Line 1464 of yacc.c  */
#line 1133 "ntp_parser.y"
    { (yyval.Integer) = 0; }
    break;

  case 245:

/* Line 1464 of yacc.c  */
#line 1137 "ntp_parser.y"
    { (yyval.Double) = (double)(yyvsp[(1) - (1)].Integer); }
    break;

  case 247:

/* Line 1464 of yacc.c  */
#line 1148 "ntp_parser.y"
    {
			cfgt.sim_details = create_sim_node((yyvsp[(3) - (5)].Queue), (yyvsp[(4) - (5)].Queue));

			/* Reset the old_config_style variable */
			old_config_style = 1;
		}
    break;

  case 248:

/* Line 1464 of yacc.c  */
#line 1162 "ntp_parser.y"
    { old_config_style = 0; }
    break;

  case 249:

/* Line 1464 of yacc.c  */
#line 1166 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (3)].Queue), (yyvsp[(2) - (3)].Attr_val)); }
    break;

  case 250:

/* Line 1464 of yacc.c  */
#line 1167 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (2)].Attr_val)); }
    break;

  case 251:

/* Line 1464 of yacc.c  */
#line 1171 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); }
    break;

  case 252:

/* Line 1464 of yacc.c  */
#line 1172 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); }
    break;

  case 253:

/* Line 1464 of yacc.c  */
#line 1176 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Sim_server)); }
    break;

  case 254:

/* Line 1464 of yacc.c  */
#line 1177 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Sim_server)); }
    break;

  case 255:

/* Line 1464 of yacc.c  */
#line 1182 "ntp_parser.y"
    { (yyval.Sim_server) = create_sim_server((yyvsp[(1) - (5)].Address_node), (yyvsp[(3) - (5)].Double), (yyvsp[(4) - (5)].Queue)); }
    break;

  case 256:

/* Line 1464 of yacc.c  */
#line 1186 "ntp_parser.y"
    { (yyval.Double) = (yyvsp[(3) - (4)].Double); }
    break;

  case 257:

/* Line 1464 of yacc.c  */
#line 1190 "ntp_parser.y"
    { (yyval.Address_node) = (yyvsp[(3) - (3)].Address_node); }
    break;

  case 258:

/* Line 1464 of yacc.c  */
#line 1194 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Sim_script)); }
    break;

  case 259:

/* Line 1464 of yacc.c  */
#line 1195 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Sim_script)); }
    break;

  case 260:

/* Line 1464 of yacc.c  */
#line 1200 "ntp_parser.y"
    { (yyval.Sim_script) = create_sim_script_info((yyvsp[(3) - (6)].Double), (yyvsp[(5) - (6)].Queue)); }
    break;

  case 261:

/* Line 1464 of yacc.c  */
#line 1204 "ntp_parser.y"
    { (yyval.Queue) = enqueue((yyvsp[(1) - (3)].Queue), (yyvsp[(2) - (3)].Attr_val)); }
    break;

  case 262:

/* Line 1464 of yacc.c  */
#line 1205 "ntp_parser.y"
    { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (2)].Attr_val)); }
    break;

  case 263:

/* Line 1464 of yacc.c  */
#line 1210 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); }
    break;

  case 264:

/* Line 1464 of yacc.c  */
#line 1212 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); }
    break;

  case 265:

/* Line 1464 of yacc.c  */
#line 1214 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); }
    break;

  case 266:

/* Line 1464 of yacc.c  */
#line 1216 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); }
    break;

  case 267:

/* Line 1464 of yacc.c  */
#line 1218 "ntp_parser.y"
    { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); }
    break;



/* Line 1464 of yacc.c  */
#line 3356 "ntp_parser.c"
      default: break;
    }
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);

  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);

  *++yyvsp = yyval;

  /* Now `shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTOKENS];

  goto yynewstate;


/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
#if ! YYERROR_VERBOSE
      yyerror (YY_("syntax error"));
#else
      {
	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
	  {
	    YYSIZE_T yyalloc = 2 * yysize;
	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
	    if (yymsg != yymsgbuf)
	      YYSTACK_FREE (yymsg);
	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
	    if (yymsg)
	      yymsg_alloc = yyalloc;
	    else
	      {
		yymsg = yymsgbuf;
		yymsg_alloc = sizeof yymsgbuf;
	      }
	  }

	if (0 < yysize && yysize <= yymsg_alloc)
	  {
	    (void) yysyntax_error (yymsg, yystate, yychar);
	    yyerror (yymsg);
	  }
	else
	  {
	    yyerror (YY_("syntax error"));
	    if (yysize != 0)
	      goto yyexhaustedlab;
	  }
      }
#endif
    }



  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
	 error, discard it.  */

      if (yychar <= YYEOF)
	{
	  /* Return failure if at end of input.  */
	  if (yychar == YYEOF)
	    YYABORT;
	}
      else
	{
	  yydestruct ("Error: discarding",
		      yytoken, &yylval);
	  yychar = YYEMPTY;
	}
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */
  goto yyerrlab1;


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:

  /* Pacify compilers like GCC when the user code never invokes
     YYERROR and the label yyerrorlab therefore never appears in user
     code.  */
  if (/*CONSTCOND*/ 0)
     goto yyerrorlab;

  /* Do not reclaim the symbols of the rule which action triggered
     this YYERROR.  */
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  yyerrstatus = 3;	/* Each real token shifted decrements this.  */

  for (;;)
    {
      yyn = yypact[yystate];
      if (yyn != YYPACT_NINF)
	{
	  yyn += YYTERROR;
	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
	    {
	      yyn = yytable[yyn];
	      if (0 < yyn)
		break;
	    }
	}

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
	YYABORT;


      yydestruct ("Error: popping",
		  yystos[yystate], yyvsp);
      YYPOPSTACK (1);
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  *++yyvsp = yylval;


  /* Shift the error token.  */
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturn;

/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturn;

#if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here.  |
`-------------------------------------------------*/
yyexhaustedlab:
  yyerror (YY_("memory exhausted"));
  yyresult = 2;
  /* Fall through.  */
#endif

yyreturn:
  if (yychar != YYEMPTY)
     yydestruct ("Cleanup: discarding lookahead",
		 yytoken, &yylval);
  /* Do not reclaim the symbols of the rule which action triggered
     this YYABORT or YYACCEPT.  */
  YYPOPSTACK (yylen);
  YY_STACK_PRINT (yyss, yyssp);
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
		  yystos[*yyssp], yyvsp);
      YYPOPSTACK (1);
    }
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
#if YYERROR_VERBOSE
  if (yymsg != yymsgbuf)
    YYSTACK_FREE (yymsg);
#endif
  /* Make sure YYID is used.  */
  return YYID (yyresult);
}



/* Line 1684 of yacc.c  */
#line 1222 "ntp_parser.y"


void
yyerror(
	const char *msg
	)
{
	int retval;

	ip_file->err_line_no = ip_file->prev_token_line_no;
	ip_file->err_col_no = ip_file->prev_token_col_no;
	
	msyslog(LOG_ERR, 
		"line %d column %d %s", 
		ip_file->err_line_no,
		ip_file->err_col_no,
		msg);
	if (!input_from_file) {
		/* Save the error message in the correct buffer */
		retval = snprintf(remote_config.err_msg + remote_config.err_pos,
				  MAXLINE - remote_config.err_pos,
				  "column %d %s",
				  ip_file->err_col_no, msg);

		/* Increment the value of err_pos */
		if (retval > 0)
			remote_config.err_pos += retval;

		/* Increment the number of errors */
		++remote_config.no_errors;
	}
}


/*
 * token_name - Convert T_ token integers to text.
 *		Example: token_name(T_Server) returns "T_Server".
 *		see also keyword(T_Server) which returns "server".
 */
const char *
token_name(
	int token
	)
{
	return yytname[YYTRANSLATE(token)];
}


/* Initial Testing function -- ignore
int main(int argc, char *argv[])
{
	ip_file = FOPEN(argv[1], "r");
	if (!ip_file) {
		fprintf(stderr, "ERROR!! Could not open file: %s\n", argv[1]);
	}
	key_scanner = create_keyword_scanner(keyword_list);
	print_keyword_scanner(key_scanner, 0);
	yyparse();
	return 0;
}
*/


ntp-4.2.6p5/ntpd/refclock_palisade.h0000644000175000017500000001457011307651603016372 0ustar  peterpeter/*
 * This software was developed by the Software and Component Technologies
 * group of Trimble Navigation, Ltd.
 *
 * Copyright (c) 1997, 1998, 1999, 2000   Trimble Navigation Ltd.
 * 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.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *    This product includes software developed by Trimble Navigation, Ltd.
 * 4. The name of Trimble Navigation Ltd. may not be used to endorse or
 *    promote products derived from this software without specific prior
 *    written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY TRIMBLE NAVIGATION LTD. ``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 TRIMBLE NAVIGATION LTD. 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.
 */

/*
 * refclock_palisade - clock driver for the Trimble Palisade GPS
 * timing receiver
 *
 * For detailed information on this program, please refer to the html 
 * Refclock 29 page accompanying the NTP distribution.
 *
 * for questions / bugs / comments, contact:
 * sven_dietrich@trimble.com
 *
 * Sven-Thorsten Dietrich
 * 645 North Mary Avenue
 * Post Office Box 3642
 * Sunnyvale, CA 94088-3642
 *
 */

#ifndef _REFCLOCK_PALISADE_H
#define _REFCLOCK_PALISADE_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#if defined HAVE_SYS_MODEM_H
#include 
#ifndef __QNXNTO__
#define TIOCMSET MCSETA
#define TIOCMGET MCGETA
#define TIOCM_RTS MRTS
#endif
#endif

#ifdef HAVE_TERMIOS_H
# ifdef TERMIOS_NEEDS__SVID3
#  define _SVID3
# endif
# include 
# include 
# ifdef TERMIOS_NEEDS__SVID3
#  undef _SVID3
# endif
#endif

#ifdef HAVE_SYS_IOCTL_H
#include 
#endif

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_control.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"

/*
 * GPS Definitions
 */
#define	DESCRIPTION	"Trimble Palisade GPS" /* Long name */
#define	PRECISION	(-20)	/* precision assumed (about 1 us) */
#define	REFID		"GPS\0"	/* reference ID */
#define TRMB_MINPOLL    4	/* 16 seconds */
#define TRMB_MAXPOLL	5	/* 32 seconds */

/*
 * I/O Definitions
 */
#define	DEVICE		"/dev/palisade%d" 	/* device name and unit */
#define	SPEED232	B9600		  	/* uart speed (9600 baud) */

/*
 * TSIP Report Definitions
 */
#define LENCODE_8F0B	74	/* Length of TSIP 8F-0B Packet & header */
#define LENCODE_NTP     22	/* Length of Palisade NTP Packet */

#define LENCODE_8FAC    68      /* Length of Thunderbolt 8F-AC Position Packet*/
#define LENCODE_8FAB    17      /* Length of Thunderbolt Primary Timing Packet*/

/* Allowed Sub-Packet ID's */
#define PACKET_8F0B	0x0B
#define PACKET_NTP	0xAD

/* Thunderbolt Packets */
#define PACKET_8FAC     0xAC	/* Supplementary Thunderbolt Time Packet */
#define PACKET_8FAB     0xAB	/* Primary Thunderbolt Time Packet */
#define PACKET_6D	0x6D	/* Supplementary Thunderbolt Tracking Stats */
#define PACKET_41	0x41	/* Thunderbolt I dont know what this packet is, it's not documented on my manual*/

/* Acutime Packets */
#define PACKET_41A      0x41    /* GPS time */
#define PACKET_46       0x46    /* Receiver Health */

#define DLE 0x10
#define ETX 0x03

/* parse states */
#define TSIP_PARSED_EMPTY       0	
#define TSIP_PARSED_FULL        1
#define TSIP_PARSED_DLE_1       2
#define TSIP_PARSED_DATA        3
#define TSIP_PARSED_DLE_2       4

/* 
 * Leap-Insert and Leap-Delete are encoded as follows:
 * 	PALISADE_UTC_TIME set   and PALISADE_LEAP_PENDING set: INSERT leap
 */

#define PALISADE_LEAP_INPROGRESS 0x08 /* This is the leap flag			*/
#define PALISADE_LEAP_WARNING    0x04 /* GPS Leap Warning (see ICD-200) */
#define PALISADE_LEAP_PENDING    0x02 /* Leap Pending (24 hours)		*/
#define PALISADE_UTC_TIME        0x01 /* UTC time available				*/

#define mb(_X_) (up->rpt_buf[(_X_ + 1)]) /* shortcut for buffer access	*/

/* Conversion Definitions */
#define GPS_PI 		(3.1415926535898)
#define	R2D		(180.0/GPS_PI)

/*
 * Structure for build data packets for send (thunderbolt uses it only)
 * taken from Markus Prosch
 */
struct packettx
{
	short	size;
	u_char *data;
};

/*
 * Palisade unit control structure.
 */
struct palisade_unit {
	short		unit;		/* NTP refclock unit number */
	int 		polled;		/* flag to detect noreplies */
	char		leap_status;	/* leap second flag */
	char		rpt_status;	/* TSIP Parser State */
	short 		rpt_cnt;	/* TSIP packet length so far */
	char 		rpt_buf[BMAX]; 	/* packet assembly buffer */
	int		type;		/* Clock mode type */
};

/*
 * Function prototypes
 */

static	int	palisade_start		(int, struct peer *);
static	void	palisade_shutdown	(int, struct peer *);
static	void	palisade_receive	(struct peer *);
static	void	palisade_poll		(int, struct peer *);
static  void 	palisade_io		(struct recvbuf *);
int 		palisade_configure	(int, struct peer *);
int 		TSIP_decode		(struct peer *);
long		HW_poll			(struct refclockproc *);
float 		getfloat		(u_char *); 
double 		getdbl 			(u_char *);
short  		getint 			(u_char *);
long		getlong			(u_char *);


#ifdef PALISADE_SENDCMD_RESURRECTED
static  void	sendcmd			(struct packettx *buffer, int c);
#endif
static  void	sendsupercmd		(struct packettx *buffer, int c1, int c2);
static  void	sendbyte		(struct packettx *buffer, int b);
static  void	sendint			(struct packettx *buffer, int a);
static  int	sendetx			(struct packettx *buffer, int fd);
static  void	init_thunderbolt	(int fd);
static  void	init_acutime		(int fd);
#endif /* PALISADE_H */
ntp-4.2.6p5/ntpd/refclock_oncore.c0000644000175000017500000035547211505336022016074 0ustar  peterpeter/*
 * ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 *  wrote this file.  As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
 * ----------------------------------------------------------------------------
 *
 * refclock_oncore.c
 *
 * Driver for some of the various the Motorola Oncore GPS receivers.
 *   should work with Basic, PVT6, VP, UT, UT+, GT, GT+, SL, M12, M12+T
 *	The receivers with TRAIM (VP, UT, UT+, M12+T), will be more accurate
 *	than the others.
 *	The receivers without position hold (GT, GT+) will be less accurate.
 *
 * Tested with:
 *
 *		(UT)				   (VP)
 *   COPYRIGHT 1991-1997 MOTOROLA INC.	COPYRIGHT 1991-1996 MOTOROLA INC.
 *   SFTW P/N #     98-P36848P		SFTW P/N # 98-P36830P
 *   SOFTWARE VER # 2			SOFTWARE VER # 8
 *   SOFTWARE REV # 2			SOFTWARE REV # 8
 *   SOFTWARE DATE  APR 24 1998 	SOFTWARE DATE  06 Aug 1996
 *   MODEL #	R1121N1114		MODEL #    B4121P1155
 *   HWDR P/N # 1			HDWR P/N # _
 *   SERIAL #	R0010A			SERIAL #   SSG0226478
 *   MANUFACTUR DATE 6H07		MANUFACTUR DATE 7E02
 *					OPTIONS LIST	IB
 *
 *	      (Basic)				   (M12)
 *   COPYRIGHT 1991-1994 MOTOROLA INC.	COPYRIGHT 1991-2000 MOTOROLA INC.
 *   SFTW P/N # 98-P39949M		SFTW P/N # 61-G10002A
 *   SOFTWARE VER # 5			SOFTWARE VER # 1
 *   SOFTWARE REV # 0			SOFTWARE REV # 3
 *   SOFTWARE DATE  20 JAN 1994 	SOFTWARE DATE  Mar 13 2000
 *   MODEL #	A11121P116		MODEL #    P143T12NR1
 *   HDWR P/N # _			HWDR P/N # 1
 *   SERIAL #	SSG0049809		SERIAL #   P003UD
 *   MANUFACTUR DATE 417AMA199		MANUFACTUR DATE 0C27
 *   OPTIONS LIST    AB
 *
 *	      (M12+T)				  (M12+T later version)
 *   COPYRIGHT 1991-2002 MOTOROLA INC.	COPYRIGHT 1991-2003 MOTOROLA INC.
 *   SFTW P/N #     61-G10268A		SFTW P/N #     61-G10268A
 *   SOFTWARE VER # 2			SOFTWARE VER # 2
 *   SOFTWARE REV # 0			SOFTWARE REV # 1
 *   SOFTWARE DATE  AUG 14 2002 	SOFTWARE DATE  APR 16 2003
 *   MODEL #	P283T12T11		MODEL #    P273T12T12
 *   HWDR P/N # 2			HWDR P/N # 2
 *   SERIAL #	P04DC2			SERIAL #   P05Z7Z
 *   MANUFACTUR DATE 2J17		MANUFACTUR DATE 3G15
 *
 * --------------------------------------------------------------------------
 * Reg Clemens (June 2009)
 * BUG[1220] OK, big patch, but mostly done mechanically.  Change direct calls to write
 * to clockstats to a call to oncore_log, which now calls the old routine plus msyslog.
 * Have to set the LOG_LEVELS of the calls for msyslog, and this was done by hand. New
 * routine oncore_log.
 * --------------------------------------------------------------------------
 * Reg Clemens (June 2009)
 * BUG[1218] The comment on where the oncore driver gets its input file does not
 * agree with the code.  Change the comment.
 * --------------------------------------------------------------------------
 * Reg Clemens (June 2009)
 * change exit statements to return(0) in main program.  I had assumed that if the
 * PPS driver did not start for some reason, we shuould stop NTPD itelf.  Others
 * disagree.  We now give an ERR log message and stop this driver.
 * --------------------------------------------------------------------------
 * Reg Clemens (June 2009)
 * A bytes available message for the input subsystem (Debug message).
 * --------------------------------------------------------------------------
 * Reg Clemens (Nov 2008)
 * This code adds a message for TRAIM messages.  Users often worry about the
 * driver not starting up, and it is often because of signal strength being low.
 * Low signal strength will give TRAIM messages.
 * --------------------------------------------------------------------------
 * Reg Clemens (Nov 2008)
 * Add waiting on Almanac Message.
 * --------------------------------------------------------------------------
 * Reg Clemens (Nov 2008)
 * Add back in @@Bl code to do the @@Bj/@@Gj that is in later ONCOREs
 * LEAP SECONDS: All of the ONCORE receivers, VP -> M12T have the @@Bj command
 * that says 'Leap Pending'.  As documented it only becomes true in the month
 * before the leap second is to be applied, but in practice at least some of
 * the receivers turn this indicator on as soon as the message is posted, which
 * can be 6months early.  As such, we use the Bj command to turn on the
 * instance->pp->leap indicator but only run this test in December and June for
 * updates on 1Jan and 1July.
 *
 * The @@Gj command exists in later ONCOREs, and it gives the exact date
 * and size of the Leap Update.  It can be emulated in the VP using the @@Bl
 * command which reads the raw Satellite Broadcast Messages.
 * We use these two commands to print informative messages in the clockstats
 * file once per day as soon as the message appears on the satellites.
 * --------------------------------------------------------------------------
 * Reg Clemens (Feb 2006)
 * Fix some gcc4 compiler complaints
 * Fix possible segfault in oncore_init_shmem
 * change all (possible) fprintf(stderr, to record_clock_stats
 * Apply patch from Russell J. Yount  Fixed (new) MT12+T UTC not correct
 *   immediately after new Almanac Read.
 * Apply patch for new PPS implementation by Rodolfo Giometti 
 *   now code can use old Ulrich Windl  or
 *   the new one.  Compiles depending on timepps.h seen.
 * --------------------------------------------------------------------------
 * Luis Batanero Guerrero  (Dec 2005) Patch for leap seconds
 * (the oncore driver was setting the wrong ntpd variable)
 * --------------------------------------------------------------------------
 * Reg.Clemens (Mar 2004)
 * Support for interfaces other than PPSAPI removed, for Solaris, SunOS,
 * SCO, you now need to use one of the timepps.h files in the root dir.
 * this driver will 'grab' it for you if you dont have one in /usr/include
 * --------------------------------------------------------------------------
 * This code uses the two devices
 *	/dev/oncore.serial.n
 *	/dev/oncore.pps.n
 * which may be linked to the same device.
 * and can read initialization data from the file
 *	/etc/ntp.oncoreN, /etc/ntp.oncore.N, or /etc/ntp.oncore, where
 *	n or N are the unit number, viz 127.127.30.N.
 * --------------------------------------------------------------------------
 * Reg.Clemens  Sep98.
 *  Original code written for FreeBSD.
 *  With these mods it works on FreeBSD, SunOS, Solaris and Linux
 *    (SunOS 4.1.3 + ppsclock)
 *    (Solaris7 + MU4)
 *    (RedHat 5.1 2.0.35 + PPSKit, 2.1.126 + or later).
 *
 *  Lat,Long,Ht, cable-delay, offset, and the ReceiverID (along with the
 *  state machine state) are printed to CLOCKSTATS if that file is enabled
 *  in /etc/ntp.conf.
 *
 * --------------------------------------------------------------------------
 *
 * According to the ONCORE manual (TRM0003, Rev 3.2, June 1998, page 3.13)
 * doing an average of 10000 valid 2D and 3D fixes is what the automatic
 * site survey mode does.  Looking at the output from the receiver
 * it seems like it is only using 3D fixes.
 * When we do it ourselves, take 10000 3D fixes.
 */

#define POS_HOLD_AVERAGE	10000	/* nb, 10000s ~= 2h45m */

/*
 * ONCORE_SHMEM_STATUS will create a mmap(2)'ed file named according to a
 * "STATUS" line in the oncore config file, which contains the most recent
 * copy of all types of messages we recognize.	This file can be mmap(2)'ed
 * by monitoring and statistics programs.
 *
 * See separate HTML documentation for this option.
 */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_ONCORE)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_unixtime.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"

#include 
#include 
#include 
#ifdef ONCORE_SHMEM_STATUS
# ifdef HAVE_SYS_MMAN_H
#  include 
#  ifndef MAP_FAILED
#   define MAP_FAILED ((u_char *) -1)
#  endif  /* MAP_FAILED */
# endif /* HAVE_SYS_MMAN_H */
#endif /* ONCORE_SHMEM_STATUS */

#ifdef HAVE_PPSAPI
# include "ppsapi_timepps.h"
#endif

#ifdef HAVE_SYS_SIO_H
# include 
#endif

struct Bl {
	int	dt_ls;
	int	dt_lsf;
	int	WN;
	int	DN;
	int	WN_lsf;
	int	DN_lsf;
	int	wn_flg;
	int	lsf_flg;
	int	Bl_day;
} Bl;

enum receive_state {
	ONCORE_NO_IDEA,
	ONCORE_CHECK_ID,
	ONCORE_CHECK_CHAN,
	ONCORE_HAVE_CHAN,
	ONCORE_RESET_SENT,
	ONCORE_TEST_SENT,
	ONCORE_INIT,
	ONCORE_ALMANAC,
	ONCORE_RUN
};

enum site_survey_state {
	ONCORE_SS_UNKNOWN,
	ONCORE_SS_TESTING,
	ONCORE_SS_HW,
	ONCORE_SS_SW,
	ONCORE_SS_DONE
};

enum antenna_state {
      ONCORE_ANTENNA_UNKNOWN = -1,
      ONCORE_ANTENNA_OK      =	0,
      ONCORE_ANTENNA_OC      =	1,
      ONCORE_ANTENNA_UC      =	2,
      ONCORE_ANTENNA_NV      =	3
};

/* Model Name, derived from the @@Cj message.
 * Used to initialize some variables.
 */

enum oncore_model {
	ONCORE_BASIC,
	ONCORE_PVT6,
	ONCORE_VP,
	ONCORE_UT,
	ONCORE_UTPLUS,
	ONCORE_GT,
	ONCORE_GTPLUS,
	ONCORE_SL,
	ONCORE_M12,
	ONCORE_UNKNOWN
};

/* the bits that describe these properties are in the same place
 * on the VP/UT, but have moved on the M12.  As such we extract
 * them, and use them from this struct.
 *
 */

struct RSM {
	u_char	posn0D;
	u_char	posn2D;
	u_char	posn3D;
	u_char	bad_almanac;
	u_char	bad_fix;
};

/* It is possible to test the VP/UT each cycle (@@Ea or equivalent) to
 * see what mode it is in.  The bits on the M12 are multiplexed with
 * other messages, so we have to 'keep' the last known mode here.
 */

enum posn_mode {
	MODE_UNKNOWN,
	MODE_0D,
	MODE_2D,
	MODE_3D
};

struct instance {
	int	unit;		/* 127.127.30.unit */
	struct	refclockproc *pp;
	struct	peer *peer;

	int	ttyfd;		/* TTY file descriptor */
	int	ppsfd;		/* PPS file descriptor */
	int	shmemfd;	/* Status shm descriptor */
	pps_handle_t pps_h;
	pps_params_t pps_p;
	enum receive_state o_state;		/* Receive state */
	enum posn_mode mode;			/* 0D, 2D, 3D */
	enum site_survey_state site_survey;	/* Site Survey state */
	enum antenna_state ant_state;		/* antenna state */

	int	Bj_day;

	u_long	delay;		/* ns */
	long	offset; 	/* ns */

	u_char	*shmem;
	char	*shmem_fname;
	u_int	shmem_Cb;
	u_int	shmem_Ba;
	u_int	shmem_Ea;
	u_int	shmem_Ha;
	u_char	shmem_reset;
	u_char	shmem_Posn;
	u_char	shmem_bad_Ea;
	u_char	almanac_from_shmem;

	double	ss_lat;
	double	ss_long;
	double	ss_ht;
	double	dH;
	int	ss_count;
	u_char	posn_set;

	enum oncore_model model;
	u_int	version;
	u_int	revision;

	u_char	chan;		/* 6 for PVT6 or BASIC, 8 for UT/VP, 12 for m12, 0 if unknown */
	s_char	traim;		/* do we have traim? yes UT/VP, M12+T, no BASIC, GT, M12, -1 unknown, 0 no, +1 yes */
				/* the following 7 are all timing counters */
	u_char	traim_delay;	/* seconds counter, waiting for reply */
	u_char	count;		/* cycles thru Ea before starting */
	u_char	count1; 	/* cycles thru Ea after SS_TESTING, waiting for SS_HW */
	u_char	count2; 	/* cycles thru Ea after count, to check for @@Ea */
	u_char	count3; 	/* cycles thru Ea checking for # channels */
	u_char	count4; 	/* cycles thru leap after Gj to issue Bj */
	u_char	count5; 	/* cycles thru get_timestamp waiting for valid UTC correction */
	u_char	count5_set;	/* only set count5 once */
	u_char	counta; 	/* count for waiting on almanac message */
	u_char	pollcnt;
	u_char	timeout;	/* count to retry Cj after Fa self-test */
	u_char	max_len;	/* max length message seen by oncore_log, for debugging */
	u_char	max_count;	/* count for message statistics */

	struct	RSM rsm;	/* bits extracted from Receiver Status Msg in @@Ea */
	struct	Bl Bl;		/* Satellite Broadcast Data Message */
	u_char	printed;
	u_char	polled;
	u_long	ev_serial;
	int	Rcvptr;
	u_char	Rcvbuf[500];
	u_char	BEHa[160];	/* Ba, Ea or Ha */
	u_char	BEHn[80];	/* Bn , En , or Hn */
	u_char	Cj[300];
	u_char	Ag;		/* Satellite mask angle */
	u_char	saw_At;
	u_char	saw_Ay;
	u_char	saw_Az;
	s_char	saw_Bj;
	s_char	saw_Gj;
	u_char	have_dH;
	u_char	init_type;
	s_char	saw_tooth;
	s_char	chan_in;	/* chan number from INPUT, will always use it */
	u_char	chan_id;	/* chan number determined from part number */
	u_char	chan_ck;	/* chan number determined by sending commands to hardware */
	s_char	traim_in;	/* TRAIM from INPUT, will always use ON/OFF specified */
	s_char	traim_id;	/* TRAIM determined from part number */
	u_char	traim_ck;	/* TRAIM determined by sending commands to hardware */
	u_char	once;		/* one pass code at top of BaEaHa */
	s_char	assert;
	u_char	hardpps;
};

#define rcvbuf	instance->Rcvbuf
#define rcvptr	instance->Rcvptr

static	int	oncore_start	      (int, struct peer *);
static	void	oncore_poll	      (int, struct peer *);
static	void	oncore_shutdown       (int, struct peer *);
static	void	oncore_consume	      (struct instance *);
static	void	oncore_read_config    (struct instance *);
static	void	oncore_receive	      (struct recvbuf *);
static	int	oncore_ppsapi	      (struct instance *);
static	void	oncore_get_timestamp  (struct instance *, long, long);
static	void	oncore_init_shmem     (struct instance *);

static	void	oncore_antenna_report (struct instance *, enum antenna_state);
static	void	oncore_chan_test      (struct instance *);
static	void	oncore_check_almanac  (struct instance *);
static	void	oncore_check_antenna  (struct instance *);
static	void	oncore_check_leap_sec (struct instance *);
static	int	oncore_checksum_ok    (u_char *, int);
static	void	oncore_compute_dH     (struct instance *);
static	void	oncore_load_almanac   (struct instance *);
static	void	oncore_log	      (struct instance *, int, const char *);
static	void	oncore_print_Cb       (struct instance *, u_char *);
/* static  void    oncore_print_array	 (u_char *, int);	*/
static	void	oncore_print_posn     (struct instance *);
static	void	oncore_sendmsg	      (struct instance *, u_char *, size_t);
static	void	oncore_set_posn       (struct instance *);
static	void	oncore_set_traim      (struct instance *);
static	void	oncore_shmem_get_3D   (struct instance *);
static	void	oncore_ss	      (struct instance *);
static	int	oncore_wait_almanac   (struct instance *);

static	void	oncore_msg_any	   (struct instance *, u_char *, size_t, int);
static	void	oncore_msg_Adef    (struct instance *, u_char *, size_t);
static	void	oncore_msg_Ag	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_As	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_At	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_Ay	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_Az	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_BaEaHa  (struct instance *, u_char *, size_t);
static	void	oncore_msg_Bd	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_Bj	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_Bl	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_BnEnHn  (struct instance *, u_char *, size_t);
static	void	oncore_msg_CaFaIa  (struct instance *, u_char *, size_t);
static	void	oncore_msg_Cb	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_Cf	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_Cj	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_Cj_id   (struct instance *, u_char *, size_t);
static	void	oncore_msg_Cj_init (struct instance *, u_char *, size_t);
static	void	oncore_msg_Ga	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_Gb	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_Gj	   (struct instance *, u_char *, size_t);
static	void	oncore_msg_Sz	   (struct instance *, u_char *, size_t);

struct	refclock refclock_oncore = {
	oncore_start,		/* start up driver */
	oncore_shutdown,	/* shut down driver */
	oncore_poll,		/* transmit poll message */
	noentry,		/* not used */
	noentry,		/* not used */
	noentry,		/* not used */
	NOFLAGS 		/* not used */
};

/*
 * Understanding the next bit here is not easy unless you have a manual
 * for the the various Oncore Models.
 */

static struct msg_desc {
	const char	flag[3];
	const int	len;
	void		(*handler) (struct instance *, u_char *, size_t);
	const char	*fmt;
	int		shmem;
} oncore_messages[] = {
			/* Ea and En first since they're most common */
	{ "Ea",  76,    oncore_msg_BaEaHa, "mdyyhmsffffaaaaoooohhhhmmmmvvhhddtntimsdimsdimsdimsdimsdimsdimsdimsdsC" },
	{ "Ba",  68,    oncore_msg_BaEaHa, "mdyyhmsffffaaaaoooohhhhmmmmvvhhddtntimsdimsdimsdimsdimsdimsdsC" },
	{ "Ha", 154,    oncore_msg_BaEaHa, "mdyyhmsffffaaaaoooohhhhmmmmaaaaoooohhhhmmmmVVvvhhddntimsiddimsiddimsiddimsiddimsiddimsiddimsiddimsiddimsiddimsiddimsiddimsiddssrrccooooTTushmvvvvvvC" },
	{ "Bn",  59,    oncore_msg_BnEnHn, "otaapxxxxxxxxxxpysreensffffsffffsffffsffffsffffsffffC" },
	{ "En",  69,    oncore_msg_BnEnHn, "otaapxxxxxxxxxxpysreensffffsffffsffffsffffsffffsffffsffffsffffC" },
	{ "Hn",  78,    oncore_msg_BnEnHn, "" },
	{ "Ab",  10,    0,                 "" },
	{ "Ac",  11,    0,                 "" },
	{ "Ad",  11,    oncore_msg_Adef,   "" },
	{ "Ae",  11,    oncore_msg_Adef,   "" },
	{ "Af",  15,    oncore_msg_Adef,   "" },
	{ "Ag",   8,    oncore_msg_Ag,     "" }, /* Satellite mask angle */
	{ "As",  20,    oncore_msg_As,     "" },
	{ "At",   8,    oncore_msg_At,     "" },
	{ "Au",  12,    0,                 "" },
	{ "Av",   8,    0,                 "" },
	{ "Aw",   8,    0,                 "" },
	{ "Ay",  11,    oncore_msg_Ay,     "" },
	{ "Az",  11,    oncore_msg_Az,     "" },
	{ "AB",   8,    0,                 "" },
	{ "Bb",  92,    0,                 "" },
	{ "Bd",  23,    oncore_msg_Bd,     "" },
	{ "Bj",   8,    oncore_msg_Bj,     "" },
	{ "Bl",  41,    oncore_msg_Bl,     "" },
	{ "Ca",   9,    oncore_msg_CaFaIa, "" },
	{ "Cb",  33,    oncore_msg_Cb,     "" },
	{ "Cf",   7,    oncore_msg_Cf,     "" },
	{ "Cg",   8,    0,                 "" },
	{ "Ch",   9,    0,                 "" },
	{ "Cj", 294,    oncore_msg_Cj,     "" },
	{ "Ek",  71,    0,                 "" },
	{ "Fa",   9,    oncore_msg_CaFaIa, "" },
	{ "Ga",  20,    oncore_msg_Ga,     "" },
	{ "Gb",  17,    oncore_msg_Gb,     "" },
	{ "Gc",   8,    0,                 "" },
	{ "Gd",   8,    0,                 "" },
	{ "Ge",   8,    0,                 "" },
	{ "Gj",  21,    oncore_msg_Gj,     "" },
	{ "Ia",  10,    oncore_msg_CaFaIa, "" },
	{ "Sz",   8,    oncore_msg_Sz,     "" },
	{ {0},	  7,	0,		   "" }
};


static u_char oncore_cmd_Aa[]  = { 'A', 'a', 0, 0, 0 }; 			    /* 6/8	Time of Day				*/
static u_char oncore_cmd_Ab[]  = { 'A', 'b', 0, 0, 0 }; 			    /* 6/8	GMT Correction				*/
static u_char oncore_cmd_AB[]  = { 'A', 'B', 4 };				    /* VP	Application Type: Static		*/
static u_char oncore_cmd_Ac[]  = { 'A', 'c', 0, 0, 0, 0 };			    /* 6/8	Date					*/
static u_char oncore_cmd_Ad[]  = { 'A', 'd', 0,0,0,0 }; 			    /* 6/8	Latitude				*/
static u_char oncore_cmd_Ae[]  = { 'A', 'e', 0,0,0,0 }; 			    /* 6/8	Longitude				*/
static u_char oncore_cmd_Af[]  = { 'A', 'f', 0,0,0,0, 0 };			    /* 6/8	Height					*/
static u_char oncore_cmd_Ag[]  = { 'A', 'g', 0 };				    /* 6/8/12	Satellite Mask Angle			*/
static u_char oncore_cmd_Agx[] = { 'A', 'g', 0xff };				    /* 6/8/12	Satellite Mask Angle: read		*/
static u_char oncore_cmd_As[]  = { 'A', 's', 0,0,0,0, 0,0,0,0, 0,0,0,0, 0 };	    /* 6/8/12	Posn Hold Parameters			*/
static u_char oncore_cmd_Asx[] = { 'A', 's', 0x7f,0xff,0xff,0xff,		    /* 6/8/12	Posn Hold Readback			*/
					     0x7f,0xff,0xff,0xff,		    /*		 on UT+ this doesnt work with 0xff	*/
					     0x7f,0xff,0xff,0xff, 0xff };	    /*		 but does work with 0x7f (sigh).	*/
static u_char oncore_cmd_At0[] = { 'A', 't', 0 };				    /* 6/8	Posn Hold: off				*/
static u_char oncore_cmd_At1[] = { 'A', 't', 1 };				    /* 6/8	Posn Hold: on				*/
static u_char oncore_cmd_At2[] = { 'A', 't', 2 };				    /* 6/8	Posn Hold: Start Site Survey		*/
static u_char oncore_cmd_Atx[] = { 'A', 't', 0xff };				    /* 6/8	Posn Hold: Read Back			*/
static u_char oncore_cmd_Au[]  = { 'A', 'u', 0,0,0,0, 0 };			    /* GT/M12	Altitude Hold Ht.			*/
static u_char oncore_cmd_Av0[] = { 'A', 'v', 0 };				    /* VP/GT	Altitude Hold: off			*/
static u_char oncore_cmd_Av1[] = { 'A', 'v', 1 };				    /* VP/GT	Altitude Hold: on			*/
static u_char oncore_cmd_Aw[]  = { 'A', 'w', 1 };				    /* 6/8/12	UTC/GPS time selection			*/
static u_char oncore_cmd_Ay[]  = { 'A', 'y', 0, 0, 0, 0 };			    /* Timing	1PPS time offset: set			*/
static u_char oncore_cmd_Ayx[] = { 'A', 'y', 0xff, 0xff, 0xff, 0xff };		    /* Timing	1PPS time offset: Read			*/
static u_char oncore_cmd_Az[]  = { 'A', 'z', 0, 0, 0, 0 };			    /* 6/8UT/12 1PPS Cable Delay: set			*/
static u_char oncore_cmd_Azx[] = { 'A', 'z', 0xff, 0xff, 0xff, 0xff };		    /* 6/8UT/12 1PPS Cable Delay: Read			*/
static u_char oncore_cmd_Ba0[] = { 'B', 'a', 0 };				    /* 6	Position/Data/Status: off		*/
static u_char oncore_cmd_Ba[]  = { 'B', 'a', 1 };				    /* 6	Position/Data/Status: on		*/
static u_char oncore_cmd_Bb[]  = { 'B', 'b', 1 };				    /* 6/8/12	Visible Satellites			*/
static u_char oncore_cmd_Bd[]  = { 'B', 'd', 1 };				    /* 6/8/12?	Almanac Status Msg.			*/
static u_char oncore_cmd_Be[]  = { 'B', 'e', 1 };				    /* 6/8/12	Request Almanac Data			*/
static u_char oncore_cmd_Bj[]  = { 'B', 'j', 0 };				    /* 6/8	Leap Second Pending			*/
static u_char oncore_cmd_Bl[]  = { 'B', 'l', 1 };				    /* VP	Satellite Broadcast Data Msg		*/
static u_char oncore_cmd_Bn0[] = { 'B', 'n', 0, 1, 0,10, 2, 0,0,0, 0,0,0,0,0,0,0 }; /* 6	TRAIM setup/status: msg off, traim on	*/
static u_char oncore_cmd_Bn[]  = { 'B', 'n', 1, 1, 0,10, 2, 0,0,0, 0,0,0,0,0,0,0 }; /* 6	TRAIM setup/status: msg on,  traim on	*/
static u_char oncore_cmd_Bnx[] = { 'B', 'n', 0, 0, 0,10, 2, 0,0,0, 0,0,0,0,0,0,0 }; /* 6	TRAIM setup/status: msg off, traim off	*/
static u_char oncore_cmd_Ca[]  = { 'C', 'a' };					    /* 6	Self Test				*/
static u_char oncore_cmd_Cf[]  = { 'C', 'f' };					    /* 6/8/12	Set to Defaults 			*/
static u_char oncore_cmd_Cg[]  = { 'C', 'g', 1 };				    /* VP	Posn Fix/Idle Mode			*/
static u_char oncore_cmd_Cj[]  = { 'C', 'j' };					    /* 6/8/12	Receiver ID				*/
static u_char oncore_cmd_Ea0[] = { 'E', 'a', 0 };				    /* 8	Position/Data/Status: off		*/
static u_char oncore_cmd_Ea[]  = { 'E', 'a', 1 };				    /* 8	Position/Data/Status: on		*/
static u_char oncore_cmd_Ek[]  = { 'E', 'k', 0 }; /* just turn off */		    /* 8	Posn/Status/Data - extension		*/
static u_char oncore_cmd_En0[] = { 'E', 'n', 0, 1, 0,10, 2, 0,0,0, 0,0,0,0,0,0,0 }; /* 8/GT	TRAIM setup/status: msg off, traim on	*/
static u_char oncore_cmd_En[]  = { 'E', 'n', 1, 1, 0,10, 2, 0,0,0, 0,0,0,0,0,0,0 }; /* 8/GT	TRAIM setup/status: msg on,  traim on	*/
static u_char oncore_cmd_Enx[] = { 'E', 'n', 0, 0, 0,10, 2, 0,0,0, 0,0,0,0,0,0,0 }; /* 8/GT	TRAIM setup/status: msg off, traim off	*/
static u_char oncore_cmd_Fa[]  = { 'F', 'a' };					    /* 8	Self Test				*/
static u_char oncore_cmd_Ga[]  = { 'G', 'a', 0,0,0,0, 0,0,0,0, 0,0,0,0, 0 };	    /* 12	Position Set				*/
static u_char oncore_cmd_Gax[] = { 'G', 'a', 0xff, 0xff, 0xff, 0xff,		    /* 12	Position Set: Read			*/
					     0xff, 0xff, 0xff, 0xff,		    /*							*/
					     0xff, 0xff, 0xff, 0xff, 0xff };	    /*							*/
static u_char oncore_cmd_Gb[]  = { 'G', 'b', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };	    /* 12	set Date/Time				*/
static u_char oncore_cmd_Gc[]  = { 'G', 'c', 1 };				    /* 12	PPS Control: On Cont			*/
static u_char oncore_cmd_Gd0[] = { 'G', 'd', 0 };				    /* 12	Position Control: 3D (no hold)		*/
static u_char oncore_cmd_Gd1[] = { 'G', 'd', 1 };				    /* 12	Position Control: 0D (3D hold)		*/
static u_char oncore_cmd_Gd2[] = { 'G', 'd', 2 };				    /* 12	Position Control: 2D (Alt Hold) 	*/
static u_char oncore_cmd_Gd3[] = { 'G', 'd', 3 };				    /* 12	Position Coltrol: Start Site Survey	*/
static u_char oncore_cmd_Ge0[] = { 'G', 'e', 0 };				    /* M12+T	TRAIM: off				*/
static u_char oncore_cmd_Ge[]  = { 'G', 'e', 1 };				    /* M12+T	TRAIM: on				*/
static u_char oncore_cmd_Gj[]  = { 'G', 'j' };					    /* 8?/12	Leap Second Pending			*/
static u_char oncore_cmd_Ha0[] = { 'H', 'a', 0 };				    /* 12	Position/Data/Status: off		*/
static u_char oncore_cmd_Ha[]  = { 'H', 'a', 1 };				    /* 12	Position/Data/Status: on		*/
static u_char oncore_cmd_Hn0[] = { 'H', 'n', 0 };				    /* 12	TRAIM Status: off			*/
static u_char oncore_cmd_Hn[]  = { 'H', 'n', 1 };				    /* 12	TRAIM Status: on			*/
static u_char oncore_cmd_Ia[]  = { 'I', 'a' };					    /* 12	Self Test				*/

/* it appears that as of 1997/1998, the UT had As,At, but not Au,Av
 *				    the GT had Au,Av, but not As,At
 * This was as of v2.0 of both firmware sets. possibly 1.3 for UT.
 * Bj in UT at v1.3
 * dont see Bd in UT/GT thru 1999
 * Gj in UT as of 3.0, 1999 , Bj as of 1.3
 */

static char *Month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jly",
	"Aug", "Sep", "Oct", "Nov", "Dec" };

#define DEVICE1 	"/dev/oncore.serial.%d" /* name of serial device */
#define DEVICE2 	"/dev/oncore.pps.%d"    /* name of pps device */

#define SPEED		B9600		/* Oncore Binary speed (9600 bps) */

/*
 * Assemble and disassemble 32bit signed quantities from a buffer.
 *
 */

	/* to buffer, int w, u_char *buf */
#define w32_buf(buf,w)	{ u_int i_tmp;			   \
			  i_tmp = (w<0) ? (~(-w)+1) : (w); \
			  (buf)[0] = (i_tmp >> 24) & 0xff; \
			  (buf)[1] = (i_tmp >> 16) & 0xff; \
			  (buf)[2] = (i_tmp >>	8) & 0xff; \
			  (buf)[3] = (i_tmp	 ) & 0xff; \
			}

#define w32(buf)      (((buf)[0]&0xff) << 24 | \
		       ((buf)[1]&0xff) << 16 | \
		       ((buf)[2]&0xff) <<  8 | \
		       ((buf)[3]&0xff) )

	/* from buffer, char *buf, result to an int */
#define buf_w32(buf) (((buf)[0]&0200) ? (-(~w32(buf)+1)) : w32(buf))


/*
 * oncore_start - initialize data for processing
 */

static int
oncore_start(
	int unit,
	struct peer *peer
	)
{
#define STRING_LEN	32
	register struct instance *instance;
	struct refclockproc *pp;
	int fd1, fd2;
	char device1[STRING_LEN], device2[STRING_LEN], Msg[160];
	struct stat stat1, stat2;

	/* create instance structure for this unit */

	instance = emalloc(sizeof(*instance));
	memset(instance, 0, sizeof(*instance));

	/* initialize miscellaneous variables */

	pp = peer->procptr;
	pp->unitptr    = (caddr_t) instance;
	instance->pp   = pp;
	instance->unit = unit;
	instance->peer = peer;
	instance->assert = 1;
	instance->once = 1;

	instance->Bj_day = -1;
	instance->traim = -1;
	instance->traim_in = -1;
	instance->chan_in = -1;
	instance->model = ONCORE_UNKNOWN;
	instance->mode = MODE_UNKNOWN;
	instance->site_survey = ONCORE_SS_UNKNOWN;
	instance->Ag = 0xff;		/* Satellite mask angle, unset by user */
	instance->ant_state = ONCORE_ANTENNA_UNKNOWN;

	peer->precision = -26;
	peer->minpoll = 4;
	peer->maxpoll = 4;
	pp->clockdesc = "Motorola Oncore GPS Receiver";
	memcpy((char *)&pp->refid, "GPS\0", (size_t) 4);

	oncore_log(instance, LOG_NOTICE, "ONCORE DRIVER -- CONFIGURING");
	instance->o_state = ONCORE_NO_IDEA;
	oncore_log(instance, LOG_NOTICE, "state = ONCORE_NO_IDEA");

	/* Now open files.
	 * This is a bit complicated, a we dont want to open the same file twice
	 * (its a problem on some OS), and device2 may not exist for the new PPS
	 */

	(void)snprintf(device1, sizeof(device1), DEVICE1, unit);
	(void)snprintf(device2, sizeof(device2), DEVICE2, unit);

	/* OPEN DEVICES */
	/* opening different devices for fd1 and fd2 presents no problems */
	/* opening the SAME device twice, seems to be OS dependent.
		(a) on Linux (no streams) no problem
		(b) on SunOS (and possibly Solaris, untested), (streams)
			never see the line discipline.
	   Since things ALWAYS work if we only open the device once, we check
	     to see if the two devices are in fact the same, then proceed to
	     do one open or two.

	   For use with linuxPPS we assume that the N_TTY file has been opened
	     and that the line discipline has been changed to N_PPS by another
	     program (say ppsldisc) so that the two files expected by the oncore
	     driver can be opened.

	   Note that the linuxPPS N_PPS file is just like a N_TTY, so we can do
	     the stat below without error even though the file has already had its
	     line discipline changed by another process.

	   The Windows port of ntpd arranges to return duplicate handles for
	     multiple opens of the same serial device, and doesn't have inodes
	     for serial handles, so we just open both on Windows.
	*/
#ifndef SYS_WINNT
	if (stat(device1, &stat1)) {
		snprintf(Msg, sizeof(Msg), "Can't stat fd1 (%s)",
			 device1);
		oncore_log(instance, LOG_ERR, Msg);
		return(0);			/* exit, no file, can't start driver */
	}

	if (stat(device2, &stat2)) {
		stat2.st_dev = stat2.st_ino = -2;
		snprintf(Msg, sizeof(Msg),
			 "Can't stat fd2 (%s) errno = %d",
			 device2, errno);
		oncore_log(instance, LOG_ERR, Msg);
	}
#endif	/* !SYS_WINNT */

	if (!(fd1 = refclock_open(device1, SPEED, LDISC_RAW))) {
		snprintf(Msg, sizeof(Msg), "Can't open fd1 (%s)",
			 device1);
		oncore_log(instance, LOG_ERR, Msg);
		return(0);			/* exit, can't open file, can't start driver */
	}

	/* for LINUX the PPS device is the result of a line discipline.
	   It seems simplest to let an external program create the appropriate
	   /dev/pps file, and only check (carefully) for its existance here
	 */

#ifndef SYS_WINNT
	if ((stat1.st_dev == stat2.st_dev) && (stat1.st_ino == stat2.st_ino))	/* same device here */
		fd2 = fd1;
	else
#endif	/* !SYS_WINNT */
	{	/* different devices here */
		if ((fd2=tty_open(device2, O_RDWR, 0777)) < 0) {
			snprintf(Msg, sizeof(Msg),
				"Can't open fd2 (%s)", device2);
			oncore_log(instance, LOG_ERR, Msg);
			return(0);		/* exit, can't open PPS file, can't start driver */
		}
	}

	/* open ppsapi source */

	if (time_pps_create(fd2, &instance->pps_h) < 0) {
		oncore_log(instance, LOG_ERR, "exit, PPSAPI not found in kernel");
		return(0);			/* exit, don't find PPSAPI in kernel */
	}

	/* continue initialization */

	instance->ttyfd = fd1;
	instance->ppsfd = fd2;

	/* go read any input data in /etc/ntp.oncoreX or /etc/ntp/oncore.X */

	oncore_read_config(instance);

	if (!oncore_ppsapi(instance))
		return(0);

	pp->io.clock_recv = oncore_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd1;
	if (!io_addclock(&pp->io)) {
		oncore_log(instance, LOG_ERR, "can't do io_addclock");
		(void) close(fd1);
		free(instance);
		return (0);
	}

#ifdef ONCORE_SHMEM_STATUS
	/*
	 * Before starting ONCORE, lets setup SHMEM
	 * This will include merging an old SHMEM into the new one if
	 * an old one is found.
	 */

	oncore_init_shmem(instance);
#endif

	/*
	 * This will return the Model of the Oncore receiver.
	 * and start the Initialization loop in oncore_msg_Cj.
	 */

	instance->o_state = ONCORE_CHECK_ID;
	oncore_log(instance, LOG_NOTICE, "state = ONCORE_CHECK_ID");

	instance->timeout = 4;
	oncore_sendmsg(instance, oncore_cmd_Cg, sizeof(oncore_cmd_Cg)); /* Set Posn Fix mode (not Idle (VP)) */
	oncore_sendmsg(instance, oncore_cmd_Cj, sizeof(oncore_cmd_Cj));

	instance->pollcnt = 2;
	return (1);
}


/*
 * oncore_shutdown - shut down the clock
 */

static void
oncore_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct instance *instance;
	struct refclockproc *pp;

	pp = peer->procptr;
	instance = (struct instance *) pp->unitptr;

	io_closeclock(&pp->io);

	time_pps_destroy (instance->pps_h);

	close(instance->ttyfd);

	if ((instance->ppsfd != -1) && (instance->ppsfd != instance->ttyfd))
		close(instance->ppsfd);

	if (instance->shmemfd)
		close(instance->shmemfd);

	free(instance);
}



/*
 * oncore_poll - called by the transmit procedure
 */

static void
oncore_poll(
	int unit,
	struct peer *peer
	)
{
	struct instance *instance;

	instance = (struct instance *) peer->procptr->unitptr;
	if (instance->timeout) {
		instance->timeout--;
		if (instance->timeout == 0) {
			oncore_log(instance, LOG_ERR,
			    "Oncore: No response from @@Cj, shutting down driver");
			oncore_shutdown(unit, peer);
		} else {
			oncore_sendmsg(instance, oncore_cmd_Cj, sizeof(oncore_cmd_Cj));
			oncore_log(instance, LOG_WARNING, "Oncore: Resend @@Cj");
		}
		return;
	}

	if (!instance->pollcnt)
		refclock_report(peer, CEVNT_TIMEOUT);
	else
		instance->pollcnt--;
	peer->procptr->polls++;
	instance->polled = 1;
}



/*
 * Initialize PPSAPI
 */

static int
oncore_ppsapi(
	struct instance *instance
	)
{
	int cap, mode, mode1;
	char *cp, Msg[160];

	if (time_pps_getcap(instance->pps_h, &cap) < 0) {
		msnprintf(Msg, sizeof(Msg), "time_pps_getcap failed: %m");
		oncore_log(instance, LOG_ERR, Msg);
		return (0);
	}

	if (time_pps_getparams(instance->pps_h, &instance->pps_p) < 0) {
		msnprintf(Msg, sizeof(Msg), "time_pps_getparams failed: %m");
		oncore_log(instance, LOG_ERR, Msg);
		return (0);
	}

	/* nb. only turn things on, if someone else has turned something
	 *	on before we get here, leave it alone!
	 */

	if (instance->assert) {
		cp = "Assert";
		mode = PPS_CAPTUREASSERT;
		mode1 = PPS_OFFSETASSERT;
	} else {
		cp = "Clear";
		mode = PPS_CAPTURECLEAR;
		mode1 = PPS_OFFSETCLEAR;
	}
	snprintf(Msg, sizeof(Msg), "Initializing timing to %s.", cp);
	oncore_log(instance, LOG_INFO, Msg);

	if (!(mode & cap)) {
		snprintf(Msg, sizeof(Msg),
			 "Can't set timing to %s, exiting...", cp);
		oncore_log(instance, LOG_ERR, Msg);
		return(0);
	}

	if (!(mode1 & cap)) {
		snprintf(Msg, sizeof(Msg),
			 "Can't set %s, this will increase jitter.", cp);
		oncore_log(instance, LOG_NOTICE, Msg);
		mode1 = 0;
	}

	/* only set what is legal */

	instance->pps_p.mode = (mode | mode1 | PPS_TSFMT_TSPEC) & cap;

	if (time_pps_setparams(instance->pps_h, &instance->pps_p) < 0) {
		oncore_log(instance, LOG_ERR, "ONCORE: time_pps_setparams fails");
		return(0);		/* exit, can't do time_pps_setparans on PPS file */
	}

	/* If HARDPPS is on, we tell kernel */

	if (instance->hardpps) {
		int	i;

		oncore_log(instance, LOG_INFO, "HARDPPS Set.");

		if (instance->assert)
			i = PPS_CAPTUREASSERT;
		else
			i = PPS_CAPTURECLEAR;

		/* we know that 'i' is legal from above */

		if (time_pps_kcbind(instance->pps_h, PPS_KC_HARDPPS, i,
		    PPS_TSFMT_TSPEC) < 0) {
			msnprintf(Msg, sizeof(Msg), "time_pps_kcbind failed: %m");
			oncore_log(instance, LOG_ERR, Msg);
			oncore_log(instance, LOG_ERR, "HARDPPS failed, abort...");
			return (0);
		}

		pps_enable = 1;
	}
	return(1);
}



#ifdef ONCORE_SHMEM_STATUS
static void
oncore_init_shmem(
	struct instance *instance
	)
{
	int i, l, n, fd, shmem_old_size, n1;
	char Msg[160];
	u_char *cp, *cp1, *buf, *shmem_old;
	struct msg_desc *mp;
	struct stat sbuf;
	size_t shmem_length;

	/*
	* The first thing we do is see if there is an instance->shmem_fname file (still)
	* out there from a previous run.  If so, we copy it in and use it to initialize
	* shmem (so we won't lose our almanac if we need it).
	*/

	shmem_old = 0;
	shmem_old_size = 0;
	if ((fd = open(instance->shmem_fname, O_RDONLY)) < 0)
		oncore_log(instance, LOG_WARNING, "ONCORE: Can't open SHMEM file");
	else {
		fstat(fd, &sbuf);
		shmem_old_size = sbuf.st_size;
		if (shmem_old_size != 0) {
			shmem_old = emalloc((unsigned) sbuf.st_size);
			read(fd, shmem_old, shmem_old_size);
		}
		close(fd);
	}

	/* OK, we now create the NEW SHMEM. */

	if ((instance->shmemfd = open(instance->shmem_fname, O_RDWR|O_CREAT|O_TRUNC, 0644)) < 0) {
		oncore_log(instance, LOG_WARNING, "ONCORE: Can't open shmem");
		if (shmem_old)
			free(shmem_old);

		return;
	}

	/* see how big it needs to be */

	n = 1;
	for (mp=oncore_messages; mp->flag[0]; mp++) {
		mp->shmem = n;
		/* Allocate space for multiplexed almanac, and 0D/2D/3D @@Ea records */
		if (!strcmp(mp->flag, "Cb")) {
			instance->shmem_Cb = n;
			n += (mp->len + 3) * 34;
		}
		if (!strcmp(mp->flag, "Ba")) {
			instance->shmem_Ba = n;
			n += (mp->len + 3) * 3;
		}
		if (!strcmp(mp->flag, "Ea")) {
			instance->shmem_Ea = n;
			n += (mp->len + 3) * 3;
		}
		if (!strcmp(mp->flag, "Ha")) {
			instance->shmem_Ha = n;
			n += (mp->len + 3) * 3;
		}
		n += (mp->len + 3);
	}
	shmem_length = n + 2;

	buf = emalloc(shmem_length);
	memset(buf, 0, shmem_length);

	/* next build the new SHMEM buffer in memory */

	for (mp=oncore_messages; mp->flag[0]; mp++) {
		l = mp->shmem;
		buf[l + 0] = mp->len >> 8;
		buf[l + 1] = mp->len & 0xff;
		buf[l + 2] = 0;
		buf[l + 3] = '@';
		buf[l + 4] = '@';
		buf[l + 5] = mp->flag[0];
		buf[l + 6] = mp->flag[1];
		if (!strcmp(mp->flag, "Cb") || !strcmp(mp->flag, "Ba") || !strcmp(mp->flag, "Ea") || !strcmp(mp->flag, "Ha")) {
			if (!strcmp(mp->flag, "Cb"))
				n = 35;
			else
				n = 4;
			for (i=1; ilen+3) + 0] = mp->len >> 8;
				buf[l + i * (mp->len+3) + 1] = mp->len & 0xff;
				buf[l + i * (mp->len+3) + 2] = 0;
				buf[l + i * (mp->len+3) + 3] = '@';
				buf[l + i * (mp->len+3) + 4] = '@';
				buf[l + i * (mp->len+3) + 5] = mp->flag[0];
				buf[l + i * (mp->len+3) + 6] = mp->flag[1];
			}
		}
	}

	/* we now walk thru the two buffers (shmem_old and buf, soon to become shmem)
	 * copying the data in shmem_old to buf.
	 * When we are done we write it out and free both buffers.
	 * If the structure sizes dont agree, I will not copy.
	 * This could be due to an addition/deletion or a problem with the disk file.
	 */

	if (shmem_old) {
		if (shmem_old_size == shmem_length) {
			for (cp=buf+4, cp1=shmem_old+4; (n = 256*(*(cp-3)) + *(cp-2));	cp+=(n+3), cp1+=(n+3)) {
				n1 = 256*(*(cp1-3)) + *(cp1-2);
				if (n == 0 || n1 != n || strncmp((char *) cp, (char *) cp1, 4))
					break;

				memcpy(cp, cp1, (size_t) n);
			}
		}
		free(shmem_old);
	}

	i = write(instance->shmemfd, buf, shmem_length);
	free(buf);

	if (i != shmem_length) {
		oncore_log(instance, LOG_ERR, "ONCORE: error writing shmem");
		close(instance->shmemfd);
		return;
	}

	instance->shmem = (u_char *) mmap(0, shmem_length,
		PROT_READ | PROT_WRITE,
#ifdef MAP_HASSEMAPHORE
		MAP_HASSEMAPHORE |
#endif
		MAP_SHARED, instance->shmemfd, (off_t)0);

	if (instance->shmem == (u_char *)MAP_FAILED) {
		instance->shmem = 0;
		close(instance->shmemfd);
		return;
	}

	snprintf(Msg, sizeof(Msg),
		 "SHMEM (size = %ld) is CONFIGURED and available as %s",
		 (u_long) shmem_length, instance->shmem_fname);
	oncore_log(instance, LOG_NOTICE, Msg);
}
#endif /* ONCORE_SHMEM_STATUS */



/*
 * Read Input file if it exists.
 */

static void
oncore_read_config(
	struct instance *instance
	)
{
/*
 * First we try to open the configuration file
 *    /etc/ntp.oncore.N
 * where N is the unit number viz 127.127.30.N.
 * If we don't find it we try
 *    /etc/ntp.oncoreN
 * and then
 *    /etc/ntp.oncore
 *
 * If we don't find any then we don't have the cable delay or PPS offset
 * and we choose MODE (4) below.
 *
 * Five Choices for MODE
 *    (0) ONCORE is preinitialized, don't do anything to change it.
 *	    nb, DON'T set 0D mode, DON'T set Delay, position...
 *    (1) NO RESET, Read Position, delays from data file, lock it in, go to 0D mode.
 *    (2) NO RESET, Read Delays from data file, do SITE SURVEY to get position,
 *		    lock this in, go to 0D mode.
 *    (3) HARD RESET, Read Position, delays from data file, lock it in, go to 0D mode.
 *    (4) HARD RESET, Read Delays from data file, do SITE SURVEY to get position,
 *		    lock this in, go to 0D mode.
 *     NB. If a POSITION is specified in the config file with mode=(2,4) [SITE SURVEY]
 *	   then this position is set as the INITIAL position of the ONCORE.
 *	   This can reduce the time to first fix.
 * -------------------------------------------------------------------------------
 * Note that an Oncore UT without a battery backup retains NO information if it is
 *   power cycled, with a Battery Backup it remembers the almanac, etc.
 * For an Oncore VP, there is an eeprom that will contain this data, along with the
 *   option of Battery Backup.
 * So a UT without Battery Backup is equivalent to doing a HARD RESET on each
 *   power cycle, since there is nowhere to store the data.
 * -------------------------------------------------------------------------------
 *
 * If we open one or the other of the files, we read it looking for
 *   MODE, LAT, LON, (HT, HTGPS, HTMSL), DELAY, OFFSET, ASSERT, CLEAR, HARDPPS,
 *   STATUS, POSN3D, POSN2D, CHAN, TRAIM
 * then initialize using method MODE.  For Mode = (1,3) all of (LAT, LON, HT) must
 *   be present or mode reverts to (2,4).
 *
 * Read input file.
 *
 *	# is comment to end of line
 *	= allowed between 1st and 2nd fields.
 *
 *	Expect to see one line with 'MODE' as first field, followed by an integer
 *	   in the range 0-4 (default = 4).
 *
 *	Expect to see two lines with 'LONG', 'LAT' followed by 1-3 fields.
 *	All numbers are floating point.
 *		DDD.ddd
 *		DDD  MMM.mmm
 *		DDD  MMM  SSS.sss
 *
 *	Expect to see one line with 'HT' as first field,
 *	   followed by 1-2 fields.  First is a number, the second is 'FT' or 'M'
 *	   for feet or meters.	HT is the height above the GPS ellipsoid.
 *	   If the receiver reports height in both GPS and MSL, then we will report
 *	   the difference GPS-MSL on the clockstats file.
 *
 *	There is an optional line, starting with DELAY, followed
 *	   by 1 or two fields.	The first is a number (a time) the second is
 *	   'MS', 'US' or 'NS' for miliseconds, microseconds or nanoseconds.
 *	    DELAY  is cable delay, typically a few tens of ns.
 *
 *	There is an optional line, starting with OFFSET, followed
 *	   by 1 or two fields.	The first is a number (a time) the second is
 *	   'MS', 'US' or 'NS' for miliseconds, microseconds or nanoseconds.
 *	   OFFSET is the offset of the PPS pulse from 0. (only fully implemented
 *		with the PPSAPI, we need to be able to tell the Kernel about this
 *		offset if the Kernel PLL is in use, but can only do this presently
 *		when using the PPSAPI interface.  If not using the Kernel PLL,
 *		then there is no problem.
 *
 *	There is an optional line, with either ASSERT or CLEAR on it, which
 *	   determine which transition of the PPS signal is used for timing by the
 *	   PPSAPI.  If neither is present, then ASSERT is assumed.
 *	   ASSERT/CLEAR can also be set with FLAG2 of the ntp.conf input.
 *	   For Flag2, ASSERT=0, and hence is default.
 *
 *	There is an optional line, with HARDPPS on it.	Including this line causes
 *	   the PPS signal to control the kernel PLL.
 *	   HARDPPS can also be set with FLAG3 of the ntp.conf input.
 *	   For Flag3, 0 is disabled, and the default.
 *
 *	There are three options that have to do with using the shared memory option.
 *	   First, to enable the option there must be a SHMEM line with a file name.
 *	   The file name is the file associated with the shared memory.
 *
 *	In shared memory, there is one 'record' for each returned variable.
 *	For the @@Ea data there are three 'records' containing position data.
 *	   There will always be data in the record corresponding to the '0D' @@Ea record,
 *	   and the user has a choice of filling the '3D' record by specifying POSN3D,
 *	   or the '2D' record by specifying POSN2D.  In either case the '2D' or '3D'
 *	   record is filled once every 15s.
 *
 *	Two additional variables that can be set are CHAN and TRAIM.  These should be
 *	   set correctly by the code examining the @@Cj record, but we bring them out here
 *	   to allow the user to override either the # of channels, or the existence of TRAIM.
 *	   CHAN expects to be followed by in integer: 6, 8, or 12. TRAIM expects to be
 *	   followed by YES or NO.
 *
 *	There is an optional line with MASK on it followed by one integer field in the
 *	   range 0 to 89. This sets the satellite mask angle and will determine the minimum
 *	   elevation angle for satellites to be tracked by the receiver. The default value
 *	   is 10 deg for the VP and 0 deg for all other receivers.
 *
 * So acceptable input would be
 *	# these are my coordinates (RWC)
 *	LON  -106 34.610
 *	LAT    35 08.999
 *	HT	1589	# could equally well say HT 5215 FT
 *	DELAY  60 ns
 */

	FILE	*fd;
	char	*cp, *cc, *ca, line[100], units[2], device[64], Msg[160], **cpp;
	char	*dirs[] = { "/etc/ntp", "/etc", 0 };
	int	i, sign, lat_flg, long_flg, ht_flg, mode, mask;
	double	f1, f2, f3;

	fd = NULL;	/* just to shutup gcc complaint */
	for (cpp=dirs; *cpp; cpp++) {
		cp = *cpp;
		snprintf(device, sizeof(device), "%s/ntp.oncore.%d",
			 cp, instance->unit);  /* try "ntp.oncore.0 */
		if ((fd=fopen(device, "r")))
			break;
		snprintf(device, sizeof(device), "%s/ntp.oncore%d",
			 cp, instance->unit);  /* try "ntp.oncore0" */
		if ((fd=fopen(device, "r")))
			break;
		snprintf(device, sizeof(device), "%s/ntp.oncore", cp);
		if ((fd=fopen(device, "r")))   /* last try "ntp.oncore" */
			break;
	}

	if (!fd) {	/* no inputfile, default to the works ... */
		instance->init_type = 4;
		return;
	}

	mode = mask = 0;
	lat_flg = long_flg = ht_flg = 0;
	while (fgets(line, 100, fd)) {

		/* Remove comments */
		if ((cp = strchr(line, '#')))
			*cp = '\0';

		/* Remove trailing space */
		for (i = strlen(line);
		     i > 0 && isascii((int)line[i - 1]) && isspace((int)line[i - 1]);
			)
			line[--i] = '\0';

		/* Remove leading space */
		for (cc = line; *cc && isascii((int)*cc) && isspace((int)*cc); cc++)
			continue;

		/* Stop if nothing left */
		if (!*cc)
			continue;

		/* Uppercase the command and find the arg */
		for (ca = cc; *ca; ca++) {
			if (isascii((int)*ca)) {
				if (islower((int)*ca)) {
					*ca = toupper(*ca);
				} else if (isspace((int)*ca) || (*ca == '='))
					break;
			}
		}

		/* Remove space (and possible =) leading the arg */
		for (; *ca && isascii((int)*ca) && (isspace((int)*ca) || (*ca == '=')); ca++)
			continue;

		if (!strncmp(cc, "STATUS", (size_t) 6) || !strncmp(cc, "SHMEM", (size_t) 5)) {
			instance->shmem_fname = estrdup(ca);
			continue;
		}

		/* Uppercase argument as well */
		for (cp = ca; *cp; cp++)
			if (isascii((int)*cp) && islower((int)*cp))
				*cp = toupper(*cp);

		if (!strncmp(cc, "LAT", (size_t) 3)) {
			f1 = f2 = f3 = 0;
			sscanf(ca, "%lf %lf %lf", &f1, &f2, &f3);
			sign = 1;
			if (f1 < 0) {
				f1 = -f1;
				sign = -1;
			}
			instance->ss_lat = sign*1000*(fabs(f3) + 60*(fabs(f2) + 60*f1)); /*miliseconds*/
			lat_flg++;
		} else if (!strncmp(cc, "LON", (size_t) 3)) {
			f1 = f2 = f3 = 0;
			sscanf(ca, "%lf %lf %lf", &f1, &f2, &f3);
			sign = 1;
			if (f1 < 0) {
				f1 = -f1;
				sign = -1;
			}
			instance->ss_long = sign*1000*(fabs(f3) + 60*(fabs(f2) + 60*f1)); /*miliseconds*/
			long_flg++;
		} else if (!strncmp(cc, "HT", (size_t) 2)) {
			f1 = 0;
			units[0] = '\0';
			sscanf(ca, "%lf %1s", &f1, units);
			if (units[0] == 'F')
				f1 = 0.3048 * f1;
			instance->ss_ht = 100 * f1;    /* cm */
			ht_flg++;
		} else if (!strncmp(cc, "DELAY", (size_t) 5)) {
			f1 = 0;
			units[0] = '\0';
			sscanf(ca, "%lf %1s", &f1, units);
			if (units[0] == 'N')
				;
			else if (units[0] == 'U')
				f1 = 1000 * f1;
			else if (units[0] == 'M')
				f1 = 1000000 * f1;
			else
				f1 = 1000000000 * f1;
			if (f1 < 0 || f1 > 1.e9)
				f1 = 0;
			if (f1 < 0 || f1 > 999999) {
				snprintf(Msg, sizeof(Msg), 
					 "PPS Cable delay of %fns out of Range, ignored",
					 f1);
				oncore_log(instance, LOG_WARNING, Msg);
			} else
				instance->delay = f1;		/* delay in ns */
		} else if (!strncmp(cc, "OFFSET", (size_t) 6)) {
			f1 = 0;
			units[0] = '\0';
			sscanf(ca, "%lf %1s", &f1, units);
			if (units[0] == 'N')
				;
			else if (units[0] == 'U')
				f1 = 1000 * f1;
			else if (units[0] == 'M')
				f1 = 1000000 * f1;
			else
				f1 = 1000000000 * f1;
			if (f1 < 0 || f1 > 1.e9)
				f1 = 0;
			if (f1 < 0 || f1 > 999999999.) {
				snprintf(Msg, sizeof(Msg),
					 "PPS Offset of %fns out of Range, ignored",
					 f1);
				oncore_log(instance, LOG_WARNING, Msg);
			} else
				instance->offset = f1;		/* offset in ns */
		} else if (!strncmp(cc, "MODE", (size_t) 4)) {
			sscanf(ca, "%d", &mode);
			if (mode < 0 || mode > 4)
				mode = 4;
		} else if (!strncmp(cc, "ASSERT", (size_t) 6)) {
			instance->assert = 1;
		} else if (!strncmp(cc, "CLEAR", (size_t) 5)) {
			instance->assert = 0;
		} else if (!strncmp(cc, "HARDPPS", (size_t) 7)) {
			instance->hardpps = 1;
		} else if (!strncmp(cc, "POSN2D", (size_t) 6)) {
			instance->shmem_Posn = 2;
		} else if (!strncmp(cc, "POSN3D", (size_t) 6)) {
			instance->shmem_Posn = 3;
		} else if (!strncmp(cc, "CHAN", (size_t) 4)) {
			sscanf(ca, "%d", &i);
			if ((i == 6) || (i == 8) || (i == 12))
				instance->chan_in = i;
		} else if (!strncmp(cc, "TRAIM", (size_t) 5)) {
			instance->traim_in = 1; 	/* so TRAIM alone is YES */
			if (!strcmp(ca, "NO") || !strcmp(ca, "OFF"))    /* Yes/No, On/Off */
				instance->traim_in = 0;
		} else if (!strncmp(cc, "MASK", (size_t) 4)) {
			sscanf(ca, "%d", &mask);
			if (mask > -1 && mask < 90)
				instance->Ag = mask;			/* Satellite mask angle */
		}
	}
	fclose(fd);

	/*
	 *    OK, have read all of data file, and extracted the good stuff.
	 *    If lat/long/ht specified they ALL must be specified for mode = (1,3).
	 */

	instance->posn_set = 1;
	if (!( lat_flg && long_flg && ht_flg )) {
		snprintf(Msg, sizeof(Msg),
			 "ONCORE: incomplete data on %s", device);
		oncore_log (instance, LOG_WARNING, Msg);
		instance->posn_set = 0;
		if (mode == 1 || mode == 3) {
			snprintf(Msg, sizeof(Msg),
				 "Input Mode = %d, but no/incomplete position, mode set to %d",
				 mode, mode+1);
			oncore_log(instance, LOG_WARNING, Msg);
			mode++;
		}
	}
	instance->init_type = mode;

	snprintf(Msg, sizeof(Msg), "Input mode = %d", mode);
	oncore_log(instance, LOG_INFO, Msg);
}



/*
 * move data from NTP to buffer (toss the extra in the unlikely case it won't fit)
 */

static void
oncore_receive(
	struct recvbuf *rbufp
	)
{
	size_t i;
	u_char *p;
	struct peer *peer;
	struct instance *instance;

	peer = (struct peer *)rbufp->recv_srcclock;
	instance = (struct instance *) peer->procptr->unitptr;
	p = (u_char *) &rbufp->recv_space;

#ifdef ONCORE_VERBOSE_RECEIVE
	if (debug > 4) {
		int i;
		char	Msg[120], Msg2[10];

		snprintf(Msg, sizeof(Msg), ">>> %d bytes available",
			 rbufp->recv_length);
		oncore_log(instance, LOG_DEBUG, Msg);
		strncpy(Msg, ">>>", sizeof(Msg));
		for (i = 0; i < rbufp->recv_length; i++) {
			snprintf(Msg2, sizeof(Msg2), "%02x ", p[i]);
			strncat(Msg, Msg2, sizeof(Msg));
		}
		oncore_log(instance, LOG_DEBUG, Msg);

		strncpy(Msg, ">>>", sizeof(Msg));
		for (i = 0; i < rbufp->recv_length; i++) {
			snprintf(Msg2, sizeof(Msg2), "%03o ", p[i]);
			strncat(Msg, Msg2, sizeof(Msg));
		}
		oncore_log(instance, LOG_DEBUG, Msg);
	}
#endif

	i = rbufp->recv_length;
	if (rcvbuf+rcvptr+i > &rcvbuf[sizeof rcvbuf])
		i = sizeof(rcvbuf) - rcvptr;	/* and some char will be lost */
	memcpy(rcvbuf+rcvptr, p, i);
	rcvptr += i;
	oncore_consume(instance);
}



/*
 * Deal with any complete messages
 */

static void
oncore_consume(
	struct instance *instance
	)
{
	int i, m;
	unsigned l;

	while (rcvptr >= 7) {
		if (rcvbuf[0] != '@' || rcvbuf[1] != '@') {
			/* We're not in sync, lets try to get there */
			for (i=1; i < rcvptr-1; i++)
				if (rcvbuf[i] == '@' && rcvbuf[i+1] == '@')
					break;
#ifdef ONCORE_VERBOSE_CONSUME
			if (debug > 4) {
				char	Msg[120];

				snprintf(Msg, sizeof(Msg),
					 ">>> skipping %d chars", i);
				oncore_log(instance, LOG_DEBUG, Msg);
			}
#endif
			if (i != rcvptr)
				memcpy(rcvbuf, rcvbuf+i, (size_t)(rcvptr-i));
			rcvptr -= i;
			continue;
		}

		/* Ok, we have a header now */
		l = sizeof(oncore_messages)/sizeof(oncore_messages[0]) -1;
		for(m=0; m 4) {
				char	Msg[120];

				snprintf(Msg, sizeof(Msg),
					 ">>> Unknown MSG, skipping 4 (%c%c)",
					 rcvbuf[2], rcvbuf[3]);
				oncore_log(instance, LOG_DEBUG, Msg);
			}
#endif
			memcpy(rcvbuf, rcvbuf+4, (size_t) 4);
			rcvptr -= 4;
			continue;
		}

		l = oncore_messages[m].len;
#ifdef ONCORE_VERBOSE_CONSUME
		if (debug > 3) {
			char Msg[120];

			snprintf(Msg, sizeof(Msg),
				 "GOT: %c%c  %d of %d entry %d",
				 instance->unit, rcvbuf[2], rcvbuf[3],
				 rcvptr, l, m);
			oncore_log(instance, LOG_DEBUG, Msg);
			}
#endif
		/* Got the entire message ? */

		if (rcvptr < l)
			return;

		/* are we at the end of message? should be  */

		if (rcvbuf[l-2] != '\r' || rcvbuf[l-1] != '\n') {
#ifdef ONCORE_VERBOSE_CONSUME
			if (debug)
				oncore_log(instance, LOG_DEBUG, "NO  at end of message");
#endif
		} else {	/* check the CheckSum */
			if (oncore_checksum_ok(rcvbuf, l)) {
				if (instance->shmem != NULL) {
					instance->shmem[oncore_messages[m].shmem + 2]++;
					memcpy(instance->shmem + oncore_messages[m].shmem + 3,
					    rcvbuf, (size_t) l);
				}
				oncore_msg_any(instance, rcvbuf, (size_t) (l-3), m);
				if (oncore_messages[m].handler)
					oncore_messages[m].handler(instance, rcvbuf, (size_t) (l-3));
			}
#ifdef ONCORE_VERBOSE_CONSUME
			else if (debug) {
				char	Msg[120], Msg2[10];

				oncore_log(instance, LOG_ERR, "Checksum mismatch!");
				snprintf(Msg, sizeof(Msg), "@@%c%c ", rcvbuf[2], rcvbuf[3]);
				for (i = 4; i < l; i++) {
					snprintf(Msg2, sizeof(Msg2),
						 "%03o ", rcvbuf[i]);
					strncat(Msg, Msg2, sizeof(Msg));
				}
				oncore_log(instance, LOG_DEBUG, Msg);
			}
#endif
		}

		if (l != rcvptr)
			memcpy(rcvbuf, rcvbuf+l, (size_t) (rcvptr-l));
		rcvptr -= l;
	}
}



static void
oncore_get_timestamp(
	struct instance *instance,
	long dt1,	/* tick offset THIS time step */
	long dt2	/* tick offset NEXT time step */
	)
{
	int	Rsm;
	u_long	j;
	l_fp ts, ts_tmp;
	double dmy;
#ifdef HAVE_STRUCT_TIMESPEC
	struct timespec *tsp = 0;
#else
	struct timeval	*tsp = 0;
#endif
	int	current_mode;
	pps_params_t current_params;
	struct timespec timeout;
	struct peer *peer;
	pps_info_t pps_i;
	char	Msg[140];

	peer = instance->peer;

#if 1
	/* If we are in SiteSurvey mode, then we are in 3D mode, and we fall thru.
	 * If we have Finished the SiteSurvey, then we fall thru for the 14/15
	 *  times we get here in 0D mode (the 1/15 is in 3D for SHMEM).
	 * This gives good time, which gets better when the SS is done.
	 */

	if ((instance->site_survey == ONCORE_SS_DONE) && (instance->mode != MODE_0D)) {
#else
	/* old check, only fall thru for SS_DONE and 0D mode, 2h45m wait for ticks */

	if ((instance->site_survey != ONCORE_SS_DONE) || (instance->mode != MODE_0D)) {
#endif
		peer->flags &= ~FLAG_PPS;
		return;
	}

	/* Don't do anything without an almanac to define the GPS->UTC delta */

	if (instance->rsm.bad_almanac) {
		peer->flags &= ~FLAG_PPS;
		return;
	}

	/* Once the Almanac is valid, the M12+T does not produce valid UTC
	 * immediately.
	 * Wait for UTC offset decode valid, then wait one message more
	 * so we are not off by 13 seconds after  reset.
	 */

	if (instance->count5) {
		instance->count5--;
		peer->flags &= ~FLAG_PPS;
		return;
	}

	j = instance->ev_serial;
	timeout.tv_sec = 0;
	timeout.tv_nsec = 0;
	if (time_pps_fetch(instance->pps_h, PPS_TSFMT_TSPEC, &pps_i,
	    &timeout) < 0) {
		oncore_log(instance, LOG_ERR, "time_pps_fetch failed");
		peer->flags &= ~FLAG_PPS;
		return;
	}

	if (instance->assert) {
		tsp = &pps_i.assert_timestamp;

#ifdef ONCORE_VERBOSE_GET_TIMESTAMP
		if (debug > 2) {
			u_long i;

			i = (u_long) pps_i.assert_sequence;
# ifdef HAVE_STRUCT_TIMESPEC
			snprintf(Msg, sizeof(Msg),
				 "serial/j (%lu, %lu) %ld.%09ld", i, j,
				 (long)tsp->tv_sec, (long)tsp->tv_nsec);
# else
			snprintf(Msg, sizeof(Msg), 
				 "serial/j (%lu, %lu) %ld.%06ld", i, j,
				 (long)tsp->tv_sec, (long)tsp->tv_usec);
# endif
			oncore_log(instance, LOG_DEBUG, Msg);
		}
#endif

		if (pps_i.assert_sequence == j) {
			oncore_log(instance, LOG_NOTICE, "ONCORE: oncore_get_timestamp, error serial pps");
			peer->flags &= ~FLAG_PPS;
			return;
		}

		instance->ev_serial = pps_i.assert_sequence;
	} else {
		tsp = &pps_i.clear_timestamp;

#if 0
		if (debug > 2) {
			u_long i;

			i = (u_long) pps_i.clear_sequence;
# ifdef HAVE_STRUCT_TIMESPEC
			snprintf(Msg, sizeof(Msg),
				 "serial/j (%lu, %lu) %ld.%09ld", i, j,
				 (long)tsp->tv_sec, (long)tsp->tv_nsec);
# else
			snprintf(Msg. sizeof(Msg),
				 "serial/j (%lu, %lu) %ld.%06ld", i, j,
				 (long)tsp->tv_sec, (long)tsp->tv_usec);
# endif
			oncore_log(instance, LOG_DEBUG, Msg);
		}
#endif

		if (pps_i.clear_sequence == j) {
			oncore_log(instance, LOG_ERR, "oncore_get_timestamp, error serial pps");
			peer->flags &= ~FLAG_PPS;
			return;
		}
		instance->ev_serial = pps_i.clear_sequence;
	}

	/* convert timespec -> ntp l_fp */

	dmy = tsp->tv_nsec;
	dmy /= 1e9;
	ts.l_uf = dmy * 4294967296.0;
	ts.l_ui = tsp->tv_sec;

#if 0
     alternate code for previous 4 lines is
	dmy = 1.0e-9*tsp->tv_nsec;	/* fractional part */
	DTOLFP(dmy, &ts);
	dmy = tsp->tv_sec;		/* integer part */
	DTOLFP(dmy, &ts_tmp);
	L_ADD(&ts, &ts_tmp);
     or more simply
	dmy = 1.0e-9*tsp->tv_nsec;	/* fractional part */
	DTOLFP(dmy, &ts);
	ts.l_ui = tsp->tv_sec;
#endif	/* 0 */

	/* now have timestamp in ts */
	/* add in saw_tooth and offset, these will be ZERO if no TRAIM */
	/* they will be IGNORED if the PPSAPI cant do PPS_OFFSET/ASSERT/CLEAR */
	/* we just try to add them in and dont test for that here */

	/* saw_tooth not really necessary if using TIMEVAL */
	/* since its only precise to us, but do it anyway. */

	/* offset in ns, and is positive (late), we subtract */
	/* to put the PPS time transition back where it belongs */

	/* must hand the offset for the NEXT sec off to the Kernel to do */
	/* the addition, so that the Kernel PLL sees the offset too */

	if (instance->assert)
		instance->pps_p.assert_offset.tv_nsec = -dt2;
	else
		instance->pps_p.clear_offset.tv_nsec  = -dt2;

	/* The following code is necessary, and not just a time_pps_setparams,
	 * using the saved instance->pps_p, since some other process on the
	 * machine may have diddled with the mode bits (say adding something
	 * that it needs).  We take what is there and ADD what we need.
	 * [[ The results from the time_pps_getcap is unlikely to change so
	 *    we could probably just save it, but I choose to do the call ]]
	 * Unfortunately, there is only ONE set of mode bits in the kernel per
	 * interface, and not one set for each open handle.
	 *
	 * There is still a race condition here where we might mess up someone
	 * elses mode, but if he is being careful too, he should survive.
	 */

	if (time_pps_getcap(instance->pps_h, ¤t_mode) < 0) {
		msnprintf(Msg, sizeof(Msg), "time_pps_getcap failed: %m");
		oncore_log(instance, LOG_ERR, Msg);
		peer->flags &= ~FLAG_PPS;
		return;
	}

	if (time_pps_getparams(instance->pps_h, ¤t_params) < 0) {
		msnprintf(Msg, sizeof(Msg), "time_pps_getparams failed: %m");
		oncore_log(instance, LOG_ERR, Msg);
		peer->flags &= ~FLAG_PPS;
		return;
	}

		/* or current and mine */
	current_params.mode |= instance->pps_p.mode;
		/* but only set whats legal */
	current_params.mode &= current_mode;

	current_params.assert_offset.tv_sec = 0;
	current_params.assert_offset.tv_nsec = -dt2;
	current_params.clear_offset.tv_sec = 0;
	current_params.clear_offset.tv_nsec = -dt2;

	if (time_pps_setparams(instance->pps_h, ¤t_params))
		oncore_log(instance, LOG_ERR, "ONCORE: Error doing time_pps_setparams");

	/* have time from UNIX origin, convert to NTP origin. */

	ts.l_ui += JAN_1970;
	instance->pp->lastrec = ts;

	/* print out information about this timestamp (long line) */

	ts_tmp = ts;
	ts_tmp.l_ui = 0;	/* zero integer part */
	LFPTOD(&ts_tmp, dmy);	/* convert fractional part to a double */
	j = 1.0e9*dmy;		/* then to integer ns */

	Rsm = 0;
	if (instance->chan == 6)
		Rsm = instance->BEHa[64];
	else if (instance->chan == 8)
		Rsm = instance->BEHa[72];
	else if (instance->chan == 12)
		Rsm = ((instance->BEHa[129]<<8) | instance->BEHa[130]);

	if (instance->chan == 6 || instance->chan == 8) {
		char	f1[5], f2[5], f3[5], f4[5];
		if (instance->traim) {
			snprintf(f1, sizeof(f1), "%d",
				 instance->BEHn[21]);
			snprintf(f2, sizeof(f2), "%d",
				 instance->BEHn[22]);
			snprintf(f3, sizeof(f3), "%2d",
				 instance->BEHn[23] * 256 +
				     instance->BEHn[24]);
			snprintf(f4, sizeof(f4), "%3d",
				 (s_char)instance->BEHn[25]);
		} else {
			strncpy(f1, "x", sizeof(f1));
			strncpy(f2, "x", sizeof(f2));
			strncpy(f3, "xx", sizeof(f3));
			strncpy(f4, "xxx", sizeof(f4));
		}
		snprintf(Msg, sizeof(Msg),	/* MAX length 128, currently at 127 */
 "%u.%09lu %d %d %2d %2d %2d %2ld rstat   %02x dop %4.1f nsat %2d,%d traim %d,%s,%s sigma %s neg-sawtooth %s sat %d%d%d%d%d%d%d%d",
		    ts.l_ui, j,
		    instance->pp->year, instance->pp->day,
		    instance->pp->hour, instance->pp->minute, instance->pp->second,
		    (long) tsp->tv_sec % 60,
		    Rsm, 0.1*(256*instance->BEHa[35]+instance->BEHa[36]),
		    /*rsat	dop */
		    instance->BEHa[38], instance->BEHa[39], instance->traim, f1, f2,
		    /*	nsat visible,	  nsat tracked,     traim,traim,traim */
		    f3, f4,
		    /* sigma neg-sawtooth */
	  /*sat*/   instance->BEHa[41], instance->BEHa[45], instance->BEHa[49], instance->BEHa[53],
		    instance->BEHa[57], instance->BEHa[61], instance->BEHa[65], instance->BEHa[69]
		    );					/* will be 0 for 6 chan */
	} else if (instance->chan == 12) {
		char	f1[5], f2[5], f3[5], f4[5];
		if (instance->traim) {
			snprintf(f1, sizeof(f1), "%d",
				 instance->BEHn[6]);
			snprintf(f2, sizeof(f2), "%d",
				 instance->BEHn[7]);
			snprintf(f3, sizeof(f3), "%d",
				 instance->BEHn[12] * 256 +
				     instance->BEHn[13]);
			snprintf(f4, sizeof(f4), "%3d",
				 (s_char)instance->BEHn[14]);
		} else {
			strncpy(f1, "x", sizeof(f1));
			strncpy(f2, "x", sizeof(f2));
			strncpy(f3, "xx", sizeof(f3));
			strncpy(f4, "xxx", sizeof(f4));
		}
		snprintf(Msg, sizeof(Msg),
 "%u.%09lu %d %d %2d %2d %2d %2ld rstat %02x dop %4.1f nsat %2d,%d traim %d,%s,%s sigma %s neg-sawtooth %s sat %d%d%d%d%d%d%d%d%d%d%d%d",
		    ts.l_ui, j,
		    instance->pp->year, instance->pp->day,
		    instance->pp->hour, instance->pp->minute, instance->pp->second,
		    (long) tsp->tv_sec % 60,
		    Rsm, 0.1*(256*instance->BEHa[53]+instance->BEHa[54]),
		    /*rsat	dop */
		    instance->BEHa[55], instance->BEHa[56], instance->traim, f1, f2,
		    /*	nsat visible,	  nsat tracked	 traim,traim,traim */
		    f3, f4,
		    /* sigma neg-sawtooth */
	  /*sat*/   instance->BEHa[58], instance->BEHa[64], instance->BEHa[70], instance->BEHa[76],
		    instance->BEHa[82], instance->BEHa[88], instance->BEHa[94], instance->BEHa[100],
		    instance->BEHa[106], instance->BEHa[112], instance->BEHa[118], instance->BEHa[124]
		    );
	}

	/* and some things I dont understand (magic ntp things) */

	if (!refclock_process(instance->pp)) {
		refclock_report(instance->peer, CEVNT_BADTIME);
		peer->flags &= ~FLAG_PPS;
		return;
	}

	oncore_log(instance, LOG_INFO, Msg);	 /* this is long message above */
	instance->pollcnt = 2;

	if (instance->polled) {
		instance->polled = 0;
	     /* instance->pp->dispersion = instance->pp->skew = 0;	*/
		instance->pp->lastref = instance->pp->lastrec;
		refclock_receive(instance->peer);
	}
	peer->flags |= FLAG_PPS;
}


/*************** oncore_msg_XX routines start here *******************/


/*
 * print Oncore response message.
 */

static void
oncore_msg_any(
	struct instance *instance,
	u_char *buf,
	size_t len,
	int idx
	)
{
#ifdef ONCORE_VERBOSE_MSG_ANY
	int i;
	const char *fmt = oncore_messages[idx].fmt;
	const char *p;
	char *q;
	char *qlim;
#ifdef HAVE_GETCLOCK
	struct timespec ts;
#endif
	struct timeval tv;
	char	Msg[120], Msg2[10];

	if (debug > 3) {
# ifdef HAVE_GETCLOCK
		(void) getclock(TIMEOFDAY, &ts);
		tv.tv_sec = ts.tv_sec;
		tv.tv_usec = ts.tv_nsec / 1000;
# else
		GETTIMEOFDAY(&tv, 0);
# endif
		snprintf(Msg, sizeof(Msg), "%ld.%06ld",
			 (long)tv.tv_sec, (long)tv.tv_usec);
		oncore_log(instance, LOG_DEBUG, Msg);

		if (!*fmt) {
			snprintf(Msg, sizeof(Msg), ">>@@%c%c ", buf[2],
				 buf[3]);
			for(i = 2; i < len && i < 2400 ; i++) {
				snprintf(Msg2, sizeof(Msg2), "%02x",
					 buf[i]);
				strncpy(Msg, Msg2, sizeof(Msg));

			}
			oncore_log(instance, LOG_DEBUG, Msg);
			return;
		} else {
			strncat(Msg, "##", sizeof(Msg));
			qlim = Msg + sizeof(Msg) - 3;
			for (p = fmt, q = Msg + 2; q < qlim && *p; ) {
				*q++ = *p++;
				*q++ = '_';
			}
			*q = '\0';
			oncore_log(instance, LOG_DEBUG, Msg);
			snprintf(Msg, sizeof(Msg), "%c%c", buf[2],
				 buf[3]);
			i = 4;
			for (p = fmt; *p; p++) {
				snprintf(Msg2, "%02x", buf[i++]);
				strncat(Msg, Msg2, sizeof(Msg));
			}
			oncore_log(instance, LOG_DEBUG, Msg);
		}
	}
#endif
}



/* Latitude, Longitude, Height */

static void
oncore_msg_Adef(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
}



/* Mask Angle */

static void
oncore_msg_Ag(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{		char  Msg[160], *cp;

		cp = "set to";
		if (instance->o_state == ONCORE_RUN)
			cp = "is";

		instance->Ag = buf[4];
		snprintf(Msg, sizeof(Msg),
			 "Satellite mask angle %s %d degrees", cp, 
			 (int)instance->Ag);
		oncore_log(instance, LOG_INFO, Msg);
}



/*
 * get Position hold position
 */

static void
oncore_msg_As(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	instance->ss_lat  = buf_w32(&buf[4]);
	instance->ss_long = buf_w32(&buf[8]);
	instance->ss_ht   = buf_w32(&buf[12]);

	/* Print out Position */
	oncore_print_posn(instance);
}



/*
 * Try to use Oncore UT+ Auto Survey Feature
 *	If its not there (VP), set flag to do it ourselves.
 */

static void
oncore_msg_At(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	instance->saw_At = 1;
	if (instance->site_survey == ONCORE_SS_TESTING) {
		if (buf[4] == 2) {
			oncore_log(instance, LOG_NOTICE,
					"Initiating hardware 3D site survey");

			oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_HW");
			instance->site_survey = ONCORE_SS_HW;
		}
	}
}



/*
 * get PPS Offset
 * Nb. @@Ay is not supported for early UT (no plus) model
 */

static void
oncore_msg_Ay(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	char Msg[120];

	if (instance->saw_Ay)
		return;

	instance->saw_Ay = 1;

	instance->offset = buf_w32(&buf[4]);

	snprintf(Msg, sizeof(Msg), "PPS Offset is set to %ld ns",
		 instance->offset);
	oncore_log(instance, LOG_INFO, Msg);
}



/*
 * get Cable Delay
 */

static void
oncore_msg_Az(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	char Msg[120];

	if (instance->saw_Az)
		return;

	instance->saw_Az = 1;

	instance->delay = buf_w32(&buf[4]);

	snprintf(Msg, sizeof(Msg), "Cable delay is set to %ld ns",
		instance->delay);
	oncore_log(instance, LOG_INFO, Msg);
}



/* Ba, Ea and Ha come here, these contain Position */

static void
oncore_msg_BaEaHa(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	const char	*cp;
	char		Msg[160];
	int		mode;

	/* OK, we are close to the RUN state now.
	 * But we have a few more items to initialize first.
	 *
	 * At the beginning of this routine there are several 'timers'.
	 * We enter this routine 1/sec, and since the upper levels of NTP have usurped
	 * the use of timers, we use the 1/sec entry to do things that
	 * we would normally do with timers...
	 */

	if (instance->o_state == ONCORE_CHECK_CHAN) {	/* here while checking for the # chan */
		if (buf[2] == 'B') {		/* 6chan */
			if (instance->chan_ck < 6) instance->chan_ck = 6;
		} else if (buf[2] == 'E') {	/* 8chan */
			if (instance->chan_ck < 8) instance->chan_ck = 8;
		} else if (buf[2] == 'H') {	/* 12chan */
			if (instance->chan_ck < 12) instance->chan_ck = 12;
		}

		if (instance->count3++ < 5)
			return;

		instance->count3 = 0;

		if (instance->chan_in != -1)	/* set in Input */
			instance->chan = instance->chan_in;
		else				/* set from test */
			instance->chan = instance->chan_ck;

		snprintf(Msg, sizeof(Msg), "Input   says chan = %d",
			 instance->chan_in);
		oncore_log(instance, LOG_INFO, Msg);
		snprintf(Msg, sizeof(Msg), "Model # says chan = %d",
			 instance->chan_id);
		oncore_log(instance, LOG_INFO, Msg);
		snprintf(Msg, sizeof(Msg), "Testing says chan = %d",
			 instance->chan_ck);
		oncore_log(instance, LOG_INFO, Msg);
		snprintf(Msg, sizeof(Msg), "Using        chan = %d",
			 instance->chan);
		oncore_log(instance, LOG_INFO, Msg);

		instance->o_state = ONCORE_HAVE_CHAN;
		oncore_log(instance, LOG_NOTICE, "state = ONCORE_HAVE_CHAN");

		instance->timeout = 4;
		oncore_sendmsg(instance, oncore_cmd_Cj, sizeof(oncore_cmd_Cj));
		return;
	}

	if (instance->o_state != ONCORE_ALMANAC && instance->o_state != ONCORE_RUN)
		return;

	/* PAUSE 5sec - make sure results are stable, before using position */

	if (instance->count) {
		if (instance->count++ < 5)
			return;
		instance->count = 0;
	}

	memcpy(instance->BEHa, buf, (size_t) (len+3));	/* Ba, Ea or Ha */

	/* check the antenna (did it get unplugged) and almanac (is it ready) for changes. */

	oncore_check_almanac(instance);
	oncore_check_antenna(instance);

	/* If we are in Almanac mode, waiting for Almanac, we can't do anything till we have it */
	/* When we have an almanac, we will start the Bn/En/@@Hn messages */

	if (instance->o_state == ONCORE_ALMANAC)
		if (oncore_wait_almanac(instance))
			return;

	/* do some things once when we get this far in BaEaHa */

	if (instance->once) {
		instance->once = 0;
		instance->count2 = 1;

		/* Have we seen an @@At (position hold) command response */
		/* if not, message out */

		if (instance->chan != 12 && !instance->saw_At) {
			oncore_log(instance, LOG_NOTICE,
				"Not Good, no @@At command (no Position Hold), must be a GT/GT+");
			oncore_sendmsg(instance, oncore_cmd_Av1, sizeof(oncore_cmd_Av1));
		}

		/* have an Almanac, can start the SiteSurvey
		 * (actually only need to get past the almanac_load where we diddle with At
		 *  command,- we can't change it after we start the HW_SS below
		 */

		mode = instance->init_type;
		switch (mode) {
		case 0: /* NO initialization, don't change anything */
		case 1: /* Use given Position */
		case 3:
			instance->site_survey = ONCORE_SS_DONE;
			oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_DONE");
			break;

		case 2:
		case 4: /* Site Survey */
			oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_TESTING");
			instance->site_survey = ONCORE_SS_TESTING;
			instance->count1 = 1;
			if (instance->chan == 12)
				oncore_sendmsg(instance, oncore_cmd_Gd3,  sizeof(oncore_cmd_Gd3));  /* M12+T */
			else
				oncore_sendmsg(instance, oncore_cmd_At2,  sizeof(oncore_cmd_At2));  /* not GT, arg not VP */
			break;
		}

		/* Read back PPS Offset for Output */
		/* Nb. This will fail silently for early UT (no plus) and M12 models */

		oncore_sendmsg(instance, oncore_cmd_Ayx,  sizeof(oncore_cmd_Ayx));

		/* Read back Cable Delay for Output */

		oncore_sendmsg(instance, oncore_cmd_Azx,  sizeof(oncore_cmd_Azx));

		/* Read back Satellite Mask Angle for Output */

		oncore_sendmsg(instance, oncore_cmd_Agx,  sizeof(oncore_cmd_Agx));
	}


	/* Unfortunately, the Gd3 command returns '3' for the M12 v1.3 firmware where it is
	 * out-of-range and it should return 0-2. (v1.3 can't do a HW Site Survey)
	 * We must do the Gd3, and then wait a cycle or two for things to settle,
	 * then check Ha[130]&0x10 to see if a SS is in progress.
	 * We will set SW if HW has not been set after an appropriate delay.
	 */

	if (instance->site_survey == ONCORE_SS_TESTING) {
		if (instance->chan == 12) {
			if (instance->count1) {
				if (instance->count1++ > 5 || instance->BEHa[130]&0x10) {
					instance->count1 = 0;
					if (instance->BEHa[130]&0x10) {
						oncore_log(instance, LOG_NOTICE,
								"Initiating hardware 3D site survey");

						oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_HW");
						instance->site_survey = ONCORE_SS_HW;
					} else {
						oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_SW");
						instance->site_survey = ONCORE_SS_SW;
					}
				}
			}
		} else {
			if (instance->count1) {
				if (instance->count1++ > 5) {
					instance->count1 = 0;
					/*
					 * For instance->site_survey to still be ONCORE_SS_TESTING, then after a 5sec
					 * wait after the @@At2/@@Gd3 command we have not changed the state to
					 * ONCORE_SS_HW.  If the Hardware is capable of doing a Site Survey, then
					 * the variable would have been changed by now.
					 * There are three possibilities:
					 * 6/8chan
					 *   (a) We did not get a response to the @@At0 or @@At2 commands,
					 *	   and it must be a GT/GT+/SL with no position hold mode.
					 *	   We will have to do it ourselves.
					 *   (b) We saw the @@At0, @@At2 commands, but @@At2 failed,
					 *	   must be a VP or older UT which doesn't have Site Survey mode.
					 *	   We will have to do it ourselves.
					 * 12chan
					 *   (c) We saw the @@Gd command, and saw H[13]*0x10
					 *	   We will have to do it ourselves (done above)
					 */

					snprintf(Msg, sizeof(Msg), 
						 "Initiating software 3D site survey (%d samples)",
						 POS_HOLD_AVERAGE);
					oncore_log(instance, LOG_INFO, Msg);

					oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_SW");
					instance->site_survey = ONCORE_SS_SW;

					instance->ss_lat = instance->ss_long = instance->ss_ht = 0;
					if (instance->chan == 12)
						oncore_sendmsg(instance, oncore_cmd_Gd0, sizeof(oncore_cmd_Gd0)); /* disable */
					else {
						oncore_sendmsg(instance, oncore_cmd_At0, sizeof(oncore_cmd_At0)); /* disable */
						oncore_sendmsg(instance, oncore_cmd_Av0, sizeof(oncore_cmd_Av0)); /* disable */
					}
				}
			}
		}
	}

	/* check the mode we are in 0/2/3D */

	if (instance->chan == 6) {
		if (instance->BEHa[64]&0x8)
			instance->mode = MODE_0D;
		else if (instance->BEHa[64]&0x10)
			instance->mode = MODE_2D;
		else if (instance->BEHa[64]&0x20)
			instance->mode = MODE_3D;
	} else if (instance->chan == 8) {
		if (instance->BEHa[72]&0x8)
			instance->mode = MODE_0D;
		else if (instance->BEHa[72]&0x10)
			instance->mode = MODE_2D;
		else if (instance->BEHa[72]&0x20)
			instance->mode = MODE_3D;
	} else if (instance->chan == 12) {
		int bits;

		bits = (instance->BEHa[129]>>5) & 0x7;	/* actually Ha */
		if (bits == 0x4)
			instance->mode = MODE_0D;
		else if (bits == 0x6)
			instance->mode = MODE_2D;
		else if (bits == 0x7)
			instance->mode = MODE_3D;
	}

	/* copy the record to the (extra) location in SHMEM */

	if (instance->shmem) {
		int	i;
		u_char	*smp;	 /* pointer to start of shared mem for Ba/Ea/Ha */

		switch(instance->chan) {
		case 6:   smp = &instance->shmem[instance->shmem_Ba]; break;
		case 8:   smp = &instance->shmem[instance->shmem_Ea]; break;
		case 12:  smp = &instance->shmem[instance->shmem_Ha]; break;
		default:  smp = (u_char *) NULL;		      break;
		}

		switch (instance->mode) {
		case MODE_0D:	i = 1; break;	/* 0D, Position Hold */
		case MODE_2D:	i = 2; break;	/* 2D, Altitude Hold */
		case MODE_3D:	i = 3; break;	/* 3D fix */
		default:	i = 0; break;
		}

		if (i && smp != NULL) {
			i *= (len+6);
			smp[i + 2]++;
			memcpy(&smp[i+3], buf, (size_t) (len+3));
		}
	}

	/*
	 * check if traim timer active
	 * if it hasn't been cleared, then @@Bn/@@En/@@Hn did not respond
	 */

	if (instance->traim_delay) {
		if (instance->traim_delay++ > 5) {
			instance->traim = 0;
			instance->traim_delay = 0;
			cp = "ONCORE: Did not detect TRAIM response, TRAIM = OFF";
			oncore_log(instance, LOG_INFO, cp);

			oncore_set_traim(instance);
		} else
			return;

	}

	/* by now should have a @@Ba/@@Ea/@@Ha with good data in it */

	if (!instance->have_dH && !instance->traim_delay)
		oncore_compute_dH(instance);

	/*
	 * must be ONCORE_RUN if we are here.
	 * Have # chan and TRAIM by now.
	 */

	instance->pp->year   = buf[6]*256+buf[7];
	instance->pp->day    = ymd2yd(buf[6]*256+buf[7], buf[4], buf[5]);
	instance->pp->hour   = buf[8];
	instance->pp->minute = buf[9];
	instance->pp->second = buf[10];

	/*
	 * Are we doing a Hardware or Software Site Survey?
	 */

	if (instance->site_survey == ONCORE_SS_HW || instance->site_survey == ONCORE_SS_SW)
		oncore_ss(instance);

	/* see if we ever saw a response from the @@Ayx above */

	if (instance->count2) {
		if (instance->count2++ > 5) {	/* this delay to check on @@Ay command */
			instance->count2 = 0;

			/* Have we seen an Ay (1PPS time offset) command response */
			/* if not, and non-zero offset, zero the offset, and send message */

			if (!instance->saw_Ay && instance->offset) {
				oncore_log(instance, LOG_INFO, "No @@Ay command, PPS OFFSET ignored");
				instance->offset = 0;
			}
		}
	}

	/*
	 * Check the leap second status once per day.
	 */

	oncore_check_leap_sec(instance);

	/*
	 * if SHMEM active, every 15s, steal one 'tick' to get 2D or 3D posn.
	 */

	if (instance->shmem && !instance->shmem_bad_Ea && instance->shmem_Posn && (instance->site_survey == ONCORE_SS_DONE))
		oncore_shmem_get_3D(instance);

	if (!instance->traim)	/* NO traim, no BnEnHn, go get tick */
		oncore_get_timestamp(instance, instance->offset, instance->offset);
}



/* Almanac Status */

static void
oncore_msg_Bd(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	char Msg[160];

	snprintf(Msg, sizeof(Msg),
		 "Bd: Almanac %s, week = %d, t = %d, %d SVs: %x",
		 ((buf[4]) ? "LOADED" : "(NONE)"), buf[5], buf[6],
		 buf[7], w32(&buf[8]));
	oncore_log(instance, LOG_NOTICE, Msg);
}



/* get leap-second warning message */

/*
 * @@Bj does NOT behave as documented in current Oncore firmware.
 * It turns on the LEAP indicator when the data is set, and does not,
 * as documented, wait until the beginning of the month when the
 * leap second will occur.
 * Since this firmware bug will never be fixed in all the outstanding Oncore receivers
 * @@Bj is only called in June/December.
 */

static void
oncore_msg_Bj(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	const char	*cp;

	instance->saw_Bj = 1;

	switch(buf[4]) {
	case 1:
		instance->pp->leap = LEAP_ADDSECOND;
		cp = "Set pp.leap to LEAP_ADDSECOND";
		break;
	case 2:
		instance->pp->leap = LEAP_DELSECOND;
		cp = "Set pp.leap to LEAP_DELSECOND";
		break;
	case 0:
	default:
		instance->pp->leap = LEAP_NOWARNING;
		cp = "Set pp.leap to LEAP_NOWARNING";
		break;
	}
	oncore_log(instance, LOG_NOTICE, cp);
}



static void
oncore_msg_Bl(
	struct instance *instance,
	u_char *buf,
	size_t	len
	)
{
	int	chan, id, subframe, valid, page, i, j, tow;
	int	day_now, day_lsf;
	char	*cp, Msg[120];
	enum {
		WARN_NOT_YET,
		WARN_0,
		WARN_PLUS,
		WARN_MINUS
	} warn;

	day_now = day_lsf = 0;
	cp = NULL;      /* keep gcc happy */

	chan = buf[4] & 0377;
	id   = buf[5] & 0377;
	subframe = buf[6] & 017;
	valid = (buf[6] >> 4) & 017;
	page = buf[7];

	if ((!instance->Bl.lsf_flg && !instance->Bl.wn_flg) && (subframe == 4 && page == 18 && valid == 10)) {
		instance->Bl.dt_ls  = buf[32];
		instance->Bl.WN_lsf = buf[33];
		instance->Bl.DN_lsf = buf[34];
		instance->Bl.dt_lsf = buf[35];
		instance->Bl.lsf_flg++;
	}
	if ((instance->Bl.lsf_flg && !instance->Bl.wn_flg) && (subframe == 1 && valid == 10)) {
		i = (buf[7+7]<<8) + buf[7+8];
		instance->Bl.WN = i >> 6;
		tow = (buf[7+4]<<16) + (buf[7+5]<<8) + buf[7+6];
		tow >>= 7;
		tow = tow & 0377777;
		tow <<= 2;
		instance->Bl.DN = tow/57600L + 1;
		instance->Bl.wn_flg++;
	}
	if (instance->Bl.wn_flg && instance->Bl.lsf_flg)  {
		instance->Bl.wn_flg = instance->Bl.lsf_flg = 0;
		oncore_cmd_Bl[2] = 0;
		oncore_sendmsg(instance, oncore_cmd_Bl, sizeof oncore_cmd_Bl);
		oncore_cmd_Bl[2] = 1;

		i = instance->Bl.WN&01400;
		instance->Bl.WN_lsf |= i;

		/* have everything I need, doit */

		i = (instance->Bl.WN_lsf - instance->Bl.WN);
		if (i < 0)
			i += 1024;
		day_now = instance->Bl.DN;
		day_lsf = 7*i + instance->Bl.DN_lsf;

		/* ignore if in past or more than a month in future */

		warn = WARN_NOT_YET;
		if (day_lsf >= day_now && day_lsf - day_now < 32) {
			/* if < 28d, doit, if 28-31, ck day-of-month < 20 (not at end of prev month) */
			if (day_lsf - day_now < 28 ||  instance->BEHa[5] < 20) {
				i = instance->Bl.dt_lsf - instance->Bl.dt_ls;
				switch (i) {
				case -1:
					warn = WARN_MINUS;
					break;
				case  0:
					warn = WARN_0;
					break;
				case  1:
					warn = WARN_PLUS;
					break;
				}
			}
		}

		switch (warn) {
		case WARN_0:
		case WARN_NOT_YET:
			instance->peer->leap = LEAP_NOWARNING;
			cp = "Set peer.leap to LEAP_NOWARNING";
			break;
		case WARN_MINUS:
			instance->peer->leap = LEAP_DELSECOND;
			cp = "Set peer.leap to LEAP_DELSECOND";
			break;
		case WARN_PLUS:
			instance->peer->leap = LEAP_ADDSECOND;
			cp = "Set peer.leap to LEAP_ADDSECOND";
			break;
		}
		oncore_log(instance, LOG_NOTICE, cp);

		i = instance->Bl.dt_lsf-instance->Bl.dt_ls;
		if (i) {
			j = (i >= 0) ? i : -i;		/* abs(i) */
			snprintf(Msg, sizeof(Msg),
				 "see Leap_Second (%c%d) in %d days",
				 ((i >= 0) ? '+' : '-'), j,
				 day_lsf-day_now);
			oncore_log(instance, LOG_NOTICE, Msg);
		}
	}
	snprintf(Msg, sizeof(Msg), 
		"dt_ls = %d  dt_lsf = %d  WN = %d  DN = %d  WN_lsf = %d  DNlsf = %d  wn_flg = %d  lsf_flg = %d  Bl_day = %d",
		instance->Bl.dt_ls, instance->Bl.dt_lsf,
		instance->Bl.WN, instance->Bl.DN, 
		instance->Bl.WN_lsf, instance->Bl.DN_lsf,
		instance->Bl.wn_flg, instance->Bl.lsf_flg,
		instance->Bl.Bl_day);
	oncore_log(instance, LOG_INFO, Msg);
}


static void
oncore_msg_BnEnHn(
	struct instance *instance,
	u_char *buf,
	size_t	len
	)
{
	long	dt1, dt2;

	if (instance->o_state != ONCORE_RUN)
		return;

	if (instance->traim_delay) {	 /* flag that @@Bn/@@En/Hn returned */
			instance->traim_ck = 1;
			instance->traim_delay = 0;
			oncore_log(instance, LOG_NOTICE, "ONCORE: Detected TRAIM, TRAIM = ON");

			oncore_set_traim(instance);
	}

	memcpy(instance->BEHn, buf, (size_t) len);	/* Bn or En or Hn */

	if (!instance->traim)	/* BnEnHn will be turned off in any case */
		return;

	/* If Time RAIM doesn't like it, don't trust it */

	if (buf[2] == 'H') {
		if (instance->BEHn[6]) {    /* bad TRAIM */
			oncore_log(instance, LOG_WARNING, "BAD TRAIM");
			return;
		}

		dt1 = instance->saw_tooth + instance->offset;	 /* dt this time step */
		instance->saw_tooth = (s_char) instance->BEHn[14]; /* update for next time Hn[14] */
		dt2 = instance->saw_tooth + instance->offset;	 /* dt next time step */
	} else {
		if (instance->BEHn[21]) /* bad TRAIM */
			return;

		dt1 = instance->saw_tooth + instance->offset;	 /* dt this time step */
		instance->saw_tooth = (s_char) instance->BEHn[25]; /* update for next time Bn[25], En[25] */
		dt2 = instance->saw_tooth + instance->offset;	 /* dt next time step */
	}

	oncore_get_timestamp(instance, dt1, dt2);
}



/* Here for @@Ca, @@Fa and @@Ia messages */

/* These are Self test Commands for 6, 8, and 12 chan receivers.
 * There are good reasons NOT to do a @@Ca, @@Fa or @@Ia command with the ONCORE.
 * It was found that under some circumstances the following
 * command would fail if issued immediately after the return from the
 * @@Fa, but a 2sec delay seemed to fix things.  Since simply calling
 * sleep(2) is wasteful, and may cause trouble for some OS's, repeating
 * itimer, we set a flag, and test it at the next POLL.  If it hasn't
 * been cleared, we reissue the @@Cj that is issued below.
 * Note that we do a @@Cj at the beginning, and again here.
 * The first is to get the info, the 2nd is just used as a safe command
 * after the @@Fa for all Oncores (and it was in this posn in the
 * original code).
 */

static void
oncore_msg_CaFaIa(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	char	Msg[120];
	int	i;

	if (instance->o_state == ONCORE_TEST_SENT) {
		enum antenna_state antenna;

		instance->timeout = 0;

#if ONCORE_VERBOSE_SELF_TEST
		if (debug > 2) {
			if (buf[2] == 'I')
				snprintf(Msg, sizeof(Msg),
					 ">>@@%ca %x %x %x", buf[2],
					 buf[4], buf[5], buf[6]);
			else
				snprintf(Msg, sizeof(Msg),
					 ">>@@%ca %x %x", buf[2],
					 buf[4], buf[5]);
			oncore_log(instance, LOG_DEBUG, Msg);
		}
#endif

		antenna = (buf[4] & 0xc0) >> 6;
		buf[4] &= ~0xc0;

		i = buf[4] || buf[5];
		if (buf[2] == 'I') i = i || buf[6];
		if (i) {
			if (buf[2] == 'I')
				snprintf(Msg, sizeof(Msg), 
					 "self test failed: result %02x %02x %02x",
					 buf[4], buf[5], buf[6]);
			else
				snprintf(Msg, sizeof(Msg),
					 "self test failed: result %02x %02x",
					 buf[4], buf[5]);
			oncore_log(instance, LOG_ERR, Msg);

			oncore_log(instance, LOG_ERR, 
				   "ONCORE: self test failed, shutting down driver");

			refclock_report(instance->peer, CEVNT_FAULT);
			oncore_shutdown(instance->unit, instance->peer);
			return;
		}

		/* report the current antenna state */

		oncore_antenna_report(instance, antenna);

		instance->o_state = ONCORE_INIT;
		oncore_log(instance, LOG_NOTICE, "state = ONCORE_INIT");

		instance->timeout = 4;
		oncore_sendmsg(instance, oncore_cmd_Cj, sizeof(oncore_cmd_Cj));
	}
}



/*
 * Demultiplex the almanac into shmem
 */

static void
oncore_msg_Cb(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	int i;

	if (instance->shmem == NULL)
		return;

	if (buf[4] == 5 && buf[5] > 0 && buf[5] < 26)
		i = buf[5];
	else if (buf[4] == 4 && buf[5] <= 5)
		i = buf[5] + 24;
	else if (buf[4] == 4 && buf[5] <= 10)
		i = buf[5] + 23;
	else if (buf[4] == 4 && buf[5] == 25)
		i = 34;
	else {
		oncore_log(instance, LOG_NOTICE, "Cb: Response is NO ALMANAC");
		return;
	}

	i *= 36;
	instance->shmem[instance->shmem_Cb + i + 2]++;
	memcpy(instance->shmem + instance->shmem_Cb + i + 3, buf, (size_t) (len + 3));

#ifdef ONCORE_VERBOSE_MSG_CB
	{
		char Msg[160];

		snprintf(Msg, sizeof(Msg), "See Cb [%d,%d]", buf[4],
			 buf[5]);
		oncore_log(instance, LOG_DEBUG, Msg);
	}
#endif
}



/*
 * Set to Factory Defaults (Reasonable for UT w/ no Battery Backup
 *	not so for VP (eeprom) or any unit with a battery
 */

static void
oncore_msg_Cf(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	if (instance->o_state == ONCORE_RESET_SENT) {
		oncore_sendmsg(instance, oncore_cmd_Cg, sizeof(oncore_cmd_Cg)); /* Return to  Posn Fix mode */
										       /* Reset set VP to IDLE */
		instance->o_state = ONCORE_TEST_SENT;
		oncore_log(instance, LOG_NOTICE, "state = ONCORE_TEST_SENT");

		oncore_sendmsg(instance, oncore_cmd_Cj, sizeof(oncore_cmd_Cj));
	}
}



/*
 * This is the Grand Central Station for the Preliminary Initialization.
 * Once done here we move on to oncore_msg_BaEaHa for final Initialization and Running.
 *
 * We do an @@Cj whenever we need a safe command for all Oncores.
 * The @@Cj gets us back here where we can switch to the next phase of setup.
 *
 * o Once at the very beginning (in start) to get the Model number.
 *   This info is printed, but no longer used.
 * o Again after we have determined the number of Channels in the receiver.
 * o And once later after we have done a reset and test, (which may hang),
 *   as we are about to initialize the Oncore and start it running.
 * o We have one routine below for each case.
 */

static void
oncore_msg_Cj(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	int	mode;

	memcpy(instance->Cj, buf, len);

	instance->timeout = 0;
	if (instance->o_state == ONCORE_CHECK_ID) {
		oncore_msg_Cj_id(instance, buf, len);
		oncore_chan_test(instance);
	} else if (instance->o_state == ONCORE_HAVE_CHAN) {
		mode = instance->init_type;
		if (mode == 3 || mode == 4) {	/* Cf will return here to check for TEST */
			instance->o_state = ONCORE_RESET_SENT;
			oncore_log(instance, LOG_NOTICE, "state = ONCORE_RESET_SENT");
			oncore_sendmsg(instance, oncore_cmd_Cf, sizeof(oncore_cmd_Cf));
		} else {
			instance->o_state = ONCORE_TEST_SENT;
			oncore_log(instance, LOG_NOTICE, "state = ONCORE_TEST_SENT");
		}
	}

	if (instance->o_state == ONCORE_TEST_SENT) {
		if (instance->chan == 6)
			oncore_sendmsg(instance, oncore_cmd_Ca, sizeof(oncore_cmd_Ca));
		else if (instance->chan == 8)
			oncore_sendmsg(instance, oncore_cmd_Fa, sizeof(oncore_cmd_Fa));
		else if (instance->chan == 12)
			oncore_sendmsg(instance, oncore_cmd_Ia, sizeof(oncore_cmd_Ia));
	} else if (instance->o_state == ONCORE_INIT)
		oncore_msg_Cj_init(instance, buf, len);
}



/* The information on determining a Oncore 'Model', viz VP, UT, etc, from
 *	the Model Number comes from "Richard M. Hambly" 
 *	and from Motorola.  Until recently Rick was the only source of
 *	this information as Motorola didn't give the information out.
 *
 * Determine the Type from the Model #, this determines #chan and if TRAIM is
 *   available.
 *
 * The Information from this routine is NO LONGER USED.
 * The RESULTS are PRINTED, BUT NOT USED, and the routine COULD BE DELETED
 */

static void
oncore_msg_Cj_id(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	char *cp, *cp1, *cp2, Model[21], Msg[160];

	/* Write Receiver ID message to clockstats file */

	instance->Cj[294] = '\0';
	for (cp=(char *)instance->Cj; cp< (char *) &instance->Cj[294]; ) {
		cp1 = strchr(cp, '\r');
		if (!cp1)
			cp1 = (char *)&instance->Cj[294];
		*cp1 = '\0';
		oncore_log(instance, LOG_NOTICE, cp);
		*cp1 = '\r';
		cp = cp1+2;
	}

	/* next, the Firmware Version and Revision numbers */

	instance->version  = atoi((char *) &instance->Cj[83]);
	instance->revision = atoi((char *) &instance->Cj[111]);

	/* from model number decide which Oncore this is,
		and then the number of channels */

	for (cp= (char *) &instance->Cj[160]; *cp == ' '; cp++)   /* start right after 'Model #' */
		;
	cp1 = cp;
	cp2 = Model;
	for (; !isspace((int)*cp) && cp-cp1 < 20; cp++, cp2++)
		*cp2 = *cp;
	*cp2 = '\0';

	cp = 0;
	if (!strncmp(Model, "PVT6", (size_t) 4)) {
		cp = "PVT6";
		instance->model = ONCORE_PVT6;
	} else if (Model[0] == 'A') {
		cp = "Basic";
		instance->model = ONCORE_BASIC;
	} else if (Model[0] == 'B' || !strncmp(Model, "T8", (size_t) 2)) {
		cp = "VP";
		instance->model = ONCORE_VP;
	} else if (Model[0] == 'P') {
		cp = "M12";
		instance->model = ONCORE_M12;
	} else if (Model[0] == 'R' || Model[0] == 'D' || Model[0] == 'S') {
		if (Model[5] == 'N') {
			cp = "GT";
			instance->model = ONCORE_GT;
		} else if ((Model[1] == '3' || Model[1] == '4') && Model[5] == 'G') {
			cp = "GT+";
			instance->model = ONCORE_GTPLUS;
		} else if ((Model[1] == '5' && Model[5] == 'U') || (Model[1] == '1' && Model[5] == 'A')) {
				cp = "UT";
				instance->model = ONCORE_UT;
		} else if (Model[1] == '5' && Model[5] == 'G') {
			cp = "UT+";
			instance->model = ONCORE_UTPLUS;
		} else if (Model[1] == '6' && Model[5] == 'G') {
			cp = "SL";
			instance->model = ONCORE_SL;
		} else {
			cp = "Unknown";
			instance->model = ONCORE_UNKNOWN;
		}
	} else	{
		cp = "Unknown";
		instance->model = ONCORE_UNKNOWN;
	}

	/* use MODEL to set CHAN and TRAIM and possibly zero SHMEM */

	snprintf(Msg, sizeof(Msg),
		 "This looks like an Oncore %s with version %d.%d firmware.",
		 cp, instance->version, instance->revision);
	oncore_log(instance, LOG_INFO, Msg);

	instance->chan_id = 8;	   /* default */
	if (instance->model == ONCORE_BASIC || instance->model == ONCORE_PVT6)
		instance->chan_id = 6;
	else if (instance->model == ONCORE_VP || instance->model == ONCORE_UT || instance->model == ONCORE_UTPLUS)
		instance->chan_id = 8;
	else if (instance->model == ONCORE_M12)
		instance->chan_id = 12;

	instance->traim_id = 0;    /* default */
	if (instance->model == ONCORE_BASIC || instance->model == ONCORE_PVT6)
		instance->traim_id = 0;
	else if (instance->model == ONCORE_VP || instance->model == ONCORE_UT || instance->model == ONCORE_UTPLUS)
		instance->traim_id = 1;
	else if (instance->model == ONCORE_M12)
		instance->traim_id = -1;

	snprintf(Msg, sizeof(Msg), "Channels = %d, TRAIM = %s",
		 instance->chan_id,
		 ((instance->traim_id < 0)
		      ? "UNKNOWN"
		      : (instance->traim_id > 0)
		            ? "ON"
			    : "OFF"));
	oncore_log(instance, LOG_INFO, Msg);
}



/* OK, know type of Oncore, have possibly reset it, and have tested it.
 * We know the number of channels.
 * We will determine whether we have TRAIM before we actually start.
 * Now initialize.
 */

static void
oncore_msg_Cj_init(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	char	Msg[160];
	u_char	Cmd[20];
	int	mode;


	/* The M12 with 1.3 or 2.0 Firmware, loses track of all Satellites and has to
	 * start again if we go from 0D -> 3D, then loses them again when we
	 * go from 3D -> 0D.  We do this to get a @@Ea message for SHMEM.
	 * For NOW we will turn this aspect of filling SHMEM off for the M12
	 */

	if (instance->chan == 12) {
		instance->shmem_bad_Ea = 1;
		snprintf(Msg, sizeof(Msg),
			 "*** SHMEM partially enabled for ONCORE M12 s/w v%d.%d ***",
			 instance->version, instance->revision);
		oncore_log(instance, LOG_NOTICE, Msg);
	}

	oncore_sendmsg(instance, oncore_cmd_Cg, sizeof(oncore_cmd_Cg)); /* Return to  Posn Fix mode */
	oncore_sendmsg(instance, oncore_cmd_Bb, sizeof(oncore_cmd_Bb)); /* turn on for shmem (6/8/12) */
	oncore_sendmsg(instance, oncore_cmd_Ek, sizeof(oncore_cmd_Ek)); /* turn off (VP) */
	oncore_sendmsg(instance, oncore_cmd_Aw, sizeof(oncore_cmd_Aw)); /* UTC time (6/8/12) */
	oncore_sendmsg(instance, oncore_cmd_AB, sizeof(oncore_cmd_AB)); /* Appl type static (VP) */
	oncore_sendmsg(instance, oncore_cmd_Be, sizeof(oncore_cmd_Be)); /* Tell us the Almanac for shmem (6/8/12) */
	oncore_sendmsg(instance, oncore_cmd_Bd, sizeof(oncore_cmd_Bd)); /* Tell us when Almanac changes */

	mode = instance->init_type;

	/* If there is Position input in the Config file
	 * and mode = (1,3) set it as posn hold posn, goto 0D mode.
	 *  or mode = (2,4) set it as INITIAL position, and do Site Survey.
	 */

	if (instance->posn_set) {
		oncore_log(instance, LOG_INFO, "Setting Posn from input data");
		oncore_set_posn(instance);	/* this should print posn indirectly thru the As cmd */
	} else	/* must issue an @@At here to check on 6/8 Position Hold, set_posn would have */
		if (instance->chan != 12)
			oncore_sendmsg(instance, oncore_cmd_Atx, sizeof(oncore_cmd_Atx));

	if (mode != 0) {
			/* cable delay in ns */
		memcpy(Cmd, oncore_cmd_Az, (size_t) sizeof(oncore_cmd_Az));
		w32_buf(&Cmd[-2+4], instance->delay);
		oncore_sendmsg(instance, Cmd,  sizeof(oncore_cmd_Az));	/* 6,8,12 */

			/* PPS offset in ns */
		if (instance->offset) {
			memcpy(Cmd, oncore_cmd_Ay, (size_t) sizeof(oncore_cmd_Ay));	/* some have it, some don't */
			w32_buf(&Cmd[-2+4], instance->offset);			/* will check for hw response */
			oncore_sendmsg(instance, Cmd,  sizeof(oncore_cmd_Ay));
		}

		/* Satellite mask angle */

		if (instance->Ag != 0xff) {	/* will have 0xff in it if not set by user */
			memcpy(Cmd, oncore_cmd_Ag, (size_t) sizeof(oncore_cmd_Ag));
			Cmd[-2+4] = instance->Ag;
			oncore_sendmsg(instance, Cmd,  sizeof(oncore_cmd_Ag));
		}
	}

	/* 6, 8 12 chan - Position/Status/Data Output Message, 1/s
	 * now we're really running
	 * these were ALL started in the chan test,
	 * However, if we had mode=3,4 then commands got turned off, so we turn
	 * them on again here just in case
	 */

	if (instance->chan == 6) { /* start 6chan, kill 8,12chan commands, possibly testing VP in 6chan mode */
		oncore_sendmsg(instance, oncore_cmd_Ea0, sizeof(oncore_cmd_Ea0));
		oncore_sendmsg(instance, oncore_cmd_En0, sizeof(oncore_cmd_En0));
		oncore_sendmsg(instance, oncore_cmd_Ha0, sizeof(oncore_cmd_Ha0));
		oncore_sendmsg(instance, oncore_cmd_Hn0, sizeof(oncore_cmd_Hn0));
		oncore_sendmsg(instance, oncore_cmd_Ba, sizeof(oncore_cmd_Ba ));
	} else if (instance->chan == 8) {  /* start 8chan, kill 6,12chan commands */
		oncore_sendmsg(instance, oncore_cmd_Ba0, sizeof(oncore_cmd_Ba0));
		oncore_sendmsg(instance, oncore_cmd_Bn0, sizeof(oncore_cmd_Bn0));
		oncore_sendmsg(instance, oncore_cmd_Ha0, sizeof(oncore_cmd_Ha0));
		oncore_sendmsg(instance, oncore_cmd_Hn0, sizeof(oncore_cmd_Hn0));
		oncore_sendmsg(instance, oncore_cmd_Ea, sizeof(oncore_cmd_Ea ));
	} else if (instance->chan == 12){  /* start 12chan, kill 6,12chan commands */
		oncore_sendmsg(instance, oncore_cmd_Ba0, sizeof(oncore_cmd_Ba0));
		oncore_sendmsg(instance, oncore_cmd_Bn0, sizeof(oncore_cmd_Bn0));
		oncore_sendmsg(instance, oncore_cmd_Ea0, sizeof(oncore_cmd_Ea0));
		oncore_sendmsg(instance, oncore_cmd_En0, sizeof(oncore_cmd_En0));
		oncore_sendmsg(instance, oncore_cmd_Ha, sizeof(oncore_cmd_Ha ));
	}

	instance->count = 1;
	instance->o_state = ONCORE_ALMANAC;
	oncore_log(instance, LOG_NOTICE, "state = ONCORE_ALMANAC");
}



/* 12chan position */

static void
oncore_msg_Ga(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	char Msg[160];
	long lat, lon, ht;
	double Lat, Lon, Ht;


	lat = buf_w32(&buf[4]);
	lon = buf_w32(&buf[8]);
	ht  = buf_w32(&buf[12]);  /* GPS ellipsoid */

	Lat = lat;
	Lon = lon;
	Ht  = ht;

	Lat /= 3600000;
	Lon /= 3600000;
	Ht  /= 100;


	snprintf(Msg, sizeof(Msg),
		 "Ga Posn Lat = %.7f, Lon = %.7f, Ht  = %.2f", Lat,
		 Lon, Ht);
	oncore_log(instance, LOG_NOTICE, Msg);

	instance->ss_lat  = lat;
	instance->ss_long = lon;
	instance->ss_ht   = ht;

	oncore_print_posn(instance);
}



/* 12 chan time/date */

static void
oncore_msg_Gb(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	char	Msg[160], *gmts;
	int	mo, d, y, h, m, s, gmth, gmtm;

	mo = buf[4];
	d  = buf[5];
	y  = 256*buf[6]+buf[7];

	h  = buf[8];
	m  = buf[9];
	s  = buf[10];

	gmts = ((buf[11] == 0) ? "+" : "-");
	gmth = buf[12];
	gmtm = buf[13];

	snprintf(Msg, sizeof(Msg),
		 "Date/Time set to: %d%s%d %2d:%02d:%02d GMT (GMT offset is %s%02d:%02d)",
		 d, Month[mo-1], y, h, m, s, gmts, gmth, gmtm);
	oncore_log(instance, LOG_NOTICE, Msg);
}



/* Leap Second for M12, gives all info from satellite message */
/* also in UT v3.0 */

static void
oncore_msg_Gj(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	int dt;
	char Msg[160], *cp;

	instance->saw_Gj = 1; /* flag, saw_Gj, dont need to try Bj in check_leap */

	/* print the message to verify whats there */

	dt = buf[5] - buf[4];

	snprintf(Msg, sizeof(Msg),
		 "Leap Sec Msg: %d %d %d %d %d %d %d %d %d %d", buf[4],
		 buf[5], 256 * buf[6] + buf[7], buf[8], buf[9], buf[10],
		 (buf[14] + 256 *
		     (buf[13] + 256 * (buf[12] + 256 * buf[11]))),
		 buf[15], buf[16], buf[17]);
	oncore_log(instance, LOG_INFO, Msg);

	if (dt) {
		snprintf(Msg, sizeof(Msg),
			 "Leap second (%d) scheduled for %d%s%d at %d:%d:%d",
			 dt, buf[9], Month[buf[8] - 1], 
			 256 * buf[6] + buf[7], buf[15], buf[16],
			 buf[17]);
		oncore_log(instance, LOG_NOTICE, Msg);
	}

	/* Only raise warning within a month of the leap second */

	instance->pp->leap = LEAP_NOWARNING;
	cp = "Set pp.leap to LEAP_NOWARNING";

	if (buf[6] == instance->BEHa[6] && buf[7] == instance->BEHa[7] && /* year */
	    buf[8] == instance->BEHa[4]) {	/* month */
		if (dt) {
			if (dt < 0) {
				instance->pp->leap = LEAP_DELSECOND;
				cp = "Set pp.leap to LEAP_DELSECOND";
			} else {
				instance->pp->leap = LEAP_ADDSECOND;
				cp = "Set pp.leap to LEAP_ADDSECOND";
			}
		}
	}
	oncore_log(instance, LOG_INFO, cp);
}



/* Power on failure */

static void
oncore_msg_Sz(
	struct instance *instance,
	u_char *buf,
	size_t len
	)
{
	if (instance && instance->peer) {
		oncore_log(instance, LOG_ERR, "Oncore: System Failure at Power On");
		oncore_shutdown(instance->unit, instance->peer);
	}
}

/************** Small Subroutines ***************/


static void
oncore_antenna_report(
	struct instance *instance,
	enum antenna_state new_state)
{
	char *cp;

	if (instance->ant_state == new_state)
		return;

	switch (new_state) {
	case ONCORE_ANTENNA_OK: cp = "GPS antenna: OK";                   break;
	case ONCORE_ANTENNA_OC: cp = "GPS antenna: short (overcurrent)";  break;
	case ONCORE_ANTENNA_UC: cp = "GPS antenna: open (not connected)"; break;
	case ONCORE_ANTENNA_NV: cp = "GPS antenna: short (no voltage)";   break;
	default:		cp = "GPS antenna: ?";                    break;
	}

	instance->ant_state = new_state;
	oncore_log(instance, LOG_NOTICE, cp);
}



static void
oncore_chan_test(
	struct instance *instance
	)
{
	/* subroutine oncore_Cj_id has determined the number of channels from the
	 * model number of the attached oncore.  This is not always correct since
	 * the oncore could have non-standard firmware.  Here we check (independently) by
	 * trying a 6, 8, and 12 chan command, and see which responds.
	 * Caution: more than one CAN respond.
	 *
	 * This #chan is used by the code rather than that calculated from the model number.
	 */

	instance->o_state = ONCORE_CHECK_CHAN;
	oncore_log(instance, LOG_NOTICE, "state = ONCORE_CHECK_CHAN");

	instance->count3 = 1;
	oncore_sendmsg(instance, oncore_cmd_Ba, sizeof(oncore_cmd_Ba));
	oncore_sendmsg(instance, oncore_cmd_Ea, sizeof(oncore_cmd_Ea));
	oncore_sendmsg(instance, oncore_cmd_Ha, sizeof(oncore_cmd_Ha));
}



/* check for a GOOD Almanac, have we got one yet? */

static void
oncore_check_almanac(
	struct instance *instance
	)
{
	if (instance->chan == 6) {
		instance->rsm.bad_almanac = instance->BEHa[64]&0x1;
		instance->rsm.bad_fix	  = instance->BEHa[64]&0x52;
	} else if (instance->chan == 8) {
		instance->rsm.bad_almanac = instance->BEHa[72]&0x1;
		instance->rsm.bad_fix	  = instance->BEHa[72]&0x52;
	} else if (instance->chan == 12) {
		int bits1, bits2, bits3;

		bits1 = (instance->BEHa[129]>>5) & 0x7; 	/* actually Ha */
		bits2 = instance->BEHa[130];
		instance->rsm.bad_almanac = (bits2 & 0x80);
		instance->rsm.bad_fix	  = (bits2 & 0x8) || (bits1 == 0x2);
					  /* too few sat     Bad Geom	  */

		bits3 = instance->BEHa[141];	/* UTC parameters */
		if (!instance->count5_set && (bits3 & 0xC0)) {
			instance->count5 = 2;
			instance->count5_set = 1;
		}
#ifdef ONCORE_VERBOSE_CHECK_ALMANAC
		{
			char Msg[160];

			snprintf(Msg, sizeof(Msg),
				 "DEBUG BITS: (%x %x), (%x %x %x),  %x %x %x %x %x",
				 instance->BEHa[129],
				 instance->BEHa[130], bits1, bits2,
				 bits3, instance->mode == MODE_0D,
				 instance->mode == MODE_2D, 
				 instance->mode == MODE_3D,
				 instance->rsm.bad_almanac,
				 instance->rsm.bad_fix);
			oncore_log(instance, LOG_DEBUG, Msg);
		}
#endif
	}
}



/* check the antenna for changes (did it get unplugged?) */

static void
oncore_check_antenna(
	struct instance *instance
	)
{
	enum antenna_state antenna;		/* antenna state */

	antenna = instance->ant_state;
	if (instance->chan == 12)
		antenna = (instance->BEHa[130] & 0x6 ) >> 1;
	else
		antenna = (instance->BEHa[37] & 0xc0) >> 6;  /* prob unset 6, set GT, UT unset VP */

	oncore_antenna_report (instance, antenna);
}



/*
 * Check the leap second status once per day.
 *
 * Note that the ONCORE firmware for the Bj command is wrong at
 * least in the VP.
 * It starts advertising a LEAP SECOND as soon as the GPS satellite
 * data message (page 18, subframe 4) is updated to a date in the
 * future, and does not wait for the month that it will occur.
 * The event will usually be advertised several months in advance.
 * Since there is a one bit flag, there is no way to tell if it is
 * this month, or when...
 *
 * As such, we have the workaround below, of only checking for leap
 * seconds with the Bj command in June/December.
 *
 * The Gj command gives more information, and we can tell in which
 * month to apply the correction.
 *
 * Note that with the VP we COULD read the raw data message, and
 * interpret it ourselves, but since this is specific to this receiver
 * only, and the above workaround is adequate, we don't bother.
 */

static void
oncore_check_leap_sec(
	struct instance *instance
	)
{
	oncore_cmd_Bl[2] = 1;				/* just to be sure */
	if (instance->Bj_day != instance->BEHa[5]) {	/* do this 1/day */
		instance->Bj_day = instance->BEHa[5];

		if (instance->saw_Gj < 0) {	/* -1 DONT have Gj use Bj */
			if ((instance->BEHa[4] == 6) || (instance->BEHa[4] == 12))
				oncore_sendmsg(instance, oncore_cmd_Bj, sizeof(oncore_cmd_Bj));
				oncore_sendmsg(instance, oncore_cmd_Bl, sizeof(oncore_cmd_Bl));
			return;
		}

		if (instance->saw_Gj == 0)	/* 0 is dont know if we have Gj */
			instance->count4 = 1;

		oncore_sendmsg(instance, oncore_cmd_Gj, sizeof(oncore_cmd_Gj));
		return;
	}

	/* Gj works for some 6/8 chan UT and the M12	  */
	/* if no response from Gj in 5 sec, we try Bj	  */
	/* which isnt implemented in all the GT/UT either */

	if (instance->count4) { 	/* delay, waiting for Gj response */
		if (instance->saw_Gj == 1)
			instance->count4 = 0;
		else if (instance->count4++ > 5) {	/* delay, waiting for Gj response */
			instance->saw_Gj = -1;		/* didnt see it, will use Bj */
			instance->count4 = 0;
			if ((instance->BEHa[4] == 6) || (instance->BEHa[4] == 12))
				oncore_sendmsg(instance, oncore_cmd_Bj, sizeof(oncore_cmd_Bj));
				oncore_sendmsg(instance, oncore_cmd_Bl, sizeof(oncore_cmd_Bl));
		}
	}
}



/* check the message checksum,
 *  buf points to START of message ( @@ )
 *  len is length WITH CR/LF.
 */

static int
oncore_checksum_ok(
	u_char *buf,
	int	len
	)
{
	int	i, j;

	j = 0;
	for (i = 2; i < len-3; i++)
		j ^= buf[i];

	return(j == buf[len-3]);
}



static void
oncore_compute_dH(
	struct instance *instance
	)
{
	int GPS, MSL;
	char	Msg[160];

	/* Here calculate dH = GPS - MSL for output message */
	/* also set Altitude Hold mode if GT */

	instance->have_dH = 1;
	if (instance->chan == 12) {
		GPS = buf_w32(&instance->BEHa[39]);
		MSL = buf_w32(&instance->BEHa[43]);
	} else {
		GPS = buf_w32(&instance->BEHa[23]);
		MSL = buf_w32(&instance->BEHa[27]);
	}
	instance->dH = GPS - MSL;
	instance->dH /= 100.;

	/* if MSL is not set, the calculation is meaningless */

	if (MSL) {	/* not set ! */
		snprintf(Msg, sizeof(Msg), "dH = (GPS - MSL) = %.2fm",
			 instance->dH);
		oncore_log(instance, LOG_INFO, Msg);
	}
}



/*
 * try loading Almanac from shmem (where it was copied from shmem_old
 */

static void
oncore_load_almanac(
	struct instance *instance
	)
{
	u_char	*cp, Cmd[20];
	int	n;
	struct timeval tv;
	struct tm *tm;

	if (!instance->shmem)
		return;

#ifndef ONCORE_VERBOSE_LOAD_ALMANAC
	for (cp = instance->shmem + 4; (n = 256 * (*(cp-3)) + *(cp-2));
	     cp += (n + 3)) {
		if (!strncmp((char *) cp, "@@Cb", 4) &&
		    oncore_checksum_ok(cp, 33) &&
		    (*(cp+4) == 4 || *(cp+4) == 5)) {
			write(instance->ttyfd, cp, n);
			oncore_print_Cb(instance, cp);
		}
	}
#else	/* ONCORE_VERBOSE_LOAD_ALMANAC follows */
	for (cp = instance->shmem + 4; (n = 256 * (*(cp-3)) + *(cp-2));
	     cp += (n+3)) {
		char Msg[160];

		snprintf(Msg, sizeof(Msg), "See %c%c%c%c %d", *(cp),
			 *(cp+1), *(cp+2), *(cp+3), *(cp+4));
		oncore_log(instance, LOG_DEBUG, Msg);

		if (!strncmp(cp, "@@Cb", 4)) {
			oncore_print_Cb(instance, cp);
			if (oncore_checksum_ok(cp, 33)) {
				if (*(cp+4) == 4 || *(cp+4) == 5) {
					oncore_log(instance, LOG_DEBUG, "GOOD SF");
					write(instance->ttyfd, cp, n);
				} else
					oncore_log(instance, LOG_DEBUG, "BAD SF");
			} else
				oncore_log(instance, LOG_DEBUG, "BAD CHECKSUM");
		}
	}
#endif

	/* Must load position and time or the Almanac doesn't do us any good */

	if (!instance->posn_set) {	/* if we input a posn use it, else from SHMEM */
		oncore_log(instance, LOG_NOTICE, "Loading Posn from SHMEM");
		for (cp=instance->shmem+4; (n = 256*(*(cp-3)) + *(cp-2));  cp+=(n+3)) {
			if ((instance->chan == 6  && (!strncmp((char *) cp, "@@Ba", 4) && oncore_checksum_ok(cp,  68))) ||
			    (instance->chan == 8  && (!strncmp((char *) cp, "@@Ea", 4) && oncore_checksum_ok(cp,  76))) ||
			    (instance->chan == 12 && (!strncmp((char *) cp, "@@Ha", 4) && oncore_checksum_ok(cp, 154)))) {
				int ii, jj, kk;

				instance->posn_set = 1;
				ii = buf_w32(cp + 15);
				jj = buf_w32(cp + 19);
				kk = buf_w32(cp + 23);
#ifdef ONCORE_VERBOSE_LOAD_ALMANAC
				{
					char Msg[160];
					snprintf(Msg, sizeof(Msg),
						 "SHMEM posn = %ld (%d, %d, %d)",
						 (long)(cp-instance->shmem),
						 ii, jj, kk);
					oncore_log(instance, LOG_DEBUG, Msg);
				}
#endif
				if (ii != 0 || jj != 0 || kk != 0) { /* phk asked for this test */
					instance->ss_lat  = ii;
					instance->ss_long = jj;
					instance->ss_ht   = kk;
				}
			}
		}
	}
	oncore_set_posn(instance);

	/* and set time to time from Computer clock */

	GETTIMEOFDAY(&tv, 0);
	tm = gmtime((const time_t *) &tv.tv_sec);

#ifdef ONCORE_VERBOSE_LOAD_ALMANAC
	{
		char Msg[160];
		snprintf(Msg, sizeof(Msg), "DATE %d %d %d, %d %d %d",
			 1900 + tm->tm_year, tm->tm_mon, tm->tm_mday,
			 tm->tm_hour, tm->tm_min, tm->tm_sec);
		oncore_log(instance, LOG_DEBUG, Msg);
	}
#endif
	if (instance->chan == 12) {
		memcpy(Cmd, oncore_cmd_Gb, (size_t) sizeof(oncore_cmd_Gb));
		Cmd[-2+4]  = tm->tm_mon + 1;
		Cmd[-2+5]  = tm->tm_mday;
		Cmd[-2+6]  = (1900+tm->tm_year)/256;
		Cmd[-2+7]  = (1900+tm->tm_year)%256;
		Cmd[-2+8]  = tm->tm_hour;
		Cmd[-2+9]  = tm->tm_min;
		Cmd[-2+10] = tm->tm_sec;
		Cmd[-2+11] = 0;
		Cmd[-2+12] = 0;
		Cmd[-2+13] = 0;
		oncore_sendmsg(instance, Cmd,  sizeof(oncore_cmd_Gb));
	} else {
		/* First set GMT offset to zero */

		oncore_sendmsg(instance, oncore_cmd_Ab, sizeof(oncore_cmd_Ab));

		memcpy(Cmd, oncore_cmd_Ac, (size_t) sizeof(oncore_cmd_Ac));
		Cmd[-2+4] = tm->tm_mon + 1;
		Cmd[-2+5] = tm->tm_mday;
		Cmd[-2+6] = (1900+tm->tm_year)/256;
		Cmd[-2+7] = (1900+tm->tm_year)%256;
		oncore_sendmsg(instance, Cmd,  sizeof(oncore_cmd_Ac));

		memcpy(Cmd, oncore_cmd_Aa, (size_t) sizeof(oncore_cmd_Aa));
		Cmd[-2+4] = tm->tm_hour;
		Cmd[-2+5] = tm->tm_min;
		Cmd[-2+6] = tm->tm_sec;
		oncore_sendmsg(instance, Cmd,  sizeof(oncore_cmd_Aa));
	}

	oncore_log(instance, LOG_INFO, "Setting Posn and Time after Loading Almanac");
}



/* Almanac data input */

static void
oncore_print_Cb(
	struct instance *instance,
	u_char *cp
	)
{
#ifdef ONCORE_VERBOSE_CB
	int	ii;
	char	Msg[160], Msg2[10];

	snprintf(Msg, sizeof(Msg), "DEBUG: See: %c%c%c%c", *(cp),
		 *(cp+1), *(cp+2), *(cp+3));
	oncore_log(instance, LOG_DEBUG, Msg);
	snprintf(Msg, sizeof(Msg), "DEBUG: Cb: [%d,%d]", *(cp+4),
		*(cp+5));
	for(ii = 0; ii < 33; ii++) {
		snprintf(Msg2, sizeof(Msg2), " %d", *(cp+ii));
		strncat(Msg, Msg2, sizeof(Msg));
	}
	oncore_log(instance, LOG_DEBUG, Msg);

	snprintf(Msg, sizeof(Msg), "Debug: Cb: [%d,%d]", *(cp+4),
		 *(cp+5));
	oncore_log(instance, LOG_DEBUG, Msg);
#endif
}


#if 0
static void
oncore_print_array(
	u_char *cp,
	int	n
	)
{
	int	jj, i, j, nn;

	nn = 0;
	printf("\nTOP\n");
	jj = n/16;
	for (j=0; jss_long;
	if (lon < 0) {
		ew = 'W';
		lon = -lon;
	}

	ns = 'N';
	lat = instance->ss_lat;
	if (lat < 0) {
		ns = 'S';
		lat = -lat;
	}

	hm = instance->ss_ht/100.;
	hft= hm/0.3048;

	xd = lat/3600000.;	/* lat, lon in int msec arc, ht in cm. */
	yd = lon/3600000.;
	snprintf(Msg, sizeof(Msg),
		 "Lat = %c %11.7fdeg,    Long = %c %11.7fdeg,    Alt = %5.2fm (%5.2fft) GPS",
		 ns, xd, ew, yd, hm, hft);
	oncore_log(instance, LOG_INFO, Msg);

	idx = xd;
	idy = yd;
	imx = lat%3600000;
	imy = lon%3600000;
	xm = imx/60000.;
	ym = imy/60000.;
	snprintf(Msg, sizeof(Msg),
	    "Lat = %c %3ddeg %7.4fm,   Long = %c %3ddeg %8.5fm,  Alt = %7.2fm (%7.2fft) GPS", ns, idx, xm, ew, idy, ym, hm, hft);
	oncore_log(instance, LOG_INFO, Msg);

	imx = xm;
	imy = ym;
	is  = lat%60000;
	xs  = is/1000.;
	is  = lon%60000;
	ys  = is/1000.;
	snprintf(Msg, sizeof(Msg),
		 "Lat = %c %3ddeg %2dm %5.2fs, Long = %c %3ddeg %2dm %5.2fs, Alt = %7.2fm (%7.2fft) GPS",
		 ns, idx, imx, xs, ew, idy, imy, ys, hm, hft);
	oncore_log(instance, LOG_INFO, Msg);
}



/*
 * write message to Oncore.
 */

static void
oncore_sendmsg(
	struct	instance *instance,
	u_char *ptr,
	size_t len
	)
{
	int	fd;
	u_char cs = 0;

	fd = instance->ttyfd;
#ifdef ONCORE_VERBOSE_SENDMSG
	if (debug > 4) {
		char	Msg[120];

		snprintf(Msg, sizeof(Msg), "ONCORE: Send @@%c%c %d",
			 ptr[0], ptr[1], (int)len);
		oncore_log(instance, LOG_DEBUG, Msg);
	}
#endif
	write(fd, "@@", (size_t) 2);
	write(fd, ptr, len);
	while (len--)
		cs ^= *ptr++;
	write(fd, &cs, (size_t) 1);
	write(fd, "\r\n", (size_t) 2);
}



static void
oncore_set_posn(
	struct instance *instance
	)
{
	int	mode;
	u_char	  Cmd[20];

	/* Turn OFF position hold, it needs to be off to set position (for some units),
	   will get set ON in @@Ea later */

	if (instance->chan == 12)
		oncore_sendmsg(instance, oncore_cmd_Gd0, sizeof(oncore_cmd_Gd0)); /* (12) */
	else {
		oncore_sendmsg(instance, oncore_cmd_At0, sizeof(oncore_cmd_At0)); /* (6/8) */
		oncore_sendmsg(instance, oncore_cmd_Av0, sizeof(oncore_cmd_Av0)); /* (6/8) */
	}

	mode = instance->init_type;

	if (mode != 0) {	/* first set posn hold position */
		memcpy(Cmd, oncore_cmd_As, (size_t) sizeof(oncore_cmd_As));	/* don't modify static variables */
		w32_buf(&Cmd[-2+4],  (int) instance->ss_lat);
		w32_buf(&Cmd[-2+8],  (int) instance->ss_long);
		w32_buf(&Cmd[-2+12], (int) instance->ss_ht);
		Cmd[-2+16] = 0;
		oncore_sendmsg(instance, Cmd,  sizeof(oncore_cmd_As));	/* posn hold 3D posn (6/8/12) */

		memcpy(Cmd, oncore_cmd_Au, (size_t) sizeof(oncore_cmd_Au));
		w32_buf(&Cmd[-2+4], (int) instance->ss_ht);
		Cmd[-2+8] = 0;
		oncore_sendmsg(instance, Cmd,  sizeof(oncore_cmd_Au));	/* altitude hold (6/8/12 not UT, M12T) */

		/* next set current position */

		if (instance->chan == 12) {
			memcpy(Cmd, oncore_cmd_Ga, (size_t) sizeof(oncore_cmd_Ga));
			w32_buf(&Cmd[-2+4], (int) instance->ss_lat);
			w32_buf(&Cmd[-2+8], (int) instance->ss_long);
			w32_buf(&Cmd[-2+12],(int) instance->ss_ht);
			Cmd[-2+16] = 0;
			oncore_sendmsg(instance, Cmd,  sizeof(oncore_cmd_Ga));		  /* 3d posn (12) */
		} else {
			memcpy(Cmd, oncore_cmd_Ad, (size_t) sizeof(oncore_cmd_Ad));
			w32_buf(&Cmd[-2+4], (int) instance->ss_lat);
			oncore_sendmsg(instance, Cmd,  sizeof(oncore_cmd_Ad));	/* lat (6/8) */

			memcpy(Cmd, oncore_cmd_Ae, (size_t) sizeof(oncore_cmd_Ae));
			w32_buf(&Cmd[-2+4], (int) instance->ss_long);
			oncore_sendmsg(instance, Cmd,  sizeof(oncore_cmd_Ae));	/* long (6/8) */

			memcpy(Cmd, oncore_cmd_Af, (size_t) sizeof(oncore_cmd_Af));
			w32_buf(&Cmd[-2+4], (int) instance->ss_ht);
			Cmd[-2+8] = 0;
			oncore_sendmsg(instance, Cmd,  sizeof(oncore_cmd_Af));	/* ht (6/8) */
		}

		/* Finally, turn on position hold */

		if (instance->chan == 12)
			oncore_sendmsg(instance, oncore_cmd_Gd1,  sizeof(oncore_cmd_Gd1));
		else
			oncore_sendmsg(instance, oncore_cmd_At1,  sizeof(oncore_cmd_At1));
	}
}



static void
oncore_set_traim(
	struct instance *instance
	)
{
	char	Msg[160];

	if (instance->traim_in != -1)	/* set in Input */
		instance->traim = instance->traim_in;
	else
		instance->traim = instance->traim_ck;

	snprintf(Msg, sizeof(Msg), "Input   says TRAIM = %d",
		 instance->traim_in);
	oncore_log(instance, LOG_INFO, Msg);
	snprintf(Msg, sizeof(Msg), "Model # says TRAIM = %d",
		 instance->traim_id);
	oncore_log(instance, LOG_INFO, Msg);
	snprintf(Msg, sizeof(Msg), "Testing says TRAIM = %d",
		 instance->traim_ck);
	oncore_log(instance, LOG_INFO, Msg);
	snprintf(Msg, sizeof(Msg), "Using        TRAIM = %d",
		 instance->traim);
	oncore_log(instance, LOG_INFO, Msg);

	if (instance->traim_ck == 1 && instance->traim == 0) {
		/* if it should be off, and I turned it on during testing,
		   then turn it off again */
		if (instance->chan == 6)
			oncore_sendmsg(instance, oncore_cmd_Bnx, sizeof(oncore_cmd_Bnx));
		else if (instance->chan == 8)
			oncore_sendmsg(instance, oncore_cmd_Enx, sizeof(oncore_cmd_Enx));
		else	/* chan == 12 */
			oncore_sendmsg(instance, oncore_cmd_Ge0, sizeof(oncore_cmd_Ge0));
			oncore_sendmsg(instance, oncore_cmd_Hn0, sizeof(oncore_cmd_Hn0));
	}
}



/*
 * if SHMEM active, every 15s, steal one 'tick' to get 2D or 3D posn.
 */

static void
oncore_shmem_get_3D(
	struct instance *instance
	)
{
	if (instance->pp->second%15 == 3) {	/* start the sequence */			/* by changing mode */
		instance->shmem_reset = 1;
		if (instance->chan == 12) {
			if (instance->shmem_Posn == 2)
				oncore_sendmsg(instance, oncore_cmd_Gd2,  sizeof(oncore_cmd_Gd2));  /* 2D */
			else
				oncore_sendmsg(instance, oncore_cmd_Gd0,  sizeof(oncore_cmd_Gd0));  /* 3D */
		} else {
			if (instance->saw_At) { 		/* out of 0D -> 3D mode */
				oncore_sendmsg(instance, oncore_cmd_At0, sizeof(oncore_cmd_At0));
				if (instance->shmem_Posn == 2)	/* 3D -> 2D mode */
					oncore_sendmsg(instance, oncore_cmd_Av1, sizeof(oncore_cmd_Av1));
			} else
				oncore_sendmsg(instance, oncore_cmd_Av0, sizeof(oncore_cmd_Av0));
		}
	} else if (instance->shmem_reset || (instance->mode != MODE_0D)) {
		instance->shmem_reset = 0;
		if (instance->chan == 12)
			oncore_sendmsg(instance, oncore_cmd_Gd1,  sizeof(oncore_cmd_Gd1));	/* 0D */
		else {
			if (instance->saw_At) {
				if (instance->mode == MODE_2D)	/* 2D -> 3D or 0D mode */
					oncore_sendmsg(instance, oncore_cmd_Av0, sizeof(oncore_cmd_Av0));
				oncore_sendmsg(instance, oncore_cmd_At1,  sizeof(oncore_cmd_At1)); /* to 0D mode */
			} else
				oncore_sendmsg(instance, oncore_cmd_Av1,  sizeof(oncore_cmd_Av1));
		}
	}
}



/*
 * Here we do the Software SiteSurvey.
 * We have to average our own position for the Position Hold Mode
 *   We use Heights from the GPS ellipsoid.
 * We check for the END of either HW or SW SiteSurvey.
 */

static void
oncore_ss(
	struct instance *instance
	)
{
	char	Msg[160];
	double	lat, lon, ht;


	if (instance->site_survey == ONCORE_SS_HW) {
		/*
		 * Check to see if Hardware SiteSurvey has Finished.
		 */

		if ((instance->chan == 8  && !(instance->BEHa[37]  & 0x20)) ||
		    (instance->chan == 12 && !(instance->BEHa[130] & 0x10))) {
			oncore_log(instance, LOG_INFO, "Now in 0D mode");

			if (instance->chan == 12)
				oncore_sendmsg(instance, oncore_cmd_Gax, sizeof(oncore_cmd_Gax));
			else
				oncore_sendmsg(instance, oncore_cmd_Asx, sizeof(oncore_cmd_Asx));

			oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_DONE");
			instance->site_survey = ONCORE_SS_DONE;
		}
	} else {
		/*
		 * Must be a Software Site Survey.
		 */

		if (instance->rsm.bad_fix)	/* Not if poor geometry or less than 3 sats */
			return;

		if (instance->mode != MODE_3D)	/* Use only 3D Fixes */
			return;

		instance->ss_lat  += buf_w32(&instance->BEHa[15]);
		instance->ss_long += buf_w32(&instance->BEHa[19]);
		instance->ss_ht   += buf_w32(&instance->BEHa[23]);  /* GPS ellipsoid */
		instance->ss_count++;

		if (instance->ss_count != POS_HOLD_AVERAGE)
			return;

		instance->ss_lat  /= POS_HOLD_AVERAGE;
		instance->ss_long /= POS_HOLD_AVERAGE;
		instance->ss_ht   /= POS_HOLD_AVERAGE;

		snprintf(Msg, sizeof(Msg),
			 "Surveyed posn: lat %.3f (mas) long %.3f (mas) ht %.3f (cm)",
			 instance->ss_lat, instance->ss_long,
			 instance->ss_ht);
		oncore_log(instance, LOG_NOTICE, Msg);
		lat = instance->ss_lat/3600000.;
		lon = instance->ss_long/3600000.;
		ht  = instance->ss_ht/100;
		snprintf(Msg, sizeof(Msg),
			 "Surveyed posn: lat %.7f (deg) long %.7f (deg) ht %.2f (m)",
			 lat, lon, ht);
		oncore_log(instance, LOG_NOTICE, Msg);

		oncore_set_posn(instance);

		oncore_log(instance, LOG_INFO, "Now in 0D mode");

		oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_DONE");
		instance->site_survey = ONCORE_SS_DONE;
	}
}



static int
oncore_wait_almanac(
	struct instance *instance
	)
{
	if (instance->rsm.bad_almanac) {
		instance->counta++;
		if (instance->counta%5 == 0)
			oncore_log(instance, LOG_INFO, "Waiting for Almanac");

		/*
		 * If we get here (first time) then we don't have an almanac in memory.
		 * Check if we have a SHMEM, and if so try to load whatever is there.
		 */

		if (!instance->almanac_from_shmem) {
			instance->almanac_from_shmem = 1;
			oncore_load_almanac(instance);
		}
		return(1);
	} else {  /* Here we have the Almanac, we will be starting the @@Bn/@@En/@@Hn
		     commands, and can finally check for TRAIM.  Again, we set a delay
		     (5sec) and wait for things to settle down */

		if (instance->chan == 6)
			oncore_sendmsg(instance, oncore_cmd_Bn, sizeof(oncore_cmd_Bn));
		else if (instance->chan == 8)
			oncore_sendmsg(instance, oncore_cmd_En, sizeof(oncore_cmd_En));
		else if (instance->chan == 12) {
			oncore_sendmsg(instance, oncore_cmd_Gc, sizeof(oncore_cmd_Gc)); /* 1PPS on, continuous */
			oncore_sendmsg(instance, oncore_cmd_Ge, sizeof(oncore_cmd_Ge)); /* TRAIM on */
			oncore_sendmsg(instance, oncore_cmd_Hn, sizeof(oncore_cmd_Hn)); /* TRAIM status 1/s */
		}
		instance->traim_delay = 1;

		oncore_log(instance, LOG_NOTICE, "Have now loaded an ALMANAC");

		instance->o_state = ONCORE_RUN;
		oncore_log(instance, LOG_NOTICE, "state = ONCORE_RUN");
	}
	return(0);
}



static void
oncore_log (
	struct instance *instance,
	int	log_level,
	const char *msg
	)
{
	int i;
	char	Msg[200];

	snprintf(Msg, sizeof(Msg), "ONCORE[%d]: %s", instance->unit,
		 msg);
	syslog(log_level, Msg);

	i = strlen(msg);

	if (i > 127) {
		snprintf(Msg, sizeof(Msg),
			 "Internal Error: max error msg length exceeded in clockstats file (%d)",
			 i);
		record_clock_stats(&(instance->peer->srcadr), Msg);
		record_clock_stats(&(instance->peer->srcadr), "Start of message was");
		strncpy(Msg, msg, 120);
		record_clock_stats(&(instance->peer->srcadr), Msg);
	} else {	/* now put ONCORE[n]: ahead of message if it will fit */
		if (i < 110) {
			snprintf(Msg, sizeof(Msg), "ONCORE[%d]: %s",
				 instance->unit, msg);
			record_clock_stats(&(instance->peer->srcadr), Msg);
		} else
			record_clock_stats(&(instance->peer->srcadr), msg);
	}

#ifdef ONCORE_VERBOSE_ONCORE_LOG
	instance->max_len = max(i, instance->max_len);
	instance->max_count++;
	if (instance->max_count % 100 == 0) {
		snprintf(Msg, sizeof(Msg),
			 "Max Message Length so far is %d",
			 instance->max_len);
		oncore_log(instance, LOG_INFO, Msg);
	}
#endif
}

#else
int refclock_oncore_bs;
#endif	/* REFCLOCK && CLOCK_ONCORE */
ntp-4.2.6p5/ntpd/refclock_jjy.c0000644000175000017500000011164211505336022015370 0ustar  peterpeter/*
 * refclock_jjy - clock driver for JJY receivers
 */

/**********************************************************************/
/*								      */
/*  Copyright (C) 2001-2004, Takao Abe.  All rights reserved.	      */
/*								      */
/*  Permission to use, copy, modify, and distribute this software     */
/*  and its documentation for any purpose is hereby granted	      */
/*  without fee, provided that the following conditions are met:      */
/*								      */
/*  One retains the entire copyright notice properly, and both the    */
/*  copyright notice and this license. in the documentation and/or    */
/*  other materials provided with the distribution.		      */
/*								      */
/*  This software and the name of the author must not be used to      */
/*  endorse or promote products derived from this software without    */
/*  prior written permission.					      */
/*								      */
/*  THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESSED OR IMPLIED    */
/*  WARRANTIES OF ANY KIND, INCLUDING, BUT NOT LIMITED TO, THE	      */
/*  IMPLIED WARRANTIES OF MERCHANTABLILITY AND FITNESS FOR A	      */
/*  PARTICULAR PURPOSE.						      */
/*  IN NO EVENT SHALL THE AUTHOR TAKAO ABE BE LIABLE FOR ANY DIRECT,  */
/*  INDIRECT, GENERAL, 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. */
/*								      */
/*  This driver is developed in my private time, and is opened as     */
/*  voluntary contributions for the NTP.			      */
/*  The manufacturer of the JJY receiver has not participated in      */
/*  a development of this driver.				      */
/*  The manufacturer does not warrant anything about this driver,     */
/*  and is not liable for anything about this driver.		      */
/*								      */
/**********************************************************************/
/*								      */
/*  Author     Takao Abe					      */
/*  Email      takao_abe@xurb.jp				      */
/*  Homepage   http://www.bea.hi-ho.ne.jp/abetakao/		      */
/*								      */
/*  The email address abetakao@bea.hi-ho.ne.jp is never read	      */
/*  from 2010, because a few filtering rule are provided by the	      */
/*  "hi-ho.ne.jp", and lots of spam mail are reached.		      */
/*  New email address for supporting the refclock_jjy is	      */
/*  takao_abe@xurb.jp						      */
/*								      */
/**********************************************************************/
/*								      */
/*  History							      */
/*								      */
/*  2001/07/15							      */
/*    [New]    Support the Tristate Ltd. JJY receiver		      */
/*								      */
/*  2001/08/04							      */
/*    [Change] Log to clockstats even if bad reply		      */
/*    [Fix]    PRECISION = (-3) (about 100 ms)			      */
/*    [Add]    Support the C-DEX Co.Ltd. JJY receiver		      */
/*								      */
/*  2001/12/04							      */
/*    [Fix]    C-DEX JST2000 ( fukusima@goto.info.waseda.ac.jp )      */
/*								      */
/*  2002/07/12							      */
/*    [Fix]    Portability for FreeBSD ( patched by the user )	      */
/*								      */
/*  2004/10/31							      */
/*    [Change] Command send timing for the Tristate Ltd. JJY receiver */
/*	       JJY-01 ( Firmware version 2.01 )			      */
/*	       Thanks to Andy Taki for testing under FreeBSD	      */
/*								      */
/*  2004/11/28							      */
/*    [Add]    Support the Echo Keisokuki LT-2000 receiver	      */
/*								      */
/*  2006/11/04							      */
/*    [Fix]    C-DEX JST2000					      */
/*	       Thanks to Hideo Kuramatsu for the patch		      */
/*								      */
/*  2009/04/05							      */
/*    [Add]    Support the CITIZEN T.I.C JJY-200 receiver	      */
/*								      */
/*  2010/11/20							      */
/*    [Change] Bug 1618 ( Harmless )				      */
/*	       Code clean up ( Remove unreachable codes ) in	      */
/*	       jjy_start()					      */
/*    [Change] Change clockstats format of the Tristate JJY01/02      */
/*	       Issues more command to get the status of the receiver  */
/*	       when "fudge 127.127.40.X flag1 1" is specified	      */
/*	       ( DATE,STIM -> DCST,STUS,DATE,STIM )		      */
/*								      */
/**********************************************************************/

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_JJY)

#include 
#include 
#include 
#include 
#include 

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_tty.h"
#include "ntp_refclock.h"
#include "ntp_calendar.h"
#include "ntp_stdlib.h"

/**********************************************************************/
/*								      */
/*  The Tristate Ltd. JJY receiver JJY01			      */
/*								      */
/*  Command	   Response		    Remarks		      */
/*  ------------   ----------------------   ---------------------     */
/*  dcst   VALID|INVALID			      */
/*  stus   ADJUSTED|UNADJUSTED			      */
/*  date   YYYY/MM/DD XXX			      */
/*  time   HH:MM:SS				      */
/*  stim   HH:MM:SS	    Reply at just second      */
/*								      */
/*  During synchronization after a receiver is turned on,	      */
/*  It replies the past time from 2000/01/01 00:00:00.		      */
/*  The function "refclock_process" checks the time and tells	      */
/*  as an insanity time.					      */
/*								      */
/**********************************************************************/
/*								      */
/*  The C-DEX Co. Ltd. JJY receiver JST2000			      */
/*								      */
/*  Command	   Response		    Remarks		      */
/*  ------------   ----------------------   ---------------------     */
/*  1J   JYYMMDD HHMMSSS			      */
/*								      */
/**********************************************************************/
/*								      */
/*  The Echo Keisokuki Co. Ltd. JJY receiver LT2000		      */
/*								      */
/*  Command        Response		    Remarks		      */
/*  ------------   ----------------------   ---------------------     */
/*  #					    Mode 1 (Request&Send)     */
/*  T		   YYMMDDWHHMMSS		      */
/*  C					    Mode 2 (Continuous)	      */
/*		   YYMMDDWHHMMSS	      */
/*		   		    Second signal	      */
/*								      */
/**********************************************************************/
/*								      */
/*  The CITIZEN T.I.C CO., LTD. JJY receiver JJY200		      */
/*								      */
/*  Command	   Response		    Remarks		      */
/*  ------------   ----------------------   ---------------------     */
/*		   'XX YY/MM/DD W HH:MM:SS			      */
/*					    XX: OK|NG|ER	      */
/*					    W:  0(Monday)-6(Sunday)   */
/*								      */
/**********************************************************************/

/*
 * Interface definitions
 */
#define	DEVICE  	"/dev/jjy%d"	/* device name and unit */
#define	SPEED232	B9600		/* uart speed (9600 baud) */
#define	SPEED232_TRISTATE_JJY01		B9600   /* UART speed (9600 baud) */
#define	SPEED232_CDEX_JST2000		B9600   /* UART speed (9600 baud) */
#define	SPEED232_ECHOKEISOKUKI_LT2000	B9600   /* UART speed (9600 baud) */
#define	SPEED232_CITIZENTIC_JJY200	B4800   /* UART speed (4800 baud) */
#define	REFID   	"JJY"		/* reference ID */
#define	DESCRIPTION	"JJY Receiver"
#define	PRECISION	(-3)		/* precision assumed (about 100 ms) */

/*
 * JJY unit control structure
 */
struct jjyunit {
	char	unittype ;	    /* UNITTYPE_XXXXXXXXXX */
	short   operationmode ;	    /* Echo Keisokuki LT-2000 : 1 or 2 */
	short	version ;
	short	linediscipline ;    /* LDISC_CLK or LDISC_RAW */
	char    bPollFlag ;	    /* Set by jjy_pool and Reset by jjy_receive */
	int 	linecount ;
	int 	lineerror ;
	int 	year, month, day, hour, minute, second, msecond ;
/* LDISC_RAW only */
#define	MAX_LINECOUNT	8
#define	MAX_RAWBUF   	64
	int 	lineexpect ;
	int 	charexpect [ MAX_LINECOUNT ] ;
	int 	charcount ;
	char	rawbuf [ MAX_RAWBUF ] ;
};

#define	UNITTYPE_TRISTATE_JJY01	1
#define	UNITTYPE_CDEX_JST2000  	2
#define	UNITTYPE_ECHOKEISOKUKI_LT2000  	3
#define	UNITTYPE_CITIZENTIC_JJY200  	4

/*
 * Function prototypes
 */
static	int 	jjy_start		    (int, struct peer *);
static	void	jjy_shutdown		    (int, struct peer *);
static	void	jjy_poll		    (int, struct peer *);
static	void	jjy_poll_tristate_jjy01	    (int, struct peer *);
static	void	jjy_poll_cdex_jst2000	    (int, struct peer *);
static	void	jjy_poll_echokeisokuki_lt2000(int, struct peer *);
static	void	jjy_poll_citizentic_jjy200  (int, struct peer *);
static	void	jjy_receive		    (struct recvbuf *);
static	int	jjy_receive_tristate_jjy01  (struct recvbuf *);
static	int	jjy_receive_cdex_jst2000    (struct recvbuf *);
static	int	jjy_receive_echokeisokuki_lt2000 (struct recvbuf *);
static  int	jjy_receive_citizentic_jjy200 (struct recvbuf *);

static	void	printableString ( char*, int, char*, int ) ;

/*
 * Transfer vector
 */
struct	refclock refclock_jjy = {
	jjy_start,	/* start up driver */
	jjy_shutdown,	/* shutdown driver */
	jjy_poll,	/* transmit poll message */
	noentry,	/* not used */
	noentry,	/* not used */
	noentry,	/* not used */
	NOFLAGS		/* not used */
};

/*
 * Start up driver return code
 */
#define	RC_START_SUCCESS	1
#define	RC_START_ERROR		0

/*
 * Local constants definition
 */

#define	MAX_LOGTEXT	64

/*
 * Tristate JJY01/JJY02 constants definition
 */

#define	TS_JJY01_COMMAND_NUMBER_DATE	1
#define	TS_JJY01_COMMAND_NUMBER_TIME	2
#define	TS_JJY01_COMMAND_NUMBER_STIM	3
#define	TS_JJY01_COMMAND_NUMBER_STUS	4
#define	TS_JJY01_COMMAND_NUMBER_DCST	5

#define	TS_JJY01_REPLY_DATE		"yyyy/mm/dd www\r\n"
#define	TS_JJY01_REPLY_STIM		"hh:mm:ss\r\n"
#define	TS_JJY01_REPLY_STUS_YES		"adjusted\r\n"
#define	TS_JJY01_REPLY_STUS_NO		"unadjusted\r\n"
#define	TS_JJY01_REPLY_DCST_VALID	"valid\r\n"
#define	TS_JJY01_REPLY_DCST_INVALID	"invalid\r\n"

#define	TS_JJY01_REPLY_LENGTH_DATE	    14	/* Length without  */
#define	TS_JJY01_REPLY_LENGTH_STIM	    8	/* Length without  */
#define	TS_JJY01_REPLY_LENGTH_STUS_YES	    8	/* Length without  */
#define	TS_JJY01_REPLY_LENGTH_STUS_NO	    10	/* Length without  */
#define	TS_JJY01_REPLY_LENGTH_DCST_VALID    5	/* Length without  */
#define	TS_JJY01_REPLY_LENGTH_DCST_INVALID  7	/* Length without  */

static  struct
{
	char	commandNumber ;
	char	*commandLog ;
	char	*command ;
	int	commandLength ;
} tristate_jjy01_command_sequence[] =
{
	/* dcst -> VALID or INVALID */
	{ TS_JJY01_COMMAND_NUMBER_DCST, "dcst", "dcst\r\n", 6 },
	/* stus -> ADJUSTED or UNADJUSTED */
	{ TS_JJY01_COMMAND_NUMBER_STUS, "stus", "stus\r\n", 6 },
	/* date -> YYYY/MM/DD WWW */
	{ TS_JJY01_COMMAND_NUMBER_DATE, "date", "date\r\n", 6 },
	/* stim -> HH:MM:SS */
	{ TS_JJY01_COMMAND_NUMBER_STIM, "stim", "stim\r\n", 6 },
	{ 0			      , NULL  , NULL	  , 0 }
} ;


/**************************************************************************************************/
/*  jjy_start - open the devices and initialize data for processing                               */
/**************************************************************************************************/
static int
jjy_start ( int unit, struct peer *peer )
{

	struct jjyunit	    *up ;
	struct refclockproc *pp ;
	int 	fd ;
	char	*pDeviceName ;
	short	iDiscipline ;
	int 	iSpeed232 ;

#ifdef DEBUG
	if ( debug ) {
		printf ( "jjy_start (refclock_jjy.c) : %s  mode=%d  ", ntoa(&peer->srcadr), peer->ttl ) ;
		printf ( DEVICE, unit ) ;
		printf ( "\n" ) ;
	}
#endif
	/*
	 * Open serial port
	 */
	pDeviceName = emalloc ( strlen(DEVICE) + 10 );
	snprintf ( pDeviceName, strlen(DEVICE) + 10, DEVICE, unit ) ;

	/*
	 * peer->ttl is a mode number specified by "127.127.40.X mode N" in the ntp.conf
	 */
	switch ( peer->ttl ) {
	case 0 :
	case 1 :
		iDiscipline = LDISC_CLK ;
		iSpeed232   = SPEED232_TRISTATE_JJY01 ;
		break ;
	case 2 :
		iDiscipline = LDISC_RAW ;
		iSpeed232   = SPEED232_CDEX_JST2000   ;
		break ;
	case 3 :
		iDiscipline = LDISC_CLK ;
		iSpeed232   = SPEED232_ECHOKEISOKUKI_LT2000 ;
		break ;
	case 4 :
		iDiscipline = LDISC_CLK ;
		iSpeed232   = SPEED232_CITIZENTIC_JJY200 ;
		break ;
	default :
		msyslog ( LOG_ERR, "JJY receiver [ %s mode %d ] : Unsupported mode",
			  ntoa(&peer->srcadr), peer->ttl ) ;
		free ( (void*) pDeviceName ) ;
		return RC_START_ERROR ;
	}

	if ( ! ( fd = refclock_open ( pDeviceName, iSpeed232, iDiscipline ) ) ) {
		free ( (void*) pDeviceName ) ;
		return RC_START_ERROR ;
	}
	free ( (void*) pDeviceName ) ;

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc (sizeof(*up));
	memset ( up, 0, sizeof(*up) ) ;
	up->linediscipline = iDiscipline ;

	/*
	 * peer->ttl is a mode number specified by "127.127.40.X mode N" in the ntp.conf
	 */
	switch ( peer->ttl ) {
	case 0 :
		/*
		 * The mode 0 is a default clock type at this time.
		 * But this will be change to auto-detect mode in the future.
		 */
	case 1 :
		up->unittype = UNITTYPE_TRISTATE_JJY01 ;
		up->version  = 100 ;
		/* 2010/11/20 */
		/* Command sequence is defined by the struct tristate_jjy01_command_sequence, */
		/* and the following 3 lines are not used in the mode LDISC_CLK. */
		/* up->lineexpect = 2 ; */
		/* up->charexpect[0] = 14 ; */ /* YYYY/MM/DD WWW */
		/* up->charexpect[1] =  8 ; */ /* HH:MM:SS */
		break ;
	case 2 :
		up->unittype = UNITTYPE_CDEX_JST2000 ;
		up->lineexpect = 1 ;
		up->charexpect[0] = 15 ; /* JYYMMDD HHMMSSS */
		break ;
	case 3 :
		up->unittype = UNITTYPE_ECHOKEISOKUKI_LT2000 ;
		up->operationmode = 2 ;  /* Mode 2 : Continuous mode */
		up->lineexpect = 1 ;
		switch ( up->operationmode ) {
		case 1 :
			up->charexpect[0] = 15 ; /* YYMMDDWHHMMSS */
			break ;
		case 2 :
			up->charexpect[0] = 17 ; /* YYMMDDWHHMMSS */
			break ;
		}
		break ;
	case 4 :
		up->unittype = UNITTYPE_CITIZENTIC_JJY200 ;
		up->lineexpect = 1 ;
		up->charexpect[0] = 23 ; /* 'XX YY/MM/DD W HH:MM:SS */
		break ;

	/* 2010/11/20 */
	/* The "default:" section of this switch block is never executed,     */
	/* because the former switch block traps the same "default:" case.    */
	/* This "default:" section codes are removed to avoid spending time   */
	/* in the future looking, though the codes are functionally harmless. */

	}

	pp = peer->procptr ;
	pp->unitptr       = (caddr_t) up ;
	pp->io.clock_recv = jjy_receive ;
	pp->io.srcclock   = (caddr_t) peer ;
	pp->io.datalen	  = 0 ;
	pp->io.fd	  = fd ;
	if ( ! io_addclock(&pp->io) ) {
		close ( fd ) ;
		pp->io.fd = -1 ;
		free ( up ) ;
		pp->unitptr = NULL ;
		return RC_START_ERROR ;
	}

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION ;
	peer->burst	= 1 ;
	pp->clockdesc	= DESCRIPTION ;
	memcpy ( (char*)&pp->refid, REFID, strlen(REFID) ) ;

	return RC_START_SUCCESS ;

}


/**************************************************************************************************/
/*  jjy_shutdown - shutdown the clock                                                             */
/**************************************************************************************************/
static void
jjy_shutdown ( int unit, struct peer *peer )
{

	struct jjyunit	    *up;
	struct refclockproc *pp;

	pp = peer->procptr ;
	up = (struct jjyunit *) pp->unitptr ;
	if ( -1 != pp->io.fd )
		io_closeclock ( &pp->io ) ;
	if ( NULL != up )
		free ( up ) ;

}


/**************************************************************************************************/
/*  jjy_receive - receive data from the serial interface                                          */
/**************************************************************************************************/
static void
jjy_receive ( struct recvbuf *rbufp )
{

	struct jjyunit	    *up ;
	struct refclockproc *pp ;
	struct peer	    *peer;

	l_fp	tRecvTimestamp;		/* arrival timestamp */
	int 	rc ;
	char	sLogText [ MAX_LOGTEXT ] ;
	int 	i, bCntrlChar ;

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = (struct peer *) rbufp->recv_srcclock ;
	pp = peer->procptr ;
	up = (struct jjyunit *) pp->unitptr ;

	/*
	 * Get next input line
	 */
	pp->lencode  = refclock_gtlin ( rbufp, pp->a_lastcode, BMAX, &tRecvTimestamp ) ;

	if ( up->linediscipline == LDISC_RAW ) {
		/*
		 * The reply with  and  may give a blank line
		 */
		if ( pp->lencode == 0  &&  up->charcount == 0 ) return ;
		/*
		 * Copy received charaters to temporary buffer 
		 */
		for ( i = 0 ;
		      i < pp->lencode && up->charcount < MAX_RAWBUF - 2 ;
		      i ++ , up->charcount ++ ) {
			up->rawbuf[up->charcount] = pp->a_lastcode[i] ;
		}
		while ( up->charcount > 0 && up->rawbuf[0] < ' ' ) {
			for ( i = 0 ; i < up->charcount - 1 ; i ++ )
				up->rawbuf[i] = up->rawbuf[i+1] ;
			up->charcount -- ;
		}
		bCntrlChar = 0 ;
		for ( i = 0 ; i < up->charcount ; i ++ ) {
			if ( up->rawbuf[i] < ' ' ) {
				bCntrlChar = 1 ;
				break ;
			}
		}
		if ( pp->lencode > 0  &&  up->linecount < up->lineexpect ) {
			if ( bCntrlChar == 0  &&
			     up->charcount < up->charexpect[up->linecount] )
				return ;
		}
		up->rawbuf[up->charcount] = 0 ;
	} else {
		/*
		 * The reply with  gives a blank line
		 */
		if ( pp->lencode == 0 ) return ;
	}
	/*
	 * We get down to business
	 */

	pp->lastrec = tRecvTimestamp ;

	up->linecount ++ ;

	if ( up->lineerror != 0 ) return ;

	switch ( up->unittype ) {
	
	case UNITTYPE_TRISTATE_JJY01 :
		rc = jjy_receive_tristate_jjy01  ( rbufp ) ;
		break ;

	case UNITTYPE_CDEX_JST2000 :
		rc = jjy_receive_cdex_jst2000 ( rbufp ) ;
		break ;

	case UNITTYPE_ECHOKEISOKUKI_LT2000 :
		rc = jjy_receive_echokeisokuki_lt2000 ( rbufp ) ;
		break ;

	case UNITTYPE_CITIZENTIC_JJY200 :
		rc = jjy_receive_citizentic_jjy200 ( rbufp ) ;
		break ;

	default :
		rc = 0 ;
		break ;

	}

	if ( up->linediscipline == LDISC_RAW ) {
		if ( up->linecount <= up->lineexpect  &&
		     up->charcount > up->charexpect[up->linecount-1] ) {
			for ( i = 0 ;
			      i < up->charcount - up->charexpect[up->linecount-1] ;
			      i ++ ) {
				up->rawbuf[i] = up->rawbuf[i+up->charexpect[up->linecount-1]] ;
			}
			up->charcount -= up->charexpect[up->linecount-1] ;
		} else {
			up->charcount = 0 ;
		}
	}

	if ( rc == 0 ) 
		return ;

	up->bPollFlag = 0 ;

	if ( up->lineerror != 0 ) {
		refclock_report ( peer, CEVNT_BADREPLY ) ;
		strncpy  ( sLogText, "BAD REPLY [",
			   sizeof( sLogText ) ) ;
		if ( up->linediscipline == LDISC_RAW ) {
			strncat ( sLogText, up->rawbuf,
				  sizeof( sLogText ) -
				      strlen ( sLogText ) - 1 ) ;
		} else {
			strncat ( sLogText, pp->a_lastcode,
				  sizeof( sLogText ) -
				      strlen ( sLogText ) - 1 ) ;
		}
		sLogText[MAX_LOGTEXT-1] = 0 ;
		if ( strlen ( sLogText ) < MAX_LOGTEXT - 2 )
			strncat ( sLogText, "]",
				  sizeof( sLogText ) -
				      strlen ( sLogText ) - 1 ) ;
		record_clock_stats ( &peer->srcadr, sLogText ) ;
		return ;
	}

	pp->year   = up->year ;
	pp->day    = ymd2yd ( up->year, up->month, up->day ) ;
	pp->hour   = up->hour ;
	pp->minute = up->minute ;
	pp->second = up->second ;
	pp->nsec   = up->msecond * 1000000;

	/* 
	 * JST to UTC 
	 */
	pp->hour -= 9 ;
	if ( pp->hour < 0 ) {
		pp->hour += 24 ;
		pp->day -- ;
		if ( pp->day < 1 ) {
			pp->year -- ;
			pp->day  = ymd2yd ( pp->year, 12, 31 ) ;
		}
	}
#ifdef DEBUG
	if ( debug ) {
		printf ( "jjy_receive (refclock_jjy.c) : %04d/%02d/%02d %02d:%02d:%02d.%1d JST   ", 
			  up->year, up->month, up->day, up->hour,
			  up->minute, up->second, up->msecond/100 ) ;
		printf ( "( %04d/%03d %02d:%02d:%02d.%1d UTC )\n",
			  pp->year, pp->day, pp->hour, pp->minute,
			  pp->second, (int)(pp->nsec/100000000) ) ;
	}
#endif

	/*
	 * Process the new sample in the median filter and determine the
	 * timecode timestamp.
	 */

	snprintf ( sLogText, sizeof(sLogText),
		   "%04d/%02d/%02d %02d:%02d:%02d.%1d JST",
		   up->year, up->month, up->day,
		   up->hour, up->minute, up->second, up->msecond/100 ) ;
	record_clock_stats ( &peer->srcadr, sLogText ) ;

	if ( ! refclock_process ( pp ) ) {
		refclock_report(peer, CEVNT_BADTIME);
		return ;
	}

	pp->lastref = pp->lastrec;
	refclock_receive(peer);

}

/**************************************************************************************************/

static int
jjy_receive_tristate_jjy01 ( struct recvbuf *rbufp )
{

	static	char	*sFunctionName = "jjy_receive_tristate_jjy01" ;

	struct jjyunit	    *up ;
	struct refclockproc *pp ;
	struct peer	    *peer;

	char	*pBuf ;
	int 	iLen ;
	int 	rc ;

	int 	bOverMidnight = 0 ;

	char	sLogText [ MAX_LOGTEXT ], sReplyText  [ MAX_LOGTEXT ] ;

	char	*pCmd ;
	int 	iCmdLen ;

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = (struct peer *) rbufp->recv_srcclock ;
	pp = peer->procptr ;
	up = (struct jjyunit *) pp->unitptr ;

	if ( up->linediscipline == LDISC_RAW ) {
		pBuf = up->rawbuf ;
		iLen = up->charcount ;
	} else {
		pBuf = pp->a_lastcode ;
		iLen = pp->lencode ;
	}

	switch ( tristate_jjy01_command_sequence[up->linecount-1].commandNumber ) {

	case TS_JJY01_COMMAND_NUMBER_DATE : /* YYYY/MM/DD WWW */

		if ( iLen != TS_JJY01_REPLY_LENGTH_DATE ) {
			up->lineerror = 1 ;
			break ;
		}

		rc = sscanf ( pBuf, "%4d/%2d/%2d", &up->year,
			      &up->month, &up->day ) ;
		if ( rc != 3 || up->year < 2000 || up->month < 1 ||
		     up->month > 12 || up->day < 1 || up->day > 31 ) {
			up->lineerror = 1 ;
			break ;
		}

		/*** Start of modification on 2004/10/31 ***/
		/*
		 * Following codes are moved from the function jjy_poll_tristate_jjy01 in this source.
		 * The Tristate JJY-01 ( Firmware version 1.01 ) accepts "time" and "stim" commands without any delay.
		 * But the JJY-01 ( Firmware version 2.01 ) does not accept these commands continuously,
		 * so this driver issues the second command "stim" after the reply of the first command "date".
		 */

		/*** 2010/11/20 ***/
		/*
		 * Codes of a next command issue are moved to the end of this function.
		 */

		/*** End of modification ***/

		break ;

	case TS_JJY01_COMMAND_NUMBER_TIME : /* HH:MM:SS */
	case TS_JJY01_COMMAND_NUMBER_STIM : /* HH:MM:SS */

		if ( iLen != TS_JJY01_REPLY_LENGTH_STIM ) {
			up->lineerror = 1 ;
			break ;
		}

		rc = sscanf ( pBuf, "%2d:%2d:%2d", &up->hour,
			      &up->minute, &up->second ) ;
		if ( rc != 3 || up->hour > 23 || up->minute > 59 ||
		     up->second > 60 ) {
			up->lineerror = 1 ;
			break ;
		}

		up->msecond = 0 ;
		if ( up->hour == 0 && up->minute == 0 &&
		     up->second <= 2 ) {
			/*
			 * The command "date" and "time" ( or "stim" ) were sent to the JJY receiver separately,
			 * and the JJY receiver replies a date and time separately.
			 * Just after midnight transitions, we ignore this time.
			 */
			bOverMidnight = 1 ;
		}
		break ;

	case TS_JJY01_COMMAND_NUMBER_STUS :

		if ( ( iLen == TS_JJY01_REPLY_LENGTH_STUS_YES
		    && strncmp( pBuf, TS_JJY01_REPLY_STUS_YES,
				TS_JJY01_REPLY_LENGTH_STUS_YES ) == 0 )
		  || ( iLen == TS_JJY01_REPLY_LENGTH_STUS_NO
		    && strncmp( pBuf, TS_JJY01_REPLY_STUS_NO,
				TS_JJY01_REPLY_LENGTH_STUS_NO ) == 0 ) ) {
			/* Good */
		} else {
			up->lineerror = 1 ;
			break ;
		}

		break ;

	case TS_JJY01_COMMAND_NUMBER_DCST :

		if ( ( iLen == TS_JJY01_REPLY_LENGTH_DCST_VALID
		    && strncmp( pBuf, TS_JJY01_REPLY_DCST_VALID,
				TS_JJY01_REPLY_LENGTH_DCST_VALID ) == 0 )
		  || ( iLen == TS_JJY01_REPLY_LENGTH_DCST_INVALID
		    && strncmp( pBuf, TS_JJY01_REPLY_DCST_INVALID,
				TS_JJY01_REPLY_LENGTH_DCST_INVALID ) == 0 ) ) {
			/* Good */
		} else {
			up->lineerror = 1 ;
			break ;
		}

		break ;

	default : /*  Unexpected reply */

		up->lineerror = 1 ;
		break ;

	}

	/* Clockstats Log */

	printableString( sReplyText, sizeof(sReplyText), pBuf, iLen ) ;
	snprintf ( sLogText, sizeof(sLogText), "%d: %s -> %c: %s",
		   up->linecount,
		   tristate_jjy01_command_sequence[up->linecount-1].commandLog,
		   ( up->lineerror == 0 ) 
			? ( ( bOverMidnight == 0 )
				? 'O' 
				: 'S' ) 
			: 'X',
		   sReplyText ) ;
	record_clock_stats ( &peer->srcadr, sLogText ) ;

	/* Check before issue next command */

	if ( up->lineerror != 0 ) {
		/* Do not issue next command */
		return 0 ;
	}

	if ( bOverMidnight != 0 ) {
		/* Do not issue next command */
		return 0 ;
	}

	if ( tristate_jjy01_command_sequence[up->linecount].command == NULL ) {
		/* Command sequence completed */
		return 1 ;
	}

	/* Issue next command */

#ifdef DEBUG
	if ( debug ) {
		printf ( "%s (refclock_jjy.c) : send '%s'\n",
			sFunctionName, tristate_jjy01_command_sequence[up->linecount].commandLog ) ;
	}
#endif

	pCmd =  tristate_jjy01_command_sequence[up->linecount].command ;
	iCmdLen = tristate_jjy01_command_sequence[up->linecount].commandLength ;
	if ( write ( pp->io.fd, pCmd, iCmdLen ) != iCmdLen ) {
		refclock_report ( peer, CEVNT_FAULT ) ;
	}

	return 0 ;

}

/**************************************************************************************************/

static int
jjy_receive_cdex_jst2000 ( struct recvbuf *rbufp )
{

	static	char	*sFunctionName = "jjy_receive_cdex_jst2000" ;

	struct jjyunit      *up ;
	struct refclockproc *pp ;
	struct peer         *peer;

	char	*pBuf ;
	int 	iLen ;
	int 	rc ;

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = (struct peer *) rbufp->recv_srcclock ;
	pp = peer->procptr ;
	up = (struct jjyunit *) pp->unitptr ;

	if ( up->linediscipline == LDISC_RAW ) {
		pBuf = up->rawbuf ;
		iLen = up->charcount ;
	} else {
		pBuf = pp->a_lastcode ;
		iLen = pp->lencode ;
	}

	switch ( up->linecount ) {

	case 1 : /* JYYMMDD HHMMSSS */

		if ( iLen != 15 ) {
#ifdef DEBUG
			if ( debug >= 2 ) {
				printf ( "%s (refclock_jjy.c) : Reply length error ( iLen=%d )\n",
					 sFunctionName, iLen ) ;
			}
#endif
			up->lineerror = 1 ;
			break ;
		}
		rc = sscanf ( pBuf, "J%2d%2d%2d%*1d%2d%2d%2d%1d",
			      &up->year, &up->month, &up->day,
			      &up->hour, &up->minute, &up->second,
			      &up->msecond ) ;
		if ( rc != 7 || up->month < 1 || up->month > 12 ||
		     up->day < 1 || up->day > 31 || up->hour > 23 ||
		     up->minute > 59 || up->second > 60 ) {
#ifdef DEBUG
			if ( debug >= 2 ) {
				printf ( "%s (refclock_jjy.c) : Time error (rc=%d) [ %02d %02d %02d * %02d %02d %02d.%1d ]\n",
					 sFunctionName, rc, up->year,
					 up->month, up->day, up->hour,
					 up->minute, up->second,
					 up->msecond ) ;
			}
#endif
			up->lineerror = 1 ;
			break ;
		}
		up->year    += 2000 ;
		up->msecond *= 100 ;
		break ;

	default : /*  Unexpected reply */

		up->lineerror = 1 ;
		break ;

	}

	return 1 ;

}

/**************************************************************************************************/

static int
jjy_receive_echokeisokuki_lt2000 ( struct recvbuf *rbufp )
{

	static	char	*sFunctionName = "jjy_receive_echokeisokuki_lt2000" ;

	struct jjyunit      *up ;
	struct refclockproc *pp ;
	struct peer	    *peer;

	char	*pBuf ;
	int 	iLen ;
	int 	rc ;
	int	i, ibcc, ibcc1, ibcc2 ;

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = (struct peer *) rbufp->recv_srcclock ;
	pp = peer->procptr ;
	up = (struct jjyunit *) pp->unitptr ;

	if ( up->linediscipline == LDISC_RAW ) {
		pBuf = up->rawbuf ;
		iLen = up->charcount ;
	} else {
		pBuf = pp->a_lastcode ;
		iLen = pp->lencode ;
	}

	switch ( up->linecount ) {

	case 1 : /* YYMMDDWHHMMSS or YYMMDDWHHMMSS */

		if ( ( up->operationmode == 1 && iLen != 15 ) ||
		     ( up->operationmode == 2 && iLen != 17 ) ) {
#ifdef DEBUG
			if ( debug >= 2 ) {
				printf ( "%s (refclock_jjy.c) : Reply length error ( iLen=%d )\n",
					 sFunctionName, iLen ) ;
			}
#endif
			if ( up->operationmode == 1 ) {
#ifdef DEBUG
				if ( debug ) {
					printf ( "%s (refclock_jjy.c) : send '#'\n", sFunctionName ) ;
				}
#endif
				if ( write ( pp->io.fd, "#",1 ) != 1  ) {
					refclock_report ( peer, CEVNT_FAULT ) ;
				}
			}
			up->lineerror = 1 ;
			break ;
		}

		if ( up->operationmode == 1 ) {

			for ( i = ibcc = 0 ; i < 13 ; i ++ )
				ibcc ^= pBuf[i] ;
			ibcc1 = 0x30 | ( ( ibcc >> 4 ) & 0xF ) ;
			ibcc2 = 0x30 | ( ( ibcc      ) & 0xF ) ;
			if ( pBuf[13] != ibcc1 || pBuf[14] != ibcc2 ) {
#ifdef DEBUG
				if ( debug >= 2 ) {
					printf ( "%s (refclock_jjy.c) : BCC error ( Recv=%02X,%02X / Calc=%02X,%02X)\n",
						 sFunctionName,
						 pBuf[13] & 0xFF,
						 pBuf[14] & 0xFF,
						 ibcc1, ibcc2 ) ;
				}
#endif
				up->lineerror = 1 ;
				break ;
			}

		}

		rc = sscanf ( pBuf, "%2d%2d%2d%*1d%2d%2d%2d",
			      &up->year, &up->month, &up->day,
			      &up->hour, &up->minute, &up->second ) ;
		if ( rc != 6 || up->month < 1 || up->month > 12 ||
		     up->day < 1 || up->day > 31 || up->hour > 23 ||
		     up->minute > 59 || up->second > 60 ) {
#ifdef DEBUG
			if ( debug >= 2 ) {
				printf ( "%s (refclock_jjy.c) : Time error (rc=%d) [ %02d %02d %02d * %02d %02d %02d ]\n",
					 sFunctionName, rc, up->year,
					 up->month, up->day, up->hour,
					 up->minute, up->second ) ;
			}
#endif
			up->lineerror = 1 ;
			break ;
		}

		up->year += 2000 ;

		if ( up->operationmode == 2 ) {

			/* A time stamp comes on every 0.5 seccond in the mode 2 of the LT-2000. */
			up->msecond = 500 ;
			pp->second -- ;
			if ( pp->second < 0 ) {
				pp->second = 59 ;
				pp->minute -- ;
				if ( pp->minute < 0 ) {
					pp->minute = 59 ;
					pp->hour -- ;
					if ( pp->hour < 0 ) {
						pp->hour = 23 ;
						pp->day -- ;
						if ( pp->day < 1 ) {
							pp->year -- ;
							pp->day  = ymd2yd ( pp->year, 12, 31 ) ;
						}
					}
				}
			}

			/* Switch from mode 2 to mode 1 in order to restraint of useless time stamp. */
#ifdef DEBUG
			if ( debug ) {
				printf ( "%s (refclock_jjy.c) : send '#'\n",
					 sFunctionName ) ;
			}
#endif
			if ( write ( pp->io.fd, "#",1 ) != 1  ) {
				refclock_report ( peer, CEVNT_FAULT ) ;
			}

		}

		break ;

	default : /*  Unexpected reply */

#ifdef DEBUG
		if ( debug ) {
			printf ( "%s (refclock_jjy.c) : send '#'\n",
				 sFunctionName ) ;
		}
#endif
		if ( write ( pp->io.fd, "#",1 ) != 1  ) {
			refclock_report ( peer, CEVNT_FAULT ) ;
		}

		up->lineerror = 1 ;
		break ;

	}

	return 1 ;

}

/**************************************************************************************************/

static int
jjy_receive_citizentic_jjy200 ( struct recvbuf *rbufp )
{

	static char *sFunctionName = "jjy_receive_citizentic_jjy200" ;

	struct jjyunit		*up ;
	struct refclockproc	*pp ;
	struct peer		*peer;

	char	*pBuf ;
	int	iLen ;
	int	rc ;
	char	cApostrophe, sStatus[3] ;
	int	iWeekday ;

	/*
	* Initialize pointers and read the timecode and timestamp
	*/
	peer = (struct peer *) rbufp->recv_srcclock ;
	pp = peer->procptr ;
	up = (struct jjyunit *) pp->unitptr ;

	if ( up->linediscipline == LDISC_RAW ) {
		pBuf = up->rawbuf ;
		iLen = up->charcount ;
	} else {
		pBuf = pp->a_lastcode ;
		iLen = pp->lencode ;
	}

	/*
	* JJY-200 sends a timestamp every second.
	* So, a timestamp is ignored unless it is right after polled.
	*/
	if ( ! up->bPollFlag )
		return 0 ;

	switch ( up->linecount ) {

	case 1 : /* 'XX YY/MM/DD W HH:MM:SS */

		if ( iLen != 23 ) {
#ifdef DEBUG
			if ( debug >= 2 ) {
				printf ( "%s (refclock_jjy.c) : Reply length error ( iLen=%d )\n",
					 sFunctionName, iLen ) ;
			}
#endif
			up->lineerror = 1 ;
			break ;
		}

		rc = sscanf ( pBuf, "%c%2s %2d/%2d/%2d %1d %2d:%2d:%2d",
			      &cApostrophe, sStatus, &up->year,
			      &up->month, &up->day, &iWeekday,
			      &up->hour, &up->minute, &up->second ) ;
		sStatus[2] = 0 ;
		if ( rc != 9 || cApostrophe != '\'' ||
		     strcmp( sStatus, "OK" ) != 0 || up->month < 1 ||
		     up->month > 12 || up->day < 1 || up->day > 31 ||
		     iWeekday > 6 || up->hour > 23 || up->minute > 59 ||
		     up->second > 60 ) {
#ifdef DEBUG
			if ( debug >= 2 ) {
				printf ( "%s (refclock_jjy.c) : Time error (rc=%d) [ %c %2s %02d %02d %02d %d %02d %02d %02d ]\n",
					 sFunctionName, rc, cApostrophe,
					 sStatus, up->year, up->month,
					 up->day, iWeekday, up->hour,
					 up->minute, up->second ) ;
			}
#endif
			up->lineerror = 1 ;
			break ;
		}

		up->year += 2000 ;
		up->msecond = 0 ;

		break ;

	default : /* Unexpected reply */

		up->lineerror = 1 ;
		break ;

	}

	return 1 ;

}

/**************************************************************************************************/
/*  jjy_poll - called by the transmit procedure                                                   */
/**************************************************************************************************/
static void
jjy_poll ( int unit, struct peer *peer )
{

	struct jjyunit      *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct jjyunit *) pp->unitptr ;

	if ( pp->polls > 0  &&  up->linecount == 0 ) {
		/*
		 * No reply for last command
		 */
		refclock_report ( peer, CEVNT_TIMEOUT ) ;
	}

#ifdef DEBUG
	if ( debug ) {
		printf ( "jjy_poll (refclock_jjy.c) : %ld\n", pp->polls ) ;
	}
#endif

	pp->polls ++ ;

	up->bPollFlag = 1 ;
	up->linecount = 0 ;
	up->lineerror = 0 ;
	up->charcount = 0 ;

	switch ( up->unittype ) {
	
	case UNITTYPE_TRISTATE_JJY01 :
		jjy_poll_tristate_jjy01  ( unit, peer ) ;
		break ;

	case UNITTYPE_CDEX_JST2000 :
		jjy_poll_cdex_jst2000 ( unit, peer ) ;
		break ;

	case UNITTYPE_ECHOKEISOKUKI_LT2000 :
		jjy_poll_echokeisokuki_lt2000 ( unit, peer ) ;
		break ;

	case UNITTYPE_CITIZENTIC_JJY200 :
		jjy_poll_citizentic_jjy200 ( unit, peer ) ;
		break ;

	default :
		break ;

	}

}

/**************************************************************************************************/

static void
jjy_poll_tristate_jjy01  ( int unit, struct peer *peer )
{

	static char *sFunctionName = "jjy_poll_tristate_jjy01" ;

	struct jjyunit	    *up;
	struct refclockproc *pp;

	char	*pCmd ;
	int 	iCmdLen ;

	pp = peer->procptr;
	up = (struct jjyunit *) pp->unitptr ;

	if ( ( pp->sloppyclockflag & CLK_FLAG1 ) == 0 ) {
		up->linecount = 2 ;
	}

#ifdef DEBUG
	if ( debug ) {
		printf ( "%s (refclock_jjy.c) : flag1=%X CLK_FLAG1=%X up->linecount=%d\n",
			sFunctionName, pp->sloppyclockflag, CLK_FLAG1,
			up->linecount ) ;
	}
#endif

	/*
	 * Send a first command
	 */

#ifdef DEBUG
	if ( debug ) {
		printf ( "%s (refclock_jjy.c) : send '%s'\n",
			 sFunctionName,
			 tristate_jjy01_command_sequence[up->linecount].commandLog ) ;
	}
#endif

	pCmd =  tristate_jjy01_command_sequence[up->linecount].command ;
	iCmdLen = tristate_jjy01_command_sequence[up->linecount].commandLength ;
	if ( write ( pp->io.fd, pCmd, iCmdLen ) != iCmdLen ) {
		refclock_report ( peer, CEVNT_FAULT ) ;
	}

}

/**************************************************************************************************/

static void
jjy_poll_cdex_jst2000 ( int unit, struct peer *peer )
{

	struct refclockproc *pp;

	pp = peer->procptr;

	/*
	 * Send "1J" command
	 */

#ifdef DEBUG
	if ( debug ) {
		printf ( "jjy_poll_cdex_jst2000 (refclock_jjy.c) : send '1J'\n" ) ;
	}
#endif

	if ( write ( pp->io.fd, "\0051J\003", 4 ) != 4  ) {
		refclock_report ( peer, CEVNT_FAULT ) ;
	}

}

/**************************************************************************************************/

static void
jjy_poll_echokeisokuki_lt2000 ( int unit, struct peer *peer )
{

	struct jjyunit      *up;
	struct refclockproc *pp;

	char	sCmd[2] ;

	pp = peer->procptr;
	up = (struct jjyunit *) pp->unitptr ;

	/*
	 * Send "T" or "C" command
	 */

	switch ( up->operationmode ) {
	case 1 : sCmd[0] = 'T' ; break ;
	case 2 : sCmd[0] = 'C' ; break ;
	}
	sCmd[1] = 0 ;

#ifdef DEBUG
	if ( debug ) {
		printf ( "jjy_poll_echokeisokuki_lt2000 (refclock_jjy.c) : send '%s'\n", sCmd ) ;
	}
#endif

	if ( write ( pp->io.fd, sCmd, 1 ) != 1  ) {
		refclock_report ( peer, CEVNT_FAULT ) ;
	}

}

/**************************************************************************************************/

static void
jjy_poll_citizentic_jjy200 ( int unit, struct peer *peer )
{

	/* Do nothing ( up->bPollFlag is set by the jjy_poll ) */

}

/**************************************************************************************************/

static void
printableString ( char *sOutput, int iOutputLen, char *sInput, int iInputLen )
{

	char	*printableControlChar[] = {
			"", "", "", "",
			"", "", "", "",
			"" , "" , "" , "" ,
			"" , "" , "" , "" ,
			"", "", "", "",
			"", "", "", "",
			"", "" , "", "",
			"" , "" , "" , "" ,
			" " } ;

	int	i, j, n ;

	for ( i = j = 0 ; i < iInputLen && j < iOutputLen ; i ++ ) {
		if ( isprint( sInput[i] ) ) {
			n = 1 ;
			if ( j + 1 >= iOutputLen )
				break ;
			sOutput[j] = sInput[i] ;
		} else if ( ( sInput[i] & 0xFF ) < 
			    COUNTOF(printableControlChar) ) {
			n = strlen( printableControlChar[sInput[i] & 0xFF] ) ;
			if ( j + n + 1 >= iOutputLen )
				break ;
			strncpy( sOutput + j,
				 printableControlChar[sInput[i] & 0xFF],
				 (size_t)iOutputLen - j ) ;
		} else {
			n = 5 ;
			if ( j + n + 1 >= iOutputLen ) break ;
			snprintf( sOutput + j, (size_t)iOutputLen - j,
				  "", sInput[i] & 0xFF ) ;
		}
		j += n ;
	}

	sOutput[min(j, iOutputLen - 1)] = '\0' ;

}

/**************************************************************************************************/

#else
int refclock_jjy_bs ;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_trak.c0000644000175000017500000002146611332473302015542 0ustar  peterpeter/*
 * refclock_trak - clock driver for the TRAK 8810 GPS Station Clock
 *
 * Tomoaki TSURUOKA  
 *	original version  Dec, 1993
 *	revised  version  Sep, 1994 for ntp3.4e or later
 */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_TRAK) && defined(PPS)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"
#include "ntp_unixtime.h"

#include 
#include 

#ifdef HAVE_SYS_TERMIOS_H
# include 
#endif
#ifdef HAVE_SYS_PPSCLOCK_H
# include 
#endif

/*
 * This driver supports the TRAK 8810/8820 GPS Station Clock. The claimed
 * accuracy at the 1-pps output is 200-300 ns relative to the broadcast
 * signal; however, in most cases the actual accuracy is limited by the
 * precision of the timecode and the latencies of the serial interface
 * and operating system.
 *
 * For best accuracy, this radio requires the LDISC_ACTS line
 * discipline, which captures a timestamp at the '*' on-time character
 * of the timecode. Using this discipline the jitter is in the order of
 * 1 ms and systematic error about 0.5 ms. If unavailable, the buffer
 * timestamp is used, which is captured at the \r ending the timecode
 * message. This introduces a systematic error of 23 character times, or
 * about 24 ms at 9600 bps, together with a jitter well over 8 ms on Sun
 * IPC-class machines.
 *
 * Using the memus, the radio should be set for 9600 bps, one stop bit
 * and no parity. It should be set to operate in computer (no echo)
 * mode. The timecode format includes neither the year nor leap-second
 * warning. No provisions are included in this preliminary version of
 * the driver to read and record detailed internal radio status.
 *
 * In operation, this driver sends a RQTS\r request to the radio at
 * initialization in order to put it in continuous time output mode. The
 * radio then sends the following message once each second:
 *
 *	*RQTS U,ddd:hh:mm:ss.0,q
 *
 *	on-time = '*' *	ddd = day of year
 *	hh:mm:ss = hours, minutes, seconds
 *	q = quality indicator (phase error), 0-6:
 * 		0 > 20 us
 *		6 > 10 us
 *		5 > 1 us
 *		4 > 100 ns
 *		3 > 10 ns
 *		2 < 10 ns
 *
 * The alarm condition is indicated by '0' at Q, which means the radio
 * has a phase error than 20 usec relative to the broadcast time. The
 * absence of year, DST and leap-second warning in this format is also
 * alarming.
 *
 * The continuous time mode is disabled using the RQTX request,
 * following which the radio sends a RQTX DONE response. In the
 * normal mode, other control and status requests are effective,
 * including the leap-second status request RQLS. The radio responds
 * wtih RQLS yy,mm,dd, where yy,mm,dd are the year, month and
 * day. Presumably, this gives the epoch of the next leap second,
 * RQLS 00,00,00 if none is specified in the GPS message. Specified in
 * this form, the information is generally useless and is ignored by
 * the driver.
 *
 * Fudge Factors
 *
 * There are no special fudge factors other than the generic.
 */

/*
 * Interface definitions
 */
#define	DEVICE		"/dev/trak%d" /* device name and unit */
#define	SPEED232	B9600	/* uart speed (9600 baud) */
#define	PRECISION	(-20)	/* precision assumed (about 1 us) */
#define	REFID		"GPS\0"	/* reference ID */
#define	DESCRIPTION	"TRACK 8810/8820 Station Clock" /* WRU */

#define	LENTRAK		24	/* timecode length */
#define C_CTO		"RQTS\r" /* start continuous time output */

/*
 * Unit control structure
 */
struct trakunit {
	int	polled;		/* poll message flag */
	l_fp    tstamp;         /* timestamp of last poll */
};

/*
 * Function prototypes
 */
static	int	trak_start	P((int, struct peer *));
static	void	trak_shutdown	P((int, struct peer *));
static	void	trak_receive	P((struct recvbuf *));
static	void	trak_poll	P((int, struct peer *));

/*
 * Transfer vector
 */
struct	refclock refclock_trak = {
	trak_start,		/* start up driver */
	trak_shutdown,		/* shut down driver */
	trak_poll,		/* transmit poll message */
	noentry,		/* not used (old trak_control) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old trak_buginfo) */
	NOFLAGS			/* not used */
};


/*
 * trak_start - open the devices and initialize data for processing
 */
static int
trak_start(
	int unit,
	struct peer *peer
	)
{
	register struct trakunit *up;
	struct refclockproc *pp;
	int fd;
	char device[20];

	/*
	 * Open serial port. The LDISC_ACTS line discipline inserts a
	 * timestamp following the "*" on-time character of the
	 * timecode.
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
	if (
#ifdef PPS
		!(fd = refclock_open(device, SPEED232, LDISC_CLK))
#else
		!(fd = refclock_open(device, SPEED232, 0))
#endif /* PPS */
		)
	    return (0);

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp = peer->procptr;
	pp->io.clock_recv = trak_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		(void) close(fd);
		pp->io.fd = -1;
		free(up);
		return (0);
	}
	pp->unitptr = (caddr_t)up;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	up->polled = 0;

	/*
	 * Start continuous time output. If something breaks, fold the
	 * tent and go home.
	 */
	if (write(pp->io.fd, C_CTO, sizeof(C_CTO)) != sizeof(C_CTO)) {
		refclock_report(peer, CEVNT_FAULT);
		(void) close(fd);
		free(up);
		return (0);
	}
	return (1);
}


/*
 * trak_shutdown - shut down the clock
 */
static void
trak_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct trakunit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct trakunit *)pp->unitptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}


/*
 * trak_receive - receive data from the serial interface
 */
static void
trak_receive(
	struct recvbuf *rbufp
	)
{
	register struct trakunit *up;
	struct refclockproc *pp;
	struct peer *peer;
	l_fp trtmp;
	char *dpt, *dpend;
	char qchar;
#ifdef PPS
	struct ppsclockev ppsev;
	int request;
#ifdef HAVE_CIOGETEV
        request = CIOGETEV;
#endif
#ifdef HAVE_TIOCGPPSEV
        request = TIOCGPPSEV;
#endif
#endif /* PPS */

	/*
	 * Initialize pointers and read the timecode and timestamp. We
	 * then chuck out everything, including runts, except one
	 * message each poll interval.
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct trakunit *)pp->unitptr;
	pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX,
				     &pp->lastrec);

	/*
	 * We get a buffer and timestamp following the '*' on-time
	 * character. If a valid timestamp, we use that in place of the
	 * buffer timestamp and edit out the timestamp for prettyprint
	 * billboards.
	 */
	dpt = pp->a_lastcode;
	dpend = dpt + pp->lencode;
	if (*dpt == '*' && buftvtots(dpt + 1, &trtmp)) {
		if (trtmp.l_i == pp->lastrec.l_i || trtmp.l_i ==
		    pp->lastrec.l_i + 1) {
			pp->lastrec = trtmp;
			dpt += 9;
			while (dpt < dpend) {
				*(dpt - 8) = *dpt;
				++dpt;
			}
		}
	}
	if (up->polled == 0) return;
	up->polled = 0;
#ifndef PPS
	get_systime(&up->tstamp);
#endif
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
#ifdef DEBUG
	if (debug)
	    printf("trak: timecode %d %s\n", pp->lencode,
		   pp->a_lastcode);
#endif

	/*
	 * We get down to business, check the timecode format and decode
	 * its contents. If the timecode has invalid length or is not in
	 * proper format, we declare bad format and exit.
	 */
	if (pp->lencode < LENTRAK) {
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	/*
	 * Timecode format: "*RQTS U,ddd:hh:mm:ss.0,q"
	 */
	if (sscanf(pp->a_lastcode, "*RQTS U,%3d:%2d:%2d:%2d.0,%c",
		   &pp->day, &pp->hour, &pp->minute, &pp->second, &qchar) != 5) {
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	/*
	 * Decode quality and leap characters. If unsynchronized, set
	 * the leap bits accordingly and exit.
	 */
	if (qchar == '0') {
		pp->leap = LEAP_NOTINSYNC;
		return;
	}
#ifdef PPS
	if(ioctl(fdpps,request,(caddr_t) &ppsev) >=0) {
		ppsev.tv.tv_sec += (u_int32) JAN_1970;
		TVTOTS(&ppsev.tv,&up->tstamp);
	}
#endif /* PPS */
	/* record the last ppsclock event time stamp */
	pp->lastrec = up->tstamp;
	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
        }
	pp->lastref = pp->lastrec;
	refclock_receive(peer);
}


/*
 * trak_poll - called by the transmit procedure
 */
static void
trak_poll(
	int unit,
	struct peer *peer
	)
{
	register struct trakunit *up;
	struct refclockproc *pp;

	/*
	 * We don't really do anything here, except arm the receiving
	 * side to capture a sample and check for timeouts.
	 */
	pp = peer->procptr;
	up = (struct trakunit *)pp->unitptr;
	if (up->polled)
	    refclock_report(peer, CEVNT_TIMEOUT);
	pp->polls++;
	up->polled = 1;
}

#else
int refclock_trak_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_dumbclock.c0000644000175000017500000002105711336477350016553 0ustar  peterpeter/*
 * refclock_dumbclock - clock driver for a unknown time distribution system
 * that only provides hh:mm:ss (in local time, yet!).
 */

/*
 * Must interpolate back to local time.  Very annoying.
 */
#define GET_LOCALTIME

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_DUMBCLOCK)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_calendar.h"
#include "ntp_stdlib.h"

#include 
#include 

#ifdef SYS_WINNT
extern int async_write(int, const void *, unsigned int);
#undef write
#define write(fd, data, octets)	async_write(fd, data, octets)
#endif

/*
 * This driver supports a generic dumb clock that only outputs hh:mm:ss,
 * in local time, no less.
 *
 * Input format:
 *
 *	hh:mm:ss   
 *
 * hh:mm:ss -- what you'd expect, with a 24 hour clock.  (Heck, that's the only
 * way it could get stupider.)  We take time on the .
 *
 * The original source of this module was the WWVB module.
 */

/*
 * Interface definitions
 */
#define	DEVICE		"/dev/dumbclock%d" /* device name and unit */
#define	SPEED232	B9600	/* uart speed (9600 baud) */
#define	PRECISION	(-13)	/* precision assumed (about 100 us) */
#define	REFID		"dumbclock"	/* reference ID */
#define	DESCRIPTION	"Dumb clock" /* WRU */


/*
 * Insanity check.  Since the time is local, we need to make sure that during midnight
 * transitions, we can convert back to Unix time.  If the conversion results in some number
 * worse than this number of seconds away, assume the next day and retry.
 */
#define INSANE_SECONDS 3600

/*
 * Dumb clock control structure
 */
struct dumbclock_unit {
	u_char	  tcswitch;	/* timecode switch */
	l_fp	  laststamp;	/* last receive timestamp */
	u_char	  lasthour;	/* last hour (for monitor) */
	u_char	  linect;	/* count ignored lines (for monitor */
	struct tm ymd;		/* struct tm for y/m/d only */
};

/*
 * Function prototypes
 */
static	int	dumbclock_start		(int, struct peer *);
static	void	dumbclock_shutdown	(int, struct peer *);
static	void	dumbclock_receive	(struct recvbuf *);
#if 0
static	void	dumbclock_poll		(int, struct peer *);
#endif

/*
 * Transfer vector
 */
struct	refclock refclock_dumbclock = {
	dumbclock_start,		     /* start up driver */
	dumbclock_shutdown,		     /* shut down driver */
	noentry,			     /* poll the driver -- a nice fabrication */
	noentry,			     /* not used */
	noentry,			     /* not used */
	noentry,			     /* not used */
	NOFLAGS				     /* not used */
};


/*
 * dumbclock_start - open the devices and initialize data for processing
 */
static int
dumbclock_start(
	int unit,
	struct peer *peer
	)
{
	register struct dumbclock_unit *up;
	struct refclockproc *pp;
	int fd;
	char device[20];
	struct tm *tm_time_p;
	time_t     now;

	/*
	 * Open serial port. Don't bother with CLK line discipline, since
	 * it's not available.
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
#ifdef DEBUG
	if (debug)
		printf ("starting Dumbclock with device %s\n",device);
#endif
	fd = refclock_open(device, SPEED232, 0);
	if (!fd)
		return (0);

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp = peer->procptr;
	pp->unitptr = (caddr_t)up;
	pp->io.clock_recv = dumbclock_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		pp->io.fd = -1;
		free(up);
		pp->unitptr = NULL;
		return (0);
	}


	time(&now);
#ifdef GET_LOCALTIME
	tm_time_p = localtime(&now);
#else
	tm_time_p = gmtime(&now);
#endif
	if (tm_time_p)
		up->ymd = *tm_time_p;
	else
		return 0;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	return (1);
}


/*
 * dumbclock_shutdown - shut down the clock
 */
static void
dumbclock_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct dumbclock_unit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct dumbclock_unit *)pp->unitptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}


/*
 * dumbclock_receive - receive data from the serial interface
 */
static void
dumbclock_receive(
	struct recvbuf *rbufp
	)
{
	struct dumbclock_unit *up;
	struct refclockproc *pp;
	struct peer *peer;

	l_fp	trtmp;		/* arrival timestamp */
	int	hours;		/* hour-of-day */
	int	minutes;	/* minutes-past-the-hour */
	int	seconds;	/* seconds */
	int	temp;		/* int temp */
	int	got_good;	/* got a good time flag */

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct dumbclock_unit *)pp->unitptr;
	temp = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);

	if (temp == 0) {
		if (up->tcswitch == 0) {
			up->tcswitch = 1;
			up->laststamp = trtmp;
		} else
			up->tcswitch = 0;
		return;
	}
	pp->lencode = (u_short)temp;
	pp->lastrec = up->laststamp;
	up->laststamp = trtmp;
	up->tcswitch = 1;

#ifdef DEBUG
	if (debug)
		printf("dumbclock: timecode %d %s\n",
		       pp->lencode, pp->a_lastcode);
#endif

	/*
	 * We get down to business. Check the timecode format...
	 */
	got_good=0;
	if (sscanf(pp->a_lastcode,"%02d:%02d:%02d",
		   &hours,&minutes,&seconds) == 3)
	{
	    struct tm *gmtp;
	    struct tm *lt_p;
	    time_t     asserted_time;	     /* the SPM time based on the composite time+date */
	    struct tm  asserted_tm;	     /* the struct tm of the same */
	    int        adjyear;
	    int        adjmon;
	    time_t     reality_delta;
	    time_t     now;


	    /*
	     * Convert to GMT for sites that distribute localtime.  This
	     * means we have to figure out what day it is.  Easier said
	     * than done...
	     */

	    memset(&asserted_tm, 0, sizeof(asserted_tm));

	    asserted_tm.tm_year  = up->ymd.tm_year;
	    asserted_tm.tm_mon   = up->ymd.tm_mon;
	    asserted_tm.tm_mday  = up->ymd.tm_mday;
	    asserted_tm.tm_hour  = hours;
	    asserted_tm.tm_min   = minutes;
	    asserted_tm.tm_sec   = seconds;
	    asserted_tm.tm_isdst = -1;

#ifdef GET_LOCALTIME
	    asserted_time = mktime (&asserted_tm);
	    time(&now);
#else
#include "GMT unsupported for dumbclock!"
#endif
	    reality_delta = asserted_time - now;

	    /*
	     * We assume that if the time is grossly wrong, it's because we got the
	     * year/month/day wrong.
	     */
	    if (reality_delta > INSANE_SECONDS)
	    {
		asserted_time -= SECSPERDAY; /* local clock behind real time */
	    }
	    else if (-reality_delta > INSANE_SECONDS)
	    {
		asserted_time += SECSPERDAY; /* local clock ahead of real time */
	    }
	    lt_p = localtime(&asserted_time);
	    if (lt_p)
	    {
		up->ymd = *lt_p;
	    }
	    else
	    {
		refclock_report (peer, CEVNT_FAULT);
		return;
	    }

	    if ((gmtp = gmtime (&asserted_time)) == NULL)
	    {
		refclock_report (peer, CEVNT_FAULT);
		return;
	    }
	    adjyear = gmtp->tm_year+1900;
	    adjmon  = gmtp->tm_mon+1;
	    pp->day = ymd2yd (adjyear, adjmon, gmtp->tm_mday);
	    pp->hour   = gmtp->tm_hour;
	    pp->minute = gmtp->tm_min;
	    pp->second = gmtp->tm_sec;
#ifdef DEBUG
	    if (debug)
		printf ("time is %04d/%02d/%02d %02d:%02d:%02d UTC\n",
			adjyear,adjmon,gmtp->tm_mday,pp->hour,pp->minute,
			pp->second);
#endif

	    got_good=1;
	}

	if (!got_good)
	{
	    if (up->linect > 0)
	    	up->linect--;
	    else
	    	refclock_report(peer, CEVNT_BADREPLY);
	    return;
	}

	/*
	 * Process the new sample in the median filter and determine the
	 * timecode timestamp.
	 */
	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	pp->lastref = pp->lastrec;
	refclock_receive(peer);
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
	up->lasthour = (u_char)pp->hour;
}

#if 0
/*
 * dumbclock_poll - called by the transmit procedure
 */
static void
dumbclock_poll(
	int unit,
	struct peer *peer
	)
{
	register struct dumbclock_unit *up;
	struct refclockproc *pp;
	char pollchar;

	/*
	 * Time to poll the clock. The Chrono-log clock is supposed to
	 * respond to a 'T' by returning a timecode in the format(s)
	 * specified above.  Ours does (can?) not, but this seems to be
	 * an installation-specific problem.  This code is dyked out,
	 * but may be re-enabled if anyone ever finds a Chrono-log that
	 * actually listens to this command.
	 */
#if 0
	pp = peer->procptr;
	up = (struct dumbclock_unit *)pp->unitptr;
	if (peer->reach == 0)
		refclock_report(peer, CEVNT_TIMEOUT);
	if (up->linect > 0)
		pollchar = 'R';
	else
		pollchar = 'T';
	if (write(pp->io.fd, &pollchar, 1) != 1)
		refclock_report(peer, CEVNT_FAULT);
	else
		pp->polls++;
#endif
}
#endif

#else
int refclock_dumbclock_bs;
#endif	/* defined(REFCLOCK) && defined(CLOCK_DUMBCLOCK) */
ntp-4.2.6p5/ntpd/ntp_keyword.h0000644000175000017500000015727111675457724015333 0ustar  peterpeter/*
 * ntp_keyword.h
 * 
 * NOTE: edit this file with caution, it is generated by keyword-gen.c
 *	 Generated 2010-04-06 04:38:11 UTC	  diff_ignore_line
 *
 */
#include "ntp_scanner.h"
#include "ntp_parser.h"

#define LOWEST_KEYWORD_ID 258

const char * const keyword_text[163] = {
	/* 0       258                T_Age */	"age",
	/* 1       259                T_All */	"all",
	/* 2       260              T_Allan */	"allan",
	/* 3       261               T_Auth */	"auth",
	/* 4       262            T_Autokey */	"autokey",
	/* 5       263            T_Automax */	"automax",
	/* 6       264            T_Average */	"average",
	/* 7       265            T_Bclient */	"bclient",
	/* 8       266             T_Beacon */	"beacon",
	/* 9       267               T_Bias */	"bias",
	/* 10      268          T_Broadcast */	"broadcast",
	/* 11      269    T_Broadcastclient */	"broadcastclient",
	/* 12      270     T_Broadcastdelay */	"broadcastdelay",
	/* 13      271              T_Burst */	"burst",
	/* 14      272          T_Calibrate */	"calibrate",
	/* 15      273          T_Calldelay */	"calldelay",
	/* 16      274            T_Ceiling */	"ceiling",
	/* 17      275         T_Clockstats */	"clockstats",
	/* 18      276             T_Cohort */	"cohort",
	/* 19      277         T_ControlKey */	"controlkey",
	/* 20      278             T_Crypto */	"crypto",
	/* 21      279        T_Cryptostats */	"cryptostats",
	/* 22      280                T_Day */	"day",
	/* 23      281            T_Default */	"default",
	/* 24      282             T_Digest */	"digest",
	/* 25      283            T_Disable */	"disable",
	/* 26      284            T_Discard */	"discard",
	/* 27      285         T_Dispersion */	"dispersion",
	/* 28      286             T_Double */	NULL,
	/* 29      287          T_Driftfile */	"driftfile",
	/* 30      288               T_Drop */	"drop",
	/* 31      289           T_Ellipsis */	"...",
	/* 32      290             T_Enable */	"enable",
	/* 33      291                T_End */	"end",
	/* 34      292              T_False */	NULL,
	/* 35      293               T_File */	"file",
	/* 36      294            T_Filegen */	"filegen",
	/* 37      295              T_Flag1 */	"flag1",
	/* 38      296              T_Flag2 */	"flag2",
	/* 39      297              T_Flag3 */	"flag3",
	/* 40      298              T_Flag4 */	"flag4",
	/* 41      299              T_Flake */	"flake",
	/* 42      300              T_Floor */	"floor",
	/* 43      301               T_Freq */	"freq",
	/* 44      302              T_Fudge */	"fudge",
	/* 45      303               T_Host */	"host",
	/* 46      304           T_Huffpuff */	"huffpuff",
	/* 47      305             T_Iburst */	"iburst",
	/* 48      306              T_Ident */	"ident",
	/* 49      307             T_Ignore */	"ignore",
	/* 50      308        T_Includefile */	"includefile",
	/* 51      309            T_Integer */	NULL,
	/* 52      310          T_Interface */	"interface",
	/* 53      311               T_Ipv4 */	"ipv4",
	/* 54      312          T_Ipv4_flag */	"-4",
	/* 55      313               T_Ipv6 */	"ipv6",
	/* 56      314          T_Ipv6_flag */	"-6",
	/* 57      315             T_Kernel */	"kernel",
	/* 58      316                T_Key */	"key",
	/* 59      317               T_Keys */	"keys",
	/* 60      318            T_Keysdir */	"keysdir",
	/* 61      319                T_Kod */	"kod",
	/* 62      320             T_Mssntp */	"mssntp",
	/* 63      321           T_Leapfile */	"leapfile",
	/* 64      322            T_Limited */	"limited",
	/* 65      323               T_Link */	"link",
	/* 66      324             T_Listen */	"listen",
	/* 67      325          T_Logconfig */	"logconfig",
	/* 68      326            T_Logfile */	"logfile",
	/* 69      327          T_Loopstats */	"loopstats",
	/* 70      328        T_Lowpriotrap */	"lowpriotrap",
	/* 71      329     T_Manycastclient */	"manycastclient",
	/* 72      330     T_Manycastserver */	"manycastserver",
	/* 73      331               T_Mask */	"mask",
	/* 74      332           T_Maxclock */	"maxclock",
	/* 75      333            T_Maxdist */	"maxdist",
	/* 76      334            T_Maxpoll */	"maxpoll",
	/* 77      335           T_Minclock */	"minclock",
	/* 78      336            T_Mindist */	"mindist",
	/* 79      337            T_Minimum */	"minimum",
	/* 80      338            T_Minpoll */	"minpoll",
	/* 81      339            T_Minsane */	"minsane",
	/* 82      340               T_Mode */	"mode",
	/* 83      341            T_Monitor */	"monitor",
	/* 84      342              T_Month */	"month",
	/* 85      343    T_Multicastclient */	"multicastclient",
	/* 86      344                T_Nic */	"nic",
	/* 87      345             T_Nolink */	"nolink",
	/* 88      346           T_Nomodify */	"nomodify",
	/* 89      347               T_None */	"none",
	/* 90      348             T_Nopeer */	"nopeer",
	/* 91      349            T_Noquery */	"noquery",
	/* 92      350           T_Noselect */	"noselect",
	/* 93      351            T_Noserve */	"noserve",
	/* 94      352             T_Notrap */	"notrap",
	/* 95      353            T_Notrust */	"notrust",
	/* 96      354                T_Ntp */	"ntp",
	/* 97      355            T_Ntpport */	"ntpport",
	/* 98      356     T_NtpSignDsocket */	"ntpsigndsocket",
	/* 99      357             T_Orphan */	"orphan",
	/* 100     358              T_Panic */	"panic",
	/* 101     359               T_Peer */	"peer",
	/* 102     360          T_Peerstats */	"peerstats",
	/* 103     361              T_Phone */	"phone",
	/* 104     362                T_Pid */	"pid",
	/* 105     363            T_Pidfile */	"pidfile",
	/* 106     364               T_Pool */	"pool",
	/* 107     365               T_Port */	"port",
	/* 108     366            T_Preempt */	"preempt",
	/* 109     367             T_Prefer */	"prefer",
	/* 110     368         T_Protostats */	"protostats",
	/* 111     369                 T_Pw */	"pw",
	/* 112     370                T_Qos */	"qos",
	/* 113     371           T_Randfile */	"randfile",
	/* 114     372           T_Rawstats */	"rawstats",
	/* 115     373              T_Refid */	"refid",
	/* 116     374         T_Requestkey */	"requestkey",
	/* 117     375           T_Restrict */	"restrict",
	/* 118     376             T_Revoke */	"revoke",
	/* 119     377      T_Saveconfigdir */	"saveconfigdir",
	/* 120     378             T_Server */	"server",
	/* 121     379             T_Setvar */	"setvar",
	/* 122     380               T_Sign */	"sign",
	/* 123     381         T_Statistics */	"statistics",
	/* 124     382              T_Stats */	"stats",
	/* 125     383           T_Statsdir */	"statsdir",
	/* 126     384               T_Step */	"step",
	/* 127     385            T_Stepout */	"stepout",
	/* 128     386            T_Stratum */	"stratum",
	/* 129     387             T_String */	NULL,
	/* 130     388           T_Sysstats */	"sysstats",
	/* 131     389               T_Tick */	"tick",
	/* 132     390              T_Time1 */	"time1",
	/* 133     391              T_Time2 */	"time2",
	/* 134     392        T_Timingstats */	"timingstats",
	/* 135     393             T_Tinker */	"tinker",
	/* 136     394                T_Tos */	"tos",
	/* 137     395               T_Trap */	"trap",
	/* 138     396               T_True */	"true",
	/* 139     397         T_Trustedkey */	"trustedkey",
	/* 140     398                T_Ttl */	"ttl",
	/* 141     399               T_Type */	"type",
	/* 142     400           T_Unconfig */	"unconfig",
	/* 143     401             T_Unpeer */	"unpeer",
	/* 144     402            T_Version */	"version",
	/* 145     403    T_WanderThreshold */	NULL,
	/* 146     404               T_Week */	"week",
	/* 147     405           T_Wildcard */	"wildcard",
	/* 148     406             T_Xleave */	"xleave",
	/* 149     407               T_Year */	"year",
	/* 150     408               T_Flag */	NULL,
	/* 151     409               T_Void */	NULL,
	/* 152     410                T_EOC */	NULL,
	/* 153     411           T_Simulate */	"simulate",
	/* 154     412         T_Beep_Delay */	"beep_delay",
	/* 155     413       T_Sim_Duration */	"simulation_duration",
	/* 156     414      T_Server_Offset */	"server_offset",
	/* 157     415           T_Duration */	"duration",
	/* 158     416        T_Freq_Offset */	"freq_offset",
	/* 159     417             T_Wander */	"wander",
	/* 160     418             T_Jitter */	"jitter",
	/* 161     419         T_Prop_Delay */	"prop_delay",
	/* 162     420         T_Proc_Delay */	"proc_delay"
};

#define SCANNER_INIT_S 742

const scan_state sst[745] = {
/*SS_T( ch,	f-by, match, other ),				 */
  0,				      /*     0                   */
  S_ST( '-',	3,      314,     0 ), /*     1                   */
  S_ST( '.',	3,        3,     1 ), /*     2                   */
  S_ST( '.',	3,      289,     0 ), /*     3                   */
  S_ST( 'a',	3,       15,     2 ), /*     4                   */
  S_ST( 'g',	3,      258,     0 ), /*     5                   */
  S_ST( 'l',	3,      259,     5 ), /*     6                   */
  S_ST( 'a',	3,      260,     0 ), /*     7                   */
  S_ST( 'u',	3,        9,     6 ), /*     8                   */
  S_ST( 't',	3,       10,     0 ), /*     9                   */
  S_ST( 'o',	3,       13,   261 ), /*    10                   */
  S_ST( 'k',	3,       12,     0 ), /*    11                   */
  S_ST( 'e',	3,      262,     0 ), /*    12                   */
  S_ST( 'm',	3,       14,    11 ), /*    13                   */
  S_ST( 'a',	3,      263,     0 ), /*    14                   */
  S_ST( 'v',	3,       16,     8 ), /*    15                   */
  S_ST( 'e',	3,       17,     0 ), /*    16                   */
  S_ST( 'r',	3,       18,     0 ), /*    17                   */
  S_ST( 'a',	3,       19,     0 ), /*    18                   */
  S_ST( 'g',	3,      264,     0 ), /*    19                   */
  S_ST( 'b',	3,       55,     4 ), /*    20                   */
  S_ST( 'c',	3,       22,     0 ), /*    21                   */
  S_ST( 'l',	3,       23,     0 ), /*    22                   */
  S_ST( 'i',	3,       24,     0 ), /*    23                   */
  S_ST( 'e',	3,       25,     0 ), /*    24                   */
  S_ST( 'n',	3,      265,     0 ), /*    25                   */
  S_ST( 'e',	3,       30,    21 ), /*    26                   */
  S_ST( 'a',	3,       28,     0 ), /*    27                   */
  S_ST( 'c',	3,       29,     0 ), /*    28                   */
  S_ST( 'o',	3,      266,     0 ), /*    29                   */
  S_ST( 'e',	3,       31,    27 ), /*    30                   */
  S_ST( 'p',	3,       32,     0 ), /*    31                   */
  S_ST( '_',	3,       33,     0 ), /*    32                   */
  S_ST( 'd',	3,       34,     0 ), /*    33                   */
  S_ST( 'e',	3,       35,     0 ), /*    34                   */
  S_ST( 'l',	3,       36,     0 ), /*    35                   */
  S_ST( 'a',	3,      412,     0 ), /*    36                   */
  S_ST( 'i',	3,       38,    26 ), /*    37                   */
  S_ST( 'a',	3,      267,     0 ), /*    38                   */
  S_ST( 'r',	3,       40,    37 ), /*    39                   */
  S_ST( 'o',	3,       41,     0 ), /*    40                   */
  S_ST( 'a',	3,       42,     0 ), /*    41                   */
  S_ST( 'd',	3,       43,     0 ), /*    42                   */
  S_ST( 'c',	3,       44,     0 ), /*    43                   */
  S_ST( 'a',	3,       45,     0 ), /*    44                   */
  S_ST( 's',	3,      268,     0 ), /*    45                   */
  S_ST( 'c',	3,       47,     0 ), /*    46                   */
  S_ST( 'l',	3,       48,     0 ), /*    47                   */
  S_ST( 'i',	3,       49,     0 ), /*    48                   */
  S_ST( 'e',	3,       50,     0 ), /*    49                   */
  S_ST( 'n',	3,      269,     0 ), /*    50                   */
  S_ST( 'd',	3,       52,    46 ), /*    51                   */
  S_ST( 'e',	3,       53,     0 ), /*    52                   */
  S_ST( 'l',	3,       54,     0 ), /*    53                   */
  S_ST( 'a',	3,      270,     0 ), /*    54                   */
  S_ST( 'u',	3,       56,    39 ), /*    55                   */
  S_ST( 'r',	3,       57,     0 ), /*    56                   */
  S_ST( 's',	3,      271,     0 ), /*    57                   */
  S_ST( 'c',	3,       95,    20 ), /*    58                   */
  S_ST( 'a',	3,       60,     0 ), /*    59                   */
  S_ST( 'l',	3,       66,     0 ), /*    60                   */
  S_ST( 'i',	3,       62,     0 ), /*    61                   */
  S_ST( 'b',	3,       63,     0 ), /*    62                   */
  S_ST( 'r',	3,       64,     0 ), /*    63                   */
  S_ST( 'a',	3,       65,     0 ), /*    64                   */
  S_ST( 't',	3,      272,     0 ), /*    65                   */
  S_ST( 'l',	3,       67,    61 ), /*    66                   */
  S_ST( 'd',	3,       68,     0 ), /*    67                   */
  S_ST( 'e',	3,       69,     0 ), /*    68                   */
  S_ST( 'l',	3,       70,     0 ), /*    69                   */
  S_ST( 'a',	3,      273,     0 ), /*    70                   */
  S_ST( 'e',	3,       72,    59 ), /*    71                   */
  S_ST( 'i',	3,       73,     0 ), /*    72                   */
  S_ST( 'l',	3,       74,     0 ), /*    73                   */
  S_ST( 'i',	3,       75,     0 ), /*    74                   */
  S_ST( 'n',	3,      274,     0 ), /*    75                   */
  S_ST( 'l',	3,       77,    71 ), /*    76                   */
  S_ST( 'o',	3,       78,     0 ), /*    77                   */
  S_ST( 'c',	3,       79,     0 ), /*    78                   */
  S_ST( 'k',	3,       80,     0 ), /*    79                   */
  S_ST( 's',	3,       81,     0 ), /*    80                   */
  S_ST( 't',	3,       82,     0 ), /*    81                   */
  S_ST( 'a',	3,       83,     0 ), /*    82                   */
  S_ST( 't',	3,      275,     0 ), /*    83                   */
  S_ST( 'o',	3,       88,    76 ), /*    84                   */
  S_ST( 'h',	3,       86,     0 ), /*    85                   */
  S_ST( 'o',	3,       87,     0 ), /*    86                   */
  S_ST( 'r',	3,      276,     0 ), /*    87                   */
  S_ST( 'n',	3,       89,    85 ), /*    88                   */
  S_ST( 't',	3,       90,     0 ), /*    89                   */
  S_ST( 'r',	3,       91,     0 ), /*    90                   */
  S_ST( 'o',	3,       92,     0 ), /*    91                   */
  S_ST( 'l',	3,       93,     0 ), /*    92                   */
  S_ST( 'k',	3,       94,     0 ), /*    93                   */
  S_ST( 'e',	3,      277,     0 ), /*    94                   */
  S_ST( 'r',	3,       96,    84 ), /*    95                   */
  S_ST( 'y',	3,       97,     0 ), /*    96                   */
  S_ST( 'p',	3,       98,     0 ), /*    97                   */
  S_ST( 't',	3,      278,     0 ), /*    98                   */
  S_ST( 's',	3,      100,     0 ), /*    99                   */
  S_ST( 't',	3,      101,     0 ), /*   100                   */
  S_ST( 'a',	3,      102,     0 ), /*   101                   */
  S_ST( 't',	3,      279,     0 ), /*   102                   */
  S_ST( 'd',	3,      135,    58 ), /*   103                   */
  S_ST( 'a',	3,      280,     0 ), /*   104                   */
  S_ST( 'e',	3,      106,   104 ), /*   105                   */
  S_ST( 'f',	3,      107,     0 ), /*   106                   */
  S_ST( 'a',	3,      108,     0 ), /*   107                   */
  S_ST( 'u',	3,      109,     0 ), /*   108                   */
  S_ST( 'l',	3,      281,     0 ), /*   109                   */
  S_ST( 'i',	3,      114,   105 ), /*   110                   */
  S_ST( 'g',	3,      112,     0 ), /*   111                   */
  S_ST( 'e',	3,      113,     0 ), /*   112                   */
  S_ST( 's',	3,      282,     0 ), /*   113                   */
  S_ST( 's',	3,      121,   111 ), /*   114                   */
  S_ST( 'a',	3,      116,     0 ), /*   115                   */
  S_ST( 'b',	3,      117,     0 ), /*   116                   */
  S_ST( 'l',	3,      283,     0 ), /*   117                   */
  S_ST( 'c',	3,      119,   115 ), /*   118                   */
  S_ST( 'a',	3,      120,     0 ), /*   119                   */
  S_ST( 'r',	3,      284,     0 ), /*   120                   */
  S_ST( 'p',	3,      122,   118 ), /*   121                   */
  S_ST( 'e',	3,      123,     0 ), /*   122                   */
  S_ST( 'r',	3,      124,     0 ), /*   123                   */
  S_ST( 's',	3,      125,     0 ), /*   124                   */
  S_ST( 'i',	3,      126,     0 ), /*   125                   */
  S_ST( 'o',	3,      285,     0 ), /*   126                   */
  S_ST( 'r',	3,      134,   110 ), /*   127                   */
  S_ST( 'i',	3,      129,     0 ), /*   128                   */
  S_ST( 'f',	3,      130,     0 ), /*   129                   */
  S_ST( 't',	3,      131,     0 ), /*   130                   */
  S_ST( 'f',	3,      132,     0 ), /*   131                   */
  S_ST( 'i',	3,      133,     0 ), /*   132                   */
  S_ST( 'l',	3,      287,     0 ), /*   133                   */
  S_ST( 'o',	3,      288,   128 ), /*   134                   */
  S_ST( 'u',	3,      136,   127 ), /*   135                   */
  S_ST( 'r',	3,      137,     0 ), /*   136                   */
  S_ST( 'a',	3,      138,     0 ), /*   137                   */
  S_ST( 't',	3,      139,     0 ), /*   138                   */
  S_ST( 'i',	3,      140,     0 ), /*   139                   */
  S_ST( 'o',	3,      415,     0 ), /*   140                   */
  S_ST( 'e',	3,      142,   103 ), /*   141                   */
  S_ST( 'n',	3,      291,     0 ), /*   142                   */
  S_ST( 'a',	3,      144,     0 ), /*   143                   */
  S_ST( 'b',	3,      145,     0 ), /*   144                   */
  S_ST( 'l',	3,      290,     0 ), /*   145                   */
  S_ST( 'f',	3,      165,   141 ), /*   146                   */
  S_ST( 'i',	3,      148,     0 ), /*   147                   */
  S_ST( 'l',	3,      293,     0 ), /*   148                   */
  S_ST( 'g',	3,      150,     0 ), /*   149                   */
  S_ST( 'e',	3,      294,     0 ), /*   150                   */
  S_ST( 'l',	3,      155,   147 ), /*   151                   */
  S_ST( 'a',	3,      154,     0 ), /*   152                   */
  S_ST( 'g',	3,      298,     0 ), /*   153                   */
  S_ST( 'k',	3,      299,   153 ), /*   154                   */
  S_ST( 'o',	3,      156,   152 ), /*   155                   */
  S_ST( 'o',	3,      300,     0 ), /*   156                   */
  S_ST( 'r',	3,      158,   151 ), /*   157                   */
  S_ST( 'e',	3,      301,     0 ), /*   158                   */
  S_ST( '_',	3,      160,     0 ), /*   159                   */
  S_ST( 'o',	3,      161,     0 ), /*   160                   */
  S_ST( 'f',	3,      162,     0 ), /*   161                   */
  S_ST( 'f',	3,      163,     0 ), /*   162                   */
  S_ST( 's',	3,      164,     0 ), /*   163                   */
  S_ST( 'e',	3,      416,     0 ), /*   164                   */
  S_ST( 'u',	3,      166,   157 ), /*   165                   */
  S_ST( 'd',	3,      167,     0 ), /*   166                   */
  S_ST( 'g',	3,      302,     0 ), /*   167                   */
  S_ST( 'h',	3,      171,   146 ), /*   168                   */
  S_ST( 'o',	3,      170,     0 ), /*   169                   */
  S_ST( 's',	3,      303,     0 ), /*   170                   */
  S_ST( 'u',	3,      172,   169 ), /*   171                   */
  S_ST( 'f',	3,      173,     0 ), /*   172                   */
  S_ST( 'f',	3,      174,     0 ), /*   173                   */
  S_ST( 'p',	3,      175,     0 ), /*   174                   */
  S_ST( 'u',	3,      176,     0 ), /*   175                   */
  S_ST( 'f',	3,      304,     0 ), /*   176                   */
  S_ST( 'i',	3,      204,   168 ), /*   177                   */
  S_ST( 'b',	3,      179,     0 ), /*   178                   */
  S_ST( 'u',	3,      180,     0 ), /*   179                   */
  S_ST( 'r',	3,      181,     0 ), /*   180                   */
  S_ST( 's',	3,      305,     0 ), /*   181                   */
  S_ST( 'd',	3,      183,   178 ), /*   182                   */
  S_ST( 'e',	3,      184,     0 ), /*   183                   */
  S_ST( 'n',	3,      306,     0 ), /*   184                   */
  S_ST( 'g',	3,      186,   182 ), /*   185                   */
  S_ST( 'n',	3,      187,     0 ), /*   186                   */
  S_ST( 'o',	3,      188,     0 ), /*   187                   */
  S_ST( 'r',	3,      307,     0 ), /*   188                   */
  S_ST( 'n',	3,      198,   185 ), /*   189                   */
  S_ST( 'c',	3,      191,     0 ), /*   190                   */
  S_ST( 'l',	3,      192,     0 ), /*   191                   */
  S_ST( 'u',	3,      193,     0 ), /*   192                   */
  S_ST( 'd',	3,      194,     0 ), /*   193                   */
  S_ST( 'e',	3,      195,     0 ), /*   194                   */
  S_ST( 'f',	3,      196,     0 ), /*   195                   */
  S_ST( 'i',	3,      197,     0 ), /*   196                   */
  S_ST( 'l',	3,      308,     0 ), /*   197                   */
  S_ST( 't',	3,      199,   190 ), /*   198                   */
  S_ST( 'e',	3,      200,     0 ), /*   199                   */
  S_ST( 'r',	3,      201,     0 ), /*   200                   */
  S_ST( 'f',	3,      202,     0 ), /*   201                   */
  S_ST( 'a',	3,      203,     0 ), /*   202                   */
  S_ST( 'c',	3,      310,     0 ), /*   203                   */
  S_ST( 'p',	3,      205,   189 ), /*   204                   */
  S_ST( 'v',	3,      313,     0 ), /*   205                   */
  S_ST( 'j',	3,      207,   177 ), /*   206                   */
  S_ST( 'i',	3,      208,     0 ), /*   207                   */
  S_ST( 't',	3,      209,     0 ), /*   208                   */
  S_ST( 't',	3,      210,     0 ), /*   209                   */
  S_ST( 'e',	3,      418,     0 ), /*   210                   */
  S_ST( 'k',	3,      218,   206 ), /*   211                   */
  S_ST( 'e',	3,      316,     0 ), /*   212                   */
  S_ST( 'r',	3,      214,     0 ), /*   213                   */
  S_ST( 'n',	3,      215,     0 ), /*   214                   */
  S_ST( 'e',	3,      315,     0 ), /*   215                   */
  S_ST( 'd',	3,      217,     0 ), /*   216                   */
  S_ST( 'i',	3,      318,     0 ), /*   217                   */
  S_ST( 'o',	3,      319,   212 ), /*   218                   */
  S_ST( 'l',	3,      235,   211 ), /*   219                   */
  S_ST( 'e',	3,      221,     0 ), /*   220                   */
  S_ST( 'a',	3,      222,     0 ), /*   221                   */
  S_ST( 'p',	3,      223,     0 ), /*   222                   */
  S_ST( 'f',	3,      224,     0 ), /*   223                   */
  S_ST( 'i',	3,      225,     0 ), /*   224                   */
  S_ST( 'l',	3,      321,     0 ), /*   225                   */
  S_ST( 'i',	3,      232,   220 ), /*   226                   */
  S_ST( 'm',	3,      228,     0 ), /*   227                   */
  S_ST( 'i',	3,      229,     0 ), /*   228                   */
  S_ST( 't',	3,      230,     0 ), /*   229                   */
  S_ST( 'e',	3,      322,     0 ), /*   230                   */
  S_ST( 'n',	3,      323,   227 ), /*   231                   */
  S_ST( 's',	3,      233,   231 ), /*   232                   */
  S_ST( 't',	3,      234,     0 ), /*   233                   */
  S_ST( 'e',	3,      324,     0 ), /*   234                   */
  S_ST( 'o',	3,      251,   226 ), /*   235                   */
  S_ST( 'g',	3,      242,     0 ), /*   236                   */
  S_ST( 'c',	3,      238,     0 ), /*   237                   */
  S_ST( 'o',	3,      239,     0 ), /*   238                   */
  S_ST( 'n',	3,      240,     0 ), /*   239                   */
  S_ST( 'f',	3,      241,     0 ), /*   240                   */
  S_ST( 'i',	3,      325,     0 ), /*   241                   */
  S_ST( 'f',	3,      243,   237 ), /*   242                   */
  S_ST( 'i',	3,      244,     0 ), /*   243                   */
  S_ST( 'l',	3,      326,     0 ), /*   244                   */
  S_ST( 'o',	3,      246,   236 ), /*   245                   */
  S_ST( 'p',	3,      247,     0 ), /*   246                   */
  S_ST( 's',	3,      248,     0 ), /*   247                   */
  S_ST( 't',	3,      249,     0 ), /*   248                   */
  S_ST( 'a',	3,      250,     0 ), /*   249                   */
  S_ST( 't',	3,      327,     0 ), /*   250                   */
  S_ST( 'w',	3,      252,   245 ), /*   251                   */
  S_ST( 'p',	3,      253,     0 ), /*   252                   */
  S_ST( 'r',	3,      254,     0 ), /*   253                   */
  S_ST( 'i',	3,      255,     0 ), /*   254                   */
  S_ST( 'o',	3,      256,     0 ), /*   255                   */
  S_ST( 't',	3,      257,     0 ), /*   256                   */
  S_ST( 'r',	3,      286,     0 ), /*   257                   */
  S_ST( 'e',	0,        0,     0 ), /*   258 T_Age             */
  S_ST( 'l',	0,        7,     0 ), /*   259 T_All             */
  S_ST( 'n',	0,        0,     0 ), /*   260 T_Allan           */
  S_ST( 'h',	0,        0,     0 ), /*   261 T_Auth            */
  S_ST( 'y',	0,        0,     0 ), /*   262 T_Autokey         */
  S_ST( 'x',	0,        0,     0 ), /*   263 T_Automax         */
  S_ST( 'e',	0,        0,     0 ), /*   264 T_Average         */
  S_ST( 't',	0,        0,     0 ), /*   265 T_Bclient         */
  S_ST( 'n',	0,        0,     0 ), /*   266 T_Beacon          */
  S_ST( 's',	0,        0,     0 ), /*   267 T_Bias            */
  S_ST( 't',	1,       51,     0 ), /*   268 T_Broadcast       */
  S_ST( 't',	0,        0,     0 ), /*   269 T_Broadcastclient */
  S_ST( 'y',	0,        0,     0 ), /*   270 T_Broadcastdelay  */
  S_ST( 't',	0,        0,     0 ), /*   271 T_Burst           */
  S_ST( 'e',	0,        0,     0 ), /*   272 T_Calibrate       */
  S_ST( 'y',	0,        0,     0 ), /*   273 T_Calldelay       */
  S_ST( 'g',	0,        0,     0 ), /*   274 T_Ceiling         */
  S_ST( 's',	0,        0,     0 ), /*   275 T_Clockstats      */
  S_ST( 't',	0,        0,     0 ), /*   276 T_Cohort          */
  S_ST( 'y',	0,        0,     0 ), /*   277 T_ControlKey      */
  S_ST( 'o',	0,       99,     0 ), /*   278 T_Crypto          */
  S_ST( 's',	0,        0,     0 ), /*   279 T_Cryptostats     */
  S_ST( 'y',	0,        0,     0 ), /*   280 T_Day             */
  S_ST( 't',	0,        0,     0 ), /*   281 T_Default         */
  S_ST( 't',	1,        0,     0 ), /*   282 T_Digest          */
  S_ST( 'e',	0,        0,     0 ), /*   283 T_Disable         */
  S_ST( 'd',	0,        0,     0 ), /*   284 T_Discard         */
  S_ST( 'n',	0,        0,     0 ), /*   285 T_Dispersion      */
  S_ST( 'a',	3,      328,     0 ), /*   286                   */
  S_ST( 'e',	1,        0,     0 ), /*   287 T_Driftfile       */
  S_ST( 'p',	0,        0,     0 ), /*   288 T_Drop            */
  S_ST( '.',	0,        0,     0 ), /*   289 T_Ellipsis        */
  S_ST( 'e',	0,        0,     0 ), /*   290 T_Enable          */
  S_ST( 'd',	0,        0,   143 ), /*   291 T_End             */
  S_ST( 'm',	3,      473,   219 ), /*   292                   */
  S_ST( 'e',	1,      149,     0 ), /*   293 T_File            */
  S_ST( 'n',	0,        0,     0 ), /*   294 T_Filegen         */
  S_ST( '1',	0,        0,     0 ), /*   295 T_Flag1           */
  S_ST( '2',	0,        0,   295 ), /*   296 T_Flag2           */
  S_ST( '3',	0,        0,   296 ), /*   297 T_Flag3           */
  S_ST( '4',	0,        0,   297 ), /*   298 T_Flag4           */
  S_ST( 'e',	0,        0,     0 ), /*   299 T_Flake           */
  S_ST( 'r',	0,        0,     0 ), /*   300 T_Floor           */
  S_ST( 'q',	0,      159,     0 ), /*   301 T_Freq            */
  S_ST( 'e',	1,        0,     0 ), /*   302 T_Fudge           */
  S_ST( 't',	1,        0,     0 ), /*   303 T_Host            */
  S_ST( 'f',	0,        0,     0 ), /*   304 T_Huffpuff        */
  S_ST( 't',	0,        0,     0 ), /*   305 T_Iburst          */
  S_ST( 't',	1,        0,     0 ), /*   306 T_Ident           */
  S_ST( 'e',	0,        0,     0 ), /*   307 T_Ignore          */
  S_ST( 'e',	1,        0,     0 ), /*   308 T_Includefile     */
  S_ST( 'a',	3,      433,     0 ), /*   309                   */
  S_ST( 'e',	0,        0,     0 ), /*   310 T_Interface       */
  S_ST( '4',	0,        0,     0 ), /*   311 T_Ipv4            */
  S_ST( '4',	0,        0,     0 ), /*   312 T_Ipv4_flag       */
  S_ST( '6',	0,        0,   311 ), /*   313 T_Ipv6            */
  S_ST( '6',	0,        0,   312 ), /*   314 T_Ipv6_flag       */
  S_ST( 'l',	0,        0,     0 ), /*   315 T_Kernel          */
  S_ST( 'y',	0,      317,   213 ), /*   316 T_Key             */
  S_ST( 's',	1,      216,     0 ), /*   317 T_Keys            */
  S_ST( 'r',	1,        0,     0 ), /*   318 T_Keysdir         */
  S_ST( 'd',	0,        0,     0 ), /*   319 T_Kod             */
  S_ST( 'p',	0,        0,     0 ), /*   320 T_Mssntp          */
  S_ST( 'e',	1,        0,     0 ), /*   321 T_Leapfile        */
  S_ST( 'd',	0,        0,     0 ), /*   322 T_Limited         */
  S_ST( 'k',	0,        0,     0 ), /*   323 T_Link            */
  S_ST( 'n',	0,        0,     0 ), /*   324 T_Listen          */
  S_ST( 'g',	2,        0,     0 ), /*   325 T_Logconfig       */
  S_ST( 'e',	1,        0,     0 ), /*   326 T_Logfile         */
  S_ST( 's',	0,        0,     0 ), /*   327 T_Loopstats       */
  S_ST( 'p',	0,        0,     0 ), /*   328 T_Lowpriotrap     */
  S_ST( 't',	1,        0,     0 ), /*   329 T_Manycastclient  */
  S_ST( 'r',	2,        0,     0 ), /*   330 T_Manycastserver  */
  S_ST( 'k',	0,        0,     0 ), /*   331 T_Mask            */
  S_ST( 'k',	0,        0,     0 ), /*   332 T_Maxclock        */
  S_ST( 't',	0,        0,     0 ), /*   333 T_Maxdist         */
  S_ST( 'l',	0,        0,     0 ), /*   334 T_Maxpoll         */
  S_ST( 'k',	0,        0,     0 ), /*   335 T_Minclock        */
  S_ST( 't',	0,        0,     0 ), /*   336 T_Mindist         */
  S_ST( 'm',	0,        0,     0 ), /*   337 T_Minimum         */
  S_ST( 'l',	0,        0,     0 ), /*   338 T_Minpoll         */
  S_ST( 'e',	0,        0,     0 ), /*   339 T_Minsane         */
  S_ST( 'e',	0,        0,     0 ), /*   340 T_Mode            */
  S_ST( 'r',	0,        0,     0 ), /*   341 T_Monitor         */
  S_ST( 'h',	0,        0,     0 ), /*   342 T_Month           */
  S_ST( 't',	2,        0,     0 ), /*   343 T_Multicastclient */
  S_ST( 'c',	0,        0,     0 ), /*   344 T_Nic             */
  S_ST( 'k',	0,        0,     0 ), /*   345 T_Nolink          */
  S_ST( 'y',	0,        0,     0 ), /*   346 T_Nomodify        */
  S_ST( 'e',	0,        0,     0 ), /*   347 T_None            */
  S_ST( 'r',	0,        0,     0 ), /*   348 T_Nopeer          */
  S_ST( 'y',	0,        0,     0 ), /*   349 T_Noquery         */
  S_ST( 't',	0,        0,     0 ), /*   350 T_Noselect        */
  S_ST( 'e',	0,        0,     0 ), /*   351 T_Noserve         */
  S_ST( 'p',	0,        0,     0 ), /*   352 T_Notrap          */
  S_ST( 't',	0,        0,     0 ), /*   353 T_Notrust         */
  S_ST( 'p',	0,      521,     0 ), /*   354 T_Ntp             */
  S_ST( 't',	0,        0,     0 ), /*   355 T_Ntpport         */
  S_ST( 't',	1,        0,     0 ), /*   356 T_NtpSignDsocket  */
  S_ST( 'n',	0,        0,     0 ), /*   357 T_Orphan          */
  S_ST( 'c',	0,        0,     0 ), /*   358 T_Panic           */
  S_ST( 'r',	1,      542,     0 ), /*   359 T_Peer            */
  S_ST( 's',	0,        0,     0 ), /*   360 T_Peerstats       */
  S_ST( 'e',	2,        0,     0 ), /*   361 T_Phone           */
  S_ST( 'd',	0,      550,     0 ), /*   362 T_Pid             */
  S_ST( 'e',	1,        0,     0 ), /*   363 T_Pidfile         */
  S_ST( 'l',	1,        0,     0 ), /*   364 T_Pool            */
  S_ST( 't',	0,        0,     0 ), /*   365 T_Port            */
  S_ST( 't',	0,        0,     0 ), /*   366 T_Preempt         */
  S_ST( 'r',	0,        0,     0 ), /*   367 T_Prefer          */
  S_ST( 's',	0,        0,     0 ), /*   368 T_Protostats      */
  S_ST( 'w',	1,        0,   556 ), /*   369 T_Pw              */
  S_ST( 's',	0,        0,     0 ), /*   370 T_Qos             */
  S_ST( 'e',	1,        0,     0 ), /*   371 T_Randfile        */
  S_ST( 's',	0,        0,     0 ), /*   372 T_Rawstats        */
  S_ST( 'd',	1,        0,     0 ), /*   373 T_Refid           */
  S_ST( 'y',	0,        0,     0 ), /*   374 T_Requestkey      */
  S_ST( 't',	0,        0,     0 ), /*   375 T_Restrict        */
  S_ST( 'e',	0,        0,     0 ), /*   376 T_Revoke          */
  S_ST( 'r',	1,        0,     0 ), /*   377 T_Saveconfigdir   */
  S_ST( 'r',	1,      630,     0 ), /*   378 T_Server          */
  S_ST( 'r',	1,        0,     0 ), /*   379 T_Setvar          */
  S_ST( 'n',	1,        0,     0 ), /*   380 T_Sign            */
  S_ST( 's',	0,        0,     0 ), /*   381 T_Statistics      */
  S_ST( 's',	0,      665,   660 ), /*   382 T_Stats           */
  S_ST( 'r',	1,        0,     0 ), /*   383 T_Statsdir        */
  S_ST( 'p',	0,      668,     0 ), /*   384 T_Step            */
  S_ST( 't',	0,        0,     0 ), /*   385 T_Stepout         */
  S_ST( 'm',	0,        0,     0 ), /*   386 T_Stratum         */
  S_ST( 'n',	3,      403,     0 ), /*   387                   */
  S_ST( 's',	0,        0,     0 ), /*   388 T_Sysstats        */
  S_ST( 'k',	0,        0,     0 ), /*   389 T_Tick            */
  S_ST( '1',	0,        0,     0 ), /*   390 T_Time1           */
  S_ST( '2',	0,        0,   390 ), /*   391 T_Time2           */
  S_ST( 's',	0,        0,     0 ), /*   392 T_Timingstats     */
  S_ST( 'r',	0,        0,     0 ), /*   393 T_Tinker          */
  S_ST( 's',	0,        0,     0 ), /*   394 T_Tos             */
  S_ST( 'p',	1,        0,     0 ), /*   395 T_Trap            */
  S_ST( 'e',	0,        0,     0 ), /*   396 T_True            */
  S_ST( 'y',	0,        0,     0 ), /*   397 T_Trustedkey      */
  S_ST( 'l',	0,        0,     0 ), /*   398 T_Ttl             */
  S_ST( 'e',	0,        0,     0 ), /*   399 T_Type            */
  S_ST( 'g',	1,        0,     0 ), /*   400 T_Unconfig        */
  S_ST( 'r',	1,        0,     0 ), /*   401 T_Unpeer          */
  S_ST( 'n',	0,        0,     0 ), /*   402 T_Version         */
  S_ST( 'y',	3,      408,     0 ), /*   403                   */
  S_ST( 'k',	0,        0,     0 ), /*   404 T_Week            */
  S_ST( 'd',	0,        0,     0 ), /*   405 T_Wildcard        */
  S_ST( 'e',	0,        0,     0 ), /*   406 T_Xleave          */
  S_ST( 'r',	0,        0,     0 ), /*   407 T_Year            */
  S_ST( 'c',	3,      409,     0 ), /*   408                   */
  S_ST( 'a',	3,      410,     0 ), /*   409                   */
  S_ST( 's',	3,      421,     0 ), /*   410                   */
  S_ST( 'e',	0,        0,     0 ), /*   411 T_Simulate        */
  S_ST( 'y',	0,        0,     0 ), /*   412 T_Beep_Delay      */
  S_ST( 'n',	0,        0,     0 ), /*   413 T_Sim_Duration    */
  S_ST( 't',	0,        0,     0 ), /*   414 T_Server_Offset   */
  S_ST( 'n',	0,        0,     0 ), /*   415 T_Duration        */
  S_ST( 't',	0,        0,     0 ), /*   416 T_Freq_Offset     */
  S_ST( 'r',	0,        0,     0 ), /*   417 T_Wander          */
  S_ST( 'r',	0,        0,     0 ), /*   418 T_Jitter          */
  S_ST( 'y',	0,        0,     0 ), /*   419 T_Prop_Delay      */
  S_ST( 'y',	0,        0,     0 ), /*   420 T_Proc_Delay      */
  S_ST( 't',	3,      427,     0 ), /*   421                   */
  S_ST( 'c',	3,      423,     0 ), /*   422                   */
  S_ST( 'l',	3,      424,     0 ), /*   423                   */
  S_ST( 'i',	3,      425,     0 ), /*   424                   */
  S_ST( 'e',	3,      426,     0 ), /*   425                   */
  S_ST( 'n',	3,      329,     0 ), /*   426                   */
  S_ST( 's',	3,      428,   422 ), /*   427                   */
  S_ST( 'e',	3,      429,     0 ), /*   428                   */
  S_ST( 'r',	3,      430,     0 ), /*   429                   */
  S_ST( 'v',	3,      431,     0 ), /*   430                   */
  S_ST( 'e',	3,      330,     0 ), /*   431                   */
  S_ST( 's',	3,      331,   387 ), /*   432                   */
  S_ST( 'x',	3,      441,   432 ), /*   433                   */
  S_ST( 'c',	3,      435,     0 ), /*   434                   */
  S_ST( 'l',	3,      436,     0 ), /*   435                   */
  S_ST( 'o',	3,      437,     0 ), /*   436                   */
  S_ST( 'c',	3,      332,     0 ), /*   437                   */
  S_ST( 'd',	3,      439,   434 ), /*   438                   */
  S_ST( 'i',	3,      440,     0 ), /*   439                   */
  S_ST( 's',	3,      333,     0 ), /*   440                   */
  S_ST( 'p',	3,      442,   438 ), /*   441                   */
  S_ST( 'o',	3,      443,     0 ), /*   442                   */
  S_ST( 'l',	3,      334,     0 ), /*   443                   */
  S_ST( 'i',	3,      445,   309 ), /*   444                   */
  S_ST( 'n',	3,      459,     0 ), /*   445                   */
  S_ST( 'c',	3,      447,     0 ), /*   446                   */
  S_ST( 'l',	3,      448,     0 ), /*   447                   */
  S_ST( 'o',	3,      449,     0 ), /*   448                   */
  S_ST( 'c',	3,      335,     0 ), /*   449                   */
  S_ST( 'd',	3,      451,   446 ), /*   450                   */
  S_ST( 'i',	3,      452,     0 ), /*   451                   */
  S_ST( 's',	3,      336,     0 ), /*   452                   */
  S_ST( 'i',	3,      454,   450 ), /*   453                   */
  S_ST( 'm',	3,      455,     0 ), /*   454                   */
  S_ST( 'u',	3,      337,     0 ), /*   455                   */
  S_ST( 'p',	3,      457,   453 ), /*   456                   */
  S_ST( 'o',	3,      458,     0 ), /*   457                   */
  S_ST( 'l',	3,      338,     0 ), /*   458                   */
  S_ST( 's',	3,      460,   456 ), /*   459                   */
  S_ST( 'a',	3,      461,     0 ), /*   460                   */
  S_ST( 'n',	3,      339,     0 ), /*   461                   */
  S_ST( 'o',	3,      464,   444 ), /*   462                   */
  S_ST( 'd',	3,      340,     0 ), /*   463                   */
  S_ST( 'n',	3,      468,   463 ), /*   464                   */
  S_ST( 'i',	3,      466,     0 ), /*   465                   */
  S_ST( 't',	3,      467,     0 ), /*   466                   */
  S_ST( 'o',	3,      341,     0 ), /*   467                   */
  S_ST( 't',	3,      342,   465 ), /*   468                   */
  S_ST( 's',	3,      470,   462 ), /*   469                   */
  S_ST( 's',	3,      471,     0 ), /*   470                   */
  S_ST( 'n',	3,      472,     0 ), /*   471                   */
  S_ST( 't',	3,      320,     0 ), /*   472                   */
  S_ST( 'u',	3,      474,   469 ), /*   473                   */
  S_ST( 'l',	3,      475,     0 ), /*   474                   */
  S_ST( 't',	3,      476,     0 ), /*   475                   */
  S_ST( 'i',	3,      477,     0 ), /*   476                   */
  S_ST( 'c',	3,      478,     0 ), /*   477                   */
  S_ST( 'a',	3,      479,     0 ), /*   478                   */
  S_ST( 's',	3,      480,     0 ), /*   479                   */
  S_ST( 't',	3,      481,     0 ), /*   480                   */
  S_ST( 'c',	3,      482,     0 ), /*   481                   */
  S_ST( 'l',	3,      483,     0 ), /*   482                   */
  S_ST( 'i',	3,      484,     0 ), /*   483                   */
  S_ST( 'e',	3,      485,     0 ), /*   484                   */
  S_ST( 'n',	3,      343,     0 ), /*   485                   */
  S_ST( 'n',	3,      517,   292 ), /*   486                   */
  S_ST( 'i',	3,      344,     0 ), /*   487                   */
  S_ST( 'o',	3,      512,   487 ), /*   488                   */
  S_ST( 'l',	3,      490,     0 ), /*   489                   */
  S_ST( 'i',	3,      491,     0 ), /*   490                   */
  S_ST( 'n',	3,      345,     0 ), /*   491                   */
  S_ST( 'm',	3,      493,   489 ), /*   492                   */
  S_ST( 'o',	3,      494,     0 ), /*   493                   */
  S_ST( 'd',	3,      495,     0 ), /*   494                   */
  S_ST( 'i',	3,      496,     0 ), /*   495                   */
  S_ST( 'f',	3,      346,     0 ), /*   496                   */
  S_ST( 'n',	3,      347,   492 ), /*   497                   */
  S_ST( 'p',	3,      499,   497 ), /*   498                   */
  S_ST( 'e',	3,      500,     0 ), /*   499                   */
  S_ST( 'e',	3,      348,     0 ), /*   500                   */
  S_ST( 'q',	3,      502,   498 ), /*   501                   */
  S_ST( 'u',	3,      503,     0 ), /*   502                   */
  S_ST( 'e',	3,      504,     0 ), /*   503                   */
  S_ST( 'r',	3,      349,     0 ), /*   504                   */
  S_ST( 's',	3,      506,   501 ), /*   505                   */
  S_ST( 'e',	3,      510,     0 ), /*   506                   */
  S_ST( 'l',	3,      508,     0 ), /*   507                   */
  S_ST( 'e',	3,      509,     0 ), /*   508                   */
  S_ST( 'c',	3,      350,     0 ), /*   509                   */
  S_ST( 'r',	3,      511,   507 ), /*   510                   */
  S_ST( 'v',	3,      351,     0 ), /*   511                   */
  S_ST( 't',	3,      513,   505 ), /*   512                   */
  S_ST( 'r',	3,      515,     0 ), /*   513                   */
  S_ST( 'a',	3,      352,     0 ), /*   514                   */
  S_ST( 'u',	3,      516,   514 ), /*   515                   */
  S_ST( 's',	3,      353,     0 ), /*   516                   */
  S_ST( 't',	3,      354,   488 ), /*   517                   */
  S_ST( 'p',	3,      519,     0 ), /*   518                   */
  S_ST( 'o',	3,      520,     0 ), /*   519                   */
  S_ST( 'r',	3,      355,     0 ), /*   520                   */
  S_ST( 's',	3,      522,   518 ), /*   521                   */
  S_ST( 'i',	3,      523,     0 ), /*   522                   */
  S_ST( 'g',	3,      524,     0 ), /*   523                   */
  S_ST( 'n',	3,      525,     0 ), /*   524                   */
  S_ST( 'd',	3,      526,     0 ), /*   525                   */
  S_ST( 's',	3,      527,     0 ), /*   526                   */
  S_ST( 'o',	3,      528,     0 ), /*   527                   */
  S_ST( 'c',	3,      529,     0 ), /*   528                   */
  S_ST( 'k',	3,      530,     0 ), /*   529                   */
  S_ST( 'e',	3,      356,     0 ), /*   530                   */
  S_ST( 'o',	3,      532,   486 ), /*   531                   */
  S_ST( 'r',	3,      533,     0 ), /*   532                   */
  S_ST( 'p',	3,      534,     0 ), /*   533                   */
  S_ST( 'h',	3,      535,     0 ), /*   534                   */
  S_ST( 'a',	3,      357,     0 ), /*   535                   */
  S_ST( 'p',	3,      369,   531 ), /*   536                   */
  S_ST( 'a',	3,      538,     0 ), /*   537                   */
  S_ST( 'n',	3,      539,     0 ), /*   538                   */
  S_ST( 'i',	3,      358,     0 ), /*   539                   */
  S_ST( 'e',	3,      541,   537 ), /*   540                   */
  S_ST( 'e',	3,      359,     0 ), /*   541                   */
  S_ST( 's',	3,      543,     0 ), /*   542                   */
  S_ST( 't',	3,      544,     0 ), /*   543                   */
  S_ST( 'a',	3,      545,     0 ), /*   544                   */
  S_ST( 't',	3,      360,     0 ), /*   545                   */
  S_ST( 'h',	3,      547,   540 ), /*   546                   */
  S_ST( 'o',	3,      548,     0 ), /*   547                   */
  S_ST( 'n',	3,      361,     0 ), /*   548                   */
  S_ST( 'i',	3,      362,   546 ), /*   549                   */
  S_ST( 'f',	3,      551,     0 ), /*   550                   */
  S_ST( 'i',	3,      552,     0 ), /*   551                   */
  S_ST( 'l',	3,      363,     0 ), /*   552                   */
  S_ST( 'o',	3,      555,   549 ), /*   553                   */
  S_ST( 'o',	3,      364,     0 ), /*   554                   */
  S_ST( 'r',	3,      365,   554 ), /*   555                   */
  S_ST( 'r',	3,      563,   553 ), /*   556                   */
  S_ST( 'e',	3,      561,     0 ), /*   557                   */
  S_ST( 'e',	3,      559,     0 ), /*   558                   */
  S_ST( 'm',	3,      560,     0 ), /*   559                   */
  S_ST( 'p',	3,      366,     0 ), /*   560                   */
  S_ST( 'f',	3,      562,   558 ), /*   561                   */
  S_ST( 'e',	3,      367,     0 ), /*   562                   */
  S_ST( 'o',	3,      576,   557 ), /*   563                   */
  S_ST( 'c',	3,      565,     0 ), /*   564                   */
  S_ST( '_',	3,      566,     0 ), /*   565                   */
  S_ST( 'd',	3,      567,     0 ), /*   566                   */
  S_ST( 'e',	3,      568,     0 ), /*   567                   */
  S_ST( 'l',	3,      569,     0 ), /*   568                   */
  S_ST( 'a',	3,      420,     0 ), /*   569                   */
  S_ST( 'p',	3,      571,   564 ), /*   570                   */
  S_ST( '_',	3,      572,     0 ), /*   571                   */
  S_ST( 'd',	3,      573,     0 ), /*   572                   */
  S_ST( 'e',	3,      574,     0 ), /*   573                   */
  S_ST( 'l',	3,      575,     0 ), /*   574                   */
  S_ST( 'a',	3,      419,     0 ), /*   575                   */
  S_ST( 't',	3,      577,   570 ), /*   576                   */
  S_ST( 'o',	3,      578,     0 ), /*   577                   */
  S_ST( 's',	3,      579,     0 ), /*   578                   */
  S_ST( 't',	3,      580,     0 ), /*   579                   */
  S_ST( 'a',	3,      581,     0 ), /*   580                   */
  S_ST( 't',	3,      368,     0 ), /*   581                   */
  S_ST( 'q',	3,      583,   536 ), /*   582                   */
  S_ST( 'o',	3,      370,     0 ), /*   583                   */
  S_ST( 'r',	3,      596,   582 ), /*   584                   */
  S_ST( 'a',	3,      591,     0 ), /*   585                   */
  S_ST( 'n',	3,      587,     0 ), /*   586                   */
  S_ST( 'd',	3,      588,     0 ), /*   587                   */
  S_ST( 'f',	3,      589,     0 ), /*   588                   */
  S_ST( 'i',	3,      590,     0 ), /*   589                   */
  S_ST( 'l',	3,      371,     0 ), /*   590                   */
  S_ST( 'w',	3,      592,   586 ), /*   591                   */
  S_ST( 's',	3,      593,     0 ), /*   592                   */
  S_ST( 't',	3,      594,     0 ), /*   593                   */
  S_ST( 'a',	3,      595,     0 ), /*   594                   */
  S_ST( 't',	3,      372,     0 ), /*   595                   */
  S_ST( 'e',	3,      611,   585 ), /*   596                   */
  S_ST( 'f',	3,      598,     0 ), /*   597                   */
  S_ST( 'i',	3,      373,     0 ), /*   598                   */
  S_ST( 'q',	3,      600,   597 ), /*   599                   */
  S_ST( 'u',	3,      601,     0 ), /*   600                   */
  S_ST( 'e',	3,      602,     0 ), /*   601                   */
  S_ST( 's',	3,      603,     0 ), /*   602                   */
  S_ST( 't',	3,      604,     0 ), /*   603                   */
  S_ST( 'k',	3,      605,     0 ), /*   604                   */
  S_ST( 'e',	3,      374,     0 ), /*   605                   */
  S_ST( 's',	3,      607,   599 ), /*   606                   */
  S_ST( 't',	3,      608,     0 ), /*   607                   */
  S_ST( 'r',	3,      609,     0 ), /*   608                   */
  S_ST( 'i',	3,      610,     0 ), /*   609                   */
  S_ST( 'c',	3,      375,     0 ), /*   610                   */
  S_ST( 'v',	3,      612,   606 ), /*   611                   */
  S_ST( 'o',	3,      613,     0 ), /*   612                   */
  S_ST( 'k',	3,      376,     0 ), /*   613                   */
  S_ST( 's',	3,      674,   584 ), /*   614                   */
  S_ST( 'a',	3,      616,     0 ), /*   615                   */
  S_ST( 'v',	3,      617,     0 ), /*   616                   */
  S_ST( 'e',	3,      618,     0 ), /*   617                   */
  S_ST( 'c',	3,      619,     0 ), /*   618                   */
  S_ST( 'o',	3,      620,     0 ), /*   619                   */
  S_ST( 'n',	3,      621,     0 ), /*   620                   */
  S_ST( 'f',	3,      622,     0 ), /*   621                   */
  S_ST( 'i',	3,      623,     0 ), /*   622                   */
  S_ST( 'g',	3,      624,     0 ), /*   623                   */
  S_ST( 'd',	3,      625,     0 ), /*   624                   */
  S_ST( 'i',	3,      377,     0 ), /*   625                   */
  S_ST( 'e',	3,      636,   615 ), /*   626                   */
  S_ST( 'r',	3,      628,     0 ), /*   627                   */
  S_ST( 'v',	3,      629,     0 ), /*   628                   */
  S_ST( 'e',	3,      378,     0 ), /*   629                   */
  S_ST( '_',	3,      631,     0 ), /*   630                   */
  S_ST( 'o',	3,      632,     0 ), /*   631                   */
  S_ST( 'f',	3,      633,     0 ), /*   632                   */
  S_ST( 'f',	3,      634,     0 ), /*   633                   */
  S_ST( 's',	3,      635,     0 ), /*   634                   */
  S_ST( 'e',	3,      414,     0 ), /*   635                   */
  S_ST( 't',	3,      637,   627 ), /*   636                   */
  S_ST( 'v',	3,      638,     0 ), /*   637                   */
  S_ST( 'a',	3,      379,     0 ), /*   638                   */
  S_ST( 'i',	3,      641,   626 ), /*   639                   */
  S_ST( 'g',	3,      380,     0 ), /*   640                   */
  S_ST( 'm',	3,      642,   640 ), /*   641                   */
  S_ST( 'u',	3,      643,     0 ), /*   642                   */
  S_ST( 'l',	3,      644,     0 ), /*   643                   */
  S_ST( 'a',	3,      645,     0 ), /*   644                   */
  S_ST( 't',	3,      646,     0 ), /*   645                   */
  S_ST( 'i',	3,      647,   411 ), /*   646                   */
  S_ST( 'o',	3,      648,     0 ), /*   647                   */
  S_ST( 'n',	3,      649,     0 ), /*   648                   */
  S_ST( '_',	3,      650,     0 ), /*   649                   */
  S_ST( 'd',	3,      651,     0 ), /*   650                   */
  S_ST( 'u',	3,      652,     0 ), /*   651                   */
  S_ST( 'r',	3,      653,     0 ), /*   652                   */
  S_ST( 'a',	3,      654,     0 ), /*   653                   */
  S_ST( 't',	3,      655,     0 ), /*   654                   */
  S_ST( 'i',	3,      656,     0 ), /*   655                   */
  S_ST( 'o',	3,      413,     0 ), /*   656                   */
  S_ST( 't',	3,      670,   639 ), /*   657                   */
  S_ST( 'a',	3,      659,     0 ), /*   658                   */
  S_ST( 't',	3,      382,     0 ), /*   659                   */
  S_ST( 'i',	3,      661,     0 ), /*   660                   */
  S_ST( 's',	3,      662,     0 ), /*   661                   */
  S_ST( 't',	3,      663,     0 ), /*   662                   */
  S_ST( 'i',	3,      664,     0 ), /*   663                   */
  S_ST( 'c',	3,      381,     0 ), /*   664                   */
  S_ST( 'd',	3,      666,     0 ), /*   665                   */
  S_ST( 'i',	3,      383,     0 ), /*   666                   */
  S_ST( 'e',	3,      384,   658 ), /*   667                   */
  S_ST( 'o',	3,      669,     0 ), /*   668                   */
  S_ST( 'u',	3,      385,     0 ), /*   669                   */
  S_ST( 'r',	3,      671,   667 ), /*   670                   */
  S_ST( 'a',	3,      672,     0 ), /*   671                   */
  S_ST( 't',	3,      673,     0 ), /*   672                   */
  S_ST( 'u',	3,      386,     0 ), /*   673                   */
  S_ST( 'y',	3,      675,   657 ), /*   674                   */
  S_ST( 's',	3,      676,     0 ), /*   675                   */
  S_ST( 's',	3,      677,     0 ), /*   676                   */
  S_ST( 't',	3,      678,     0 ), /*   677                   */
  S_ST( 'a',	3,      679,     0 ), /*   678                   */
  S_ST( 't',	3,      388,     0 ), /*   679                   */
  S_ST( 't',	3,      706,   614 ), /*   680                   */
  S_ST( 'i',	3,      692,     0 ), /*   681                   */
  S_ST( 'c',	3,      389,     0 ), /*   682                   */
  S_ST( 'm',	3,      685,   682 ), /*   683                   */
  S_ST( 'e',	3,      391,     0 ), /*   684                   */
  S_ST( 'i',	3,      686,   684 ), /*   685                   */
  S_ST( 'n',	3,      687,     0 ), /*   686                   */
  S_ST( 'g',	3,      688,     0 ), /*   687                   */
  S_ST( 's',	3,      689,     0 ), /*   688                   */
  S_ST( 't',	3,      690,     0 ), /*   689                   */
  S_ST( 'a',	3,      691,     0 ), /*   690                   */
  S_ST( 't',	3,      392,     0 ), /*   691                   */
  S_ST( 'n',	3,      693,   683 ), /*   692                   */
  S_ST( 'k',	3,      694,     0 ), /*   693                   */
  S_ST( 'e',	3,      393,     0 ), /*   694                   */
  S_ST( 'o',	3,      394,   681 ), /*   695                   */
  S_ST( 'r',	3,      698,   695 ), /*   696                   */
  S_ST( 'a',	3,      395,     0 ), /*   697                   */
  S_ST( 'u',	3,      699,   697 ), /*   698                   */
  S_ST( 's',	3,      700,   396 ), /*   699                   */
  S_ST( 't',	3,      701,     0 ), /*   700                   */
  S_ST( 'e',	3,      702,     0 ), /*   701                   */
  S_ST( 'd',	3,      703,     0 ), /*   702                   */
  S_ST( 'k',	3,      704,     0 ), /*   703                   */
  S_ST( 'e',	3,      397,     0 ), /*   704                   */
  S_ST( 't',	3,      398,   696 ), /*   705                   */
  S_ST( 'y',	3,      707,   705 ), /*   706                   */
  S_ST( 'p',	3,      399,     0 ), /*   707                   */
  S_ST( 'u',	3,      709,   680 ), /*   708                   */
  S_ST( 'n',	3,      715,     0 ), /*   709                   */
  S_ST( 'c',	3,      711,     0 ), /*   710                   */
  S_ST( 'o',	3,      712,     0 ), /*   711                   */
  S_ST( 'n',	3,      713,     0 ), /*   712                   */
  S_ST( 'f',	3,      714,     0 ), /*   713                   */
  S_ST( 'i',	3,      400,     0 ), /*   714                   */
  S_ST( 'p',	3,      716,   710 ), /*   715                   */
  S_ST( 'e',	3,      717,     0 ), /*   716                   */
  S_ST( 'e',	3,      401,     0 ), /*   717                   */
  S_ST( 'v',	3,      719,   708 ), /*   718                   */
  S_ST( 'e',	3,      720,     0 ), /*   719                   */
  S_ST( 'r',	3,      721,     0 ), /*   720                   */
  S_ST( 's',	3,      722,     0 ), /*   721                   */
  S_ST( 'i',	3,      723,     0 ), /*   722                   */
  S_ST( 'o',	3,      402,     0 ), /*   723                   */
  S_ST( 'w',	3,      731,   718 ), /*   724                   */
  S_ST( 'a',	3,      726,     0 ), /*   725                   */
  S_ST( 'n',	3,      727,     0 ), /*   726                   */
  S_ST( 'd',	3,      728,     0 ), /*   727                   */
  S_ST( 'e',	3,      417,     0 ), /*   728                   */
  S_ST( 'e',	3,      730,   725 ), /*   729                   */
  S_ST( 'e',	3,      404,     0 ), /*   730                   */
  S_ST( 'i',	3,      732,   729 ), /*   731                   */
  S_ST( 'l',	3,      733,     0 ), /*   732                   */
  S_ST( 'd',	3,      734,     0 ), /*   733                   */
  S_ST( 'c',	3,      735,     0 ), /*   734                   */
  S_ST( 'a',	3,      736,     0 ), /*   735                   */
  S_ST( 'r',	3,      405,     0 ), /*   736                   */
  S_ST( 'x',	3,      738,   724 ), /*   737                   */
  S_ST( 'l',	3,      739,     0 ), /*   738                   */
  S_ST( 'e',	3,      740,     0 ), /*   739                   */
  S_ST( 'a',	3,      741,     0 ), /*   740                   */
  S_ST( 'v',	3,      406,     0 ), /*   741                   */
  S_ST( 'y',	3,      743,   737 ), /*   742 initial state     */
  S_ST( 'e',	3,      744,     0 ), /*   743                   */
  S_ST( 'a',	3,      407,     0 )  /*   744                   */
};

ntp-4.2.6p5/ntpd/refclock_arc.c0000644000175000017500000013524611616416170015355 0ustar  peterpeter/*
 * refclock_arc - clock driver for ARCRON MSF/DCF/WWVB receivers
 */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_ARCRON_MSF)

static const char arc_version[] = { "V1.3 2003/02/21" };

/* define PRE_NTP420 for compatibility to previous versions of NTP (at least
   to 4.1.0 */
#undef PRE_NTP420

#ifndef ARCRON_NOT_KEEN
#define ARCRON_KEEN 1 /* Be keen, and trusting of the clock, if defined. */
#endif

#ifndef ARCRON_NOT_MULTIPLE_SAMPLES
#define ARCRON_MULTIPLE_SAMPLES 1 /* Use all timestamp bytes as samples. */
#endif

#ifndef ARCRON_NOT_LEAPSECOND_KEEN
#ifndef ARCRON_LEAPSECOND_KEEN
#undef ARCRON_LEAPSECOND_KEEN /* Respond quickly to leap seconds: doesn't work yet. */
#endif
#endif

/*
Code by Derek Mulcahy, , 1997.
Modifications by Damon Hart-Davis, , 1997.
Modifications by Paul Alfille, , 2003.
Modifications by Christopher Price, , 2003.
Modifications by Nigel Roles , 2003.


THIS CODE IS SUPPLIED AS IS, WITH NO WARRANTY OF ANY KIND.  USE AT
YOUR OWN RISK.

Orginally developed and used with ntp3-5.85 by Derek Mulcahy.

Built against ntp3-5.90 on Solaris 2.5 using gcc 2.7.2.

This code may be freely copied and used and incorporated in other
systems providing the disclaimer and notice of authorship are
reproduced.

-------------------------------------------------------------------------------

Nigel's notes:

1) Called tcgetattr() before modifying, so that fields correctly initialised
   for all operating systems

2) Altered parsing of timestamp line so that it copes with fields which are
   not always ASCII digits (e.g. status field when battery low)

-------------------------------------------------------------------------------

Christopher's notes:

MAJOR CHANGES SINCE V1.2 
========================
 1) Applied patch by Andrey Bray 
    2001-02-17 comp.protocols.time.ntp

 2) Added WWVB support via clock mode command, localtime/UTC time configured
    via flag1=(0=UTC, 1=localtime)

 3) Added ignore resync request via flag2=(0=resync, 1=ignore resync)

 4) Added simplified conversion from localtime to UTC with dst/bst translation

 5) Added average signal quality poll

 6) Fixed a badformat error when no code is available due to stripping 
    \n & \r's 

 7) Fixed a badformat error when clearing lencode & memset a_lastcode in poll
    routine

 8) Lots of code cleanup, including standardized DEBUG macros and removal 
    of unused code 

-------------------------------------------------------------------------------

Author's original note:

I enclose my ntp driver for the Galleon Systems Arc MSF receiver.

It works (after a fashion) on both Solaris-1 and Solaris-2.

I am currently using ntp3-5.85.  I have been running the code for
about 7 months without any problems.  Even coped with the change to BST!

I had to do some funky things to read from the clock because it uses the
power from the receive lines to drive the transmit lines.  This makes the
code look a bit stupid but it works.  I also had to put in some delays to
allow for the turnaround time from receive to transmit.  These delays
are between characters when requesting a time stamp so that shouldn't affect
the results too drastically.

...

The bottom line is that it works but could easily be improved.  You are
free to do what you will with the code.  I haven't been able to determine
how good the clock is.  I think that this requires a known good clock
to compare it against.

-------------------------------------------------------------------------------

Damon's notes for adjustments:

MAJOR CHANGES SINCE V1.0
========================
 1) Removal of pollcnt variable that made the clock go permanently
    off-line once two time polls failed to gain responses.

 2) Avoiding (at least on Solaris-2) terminal becoming the controlling
    terminal of the process when we do a low-level open().

 3) Additional logic (conditional on ARCRON_LEAPSECOND_KEEN being
    defined) to try to resync quickly after a potential leap-second
    insertion or deletion.

 4) Code significantly slimmer at run-time than V1.0.


GENERAL
=======

 1) The C preprocessor symbol to have the clock built has been changed
    from ARC to ARCRON_MSF to CLOCK_ARCRON_MSF to minimise the
    possiblity of clashes with other symbols in the future.

 2) PRECISION should be -4/-5 (63ms/31ms) for the following reasons:

     a) The ARC documentation claims the internal clock is (only)
	accurate to about 20ms relative to Rugby (plus there must be
	noticable drift and delay in the ms range due to transmission
	delays and changing atmospheric effects).  This clock is not
	designed for ms accuracy as NTP has spoilt us all to expect.

     b) The clock oscillator looks like a simple uncompensated quartz
	crystal of the sort used in digital watches (ie 32768Hz) which
	can have large temperature coefficients and drifts; it is not
	clear if this oscillator is properly disciplined to the MSF
	transmission, but as the default is to resync only once per
	*day*, we can imagine that it is not, and is free-running.  We
	can minimise drift by resyncing more often (at the cost of
	reduced battery life), but drift/wander may still be
	significant.

     c) Note that the bit time of 3.3ms adds to the potential error in
	the the clock timestamp, since the bit clock of the serial link
	may effectively be free-running with respect to the host clock
	and the MSF clock.  Actually, the error is probably 1/16th of
	the above, since the input data is probably sampled at at least
	16x the bit rate.

    By keeping the clock marked as not very precise, it will have a
    fairly large dispersion, and thus will tend to be used as a
    `backup' time source and sanity checker, which this clock is
    probably ideal for.  For an isolated network without other time
    sources, this clock can probably be expected to provide *much*
    better than 1s accuracy, which will be fine.

    By default, PRECISION is set to -4, but experience, especially at a
    particular geographic location with a particular clock, may allow
    this to be altered to -5.  (Note that skews of +/- 10ms are to be
    expected from the clock from time-to-time.)  This improvement of
    reported precision can be instigated by setting flag3 to 1, though
    the PRECISION will revert to the normal value while the clock
    signal quality is unknown whatever the flag3 setting.

    IN ANY CASE, BE SURE TO SET AN APPROPRIATE FUDGE FACTOR TO REMOVE
    ANY RESIDUAL SKEW, eg:

	server 127.127.27.0 # ARCRON MSF radio clock unit 0.
	# Fudge timestamps by about 20ms.
	fudge 127.127.27.0 time1 0.020

    You will need to observe your system's behaviour, assuming you have
    some other NTP source to compare it with, to work out what the
    fudge factor should be.  For my Sun SS1 running SunOS 4.1.3_U1 with
    my MSF clock with my distance from the MSF transmitter, +20ms
    seemed about right, after some observation.

 3) REFID has been made "MSFa" to reflect the MSF time source and the
    ARCRON receiver.

 4) DEFAULT_RESYNC_TIME is the time in seconds (by default) before
    forcing a resync since the last attempt.  This is picked to give a
    little less than an hour between resyncs and to try to avoid
    clashing with any regular event at a regular time-past-the-hour
    which might cause systematic errors.

    The INITIAL_RESYNC_DELAY is to avoid bothering the clock and
    running down its batteries unnecesarily if ntpd is going to crash
    or be killed or reconfigured quickly.  If ARCRON_KEEN is defined
    then this period is long enough for (with normal polling rates)
    enough time samples to have been taken to allow ntpd to sync to
    the clock before the interruption for the clock to resync to MSF.
    This avoids ntpd syncing to another peer first and then
    almost immediately hopping to the MSF clock.

    The RETRY_RESYNC_TIME is used before rescheduling a resync after a
    resync failed to reveal a statisfatory signal quality (too low or
    unknown).

 5) The clock seems quite jittery, so I have increased the
    median-filter size from the typical (previous) value of 3.  I
    discard up to half the results in the filter.  It looks like maybe
    1 sample in 10 or so (maybe less) is a spike, so allow the median
    filter to discard at least 10% of its entries or 1 entry, whichever
    is greater.

 6) Sleeping *before* each character sent to the unit to allow required
    inter-character time but without introducting jitter and delay in
    handling the response if possible.

 7) If the flag ARCRON_KEEN is defined, take time samples whenever
    possible, even while resyncing, etc.  We rely, in this case, on the
    clock always giving us a reasonable time or else telling us in the
    status byte at the end of the timestamp that it failed to sync to
    MSF---thus we should never end up syncing to completely the wrong
    time.

 8) If the flag ARCRON_OWN_FILTER is defined, use own versions of
    refclock median-filter routines to get round small bug in 3-5.90
    code which does not return the median offset. XXX Removed this
    bit due NTP Version 4 upgrade - dlm.

 9) We would appear to have a year-2000 problem with this clock since
    it returns only the two least-significant digits of the year.  But
    ntpd ignores the year and uses the local-system year instead, so
    this is in fact not a problem.  Nevertheless, we attempt to do a
    sensible thing with the dates, wrapping them into a 100-year
    window.

 10)Logs stats information that can be used by Derek's Tcl/Tk utility
    to show the status of the clock.

 11)The clock documentation insists that the number of bits per
    character to be sent to the clock, and sent by it, is 11, including
    one start bit and two stop bits.  The data format is either 7+even
    or 8+none.


TO-DO LIST
==========

  * Eliminate use of scanf(), and maybe sprintf().

  * Allow user setting of resync interval to trade battery life for
    accuracy; maybe could be done via fudge factor or unit number.

  * Possibly note the time since the last resync of the MSF clock to
    MSF as the age of the last reference timestamp, ie trust the
    clock's oscillator not very much...

  * Add very slow auto-adjustment up to a value of +/- time2 to correct
    for long-term errors in the clock value (time2 defaults to 0 so the
    correction would be disabled by default).

  * Consider trying to use the tty_clk/ppsclock support.

  * Possibly use average or maximum signal quality reported during
    resync, rather than just the last one, which may be atypical.

*/


/* Notes for HKW Elektronik GmBH Radio clock driver */
/* Author Lyndon David, Sentinet Ltd, Feb 1997      */
/* These notes seem also to apply usefully to the ARCRON clock. */

/* The HKW clock module is a radio receiver tuned into the Rugby */
/* MSF time signal tranmitted on 60 kHz. The clock module connects */
/* to the computer via a serial line and transmits the time encoded */
/* in 15 bytes at 300 baud 7 bits two stop bits even parity */

/* Clock communications, from the datasheet */
/* All characters sent to the clock are echoed back to the controlling */
/* device. */
/* Transmit time/date information */
/* syntax ASCII o */
/* Character o may be replaced if neccesary by a character whose code */
/* contains the lowest four bits f(hex) eg */
/* syntax binary: xxxx1111 00001101 */

/* DHD note:
You have to wait for character echo + 10ms before sending next character.
*/

/* The clock replies to this command with a sequence of 15 characters */
/* which contain the complete time and a final  making 16 characters */
/* in total. */
/* The RC computer clock will not reply immediately to this command because */
/* the start bit edge of the first reply character marks the beginning of */
/* the second. So the RC Computer Clock will reply to this command at the */
/* start of the next second */
/* The characters have the following meaning */
/* 1. hours tens   */
/* 2. hours units  */
/* 3. minutes tens */
/* 4. minutes units */
/* 5. seconds tens  */
/* 6. seconds units */
/* 7. day of week 1-monday 7-sunday */
/* 8. day of month tens */
/* 9. day of month units */
/* 10. month tens */
/* 11. month units */
/* 12. year tens */
/* 13. year units */
/* 14. BST/UTC status */
/*	bit 7	parity */
/*	bit 6	always 0 */
/*	bit 5	always 1 */
/*	bit 4	always 1 */
/*	bit 3	always 0 */
/*	bit 2	=1 if UTC is in effect, complementary to the BST bit */
/*	bit 1	=1 if BST is in effect, according to the BST bit     */
/*	bit 0	BST/UTC change impending bit=1 in case of change impending */
/* 15. status */
/*	bit 7	parity */
/*	bit 6	always 0 */
/*	bit 5	always 1 */
/*	bit 4	always 1 */
/*	bit 3	=1 if low battery is detected */
/*	bit 2	=1 if the very last reception attempt failed and a valid */
/*		time information already exists (bit0=1) */
/*		=0 if the last reception attempt was successful */
/*	bit 1	=1 if at least one reception since 2:30 am was successful */
/*		=0 if no reception attempt since 2:30 am was successful */
/*	bit 0	=1 if the RC Computer Clock contains valid time information */
/*		This bit is zero after reset and one after the first */
/*		successful reception attempt */

/* DHD note:
Also note g command which confirms that a resync is in progress, and
if so what signal quality (0--5) is available.
Also note h command which starts a resync to MSF signal.
*/


#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_calendar.h"
#include "ntp_stdlib.h"

#include 
#include 

#if defined(HAVE_BSD_TTYS)
#include 
#endif /* HAVE_BSD_TTYS */

#if defined(HAVE_SYSV_TTYS)
#include 
#endif /* HAVE_SYSV_TTYS */

#if defined(HAVE_TERMIOS)
#include 
#endif

/*
 * This driver supports the ARCRON MSF/DCF/WWVB Radio Controlled Clock
 */

/*
 * Interface definitions
 */
#define DEVICE		"/dev/arc%d"	/* Device name and unit. */
#define SPEED		B300		/* UART speed (300 baud) */
#define PRECISION	(-4)		/* Precision  (~63 ms). */
#define HIGHPRECISION	(-5)		/* If things are going well... */
#define REFID		"MSFa"		/* Reference ID. */
#define REFID_MSF	"MSF"		/* Reference ID. */
#define REFID_DCF77	"DCF"		/* Reference ID. */
#define REFID_WWVB	"WWVB"		/* Reference ID. */
#define DESCRIPTION	"ARCRON MSF/DCF/WWVB Receiver"

#ifdef PRE_NTP420
#define MODE ttlmax
#else
#define MODE ttl
#endif

#define LENARC		16		/* Format `o' timecode length. */

#define BITSPERCHAR	11		/* Bits per character. */
#define BITTIME		0x0DA740E	/* Time for 1 bit at 300bps. */
#define CHARTIME10	0x8888888	/* Time for 10-bit char at 300bps. */
#define CHARTIME11	0x962FC96	/* Time for 11-bit char at 300bps. */
#define CHARTIME			/* Time for char at 300bps. */ \
( (BITSPERCHAR == 11) ? CHARTIME11 : ( (BITSPERCHAR == 10) ? CHARTIME10 : \
				       (BITSPERCHAR * BITTIME) ) )

     /* Allow for UART to accept char half-way through final stop bit. */
#define INITIALOFFSET (u_int32)(-BITTIME/2)

     /*
    charoffsets[x] is the time after the start of the second that byte
    x (with the first byte being byte 1) is received by the UART,
    assuming that the initial edge of the start bit of the first byte
    is on-time.  The values are represented as the fractional part of
    an l_fp.

    We store enough values to have the offset of each byte including
    the trailing \r, on the assumption that the bytes follow one
    another without gaps.
    */
     static const u_int32 charoffsets[LENARC+1] = {
#if BITSPERCHAR == 11 /* Usual case. */
	     /* Offsets computed as accurately as possible... */
	     0,
	     INITIALOFFSET + 0x0962fc96, /*  1 chars,  11 bits */
	     INITIALOFFSET + 0x12c5f92c, /*  2 chars,  22 bits */
	     INITIALOFFSET + 0x1c28f5c3, /*  3 chars,  33 bits */
	     INITIALOFFSET + 0x258bf259, /*  4 chars,  44 bits */
	     INITIALOFFSET + 0x2eeeeeef, /*  5 chars,  55 bits */
	     INITIALOFFSET + 0x3851eb85, /*  6 chars,  66 bits */
	     INITIALOFFSET + 0x41b4e81b, /*  7 chars,  77 bits */
	     INITIALOFFSET + 0x4b17e4b1, /*  8 chars,  88 bits */
	     INITIALOFFSET + 0x547ae148, /*  9 chars,  99 bits */
	     INITIALOFFSET + 0x5dddddde, /* 10 chars, 110 bits */
	     INITIALOFFSET + 0x6740da74, /* 11 chars, 121 bits */
	     INITIALOFFSET + 0x70a3d70a, /* 12 chars, 132 bits */
	     INITIALOFFSET + 0x7a06d3a0, /* 13 chars, 143 bits */
	     INITIALOFFSET + 0x8369d037, /* 14 chars, 154 bits */
	     INITIALOFFSET + 0x8ccccccd, /* 15 chars, 165 bits */
	     INITIALOFFSET + 0x962fc963  /* 16 chars, 176 bits */
#else
	     /* Offsets computed with a small rounding error... */
	     0,
	     INITIALOFFSET +  1 * CHARTIME,
	     INITIALOFFSET +  2 * CHARTIME,
	     INITIALOFFSET +  3 * CHARTIME,
	     INITIALOFFSET +  4 * CHARTIME,
	     INITIALOFFSET +  5 * CHARTIME,
	     INITIALOFFSET +  6 * CHARTIME,
	     INITIALOFFSET +  7 * CHARTIME,
	     INITIALOFFSET +  8 * CHARTIME,
	     INITIALOFFSET +  9 * CHARTIME,
	     INITIALOFFSET + 10 * CHARTIME,
	     INITIALOFFSET + 11 * CHARTIME,
	     INITIALOFFSET + 12 * CHARTIME,
	     INITIALOFFSET + 13 * CHARTIME,
	     INITIALOFFSET + 14 * CHARTIME,
	     INITIALOFFSET + 15 * CHARTIME,
	     INITIALOFFSET + 16 * CHARTIME
#endif
     };

#define DEFAULT_RESYNC_TIME  (57*60)	/* Gap between resync attempts (s). */
#define RETRY_RESYNC_TIME    (27*60)	/* Gap to emergency resync attempt. */
#ifdef ARCRON_KEEN
#define INITIAL_RESYNC_DELAY 500	/* Delay before first resync. */
#else
#define INITIAL_RESYNC_DELAY 50		/* Delay before first resync. */
#endif

     static const int moff[12] =
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
/* Flags for a raw open() of the clock serial device. */
#ifdef O_NOCTTY /* Good, we can avoid tty becoming controlling tty. */
#define OPEN_FLAGS (O_RDWR | O_NOCTTY)
#else		/* Oh well, it may not matter... */
#define OPEN_FLAGS (O_RDWR)
#endif


/* Length of queue of command bytes to be sent. */
#define CMDQUEUELEN 4			/* Enough for two cmds + each \r. */
/* Queue tick time; interval in seconds between chars taken off queue. */
/* Must be >= 2 to allow o\r response to come back uninterrupted. */
#define QUEUETICK   2			/* Allow o\r reply to finish. */

/*
 * ARC unit control structure
 */
struct arcunit {
	l_fp lastrec;	    /* Time tag for the receive time (system). */
	int status;	    /* Clock status. */

	int quality;	    /* Quality of reception 0--5 for unit. */
	/* We may also use the values -1 or 6 internally. */
	u_long quality_stamp; /* Next time to reset quality average. */

	u_long next_resync; /* Next resync time (s) compared to current_time. */
	int resyncing;	    /* Resync in progress if true. */

	/* In the outgoing queue, cmdqueue[0] is next to be sent. */
	char cmdqueue[CMDQUEUELEN+1]; /* Queue of outgoing commands + \0. */

	u_long saved_flags; /* Saved fudge flags. */
};

#ifdef ARCRON_LEAPSECOND_KEEN
/* The flag `possible_leap' is set non-zero when any MSF unit
       thinks a leap-second may have happened.

       Set whenever we receive a valid time sample in the first hour of
       the first day of the first/seventh months.

       Outside the special hour this value is unconditionally set
       to zero by the receive routine.

       On finding itself in this timeslot, as long as the value is
       non-negative, the receive routine sets it to a positive value to
       indicate a resync to MSF should be performed.

       In the poll routine, if this value is positive and we are not
       already resyncing (eg from a sync that started just before
       midnight), start resyncing and set this value negative to
       indicate that a leap-triggered resync has been started.  Having
       set this negative prevents the receive routine setting it
       positive and thus prevents multiple resyncs during the witching
       hour.
     */
static int possible_leap = 0;       /* No resync required by default. */
#endif

#if 0
static void dummy_event_handler (struct peer *);
static void   arc_event_handler (struct peer *);
#endif /* 0 */

#define QUALITY_UNKNOWN	    -1 /* Indicates unknown clock quality. */
#define MIN_CLOCK_QUALITY    0 /* Min quality clock will return. */
#define MIN_CLOCK_QUALITY_OK 3 /* Min quality for OK reception. */
#define MAX_CLOCK_QUALITY    5 /* Max quality clock will return. */

/*
 * Function prototypes
 */
static	int	arc_start	(int, struct peer *);
static	void	arc_shutdown	(int, struct peer *);
static	void	arc_receive	(struct recvbuf *);
static	void	arc_poll	(int, struct peer *);

/*
 * Transfer vector
 */
struct  refclock refclock_arc = {
	arc_start,		/* start up driver */
	arc_shutdown,		/* shut down driver */
	arc_poll,		/* transmit poll message */
	noentry,		/* not used (old arc_control) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old arc_buginfo) */
	NOFLAGS			/* not used */
};

/* Queue us up for the next tick. */
#define ENQUEUE(up) \
	do { \
	     peer->nextaction = current_time + QUEUETICK; \
	} while(0)

/* Placeholder event handler---does nothing safely---soaks up loose tick. */
static void
dummy_event_handler(
	struct peer *peer
	)
{
#ifdef DEBUG
	if(debug) { printf("arc: dummy_event_handler() called.\n"); }
#endif
}

/*
Normal event handler.

Take first character off queue and send to clock if not a null.

Shift characters down and put a null on the end.

We assume that there is no parallelism so no race condition, but even
if there is nothing bad will happen except that we might send some bad
data to the clock once in a while.
*/
static void
arc_event_handler(
	struct peer *peer
	)
{
	struct refclockproc *pp = peer->procptr;
	register struct arcunit *up = pp->unitptr;
	int i;
	char c;
#ifdef DEBUG
	if(debug > 2) { printf("arc: arc_event_handler() called.\n"); }
#endif

	c = up->cmdqueue[0];       /* Next char to be sent. */
	/* Shift down characters, shifting trailing \0 in at end. */
	for(i = 0; i < CMDQUEUELEN; ++i)
	{ up->cmdqueue[i] = up->cmdqueue[i+1]; }

	/* Don't send '\0' characters. */
	if(c != '\0') {
		if(write(pp->io.fd, &c, 1) != 1) {
			msyslog(LOG_NOTICE, "ARCRON: write to fd %d failed", pp->io.fd);
		}
#ifdef DEBUG
		else if(debug) { printf("arc: sent `%2.2x', fd %d.\n", c, pp->io.fd); }
#endif
	}

	ENQUEUE(up);
}

/*
 * arc_start - open the devices and initialize data for processing
 */
static int
arc_start(
	int unit,
	struct peer *peer
	)
{
	register struct arcunit *up;
	struct refclockproc *pp;
	int temp_fd;
	int fd;
	char device[20];
#ifdef HAVE_TERMIOS
	struct termios arg;
#endif

	msyslog(LOG_NOTICE, "MSF_ARCRON %s: opening unit %d",
		arc_version, unit);
	DPRINTF(1, ("arc: %s: attempt to open unit %d.\n", arc_version,
		unit));

	/*
	 * Open serial port. Use CLK line discipline, if available.
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
	temp_fd = refclock_open(device, SPEED, LDISC_CLK);
	if (temp_fd <= 0)
		return 0;
	DPRINTF(1, ("arc: unit %d using tty_open().\n", unit));
	fd = tty_open(device, OPEN_FLAGS, 0777);
	if (fd < 0) {
		msyslog(LOG_ERR, "MSF_ARCRON(%d): failed second open(%s, 0777): %m.\n",
			unit, device);
		close(temp_fd);
		return 0;
	}
	close(temp_fd);
	temp_fd = -1;

#ifndef SYS_WINNT
	fcntl(fd, F_SETFL, 0); /* clear the descriptor flags */
#endif
	DPRINTF(1, ("arc: opened RS232 port with file descriptor %d.\n", fd));

#ifdef HAVE_TERMIOS

	if (tcgetattr(fd, &arg) < 0) {
		msyslog(LOG_ERR, "MSF_ARCRON(%d): tcgetattr(%s): %m.\n",
			unit, device);
		close(fd);
		return 0;
	}

	arg.c_iflag = IGNBRK | ISTRIP;
	arg.c_oflag = 0;
	arg.c_cflag = B300 | CS8 | CREAD | CLOCAL | CSTOPB;
	arg.c_lflag = 0;
	arg.c_cc[VMIN] = 1;
	arg.c_cc[VTIME] = 0;

	if (tcsetattr(fd, TCSANOW, &arg) < 0) {
		msyslog(LOG_ERR, "MSF_ARCRON(%d): tcsetattr(%s): %m.\n",
			unit, device);
		close(fd);
		return 0;
	}

#else

	msyslog(LOG_ERR, "ARCRON: termios required by this driver");
	(void)close(fd);

	return 0;

#endif

	/* Set structure to all zeros... */
	up = emalloc_zero(sizeof(*up));
	pp = peer->procptr;
	pp->io.clock_recv = arc_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		pp->io.fd = -1;
		free(up); 
		return(0); 
	}
	pp->unitptr = up;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	peer->stratum = 2;              /* Default to stratum 2 not 0. */
	pp->clockdesc = DESCRIPTION;
	if (peer->MODE > 3) {
		msyslog(LOG_NOTICE, "ARCRON: Invalid mode %d", peer->MODE);
		return 0;
	}
#ifdef DEBUG
	if(debug) { printf("arc: mode = %d.\n", peer->MODE); }
#endif
	switch (peer->MODE) {
	    case 1:
		memcpy((char *)&pp->refid, REFID_MSF, 4);
		break;
	    case 2:
		memcpy((char *)&pp->refid, REFID_DCF77, 4);
		break;
	    case 3:
		memcpy((char *)&pp->refid, REFID_WWVB, 4);
		break;
	    default:
		memcpy((char *)&pp->refid, REFID, 4);
		break;
	}
	/* Spread out resyncs so that they should remain separated. */
	up->next_resync = current_time + INITIAL_RESYNC_DELAY + (67*unit)%1009;

#if 0 /* Not needed because of zeroing of arcunit structure... */
	up->resyncing = 0;              /* Not resyncing yet. */
	up->saved_flags = 0;            /* Default is all flags off. */
	/* Clear send buffer out... */
	{
		int i;
		for(i = CMDQUEUELEN; i >= 0; --i) { up->cmdqueue[i] = '\0'; }
	}
#endif

#ifdef ARCRON_KEEN
	up->quality = QUALITY_UNKNOWN;  /* Trust the clock immediately. */
#else
	up->quality = MIN_CLOCK_QUALITY;/* Don't trust the clock yet. */
#endif

	peer->action = arc_event_handler;

	ENQUEUE(up);

	return(1);
}


/*
 * arc_shutdown - shut down the clock
 */
static void
arc_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct arcunit *up;
	struct refclockproc *pp;

	peer->action = dummy_event_handler;

	pp = peer->procptr;
	up = pp->unitptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}

/*
Compute space left in output buffer.
*/
static int
space_left(
	register struct arcunit *up
	)
{
	int spaceleft;

	/* Compute space left in buffer after any pending output. */
	for(spaceleft = 0; spaceleft < CMDQUEUELEN; ++spaceleft)
	{ if(up->cmdqueue[CMDQUEUELEN - 1 - spaceleft] != '\0') { break; } }
	return(spaceleft);
}

/*
Send command by copying into command buffer as far forward as possible,
after any pending output.

Indicate an error by returning 0 if there is not space for the command.
*/
static int
send_slow(
	register struct arcunit *up,
	int fd,
	const char *s
	)
{
	int sl = strlen(s);
	int spaceleft = space_left(up);

#ifdef DEBUG
	if(debug > 1) { printf("arc: spaceleft = %d.\n", spaceleft); }
#endif
	if(spaceleft < sl) { /* Should not normally happen... */
#ifdef DEBUG
		msyslog(LOG_NOTICE, "ARCRON: send-buffer overrun (%d/%d)",
			sl, spaceleft);
#endif
		return(0);			/* FAILED! */
	}

	/* Copy in the command to be sent. */
	while(*s && spaceleft > 0) { up->cmdqueue[CMDQUEUELEN - spaceleft--] = *s++; }

	return(1);
}


static int
get2(char *p, int *val)
{
  if (!isdigit((int)p[0]) || !isdigit((int)p[1])) return 0;
  *val = (p[0] - '0') * 10 + p[1] - '0';
  return 1;
}

static int
get1(char *p, int *val)
{
  if (!isdigit((int)p[0])) return 0;
  *val = p[0] - '0';
  return 1;
}

/* Macro indicating action we will take for different quality values. */
#define quality_action(q) \
(((q) == QUALITY_UNKNOWN) ?         "UNKNOWN, will use clock anyway" : \
 (((q) < MIN_CLOCK_QUALITY_OK) ? "TOO POOR, will not use clock" : \
  "OK, will use clock"))

/*
 * arc_receive - receive data from the serial interface
 */
static void
arc_receive(
	struct recvbuf *rbufp
	)
{
	register struct arcunit *up;
	struct refclockproc *pp;
	struct peer *peer;
	char c;
	int i, n, wday, month, flags, status;
	int arc_last_offset;
	static int quality_average = 0;
	static int quality_sum = 0;
	static int quality_polls = 0;

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = pp->unitptr;


	/*
	  If the command buffer is empty, and we are resyncing, insert a
	  g\r quality request into it to poll for signal quality again.
	*/
	if((up->resyncing) && (space_left(up) == CMDQUEUELEN)) {
#ifdef DEBUG
		if(debug > 1) { printf("arc: inserting signal-quality poll.\n"); }
#endif
		send_slow(up, pp->io.fd, "g\r");
	}

	/*
	  The `arc_last_offset' is the offset in lastcode[] of the last byte
	  received, and which we assume actually received the input
	  timestamp.

	  (When we get round to using tty_clk and it is available, we
	  assume that we will receive the whole timecode with the
	  trailing \r, and that that \r will be timestamped.  But this
	  assumption also works if receive the characters one-by-one.)
	*/
	arc_last_offset = pp->lencode+rbufp->recv_length - 1;

	/*
	  We catch a timestamp iff:

	  * The command code is `o' for a timestamp.

	  * If ARCRON_MULTIPLE_SAMPLES is undefined then we must have
	  exactly char in the buffer (the command code) so that we
	  only sample the first character of the timecode as our
	  `on-time' character.

	  * The first character in the buffer is not the echoed `\r'
	  from the `o` command (so if we are to timestamp an `\r' it
	  must not be first in the receive buffer with lencode==1.
	  (Even if we had other characters following it, we probably
	  would have a premature timestamp on the '\r'.)

	  * We have received at least one character (I cannot imagine
	  how it could be otherwise, but anyway...).
	*/
	c = rbufp->recv_buffer[0];
	if((pp->a_lastcode[0] == 'o') &&
#ifndef ARCRON_MULTIPLE_SAMPLES
	   (pp->lencode == 1) &&
#endif
	   ((pp->lencode != 1) || (c != '\r')) &&
	   (arc_last_offset >= 1)) {
		/* Note that the timestamp should be corrected if >1 char rcvd. */
		l_fp timestamp;
		timestamp = rbufp->recv_time;
#ifdef DEBUG
		if(debug) { /* Show \r as `R', other non-printing char as `?'. */
			printf("arc: stamp -->%c<-- (%d chars rcvd)\n",
			       ((c == '\r') ? 'R' : (isgraph((int)c) ? c : '?')),
			       rbufp->recv_length);
		}
#endif

		/*
		  Now correct timestamp by offset of last byte received---we
		  subtract from the receive time the delay implied by the
		  extra characters received.

		  Reject the input if the resulting code is too long, but
		  allow for the trailing \r, normally not used but a good
		  handle for tty_clk or somesuch kernel timestamper.
		*/
		if(arc_last_offset > LENARC) {
#ifdef DEBUG
			if(debug) {
				printf("arc: input code too long (%d cf %d); rejected.\n",
				       arc_last_offset, LENARC);
			}
#endif
			pp->lencode = 0;
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		}

		L_SUBUF(×tamp, charoffsets[arc_last_offset]);
#ifdef DEBUG
		if(debug > 1) {
			printf(
				"arc: %s%d char(s) rcvd, the last for lastcode[%d]; -%sms offset applied.\n",
				((rbufp->recv_length > 1) ? "*** " : ""),
				rbufp->recv_length,
				arc_last_offset,
				mfptoms((unsigned long)0,
					charoffsets[arc_last_offset],
					1));
		}
#endif

#ifdef ARCRON_MULTIPLE_SAMPLES
		/*
		  If taking multiple samples, capture the current adjusted
		  sample iff:

		  * No timestamp has yet been captured (it is zero), OR

		  * This adjusted timestamp is earlier than the one already
		  captured, on the grounds that this one suffered less
		  delay in being delivered to us and is more accurate.

		*/
		if(L_ISZERO(&(up->lastrec)) ||
		   L_ISGEQ(&(up->lastrec), ×tamp))
#endif
		{
#ifdef DEBUG
			if(debug > 1) {
				printf("arc: system timestamp captured.\n");
#ifdef ARCRON_MULTIPLE_SAMPLES
				if(!L_ISZERO(&(up->lastrec))) {
					l_fp diff;
					diff = up->lastrec;
					L_SUB(&diff, ×tamp);
					printf("arc: adjusted timestamp by -%sms.\n",
					       mfptoms(diff.l_i, diff.l_f, 3));
				}
#endif
			}
#endif
			up->lastrec = timestamp;
		}

	}

	/* Just in case we still have lots of rubbish in the buffer... */
	/* ...and to avoid the same timestamp being reused by mistake, */
	/* eg on receipt of the \r coming in on its own after the      */
	/* timecode.						       */
	if(pp->lencode >= LENARC) {
#ifdef DEBUG
		if(debug && (rbufp->recv_buffer[0] != '\r'))
		{ printf("arc: rubbish in pp->a_lastcode[].\n"); }
#endif
		pp->lencode = 0;
		return;
	}

	/* Append input to code buffer, avoiding overflow. */
	for(i = 0; i < rbufp->recv_length; i++) {
		if(pp->lencode >= LENARC) { break; } /* Avoid overflow... */
		c = rbufp->recv_buffer[i];

		/* Drop trailing '\r's and drop `h' command echo totally. */
		if(c != '\r' && c != 'h') { pp->a_lastcode[pp->lencode++] = c; }

		/*
		  If we've just put an `o' in the lastcode[0], clear the
		  timestamp in anticipation of a timecode arriving soon.

		  We would expect to get to process this before any of the
		  timecode arrives.
		*/
		if((c == 'o') && (pp->lencode == 1)) {
			L_CLR(&(up->lastrec));
#ifdef DEBUG
			if(debug > 1) { printf("arc: clearing timestamp.\n"); }
#endif
		}
	}
	if (pp->lencode == 0) return;

	/* Handle a quality message. */
	if(pp->a_lastcode[0] == 'g') {
		int r, q;

		if(pp->lencode < 3) { return; } /* Need more data... */
		r = (pp->a_lastcode[1] & 0x7f); /* Strip parity. */
		q = (pp->a_lastcode[2] & 0x7f); /* Strip parity. */
		if(((q & 0x70) != 0x30) || ((q & 0xf) > MAX_CLOCK_QUALITY) ||
		   ((r & 0x70) != 0x30)) {
			/* Badly formatted response. */
#ifdef DEBUG
			if(debug) { printf("arc: bad `g' response %2x %2x.\n", r, q); }
#endif
			return;
		}
		if(r == '3') { /* Only use quality value whilst sync in progress. */
			if (up->quality_stamp < current_time) {
				struct calendar cal;
				l_fp new_stamp;
			
				get_systime (&new_stamp);
				caljulian (new_stamp.l_ui, &cal);
				up->quality_stamp = 
					current_time + 60 - cal.second + 5;
				quality_sum = 0;
				quality_polls = 0;
			}
			quality_sum += (q & 0xf);
			quality_polls++;
			quality_average = (quality_sum / quality_polls);
#ifdef DEBUG
			if(debug) { printf("arc: signal quality %d (%d).\n", quality_average, (q & 0xf)); }
#endif
		} else if( /* (r == '2') && */ up->resyncing) {
			up->quality = quality_average;
#ifdef DEBUG
			if(debug)
			{
				printf("arc: sync finished, signal quality %d: %s\n",
				       up->quality,
				       quality_action(up->quality));
			}
#endif
			msyslog(LOG_NOTICE,
				"ARCRON: sync finished, signal quality %d: %s",
				up->quality,
				quality_action(up->quality));
			up->resyncing = 0; /* Resync is over. */
			quality_average = 0;
			quality_sum = 0;
			quality_polls = 0;

#ifdef ARCRON_KEEN
			/* Clock quality dubious; resync earlier than usual. */
			if((up->quality == QUALITY_UNKNOWN) ||
			   (up->quality < MIN_CLOCK_QUALITY_OK))
			{ up->next_resync = current_time + RETRY_RESYNC_TIME; }
#endif
		}
		pp->lencode = 0;
		return;
	}

	/* Stop now if this is not a timecode message. */
	if(pp->a_lastcode[0] != 'o') {
		pp->lencode = 0;
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	/* If we don't have enough data, wait for more... */
	if(pp->lencode < LENARC) { return; }


	/* WE HAVE NOW COLLECTED ONE TIMESTAMP (phew)... */
#ifdef DEBUG
	if(debug > 1) { printf("arc: NOW HAVE TIMESTAMP...\n"); }
#endif

	/* But check that we actually captured a system timestamp on it. */
	if(L_ISZERO(&(up->lastrec))) {
#ifdef DEBUG
		if(debug) { printf("arc: FAILED TO GET SYSTEM TIMESTAMP\n"); }
#endif
		pp->lencode = 0;
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}
	/*
	  Append a mark of the clock's received signal quality for the
	  benefit of Derek Mulcahy's Tcl/Tk utility (we map the `unknown'
	  quality value to `6' for his s/w) and terminate the string for
	  sure.  This should not go off the buffer end.
	*/
	pp->a_lastcode[pp->lencode] = ((up->quality == QUALITY_UNKNOWN) ?
				       '6' : ('0' + up->quality));
	pp->a_lastcode[pp->lencode + 1] = '\0'; /* Terminate for printf(). */

#ifdef PRE_NTP420
	/* We don't use the micro-/milli- second part... */
	pp->usec = 0;
	pp->msec = 0;
#else
	/* We don't use the nano-second part... */
	pp->nsec = 0;
#endif	
	/* Validate format and numbers. */
	if (pp->a_lastcode[0] != 'o'
		|| !get2(pp->a_lastcode + 1, &pp->hour)
		|| !get2(pp->a_lastcode + 3, &pp->minute)
		|| !get2(pp->a_lastcode + 5, &pp->second)
		|| !get1(pp->a_lastcode + 7, &wday)
		|| !get2(pp->a_lastcode + 8, &pp->day)
		|| !get2(pp->a_lastcode + 10, &month)
		|| !get2(pp->a_lastcode + 12, &pp->year)) {
#ifdef DEBUG
		/* Would expect to have caught major problems already... */
		if(debug) { printf("arc: badly formatted data.\n"); }
#endif
		pp->lencode = 0;
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}
	flags = pp->a_lastcode[14];
	status = pp->a_lastcode[15];
#ifdef DEBUG
	if(debug) { printf("arc: status 0x%.2x flags 0x%.2x\n", flags, status); }
#endif
	n = 9;

	/*
	  Validate received values at least enough to prevent internal
	  array-bounds problems, etc.
	*/
	if((pp->hour < 0) || (pp->hour > 23) ||
	   (pp->minute < 0) || (pp->minute > 59) ||
	   (pp->second < 0) || (pp->second > 60) /*Allow for leap seconds.*/ ||
	   (wday < 1) || (wday > 7) ||
	   (pp->day < 1) || (pp->day > 31) ||
	   (month < 1) || (month > 12) ||
	   (pp->year < 0) || (pp->year > 99)) {
		/* Data out of range. */
		pp->lencode = 0;
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}


	if(peer->MODE == 0) { /* compatiblity to original version */
		int bst = flags;
		/* Check that BST/UTC bits are the complement of one another. */
		if(!(bst & 2) == !(bst & 4)) {
			pp->lencode = 0;
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		}
	}
	if(status & 0x8) { msyslog(LOG_NOTICE, "ARCRON: battery low"); }

	/* Year-2000 alert! */
	/* Attempt to wrap 2-digit date into sensible window. */
	if(pp->year < YEAR_PIVOT) { pp->year += 100; }		/* Y2KFixes */
	pp->year += 1900;	/* use full four-digit year */	/* Y2KFixes */
	/*
	  Attempt to do the right thing by screaming that the code will
	  soon break when we get to the end of its useful life.  What a
	  hero I am...  PLEASE FIX LEAP-YEAR AND WRAP CODE IN 209X!
	*/
	if(pp->year >= YEAR_PIVOT+2000-2 ) {  			/* Y2KFixes */
		/*This should get attention B^> */
		msyslog(LOG_NOTICE,
			"ARCRON: fix me!  EITHER YOUR DATE IS BADLY WRONG or else I will break soon!");
	}
#ifdef DEBUG
	if(debug) {
		printf("arc: n=%d %02d:%02d:%02d %02d/%02d/%04d %1d %1d\n",
		       n,
		       pp->hour, pp->minute, pp->second,
		       pp->day, month, pp->year, flags, status);
	}
#endif

	/*
	  The status value tested for is not strictly supported by the
	  clock spec since the value of bit 2 (0x4) is claimed to be
	  undefined for MSF, yet does seem to indicate if the last resync
	  was successful or not.
	*/
	pp->leap = LEAP_NOWARNING;
	status &= 0x7;
	if(status == 0x3) {
		if(status != up->status)
		{ msyslog(LOG_NOTICE, "ARCRON: signal acquired"); }
	} else {
		if(status != up->status) {
			msyslog(LOG_NOTICE, "ARCRON: signal lost");
			pp->leap = LEAP_NOTINSYNC; /* MSF clock is free-running. */
			up->status = status;
			pp->lencode = 0;
			refclock_report(peer, CEVNT_FAULT);
			return;
		}
	}
	up->status = status;

	if (peer->MODE == 0) { /* compatiblity to original version */
		int bst = flags;

		pp->day += moff[month - 1];

		if(isleap_4(pp->year) && month > 2) { pp->day++; }/* Y2KFixes */

		/* Convert to UTC if required */
		if(bst & 2) {
			pp->hour--;
			if (pp->hour < 0) {
				pp->hour = 23;
				pp->day--;
				/* If we try to wrap round the year
				 * (BST on 1st Jan), reject.*/
				if(pp->day < 0) {
					pp->lencode = 0;
					refclock_report(peer, CEVNT_BADTIME);
					return;
				}
			}
		}
	}

	if(peer->MODE > 0) {
		if(pp->sloppyclockflag & CLK_FLAG1) {
			struct tm  local;
			struct tm *gmtp;
			time_t	   unixtime;

			/*
			 * Convert to GMT for sites that distribute localtime.
			 * This means we have to do Y2K conversion on the
			 * 2-digit year; otherwise, we get the time wrong.
			 */

			memset(&local, 0, sizeof(local));

			local.tm_year  = pp->year-1900;
			local.tm_mon   = month-1;
			local.tm_mday  = pp->day;
			local.tm_hour  = pp->hour;
			local.tm_min   = pp->minute;
			local.tm_sec   = pp->second;
			switch (peer->MODE) {
			    case 1:
				local.tm_isdst = (flags & 2);
				break;
			    case 2:
				local.tm_isdst = (flags & 2);
				break;
			    case 3:
				switch (flags & 3) {
				    case 0: /* It is unclear exactly when the 
					       Arcron changes from DST->ST and 
					       ST->DST. Testing has shown this
					       to be irregular. For the time 
					       being, let the OS decide. */
					local.tm_isdst = 0;
#ifdef DEBUG
					if (debug)
					    printf ("arc: DST = 00 (0)\n"); 
#endif
					break;
				    case 1: /* dst->st time */
					local.tm_isdst = -1;
#ifdef DEBUG
					if (debug) 
					    printf ("arc: DST = 01 (1)\n"); 
#endif
					break;
				    case 2: /* st->dst time */
					local.tm_isdst = -1;
#ifdef DEBUG
					if (debug) 
					    printf ("arc: DST = 10 (2)\n"); 
#endif
					break;
				    case 3: /* dst time */
				        local.tm_isdst = 1;
#ifdef DEBUG
					if (debug) 
					    printf ("arc: DST = 11 (3)\n"); 
#endif
					break;
				}
				break;
			    default:
				msyslog(LOG_NOTICE, "ARCRON: Invalid mode %d",
					peer->MODE);
				return;
				break;
			}
			unixtime = mktime (&local);
			if ((gmtp = gmtime (&unixtime)) == NULL)
			{
				pp->lencode = 0;
				refclock_report (peer, CEVNT_FAULT);
				return;
			}
			pp->year = gmtp->tm_year+1900;
			month = gmtp->tm_mon+1;
			pp->day = ymd2yd(pp->year,month,gmtp->tm_mday);
			/* pp->day = gmtp->tm_yday; */
			pp->hour = gmtp->tm_hour;
			pp->minute = gmtp->tm_min;
			pp->second = gmtp->tm_sec;
#ifdef DEBUG
			if (debug)
			{
				printf ("arc: time is %04d/%02d/%02d %02d:%02d:%02d UTC\n",
					pp->year,month,gmtp->tm_mday,pp->hour,pp->minute,
					pp->second);
			}
#endif
		} else 
		{
			/*
			* For more rational sites distributing UTC
			*/
			pp->day    = ymd2yd(pp->year,month,pp->day);
		}
	}

	if (peer->MODE == 0) { /* compatiblity to original version */
				/* If clock signal quality is 
				 * unknown, revert to default PRECISION...*/
		if(up->quality == QUALITY_UNKNOWN) { 
			peer->precision = PRECISION; 
		} else { /* ...else improve precision if flag3 is set... */
			peer->precision = ((pp->sloppyclockflag & CLK_FLAG3) ?
					   HIGHPRECISION : PRECISION);
		}
	} else {
		if ((status == 0x3) && (pp->sloppyclockflag & CLK_FLAG2)) {
			peer->precision = ((pp->sloppyclockflag & CLK_FLAG3) ?
					   HIGHPRECISION : PRECISION);
		} else if (up->quality == QUALITY_UNKNOWN) {
			peer->precision = PRECISION;
		} else {
			peer->precision = ((pp->sloppyclockflag & CLK_FLAG3) ?
					   HIGHPRECISION : PRECISION);
		}
	}

	/* Notice and log any change (eg from initial defaults) for flags. */
	if(up->saved_flags != pp->sloppyclockflag) {
#ifdef DEBUG
		msyslog(LOG_NOTICE, "ARCRON: flags enabled: %s%s%s%s",
			((pp->sloppyclockflag & CLK_FLAG1) ? "1" : "."),
			((pp->sloppyclockflag & CLK_FLAG2) ? "2" : "."),
			((pp->sloppyclockflag & CLK_FLAG3) ? "3" : "."),
			((pp->sloppyclockflag & CLK_FLAG4) ? "4" : "."));
		/* Note effects of flags changing... */
		if(debug) {
			printf("arc: PRECISION = %d.\n", peer->precision);
		}
#endif
		up->saved_flags = pp->sloppyclockflag;
	}

	/* Note time of last believable timestamp. */
	pp->lastrec = up->lastrec;

#ifdef ARCRON_LEAPSECOND_KEEN
	/* Find out if a leap-second might just have happened...
	   (ie is this the first hour of the first day of Jan or Jul?)
	*/
	if((pp->hour == 0) &&
	   (pp->day == 1) &&
	   ((month == 1) || (month == 7))) {
		if(possible_leap >= 0) {
			/* A leap may have happened, and no resync has started yet...*/
			possible_leap = 1;
		}
	} else {
		/* Definitely not leap-second territory... */
		possible_leap = 0;
	}
#endif

	if (!refclock_process(pp)) {
		pp->lencode = 0;
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
	refclock_receive(peer);
}


/* request_time() sends a time request to the clock with given peer. */
/* This automatically reports a fault if necessary. */
/* No data should be sent after this until arc_poll() returns. */
static  void    request_time    (int, struct peer *);
static void
request_time(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp = peer->procptr;
	register struct arcunit *up = pp->unitptr;
#ifdef DEBUG
	if(debug) { printf("arc: unit %d: requesting time.\n", unit); }
#endif
	if (!send_slow(up, pp->io.fd, "o\r")) {
#ifdef DEBUG
		if (debug) {
			printf("arc: unit %d: problem sending", unit);
		}
#endif
		pp->lencode = 0;
		refclock_report(peer, CEVNT_FAULT);
		return;
	}
	pp->polls++;
}

/*
 * arc_poll - called by the transmit procedure
 */
static void
arc_poll(
	int unit,
	struct peer *peer
	)
{
	register struct arcunit *up;
	struct refclockproc *pp;
	int resync_needed;              /* Should we start a resync? */

	pp = peer->procptr;
	up = pp->unitptr;
#if 0
	pp->lencode = 0;
	memset(pp->a_lastcode, 0, sizeof(pp->a_lastcode));
#endif

#if 0
	/* Flush input. */
	tcflush(pp->io.fd, TCIFLUSH);
#endif

	/* Resync if our next scheduled resync time is here or has passed. */
	resync_needed = ( !(pp->sloppyclockflag & CLK_FLAG2) &&
			  (up->next_resync <= current_time) );

#ifdef ARCRON_LEAPSECOND_KEEN
	/*
	  Try to catch a potential leap-second insertion or deletion quickly.

	  In addition to the normal NTP fun of clocks that don't report
	  leap-seconds spooking their hosts, this clock does not even
	  sample the radio sugnal the whole time, so may miss a
	  leap-second insertion or deletion for up to a whole sample
	  time.

	  To try to minimise this effect, if in the first few minutes of
	  the day immediately following a leap-second-insertion point
	  (ie in the first hour of the first day of the first and sixth
	  months), and if the last resync was in the previous day, and a
	  resync is not already in progress, resync the clock
	  immediately.

	*/
	if((possible_leap > 0) &&       /* Must be 00:XX 01/0{1,7}/XXXX. */
	   (!up->resyncing)) {          /* No resync in progress yet. */
		resync_needed = 1;
		possible_leap = -1;          /* Prevent multiple resyncs. */
		msyslog(LOG_NOTICE,"ARCRON: unit %d: checking for leap second",unit);
	}
#endif

	/* Do a resync if required... */
	if(resync_needed) {
		/* First, reset quality value to `unknown' so we can detect */
		/* when a quality message has been responded to by this     */
		/* being set to some other value.                           */
		up->quality = QUALITY_UNKNOWN;

		/* Note that we are resyncing... */
		up->resyncing = 1;

		/* Now actually send the resync command and an immediate poll. */
#ifdef DEBUG
		if(debug) { printf("arc: sending resync command (h\\r).\n"); }
#endif
		msyslog(LOG_NOTICE, "ARCRON: unit %d: sending resync command", unit);
		send_slow(up, pp->io.fd, "h\r");

		/* Schedule our next resync... */
		up->next_resync = current_time + DEFAULT_RESYNC_TIME;

		/* Drop through to request time if appropriate. */
	}

	/* If clock quality is too poor to trust, indicate a fault. */
	/* If quality is QUALITY_UNKNOWN and ARCRON_KEEN is defined,*/
	/* we'll cross our fingers and just hope that the thing     */
	/* synced so quickly we did not catch it---we'll            */
	/* double-check the clock is OK elsewhere.                  */
	if(
#ifdef ARCRON_KEEN
		(up->quality != QUALITY_UNKNOWN) &&
#else
		(up->quality == QUALITY_UNKNOWN) ||
#endif
		(up->quality < MIN_CLOCK_QUALITY_OK)) {
#ifdef DEBUG
		if(debug) {
			printf("arc: clock quality %d too poor.\n", up->quality);
		}
#endif
		pp->lencode = 0;
		refclock_report(peer, CEVNT_FAULT);
		return;
	}
	/* This is the normal case: request a timestamp. */
	request_time(unit, peer);
}

#else
int refclock_arc_bs;
#endif
ntp-4.2.6p5/ntpd/refclock_mx4200.c0000644000175000017500000012417311332473274015542 0ustar  peterpeter/*
 * This software was developed by the Computer Systems Engineering group
 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66.
 *
 * Copyright (c) 1992 The Regents of the University of California.
 * 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.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Lawrence Berkeley Laboratory.
 * 4. The name of the University may not be used to endorse or promote
 *    products derived from this software without specific prior
 *    written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
 */

/*
 * Modified: Marc Brett    Sept, 1999.
 *
 * 1. Added support for alternate PPS schemes, with code mostly
 *    copied from the Oncore driver (Thanks, Poul-Henning Kamp).
 *    This code runs on SunOS 4.1.3 with ppsclock-1.6a1 and Solaris 7.
 */


#ifdef HAVE_CONFIG_H
# include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_MX4200) && defined(HAVE_PPSAPI)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"

#include 
#include 

#include "mx4200.h"

#ifdef HAVE_SYS_TERMIOS_H
# include 
#endif
#ifdef HAVE_SYS_PPSCLOCK_H
# include 
#endif

#include "ntp_sprintf.h"

#ifndef HAVE_STRUCT_PPSCLOCKEV
struct ppsclockev {
# ifdef HAVE_STRUCT_TIMESPEC
	struct timespec tv;
# else
	struct timeval tv;
# endif
	u_int serial;
};
#endif /* ! HAVE_STRUCT_PPSCLOCKEV */

#ifdef HAVE_PPSAPI
# include "ppsapi_timepps.h"
#endif /* HAVE_PPSAPI */

/*
 * This driver supports the Magnavox Model MX 4200 GPS Receiver
 * adapted to precision timing applications.  It requires the
 * ppsclock line discipline or streams module described in the
 * Line Disciplines and Streams Drivers page. It also requires a
 * gadget box and 1-PPS level converter, such as described in the
 * Pulse-per-second (PPS) Signal Interfacing page.
 *
 * It's likely that other compatible Magnavox receivers such as the
 * MX 4200D, MX 9212, MX 9012R, MX 9112 will be supported by this code.
 */

/*
 * Check this every time you edit the code!
 */
#define YEAR_LAST_MODIFIED 2000

/*
 * GPS Definitions
 */
#define	DEVICE		"/dev/gps%d"	/* device name and unit */
#define	SPEED232	B4800		/* baud */

/*
 * Radio interface parameters
 */
#define	PRECISION	(-18)	/* precision assumed (about 4 us) */
#define	REFID	"GPS\0"		/* reference id */
#define	DESCRIPTION	"Magnavox MX4200 GPS Receiver" /* who we are */
#define	DEFFUDGETIME	0	/* default fudge time (ms) */

#define	SLEEPTIME	32	/* seconds to wait for reconfig to complete */

/*
 * Position Averaging.
 */
#define INTERVAL	1	/* Interval between position measurements (s) */
#define AVGING_TIME	24	/* Number of hours to average */
#define NOT_INITIALIZED	-9999.	/* initial pivot longitude */

/*
 * MX4200 unit control structure.
 */
struct mx4200unit {
	u_int  pollcnt;			/* poll message counter */
	u_int  polled;			/* Hand in a time sample? */
	u_int  lastserial;		/* last pps serial number */
	struct ppsclockev ppsev;	/* PPS control structure */
	double avg_lat;			/* average latitude */
	double avg_lon;			/* average longitude */
	double avg_alt;			/* average height */
	double central_meridian;	/* central meridian */
	double N_fixes;			/* Number of position measurements */
	int    last_leap;		/* leap second warning */
	u_int  moving;			/* mobile platform? */
	u_long sloppyclockflag;		/* fudge flags */
	u_int  known;			/* position known yet? */
	u_long clamp_time;		/* when to stop postion averaging */
	u_long log_time;		/* when to print receiver status */
	pps_handle_t	pps_h;
	pps_params_t	pps_p;
	pps_info_t	pps_i;
};

static char pmvxg[] = "PMVXG";

/* XXX should be somewhere else */
#ifdef __GNUC__
#if __GNUC__ < 2  || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
#ifndef __attribute__
#define __attribute__(args)
#endif /* __attribute__ */
#endif /* __GNUC__ < 2  || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) */
#else
#ifndef __attribute__
#define __attribute__(args)
#endif /* __attribute__ */
#endif /* __GNUC__ */
/* XXX end */

/*
 * Function prototypes
 */
static	int	mx4200_start	(int, struct peer *);
static	void	mx4200_shutdown	(int, struct peer *);
static	void	mx4200_receive	(struct recvbuf *);
static	void	mx4200_poll	(int, struct peer *);

static	char *	mx4200_parse_t	(struct peer *);
static	char *	mx4200_parse_p	(struct peer *);
static	char *	mx4200_parse_s	(struct peer *);
#ifdef QSORT_USES_VOID_P
int	mx4200_cmpl_fp	(const void *, const void *);
#else
int	mx4200_cmpl_fp	(const l_fp *, const l_fp *);
#endif /* not QSORT_USES_VOID_P */
static	int	mx4200_config	(struct peer *);
static	void	mx4200_ref	(struct peer *);
static	void	mx4200_send	(struct peer *, char *, ...)
    __attribute__ ((format (printf, 2, 3)));
static	u_char	mx4200_cksum	(char *, int);
static	int	mx4200_jday	(int, int, int);
static	void	mx4200_debug	(struct peer *, char *, ...)
    __attribute__ ((format (printf, 2, 3)));
static	int	mx4200_pps	(struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_mx4200 = {
	mx4200_start,		/* start up driver */
	mx4200_shutdown,	/* shut down driver */
	mx4200_poll,		/* transmit poll message */
	noentry,		/* not used (old mx4200_control) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old mx4200_buginfo) */
	NOFLAGS			/* not used */
};



/*
 * mx4200_start - open the devices and initialize data for processing
 */
static int
mx4200_start(
	int unit,
	struct peer *peer
	)
{
	register struct mx4200unit *up;
	struct refclockproc *pp;
	int fd;
	char gpsdev[20];

	/*
	 * Open serial port
	 */
	snprintf(gpsdev, sizeof(gpsdev), DEVICE, unit);
	if (!(fd = refclock_open(gpsdev, SPEED232, LDISC_PPS))) {
	    return (0);
	}

	/*
	 * Allocate unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp = peer->procptr;
	pp->io.clock_recv = mx4200_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		pp->io.fd = -1;
		free(up);
		return (0);
	}
	pp->unitptr = (caddr_t)up;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);

	/* Ensure the receiver is properly configured */
	return mx4200_config(peer);
}


/*
 * mx4200_shutdown - shut down the clock
 */
static void
mx4200_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct mx4200unit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct mx4200unit *)pp->unitptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}


/*
 * mx4200_config - Configure the receiver
 */
static int
mx4200_config(
	struct peer *peer
	)
{
	char tr_mode;
	int add_mode;
	register struct mx4200unit *up;
	struct refclockproc *pp;
	int mode;

	pp = peer->procptr;
	up = (struct mx4200unit *)pp->unitptr;

	/*
	 * Initialize the unit variables
	 *
	 * STRANGE BEHAVIOUR WARNING: The fudge flags are not available
	 * at the time mx4200_start is called.  These are set later,
	 * and so the code must be prepared to handle changing flags.
	 */
	up->sloppyclockflag = pp->sloppyclockflag;
	if (pp->sloppyclockflag & CLK_FLAG2) {
		up->moving   = 1;	/* Receiver on mobile platform */
		msyslog(LOG_DEBUG, "mx4200_config: mobile platform");
	} else {
		up->moving   = 0;	/* Static Installation */
	}
	up->pollcnt     	= 2;
	up->polled      	= 0;
	up->known       	= 0;
	up->avg_lat     	= 0.0;
	up->avg_lon     	= 0.0;
	up->avg_alt     	= 0.0;
	up->central_meridian	= NOT_INITIALIZED;
	up->N_fixes    		= 0.0;
	up->last_leap   	= 0;	/* LEAP_NOWARNING */
	up->clamp_time  	= current_time + (AVGING_TIME * 60 * 60);
	up->log_time    	= current_time + SLEEPTIME;

	if (time_pps_create(pp->io.fd, &up->pps_h) < 0) {
		perror("time_pps_create");
		msyslog(LOG_ERR,
			"mx4200_config: time_pps_create failed: %m");
		return (0);
	}
	if (time_pps_getcap(up->pps_h, &mode) < 0) {
		msyslog(LOG_ERR,
			"mx4200_config: time_pps_getcap failed: %m");
		return (0);
	}

	if (time_pps_getparams(up->pps_h, &up->pps_p) < 0) {
		msyslog(LOG_ERR,
			"mx4200_config: time_pps_getparams failed: %m");
		return (0);
	}

	/* nb. only turn things on, if someone else has turned something
	 *      on before we get here, leave it alone!
	 */

	up->pps_p.mode = PPS_CAPTUREASSERT | PPS_TSFMT_TSPEC;
	up->pps_p.mode &= mode;		/* only set what is legal */

	if (time_pps_setparams(up->pps_h, &up->pps_p) < 0) {
		perror("time_pps_setparams");
		msyslog(LOG_ERR,
			"mx4200_config: time_pps_setparams failed: %m");
		exit(1);
	}

	if (time_pps_kcbind(up->pps_h, PPS_KC_HARDPPS, PPS_CAPTUREASSERT,
			PPS_TSFMT_TSPEC) < 0) {
		perror("time_pps_kcbind");
		msyslog(LOG_ERR,
			"mx4200_config: time_pps_kcbind failed: %m");
		exit(1);
	}


	/*
	 * "007" Control Port Configuration
	 * Zero the output list (do it twice to flush possible junk)
	 */
	mx4200_send(peer, "%s,%03d,,%d,,,,,,", pmvxg,
	    PMVXG_S_PORTCONF,
	    /* control port output block Label */
	    1);		/* clear current output control list (1=yes) */
	/* add/delete sentences from list */
	/* must be null */
	/* sentence output rate (sec) */
	/* precision for position output */
	/* nmea version for cga & gll output */
	/* pass-through control */
	mx4200_send(peer, "%s,%03d,,%d,,,,,,", pmvxg,
	    PMVXG_S_PORTCONF, 1);

	/*
	 * Request software configuration so we can syslog the firmware version
	 */
	mx4200_send(peer, "%s,%03d", "CDGPQ", PMVXG_D_SOFTCONF);

	/*
	 * "001" Initialization/Mode Control, Part A
	 * Where ARE we?
	 */
	mx4200_send(peer, "%s,%03d,,,,,,,,,,", pmvxg,
	    PMVXG_S_INITMODEA);
	/* day of month */
	/* month of year */
	/* year */
	/* gmt */
	/* latitude   DDMM.MMMM */
	/* north/south */
	/* longitude DDDMM.MMMM */
	/* east/west */
	/* height */
	/* Altitude Reference 1=MSL */

	/*
	 * "001" Initialization/Mode Control, Part B
	 * Start off in 2d/3d coast mode, holding altitude to last known
	 * value if only 3 satellites available.
	 */
	mx4200_send(peer, "%s,%03d,%d,,%.1f,%.1f,%d,%d,%d,%c,%d",
	    pmvxg, PMVXG_S_INITMODEB,
	    3,		/* 2d/3d coast */
	    /* reserved */
	    0.1,	/* hor accel fact as per Steve (m/s**2) */
	    0.1,	/* ver accel fact as per Steve (m/s**2) */
	    10,		/* vdop */
	    10,		/* hdop limit as per Steve */
	    5,		/* elevation limit as per Steve (deg) */
	    'U',	/* time output mode (UTC) */
	    0);		/* local time offset from gmt (HHHMM) */

	/*
	 * "023" Time Recovery Configuration
	 * Get UTC time from a stationary receiver.
	 * (Set field 1 'D' == dynamic if we are on a moving platform).
	 * (Set field 1 'S' == static  if we are not moving).
	 * (Set field 1 'K' == known position if we can initialize lat/lon/alt).
	 */

	if (pp->sloppyclockflag & CLK_FLAG2)
		up->moving   = 1;	/* Receiver on mobile platform */
	else
		up->moving   = 0;	/* Static Installation */

	up->pollcnt  = 2;
	if (up->moving) {
		/* dynamic: solve for pos, alt, time, while moving */
		tr_mode = 'D';
	} else {
		/* static: solve for pos, alt, time, while stationary */
		tr_mode = 'S';
	}
	mx4200_send(peer, "%s,%03d,%c,%c,%c,%d,%d,%d,", pmvxg,
	    PMVXG_S_TRECOVCONF,
	    tr_mode,	/* time recovery mode (see above ) */
	    'U',	/* synchronize to UTC */
	    'A',	/* always output a time pulse */
	    500,	/* max time error in ns */
	    0,		/* user bias in ns */
	    1);		/* output "830" sentences to control port */
			/* Multi-satellite mode */

	/*
	 * Output position information (to calculate fixed installation
	 * location) only if we are not moving
	 */
	if (up->moving) {
		add_mode = 2;	/* delete from list */
	} else {
		add_mode = 1;	/* add to list */
	}


	/*
	 * "007" Control Port Configuration
	 * Output "021" position, height, velocity reports
	 */
	mx4200_send(peer, "%s,%03d,%03d,%d,%d,,%d,,,", pmvxg,
	    PMVXG_S_PORTCONF,
	    PMVXG_D_PHV, /* control port output block Label */
	    0,		/* clear current output control list (0=no) */
	    add_mode,	/* add/delete sentences from list (1=add, 2=del) */
	    		/* must be null */
	    INTERVAL);	/* sentence output rate (sec) */
			/* precision for position output */
			/* nmea version for cga & gll output */
			/* pass-through control */

	return (1);
}

/*
 * mx4200_ref - Reconfigure unit as a reference station at a known position.
 */
static void
mx4200_ref(
	struct peer *peer
	)
{
	register struct mx4200unit *up;
	struct refclockproc *pp;
	double minute, lat, lon, alt;
	char lats[16], lons[16];
	char nsc, ewc;

	pp = peer->procptr;
	up = (struct mx4200unit *)pp->unitptr;

	/* Should never happen! */
	if (up->moving) return;

	/*
	 * Set up to output status information in the near future
	 */
	up->log_time    = current_time + SLEEPTIME;

	/*
	 * "007" Control Port Configuration
	 * Stop outputting "021" position, height, velocity reports
	 */
	mx4200_send(peer, "%s,%03d,%03d,%d,%d,,,,,", pmvxg,
	    PMVXG_S_PORTCONF,
	    PMVXG_D_PHV, /* control port output block Label */
	    0,		/* clear current output control list (0=no) */
	    2);		/* add/delete sentences from list (2=delete) */
			/* must be null */
	    		/* sentence output rate (sec) */
			/* precision for position output */
			/* nmea version for cga & gll output */
			/* pass-through control */

	/*
	 * "001" Initialization/Mode Control, Part B
	 * Put receiver in fully-constrained 2d nav mode
	 */
	mx4200_send(peer, "%s,%03d,%d,,%.1f,%.1f,%d,%d,%d,%c,%d",
	    pmvxg, PMVXG_S_INITMODEB,
	    2,		/* 2d nav */
	    /* reserved */
	    0.1,	/* hor accel fact as per Steve (m/s**2) */
	    0.1,	/* ver accel fact as per Steve (m/s**2) */
	    10,		/* vdop */
	    10,		/* hdop limit as per Steve */
	    5,		/* elevation limit as per Steve (deg) */
	    'U',	/* time output mode (UTC) */
	    0);		/* local time offset from gmt (HHHMM) */

	/*
	 * "023" Time Recovery Configuration
	 * Get UTC time from a stationary receiver.  Solve for time only.
	 * This should improve the time resolution dramatically.
	 */
	mx4200_send(peer, "%s,%03d,%c,%c,%c,%d,%d,%d,", pmvxg,
	    PMVXG_S_TRECOVCONF,
	    'K',	/* known position: solve for time only */
	    'U',	/* synchronize to UTC */
	    'A',	/* always output a time pulse */
	    500,	/* max time error in ns */
	    0,		/* user bias in ns */
	    1);		/* output "830" sentences to control port */
	/* Multi-satellite mode */

	/*
	 * "000" Initialization/Mode Control - Part A
	 * Fix to our averaged position.
	 */
	if (up->central_meridian != NOT_INITIALIZED) {
		up->avg_lon += up->central_meridian;
		if (up->avg_lon < -180.0) up->avg_lon += 360.0;
		if (up->avg_lon >  180.0) up->avg_lon -= 360.0;
	}

	if (up->avg_lat >= 0.0) {
		lat = up->avg_lat;
		nsc = 'N';
	} else {
		lat = up->avg_lat * (-1.0);
		nsc = 'S';
	}
	if (up->avg_lon >= 0.0) {
		lon = up->avg_lon;
		ewc = 'E';
	} else {
		lon = up->avg_lon * (-1.0);
		ewc = 'W';
	}
	alt = up->avg_alt;
	minute = (lat - (double)(int)lat) * 60.0;
	snprintf(lats, sizeof(lats), "%02d%02.4f", (int)lat, minute);
	minute = (lon - (double)(int)lon) * 60.0;
	snprintf(lons, sizeof(lons), "%03d%02.4f", (int)lon, minute);

	mx4200_send(peer, "%s,%03d,,,,,%s,%c,%s,%c,%.2f,%d", pmvxg,
	    PMVXG_S_INITMODEA,
	    /* day of month */
	    /* month of year */
	    /* year */
	    /* gmt */
	    lats,	/* latitude   DDMM.MMMM */
	    nsc,	/* north/south */
	    lons,	/* longitude DDDMM.MMMM */
	    ewc,	/* east/west */
	    alt,	/* Altitude */
	    1);		/* Altitude Reference (0=WGS84 ellipsoid, 1=MSL geoid)*/

	msyslog(LOG_DEBUG,
	    "mx4200: reconfig to fixed location: %s %c, %s %c, %.2f m",
		lats, nsc, lons, ewc, alt );

}

/*
 * mx4200_poll - mx4200 watchdog routine
 */
static void
mx4200_poll(
	int unit,
	struct peer *peer
	)
{
	register struct mx4200unit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct mx4200unit *)pp->unitptr;

	/*
	 * You don't need to poll this clock.  It puts out timecodes
	 * once per second.  If asked for a timestamp, take note.
	 * The next time a timecode comes in, it will be fed back.
	 */

	/*
	 * If we haven't had a response in a while, reset the receiver.
	 */
	if (up->pollcnt > 0) {
		up->pollcnt--;
	} else {
		refclock_report(peer, CEVNT_TIMEOUT);

		/*
		 * Request a "000" status message which should trigger a
		 * reconfig
		 */
		mx4200_send(peer, "%s,%03d",
		    "CDGPQ",		/* query from CDU to GPS */
		    PMVXG_D_STATUS);	/* label of desired sentence */
	}

	/*
	 * polled every 64 seconds. Ask mx4200_receive to hand in
	 * a timestamp.
	 */
	up->polled = 1;
	pp->polls++;

	/*
	 * Output receiver status information.
	 */
	if ((up->log_time > 0) && (current_time > up->log_time)) {
		up->log_time = 0;
		/*
		 * Output the following messages once, for debugging.
		 *    "004" Mode Data
		 *    "523" Time Recovery Parameters
		 */
		mx4200_send(peer, "%s,%03d", "CDGPQ", PMVXG_D_MODEDATA);
		mx4200_send(peer, "%s,%03d", "CDGPQ", PMVXG_D_TRECOVUSEAGE);
	}
}

static char char2hex[] = "0123456789ABCDEF";

/*
 * mx4200_receive - receive gps data
 */
static void
mx4200_receive(
	struct recvbuf *rbufp
	)
{
	register struct mx4200unit *up;
	struct refclockproc *pp;
	struct peer *peer;
	char *cp;
	int sentence_type;
	u_char ck;

	/*
	 * Initialize pointers and read the timecode and timestamp.
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct mx4200unit *)pp->unitptr;

	/*
	 * If operating mode has been changed, then reinitialize the receiver
	 * before doing anything else.
	 */
	if ((pp->sloppyclockflag & CLK_FLAG2) !=
	    (up->sloppyclockflag & CLK_FLAG2)) {
		up->sloppyclockflag = pp->sloppyclockflag;
		mx4200_debug(peer,
		    "mx4200_receive: mode switch: reset receiver\n");
		mx4200_config(peer);
		return;
	}
	up->sloppyclockflag = pp->sloppyclockflag;

	/*
	 * Read clock output.  Automatically handles STREAMS, CLKLDISC.
	 */
	pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &pp->lastrec);

	/*
	 * There is a case where  generates 2 timestamps.
	 */
	if (pp->lencode == 0)
		return;

	up->pollcnt = 2;
	pp->a_lastcode[pp->lencode] = '\0';
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
	mx4200_debug(peer, "mx4200_receive: %d %s\n",
		     pp->lencode, pp->a_lastcode);

	/*
	 * The structure of the control port sentences is based on the
	 * NMEA-0183 Standard for interfacing Marine Electronics
	 * Navigation Devices (Version 1.5)
	 *
	 *	$PMVXG,XXX, ....................*CK
	 *
	 *		$	Sentence Start Identifier (reserved char)
	 *			   (Start-of-Sentence Identifier)
	 *		P	Special ID (Proprietary)
	 *		MVX	Originator ID (Magnavox)
	 *		G	Interface ID (GPS)
	 *		,	Field Delimiters (reserved char)
	 *		XXX	Sentence Type
	 *		......	Data
	 *		*	Checksum Field Delimiter (reserved char)
	 *		CK	Checksum
	 *		 Carriage-Return/Line Feed (reserved chars)
	 *			   (End-of-Sentence Identifier)
	 *
	 * Reject if any important landmarks are missing.
	 */
	cp = pp->a_lastcode + pp->lencode - 3;
	if (cp < pp->a_lastcode || *pp->a_lastcode != '$' || cp[0] != '*' ) {
		mx4200_debug(peer, "mx4200_receive: bad format\n");
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	/*
	 * Check and discard the checksum
	 */
	ck = mx4200_cksum(&pp->a_lastcode[1], pp->lencode - 4);
	if (char2hex[ck >> 4] != cp[1] || char2hex[ck & 0xf] != cp[2]) {
		mx4200_debug(peer, "mx4200_receive: bad checksum\n");
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}
	*cp = '\0';

	/*
	 * Get the sentence type.
	 */
	sentence_type = 0;
	if ((cp = strchr(pp->a_lastcode, ',')) == NULL) {
		mx4200_debug(peer, "mx4200_receive: no sentence\n");
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}
	cp++;
	sentence_type = strtol(cp, &cp, 10);

	/*
	 * Process the sentence according to its type.
	 */
	switch (sentence_type) {

	/*
	 * "000" Status message
	 */
	case PMVXG_D_STATUS:
		/*
		 * XXX
		 * Since we configure the receiver to not give us status
		 * messages and since the receiver outputs status messages by
		 * default after being reset to factory defaults when sent the
		 * "$PMVXG,018,C\r\n" message, any status message we get
		 * indicates the reciever needs to be initialized; thus, it is
		 * not necessary to decode the status message.
		 */
		if ((cp = mx4200_parse_s(peer)) != NULL) {
			mx4200_debug(peer,
				     "mx4200_receive: status: %s\n", cp);
		}
		mx4200_debug(peer, "mx4200_receive: reset receiver\n");
		mx4200_config(peer);
		break;

	/*
	 * "021" Position, Height, Velocity message,
	 *  if we are still averaging our position
	 */
	case PMVXG_D_PHV:
		if (!up->known) {
			/*
			 * Parse the message, calculating our averaged position.
			 */
			if ((cp = mx4200_parse_p(peer)) != NULL) {
				mx4200_debug(peer, "mx4200_receive: pos: %s\n", cp);
				return;
			}
			mx4200_debug(peer,
			    "mx4200_receive: position avg %f %.9f %.9f %.4f\n",
			    up->N_fixes, up->avg_lat, up->avg_lon, up->avg_alt);
			/*
			 * Reinitialize as a reference station
			 * if position is well known.
			 */
			if (current_time > up->clamp_time) {
				up->known++;
				mx4200_debug(peer, "mx4200_receive: reconfiguring!\n");
				mx4200_ref(peer);
			}
		}
		break;

	/*
	 * Print to the syslog:
	 * "004" Mode Data
	 * "030" Software Configuration
	 * "523" Time Recovery Parameters Currently in Use
	 */
	case PMVXG_D_MODEDATA:
	case PMVXG_D_SOFTCONF:
	case PMVXG_D_TRECOVUSEAGE:

		if ((cp = mx4200_parse_s(peer)) != NULL) {
			mx4200_debug(peer,
				     "mx4200_receive: multi-record: %s\n", cp);
		}
		break;

	/*
	 * "830" Time Recovery Results message
	 */
	case PMVXG_D_TRECOVOUT:

		/*
		 * Capture the last PPS signal.
		 * Precision timestamp is returned in pp->lastrec
		 */
		if (mx4200_pps(peer) != NULL) {
			mx4200_debug(peer, "mx4200_receive: pps failure\n");
			refclock_report(peer, CEVNT_FAULT);
			return;
		}


		/*
		 * Parse the time recovery message, and keep the info
		 * to print the pretty billboards.
		 */
		if ((cp = mx4200_parse_t(peer)) != NULL) {
			mx4200_debug(peer, "mx4200_receive: time: %s\n", cp);
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		}

		/*
		 * Add the new sample to a median filter.
		 */
		if (!refclock_process(pp)) {
			mx4200_debug(peer,"mx4200_receive: offset: %.6f\n",
			    pp->offset);
			refclock_report(peer, CEVNT_BADTIME);
			return;
		}

		/*
		 * The clock will blurt a timecode every second but we only
		 * want one when polled.  If we havn't been polled, bail out.
		 */
		if (!up->polled)
			return;

		/*
		 * Return offset and dispersion to control module.  We use
		 * lastrec as both the reference time and receive time in
		 * order to avoid being cute, like setting the reference time
		 * later than the receive time, which may cause a paranoid
		 * protocol module to chuck out the data.
		 */
		mx4200_debug(peer, "mx4200_receive: process time: ");
		mx4200_debug(peer, "%4d-%03d %02d:%02d:%02d at %s, %.6f\n",
		    pp->year, pp->day, pp->hour, pp->minute, pp->second,
		    prettydate(&pp->lastrec), pp->offset);
		pp->lastref = pp->lastrec;
		refclock_receive(peer);

		/*
		 * We have succeeded in answering the poll.
		 * Turn off the flag and return
		 */
		up->polled = 0;
		break;

	/*
	 * Ignore all other sentence types
	 */
	default:
		break;

	} /* switch (sentence_type) */

	return;
}


/*
 * Parse a mx4200 time recovery message. Returns a string if error.
 *
 * A typical message looks like this.  Checksum has already been stripped.
 *
 *    $PMVXG,830,T,YYYY,MM,DD,HH:MM:SS,U,S,FFFFFF,PPPPP,BBBBBB,LL
 *
 *	Field	Field Contents
 *	-----	--------------
 *		Block Label: $PMVXG
 *		Sentence Type: 830=Time Recovery Results
 *			This sentence is output approximately 1 second
 *			preceding the 1PPS output.  It indicates the
 *			exact time of the next pulse, whether or not the
 *			time mark will be valid (based on operator-specified
 *			error tolerance), the time to which the pulse is
 *			synchronized, the receiver operating mode,
 *			and the time error of the *last* 1PPS output.
 *	1  char Time Mark Valid: T=Valid, F=Not Valid
 *	2  int  Year: 1993-
 *	3  int  Month of Year: 1-12
 *	4  int  Day of Month: 1-31
 *	5  int  Time of Day: HH:MM:SS
 *	6  char Time Synchronization: U=UTC, G=GPS
 *	7  char Time Recovery Mode: D=Dynamic, S=Static,
 *			K=Known Position, N=No Time Recovery
 *	8  int  Oscillator Offset: The filter's estimate of the oscillator
 *			frequency error, in parts per billion (ppb).
 *	9  int  Time Mark Error: The computed error of the *last* pulse
 *			output, in nanoseconds.
 *	10 int  User Time Bias: Operator specified bias, in nanoseconds
 *	11 int  Leap Second Flag: Indicates that a leap second will
 *			occur.  This value is usually zero, except during
 *			the week prior to the leap second occurrence, when
 *			this value will be set to +1 or -1.  A value of
 *			+1 indicates that GPS time will be 1 second
 *			further ahead of UTC time.
 *
 */
static char *
mx4200_parse_t(
	struct peer *peer
	)
{
	struct refclockproc *pp;
	struct mx4200unit *up;
	char   time_mark_valid, time_sync, op_mode;
	int    sentence_type, valid;
	int    year, day_of_year, month, day_of_month;
	int    hour, minute, second, leapsec_warn;
	int    oscillator_offset, time_mark_error, time_bias;

	pp = peer->procptr;
	up = (struct mx4200unit *)pp->unitptr;

	leapsec_warn = 0;  /* Not all receivers output leap second warnings (!) */
	sscanf(pp->a_lastcode,
		"$PMVXG,%d,%c,%d,%d,%d,%d:%d:%d,%c,%c,%d,%d,%d,%d",
		&sentence_type, &time_mark_valid, &year, &month, &day_of_month,
		&hour, &minute, &second, &time_sync, &op_mode,
		&oscillator_offset, &time_mark_error, &time_bias, &leapsec_warn);

	if (sentence_type != PMVXG_D_TRECOVOUT)
		return ("wrong rec-type");

	switch (time_mark_valid) {
		case 'T':
			valid = 1;
			break;
		case 'F':
			valid = 0;
			break;
		default:
			return ("bad pulse-valid");
	}

	switch (time_sync) {
		case 'G':
			return ("synchronized to GPS; should be UTC");
		case 'U':
			break; /* UTC -> ok */
		default:
			return ("not synchronized to UTC");
	}

	/*
	 * Check for insane time (allow for possible leap seconds)
	 */
	if (second > 60 || minute > 59 || hour > 23 ||
	    second <  0 || minute <  0 || hour <  0) {
		mx4200_debug(peer,
		    "mx4200_parse_t: bad time %02d:%02d:%02d",
		    hour, minute, second);
		if (leapsec_warn != 0)
			mx4200_debug(peer, " (leap %+d\n)", leapsec_warn);
		mx4200_debug(peer, "\n");
		refclock_report(peer, CEVNT_BADTIME);
		return ("bad time");
	}
	if ( second == 60 ) {
		msyslog(LOG_DEBUG,
		    "mx4200: leap second! %02d:%02d:%02d",
		    hour, minute, second);
	}

	/*
	 * Check for insane date
	 * (Certainly can't be any year before this code was last altered!)
	 */
	if (day_of_month > 31 || month > 12 ||
	    day_of_month <  1 || month <  1 || year < YEAR_LAST_MODIFIED) {
		mx4200_debug(peer,
		    "mx4200_parse_t: bad date (%4d-%02d-%02d)\n",
		    year, month, day_of_month);
		refclock_report(peer, CEVNT_BADDATE);
		return ("bad date");
	}

	/*
	 * Silly Hack for MX4200:
	 * ASCII message is for *next* 1PPS signal, but we have the
	 * timestamp for the *last* 1PPS signal.  So we have to subtract
	 * a second.  Discard if we are on a month boundary to avoid
	 * possible leap seconds and leap days.
	 */
	second--;
	if (second < 0) {
		second = 59;
		minute--;
		if (minute < 0) {
			minute = 59;
			hour--;
			if (hour < 0) {
				hour = 23;
				day_of_month--;
				if (day_of_month < 1) {
					return ("sorry, month boundary");
				}
			}
		}
	}

	/*
	 * Calculate Julian date
	 */
	if (!(day_of_year = mx4200_jday(year, month, day_of_month))) {
		mx4200_debug(peer,
		    "mx4200_parse_t: bad julian date %d (%4d-%02d-%02d)\n",
		    day_of_year, year, month, day_of_month);
		refclock_report(peer, CEVNT_BADDATE);
		return("invalid julian date");
	}

	/*
	 * Setup leap second indicator
	 */
	switch (leapsec_warn) {
		case 0:
			pp->leap = LEAP_NOWARNING;
			break;
		case 1:
			pp->leap = LEAP_ADDSECOND;
			break;
		case -1:
			pp->leap = LEAP_DELSECOND;
			break;
		default:
			pp->leap = LEAP_NOTINSYNC;
	}

	/*
	 * Any change to the leap second warning status?
	 */
	if (leapsec_warn != up->last_leap ) {
		msyslog(LOG_DEBUG,
		    "mx4200: leap second warning: %d to %d (%d)",
		    up->last_leap, leapsec_warn, pp->leap);
	}
	up->last_leap = leapsec_warn;

	/*
	 * Copy time data for billboard monitoring.
	 */

	pp->year   = year;
	pp->day    = day_of_year;
	pp->hour   = hour;
	pp->minute = minute;
	pp->second = second;

	/*
	 * Toss if sentence is marked invalid
	 */
	if (!valid || pp->leap == LEAP_NOTINSYNC) {
		mx4200_debug(peer, "mx4200_parse_t: time mark not valid\n");
		refclock_report(peer, CEVNT_BADTIME);
		return ("pulse invalid");
	}

	return (NULL);
}

/*
 * Calculate the checksum
 */
static u_char
mx4200_cksum(
	register char *cp,
	register int n
	)
{
	register u_char ck;

	for (ck = 0; n-- > 0; cp++)
		ck ^= *cp;
	return (ck);
}

/*
 * Tables to compute the day of year.  Viva la leap.
 */
static int day1tab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
static int day2tab[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/*
 * Calculate the the Julian Day
 */
static int
mx4200_jday(
	int year,
	int month,
	int day_of_month
	)
{
	register int day, i;
	int leap_year;

	/*
	 * Is this a leap year ?
	 */
	if (year % 4) {
		leap_year = 0; /* FALSE */
	} else {
		if (year % 100) {
			leap_year = 1; /* TRUE */
		} else {
			if (year % 400) {
				leap_year = 0; /* FALSE */
			} else {
				leap_year = 1; /* TRUE */
			}
		}
	}

	/*
	 * Calculate the Julian Date
	 */
	day = day_of_month;

	if (leap_year) {
		/* a leap year */
		if (day > day2tab[month - 1]) {
			return (0);
		}
		for (i = 0; i < month - 1; i++)
		    day += day2tab[i];
	} else {
		/* not a leap year */
		if (day > day1tab[month - 1]) {
			return (0);
		}
		for (i = 0; i < month - 1; i++)
		    day += day1tab[i];
	}
	return (day);
}

/*
 * Parse a mx4200 position/height/velocity sentence.
 *
 * A typical message looks like this.  Checksum has already been stripped.
 *
 * $PMVXG,021,SSSSSS.SS,DDMM.MMMM,N,DDDMM.MMMM,E,HHHHH.H,GGGG.G,EEEE.E,WWWW.W,MM
 *
 *	Field	Field Contents
 *	-----	--------------
 *		Block Label: $PMVXG
 *		Sentence Type: 021=Position, Height Velocity Data
 *			This sentence gives the receiver position, height,
 *			navigation mode, and velocity north/east.
 *			*This sentence is intended for post-analysis
 *			applications.*
 *	1 float UTC measurement time (seconds into week)
 *	2 float WGS-84 Lattitude (degrees, minutes)
 *	3  char N=North, S=South
 *	4 float WGS-84 Longitude (degrees, minutes)
 *	5  char E=East, W=West
 *	6 float Altitude (meters above mean sea level)
 *	7 float Geoidal height (meters)
 *	8 float East velocity (m/sec)
 *	9 float West Velocity (m/sec)
 *	10  int Navigation Mode
 *		    Mode if navigating:
 *			1 = Position from remote device
 *			2 = 2-D position
 *			3 = 3-D position
 *			4 = 2-D differential position
 *			5 = 3-D differential position
 *			6 = Static
 *			8 = Position known -- reference station
 *			9 = Position known -- Navigator
 *		    Mode if not navigating:
 *			51 = Too few satellites
 *			52 = DOPs too large
 *			53 = Position STD too large
 *			54 = Velocity STD too large
 *			55 = Too many iterations for velocity
 *			56 = Too many iterations for position
 *			57 = 3 sat startup failed
 *			58 = Command abort
 */
static char *
mx4200_parse_p(
	struct peer *peer
	)
{
	struct refclockproc *pp;
	struct mx4200unit *up;
	int sentence_type, mode;
	double mtime, lat, lon, alt, geoid, vele, veln;
	char   north_south, east_west;

	pp = peer->procptr;
	up = (struct mx4200unit *)pp->unitptr;

	/* Should never happen! */
	if (up->moving) return ("mobile platform - no pos!");

	sscanf ( pp->a_lastcode,
		"$PMVXG,%d,%lf,%lf,%c,%lf,%c,%lf,%lf,%lf,%lf,%d",
		&sentence_type, &mtime, &lat, &north_south, &lon, &east_west,
		&alt, &geoid, &vele, &veln, &mode);

	/* Sentence type */
	if (sentence_type != PMVXG_D_PHV)
		return ("wrong rec-type");

	/*
	 * return if not navigating
	 */
	if (mode > 10)
		return ("not navigating");
	if (mode != 3 && mode != 5)
		return ("not navigating in 3D");

	/* Latitude (always +ve) and convert DDMM.MMMM to decimal */
	if (lat <  0.0) return ("negative latitude");
	if (lat > 9000.0) lat = 9000.0;
	lat *= 0.01;
	lat = ((int)lat) + (((lat - (int)lat)) * 1.6666666666666666);

	/* North/South */
	switch (north_south) {
		case 'N':
			break;
		case 'S':
			lat *= -1.0;
			break;
		default:
			return ("invalid north/south indicator");
	}

	/* Longitude (always +ve) and convert DDDMM.MMMM to decimal */
	if (lon <   0.0) return ("negative longitude");
	if (lon > 180.0) lon = 180.0;
	lon *= 0.01;
	lon = ((int)lon) + (((lon - (int)lon)) * 1.6666666666666666);

	/* East/West */
	switch (east_west) {
		case 'E':
			break;
		case 'W':
			lon *= -1.0;
			break;
		default:
			return ("invalid east/west indicator");
	}

	/*
	 * Normalize longitude to near 0 degrees.
	 * Assume all data are clustered around first reading.
	 */
	if (up->central_meridian == NOT_INITIALIZED) {
		up->central_meridian = lon;
		mx4200_debug(peer,
		    "mx4200_receive: central meridian =  %.9f \n",
		    up->central_meridian);
	}
	lon -= up->central_meridian;
	if (lon < -180.0) lon += 360.0;
	if (lon >  180.0) lon -= 360.0;

	/*
	 * Calculate running averages
	 */

	up->avg_lon = (up->N_fixes * up->avg_lon) + lon;
	up->avg_lat = (up->N_fixes * up->avg_lat) + lat;
	up->avg_alt = (up->N_fixes * up->avg_alt) + alt;

	up->N_fixes += 1.0;

	up->avg_lon /= up->N_fixes;
	up->avg_lat /= up->N_fixes;
	up->avg_alt /= up->N_fixes;

	mx4200_debug(peer,
	    "mx4200_receive: position rdg %.0f: %.9f %.9f %.4f (CM=%.9f)\n",
	    up->N_fixes, lat, lon, alt, up->central_meridian);

	return (NULL);
}

/*
 * Parse a mx4200 Status sentence
 * Parse a mx4200 Mode Data sentence
 * Parse a mx4200 Software Configuration sentence
 * Parse a mx4200 Time Recovery Parameters Currently in Use sentence
 * (used only for logging raw strings)
 *
 * A typical message looks like this.  Checksum has already been stripped.
 *
 * $PMVXG,000,XXX,XX,X,HHMM,X
 *
 *	Field	Field Contents
 *	-----	--------------
 *		Block Label: $PMVXG
 *		Sentence Type: 000=Status.
 *			Returns status of the receiver to the controller.
 *	1	Current Receiver Status:
 *		ACQ = Satellite re-acquisition
 *		ALT = Constellation selection
 *		COR = Providing corrections (for reference stations only)
 *		IAC = Initial acquisition
 *		IDL = Idle, no satellites
 *		NAV = Navigation
 *		STS = Search the Sky (no almanac available)
 *		TRK = Tracking
 *	2	Number of satellites that should be visible
 *	3	Number of satellites being tracked
 *	4	Time since last navigation status if not currently navigating
 *		(hours, minutes)
 *	5	Initialization status:
 *		0 = Waiting for initialization parameters
 *		1 = Initialization completed
 *
 * A typical message looks like this.  Checksum has already been stripped.
 *
 * $PMVXG,004,C,R,D,H.HH,V.VV,TT,HHHH,VVVV,T
 *
 *	Field	Field Contents
 *	-----	--------------
 *		Block Label: $PMVXG
 *		Sentence Type: 004=Software Configuration.
 *			Defines the navigation mode and criteria for
 *			acceptable navigation for the receiver.
 *	1	Constrain Altitude Mode:
 *		0 = Auto.  Constrain altitude (2-D solution) and use
 *		    manual altitude input when 3 sats avalable.  Do
 *		    not constrain altitude (3-D solution) when 4 sats
 *		    available.
 *		1 = Always constrain altitude (2-D solution).
 *		2 = Never constrain altitude (3-D solution).
 *		3 = Coast.  Constrain altitude (2-D solution) and use
 *		    last GPS altitude calculation when 3 sats avalable.
 *		    Do not constrain altitude (3-D solution) when 4 sats
 *		    available.
 *	2	Altitude Reference: (always 0 for MX4200)
 *		0 = Ellipsoid
 *		1 = Geoid (MSL)
 *	3	Differential Navigation Control:
 *		0 = Disabled
 *		1 = Enabled
 *	4	Horizontal Acceleration Constant (m/sec**2)
 *	5	Vertical Acceleration Constant (m/sec**2) (0 for MX4200)
 *	6	Tracking Elevation Limit (degrees)
 *	7	HDOP Limit
 *	8	VDOP Limit
 *	9	Time Output Mode:
 *		U = UTC
 *		L = Local time
 *	10	Local Time Offset (minutes) (absent on MX4200)
 *
 * A typical message looks like this.  Checksum has already been stripped.
 *
 * $PMVXG,030,NNNN,FFF
 *
 *	Field	Field Contents
 *	-----	--------------
 *		Block Label: $PMVXG
 *		Sentence Type: 030=Software Configuration.
 *			This sentence contains the navigation processor
 *			and baseband firmware version numbers.
 *	1	Nav Processor Version Number
 *	2	Baseband Firmware Version Number
 *
 * A typical message looks like this.  Checksum has already been stripped.
 *
 * $PMVXG,523,M,S,M,EEEE,BBBBBB,C,R
 *
 *	Field	Field Contents
 *	-----	--------------
 *		Block Label: $PMVXG
 *		Sentence Type: 523=Time Recovery Parameters Currently in Use.
 *			This sentence contains the configuration of the
 *			time recovery feature of the receiver.
 *	1	Time Recovery Mode:
 *		D = Dynamic; solve for position and time while moving
 *		S = Static; solve for position and time while stationary
 *		K = Known position input, solve for time only
 *		N = No time recovery
 *	2	Time Synchronization:
 *		U = UTC time
 *		G = GPS time
 *	3	Time Mark Mode:
 *		A = Always output a time pulse
 *		V = Only output time pulse if time is valid (as determined
 *		    by Maximum Time Error)
 *	4	Maximum Time Error - the maximum error (in nanoseconds) for
 *		which a time mark will be considered valid.
 *	5	User Time Bias - external bias in nanoseconds
 *	6	Time Message Control:
 *		0 = Do not output the time recovery message
 *		1 = Output the time recovery message (record 830) to
 *		    Control port
 *		2 = Output the time recovery message (record 830) to
 *		    Equipment port
 *	7	Reserved
 *	8	Position Known PRN (absent on MX 4200)
 *
 */
static char *
mx4200_parse_s(
	struct peer *peer
	)
{
	struct refclockproc *pp;
	struct mx4200unit *up;
	int sentence_type;

	pp = peer->procptr;
	up = (struct mx4200unit *)pp->unitptr;

        sscanf ( pp->a_lastcode, "$PMVXG,%d", &sentence_type);

	/* Sentence type */
	switch (sentence_type) {

		case PMVXG_D_STATUS:
			msyslog(LOG_DEBUG,
			  "mx4200: status: %s", pp->a_lastcode);
			break;
		case PMVXG_D_MODEDATA:
			msyslog(LOG_DEBUG,
			  "mx4200: mode data: %s", pp->a_lastcode);
			break;
		case PMVXG_D_SOFTCONF:
			msyslog(LOG_DEBUG,
			  "mx4200: firmware configuration: %s", pp->a_lastcode);
			break;
		case PMVXG_D_TRECOVUSEAGE:
			msyslog(LOG_DEBUG,
			  "mx4200: time recovery parms: %s", pp->a_lastcode);
			break;
		default:
			return ("wrong rec-type");
	}

	return (NULL);
}

/*
 * Process a PPS signal, placing a timestamp in pp->lastrec.
 */
static int
mx4200_pps(
	struct peer *peer
	)
{
	int temp_serial;
	struct refclockproc *pp;
	struct mx4200unit *up;

	struct timespec timeout;

	pp = peer->procptr;
	up = (struct mx4200unit *)pp->unitptr;

	/*
	 * Grab the timestamp of the PPS signal.
	 */
	temp_serial = up->pps_i.assert_sequence;
	timeout.tv_sec  = 0;
	timeout.tv_nsec = 0;
	if (time_pps_fetch(up->pps_h, PPS_TSFMT_TSPEC, &(up->pps_i),
			&timeout) < 0) {
		mx4200_debug(peer,
		  "mx4200_pps: time_pps_fetch: serial=%lu, %s\n",
		     (unsigned long)up->pps_i.assert_sequence, strerror(errno));
		refclock_report(peer, CEVNT_FAULT);
		return(1);
	}
	if (temp_serial == up->pps_i.assert_sequence) {
		mx4200_debug(peer,
		   "mx4200_pps: assert_sequence serial not incrementing: %lu\n",
			(unsigned long)up->pps_i.assert_sequence);
		refclock_report(peer, CEVNT_FAULT);
		return(1);
	}
	/*
	 * Check pps serial number against last one
	 */
	if (up->lastserial + 1 != up->pps_i.assert_sequence &&
	    up->lastserial != 0) {
		if (up->pps_i.assert_sequence == up->lastserial) {
			mx4200_debug(peer, "mx4200_pps: no new pps event\n");
		} else {
			mx4200_debug(peer, "mx4200_pps: missed %lu pps events\n",
			    up->pps_i.assert_sequence - up->lastserial - 1UL);
		}
		refclock_report(peer, CEVNT_FAULT);
	}
	up->lastserial = up->pps_i.assert_sequence;

	/*
	 * Return the timestamp in pp->lastrec
	 */

	pp->lastrec.l_ui = up->pps_i.assert_timestamp.tv_sec +
			   (u_int32) JAN_1970;
	pp->lastrec.l_uf = ((double)(up->pps_i.assert_timestamp.tv_nsec) *
			   4.2949672960) + 0.5;

	return(0);
}

/*
 * mx4200_debug - print debug messages
 */
#if defined(__STDC__)
static void
mx4200_debug(struct peer *peer, char *fmt, ...)
#else
static void
mx4200_debug(peer, fmt, va_alist)
     struct peer *peer;
     char *fmt;
#endif /* __STDC__ */
{
#ifdef DEBUG
	va_list ap;
	struct refclockproc *pp;
	struct mx4200unit *up;

	if (debug) {

#if defined(__STDC__)
		va_start(ap, fmt);
#else
		va_start(ap);
#endif /* __STDC__ */

		pp = peer->procptr;
		up = (struct mx4200unit *)pp->unitptr;


		/*
		 * Print debug message to stdout
		 * In the future, we may want to get get more creative...
		 */
		vprintf(fmt, ap);

		va_end(ap);
	}
#endif
}

/*
 * Send a character string to the receiver.  Checksum is appended here.
 */
#if defined(__STDC__)
static void
mx4200_send(struct peer *peer, char *fmt, ...)
#else
static void
mx4200_send(peer, fmt, va_alist)
     struct peer *peer;
     char *fmt;
     va_dcl
#endif /* __STDC__ */
{
	struct refclockproc *pp;
	struct mx4200unit *up;

	register char *cp;
	register int n, m;
	va_list ap;
	char buf[1024];
	u_char ck;

#if defined(__STDC__)
	va_start(ap, fmt);
#else
	va_start(ap);
#endif /* __STDC__ */

	pp = peer->procptr;
	up = (struct mx4200unit *)pp->unitptr;

	cp = buf;
	*cp++ = '$';
	n = VSNPRINTF((cp, sizeof(buf) - 1, fmt, ap));
	ck = mx4200_cksum(cp, n);
	cp += n;
	++n;
	n += SNPRINTF((cp, sizeof(buf) - n - 5, "*%02X\r\n", ck));

	m = write(pp->io.fd, buf, (unsigned)n);
	if (m < 0)
		msyslog(LOG_ERR, "mx4200_send: write: %m (%s)", buf);
	mx4200_debug(peer, "mx4200_send: %d %s\n", m, buf);
	va_end(ap);
}

#else
int refclock_mx4200_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/ntp_util.c0000644000175000017500000005757711460237473014614 0ustar  peterpeter/*
 * ntp_util.c - stuff I didn't have any other place for
 */
#ifdef HAVE_CONFIG_H
# include 
#endif

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_unixtime.h"
#include "ntp_filegen.h"
#include "ntp_if.h"
#include "ntp_stdlib.h"
#include "ntp_assert.h"

#include 
#include 
#include 
#ifdef HAVE_SYS_IOCTL_H
# include 
#endif

#ifdef HAVE_IEEEFP_H
# include 
#endif
#ifdef HAVE_MATH_H
# include 
#endif

#ifdef  DOSYNCTODR
# if !defined(VMS)
#  include 
# endif /* VMS */
#endif

#if defined(VMS)
# include 
#endif /* VMS */

/*
 * Defines used by the leapseconds stuff
 */
#define	MAX_TAI	100			/* max TAI offset (s) */
#define	L_DAY	86400UL			/* seconds per day */
#define	L_YEAR	(L_DAY * 365)		/* days per year */
#define	L_LYEAR	(L_YEAR + L_DAY)	/* days per leap year */
#define	L_4YEAR	(L_LYEAR + 3 * L_YEAR)	/* days per leap cycle */
#define	L_CENT	(L_4YEAR * 25)		/* days per century */

/*
 * This contains odds and ends, including the hourly stats, various
 * configuration items, leapseconds stuff, etc.
 */
/*
 * File names
 */
static	char *key_file_name;		/* keys file name */
char	*leapseconds_file_name;		/* leapseconds file name */
char	*stats_drift_file;		/* frequency file name */
static	char *stats_temp_file;		/* temp frequency file name */
double wander_resid;			/* wander threshold */
double	wander_threshold = 1e-7;	/* initial wander threshold */
int	drift_file_sw;			/* clock update switch */

/*
 * Statistics file stuff
 */
#ifndef NTP_VAR
# ifndef SYS_WINNT
#  define NTP_VAR "/var/NTP/"		/* NOTE the trailing '/' */
# else
#  define NTP_VAR "c:\\var\\ntp\\"	/* NOTE the trailing '\\' */
# endif /* SYS_WINNT */
#endif

#ifndef MAXPATHLEN
# define MAXPATHLEN 256
#endif

#ifdef DEBUG_TIMING
static FILEGEN timingstats;
#endif
#ifdef OPENSSL
static FILEGEN cryptostats;
#endif /* OPENSSL */

static	char statsdir[MAXPATHLEN] = NTP_VAR;
static FILEGEN peerstats;
static FILEGEN loopstats;
static FILEGEN clockstats;
static FILEGEN rawstats;
static FILEGEN sysstats;
static FILEGEN protostats;

/*
 * This controls whether stats are written to the fileset. Provided
 * so that ntpdc can turn off stats when the file system fills up. 
 */
int stats_control;

/*
 * Initial frequency offset later passed to the loopfilter.
 */
double	old_drift = 1e9;		/* current frequency */
static double prev_drift_comp;		/* last frequency update */

/*
 * Static prototypes
 */
static int leap_file(FILE *);
static void record_sys_stats(void);

/* 
 * Prototypes
 */
#ifdef DEBUG
void	uninit_util(void);
#endif


/*
 * uninit_util - free memory allocated by init_util
 */
#ifdef DEBUG
void
uninit_util(void)
{
#if defined(_MSC_VER) && defined (_DEBUG)
	_CrtCheckMemory();
#endif
	if (stats_drift_file) {
		free(stats_drift_file);
		free(stats_temp_file);
		stats_drift_file = NULL;
		stats_temp_file = NULL;
	}
	if (key_file_name) {
		free(key_file_name);
		key_file_name = NULL;
	}
	filegen_unregister("peerstats");
	filegen_unregister("loopstats");
	filegen_unregister("clockstats");
	filegen_unregister("rawstats");
	filegen_unregister("sysstats");
	filegen_unregister("protostats");
#ifdef OPENSSL
	filegen_unregister("cryptostats");
#endif /* OPENSSL */
#ifdef DEBUG_TIMING
	filegen_unregister("timingstats");
#endif /* DEBUG_TIMING */

#if defined(_MSC_VER) && defined (_DEBUG)
	_CrtCheckMemory();
#endif
}
#endif /* DEBUG */


/*
 * init_util - initialize the utilities (ntpd included)
 */
void
init_util(void)
{
	stats_drift_file = NULL;
	stats_temp_file = NULL;
	key_file_name = NULL;
	filegen_register(statsdir, "peerstats",   &peerstats);
	filegen_register(statsdir, "loopstats",   &loopstats);
	filegen_register(statsdir, "clockstats",  &clockstats);
	filegen_register(statsdir, "rawstats",    &rawstats);
	filegen_register(statsdir, "sysstats",    &sysstats);
	filegen_register(statsdir, "protostats",  &protostats);
#ifdef OPENSSL
	filegen_register(statsdir, "cryptostats", &cryptostats);
#endif /* OPENSSL */
#ifdef DEBUG_TIMING
	filegen_register(statsdir, "timingstats", &timingstats);
#endif /* DEBUG_TIMING */
#ifdef DEBUG
	atexit(uninit_util);
#endif /* DEBUG */
}


/*
 * hourly_stats - print some interesting stats
 */
void
write_stats(void)
{
	FILE	*fp;
	double	ftemp;
#ifdef DOSYNCTODR
	struct timeval tv;
#if !defined(VMS)
	int	prio_set;
#endif
#ifdef HAVE_GETCLOCK
        struct timespec ts;
#endif
	int	o_prio;

	/*
	 * Sometimes having a Sun can be a drag.
	 *
	 * The kernel variable dosynctodr controls whether the system's
	 * soft clock is kept in sync with the battery clock. If it
	 * is zero, then the soft clock is not synced, and the battery
	 * clock is simply left to rot. That means that when the system
	 * reboots, the battery clock (which has probably gone wacky)
	 * sets the soft clock. That means ntpd starts off with a very
	 * confused idea of what time it is. It then takes a large
	 * amount of time to figure out just how wacky the battery clock
	 * has made things drift, etc, etc. The solution is to make the
	 * battery clock sync up to system time. The way to do THAT is
	 * to simply set the time of day to the current time of day, but
	 * as quickly as possible. This may, or may not be a sensible
	 * thing to do.
	 *
	 * CAVEAT: settimeofday() steps the sun clock by about 800 us,
	 *         so setting DOSYNCTODR seems a bad idea in the
	 *         case of us resolution
	 */

#if !defined(VMS)
	/*
	 * (prr) getpriority returns -1 on error, but -1 is also a valid
	 * return value (!), so instead we have to zero errno before the
	 * call and check it for non-zero afterwards.
	 */
	errno = 0;
	prio_set = 0;
	o_prio = getpriority(PRIO_PROCESS,0); /* Save setting */

	/*
	 * (prr) if getpriority succeeded, call setpriority to raise
	 * scheduling priority as high as possible.  If that succeeds
	 * as well, set the prio_set flag so we remember to reset
	 * priority to its previous value below.  Note that on Solaris
	 * 2.6 (and beyond?), both getpriority and setpriority will fail
	 * with ESRCH, because sched_setscheduler (called from main) put
	 * us in the real-time scheduling class which setpriority
	 * doesn't know about. Being in the real-time class is better
	 * than anything setpriority can do, anyhow, so this error is
	 * silently ignored.
	 */
	if ((errno == 0) && (setpriority(PRIO_PROCESS,0,-20) == 0))
		prio_set = 1;	/* overdrive */
#endif /* VMS */
#ifdef HAVE_GETCLOCK
        (void) getclock(TIMEOFDAY, &ts);
        tv.tv_sec = ts.tv_sec;
        tv.tv_usec = ts.tv_nsec / 1000;
#else /*  not HAVE_GETCLOCK */
	GETTIMEOFDAY(&tv,(struct timezone *)NULL);
#endif /* not HAVE_GETCLOCK */
	if (ntp_set_tod(&tv,(struct timezone *)NULL) != 0)
		msyslog(LOG_ERR, "can't sync battery time: %m");
#if !defined(VMS)
	if (prio_set)
		setpriority(PRIO_PROCESS, 0, o_prio); /* downshift */
#endif /* VMS */
#endif /* DOSYNCTODR */
	record_sys_stats();
	ftemp = fabs(prev_drift_comp - drift_comp); 
	prev_drift_comp = drift_comp;
	if (ftemp > clock_phi)
		return;

	if (stats_drift_file != 0 && drift_file_sw) {

		/*
		 * When the frequency file is written, initialize the
		 * wander threshold to a configured initial value.
		 * Thereafter reduce it by a factor of 0.5. When it
		 * drops below the frequency wander, write the frequency
		 * file. This adapts to the prevailing wander yet
		 * minimizes the file writes.
		 */
		drift_file_sw = FALSE;
		wander_resid *= 0.5;
#ifdef DEBUG
		if (debug)
			printf("write_stats: wander %.6lf thresh %.6lf, freq %.6lf\n",
			    clock_stability * 1e6, wander_resid * 1e6,
			    drift_comp * 1e6);
#endif
 		if (sys_leap != LEAP_NOTINSYNC && clock_stability >
		    wander_resid) {
			wander_resid = wander_threshold;
			if ((fp = fopen(stats_temp_file, "w")) == NULL)
			    {
				msyslog(LOG_ERR,
				    "frequency file %s: %m",
				    stats_temp_file);
				return;
			}
			fprintf(fp, "%.3f\n", drift_comp * 1e6);
			(void)fclose(fp);
			/* atomic */
#ifdef SYS_WINNT
			if (_unlink(stats_drift_file)) /* rename semantics differ under NT */
				msyslog(LOG_WARNING, 
					"Unable to remove prior drift file %s, %m", 
					stats_drift_file);
#endif /* SYS_WINNT */

#ifndef NO_RENAME
			if (rename(stats_temp_file, stats_drift_file))
				msyslog(LOG_WARNING, 
					"Unable to rename temp drift file %s to %s, %m", 
					stats_temp_file, stats_drift_file);
#else
			/* we have no rename NFS of ftp in use */
			if ((fp = fopen(stats_drift_file, "w")) ==
			    NULL) {
				msyslog(LOG_ERR,
				    "frequency file %s: %m",
				    stats_drift_file);
				return;
			}
#endif

#if defined(VMS)
			/* PURGE */
			{
				$DESCRIPTOR(oldvers,";-1");
				struct dsc$descriptor driftdsc = {
					strlen(stats_drift_file), 0, 0,
					    stats_drift_file };
				while(lib$delete_file(&oldvers,
				    &driftdsc) & 1);
			}
#endif
		} else {
			/* XXX: Log a message at INFO level */
		}
	}
}


/*
 * stats_config - configure the stats operation
 */
void
stats_config(
	int item,
	const char *invalue	/* only one type so far */
	)
{
	FILE	*fp;
	const char *value;
	int	len;
	char	tbuf[80];
	char	str1[20], str2[20];
#ifndef VMS
	const char temp_ext[] = ".TEMP";
#else
	const char temp_ext[] = "-TEMP";
#endif

	/*
	 * Expand environment strings under Windows NT, since the
	 * command interpreter doesn't do this, the program must.
	 */
#ifdef SYS_WINNT
	char newvalue[MAX_PATH], parameter[MAX_PATH];

	if (!ExpandEnvironmentStrings(invalue, newvalue, MAX_PATH)) {
 		switch(item) {
		    case STATS_FREQ_FILE:
			strcpy(parameter,"STATS_FREQ_FILE");
			break;

		    case STATS_LEAP_FILE:
			strcpy(parameter,"STATS_LEAP_FILE");
			break;

		    case STATS_STATSDIR:
			strcpy(parameter,"STATS_STATSDIR");
			break;

		    case STATS_PID_FILE:
			strcpy(parameter,"STATS_PID_FILE");
			break;

		    default:
			strcpy(parameter,"UNKNOWN");
			break;
		}
		value = invalue;
		msyslog(LOG_ERR,
		    "ExpandEnvironmentStrings(%s) failed: %m\n",
		    parameter);
	} else {
		value = newvalue;
	}
#else    
	value = invalue;
#endif /* SYS_WINNT */

	switch(item) {

	/*
	 * Open and read frequency file.
	 */
	case STATS_FREQ_FILE:
		if (!value || (len = strlen(value)) == 0)
			break;

		stats_drift_file = erealloc(stats_drift_file, len + 1);
		stats_temp_file = erealloc(stats_temp_file, 
					   len + sizeof(".TEMP"));

		memcpy(stats_drift_file, value, (unsigned)(len+1));
		memcpy(stats_temp_file, value, (unsigned)len);
		memcpy(stats_temp_file + len, temp_ext,
		       sizeof(temp_ext));

		/*
		 * Open drift file and read frequency. If the file is
		 * missing or contains errors, tell the loop to reset.
		 */
		if ((fp = fopen(stats_drift_file, "r")) == NULL)
			break;

		if (fscanf(fp, "%lf", &old_drift) != 1) {
			msyslog(LOG_ERR,
				"format error frequency file %s", 
				stats_drift_file);
			fclose(fp);
			break;

		}
		fclose(fp);
		old_drift /= 1e6;
		prev_drift_comp = old_drift;
		break;

	/*
	 * Specify statistics directory.
	 */
	case STATS_STATSDIR:

		/*
		 * HMS: the following test is insufficient:
		 * - value may be missing the DIR_SEP
		 * - we still need the filename after it
		 */
		if (strlen(value) >= sizeof(statsdir)) {
			msyslog(LOG_ERR,
			    "statsdir too long (>%d, sigh)",
			    (int)sizeof(statsdir) - 1);
		} else {
			l_fp now;
			int add_dir_sep;
			int value_l = strlen(value);

			/* Add a DIR_SEP unless we already have one. */
			if (value_l == 0)
				add_dir_sep = 0;
			else
				add_dir_sep = (DIR_SEP !=
				    value[value_l - 1]);

			if (add_dir_sep)
			    snprintf(statsdir, sizeof(statsdir),
				"%s%c", value, DIR_SEP);
			else
			    snprintf(statsdir, sizeof(statsdir),
				"%s", value);

			get_systime(&now);
			if(peerstats.prefix == &statsdir[0] &&
			    peerstats.fp != NULL) {
				fclose(peerstats.fp);
				peerstats.fp = NULL;
				filegen_setup(&peerstats, now.l_ui);
			}
			if(loopstats.prefix == &statsdir[0] &&
			    loopstats.fp != NULL) {
				fclose(loopstats.fp);
				loopstats.fp = NULL;
				filegen_setup(&loopstats, now.l_ui);
			}
			if(clockstats.prefix == &statsdir[0] &&
			    clockstats.fp != NULL) {
				fclose(clockstats.fp);
				clockstats.fp = NULL;
				filegen_setup(&clockstats, now.l_ui);
			}
			if(rawstats.prefix == &statsdir[0] &&
			    rawstats.fp != NULL) {
				fclose(rawstats.fp);
				rawstats.fp = NULL;
				filegen_setup(&rawstats, now.l_ui);
			}
			if(sysstats.prefix == &statsdir[0] &&
			    sysstats.fp != NULL) {
				fclose(sysstats.fp);
				sysstats.fp = NULL;
				filegen_setup(&sysstats, now.l_ui);
			}
			if(protostats.prefix == &statsdir[0] &&
			    protostats.fp != NULL) {
				fclose(protostats.fp);
				protostats.fp = NULL;
				filegen_setup(&protostats, now.l_ui);
			}
#ifdef OPENSSL
			if(cryptostats.prefix == &statsdir[0] &&
			    cryptostats.fp != NULL) {
				fclose(cryptostats.fp);
				cryptostats.fp = NULL;
				filegen_setup(&cryptostats, now.l_ui);
			}
#endif /* OPENSSL */
#ifdef DEBUG_TIMING
			if(timingstats.prefix == &statsdir[0] &&
			    timingstats.fp != NULL) {
				fclose(timingstats.fp);
				timingstats.fp = NULL;
				filegen_setup(&timingstats, now.l_ui);
			}
#endif /* DEBUG_TIMING */
		}
		break;

	/*
	 * Open pid file.
	 */
	case STATS_PID_FILE:
		if ((fp = fopen(value, "w")) == NULL) {
			msyslog(LOG_ERR, "pid file %s: %m",
			    value);
			break;
		}
		fprintf(fp, "%d", (int)getpid());
		fclose(fp);;
		break;

	/*
	 * Read leapseconds file.
	 */
	case STATS_LEAP_FILE:
		if ((fp = fopen(value, "r")) == NULL) {
			msyslog(LOG_ERR, "leapseconds file %s: %m",
			    value);
			break;
		}

		if (leap_file(fp) < 0) {
			msyslog(LOG_ERR,
			    "format error leapseconds file %s",
			    value);
		} else {
			strcpy(str1, fstostr(leap_sec));
			strcpy(str2, fstostr(leap_expire));
			snprintf(tbuf, sizeof(tbuf),
			    "%d leap %s expire %s", leap_tai, str1,
			    str2);
			report_event(EVNT_TAI, NULL, tbuf);
		}
		fclose(fp);
		break;

	default:
		/* oh well */
		break;
	}
}


/*
 * record_peer_stats - write peer statistics to file
 *
 * file format:
 * day (MJD)
 * time (s past UTC midnight)
 * IP address
 * status word (hex)
 * offset
 * delay
 * dispersion
 * jitter
*/
void
record_peer_stats(
	sockaddr_u *addr,
	int	status,
	double	offset,		/* offset */
	double	delay,		/* delay */
	double	dispersion,	/* dispersion */
	double	jitter		/* jitter */
	)
{
	l_fp	now;
	u_long	day;

	if (!stats_control)
		return;

	get_systime(&now);
	filegen_setup(&peerstats, now.l_ui);
	day = now.l_ui / 86400 + MJD_1900;
	now.l_ui %= 86400;
	if (peerstats.fp != NULL) {
		fprintf(peerstats.fp,
		    "%lu %s %s %x %.9f %.9f %.9f %.9f\n", day,
		    ulfptoa(&now, 3), stoa(addr), status, offset,
		    delay, dispersion, jitter);
		fflush(peerstats.fp);
	}
}


/*
 * record_loop_stats - write loop filter statistics to file
 *
 * file format:
 * day (MJD)
 * time (s past midnight)
 * offset
 * frequency (PPM)
 * jitter
 * wnder (PPM)
 * time constant (log2)
 */
void
record_loop_stats(
	double	offset,		/* offset */
	double	freq,		/* frequency (PPM) */
	double	jitter,		/* jitter */
	double	wander,		/* wander (PPM) */
	int spoll
	)
{
	l_fp	now;
	u_long	day;

	if (!stats_control)
		return;

	get_systime(&now);
	filegen_setup(&loopstats, now.l_ui);
	day = now.l_ui / 86400 + MJD_1900;
	now.l_ui %= 86400;
	if (loopstats.fp != NULL) {
		fprintf(loopstats.fp, "%lu %s %.9f %.3f %.9f %.6f %d\n",
		    day, ulfptoa(&now, 3), offset, freq * 1e6, jitter,
		    wander * 1e6, spoll);
		fflush(loopstats.fp);
	}
}


/*
 * record_clock_stats - write clock statistics to file
 *
 * file format:
 * day (MJD)
 * time (s past midnight)
 * IP address
 * text message
 */
void
record_clock_stats(
	sockaddr_u *addr,
	const char *text	/* timecode string */
	)
{
	l_fp	now;
	u_long	day;

	if (!stats_control)
		return;

	get_systime(&now);
	filegen_setup(&clockstats, now.l_ui);
	day = now.l_ui / 86400 + MJD_1900;
	now.l_ui %= 86400;
	if (clockstats.fp != NULL) {
		fprintf(clockstats.fp, "%lu %s %s %s\n", day,
		    ulfptoa(&now, 3), stoa(addr), text);
		fflush(clockstats.fp);
	}
}


/*
 * record_raw_stats - write raw timestamps to file
 *
 * file format
 * day (MJD)
 * time (s past midnight)
 * peer ip address
 * IP address
 * t1 t2 t3 t4 timestamps
 */
void
record_raw_stats(
	sockaddr_u *srcadr,
	sockaddr_u *dstadr,
	l_fp	*t1,		/* originate timestamp */
	l_fp	*t2,		/* receive timestamp */
	l_fp	*t3,		/* transmit timestamp */
	l_fp	*t4		/* destination timestamp */
	)
{
	l_fp	now;
	u_long	day;

	if (!stats_control)
		return;

	get_systime(&now);
	filegen_setup(&rawstats, now.l_ui);
	day = now.l_ui / 86400 + MJD_1900;
	now.l_ui %= 86400;
	if (rawstats.fp != NULL) {
		fprintf(rawstats.fp, "%lu %s %s %s %s %s %s %s\n", day,
		    ulfptoa(&now, 3), stoa(srcadr), dstadr ? 
		    stoa(dstadr) : "-",	ulfptoa(t1, 9), ulfptoa(t2, 9),
		    ulfptoa(t3, 9), ulfptoa(t4, 9));
		fflush(rawstats.fp);
	}
}


/*
 * record_sys_stats - write system statistics to file
 *
 * file format
 * day (MJD)
 * time (s past midnight)
 * time since reset
 * packets recieved
 * packets for this host
 * current version
 * old version
 * access denied
 * bad length or format
 * bad authentication
 * declined
 * rate exceeded
 * KoD sent
 */
void
record_sys_stats(void)
{
	l_fp	now;
	u_long	day;

	if (!stats_control)
		return;

	get_systime(&now);
	filegen_setup(&sysstats, now.l_ui);
	day = now.l_ui / 86400 + MJD_1900;
	now.l_ui %= 86400;
	if (sysstats.fp != NULL) {
		fprintf(sysstats.fp,
		    "%lu %s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",
		    day, ulfptoa(&now, 3), current_time - sys_stattime,
		    sys_received, sys_processed, sys_newversion,
		    sys_oldversion, sys_restricted, sys_badlength,
		    sys_badauth, sys_declined, sys_limitrejected,
		    sys_kodsent);
		fflush(sysstats.fp);
		proto_clr_stats();
	}
}


/*
 * record_proto_stats - write system statistics to file
 *
 * file format
 * day (MJD)
 * time (s past midnight)
 * text message
 */
void
record_proto_stats(
	char	*str		/* text string */
	)
{
	l_fp	now;
	u_long	day;

	if (!stats_control)
		return;

	get_systime(&now);
	filegen_setup(&protostats, now.l_ui);
	day = now.l_ui / 86400 + MJD_1900;
	now.l_ui %= 86400;
	if (protostats.fp != NULL) {
		fprintf(protostats.fp, "%lu %s %s\n", day,
		    ulfptoa(&now, 3), str);
		fflush(protostats.fp);
	}
}


#ifdef OPENSSL
/*
 * record_crypto_stats - write crypto statistics to file
 *
 * file format:
 * day (mjd)
 * time (s past midnight)
 * peer ip address
 * text message
 */
void
record_crypto_stats(
	sockaddr_u *addr,
	const char *text	/* text message */
	)
{
	l_fp	now;
	u_long	day;

	if (!stats_control)
		return;

	get_systime(&now);
	filegen_setup(&cryptostats, now.l_ui);
	day = now.l_ui / 86400 + MJD_1900;
	now.l_ui %= 86400;
	if (cryptostats.fp != NULL) {
		if (addr == NULL)
			fprintf(cryptostats.fp, "%lu %s 0.0.0.0 %s\n",
			    day, ulfptoa(&now, 3), text);
		else
			fprintf(cryptostats.fp, "%lu %s %s %s\n",
			    day, ulfptoa(&now, 3), stoa(addr), text);
		fflush(cryptostats.fp);
	}
}
#endif /* OPENSSL */


#ifdef DEBUG_TIMING
/*
 * record_timing_stats - write timing statistics to file
 *
 * file format:
 * day (mjd)
 * time (s past midnight)
 * text message
 */
void
record_timing_stats(
	const char *text	/* text message */
	)
{
	static unsigned int flshcnt;
	l_fp	now;
	u_long	day;

	if (!stats_control)
		return;

	get_systime(&now);
	filegen_setup(&timingstats, now.l_ui);
	day = now.l_ui / 86400 + MJD_1900;
	now.l_ui %= 86400;
	if (timingstats.fp != NULL) {
		fprintf(timingstats.fp, "%lu %s %s\n", day, lfptoa(&now,
		    3), text);
		if (++flshcnt % 100 == 0)
			fflush(timingstats.fp);
	}
}
#endif


/*
 * leap_file - read leapseconds file
 *
 * Read the ERTS leapsecond file in NIST text format and extract the
 * NTP seconds of the latest leap and TAI offset after the leap.
 */
static int
leap_file(
	FILE	*fp		/* file handle */
	)
{
	char	buf[NTP_MAXSTRLEN]; /* file line buffer */
	u_long	leap;		/* NTP time at leap */
	u_long	expire;		/* NTP time when file expires */
	int	offset;		/* TAI offset at leap (s) */
	int	i;

	/*
	 * Read and parse the leapseconds file. Empty lines and comments
	 * are ignored. A line beginning with #@ contains the file
	 * expiration time in NTP seconds. Other lines begin with two
	 * integers followed by junk or comments. The first integer is
	 * the NTP seconds at the leap, the second is the TAI offset
	 * after the leap.
 	 */
	offset = 0;
	leap = 0;
	expire = 0;
	i = 10;
	while (fgets(buf, NTP_MAXSTRLEN - 1, fp) != NULL) {
		if (strlen(buf) < 1)
			continue;

		if (buf[0] == '#') {
			if (strlen(buf) < 3)
				continue;

			/*
			 * Note the '@' flag was used only in the 2006
			 * table; previious to that the flag was '$'.
			 */
			if (buf[1] == '@' || buf[1] == '$') {
				if (sscanf(&buf[2], "%lu", &expire) !=
				    1)
					return (-1);

				continue;
			}
		}
		if (sscanf(buf, "%lu %d", &leap, &offset) == 2) {

			/*
			 * Valid offsets must increase by one for each
			 * leap.
			 */
			if (i++ != offset)
				return (-1);
		}
	}

	/*
	 * There must be at least one leap.
	 */
	if (i == 10)
		return (-1);

	leap_tai = offset;
	leap_sec = leap;
	leap_expire = expire;
	return (0);
}


/*
 * leap_month - returns seconds until the end of the month.
 */
u_long
leap_month(
	u_long	sec		/* current NTP second */
	)
{
	u_long	ltemp;
	u_long	*ptr;
	u_long	year[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30,
		    31}; 
	u_long	lyear[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30,
		    31}; 

	/*
	 * Find current leap cycle.
	 */
	ltemp = sec;
	while (ltemp >= L_CENT)
		ltemp -= L_CENT;
	while (ltemp >= L_4YEAR)
		ltemp -= L_4YEAR;

	/*
	 * We are within four years of the target. If in leap year, use
	 * leap year month table; otherwise, use year month table.
	 */
	if (ltemp < L_LYEAR) {
		ptr = lyear;
	} else {
		ptr = year;
		ltemp -= L_LYEAR;
		while (ltemp >= L_YEAR)
			ltemp -= L_YEAR;
	}

	/*
	 * We are within one year of the target. Find the month of the
	 * leap.
	 */
	while (ltemp >= *ptr * L_DAY)
		ltemp -= *ptr++ * L_DAY;

	/*
	 * The result is the number of seconds until the end of the
	 * month when the leap is to occur.
	 */
	return (*ptr * L_DAY - ltemp - L_DAY);
}


/*
 * getauthkeys - read the authentication keys from the specified file
 */
void
getauthkeys(
	const char *keyfile
	)
{
	int len;

	len = strlen(keyfile);
	if (!len)
		return;
	
#ifndef SYS_WINNT
	key_file_name = erealloc(key_file_name, len + 1);
	memmove(key_file_name, keyfile, len + 1);
#else
	key_file_name = erealloc(key_file_name, _MAX_PATH);
	if (len + 1 > _MAX_PATH)
		return;
	if (!ExpandEnvironmentStrings(keyfile, key_file_name,
				      _MAX_PATH)) {
		msyslog(LOG_ERR,
			"ExpandEnvironmentStrings(KEY_FILE) failed: %m");
		strncpy(key_file_name, keyfile, _MAX_PATH);
	}
#endif /* SYS_WINNT */

	authreadkeys(key_file_name);
}


/*
 * rereadkeys - read the authentication key file over again.
 */
void
rereadkeys(void)
{
	if (NULL != key_file_name)
		authreadkeys(key_file_name);
}


/*
 * sock_hash - hash a sockaddr_u structure
 */
u_short
sock_hash(
	sockaddr_u *addr
	)
{
	u_int hashVal;
	u_int j;
	size_t len;
	u_char *pch;
	hashVal = 0;
	len = 0;

	/*
	 * We can't just hash the whole thing because there are hidden
	 * fields in sockaddr_in6 that might be filled in by recvfrom(),
	 * so just use the family, port and address.
	 */
	pch = (u_char *)&AF(addr);
	hashVal = 37 * hashVal + *pch;
	if (sizeof(AF(addr)) > 1) {
		pch++;
		hashVal = 37 * hashVal + *pch;
	}
	switch(AF(addr)) {
	case AF_INET:
		pch = (u_char *)&SOCK_ADDR4(addr);
		len = sizeof(SOCK_ADDR4(addr));
		break;

	case AF_INET6:
		pch = (u_char *)&SOCK_ADDR6(addr);
		len = sizeof(SOCK_ADDR6(addr));
		break;
	}

	for (j = 0; j < len ; j++)
		hashVal = 37 * hashVal + pch[j];

	hashVal = hashVal & NTP_HASH_MASK;

	return (u_short)hashVal;
}


#if notyet
/*
 * ntp_exit - document explicitly that ntpd has exited
 */
void
ntp_exit(int retval)
{
	msyslog(LOG_ERR, "EXITING with return code %d", retval);
	exit(retval);
}
#endif

/*
 * fstostr - prettyprint NTP seconds
 */
char * fstostr(
	time_t	ntp_stamp
	)
{
	static char	str[20];
	struct tm *	tm;
	time_t		unix_stamp;

	unix_stamp = ntp_stamp - JAN_1970;
	tm = gmtime(&unix_stamp);
	if (NULL != tm)
		snprintf(str, sizeof(str),
			 "%04d%02d%02d%02d%02d",
			 tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
			 tm->tm_hour, tm->tm_min);
	else
		strcpy(str, "gmtime() error");

	return str;
}
ntp-4.2.6p5/ntpd/refclock_heath.c0000644000175000017500000003210011332473272015663 0ustar  peterpeter/*
 * refclock_heath - clock driver for Heath GC-1000
 * (but no longer the GC-1001 Model II, which apparently never worked)
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_HEATH)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"

#include 
#include 

#ifdef HAVE_SYS_IOCTL_H
# include 
#endif /* not HAVE_SYS_IOCTL_H */

/*
 * This driver supports the Heath GC-1000 Most Accurate Clock, with
 * RS232C Output Accessory. This is a WWV/WWVH receiver somewhat less
 * robust than other supported receivers. Its claimed accuracy is 100 ms
 * when actually synchronized to the broadcast signal, but this doesn't
 * happen even most of the time, due to propagation conditions, ambient
 * noise sources, etc. When not synchronized, the accuracy is at the
 * whim of the internal clock oscillator, which can wander into the
 * sunset without warning. Since the indicated precision is 100 ms,
 * expect a host synchronized only to this thing to wander to and fro,
 * occasionally being rudely stepped when the offset exceeds the default
 * clock_max of 128 ms. 
 *
 * There were two GC-1000 versions supported by this driver. The original
 * GC-1000 with RS-232 output first appeared in 1983, but dissapeared
 * from the market a few years later. The GC-1001 II with RS-232 output
 * first appeared circa 1990, but apparently is no longer manufactured.
 * The two models differ considerably, both in interface and commands.
 * The GC-1000 has a pseudo-bipolar timecode output triggered by a RTS
 * transition. The timecode includes both the day of year and time of
 * day. The GC-1001 II has a true bipolar output and a complement of
 * single character commands. The timecode includes only the time of
 * day.
 *
 * The GC-1001 II was apparently never tested and, based on a Coverity
 * scan, apparently never worked [Bug 689].  Related code has been disabled.
 *
 * GC-1000
 *
 * The internal DIPswitches should be set to operate in MANUAL mode. The
 * external DIPswitches should be set to GMT and 24-hour format.
 *
 * In MANUAL mode the clock responds to a rising edge of the request to
 * send (RTS) modem control line by sending the timecode. Therefore, it
 * is necessary that the operating system implement the TIOCMBIC and
 * TIOCMBIS ioctl system calls and TIOCM_RTS control bit. Present
 * restrictions require the use of a POSIX-compatible programming
 * interface, although other interfaces may work as well.
 *
 * A simple hardware modification to the clock can be made which
 * prevents the clock hearing the request to send (RTS) if the HI SPEC
 * lamp is out. Route the HISPEC signal to the tone decoder board pin
 * 19, from the display, pin 19. Isolate pin 19 of the decoder board
 * first, but maintain connection with pin 10. Also isolate pin 38 of
 * the CPU on the tone board, and use half an added 7400 to gate the
 * original signal to pin 38 with that from pin 19.
 *
 * The clock message consists of 23 ASCII printing characters in the
 * following format:
 *
 * hh:mm:ss.f AM  dd/mm/yr
 *
 *	hh:mm:ss.f = hours, minutes, seconds
 *	f = deciseconds ('?' when out of spec)
 *	AM/PM/bb = blank in 24-hour mode
 *	dd/mm/yr = day, month, year
 *
 * The alarm condition is indicated by '?', rather than a digit, at f.
 * Note that 0?:??:??.? is displayed before synchronization is first
 * established and hh:mm:ss.? once synchronization is established and
 * then lost again for about a day.
 *
 * GC-1001 II
 *
 * Commands consist of a single letter and are case sensitive. When
 * enterred in lower case, a description of the action performed is
 * displayed. When enterred in upper case the action is performed.
 * Following is a summary of descriptions as displayed by the clock:
 *
 * The clock responds with a command The 'A' command returns an ASCII
 * local time string:  HH:MM:SS.T xx, where
 *
 *	HH = hours
 *	MM = minutes
 *	SS = seconds
 *	T = tenths-of-seconds
 *	xx = 'AM', 'PM', or '  '
 *	 = carriage return
 *
 * The 'D' command returns 24 pairs of bytes containing the variable
 * divisor value at the end of each of the previous 24 hours. This
 * allows the timebase trimming process to be observed.  UTC hour 00 is
 * always returned first. The first byte of each pair is the high byte
 * of (variable divisor * 16); the second byte is the low byte of
 * (variable divisor * 16). For example, the byte pair 3C 10 would be
 * returned for a divisor of 03C1 hex (961 decimal).
 *
 * The 'I' command returns:  | TH | TL | ER | DH | DL | U1 | I1 | I2 | ,
 * where
 *
 *	TH = minutes since timebase last trimmed (high byte)
 *	TL = minutes since timebase last trimmed (low byte)
 *	ER = last accumulated error in 1.25 ms increments
 *	DH = high byte of (current variable divisor * 16)
 *	DL = low byte of (current variable divisor * 16)
 *	U1 = UT1 offset (/.1 s):  | + | 4 | 2 | 1 | 0 | 0 | 0 | 0 |
 *	I1 = information byte 1:  | W | C | D | I | U | T | Z | 1 | ,
 *	     where
 *
 *		W = set by WWV(H)
 *		C = CAPTURE LED on
 *		D = TRIM DN LED on
 *		I = HI SPEC LED on
 *		U = TRIM UP LED on
 *		T = DST switch on
 *		Z = UTC switch on
 *		1 = UT1 switch on
 *
 *	I2 = information byte 2:  | 8 | 8 | 4 | 2 | 1 | D | d | S | ,
 *	     where
 *
 *		8, 8, 4, 2, 1 = TIME ZONE switch settings
 *		D = DST bit (#55) in last-received frame
 *		d = DST bit (#2) in last-received frame
 *		S = clock is in simulation mode
 *
 * The 'P' command returns 24 bytes containing the number of frames
 * received without error during UTC hours 00 through 23, providing an
 * indication of hourly propagation.  These bytes are updated each hour
 * to reflect the previous 24 hour period.  UTC hour 00 is always
 * returned first.
 *
 * The 'T' command returns the UTC time:  | HH | MM | SS | T0 | , where
 *	HH = tens-of-hours and hours (packed BCD)
 *	MM = tens-of-minutes and minutes (packed BCD)
 *	SS = tens-of-seconds and seconds (packed BCD)
 *	T = tenths-of-seconds (BCD)
 *
 * Fudge Factors
 *
 * A fudge time1 value of .04 s appears to center the clock offset
 * residuals. The fudge time2 parameter is the local time offset east of
 * Greenwich, which depends on DST. Sorry about that, but the clock
 * gives no hint on what the DIPswitches say.
 */

/*
 * Interface definitions
 */
#define	DEVICE		"/dev/heath%d" /* device name and unit */
#define	PRECISION	(-4)	/* precision assumed (about 100 ms) */
#define	REFID		"WWV\0"	/* reference ID */
#define	DESCRIPTION	"Heath GC-1000 Most Accurate Clock" /* WRU */

#define LENHEATH1	23	/* min timecode length */
#if 0	/* BUG 689 */
#define LENHEATH2	13	/* min timecode length */
#endif

/*
 * Tables to compute the ddd of year form icky dd/mm timecode. Viva la
 * leap.
 */
static int day1tab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
static int day2tab[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/*
 * Baud rate table. The GC-1000 supports 1200, 2400 and 4800; the
 * GC-1001 II supports only 9600.
 */
static int speed[] = {B1200, B2400, B4800, B9600};

/*
 * Function prototypes
 */
static	int	heath_start	(int, struct peer *);
static	void	heath_shutdown	(int, struct peer *);
static	void	heath_receive	(struct recvbuf *);
static	void	heath_poll	(int, struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_heath = {
	heath_start,		/* start up driver */
	heath_shutdown,		/* shut down driver */
	heath_poll,		/* transmit poll message */
	noentry,		/* not used (old heath_control) */
	noentry,		/* initialize driver */
	noentry,		/* not used (old heath_buginfo) */
	NOFLAGS			/* not used */
};


/*
 * heath_start - open the devices and initialize data for processing
 */
static int
heath_start(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	int fd;
	char device[20];

	/*
	 * Open serial port
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
	if (!(fd = refclock_open(device, speed[peer->ttl & 0x3],
	    LDISC_REMOTE)))
		return (0);
	pp = peer->procptr;
	pp->io.clock_recv = heath_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		pp->io.fd = -1;
		return (0);
	}

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	peer->burst = NSTAGE;
	pp->clockdesc = DESCRIPTION;
	memcpy(&pp->refid, REFID, 4);
	return (1);
}


/*
 * heath_shutdown - shut down the clock
 */
static void
heath_shutdown(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;

	pp = peer->procptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
}


/*
 * heath_receive - receive data from the serial interface
 */
static void
heath_receive(
	struct recvbuf *rbufp
	)
{
	struct refclockproc *pp;
	struct peer *peer;
	l_fp trtmp;
	int month, day;
	int i;
	char dsec, a[5];

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX,
	    &trtmp);

	/*
	 * We get down to business, check the timecode format and decode
	 * its contents. If the timecode has invalid length or is not in
	 * proper format, we declare bad format and exit.
	 */
	switch (pp->lencode) {

	/*
	 * GC-1000 timecode format: "hh:mm:ss.f AM  mm/dd/yy"
	 * GC-1001 II timecode format: "hh:mm:ss.f   "
	 */
	case LENHEATH1:
		if (sscanf(pp->a_lastcode,
		    "%2d:%2d:%2d.%c%5c%2d/%2d/%2d", &pp->hour,
		    &pp->minute, &pp->second, &dsec, a, &month, &day,
		    &pp->year) != 8) {
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		}
		break;

#if 0	/* BUG 689 */
	/*
	 * GC-1001 II timecode format: "hh:mm:ss.f   "
	 */
	case LENHEATH2:
		if (sscanf(pp->a_lastcode, "%2d:%2d:%2d.%c", &pp->hour,
		    &pp->minute, &pp->second, &dsec) != 4) {
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		} else {
			struct tm *tm_time_p;
			time_t     now;

			time(&now);	/* we should grab 'now' earlier */
			tm_time_p = gmtime(&now);
			/*
			 * There is a window of time around midnight
			 * where this will Do The Wrong Thing.
			 */
			if (tm_time_p) {
				month = tm_time_p->tm_mon + 1;
				day = tm_time_p->tm_mday;
			} else {
				refclock_report(peer, CEVNT_FAULT);
				return;
			}
		}
		break;
#endif

	default:
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	/*
	 * We determine the day of the year from the DIPswitches. This
	 * should be fixed, since somebody might forget to set them.
	 * Someday this hazard will be fixed by a fiendish scheme that
	 * looks at the timecode and year the radio shows, then computes
	 * the residue of the seconds mod the seconds in a leap cycle.
	 * If in the third year of that cycle and the third and later
	 * months of that year, add one to the day. Then, correct the
	 * timecode accordingly. Icky pooh. This bit of nonsense could
	 * be avoided if the engineers had been required to write a
	 * device driver before finalizing the timecode format.
	 */
	if (month < 1 || month > 12 || day < 1) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	if (pp->year % 4) {
		if (day > day1tab[month - 1]) {
			refclock_report(peer, CEVNT_BADTIME);
			return;
		}
		for (i = 0; i < month - 1; i++)
		    day += day1tab[i];
	} else {
		if (day > day2tab[month - 1]) {
			refclock_report(peer, CEVNT_BADTIME);
			return;
		}
		for (i = 0; i < month - 1; i++)
		    day += day2tab[i];
	}
	pp->day = day;

	/*
	 * Determine synchronization and last update
	 */
	if (!isdigit((int)dsec))
		pp->leap = LEAP_NOTINSYNC;
	else {
		pp->nsec = (dsec - '0') * 100000000;
		pp->leap = LEAP_NOWARNING;
	}
	if (!refclock_process(pp))
		refclock_report(peer, CEVNT_BADTIME);
}


/*
 * heath_poll - called by the transmit procedure
 */
static void
heath_poll(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	int bits = TIOCM_RTS;

	/*
	 * At each poll we check for timeout and toggle the RTS modem
	 * control line, then take a timestamp. Presumably, this is the
	 * event the radio captures to generate the timecode.
	 * Apparently, the radio takes about a second to make up its
	 * mind to send a timecode, so the receive timestamp is
	 * worthless.
	 */
	pp = peer->procptr;

	/*
	 * We toggle the RTS modem control lead (GC-1000) and sent a T
	 * (GC-1001 II) to kick a timecode loose from the radio. This
	 * code works only for POSIX and SYSV interfaces. With bsd you
	 * are on your own. We take a timestamp between the up and down
	 * edges to lengthen the pulse, which should be about 50 usec on
	 * a Sun IPC. With hotshot CPUs, the pulse might get too short.
	 * Later.
	 *
	 * Bug 689: Even though we no longer support the GC-1001 II,
	 * I'm leaving the 'T' write in for timing purposes.
	 */
	if (ioctl(pp->io.fd, TIOCMBIC, (char *)&bits) < 0)
		refclock_report(peer, CEVNT_FAULT);
	get_systime(&pp->lastrec);
	if (write(pp->io.fd, "T", 1) != 1)
		refclock_report(peer, CEVNT_FAULT);
	ioctl(pp->io.fd, TIOCMBIS, (char *)&bits);
	if (peer->burst > 0)
		return;
	if (pp->coderecv == pp->codeproc) {
		refclock_report(peer, CEVNT_TIMEOUT);
		return;
	}
	pp->lastref = pp->lastrec;
	refclock_receive(peer);
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
#ifdef DEBUG
	if (debug)
	    printf("heath: timecode %d %s\n", pp->lencode,
		   pp->a_lastcode);
#endif
	peer->burst = MAXSTAGE;
	pp->polls++;
}

#else
int refclock_heath_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/ntpd-opts.def0000644000175000017500000000032510544731227015173 0ustar  peterpeter/* -*- Mode: Text -*- */

autogen definitions options;

#include copyright.def

prog-name      = "ntpd";
prog-title     = "NTP daemon program";

#include ntpdbase-opts.def

detail = <<-  _END_DETAIL
	_END_DETAIL;
ntp-4.2.6p5/ntpd/ntp_signd.c0000644000175000017500000001245611307651604014722 0ustar  peterpeter/* Copyright 2008, Red Hat, Inc.
   Copyright 2008, Andrew Tridgell.
   Licenced under the same terms as NTP itself. 
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#ifdef HAVE_NTP_SIGND

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_stdlib.h"
#include "ntp_unixtime.h"
#include "ntp_control.h"
#include "ntp_string.h"

#include 
#include 
#ifdef HAVE_LIBSCF_H
#include 
#include 
#endif /* HAVE_LIBSCF_H */

#include 

/* socket routines by tridge - from junkcode.samba.org */

/*
  connect to a unix domain socket
*/
static int 
ux_socket_connect(const char *name)
{
	int fd;
        struct sockaddr_un addr;
	if (!name) {
		return -1;
	}

        memset(&addr, 0, sizeof(addr));
        addr.sun_family = AF_UNIX;
        strncpy(addr.sun_path, name, sizeof(addr.sun_path));

	fd = socket(AF_UNIX, SOCK_STREAM, 0);
	if (fd == -1) {
		return -1;
	}
	
	if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
		close(fd);
		return -1;
	}

	return fd;
}


/*
  keep writing until its all sent
*/
static int 
write_all(int fd, const void *buf, size_t len)
{
	size_t total = 0;
	while (len) {
		int n = write(fd, buf, len);
		if (n <= 0) return total;
		buf = n + (char *)buf;
		len -= n;
		total += n;
	}
	return total;
}

/*
  keep reading until its all read
*/
static int 
read_all(int fd, void *buf, size_t len)
{
	size_t total = 0;
	while (len) {
		int n = read(fd, buf, len);
		if (n <= 0) return total;
		buf = n + (char *)buf;
		len -= n;
		total += n;
	}
	return total;
}

/*
  send a packet in length prefix format
*/
static int 
send_packet(int fd, const char *buf, uint32_t len)
{
	uint32_t net_len = htonl(len);
	if (write_all(fd, &net_len, sizeof(net_len)) != sizeof(net_len)) return -1;
	if (write_all(fd, buf, len) != len) return -1;	
	return 0;
}

/*
  receive a packet in length prefix format
*/
static int 
recv_packet(int fd, char **buf, uint32_t *len)
{
	if (read_all(fd, len, sizeof(*len)) != sizeof(*len)) return -1;
	*len = ntohl(*len);
	(*buf) = emalloc(*len);
	if (read_all(fd, *buf, *len) != *len) {
		free(*buf);
		return -1;
	}
	return 0;
}

void 
send_via_ntp_signd(
	struct recvbuf *rbufp,	/* receive packet pointer */
	int	xmode,
	keyid_t	xkeyid, 
	int flags,
	struct pkt  *xpkt
	)
{
	
	/* We are here because it was detected that the client
	 * sent an all-zero signature, and we therefore know
	 * it's windows trying to talk to an AD server
	 *
	 * Because we don't want to dive into Samba's secrets
	 * database just to find the long-term kerberos key
	 * that is re-used as the NTP key, we instead hand the
	 * packet over to Samba to sign, and return to us.
	 *
	 * The signing method Samba will use is described by
	 * Microsoft in MS-SNTP, found here:
	 * http://msdn.microsoft.com/en-us/library/cc212930.aspx
	 */
	
	int fd, sendlen;
	struct samba_key_in {
		uint32_t version;
		uint32_t op;
		uint32_t packet_id;
		uint32_t key_id_le;
		struct pkt pkt;
	} samba_pkt;
	
	struct samba_key_out {
		uint32_t version;
		uint32_t op;
		uint32_t packet_id;
		struct pkt pkt;
	} samba_reply;
	
	char full_socket[256];

	char *reply = NULL;
	uint32_t reply_len;
	
	memset(&samba_pkt, 0, sizeof(samba_pkt));
	samba_pkt.op = 0; /* Sign message */
	/* This will be echoed into the reply - a different
	 * impelementation might want multiple packets
	 * awaiting signing */

	samba_pkt.packet_id = 1;

	/* Swap the byte order back - it's actually little
	 * endian on the wire, but it was read above as
	 * network byte order */
	samba_pkt.key_id_le = htonl(xkeyid);
	samba_pkt.pkt = *xpkt;

	snprintf(full_socket, sizeof(full_socket), "%s/socket", ntp_signd_socket);

	fd = ux_socket_connect(full_socket);
	/* Only continue with this if we can talk to Samba */
	if (fd != -1) {
		/* Send old packet to Samba, expect response */
		/* Packet to Samba is quite simple: 
		   All values BIG endian except key ID as noted
		   [packet size as BE] - 4 bytes
		   [protocol version (0)] - 4 bytes
		   [packet ID] - 4 bytes
		   [operation (sign message=0)] - 4 bytes
		   [key id] - LITTLE endian (as on wire) - 4 bytes
		   [message to sign] - as marshalled, without signature
		*/
			
		if (send_packet(fd, (char *)&samba_pkt, offsetof(struct samba_key_in, pkt) + LEN_PKT_NOMAC) != 0) {
			/* Huh?  could not talk to Samba... */
			close(fd);
			return;
		}
			
		if (recv_packet(fd, &reply, &reply_len) != 0) {
			if (reply) {
				free(reply);
			}
			close(fd);
			return;
		}
		/* Return packet is also simple: 
		   [packet size] - network byte order - 4 bytes
		   [protocol version (0)] network byte order - - 4 bytes
		   [operation (signed success=3, failure=4)] network byte order - - 4 byte
		   (optional) [signed message] - as provided before, with signature appended
		*/
			
		if (reply_len <= sizeof(samba_reply)) {
			memcpy(&samba_reply, reply, reply_len);
			if (ntohl(samba_reply.op) == 3 && reply_len >  offsetof(struct samba_key_out, pkt)) {
				sendlen = reply_len - offsetof(struct samba_key_out, pkt);
				xpkt = &samba_reply.pkt;
				sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, 0, xpkt, sendlen);
#ifdef DEBUG
				if (debug)
					printf(
						"transmit ntp_signd packet: at %ld %s->%s mode %d keyid %08x len %d\n",
						current_time, ntoa(&rbufp->dstadr->sin),
						ntoa(&rbufp->recv_srcadr), xmode, xkeyid, sendlen);
#endif
			}
		}
		
		if (reply) {
			free(reply);
		}
		close(fd);
		
	}
}
#endif
ntp-4.2.6p5/ntpd/ntpd-opts.h0000644000175000017500000002675411675460550014706 0ustar  peterpeter/*  
 *  EDIT THIS FILE WITH CAUTION  (ntpd-opts.h)
 *  
 *  It has been AutoGen-ed  December 24, 2011 at 06:34:00 PM by AutoGen 5.12
 *  From the definitions    ntpd-opts.def
 *  and the template file   options
 *
 * Generated from AutoOpts 35:0:10 templates.
 *
 *  AutoOpts is a copyrighted work.  This header file is not encumbered
 *  by AutoOpts licensing, but is provided under the licensing terms chosen
 *  by the ntpd author or copyright holder.  AutoOpts is
 *  licensed under the terms of the LGPL.  The redistributable library
 *  (``libopts'') is licensed under the terms of either the LGPL or, at the
 *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
 *  for details.
 *
 * This source file is copyrighted and licensed under the following terms:
 *
 *  see html/copyright.html
 *  
 */
/*
 *  This file contains the programmatic interface to the Automated
 *  Options generated for the ntpd program.
 *  These macros are documented in the AutoGen info file in the
 *  "AutoOpts" chapter.  Please refer to that doc for usage help.
 */
#ifndef AUTOOPTS_NTPD_OPTS_H_GUARD
#define AUTOOPTS_NTPD_OPTS_H_GUARD 1
#include "config.h"
#include 

/*
 *  Ensure that the library used for compiling this generated header is at
 *  least as new as the version current when the header template was released
 *  (not counting patch version increments).  Also ensure that the oldest
 *  tolerable version is at least as old as what was current when the header
 *  template was released.
 */
#define AO_TEMPLATE_VERSION 143360
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
  Choke Me.
#endif

/*
 *  Enumeration of each option:
 */
typedef enum {
    INDEX_OPT_IPV4              =  0,
    INDEX_OPT_IPV6              =  1,
    INDEX_OPT_AUTHREQ           =  2,
    INDEX_OPT_AUTHNOREQ         =  3,
    INDEX_OPT_BCASTSYNC         =  4,
    INDEX_OPT_CONFIGFILE        =  5,
    INDEX_OPT_DEBUG_LEVEL       =  6,
    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_SLEW              = 29,
    INDEX_OPT_USEPCC            = 30,
    INDEX_OPT_PCCFREQ           = 31,
    INDEX_OPT_VERSION           = 32,
    INDEX_OPT_HELP              = 33,
    INDEX_OPT_MORE_HELP         = 34
} teOptIndex;

#define OPTION_CT    35
#define NTPD_VERSION       "4.2.6p5"
#define NTPD_FULL_VERSION  "ntpd 4.2.6p5"

/*
 *  Interface defines for all options.  Replace "n" with the UPPER_CASED
 *  option name (as in the teOptIndex enumeration above).
 *  e.g. HAVE_OPT(IPV4)
 */
#define         DESC(n) (ntpdOptions.pOptDesc[INDEX_OPT_## n])
#define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
#define      OPT_ARG(n) (DESC(n).optArg.argString)
#define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
#define    COUNT_OPT(n) (DESC(n).optOccCt)
#define    ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
#define  ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
#define  STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
#define    CLEAR_OPT(n) STMTS( \
                DESC(n).fOptState &= OPTST_PERSISTENT_MASK;   \
                if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
                    DESC(n).fOptState |= OPTST_DISABLED; \
                DESC(n).optCookie = NULL )

/* * * * * *
 *
 *  Enumeration of ntpd exit codes
 */
typedef enum {
    NTPD_EXIT_SUCCESS = 0,
    NTPD_EXIT_FAILURE = 1
} ntpd_exit_code_t;
/*
 *  Make sure there are no #define name conflicts with the option names
 */
#ifndef     NO_OPTION_NAME_WARNINGS
# ifdef    IPV4
#  warning undefining IPV4 due to option name conflict
#  undef   IPV4
# endif
# ifdef    IPV6
#  warning undefining IPV6 due to option name conflict
#  undef   IPV6
# endif
# ifdef    AUTHREQ
#  warning undefining AUTHREQ due to option name conflict
#  undef   AUTHREQ
# endif
# ifdef    AUTHNOREQ
#  warning undefining AUTHNOREQ due to option name conflict
#  undef   AUTHNOREQ
# endif
# ifdef    BCASTSYNC
#  warning undefining BCASTSYNC due to option name conflict
#  undef   BCASTSYNC
# endif
# ifdef    CONFIGFILE
#  warning undefining CONFIGFILE due to option name conflict
#  undef   CONFIGFILE
# endif
# ifdef    DEBUG_LEVEL
#  warning undefining DEBUG_LEVEL due to option name conflict
#  undef   DEBUG_LEVEL
# endif
# ifdef    SET_DEBUG_LEVEL
#  warning undefining SET_DEBUG_LEVEL due to option name conflict
#  undef   SET_DEBUG_LEVEL
# endif
# ifdef    DRIFTFILE
#  warning undefining DRIFTFILE due to option name conflict
#  undef   DRIFTFILE
# endif
# ifdef    PANICGATE
#  warning undefining PANICGATE due to option name conflict
#  undef   PANICGATE
# endif
# ifdef    JAILDIR
#  warning undefining JAILDIR due to option name conflict
#  undef   JAILDIR
# endif
# ifdef    INTERFACE
#  warning undefining INTERFACE due to option name conflict
#  undef   INTERFACE
# endif
# ifdef    KEYFILE
#  warning undefining KEYFILE due to option name conflict
#  undef   KEYFILE
# endif
# ifdef    LOGFILE
#  warning undefining LOGFILE due to option name conflict
#  undef   LOGFILE
# endif
# ifdef    NOVIRTUALIPS
#  warning undefining NOVIRTUALIPS due to option name conflict
#  undef   NOVIRTUALIPS
# endif
# ifdef    MODIFYMMTIMER
#  warning undefining MODIFYMMTIMER due to option name conflict
#  undef   MODIFYMMTIMER
# endif
# ifdef    NOFORK
#  warning undefining NOFORK due to option name conflict
#  undef   NOFORK
# endif
# ifdef    NICE
#  warning undefining NICE due to option name conflict
#  undef   NICE
# endif
# ifdef    PIDFILE
#  warning undefining PIDFILE due to option name conflict
#  undef   PIDFILE
# endif
# ifdef    PRIORITY
#  warning undefining PRIORITY due to option name conflict
#  undef   PRIORITY
# endif
# ifdef    QUIT
#  warning undefining QUIT due to option name conflict
#  undef   QUIT
# endif
# ifdef    PROPAGATIONDELAY
#  warning undefining PROPAGATIONDELAY due to option name conflict
#  undef   PROPAGATIONDELAY
# endif
# ifdef    SAVECONFIGQUIT
#  warning undefining SAVECONFIGQUIT due to option name conflict
#  undef   SAVECONFIGQUIT
# endif
# ifdef    STATSDIR
#  warning undefining STATSDIR due to option name conflict
#  undef   STATSDIR
# endif
# ifdef    TRUSTEDKEY
#  warning undefining TRUSTEDKEY due to option name conflict
#  undef   TRUSTEDKEY
# endif
# ifdef    USER
#  warning undefining USER due to option name conflict
#  undef   USER
# endif
# ifdef    UPDATEINTERVAL
#  warning undefining UPDATEINTERVAL due to option name conflict
#  undef   UPDATEINTERVAL
# endif
# ifdef    VAR
#  warning undefining VAR due to option name conflict
#  undef   VAR
# endif
# ifdef    DVAR
#  warning undefining DVAR due to option name conflict
#  undef   DVAR
# endif
# ifdef    SLEW
#  warning undefining SLEW due to option name conflict
#  undef   SLEW
# endif
# ifdef    USEPCC
#  warning undefining USEPCC due to option name conflict
#  undef   USEPCC
# endif
# ifdef    PCCFREQ
#  warning undefining PCCFREQ due to option name conflict
#  undef   PCCFREQ
# endif
#else  /* NO_OPTION_NAME_WARNINGS */
# undef IPV4
# undef IPV6
# undef AUTHREQ
# undef AUTHNOREQ
# undef BCASTSYNC
# undef CONFIGFILE
# undef DEBUG_LEVEL
# undef SET_DEBUG_LEVEL
# undef DRIFTFILE
# undef PANICGATE
# undef JAILDIR
# undef INTERFACE
# undef KEYFILE
# undef LOGFILE
# undef NOVIRTUALIPS
# undef MODIFYMMTIMER
# undef NOFORK
# undef NICE
# undef PIDFILE
# undef PRIORITY
# undef QUIT
# undef PROPAGATIONDELAY
# undef SAVECONFIGQUIT
# undef STATSDIR
# undef TRUSTEDKEY
# undef USER
# undef UPDATEINTERVAL
# undef VAR
# undef DVAR
# undef SLEW
# undef USEPCC
# undef PCCFREQ
#endif  /*  NO_OPTION_NAME_WARNINGS */

/* * * * * *
 *
 *  Interface defines for specific options.
 */
#define VALUE_OPT_IPV4           '4'
#define VALUE_OPT_IPV6           '6'
#define VALUE_OPT_AUTHREQ        'a'
#define VALUE_OPT_AUTHNOREQ      'A'
#define VALUE_OPT_BCASTSYNC      'b'
#define VALUE_OPT_CONFIGFILE     'c'
#define VALUE_OPT_DEBUG_LEVEL    'd'
#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
#define VALUE_OPT_DRIFTFILE      'f'
#define VALUE_OPT_PANICGATE      'g'
#define VALUE_OPT_JAILDIR        'i'
#define VALUE_OPT_INTERFACE      'I'
#define VALUE_OPT_KEYFILE        'k'
#define VALUE_OPT_LOGFILE        'l'
#define VALUE_OPT_NOVIRTUALIPS   'L'
#define VALUE_OPT_MODIFYMMTIMER  'M'
#define VALUE_OPT_NOFORK         'n'
#define VALUE_OPT_NICE           'N'
#define VALUE_OPT_PIDFILE        'p'
#define VALUE_OPT_PRIORITY       'P'

#define OPT_VALUE_PRIORITY       (DESC(PRIORITY).optArg.argInt)
#define VALUE_OPT_QUIT           'q'
#define VALUE_OPT_PROPAGATIONDELAY 'r'
#define VALUE_OPT_SAVECONFIGQUIT 22
#define VALUE_OPT_STATSDIR       's'
#define VALUE_OPT_TRUSTEDKEY     't'
#define VALUE_OPT_USER           'u'
#define VALUE_OPT_UPDATEINTERVAL 'U'

#define OPT_VALUE_UPDATEINTERVAL (DESC(UPDATEINTERVAL).optArg.argInt)
#define VALUE_OPT_VAR            27
#define VALUE_OPT_DVAR           28
#define VALUE_OPT_SLEW           'x'
#define VALUE_OPT_USEPCC         30
#define VALUE_OPT_PCCFREQ        31
#define VALUE_OPT_HELP          '?'
#define VALUE_OPT_MORE_HELP     '!'
#define VALUE_OPT_VERSION       INDEX_OPT_VERSION
/*
 *  Interface defines not associated with particular options
 */
#define ERRSKIP_OPTERR  STMTS(ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP)
#define ERRSTOP_OPTERR  STMTS(ntpdOptions.fOptSet |= OPTPROC_ERRSTOP)
#define RESTART_OPT(n)  STMTS( \
                ntpdOptions.curOptIdx = (n); \
                ntpdOptions.pzCurOpt  = NULL)
#define START_OPT       RESTART_OPT(1)
#define USAGE(c)        (*ntpdOptions.pUsageProc)(&ntpdOptions, c)
/* extracted from opthead.tlib near line 451 */

#ifdef  __cplusplus
extern "C" {
#endif

/* * * * * *
 *
 *  Declare the ntpd option descriptor.
 */
extern tOptions ntpdOptions;

#if defined(ENABLE_NLS)
# ifndef _
#   include 
static inline char* aoGetsText(char const* pz) {
    if (pz == NULL) return NULL;
    return (char*)gettext(pz);
}
#   define _(s)  aoGetsText(s)
# endif /* _() */

# define OPT_NO_XLAT_CFG_NAMES  STMTS(ntpdOptions.fOptSet |= \
                                    OPTPROC_NXLAT_OPT_CFG;)
# define OPT_NO_XLAT_OPT_NAMES  STMTS(ntpdOptions.fOptSet |= \
                                    OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)

# define OPT_XLAT_CFG_NAMES     STMTS(ntpdOptions.fOptSet &= \
                                  ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
# define OPT_XLAT_OPT_NAMES     STMTS(ntpdOptions.fOptSet &= \
                                  ~OPTPROC_NXLAT_OPT;)

#else   /* ENABLE_NLS */
# define OPT_NO_XLAT_CFG_NAMES
# define OPT_NO_XLAT_OPT_NAMES

# define OPT_XLAT_CFG_NAMES
# define OPT_XLAT_OPT_NAMES

# ifndef _
#   define _(_s)  _s
# endif
#endif  /* ENABLE_NLS */

#ifdef  __cplusplus
}
#endif
#endif /* AUTOOPTS_NTPD_OPTS_H_GUARD */
/* ntpd-opts.h ends here */
ntp-4.2.6p5/ntpd/refclock_pcf.c0000644000175000017500000001146411332473273015355 0ustar  peterpeter/*
 * refclock_pcf - clock driver for the Conrad parallel port radio clock
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_PCF)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_calendar.h"
#include "ntp_stdlib.h"

/*
 * This driver supports the parallel port radio clock sold by Conrad
 * Electronic under order numbers 967602 and 642002.
 *
 * It requires that the local timezone be CET/CEST and that the pcfclock
 * device driver be installed.  A device driver for Linux is available at
 * http://home.pages.de/~voegele/pcf.html.  Information about a FreeBSD
 * driver is available at http://schumann.cx/pcfclock/.
 */

/*
 * Interface definitions
 */
#define	DEVICE		"/dev/pcfclocks/%d"
#define	OLDDEVICE	"/dev/pcfclock%d"
#define	PRECISION	(-1)	/* precision assumed (about 0.5 s) */
#define REFID		"PCF"
#define DESCRIPTION	"Conrad parallel port radio clock"

#define LENPCF		18	/* timecode length */

/*
 * Function prototypes
 */
static	int 	pcf_start 		(int, struct peer *);
static	void	pcf_shutdown		(int, struct peer *);
static	void	pcf_poll		(int, struct peer *);

/*
 * Transfer vector
 */
struct  refclock refclock_pcf = {
	pcf_start,              /* start up driver */
	pcf_shutdown,           /* shut down driver */
	pcf_poll,               /* transmit poll message */
	noentry,                /* not used */
	noentry,                /* initialize driver (not used) */
	noentry,                /* not used */
	NOFLAGS                 /* not used */
};


/*
 * pcf_start - open the device and initialize data for processing
 */
static int
pcf_start(
     	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	int fd;
	char device[128];

	/*
	 * Open device file for reading.
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
	fd = open(device, O_RDONLY);
	if (fd == -1) {
		snprintf(device, sizeof(device), OLDDEVICE, unit);
		fd = open(device, O_RDONLY);
	}
#ifdef DEBUG
	if (debug)
		printf ("starting PCF with device %s\n",device);
#endif
	if (fd == -1) {
		return (0);
	}
	
	pp = peer->procptr;
	pp->io.clock_recv = noentry;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	
	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	/* one transmission takes 172.5 milliseconds since the radio clock
	   transmits 69 bits with a period of 2.5 milliseconds per bit */
	pp->fudgetime1 = 0.1725;
	memcpy((char *)&pp->refid, REFID, 4);

	return (1);
}


/*
 * pcf_shutdown - shut down the clock
 */
static void
pcf_shutdown(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	
	pp = peer->procptr;
	(void)close(pp->io.fd);
}


/*
 * pcf_poll - called by the transmit procedure
 */
static void
pcf_poll(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	char buf[LENPCF];
	struct tm tm, *tp;
	time_t t;
	
	pp = peer->procptr;

	buf[0] = 0;
	if (read(pp->io.fd, buf, sizeof(buf)) < sizeof(buf) || buf[0] != 9) {
		refclock_report(peer, CEVNT_FAULT);
		return;
	}

	memset(&tm, 0, sizeof(tm));

	tm.tm_mday = buf[11] * 10 + buf[10];
	tm.tm_mon = buf[13] * 10 + buf[12] - 1;
	tm.tm_year = buf[15] * 10 + buf[14];
	tm.tm_hour = buf[7] * 10 + buf[6];
	tm.tm_min = buf[5] * 10 + buf[4];
	tm.tm_sec = buf[3] * 10 + buf[2];
	tm.tm_isdst = (buf[8] & 1) ? 1 : (buf[8] & 2) ? 0 : -1;

	/*
	 * Y2K convert the 2-digit year
	 */
	if (tm.tm_year < 99)
		tm.tm_year += 100;
	
	t = mktime(&tm);
	if (t == (time_t) -1) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}

#if defined(__GLIBC__) && defined(_BSD_SOURCE)
	if ((tm.tm_isdst > 0 && tm.tm_gmtoff != 7200)
	    || (tm.tm_isdst == 0 && tm.tm_gmtoff != 3600)
	    || tm.tm_isdst < 0) {
#ifdef DEBUG
		if (debug)
			printf ("local time zone not set to CET/CEST\n");
#endif
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
#endif

	pp->lencode = strftime(pp->a_lastcode, BMAX, "%Y %m %d %H %M %S", &tm);

#if defined(_REENTRANT) || defined(_THREAD_SAFE)
	tp = gmtime_r(&t, &tm);
#else
	tp = gmtime(&t);
#endif
	if (!tp) {
		refclock_report(peer, CEVNT_FAULT);
		return;
	}

	get_systime(&pp->lastrec);
	pp->polls++;
	pp->year = tp->tm_year + 1900;
	pp->day = tp->tm_yday + 1;
	pp->hour = tp->tm_hour;
	pp->minute = tp->tm_min;
	pp->second = tp->tm_sec;
	pp->nsec = buf[16] * 31250000;
	if (buf[17] & 1)
		pp->nsec += 500000000;

#ifdef DEBUG
	if (debug)
		printf ("pcf%d: time is %04d/%02d/%02d %02d:%02d:%02d UTC\n",
			unit, pp->year, tp->tm_mon + 1, tp->tm_mday, pp->hour,
			pp->minute, pp->second);
#endif

	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
	if ((buf[1] & 1) && !(pp->sloppyclockflag & CLK_FLAG2))
		pp->leap = LEAP_NOTINSYNC;
	else
		pp->leap = LEAP_NOWARNING;
	pp->lastref = pp->lastrec;
	refclock_receive(peer);
}
#else
int refclock_pcf_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_datum.c0000644000175000017500000006070011307651604015712 0ustar  peterpeter/*
** refclock_datum - clock driver for the Datum Programmable Time Server
**
** Important note: This driver assumes that you have termios. If you have
** a system that does not have termios, you will have to modify this driver.
**
** Sorry, I have only tested this driver on SUN and HP platforms.
*/

#ifdef HAVE_CONFIG_H
# include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_DATUM)

/*
** Include Files
*/

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"

#include 
#include 

#if defined(HAVE_BSD_TTYS)
#include 
#endif /* HAVE_BSD_TTYS */

#if defined(HAVE_SYSV_TTYS)
#include 
#endif /* HAVE_SYSV_TTYS */

#if defined(HAVE_TERMIOS)
#include 
#endif
#if defined(STREAM)
#include 
#if defined(WWVBCLK)
#include 
#endif /* WWVBCLK */
#endif /* STREAM */

#include "ntp_stdlib.h"

/*
** This driver supports the Datum Programmable Time System (PTS) clock.
** The clock works in very straight forward manner. When it receives a
** time code request (e.g., the ascii string "//k/mn"), it responds with
** a seven byte BCD time code. This clock only responds with a
** time code after it first receives the "//k/mn" message. It does not
** periodically send time codes back at some rate once it is started.
** the returned time code can be broken down into the following fields.
**
**            _______________________________
** Bit Index | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
**            ===============================
** byte 0:   | -   -   -   - |      H D      |
**            ===============================
** byte 1:   |      T D      |      U D      |
**            ===============================
** byte 2:   | -   - |  T H  |      U H      |
**            ===============================
** byte 3:   | - |    T M    |      U M      |
**            ===============================
** byte 4:   | - |    T S    |      U S      |
**            ===============================
** byte 5:   |      t S      |      h S      |
**            ===============================
** byte 6:   |      m S      | -   -   -   - |
**            ===============================
**
** In the table above:
**
**	"-" means don't care
**	"H D", "T D", and "U D" means Hundreds, Tens, and Units of Days
**	"T H", and "UH" means Tens and Units of Hours
**	"T M", and "U M" means Tens and Units of Minutes
**	"T S", and "U S" means Tens and Units of Seconds
**	"t S", "h S", and "m S" means tenths, hundredths, and thousandths
**				of seconds
**
** The Datum PTS communicates throught the RS232 port on your machine.
** Right now, it assumes that you have termios. This driver has been tested
** on SUN and HP workstations. The Datum PTS supports various IRIG and
** NASA input codes. This driver assumes that the name of the device is
** /dev/datum. You will need to make a soft link to your RS232 device or
** create a new driver to use this refclock.
*/

/*
** Datum PTS defines
*/

/*
** Note that if GMT is defined, then the Datum PTS must use Greenwich
** time. Otherwise, this driver allows the Datum PTS to use the current
** wall clock for its time. It determines the time zone offset by minimizing
** the error after trying several time zone offsets. If the Datum PTS
** time is Greenwich time and GMT is not defined, everything should still
** work since the time zone will be found to be 0. What this really means
** is that your system time (at least to start with) must be within the
** correct time by less than +- 30 minutes. The default is for GMT to not
** defined. If you really want to force GMT without the funny +- 30 minute
** stuff then you must define (uncomment) GMT below.
*/

/*
#define GMT
#define DEBUG_DATUM_PTC
#define LOG_TIME_ERRORS
*/


#define	PRECISION	(-10)		/* precision assumed 1/1024 ms */
#define	REFID "DATM"			/* reference id */
#define DATUM_DISPERSION 0		/* fixed dispersion = 0 ms */
#define DATUM_MAX_ERROR 0.100		/* limits on sigma squared */
#define DATUM_DEV	"/dev/datum"	/* device name */

#define DATUM_MAX_ERROR2 (DATUM_MAX_ERROR*DATUM_MAX_ERROR)

/*
** The Datum PTS structure
*/

/*
** I don't use a fixed array of MAXUNITS like everyone else just because
** I don't like to program that way. Sorry if this bothers anyone. I assume
** that you can use any id for your unit and I will search for it in a
** dynamic array of units until I find it. I was worried that users might
** enter a bad id in their configuration file (larger than MAXUNITS) and
** besides, it is just cleaner not to have to assume that you have a fixed
** number of anything in a program.
*/

struct datum_pts_unit {
	struct peer *peer;		/* peer used by ntp */
	struct refclockio io;		/* io structure used by ntp */
	int PTS_fd;			/* file descriptor for PTS */
	u_int unit;			/* id for unit */
	u_long timestarted;		/* time started */
	l_fp lastrec;			/* time tag for the receive time (system) */
	l_fp lastref;			/* reference time (Datum time) */
	u_long yearstart;		/* the year that this clock started */
	int coderecv;			/* number of time codes received */
	int day;			/* day */
	int hour;			/* hour */
	int minute;			/* minutes */
	int second;			/* seconds */
	int msec;			/* miliseconds */
	int usec;			/* miliseconds */
	u_char leap;			/* funny leap character code */
	char retbuf[8];		/* returned time from the datum pts */
	char nbytes;			/* number of bytes received from datum pts */ 
	double sigma2;		/* average squared error (roughly) */
	int tzoff;			/* time zone offest from GMT */
};

/*
** PTS static constant variables for internal use
*/

static char TIME_REQUEST[6];	/* request message sent to datum for time */
static int nunits;		/* number of active units */
static struct datum_pts_unit
**datum_pts_unit;	/* dynamic array of datum PTS structures */

/*
** Callback function prototypes that ntpd needs to know about.
*/

static	int	datum_pts_start		(int, struct peer *);
static	void	datum_pts_shutdown	(int, struct peer *);
static	void	datum_pts_poll		(int, struct peer *);
static	void	datum_pts_control	(int, struct refclockstat *,
					   struct refclockstat *, struct peer *);
static	void	datum_pts_init		(void);
static	void	datum_pts_buginfo	(int, struct refclockbug *, struct peer *);

/*
** This is the call back function structure that ntpd actually uses for
** this refclock.
*/

struct	refclock refclock_datum = {
	datum_pts_start,		/* start up a new Datum refclock */
	datum_pts_shutdown,		/* shutdown a Datum refclock */
	datum_pts_poll,		/* sends out the time request */
	datum_pts_control,		/* not used */
	datum_pts_init,		/* initialization (called first) */
	datum_pts_buginfo,		/* not used */
	NOFLAGS			/* we are not setting any special flags */
};

/*
** The datum_pts_receive callback function is handled differently from the
** rest. It is passed to the ntpd io data structure. Basically, every
** 64 seconds, the datum_pts_poll() routine is called. It sends out the time
** request message to the Datum Programmable Time System. Then, ntpd
** waits on a select() call to receive data back. The datum_pts_receive()
** function is called as data comes back. We expect a seven byte time
** code to be returned but the datum_pts_receive() function may only get
** a few bytes passed to it at a time. In other words, this routine may
** get called by the io stuff in ntpd a few times before we get all seven
** bytes. Once the last byte is received, we process it and then pass the
** new time measurement to ntpd for updating the system time. For now,
** there is no 3 state filtering done on the time measurements. The
** jitter may be a little high but at least for its current use, it is not
** a problem. We have tried to keep things as simple as possible. This
** clock should not jitter more than 1 or 2 mseconds at the most once
** things settle down. It is important to get the right drift calibrated
** in the ntpd.drift file as well as getting the right tick set up right
** using tickadj for SUNs. Tickadj is not used for the HP but you need to
** remember to bring up the adjtime daemon because HP does not support
** the adjtime() call.
*/

static	void	datum_pts_receive	(struct recvbuf *);

/*......................................................................*/
/*	datum_pts_start - start up the datum PTS. This means open the	*/
/*	RS232 device and set up the data structure for my unit.		*/
/*......................................................................*/

static int
datum_pts_start(
	int unit,
	struct peer *peer
	)
{
	struct datum_pts_unit **temp_datum_pts_unit;
	struct datum_pts_unit *datum_pts;
	int fd;
#ifdef HAVE_TERMIOS
	struct termios arg;
#endif

#ifdef DEBUG_DATUM_PTC
	if (debug)
	    printf("Starting Datum PTS unit %d\n", unit);
#endif

	/*
	** Open the Datum PTS device
	*/
	fd = open(DATUM_DEV, O_RDWR);

	if (fd < 0) {
		msyslog(LOG_ERR, "Datum_PTS: open(\"%s\", O_RDWR) failed: %m", DATUM_DEV);
		return 0;
	}

	/*
	** Create the memory for the new unit
	*/

	temp_datum_pts_unit = (struct datum_pts_unit **)
		emalloc((nunits+1)*sizeof(struct datum_pts_unit *));
	if (nunits > 0) memcpy(temp_datum_pts_unit, datum_pts_unit,
			       nunits*sizeof(struct datum_pts_unit *));
	free(datum_pts_unit);
	datum_pts_unit = temp_datum_pts_unit;
	datum_pts_unit[nunits] = (struct datum_pts_unit *)
		emalloc(sizeof(struct datum_pts_unit));
	datum_pts = datum_pts_unit[nunits];

	datum_pts->unit = unit;	/* set my unit id */
	datum_pts->yearstart = 0;	/* initialize the yearstart to 0 */
	datum_pts->sigma2 = 0.0;	/* initialize the sigma2 to 0 */

	datum_pts->PTS_fd = fd;

	fcntl(datum_pts->PTS_fd, F_SETFL, 0); /* clear the descriptor flags */

#ifdef DEBUG_DATUM_PTC
	if (debug)
	    printf("Opening RS232 port with file descriptor %d\n",
		   datum_pts->PTS_fd);
#endif

	/*
	** Set up the RS232 terminal device information. Note that we assume that
	** we have termios. This code has only been tested on SUNs and HPs. If your
	** machine does not have termios this driver cannot be initialized. You can change this
	** if you want by editing this source. Please give the changes back to the
	** ntp folks so that it can become part of their regular distribution.
	*/

#ifdef HAVE_TERMIOS

	memset(&arg, 0, sizeof(arg));

	arg.c_iflag = IGNBRK;
	arg.c_oflag = 0;
	arg.c_cflag = B9600 | CS8 | CREAD | PARENB | CLOCAL;
	arg.c_lflag = 0;
	arg.c_cc[VMIN] = 0;		/* start timeout timer right away (not used) */
	arg.c_cc[VTIME] = 30;		/* 3 second timout on reads (not used) */

	tcsetattr(datum_pts->PTS_fd, TCSANOW, &arg);

#else

	msyslog(LOG_ERR, "Datum_PTS: Termios not supported in this driver");
	(void)close(datum_pts->PTS_fd);

	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);

	return 0;

#endif

	/*
	** Initialize the ntpd IO structure
	*/

	datum_pts->peer = peer;
	datum_pts->io.clock_recv = datum_pts_receive;
	datum_pts->io.srcclock = (caddr_t)datum_pts;
	datum_pts->io.datalen = 0;
	datum_pts->io.fd = datum_pts->PTS_fd;

	if (!io_addclock(&(datum_pts->io))) {

#ifdef DEBUG_DATUM_PTC
		if (debug)
		    printf("Problem adding clock\n");
#endif

		msyslog(LOG_ERR, "Datum_PTS: Problem adding clock");
		(void)close(datum_pts->PTS_fd);

		return 0;
	}

	/*
	** Now add one to the number of units and return a successful code
	*/

	nunits++;
	return 1;

}


/*......................................................................*/
/*	datum_pts_shutdown - this routine shuts doen the device and	*/
/*	removes the memory for the unit.				*/
/*......................................................................*/

static void
datum_pts_shutdown(
	int unit,
	struct peer *peer
	)
{
	int i,j;
	struct datum_pts_unit **temp_datum_pts_unit;

#ifdef DEBUG_DATUM_PTC
	if (debug)
	    printf("Shutdown Datum PTS\n");
#endif

	msyslog(LOG_ERR, "Datum_PTS: Shutdown Datum PTS");

	/*
	** First we have to find the right unit (i.e., the one with the same id).
	** We do this by looping through the dynamic array of units intil we find
	** it. Note, that I don't simply use an array with a maximimum number of
	** Datum PTS units. Everything is completely dynamic.
	*/

	for (i=0; iunit == unit) {

			/*
			** We found the unit so close the file descriptor and free up the memory used
			** by the structure.
			*/

			io_closeclock(&datum_pts_unit[i]->io);
			close(datum_pts_unit[i]->PTS_fd);
			free(datum_pts_unit[i]);

			/*
			** Now clean up the datum_pts_unit dynamic array so that there are no holes.
			** This may mean moving pointers around, etc., to keep things compact.
			*/

			if (nunits > 1) {

				temp_datum_pts_unit = (struct datum_pts_unit **)
					emalloc((nunits-1)*sizeof(struct datum_pts_unit *));
				if (i!= 0) memcpy(temp_datum_pts_unit, datum_pts_unit,
						  i*sizeof(struct datum_pts_unit *));

				for (j=i+1; junit == unit) {
			unit_index = i;
			datum_pts = datum_pts_unit[i];
			error_code = write(datum_pts->PTS_fd, TIME_REQUEST, 6);
			if (error_code != 6) perror("TIME_REQUEST");
			datum_pts->nbytes = 0;
			break;
		}
	}

	/*
	** Print out an error message if we could not find the right unit.
	*/

	if (unit_index == -1) {

#ifdef DEBUG_DATUM_PTC
		if (debug)
		    printf("Error, could not poll unit %d\n",unit);
#endif

		msyslog(LOG_ERR, "Datum_PTS: Could not poll unit %d",unit);
		return;

	}

}


/*......................................................................*/
/*	datum_pts_control - not used					*/
/*......................................................................*/

static void
datum_pts_control(
	int unit,
	struct refclockstat *in,
	struct refclockstat *out,
	struct peer *peer
	)
{

#ifdef DEBUG_DATUM_PTC
	if (debug)
	    printf("Control Datum PTS\n");
#endif

}


/*......................................................................*/
/*	datum_pts_init - initializes things for all possible Datum	*/
/*	time code generators that might be used. In practice, this is	*/
/*	only called once at the beginning before anything else is	*/
/*	called.								*/
/*......................................................................*/

static void
datum_pts_init(void)
{

	/*									*/
	/*...... open up the log file if we are debugging ......................*/
	/*									*/

	/*
	** Open up the log file if we are debugging. For now, send data out to the
	** screen (stdout).
	*/

#ifdef DEBUG_DATUM_PTC
	if (debug)
	    printf("Init Datum PTS\n");
#endif

	/*
	** Initialize the time request command string. This is the only message
	** that we ever have to send to the Datum PTS (although others are defined).
	*/

	memcpy(TIME_REQUEST, "//k/mn",6);

	/*
	** Initialize the number of units to 0 and set the dynamic array of units to
	** NULL since there are no units defined yet.
	*/

	datum_pts_unit = NULL;
	nunits = 0;

}


/*......................................................................*/
/*	datum_pts_buginfo - not used					*/
/*......................................................................*/

static void
datum_pts_buginfo(
	int unit,
	register struct refclockbug *bug,
	register struct peer *peer
	)
{

#ifdef DEBUG_DATUM_PTC
	if (debug)
	    printf("Buginfo Datum PTS\n");
#endif

}


/*......................................................................*/
/*	datum_pts_receive - receive the time buffer that was read in	*/
/*	by the ntpd io handling routines. When 7 bytes have been	*/
/*	received (it may take several tries before all 7 bytes are	*/
/*	received), then the time code must be unpacked and sent to	*/
/*	the ntpd clock_receive() routine which causes the systems	*/
/*	clock to be updated (several layers down).			*/
/*......................................................................*/

static void
datum_pts_receive(
	struct recvbuf *rbufp
	)
{
	int i;
	l_fp tstmp;
	struct datum_pts_unit *datum_pts;
	char *dpt;
	int dpend;
	int tzoff;
	int timerr;
	double ftimerr, abserr;
#ifdef DEBUG_DATUM_PTC
	double dispersion;
#endif
	int goodtime;
      /*double doffset;*/

	/*
	** Get the time code (maybe partial) message out of the rbufp buffer.
	*/

	datum_pts = (struct datum_pts_unit *)rbufp->recv_srcclock;
	dpt = (char *)&rbufp->recv_space;
	dpend = rbufp->recv_length;

#ifdef DEBUG_DATUM_PTC
	if (debug)
	    printf("Receive Datum PTS: %d bytes\n", dpend);
#endif

	/*									*/
	/*...... save the ntp system time when the first byte is received ......*/
	/*									*/

	/*
	** Save the ntp system time when the first byte is received. Note that
	** because it may take several calls to this routine before all seven
	** bytes of our return message are finally received by the io handlers in
	** ntpd, we really do want to use the time tag when the first byte is
	** received to reduce the jitter.
	*/

	if (datum_pts->nbytes == 0) {
		datum_pts->lastrec = rbufp->recv_time;
	}

	/*
	** Increment our count to the number of bytes received so far. Return if we
	** haven't gotten all seven bytes yet.
	*/

	for (i=0; iretbuf[datum_pts->nbytes+i] = dpt[i];
	}

	datum_pts->nbytes += dpend;

	if (datum_pts->nbytes != 7) {
		return;
	}

	/*
	** Convert the seven bytes received in our time buffer to day, hour, minute,
	** second, and msecond values. The usec value is not used for anything
	** currently. It is just the fractional part of the time stored in units
	** of microseconds.
	*/

	datum_pts->day =	100*(datum_pts->retbuf[0] & 0x0f) +
		10*((datum_pts->retbuf[1] & 0xf0)>>4) +
		(datum_pts->retbuf[1] & 0x0f);

	datum_pts->hour =	10*((datum_pts->retbuf[2] & 0x30)>>4) +
		(datum_pts->retbuf[2] & 0x0f);

	datum_pts->minute =	10*((datum_pts->retbuf[3] & 0x70)>>4) +
		(datum_pts->retbuf[3] & 0x0f);

	datum_pts->second =	10*((datum_pts->retbuf[4] & 0x70)>>4) +
		(datum_pts->retbuf[4] & 0x0f);

	datum_pts->msec =	100*((datum_pts->retbuf[5] & 0xf0) >> 4) + 
		10*(datum_pts->retbuf[5] & 0x0f) +
		((datum_pts->retbuf[6] & 0xf0)>>4);

	datum_pts->usec =	1000*datum_pts->msec;

#ifdef DEBUG_DATUM_PTC
	if (debug)
	    printf("day %d, hour %d, minute %d, second %d, msec %d\n",
		   datum_pts->day,
		   datum_pts->hour,
		   datum_pts->minute,
		   datum_pts->second,
		   datum_pts->msec);
#endif

	/*
	** Get the GMT time zone offset. Note that GMT should be zero if the Datum
	** reference time is using GMT as its time base. Otherwise we have to
	** determine the offset if the Datum PTS is using time of day as its time
	** base.
	*/

	goodtime = 0;		/* We are not sure about the time and offset yet */

#ifdef GMT

	/*
	** This is the case where the Datum PTS is using GMT so there is no time
	** zone offset.
	*/

	tzoff = 0;		/* set time zone offset to 0 */

#else

	/*
	** This is the case where the Datum PTS is using regular time of day for its
	** time so we must compute the time zone offset. The way we do it is kind of
	** funny but it works. We loop through different time zones (0 to 24) and
	** pick the one that gives the smallest error (+- one half hour). The time
	** zone offset is stored in the datum_pts structure for future use. Normally,
	** the clocktime() routine is only called once (unless the time zone offset
	** changes due to daylight savings) since the goodtime flag is set when a
	** good time is found (with a good offset). Note that even if the Datum
	** PTS is using GMT, this mechanism will still work since it should come up
	** with a value for tzoff = 0 (assuming that your system clock is within
	** a half hour of the Datum time (even with time zone differences).
	*/

	for (tzoff=0; tzoff<24; tzoff++) {
		if (clocktime( datum_pts->day,
			       datum_pts->hour,
			       datum_pts->minute,
			       datum_pts->second,
			       (tzoff + datum_pts->tzoff) % 24,
			       datum_pts->lastrec.l_ui,
			       &datum_pts->yearstart,
			       &datum_pts->lastref.l_ui) ) {

			datum_pts->lastref.l_uf = 0;
			error = datum_pts->lastref.l_ui - datum_pts->lastrec.l_ui;

#ifdef DEBUG_DATUM_PTC
			printf("Time Zone (clocktime method) = %d, error = %d\n", tzoff, error);
#endif

			if ((error < 1799) && (error > -1799)) {
				tzoff = (tzoff + datum_pts->tzoff) % 24;
				datum_pts->tzoff = tzoff;
				goodtime = 1;

#ifdef DEBUG_DATUM_PTC
				printf("Time Zone found (clocktime method) = %d\n",tzoff);
#endif

				break;
			}

		}
	}

#endif

	/*
	** Make sure that we have a good time from the Datum PTS. Clocktime() also
	** sets yearstart and lastref.l_ui. We will have to set astref.l_uf (i.e.,
	** the fraction of a second) stuff later.
	*/

	if (!goodtime) {

		if (!clocktime( datum_pts->day,
				datum_pts->hour,
				datum_pts->minute,
				datum_pts->second,
				tzoff,
				datum_pts->lastrec.l_ui,
				&datum_pts->yearstart,
				&datum_pts->lastref.l_ui) ) {

#ifdef DEBUG_DATUM_PTC
			if (debug)
			{
				printf("Error: bad clocktime\n");
				printf("GMT %d, lastrec %d, yearstart %d, lastref %d\n",
				       tzoff,
				       datum_pts->lastrec.l_ui,
				       datum_pts->yearstart,
				       datum_pts->lastref.l_ui);
			}
#endif

			msyslog(LOG_ERR, "Datum_PTS: Bad clocktime");

			return;

		}else{

#ifdef DEBUG_DATUM_PTC
			if (debug)
			    printf("Good clocktime\n");
#endif

		}

	}

	/*
	** We have datum_pts->lastref.l_ui set (which is the integer part of the
	** time. Now set the microseconds field.
	*/

	TVUTOTSF(datum_pts->usec, datum_pts->lastref.l_uf);

	/*
	** Compute the time correction as the difference between the reference
	** time (i.e., the Datum time) minus the receive time (system time).
	*/

	tstmp = datum_pts->lastref;		/* tstmp is the datum ntp time */
	L_SUB(&tstmp, &datum_pts->lastrec);	/* tstmp is now the correction */
	datum_pts->coderecv++;		/* increment a counter */

#ifdef DEBUG_DATUM_PTC
	dispersion = DATUM_DISPERSION;	/* set the dispersion to 0 */
	ftimerr = dispersion;
	ftimerr /= (1024.0 * 64.0);
	if (debug)
	    printf("dispersion = %d, %f\n", dispersion, ftimerr);
#endif

	/*
	** Pass the new time to ntpd through the refclock_receive function. Note
	** that we are not trying to make any corrections due to the time it takes
	** for the Datum PTS to send the message back. I am (erroneously) assuming
	** that the time for the Datum PTS to send the time back to us is negligable.
	** I suspect that this time delay may be as much as 15 ms or so (but probably
	** less). For our needs at JPL, this kind of error is ok so it is not
	** necessary to use fudge factors in the ntp.conf file. Maybe later we will.
	*/
      /*LFPTOD(&tstmp, doffset);*/
	datum_pts->lastref = datum_pts->lastrec;
	refclock_receive(datum_pts->peer);

	/*
	** Compute sigma squared (not used currently). Maybe later, this could be
	** used for the dispersion estimate. The problem is that ntpd does not link
	** in the math library so sqrt() is not available. Anyway, this is useful
	** for debugging. Maybe later I will just use absolute values for the time
	** error to come up with my dispersion estimate. Anyway, for now my dispersion
	** is set to 0.
	*/

	timerr = tstmp.l_ui<<20;
	timerr |= (tstmp.l_uf>>12) & 0x000fffff;
	ftimerr = timerr;
	ftimerr /= 1024*1024;
	abserr = ftimerr;
	if (ftimerr < 0.0) abserr = -ftimerr;

	if (datum_pts->sigma2 == 0.0) {
		if (abserr < DATUM_MAX_ERROR) {
			datum_pts->sigma2 = abserr*abserr;
		}else{
			datum_pts->sigma2 = DATUM_MAX_ERROR2;
		}
	}else{
		if (abserr < DATUM_MAX_ERROR) {
			datum_pts->sigma2 = 0.95*datum_pts->sigma2 + 0.05*abserr*abserr;
		}else{
			datum_pts->sigma2 = 0.95*datum_pts->sigma2 + 0.05*DATUM_MAX_ERROR2;
		}
	}

#ifdef DEBUG_DATUM_PTC
	if (debug)
	    printf("Time error = %f seconds\n", ftimerr);
#endif

#if defined(DEBUG_DATUM_PTC) || defined(LOG_TIME_ERRORS)
	if (debug)
	    printf("PTS: day %d, hour %d, minute %d, second %d, msec %d, Time Error %f\n",
		   datum_pts->day,
		   datum_pts->hour,
		   datum_pts->minute,
		   datum_pts->second,
		   datum_pts->msec,
		   ftimerr);
#endif

}
#else
int refclock_datum_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/ntp_refclock.c0000644000175000017500000010026711665566225015417 0ustar  peterpeter/*
 * ntp_refclock - processing support for reference clocks
 */
#ifdef HAVE_CONFIG_H
# include 
#endif

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_unixtime.h"
#include "ntp_tty.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"
#include "ntp_assert.h"

#include 

#ifdef HAVE_SYS_IOCTL_H
# include 
#endif /* HAVE_SYS_IOCTL_H */

#ifdef REFCLOCK

#ifdef TTYCLK
# ifdef HAVE_SYS_CLKDEFS_H
#  include 
#  include 
# endif
# ifdef HAVE_SYS_SIO_H
#  include 
# endif
#endif /* TTYCLK */

#ifdef KERNEL_PLL
#include "ntp_syscall.h"
#endif /* KERNEL_PLL */

#ifdef HAVE_PPSAPI
#include "ppsapi_timepps.h"
#include "refclock_atom.h"
#endif /* HAVE_PPSAPI */

/*
 * Reference clock support is provided here by maintaining the fiction
 * that the clock is actually a peer.  As no packets are exchanged with
 * a reference clock, however, we replace the transmit, receive and
 * packet procedures with separate code to simulate them.  Routines
 * refclock_transmit() and refclock_receive() maintain the peer
 * variables in a state analogous to an actual peer and pass reference
 * clock data on through the filters.  Routines refclock_peer() and
 * refclock_unpeer() are called to initialize and terminate reference
 * clock associations.  A set of utility routines is included to open
 * serial devices, process sample data, edit input lines to extract
 * embedded timestamps and to perform various debugging functions.
 *
 * The main interface used by these routines is the refclockproc
 * structure, which contains for most drivers the decimal equivalants
 * of the year, day, month, hour, second and millisecond/microsecond
 * decoded from the ASCII timecode.  Additional information includes
 * the receive timestamp, exception report, statistics tallies, etc. 
 * In addition, there may be a driver-specific unit structure used for
 * local control of the device.
 *
 * The support routines are passed a pointer to the peer structure,
 * which is used for all peer-specific processing and contains a
 * pointer to the refclockproc structure, which in turn contains a
 * pointer to the unit structure, if used.  The peer structure is 
 * identified by an interface address in the dotted quad form 
 * 127.127.t.u, where t is the clock type and u the unit.
 */
#define FUDGEFAC	.1	/* fudge correction factor */
#define LF		0x0a	/* ASCII LF */

#ifdef PPS
int	fdpps;			/* ppsclock legacy */
#endif /* PPS */

int	cal_enable;		/* enable refclock calibrate */

/*
 * Forward declarations
 */
#ifdef QSORT_USES_VOID_P
static int refclock_cmpl_fp (const void *, const void *);
#else
static int refclock_cmpl_fp (const double *, const double *);
#endif /* QSORT_USES_VOID_P */
static int refclock_sample (struct refclockproc *);


/*
 * refclock_report - note the occurance of an event
 *
 * This routine presently just remembers the report and logs it, but
 * does nothing heroic for the trap handler. It tries to be a good
 * citizen and bothers the system log only if things change.
 */
void
refclock_report(
	struct peer *peer,
	int code
	)
{
	struct refclockproc *pp;

	pp = peer->procptr;
	if (pp == NULL)
		return;

	switch (code) {

	case CEVNT_TIMEOUT:
		pp->noreply++;
		break;

	case CEVNT_BADREPLY:
		pp->badformat++;
		break;

	case CEVNT_FAULT:
		break;

	case CEVNT_BADDATE:
	case CEVNT_BADTIME:
		pp->baddata++;
		break;

	default:
		/* ignore others */
		break;
	}
	if (pp->lastevent < 15)
		pp->lastevent++;
	if (pp->currentstatus != code) {
		pp->currentstatus = (u_char)code;
		report_event(PEVNT_CLOCK, peer, ceventstr(code));
	}
}


/*
 * init_refclock - initialize the reference clock drivers
 *
 * This routine calls each of the drivers in turn to initialize internal
 * variables, if necessary. Most drivers have nothing to say at this
 * point.
 */
void
init_refclock(void)
{
	int i;

	for (i = 0; i < (int)num_refclock_conf; i++)
		if (refclock_conf[i]->clock_init != noentry)
			(refclock_conf[i]->clock_init)();
}


/*
 * refclock_newpeer - initialize and start a reference clock
 *
 * This routine allocates and initializes the interface structure which
 * supports a reference clock in the form of an ordinary NTP peer. A
 * driver-specific support routine completes the initialization, if
 * used. Default peer variables which identify the clock and establish
 * its reference ID and stratum are set here. It returns one if success
 * and zero if the clock address is invalid or already running,
 * insufficient resources are available or the driver declares a bum
 * rap.
 */
int
refclock_newpeer(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	u_char clktype;
	int unit;

	/*
	 * Check for valid clock address. If already running, shut it
	 * down first.
	 */
	if (!ISREFCLOCKADR(&peer->srcadr)) {
		msyslog(LOG_ERR,
			"refclock_newpeer: clock address %s invalid",
			stoa(&peer->srcadr));
		return (0);
	}
	clktype = (u_char)REFCLOCKTYPE(&peer->srcadr);
	unit = REFCLOCKUNIT(&peer->srcadr);
	if (clktype >= num_refclock_conf ||
		refclock_conf[clktype]->clock_start == noentry) {
		msyslog(LOG_ERR,
			"refclock_newpeer: clock type %d invalid\n",
			clktype);
		return (0);
	}

	/*
	 * Allocate and initialize interface structure
	 */
	pp = emalloc(sizeof(*pp));
	memset(pp, 0, sizeof(*pp));
	peer->procptr = pp;

	/*
	 * Initialize structures
	 */
	peer->refclktype = clktype;
	peer->refclkunit = (u_char)unit;
	peer->flags |= FLAG_REFCLOCK;
	peer->leap = LEAP_NOTINSYNC;
	peer->stratum = STRATUM_REFCLOCK;
	peer->ppoll = peer->maxpoll;
	pp->type = clktype;
	pp->timestarted = current_time;

	/*
	 * Set peer.pmode based on the hmode. For appearances only.
	 */
	switch (peer->hmode) {
	case MODE_ACTIVE:
		peer->pmode = MODE_PASSIVE;
		break;

	default:
		peer->pmode = MODE_SERVER;
		break;
	}

	/*
	 * Do driver dependent initialization. The above defaults
	 * can be wiggled, then finish up for consistency.
	 */
	if (!((refclock_conf[clktype]->clock_start)(unit, peer))) {
		refclock_unpeer(peer);
		return (0);
	}
	peer->refid = pp->refid;
	return (1);
}


/*
 * refclock_unpeer - shut down a clock
 */
void
refclock_unpeer(
	struct peer *peer	/* peer structure pointer */
	)
{
	u_char clktype;
	int unit;

	/*
	 * Wiggle the driver to release its resources, then give back
	 * the interface structure.
	 */
	if (NULL == peer->procptr)
		return;

	clktype = peer->refclktype;
	unit = peer->refclkunit;
	if (refclock_conf[clktype]->clock_shutdown != noentry)
		(refclock_conf[clktype]->clock_shutdown)(unit, peer);
	free(peer->procptr);
	peer->procptr = NULL;
}


/*
 * refclock_timer - called once per second for housekeeping.
 */
void
refclock_timer(
	struct peer *peer	/* peer structure pointer */
	)
{
	u_char clktype;
	int unit;

	clktype = peer->refclktype;
	unit = peer->refclkunit;
	if (refclock_conf[clktype]->clock_timer != noentry)
		(refclock_conf[clktype]->clock_timer)(unit, peer);
}
	

/*
 * refclock_transmit - simulate the transmit procedure
 *
 * This routine implements the NTP transmit procedure for a reference
 * clock. This provides a mechanism to call the driver at the NTP poll
 * interval, as well as provides a reachability mechanism to detect a
 * broken radio or other madness.
 */
void
refclock_transmit(
	struct peer *peer	/* peer structure pointer */
	)
{
	u_char clktype;
	int unit;

	clktype = peer->refclktype;
	unit = peer->refclkunit;
	peer->sent++;
	get_systime(&peer->xmt);

	/*
	 * This is a ripoff of the peer transmit routine, but
	 * specialized for reference clocks. We do a little less
	 * protocol here and call the driver-specific transmit routine.
	 */
	if (peer->burst == 0) {
		u_char oreach;
#ifdef DEBUG
		if (debug)
			printf("refclock_transmit: at %ld %s\n",
			    current_time, stoa(&(peer->srcadr)));
#endif

		/*
		 * Update reachability and poll variables like the
		 * network code.
		 */
		oreach = peer->reach & 0xfe;
		peer->reach <<= 1;
		if (!(peer->reach & 0x0f))
			clock_filter(peer, 0., 0., MAXDISPERSE);
		peer->outdate = current_time;
		if (!peer->reach) {
			if (oreach) {
				report_event(PEVNT_UNREACH, peer, NULL);
				peer->timereachable = current_time;
			}
		} else {
			if (peer->flags & FLAG_BURST)
				peer->burst = NSTAGE;
		}
	} else {
		peer->burst--;
	}
	if (refclock_conf[clktype]->clock_poll != noentry)
		(refclock_conf[clktype]->clock_poll)(unit, peer);
	poll_update(peer, peer->hpoll);
}


/*
 * Compare two doubles - used with qsort()
 */
static int
refclock_cmpl_fp(
	const void *p1,
	const void *p2
	)
{
	const double *dp1 = (const double *)p1;
	const double *dp2 = (const double *)p2;

	if (*dp1 < *dp2)
		return -1;
	if (*dp1 > *dp2)
		return 1;
	return 0;
}


/*
 * refclock_process_offset - update median filter
 *
 * This routine uses the given offset and timestamps to construct a new
 * entry in the median filter circular buffer. Samples that overflow the
 * filter are quietly discarded.
 */
void
refclock_process_offset(
	struct refclockproc *pp,	/* refclock structure pointer */
	l_fp lasttim,			/* last timecode timestamp */
	l_fp lastrec,			/* last receive timestamp */
	double fudge
	)
{
	l_fp lftemp;
	double doffset;

	pp->lastrec = lastrec;
	lftemp = lasttim;
	L_SUB(&lftemp, &lastrec);
	LFPTOD(&lftemp, doffset);
	SAMPLE(doffset + fudge);
}


/*
 * refclock_process - process a sample from the clock
 * refclock_process_f - refclock_process with other than time1 fudge
 *
 * This routine converts the timecode in the form days, hours, minutes,
 * seconds and milliseconds/microseconds to internal timestamp format,
 * then constructs a new entry in the median filter circular buffer.
 * Return success (1) if the data are correct and consistent with the
 * converntional calendar.
 *
 * Important for PPS users: Normally, the pp->lastrec is set to the
 * system time when the on-time character is received and the pp->year,
 * ..., pp->second decoded and the seconds fraction pp->nsec in
 * nanoseconds). When a PPS offset is available, pp->nsec is forced to
 * zero and the fraction for pp->lastrec is set to the PPS offset.
 */
int
refclock_process_f(
	struct refclockproc *pp,	/* refclock structure pointer */
	double fudge
	)
{
	l_fp offset, ltemp;

	/*
	 * Compute the timecode timestamp from the days, hours, minutes,
	 * seconds and milliseconds/microseconds of the timecode. Use
	 * clocktime() for the aggregate seconds and the msec/usec for
	 * the fraction, when present. Note that this code relies on the
	 * filesystem time for the years and does not use the years of
	 * the timecode.
	 */
	if (!clocktime(pp->day, pp->hour, pp->minute, pp->second, GMT,
		pp->lastrec.l_ui, &pp->yearstart, &offset.l_ui))
		return (0);

	offset.l_uf = 0;
	DTOLFP(pp->nsec / 1e9, <emp);
	L_ADD(&offset, <emp);
	refclock_process_offset(pp, offset, pp->lastrec, fudge);
	return (1);
}


int
refclock_process(
	struct refclockproc *pp		/* refclock structure pointer */
)
{
	return refclock_process_f(pp, pp->fudgetime1);
}


/*
 * refclock_sample - process a pile of samples from the clock
 *
 * This routine implements a recursive median filter to suppress spikes
 * in the data, as well as determine a performance statistic. It
 * calculates the mean offset and RMS jitter. A time adjustment
 * fudgetime1 can be added to the final offset to compensate for various
 * systematic errors. The routine returns the number of samples
 * processed, which could be zero.
 */
static int
refclock_sample(
	struct refclockproc *pp		/* refclock structure pointer */
	)
{
	size_t	i, j, k, m, n;
	double	off[MAXSTAGE];
	double	offset;

	/*
	 * Copy the raw offsets and sort into ascending order. Don't do
	 * anything if the buffer is empty.
	 */
	n = 0;
	while (pp->codeproc != pp->coderecv) {
		pp->codeproc = (pp->codeproc + 1) % MAXSTAGE;
		off[n] = pp->filter[pp->codeproc];
		n++;
	}
	if (n == 0)
		return (0);

	if (n > 1)
		qsort((void *)off, n, sizeof(off[0]), refclock_cmpl_fp);

	/*
	 * Reject the furthest from the median of the samples until
	 * approximately 60 percent of the samples remain.
	 */
	i = 0; j = n;
	m = n - (n * 4) / 10;
	while ((j - i) > m) {
		offset = off[(j + i) / 2];
		if (off[j - 1] - offset < offset - off[i])
			i++;	/* reject low end */
		else
			j--;	/* reject high end */
	}

	/*
	 * Determine the offset and jitter.
	 */
	pp->offset = 0;
	pp->jitter = 0;
	for (k = i; k < j; k++) {
		pp->offset += off[k];
		if (k > i)
			pp->jitter += SQUARE(off[k] - off[k - 1]);
	}
	pp->offset /= m;
	pp->jitter = max(SQRT(pp->jitter / m), LOGTOD(sys_precision));
#ifdef DEBUG
	if (debug)
		printf(
		    "refclock_sample: n %d offset %.6f disp %.6f jitter %.6f\n",
		    n, pp->offset, pp->disp, pp->jitter);
#endif
	return (int)n;
}


/*
 * refclock_receive - simulate the receive and packet procedures
 *
 * This routine simulates the NTP receive and packet procedures for a
 * reference clock. This provides a mechanism in which the ordinary NTP
 * filter, selection and combining algorithms can be used to suppress
 * misbehaving radios and to mitigate between them when more than one is
 * available for backup.
 */
void
refclock_receive(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;

#ifdef DEBUG
	if (debug)
		printf("refclock_receive: at %lu %s\n",
		    current_time, stoa(&peer->srcadr));
#endif

	/*
	 * Do a little sanity dance and update the peer structure. Groom
	 * the median filter samples and give the data to the clock
	 * filter.
	 */
	pp = peer->procptr;
	peer->leap = pp->leap;
	if (peer->leap == LEAP_NOTINSYNC)
		return;

	peer->received++;
	peer->timereceived = current_time;
	if (!peer->reach) {
		report_event(PEVNT_REACH, peer, NULL);
		peer->timereachable = current_time;
	}
	peer->reach |= 1;
	peer->reftime = pp->lastref;
	peer->aorg = pp->lastrec;
	peer->rootdisp = pp->disp;
	get_systime(&peer->dst);
	if (!refclock_sample(pp))
		return;

	clock_filter(peer, pp->offset, 0., pp->jitter);
	if (cal_enable && fabs(last_offset) < sys_mindisp && sys_peer !=
	    NULL) {
		if (sys_peer->refclktype == REFCLK_ATOM_PPS &&
		    peer->refclktype != REFCLK_ATOM_PPS)
			pp->fudgetime1 -= pp->offset * FUDGEFAC;
	}
}


/*
 * refclock_gtlin - groom next input line and extract timestamp
 *
 * This routine processes the timecode received from the clock and
 * strips the parity bit and control characters. It returns the number
 * of characters in the line followed by a NULL character ('\0'), which
 * is not included in the count. In case of an empty line, the previous
 * line is preserved.
 */
int
refclock_gtlin(
	struct recvbuf *rbufp,	/* receive buffer pointer */
	char	*lineptr,	/* current line pointer */
	int	bmax,		/* remaining characters in line */
	l_fp	*tsptr		/* pointer to timestamp returned */
	)
{
	char	s[BMAX];
	char	*dpt, *dpend, *dp;

	dpt = s;
	dpend = s + refclock_gtraw(rbufp, s, BMAX - 1, tsptr);
	if (dpend - dpt > bmax - 1)
		dpend = dpt + bmax - 1;
	for (dp = lineptr; dpt < dpend; dpt++) {
		char	c;

		c = *dpt & 0x7f;
		if (c >= 0x20 && c < 0x7f)
			*dp++ = c;
	}
	if (dp == lineptr)
		return (0);

	*dp = '\0';
	return (dp - lineptr);
}


/*
 * refclock_gtraw - get next line/chunk of data
 *
 * This routine returns the raw data received from the clock in both
 * canonical or raw modes. The terminal interface routines map CR to LF.
 * In canonical mode this results in two lines, one containing data
 * followed by LF and another containing only LF. In raw mode the
 * interface routines can deliver arbitraty chunks of data from one
 * character to a maximum specified by the calling routine. In either
 * mode the routine returns the number of characters in the line
 * followed by a NULL character ('\0'), which is not included in the
 * count.
 *
 * If a timestamp is present in the timecode, as produced by the tty_clk
 * STREAMS module, it returns that as the timestamp; otherwise, it
 * returns the buffer timestamp.
 */
int
refclock_gtraw(
	struct recvbuf *rbufp,	/* receive buffer pointer */
	char	*lineptr,	/* current line pointer */
	int	bmax,		/* remaining characters in line */
	l_fp	*tsptr		/* pointer to timestamp returned */
	)
{
	char	*dpt, *dpend, *dp;
	l_fp	trtmp, tstmp;
	int	i;

	/*
	 * Check for the presence of a timestamp left by the tty_clock
	 * module and, if present, use that instead of the buffer
	 * timestamp captured by the I/O routines. We recognize a
	 * timestamp by noting its value is earlier than the buffer
	 * timestamp, but not more than one second earlier.
	 */
	dpt = (char *)rbufp->recv_buffer;
	dpend = dpt + rbufp->recv_length;
	trtmp = rbufp->recv_time;
	if (dpend >= dpt + 8) {
		if (buftvtots(dpend - 8, &tstmp)) {
			L_SUB(&trtmp, &tstmp);
			if (trtmp.l_ui == 0) {
#ifdef DEBUG
				if (debug > 1) {
					printf(
					    "refclock_gtlin: fd %d ldisc %s",
					    rbufp->fd, lfptoa(&trtmp,
					    6));
					get_systime(&trtmp);
					L_SUB(&trtmp, &tstmp);
					printf(" sigio %s\n",
					    lfptoa(&trtmp, 6));
				}
#endif
				dpend -= 8;
				trtmp = tstmp;
			} else
				trtmp = rbufp->recv_time;
		}
	}

	/*
	 * Copy the raw buffer to the user string. The string is padded
	 * with a NULL, which is not included in the character count.
	 */
	if (dpend - dpt > bmax - 1)
		dpend = dpt + bmax - 1;
	for (dp = lineptr; dpt < dpend; dpt++)
		*dp++ = *dpt;
	*dp = '\0';
	i = dp - lineptr;
#ifdef DEBUG
	if (debug > 1)
		printf("refclock_gtraw: fd %d time %s timecode %d %s\n",
		    rbufp->fd, ulfptoa(&trtmp, 6), i, lineptr);
#endif
	*tsptr = trtmp;
	return (i);
}


/*
 * The following code does not apply to WINNT & VMS ...
 */
#if !defined SYS_VXWORKS && !defined SYS_WINNT
#if defined(HAVE_TERMIOS) || defined(HAVE_SYSV_TTYS) || defined(HAVE_BSD_TTYS)

/*
 * refclock_open - open serial port for reference clock
 *
 * This routine opens a serial port for I/O and sets default options. It
 * returns the file descriptor if success and zero if failure.
 */
int
refclock_open(
	char	*dev,		/* device name pointer */
	u_int	speed,		/* serial port speed (code) */
	u_int	lflags		/* line discipline flags */
	)
{
	int	fd;
	int	omode;
#ifdef O_NONBLOCK
	char    trash[128];	/* litter bin for old input data */
#endif

	/*
	 * Open serial port and set default options
	 */
	omode = O_RDWR;
#ifdef O_NONBLOCK
	omode |= O_NONBLOCK;
#endif
#ifdef O_NOCTTY
	omode |= O_NOCTTY;
#endif

	fd = open(dev, omode, 0777);
	if (fd < 0) {
		msyslog(LOG_ERR, "refclock_open %s: %m", dev);
		return (0);
	}
	NTP_INSIST(fd != 0);
	if (!refclock_setup(fd, speed, lflags)) {
		close(fd);
		return (0);
	}
	if (!refclock_ioctl(fd, lflags)) {
		close(fd);
		return (0);
	}
#ifdef O_NONBLOCK
	/*
	 * We want to make sure there is no pending trash in the input
	 * buffer. Since we have non-blocking IO available, this is a
	 * good moment to read and dump all available outdated stuff
	 * that might have become toxic for the driver.
	 */
	while (read(fd, trash, sizeof(trash)) > 0 || errno == EINTR)
		/*NOP*/;
#endif
	return (fd);
}


/*
 * refclock_setup - initialize terminal interface structure
 */
int
refclock_setup(
	int	fd,		/* file descriptor */
	u_int	speed,		/* serial port speed (code) */
	u_int	lflags		/* line discipline flags */
	)
{
	int	i;
	TTY	ttyb, *ttyp;
#ifdef PPS
	fdpps = fd;		/* ppsclock legacy */
#endif /* PPS */

	/*
	 * By default, the serial line port is initialized in canonical
	 * (line-oriented) mode at specified line speed, 8 bits and no
	 * parity. LF ends the line and CR is mapped to LF. The break,
	 * erase and kill functions are disabled. There is a different
	 * section for each terminal interface, as selected at compile
	 * time. The flag bits can be used to set raw mode and echo.
	 */
	ttyp = &ttyb;
#ifdef HAVE_TERMIOS

	/*
	 * POSIX serial line parameters (termios interface)
	 */
	if (tcgetattr(fd, ttyp) < 0) {
		msyslog(LOG_ERR,
			"refclock_setup fd %d tcgetattr: %m", fd);
		return (0);
	}

	/*
	 * Set canonical mode and local connection; set specified speed,
	 * 8 bits and no parity; map CR to NL; ignore break.
	 */
	if (speed) {
		u_int	ltemp = 0;

		ttyp->c_iflag = IGNBRK | IGNPAR | ICRNL;
		ttyp->c_oflag = 0;
		ttyp->c_cflag = CS8 | CLOCAL | CREAD;
		if (lflags & LDISC_7O1) {
			/* HP Z3801A needs 7-bit, odd parity */
  			ttyp->c_cflag = CS7 | PARENB | PARODD | CLOCAL | CREAD;
		}
		cfsetispeed(&ttyb, speed);
		cfsetospeed(&ttyb, speed);
		for (i = 0; i < NCCS; ++i)
			ttyp->c_cc[i] = '\0';

#if defined(TIOCMGET) && !defined(SCO5_CLOCK)

		/*
		 * If we have modem control, check to see if modem leads
		 * are active; if so, set remote connection. This is
		 * necessary for the kernel pps mods to work.
		 */
		if (ioctl(fd, TIOCMGET, (char *)<emp) < 0)
			msyslog(LOG_ERR,
			    "refclock_setup fd %d TIOCMGET: %m", fd);
#ifdef DEBUG
		if (debug)
			printf("refclock_setup fd %d modem status: 0x%x\n",
			    fd, ltemp);
#endif
		if (ltemp & TIOCM_DSR && lflags & LDISC_REMOTE)
			ttyp->c_cflag &= ~CLOCAL;
#endif /* TIOCMGET */
	}

	/*
	 * Set raw and echo modes. These can be changed on-fly.
	 */
	ttyp->c_lflag = ICANON;
	if (lflags & LDISC_RAW) {
		ttyp->c_lflag = 0;
		ttyp->c_iflag = 0;
		ttyp->c_cc[VMIN] = 1;
	}
	if (lflags & LDISC_ECHO)
		ttyp->c_lflag |= ECHO;
	if (tcsetattr(fd, TCSANOW, ttyp) < 0) {
		msyslog(LOG_ERR,
		    "refclock_setup fd %d TCSANOW: %m", fd);
		return (0);
	}

	/*
	 * flush input and output buffers to discard any outdated stuff
	 * that might have become toxic for the driver. Failing to do so
	 * is logged, but we keep our fingers crossed otherwise.
	 */
	if (tcflush(fd, TCIOFLUSH) < 0)
		msyslog(LOG_ERR, "refclock_setup fd %d tcflush(): %m", fd);
#endif /* HAVE_TERMIOS */

#ifdef HAVE_SYSV_TTYS

	/*
	 * System V serial line parameters (termio interface)
	 *
	 */
	if (ioctl(fd, TCGETA, ttyp) < 0) {
		msyslog(LOG_ERR,
		    "refclock_setup fd %d TCGETA: %m", fd);
		return (0);
	}

	/*
	 * Set canonical mode and local connection; set specified speed,
	 * 8 bits and no parity; map CR to NL; ignore break.
	 */
	if (speed) {
		u_int	ltemp = 0;

		ttyp->c_iflag = IGNBRK | IGNPAR | ICRNL;
		ttyp->c_oflag = 0;
		ttyp->c_cflag = speed | CS8 | CLOCAL | CREAD;
		for (i = 0; i < NCCS; ++i)
			ttyp->c_cc[i] = '\0';

#if defined(TIOCMGET) && !defined(SCO5_CLOCK)

		/*
		 * If we have modem control, check to see if modem leads
		 * are active; if so, set remote connection. This is
		 * necessary for the kernel pps mods to work.
		 */
		if (ioctl(fd, TIOCMGET, (char *)<emp) < 0)
			msyslog(LOG_ERR,
			    "refclock_setup fd %d TIOCMGET: %m", fd);
#ifdef DEBUG
		if (debug)
			printf("refclock_setup fd %d modem status: %x\n",
			    fd, ltemp);
#endif
		if (ltemp & TIOCM_DSR)
			ttyp->c_cflag &= ~CLOCAL;
#endif /* TIOCMGET */
	}

	/*
	 * Set raw and echo modes. These can be changed on-fly.
	 */
	ttyp->c_lflag = ICANON;
	if (lflags & LDISC_RAW) {
		ttyp->c_lflag = 0;
		ttyp->c_iflag = 0;
		ttyp->c_cc[VMIN] = 1;
	}
	if (ioctl(fd, TCSETA, ttyp) < 0) {
		msyslog(LOG_ERR,
		    "refclock_setup fd %d TCSETA: %m", fd);
		return (0);
	}
#endif /* HAVE_SYSV_TTYS */

#ifdef HAVE_BSD_TTYS

	/*
	 * 4.3bsd serial line parameters (sgttyb interface)
	 */
	if (ioctl(fd, TIOCGETP, (char *)ttyp) < 0) {
		msyslog(LOG_ERR,
		    "refclock_setup fd %d TIOCGETP: %m", fd);
		return (0);
	}
	if (speed)
		ttyp->sg_ispeed = ttyp->sg_ospeed = speed;
	ttyp->sg_flags = EVENP | ODDP | CRMOD;
	if (ioctl(fd, TIOCSETP, (char *)ttyp) < 0) {
		msyslog(LOG_ERR,
		    "refclock_setup TIOCSETP: %m");
		return (0);
	}
#endif /* HAVE_BSD_TTYS */
	return(1);
}
#endif /* HAVE_TERMIOS || HAVE_SYSV_TTYS || HAVE_BSD_TTYS */
#endif /* SYS_VXWORKS SYS_WINNT */


/*
 * refclock_ioctl - set serial port control functions
 *
 * This routine attempts to hide the internal, system-specific details
 * of serial ports. It can handle POSIX (termios), SYSV (termio) and BSD
 * (sgtty) interfaces with varying degrees of success. The routine sets
 * up optional features such as tty_clk. The routine returns 1 if
 * success and 0 if failure.
 */
int
refclock_ioctl(
	int	fd, 		/* file descriptor */
	u_int	lflags		/* line discipline flags */
	)
{
	/*
	 * simply return 1 if no UNIX line discipline is supported
	 */
#if !defined SYS_VXWORKS && !defined SYS_WINNT
#if defined(HAVE_TERMIOS) || defined(HAVE_SYSV_TTYS) || defined(HAVE_BSD_TTYS)

#ifdef DEBUG
	if (debug)
		printf("refclock_ioctl: fd %d flags 0x%x\n", fd,
		    lflags);
#endif
#ifdef TTYCLK

	/*
	 * The TTYCLK option provides timestamping at the driver level.
	 * It requires the tty_clk streams module and System V STREAMS
	 * support. If not available, don't complain.
	 */
	if (lflags & (LDISC_CLK | LDISC_CLKPPS | LDISC_ACTS)) {
		int rval = 0;

		if (ioctl(fd, I_PUSH, "clk") < 0) {
			msyslog(LOG_NOTICE,
			    "refclock_ioctl fd %d I_PUSH: %m", fd);
			return (0);
#ifdef CLK_SETSTR
		} else {
			char *str;

			if (lflags & LDISC_CLKPPS)
				str = "\377";
			else if (lflags & LDISC_ACTS)
				str = "*";
			else
				str = "\n";
			if (ioctl(fd, CLK_SETSTR, str) < 0) {
				msyslog(LOG_ERR,
				    "refclock_ioctl fd %d CLK_SETSTR: %m", fd);
				return (0);
			}
#endif /*CLK_SETSTR */
		}
	}
#endif /* TTYCLK */
#endif /* HAVE_TERMIOS || HAVE_SYSV_TTYS || HAVE_BSD_TTYS */
#endif /* SYS_VXWORKS SYS_WINNT */
	return (1);
}


/*
 * refclock_control - set and/or return clock values
 *
 * This routine is used mainly for debugging. It returns designated
 * values from the interface structure that can be displayed using
 * ntpdc and the clockstat command. It can also be used to initialize
 * configuration variables, such as fudgetimes, fudgevalues, reference
 * ID and stratum.
 */
void
refclock_control(
	sockaddr_u *srcadr,
	struct refclockstat *in,
	struct refclockstat *out
	)
{
	struct peer *peer;
	struct refclockproc *pp;
	u_char clktype;
	int unit;

	/*
	 * Check for valid address and running peer
	 */
	if (!ISREFCLOCKADR(srcadr))
		return;

	clktype = (u_char)REFCLOCKTYPE(srcadr);
	unit = REFCLOCKUNIT(srcadr);

	peer = findexistingpeer(srcadr, NULL, -1, 0);

	if (NULL == peer || NULL == peer->procptr)
		return;

	pp = peer->procptr;

	/*
	 * Initialize requested data
	 */
	if (in != 0) {
		if (in->haveflags & CLK_HAVETIME1)
			pp->fudgetime1 = in->fudgetime1;
		if (in->haveflags & CLK_HAVETIME2)
			pp->fudgetime2 = in->fudgetime2;
		if (in->haveflags & CLK_HAVEVAL1)
			peer->stratum = pp->stratum = (u_char)in->fudgeval1;
		if (in->haveflags & CLK_HAVEVAL2)
			peer->refid = pp->refid = in->fudgeval2;
		if (in->haveflags & CLK_HAVEFLAG1) {
			pp->sloppyclockflag &= ~CLK_FLAG1;
			pp->sloppyclockflag |= in->flags & CLK_FLAG1;
		}
		if (in->haveflags & CLK_HAVEFLAG2) {
			pp->sloppyclockflag &= ~CLK_FLAG2;
			pp->sloppyclockflag |= in->flags & CLK_FLAG2;
		}
		if (in->haveflags & CLK_HAVEFLAG3) {
			pp->sloppyclockflag &= ~CLK_FLAG3;
			pp->sloppyclockflag |= in->flags & CLK_FLAG3;
		}
		if (in->haveflags & CLK_HAVEFLAG4) {
			pp->sloppyclockflag &= ~CLK_FLAG4;
			pp->sloppyclockflag |= in->flags & CLK_FLAG4;
		}
	}

	/*
	 * Readback requested data
	 */
	if (out != 0) {
		out->haveflags = CLK_HAVETIME1 | CLK_HAVEVAL1 |
			CLK_HAVEVAL2 | CLK_HAVEFLAG4;
		out->fudgetime1 = pp->fudgetime1;
		out->fudgetime2 = pp->fudgetime2;
		out->fudgeval1 = pp->stratum;
		out->fudgeval2 = pp->refid;
		out->flags = (u_char) pp->sloppyclockflag;

		out->timereset = current_time - pp->timestarted;
		out->polls = pp->polls;
		out->noresponse = pp->noreply;
		out->badformat = pp->badformat;
		out->baddata = pp->baddata;

		out->lastevent = pp->lastevent;
		out->currentstatus = pp->currentstatus;
		out->type = pp->type;
		out->clockdesc = pp->clockdesc;
		out->lencode = (u_short)pp->lencode;
		out->p_lastcode = pp->a_lastcode;
	}

	/*
	 * Give the stuff to the clock
	 */
	if (refclock_conf[clktype]->clock_control != noentry)
		(refclock_conf[clktype]->clock_control)(unit, in, out, peer);
}


/*
 * refclock_buginfo - return debugging info
 *
 * This routine is used mainly for debugging. It returns designated
 * values from the interface structure that can be displayed using
 * ntpdc and the clkbug command.
 */
void
refclock_buginfo(
	sockaddr_u *srcadr,	/* clock address */
	struct refclockbug *bug /* output structure */
	)
{
	struct peer *peer;
	struct refclockproc *pp;
	int clktype;
	int unit;
	unsigned u;

	/*
	 * Check for valid address and peer structure
	 */
	if (!ISREFCLOCKADR(srcadr))
		return;

	clktype = (u_char) REFCLOCKTYPE(srcadr);
	unit = REFCLOCKUNIT(srcadr);

	peer = findexistingpeer(srcadr, NULL, -1, 0);

	if (NULL == peer || NULL == peer->procptr)
		return;

	pp = peer->procptr;

	/*
	 * Copy structure values
	 */
	bug->nvalues = 8;
	bug->svalues = 0x0000003f;
	bug->values[0] = pp->year;
	bug->values[1] = pp->day;
	bug->values[2] = pp->hour;
	bug->values[3] = pp->minute;
	bug->values[4] = pp->second;
	bug->values[5] = pp->nsec;
	bug->values[6] = pp->yearstart;
	bug->values[7] = pp->coderecv;
	bug->stimes = 0xfffffffc;
	bug->times[0] = pp->lastref;
	bug->times[1] = pp->lastrec;
	for (u = 2; u < bug->ntimes; u++)
		DTOLFP(pp->filter[u - 2], &bug->times[u]);

	/*
	 * Give the stuff to the clock
	 */
	if (refclock_conf[clktype]->clock_buginfo != noentry)
		(refclock_conf[clktype]->clock_buginfo)(unit, bug, peer);
}


#ifdef HAVE_PPSAPI
/*
 * refclock_ppsapi - initialize/update ppsapi
 *
 * This routine is called after the fudge command to open the PPSAPI
 * interface for later parameter setting after the fudge command.
 */
int
refclock_ppsapi(
	int	fddev,			/* fd device */
	struct refclock_atom *ap	/* atom structure pointer */
	)
{
	if (ap->handle == 0) {
		if (time_pps_create(fddev, &ap->handle) < 0) {
			msyslog(LOG_ERR,
			    "refclock_ppsapi: time_pps_create: %m");
			return (0);
		}
	}
	return (1);
}


/*
 * refclock_params - set ppsapi parameters
 *
 * This routine is called to set the PPSAPI parameters after the fudge
 * command.
 */
int
refclock_params(
	int	mode,			/* mode bits */
	struct refclock_atom *ap	/* atom structure pointer */
	)
{
	memset(&ap->pps_params, 0, sizeof(pps_params_t));
	ap->pps_params.api_version = PPS_API_VERS_1;

	/*
	 * Solaris serial ports provide PPS pulse capture only on the
	 * assert edge. FreeBSD serial ports provide capture on the
	 * clear edge, while FreeBSD parallel ports provide capture
	 * on the assert edge. Your mileage may vary.
	 */
	if (mode & CLK_FLAG2)
		ap->pps_params.mode = PPS_TSFMT_TSPEC | PPS_CAPTURECLEAR;
	else
		ap->pps_params.mode = PPS_TSFMT_TSPEC | PPS_CAPTUREASSERT;
	if (time_pps_setparams(ap->handle, &ap->pps_params) < 0) {
		msyslog(LOG_ERR,
		    "refclock_params: time_pps_setparams: %m");
		return (0);
	}

	/*
	 * If flag3 is lit, select the kernel PPS.
	 */
	if (mode & CLK_FLAG3) {
		if (time_pps_kcbind(ap->handle, PPS_KC_HARDPPS,
		    ap->pps_params.mode & ~PPS_TSFMT_TSPEC,
		    PPS_TSFMT_TSPEC) < 0) {
			if (errno != EOPNOTSUPP) { 
				msyslog(LOG_ERR,
				    "refclock_params: time_pps_kcbind: %m");
				return (0);
			}
		}
		pps_enable = 1;
	}
	return (1);
}


/*
 * refclock_pps - called once per second
 *
 * This routine is called once per second. It snatches the PPS
 * timestamp from the kernel and saves the sign-extended fraction in
 * a circular buffer for processing at the next poll event.
 */
int
refclock_pps(
	struct peer *peer,		/* peer structure pointer */
	struct refclock_atom *ap,	/* atom structure pointer */
	int	mode			/* mode bits */	
	)
{
	struct refclockproc *pp;
	pps_info_t pps_info;
	struct timespec timeout;
	double	dtemp;

	/*
	 * We require the clock to be synchronized before setting the
	 * parameters. When the parameters have been set, fetch the
	 * most recent PPS timestamp.
	 */ 
	pp = peer->procptr;
	if (ap->handle == 0)
		return (0);

	if (ap->pps_params.mode == 0 && sys_leap != LEAP_NOTINSYNC) {
		if (refclock_params(pp->sloppyclockflag, ap) < 1)
			return (0);
	}
	timeout.tv_sec = 0;
	timeout.tv_nsec = 0;
	memset(&pps_info, 0, sizeof(pps_info_t));
	if (time_pps_fetch(ap->handle, PPS_TSFMT_TSPEC, &pps_info,
	    &timeout) < 0) {
		refclock_report(peer, CEVNT_FAULT);
		return (0);
	}
	timeout = ap->ts;
	if (ap->pps_params.mode & PPS_CAPTUREASSERT)
		ap->ts = pps_info.assert_timestamp;
	else if (ap->pps_params.mode & PPS_CAPTURECLEAR)
		ap->ts = pps_info.clear_timestamp;
	else
		return (0);
	
	/*
	 * There can be zero, one or two PPS pulses between polls,
	 * depending on the poll interval relative to the PPS interval.
	 * The pulse must be newer and within the range gate relative
	 * to the last pulse.
	 */
	if (ap->ts.tv_sec <= timeout.tv_sec || abs(ap->ts.tv_nsec -
	    timeout.tv_nsec) > RANGEGATE)
		return (0);

	/*
	 * Convert to signed fraction offset and stuff in median filter.
	 */
	pp->lastrec.l_ui = (u_int32)ap->ts.tv_sec + JAN_1970;
	dtemp = ap->ts.tv_nsec / 1e9;
	pp->lastrec.l_uf = (u_int32)(dtemp * FRAC);
	if (dtemp > .5)
		dtemp -= 1.;
	SAMPLE(-dtemp + pp->fudgetime1);
#ifdef DEBUG
	if (debug > 1)
		printf("refclock_pps: %lu %f %f\n", current_time,
		    dtemp, pp->fudgetime1);
#endif
	return (1);
}
#endif /* HAVE_PPSAPI */
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_hopfpci.c0000644000175000017500000001323411332473273016232 0ustar  peterpeter/*
 * refclock_hopfpci.c
 *
 * - clock driver for hopf 6039 PCI board (GPS or DCF77)
 * Bernd Altmeier altmeier@atlsoft.de
 *
 * latest source and further information can be found at:
 * http://www.ATLSoft.de/ntp
 *
 * In order to run this driver you have to install and test
 * the PCI-board driver for your system first.
 *
 * On Linux/UNIX
 *
 * The driver attempts to open the device /dev/hopf6039 .
 * The device entry will be made by the installation process of
 * the kernel module for the PCI-bus board. The driver sources
 * belongs to the delivery equipment of the PCI-board.
 *
 * On Windows NT/2000
 *
 * The driver attempts to open the device by calling the function
 * "OpenHopfDevice()". This function will be installed by the
 * Device Driver for the PCI-bus board. The driver belongs to the
 * delivery equipment of the PCI-board.
 *
 *
 * Start   21.03.2000 Revision: 01.20
 * changes 22.12.2000 Revision: 01.40 flag1 = 1 sync even if Quarz
 *
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_HOPF_PCI)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"

#undef fileno
#include 
#undef fileno

#ifndef SYS_WINNT
# include 
# include 
# include 
# include 
# include 
# include "hopf6039.h"
#else
# include "hopf_PCI_io.h"
#endif

/*
 * hopfpci interface definitions
 */
#define PRECISION       (-10)    /* precision assumed (1 ms) */
#define REFID           "hopf"   /* reference ID */
#define DESCRIPTION     "hopf Elektronik PCI radio board"

#define NSAMPLES        3       /* stages of median filter */
#ifndef SYS_WINNT
# define	DEVICE	"/dev/hopf6039" 	/* device name inode*/
#else
# define	DEVICE	"hopf6039" 	/* device name WinNT  */
#endif

#define LEWAPWAR	0x20	/* leap second warning bit */

#define	HOPF_OPMODE	0xC0	/* operation mode mask */
#define HOPF_INVALID	0x00	/* no time code available */
#define HOPF_INTERNAL	0x40	/* internal clock */
#define HOPF_RADIO	0x80	/* radio clock */
#define HOPF_RADIOHP	0xC0	/* high precision radio clock */


/*
 * hopfclock unit control structure.
 */
struct hopfclock_unit {
	short	unit;		/* NTP refclock unit number */
	char	leap_status;	/* leap second flag */
};
int	fd;			/* file descr. */

/*
 * Function prototypes
 */
static  int     hopfpci_start       (int, struct peer *);
static  void    hopfpci_shutdown    (int, struct peer *);
static  void    hopfpci_poll        (int unit, struct peer *);

/*
 * Transfer vector
 */
struct  refclock refclock_hopfpci = {
	hopfpci_start,          /* start up driver */
	hopfpci_shutdown,       /* shut down driver */
	hopfpci_poll,           /* transmit poll message */
	noentry,                /* not used */
	noentry,                /* initialize driver (not used) */
	noentry,                /* not used */
	NOFLAGS                 /* not used */
};

/*
 * hopfpci_start - attach to hopf PCI board 6039
 */
static int
hopfpci_start(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	struct hopfclock_unit *up;

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));

#ifndef SYS_WINNT

 	fd = open(DEVICE,O_RDWR); /* try to open hopf clock device */

#else
	if (!OpenHopfDevice()) {
		msyslog(LOG_ERR, "Start: %s unit: %d failed!", DEVICE, unit);
		free(up);
		return (0);
	}
#endif

	pp = peer->procptr;
	pp->io.clock_recv = noentry;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = INVALID_SOCKET;
	pp->unitptr = (caddr_t)up;

	get_systime(&pp->lastrec);

	/*
	 * Initialize miscellaneous peer variables
	 */
	memcpy((char *)&pp->refid, REFID, 4);
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	up->leap_status = 0;
	up->unit = (short) unit;
	return (1);
}


/*
 * hopfpci_shutdown - shut down the clock
 */
static void
hopfpci_shutdown(
	int unit,
	struct peer *peer
	)
{

#ifndef SYS_WINNT
	close(fd);
#else
	CloseHopfDevice();
#endif
	if (NULL != peer->procptr->unitptr)
		free(peer->procptr->unitptr);
}


/*
 * hopfpci_poll - called by the transmit procedure
 */
static void
hopfpci_poll(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;
	HOPFTIME m_time;

	pp = peer->procptr;

#ifndef SYS_WINNT
	ioctl(fd,HOPF_CLOCK_GET_UTC,&m_time);
#else
	GetHopfSystemTime(&m_time);
#endif
	pp->polls++;

	pp->day    = ymd2yd(m_time.wYear,m_time.wMonth,m_time.wDay);
	pp->hour   = m_time.wHour;
	pp->minute = m_time.wMinute;
	pp->second = m_time.wSecond;
	pp->nsec   = m_time.wMilliseconds * 1000000;
	if (m_time.wStatus & LEWAPWAR)
		pp->leap = LEAP_ADDSECOND;
	else
		pp->leap = LEAP_NOWARNING;

	snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
		 "ST: %02X T: %02d:%02d:%02d.%03ld D: %02d.%02d.%04d",
		 m_time.wStatus, pp->hour, pp->minute, pp->second,
		 pp->nsec / 1000000, m_time.wDay, m_time.wMonth,
		 m_time.wYear);
	pp->lencode = (u_short)strlen(pp->a_lastcode);

	get_systime(&pp->lastrec);

	/*
	 * If clock has no valid status then report error and exit
	 */
	if ((m_time.wStatus & HOPF_OPMODE) == HOPF_INVALID) {  /* time ok? */
		refclock_report(peer, CEVNT_BADTIME);
		pp->leap = LEAP_NOTINSYNC;
		return;
	}

	/*
	 * Test if time is running on internal quarz
	 * if CLK_FLAG1 is set, sychronize even if no radio operation
	 */

	if ((m_time.wStatus & HOPF_OPMODE) == HOPF_INTERNAL){
		if ((pp->sloppyclockflag & CLK_FLAG1) == 0) {
			refclock_report(peer, CEVNT_BADTIME);
			pp->leap = LEAP_NOTINSYNC;
			return;
		}
	}

	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	pp->lastref = pp->lastrec;
	refclock_receive(peer);
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
	return;
}

#else
int refclock_hopfpci_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/keyword-gen-utd0000644000175000017500000000007111675457724015546 0ustar  peterpeter *	 Generated 2010-04-06 04:38:11 UTC	  diff_ignore_line
ntp-4.2.6p5/ntpd/ntpdbase-opts.def0000644000175000017500000002716711307651603016040 0ustar  peterpeter#include autogen-version.def

include = <<- _EOF_
	#ifdef __windows
	  extern int atoi(const char *);
	#else
	# include 
	#endif
	_EOF_;

test-main;

flag = {
    name      = ipv4;
    value     = 4;
    flags-cant = ipv6;
    descrip   = "Force IPv4 DNS name resolution";
    doc = <<-  _EndOfDoc_
	Force DNS resolution of following host names on the command line
	to the IPv4 namespace.
	_EndOfDoc_;
};

flag = {
    name      = ipv6;
    value     = 6;
    flags-cant = ipv4;
    descrip   = "Force IPv6 DNS name resolution";
    doc = <<-  _EndOfDoc_
	Force DNS resolution of following host names on the command line
	to the IPv6 namespace.
	_EndOfDoc_;
};

flag = {
    name      = authreq;
    value     = a;
    descrip   = "Require crypto authentication";
    flags-cant = authnoreq;
    doc = <<-  _EndOfDoc_
	Require cryptographic authentication for broadcast client,
	multicast client and symmetric passive associations.
	This is the default.
	_EndOfDoc_;
};

flag = {
    name      = authnoreq;
    value     = A;
    descrip   = "Do not require crypto authentication";
    flags-cant = authreq;
    doc = <<-  _EndOfDoc_
	Do not require cryptographic authentication for broadcast client,
	multicast client and symmetric passive associations.
	This is almost never a good idea.
	_EndOfDoc_;
};

flag = {
    name      = bcastsync;
    value     = b;
    descrip   = "Allow us to sync to broadcast servers";
    doc = <<-  _EndOfDoc_
	_EndOfDoc_;
};

flag = {
    name      = configfile;
    value     = c;
    arg-type  = string;
    descrip   = "configuration file name";
    doc = <<-  _EndOfDoc_
	The name and path of the configuration file,
	/etc/ntp.conf
	by default.
	_EndOfDoc_;
};

flag = {
    name      = debug-level;
    value     = d;
    max       = NOLIMIT;
    ifdef     = DEBUG;
    nopreset;
    descrip   = "Increase output debug message level";
    omitted-usage = "this package was built using 'configure --disable--debug'";
    doc = <<-  _EndOfDoc_
	Increase the debugging message output level.
	_EndOfDoc_;
};

flag = {
    name      = set-debug-level;
    value     = D;
    arg-type  = string;
    max       = NOLIMIT;
    ifdef     = DEBUG;
    descrip   = "Set the output debug message level";
    omitted-usage = "this package was built using 'configure --disable--debug'";
    flag-code = 'DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );';
    doc = <<-  _EndOfDoc_
	Set the output debugging level.  Can be supplied multiple times,
	but each overrides the previous value(s).
	_EndOfDoc_;
};

flag = {
    name      = driftfile;
    value     = f;
    arg-type  = string;
    descrip   = "frequency drift file name";
    doc = <<-  _EndOfDoc_
	The name and path of the frequency file,
	/etc/ntp.drift
	by default.
	This is the same operation as the
	driftfile driftfile
	configuration specification in the 
	/etc/ntp.conf
	file.
	_EndOfDoc_;
};

flag = {
    name      = panicgate;
    value     = g;
    max       = NOLIMIT;
    descrip   = "Allow the first adjustment to be Big";
    doc = <<-  _EndOfDoc_
	Normally,
	ntpd
	exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
	ntpd
	will exit with a message to the system log. This option can be used with the
	-q
	and
	-x
	options.
	See the
	tinker
	configuration file directive for other options.
	_EndOfDoc_;
};

flag = {
    ifdef     = HAVE_DROPROOT;
    name      = jaildir;
    value     = i;
    arg-type  = string;
    descrip   = "Jail directory";
    omitted-usage = "built without --enable-clockctl or --enable-linuxcaps";
    doc = <<-  _EndOfDoc_
	Chroot the server to the directory
	jaildir
	.
	This option also implies that the server attempts to drop root privileges at startup.
	You may need to also specify a
	-u
	option.
	This option is only available if the OS supports adjusting the clock
	without full root privileges.
	This option is supported under NetBSD (configure with
	--enable-clockctl
	) and Linux (configure with
	--enable-linuxcaps
	).
	_EndOfDoc_;
};

flag = {
    name      = interface;
    value     = I;
    arg-type  = string;
    descrip   = "Listen on an interface name or address";
    max       = NOLIMIT;
    arg-name  = iface;
    stack-arg;
    doc = <<-  _EndOfDoc_
	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
	interface command, which is more versatile. 
	_EndOfDoc_;
};

flag = {
    name      = keyfile;
    value     = k;
    arg-type  = string;
    descrip   = "path to symmetric keys";
    doc = <<-  _EndOfDoc_
	Specify the name and path of the symmetric key file.
	/etc/ntp.keys
	is the default.
	This is the same operation as the
	keys keyfile
	configuration file directive.
	_EndOfDoc_;
};

flag = {
    name      = logfile;
    value     = l;
    arg-type  = string;
    descrip   = "path to the log file";
    doc = <<-  _EndOfDoc_
	Specify the name and path of the log file.
	The default is the system log file.
	This is the same operation as the
	logfile logfile
	configuration file directive.
	_EndOfDoc_;
};

flag = {
    name      = novirtualips;
    value     = L;
    descrip   = "Do not listen to virtual interfaces";
    doc = <<-  _EndOfDoc_
	Do not listen to virtual interfaces, defined as those with
	names containing a colon.  This option is deprecated.  Please
	consider using the configuration file interface command, which
	is more versatile.
	_EndOfDoc_;
};

flag = {
    ifdef     = SYS_WINNT;
    name      = modifymmtimer;
    value     = M;
    descrip   = "Modify Multimedia Timer (Windows only)";
    doc = <<-  _EndOfDoc_
	Set the Windows Multimedia Timer to highest resolution.  This
	ensures the resolution does not change while ntpd is running,
	avoiding timekeeping glitches associated with changes.
	_EndOfDoc_;
};

flag = {
    name      = nofork;
    value     = n;
    descrip   = "Do not fork";
    doc = <<-  _EndOfDoc_
	_EndOfDoc_;
};

flag = {
    name      = nice;
    value     = N;
    descrip   = "Run at high priority";
    doc = <<-  _EndOfDoc_
	To the extent permitted by the operating system, run
	ntpd
	at the highest priority.
	_EndOfDoc_;
};

flag = {
    name      = pidfile;
    value     = p;
    arg-type  = string;
    descrip   = "path to the PID file";
    doc = <<-  _EndOfDoc_
	Specify the name and path of the file used to record
	ntpd's
	process ID.
	This is the same operation as the
	pidfile pidfile
	configuration file directive.
	_EndOfDoc_;
};

flag = {
    name      = priority;
    value     = P;
    arg-type  = number;
    descrip   = "Process priority";
    doc = <<-  _EndOfDoc_
	To the extent permitted by the operating system, run
	ntpd
	at the specified
	sched_setscheduler(SCHED_FIFO)
	priority.
	_EndOfDoc_;
};

flag = {
    name      = quit;
    value     = q;
    descrip   = "Set the time and quit";
    doc = <<-  _EndOfDoc_
	ntpd
	will exit just after the first time the clock is set. This behavior mimics that of the
	ntpdate
	program, which is to be retired.
	The
	-g
	and
	-x
	options can be used with this option.
	Note: The kernel time discipline is disabled with this option.
	_EndOfDoc_;
};

flag = {
    name      = propagationdelay;
    value     = r;
    arg-type  = string;
    descrip   = "Broadcast/propagation delay";
    doc = <<-  _EndOfDoc_
	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.
	_EndOfDoc_;
};

flag = {
    ifdef     = SAVECONFIG;
    name      = saveconfigquit;
    arg-type  = string;
    descrip   = "Save parsed configuration and quit";
    doc = <<-  _EndOfDoc_
	Cause ntpd to parse its startup configuration file and save an
	equivalent to the given filename and exit.  This option was
	designed for automated testing.
	_EndOfDoc_;
};

flag = {
    name      = statsdir;
    value     = s;
    arg-type  = string;
    descrip   = "Statistics file location";
    doc = <<-  _EndOfDoc_
	Specify the directory path for files created by the statistics facility.
	This is the same operation as the
	statsdir statsdir
	configuration file directive.
	_EndOfDoc_;
};

flag = {
    name      = trustedkey;
    value     = t;
    arg-type  = string;
    descrip   = "Trusted key number";
    max       = NOLIMIT;
    arg-name  = tkey;
    stack-arg;
    doc = <<-  _EndOfDoc_
	Add a key number to the trusted key list.
	_EndOfDoc_;
};

flag = {
    ifdef     = HAVE_DROPROOT;
    name      = user;
    value     = u;
    arg-type  = string;
    descrip   = "Run as userid (or userid:groupid)";
    omitted-usage = "built without --enable-clockctl or --enable-linuxcaps";
    doc = <<-  _EndOfDoc_
	Specify a user, and optionally a group, to switch to.
	This option is only available if the OS supports adjusting the clock
	without full root privileges.
	This option is supported under NetBSD (configure with
	--enable-clockctl
	) and Linux (configure with
	--enable-linuxcaps
	).
	_EndOfDoc_;
};

flag = {
    name      = updateinterval;
    value     = U;
    arg-type  = number;
    descrip   = "interval in seconds between scans for new or dropped interfaces";
    doc = <<-  _EndOfDoc_
	Give the time in seconds between two scans for new or dropped interfaces.
	For systems with routing socket support the scans will be performed shortly after the interface change
	has been detected by the system.
	Use 0 to disable scanning. 60 seconds is the minimum time between scans.
	_EndOfDoc_;
};

flag = {
    name      = var;
/*    value     = v;	Bug 817 */
    arg-type  = string;
    descrip   = "make ARG an ntp variable (RW)";
    max       = NOLIMIT;
    arg-name  = nvar;
    stack-arg;
    doc = <<-  _EndOfDoc_
	_EndOfDoc_;
};

flag = {
    name      = dvar;
/*    value     = V;	Bug 817 */
    arg-type  = string;
    descrip   = "make ARG an ntp variable (RW|DEF)";
    max       = NOLIMIT;
    arg-name  = ndvar;
    stack-arg;
    doc = <<-  _EndOfDoc_
	_EndOfDoc_;
};

flag = {
    name      = slew;
    value     = x;
    descrip   = "Slew up to 600 seconds";
    doc = <<-  _EndOfDoc_
	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.
	Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
	Thus, an adjustment as much as 600 s will take almost 14 days to complete.
	This option can be used with the
	-g
	and
	-q
	options.
	See the
	tinker
	configuration file directive for other options.
	Note: The kernel time discipline is disabled with this option.
	_EndOfDoc_;
};

flag = {
    ifdef     = SYS_WINNT;
    name      = usepcc;
    descrip   = "Use CPU cycle counter (Windows only)";
    doc = <<-  _EndOfDoc_
	Attempt to substitute the CPU counter for QueryPerformanceCounter.
	The CPU counter and QueryPerformanceCounter are compared, and if
	they have the same frequency, the CPU counter (RDTSC on x86) is
	used directly, saving the overhead of a system call.
	_EndOfDoc_;
};

flag = {
    ifdef     = SYS_WINNT;
    name      = pccfreq;
    arg-type  = string;
    descrip   = "Force CPU cycle counter use (Windows only)";
    doc = <<-  _EndOfDoc_
	Force substitution the CPU counter for QueryPerformanceCounter.
	The CPU counter (RDTSC on x86) is used unconditionally with the
	given frequency (in Hz).
	_EndOfDoc_;
};
ntp-4.2.6p5/ntpd/ntp_restrict.c0000644000175000017500000003366411362536523015464 0ustar  peterpeter/*
 * ntp_restrict.c - determine host restrictions
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#include 
#include 

#include "ntpd.h"
#include "ntp_if.h"
#include "ntp_lists.h"
#include "ntp_stdlib.h"
#include "ntp_assert.h"

/*
 * This code keeps a simple address-and-mask list of hosts we want
 * to place restrictions on (or remove them from). The restrictions
 * are implemented as a set of flags which tell you what the host
 * can't do. There is a subroutine entry to return the flags. The
 * list is kept sorted to reduce the average number of comparisons
 * and make sure you get the set of restrictions most specific to
 * the address.
 *
 * The algorithm is that, when looking up a host, it is first assumed
 * that the default set of restrictions will apply. It then searches
 * down through the list. Whenever it finds a match it adopts the
 * match's flags instead. When you hit the point where the sorted
 * address is greater than the target, you return with the last set of
 * flags you found. Because of the ordering of the list, the most
 * specific match will provide the final set of flags.
 *
 * This was originally intended to restrict you from sync'ing to your
 * own broadcasts when you are doing that, by restricting yourself from
 * your own interfaces. It was also thought it would sometimes be useful
 * to keep a misbehaving host or two from abusing your primary clock. It
 * has been expanded, however, to suit the needs of those with more
 * restrictive access policies.
 */
/*
 * We will use two lists, one for IPv4 addresses and one for IPv6
 * addresses. This is not protocol-independant but for now I can't
 * find a way to respect this. We'll check this later... JFB 07/2001
 */
#define MASK_IPV6_ADDR(dst, src, msk)					\
	do {								\
		int idx;						\
		for (idx = 0; idx < COUNTOF((dst)->s6_addr); idx++) {	\
			(dst)->s6_addr[idx] = (src)->s6_addr[idx]	\
					      & (msk)->s6_addr[idx];	\
		}							\
	} while (0)

/*
 * We allocate INC_RESLIST{4|6} entries to the free list whenever empty.
 * Auto-tune these to be just less than 1KB (leaving at least 16 bytes
 * for allocator overhead).
 */
#define	INC_RESLIST4	((1024 - 16) / V4_SIZEOF_RESTRICT_U)
#define	INC_RESLIST6	((1024 - 16) / V6_SIZEOF_RESTRICT_U)

/*
 * The restriction list
 */
restrict_u *restrictlist4;
restrict_u *restrictlist6;
static int restrictcount;	/* count in the restrict lists */

/*
 * The free list and associated counters.  Also some uninteresting
 * stat counters.
 */
static restrict_u *resfree4;	/* available entries (free list) */
static restrict_u *resfree6;

static u_long res_calls;
static u_long res_found;
static u_long res_not_found;

/*
 * Count number of restriction entries referring to RES_LIMITED, to
 * control implicit activation/deactivation of the MRU monlist.
 */
static	u_long res_limited_refcnt;

/*
 * Our default entries.
 */
static	restrict_u	restrict_def4;
static	restrict_u	restrict_def6;

/*
 * "restrict source ..." enabled knob and restriction bits.
 */
static	int		restrict_source_enabled;
static	u_short		restrict_source_flags;
static	u_short		restrict_source_mflags;

/*
 * private functions
 */
static restrict_u *	alloc_res4(void);
static restrict_u *	alloc_res6(void);
static void		free_res(restrict_u *, int);
static void		inc_res_limited(void);
static void		dec_res_limited(void);
static restrict_u *	match_restrict4_addr(u_int32, u_short);
static restrict_u *	match_restrict6_addr(const struct in6_addr *,
					     u_short);
static restrict_u *	match_restrict_entry(const restrict_u *, int);
static int		res_sorts_before4(restrict_u *, restrict_u *);
static int		res_sorts_before6(restrict_u *, restrict_u *);


/*
 * init_restrict - initialize the restriction data structures
 */
void
init_restrict(void)
{
	/*
	 * The restriction lists begin with a default entry with address
	 * and mask 0, which will match any entry.  The lists are kept
	 * sorted by descending address followed by descending mask:
	 *
	 *   address	  mask
	 * 192.168.0.0	255.255.255.0	kod limited noquery nopeer
	 * 192.168.0.0	255.255.0.0	kod limited
	 * 0.0.0.0	0.0.0.0		kod limited noquery
	 *
	 * The first entry which matches an address is used.  With the
	 * example restrictions above, 192.168.0.0/24 matches the first
	 * entry, the rest of 192.168.0.0/16 matches the second, and
	 * everything else matches the third (default).
	 *
	 * Note this achieves the same result a little more efficiently
	 * than the documented behavior, which is to keep the lists
	 * sorted by ascending address followed by ascending mask, with
	 * the _last_ matching entry used.
	 *
	 * An additional wrinkle is we may have multiple entries with
	 * the same address and mask but differing match flags (mflags).
	 * At present there is only one, RESM_NTPONLY.  Entries with
	 * RESM_NTPONLY are sorted earlier so they take precedence over
	 * any otherwise similar entry without.  Again, this is the same
	 * behavior as but reversed implementation compared to the docs.
	 * 
	 */
	LINK_SLIST(restrictlist4, &restrict_def4, link);
	LINK_SLIST(restrictlist6, &restrict_def6, link);
	restrictcount = 2;
}


static restrict_u *
alloc_res4(void)
{
	const size_t	cb = V4_SIZEOF_RESTRICT_U;
	const size_t	count = INC_RESLIST4;
	restrict_u *	rl;
	restrict_u *	res;
	int		i;

	UNLINK_HEAD_SLIST(res, resfree4, link);
	if (res != NULL)
		return res;

	rl = emalloc(count * cb);
	memset(rl, 0, count * cb);
	/* link all but the first onto free list */
	res = (void *)((char *)rl + (count - 1) * cb);
	for (i = count - 1; i > 0; i--) {
		LINK_SLIST(resfree4, res, link);
		res = (void *)((char *)res - cb);
	}
	NTP_INSIST(rl == res);
	/* allocate the first */
	return res;
}


static restrict_u *
alloc_res6(void)
{
	const size_t	cb = V6_SIZEOF_RESTRICT_U;
	const size_t	count = INC_RESLIST6;
	restrict_u *	rl;
	restrict_u *	res;
	int		i;

	UNLINK_HEAD_SLIST(res, resfree6, link);
	if (res != NULL)
		return res;

	rl = emalloc(count * cb);
	memset(rl, 0, count * cb);
	/* link all but the first onto free list */
	res = (void *)((char *)rl + (count - 1) * cb);
	for (i = count - 1; i > 0; i--) {
		LINK_SLIST(resfree6, res, link);
		res = (void *)((char *)res - cb);
	}
	NTP_INSIST(rl == res);
	/* allocate the first */
	return res;
}


static void
free_res(
	restrict_u *	res,
	int		v6
	)
{
	restrict_u **	plisthead;
	restrict_u *	unlinked;

	restrictcount--;
	if (RES_LIMITED && res->flags)
		dec_res_limited();

	if (v6)
		plisthead = &restrictlist6;
	else
		plisthead = &restrictlist4;
	UNLINK_SLIST(unlinked, *plisthead, res, link, restrict_u);
	NTP_INSIST(unlinked == res);

	if (v6) {
		memset(res, 0, V6_SIZEOF_RESTRICT_U);
		plisthead = &resfree6;
	} else {
		memset(res, 0, V4_SIZEOF_RESTRICT_U);
		plisthead = &resfree4;
	}
	LINK_SLIST(*plisthead, res, link);
}


static void
inc_res_limited(void)
{
	if (!res_limited_refcnt)
		mon_start(MON_RES);
	res_limited_refcnt++;
}


static void
dec_res_limited(void)
{
	res_limited_refcnt--;
	if (!res_limited_refcnt)
		mon_stop(MON_RES);
}


static restrict_u *
match_restrict4_addr(
	u_int32	addr,
	u_short	port
	)
{
	restrict_u *	res;
	restrict_u *	next;

	for (res = restrictlist4; res != NULL; res = next) {
		next = res->link;
		if (res->u.v4.addr == (addr & res->u.v4.mask)
		    && (!(RESM_NTPONLY & res->mflags)
			|| NTP_PORT == port))
			break;
	}
	return res;
}


static restrict_u *
match_restrict6_addr(
	const struct in6_addr *	addr,
	u_short			port
	)
{
	restrict_u *	res;
	restrict_u *	next;
	struct in6_addr	masked;

	for (res = restrictlist6; res != NULL; res = next) {
		next = res->link;
		NTP_INSIST(next != res);
		MASK_IPV6_ADDR(&masked, addr, &res->u.v6.mask);
		if (ADDR6_EQ(&masked, &res->u.v6.addr)
		    && (!(RESM_NTPONLY & res->mflags)
			|| NTP_PORT == port))
			break;
	}
	return res;
}


/*
 * match_restrict_entry - find an exact match on a restrict list.
 *
 * Exact match is addr, mask, and mflags all equal.
 * In order to use more common code for IPv4 and IPv6, this routine
 * requires the caller to populate a restrict_u with mflags and either
 * the v4 or v6 address and mask as appropriate.  Other fields in the
 * input restrict_u are ignored.
 */
static restrict_u *
match_restrict_entry(
	const restrict_u *	pmatch,
	int			v6
	)
{
	restrict_u *res;
	restrict_u *rlist;
	size_t cb;

	if (v6) {
		rlist = restrictlist6;
		cb = sizeof(pmatch->u.v6);
	} else {
		rlist = restrictlist4;
		cb = sizeof(pmatch->u.v4);
	}

	for (res = rlist; res != NULL; res = res->link)
		if (res->mflags == pmatch->mflags &&
		    !memcmp(&res->u, &pmatch->u, cb))
			break;
	return res;
}


/*
 * res_sorts_before4 - compare two restrict4 entries
 *
 * Returns nonzero if r1 sorts before r2.  We sort by descending
 * address, then descending mask, then descending mflags, so sorting
 * before means having a higher value.
 */
static int
res_sorts_before4(
	restrict_u *r1,
	restrict_u *r2
	)
{
	int r1_before_r2;

	if (r1->u.v4.addr > r2->u.v4.addr)
		r1_before_r2 = 1;
	else if (r1->u.v4.addr < r2->u.v4.addr)
		r1_before_r2 = 0;
	else if (r1->u.v4.mask > r2->u.v4.mask)
		r1_before_r2 = 1;
	else if (r1->u.v4.mask < r2->u.v4.mask)
		r1_before_r2 = 0;
	else if (r1->mflags > r2->mflags)
		r1_before_r2 = 1;
	else
		r1_before_r2 = 0;

	return r1_before_r2;
}


/*
 * res_sorts_before6 - compare two restrict6 entries
 *
 * Returns nonzero if r1 sorts before r2.  We sort by descending
 * address, then descending mask, then descending mflags, so sorting
 * before means having a higher value.
 */
static int
res_sorts_before6(
	restrict_u *r1,
	restrict_u *r2
	)
{
	int r1_before_r2;
	int cmp;

	cmp = ADDR6_CMP(&r1->u.v6.addr, &r2->u.v6.addr);
	if (cmp > 0)		/* r1->addr > r2->addr */
		r1_before_r2 = 1;
	else if (cmp < 0)	/* r2->addr > r1->addr */
		r1_before_r2 = 0;
	else {
		cmp = ADDR6_CMP(&r1->u.v6.mask, &r2->u.v6.mask);
		if (cmp > 0)		/* r1->mask > r2->mask*/
			r1_before_r2 = 1;
		else if (cmp < 0)	/* r2->mask > r1->mask */
			r1_before_r2 = 0;
		else if (r1->mflags > r2->mflags)
			r1_before_r2 = 1;
		else
			r1_before_r2 = 0;
	}

	return r1_before_r2;
}


/*
 * restrictions - return restrictions for this host
 */
u_short
restrictions(
	sockaddr_u *srcadr
	)
{
	restrict_u *match;
	struct in6_addr *pin6;
	u_short flags;

	res_calls++;
	flags = 0;
	/* IPv4 source address */
	if (IS_IPV4(srcadr)) {
		/*
		 * Ignore any packets with a multicast source address
		 * (this should be done early in the receive process,
		 * not later!)
		 */
		if (IN_CLASSD(SRCADR(srcadr)))
			return (int)RES_IGNORE;

		match = match_restrict4_addr(SRCADR(srcadr),
					     SRCPORT(srcadr));
		match->count++;
		/*
		 * res_not_found counts only use of the final default
		 * entry, not any "restrict default ntpport ...", which
		 * would be just before the final default.
		 */
		if (&restrict_def4 == match)
			res_not_found++;
		else
			res_found++;
		flags = match->flags;
	}

	/* IPv6 source address */
	if (IS_IPV6(srcadr)) {
		pin6 = PSOCK_ADDR6(srcadr);

		/*
		 * Ignore any packets with a multicast source address
		 * (this should be done early in the receive process,
		 * not later!)
		 */
		if (IN6_IS_ADDR_MULTICAST(pin6))
			return (int)RES_IGNORE;

		match = match_restrict6_addr(pin6, SRCPORT(srcadr));
		match->count++;
		if (&restrict_def6 == match)
			res_not_found++;
		else
			res_found++;
		flags = match->flags;
	}
	return (flags);
}


/*
 * hack_restrict - add/subtract/manipulate entries on the restrict list
 */
void
hack_restrict(
	int		op,
	sockaddr_u *	resaddr,
	sockaddr_u *	resmask,
	u_short		mflags,
	u_short		flags
	)
{
	int		v6;
	restrict_u	match;
	restrict_u *	res;
	restrict_u **	plisthead;

	DPRINTF(1, ("restrict: op %d addr %s mask %s mflags %08x flags %08x\n",
		    op, stoa(resaddr), stoa(resmask), mflags, flags));

	if (NULL == resaddr) {
		NTP_REQUIRE(NULL == resmask);
		NTP_REQUIRE(RESTRICT_FLAGS == op);
		restrict_source_flags = flags;
		restrict_source_mflags = mflags;
		restrict_source_enabled = 1;
		return;
	}

	memset(&match, 0, sizeof(match));
	/* silence VC9 potentially uninit warnings */
	res = NULL;
	v6 = 0;

	if (IS_IPV4(resaddr)) {
		v6 = 0;
		/*
		 * Get address and mask in host byte order for easy
		 * comparison as u_int32
		 */
		match.u.v4.addr = SRCADR(resaddr);
		match.u.v4.mask = SRCADR(resmask);
		match.u.v4.addr &= match.u.v4.mask;

	} else if (IS_IPV6(resaddr)) {
		v6 = 1;
		/*
		 * Get address and mask in network byte order for easy
		 * comparison as byte sequences (e.g. memcmp())
		 */
		match.u.v6.mask = SOCK_ADDR6(resmask);
		MASK_IPV6_ADDR(&match.u.v6.addr, PSOCK_ADDR6(resaddr),
			       &match.u.v6.mask);

	} else	/* not IPv4 nor IPv6 */
		NTP_REQUIRE(0);

	match.flags = flags;
	match.mflags = mflags;
	res = match_restrict_entry(&match, v6);

	switch (op) {

	case RESTRICT_FLAGS:
		/*
		 * Here we add bits to the flags. If this is a
		 * new restriction add it.
		 */
		if (NULL == res) {
			if (v6) {
				res = alloc_res6();
				memcpy(res, &match,
				       V6_SIZEOF_RESTRICT_U);
				plisthead = &restrictlist6;
			} else {
				res = alloc_res4();
				memcpy(res, &match,
				       V4_SIZEOF_RESTRICT_U);
				plisthead = &restrictlist4;
			}
			LINK_SORT_SLIST(
				*plisthead, res,
				(v6)
				  ? res_sorts_before6(res, L_S_S_CUR())
				  : res_sorts_before4(res, L_S_S_CUR()),
				link, restrict_u);
			restrictcount++;
			if (RES_LIMITED & flags)
				inc_res_limited();
		} else {
			if ((RES_LIMITED & flags) &&
			    !(RES_LIMITED & res->flags))
				inc_res_limited();
			res->flags |= flags;
		}
		break;

	case RESTRICT_UNFLAG:
		/*
		 * Remove some bits from the flags. If we didn't
		 * find this one, just return.
		 */
		if (res != NULL) {
			if ((RES_LIMITED & res->flags)
			    && (RES_LIMITED & flags))
				dec_res_limited();
			res->flags &= ~flags;
		}
		break;

	case RESTRICT_REMOVE:
	case RESTRICT_REMOVEIF:
		/*
		 * Remove an entry from the table entirely if we
		 * found one. Don't remove the default entry and
		 * don't remove an interface entry.
		 */
		if (res != NULL
		    && (RESTRICT_REMOVEIF == op
			|| !(RESM_INTERFACE & res->mflags))
		    && res != &restrict_def4
		    && res != &restrict_def6)
			free_res(res, v6);
		break;

	default:	/* unknown op */
		NTP_INSIST(0);
		break;
	}

}

ntp-4.2.6p5/ntpd/refclock_msfees.c0000644000175000017500000013211211332473274016062 0ustar  peterpeter/* refclock_ees - clock driver for the EES M201 receiver */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_MSFEES) && defined(PPS)

/* Currently REQUIRES STREAM and PPSCD. CLK and CBREAK modes
 * were removed as the code was overly hairy, they weren't in use
 * (hence probably didn't work).  Still in RCS file at cl.cam.ac.uk
 */

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_calendar.h"

#include 
#if defined(HAVE_BSD_TTYS)
#include 
#endif /* HAVE_BSD_TTYS */
#if defined(HAVE_SYSV_TTYS)
#include 
#endif /* HAVE_SYSV_TTYS */
#if defined(HAVE_TERMIOS)
#include 
#endif
#if defined(STREAM)
#include 
#endif

#ifdef HAVE_SYS_TERMIOS_H
# include 
#endif
#ifdef HAVE_SYS_PPSCLOCK_H
# include 
#endif

#include "ntp_stdlib.h"

int dbg = 0;
/*
	fudgefactor	= fudgetime1;
	os_delay	= fudgetime2;
	   offset_fudge	= os_delay + fudgefactor + inherent_delay;
	stratumtouse	= fudgeval1 & 0xf
	dbg		= fudgeval2;
	sloppyclockflag	= flags & CLK_FLAG1;
		1	  log smoothing summary when processing sample
		4	  dump the buffer from the clock
		8	  EIOGETKD the last n uS time stamps
	if (flags & CLK_FLAG2 && unitinuse) ees->leaphold = 0;
	ees->dump_vals	= flags & CLK_FLAG3;
	ees->usealldata	= flags & CLK_FLAG4;


	bug->values[0] = (ees->lasttime) ? current_time - ees->lasttime : 0;
	bug->values[1] = (ees->clocklastgood)?current_time-ees->clocklastgood:0;
	bug->values[2] = (u_long)ees->status;
	bug->values[3] = (u_long)ees->lastevent;
	bug->values[4] = (u_long)ees->reason;
	bug->values[5] = (u_long)ees->nsamples;
	bug->values[6] = (u_long)ees->codestate;
	bug->values[7] = (u_long)ees->day;
	bug->values[8] = (u_long)ees->hour;
	bug->values[9] = (u_long)ees->minute;
	bug->values[10] = (u_long)ees->second;
	bug->values[11] = (u_long)ees->tz;
	bug->values[12] = ees->yearstart;
	bug->values[13] = (ees->leaphold > current_time) ?
				ees->leaphold - current_time : 0;
	bug->values[14] = inherent_delay[unit].l_uf;
	bug->values[15] = offset_fudge[unit].l_uf;

	bug->times[0] = ees->reftime;
	bug->times[1] = ees->arrvtime;
	bug->times[2] = ees->lastsampletime;
	bug->times[3] = ees->offset;
	bug->times[4] = ees->lowoffset;
	bug->times[5] = ees->highoffset;
	bug->times[6] = inherent_delay[unit];
	bug->times[8] = os_delay[unit];
	bug->times[7] = fudgefactor[unit];
	bug->times[9] = offset_fudge[unit];
	bug->times[10]= ees->yearstart, 0;
	*/

/* This should support the use of an EES M201 receiver with RS232
 * output (modified to transmit time once per second).
 *
 * For the format of the message sent by the clock, see the EESM_
 * definitions below.
 *
 * It appears to run free for an integral number of minutes, until the error
 * reaches 4mS, at which point it steps at second = 01.
 * It appears that sometimes it steps 4mS (say at 7 min interval),
 * then the next minute it decides that it was an error, so steps back.
 * On the next minute it steps forward again :-(
 * This is typically 16.5uS/S then 3975uS at the 4min re-sync,
 * or 9.5uS/S then 3990.5uS at a 7min re-sync,
 * at which point it may lose the "00" second time stamp.
 * I assume that the most accurate time is just AFTER the re-sync.
 * Hence remember the last cycle interval,
 *
 * Can run in any one of:
 *
 *	PPSCD	PPS signal sets CD which interupts, and grabs the current TOD
 *	(sun)		*in the interupt code*, so as to avoid problems with
 *			the STREAMS scheduling.
 *
 * It appears that it goes 16.5 uS slow each second, then every 4 mins it
 * generates no "00" second tick, and gains 3975 uS. Ho Hum ! (93/2/7)
 */

/* Definitions */
#ifndef	MAXUNITS
#define	MAXUNITS	4	/* maximum number of EES units permitted */
#endif

#ifndef	EES232
#define	EES232	"/dev/ees%d"	/* Device to open to read the data */
#endif

/* Other constant stuff */
#ifndef	EESPRECISION
#define	EESPRECISION	(-10)		/* what the heck - 2**-10 = 1ms */
#endif
#ifndef	EESREFID
#define	EESREFID	"MSF\0"		/* String to identify the clock */
#endif
#ifndef	EESHSREFID
#define	EESHSREFID	(0x7f7f0000 | ((REFCLK_MSF_EES) << 8)) /* Numeric refid */
#endif

/* Description of clock */
#define	EESDESCRIPTION		"EES M201 MSF Receiver"

/* Speed we run the clock port at. If this is changed the UARTDELAY
 * value should be recomputed to suit.
 */
#ifndef	SPEED232
#define	SPEED232	B9600	/* 9600 baud */
#endif

/* What is the inherent delay for this mode of working, i.e. when is the
 * data time stamped.
 */
#define	SAFETY_SHIFT	10	/* Split the shift to avoid overflow */
#define	BITS_TO_L_FP(bits, baud) \
(((((bits)*2 +1) << (FRACTION_PREC-SAFETY_SHIFT)) / (2*baud)) << SAFETY_SHIFT)
#define	INH_DELAY_CBREAK	BITS_TO_L_FP(119, 9600)
#define	INH_DELAY_PPS		BITS_TO_L_FP(  0, 9600)

#ifndef	STREAM_PP1
#define	STREAM_PP1	"ppsclocd\0<-- patch space for module name1 -->"
#endif
#ifndef	STREAM_PP2
#define	STREAM_PP2	"ppsclock\0<-- patch space for module name2 -->"
#endif

     /* Offsets of the bytes of the serial line code.  The clock gives
 * local time with a GMT/BST indication. The EESM_ definitions
 * give offsets into ees->lastcode.
 */
#define EESM_CSEC	 0	/* centiseconds - always zero in our clock  */
#define EESM_SEC	 1	/* seconds in BCD			    */
#define EESM_MIN	 2	/* minutes in BCD			    */
#define EESM_HOUR	 3	/* hours in BCD				    */
#define EESM_DAYWK	 4	/* day of week (Sun = 0 etc)		    */
#define EESM_DAY	 5	/* day of month in BCD			    */
#define EESM_MON	 6	/* month in BCD				    */
#define EESM_YEAR	 7	/* year MOD 100 in BCD			    */
#define EESM_LEAP	 8	/* 0x0f if leap year, otherwise zero        */
#define EESM_BST	 9	/* 0x03 if BST, 0x00 if GMT		    */
#define EESM_MSFOK	10	/* 0x3f if radio good, otherwise zero	    */
				/* followed by a frame alignment byte (0xff) /
				/  which is not put into the lastcode buffer*/

/* Length of the serial time code, in characters.  The first length
 * is less the frame alignment byte.
 */
#define	LENEESPRT	(EESM_MSFOK+1)
#define	LENEESCODE	(LENEESPRT+1)

     /* Code state. */
#define	EESCS_WAIT	0       /* waiting for start of timecode */
#define	EESCS_GOTSOME	1	/* have an incomplete time code buffered */

     /* Default fudge factor and character to receive */
#define	DEFFUDGETIME	0	/* Default user supplied fudge factor */
#ifndef	DEFOSTIME
#define	DEFOSTIME	0	/* Default OS delay -- passed by Make ? */
#endif
#define	DEFINHTIME	INH_DELAY_PPS /* inherent delay due to sample point*/

     /* Limits on things.  Reduce the number of samples to SAMPLEREDUCE by median
 * elimination.  If we're running with an accurate clock, chose the BESTSAMPLE
 * as the estimated offset, otherwise average the remainder.
 */
#define	FULLSHIFT	6			/* NCODES root 2 */
#define NCODES		(1<< FULLSHIFT)		/* 64 */
#define	REDUCESHIFT	(FULLSHIFT -1)		/* SAMPLEREDUCE root 2 */

     /* Towards the high ( Why ?) end of half */
#define	BESTSAMPLE	((samplereduce * 3) /4)	/* 24 */

     /* Leap hold time.  After a leap second the clock will no longer be
 * reliable until it resynchronizes.  Hope 40 minutes is enough. */
#define	EESLEAPHOLD	(40 * 60)

#define	EES_STEP_F	(1 << 24) /* the receiver steps in units of about 4ms */
#define	EES_STEP_F_GRACE (EES_STEP_F/8) /*Allow for slop of 1/8 which is .5ms*/
#define	EES_STEP_NOTE	(1 << 21)/* Log any unexpected jumps, say .5 ms .... */
#define	EES_STEP_NOTES	50	/* Only do a limited number */
#define	MAX_STEP	16	/* Max number of steps to remember */

     /* debug is a bit mask of debugging that is wanted */
#define	DB_SYSLOG_SMPLI		0x0001
#define	DB_SYSLOG_SMPLE		0x0002
#define	DB_SYSLOG_SMTHI		0x0004
#define	DB_SYSLOG_NSMTHE	0x0008
#define	DB_SYSLOG_NSMTHI	0x0010
#define	DB_SYSLOG_SMTHE		0x0020
#define	DB_PRINT_EV		0x0040
#define	DB_PRINT_CDT		0x0080
#define	DB_PRINT_CDTC		0x0100
#define	DB_SYSLOG_KEEPD		0x0800
#define	DB_SYSLOG_KEEPE		0x1000
#define	DB_LOG_DELTAS		0x2000
#define	DB_PRINT_DELTAS		0x4000
#define	DB_LOG_AWAITMORE	0x8000
#define	DB_LOG_SAMPLES		0x10000
#define	DB_NO_PPS		0x20000
#define	DB_INC_PPS		0x40000
#define	DB_DUMP_DELTAS		0x80000

     struct eesunit {			/* EES unit control structure. */
	     struct peer *peer;		/* associated peer structure */
	     struct refclockio io;		/* given to the I/O handler */
	     l_fp	reftime;		/* reference time */
	     l_fp	lastsampletime;		/* time as in txt from last EES msg */
	     l_fp	arrvtime;		/* Time at which pkt arrived */
	     l_fp	codeoffsets[NCODES];	/* the time of arrival of 232 codes */
	     l_fp	offset;			/* chosen offset        (for clkbug) */
	     l_fp	lowoffset;		/* lowest sample offset (for clkbug) */
	     l_fp	highoffset;		/* highest   "     "    (for clkbug) */
	     char	lastcode[LENEESCODE+6];	/* last time code we received */
	     u_long	lasttime;		/* last time clock heard from */
	     u_long	clocklastgood;		/* last time good radio seen */
	     u_char	lencode;		/* length of code in buffer */
	     u_char	nsamples;		/* number of samples we've collected */
	     u_char	codestate;		/* state of 232 code reception */
	     u_char	unit;			/* unit number for this guy */
	     u_char	status;			/* clock status */
	     u_char	lastevent;		/* last clock event */
	     u_char	reason;			/* reason for last abort */
	     u_char	hour;			/* hour of day */
	     u_char	minute;			/* minute of hour */
	     u_char	second;			/* seconds of minute */
	     char	tz;			/* timezone from clock */
	     u_char	ttytype;		/* method used */
	     u_char	dump_vals;		/* Should clock values be dumped */
	     u_char	usealldata;		/* Use ALL samples */
	     u_short	day;			/* day of year from last code */
	     u_long	yearstart;		/* start of current year */
	     u_long	leaphold;		/* time of leap hold expiry */
	     u_long	badformat;		/* number of bad format codes */
	     u_long	baddata;		/* number of invalid time codes */
	     u_long	timestarted;		/* time we started this */
	     long	last_pps_no;		/* The serial # of the last PPS */
	     char	fix_pending;		/* Is a "sync to time" pending ? */
	     /* Fine tuning - compensate for 4 mS ramping .... */
	     l_fp	last_l;			/* last time stamp */
	     u_char	last_steps[MAX_STEP];	/* Most recent n steps */
	     int	best_av_step;		/* Best guess at average step */
	     char	best_av_step_count;	/* # of steps over used above */
	     char	this_step;		/* Current pos in buffer */
	     int	last_step_late;		/* How late the last step was (0-59) */
	     long	jump_fsecs;		/* # of fractions of a sec last jump */
	     u_long	last_step;		/* time of last step */
	     int	last_step_secs;		/* Number of seconds in last step */
	     int	using_ramp;		/* 1 -> noemal, -1 -> over stepped */
     };
#define	last_sec	last_l.l_ui
#define	last_sfsec	last_l.l_f
#define	this_uisec	((ees->arrvtime).l_ui)
#define	this_sfsec	((ees->arrvtime).l_f)
#define	msec(x)		((x) / (1<<22))
#define	LAST_STEPS	(sizeof ees->last_steps / sizeof ees->last_steps[0])
#define	subms(x)	((((((x < 0) ? (-(x)) : (x)) % (1<<22))/2) * 625) / (1<<(22 -5)))

/* Bitmask for what methods to try to use -- currently only PPS enabled */
#define	T_CBREAK	1
#define	T_PPS		8
/* macros to test above */
#define	is_cbreak(x)	((x)->ttytype & T_CBREAK)
#define	is_pps(x)	((x)->ttytype & T_PPS)
#define	is_any(x)	((x)->ttytype)

#define	CODEREASON	20	/* reason codes */

/* Data space for the unit structures.  Note that we allocate these on
 * the fly, but never give them back. */
static struct eesunit *eesunits[MAXUNITS];
static u_char unitinuse[MAXUNITS];

/* Keep the fudge factors separately so they can be set even
 * when no clock is configured. */
static l_fp inherent_delay[MAXUNITS];		/* when time stamp is taken */
static l_fp fudgefactor[MAXUNITS];		/* fudgetime1 */
static l_fp os_delay[MAXUNITS];			/* fudgetime2 */
static l_fp offset_fudge[MAXUNITS];		/* Sum of above */
static u_char stratumtouse[MAXUNITS];
static u_char sloppyclockflag[MAXUNITS];

static int deltas[60];

static l_fp acceptable_slop; /* = { 0, 1 << (FRACTION_PREC -2) }; */
static l_fp onesec; /* = { 1, 0 }; */

#ifndef	DUMP_BUF_SIZE	/* Size of buffer to be used by dump_buf */
#define	DUMP_BUF_SIZE	10112
#endif

/* ees_reset - reset the count back to zero */
#define	ees_reset(ees) (ees)->nsamples = 0; \
(ees)->codestate = EESCS_WAIT

/* ees_event - record and report an event */
#define	ees_event(ees, evcode) if ((ees)->status != (u_char)(evcode)) \
ees_report_event((ees), (evcode))

     /* Find the precision of the system clock by reading it */
#define	USECS	1000000
#define	MINSTEP	5	/* some systems increment uS on each call */
#define	MAXLOOPS (USECS/9)

/*
 * Function prototypes
 */

static	int	msfees_start	P((int unit, struct peer *peer));
static	void	msfees_shutdown	P((int unit, struct peer *peer));
static	void	msfees_poll	P((int unit, struct peer *peer));
static	void	msfees_init	P((void));
static	void	dump_buf	P((l_fp *coffs, int from, int to, char *text));
static	void	ees_report_event P((struct eesunit *ees, int code));
static	void	ees_receive	P((struct recvbuf *rbufp));
static	void	ees_process	P((struct eesunit *ees));
#ifdef QSORT_USES_VOID_P
static	int	offcompare	P((const void *va, const void *vb));
#else
static	int	offcompare	P((const l_fp *a, const l_fp *b));
#endif /* QSORT_USES_VOID_P */


/*
 * Transfer vector
 */
struct	refclock refclock_msfees = {
	msfees_start,		/* start up driver */
	msfees_shutdown,	/* shut down driver */
	msfees_poll,		/* transmit poll message */
	noentry,		/* not used */
	msfees_init,		/* initialize driver */
	noentry,		/* not used */
	NOFLAGS			/* not used */
};


static void
dump_buf(
	l_fp *coffs,
	int from,
	int to,
	char *text
	)
{
	char buff[DUMP_BUF_SIZE + 80];
	int i;
	register char *ptr = buff;

	snprintf(buff, sizeof(buff), text);
	for (i = from; i < to; i++) {
		ptr += strlen(ptr);
		if ((ptr - buff) > DUMP_BUF_SIZE) {
			msyslog(LOG_DEBUG, "D: %s", buff);
			ptr = buff;
		}
		snprintf(ptr, sizeof(buff) - (ptr - buff),
			 " %06d", ((int)coffs[i].l_f) / 4295);
	}
	msyslog(LOG_DEBUG, "D: %s", buff);
}

/* msfees_init - initialize internal ees driver data */
static void
msfees_init(void)
{
	register int i;
	/* Just zero the data arrays */
	memset((char *)eesunits, 0, sizeof eesunits);
	memset((char *)unitinuse, 0, sizeof unitinuse);

	acceptable_slop.l_ui = 0;
	acceptable_slop.l_uf = 1 << (FRACTION_PREC -2);

	onesec.l_ui = 1;
	onesec.l_uf = 0;

	/* Initialize fudge factors to default. */
	for (i = 0; i < MAXUNITS; i++) {
		fudgefactor[i].l_ui	= 0;
		fudgefactor[i].l_uf	= DEFFUDGETIME;
		os_delay[i].l_ui	= 0;
		os_delay[i].l_uf	= DEFOSTIME;
		inherent_delay[i].l_ui	= 0;
		inherent_delay[i].l_uf	= DEFINHTIME;
		offset_fudge[i]		= os_delay[i];
		L_ADD(&offset_fudge[i], &fudgefactor[i]);
		L_ADD(&offset_fudge[i], &inherent_delay[i]);
		stratumtouse[i]		= 0;
		sloppyclockflag[i]	= 0;
	}
}


/* msfees_start - open the EES devices and initialize data for processing */
static int
msfees_start(
	int unit,
	struct peer *peer
	)
{
	register struct eesunit *ees;
	register int i;
	int fd232 = -1;
	char eesdev[20];
	struct termios ttyb, *ttyp;
	struct refclockproc *pp;
	pp = peer->procptr;

	if (unit >= MAXUNITS) {
		msyslog(LOG_ERR, "ees clock: unit number %d invalid (max %d)",
			unit, MAXUNITS-1);
		return 0;
	}
	if (unitinuse[unit]) {
		msyslog(LOG_ERR, "ees clock: unit number %d in use", unit);
		return 0;
	}

	/* Unit okay, attempt to open the devices.  We do them both at
	 * once to make sure we can */
	snprintf(eesdev, sizeof(eesdev), EES232, unit);

	fd232 = open(eesdev, O_RDWR, 0777);
	if (fd232 == -1) {
		msyslog(LOG_ERR, "ees clock: open of %s failed: %m", eesdev);
		return 0;
	}

#ifdef	TIOCEXCL
	/* Set for exclusive use */
	if (ioctl(fd232, TIOCEXCL, (char *)0) < 0) {
		msyslog(LOG_ERR, "ees clock: ioctl(%s, TIOCEXCL): %m", eesdev);
		goto screwed;
	}
#endif

	/* STRIPPED DOWN VERSION: Only PPS CD is supported at the moment */

	/* Set port characteristics.  If we don't have a STREAMS module or
	 * a clock line discipline, cooked mode is just usable, even though it
	 * strips the top bit.  The only EES byte which uses the top
	 * bit is the year, and we don't use that anyway. If we do
	 * have the line discipline, we choose raw mode, and the
	 * line discipline code will block up the messages.
	 */

	/* STIPPED DOWN VERSION: Only PPS CD is supported at the moment */

	ttyp = &ttyb;
	if (tcgetattr(fd232, ttyp) < 0) {
		msyslog(LOG_ERR, "msfees_start: tcgetattr(%s): %m", eesdev);
		goto screwed;
	}

	ttyp->c_iflag = IGNBRK|IGNPAR|ICRNL;
	ttyp->c_cflag = SPEED232|CS8|CLOCAL|CREAD;
	ttyp->c_oflag = 0;
	ttyp->c_lflag = ICANON;
	ttyp->c_cc[VERASE] = ttyp->c_cc[VKILL] = '\0';
	if (tcsetattr(fd232, TCSANOW, ttyp) < 0) {
		msyslog(LOG_ERR, "msfees_start: tcsetattr(%s): %m", eesdev);
		goto screwed;
	}

	if (tcflush(fd232, TCIOFLUSH) < 0) {
		msyslog(LOG_ERR, "msfees_start: tcflush(%s): %m", eesdev);
		goto screwed;
	}

	inherent_delay[unit].l_uf = INH_DELAY_PPS;

	/* offset fudge (how *late* the timestamp is) = fudge + os delays */
	offset_fudge[unit] = os_delay[unit];
	L_ADD(&offset_fudge[unit], &fudgefactor[unit]);
	L_ADD(&offset_fudge[unit], &inherent_delay[unit]);

	/* Looks like this might succeed.  Find memory for the structure.
	 * Look to see if there are any unused ones, if not we malloc() one.
	 */
	if (eesunits[unit] != 0) /* The one we want is okay */
	    ees = eesunits[unit];
	else {
		/* Look for an unused, but allocated struct */
		for (i = 0; i < MAXUNITS; i++) {
			if (!unitinuse[i] && eesunits[i] != 0)
			    break;
		}

		if (i < MAXUNITS) {	/* Reclaim this one */
			ees = eesunits[i];
			eesunits[i] = 0;
		}			/* no spare -- make a new one */
		else ees = (struct eesunit *) emalloc(sizeof(struct eesunit));
	}
	memset((char *)ees, 0, sizeof(struct eesunit));
	eesunits[unit] = ees;

	/* Set up the structures */
	ees->peer	= peer;
	ees->unit	= (u_char)unit;
	ees->timestarted= current_time;
	ees->ttytype	= 0;
	ees->io.clock_recv= ees_receive;
	ees->io.srcclock= (caddr_t)ees;
	ees->io.datalen	= 0;
	ees->io.fd	= fd232;

	/* Okay.  Push one of the two (linked into the kernel, or dynamically
	 * loaded) STREAMS module, and give it to the I/O code to start
	 * receiving stuff.
	 */

#ifdef STREAM
	{
		int rc1;
		/* Pop any existing onews first ... */
		while (ioctl(fd232, I_POP, 0 ) >= 0) ;

		/* Now try pushing either of the possible modules */
		if ((rc1=ioctl(fd232, I_PUSH, STREAM_PP1)) < 0 &&
		    ioctl(fd232, I_PUSH, STREAM_PP2) < 0) {
			msyslog(LOG_ERR,
				"ees clock: Push of `%s' and `%s' to %s failed %m",
				STREAM_PP1, STREAM_PP2, eesdev);
			goto screwed;
		}
		else {
			NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
				msyslog(LOG_INFO, "I: ees clock: PUSHed %s on %s",
					(rc1 >= 0) ? STREAM_PP1 : STREAM_PP2, eesdev);
			ees->ttytype |= T_PPS;
		}
	}
#endif /* STREAM */

	/* Add the clock */
	if (!io_addclock(&ees->io)) {
		/* Oh shit.  Just close and return. */
		msyslog(LOG_ERR, "ees clock: io_addclock(%s): %m", eesdev);
		goto screwed;
	}


	/* All done.  Initialize a few random peer variables, then
	 * return success. */
	peer->precision	= sys_precision;
	peer->stratum	= stratumtouse[unit];
	if (stratumtouse[unit] <= 1) {
		memcpy((char *)&pp->refid, EESREFID, 4);
		if (unit > 0 && unit < 10)
		    ((char *)&pp->refid)[3] = '0' + unit;
	} else {
		peer->refid = htonl(EESHSREFID);
	}
	unitinuse[unit] = 1;
	pp->unitptr = (caddr_t) &eesunits[unit];
	pp->clockdesc = EESDESCRIPTION;
	msyslog(LOG_ERR, "ees clock: %s OK on %d", eesdev, unit);
	return (1);

    screwed:
	if (fd232 != -1)
	    (void) close(fd232);
	return (0);
}


/* msfees_shutdown - shut down a EES clock */
static void
msfees_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct eesunit *ees;

	if (unit >= MAXUNITS) {
		msyslog(LOG_ERR,
			"ees clock: INTERNAL ERROR, unit number %d invalid (max %d)",
			unit, MAXUNITS);
		return;
	}
	if (!unitinuse[unit]) {
		msyslog(LOG_ERR,
			"ees clock: INTERNAL ERROR, unit number %d not in use", unit);
		return;
	}

	/* Tell the I/O module to turn us off.  We're history. */
	ees = eesunits[unit];
	io_closeclock(&ees->io);
	unitinuse[unit] = 0;
}


/* ees_report_event - note the occurance of an event */
static void
ees_report_event(
	struct eesunit *ees,
	int code
	)
{
	if (ees->status != (u_char)code) {
		ees->status = (u_char)code;
		if (code != CEVNT_NOMINAL)
		    ees->lastevent = (u_char)code;
		/* Should report event to trap handler in here.
		 * Soon...
		 */
	}
}


/* ees_receive - receive data from the serial interface on an EES clock */
static void
ees_receive(
	struct recvbuf *rbufp
	)
{
	register int n_sample;
	register int day;
	register struct eesunit *ees;
	register u_char *dpt;		/* Data PoinTeR: move along ... */
	register u_char *dpend;		/* Points just *after* last data char */
	register char *cp;
	l_fp tmp;
	int call_pps_sample = 0;
	l_fp pps_arrvstamp;
	int	sincelast;
	int	pps_step = 0;
	int	suspect_4ms_step = 0;
	struct ppsclockev ppsclockev;
	long *ptr = (long *) &ppsclockev;
	int rc;
	int request;
#ifdef HAVE_CIOGETEV
	request = CIOGETEV;
#endif
#ifdef HAVE_TIOCGPPSEV
	request = TIOCGPPSEV;
#endif

	/* Get the clock this applies to and a pointer to the data */
	ees = (struct eesunit *)rbufp->recv_srcclock;
	dpt = (u_char *)&rbufp->recv_space;
	dpend = dpt + rbufp->recv_length;
	if ((dbg & DB_LOG_AWAITMORE) && (rbufp->recv_length != LENEESCODE))
	    printf("[%d] ", rbufp->recv_length);

	/* Check out our state and process appropriately */
	switch (ees->codestate) {
	    case EESCS_WAIT:
		/* Set an initial guess at the timestamp as the recv time.
		 * If just running in CBREAK mode, we can't improve this.
		 * If we have the CLOCK Line Discipline, PPSCD, or sime such,
		 * then we will do better later ....
		 */
		ees->arrvtime = rbufp->recv_time;
		ees->codestate = EESCS_GOTSOME;
		ees->lencode = 0;
		/*FALLSTHROUGH*/

	    case EESCS_GOTSOME:
		cp = &(ees->lastcode[ees->lencode]);

		/* Gobble the bytes until the final (possibly stripped) 0xff */
		while (dpt < dpend && (*dpt & 0x7f) != 0x7f) {
			*cp++ = (char)*dpt++;
			ees->lencode++;
			/* Oh dear -- too many bytes .. */
			if (ees->lencode > LENEESPRT) {
				NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
					msyslog(LOG_INFO,
						"I: ees clock: %d + %d > %d [%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x]",
						ees->lencode, dpend - dpt, LENEESPRT,
#define D(x) (ees->lastcode[x])
						D(0), D(1), D(2), D(3), D(4), D(5), D(6),
						D(7), D(8), D(9), D(10), D(11), D(12));
#undef	D
				ees->badformat++;
				ees->reason = CODEREASON + 1;
				ees_event(ees, CEVNT_BADREPLY);
				ees_reset(ees);
				return;
			}
		}
		/* Gave up because it was end of the buffer, rather than ff */
		if (dpt == dpend) {
			/* Incomplete.  Wait for more. */
			if (dbg & DB_LOG_AWAITMORE)
			    msyslog(LOG_INFO,
				    "I: ees clock %d: %p == %p: await more",
				    ees->unit, dpt, dpend);
			return;
		}

		/* This shouldn't happen ... ! */
		if ((*dpt & 0x7f) != 0x7f) {
			msyslog(LOG_INFO, "I: ees clock: %0x & 0x7f != 0x7f", *dpt);
			ees->badformat++;
			ees->reason = CODEREASON + 2;
			ees_event(ees, CEVNT_BADREPLY);
			ees_reset(ees);
			return;
		}

		/* Skip the 0xff */
		dpt++;

		/* Finally, got a complete buffer.  Mainline code will
		 * continue on. */
		cp = ees->lastcode;
		break;

	    default:
		msyslog(LOG_ERR, "ees clock: INTERNAL ERROR: %d state %d",
			ees->unit, ees->codestate);
		ees->reason = CODEREASON + 5;
		ees_event(ees, CEVNT_FAULT);
		ees_reset(ees);
		return;
	}

	/* Boy!  After all that crap, the lastcode buffer now contains
	 * something we hope will be a valid time code.  Do length
	 * checks and sanity checks on constant data.
	 */
	ees->codestate = EESCS_WAIT;
	ees->lasttime = current_time;
	if (ees->lencode != LENEESPRT) {
		ees->badformat++;
		ees->reason = CODEREASON + 6;
		ees_event(ees, CEVNT_BADREPLY);
		ees_reset(ees);
		return;
	}

	cp = ees->lastcode;

	/* Check that centisecond is zero */
	if (cp[EESM_CSEC] != 0) {
		ees->baddata++;
		ees->reason = CODEREASON + 7;
		ees_event(ees, CEVNT_BADREPLY);
		ees_reset(ees);
		return;
	}

	/* Check flag formats */
	if (cp[EESM_LEAP] != 0 && cp[EESM_LEAP] != 0x0f) {
		ees->badformat++;
		ees->reason = CODEREASON + 8;
		ees_event(ees, CEVNT_BADREPLY);
		ees_reset(ees);
		return;
	}

	if (cp[EESM_BST] != 0 && cp[EESM_BST] != 0x03) {
		ees->badformat++;
		ees->reason = CODEREASON + 9;
		ees_event(ees, CEVNT_BADREPLY);
		ees_reset(ees);
		return;
	}

	if (cp[EESM_MSFOK] != 0 && cp[EESM_MSFOK] != 0x3f) {
		ees->badformat++;
		ees->reason = CODEREASON + 10;
		ees_event(ees, CEVNT_BADREPLY);
		ees_reset(ees);
		return;
	}

	/* So far, so good.  Compute day, hours, minutes, seconds,
	 * time zone.  Do range checks on these.
	 */

#define bcdunpack(val)	( (((val)>>4) & 0x0f) * 10 + ((val) & 0x0f) )
#define istrue(x)	((x)?1:0)

	ees->second  = bcdunpack(cp[EESM_SEC]);  /* second       */
	ees->minute  = bcdunpack(cp[EESM_MIN]);  /* minute       */
	ees->hour    = bcdunpack(cp[EESM_HOUR]); /* hour         */

	day          = bcdunpack(cp[EESM_DAY]);  /* day of month */

	switch (bcdunpack(cp[EESM_MON])) {       /* month        */

		/*  Add in lengths of all previous months.  Add one more
		    if it is a leap year and after February.
		*/
	    case 12:	day += NOV;			  /*FALLSTHROUGH*/
	    case 11:	day += OCT;			  /*FALLSTHROUGH*/
	    case 10:	day += SEP;			  /*FALLSTHROUGH*/
	    case  9:	day += AUG;			  /*FALLSTHROUGH*/
	    case  8:	day += JUL;			  /*FALLSTHROUGH*/
	    case  7:	day += JUN;			  /*FALLSTHROUGH*/
	    case  6:	day += MAY;			  /*FALLSTHROUGH*/
	    case  5:	day += APR;			  /*FALLSTHROUGH*/
	    case  4:	day += MAR;			  /*FALLSTHROUGH*/
	    case  3:	day += FEB;
		if (istrue(cp[EESM_LEAP])) day++; /*FALLSTHROUGH*/
	    case  2:	day += JAN;			  /*FALLSTHROUGH*/
	    case  1:	break;
	    default:	ees->baddata++;
		ees->reason = CODEREASON + 11;
		ees_event(ees, CEVNT_BADDATE);
		ees_reset(ees);
		return;
	}

	ees->day     = day;

	/* Get timezone. The clocktime routine wants the number
	 * of hours to add to the delivered time to get UT.
	 * Currently -1 if BST flag set, 0 otherwise.  This
	 * is the place to tweak things if double summer time
	 * ever happens.
	 */
	ees->tz      = istrue(cp[EESM_BST]) ? -1 : 0;

	if (ees->day > 366 || ees->day < 1 ||
	    ees->hour > 23 || ees->minute > 59 || ees->second > 59) {
		ees->baddata++;
		ees->reason = CODEREASON + 12;
		ees_event(ees, CEVNT_BADDATE);
		ees_reset(ees);
		return;
	}

	n_sample = ees->nsamples;

	/* Now, compute the reference time value: text -> tmp.l_ui */
	if (!clocktime(ees->day, ees->hour, ees->minute, ees->second,
		       ees->tz, rbufp->recv_time.l_ui, &ees->yearstart,
		       &tmp.l_ui)) {
		ees->baddata++;
		ees->reason = CODEREASON + 13;
		ees_event(ees, CEVNT_BADDATE);
		ees_reset(ees);
		return;
	}
	tmp.l_uf = 0;

	/*  DON'T use ees->arrvtime -- it may be < reftime */
	ees->lastsampletime = tmp;

	/* If we are synchronised to the radio, update the reference time.
	 * Also keep a note of when clock was last good.
	 */
	if (istrue(cp[EESM_MSFOK])) {
		ees->reftime = tmp;
		ees->clocklastgood = current_time;
	}


	/* Compute the offset.  For the fractional part of the
	 * offset we use the expected delay for the message.
	 */
	ees->codeoffsets[n_sample].l_ui = tmp.l_ui;
	ees->codeoffsets[n_sample].l_uf = 0;

	/* Number of seconds since the last step */
	sincelast = this_uisec - ees->last_step;

	memset((char *) &ppsclockev, 0, sizeof ppsclockev);

	rc = ioctl(ees->io.fd, request, (char *) &ppsclockev);
	if (dbg & DB_PRINT_EV) fprintf(stderr,
					 "[%x] CIOGETEV u%d %d (%x %d) gave %d (%d): %08lx %08lx %ld\n",
					 DB_PRINT_EV, ees->unit, ees->io.fd, request, is_pps(ees),
					 rc, errno, ptr[0], ptr[1], ptr[2]);

	/* If we managed to get the time of arrival, process the info */
	if (rc >= 0) {
		int conv = -1;
		pps_step = ppsclockev.serial - ees->last_pps_no;

		/* Possible that PPS triggered, but text message didn't */
		if (pps_step == 2) msyslog(LOG_ERR, "pps step = 2 @ %02d", ees->second);
		if (pps_step == 2 && ees->second == 1) suspect_4ms_step |= 1;
		if (pps_step == 2 && ees->second == 2) suspect_4ms_step |= 4;

		/* allow for single loss of PPS only */
		if (pps_step != 1 && pps_step != 2)
		    fprintf(stderr, "PPS step: %d too far off %ld (%d)\n",
			    ppsclockev.serial, ees->last_pps_no, pps_step);
		else if (!buftvtots((char *) &(ppsclockev.tv), &pps_arrvstamp))
		    fprintf(stderr, "buftvtots failed\n");
		else {	/* if ((ABS(time difference) - 0.25) < 0)
			 * then believe it ...
			 */
			l_fp diff;
			diff = pps_arrvstamp;
			conv = 0;
			L_SUB(&diff, &ees->arrvtime);
			if (dbg & DB_PRINT_CDT)
			    printf("[%x] Have %lx.%08lx and %lx.%08lx -> %lx.%08lx @ %s",
				   DB_PRINT_CDT, (long)ees->arrvtime.l_ui, (long)ees->arrvtime.l_uf,
				   (long)pps_arrvstamp.l_ui, (long)pps_arrvstamp.l_uf,
				   (long)diff.l_ui, (long)diff.l_uf,
				   ctime(&(ppsclockev.tv.tv_sec)));
			if (L_ISNEG(&diff)) M_NEG(diff.l_ui, diff.l_uf);
			L_SUB(&diff, &acceptable_slop);
			if (L_ISNEG(&diff)) {	/* AOK -- pps_sample */
				ees->arrvtime = pps_arrvstamp;
				conv++;
				call_pps_sample++;
			}
			/* Some loss of some signals around sec = 1 */
			else if (ees->second == 1) {
				diff = pps_arrvstamp;
				L_ADD(&diff, &onesec);
				L_SUB(&diff, &ees->arrvtime);
				if (L_ISNEG(&diff)) M_NEG(diff.l_ui, diff.l_uf);
				L_SUB(&diff, &acceptable_slop);
				msyslog(LOG_ERR, "Have sec==1 slip %ds a=%08x-p=%08x -> %x.%08x (u=%d) %s",
					pps_arrvstamp.l_ui - ees->arrvtime.l_ui,
					pps_arrvstamp.l_uf,
					ees->arrvtime.l_uf,
					diff.l_ui, diff.l_uf,
					(int)ppsclockev.tv.tv_usec,
					ctime(&(ppsclockev.tv.tv_sec)));
				if (L_ISNEG(&diff)) {	/* AOK -- pps_sample */
					suspect_4ms_step |= 2;
					ees->arrvtime = pps_arrvstamp;
					L_ADD(&ees->arrvtime, &onesec);
					conv++;
					call_pps_sample++;
				}
			}
		}
		ees->last_pps_no = ppsclockev.serial;
		if (dbg & DB_PRINT_CDTC)
		    printf(
			    "[%x] %08lx %08lx %d u%d (%d %d)\n",
			    DB_PRINT_CDTC, (long)pps_arrvstamp.l_ui,
			    (long)pps_arrvstamp.l_uf, conv, ees->unit,
			    call_pps_sample, pps_step);
	}

	/* See if there has been a 4ms jump at a minute boundry */
	{	l_fp	delta;
#define	delta_isec	delta.l_ui
#define	delta_ssec	delta.l_i
#define	delta_sfsec	delta.l_f
	long	delta_f_abs;

	delta.l_i = ees->arrvtime.l_i;
	delta.l_f = ees->arrvtime.l_f;

	L_SUB(&delta, &ees->last_l);
	delta_f_abs = delta_sfsec;
	if (delta_f_abs < 0) delta_f_abs = -delta_f_abs;

	/* Dump the deltas each minute */
	if (dbg & DB_DUMP_DELTAS)
	{	
		if (/*0 <= ees->second && */
		    ees->second < COUNTOF(deltas))
			deltas[ees->second] = delta_sfsec;
	/* Dump on second 1, as second 0 sometimes missed */
	if (ees->second == 1) {
		char text[16 * COUNTOF(deltas)];
		char *cptr=text;
		int i;
		for (i = 0; i < COUNTOF(deltas); i++) {
			snprintf(cptr, sizeof(text) / COUNTOF(deltas),
				" %d.%04d", msec(deltas[i]),
				subms(deltas[i]));
			cptr += strlen(cptr);
		}
		msyslog(LOG_ERR, "Deltas: %d.%04d<->%d.%04d: %s",
			msec(EES_STEP_F - EES_STEP_F_GRACE), subms(EES_STEP_F - EES_STEP_F_GRACE),
			msec(EES_STEP_F + EES_STEP_F_GRACE), subms(EES_STEP_F + EES_STEP_F_GRACE),
			text+1);
		for (i=0; i<((sizeof deltas) / (sizeof deltas[0])); i++) deltas[i] = 0;
	}
	}

	/* Lets see if we have a 4 mS step at a minute boundaary */
	if (	((EES_STEP_F - EES_STEP_F_GRACE) < delta_f_abs) &&
		(delta_f_abs < (EES_STEP_F + EES_STEP_F_GRACE)) &&
		(ees->second == 0 || ees->second == 1 || ees->second == 2) &&
		(sincelast < 0 || sincelast > 122)
		) {	/* 4ms jump at min boundry */
		int old_sincelast;
		int count=0;
		int sum = 0;
		/* Yes -- so compute the ramp time */
		if (ees->last_step == 0) sincelast = 0;
		old_sincelast = sincelast;

		/* First time in, just set "ees->last_step" */
		if(ees->last_step) {
			int other_step = 0;
			int third_step = 0;
			int this_step = (sincelast + (60 /2)) / 60;
			int p_step = ees->this_step;
			int p;
			ees->last_steps[p_step] = this_step;
			p= p_step;
			p_step++;
			if (p_step >= LAST_STEPS) p_step = 0;
			ees->this_step = p_step;
				/* Find the "average" interval */
			while (p != p_step) {
				int this = ees->last_steps[p];
				if (this == 0) break;
				if (this != this_step) {
					if (other_step == 0 && (
						this== (this_step +2) ||
						this== (this_step -2) ||
						this== (this_step +1) ||
						this== (this_step -1)))
					    other_step = this;
					if (other_step != this) {
						int idelta = (this_step - other_step);
						if (idelta < 0) idelta = - idelta;
						if (third_step == 0 && (
							(idelta == 1) ? (
								this == (other_step +1) ||
								this == (other_step -1) ||
								this == (this_step +1) ||
								this == (this_step -1))
							:
							(
								this == (this_step + other_step)/2
								)
							)) third_step = this;
						if (third_step != this) break;
					}
				}
				sum += this;
				p--;
				if (p < 0) p += LAST_STEPS;
				count++;
			}
			msyslog(LOG_ERR, "MSF%d: %d: This=%d (%d), other=%d/%d, sum=%d, count=%d, pps_step=%d, suspect=%x", ees->unit, p, ees->last_steps[p], this_step, other_step, third_step, sum, count, pps_step, suspect_4ms_step);
			if (count != 0) sum = ((sum * 60) + (count /2)) / count;
#define	SV(x) (ees->last_steps[(x + p_step) % LAST_STEPS])
			msyslog(LOG_ERR, "MSF%d: %x steps %d: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d",
				ees->unit, suspect_4ms_step, p_step, SV(0), SV(1), SV(2), SV(3), SV(4), SV(5), SV(6),
				SV(7), SV(8), SV(9), SV(10), SV(11), SV(12), SV(13), SV(14), SV(15));
			printf("MSF%d: steps %d: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n",
			       ees->unit, p_step, SV(0), SV(1), SV(2), SV(3), SV(4), SV(5), SV(6),
			       SV(7), SV(8), SV(9), SV(10), SV(11), SV(12), SV(13), SV(14), SV(15));
#undef SV
			ees->jump_fsecs = delta_sfsec;
			ees->using_ramp = 1;
			if (sincelast > 170)
			    ees->last_step_late += sincelast - ((sum) ? sum : ees->last_step_secs);
			else ees->last_step_late = 30;
			if (ees->last_step_late < -60 || ees->last_step_late > 120) ees->last_step_late = 30;
			if (ees->last_step_late < 0) ees->last_step_late = 0;
			if (ees->last_step_late >= 60) ees->last_step_late = 59;
			sincelast = 0;
		}
		else {	/* First time in -- just save info */
			ees->last_step_late = 30;
			ees->jump_fsecs = delta_sfsec;
			ees->using_ramp = 1;
			sum = 4 * 60;
		}
		ees->last_step = this_uisec;
		printf("MSF%d: d=%3ld.%04ld@%d :%d:%d:$%d:%d:%d\n",
		       ees->unit, (long)msec(delta_sfsec), (long)subms(delta_sfsec),
		       ees->second, old_sincelast, ees->last_step_late, count, sum,
		       ees->last_step_secs);
		msyslog(LOG_ERR, "MSF%d: d=%3d.%04d@%d :%d:%d:%d:%d:%d",
			ees->unit, msec(delta_sfsec), subms(delta_sfsec), ees->second,
			old_sincelast, ees->last_step_late, count, sum, ees->last_step_secs);
		if (sum) ees->last_step_secs = sum;
	}
	/* OK, so not a 4ms step at a minute boundry */
	else {
		if (suspect_4ms_step) msyslog(LOG_ERR,
					      "MSF%d: suspect = %x, but delta of %d.%04d [%d.%04d<%d.%04d<%d.%04d: %d %d]",
					      ees->unit, suspect_4ms_step, msec(delta_sfsec), subms(delta_sfsec),
					      msec(EES_STEP_F - EES_STEP_F_GRACE),
					      subms(EES_STEP_F - EES_STEP_F_GRACE),
					      (int)msec(delta_f_abs),
					      (int)subms(delta_f_abs),
					      msec(EES_STEP_F + EES_STEP_F_GRACE),
					      subms(EES_STEP_F + EES_STEP_F_GRACE),
					      ees->second,
					      sincelast);
		if ((delta_f_abs > EES_STEP_NOTE) && ees->last_l.l_i) {
			static int ees_step_notes = EES_STEP_NOTES;
			if (ees_step_notes > 0) {
				ees_step_notes--;
				printf("MSF%d: D=%3ld.%04ld@%02d :%d%s\n",
				       ees->unit, (long)msec(delta_sfsec), (long)subms(delta_sfsec),
				       ees->second, sincelast, ees_step_notes ? "" : " -- NO MORE !");
				msyslog(LOG_ERR, "MSF%d: D=%3d.%04d@%02d :%d%s",
					ees->unit, msec(delta_sfsec), subms(delta_sfsec), ees->second, (ees->last_step) ? sincelast : -1, ees_step_notes ? "" : " -- NO MORE !");
			}
		}
	}
	}
	ees->last_l = ees->arrvtime;

	/* IF we have found that it's ramping
	 * && it's within twice the expected ramp period
	 * && there is a non zero step size (avoid /0 !)
	 * THEN we twiddle things
	 */
	if (ees->using_ramp &&
	    sincelast < (ees->last_step_secs)*2 &&
	    ees->last_step_secs)
	{	long	sec_of_ramp = sincelast + ees->last_step_late;
	long	fsecs;
	l_fp	inc;

	/* Ramp time may vary, so may ramp for longer than last time */
	if (sec_of_ramp > (ees->last_step_secs + 120))
	    sec_of_ramp =  ees->last_step_secs;

	/* sec_of_ramp * ees->jump_fsecs may overflow 2**32 */
	fsecs = sec_of_ramp * (ees->jump_fsecs /  ees->last_step_secs);

	if (dbg & DB_LOG_DELTAS) msyslog(LOG_ERR,
					   "[%x] MSF%d: %3ld/%03d -> d=%11ld (%d|%ld)",
					   DB_LOG_DELTAS,
					   ees->unit, sec_of_ramp, ees->last_step_secs, fsecs,
					   pps_arrvstamp.l_f, pps_arrvstamp.l_f + fsecs);
	if (dbg & DB_PRINT_DELTAS) printf(
		"MSF%d: %3ld/%03d -> d=%11ld (%ld|%ld)\n",
		ees->unit, sec_of_ramp, ees->last_step_secs, fsecs,
		(long)pps_arrvstamp.l_f, pps_arrvstamp.l_f + fsecs);

	/* Must sign extend the result */
	inc.l_i = (fsecs < 0) ? -1 : 0;
	inc.l_f = fsecs;
	if (dbg & DB_INC_PPS)
	{	L_SUB(&pps_arrvstamp, &inc);
	L_SUB(&ees->arrvtime, &inc);
	}
	else
	{	L_ADD(&pps_arrvstamp, &inc);
	L_ADD(&ees->arrvtime, &inc);
	}
	}
	else {
		if (dbg & DB_LOG_DELTAS) msyslog(LOG_ERR,
						   "[%x] MSF%d: ees->using_ramp=%d, sincelast=%x / %x, ees->last_step_secs=%x",
						   DB_LOG_DELTAS,
						   ees->unit, ees->using_ramp,
						   sincelast,
						   (ees->last_step_secs)*2,
						   ees->last_step_secs);
		if (dbg & DB_PRINT_DELTAS) printf(
			"[%x] MSF%d: ees->using_ramp=%d, sincelast=%x / %x, ees->last_step_secs=%x\n",
			DB_LOG_DELTAS,
			ees->unit, ees->using_ramp,
			sincelast,
			(ees->last_step_secs)*2,
			ees->last_step_secs);
	}

	L_SUB(&ees->arrvtime, &offset_fudge[ees->unit]);
	L_SUB(&pps_arrvstamp, &offset_fudge[ees->unit]);

	if (call_pps_sample && !(dbg & DB_NO_PPS)) {
		/* Sigh -- it expects its args negated */
		L_NEG(&pps_arrvstamp);
		/*
		 * I had to disable this here, since it appears there is no pointer to the
		 * peer structure.
		 *
		 (void) pps_sample(peer, &pps_arrvstamp);
		*/
	}

	/* Subtract off the local clock time stamp */
	L_SUB(&ees->codeoffsets[n_sample], &ees->arrvtime);
	if (dbg & DB_LOG_SAMPLES) msyslog(LOG_ERR,
					    "MSF%d: [%x] %d (ees: %d %d) (pps: %d %d)%s",
					    ees->unit, DB_LOG_DELTAS, n_sample,
					    ees->codeoffsets[n_sample].l_f,
					    ees->codeoffsets[n_sample].l_f / 4295,
					    pps_arrvstamp.l_f,
					    pps_arrvstamp.l_f /4295,
					    (dbg & DB_NO_PPS) ? " [no PPS]" : "");

	if (ees->nsamples++ == NCODES-1) ees_process(ees);

	/* Done! */
}


/* offcompare - auxiliary comparison routine for offset sort */

#ifdef QSORT_USES_VOID_P
static int
offcompare(
	const void *va,
	const void *vb
	)
{
	const l_fp *a = (const l_fp *)va;
	const l_fp *b = (const l_fp *)vb;
	return(L_ISGEQ(a, b) ? (L_ISEQU(a, b) ? 0 : 1) : -1);
}
#else
static int
offcompare(
	const l_fp *a,
	const l_fp *b
	)
{
	return(L_ISGEQ(a, b) ? (L_ISEQU(a, b) ? 0 : 1) : -1);
}
#endif /* QSORT_USES_VOID_P */


/* ees_process - process a pile of samples from the clock */
static void
ees_process(
	struct eesunit *ees
	)
{
	static int last_samples = -1;
	register int i, j;
	register int noff;
	register l_fp *coffs = ees->codeoffsets;
	l_fp offset, tmp;
	double dispersion;	/* ++++ */
	int lostsync, isinsync;
	int samples = ees->nsamples;
	int samplelog = 0;	/* keep "gcc -Wall" happy ! */
	int samplereduce = (samples + 1) / 2;
	double doffset;

	/* Reset things to zero so we don't have to worry later */
	ees_reset(ees);

	if (sloppyclockflag[ees->unit]) {
		samplelog = (samples <  2) ? 0 :
			(samples <  5) ? 1 :
			(samples <  9) ? 2 :
			(samples < 17) ? 3 :
			(samples < 33) ? 4 : 5;
		samplereduce = (1 << samplelog);
	}

	if (samples != last_samples &&
	    ((samples != (last_samples-1)) || samples < 3)) {
		msyslog(LOG_ERR, "Samples=%d (%d), samplereduce=%d ....",
			samples, last_samples, samplereduce);
		last_samples = samples;
	}
	if (samples < 1) return;

	/* If requested, dump the raw data we have in the buffer */
	if (ees->dump_vals) dump_buf(coffs, 0, samples, "Raw  data  is:");

	/* Sort the offsets, trim off the extremes, then choose one. */
	qsort(
#ifdef QSORT_USES_VOID_P
	    (void *)
#else
	    (char *)
#endif
	    coffs, (size_t)samples, sizeof(l_fp), offcompare);

	noff = samples;
	i = 0;
	while ((noff - i) > samplereduce) {
		/* Trim off the sample which is further away
		 * from the median.  We work this out by doubling
		 * the median, subtracting off the end samples, and
		 * looking at the sign of the answer, using the
		 * identity (c-b)-(b-a) == 2*b-a-c
		 */
		tmp = coffs[(noff + i)/2];
		L_ADD(&tmp, &tmp);
		L_SUB(&tmp, &coffs[i]);
		L_SUB(&tmp, &coffs[noff-1]);
		if (L_ISNEG(&tmp)) noff--; else i++;
	}

	/* If requested, dump the reduce data we have in the buffer */
	if (ees->dump_vals) dump_buf(coffs, i, noff, "Reduced    to:");

	/* What we do next depends on the setting of the sloppy clock flag.
	 * If it is on, average the remainder to derive our estimate.
	 * Otherwise, just pick a representative value from the remaining stuff
	 */
	if (sloppyclockflag[ees->unit]) {
		offset.l_ui = offset.l_uf = 0;
		for (j = i; j < noff; j++)
		    L_ADD(&offset, &coffs[j]);
		for (j = samplelog; j > 0; j--)
		    L_RSHIFTU(&offset);
	}
	else offset = coffs[i+BESTSAMPLE];

	/* Compute the dispersion as the difference between the
	 * lowest and highest offsets that remain in the
	 * consideration list.
	 *
	 * It looks like MOST clocks have MOD (max error), so halve it !
	 */
	tmp = coffs[noff-1];
	L_SUB(&tmp, &coffs[i]);
#define	FRACT_SEC(n) ((1 << 30) / (n/2))
	dispersion = LFPTOFP(&tmp) / 2; /* ++++ */
	if (dbg & (DB_SYSLOG_SMPLI | DB_SYSLOG_SMPLE)) msyslog(
		(dbg & DB_SYSLOG_SMPLE) ? LOG_ERR : LOG_INFO,
		"I: [%x] Offset=%06d (%d), disp=%f%s [%d], %d %d=%d %d:%d %d=%d %d",
		dbg & (DB_SYSLOG_SMPLI | DB_SYSLOG_SMPLE),
		offset.l_f / 4295, offset.l_f,
		(dispersion * 1526) / 100,
		(sloppyclockflag[ees->unit]) ? " by averaging" : "",
		FRACT_SEC(10) / 4295,
		(coffs[0].l_f) / 4295,
		i,
		(coffs[i].l_f) / 4295,
		(coffs[samples/2].l_f) / 4295,
		(coffs[i+BESTSAMPLE].l_f) / 4295,
		noff-1,
		(coffs[noff-1].l_f) / 4295,
		(coffs[samples-1].l_f) / 4295);

	/* Are we playing silly wotsits ?
	 * If we are using all data, see if there is a "small" delta,
	 * and if so, blurr this with 3/4 of the delta from the last value
	 */
	if (ees->usealldata && ees->offset.l_uf) {
		long diff = (long) (ees->offset.l_uf - offset.l_uf);

		/* is the delta small enough ? */
		if ((- FRACT_SEC(100)) < diff && diff < FRACT_SEC(100)) {
			int samd = (64 * 4) / samples;
			long new;
			if (samd < 2) samd = 2;
			new = offset.l_uf + ((diff * (samd -1)) / samd);

			/* Sign change -> need to fix up int part */
			if ((new & 0x80000000) !=
			    (((long) offset.l_uf) & 0x80000000))
			{	NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
					msyslog(LOG_INFO, "I: %lx != %lx (%lx %lx), so add %d",
						new & 0x80000000,
						((long) offset.l_uf) & 0x80000000,
						new, (long) offset.l_uf,
						(new < 0) ? -1 : 1);
				offset.l_ui += (new < 0) ? -1 : 1;
			}
			dispersion /= 4;
			if (dbg & (DB_SYSLOG_SMTHI | DB_SYSLOG_SMTHE)) msyslog(
				(dbg & DB_SYSLOG_SMTHE) ? LOG_ERR : LOG_INFO,
				"I: [%x] Smooth data: %ld -> %ld, dispersion now %f",
				dbg & (DB_SYSLOG_SMTHI | DB_SYSLOG_SMTHE),
				((long) offset.l_uf) / 4295, new / 4295,
				(dispersion * 1526) / 100);
			offset.l_uf = (unsigned long) new;
		}
		else if (dbg & (DB_SYSLOG_NSMTHI | DB_SYSLOG_NSMTHE)) msyslog(
			(dbg & DB_SYSLOG_NSMTHE) ? LOG_ERR : LOG_INFO,
			"[%x] No smooth as delta not %d < %ld < %d",
			dbg & (DB_SYSLOG_NSMTHI | DB_SYSLOG_NSMTHE),
			- FRACT_SEC(100), diff, FRACT_SEC(100));
	}
	else if (dbg & (DB_SYSLOG_NSMTHI | DB_SYSLOG_NSMTHE)) msyslog(
		(dbg & DB_SYSLOG_NSMTHE) ? LOG_ERR : LOG_INFO,
		"I: [%x] No smooth as flag=%x and old=%x=%d (%d:%d)",
		dbg & (DB_SYSLOG_NSMTHI | DB_SYSLOG_NSMTHE),
		ees->usealldata, ees->offset.l_f, ees->offset.l_uf,
		offset.l_f, ees->offset.l_f - offset.l_f);

	/* Collect offset info for debugging info */
	ees->offset = offset;
	ees->lowoffset = coffs[i];
	ees->highoffset = coffs[noff-1];

	/* Determine synchronization status.  Can be unsync'd either
	 * by a report from the clock or by a leap hold.
	 *
	 * Loss of the radio signal for a short time does not cause
	 * us to go unsynchronised, since the receiver keeps quite
	 * good time on its own.  The spec says 20ms in 4 hours; the
	 * observed drift in our clock (Cambridge) is about a second
	 * a day, but even that keeps us within the inherent tolerance
	 * of the clock for about 15 minutes. Observation shows that
	 * the typical "short" outage is 3 minutes, so to allow us
	 * to ride out those, we will give it 5 minutes.
	 */
	lostsync = current_time - ees->clocklastgood > 300 ? 1 : 0;
	isinsync = (lostsync || ees->leaphold > current_time) ? 0 : 1;

	/* Done.  Use time of last good, synchronised code as the
	 * reference time, and lastsampletime as the receive time.
	 */
	if (ees->fix_pending) {
		msyslog(LOG_ERR, "MSF%d: fix_pending=%d -> jump %x.%08x\n",
			ees->fix_pending, ees->unit, offset.l_i, offset.l_f);
		ees->fix_pending = 0;
	}
	LFPTOD(&offset, doffset);
	refclock_receive(ees->peer);
	ees_event(ees, lostsync ? CEVNT_PROP : CEVNT_NOMINAL);
}

/* msfees_poll - called by the transmit procedure */
static void
msfees_poll(
	int unit,
	struct peer *peer
	)
{
	if (unit >= MAXUNITS) {
		msyslog(LOG_ERR, "ees clock poll: INTERNAL: unit %d invalid",
			unit);
		return;
	}
	if (!unitinuse[unit]) {
		msyslog(LOG_ERR, "ees clock poll: INTERNAL: unit %d unused",
			unit);
		return;
	}

	ees_process(eesunits[unit]);

	if ((current_time - eesunits[unit]->lasttime) > 150)
	    ees_event(eesunits[unit], CEVNT_FAULT);
}


#else
int refclock_msfees_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/ntp_parser.h0000644000175000017500000002246611675457724015140 0ustar  peterpeter
/* A Bison parser, made by GNU Bison 2.4.1.  */

/* Skeleton interface for Bison's Yacc-like parsers in C
   
      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
   Free Software Foundation, Inc.
   
   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 .  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.
   
   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */


/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     T_Age = 258,
     T_All = 259,
     T_Allan = 260,
     T_Auth = 261,
     T_Autokey = 262,
     T_Automax = 263,
     T_Average = 264,
     T_Bclient = 265,
     T_Beacon = 266,
     T_Bias = 267,
     T_Broadcast = 268,
     T_Broadcastclient = 269,
     T_Broadcastdelay = 270,
     T_Burst = 271,
     T_Calibrate = 272,
     T_Calldelay = 273,
     T_Ceiling = 274,
     T_Clockstats = 275,
     T_Cohort = 276,
     T_ControlKey = 277,
     T_Crypto = 278,
     T_Cryptostats = 279,
     T_Day = 280,
     T_Default = 281,
     T_Digest = 282,
     T_Disable = 283,
     T_Discard = 284,
     T_Dispersion = 285,
     T_Double = 286,
     T_Driftfile = 287,
     T_Drop = 288,
     T_Ellipsis = 289,
     T_Enable = 290,
     T_End = 291,
     T_False = 292,
     T_File = 293,
     T_Filegen = 294,
     T_Flag1 = 295,
     T_Flag2 = 296,
     T_Flag3 = 297,
     T_Flag4 = 298,
     T_Flake = 299,
     T_Floor = 300,
     T_Freq = 301,
     T_Fudge = 302,
     T_Host = 303,
     T_Huffpuff = 304,
     T_Iburst = 305,
     T_Ident = 306,
     T_Ignore = 307,
     T_Includefile = 308,
     T_Integer = 309,
     T_Interface = 310,
     T_Ipv4 = 311,
     T_Ipv4_flag = 312,
     T_Ipv6 = 313,
     T_Ipv6_flag = 314,
     T_Kernel = 315,
     T_Key = 316,
     T_Keys = 317,
     T_Keysdir = 318,
     T_Kod = 319,
     T_Mssntp = 320,
     T_Leapfile = 321,
     T_Limited = 322,
     T_Link = 323,
     T_Listen = 324,
     T_Logconfig = 325,
     T_Logfile = 326,
     T_Loopstats = 327,
     T_Lowpriotrap = 328,
     T_Manycastclient = 329,
     T_Manycastserver = 330,
     T_Mask = 331,
     T_Maxclock = 332,
     T_Maxdist = 333,
     T_Maxpoll = 334,
     T_Minclock = 335,
     T_Mindist = 336,
     T_Minimum = 337,
     T_Minpoll = 338,
     T_Minsane = 339,
     T_Mode = 340,
     T_Monitor = 341,
     T_Month = 342,
     T_Multicastclient = 343,
     T_Nic = 344,
     T_Nolink = 345,
     T_Nomodify = 346,
     T_None = 347,
     T_Nopeer = 348,
     T_Noquery = 349,
     T_Noselect = 350,
     T_Noserve = 351,
     T_Notrap = 352,
     T_Notrust = 353,
     T_Ntp = 354,
     T_Ntpport = 355,
     T_NtpSignDsocket = 356,
     T_Orphan = 357,
     T_Panic = 358,
     T_Peer = 359,
     T_Peerstats = 360,
     T_Phone = 361,
     T_Pid = 362,
     T_Pidfile = 363,
     T_Pool = 364,
     T_Port = 365,
     T_Preempt = 366,
     T_Prefer = 367,
     T_Protostats = 368,
     T_Pw = 369,
     T_Qos = 370,
     T_Randfile = 371,
     T_Rawstats = 372,
     T_Refid = 373,
     T_Requestkey = 374,
     T_Restrict = 375,
     T_Revoke = 376,
     T_Saveconfigdir = 377,
     T_Server = 378,
     T_Setvar = 379,
     T_Sign = 380,
     T_Statistics = 381,
     T_Stats = 382,
     T_Statsdir = 383,
     T_Step = 384,
     T_Stepout = 385,
     T_Stratum = 386,
     T_String = 387,
     T_Sysstats = 388,
     T_Tick = 389,
     T_Time1 = 390,
     T_Time2 = 391,
     T_Timingstats = 392,
     T_Tinker = 393,
     T_Tos = 394,
     T_Trap = 395,
     T_True = 396,
     T_Trustedkey = 397,
     T_Ttl = 398,
     T_Type = 399,
     T_Unconfig = 400,
     T_Unpeer = 401,
     T_Version = 402,
     T_WanderThreshold = 403,
     T_Week = 404,
     T_Wildcard = 405,
     T_Xleave = 406,
     T_Year = 407,
     T_Flag = 408,
     T_Void = 409,
     T_EOC = 410,
     T_Simulate = 411,
     T_Beep_Delay = 412,
     T_Sim_Duration = 413,
     T_Server_Offset = 414,
     T_Duration = 415,
     T_Freq_Offset = 416,
     T_Wander = 417,
     T_Jitter = 418,
     T_Prop_Delay = 419,
     T_Proc_Delay = 420
   };
#endif
/* Tokens.  */
#define T_Age 258
#define T_All 259
#define T_Allan 260
#define T_Auth 261
#define T_Autokey 262
#define T_Automax 263
#define T_Average 264
#define T_Bclient 265
#define T_Beacon 266
#define T_Bias 267
#define T_Broadcast 268
#define T_Broadcastclient 269
#define T_Broadcastdelay 270
#define T_Burst 271
#define T_Calibrate 272
#define T_Calldelay 273
#define T_Ceiling 274
#define T_Clockstats 275
#define T_Cohort 276
#define T_ControlKey 277
#define T_Crypto 278
#define T_Cryptostats 279
#define T_Day 280
#define T_Default 281
#define T_Digest 282
#define T_Disable 283
#define T_Discard 284
#define T_Dispersion 285
#define T_Double 286
#define T_Driftfile 287
#define T_Drop 288
#define T_Ellipsis 289
#define T_Enable 290
#define T_End 291
#define T_False 292
#define T_File 293
#define T_Filegen 294
#define T_Flag1 295
#define T_Flag2 296
#define T_Flag3 297
#define T_Flag4 298
#define T_Flake 299
#define T_Floor 300
#define T_Freq 301
#define T_Fudge 302
#define T_Host 303
#define T_Huffpuff 304
#define T_Iburst 305
#define T_Ident 306
#define T_Ignore 307
#define T_Includefile 308
#define T_Integer 309
#define T_Interface 310
#define T_Ipv4 311
#define T_Ipv4_flag 312
#define T_Ipv6 313
#define T_Ipv6_flag 314
#define T_Kernel 315
#define T_Key 316
#define T_Keys 317
#define T_Keysdir 318
#define T_Kod 319
#define T_Mssntp 320
#define T_Leapfile 321
#define T_Limited 322
#define T_Link 323
#define T_Listen 324
#define T_Logconfig 325
#define T_Logfile 326
#define T_Loopstats 327
#define T_Lowpriotrap 328
#define T_Manycastclient 329
#define T_Manycastserver 330
#define T_Mask 331
#define T_Maxclock 332
#define T_Maxdist 333
#define T_Maxpoll 334
#define T_Minclock 335
#define T_Mindist 336
#define T_Minimum 337
#define T_Minpoll 338
#define T_Minsane 339
#define T_Mode 340
#define T_Monitor 341
#define T_Month 342
#define T_Multicastclient 343
#define T_Nic 344
#define T_Nolink 345
#define T_Nomodify 346
#define T_None 347
#define T_Nopeer 348
#define T_Noquery 349
#define T_Noselect 350
#define T_Noserve 351
#define T_Notrap 352
#define T_Notrust 353
#define T_Ntp 354
#define T_Ntpport 355
#define T_NtpSignDsocket 356
#define T_Orphan 357
#define T_Panic 358
#define T_Peer 359
#define T_Peerstats 360
#define T_Phone 361
#define T_Pid 362
#define T_Pidfile 363
#define T_Pool 364
#define T_Port 365
#define T_Preempt 366
#define T_Prefer 367
#define T_Protostats 368
#define T_Pw 369
#define T_Qos 370
#define T_Randfile 371
#define T_Rawstats 372
#define T_Refid 373
#define T_Requestkey 374
#define T_Restrict 375
#define T_Revoke 376
#define T_Saveconfigdir 377
#define T_Server 378
#define T_Setvar 379
#define T_Sign 380
#define T_Statistics 381
#define T_Stats 382
#define T_Statsdir 383
#define T_Step 384
#define T_Stepout 385
#define T_Stratum 386
#define T_String 387
#define T_Sysstats 388
#define T_Tick 389
#define T_Time1 390
#define T_Time2 391
#define T_Timingstats 392
#define T_Tinker 393
#define T_Tos 394
#define T_Trap 395
#define T_True 396
#define T_Trustedkey 397
#define T_Ttl 398
#define T_Type 399
#define T_Unconfig 400
#define T_Unpeer 401
#define T_Version 402
#define T_WanderThreshold 403
#define T_Week 404
#define T_Wildcard 405
#define T_Xleave 406
#define T_Year 407
#define T_Flag 408
#define T_Void 409
#define T_EOC 410
#define T_Simulate 411
#define T_Beep_Delay 412
#define T_Sim_Duration 413
#define T_Server_Offset 414
#define T_Duration 415
#define T_Freq_Offset 416
#define T_Wander 417
#define T_Jitter 418
#define T_Prop_Delay 419
#define T_Proc_Delay 420




#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{

/* Line 1676 of yacc.c  */
#line 50 "ntp_parser.y"

    char   *String;
    double  Double;
    int     Integer;
    void   *VoidPtr;
    queue  *Queue;
    struct attr_val *Attr_val;
    struct address_node *Address_node;
    struct setvar_node *Set_var;

    /* Simulation types */
    server_info *Sim_server;
    script_info *Sim_script;



/* Line 1676 of yacc.c  */
#line 399 "ntp_parser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif

extern YYSTYPE yylval;


ntp-4.2.6p5/ntpd/refclock_ripencc.c0000644000175000017500000035500711455531713016234 0ustar  peterpeter/*
 * $Id: refclock_ripencc.c,v 1.13 2002/06/18 14:20:55 marks Exp marks $
 *
 * Copyright (c) 2002  RIPE NCC
 *
 * All Rights Reserved
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose and without fee is hereby granted,
 * provided that the above copyright notice appear in all copies and that
 * both that copyright notice and this permission notice appear in
 * supporting documentation, and that the name of the author not be
 * used in advertising or publicity pertaining to distribution of the
 * software without specific, written prior permission.
 *
 * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
 * AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 *
 *
 * This driver was developed for use with the RIPE NCC TTM project.
 *
 *
 * The initial driver was developed by Daniel Karrenberg  
 * using the code made available by Trimble. This was for xntpd-3.x.x
 *
 * Rewrite of the driver for ntpd-4.x.x by Mark Santcroos 
 *
 */

#ifdef HAVE_CONFIG_H
#include 
#endif /* HAVE_CONFIG_H */

#if defined(REFCLOCK) && defined(CLOCK_RIPENCC)

#include "ntp_stdlib.h"
#include "ntpd.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_io.h"

#ifdef HAVE_PPSAPI
# include "ppsapi_timepps.h"
#endif

/*
 * Definitions
 */

/* we are on little endian */
#define BYTESWAP

/* 
 * DEBUG statements: uncomment if necessary
 */
/* #define DEBUG_NCC */ /* general debug statements */
/* #define DEBUG_PPS */ /* debug pps */
/* #define DEBUG_RAW */ /* print raw packets */

#define TRIMBLE_OUTPUT_FUNC
#define TSIP_VERNUM "7.12a"

#ifndef FALSE
#define FALSE 	(0)
#define TRUE 	(!FALSE)
#endif /* FALSE */

#define GPS_PI 	(3.1415926535898)
#define GPS_C 		(299792458.)
#define	D2R		(GPS_PI/180.0)
#define	R2D		(180.0/GPS_PI)
#define WEEK 	(604800.)
#define MAXCHAN  (8)

/* control characters for TSIP packets */
#define DLE 	(0x10)
#define ETX 	(0x03)

#define MAX_RPTBUF (256)

/* values of TSIPPKT.status */
#define TSIP_PARSED_EMPTY 	0
#define TSIP_PARSED_FULL 	1
#define TSIP_PARSED_DLE_1 	2
#define TSIP_PARSED_DATA 	3
#define TSIP_PARSED_DLE_2 	4

#define UTCF_UTC_AVAIL  (unsigned char) (1)     /* UTC available */
#define UTCF_LEAP_SCHD  (unsigned char) (1<<4)  /* Leap scheduled */
#define UTCF_LEAP_PNDG  (unsigned char) (1<<5)  /* Leap pending, will occur at end of day */

#define DEVICE  "/dev/gps%d"	/* name of radio device */
#define PRECISION       (-9)    /* precision assumed (about 2 ms) */
#define PPS_PRECISION   (-20)	/* precision assumed (about 1 us) */
#define REFID           "GPS\0" /* reference id */
#define REFID_LEN	4
#define DESCRIPTION     "RIPE NCC GPS (Palisade)"	/* Description */
#define SPEED232        B9600   /* 9600 baud */

#define NSAMPLES        3       /* stages of median filter */

/* Structures */

/* TSIP packets have the following structure, whether report or command. */
typedef struct {
	short 
	    counter,		/* counter */
	    len;		/* size of buf; < MAX_RPTBUF unsigned chars */
	unsigned char
	    status,		/* TSIP packet format/parse status */
	    code,		/* TSIP code */
	    buf[MAX_RPTBUF];	/* report or command string */
} TSIPPKT;

/* TSIP binary data structures */
typedef struct {
	unsigned char
	    t_oa_raw, SV_health;
	float
	    e, t_oa, i_0, OMEGADOT, sqrt_A,
	    OMEGA_0, omega, M_0, a_f0, a_f1,
	    Axis, n, OMEGA_n, ODOT_n, t_zc;
	short
	    weeknum, wn_oa;
} ALM_INFO;

typedef struct {		/*  Almanac health page (25) parameters  */
	unsigned char
	    WN_a, SV_health[32], t_oa;
} ALH_PARMS;

typedef struct {		/*  Universal Coordinated Time (UTC) parms */
	double
	    A_0;
	float
	    A_1;
	short
	    delta_t_LS;
	float
	    t_ot;
	short
	    WN_t, WN_LSF, DN, delta_t_LSF;
} UTC_INFO;

typedef struct {		/*  Ionospheric info (float)  */
	float
	    alpha_0, alpha_1, alpha_2, alpha_3,
	    beta_0, beta_1, beta_2, beta_3;
} ION_INFO;

typedef struct {		/*  Subframe 1 info (float)  */
	short
	    weeknum;
	unsigned char
	    codeL2, L2Pdata, SVacc_raw, SV_health;
	short
	    IODC;
	float
	    T_GD, t_oc, a_f2, a_f1, a_f0, SVacc;
} EPHEM_CLOCK;

typedef	struct {		/*  Ephemeris info (float)  */
	unsigned char
	    IODE, fit_interval;
	float
	    C_rs, delta_n;
	double
	    M_0;
	float
	    C_uc;
	double
	    e;
	float
	    C_us;
	double
	    sqrt_A;
	float
	    t_oe, C_ic;
	double
	    OMEGA_0;
	float
	    C_is;
	double
	    i_0;
	float
	    C_rc;
	double
	    omega;
	float
	    OMEGADOT, IDOT;
	double
	    Axis, n, r1me2, OMEGA_n, ODOT_n;
} EPHEM_ORBIT;

typedef struct {		/* Navigation data structure */
	short
	    sv_number;		/* SV number (0 = no entry) */
	float
	    t_ephem;		/* time of ephemeris collection */
	EPHEM_CLOCK
	    ephclk;		/* subframe 1 data */
	EPHEM_ORBIT
	    ephorb;		/* ephemeris data */
} NAV_INFO;

typedef struct {
	unsigned char
	    bSubcode,
	    operating_mode,
	    dgps_mode,
	    dyn_code,
	    trackmode;
	float
	    elev_mask,
	    cno_mask,
	    dop_mask,
	    dop_switch;
	unsigned char
	    dgps_age_limit;
} TSIP_RCVR_CFG;


#ifdef TRIMBLE_OUTPUT_FUNC
static char
        *dayname[7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"},
	old_baudnum[] = {0, 1, 4, 5, 6, 8, 9, 11, 28, 12},
        *st_baud_text_app [] = {"", "", "  300", "  600", " 1200", " 2400", 
				" 4800", " 9600", "19200", "38400"},
	*old_parity_text[] = {"EVEN", "ODD", "", "", "NONE"},
	*parity_text [] = {"NONE", "ODD", "EVEN"},
	*old_input_ch[] = { "TSIP", "RTCM (6 of 8 bits)"},
	*old_output_ch[] = { "TSIP", "No output", "", "", "", "NMEA 0183"},
	*protocols_in_text[] = { "", "TSIP", "", ""},
	*protocols_out_text[] =	{ "", "TSIP", "NMEA"},
	*rcvr_port_text [] = { "Port A      ", "Port B      ", "Current Port"},
	*dyn_text [] = {"Unchanged", "Land", "Sea", "Air", "Static"},
	*NavModeText0xBB[] = {"automatic", "time only (0-D)", "", "2-D",
			      "3-D", "", "", "OverDetermined Time"},
	*PPSTimeBaseText[] = {"GPS", "UTC", "USER"},
	*PPSPolarityText[] = {"Positive", "Negative"},
  	*MaskText[] = { "Almanac  ", "Ephemeris", "UTC      ", "Iono     ",
			"GPS Msg  ", "Alm Hlth ", "Time Fix ", "SV Select",
			"Ext Event", "Pos Fix  ", "Raw Meas "};

#endif /* TRIMBLE_OUTPUT_FUNC */

/*
 * Unit control structure
 */
struct ripencc_unit {                   
        int unit;                       /* unit number */
        int     pollcnt;                /* poll message counter */
        int     polled;                 /* Hand in a sample? */
        char leapdelta;                 /* delta of next leap event */
        unsigned char utcflags;         /* delta of next leap event */
        l_fp    tstamp;                 /* timestamp of last poll */
        
        struct timespec ts;             /* last timestamp */
        pps_params_t pps_params;        /* pps parameters */
        pps_info_t pps_info;            /* last pps data */
        pps_handle_t handle;            /* pps handlebars */

};


/*******************        PROTOYPES            *****************/

/*  prototypes for report parsing primitives */
short rpt_0x3D (TSIPPKT *rpt, unsigned char *tx_baud_index,
		unsigned char *rx_baud_index, unsigned char *char_format_index,
		unsigned char *stop_bits, unsigned char *tx_mode_index,
		unsigned char *rx_mode_index);
short rpt_0x40 (TSIPPKT *rpt, unsigned char *sv_prn, short *week_num,
		float *t_zc, float *eccentricity, float *t_oa, float *i_0,
		float *OMEGA_dot, float *sqrt_A, float *OMEGA_0, float *omega,
		float *M_0);
short rpt_0x41 (TSIPPKT *rpt, float *time_of_week, float *UTC_offset,
		short *week_num);
short rpt_0x42 (TSIPPKT *rpt, float ECEF_pos[3], float *time_of_fix);
short rpt_0x43 (TSIPPKT *rpt, float ECEF_vel[3], float *freq_offset,
		float *time_of_fix);
short rpt_0x45 (TSIPPKT *rpt, unsigned char *major_nav_version,
		unsigned char *minor_nav_version, unsigned char *nav_day,
		unsigned char *nav_month, unsigned char *nav_year,
		unsigned char *major_dsp_version, unsigned char *minor_dsp_version,
		unsigned char *dsp_day, unsigned char *dsp_month,
		unsigned char *dsp_year);
short rpt_0x46 (TSIPPKT *rpt, unsigned char *status1, unsigned char *status2);
short rpt_0x47 (TSIPPKT *rpt, unsigned char *nsvs, unsigned char *sv_prn,
		float *snr);
short rpt_0x48 (TSIPPKT *rpt, unsigned char *message);
short rpt_0x49 (TSIPPKT *rpt, unsigned char *sv_health);
short rpt_0x4A (TSIPPKT *rpt, float *lat, float *lon, float *alt,
		float *clock_bias, float *time_of_fix);
short rpt_0x4A_2 (TSIPPKT *rpt, float *alt, float *dummy,
		  unsigned char *alt_flag);
short rpt_0x4B (TSIPPKT *rpt, unsigned char *machine_id,
		unsigned char *status3, unsigned char *status4);
short rpt_0x4C (TSIPPKT *rpt, unsigned char *dyn_code, float *el_mask,
		float *snr_mask, float *dop_mask, float *dop_switch);
short rpt_0x4D (TSIPPKT *rpt, float *osc_offset);
short rpt_0x4E (TSIPPKT *rpt, unsigned char *response);
short rpt_0x4F (TSIPPKT *rpt, double *a0, float *a1, float *time_of_data,
		short *dt_ls, short *wn_t, short *wn_lsf, short *dn, short *dt_lsf);
short rpt_0x54 (TSIPPKT *rpt, float *clock_bias, float *freq_offset,
		float *time_of_fix);
short rpt_0x55 (TSIPPKT *rpt, unsigned char *pos_code, unsigned char *vel_code,
		unsigned char *time_code, unsigned char *aux_code);
short rpt_0x56 (TSIPPKT *rpt, float vel_ENU[3], float *freq_offset,
		float *time_of_fix);
short rpt_0x57 (TSIPPKT *rpt, unsigned char *source_code,
		unsigned char *diag_code, short *week_num, float *time_of_fix);
short rpt_0x58 (TSIPPKT *rpt, unsigned char *op_code, unsigned char *data_type,
		unsigned char *sv_prn, unsigned char *data_length,
		unsigned char *data_packet);
short rpt_0x59 (TSIPPKT *rpt, unsigned char *code_type,
		unsigned char status_code[32]);
short rpt_0x5A (TSIPPKT *rpt, unsigned char *sv_prn, float *sample_length,
		float *signal_level, float *code_phase, float *Doppler,
		double *time_of_fix);
short rpt_0x5B (TSIPPKT *rpt, unsigned char *sv_prn, unsigned char *sv_health,
		unsigned char *sv_iode, unsigned char *fit_interval_flag,
		float *time_of_collection, float *time_of_eph, float *sv_accy);
short rpt_0x5C (TSIPPKT *rpt, unsigned char *sv_prn, unsigned char *slot,
		unsigned char *chan, unsigned char *acq_flag, unsigned char *eph_flag,
		float *signal_level, float *time_of_last_msmt, float *elev,
		float *azim, unsigned char *old_msmt_flag,
		unsigned char *integer_msec_flag, unsigned char *bad_data_flag,
		unsigned char *data_collect_flag);
short rpt_0x6D (TSIPPKT *rpt, unsigned char *manual_mode, unsigned char *nsvs,
		unsigned char *ndim, unsigned char sv_prn[], float *pdop,
		float *hdop, float *vdop, float *tdop);
short rpt_0x82 (TSIPPKT *rpt, unsigned char *diff_mode);
short rpt_0x83 (TSIPPKT *rpt, double ECEF_pos[3], double *clock_bias,
		float *time_of_fix);
short rpt_0x84 (TSIPPKT *rpt, double *lat, double *lon, double *alt,
		double *clock_bias, float *time_of_fix);
short rpt_Paly0xBB(TSIPPKT *rpt, TSIP_RCVR_CFG *TsipxBB);
short rpt_0xBC   (TSIPPKT *rpt, unsigned char *port_num,
		  unsigned char *in_baud, unsigned char *out_baud,
		  unsigned char *data_bits, unsigned char *parity,
		  unsigned char *stop_bits, unsigned char *flow_control,
		  unsigned char *protocols_in, unsigned char *protocols_out,
		  unsigned char *reserved);

/* prototypes for superpacket parsers */

short rpt_0x8F0B (TSIPPKT *rpt, unsigned short *event, double *tow,
		  unsigned char *date, unsigned char *month, short *year,
		  unsigned char *dim_mode, short *utc_offset, double *bias, double *drift,
		  float *bias_unc, float *dr_unc, double *lat, double *lon, double *alt,
		  char sv_id[8]);
short rpt_0x8F14 (TSIPPKT *rpt, short *datum_idx, double datum_coeffs[5]);
short rpt_0x8F15 (TSIPPKT *rpt, short *datum_idx, double datum_coeffs[5]);
short rpt_0x8F20 (TSIPPKT *rpt, unsigned char *info, double *lat,
		  double *lon, double *alt, double vel_enu[], double *time_of_fix,
		  short *week_num, unsigned char *nsvs, unsigned char sv_prn[], 
		  short sv_IODC[], short *datum_index);
short rpt_0x8F41 (TSIPPKT *rpt, unsigned char *bSearchRange,
		  unsigned char *bBoardOptions, unsigned long *iiSerialNumber,
		  unsigned char *bBuildYear, unsigned char *bBuildMonth,
		  unsigned char *bBuildDay, unsigned char *bBuildHour,
		  float *fOscOffset, unsigned short *iTestCodeId);
short rpt_0x8F42 (TSIPPKT *rpt, unsigned char *bProdOptionsPre,
		  unsigned char *bProdNumberExt, unsigned short *iCaseSerialNumberPre,
		  unsigned long *iiCaseSerialNumber, unsigned long *iiProdNumber,
		  unsigned short *iPremiumOptions, unsigned short *iMachineID,
		  unsigned short *iKey);
short rpt_0x8F45 (TSIPPKT *rpt, unsigned char *bSegMask);
short rpt_0x8F4A_16 (TSIPPKT *rpt, unsigned char *pps_enabled,
		     unsigned char *pps_timebase, unsigned char *pos_polarity,
		     double *pps_offset, float *bias_unc_threshold);
short rpt_0x8F4B (TSIPPKT *rpt, unsigned long *decorr_max);
short rpt_0x8F4D (TSIPPKT *rpt, unsigned long *event_mask);
short rpt_0x8FA5 (TSIPPKT *rpt, unsigned char *spktmask);
short rpt_0x8FAD (TSIPPKT *rpt, unsigned short *COUNT, double *FracSec,
		  unsigned char *Hour, unsigned char *Minute, unsigned char *Second,
		  unsigned char *Day, unsigned char *Month, unsigned short *Year,
		  unsigned char *Status, unsigned char *Flags);

/**/
/* prototypes for command-encode primitives with suffix convention:  */
/* c = clear, s = set, q = query, e = enable, d = disable            */
void cmd_0x1F  (TSIPPKT *cmd);
void cmd_0x26  (TSIPPKT *cmd);
void cmd_0x2F  (TSIPPKT *cmd);
void cmd_0x35s (TSIPPKT *cmd, unsigned char pos_code, unsigned char vel_code,
		unsigned char time_code, unsigned char opts_code);
void cmd_0x3C  (TSIPPKT *cmd, unsigned char sv_prn);
void cmd_0x3Ds (TSIPPKT *cmd, unsigned char baud_out, unsigned char baud_inp,
		unsigned char char_code, unsigned char stopbitcode,
		unsigned char output_mode, unsigned char input_mode);
void cmd_0xBBq (TSIPPKT *cmd, unsigned char subcode) ;

/* prototypes 8E commands */
void cmd_0x8E0Bq (TSIPPKT *cmd);
void cmd_0x8E41q (TSIPPKT *cmd);
void cmd_0x8E42q (TSIPPKT *cmd);
void cmd_0x8E4Aq (TSIPPKT *cmd);
void cmd_0x8E4As (TSIPPKT *cmd, unsigned char PPSOnOff, unsigned char TimeBase,
		  unsigned char Polarity, double PPSOffset, float Uncertainty);
void cmd_0x8E4Bq (TSIPPKT *cmd);
void cmd_0x8E4Ds (TSIPPKT *cmd, unsigned long AutoOutputMask);
void cmd_0x8EADq (TSIPPKT *cmd);

/* header/source border XXXXXXXXXXXXXXXXXXXXXXXXXX */

/* Trimble parse functions */
static 	int	parse0x8FAD	(TSIPPKT *, struct peer *);
static 	int	parse0x8F0B	(TSIPPKT *, struct peer *);
#ifdef TRIMBLE_OUTPUT_FUNC
static 	int	parseany	(TSIPPKT *, struct peer *);
static 	void	TranslateTSIPReportToText	(TSIPPKT *, char *);
#endif /* TRIMBLE_OUTPUT_FUNC */
static 	int	parse0x5C	(TSIPPKT *, struct peer *);
static 	int	parse0x4F	(TSIPPKT *, struct peer *);
static	void	tsip_input_proc	(TSIPPKT *, int);

/* Trimble helper functions */
static	void	bPutFloat 	(float *, unsigned char *);
static	void	bPutDouble 	(double *, unsigned char *);
static	void	bPutULong 	(unsigned long *, unsigned char *);
static	int	print_msg_table_header	(int rptcode, char *HdrStr, int force);
static	char *	show_time	(float time_of_week);

/* RIPE NCC functions */
static	void	ripencc_control	(int, const struct refclockstat *,
				 struct refclockstat *, struct peer *);
static	int	ripencc_ppsapi	(struct peer *, int, int);
static	int	ripencc_get_pps_ts	(struct ripencc_unit *, l_fp *);
static	int	ripencc_start	(int, struct peer *);
static 	void	ripencc_shutdown	(int, struct peer *);
static 	void	ripencc_poll	(int, struct peer *);
static 	void	ripencc_send	(struct peer *, TSIPPKT spt);
static 	void	ripencc_receive	(struct recvbuf *);

/* fill in reflock structure for our clock */
struct refclock refclock_ripencc = {
	ripencc_start,		/* start up driver */
	ripencc_shutdown,	/* shut down driver */
	ripencc_poll,		/* transmit poll message */
	ripencc_control,	/* control function */
	noentry,		/* initialize driver */
	noentry,		/* debug info */
	NOFLAGS			/* clock flags */
};

/*
 *  Tables to compute the ddd of year form icky dd/mm timecode. Viva la
 *  leap.
 */
static int day1tab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
static int day2tab[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};


/*
 * ripencc_start - open the GPS devices and initialize data for processing
 */
static int
ripencc_start(int unit, struct peer *peer)
{
	register struct ripencc_unit *up;
	struct refclockproc *pp;
	char device[40];
	int fd;
	struct termios tio;
	TSIPPKT spt;

	pp = peer->procptr;

	/*
	 * Open serial port
	 */
	(void)snprintf(device, sizeof(device), DEVICE, unit);
	if (!(fd = refclock_open(device, SPEED232, LDISC_RAW))) {
		pp->io.fd = -1;
		return (0);
	}

	pp->io.fd = fd;

	/* from refclock_palisade.c */
	if (tcgetattr(fd, &tio) < 0) {
		msyslog(LOG_ERR, "Palisade(%d) tcgetattr(fd, &tio): %m",unit);
		return (0);
	}

	/*
	 * set flags
	 */
	tio.c_cflag |= (PARENB|PARODD);
	tio.c_iflag &= ~ICRNL;
	if (tcsetattr(fd, TCSANOW, &tio) == -1) {
		msyslog(LOG_ERR, "Palisade(%d) tcsetattr(fd, &tio): %m",unit);
		return (0);
	}

	/*
	 * Allocate and initialize unit structure
	 */
	if (!(up = (struct ripencc_unit *) 
	      emalloc(sizeof(struct ripencc_unit)))) {
		(void) close(fd);
		return (0);
	}
	memset((char *)up, 0, sizeof(struct ripencc_unit));

	pp->io.clock_recv = ripencc_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	if (!io_addclock(&pp->io)) {
		pp->io.fd = -1;
		(void) close(fd);
		free(up);
		return (0);
	}
	pp->unitptr = (caddr_t)up;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, REFID_LEN);
	up->pollcnt = 2;
	up->unit = unit;
	up->leapdelta = 0;
	up->utcflags = 0;

	/*
	 * Initialize the Clock
	 */

	/* query software versions */
	cmd_0x1F(&spt);			
	ripencc_send(peer, spt);          

	/* query receiver health */
	cmd_0x26(&spt);			
	ripencc_send(peer, spt);

	/* query serial numbers */	
	cmd_0x8E42q(&spt);		
	ripencc_send(peer, spt);  
	
	/* query manuf params */
	cmd_0x8E41q(&spt);		
	ripencc_send(peer, spt); 

	/* i/o opts */ /* trimble manual page A30 */
	cmd_0x35s(&spt, 
		  0x1C, 	/* position */
		  0x00, 	/* velocity */
		  0x05, 	/* timing */
		  0x0a); 	/* auxilary */
	ripencc_send(peer, spt);
	
	/* turn off port A */
	cmd_0x3Ds (&spt,
		   0x0B,	/* baud_out */
		   0x0B,	/* baud_inp */
		   0x07,	/* char_code */
		   0x07,	/* stopbitcode */
		   0x01,	/* output_mode */
		   0x00);	/* input_mode */
	ripencc_send(peer, spt);

	/* set i/o options */
	cmd_0x8E4As (&spt,
		     0x01,	/* PPS on */
		     0x01,	/* Timebase UTC */
		     0x00,	/* polarity positive */
		     0.,	/* 100 ft. cable XXX make flag */
		     1e-6 * GPS_C); 	/* turn of biasuncert. > (1us) */
	ripencc_send(peer,spt);

	/* all outomatic packet output off */
	cmd_0x8E4Ds(&spt,
		    0x00000000); /* AutoOutputMask */
	ripencc_send(peer, spt);

	cmd_0xBBq (&spt,
		   0x00);	/* query primary configuration */
	ripencc_send(peer,spt);


	/* query PPS parameters */
	cmd_0x8E4Aq (&spt);	/* query PPS params */
	ripencc_send(peer,spt);

	/* query survey limit */
	cmd_0x8E4Bq (&spt);	/* query survey limit */
	ripencc_send(peer,spt);

#ifdef DEBUG_NCC
	if (debug)
		printf("ripencc_start: success\n");
#endif /* DEBUG_NCC */

	/*
	 * Start the PPSAPI interface if it is there. Default to use
	 * the assert edge and do not enable the kernel hardpps.
	 */
	if (time_pps_create(fd, &up->handle) < 0) {
		up->handle = 0;
		msyslog(LOG_ERR, "refclock_ripencc: time_pps_create failed: %m");
		return (1);
	}

	return(ripencc_ppsapi(peer, 0, 0));
}

/*
 * ripencc_control - fudge control
 */
static void
ripencc_control(
	int unit,		/* unit (not used) */
	const struct refclockstat *in, /* input parameters (not used) */
	struct refclockstat *out, /* output parameters (not used) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;

#ifdef DEBUG_NCC
	msyslog(LOG_INFO,"%s()",__FUNCTION__);
#endif /* DEBUG_NCC */

	pp = peer->procptr;
	ripencc_ppsapi(peer, pp->sloppyclockflag & CLK_FLAG2,
		       pp->sloppyclockflag & CLK_FLAG3);
}


/*
 * Initialize PPSAPI
 */
int
ripencc_ppsapi(
	struct peer *peer,	/* peer structure pointer */
	int enb_clear,		/* clear enable */
	int enb_hardpps		/* hardpps enable */
	)
{
	struct refclockproc *pp;
	struct ripencc_unit *up;
	int capability;

	pp = peer->procptr;
	up = (struct ripencc_unit *)pp->unitptr;
	if (time_pps_getcap(up->handle, &capability) < 0) {
		msyslog(LOG_ERR,
			"refclock_ripencc: time_pps_getcap failed: %m");
		return (0);
	}
	memset(&up->pps_params, 0, sizeof(pps_params_t));
	if (enb_clear)
		up->pps_params.mode = capability & PPS_CAPTURECLEAR;
	else
		up->pps_params.mode = capability & PPS_CAPTUREASSERT;
	if (!up->pps_params.mode) {
		msyslog(LOG_ERR,
			"refclock_ripencc: invalid capture edge %d",
			!enb_clear);
		return (0);
	}
	up->pps_params.mode |= PPS_TSFMT_TSPEC;
	if (time_pps_setparams(up->handle, &up->pps_params) < 0) {
		msyslog(LOG_ERR,
			"refclock_ripencc: time_pps_setparams failed: %m");
		return (0);
	}
	if (enb_hardpps) {
		if (time_pps_kcbind(up->handle, PPS_KC_HARDPPS,
				    up->pps_params.mode & ~PPS_TSFMT_TSPEC,
				    PPS_TSFMT_TSPEC) < 0) {
			msyslog(LOG_ERR,
				"refclock_ripencc: time_pps_kcbind failed: %m");
			return (0);
		}
		pps_enable = 1;
	}
	peer->precision = PPS_PRECISION;

#if DEBUG_NCC
	if (debug) {
		time_pps_getparams(up->handle, &up->pps_params);
		printf(
			"refclock_ripencc: capability 0x%x version %d mode 0x%x kern %d\n",
			capability, up->pps_params.api_version,
			up->pps_params.mode, enb_hardpps);
	}
#endif /* DEBUG_NCC */

	return (1);
}

/*
 * This function is called every 64 seconds from ripencc_receive
 * It will fetch the pps time 
 *
 * Return 0 on failure and 1 on success.
 */
static int
ripencc_get_pps_ts(
	struct ripencc_unit *up,
	l_fp *tsptr
	)
{
	pps_info_t pps_info;
	struct timespec timeout, ts;
	double dtemp;
	l_fp tstmp;

#ifdef DEBUG_PPS
	msyslog(LOG_INFO,"ripencc_get_pps_ts\n");
#endif /* DEBUG_PPS */


	/*
	 * Convert the timespec nanoseconds field to ntp l_fp units.
	 */ 
	if (up->handle == 0)
		return (0);
	timeout.tv_sec = 0;
	timeout.tv_nsec = 0;
	memcpy(&pps_info, &up->pps_info, sizeof(pps_info_t));
	if (time_pps_fetch(up->handle, PPS_TSFMT_TSPEC, &up->pps_info,
			   &timeout) < 0)
		return (0);
	if (up->pps_params.mode & PPS_CAPTUREASSERT) {
		if (pps_info.assert_sequence ==
		    up->pps_info.assert_sequence)
			return (0);
		ts = up->pps_info.assert_timestamp;
	} else if (up->pps_params.mode & PPS_CAPTURECLEAR) {
		if (pps_info.clear_sequence ==
		    up->pps_info.clear_sequence)
			return (0);
		ts = up->pps_info.clear_timestamp;
	} else {
		return (0);
	}
	if ((up->ts.tv_sec == ts.tv_sec) && (up->ts.tv_nsec == ts.tv_nsec))
		return (0);
	up->ts = ts;

	tstmp.l_ui = ts.tv_sec + JAN_1970;
	dtemp = ts.tv_nsec * FRAC / 1e9;
	tstmp.l_uf = (u_int32)dtemp;

#ifdef DEBUG_PPS
	msyslog(LOG_INFO,"ts.tv_sec: %d\n",(int)ts.tv_sec);
	msyslog(LOG_INFO,"ts.tv_nsec: %ld\n",ts.tv_nsec);
#endif /* DEBUG_PPS */

	*tsptr = tstmp;
	return (1);
}

/*
 * ripencc_shutdown - shut down a GPS clock
 */
static void
ripencc_shutdown(int unit, struct peer *peer)
{
	register struct ripencc_unit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct ripencc_unit *)pp->unitptr;

	if (up != NULL) {
		if (up->handle != 0)
			time_pps_destroy(up->handle);
		free(up);
	}
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);

	return;
}

/*
 * ripencc_poll - called by the transmit procedure
 */
static void
ripencc_poll(int unit, struct peer *peer)
{
	register struct ripencc_unit *up;
	struct refclockproc *pp;
	TSIPPKT spt;

#ifdef DEBUG_NCC
	if (debug)
		fprintf(stderr, "ripencc_poll(%d)\n", unit);
#endif /* DEBUG_NCC */
	pp = peer->procptr;
	up = (struct ripencc_unit *)pp->unitptr;
	if (up->pollcnt == 0)
		refclock_report(peer, CEVNT_TIMEOUT);
	else
		up->pollcnt--;

	pp->polls++;
	up->polled = 1;

	/* poll for UTC superpacket */
	cmd_0x8EADq (&spt);
	ripencc_send(peer,spt);
}

/*
 * ripencc_send - send message to clock
 * use the structures being created by the trimble functions!
 * makes the code more readable/clean
 */
static void
ripencc_send(struct peer *peer, TSIPPKT spt)
{
	unsigned char *ip, *op;
	unsigned char obuf[512];

#ifdef DEBUG_RAW
	{
		register struct ripencc_unit *up;
		register struct refclockproc *pp;	

		pp = peer->procptr;
		up = (struct ripencc_unit *)pp->unitptr;
		if (debug)
			printf("ripencc_send(%d, %02X)\n", up->unit, cmd);
	}
#endif /* DEBUG_RAW */

	ip = spt.buf;
	op = obuf;

	*op++ = 0x10;
	*op++ = spt.code;

	while (spt.len--) {
		if (op-obuf > sizeof(obuf)-5) {
			msyslog(LOG_ERR, "ripencc_send obuf overflow!");
			refclock_report(peer, CEVNT_FAULT);
			return;
		}
			
		if (*ip == 0x10) /* byte stuffing */
			*op++ = 0x10;
		*op++ = *ip++;
	}
	
	*op++ = 0x10;
	*op++ = 0x03;

#ifdef DEBUG_RAW
	if (debug) { /* print raw packet */
		unsigned char *cp;
		int i;

		printf("ripencc_send: len %d\n", op-obuf);
		for (i=1, cp=obuf; cpprocptr->io.fd, obuf, op-obuf) == -1) {
		refclock_report(peer, CEVNT_FAULT);
	}
}

/*
 * ripencc_receive()
 *
 * called when a packet is received on the serial port
 * takes care of further processing
 *
 */
static void
ripencc_receive(struct recvbuf *rbufp)
{
	register struct ripencc_unit *up;
	register struct refclockproc *pp;	
	struct peer *peer;
	static TSIPPKT rpt;	/* for current incoming TSIP report */ 
	TSIPPKT spt;		/* send packet */
	int ns_since_pps;			
	int i;
	char *cp;
	/* these variables hold data until we decide it's worth keeping */
	char    rd_lastcode[BMAX];
	l_fp    rd_tmp;
	u_short rd_lencode;

	/* msyslog(LOG_INFO, "%s",__FUNCTION__); */

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct ripencc_unit *)pp->unitptr;
	rd_lencode = refclock_gtlin(rbufp, rd_lastcode, BMAX, &rd_tmp);

#ifdef DEBUG_RAW
	if (debug)
		fprintf(stderr, "ripencc_receive(%d)\n", up->unit);
#endif /* DEBUG_RAW */

#ifdef DEBUG_RAW
	if (debug) {		/* print raw packet */
		int i;
		unsigned char *cp;

		printf("ripencc_receive: len %d\n", rbufp->recv_length);
		for (i=1, cp=(char*)&rbufp->recv_space;
		     i <= rbufp->recv_length;
		     i++, cp++) {
			printf(" %02X", *cp);
			if (i%10 == 0) 
				printf("\n");
		}
		printf("\n");
	}
#endif /* DEBUG_RAW */

	cp = (char*) &rbufp->recv_space;
	i=rbufp->recv_length;

	while (i--) {		/* loop over received chars */

		tsip_input_proc(&rpt, (unsigned char) *cp++);

		if (rpt.status != TSIP_PARSED_FULL)
			continue;

		switch (rpt.code) {

		    case 0x8F:	/* superpacket */

			switch (rpt.buf[0]) {

			    case 0xAD:	/* UTC Time */
				/*
				** When polling on port B the timecode is
				** the time of the previous PPS.  If we
				** completed receiving the packet less than
				** 150ms after the turn of the second, it
				** may have the code of the previous second.
				** We do not trust that and simply poll
				** again without even parsing it.
				**
				** More elegant would be to re-schedule the
				** poll, but I do not know (yet) how to do
				** that cleanly.
				**
				*/
				/* BLA ns_since_pps = ncc_tstmp(rbufp, &trtmp); */
/*   if (up->polled && ns_since_pps > -1 && ns_since_pps < 150) { */

				ns_since_pps = 200;
				if (up->polled && ns_since_pps < 150) {
					msyslog(LOG_INFO, "%s(): up->polled",
						__FUNCTION__);
					ripencc_poll(up->unit, peer);
					break;
				}

			        /*
 				 * Parse primary utc time packet
				 * and fill refclock structure 
				 * from results. 
				 */
				if (parse0x8FAD(&rpt, peer) < 0) {
					msyslog(LOG_INFO, "%s(): parse0x8FAD < 0",__FUNCTION__);
					refclock_report(peer, CEVNT_BADREPLY);
					break;
				}
				/*
				 * If the PPSAPI is working, rather use its 
				 * timestamps.
				 * assume that the PPS occurs on the second 
				 * so blow any msec
				 */
				if (ripencc_get_pps_ts(up, &rd_tmp) == 1) {
					pp->lastrec = up->tstamp = rd_tmp;
					pp->nsec = 0;
				}
				else
					msyslog(LOG_INFO, "%s(): ripencc_get_pps_ts returns failure\n",__FUNCTION__);


				if (!up->polled) { 
					msyslog(LOG_INFO, "%s(): unrequested packet\n",__FUNCTION__);
					/* unrequested packet */
					break;
				}

				/* we have been polled ! */
				up->polled = 0;
				up->pollcnt = 2;

				/* poll for next packet */
				cmd_0x8E0Bq(&spt);
				ripencc_send(peer,spt);
				
				if (ns_since_pps < 0) { /* no PPS */
					msyslog(LOG_INFO, "%s(): ns_since_pps < 0",__FUNCTION__);
					refclock_report(peer, CEVNT_BADTIME);
					break;
				}

				/*
				** Process the new sample in the median
				** filter and determine the reference clock
				** offset and dispersion.
				*/
				if (!refclock_process(pp)) {
					msyslog(LOG_INFO, "%s(): !refclock_process",__FUNCTION__);
					refclock_report(peer, CEVNT_BADTIME);
					break;
				}

				refclock_receive(peer);
				break;
			
			    case 0x0B: /* comprehensive time packet */
				parse0x8F0B(&rpt, peer);
				break;

			    default: /* other superpackets */
#ifdef DEBUG_NCC
				msyslog(LOG_INFO, "%s(): calling parseany",
					__FUNCTION__);
#endif /* DEBUG_NCC */
#ifdef TRIMBLE_OUTPUT_FUNC
				parseany(&rpt, peer);
#endif /* TRIMBLE_OUTPUT_FUNC */
				break;
			}
			break;

		    case 0x4F:	/* UTC parameters, for leap info */
			parse0x4F(&rpt, peer);
			break;

		    case 0x5C:	/* sat tracking data */
			parse0x5C(&rpt, peer);
			break;

		    default:	/* other packets */
#ifdef TRIMBLE_OUTPUT_FUNC
			parseany(&rpt, peer);
#endif /* TRIMBLE_OUTPUT_FUNC */
			break;
		}
   		rpt.status = TSIP_PARSED_EMPTY;
	}
}

/* 
 * All trimble functions that are directly referenced from driver code
 * (so not from parseany)
 */

/* request software versions */
void
cmd_0x1F(
	 TSIPPKT *cmd
	 )
{
	cmd->len = 0;
	cmd->code = 0x1F;
}

/* request receiver health */
void
cmd_0x26(
	 TSIPPKT *cmd
	 )
{
	cmd->len = 0;
	cmd->code = 0x26;
}

/* request UTC params */
void
cmd_0x2F(
	 TSIPPKT *cmd
	 )
{
	cmd->len = 0;
	cmd->code = 0x2F;
}

/* set serial I/O options */
void
cmd_0x35s(
	 TSIPPKT *cmd,
	 unsigned char pos_code,
	 unsigned char vel_code,
	 unsigned char time_code,
	 unsigned char opts_code
	 )
{
	cmd->buf[0] = pos_code;
	cmd->buf[1] = vel_code;
	cmd->buf[2] = time_code;
	cmd->buf[3] = opts_code;
	cmd->len = 4;
	cmd->code = 0x35;
}

/* request tracking status */
void
cmd_0x3C(
	 TSIPPKT *cmd,
	 unsigned char sv_prn
	 )
{
	cmd->buf[0] = sv_prn;
	cmd->len = 1;
	cmd->code = 0x3C;
}

/* set Channel A configuration for dual-port operation */
void
cmd_0x3Ds(
	  TSIPPKT *cmd,
	  unsigned char baud_out,
	  unsigned char baud_inp,
	  unsigned char char_code,
	  unsigned char stopbitcode,
	  unsigned char output_mode,
	  unsigned char input_mode
	  )
{
	cmd->buf[0] = baud_out;		/* XMT baud rate */
	cmd->buf[1] = baud_inp;		/* RCV baud rate */
	cmd->buf[2] = char_code;	/* parity and #bits per byte */
	cmd->buf[3] = stopbitcode;	/* number of stop bits code */
	cmd->buf[4] = output_mode;	/* Ch. A transmission mode */
	cmd->buf[5] = input_mode;	/* Ch. A reception mode */
	cmd->len = 6;
	cmd->code = 0x3D;
}


/* query primary configuration */
void
cmd_0xBBq(
	  TSIPPKT *cmd,
	  unsigned char subcode
	  )
{
	cmd->len = 1;
	cmd->code = 0xBB;
	cmd->buf[0] = subcode;
}


/**** Superpackets ****/
/* 8E-0B to query 8F-0B controls */
void
cmd_0x8E0Bq(
	    TSIPPKT *cmd
	    )
{
	cmd->len = 1;
	cmd->code = 0x8E;
	cmd->buf[0] = 0x0B;
}


/* 8F-41 to query board serial number */
void
cmd_0x8E41q(
	    TSIPPKT *cmd
	    )
{
	cmd->len = 1;
	cmd->code = 0x8E;
	cmd->buf[0] = 0x41;
}


/* 8F-42 to query product serial number */
void
cmd_0x8E42q(
	    TSIPPKT *cmd
	    )
{
	cmd->len = 1;
	cmd->code = 0x8E;
	cmd->buf[0] = 0x42;
}


/* 8F-4A to query PPS parameters */
void
cmd_0x8E4Aq(
	    TSIPPKT *cmd
	    )
{
	cmd->len = 1;
	cmd->code = 0x8E;
	cmd->buf[0] = 0x4A;
}


/* set i/o options */
void
cmd_0x8E4As(
	    TSIPPKT *cmd,
	    unsigned char PPSOnOff,
	    unsigned char TimeBase,
	    unsigned char Polarity,
	    double PPSOffset,
	    float Uncertainty
	    )
{
	cmd->len = 16;
	cmd->code = 0x8E;
	cmd->buf[0] = 0x4A;
	cmd->buf[1] = PPSOnOff;
	cmd->buf[2] = TimeBase;
	cmd->buf[3] = Polarity;
	bPutDouble (&PPSOffset, &cmd->buf[4]);
	bPutFloat (&Uncertainty, &cmd->buf[12]);
}

/* 8F-4B query survey limit */
void
cmd_0x8E4Bq(
	    TSIPPKT *cmd
	    )
{
	cmd->len = 1;
	cmd->code = 0x8E;
	cmd->buf[0] = 0x4B;
}

/* poll for UTC superpacket */
/* 8E-AD to query 8F-AD controls */
void
cmd_0x8EADq(
	    TSIPPKT *cmd
	    )
{
	cmd->len = 1;
	cmd->code = 0x8E;
	cmd->buf[0] = 0xAD;
}

/* all outomatic packet output off */
void
cmd_0x8E4Ds(
	    TSIPPKT *cmd,
	    unsigned long AutoOutputMask
	    )
{
	cmd->len = 5;
	cmd->code = 0x8E;
	cmd->buf[0] = 0x4D;
	bPutULong (&AutoOutputMask, &cmd->buf[1]);
}


/*
 * for DOS machines, reverse order of bytes as they come through the
 * serial port.
 */
#ifdef BYTESWAP
static short
bGetShort(
	  unsigned char *bp
	  )
{
	short outval;
	unsigned char *optr;

	optr = (unsigned char*)&outval + 1;
	*optr-- = *bp++;
	*optr = *bp;
	return outval;
}

#ifdef TRIMBLE_OUTPUT_FUNC
static unsigned short
bGetUShort(
	   unsigned char *bp
	   )
{
	unsigned short outval;
	unsigned char *optr;

	optr = (unsigned char*)&outval + 1;
	*optr-- = *bp++;
	*optr = *bp;
	return outval;
}

static long
bGetLong(
	 unsigned char *bp
	 )
{
	long outval;
	unsigned char *optr;

	optr = (unsigned char*)&outval + 3;
	*optr-- = *bp++;
	*optr-- = *bp++;
	*optr-- = *bp++;
	*optr = *bp;
	return outval;
}

static unsigned long
bGetULong(
	  unsigned char *bp
	  )
{
	unsigned long outval;
	unsigned char *optr;

	optr = (unsigned char*)&outval + 3;
	*optr-- = *bp++;
	*optr-- = *bp++;
	*optr-- = *bp++;
	*optr = *bp;
	return outval;
}
#endif /* TRIMBLE_OUTPUT_FUNC */

static float
bGetSingle(
	   unsigned char *bp
	   )
{
	float outval;
	unsigned char *optr;

	optr = (unsigned char*)&outval + 3;
	*optr-- = *bp++;
	*optr-- = *bp++;
	*optr-- = *bp++;
	*optr = *bp;
	return outval;
}

static double
bGetDouble(
	   unsigned char *bp
	   )
{
	double outval;
	unsigned char *optr;

	optr = (unsigned char*)&outval + 7;
	*optr-- = *bp++;
	*optr-- = *bp++;
	*optr-- = *bp++;
	*optr-- = *bp++;
	*optr-- = *bp++;
	*optr-- = *bp++;
	*optr-- = *bp++;
	*optr = *bp;
	return outval;
}

#else /* not BYTESWAP */

#define bGetShort(bp) 	(*(short*)(bp))
#define bGetLong(bp) 	(*(long*)(bp))
#define bGetULong(bp) 	(*(unsigned long*)(bp))
#define bGetSingle(bp) 	(*(float*)(bp))
#define bGetDouble(bp)	(*(double*)(bp))

#endif /* BYTESWAP */
/*
 * Byte-reversal is necessary for little-endian (Intel-based) machines.
 * TSIP streams are Big-endian (Motorola-based).
 */
#ifdef BYTESWAP

void
bPutFloat(
	  float *in,
	  unsigned char *out
	  )
{
	unsigned char *inptr;

	inptr = (unsigned char*)in + 3;
	*out++ = *inptr--;
	*out++ = *inptr--;
	*out++ = *inptr--;
	*out = *inptr;
}

static void
bPutULong(
	  unsigned long *in,
	  unsigned char *out
	  )
{
	unsigned char *inptr;

	inptr = (unsigned char*)in + 3;
	*out++ = *inptr--;
	*out++ = *inptr--;
	*out++ = *inptr--;
	*out = *inptr;
}

static void
bPutDouble(
	   double *in,
	   unsigned char *out
	   )
{
	unsigned char *inptr;

	inptr = (unsigned char*)in + 7;
	*out++ = *inptr--;
	*out++ = *inptr--;
	*out++ = *inptr--;
	*out++ = *inptr--;
	*out++ = *inptr--;
	*out++ = *inptr--;
	*out++ = *inptr--;
	*out = *inptr;
}

#else	/* not BYTESWAP */

void bPutShort (short a, unsigned char *cmdbuf) {*(short*) cmdbuf = a;}
void bPutULong (long a, unsigned char *cmdbuf) 	{*(long*) cmdbuf = a;}
void bPutFloat (float a, unsigned char *cmdbuf) {*(float*) cmdbuf = a;}
void bPutDouble (double a, unsigned char *cmdbuf){*(double*) cmdbuf = a;}

#endif /* BYTESWAP */

/*
 * Parse primary utc time packet
 * and fill refclock structure 
 * from results. 
 *
 * 0 = success
 * -1 = errors
 */

static int
parse0x8FAD(
	    TSIPPKT *rpt,
	    struct peer *peer
	    )
{
	register struct refclockproc *pp;	
	register struct ripencc_unit *up;

	unsigned day, month, year;	/* data derived from received timecode */
	unsigned hour, minute, second;
	unsigned char trackstat, utcflags;

   	static char logbuf[1024];	/* logging string buffer */
	int i;
	unsigned char *buf;
		
	buf = rpt->buf;
	pp = peer->procptr;

	if (rpt->len != 22) 
		return (-1);
	
	if (bGetShort(&buf[1]) != 0) {
#ifdef DEBUG_NCC
		if (debug) 
			printf("parse0x8FAD: event count != 0\n");
#endif /* DEBUG_NCC */
		return(-1);
	}

	if (bGetDouble(&buf[3]) != 0.0) {
#ifdef DEBUG_NCC
		if (debug) 
			printf("parse0x8FAD: fracsecs != 0\n");
#endif /* DEBUG_NCC */
		return(-1);
	}

	hour =		(unsigned int) buf[11];
	minute =	(unsigned int) buf[12];
	second =	(unsigned int) buf[13];
	day =		(unsigned int) buf[14];
	month =		(unsigned int) buf[15];
	year =		bGetShort(&buf[16]);
	trackstat =	buf[18];
	utcflags =	buf[19];


	sprintf(logbuf, "U1 %d.%d.%d %02d:%02d:%02d %d %02x",
		day, month, year, hour, minute, second, trackstat, utcflags);

#ifdef DEBUG_NCC
	if (debug) 
   		puts(logbuf);
#endif /* DEBUG_NCC */

	record_clock_stats(&peer->srcadr, logbuf);

	if (!utcflags & UTCF_UTC_AVAIL)
		return(-1);

	/* poll for UTC parameters once and then if UTC flag changed */
	up = (struct ripencc_unit *) pp->unitptr;
	if (utcflags != up->utcflags) {
		TSIPPKT spt;	/* local structure for send packet */
		cmd_0x2F (&spt); /* request UTC params */
		ripencc_send(peer,spt);
		up->utcflags = utcflags;
	}
	
	/*
	 * If we hit the leap second, we choose to skip this sample
	 * rather than rely on other code to be perfectly correct.
	 * No offense, just defense ;-).
	 */
	if (second == 60)
		return(-1);

	/* now check and convert the time we received */

	pp->year = year;
	if (month < 1 || month > 12 || day < 1 || day > 31) 
		return(-1);

	if (pp->year % 4) {	/* XXX: use is_leapyear() ? */
		if (day > day1tab[month - 1]) 
			return(-1);
		for (i = 0; i < month - 1; i++)
			day += day1tab[i];
	} else {
		if (day > day2tab[month - 1]) 
			return(-1);
		for (i = 0; i < month - 1; i++)
			day += day2tab[i];
	}
	pp->day = day;
	pp->hour = hour;
	pp->minute = minute;
	pp-> second = second;
	pp->nsec = 0;

	if ((utcflags&UTCF_LEAP_PNDG) && up->leapdelta != 0) 
		pp-> leap = (up->leapdelta > 0)
		    ? LEAP_ADDSECOND
		    : LEAP_DELSECOND; 
	else
		pp-> leap = LEAP_NOWARNING;  

	return (0);
}

/*
 * Parse comprehensive time packet 
 *
 *  0 = success
 * -1 = errors
 */

int
parse0x8F0B(
	    TSIPPKT *rpt,
	    struct peer *peer
	    )
{
	register struct refclockproc *pp;	

	unsigned day, month, year;	/* data derived from received timecode */
	unsigned hour, minute, second;
	unsigned utcoff;
	unsigned char mode;
	double  bias, rate;
	float biasunc, rateunc;
	double lat, lon, alt;
	short lat_deg, lon_deg;
	float lat_min, lon_min;
	unsigned char north_south, east_west;
	char sv[9];

   	static char logbuf[1024];	/* logging string buffer */
	unsigned char b;
	int i;
	unsigned char *buf;
	double tow;
		
	buf = rpt->buf;
	pp = peer->procptr;

	if (rpt->len != 74) 
		return (-1);
	
	if (bGetShort(&buf[1]) != 0)
		return(-1);;

	tow =  bGetDouble(&buf[3]);

	if (tow == -1.0) {
		return(-1);
	}
	else if ((tow >= 604800.0) || (tow < 0.0)) {
		return(-1);
	}
	else
	{
		if (tow < 604799.9) tow = tow + .00000001;
		second = (unsigned int) fmod(tow, 60.);
		minute =  (unsigned int) fmod(tow/60., 60.);
		hour = (unsigned int )fmod(tow / 3600., 24.);
	} 

	day =		(unsigned int) buf[11];
	month =		(unsigned int) buf[12];
	year =		bGetShort(&buf[13]);
	mode =		buf[15];
	utcoff =	bGetShort(&buf[16]);
	bias = 		bGetDouble(&buf[18]) / GPS_C * 1e9;	/* ns */
	rate = 		bGetDouble(&buf[26]) / GPS_C * 1e9;	/* ppb */ 
	biasunc = 	bGetSingle(&buf[34]) / GPS_C * 1e9;	/* ns */
	rateunc = 	bGetSingle(&buf[38]) / GPS_C * 1e9;	/* ppb */
	lat = 		bGetDouble(&buf[42]) * R2D;
	lon = 		bGetDouble(&buf[50]) * R2D;
	alt = 		bGetDouble(&buf[58]);

	if (lat < 0.0) {
		north_south = 'S';
		lat = -lat;
	}
	else {
		north_south = 'N';
	}
	lat_deg = (short)lat;
	lat_min = (lat - lat_deg) * 60.0;

	if (lon < 0.0) {
		east_west = 'W';
		lon = -lon;
	}
	else {
		east_west = 'E';
	}

	lon_deg = (short)lon;
	lon_min = (lon - lon_deg) * 60.0;

	for (i=0; i<8; i++) {
		sv[i] = buf[i + 66];
		if (sv[i]) {
			TSIPPKT spt; /* local structure for sendpacket */
			b = (unsigned char) (sv[i]<0 ? -sv[i] : sv[i]);
			/* request tracking status */
			cmd_0x3C  (&spt, b);
			ripencc_send(peer,spt);
		}
	}


	sprintf(logbuf, "C1 %02d%02d%04d %02d%02d%02d %d %7.0f %.1f %.0f %.1f %d %02d%09.6f %c %02d%09.6f %c %.0f  %d %d %d %d %d %d %d %d",
		day, month, year, hour, minute, second, mode, bias, biasunc,
		rate, rateunc, utcoff, lat_deg, lat_min, north_south, lon_deg,
		lon_min, east_west, alt, sv[0], sv[1], sv[2], sv[3], sv[4],
		sv[5], sv[6], sv[7]);

#ifdef DEBUG_NCC
	if (debug) 
   		puts(logbuf);
#endif /* DEBUG_NCC */

	record_clock_stats(&peer->srcadr, logbuf);

	return (0);
}

#ifdef TRIMBLE_OUTPUT_FUNC
/* 
 * Parse any packet using Trimble machinery
 */
int
parseany(
	 TSIPPKT *rpt,
	 struct peer *peer
	 )
{
   	static char logbuf[1024];	/* logging string buffer */

   	TranslateTSIPReportToText (rpt, logbuf);	/* anything else */
#ifdef DEBUG_NCC
	if (debug) 
   		puts(&logbuf[1]);
#endif /* DEBUG_NCC */
	record_clock_stats(&peer->srcadr, &logbuf[1]);
	return(0);
}
#endif /* TRIMBLE_OUTPUT_FUNC */


/*
 * Parse UTC Parameter Packet
 * 
 * See the IDE for documentation!
 *
 * 0 = success
 * -1 = errors
 */

int
parse0x4F(
	  TSIPPKT *rpt,
	  struct peer *peer
	  )
{
	register struct ripencc_unit *up;

	double a0;
	float a1, tot;
	int dt_ls, wn_t, wn_lsf, dn, dt_lsf;

   	static char logbuf[1024];	/* logging string buffer */
	unsigned char *buf;
		
	buf = rpt->buf;
	
	if (rpt->len != 26) 
		return (-1);
	a0 = bGetDouble (buf);
	a1 = bGetSingle (&buf[8]);
	dt_ls = bGetShort (&buf[12]);
	tot = bGetSingle (&buf[14]);
	wn_t = bGetShort (&buf[18]);
	wn_lsf = bGetShort (&buf[20]);
	dn = bGetShort (&buf[22]);
	dt_lsf = bGetShort (&buf[24]);

	sprintf(logbuf, "L1 %d %d %d %g %g %g %d %d %d",
		dt_lsf - dt_ls, dt_ls, dt_lsf, a0, a1, tot, wn_t, wn_lsf, dn); 

#ifdef DEBUG_NCC
	if (debug) 
   		puts(logbuf);
#endif /* DEBUG_NCC */

	record_clock_stats(&peer->srcadr, logbuf);

	up = (struct ripencc_unit *) peer->procptr->unitptr;
	up->leapdelta = dt_lsf - dt_ls;

	return (0);
}

/*
 * Parse Tracking Status packet
 *
 * 0 = success
 * -1 = errors
 */

int
parse0x5C(
	  TSIPPKT *rpt,
	  struct peer *peer
	  )
{
	unsigned char prn, channel, aqflag, ephstat;
	float snr, azinuth, elevation;

   	static char logbuf[1024];	/* logging string buffer */
	unsigned char *buf;
		
	buf = rpt->buf;
	
	if (rpt->len != 24) 
		return(-1);

	prn = buf[0];
	channel = (unsigned char)(buf[1] >> 3);
	if (channel == 0x10) 
		channel = 2;
	else 
		channel++;
	aqflag = buf[2];
	ephstat = buf[3];
	snr = bGetSingle(&buf[4]);
	elevation = bGetSingle(&buf[12]) * R2D;
	azinuth = bGetSingle(&buf[16]) * R2D;

	sprintf(logbuf, "S1 %02d %d %d %02x %4.1f %5.1f %4.1f",
		prn, channel, aqflag, ephstat, snr, azinuth, elevation);

#ifdef DEBUG_NCC
	if (debug) 
   		puts(logbuf);
#endif /* DEBUG_NCC */

	record_clock_stats(&peer->srcadr, logbuf);

	return (0);
}

/******* Code below is from Trimble Tsipchat *************/

/*
 * *************************************************************************
 *
 * Trimble Navigation, Ltd.
 * OEM Products Development Group
 * P.O. Box 3642
 * 645 North Mary Avenue
 * Sunnyvale, California 94088-3642
 *
 * Corporate Headquarter:
 *    Telephone:  (408) 481-8000
 *    Fax:        (408) 481-6005
 *
 * Technical Support Center:
 *    Telephone:  (800) 767-4822	(U.S. and Canada)
 *                (408) 481-6940    (outside U.S. and Canada)
 *    Fax:        (408) 481-6020
 *    BBS:        (408) 481-7800
 *    e-mail:     trimble_support@trimble.com
 *		ftp://ftp.trimble.com/pub/sct/embedded/bin
 *
 * *************************************************************************
 *
 * -------  BYTE-SWAPPING  -------
 * TSIP is big-endian (Motorola) protocol.  To use on little-endian (Intel)
 * systems, the bytes of all multi-byte types (shorts, floats, doubles, etc.)
 * must be reversed.  This is controlled by the MACRO BYTESWAP; if defined, it
 * assumes little-endian protocol.
 * --------------------------------
 *
 * T_PARSER.C and T_PARSER.H contains primitive functions that interpret
 * reports received from the receiver.  A second source file pair,
 * T_FORMAT.C and T_FORMAT.H, contin the matching TSIP command formatters.
 *
 * The module is in very portable, basic C language.  It can be used as is, or
 * with minimal changes if a TSIP communications application is needed separate
 * from TSIPCHAT. The construction of most argument lists avoid the use of
 * structures, but the developer is encouraged to reconstruct them using such
 * definitions to meet project requirements.  Declarations of T_PARSER.C
 * functions are included in T_PARSER.H to provide prototyping definitions.
 *
 * There are two types of functions: a serial input processing routine,
 *                            tsip_input_proc()
 * which assembles incoming bytes into a TSIPPKT structure, and the
 * report parsers, rpt_0x??().
 *
 * 1) The function tsip_input_proc() accumulates bytes from the receiver,
 * strips control bytes (DLE), and checks if the report end sequence (DLE ETX)
 * has been received.  rpt.status is defined as TSIP_PARSED_FULL (== 1)
 * if a complete packet is available.
 *
 * 2) The functions rpt_0x??() are report string interpreters patterned after
 * the document called "Trimble Standard Interface Protocol".  It should be
 * noted that if the report buffer is sent into the receiver with the wrong
 * length (byte count), the rpt_0x??() returns the Boolean equivalence for
 * TRUE.
 *
 * *************************************************************************
 *
 */


/*
 * reads bytes until serial buffer is empty or a complete report
 * has been received; end of report is signified by DLE ETX.
 */
static void
tsip_input_proc(
		TSIPPKT *rpt,
		int inbyte
		)
{
	unsigned char newbyte;

	if (inbyte < 0 || inbyte > 0xFF) return;

	newbyte = (unsigned char)(inbyte);
	switch (rpt->status)
	{
	    case TSIP_PARSED_DLE_1:
		switch (newbyte)
		{
		    case 0:
		    case ETX:
			/* illegal TSIP IDs */
			rpt->len = 0;
			rpt->status = TSIP_PARSED_EMPTY;
			break;
		    case DLE:
			/* try normal message start again */
			rpt->len = 0;
			rpt->status = TSIP_PARSED_DLE_1;
			break;
		    default:
			/* legal TSIP ID; start message */
			rpt->code = newbyte;
			rpt->len = 0;
			rpt->status = TSIP_PARSED_DATA;
			break;
		}
		break;
	    case TSIP_PARSED_DATA:
		switch (newbyte) {
		    case DLE:
			/* expect DLE or ETX next */
			rpt->status = TSIP_PARSED_DLE_2;
			break;
		    default:
			/* normal data byte  */
			rpt->buf[rpt->len] = newbyte;
			rpt->len++;
			/* no change in rpt->status */
			break;
		}
		break;
	    case TSIP_PARSED_DLE_2:
		switch (newbyte) {
		    case DLE:
			/* normal data byte */
			rpt->buf[rpt->len] = newbyte;
			rpt->len++;
			rpt->status = TSIP_PARSED_DATA;
			break;
		    case ETX:
			/* end of message; return TRUE here. */
			rpt->status = TSIP_PARSED_FULL;
			break;
		    default:
			/* error: treat as TSIP_PARSED_DLE_1; start new report packet */
			rpt->code = newbyte;
			rpt->len = 0;
			rpt->status = TSIP_PARSED_DATA;
		}
		break;
	    case TSIP_PARSED_FULL:
	    case TSIP_PARSED_EMPTY:
	    default:
		switch (newbyte) {
		    case DLE:
			/* normal message start */
			rpt->len = 0;
			rpt->status = TSIP_PARSED_DLE_1;
			break;
		    default:
			/* error: ignore newbyte */
			rpt->len = 0;
			rpt->status = TSIP_PARSED_EMPTY;
		}
		break;
	}
	if (rpt->len > MAX_RPTBUF) {
		/* error: start new report packet */
		rpt->status = TSIP_PARSED_EMPTY;
		rpt->len = 0;
	}
}

#ifdef TRIMBLE_OUTPUT_FUNC

/**/
/* Channel A configuration for dual port operation */
short
rpt_0x3D(
	 TSIPPKT *rpt,
	 unsigned char *tx_baud_index,
	 unsigned char *rx_baud_index,
	 unsigned char *char_format_index,
	 unsigned char *stop_bits,
	 unsigned char *tx_mode_index,
	 unsigned char *rx_mode_index
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 6) return TRUE;
	*tx_baud_index = buf[0];
	*rx_baud_index = buf[1];
	*char_format_index = buf[2];
	*stop_bits = (unsigned char)((buf[3] == 0x07) ? 1 : 2);
	*tx_mode_index = buf[4];
	*rx_mode_index = buf[5];
	return FALSE;
}

/**/
/* almanac data for specified satellite */
short
rpt_0x40(
	 TSIPPKT *rpt,
	 unsigned char *sv_prn,
	 short *week_num,
	 float *t_zc,
	 float *eccentricity,
	 float *t_oa,
	 float *i_0,
	 float *OMEGA_dot,
	 float *sqrt_A,
	 float *OMEGA_0,
	 float *omega,
	 float *M_0
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 39) return TRUE;
	*sv_prn = buf[0];
	*t_zc = bGetSingle (&buf[1]);
	*week_num = bGetShort (&buf[5]);
	*eccentricity = bGetSingle (&buf[7]);
	*t_oa = bGetSingle (&buf[11]);
	*i_0 = bGetSingle (&buf[15]);
	*OMEGA_dot = bGetSingle (&buf[19]);
	*sqrt_A = bGetSingle (&buf[23]);
	*OMEGA_0 = bGetSingle (&buf[27]);
	*omega = bGetSingle (&buf[31]);
	*M_0 = bGetSingle (&buf[35]);
	return FALSE;
}

/* GPS time */
short
rpt_0x41(
	 TSIPPKT *rpt,
	 float *time_of_week,
	 float *UTC_offset,
	 short *week_num
	 )
{
	unsigned char *buf;
	buf = rpt->buf;
	
	if (rpt->len != 10) return TRUE;
	*time_of_week = bGetSingle (buf);
	*week_num = bGetShort (&buf[4]);
	*UTC_offset = bGetSingle (&buf[6]);
	return FALSE;
}

/* position in ECEF, single precision */
short
rpt_0x42(
	 TSIPPKT *rpt,
	 float pos_ECEF[3],
	 float *time_of_fix
	 )
{
	unsigned char *buf;
	buf = rpt->buf;
	
	if (rpt->len != 16) return TRUE;
	pos_ECEF[0] = bGetSingle (buf);
	pos_ECEF[1]= bGetSingle (&buf[4]);
	pos_ECEF[2]= bGetSingle (&buf[8]);
	*time_of_fix = bGetSingle (&buf[12]);
	return FALSE;
}

/* velocity in ECEF, single precision */
short
rpt_0x43(
	 TSIPPKT *rpt,
	 float ECEF_vel[3],
	 float *freq_offset,
	 float *time_of_fix
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 20) return TRUE;
	ECEF_vel[0] = bGetSingle (buf);
	ECEF_vel[1] = bGetSingle (&buf[4]);
	ECEF_vel[2] = bGetSingle (&buf[8]);
	*freq_offset = bGetSingle (&buf[12]);
	*time_of_fix = bGetSingle (&buf[16]);
	return FALSE;
}

/* software versions */	
short
rpt_0x45(
	 TSIPPKT *rpt,
	 unsigned char *major_nav_version,
	 unsigned char *minor_nav_version,
	 unsigned char *nav_day,
	 unsigned char *nav_month,
	 unsigned char *nav_year,
	 unsigned char *major_dsp_version,
	 unsigned char *minor_dsp_version,
	 unsigned char *dsp_day,
	 unsigned char *dsp_month,
	 unsigned char *dsp_year
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 10) return TRUE;
	*major_nav_version = buf[0];
	*minor_nav_version = buf[1];
	*nav_day = buf[2];
	*nav_month = buf[3];
	*nav_year = buf[4];
	*major_dsp_version = buf[5];
	*minor_dsp_version = buf[6];
	*dsp_day = buf[7];
	*dsp_month = buf[8];
	*dsp_year = buf[9];
	return FALSE;
}

/* receiver health and status */
short
rpt_0x46(
	 TSIPPKT *rpt,
	 unsigned char *status1,
	 unsigned char *status2
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 2) return TRUE;
	*status1 = buf[0];
	*status2 = buf[1];
	return FALSE;
}

/* signal levels for all satellites tracked */
short
rpt_0x47(
	 TSIPPKT *rpt,
	 unsigned char *nsvs,
	 unsigned char *sv_prn,
	 float *snr
	 )
{
	short isv;
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 1 + 5*buf[0]) return TRUE;
	*nsvs = buf[0];
	for (isv = 0; isv < (*nsvs); isv++) {
		sv_prn[isv] = buf[5*isv + 1];
		snr[isv] = bGetSingle (&buf[5*isv + 2]);
	}
	return FALSE;
}

/* GPS system message */
short
rpt_0x48(
	 TSIPPKT *rpt,
	 unsigned char *message
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 22) return TRUE;
	memcpy (message, buf, 22);
	message[22] = 0;
	return FALSE;
}

/* health for all satellites from almanac health page */
short
rpt_0x49(
	 TSIPPKT *rpt,
	 unsigned char *sv_health
	 )
{
	short i;
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 32) return TRUE;
	for (i = 0; i < 32; i++) sv_health [i]= buf[i];
	return FALSE;
}

/* position in lat-lon-alt, single precision */
short
rpt_0x4A(
	 TSIPPKT *rpt,
	 float *lat,
	 float *lon,
	 float *alt,
	 float *clock_bias,
	 float *time_of_fix
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 20) return TRUE;
	*lat = bGetSingle (buf);
	*lon = bGetSingle (&buf[4]);
	*alt = bGetSingle (&buf[8]);
	*clock_bias = bGetSingle (&buf[12]);
	*time_of_fix = bGetSingle (&buf[16]);
	return FALSE;
}

/* reference altitude parameters */
short
rpt_0x4A_2(
	   TSIPPKT *rpt,
	   float *alt,
	   float *dummy,
	   unsigned char *alt_flag
	   )
{
	unsigned char *buf;

	buf = rpt->buf;

	if (rpt->len != 9) return TRUE;
	*alt = bGetSingle (buf);
	*dummy = bGetSingle (&buf[4]);
	*alt_flag = buf[8];
	return FALSE;
}

/* machine ID code, status */
short
rpt_0x4B(
	 TSIPPKT *rpt,
	 unsigned char *machine_id,
	 unsigned char *status3,
	 unsigned char *status4
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 3) return TRUE;
	*machine_id = buf[0];
	*status3 = buf[1];
	*status4 = buf[2];
	return FALSE;
}

/* operating parameters and masks */
short
rpt_0x4C(
	 TSIPPKT *rpt,
	 unsigned char *dyn_code,
	 float *el_mask,
	 float *snr_mask,
	 float *dop_mask,
	 float *dop_switch
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 17) return TRUE;
	*dyn_code = buf[0];
	*el_mask = bGetSingle (&buf[1]);
	*snr_mask = bGetSingle (&buf[5]);
	*dop_mask = bGetSingle (&buf[9]);
	*dop_switch = bGetSingle (&buf[13]);
	return FALSE;
}

/* oscillator offset */
short
rpt_0x4D(
	 TSIPPKT *rpt,
	 float *osc_offset
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 4) return TRUE;
	*osc_offset = bGetSingle (buf);
	return FALSE;
}

/* yes/no response to command to set GPS time */
short
rpt_0x4E(
	 TSIPPKT *rpt,
	 unsigned char *response
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 1) return TRUE;
	*response = buf[0];
	return FALSE;
}

/* UTC data */
short
rpt_0x4F(
	 TSIPPKT *rpt,
	 double *a0,
	 float *a1,
	 float *time_of_data,
	 short *dt_ls,
	 short *wn_t,
	 short *wn_lsf,
	 short *dn,
	 short *dt_lsf
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 26) return TRUE;
	*a0 = bGetDouble (buf);
	*a1 = bGetSingle (&buf[8]);
	*dt_ls = bGetShort (&buf[12]);
	*time_of_data = bGetSingle (&buf[14]);
	*wn_t = bGetShort (&buf[18]);
	*wn_lsf = bGetShort (&buf[20]);
	*dn = bGetShort (&buf[22]);
	*dt_lsf = bGetShort (&buf[24]);
	return FALSE;
}

/**/
/* clock offset and frequency offset in 1-SV (0-D) mode */
short
rpt_0x54(
	 TSIPPKT *rpt,
	 float *clock_bias,
	 float *freq_offset,
	 float *time_of_fix
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 12) return TRUE;
	*clock_bias = bGetSingle (buf);
	*freq_offset = bGetSingle (&buf[4]);
	*time_of_fix = bGetSingle (&buf[8]);
	return FALSE;
}

/* I/O serial options */
short
rpt_0x55(
	 TSIPPKT *rpt,
	 unsigned char *pos_code,
	 unsigned char *vel_code,
	 unsigned char *time_code,
	 unsigned char *aux_code
	 )
{
	unsigned char *buf;
	buf = rpt->buf;
	
	if (rpt->len != 4) return TRUE;
	*pos_code = buf[0];
	*vel_code = buf[1];
	*time_code = buf[2];
	*aux_code = buf[3];
	return FALSE;
}

/* velocity in east-north-up coordinates */	
short
rpt_0x56(
	 TSIPPKT *rpt,
	 float vel_ENU[3],
	 float *freq_offset,
	 float *time_of_fix
	 )
{
	unsigned char *buf;
	buf = rpt->buf;
	
	if (rpt->len != 20) return TRUE;
	/* east */
	vel_ENU[0] = bGetSingle (buf);
	/* north */
	vel_ENU[1] = bGetSingle (&buf[4]);
	/* up */
	vel_ENU[2] = bGetSingle (&buf[8]);
	*freq_offset = bGetSingle (&buf[12]);
	*time_of_fix = bGetSingle (&buf[16]);
	return FALSE;
}

/* info about last computed fix */
short
rpt_0x57(
	 TSIPPKT *rpt,
	 unsigned char *source_code,
	 unsigned char *diag_code,
	 short *week_num,
	 float *time_of_fix
	 )
{
	unsigned char *buf;
	buf = rpt->buf;
	
	if (rpt->len != 8) return TRUE;
	*source_code = buf[0];
	*diag_code = buf[1];
	*time_of_fix = bGetSingle (&buf[2]);
	*week_num = bGetShort (&buf[6]);
	return FALSE;
}

/* GPS system data or acknowledgment of GPS system data load */
short
rpt_0x58(
	 TSIPPKT *rpt,
	 unsigned char *op_code,
	 unsigned char *data_type,
	 unsigned char *sv_prn,
	 unsigned char *data_length,
	 unsigned char *data_packet
	 )
{
	unsigned char *buf, *buf4;
	short dl;
	ALM_INFO* alminfo;
	ION_INFO* ioninfo;
	UTC_INFO* utcinfo;
	NAV_INFO* navinfo;

	buf = rpt->buf;

	if (buf[0] == 2) {
		if (rpt->len < 4) return TRUE;
		if (rpt->len != 4+buf[3]) return TRUE;
	}
	else if (rpt->len != 3) {
		return TRUE;
	}
	*op_code = buf[0];
	*data_type = buf[1];
	*sv_prn = buf[2];
	if (*op_code == 2) {
		dl = buf[3];
		*data_length = (unsigned char)dl;
		buf4 = &buf[4];
		switch (*data_type) {
		    case 2:
			/* Almanac */
			if (*data_length != sizeof (ALM_INFO)) return TRUE;
			alminfo = (ALM_INFO*)data_packet;
			alminfo->t_oa_raw  = buf4[0];
			alminfo->SV_health = buf4[1];
			alminfo->e         = bGetSingle(&buf4[2]);
			alminfo->t_oa      = bGetSingle(&buf4[6]);
			alminfo->i_0       = bGetSingle(&buf4[10]);
			alminfo->OMEGADOT  = bGetSingle(&buf4[14]);
			alminfo->sqrt_A    = bGetSingle(&buf4[18]);
			alminfo->OMEGA_0   = bGetSingle(&buf4[22]);
			alminfo->omega     = bGetSingle(&buf4[26]);
			alminfo->M_0       = bGetSingle(&buf4[30]);
			alminfo->a_f0      = bGetSingle(&buf4[34]);
			alminfo->a_f1      = bGetSingle(&buf4[38]);
			alminfo->Axis      = bGetSingle(&buf4[42]);
			alminfo->n         = bGetSingle(&buf4[46]);
			alminfo->OMEGA_n   = bGetSingle(&buf4[50]);
			alminfo->ODOT_n    = bGetSingle(&buf4[54]);
			alminfo->t_zc      = bGetSingle(&buf4[58]);
			alminfo->weeknum   = bGetShort(&buf4[62]);
			alminfo->wn_oa     = bGetShort(&buf4[64]);
			break;

		    case 3:
			/* Almanac health page */
			if (*data_length != sizeof (ALH_PARMS) + 3) return TRUE;

			/* this record is returned raw */
			memcpy (data_packet, buf4, dl);
			break;

		    case 4:
			/* Ionosphere */
			if (*data_length != sizeof (ION_INFO) + 8) return TRUE;
			ioninfo = (ION_INFO*)data_packet;
			ioninfo->alpha_0   = bGetSingle (&buf4[8]);
			ioninfo->alpha_1   = bGetSingle (&buf4[12]);
			ioninfo->alpha_2   = bGetSingle (&buf4[16]);
			ioninfo->alpha_3   = bGetSingle (&buf4[20]);
			ioninfo->beta_0    = bGetSingle (&buf4[24]);
			ioninfo->beta_1    = bGetSingle (&buf4[28]);
			ioninfo->beta_2    = bGetSingle (&buf4[32]);
			ioninfo->beta_3    = bGetSingle (&buf4[36]);
			break;

		    case 5:
			/* UTC */
			if (*data_length != sizeof (UTC_INFO) + 13) return TRUE;
			utcinfo = (UTC_INFO*)data_packet;
			utcinfo->A_0       = bGetDouble (&buf4[13]);
			utcinfo->A_1       = bGetSingle (&buf4[21]);
			utcinfo->delta_t_LS = bGetShort (&buf4[25]);
			utcinfo->t_ot      = bGetSingle(&buf4[27]);
			utcinfo->WN_t      = bGetShort (&buf4[31]);
			utcinfo->WN_LSF    = bGetShort (&buf4[33]);
			utcinfo->DN        = bGetShort (&buf4[35]);
			utcinfo->delta_t_LSF = bGetShort (&buf4[37]);
			break;

		    case 6:
			/* Ephemeris */
			if (*data_length != sizeof (NAV_INFO) - 1) return TRUE;

			navinfo = (NAV_INFO*)data_packet;

			navinfo->sv_number = buf4[0];
			navinfo->t_ephem = bGetSingle (&buf4[1]);
			navinfo->ephclk.weeknum = bGetShort (&buf4[5]);

			navinfo->ephclk.codeL2 = buf4[7];
			navinfo->ephclk.L2Pdata = buf4[8];
			navinfo->ephclk.SVacc_raw = buf4[9];
			navinfo->ephclk.SV_health = buf4[10];
			navinfo->ephclk.IODC = bGetShort (&buf4[11]);
			navinfo->ephclk.T_GD = bGetSingle (&buf4[13]);
			navinfo->ephclk.t_oc = bGetSingle (&buf4[17]);
			navinfo->ephclk.a_f2 = bGetSingle (&buf4[21]);
			navinfo->ephclk.a_f1 = bGetSingle (&buf4[25]);
			navinfo->ephclk.a_f0 = bGetSingle (&buf4[29]);
			navinfo->ephclk.SVacc = bGetSingle (&buf4[33]);

			navinfo->ephorb.IODE = buf4[37];
			navinfo->ephorb.fit_interval = buf4[38];
			navinfo->ephorb.C_rs = bGetSingle (&buf4[39]);
			navinfo->ephorb.delta_n = bGetSingle (&buf4[43]);
			navinfo->ephorb.M_0 = bGetDouble (&buf4[47]);
			navinfo->ephorb.C_uc = bGetSingle (&buf4[55]);
			navinfo->ephorb.e = bGetDouble (&buf4[59]);
			navinfo->ephorb.C_us = bGetSingle (&buf4[67]);
			navinfo->ephorb.sqrt_A = bGetDouble (&buf4[71]);
			navinfo->ephorb.t_oe = bGetSingle (&buf4[79]);
			navinfo->ephorb.C_ic = bGetSingle (&buf4[83]);
			navinfo->ephorb.OMEGA_0 = bGetDouble (&buf4[87]);
			navinfo->ephorb.C_is = bGetSingle (&buf4[95]);
			navinfo->ephorb.i_0 = bGetDouble (&buf4[99]);
			navinfo->ephorb.C_rc = bGetSingle (&buf4[107]);
			navinfo->ephorb.omega = bGetDouble (&buf4[111]);
			navinfo->ephorb.OMEGADOT=bGetSingle (&buf4[119]);
			navinfo->ephorb.IDOT = bGetSingle (&buf4[123]);
			navinfo->ephorb.Axis = bGetDouble (&buf4[127]);
			navinfo->ephorb.n = bGetDouble (&buf4[135]);
			navinfo->ephorb.r1me2 = bGetDouble (&buf4[143]);
			navinfo->ephorb.OMEGA_n=bGetDouble (&buf4[151]);
			navinfo->ephorb.ODOT_n = bGetDouble (&buf4[159]);
			break;
		}
	}
	return FALSE;
}

/* satellite enable/disable or health heed/ignore list */	
short
rpt_0x59(
	 TSIPPKT *rpt,
	 unsigned char *code_type,
	 unsigned char status_code[32]
	 )
{
	short iprn;
	unsigned char *buf;
	buf = rpt->buf;
	
	if (rpt->len != 33) return TRUE;
	*code_type = buf[0];
	for (iprn = 0; iprn < 32; iprn++)
		status_code[iprn] = buf[iprn + 1];
	return FALSE;
}

/* raw measurement data - code phase/Doppler */
short
rpt_0x5A(
	 TSIPPKT *rpt,
	 unsigned char *sv_prn,
	 float *sample_length,
	 float *signal_level,
	 float *code_phase,
	 float *Doppler,
	 double *time_of_fix
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 25) return TRUE;
	*sv_prn = buf[0];
	*sample_length = bGetSingle (&buf[1]);
	*signal_level = bGetSingle (&buf[5]);
	*code_phase = bGetSingle (&buf[9]);
	*Doppler = bGetSingle (&buf[13]);
	*time_of_fix = bGetDouble (&buf[17]);
	return FALSE;
}

/* satellite ephorb status */	
short
rpt_0x5B(
	 TSIPPKT *rpt,
	 unsigned char *sv_prn,
	 unsigned char *sv_health,
	 unsigned char *sv_iode,
	 unsigned char *fit_interval_flag,
	 float *time_of_collection,
	 float *time_of_eph,
	 float *sv_accy
	 )
{
	unsigned char *buf;
	buf = rpt->buf;
	
	if (rpt->len != 16) return TRUE;
	*sv_prn = buf[0];
	*time_of_collection = bGetSingle (&buf[1]);
	*sv_health = buf[5];
	*sv_iode = buf[6];
	*time_of_eph = bGetSingle (&buf[7]);
	*fit_interval_flag = buf[11];
	*sv_accy = bGetSingle (&buf[12]);
	return FALSE;
}

/* satellite tracking status */
short
rpt_0x5C(
	 TSIPPKT *rpt,
	 unsigned char *sv_prn,
	 unsigned char *slot,
	 unsigned char *chan,
	 unsigned char *acq_flag,
	 unsigned char *eph_flag,
	 float *signal_level,
	 float *time_of_last_msmt,
	 float *elev,
	 float *azim,
	 unsigned char *old_msmt_flag,
	 unsigned char *integer_msec_flag,
	 unsigned char *bad_data_flag,
	 unsigned char *data_collect_flag
	 )
{
	unsigned char *buf;
	buf = rpt->buf;
	
	if (rpt->len != 24) return TRUE;
	*sv_prn = buf[0];
	*slot = (unsigned char)((buf[1] & 0x07) + 1);
	*chan = (unsigned char)(buf[1] >> 3);
	if (*chan == 0x10) *chan = 2;
	else (*chan)++;
	*acq_flag = buf[2];
	*eph_flag = buf[3];
	*signal_level = bGetSingle (&buf[4]);
	*time_of_last_msmt = bGetSingle (&buf[8]);
	*elev = bGetSingle (&buf[12]);
	*azim = bGetSingle (&buf[16]);
	*old_msmt_flag = buf[20];
	*integer_msec_flag = buf[21];
	*bad_data_flag = buf[22];
	*data_collect_flag = buf[23];
	return FALSE;
}

/**/
/* over-determined satellite selection for position fixes, PDOP, fix mode */
short
rpt_0x6D(
	 TSIPPKT *rpt,
	 unsigned char *manual_mode,
	 unsigned char *nsvs,
	 unsigned char *ndim,
	 unsigned char sv_prn[],
	 float *pdop,
	 float *hdop,
	 float *vdop,
	 float *tdop
	 )
{
	short islot;
	unsigned char *buf;
	buf = rpt->buf;

	*nsvs = (unsigned char)((buf[0] & 0xF0) >> 4);
	if ((*nsvs)>8) return TRUE;
	if (rpt->len != 17 + (*nsvs) ) return TRUE;

	*manual_mode = (unsigned char)(buf[0] & 0x08);
	*ndim  = (unsigned char)((buf[0] & 0x07));
	*pdop = bGetSingle (&buf[1]);
	*hdop = bGetSingle (&buf[5]);
	*vdop = bGetSingle (&buf[9]);
	*tdop = bGetSingle (&buf[13]);
	for (islot = 0; islot < (*nsvs); islot++)
		sv_prn[islot] = buf[islot + 17];
	return FALSE;
}

/**/
/* differential fix mode */
short
rpt_0x82(
	 TSIPPKT *rpt,
	 unsigned char *diff_mode
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 1) return TRUE;
	*diff_mode = buf[0];
	return FALSE;
}

/* position, ECEF double precision */
short
rpt_0x83(
	 TSIPPKT *rpt,
	 double ECEF_pos[3],
	 double *clock_bias,
	 float *time_of_fix
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 36) return TRUE;
	ECEF_pos[0] = bGetDouble (buf);
	ECEF_pos[1] = bGetDouble (&buf[8]);
	ECEF_pos[2] = bGetDouble (&buf[16]);
	*clock_bias  = bGetDouble (&buf[24]);
	*time_of_fix = bGetSingle (&buf[32]);
	return FALSE;
}

/* position, lat-lon-alt double precision */	
short
rpt_0x84(
	 TSIPPKT *rpt,
	 double *lat,
	 double *lon,
	 double *alt,
	 double *clock_bias,
	 float *time_of_fix
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 36) return TRUE;
	*lat = bGetDouble (buf);
	*lon = bGetDouble (&buf[8]);
	*alt = bGetDouble (&buf[16]);
	*clock_bias = bGetDouble (&buf[24]);
	*time_of_fix = bGetSingle (&buf[32]);
	return FALSE;
}

short
rpt_Paly0xBB(
	     TSIPPKT *rpt,
	     TSIP_RCVR_CFG *TsipxBB
	     )
{
	unsigned char *buf;
	buf = rpt->buf;

	/* Palisade is inconsistent with other TSIP, which has a length of 40 */
	/* if (rpt->len != 40) return TRUE; */
	if (rpt->len != 43) return TRUE;

	TsipxBB->bSubcode	=  buf[0];
	TsipxBB->operating_mode	=  buf[1];
	TsipxBB->dyn_code	=  buf[3];
	TsipxBB->elev_mask	=  bGetSingle (&buf[5]);
	TsipxBB->cno_mask	=  bGetSingle (&buf[9]);
	TsipxBB->dop_mask 	=  bGetSingle (&buf[13]);
	TsipxBB->dop_switch 	=  bGetSingle (&buf[17]);
	return FALSE;
}

/* Receiver serial port configuration */
short
rpt_0xBC(
	 TSIPPKT *rpt,
	 unsigned char *port_num,
	 unsigned char *in_baud,
	 unsigned char *out_baud,
	 unsigned char *data_bits,
	 unsigned char *parity,
	 unsigned char *stop_bits,
	 unsigned char *flow_control,
	 unsigned char *protocols_in,
	 unsigned char *protocols_out,
	 unsigned char *reserved
	 )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 10) return TRUE;
	*port_num = buf[0];
	*in_baud = buf[1];
	*out_baud = buf[2];
	*data_bits = buf[3];
	*parity = buf[4];
	*stop_bits = buf[5];
	*flow_control = buf[6];
	*protocols_in = buf[7];
	*protocols_out = buf[8];
	*reserved = buf[9];

	return FALSE;
}

/**** Superpackets ****/

short
rpt_0x8F0B(
	   TSIPPKT *rpt,
	   unsigned short *event,
	   double *tow,
	   unsigned char *date,
	   unsigned char *month,
	   short *year,
	   unsigned char *dim_mode,
	   short *utc_offset,
	   double *bias,
	   double *drift,
	   float *bias_unc,
	   float *dr_unc,
	   double *lat,
	   double *lon,
	   double *alt,
	   char sv_id[8]
	   )
{
	short local_index;
	unsigned char *buf;

	buf = rpt->buf;
	if (rpt->len != 74) return TRUE;
	*event = bGetShort(&buf[1]);
	*tow = bGetDouble(&buf[3]);
	*date = buf[11];
	*month = buf[12];
	*year = bGetShort(&buf[13]);
	*dim_mode = buf[15];
	*utc_offset = bGetShort(&buf[16]);
	*bias = bGetDouble(&buf[18]);
	*drift = bGetDouble(&buf[26]);
	*bias_unc = bGetSingle(&buf[34]);
	*dr_unc = bGetSingle(&buf[38]);
	*lat = bGetDouble(&buf[42]);
	*lon = bGetDouble(&buf[50]);
	*alt = bGetDouble(&buf[58]);

	for (local_index=0; local_index<8; local_index++) sv_id[local_index] = buf[local_index + 66];
	return FALSE;
}

/* datum index and coefficients  */
short
rpt_0x8F14(
	   TSIPPKT *rpt,
	   short *datum_idx,
	   double datum_coeffs[5]
	   )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 43) return TRUE;
	*datum_idx = bGetShort(&buf[1]);
	datum_coeffs[0] = bGetDouble (&buf[3]);
	datum_coeffs[1] = bGetDouble (&buf[11]);
	datum_coeffs[2] = bGetDouble (&buf[19]);
	datum_coeffs[3] = bGetDouble (&buf[27]);
	datum_coeffs[4] = bGetDouble (&buf[35]);
	return FALSE;
}


/* datum index and coefficients  */
short
rpt_0x8F15(
	   TSIPPKT *rpt,
	   short *datum_idx,
	   double datum_coeffs[5]
	   )
{
	unsigned char *buf;
	buf = rpt->buf;

	if (rpt->len != 43) return TRUE;
	*datum_idx = bGetShort(&buf[1]);
	datum_coeffs[0] = bGetDouble (&buf[3]);
	datum_coeffs[1] = bGetDouble (&buf[11]);
	datum_coeffs[2] = bGetDouble (&buf[19]);
	datum_coeffs[3] = bGetDouble (&buf[27]);
	datum_coeffs[4] = bGetDouble (&buf[35]);
	return FALSE;
}


#define MAX_LONG  (2147483648.)   /* 2**31 */

short
rpt_0x8F20(
	   TSIPPKT *rpt,
	   unsigned char *info,
	   double *lat,
	   double *lon,
	   double *alt,
	   double vel_enu[],
	   double *time_of_fix,
	   short *week_num,
	   unsigned char *nsvs,
	   unsigned char sv_prn[],
	   short sv_IODC[],
	   short *datum_index
	   )
{
	short
	    isv;
	unsigned char
	    *buf, prnx, iode;
	unsigned long
	    ulongtemp;
	long
	    longtemp;
	double
	    vel_scale;

	buf = rpt->buf;

	if (rpt->len != 56) return TRUE;

	vel_scale = (buf[24]&1)? 0.020 : 0.005;
	vel_enu[0] = bGetShort (buf+2)*vel_scale;
	vel_enu[1] = bGetShort (buf+4)*vel_scale;
	vel_enu[2] = bGetShort (buf+6)*vel_scale;

	*time_of_fix = bGetULong (buf+8)*.001;

	longtemp = bGetLong (buf+12);
	*lat = longtemp*(GPS_PI/MAX_LONG);

	ulongtemp = bGetULong (buf+16);
	*lon = ulongtemp*(GPS_PI/MAX_LONG);
	if (*lon > GPS_PI) *lon -= 2.0*GPS_PI;

	*alt = bGetLong (buf+20)*.001;
	/* 25 blank; 29 = UTC */
	(*datum_index) = (short)((short)buf[26]-1);
	*info = buf[27];
	*nsvs = buf[28];
	*week_num = bGetShort (&buf[30]);
	for (isv = 0; isv < 8; isv++) {
		prnx = buf[32+2*isv];
		sv_prn[isv] = (unsigned char)(prnx&0x3F);
		iode = buf[33+2*isv];
		sv_IODC[isv] = (short)(iode | ((prnx>>6)<<8));
	}
	return FALSE;
}

short
rpt_0x8F41(
	   TSIPPKT *rpt,
	   unsigned char *bSearchRange,
	   unsigned char *bBoardOptions,
	   unsigned long *iiSerialNumber,
	   unsigned char *bBuildYear,
	   unsigned char *bBuildMonth,
	   unsigned char *bBuildDay,
	   unsigned char *bBuildHour,
	   float *fOscOffset,
	   unsigned short *iTestCodeId
	   )
{
	if (rpt->len != 17) return FALSE;
	*bSearchRange = rpt->buf[1];
	*bBoardOptions = rpt->buf[2];
	*iiSerialNumber = bGetLong(&rpt->buf[3]);
	*bBuildYear = rpt->buf[7];
	*bBuildMonth = rpt->buf[8];
	*bBuildDay = rpt->buf[9];
	*bBuildHour =	rpt->buf[10];
	*fOscOffset = bGetSingle(&rpt->buf[11]);
	*iTestCodeId = bGetShort(&rpt->buf[15]);
/*	Tsipx8E41Data = *Tsipx8E41; */
	return TRUE;
}

short
rpt_0x8F42(
	   TSIPPKT *rpt,
	   unsigned char *bProdOptionsPre,
	   unsigned char *bProdNumberExt,
	   unsigned short *iCaseSerialNumberPre,
	   unsigned long *iiCaseSerialNumber,
	   unsigned long *iiProdNumber,
	   unsigned short *iPremiumOptions,
	   unsigned short *iMachineID,
	   unsigned short *iKey
	   )
{
	if (rpt->len != 19) return FALSE;
	*bProdOptionsPre = rpt->buf[1];
	*bProdNumberExt = rpt->buf[2];
	*iCaseSerialNumberPre = bGetShort(&rpt->buf[3]);
	*iiCaseSerialNumber = bGetLong(&rpt->buf[5]);
	*iiProdNumber = bGetLong(&rpt->buf[9]);
	*iPremiumOptions = bGetShort(&rpt->buf[13]);
	*iMachineID = bGetShort(&rpt->buf[15]);
	*iKey = bGetShort(&rpt->buf[17]);
	return TRUE;
}

short
rpt_0x8F45(
	   TSIPPKT *rpt,
	   unsigned char *bSegMask
	   )
{
	if (rpt->len != 2) return FALSE;
	*bSegMask = rpt->buf[1];
	return TRUE;
}

/* Stinger PPS definition */
short
rpt_0x8F4A_16(
	      TSIPPKT *rpt,
	      unsigned char *pps_enabled,
	      unsigned char *pps_timebase,
	      unsigned char *pos_polarity,
	      double *pps_offset,
	      float *bias_unc_threshold
	      )
{
	unsigned char
	    *buf;

	buf = rpt->buf;
	if (rpt->len != 16) return TRUE;
	*pps_enabled = buf[1];
	*pps_timebase = buf[2];
	*pos_polarity = buf[3];
	*pps_offset = bGetDouble(&buf[4]);
	*bias_unc_threshold = bGetSingle(&buf[12]);
	return FALSE;
}

short
rpt_0x8F4B(
	   TSIPPKT *rpt,
	   unsigned long *decorr_max
	   )
{
	unsigned char
	    *buf;

	buf = rpt->buf;
	if (rpt->len != 5) return TRUE;
	*decorr_max = bGetLong(&buf[1]);
	return FALSE;
}

short
rpt_0x8F4D(
	   TSIPPKT *rpt,
	   unsigned long *event_mask
	   )
{
	unsigned char
	    *buf;

	buf = rpt->buf;
	if (rpt->len != 5) return TRUE;
	*event_mask = bGetULong (&buf[1]);
	return FALSE;
}

short
rpt_0x8FA5(
	   TSIPPKT *rpt,
	   unsigned char *spktmask
	   )
{
	unsigned char
	    *buf;

	buf = rpt->buf;
	if (rpt->len != 5) return TRUE;
	spktmask[0] = buf[1];
	spktmask[1] = buf[2];
	spktmask[2] = buf[3];
	spktmask[3] = buf[4];
	return FALSE;
}

short
rpt_0x8FAD(
	   TSIPPKT *rpt,
	   unsigned short *COUNT,
	   double *FracSec,
	   unsigned char *Hour,
	   unsigned char *Minute,
	   unsigned char *Second,
	   unsigned char *Day,
	   unsigned char *Month,
	   unsigned short *Year,
	   unsigned char *Status,
	   unsigned char *Flags
	   )
{
	if (rpt->len != 22) return TRUE;

	*COUNT = bGetUShort(&rpt->buf[1]);
	*FracSec = bGetDouble(&rpt->buf[3]);
	*Hour = rpt->buf[11];
	*Minute = rpt->buf[12];
	*Second = rpt->buf[13];
	*Day = rpt->buf[14];
	*Month = rpt->buf[15];
	*Year = bGetUShort(&rpt->buf[16]);
	*Status = rpt->buf[18];
	*Flags = rpt->buf[19];
	return FALSE;
}


/*
 * *************************************************************************
 *
 * Trimble Navigation, Ltd.
 * OEM Products Development Group
 * P.O. Box 3642
 * 645 North Mary Avenue
 * Sunnyvale, California 94088-3642
 *
 * Corporate Headquarter:
 *    Telephone:  (408) 481-8000
 *    Fax:        (408) 481-6005
 *
 * Technical Support Center:
 *    Telephone:  (800) 767-4822	(U.S. and Canada)
 *                (408) 481-6940    (outside U.S. and Canada)
 *    Fax:        (408) 481-6020
 *    BBS:        (408) 481-7800
 *    e-mail:     trimble_support@trimble.com
 *		ftp://ftp.trimble.com/pub/sct/embedded/bin
 *
 * *************************************************************************
 *
 * T_REPORT.C consists of a primary function TranslateTSIPReportToText()
 * called by main().
 *
 * This function takes a character buffer that has been received as a report
 * from a TSIP device and interprets it.  The character buffer has been
 * assembled using tsip_input_proc() in T_PARSER.C.
 *
 * A large case statement directs processing to one of many mid-level
 * functions.  The mid-level functions specific to the current report
 * code passes the report buffer to the appropriate report decoder
 * rpt_0x?? () in T_PARSER.C, which converts the byte stream in rpt.buf
 * to data values approporaite for use.
 *
 * *************************************************************************
 *
 */


#define GOOD_PARSE 0
#define BADID_PARSE 1
#define BADLEN_PARSE 2
#define BADDATA_PARSE 3

#define B_TSIP	0x02
#define B_NMEA	0x04


/* pbuf is the pointer to the current location of the text output */
static char
*pbuf;

/* keep track of whether the message has been successfully parsed */
static short
parsed;


/* convert time of week into day-hour-minute-second and print */
char *
show_time(
	  float time_of_week
	  )
{
	short	days, hours, minutes;
	float seconds;
	double tow = 0;
	static char timestring [80];

	if (time_of_week == -1.0)
	{
		sprintf(timestring, "      ");
	}
	else if ((time_of_week >= 604800.0) || (time_of_week < 0.0))
	{
		sprintf(timestring, "          ");
	}
	else
	{
		if (time_of_week < 604799.9) 
			tow = time_of_week + .00000001;
		seconds = (float)fmod(tow, 60.);
		minutes =  (short) fmod(tow/60., 60.);
		hours = (short)fmod(tow / 3600., 24.);
		days = (short)(tow / 86400.0);
		sprintf(timestring, " %s %02d:%02d:%05.2f   ",
			dayname[days], hours, minutes, seconds);
	}
	return timestring;
}

/**/
/* 0x3D */
static void
rpt_chan_A_config(
		  TSIPPKT *rpt
		  )
{
	unsigned char
	    tx_baud_index, rx_baud_index,
	    char_format_index, stop_bits,
	    tx_mode_index, rx_mode_index,
	    databits, parity;
	int
	    i, nbaud;

	/* unload rptbuf */
	if (rpt_0x3D (rpt,
		      &tx_baud_index, &rx_baud_index, &char_format_index,
		      &stop_bits, &tx_mode_index, &rx_mode_index)) {
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nChannel A Configuration");

	nbaud = sizeof(old_baudnum);

	for (i = 0; i < nbaud; ++i) if (tx_baud_index == old_baudnum[i]) break;
	pbuf += sprintf(pbuf, "\n   Transmit speed: %s at %s",
			old_output_ch[tx_mode_index], st_baud_text_app[i]);

	for (i = 0; i < nbaud; ++i) if (rx_baud_index == old_baudnum[i]) break;
	pbuf += sprintf(pbuf, "\n   Receive speed: %s at %s",
			old_input_ch[rx_mode_index], st_baud_text_app[i]);

	databits = (unsigned char)((char_format_index & 0x03) + 5);

	parity = (unsigned char)(char_format_index >> 2);
	if (parity > 4) parity = 2;

	pbuf += sprintf(pbuf, "\n   Character format (bits/char, parity, stop bits): %d-%s-%d",
			databits, old_parity_text[parity], stop_bits);
}

/**/
/* 0x40 */
static void
rpt_almanac_data_page(
		      TSIPPKT *rpt
		      )
{
	unsigned char
	    sv_prn;
	short
	    week_num;
	float
	    t_zc,
	    eccentricity,
	    t_oa,
	    i_0,
	    OMEGA_dot,
	    sqrt_A,
	    OMEGA_0,
	    omega,
	    M_0;

	/* unload rptbuf */
	if (rpt_0x40 (rpt,
		      &sv_prn, &week_num, &t_zc, &eccentricity, &t_oa,
		      &i_0, &OMEGA_dot, &sqrt_A, &OMEGA_0, &omega, &M_0)) {
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nAlmanac for SV %02d", sv_prn);
	pbuf += sprintf(pbuf, "\n       Captured:%15.0f %s",
			t_zc, show_time (t_zc));
	pbuf += sprintf(pbuf, "\n           week:%15d", week_num);
	pbuf += sprintf(pbuf, "\n   Eccentricity:%15g", eccentricity);
	pbuf += sprintf(pbuf, "\n           T_oa:%15.0f %s",
			t_oa, show_time (t_oa));
	pbuf += sprintf(pbuf, "\n            i 0:%15g", i_0);
	pbuf += sprintf(pbuf, "\n      OMEGA dot:%15g", OMEGA_dot);
	pbuf += sprintf(pbuf, "\n         sqrt A:%15g", sqrt_A);
	pbuf += sprintf(pbuf, "\n        OMEGA 0:%15g", OMEGA_0);
	pbuf += sprintf(pbuf, "\n          omega:%15g", omega);
	pbuf += sprintf(pbuf, "\n            M 0:%15g", M_0);
}

/* 0x41 */
static void
rpt_GPS_time(
	     TSIPPKT *rpt
	     )
{
	float
	    time_of_week, UTC_offset;
	short
	    week_num;

	/* unload rptbuf */
	if (rpt_0x41 (rpt, &time_of_week, &UTC_offset, &week_num)) {
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nGPS time:%s GPS week: %d   UTC offset %.1f",
			show_time(time_of_week), week_num, UTC_offset);

}

/* 0x42 */
static void
rpt_single_ECEF_position(
			 TSIPPKT *rpt
			 )
{
	float
	    ECEF_pos[3], time_of_fix;

	/* unload rptbuf */
	if (rpt_0x42 (rpt, ECEF_pos, &time_of_fix)) {
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nSXYZ:  %15.0f  %15.0f  %15.0f    %s",
			ECEF_pos[0], ECEF_pos[1], ECEF_pos[2],
			show_time(time_of_fix));
}

/* 0x43 */
static void
rpt_single_ECEF_velocity(
			 TSIPPKT *rpt
			 )
{

	float
	    ECEF_vel[3], freq_offset, time_of_fix;

	/* unload rptbuf */
	if (rpt_0x43 (rpt, ECEF_vel, &freq_offset, &time_of_fix)) {
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nVelECEF: %11.3f  %11.3f  %11.3f  %12.3f%s",
			ECEF_vel[0], ECEF_vel[1], ECEF_vel[2], freq_offset,
			show_time(time_of_fix));
}

/*  0x45  */
static void
rpt_SW_version(
	       TSIPPKT *rpt
	       )
{
	unsigned char
	    major_nav_version, minor_nav_version,
	    nav_day, nav_month, nav_year,
	    major_dsp_version, minor_dsp_version,
	    dsp_day, dsp_month, dsp_year;

	/* unload rptbuf */
	if (rpt_0x45 (rpt,
		      &major_nav_version, &minor_nav_version,
		      &nav_day, &nav_month, &nav_year,
		      &major_dsp_version, &minor_dsp_version,
		      &dsp_day, &dsp_month, &dsp_year)) {
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf,
			"\nFW Versions:  Nav Proc %2d.%02d  %2d/%2d/%2d  Sig Proc %2d.%02d  %2d/%2d/%2d",
			major_nav_version, minor_nav_version, nav_day, nav_month, nav_year,
			major_dsp_version, minor_dsp_version, dsp_day, dsp_month, dsp_year);
}

/* 0x46 */
static void
rpt_rcvr_health(
		TSIPPKT *rpt
		)
{
	unsigned char
	    status1, status2;
	const char
	    *text;
	static const char const
	    *sc_text[] = {
		"Doing position fixes",
		"Don't have GPS time yet",
		"Waiting for almanac collection",
		"DOP too high          ",
		"No satellites available",
		"Only 1 satellite available",
		"Only 2 satellites available",
		"Only 3 satellites available",
		"No satellites usable   ",
		"Only 1 satellite usable",
		"Only 2 satellites usable",
		"Only 3 satellites usable",
		"Chosen satellite unusable"};


	/* unload rptbuf */
	if (rpt_0x46 (rpt, &status1, &status2))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	text = (status1 < COUNTOF(sc_text))
	    ? sc_text[status1]
	    : "(out of range)";
	pbuf += sprintf(pbuf, "\nRcvr status1: %s (%02Xh); ",
			text, status1);

	pbuf += sprintf(pbuf, "status2: %s, %s (%02Xh)",
			(status2 & 0x01)?"No BBRAM":"BBRAM OK",
			(status2 & 0x10)?"No Ant":"Ant OK",
			status2);
}

/* 0x47 */
static void
rpt_SNR_all_SVs(
		TSIPPKT *rpt
		)
{
	unsigned char
	    nsvs, sv_prn[12];
	short
	    isv;
	float
	    snr[12];

	/* unload rptbuf */
	if (rpt_0x47 (rpt, &nsvs, sv_prn, snr))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nSNR for satellites: %d", nsvs);
	for (isv = 0; isv < nsvs; isv++)
	{
		pbuf += sprintf(pbuf, "\n    SV %02d   %6.2f",
				sv_prn[isv], snr[isv]);
	}
}

/* 0x48 */
static void
rpt_GPS_system_message(
		       TSIPPKT *rpt
		       )
{
	unsigned char
	    message[23];

	/* unload rptbuf */
	if (rpt_0x48 (rpt, message))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nGPS message: %s", message);
}

/* 0x49 */
static void
rpt_almanac_health_page(
			TSIPPKT *rpt
			)
{
	short
	    iprn;
	unsigned char
	    sv_health [32];

	/* unload rptbuf */
	if (rpt_0x49 (rpt, sv_health))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nAlmanac health page:");
	for (iprn = 0; iprn < 32; iprn++)
	{
		if (!(iprn%5)) *pbuf++ = '\n';
		pbuf += sprintf(pbuf, "    SV%02d  %2X",
				(iprn+1) , sv_health[iprn]);
	}
}

/* 0x4A */
static void
rpt_single_lla_position(
			TSIPPKT *rpt
			)
{
	short
	    lat_deg, lon_deg;
	float
	    lat, lon,
	    alt, clock_bias, time_of_fix;
	double lat_min, lon_min;
	unsigned char
	    north_south, east_west;

	if (rpt_0x4A (rpt,
		      &lat, &lon, &alt, &clock_bias, &time_of_fix))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	/* convert from radians to degrees */
	lat *= (float)R2D;
	north_south = 'N';
	if (lat < 0.0)
	{
		north_south = 'S';
		lat = -lat;
	}
	lat_deg = (short)lat;
	lat_min = (lat - lat_deg) * 60.0;

	lon *= (float)R2D;
	east_west = 'E';
	if (lon < 0.0)
	{
		east_west = 'W';
		lon = -lon;
	}
	lon_deg = (short)lon;
	lon_min = (lon - lon_deg) * 60.0;

	pbuf += sprintf(pbuf, "\nSLLA: %4d: %06.3f  %c%5d:%06.3f  %c%10.2f  %12.2f%s",
			lat_deg, lat_min, north_south,
			lon_deg, lon_min, east_west,
			alt, clock_bias,
			show_time(time_of_fix));
}

/* 0x4A */
static void
rpt_ref_alt(
	    TSIPPKT *rpt
	    )
{
	float
	    alt, dummy;
	unsigned char
	    alt_flag;

	if (rpt_0x4A_2 (rpt, &alt, &dummy, &alt_flag))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nReference Alt:   %.1f m;    %s",
			alt, alt_flag?"ON":"OFF");
}

/* 0x4B */
static void
rpt_rcvr_id_and_status(
		       TSIPPKT *rpt
		       )
{

	unsigned char
	    machine_id, status3, status4;

	/* unload rptbuf */
	if (rpt_0x4B (rpt, &machine_id, &status3, &status4))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nRcvr Machine ID: %d; Status3 = %s, %s (%02Xh)",
			machine_id,
			(status3 & 0x02)?"No RTC":"RTC OK",
			(status3 & 0x08)?"No Alm":"Alm OK",
			status3);
}

/* 0x4C */
static void
rpt_operating_parameters(
			 TSIPPKT *rpt
			 )
{
	unsigned char
	    dyn_code;
	float
	    el_mask, snr_mask, dop_mask, dop_switch;

	/* unload rptbuf */
	if (rpt_0x4C (rpt, &dyn_code, &el_mask,
		      &snr_mask, &dop_mask, &dop_switch))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nOperating Parameters:");
	pbuf += sprintf(pbuf, "\n     Dynamics code = %d %s",
			dyn_code, dyn_text[dyn_code]);
	pbuf += sprintf(pbuf, "\n     Elevation mask = %.2f", el_mask * R2D);
	pbuf += sprintf(pbuf, "\n     SNR mask = %.2f", snr_mask);
	pbuf += sprintf(pbuf, "\n     DOP mask = %.2f", dop_mask);
	pbuf += sprintf(pbuf, "\n     DOP switch = %.2f", dop_switch);
}

/* 0x4D */
static void
rpt_oscillator_offset(
		      TSIPPKT *rpt
		      )
{
	float
	    osc_offset;

	/* unload rptbuf */
	if (rpt_0x4D (rpt, &osc_offset))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nOscillator offset: %.2f Hz = %.3f PPM",
			osc_offset, osc_offset/1575.42);
}

/* 0x4E */
static void
rpt_GPS_time_set_response(
			  TSIPPKT *rpt
			  )
{
	unsigned char
	    response;

	/* unload rptbuf */
	if (rpt_0x4E (rpt, &response))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	switch (response)
	{
	    case 'Y':
		pbuf += sprintf(pbuf, "\nTime set accepted");
		break;

	    case 'N':
		pbuf += sprintf(pbuf, "\nTime set rejected or not required");
		break;

	    default:
		parsed = BADDATA_PARSE;
	}
}

/* 0x4F */
static void
rpt_UTC_offset(
	       TSIPPKT *rpt
	       )
{
	double
	    a0;
	float
	    a1, time_of_data;
	short
	    dt_ls, wn_t, wn_lsf, dn, dt_lsf;

	/* unload rptbuf */
	if (rpt_0x4F (rpt, &a0, &a1, &time_of_data,
		      &dt_ls, &wn_t, &wn_lsf, &dn, &dt_lsf)) {
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nUTC Correction Data");
	pbuf += sprintf(pbuf, "\n   A_0         = %g  ", a0);
	pbuf += sprintf(pbuf, "\n   A_1         = %g  ", a1);
	pbuf += sprintf(pbuf, "\n   delta_t_LS  = %d  ", dt_ls);
	pbuf += sprintf(pbuf, "\n   t_ot        = %.0f  ", time_of_data);
	pbuf += sprintf(pbuf, "\n   WN_t        = %d  ", wn_t );
	pbuf += sprintf(pbuf, "\n   WN_LSF      = %d  ", wn_lsf );
	pbuf += sprintf(pbuf, "\n   DN          = %d  ", dn );
	pbuf += sprintf(pbuf, "\n   delta_t_LSF = %d  ", dt_lsf );
}

/**/
/* 0x54 */
static void
rpt_1SV_bias(
	     TSIPPKT *rpt
	     )
{
	float
	    clock_bias, freq_offset, time_of_fix;

	/* unload rptbuf */
	if (rpt_0x54 (rpt, &clock_bias, &freq_offset, &time_of_fix)) {
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf (pbuf, "\nTime Fix   Clock Bias: %6.2f m  Freq Bias: %6.2f m/s%s",
			 clock_bias, freq_offset, show_time (time_of_fix));
}

/* 0x55 */
static void
rpt_io_opt(
	   TSIPPKT *rpt
	   )
{
	unsigned char
	    pos_code, vel_code, time_code, aux_code;

	/* unload rptbuf */
	if (rpt_0x55 (rpt,
		      &pos_code, &vel_code, &time_code, &aux_code)) {
		parsed = BADLEN_PARSE;
		return;
	}
	/* rptbuf unloaded */

	pbuf += sprintf(pbuf, "\nI/O Options: %2X %2X %2X %2X",
			pos_code, vel_code, time_code, aux_code);

	if (pos_code & 0x01) {
		pbuf += sprintf(pbuf, "\n    ECEF XYZ position output");
	}

	if (pos_code & 0x02) {
		pbuf += sprintf(pbuf, "\n    LLA position output");
	}

	pbuf += sprintf(pbuf, (pos_code & 0x04)?
			"\n    MSL altitude output (Geoid height) ":
			"\n    WGS-84 altitude output");

	pbuf += sprintf(pbuf, (pos_code & 0x08)?
			"\n    MSL altitude input":
			"\n    WGS-84 altitude input");

	pbuf += sprintf(pbuf, (pos_code & 0x10)?
			"\n    Double precision":
			"\n    Single precision");

	if (pos_code & 0x20) {
		pbuf += sprintf(pbuf, "\n    All Enabled Superpackets");
	}

	if (vel_code & 0x01) {
		pbuf += sprintf(pbuf, "\n    ECEF XYZ velocity output");
	}

	if (vel_code & 0x02) {
		pbuf += sprintf(pbuf, "\n    ENU velocity output");
	}

	pbuf += sprintf(pbuf, (time_code & 0x01)?
			"\n    Time tags in UTC":
			"\n    Time tags in GPS time");

	if (time_code & 0x02) {
		pbuf += sprintf(pbuf, "\n    Fixes delayed to integer seconds");
	}

	if (time_code & 0x04) {
		pbuf += sprintf(pbuf, "\n    Fixes sent only on request");
	}

	if (time_code & 0x08) {
		pbuf += sprintf(pbuf, "\n    Synchronized measurements");
	}

	if (time_code & 0x10) {
		pbuf += sprintf(pbuf, "\n    Minimize measurement propagation");
	}

	pbuf += sprintf(pbuf, (time_code & 0x20) ?
			"\n    PPS output at all times" :
			"\n    PPS output during fixes");

	if (aux_code & 0x01) {
		pbuf += sprintf(pbuf, "\n    Raw measurement output");
	}

	if (aux_code & 0x02) {
		pbuf += sprintf(pbuf, "\n    Code-phase smoothed before output");
	}

	if (aux_code & 0x04) {
		pbuf += sprintf(pbuf, "\n    Additional fix status");
	}

	pbuf += sprintf(pbuf, (aux_code & 0x08)?
			"\n    Signal Strength Output as dBHz" :
			"\n    Signal Strength Output as AMU");
}

/* 0x56 */
static void
rpt_ENU_velocity(
		 TSIPPKT *rpt
		 )
{
	float
	    vel_ENU[3], freq_offset, time_of_fix;

	/* unload rptbuf */
	if (rpt_0x56 (rpt, vel_ENU, &freq_offset, &time_of_fix)) {
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nVel ENU: %11.3f  %11.3f  %11.3f  %12.3f%s",
			vel_ENU[0], vel_ENU[1], vel_ENU[2], freq_offset,
			show_time (time_of_fix));
}

/* 0x57 */
static void
rpt_last_fix_info(
		  TSIPPKT *rpt
		  )
{
	unsigned char
	    source_code, diag_code;
	short
	    week_num;
	float
	    time_of_fix;

	/* unload rptbuf */
	if (rpt_0x57 (rpt, &source_code, &diag_code, &week_num, &time_of_fix)) {
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\n source code %d;   diag code: %2Xh",
			source_code, diag_code);
	pbuf += sprintf(pbuf, "\n    Time of last fix:%s", show_time(time_of_fix));
	pbuf += sprintf(pbuf, "\n    Week of last fix: %d", week_num);
}

/* 0x58 */
static void
rpt_GPS_system_data(
		    TSIPPKT *rpt
		    )
{
	unsigned char
	    iprn,
	    op_code, data_type, sv_prn,
	    data_length, data_packet[250];
	ALM_INFO
	    *almanac;
	ALH_PARMS
	    *almh;
	UTC_INFO
	    *utc;
	ION_INFO
	    *ionosphere;
	EPHEM_CLOCK
	    *cdata;
	EPHEM_ORBIT
	    *edata;
	NAV_INFO
	    *nav_data;
	unsigned char
	    curr_t_oa;
	unsigned short
	    curr_wn_oa;
	static char
	    *datname[] =
	    {"", "", "Almanac Orbit",
	     "Health Page & Ref Time", "Ionosphere", "UTC ",
	     "Ephemeris"};

	/* unload rptbuf */
	if (rpt_0x58 (rpt, &op_code, &data_type, &sv_prn,
		      &data_length, data_packet))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nSystem data [%d]:  %s  SV%02d",
			data_type, datname[data_type], sv_prn);
	switch (op_code)
	{
	    case 1:
		pbuf += sprintf(pbuf, "  Acknowledgment");
		break;
	    case 2:
		pbuf += sprintf(pbuf, "  length = %d bytes", data_length);
		switch (data_type) {
		    case 2:
			/* Almanac */
			if (sv_prn == 0 || sv_prn > 32) {
				pbuf += sprintf(pbuf, "  Binary PRN invalid");
				return;
			}
			almanac = (ALM_INFO*)data_packet;
			pbuf += sprintf(pbuf, "\n   t_oa_raw = % -12d    SV_hlth  = % -12d  ",
					almanac->t_oa_raw , almanac->SV_health );
			pbuf += sprintf(pbuf, "\n   e        = % -12g    t_oa     = % -12g  ",
					almanac->e        , almanac->t_oa     );
			pbuf += sprintf(pbuf, "\n   i_0      = % -12g    OMEGADOT = % -12g  ",
					almanac->i_0      , almanac->OMEGADOT );
			pbuf += sprintf(pbuf, "\n   sqrt_A   = % -12g    OMEGA_0  = % -12g  ",
					almanac->sqrt_A   , almanac->OMEGA_0  );
			pbuf += sprintf(pbuf, "\n   omega    = % -12g    M_0      = % -12g  ",
					almanac->omega    , almanac->M_0      );
			pbuf += sprintf(pbuf, "\n   a_f0     = % -12g    a_f1     = % -12g  ",
					almanac->a_f0     , almanac->a_f1     );
			pbuf += sprintf(pbuf, "\n   Axis     = % -12g    n        = % -12g  ",
					almanac->Axis     , almanac->n        );
			pbuf += sprintf(pbuf, "\n   OMEGA_n  = % -12g    ODOT_n   = % -12g  ",
					almanac->OMEGA_n  , almanac->ODOT_n   );
			pbuf += sprintf(pbuf, "\n   t_zc     = % -12g    weeknum  = % -12d  ",
					almanac->t_zc     , almanac->weeknum  );
			pbuf += sprintf(pbuf, "\n   wn_oa    = % -12d", almanac->wn_oa    );
			break;

		    case 3:
			/* Almanac health page */
			almh = (ALH_PARMS*)data_packet;
			pbuf += sprintf(pbuf, "\n   t_oa = %d, wn_oa&0xFF = %d  ",
					almh->t_oa, almh->WN_a);
			pbuf += sprintf(pbuf, "\nAlmanac health page:");
			for (iprn = 0; iprn < 32; iprn++) {
				if (!(iprn%5)) *pbuf++ = '\n';
				pbuf += sprintf(pbuf, "    SV%02d  %2X",
						(iprn+1) , almh->SV_health[iprn]);
			}
			curr_t_oa = data_packet[34];
			curr_wn_oa = (unsigned short)((data_packet[35]<<8) + data_packet[36]);
			pbuf += sprintf(pbuf, "\n   current t_oa = %d, wn_oa = %d  ",
					curr_t_oa, curr_wn_oa);
			break;

		    case 4:
			/* Ionosphere */
			ionosphere = (ION_INFO*)data_packet;
			pbuf += sprintf(pbuf, "\n   alpha_0 = % -12g  alpha_1 = % -12g ",
					ionosphere->alpha_0, ionosphere->alpha_1);
			pbuf += sprintf(pbuf, "\n   alpha_2 = % -12g  alpha_3 = % -12g ",
					ionosphere->alpha_2, ionosphere->alpha_3);
			pbuf += sprintf(pbuf, "\n   beta_0  = % -12g  beta_1  = % -12g  ",
					ionosphere->beta_0, ionosphere->beta_1);
			pbuf += sprintf(pbuf, "\n   beta_2  = % -12g  beta_3  = % -12g  ",
					ionosphere->beta_2, ionosphere->beta_3);
			break;

		    case 5:
			/* UTC */
			utc = (UTC_INFO*)data_packet;
			pbuf += sprintf(pbuf, "\n   A_0         = %g  ", utc->A_0);
			pbuf += sprintf(pbuf, "\n   A_1         = %g  ", utc->A_1);
			pbuf += sprintf(pbuf, "\n   delta_t_LS  = %d  ", utc->delta_t_LS);
			pbuf += sprintf(pbuf, "\n   t_ot        = %.0f  ", utc->t_ot );
			pbuf += sprintf(pbuf, "\n   WN_t        = %d  ", utc->WN_t );
			pbuf += sprintf(pbuf, "\n   WN_LSF      = %d  ", utc->WN_LSF );
			pbuf += sprintf(pbuf, "\n   DN          = %d  ", utc->DN );
			pbuf += sprintf(pbuf, "\n   delta_t_LSF = %d  ", utc->delta_t_LSF );
			break;

		    case 6: /* Ephemeris */
			if (sv_prn == 0 || sv_prn > 32) {
				pbuf += sprintf(pbuf, "  Binary PRN invalid");
				return;
			}
			nav_data = (NAV_INFO*)data_packet;

			pbuf += sprintf(pbuf, "\n     SV_PRN = % -12d .  t_ephem = % -12g . ",
					nav_data->sv_number , nav_data->t_ephem );
			cdata = &(nav_data->ephclk);
			pbuf += sprintf(pbuf,
					"\n    weeknum = % -12d .   codeL2 = % -12d .  L2Pdata = % -12d",
					cdata->weeknum , cdata->codeL2 , cdata->L2Pdata );
			pbuf += sprintf(pbuf,
					"\n  SVacc_raw = % -12d .SV_health = % -12d .     IODC = % -12d",
					cdata->SVacc_raw, cdata->SV_health, cdata->IODC );
			pbuf += sprintf(pbuf,
					"\n       T_GD = % -12g .     t_oc = % -12g .     a_f2 = % -12g",
					cdata->T_GD, cdata->t_oc, cdata->a_f2 );
			pbuf += sprintf(pbuf,
					"\n       a_f1 = % -12g .     a_f0 = % -12g .    SVacc = % -12g",
					cdata->a_f1, cdata->a_f0, cdata->SVacc );
			edata = &(nav_data->ephorb);
			pbuf += sprintf(pbuf,
					"\n       IODE = % -12d .fit_intvl = % -12d .     C_rs = % -12g",
					edata->IODE, edata->fit_interval, edata->C_rs );
			pbuf += sprintf(pbuf,
					"\n    delta_n = % -12g .      M_0 = % -12g .     C_uc = % -12g",
					edata->delta_n, edata->M_0, edata->C_uc );
			pbuf += sprintf(pbuf,
					"\n        ecc = % -12g .     C_us = % -12g .   sqrt_A = % -12g",
					edata->e, edata->C_us, edata->sqrt_A );
			pbuf += sprintf(pbuf,
					"\n       t_oe = % -12g .     C_ic = % -12g .  OMEGA_0 = % -12g",
					edata->t_oe, edata->C_ic, edata->OMEGA_0 );
			pbuf += sprintf(pbuf,
					"\n       C_is = % -12g .      i_0 = % -12g .     C_rc = % -12g",
					edata->C_is, edata->i_0, edata->C_rc );
			pbuf += sprintf(pbuf,
					"\n      omega = % -12g . OMEGADOT = % -12g .     IDOT = % -12g",
					edata->omega, edata->OMEGADOT, edata->IDOT );
			pbuf += sprintf(pbuf,
					"\n       Axis = % -12g .        n = % -12g .    r1me2 = % -12g",
					edata->Axis, edata->n, edata->r1me2 );
			pbuf += sprintf(pbuf,
					"\n    OMEGA_n = % -12g .   ODOT_n = % -12g",
					edata->OMEGA_n, edata->ODOT_n );
			break;
		}
	}
}


/* 0x59: */
static void
rpt_SVs_enabled(
		TSIPPKT *rpt
		)
{
	unsigned char
	    numsvs,
	    code_type,
	    status_code[32];
	short
	    iprn;

	/* unload rptbuf */
	if (rpt_0x59 (rpt, &code_type, status_code))
	{
		parsed = BADLEN_PARSE;
		return;
	}
	switch (code_type)
	{
	    case 3: pbuf += sprintf(pbuf, "\nSVs Disabled:\n"); break;
	    case 6: pbuf += sprintf(pbuf, "\nSVs with Health Ignored:\n"); break;
	    default: return;
	}
	numsvs = 0;
	for (iprn = 0; iprn < 32; iprn++)
	{
		if (status_code[iprn])
		{
			pbuf += sprintf(pbuf, " %02d", iprn+1);
			numsvs++;
		}
	}
	if (numsvs == 0) pbuf += sprintf(pbuf, "None");
}


/* 0x5A */
static void
rpt_raw_msmt(
	     TSIPPKT *rpt
	     )
{
	unsigned char
	    sv_prn;
	float
	    sample_length, signal_level, code_phase, Doppler;
	double
	    time_of_fix;

	/* unload rptbuf */
	if (rpt_0x5A (rpt, &sv_prn, &sample_length, &signal_level,
		      &code_phase, &Doppler, &time_of_fix))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\n   %02d %5.0f %7.1f %10.2f %10.2f %12.3f %s",
			sv_prn, sample_length, signal_level, code_phase, Doppler, time_of_fix,
			show_time ((float)time_of_fix));
}

/* 0x5B */
static void
rpt_SV_ephemeris_status(
			TSIPPKT *rpt
			)
{
	unsigned char
	    sv_prn, sv_health, sv_iode, fit_interval_flag;
	float
	    time_of_collection, time_of_eph, sv_accy;

	/* unload rptbuf */
	if (rpt_0x5B (rpt, &sv_prn, &sv_health, &sv_iode, &fit_interval_flag,
		      &time_of_collection, &time_of_eph, &sv_accy))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\n  SV%02d  %s   %2Xh     %2Xh ",
			sv_prn, show_time (time_of_collection), sv_health, sv_iode);
	/* note: cannot use show_time twice in same call */
	pbuf += sprintf(pbuf, "%s   %1d   %4.1f",
			show_time (time_of_eph), fit_interval_flag, sv_accy);
}

/* 0x5C */
static void
rpt_SV_tracking_status(
		       TSIPPKT *rpt
		       )
{
	unsigned char
	    sv_prn, chan, slot, acq_flag, eph_flag,
	    old_msmt_flag, integer_msec_flag, bad_data_flag,
	    data_collect_flag;
	float
	    signal_level, time_of_last_msmt,
	    elev, azim;

	/* unload rptbuf */
	if (rpt_0x5C (rpt,
		      &sv_prn, &slot, &chan, &acq_flag, &eph_flag,
		      &signal_level, &time_of_last_msmt, &elev, &azim,
		      &old_msmt_flag, &integer_msec_flag, &bad_data_flag,
		      &data_collect_flag))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf,
			"\n SV%2d  %1d   %1d   %1d   %4.1f  %s  %5.1f  %5.1f",
			sv_prn, chan,
			acq_flag, eph_flag, signal_level,
			show_time(time_of_last_msmt),
			elev*R2D, azim*R2D);
}

/**/
/* 0x6D */
static void
rpt_allSV_selection(
		    TSIPPKT *rpt
		    )
{
	unsigned char
	    manual_mode, nsvs, sv_prn[8], ndim;
	short
	    islot;
	float
	    pdop, hdop, vdop, tdop;

	/* unload rptbuf */
	if (rpt_0x6D (rpt,
		      &manual_mode, &nsvs, &ndim, sv_prn,
		      &pdop, &hdop, &vdop, &tdop))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	switch (ndim)
	{
	    case 0:
		pbuf += sprintf(pbuf, "\nMode: Searching, %d-SV:", nsvs);
		break;
	    case 1:
		pbuf += sprintf(pbuf, "\nMode: One-SV Timing:");
		break;
	    case 3: case 4:
		pbuf += sprintf(pbuf, "\nMode: %c-%dD, %d-SV:",
				manual_mode ? 'M' : 'A', ndim - 1,  nsvs);
		break;
	    case 5:
		pbuf += sprintf(pbuf, "\nMode: Timing, %d-SV:", nsvs);
		break;
	    default:
		pbuf += sprintf(pbuf, "\nMode: Unknown = %d:", ndim);
		break;
	}

	for (islot = 0; islot < nsvs; islot++)
	{
		if (sv_prn[islot]) pbuf += sprintf(pbuf, " %02d", sv_prn[islot]);
	}
	if (ndim == 3 || ndim == 4)
	{
		pbuf += sprintf(pbuf, ";  DOPs: P %.1f H %.1f V %.1f T %.1f",
				pdop, hdop, vdop, tdop);
	}
}

/**/
/* 0x82 */
static void
rpt_DGPS_position_mode(
		       TSIPPKT *rpt
		       )
{
	unsigned char
	    diff_mode;

	/* unload rptbuf */
	if (rpt_0x82 (rpt, &diff_mode)) {
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nFix is%s DGPS-corrected (%s mode)  (%d)",
			(diff_mode&1) ? "" : " not",
			(diff_mode&2) ? "auto" : "manual",
			diff_mode);
}

/* 0x83 */
static void
rpt_double_ECEF_position(
			 TSIPPKT *rpt
			 )
{
	double
	    ECEF_pos[3], clock_bias;
	float
	    time_of_fix;

	/* unload rptbuf */
	if (rpt_0x83 (rpt, ECEF_pos, &clock_bias, &time_of_fix))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nDXYZ:%12.2f  %13.2f  %13.2f %12.2f%s",
			ECEF_pos[0], ECEF_pos[1], ECEF_pos[2], clock_bias,
			show_time(time_of_fix));
}

/* 0x84 */
static void
rpt_double_lla_position(
			TSIPPKT *rpt
			)
{
	short
	    lat_deg, lon_deg;
	double
	    lat, lon, lat_min, lon_min,
	    alt, clock_bias;
	float
	    time_of_fix;
	unsigned char
	    north_south, east_west;

	/* unload rptbuf */
	if (rpt_0x84 (rpt,
		      &lat, &lon, &alt, &clock_bias, &time_of_fix))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	lat *= R2D;
	lon *= R2D;
	if (lat < 0.0) {
		north_south = 'S';
		lat = -lat;
	} else {
		north_south = 'N';
	}
	lat_deg = (short)lat;
	lat_min = (lat - lat_deg) * 60.0;

	if (lon < 0.0) {
		east_west = 'W';
		lon = -lon;
	} else {
		east_west = 'E';
	}
	lon_deg = (short)lon;
	lon_min = (lon - lon_deg) * 60.0;
	pbuf += sprintf(pbuf, "\nDLLA: %2d:%08.5f %c; %3d:%08.5f %c; %10.2f %12.2f%s",
			lat_deg, lat_min, north_south,
			lon_deg, lon_min, east_west,
			alt, clock_bias,
			show_time(time_of_fix));
}

/* 0xBB */
static void
rpt_complete_rcvr_config(
			 TSIPPKT *rpt
			 )
{
	TSIP_RCVR_CFG TsipxBB ;
	/* unload rptbuf */
	if (rpt_Paly0xBB (rpt, &TsipxBB))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\n   operating mode:      %s",
			NavModeText0xBB[TsipxBB.operating_mode]);
	pbuf += sprintf(pbuf, "\n   dynamics:            %s",
			dyn_text[TsipxBB.dyn_code]);
	pbuf += sprintf(pbuf, "\n   elev angle mask:     %g deg",
			TsipxBB.elev_mask * R2D);
	pbuf += sprintf(pbuf, "\n   SNR mask:            %g AMU",
			TsipxBB.cno_mask);
	pbuf += sprintf(pbuf, "\n   DOP mask:            %g",
			TsipxBB.dop_mask);
	pbuf += sprintf(pbuf, "\n   DOP switch:          %g",
			TsipxBB.dop_switch);
	return ;
}

/* 0xBC */
static void
rpt_rcvr_serial_port_config(
			    TSIPPKT *rpt
			    )
{
	unsigned char
	    port_num, in_baud, out_baud, data_bits, parity, stop_bits, flow_control,
	    protocols_in, protocols_out, reserved;
	unsigned char known;

	/* unload rptbuf */
	if (rpt_0xBC (rpt, &port_num, &in_baud, &out_baud, &data_bits, &parity,
		      &stop_bits, &flow_control, &protocols_in, &protocols_out, &reserved)) {
		parsed = BADLEN_PARSE;
		return;
	}
	/* rptbuf unloaded */

	pbuf += sprintf(pbuf, "\n   RECEIVER serial port %s config:",
			rcvr_port_text[port_num]);

	pbuf += sprintf(pbuf, "\n             I/O Baud %s/%s, %d - %s - %d",
			st_baud_text_app[in_baud],
			st_baud_text_app[out_baud],
			data_bits+5,
			parity_text[parity],
			stop_bits=1);
	pbuf += sprintf(pbuf, "\n             Input protocols: ");
	known = FALSE;
	if (protocols_in&B_TSIP)
	{
		pbuf += sprintf(pbuf, "%s ", protocols_in_text[1]);
		known = TRUE;
	}
	if (known == FALSE) pbuf += sprintf(pbuf, "No known");

	pbuf += sprintf(pbuf, "\n             Output protocols: ");
	known = FALSE;
	if (protocols_out&B_TSIP)
	{
		pbuf += sprintf(pbuf, "%s ", protocols_out_text[1]);
		known = TRUE;
	}
	if (protocols_out&B_NMEA)
	{
		pbuf += sprintf(pbuf, "%s ", protocols_out_text[2]);
		known = TRUE;
	}
	if (known == FALSE) pbuf += sprintf(pbuf, "No known");
	reserved = reserved;

}

/* 0x8F */
/* 8F0B */
static void
rpt_8F0B(
	 TSIPPKT *rpt
	 )
{
	const char
	    *oprtng_dim[7] = {
		"horizontal (2-D)",
		"full position (3-D)",
		"single satellite (0-D)",
		"automatic",
		"N/A",
		"N/A",
		"overdetermined clock"};
	char
	    sv_id[8];
	unsigned char
	    month,
	    date,
	    dim_mode,
	    north_south,
	    east_west;
	unsigned short
	    event;
	short
	    utc_offset,
	    year,
	    local_index;
	short
	    lat_deg,
	    lon_deg;
	float
	    bias_unc,
	    dr_unc;
	double
	    tow,
	    bias,
	    drift,
	    lat,
	    lon,
	    alt,
	    lat_min,
	    lon_min;
	int
	    numfix,
	    numnotfix;

	if (rpt_0x8F0B(rpt,
		       &event,
		       &tow,
		       &date,
		       &month,
		       &year,
		       &dim_mode,
		       &utc_offset,
		       &bias,
		       &drift,
		       &bias_unc,
		       &dr_unc,
		       &lat,
		       &lon,
		       &alt,
		       sv_id))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	if (event == 0)
	{
		pbuf += sprintf(pbuf, "\nNew partial+full meas");
	}
	else
	{
		pbuf += sprintf(pbuf, "\nEvent count: %5d", event);
	}

	pbuf += sprintf(pbuf, "\nGPS time  : %s %2d/%2d/%2d (DMY)",
			show_time(tow), date, month, year);
	pbuf += sprintf(pbuf, "\nMode      : %s", oprtng_dim[dim_mode]);
	pbuf += sprintf(pbuf, "\nUTC offset: %2d", utc_offset);
	pbuf += sprintf(pbuf, "\nClock Bias: %6.2f m", bias);
	pbuf += sprintf(pbuf, "\nFreq bias : %6.2f m/s", drift);
	pbuf += sprintf(pbuf, "\nBias unc  : %6.2f m", bias_unc);
	pbuf += sprintf(pbuf, "\nFreq unc  : %6.2f m/s", dr_unc);

	lat *= R2D; /* convert from radians to degrees */
	lon *= R2D;
	if (lat < 0.0)
	{
		north_south = 'S';
		lat = -lat;
	}
	else
	{
		north_south = 'N';
	}

	lat_deg = (short)lat;
	lat_min = (lat - lat_deg) * 60.0;
	if (lon < 0.0)
	{
		east_west = 'W';
		lon = -lon;
	}
	else
	{
		east_west = 'E';
	}

	lon_deg = (short)lon;
	lon_min = (lon - lon_deg) * 60.0;
	pbuf += sprintf(pbuf, "\nPosition  :");
	pbuf += sprintf(pbuf, " %4d %6.3f %c", lat_deg, lat_min, north_south);
	pbuf += sprintf(pbuf, " %5d %6.3f %c", lon_deg, lon_min, east_west);
	pbuf += sprintf(pbuf, " %10.2f", alt);

	numfix = numnotfix = 0;
	for (local_index=0; local_index<8; local_index++)
	{
		if (sv_id[local_index] < 0) numnotfix++;
		if (sv_id[local_index] > 0) numfix++;
	}
	if (numfix > 0)
	{
		pbuf += sprintf(pbuf, "\nSVs used in fix  : ");
		for (local_index=0; local_index<8; local_index++)
		{
			if (sv_id[local_index] > 0)
			{
				pbuf += sprintf(pbuf, "%2d ", sv_id[local_index]);
			}
		}
	}
	if (numnotfix > 0)
	{
		pbuf += sprintf(pbuf, "\nOther SVs tracked: ");
		for (local_index=0; local_index<8; local_index++)
		{
			if (sv_id[local_index] < 0)
			{
				pbuf += sprintf(pbuf, "%2d ", sv_id[local_index]);
			}
		}
	}
}

/* 0x8F14 */
/* Datum parameters */
static void
rpt_8F14(
	 TSIPPKT *rpt
	 )
{
	double
	    datum_coeffs[5];
	short
	    datum_idx;

	/* unload rptbuf */
	if (rpt_0x8F14 (rpt, &datum_idx, datum_coeffs))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	if (datum_idx == -1)
	{
		pbuf += sprintf(pbuf, "\nUser-Entered Datum:");
		pbuf += sprintf(pbuf, "\n   dx        = %6.1f", datum_coeffs[0]);
		pbuf += sprintf(pbuf, "\n   dy        = %6.1f", datum_coeffs[1]);
		pbuf += sprintf(pbuf, "\n   dz        = %6.1f", datum_coeffs[2]);
		pbuf += sprintf(pbuf, "\n   a-axis    = %10.3f", datum_coeffs[3]);
		pbuf += sprintf(pbuf, "\n   e-squared = %16.14f", datum_coeffs[4]);
	}
	else if (datum_idx == 0)
	{
		pbuf += sprintf(pbuf, "\nWGS-84 datum, Index 0 ");
	}
	else
	{
		pbuf += sprintf(pbuf, "\nStandard Datum, Index %3d ", datum_idx);
	}
}

/* 0x8F15 */
/* Datum parameters */
static void
rpt_8F15(
	 TSIPPKT *rpt
	 )
{
	double
	    datum_coeffs[5];
	short
	    datum_idx;

	/* unload rptbuf */
	if (rpt_0x8F15 (rpt, &datum_idx, datum_coeffs)) {
		parsed = BADLEN_PARSE;
		return;
	}

	if (datum_idx == -1)
	{
		pbuf += sprintf(pbuf, "\nUser-Entered Datum:");
		pbuf += sprintf(pbuf, "\n   dx        = %6.1f", datum_coeffs[0]);
		pbuf += sprintf(pbuf, "\n   dy        = %6.1f", datum_coeffs[1]);
		pbuf += sprintf(pbuf, "\n   dz        = %6.1f", datum_coeffs[2]);
		pbuf += sprintf(pbuf, "\n   a-axis    = %10.3f", datum_coeffs[3]);
		pbuf += sprintf(pbuf, "\n   e-squared = %16.14f", datum_coeffs[4]);
	}
	else if (datum_idx == 0)
	{
		pbuf += sprintf(pbuf, "\nWGS-84 datum, Index 0 ");
	}
	else
	{
		pbuf += sprintf(pbuf, "\nStandard Datum, Index %3d ", datum_idx);
	}
}

/* 0x8F20 */
#define INFO_DGPS       0x02
#define INFO_2D         0x04
#define INFO_ALTSET     0x08
#define INFO_FILTERED   0x10
static void
rpt_8F20(
	 TSIPPKT *rpt
	 )
{
	unsigned char
	    info, nsvs, sv_prn[32];
	short
	    week_num, datum_index, sv_IODC[32];
	double
	    lat, lon, alt, time_of_fix;
	double
	    londeg, latdeg, vel[3];
	short
	    isv;
	char
	    datum_string[20];

	/* unload rptbuf */
	if (rpt_0x8F20 (rpt,
			&info, &lat, &lon, &alt, vel,
			&time_of_fix,
			&week_num, &nsvs, sv_prn, sv_IODC, &datum_index))
	{
		parsed = BADLEN_PARSE;
		return;
	}
	pbuf += sprintf(pbuf,
			"\nFix at: %04d:%3s:%02d:%02d:%06.3f GPS (=UTC+%2ds)  FixType: %s%s%s",
			week_num,
			dayname[(short)(time_of_fix/86400.0)],
			(short)fmod(time_of_fix/3600., 24.),
			(short)fmod(time_of_fix/60., 60.),
			fmod(time_of_fix, 60.),
			(char)rpt->buf[29],		/* UTC offset */
			(info & INFO_DGPS)?"Diff":"",
			(info & INFO_2D)?"2D":"3D",
			(info & INFO_FILTERED)?"-Filtrd":"");

	if (datum_index > 0)
	{
		sprintf(datum_string, "Datum%3d", datum_index);
	}
	else if (datum_index)
	{
		sprintf(datum_string, "Unknown ");
	}
	else
	{
		sprintf(datum_string, "WGS-84");
	}

	/* convert from radians to degrees */
	latdeg = R2D * fabs(lat);
	londeg = R2D * fabs(lon);
	pbuf += sprintf(pbuf,
			"\n   Pos: %4d:%09.6f %c %5d:%09.6f %c %10.2f m HAE (%s)",
			(short)latdeg, fmod (latdeg, 1.)*60.0,
			(lat<0.0)?'S':'N',
			(short)londeg, fmod (londeg, 1.)*60.0,
			(lon<0.0)?'W':'E',
			alt,
			datum_string);
	pbuf += sprintf(pbuf,
			"\n   Vel:    %9.3f E       %9.3f N      %9.3f U   (m/sec)",
			vel[0], vel[1], vel[2]);

	pbuf += sprintf(pbuf,
			"\n   SVs: ");
	for (isv = 0; isv < nsvs; isv++) {
		pbuf += sprintf(pbuf, " %02d", sv_prn[isv]);
	}
	pbuf += sprintf(pbuf, "     (IODEs:");
	for (isv = 0; isv < nsvs; isv++) {
		pbuf += sprintf(pbuf, " %02X", sv_IODC[isv]&0xFF);
	}
	pbuf += sprintf(pbuf, ")");
}

/* 0x8F41 */
static void
rpt_8F41(
	 TSIPPKT *rpt
	 )
{
	unsigned char
	    bSearchRange,
	    bBoardOptions,
	    bBuildYear,
	    bBuildMonth,
	    bBuildDay,
	    bBuildHour;
	float
	    fOscOffset;
	unsigned short
	    iTestCodeId;
	unsigned long
	    iiSerialNumber;

	if (!rpt_0x8F41(rpt,
			&bSearchRange,
			&bBoardOptions,
			&iiSerialNumber,
			&bBuildYear,
			&bBuildMonth,
			&bBuildDay,
			&bBuildHour,
			&fOscOffset,
			&iTestCodeId))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\n  search range:          %d",
			bSearchRange);
	pbuf += sprintf(pbuf, "\n  board options:         %d",
			bBoardOptions);
	pbuf += sprintf(pbuf, "\n  board serial #:        %ld",
			iiSerialNumber);
	pbuf += sprintf(pbuf, "\n  build date/hour:       %02d/%02d/%02d %02d:00",
			bBuildDay, bBuildMonth, bBuildYear, bBuildHour);
	pbuf += sprintf(pbuf, "\n  osc offset:            %.3f PPM (%.0f Hz)",
			fOscOffset/1575.42, fOscOffset);
	pbuf += sprintf(pbuf, "\n  test code:             %d",
			iTestCodeId);
}

/* 0x8F42 */
static void
rpt_8F42(
	 TSIPPKT *rpt
	 )
{
	unsigned char
	    bProdOptionsPre,
	    bProdNumberExt;
	unsigned short
	    iCaseSerialNumberPre,
	    iPremiumOptions,
	    iMachineID,
	    iKey;
	unsigned long
	    iiCaseSerialNumber,
	    iiProdNumber;

	if (!rpt_0x8F42(rpt,
			&bProdOptionsPre,
			&bProdNumberExt,
			&iCaseSerialNumberPre,
			&iiCaseSerialNumber,
			&iiProdNumber,
			&iPremiumOptions,
			&iMachineID,
			&iKey))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nProduct ID 8F42");
	pbuf += sprintf(pbuf, "\n   extension:            %d", bProdNumberExt);
	pbuf += sprintf(pbuf, "\n   case serial # prefix: %d", iCaseSerialNumberPre);
	pbuf += sprintf(pbuf, "\n   case serial #:        %ld", iiCaseSerialNumber);
	pbuf += sprintf(pbuf, "\n   prod. #:              %ld", iiProdNumber);
	pbuf += sprintf(pbuf, "\n   premium options:      %Xh", iPremiumOptions);
	pbuf += sprintf(pbuf, "\n   machine ID:           %d", iMachineID);
	pbuf += sprintf(pbuf, "\n   key:                  %Xh", iKey);
}

/* 0x8F45 */
static void
rpt_8F45(
	 TSIPPKT *rpt
	 )
{
	unsigned char bSegMask;

	if (!rpt_0x8F45(rpt,
			&bSegMask))
	{
		parsed = BADLEN_PARSE;
		return;
	}
	pbuf += sprintf(pbuf, "\nCleared Segment Mask: %Xh", bSegMask);
}

/* Stinger PPS def */
static void
rpt_8F4A(
	 TSIPPKT *rpt
	 )
{
	unsigned char
	    pps_enabled,
	    pps_timebase,
	    pps_polarity;
	float
	    bias_unc_threshold;
	double
	    pps_offset;

  	if (rpt_0x8F4A_16 (rpt,
			   &pps_enabled,
			   &pps_timebase,
			   &pps_polarity,
			   &pps_offset,
			   &bias_unc_threshold))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nPPS is         %s",	pps_enabled?"enabled":"disabled");
	pbuf += sprintf(pbuf, "\n   timebase:   %s", PPSTimeBaseText[pps_timebase]);
	pbuf += sprintf(pbuf, "\n   polarity:   %s", PPSPolarityText[pps_polarity]);
	pbuf += sprintf(pbuf, "\n   offset:     %.1f ns, ", pps_offset*1.e9);
	pbuf += sprintf(pbuf, "\n   biasunc:    %.1f ns", bias_unc_threshold/GPS_C*1.e9);
}

/* fast-SA decorrolation time for self-survey */
static void
rpt_8F4B(
	 TSIPPKT *rpt
	 )
{
	unsigned long
	    decorr_max;

	if (rpt_0x8F4B(rpt, &decorr_max))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf,
			"\nMax # of position fixes for self-survey : %ld",
			decorr_max);
}

static void
rpt_8F4D(
	 TSIPPKT *rpt
	 )
{
	static char
	    *linestart;
	unsigned long
	    OutputMask;
	static unsigned long
	    MaskBit[] = {
		0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010,
		0x00000020,
		0x00000100L, 0x00000800L, 0x00001000L,
		0x40000000L, 0x80000000L};
	int
	    ichoice,
	    numchoices;

	if (rpt_0x8F4D(rpt, &OutputMask))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nAuto-Report Mask: %02X %02X %02X %02X",
			(unsigned char)(OutputMask>>24),
			(unsigned char)(OutputMask>>16),
			(unsigned char)(OutputMask>>8),
			(unsigned char)OutputMask);

	numchoices = sizeof(MaskText)/sizeof(char*);
	pbuf += sprintf(pbuf, "\nAuto-Reports scheduled for Output:");
	linestart = pbuf;
	for (ichoice = 0; ichoice < numchoices; ichoice++)
	{
		if (OutputMask&MaskBit[ichoice])
		{
			pbuf += sprintf(pbuf, "%s %s",
					(pbuf==linestart)?"\n     ":",",
					MaskText[ichoice]);
			if (pbuf-linestart > 60) linestart = pbuf;
		}
	}

	pbuf += sprintf(pbuf, "\nAuto-Reports NOT scheduled for Output:");
	linestart = pbuf;
	for (ichoice = 0; ichoice < numchoices; ichoice++)
	{
		if (OutputMask&MaskBit[ichoice]) continue;
	     	pbuf += sprintf(pbuf, "%s %s",
				(pbuf==linestart)?"\n     ":",",
				MaskText[ichoice]);
		if (pbuf-linestart > 60) linestart = pbuf;
	}
}

static void
rpt_8FA5(
	 TSIPPKT *rpt
	 )
{
	unsigned char
	    spktmask[4];

	if (rpt_0x8FA5(rpt, spktmask))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf, "\nSuperpacket auto-output mask: %02X %02X %02X %02X",
			spktmask[0], spktmask[1], spktmask[2], spktmask[3]);

	if (spktmask[0]&0x01) pbuf+= sprintf (pbuf, "\n    PPS   8F-0B");
	if (spktmask[0]&0x02) pbuf+= sprintf (pbuf, "\n    Event 8F-0B");
	if (spktmask[0]&0x10) pbuf+= sprintf (pbuf, "\n    PPS   8F-AD");
	if (spktmask[0]&0x20) pbuf+= sprintf (pbuf, "\n    Event 8F-AD");
	if (spktmask[2]&0x01) pbuf+= sprintf (pbuf, "\n    ppos Fix 8F-20");
}

static void
rpt_8FAD(
	 TSIPPKT *rpt
	 )
{
	unsigned short
	    Count,
	    Year;
	double
	    FracSec;
	unsigned char
	    Hour,
	    Minute,
	    Second,
	    Day,
	    Month,
	    Status,
	    Flags;
	static char* Status8FADText[] = {
		"CODE_DOING_FIXES",
		"CODE_GOOD_1_SV",
		"CODE_APPX_1SV",
		"CODE_NEED_TIME",
		"CODE_NEED_INITIALIZATION",
		"CODE_PDOP_HIGH",
		"CODE_BAD_1SV",
		"CODE_0SVS",
		"CODE_1SV",
		"CODE_2SVS",
		"CODE_3SVS",
		"CODE_NO_INTEGRITY",
		"CODE_DCORR_GEN",
		"CODE_OVERDET_CLK",
		"Invalid Status"},
	    *LeapStatusText[] = {
		    " UTC Avail", " ", " ", " ",
		    " Scheduled", " Pending", " Warning", " In Progress"};
	int i;

	if (rpt_0x8FAD (rpt,
			&Count,
			&FracSec,
			&Hour,
			&Minute,
			&Second,
			&Day,
			&Month,
			&Year,
			&Status,
			&Flags))
	{
		parsed = BADLEN_PARSE;
		return;
	}

	pbuf += sprintf(pbuf,    "\n8FAD   Count: %d   Status: %s",
			Count, Status8FADText[Status]);

	pbuf += sprintf(pbuf, "\n   Leap Flags:");
	if (Flags)
	{
		for (i=0; i<8; i++)
		{
			if (Flags&(1<code, rpt->len);
	}
	if (parsed == BADID_PARSE)
	{
		pbuf += sprintf(pbuf,
				"\nTSIP report packet ID %2Xh, length %d: translation not supported",
				rpt->code, rpt->len);
	}

	if (parsed == BADDATA_PARSE)
	{
		pbuf += sprintf(pbuf,
				"\nTSIP report packet ID %2Xh, length %d: data content incorrect",
				rpt->code, rpt->len);
	}

	for (i = 0; i < rpt->len; i++) {
		if ((i % 20) == 0) *pbuf++ = '\n';
		pbuf += sprintf(pbuf, " %02X", rpt->buf[i]);
	}
}
/**/

/*
** main subroutine, called from ProcessInputBytesWhileWaitingForKBHit()
*/
void
TranslateTSIPReportToText(
			  TSIPPKT *rpt,
			  char *TextOutputBuffer
			  )
{

	/* pbuf is the pointer to the current location of the text output */
	pbuf = TextOutputBuffer;

	/* keep track of whether the message has been successfully parsed */
	parsed = GOOD_PARSE;

	/* print a header if this is the first of a series of messages */
	pbuf += print_msg_table_header (rpt->code, pbuf, FALSE);

	/* process incoming TSIP report according to code */
	switch (rpt->code)
	{
	    case 0x3D: rpt_chan_A_config (rpt); break;
	    case 0x40: rpt_almanac_data_page (rpt); break;
	    case 0x41: rpt_GPS_time (rpt); break;
	    case 0x42: rpt_single_ECEF_position (rpt); break;
	    case 0x43: rpt_single_ECEF_velocity (rpt); break;
	    case 0x45: rpt_SW_version (rpt); break;
	    case 0x46: rpt_rcvr_health (rpt); break;
	    case 0x47: rpt_SNR_all_SVs (rpt); break;
	    case 0x48: rpt_GPS_system_message (rpt); break;
	    case 0x49: rpt_almanac_health_page (rpt); break;
	    case 0x4A: switch (rpt->len) {
			/*
			** special case (=slip-up) in the TSIP protocol;
			** parsing method depends on length
			*/
		    case 20: rpt_single_lla_position (rpt); break;
		    case  9: rpt_ref_alt (rpt); break;
		} break;
	    case 0x4B: rpt_rcvr_id_and_status (rpt);break;
	    case 0x4C: rpt_operating_parameters (rpt); break;
	    case 0x4D: rpt_oscillator_offset (rpt); break;
	    case 0x4E: rpt_GPS_time_set_response (rpt); break;
	    case 0x4F: rpt_UTC_offset (rpt); break;
	    case 0x54: rpt_1SV_bias (rpt); break;
	    case 0x55: rpt_io_opt (rpt); break;
	    case 0x56: rpt_ENU_velocity (rpt); break;
	    case 0x57: rpt_last_fix_info (rpt); break;
	    case 0x58: rpt_GPS_system_data (rpt); break;
	    case 0x59: rpt_SVs_enabled (rpt); break;
	    case 0x5A: rpt_raw_msmt (rpt); break;
	    case 0x5B: rpt_SV_ephemeris_status (rpt); break;
	    case 0x5C: rpt_SV_tracking_status (rpt); break;
	    case 0x6D: rpt_allSV_selection (rpt); break;
	    case 0x82: rpt_DGPS_position_mode (rpt); break;
	    case 0x83: rpt_double_ECEF_position (rpt); break;
	    case 0x84: rpt_double_lla_position (rpt); break;
	    case 0xBB: rpt_complete_rcvr_config (rpt); break;
	    case 0xBC: rpt_rcvr_serial_port_config (rpt); break;

	    case 0x8F: switch (rpt->buf[0])
		{
			/* superpackets; parsed according to subcodes */
		    case 0x0B: rpt_8F0B(rpt); break;
		    case 0x14: rpt_8F14(rpt); break;
		    case 0x15: rpt_8F15(rpt); break;
		    case 0x20: rpt_8F20(rpt); break;
		    case 0x41: rpt_8F41(rpt); break;
		    case 0x42: rpt_8F42(rpt); break;
		    case 0x45: rpt_8F45(rpt); break;
		    case 0x4A: rpt_8F4A(rpt); break;
		    case 0x4B: rpt_8F4B(rpt); break;
		    case 0x4D: rpt_8F4D(rpt); break;
		    case 0xA5: rpt_8FA5(rpt); break;
		    case 0xAD: rpt_8FAD(rpt); break;
		    default: parsed = BADID_PARSE; break;
		}
		break;

	    default: parsed = BADID_PARSE; break;
	}

	if (parsed != GOOD_PARSE)
	{
		/*
		**The message has TSIP structure (DLEs, etc.)
		** but could not be parsed by above routines
		*/
		unknown_rpt (rpt);
	}

	/* close TextOutputBuffer */
	pbuf = '\0';
}

#endif /* TRIMBLE_OUTPUT_FUNC */

#else  /* defined(REFCLOCK) && defined(CLOCK_RIPENCC) */
int refclock_ripencc_bs;
#endif /* defined(REFCLOCK) && defined(CLOCK_RIPENCC) */

ntp-4.2.6p5/ntpd/refclock_chu.c0000644000175000017500000013322511336477344015373 0ustar  peterpeter/*
 * refclock_chu - clock driver for Canadian CHU time/frequency station
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_CHU)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_calendar.h"
#include "ntp_stdlib.h"

#include 
#include 
#include 

#ifdef HAVE_AUDIO
#include "audio.h"
#endif /* HAVE_AUDIO */

#define ICOM 	1		/* undefine to suppress ICOM code */

#ifdef ICOM
#include "icom.h"
#endif /* ICOM */
/*
 * Audio CHU demodulator/decoder
 *
 * This driver synchronizes the computer time using data encoded in
 * radio transmissions from Canadian time/frequency station CHU in
 * Ottawa, Ontario. Transmissions are made continuously on 3330 kHz,
 * 7850 kHz and 14670 kHz in upper sideband, compatible AM mode. An
 * ordinary shortwave receiver can be tuned manually to one of these
 * frequencies or, in the case of ICOM receivers, the receiver can be
 * tuned automatically as propagation conditions change throughout the
 * day and season.
 *
 * The driver requires an audio codec or sound card with sampling rate 8
 * kHz and mu-law companding. This is the same standard as used by the
 * telephone industry and is supported by most hardware and operating
 * systems, including Solaris, SunOS, FreeBSD, NetBSD and Linux. In this
 * implementation, only one audio driver and codec can be supported on a
 * single machine.
 *
 * The driver can be compiled to use a Bell 103 compatible modem or
 * modem chip to receive the radio signal and demodulate the data.
 * Alternatively, the driver can be compiled to use the audio codec of
 * the workstation or another with compatible audio drivers. In the
 * latter case, the driver implements the modem using DSP routines, so
 * the radio can be connected directly to either the microphone on line
 * input port. In either case, the driver decodes the data using a
 * maximum-likelihood technique which exploits the considerable degree
 * of redundancy available to maximize accuracy and minimize errors.
 *
 * The CHU time broadcast includes an audio signal compatible with the
 * Bell 103 modem standard (mark = 2225 Hz, space = 2025 Hz). The signal
 * consists of nine, ten-character bursts transmitted at 300 bps between
 * seconds 31 and 39 of each minute. Each character consists of eight
 * data bits plus one start bit and two stop bits to encode two hex
 * digits. The burst data consist of five characters (ten hex digits)
 * followed by a repeat of these characters. In format A, the characters
 * are repeated in the same polarity; in format B, the characters are
 * repeated in the opposite polarity.
 *
 * Format A bursts are sent at seconds 32 through 39 of the minute in
 * hex digits (nibble swapped)
 *
 *	6dddhhmmss6dddhhmmss
 *
 * The first ten digits encode a frame marker (6) followed by the day
 * (ddd), hour (hh in UTC), minute (mm) and the second (ss). Since
 * format A bursts are sent during the third decade of seconds the tens
 * digit of ss is always 3. The driver uses this to determine correct
 * burst synchronization. These digits are then repeated with the same
 * polarity.
 *
 * Format B bursts are sent at second 31 of the minute in hex digits
 *
 *	xdyyyyttaaxdyyyyttaa
 *
 * The first ten digits encode a code (x described below) followed by
 * the DUT1 (d in deciseconds), Gregorian year (yyyy), difference TAI -
 * UTC (tt) and daylight time indicator (aa) peculiar to Canada. These
 * digits are then repeated with inverted polarity.
 *
 * The x is coded
 *
 * 1 Sign of DUT (0 = +)
 * 2 Leap second warning. One second will be added.
 * 4 Leap second warning. One second will be subtracted.
 * 8 Even parity bit for this nibble.
 *
 * By design, the last stop bit of the last character in the burst
 * coincides with 0.5 second. Since characters have 11 bits and are
 * transmitted at 300 bps, the last stop bit of the first character
 * coincides with 0.5 - 9 * 11/300 = 0.170 second. Depending on the
 * UART, character interrupts can vary somewhere between the end of bit
 * 9 and end of bit 11. These eccentricities can be corrected along with
 * the radio propagation delay using fudge time 1.
 *
 * Debugging aids
 *
 * The timecode format used for debugging and data recording includes
 * data helpful in diagnosing problems with the radio signal and serial
 * connections. With debugging enabled (-d on the ntpd command line),
 * the driver produces one line for each burst in two formats
 * corresponding to format A and B.Each line begins with the format code
 * chuA or chuB followed by the status code and signal level (0-9999).
 * The remainder of the line is as follows.
 *
 * Following is format A:
 *
 *	n b f s m code
 *
 * where n is the number of characters in the burst (0-10), b the burst
 * distance (0-40), f the field alignment (-1, 0, 1), s the
 * synchronization distance (0-16), m the burst number (2-9) and code
 * the burst characters as received. Note that the hex digits in each
 * character are reversed, so the burst
 *
 *	10 38 0 16 9 06851292930685129293
 *
 * is interpreted as containing 10 characters with burst distance 38,
 * field alignment 0, synchronization distance 16 and burst number 9.
 * The nibble-swapped timecode shows day 58, hour 21, minute 29 and
 * second 39.
 *
 * Following is format B:
 * 
 *	n b s code
 *
 * where n is the number of characters in the burst (0-10), b the burst
 * distance (0-40), s the synchronization distance (0-40) and code the
 * burst characters as received. Note that the hex digits in each
 * character are reversed and the last ten digits inverted, so the burst
 *
 *	10 40 1091891300ef6e76ec
 *
 * is interpreted as containing 10 characters with burst distance 40.
 * The nibble-swapped timecode shows DUT1 +0.1 second, year 1998 and TAI
 * - UTC 31 seconds.
 *
 * Each line is preceeded by the code chuA or chuB, as appropriate. If
 * the audio driver is compiled, the current gain (0-255) and relative
 * signal level (0-9999) follow the code. The receiver volume control
 * should be set so that the gain is somewhere near the middle of the
 * range 0-255, which results in a signal level near 1000.
 *
 * In addition to the above, the reference timecode is updated and
 * written to the clockstats file and debug score after the last burst
 * received in the minute. The format is
 *
 *	sq yyyy ddd hh:mm:ss l s dd t agc ident m b      
 *
 * s	'?' before first synchronized and ' ' after that
 * q	status code (see below)
 * yyyy	year
 * ddd	day of year
 * hh:mm:ss time of day
 * l	leap second indicator (space, L or D)
 * dst	Canadian daylight code (opaque)
 * t	number of minutes since last synchronized
 * agc	audio gain (0 - 255)
 * ident identifier (CHU0 3330 kHz, CHU1 7850 kHz, CHU2 14670 kHz)
 * m	signal metric (0 - 100)
 * b	number of timecodes for the previous minute (0 - 59)
 *
 * Fudge factors
 *
 * For accuracies better than the low millisceconds, fudge time1 can be
 * set to the radio propagation delay from CHU to the receiver. This can
 * be done conviently using the minimuf program.
 *
 * Fudge flag4 causes the dubugging output described above to be
 * recorded in the clockstats file. When the audio driver is compiled,
 * fudge flag2 selects the audio input port, where 0 is the mike port
 * (default) and 1 is the line-in port. It does not seem useful to
 * select the compact disc player port. Fudge flag3 enables audio
 * monitoring of the input signal. For this purpose, the monitor gain is
 * set to a default value.
 *
 * The audio codec code is normally compiled in the driver if the
 * architecture supports it (HAVE_AUDIO defined), but is used only if
 * the link /dev/chu_audio is defined and valid. The serial port code is
 * always compiled in the driver, but is used only if the autdio codec
 * is not available and the link /dev/chu%d is defined and valid.
 *
 * The ICOM code is normally compiled in the driver if selected (ICOM
 * defined), but is used only if the link /dev/icom%d is defined and
 * valid and the mode keyword on the server configuration command
 * specifies a nonzero mode (ICOM ID select code). The C-IV speed is
 * 9600 bps if the high order 0x80 bit of the mode is zero and 1200 bps
 * if one. The C-IV trace is turned on if the debug level is greater
 * than one.
 *
 * Alarm codes
 *
 * CEVNT_BADTIME	invalid date or time
 * CEVNT_PROP		propagation failure - no stations heard
 */
/*
 * Interface definitions
 */
#define	SPEED232	B300	/* uart speed (300 baud) */
#define	PRECISION	(-10)	/* precision assumed (about 1 ms) */
#define	REFID		"CHU"	/* reference ID */
#define	DEVICE		"/dev/chu%d" /* device name and unit */
#define	SPEED232	B300	/* UART speed (300 baud) */
#ifdef ICOM
#define TUNE		.001	/* offset for narrow filter (MHz) */
#define DWELL		5	/* minutes in a dwell */
#define NCHAN		3	/* number of channels */
#define ISTAGE		3	/* number of integrator stages */
#endif /* ICOM */

#ifdef HAVE_AUDIO
/*
 * Audio demodulator definitions
 */
#define SECOND		8000	/* nominal sample rate (Hz) */
#define BAUD		300	/* modulation rate (bps) */
#define OFFSET		128	/* companded sample offset */
#define SIZE		256	/* decompanding table size */
#define	MAXAMP		6000.	/* maximum signal level */
#define	MAXCLP		100	/* max clips above reference per s */
#define	SPAN		800.	/* min envelope span */
#define LIMIT		1000.	/* soft limiter threshold */
#define AGAIN		6.	/* baseband gain */
#define LAG		10	/* discriminator lag */
#define	DEVICE_AUDIO	"/dev/audio" /* device name */
#define	DESCRIPTION	"CHU Audio/Modem Receiver" /* WRU */
#define	AUDIO_BUFSIZ	240	/* audio buffer size (30 ms) */
#else
#define	DESCRIPTION	"CHU Modem Receiver" /* WRU */
#endif /* HAVE_AUDIO */

/*
 * Decoder definitions
 */
#define CHAR		(11. / 300.) /* character time (s) */
#define BURST		11	/* max characters per burst */
#define MINCHAR		9	/* min characters per burst */
#define MINDIST		28	/* min burst distance (of 40)  */
#define MINSYNC		8	/* min sync distance (of 16) */
#define MINSTAMP	20	/* min timestamps (of 60) */
#define MINMETRIC	50	/* min channel metric (of 160) */

/*
 * The on-time synchronization point for the driver is the last stop bit
 * of the first character 170 ms. The modem delay is 0.8 ms, while the
 * receiver delay is approxmately 4.7 ms at 2125 Hz. The fudge value 1.3
 * ms due to the codec and other causes was determined by calibrating to
 * a PPS signal from a GPS receiver. The additional propagation delay
 * specific to each receiver location can be programmed in the fudge
 * time1. 
 *
 * The resulting offsets with a 2.4-GHz P4 running FreeBSD 6.1 are
 * generally within 0.5 ms short term with 0.3 ms jitter. The long-term
 * offsets vary up to 0.3 ms due to ionospheric layer height variations.
 * The processor load due to the driver is 0.4 percent.
 */
#define	PDELAY	((170 + .8 + 4.7 + 1.3) / 1000)	/* system delay (s) */

/*
 * Status bits (status)
 */
#define RUNT		0x0001	/* runt burst */
#define NOISE		0x0002	/* noise burst */
#define BFRAME		0x0004	/* invalid format B frame sync */
#define BFORMAT		0x0008	/* invalid format B data */
#define AFRAME		0x0010	/* invalid format A frame sync */
#define AFORMAT		0x0020	/* invalid format A data */
#define DECODE		0x0040	/* invalid data decode */
#define STAMP		0x0080	/* too few timestamps */
#define AVALID		0x0100	/* valid A frame */
#define BVALID		0x0200	/* valid B frame */
#define INSYNC		0x0400	/* clock synchronized */
#define	METRIC		0x0800	/* one or more stations heard */

/*
 * Alarm status bits (alarm)
 *
 * These alarms are set at the end of a minute in which at least one
 * burst was received. SYNERR is raised if the AFRAME or BFRAME status
 * bits are set during the minute, FMTERR is raised if the AFORMAT or
 * BFORMAT status bits are set, DECERR is raised if the DECODE status
 * bit is set and TSPERR is raised if the STAMP status bit is set.
 */
#define SYNERR		0x01	/* frame sync error */
#define FMTERR		0x02	/* data format error */
#define DECERR		0x04	/* data decoding error */
#define TSPERR		0x08	/* insufficient data */

#ifdef HAVE_AUDIO
/*
 * Maximum-likelihood UART structure. There are eight of these
 * corresponding to the number of phases.
 */ 
struct surv {
	l_fp	cstamp;		/* last bit timestamp */
	double	shift[12];	/* sample shift register */
	double	span;		/* shift register envelope span */
	double	dist;		/* sample distance */
	int	uart;		/* decoded character */
};
#endif /* HAVE_AUDIO */

#ifdef ICOM
/*
 * CHU station structure. There are three of these corresponding to the
 * three frequencies.
 */
struct xmtr {
	double	integ[ISTAGE];	/* circular integrator */
	double	metric;		/* integrator sum */
	int	iptr;		/* integrator pointer */
	int	probe;		/* dwells since last probe */
};
#endif /* ICOM */

/*
 * CHU unit control structure
 */
struct chuunit {
	u_char	decode[20][16];	/* maximum-likelihood decoding matrix */
	l_fp	cstamp[BURST];	/* character timestamps */
	l_fp	tstamp[MAXSTAGE]; /* timestamp samples */
	l_fp	timestamp;	/* current buffer timestamp */
	l_fp	laststamp;	/* last buffer timestamp */
	l_fp	charstamp;	/* character time as a l_fp */
	int	second;		/* counts the seconds of the minute */
	int	errflg;		/* error flags */
	int	status;		/* status bits */
	char	ident[5];	/* station ID and channel */
#ifdef ICOM
	int	fd_icom;	/* ICOM file descriptor */
	int	chan;		/* radio channel */
	int	dwell;		/* dwell cycle */
	struct xmtr xmtr[NCHAN]; /* station metric */
#endif /* ICOM */

	/*
	 * Character burst variables
	 */
	int	cbuf[BURST];	/* character buffer */
	int	ntstamp;	/* number of timestamp samples */
	int	ndx;		/* buffer start index */
	int	prevsec;	/* previous burst second */
	int	burdist;	/* burst distance */
	int	syndist;	/* sync distance */
	int	burstcnt;	/* format A bursts this minute */
	double	maxsignal;	/* signal level (modem only) */
	int	gain;		/* codec gain (modem only) */

	/*
	 * Format particulars
	 */
	int	leap;		/* leap/dut code */
	int	dut;		/* UTC1 correction */
	int	tai;		/* TAI - UTC correction */
	int	dst;		/* Canadian DST code */

#ifdef HAVE_AUDIO
	/*
	 * Audio codec variables
	 */
	int	fd_audio;	/* audio port file descriptor */
	double	comp[SIZE];	/* decompanding table */
	int	port;		/* codec port */
	int	mongain;	/* codec monitor gain */
	int	clipcnt;	/* sample clip count */
	int	seccnt;		/* second interval counter */

	/*
	 * Modem variables
	 */
	l_fp	tick;		/* audio sample increment */
	double	bpf[9];		/* IIR bandpass filter */
	double	disc[LAG];	/* discriminator shift register */
	double	lpf[27];	/* FIR lowpass filter */
	double	monitor;	/* audio monitor */
	int	discptr;	/* discriminator pointer */

	/*
	 * Maximum-likelihood UART variables
	 */
	double	baud;		/* baud interval */
	struct surv surv[8];	/* UART survivor structures */
	int	decptr;		/* decode pointer */
	int	decpha;		/* decode phase */
	int	dbrk;		/* holdoff counter */
#endif /* HAVE_AUDIO */
};

/*
 * Function prototypes
 */
static	int	chu_start	(int, struct peer *);
static	void	chu_shutdown	(int, struct peer *);
static	void	chu_receive	(struct recvbuf *);
static	void	chu_second	(int, struct peer *);
static	void	chu_poll	(int, struct peer *);

/*
 * More function prototypes
 */
static	void	chu_decode	(struct peer *, int, l_fp);
static	void	chu_burst	(struct peer *);
static	void	chu_clear	(struct peer *);
static	void	chu_a		(struct peer *, int);
static	void	chu_b		(struct peer *, int);
static	int	chu_dist	(int, int);
static	double	chu_major	(struct peer *);
#ifdef HAVE_AUDIO
static	void	chu_uart	(struct surv *, double);
static	void	chu_rf		(struct peer *, double);
static	void	chu_gain	(struct peer *);
static	void	chu_audio_receive (struct recvbuf *rbufp);
#endif /* HAVE_AUDIO */
#ifdef ICOM
static	int	chu_newchan	(struct peer *, double);
#endif /* ICOM */
static	void	chu_serial_receive (struct recvbuf *rbufp);

/*
 * Global variables
 */
static char hexchar[] = "0123456789abcdef_*=";

#ifdef ICOM
/*
 * Note the tuned frequencies are 1 kHz higher than the carrier. CHU
 * transmits on USB with carrier so we can use AM and the narrow SSB
 * filter.
 */
static double qsy[NCHAN] = {3.330, 7.850, 14.670}; /* freq (MHz) */
#endif /* ICOM */

/*
 * Transfer vector
 */
struct	refclock refclock_chu = {
	chu_start,		/* start up driver */
	chu_shutdown,		/* shut down driver */
	chu_poll,		/* transmit poll message */
	noentry,		/* not used (old chu_control) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old chu_buginfo) */
	chu_second		/* housekeeping timer */
};


/*
 * chu_start - open the devices and initialize data for processing
 */
static int
chu_start(
	int	unit,		/* instance number (not used) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct chuunit *up;
	struct refclockproc *pp;
	char device[20];	/* device name */
	int	fd;		/* file descriptor */
#ifdef ICOM
	int	temp;
#endif /* ICOM */
#ifdef HAVE_AUDIO
	int	fd_audio;	/* audio port file descriptor */
	int	i;		/* index */
	double	step;		/* codec adjustment */

	/*
	 * Open audio device. Don't complain if not there.
	 */
	fd_audio = audio_init(DEVICE_AUDIO, AUDIO_BUFSIZ, unit);
#ifdef DEBUG
	if (fd_audio > 0 && debug)
		audio_show();
#endif

	/*
	 * If audio is unavailable, Open serial port in raw mode.
	 */
	if (fd_audio > 0) {
		fd = fd_audio;
	} else {
		snprintf(device, sizeof(device), DEVICE, unit);
		fd = refclock_open(device, SPEED232, LDISC_RAW);
	}
#else /* HAVE_AUDIO */

	/*
	 * Open serial port in raw mode.
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
	fd = refclock_open(device, SPEED232, LDISC_RAW);
#endif /* HAVE_AUDIO */
	if (fd <= 0)
		return (0);

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp = peer->procptr;
	pp->unitptr = (caddr_t)up;
	pp->io.clock_recv = chu_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		pp->io.fd = -1;
		free(up);
		pp->unitptr = NULL;
		return (0);
	}

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	strcpy(up->ident, "CHU");
	memcpy(&pp->refid, up->ident, 4); 
	DTOLFP(CHAR, &up->charstamp);
#ifdef HAVE_AUDIO

	/*
	 * The companded samples are encoded sign-magnitude. The table
	 * contains all the 256 values in the interest of speed. We do
	 * this even if the audio codec is not available. C'est la lazy.
	 */
	up->fd_audio = fd_audio;
	up->gain = 127;
	up->comp[0] = up->comp[OFFSET] = 0.;
	up->comp[1] = 1; up->comp[OFFSET + 1] = -1.;
	up->comp[2] = 3; up->comp[OFFSET + 2] = -3.;
	step = 2.;
	for (i = 3; i < OFFSET; i++) {
		up->comp[i] = up->comp[i - 1] + step;
		up->comp[OFFSET + i] = -up->comp[i];
                if (i % 16 == 0)
                	step *= 2.;
	}
	DTOLFP(1. / SECOND, &up->tick);
#endif /* HAVE_AUDIO */
#ifdef ICOM
	temp = 0;
#ifdef DEBUG
	if (debug > 1)
		temp = P_TRACE;
#endif
	if (peer->ttl > 0) {
		if (peer->ttl & 0x80)
			up->fd_icom = icom_init("/dev/icom", B1200,
			    temp);
		else
			up->fd_icom = icom_init("/dev/icom", B9600,
			    temp);
	}
	if (up->fd_icom > 0) {
		if (chu_newchan(peer, 0) != 0) {
			msyslog(LOG_NOTICE, "icom: radio not found");
			close(up->fd_icom);
			up->fd_icom = 0;
		} else {
			msyslog(LOG_NOTICE, "icom: autotune enabled");
		}
	}
#endif /* ICOM */
	return (1);
}


/*
 * chu_shutdown - shut down the clock
 */
static void
chu_shutdown(
	int	unit,		/* instance number (not used) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct chuunit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;
	if (up == NULL)
		return;

	io_closeclock(&pp->io);
#ifdef ICOM
	if (up->fd_icom > 0)
		close(up->fd_icom);
#endif /* ICOM */
	free(up);
}


/*
 * chu_receive - receive data from the audio or serial device
 */
static void
chu_receive(
	struct recvbuf *rbufp	/* receive buffer structure pointer */
	)
{
#ifdef HAVE_AUDIO
	struct chuunit *up;
	struct refclockproc *pp;
	struct peer *peer;

	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	/*
	 * If the audio codec is warmed up, the buffer contains codec
	 * samples which need to be demodulated and decoded into CHU
	 * characters using the software UART. Otherwise, the buffer
	 * contains CHU characters from the serial port, so the software
	 * UART is bypassed. In this case the CPU will probably run a
	 * few degrees cooler.
	 */
	if (up->fd_audio > 0)
		chu_audio_receive(rbufp);
	else
		chu_serial_receive(rbufp);
#else
	chu_serial_receive(rbufp);
#endif /* HAVE_AUDIO */
}


#ifdef HAVE_AUDIO
/*
 * chu_audio_receive - receive data from the audio device
 */
static void
chu_audio_receive(
	struct recvbuf *rbufp	/* receive buffer structure pointer */
	)
{
	struct chuunit *up;
	struct refclockproc *pp;
	struct peer *peer;

	double	sample;		/* codec sample */
	u_char	*dpt;		/* buffer pointer */
	int	bufcnt;		/* buffer counter */
	l_fp	ltemp;		/* l_fp temp */

	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	/*
	 * Main loop - read until there ain't no more. Note codec
	 * samples are bit-inverted.
	 */
	DTOLFP((double)rbufp->recv_length / SECOND, <emp);
	L_SUB(&rbufp->recv_time, <emp);
	up->timestamp = rbufp->recv_time;
	dpt = rbufp->recv_buffer;
	for (bufcnt = 0; bufcnt < rbufp->recv_length; bufcnt++) {
		sample = up->comp[~*dpt++ & 0xff];

		/*
		 * Clip noise spikes greater than MAXAMP. If no clips,
		 * increase the gain a tad; if the clips are too high, 
		 * decrease a tad.
		 */
		if (sample > MAXAMP) {
			sample = MAXAMP;
			up->clipcnt++;
		} else if (sample < -MAXAMP) {
			sample = -MAXAMP;
			up->clipcnt++;
		}
		chu_rf(peer, sample);
		L_ADD(&up->timestamp, &up->tick);

		/*
		 * Once each second ride gain.
		 */
		up->seccnt = (up->seccnt + 1) % SECOND;
		if (up->seccnt == 0) {
			chu_gain(peer);
		}
	}

	/*
	 * Set the input port and monitor gain for the next buffer.
	 */
	if (pp->sloppyclockflag & CLK_FLAG2)
		up->port = 2;
	else
		up->port = 1;
	if (pp->sloppyclockflag & CLK_FLAG3)
		up->mongain = MONGAIN;
	else
		up->mongain = 0;
}


/*
 * chu_rf - filter and demodulate the FSK signal
 *
 * This routine implements a 300-baud Bell 103 modem with mark 2225 Hz
 * and space 2025 Hz. It uses a bandpass filter followed by a soft
 * limiter, FM discriminator and lowpass filter. A maximum-likelihood
 * decoder samples the baseband signal at eight times the baud rate and
 * detects the start bit of each character.
 *
 * The filters are built for speed, which explains the rather clumsy
 * code. Hopefully, the compiler will efficiently implement the move-
 * and-muiltiply-and-add operations.
 */
static void
chu_rf(
	struct peer *peer,	/* peer structure pointer */
	double	sample		/* analog sample */
	)
{
	struct refclockproc *pp;
	struct chuunit *up;
	struct surv *sp;

	/*
	 * Local variables
	 */
	double	signal;		/* bandpass signal */
	double	limit;		/* limiter signal */
	double	disc;		/* discriminator signal */
	double	lpf;		/* lowpass signal */
	double	dist;		/* UART signal distance */
	int	i, j;

	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	/*
	 * Bandpass filter. 4th-order elliptic, 500-Hz bandpass centered
	 * at 2125 Hz. Passband ripple 0.3 dB, stopband ripple 50 dB,
	 * phase delay 0.24 ms.
	 */
	signal = (up->bpf[8] = up->bpf[7]) * 5.844676e-01;
	signal += (up->bpf[7] = up->bpf[6]) * 4.884860e-01;
	signal += (up->bpf[6] = up->bpf[5]) * 2.704384e+00;
	signal += (up->bpf[5] = up->bpf[4]) * 1.645032e+00;
	signal += (up->bpf[4] = up->bpf[3]) * 4.644557e+00;
	signal += (up->bpf[3] = up->bpf[2]) * 1.879165e+00;
	signal += (up->bpf[2] = up->bpf[1]) * 3.522634e+00;
	signal += (up->bpf[1] = up->bpf[0]) * 7.315738e-01;
	up->bpf[0] = sample - signal;
	signal = up->bpf[0] * 6.176213e-03
	    + up->bpf[1] * 3.156599e-03
	    + up->bpf[2] * 7.567487e-03
	    + up->bpf[3] * 4.344580e-03
	    + up->bpf[4] * 1.190128e-02
	    + up->bpf[5] * 4.344580e-03
	    + up->bpf[6] * 7.567487e-03
	    + up->bpf[7] * 3.156599e-03
	    + up->bpf[8] * 6.176213e-03;

	up->monitor = signal / 4.;	/* note monitor after filter */

	/*
	 * Soft limiter/discriminator. The 11-sample discriminator lag
	 * interval corresponds to three cycles of 2125 Hz, which
	 * requires the sample frequency to be 2125 * 11 / 3 = 7791.7
	 * Hz. The discriminator output varies +-0.5 interval for input
	 * frequency 2025-2225 Hz. However, we don't get to sample at
	 * this frequency, so the discriminator output is biased. Life
	 * at 8000 Hz sucks.
	 */
	limit = signal;
	if (limit > LIMIT)
		limit = LIMIT;
	else if (limit < -LIMIT)
		limit = -LIMIT;
	disc = up->disc[up->discptr] * -limit;
	up->disc[up->discptr] = limit;
	up->discptr = (up->discptr + 1 ) % LAG;
	if (disc >= 0)
		disc = SQRT(disc);
	else
		disc = -SQRT(-disc);

	/*
	 * Lowpass filter. Raised cosine FIR, Ts = 1 / 300, beta = 0.1.
	 */
	lpf = (up->lpf[26] = up->lpf[25]) * 2.538771e-02;
	lpf += (up->lpf[25] = up->lpf[24]) * 1.084671e-01;
	lpf += (up->lpf[24] = up->lpf[23]) * 2.003159e-01;
	lpf += (up->lpf[23] = up->lpf[22]) * 2.985303e-01;
	lpf += (up->lpf[22] = up->lpf[21]) * 4.003697e-01;
	lpf += (up->lpf[21] = up->lpf[20]) * 5.028552e-01;
	lpf += (up->lpf[20] = up->lpf[19]) * 6.028795e-01;
	lpf += (up->lpf[19] = up->lpf[18]) * 6.973249e-01;
	lpf += (up->lpf[18] = up->lpf[17]) * 7.831828e-01;
	lpf += (up->lpf[17] = up->lpf[16]) * 8.576717e-01;
	lpf += (up->lpf[16] = up->lpf[15]) * 9.183463e-01;
	lpf += (up->lpf[15] = up->lpf[14]) * 9.631951e-01;
	lpf += (up->lpf[14] = up->lpf[13]) * 9.907208e-01;
	lpf += (up->lpf[13] = up->lpf[12]) * 1.000000e+00;
	lpf += (up->lpf[12] = up->lpf[11]) * 9.907208e-01;
	lpf += (up->lpf[11] = up->lpf[10]) * 9.631951e-01;
	lpf += (up->lpf[10] = up->lpf[9]) * 9.183463e-01;
	lpf += (up->lpf[9] = up->lpf[8]) * 8.576717e-01;
	lpf += (up->lpf[8] = up->lpf[7]) * 7.831828e-01;
	lpf += (up->lpf[7] = up->lpf[6]) * 6.973249e-01;
	lpf += (up->lpf[6] = up->lpf[5]) * 6.028795e-01;
	lpf += (up->lpf[5] = up->lpf[4]) * 5.028552e-01;
	lpf += (up->lpf[4] = up->lpf[3]) * 4.003697e-01;
	lpf += (up->lpf[3] = up->lpf[2]) * 2.985303e-01;
	lpf += (up->lpf[2] = up->lpf[1]) * 2.003159e-01;
	lpf += (up->lpf[1] = up->lpf[0]) * 1.084671e-01;
	lpf += up->lpf[0] = disc * 2.538771e-02;

	/*
	 * Maximum-likelihood decoder. The UART updates each of the
	 * eight survivors and determines the span, slice level and
	 * tentative decoded character. Valid 11-bit characters are
	 * framed so that bit 10 and bit 11 (stop bits) are mark and bit
	 * 1 (start bit) is space. When a valid character is found, the
	 * survivor with maximum distance determines the final decoded
	 * character.
	 */
	up->baud += 1. / SECOND;
	if (up->baud > 1. / (BAUD * 8.)) {
		up->baud -= 1. / (BAUD * 8.);
		up->decptr = (up->decptr + 1) % 8;
		sp = &up->surv[up->decptr];
		sp->cstamp = up->timestamp;
		chu_uart(sp, -lpf * AGAIN);
		if (up->dbrk > 0) {
			up->dbrk--;
			if (up->dbrk > 0)
				return;

			up->decpha = up->decptr;
		}
		if (up->decptr != up->decpha)
			return;

		dist = 0;
		j = -1;
		for (i = 0; i < 8; i++) {

			/*
			 * The timestamp is taken at the last bit, so
			 * for correct decoding we reqire sufficient
			 * span and correct start bit and two stop bits.
			 */
			if ((up->surv[i].uart & 0x601) != 0x600 ||
			    up->surv[i].span < SPAN)
				continue;

			if (up->surv[i].dist > dist) {
				dist = up->surv[i].dist;
				j = i;
			}
		}
		if (j < 0)
			return;

		/*
		 * Process the character, then blank the decoder until
		 * the end of the next character.This sets the decoding
		 * phase of the entire burst from the phase of the first
		 * character.
		 */
		up->maxsignal = up->surv[j].span;
		chu_decode(peer, (up->surv[j].uart >> 1) & 0xff,
		    up->surv[j].cstamp);
		up->dbrk = 88;
	}
}


/*
 * chu_uart - maximum-likelihood UART
 *
 * This routine updates a shift register holding the last 11 envelope
 * samples. It then computes the slice level and span over these samples
 * and determines the tentative data bits and distance. The calling
 * program selects over the last eight survivors the one with maximum
 * distance to determine the decoded character.
 */
static void
chu_uart(
	struct surv *sp,	/* survivor structure pointer */
	double	sample		/* baseband signal */
	)
{
	double	es_max, es_min;	/* max/min envelope */
	double	slice;		/* slice level */
	double	dist;		/* distance */
	double	dtemp;
	int	i;

	/*
	 * Save the sample and shift right. At the same time, measure
	 * the maximum and minimum over all eleven samples.
	 */
	es_max = -1e6;
	es_min = 1e6;
	sp->shift[0] = sample;
	for (i = 11; i > 0; i--) {
		sp->shift[i] = sp->shift[i - 1];
		if (sp->shift[i] > es_max)
			es_max = sp->shift[i];
		if (sp->shift[i] < es_min)
			es_min = sp->shift[i];
	}

	/*
	 * Determine the span as the maximum less the minimum and the
	 * slice level as the minimum plus a fraction of the span. Note
	 * the slight bias toward mark to correct for the modem tendency
	 * to make more mark than space errors. Compute the distance on
	 * the assumption the last two bits must be mark, the first
	 * space and the rest either mark or space. 
	 */ 
	sp->span = es_max - es_min;
	slice = es_min + .45 * sp->span;
	dist = 0;
	sp->uart = 0;
	for (i = 1; i < 12; i++) {
		sp->uart <<= 1;
		dtemp = sp->shift[i];
		if (dtemp > slice)
			sp->uart |= 0x1;
		if (i == 1 || i == 2) {
			dist += dtemp - es_min;
		} else if (i == 11) {
			dist += es_max - dtemp;
		} else {
			if (dtemp > slice)
				dist += dtemp - es_min;
			else
				dist += es_max - dtemp;
		}
	}
	sp->dist = dist / (11 * sp->span);
}
#endif /* HAVE_AUDIO */


/*
 * chu_serial_receive - receive data from the serial device
 */
static void
chu_serial_receive(
	struct recvbuf *rbufp	/* receive buffer structure pointer */
	)
{
	struct chuunit *up;
	struct refclockproc *pp;
	struct peer *peer;

	u_char	*dpt;		/* receive buffer pointer */

	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	dpt = (u_char *)&rbufp->recv_space;
	chu_decode(peer, *dpt, rbufp->recv_time);
}


/*
 * chu_decode - decode the character data
 */
static void
chu_decode(
	struct peer *peer,	/* peer structure pointer */
	int	hexhex,		/* data character */
	l_fp	cstamp		/* data character timestamp */
	)
{
	struct refclockproc *pp;
	struct chuunit *up;

	l_fp	tstmp;		/* timestamp temp */
	double	dtemp;

	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	/*
	 * If the interval since the last character is greater than the
	 * longest burst, process the last burst and start a new one. If
	 * the interval is less than this but greater than two
	 * characters, consider this a noise burst and reject it.
	 */
	tstmp = up->timestamp;
	if (L_ISZERO(&up->laststamp))
		up->laststamp = up->timestamp;
	L_SUB(&tstmp, &up->laststamp);
	up->laststamp = up->timestamp;
	LFPTOD(&tstmp, dtemp);
	if (dtemp > BURST * CHAR) {
		chu_burst(peer);
		up->ndx = 0;
	} else if (dtemp > 2.5 * CHAR) {
		up->ndx = 0;
	}

	/*
	 * Append the character to the current burst and append the
	 * character timestamp to the timestamp list.
	 */
	if (up->ndx < BURST) {
		up->cbuf[up->ndx] = hexhex & 0xff;
		up->cstamp[up->ndx] = cstamp;
		up->ndx++;

	}
}


/*
 * chu_burst - search for valid burst format
 */
static void
chu_burst(
	struct peer *peer
	)
{
	struct chuunit *up;
	struct refclockproc *pp;

	int	i;

	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	/*
	 * Correlate a block of five characters with the next block of
	 * five characters. The burst distance is defined as the number
	 * of bits that match in the two blocks for format A and that
	 * match the inverse for format B.
	 */
	if (up->ndx < MINCHAR) {
		up->status |= RUNT;
		return;
	}
	up->burdist = 0;
	for (i = 0; i < 5 && i < up->ndx - 5; i++)
		up->burdist += chu_dist(up->cbuf[i], up->cbuf[i + 5]);

	/*
	 * If the burst distance is at least MINDIST, this must be a
	 * format A burst; if the value is not greater than -MINDIST, it
	 * must be a format B burst. If the B burst is perfect, we
	 * believe it; otherwise, it is a noise burst and of no use to
	 * anybody.
	 */
	if (up->burdist >= MINDIST) {
		chu_a(peer, up->ndx);
	} else if (up->burdist <= -MINDIST) {
		chu_b(peer, up->ndx);
	} else {
		up->status |= NOISE;
		return;
	}

	/*
	 * If this is a valid burst, wait a guard time of ten seconds to
	 * allow for more bursts, then arm the poll update routine to
	 * process the minute. Don't do this if this is called from the
	 * timer interrupt routine.
	 */
	if (peer->outdate != current_time)
		peer->nextdate = current_time + 10;
}


/*
 * chu_b - decode format B burst
 */
static void
chu_b(
	struct peer *peer,
	int	nchar
	)
{
	struct	refclockproc *pp;
	struct	chuunit *up;

	u_char	code[11];	/* decoded timecode */
	char	tbuf[80];	/* trace buffer */
	char *	p;
	size_t	chars;
	size_t	cb;
	int	i;

	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	/*
	 * In a format B burst, a character is considered valid only if
	 * the first occurence matches the last occurence. The burst is
	 * considered valid only if all characters are valid; that is,
	 * only if the distance is 40. Note that once a valid frame has
	 * been found errors are ignored.
	 */
	snprintf(tbuf, sizeof(tbuf), "chuB %04x %4.0f %2d %2d ",
		 up->status, up->maxsignal, nchar, -up->burdist);
	cb = sizeof(tbuf);
	p = tbuf;
	for (i = 0; i < nchar; i++) {
		chars = strlen(p);
		if (cb < chars + 1) {
			msyslog(LOG_ERR, "chu_b() fatal out buffer");
			exit(1);
		}
		cb -= chars;
		p += chars;
		snprintf(p, cb, "%02x", up->cbuf[i]);
	}
	if (pp->sloppyclockflag & CLK_FLAG4)
		record_clock_stats(&peer->srcadr, tbuf);
#ifdef DEBUG
	if (debug)
		printf("%s\n", tbuf);
#endif
	if (up->burdist > -40) {
		up->status |= BFRAME;
		return;
	}

	/*
	 * Convert the burst data to internal format. Don't bother with
	 * the timestamps.
	 */
	for (i = 0; i < 5; i++) {
		code[2 * i] = hexchar[up->cbuf[i] & 0xf];
		code[2 * i + 1] = hexchar[(up->cbuf[i] >>
		    4) & 0xf];
	}
	if (sscanf((char *)code, "%1x%1d%4d%2d%2x", &up->leap, &up->dut,
	    &pp->year, &up->tai, &up->dst) != 5) {
		up->status |= BFORMAT;
		return;
	}
	up->status |= BVALID;
	if (up->leap & 0x8)
		up->dut = -up->dut;
}


/*
 * chu_a - decode format A burst
 */
static void
chu_a(
	struct peer *peer,
	int nchar
	)
{
	struct refclockproc *pp;
	struct chuunit *up;

	char	tbuf[80];	/* trace buffer */
	char *	p;
	size_t	chars;
	size_t	cb;
	l_fp	offset;		/* timestamp offset */
	int	val;		/* distance */
	int	temp;
	int	i, j, k;

	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	/*
	 * Determine correct burst phase. There are three cases
	 * corresponding to in-phase, one character early or one
	 * character late. These cases are distinguished by the position
	 * of the framing digits 0x6 at positions 0 and 5 and 0x3 at
	 * positions 4 and 9. The correct phase is when the distance
	 * relative to the framing digits is maximum. The burst is valid
	 * only if the maximum distance is at least MINSYNC.
	 */
	up->syndist = k = 0;
	val = -16;
	for (i = -1; i < 2; i++) {
		temp = up->cbuf[i + 4] & 0xf;
		if (i >= 0)
			temp |= (up->cbuf[i] & 0xf) << 4;
		val = chu_dist(temp, 0x63);
		temp = (up->cbuf[i + 5] & 0xf) << 4;
		if (i + 9 < nchar)
			temp |= up->cbuf[i + 9] & 0xf;
		val += chu_dist(temp, 0x63);
		if (val > up->syndist) {
			up->syndist = val;
			k = i;
		}
	}

	/*
	 * Extract the second number; it must be in the range 2 through
	 * 9 and the two repititions must be the same.
	 */
	temp = (up->cbuf[k + 4] >> 4) & 0xf;
	if (temp < 2 || temp > 9 || k + 9 >= nchar || temp !=
	    ((up->cbuf[k + 9] >> 4) & 0xf))
		temp = 0;
	snprintf(tbuf, sizeof(tbuf),
		 "chuA %04x %4.0f %2d %2d %2d %2d %1d ", up->status,
		 up->maxsignal, nchar, up->burdist, k, up->syndist,
		 temp);
	cb = sizeof(tbuf);
	p = tbuf;
	for (i = 0; i < nchar; i++) {
		chars = strlen(p);
		if (cb < chars + 1) {
			msyslog(LOG_ERR, "chu_a() fatal out buffer");
			exit(1);
		}
		cb -= chars;
		p += chars;
		snprintf(p, cb, "%02x", up->cbuf[i]);
	}
	if (pp->sloppyclockflag & CLK_FLAG4)
		record_clock_stats(&peer->srcadr, tbuf);
#ifdef DEBUG
	if (debug)
		printf("%s\n", tbuf);
#endif
	if (up->syndist < MINSYNC) {
		up->status |= AFRAME;
		return;
	}

	/*
	 * A valid burst requires the first seconds number to match the
	 * last seconds number. If so, the burst timestamps are
	 * corrected to the current minute and saved for later
	 * processing. In addition, the seconds decode is advanced from
	 * the previous burst to the current one.
	 */
	if (temp == 0) {
		up->status |= AFORMAT;
	} else {
		up->status |= AVALID;
		up->second = pp->second = 30 + temp;
		offset.l_ui = 30 + temp;
		offset.l_f = 0;
		i = 0;
		if (k < 0)
			offset = up->charstamp;
		else if (k > 0)
			i = 1;
		for (; i < nchar && i < k + 10; i++) {
			up->tstamp[up->ntstamp] = up->cstamp[i];
			L_SUB(&up->tstamp[up->ntstamp], &offset);
			L_ADD(&offset, &up->charstamp);
			if (up->ntstamp < MAXSTAGE - 1)
				up->ntstamp++;
		}
		while (temp > up->prevsec) {
			for (j = 15; j > 0; j--) {
				up->decode[9][j] = up->decode[9][j - 1];
				up->decode[19][j] =
				    up->decode[19][j - 1];
			}
			up->decode[9][j] = up->decode[19][j] = 0;
			up->prevsec++;
		}
	}

	/*
	 * Stash the data in the decoding matrix.
	 */
	i = -(2 * k);
	for (j = 0; j < nchar; j++) {
		if (i < 0 || i > 18) {
			i += 2;
			continue;
		}
		up->decode[i][up->cbuf[j] & 0xf]++;
		i++;
		up->decode[i][(up->cbuf[j] >> 4) & 0xf]++;
		i++;
	}
	up->burstcnt++;
}


/*
 * chu_poll - called by the transmit procedure
 */
static void
chu_poll(
	int unit,
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;

	pp = peer->procptr;
	pp->polls++;
}


/*
 * chu_second - process minute data
 */
static void
chu_second(
	int unit,
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct chuunit *up;
	l_fp	offset;
	char	synchar, qual, leapchar;
	int	minset, i;
	double	dtemp;

	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	/*
	 * This routine is called once per minute to process the
	 * accumulated burst data. We do a bit of fancy footwork so that
	 * this doesn't run while burst data are being accumulated.
	 */
	up->second = (up->second + 1) % 60;
	if (up->second != 0)
		return;

	/*
	 * Process the last burst, if still in the burst buffer.
	 * If the minute contains a valid B frame with sufficient A
	 * frame metric, it is considered valid. However, the timecode
	 * is sent to clockstats even if invalid.
	 */
	chu_burst(peer);
	minset = ((current_time - peer->update) + 30) / 60;
	dtemp = chu_major(peer);
	qual = 0;
	if (up->status & (BFRAME | AFRAME))
		qual |= SYNERR;
	if (up->status & (BFORMAT | AFORMAT))
		qual |= FMTERR;
	if (up->status & DECODE)
		qual |= DECERR;
	if (up->status & STAMP)
		qual |= TSPERR;
	if (up->status & BVALID && dtemp >= MINMETRIC)
		up->status |= INSYNC;
	synchar = leapchar = ' ';
	if (!(up->status & INSYNC)) {
		pp->leap = LEAP_NOTINSYNC;
		synchar = '?';
	} else if (up->leap & 0x2) {
		pp->leap = LEAP_ADDSECOND;
		leapchar = 'L';
	} else if (up->leap & 0x4) {
		pp->leap = LEAP_DELSECOND;
		leapchar = 'l';
	} else {
		pp->leap = LEAP_NOWARNING;
	}
	snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
	    "%c%1X %04d %03d %02d:%02d:%02d %c%x %+d %d %d %s %.0f %d",
	    synchar, qual, pp->year, pp->day, pp->hour, pp->minute,
	    pp->second, leapchar, up->dst, up->dut, minset, up->gain,
	    up->ident, dtemp, up->ntstamp);
	pp->lencode = strlen(pp->a_lastcode);

	/*
	 * If in sync and the signal metric is above threshold, the
	 * timecode is ipso fatso valid and can be selected to
	 * discipline the clock.
	 */
	if (up->status & INSYNC && !(up->status & (DECODE | STAMP)) &&
	    dtemp > MINMETRIC) {
		if (!clocktime(pp->day, pp->hour, pp->minute, 0, GMT,
		    up->tstamp[0].l_ui, &pp->yearstart, &offset.l_ui)) {
			up->errflg = CEVNT_BADTIME;
		} else {
			offset.l_uf = 0;
			for (i = 0; i < up->ntstamp; i++)
				refclock_process_offset(pp, offset,
				up->tstamp[i], PDELAY +
				    pp->fudgetime1);
			pp->lastref = up->timestamp;
			refclock_receive(peer);
		}
	}
	if (dtemp > 0)
		record_clock_stats(&peer->srcadr, pp->a_lastcode);
#ifdef DEBUG
	if (debug)
		printf("chu: timecode %d %s\n", pp->lencode,
		    pp->a_lastcode);
#endif
#ifdef ICOM
	chu_newchan(peer, dtemp);
#endif /* ICOM */
	chu_clear(peer);
	if (up->errflg)
		refclock_report(peer, up->errflg);
	up->errflg = 0;
}


/*
 * chu_major - majority decoder
 */
static double
chu_major(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct chuunit *up;

	u_char	code[11];	/* decoded timecode */
	int	metric;		/* distance metric */
	int	val1;		/* maximum distance */
	int	synchar;	/* stray cat */
	int	temp;
	int	i, j, k;

	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	/*
	 * Majority decoder. Each burst encodes two replications at each
	 * digit position in the timecode. Each row of the decoding
	 * matrix encodes the number of occurences of each digit found
	 * at the corresponding position. The maximum over all
	 * occurrences at each position is the distance for this
	 * position and the corresponding digit is the maximum-
	 * likelihood candidate. If the distance is not more than half
	 * the total number of occurences, a majority has not been found
	 * and the data are discarded. The decoding distance is defined
	 * as the sum of the distances over the first nine digits. The
	 * tenth digit varies over the seconds, so we don't count it.
	 */
	metric = 0;
	for (i = 0; i < 9; i++) {
		val1 = 0;
		k = 0;
		for (j = 0; j < 16; j++) {
			temp = up->decode[i][j] + up->decode[i + 10][j];
			if (temp > val1) {
				val1 = temp;
				k = j;
			}
		}
		if (val1 <= up->burstcnt)
			up->status |= DECODE;
		metric += val1;
		code[i] = hexchar[k];
	}

	/*
	 * Compute the timecode timestamp from the days, hours and
	 * minutes of the timecode. Use clocktime() for the aggregate
	 * minutes and the minute offset computed from the burst
	 * seconds. Note that this code relies on the filesystem time
	 * for the years and does not use the years of the timecode.
	 */
	if (sscanf((char *)code, "%1x%3d%2d%2d", &synchar, &pp->day,
	    &pp->hour, &pp->minute) != 4)
		up->status |= DECODE;
	if (up->ntstamp < MINSTAMP)
		up->status |= STAMP;
	return (metric);
}


/*
 * chu_clear - clear decoding matrix
 */
static void
chu_clear(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct chuunit *up;
	int	i, j;

	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	/*
	 * Clear stuff for the minute.
	 */
	up->ndx = up->prevsec = 0;
	up->burstcnt = up->ntstamp = 0;
	up->status &= INSYNC | METRIC;
	for (i = 0; i < 20; i++) {
		for (j = 0; j < 16; j++)
			up->decode[i][j] = 0;
	}
}

#ifdef ICOM
/*
 * chu_newchan - called once per minute to find the best channel;
 * returns zero on success, nonzero if ICOM error.
 */
static int
chu_newchan(
	struct peer *peer,
	double	met
	)
{
	struct chuunit *up;
	struct refclockproc *pp;
	struct xmtr *sp;
	int	rval;
	double	metric;
	int	i;

	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	/*
	 * The radio can be tuned to three channels: 0 (3330 kHz), 1
	 * (7850 kHz) and 2 (14670 kHz). There are five one-minute
	 * dwells in each cycle. During the first dwell the radio is
	 * tuned to one of the three channels to measure the channel
	 * metric. The channel is selected as the one least recently
	 * measured. During the remaining four dwells the radio is tuned
	 * to the channel with the highest channel metric. 
	 */
	if (up->fd_icom <= 0)
		return (0);

	/*
	 * Update the current channel metric and age of all channels.
	 * Scan all channels for the highest metric.
	 */
	sp = &up->xmtr[up->chan];
	sp->metric -= sp->integ[sp->iptr];
	sp->integ[sp->iptr] = met;
	sp->metric += sp->integ[sp->iptr];
	sp->probe = 0;
	sp->iptr = (sp->iptr + 1) % ISTAGE;
	metric = 0;
	for (i = 0; i < NCHAN; i++) {
		up->xmtr[i].probe++;
		if (up->xmtr[i].metric > metric) {
			up->status |= METRIC;
			metric = up->xmtr[i].metric;
			up->chan = i;
		}
	}

	/*
	 * Start the next dwell. If the first dwell or no stations have
	 * been heard, continue round-robin scan.
	 */
	up->dwell = (up->dwell + 1) % DWELL;
	if (up->dwell == 0 || metric == 0) {
		rval = 0;
		for (i = 0; i < NCHAN; i++) {
			if (up->xmtr[i].probe > rval) {
				rval = up->xmtr[i].probe;
				up->chan = i;
			}
		}
	}

	/* Retune the radio at each dwell in case somebody nudges the
	 * tuning knob.
	 */
	rval = icom_freq(up->fd_icom, peer->ttl & 0x7f, qsy[up->chan] +
	    TUNE);
	snprintf(up->ident, sizeof(up->ident), "CHU%d", up->chan);
	memcpy(&pp->refid, up->ident, 4); 
	memcpy(&peer->refid, up->ident, 4);
	if (metric == 0 && up->status & METRIC) {
		up->status &= ~METRIC;
		refclock_report(peer, CEVNT_PROP);
	} 
	return (rval);
}
#endif /* ICOM */


/*
 * chu_dist - determine the distance of two octet arguments
 */
static int
chu_dist(
	int	x,		/* an octet of bits */
	int	y		/* another octet of bits */
	)
{
	int	val;		/* bit count */ 
	int	temp;
	int	i;

	/*
	 * The distance is determined as the weight of the exclusive OR
	 * of the two arguments. The weight is determined by the number
	 * of one bits in the result. Each one bit increases the weight,
	 * while each zero bit decreases it.
	 */
	temp = x ^ y;
	val = 0;
	for (i = 0; i < 8; i++) {
		if ((temp & 0x1) == 0)
			val++;
		else
			val--;
		temp >>= 1;
	}
	return (val);
}


#ifdef HAVE_AUDIO
/*
 * chu_gain - adjust codec gain
 *
 * This routine is called at the end of each second. During the second
 * the number of signal clips above the MAXAMP threshold (6000). If
 * there are no clips, the gain is bumped up; if there are more than
 * MAXCLP clips (100), it is bumped down. The decoder is relatively
 * insensitive to amplitude, so this crudity works just peachy. The
 * routine also jiggles the input port and selectively mutes the
 */
static void
chu_gain(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct chuunit *up;

	pp = peer->procptr;
	up = (struct chuunit *)pp->unitptr;

	/*
	 * Apparently, the codec uses only the high order bits of the
	 * gain control field. Thus, it may take awhile for changes to
	 * wiggle the hardware bits.
	 */
	if (up->clipcnt == 0) {
		up->gain += 4;
		if (up->gain > MAXGAIN)
			up->gain = MAXGAIN;
	} else if (up->clipcnt > MAXCLP) {
		up->gain -= 4;
		if (up->gain < 0)
			up->gain = 0;
	}
	audio_gain(up->gain, up->mongain, up->port);
	up->clipcnt = 0;
}
#endif /* HAVE_AUDIO */


#else
int refclock_chu_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_acts.c0000644000175000017500000005626511415050142015533 0ustar  peterpeter/*
 * refclock_acts - clock driver for the NIST/USNO/PTB/NPL Computer Time
 *	Services
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && (defined(CLOCK_ACTS) || defined(CLOCK_PTBACTS))

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_unixtime.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"
#include "ntp_control.h"

#include 
#include 
#ifdef HAVE_SYS_IOCTL_H
# include 
#endif /* HAVE_SYS_IOCTL_H */

/*
 * This driver supports the US (NIST, USNO) and European (PTB, NPL,
 * etc.) modem time services, as well as Spectracom GPS and WWVB
 * receivers connected via a modem. The driver periodically dials a
 * number from a telephone list, receives the timecode data and
 * calculates the local clock correction. It is designed primarily for
 * use as backup when neither a radio clock nor connectivity to Internet
 * time servers is available.
 *
 * This driver requires a modem with a Hayes-compatible command set and
 * control over the modem data terminal ready (DTR) control line. The
 * modem setup string is hard-coded in the driver and may require
 * changes for nonstandard modems or special circumstances. For reasons
 * unrelated to this driver, the data set ready (DSR) control line
 * should not be set when this driver is first started.
 *
 * The calling program is initiated by setting fudge flag1, either
 * manually or automatically. When flag1 is set, the calling program
 * dials the first number in the phone command of the configuration
 * file. If that call fails, the calling program dials the second number
 * and so on. The number is specified by the Hayes ATDT prefix followed
 * by the number itself, including the prefix and long-distance digits
 * and delay code, if necessary. The flag1 is reset and the calling
 * program terminated if (a) a valid clock update has been determined,
 * (b) no more numbers remain in the list, (c) a device fault or timeout
 * occurs or (d) fudge flag1 is reset manually.
 *
 * The driver is transparent to each of the modem time services and
 * Spectracom radios. It selects the parsing algorithm depending on the
 * message length. There is some hazard should the message be corrupted.
 * However, the data format is checked carefully and only if all checks
 * succeed is the message accepted. Corrupted lines are discarded
 * without complaint.
 *
 * Fudge controls
 *
 * flag1	force a call in manual mode
 * flag2	enable port locking (not verified)
 * flag3	no modem; port is directly connected to device
 * flag4	not used
 *
 * time1	offset adjustment (s)
 *
 * Ordinarily, the serial port is connected to a modem; however, it can
 * be connected directly to a device or another computer for testing and
 * calibration. In this case set fudge flag3 and the driver will send a
 * single character 'T' at each poll event. In principle, fudge flag2
 * enables port locking, allowing the modem to be shared when not in use
 * by this driver. At least on Solaris with the current NTP I/O
 * routines, this results only in lots of ugly error messages.
 */
/*
 * National Institute of Science and Technology (NIST)
 *
 * Phone: (303) 494-4774 (Boulder, CO); (808) 335-4721 (Hawaii)
 *
 * Data Format
 *
 * National Institute of Standards and Technology
 * Telephone Time Service, Generator 3B
 * Enter question mark "?" for HELP
 *                         D  L D
 *  MJD  YR MO DA H  M  S  ST S UT1 msADV        
 * 47999 90-04-18 21:39:15 50 0 +.1 045.0 UTC(NIST) *
 * ...
 *
 * MJD, DST, DUT1 and UTC are not used by this driver. The "*" or "#" is
 * the on-time markers echoed by the driver and used by NIST to measure
 * and correct for the propagation delay.
 *
 * US Naval Observatory (USNO)
 *
 * Phone: (202) 762-1594 (Washington, DC); (719) 567-6742 (Boulder, CO)
 *
 * Data Format (two lines, repeating at one-second intervals)
 *
 * jjjjj nnn hhmmss UTC
 * *
 *
 * jjjjj	modified Julian day number (not used)
 * nnn		day of year
 * hhmmss	second of day
 * *		on-time marker for previous timecode
 * ...
 *
 * USNO does not correct for the propagation delay. A fudge time1 of
 * about .06 s is advisable.
 *
 * European Services (PTB, NPL, etc.)
 *
 * PTB: +49 531 512038 (Germany)
 * NPL: 0906 851 6333 (UK only)
 *
 * Data format (see the documentation for phone numbers and formats.)
 *
 * 1995-01-23 20:58:51 MEZ  10402303260219950123195849740+40000500
 *
 * Spectracom GPS and WWVB Receivers
 *
 * If a modem is connected to a Spectracom receiver, this driver will
 * call it up and retrieve the time in one of two formats. As this
 * driver does not send anything, the radio will have to either be
 * configured in continuous mode or be polled by another local driver.
 */
/*
 * Interface definitions
 */
#define	DEVICE		"/dev/acts%d" /* device name and unit */
#define	SPEED232	B9600	/* uart speed (9600 baud) */
#define	PRECISION	(-10)	/* precision assumed (about 1 ms) */
#define LOCKFILE	"/var/spool/locks/LCK..cua%d"
#define DESCRIPTION	"Automated Computer Time Service" /* WRU */
#define REFID		"NONE"	/* default reference ID */
#define MSGCNT		20	/* max message count */
#define SMAX		256	/* max clockstats line length */
#define	MAXPHONE	10	/* max number of phone numbers */

/*
 * Calling program modes
 */
#define MODE_AUTO	0	/* automatic mode */
#define MODE_BACKUP	1	/* backup mode */
#define MODE_MANUAL	2	/* manual mode */

/*
 * Service identifiers.
 */
#define REFACTS		"NIST"	/* NIST reference ID */
#define LENACTS		50	/* NIST format */
#define REFUSNO		"USNO"	/* USNO reference ID */
#define LENUSNO		20	/* USNO */
#define REFPTB		"PTB\0"	/* PTB/NPL reference ID */
#define LENPTB		78	/* PTB/NPL format */
#define REFWWVB		"WWVB"	/* WWVB reference ID */
#define	LENWWVB0	22	/* WWVB format 0 */
#define	LENWWVB2	24	/* WWVB format 2 */
#define LF		0x0a	/* ASCII LF */

/*
 * Modem setup strings. These may have to be changed for some modems.
 *
 * AT	command prefix
 * B1	US answer tone
 * &C0	disable carrier detect
 * &D2	hang up and return to command mode on DTR transition
 * E0	modem command echo disabled
 * l1	set modem speaker volume to low level
 * M1	speaker enabled until carrier detect
 * Q0	return result codes
 * V1	return result codes as English words
 */
#define MODEM_SETUP	"ATB1&C0&D2E0L1M1Q0V1\r" /* modem setup */
#define MODEM_HANGUP	"ATH\r"	/* modem disconnect */

/*
 * Timeouts (all in seconds)
 */
#define SETUP		3	/* setup timeout */
#define	DTR		1	/* DTR timeout */
#define ANSWER		60	/* answer timeout */
#define CONNECT		20	/* first valid message timeout */
#define TIMECODE	30	/* all valid messages timeout */

/*
 * State machine codes
 */
#define S_IDLE		0	/* wait for poll */
#define S_OK		1	/* wait for modem setup */
#define S_DTR		2	/* wait for modem DTR */
#define S_CONNECT	3	/* wait for answer*/
#define S_FIRST		4	/* wait for first valid message */
#define S_MSG		5	/* wait for all messages */
#define S_CLOSE		6	/* wait after sending disconnect */

/*
 * Unit control structure
 */
struct actsunit {
	int	unit;		/* unit number */
	int	state;		/* the first one was Delaware */
	int	timer;		/* timeout counter */
	int	retry;		/* retry index */
	int	msgcnt;		/* count of messages received */
	l_fp	tstamp;		/* on-time timestamp */
	char	*bufptr;	/* buffer pointer */
};

/*
 * Function prototypes
 */
static	int	acts_start	(int, struct peer *);
static	void	acts_shutdown	(int, struct peer *);
static	void	acts_receive	(struct recvbuf *);
static	void	acts_message	(struct peer *);
static	void	acts_timecode	(struct peer *, char *);
static	void	acts_poll	(int, struct peer *);
static	void	acts_timeout	(struct peer *);
static	void	acts_disc	(struct peer *);
static	void	acts_timer	(int, struct peer *);

/*
 * Transfer vector (conditional structure name)
 */
struct	refclock refclock_acts = {
	acts_start,		/* start up driver */
	acts_shutdown,		/* shut down driver */
	acts_poll,		/* transmit poll message */
	noentry,		/* not used */
	noentry,		/* not used */
	noentry,		/* not used */
	acts_timer		/* housekeeping timer */
};

/*
 * Initialize data for processing
 */
static int
acts_start (
	int	unit,
	struct peer *peer
	)
{
	struct actsunit *up;
	struct refclockproc *pp;

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(struct actsunit));
	memset(up, 0, sizeof(struct actsunit));
	up->unit = unit;
	pp = peer->procptr;
	pp->unitptr = (caddr_t)up;
	pp->io.clock_recv = acts_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	peer->sstclktype = CTL_SST_TS_TELEPHONE;
	up->bufptr = pp->a_lastcode;
	return (1);
}


/*
 * acts_shutdown - shut down the clock
 */
static void
acts_shutdown (
	int	unit,
	struct peer *peer
	)
{
	struct actsunit *up;
	struct refclockproc *pp;

	/*
	 * Warning: do this only when a call is not in progress.
	 */
	pp = peer->procptr;
	up = (struct actsunit *)pp->unitptr;
	free(up);
}


/*
 * acts_receive - receive data from the serial interface
 */
static void
acts_receive (
	struct recvbuf *rbufp
	)
{
	struct actsunit *up;
	struct refclockproc *pp;
	struct peer *peer;
	char	tbuf[BMAX];
	char	*tptr;

	/*
	 * Initialize pointers and read the timecode and timestamp. Note
	 * we are in raw mode and victim of whatever the terminal
	 * interface kicks up; so, we have to reassemble messages from
	 * arbitrary fragments. Capture the timecode at the beginning of
	 * the message and at the '*' and '#' on-time characters.
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct actsunit *)pp->unitptr;
	pp->lencode = refclock_gtraw(rbufp, tbuf, BMAX - (up->bufptr -
	    pp->a_lastcode), &pp->lastrec);
	for (tptr = tbuf; *tptr != '\0'; tptr++) {
		if (*tptr == LF) {
			if (up->bufptr == pp->a_lastcode) {
				up->tstamp = pp->lastrec;
				continue;

			} else {
				*up->bufptr = '\0';
				acts_message(peer);
				up->bufptr = pp->a_lastcode;
			}
		} else if (!iscntrl(*tptr)) {
			*up->bufptr++ = *tptr;
			if (*tptr == '*' || *tptr == '#') {
				up->tstamp = pp->lastrec;
				write(pp->io.fd, tptr, 1);
			}
		}
	}
}


/*
 * acts_message - process message
 */
void
acts_message(
	struct peer *peer
	)
{
	struct actsunit *up;
	struct refclockproc *pp;
	int	dtr = TIOCM_DTR;
	char	tbuf[SMAX];
#ifdef DEBUG
	u_int	modem;
#endif

	/*
	 * What to do depends on the state and the first token in the
	 * message.	 */
	pp = peer->procptr;
	up = (struct actsunit *)pp->unitptr;
#ifdef DEBUG
	ioctl(pp->io.fd, TIOCMGET, (char *)&modem);
	snprintf(tbuf, sizeof(tbuf), "acts: %04x (%d %d) %lu %s", modem,
		 up->state, up->timer, (u_long)strlen(pp->a_lastcode),
		 pp->a_lastcode);
	if (debug)
		printf("%s\n", tbuf);
#endif

	/*
	 * Extract the first token in the line. A NO token sends the
	 * message to the clockstats.
	 */
	strncpy(tbuf, pp->a_lastcode, SMAX);
	strtok(tbuf, " ");
	if (strcmp(tbuf, "NO") == 0) {
		report_event(PEVNT_CLOCK, peer, pp->a_lastcode);
		return;
	}
	switch(up->state) {

	/*
	 * We are waiting for the OK response to the modem setup
	 * command. When this happens, raise DTR and dial the number
	 * followed by \r.
	 */
	case S_OK:
		if (strcmp(tbuf, "OK") != 0) {
			msyslog(LOG_ERR, "acts: setup error %s",
			    pp->a_lastcode);
			acts_disc(peer);
			return;
		}
		ioctl(pp->io.fd, TIOCMBIS, (char *)&dtr);
		up->state = S_DTR;
		up->timer = DTR;
		return;

	/*
	 * We are waiting for the call to be answered. All we care about
	 * here is token CONNECT. Send the message to the clockstats.
	 */
	case S_CONNECT:
		report_event(PEVNT_CLOCK, peer, pp->a_lastcode);
		if (strcmp(tbuf, "CONNECT") != 0) {
			acts_disc(peer);
			return;
		}
		up->state = S_FIRST;
		up->timer = CONNECT;
		return;

	/*
	 * We are waiting for a timecode. Pass it to the parser.
	 */
	case S_FIRST:
	case S_MSG:
		acts_timecode(peer, pp->a_lastcode);
		break;
	}
}

/*
 * acts_timecode - identify the service and parse the timecode message
 */
void
acts_timecode(
	struct peer *peer,	/* peer structure pointer */
	char	*str		/* timecode string */
	)
{
	struct actsunit *up;
	struct refclockproc *pp;
	int	day;		/* day of the month */
	int	month;		/* month of the year */
	u_long	mjd;		/* Modified Julian Day */
	double	dut1;		/* DUT adjustment */

	u_int	dst;		/* ACTS daylight/standard time */
	u_int	leap;		/* ACTS leap indicator */
	double	msADV;		/* ACTS transmit advance (ms) */
	char	utc[10];	/* ACTS timescale */
	char	flag;		/* ACTS on-time character (* or #) */

	char	synchar;	/* WWVB synchronized indicator */
	char	qualchar;	/* WWVB quality indicator */
	char	leapchar;	/* WWVB leap indicator */
	char	dstchar;	/* WWVB daylight/savings indicator */
	int	tz;		/* WWVB timezone */

	u_int	leapmonth;	/* PTB/NPL month of leap */
	char	leapdir;	/* PTB/NPL leap direction */

	/*
	 * The parser selects the modem format based on the message
	 * length. Since the data are checked carefully, occasional
	 * errors due noise are forgivable.
	 */
	pp = peer->procptr;
	up = (struct actsunit *)pp->unitptr;
	pp->nsec = 0;
	switch(strlen(str)) {

	/*
	 * For USNO format on-time character '*', which is on a line by
	 * itself. Be sure a timecode has been received.
	 */
	case 1:
		if (*str == '*' && up->msgcnt > 0) 
			break;

		return;
	
	/*
	 * ACTS format: "jjjjj yy-mm-dd hh:mm:ss ds l uuu aaaaa
	 * UTC(NIST) *"
	 */
	case LENACTS:
		if (sscanf(str,
		    "%5ld %2d-%2d-%2d %2d:%2d:%2d %2d %1d %3lf %5lf %9s %c",
		    &mjd, &pp->year, &month, &day, &pp->hour,
		    &pp->minute, &pp->second, &dst, &leap, &dut1,
		    &msADV, utc, &flag) != 13) {
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		}

		/*
		 * Wait until ACTS has calculated the roundtrip delay.
		 * We don't need to do anything, as ACTS adjusts the
		 * on-time epoch.
		 */
		if (flag != '#')
			return;

		pp->day = ymd2yd(pp->year, month, day);
		pp->leap = LEAP_NOWARNING;
		if (leap == 1)
	    		pp->leap = LEAP_ADDSECOND;
		else if (pp->leap == 2)
	    		pp->leap = LEAP_DELSECOND;
		memcpy(&pp->refid, REFACTS, 4);
		if (up->msgcnt == 0)
			record_clock_stats(&peer->srcadr, str);
		up->msgcnt++;
		break;

	/*
	 * USNO format: "jjjjj nnn hhmmss UTC"
	 */
	case LENUSNO:
		if (sscanf(str, "%5ld %3d %2d%2d%2d %3s",
		    &mjd, &pp->day, &pp->hour, &pp->minute,
		    &pp->second, utc) != 6) {
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		}

		/*
		 * Wait for the on-time character, which follows in a
		 * separate message. There is no provision for leap
		 * warning.
		 */
		pp->leap = LEAP_NOWARNING;
		memcpy(&pp->refid, REFUSNO, 4);
		if (up->msgcnt == 0)
			record_clock_stats(&peer->srcadr, str);
		up->msgcnt++;
		return;

	/*
	 * PTB/NPL format: "yyyy-mm-dd hh:mm:ss MEZ" 
	 */
	case LENPTB:
		if (sscanf(str,
		    "%*4d-%*2d-%*2d %*2d:%*2d:%2d %*5c%*12c%4d%2d%2d%2d%2d%5ld%2lf%c%2d%3lf%*15c%c",
		    &pp->second, &pp->year, &month, &day, &pp->hour,
		    &pp->minute, &mjd, &dut1, &leapdir, &leapmonth,
		    &msADV, &flag) != 12) {
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		}
		pp->leap = LEAP_NOWARNING;
		if (leapmonth == month) {
			if (leapdir == '+')
		    		pp->leap = LEAP_ADDSECOND;
			else if (leapdir == '-')
		    		pp->leap = LEAP_DELSECOND;
		}
		pp->day = ymd2yd(pp->year, month, day);
		memcpy(&pp->refid, REFPTB, 4);
		if (up->msgcnt == 0)
			record_clock_stats(&peer->srcadr, str);
		up->msgcnt++;
		break;


	/*
	 * WWVB format 0: "I  ddd hh:mm:ss DTZ=nn"
	 */
	case LENWWVB0:
		if (sscanf(str, "%c %3d %2d:%2d:%2d %cTZ=%2d",
		    &synchar, &pp->day, &pp->hour, &pp->minute,
		    &pp->second, &dstchar, &tz) != 7) {
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		}
		pp->leap = LEAP_NOWARNING;
		if (synchar != ' ')
			pp->leap = LEAP_NOTINSYNC;
		memcpy(&pp->refid, REFWWVB, 4);
		if (up->msgcnt == 0)
			record_clock_stats(&peer->srcadr, str);
		up->msgcnt++;
		break;

	/*
	 * WWVB format 2: "IQyy ddd hh:mm:ss.mmm LD"
	 */
	case LENWWVB2:
		if (sscanf(str, "%c%c%2d %3d %2d:%2d:%2d.%3ld%c%c%c",
		    &synchar, &qualchar, &pp->year, &pp->day,
		    &pp->hour, &pp->minute, &pp->second, &pp->nsec,
		    &dstchar, &leapchar, &dstchar) != 11) {
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		}
		pp->nsec *= 1000000;
		pp->leap = LEAP_NOWARNING;
		if (synchar != ' ')
			pp->leap = LEAP_NOTINSYNC;
		else if (leapchar == 'L')
			pp->leap = LEAP_ADDSECOND;
		memcpy(&pp->refid, REFWWVB, 4);
		if (up->msgcnt == 0)
			record_clock_stats(&peer->srcadr, str);
		up->msgcnt++;
		break;

	/*
	 * None of the above. Just forget about it and wait for the next
	 * message or timeout.
	 */
	default:
		return;
	}

	/*
	 * We have a valid timecode. The fudge time1 value is added to
	 * each sample by the main line routines. Note that in current
	 * telephone networks the propatation time can be different for
	 * each call and can reach 200 ms for some calls.
	 */
	peer->refid = pp->refid;
	pp->lastrec = up->tstamp;
	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	pp->lastref = pp->lastrec;
	if (up->state != S_MSG) {
		up->state = S_MSG;
		up->timer = TIMECODE;
	}
}


/*
 * acts_poll - called by the transmit routine
 */
static void
acts_poll (
	int	unit,
	struct peer *peer
	)
{
	struct actsunit *up;
	struct refclockproc *pp;

	/*
	 * This routine is called at every system poll. All it does is
	 * set flag1 under certain conditions. The real work is done by
	 * the timeout routine and state machine.
	 */
	pp = peer->procptr;
	up = (struct actsunit *)pp->unitptr;
	switch (peer->ttl) {

	/*
	 * In manual mode the calling program is activated by the ntpdc
	 * program using the enable flag (fudge flag1), either manually
	 * or by a cron job.
	 */
	case MODE_MANUAL:
		/* fall through */
		break;

	/*
	 * In automatic mode the calling program runs continuously at
	 * intervals determined by the poll event or specified timeout.
	 */
	case MODE_AUTO:
		pp->sloppyclockflag |= CLK_FLAG1;
		break;

	/*
	 * In backup mode the calling program runs continuously as long
	 * as either no peers are available or this peer is selected.
	 */
	case MODE_BACKUP:
		if (sys_peer == NULL || sys_peer == peer)
			pp->sloppyclockflag |= CLK_FLAG1;
		break;
	}
}


/*
 * acts_timer - called at one-second intervals
 */
static void
acts_timer(
	int	unit,
	struct peer *peer
	)
{
	struct actsunit *up;
	struct refclockproc *pp;

	/*
	 * This routine implments a timeout which runs for a programmed
	 * interval. The counter is initialized by the state machine and
	 * counts down to zero. Upon reaching zero, the state machine is
	 * called. If flag1 is set while in S_IDLE state, force a
	 * timeout.
	 */
	pp = peer->procptr;
	up = (struct actsunit *)pp->unitptr;
	if (pp->sloppyclockflag & CLK_FLAG1 && up->state == S_IDLE) {
		acts_timeout(peer);
		return;
	}
	if (up->timer == 0)
		return;

	up->timer--;
	if (up->timer == 0)
		acts_timeout(peer);
}


/*
 * acts_timeout - called on timeout
 */
static void
acts_timeout(
	struct peer *peer
	)
{
	struct actsunit *up;
	struct refclockproc *pp;
	int	fd;
	char	device[20];
	char	lockfile[128], pidbuf[8];
	char	tbuf[SMAX];

	/*
	 * The state machine is driven by messages from the modem, when
	 * first stated and at timeout.
	 */
	pp = peer->procptr;
	up = (struct actsunit *)pp->unitptr;
	pp->sloppyclockflag &= ~CLK_FLAG1;
	if (sys_phone[up->retry] == NULL && !(pp->sloppyclockflag &
	    CLK_FLAG3)) {
		msyslog(LOG_ERR, "acts: no phones");
		return;
	}
	switch(up->state) {

	/*
	 * System poll event. Lock the modem port and open the device.
	 */
	case S_IDLE:

		/*
		 * Lock the modem port. If busy, retry later. Note: if
		 * something fails between here and the close, the lock
		 * file may not be removed.
		 */
		if (pp->sloppyclockflag & CLK_FLAG2) {
			snprintf(lockfile, sizeof(lockfile), LOCKFILE,
			    up->unit);
			fd = open(lockfile, O_WRONLY | O_CREAT | O_EXCL,
			    0644);
			if (fd < 0) {
				msyslog(LOG_ERR, "acts: port busy");
				return;
			}
			snprintf(pidbuf, sizeof(pidbuf), "%d\n",
			    (u_int)getpid());
			write(fd, pidbuf, strlen(pidbuf));
			close(fd);
		}

		/*
		 * Open the device in raw mode and link the I/O.
		 */
		if (!pp->io.fd) {
			snprintf(device, sizeof(device), DEVICE,
			    up->unit);
			fd = refclock_open(device, SPEED232,
			    LDISC_ACTS | LDISC_RAW | LDISC_REMOTE);
			if (fd == 0) {
				msyslog(LOG_ERR,
				    "acts: open fails");
				return;
			}
			pp->io.fd = fd;
			if (!io_addclock(&pp->io)) {
				msyslog(LOG_ERR,
				    "acts: addclock fails");
				close(fd);
				pp->io.fd = 0;
				return;
			}
		}

		/*
		 * If the port is directly connected to the device, skip
		 * the modem business and send 'T' for Spectrabum.
		 */
		if (pp->sloppyclockflag & CLK_FLAG3) {
			if (write(pp->io.fd, "T", 1) < 0) {
				msyslog(LOG_ERR, "acts: write %m");
				return;
			}
			up->state = S_FIRST;
			up->timer = CONNECT;
			return;
		}

		/*
		 * Initialize the modem. This works with Hayes commands.
		 */
#ifdef DEBUG
		if (debug)
			printf("acts: setup %s\n", MODEM_SETUP);
#endif
		if (write(pp->io.fd, MODEM_SETUP, strlen(MODEM_SETUP)) <
		    0) {
			msyslog(LOG_ERR, "acts: write %m");
			return;
		}
		up->state = S_OK;
		up->timer = SETUP;
		return;

	/*
	 * In OK state the modem did not respond to setup.
	 */
	case S_OK:
		msyslog(LOG_ERR, "acts: no modem");
		break;

	/*
	 * In DTR state we are waiting for the modem to settle down
	 * before hammering it with a dial command.
	 */
	case S_DTR:
		snprintf(tbuf, sizeof(tbuf), "DIAL #%d %s", up->retry,
		    sys_phone[up->retry]);
		report_event(PEVNT_CLOCK, peer, tbuf);
#ifdef DEBUG
		if (debug)
			printf("%s\n", tbuf);
#endif
		write(pp->io.fd, sys_phone[up->retry],
		    strlen(sys_phone[up->retry]));
		write(pp->io.fd, "\r", 1);
		up->state = S_CONNECT;
		up->timer = ANSWER;
		return;

	/*
	 * In CONNECT state the call did not complete.
	 */
	case S_CONNECT:
		msyslog(LOG_ERR, "acts: no answer");
		break;

	/*
	 * In FIRST state no messages were received.
	 */
	case S_FIRST:
		msyslog(LOG_ERR, "acts: no messages");
		break;

	/*
	 * In CLOSE state hangup is complete. Close the doors and
	 * windows and get some air.
	 */
	case S_CLOSE:

		/*
		 * Close the device and unlock a shared modem.
		 */
		if (pp->io.fd) {
			io_closeclock(&pp->io);
			close(pp->io.fd);
			if (pp->sloppyclockflag & CLK_FLAG2) {
				snprintf(lockfile, sizeof(lockfile),
				    LOCKFILE, up->unit);
				unlink(lockfile);
			}
			pp->io.fd = 0;
		}

		/*
		 * If messages were received, fold the tent and wait for
		 * the next poll. If no messages and there are more
		 * numbers to dial, retry after a short wait.
		 */
		up->bufptr = pp->a_lastcode;
		up->timer = 0;
		up->state = S_IDLE;
		if ( up->msgcnt == 0) {
			up->retry++;
			if (sys_phone[up->retry] == NULL)
				up->retry = 0;
			else
				up->timer = SETUP;
		} else {
			up->retry = 0;
		}
		up->msgcnt = 0;
		return;
	}
	acts_disc(peer);
}


/*
 * acts_disc - disconnect the call and clean the place up.
 */
static void
acts_disc (
	struct peer *peer
	)
{
	struct actsunit *up;
	struct refclockproc *pp;
	int	dtr = TIOCM_DTR;

	/*
	 * We get here if the call terminated successfully or if an
	 * error occured. If the median filter has something in it,
	 * feed the data to the clock filter. If a modem port, drop DTR
	 * to force command mode and send modem hangup.
	 */
	pp = peer->procptr;
	up = (struct actsunit *)pp->unitptr;
	if (up->msgcnt > 0)
		refclock_receive(peer);
	if (!(pp->sloppyclockflag & CLK_FLAG3)) {
		ioctl(pp->io.fd, TIOCMBIC, (char *)&dtr);
		write(pp->io.fd, MODEM_HANGUP, strlen(MODEM_HANGUP));
	}
	up->timer = SETUP;
	up->state = S_CLOSE;
}
#else
int refclock_acts_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_tpro.c0000644000175000017500000001153411332473277015573 0ustar  peterpeter/*
 * refclock_tpro - clock driver for the KSI/Odetics TPRO-S IRIG-B reader
 */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_TPRO)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "sys/tpro.h"
#include "ntp_stdlib.h"

#include 
#include 

/*
 * This driver supports the KSI/Odetecs TPRO-S IRIG-B reader and TPRO-
 * SAT GPS receiver for the Sun Microsystems SBus. It requires that the
 * tpro.o device driver be installed and loaded.
 */ 

/*
 * TPRO interface definitions
 */
#define	DEVICE		 "/dev/tpro%d" /* device name and unit */
#define	PRECISION	(-20)	/* precision assumed (1 us) */
#define	REFID		"IRIG"	/* reference ID */
#define	DESCRIPTION	"KSI/Odetics TPRO/S IRIG Interface" /* WRU */

/*
 * Unit control structure
 */
struct tprounit {
	struct	tproval tprodata; /* data returned from tpro read */
};

/*
 * Function prototypes
 */
static	int	tpro_start	(int, struct peer *);
static	void	tpro_shutdown	(int, struct peer *);
static	void	tpro_poll	(int unit, struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_tpro = {
	tpro_start,		/* start up driver */
	tpro_shutdown,		/* shut down driver */
	tpro_poll,		/* transmit poll message */
	noentry,		/* not used (old tpro_control) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old tpro_buginfo) */
	NOFLAGS			/* not used */
};


/*
 * tpro_start - open the TPRO device and initialize data for processing
 */
static int
tpro_start(
	int unit,
	struct peer *peer
	)
{
	register struct tprounit *up;
	struct refclockproc *pp;
	char device[20];
	int fd;

	/*
	 * Open TPRO device
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
	fd = open(device, O_RDONLY | O_NDELAY, 0777);
	if (fd == -1) {
		msyslog(LOG_ERR, "tpro_start: open of %s: %m", device);
		return (0);
	}

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp = peer->procptr;
	pp->io.clock_recv = noentry;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	pp->unitptr = (caddr_t)up;

	/*
	 * Initialize miscellaneous peer variables
	 */
	peer->precision = PRECISION;
	peer->burst = NSTAGE;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	return (1);
}


/*
 * tpro_shutdown - shut down the clock
 */
static void
tpro_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct tprounit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct tprounit *)pp->unitptr;
	io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}


/*
 * tpro_poll - called by the transmit procedure
 */
static void
tpro_poll(
	int unit,
	struct peer *peer
	)
{
	register struct tprounit *up;
	struct refclockproc *pp;
	struct tproval *tp;

	/*
	 * This is the main routine. It snatches the time from the TPRO
	 * board and tacks on a local timestamp.
	 */
	pp = peer->procptr;
	up = (struct tprounit *)pp->unitptr;

	tp = &up->tprodata;
	if (read(pp->io.fd, (char *)tp, sizeof(struct tproval)) < 0) {
		refclock_report(peer, CEVNT_FAULT);
		return;
	}
	get_systime(&pp->lastrec);
	pp->polls++;

	/*
	 * We get down to business, check the timecode format and decode
	 * its contents. If the timecode has invalid length or is not in
	 * proper format, we declare bad format and exit. Note: we
	 * can't use the sec/usec conversion produced by the driver,
	 * since the year may be suspect. All format error checking is
	 * done by the sprintf() and sscanf() routines.
	 *
	 * Note that the refclockproc usec member has now become nsec.
	 * We could either multiply the read-in usec value by 1000 or
	 * we could pad the written string appropriately and read the
	 * resulting value in already scaled.
	 */
	snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
		 "%1x%1x%1x %1x%1x:%1x%1x:%1x%1x.%1x%1x%1x%1x%1x%1x %1x",
		 tp->day100, tp->day10, tp->day1, tp->hour10, tp->hour1,
		 tp->min10, tp->min1, tp->sec10, tp->sec1, tp->ms100,
		 tp->ms10, tp->ms1, tp->usec100, tp->usec10, tp->usec1,
		 tp->status);
	pp->lencode = strlen(pp->a_lastcode);
#ifdef DEBUG
	if (debug)
		printf("tpro: time %s timecode %d %s\n",
		   ulfptoa(&pp->lastrec, 6), pp->lencode,
		   pp->a_lastcode);
#endif
	if (sscanf(pp->a_lastcode, "%3d %2d:%2d:%2d.%6ld", &pp->day,
	    &pp->hour, &pp->minute, &pp->second, &pp->nsec)
	    != 5) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	pp->nsec *= 1000;	/* Convert usec to nsec */
	if (!tp->status & 0x3)
		pp->leap = LEAP_NOTINSYNC;
	else
		pp->leap = LEAP_NOWARNING;
	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	if (peer->burst > 0)
		return;
	if (pp->coderecv == pp->codeproc) {
		refclock_report(peer, CEVNT_TIMEOUT);
		return;
	}
	pp->lastref = pp->lastrec;
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
	refclock_receive(peer);
	peer->burst = NSTAGE;
}

#else
int refclock_tpro_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/Makefile.in0000644000175000017500000016344011675460277014652 0ustar  peterpeter# 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@

# we traditionally installed software in bindir, while it should have gone
# in sbindir.  Now that we offer a choice, look in the "other" installation
# subdir to warn folks if there is another version there.



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@
@NTP_BINSUBDIR_IS_BIN_TRUE@bin_PROGRAMS = ntpd$(EXEEXT) @MAKE_NTPDSIM@
@NTP_BINSUBDIR_IS_BIN_FALSE@sbin_PROGRAMS = ntpd$(EXEEXT) \
@NTP_BINSUBDIR_IS_BIN_FALSE@	@MAKE_NTPDSIM@ $(am__empty)
EXTRA_PROGRAMS = check_y2k$(EXEEXT) ntpdsim$(EXEEXT) \
	keyword-gen$(EXEEXT)
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
	$(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf \
	ntp_parser.c ntp_parser.h
subdir = ntpd
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
	$(top_srcdir)/m4/define_dir.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_cacheversion.m4 \
	$(top_srcdir)/m4/ntp_dir_sep.m4 \
	$(top_srcdir)/m4/ntp_lineeditlibs.m4 \
	$(top_srcdir)/m4/ntp_openssl.m4 \
	$(top_srcdir)/m4/ntp_vpathhack.m4 \
	$(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 =
LIBRARIES = $(noinst_LIBRARIES)
ARFLAGS = cru
libntpd_a_AR = $(AR) $(ARFLAGS)
libntpd_a_LIBADD =
am__objects_1 =
am_libntpd_a_OBJECTS = ntp_control.$(OBJEXT) ntp_crypto.$(OBJEXT) \
	ntp_filegen.$(OBJEXT) ntp_intres.$(OBJEXT) \
	ntp_loopfilter.$(OBJEXT) ntp_monitor.$(OBJEXT) \
	ntp_peer.$(OBJEXT) ntp_proto.$(OBJEXT) ntp_refclock.$(OBJEXT) \
	ntp_request.$(OBJEXT) ntp_restrict.$(OBJEXT) \
	ntp_signd.$(OBJEXT) ntp_timer.$(OBJEXT) ntp_util.$(OBJEXT) \
	refclock_acts.$(OBJEXT) refclock_arbiter.$(OBJEXT) \
	refclock_arc.$(OBJEXT) refclock_as2201.$(OBJEXT) \
	refclock_atom.$(OBJEXT) refclock_bancomm.$(OBJEXT) \
	refclock_chronolog.$(OBJEXT) refclock_chu.$(OBJEXT) \
	refclock_conf.$(OBJEXT) refclock_datum.$(OBJEXT) \
	refclock_dumbclock.$(OBJEXT) refclock_fg.$(OBJEXT) \
	refclock_gpsvme.$(OBJEXT) refclock_heath.$(OBJEXT) \
	refclock_hopfser.$(OBJEXT) refclock_hopfpci.$(OBJEXT) \
	refclock_hpgps.$(OBJEXT) refclock_irig.$(OBJEXT) \
	refclock_jjy.$(OBJEXT) refclock_jupiter.$(OBJEXT) \
	refclock_leitch.$(OBJEXT) refclock_local.$(OBJEXT) \
	refclock_mx4200.$(OBJEXT) refclock_neoclock4x.$(OBJEXT) \
	refclock_nmea.$(OBJEXT) refclock_oncore.$(OBJEXT) \
	refclock_palisade.$(OBJEXT) refclock_parse.$(OBJEXT) \
	refclock_pcf.$(OBJEXT) refclock_pst.$(OBJEXT) \
	refclock_ripencc.$(OBJEXT) refclock_shm.$(OBJEXT) \
	refclock_tpro.$(OBJEXT) refclock_true.$(OBJEXT) \
	refclock_tt560.$(OBJEXT) refclock_ulink.$(OBJEXT) \
	refclock_wwv.$(OBJEXT) refclock_wwvb.$(OBJEXT) \
	refclock_zyfer.$(OBJEXT) $(am__objects_1)
libntpd_a_OBJECTS = $(am_libntpd_a_OBJECTS)
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \
	"$(DESTDIR)$(man1dir)"
PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS)
check_y2k_SOURCES = check_y2k.c
check_y2k_OBJECTS = check_y2k.$(OBJEXT)
am__DEPENDENCIES_1 = version.o libntpd.a
check_y2k_DEPENDENCIES = $(am__DEPENDENCIES_1) ../libntp/libntp.a
keyword_gen_SOURCES = keyword-gen.c
keyword_gen_OBJECTS = keyword-gen.$(OBJEXT)
keyword_gen_DEPENDENCIES = ../libntp/libntp.a
am_ntpd_OBJECTS = cmd_args.$(OBJEXT) ntp_config.$(OBJEXT) \
	ntp_data_structures.$(OBJEXT) ntp_io.$(OBJEXT) \
	ntp_parser.$(OBJEXT) ntp_scanner.$(OBJEXT) ntpd.$(OBJEXT) \
	ntpd-opts.$(OBJEXT) $(am__objects_1)
ntpd_OBJECTS = $(am_ntpd_OBJECTS)
am__DEPENDENCIES_2 =
ntpd_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
	../libntp/libntp.a
am__objects_2 = ntpdsim-cmd_args.$(OBJEXT) \
	ntpdsim-ntp_config.$(OBJEXT) \
	ntpdsim-ntp_data_structures.$(OBJEXT) ntpdsim-ntp_io.$(OBJEXT) \
	ntpdsim-ntp_parser.$(OBJEXT) ntpdsim-ntp_scanner.$(OBJEXT) \
	ntpdsim-ntpd.$(OBJEXT) ntpdsim-ntpd-opts.$(OBJEXT) \
	$(am__objects_1)
am_ntpdsim_OBJECTS = $(am__objects_2) ntpdsim-ntpsim.$(OBJEXT) \
	$(am__objects_1)
ntpdsim_OBJECTS = $(am_ntpdsim_OBJECTS)
ntpdsim_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
	../libntp/libntpsim.a
ntpdsim_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=link $(CCLD) $(ntpdsim_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
	$(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
	$(LDFLAGS) -o $@
YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
YLWRAP = $(top_srcdir)/ylwrap
SOURCES = $(libntpd_a_SOURCES) check_y2k.c keyword-gen.c \
	$(ntpd_SOURCES) $(ntpdsim_SOURCES)
DIST_SOURCES = $(libntpd_a_SOURCES) check_y2k.c keyword-gen.c \
	$(ntpd_SOURCES) $(ntpdsim_SOURCES)
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'
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
DATA = $(noinst_DATA)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINSUBDIR = @BINSUBDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
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@
EF_LIBS = @EF_LIBS@
EF_PROGS = @EF_PROGS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_INLINE = @HAVE_INLINE@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LCRYPTO = @LCRYPTO@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
LIBOPTS_DIR = @LIBOPTS_DIR@
LIBOPTS_LDADD = @LIBOPTS_LDADD@
LIBPARSE = @LIBPARSE@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
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@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENSSL = @OPENSSL@
OPENSSL_INC = @OPENSSL_INC@
OPENSSL_LIB = @OPENSSL_LIB@
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_SH = @PATH_SH@
PATH_TEST = @PATH_TEST@
POSIX_SHELL = @POSIX_SHELL@
PROPDELAY = @PROPDELAY@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SNMP_CFLAGS = @SNMP_CFLAGS@
SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
SNMP_LIBS = @SNMP_LIBS@
STRIP = @STRIP@
TESTDCF = @TESTDCF@
VERSION = @VERSION@
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_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 = 
AUTOMAKE_OPTIONS = 
noinst_LIBRARIES = libntpd.a
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \
	-I$(top_srcdir)/lib/isc/nothreads/include \
	-I$(top_srcdir)/lib/isc/unix/include $(LIBOPTS_CFLAGS)


# LDADD might need RESLIB and ADJLIB.
LDADD = version.o libntpd.a @LIBPARSE@
AM_YFLAGS = -d -t -r all
@NTP_CROSSCOMPILE_FALSE@@SAVECONFIG_ENABLED_TRUE@CHECK_SAVECONFIG = check-saveconfig
@NTP_CROSSCOMPILE_TRUE@@SAVECONFIG_ENABLED_TRUE@CHECK_SAVECONFIG = 
@SAVECONFIG_ENABLED_FALSE@CHECK_SAVECONFIG = 
@VPATH_HACK_FALSE@VPHACK = 

#
# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as 
# BSD make) to work around issues specific to compiling
# ntp_parser.y into ntp_parser.h and ntp_parser.c in a vPATH
# configuration where we would like (for a change) the output
# files ntp_parser.[ch] to be placed in the source directory,
# as opposed to the build directory.  This allows a single
# host of a flock configured with Bison to update ntp_parser.[ch]
# used by the rest.
# 
@VPATH_HACK_TRUE@VPHACK = vphack
@VPATH_HACK_FALSE@VPHACK_AFTER = 
@VPATH_HACK_TRUE@VPHACK_AFTER = vphack_after

# BUILT_SOURCES which should also be in EXTRA_DIST
B_S_DIST = \
	ntpd-opts.c 	\
	ntpd-opts.h 	\
	$(NULL)

BUILT_SOURCES = $(VPHACK) ntp_parser.c ntp_parser.h $(VPHACK_AFTER) \
	$(B_S_DIST) $(NULL) .deps-ver
man_MANS = $(srcdir)/ntpd.1

# ntpdsim.1 is a remnant along with all the ntpdsim-opts.* files, the
# simulator currently uses ntpd-opts.[ch].  This also means there is no
# longer a reason to have ntpdbase-opts.def split off of ntpd-opts.def.

# ntpd may need:
# log10                               refclock_wwv.o
# sqrt                                ntp_control.o
# floor                               refclock_wwv.o
# which are (usually) provided by -lm.
ntpd_LDADD = $(LDADD) $(LIBOPTS_LDADD) ../libntp/libntp.a -lm @LCRYPTO@ @LSCF@
ntpdsim_LDADD = $(LDADD) $(LIBOPTS_LDADD) ../libntp/libntpsim.a -lm @LCRYPTO@ @LSCF@
ntpdsim_CFLAGS = $(CFLAGS) -DSIM
check_y2k_LDADD = $(LDADD) ../libntp/libntp.a
keyword_gen_LDADD = ../libntp/libntp.a	# we don't want $(LDADD) here
DISTCLEANFILES = \
	keyword-gen		\
	.version		\
	version.c		\
	$(NULL)

CLEANFILES = check-saveconfig compsave.conf k-g-u-submake $(NULL) \
	.deps-ver
EXTRA_DIST = \
	complete.conf		\
	keyword-gen-utd		\
	ntpd.1			\
	ntpd-opts.def		\
	ntpd-opts.menu		\
	ntpd-opts.texi		\
	ntpdbase-opts.def	\
	refclock_msfees.c	\
	refclock_trak.c		\
	$(B_S_DIST)		\
	$(NULL)

ETAGS_ARGS = Makefile.am
###							Y2Kfixes
check_PROGRAMS = @MAKE_CHECK_Y2K@
noinst_DATA = $(srcdir)/ntpd-opts.texi $(srcdir)/ntpd-opts.menu
run_ag = cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)"	\
		autogen -L ../include --writable

std_def_list = $(top_srcdir)/include/autogen-version.def 	\
		$(top_srcdir)/include/copyright.def 		\
		$(top_srcdir)/include/version.def

ntpd_SOURCES = \
	cmd_args.c		\
	ntp_config.c		\
	ntp_data_structures.c	\
	ntp_keyword.h		\
	ntp_io.c		\
	ntp_parser.y		\
	ntp_scanner.c		\
	ntp_scanner.h		\
	ntpd.c			\
	ntpd-opts.c		\
	ntpd-opts.h		\
	$(NULL)

ntpdsim_SOURCES = \
	$(ntpd_SOURCES)		\
	ntpsim.c		\
	$(NULL)


# libntpd_a_SOURCES do not use #ifdef SIM
libntpd_a_SOURCES = \
	jupiter.h		\
	ntp_control.c		\
	ntp_crypto.c		\
	ntp_filegen.c		\
	ntp_intres.c		\
	ntp_loopfilter.c	\
	ntp_monitor.c		\
	ntp_peer.c		\
	ntp_proto.c		\
	ntp_refclock.c		\
	ntp_request.c		\
	ntp_restrict.c		\
	ntp_signd.c		\
	ntp_timer.c		\
	ntp_util.c		\
	ppsapi_timepps.h	\
	refclock_acts.c		\
	refclock_arbiter.c	\
	refclock_arc.c		\
	refclock_as2201.c	\
	refclock_atom.c		\
	refclock_bancomm.c	\
	refclock_chronolog.c	\
	refclock_chu.c		\
	refclock_conf.c		\
	refclock_datum.c	\
	refclock_dumbclock.c	\
	refclock_fg.c		\
	refclock_gpsvme.c	\
	refclock_heath.c	\
	refclock_hopfser.c	\
	refclock_hopfpci.c	\
	refclock_hpgps.c	\
	refclock_irig.c		\
	refclock_jjy.c		\
	refclock_jupiter.c	\
	refclock_leitch.c	\
	refclock_local.c	\
	refclock_mx4200.c	\
	refclock_neoclock4x.c	\
	refclock_nmea.c		\
	refclock_oncore.c	\
	refclock_palisade.c	\
	refclock_palisade.h	\
	refclock_parse.c	\
	refclock_pcf.c		\
	refclock_pst.c		\
	refclock_ripencc.c	\
	refclock_shm.c		\
	refclock_tpro.c		\
	refclock_true.c		\
	refclock_tt560.c	\
	refclock_ulink.c	\
	refclock_wwv.c		\
	refclock_wwvb.c		\
	refclock_zyfer.c	\
	$(NULL)

all: $(BUILT_SOURCES)
	$(MAKE) $(AM_MAKEFLAGS) all-am

.SUFFIXES:
.SUFFIXES: .c .lo .o .obj .y
$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf $(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 ntpd/Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --foreign ntpd/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):

clean-noinstLIBRARIES:
	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
libntpd.a: $(libntpd_a_OBJECTS) $(libntpd_a_DEPENDENCIES) 
	-rm -f libntpd.a
	$(libntpd_a_AR) libntpd.a $(libntpd_a_OBJECTS) $(libntpd_a_LIBADD)
	$(RANLIB) libntpd.a
install-binPROGRAMS: $(bin_PROGRAMS)
	@$(NORMAL_INSTALL)
	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
	for p in $$list; do echo "$$p $$p"; done | \
	sed 's/$(EXEEXT)$$//' | \
	while read p p1; do if test -f $$p || test -f $$p1; \
	  then echo "$$p"; echo "$$p"; else :; fi; \
	done | \
	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
	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; \
	    else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
	    } \
	; done

uninstall-binPROGRAMS:
	@$(NORMAL_UNINSTALL)
	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
	files=`for p in $$list; do echo "$$p"; done | \
	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
	      -e 's/$$/$(EXEEXT)/' `; \
	test -n "$$list" || exit 0; \
	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
	cd "$(DESTDIR)$(bindir)" && rm -f $$files

clean-binPROGRAMS:
	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
	echo " rm -f" $$list; \
	rm -f $$list || exit $$?; \
	test -n "$(EXEEXT)" || exit 0; \
	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
	echo " rm -f" $$list; \
	rm -f $$list

clean-checkPROGRAMS:
	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
	echo " rm -f" $$list; \
	rm -f $$list || exit $$?; \
	test -n "$(EXEEXT)" || exit 0; \
	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
	echo " rm -f" $$list; \
	rm -f $$list
install-sbinPROGRAMS: $(sbin_PROGRAMS)
	@$(NORMAL_INSTALL)
	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
	for p in $$list; do echo "$$p $$p"; done | \
	sed 's/$(EXEEXT)$$//' | \
	while read p p1; do if test -f $$p || test -f $$p1; \
	  then echo "$$p"; echo "$$p"; else :; fi; \
	done | \
	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
	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; \
	    else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
	    } \
	; done

uninstall-sbinPROGRAMS:
	@$(NORMAL_UNINSTALL)
	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
	files=`for p in $$list; do echo "$$p"; done | \
	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
	      -e 's/$$/$(EXEEXT)/' `; \
	test -n "$$list" || exit 0; \
	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
	cd "$(DESTDIR)$(sbindir)" && rm -f $$files

clean-sbinPROGRAMS:
	@list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
	echo " rm -f" $$list; \
	rm -f $$list || exit $$?; \
	test -n "$(EXEEXT)" || exit 0; \
	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
	echo " rm -f" $$list; \
	rm -f $$list
check_y2k$(EXEEXT): $(check_y2k_OBJECTS) $(check_y2k_DEPENDENCIES) 
	@rm -f check_y2k$(EXEEXT)
	$(LINK) $(check_y2k_OBJECTS) $(check_y2k_LDADD) $(LIBS)
keyword-gen$(EXEEXT): $(keyword_gen_OBJECTS) $(keyword_gen_DEPENDENCIES) 
	@rm -f keyword-gen$(EXEEXT)
	$(LINK) $(keyword_gen_OBJECTS) $(keyword_gen_LDADD) $(LIBS)
ntp_parser.h: ntp_parser.c
	@if test ! -f $@; then \
	  rm -f ntp_parser.c; \
	  $(MAKE) $(AM_MAKEFLAGS) ntp_parser.c; \
	else :; fi
ntpd$(EXEEXT): $(ntpd_OBJECTS) $(ntpd_DEPENDENCIES) 
	@rm -f ntpd$(EXEEXT)
	$(LINK) $(ntpd_OBJECTS) $(ntpd_LDADD) $(LIBS)
ntpdsim$(EXEEXT): $(ntpdsim_OBJECTS) $(ntpdsim_DEPENDENCIES) 
	@rm -f ntpdsim$(EXEEXT)
	$(ntpdsim_LINK) $(ntpdsim_OBJECTS) $(ntpdsim_LDADD) $(LIBS)

mostlyclean-compile:
	-rm -f *.$(OBJEXT)

distclean-compile:
	-rm -f *.tab.c

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_y2k.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd_args.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyword-gen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_config.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_control.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_crypto.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_data_structures.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_filegen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_intres.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_io.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_loopfilter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_monitor.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_parser.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_peer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_proto.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_refclock.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_request.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_restrict.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_scanner.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_signd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_timer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_util.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpd-opts.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-cmd_args.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_config.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_data_structures.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_io.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_parser.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_scanner.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntpd-opts.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntpd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntpsim.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_acts.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_arbiter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_arc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_as2201.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_atom.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_bancomm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_chronolog.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_chu.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_conf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_datum.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_dumbclock.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_fg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_gpsvme.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_heath.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_hopfpci.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_hopfser.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_hpgps.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_irig.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_jjy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_jupiter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_leitch.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_local.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_mx4200.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_neoclock4x.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_nmea.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_oncore.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_palisade.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_parse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_pcf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_pst.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_ripencc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_shm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_tpro.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_true.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_tt560.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_ulink.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_wwv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_wwvb.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_zyfer.Po@am__quote@

.c.o:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c $<

.c.obj:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`

.c.lo:
@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<

ntpdsim-cmd_args.o: cmd_args.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-cmd_args.o -MD -MP -MF $(DEPDIR)/ntpdsim-cmd_args.Tpo -c -o ntpdsim-cmd_args.o `test -f 'cmd_args.c' || echo '$(srcdir)/'`cmd_args.c
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-cmd_args.Tpo $(DEPDIR)/ntpdsim-cmd_args.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cmd_args.c' object='ntpdsim-cmd_args.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-cmd_args.o `test -f 'cmd_args.c' || echo '$(srcdir)/'`cmd_args.c

ntpdsim-cmd_args.obj: cmd_args.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-cmd_args.obj -MD -MP -MF $(DEPDIR)/ntpdsim-cmd_args.Tpo -c -o ntpdsim-cmd_args.obj `if test -f 'cmd_args.c'; then $(CYGPATH_W) 'cmd_args.c'; else $(CYGPATH_W) '$(srcdir)/cmd_args.c'; fi`
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-cmd_args.Tpo $(DEPDIR)/ntpdsim-cmd_args.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cmd_args.c' object='ntpdsim-cmd_args.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-cmd_args.obj `if test -f 'cmd_args.c'; then $(CYGPATH_W) 'cmd_args.c'; else $(CYGPATH_W) '$(srcdir)/cmd_args.c'; fi`

ntpdsim-ntp_config.o: ntp_config.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_config.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_config.Tpo -c -o ntpdsim-ntp_config.o `test -f 'ntp_config.c' || echo '$(srcdir)/'`ntp_config.c
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntp_config.Tpo $(DEPDIR)/ntpdsim-ntp_config.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntp_config.c' object='ntpdsim-ntp_config.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_config.o `test -f 'ntp_config.c' || echo '$(srcdir)/'`ntp_config.c

ntpdsim-ntp_config.obj: ntp_config.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_config.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_config.Tpo -c -o ntpdsim-ntp_config.obj `if test -f 'ntp_config.c'; then $(CYGPATH_W) 'ntp_config.c'; else $(CYGPATH_W) '$(srcdir)/ntp_config.c'; fi`
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntp_config.Tpo $(DEPDIR)/ntpdsim-ntp_config.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntp_config.c' object='ntpdsim-ntp_config.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_config.obj `if test -f 'ntp_config.c'; then $(CYGPATH_W) 'ntp_config.c'; else $(CYGPATH_W) '$(srcdir)/ntp_config.c'; fi`

ntpdsim-ntp_data_structures.o: ntp_data_structures.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_data_structures.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_data_structures.Tpo -c -o ntpdsim-ntp_data_structures.o `test -f 'ntp_data_structures.c' || echo '$(srcdir)/'`ntp_data_structures.c
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntp_data_structures.Tpo $(DEPDIR)/ntpdsim-ntp_data_structures.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntp_data_structures.c' object='ntpdsim-ntp_data_structures.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_data_structures.o `test -f 'ntp_data_structures.c' || echo '$(srcdir)/'`ntp_data_structures.c

ntpdsim-ntp_data_structures.obj: ntp_data_structures.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_data_structures.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_data_structures.Tpo -c -o ntpdsim-ntp_data_structures.obj `if test -f 'ntp_data_structures.c'; then $(CYGPATH_W) 'ntp_data_structures.c'; else $(CYGPATH_W) '$(srcdir)/ntp_data_structures.c'; fi`
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntp_data_structures.Tpo $(DEPDIR)/ntpdsim-ntp_data_structures.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntp_data_structures.c' object='ntpdsim-ntp_data_structures.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_data_structures.obj `if test -f 'ntp_data_structures.c'; then $(CYGPATH_W) 'ntp_data_structures.c'; else $(CYGPATH_W) '$(srcdir)/ntp_data_structures.c'; fi`

ntpdsim-ntp_io.o: ntp_io.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_io.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_io.Tpo -c -o ntpdsim-ntp_io.o `test -f 'ntp_io.c' || echo '$(srcdir)/'`ntp_io.c
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntp_io.Tpo $(DEPDIR)/ntpdsim-ntp_io.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntp_io.c' object='ntpdsim-ntp_io.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_io.o `test -f 'ntp_io.c' || echo '$(srcdir)/'`ntp_io.c

ntpdsim-ntp_io.obj: ntp_io.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_io.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_io.Tpo -c -o ntpdsim-ntp_io.obj `if test -f 'ntp_io.c'; then $(CYGPATH_W) 'ntp_io.c'; else $(CYGPATH_W) '$(srcdir)/ntp_io.c'; fi`
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntp_io.Tpo $(DEPDIR)/ntpdsim-ntp_io.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntp_io.c' object='ntpdsim-ntp_io.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_io.obj `if test -f 'ntp_io.c'; then $(CYGPATH_W) 'ntp_io.c'; else $(CYGPATH_W) '$(srcdir)/ntp_io.c'; fi`

ntpdsim-ntp_parser.o: ntp_parser.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_parser.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_parser.Tpo -c -o ntpdsim-ntp_parser.o `test -f 'ntp_parser.c' || echo '$(srcdir)/'`ntp_parser.c
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntp_parser.Tpo $(DEPDIR)/ntpdsim-ntp_parser.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntp_parser.c' object='ntpdsim-ntp_parser.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_parser.o `test -f 'ntp_parser.c' || echo '$(srcdir)/'`ntp_parser.c

ntpdsim-ntp_parser.obj: ntp_parser.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_parser.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_parser.Tpo -c -o ntpdsim-ntp_parser.obj `if test -f 'ntp_parser.c'; then $(CYGPATH_W) 'ntp_parser.c'; else $(CYGPATH_W) '$(srcdir)/ntp_parser.c'; fi`
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntp_parser.Tpo $(DEPDIR)/ntpdsim-ntp_parser.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntp_parser.c' object='ntpdsim-ntp_parser.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_parser.obj `if test -f 'ntp_parser.c'; then $(CYGPATH_W) 'ntp_parser.c'; else $(CYGPATH_W) '$(srcdir)/ntp_parser.c'; fi`

ntpdsim-ntp_scanner.o: ntp_scanner.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_scanner.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_scanner.Tpo -c -o ntpdsim-ntp_scanner.o `test -f 'ntp_scanner.c' || echo '$(srcdir)/'`ntp_scanner.c
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntp_scanner.Tpo $(DEPDIR)/ntpdsim-ntp_scanner.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntp_scanner.c' object='ntpdsim-ntp_scanner.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_scanner.o `test -f 'ntp_scanner.c' || echo '$(srcdir)/'`ntp_scanner.c

ntpdsim-ntp_scanner.obj: ntp_scanner.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_scanner.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_scanner.Tpo -c -o ntpdsim-ntp_scanner.obj `if test -f 'ntp_scanner.c'; then $(CYGPATH_W) 'ntp_scanner.c'; else $(CYGPATH_W) '$(srcdir)/ntp_scanner.c'; fi`
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntp_scanner.Tpo $(DEPDIR)/ntpdsim-ntp_scanner.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntp_scanner.c' object='ntpdsim-ntp_scanner.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_scanner.obj `if test -f 'ntp_scanner.c'; then $(CYGPATH_W) 'ntp_scanner.c'; else $(CYGPATH_W) '$(srcdir)/ntp_scanner.c'; fi`

ntpdsim-ntpd.o: ntpd.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntpd.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntpd.Tpo -c -o ntpdsim-ntpd.o `test -f 'ntpd.c' || echo '$(srcdir)/'`ntpd.c
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntpd.Tpo $(DEPDIR)/ntpdsim-ntpd.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntpd.c' object='ntpdsim-ntpd.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpd.o `test -f 'ntpd.c' || echo '$(srcdir)/'`ntpd.c

ntpdsim-ntpd.obj: ntpd.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntpd.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntpd.Tpo -c -o ntpdsim-ntpd.obj `if test -f 'ntpd.c'; then $(CYGPATH_W) 'ntpd.c'; else $(CYGPATH_W) '$(srcdir)/ntpd.c'; fi`
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntpd.Tpo $(DEPDIR)/ntpdsim-ntpd.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntpd.c' object='ntpdsim-ntpd.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpd.obj `if test -f 'ntpd.c'; then $(CYGPATH_W) 'ntpd.c'; else $(CYGPATH_W) '$(srcdir)/ntpd.c'; fi`

ntpdsim-ntpd-opts.o: ntpd-opts.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntpd-opts.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntpd-opts.Tpo -c -o ntpdsim-ntpd-opts.o `test -f 'ntpd-opts.c' || echo '$(srcdir)/'`ntpd-opts.c
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntpd-opts.Tpo $(DEPDIR)/ntpdsim-ntpd-opts.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntpd-opts.c' object='ntpdsim-ntpd-opts.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpd-opts.o `test -f 'ntpd-opts.c' || echo '$(srcdir)/'`ntpd-opts.c

ntpdsim-ntpd-opts.obj: ntpd-opts.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntpd-opts.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntpd-opts.Tpo -c -o ntpdsim-ntpd-opts.obj `if test -f 'ntpd-opts.c'; then $(CYGPATH_W) 'ntpd-opts.c'; else $(CYGPATH_W) '$(srcdir)/ntpd-opts.c'; fi`
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntpd-opts.Tpo $(DEPDIR)/ntpdsim-ntpd-opts.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntpd-opts.c' object='ntpdsim-ntpd-opts.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpd-opts.obj `if test -f 'ntpd-opts.c'; then $(CYGPATH_W) 'ntpd-opts.c'; else $(CYGPATH_W) '$(srcdir)/ntpd-opts.c'; fi`

ntpdsim-ntpsim.o: ntpsim.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntpsim.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntpsim.Tpo -c -o ntpdsim-ntpsim.o `test -f 'ntpsim.c' || echo '$(srcdir)/'`ntpsim.c
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntpsim.Tpo $(DEPDIR)/ntpdsim-ntpsim.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntpsim.c' object='ntpdsim-ntpsim.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpsim.o `test -f 'ntpsim.c' || echo '$(srcdir)/'`ntpsim.c

ntpdsim-ntpsim.obj: ntpsim.c
@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -MT ntpdsim-ntpsim.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntpsim.Tpo -c -o ntpdsim-ntpsim.obj `if test -f 'ntpsim.c'; then $(CYGPATH_W) 'ntpsim.c'; else $(CYGPATH_W) '$(srcdir)/ntpsim.c'; fi`
@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ntpdsim-ntpsim.Tpo $(DEPDIR)/ntpdsim-ntpsim.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntpsim.c' object='ntpdsim-ntpsim.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ntpdsim_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpsim.obj `if test -f 'ntpsim.c'; then $(CYGPATH_W) 'ntpsim.c'; else $(CYGPATH_W) '$(srcdir)/ntpsim.c'; fi`

.y.c:
	$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
install-man1: $(man_MANS)
	@$(NORMAL_INSTALL)
	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
	@list=''; 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=''; 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; }

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	set x; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	shift; \
	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  if test $$# -gt 0; then \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      "$$@" $$unique; \
	  else \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      $$unique; \
	  fi; \
	fi
ctags: CTAGS
CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && $(am__cd) $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) "$$here"

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

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
	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
	$(MAKE) $(AM_MAKEFLAGS) check-local
check: $(BUILT_SOURCES)
	$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) $(DATA)
installdirs:
	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)"; do \
	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
	done
install: $(BUILT_SOURCES)
	$(MAKE) $(AM_MAKEFLAGS) 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:
	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)

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."
	-rm -f ntp_parser.c
	-rm -f ntp_parser.h
	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am

clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
	clean-libtool clean-noinstLIBRARIES clean-sbinPROGRAMS \
	mostlyclean-am

distclean: distclean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
	distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

html-am:

info: info-am

info-am:

install-data-am: install-man

install-dvi: install-dvi-am

install-dvi-am:

install-exec-am: install-binPROGRAMS install-sbinPROGRAMS
	@$(NORMAL_INSTALL)
	$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
install-html: install-html-am

install-html-am:

install-info: install-info-am

install-info-am:

install-man: install-man1

install-pdf: install-pdf-am

install-pdf-am:

install-ps: install-ps-am

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-compile mostlyclean-generic \
	mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-binPROGRAMS uninstall-man \
	uninstall-sbinPROGRAMS

uninstall-man: uninstall-man1

.MAKE: all check check-am install install-am install-exec-am \
	install-strip

.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
	clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
	clean-libtool clean-noinstLIBRARIES clean-sbinPROGRAMS ctags \
	distclean distclean-compile distclean-generic \
	distclean-libtool distclean-tags distdir dvi dvi-am html \
	html-am info info-am install install-am install-binPROGRAMS \
	install-data install-data-am install-dvi install-dvi-am \
	install-exec install-exec-am install-exec-hook install-html \
	install-html-am install-info install-info-am install-man \
	install-man1 install-pdf install-pdf-am install-ps \
	install-ps-am install-sbinPROGRAMS install-strip installcheck \
	installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-compile \
	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
	tags uninstall uninstall-am uninstall-binPROGRAMS \
	uninstall-man uninstall-man1 uninstall-sbinPROGRAMS


vphack:
	test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c .
	test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h .

#
# ylwrap script which invokes Bison replaces ntp_parser.h
# symlink with the updated file, when ntp_parser.h changes.
# vphack_after detects this and copies the updated file to srcdir 
# and re-creates the ntp_parser.h symlink in its place.
#

vphack_after:
	test -L ntp_parser.h || ( \
		mv ntp_parser.h $(srcdir)/ntp_parser.h && \
		ln -s $(srcdir)/ntp_parser.h . \
		)

check-local: @MAKE_CHECK_Y2K@ $(CHECK_SAVECONFIG)
	test -z "@MAKE_CHECK_Y2K@" || ./@MAKE_CHECK_Y2K@

k-g-u-submake: keyword-gen
	./keyword-gen $(srcdir)/ntp_parser.h > k-g.out
	@grep -v diff_ignore_line < k-g.out > cmp1
	@grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2
	@cmp cmp1 cmp2 > /dev/null || \
		{ mv -f k-g.out $(srcdir)/ntp_keyword.h && \
		  echo 'Generated changed ntp_keyword.h.' ;}
	@[ ! -f k-g.out ] || \
		{ rm k-g.out && echo 'ntp_keyword.h is up to date.' ;}
	@rm cmp1 cmp2
	@echo 'keyword-gen and ntp_keyword.h are up to date.' > $@

$(srcdir)/keyword-gen-utd: $(srcdir)/keyword-gen.c $(srcdir)/ntp_parser.h
	$(MAKE) k-g-u-submake	# avoid explicit dependency
	grep diff_ignore_line $(srcdir)/ntp_keyword.h > k-g-u
	mv -f k-g-u $@

$(srcdir)/ntp_keyword.h: $(srcdir)/keyword-gen-utd
	@: do-nothing action to avoid default SCCS get
	@: .h updated if needed by k-g-u-submake rule

$(srcdir)/ntpd-opts.h: $(srcdir)/ntpd-opts.c
	@: do-nothing action to avoid default SCCS get, .h built with .c

$(srcdir)/ntpd-opts.c: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
	$(run_ag) ntpd-opts.def

$(srcdir)/ntpd.1: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
	$(run_ag) -Tagman1.tpl -bntpd ntpd-opts.def

$(srcdir)/ntpd-opts.menu: $(srcdir)/ntpd-opts.texi
	@: do-nothing action to avoid default SCCS get, .menu built with .texi

$(srcdir)/ntpd-opts.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
	$(run_ag) -Taginfo.tpl -DLEVEL=section ntpd-opts.def
	$(top_srcdir)/scripts/check--help $@

$(PROGRAMS): $(LDADD)

compsave.conf: ntpd $(srcdir)/complete.conf
	./ntpd --configfile $(srcdir)/complete.conf --saveconfigquit $@

check-saveconfig: $(srcdir)/complete.conf compsave.conf
	cmp $(srcdir)/complete.conf compsave.conf && echo stamp > $@

../libopts/libopts.la:
	cd ../libopts && $(MAKE) libopts.la

../libntp/libntp.a:
	cd ../libntp && $(MAKE) libntp.a

../libparse/libparse.a:
	cd ../libparse && $(MAKE) libparse.a

$(top_srcdir)/version:
	cd $(top_srcdir) && $(MAKE) version

version.o: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/version
	env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpd
	$(COMPILE) -c version.c

install-exec-hook:
	@case ${BINSUBDIR} in						\
	 bin) ODIR=${sbindir} ;;					\
	 sbin) ODIR=${bindir} ;;					\
	esac;								\
	test -z "${bin_PROGRAMS}${bin_SCRIPTS}"				\
	|| for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do		\
	   test ! -f $$ODIR/$$i || echo "*** $$i is also in $$ODIR!";	\
	done

#
$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
	@[ -f $@ ] ||							\
		cp $(top_srcdir)/deps-ver $@
	@[ -w $@ ] ||							\
		chmod ug+w $@
	@cmp $(top_srcdir)/deps-ver $@ > /dev/null || (			\
		$(MAKE) clean &&					\
		echo -n "Prior $(subdir)/$(DEPDIR) version " &&		\
		cat $@ &&						\
		rm -rf $(DEPDIR) &&					\
		mkdir $(DEPDIR) && 					\
		case "$(top_builddir)" in				\
		 .)							\
		    ./config.status Makefile depfiles			\
		    ;;							\
		 ..)							\
			cd .. &&					\
			./config.status $(subdir)/Makefile depfiles &&	\
			cd $(subdir)					\
		    ;;							\
		 *)							\
		    echo 'Fatal: depsver.mf Automake fragment limited'	\
			 'to immediate subdirectories.'	&&		\
		    echo "top_builddir:	$(top_builddir)" &&		\
		    echo "subdir:	$(subdir)" &&			\
		    exit 1						\
		    ;;							\
		esac &&							\
		echo -n "Cleaned $(subdir)/$(DEPDIR) version " &&	\
		cat $(top_srcdir)/deps-ver				\
	)
	cp $(top_srcdir)/deps-ver $@

.deps-ver: $(top_srcdir)/deps-ver
	@[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver
	@touch $@

#
# depsver.mf	included in Makefile.am for directories with .deps
#
# When building in the same directory with sources that change over
# time, such as when tracking using bk, the .deps files can become
# stale with respect to moved, deleted, or superceded headers.  Most
# commonly, this would exhibit as make reporting a failure to make a
# header file which is no longer in the location given.  To address
# this issue, we use a deps-ver file which is updated with each change
# that breaks old .deps files.  A copy of deps-ver is made into
# $(DEPDIR) if not already present.  If $(DEPDIR)/deps-ver is present
# with different contents than deps-ver, we make clean to ensure all
# .o files built before the incompatible change are rebuilt along with
# their updated .deps files, then remove $(DEPDIR) and recreate it as
# empty stubs.
#
# It is normal when configured with --disable-dependency-tracking for
# the DEPDIR to not have been created.  For this reason, we use the
# intermediate target .deps-ver, which invokes make recursively if
# DEPDIR exists.
#
# If you modify depsver.mf, please make the changes to the master
# copy, the one in sntp is copied by the bootstrap script from it.
#
# This comment block follows rather than leads the related code so that
# it stays with it in the generated Makefile.in and Makefile.
#

# 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:
ntp-4.2.6p5/ntpd/complete.conf0000644000175000017500000000466511636775106015264 0ustar  peterpetersaveconfigdir "/etc/ntp/conf"
driftfile "/etc/ntp.drift"
logfile "/var/log/ntp.log"
logconfig =allall -allinfo -allevents -allstatistics -allstatus +allall -clockinfo -clockevents -clockstatistics -clockstatus +clockall -syncinfo -syncevents -syncstatistics -syncstatus +syncall -sysinfo -sysevents -sysstatistics -sysstatus +sysall
statsdir "/etc/ntp/stats"
statistics loopstats peerstats
filegen clockstats file clockstats type none enable
filegen cryptostats file cryptostats type pid link disable
filegen loopstats file loopstats type day nolink enable
filegen peerstats file peerstats type week enable
filegen protostats file stats type month enable
filegen rawstats file rawstats type year nolink enable
filegen sysstats file sysstats type age enable
filegen timingstats file timingstats type none disable
crypto digest md5 host myhostname ident wedent pw cryptopass randfile /.rnd
revoke 10
keysdir "/etc/ntp/keys"
keys "/etc/ntp.keys"
trustedkey 1 2 3 4 5 6 7 8 9 10 11 12 (14 ... 16) 18 (32768 ... 65534)
controlkey 12
requestkey 12
enable auth ntp monitor
disable bclient calibrate kernel
tos beacon 3600 ceiling 16 cohort 0 floor 1 maxclock 10 maxdist 1.5 minclock 3 mindist 0.001 minsane 1 orphan 16
tinker allan 1500 dispersion 15 freq 0 huffpuff 7200 panic 1000 step 0.128 stepout 900
broadcastclient
server 127.127.1.0 mode 64 prefer true
fudge 127.127.1.0 time1 0 time2 1.1 stratum 7 refid Abcd
pool 0.north-america.pool.ntp.org. iburst preempt
server 1.north-america.pool.ntp.org. iburst
server -4 2.north-america.pool.ntp.org. minpoll 6 maxpoll 10 iburst
server -6 ntp.davehart.net. minpoll 6 maxpoll 10 version 5 burst iburst
peer -6 davehart.broker.freenet6.net. xleave autokey
peer -4 192.168.192.168 key 1 bias 3.1416 noselect
broadcast 192.168.192.255
manycastclient 224.0.1.1
manycastclient ff05::101
manycastserver 224.0.1.1 ff05::101
multicastclient 224.0.1.1 ff05::101
discard minimum 1 average 3 monitor 1
restrict default nomodify limited kod
restrict trusted.host.name.example.com. nomodify
restrict [fe80::1] mask [ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]
restrict 127.0.0.1 mask 255.255.255.255
restrict ::1
interface drop ipv6
interface ignore ipv4
interface drop wildcard
interface listen eth0
interface listen ipv6
interface listen 192.168.192.0/24
interface listen 192.168.193.1
setvar varnondef = "this variable does not have default after the value"
setvar vanity = "name plate" default
trap 127.0.0.1 interface 127.0.0.1 port 1234
trap 127.0.0.2
ntp-4.2.6p5/ntpd/ntp_request.c0000644000175000017500000022155311665566225015321 0ustar  peterpeter/*
 * ntp_request.c - respond to information requests
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_request.h"
#include "ntp_control.h"
#include "ntp_refclock.h"
#include "ntp_if.h"
#include "ntp_stdlib.h"
#include "ntp_assert.h"

#include 
#include 
#include 
#ifdef HAVE_NETINET_IN_H
#include 
#endif
#include 

#include "recvbuff.h"

#ifdef KERNEL_PLL
#include "ntp_syscall.h"
#endif /* KERNEL_PLL */

/*
 * Structure to hold request procedure information
 */
#define	NOAUTH	0
#define	AUTH	1

#define	NO_REQUEST	(-1)
/*
 * Because we now have v6 addresses in the messages, we need to compensate
 * for the larger size.  Therefore, we introduce the alternate size to 
 * keep us friendly with older implementations.  A little ugly.
 */
static int client_v6_capable = 0;   /* the client can handle longer messages */

#define v6sizeof(type)	(client_v6_capable ? sizeof(type) : v4sizeof(type))

struct req_proc {
	short request_code;	/* defined request code */
	short needs_auth;	/* true when authentication needed */
	short sizeofitem;	/* size of request data item (older size)*/
	short v6_sizeofitem;	/* size of request data item (new size)*/
	void (*handler) (sockaddr_u *, struct interface *,
			   struct req_pkt *);	/* routine to handle request */
};

/*
 * Universal request codes
 */
static	struct req_proc univ_codes[] = {
	{ NO_REQUEST,		NOAUTH,	 0,	0 }
};

static	void	req_ack	(sockaddr_u *, struct interface *, struct req_pkt *, int);
static	char *	prepare_pkt	(sockaddr_u *, struct interface *,
				 struct req_pkt *, size_t);
static	char *	more_pkt	(void);
static	void	flush_pkt	(void);
static	void	peer_list	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	peer_list_sum	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	peer_info	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	peer_stats	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	sys_info	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	sys_stats	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	mem_stats	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	io_stats	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	timer_stats	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	loop_info	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	do_conf		(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	do_unconf	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	set_sys_flag	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	clr_sys_flag	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	setclr_flags	(sockaddr_u *, struct interface *, struct req_pkt *, u_long);
static	void	list_restrict	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	do_resaddflags	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	do_ressubflags	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	do_unrestrict	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	do_restrict	(sockaddr_u *, struct interface *, struct req_pkt *, int);
static	void	mon_getlist_0	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	mon_getlist_1	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	reset_stats	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	reset_peer	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	do_key_reread	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	trust_key	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	untrust_key	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	do_trustkey	(sockaddr_u *, struct interface *, struct req_pkt *, u_long);
static	void	get_auth_info	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	reset_auth_stats (void);
static	void	req_get_traps	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	req_set_trap	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	req_clr_trap	(sockaddr_u *, struct interface *, struct req_pkt *);
static	void	do_setclr_trap	(sockaddr_u *, struct interface *, struct req_pkt *, int);
static	void	set_request_keyid (sockaddr_u *, struct interface *, struct req_pkt *);
static	void	set_control_keyid (sockaddr_u *, struct interface *, struct req_pkt *);
static	void	get_ctl_stats   (sockaddr_u *, struct interface *, struct req_pkt *);
static	void	get_if_stats    (sockaddr_u *, struct interface *, struct req_pkt *);
static	void	do_if_reload    (sockaddr_u *, struct interface *, struct req_pkt *);
#ifdef KERNEL_PLL
static	void	get_kernel_info (sockaddr_u *, struct interface *, struct req_pkt *);
#endif /* KERNEL_PLL */
#ifdef REFCLOCK
static	void	get_clock_info (sockaddr_u *, struct interface *, struct req_pkt *);
static	void	set_clock_fudge (sockaddr_u *, struct interface *, struct req_pkt *);
#endif	/* REFCLOCK */
#ifdef REFCLOCK
static	void	get_clkbug_info (sockaddr_u *, struct interface *, struct req_pkt *);
#endif	/* REFCLOCK */

/*
 * ntpd request codes
 */
static	struct req_proc ntp_codes[] = {
	{ REQ_PEER_LIST,	NOAUTH,	0, 0,	peer_list },
	{ REQ_PEER_LIST_SUM,	NOAUTH,	0, 0,	peer_list_sum },
	{ REQ_PEER_INFO,    NOAUTH, v4sizeof(struct info_peer_list),
				sizeof(struct info_peer_list), peer_info},
	{ REQ_PEER_STATS,   NOAUTH, v4sizeof(struct info_peer_list),
				sizeof(struct info_peer_list), peer_stats},
	{ REQ_SYS_INFO,		NOAUTH,	0, 0,	sys_info },
	{ REQ_SYS_STATS,	NOAUTH,	0, 0,	sys_stats },
	{ REQ_IO_STATS,		NOAUTH,	0, 0,	io_stats },
	{ REQ_MEM_STATS,	NOAUTH,	0, 0,	mem_stats },
	{ REQ_LOOP_INFO,	NOAUTH,	0, 0,	loop_info },
	{ REQ_TIMER_STATS,	NOAUTH,	0, 0,	timer_stats },
	{ REQ_CONFIG,	    AUTH, v4sizeof(struct conf_peer),
				sizeof(struct conf_peer), do_conf },
	{ REQ_UNCONFIG,	    AUTH, v4sizeof(struct conf_unpeer),
				sizeof(struct conf_unpeer), do_unconf },
	{ REQ_SET_SYS_FLAG, AUTH, sizeof(struct conf_sys_flags),
				sizeof(struct conf_sys_flags), set_sys_flag },
	{ REQ_CLR_SYS_FLAG, AUTH, sizeof(struct conf_sys_flags), 
				sizeof(struct conf_sys_flags),  clr_sys_flag },
	{ REQ_GET_RESTRICT,	NOAUTH,	0, 0,	list_restrict },
	{ REQ_RESADDFLAGS, AUTH, v4sizeof(struct conf_restrict),
				sizeof(struct conf_restrict), do_resaddflags },
	{ REQ_RESSUBFLAGS, AUTH, v4sizeof(struct conf_restrict),
				sizeof(struct conf_restrict), do_ressubflags },
	{ REQ_UNRESTRICT, AUTH, v4sizeof(struct conf_restrict),
				sizeof(struct conf_restrict), do_unrestrict },
	{ REQ_MON_GETLIST,	NOAUTH,	0, 0,	mon_getlist_0 },
	{ REQ_MON_GETLIST_1,	NOAUTH,	0, 0,	mon_getlist_1 },
	{ REQ_RESET_STATS, AUTH, sizeof(struct reset_flags), 0, reset_stats },
	{ REQ_RESET_PEER,  AUTH, v4sizeof(struct conf_unpeer),
				sizeof(struct conf_unpeer), reset_peer },
	{ REQ_REREAD_KEYS,	AUTH,	0, 0,	do_key_reread },
	{ REQ_TRUSTKEY,   AUTH, sizeof(u_long), sizeof(u_long), trust_key },
	{ REQ_UNTRUSTKEY, AUTH, sizeof(u_long), sizeof(u_long), untrust_key },
	{ REQ_AUTHINFO,		NOAUTH,	0, 0,	get_auth_info },
	{ REQ_TRAPS,		NOAUTH, 0, 0,	req_get_traps },
	{ REQ_ADD_TRAP,	AUTH, v4sizeof(struct conf_trap),
				sizeof(struct conf_trap), req_set_trap },
	{ REQ_CLR_TRAP,	AUTH, v4sizeof(struct conf_trap),
				sizeof(struct conf_trap), req_clr_trap },
	{ REQ_REQUEST_KEY, AUTH, sizeof(u_long), sizeof(u_long), 
				set_request_keyid },
	{ REQ_CONTROL_KEY, AUTH, sizeof(u_long), sizeof(u_long), 
				set_control_keyid },
	{ REQ_GET_CTLSTATS,	NOAUTH,	0, 0,	get_ctl_stats },
#ifdef KERNEL_PLL
	{ REQ_GET_KERNEL,	NOAUTH,	0, 0,	get_kernel_info },
#endif
#ifdef REFCLOCK
	{ REQ_GET_CLOCKINFO, NOAUTH, sizeof(u_int32), sizeof(u_int32), 
				get_clock_info },
	{ REQ_SET_CLKFUDGE, AUTH, sizeof(struct conf_fudge), 
				sizeof(struct conf_fudge), set_clock_fudge },
	{ REQ_GET_CLKBUGINFO, NOAUTH, sizeof(u_int32), sizeof(u_int32),
				get_clkbug_info },
#endif
	{ REQ_IF_STATS,		AUTH, 0, 0,	get_if_stats },
	{ REQ_IF_RELOAD,        AUTH, 0, 0,	do_if_reload },

	{ NO_REQUEST,		NOAUTH,	0, 0,	0 }
};


/*
 * Authentication keyid used to authenticate requests.  Zero means we
 * don't allow writing anything.
 */
keyid_t info_auth_keyid;

/*
 * Statistic counters to keep track of requests and responses.
 */
u_long numrequests;		/* number of requests we've received */
u_long numresppkts;		/* number of resp packets sent with data */

u_long errorcounter[INFO_ERR_AUTH+1];	/* lazy way to count errors, indexed */
/* by the error code */

/*
 * A hack.  To keep the authentication module clear of ntp-ism's, we
 * include a time reset variable for its stats here.
 */
static u_long auth_timereset;

/*
 * Response packet used by these routines.  Also some state information
 * so that we can handle packet formatting within a common set of
 * subroutines.  Note we try to enter data in place whenever possible,
 * but the need to set the more bit correctly means we occasionally
 * use the extra buffer and copy.
 */
static struct resp_pkt rpkt;
static int reqver;
static int seqno;
static int nitems;
static int itemsize;
static int databytes;
static char exbuf[RESP_DATA_SIZE];
static int usingexbuf;
static sockaddr_u *toaddr;
static struct interface *frominter;

/*
 * init_request - initialize request data
 */
void
init_request (void)
{
	int i;

	numrequests = 0;
	numresppkts = 0;
	auth_timereset = 0;
	info_auth_keyid = 0;	/* by default, can't do this */

	for (i = 0; i < sizeof(errorcounter)/sizeof(errorcounter[0]); i++)
	    errorcounter[i] = 0;
}


/*
 * req_ack - acknowledge request with no data
 */
static void
req_ack(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt,
	int errcode
	)
{
	/*
	 * fill in the fields
	 */
	rpkt.rm_vn_mode = RM_VN_MODE(RESP_BIT, 0, reqver);
	rpkt.auth_seq = AUTH_SEQ(0, 0);
	rpkt.implementation = inpkt->implementation;
	rpkt.request = inpkt->request;
	rpkt.err_nitems = ERR_NITEMS(errcode, 0);
	rpkt.mbz_itemsize = MBZ_ITEMSIZE(0);

	/*
	 * send packet and bump counters
	 */
	sendpkt(srcadr, inter, -1, (struct pkt *)&rpkt, RESP_HEADER_SIZE);
	errorcounter[errcode]++;
}


/*
 * prepare_pkt - prepare response packet for transmission, return pointer
 *		 to storage for data item.
 */
static char *
prepare_pkt(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *pkt,
	size_t structsize
	)
{
	DPRINTF(4, ("request: preparing pkt\n"));

	/*
	 * Fill in the implementation, request and itemsize fields
	 * since these won't change.
	 */
	rpkt.implementation = pkt->implementation;
	rpkt.request = pkt->request;
	rpkt.mbz_itemsize = MBZ_ITEMSIZE(structsize);

	/*
	 * Compute the static data needed to carry on.
	 */
	toaddr = srcadr;
	frominter = inter;
	seqno = 0;
	nitems = 0;
	itemsize = structsize;
	databytes = 0;
	usingexbuf = 0;

	/*
	 * return the beginning of the packet buffer.
	 */
	return &rpkt.data[0];
}


/*
 * more_pkt - return a data pointer for a new item.
 */
static char *
more_pkt(void)
{
	/*
	 * If we were using the extra buffer, send the packet.
	 */
	if (usingexbuf) {
		DPRINTF(3, ("request: sending pkt\n"));
		rpkt.rm_vn_mode = RM_VN_MODE(RESP_BIT, MORE_BIT, reqver);
		rpkt.auth_seq = AUTH_SEQ(0, seqno);
		rpkt.err_nitems = htons((u_short)nitems);
		sendpkt(toaddr, frominter, -1, (struct pkt *)&rpkt,
			RESP_HEADER_SIZE + databytes);
		numresppkts++;

		/*
		 * Copy data out of exbuf into the packet.
		 */
		memcpy(&rpkt.data[0], exbuf, (unsigned)itemsize);
		seqno++;
		databytes = 0;
		nitems = 0;
		usingexbuf = 0;
	}

	databytes += itemsize;
	nitems++;
	if (databytes + itemsize <= RESP_DATA_SIZE) {
		DPRINTF(4, ("request: giving him more data\n"));
		/*
		 * More room in packet.  Give him the
		 * next address.
		 */
		return &rpkt.data[databytes];
	} else {
		/*
		 * No room in packet.  Give him the extra
		 * buffer unless this was the last in the sequence.
		 */
		DPRINTF(4, ("request: into extra buffer\n"));
		if (seqno == MAXSEQ)
			return NULL;
		else {
			usingexbuf = 1;
			return exbuf;
		}
	}
}


/*
 * flush_pkt - we're done, return remaining information.
 */
static void
flush_pkt(void)
{
	DPRINTF(3, ("request: flushing packet, %d items\n", nitems));
	/*
	 * Must send the last packet.  If nothing in here and nothing
	 * has been sent, send an error saying no data to be found.
	 */
	if (seqno == 0 && nitems == 0)
		req_ack(toaddr, frominter, (struct req_pkt *)&rpkt,
			INFO_ERR_NODATA);
	else {
		rpkt.rm_vn_mode = RM_VN_MODE(RESP_BIT, 0, reqver);
		rpkt.auth_seq = AUTH_SEQ(0, seqno);
		rpkt.err_nitems = htons((u_short)nitems);
		sendpkt(toaddr, frominter, -1, (struct pkt *)&rpkt,
			RESP_HEADER_SIZE+databytes);
		numresppkts++;
	}
}



/*
 * Given a buffer, return the packet mode
 */
int
get_packet_mode(struct recvbuf *rbufp)
{
	struct req_pkt *inpkt = (struct req_pkt *)&rbufp->recv_pkt;
	return (INFO_MODE(inpkt->rm_vn_mode));
}


/*
 * process_private - process private mode (7) packets
 */
void
process_private(
	struct recvbuf *rbufp,
	int mod_okay
	)
{
	static u_long quiet_until;
	struct req_pkt *inpkt;
	struct req_pkt_tail *tailinpkt;
	sockaddr_u *srcadr;
	struct interface *inter;
	struct req_proc *proc;
	int ec;
	short temp_size;
	l_fp ftmp;
	double dtemp;
	size_t recv_len;
	size_t noslop_len;
	size_t mac_len;

	/*
	 * Initialize pointers, for convenience
	 */
	recv_len = rbufp->recv_length;
	inpkt = (struct req_pkt *)&rbufp->recv_pkt;
	srcadr = &rbufp->recv_srcadr;
	inter = rbufp->dstadr;

	DPRINTF(3, ("process_private: impl %d req %d\n",
		    inpkt->implementation, inpkt->request));

	/*
	 * Do some sanity checks on the packet.  Return a format
	 * error if it fails.
	 */
	ec = 0;
	if (   (++ec, ISRESPONSE(inpkt->rm_vn_mode))
	    || (++ec, ISMORE(inpkt->rm_vn_mode))
	    || (++ec, INFO_VERSION(inpkt->rm_vn_mode) > NTP_VERSION)
	    || (++ec, INFO_VERSION(inpkt->rm_vn_mode) < NTP_OLDVERSION)
	    || (++ec, INFO_SEQ(inpkt->auth_seq) != 0)
	    || (++ec, INFO_ERR(inpkt->err_nitems) != 0)
	    || (++ec, INFO_MBZ(inpkt->mbz_itemsize) != 0)
	    || (++ec, rbufp->recv_length < REQ_LEN_HDR)
		) {
		NLOG(NLOG_SYSEVENT)
			if (current_time >= quiet_until) {
				msyslog(LOG_ERR,
					"process_private: drop test %d"
					" failed, pkt from %s",
					ec, stoa(srcadr));
				quiet_until = current_time + 60;
			}
		return;
	}

	reqver = INFO_VERSION(inpkt->rm_vn_mode);

	/*
	 * Get the appropriate procedure list to search.
	 */
	if (inpkt->implementation == IMPL_UNIV)
		proc = univ_codes;
	else if ((inpkt->implementation == IMPL_XNTPD) ||
		 (inpkt->implementation == IMPL_XNTPD_OLD))
		proc = ntp_codes;
	else {
		req_ack(srcadr, inter, inpkt, INFO_ERR_IMPL);
		return;
	}

	/*
	 * Search the list for the request codes.  If it isn't one
	 * we know, return an error.
	 */
	while (proc->request_code != NO_REQUEST) {
		if (proc->request_code == (short) inpkt->request)
			break;
		proc++;
	}
	if (proc->request_code == NO_REQUEST) {
		req_ack(srcadr, inter, inpkt, INFO_ERR_REQ);
		return;
	}

	DPRINTF(4, ("found request in tables\n"));

	/*
	 * If we need data, check to see if we have some.  If we
	 * don't, check to see that there is none (picky, picky).
	 */	

	/* This part is a bit tricky, we want to be sure that the size
	 * returned is either the old or the new size.  We also can find
	 * out if the client can accept both types of messages this way. 
	 *
	 * Handle the exception of REQ_CONFIG. It can have two data sizes.
	 */
	temp_size = INFO_ITEMSIZE(inpkt->mbz_itemsize);
	if ((temp_size != proc->sizeofitem &&
	     temp_size != proc->v6_sizeofitem) &&
	    !(inpkt->implementation == IMPL_XNTPD &&
	      inpkt->request == REQ_CONFIG &&
	      temp_size == sizeof(struct old_conf_peer))) {
		DPRINTF(3, ("process_private: wrong item size, received %d, should be %d or %d\n",
			    temp_size, proc->sizeofitem, proc->v6_sizeofitem));
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}
	if ((proc->sizeofitem != 0) &&
	    ((size_t)(temp_size * INFO_NITEMS(inpkt->err_nitems)) >
	     (recv_len - REQ_LEN_HDR))) {
		DPRINTF(3, ("process_private: not enough data\n"));
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}

	switch (inpkt->implementation) {
	case IMPL_XNTPD:
		client_v6_capable = 1;
		break;
	case IMPL_XNTPD_OLD:
		client_v6_capable = 0;
		break;
	default:
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}

	/*
	 * If we need to authenticate, do so.  Note that an
	 * authenticatable packet must include a mac field, must
	 * have used key info_auth_keyid and must have included
	 * a time stamp in the appropriate field.  The time stamp
	 * must be within INFO_TS_MAXSKEW of the receive
	 * time stamp.
	 */
	if (proc->needs_auth && sys_authenticate) {

		if (recv_len < (REQ_LEN_HDR +
		    (INFO_ITEMSIZE(inpkt->mbz_itemsize) *
		    INFO_NITEMS(inpkt->err_nitems)) +
		    REQ_TAIL_MIN)) {
			req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
			return;
		}

		/*
		 * For 16-octet digests, regardless of itemsize and
		 * nitems, authenticated requests are a fixed size
		 * with the timestamp, key ID, and digest located
		 * at the end of the packet.  Because the key ID
		 * determining the digest size precedes the digest,
		 * for larger digests the fixed size request scheme
		 * is abandoned and the timestamp, key ID, and digest
		 * are located relative to the start of the packet,
		 * with the digest size determined by the packet size.
		 */
		noslop_len = REQ_LEN_HDR
			     + INFO_ITEMSIZE(inpkt->mbz_itemsize) *
			       INFO_NITEMS(inpkt->err_nitems)
			     + sizeof(inpkt->tstamp);
		/* 32-bit alignment */
		noslop_len = (noslop_len + 3) & ~3;
		if (recv_len > (noslop_len + MAX_MAC_LEN))
			mac_len = 20;
		else
			mac_len = recv_len - noslop_len;

		tailinpkt = (void *)((char *)inpkt + recv_len -
			    (mac_len + sizeof(inpkt->tstamp)));

		/*
		 * If this guy is restricted from doing this, don't let
		 * him.  If the wrong key was used, or packet doesn't
		 * have mac, return.
		 */
		if (!INFO_IS_AUTH(inpkt->auth_seq) || !info_auth_keyid
		    || ntohl(tailinpkt->keyid) != info_auth_keyid) {
			DPRINTF(5, ("failed auth %d info_auth_keyid %u pkt keyid %u maclen %lu\n",
				    INFO_IS_AUTH(inpkt->auth_seq),
				    info_auth_keyid,
				    ntohl(tailinpkt->keyid), (u_long)mac_len));
#ifdef DEBUG
			msyslog(LOG_DEBUG,
				"process_private: failed auth %d info_auth_keyid %u pkt keyid %u maclen %lu\n",
				INFO_IS_AUTH(inpkt->auth_seq),
				info_auth_keyid,
				ntohl(tailinpkt->keyid), (u_long)mac_len);
#endif
			req_ack(srcadr, inter, inpkt, INFO_ERR_AUTH);
			return;
		}
		if (recv_len > REQ_LEN_NOMAC + MAX_MAC_LEN) {
			DPRINTF(5, ("bad pkt length %lu\n", 
				    (u_long)recv_len));
			msyslog(LOG_ERR,
				"process_private: bad pkt length %lu",
				(u_long)recv_len);
			req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
			return;
		}
		if (!mod_okay || !authhavekey(info_auth_keyid)) {
			DPRINTF(5, ("failed auth mod_okay %d\n",
				    mod_okay));
#ifdef DEBUG
			msyslog(LOG_DEBUG,
				"process_private: failed auth mod_okay %d\n",
				mod_okay);
#endif
			req_ack(srcadr, inter, inpkt, INFO_ERR_AUTH);
			return;
		}

		/*
		 * calculate absolute time difference between xmit time stamp
		 * and receive time stamp.  If too large, too bad.
		 */
		NTOHL_FP(&tailinpkt->tstamp, &ftmp);
		L_SUB(&ftmp, &rbufp->recv_time);
		LFPTOD(&ftmp, dtemp);
		if (fabs(dtemp) > INFO_TS_MAXSKEW) {
			/*
			 * He's a loser.  Tell him.
			 */
			DPRINTF(5, ("xmit/rcv timestamp delta %g > INFO_TS_MAXSKEW %g\n",
				    dtemp, INFO_TS_MAXSKEW));
			req_ack(srcadr, inter, inpkt, INFO_ERR_AUTH);
			return;
		}

		/*
		 * So far so good.  See if decryption works out okay.
		 */
		if (!authdecrypt(info_auth_keyid, (u_int32 *)inpkt,
				 recv_len - mac_len, mac_len)) {
			DPRINTF(5, ("authdecrypt failed\n"));
			req_ack(srcadr, inter, inpkt, INFO_ERR_AUTH);
			return;
		}
	}

	DPRINTF(3, ("process_private: all okay, into handler\n"));
	/*
	 * Packet is okay.  Call the handler to send him data.
	 */
	(proc->handler)(srcadr, inter, inpkt);
}


/*
 * peer_list - send a list of the peers
 */
static void
peer_list(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_peer_list *ip;
	register struct peer *pp;
	register int i;
	register int skip = 0;

	ip = (struct info_peer_list *)prepare_pkt(srcadr, inter, inpkt,
	    v6sizeof(struct info_peer_list));
	for (i = 0; i < NTP_HASH_SIZE && ip != 0; i++) {
		pp = peer_hash[i];
		while (pp != 0 && ip != 0) {
			if (IS_IPV6(&pp->srcadr)) {
				if (client_v6_capable) {
					ip->addr6 = SOCK_ADDR6(&pp->srcadr);
					ip->v6_flag = 1;
					skip = 0;
				} else {
					skip = 1;
					break;
				}
			} else {
				ip->addr = NSRCADR(&pp->srcadr);
				if (client_v6_capable)
					ip->v6_flag = 0;
				skip = 0;
			}

			if(!skip) {
				ip->port = NSRCPORT(&pp->srcadr);
				ip->hmode = pp->hmode;
				ip->flags = 0;
				if (pp->flags & FLAG_CONFIG)
				    ip->flags |= INFO_FLAG_CONFIG;
				if (pp == sys_peer)
				    ip->flags |= INFO_FLAG_SYSPEER;
				if (pp->status == CTL_PST_SEL_SYNCCAND)
				    ip->flags |= INFO_FLAG_SEL_CANDIDATE;
				if (pp->status >= CTL_PST_SEL_SYSPEER)
				    ip->flags |= INFO_FLAG_SHORTLIST;
				ip = (struct info_peer_list *)more_pkt();
			}
			pp = pp->next; 
		}
	}
	flush_pkt();
}


/*
 * peer_list_sum - return extended peer list
 */
static void
peer_list_sum(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_peer_summary *ips;
	register struct peer *pp;
	register int i;
	l_fp ltmp;
	register int skip;

#ifdef DEBUG
	if (debug > 2)
	    printf("wants peer list summary\n");
#endif
	ips = (struct info_peer_summary *)prepare_pkt(srcadr, inter, inpkt,
	    v6sizeof(struct info_peer_summary));
	for (i = 0; i < NTP_HASH_SIZE && ips != 0; i++) {
		pp = peer_hash[i];
		while (pp != 0 && ips != 0) {
#ifdef DEBUG
			if (debug > 3)
			    printf("sum: got one\n");
#endif
			/*
			 * Be careful here not to return v6 peers when we
			 * want only v4.
			 */
			if (IS_IPV6(&pp->srcadr)) {
				if (client_v6_capable) {
					ips->srcadr6 = SOCK_ADDR6(&pp->srcadr);
					ips->v6_flag = 1;
					if (pp->dstadr)
						ips->dstadr6 = SOCK_ADDR6(&pp->dstadr->sin);
					else
						memset(&ips->dstadr6, 0, sizeof(ips->dstadr6));
					skip = 0;
				} else {
					skip = 1;
					break;
				}
			} else {
				ips->srcadr = NSRCADR(&pp->srcadr);
				if (client_v6_capable)
					ips->v6_flag = 0;
				
				if (pp->dstadr) {
					if (!pp->processed)
						ips->dstadr = NSRCADR(&pp->dstadr->sin);
					else {
						if (MDF_BCAST == pp->cast_flags)
							ips->dstadr = NSRCADR(&pp->dstadr->bcast);
						else if (pp->cast_flags) {
							ips->dstadr = NSRCADR(&pp->dstadr->sin);
							if (!ips->dstadr)
								ips->dstadr = NSRCADR(&pp->dstadr->bcast);
						}
					}
				} else
					ips->dstadr = 0;

				skip = 0;
			}
			
			if (!skip){ 
				ips->srcport = NSRCPORT(&pp->srcadr);
				ips->stratum = pp->stratum;
				ips->hpoll = pp->hpoll;
				ips->ppoll = pp->ppoll;
				ips->reach = pp->reach;
				ips->flags = 0;
				if (pp == sys_peer)
				    ips->flags |= INFO_FLAG_SYSPEER;
				if (pp->flags & FLAG_CONFIG)
				    ips->flags |= INFO_FLAG_CONFIG;
				if (pp->flags & FLAG_REFCLOCK)
				    ips->flags |= INFO_FLAG_REFCLOCK;
				if (pp->flags & FLAG_PREFER)
				    ips->flags |= INFO_FLAG_PREFER;
				if (pp->flags & FLAG_BURST)
				    ips->flags |= INFO_FLAG_BURST;
				if (pp->status == CTL_PST_SEL_SYNCCAND)
				    ips->flags |= INFO_FLAG_SEL_CANDIDATE;
				if (pp->status >= CTL_PST_SEL_SYSPEER)
				    ips->flags |= INFO_FLAG_SHORTLIST;
				ips->hmode = pp->hmode;
				ips->delay = HTONS_FP(DTOFP(pp->delay));
				DTOLFP(pp->offset, <mp);
				HTONL_FP(<mp, &ips->offset);
				ips->dispersion = HTONS_FP(DTOUFP(SQRT(pp->disp)));
			}	
			pp = pp->next; 
			ips = (struct info_peer_summary *)more_pkt();
		}
	}
	flush_pkt();
}


/*
 * peer_info - send information for one or more peers
 */
static void
peer_info (
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_peer_list *ipl;
	register struct peer *pp;
	register struct info_peer *ip;
	register int items;
	register int i, j;
	sockaddr_u addr;
	extern struct peer *sys_peer;
	l_fp ltmp;

	items = INFO_NITEMS(inpkt->err_nitems);
	ipl = (struct info_peer_list *) inpkt->data;

	ip = (struct info_peer *)prepare_pkt(srcadr, inter, inpkt,
	    v6sizeof(struct info_peer));
	while (items-- > 0 && ip != 0) {
		ZERO_SOCK(&addr);
		NSRCPORT(&addr) = ipl->port;
		if (client_v6_capable && ipl->v6_flag) {
			AF(&addr) = AF_INET6;
			SOCK_ADDR6(&addr) = ipl->addr6;
		} else {
			AF(&addr) = AF_INET;
			NSRCADR(&addr) = ipl->addr;
		}
#ifdef ISC_PLATFORM_HAVESALEN
		addr.sa.sa_len = SOCKLEN(&addr);
#endif
		ipl++;
		pp = findexistingpeer(&addr, NULL, -1, 0);
		if (NULL == pp)
			continue;
		if (IS_IPV6(srcadr)) {
			if (pp->dstadr)
				ip->dstadr6 =
				    (MDF_BCAST == pp->cast_flags)
					? SOCK_ADDR6(&pp->dstadr->bcast)
					: SOCK_ADDR6(&pp->dstadr->sin);
			else
				memset(&ip->dstadr6, 0, sizeof(ip->dstadr6));

			ip->srcadr6 = SOCK_ADDR6(&pp->srcadr);
			ip->v6_flag = 1;
		} else {
			if (pp->dstadr) {
				if (!pp->processed)
					ip->dstadr = NSRCADR(&pp->dstadr->sin);
				else {
					if (MDF_BCAST == pp->cast_flags)
						ip->dstadr = NSRCADR(&pp->dstadr->bcast);
					else if (pp->cast_flags) {
						ip->dstadr = NSRCADR(&pp->dstadr->sin);
						if (!ip->dstadr)
							ip->dstadr = NSRCADR(&pp->dstadr->bcast);
					}
				}
			} else
				ip->dstadr = 0;

			ip->srcadr = NSRCADR(&pp->srcadr);
			if (client_v6_capable)
				ip->v6_flag = 0;
		}
		ip->srcport = NSRCPORT(&pp->srcadr);
		ip->flags = 0;
		if (pp == sys_peer)
		    ip->flags |= INFO_FLAG_SYSPEER;
		if (pp->flags & FLAG_CONFIG)
		    ip->flags |= INFO_FLAG_CONFIG;
		if (pp->flags & FLAG_REFCLOCK)
		    ip->flags |= INFO_FLAG_REFCLOCK;
		if (pp->flags & FLAG_PREFER)
		    ip->flags |= INFO_FLAG_PREFER;
		if (pp->flags & FLAG_BURST)
		    ip->flags |= INFO_FLAG_BURST;
		if (pp->status == CTL_PST_SEL_SYNCCAND)
		    ip->flags |= INFO_FLAG_SEL_CANDIDATE;
		if (pp->status >= CTL_PST_SEL_SYSPEER)
		    ip->flags |= INFO_FLAG_SHORTLIST;
		ip->leap = pp->leap;
		ip->hmode = pp->hmode;
		ip->keyid = pp->keyid;
		ip->stratum = pp->stratum;
		ip->ppoll = pp->ppoll;
		ip->hpoll = pp->hpoll;
		ip->precision = pp->precision;
		ip->version = pp->version;
		ip->reach = pp->reach;
		ip->unreach = (u_char) pp->unreach;
		ip->flash = (u_char)pp->flash;
		ip->flash2 = (u_short) pp->flash;
		ip->estbdelay = HTONS_FP(DTOFP(pp->delay));
		ip->ttl = pp->ttl;
		ip->associd = htons(pp->associd);
		ip->rootdelay = HTONS_FP(DTOUFP(pp->rootdelay));
		ip->rootdispersion = HTONS_FP(DTOUFP(pp->rootdisp));
		ip->refid = pp->refid;
		HTONL_FP(&pp->reftime, &ip->reftime);
		HTONL_FP(&pp->aorg, &ip->org);
		HTONL_FP(&pp->rec, &ip->rec);
		HTONL_FP(&pp->xmt, &ip->xmt);
		j = pp->filter_nextpt - 1;
		for (i = 0; i < NTP_SHIFT; i++, j--) {
			if (j < 0)
			    j = NTP_SHIFT-1;
			ip->filtdelay[i] = HTONS_FP(DTOFP(pp->filter_delay[j]));
			DTOLFP(pp->filter_offset[j], <mp);
			HTONL_FP(<mp, &ip->filtoffset[i]);
			ip->order[i] = (u_char)((pp->filter_nextpt+NTP_SHIFT-1)
				- pp->filter_order[i]);
			if (ip->order[i] >= NTP_SHIFT)
			    ip->order[i] -= NTP_SHIFT;
		}
		DTOLFP(pp->offset, <mp);
		HTONL_FP(<mp, &ip->offset);
		ip->delay = HTONS_FP(DTOFP(pp->delay));
		ip->dispersion = HTONS_FP(DTOUFP(SQRT(pp->disp)));
		ip->selectdisp = HTONS_FP(DTOUFP(SQRT(pp->jitter)));
		ip = (struct info_peer *)more_pkt();
	}
	flush_pkt();
}


/*
 * peer_stats - send statistics for one or more peers
 */
static void
peer_stats (
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_peer_list *ipl;
	register struct peer *pp;
	register struct info_peer_stats *ip;
	register int items;
	sockaddr_u addr;
	extern struct peer *sys_peer;

#ifdef DEBUG
	if (debug)
	     printf("peer_stats: called\n");
#endif
	items = INFO_NITEMS(inpkt->err_nitems);
	ipl = (struct info_peer_list *) inpkt->data;
	ip = (struct info_peer_stats *)prepare_pkt(srcadr, inter, inpkt,
	    v6sizeof(struct info_peer_stats));
	while (items-- > 0 && ip != 0) {
		memset((char *)&addr, 0, sizeof(addr));
		NSRCPORT(&addr) = ipl->port;
		if (client_v6_capable && ipl->v6_flag) {
			AF(&addr) = AF_INET6;
			SOCK_ADDR6(&addr) = ipl->addr6;
		} else {
			AF(&addr) = AF_INET;
			NSRCADR(&addr) = ipl->addr;
		}	
#ifdef ISC_PLATFORM_HAVESALEN
		addr.sa.sa_len = SOCKLEN(&addr);
#endif
		DPRINTF(1, ("peer_stats: looking for %s, %d, %d\n",
			    stoa(&addr), ipl->port, NSRCPORT(&addr)));

		ipl = (struct info_peer_list *)((char *)ipl +
		    INFO_ITEMSIZE(inpkt->mbz_itemsize));

		pp = findexistingpeer(&addr, NULL, -1, 0);
		if (NULL == pp)
			continue;

		DPRINTF(1, ("peer_stats: found %s\n", stoa(&addr)));

		if (IS_IPV4(&pp->srcadr)) {
			if (pp->dstadr) {
				if (!pp->processed)
					ip->dstadr = NSRCADR(&pp->dstadr->sin);
				else {
					if (MDF_BCAST == pp->cast_flags)
						ip->dstadr = NSRCADR(&pp->dstadr->bcast);
					else if (pp->cast_flags) {
						ip->dstadr = NSRCADR(&pp->dstadr->sin);
						if (!ip->dstadr)
							ip->dstadr = NSRCADR(&pp->dstadr->bcast);
					}
				}
			} else
				ip->dstadr = 0;
			
			ip->srcadr = NSRCADR(&pp->srcadr);
			if (client_v6_capable)
				ip->v6_flag = 0;
		} else {
			if (pp->dstadr)
				ip->dstadr6 =
				    (MDF_BCAST == pp->cast_flags)
					? SOCK_ADDR6(&pp->dstadr->bcast)
					: SOCK_ADDR6(&pp->dstadr->sin);
			else
				memset(&ip->dstadr6, 0, sizeof(ip->dstadr6));

			ip->srcadr6 = SOCK_ADDR6(&pp->srcadr);
			ip->v6_flag = 1;
		}	
		ip->srcport = NSRCPORT(&pp->srcadr);
		ip->flags = 0;
		if (pp == sys_peer)
		    ip->flags |= INFO_FLAG_SYSPEER;
		if (pp->flags & FLAG_CONFIG)
		    ip->flags |= INFO_FLAG_CONFIG;
		if (pp->flags & FLAG_REFCLOCK)
		    ip->flags |= INFO_FLAG_REFCLOCK;
		if (pp->flags & FLAG_PREFER)
		    ip->flags |= INFO_FLAG_PREFER;
		if (pp->flags & FLAG_BURST)
		    ip->flags |= INFO_FLAG_BURST;
		if (pp->flags & FLAG_IBURST)
		    ip->flags |= INFO_FLAG_IBURST;
		if (pp->status == CTL_PST_SEL_SYNCCAND)
		    ip->flags |= INFO_FLAG_SEL_CANDIDATE;
		if (pp->status >= CTL_PST_SEL_SYSPEER)
		    ip->flags |= INFO_FLAG_SHORTLIST;
		ip->flags = htons(ip->flags);
		ip->timereceived = htonl((u_int32)(current_time - pp->timereceived));
		ip->timetosend = htonl(pp->nextdate - current_time);
		ip->timereachable = htonl((u_int32)(current_time - pp->timereachable));
		ip->sent = htonl((u_int32)(pp->sent));
		ip->processed = htonl((u_int32)(pp->processed));
		ip->badauth = htonl((u_int32)(pp->badauth));
		ip->bogusorg = htonl((u_int32)(pp->bogusorg));
		ip->oldpkt = htonl((u_int32)(pp->oldpkt));
		ip->seldisp = htonl((u_int32)(pp->seldisptoolarge));
		ip->selbroken = htonl((u_int32)(pp->selbroken));
		ip->candidate = pp->status;
		ip = (struct info_peer_stats *)more_pkt();
	}
	flush_pkt();
}


/*
 * sys_info - return system info
 */
static void
sys_info(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_sys *is;

	is = (struct info_sys *)prepare_pkt(srcadr, inter, inpkt,
	    v6sizeof(struct info_sys));

	if (sys_peer) {
		if (IS_IPV4(&sys_peer->srcadr)) {
			is->peer = NSRCADR(&sys_peer->srcadr);
			if (client_v6_capable)
				is->v6_flag = 0;
		} else if (client_v6_capable) {
			is->peer6 = SOCK_ADDR6(&sys_peer->srcadr);
			is->v6_flag = 1;
		}
		is->peer_mode = sys_peer->hmode;
	} else {
		is->peer = 0;
		if (client_v6_capable) {
			is->v6_flag = 0;
		}
		is->peer_mode = 0;
	}

	is->leap = sys_leap;
	is->stratum = sys_stratum;
	is->precision = sys_precision;
	is->rootdelay = htonl(DTOFP(sys_rootdelay));
	is->rootdispersion = htonl(DTOUFP(sys_rootdisp));
	is->frequency = htonl(DTOFP(sys_jitter));
	is->stability = htonl(DTOUFP(clock_stability));
	is->refid = sys_refid;
	HTONL_FP(&sys_reftime, &is->reftime);

	is->poll = sys_poll;
	
	is->flags = 0;
	if (sys_authenticate)
		is->flags |= INFO_FLAG_AUTHENTICATE;
	if (sys_bclient)
		is->flags |= INFO_FLAG_BCLIENT;
#ifdef REFCLOCK
	if (cal_enable)
		is->flags |= INFO_FLAG_CAL;
#endif /* REFCLOCK */
	if (kern_enable)
		is->flags |= INFO_FLAG_KERNEL;
	if (mon_enabled != MON_OFF)
		is->flags |= INFO_FLAG_MONITOR;
	if (ntp_enable)
		is->flags |= INFO_FLAG_NTP;
	if (pps_enable)
		is->flags |= INFO_FLAG_PPS_SYNC;
	if (stats_control)
		is->flags |= INFO_FLAG_FILEGEN;
	is->bdelay = HTONS_FP(DTOFP(sys_bdelay));
	HTONL_UF(sys_authdelay.l_f, &is->authdelay);
	(void) more_pkt();
	flush_pkt();
}


/*
 * sys_stats - return system statistics
 */
static void
sys_stats(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_sys_stats *ss;

	/*
	 * Importations from the protocol module
	 */
	ss = (struct info_sys_stats *)prepare_pkt(srcadr, inter, inpkt,
		sizeof(struct info_sys_stats));
	ss->timeup = htonl((u_int32)current_time);
	ss->timereset = htonl((u_int32)(current_time - sys_stattime));
	ss->denied = htonl((u_int32)sys_restricted);
	ss->oldversionpkt = htonl((u_int32)sys_oldversion);
	ss->newversionpkt = htonl((u_int32)sys_newversion);
	ss->unknownversion = htonl((u_int32)sys_declined);
	ss->badlength = htonl((u_int32)sys_badlength);
	ss->processed = htonl((u_int32)sys_processed);
	ss->badauth = htonl((u_int32)sys_badauth);
	ss->limitrejected = htonl((u_int32)sys_limitrejected);
	ss->received = htonl((u_int32)sys_received);
	(void) more_pkt();
	flush_pkt();
}


/*
 * mem_stats - return memory statistics
 */
static void
mem_stats(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_mem_stats *ms;
	register int i;

	/*
	 * Importations from the peer module
	 */
	extern int peer_hash_count[NTP_HASH_SIZE];
	extern int peer_free_count;
	extern u_long peer_timereset;
	extern u_long findpeer_calls;
	extern u_long peer_allocations;
	extern u_long peer_demobilizations;
	extern int total_peer_structs;

	ms = (struct info_mem_stats *)prepare_pkt(srcadr, inter, inpkt,
						  sizeof(struct info_mem_stats));

	ms->timereset = htonl((u_int32)(current_time - peer_timereset));
	ms->totalpeermem = htons((u_short)total_peer_structs);
	ms->freepeermem = htons((u_short)peer_free_count);
	ms->findpeer_calls = htonl((u_int32)findpeer_calls);
	ms->allocations = htonl((u_int32)peer_allocations);
	ms->demobilizations = htonl((u_int32)peer_demobilizations);

	for (i = 0; i < NTP_HASH_SIZE; i++) {
		if (peer_hash_count[i] > 255)
		    ms->hashcount[i] = 255;
		else
		    ms->hashcount[i] = (u_char)peer_hash_count[i];
	}

	(void) more_pkt();
	flush_pkt();
}


/*
 * io_stats - return io statistics
 */
static void
io_stats(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_io_stats *io;

	/*
	 * Importations from the io module
	 */
	extern u_long io_timereset;
	
	io = (struct info_io_stats *)prepare_pkt(srcadr, inter, inpkt,
						 sizeof(struct info_io_stats));

	io->timereset = htonl((u_int32)(current_time - io_timereset));
	io->totalrecvbufs = htons((u_short) total_recvbuffs());
	io->freerecvbufs = htons((u_short) free_recvbuffs());
	io->fullrecvbufs = htons((u_short) full_recvbuffs());
	io->lowwater = htons((u_short) lowater_additions());
	io->dropped = htonl((u_int32)packets_dropped);
	io->ignored = htonl((u_int32)packets_ignored);
	io->received = htonl((u_int32)packets_received);
	io->sent = htonl((u_int32)packets_sent);
	io->notsent = htonl((u_int32)packets_notsent);
	io->interrupts = htonl((u_int32)handler_calls);
	io->int_received = htonl((u_int32)handler_pkts);

	(void) more_pkt();
	flush_pkt();
}


/*
 * timer_stats - return timer statistics
 */
static void
timer_stats(
	sockaddr_u *		srcadr,
	struct interface *	inter,
	struct req_pkt *	inpkt
	)
{
	struct info_timer_stats *	ts;
	u_long				sincereset;

	ts = (struct info_timer_stats *)prepare_pkt(srcadr, inter,
						    inpkt, sizeof(*ts));

	sincereset = current_time - timer_timereset;
	ts->timereset = htonl((u_int32)sincereset);
	ts->alarms = ts->timereset;
	ts->overflows = htonl((u_int32)alarm_overflow);
	ts->xmtcalls = htonl((u_int32)timer_xmtcalls);

	(void) more_pkt();
	flush_pkt();
}


/*
 * loop_info - return the current state of the loop filter
 */
static void
loop_info(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_loop *li;
	l_fp ltmp;

	/*
	 * Importations from the loop filter module
	 */
	extern double last_offset;
	extern double drift_comp;
	extern int tc_counter;
	extern u_long sys_epoch;

	li = (struct info_loop *)prepare_pkt(srcadr, inter, inpkt,
	    sizeof(struct info_loop));

	DTOLFP(last_offset, <mp);
	HTONL_FP(<mp, &li->last_offset);
	DTOLFP(drift_comp * 1e6, <mp);
	HTONL_FP(<mp, &li->drift_comp);
	li->compliance = htonl((u_int32)(tc_counter));
	li->watchdog_timer = htonl((u_int32)(current_time - sys_epoch));

	(void) more_pkt();
	flush_pkt();
}


/*
 * do_conf - add a peer to the configuration list
 */
static void
do_conf(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	static u_long soonest_ifrescan_time = 0;
	int items;
	u_int fl;
	struct conf_peer *cp; 
	struct conf_peer temp_cp;
	sockaddr_u peeraddr;

	/*
	 * Do a check of everything to see that it looks
	 * okay.  If not, complain about it.  Note we are
	 * very picky here.
	 */
	items = INFO_NITEMS(inpkt->err_nitems);
	cp = (struct conf_peer *)inpkt->data;
	memset(&temp_cp, 0, sizeof(struct conf_peer));
	memcpy(&temp_cp, (char *)cp, INFO_ITEMSIZE(inpkt->mbz_itemsize));

#if 0 /* paranoid checking - these are done in newpeer() */
	fl = 0;
	while (items-- > 0 && !fl) {
		if (((temp_cp.version) > NTP_VERSION)
		    || ((temp_cp.version) < NTP_OLDVERSION))
		    fl = 1;
		if (temp_cp.hmode != MODE_ACTIVE
		    && temp_cp.hmode != MODE_CLIENT
		    && temp_cp.hmode != MODE_BROADCAST)
		    fl = 1;
		if (temp_cp.flags & ~(CONF_FLAG_PREFER | CONF_FLAG_BURST |
		    CONF_FLAG_IBURST | CONF_FLAG_SKEY))
			fl = 1;
		cp = (struct conf_peer *)
		    ((char *)cp + INFO_ITEMSIZE(inpkt->mbz_itemsize));
	}

	if (fl) {
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}
#endif /* end paranoid checking */

	/*
	 * Looks okay, try it out
	 */
	items = INFO_NITEMS(inpkt->err_nitems);
	cp = (struct conf_peer *)inpkt->data;  

	while (items-- > 0) {
		memset(&temp_cp, 0, sizeof(struct conf_peer));
		memcpy(&temp_cp, (char *)cp, INFO_ITEMSIZE(inpkt->mbz_itemsize));
		ZERO_SOCK(&peeraddr);

		fl = 0;
		if (temp_cp.flags & CONF_FLAG_PREFER)
			fl |= FLAG_PREFER;
		if (temp_cp.flags & CONF_FLAG_BURST)
		    fl |= FLAG_BURST;
		if (temp_cp.flags & CONF_FLAG_IBURST)
		    fl |= FLAG_IBURST;
#ifdef OPENSSL
		if (temp_cp.flags & CONF_FLAG_SKEY)
			fl |= FLAG_SKEY;
#endif /* OPENSSL */		
		if (client_v6_capable && temp_cp.v6_flag != 0) {
			AF(&peeraddr) = AF_INET6;
			SOCK_ADDR6(&peeraddr) = temp_cp.peeraddr6; 
		} else {
			AF(&peeraddr) = AF_INET;
			NSRCADR(&peeraddr) = temp_cp.peeraddr;
			/*
			 * Make sure the address is valid
			 */
			if (!ISREFCLOCKADR(&peeraddr) && 
			    ISBADADR(&peeraddr)) {
				req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
				return;
			}

		}
		NSRCPORT(&peeraddr) = htons(NTP_PORT);
#ifdef ISC_PLATFORM_HAVESALEN
		peeraddr.sa.sa_len = SOCKLEN(&peeraddr);
#endif

		/* XXX W2DO? minpoll/maxpoll arguments ??? */
		if (peer_config(&peeraddr, (struct interface *)0,
		    temp_cp.hmode, temp_cp.version, temp_cp.minpoll, 
		    temp_cp.maxpoll, fl, temp_cp.ttl, temp_cp.keyid,
		    NULL) == 0) {
			req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
			return;
		}

		/*
		 * ntp_intres.c uses REQ_CONFIG/doconf() to add each
		 * server after its name is resolved.  If we have been
		 * disconnected from the network, it may notice the
		 * network has returned and add the first server while
		 * the relevant interface is still disabled, awaiting
		 * the next interface rescan.  To get things moving
		 * more quickly, trigger an interface scan now, except
		 * if we have done so in the last half minute.
		 */
		if (soonest_ifrescan_time < current_time) {
			soonest_ifrescan_time = current_time + 30;
			timer_interfacetimeout(current_time);
			DPRINTF(1, ("do_conf triggering interface rescan\n"));
		}

		cp = (struct conf_peer *)
		    ((char *)cp + INFO_ITEMSIZE(inpkt->mbz_itemsize));
	}

	req_ack(srcadr, inter, inpkt, INFO_OKAY);
}

#if 0
/* XXX */
/*
 * dns_a - Snarf DNS info for an association ID
 */
static void
dns_a(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_dns_assoc *dp;
	register int items;
	struct sockaddr_in peeraddr;

	/*
	 * Do a check of everything to see that it looks
	 * okay.  If not, complain about it.  Note we are
	 * very picky here.
	 */
	items = INFO_NITEMS(inpkt->err_nitems);
	dp = (struct info_dns_assoc *)inpkt->data;

	/*
	 * Looks okay, try it out
	 */
	items = INFO_NITEMS(inpkt->err_nitems);
	dp = (struct info_dns_assoc *)inpkt->data;
	memset((char *)&peeraddr, 0, sizeof(struct sockaddr_in));
	peeraddr.sin_family = AF_INET;
	peeraddr.sin_port = htons(NTP_PORT);

	/*
	 * Make sure the address is valid
	 */
	if (!ISREFCLOCKADR(&peeraddr) && ISBADADR(&peeraddr)) {
		msyslog(LOG_ERR, "dns_a: !ISREFCLOCKADR && ISBADADR");
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}

	while (items-- > 0) {
		associd_t associd;
		size_t hnl;
		struct peer *peer;
		int bogon = 0;

		associd = dp->associd;
		peer = findpeerbyassoc(associd);
		if (peer == 0 || peer->flags & FLAG_REFCLOCK) {
			msyslog(LOG_ERR, "dns_a: %s",
				(peer == 0)
				? "peer == 0"
				: "peer->flags & FLAG_REFCLOCK");
			++bogon;
		}
		peeraddr.sin_addr.s_addr = dp->peeraddr;
		for (hnl = 0; dp->hostname[hnl] && hnl < sizeof dp->hostname; ++hnl) ;
		if (hnl >= sizeof dp->hostname) {
			msyslog(LOG_ERR, "dns_a: hnl (%ld) >= %ld",
				(long)hnl, (long)sizeof dp->hostname);
			++bogon;
		}

		msyslog(LOG_INFO, "dns_a: <%s> for %s, AssocID %d, bogon %d",
			dp->hostname,
			stoa((sockaddr_u *)&peeraddr), associd,
			bogon);

		if (bogon) {
			/* If it didn't work */
			req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
			return;
		} else {
#if 0
#ifdef PUBKEY
			crypto_public(peer, dp->hostname);
#endif /* PUBKEY */
#endif
		}

		dp++;
	}

	req_ack(srcadr, inter, inpkt, INFO_OKAY);
}
#endif /* 0 */

/*
 * do_unconf - remove a peer from the configuration list
 */
static void
do_unconf(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct conf_unpeer *cp;
	struct conf_unpeer temp_cp;
	register int items;
	register struct peer *peer;
	sockaddr_u peeraddr;
	int bad, found;

	/*
	 * This is a bit unstructured, but I like to be careful.
	 * We check to see that every peer exists and is actually
	 * configured.  If so, we remove them.  If not, we return
	 * an error.
	 */
	items = INFO_NITEMS(inpkt->err_nitems);
	cp = (struct conf_unpeer *)inpkt->data;

	bad = 0;
	while (items-- > 0 && !bad) {
		memset(&temp_cp, 0, sizeof(temp_cp));
		ZERO_SOCK(&peeraddr);
		memcpy(&temp_cp, cp, INFO_ITEMSIZE(inpkt->mbz_itemsize));
		if (client_v6_capable && temp_cp.v6_flag) {
			AF(&peeraddr) = AF_INET6;
			SOCK_ADDR6(&peeraddr) = temp_cp.peeraddr6;
		} else {
			AF(&peeraddr) = AF_INET;
			NSRCADR(&peeraddr) = temp_cp.peeraddr;
		}
		SET_PORT(&peeraddr, NTP_PORT);
#ifdef ISC_PLATFORM_HAVESALEN
		peeraddr.sa.sa_len = SOCKLEN(&peeraddr);
#endif
		found = 0;
		peer = NULL;

		DPRINTF(1, ("searching for %s\n", stoa(&peeraddr)));

		while (!found) {
			peer = findexistingpeer(&peeraddr, peer, -1, 0);
			if (!peer)
				break;
			if (peer->flags & FLAG_CONFIG)
				found = 1;
		}
		if (!found)
			bad = 1;
		cp = (struct conf_unpeer *)
			((char *)cp + INFO_ITEMSIZE(inpkt->mbz_itemsize));
	}

	if (bad) {
		req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
		return;
	}

	/*
	 * Now do it in earnest.
	 */

	items = INFO_NITEMS(inpkt->err_nitems);
	cp = (struct conf_unpeer *)inpkt->data;

	while (items-- > 0) {
		memset(&temp_cp, 0, sizeof(temp_cp));
		memset(&peeraddr, 0, sizeof(peeraddr));
		memcpy(&temp_cp, cp, INFO_ITEMSIZE(inpkt->mbz_itemsize));
		if (client_v6_capable && temp_cp.v6_flag) {
			AF(&peeraddr) = AF_INET6;
			SOCK_ADDR6(&peeraddr) = temp_cp.peeraddr6;
		} else {
			AF(&peeraddr) = AF_INET;
			NSRCADR(&peeraddr) = temp_cp.peeraddr;
		}
		SET_PORT(&peeraddr, NTP_PORT);
#ifdef ISC_PLATFORM_HAVESALEN
		peeraddr.sa.sa_len = SOCKLEN(&peeraddr);
#endif
		found = 0;
		peer = NULL;

		while (!found) {
			peer = findexistingpeer(&peeraddr, peer, -1, 0);
			if (!peer)
				break;
			if (peer->flags & FLAG_CONFIG)
				found = 1;
		}
		NTP_INSIST(found);
		NTP_INSIST(peer);

		peer_clear(peer, "GONE");
		unpeer(peer);

		cp = (struct conf_unpeer *)
			((char *)cp + INFO_ITEMSIZE(inpkt->mbz_itemsize));
	}

	req_ack(srcadr, inter, inpkt, INFO_OKAY);
}


/*
 * set_sys_flag - set system flags
 */
static void
set_sys_flag(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	setclr_flags(srcadr, inter, inpkt, 1);
}


/*
 * clr_sys_flag - clear system flags
 */
static void
clr_sys_flag(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	setclr_flags(srcadr, inter, inpkt, 0);
}


/*
 * setclr_flags - do the grunge work of flag setting/clearing
 */
static void
setclr_flags(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt,
	u_long set
	)
{
	struct conf_sys_flags *sf;
	u_int32 flags;
	int prev_kern_enable;

	prev_kern_enable = kern_enable;
	if (INFO_NITEMS(inpkt->err_nitems) > 1) {
		msyslog(LOG_ERR, "setclr_flags: err_nitems > 1");
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}

	sf = (struct conf_sys_flags *)inpkt->data;
	flags = ntohl(sf->flags);
	
	if (flags & ~(SYS_FLAG_BCLIENT | SYS_FLAG_PPS |
		      SYS_FLAG_NTP | SYS_FLAG_KERNEL | SYS_FLAG_MONITOR |
		      SYS_FLAG_FILEGEN | SYS_FLAG_AUTH | SYS_FLAG_CAL)) {
		msyslog(LOG_ERR, "setclr_flags: extra flags: %#x",
			flags & ~(SYS_FLAG_BCLIENT | SYS_FLAG_PPS |
				  SYS_FLAG_NTP | SYS_FLAG_KERNEL |
				  SYS_FLAG_MONITOR | SYS_FLAG_FILEGEN |
				  SYS_FLAG_AUTH | SYS_FLAG_CAL));
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}

	if (flags & SYS_FLAG_BCLIENT)
		proto_config(PROTO_BROADCLIENT, set, 0., NULL);
	if (flags & SYS_FLAG_PPS)
		proto_config(PROTO_PPS, set, 0., NULL);
	if (flags & SYS_FLAG_NTP)
		proto_config(PROTO_NTP, set, 0., NULL);
	if (flags & SYS_FLAG_KERNEL)
		proto_config(PROTO_KERNEL, set, 0., NULL);
	if (flags & SYS_FLAG_MONITOR)
		proto_config(PROTO_MONITOR, set, 0., NULL);
	if (flags & SYS_FLAG_FILEGEN)
		proto_config(PROTO_FILEGEN, set, 0., NULL);
	if (flags & SYS_FLAG_AUTH)
		proto_config(PROTO_AUTHENTICATE, set, 0., NULL);
	if (flags & SYS_FLAG_CAL)
		proto_config(PROTO_CAL, set, 0., NULL);
	req_ack(srcadr, inter, inpkt, INFO_OKAY);

	/* Reset the kernel ntp parameters if the kernel flag changed. */
	if (prev_kern_enable && !kern_enable)
	     	loop_config(LOOP_KERN_CLEAR, 0.0);
	if (!prev_kern_enable && kern_enable)
	     	loop_config(LOOP_DRIFTCOMP, drift_comp);
}

/*
 * list_restrict4 - recursive helper for list_restrict dumps IPv4
 *		    restriction list in reverse order.
 */
static void
list_restrict4(
	restrict_u *		res,
	struct info_restrict **	ppir
	)
{
	struct info_restrict *	pir;

	if (res->link != NULL)
		list_restrict4(res->link, ppir);

	pir = *ppir;
	pir->addr = htonl(res->u.v4.addr);
	if (client_v6_capable) 
		pir->v6_flag = 0;
	pir->mask = htonl(res->u.v4.mask);
	pir->count = htonl(res->count);
	pir->flags = htons(res->flags);
	pir->mflags = htons(res->mflags);
	*ppir = (struct info_restrict *)more_pkt();
}


/*
 * list_restrict6 - recursive helper for list_restrict dumps IPv6
 *		    restriction list in reverse order.
 */
static void
list_restrict6(
	restrict_u *		res,
	struct info_restrict **	ppir
	)
{
	struct info_restrict *	pir;

	if (res->link != NULL)
		list_restrict6(res->link, ppir);

	pir = *ppir;
	pir->addr6 = res->u.v6.addr; 
	pir->mask6 = res->u.v6.mask;
	pir->v6_flag = 1;
	pir->count = htonl(res->count);
	pir->flags = htons(res->flags);
	pir->mflags = htons(res->mflags);
	*ppir = (struct info_restrict *)more_pkt();
}


/*
 * list_restrict - return the restrict list
 */
static void
list_restrict(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	struct info_restrict *ir;

	DPRINTF(3, ("wants restrict list summary\n"));

	ir = (struct info_restrict *)prepare_pkt(srcadr, inter, inpkt,
	    v6sizeof(struct info_restrict));
	
	/*
	 * The restriction lists are kept sorted in the reverse order
	 * than they were originally.  To preserve the output semantics,
	 * dump each list in reverse order.  A recursive helper function
	 * achieves that.
	 */
	list_restrict4(restrictlist4, &ir);
	if (client_v6_capable)
		list_restrict6(restrictlist6, &ir);
	flush_pkt();
}


/*
 * do_resaddflags - add flags to a restrict entry (or create one)
 */
static void
do_resaddflags(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	do_restrict(srcadr, inter, inpkt, RESTRICT_FLAGS);
}



/*
 * do_ressubflags - remove flags from a restrict entry
 */
static void
do_ressubflags(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	do_restrict(srcadr, inter, inpkt, RESTRICT_UNFLAG);
}


/*
 * do_unrestrict - remove a restrict entry from the list
 */
static void
do_unrestrict(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	do_restrict(srcadr, inter, inpkt, RESTRICT_REMOVE);
}


/*
 * do_restrict - do the dirty stuff of dealing with restrictions
 */
static void
do_restrict(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt,
	int op
	)
{
	register struct conf_restrict *cr;
	register int items;
	sockaddr_u matchaddr;
	sockaddr_u matchmask;
	int bad;

	/*
	 * Do a check of the flags to make sure that only
	 * the NTPPORT flag is set, if any.  If not, complain
	 * about it.  Note we are very picky here.
	 */
	items = INFO_NITEMS(inpkt->err_nitems);
	cr = (struct conf_restrict *)inpkt->data;

	bad = 0;
	cr->flags = ntohs(cr->flags);
	cr->mflags = ntohs(cr->mflags);
	while (items-- > 0 && !bad) {
		if (cr->mflags & ~(RESM_NTPONLY))
		    bad |= 1;
		if (cr->flags & ~(RES_ALLFLAGS))
		    bad |= 2;
		if (cr->mask != htonl(INADDR_ANY)) {
			if (client_v6_capable && cr->v6_flag != 0) {
				if (IN6_IS_ADDR_UNSPECIFIED(&cr->addr6))
					bad |= 4;
			} else
				if (cr->addr == htonl(INADDR_ANY))
					bad |= 8;
		}
		cr = (struct conf_restrict *)((char *)cr +
		    INFO_ITEMSIZE(inpkt->mbz_itemsize));
	}

	if (bad) {
		msyslog(LOG_ERR, "do_restrict: bad = %#x", bad);
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}

	/*
	 * Looks okay, try it out
	 */
	items = INFO_NITEMS(inpkt->err_nitems);
	cr = (struct conf_restrict *)inpkt->data;
	ZERO_SOCK(&matchaddr);
	ZERO_SOCK(&matchmask);

	while (items-- > 0) {
		if (client_v6_capable && cr->v6_flag) {
			AF(&matchaddr) = AF_INET6;
			AF(&matchmask) = AF_INET6;
			SOCK_ADDR6(&matchaddr) = cr->addr6;
			SOCK_ADDR6(&matchmask) = cr->mask6;
		} else {
			AF(&matchaddr) = AF_INET;
			AF(&matchmask) = AF_INET;
			NSRCADR(&matchaddr) = cr->addr;
			NSRCADR(&matchmask) = cr->mask;
		}
		hack_restrict(op, &matchaddr, &matchmask, cr->mflags,
			 cr->flags);
		cr++;
	}

	req_ack(srcadr, inter, inpkt, INFO_OKAY);
}


/*
 * mon_getlist - return monitor data
 */
static void
mon_getlist_0(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_monitor *im;
	register struct mon_data *md;
	extern struct mon_data mon_mru_list;
	extern int mon_enabled;

#ifdef DEBUG
	if (debug > 2)
	    printf("wants monitor 0 list\n");
#endif
	if (!mon_enabled) {
		req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
		return;
	}
	im = (struct info_monitor *)prepare_pkt(srcadr, inter, inpkt,
	    v6sizeof(struct info_monitor));
	for (md = mon_mru_list.mru_next; md != &mon_mru_list && im != 0;
	     md = md->mru_next) {
		im->lasttime = htonl((u_int32)((current_time -
		    md->firsttime) / md->count));
		im->firsttime = htonl((u_int32)(current_time - md->lasttime));
		im->restr = htonl((u_int32)md->flags);
		im->count = htonl((u_int32)(md->count));
		if (IS_IPV6(&md->rmtadr)) {
			if (!client_v6_capable)
				continue;
			im->addr6 = SOCK_ADDR6(&md->rmtadr);
			im->v6_flag = 1;
		} else {
			im->addr = NSRCADR(&md->rmtadr);
			if (client_v6_capable)
				im->v6_flag = 0;
		}
		im->port = md->rmtport;
		im->mode = md->mode;
		im->version = md->version;
		im = (struct info_monitor *)more_pkt();
	}
	flush_pkt();
}

/*
 * mon_getlist - return monitor data
 */
static void
mon_getlist_1(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_monitor_1 *im;
	register struct mon_data *md;
	extern struct mon_data mon_mru_list;
	extern int mon_enabled;

	if (!mon_enabled) {
		req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
		return;
	}
	im = (struct info_monitor_1 *)prepare_pkt(srcadr, inter, inpkt,
	    v6sizeof(struct info_monitor_1));
	for (md = mon_mru_list.mru_next; md != &mon_mru_list && im != 0;
	     md = md->mru_next) {
		im->lasttime = htonl((u_int32)((current_time -
		    md->firsttime) / md->count));
		im->firsttime = htonl((u_int32)(current_time - md->lasttime));
		im->restr = htonl((u_int32)md->flags);
		im->count = htonl((u_int32)md->count);
		if (IS_IPV6(&md->rmtadr)) {
			if (!client_v6_capable)
				continue;
			im->addr6 = SOCK_ADDR6(&md->rmtadr);
			im->v6_flag = 1;
			im->daddr6 = SOCK_ADDR6(&md->interface->sin);
		} else {
			im->addr = NSRCADR(&md->rmtadr);
			if (client_v6_capable)
				im->v6_flag = 0;
			if (MDF_BCAST == md->cast_flags)
				im->daddr = NSRCADR(&md->interface->bcast);
			else if (md->cast_flags) {
				im->daddr = NSRCADR(&md->interface->sin);
				if (!im->daddr)
					im->daddr = NSRCADR(&md->interface->bcast);
			} else
				im->daddr = 4;
		}
		im->flags = htonl(md->cast_flags);
		im->port = md->rmtport;
		im->mode = md->mode;
		im->version = md->version;
		im = (struct info_monitor_1 *)more_pkt();
	}
	flush_pkt();
}

/*
 * Module entry points and the flags they correspond with
 */
struct reset_entry {
	int flag;		/* flag this corresponds to */
	void (*handler) (void); /* routine to handle request */
};

struct reset_entry reset_entries[] = {
	{ RESET_FLAG_ALLPEERS,	peer_all_reset },
	{ RESET_FLAG_IO,	io_clr_stats },
	{ RESET_FLAG_SYS,	proto_clr_stats },
	{ RESET_FLAG_MEM,	peer_clr_stats },
	{ RESET_FLAG_TIMER,	timer_clr_stats },
	{ RESET_FLAG_AUTH,	reset_auth_stats },
	{ RESET_FLAG_CTL,	ctl_clr_stats },
	{ 0,			0 }
};

/*
 * reset_stats - reset statistic counters here and there
 */
static void
reset_stats(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	struct reset_flags *rflags;
	u_long flags;
	struct reset_entry *rent;

	if (INFO_NITEMS(inpkt->err_nitems) > 1) {
		msyslog(LOG_ERR, "reset_stats: err_nitems > 1");
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}

	rflags = (struct reset_flags *)inpkt->data;
	flags = ntohl(rflags->flags);

	if (flags & ~RESET_ALLFLAGS) {
		msyslog(LOG_ERR, "reset_stats: reset leaves %#lx",
			flags & ~RESET_ALLFLAGS);
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}

	for (rent = reset_entries; rent->flag != 0; rent++) {
		if (flags & rent->flag)
			(*rent->handler)();
	}
	req_ack(srcadr, inter, inpkt, INFO_OKAY);
}


/*
 * reset_peer - clear a peer's statistics
 */
static void
reset_peer(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	struct conf_unpeer *cp;
	int items;
	struct peer *peer;
	sockaddr_u peeraddr;
	int bad;

	/*
	 * We check first to see that every peer exists.  If not,
	 * we return an error.
	 */

	items = INFO_NITEMS(inpkt->err_nitems);
	cp = (struct conf_unpeer *)inpkt->data;

	bad = 0;
	while (items-- > 0 && !bad) {
		ZERO_SOCK(&peeraddr);
		if (client_v6_capable && cp->v6_flag) {
			AF(&peeraddr) = AF_INET6;
			SOCK_ADDR6(&peeraddr) = cp->peeraddr6;
		} else {
			AF(&peeraddr) = AF_INET;
			NSRCADR(&peeraddr) = cp->peeraddr;
		}

#ifdef ISC_PLATFORM_HAVESALEN
		peeraddr.sa.sa_len = SOCKLEN(&peeraddr);
#endif
		peer = findexistingpeer(&peeraddr, NULL, -1, 0);
		if (NULL == peer)
			bad++;
		cp = (struct conf_unpeer *)((char *)cp +
		    INFO_ITEMSIZE(inpkt->mbz_itemsize));
	}

	if (bad) {
		req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
		return;
	}

	/*
	 * Now do it in earnest.
	 */

	items = INFO_NITEMS(inpkt->err_nitems);
	cp = (struct conf_unpeer *)inpkt->data;
	while (items-- > 0) {
		ZERO_SOCK(&peeraddr);
		if (client_v6_capable && cp->v6_flag) {
			AF(&peeraddr) = AF_INET6;
			SOCK_ADDR6(&peeraddr) = cp->peeraddr6;
		} else {
			AF(&peeraddr) = AF_INET;
			NSRCADR(&peeraddr) = cp->peeraddr;
		}
		SET_PORT(&peeraddr, 123);
#ifdef ISC_PLATFORM_HAVESALEN
		peeraddr.sa.sa_len = SOCKLEN(&peeraddr);
#endif
		peer = findexistingpeer(&peeraddr, NULL, -1, 0);
		while (peer != NULL) {
			peer_reset(peer);
			peer = findexistingpeer(&peeraddr, peer, -1, 0);
		}
		cp = (struct conf_unpeer *)((char *)cp +
		    INFO_ITEMSIZE(inpkt->mbz_itemsize));
	}

	req_ack(srcadr, inter, inpkt, INFO_OKAY);
}


/*
 * do_key_reread - reread the encryption key file
 */
static void
do_key_reread(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	rereadkeys();
	req_ack(srcadr, inter, inpkt, INFO_OKAY);
}


/*
 * trust_key - make one or more keys trusted
 */
static void
trust_key(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	do_trustkey(srcadr, inter, inpkt, 1);
}


/*
 * untrust_key - make one or more keys untrusted
 */
static void
untrust_key(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	do_trustkey(srcadr, inter, inpkt, 0);
}


/*
 * do_trustkey - make keys either trustable or untrustable
 */
static void
do_trustkey(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt,
	u_long trust
	)
{
	register u_long *kp;
	register int items;

	items = INFO_NITEMS(inpkt->err_nitems);
	kp = (u_long *)inpkt->data;
	while (items-- > 0) {
		authtrust(*kp, trust);
		kp++;
	}

	req_ack(srcadr, inter, inpkt, INFO_OKAY);
}


/*
 * get_auth_info - return some stats concerning the authentication module
 */
static void
get_auth_info(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_auth *ia;

	/*
	 * Importations from the authentication module
	 */
	extern u_long authnumkeys;
	extern int authnumfreekeys;
	extern u_long authkeylookups;
	extern u_long authkeynotfound;
	extern u_long authencryptions;
	extern u_long authdecryptions;
	extern u_long authkeyuncached;
	extern u_long authkeyexpired;

	ia = (struct info_auth *)prepare_pkt(srcadr, inter, inpkt,
					     sizeof(struct info_auth));

	ia->numkeys = htonl((u_int32)authnumkeys);
	ia->numfreekeys = htonl((u_int32)authnumfreekeys);
	ia->keylookups = htonl((u_int32)authkeylookups);
	ia->keynotfound = htonl((u_int32)authkeynotfound);
	ia->encryptions = htonl((u_int32)authencryptions);
	ia->decryptions = htonl((u_int32)authdecryptions);
	ia->keyuncached = htonl((u_int32)authkeyuncached);
	ia->expired = htonl((u_int32)authkeyexpired);
	ia->timereset = htonl((u_int32)(current_time - auth_timereset));
	
	(void) more_pkt();
	flush_pkt();
}



/*
 * reset_auth_stats - reset the authentication stat counters.  Done here
 *		      to keep ntp-isms out of the authentication module
 */
static void
reset_auth_stats(void)
{
	/*
	 * Importations from the authentication module
	 */
	extern u_long authkeylookups;
	extern u_long authkeynotfound;
	extern u_long authencryptions;
	extern u_long authdecryptions;
	extern u_long authkeyuncached;

	authkeylookups = 0;
	authkeynotfound = 0;
	authencryptions = 0;
	authdecryptions = 0;
	authkeyuncached = 0;
	auth_timereset = current_time;
}


/*
 * req_get_traps - return information about current trap holders
 */
static void
req_get_traps(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_trap *it;
	register struct ctl_trap *tr;
	register int i;

	/*
	 * Imported from the control module
	 */
	extern struct ctl_trap ctl_trap[];
	extern int num_ctl_traps;

	if (num_ctl_traps == 0) {
		req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
		return;
	}

	it = (struct info_trap *)prepare_pkt(srcadr, inter, inpkt,
	    v6sizeof(struct info_trap));

	for (i = 0, tr = ctl_trap; i < CTL_MAXTRAPS; i++, tr++) {
		if (tr->tr_flags & TRAP_INUSE) {
			if (IS_IPV4(&tr->tr_addr)) {
				if (tr->tr_localaddr == any_interface)
					it->local_address = 0;
				else
					it->local_address
					    = NSRCADR(&tr->tr_localaddr->sin);
				it->trap_address = NSRCADR(&tr->tr_addr);
				if (client_v6_capable)
					it->v6_flag = 0;
			} else {
				if (!client_v6_capable)
					continue;
				it->local_address6 
				    = SOCK_ADDR6(&tr->tr_localaddr->sin);
				it->trap_address6 = SOCK_ADDR6(&tr->tr_addr);
				it->v6_flag = 1;
			}
			it->trap_port = NSRCPORT(&tr->tr_addr);
			it->sequence = htons(tr->tr_sequence);
			it->settime = htonl((u_int32)(current_time - tr->tr_settime));
			it->origtime = htonl((u_int32)(current_time - tr->tr_origtime));
			it->resets = htonl((u_int32)tr->tr_resets);
			it->flags = htonl((u_int32)tr->tr_flags);
			it = (struct info_trap *)more_pkt();
		}
	}
	flush_pkt();
}


/*
 * req_set_trap - configure a trap
 */
static void
req_set_trap(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	do_setclr_trap(srcadr, inter, inpkt, 1);
}



/*
 * req_clr_trap - unconfigure a trap
 */
static void
req_clr_trap(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	do_setclr_trap(srcadr, inter, inpkt, 0);
}



/*
 * do_setclr_trap - do the grunge work of (un)configuring a trap
 */
static void
do_setclr_trap(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt,
	int set
	)
{
	register struct conf_trap *ct;
	register struct interface *linter;
	int res;
	sockaddr_u laddr;

	/*
	 * Prepare sockaddr
	 */
	ZERO_SOCK(&laddr);
	AF(&laddr) = AF(srcadr);
	SET_PORT(&laddr, NTP_PORT);

	/*
	 * Restrict ourselves to one item only.  This eliminates
	 * the error reporting problem.
	 */
	if (INFO_NITEMS(inpkt->err_nitems) > 1) {
		msyslog(LOG_ERR, "do_setclr_trap: err_nitems > 1");
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}
	ct = (struct conf_trap *)inpkt->data;

	/*
	 * Look for the local interface.  If none, use the default.
	 */
	if (ct->local_address == 0) {
		linter = any_interface;
	} else {
		if (IS_IPV4(&laddr))
			NSRCADR(&laddr) = ct->local_address;
		else
			SOCK_ADDR6(&laddr) = ct->local_address6;
		linter = findinterface(&laddr);
		if (NULL == linter) {
			req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
			return;
		}
	}

	if (IS_IPV4(&laddr))
		NSRCADR(&laddr) = ct->trap_address;
	else
		SOCK_ADDR6(&laddr) = ct->trap_address6;
	if (ct->trap_port)
		NSRCPORT(&laddr) = ct->trap_port;
	else
		SET_PORT(&laddr, TRAPPORT);

	if (set) {
		res = ctlsettrap(&laddr, linter, 0,
				 INFO_VERSION(inpkt->rm_vn_mode));
	} else {
		res = ctlclrtrap(&laddr, linter, 0);
	}

	if (!res) {
		req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
	} else {
		req_ack(srcadr, inter, inpkt, INFO_OKAY);
	}
	return;
}



/*
 * set_request_keyid - set the keyid used to authenticate requests
 */
static void
set_request_keyid(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	keyid_t *pkeyid;

	/*
	 * Restrict ourselves to one item only.
	 */
	if (INFO_NITEMS(inpkt->err_nitems) > 1) {
		msyslog(LOG_ERR, "set_request_keyid: err_nitems > 1");
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}

	pkeyid = (keyid_t *)inpkt->data;
	info_auth_keyid = ntohl(*pkeyid);
	req_ack(srcadr, inter, inpkt, INFO_OKAY);
}



/*
 * set_control_keyid - set the keyid used to authenticate requests
 */
static void
set_control_keyid(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	keyid_t *pkeyid;
	extern keyid_t ctl_auth_keyid;

	/*
	 * Restrict ourselves to one item only.
	 */
	if (INFO_NITEMS(inpkt->err_nitems) > 1) {
		msyslog(LOG_ERR, "set_control_keyid: err_nitems > 1");
		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
		return;
	}

	pkeyid = (keyid_t *)inpkt->data;
	ctl_auth_keyid = ntohl(*pkeyid);
	req_ack(srcadr, inter, inpkt, INFO_OKAY);
}



/*
 * get_ctl_stats - return some stats concerning the control message module
 */
static void
get_ctl_stats(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_control *ic;

	/*
	 * Importations from the control module
	 */
	extern u_long ctltimereset;
	extern u_long numctlreq;
	extern u_long numctlbadpkts;
	extern u_long numctlresponses;
	extern u_long numctlfrags;
	extern u_long numctlerrors;
	extern u_long numctltooshort;
	extern u_long numctlinputresp;
	extern u_long numctlinputfrag;
	extern u_long numctlinputerr;
	extern u_long numctlbadoffset;
	extern u_long numctlbadversion;
	extern u_long numctldatatooshort;
	extern u_long numctlbadop;
	extern u_long numasyncmsgs;

	ic = (struct info_control *)prepare_pkt(srcadr, inter, inpkt,
						sizeof(struct info_control));

	ic->ctltimereset = htonl((u_int32)(current_time - ctltimereset));
	ic->numctlreq = htonl((u_int32)numctlreq);
	ic->numctlbadpkts = htonl((u_int32)numctlbadpkts);
	ic->numctlresponses = htonl((u_int32)numctlresponses);
	ic->numctlfrags = htonl((u_int32)numctlfrags);
	ic->numctlerrors = htonl((u_int32)numctlerrors);
	ic->numctltooshort = htonl((u_int32)numctltooshort);
	ic->numctlinputresp = htonl((u_int32)numctlinputresp);
	ic->numctlinputfrag = htonl((u_int32)numctlinputfrag);
	ic->numctlinputerr = htonl((u_int32)numctlinputerr);
	ic->numctlbadoffset = htonl((u_int32)numctlbadoffset);
	ic->numctlbadversion = htonl((u_int32)numctlbadversion);
	ic->numctldatatooshort = htonl((u_int32)numctldatatooshort);
	ic->numctlbadop = htonl((u_int32)numctlbadop);
	ic->numasyncmsgs = htonl((u_int32)numasyncmsgs);

	(void) more_pkt();
	flush_pkt();
}


#ifdef KERNEL_PLL
/*
 * get_kernel_info - get kernel pll/pps information
 */
static void
get_kernel_info(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_kernel *ik;
	struct timex ntx;

	if (!pll_control) {
		req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
		return;
	}

	memset((char *)&ntx, 0, sizeof(ntx));
	if (ntp_adjtime(&ntx) < 0)
		msyslog(LOG_ERR, "get_kernel_info: ntp_adjtime() failed: %m");
	ik = (struct info_kernel *)prepare_pkt(srcadr, inter, inpkt,
	    sizeof(struct info_kernel));

	/*
	 * pll variables
	 */
	ik->offset = htonl((u_int32)ntx.offset);
	ik->freq = htonl((u_int32)ntx.freq);
	ik->maxerror = htonl((u_int32)ntx.maxerror);
	ik->esterror = htonl((u_int32)ntx.esterror);
	ik->status = htons(ntx.status);
	ik->constant = htonl((u_int32)ntx.constant);
	ik->precision = htonl((u_int32)ntx.precision);
	ik->tolerance = htonl((u_int32)ntx.tolerance);

	/*
	 * pps variables
	 */
	ik->ppsfreq = htonl((u_int32)ntx.ppsfreq);
	ik->jitter = htonl((u_int32)ntx.jitter);
	ik->shift = htons(ntx.shift);
	ik->stabil = htonl((u_int32)ntx.stabil);
	ik->jitcnt = htonl((u_int32)ntx.jitcnt);
	ik->calcnt = htonl((u_int32)ntx.calcnt);
	ik->errcnt = htonl((u_int32)ntx.errcnt);
	ik->stbcnt = htonl((u_int32)ntx.stbcnt);
	
	(void) more_pkt();
	flush_pkt();
}
#endif /* KERNEL_PLL */


#ifdef REFCLOCK
/*
 * get_clock_info - get info about a clock
 */
static void
get_clock_info(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct info_clock *ic;
	register u_int32 *clkaddr;
	register int items;
	struct refclockstat clock_stat;
	sockaddr_u addr;
	l_fp ltmp;

	ZERO_SOCK(&addr);
	AF(&addr) = AF_INET;
#ifdef ISC_PLATFORM_HAVESALEN
	addr.sa.sa_len = SOCKLEN(&addr);
#endif
	SET_PORT(&addr, NTP_PORT);
	items = INFO_NITEMS(inpkt->err_nitems);
	clkaddr = (u_int32 *) inpkt->data;

	ic = (struct info_clock *)prepare_pkt(srcadr, inter, inpkt,
					      sizeof(struct info_clock));

	while (items-- > 0) {
		NSRCADR(&addr) = *clkaddr++;
		if (!ISREFCLOCKADR(&addr) ||
		    findexistingpeer(&addr, NULL, -1, 0) == NULL) {
			req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
			return;
		}

		clock_stat.kv_list = (struct ctl_var *)0;

		refclock_control(&addr, NULL, &clock_stat);

		ic->clockadr = NSRCADR(&addr);
		ic->type = clock_stat.type;
		ic->flags = clock_stat.flags;
		ic->lastevent = clock_stat.lastevent;
		ic->currentstatus = clock_stat.currentstatus;
		ic->polls = htonl((u_int32)clock_stat.polls);
		ic->noresponse = htonl((u_int32)clock_stat.noresponse);
		ic->badformat = htonl((u_int32)clock_stat.badformat);
		ic->baddata = htonl((u_int32)clock_stat.baddata);
		ic->timestarted = htonl((u_int32)clock_stat.timereset);
		DTOLFP(clock_stat.fudgetime1, <mp);
		HTONL_FP(<mp, &ic->fudgetime1);
		DTOLFP(clock_stat.fudgetime2, <mp);
		HTONL_FP(<mp, &ic->fudgetime2);
		ic->fudgeval1 = htonl((u_int32)clock_stat.fudgeval1);
		ic->fudgeval2 = htonl(clock_stat.fudgeval2);

		free_varlist(clock_stat.kv_list);

		ic = (struct info_clock *)more_pkt();
	}
	flush_pkt();
}



/*
 * set_clock_fudge - get a clock's fudge factors
 */
static void
set_clock_fudge(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register struct conf_fudge *cf;
	register int items;
	struct refclockstat clock_stat;
	sockaddr_u addr;
	l_fp ltmp;

	ZERO_SOCK(&addr);
	memset((char *)&clock_stat, 0, sizeof clock_stat);
	items = INFO_NITEMS(inpkt->err_nitems);
	cf = (struct conf_fudge *) inpkt->data;

	while (items-- > 0) {
		AF(&addr) = AF_INET;
		NSRCADR(&addr) = cf->clockadr;
#ifdef ISC_PLATFORM_HAVESALEN
		addr.sa.sa_len = SOCKLEN(&addr);
#endif
		SET_PORT(&addr, NTP_PORT);
		if (!ISREFCLOCKADR(&addr) ||
		    findexistingpeer(&addr, NULL, -1, 0) == 0) {
			req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
			return;
		}

		switch(ntohl(cf->which)) {
		    case FUDGE_TIME1:
			NTOHL_FP(&cf->fudgetime, <mp);
			LFPTOD(<mp, clock_stat.fudgetime1);
			clock_stat.haveflags = CLK_HAVETIME1;
			break;
		    case FUDGE_TIME2:
			NTOHL_FP(&cf->fudgetime, <mp);
			LFPTOD(<mp, clock_stat.fudgetime2);
			clock_stat.haveflags = CLK_HAVETIME2;
			break;
		    case FUDGE_VAL1:
			clock_stat.fudgeval1 = ntohl(cf->fudgeval_flags);
			clock_stat.haveflags = CLK_HAVEVAL1;
			break;
		    case FUDGE_VAL2:
			clock_stat.fudgeval2 = ntohl(cf->fudgeval_flags);
			clock_stat.haveflags = CLK_HAVEVAL2;
			break;
		    case FUDGE_FLAGS:
			clock_stat.flags = (u_char) (ntohl(cf->fudgeval_flags) & 0xf);
			clock_stat.haveflags =
				(CLK_HAVEFLAG1|CLK_HAVEFLAG2|CLK_HAVEFLAG3|CLK_HAVEFLAG4);
			break;
		    default:
			msyslog(LOG_ERR, "set_clock_fudge: default!");
			req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
			return;
		}

		refclock_control(&addr, &clock_stat, (struct refclockstat *)0);
	}

	req_ack(srcadr, inter, inpkt, INFO_OKAY);
}
#endif

#ifdef REFCLOCK
/*
 * get_clkbug_info - get debugging info about a clock
 */
static void
get_clkbug_info(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	register int i;
	register struct info_clkbug *ic;
	register u_int32 *clkaddr;
	register int items;
	struct refclockbug bug;
	sockaddr_u addr;

	ZERO_SOCK(&addr);
	AF(&addr) = AF_INET;
#ifdef ISC_PLATFORM_HAVESALEN
	addr.sa.sa_len = SOCKLEN(&addr);
#endif
	SET_PORT(&addr, NTP_PORT);
	items = INFO_NITEMS(inpkt->err_nitems);
	clkaddr = (u_int32 *) inpkt->data;

	ic = (struct info_clkbug *)prepare_pkt(srcadr, inter, inpkt,
					       sizeof(struct info_clkbug));

	while (items-- > 0) {
		NSRCADR(&addr) = *clkaddr++;
		if (!ISREFCLOCKADR(&addr) ||
		    findexistingpeer(&addr, NULL, -1, 0) == 0) {
			req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
			return;
		}

		memset((char *)&bug, 0, sizeof bug);
		refclock_buginfo(&addr, &bug);
		if (bug.nvalues == 0 && bug.ntimes == 0) {
			req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
			return;
		}

		ic->clockadr = NSRCADR(&addr);
		i = bug.nvalues;
		if (i > NUMCBUGVALUES)
		    i = NUMCBUGVALUES;
		ic->nvalues = (u_char)i;
		ic->svalues = htons((u_short) (bug.svalues & ((1<= 0)
		    ic->values[i] = htonl(bug.values[i]);

		i = bug.ntimes;
		if (i > NUMCBUGTIMES)
		    i = NUMCBUGTIMES;
		ic->ntimes = (u_char)i;
		ic->stimes = htonl(bug.stimes);
		while (--i >= 0) {
			HTONL_FP(&bug.times[i], &ic->times[i]);
		}

		ic = (struct info_clkbug *)more_pkt();
	}
	flush_pkt();
}
#endif

/*
 * receiver of interface structures
 */
static void
fill_info_if_stats(void *data, interface_info_t *interface_info)
{
	struct info_if_stats **ifsp = (struct info_if_stats **)data;
	struct info_if_stats *ifs = *ifsp;
	endpt *ep = interface_info->ep;
	
	memset(ifs, 0, sizeof(*ifs));
	
	if (IS_IPV6(&ep->sin)) {
		if (!client_v6_capable) {
			return;
		}
		ifs->v6_flag = 1;
		ifs->unaddr.addr6 = SOCK_ADDR6(&ep->sin);
		ifs->unbcast.addr6 = SOCK_ADDR6(&ep->bcast);
		ifs->unmask.addr6 = SOCK_ADDR6(&ep->mask);
	} else {
		ifs->v6_flag = 0;
		ifs->unaddr.addr = SOCK_ADDR4(&ep->sin);
		ifs->unbcast.addr = SOCK_ADDR4(&ep->bcast);
		ifs->unmask.addr = SOCK_ADDR4(&ep->mask);
	}
	ifs->v6_flag = htonl(ifs->v6_flag);
	strncpy(ifs->name, ep->name, sizeof(ifs->name));
	ifs->family = htons(ep->family);
	ifs->flags = htonl(ep->flags);
	ifs->last_ttl = htonl(ep->last_ttl);
	ifs->num_mcast = htonl(ep->num_mcast);
	ifs->received = htonl(ep->received);
	ifs->sent = htonl(ep->sent);
	ifs->notsent = htonl(ep->notsent);
	ifs->ifindex = htonl(ep->ifindex);
	/* scope no longer in struct interface, in in6_addr typically */
	ifs->scopeid = ifs->ifindex;
	ifs->ifnum = htonl(ep->ifnum);
	ifs->uptime = htonl(current_time - ep->starttime);
	ifs->ignore_packets = ep->ignore_packets;
	ifs->peercnt = htonl(ep->peercnt);
	ifs->action = interface_info->action;
	
	*ifsp = (struct info_if_stats *)more_pkt();
}

/*
 * get_if_stats - get interface statistics
 */
static void
get_if_stats(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	struct info_if_stats *ifs;

	DPRINTF(3, ("wants interface statistics\n"));

	ifs = (struct info_if_stats *)prepare_pkt(srcadr, inter, inpkt,
	    v6sizeof(struct info_if_stats));

	interface_enumerate(fill_info_if_stats, &ifs);
	
	flush_pkt();
}

static void
do_if_reload(
	sockaddr_u *srcadr,
	struct interface *inter,
	struct req_pkt *inpkt
	)
{
	struct info_if_stats *ifs;

	DPRINTF(3, ("wants interface reload\n"));

	ifs = (struct info_if_stats *)prepare_pkt(srcadr, inter, inpkt,
	    v6sizeof(struct info_if_stats));

	interface_update(fill_info_if_stats, &ifs);
	
	flush_pkt();
}

ntp-4.2.6p5/ntpd/refclock_as2201.c0000644000175000017500000002612711332473277015523 0ustar  peterpeter/*
 * refclock_as2201 - clock driver for the Austron 2201A GPS
 *	Timing Receiver
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_AS2201)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"

#include 
#include 

/*
 * This driver supports the Austron 2200A/2201A GPS Receiver with
 * Buffered RS-232-C Interface Module. Note that the original 2200/2201
 * receivers will not work reliably with this driver, since the older
 * design cannot accept input commands at any reasonable data rate.
 *
 * The program sends a "*toc\r" to the radio and expects a response of
 * the form "yy:ddd:hh:mm:ss.mmm\r" where yy = year of century, ddd =
 * day of year, hh:mm:ss = second of day and mmm = millisecond of
 * second. Then, it sends statistics commands to the radio and expects
 * a multi-line reply showing the corresponding statistics or other
 * selected data. Statistics commands are sent in order as determined by
 * a vector of commands; these might have to be changed with different
 * radio options. If flag4 of the fudge configuration command is set to
 * 1, the statistics data are written to the clockstats file for later
 * processing.
 *
 * In order for this code to work, the radio must be placed in non-
 * interactive mode using the "off" command and with a single 
 * response using the "term cr" command. The setting of the "echo"
 * and "df" commands does not matter. The radio should select UTC
 * timescale using the "ts utc" command.
 *
 * There are two modes of operation for this driver. The first with
 * default configuration is used with stock kernels and serial-line
 * drivers and works with almost any machine. In this mode the driver
 * assumes the radio captures a timestamp upon receipt of the "*" that
 * begins the driver query. Accuracies in this mode are in the order of
 * a millisecond or two and the receiver can be connected to only one
 * host.
 *
 * The second mode of operation can be used for SunOS kernels that have
 * been modified with the ppsclock streams module included in this
 * distribution. The mode is enabled if flag3 of the fudge configuration
 * command has been set to 1. In this mode a precise timestamp is
 * available using a gadget box and 1-pps signal from the receiver. This
 * improves the accuracy to the order of a few tens of microseconds. In
 * addition, the serial output and 1-pps signal can be bussed to more
 * than one hosts, but only one of them should be connected to the
 * radio input data line. 
 */

/*
 * GPS Definitions
 */
#define SMAX		200	/* statistics buffer length */
#define	DEVICE		"/dev/gps%d" /* device name and unit */
#define	SPEED232	B9600	/* uart speed (9600 baud) */
#define	PRECISION	(-20)	/* precision assumed (about 1 us) */
#define	REFID		"GPS\0"	/* reference ID */
#define	DESCRIPTION	"Austron 2201A GPS Receiver" /* WRU */

#define	LENTOC		19	/* yy:ddd:hh:mm:ss.mmm timecode lngth */

/*
 * AS2201 unit control structure.
 */
struct as2201unit {
	char	*lastptr;	/* statistics buffer pointer */
	char	stats[SMAX];	/* statistics buffer */
	int	linect;		/* count of lines remaining */
	int	index;		/* current statistics command */
};

/*
 * Radio commands to extract statitistics
 *
 * A command consists of an ASCII string terminated by a  (\r). The
 * command list consist of a sequence of commands terminated by a null
 * string ("\0"). One command from the list is sent immediately
 * following each received timecode (*toc\r command) and the ASCII
 * strings received from the radio are saved along with the timecode in
 * the clockstats file. Subsequent commands are sent at each timecode,
 * with the last one in the list followed by the first one. The data
 * received from the radio consist of ASCII strings, each terminated by
 * a  (\r) character. The number of strings for each command is
 * specified as the first line of output as an ASCII-encode number. Note
 * that the ETF command requires the Input Buffer Module and the LORAN
 * commands require the LORAN Assist Module. However, if these modules
 * are not installed, the radio and this driver will continue to operate
 * successfuly, but no data will be captured for these commands.
 */
static char stat_command[][30] = {
	"ITF\r",		/* internal time/frequency */
	"ETF\r",		/* external time/frequency */
	"LORAN ENSEMBLE\r",	/* GPS/LORAN ensemble statistics */
	"LORAN TDATA\r",	/* LORAN signal data */
	"ID;OPT;VER\r",		/* model; options; software version */

	"ITF\r",		/* internal time/frequency */
	"ETF\r",		/* external time/frequency */
	"LORAN ENSEMBLE\r",	/* GPS/LORAN ensemble statistics */
	"TRSTAT\r",		/* satellite tracking status */
	"POS;PPS;PPSOFF\r",	/* position, pps source, offsets */

	"ITF\r",		/* internal time/frequency */
	"ETF\r",		/* external time/frequency */
	"LORAN ENSEMBLE\r",	/* GPS/LORAN ensemble statistics */
	"LORAN TDATA\r",	/* LORAN signal data */
	"UTC\r",			/* UTC leap info */

	"ITF\r",		/* internal time/frequency */
	"ETF\r",		/* external time/frequency */
	"LORAN ENSEMBLE\r",	/* GPS/LORAN ensemble statistics */
	"TRSTAT\r",		/* satellite tracking status */
	"OSC;ET;TEMP\r",	/* osc type; tune volts; oven temp */
	"\0"			/* end of table */
};

/*
 * Function prototypes
 */
static	int	as2201_start	(int, struct peer *);
static	void	as2201_shutdown	(int, struct peer *);
static	void	as2201_receive	(struct recvbuf *);
static	void	as2201_poll	(int, struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_as2201 = {
	as2201_start,		/* start up driver */
	as2201_shutdown,	/* shut down driver */
	as2201_poll,		/* transmit poll message */
	noentry,		/* not used (old as2201_control) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old as2201_buginfo) */
	NOFLAGS			/* not used */
};


/*
 * as2201_start - open the devices and initialize data for processing
 */
static int
as2201_start(
	int unit,
	struct peer *peer
	)
{
	register struct as2201unit *up;
	struct refclockproc *pp;
	int fd;
	char gpsdev[20];

	/*
	 * Open serial port. Use CLK line discipline, if available.
	 */
	snprintf(gpsdev, sizeof(gpsdev), DEVICE, unit);
	if (!(fd = refclock_open(gpsdev, SPEED232, LDISC_CLK)))
		return (0);

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp = peer->procptr;
	pp->io.clock_recv = as2201_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		pp->io.fd = -1;
		free(up);
		return (0);
	}
	pp->unitptr = (caddr_t)up;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	peer->burst = NSTAGE;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	up->lastptr = up->stats;
	up->index = 0;
	return (1);
}


/*
 * as2201_shutdown - shut down the clock
 */
static void
as2201_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct as2201unit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct as2201unit *)pp->unitptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}


/*
 * as2201__receive - receive data from the serial interface
 */
static void
as2201_receive(
	struct recvbuf *rbufp
	)
{
	register struct as2201unit *up;
	struct refclockproc *pp;
	struct peer *peer;
	l_fp trtmp;

	/*
	 * Initialize pointers and read the timecode and timestamp.
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct as2201unit *)pp->unitptr;
	pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);
#ifdef DEBUG
	if (debug)
	    printf("gps: timecode %d %d %s\n",
		   up->linect, pp->lencode, pp->a_lastcode);
#endif
	if (pp->lencode == 0)
	    return;

	/*
	 * If linect is greater than zero, we must be in the middle of a
	 * statistics operation, so simply tack the received data at the
	 * end of the statistics string. If not, we could either have
	 * just received the timecode itself or a decimal number
	 * indicating the number of following lines of the statistics
	 * reply. In the former case, write the accumulated statistics
	 * data to the clockstats file and continue onward to process
	 * the timecode; in the later case, save the number of lines and
	 * quietly return.
	 */
	if (pp->sloppyclockflag & CLK_FLAG2)
		pp->lastrec = trtmp;
	if (up->linect > 0) {
		up->linect--;
		if ((int)(up->lastptr - up->stats + pp->lencode) > SMAX - 2)
		    return;
		*up->lastptr++ = ' ';
		(void)strcpy(up->lastptr, pp->a_lastcode);
		up->lastptr += pp->lencode;
		return;
	} else {
		if (pp->lencode == 1) {
			up->linect = atoi(pp->a_lastcode);
			return;
		} else {
			record_clock_stats(&peer->srcadr, up->stats);
#ifdef DEBUG
			if (debug)
			    printf("gps: stat %s\n", up->stats);
#endif
		}
	}
	up->lastptr = up->stats;
	*up->lastptr = '\0';

	/*
	 * We get down to business, check the timecode format and decode
	 * its contents. If the timecode has invalid length or is not in
	 * proper format, we declare bad format and exit.
	 */
	if (pp->lencode < LENTOC) {
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	/*
	 * Timecode format: "yy:ddd:hh:mm:ss.mmm"
	 */
	if (sscanf(pp->a_lastcode, "%2d:%3d:%2d:%2d:%2d.%3ld", &pp->year,
		   &pp->day, &pp->hour, &pp->minute, &pp->second, &pp->nsec)
	    != 6) {
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}
	pp->nsec *= 1000000;

	/*
	 * Test for synchronization (this is a temporary crock).
	 */
	if (pp->a_lastcode[2] != ':')
		pp->leap = LEAP_NOTINSYNC;
	else
		pp->leap = LEAP_NOWARNING;

	/*
	 * Process the new sample in the median filter and determine the
	 * timecode timestamp.
	 */
	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}

	/*
	 * If CLK_FLAG4 is set, initialize the statistics buffer and
	 * send the next command. If not, simply write the timecode to
	 * the clockstats file.
	 */
	(void)strcpy(up->lastptr, pp->a_lastcode);
	up->lastptr += pp->lencode;
	if (pp->sloppyclockflag & CLK_FLAG4) {
		*up->lastptr++ = ' ';
		(void)strcpy(up->lastptr, stat_command[up->index]);
		up->lastptr += strlen(stat_command[up->index]);
		up->lastptr--;
		*up->lastptr = '\0';
		(void)write(pp->io.fd, stat_command[up->index],
		    strlen(stat_command[up->index]));
		up->index++;
		if (*stat_command[up->index] == '\0')
			up->index = 0;
	}
}


/*
 * as2201_poll - called by the transmit procedure
 *
 * We go to great pains to avoid changing state here, since there may be
 * more than one eavesdropper receiving the same timecode.
 */
static void
as2201_poll(
	int unit,
	struct peer *peer
	)
{
	struct refclockproc *pp;

	/*
	 * Send a "\r*toc\r" to get things going. We go to great pains
	 * to avoid changing state, since there may be more than one
	 * eavesdropper watching the radio.
	 */
	pp = peer->procptr;
	if (write(pp->io.fd, "\r*toc\r", 6) != 6) {
		refclock_report(peer, CEVNT_FAULT);
	} else {
		pp->polls++;
		if (!(pp->sloppyclockflag & CLK_FLAG2))
			get_systime(&pp->lastrec);
	}
	if (peer->burst > 0)
                return;
        if (pp->coderecv == pp->codeproc) {
                refclock_report(peer, CEVNT_TIMEOUT);
                return;
        }
        refclock_receive(peer);
	peer->burst = NSTAGE;
}

#else
int refclock_as2201_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/ntpd.10000644000175000017500000002371211675460564013630 0ustar  peterpeter.TH NTPD 1 2011-12-24 "( 4.2.6p5)" "Programmer's Manual"
.\"  EDIT THIS FILE WITH CAUTION  (ntpd.1)
.\"  
.\"  It has been AutoGen-ed  December 24, 2011 at 06:34:12 PM by AutoGen 5.12
.\"  From the definitions    ntpd-opts.def
.\"  and the template file   agman1.tpl
.\"
.SH NAME
ntpd \- NTP daemon program
.SH SYNOPSIS
.B ntpd
.\" Mixture of short (flag) options and long options
.RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..."
.PP
All arguments must be options.
.SH "DESCRIPTION"
This manual page briefly documents the \fBntpd\fP command.

.SH OPTIONS
.TP
.BR \-4 ", " \--ipv4
Force IPv4 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.
.TP
.BR \-6 ", " \--ipv6
Force IPv6 DNS name resolution.
This option must not appear in combination with any of the following options:
ipv4.
.sp
Force DNS resolution of following host names on the command line
to the IPv6 namespace.
.TP
.BR \-a ", " \--authreq
Require crypto authentication.
This option must not appear in combination with any of the following options:
authnoreq.
.sp
Require cryptographic authentication for broadcast client,
multicast client and symmetric passive associations.
This is the default.
.TP
.BR \-A ", " \--authnoreq
Do not require crypto authentication.
This option must not appear in combination with any of the following options:
authreq.
.sp
Do not require cryptographic authentication for broadcast client,
multicast client and symmetric passive associations.
This is almost never a good idea.
.TP
.BR \-b ", " \--bcastsync
Allow us to sync to broadcast servers.
.sp

.TP
.BR \-c " \fIstring\fP, " \--configfile "=" \fIstring\fP
configuration file name.
.sp
The name and path of the configuration file,
/etc/ntp.conf
by default.
.TP
.BR \-d ", " \--debug-level
Increase output debug message level.
This option may appear an unlimited number of times.
.sp
Increase the debugging message output level.
.TP
.BR \-D " \fIstring\fP, " \--set-debug-level "=" \fIstring\fP
Set the output debug message level.
This option may appear an unlimited number of times.
.sp
Set the output debugging level.  Can be supplied multiple times,
but each overrides the previous value(s).
.TP
.BR \-f " \fIstring\fP, " \--driftfile "=" \fIstring\fP
frequency drift file name.
.sp
The name and path of the frequency file,
/etc/ntp.drift
by default.
This is the same operation as the
driftfile driftfile
configuration specification in the 
/etc/ntp.conf
file.
.TP
.BR \-g ", " \--panicgate
Allow the first adjustment to be Big.
This option may appear an unlimited number of times.
.sp
Normally,
ntpd
exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
ntpd
will exit with a message to the system log. This option can be used with the
-q
and
-x
options.
See the
tinker
configuration file directive for other options.
.TP
.BR \-i " \fIstring\fP, " \--jaildir "=" \fIstring\fP
Jail directory.
.sp
Chroot the server to the directory
jaildir
.
This option also implies that the server attempts to drop root privileges at startup.
You may need to also specify a
-u
option.
This option is only available if the OS supports adjusting the clock
without full root privileges.
This option is supported under NetBSD (configure with
--enable-clockctl
) and Linux (configure with
--enable-linuxcaps
).
.TP
.BR \-I " \fIiface\fP, " \--interface "=" \fIiface\fP
Listen on an interface name or address.
This option may appear an unlimited number of times.
.sp
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
interface command, which is more versatile. 
.TP
.BR \-k " \fIstring\fP, " \--keyfile "=" \fIstring\fP
path to symmetric keys.
.sp
Specify the name and path of the symmetric key file.
/etc/ntp.keys
is the default.
This is the same operation as the
keys keyfile
configuration file directive.
.TP
.BR \-l " \fIstring\fP, " \--logfile "=" \fIstring\fP
path to the log file.
.sp
Specify the name and path of the log file.
The default is the system log file.
This is the same operation as the
logfile logfile
configuration file directive.
.TP
.BR \-L ", " \--novirtualips
Do not listen to virtual interfaces.
.sp
Do not listen to virtual interfaces, defined as those with
names containing a colon.  This option is deprecated.  Please
consider using the configuration file interface command, which
is more versatile.
.TP
.BR \-M ", " \--modifymmtimer
Modify Multimedia Timer (Windows only).
.sp
Set the Windows Multimedia Timer to highest resolution.  This
ensures the resolution does not change while ntpd is running,
avoiding timekeeping glitches associated with changes.
.TP
.BR \-n ", " \--nofork
Do not fork.
.sp

.TP
.BR \-N ", " \--nice
Run at high priority.
.sp
To the extent permitted by the operating system, run
ntpd
at the highest priority.
.TP
.BR \-p " \fIstring\fP, " \--pidfile "=" \fIstring\fP
path to the PID file.
.sp
Specify the name and path of the file used to record
ntpd's
process ID.
This is the same operation as the
pidfile pidfile
configuration file directive.
.TP
.BR \-P " \fInumber\fP, " \--priority "=" \fInumber\fP
Process priority.
This option takes an integer number as its argument.
.sp
To the extent permitted by the operating system, run
ntpd
at the specified
sched_setscheduler(SCHED_FIFO)
priority.
.TP
.BR \-q ", " \--quit
Set the time and quit.
.sp
ntpd
will exit just after the first time the clock is set. This behavior mimics that of the
ntpdate
program, which is to be retired.
The
-g
and
-x
options can be used with this option.
Note: The kernel time discipline is disabled with this option.
.TP
.BR \-r " \fIstring\fP, " \--propagationdelay "=" \fIstring\fP
Broadcast/propagation delay.
.sp
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.
.TP
.BR \--saveconfigquit "=\fIstring\fP"
Save parsed configuration and quit.
.sp
Cause ntpd to parse its startup configuration file and save an
equivalent to the given filename and exit.  This option was
designed for automated testing.
.TP
.BR \-s " \fIstring\fP, " \--statsdir "=" \fIstring\fP
Statistics file location.
.sp
Specify the directory path for files created by the statistics facility.
This is the same operation as the
statsdir statsdir
configuration file directive.
.TP
.BR \-t " \fItkey\fP, " \--trustedkey "=" \fItkey\fP
Trusted key number.
This option may appear an unlimited number of times.
.sp
Add a key number to the trusted key list.
.TP
.BR \-u " \fIstring\fP, " \--user "=" \fIstring\fP
Run as userid (or userid:groupid).
.sp
Specify a user, and optionally a group, to switch to.
This option is only available if the OS supports adjusting the clock
without full root privileges.
This option is supported under NetBSD (configure with
--enable-clockctl
) and Linux (configure with
--enable-linuxcaps
).
.TP
.BR \-U " \fInumber\fP, " \--updateinterval "=" \fInumber\fP
interval in seconds between scans for new or dropped interfaces.
This option takes an integer number as its argument.
.sp
Give the time in seconds between two scans for new or dropped interfaces.
For systems with routing socket support the scans will be performed shortly after the interface change
has been detected by the system.
Use 0 to disable scanning. 60 seconds is the minimum time between scans.
.TP
.BR \--var "=\fInvar\fP"
make ARG an ntp variable (RW).
This option may appear an unlimited number of times.
.sp

.TP
.BR \--dvar "=\fIndvar\fP"
make ARG an ntp variable (RW|DEF).
This option may appear an unlimited number of times.
.sp

.TP
.BR \-x ", " \--slew
Slew up to 600 seconds.
.sp
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.
Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
Thus, an adjustment as much as 600 s will take almost 14 days to complete.
This option can be used with the
-g
and
-q
options.
See the
tinker
configuration file directive for other options.
Note: The kernel time discipline is disabled with this option.
.TP
.BR \--usepcc
Use CPU cycle counter (Windows only).
.sp
Attempt to substitute the CPU counter for QueryPerformanceCounter.
The CPU counter and QueryPerformanceCounter are compared, and if
they have the same frequency, the CPU counter (RDTSC on x86) is
used directly, saving the overhead of a system call.
.TP
.BR \--pccfreq "=\fIstring\fP"
Force CPU cycle counter use (Windows only).
.sp
Force substitution the CPU counter for QueryPerformanceCounter.
The CPU counter (RDTSC on x86) is used unconditionally with the
given frequency (in Hz).
.TP
.BR \-? , " \--help"
Display extended usage information and exit.
.TP
.BR \-! , " \--more-help"
Extended usage information passed thru pager.
.TP
.BR \- " [{\fIv|c|n\fP}]," " \--version" "[=\fI{v|c|n}\fP]"
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.
.SH OPTION PRESETS
Any option that is not marked as \fInot presettable\fP may be preset
by loading values from environment variables named:
.nf
  \fBNTPD_\fP or \fBNTPD\fP
.fi
.ad
.SH AUTHOR
David L. Mills and/or others
.br
Please send bug reports to:  http://bugs.ntp.org, bugs@ntp.org

.PP
.nf
.na
see html/copyright.html

.fi
.ad
.PP
This manual page was \fIAutoGen\fP-erated from the \fBntpd\fP
option definitions.
ntp-4.2.6p5/ntpd/ntp_parser.y0000644000175000017500000006432111460751117015136 0ustar  peterpeter/* ntp_parser.y
 *
 * The parser for the NTP configuration file.
 *
 * Written By:	Sachin Kamboj
 *		University of Delaware
 *		Newark, DE 19711
 * Copyright (c) 2006
 */

%{
  #ifdef HAVE_CONFIG_H
  # include 
  #endif

  #include "ntp.h"
  #include "ntpd.h"
  #include "ntp_machine.h"
  #include "ntp_stdlib.h"
  #include "ntp_filegen.h"
  #include "ntp_data_structures.h"
  #include "ntp_scanner.h"
  #include "ntp_config.h"
  #include "ntp_crypto.h"

  #include "ntpsim.h"		/* HMS: Do we really want this all the time? */
				/* SK: It might be a good idea to always
				   include the simulator code. That way
				   someone can use the same configuration file
				   for both the simulator and the daemon
				*/


  struct FILE_INFO *ip_file;   /* Pointer to the configuration file stream */

  #define YYMALLOC	emalloc
  #define YYFREE	free
  #define YYERROR_VERBOSE
  #define YYMAXDEPTH	1000   /* stop the madness sooner */
  void yyerror(const char *msg);
  extern int input_from_file;  /* 0=input from ntpq :config */
%}

/* 
 * Enable generation of token names array even without YYDEBUG.
 * We access via token_name() defined below.
 */
%token-table

%union {
    char   *String;
    double  Double;
    int     Integer;
    void   *VoidPtr;
    queue  *Queue;
    struct attr_val *Attr_val;
    struct address_node *Address_node;
    struct setvar_node *Set_var;

    /* Simulation types */
    server_info *Sim_server;
    script_info *Sim_script;
}

/* TERMINALS (do not appear left of colon) */
%token		T_Age
%token		T_All
%token		T_Allan
%token		T_Auth
%token		T_Autokey
%token		T_Automax
%token		T_Average
%token		T_Bclient
%token		T_Beacon
%token		T_Bias
%token		T_Broadcast
%token		T_Broadcastclient
%token		T_Broadcastdelay
%token		T_Burst
%token		T_Calibrate
%token		T_Calldelay
%token		T_Ceiling
%token		T_Clockstats
%token		T_Cohort
%token		T_ControlKey
%token		T_Crypto
%token		T_Cryptostats
%token		T_Day
%token		T_Default
%token		T_Digest
%token		T_Disable
%token		T_Discard
%token		T_Dispersion
%token		T_Double
%token		T_Driftfile
%token		T_Drop
%token		T_Ellipsis	/* "..." not "ellipsis" */
%token		T_Enable
%token		T_End
%token		T_False
%token		T_File
%token		T_Filegen
%token		T_Flag1
%token		T_Flag2
%token		T_Flag3
%token		T_Flag4
%token		T_Flake
%token		T_Floor
%token		T_Freq
%token		T_Fudge
%token		T_Host
%token		T_Huffpuff
%token		T_Iburst
%token		T_Ident
%token		T_Ignore
%token		T_Includefile
%token		T_Integer
%token		T_Interface
%token		T_Ipv4
%token		T_Ipv4_flag
%token		T_Ipv6
%token		T_Ipv6_flag
%token		T_Kernel
%token		T_Key
%token		T_Keys
%token		T_Keysdir
%token		T_Kod
%token		T_Mssntp
%token		T_Leapfile
%token		T_Limited
%token		T_Link
%token		T_Listen
%token		T_Logconfig
%token		T_Logfile
%token		T_Loopstats
%token		T_Lowpriotrap
%token		T_Manycastclient
%token		T_Manycastserver
%token		T_Mask
%token		T_Maxclock
%token		T_Maxdist
%token		T_Maxpoll
%token		T_Minclock
%token		T_Mindist
%token		T_Minimum
%token		T_Minpoll
%token		T_Minsane
%token		T_Mode
%token		T_Monitor
%token		T_Month
%token		T_Multicastclient
%token		T_Nic
%token		T_Nolink
%token		T_Nomodify
%token		T_None
%token		T_Nopeer
%token		T_Noquery
%token		T_Noselect
%token		T_Noserve
%token		T_Notrap
%token		T_Notrust
%token		T_Ntp
%token		T_Ntpport
%token		T_NtpSignDsocket
%token		T_Orphan
%token		T_Panic
%token		T_Peer
%token		T_Peerstats
%token		T_Phone
%token		T_Pid
%token		T_Pidfile
%token		T_Pool
%token		T_Port
%token		T_Preempt
%token		T_Prefer
%token		T_Protostats
%token		T_Pw
%token		T_Qos
%token		T_Randfile
%token		T_Rawstats
%token		T_Refid
%token		T_Requestkey
%token		T_Restrict
%token		T_Revoke
%token		T_Saveconfigdir
%token		T_Server
%token		T_Setvar
%token		T_Sign
%token		T_Statistics
%token		T_Stats
%token		T_Statsdir
%token		T_Step
%token		T_Stepout
%token		T_Stratum
%token		T_String
%token		T_Sysstats
%token		T_Tick
%token		T_Time1
%token		T_Time2
%token		T_Timingstats
%token		T_Tinker
%token		T_Tos
%token		T_Trap
%token		T_True
%token		T_Trustedkey
%token		T_Ttl
%token		T_Type
%token		T_Unconfig
%token		T_Unpeer
%token		T_Version
%token		T_WanderThreshold	/* Not a token */
%token		T_Week
%token		T_Wildcard
%token		T_Xleave
%token		T_Year
%token		T_Flag		/* Not an actual token */
%token		T_Void		/* Not an actual token */
%token		T_EOC


/* NTP Simulator Tokens */
%token		T_Simulate
%token		T_Beep_Delay
%token		T_Sim_Duration
%token		T_Server_Offset
%token		T_Duration
%token		T_Freq_Offset
%token		T_Wander
%token		T_Jitter
%token		T_Prop_Delay
%token		T_Proc_Delay



/*** NON-TERMINALS ***/
%type		access_control_flag
%type			ac_flag_list
%type		address
%type		address_fam
%type			address_list
%type		boolean
%type		client_type
%type		crypto_command
%type			crypto_command_list
%type		crypto_str_keyword
%type		discard_option
%type		discard_option_keyword
%type			discard_option_list
%type		enable_disable
%type		filegen_option
%type			filegen_option_list
%type		filegen_type
%type		fudge_factor
%type		fudge_factor_bool_keyword
%type		fudge_factor_dbl_keyword
%type			fudge_factor_list
%type			integer_list
%type			integer_list_range
%type		integer_list_range_elt
%type		integer_range
%type		nic_rule_action
%type		interface_command
%type		interface_nic
%type		ip_address
%type		link_nolink
%type		log_config_command
%type			log_config_list
%type		misc_cmd_dbl_keyword
%type		misc_cmd_str_keyword
%type		misc_cmd_str_lcl_keyword
%type		nic_rule_class
%type		number
%type		option
%type		option_flag
%type		option_flag_keyword
%type			option_list
%type		option_int
%type		option_int_keyword
%type		stat
%type			stats_list
%type			string_list
%type		system_option
%type		system_option_flag_keyword
%type			system_option_list
%type		t_default_or_zero
%type		tinker_option_keyword
%type		tinker_option
%type			tinker_option_list
%type		tos_option
%type		tos_option_dbl_keyword
%type		tos_option_int_keyword
%type			tos_option_list
%type		trap_option
%type			trap_option_list
%type		unpeer_keyword
%type		variable_assign

/* NTP Simulator non-terminals */
%type			sim_init_statement_list
%type		sim_init_statement
%type			sim_server_list
%type		sim_server
%type		sim_server_offset
%type		sim_server_name
%type			sim_act_list
%type		sim_act
%type			sim_act_stmt_list
%type		sim_act_stmt

%%

/* ntp.conf
 * Configuration File Grammar
 * --------------------------
 */

configuration
	:	command_list
	;

command_list
	:	command_list command T_EOC
	|	command T_EOC
	|	error T_EOC
		{
			/* I will need to incorporate much more fine grained
			 * error messages. The following should suffice for
			 * the time being.
			 */
			msyslog(LOG_ERR, 
				"syntax error in %s line %d, column %d",
				ip_file->fname,
				ip_file->err_line_no,
				ip_file->err_col_no);
		}
	;

command :	/* NULL STATEMENT */
	|	server_command
	|	unpeer_command
	|	other_mode_command
	|	authentication_command
	|	monitoring_command
	|	access_control_command
	|	orphan_mode_command
	|	fudge_command
	|	system_option_command
	|	tinker_command
	|	miscellaneous_command
	|	simulate_command
	;

/* Server Commands
 * ---------------
 */

server_command
	:	client_type address option_list
		{
			struct peer_node *my_node =  create_peer_node($1, $2, $3);
			if (my_node)
				enqueue(cfgt.peers, my_node);
		}
	|	client_type address
		{
			struct peer_node *my_node = create_peer_node($1, $2, NULL);
			if (my_node)
				enqueue(cfgt.peers, my_node);
		}
	;

client_type
	:	T_Server
	|	T_Pool
	|	T_Peer
	|	T_Broadcast
	|	T_Manycastclient
	;

address
	:	ip_address
	|	address_fam T_String
			{ $$ = create_address_node($2, $1); }
	;

ip_address
	:	T_String
			{ $$ = create_address_node($1, 0); }
	;

address_fam
	:	T_Ipv4_flag
			{ $$ = AF_INET; }
	|	T_Ipv6_flag
			{ $$ = AF_INET6; }
	;

option_list
	:	option_list option { $$ = enqueue($1, $2); }
	|	option { $$ = enqueue_in_new_queue($1); }
	;

option
	:	option_flag
	|	option_int
	|	T_Bias number
			{ $$ = create_attr_dval($1, $2); }
	;

option_flag
	:	option_flag_keyword
			{ $$ = create_attr_ival(T_Flag, $1); }
	;

option_flag_keyword
	:	T_Autokey
	|	T_Burst
	|	T_Iburst
	|	T_Noselect
	|	T_Preempt
	|	T_Prefer
	|	T_True
	|	T_Xleave
	;

option_int
	:	option_int_keyword T_Integer
			{ $$ = create_attr_ival($1, $2); }
	;

option_int_keyword
	:	T_Key
	|	T_Minpoll
	|	T_Maxpoll
	|	T_Ttl
	|	T_Mode
	|	T_Version
	;



/* unpeer commands
 * ---------------
 */

unpeer_command
	:	unpeer_keyword address
		{
			struct unpeer_node *my_node = create_unpeer_node($2);
			if (my_node)
				enqueue(cfgt.unpeers, my_node);
		}
	;	
unpeer_keyword	
	:	T_Unconfig
	|	T_Unpeer
	;
	
	
/* Other Modes
 * (broadcastclient manycastserver multicastclient)
 * ------------------------------------------------
 */

other_mode_command
	:	T_Broadcastclient
			{ cfgt.broadcastclient = 1; }
	|	T_Manycastserver address_list
			{ append_queue(cfgt.manycastserver, $2); }
	|	T_Multicastclient address_list
			{ append_queue(cfgt.multicastclient, $2); }
	;



/* Authentication Commands
 * -----------------------
 */

authentication_command
	:	T_Automax T_Integer
			{ enqueue(cfgt.vars, create_attr_ival($1, $2)); }
	|	T_ControlKey T_Integer
			{ cfgt.auth.control_key = $2; }
	|	T_Crypto crypto_command_list
		{ 
			cfgt.auth.cryptosw++;
			append_queue(cfgt.auth.crypto_cmd_list, $2);
		}
	|	T_Keys T_String
			{ cfgt.auth.keys = $2; }
	|	T_Keysdir T_String
			{ cfgt.auth.keysdir = $2; }
	|	T_Requestkey T_Integer
			{ cfgt.auth.request_key = $2; }
	|	T_Revoke T_Integer
			{ cfgt.auth.revoke = $2; }
	|	T_Trustedkey integer_list_range
			{ cfgt.auth.trusted_key_list = $2; }
	|	T_NtpSignDsocket T_String
			{ cfgt.auth.ntp_signd_socket = $2; }
	;

crypto_command_list
	:	/* empty list */
			{ $$ = create_queue(); }
	|	crypto_command_list crypto_command
		{ 
			if ($2 != NULL)
				$$ = enqueue($1, $2);
			else
				$$ = $1;
		}
	;

crypto_command
	:	crypto_str_keyword T_String
			{ $$ = create_attr_sval($1, $2); }
	|	T_Revoke T_Integer
		{
			$$ = NULL;
			cfgt.auth.revoke = $2;
			msyslog(LOG_WARNING,
				"'crypto revoke %d' is deprecated, "
				"please use 'revoke %d' instead.",
				cfgt.auth.revoke, cfgt.auth.revoke);
		}
	;

crypto_str_keyword
	:	T_Host
	|	T_Ident
	|	T_Pw
	|	T_Randfile
	|	T_Sign
	|	T_Digest
	;


/* Orphan Mode Commands
 * --------------------
 */

orphan_mode_command
	:	T_Tos tos_option_list
			{ append_queue(cfgt.orphan_cmds,$2); }
	;

tos_option_list
	:	tos_option_list tos_option { $$ = enqueue($1, $2); }
	|	tos_option { $$ = enqueue_in_new_queue($1); }
	;

tos_option
	:	tos_option_int_keyword T_Integer
			{ $$ = create_attr_dval($1, (double)$2); }
	|	tos_option_dbl_keyword number
			{ $$ = create_attr_dval($1, $2); }
	|	T_Cohort boolean
			{ $$ = create_attr_dval($1, (double)$2); }
	;

tos_option_int_keyword
	:	T_Ceiling
	|	T_Floor
	|	T_Orphan
	|	T_Minsane
	|	T_Beacon
	;

tos_option_dbl_keyword
	:	T_Mindist
	|	T_Maxdist
	|	T_Minclock
	|	T_Maxclock
	;


/* Monitoring Commands
 * -------------------
 */

monitoring_command
	:	T_Statistics stats_list
			{ append_queue(cfgt.stats_list, $2); }
	|	T_Statsdir T_String
		{
			if (input_from_file) {
				cfgt.stats_dir = $2;
			} else {
				YYFREE($2);
				yyerror("statsdir remote configuration ignored");
			}
		}
	|	T_Filegen stat filegen_option_list
		{
			enqueue(cfgt.filegen_opts,
				create_filegen_node($2, $3));
		}
	;

stats_list
	:	stats_list stat { $$ = enqueue($1, create_ival($2)); }
	|	stat { $$ = enqueue_in_new_queue(create_ival($1)); }
	;

stat
	:	T_Clockstats
	|	T_Cryptostats
	|	T_Loopstats
	|	T_Peerstats
	|	T_Rawstats
	|	T_Sysstats
	|	T_Timingstats
	|	T_Protostats
	;

filegen_option_list
	:	/* empty list */
			{ $$ = create_queue(); }
	|	filegen_option_list filegen_option
		{
			if ($2 != NULL)
				$$ = enqueue($1, $2);
			else
				$$ = $1;
		}
	;

filegen_option
	:	T_File T_String
		{
			if (input_from_file) {
				$$ = create_attr_sval($1, $2);
			} else {
				$$ = NULL;
				YYFREE($2);
				yyerror("filegen file remote config ignored");
			}
		}
	|	T_Type filegen_type
		{
			if (input_from_file) {
				$$ = create_attr_ival($1, $2);
			} else {
				$$ = NULL;
				yyerror("filegen type remote config ignored");
			}
		}
	|	link_nolink
		{
			const char *err;
			
			if (input_from_file) {
				$$ = create_attr_ival(T_Flag, $1);
			} else {
				$$ = NULL;
				if (T_Link == $1)
					err = "filegen link remote config ignored";
				else
					err = "filegen nolink remote config ignored";
				yyerror(err);
			}
		}
	|	enable_disable
			{ $$ = create_attr_ival(T_Flag, $1); }
	;

link_nolink
	:	T_Link
	|	T_Nolink
	;

enable_disable
	:	T_Enable
	|	T_Disable
	;

filegen_type
	:	T_None
	|	T_Pid
	|	T_Day
	|	T_Week
	|	T_Month
	|	T_Year
	|	T_Age
	;


/* Access Control Commands
 * -----------------------
 */

access_control_command
	:	T_Discard discard_option_list
		{
			append_queue(cfgt.discard_opts, $2);
		}
	|	T_Restrict address ac_flag_list
		{
			enqueue(cfgt.restrict_opts,
				create_restrict_node($2, NULL, $3, ip_file->line_no));
		}
	|	T_Restrict T_Default ac_flag_list
		{
			enqueue(cfgt.restrict_opts,
				create_restrict_node(NULL, NULL, $3, ip_file->line_no));
		}
	|	T_Restrict T_Ipv4_flag T_Default ac_flag_list
		{
			enqueue(cfgt.restrict_opts,
				create_restrict_node(
					create_address_node(
						estrdup("0.0.0.0"), 
						AF_INET),
					create_address_node(
						estrdup("0.0.0.0"), 
						AF_INET),
					$4, 
					ip_file->line_no));
		}
	|	T_Restrict T_Ipv6_flag T_Default ac_flag_list
		{
			enqueue(cfgt.restrict_opts,
				create_restrict_node(
					create_address_node(
						estrdup("::"), 
						AF_INET6),
					create_address_node(
						estrdup("::"), 
						AF_INET6),
					$4, 
					ip_file->line_no));
		}
	|	T_Restrict ip_address T_Mask ip_address ac_flag_list
		{
			enqueue(cfgt.restrict_opts,
				create_restrict_node($2, $4, $5, ip_file->line_no));
		}
	;

ac_flag_list
	:	/* empty list is allowed */
			{ $$ = create_queue(); }
	|	ac_flag_list access_control_flag
			{ $$ = enqueue($1, create_ival($2)); }
	;

access_control_flag
	:	T_Flake
	|	T_Ignore
	|	T_Kod
	|	T_Mssntp
	|	T_Limited
	|	T_Lowpriotrap
	|	T_Nomodify
	|	T_Nopeer
	|	T_Noquery
	|	T_Noserve
	|	T_Notrap
	|	T_Notrust
	|	T_Ntpport
	|	T_Version
	;

discard_option_list
	:	discard_option_list discard_option
			{ $$ = enqueue($1, $2); }
	|	discard_option 
			{ $$ = enqueue_in_new_queue($1); }
	;

discard_option
	:	discard_option_keyword T_Integer
			{ $$ = create_attr_ival($1, $2); }
	;

discard_option_keyword
	:	T_Average
	|	T_Minimum
	|	T_Monitor
	;


/* Fudge Commands
 * --------------
 */

fudge_command
	:	T_Fudge address fudge_factor_list
			{ enqueue(cfgt.fudge, create_addr_opts_node($2, $3)); }
	;

fudge_factor_list
	:	fudge_factor_list fudge_factor
			{ enqueue($1, $2); }
	|	fudge_factor
			{ $$ = enqueue_in_new_queue($1); }
	;
	
fudge_factor
	:	fudge_factor_dbl_keyword number
			{ $$ = create_attr_dval($1, $2); }
	|	fudge_factor_bool_keyword boolean
			{ $$ = create_attr_ival($1, $2); }
	|	T_Stratum T_Integer
			{ $$ = create_attr_ival($1, $2); }
	|	T_Refid T_String
			{ $$ = create_attr_sval($1, $2); }
	;

fudge_factor_dbl_keyword
	:	T_Time1
	|	T_Time2
	;

fudge_factor_bool_keyword
	:	T_Flag1
	|	T_Flag2
	|	T_Flag3
	|	T_Flag4
	;


/* Command for System Options
 * --------------------------
 */

system_option_command
	:	T_Enable system_option_list
			{ append_queue(cfgt.enable_opts, $2);  }
	|	T_Disable system_option_list
			{ append_queue(cfgt.disable_opts, $2);  }
	;

system_option_list
	:	system_option_list system_option
		{
			if ($2 != NULL)
				$$ = enqueue($1, $2);
			else
				$$ = $1;
		}
	|	system_option
		{
			if ($1 != NULL)
				$$ = enqueue_in_new_queue($1);
			else
				$$ = create_queue();
		}
	;

system_option
	:	system_option_flag_keyword
			{ $$ = create_attr_ival(T_Flag, $1); }
	|	T_Stats
		{ 
			if (input_from_file) {
				$$ = create_attr_ival(T_Flag, $1);
			} else {
				$$ = NULL;
				yyerror("enable/disable stats remote config ignored");
			}
		}
	;

system_option_flag_keyword
	:	T_Auth
	|	T_Bclient
	|	T_Calibrate
	|	T_Kernel
	|	T_Monitor
	|	T_Ntp
	;


/* Tinker Commands
 * ---------------
 */

tinker_command
	:	T_Tinker tinker_option_list  { append_queue(cfgt.tinker, $2); }
	;

tinker_option_list
	:	tinker_option_list tinker_option  { $$ = enqueue($1, $2); }
	|	tinker_option { $$ = enqueue_in_new_queue($1); }
	;

tinker_option
	:	tinker_option_keyword number
			{ $$ = create_attr_dval($1, $2); }
	;

tinker_option_keyword
	:	T_Allan
	|	T_Dispersion
	|	T_Freq
	|	T_Huffpuff
	|	T_Panic
	|	T_Step
	|	T_Stepout
	;


/* Miscellaneous Commands
 * ----------------------
 */

miscellaneous_command
	:	interface_command
	|	misc_cmd_dbl_keyword number
		{
			struct attr_val *av;
			
			av = create_attr_dval($1, $2);
			enqueue(cfgt.vars, av);
		}
	|	misc_cmd_str_keyword T_String
		{
			struct attr_val *av;
			
			av = create_attr_sval($1, $2);
			enqueue(cfgt.vars, av);
		}
	|	misc_cmd_str_lcl_keyword T_String
		{
			char error_text[64];
			struct attr_val *av;

			if (input_from_file) {
				av = create_attr_sval($1, $2);
				enqueue(cfgt.vars, av);
			} else {
				YYFREE($2);
				snprintf(error_text, sizeof(error_text),
					 "%s remote config ignored",
					 keyword($1));
				yyerror(error_text);
			}
		}
	|	T_Includefile T_String command
		{
			if (!input_from_file) {
				yyerror("remote includefile ignored");
				break;
			}
			if (curr_include_level >= MAXINCLUDELEVEL) {
				fprintf(stderr, "getconfig: Maximum include file level exceeded.\n");
				msyslog(LOG_ERR, "getconfig: Maximum include file level exceeded.\n");
			} else {
				fp[curr_include_level + 1] = F_OPEN(FindConfig($2), "r");
				if (fp[curr_include_level + 1] == NULL) {
					fprintf(stderr, "getconfig: Couldn't open <%s>\n", FindConfig($2));
					msyslog(LOG_ERR, "getconfig: Couldn't open <%s>\n", FindConfig($2));
				} else {
					ip_file = fp[++curr_include_level];
				}
			}
		}
	|	T_End
		{
			while (curr_include_level != -1)
				FCLOSE(fp[curr_include_level--]);
		}
	|	T_Calldelay T_Integer
			{ enqueue(cfgt.vars, create_attr_ival($1, $2)); }
	|	T_Driftfile drift_parm
			{ /* Null action, possibly all null parms */ }
	|	T_Logconfig log_config_list
			{ append_queue(cfgt.logconfig, $2); }
	|	T_Phone string_list
			{ append_queue(cfgt.phone, $2); }
	|	T_Setvar variable_assign
			{ enqueue(cfgt.setvar, $2); }
	|	T_Trap ip_address
			{ enqueue(cfgt.trap, create_addr_opts_node($2, NULL)); }
	|	T_Trap ip_address trap_option_list
			{ enqueue(cfgt.trap, create_addr_opts_node($2, $3)); }
	|	T_Ttl integer_list
			{ append_queue(cfgt.ttl, $2); }
	;

misc_cmd_dbl_keyword
	:	T_Broadcastdelay
	|	T_Tick
	;

misc_cmd_str_keyword
	:	T_Leapfile
	|	T_Pidfile
	|	T_Qos
	;

misc_cmd_str_lcl_keyword
	:	T_Logfile
	|	T_Saveconfigdir
	;

drift_parm
	:	T_String
			{ enqueue(cfgt.vars, create_attr_sval(T_Driftfile, $1)); }
	|	T_String T_Double
			{ enqueue(cfgt.vars, create_attr_dval(T_WanderThreshold, $2));
			  enqueue(cfgt.vars, create_attr_sval(T_Driftfile, $1)); }
	|	/* Null driftfile,  indicated by null string "\0" */
			{ enqueue(cfgt.vars, create_attr_sval(T_Driftfile, "\0")); }
	;

variable_assign
	:	T_String '=' T_String t_default_or_zero
			{ $$ = create_setvar_node($1, $3, $4); }
	;

t_default_or_zero
	:	T_Default
	|	/* empty, no "default" modifier */
		{ $$ = 0; }
	;

trap_option_list
	:	trap_option_list trap_option
				{ $$ = enqueue($1, $2); }
	|	trap_option	{ $$ = enqueue_in_new_queue($1); }
	;

trap_option
	:	T_Port T_Integer	{ $$ = create_attr_ival($1, $2); }
	|	T_Interface ip_address	{ $$ = create_attr_pval($1, $2); }
	;

log_config_list
	:	log_config_list log_config_command { $$ = enqueue($1, $2); }
	|	log_config_command  { $$ = enqueue_in_new_queue($1); }
	;

log_config_command
	:	T_String
		{
			char prefix = $1[0];
			char *type = $1 + 1;
			
			if (prefix != '+' && prefix != '-' && prefix != '=') {
				yyerror("Logconfig prefix is not '+', '-' or '='\n");
			}
			else
				$$ = create_attr_sval(prefix, estrdup(type));
			YYFREE($1);
		}
	;

interface_command
	:	interface_nic nic_rule_action nic_rule_class
		{
			enqueue(cfgt.nic_rules,
				create_nic_rule_node($3, NULL, $2));
		}
	|	interface_nic nic_rule_action T_String
		{
			enqueue(cfgt.nic_rules,
				create_nic_rule_node(0, $3, $2));
		}
	;

interface_nic
	:	T_Interface
	|	T_Nic
	;

nic_rule_class
	:	T_All
	|	T_Ipv4
	|	T_Ipv6
	|	T_Wildcard
	;

nic_rule_action
	:	T_Listen
	|	T_Ignore
	|	T_Drop
	;



/* Miscellaneous Rules
 * -------------------
 */

integer_list
	:	integer_list T_Integer { $$ = enqueue($1, create_ival($2)); }
	|	T_Integer { $$ = enqueue_in_new_queue(create_ival($1)); }
	;

integer_list_range
	:	integer_list_range integer_list_range_elt
			{ $$ = enqueue($1, $2); }
	|	integer_list_range_elt
			{ $$ = enqueue_in_new_queue($1); }
	;

integer_list_range_elt
	:	T_Integer
			{ $$ = create_attr_ival('i', $1); }
	|	integer_range		/* default of $$ = $1 is good */
	;

integer_range		/* limited to unsigned shorts */
	:	'(' T_Integer T_Ellipsis T_Integer ')'
			{ $$ = create_attr_shorts('-', $2, $4); }
	;

string_list
	:	string_list T_String { $$ = enqueue($1, create_pval($2)); }
	|	T_String { $$ = enqueue_in_new_queue(create_pval($1)); }
	;

address_list
	:	address_list address { $$ = enqueue($1, $2); }
	|	address { $$ = enqueue_in_new_queue($1); }
	;

boolean
	:	T_Integer
		{
			if ($1 != 0 && $1 != 1) {
				yyerror("Integer value is not boolean (0 or 1). Assuming 1");
				$$ = 1;
			} else {
				$$ = $1;
			}
		}
	|	T_True    { $$ = 1; }
	|	T_False   { $$ = 0; }
	;

number
	:	T_Integer { $$ = (double)$1; }
	|	T_Double
	;


/* Simulator Configuration Commands
 * --------------------------------
 */

simulate_command
	:	sim_conf_start '{' sim_init_statement_list sim_server_list '}'
		{
			cfgt.sim_details = create_sim_node($3, $4);

			/* Reset the old_config_style variable */
			old_config_style = 1;
		}
	;

/* The following is a terrible hack to get the configuration file to
 * treat newlines as whitespace characters within the simulation.
 * This is needed because newlines are significant in the rest of the
 * configuration file.
 */
sim_conf_start
	:	T_Simulate { old_config_style = 0; }
	;

sim_init_statement_list
	:	sim_init_statement_list sim_init_statement T_EOC { $$ = enqueue($1, $2); }
	|	sim_init_statement T_EOC			 { $$ = enqueue_in_new_queue($1); }
	;

sim_init_statement
	:	T_Beep_Delay '=' number   { $$ = create_attr_dval($1, $3); }
	|	T_Sim_Duration '=' number { $$ = create_attr_dval($1, $3); }
	;

sim_server_list
	:	sim_server_list sim_server { $$ = enqueue($1, $2); }
	|	sim_server		   { $$ = enqueue_in_new_queue($1); }
	;

sim_server
	:	sim_server_name '{' sim_server_offset sim_act_list '}'
		{ $$ = create_sim_server($1, $3, $4); }
	;

sim_server_offset
	:	T_Server_Offset '=' number T_EOC { $$ = $3; }
	;

sim_server_name
	:	T_Server '=' address { $$ = $3; }
	;

sim_act_list
	:	sim_act_list sim_act { $$ = enqueue($1, $2); }
	|	sim_act		     { $$ = enqueue_in_new_queue($1); }
	;

sim_act
	:	T_Duration '=' number '{' sim_act_stmt_list '}'
			{ $$ = create_sim_script_info($3, $5); }
	;

sim_act_stmt_list
	:	sim_act_stmt_list sim_act_stmt T_EOC { $$ = enqueue($1, $2); }
	|	sim_act_stmt T_EOC		     { $$ = enqueue_in_new_queue($1); }
	;

sim_act_stmt
	:	T_Freq_Offset '=' number
			{ $$ = create_attr_dval($1, $3); }
	|	T_Wander '=' number
			{ $$ = create_attr_dval($1, $3); }
	|	T_Jitter '=' number
			{ $$ = create_attr_dval($1, $3); }
	|	T_Prop_Delay '=' number
			{ $$ = create_attr_dval($1, $3); }
	|	T_Proc_Delay '=' number
			{ $$ = create_attr_dval($1, $3); }
	;


%%

void
yyerror(
	const char *msg
	)
{
	int retval;

	ip_file->err_line_no = ip_file->prev_token_line_no;
	ip_file->err_col_no = ip_file->prev_token_col_no;
	
	msyslog(LOG_ERR, 
		"line %d column %d %s", 
		ip_file->err_line_no,
		ip_file->err_col_no,
		msg);
	if (!input_from_file) {
		/* Save the error message in the correct buffer */
		retval = snprintf(remote_config.err_msg + remote_config.err_pos,
				  MAXLINE - remote_config.err_pos,
				  "column %d %s",
				  ip_file->err_col_no, msg);

		/* Increment the value of err_pos */
		if (retval > 0)
			remote_config.err_pos += retval;

		/* Increment the number of errors */
		++remote_config.no_errors;
	}
}


/*
 * token_name - Convert T_ token integers to text.
 *		Example: token_name(T_Server) returns "T_Server".
 *		see also keyword(T_Server) which returns "server".
 */
const char *
token_name(
	int token
	)
{
	return yytname[YYTRANSLATE(token)];
}


/* Initial Testing function -- ignore
int main(int argc, char *argv[])
{
	ip_file = FOPEN(argv[1], "r");
	if (!ip_file) {
		fprintf(stderr, "ERROR!! Could not open file: %s\n", argv[1]);
	}
	key_scanner = create_keyword_scanner(keyword_list);
	print_keyword_scanner(key_scanner, 0);
	yyparse();
	return 0;
}
*/

ntp-4.2.6p5/ntpd/ntpd-opts.c0000644000175000017500000011630011675460550014664 0ustar  peterpeter/*  
 *  EDIT THIS FILE WITH CAUTION  (ntpd-opts.c)
 *  
 *  It has been AutoGen-ed  December 24, 2011 at 06:34:01 PM by AutoGen 5.12
 *  From the definitions    ntpd-opts.def
 *  and the template file   options
 *
 * Generated from AutoOpts 35:0:10 templates.
 *
 *  AutoOpts is a copyrighted work.  This source file is not encumbered
 *  by AutoOpts licensing, but is provided under the licensing terms chosen
 *  by the ntpd author or copyright holder.  AutoOpts is
 *  licensed under the terms of the LGPL.  The redistributable library
 *  (``libopts'') is licensed under the terms of either the LGPL or, at the
 *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
 *  for details.
 *
 * This source file is copyrighted and licensed under the following terms:
 *
 *  see html/copyright.html
 *  
 */

#include 

#include 
#include 
#include 

#define OPTION_CODE_COMPILE 1
#include "ntpd-opts.h"

#ifdef  __cplusplus
extern "C" {
#endif
extern FILE * option_usage_fp;

/* TRANSLATORS: choose the translation for option names wisely because you
                cannot ever change your mind. */
static char const zCopyright[38] =
"ntpd 4.2.6p5\n\
see html/copyright.html\n";
static char const zLicenseDescrip[25] =
"see html/copyright.html\n";

extern tUsageProc optionUsage;

/*
 *  global included definitions
 */
#ifdef __windows
  extern int atoi(const char *);
#else
# include 
#endif

#ifndef NULL
#  define NULL 0
#endif

/*
 *  Ipv4 option description with
 *  "Must also have options" and "Incompatible options":
 */
static char const zIpv4Text[] =
        "Force IPv4 DNS name resolution";
static char const zIpv4_NAME[]               = "IPV4";
static char const zIpv4_Name[]               = "ipv4";
static const int
    aIpv4CantList[] = {
    INDEX_OPT_IPV6, NO_EQUIVALENT };
#define IPV4_FLAGS       (OPTST_DISABLED)

/*
 *  Ipv6 option description with
 *  "Must also have options" and "Incompatible options":
 */
static char const zIpv6Text[] =
        "Force IPv6 DNS name resolution";
static char const zIpv6_NAME[]               = "IPV6";
static char const zIpv6_Name[]               = "ipv6";
static const int
    aIpv6CantList[] = {
    INDEX_OPT_IPV4, NO_EQUIVALENT };
#define IPV6_FLAGS       (OPTST_DISABLED)

/*
 *  Authreq option description with
 *  "Must also have options" and "Incompatible options":
 */
static char const zAuthreqText[] =
        "Require crypto authentication";
static char const zAuthreq_NAME[]            = "AUTHREQ";
static char const zAuthreq_Name[]            = "authreq";
static const int
    aAuthreqCantList[] = {
    INDEX_OPT_AUTHNOREQ, NO_EQUIVALENT };
#define AUTHREQ_FLAGS       (OPTST_DISABLED)

/*
 *  Authnoreq option description with
 *  "Must also have options" and "Incompatible options":
 */
static char const zAuthnoreqText[] =
        "Do not require crypto authentication";
static char const zAuthnoreq_NAME[]          = "AUTHNOREQ";
static char const zAuthnoreq_Name[]          = "authnoreq";
static const int
    aAuthnoreqCantList[] = {
    INDEX_OPT_AUTHREQ, NO_EQUIVALENT };
#define AUTHNOREQ_FLAGS       (OPTST_DISABLED)

/*
 *  Bcastsync option description:
 */
static char const zBcastsyncText[] =
        "Allow us to sync to broadcast servers";
static char const zBcastsync_NAME[]          = "BCASTSYNC";
static char const zBcastsync_Name[]          = "bcastsync";
#define BCASTSYNC_FLAGS       (OPTST_DISABLED)

/*
 *  Configfile option description:
 */
static char const zConfigfileText[] =
        "configuration file name";
static char const zConfigfile_NAME[]         = "CONFIGFILE";
static char const zConfigfile_Name[]         = "configfile";
#define CONFIGFILE_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

/*
 *  Debug_Level option description:
 */
#ifdef DEBUG
static char const zDebug_LevelText[] =
        "Increase output debug message level";
static char const zDebug_Level_NAME[]        = "DEBUG_LEVEL";
static char const zDebug_Level_Name[]        = "debug-level";
#define DEBUG_LEVEL_FLAGS       (OPTST_DISABLED)

#else   /* disable Debug_Level */
#define DEBUG_LEVEL_FLAGS       (OPTST_OMITTED | OPTST_NO_INIT)
#define zDebug_Level_NAME      NULL
static char const zDebug_Level_Name[] = "debug-level";
static char const zDebug_LevelText[]  = "this package was built using 'configure --disable--debug'";
#endif  /* DEBUG */

/*
 *  Set_Debug_Level option description:
 */
#ifdef DEBUG
static char const zSet_Debug_LevelText[] =
        "Set the output debug message level";
static char const zSet_Debug_Level_NAME[]    = "SET_DEBUG_LEVEL";
static char const zSet_Debug_Level_Name[]    = "set-debug-level";
#define SET_DEBUG_LEVEL_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

#else   /* disable Set_Debug_Level */
#define SET_DEBUG_LEVEL_FLAGS       (OPTST_OMITTED | OPTST_NO_INIT)
#define zSet_Debug_Level_NAME      NULL
static char const zSet_Debug_Level_Name[] = "set-debug-level";
static char const zSet_Debug_LevelText[]  = "this package was built using 'configure --disable--debug'";
#endif  /* DEBUG */

/*
 *  Driftfile option description:
 */
static char const zDriftfileText[] =
        "frequency drift file name";
static char const zDriftfile_NAME[]          = "DRIFTFILE";
static char const zDriftfile_Name[]          = "driftfile";
#define DRIFTFILE_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

/*
 *  Panicgate option description:
 */
static char const zPanicgateText[] =
        "Allow the first adjustment to be Big";
static char const zPanicgate_NAME[]          = "PANICGATE";
static char const zPanicgate_Name[]          = "panicgate";
#define PANICGATE_FLAGS       (OPTST_DISABLED)

/*
 *  Jaildir option description:
 */
#ifdef HAVE_DROPROOT
static char const zJaildirText[] =
        "Jail directory";
static char const zJaildir_NAME[]            = "JAILDIR";
static char const zJaildir_Name[]            = "jaildir";
#define JAILDIR_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

#else   /* disable Jaildir */
#define JAILDIR_FLAGS       (OPTST_OMITTED | OPTST_NO_INIT)
#define zJaildir_NAME      NULL
static char const zJaildir_Name[] = "jaildir";
static char const zJaildirText[]  = "built without --enable-clockctl or --enable-linuxcaps";
#endif  /* HAVE_DROPROOT */

/*
 *  Interface option description:
 */
static char const zInterfaceText[] =
        "Listen on an interface name or address";
static char const zInterface_NAME[]          = "INTERFACE";
static char const zInterface_Name[]          = "interface";
#define INTERFACE_FLAGS       (OPTST_DISABLED | OPTST_STACKED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

/*
 *  Keyfile option description:
 */
static char const zKeyfileText[] =
        "path to symmetric keys";
static char const zKeyfile_NAME[]            = "KEYFILE";
static char const zKeyfile_Name[]            = "keyfile";
#define KEYFILE_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

/*
 *  Logfile option description:
 */
static char const zLogfileText[] =
        "path to the log file";
static char const zLogfile_NAME[]            = "LOGFILE";
static char const zLogfile_Name[]            = "logfile";
#define LOGFILE_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

/*
 *  Novirtualips option description:
 */
static char const zNovirtualipsText[] =
        "Do not listen to virtual interfaces";
static char const zNovirtualips_NAME[]       = "NOVIRTUALIPS";
static char const zNovirtualips_Name[]       = "novirtualips";
#define NOVIRTUALIPS_FLAGS       (OPTST_DISABLED)

/*
 *  Modifymmtimer option description:
 */
#ifdef SYS_WINNT
static char const zModifymmtimerText[] =
        "Modify Multimedia Timer (Windows only)";
static char const zModifymmtimer_NAME[]      = "MODIFYMMTIMER";
static char const zModifymmtimer_Name[]      = "modifymmtimer";
#define MODIFYMMTIMER_FLAGS       (OPTST_DISABLED)

#else   /* disable Modifymmtimer */
#define MODIFYMMTIMER_FLAGS       (OPTST_OMITTED | OPTST_NO_INIT)
#define zModifymmtimer_NAME      NULL
#define zModifymmtimerText       NULL
#define zModifymmtimer_Name      NULL
#endif  /* SYS_WINNT */

/*
 *  Nofork option description:
 */
static char const zNoforkText[] =
        "Do not fork";
static char const zNofork_NAME[]             = "NOFORK";
static char const zNofork_Name[]             = "nofork";
#define NOFORK_FLAGS       (OPTST_DISABLED)

/*
 *  Nice option description:
 */
static char const zNiceText[] =
        "Run at high priority";
static char const zNice_NAME[]               = "NICE";
static char const zNice_Name[]               = "nice";
#define NICE_FLAGS       (OPTST_DISABLED)

/*
 *  Pidfile option description:
 */
static char const zPidfileText[] =
        "path to the PID file";
static char const zPidfile_NAME[]            = "PIDFILE";
static char const zPidfile_Name[]            = "pidfile";
#define PIDFILE_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

/*
 *  Priority option description:
 */
static char const zPriorityText[] =
        "Process priority";
static char const zPriority_NAME[]           = "PRIORITY";
static char const zPriority_Name[]           = "priority";
#define PRIORITY_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))

/*
 *  Quit option description:
 */
static char const zQuitText[] =
        "Set the time and quit";
static char const zQuit_NAME[]               = "QUIT";
static char const zQuit_Name[]               = "quit";
#define QUIT_FLAGS       (OPTST_DISABLED)

/*
 *  Propagationdelay option description:
 */
static char const zPropagationdelayText[] =
        "Broadcast/propagation delay";
static char const zPropagationdelay_NAME[]   = "PROPAGATIONDELAY";
static char const zPropagationdelay_Name[]   = "propagationdelay";
#define PROPAGATIONDELAY_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

/*
 *  Saveconfigquit option description:
 */
#ifdef SAVECONFIG
static char const zSaveconfigquitText[] =
        "Save parsed configuration and quit";
static char const zSaveconfigquit_NAME[]     = "SAVECONFIGQUIT";
static char const zSaveconfigquit_Name[]     = "saveconfigquit";
#define SAVECONFIGQUIT_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

#else   /* disable Saveconfigquit */
#define SAVECONFIGQUIT_FLAGS       (OPTST_OMITTED | OPTST_NO_INIT)
#define zSaveconfigquit_NAME      NULL
#define zSaveconfigquitText       NULL
#define zSaveconfigquit_Name      NULL
#endif  /* SAVECONFIG */

/*
 *  Statsdir option description:
 */
static char const zStatsdirText[] =
        "Statistics file location";
static char const zStatsdir_NAME[]           = "STATSDIR";
static char const zStatsdir_Name[]           = "statsdir";
#define STATSDIR_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

/*
 *  Trustedkey option description:
 */
static char const zTrustedkeyText[] =
        "Trusted key number";
static char const zTrustedkey_NAME[]         = "TRUSTEDKEY";
static char const zTrustedkey_Name[]         = "trustedkey";
#define TRUSTEDKEY_FLAGS       (OPTST_DISABLED | OPTST_STACKED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

/*
 *  User option description:
 */
#ifdef HAVE_DROPROOT
static char const zUserText[] =
        "Run as userid (or userid:groupid)";
static char const zUser_NAME[]               = "USER";
static char const zUser_Name[]               = "user";
#define USER_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

#else   /* disable User */
#define USER_FLAGS       (OPTST_OMITTED | OPTST_NO_INIT)
#define zUser_NAME      NULL
static char const zUser_Name[] = "user";
static char const zUserText[]  = "built without --enable-clockctl or --enable-linuxcaps";
#endif  /* HAVE_DROPROOT */

/*
 *  Updateinterval option description:
 */
static char const zUpdateintervalText[] =
        "interval in seconds between scans for new or dropped interfaces";
static char const zUpdateinterval_NAME[]     = "UPDATEINTERVAL";
static char const zUpdateinterval_Name[]     = "updateinterval";
#define UPDATEINTERVAL_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))

/*
 *  Var option description:
 */
static char const zVarText[] =
        "make ARG an ntp variable (RW)";
static char const zVar_NAME[]                = "VAR";
static char const zVar_Name[]                = "var";
#define VAR_FLAGS       (OPTST_DISABLED | OPTST_STACKED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

/*
 *  Dvar option description:
 */
static char const zDvarText[] =
        "make ARG an ntp variable (RW|DEF)";
static char const zDvar_NAME[]               = "DVAR";
static char const zDvar_Name[]               = "dvar";
#define DVAR_FLAGS       (OPTST_DISABLED | OPTST_STACKED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

/*
 *  Slew option description:
 */
static char const zSlewText[] =
        "Slew up to 600 seconds";
static char const zSlew_NAME[]               = "SLEW";
static char const zSlew_Name[]               = "slew";
#define SLEW_FLAGS       (OPTST_DISABLED)

/*
 *  Usepcc option description:
 */
#ifdef SYS_WINNT
static char const zUsepccText[] =
        "Use CPU cycle counter (Windows only)";
static char const zUsepcc_NAME[]             = "USEPCC";
static char const zUsepcc_Name[]             = "usepcc";
#define USEPCC_FLAGS       (OPTST_DISABLED)

#else   /* disable Usepcc */
#define USEPCC_FLAGS       (OPTST_OMITTED | OPTST_NO_INIT)
#define zUsepcc_NAME      NULL
#define zUsepccText       NULL
#define zUsepcc_Name      NULL
#endif  /* SYS_WINNT */

/*
 *  Pccfreq option description:
 */
#ifdef SYS_WINNT
static char const zPccfreqText[] =
        "Force CPU cycle counter use (Windows only)";
static char const zPccfreq_NAME[]            = "PCCFREQ";
static char const zPccfreq_Name[]            = "pccfreq";
#define PCCFREQ_FLAGS       (OPTST_DISABLED \
        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))

#else   /* disable Pccfreq */
#define PCCFREQ_FLAGS       (OPTST_OMITTED | OPTST_NO_INIT)
#define zPccfreq_NAME      NULL
#define zPccfreqText       NULL
#define zPccfreq_Name      NULL
#endif  /* SYS_WINNT */

/*
 *  Help/More_Help/Version option descriptions:
 */
static char const zHelpText[]          = "Display extended usage information and exit";
static char const zHelp_Name[]         = "help";
#ifdef HAVE_WORKING_FORK
#define OPTST_MORE_HELP_FLAGS   (OPTST_IMM | OPTST_NO_INIT)
static char const zMore_Help_Name[]    = "more-help";
static char const zMore_HelpText[]     = "Extended usage information passed thru pager";
#else
#define OPTST_MORE_HELP_FLAGS   (OPTST_OMITTED | OPTST_NO_INIT)
#define zMore_Help_Name   NULL
#define zMore_HelpText    NULL
#endif
#ifdef NO_OPTIONAL_OPT_ARGS
#  define OPTST_VERSION_FLAGS   OPTST_IMM | OPTST_NO_INIT
#else
#  define OPTST_VERSION_FLAGS   OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
                                OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
#endif

static char const zVersionText[]       = "Output version information and exit";
static char const zVersion_Name[]      = "version";
/*
 *  Declare option callback procedures
 */
#ifdef DEBUG
  static tOptProc doOptSet_Debug_Level;
#else /* not DEBUG */
# define doOptSet_Debug_Level NULL
#endif /* def/not DEBUG */
#if defined(TEST_NTPD_OPTS)
/*
 *  Under test, omit argument processing, or call optionStackArg,
 *  if multiple copies are allowed.
 */
static tOptProc
    doUsageOpt;

/*
 *  #define map the "normal" callout procs to the test ones...
 */
#define SET_DEBUG_LEVEL_OPT_PROC optionStackArg


#else /* NOT defined TEST_NTPD_OPTS */
/*
 *  When not under test, there are different procs to use
 */
extern tOptProc
    optionBooleanVal,    optionNestedVal,     optionNumericVal,
    optionPagedUsage,    optionPrintVersion,  optionResetOpt,
    optionStackArg,      optionTimeDate,      optionTimeVal,
    optionUnstackArg,    optionVersionStderr;
static tOptProc
    doUsageOpt;

/*
 *  #define map the "normal" callout procs
 */
#define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level

#define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level
#endif /* defined(TEST_NTPD_OPTS) */
#ifdef TEST_NTPD_OPTS
# define DOVERPROC optionVersionStderr
#else
# define DOVERPROC optionPrintVersion
#endif /* TEST_NTPD_OPTS */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 *  Define the Ntpd Option Descriptions.
 */
static tOptDesc optDesc[OPTION_CT] = {
  {  /* entry idx, value */ 0, VALUE_OPT_IPV4,
     /* equiv idx, value */ 0, VALUE_OPT_IPV4,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ IPV4_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, aIpv4CantList,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zIpv4Text, zIpv4_NAME, zIpv4_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 1, VALUE_OPT_IPV6,
     /* equiv idx, value */ 1, VALUE_OPT_IPV6,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ IPV6_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, aIpv6CantList,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zIpv6Text, zIpv6_NAME, zIpv6_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 2, VALUE_OPT_AUTHREQ,
     /* equiv idx, value */ 2, VALUE_OPT_AUTHREQ,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ AUTHREQ_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, aAuthreqCantList,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zAuthreqText, zAuthreq_NAME, zAuthreq_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 3, VALUE_OPT_AUTHNOREQ,
     /* equiv idx, value */ 3, VALUE_OPT_AUTHNOREQ,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ AUTHNOREQ_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, aAuthnoreqCantList,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zAuthnoreqText, zAuthnoreq_NAME, zAuthnoreq_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 4, VALUE_OPT_BCASTSYNC,
     /* equiv idx, value */ 4, VALUE_OPT_BCASTSYNC,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ BCASTSYNC_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zBcastsyncText, zBcastsync_NAME, zBcastsync_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 5, VALUE_OPT_CONFIGFILE,
     /* equiv idx, value */ 5, VALUE_OPT_CONFIGFILE,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ CONFIGFILE_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zConfigfileText, zConfigfile_NAME, zConfigfile_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 6, VALUE_OPT_DEBUG_LEVEL,
     /* equiv idx, value */ 6, VALUE_OPT_DEBUG_LEVEL,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, NOLIMIT, 0,
     /* opt state flags  */ DEBUG_LEVEL_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zDebug_LevelText, zDebug_Level_NAME, zDebug_Level_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 7, VALUE_OPT_SET_DEBUG_LEVEL,
     /* equiv idx, value */ 7, VALUE_OPT_SET_DEBUG_LEVEL,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, NOLIMIT, 0,
     /* opt state flags  */ SET_DEBUG_LEVEL_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ SET_DEBUG_LEVEL_OPT_PROC,
     /* desc, NAME, name */ zSet_Debug_LevelText, zSet_Debug_Level_NAME, zSet_Debug_Level_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 8, VALUE_OPT_DRIFTFILE,
     /* equiv idx, value */ 8, VALUE_OPT_DRIFTFILE,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ DRIFTFILE_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zDriftfileText, zDriftfile_NAME, zDriftfile_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 9, VALUE_OPT_PANICGATE,
     /* equiv idx, value */ 9, VALUE_OPT_PANICGATE,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, NOLIMIT, 0,
     /* opt state flags  */ PANICGATE_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zPanicgateText, zPanicgate_NAME, zPanicgate_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 10, VALUE_OPT_JAILDIR,
     /* equiv idx, value */ 10, VALUE_OPT_JAILDIR,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ JAILDIR_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zJaildirText, zJaildir_NAME, zJaildir_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 11, VALUE_OPT_INTERFACE,
     /* equiv idx, value */ 11, VALUE_OPT_INTERFACE,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, NOLIMIT, 0,
     /* opt state flags  */ INTERFACE_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ optionStackArg,
     /* desc, NAME, name */ zInterfaceText, zInterface_NAME, zInterface_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 12, VALUE_OPT_KEYFILE,
     /* equiv idx, value */ 12, VALUE_OPT_KEYFILE,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ KEYFILE_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zKeyfileText, zKeyfile_NAME, zKeyfile_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 13, VALUE_OPT_LOGFILE,
     /* equiv idx, value */ 13, VALUE_OPT_LOGFILE,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ LOGFILE_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zLogfileText, zLogfile_NAME, zLogfile_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 14, VALUE_OPT_NOVIRTUALIPS,
     /* equiv idx, value */ 14, VALUE_OPT_NOVIRTUALIPS,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ NOVIRTUALIPS_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zNovirtualipsText, zNovirtualips_NAME, zNovirtualips_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 15, VALUE_OPT_MODIFYMMTIMER,
     /* equiv idx, value */ 15, VALUE_OPT_MODIFYMMTIMER,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ MODIFYMMTIMER_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zModifymmtimerText, zModifymmtimer_NAME, zModifymmtimer_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 16, VALUE_OPT_NOFORK,
     /* equiv idx, value */ 16, VALUE_OPT_NOFORK,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ NOFORK_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zNoforkText, zNofork_NAME, zNofork_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 17, VALUE_OPT_NICE,
     /* equiv idx, value */ 17, VALUE_OPT_NICE,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ NICE_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zNiceText, zNice_NAME, zNice_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 18, VALUE_OPT_PIDFILE,
     /* equiv idx, value */ 18, VALUE_OPT_PIDFILE,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ PIDFILE_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zPidfileText, zPidfile_NAME, zPidfile_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 19, VALUE_OPT_PRIORITY,
     /* equiv idx, value */ 19, VALUE_OPT_PRIORITY,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ PRIORITY_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ optionNumericVal,
     /* desc, NAME, name */ zPriorityText, zPriority_NAME, zPriority_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 20, VALUE_OPT_QUIT,
     /* equiv idx, value */ 20, VALUE_OPT_QUIT,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ QUIT_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zQuitText, zQuit_NAME, zQuit_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY,
     /* equiv idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ PROPAGATIONDELAY_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zPropagationdelayText, zPropagationdelay_NAME, zPropagationdelay_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 22, VALUE_OPT_SAVECONFIGQUIT,
     /* equiv idx, value */ 22, VALUE_OPT_SAVECONFIGQUIT,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ SAVECONFIGQUIT_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zSaveconfigquitText, zSaveconfigquit_NAME, zSaveconfigquit_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 23, VALUE_OPT_STATSDIR,
     /* equiv idx, value */ 23, VALUE_OPT_STATSDIR,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ STATSDIR_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zStatsdirText, zStatsdir_NAME, zStatsdir_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 24, VALUE_OPT_TRUSTEDKEY,
     /* equiv idx, value */ 24, VALUE_OPT_TRUSTEDKEY,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, NOLIMIT, 0,
     /* opt state flags  */ TRUSTEDKEY_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ optionStackArg,
     /* desc, NAME, name */ zTrustedkeyText, zTrustedkey_NAME, zTrustedkey_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 25, VALUE_OPT_USER,
     /* equiv idx, value */ 25, VALUE_OPT_USER,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ USER_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zUserText, zUser_NAME, zUser_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 26, VALUE_OPT_UPDATEINTERVAL,
     /* equiv idx, value */ 26, VALUE_OPT_UPDATEINTERVAL,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ UPDATEINTERVAL_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ optionNumericVal,
     /* desc, NAME, name */ zUpdateintervalText, zUpdateinterval_NAME, zUpdateinterval_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 27, VALUE_OPT_VAR,
     /* equiv idx, value */ 27, VALUE_OPT_VAR,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, NOLIMIT, 0,
     /* opt state flags  */ VAR_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ optionStackArg,
     /* desc, NAME, name */ zVarText, zVar_NAME, zVar_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 28, VALUE_OPT_DVAR,
     /* equiv idx, value */ 28, VALUE_OPT_DVAR,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, NOLIMIT, 0,
     /* opt state flags  */ DVAR_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ optionStackArg,
     /* desc, NAME, name */ zDvarText, zDvar_NAME, zDvar_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 29, VALUE_OPT_SLEW,
     /* equiv idx, value */ 29, VALUE_OPT_SLEW,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ SLEW_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zSlewText, zSlew_NAME, zSlew_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 30, VALUE_OPT_USEPCC,
     /* equiv idx, value */ 30, VALUE_OPT_USEPCC,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ USEPCC_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zUsepccText, zUsepcc_NAME, zUsepcc_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ 31, VALUE_OPT_PCCFREQ,
     /* equiv idx, value */ 31, VALUE_OPT_PCCFREQ,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ PCCFREQ_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ NULL,
     /* desc, NAME, name */ zPccfreqText, zPccfreq_NAME, zPccfreq_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
     /* equiv idx value  */ NO_EQUIVALENT, 0,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ OPTST_VERSION_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ DOVERPROC,
     /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
     /* disablement strs */ NULL, NULL },



  {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
     /* equiv idx value  */ NO_EQUIVALENT, 0,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL, NULL,
     /* option proc      */ doUsageOpt,
     /* desc, NAME, name */ zHelpText, NULL, zHelp_Name,
     /* disablement strs */ NULL, NULL },

  {  /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
     /* equiv idx value  */ NO_EQUIVALENT, 0,
     /* equivalenced to  */ NO_EQUIVALENT,
     /* min, max, act ct */ 0, 1, 0,
     /* opt state flags  */ OPTST_MORE_HELP_FLAGS, 0,
     /* last opt argumnt */ { NULL },
     /* arg list/cookie  */ NULL,
     /* must/cannot opts */ NULL,  NULL,
     /* option proc      */ optionPagedUsage,
     /* desc, NAME, name */ zMore_HelpText, NULL, zMore_Help_Name,
     /* disablement strs */ NULL, NULL }
};

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 *  Define the Ntpd Option Environment
 */
static char const zPROGNAME[5] = "NTPD";
static char const zUsageTitle[99] =
"ntpd - NTP daemon program - Ver. 4.2.6p5\n\
USAGE:  %s [ - [] | --[{=| }] ]...\n";
#define zRcName     NULL
#define apzHomeList NULL

static char const zBugsAddr[34]    = "http://bugs.ntp.org, bugs@ntp.org";
#define zExplain NULL
static char const zDetail[7] = "\n\n";
static char const zFullVersion[] = NTPD_FULL_VERSION;
/* extracted from optcode.tlib near line 515 */

#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
  static tOptionXlateProc translate_option_strings;
#else
# define OPTPROC_BASE OPTPROC_NONE
# define translate_option_strings NULL
#endif /* ENABLE_NLS */


#define ntpd_full_usage NULL
#define ntpd_short_usage NULL
#ifndef  PKGDATADIR
# define PKGDATADIR ""
#endif

#ifndef  WITH_PACKAGER
# define ntpd_packager_info NULL
#else
static char const ntpd_packager_info[] =
    "Packaged by " WITH_PACKAGER

# ifdef WITH_PACKAGER_VERSION
        " ("WITH_PACKAGER_VERSION")"
# endif

# ifdef WITH_PACKAGER_BUG_REPORTS
    "\nReport ntpd bugs to " WITH_PACKAGER_BUG_REPORTS
# endif
    "\n";
#endif

tOptions ntpdOptions = {
    OPTIONS_STRUCT_VERSION,
    0, NULL,                    /* original argc + argv    */
    ( OPTPROC_BASE
    + OPTPROC_ERRSTOP
    + OPTPROC_SHORTOPT
    + OPTPROC_LONGOPT
    + OPTPROC_NO_REQ_OPT
    + OPTPROC_ENVIRON
    + OPTPROC_NO_ARGS
    + OPTPROC_MISUSE ),
    0, NULL,                    /* current option index, current option */
    NULL,         NULL,         zPROGNAME,
    zRcName,      zCopyright,   zLicenseDescrip,
    zFullVersion, apzHomeList,  zUsageTitle,
    zExplain,     zDetail,      optDesc,
    zBugsAddr,                  /* address to send bugs to */
    NULL, NULL,                 /* extensions/saved state  */
    optionUsage, /* usage procedure */
    translate_option_strings,   /* translation procedure */
    /*
     *  Indexes to special options
     */
    { INDEX_OPT_MORE_HELP, /* more-help option index */
      NO_EQUIVALENT, /* save option index */
      NO_EQUIVALENT, /* '-#' option index */
      NO_EQUIVALENT /* index of default opt */
    },
    35 /* full option count */, 32 /* user option count */,
    ntpd_full_usage, ntpd_short_usage,
    NULL, NULL,
    PKGDATADIR, ntpd_packager_info
};

/*
 *  Create the static procedure(s) declared above.
 */
static void
doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
{
    (void)pOptions;
    USAGE(NTPD_EXIT_SUCCESS);
}

#if ! defined(TEST_NTPD_OPTS)

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 *   For the set-debug-level option, when DEBUG is #define-d.
 */
#ifdef DEBUG
static void
doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
{
    /* extracted from ntpdbase-opts.def, line 100 */
DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
}
#endif /* defined DEBUG */
#endif /* defined(TEST_NTPD_OPTS) */
/* extracted from optmain.tlib near line 128 */

#if defined(TEST_NTPD_OPTS) /* TEST MAIN PROCEDURE: */

extern void optionPutShell(tOptions*);

int
main(int argc, char ** argv)
{
    int res = NTPD_EXIT_SUCCESS;
    (void)optionProcess(&ntpdOptions, argc, argv);
    optionPutShell(&ntpdOptions);
    res = ferror(stdout);
    if (res != 0)
        fputs("output error writing to stdout\n", stderr);
    return res;
}
#endif  /* defined TEST_NTPD_OPTS */
/* extracted from optcode.tlib near line 666 */

#if ENABLE_NLS
#include 
#include 
#include 
#include 
#include 

static char* AO_gettext(char const* pz);
static void  coerce_it(void** s);

static char*
AO_gettext(char const* pz)
{
    char* pzRes;
    if (pz == NULL)
        return NULL;
    pzRes = _(pz);
    if (pzRes == pz)
        return pzRes;
    pzRes = strdup(pzRes);
    if (pzRes == NULL) {
        fputs(_("No memory for duping translated strings\n"), stderr);
        exit(NTPD_EXIT_FAILURE);
    }
    return pzRes;
}

static void coerce_it(void** s) { *s = AO_gettext(*s);
}

/*
 *  This invokes the translation code (e.g. gettext(3)).
 */
static void
translate_option_strings(void)
{
    tOptions * const pOpt = &ntpdOptions;

    /*
     *  Guard against re-translation.  It won't work.  The strings will have
     *  been changed by the first pass through this code.  One shot only.
     */
    if (option_usage_text.field_ct != 0) {
        /*
         *  Do the translations.  The first pointer follows the field count
         *  field.  The field count field is the size of a pointer.
         */
        tOptDesc * pOD = pOpt->pOptDesc;
        char **    ppz = (char**)(void*)&(option_usage_text);
        int        ix  = option_usage_text.field_ct;

        do {
            ppz++;
            *ppz = AO_gettext(*ppz);
        } while (--ix > 0);

        coerce_it((void*)&(pOpt->pzCopyright));
        coerce_it((void*)&(pOpt->pzCopyNotice));
        coerce_it((void*)&(pOpt->pzFullVersion));
        coerce_it((void*)&(pOpt->pzUsageTitle));
        coerce_it((void*)&(pOpt->pzExplain));
        coerce_it((void*)&(pOpt->pzDetail));
        coerce_it((void*)&(pOpt->pzPackager));
        option_usage_text.field_ct = 0;

        for (ix = pOpt->optCt; ix > 0; ix--, pOD++)
            coerce_it((void*)&(pOD->pzText));
    }

    if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
        tOptDesc * pOD = pOpt->pOptDesc;
        int        ix;

        for (ix = pOpt->optCt; ix > 0; ix--, pOD++) {
            coerce_it((void*)&(pOD->pz_Name));
            coerce_it((void*)&(pOD->pz_DisableName));
            coerce_it((void*)&(pOD->pz_DisablePfx));
        }
        /* prevent re-translation */
        ntpdOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT;
    }
}

#endif /* ENABLE_NLS */

#ifdef  __cplusplus
}
#endif
/* ntpd-opts.c ends here */
ntp-4.2.6p5/ntpd/refclock_conf.c0000644000175000017500000001605011510477207015525 0ustar  peterpeter/*
 * refclock_conf.c - reference clock configuration
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#include 
#include 

#include "ntpd.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"

#ifdef REFCLOCK

static struct refclock refclock_none = {
	noentry, noentry, noentry, noentry, noentry, noentry, NOFLAGS
};

#ifdef CLOCK_LOCAL
extern	struct refclock	refclock_local;
#else
#define	refclock_local	refclock_none
#endif

#if 0 && defined(CLOCK_TRAK) && defined(PPS)
extern	struct refclock	refclock_trak;
#else
#define	refclock_trak	refclock_none
#endif

#ifdef CLOCK_PST
extern	struct refclock	refclock_pst;
#else
#define	refclock_pst	refclock_none
#endif

#ifdef CLOCK_CHU
extern	struct refclock	refclock_chu;
#else
#define	refclock_chu	refclock_none
#endif

#ifdef CLOCK_WWV
extern  struct refclock refclock_wwv;
#else
#define refclock_wwv    refclock_none
#endif

#ifdef CLOCK_SPECTRACOM
extern	struct refclock	refclock_wwvb;
#else
#define	refclock_wwvb	refclock_none
#endif

#ifdef CLOCK_PARSE
extern	struct refclock	refclock_parse;
#else
#define	refclock_parse	refclock_none
#endif

#if defined(CLOCK_MX4200) && defined(HAVE_PPSAPI)
extern	struct refclock	refclock_mx4200;
#else
#define	refclock_mx4200	refclock_none
#endif

#ifdef CLOCK_AS2201
extern	struct refclock	refclock_as2201;
#else
#define	refclock_as2201	refclock_none
#endif

#ifdef CLOCK_ARBITER
extern  struct refclock refclock_arbiter;
#else
#define refclock_arbiter refclock_none
#endif

#ifdef CLOCK_TPRO
extern	struct refclock	refclock_tpro;
#else
#define	refclock_tpro	refclock_none
#endif

#ifdef CLOCK_LEITCH
extern	struct refclock	refclock_leitch;
#else
#define	refclock_leitch	refclock_none
#endif

#ifdef CLOCK_IRIG
extern	struct refclock	refclock_irig;
#else
#define refclock_irig	refclock_none
#endif

#if 0 && defined(CLOCK_MSFEES) && defined(PPS)
extern	struct refclock	refclock_msfees;
#else
#define refclock_msfees	refclock_none
#endif

#ifdef CLOCK_BANC
extern	struct refclock refclock_bancomm;
#else
#define refclock_bancomm refclock_none
#endif

#ifdef CLOCK_TRUETIME
extern	struct refclock	refclock_true;
#else
#define	refclock_true	refclock_none
#endif

#ifdef CLOCK_DATUM
extern	struct refclock	refclock_datum;
#else
#define refclock_datum	refclock_none
#endif

#ifdef CLOCK_ACTS
extern	struct refclock	refclock_acts;
#else
#define refclock_acts	refclock_none
#endif

#ifdef CLOCK_HEATH
extern	struct refclock	refclock_heath;
#else
#define refclock_heath	refclock_none
#endif

#ifdef CLOCK_NMEA
extern	struct refclock refclock_nmea;
#else
#define	refclock_nmea	refclock_none
#endif

#if defined (CLOCK_ATOM) && defined(HAVE_PPSAPI)
extern	struct refclock	refclock_atom;
#else
#define refclock_atom	refclock_none
#endif

#ifdef CLOCK_HPGPS
extern	struct refclock	refclock_hpgps;
#else
#define	refclock_hpgps	refclock_none
#endif

#ifdef CLOCK_GPSVME
extern	struct refclock refclock_gpsvme;
#else
#define refclock_gpsvme refclock_none
#endif

#ifdef CLOCK_ARCRON_MSF
extern	struct refclock refclock_arc;
#else
#define refclock_arc refclock_none
#endif

#ifdef CLOCK_SHM
extern	struct refclock refclock_shm;
#else
#define refclock_shm refclock_none
#endif

#ifdef CLOCK_PALISADE 
extern	struct refclock refclock_palisade;
#else
#define refclock_palisade refclock_none
#endif

#if defined(CLOCK_ONCORE)
extern	struct refclock refclock_oncore;
#else
#define refclock_oncore refclock_none
#endif

#if defined(CLOCK_JUPITER) && defined(HAVE_PPSAPI)
extern	struct refclock refclock_jupiter;
#else
#define refclock_jupiter refclock_none
#endif

#if defined(CLOCK_CHRONOLOG)
extern struct refclock refclock_chronolog;
#else
#define refclock_chronolog refclock_none
#endif

#if defined(CLOCK_DUMBCLOCK)
extern struct refclock refclock_dumbclock;
#else
#define refclock_dumbclock refclock_none
#endif

#ifdef CLOCK_ULINK
extern	struct refclock	refclock_ulink;
#else
#define	refclock_ulink	refclock_none
#endif

#ifdef CLOCK_PCF
extern	struct refclock	refclock_pcf;
#else
#define	refclock_pcf	refclock_none
#endif

#ifdef CLOCK_FG
extern	struct refclock	refclock_fg;
#else
#define	refclock_fg	refclock_none
#endif

#ifdef CLOCK_HOPF_SERIAL
extern	struct refclock	refclock_hopfser;
#else
#define	refclock_hopfser refclock_none
#endif

#ifdef CLOCK_HOPF_PCI
extern	struct refclock	refclock_hopfpci;
#else
#define	refclock_hopfpci refclock_none
#endif

#ifdef CLOCK_JJY
extern	struct refclock	refclock_jjy;
#else
#define	refclock_jjy refclock_none
#endif

#ifdef CLOCK_TT560
extern	struct refclock	refclock_tt560;
#else
#define	refclock_tt560 refclock_none
#endif

#ifdef CLOCK_ZYFER
extern	struct refclock	refclock_zyfer;
#else
#define	refclock_zyfer refclock_none
#endif

#ifdef CLOCK_RIPENCC
extern struct refclock refclock_ripencc;
#else
#define refclock_ripencc refclock_none
#endif

#ifdef CLOCK_NEOCLOCK4X
extern	struct refclock	refclock_neoclock4x;
#else
#define	refclock_neoclock4x	refclock_none
#endif

/*
 * Order is clock_start(), clock_shutdown(), clock_poll(),
 * clock_control(), clock_init(), clock_buginfo, clock_flags;
 *
 * Types are defined in ntp.h.  The index must match this.
 */
struct refclock * const refclock_conf[] = {
	&refclock_none,		/* 0 REFCLK_NONE */
	&refclock_local,	/* 1 REFCLK_LOCAL */
	&refclock_none,		/* 2 deprecated: REFCLK_GPS_TRAK */
	&refclock_pst,		/* 3 REFCLK_WWV_PST */
	&refclock_wwvb, 	/* 4 REFCLK_SPECTRACOM */
	&refclock_true,		/* 5 REFCLK_TRUETIME */
	&refclock_irig,		/* 6 REFCLK_IRIG_AUDIO */
	&refclock_chu,		/* 7 REFCLK_CHU_AUDIO */
	&refclock_parse,	/* 8 REFCLK_PARSE */
	&refclock_mx4200,	/* 9 REFCLK_GPS_MX4200 */
	&refclock_as2201,	/* 10 REFCLK_GPS_AS2201 */
	&refclock_arbiter,	/* 11 REFCLK_GPS_ARBITER */
	&refclock_tpro,		/* 12 REFCLK_IRIG_TPRO */
	&refclock_leitch,	/* 13 REFCLK_ATOM_LEITCH */
	&refclock_none,		/* 14 deprecated: REFCLK_MSF_EES */
	&refclock_none,		/* 15 not used */
	&refclock_bancomm,	/* 16 REFCLK_IRIG_BANCOMM */
	&refclock_datum,	/* 17 REFCLK_GPS_DATUM */
	&refclock_acts,		/* 18 REFCLK_ACTS */
	&refclock_heath,	/* 19 REFCLK_WWV_HEATH */
	&refclock_nmea,		/* 20 REFCLK_GPS_NMEA */
	&refclock_gpsvme,	/* 21 REFCLK_GPS_VME */
	&refclock_atom,		/* 22 REFCLK_ATOM_PPS */
	&refclock_none,		/* 23 not used */
	&refclock_none,		/* 24 not used */
	&refclock_none,		/* 25 not used */
	&refclock_hpgps,	/* 26 REFCLK_GPS_HP */
	&refclock_arc, 		/* 27 REFCLK_ARCRON_MSF */
	&refclock_shm,		/* 28 REFCLK_SHM */
	&refclock_palisade,	/* 29 REFCLK_PALISADE */
	&refclock_oncore,	/* 30 REFCLK_ONCORE */
	&refclock_jupiter,	/* 31 REFCLK_GPS_JUPITER */
	&refclock_chronolog,	/* 32 REFCLK_CHRONOLOG */
	&refclock_dumbclock,	/* 33 REFCLK_DUMBCLOCK */
	&refclock_ulink,	/* 34 REFCLOCK_ULINK */
	&refclock_pcf,		/* 35 REFCLOCK_PCF */
	&refclock_wwv,		/* 36 REFCLOCK_WWV_AUDIO */
	&refclock_fg,		/* 37 REFCLOCK_FG */
	&refclock_hopfser,	/* 38 REFCLK_HOPF_SERIAL */
	&refclock_hopfpci,	/* 39 REFCLK_HOPF_PCI */
	&refclock_jjy,		/* 40 REFCLK_JJY */
	&refclock_tt560,	/* 41 REFCLK_TT560 */
	&refclock_zyfer,	/* 42 REFCLK_ZYFER */
	&refclock_ripencc,	/* 43 REFCLK_RIPENCC */
	&refclock_neoclock4x    /* 44 REFCLK_NEOCLOCK4X */
};

u_char num_refclock_conf = sizeof(refclock_conf)/sizeof(struct refclock *);

#else
int refclock_conf_bs;
#endif
ntp-4.2.6p5/ntpd/refclock_nmea.c0000644000175000017500000007701311466411656015534 0ustar  peterpeter/*
 * refclock_nmea.c - clock driver for an NMEA GPS CLOCK
 *		Michael Petry Jun 20, 1994
 *		 based on refclock_heathn.c
 *
 * Updated to add support for Accord GPS Clock
 *		Venu Gopal Dec 05, 2007
 *		neo.venu@gmail.com, venugopal_d@pgad.gov.in
 *
 * Updated to process 'time1' fudge factor
 *		Venu Gopal May 05, 2008
 *
 * Converted to common PPSAPI code, separate PPS fudge time1
 * from serial timecode fudge time2.
 *		Dave Hart July 1, 2009
 *		hart@ntp.org, davehart@davehart.com
 */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_NMEA)

#include 
#include 
#include 

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_unixtime.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"
#include "ntp_calendar.h"

#ifdef HAVE_PPSAPI
# include "ppsapi_timepps.h"
# include "refclock_atom.h"
#endif /* HAVE_PPSAPI */

#ifdef SYS_WINNT
#undef write	/* ports/winnt/include/config.h: #define write _write */
extern int async_write(int, const void *, unsigned int);
#define write(fd, data, octets)	async_write(fd, data, octets)
#endif

#ifndef TIMESPECTOTS
#define TIMESPECTOTS(ptspec, pts)					\
	do {								\
		DTOLFP((ptspec)->tv_nsec * 1.0e-9, pts);		\
		(pts)->l_ui += (u_int32)((ptspec)->tv_sec) + JAN_1970;	\
	} while (0)
#endif


/*
 * This driver supports NMEA-compatible GPS receivers
 *
 * Prototype was refclock_trak.c, Thanks a lot.
 *
 * The receiver used spits out the NMEA sentences for boat navigation.
 * And you thought it was an information superhighway.	Try a raging river
 * filled with rapids and whirlpools that rip away your data and warp time.
 *
 * If HAVE_PPSAPI is defined code to use the PPSAPI will be compiled in.
 * On startup if initialization of the PPSAPI fails, it will fall back
 * to the "normal" timestamps.
 *
 * The PPSAPI part of the driver understands fudge flag2 and flag3. If
 * flag2 is set, it will use the clear edge of the pulse. If flag3 is
 * set, kernel hardpps is enabled.
 *
 * GPS sentences other than RMC (the default) may be enabled by setting
 * the relevent bits of 'mode' in the server configuration line
 * server 127.127.20.x mode X
 * 
 * bit 0 - enables RMC (1)
 * bit 1 - enables GGA (2)
 * bit 2 - enables GLL (4)
 * bit 3 - enables ZDA (8) - Standard Time & Date
 * bit 3 - enables ZDG (8) - Accord GPS Clock's custom sentence with GPS time 
 *			     very close to standard ZDA
 * 
 * Multiple sentences may be selected except when ZDG/ZDA is selected.
 *
 * bit 4/5/6 - selects the baudrate for serial port :
 *		0 for 4800 (default) 
 *		1 for 9600 
 *		2 for 19200 
 *		3 for 38400 
 *		4 for 57600 
 *		5 for 115200 
 */
#define NMEA_MESSAGE_MASK_OLD	 0x07
#define NMEA_MESSAGE_MASK_SINGLE 0x08
#define NMEA_MESSAGE_MASK	 (NMEA_MESSAGE_MASK_OLD | NMEA_MESSAGE_MASK_SINGLE)

#define NMEA_BAUDRATE_MASK	 0x70
#define NMEA_BAUDRATE_SHIFT	 4

/*
 * Definitions
 */
#define	DEVICE		"/dev/gps%d"	/* GPS serial device */
#define	PPSDEV		"/dev/gpspps%d"	/* PPSAPI device override */
#define	SPEED232	B4800	/* uart speed (4800 bps) */
#define	PRECISION	(-9)	/* precision assumed (about 2 ms) */
#define	PPS_PRECISION	(-20)	/* precision assumed (about 1 us) */
#define	REFID		"GPS\0"	/* reference id */
#define	DESCRIPTION	"NMEA GPS Clock" /* who we are */
#ifndef O_NOCTTY
#define M_NOCTTY	0
#else
#define M_NOCTTY	O_NOCTTY
#endif
#ifndef O_NONBLOCK
#define M_NONBLOCK	0
#else
#define M_NONBLOCK	O_NONBLOCK
#endif
#define PPSOPENMODE	(O_RDWR | M_NOCTTY | M_NONBLOCK)

/* NMEA sentence array indexes for those we use */
#define NMEA_GPRMC	0	/* recommended min. nav. */
#define NMEA_GPGGA	1	/* fix and quality */
#define NMEA_GPGLL	2	/* geo. lat/long */
#define NMEA_GPZDA	3	/* date/time */
/*
 * $GPZDG is a proprietary sentence that violates the spec, by not
 * using $P and an assigned company identifier to prefix the sentence
 * identifier.	When used with this driver, the system needs to be
 * isolated from other NTP networks, as it operates in GPS time, not
 * UTC as is much more common.	GPS time is >15 seconds different from
 * UTC due to not respecting leap seconds since 1970 or so.  Other
 * than the different timebase, $GPZDG is similar to $GPZDA.
 */
#define NMEA_GPZDG	4
#define NMEA_ARRAY_SIZE (NMEA_GPZDG + 1)

/*
 * Sentence selection mode bits
 */
#define USE_ALL			0	/* any/all */
#define USE_GPRMC		1
#define USE_GPGGA		2
#define USE_GPGLL		4
#define USE_GPZDA_ZDG		8	/* affects both */

/* mapping from sentence index to controlling mode bit */
u_char sentence_mode[NMEA_ARRAY_SIZE] =
{
	USE_GPRMC,
	USE_GPGGA,
	USE_GPGLL,
	USE_GPZDA_ZDG,
	USE_GPZDA_ZDG
};

/*
 * Unit control structure
 */
struct nmeaunit {
#ifdef HAVE_PPSAPI
	struct refclock_atom atom; /* PPSAPI structure */
	int	ppsapi_tried;	/* attempt PPSAPI once */
	int	ppsapi_lit;	/* time_pps_create() worked */
	int	ppsapi_fd;	/* fd used with PPSAPI */
	int	ppsapi_gate;	/* allow edge detection processing */
	int	tcount;		/* timecode sample counter */
	int	pcount;		/* PPS sample counter */
#endif /* HAVE_PPSAPI */
	l_fp	tstamp;		/* timestamp of last poll */
	int	gps_time;	/* 0 UTC, 1 GPS time */
		/* per sentence checksum seen flag */
	struct calendar used;	/* hh:mm:ss of used sentence */
	u_char	cksum_seen[NMEA_ARRAY_SIZE];
};

/*
 * Function prototypes
 */
static	int	nmea_start	(int, struct peer *);
static	void	nmea_shutdown	(int, struct peer *);
static	void	nmea_receive	(struct recvbuf *);
static	void	nmea_poll	(int, struct peer *);
#ifdef HAVE_PPSAPI
static	void	nmea_control	(int, struct refclockstat *,
				 struct refclockstat *, struct peer *);
static	void	nmea_timer	(int, struct peer *);
#define		NMEA_CONTROL	nmea_control
#define		NMEA_TIMER	nmea_timer
#else
#define		NMEA_CONTROL	noentry
#define		NMEA_TIMER	noentry
#endif /* HAVE_PPSAPI */
static	void	gps_send	(int, const char *, struct peer *);
static	char *	field_parse	(char *, int);
static	int	nmea_checksum_ok(const char *);
static void nmea_day_unfold(struct calendar*);
static void nmea_century_unfold(struct calendar*);

/*
 * Transfer vector
 */
struct	refclock refclock_nmea = {
	nmea_start,		/* start up driver */
	nmea_shutdown,		/* shut down driver */
	nmea_poll,		/* transmit poll message */
	NMEA_CONTROL,		/* fudge control */
	noentry,		/* initialize driver */
	noentry,		/* buginfo */
	NMEA_TIMER		/* called once per second */
};

/*
 * nmea_start - open the GPS devices and initialize data for processing
 */
static int
nmea_start(
	int unit,
	struct peer *peer
	)
{
	register struct nmeaunit *up;
	struct refclockproc *pp;
	int fd;
	char device[20];
	int baudrate;
	char *baudtext;

	pp = peer->procptr;

	/*
	 * Open serial port. Use CLK line discipline, if available.
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
	
	/*
	 * Opening the serial port with appropriate baudrate
	 * based on the value of bit 4/5/6
	 */
	switch ((peer->ttl & NMEA_BAUDRATE_MASK) >> NMEA_BAUDRATE_SHIFT) {
	case 0:
	case 6:
	case 7:
	default:
		baudrate = SPEED232;
		baudtext = "4800";
		break;
	case 1:
		baudrate = B9600;
		baudtext = "9600";
		break;
	case 2:
		baudrate = B19200;
		baudtext = "19200";
		break;
	case 3:
		baudrate = B38400;
		baudtext = "38400";
		break;
#ifdef B57600
	case 4:
		baudrate = B57600;
		baudtext = "57600";
		break;
#endif
#ifdef B115200
	case 5:
		baudrate = B115200;
		baudtext = "115200";
		break;
#endif
	}

	fd = refclock_open(device, baudrate, LDISC_CLK);
	
	if (fd <= 0) {
#ifdef HAVE_READLINK
		/* nmead support added by Jon Miner (cp_n18@yahoo.com)
		 *
		 * See http://home.hiwaay.net/~taylorc/gps/nmea-server/
		 * for information about nmead
		 *
		 * To use this, you need to create a link from /dev/gpsX
		 * to the server:port where nmead is running.  Something
		 * like this:
		 *
		 * ln -s server:port /dev/gps1
		 */
		char buffer[80];
		char *nmea_host, *nmea_tail;
		int   nmea_port;
		int   len;
		struct hostent *he;
		struct protoent *p;
		struct sockaddr_in so_addr;

		if ((len = readlink(device,buffer,sizeof(buffer))) == -1)
			return(0);
		buffer[len] = 0;

		if ((nmea_host = strtok(buffer,":")) == NULL)
			return(0);
		if ((nmea_tail = strtok(NULL,":")) == NULL)
			return(0);

		nmea_port = atoi(nmea_tail);

		if ((he = gethostbyname(nmea_host)) == NULL)
			return(0);
		if ((p = getprotobyname("tcp")) == NULL)
			return(0);
		memset(&so_addr, 0, sizeof(so_addr));
		so_addr.sin_family = AF_INET;
		so_addr.sin_port = htons(nmea_port);
		so_addr.sin_addr = *((struct in_addr *) he->h_addr);

		if ((fd = socket(PF_INET,SOCK_STREAM,p->p_proto)) == -1)
			return(0);
		if (connect(fd,(struct sockaddr *)&so_addr, sizeof(so_addr)) == -1) {
			close(fd);
			return (0);
		}
#else
		pp->io.fd = -1;
		return (0);
#endif
	}

	msyslog(LOG_NOTICE, "%s serial %s open at %s bps",
		refnumtoa(&peer->srcadr), device, baudtext);

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp->io.clock_recv = nmea_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		pp->io.fd = -1;
		close(fd);
		free(up);
		return (0);
	}
	pp->unitptr = (caddr_t)up;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy(&pp->refid, REFID, 4);

	gps_send(fd,"$PMOTG,RMC,0000*1D\r\n", peer);

	return (1);
}


/*
 * nmea_shutdown - shut down a GPS clock
 * 
 * NOTE this routine is called after nmea_start() returns failure,
 * as well as during a normal shutdown due to ntpq :config unpeer.
 */
static void
nmea_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct nmeaunit *up;
	struct refclockproc *pp;

	UNUSED_ARG(unit);

	pp = peer->procptr;
	up = (struct nmeaunit *)pp->unitptr;
	if (up != NULL) {
#ifdef HAVE_PPSAPI
		if (up->ppsapi_lit) {
			time_pps_destroy(up->atom.handle);
			if (up->ppsapi_fd != pp->io.fd)
				close(up->ppsapi_fd);
		}
#endif
		free(up);
	}
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
}

/*
 * nmea_control - configure fudge params
 */
#ifdef HAVE_PPSAPI
static void
nmea_control(
	int unit,
	struct refclockstat *in_st,
	struct refclockstat *out_st,
	struct peer *peer
	)
{
	char device[32];
	register struct nmeaunit *up;
	struct refclockproc *pp;
	int pps_fd;
	
	UNUSED_ARG(in_st);
	UNUSED_ARG(out_st);

	pp = peer->procptr;
	up = (struct nmeaunit *)pp->unitptr;

	if (!(CLK_FLAG1 & pp->sloppyclockflag)) {
		if (!up->ppsapi_tried)
			return;
		up->ppsapi_tried = 0;
		if (!up->ppsapi_lit)
			return;
		peer->flags &= ~FLAG_PPS;
		peer->precision = PRECISION;
		time_pps_destroy(up->atom.handle);
		if (up->ppsapi_fd != pp->io.fd)
			close(up->ppsapi_fd);
		up->atom.handle = 0;
		up->ppsapi_lit = 0;
		up->ppsapi_fd = -1;
		return;
	}

	if (up->ppsapi_tried)
		return;
	/*
	 * Light up the PPSAPI interface.
	 */
	up->ppsapi_tried = 1;

	/*
	 * if /dev/gpspps$UNIT can be opened that will be used for
	 * PPSAPI.  Otherwise, the GPS serial device /dev/gps$UNIT
	 * already opened is used for PPSAPI as well.
	 */
	snprintf(device, sizeof(device), PPSDEV, unit);

	pps_fd = open(device, PPSOPENMODE, S_IRUSR | S_IWUSR);

	if (-1 == pps_fd)
		pps_fd = pp->io.fd;
	
	if (refclock_ppsapi(pps_fd, &up->atom)) {
		up->ppsapi_lit = 1;
		up->ppsapi_fd = pps_fd;
		/* prepare to use the PPS API for our own purposes now. */
		refclock_params(pp->sloppyclockflag, &up->atom);
		return;
	}

	NLOG(NLOG_CLOCKINFO)
		msyslog(LOG_WARNING, "%s flag1 1 but PPSAPI fails",
			refnumtoa(&peer->srcadr));
}
#endif	/* HAVE_PPSAPI */


/*
 * nmea_timer - called once per second, fetches PPS
 *		timestamp and stuffs in median filter.
 */
#ifdef HAVE_PPSAPI
static void
nmea_timer(
	int		unit,
	struct peer *	peer
	)
{
	struct nmeaunit *up;
	struct refclockproc *pp;

	UNUSED_ARG(unit);

	pp = peer->procptr;
	up = (struct nmeaunit *)pp->unitptr;

	if (up->ppsapi_lit && up->ppsapi_gate &&
	    refclock_pps(peer, &up->atom, pp->sloppyclockflag) > 0) {
		up->pcount++,
		peer->flags |= FLAG_PPS;
		peer->precision = PPS_PRECISION;
	}
}
#endif	/* HAVE_PPSAPI */

#ifdef HAVE_PPSAPI
/*
 * This function is used to correlate a receive time stamp and a
 * reference time with a PPS edge time stamp. It applies the necessary
 * fudges (fudge1 for PPS, fudge2 for receive time) and then tries to
 * move the receive time stamp to the corresponding edge. This can
 * warp into future, if a transmission delay of more than 500ms is not
 * compensated with a corresponding fudge time2 value, because then
 * the next PPS edge is nearer than the last. (Similiar to what the
 * PPS ATOM driver does, but we deal with full time stamps here, not
 * just phase shift information.) Likewise, a negative fudge time2
 * value must be used if the reference time stamp correlates with the
 * *following* PPS pulse.
 *
 * Note that the receive time fudge value only needs to move the receive
 * stamp near a PPS edge but that close proximity is not required;
 * +/-100ms precision should be enough. But since the fudge value will
 * probably also be used to compensate the transmission delay when no PPS
 * edge can be related to the time stamp, it's best to get it as close
 * as possible.
 *
 * It should also be noted that the typical use case is matching to
 * the preceeding edge, as most units relate their sentences to the
 * current second.
 *
 * The function returns PPS_RELATE_NONE (0) if no PPS edge correlation
 * can be fixed; PPS_RELATE_EDGE (1) when a PPS edge could be fixed, but
 * the distance to the reference time stamp is too big (exceeds +/-400ms)
 * and the ATOM driver PLL cannot be used to fix the phase; and
 * PPS_RELATE_PHASE (2) when the ATOM driver PLL code can be used.
 *
 * On output, the receive time stamp is replaced with the
 * corresponding PPS edge time if a fix could be made; the PPS fudge
 * is updated to reflect the proper fudge time to apply. (This implies
 * that 'refclock_process_f()' must be used!)
 */
#define PPS_RELATE_NONE	 0	/* no pps correlation possible	  */
#define PPS_RELATE_EDGE	 1	/* recv time fixed, no phase lock */
#define PPS_RELATE_PHASE 2	/* recv time fixed, phase lock ok */

static int
refclock_ppsrelate(
	const struct refclockproc  *pp	    ,	/* for sanity	  */
	const struct refclock_atom *ap	    ,	/* for PPS io	  */
	const l_fp		   *reftime ,
	l_fp			   *rd_stamp,	/* i/o read stamp */
	double			    pp_fudge,	/* pps fudge	  */
	double			   *rd_fudge)	/* i/o read fudge */
{
	pps_info_t	pps_info;
	struct timespec timeout;
	l_fp		pp_stamp, pp_delta;
	double		delta, idelta;

	if (pp->leap == LEAP_NOTINSYNC)
		return PPS_RELATE_NONE;	/* clock is insane, no chance */
	
	memset(&timeout, 0, sizeof(timeout));
	memset(&pps_info, 0, sizeof(pps_info_t));

	if (time_pps_fetch(ap->handle, PPS_TSFMT_TSPEC,
			   &pps_info, &timeout) < 0)
		return PPS_RELATE_NONE;

	/* get last active PPS edge before receive */
	if (ap->pps_params.mode & PPS_CAPTUREASSERT)
		timeout = pps_info.assert_timestamp;
	else if (ap->pps_params.mode & PPS_CAPTURECLEAR)
		timeout = pps_info.clear_timestamp;
	else
		return PPS_RELATE_NONE;

	/* get delta between receive time and PPS time */
	TIMESPECTOTS(&timeout, &pp_stamp);
	pp_delta = *rd_stamp;
	L_SUB(&pp_delta, &pp_stamp);
	LFPTOD(&pp_delta, delta);
	delta += pp_fudge - *rd_fudge;
	if (fabs(delta) > 1.5)
		return PPS_RELATE_NONE; /* PPS timeout control */
	
	/* eventually warp edges, check phase */
	idelta	  = floor(delta + 0.5);
	pp_fudge -= idelta;
	delta	 -= idelta;
	if (fabs(delta) > 0.45)
		return PPS_RELATE_NONE; /* dead band control */

	/* we actually have a PPS edge to relate with! */
	*rd_stamp = pp_stamp;
	*rd_fudge = pp_fudge;

	/* if whole system out-of-sync, do not try to PLL */
	if (sys_leap == LEAP_NOTINSYNC)
		return PPS_RELATE_EDGE;	/* cannot PLL with atom code */

	/* check against reftime if ATOM PLL can be used */
	pp_delta = *reftime;
	L_SUB(&pp_delta, &pp_stamp);
	LFPTOD(&pp_delta, delta);
	delta += pp_fudge;
	if (fabs(delta) > 0.45)
		return PPS_RELATE_EDGE;	/* cannot PLL with atom code */

	/* all checks passed, gets an AAA rating here! */
	return PPS_RELATE_PHASE; /* can PLL with atom code */
}
#endif	/* HAVE_PPSAPI */

/*
 * nmea_receive - receive data from the serial interface
 */
static void
nmea_receive(
	struct recvbuf *rbufp
	)
{
	register struct nmeaunit *up;
	struct refclockproc *pp;
	struct peer *peer;
	char *cp, *dp, *msg;
	u_char sentence;
	/* Use these variables to hold data until we decide its worth
	 * keeping */
	char	rd_lastcode[BMAX];
	l_fp	rd_timestamp, reftime;
	int	rd_lencode;
	double	rd_fudge;
	struct calendar date;

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = rbufp->recv_peer;
	pp = peer->procptr;
	up = (struct nmeaunit *)pp->unitptr;

	rd_lencode = refclock_gtlin(
			rbufp, 
			rd_lastcode, 
			sizeof(rd_lastcode), 
			&rd_timestamp);

	/*
	 * There is a case that a  gives back a "blank" line.
	 * We can't have a well-formed sentence with less than 8 chars.
	 */
	if (0 == rd_lencode)
		return;

	if (rd_lencode < 8) {
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	DPRINTF(1, ("nmea: gpsread %d %s\n", rd_lencode, rd_lastcode));

	/*
	 * We check the timecode format and decode its contents. The
	 * we only care about a few of them.  The most important being
	 * the $GPRMC format
	 * $GPRMC,hhmmss,a,fddmm.xx,n,dddmmm.xx,w,zz.z,yyy.,ddmmyy,dd,v*CC
	 * mode (0,1,2,3) selects sentence ANY/ALL, RMC, GGA, GLL, ZDA
	 * $GPGLL,3513.8385,S,14900.7851,E,232420.594,A*21
	 * $GPGGA,232420.59,3513.8385,S,14900.7851,E,1,05,3.4,00519,M,,,,*3F
	 * $GPRMC,232418.19,A,3513.8386,S,14900.7853,E,00.0,000.0,121199,12.,E*77
	 *
	 * Defining GPZDA to support Standard Time & Date
	 * sentence. The sentence has the following format 
	 *  
	 *  $--ZDA,HHMMSS.SS,DD,MM,YYYY,TH,TM,*CS
	 *
	 *  Apart from the familiar fields, 
	 *  'TH'    Time zone Hours
	 *  'TM'    Time zone Minutes
	 *
	 * Defining GPZDG to support Accord GPS Clock's custom NMEA 
	 * sentence. The sentence has the following format 
	 *  
	 *  $GPZDG,HHMMSS.S,DD,MM,YYYY,AA.BB,V*CS
	 *
	 *  It contains the GPS timestamp valid for next PPS pulse.
	 *  Apart from the familiar fields, 
	 *  'AA.BB' denotes the signal strength( should be < 05.00 ) 
	 *  'V'	    denotes the GPS sync status : 
	 *	   '0' indicates INVALID time, 
	 *	   '1' indicates accuracy of +/-20 ms
	 *	   '2' indicates accuracy of +/-100 ns
	 */

	cp = rd_lastcode;
	if (cp[0] == '$') {
		/* Allow for GLGGA and GPGGA etc. */
		msg = cp + 3;

		if (strncmp(msg, "RMC", 3) == 0)
			sentence = NMEA_GPRMC;
		else if (strncmp(msg, "GGA", 3) == 0)
			sentence = NMEA_GPGGA;
		else if (strncmp(msg, "GLL", 3) == 0)
			sentence = NMEA_GPGLL;
		else if (strncmp(msg, "ZDG", 3) == 0)
			sentence = NMEA_GPZDG;
		else if (strncmp(msg, "ZDA", 3) == 0)
			sentence = NMEA_GPZDA;
		else
			return;
	} else
		return;

	/* See if I want to process this message type */
	if ((peer->ttl & NMEA_MESSAGE_MASK) &&
	   !(peer->ttl & sentence_mode[sentence]))
		return;

	/* 
	 * $GPZDG provides GPS time not UTC, and the two mix poorly.
	 * Once have processed a $GPZDG, do not process any further
	 * UTC sentences (all but $GPZDG currently).
	 */
	if (up->gps_time && NMEA_GPZDG != sentence)
		return;

	/*
	 * Apparently, older NMEA specifications (which are expensive)
	 * did not require the checksum for all sentences.  $GPMRC is
	 * the only one so far identified which has always been required
	 * to include a checksum.
	 *
	 * Today, most NMEA GPS receivers checksum every sentence.  To
	 * preserve its error-detection capabilities with modern GPSes
	 * while allowing operation without checksums on all but $GPMRC,
	 * we keep track of whether we've ever seen a checksum on a
	 * given sentence, and if so, reject future checksum failures.
	 */
	if (nmea_checksum_ok(rd_lastcode)) {
		up->cksum_seen[sentence] = TRUE;
	} else if (NMEA_GPRMC == sentence || up->cksum_seen[sentence]) {
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	cp = rd_lastcode;

	/* Grab field depending on clock string type */
	memset(&date, 0, sizeof(date));
	switch (sentence) {

	case NMEA_GPRMC:
		/*
		 * Test for synchronization.  Check for quality byte.
		 */
		dp = field_parse(cp, 2);
		if (dp[0] != 'A')
			pp->leap = LEAP_NOTINSYNC;
		else
			pp->leap = LEAP_NOWARNING;

		/* Now point at the time field */
		dp = field_parse(cp, 1);
		break;

	case NMEA_GPGGA:
		/*
		 * Test for synchronization.  Check for quality byte.
		 */
		dp = field_parse(cp, 6);
		if (dp[0] == '0')
			pp->leap = LEAP_NOTINSYNC;
		else
			pp->leap = LEAP_NOWARNING;

		/* Now point at the time field */
		dp = field_parse(cp, 1);
		break;

	case NMEA_GPGLL:
		/*
		 * Test for synchronization.  Check for quality byte.
		 */
		dp = field_parse(cp, 6);
		if (dp[0] != 'A')
			pp->leap = LEAP_NOTINSYNC;
		else
			pp->leap = LEAP_NOWARNING;

		/* Now point at the time field */
		dp = field_parse(cp, 5);
		break;
	
	case NMEA_GPZDG:
		/* For $GPZDG check for validity of GPS time. */
		dp = field_parse(cp, 6);
		if (dp[0] == '0') 
			pp->leap = LEAP_NOTINSYNC;
		else 
			pp->leap = LEAP_NOWARNING;
		/* fall through to NMEA_GPZDA */

	case NMEA_GPZDA:
		if (NMEA_GPZDA == sentence)
			pp->leap = LEAP_NOWARNING;

		/* Now point at the time field */
		dp = field_parse(cp, 1);
		break;

	default:
		return;
	}

	/*
	 * Check time code format of NMEA
	 */
	if (!isdigit((int)dp[0]) ||
	    !isdigit((int)dp[1]) ||
	    !isdigit((int)dp[2]) ||
	    !isdigit((int)dp[3]) ||
	    !isdigit((int)dp[4]) ||
	    !isdigit((int)dp[5])) {

		DPRINTF(1, ("NMEA time code %c%c%c%c%c%c non-numeric",
			    dp[0], dp[1], dp[2], dp[3], dp[4], dp[5]));
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}

	/*
	 * Convert time and check values.
	 */
	date.hour = ((dp[0] - '0') * 10) + dp[1] - '0';
	date.minute = ((dp[2] - '0') * 10) + dp[3] -  '0';
	date.second = ((dp[4] - '0') * 10) + dp[5] - '0';
	/* 
	 * Default to 0 milliseconds, if decimal convert milliseconds in
	 * one, two or three digits
	 */
	pp->nsec = 0; 
	if (dp[6] == '.') {
		if (isdigit((int)dp[7])) {
			pp->nsec = (dp[7] - '0') * 100000000;
			if (isdigit((int)dp[8])) {
				pp->nsec += (dp[8] - '0') * 10000000;
				if (isdigit((int)dp[9])) {
					pp->nsec += (dp[9] - '0') * 1000000;
				}
			}
		}
	}

	if (date.hour > 23 || date.minute > 59 || 
	    date.second > 59 || pp->nsec > 1000000000) {

		DPRINTF(1, ("NMEA hour/min/sec/nsec range %02d:%02d:%02d.%09ld\n",
			    pp->hour, pp->minute, pp->second, pp->nsec));
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}

	/*
	 * Used only the first recognized sentence each second.
	 */
	if (date.hour   == up->used.hour   &&
	    date.minute == up->used.minute &&
	    date.second == up->used.second)
		return;

	pp->lencode = (u_short)rd_lencode;
	memcpy(pp->a_lastcode, rd_lastcode, pp->lencode + 1);
	up->tstamp = rd_timestamp;
	pp->lastrec = up->tstamp;
	DPRINTF(1, ("nmea: timecode %d %s\n", pp->lencode, pp->a_lastcode));

	/*
	 * Convert date and check values.
	 */
	if (NMEA_GPRMC == sentence) {

		dp = field_parse(cp,9);
		date.monthday = 10 * (dp[0] - '0') + (dp[1] - '0');
		date.month    = 10 * (dp[2] - '0') + (dp[3] - '0');
		date.year     = 10 * (dp[4] - '0') + (dp[5] - '0');
		nmea_century_unfold(&date);

	} else if (NMEA_GPZDA == sentence || NMEA_GPZDG == sentence) {

		dp = field_parse(cp, 2);
		date.monthday = 10 * (dp[0] - '0') + (dp[1] - '0');
		dp = field_parse(cp, 3);
		date.month = 10 * (dp[0] - '0') + (dp[1] - '0');
		dp = field_parse(cp, 4);
		date.year = 1000 * (dp[0] - '0') + 100 * (dp[1] - '0')
			  + 10 * (dp[2] - '0') + (dp[3] - '0');

	} else
		nmea_day_unfold(&date);

	if (date.month < 1 || date.month > 12 ||
	    date.monthday < 1 || date.monthday > 31) {
		refclock_report(peer, CEVNT_BADDATE);
		return;
	}

	up->used.hour = date.hour;
	up->used.minute = date.minute;
	up->used.second = date.second;

	/*
	 * If "fudge 127.127.20.__ flag4 1" is configured in ntp.conf,
	 * remove the location and checksum from the NMEA sentence
	 * recorded as the last timecode and visible to remote users
	 * with:
	 *
	 * ntpq -c clockvar 
	 *
	 * Note that this also removes the location from the clockstats
	 * log (if it is enabled).  Some NTP operators monitor their
	 * NMEA GPS using the change in location in clockstats over
	 * time as as a proxy for the quality of GPS reception and
	 * thereby time reported.
	 */
	if (CLK_FLAG4 & pp->sloppyclockflag) {
		/*
		 * Start by pointing cp and dp at the fields with 
		 * longitude and latitude in the last timecode.
		 */
		switch (sentence) {

		case NMEA_GPGLL:
			cp = field_parse(pp->a_lastcode, 1);
			dp = field_parse(cp, 2);
			break;

		case NMEA_GPGGA:
			cp = field_parse(pp->a_lastcode, 2);
			dp = field_parse(cp, 2);
			break;

		case NMEA_GPRMC:
			cp = field_parse(pp->a_lastcode, 3);
			dp = field_parse(cp, 2);
			break;

		case NMEA_GPZDA:
		case NMEA_GPZDG:
		default:
			cp = dp = NULL;
		}

		/* Blank the entire latitude & longitude. */
		while (cp) {
			while (',' != *cp) {
				if ('.' != *cp)
					*cp = '_';
				cp++;
			}

			/* Longitude at cp then latitude at dp */
			if (cp < dp)
				cp = dp;
			else
				cp = NULL;
		}

		/* Blank the checksum, the last two characters */
		if (dp) {
			cp = pp->a_lastcode + pp->lencode - 2;
			if (0 == cp[2])
				cp[0] = cp[1] = '_';
		}

	}

	/*
	 * Get the reference time stamp from the calendar buffer.
	 * Process the new sample in the median filter and determine
	 * the timecode timestamp, but only if the PPS is not in
	 * control.
	 */
	rd_fudge = pp->fudgetime2;
	date.yearday = 0; /* make sure it's not used */
	DTOLFP(pp->nsec * 1.0e-9, &reftime);
	reftime.l_ui += caltontp(&date);

	/* $GPZDG postprocessing first... */
	if (NMEA_GPZDG == sentence) {
		/*
		 * Note if we're only using GPS timescale from now on.
		 */
		if (!up->gps_time) {
			up->gps_time = 1;
			NLOG(NLOG_CLOCKINFO)
			msyslog(LOG_INFO, "%s using only $GPZDG",
				refnumtoa(&peer->srcadr));
		}
		/*
		 * $GPZDG indicates the second after the *next* PPS
		 * pulse. So we remove 1 second from the reference
		 * time now.
		 */
		reftime.l_ui--;
	}

#ifdef HAVE_PPSAPI
	up->tcount++;
	/*
	 * If we have PPS running, we try to associate the sentence with
	 * the last active edge of the PPS signal.
	 */
	if (up->ppsapi_lit)
		switch (refclock_ppsrelate(pp, &up->atom, &reftime,
					  &rd_timestamp, pp->fudgetime1,
					  &rd_fudge))
		{
		case PPS_RELATE_EDGE:
			up->ppsapi_gate = 0;
			break;
		case PPS_RELATE_PHASE:
			up->ppsapi_gate = 1;
			break;
		default:
			break;
		}
	else 
		up->ppsapi_gate = 0;

	if (up->ppsapi_gate && (peer->flags & FLAG_PPS))
		return;
#endif /* HAVE_PPSAPI */

	refclock_process_offset(pp, reftime, rd_timestamp, rd_fudge);
}


/*
 * nmea_poll - called by the transmit procedure
 *
 * We go to great pains to avoid changing state here, since there may be
 * more than one eavesdropper receiving the same timecode.
 */
static void
nmea_poll(
	int unit,
	struct peer *peer
	)
{
	register struct nmeaunit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct nmeaunit *)pp->unitptr;

	/*
	 * Process median filter samples. If none received, declare a
	 * timeout and keep going.
	 */
#ifdef HAVE_PPSAPI
	if (up->pcount == 0) {
		peer->flags &= ~FLAG_PPS;
		peer->precision = PRECISION;
	}
	if (up->tcount == 0) {
		pp->coderecv = pp->codeproc;
		refclock_report(peer, CEVNT_TIMEOUT);
		return;
	}
	up->pcount = up->tcount = 0;
#else /* HAVE_PPSAPI */
	if (pp->coderecv == pp->codeproc) {
		refclock_report(peer, CEVNT_TIMEOUT);
		return;
	}
#endif /* HAVE_PPSAPI */

	pp->polls++;
	pp->lastref = pp->lastrec;
	refclock_receive(peer);
	record_clock_stats(&peer->srcadr, pp->a_lastcode);

	/*
	 * usually nmea_receive can get a timestamp every second, 
	 * but at least one Motorola unit needs prompting each
	 * time.
	 */

	gps_send(pp->io.fd,"$PMOTG,RMC,0000*1D\r\n", peer);
}


/*
 *
 *	gps_send(fd,cmd, peer)	Sends a command to the GPS receiver.
 *	 as	gps_send(fd,"rqts,u\r", peer);
 *
 *	We don't currently send any data, but would like to send
 *	RTCM SC104 messages for differential positioning. It should
 *	also give us better time. Without a PPS output, we're
 *	Just fooling ourselves because of the serial code paths
 *
 */
static void
gps_send(
	int fd,
	const char *cmd,
	struct peer *peer
	)
{
	if (write(fd, cmd, strlen(cmd)) == -1) {
		refclock_report(peer, CEVNT_FAULT);
	}
}


static char *
field_parse(
	char *cp,
	int fn
	)
{
	char *tp;
	int i = fn;

	for (tp = cp; i && *tp; tp++)
		if (*tp == ',')
			i--;

	return tp;
}


/*
 * nmea_checksum_ok verifies 8-bit XOR checksum is correct then returns 1
 *
 * format is $XXXXX,1,2,3,4*ML
 *
 * 8-bit XOR of characters between $ and * noninclusive is transmitted
 * in last two chars M and L holding most and least significant nibbles
 * in hex representation such as:
 *
 *   $GPGLL,5057.970,N,00146.110,E,142451,A*27
 *   $GPVTG,089.0,T,,,15.2,N,,*7F
 */
int
nmea_checksum_ok(
	const char *sentence
	)
{
	u_char my_cs;
	u_long input_cs;
	const char *p;

	my_cs = 0;
	p = sentence;

	if ('$' != *p++)
		return 0;

	for ( ; *p && '*' != *p; p++) {

		my_cs ^= *p;
	}

	if ('*' != *p++)
		return 0;

	if (0 == p[0] || 0 == p[1] || 0 != p[2])
		return 0;

	if (0 == hextoint(p, &input_cs))
		return 0;

	if (my_cs != input_cs)
		return 0;

	return 1;
}

/*
 * -------------------------------------------------------------------
 * funny calendar-oriented stuff -- a bit hard to grok.
 * -------------------------------------------------------------------
 */
/*
 * Do a periodic unfolding of a truncated value around a given pivot
 * value.
 * The result r will hold to pivot <= r < pivot+period (period>0) or
 * pivot+period < r <= pivot (period < 0) and value % period == r % period,
 * using floor division convention.
 */
static time_t
nmea_periodic_unfold(
	time_t pivot,
	time_t value,
	time_t period)
{
	/*
	 * This will only work as long as 'value - pivot%period' does
	 * not create a signed overflow condition.
	 */
	value = (value - (pivot % period)) % period;
	if (value && (value ^ period) < 0)
		value += period;
	return pivot + value;
}

/*
 * Unfold a time-of-day (seconds since midnight) around the current
 * system time in a manner that guarantees an absolute difference of
 * less than 12hrs.
 *
 * This function is used for NMEA sentences that contain no date
 * information. This requires the system clock to be in +/-12hrs
 * around the true time, or the clock will synchronize the system 1day
 * off if not augmented with a time sources that also provide the
 * necessary date information.
 *
 * The function updates the refclockproc structure is also uses as
 * input to fetch the time from.
 */
static void
nmea_day_unfold(
	struct calendar *jd)
{
	time_t value, pivot;
	struct tm *tdate;

	value = ((time_t)jd->hour * MINSPERHR
		 + (time_t)jd->minute) * SECSPERMIN
		  + (time_t)jd->second;
	pivot = time(NULL) - SECSPERDAY/2;

	value = nmea_periodic_unfold(pivot, value, SECSPERDAY);
	tdate = gmtime(&value);
	if (tdate) {
		jd->year     = tdate->tm_year + 1900;
		jd->yearday  = tdate->tm_yday + 1;
		jd->month    = tdate->tm_mon + 1;
		jd->monthday = tdate->tm_mday;
		jd->hour     = tdate->tm_hour;
		jd->minute   = tdate->tm_min;
		jd->second   = tdate->tm_sec;
	} else {
		jd->year     = 0;
		jd->yearday  = 0;
		jd->month    = 0;
		jd->monthday = 0;
	}
}

/*
 * Unfold a 2-digit year into full year spec around the current year
 * of the system time. This requires the system clock to be in -79/+19
 * years around the true time, or the result will be off by
 * 100years. The assymetric behaviour was chosen to enable inital sync
 * for systems that do not have a battery-backup-clock and start with
 * a date that is typically years in the past.
 *
 * The function updates the calendar structure that is also used as
 * input to fetch the year from.
 */
static void
nmea_century_unfold(
	struct calendar *jd)
{
	time_t	   pivot_time;
	struct tm *pivot_date;
	time_t	   pivot_year;

	/* get warp limit and century start of pivot from system time */
	pivot_time = time(NULL);
	pivot_date = gmtime(&pivot_time);
	pivot_year = pivot_date->tm_year + 1900 - 20;
	jd->year = nmea_periodic_unfold(pivot_year, jd->year, 100);
}

#else
int refclock_nmea_bs;
#endif /* REFCLOCK && CLOCK_NMEA */
ntp-4.2.6p5/ntpd/ntp_io.c0000644000175000017500000031550711665566225014243 0ustar  peterpeter/*
 * ntp_io.c - input/output routines for ntpd.	The socket-opening code
 *		   was shamelessly stolen from ntpd.
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#include 
#include 
#ifdef HAVE_SYS_PARAM_H
# include 
#endif
#ifdef HAVE_SYS_IOCTL_H
# include 
#endif
#ifdef HAVE_SYS_SOCKIO_H	/* UXPV: SIOC* #defines (Frank Vance ) */
# include 
#endif
#ifdef HAVE_SYS_UIO_H
# include 
#endif

#include "ntp_machine.h"
#include "ntpd.h"
#include "ntp_io.h"
#include "iosignal.h"
#include "ntp_lists.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"
#include "ntp_request.h"
#include "ntp.h"
#include "ntp_unixtime.h"
#include "ntp_assert.h"
#include "ntpd-opts.h"

/* Don't include ISC's version of IPv6 variables and structures */
#define ISC_IPV6_H 1
#include 
#include 
#include 
#include 
#include 

#ifdef SIM
#include "ntpsim.h"
#endif

#ifdef HAS_ROUTING_SOCKET
# include 
# ifdef HAVE_RTNETLINK
#  include 
# endif
#endif


/*
 * setsockopt does not always have the same arg declaration
 * across all platforms. If it's not defined we make it empty
 */

#ifndef SETSOCKOPT_ARG_CAST
#define SETSOCKOPT_ARG_CAST
#endif

extern int listen_to_virtual_ips;

/*
 * NIC rule entry
 */
typedef struct nic_rule_tag nic_rule;

struct nic_rule_tag {
	nic_rule *	next;
	nic_rule_action	action;
	nic_rule_match	match_type;
	char *		if_name;
	sockaddr_u	addr;
	int		prefixlen;
};

/*
 * NIC rule listhead.  Entries are added at the head so that the first
 * match in the list is the last matching rule specified.
 */
nic_rule *nic_rule_list;


#if defined(SO_TIMESTAMP) && defined(SCM_TIMESTAMP)
#if defined(CMSG_FIRSTHDR)
#define HAVE_TIMESTAMP
#define USE_TIMESTAMP_CMSG
#ifndef TIMESTAMP_CTLMSGBUF_SIZE
#define TIMESTAMP_CTLMSGBUF_SIZE 1536 /* moderate default */
#endif
#else
/* fill in for old/other timestamp interfaces */
#endif
#endif

#if defined(SYS_WINNT)
#include 
#include 
/*
 * Windows C runtime ioctl() can't deal properly with sockets, 
 * map to ioctlsocket for this source file.
 */
#define ioctl(fd, opt, val)  ioctlsocket((fd), (opt), (u_long *)(val))
#endif  /* SYS_WINNT */

/*
 * We do asynchronous input using the SIGIO facility.  A number of
 * recvbuf buffers are preallocated for input.	In the signal
 * handler we poll to see which sockets are ready and read the
 * packets from them into the recvbuf's along with a time stamp and
 * an indication of the source host and the interface it was received
 * through.  This allows us to get as accurate receive time stamps
 * as possible independent of other processing going on.
 *
 * We watch the number of recvbufs available to the signal handler
 * and allocate more when this number drops below the low water
 * mark.  If the signal handler should run out of buffers in the
 * interim it will drop incoming frames, the idea being that it is
 * better to drop a packet than to be inaccurate.
 */


/*
 * Other statistics of possible interest
 */
volatile u_long packets_dropped;	/* total number of packets dropped on reception */
volatile u_long packets_ignored;	/* packets received on wild card interface */
volatile u_long packets_received;	/* total number of packets received */
	 u_long packets_sent;		/* total number of packets sent */
	 u_long packets_notsent;	/* total number of packets which couldn't be sent */

volatile u_long handler_calls;	/* number of calls to interrupt handler */
volatile u_long handler_pkts;	/* number of pkts received by handler */
u_long io_timereset;		/* time counters were reset */

/*
 * Interface stuff
 */
endpt *	any_interface;		/* wildcard ipv4 interface */
endpt *	any6_interface;		/* wildcard ipv6 interface */
endpt *	loopback_interface;	/* loopback ipv4 interface */

isc_boolean_t broadcast_client_enabled;	/* is broadcast client enabled */
int ninterfaces;			/* Total number of interfaces */

int disable_dynamic_updates;		/* scan interfaces once only */

#ifdef REFCLOCK
/*
 * Refclock stuff.	We keep a chain of structures with data concerning
 * the guys we are doing I/O for.
 */
static	struct refclockio *refio;
#endif /* REFCLOCK */

#if defined(HAVE_IPTOS_SUPPORT)
/* set IP_TOS to minimize packet delay */
# if defined(IPTOS_PREC_INTERNETCONTROL)
	unsigned int qos = IPTOS_PREC_INTERNETCONTROL;
# else
	 unsigned int qos = IPTOS_LOWDELAY;
# endif
#endif

/*
 * File descriptor masks etc. for call to select
 * Not needed for I/O Completion Ports
 */
fd_set activefds;
int maxactivefd;
/*
 * bit alternating value to detect verified interfaces during an update cycle
 */
static  u_short		sys_interphase = 0;

static endpt *	new_interface(endpt *);
static void	add_interface(endpt *);
static int	update_interfaces(u_short, interface_receiver_t,
				  void *);
static void	remove_interface(endpt *);
static endpt *	create_interface(u_short, endpt *);

static int	move_fd			(SOCKET);
static int	is_wildcard_addr	(const sockaddr_u *);

/*
 * Multicast functions
 */
static	isc_boolean_t	addr_ismulticast	(sockaddr_u *);
static	isc_boolean_t	is_anycast		(sockaddr_u *,
						 const char *);

/*
 * Not all platforms support multicast
 */
#ifdef MCAST
static	isc_boolean_t	socket_multicast_enable	(endpt *, sockaddr_u *);
static	isc_boolean_t	socket_multicast_disable(endpt *, sockaddr_u *);
#endif

#ifdef DEBUG
static void interface_dump	(const endpt *);
static void sockaddr_dump	(const sockaddr_u *);
static void print_interface	(const endpt *, char *, char *);
#define DPRINT_INTERFACE(level, args) do { if (debug >= (level)) { print_interface args; } } while (0)
#else
#define DPRINT_INTERFACE(level, args) do {} while (0)
#endif

typedef struct vsock vsock_t;
enum desc_type { FD_TYPE_SOCKET, FD_TYPE_FILE };

struct vsock {
	vsock_t	*	link;
	SOCKET		fd;
	enum desc_type	type;
};

vsock_t	*fd_list;

#if !defined(HAVE_IO_COMPLETION_PORT) && defined(HAS_ROUTING_SOCKET)
/*
 * async notification processing (e. g. routing sockets)
 */
/*
 * support for receiving data on fd that is not a refclock or a socket
 * like e. g. routing sockets
 */
struct asyncio_reader {
	struct asyncio_reader *link;		    /* the list this is being kept in */
	SOCKET fd;				    /* fd to be read */
	void  *data;				    /* possibly local data */
	void (*receiver)(struct asyncio_reader *);  /* input handler */
};

struct asyncio_reader *asyncio_reader_list;

static void delete_asyncio_reader (struct asyncio_reader *);
static struct asyncio_reader *new_asyncio_reader (void);
static void add_asyncio_reader (struct asyncio_reader *, enum desc_type);
static void remove_asyncio_reader (struct asyncio_reader *);

#endif /* !defined(HAVE_IO_COMPLETION_PORT) && defined(HAS_ROUTING_SOCKET) */

static void init_async_notifications (void);

static	int	addr_eqprefix	(const sockaddr_u *, const sockaddr_u *,
				 int);
static int	addr_samesubnet	(const sockaddr_u *, const sockaddr_u *,
				 const sockaddr_u *, const sockaddr_u *);
static	int	create_sockets	(u_short);
static	SOCKET	open_socket	(sockaddr_u *, int, int, endpt *);
static	char *	fdbits		(int, fd_set *);
static	void	set_reuseaddr	(int);
static	isc_boolean_t	socket_broadcast_enable	 (struct interface *, SOCKET, sockaddr_u *);
static	isc_boolean_t	socket_broadcast_disable (struct interface *, sockaddr_u *);

typedef struct remaddr remaddr_t;

struct remaddr {
	remaddr_t *		link;
	sockaddr_u		addr;
	endpt *			ep;
};

remaddr_t *	remoteaddr_list;
endpt *		ep_list;	/* complete endpt list */
endpt *		mc4_list;	/* IPv4 mcast-capable unicast endpts */
endpt *		mc6_list;	/* IPv6 mcast-capable unicast endpts */

static endpt *	wildipv4;
static endpt *	wildipv6;

static void	add_fd_to_list		(SOCKET, enum desc_type);
static endpt *	find_addr_in_list	(sockaddr_u *);
static endpt *	find_flagged_addr_in_list(sockaddr_u *, u_int32);
static void	delete_addr_from_list	(sockaddr_u *);
static void	delete_interface_from_list(endpt *);
static void	close_and_delete_fd_from_list(SOCKET);
static void	add_addr_to_list	(sockaddr_u *, endpt *);
static void	create_wildcards	(u_short);
static endpt *	getinterface		(sockaddr_u *, u_int32);
static endpt *	findlocalinterface	(sockaddr_u *, int, int);
static endpt *	findclosestinterface	(sockaddr_u *, int);
#ifdef DEBUG
static const char *	action_text	(nic_rule_action);
#endif
static nic_rule_action	interface_action(char *, sockaddr_u *, u_int32);
static void		convert_isc_if	(isc_interface_t *,
					 endpt *, u_short);
static void		calc_addr_distance(sockaddr_u *,
					   const sockaddr_u *,
					   const sockaddr_u *);
static int		cmp_addr_distance(const sockaddr_u *,
					  const sockaddr_u *);

/*
 * Routines to read the ntp packets
 */
#if !defined(HAVE_IO_COMPLETION_PORT)
static inline int     read_network_packet	(SOCKET, struct interface *, l_fp);
static inline int     read_refclock_packet	(SOCKET, struct refclockio *, l_fp);
#endif


#ifdef SYS_WINNT
/*
 * Windows 2000 systems incorrectly cause UDP sockets using WASRecvFrom
 * to not work correctly, returning a WSACONNRESET error when a WSASendTo
 * fails with an "ICMP port unreachable" response and preventing the
 * socket from using the WSARecvFrom in subsequent operations.
 * The function below fixes this, but requires that Windows 2000
 * Service Pack 2 or later be installed on the system.  NT 4.0
 * systems are not affected by this and work correctly.
 * See Microsoft Knowledge Base Article Q263823 for details of this.
 */
void
connection_reset_fix(
	SOCKET		fd,
	sockaddr_u *	addr
	)
{
	DWORD dw;
	BOOL  bNewBehavior = FALSE;
	DWORD status;

	/*
	 * disable bad behavior using IOCTL: SIO_UDP_CONNRESET
	 * NT 4.0 has no problem
	 */
	if (isc_win32os_majorversion() >= 5) {
		status = WSAIoctl(fd, SIO_UDP_CONNRESET, &bNewBehavior,
				  sizeof(bNewBehavior), NULL, 0,
				  &dw, NULL, NULL);
		if (SOCKET_ERROR == status)
			msyslog(LOG_ERR,
				"connection_reset_fix() failed for address %s: %m", 
				stoa(addr));
	}
}
#endif

/*
 * on Unix systems the stdio library typically
 * makes use of file descriptors in the lower
 * integer range.  stdio usually will make use
 * of the file descriptors in the range of
 * [0..FOPEN_MAX)
 * in order to keep this range clean, for socket
 * file descriptors we attempt to move them above
 * FOPEN_MAX. This is not as easy as it sounds as
 * FOPEN_MAX changes from implementation to implementation
 * and may exceed to current file decriptor limits.
 * We are using following strategy:
 * - keep a current socket fd boundary initialized with
 *   max(0, min(getdtablesize() - FD_CHUNK, FOPEN_MAX))
 * - attempt to move the descriptor to the boundary or
 *   above.
 *   - if that fails and boundary > 0 set boundary
 *     to min(0, socket_fd_boundary - FD_CHUNK)
 *     -> retry
 *     if failure and boundary == 0 return old fd
 *   - on success close old fd return new fd
 *
 * effects:
 *   - fds will be moved above the socket fd boundary
 *     if at all possible.
 *   - the socket boundary will be reduced until
 *     allocation is possible or 0 is reached - at this
 *     point the algrithm will be disabled
 */
static int
move_fd(
	SOCKET fd
	)
{
#if !defined(SYS_WINNT) && defined(F_DUPFD)
#ifndef FD_CHUNK
#define FD_CHUNK	10
#endif
/*
 * number of fds we would like to have for
 * stdio FILE* available.
 * we can pick a "low" number as our use of
 * FILE* is limited to log files and temporarily
 * to data and config files. Except for log files
 * we don't keep the other FILE* open beyond the
 * scope of the function that opened it.
 */
#ifndef FD_PREFERRED_SOCKBOUNDARY
#define FD_PREFERRED_SOCKBOUNDARY 48
#endif

#ifndef HAVE_GETDTABLESIZE
/*
 * if we have no idea about the max fd value set up things
 * so we will start at FOPEN_MAX
 */
#define getdtablesize() (FOPEN_MAX+FD_CHUNK)
#endif

#ifndef FOPEN_MAX
#define FOPEN_MAX	20	/* assume that for the lack of anything better */
#endif
	static SOCKET socket_boundary = -1;
	SOCKET newfd;

	NTP_REQUIRE((int)fd >= 0);

	/*
	 * check whether boundary has be set up
	 * already
	 */
	if (socket_boundary == -1) {
		socket_boundary = max(0, min(getdtablesize() - FD_CHUNK, 
					     min(FOPEN_MAX, FD_PREFERRED_SOCKBOUNDARY)));
#ifdef DEBUG
		msyslog(LOG_DEBUG,
			"ntp_io: estimated max descriptors: %d, initial socket boundary: %d",
			getdtablesize(), socket_boundary);
#endif
	}

	/*
	 * Leave a space for stdio to work in. potentially moving the
	 * socket_boundary lower until allocation succeeds.
	 */
	do {
		if (fd >= 0 && fd < socket_boundary) {
			/* inside reserved range: attempt to move fd */
			newfd = fcntl(fd, F_DUPFD, socket_boundary);
			
			if (newfd != -1) {
				/* success: drop the old one - return the new one */
				close(fd);
				return newfd;
			}
		} else {
			/* outside reserved range: no work - return the original one */
			return fd;
		}
		socket_boundary = max(0, socket_boundary - FD_CHUNK);
#ifdef DEBUG
		msyslog(LOG_DEBUG,
			"ntp_io: selecting new socket boundary: %d",
			socket_boundary);
#endif
	} while (socket_boundary > 0);
#else
	NTP_REQUIRE((int)fd >= 0);
#endif /* !defined(SYS_WINNT) && defined(F_DUPFD) */
	return fd;
}

#ifdef DEBUG_TIMING
/*
 * collect timing information for various processing
 * paths. currently we only pass then on to the file
 * for later processing. this could also do histogram
 * based analysis in other to reduce the load (and skew)
 * dur to the file output
 */
void
collect_timing(struct recvbuf *rb, const char *tag, int count, l_fp *dts)
{
	char buf[256];

	snprintf(buf, sizeof(buf), "%s %d %s %s", 
		 (rb != NULL)
		     ? ((rb->dstadr != NULL)
			    ? stoa(&rb->recv_srcadr)
			    : "-REFCLOCK-")
		     : "-",
		 count, lfptoa(dts, 9), tag);
	record_timing_stats(buf);
}
#endif

/*
 * About dynamic interfaces, sockets, reception and more...
 *
 * the code solves following tasks:
 *
 *   - keep a current list of active interfaces in order
 *     to bind to to the interface address on NTP_PORT so that
 *     all wild and specific bindings for NTP_PORT are taken by ntpd
 *     to avoid other daemons messing with the time or sockets.
 *   - all interfaces keep a list of peers that are referencing 
 *     the interface in order to quickly re-assign the peers to
 *     new interface in case an interface is deleted (=> gone from system or
 *     down)
 *   - have a preconfigured socket ready with the right local address
 *     for transmission and reception
 *   - have an address list for all destination addresses used within ntpd
 *     to find the "right" preconfigured socket.
 *   - facilitate updating the internal interface list with respect to
 *     the current kernel state
 *
 * special issues:
 *
 *   - mapping of multicast addresses to the interface affected is not always
 *     one to one - especially on hosts with multiple interfaces
 *     the code here currently allocates a separate interface entry for those
 *     multicast addresses
 *     iff it is able to bind to a *new* socket with the multicast address (flags |= MCASTIF)
 *     in case of failure the multicast address is bound to an existing interface.
 *   - on some systems it is perfectly legal to assign the same address to
 *     multiple interfaces. Therefore this code does not keep a list of interfaces
 *     but a list of interfaces that represent a unique address as determined by the kernel
 *     by the procedure in findlocalinterface. Thus it is perfectly legal to see only
 *     one representative of a group of real interfaces if they share the same address.
 * 
 * Frank Kardel 20050910
 */

/*
 * init_io - initialize I/O data structures and call socket creation routine
 */
void
init_io(void)
{
	/*
	 * Init buffer free list and stat counters
	 */
	init_recvbuff(RECV_INIT);

#ifdef SYS_WINNT
	init_io_completion_port();
#endif /* SYS_WINNT */

#if defined(HAVE_SIGNALED_IO)
	(void) set_signal();
#endif
}


/*
 * io_open_sockets - call socket creation routine
 */
void
io_open_sockets(void)
{
	static int already_opened;

	if (already_opened || HAVE_OPT( SAVECONFIGQUIT ))
		return;

	already_opened = 1;

	/*
	 * Create the sockets
	 */
	BLOCKIO();
	create_sockets(NTP_PORT);
	UNBLOCKIO();

	init_async_notifications();

	DPRINTF(3, ("io_open_sockets: maxactivefd %d\n", maxactivefd));
}


#ifdef DEBUG
/*
 * function to dump the contents of the interface structure
 * for debugging use only.
 */
void
interface_dump(const endpt *itf)
{
	printf("Dumping interface: %p\n", itf);
	printf("fd = %d\n", itf->fd);
	printf("bfd = %d\n", itf->bfd);
	printf("sin = %s,\n", stoa(&itf->sin));
	sockaddr_dump(&itf->sin);
	printf("bcast = %s,\n", stoa(&itf->bcast));
	sockaddr_dump(&itf->bcast);
	printf("mask = %s,\n", stoa(&itf->mask));
	sockaddr_dump(&itf->mask);
	printf("name = %s\n", itf->name);
	printf("flags = 0x%08x\n", itf->flags);
	printf("last_ttl = %d\n", itf->last_ttl);
	printf("addr_refid = %08x\n", itf->addr_refid);
	printf("num_mcast = %d\n", itf->num_mcast);
	printf("received = %ld\n", itf->received);
	printf("sent = %ld\n", itf->sent);
	printf("notsent = %ld\n", itf->notsent);
	printf("ifindex = %u\n", itf->ifindex);
	printf("peercnt = %u\n", itf->peercnt);
	printf("phase = %u\n", itf->phase);
}

/*
 * sockaddr_dump - hex dump the start of a sockaddr_u
 */
static void
sockaddr_dump(const sockaddr_u *psau)
{
	/* Limit the size of the sockaddr_storage hex dump */
	const int maxsize = min(32, sizeof(psau->sa6));
	const u_char *	cp;
	int		i;

	cp = (const void *)&psau->sa;

	for(i = 0; i < maxsize; i++) {
		printf("%02x", *cp++);
		if (!((i + 1) % 4))
			printf(" ");
	}
	printf("\n");
}

/*
 * print_interface - helper to output debug information
 */
static void
print_interface(const endpt *iface, char *pfx, char *sfx)
{
	printf("%sinterface #%d: fd=%d, bfd=%d, name=%s, flags=0x%x, ifindex=%u, sin=%s",
	       pfx,
	       iface->ifnum,
	       iface->fd,
	       iface->bfd,
	       iface->name,
	       iface->flags,
	       iface->ifindex,
	       stoa(&iface->sin));
	if (AF_INET == iface->family) {
		if (iface->flags & INT_BROADCAST)
			printf(", bcast=%s", stoa(&iface->bcast));
		printf(", mask=%s", stoa(&iface->mask));
	}
	printf(", %s:%s",
	       (iface->ignore_packets) 
		   ? "Disabled"
		   : "Enabled",
	       sfx);
	if (debug > 4)	/* in-depth debugging only */
		interface_dump(iface);
}
#endif

#if !defined(HAVE_IO_COMPLETION_PORT) && defined(HAS_ROUTING_SOCKET)
/*
 * create an asyncio_reader structure
 */
static struct asyncio_reader *
new_asyncio_reader(void)
{
	struct asyncio_reader *reader;

	reader = emalloc(sizeof(*reader));

	memset(reader, 0, sizeof(*reader));
	reader->fd = INVALID_SOCKET;
	return reader;
}

/*
 * delete a reader
 */
static void
delete_asyncio_reader(
	struct asyncio_reader *reader
	)
{
	free(reader);
}

/*
 * add asynchio_reader
 */
static void
add_asyncio_reader(
	struct asyncio_reader *	reader, 
	enum desc_type		type)
{
	LINK_SLIST(asyncio_reader_list, reader, link);
	add_fd_to_list(reader->fd, type);
}
	
/*
 * remove asynchio_reader
 */
static void
remove_asyncio_reader(
	struct asyncio_reader *reader
	)
{
	struct asyncio_reader *unlinked;

	UNLINK_SLIST(unlinked, asyncio_reader_list, reader, link,
	    struct asyncio_reader);

	if (reader->fd != INVALID_SOCKET)
		close_and_delete_fd_from_list(reader->fd);

	reader->fd = INVALID_SOCKET;
}
#endif /* !defined(HAVE_IO_COMPLETION_PORT) && defined(HAS_ROUTING_SOCKET) */


/* compare two sockaddr prefixes */
static int
addr_eqprefix(
	const sockaddr_u *	a,
	const sockaddr_u *	b,
	int			prefixlen
	)
{
	isc_netaddr_t		isc_a;
	isc_netaddr_t		isc_b;
	isc_sockaddr_t		isc_sa;

	memset(&isc_sa, 0, sizeof(isc_sa));
	memcpy(&isc_sa.type.sa, &a->sa, 
	       min(sizeof(isc_sa.type), sizeof(*a)));
	isc_netaddr_fromsockaddr(&isc_a, &isc_sa);

	memset(&isc_sa, 0, sizeof(isc_sa));
	memcpy(&isc_sa.type.sa, &b->sa, 
	       min(sizeof(isc_sa.type), sizeof(*b)));
	isc_netaddr_fromsockaddr(&isc_b, &isc_sa);

	return (int)isc_netaddr_eqprefix(&isc_a, &isc_b,
					 (u_int)prefixlen);
}


static int
addr_samesubnet(
	const sockaddr_u *	a,
	const sockaddr_u *	a_mask,
	const sockaddr_u *	b,
	const sockaddr_u *	b_mask
	)
{
	const u_int32 *	pa;
	const u_int32 *	pa_limit;
	const u_int32 *	pb;
	const u_int32 *	pm;
	size_t		loops;

	NTP_REQUIRE(AF(a) == AF(a_mask));
	NTP_REQUIRE(AF(b) == AF(b_mask));
	/*
	 * With address and mask families verified to match, comparing
	 * the masks also validates the address's families match.
	 */
	if (!SOCK_EQ(a_mask, b_mask))
		return FALSE;

	if (IS_IPV6(a)) {
		loops = sizeof(NSRCADR6(a)) / sizeof(*pa);
		pa = (const void *)&NSRCADR6(a);
		pb = (const void *)&NSRCADR6(b);
		pm = (const void *)&NSRCADR6(a_mask);
	} else {
		loops = sizeof(NSRCADR(a)) / sizeof(*pa);
		pa = (const void *)&NSRCADR(a);
		pb = (const void *)&NSRCADR(b);
		pm = (const void *)&NSRCADR(a_mask);
	}
	for (pa_limit = pa + loops; pa < pa_limit; pa++, pb++, pm++)
		if ((*pa & *pm) != (*pb & *pm))
			return FALSE;

	return TRUE;
}


/*
 * Code to tell if we have an IP address
 * If we have then return the sockaddr structure
 * and set the return value
 * see the bind9/getaddresses.c for details
 */
int
is_ip_address(
	const char *	host,
	sockaddr_u *	addr
	)
{
	struct in_addr in4;
	struct in6_addr in6;
	char tmpbuf[128];
	char *pch;

	NTP_REQUIRE(host != NULL);
	NTP_REQUIRE(addr != NULL);

	memset(addr, 0, sizeof(*addr));

	/*
	 * Try IPv4, then IPv6.  In order to handle the extended format
	 * for IPv6 scoped addresses (address%scope_ID), we'll use a local
	 * working buffer of 128 bytes.  The length is an ad-hoc value, but
	 * should be enough for this purpose; the buffer can contain a string
	 * of at least 80 bytes for scope_ID in addition to any IPv6 numeric
	 * addresses (up to 46 bytes), the delimiter character and the
	 * terminating NULL character.
	 */
	if (inet_pton(AF_INET, host, &in4) == 1) {
		AF(addr) = AF_INET;
		SET_ADDR4N(addr, in4.s_addr);

		return TRUE;
	} else if (sizeof(tmpbuf) > strlen(host)) {
		if ('[' == host[0]) {
			strncpy(tmpbuf, &host[1], sizeof(tmpbuf));
			pch = strchr(tmpbuf, ']');
			if (pch != NULL)
				*pch = '\0';
		} else
			strncpy(tmpbuf, host, sizeof(tmpbuf));
		pch = strchr(tmpbuf, '%');
		if (pch != NULL)
			*pch = '\0';

		if (inet_pton(AF_INET6, tmpbuf, &in6) == 1) {
			AF(addr) = AF_INET6;
			SET_ADDR6N(addr, in6);

			return TRUE;
		}
	}
	/*
	 * If we got here it was not an IP address
	 */
	return FALSE;
}


/*
 * interface list enumerator - visitor pattern
 */
void
interface_enumerate(
	interface_receiver_t	receiver, 
	void *			data
	)
{
	interface_info_t ifi;

	ifi.action = IFS_EXISTS;
	for (ifi.ep = ep_list; ifi.ep != NULL; ifi.ep = ifi.ep->elink)
		(*receiver)(data, &ifi);
}

/*
 * do standard initialization of interface structure
 */
static void
init_interface(
	endpt *ep
	)
{
	memset(ep, 0, sizeof(*ep));
	ep->fd = INVALID_SOCKET;
	ep->bfd = INVALID_SOCKET;
	ep->phase = sys_interphase;
}


/*
 * create new interface structure initialize from
 * template structure or via standard initialization
 * function
 */
static struct interface *
new_interface(
	struct interface *interface
	)
{
	static u_int		sys_ifnum = 0;
	struct interface *	iface;

	iface = emalloc(sizeof(*iface));

	if (NULL == interface)
		init_interface(iface);
	else				/* use the template */
		memcpy(iface, interface, sizeof(*iface));

	/* count every new instance of an interface in the system */
	iface->ifnum = sys_ifnum++;
	iface->starttime = current_time;

	return iface;
}


/*
 * return interface storage into free memory pool
 */
static inline void
delete_interface(
	endpt *ep
	)
{
	free(ep);
}


/*
 * link interface into list of known interfaces
 */
static void
add_interface(
	endpt *	ep
	)
{
	endpt **	pmclisthead;
	endpt *		scan;
	endpt *		scan_next;
	endpt *		unlinked;
	sockaddr_u *	addr;
	int		ep_local;
	int		scan_local;
	int		same_subnet;
	int		ep_univ_iid;	/* iface ID from MAC address */
	int		scan_univ_iid;	/* see RFC 4291 */
	int		ep_privacy;	/* random local iface ID */
	int		scan_privacy;	/* see RFC 4941 */
	int		rc;

	/*
	 * Calculate the address hash
	 */
	ep->addr_refid = addr2refid(&ep->sin);

	LINK_SLIST(ep_list, ep, elink);
	ninterfaces++;
#ifdef MCAST
	/* the rest is for enabled multicast-capable addresses only */
	if (ep->ignore_packets || !(INT_MULTICAST & ep->flags) ||
	    INT_LOOPBACK & ep->flags)
		return;
# ifndef INCLUDE_IPV6_MULTICAST_SUPPORT
	if (AF_INET6 == ep->family)
		return;
# endif
	pmclisthead = (AF_INET == ep->family)
			 ? &mc4_list
			 : &mc6_list;

	if (AF_INET6 == ep->family) {
		ep_local =
		    IN6_IS_ADDR_LINKLOCAL(PSOCK_ADDR6(&ep->sin)) ||
		    IN6_IS_ADDR_SITELOCAL(PSOCK_ADDR6(&ep->sin));
		ep_univ_iid = IS_IID_UNIV(&ep->sin);
		ep_privacy = !!(INT_PRIVACY & ep->flags);
	} else {
		ep_local = FALSE;
		ep_univ_iid = FALSE;
		ep_privacy = FALSE;
	}
	DPRINTF(4, ("add_interface mcast-capable %s%s%s%s\n",
		    stoa(&ep->sin),
		    (ep_local) ? " link/scope-local" : "",
		    (ep_univ_iid) ? " univ-IID" : "",
		    (ep_privacy) ? " privacy" : ""));
	/*
	 * If we have multiple local addresses on the same network
	 * interface, and some are link- or site-local, do not multicast
	 * out from the link-/site-local addresses by default, to avoid
	 * duplicate manycastclient associations between v6 peers using
	 * link-local and global addresses.  link-local can still be
	 * chosen using "nic ignore myv6globalprefix::/64".
	 * Similarly, if we have multiple global addresses from the same
	 * prefix on the same network interface, multicast from one,
	 * preferring EUI-64, then static, then least RFC 4941 privacy
	 * addresses.
	 */
	for (scan = *pmclisthead; scan != NULL; scan = scan_next) {
		scan_next = scan->mclink;
		if (ep->family != scan->family)
			continue;
		if (strcmp(ep->name, scan->name))
			continue;
		same_subnet = addr_samesubnet(&ep->sin, &ep->mask,
					      &scan->sin, &scan->mask);
		if (AF_INET6 == ep->family) {
			addr = &scan->sin;
			scan_local =
			    IN6_IS_ADDR_LINKLOCAL(PSOCK_ADDR6(addr)) ||
			    IN6_IS_ADDR_SITELOCAL(PSOCK_ADDR6(addr));
			scan_univ_iid = IS_IID_UNIV(addr);
			scan_privacy = !!(INT_PRIVACY & scan->flags);
		} else {
			scan_local = FALSE;
			scan_univ_iid = FALSE;
			scan_privacy = FALSE;
		}
		DPRINTF(4, ("add_interface mcast-capable scan %s%s%s%s\n",
			    stoa(&scan->sin),
			    (scan_local) ? " link/scope-local" : "",
			    (scan_univ_iid) ? " univ-IID" : "",
			    (scan_privacy) ? " privacy" : ""));
		if ((ep_local && !scan_local) || (same_subnet && 
		    ((ep_privacy && !scan_privacy) ||
		     (!ep_univ_iid && scan_univ_iid)))) {
			DPRINTF(4, ("did not add %s to %s of IPv6 multicast-capable list which already has %s\n",
				stoa(&ep->sin),
				(ep_local)
				    ? "tail"
				    : "head",
				stoa(&scan->sin)));
			return;
		}
		if ((scan_local && !ep_local) || (same_subnet &&
		    ((scan_privacy && !ep_privacy) ||
		     (!scan_univ_iid && ep_univ_iid)))) {
			UNLINK_SLIST(unlinked, *pmclisthead,
				     scan, mclink, endpt);
			DPRINTF(4, ("%s %s from IPv6 multicast-capable list to add %s\n",
				(unlinked != scan)
				    ? "Failed to remove"
				    : "removed",
				stoa(&scan->sin), stoa(&ep->sin)));
		}
	}
	/*
	 * Add link/site local at the tail of the multicast-
	 * capable unicast interfaces list, so that ntpd will
	 * send from global addresses before link-/site-local
	 * ones.
	 */
	if (ep_local)
		LINK_TAIL_SLIST(*pmclisthead, ep, mclink, endpt);
	else
		LINK_SLIST(*pmclisthead, ep, mclink);
	DPRINTF(4, ("added %s to %s of IPv%s multicast-capable unicast local address list\n",
		stoa(&ep->sin),
		(ep_local)
		    ? "tail"
		    : "head",
		(AF_INET == ep->family)
		    ? "4"
		    : "6"));

	/*
	 * select the local address from which to send to multicast.
	 */
	switch (AF(&ep->sin)) {
	case AF_INET :
		rc = setsockopt(ep->fd, IPPROTO_IP,
				IP_MULTICAST_IF,
				(void *)&NSRCADR(&ep->sin),
				sizeof(NSRCADR(&ep->sin)));
		if (rc)
			msyslog(LOG_ERR,
				"setsockopt IP_MULTICAST_IF %s fails: %m",
				stoa(&ep->sin));
		break;
# ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
	case AF_INET6 :
		rc = setsockopt(ep->fd, IPPROTO_IPV6,
				 IPV6_MULTICAST_IF,
				 (void *)&ep->ifindex,
				 sizeof(ep->ifindex));
		if (rc)
			msyslog(LOG_ERR,
				"setsockopt IPV6_MULTICAST_IF %u for %s fails: %m",
				ep->ifindex, stoa(&ep->sin));
		break;
# endif
	}
#endif	/* MCAST */
}


/*
 * remove interface from known interface list and clean up
 * associated resources
 */
static void
remove_interface(
	endpt *	ep
	)
{
	endpt *		unlinked;
	endpt **	pmclisthead;
	sockaddr_u	resmask;

	UNLINK_SLIST(unlinked, ep_list, ep, elink, endpt);
	if (!ep->ignore_packets && INT_MULTICAST & ep->flags) {
		pmclisthead = (AF_INET == ep->family)
				 ? &mc4_list
				 : &mc6_list;
		UNLINK_SLIST(unlinked, *pmclisthead, ep, mclink, endpt);
		DPRINTF(4, ("%s %s IPv%s multicast-capable unicast local address list\n",
			stoa(&ep->sin),
			(unlinked != NULL)
			    ? "removed from"
			    : "not found on",
			(AF_INET == ep->family)
			    ? "4"
			    : "6"));
	}
	delete_interface_from_list(ep);
  
	if (ep->fd != INVALID_SOCKET) {
		msyslog(LOG_INFO,
			"Deleting interface #%d %s, %s#%d, interface stats: received=%ld, sent=%ld, dropped=%ld, active_time=%ld secs",
			ep->ifnum,
			ep->name,
			stoa(&ep->sin),
			SRCPORT(&ep->sin),
			ep->received,
			ep->sent,
			ep->notsent,
			current_time - ep->starttime);
		close_and_delete_fd_from_list(ep->fd);
	}

	if (ep->bfd != INVALID_SOCKET) {
		msyslog(LOG_INFO,
			"Deleting broadcast address %s#%d from interface #%d %s",
			stoa(&ep->bcast), SRCPORT(&ep->bcast),
			ep->ifnum, ep->name);
		close_and_delete_fd_from_list(ep->bfd);
	}

	ninterfaces--;
	ntp_monclearinterface(ep);

	/* remove restrict interface entry */
	SET_HOSTMASK(&resmask, AF(&ep->sin));
	hack_restrict(RESTRICT_REMOVEIF, &ep->sin, &resmask,
		      RESM_NTPONLY | RESM_INTERFACE, RES_IGNORE);
}


static void
log_listen_address(
	endpt *	ep
	)
{
	msyslog(LOG_INFO, "%s on %d %s %s UDP %d",
		(ep->ignore_packets) 
		    ? "Listen and drop"
		    : "Listen normally",
		ep->ifnum,
		ep->name,
		stoa(&ep->sin),
		SRCPORT(&ep->sin));
}


static void
create_wildcards(
	u_short	port
	)
{
	int			v4wild, v6wild;
	sockaddr_u		wildaddr;
	nic_rule_action		action;
	struct interface *	wildif;

	/*
	 * silence "potentially uninitialized" warnings from VC9
	 * failing to follow the logic.  Ideally action could remain
	 * uninitialized, and the memset be the first statement under
	 * the first if (v4wild).
	 */
	action = ACTION_LISTEN;
	memset(&wildaddr, 0, sizeof(wildaddr));
	
	/*
	 * create pseudo-interface with wildcard IPv4 address
	 */
	v4wild = ipv4_works;
	if (v4wild) {
		/* set wildaddr to the v4 wildcard address 0.0.0.0 */
		AF(&wildaddr) = AF_INET;
		SET_ADDR4(&wildaddr, INADDR_ANY);
		SET_PORT(&wildaddr, port);

		/* check for interface/nic rules affecting the wildcard */
		action = interface_action(NULL, &wildaddr, 0);
		v4wild = (ACTION_IGNORE != action);
	}
	if (v4wild) {
		wildif = new_interface(NULL);

		strncpy(wildif->name, "v4wildcard", sizeof(wildif->name));
		memcpy(&wildif->sin, &wildaddr, sizeof(wildif->sin));
		wildif->family = AF_INET;
		AF(&wildif->mask) = AF_INET;
		SET_ONESMASK(&wildif->mask);

		wildif->flags = INT_BROADCAST | INT_UP | INT_WILDCARD;
		wildif->ignore_packets = (ACTION_DROP == action);
#if defined(MCAST)
		/*
		 * enable multicast reception on the broadcast socket
		 */
		AF(&wildif->bcast) = AF_INET;
		SET_ADDR4(&wildif->bcast, INADDR_ANY);
		SET_PORT(&wildif->bcast, port);
#endif /* MCAST */
		wildif->fd = open_socket(&wildif->sin, 0, 1, wildif);

		if (wildif->fd != INVALID_SOCKET) {
			wildipv4 = wildif;
			any_interface = wildif;
			
			add_addr_to_list(&wildif->sin, wildif);
			add_interface(wildif);
			log_listen_address(wildif);
		} else {
			msyslog(LOG_ERR, 
				"unable to bind to wildcard address %s - another process may be running - EXITING",
				stoa(&wildif->sin));
			exit(1);
		}
		DPRINT_INTERFACE(2, (wildif, "created ", "\n"));
	}

#ifdef INCLUDE_IPV6_SUPPORT
	/*
	 * create pseudo-interface with wildcard IPv6 address
	 */
	v6wild = ipv6_works;
	if (v6wild) {
		/* set wildaddr to the v6 wildcard address :: */
		memset(&wildaddr, 0, sizeof(wildaddr));
		AF(&wildaddr) = AF_INET6;
		SET_ADDR6N(&wildaddr, in6addr_any);
		SET_PORT(&wildaddr, port);
		SET_SCOPE(&wildaddr, 0);

		/* check for interface/nic rules affecting the wildcard */
		action = interface_action(NULL, &wildaddr, 0);
		v6wild = (ACTION_IGNORE != action);
	}
	if (v6wild) {
		wildif = new_interface(NULL);

		strncpy(wildif->name, "v6wildcard", sizeof(wildif->name));
		memcpy(&wildif->sin, &wildaddr, sizeof(wildif->sin));
		wildif->family = AF_INET6;
		AF(&wildif->mask) = AF_INET6;
		SET_ONESMASK(&wildif->mask);

		wildif->flags = INT_UP | INT_WILDCARD;
		wildif->ignore_packets = (ACTION_DROP == action);

		wildif->fd = open_socket(&wildif->sin, 0, 1, wildif);

		if (wildif->fd != INVALID_SOCKET) {
			wildipv6 = wildif;
			any6_interface = wildif;
			add_addr_to_list(&wildif->sin, wildif);
			add_interface(wildif);
			log_listen_address(wildif);
		} else {
			msyslog(LOG_ERR,
				"unable to bind to wildcard address %s - another process may be running - EXITING",
				stoa(&wildif->sin));
			exit(1);
		}
		DPRINT_INTERFACE(2, (wildif, "created ", "\n"));
	}
#endif
}


/*
 * add_nic_rule() -- insert a rule entry at the head of nic_rule_list.
 */
void
add_nic_rule(
	nic_rule_match	match_type,
	const char *	if_name,	/* interface name or numeric address */
	int		prefixlen,
	nic_rule_action	action
	)
{
	nic_rule *	rule;
	isc_boolean_t	is_ip;

	rule = emalloc(sizeof(*rule));
	memset(rule, 0, sizeof(*rule));
	rule->match_type = match_type;
	rule->prefixlen = prefixlen;
	rule->action = action;
	
	if (MATCH_IFNAME == match_type) {
		NTP_REQUIRE(NULL != if_name);
		rule->if_name = estrdup(if_name);
	} else if (MATCH_IFADDR == match_type) {
		NTP_REQUIRE(NULL != if_name);
		/* set rule->addr */
		is_ip = is_ip_address(if_name, &rule->addr);
		NTP_REQUIRE(is_ip);
	} else
		NTP_REQUIRE(NULL == if_name);

	LINK_SLIST(nic_rule_list, rule, next);
}


#ifdef DEBUG
static const char *
action_text(
	nic_rule_action	action
	)
{
	const char *t;

	switch (action) {

	default:
		t = "ERROR";	/* quiet uninit warning */
		DPRINTF(1, ("fatal: unknown nic_rule_action %d\n",
			    action));
		NTP_ENSURE(0);
		break;

	case ACTION_LISTEN:
		t = "listen";
		break;

	case ACTION_IGNORE:
		t = "ignore";
		break;

	case ACTION_DROP:
		t = "drop";
		break;
	}

	return t;
}
#endif	/* DEBUG */


static nic_rule_action
interface_action(
	char *		if_name,
	sockaddr_u *	if_addr,
	u_int32		if_flags
	)
{
	nic_rule *	rule;
	int		isloopback;
	int		iswildcard;

	DPRINTF(4, ("interface_action: %s %s ",
		    (if_name != NULL)
			? if_name
			: "wildcard",
		    stoa(if_addr)));

	iswildcard = is_wildcard_addr(if_addr);

	/*
	 * Always listen on 127.0.0.1 - required by ntp_intres
	 */
	if (INT_LOOPBACK & if_flags) {
		isloopback = TRUE;
		if (IS_IPV4(if_addr)) {
			DPRINTF(4, ("IPv4 loopback - listen\n"));
			return ACTION_LISTEN;
		}
	} else {
		isloopback = FALSE;
	}

	/*
	 * Find any matching NIC rule from --interface / -I or ntp.conf
	 * interface/nic rules.
	 */
	for (rule = nic_rule_list; rule != NULL; rule = rule->next) {

		switch (rule->match_type) {

		case MATCH_ALL:
			/* loopback and wildcard excluded from "all" */
			if (isloopback || iswildcard)
				break;
			DPRINTF(4, ("nic all %s\n",
			    action_text(rule->action)));
			return rule->action;

		case MATCH_IPV4:
			if (IS_IPV4(if_addr)) {
				DPRINTF(4, ("nic ipv4 %s\n",
				    action_text(rule->action)));
				return rule->action;
			}
			break;

		case MATCH_IPV6:
			if (IS_IPV6(if_addr)) {
				DPRINTF(4, ("nic ipv6 %s\n",
				    action_text(rule->action)));
				return rule->action;
			}
			break;

		case MATCH_WILDCARD:
			if (iswildcard) {
				DPRINTF(4, ("nic wildcard %s\n",
				    action_text(rule->action)));
				return rule->action;
			}
			break;

		case MATCH_IFADDR:
			if (rule->prefixlen != -1) {
				if (addr_eqprefix(if_addr, &rule->addr,
						  rule->prefixlen)) {

					DPRINTF(4, ("subnet address match - %s\n",
					    action_text(rule->action)));
					return rule->action;
				}
			} else
				if (SOCK_EQ(if_addr, &rule->addr)) {

					DPRINTF(4, ("address match - %s\n",
					    action_text(rule->action)));
					return rule->action;
				}
			break;

		case MATCH_IFNAME:
			if (if_name != NULL
			    && !strcasecmp(if_name, rule->if_name)) {

				DPRINTF(4, ("interface name match - %s\n",
				    action_text(rule->action)));
				return rule->action;
			}
			break;
		}
	}

	/*
	 * Unless explicitly disabled such as with "nic ignore ::1"
	 * listen on loopback addresses.  Since ntpq and ntpdc query
	 * "localhost" by default, which typically resolves to ::1 and
	 * 127.0.0.1, it's useful to default to listening on both.
	 */
	if (isloopback) {
		DPRINTF(4, ("default loopback listen\n"));
		return ACTION_LISTEN;
	}

	/*
	 * Treat wildcard addresses specially.  If there is no explicit
	 * "nic ... wildcard" or "nic ... 0.0.0.0" or "nic ... ::" rule
	 * default to drop.
	 */
	if (iswildcard) {
		DPRINTF(4, ("default wildcard drop\n"));
		return ACTION_DROP;
	}

	/*
	 * Check for "virtual IP" (colon in the interface name) after
	 * the rules so that "ntpd --interface eth0:1 -novirtualips"
	 * does indeed listen on eth0:1's addresses.
	 */
	if (!listen_to_virtual_ips && if_name != NULL
	    && (strchr(if_name, ':') != NULL)) {

		DPRINTF(4, ("virtual ip - ignore\n"));
		return ACTION_IGNORE;
	}

	/*
	 * If there are no --interface/-I command-line options and no
	 * interface/nic rules in ntp.conf, the default action is to
	 * listen.  In the presence of rules from either, the default
	 * is to ignore.  This implements ntpd's traditional listen-
	 * every default with no interface listen configuration, and
	 * ensures a single -I eth0 or "nic listen eth0" means do not
	 * listen on any other addresses.
	 */
	if (NULL == nic_rule_list) {
		DPRINTF(4, ("default listen\n"));
		return ACTION_LISTEN;
	}

	DPRINTF(4, ("implicit ignore\n"));
	return ACTION_IGNORE;
}


static void
convert_isc_if(
	isc_interface_t *isc_if,
	endpt *itf,
	u_short port
	)
{
	const u_char v6loop[16] = {0, 0, 0, 0, 0, 0, 0, 0,
				   0, 0, 0, 0, 0, 0, 0, 1};

	strncpy(itf->name, isc_if->name, sizeof(itf->name));
	itf->name[sizeof(itf->name) - 1] = 0; /* strncpy may not */
	itf->ifindex = isc_if->ifindex;
	itf->family = (u_short)isc_if->af;
	AF(&itf->sin) = itf->family;
	AF(&itf->mask) = itf->family;
	AF(&itf->bcast) = itf->family;
	SET_PORT(&itf->sin, port);
	SET_PORT(&itf->mask, port);
	SET_PORT(&itf->bcast, port);

	if (IS_IPV4(&itf->sin)) {
		NSRCADR(&itf->sin) = isc_if->address.type.in.s_addr;
		NSRCADR(&itf->mask) = isc_if->netmask.type.in.s_addr;

		if (isc_if->flags & INTERFACE_F_BROADCAST) {
			itf->flags |= INT_BROADCAST;
			NSRCADR(&itf->bcast) = 
			    isc_if->broadcast.type.in.s_addr;
		}
	}
#ifdef INCLUDE_IPV6_SUPPORT
	else if (IS_IPV6(&itf->sin)) {
		SET_ADDR6N(&itf->sin, isc_if->address.type.in6);
		SET_ADDR6N(&itf->mask, isc_if->netmask.type.in6);

		SET_SCOPE(&itf->sin, isc_if->address.zone);
	}
#endif /* INCLUDE_IPV6_SUPPORT */


	/* Process the rest of the flags */

	itf->flags |=
		  ((INTERFACE_F_UP & isc_if->flags)
			? INT_UP : 0)
		| ((INTERFACE_F_LOOPBACK & isc_if->flags) 
			? INT_LOOPBACK : 0)
		| ((INTERFACE_F_POINTTOPOINT & isc_if->flags) 
			? INT_PPP : 0)
		| ((INTERFACE_F_MULTICAST & isc_if->flags) 
			? INT_MULTICAST : 0)
		| ((INTERFACE_F_PRIVACY & isc_if->flags)
			? INT_PRIVACY : 0)
		;

	/*
	 * Clear the loopback flag if the address is not localhost.
	 * http://bugs.ntp.org/1683
	 */
	if (INT_LOOPBACK & itf->flags) {
		if (AF_INET == itf->family) {
			if (127 != (SRCADR(&itf->sin) >> 24))
				itf->flags &= ~INT_LOOPBACK;
		} else {
			if (memcmp(v6loop, NSRCADR6(&itf->sin),
				   sizeof(NSRCADR6(&itf->sin))))
				itf->flags &= ~INT_LOOPBACK;
		}
	}
}


/*
 * refresh_interface
 *
 * some OSes have been observed to keep
 * cached routes even when more specific routes
 * become available.
 * this can be mitigated by re-binding
 * the socket.
 */
static int
refresh_interface(
	struct interface * interface
	)
{
#ifdef  OS_MISSES_SPECIFIC_ROUTE_UPDATES
	if (interface->fd != INVALID_SOCKET) {
		close_and_delete_fd_from_list(interface->fd);
		interface->fd = open_socket(&interface->sin,
					    0, 0, interface);
		 /*
		  * reset TTL indication so TTL is is set again 
		  * next time around
		  */
		interface->last_ttl = 0;
		return (interface->fd != INVALID_SOCKET);
	} else
		return 0;	/* invalid sockets are not refreshable */
#else /* !OS_MISSES_SPECIFIC_ROUTE_UPDATES */
	return (interface->fd != INVALID_SOCKET);
#endif /* !OS_MISSES_SPECIFIC_ROUTE_UPDATES */
}

/*
 * interface_update - externally callable update function
 */
void
interface_update(
	interface_receiver_t	receiver,
	void *			data)
{
	int new_interface_found;

	if (disable_dynamic_updates)
		return;

	BLOCKIO();
	new_interface_found = update_interfaces(NTP_PORT, receiver, data);
	UNBLOCKIO();

	if (!new_interface_found)
		return;

#ifdef DEBUG
	msyslog(LOG_DEBUG, "new interface(s) found: waking up resolver");
#endif
#ifdef SYS_WINNT
	/* wake up the resolver thread */
	if (ResolverEventHandle != NULL)
		SetEvent(ResolverEventHandle);
#else
	/* write any single byte to the pipe to wake up the resolver process */
	write( resolver_pipe_fd[1], &new_interface_found, 1 );
#endif
}


/*
 * sau_from_netaddr() - convert network address on-wire formats.
 * Convert from libisc's isc_netaddr_t to NTP's sockaddr_u
 */
void
sau_from_netaddr(
	sockaddr_u *psau,
	const isc_netaddr_t *pna
	)
{
	memset(psau, 0, sizeof(*psau));
	AF(psau) = (u_short)pna->family;
	switch (pna->family) {

	case AF_INET:
		memcpy(&psau->sa4.sin_addr, &pna->type.in,
		       sizeof(psau->sa4.sin_addr));
		break;

	case AF_INET6:
		memcpy(&psau->sa6.sin6_addr, &pna->type.in6,
		       sizeof(psau->sa6.sin6_addr));
		break;
	}
}


static int
is_wildcard_addr(
	const sockaddr_u *psau
	)
{
	if (IS_IPV4(psau) && !NSRCADR(psau))
		return 1;

#ifdef INCLUDE_IPV6_SUPPORT
	if (IS_IPV6(psau) && S_ADDR6_EQ(psau, &in6addr_any))
		return 1;
#endif

	return 0;
}


#ifdef OS_NEEDS_REUSEADDR_FOR_IFADDRBIND
/*
 * enable/disable re-use of wildcard address socket
 */
static void
set_wildcard_reuse(
	u_short	family,
	int	on
	)
{
	struct interface *any;
	SOCKET fd = INVALID_SOCKET;

	any = ANY_INTERFACE_BYFAM(family);
	if (any != NULL)
		fd = any->fd;

	if (fd != INVALID_SOCKET) {
		if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
			       (char *)&on, sizeof(on)))
			msyslog(LOG_ERR,
				"set_wildcard_reuse: setsockopt(SO_REUSEADDR, %s) failed: %m",
				on ? "on" : "off");

		DPRINTF(4, ("set SO_REUSEADDR to %s on %s\n", 
			    on ? "on" : "off",
			    stoa(&any->sin)));
	}
}
#endif /* OS_NEEDS_REUSEADDR_FOR_IFADDRBIND */


static isc_boolean_t
is_anycast(
	sockaddr_u *psau,
	const char *name
	)
{
#if defined(INCLUDE_IPV6_SUPPORT) && defined(SIOCGIFAFLAG_IN6) && \
    defined(IN6_IFF_ANYCAST)
	struct in6_ifreq ifr6;
	int fd;
	u_int32 flags6;

	if (psau->sa.sa_family != AF_INET6)
		return ISC_FALSE;
	if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
		return ISC_FALSE;
	memset(&ifr6, 0, sizeof(ifr6));
	memcpy(&ifr6.ifr_addr, &psau->sa6, sizeof(ifr6.ifr_addr));
	strncpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name));
	if (ioctl(fd, SIOCGIFAFLAG_IN6, &ifr6) < 0) {
		close(fd);
		return ISC_FALSE;
	}
	close(fd);
	flags6 = ifr6.ifr_ifru.ifru_flags6;
	if ((flags6 & IN6_IFF_ANYCAST) != 0)
		return ISC_TRUE;
#endif	/* INCLUDE_IPV6_SUPPORT && SIOCGIFAFLAG_IN6 && IN6_IFF_ANYCAST */
	return ISC_FALSE;
}


/*
 * update_interface strategy
 *
 * toggle configuration phase
 *
 * Phase 1:
 * forall currently existing interfaces
 *   if address is known:
 *	drop socket - rebind again
 *
 *   if address is NOT known:
 *	attempt to create a new interface entry
 *
 * Phase 2:
 * forall currently known non MCAST and WILDCARD interfaces
 *   if interface does not match configuration phase (not seen in phase 1):
 *	remove interface from known interface list
 *	forall peers associated with this interface
 *         disconnect peer from this interface
 *
 * Phase 3:
 *   attempt to re-assign interfaces to peers
 *
 */

static int
update_interfaces(
	u_short			port,
	interface_receiver_t	receiver,
	void *			data
	)
{
	isc_mem_t *		mctx = (void *)-1;
	interface_info_t	ifi;
	isc_interfaceiter_t *	iter;
	isc_result_t		result;
	isc_interface_t		isc_if;
	int			new_interface_found;
	int			refresh_peers;
	unsigned int		family;
	endpt			enumep;
	endpt *			ep;
	endpt *			next_ep;

	DPRINTF(3, ("update_interfaces(%d)\n", port));

	/*
	 * phase one - scan interfaces
	 * - create those that are not found
	 * - update those that are found
	 */

	new_interface_found = FALSE;
	refresh_peers = FALSE;
	iter = NULL;
	result = isc_interfaceiter_create(mctx, &iter);

	if (result != ISC_R_SUCCESS)
		return 0;

	/* 
	 * Toggle system interface scan phase to find untouched
	 * interfaces to be deleted.
	 */
	sys_interphase ^= 0x1;
	
	for (result = isc_interfaceiter_first(iter);
	     ISC_R_SUCCESS == result;
	     result = isc_interfaceiter_next(iter)) {

		result = isc_interfaceiter_current(iter, &isc_if);

		if (result != ISC_R_SUCCESS)
			break;

		/* See if we have a valid family to use */
		family = isc_if.address.family;
		if (AF_INET != family && AF_INET6 != family)
			continue;
		if (AF_INET == family && !ipv4_works)
			continue;
		if (AF_INET6 == family && !ipv6_works)
			continue;

		/* create prototype */
		init_interface(&enumep);

		convert_isc_if(&isc_if, &enumep, port);

		/* 
		 * Check if and how we are going to use the interface.
		 */
		switch (interface_action(enumep.name, &enumep.sin,
					 enumep.flags)) {

		case ACTION_IGNORE:
			continue;

		case ACTION_LISTEN:
			enumep.ignore_packets = ISC_FALSE;
			break;

		case ACTION_DROP:
			enumep.ignore_packets = ISC_TRUE;
			break;
		}

		DPRINT_INTERFACE(4, (&enumep, "examining ", "\n"));

		 /* interfaces must be UP to be usable */
		if (!(enumep.flags & INT_UP)) {
			DPRINTF(4, ("skipping interface %s (%s) - DOWN\n",
				    enumep.name, stoa(&enumep.sin)));
			continue;
		}

		/*
		 * skip any interfaces UP and bound to a wildcard
		 * address - some dhcp clients produce that in the
		 * wild
		 */
		if (is_wildcard_addr(&enumep.sin))
			continue;

		if (is_anycast(&enumep.sin, isc_if.name))
			continue;

		/*
		 * map to local *address* in order to map all duplicate
		 * interfaces to an endpt structure with the appropriate
		 * socket.  Our name space is (ip-address), NOT
		 * (interface name, ip-address).
		 */
		ep = getinterface(&enumep.sin, INT_WILDCARD);
		
		if (ep != NULL && refresh_interface(ep)) {
			/*
			 * found existing and up to date interface -
			 * mark present.
			 */
			if (ep->phase != sys_interphase) {
				/*
				 * On a new round we reset the name so
				 * the interface name shows up again if
				 * this address is no longer shared.
				 * We reset ignore_packets from the
				 * new prototype to respect any runtime
				 * changes to the nic rules.
				 */
				strncpy(ep->name, enumep.name,
					sizeof(ep->name));
				if (ep->ignore_packets !=
				    enumep.ignore_packets) {
					ep->ignore_packets = 
					    enumep.ignore_packets;
					refresh_peers = TRUE;
					DPRINTF(4, ("refreshing peers due to %s ignore_packets change to %d\n",
					    stoa(&ep->sin),
					    ep->ignore_packets));
				}
			} else {
				/* name collision - rename interface */
				strncpy(ep->name, "*multiple*",
					sizeof(ep->name));
			}

			DPRINT_INTERFACE(4, (ep, "updating ", 
					     " present\n"));

			if (ep->ignore_packets !=
			    enumep.ignore_packets) {
				/*
				 * We have conflicting configurations
				 * for the interface address. This is
				 * caused by using -I 
				 * for an interface that shares its 
				 * address with other interfaces. We
				 * can not disambiguate incoming
				 * packets delivered to this socket
				 * without extra syscalls/features.
				 * These are not (commonly) available.
				 * Note this is a more unusual
				 * configuration where several
				 * interfaces share an address but
				 * filtering via interface name is
				 * attempted.  We resolve the
				 * configuration conflict by disabling
				 * the processing of received packets.
				 * This leads to no service on the
				 * interface address where the conflict
				 * occurs.
				 */
				msyslog(LOG_ERR,
					"WARNING: conflicting enable configuration for interfaces %s and %s for address %s - unsupported configuration - address DISABLED",
					enumep.name, ep->name,
					stoa(&enumep.sin));

				ep->ignore_packets = ISC_TRUE;				
			}

			ep->phase = sys_interphase;

			ifi.action = IFS_EXISTS;
			ifi.ep = ep;
			if (receiver != NULL)
				(*receiver)(data, &ifi);
		} else {
			/*
			 * This is new or refreshing failed - add to
			 * our interface list.  If refreshing failed we
			 * will delete the interface structure in phase
			 * 2 as the interface was not marked current.
			 * We can bind to the address as the refresh
			 * code already closed the offending socket
			 */
			ep = create_interface(port, &enumep);

			if (ep != NULL) {
				ifi.action = IFS_CREATED;
				ifi.ep = ep;
				if (receiver != NULL)
					(*receiver)(data, &ifi);

				new_interface_found = TRUE;
				refresh_peers = TRUE;
				DPRINTF(4, ("refreshing peers due to new addr %s\n",
					stoa(&ep->sin)));
				DPRINT_INTERFACE(3,
					(ep, "updating ",
					 " new - created\n"));
			} else {
				DPRINT_INTERFACE(3, 
					(&enumep, "updating ",
					 " new - creation FAILED"));
			
				msyslog(LOG_INFO,
					"failed to init interface for address %s", 
					stoa(&enumep.sin));
				continue;
			}
		}
	}

	isc_interfaceiter_destroy(&iter);

	/*
	 * phase 2 - delete gone interfaces - reassigning peers to
	 * other interfaces
	 */
	for (ep = ep_list; ep != NULL; ep = next_ep) {
		next_ep = ep->elink;
		  
		/*
		 * if phase does not match sys_phase this interface was
		 * not enumerated during the last interface scan - so it
		 * is gone and will be deleted here unless it did not
		 * originate from interface enumeration (INT_WILDCARD,
		 * INT_MCASTIF).
		 */
		if (((INT_WILDCARD | INT_MCASTIF) & ep->flags) ||
		    ep->phase == sys_interphase)
			continue;

		DPRINT_INTERFACE(3, (ep, "updating ",
				     "GONE - deleting\n"));
		remove_interface(ep);
		refresh_peers = TRUE;
		DPRINTF(4, ("refreshing peers due to deleted addr %s",
			    stoa(&ep->sin)));

		ifi.action = IFS_DELETED;
		ifi.ep = ep;
		if (receiver != NULL)
			(*receiver)(data, &ifi);

		/* disconnect peers from deleted endpt. */
		while (ep->peers != NULL)
			set_peerdstadr(ep->peers, NULL);

		/*
		 * update globals in case we lose 
		 * a loopback interface
		 */
		if (ep == loopback_interface)
			loopback_interface = NULL;

		delete_interface(ep);
	}

	/*
	 * phase 3 - re-configure as the world has changed if necessary
	 */
	if (refresh_peers) {
		refresh_all_peerinterfaces();
		msyslog(LOG_INFO, "peers refreshed");
	}

	return new_interface_found;
}


/*
 * create_sockets - create a socket for each interface plus a default
 *			socket for when we don't know where to send
 */
static int
create_sockets(
	u_short port
	)
{
#ifndef HAVE_IO_COMPLETION_PORT
	/*
	 * I/O Completion Ports don't care about the select and FD_SET
	 */
	maxactivefd = 0;
	FD_ZERO(&activefds);
#endif

	DPRINTF(2, ("create_sockets(%d)\n", port));

	create_wildcards(port);

	update_interfaces(port, NULL, NULL);
	
	/*
	 * Now that we have opened all the sockets, turn off the reuse
	 * flag for security.
	 */
	set_reuseaddr(0);

	DPRINTF(2, ("create_sockets: Total interfaces = %d\n", ninterfaces));

	return ninterfaces;
}

/*
 * create_interface - create a new interface for a given prototype
 *		      binding the socket.
 */
static struct interface *
create_interface(
	u_short			port,
	struct interface *	protot
	)
{
	sockaddr_u	resmask;
	endpt *		iface;
#if defined(MCAST) && defined(MULTICAST_NONEWSOCKET)
	remaddr_t *	entry;
	remaddr_t *	next_entry;
#endif
	DPRINTF(2, ("create_interface(%s#%d)\n", stoa(&protot->sin),
		    port));

	/* build an interface */
	iface = new_interface(protot);
	
	/*
	 * create socket
	 */
	iface->fd = open_socket(&iface->sin, 0, 0, iface);

	if (iface->fd != INVALID_SOCKET)
		log_listen_address(iface);

	if ((INT_BROADCAST & iface->flags)
	    && iface->bfd != INVALID_SOCKET)
		msyslog(LOG_INFO, "Listening on broadcast address %s#%d",
			stoa((&iface->bcast)), port);

	if (INVALID_SOCKET == iface->fd
	    && INVALID_SOCKET == iface->bfd) {
		msyslog(LOG_ERR, "unable to create socket on %s (%d) for %s#%d",
			iface->name,
			iface->ifnum,
			stoa((&iface->sin)),
			port);
		delete_interface(iface);
		return NULL;
	}
	
	/*
	 * Blacklist our own addresses, no use talking to ourself
	 */
	SET_HOSTMASK(&resmask, AF(&iface->sin));
	hack_restrict(RESTRICT_FLAGS, &iface->sin, &resmask,
		      RESM_NTPONLY | RESM_INTERFACE, RES_IGNORE);
	  
	/*
	 * set globals with the first found
	 * loopback interface of the appropriate class
	 */
	if (NULL == loopback_interface && AF_INET == iface->family
	    && (INT_LOOPBACK & iface->flags))
		loopback_interface = iface;

	/*
	 * put into our interface list
	 */
	add_addr_to_list(&iface->sin, iface);
	add_interface(iface);

#if defined(MCAST) && defined(MULTICAST_NONEWSOCKET)
	/*
	 * Join any previously-configured compatible multicast groups.
	 */
	if (INT_MULTICAST & iface->flags &&
	    !((INT_LOOPBACK | INT_WILDCARD) & iface->flags) &&
	    !iface->ignore_packets) {
		for (entry = remoteaddr_list;
		     entry != NULL;
		     entry = next_entry) {
			next_entry = entry->link;
			if (AF(&iface->sin) != AF(&entry->addr) ||
			    !IS_MCAST(&entry->addr))
				continue;
			if (socket_multicast_enable(iface,
						    &entry->addr))
				msyslog(LOG_INFO, 
					"Joined %s socket to multicast group %s",
					stoa(&iface->sin),
					stoa(&entry->addr));
			else
				msyslog(LOG_ERR,
					"Failed to join %s socket to multicast group %s",
					stoa(&iface->sin),
					stoa(&entry->addr));
		}
	}
#endif	/* MCAST && MCAST_NONEWSOCKET */

	DPRINT_INTERFACE(2, (iface, "created ", "\n"));
	return iface;
}


#ifdef SO_EXCLUSIVEADDRUSE
static void
set_excladdruse(
	SOCKET fd
	)
{
	int one = 1;
	int failed;
#ifdef SYS_WINNT
	DWORD err;
#endif

	failed = setsockopt(fd, SOL_SOCKET, SO_EXCLUSIVEADDRUSE,
			    (char *)&one, sizeof(one));

	if (!failed)
		return;

#ifdef SYS_WINNT
	/*
	 * Prior to Windows XP setting SO_EXCLUSIVEADDRUSE can fail with
	 * error WSAINVAL depending on service pack level and whether
	 * the user account is in the Administrators group.  Do not 
	 * complain if it fails that way on versions prior to XP (5.1).
	 */
	err = GetLastError();

	if (isc_win32os_versioncheck(5, 1, 0, 0) < 0	/* < 5.1/XP */
	    && WSAEINVAL == err)
		return;

	SetLastError(err);
#endif
	msyslog(LOG_ERR, 
		"setsockopt(%d, SO_EXCLUSIVEADDRUSE, on): %m",
		(int)fd);
}
#endif  /* SO_EXCLUSIVEADDRUSE */


/*
 * set_reuseaddr() - set/clear REUSEADDR on all sockets
 *			NB possible hole - should we be doing this on broadcast
 *			fd's also?
 */
static void
set_reuseaddr(
	int flag
	)
{
#ifndef SO_EXCLUSIVEADDRUSE
	endpt *ep;

	for (ep = ep_list; ep != NULL; ep = ep->elink) {
		if (ep->flags & INT_WILDCARD)
			continue;
	  
		/*
		 * if ep->fd  is INVALID_SOCKET, we might have a adapter
		 * configured but not present
		 */
		DPRINTF(4, ("setting SO_REUSEADDR on %.16s@%s to %s\n",
			    ep->name, stoa(&ep->sin),
			    flag ? "on" : "off"));
		
		if (ep->fd != INVALID_SOCKET) {
			if (setsockopt(ep->fd, SOL_SOCKET, SO_REUSEADDR,
				       (char *)&flag, sizeof(flag))) {
				msyslog(LOG_ERR, "set_reuseaddr: setsockopt(%s, SO_REUSEADDR, %s) failed: %m",
					stoa(&ep->sin), flag ? "on" : "off");
			}
		}
	}
#endif /* ! SO_EXCLUSIVEADDRUSE */
}

/*
 * This is just a wrapper around an internal function so we can
 * make other changes as necessary later on
 */
void
enable_broadcast(
	struct interface *	iface, 
	sockaddr_u *		baddr
	)
{
#ifdef OPEN_BCAST_SOCKET 
	socket_broadcast_enable(iface, iface->fd, baddr);
#endif
}

#ifdef OPEN_BCAST_SOCKET 
/*
 * Enable a broadcast address to a given socket
 * The socket is in the inter_list all we need to do is enable
 * broadcasting. It is not this function's job to select the socket
 */
static isc_boolean_t
socket_broadcast_enable(
	struct interface *	iface, 
	SOCKET			fd, 
	sockaddr_u *		baddr
	)
{
#ifdef SO_BROADCAST
	int on = 1;

	if (IS_IPV4(baddr)) {
		/* if this interface can support broadcast, set SO_BROADCAST */
		if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST,
			       (char *)&on, sizeof(on)))
			msyslog(LOG_ERR,
				"setsockopt(SO_BROADCAST) enable failure on address %s: %m",
				stoa(baddr));
		else
			DPRINTF(2, ("Broadcast enabled on socket %d for address %s\n",
				    fd, stoa(baddr)));
	}
	iface->flags |= INT_BCASTOPEN;
	broadcast_client_enabled = ISC_TRUE;
	return ISC_TRUE;
#else
	return ISC_FALSE;
#endif /* SO_BROADCAST */
}

/*
 * Remove a broadcast address from a given socket
 * The socket is in the inter_list all we need to do is disable
 * broadcasting. It is not this function's job to select the socket
 */
static isc_boolean_t
socket_broadcast_disable(
	struct interface *	iface, 
	sockaddr_u *		baddr
	)
{
#ifdef SO_BROADCAST
	int off = 0;	/* This seems to be OK as an int */

	if (IS_IPV4(baddr) && setsockopt(iface->fd, SOL_SOCKET,
	    SO_BROADCAST, (char *)&off, sizeof(off)))
		msyslog(LOG_ERR,
			"setsockopt(SO_BROADCAST) disable failure on address %s: %m",
			stoa(baddr));

	iface->flags &= ~INT_BCASTOPEN;
	broadcast_client_enabled = ISC_FALSE;
	return ISC_TRUE;
#else
	return ISC_FALSE;
#endif /* SO_BROADCAST */
}

#endif /* OPEN_BCAST_SOCKET */

/*
 * return the broadcast client flag value
 */
isc_boolean_t
get_broadcastclient_flag(void)
{
	return (broadcast_client_enabled);
}
/*
 * Check to see if the address is a multicast address
 */
static isc_boolean_t
addr_ismulticast(
	sockaddr_u *maddr
	)
{
	isc_boolean_t result;

#ifndef INCLUDE_IPV6_MULTICAST_SUPPORT
	/*
	 * If we don't have IPV6 support any IPV6 addr is not multicast
	 */
	if (IS_IPV6(maddr))
		result = ISC_FALSE;
	else
#endif
		result = IS_MCAST(maddr);

	if (!result)
		DPRINTF(4, ("address %s is not multicast\n",
			    stoa(maddr)));

	return result;
}

/*
 * Multicast servers need to set the appropriate Multicast interface
 * socket option in order for it to know which interface to use for
 * send the multicast packet.
 */
void
enable_multicast_if(
	struct interface *	iface,
	sockaddr_u *		maddr
	)
{
#ifdef MCAST
	TYPEOF_IP_MULTICAST_LOOP off = 0;

	NTP_REQUIRE(AF(maddr) == AF(&iface->sin));

	switch (AF(&iface->sin)) {

	case AF_INET:
#ifdef IP_MULTICAST_LOOP
		/*
		 * Don't send back to itself, but allow failure to set
		 */
		if (setsockopt(iface->fd, IPPROTO_IP,
			       IP_MULTICAST_LOOP,
			       SETSOCKOPT_ARG_CAST &off,
			       sizeof(off))) {

			msyslog(LOG_ERR,
				"setsockopt IP_MULTICAST_LOOP failed: %m on socket %d, addr %s for multicast address %s",
				iface->fd, stoa(&iface->sin), 
				stoa(maddr));
		}
#endif
		break;

	case AF_INET6:
#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
#ifdef IPV6_MULTICAST_LOOP
		/*
		 * Don't send back to itself, but allow failure to set
		 */
		if (setsockopt(iface->fd, IPPROTO_IPV6,
			       IPV6_MULTICAST_LOOP,
			       (char *) &off, sizeof(off))) {

			msyslog(LOG_ERR,
				"setsockopt IP_MULTICAST_LOOP failed: %m on socket %d, addr %s for multicast address %s",
				iface->fd, stoa(&iface->sin),
				stoa(maddr));
		}
#endif
		break;
#else
		return;
#endif	/* INCLUDE_IPV6_MULTICAST_SUPPORT */
	}
	return;
#endif
}

/*
 * Add a multicast address to a given socket
 * The socket is in the inter_list all we need to do is enable
 * multicasting. It is not this function's job to select the socket
 */
#if defined(MCAST)
static isc_boolean_t
socket_multicast_enable(
	endpt *		iface,
	sockaddr_u *	maddr
	)
{
	struct ip_mreq		mreq;
#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
	struct ipv6_mreq	mreq6;
#endif
	switch (AF(maddr)) {

	case AF_INET:
		memset(&mreq, 0, sizeof(mreq));
		mreq.imr_multiaddr = SOCK_ADDR4(maddr);
		mreq.imr_interface.s_addr = htonl(INADDR_ANY);
		if (setsockopt(iface->fd,
			       IPPROTO_IP,
			       IP_ADD_MEMBERSHIP,
			       (char *)&mreq, 
			       sizeof(mreq))) {
			msyslog(LOG_ERR,
				"setsockopt IP_ADD_MEMBERSHIP failed: %m on socket %d, addr %s for %x / %x (%s)",
				iface->fd, stoa(&iface->sin),
				mreq.imr_multiaddr.s_addr,
				mreq.imr_interface.s_addr,
				stoa(maddr));
			return ISC_FALSE;
		}
		DPRINTF(4, ("Added IPv4 multicast membership on socket %d, addr %s for %x / %x (%s)\n",
			    iface->fd, stoa(&iface->sin),
			    mreq.imr_multiaddr.s_addr,
			    mreq.imr_interface.s_addr, stoa(maddr)));
		break;

	case AF_INET6:
#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
		/*
		 * Enable reception of multicast packets.
		 * If the address is link-local we can get the
		 * interface index from the scope id. Don't do this
		 * for other types of multicast addresses. For now let
		 * the kernel figure it out.
		 */
		memset(&mreq6, 0, sizeof(mreq6));
		mreq6.ipv6mr_multiaddr = SOCK_ADDR6(maddr);
		mreq6.ipv6mr_interface = iface->ifindex;

		if (setsockopt(iface->fd, IPPROTO_IPV6,
			       IPV6_JOIN_GROUP, (char *)&mreq6, 
			       sizeof(mreq6))) {
			msyslog(LOG_ERR,
				"setsockopt IPV6_JOIN_GROUP failed: %m on socket %d, addr %s for interface %u (%s)",
				iface->fd, stoa(&iface->sin),
				mreq6.ipv6mr_interface, stoa(maddr));
			return ISC_FALSE;
		}
		DPRINTF(4, ("Added IPv6 multicast group on socket %d, addr %s for interface %u (%s)\n",
			    iface->fd, stoa(&iface->sin),
			    mreq6.ipv6mr_interface, stoa(maddr)));
#else
		return ISC_FALSE;
#endif	/* INCLUDE_IPV6_MULTICAST_SUPPORT */
	}
	iface->flags |= INT_MCASTOPEN;
	iface->num_mcast++;

	return ISC_TRUE;
}
#endif	/* MCAST */


/*
 * Remove a multicast address from a given socket
 * The socket is in the inter_list all we need to do is disable
 * multicasting. It is not this function's job to select the socket
 */
#ifdef MCAST
static isc_boolean_t
socket_multicast_disable(
	struct interface *	iface,
	sockaddr_u *		maddr
	)
{
#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
	struct ipv6_mreq mreq6;
#endif
	struct ip_mreq mreq;

	memset(&mreq, 0, sizeof(mreq));

	if (find_addr_in_list(maddr) == NULL) {
		DPRINTF(4, ("socket_multicast_disable(%s): not found\n", 
			    stoa(maddr)));
		return ISC_TRUE;
	}

	switch (AF(maddr)) {

	case AF_INET:
		mreq.imr_multiaddr = SOCK_ADDR4(maddr);
		mreq.imr_interface = SOCK_ADDR4(&iface->sin);
		if (setsockopt(iface->fd, IPPROTO_IP,
			       IP_DROP_MEMBERSHIP, (char *)&mreq,
			       sizeof(mreq))) {

			msyslog(LOG_ERR,
				"setsockopt IP_DROP_MEMBERSHIP failed: %m on socket %d, addr %s for %x / %x (%s)",
				iface->fd, stoa(&iface->sin),
				SRCADR(maddr), SRCADR(&iface->sin),
				stoa(maddr));
			return ISC_FALSE;
		}
		break;
	case AF_INET6:
#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
		/*
		 * Disable reception of multicast packets
		 * If the address is link-local we can get the
		 * interface index from the scope id.  Don't do this
		 * for other types of multicast addresses. For now let
		 * the kernel figure it out.
		 */
		mreq6.ipv6mr_multiaddr = SOCK_ADDR6(maddr);
		mreq6.ipv6mr_interface = iface->ifindex;

		if (setsockopt(iface->fd, IPPROTO_IPV6,
			       IPV6_LEAVE_GROUP, (char *)&mreq6,
			       sizeof(mreq6))) {

			msyslog(LOG_ERR,
				"setsockopt IPV6_LEAVE_GROUP failure: %m on socket %d, addr %s for %d (%s)",
				iface->fd, stoa(&iface->sin),
				iface->ifindex, stoa(maddr));
			return ISC_FALSE;
		}
		break;
#else
		return ISC_FALSE;
#endif	/* INCLUDE_IPV6_MULTICAST_SUPPORT */
	}

	iface->num_mcast--;
	if (!iface->num_mcast)
		iface->flags &= ~INT_MCASTOPEN;

	return ISC_TRUE;
}
#endif	/* MCAST */

/*
 * io_setbclient - open the broadcast client sockets
 */
void
io_setbclient(void)
{
#ifdef OPEN_BCAST_SOCKET 
	struct interface *	interf;
	int			nif;
	isc_boolean_t		jstatus; 
	SOCKET			fd;

	nif = 0;
	set_reuseaddr(1);

	for (interf = ep_list;
	     interf != NULL;
	     interf = interf->elink) {

		if (interf->flags & (INT_WILDCARD | INT_LOOPBACK))
			continue;
	  
		/* use only allowed addresses */
		if (interf->ignore_packets)
			continue;


		/* Need a broadcast-capable interface */
		if (!(interf->flags & INT_BROADCAST))
			continue;

		/* Only IPv4 addresses are valid for broadcast */
		NTP_REQUIRE(IS_IPV4(&interf->sin));

		/* Do we already have the broadcast address open? */
		if (interf->flags & INT_BCASTOPEN) {
			/* 
			 * account for already open interfaces to avoid
			 * misleading warning below 
			 */
			nif++;
			continue;
		}

		/*
		 * Try to open the broadcast address
		 */
		interf->family = AF_INET;
		interf->bfd = open_socket(&interf->bcast, 1, 0, interf);

		/*
		 * If we succeeded then we use it otherwise enable
		 * broadcast on the interface address
		 */
		if (interf->bfd != INVALID_SOCKET) {
			fd = interf->bfd;
			jstatus = ISC_TRUE;
		} else {
			fd = interf->fd;
			jstatus = socket_broadcast_enable(interf, fd,
					&interf->sin);
		}

		/* Enable Broadcast on socket */
		if (jstatus) {
			nif++;
			msyslog(LOG_INFO,
				"io_setbclient: Opened broadcast client on interface #%d %s",
				interf->ifnum, interf->name);
			interf->addr_refid = addr2refid(&interf->sin);
		}
	}
	set_reuseaddr(0);
	if (nif > 0)
		DPRINTF(1, ("io_setbclient: Opened broadcast clients\n"));
	else if (!nif)
		msyslog(LOG_ERR,
			"Unable to listen for broadcasts, no broadcast interfaces available");
#else
	msyslog(LOG_ERR,
		"io_setbclient: Broadcast Client disabled by build");
#endif	/* OPEN_BCAST_SOCKET */
}

/*
 * io_unsetbclient - close the broadcast client sockets
 */
void
io_unsetbclient(void)
{
	endpt *ep;

	for (ep = ep_list; ep != NULL; ep = ep->elink) {
		if (INT_WILDCARD & ep->flags)
			continue;
		if (!(INT_BCASTOPEN & ep->flags))
			continue;
		socket_broadcast_disable(ep, &ep->sin);
	}
}

/*
 * io_multicast_add() - add multicast group address
 */
void
io_multicast_add(
	sockaddr_u *addr
	)
{
#ifdef MCAST
	endpt *	ep;
	endpt *	one_ep;

	/*
	 * Check to see if this is a multicast address
	 */
	if (!addr_ismulticast(addr))
		return;

	/* If we already have it we can just return */
	if (NULL != find_flagged_addr_in_list(addr, INT_MCASTOPEN)) {
		msyslog(LOG_INFO, 
			"Duplicate request found for multicast address %s",
			stoa(addr));
		return;
	}

#ifndef MULTICAST_NONEWSOCKET
	ep = new_interface(NULL);
	
	/*
	 * Open a new socket for the multicast address
	 */
	ep->sin = *addr;
	SET_PORT(&ep->sin, NTP_PORT);
	ep->family = AF(&ep->sin);
	AF(&ep->mask) = ep->family;
	SET_ONESMASK(&ep->mask);

	set_reuseaddr(1);
	ep->bfd = INVALID_SOCKET;
	ep->fd = open_socket(&ep->sin, 0, 0, ep);
	if (ep->fd != INVALID_SOCKET) {
		ep->ignore_packets = ISC_FALSE;
		ep->flags |= INT_MCASTIF;
		
		strncpy(ep->name, "multicast", sizeof(ep->name));
		DPRINT_INTERFACE(2, (ep, "multicast add ", "\n"));
		add_interface(ep);
		log_listen_address(ep);
	} else {
		/* bind failed, re-use wildcard interface */
		delete_interface(ep);

		if (IS_IPV4(addr))
			ep = wildipv4;
		else if (IS_IPV6(addr))
			ep = wildipv6;
		else
			ep = NULL;

		if (ep != NULL) {
			/* HACK ! -- stuff in an address */
			/* because we don't bind addr? DH */
			ep->bcast = *addr;
			msyslog(LOG_ERR,
				"multicast address %s using wildcard interface #%d %s",
				stoa(addr), ep->ifnum, ep->name);
		} else {
			msyslog(LOG_ERR,
				"No multicast socket available to use for address %s",
				stoa(addr));
			return;
		}
	}
	{	/* in place of the { following for in #else clause */
		one_ep = ep;
#else	/* MULTICAST_NONEWSOCKET follows */
	/*
	 * For the case where we can't use a separate socket (Windows)
	 * join each applicable endpoint socket to the group address.
	 */
	if (IS_IPV4(addr))
		one_ep = wildipv4;
	else
		one_ep = wildipv6;
	for (ep = ep_list; ep != NULL; ep = ep->elink) {
		if (ep->ignore_packets || AF(&ep->sin) != AF(addr) ||
		    !(INT_MULTICAST & ep->flags) ||
		    (INT_LOOPBACK | INT_WILDCARD) & ep->flags)
			continue;
		one_ep = ep;
#endif	/* MULTICAST_NONEWSOCKET */
		if (socket_multicast_enable(ep, addr))
			msyslog(LOG_INFO, 
				"Joined %s socket to multicast group %s",
				stoa(&ep->sin),
				stoa(addr));
		else
			msyslog(LOG_ERR,
				"Failed to join %s socket to multicast group %s",
				stoa(&ep->sin),
				stoa(addr));
	}

	add_addr_to_list(addr, one_ep);
#else	/* !MCAST  follows*/
	msyslog(LOG_ERR,
		"Can not add multicast address %s: no multicast support",
		stoa(addr));
#endif
	return;
}


/*
 * io_multicast_del() - delete multicast group address
 */
void
io_multicast_del(
	sockaddr_u *	addr
	)
{
#ifdef MCAST
	endpt *iface;

	/*
	 * Check to see if this is a multicast address
	 */
	if (!addr_ismulticast(addr)) {
		msyslog(LOG_ERR, "invalid multicast address %s",
			stoa(addr));
		return;
	}

	/*
	 * Disable reception of multicast packets
	 */
	while ((iface = find_flagged_addr_in_list(addr, INT_MCASTOPEN))
	       != NULL)
		socket_multicast_disable(iface, addr);

	delete_addr_from_list(addr);

#else /* not MCAST */
	msyslog(LOG_ERR,
		"Can not delete multicast address %s: no multicast support",
		stoa(addr));
#endif /* not MCAST */
}


/*
 * init_nonblocking_io() - set up descriptor to be non blocking
 */
static void init_nonblocking_io(
	SOCKET fd
	)
{
	/*
	 * set non-blocking,
	 */

#ifdef USE_FIONBIO
	/* in vxWorks we use FIONBIO, but the others are defined for old systems, so
	 * all hell breaks loose if we leave them defined
	 */
#undef O_NONBLOCK
#undef FNDELAY
#undef O_NDELAY
#endif

#if defined(O_NONBLOCK) /* POSIX */
	if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) {
		msyslog(LOG_ERR,
			"fcntl(O_NONBLOCK) fails on fd #%d: %m", fd);
		exit(1);
	}
#elif defined(FNDELAY)
	if (fcntl(fd, F_SETFL, FNDELAY) < 0) {
		msyslog(LOG_ERR, "fcntl(FNDELAY) fails on fd #%d: %m",
			fd);
		exit(1);
	}
#elif defined(O_NDELAY) /* generally the same as FNDELAY */
	if (fcntl(fd, F_SETFL, O_NDELAY) < 0) {
		msyslog(LOG_ERR, "fcntl(O_NDELAY) fails on fd #%d: %m",
			fd);
		exit(1);
	}
#elif defined(FIONBIO)
	{
		int on = 1;

		if (ioctl(fd, FIONBIO, &on) < 0) {
			msyslog(LOG_ERR,
				"ioctl(FIONBIO) fails on fd #%d: %m",
				fd);
			exit(1);
		}
	}
#elif defined(FIOSNBIO)
	if (ioctl(fd, FIOSNBIO, &on) < 0) {
		msyslog(LOG_ERR,
			"ioctl(FIOSNBIO) fails on fd #%d: %m", fd);
		exit(1);
	}
#else
# include "Bletch: Need non-blocking I/O!"
#endif
}

/*
 * open_socket - open a socket, returning the file descriptor
 */

static SOCKET
open_socket(
	sockaddr_u *	addr,
	int		bcast,
	int		turn_off_reuse,
	endpt *		interf
	)
{
	SOCKET	fd;
	int	errval;
	char	scopetext[16];
	/*
	 * int is OK for REUSEADR per 
	 * http://www.kohala.com/start/mcast.api.txt
	 */
	int	on = 1;
	int	off = 0;

	if (IS_IPV6(addr) && !ipv6_works)
		return INVALID_SOCKET;

	/* create a datagram (UDP) socket */
	fd = socket(AF(addr), SOCK_DGRAM, 0);
	if (INVALID_SOCKET == fd) {
		errval = socket_errno();
		msyslog(LOG_ERR, 
			"socket(AF_INET%s, SOCK_DGRAM, 0) failed on address %s: %m",
			IS_IPV6(addr) ? "6" : "", stoa(addr));

		if (errval == EPROTONOSUPPORT || 
		    errval == EAFNOSUPPORT ||
		    errval == EPFNOSUPPORT)
			return (INVALID_SOCKET);

		errno = errval;
		msyslog(LOG_ERR,
			"unexpected socket() error %m code %d (not EPROTONOSUPPORT nor EAFNOSUPPORT nor EPFNOSUPPORT) - exiting",
			errno);
		exit(1);
	}

#ifdef SYS_WINNT
	connection_reset_fix(fd, addr);
#endif
	/*
	 * Fixup the file descriptor for some systems
	 * See bug #530 for details of the issue.
	 */
	fd = move_fd(fd);

	/*
	 * set SO_REUSEADDR since we will be binding the same port
	 * number on each interface according to turn_off_reuse.
	 * This is undesirable on Windows versions starting with
	 * Windows XP (numeric version 5.1).
	 */
#ifdef SYS_WINNT
	if (isc_win32os_versioncheck(5, 1, 0, 0) < 0)  /* before 5.1 */
#endif
		if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
			       (char *)((turn_off_reuse) 
					    ? &off 
					    : &on), 
			       sizeof(on))) {

			msyslog(LOG_ERR,
				"setsockopt SO_REUSEADDR %s fails for address %s: %m",
				(turn_off_reuse)
				    ? "off" 
				    : "on", 
				stoa(addr));
			closesocket(fd);
			return INVALID_SOCKET;
		}
#ifdef SO_EXCLUSIVEADDRUSE
	/*
	 * setting SO_EXCLUSIVEADDRUSE on the wildcard we open
	 * first will cause more specific binds to fail.
	 */
	if (!(interf->flags & INT_WILDCARD))
		set_excladdruse(fd);
#endif

	/*
	 * IPv4 specific options go here
	 */
	if (IS_IPV4(addr)) {
#if defined(HAVE_IPTOS_SUPPORT)
		if (setsockopt(fd, IPPROTO_IP, IP_TOS, (char *)&qos,
			       sizeof(qos)))
			msyslog(LOG_ERR,
				"setsockopt IP_TOS (%02x) fails on address %s: %m",
				qos, stoa(addr));
#endif /* HAVE_IPTOS_SUPPORT */
		if (bcast)
			socket_broadcast_enable(interf, fd, addr);
	}

	/*
	 * IPv6 specific options go here
	 */
	if (IS_IPV6(addr)) {
#ifdef IPV6_V6ONLY
		if (isc_net_probe_ipv6only() == ISC_R_SUCCESS
		    && setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY,
		    (char*)&on, sizeof(on)))
			msyslog(LOG_ERR,
				"setsockopt IPV6_V6ONLY on fails on address %s: %m",
				stoa(addr));
#endif
#ifdef IPV6_BINDV6ONLY
		if (setsockopt(fd, IPPROTO_IPV6, IPV6_BINDV6ONLY,
		    (char*)&on, sizeof(on)))
			msyslog(LOG_ERR,
				"setsockopt IPV6_BINDV6ONLY on fails on address %s: %m",
				stoa(addr));
#endif
	}

#ifdef OS_NEEDS_REUSEADDR_FOR_IFADDRBIND
	/*
	 * some OSes don't allow binding to more specific
	 * addresses if a wildcard address already bound
	 * to the port and SO_REUSEADDR is not set
	 */
	if (!is_wildcard_addr(addr))
		set_wildcard_reuse(AF(addr), 1);
#endif

	/*
	 * bind the local address.
	 */
	errval = bind(fd, &addr->sa, SOCKLEN(addr));

#ifdef OS_NEEDS_REUSEADDR_FOR_IFADDRBIND
	if (!is_wildcard_addr(addr))
		set_wildcard_reuse(AF(addr), 0);
#endif

	if (errval < 0) {
		/*
		 * Don't log this under all conditions
		 */
		if (turn_off_reuse == 0
#ifdef DEBUG
		    || debug > 1
#endif
		    ) {
			if (SCOPE(addr))
				snprintf(scopetext, sizeof(scopetext),
					 "%%%d", SCOPE(addr));
			else
				scopetext[0] = 0;

			msyslog(LOG_ERR,
				"bind(%d) AF_INET%s %s%s#%d%s flags 0x%x failed: %m",
				fd, IS_IPV6(addr) ? "6" : "",
				stoa(addr), scopetext, SRCPORT(addr),
				IS_MCAST(addr) ? " (multicast)" : "",
				interf->flags);
		}

		closesocket(fd);
		
		return INVALID_SOCKET;
	}

#ifdef HAVE_TIMESTAMP
	{
		if (setsockopt(fd, SOL_SOCKET, SO_TIMESTAMP,
			       (char*)&on, sizeof(on)))
			msyslog(LOG_DEBUG,
				"setsockopt SO_TIMESTAMP on fails on address %s: %m",
				stoa(addr));
		else
			DPRINTF(4, ("setsockopt SO_TIMESTAMP enabled on fd %d address %s\n",
				    fd, stoa(addr)));
	}	
#endif
	DPRINTF(4, ("bind(%d) AF_INET%s, addr %s%%%d#%d, flags 0x%x\n",
		   fd, IS_IPV6(addr) ? "6" : "", stoa(addr),
		   SCOPE(addr), SRCPORT(addr), interf->flags));

	init_nonblocking_io(fd);
	
#ifdef HAVE_SIGNALED_IO
	init_socket_sig(fd);
#endif /* not HAVE_SIGNALED_IO */

	add_fd_to_list(fd, FD_TYPE_SOCKET);

#if !defined(SYS_WINNT) && !defined(VMS)
	DPRINTF(4, ("flags for fd %d: 0x%x\n", fd,
		    fcntl(fd, F_GETFL, 0)));
#endif /* SYS_WINNT || VMS */

#if defined (HAVE_IO_COMPLETION_PORT)
/*
 * Add the socket to the completion port
 */
	if (io_completion_port_add_socket(fd, interf)) {
		msyslog(LOG_ERR, "unable to set up io completion port - EXITING");
		exit(1);
	}
#endif
	return fd;
}


#ifdef SYS_WINNT
#define sendto(fd, buf, len, flags, dest, destsz)	\
	io_completion_port_sendto(fd, buf, len, (sockaddr_u *)(dest))
#endif

/* XXX ELIMINATE sendpkt similar in ntpq.c, ntpdc.c, ntp_io.c, ntptrace.c */
/*
 * sendpkt - send a packet to the specified destination. Maintain a
 * send error cache so that only the first consecutive error for a
 * destination is logged.
 */
void
sendpkt(
	sockaddr_u *		dest,
	struct interface *	ep,
	int			ttl,
	struct pkt *		pkt,
	int			len
	)
{
	endpt *	src;
	int	ismcast;
	int	cc;
	int	rc;
	u_char	cttl;

	ismcast = IS_MCAST(dest);
	if (!ismcast)
		src = ep;
	else
		src = (IS_IPV4(dest))
			  ? mc4_list
			  : mc6_list;
	
	if (NULL == src) {
		/*
		 * unbound peer - drop request and wait for better
		 * network conditions 
		 */
		DPRINTF(2, ("%ssendpkt(dst=%s, ttl=%d, len=%d): no interface - IGNORED\n",
			    ismcast ? "\tMCAST\t***** " : "",
			    stoa(dest), ttl, len));
		return;
	}

	do {
		DPRINTF(2, ("%ssendpkt(%d, dst=%s, src=%s, ttl=%d, len=%d)\n",
			    ismcast ? "\tMCAST\t***** " : "", src->fd,
			    stoa(dest), stoa(&src->sin), ttl, len));
#ifdef MCAST
		/*
		 * for the moment we use the bcast option to set multicast ttl
		 */
		if (ismcast && ttl > 0 && ttl != src->last_ttl) {
			/*
			 * set the multicast ttl for outgoing packets
			 */
			switch (AF(&src->sin)) {
				
			case AF_INET :
				cttl = (u_char)ttl;
				rc = setsockopt(src->fd, IPPROTO_IP,
						IP_MULTICAST_TTL,
						(void *)&cttl,
						sizeof(cttl));
				break;
				
# ifdef INCLUDE_IPV6_SUPPORT
			case AF_INET6 :
				rc = setsockopt(src->fd, IPPROTO_IPV6,
						 IPV6_MULTICAST_HOPS,
						 (void *)&ttl,
						 sizeof(ttl));
				break;
# endif	/* INCLUDE_IPV6_SUPPORT */

			default:
				rc = 0;
			}
			
			if (!rc)
				src->last_ttl = ttl;
			else
				msyslog(LOG_ERR, 
					"setsockopt IP_MULTICAST_TTL/IPV6_MULTICAST_HOPS fails on address %s: %m",
					stoa(&src->sin));
		}
#endif	/* MCAST */

#ifdef SIM
		cc = simulate_server(dest, src, pkt);
#else
		cc = sendto(src->fd, (char *)pkt, (u_int)len, 0,
			    &dest->sa, SOCKLEN(dest));
#endif
		if (cc == -1) {
			src->notsent++;
			packets_notsent++;
		} else	{
			src->sent++;
			packets_sent++;
		}
		if (ismcast)
			src = src->mclink;
	} while (ismcast && src != NULL);
}


#if !defined(HAVE_IO_COMPLETION_PORT)
/*
 * fdbits - generate ascii representation of fd_set (FAU debug support)
 * HFDF format - highest fd first.
 */
static char *
fdbits(
	int count,
	fd_set *set
	)
{
	static char buffer[256];
	char * buf = buffer;

	count = min(count,  255);

	while (count >= 0) {
		*buf++ = FD_ISSET(count, set) ? '#' : '-';
		count--;
	}
	*buf = '\0';

	return buffer;
}

/*
 * Routine to read the refclock packets for a specific interface
 * Return the number of bytes read. That way we know if we should
 * read it again or go on to the next one if no bytes returned
 */
static inline int
read_refclock_packet(SOCKET fd, struct refclockio *rp, l_fp ts)
{
	int i;
	int buflen;
	register struct recvbuf *rb;

	rb = get_free_recv_buffer();

	if (NULL == rb) {
		/*
		 * No buffer space available - just drop the packet
		 */
		char buf[RX_BUFF_SIZE];

		buflen = read(fd, buf, sizeof buf);
		packets_dropped++;
		return (buflen);
	}

	i = (rp->datalen == 0
	     || rp->datalen > sizeof(rb->recv_space))
		? sizeof(rb->recv_space)
		: rp->datalen;
	buflen = read(fd, (char *)&rb->recv_space, (unsigned)i);

	if (buflen < 0) {
		if (errno != EINTR && errno != EAGAIN)
			msyslog(LOG_ERR, "clock read fd %d: %m", fd);
		freerecvbuf(rb);
		return (buflen);
	}

	/*
	 * Got one. Mark how and when it got here,
	 * put it on the full list and do bookkeeping.
	 */
	rb->recv_length = buflen;
	rb->recv_srcclock = rp->srcclock;
	rb->dstadr = 0;
	rb->fd = fd;
	rb->recv_time = ts;
	rb->receiver = rp->clock_recv;

	if (rp->io_input) {
		/*
		 * have direct input routine for refclocks
		 */
		if (rp->io_input(rb) == 0) {
			/*
			 * data was consumed - nothing to pass up
			 * into block input machine
			 */
			freerecvbuf(rb);
			return (buflen);
		}
	}
	
	add_full_recv_buffer(rb);

	rp->recvcount++;
	packets_received++;
	return (buflen);
}


#ifdef HAVE_TIMESTAMP
/*
 * extract timestamps from control message buffer
 */
static l_fp
fetch_timestamp(
	struct recvbuf *	rb,
	struct msghdr *		msghdr, 
	l_fp			ts
	)
{
#ifdef USE_TIMESTAMP_CMSG
	struct cmsghdr *cmsghdr;

	cmsghdr = CMSG_FIRSTHDR(msghdr);
	while (cmsghdr != NULL) {
		switch (cmsghdr->cmsg_type)
		{
		case SCM_TIMESTAMP:
		{
			struct timeval *tvp;
			double dtemp;
			l_fp nts;

			tvp = (struct timeval *)CMSG_DATA(cmsghdr);
			DPRINTF(4, ("fetch_timestamp: system network time stamp: %ld.%06ld\n",
				    tvp->tv_sec, tvp->tv_usec));
			nts.l_i = tvp->tv_sec + JAN_1970;
			dtemp = (tvp->tv_usec 
				 + (ntp_random() * 2. / FRAC)) / 1e6;
			nts.l_uf = (u_int32)(dtemp * FRAC);
#ifdef DEBUG_TIMING
			{
				l_fp dts;

				dts = ts;
				L_SUB(&dts, &nts);
				collect_timing(rb, 
					       "input processing delay",
					       1, &dts);
				DPRINTF(4, ("fetch_timestamp: timestamp delta: %s (incl. prec fuzz)\n",
					    lfptoa(&dts, 9)));
			}
#endif
			ts = nts;  /* network time stamp */
			break;
		}
		default:
			DPRINTF(4, ("fetch_timestamp: skipping control message 0x%x\n",
				    cmsghdr->cmsg_type));
		}
		cmsghdr = CMSG_NXTHDR(msghdr, cmsghdr);
	}
#endif
	return ts;
}
#endif


/*
 * Routine to read the network NTP packets for a specific interface
 * Return the number of bytes read. That way we know if we should
 * read it again or go on to the next one if no bytes returned
 */
static inline int
read_network_packet(
	SOCKET			fd,
	struct interface *	itf,
	l_fp			ts
	)
{
	GETSOCKNAME_SOCKLEN_TYPE fromlen;
	int buflen;
	register struct recvbuf *rb;
#ifdef HAVE_TIMESTAMP
	struct msghdr msghdr;
	struct iovec iovec;
	char control[TIMESTAMP_CTLMSGBUF_SIZE];
#endif

	/*
	 * Get a buffer and read the frame.  If we
	 * haven't got a buffer, or this is received
	 * on a disallowed socket, just dump the
	 * packet.
	 */

	rb = get_free_recv_buffer();
	if (NULL == rb || itf->ignore_packets) {
		char buf[RX_BUFF_SIZE];
		sockaddr_u from;

		if (rb != NULL)
			freerecvbuf(rb);

		fromlen = sizeof(from);
		buflen = recvfrom(fd, buf, sizeof(buf), 0,
				  &from.sa, &fromlen);
		DPRINTF(4, ("%s on (%lu) fd=%d from %s\n",
			(itf->ignore_packets)
			    ? "ignore"
			    : "drop",
			free_recvbuffs(), fd, stoa(&from)));
		if (itf->ignore_packets)
			packets_ignored++;
		else
			packets_dropped++;
		return (buflen);
	}

	fromlen = sizeof(rb->recv_srcadr);

#ifndef HAVE_TIMESTAMP
	rb->recv_length = recvfrom(fd, (char *)&rb->recv_space,
				   sizeof(rb->recv_space), 0,
				   &rb->recv_srcadr.sa, &fromlen);
#else
	iovec.iov_base        = &rb->recv_space;
	iovec.iov_len         = sizeof(rb->recv_space);
	msghdr.msg_name       = &rb->recv_srcadr;
	msghdr.msg_namelen    = fromlen;
	msghdr.msg_iov        = &iovec;
	msghdr.msg_iovlen     = 1;
	msghdr.msg_control    = (void *)&control;
	msghdr.msg_controllen = sizeof(control);
	msghdr.msg_flags      = 0;
	rb->recv_length       = recvmsg(fd, &msghdr, 0);
#endif

	buflen = rb->recv_length;

	if (buflen == 0 || (buflen == -1 && 
	    (EWOULDBLOCK == errno
#ifdef EAGAIN
	     || EAGAIN == errno
#endif
	     ))) {
		freerecvbuf(rb);
		return (buflen);
	} else if (buflen < 0) {
		msyslog(LOG_ERR, "recvfrom(%s) fd=%d: %m",
			stoa(&rb->recv_srcadr), fd);
		DPRINTF(5, ("read_network_packet: fd=%d dropped (bad recvfrom)\n",
			    fd));
		freerecvbuf(rb);
		return (buflen);
	}

	DPRINTF(3, ("read_network_packet: fd=%d length %d from %s\n",
		    fd, buflen, stoa(&rb->recv_srcadr)));

	/*
	 * Got one.  Mark how and when it got here,
	 * put it on the full list and do bookkeeping.
	 */
	rb->dstadr = itf;
	rb->fd = fd;
#ifdef HAVE_TIMESTAMP
	/* pick up a network time stamp if possible */
	ts = fetch_timestamp(rb, &msghdr, ts);
#endif
	rb->recv_time = ts;
	rb->receiver = receive;

	add_full_recv_buffer(rb);

	itf->received++;
	packets_received++;
	return (buflen);
}


/*
 * input_handler - receive packets asynchronously
 */
void
input_handler(
	l_fp *cts
	)
{
	int buflen;
	int n;
	int doing;
	SOCKET fd;
	struct timeval tvzero;
	l_fp ts;		/* Timestamp at BOselect() gob */
#ifdef DEBUG_TIMING
	l_fp ts_e;		/* Timestamp at EOselect() gob */
#endif
	fd_set fds;
	int select_count = 0;
	endpt *ep;
#if defined(HAS_ROUTING_SOCKET)
	struct asyncio_reader *asyncio_reader;
#endif

	handler_calls++;

	/*
	 * If we have something to do, freeze a timestamp.
	 * See below for the other cases (nothing left to do or error)
	 */
	ts = *cts;

	/*
	 * Do a poll to see who has data
	 */

	fds = activefds;
	tvzero.tv_sec = tvzero.tv_usec = 0;

	n = select(maxactivefd + 1, &fds, (fd_set *)0, (fd_set *)0,
		   &tvzero);

	/*
	 * If there are no packets waiting just return
	 */
	if (n < 0) {
		int err = errno;
		/*
		 * extended FAU debugging output
		 */
		if (err != EINTR)
			msyslog(LOG_ERR,
				"select(%d, %s, 0L, 0L, &0.0) error: %m",
				maxactivefd + 1,
				fdbits(maxactivefd, &activefds));
		if (err == EBADF) {
			int j, b;
			fds = activefds;
			for (j = 0; j <= maxactivefd; j++)
				if ((FD_ISSET(j, &fds)
				    && (read(j, &b, 0) == -1)))
					msyslog(LOG_ERR,
						"Bad file descriptor %d",
						j);
		}
		return;
	}
	else if (n == 0)
		return;

	++handler_pkts;

#ifdef REFCLOCK
	/*
	 * Check out the reference clocks first, if any
	 */

	if (refio != NULL) {
		register struct refclockio *rp;

		for (rp = refio; rp != NULL; rp = rp->next) {
			fd = rp->fd;

			if (FD_ISSET(fd, &fds))
				do {
					++select_count;
					buflen = read_refclock_packet(
							fd, rp, ts);
				} while (buflen > 0);
		}
	}
#endif /* REFCLOCK */

	/*
	 * Loop through the interfaces looking for data to read.
	 */
	for (ep = ep_list; ep != NULL; ep = ep->elink) {
		for (doing = 0; doing < 2; doing++) {
			if (!doing) {
				fd = ep->fd;
			} else {
				if (!(ep->flags & INT_BCASTOPEN))
					break;
				fd = ep->bfd;
			}
			if (fd < 0)
				continue;
			if (FD_ISSET(fd, &fds))
				do {
					++select_count;
					buflen = read_network_packet(
							fd, ep, ts);
				} while (buflen > 0);
			/* Check more interfaces */
		}
	}

#ifdef HAS_ROUTING_SOCKET
	/*
	 * scan list of asyncio readers - currently only used for routing sockets
	 */
	asyncio_reader = asyncio_reader_list;

	while (asyncio_reader != NULL) {
		if (FD_ISSET(asyncio_reader->fd, &fds)) {
			++select_count;
			(asyncio_reader->receiver)(asyncio_reader);
		}
		asyncio_reader = asyncio_reader->link;
	}
#endif /* HAS_ROUTING_SOCKET */
	
	/*
	 * Done everything from that select.
	 */

	/*
	 * If nothing to do, just return.
	 * If an error occurred, complain and return.
	 */
	if (select_count == 0) { /* We really had nothing to do */
#ifdef DEBUG
		if (debug)
			msyslog(LOG_DEBUG, "input_handler: select() returned 0");
#endif
		return;
	}
	/* We've done our work */
#ifdef DEBUG_TIMING
	get_systime(&ts_e);
	/*
	 * (ts_e - ts) is the amount of time we spent
	 * processing this gob of file descriptors.  Log
	 * it.
	 */
	L_SUB(&ts_e, &ts);
	collect_timing(NULL, "input handler", 1, &ts_e);
	if (debug > 3)
		msyslog(LOG_DEBUG,
			"input_handler: Processed a gob of fd's in %s msec",
			lfptoms(&ts_e, 6));
#endif
	/* just bail. */
	return;
}
#endif

/*
 * findinterface - find local interface corresponding to address
 */
endpt *
findinterface(
	sockaddr_u *addr
	)
{
	endpt *iface;
	
	iface = findlocalinterface(addr, INT_WILDCARD, 0);

	if (NULL == iface) {
		DPRINTF(4, ("Found no interface for address %s - returning wildcard\n",
			    stoa(addr)));

		iface = ANY_INTERFACE_CHOOSE(addr);
	} else
		DPRINTF(4, ("Found interface #%d %s for address %s\n",
			    iface->ifnum, iface->name, stoa(addr)));

	return iface;
}

/*
 * findlocalinterface - find local interface corresponding to addr,
 * which does not have any of flags set.  If bast is nonzero, addr is
 * a broadcast address.
 *
 * This code attempts to find the local sending address for an outgoing
 * address by connecting a new socket to destinationaddress:NTP_PORT
 * and reading the sockname of the resulting connect.
 * the complicated sequence simulates the routing table lookup
 * for to first hop without duplicating any of the routing logic into
 * ntpd. preferably we would have used an API call - but its not there -
 * so this is the best we can do here short of duplicating to entire routing
 * logic in ntpd which would be a silly and really unportable thing to do.
 *
 */
static endpt *
findlocalinterface(
	sockaddr_u *	addr,
	int		flags,
	int		bcast
	)
{
	GETSOCKNAME_SOCKLEN_TYPE	sockaddrlen;
	endpt *				iface;
	sockaddr_u			saddr;
	SOCKET				s;
	int				rtn;
	int				on;

	DPRINTF(4, ("Finding interface for addr %s in list of addresses\n",
		    stoa(addr)));
	
	s = socket(AF(addr), SOCK_DGRAM, 0);
	if (INVALID_SOCKET == s)
		return NULL;

	/*
	 * If we are looking for broadcast interface we need to set this
	 * socket to allow broadcast
	 */
	if (bcast) {
		on = 1;
		setsockopt(s, SOL_SOCKET, SO_BROADCAST,
			   (char *)&on, sizeof(on));
	}

	rtn = connect(s, &addr->sa, SOCKLEN(addr));
	if (SOCKET_ERROR == rtn) {
		closesocket(s);
		return NULL;
	}

	sockaddrlen = sizeof(saddr);
	rtn = getsockname(s, &saddr.sa, &sockaddrlen);
	closesocket(s);
	if (SOCKET_ERROR == rtn)
		return NULL;

	DPRINTF(4, ("findlocalinterface: kernel maps %s to %s\n",
		    stoa(addr), stoa(&saddr)));
	
	iface = getinterface(&saddr, flags);

	/* 
	 * if we didn't find an exact match on saddr, find the closest
	 * available local address.  This handles the case of the
	 * address suggested by the kernel being excluded by nic rules
	 * or the user's -I and -L options to ntpd.
	 * See http://bugs.ntp.org/1184 and http://bugs.ntp.org/1683
	 * for more background.
	 */
	if (NULL == iface || iface->ignore_packets)
		iface = findclosestinterface(&saddr, 
					     flags | INT_LOOPBACK);

	/* Don't use an interface which will ignore replies */
	if (iface != NULL && iface->ignore_packets)
		iface = NULL;

	return iface;
}


/*
 * findclosestinterface
 *
 * If there are -I/--interface or -L/novirtualips command-line options,
 * or "nic" or "interface" rules in ntp.conf, findlocalinterface() may
 * find the kernel's preferred local address for a given peer address is
 * administratively unavailable to ntpd, and punt to this routine's more
 * expensive search.
 *
 * Find the numerically closest local address to the one connect()
 * suggested.  This matches an address on the same subnet first, as
 * needed by Bug 1184, and provides a consistent choice if there are
 * multiple feasible local addresses, regardless of the order ntpd
 * enumerated them.
 */
static endpt *
findclosestinterface(
	sockaddr_u *	addr,
	int		flags
	)
{
	endpt *		ep;
	endpt *		winner;
	sockaddr_u	addr_dist;
	sockaddr_u	min_dist;

	winner = NULL;
	
	for (ep = ep_list; ep != NULL; ep = ep->elink) {
		if (ep->ignore_packets ||
		    AF(addr) != ep->family || 
		    flags & ep->flags)
			continue;
		
		calc_addr_distance(&addr_dist, addr, &ep->sin);
		if (NULL == winner ||
		    -1 == cmp_addr_distance(&addr_dist, &min_dist)) {
			min_dist = addr_dist;
			winner = ep;
		}
	}
	if (NULL == winner)
		DPRINTF(4, ("findclosestinterface(%s) failed\n", 
			    stoa(addr)));
	else
		DPRINTF(4, ("findclosestinterface(%s) -> %s\n", 
			    stoa(addr), stoa(&winner->sin)));

	return winner;
}


/*
 * calc_addr_distance - calculate the distance between two addresses,
 *			the absolute value of the difference between
 *			the addresses numerically, stored as an address.
 */
static void
calc_addr_distance(
	sockaddr_u *		dist,
	const sockaddr_u *	a1,
	const sockaddr_u *	a2
	)
{
	u_int32	a1val;
	u_int32	a2val;
	u_int32	v4dist;
	int	found_greater;
	int	a1_greater;
	int	i;

	NTP_REQUIRE(AF(a1) == AF(a2));

	memset(dist, 0, sizeof(*dist));
	AF(dist) = AF(a1);

	/* v4 can be done a bit simpler */
	if (IS_IPV4(a1)) {
		a1val = SRCADR(a1);
		a2val = SRCADR(a2);
		v4dist = (a1val > a2val)
			     ? a1val - a2val
			     : a2val - a1val;
		SET_ADDR4(dist, v4dist);

		return;
	}

	found_greater = FALSE;
	a1_greater = FALSE;	/* suppress pot. uninit. warning */
	for (i = 0; i < sizeof(NSRCADR6(a1)); i++) {
		if (!found_greater &&
		    NSRCADR6(a1)[i] != NSRCADR6(a2)[i]) {
			found_greater = TRUE;
			a1_greater = (NSRCADR6(a1)[i] > NSRCADR6(a2)[i]);
		}
		if (!found_greater) {
			NSRCADR6(dist)[i] = 0;
		} else {
			if (a1_greater)
				NSRCADR6(dist)[i] = NSRCADR6(a1)[i] -
						    NSRCADR6(a2)[i];
			else
				NSRCADR6(dist)[i] = NSRCADR6(a2)[i] -
						    NSRCADR6(a1)[i];
		}
	}
}


/*
 * cmp_addr_distance - compare two address distances, returning -1, 0,
 *		       1 to indicate their relationship.
 */
static int
cmp_addr_distance(
	const sockaddr_u *	d1,
	const sockaddr_u *	d2
	)
{
	int	i;

	NTP_REQUIRE(AF(d1) == AF(d2));

	if (IS_IPV4(d1)) {
		if (SRCADR(d1) < SRCADR(d2))
			return -1;
		else if (SRCADR(d1) == SRCADR(d2))
			return 0;
		else
			return 1;
	}

	for (i = 0; i < sizeof(NSRCADR6(d1)); i++) {
		if (NSRCADR6(d1)[i] < NSRCADR6(d2)[i])
			return -1;
		else if (NSRCADR6(d1)[i] > NSRCADR6(d2)[i])
			return 1;
	}

	return 0;
}



/*
 * fetch an interface structure the matches the
 * address and has the given flags NOT set
 */
static endpt *
getinterface(
	sockaddr_u *	addr, 
	u_int32		flags
	)
{
	endpt *iface;
	
	iface = find_addr_in_list(addr);

	if (iface != NULL && (iface->flags & flags))
		iface = NULL;
	
	return iface;
}


/*
 * findbcastinter - find broadcast interface corresponding to address
 */
endpt *
findbcastinter(
	sockaddr_u *addr
	)
{
#if !defined(MPE) && (defined(SIOCGIFCONF) || defined(SYS_WINNT))
	struct interface *iface;
	
	
	DPRINTF(4, ("Finding broadcast/multicast interface for addr %s in list of addresses\n",
		    stoa(addr)));

	iface = findlocalinterface(addr, INT_LOOPBACK | INT_WILDCARD,
				   1);	
	if (iface != NULL) {
		DPRINTF(4, ("Easily found bcast-/mcast- interface index #%d %s\n",
			    iface->ifnum, iface->name));
		return iface;
	}

	/*
	 * plan B - try to find something reasonable in our lists in
	 * case kernel lookup doesn't help
	 */
	for (iface = ep_list; iface != NULL; iface = iface->elink) {
		if (iface->flags & INT_WILDCARD)
			continue;
		
		/* Don't bother with ignored interfaces */
		if (iface->ignore_packets)
			continue;
		
		/*
		 * First look if this is the correct family
		 */
		if(AF(&iface->sin) != AF(addr))
			continue;

		/* Skip the loopback addresses */
		if (iface->flags & INT_LOOPBACK)
			continue;

		/*
		 * If we are looking to match a multicast address and
		 * this interface is one...
		 */
		if (addr_ismulticast(addr) 
		    && (iface->flags & INT_MULTICAST)) {
#ifdef INCLUDE_IPV6_SUPPORT
			/*
			 * ...it is the winner unless we're looking for
			 * an interface to use for link-local multicast
			 * and its address is not link-local.
			 */
			if (IS_IPV6(addr)
			    && IN6_IS_ADDR_MC_LINKLOCAL(PSOCK_ADDR6(addr))
			    && !IN6_IS_ADDR_LINKLOCAL(PSOCK_ADDR6(&iface->sin)))
				continue;
#endif
			break;
		}

		/*
		 * We match only those interfaces marked as
		 * broadcastable and either the explicit broadcast
		 * address or the network portion of the IP address.
		 * Sloppy.
		 */
		if (IS_IPV4(addr)) {
			if (SOCK_EQ(&iface->bcast, addr))
				break;

			if ((NSRCADR(&iface->sin) & NSRCADR(&iface->mask)) 
			    == (NSRCADR(addr)	  & NSRCADR(&iface->mask)))
				break;
		}
#ifdef INCLUDE_IPV6_SUPPORT
		else if (IS_IPV6(addr)) {
			if (SOCK_EQ(&iface->bcast, addr))
				break;

			if (SOCK_EQ(netof(&iface->sin), netof(addr)))
				break;
		}
#endif
	}
#endif /* SIOCGIFCONF */
	if (NULL == iface) {
		DPRINTF(4, ("No bcast interface found for %s\n",
			    stoa(addr)));
		iface = ANY_INTERFACE_CHOOSE(addr);
	} else
		DPRINTF(4, ("Found bcast-/mcast- interface index #%d %s\n",
			    iface->ifnum, iface->name));
	return iface;
}


/*
 * io_clr_stats - clear I/O module statistics
 */
void
io_clr_stats(void)
{
	packets_dropped = 0;
	packets_ignored = 0;
	packets_received = 0;
	packets_sent = 0;
	packets_notsent = 0;

	handler_calls = 0;
	handler_pkts = 0;
	io_timereset = current_time;
}


#ifdef REFCLOCK
/*
 * io_addclock - add a reference clock to the list and arrange that we
 *				 get SIGIO interrupts from it.
 */
int
io_addclock(
	struct refclockio *rio
	)
{
	BLOCKIO();

	/*
	 * Stuff the I/O structure in the list and mark the descriptor
	 * in use.  There is a harmless (I hope) race condition here.
	 */
	rio->next = refio;

# ifdef HAVE_SIGNALED_IO
	if (init_clock_sig(rio)) {
		UNBLOCKIO();
		return 0;
	}
# elif defined(HAVE_IO_COMPLETION_PORT)
	if (io_completion_port_add_clock_io(rio)) {
		UNBLOCKIO();
		return 0;
	}
# endif

	/*
	 * enqueue
	 */
	refio = rio;

	/*
	 * register fd
	 */
	add_fd_to_list(rio->fd, FD_TYPE_FILE);

	UNBLOCKIO();
	return 1;
}

/*
 * io_closeclock - close the clock in the I/O structure given
 */
void
io_closeclock(
	struct refclockio *rio
	)
{
	register struct refclockio *rp;

	BLOCKIO();

	/*
	 * Remove structure from the list
	 */
	if (refio == rio)
		refio = rio->next;
	else {
		for (rp = refio; rp != NULL; rp = rp->next)
			if (rp->next == rio) {
				rp->next = rio->next;
				break;
			}

		if (NULL == rp) {
			UNBLOCKIO();
			return;
		}
	}

	/*
	 * Close the descriptor.
	 */
	close_and_delete_fd_from_list(rio->fd);
	UNBLOCKIO();
}
#endif	/* REFCLOCK */

/*
 * On NT a SOCKET is an unsigned int so we cannot possibly keep it in
 * an array. So we use one of the ISC_LIST functions to hold the
 * socket value and use that when we want to enumerate it.
 *
 * This routine is called by the forked intres child process to close
 * all open sockets.  On Windows there's no need as intres runs in
 * the same process as a thread.
 */
#ifndef SYS_WINNT
void
kill_asyncio(int startfd)
{
	BLOCKIO();

	/*
	 * In the child process we do not maintain activefds and
	 * maxactivefd.  Zeroing maxactivefd disables code which
	 * maintains it in close_and_delete_fd_from_list().
	 */
	maxactivefd = 0;

	while (fd_list != NULL)
		close_and_delete_fd_from_list(fd_list->fd);

	UNBLOCKIO();
}
#endif	/* !SYS_WINNT */

/*
 * Add and delete functions for the list of open sockets
 */
static void
add_fd_to_list(
	SOCKET fd,
	enum desc_type type
	)
{
	vsock_t *lsock = emalloc(sizeof(*lsock));

	lsock->fd = fd;
	lsock->type = type;

	LINK_SLIST(fd_list, lsock, link);
	/*
	 * I/O Completion Ports don't care about the select and FD_SET
	 */
#ifndef HAVE_IO_COMPLETION_PORT
	if (fd < 0 || fd >= FD_SETSIZE) {
		msyslog(LOG_ERR,
			"Too many sockets in use, FD_SETSIZE %d exceeded",
			FD_SETSIZE);
		exit(1);
	}
	/*
	 * keep activefds in sync
	 */
	maxactivefd = max(fd, maxactivefd);

	FD_SET(fd, &activefds);
#endif
}

static void
close_and_delete_fd_from_list(
	SOCKET fd
	) 
{
	vsock_t *lsock;

	UNLINK_EXPR_SLIST(lsock, fd_list, fd == 
	    UNLINK_EXPR_SLIST_CURRENT()->fd, link, vsock_t);

	if (lsock != NULL) {
		switch (lsock->type) {
		case FD_TYPE_SOCKET:
			closesocket(lsock->fd);
			break;

		case FD_TYPE_FILE:
			close(lsock->fd);
			break;

		default:
			msyslog(LOG_ERR,
				"internal error - illegal descriptor type %d - EXITING",
				(int)lsock->type);
			exit(1);
		}

		free(lsock);
		/*
		 * I/O Completion Ports don't care about select and fd_set
		 */
#ifndef HAVE_IO_COMPLETION_PORT
		/*
		 * remove from activefds
		 */
		FD_CLR(fd, &activefds);
		
		if (fd == maxactivefd && maxactivefd) {
			int i;
			NTP_INSIST(maxactivefd - 1 < FD_SETSIZE);
			for (i = maxactivefd - 1; i >= 0; i--)
				if (FD_ISSET(i, &activefds)) {
					maxactivefd = i;
					break;
				}
			NTP_INSIST(fd != maxactivefd);
		}
#endif
	}
}

static void
add_addr_to_list(
	sockaddr_u *	addr,
	endpt *		ep
	)
{
	remaddr_t *laddr;

#ifdef DEBUG
	if (find_addr_in_list(addr) == NULL) {
#endif
		/* not there yet - add to list */
		laddr = emalloc(sizeof(*laddr));
		laddr->addr = *addr;
		laddr->ep = ep;
		
		LINK_SLIST(remoteaddr_list, laddr, link);
		
		DPRINTF(4, ("Added addr %s to list of addresses\n",
			    stoa(addr)));
#ifdef DEBUG
	} else
		DPRINTF(4, ("WARNING: Attempt to add duplicate addr %s to address list\n",
			    stoa(addr)));
#endif
}


static void
delete_addr_from_list(
	sockaddr_u *addr
	) 
{
	remaddr_t *unlinked;
	
	UNLINK_EXPR_SLIST(unlinked, remoteaddr_list, SOCK_EQ(addr,
		&(UNLINK_EXPR_SLIST_CURRENT()->addr)), link, remaddr_t);

	if (unlinked != NULL) {
		DPRINTF(4, ("Deleted addr %s from list of addresses\n",
			stoa(addr)));
		free(unlinked);
	}
}


static void
delete_interface_from_list(
	endpt *iface
	)
{
	remaddr_t *unlinked;

	do {
		UNLINK_EXPR_SLIST(unlinked, remoteaddr_list, iface ==
		    UNLINK_EXPR_SLIST_CURRENT()->ep, link,
		    remaddr_t);

		if (unlinked != NULL) {
			DPRINTF(4, ("Deleted addr %s for interface #%d %s from list of addresses\n",
				stoa(&unlinked->addr), iface->ifnum,
				iface->name));
			free(unlinked);
		}
	} while (unlinked != NULL);
}


static struct interface *
find_addr_in_list(
	sockaddr_u *addr
	) 
{
	remaddr_t *entry;
	
	DPRINTF(4, ("Searching for addr %s in list of addresses - ",
		    stoa(addr)));

	for (entry = remoteaddr_list;
	     entry != NULL;
	     entry = entry->link)
		if (SOCK_EQ(&entry->addr, addr)) {
			DPRINTF(4, ("FOUND\n"));
			return entry->ep;
		}

	DPRINTF(4, ("NOT FOUND\n"));
	return NULL;
}


/*
 * Find the given address with the all given flags set in the list
 */
static endpt *
find_flagged_addr_in_list(
	sockaddr_u *	addr,
	u_int32		flags
	)
{
	remaddr_t *entry;
	
	DPRINTF(4, ("Finding addr %s with flags %d in list: ",
		    stoa(addr), flags));

	for (entry = remoteaddr_list;
	     entry != NULL;
	     entry = entry->link)

		if (SOCK_EQ(&entry->addr, addr)
		    && (entry->ep->flags & flags) == flags) {

			DPRINTF(4, ("FOUND\n"));
			return entry->ep;
		}

	DPRINTF(4, ("NOT FOUND\n"));
	return NULL;
}


const char *
localaddrtoa(
	endpt *la
	)
{
	return (NULL == la)
		   ? ""
		   : stoa(&la->sin);
}


#ifdef HAS_ROUTING_SOCKET
# ifndef UPDATE_GRACE
#  define UPDATE_GRACE	2	/* wait UPDATE_GRACE seconds before scanning */
# endif

static void
process_routing_msgs(struct asyncio_reader *reader)
{
	char buffer[5120];
	int cnt, msg_type;
#ifdef HAVE_RTNETLINK
	struct nlmsghdr *nh;
#else
	struct rt_msghdr *rtm;
	char *p;
#endif
	
	if (disable_dynamic_updates) {
		/*
		 * discard ourselves if we are not needed any more
		 * usually happens when running unprivileged
		 */
		remove_asyncio_reader(reader);
		delete_asyncio_reader(reader);
		return;
	}

	cnt = read(reader->fd, buffer, sizeof(buffer));
	
	if (cnt < 0) {
		msyslog(LOG_ERR,
			"i/o error on routing socket %m - disabling");
		remove_asyncio_reader(reader);
		delete_asyncio_reader(reader);
		return;
	}

	/*
	 * process routing message
	 */
#ifdef HAVE_RTNETLINK
	for (nh = (struct nlmsghdr *)buffer;
	     NLMSG_OK(nh, cnt);
	     nh = NLMSG_NEXT(nh, cnt)) {
		msg_type = nh->nlmsg_type;
#else
	for (p = buffer;
	     (p + sizeof(struct rt_msghdr)) <= (buffer + cnt);
	     p += rtm->rtm_msglen) {
		rtm = (struct rt_msghdr *)p;
		if (rtm->rtm_version != RTM_VERSION) {
			msyslog(LOG_ERR,
				"version mismatch (got %d - expected %d) on routing socket - disabling",
				rtm->rtm_version, RTM_VERSION);

			remove_asyncio_reader(reader);
			delete_asyncio_reader(reader);
			return;
		}
		msg_type = rtm->rtm_type;
#endif
		switch (msg_type) {
#ifdef RTM_NEWADDR
		case RTM_NEWADDR:
#endif
#ifdef RTM_DELADDR
		case RTM_DELADDR:
#endif
#ifdef RTM_ADD
		case RTM_ADD:
#endif
#ifdef RTM_DELETE
		case RTM_DELETE:
#endif
#ifdef RTM_REDIRECT
		case RTM_REDIRECT:
#endif
#ifdef RTM_CHANGE
		case RTM_CHANGE:
#endif
#ifdef RTM_LOSING
		case RTM_LOSING:
#endif
#ifdef RTM_IFINFO
		case RTM_IFINFO:
#endif
#ifdef RTM_IFANNOUNCE
		case RTM_IFANNOUNCE:
#endif
#ifdef RTM_NEWLINK
		case RTM_NEWLINK:
#endif
#ifdef RTM_DELLINK
		case RTM_DELLINK:
#endif
#ifdef RTM_NEWROUTE
		case RTM_NEWROUTE:
#endif
#ifdef RTM_DELROUTE
		case RTM_DELROUTE:
#endif
			/*
			 * we are keen on new and deleted addresses and
			 * if an interface goes up and down or routing
			 * changes
			 */
			DPRINTF(3, ("routing message op = %d: scheduling interface update\n",
				    msg_type));
			timer_interfacetimeout(current_time + UPDATE_GRACE);
			break;
#ifdef HAVE_RTNETLINK
		case NLMSG_DONE:
			/* end of multipart message */
			return;
#endif
		default:
			/*
			 * the rest doesn't bother us.
			 */
			DPRINTF(4, ("routing message op = %d: ignored\n",
				    msg_type));
			break;
		}
	}
}

/*
 * set up routing notifications
 */
static void
init_async_notifications()
{
	struct asyncio_reader *reader;
#ifdef HAVE_RTNETLINK
	int fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
	struct sockaddr_nl sa;
#else
	int fd = socket(PF_ROUTE, SOCK_RAW, 0);
#endif
	if (fd < 0) {
		msyslog(LOG_ERR,
			"unable to open routing socket (%m) - using polled interface update");
		return;
	}

	fd = move_fd(fd);
#ifdef HAVE_RTNETLINK
	memset(&sa, 0, sizeof(sa));
	sa.nl_family = PF_NETLINK;
	sa.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR
		       | RTMGRP_IPV6_IFADDR | RTMGRP_IPV4_ROUTE
		       | RTMGRP_IPV4_MROUTE | RTMGRP_IPV6_ROUTE
		       | RTMGRP_IPV6_MROUTE;
	if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
		msyslog(LOG_ERR,
			"bind failed on routing socket (%m) - using polled interface update");
		return;
	}
#endif
	init_nonblocking_io(fd);
#if defined(HAVE_SIGNALED_IO)
	init_socket_sig(fd);
#endif /* HAVE_SIGNALED_IO */
	
	reader = new_asyncio_reader();

	reader->fd = fd;
	reader->receiver = process_routing_msgs;
	
	add_asyncio_reader(reader, FD_TYPE_SOCKET);
	msyslog(LOG_INFO,
		"Listening on routing socket on fd #%d for interface updates",
		fd);
}
#else
/* HAS_ROUTING_SOCKET not defined */
static void
init_async_notifications(void)
{
}
#endif
ntp-4.2.6p5/ntpd/refclock_neoclock4x.c0000644000175000017500000007210511313332146016645 0ustar  peterpeter/*
 *
 * Refclock_neoclock4x.c
 * - NeoClock4X driver for DCF77 or FIA Timecode
 *
 * Date: 2009-12-04 v1.16
 *
 * see http://www.linum.com/redir/jump/id=neoclock4x&action=redir
 * for details about the NeoClock4X device
 *
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#if defined(REFCLOCK) && (defined(CLOCK_NEOCLOCK4X))

#include 
#include 
#include 
#include 
#include 
#include 

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_control.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"

#if defined HAVE_SYS_MODEM_H
# include 
# ifndef __QNXNTO__
#  define TIOCMSET MCSETA
#  define TIOCMGET MCGETA
#  define TIOCM_RTS MRTS
# endif
#endif

#ifdef HAVE_TERMIOS_H
# ifdef TERMIOS_NEEDS__SVID3
#  define _SVID3
# endif
# include 
# ifdef TERMIOS_NEEDS__SVID3
#  undef _SVID3
# endif
#endif

#ifdef HAVE_SYS_IOCTL_H
# include 
#endif

/*
 * NTP version 4.20 change the pp->msec field to pp->nsec.
 * To allow to support older ntp versions with this sourcefile
 * you can define NTP_PRE_420 to allow this driver to compile
 * with ntp version back to 4.1.2.
 *
 */
#if 0
#define NTP_PRE_420
#endif

/*
 * If you want the driver for whatever reason to not use
 * the TX line to send anything to your NeoClock4X
 * device you must tell the NTP refclock driver which
 * firmware you NeoClock4X device uses.
 *
 * If you want to enable this feature change the "#if 0"
 * line to "#if 1" and make sure that the defined firmware
 * matches the firmware off your NeoClock4X receiver!
 *
 */

#if 0
#define NEOCLOCK4X_FIRMWARE                NEOCLOCK4X_FIRMWARE_VERSION_A
#endif

/* at this time only firmware version A is known */
#define NEOCLOCK4X_FIRMWARE_VERSION_A      'A'

#define NEOCLOCK4X_TIMECODELEN 37

#define NEOCLOCK4X_OFFSET_SERIAL            3
#define NEOCLOCK4X_OFFSET_RADIOSIGNAL       9
#define NEOCLOCK4X_OFFSET_DAY              12
#define NEOCLOCK4X_OFFSET_MONTH            14
#define NEOCLOCK4X_OFFSET_YEAR             16
#define NEOCLOCK4X_OFFSET_HOUR             18
#define NEOCLOCK4X_OFFSET_MINUTE           20
#define NEOCLOCK4X_OFFSET_SECOND           22
#define NEOCLOCK4X_OFFSET_HSEC             24
#define NEOCLOCK4X_OFFSET_DOW              26
#define NEOCLOCK4X_OFFSET_TIMESOURCE       28
#define NEOCLOCK4X_OFFSET_DSTSTATUS        29
#define NEOCLOCK4X_OFFSET_QUARZSTATUS      30
#define NEOCLOCK4X_OFFSET_ANTENNA1         31
#define NEOCLOCK4X_OFFSET_ANTENNA2         33
#define NEOCLOCK4X_OFFSET_CRC              35

#define NEOCLOCK4X_DRIVER_VERSION          "1.16 (2009-12-04)"

#define NSEC_TO_MILLI                      1000000

struct neoclock4x_unit {
  l_fp	laststamp;	/* last receive timestamp */
  short	unit;		/* NTP refclock unit number */
  u_long polled;	/* flag to detect noreplies */
  char	leap_status;	/* leap second flag */
  int	recvnow;

  char  firmware[80];
  char  firmwaretag;
  char  serial[7];
  char  radiosignal[4];
  char  timesource;
  char  dststatus;
  char  quarzstatus;
  int   antenna1;
  int   antenna2;
  int   utc_year;
  int   utc_month;
  int   utc_day;
  int   utc_hour;
  int   utc_minute;
  int   utc_second;
  int   utc_msec;
};

static	int	neoclock4x_start        (int, struct peer *);
static	void	neoclock4x_shutdown	(int, struct peer *);
static	void	neoclock4x_receive	(struct recvbuf *);
static	void	neoclock4x_poll		(int, struct peer *);
static	void	neoclock4x_control      (int, struct refclockstat *, struct refclockstat *, struct peer *);

static int      neol_atoi_len           (const char str[], int *, int);
static int      neol_hexatoi_len        (const char str[], int *, int);
static void     neol_jdn_to_ymd         (unsigned long, int *, int *, int *);
static void     neol_localtime          (unsigned long, int* , int*, int*, int*, int*, int*);
static unsigned long neol_mktime        (int, int, int, int, int, int);
#if !defined(NEOCLOCK4X_FIRMWARE)
static int      neol_query_firmware     (int, int, char *, int);
static int      neol_check_firmware     (int, const char*, char *);
#endif

struct refclock refclock_neoclock4x = {
  neoclock4x_start,	/* start up driver */
  neoclock4x_shutdown,	/* shut down driver */
  neoclock4x_poll,	/* transmit poll message */
  neoclock4x_control,
  noentry,		/* initialize driver (not used) */
  noentry,		/* not used */
  NOFLAGS			/* not used */
};

static int
neoclock4x_start(int unit,
		 struct peer *peer)
{
  struct neoclock4x_unit *up;
  struct refclockproc *pp;
  int fd;
  char dev[20];
  int sl232;
#if defined(HAVE_TERMIOS)
  struct termios termsettings;
#endif
#if !defined(NEOCLOCK4X_FIRMWARE)
  int tries;
#endif

  (void) snprintf(dev, sizeof(dev)-1, "/dev/neoclock4x-%d", unit);

  /* LDISC_STD, LDISC_RAW
   * Open serial port. Use CLK line discipline, if available.
   */
  fd = refclock_open(dev, B2400, LDISC_STD);
  if(fd <= 0)
    {
      return (0);
    }

#if defined(HAVE_TERMIOS)

#if 1
  if(tcgetattr(fd, &termsettings) < 0)
    {
      msyslog(LOG_CRIT, "NeoClock4X(%d): (tcgetattr) can't query serial port settings: %m", unit);
      (void) close(fd);
      return (0);
    }

  /* 2400 Baud 8N2 */
  termsettings.c_iflag = IGNBRK | IGNPAR | ICRNL;
  termsettings.c_oflag = 0;
  termsettings.c_cflag = CS8 | CSTOPB | CLOCAL | CREAD;
  (void)cfsetispeed(&termsettings, (u_int)B2400);
  (void)cfsetospeed(&termsettings, (u_int)B2400);

  if(tcsetattr(fd, TCSANOW, &termsettings) < 0)
    {
      msyslog(LOG_CRIT, "NeoClock4X(%d): (tcsetattr) can't set serial port 2400 8N2: %m", unit);
      (void) close(fd);
      return (0);
    }

#else
  if(tcgetattr(fd, &termsettings) < 0)
    {
      msyslog(LOG_CRIT, "NeoClock4X(%d): (tcgetattr) can't query serial port settings: %m", unit);
      (void) close(fd);
      return (0);
    }

  /* 2400 Baud 8N2 */
  termsettings.c_cflag &= ~PARENB;
  termsettings.c_cflag |= CSTOPB;
  termsettings.c_cflag &= ~CSIZE;
  termsettings.c_cflag |= CS8;

  if(tcsetattr(fd, TCSANOW, &termsettings) < 0)
    {
      msyslog(LOG_CRIT, "NeoClock4X(%d): (tcsetattr) can't set serial port 2400 8N2: %m", unit);
      (void) close(fd);
      return (0);
    }
#endif

#elif defined(HAVE_SYSV_TTYS)
  if(ioctl(fd, TCGETA, &termsettings) < 0)
    {
      msyslog(LOG_CRIT, "NeoClock4X(%d): (TCGETA) can't query serial port settings: %m", unit);
      (void) close(fd);
      return (0);
    }

  /* 2400 Baud 8N2 */
  termsettings.c_cflag &= ~PARENB;
  termsettings.c_cflag |= CSTOPB;
  termsettings.c_cflag &= ~CSIZE;
  termsettings.c_cflag |= CS8;

  if(ioctl(fd, TCSETA, &termsettings) < 0)
    {
      msyslog(LOG_CRIT, "NeoClock4X(%d): (TSGETA) can't set serial port 2400 8N2: %m", unit);
      (void) close(fd);
      return (0);
    }
#else
  msyslog(LOG_EMERG, "NeoClock4X(%d): don't know how to set port to 2400 8N2 with this OS!", unit);
  (void) close(fd);
  return (0);
#endif

#if defined(TIOCMSET) && (defined(TIOCM_RTS) || defined(CIOCM_RTS))
  /* turn on RTS, and DTR for power supply */
  /* NeoClock4x is powered from serial line */
  if(ioctl(fd, TIOCMGET, (caddr_t)&sl232) == -1)
    {
      msyslog(LOG_CRIT, "NeoClock4X(%d): can't query RTS/DTR state: %m", unit);
      (void) close(fd);
      return (0);
    }
#ifdef TIOCM_RTS
  sl232 = sl232 | TIOCM_DTR | TIOCM_RTS;	/* turn on RTS, and DTR for power supply */
#else
  sl232 = sl232 | CIOCM_DTR | CIOCM_RTS;	/* turn on RTS, and DTR for power supply */
#endif
  if(ioctl(fd, TIOCMSET, (caddr_t)&sl232) == -1)
    {
      msyslog(LOG_CRIT, "NeoClock4X(%d): can't set RTS/DTR to power neoclock4x: %m", unit);
      (void) close(fd);
      return (0);
    }
#else
  msyslog(LOG_EMERG, "NeoClock4X(%d): don't know how to set DTR/RTS to power NeoClock4X with this OS!",
	  unit);
  (void) close(fd);
  return (0);
#endif

  up = (struct neoclock4x_unit *) emalloc(sizeof(struct neoclock4x_unit));
  if(!(up))
    {
      msyslog(LOG_ERR, "NeoClock4X(%d): can't allocate memory for: %m",unit);
      (void) close(fd);
      return (0);
    }

  memset((char *)up, 0, sizeof(struct neoclock4x_unit));
  pp = peer->procptr;
  pp->clockdesc = "NeoClock4X";
  pp->unitptr = (caddr_t)up;
  pp->io.clock_recv = neoclock4x_receive;
  pp->io.srcclock = (caddr_t)peer;
  pp->io.datalen = 0;
  pp->io.fd = fd;
  /*
   * no fudge time is given by user!
   * use 169.583333 ms to compensate the serial line delay
   * formula is:
   * 2400 Baud / 11 bit = 218.18 charaters per second
   *  (NeoClock4X timecode len)
   */
  pp->fudgetime1 = (NEOCLOCK4X_TIMECODELEN * 11) / 2400.0;

  /*
   * Initialize miscellaneous variables
   */
  peer->precision = -10;
  peer->burst = NSTAGE;
  memcpy((char *)&pp->refid, "neol", 4);

  up->leap_status = 0;
  up->unit = unit;
  strcpy(up->firmware, "?");
  up->firmwaretag = '?';
  strcpy(up->serial, "?");
  strcpy(up->radiosignal, "?");
  up->timesource  = '?';
  up->dststatus   = '?';
  up->quarzstatus = '?';
  up->antenna1    = -1;
  up->antenna2    = -1;
  up->utc_year    = 0;
  up->utc_month   = 0;
  up->utc_day     = 0;
  up->utc_hour    = 0;
  up->utc_minute  = 0;
  up->utc_second  = 0;
  up->utc_msec    = 0;

#if defined(NEOCLOCK4X_FIRMWARE)
#if NEOCLOCK4X_FIRMWARE == NEOCLOCK4X_FIRMWARE_VERSION_A
  strcpy(up->firmware, "(c) 2002 NEOL S.A. FRANCE / L0.01 NDF:A:* (compile time)");
  up->firmwaretag = 'A';
#else
  msyslog(LOG_EMERG, "NeoClock4X(%d): unknown firmware defined at compile time for NeoClock4X",
	  unit);
  (void) close(fd);
  pp->io.fd = -1;
  free(pp->unitptr);
  pp->unitptr = NULL;
  return (0);
#endif
#else
  for(tries=0; tries < 5; tries++)
    {
      NLOG(NLOG_CLOCKINFO)
	msyslog(LOG_INFO, "NeoClock4X(%d): checking NeoClock4X firmware version (%d/5)", unit, tries);
      /* wait 3 seconds for receiver to power up */
      sleep(3);
      if(neol_query_firmware(pp->io.fd, up->unit, up->firmware, sizeof(up->firmware)))
	{
	  break;
	}
    }

  /* can I handle this firmware version? */
  if(!neol_check_firmware(up->unit, up->firmware, &up->firmwaretag))
    {
      (void) close(fd);
      pp->io.fd = -1;
      free(pp->unitptr);
      pp->unitptr = NULL;
      return (0);
    }
#endif

  if(!io_addclock(&pp->io))
    {
      msyslog(LOG_ERR, "NeoClock4X(%d): error add peer to ntpd: %m", unit);
      (void) close(fd);
      pp->io.fd = -1;
      free(pp->unitptr);
      pp->unitptr = NULL;
      return (0);
    }

  NLOG(NLOG_CLOCKINFO)
    msyslog(LOG_INFO, "NeoClock4X(%d): receiver setup successful done", unit);

  return (1);
}

static void
neoclock4x_shutdown(int unit,
		   struct peer *peer)
{
  struct neoclock4x_unit *up;
  struct refclockproc *pp;
  int sl232;

  if(NULL != peer)
    {
      pp = peer->procptr;
      if(pp != NULL)
        {
          up = (struct neoclock4x_unit *)pp->unitptr;
          if(up != NULL)
            {
              if(-1 !=  pp->io.fd)
                {
#if defined(TIOCMSET) && (defined(TIOCM_RTS) || defined(CIOCM_RTS))
                  /* turn on RTS, and DTR for power supply */
                  /* NeoClock4x is powered from serial line */
                  if(ioctl(pp->io.fd, TIOCMGET, (caddr_t)&sl232) == -1)
                    {
                      msyslog(LOG_CRIT, "NeoClock4X(%d): can't query RTS/DTR state: %m",
                              unit);
                    }
#ifdef TIOCM_RTS
                  /* turn on RTS, and DTR for power supply */
                  sl232 &= ~(TIOCM_DTR | TIOCM_RTS);
#else
                  /* turn on RTS, and DTR for power supply */
                  sl232 &= ~(CIOCM_DTR | CIOCM_RTS);
#endif
                  if(ioctl(pp->io.fd, TIOCMSET, (caddr_t)&sl232) == -1)
                    {
                      msyslog(LOG_CRIT, "NeoClock4X(%d): can't set RTS/DTR to power neoclock4x: %m",
                              unit);
                    }
#endif
                  io_closeclock(&pp->io);
                }
              free(up);
              pp->unitptr = NULL;
            }
        }
    }

  msyslog(LOG_ERR, "NeoClock4X(%d): shutdown", unit);

  NLOG(NLOG_CLOCKINFO)
    msyslog(LOG_INFO, "NeoClock4X(%d): receiver shutdown done", unit);
}

static void
neoclock4x_receive(struct recvbuf *rbufp)
{
  struct neoclock4x_unit *up;
  struct refclockproc *pp;
  struct peer *peer;
  unsigned long calc_utc;
  int day;
  int month;	/* ddd conversion */
  int c;
  int dsec;
  unsigned char calc_chksum;
  int recv_chksum;

  peer = (struct peer *)rbufp->recv_srcclock;
  pp = peer->procptr;
  up = (struct neoclock4x_unit *)pp->unitptr;

  /* wait till poll interval is reached */
  if(0 == up->recvnow)
    return;

  /* reset poll interval flag */
  up->recvnow = 0;

  /* read last received timecode */
  pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &pp->lastrec);
  pp->leap = LEAP_NOWARNING;

  if(NEOCLOCK4X_TIMECODELEN != pp->lencode)
    {
      NLOG(NLOG_CLOCKEVENT)
	msyslog(LOG_WARNING, "NeoClock4X(%d): received data has invalid length, expected %d bytes, received %d bytes: %s",
		up->unit, NEOCLOCK4X_TIMECODELEN, pp->lencode, pp->a_lastcode);
      refclock_report(peer, CEVNT_BADREPLY);
      return;
    }

  neol_hexatoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_CRC], &recv_chksum, 2);

  /* calculate checksum */
  calc_chksum = 0;
  for(c=0; c < NEOCLOCK4X_OFFSET_CRC; c++)
    {
      calc_chksum += pp->a_lastcode[c];
    }
  if(recv_chksum != calc_chksum)
    {
      NLOG(NLOG_CLOCKEVENT)
	msyslog(LOG_WARNING, "NeoClock4X(%d): received data has invalid chksum: %s",
		up->unit, pp->a_lastcode);
      refclock_report(peer, CEVNT_BADREPLY);
      return;
    }

  /* Allow synchronization even is quartz clock is
   * never initialized.
   * WARNING: This is dangerous!
   */
  up->quarzstatus = pp->a_lastcode[NEOCLOCK4X_OFFSET_QUARZSTATUS];
  if(0==(pp->sloppyclockflag & CLK_FLAG2))
    {
      if('I' != up->quarzstatus)
	{
	  NLOG(NLOG_CLOCKEVENT)
	    msyslog(LOG_NOTICE, "NeoClock4X(%d): quartz clock is not initialized: %s",
		    up->unit, pp->a_lastcode);
	  pp->leap = LEAP_NOTINSYNC;
	  refclock_report(peer, CEVNT_BADDATE);
	  return;
	}
    }
  if('I' != up->quarzstatus)
    {
      NLOG(NLOG_CLOCKEVENT)
	msyslog(LOG_NOTICE, "NeoClock4X(%d): using uninitialized quartz clock for time synchronization: %s",
		up->unit, pp->a_lastcode);
    }

  /*
   * If NeoClock4X is not synchronized to a radio clock
   * check if we're allowed to synchronize with the quartz
   * clock.
   */
  up->timesource = pp->a_lastcode[NEOCLOCK4X_OFFSET_TIMESOURCE];
  if(0==(pp->sloppyclockflag & CLK_FLAG2))
    {
      if('A' != up->timesource)
	{
	  /* not allowed to sync with quartz clock */
	  if(0==(pp->sloppyclockflag & CLK_FLAG1))
	    {
	      refclock_report(peer, CEVNT_BADTIME);
	      pp->leap = LEAP_NOTINSYNC;
	      return;
	    }
	}
    }

  /* this should only used when first install is done */
  if(pp->sloppyclockflag & CLK_FLAG4)
    {
      msyslog(LOG_DEBUG, "NeoClock4X(%d): received data: %s",
	      up->unit, pp->a_lastcode);
    }

  /* 123456789012345678901234567890123456789012345 */
  /* S/N123456DCF1004021010001202ASX1213CR\r\n */

  neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_YEAR], &pp->year, 2);
  neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_MONTH], &month, 2);
  neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_DAY], &day, 2);
  neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_HOUR], &pp->hour, 2);
  neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_MINUTE], &pp->minute, 2);
  neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_SECOND], &pp->second, 2);
  neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_HSEC], &dsec, 2);
#if defined(NTP_PRE_420)
  pp->msec = dsec * 10; /* convert 1/100s from neoclock to real miliseconds */
#else
  pp->nsec = dsec * 10 * NSEC_TO_MILLI; /* convert 1/100s from neoclock to nanoseconds */
#endif

  memcpy(up->radiosignal, &pp->a_lastcode[NEOCLOCK4X_OFFSET_RADIOSIGNAL], 3);
  up->radiosignal[3] = 0;
  memcpy(up->serial, &pp->a_lastcode[NEOCLOCK4X_OFFSET_SERIAL], 6);
  up->serial[6] = 0;
  up->dststatus = pp->a_lastcode[NEOCLOCK4X_OFFSET_DSTSTATUS];
  neol_hexatoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_ANTENNA1], &up->antenna1, 2);
  neol_hexatoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_ANTENNA2], &up->antenna2, 2);

  /*
    Validate received values at least enough to prevent internal
    array-bounds problems, etc.
  */
  if((pp->hour < 0) || (pp->hour > 23) ||
     (pp->minute < 0) || (pp->minute > 59) ||
     (pp->second < 0) || (pp->second > 60) /*Allow for leap seconds.*/ ||
     (day < 1) || (day > 31) ||
     (month < 1) || (month > 12) ||
     (pp->year < 0) || (pp->year > 99)) {
    /* Data out of range. */
    NLOG(NLOG_CLOCKEVENT)
      msyslog(LOG_WARNING, "NeoClock4X(%d): date/time out of range: %s",
	      up->unit, pp->a_lastcode);
    refclock_report(peer, CEVNT_BADDATE);
    return;
  }

  /* Year-2000 check not needed anymore. Same problem
   * will arise at 2099 but what should we do...?
   *
   * wrap 2-digit date into 4-digit
   *
   * if(pp->year < YEAR_PIVOT)
   * {
   *   pp->year += 100;
   * }
  */
  pp->year += 2000;

  /* adjust NeoClock4X local time to UTC */
  calc_utc = neol_mktime(pp->year, month, day, pp->hour, pp->minute, pp->second);
  calc_utc -= 3600;
  /* adjust NeoClock4X daylight saving time if needed */
  if('S' == up->dststatus)
    calc_utc -= 3600;
  neol_localtime(calc_utc, &pp->year, &month, &day, &pp->hour, &pp->minute, &pp->second);

  /*
    some preparations
  */
  pp->day = ymd2yd(pp->year, month, day);
  pp->leap = 0;

  if(pp->sloppyclockflag & CLK_FLAG4)
    {
      msyslog(LOG_DEBUG, "NeoClock4X(%d): calculated UTC date/time: %04d-%02d-%02d %02d:%02d:%02d.%03ld",
	      up->unit,
	      pp->year, month, day,
	      pp->hour, pp->minute, pp->second,
#if defined(NTP_PRE_420)
              pp->msec
#else
              pp->nsec/NSEC_TO_MILLI
#endif
              );
    }

  up->utc_year   = pp->year;
  up->utc_month  = month;
  up->utc_day    = day;
  up->utc_hour   = pp->hour;
  up->utc_minute = pp->minute;
  up->utc_second = pp->second;
#if defined(NTP_PRE_420)
  up->utc_msec   = pp->msec;
#else
  up->utc_msec   = pp->nsec/NSEC_TO_MILLI;
#endif

  if(!refclock_process(pp))
    {
      NLOG(NLOG_CLOCKEVENT)
	msyslog(LOG_WARNING, "NeoClock4X(%d): refclock_process failed!", up->unit);
      refclock_report(peer, CEVNT_FAULT);
      return;
    }
  refclock_receive(peer);

  /* report good status */
  refclock_report(peer, CEVNT_NOMINAL);

  record_clock_stats(&peer->srcadr, pp->a_lastcode);
}

static void
neoclock4x_poll(int unit,
		struct peer *peer)
{
  struct neoclock4x_unit *up;
  struct refclockproc *pp;

  pp = peer->procptr;
  up = (struct neoclock4x_unit *)pp->unitptr;

  pp->polls++;
  up->recvnow = 1;
}

static void
neoclock4x_control(int unit,
		   struct refclockstat *in,
		   struct refclockstat *out,
		   struct peer *peer)
{
  struct neoclock4x_unit *up;
  struct refclockproc *pp;

  if(NULL == peer)
    {
      msyslog(LOG_ERR, "NeoClock4X(%d): control: unit invalid/inactive", unit);
      return;
    }

  pp = peer->procptr;
  if(NULL == pp)
    {
      msyslog(LOG_ERR, "NeoClock4X(%d): control: unit invalid/inactive", unit);
      return;
    }

  up = (struct neoclock4x_unit *)pp->unitptr;
  if(NULL == up)
    {
      msyslog(LOG_ERR, "NeoClock4X(%d): control: unit invalid/inactive", unit);
      return;
    }

  if(NULL != in)
    {
      /* check to see if a user supplied time offset is given */
      if(in->haveflags & CLK_HAVETIME1)
	{
	  pp->fudgetime1 = in->fudgetime1;
	  NLOG(NLOG_CLOCKINFO)
	    msyslog(LOG_NOTICE, "NeoClock4X(%d): using fudgetime1 with %0.5fs from ntp.conf.",
		    unit, pp->fudgetime1);
	}

      /* notify */
      if(pp->sloppyclockflag & CLK_FLAG1)
	{
	  NLOG(NLOG_CLOCKINFO)
	    msyslog(LOG_NOTICE, "NeoClock4X(%d): quartz clock is used to synchronize time if radio clock has no reception.", unit);
	}
      else
	{
	  NLOG(NLOG_CLOCKINFO)
	    msyslog(LOG_NOTICE, "NeoClock4X(%d): time is only adjusted with radio signal reception.", unit);
	}
    }

  if(NULL != out)
    {
      char *tt;
      char tmpbuf[80];

      out->kv_list = (struct ctl_var *)0;
      out->type    = REFCLK_NEOCLOCK4X;

      snprintf(tmpbuf, sizeof(tmpbuf)-1,
	       "%04d-%02d-%02d %02d:%02d:%02d.%03d",
	       up->utc_year, up->utc_month, up->utc_day,
	       up->utc_hour, up->utc_minute, up->utc_second,
	       up->utc_msec);
      tt = add_var(&out->kv_list, sizeof(tmpbuf)-1, RO|DEF);
      snprintf(tt, sizeof(tmpbuf)-1, "calc_utc=\"%s\"", tmpbuf);

      tt = add_var(&out->kv_list, 40, RO|DEF);
      snprintf(tt, 39, "radiosignal=\"%s\"", up->radiosignal);
      tt = add_var(&out->kv_list, 40, RO|DEF);
      snprintf(tt, 39, "antenna1=\"%d\"", up->antenna1);
      tt = add_var(&out->kv_list, 40, RO|DEF);
      snprintf(tt, 39, "antenna2=\"%d\"", up->antenna2);
      tt = add_var(&out->kv_list, 40, RO|DEF);
      if('A' == up->timesource)
	snprintf(tt, 39, "timesource=\"radio\"");
      else if('C' == up->timesource)
	snprintf(tt, 39, "timesource=\"quartz\"");
      else
	snprintf(tt, 39, "timesource=\"unknown\"");
      tt = add_var(&out->kv_list, 40, RO|DEF);
      if('I' == up->quarzstatus)
	snprintf(tt, 39, "quartzstatus=\"synchronized\"");
      else if('X' == up->quarzstatus)
        snprintf(tt, 39, "quartzstatus=\"not synchronized\"");
      else
	snprintf(tt, 39, "quartzstatus=\"unknown\"");
      tt = add_var(&out->kv_list, 40, RO|DEF);
      if('S' == up->dststatus)
        snprintf(tt, 39, "dststatus=\"summer\"");
      else if('W' == up->dststatus)
        snprintf(tt, 39, "dststatus=\"winter\"");
      else
        snprintf(tt, 39, "dststatus=\"unknown\"");
      tt = add_var(&out->kv_list, 80, RO|DEF);
      snprintf(tt, 79, "firmware=\"%s\"", up->firmware);
      tt = add_var(&out->kv_list, 40, RO|DEF);
      snprintf(tt, 39, "firmwaretag=\"%c\"", up->firmwaretag);
      tt = add_var(&out->kv_list, 80, RO|DEF);
      snprintf(tt, 79, "driver version=\"%s\"", NEOCLOCK4X_DRIVER_VERSION);
      tt = add_var(&out->kv_list, 80, RO|DEF);
      snprintf(tt, 79, "serialnumber=\"%s\"", up->serial);
    }
}

static int
neol_hexatoi_len(const char str[],
		 int *result,
		 int maxlen)
{
  int hexdigit;
  int i;
  int n = 0;

  for(i=0; isxdigit((int)str[i]) && i < maxlen; i++)
    {
      hexdigit = isdigit((int)str[i]) ? toupper(str[i]) - '0' : toupper(str[i]) - 'A' + 10;
      n = 16 * n + hexdigit;
    }
  *result = n;
  return (n);
}

static int
neol_atoi_len(const char str[],
		  int *result,
		  int maxlen)
{
  int digit;
  int i;
  int n = 0;

  for(i=0; isdigit((int)str[i]) && i < maxlen; i++)
    {
      digit = str[i] - '0';
      n = 10 * n + digit;
    }
  *result = n;
  return (n);
}

/* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
 * Assumes input in normal date format, i.e. 1980-12-31 23:59:59
 * => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
 *
 * [For the Julian calendar (which was used in Russia before 1917,
 * Britain & colonies before 1752, anywhere else before 1582,
 * and is still in use by some communities) leave out the
 * -year/100+year/400 terms, and add 10.]
 *
 * This algorithm was first published by Gauss (I think).
 *
 * WARNING: this function will overflow on 2106-02-07 06:28:16 on
 * machines were long is 32-bit! (However, as time_t is signed, we
 * will already get problems at other places on 2038-01-19 03:14:08)
 */
static unsigned long
neol_mktime(int year,
	    int mon,
	    int day,
	    int hour,
	    int min,
	    int sec)
{
  if (0 >= (int) (mon -= 2)) {    /* 1..12 . 11,12,1..10 */
    mon += 12;      /* Puts Feb last since it has leap day */
    year -= 1;
  }
  return (((
            (unsigned long)(year/4 - year/100 + year/400 + 367*mon/12 + day) +
            year*365 - 719499
            )*24 + hour /* now have hours */
           )*60 + min /* now have minutes */
          )*60 + sec; /* finally seconds */
}

static void
neol_localtime(unsigned long utc,
	       int* year,
	       int* month,
	       int* day,
	       int* hour,
	       int* min,
	       int* sec)
{
  *sec = utc % 60;
  utc /= 60;
  *min = utc % 60;
  utc /= 60;
  *hour = utc % 24;
  utc /= 24;

  /*             JDN Date 1/1/1970 */
  neol_jdn_to_ymd(utc + 2440588L, year, month, day);
}

static void
neol_jdn_to_ymd(unsigned long jdn,
		int *yy,
		int *mm,
		int *dd)
{
  unsigned long x, z, m, d, y;
  unsigned long daysPer400Years = 146097UL;
  unsigned long fudgedDaysPer4000Years = 1460970UL + 31UL;

  x = jdn + 68569UL;
  z = 4UL * x / daysPer400Years;
  x = x - (daysPer400Years * z + 3UL) / 4UL;
  y = 4000UL * (x + 1) / fudgedDaysPer4000Years;
  x = x - 1461UL * y / 4UL + 31UL;
  m = 80UL * x / 2447UL;
  d = x - 2447UL * m / 80UL;
  x = m / 11UL;
  m = m + 2UL - 12UL * x;
  y = 100UL * (z - 49UL) + y + x;

  *yy = (int)y;
  *mm = (int)m;
  *dd = (int)d;
}

#if !defined(NEOCLOCK4X_FIRMWARE)
static int
neol_query_firmware(int fd,
		    int unit,
		    char *firmware,
		    int maxlen)
{
  char tmpbuf[256];
  int len;
  int lastsearch;
  unsigned char c;
  int last_c_was_crlf;
  int last_crlf_conv_len;
  int init;
  int read_errors;
  int flag = 0;
  int chars_read;

  /* wait a little bit */
  sleep(1);
  if(-1 != write(fd, "V", 1))
    {
      /* wait a little bit */
      sleep(1);
      memset(tmpbuf, 0x00, sizeof(tmpbuf));

      len = 0;
      lastsearch = 0;
      last_c_was_crlf = 0;
      last_crlf_conv_len = 0;
      init = 1;
      read_errors = 0;
      chars_read = 0;
      for(;;)
	{
	  if(read_errors > 5)
	    {
	      msyslog(LOG_ERR, "NeoClock4X(%d): can't read firmware version (timeout)", unit);
	      strcpy(tmpbuf, "unknown due to timeout");
	      break;
	    }
          if(chars_read > 500)
            {
	      msyslog(LOG_ERR, "NeoClock4X(%d): can't read firmware version (garbage)", unit);
	      strcpy(tmpbuf, "unknown due to garbage input");
	      break;
            }
	  if(-1 == read(fd, &c, 1))
	    {
              if(EAGAIN != errno)
                {
                  msyslog(LOG_DEBUG, "NeoClock4x(%d): read: %s", unit ,strerror(errno));
                  read_errors++;
                }
              else
                {
                  sleep(1);
                }
	      continue;
	    }
          else
            {
              chars_read++;
            }

	  if(init)
	    {
	      if(0xA9 != c) /* wait for (c) char in input stream */
		continue;

	      strcpy(tmpbuf, "(c)");
	      len = 3;
	      init = 0;
	      continue;
	    }

#if 0
	  msyslog(LOG_NOTICE, "NeoClock4X(%d): firmware %c = %02Xh", unit, c, c);
#endif

	  if(0x0A == c || 0x0D == c)
	    {
	      if(last_c_was_crlf)
		{
		  char *ptr;
		  ptr = strstr(&tmpbuf[lastsearch], "S/N");
		  if(NULL != ptr)
		    {
		      tmpbuf[last_crlf_conv_len] = 0;
		      flag = 1;
		      break;
		    }
		  /* convert \n to / */
		  last_crlf_conv_len = len;
		  tmpbuf[len++] = ' ';
		  tmpbuf[len++] = '/';
		  tmpbuf[len++] = ' ';
		  lastsearch = len;
		}
	      last_c_was_crlf = 1;
	    }
	  else
	    {
	      last_c_was_crlf = 0;
	      if(0x00 != c)
		tmpbuf[len++] = (char) c;
	    }
	  tmpbuf[len] = '\0';
	  if(len > sizeof(tmpbuf)-5)
	    break;
	}
    }
  else
    {
      msyslog(LOG_ERR, "NeoClock4X(%d): can't query firmware version", unit);
      strcpy(tmpbuf, "unknown error");
    }
  strncpy(firmware, tmpbuf, maxlen);
  firmware[maxlen] = '\0';

  if(flag)
    {
      NLOG(NLOG_CLOCKINFO)
	msyslog(LOG_INFO, "NeoClock4X(%d): firmware version: %s", unit, firmware);

      if(strstr(firmware, "/R2"))
	{
	  msyslog(LOG_INFO, "NeoClock4X(%d): Your NeoClock4X uses the new R2 firmware release. Please note the changed LED behaviour.", unit);
	}

    }

  return (flag);
}

static int
neol_check_firmware(int unit,
                    const char *firmware,
                    char *firmwaretag)
{
  char *ptr;

  *firmwaretag = '?';
  ptr = strstr(firmware, "NDF:");
  if(NULL != ptr)
    {
      if((strlen(firmware) - strlen(ptr)) >= 7)
        {
          if(':' == *(ptr+5) && '*' == *(ptr+6))
            *firmwaretag = *(ptr+4);
        }
    }

  if('A' != *firmwaretag)
    {
      msyslog(LOG_CRIT, "NeoClock4X(%d): firmware version \"%c\" not supported with this driver version!", unit, *firmwaretag);
      return (0);
    }

  return (1);
}
#endif

#else
int refclock_neoclock4x_bs;
#endif /* REFCLOCK */

/*
 * History:
 * refclock_neoclock4x.c
 *
 * 2002/04/27 cjh
 * Revision 1.0  first release
 *
 * 2002/07/15 cjh
 * preparing for bitkeeper reposity
 *
 * 2002/09/09 cjh
 * Revision 1.1
 * - don't assume sprintf returns an int anymore
 * - change the way the firmware version is read
 * - some customers would like to put a device called
 *   data diode to the NeoClock4X device to disable
 *   the write line. We need to now the firmware
 *   version even in this case. We made a compile time
 *   definition in this case. The code was previously
 *   only available on request.
 *
 * 2003/01/08 cjh
 * Revision 1.11
 * - changing xprinf to xnprinf to avoid buffer overflows
 * - change some logic
 * - fixed memory leaks if drivers can't initialize
 *
 * 2003/01/10 cjh
 * Revision 1.12
 * - replaced ldiv
 * - add code to support FreeBSD
 *
 * 2003/07/07 cjh
 * Revision 1.13
 * - fix reporting of clock status
 *   changes. previously a bad clock
 *   status was never reset.
 *
 * 2004/04/07 cjh
 * Revision 1.14
 * - open serial port in a way
 *   AIX and some other OS can
 *   handle much better
 *
 * 2006/01/11 cjh
 * Revision 1.15
 * - remove some unsued #ifdefs
 * - fix nsec calculation, closes #499
 *
 * 2009/12/04 cjh
 * Revision 1.16
 * - change license to ntp COPYRIGHT notice. This should allow Debian
 *   to add this refclock driver in further releases.
 * - detect R2 hardware
 *
 */






ntp-4.2.6p5/ntpd/refclock_true.c0000644000175000017500000005304511455531713015565 0ustar  peterpeter/*
 * refclock_true - clock driver for the Kinemetrics Truetime receivers
 *	Receiver Version 3.0C - tested plain, with CLKLDISC
 *	Developement work being done:
 * 	- Properly handle varying satellite positions (more acurately)
 *	- Integrate GPSTM and/or OMEGA and/or TRAK and/or ??? drivers
 */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_TRUETIME)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"

#include 
#include 

#ifdef SYS_WINNT
extern int async_write(int, const void *, unsigned int);
#undef write
#define write(fd, data, octets)	async_write(fd, data, octets)
#endif

/* This should be an atom clock but those are very hard to build.
 *
 * The PCL720 from P C Labs has an Intel 8253 lookalike, as well as a bunch
 * of TTL input and output pins, all brought out to the back panel.  If you
 * wire a PPS signal (such as the TTL PPS coming out of a GOES or other
 * Kinemetrics/Truetime clock) to the 8253's GATE0, and then also wire the
 * 8253's OUT0 to the PCL720's INPUT3.BIT0, then we can read CTR0 to get the
 * number of uSecs since the last PPS upward swing, mediated by reading OUT0
 * to find out if the counter has wrapped around (this happens if more than
 * 65535us (65ms) elapses between the PPS event and our being called.)
 */
#ifdef CLOCK_PPS720
# undef min	/* XXX */
# undef max	/* XXX */
# include 
# include 
# include 
# define PCL720_IOB 0x2a0	/* XXX */
# define PCL720_CTR 0		/* XXX */
#endif

/*
 * Support for Kinemetrics Truetime Receivers
 *	GOES
 *	GPS/TM-TMD
 *	XL-DC		(a 151-602-210, reported by the driver as a GPS/TM-TMD)
 *	GPS-800 TCU	(an 805-957 with the RS232 Talker/Listener module)
 *	OM-DC:		getting stale ("OMEGA")
 *
 * Most of this code is originally from refclock_wwvb.c with thanks.
 * It has been so mangled that wwvb is not a recognizable ancestor.
 *
 * Timcode format: ADDD:HH:MM:SSQCL
 *	A - control A		(this is stripped before we see it)
 *	Q - Quality indication	(see below)
 *	C - Carriage return
 *	L - Line feed
 *
 * Quality codes indicate possible error of
 *   468-DC GOES Receiver:
 *   GPS-TM/TMD Receiver: (default quality codes for XL-DC)
 *       ?     +/- 1  milliseconds	#     +/- 100 microseconds
 *       *     +/- 10 microseconds	.     +/- 1   microsecond
 *     space   less than 1 microsecond
 *   OM-DC OMEGA Receiver: (default quality codes for OMEGA)
 *   WARNING OMEGA navigation system is no longer existent
 *       >     >+- 5 seconds
 *       ?     >+/- 500 milliseconds    #     >+/- 50 milliseconds
 *       *     >+/- 5 milliseconds      .     >+/- 1 millisecond
 *      A-H    less than 1 millisecond.  Character indicates which station
 *             is being received as follows:
 *             A = Norway, B = Liberia, C = Hawaii, D = North Dakota,
 *             E = La Reunion, F = Argentina, G = Australia, H = Japan.
 *
 * The carriage return start bit begins on 0 seconds and extends to 1 bit time.
 *
 * Notes on 468-DC and OMEGA receiver:
 *
 * Send the clock a 'R' or 'C' and once per second a timestamp will
 * appear.  Send a 'P' to get the satellite position once (GOES only.)
 *
 * Notes on the 468-DC receiver:
 *
 * Since the old east/west satellite locations are only historical, you can't
 * set your clock propagation delay settings correctly and still use
 * automatic mode. The manual says to use a compromise when setting the
 * switches. This results in significant errors. The solution; use fudge
 * time1 and time2 to incorporate corrections. If your clock is set for
 * 50 and it should be 58 for using the west and 46 for using the east,
 * use the line
 *
 * fudge 127.127.5.0 time1 +0.008 time2 -0.004
 *
 * This corrects the 4 milliseconds advance and 8 milliseconds retard
 * needed. The software will ask the clock which satellite it sees.
 *
 * Ntp.conf parameters:
 * time1 - offset applied to samples when reading WEST satellite (default = 0)
 * time2 - offset applied to samples when reading EAST satellite (default = 0)
 * val1  - stratum to assign to this clock (default = 0)
 * val2  - refid assigned to this clock (default = "TRUE", see below)
 * flag1 - will silence the clock side of ntpd, just reading the clock
 *         without trying to write to it.  (default = 0)
 * flag2 - generate a debug file /tmp/true%d.
 * flag3 - enable ppsclock streams module
 * flag4 - use the PCL-720 (BSD/OS only)
 */


/*
 * Definitions
 */
#define	DEVICE		"/dev/true%d"
#define	SPEED232	B9600	/* 9600 baud */

/*
 * Radio interface parameters
 */
#define	PRECISION	(-10)	/* precision assumed (about 1 ms) */
#define	REFID		"TRUE"	/* reference id */
#define	DESCRIPTION	"Kinemetrics/TrueTime Receiver"

/*
 * Tags which station (satellite) we see
 */
#define GOES_WEST	0	/* Default to WEST satellite and apply time1 */
#define GOES_EAST	1	/* until you discover otherwise */

/*
 * used by the state machine
 */
enum true_event	{e_Init, e_Huh, e_F18, e_F50, e_F51, e_Satellite,
		 e_Poll, e_Location, e_TS, e_Max};
const char *events[] = {"Init", "Huh", "F18", "F50", "F51", "Satellite",
			"Poll", "Location", "TS"};
#define eventStr(x) (((int)x<(int)e_Max) ? events[(int)x] : "?")

enum true_state	{s_Base, s_InqTM, s_InqTCU, s_InqOmega, s_InqGOES,
		 s_Init, s_F18, s_F50, s_Start, s_Auto, s_Max};
const char *states[] = {"Base", "InqTM", "InqTCU", "InqOmega", "InqGOES",
			"Init", "F18", "F50", "Start", "Auto"};
#define stateStr(x) (((int)x<(int)s_Max) ? states[(int)x] : "?")

enum true_type	{t_unknown, t_goes, t_tm, t_tcu, t_omega, t_Max};
const char *types[] = {"unknown", "goes", "tm", "tcu", "omega"};
#define typeStr(x) (((int)x<(int)t_Max) ? types[(int)x] : "?")

/*
 * unit control structure
 */
struct true_unit {
	unsigned int	pollcnt;	/* poll message counter */
	unsigned int	station;	/* which station we are on */
	unsigned int	polled;		/* Hand in a time sample? */
	enum true_state	state;		/* state machine */
	enum true_type	type;		/* what kind of clock is it? */
	int		unit;		/* save an extra copy of this */
	FILE		*debug;		/* debug logging file */
#ifdef CLOCK_PPS720
	int		pcl720init;	/* init flag for PCL 720 */
#endif
};

/*
 * Function prototypes
 */
static	int	true_start	(int, struct peer *);
static	void	true_shutdown	(int, struct peer *);
static	void	true_receive	(struct recvbuf *);
static	void	true_poll	(int, struct peer *);
static	void	true_send	(struct peer *, const char *);
static	void	true_doevent	(struct peer *, enum true_event);

#ifdef CLOCK_PPS720
static	u_long	true_sample720	(void);
#endif

/*
 * Transfer vector
 */
struct	refclock refclock_true = {
	true_start,		/* start up driver */
	true_shutdown,		/* shut down driver */
	true_poll,		/* transmit poll message */
	noentry,		/* not used (old true_control) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old true_buginfo) */
	NOFLAGS			/* not used */
};


#if !defined(__STDC__)
# define true_debug (void)
#else
static void
true_debug(struct peer *peer, const char *fmt, ...)
{
	va_list ap;
	int want_debugging, now_debugging;
	struct refclockproc *pp;
	struct true_unit *up;

	va_start(ap, fmt);
	pp = peer->procptr;
	up = (struct true_unit *)pp->unitptr;

	want_debugging = (pp->sloppyclockflag & CLK_FLAG2) != 0;
	now_debugging = (up->debug != NULL);
	if (want_debugging != now_debugging)
	{
		if (want_debugging) {
		    char filename[40];
		    int fd;

		    snprintf(filename, sizeof(filename), "/tmp/true%d.debug", up->unit);
		    fd = open(filename, O_CREAT | O_WRONLY | O_EXCL, 0600);
		    if (fd >= 0 && (up->debug = fdopen(fd, "r+"))) {
#ifdef HAVE_SETVBUF
			    static char buf[BUFSIZ];
			    setvbuf(up->debug, buf, _IOLBF, BUFSIZ);
#else
			    setlinebuf(up->debug);
#endif
		    }
	    } else {
		    fclose(up->debug);
		    up->debug = NULL;
	    }
	}

	if (up->debug) {
		fprintf(up->debug, "true%d: ", up->unit);
		vfprintf(up->debug, fmt, ap);
	}
	va_end(ap);
}
#endif /*STDC*/

/*
 * true_start - open the devices and initialize data for processing
 */
static int
true_start(
	int unit,
	struct peer *peer
	)
{
	register struct true_unit *up;
	struct refclockproc *pp;
	char device[40];
	int fd;

	/*
	 * Open serial port
	 */
	(void)snprintf(device, sizeof(device), DEVICE, unit);
	if (!(fd = refclock_open(device, SPEED232, LDISC_CLK)))
	    return (0);

	/*
	 * Allocate and initialize unit structure
	 */
	if (!(up = (struct true_unit *)
	      emalloc(sizeof(struct true_unit)))) {
		(void) close(fd);
		return (0);
	}
	memset((char *)up, 0, sizeof(struct true_unit));
	pp = peer->procptr;
	pp->io.clock_recv = true_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		(void) close(fd);
		free(up);
		return (0);
	}
	pp->unitptr = (caddr_t)up;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	up->pollcnt = 2;
	up->type = t_unknown;
	up->state = s_Base;

	/*
	 * Send a CTRL-C character at the start,
	 * just in case the clock is already
	 * sending timecodes
	 */
	true_send(peer, "\03\r");
	
	true_doevent(peer, e_Init);

	return (1);
}

/*
 * true_shutdown - shut down the clock
 */
static void
true_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct true_unit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct true_unit *)pp->unitptr;
	io_closeclock(&pp->io);
	free(up);
}


/*
 * true_receive - receive data from the serial interface on a clock
 */
static void
true_receive(
	struct recvbuf *rbufp
	)
{
	register struct true_unit *up;
	struct refclockproc *pp;
	struct peer *peer;
	u_short new_station;
	char synced;
	int i;
	int lat, lon, off;	/* GOES Satellite position */
        /* Use these variable to hold data until we decide its worth keeping */
        char    rd_lastcode[BMAX];
        l_fp    rd_tmp;
        u_short rd_lencode;

	/*
	 * Get the clock this applies to and pointers to the data.
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct true_unit *)pp->unitptr;

	/*
	 * Read clock output.  Automatically handles STREAMS, CLKLDISC.
	 */
        rd_lencode = refclock_gtlin(rbufp, rd_lastcode, BMAX, &rd_tmp);
        rd_lastcode[rd_lencode] = '\0';

	/*
	 * There is a case where  generates 2 timestamps.
	 */
        if (rd_lencode == 0)
            return;
        pp->lencode = rd_lencode;
        strcpy(pp->a_lastcode, rd_lastcode);
        pp->lastrec = rd_tmp;
	true_debug(peer, "receive(%s) [%d]\n", pp->a_lastcode, pp->lencode);

	up->pollcnt = 2;
	record_clock_stats(&peer->srcadr, pp->a_lastcode);

	/*
	 * We get down to business, check the timecode format and decode
	 * its contents. This code decodes a multitude of different
	 * clock messages. Timecodes are processed if needed. All replies
	 * will be run through the state machine to tweak driver options
	 * and program the clock.
	 */

	/*
	 * Clock misunderstood our last command?
	 */
	if (pp->a_lastcode[0] == '?' ||
	    strcmp(pp->a_lastcode, "ERROR 05 NO SUCH FUNCTION") == 0) {
		true_doevent(peer, e_Huh);
		return;
	}

	/*
	 * Timecode: "nnnnn+nnn-nnn"
	 * (from GOES clock when asked about satellite position)
	 */
	if ((pp->a_lastcode[5] == '+' || pp->a_lastcode[5] == '-') &&
	    (pp->a_lastcode[9] == '+' || pp->a_lastcode[9] == '-') &&
	    sscanf(pp->a_lastcode, "%5d%*c%3d%*c%3d", &lon, &lat, &off) == 3
	    ) {
		const char *label = "Botch!";

		/*
		 * This is less than perfect.  Call the (satellite)
		 * either EAST or WEST and adjust slop accodingly
		 * Perfectionists would recalculate the exact delay
		 * and adjust accordingly...
		 */
		if (lon > 7000 && lon < 14000) {
			if (lon < 10000) {
				new_station = GOES_EAST;
				label = "EAST";
			} else {
				new_station = GOES_WEST;
				label = "WEST";
			}
				
			if (new_station != up->station) {
				double dtemp;

				dtemp = pp->fudgetime1;
				pp->fudgetime1 = pp->fudgetime2;
				pp->fudgetime2 = dtemp;
				up->station = new_station;
			}
		}
		else {
			/*refclock_report(peer, CEVNT_BADREPLY);*/
			label = "UNKNOWN";
		}
		true_debug(peer, "GOES: station %s\n", label);
		true_doevent(peer, e_Satellite);
		return;
	}

	/*
	 * Timecode: "Fnn"
	 * (from TM/TMD clock when it wants to tell us what it's up to.)
	 */
	if (sscanf(pp->a_lastcode, "F%2d", &i) == 1 && i > 0 && i < 80) {
		switch (i) {
		    case 50:
			true_doevent(peer, e_F50);
			break;
		    case 51:
			true_doevent(peer, e_F51);
			break;
		    default:
			true_debug(peer, "got F%02d - ignoring\n", i);
			break;
		}
		return;
	}

	/*
	 * Timecode: " TRUETIME Mk III" or " TRUETIME XL"
	 * (from a TM/TMD/XL clock during initialization.)
	 */
	if (strcmp(pp->a_lastcode, " TRUETIME Mk III") == 0 ||
	    strncmp(pp->a_lastcode, " TRUETIME XL", 12) == 0) {
		true_doevent(peer, e_F18);
		NLOG(NLOG_CLOCKSTATUS) {
			msyslog(LOG_INFO, "TM/TMD/XL: %s", pp->a_lastcode);
		}
		return;
	}

	/*
	 * Timecode: "N03726428W12209421+000033"
	 *                      1         2
	 *            0123456789012345678901234
	 * (from a TCU during initialization)
	 */
	if ((pp->a_lastcode[0] == 'N' || pp->a_lastcode[0] == 'S') &&
	    (pp->a_lastcode[9] == 'W' || pp->a_lastcode[9] == 'E') &&
	    pp->a_lastcode[18] == '+') {
		true_doevent(peer, e_Location);
		NLOG(NLOG_CLOCKSTATUS) {
			msyslog(LOG_INFO, "TCU-800: %s", pp->a_lastcode);
		}
		return;
	}
	/*
	 * Timecode: "ddd:hh:mm:ssQ"
	 * (from all clocks supported by this driver.)
	 */
	if (pp->a_lastcode[3] == ':' &&
	    pp->a_lastcode[6] == ':' &&
	    pp->a_lastcode[9] == ':' &&
	    sscanf(pp->a_lastcode, "%3d:%2d:%2d:%2d%c",
		   &pp->day, &pp->hour, &pp->minute,
		   &pp->second, &synced) == 5) {

		/*
		 * Adjust the synchronize indicator according to timecode
		 * say were OK, and then say not if we really are not OK
		 */
		if (synced == '>' || synced == '#' || synced == '?'
		    || synced == 'X')
		    pp->leap = LEAP_NOTINSYNC;
		else
                    pp->leap = LEAP_NOWARNING;

		true_doevent(peer, e_TS);

#ifdef CLOCK_PPS720
		/* If it's taken more than 65ms to get here, we'll lose. */
		if ((pp->sloppyclockflag & CLK_FLAG4) && up->pcl720init) {
			l_fp   off;

#ifdef CLOCK_ATOM
			/*
			 * find out what time it really is. Include
			 * the count from the PCL720
			 */
			if (!clocktime(pp->day, pp->hour, pp->minute, 
				       pp->second, GMT, pp->lastrec.l_ui, 
				       &pp->yearstart, &off.l_ui)) {
				refclock_report(peer, CEVNT_BADTIME);
				return;
			}
			off.l_uf = 0;
#endif

			pp->usec = true_sample720();
#ifdef CLOCK_ATOM
			TVUTOTSF(pp->usec, off.l_uf);
#endif

			/*
			 * Stomp all over the timestamp that was pulled out
			 * of the input stream. It's irrelevant since we've
			 * adjusted the input time to reflect now (via pp->usec)
			 * rather than when the data was collected.
			 */
			get_systime(&pp->lastrec);
#ifdef CLOCK_ATOM
			/*
			 * Create a true offset for feeding to pps_sample()
			 */
			L_SUB(&off, &pp->lastrec);

			pps_sample(peer, &off);
#endif
			true_debug(peer, "true_sample720: %luus\n", pp->usec);
		}
#endif

		/*
		 * The clock will blurt a timecode every second but we only
		 * want one when polled.  If we havn't been polled, bail out.
		 */
		if (!up->polled)
		    return;

		true_doevent(peer, e_Poll);
		if (!refclock_process(pp)) {
			refclock_report(peer, CEVNT_BADTIME);
			return;
		}
		/*
		 * If clock is good we send a NOMINAL message so that
		 * any previous BAD messages are nullified
		 */
                pp->lastref = pp->lastrec;
		refclock_receive(peer);
		refclock_report(peer, CEVNT_NOMINAL);

		/*
		 * We have succedded in answering the poll.
		 * Turn off the flag and return
		 */
		up->polled = 0;

		return;
	}

	/*
	 * No match to known timecodes, report failure and return
	 */
	refclock_report(peer, CEVNT_BADREPLY);
	return;
}


/*
 * true_send - time to send the clock a signal to cough up a time sample
 */
static void
true_send(
	struct peer *peer,
	const char *cmd
	)
{
	struct refclockproc *pp;

	pp = peer->procptr;
	if (!(pp->sloppyclockflag & CLK_FLAG1)) {
		register int len = strlen(cmd);

		true_debug(peer, "Send '%s'\n", cmd);
		if (write(pp->io.fd, cmd, (unsigned)len) != len)
		    refclock_report(peer, CEVNT_FAULT);
		else
		    pp->polls++;
	}
}


/*
 * state machine for initializing and controlling a clock
 */
static void
true_doevent(
	struct peer *peer,
	enum true_event event
	)
{
	struct true_unit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct true_unit *)pp->unitptr;
	if (event != e_TS) {
		NLOG(NLOG_CLOCKSTATUS) {
			msyslog(LOG_INFO, "TRUE: clock %s, state %s, event %s",
				typeStr(up->type),
				stateStr(up->state),
				eventStr(event));
		}
	}
	true_debug(peer, "clock %s, state %s, event %s\n",
		   typeStr(up->type), stateStr(up->state), eventStr(event));
	switch (up->type) {
	    case t_goes:
		switch (event) {
		    case e_Init:	/* FALLTHROUGH */
		    case e_Satellite:
			/*
			 * Switch back to on-second time codes and return.
			 */
			true_send(peer, "C");
			up->state = s_Start;
			break;
		    case e_Poll:
			/*
			 * After each poll, check the station (satellite).
			 */
			true_send(peer, "P");
			/* No state change needed. */
			break;
		    default:
			break;
		}
		/* FALLTHROUGH */
	    case t_omega:
		switch (event) {
		    case e_Init:
			true_send(peer, "C");
			up->state = s_Start;
			break;
		    case e_TS:
			if (up->state != s_Start && up->state != s_Auto) {
				true_send(peer, "\03\r");
				break;
			}
			up->state = s_Auto;
			break;
		    default:
			break;
		}
		break;
	    case t_tm:
		switch (event) {
		    case e_Init:
			true_send(peer, "F18\r");
			up->state = s_Init;
			break;
		    case e_F18:
			true_send(peer, "F50\r");
			up->state = s_F18;
			break;
		    case e_F50:
			true_send(peer, "F51\r");
			up->state = s_F50;
			break;
		    case e_F51:
			true_send(peer, "F08\r");
			up->state = s_Start;
			break;
		    case e_TS:
			if (up->state != s_Start && up->state != s_Auto) {
				true_send(peer, "\03\r");
				break;
			}
			up->state = s_Auto;
			break;
		    default:
			break;
		}
		break;
	    case t_tcu:
		switch (event) {
		    case e_Init:
			true_send(peer, "MD3\r");	/* GPS Synch'd Gen. */
			true_send(peer, "TSU\r");	/* UTC, not GPS. */
			true_send(peer, "AU\r");	/* Auto Timestamps. */
			up->state = s_Start;
			break;
		    case e_TS:
			if (up->state != s_Start && up->state != s_Auto) {
				true_send(peer, "\03\r");
				break;
			}
			up->state = s_Auto;
			break;
		    default:
			break;
		}
		break;
	    case t_unknown:
		switch (up->state) {
		    case s_Base:
			if (event != e_Init)
			    abort();
			true_send(peer, "P\r");
			up->state = s_InqGOES;
			break;
		    case s_InqGOES:
			switch (event) {
			    case e_Satellite:
				up->type = t_goes;
				true_doevent(peer, e_Init);
				break;
			    case e_Init:	/*FALLTHROUGH*/
			    case e_Huh:	/*FALLTHROUGH*/
			    case e_TS:
				up->state = s_InqOmega;
				true_send(peer, "C\r");
				break;
			    default:
				abort();
			}
			break;
		    case s_InqOmega:
			switch (event) {
			    case e_TS:
				up->type = t_omega;
				up->state = s_Auto;	/* Inq side-effect. */
				break;
			    case e_Init:	/*FALLTHROUGH*/
			    case e_Huh:
				up->state = s_InqTM;
				true_send(peer, "F18\r");
				break;
			    default:
				abort();
			}
			break;
		    case s_InqTM:
			switch (event) {
			    case e_F18:
				up->type = t_tm;
				true_doevent(peer, e_Init);
				break;
			    case e_Init:	/*FALLTHROUGH*/
			    case e_Huh:
				true_send(peer, "PO\r");
				up->state = s_InqTCU;
				break;
			    default:
				abort();
			}
			break;
		    case s_InqTCU:
			switch (event) {
			    case e_Location:
				up->type = t_tcu;
				true_doevent(peer, e_Init);
				break;
			    case e_Init:	/*FALLTHROUGH*/
			    case e_Huh:
				up->state = s_Base;
				sleep(1);	/* XXX */
				break;
			    default:
				abort();
			}
			break;
			/*
			 * An expedient hack to prevent lint complaints,
			 * these don't actually need to be used here...
			 */
		    case s_Init:
		    case s_F18:
		    case s_F50:
		    case s_Start:
		    case s_Auto:
		    case s_Max:
			msyslog(LOG_INFO, "TRUE: state %s is unexpected!", stateStr(up->state));
		}
		break;
	    default:
		abort();
		/* NOTREACHED */
	}

#ifdef CLOCK_PPS720
	if ((pp->sloppyclockflag & CLK_FLAG4) && !up->pcl720init) {
		/* Make counter trigger on gate0, count down from 65535. */
		pcl720_load(PCL720_IOB, PCL720_CTR, i8253_oneshot, 65535);
		/*
		 * (These constants are OK since
		 * they represent hardware maximums.)
		 */
		NLOG(NLOG_CLOCKINFO) {
			msyslog(LOG_NOTICE, "PCL-720 initialized");
		}
		up->pcl720init++;
	}
#endif


}

/*
 * true_poll - called by the transmit procedure
 */
static void
true_poll(
	int unit,
	struct peer *peer
	)
{
	struct true_unit *up;
	struct refclockproc *pp;

	/*
	 * You don't need to poll this clock.  It puts out timecodes
	 * once per second.  If asked for a timestamp, take note.
	 * The next time a timecode comes in, it will be fed back.
	 */
	pp = peer->procptr;
	up = (struct true_unit *)pp->unitptr;
	if (up->pollcnt > 0)
	    up->pollcnt--;
	else {
		true_doevent(peer, e_Init);
		refclock_report(peer, CEVNT_TIMEOUT);
	}

	/*
	 * polled every 64 seconds. Ask true_receive to hand in a
	 * timestamp.
	 */
	up->polled = 1;
	pp->polls++;
}

#ifdef CLOCK_PPS720
/*
 * true_sample720 - sample the PCL-720
 */
static u_long
true_sample720(void)
{
	unsigned long f;

	/* We wire the PCL-720's 8253.OUT0 to bit 0 of connector 3.
	 * If it is not being held low now, we did not get called
	 * within 65535us.
	 */
	if (inb(pcl720_data_16_23(PCL720_IOB)) & 0x01) {
		NLOG(NLOG_CLOCKINFO) {
			msyslog(LOG_NOTICE, "PCL-720 out of synch");
		}
		return (0);
	}
	f = (65536 - pcl720_read(PCL720_IOB, PCL720_CTR));
#ifdef PPS720_DEBUG
	msyslog(LOG_DEBUG, "PCL-720: %luus", f);
#endif
	return (f);
}
#endif

#else
int refclock_true_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/check_y2k.c0000644000175000017500000003745610017034563014602 0ustar  peterpeter/* check_y2k.c -- test ntp code constructs for Y2K correctness 	Y2KFixes [*/

  /*
	Code invoked by `make check`. Not part of ntpd and not to be
	installed.

	On any code I even wonder about, I've cut and pasted the code
	here and ran it as a test case just to be sure.

	For code not in "ntpd" proper, we have tried to call most 
	repaired functions from herein to properly test them
	(something never done before!). This has found several bugs,
	not normal Y2K bugs, that will strike in Y2K so repair them
	we did.

	Program exits with 0 on success, 1 on Y2K failure (stdout messages).
	Exit of 2 indicates internal logic bug detected OR failure of
	what should be our correct formulas.

	While "make check" should only check logic for source within that
	specific directory, this check goes outside the scope of the local
	directory.  It's not a perfect world (besides, there is a lot of
	interdependence here, and it really needs to be tested in
	a controled order).
   */

/* { definitions lifted from ntpd.c to allow us to complie with 
     "#include ntp.h".  I have not taken the time to reduce the clutter. */

#ifdef HAVE_CONFIG_H
# include 
#endif

#include "ntpd.h"

#ifdef HAVE_UNISTD_H
# include 
#endif
#ifdef HAVE_SYS_STAT_H
# include 
#endif
#include 
#include 
#ifndef SYS_WINNT
# if !defined(VMS)	/*wjm*/
#  include 
# endif /* VMS */
# if HAVE_SYS_SIGNAL_H
#  include 
# endif /* HAVE_SYS_SIGNAL_H */
# include 
# ifdef HAVE_SYS_IOCTL_H
#  include 
# endif /* HAVE_SYS_IOCTL_H */
# if !defined(VMS)	/*wjm*/
#  include 
# endif /* VMS */
#else
# include 
# include 
# include 
# include "../libntp/log.h"
#endif /* SYS_WINNT */
#if defined(HAVE_RTPRIO)
# ifdef HAVE_SYS_RESOURCE_H
#  include 
# endif
# ifdef HAVE_SYS_LOCK_H
#  include 
# endif
# include 
#else
# ifdef HAVE_PLOCK
#  ifdef HAVE_SYS_LOCK_H
#	include 
#  endif
# endif
#endif
#if defined(HAVE_SCHED_SETSCHEDULER)
# ifdef HAVE_SCHED_H
#  include 
# else
#  ifdef HAVE_SYS_SCHED_H
#   include 
#  endif
# endif
#endif
#if defined(HAVE_SYS_MMAN_H)
# include 
#endif

#ifdef HAVE_TERMIOS_H
# include 
#endif

#ifdef SYS_DOMAINOS
# include 
#endif /* SYS_DOMAINOS */

/* } end definitions lifted from ntpd.c */

#include "ntp_calendar.h"
#include "parse.h"

#define GoodLeap(Year) (((Year)%4 || (!((Year)%100) && (Year)%400)) ? 0 : 13 )

volatile int debug = 0;		/* debugging requests for parse stuff */
char const *progname = "check_y2k";

long
Days ( int Year )		/* return number of days since year "0" */
{
    long  Return;
		/* this is a known to be good algorithm */
    Return = Year * 365;	/* first aproximation to the value */
    if ( Year >= 1 )
    {		/* see notes in libparse/parse.c if you want a PROPER
		 * **generic algorithm. */
	Return += (Year+3) / 4;		/* add in (too many) leap days */
	Return -= (Year-1) / 100;	/* reduce by (too many) centurys */
	Return += (Year-1) / 400;	/* get final answer */
    }

    return Return;
}

static int  year0 = 1900;	/* sarting year for NTP time */
static int  yearend;		/* ending year we test for NTP time.
				    * 32-bit systems: through 2036, the
				      **year in which NTP time overflows.
				    * 64-bit systems: a reasonable upper
				      **limit (well, maybe somewhat beyond
				      **reasonable, but well before the
				      **max time, by which time the earth
				      **will be dead.) */
static time_t Time;
static struct tm LocalTime;

#define Error(year) if ( (year)>=2036 && LocalTime.tm_year < 110 ) \
	Warnings++; else Fatals++

int
main( void )
{
    int Fatals;
    int Warnings;
    int  year;

    Time = time( (time_t *)NULL )
#ifdef TESTTIMEOFFSET
		+ test_time_offset
#endif
	;
    LocalTime = *localtime( &Time );

    year = ( sizeof( u_long ) > 4 ) 	/* save max span using year as temp */
		? ( 400 * 3 ) 		/* three greater gregorian cycles */
		: ((int)(0x7FFFFFFF / 365.242 / 24/60/60)* 2 ); /*32-bit limit*/
			/* NOTE: will automacially expand test years on
			 * 64 bit machines.... this may cause some of the
			 * existing ntp logic to fail for years beyond
			 * 2036 (the current 32-bit limit). If all checks
			 * fail ONLY beyond year 2036 you may ignore such
			 * errors, at least for a decade or so. */
    yearend = year0 + year;

    puts( " internal self check" );
  {		/* verify our own logic used to verify repairs */
    unsigned long days;

    if ( year0 >= yearend )
    {
	fprintf( stdout, "year0=%d NOT LESS THAN yearend=%d  (span=%d)\n",
		(int)year0, (int)yearend, (int)year );
	exit(2);
    }

   {
    int  save_year;

    save_year = LocalTime.tm_year;	/* save current year */

    year = 1980;
    LocalTime.tm_year = year - 1900;
    Fatals = Warnings = 0;
    Error(year);		/* should increment Fatals */
    if ( Fatals == 0 ) 
    {
	fprintf( stdout, 
	    "%4d: %s(%d): FATAL DID NOT INCREMENT  (Fatals=%d Warnings=%d)\n",
	    (int)year, __FILE__, __LINE__, (int)Fatals, (int)Warnings );
	exit(2);
    }

    year = 2100;		/* test year > limit but CURRENT year < limit */
    Fatals = Warnings = 0;
    Error(year);		/* should increment Fatals */
    if ( Warnings == 0 ) 
    {
	fprintf( stdout, 
	    "%4d: %s(%d): WARNING DID NOT INCREMENT  (Fatals=%d Warnings=%d)\n",
	    (int)year, __FILE__, __LINE__, (int)Fatals, (int)Warnings );
	exit(2);
    }
    Fatals = Warnings = 0;
    LocalTime.tm_year = year - 1900;	/* everything > limit */
    Error(1980);		/* should increment Fatals */
    if ( Fatals == 0 ) 
    {
	fprintf( stdout, 
	    "%4d: %s(%d): FATALS DID NOT INCREMENT  (Fatals=%d Warnings=%d)\n",
	    (int)year, __FILE__, __LINE__, (int)Fatals, (int)Warnings );
	exit(2);
    }

    LocalTime.tm_year = save_year;
   }

    days = 365+1;		/* days in year 0 + 1 more day */
    for ( year = 1; year <= 2500; year++ )
    {
	long   Test;
	Test = Days( year );
	if ( days != Test )
	{
	    fprintf( stdout, "%04d: Days() DAY COUNT ERROR: s/b=%ld was=%ld\n", 
		year, (long)days, (long)Test );
	    exit(2);		/* would throw off many other tests */
	}

	Test = julian0(year);		/* compare with julian0() macro */
	if ( days != Test )
	{
	    fprintf( stdout, "%04d: julian0() DAY COUNT ERROR: s/b=%ld was=%ld\n", 
		year, (long)days, (long)Test );
	    exit(2);		/* would throw off many other tests */
	}

	days += 365;
	if ( isleap_4(year) ) days++;
    }

    if ( isleap_4(1999) )
    {
	fprintf( stdout, "isleap_4(1999) REPORTED TRUE\n" );
	exit(2);
    }
    if ( !isleap_4(2000) )
    {
	fprintf( stdout, "isleap_4(2000) REPORTED FALSE\n" );
	exit(2);
    }
    if ( isleap_4(2001) )
    {
	fprintf( stdout, "isleap_4(1999) REPORTED TRUE\n" );
	exit(2);
    }

    if ( !isleap_tm(2000-1900) )
    {
	fprintf( stdout, "isleap_tm(100) REPORTED FALSE\n" );
	exit(2);
    }
  }

    Fatals = Warnings = 0;

    puts( " include/ntp.h" );
  {		/* test our new isleap_*() #define "functions" */
    
    for ( year = 1400; year <= 2200; year++ )
    {
	int  LeapSw;
	int  IsLeapSw;

	LeapSw = GoodLeap(year);
	IsLeapSw = isleap_4(year);

	if ( !!LeapSw != !!IsLeapSw )
	{
	    Error(year);
	    fprintf( stdout, 
		"  %4d %2d %3d *** ERROR\n", year, LeapSw, IsLeapSw );
	    break;
	}

	IsLeapSw = isleap_tm(year-1900);

	if ( !!LeapSw != !!IsLeapSw )
	{
	    Error(year);
	    fprintf( stdout, 
		"  %4d %2d %3d *** ERROR\n", year, LeapSw, IsLeapSw );
	    break;
	}
    }
  }

    puts( " include/ntp_calendar.h" );
  {		/* I belive this is good, but just to be sure... */

	/* we are testing this #define */
#define is_leapyear(y) (y%4 == 0 && !(y%100 == 0 && !(y%400 == 0)))

    for ( year = 1400; year <= 2200; year++ )
    {
	int  LeapSw;

	LeapSw = GoodLeap(year);

	if ( !(!LeapSw) != !(!is_leapyear(year)) )
	{
	    Error(year);
	    fprintf( stdout, 
		"  %4d %2d *** ERROR\n", year, LeapSw );
	    break;
	}
    }
  }   


    puts( " libparse/parse.c" );
  { 
    long Days1970;	/* days from 1900 to 1970 */

    struct ParseTime	/* womp up a test structure to all cut/paste code */
    {
       int   year;
    } Clock_Time, *clock_time;

    clock_time = &Clock_Time;

	/* first test this #define */
#define days_per_year(x)  ((x) % 4 ? 365 : ((x % 400) ? ((x % 100) ? 366 : 365) : 366))

    for ( year = 1400; year <= 2200; year++ )
    {
	int  LeapSw;
	int  DayCnt;

	LeapSw = GoodLeap(year);
	DayCnt = (int)days_per_year(year);

	if ( ( LeapSw ? 366 : 365 ) != DayCnt )
	{
	    Error(year);
	    fprintf( stdout, 
		    "  days_per_year() %4d %2d %3d *** ERROR\n", 
		    year, LeapSw, DayCnt );
	    break;
	}
    }

    /* test (what is now julian0) calculations */

    Days1970 = Days( 1970 );	/* get days since 1970 using a known good */

    for ( year = 1970; year < yearend; year++ )
    {				
	unsigned long t;
	long DaysYear ;

	clock_time->year = year;

	/* here is the code we are testing, cut and pasted out of the source */
#if 0		/* old BUGGY code that has Y2K (and many other) failures */
	    /* ghealton: this logic FAILED with great frequency when run
	     * over a period of time, including for year 2000. True, it
	     * had more successes than failures, but that's not really good
	     * enough for critical time distribution software.
	     * It is so awful I wonder if it has had a history of failure 
	     * and fixes? */
        t =  (clock_time->year - 1970) * 365;
        t += (clock_time->year >> 2) - (1970 >> 2);
        t -= clock_time->year / 100 - 1970 / 100;
        t += clock_time->year / 400 - 1970 / 400;

		/* (immediate feare of rounding errors on integer
		 * **divisions proved well founded) */

#else
	/* my replacement, based on Days() above */
	t = julian0(year) - julian0(1970);
#endif

	/* compare result in t against trusted calculations */
	DaysYear = Days( year );	/* get days to this year */
	if ( t != DaysYear - Days1970 )
	{
	    Error(year);
	    fprintf( stdout, 
		"  %4d 1970=%-8ld %4d=%-8ld %-3ld  t=%-8ld  *** ERROR ***\n",
		  year,      (long)Days1970,
				 year,
				     (long)DaysYear,
					   (long)(DaysYear - Days1970),
						   (long)t );
	}
    }

#if 1		/* { */
   {
    debug = 1;			/* enable debugging */
    for ( year = 1970; year < yearend; year++ )
    {		/* (limited by theory unix 2038 related bug lives by, but
		 * ends in yearend) */
	clocktime_t  ct;
	time_t	     Observed;
	time_t	     Expected;
	u_long       Flag;
	unsigned long t;

	ct.day = 1;
	ct.month = 1;
	ct.year = year;
	ct.hour = ct.minute = ct.second = ct.usecond = 0;
	ct.utcoffset = 0;
	ct.utctime = 0;
	ct.flags = 0;

	Flag = 0;
 	Observed = parse_to_unixtime( &ct, &Flag );
	if ( ct.year != year )
	{
	    fprintf( stdout, 
	       "%04d: parse_to_unixtime(,%d) CORRUPTED ct.year: was %d\n",
	       (int)year, (int)Flag, (int)ct.year );
	    Error(year);
	    break;
	}
	t = julian0(year) - julian0(1970);	/* Julian day from 1970 */
	Expected = t * 24 * 60 * 60;
	if ( Observed != Expected  ||  Flag )
	{   /* time difference */
	    fprintf( stdout, 
	       "%04d: parse_to_unixtime(,%d) FAILURE: was=%lu s/b=%lu  (%ld)\n",
	       year, (int)Flag, 
	       (unsigned long)Observed, (unsigned long)Expected,
	       ((long)Observed - (long)Expected) );
	    Error(year);
	    break;
	}

	if ( year >= YEAR_PIVOT+1900 )
	{
	    /* check year % 100 code we put into parse_to_unixtime() */
	    ct.utctime = 0;
	    ct.year = year % 100;
	    Flag = 0;

	    Observed = parse_to_unixtime( &ct, &Flag );

	    if ( Observed != Expected  ||  Flag )
	    {   /* time difference */
		fprintf( stdout, 
"%04d: parse_to_unixtime(%d,%d) FAILURE: was=%lu s/b=%lu  (%ld)\n",
		   year, (int)ct.year, (int)Flag, 
		   (unsigned long)Observed, (unsigned long)Expected,
		   ((long)Observed - (long)Expected) );
		Error(year);
		break;
	    }

	    /* check year - 1900 code we put into parse_to_unixtime() */
	    ct.utctime = 0;
	    ct.year = year - 1900;
	    Flag = 0;

	    Observed = parse_to_unixtime( &ct, &Flag );

	    if ( Observed != Expected  ||  Flag )
	    {   /* time difference */
		fprintf( stdout, 
"%04d: parse_to_unixtime(%d,%d) FAILURE: was=%lu s/b=%lu  (%ld)\n",
		   year, (int)ct.year, (int)Flag, 
		   (unsigned long)Observed, (unsigned long)Expected,
		   ((long)Observed - (long)Expected) );
		Error(year);
		break;
	    }


	}
    }
#endif		/* } */
   }
  }

    puts( " libntp/caljulian.c" );
  {		/* test caljulian() */
    struct	calendar  ot;
    u_long ntp_time;		/* NTP time */

    year = year0;		/* calculate the basic year */
    printf( "  starting year %04d\n", (int)year0 );
    printf( "  ending year   %04d\n", (int)yearend );


    ntp_time = julian0( year0 );		/* NTP starts in 1900-01-01 */
#if DAY_NTP_STARTS == 693596
    ntp_time -= 365;		/* BIAS required for successful test */
#endif
    if ( DAY_NTP_STARTS != ntp_time )
    {
	Error(year);
	fprintf( stdout, 
		"%04d: DAY_NTP_STARTS (%ld) NOT TRUE VALUE OF %ld (%ld)\n",
		(int)year0,
		(long)DAY_NTP_STARTS,  (long)ntp_time,
		(long)DAY_NTP_STARTS - (long)ntp_time );
    }

    for ( ; year < yearend; year++ )
    {
	
	/* 01-01 for the current year */
	ntp_time = Days( year ) - Days( year0 );  /* days into NTP time */
	ntp_time *= 24 * 60 * 60;	/* convert into seconds */
	caljulian( ntp_time, &ot );	/* convert January 1 */
	if ( ot.year  != year
	  || ot.month != 1
	  || ot.monthday != 1 )
	{
	    Error(year);
	    fprintf( stdout, "%lu: EXPECTED %04d-01-01: FOUND %04d-%02d-%02d\n",
			(unsigned long)ntp_time,
			year, 
			(int)ot.year, (int)ot.month, (int)ot.monthday );
	    break;
	}

	ntp_time += (31 + 28-1) * ( 24 * 60 * 60 );	/* advance to 02-28 */
	caljulian( ntp_time, &ot );	/* convert Feb 28 */
	if ( ot.year  != year
	  || ot.month != 2
	  || ot.monthday != 28 )
	{
	    Error(year);
	    fprintf( stdout, "%lu: EXPECTED %04d-02-28: FOUND %04d-%02d-%02d\n",
			(unsigned long)ntp_time,
			year, 
			(int)ot.year, (int)ot.month, (int)ot.monthday );
	    break;
	}

      {
	int    m;		/* expected month */
	int    d;		/* expected day */

	m = isleap_4(year) ?  2 : 3;
	d = isleap_4(year) ? 29 : 1;

	ntp_time += ( 24 * 60 * 60 );	/* advance to the next day */
	caljulian( ntp_time, &ot );	/* convert this day */
	if ( ot.year  != year
	  || ot.month != m
	  || ot.monthday != d )
	{
	    Error(year);
	    fprintf( stdout, "%lu: EXPECTED %04d-%02d-%02d: FOUND %04d-%02d-%02d\n",
			(unsigned long)ntp_time,
			year, m, d, 
			(int)ot.year, (int)ot.month, (int)ot.monthday );
	    break;
	}

      }
    }
  }

    puts( " libntp/caltontp.c" );
  {		/* test caltontp() */
    struct	calendar  ot;
    u_long      ntp_time;		/* NTP time */

    year = year0;		/* calculate the basic year */
    printf( "  starting year %04d\n", (int)year0 );
    printf( "  ending year   %04d\n", (int)yearend );


    for ( ; year < yearend; year++ )
    {
	u_long  ObservedNtp;
	
	/* 01-01 for the current year */
	ot.year = year;
	ot.month = ot.monthday = 1; 	/* unused, but set anyway JIC */
	ot.yearday = 1;		/* this is the magic value used by caltontp() */
	ot.hour = ot.minute = ot.second = 0;

	ntp_time = Days( year ) - Days( year0 );  /* days into NTP time */
	ntp_time *= 24 * 60 * 60;	/* convert into seconds */
	ObservedNtp = caltontp( &ot );
	if ( ntp_time != ObservedNtp )
	{
	    Error(year);
	    fprintf( stdout, "%d: EXPECTED %lu: FOUND %lu (%ld)\n",
			(int)year,
			(unsigned long)ntp_time, (unsigned long)ObservedNtp ,
			(long)ntp_time - (long)ObservedNtp );

	    break;
	}

	/* now call caljulian as a type of failsafe supercheck */
	caljulian( ObservedNtp, &ot );	/* convert January 1 */
	if ( ot.year  != year
	  || ot.month != 1
	  || ot.monthday != 1 )
	{
	    Error(year);
	    fprintf( stdout, "%lu: caljulian FAILSAFE EXPECTED %04d-01-01: FOUND %04d-%02d-%02d\n",
			(unsigned long)ObservedNtp,
			year, 
			(int)ot.year, (int)ot.month, (int)ot.monthday );
	    break;
	}
    }
  }

   if ( Warnings > 0 )
       fprintf( stdout, "%d WARNINGS\n",  Warnings );
   if ( Fatals > 0 )
       fprintf( stdout, "%d FATAL ERRORS\n",  Fatals );
   return Fatals ? 1 : 0;
}
							/* Y2KFixes ] */
ntp-4.2.6p5/ntpd/ntp_config.c0000644000175000017500000030177511665566225015103 0ustar  peterpeter/* ntp_config.c
 *
 * This file contains the ntpd configuration code.
 *
 * Written By:	Sachin Kamboj
 *		University of Delaware
 *		Newark, DE 19711
 * Some parts borrowed from the older ntp_config.c
 * Copyright (c) 2006
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#ifdef HAVE_NETINFO
# include 
#endif

#include "ntp.h"
#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_unixtime.h"
#include "ntp_refclock.h"
#include "ntp_filegen.h"
#include "ntp_stdlib.h"
#include "ntp_assert.h"
#include "ntpd-opts.h"
/*
 * Sim header. Currently unconditionally included
 * PDMXXX This needs to be a conditional include
 */
#include "ntpsim.h"

#include 
#include "ntp_intres.h"
#include 
#include 

#include 
#include 
#ifdef HAVE_SYS_PARAM_H
# include 
#endif
#include 
#ifndef SIGCHLD
# define SIGCHLD SIGCLD
#endif
#if !defined(VMS)
# ifdef HAVE_SYS_WAIT_H
#  include 
# endif
#endif /* VMS */

#ifdef SYS_WINNT
# include 
HANDLE ResolverEventHandle;
#else
int resolver_pipe_fd[2];  /* used to let the resolver process alert the parent process */
#endif /* SYS_WINNT */

/*
 * [Bug 467]: Some linux headers collide with CONFIG_PHONE and CONFIG_KEYS
 * so #include these later.
 */

#include "ntp_config.h"
#include "ntp_cmdargs.h"

#include "ntp_scanner.h"
#include "ntp_parser.h"
#include "ntp_data_structures.h"


/*
 * "logconfig" building blocks
 */
struct masks {
	const char * const	name;
	const u_int32		mask;
};

static struct masks logcfg_class[] = {
	{ "clock",	NLOG_OCLOCK },
	{ "peer",	NLOG_OPEER },
	{ "sync",	NLOG_OSYNC },
	{ "sys",	NLOG_OSYS },
	{ NULL,		0 }
};

/* logcfg_noclass_items[] masks are complete and must not be shifted */
static struct masks logcfg_noclass_items[] = {
	{ "allall",		NLOG_SYSMASK | NLOG_PEERMASK | NLOG_CLOCKMASK | NLOG_SYNCMASK },
	{ "allinfo",		NLOG_SYSINFO | NLOG_PEERINFO | NLOG_CLOCKINFO | NLOG_SYNCINFO },
	{ "allevents",		NLOG_SYSEVENT | NLOG_PEEREVENT | NLOG_CLOCKEVENT | NLOG_SYNCEVENT },
	{ "allstatus",		NLOG_SYSSTATUS | NLOG_PEERSTATUS | NLOG_CLOCKSTATUS | NLOG_SYNCSTATUS },
	{ "allstatistics",	NLOG_SYSSTATIST | NLOG_PEERSTATIST | NLOG_CLOCKSTATIST | NLOG_SYNCSTATIST },
	/* the remainder are misspellings of clockall, peerall, sysall, and syncall. */
	{ "allclock",		(NLOG_INFO | NLOG_STATIST | NLOG_EVENT | NLOG_STATUS) << NLOG_OCLOCK },
	{ "allpeer",		(NLOG_INFO | NLOG_STATIST | NLOG_EVENT | NLOG_STATUS) << NLOG_OPEER },
	{ "allsys",		(NLOG_INFO | NLOG_STATIST | NLOG_EVENT | NLOG_STATUS) << NLOG_OSYS },
	{ "allsync",		(NLOG_INFO | NLOG_STATIST | NLOG_EVENT | NLOG_STATUS) << NLOG_OSYNC },
	{ NULL,			0 }
};

/* logcfg_class_items[] masks are shiftable by NLOG_O* counts */
static struct masks logcfg_class_items[] = {
	{ "all",		NLOG_INFO | NLOG_EVENT | NLOG_STATUS | NLOG_STATIST },
	{ "info",		NLOG_INFO },
	{ "events",		NLOG_EVENT },
	{ "status",		NLOG_STATUS },
	{ "statistics",		NLOG_STATIST },
	{ NULL,			0 }
};

/* Limits */
#define MAXPHONE	10	/* maximum number of phone strings */
#define MAXPPS		20	/* maximum length of PPS device string */

/*
 * Miscellaneous macros
 */
#define STRSAME(s1, s2)	(*(s1) == *(s2) && strcmp((s1), (s2)) == 0)
#define ISEOL(c)	((c) == '#' || (c) == '\n' || (c) == '\0')
#define ISSPACE(c)	((c) == ' ' || (c) == '\t')
#define STREQ(a, b)	(*(a) == *(b) && strcmp((a), (b)) == 0)

/*
 * File descriptor used by the resolver save routines, and temporary file
 * name.
 */
int call_resolver = 1;		/* ntp-genkeys sets this to 0, for example */
#ifndef SYS_WINNT
static char res_file[20];	/* enough for /tmp/ntpXXXXXX\0 */
#define RES_TEMPFILE	"/tmp/ntpXXXXXX"
#else
static char res_file[MAX_PATH];
#endif /* SYS_WINNT */

/*
 * Definitions of things either imported from or exported to outside
 */
extern int yydebug;			/* ntp_parser.c (.y) */
int curr_include_level;			/* The current include level */
struct FILE_INFO *fp[MAXINCLUDELEVEL+1];
FILE *res_fp;
struct config_tree cfgt;		/* Parser output stored here */
struct config_tree *cfg_tree_history = NULL;	/* History of configs */
char	*sys_phone[MAXPHONE] = {NULL};	/* ACTS phone numbers */
char	default_keysdir[] = NTP_KEYSDIR;
char	*keysdir = default_keysdir;	/* crypto keys directory */
char *	saveconfigdir;
#if defined(HAVE_SCHED_SETSCHEDULER)
int	config_priority_override = 0;
int	config_priority;
#endif

const char *config_file;
char default_ntp_signd_socket[] =
#ifdef NTP_SIGND_PATH
					NTP_SIGND_PATH;
#else
					"";
#endif
char *ntp_signd_socket = default_ntp_signd_socket;
#ifdef HAVE_NETINFO
struct netinfo_config_state *config_netinfo = NULL;
int check_netinfo = 1;
#endif /* HAVE_NETINFO */
#ifdef SYS_WINNT
char *alt_config_file;
LPTSTR temp;
char config_file_storage[MAX_PATH];
char alt_config_file_storage[MAX_PATH];
#endif /* SYS_WINNT */

#ifdef HAVE_NETINFO
/*
 * NetInfo configuration state
 */
struct netinfo_config_state {
	void *domain;		/* domain with config */
	ni_id config_dir;	/* ID config dir      */
	int prop_index;		/* current property   */
	int val_index;		/* current value      */
	char **val_list;       	/* value list         */
};
#endif

struct REMOTE_CONFIG_INFO remote_config;  /* Remote configuration buffer and
					     pointer info */
int input_from_file = 1;     /* A boolean flag, which when set, indicates that
			        the input is to be taken from the configuration
			        file, instead of the remote-configuration buffer
			     */

int old_config_style = 1;    /* A boolean flag, which when set,
			      * indicates that the old configuration
			      * format with a newline at the end of
			      * every command is being used
			      */
int	cryptosw;		/* crypto command called */

extern int sys_maxclock;
extern char *stats_drift_file;	/* name of the driftfile */
extern char *leapseconds_file_name; /*name of the leapseconds file */
#ifdef HAVE_IPTOS_SUPPORT
extern unsigned int qos;				/* QoS setting */
#endif /* HAVE_IPTOS_SUPPORT */

#ifdef BC_LIST_FRAMEWORK_NOT_YET_USED
/*
 * backwards compatibility flags
 */
bc_entry bc_list[] = {
	{ T_Bc_bugXXXX,		1	}	/* default enabled */
};

/*
 * declare an int pointer for each flag for quick testing without
 * walking bc_list.  If the pointer is consumed by libntp rather
 * than ntpd, declare it in a libntp source file pointing to storage
 * initialized with the appropriate value for other libntp clients, and
 * redirect it to point into bc_list during ntpd startup.
 */
int *p_bcXXXX_enabled = &bc_list[0].enabled;
#endif

/* FUNCTION PROTOTYPES */

static void apply_enable_disable(queue *q, int enable);
static void init_syntax_tree(struct config_tree *);

#ifdef FREE_CFG_T
static void free_auth_node(struct config_tree *);

static void free_config_other_modes(struct config_tree *);
static void free_config_auth(struct config_tree *);
static void free_config_tos(struct config_tree *);
static void free_config_monitor(struct config_tree *);
static void free_config_access(struct config_tree *);
static void free_config_tinker(struct config_tree *);
static void free_config_system_opts(struct config_tree *);
static void free_config_logconfig(struct config_tree *);
static void free_config_phone(struct config_tree *);
static void free_config_qos(struct config_tree *);
static void free_config_setvar(struct config_tree *);
static void free_config_ttl(struct config_tree *);
static void free_config_trap(struct config_tree *);
static void free_config_fudge(struct config_tree *);
static void free_config_vars(struct config_tree *);
static void free_config_peers(struct config_tree *);
static void free_config_unpeers(struct config_tree *);
static void free_config_nic_rules(struct config_tree *);
#ifdef SIM
static void free_config_sim(struct config_tree *);
#endif

       void free_all_config_trees(void);	/* atexit() */
static void free_config_tree(struct config_tree *ptree);
#endif	/* FREE_CFG_T */

double *create_dval(double val);
void destroy_restrict_node(struct restrict_node *my_node);
static int is_sane_resolved_address(sockaddr_u *peeraddr, int hmode);
static int get_correct_host_mode(int hmode);
static void save_and_apply_config_tree(void);
void getconfig(int argc,char *argv[]);
#if !defined(SIM)
static sockaddr_u *get_next_address(struct address_node *addr);
#endif

static void config_other_modes(struct config_tree *);
static void config_auth(struct config_tree *);
static void config_tos(struct config_tree *);
static void config_monitor(struct config_tree *);
static void config_access(struct config_tree *);
static void config_tinker(struct config_tree *);
static void config_system_opts(struct config_tree *);
static void config_logconfig(struct config_tree *);
static void config_phone(struct config_tree *);
static void config_qos(struct config_tree *);
static void config_setvar(struct config_tree *);
static void config_ttl(struct config_tree *);
static void config_trap(struct config_tree *);
static void config_fudge(struct config_tree *);
static void config_vars(struct config_tree *);
static void config_peers(struct config_tree *);
static void config_unpeers(struct config_tree *);
static void config_nic_rules(struct config_tree *);

#ifdef SIM
static void config_sim(struct config_tree *);
static void config_ntpdsim(struct config_tree *);
#else
static void config_ntpd(struct config_tree *);
#endif

enum gnn_type {
	t_UNK,		/* Unknown */
	t_REF,		/* Refclock */
	t_MSK		/* Network Mask */
};

#define DESTROY_QUEUE(q)		\
do {					\
	if (q) {			\
		destroy_queue(q);	\
		(q) = NULL;		\
	}				\
} while (0)

void ntpd_set_tod_using(const char *);
static u_int32 get_pfxmatch(const char **, struct masks *);
static u_int32 get_match(const char *, struct masks *);
static u_int32 get_logmask(const char *);
static int getnetnum(const char *num,sockaddr_u *addr, int complain,
		     enum gnn_type a_type);
static int get_multiple_netnums(const char *num, sockaddr_u *addr,
				struct addrinfo **res, int complain,
				enum gnn_type a_type);
static void save_resolve(char *name, int no_needed, int type,
			 int mode, int version, int minpoll, int maxpoll,
			 u_int flags, int ttl, keyid_t keyid, u_char *keystr);
static void abort_resolve(void);
static void do_resolve_internal(void);



/* FUNCTIONS FOR INITIALIZATION
 * ----------------------------
 */

#ifdef FREE_CFG_T
static void
free_auth_node(
	struct config_tree *ptree
	)
{
	if (ptree->auth.keys) {
		free(ptree->auth.keys);
		ptree->auth.keys = NULL;
	}

	if (ptree->auth.keysdir) {
		free(ptree->auth.keysdir);
		ptree->auth.keysdir = NULL;
	}

	if (ptree->auth.ntp_signd_socket) {
		free(ptree->auth.ntp_signd_socket);
		ptree->auth.ntp_signd_socket = NULL;
	}
}
#endif /* DEBUG */


static void
init_syntax_tree(
	struct config_tree *ptree
	)
{
	memset(ptree, 0, sizeof(*ptree));

	ptree->peers = create_queue();
	ptree->unpeers = create_queue();
	ptree->orphan_cmds = create_queue();
	ptree->manycastserver = create_queue();
	ptree->multicastclient = create_queue();
	ptree->stats_list = create_queue();
	ptree->filegen_opts = create_queue();
	ptree->discard_opts = create_queue();
	ptree->restrict_opts = create_queue();
	ptree->enable_opts = create_queue();
	ptree->disable_opts = create_queue();
	ptree->tinker = create_queue();
	ptree->fudge = create_queue();
	ptree->logconfig = create_queue();
	ptree->phone = create_queue();
	ptree->qos = create_queue();
	ptree->setvar = create_queue();
	ptree->ttl = create_queue();
	ptree->trap = create_queue();
	ptree->vars = create_queue();
	ptree->nic_rules = create_queue();
	ptree->auth.crypto_cmd_list = create_queue();
	ptree->auth.trusted_key_list = create_queue();
}


#ifdef FREE_CFG_T
void
free_all_config_trees(void)
{
	struct config_tree *ptree;
	struct config_tree *pnext;

	ptree = cfg_tree_history;

	while (ptree != NULL) {
		pnext = ptree->link;
		free_config_tree(ptree);
		ptree = pnext;
	}
}


static void
free_config_tree(
	struct config_tree *ptree
	)
{
#if defined(_MSC_VER) && defined (_DEBUG)
	_CrtCheckMemory();
#endif

	if (ptree->source.value.s != NULL)
		free(ptree->source.value.s);

	free_config_other_modes(ptree);
	free_config_auth(ptree);
	free_config_tos(ptree);
	free_config_monitor(ptree);
	free_config_access(ptree);
	free_config_tinker(ptree);
	free_config_system_opts(ptree);
	free_config_logconfig(ptree);
	free_config_phone(ptree);
	free_config_qos(ptree);
	free_config_setvar(ptree);
	free_config_ttl(ptree);
	free_config_trap(ptree);
	free_config_fudge(ptree);
	free_config_vars(ptree);
	free_config_peers(ptree);
	free_config_unpeers(ptree);
	free_config_nic_rules(ptree);
#ifdef SIM
	free_config_sim(ptree);
#endif
	/*
	 * Most of these DESTROY_QUEUE()s are handled already by the
	 * free_config_*() routines above but it's safe to use twice.
	 * Please feel free to remove ones you verified are handled
	 * in a free_config_*() routine.
	 */
	DESTROY_QUEUE(ptree->peers);
	DESTROY_QUEUE(ptree->unpeers);
	DESTROY_QUEUE(ptree->orphan_cmds);
	DESTROY_QUEUE(ptree->manycastserver);
	DESTROY_QUEUE(ptree->multicastclient);
	DESTROY_QUEUE(ptree->stats_list);
	DESTROY_QUEUE(ptree->filegen_opts);
	DESTROY_QUEUE(ptree->discard_opts);
	DESTROY_QUEUE(ptree->restrict_opts);
	DESTROY_QUEUE(ptree->enable_opts);
	DESTROY_QUEUE(ptree->disable_opts);
	DESTROY_QUEUE(ptree->tinker);
	DESTROY_QUEUE(ptree->fudge);
	DESTROY_QUEUE(ptree->logconfig);
	DESTROY_QUEUE(ptree->phone);
	DESTROY_QUEUE(ptree->qos);
	DESTROY_QUEUE(ptree->setvar);
	DESTROY_QUEUE(ptree->ttl);
	DESTROY_QUEUE(ptree->trap);
	DESTROY_QUEUE(ptree->vars);

	free_auth_node(ptree);

	free(ptree);

#if defined(_MSC_VER) && defined (_DEBUG)
	_CrtCheckMemory();
#endif
}
#endif /* FREE_CFG_T */


#ifdef SAVECONFIG
/* Dump all trees */
int
dump_all_config_trees(
	FILE *df,
	int comment
	) 
{
	struct config_tree *cfg_ptr = cfg_tree_history;
	int return_value = 0;

	for (cfg_ptr = cfg_tree_history;
	     cfg_ptr != NULL; 
	     cfg_ptr = cfg_ptr->link) 
		return_value |= dump_config_tree(cfg_ptr, df, comment);

	return return_value;
}


/* The config dumper */
int
dump_config_tree(
	struct config_tree *ptree,
	FILE *df,
	int comment
	)
{
	struct peer_node *peer = NULL;
	struct unpeer_node *unpeers = NULL;
	struct attr_val *atrv = NULL;
	struct address_node *addr = NULL;
	struct address_node *peer_addr;
	struct address_node *fudge_addr;
	struct filegen_node *fgen_node = NULL;
	struct restrict_node *rest_node = NULL;
	struct addr_opts_node *addr_opts = NULL;
	struct setvar_node *setv_node = NULL;
	nic_rule_node *rule_node;

	char **pstr = NULL;
	char *s1;
	char *s2;
	int *intp = NULL;
	void *fudge_ptr;
	void *list_ptr = NULL;
	void *options = NULL;
	void *opt_ptr = NULL;
	int *flags = NULL;
	void *opts = NULL;
	char timestamp[80];
	int enable;

	DPRINTF(1, ("dump_config_tree(%p)\n", ptree));

	if (comment) {
		if (!strftime(timestamp, sizeof(timestamp),
			      "%Y-%m-%d %H:%M:%S",
			      localtime(&ptree->timestamp)))
			timestamp[0] = '\0';

		fprintf(df, "# %s %s %s\n",
			timestamp,
			(CONF_SOURCE_NTPQ == ptree->source.attr)
			    ? "ntpq remote config from"
			    : "startup configuration file",
			ptree->source.value.s);
	}

	/* For options I didn't find documentation I'll just output its name and the cor. value */
	list_ptr = queue_head(ptree->vars);
	for(;	list_ptr != NULL;
		list_ptr = next_node(list_ptr)) {

		atrv = (struct attr_val *) list_ptr;

		switch (atrv->attr) {

		default:
			fprintf(df, "\n# dump error:\n"
				"# unknown vars token %s\n",
				token_name(atrv->attr));
			break;

		/* doubles */
		case T_Broadcastdelay:
		case T_Tick:
		case T_WanderThreshold:
			fprintf(df, "%s %g\n",
				keyword(atrv->attr),
				atrv->value.d);
			break;
			
		/* ints */
		case T_Calldelay:
#ifdef OPENSSL
		case T_Automax:
#endif
			fprintf(df, "%s %d\n",
				keyword(atrv->attr),
				atrv->value.i);
			break;

		/* strings */
		case T_Driftfile:
		case T_Leapfile:
		case T_Logfile:
		case T_Pidfile:
		case T_Saveconfigdir:
			fprintf(df, "%s \"%s\"\n",
				keyword(atrv->attr),
				atrv->value.s);
			break;
		}
	}

	list_ptr = queue_head(ptree->logconfig);
	if (list_ptr != NULL) {
		
		fprintf(df, "logconfig");

		for(;	list_ptr != NULL;
			list_ptr = next_node(list_ptr)) {

			atrv = list_ptr;
			fprintf(df, " %c%s", atrv->attr, atrv->value.s);
		}
		fprintf(df, "\n");
	}

	if (ptree->stats_dir)
		fprintf(df, "statsdir \"%s\"\n", ptree->stats_dir);

	list_ptr = queue_head(ptree->stats_list);
	if (list_ptr != NULL) {

		fprintf(df, "statistics");
		for(; 	list_ptr != NULL;
			list_ptr = next_node(list_ptr)) {

			intp = list_ptr;
			
			fprintf(df, " %s", keyword(*intp));	
		}

		fprintf(df, "\n");
	}

	list_ptr = queue_head(ptree->filegen_opts);
	for(; 	list_ptr != NULL;
		list_ptr = next_node(list_ptr)) {

		fgen_node = list_ptr;
		opt_ptr = queue_head(fgen_node->options);

		if (opt_ptr != NULL)
			fprintf(df, "filegen %s", 
				keyword(fgen_node->filegen_token));

		for(;	opt_ptr != NULL;
			opt_ptr = next_node(opt_ptr)) {
			
			atrv = opt_ptr;

			switch (atrv->attr) {

			default:
				fprintf(df, "\n# dump error:\n"
					"# unknown filegen option token %s\n"
					"filegen %s",
					token_name(atrv->attr),
					keyword(fgen_node->filegen_token));
				break;

			case T_File:
				fprintf(df, " file %s",
					atrv->value.s);
				break;

			case T_Type:
				fprintf(df, " type %s",
					keyword(atrv->value.i));
				break;

			case T_Flag:
				fprintf(df, " %s",
					keyword(atrv->value.i));
				break;
			}

		}

		fprintf(df, "\n");
	}

	list_ptr = queue_head(ptree->auth.crypto_cmd_list);
	if (list_ptr != NULL) {
		fprintf(df, "crypto");

		for (;	list_ptr != NULL;
			list_ptr = next_node(list_ptr)) {

			atrv = list_ptr;
			fprintf(df, " %s %s", keyword(atrv->attr),
				atrv->value.s);
		}
		fprintf(df, "\n");
	}

	if (ptree->auth.revoke != 0)
		fprintf(df, "revoke %d\n", ptree->auth.revoke);

	if (NULL != ptree->auth.keysdir)
		fprintf(df, "keysdir \"%s\"\n", ptree->auth.keysdir);

	if (NULL != ptree->auth.keys)
		fprintf(df, "keys \"%s\"\n", ptree->auth.keys);

	atrv = queue_head(ptree->auth.trusted_key_list);
	if (atrv != NULL) {
		fprintf(df, "trustedkey");
		do {
			if ('i' == atrv->attr)
				fprintf(df, " %d", atrv->value.i);
			else if ('-' == atrv->attr)
				fprintf(df, " (%u ... %u)",
					atrv->value.u >> 16,
					atrv->value.u & 0xffff);
			else
				fprintf(df, "\n# dump error:\n"
					"# unknown trustedkey attr %d\n"
					"trustedkey", atrv->attr);
		} while (NULL != (atrv = next_node(atrv)));
		fprintf(df, "\n");
	}

	if (ptree->auth.control_key)
		fprintf(df, "controlkey %d\n", ptree->auth.control_key);

	if (ptree->auth.request_key)
		fprintf(df, "requestkey %d\n", ptree->auth.request_key);

	/* dump enable list, then disable list */
	for (enable = 1; enable >= 0; enable--) {

		list_ptr = (enable)
			       ? queue_head(ptree->enable_opts)
			       : queue_head(ptree->disable_opts);

		if (list_ptr != NULL) {
			fprintf(df, (enable)
					? "enable"
					: "disable");

			for(;	list_ptr != NULL;
				list_ptr = next_node(list_ptr)) {

				atrv = (struct attr_val *) list_ptr;

				fprintf(df, " %s",
					keyword(atrv->value.i));
			}
			fprintf(df, "\n");
		}
	}

	list_ptr = queue_head(ptree->orphan_cmds);
	if (list_ptr != NULL)
		fprintf(df, "tos");

	for(; 	list_ptr != NULL;
		list_ptr = next_node(list_ptr)) {

		atrv = list_ptr;

		switch (atrv->attr) {

		default:
			fprintf(df, "\n# dump error:\n"
				"# unknown tos token %s\n"
				"tos", token_name(atrv->attr));
			break;

		/* ints */
		case T_Ceiling:
		case T_Floor:
		case T_Cohort:
		case T_Orphan:
		case T_Minclock:
		case T_Maxclock:
		case T_Minsane:
		case T_Beacon:
			fprintf(df, " %s %d", keyword(atrv->attr),
				(int)atrv->value.d);
			break;

		/* doubles */
		case T_Mindist:
		case T_Maxdist:
			fprintf(df, " %s %g", keyword(atrv->attr),
				atrv->value.d);
			break;
		}
	}
	if (queue_head(ptree->orphan_cmds) != NULL)
		fprintf(df, "\n");

	list_ptr = queue_head(ptree->tinker);
	if (list_ptr != NULL) {

		fprintf(df, "tinker");

		for(;	list_ptr != NULL;
			list_ptr = next_node(list_ptr)) {

			atrv = list_ptr;
			fprintf(df, " %s %g", keyword(atrv->attr),
				atrv->value.d);
		}

		fprintf(df, "\n");
	}

	if (ptree->broadcastclient)
		fprintf(df, "broadcastclient\n");

	list_ptr = queue_head(ptree->peers);
	for (; 	list_ptr != NULL;
	 	list_ptr = next_node(list_ptr)) {

		peer = list_ptr; 
		addr = peer->addr;
		fprintf(df, "%s", keyword(peer->host_mode));

		switch (addr->type) {

		default:
			fprintf(df, "# dump error:\n"
				"# unknown peer family %d for:\n"
				"peer", addr->type);
			break;

		case AF_UNSPEC:
			break;

		case AF_INET:
			fprintf(df, " -4");
			break;

		case AF_INET6:
			fprintf(df, " -6");
			break;
		}
		fprintf(df, " %s", addr->address);
		
		if (peer->minpoll != 0)
			fprintf(df, " minpoll %d", peer->minpoll);

		if (peer->maxpoll != 0)
			fprintf(df, " maxpoll %d", peer->maxpoll);

		if (peer->ttl != 0) {
			if (strlen(addr->address) > 8
			    && !memcmp(addr->address, "127.127.", 8))
				fprintf(df, " mode %d", peer->ttl);
			else
				fprintf(df, " ttl %d", peer->ttl);
		}

		if (peer->peerversion != NTP_VERSION)
			fprintf(df, " version %d", peer->peerversion);

		if (peer->peerkey != 0)
			fprintf(df, " key %d", peer->peerkey);

		if (peer->bias != 0.)
			fprintf(df, " bias %g", peer->bias);

		for (atrv = queue_head(peer->peerflags);
		     atrv != NULL;
		     atrv = next_node(atrv)) {

			NTP_INSIST(T_Flag == atrv->attr);
			NTP_INSIST(T_Integer == atrv->type);

			fprintf(df, " %s", keyword(atrv->value.i));
		}

		fprintf(df, "\n");

		fudge_ptr = queue_head(ptree->fudge);
		for(; 	fudge_ptr != NULL;
			fudge_ptr = next_node(fudge_ptr)) {


			addr_opts = (struct addr_opts_node *) fudge_ptr; 
			peer_addr = peer->addr;
			fudge_addr = addr_opts->addr;

			s1 = peer_addr->address;
			s2 = fudge_addr->address;

			if (!strcmp(s1, s2)) {

				fprintf(df, "fudge %s", addr_opts->addr->address);
	
				opts = queue_head(addr_opts->options);

				for(; opts != NULL; opts = next_node(opts)) {
					atrv = (struct attr_val *) opts; 
				
					switch (atrv->attr) {

					default:
						fprintf(df, "\n# dump error:\n"
							"# unknown fudge option %s\n"
							"fudge %s",
							token_name(atrv->attr),
							addr_opts->addr->address);
						break;

					/* doubles */
					case T_Time1:
					case T_Time2:
						fprintf(df, " %s %g",
							keyword(atrv->attr),
							atrv->value.d);
						break;
		
					/* ints */
					case T_Stratum:
					case T_Flag1:
					case T_Flag2:
					case T_Flag3:
					case T_Flag4:
						fprintf(df, " %s %d",
							keyword(atrv->attr),
							atrv->value.i);
						break;

					/* strings */
					case T_Refid:
						fprintf(df, " %s %s",
							keyword(atrv->attr),
							atrv->value.s);
						break;
					}
				}
				fprintf(df, "\n");
			}
		}
	}

	list_ptr = queue_head(ptree->manycastserver);
	if (list_ptr != NULL) {
		addr = list_ptr;
		fprintf(df, "manycastserver %s", addr->address);
		for (addr = next_node(addr);
		     addr != NULL;
		     addr = next_node(addr))
			fprintf(df, " %s", addr->address);
		fprintf(df, "\n");
	}

	list_ptr = queue_head(ptree->multicastclient);
	if (list_ptr != NULL) {
		addr = list_ptr;
		fprintf(df, "multicastclient %s", addr->address);
		for (addr = next_node(addr);
		     addr != NULL;
		     addr = next_node(addr))
			fprintf(df, " %s", addr->address);
		fprintf(df, "\n");
	}

	list_ptr = queue_head(ptree->unpeers);
	for (; 	list_ptr != NULL;
		list_ptr = next_node(list_ptr)) {
		
		unpeers = (struct unpeer_node *) list_ptr;
		
		fprintf(df, "unpeer %s\n", (unpeers->addr)->address);
	}

	list_ptr = queue_head(ptree->discard_opts);
	if (list_ptr != NULL) {

		fprintf(df, "discard");

		for(;	list_ptr != NULL;
			list_ptr = next_node(list_ptr)) {

			atrv = list_ptr;
			fprintf(df, " %s %d", keyword(atrv->attr),
				atrv->value.i);
		}
		fprintf(df, "\n");
	}

	list_ptr = queue_head(ptree->restrict_opts);
	for (;	list_ptr != NULL; 
		list_ptr = next_node(list_ptr)) {

		rest_node = list_ptr;
		if (NULL == rest_node->addr)
			s1 = "default";
		else
			s1 = rest_node->addr->address;

		fprintf(df, "restrict %s", s1);

		if (rest_node->mask != NULL)
			fprintf(df, " mask %s",
				rest_node->mask->address);

		flags = queue_head(rest_node->flags);
		for (; 	flags != NULL; flags = next_node(flags))
			fprintf(df, " %s", keyword(*flags));

		fprintf(df, "\n");
	}

	list_ptr = queue_head(ptree->nic_rules);
	for (;	list_ptr != NULL;
		list_ptr = next_node(list_ptr)) {

		rule_node = list_ptr;
		fprintf(df, "interface %s %s\n",
			keyword(rule_node->action),
			(rule_node->match_class)
			    ? keyword(rule_node->match_class)
			    : rule_node->if_name);
	}

	list_ptr = queue_head(ptree->phone);
	if (list_ptr != NULL) {

		fprintf(df, "phone");

		for(; 	list_ptr != NULL;
			list_ptr = next_node(list_ptr)) {

			pstr = list_ptr;
			fprintf(df, " %s", *pstr);
		}

		fprintf(df, "\n");
	}

	list_ptr = queue_head(ptree->qos);
	if (list_ptr != NULL) {
		
		fprintf(df, "qos");

		for(;	list_ptr != NULL;
			list_ptr = next_node(list_ptr)) {

			atrv = list_ptr;
			fprintf(df, " %s", atrv->value.s);
		}

		fprintf(df, "\n");
	}

	list_ptr = queue_head(ptree->setvar);
	for(;	list_ptr != NULL;
		list_ptr = next_node(list_ptr)) {

		setv_node = list_ptr;
		s1 = quote_if_needed(setv_node->var);
		s2 = quote_if_needed(setv_node->val);
		fprintf(df, "setvar %s = %s", s1, s2);
		free(s1);
		free(s2);

		if (setv_node->isdefault)
			fprintf(df, " default");

		fprintf(df, "\n");
	}


	list_ptr = queue_head(ptree->ttl);
	if (list_ptr != NULL) {

		fprintf(df, "ttl");

		for(; 	list_ptr != NULL;
			list_ptr = next_node(list_ptr)) {

			intp = list_ptr;
			fprintf(df, " %d", *intp);
		}
		
		fprintf(df, "\n");
	}
	
	list_ptr = queue_head(ptree->trap);
	for(;	list_ptr != NULL;
		list_ptr = next_node(list_ptr)) {

		addr_opts = list_ptr;
		addr = addr_opts->addr;

		fprintf(df, "trap %s", addr->address);

		options = queue_head(addr_opts->options);

		for(; 	options != NULL; 
			options = next_node(options)) {

			atrv = options;

			switch (atrv->attr) {

			default:
				fprintf(df, "\n# dump error:\n"
					"# unknown trap token %d\n"
					"trap %s", atrv->attr,
					addr->address);
				break;

			case T_Port:
				fprintf(df, " port %d", atrv->value.i);
				break;

			case T_Interface:
				addr = (struct address_node *) atrv->value.p;
				fprintf(df, " interface %s", addr->address);
				break;
			}
		}

		fprintf(df, "\n");
	}

	return 0;
}
#endif	/* SAVECONFIG */
	

/* FUNCTIONS FOR CREATING NODES ON THE SYNTAX TREE
 * -----------------------------------------------
 */

queue *
enqueue_in_new_queue(
	void *my_node
	)
{
	queue *my_queue = create_queue();

	enqueue(my_queue, my_node);
	return my_queue;
}

struct attr_val *
create_attr_dval(
	int attr,
	double value
	)
{
	struct attr_val *my_val;

	my_val = get_node(sizeof *my_val);
	my_val->attr = attr;
	my_val->value.d = value;
	my_val->type = T_Double;
	return my_val;
}

struct attr_val *
create_attr_ival(
	int attr,
	int value
	)
{
	struct attr_val *my_val;

	my_val = get_node(sizeof *my_val);
	my_val->attr = attr;
	my_val->value.i = value;
	my_val->type = T_Integer;
	return my_val;
}

struct attr_val *
create_attr_shorts(
	int		attr,
	ntp_u_int16_t	val1,
	ntp_u_int16_t	val2
	)
{
	struct attr_val *my_val;

	my_val = get_node(sizeof *my_val);
	my_val->attr = attr;
	my_val->value.u = (val1 << 16) | val2;
	my_val->type = T_Integer;
	return my_val;
}

struct attr_val *
create_attr_sval(
	int attr,
	char *s
	)
{
	struct attr_val *my_val;

	my_val = get_node(sizeof *my_val);
	my_val->attr = attr;
	if (NULL == s)			/* free() hates NULL */
		s = estrdup("");
	my_val->value.s = s;
	my_val->type = T_String;
	return my_val;
}

struct attr_val *
create_attr_pval(
	int attr,
	void *p
	)
{
	struct attr_val *my_val;

	my_val = get_node(sizeof *my_val);
	my_val->attr = attr;
	my_val->value.p = p;
	my_val->type = T_Void;
	return my_val;
}

int *
create_ival(
	int val
	)
{
	int *p = get_node(sizeof *p);

	*p = val;
	return p;
}

double *
create_dval(
	double val
	)
{
	double *p = get_node(sizeof *p);

	*p = val;
	return p;
}

void **
create_pval(
	void *val
	)
{
	void **p = get_node(sizeof *p);

	*p = val;
	return p;
}

struct address_node *
create_address_node(
	char *addr,
	int type
	)
{
	struct address_node *my_node;

	NTP_REQUIRE(NULL != addr);
	
	my_node = get_node(sizeof *my_node);

	my_node->address = addr;
	my_node->type = type;

	return my_node;
}


void
destroy_address_node(
	struct address_node *my_node
	)
{
	NTP_REQUIRE(NULL != my_node);
	NTP_REQUIRE(NULL != my_node->address);

	free(my_node->address);
	free_node(my_node);
}


struct peer_node *
create_peer_node(
	int hmode,
	struct address_node *addr,
	queue *options
	)
{
	struct peer_node *my_node;
	struct attr_val *option;
	int freenode;
	int errflag = 0;

	my_node = get_node(sizeof(*my_node));

	/* Initialize node values to default */
	my_node->minpoll = 0;
	my_node->maxpoll = 0;
	my_node->ttl = 0;
	my_node->peerversion = NTP_VERSION;
	my_node->peerkey = 0;
	my_node->bias = 0;
	my_node->peerflags = create_queue();

	/* Now set the node to the read values */
	my_node->host_mode = hmode;
	my_node->addr = addr;

	/*
	 * the options list mixes items that will be saved in the
	 * peer_node as explicit members, such as minpoll, and
	 * those that are moved from the options queue intact
	 * to the peer_node's peerflags queue.  The options
	 * queue is consumed and destroyed here.
	 */

	while (options && NULL != (option = dequeue(options))) {

		freenode = 1;
		/* Check the kind of option being set */
		switch (option->attr) {

		case T_Flag:
			enqueue(my_node->peerflags, option); 
			freenode = 0;
			break;

		case T_Minpoll:
			if (option->value.i < NTP_MINPOLL) {
				msyslog(LOG_INFO,
					"minpoll: provided value (%d) is below minimum (%d)",
					option->value.i, NTP_MINPOLL);
				my_node->minpoll = NTP_MINPOLL;
			}
			else
				my_node->minpoll = option->value.i;
			break;

		case T_Maxpoll:
			if (option->value.i > NTP_MAXPOLL) {
				msyslog(LOG_INFO,
					"maxpoll: provided value (%d) is above maximum (%d)",
					option->value.i, NTP_MAXPOLL);
				my_node->maxpoll = NTP_MAXPOLL;
			}
			else
				my_node->maxpoll = option->value.i;
			break;

		case T_Ttl:
			if (my_node->ttl >= MAX_TTL) {
				msyslog(LOG_ERR, "ttl: invalid argument");
				errflag = 1;
			}
			else
				my_node->ttl = option->value.i;
			break;

		case T_Mode:
			my_node->ttl = option->value.i;
			break;

		case T_Key:
			my_node->peerkey = option->value.i;
			break;

		case T_Version:
			my_node->peerversion = option->value.i;
			break;

		case T_Bias:
			my_node->bias = option->value.d;
			break;

		default:
			msyslog(LOG_ERR, 
				"Unknown peer/server option token %s",
				token_name(option->attr));
			errflag = 1;
		}
		if (freenode)
			free_node(option);
	}
	DESTROY_QUEUE(options);

	/* Check if errors were reported. If yes, ignore the node */
	if (errflag) {
		free_node(my_node);
		my_node = NULL;
	}
	return my_node;
}


struct unpeer_node *
create_unpeer_node(
	struct address_node *addr
	)
{
	struct unpeer_node *	my_node;
	char *			pch;

	my_node = get_node(sizeof(*my_node));

	/*
	 * From the parser's perspective an association ID fits into
	 * its generic T_String definition of a name/address "address".
	 * We treat all valid 16-bit numbers as association IDs.
	 */
	pch = addr->address;
	while (*pch && isdigit(*pch))
		pch++;

	if (!*pch 
	    && 1 == sscanf(addr->address, "%u", &my_node->assocID)
	    && my_node->assocID <= USHRT_MAX) {
		
		destroy_address_node(addr);
		my_node->addr = NULL;
	} else {
		my_node->assocID = 0;
		my_node->addr = addr;
	}

	return my_node;
}

struct filegen_node *
create_filegen_node(
	int	filegen_token,
	queue *	options
	)
{
	struct filegen_node *my_node;
	
	my_node = get_node(sizeof *my_node);
	my_node->filegen_token = filegen_token;
	my_node->options = options;

	return my_node;
}


struct restrict_node *
create_restrict_node(
	struct address_node *addr,
	struct address_node *mask,
	queue *flags,
	int line_no
	)
{
	struct restrict_node *my_node;
	
	my_node = get_node(sizeof *my_node);

	my_node->addr = addr;
	my_node->mask = mask;
	my_node->flags = flags;
	my_node->line_no = line_no;

	return my_node;
}

void
destroy_restrict_node(
	struct restrict_node *my_node
	)
{
	/* With great care, free all the memory occupied by
	 * the restrict node
	 */
	if (my_node->addr)
		destroy_address_node(my_node->addr);
	if (my_node->mask)
		destroy_address_node(my_node->mask);
	DESTROY_QUEUE(my_node->flags);
	free_node(my_node);
}


struct setvar_node *
create_setvar_node(
	char *	var,
	char *	val,
	int	isdefault
	)
{
	char *	pch;
	struct setvar_node *my_node;

	/* do not allow = in the variable name */
	if (NULL != (pch = strchr(var, '=')))
		*pch = '\0';

	/* Now store the string into a setvar_node */
	my_node = get_node(sizeof *my_node);
	my_node->var = var;
	my_node->val = val;
	my_node->isdefault = isdefault;

	return my_node;
}


nic_rule_node *
create_nic_rule_node(
	int match_class,
	char *if_name,	/* interface name or numeric address */
	int action
	)
{
	nic_rule_node *my_node;
	
	NTP_REQUIRE(match_class != 0 || if_name != NULL);

	my_node = get_node(sizeof(*my_node));
	my_node->match_class = match_class;
	my_node->if_name = if_name;
	my_node->action = action;

	return my_node;
}


struct addr_opts_node *
create_addr_opts_node(
	struct address_node *addr,
	queue *options
	)
{
	struct addr_opts_node *my_node;

	my_node = get_node(sizeof *my_node);
	my_node->addr = addr;
	my_node->options = options;
	return my_node;
}

script_info *
create_sim_script_info(
	double duration,
	queue *script_queue
	)
{
#ifdef SIM
	return NULL;
#else
	script_info *my_info;
	struct attr_val *my_attr_val;

	my_info = get_node(sizeof *my_info);

	/* Initialize Script Info with default values*/
	my_info->duration = duration;
	my_info->freq_offset = 0;
	my_info->wander = 0;
	my_info->jitter = 0;
	my_info->prop_delay = NET_DLY;
	my_info->proc_delay = PROC_DLY;

	/* Traverse the script_queue and fill out non-default values */
	my_attr_val = queue_head(script_queue);
	while (my_attr_val != NULL) {
		/* Set the desired value */
		switch (my_attr_val->attr) {

		case T_Freq_Offset:
			my_info->freq_offset = my_attr_val->value.d;
			break;

		case T_Wander:
			my_info->wander = my_attr_val->value.d;
			break;

		case T_Jitter:
			my_info->jitter = my_attr_val->value.d;
			break;

		case T_Prop_Delay:
			my_info->prop_delay = my_attr_val->value.d;
			break;

		case T_Proc_Delay:
			my_info->proc_delay = my_attr_val->value.d;
			break;

		default:
			msyslog(LOG_ERR, 
				"Unknown script token %d",
				my_attr_val->attr);
		}
	}
	return (my_info);
#endif
}


#if !defined(SIM)

#define ADDR_LENGTH 16 + 1

static sockaddr_u *
get_next_address(
	struct address_node *addr
	)
{
	const char addr_prefix[] = "192.168.0.";
	static int curr_addr_no = 1;
	char addr_string[ADDR_LENGTH];
	sockaddr_u *final_addr;
	struct addrinfo *ptr;
	int retval;
	
	final_addr = emalloc(sizeof *final_addr);

	if (addr->type == T_String) {
		snprintf(addr_string, ADDR_LENGTH, "%s%d", addr_prefix, curr_addr_no++);
		printf("Selecting ip address %s for hostname %s\n", addr_string, addr->address);
		retval = getaddrinfo(addr_string, "ntp", NULL, &ptr);
	} else
		retval = getaddrinfo(addr->address, "ntp", NULL, &ptr);

	if (!retval) {
		memcpy(final_addr, ptr->ai_addr, ptr->ai_addrlen);
		fprintf(stderr, "Successful in setting ip address of simulated server to: %s\n", stoa(final_addr));
	}
	else {
		fprintf(stderr, "ERROR!! Could not get a new address\n");
		exit(1);
	}
	freeaddrinfo(ptr);
	return final_addr;
}
#endif /* !SIM */


server_info *
create_sim_server(
	struct address_node *addr,
	double server_offset,
	queue *script
	)
{
#ifdef SIM
	return NULL;
#else
	server_info *my_info;

	my_info = get_node(sizeof *my_info);

	my_info->server_time = server_offset;
	my_info->addr = get_next_address(addr);
	my_info->script = script;
	my_info->curr_script = dequeue(my_info->script);
	return my_info;
#endif /* SIM */
}

struct sim_node *
create_sim_node(
	queue *init_opts,
	queue *servers
	)
{
	struct sim_node *my_node;
	
	my_node = get_node(sizeof *my_node);

	my_node->init_opts = init_opts;
	my_node->servers = servers;
	return my_node;
}




/* FUNCTIONS FOR PERFORMING THE CONFIGURATION
 * ------------------------------------------
 */

static void
config_other_modes(
	struct config_tree *ptree
	)
{
	sockaddr_u addr_sock;
	struct address_node *addr_node;

	if (ptree->broadcastclient)
		proto_config(PROTO_BROADCLIENT, ptree->broadcastclient, 0., NULL);

	/* Configure the many-cast servers */
	addr_node = queue_head(ptree->manycastserver);
	if (addr_node != NULL) {
		do {
			ZERO_SOCK(&addr_sock);
			AF(&addr_sock) = (u_short)addr_node->type;

			if (getnetnum(addr_node->address, &addr_sock, 1, t_UNK)  == 1)
				proto_config(PROTO_MULTICAST_ADD, 0, 0., &addr_sock);

			addr_node = next_node(addr_node);
		} while (addr_node != NULL);
		sys_manycastserver = 1;
	}

	/* Configure the multicast clients */
	addr_node = queue_head(ptree->multicastclient);
	if (addr_node != NULL) {
		do {
			ZERO_SOCK(&addr_sock);
			AF(&addr_sock) = (u_short)addr_node->type;

			if (getnetnum(addr_node->address, &addr_sock, 1, t_UNK)  == 1)
				proto_config(PROTO_MULTICAST_ADD, 0, 0., &addr_sock);

			addr_node = next_node(addr_node);
		} while (addr_node != NULL);
		proto_config(PROTO_MULTICAST_ADD, 1, 0., NULL);
	}
}


#ifdef FREE_CFG_T
static void
free_config_other_modes(
	struct config_tree *ptree
	)
{
	struct address_node *addr_node;

	while (NULL != (addr_node = dequeue(ptree->manycastserver)))
		destroy_address_node(addr_node);

	while (NULL != (addr_node = dequeue(ptree->multicastclient)))
		destroy_address_node(addr_node);
}
#endif	/* FREE_CFG_T */


static void
config_auth(
	struct config_tree *ptree
	)
{
	ntp_u_int16_t	ufirst;
	ntp_u_int16_t	ulast;
	ntp_u_int16_t	u;
	struct attr_val *my_val;
#ifdef OPENSSL
#ifndef NO_INTRES
	u_char		digest[EVP_MAX_MD_SIZE];
	u_int		digest_len;
	EVP_MD_CTX	ctx;
#endif
	int		item;
#endif

	/* Crypto Command */
#ifdef OPENSSL
	item = -1;	/* quiet warning */
	my_val = queue_head(ptree->auth.crypto_cmd_list);
	while (my_val != NULL) {
		switch (my_val->attr) {

		default:
			NTP_INSIST(0);
			break;

		case T_Host:
			item = CRYPTO_CONF_PRIV;
			break;

		case T_Ident:
			item = CRYPTO_CONF_IDENT;
			break;

		case T_Pw:
			item = CRYPTO_CONF_PW;
			break;

		case T_Randfile:
			item = CRYPTO_CONF_RAND;
			break;

		case T_Sign:
			item = CRYPTO_CONF_SIGN;
			break;

		case T_Digest:
			item = CRYPTO_CONF_NID;
			break;
		}
		crypto_config(item, my_val->value.s);
		my_val = next_node(my_val);
	}
#endif /* OPENSSL */

	/* Keysdir Command */
	if (ptree->auth.keysdir) {
		if (keysdir != default_keysdir)
			free(keysdir);
		keysdir = estrdup(ptree->auth.keysdir);
	}


	/* ntp_signd_socket Command */
	if (ptree->auth.ntp_signd_socket) {
		if (ntp_signd_socket != default_ntp_signd_socket)
			free(ntp_signd_socket);
		ntp_signd_socket = estrdup(ptree->auth.ntp_signd_socket);
	}

#ifdef OPENSSL
	if (ptree->auth.cryptosw && !cryptosw) {
		crypto_setup();
		cryptosw = 1;
	}
#endif /* OPENSSL */

	/* Keys Command */
	if (ptree->auth.keys)
		getauthkeys(ptree->auth.keys);

	/* Control Key Command */
	if (ptree->auth.control_key)
		ctl_auth_keyid = (keyid_t)ptree->auth.control_key;

	/* Requested Key Command */
	if (ptree->auth.request_key) {
		DPRINTF(4, ("set info_auth_keyid to %08lx\n",
			    (u_long) ptree->auth.request_key));
		info_auth_keyid = (keyid_t)ptree->auth.request_key;
	}

	/* Trusted Key Command */
	my_val = queue_head(ptree->auth.trusted_key_list);
	for (; my_val != NULL; my_val = next_node(my_val)) {
		if ('i' == my_val->attr)
			authtrust(my_val->value.i, 1);
		else if ('-' == my_val->attr) {
			ufirst = my_val->value.u >> 16;
			ulast = my_val->value.u & 0xffff;
			for (u = ufirst; u <= ulast; u++)
				authtrust(u, 1);
		}
	}

#ifdef OPENSSL
	/* crypto revoke command */
	if (ptree->auth.revoke)
		sys_revoke = ptree->auth.revoke;
#endif /* OPENSSL */

#ifndef NO_INTRES
	/* find a keyid */
	if (info_auth_keyid == 0)
		req_keyid = 65535;
	else
		req_keyid = info_auth_keyid;

	/* if doesn't exist, make up one at random */
	if (authhavekey(req_keyid)) {
		req_keytype = cache_type;
#ifndef OPENSSL
		req_hashlen = 16;
#else	/* OPENSSL follows */
		EVP_DigestInit(&ctx, EVP_get_digestbynid(req_keytype));
		EVP_DigestFinal(&ctx, digest, &digest_len);
		req_hashlen = digest_len;
#endif
	} else {
		int	rankey;

		rankey = ntp_random();
		req_keytype = NID_md5;
		req_hashlen = 16;
		MD5auth_setkey(req_keyid, req_keytype,
		    (u_char *)&rankey, sizeof(rankey));
		authtrust(req_keyid, 1);
	}

	/* save keyid so we will accept config requests with it */
	info_auth_keyid = req_keyid;
#endif /* !NO_INTRES */

}


#ifdef FREE_CFG_T
static void
free_config_auth(
	struct config_tree *ptree
	)
{
	struct attr_val *my_val;

	while (NULL != 
	       (my_val = dequeue(ptree->auth.crypto_cmd_list))) {

		free(my_val->value.s);
		free_node(my_val);
	}
	DESTROY_QUEUE(ptree->auth.crypto_cmd_list);

	DESTROY_QUEUE(ptree->auth.trusted_key_list);
}
#endif	/* FREE_CFG_T */


static void
config_tos(
	struct config_tree *ptree
	)
{
	struct attr_val *tos;
	int item;

	item = -1;	/* quiet warning */
	tos = queue_head(ptree->orphan_cmds);
	while (tos != NULL) {
		switch(tos->attr) {

		default:
			NTP_INSIST(0);
			break;

		case T_Ceiling:
			item = PROTO_CEILING;
			break;

		case T_Floor:
			item = PROTO_FLOOR;
			break;

		case T_Cohort:
			item = PROTO_COHORT;
			break;

		case T_Orphan:
			item = PROTO_ORPHAN;
			break;

		case T_Mindist:
			item = PROTO_MINDISP;
			break;

		case T_Maxdist:
			item = PROTO_MAXDIST;
			break;

		case T_Minclock:
			item = PROTO_MINCLOCK;
			break;

		case T_Maxclock:
			item = PROTO_MAXCLOCK;
			break;

		case T_Minsane:
			item = PROTO_MINSANE;
			break;

		case T_Beacon:
			item = PROTO_BEACON;
			break;
		}
		proto_config(item, 0, tos->value.d, NULL);
		tos = next_node(tos);
	}
}


#ifdef FREE_CFG_T
static void
free_config_tos(
	struct config_tree *ptree
	)
{
	struct attr_val *tos;

	while (!empty(ptree->orphan_cmds)) {
		tos = dequeue(ptree->orphan_cmds);
		free_node(tos);
	}
}
#endif	/* FREE_CFG_T */


static void
config_monitor(
	struct config_tree *ptree
	)
{
	int *pfilegen_token;
	const char *filegen_string;
	const char *filegen_file;
	FILEGEN *filegen;
	struct filegen_node *my_node;
	struct attr_val *my_opts;
	int filegen_type;
	int filegen_flag;

	/* Set the statistics directory */
	if (ptree->stats_dir)
		stats_config(STATS_STATSDIR, ptree->stats_dir);

	/* NOTE:
	 * Calling filegen_get is brain dead. Doing a string
	 * comparison to find the relavant filegen structure is
	 * expensive.
	 *
	 * Through the parser, we already know which filegen is
	 * being specified. Hence, we should either store a
	 * pointer to the specified structure in the syntax tree
	 * or an index into a filegen array.
	 *
	 * Need to change the filegen code to reflect the above.
	 */

	/* Turn on the specified statistics */
	pfilegen_token = queue_head(ptree->stats_list);
	while (pfilegen_token != NULL) {
		filegen_string = keyword(*pfilegen_token);
		filegen = filegen_get(filegen_string);

		DPRINTF(4, ("enabling filegen for %s statistics '%s%s'\n",
			    filegen_string, filegen->prefix, 
			    filegen->basename));
		filegen->flag |= FGEN_FLAG_ENABLED;
		pfilegen_token = next_node(pfilegen_token);
	}

	/* Configure the statistics with the options */
	my_node = queue_head(ptree->filegen_opts);
	while (my_node != NULL) {
		filegen_file = keyword(my_node->filegen_token);
		filegen = filegen_get(filegen_file);

		/* Initialize the filegen variables to their pre-configurtion states */
		filegen_flag = filegen->flag;
		filegen_type = filegen->type;

		/* "filegen ... enabled" is the default (when filegen is used) */
		filegen_flag |= FGEN_FLAG_ENABLED;

		my_opts = queue_head(my_node->options);
		while (my_opts != NULL) {

			switch (my_opts->attr) {

			case T_File:
				filegen_file = my_opts->value.p;
				break;

			case T_Type:
				switch (my_opts->value.i) {

				default:
					NTP_INSIST(0);
					break;

				case T_None:
					filegen_type = FILEGEN_NONE;
					break;

				case T_Pid:
					filegen_type = FILEGEN_PID;
					break;

				case T_Day:
					filegen_type = FILEGEN_DAY;
					break;

				case T_Week:
					filegen_type = FILEGEN_WEEK;
					break;

				case T_Month:
					filegen_type = FILEGEN_MONTH;
					break;

				case T_Year:
					filegen_type = FILEGEN_YEAR;
					break;

				case T_Age:
					filegen_type = FILEGEN_AGE;
					break;
				}
				break;

			case T_Flag:
				switch (my_opts->value.i) {

				case T_Link:
					filegen_flag |= FGEN_FLAG_LINK;
					break;

				case T_Nolink:
					filegen_flag &= ~FGEN_FLAG_LINK;
					break;

				case T_Enable:
					filegen_flag |= FGEN_FLAG_ENABLED;
					break;

				case T_Disable:
					filegen_flag &= ~FGEN_FLAG_ENABLED;
					break;

				default:
					msyslog(LOG_ERR, 
						"Unknown filegen flag token %d",
						my_opts->value.i);
					exit(1);
				}
				break;
			default:
				msyslog(LOG_ERR,
					"Unknown filegen option token %d",
					my_opts->attr);
				exit(1);
			}
			my_opts = next_node(my_opts);
		}
		filegen_config(filegen, filegen_file, filegen_type,
			       filegen_flag);
		my_node = next_node(my_node);
	}
}


#ifdef FREE_CFG_T
static void
free_config_monitor(
	struct config_tree *ptree
	)
{
	char **filegen_string;
	struct filegen_node *my_node;
	struct attr_val *my_opts;

	if (ptree->stats_dir) {
		free(ptree->stats_dir);
		ptree->stats_dir = NULL;
	}

	while (NULL != (filegen_string = dequeue(ptree->stats_list)))
		free_node(filegen_string);

	while (NULL != (my_node = dequeue(ptree->filegen_opts))) {

		while (NULL != (my_opts = dequeue(my_node->options)))
			free_node(my_opts);

		free_node(my_node);
	}
}
#endif	/* FREE_CFG_T */


static void
config_access(
	struct config_tree *ptree
	)
{
	static int		warned_signd;
	struct attr_val *	my_opt;
	struct restrict_node *	my_node;
	int *			curr_flag;
	sockaddr_u		addr_sock;
	sockaddr_u		addr_mask;
	u_short			flags;
	u_short			mflags;
	int			restrict_default;
	const char *		signd_warning =
#ifdef HAVE_NTP_SIGND
	    "MS-SNTP signd operations currently block ntpd degrading service to all clients.";
#else
	    "mssntp restrict bit ignored, this ntpd was configured without --enable-ntp-signd.";
#endif

	/* Configure the discard options */
	my_opt = queue_head(ptree->discard_opts);
	while (my_opt != NULL) {

		switch(my_opt->attr) {

		case T_Average:
			ntp_minpoll = my_opt->value.i;
			break;

		case T_Minimum:
			ntp_minpkt = my_opt->value.i;
			break;

		case T_Monitor:
			mon_age = my_opt->value.i;
			break;

		default:
			msyslog(LOG_ERR,
				"Unknown discard option token %d",
				my_opt->attr);
			exit(1);
		}
		my_opt = next_node(my_opt);
	}

	/* Configure the restrict options */
	for (my_node = queue_head(ptree->restrict_opts);
	     my_node != NULL;
	     my_node = next_node(my_node)) {

		ZERO_SOCK(&addr_sock);

		if (NULL == my_node->addr) {
			/*
			 * The user specified a default rule without a
			 * -4 / -6 qualifier, add to both lists
			 */
			restrict_default = 1;
			ZERO_SOCK(&addr_mask);
		} else {
			restrict_default = 0;
			/* Resolve the specified address */
			AF(&addr_sock) = (u_short)my_node->addr->type;

			if (getnetnum(my_node->addr->address,
				      &addr_sock, 1, t_UNK) != 1) {

				msyslog(LOG_ERR,
					"restrict: error in address '%s' on line %d. Ignoring...",
					my_node->addr->address, my_node->line_no);
				continue;
			}

			SET_HOSTMASK(&addr_mask, AF(&addr_sock));

			/* Resolve the mask */
			if (my_node->mask) {
				ZERO_SOCK(&addr_mask);
				AF(&addr_mask) = (u_short)my_node->mask->type;
				if (getnetnum(my_node->mask->address, &addr_mask, 1, t_MSK) != 1) {

					msyslog(LOG_ERR,
						"restrict: error in mask '%s' on line %d. Ignoring...",
						my_node->mask->address, my_node->line_no);
					continue;
				}
			}
		}

		/* Parse the flags */
		flags = 0;
		mflags = 0;

		curr_flag = queue_head(my_node->flags);
		while (curr_flag != NULL) {
			switch (*curr_flag) {

			default:
				NTP_INSIST(0);
				break;

			case T_Ntpport:
				mflags |= RESM_NTPONLY;
				break;

			case T_Flake:
				flags |= RES_TIMEOUT;
				break;

			case T_Ignore:
				flags |= RES_IGNORE;
				break;

			case T_Kod:
				flags |= RES_KOD;
				break;

			case T_Mssntp:
				flags |= RES_MSSNTP;
				break;

			case T_Limited:
				flags |= RES_LIMITED;
				break;

			case T_Lowpriotrap:
				flags |= RES_LPTRAP;
				break;

			case T_Nomodify:
				flags |= RES_NOMODIFY;
				break;

			case T_Nopeer:
				flags |= RES_NOPEER;
				break;

			case T_Noquery:
				flags |= RES_NOQUERY;
				break;

			case T_Noserve:
				flags |= RES_DONTSERVE;
				break;

			case T_Notrap:
				flags |= RES_NOTRAP;
				break;

			case T_Notrust:
				flags |= RES_DONTTRUST;
				break;

			case T_Version:
				flags |= RES_VERSION;
				break;
			}
			curr_flag = next_node(curr_flag);
		}

		/* Set the flags */
		if (restrict_default) {
			AF(&addr_sock) = AF_INET;
			hack_restrict(RESTRICT_FLAGS, &addr_sock, &addr_mask,
				      mflags, flags);

			AF(&addr_sock) = AF_INET6;
		}

		hack_restrict(RESTRICT_FLAGS, &addr_sock, &addr_mask,
			      mflags, flags);

		if ((RES_MSSNTP & flags) && !warned_signd) {
			warned_signd = 1;
			fprintf(stderr, "%s\n", signd_warning);
			msyslog(LOG_WARNING, signd_warning);
		}
	}
}


#ifdef FREE_CFG_T
static void
free_config_access(
	struct config_tree *ptree
	)
{
	struct attr_val *	my_opt;
	struct restrict_node *	my_node;
	int *			curr_flag;

	while (NULL != (my_opt = dequeue(ptree->discard_opts)))
		free_node(my_opt);

	while (NULL != (my_node = dequeue(ptree->restrict_opts))) {
		while (NULL != (curr_flag = dequeue(my_node->flags)))
			free_node(curr_flag);

		destroy_restrict_node(my_node);
	}
}
#endif	/* FREE_CFG_T */


static void
config_tinker(
	struct config_tree *ptree
	)
{
	struct attr_val *tinker;
	int item;

	item = -1;	/* quiet warning */
	tinker = queue_head(ptree->tinker);
	while (tinker != NULL) {
		switch (tinker->attr) {

		default:
			NTP_INSIST(0);
			break;

		case T_Allan:
			item = LOOP_ALLAN;
			break;

		case T_Dispersion:
			item = LOOP_PHI;
			break;

		case T_Freq:
			item = LOOP_FREQ;
			break;

		case T_Huffpuff:
			item = LOOP_HUFFPUFF;
			break;

		case T_Panic:
			item = LOOP_PANIC;
			break;

		case T_Step:
			item = LOOP_MAX;
			break;

		case T_Stepout:
			item = LOOP_MINSTEP;
			break;
		}
		loop_config(item, tinker->value.d);
		tinker = next_node(tinker);
	}
}


#ifdef FREE_CFG_T
static void
free_config_tinker(
	struct config_tree *ptree
	)
{
	struct attr_val *tinker;

	while (NULL != (tinker = dequeue(ptree->tinker)))
		free_node(tinker);
}
#endif	/* FREE_CFG_T */


/*
 * config_nic_rules - apply interface listen/ignore/drop items
 */
void
config_nic_rules(
	struct config_tree *ptree
	)
{
	nic_rule_node *	curr_node;
	sockaddr_u	addr;
	nic_rule_match	match_type;
	nic_rule_action	action;
	char *		if_name;
	char *		pchSlash;
	int		prefixlen;
	int		addrbits;

	curr_node = queue_head(ptree->nic_rules);

	if (curr_node != NULL
	    && (HAVE_OPT( NOVIRTUALIPS ) || HAVE_OPT( INTERFACE ))) {
		msyslog(LOG_ERR,
			"interface/nic rules are not allowed with --interface (-I) or --novirtualips (-L)%s",
			(input_from_file) ? ", exiting" : "");
		if (input_from_file)
			exit(1);
		else
			return;
	}

	for (;
	     curr_node != NULL;
	     curr_node = next_node(curr_node)) {

		prefixlen = -1;
		if_name = curr_node->if_name;
		if (if_name != NULL)
			if_name = estrdup(if_name);

		switch (curr_node->match_class) {

		default:
			/*
			 * this assignment quiets a gcc "may be used
			 * uninitialized" warning and is here for no
			 * other reason.
			 */
			match_type = MATCH_ALL;
			NTP_INSIST(0);
			break;

		case 0:
			/*
			 * 0 is out of range for valid token T_...
			 * and in a nic_rules_node indicates the
			 * interface descriptor is either a name or
			 * address, stored in if_name in either case.
			 */
			NTP_INSIST(if_name != NULL);
			pchSlash = strchr(if_name, '/');
			if (pchSlash != NULL)
				*pchSlash = '\0';
			if (is_ip_address(if_name, &addr)) {
				match_type = MATCH_IFADDR;
				if (pchSlash != NULL) {
					sscanf(pchSlash + 1, "%d",
					    &prefixlen);
					addrbits = 8 *
					    SIZEOF_INADDR(AF(&addr));
					prefixlen = max(-1, prefixlen);
					prefixlen = min(prefixlen,
							addrbits);
				}
			} else {
				match_type = MATCH_IFNAME;
				if (pchSlash != NULL)
					*pchSlash = '/';
			}
			break;

		case T_All:
			match_type = MATCH_ALL;
			break;

		case T_Ipv4:
			match_type = MATCH_IPV4;
			break;

		case T_Ipv6:
			match_type = MATCH_IPV6;
			break;

		case T_Wildcard:
			match_type = MATCH_WILDCARD;
			break;
		}

		switch (curr_node->action) {

		default:
			/*
			 * this assignment quiets a gcc "may be used
			 * uninitialized" warning and is here for no
			 * other reason.
			 */
			action = ACTION_LISTEN;
			NTP_INSIST(0);
			break;

		case T_Listen:
			action = ACTION_LISTEN;
			break;

		case T_Ignore:
			action = ACTION_IGNORE;
			break;

		case T_Drop:
			action = ACTION_DROP;
			break;
		}

		add_nic_rule(match_type, if_name, prefixlen,
			     action);
		timer_interfacetimeout(current_time + 2);
		if (if_name != NULL)
			free(if_name);
	}
}


#ifdef FREE_CFG_T
static void
free_config_nic_rules(
	struct config_tree *ptree
	)
{
	nic_rule_node *curr_node;

	while (NULL != (curr_node = dequeue(ptree->nic_rules))) {
		if (curr_node->if_name != NULL)
			free(curr_node->if_name);
		free_node(curr_node);
	}
	DESTROY_QUEUE(ptree->nic_rules);
}
#endif	/* FREE_CFG_T */


static void
apply_enable_disable(
	queue *	q,
	int	enable
	)
{
	struct attr_val *curr_flag;
	int option;
#ifdef BC_LIST_FRAMEWORK_NOT_YET_USED
	bc_entry *pentry;
#endif

	for (curr_flag = queue_head(q);
	     curr_flag != NULL;
	     curr_flag = next_node(curr_flag)) {

		option = curr_flag->value.i;
		switch (option) {

		default:
			msyslog(LOG_ERR,
				"can not apply enable/disable token %d, unknown",
				option);
			break;

		case T_Auth:
			proto_config(PROTO_AUTHENTICATE, enable, 0., NULL);
			break;

		case T_Bclient:
			proto_config(PROTO_BROADCLIENT, enable, 0., NULL);
			break;

		case T_Calibrate:
			proto_config(PROTO_CAL, enable, 0., NULL);
			break;

		case T_Kernel:
			proto_config(PROTO_KERNEL, enable, 0., NULL);
			break;

		case T_Monitor:
			proto_config(PROTO_MONITOR, enable, 0., NULL);
			break;

		case T_Ntp:
			proto_config(PROTO_NTP, enable, 0., NULL);
			break;

		case T_Stats:
			proto_config(PROTO_FILEGEN, enable, 0., NULL);
			break;

#ifdef BC_LIST_FRAMEWORK_NOT_YET_USED
		case T_Bc_bugXXXX:
			pentry = bc_list;
			while (pentry->token) {
				if (pentry->token == option)
					break;
				pentry++;
			}
			if (!pentry->token) {
				msyslog(LOG_ERR, 
					"compat token %d not in bc_list[]",
					option);
				continue;
			}
			pentry->enabled = enable;
			break;
#endif
		}
	}
}


static void
config_system_opts(
	struct config_tree *ptree
	)
{
	apply_enable_disable(ptree->enable_opts, 1);
	apply_enable_disable(ptree->disable_opts, 0);
}


#ifdef FREE_CFG_T
static void
free_config_system_opts(
	struct config_tree *ptree
	)
{
	struct attr_val *flag;

	while (NULL != (flag = dequeue(ptree->enable_opts)))
		free_node(flag);

	while (NULL != (flag = dequeue(ptree->disable_opts)))
		free_node(flag);
}
#endif	/* FREE_CFG_T */


static void
config_logconfig(
	struct config_tree *ptree
	)
{
	struct attr_val *my_logconfig;

	my_logconfig = queue_head(ptree->logconfig);
	while (my_logconfig != NULL) {

		switch (my_logconfig->attr) {
		case '+':
			ntp_syslogmask |= get_logmask(my_logconfig->value.s);
			break;
		case '-':
			ntp_syslogmask &= ~get_logmask(my_logconfig->value.s);
			break;
		case '=':
			ntp_syslogmask = get_logmask(my_logconfig->value.s);
			break;
		}
		my_logconfig = next_node(my_logconfig);
	}
}


#ifdef FREE_CFG_T
static void
free_config_logconfig(
	struct config_tree *ptree
	)
{
	struct attr_val *my_logconfig;

	while (NULL != (my_logconfig = dequeue(ptree->logconfig))) {		
		free(my_logconfig->value.s);
		free_node(my_logconfig);
	}
}
#endif	/* FREE_CFG_T */


static void
config_phone(
	struct config_tree *ptree
	)
{
	int i = 0;
	char **s;

	s = queue_head(ptree->phone);
	while (s != NULL) {
		if (i < COUNTOF(sys_phone) - 1) {
			sys_phone[i++] = estrdup(*s);
			sys_phone[i] = NULL;
		} else {
			msyslog(LOG_INFO,
				"phone: Number of phone entries exceeds %lu. Ignoring phone %s...",
				(u_long)(COUNTOF(sys_phone) - 1), *s);
		}
		s = next_node(s);
	}
}


#ifdef FREE_CFG_T
static void
free_config_phone(
	struct config_tree *ptree
	)
{
	char **s;

	while (NULL != (s = dequeue(ptree->phone))) {
		free(*s);
		free_node(s);
	}
}
#endif	/* FREE_CFG_T */


static void
config_qos(
	struct config_tree *ptree
	)
{
	struct attr_val *my_qosconfig;
	char *s;
#ifdef HAVE_IPTOS_SUPPORT
	unsigned int qtos = 0;
#endif

	my_qosconfig = queue_head(ptree->qos);
	while (my_qosconfig != NULL) {
		s = my_qosconfig->value.s;
#ifdef HAVE_IPTOS_SUPPORT
		if (!strcmp(s, "lowdelay"))
			qtos = CONF_QOS_LOWDELAY;
		else if (!strcmp(s, "throughput"))
			qtos = CONF_QOS_THROUGHPUT;
		else if (!strcmp(s, "reliability"))
			qtos = CONF_QOS_RELIABILITY;
		else if (!strcmp(s, "mincost"))
			qtos = CONF_QOS_MINCOST;
#ifdef IPTOS_PREC_INTERNETCONTROL
		else if (!strcmp(s, "routine") || !strcmp(s, "cs0"))
			qtos = CONF_QOS_CS0;
		else if (!strcmp(s, "priority") || !strcmp(s, "cs1"))
			qtos = CONF_QOS_CS1;
		else if (!strcmp(s, "immediate") || !strcmp(s, "cs2"))
			qtos = CONF_QOS_CS2;
		else if (!strcmp(s, "flash") || !strcmp(s, "cs3"))
			qtos = CONF_QOS_CS3; 	/* overlapping prefix on keyword */
		if (!strcmp(s, "flashoverride") || !strcmp(s, "cs4"))
			qtos = CONF_QOS_CS4;
		else if (!strcmp(s, "critical") || !strcmp(s, "cs5"))
			qtos = CONF_QOS_CS5;
		else if(!strcmp(s, "internetcontrol") || !strcmp(s, "cs6"))
			qtos = CONF_QOS_CS6;
		else if (!strcmp(s, "netcontrol") || !strcmp(s, "cs7"))
			qtos = CONF_QOS_CS7;
#endif  /* IPTOS_PREC_INTERNETCONTROL */
		if (qtos == 0)
			msyslog(LOG_ERR, "parse error, qos %s not accepted\n", s);
		else
			qos = qtos;
#endif  /* HAVE IPTOS_SUPPORT */
		/*
		 * value is set, but not being effective. Need code to
		 * change   the current connections to notice. Might
		 * also  consider logging a message about the action.
		 * XXX msyslog(LOG_INFO, "QoS %s requested by config\n", s);
		 */
		my_qosconfig = next_node(my_qosconfig);
	}
}


#ifdef FREE_CFG_T
static void
free_config_qos(
	struct config_tree *ptree
	)
{
	struct attr_val *my_qosconfig;

	while (NULL != (my_qosconfig = dequeue(ptree->qos))) {
		free(my_qosconfig->value.s);
		free_node(my_qosconfig);
	}
}
#endif	/* FREE_CFG_T */


static void
config_setvar(
	struct config_tree *ptree
	)
{
	struct setvar_node *my_node;
	size_t	varlen, vallen, octets;
	char *	str;

	str = NULL;
	my_node = queue_head(ptree->setvar);
	while (my_node != NULL) {
		varlen = strlen(my_node->var);
		vallen = strlen(my_node->val);
		octets = varlen + vallen + 1 + 1;
		str = erealloc(str, octets);
		snprintf(str, octets, "%s=%s", my_node->var,
			 my_node->val);
		set_sys_var(str, octets, (my_node->isdefault)
						? DEF 
						: 0);
		my_node = next_node(my_node);
	}
	if (str != NULL)
		free(str);
}


#ifdef FREE_CFG_T
static void
free_config_setvar(
	struct config_tree *ptree
	)
{
	struct setvar_node *my_node;

	while (NULL != (my_node = dequeue(ptree->setvar))) {
		free(my_node->var);
		free(my_node->val);
		free_node(my_node);
	}
}
#endif	/* FREE_CFG_T */


static void
config_ttl(
	struct config_tree *ptree
	)
{
	int i = 0;
	int *curr_ttl;

	curr_ttl = queue_head(ptree->ttl);
	while (curr_ttl != NULL) {
		if (i < COUNTOF(sys_ttl))
			sys_ttl[i++] = (u_char)*curr_ttl;
		else
			msyslog(LOG_INFO,
				"ttl: Number of TTL entries exceeds %lu. Ignoring TTL %d...",
				(u_long)COUNTOF(sys_ttl), *curr_ttl);

		curr_ttl = next_node(curr_ttl);
	}
	sys_ttlmax = i - 1;
}


#ifdef FREE_CFG_T
static void
free_config_ttl(
	struct config_tree *ptree
	)
{
	/* coming DESTROY_QUEUE(ptree->ttl) is enough */
}
#endif	/* FREE_CFG_T */


static void
config_trap(
	struct config_tree *ptree
	)
{
	struct addr_opts_node *curr_trap;
	struct attr_val *curr_opt;
	sockaddr_u addr_sock;
	sockaddr_u peeraddr;
	struct address_node *addr_node;
	struct interface *localaddr;
	u_short port_no;
	int err_flag;

	/* silence warning about addr_sock potentially uninitialized */
	AF(&addr_sock) = AF_UNSPEC;

	for (curr_trap = queue_head(ptree->trap);
	     curr_trap != NULL;
	     curr_trap = next_node(curr_trap)) {

		err_flag = 0;
		port_no = 0;
		localaddr = NULL;

		curr_opt = queue_head(curr_trap->options);
		while (curr_opt != NULL) {
			if (T_Port == curr_opt->attr) {
				if (curr_opt->value.i < 1 
				    || curr_opt->value.i > USHRT_MAX) {
					msyslog(LOG_ERR,
						"invalid port number "
						"%d, trap ignored", 
						curr_opt->value.i);
					err_flag = 1;
				}
				port_no = (u_short)curr_opt->value.i;
			}
			else if (T_Interface == curr_opt->attr) {
				addr_node = curr_opt->value.p;

				/* Resolve the interface address */
				ZERO_SOCK(&addr_sock);
				AF(&addr_sock) = (u_short)addr_node->type;

				if (getnetnum(addr_node->address,
					      &addr_sock, 1, t_UNK) != 1) {
					err_flag = 1;
					break;
				}

				localaddr = findinterface(&addr_sock);

				if (NULL == localaddr) {
					msyslog(LOG_ERR,
						"can't find interface with address %s",
						stoa(&addr_sock));
					err_flag = 1;
				}
			}
			curr_opt = next_node(curr_opt);
		}

		/* Now process the trap for the specified interface
		 * and port number
		 */
		if (!err_flag) {
			ZERO_SOCK(&peeraddr);
			if (1 != getnetnum(curr_trap->addr->address,
					   &peeraddr, 1, t_UNK))
				continue;

			/* port is at same location for v4 and v6 */
			SET_PORT(&peeraddr, port_no ? port_no : TRAPPORT);

			if (NULL == localaddr)
				localaddr = ANY_INTERFACE_CHOOSE(&peeraddr);
			else
				AF(&peeraddr) = AF(&addr_sock);

			if (!ctlsettrap(&peeraddr, localaddr, 0,
					NTP_VERSION))
				msyslog(LOG_ERR,
					"can't set trap for %s",
					stoa(&peeraddr));
		}
	}
}


#ifdef FREE_CFG_T
static void
free_config_trap(
	struct config_tree *ptree
	)
{
	struct addr_opts_node *curr_trap;
	struct attr_val *curr_opt;
	struct address_node *addr_node;

	while (NULL != (curr_trap = dequeue(ptree->trap))) {
		while (curr_trap->options != NULL && NULL != 
		       (curr_opt = dequeue(curr_trap->options))) {

			if (T_Interface == curr_opt->attr) {
				addr_node = curr_opt->value.p;
				destroy_address_node(addr_node);
			}
			free_node(curr_opt);
		}
		DESTROY_QUEUE(curr_trap->options);
		free_node(curr_trap);
	}
}
#endif	/* FREE_CFG_T */


static void
config_fudge(
	struct config_tree *ptree
	)
{
	struct addr_opts_node *curr_fudge;
	struct attr_val *curr_opt;
	sockaddr_u addr_sock;
	struct address_node *addr_node;
	struct refclockstat clock_stat;
	int err_flag;

	curr_fudge = queue_head(ptree->fudge);
	while (curr_fudge != NULL) {
		err_flag = 0;

		/* Get the reference clock address and
		 * ensure that it is sane
		 */
		addr_node = curr_fudge->addr;
		ZERO_SOCK(&addr_sock);
		if (getnetnum(addr_node->address, &addr_sock, 1, t_REF)
		    != 1)
			err_flag = 1;

		if (!ISREFCLOCKADR(&addr_sock)) {
			msyslog(LOG_ERR,
				"inappropriate address %s for the fudge command, line ignored",
				stoa(&addr_sock));
			err_flag = 1;
		}

		/* Parse all the options to the fudge command */
		memset(&clock_stat, 0, sizeof(clock_stat));
		curr_opt = queue_head(curr_fudge->options);
		while (curr_opt != NULL) {
			switch (curr_opt->attr) {
			case T_Time1:
				clock_stat.haveflags |= CLK_HAVETIME1;
				clock_stat.fudgetime1 = curr_opt->value.d;
				break;
			case T_Time2:
				clock_stat.haveflags |= CLK_HAVETIME2;
				clock_stat.fudgetime2 = curr_opt->value.d;
				break;
			case T_Stratum:
				clock_stat.haveflags |= CLK_HAVEVAL1;
				clock_stat.fudgeval1 = curr_opt->value.i;
				break;
			case T_Refid:
				clock_stat.haveflags |= CLK_HAVEVAL2;
				clock_stat.fudgeval2 = 0;
				memcpy(&clock_stat.fudgeval2,
				       curr_opt->value.s,
				       min(strlen(curr_opt->value.s), 4));
				break;
			case T_Flag1:
				clock_stat.haveflags |= CLK_HAVEFLAG1;
				if (curr_opt->value.i)
					clock_stat.flags |= CLK_FLAG1;
				else
					clock_stat.flags &= ~CLK_FLAG1;
				break;
			case T_Flag2:
				clock_stat.haveflags |= CLK_HAVEFLAG2;
				if (curr_opt->value.i)
					clock_stat.flags |= CLK_FLAG2;
				else
					clock_stat.flags &= ~CLK_FLAG2;
				break;
			case T_Flag3:
				clock_stat.haveflags |= CLK_HAVEFLAG3;
				if (curr_opt->value.i)
					clock_stat.flags |= CLK_FLAG3;
				else
					clock_stat.flags &= ~CLK_FLAG3;
				break;
			case T_Flag4:
				clock_stat.haveflags |= CLK_HAVEFLAG4;
				if (curr_opt->value.i)
					clock_stat.flags |= CLK_FLAG4;
				else
					clock_stat.flags &= ~CLK_FLAG4;
				break;
			default:
				msyslog(LOG_ERR,
					"Unexpected fudge internal flag 0x%x for %s\n",
					curr_opt->attr, stoa(&addr_sock));
				exit(curr_opt->attr ? curr_opt->attr : 1);
			}

			curr_opt = next_node(curr_opt);
		}

#ifdef REFCLOCK
		if (!err_flag)
			refclock_control(&addr_sock, &clock_stat,
					 (struct refclockstat *)0);
#endif

		curr_fudge = next_node(curr_fudge);
	}
}


#ifdef FREE_CFG_T
static void
free_config_fudge(
	struct config_tree *ptree
	)
{
	struct addr_opts_node *curr_fudge;
	struct attr_val *curr_opt;

	while (NULL != (curr_fudge = dequeue(ptree->fudge))) {
		while (NULL != (curr_opt = dequeue(curr_fudge->options))) {
			
			switch (curr_opt->attr) {
			case CLK_HAVEVAL2:
				free(curr_opt->value.s);
			}

			free_node(curr_opt);
		}

		DESTROY_QUEUE(curr_fudge->options);
		free_node(curr_fudge);
	}
}
#endif	/* FREE_CFG_T */


static void
config_vars(
	struct config_tree *ptree
	)
{
	struct attr_val *curr_var;
	FILE *new_file;
	int len;

	curr_var = queue_head(ptree->vars);
	while (curr_var != NULL) {
		/* Determine which variable to set and set it */
		switch (curr_var->attr) {
		case T_Broadcastdelay:
			proto_config(PROTO_BROADDELAY, 0, curr_var->value.d, NULL);
			break;
		case T_Calldelay:
			proto_config(PROTO_CALLDELAY, curr_var->value.i, 0, NULL);
			break;
		case T_Tick:
			proto_config(PROTO_ADJ, 0, curr_var->value.d, NULL);
			break;
		case T_Driftfile:
			if ('\0' == curr_var->value.s[0]) {
				stats_drift_file = 0;
				msyslog(LOG_INFO, "config: driftfile disabled\n");
			} else
				stats_config(STATS_FREQ_FILE, curr_var->value.s);
			break;
		case T_WanderThreshold:
			wander_threshold = curr_var->value.d;
			break;
		case T_Leapfile:
			stats_config(STATS_LEAP_FILE, curr_var->value.s);
			break;
		case T_Pidfile:
			stats_config(STATS_PID_FILE, curr_var->value.s);
			break;
		case T_Logfile:
			new_file = fopen(curr_var->value.s, "a");
			if (new_file != NULL) {
				NLOG(NLOG_SYSINFO) /* conditional if clause for conditional syslog */
				    msyslog(LOG_NOTICE, "logging to file %s", curr_var->value.s);
				if (syslog_file != NULL &&
				    fileno(syslog_file) != fileno(new_file))
					(void)fclose(syslog_file);

				syslog_file = new_file;
				syslogit = 0;
			}
			else
				msyslog(LOG_ERR,
					"Cannot open log file %s",
					curr_var->value.s);
			break;

		case T_Saveconfigdir:
			if (saveconfigdir != NULL)
				free(saveconfigdir);
			len = strlen(curr_var->value.s);
			if (0 == len)
				saveconfigdir = NULL;
			else if (DIR_SEP != curr_var->value.s[len - 1]
#ifdef SYS_WINNT	/* slash is also a dir. sep. on Windows */
				 && '/' != curr_var->value.s[len - 1]
#endif
				    ) {
					len++;
					saveconfigdir = emalloc(len + 1);
					snprintf(saveconfigdir, len + 1,
						 "%s%c",
						 curr_var->value.s,
						 DIR_SEP);
				} else
					saveconfigdir = estrdup(
					    curr_var->value.s);
			break;

		case T_Automax:
#ifdef OPENSSL
			sys_automax = curr_var->value.i;
#endif
			break;

		default:
			msyslog(LOG_ERR,
				"config_vars(): unexpected token %d",
				curr_var->attr);
		}
		curr_var = next_node(curr_var);
	}
}


#ifdef FREE_CFG_T
static void
free_config_vars(
	struct config_tree *ptree
	)
{
	struct attr_val *curr_var;

	while (NULL != (curr_var = dequeue(ptree->vars))) {
		/* Determine which variable to set and set it */
		switch (curr_var->attr) {
		case T_Driftfile:
		case T_Leapfile:
		case T_Pidfile:
		case T_Logfile:
			free(curr_var->value.s);
		}
		free_node(curr_var);
	}
}
#endif	/* FREE_CFG_T */


/* Define a function to check if a resolved address is sane.
 * If yes, return 1, else return 0;
 */
static int
is_sane_resolved_address(
	sockaddr_u *	peeraddr,
	int		hmode
	)
{
	if (!ISREFCLOCKADR(peeraddr) && ISBADADR(peeraddr)) {
		msyslog(LOG_ERR,
			"attempt to configure invalid address %s",
			stoa(peeraddr));
		return 0;
	}
	/*
	 * Shouldn't be able to specify multicast
	 * address for server/peer!
	 * and unicast address for manycastclient!
	 */
	if ((T_Server == hmode || T_Peer == hmode || T_Pool == hmode)
	    && IS_MCAST(peeraddr)) {
		msyslog(LOG_ERR,
			"attempt to configure invalid address %s",
			stoa(peeraddr));
		return 0;
	}
	if (T_Manycastclient == hmode && !IS_MCAST(peeraddr)) {
		msyslog(LOG_ERR,
			"attempt to configure invalid address %s",
			stoa(peeraddr));
		return 0;
	}

	if (IS_IPV6(peeraddr) && !ipv6_works)
		return 0;

	/* Ok, all tests succeeded, now we can return 1 */
	return 1;
}

static int
get_correct_host_mode(
	int hmode
	)
{
	switch (hmode) {
	    case T_Server:
	    case T_Pool:
	    case T_Manycastclient:
		return MODE_CLIENT;
		break;
	    case T_Peer:
		return MODE_ACTIVE;
		break;
	    case T_Broadcast:
		return MODE_BROADCAST;
		break;
	    default:
		return -1;
	}
}

static void
config_peers(
	struct config_tree *ptree
	)
{
	struct addrinfo *res, *res_bak;
	sockaddr_u peeraddr;
	struct peer_node *curr_peer;
	struct attr_val *option;
	int hmode;
	int peerflags;
	int status;
	int no_needed;
	int i;

	curr_peer = queue_head(ptree->peers);
	while (curr_peer != NULL) {
		/* Find the number of associations needed.
		 * If a pool coomand is specified, then sys_maxclock needed
		 * else, only one is needed
		 */
		no_needed = (T_Pool == curr_peer->host_mode)
				? sys_maxclock
				: 1;

		/* Find the correct host-mode */
		hmode = get_correct_host_mode(curr_peer->host_mode);
		NTP_INSIST(hmode != -1);

		/* translate peerflags options to bits */
		peerflags = 0;
		option = queue_head(curr_peer->peerflags);
		for (;	option != NULL; option = next_node(option))
			switch (option->value.i) {

			default:
				NTP_INSIST(0);
				break;

			case T_Autokey:
				peerflags |= FLAG_SKEY;
				break;

			case T_Burst:
				peerflags |= FLAG_BURST;
				break;

			case T_Iburst:
				peerflags |= FLAG_IBURST;
				break;

			case T_Noselect:
				peerflags |= FLAG_NOSELECT;
				break;

			case T_Preempt:
				peerflags |= FLAG_PREEMPT;
				break;

			case T_Prefer:
				peerflags |= FLAG_PREFER;
				break;

			case T_True:
				peerflags |= FLAG_TRUE;
				break;

			case T_Xleave:
				peerflags |= FLAG_XLEAVE;
				break;
			}

		/* Attempt to resolve the address */
		ZERO_SOCK(&peeraddr);
		AF(&peeraddr) = (u_short)curr_peer->addr->type;

		status = get_multiple_netnums(curr_peer->addr->address,
		    &peeraddr, &res, 0, t_UNK);

#ifdef FORCE_DEFER_DNS
		/* Hack for debugging Deferred DNS
		 * Pretend working names didn't work.
		 */
		if (status == 1) {
			/* Deferring everything breaks refclocks. */
			memcpy(&peeraddr, res->ai_addr, res->ai_addrlen);
			if (!ISREFCLOCKADR(&peeraddr)) {
				status = 0;  /* force deferred DNS path */
				msyslog(LOG_INFO, "Forcing Deferred DNS for %s, %s",
					curr_peer->addr->address, stoa(&peeraddr));
			} else {
				msyslog(LOG_INFO, "NOT Deferring DNS for %s, %s",
					curr_peer->addr->address, stoa(&peeraddr));
			}
		}
#endif

		/* I don't know why getnetnum would return -1.
		 * The old code had this test, so I guess it must be
		 * useful
		 */
		if (status == -1) {
			/* Do nothing, apparently we found an IPv6
			 * address and can't do anything about it */
		}
		/* Check if name resolution failed. If yes, store the
		 * peer information in a file for asynchronous
		 * resolution later
		 */
		else if (status != 1) {
			msyslog(LOG_INFO, "Deferring DNS for %s %d", curr_peer->addr->address, no_needed);
			save_resolve(curr_peer->addr->address,
				     no_needed,
				     curr_peer->addr->type,
				     hmode,
				     curr_peer->peerversion,
				     curr_peer->minpoll,
				     curr_peer->maxpoll,
				     peerflags,
				     curr_peer->ttl,
				     curr_peer->peerkey,
				     (u_char *)"*");
		}
		/* Yippie!! Name resolution has succeeded!!!
		 * Now we can proceed to some more sanity checks on
		 * the resolved address before we start to configure
		 * the peer
		 */
		else {
			res_bak = res;

			/*
			 * Loop to configure the desired number of
			 * associations
			 */
			for (i = 0; (i < no_needed) && res; res =
			    res->ai_next) {
				++i;
				memcpy(&peeraddr, res->ai_addr,
				    res->ai_addrlen);
				if (is_sane_resolved_address(
					&peeraddr,
					curr_peer->host_mode))

					peer_config(&peeraddr,
					    NULL,
					    hmode,
					    curr_peer->peerversion,
					    curr_peer->minpoll,
					    curr_peer->maxpoll,
					    peerflags,
					    curr_peer->ttl,
					    curr_peer->peerkey,
					    (u_char *)"*");
			}
			freeaddrinfo(res_bak);
		}
		curr_peer = next_node(curr_peer);
	}
}


#ifdef FREE_CFG_T
static void
free_config_peers(
	struct config_tree *ptree
	)
{
	struct peer_node *curr_peer;

	while (NULL != (curr_peer = dequeue(ptree->peers))) {
		destroy_address_node(curr_peer->addr);
		DESTROY_QUEUE(curr_peer->peerflags);
		free_node(curr_peer);
	}
}
#endif	/* FREE_CFG_T */


static void
config_unpeers(
	struct config_tree *ptree
	)
{
	struct addrinfo *res, *res_bak;
	sockaddr_u peeraddr;
	struct unpeer_node *curr_unpeer;
	struct peer *peer;
	int status;
	int found;

	for (curr_unpeer = queue_head(ptree->unpeers);
	     curr_unpeer != NULL;
	     curr_unpeer = next_node(curr_unpeer)) {

		/*
		 * Either AssocID will be zero, and we unpeer by name/
		 * address addr, or it is nonzero and addr NULL.
		 */
		if (curr_unpeer->assocID) {
			peer = findpeerbyassoc((u_int)curr_unpeer->assocID);
			if (peer != NULL) {
				peer_clear(peer, "GONE");
				unpeer(peer);
			}	

			continue;
		}

		/* Attempt to resolve the name or address */
		ZERO_SOCK(&peeraddr);
		AF(&peeraddr) = (u_short)curr_unpeer->addr->type;

		status = get_multiple_netnums(
			curr_unpeer->addr->address, &peeraddr, &res, 0,
			t_UNK);

		/* I don't know why getnetnum would return -1.
		 * The old code had this test, so I guess it must be
		 * useful
		 */
		if (status == -1) {
			/* Do nothing, apparently we found an IPv6
			 * address and can't do anything about it */
		}
		/* Check if name resolution failed. If yes, throw
		 * up our hands.
		 */
		else if (status != 1) {
			/* Do nothing */
		}
		/* Yippie!! Name resolution has succeeded!!!
		 */
		else {
			res_bak = res;

			/*
			 * Loop through the addresses found
			 */
			while (res) {
				memcpy(&peeraddr, res->ai_addr, res->ai_addrlen);

				found = 0;
				peer = NULL;

				DPRINTF(1, ("searching for %s\n", stoa(&peeraddr)));

				while (!found) {
					peer = findexistingpeer(&peeraddr, peer, -1, 0);
					if (!peer)
						break;
					if (peer->flags & FLAG_CONFIG)
						found = 1;
				}

				if (found) {
					peer_clear(peer, "GONE");
					unpeer(peer);
				}

				res = res->ai_next;
			}
			freeaddrinfo(res_bak);
		}
	}
}


#ifdef FREE_CFG_T
static void
free_config_unpeers(
	struct config_tree *ptree
	)
{
	struct unpeer_node *curr_unpeer;

	while (NULL != (curr_unpeer = dequeue(ptree->unpeers))) {
		destroy_address_node(curr_unpeer->addr);
		free_node(curr_unpeer);
	}
}
#endif	/* FREE_CFG_T */


#ifdef SIM
static void
config_sim(
	struct config_tree *ptree
	)
{
	int i;
	server_info *serv_info;
	struct attr_val *init_stmt;

	/* Check if a simulate block was found in the configuration code.
	 * If not, return an error and exit
	 */
	if (NULL == ptree->sim_details) {
		fprintf(stderr, "ERROR!! I couldn't find a \"simulate\" block for configuring the simulator.\n");
		fprintf(stderr, "\tCheck your configuration file.\n");
		exit(1);
	}

	/* Process the initialization statements
	 * -------------------------------------
	 */
	init_stmt = queue_head(ptree->sim_details->init_opts);
	while (init_stmt != NULL) {

		switch(init_stmt->attr) {

		case T_Beep_Delay:
			simulation.beep_delay = init_stmt->value.d;
			break;

		case T_Sim_Duration:
			simulation.end_time = init_stmt->value.d;
			break;

		default:
			fprintf(stderr,
				"Unknown simulator init token %d\n",
				init_stmt->attr);
			exit(1);
		}
		init_stmt = next_node(init_stmt);
	}


	/* Process the server list
	 * -----------------------
	 */
	simulation.num_of_servers = 
		get_no_of_elements(ptree->sim_details->servers);
	simulation.servers = emalloc(simulation.num_of_servers 
				     * sizeof(server_info));

	serv_info = queue_head(ptree->sim_details->servers);
	for (i = 0;i < simulation.num_of_servers; i++) {
		if (NULL == serv_info) {
			fprintf(stderr, "Simulator server list is corrupt\n");
			exit(1);
		} else
			memcpy(&simulation.servers[i], serv_info, sizeof(server_info));
		serv_info = next_node(serv_info);
	}

	/* Create server associations */
	printf("Creating server associations\n");
	create_server_associations();
	fprintf(stderr,"\tServer associations successfully created!!\n");
}


#ifdef FREE_CFG_T
static void
free_config_sim(
	struct config_tree *ptree
	)
{
	if (NULL == ptree->sim_details)
		return;

	DESTROY_QUEUE(ptree->sim_details->init_opts);
	DESTROY_QUEUE(ptree->sim_details->servers);

	/* Free the sim_node memory and set the sim_details as NULL */
	free_node(ptree->sim_details);
	ptree->sim_details = NULL;
}
#endif	/* FREE_CFG_T */
#endif	/* SIM */


/* Define two different config functions. One for the daemon and the other for
 * the simulator. The simulator ignores a lot of the standard ntpd configuration
 * options
 */
#ifndef SIM
static void
config_ntpd(
	struct config_tree *ptree
	)
{
	config_nic_rules(ptree);
	io_open_sockets();
	config_monitor(ptree);
	config_auth(ptree);
	config_tos(ptree);
	config_access(ptree);
	config_tinker(ptree);
	config_system_opts(ptree);
	config_logconfig(ptree);
	config_phone(ptree);
	config_setvar(ptree);
	config_ttl(ptree);
	config_trap(ptree);
	config_vars(ptree);
	config_other_modes(ptree);
	config_peers(ptree);
	config_unpeers(ptree);
	config_fudge(ptree);
	config_qos(ptree);
}
#endif	/* !SIM */


#ifdef SIM
static void
config_ntpdsim(
	struct config_tree *ptree
	)
{
	printf("Configuring Simulator...\n");
	printf("Some ntpd-specific commands in the configuration file will be ignored.\n");

	config_tos(ptree);
	config_monitor(ptree);
	config_tinker(ptree);
	config_system_opts(ptree);
	config_logconfig(ptree);
	config_vars(ptree);
	config_sim(ptree);
}
#endif /* SIM */


/*
 * config_remotely() - implements ntpd side of ntpq :config
 */
void
config_remotely(
	sockaddr_u *	remote_addr
	)
{
	struct FILE_INFO remote_cuckoo;
	char origin[128];

	snprintf(origin, sizeof(origin), "remote config from %s",
		 stoa(remote_addr));
	memset(&remote_cuckoo, 0, sizeof(remote_cuckoo));
	remote_cuckoo.fname = origin;
	remote_cuckoo.line_no = 1;
	remote_cuckoo.col_no = 1;
	ip_file = &remote_cuckoo;
	input_from_file = 0;

	init_syntax_tree(&cfgt);
	yyparse();
	cfgt.source.attr = CONF_SOURCE_NTPQ;
	cfgt.timestamp = time(NULL);
	cfgt.source.value.s = estrdup(stoa(remote_addr));

	DPRINTF(1, ("Finished Parsing!!\n"));

	save_and_apply_config_tree();

	input_from_file = 1;
}


/*
 * getconfig() - process startup configuration file e.g /etc/ntp.conf
 */
void
getconfig(
	int argc,
	char *argv[]
	)
{
	char line[MAXLINE];

#ifdef DEBUG
	atexit(free_all_config_trees);
#endif
#ifndef SYS_WINNT
	config_file = CONFIG_FILE;
#else
	temp = CONFIG_FILE;
	if (!ExpandEnvironmentStrings((LPCTSTR)temp, (LPTSTR)config_file_storage, (DWORD)sizeof(config_file_storage))) {
		msyslog(LOG_ERR, "ExpandEnvironmentStrings CONFIG_FILE failed: %m\n");
		exit(1);
	}
	config_file = config_file_storage;

	temp = ALT_CONFIG_FILE;
	if (!ExpandEnvironmentStrings((LPCTSTR)temp, (LPTSTR)alt_config_file_storage, (DWORD)sizeof(alt_config_file_storage))) {
		msyslog(LOG_ERR, "ExpandEnvironmentStrings ALT_CONFIG_FILE failed: %m\n");
		exit(1);
	}
	alt_config_file = alt_config_file_storage;

#endif /* SYS_WINNT */
	res_fp = NULL;
	ntp_syslogmask = NLOG_SYNCMASK; /* set more via logconfig */

	/*
	 * install a non default variable with this daemon version
	 */
	snprintf(line, sizeof(line), "daemon_version=\"%s\"", Version);
	set_sys_var(line, strlen(line)+1, RO);

	/*
	 * Set up for the first time step to install a variable showing
	 * which syscall is being used to step.
	 */
	set_tod_using = &ntpd_set_tod_using;

	/*
	 * On Windows, the variable has already been set, on the rest,
	 * initialize it to "UNKNOWN".
	 */
#ifndef SYS_WINNT
	strncpy(line, "settimeofday=\"UNKNOWN\"", sizeof(line));
	set_sys_var(line, strlen(line) + 1, RO);
#endif

	/*
	 * Initialize the loop.
	 */
	loop_config(LOOP_DRIFTINIT, 0.);

	getCmdOpts(argc, argv);

	init_syntax_tree(&cfgt);

	curr_include_level = 0;
	if (
		(fp[curr_include_level] = F_OPEN(FindConfig(config_file), "r")) == NULL
#ifdef HAVE_NETINFO
		/* If there is no config_file, try NetInfo. */
		&& check_netinfo && !(config_netinfo = get_netinfo_config())
#endif /* HAVE_NETINFO */
		) {
		msyslog(LOG_INFO, "getconfig: Couldn't open <%s>", FindConfig(config_file));
#ifndef SYS_WINNT
		io_open_sockets();

		return;
#else
		/* Under WinNT try alternate_config_file name, first NTP.CONF, then NTP.INI */

		if ((fp[curr_include_level] = F_OPEN(FindConfig(alt_config_file), "r")) == NULL) {

			/*
			 * Broadcast clients can sometimes run without
			 * a configuration file.
			 */
			msyslog(LOG_INFO, "getconfig: Couldn't open <%s>", FindConfig(alt_config_file));
			io_open_sockets();

			return;
		}
		cfgt.source.value.s = estrdup(alt_config_file);
#endif	/* SYS_WINNT */
	} else
		cfgt.source.value.s = estrdup(config_file);


	/*** BULK OF THE PARSER ***/
#ifdef DEBUG
	yydebug = !!(debug >= 5);
#endif
	ip_file = fp[curr_include_level];
	yyparse();
	
	DPRINTF(1, ("Finished Parsing!!\n"));

	cfgt.source.attr = CONF_SOURCE_FILE;	
	cfgt.timestamp = time(NULL);

	save_and_apply_config_tree();

	while (curr_include_level != -1)
		FCLOSE(fp[curr_include_level--]);

#ifdef HAVE_NETINFO
	if (config_netinfo)
		free_netinfo_config(config_netinfo);
#endif /* HAVE_NETINFO */

	/*
	printf("getconfig: res_fp <%p> call_resolver: %d", res_fp, call_resolver);
	*/

	if (res_fp != NULL) {
		if (call_resolver) {
			/*
			 * Need name resolution
			 */
			do_resolve_internal();
		}
	}
}


void
save_and_apply_config_tree(void)
{
	struct config_tree *ptree;
#ifndef SAVECONFIG
	struct config_tree *punlinked;
#endif

	/*
	 * Keep all the configuration trees applied since startup in
	 * a list that can be used to dump the configuration back to
	 * a text file.
	 */
	ptree = emalloc(sizeof(*ptree));
	memcpy(ptree, &cfgt, sizeof(*ptree));
	memset(&cfgt, 0, sizeof(cfgt));
	
	LINK_TAIL_SLIST(cfg_tree_history, ptree, link,
			struct config_tree);

#ifdef SAVECONFIG
	if (HAVE_OPT( SAVECONFIGQUIT )) {
		FILE *dumpfile;
		int err;
		int dumpfailed;

		dumpfile = fopen(OPT_ARG( SAVECONFIGQUIT ), "w");
		if (NULL == dumpfile) {
			err = errno;
			fprintf(stderr,
				"can not create save file %s, error %d %s\n",
				OPT_ARG( SAVECONFIGQUIT ), err,
				strerror(err));
			exit(err);
		}
		
		dumpfailed = dump_all_config_trees(dumpfile, 0);
		if (dumpfailed)
			fprintf(stderr,
				"--saveconfigquit %s error %d\n",
				OPT_ARG( SAVECONFIGQUIT ),
				dumpfailed);
		else
			fprintf(stderr,
				"configuration saved to %s\n",
				OPT_ARG( SAVECONFIGQUIT ));

		exit(dumpfailed);
	}
#endif	/* SAVECONFIG */

	/* The actual configuration done depends on whether we are configuring the
	 * simulator or the daemon. Perform a check and call the appropriate
	 * function as needed.
	 */

#ifndef SIM
	config_ntpd(ptree);
#else
	config_ntpdsim(ptree);
#endif

	/*
	 * With configure --disable-saveconfig, there's no use keeping
	 * the config tree around after application, so free it.
	 */
#ifndef SAVECONFIG
	UNLINK_SLIST(punlinked, cfg_tree_history, ptree, link,
		     struct config_tree);
	NTP_INSIST(punlinked == ptree);
	free_config_tree(ptree);
#endif
}


void
ntpd_set_tod_using(
	const char *which
	)
{
	char line[128];

	snprintf(line, sizeof(line), "settimeofday=\"%s\"", which);
	set_sys_var(line, strlen(line) + 1, RO);
}


/* FUNCTIONS COPIED FROM THE OLDER ntp_config.c
 * --------------------------------------------
 */


/*
 * get_pfxmatch - find value for prefixmatch
 * and update char * accordingly
 */
static u_int32
get_pfxmatch(
	const char **	pstr,
	struct masks *	m
	)
{
	while (m->name != NULL) {
		if (strncmp(*pstr, m->name, strlen(m->name)) == 0) {
			*pstr += strlen(m->name);
			return m->mask;
		} else {
			m++;
		}
	}
	return 0;
}

/*
 * get_match - find logmask value
 */
static u_int32
get_match(
	const char *	str,
	struct masks *	m
	)
{
	while (m->name != NULL) {
		if (strcmp(str, m->name) == 0)
			return m->mask;
		else
			m++;
	}
	return 0;
}

/*
 * get_logmask - build bitmask for ntp_syslogmask
 */
static u_int32
get_logmask(
	const char *	str
	)
{
	const char *	t;
	u_int32		offset;
	u_int32		mask;

	mask = get_match(str, logcfg_noclass_items);
	if (mask != 0)
		return mask;

	t = str;
	offset = get_pfxmatch(&t, logcfg_class);
	mask   = get_match(t, logcfg_class_items);

	if (mask)
		return mask << offset;
	else
		msyslog(LOG_ERR, "logconfig: '%s' not recognized - ignored",
			str);

	return 0;
}


#ifdef HAVE_NETINFO

/*
 * get_netinfo_config - find the nearest NetInfo domain with an ntp
 * configuration and initialize the configuration state.
 */
static struct netinfo_config_state *
get_netinfo_config(void)
{
	ni_status status;
	void *domain;
	ni_id config_dir;
	struct netinfo_config_state *config;

	if (ni_open(NULL, ".", &domain) != NI_OK) return NULL;

	while ((status = ni_pathsearch(domain, &config_dir, NETINFO_CONFIG_DIR)) == NI_NODIR) {
		void *next_domain;
		if (ni_open(domain, "..", &next_domain) != NI_OK) {
			ni_free(next_domain);
			break;
		}
		ni_free(domain);
		domain = next_domain;
	}
	if (status != NI_OK) {
		ni_free(domain);
		return NULL;
	}

	config = emalloc(sizeof(*config));
	config->domain = domain;
	config->config_dir = config_dir;
	config->prop_index = 0;
	config->val_index = 0;
	config->val_list = NULL;

	return config;
}



/*
 * free_netinfo_config - release NetInfo configuration state
 */
static void
free_netinfo_config(
	struct netinfo_config_state *config
	)
{
	ni_free(config->domain);
	free(config);
}



/*
 * gettokens_netinfo - return tokens from NetInfo
 */
static int
gettokens_netinfo (
	struct netinfo_config_state *config,
	char **tokenlist,
	int *ntokens
	)
{
	int prop_index = config->prop_index;
	int val_index = config->val_index;
	char **val_list = config->val_list;

	/*
	 * Iterate through each keyword and look for a property that matches it.
	 */
  again:
	if (!val_list) {
		for (; prop_index < COUNTOF(keywords); prop_index++)
		{
			ni_namelist namelist;
			struct keyword current_prop = keywords[prop_index];
			ni_index index;

			/*
			 * For each value associated in the property, we're going to return
			 * a separate line. We squirrel away the values in the config state
			 * so the next time through, we don't need to do this lookup.
			 */
			NI_INIT(&namelist);
			if (NI_OK == ni_lookupprop(config->domain,
			    &config->config_dir, current_prop.text,
			    &namelist)) {

				/* Found the property, but it has no values */
				if (namelist.ni_namelist_len == 0) continue;

				config->val_list = 
				    emalloc(sizeof(char*) *
				    (namelist.ni_namelist_len + 1));
				val_list = config->val_list;

				for (index = 0;
				     index < namelist.ni_namelist_len;
				     index++) {
					char *value;
					
					value = namelist.ni_namelist_val[index];
					val_list[index] = estrdup(value);
				}
				val_list[index] = NULL;

				break;
			}
			ni_namelist_free(&namelist);
		}
		config->prop_index = prop_index;
	}

	/* No list; we're done here. */
	if (!val_list)
		return CONFIG_UNKNOWN;

	/*
	 * We have a list of values for the current property.
	 * Iterate through them and return each in order.
	 */
	if (val_list[val_index]) {
		int ntok = 1;
		int quoted = 0;
		char *tokens = val_list[val_index];

		msyslog(LOG_INFO, "%s %s", keywords[prop_index].text, val_list[val_index]);

		(const char*)tokenlist[0] = keywords[prop_index].text;
		for (ntok = 1; ntok < MAXTOKENS; ntok++) {
			tokenlist[ntok] = tokens;
			while (!ISEOL(*tokens) && (!ISSPACE(*tokens) || quoted))
				quoted ^= (*tokens++ == '"');

			if (ISEOL(*tokens)) {
				*tokens = '\0';
				break;
			} else {		/* must be space */
				*tokens++ = '\0';
				while (ISSPACE(*tokens))
					tokens++;
				if (ISEOL(*tokens))
					break;
			}
		}

		if (ntok == MAXTOKENS) {
			/* HMS: chomp it to lose the EOL? */
			msyslog(LOG_ERR,
				"gettokens_netinfo: too many tokens.  Ignoring: %s",
				tokens);
		} else {
			*ntokens = ntok + 1;
		}

		config->val_index++;	/* HMS: Should this be in the 'else'? */

		return keywords[prop_index].keytype;
	}

	/* We're done with the current property. */
	prop_index = ++config->prop_index;

	/* Free val_list and reset counters. */
	for (val_index = 0; val_list[val_index]; val_index++)
		free(val_list[val_index]);
	free(val_list);
	val_list = config->val_list = NULL;
	val_index = config->val_index = 0;

	goto again;
}

#endif /* HAVE_NETINFO */

/*
 * getnetnum - return a net number (this is crude, but careful)
 *
 * returns 1 for success, and mysteriously, 0 or -1 for failure
 */
static int
getnetnum(
	const char *num,
	sockaddr_u *addr,
	int complain,
	enum gnn_type a_type
	)
{
	int retval;
	struct addrinfo *res;

	/* Get all the addresses that resolve to this name */
	retval = get_multiple_netnums(num, addr, &res, complain, a_type);

	if (retval != 1) {
		/* Name resolution failed */
		return retval;
	}

	memcpy(addr, res->ai_addr, res->ai_addrlen);

	DPRINTF(2, ("getnetnum given %s, got %s\n", num, stoa(addr)));

	freeaddrinfo(res);
	return 1;
}


/*
 * get_multiple_netnums
 *
 * returns 1 for success, and mysteriously, 0 or -1 for failure
 */
static int
get_multiple_netnums(
	const char *nameornum,
	sockaddr_u *addr,
	struct addrinfo **res,
	int complain,
	enum gnn_type a_type
	)
{
	char lookbuf[1024];
	const char *lookup;
	char *pch;
	struct addrinfo hints;
	struct addrinfo *ptr;
	int retval;
	sockaddr_u ipaddr;

	memset(&hints, 0, sizeof(hints));

	if (strlen(nameornum) >= sizeof(lookbuf)) {
		NTP_INSIST(strlen(nameornum) < sizeof(lookbuf));
		return 0;
	}

	lookup = nameornum;
	if (is_ip_address(nameornum, &ipaddr)) {
		hints.ai_flags = AI_NUMERICHOST;
		hints.ai_family = AF(&ipaddr);
		if ('[' == nameornum[0]) {
			lookup = lookbuf;
			strncpy(lookbuf, &nameornum[1],
				sizeof(lookbuf));
			pch = strchr(lookbuf, ']');
			if (pch != NULL)
				*pch = '\0';
		}
		pch = strchr(lookup, '%');
		if (pch != NULL) {
			if (lookup != lookbuf) {
				lookup = lookbuf;
				strncpy(lookbuf, nameornum,
					sizeof(lookbuf));
				pch = strchr(lookup, '%');
			}
			*pch = '\0';
		}
	}

	if (AF_INET6 == hints.ai_family && !ipv6_works)
		return 0;

	if (AF_UNSPEC == hints.ai_family) {
		if (!ipv6_works)
			hints.ai_family = AF_INET;
		else if (!ipv4_works)
			hints.ai_family = AF_INET6;
		else if (IS_IPV4(addr) || IS_IPV6(addr))
			hints.ai_family = AF(addr);
	}

	/* Get host address. Looking for UDP datagram connection */
	hints.ai_socktype = SOCK_DGRAM;

	DPRINTF(4, ("getaddrinfo %s%s\n", 
		    (AF_UNSPEC == hints.ai_family)
			? ""
			: (AF_INET == hints.ai_family)
				? "v4 "
				: "v6 ",
		    lookup));

	retval = getaddrinfo(lookup, "ntp", &hints, &ptr);

	if (retval || (AF_INET6 == ptr->ai_family && !ipv6_works)) {
		if (complain)
			msyslog(LOG_ERR,
				"getaddrinfo: \"%s\" invalid host address, ignored",
				lookup);
		else
			DPRINTF(1, ("getaddrinfo: \"%s\" invalid host address.\n",
				    lookup));

		if (!retval) {
			freeaddrinfo(ptr);
			return -1;
		} else {
			return 0;
		}
	}
	*res = ptr;

	return 1;
}


#if !defined(VMS) && !defined(SYS_WINNT)
/*
 * catchchild - receive the resolver's exit status
 */
static RETSIGTYPE
catchchild(
	int sig
	)
{
	/*
	 * We only start up one child, and if we're here
	 * it should have already exited.  Hence the following
	 * shouldn't hang.  If it does, please tell me.
	 */
#if !defined (SYS_WINNT) && !defined(SYS_VXWORKS)
	(void) wait(0);
#endif /* SYS_WINNT  && VXWORKS*/
}
#endif /* VMS */


/*
 * save_resolve - save configuration info into a file for later name resolution
 */
static void
save_resolve(
	char *name,
	int no_needed,
	int type,
	int mode,
	int version,
	int minpoll,
	int maxpoll,
	u_int flags,
	int ttl,
	keyid_t keyid,
	u_char *keystr
	)
{
#ifndef SYS_VXWORKS
	if (res_fp == NULL) {
#ifndef SYS_WINNT
		strcpy(res_file, RES_TEMPFILE);
#else
		int len;

		/* no /tmp directory under NT */
		if (!GetTempPath(sizeof res_file, res_file)) {
			msyslog(LOG_ERR, "can not get temp dir: %m");
			exit(1);
		}
		
		len = strlen(res_file);
		if (sizeof res_file < len + sizeof "ntpdXXXXXX") {
			msyslog(LOG_ERR,
				"temporary directory path %s too long",
				res_file);
			exit(1);
		}

		memmove(res_file + len, "ntpdXXXXXX",
			sizeof "ntpdXXXXXX");
#endif /* SYS_WINNT */
#ifdef HAVE_MKSTEMP
		{
			int fd;

			res_fp = NULL;
			if ((fd = mkstemp(res_file)) != -1)
				res_fp = fdopen(fd, "r+");
		}
#else
		mktemp(res_file);
		res_fp = fopen(res_file, "w");
#endif
		if (res_fp == NULL) {
			msyslog(LOG_ERR, "open failed for %s: %m", res_file);
			return;
		}
	}
#ifdef DEBUG
	if (debug) {
		printf("resolving %s\n", name);
	}
#endif

	(void)fprintf(res_fp, "%s %d %d %d %d %d %d %d %d %u %s\n",
		name, no_needed, type,
		mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr);
#ifdef DEBUG
	if (debug > 1)
		printf("config: %s %d %d %d %d %d %d %x %d %u %s\n",
			name, no_needed, type,
			mode, version, minpoll, maxpoll, flags,
			ttl, keyid, keystr);
#endif

#else  /* SYS_VXWORKS */
	/* save resolve info to a struct */
#endif /* SYS_VXWORKS */
}


/*
 * abort_resolve - terminate the resolver stuff and delete the file
 */
static void
abort_resolve(void)
{
	/*
	 * In an ideal world we would might reread the file and
	 * log the hosts which aren't getting configured.  Since
	 * this is too much work, however, just close and delete
	 * the temp file.
	 */
	if (res_fp != NULL)
		(void) fclose(res_fp);
	res_fp = NULL;

#ifndef SYS_VXWORKS		/* we don't open the file to begin with */
#if !defined(VMS)
	if (unlink(res_file))
		msyslog(LOG_WARNING, 
			"Unable to remove temporary resolver file %s, %m",
			res_file);
#else
	(void) delete(res_file);
#endif /* VMS */
#endif /* SYS_VXWORKS */
}


/*
 * do_resolve_internal - start up the resolver function (not program)
 *
 * On VMS, VxWorks, and Unix-like systems lacking fork(), this routine
 * will simply refuse to resolve anything.
 *
 * Possible implementation: keep `res_file' in memory, do async
 * name resolution via QIO, update from within completion AST.
 * I'm unlikely to find the time for doing this, though. -wjm
 */
static void
do_resolve_internal(void)
{
#ifndef SYS_WINNT
	int i;
#endif

	if (res_fp == NULL) {
		/* belch */
		msyslog(LOG_ERR,
			"do_resolve_internal: Fatal: res_fp == NULL");
		exit(1);
	}

	/* we are done with this now */
	(void) fclose(res_fp);
	res_fp = NULL;

#ifndef NO_INTRES
	req_file = res_file;	/* set up pointer to res file */
#ifndef SYS_WINNT
	(void) signal_no_reset(SIGCHLD, catchchild);

	/* the parent process will write to the pipe
	 * in order to wake up to child process
	 * which may be waiting in a select() call
	 * on the read fd */
	if (pipe(resolver_pipe_fd) < 0) {
		msyslog(LOG_ERR,
			"unable to open resolver pipe");
		exit(1);
	}

	i = fork();
	/* Shouldn't the code below be re-ordered?
	 * I.e. first check if the fork() returned an error, then
	 * check whether we're parent or child.
	 *     Martin Burnicki
	 */
	if (i == 0) {
		/*
		 * this used to close everything
		 * I don't think this is necessary
		 */
		/*
		 * To the unknown commenter above:
		 * Well, I think it's better to clean up
		 * after oneself. I have had problems with
		 * refclock-io when intres was running - things
		 * where fine again when ntpintres was gone.
		 * So some systems react erratic at least.
		 *
		 *			Frank Kardel
		 *
		 * 94-11-16:
		 * Further debugging has proven that the above is
		 * absolutely harmful. The internal resolver
		 * is still in the SIGIO process group and the lingering
		 * async io information causes it to process requests from
		 * all file decriptor causing a race between the NTP daemon
		 * and the resolver. which then eats data when it wins 8-(.
		 * It is absolutly necessary to kill any IO associations
		 * shared with the NTP daemon.
		 *
		 * We also block SIGIO (currently no ports means to
		 * disable the signal handle for IO).
		 *
		 * Thanks to wgstuken@informatik.uni-erlangen.de to notice
		 * that it is the ntp-resolver child running into trouble.
		 *
		 * THUS:
		 */

		/*
		msyslog(LOG_INFO, "do_resolve_internal: pre-closelog");
		*/
		closelog();
		kill_asyncio(0);

		(void) signal_no_reset(SIGCHLD, SIG_DFL);

		init_logging("ntpd_intres", 0);
		setup_logfile();
		/*
		msyslog(LOG_INFO, "do_resolve_internal: post-closelog");
		*/

		ntp_intres();

		/*
		 * If we got here, the intres code screwed up.
		 * Print something so we don't die without complaint
		 */
		msyslog(LOG_ERR, "call to ntp_intres lost");
		abort_resolve();
		exit(1);
	}
	if (i == -1) {
		msyslog(LOG_ERR, "fork() failed, can't start ntp_intres: %m");
		(void) signal_no_reset(SIGCHLD, SIG_DFL);
		abort_resolve();
	} else
		/* This is the parent process who will write to the pipe,
		 * so we close the read fd */
		close(resolver_pipe_fd[0]);
#else /* SYS_WINNT */
	{
		/* NT's equivalent of fork() is _spawn(), but the start point
		 * of the new process is an executable filename rather than
		 * a function name as desired here.
		 */
		unsigned thread_id;
		uintptr_t res_thd_handle;

		fflush(stdout);
		ResolverEventHandle = CreateEvent(NULL, FALSE, FALSE, NULL);
		if (ResolverEventHandle == NULL) {
			msyslog(LOG_ERR, "Unable to create resolver event object, can't start ntp_intres");
			abort_resolve();
		}
		res_thd_handle = _beginthreadex(
			NULL,			/* no security attributes	*/
			0,			/* use default stack size	*/
			ntp_intres_thread,	/* thread function		*/
			NULL,			/* argument to thread function	*/
			0,			/* use default creation flags	*/
			&thread_id);		/* receives thread identifier	*/
		if (!res_thd_handle) {
			msyslog(LOG_ERR, "_beginthreadex ntp_intres_thread failed %m");
			CloseHandle(ResolverEventHandle);
			ResolverEventHandle = NULL;
			abort_resolve();
		}
	}
#endif /* SYS_WINNT */
#else /* NO_INTRES follows */
	msyslog(LOG_ERR,
		"Deferred DNS not implemented - use numeric addresses");
	abort_resolve();
#endif
}
ntp-4.2.6p5/ntpd/cmd_args.c0000644000175000017500000001007011315077755014512 0ustar  peterpeter/*
 * cmd_args.c = command-line argument processing
 */
#ifdef HAVE_CONFIG_H
# include 
#endif

#include "ntpd.h"
#include "ntp_stdlib.h"
#include "ntp_cmdargs.h"

#include "ntpd-opts.h"

/*
 * Definitions of things either imported from or exported to outside
 */
extern char const *progname;
extern const char *specific_interface;

#ifdef HAVE_NETINFO
extern int	check_netinfo;
#endif


/*
 * getCmdOpts - get command line options
 */
void
getCmdOpts(
	int argc,
	char *argv[]
	)
{
	extern const char *config_file;
	int errflg;
	tOptions *myOptions = &ntpdOptions;

	/*
	 * Initialize, initialize
	 */
	errflg = 0;

	if (ipv4_works && ipv6_works) {
		if (HAVE_OPT( IPV4 ))
			ipv6_works = 0;
		else if (HAVE_OPT( IPV6 ))
			ipv4_works = 0;
	} else if (!ipv4_works && !ipv6_works) {
		msyslog(LOG_ERR, "Neither IPv4 nor IPv6 networking detected, fatal.");
		exit(1);
	} else if (HAVE_OPT( IPV4 ) && !ipv4_works)
		msyslog(LOG_WARNING, "-4/--ipv4 ignored, IPv4 networking not found.");
	else if (HAVE_OPT( IPV6 ) && !ipv6_works)
		msyslog(LOG_WARNING, "-6/--ipv6 ignored, IPv6 networking not found.");

	if (HAVE_OPT( AUTHREQ ))
		proto_config(PROTO_AUTHENTICATE, 1, 0., NULL);
	else if (HAVE_OPT( AUTHNOREQ ))
		proto_config(PROTO_AUTHENTICATE, 0, 0., NULL);

	if (HAVE_OPT( BCASTSYNC ))
		proto_config(PROTO_BROADCLIENT, 1, 0., NULL);

	if (HAVE_OPT( CONFIGFILE )) {
		config_file = OPT_ARG( CONFIGFILE );
#ifdef HAVE_NETINFO
		check_netinfo = 0;
#endif
	}

	if (HAVE_OPT( DRIFTFILE ))
		stats_config(STATS_FREQ_FILE, OPT_ARG( DRIFTFILE ));

	if (HAVE_OPT( PANICGATE ))
		allow_panic = TRUE;

#ifdef HAVE_DROPROOT
	if (HAVE_OPT( JAILDIR )) {
		droproot = 1;
		chrootdir = OPT_ARG( JAILDIR );
	}
#endif

	if (HAVE_OPT( KEYFILE ))
		getauthkeys(OPT_ARG( KEYFILE ));

	if (HAVE_OPT( PIDFILE ))
		stats_config(STATS_PID_FILE, OPT_ARG( PIDFILE ));

	if (HAVE_OPT( QUIT ))
		mode_ntpdate = TRUE;

	if (HAVE_OPT( PROPAGATIONDELAY ))
		do {
			double tmp;
			const char *my_ntp_optarg = OPT_ARG( PROPAGATIONDELAY );

			if (sscanf(my_ntp_optarg, "%lf", &tmp) != 1) {
				msyslog(LOG_ERR,
					"command line broadcast delay value %s undecodable",
					my_ntp_optarg);
			} else {
				proto_config(PROTO_BROADDELAY, 0, tmp, NULL);
			}
		} while (0);

	if (HAVE_OPT( STATSDIR ))
		stats_config(STATS_STATSDIR, OPT_ARG( STATSDIR ));

	if (HAVE_OPT( TRUSTEDKEY )) {
		int		ct = STACKCT_OPT(  TRUSTEDKEY );
		const char**	pp = STACKLST_OPT( TRUSTEDKEY );

		do  {
			u_long tkey;
			const char* p = *pp++;

			tkey = (int)atol(p);
			if (tkey == 0 || tkey > NTP_MAXKEY) {
				msyslog(LOG_ERR,
				    "command line trusted key %s is invalid",
				    p);
			} else {
				authtrust(tkey, 1);
			}
		} while (--ct > 0);
	}

#ifdef HAVE_DROPROOT
	if (HAVE_OPT( USER )) {
		droproot = 1;
		user = estrdup(OPT_ARG( USER ));
		group = rindex(user, ':');
		if (group)
			*group++ = '\0'; /* get rid of the ':' */
	}
#endif

	if (HAVE_OPT( VAR )) {
		int		ct = STACKCT_OPT(  VAR );
		const char**	pp = STACKLST_OPT( VAR );

		do  {
			const char* my_ntp_optarg = *pp++;

			set_sys_var(my_ntp_optarg, strlen(my_ntp_optarg)+1,
			    (u_short) (RW));
		} while (--ct > 0);
	}

	if (HAVE_OPT( DVAR )) {
		int		ct = STACKCT_OPT(  DVAR );
		const char**	pp = STACKLST_OPT( DVAR );

		do  {
			const char* my_ntp_optarg = *pp++;

			set_sys_var(my_ntp_optarg, strlen(my_ntp_optarg)+1,
			    (u_short) (RW | DEF));
		} while (--ct > 0);
	}

	if (HAVE_OPT( SLEW )) {
		clock_max = 600;
		kern_enable = 0;
	}
	if (HAVE_OPT( UPDATEINTERVAL )) {
		long val = OPT_VALUE_UPDATEINTERVAL;
			  
		if (val >= 0)
			interface_interval = val;
		else {
			fprintf(stderr, 
				"command line interface update interval %ld must not be negative\n",
				val);
			msyslog(LOG_ERR, 
				"command line interface update interval %ld must not be negative",
				val);
			errflg++;
		}
	}
#ifdef SIM

	/* SK:
	 * The simulator no longer takes any command line arguments. Hence,
	 * all the code that was here has been removed.
	 */

#endif /* SIM */

	if (errflg || argc) {
		if (argc)
			fprintf(stderr, "argc after processing is <%d>\n", argc);
		optionUsage(myOptions, 2);
	}
	return;
}
ntp-4.2.6p5/ntpd/refclock_hpgps.c0000644000175000017500000004075411332473277015736 0ustar  peterpeter/*
 * refclock_hpgps - clock driver for HP 58503A GPS receiver
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_HPGPS)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"

#include 
#include 

/* Version 0.1 April  1, 1995  
 *         0.2 April 25, 1995
 *             tolerant of missing timecode response prompt and sends
 *             clear status if prompt indicates error;
 *             can use either local time or UTC from receiver;
 *             can get receiver status screen via flag4
 *
 * WARNING!: This driver is UNDER CONSTRUCTION
 * Everything in here should be treated with suspicion.
 * If it looks wrong, it probably is.
 *
 * Comments and/or questions to: Dave Vitanye
 *                               Hewlett Packard Company
 *                               dave@scd.hp.com
 *                               (408) 553-2856
 *
 * Thanks to the author of the PST driver, which was the starting point for
 * this one.
 *
 * This driver supports the HP 58503A Time and Frequency Reference Receiver.
 * This receiver uses HP SmartClock (TM) to implement an Enhanced GPS receiver.
 * The receiver accuracy when locked to GPS in normal operation is better
 * than 1 usec. The accuracy when operating in holdover is typically better
 * than 10 usec. per day.
 *
 * The same driver also handles the HP Z3801A which is available surplus
 * from the cell phone industry.  It's popular with hams.
 * It needs a different line setup: 19200 baud, 7 data bits, odd parity
 * That is selected by adding "mode 1" to the server line in ntp.conf
 * HP Z3801A code from Jeff Mock added by Hal Murray, Sep 2005
 *
 *
 * The receiver should be operated with factory default settings.
 * Initial driver operation: expects the receiver to be already locked
 * to GPS, configured and able to output timecode format 2 messages.
 *
 * The driver uses the poll sequence :PTIME:TCODE? to get a response from
 * the receiver. The receiver responds with a timecode string of ASCII
 * printing characters, followed by a , followed by a prompt string
 * issued by the receiver, in the following format:
 * T#yyyymmddhhmmssMFLRVccscpi > 
 *
 * The driver processes the response at the  and , so what the
 * driver sees is the prompt from the previous poll, followed by this
 * timecode. The prompt from the current poll is (usually) left unread until
 * the next poll. So (except on the very first poll) the driver sees this:
 *
 * scpi > T#yyyymmddhhmmssMFLRVcc
 *
 * The T is the on-time character, at 980 msec. before the next 1PPS edge.
 * The # is the timecode format type. We look for format 2.
 * Without any of the CLK or PPS stuff, then, the receiver buffer timestamp
 * at the  is 24 characters later, which is about 25 msec. at 9600 bps,
 * so the first approximation for fudge time1 is nominally -0.955 seconds.
 * This number probably needs adjusting for each machine / OS type, so far:
 *  -0.955000 on an HP 9000 Model 712/80 HP-UX 9.05
 *  -0.953175 on an HP 9000 Model 370    HP-UX 9.10 
 *
 * This receiver also provides a 1PPS signal, but I haven't figured out
 * how to deal with any of the CLK or PPS stuff yet. Stay tuned.
 *
 */

/*
 * Fudge Factors
 *
 * Fudge time1 is used to accomodate the timecode serial interface adjustment.
 * Fudge flag4 can be set to request a receiver status screen summary, which
 * is recorded in the clockstats file.
 */

/*
 * Interface definitions
 */
#define	DEVICE		"/dev/hpgps%d" /* device name and unit */
#define	SPEED232	B9600	/* uart speed (9600 baud) */
#define	SPEED232Z	B19200	/* uart speed (19200 baud) */
#define	PRECISION	(-10)	/* precision assumed (about 1 ms) */
#define	REFID		"GPS\0"	/*  reference ID */
#define	DESCRIPTION	"HP 58503A GPS Time and Frequency Reference Receiver" 

#define SMAX            23*80+1 /* for :SYSTEM:PRINT? status screen response */

#define MTZONE          2       /* number of fields in timezone reply */
#define MTCODET2        12      /* number of fields in timecode format T2 */
#define NTCODET2        21      /* number of chars to checksum in format T2 */

/*
 * Tables to compute the day of year from yyyymmdd timecode.
 * Viva la leap.
 */
static int day1tab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
static int day2tab[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

/*
 * Unit control structure
 */
struct hpgpsunit {
	int	pollcnt;	/* poll message counter */
	int     tzhour;         /* timezone offset, hours */
	int     tzminute;       /* timezone offset, minutes */
	int     linecnt;        /* set for expected multiple line responses */
	char	*lastptr;	/* pointer to receiver response data */
	char    statscrn[SMAX]; /* receiver status screen buffer */
};

/*
 * Function prototypes
 */
static	int	hpgps_start	(int, struct peer *);
static	void	hpgps_shutdown	(int, struct peer *);
static	void	hpgps_receive	(struct recvbuf *);
static	void	hpgps_poll	(int, struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_hpgps = {
	hpgps_start,		/* start up driver */
	hpgps_shutdown,		/* shut down driver */
	hpgps_poll,		/* transmit poll message */
	noentry,		/* not used (old hpgps_control) */
	noentry,		/* initialize driver */
	noentry,		/* not used (old hpgps_buginfo) */
	NOFLAGS			/* not used */
};


/*
 * hpgps_start - open the devices and initialize data for processing
 */
static int
hpgps_start(
	int unit,
	struct peer *peer
	)
{
	register struct hpgpsunit *up;
	struct refclockproc *pp;
	int fd;
	char device[20];

	/*
	 * Open serial port. Use CLK line discipline, if available.
	 * Default is HP 58503A, mode arg selects HP Z3801A
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
	/* mode parameter to server config line shares ttl slot */
	if ((peer->ttl == 1)) {
		if (!(fd = refclock_open(device, SPEED232Z,
				LDISC_CLK | LDISC_7O1)))
			return (0);
	} else {
		if (!(fd = refclock_open(device, SPEED232, LDISC_CLK)))
			return (0);
	}
	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp = peer->procptr;
	pp->io.clock_recv = hpgps_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		pp->io.fd = -1;
		free(up);
		return (0);
	}
	pp->unitptr = (caddr_t)up;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	up->tzhour = 0;
	up->tzminute = 0;

	*up->statscrn = '\0';
	up->lastptr = up->statscrn;
	up->pollcnt = 2;

	/*
	 * Get the identifier string, which is logged but otherwise ignored,
	 * and get the local timezone information
	 */
	up->linecnt = 1;
	if (write(pp->io.fd, "*IDN?\r:PTIME:TZONE?\r", 20) != 20)
	    refclock_report(peer, CEVNT_FAULT);

	return (1);
}


/*
 * hpgps_shutdown - shut down the clock
 */
static void
hpgps_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct hpgpsunit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct hpgpsunit *)pp->unitptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}


/*
 * hpgps_receive - receive data from the serial interface
 */
static void
hpgps_receive(
	struct recvbuf *rbufp
	)
{
	register struct hpgpsunit *up;
	struct refclockproc *pp;
	struct peer *peer;
	l_fp trtmp;
	char tcodechar1;        /* identifies timecode format */
	char tcodechar2;        /* identifies timecode format */
	char timequal;          /* time figure of merit: 0-9 */
	char freqqual;          /* frequency figure of merit: 0-3 */
	char leapchar;          /* leapsecond: + or 0 or - */
	char servchar;          /* request for service: 0 = no, 1 = yes */
	char syncchar;          /* time info is invalid: 0 = no, 1 = yes */
	short expectedsm;       /* expected timecode byte checksum */
	short tcodechksm;       /* computed timecode byte checksum */
	int i,m,n;
	int month, day, lastday;
	char *tcp;              /* timecode pointer (skips over the prompt) */
	char prompt[BMAX];      /* prompt in response from receiver */

	/*
	 * Initialize pointers and read the receiver response
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct hpgpsunit *)pp->unitptr;
	*pp->a_lastcode = '\0';
	pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);

#ifdef DEBUG
	if (debug)
	    printf("hpgps: lencode: %d timecode:%s\n",
		   pp->lencode, pp->a_lastcode);
#endif

	/*
	 * If there's no characters in the reply, we can quit now
	 */
	if (pp->lencode == 0)
	    return;

	/*
	 * If linecnt is greater than zero, we are getting information only,
	 * such as the receiver identification string or the receiver status
	 * screen, so put the receiver response at the end of the status
	 * screen buffer. When we have the last line, write the buffer to
	 * the clockstats file and return without further processing.
	 *
	 * If linecnt is zero, we are expecting either the timezone
	 * or a timecode. At this point, also write the response
	 * to the clockstats file, and go on to process the prompt (if any),
	 * timezone, or timecode and timestamp.
	 */


	if (up->linecnt-- > 0) {
		if ((int)(pp->lencode + 2) <= (SMAX - (up->lastptr - up->statscrn))) {
			*up->lastptr++ = '\n';
			(void)strcpy(up->lastptr, pp->a_lastcode);
			up->lastptr += pp->lencode;
		}
		if (up->linecnt == 0) 
		    record_clock_stats(&peer->srcadr, up->statscrn);
               
		return;
	}

	record_clock_stats(&peer->srcadr, pp->a_lastcode);
	pp->lastrec = trtmp;
            
	up->lastptr = up->statscrn;
	*up->lastptr = '\0';
	up->pollcnt = 2;

	/*
	 * We get down to business: get a prompt if one is there, issue
	 * a clear status command if it contains an error indication.
	 * Next, check for either the timezone reply or the timecode reply
	 * and decode it.  If we don't recognize the reply, or don't get the
	 * proper number of decoded fields, or get an out of range timezone,
	 * or if the timecode checksum is bad, then we declare bad format
	 * and exit.
	 *
	 * Timezone format (including nominal prompt):
	 * scpi > -H,-M
	 *
	 * Timecode format (including nominal prompt):
	 * scpi > T2yyyymmddhhmmssMFLRVcc
	 *
	 */

	(void)strcpy(prompt,pp->a_lastcode);
	tcp = strrchr(pp->a_lastcode,'>');
	if (tcp == NULL)
	    tcp = pp->a_lastcode; 
	else
	    tcp++;
	prompt[tcp - pp->a_lastcode] = '\0';
	while ((*tcp == ' ') || (*tcp == '\t')) tcp++;

	/*
	 * deal with an error indication in the prompt here
	 */
	if (strrchr(prompt,'E') > strrchr(prompt,'s')){
#ifdef DEBUG
		if (debug)
		    printf("hpgps: error indicated in prompt: %s\n", prompt);
#endif
		if (write(pp->io.fd, "*CLS\r\r", 6) != 6)
		    refclock_report(peer, CEVNT_FAULT);
	}

	/*
	 * make sure we got a timezone or timecode format and 
	 * then process accordingly
	 */
	m = sscanf(tcp,"%c%c", &tcodechar1, &tcodechar2);

	if (m != 2){
#ifdef DEBUG
		if (debug)
		    printf("hpgps: no format indicator\n");
#endif
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	switch (tcodechar1) {

	    case '+':
	    case '-':
		m = sscanf(tcp,"%d,%d", &up->tzhour, &up->tzminute);
		if (m != MTZONE) {
#ifdef DEBUG
			if (debug)
			    printf("hpgps: only %d fields recognized in timezone\n", m);
#endif
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		}
		if ((up->tzhour < -12) || (up->tzhour > 13) || 
		    (up->tzminute < -59) || (up->tzminute > 59)){
#ifdef DEBUG
			if (debug)
			    printf("hpgps: timezone %d, %d out of range\n",
				   up->tzhour, up->tzminute);
#endif
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		}
		return;

	    case 'T':
		break;

	    default:
#ifdef DEBUG
		if (debug)
		    printf("hpgps: unrecognized reply format %c%c\n",
			   tcodechar1, tcodechar2);
#endif
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	} /* end of tcodechar1 switch */


	switch (tcodechar2) {

	    case '2':
		m = sscanf(tcp,"%*c%*c%4d%2d%2d%2d%2d%2d%c%c%c%c%c%2hx",
			   &pp->year, &month, &day, &pp->hour, &pp->minute, &pp->second,
			   &timequal, &freqqual, &leapchar, &servchar, &syncchar,
			   &expectedsm);
		n = NTCODET2;

		if (m != MTCODET2){
#ifdef DEBUG
			if (debug)
			    printf("hpgps: only %d fields recognized in timecode\n", m);
#endif
			refclock_report(peer, CEVNT_BADREPLY);
			return;
		}
		break;

	    default:
#ifdef DEBUG
		if (debug)
		    printf("hpgps: unrecognized timecode format %c%c\n",
			   tcodechar1, tcodechar2);
#endif
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	} /* end of tcodechar2 format switch */
           
	/* 
	 * Compute and verify the checksum.
	 * Characters are summed starting at tcodechar1, ending at just
	 * before the expected checksum.  Bail out if incorrect.
	 */
	tcodechksm = 0;
	while (n-- > 0) tcodechksm += *tcp++;
	tcodechksm &= 0x00ff;

	if (tcodechksm != expectedsm) {
#ifdef DEBUG
		if (debug)
		    printf("hpgps: checksum %2hX doesn't match %2hX expected\n",
			   tcodechksm, expectedsm);
#endif
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	/* 
	 * Compute the day of year from the yyyymmdd format.
	 */
	if (month < 1 || month > 12 || day < 1) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}

	if ( ! isleap_4(pp->year) ) {				/* Y2KFixes */
		/* not a leap year */
		if (day > day1tab[month - 1]) {
			refclock_report(peer, CEVNT_BADTIME);
			return;
		}
		for (i = 0; i < month - 1; i++) day += day1tab[i];
		lastday = 365;
	} else {
		/* a leap year */
		if (day > day2tab[month - 1]) {
			refclock_report(peer, CEVNT_BADTIME);
			return;
		}
		for (i = 0; i < month - 1; i++) day += day2tab[i];
		lastday = 366;
	}

	/*
	 * Deal with the timezone offset here. The receiver timecode is in
	 * local time = UTC + :PTIME:TZONE, so SUBTRACT the timezone values.
	 * For example, Pacific Standard Time is -8 hours , 0 minutes.
	 * Deal with the underflows and overflows.
	 */
	pp->minute -= up->tzminute;
	pp->hour -= up->tzhour;

	if (pp->minute < 0) {
		pp->minute += 60;
		pp->hour--;
	}
	if (pp->minute > 59) {
		pp->minute -= 60;
		pp->hour++;
	}
	if (pp->hour < 0)  {
		pp->hour += 24;
		day--;
		if (day < 1) {
			pp->year--;
			if ( isleap_4(pp->year) )		/* Y2KFixes */
			    day = 366;
			else
			    day = 365;
		}
	}

	if (pp->hour > 23) {
		pp->hour -= 24;
		day++;
		if (day > lastday) {
			pp->year++;
			day = 1;
		}
	}

	pp->day = day;

	/*
	 * Decode the MFLRV indicators.
	 * NEED TO FIGURE OUT how to deal with the request for service,
	 * time quality, and frequency quality indicators some day. 
	 */
	if (syncchar != '0') {
		pp->leap = LEAP_NOTINSYNC;
	}
	else {
		pp->leap = LEAP_NOWARNING;
		switch (leapchar) {

		    case '0':
			break;
                     
		    /* See http://bugs.ntp.org/1090
		     * Ignore leap announcements unless June or December.
		     * Better would be to use :GPSTime? to find the month,
		     * but that seems too likely to introduce other bugs.
		     */
		    case '+':
			if ((month==6) || (month==12))
			    pp->leap = LEAP_ADDSECOND;
			break;
                     
		    case '-':
			if ((month==6) || (month==12))
			    pp->leap = LEAP_DELSECOND;
			break;
                     
		    default:
#ifdef DEBUG
			if (debug)
			    printf("hpgps: unrecognized leap indicator: %c\n",
				   leapchar);
#endif
			refclock_report(peer, CEVNT_BADTIME);
			return;
		} /* end of leapchar switch */
	}

	/*
	 * Process the new sample in the median filter and determine the
	 * reference clock offset and dispersion. We use lastrec as both
	 * the reference time and receive time in order to avoid being
	 * cute, like setting the reference time later than the receive
	 * time, which may cause a paranoid protocol module to chuck out
	 * the data.
	 */
	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	pp->lastref = pp->lastrec;
	refclock_receive(peer);

	/*
	 * If CLK_FLAG4 is set, ask for the status screen response.
	 */
	if (pp->sloppyclockflag & CLK_FLAG4){
		up->linecnt = 22; 
		if (write(pp->io.fd, ":SYSTEM:PRINT?\r", 15) != 15)
		    refclock_report(peer, CEVNT_FAULT);
	}
}


/*
 * hpgps_poll - called by the transmit procedure
 */
static void
hpgps_poll(
	int unit,
	struct peer *peer
	)
{
	register struct hpgpsunit *up;
	struct refclockproc *pp;

	/*
	 * Time to poll the clock. The HP 58503A responds to a
	 * ":PTIME:TCODE?" by returning a timecode in the format specified
	 * above. If nothing is heard from the clock for two polls,
	 * declare a timeout and keep going.
	 */
	pp = peer->procptr;
	up = (struct hpgpsunit *)pp->unitptr;
	if (up->pollcnt == 0)
	    refclock_report(peer, CEVNT_TIMEOUT);
	else
	    up->pollcnt--;
	if (write(pp->io.fd, ":PTIME:TCODE?\r", 14) != 14) {
		refclock_report(peer, CEVNT_FAULT);
	}
	else
	    pp->polls++;
}

#else
int refclock_hpgps_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_leitch.c0000644000175000017500000003445611332473276016066 0ustar  peterpeter/*
 * refclock_leitch - clock driver for the Leitch CSD-5300 Master Clock
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_LEITCH)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"

#include 
#include 

#ifdef STREAM
#include 
#if defined(LEITCHCLK)
#include 
#endif /* LEITCHCLK */
#endif /* STREAM */

#include "ntp_stdlib.h"


/*
 * Driver for Leitch CSD-5300 Master Clock System
 *
 * COMMANDS:
 *	DATE:	D 
 *	TIME:	T 
 *	STATUS:	S 
 *	LOOP:	L 
 *
 * FORMAT:
 *	DATE: YYMMDD
 *	TIME: /HHMMSS /HHMMSS /HHMMSS /
 *		second bondaried on the stop bit of the 
 *		second boundaries at '/' above.
 *	STATUS: G (good), D (diag fail), T (time not provided) or
 *		P (last phone update failed)
 */
#define PRECISION	(-20)	/* 1x10-8 */
#define MAXUNITS 1		/* max number of LEITCH units */
#define LEITCHREFID	"ATOM"	/* reference id */
#define LEITCH_DESCRIPTION "Leitch: CSD 5300 Master Clock System Driver"
#define LEITCH232 "/dev/leitch%d"	/* name of radio device */
#define SPEED232 B300		/* uart speed (300 baud) */ 
#ifdef DEBUG
#define leitch_send(A,M) \
if (debug) fprintf(stderr,"write leitch %s\n",M); \
if ((write(A->leitchio.fd,M,sizeof(M)) < 0)) {\
	if (debug) \
	    fprintf(stderr, "leitch_send: unit %d send failed\n", A->unit); \
	else \
	    msyslog(LOG_ERR, "leitch_send: unit %d send failed %m",A->unit);}
#else
#define leitch_send(A,M) \
if ((write(A->leitchio.fd,M,sizeof(M)) < 0)) {\
	msyslog(LOG_ERR, "leitch_send: unit %d send failed %m",A->unit);}
#endif

#define STATE_IDLE 0
#define STATE_DATE 1
#define STATE_TIME1 2
#define STATE_TIME2 3
#define STATE_TIME3 4

/*
 * LEITCH unit control structure
 */
struct leitchunit {
	struct peer *peer;
	struct refclockio leitchio;
	u_char unit;
	short year;
	short yearday;
	short month;
	short day;
	short hour;
	short second;
	short minute;
	short state;
	u_short fudge1;
	l_fp reftime1;
	l_fp reftime2;
	l_fp reftime3;
	l_fp codetime1;
	l_fp codetime2;
	l_fp codetime3;
	u_long yearstart;
};

/*
 * Function prototypes
 */
static	void	leitch_init	(void);
static	int	leitch_start	(int, struct peer *);
static	void	leitch_shutdown	(int, struct peer *);
static	void	leitch_poll	(int, struct peer *);
static	void	leitch_control	(int, struct refclockstat *, struct refclockstat *, struct peer *);
#define	leitch_buginfo	noentry
static	void	leitch_receive	(struct recvbuf *);
static	void	leitch_process	(struct leitchunit *);
#if 0
static	void	leitch_timeout	(struct peer *);
#endif
static	int	leitch_get_date	(struct recvbuf *, struct leitchunit *);
static	int	leitch_get_time	(struct recvbuf *, struct leitchunit *, int);
static	int	days_per_year		(int);

static struct leitchunit leitchunits[MAXUNITS];
static u_char unitinuse[MAXUNITS];
static u_char stratumtouse[MAXUNITS];
static u_int32 refid[MAXUNITS];

static	char days_in_month [] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

/*
 * Transfer vector
 */
struct	refclock refclock_leitch = {
	leitch_start, leitch_shutdown, leitch_poll,
	leitch_control, leitch_init, leitch_buginfo, NOFLAGS
};

/*
 * leitch_init - initialize internal leitch driver data
 */
static void
leitch_init(void)
{
	int i;

	memset((char*)leitchunits, 0, sizeof(leitchunits));
	memset((char*)unitinuse, 0, sizeof(unitinuse));
	for (i = 0; i < MAXUNITS; i++)
	    memcpy((char *)&refid[i], LEITCHREFID, 4);
}

/*
 * leitch_shutdown - shut down a LEITCH clock
 */
static void
leitch_shutdown(
	int unit,
	struct peer *peer
	)
{
	struct leitchunit *leitch;

	if (unit >= MAXUNITS) {
		return;
	}
	leitch = &leitchunits[unit];
	if (-1 != leitch->leitchio.fd)
		io_closeclock(&leitch->leitchio);
#ifdef DEBUG
	if (debug)
		fprintf(stderr, "leitch_shutdown()\n");
#endif
}

/*
 * leitch_poll - called by the transmit procedure
 */
static void
leitch_poll(
	int unit,
	struct peer *peer
	)
{
	struct leitchunit *leitch;

	/* start the state machine rolling */

#ifdef DEBUG
	if (debug)
	    fprintf(stderr, "leitch_poll()\n");
#endif
	if (unit >= MAXUNITS) {
		/* XXXX syslog it */
		return;
	}

	leitch = &leitchunits[unit];

	if (leitch->state != STATE_IDLE) {
		/* reset and wait for next poll */
		/* XXXX syslog it */
		leitch->state = STATE_IDLE;
	} else {
		leitch_send(leitch,"D\r");
		leitch->state = STATE_DATE;
	}
}

static void
leitch_control(
	int unit,
	struct refclockstat *in,
	struct refclockstat *out,
	struct peer *passed_peer
	)
{
	if (unit >= MAXUNITS) {
		msyslog(LOG_ERR,
			"leitch_control: unit %d invalid", unit);
		return;
	}

	if (in) {
		if (in->haveflags & CLK_HAVEVAL1)
		    stratumtouse[unit] = (u_char)(in->fudgeval1);
		if (in->haveflags & CLK_HAVEVAL2)
		    refid[unit] = in->fudgeval2;
		if (unitinuse[unit]) {
			struct peer *peer;

			peer = (&leitchunits[unit])->peer;
			peer->stratum = stratumtouse[unit];
			peer->refid = refid[unit];
		}
	}

	if (out) {
		memset((char *)out, 0, sizeof (struct refclockstat));
		out->type = REFCLK_ATOM_LEITCH;
		out->haveflags = CLK_HAVEVAL1 | CLK_HAVEVAL2;
		out->fudgeval1 = (int32)stratumtouse[unit];
		out->fudgeval2 = refid[unit];
		out->p_lastcode = "";
		out->clockdesc = LEITCH_DESCRIPTION;
	}
}

/*
 * leitch_start - open the LEITCH devices and initialize data for processing
 */
static int
leitch_start(
	int unit,
	struct peer *peer
	)
{
	struct leitchunit *leitch;
	int fd232;
	char leitchdev[20];

	/*
	 * Check configuration info.
	 */
	if (unit >= MAXUNITS) {
		msyslog(LOG_ERR, "leitch_start: unit %d invalid", unit);
		return (0);
	}

	if (unitinuse[unit]) {
		msyslog(LOG_ERR, "leitch_start: unit %d in use", unit);
		return (0);
	}

	/*
	 * Open serial port.
	 */
	snprintf(leitchdev, sizeof(leitchdev), LEITCH232, unit);
	fd232 = open(leitchdev, O_RDWR, 0777);
	if (fd232 == -1) {
		msyslog(LOG_ERR,
			"leitch_start: open of %s: %m", leitchdev);
		return (0);
	}

	leitch = &leitchunits[unit];
	memset(leitch, 0, sizeof(*leitch));

#if defined(HAVE_SYSV_TTYS)
	/*
	 * System V serial line parameters (termio interface)
	 *
	 */
	{	struct termio ttyb;
	if (ioctl(fd232, TCGETA, &ttyb) < 0) {
		msyslog(LOG_ERR,
			"leitch_start: ioctl(%s, TCGETA): %m", leitchdev);
		goto screwed;
	}
	ttyb.c_iflag = IGNBRK|IGNPAR|ICRNL;
	ttyb.c_oflag = 0;
	ttyb.c_cflag = SPEED232|CS8|CLOCAL|CREAD;
	ttyb.c_lflag = ICANON;
	ttyb.c_cc[VERASE] = ttyb.c_cc[VKILL] = '\0';
	if (ioctl(fd232, TCSETA, &ttyb) < 0) {
		msyslog(LOG_ERR,
			"leitch_start: ioctl(%s, TCSETA): %m", leitchdev);
		goto screwed;
	}
	}
#endif /* HAVE_SYSV_TTYS */
#if defined(HAVE_TERMIOS)
	/*
	 * POSIX serial line parameters (termios interface)
	 *
	 * The LEITCHCLK option provides timestamping at the driver level. 
	 * It requires the tty_clk streams module.
	 */
	{	struct termios ttyb, *ttyp;

	ttyp = &ttyb;
	if (tcgetattr(fd232, ttyp) < 0) {
		msyslog(LOG_ERR,
			"leitch_start: tcgetattr(%s): %m", leitchdev);
		goto screwed;
	}
	ttyp->c_iflag = IGNBRK|IGNPAR|ICRNL;
	ttyp->c_oflag = 0;
	ttyp->c_cflag = SPEED232|CS8|CLOCAL|CREAD;
	ttyp->c_lflag = ICANON;
	ttyp->c_cc[VERASE] = ttyp->c_cc[VKILL] = '\0';
	if (tcsetattr(fd232, TCSANOW, ttyp) < 0) {
		msyslog(LOG_ERR,
			"leitch_start: tcsetattr(%s): %m", leitchdev);
		goto screwed;
	}
	if (tcflush(fd232, TCIOFLUSH) < 0) {
		msyslog(LOG_ERR,
			"leitch_start: tcflush(%s): %m", leitchdev);
		goto screwed;
	}
	}
#endif /* HAVE_TERMIOS */
#ifdef STREAM
#if defined(LEITCHCLK)
	if (ioctl(fd232, I_PUSH, "clk") < 0)
	    msyslog(LOG_ERR,
		    "leitch_start: ioctl(%s, I_PUSH, clk): %m", leitchdev);
	if (ioctl(fd232, CLK_SETSTR, "\n") < 0)
	    msyslog(LOG_ERR,
		    "leitch_start: ioctl(%s, CLK_SETSTR): %m", leitchdev);
#endif /* LEITCHCLK */
#endif /* STREAM */
#if defined(HAVE_BSD_TTYS)
	/*
	 * 4.3bsd serial line parameters (sgttyb interface)
	 *
	 * The LEITCHCLK option provides timestamping at the driver level. 
	 * It requires the tty_clk line discipline and 4.3bsd or later.
	 */
	{	struct sgttyb ttyb;
#if defined(LEITCHCLK)
	int ldisc = CLKLDISC;
#endif /* LEITCHCLK */

	if (ioctl(fd232, TIOCGETP, &ttyb) < 0) {
		msyslog(LOG_ERR,
			"leitch_start: ioctl(%s, TIOCGETP): %m", leitchdev);
		goto screwed;
	}
	ttyb.sg_ispeed = ttyb.sg_ospeed = SPEED232;
#if defined(LEITCHCLK)
	ttyb.sg_erase = ttyb.sg_kill = '\r';
	ttyb.sg_flags = RAW;
#else
	ttyb.sg_erase = ttyb.sg_kill = '\0';
	ttyb.sg_flags = EVENP|ODDP|CRMOD;
#endif /* LEITCHCLK */
	if (ioctl(fd232, TIOCSETP, &ttyb) < 0) {
		msyslog(LOG_ERR,
			"leitch_start: ioctl(%s, TIOCSETP): %m", leitchdev);
		goto screwed;
	}
#if defined(LEITCHCLK)
	if (ioctl(fd232, TIOCSETD, &ldisc) < 0) {
		msyslog(LOG_ERR,
			"leitch_start: ioctl(%s, TIOCSETD): %m",leitchdev);
		goto screwed;
	}
#endif /* LEITCHCLK */
	}
#endif /* HAVE_BSD_TTYS */

	/*
	 * Set up the structures
	 */
	leitch->peer = peer;
	leitch->unit = unit;
	leitch->state = STATE_IDLE;
	leitch->fudge1 = 15;	/* 15ms */

	leitch->leitchio.clock_recv = leitch_receive;
	leitch->leitchio.srcclock = (caddr_t) leitch;
	leitch->leitchio.datalen = 0;
	leitch->leitchio.fd = fd232;
	if (!io_addclock(&leitch->leitchio)) {
		leitch->leitchio.fd = -1;
		goto screwed;
	}

	/*
	 * All done.  Initialize a few random peer variables, then
	 * return success.
	 */
	peer->precision = PRECISION;
	peer->stratum = stratumtouse[unit];
	peer->refid = refid[unit];
	unitinuse[unit] = 1;
	return(1);

	/*
	 * Something broke; abandon ship.
	 */
    screwed:
	close(fd232);
	return(0);
}

/*
 * leitch_receive - receive data from the serial interface on a leitch
 * clock
 */
static void
leitch_receive(
	struct recvbuf *rbufp
	)
{
	struct leitchunit *leitch = (struct leitchunit *)rbufp->recv_srcclock;

#ifdef DEBUG
	if (debug)
	    fprintf(stderr, "leitch_recieve(%*.*s)\n", 
		    rbufp->recv_length, rbufp->recv_length,
		    rbufp->recv_buffer);
#endif
	if (rbufp->recv_length != 7)
	    return; /* The date is return with a trailing newline,
		       discard it. */

	switch (leitch->state) {
	    case STATE_IDLE:	/* unexpected, discard and resync */
		return;
	    case STATE_DATE:
		if (!leitch_get_date(rbufp,leitch)) {
			leitch->state = STATE_IDLE;
			break;
		}
		leitch_send(leitch,"T\r");
#ifdef DEBUG
		if (debug)
		    fprintf(stderr, "%u\n",leitch->yearday);
#endif
		leitch->state = STATE_TIME1;
		break;
	    case STATE_TIME1:
		if (!leitch_get_time(rbufp,leitch,1)) {
		}
		if (!clocktime(leitch->yearday,leitch->hour,leitch->minute,
			       leitch->second, 1, rbufp->recv_time.l_ui,
			       &leitch->yearstart, &leitch->reftime1.l_ui)) {
			leitch->state = STATE_IDLE;
			break;
		}
		leitch->reftime1.l_uf = 0;
#ifdef DEBUG
		if (debug)
		    fprintf(stderr, "%lu\n", (u_long)leitch->reftime1.l_ui);
#endif
		MSUTOTSF(leitch->fudge1, leitch->reftime1.l_uf);
		leitch->codetime1 = rbufp->recv_time;
		leitch->state = STATE_TIME2;
		break;
	    case STATE_TIME2:
		if (!leitch_get_time(rbufp,leitch,2)) {
		}
		if (!clocktime(leitch->yearday,leitch->hour,leitch->minute,
			       leitch->second, 1, rbufp->recv_time.l_ui,
			       &leitch->yearstart, &leitch->reftime2.l_ui)) {
			leitch->state = STATE_IDLE;
			break;
		}
#ifdef DEBUG
		if (debug)
		    fprintf(stderr, "%lu\n", (u_long)leitch->reftime2.l_ui);
#endif
		MSUTOTSF(leitch->fudge1, leitch->reftime2.l_uf);
		leitch->codetime2 = rbufp->recv_time;
		leitch->state = STATE_TIME3;
		break;
	    case STATE_TIME3:
		if (!leitch_get_time(rbufp,leitch,3)) {
		}
		if (!clocktime(leitch->yearday,leitch->hour,leitch->minute,
			       leitch->second, GMT, rbufp->recv_time.l_ui,
			       &leitch->yearstart, &leitch->reftime3.l_ui)) {
			leitch->state = STATE_IDLE;
			break;
		}
#ifdef DEBUG
		if (debug)
		    fprintf(stderr, "%lu\n", (u_long)leitch->reftime3.l_ui);
#endif
		MSUTOTSF(leitch->fudge1, leitch->reftime3.l_uf);
		leitch->codetime3 = rbufp->recv_time;
		leitch_process(leitch);
		leitch->state = STATE_IDLE;
		break;
	    default:
		msyslog(LOG_ERR,
			"leitech_receive: invalid state %d unit %d",
			leitch->state, leitch->unit);
	}
}

/*
 * leitch_process - process a pile of samples from the clock
 *
 * This routine uses a three-stage median filter to calculate offset and
 * dispersion. reduce jitter. The dispersion is calculated as the span
 * of the filter (max - min), unless the quality character (format 2) is
 * non-blank, in which case the dispersion is calculated on the basis of
 * the inherent tolerance of the internal radio oscillator, which is
 * +-2e-5 according to the radio specifications.
 */
static void
leitch_process(
	struct leitchunit *leitch
	)
{
	l_fp off;
	l_fp tmp_fp;
      /*double doffset;*/

	off = leitch->reftime1;
	L_SUB(&off,&leitch->codetime1);
	tmp_fp = leitch->reftime2;
	L_SUB(&tmp_fp,&leitch->codetime2);
	if (L_ISGEQ(&off,&tmp_fp))
	    off = tmp_fp;
	tmp_fp = leitch->reftime3;
	L_SUB(&tmp_fp,&leitch->codetime3);

	if (L_ISGEQ(&off,&tmp_fp))
	    off = tmp_fp;
      /*LFPTOD(&off, doffset);*/
	refclock_receive(leitch->peer);
}

/*
 * days_per_year
 */
static int
days_per_year(
	int year
	)
{
	if (year%4) {	/* not a potential leap year */
		return (365);
	} else {
		if (year % 100) {	/* is a leap year */
			return (366);
		} else {	
			if (year % 400) {
				return (365);
			} else {
				return (366);
			}
		}
	}
}

static int
leitch_get_date(
	struct recvbuf *rbufp,
	struct leitchunit *leitch
	)
{
	int i;

	if (rbufp->recv_length < 6)
	    return(0);
#undef  BAD    /* confict: defined as (-1) in AIX sys/param.h */
#define BAD(A) (rbufp->recv_buffer[A] < '0') || (rbufp->recv_buffer[A] > '9')
	if (BAD(0)||BAD(1)||BAD(2)||BAD(3)||BAD(4)||BAD(5))
	    return(0);
#define ATOB(A) ((rbufp->recv_buffer[A])-'0')
	leitch->year = ATOB(0)*10 + ATOB(1);
	leitch->month = ATOB(2)*10 + ATOB(3);
	leitch->day = ATOB(4)*10 + ATOB(5);

	/* sanity checks */
	if (leitch->month > 12)
	    return(0);
	if (leitch->day > days_in_month[leitch->month-1])
	    return(0);

	/* calculate yearday */
	i = 0;
	leitch->yearday = leitch->day;

	while ( i < (leitch->month-1) )
	    leitch->yearday += days_in_month[i++];

	if ((days_per_year((leitch->year>90?1900:2000)+leitch->year)==365) && 
	    leitch->month > 2)
	    leitch->yearday--;

	return(1);
}

/*
 * leitch_get_time
 */
static int
leitch_get_time(
	struct recvbuf *rbufp,
	struct leitchunit *leitch,
	int which
	)
{
	if (BAD(0)||BAD(1)||BAD(2)||BAD(3)||BAD(4)||BAD(5))
	    return(0);
	leitch->hour = ATOB(0)*10 +ATOB(1);
	leitch->minute = ATOB(2)*10 +ATOB(3);
	leitch->second = ATOB(4)*10 +ATOB(5);

	if ((leitch->hour > 23) || (leitch->minute > 60) ||
	    (leitch->second > 60))
	    return(0);
	return(1);
}

#else
int refclock_leitch_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/ntp_peer.c0000644000175000017500000006121311665566225014557 0ustar  peterpeter/*
 * ntp_peer.c - management of data maintained for peer associations
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#include 
#include 

#include "ntpd.h"
#include "ntp_lists.h"
#include "ntp_stdlib.h"
#include "ntp_control.h"
#include 
#ifdef OPENSSL
#include "openssl/rand.h"
#endif /* OPENSSL */

#ifdef SYS_WINNT
int accept_wildcard_if_for_winnt;
#else
const int accept_wildcard_if_for_winnt = FALSE;
#endif

/*
 *                  Table of valid association combinations
 *                  ---------------------------------------
 *
 *                             packet->mode
 * peer->mode      | UNSPEC  ACTIVE PASSIVE  CLIENT  SERVER  BCAST
 * ----------      | ---------------------------------------------
 * NO_PEER         |   e       1       0       1       1       1
 * ACTIVE          |   e       1       1       0       0       0
 * PASSIVE         |   e       1       e       0       0       0
 * CLIENT          |   e       0       0       0       1       0
 * SERVER          |   e       0       0       0       0       0
 * BCAST           |   e       0       0       0       0       0
 * BCLIENT         |   e       0       0       0       e       1
 *
 * One point to note here: a packet in BCAST mode can potentially match
 * a peer in CLIENT mode, but we that is a special case and we check for
 * that early in the decision process.  This avoids having to keep track
 * of what kind of associations are possible etc...  We actually
 * circumvent that problem by requiring that the first b(m)roadcast
 * received after the change back to BCLIENT mode sets the clock.
 */
#define AM_MODES	7	/* number of rows and columns */
#define NO_PEER		0	/* action when no peer is found */

int AM[AM_MODES][AM_MODES] = {
/*	{ UNSPEC,   ACTIVE,     PASSIVE,    CLIENT,     SERVER,     BCAST } */

/*NONE*/{ AM_ERR, AM_NEWPASS, AM_NOMATCH, AM_FXMIT,   AM_MANYCAST, AM_NEWBCL},

/*A*/	{ AM_ERR, AM_PROCPKT, AM_PROCPKT, AM_NOMATCH, AM_NOMATCH,  AM_NOMATCH},

/*P*/	{ AM_ERR, AM_PROCPKT, AM_ERR,     AM_NOMATCH, AM_NOMATCH,  AM_NOMATCH},

/*C*/	{ AM_ERR, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH, AM_PROCPKT,  AM_NOMATCH},

/*S*/	{ AM_ERR, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH,  AM_NOMATCH},

/*BCST*/{ AM_ERR, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH,  AM_NOMATCH},

/*BCL*/ { AM_ERR, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH,  AM_PROCPKT},
};

#define MATCH_ASSOC(x, y)	AM[(x)][(y)]

/*
 * These routines manage the allocation of memory to peer structures
 * and the maintenance of the peer hash table. The three main entry
 * points are findpeer(), which looks for matching peer structures in
 * the peer list, newpeer(), which allocates a new peer structure and
 * adds it to the list, and unpeer(), which demobilizes the association
 * and deallocates the structure.
 */
/*
 * Peer hash tables
 */
struct peer *peer_hash[NTP_HASH_SIZE];	/* peer hash table */
int	peer_hash_count[NTP_HASH_SIZE];	/* peers in each bucket */
struct peer *assoc_hash[NTP_HASH_SIZE];	/* association ID hash table */
int	assoc_hash_count[NTP_HASH_SIZE]; /* peers in each bucket */
static struct peer *peer_free;		/* peer structures free list */
int	peer_free_count;		/* count of free structures */

/*
 * Association ID.  We initialize this value randomly, then assign a new
 * value every time the peer structure is incremented.
 */
static associd_t current_association_ID; /* association ID */

/*
 * Memory allocation watermarks.
 */
#define	INIT_PEER_ALLOC		15	/* initialize for 15 peers */
#define	INC_PEER_ALLOC		5	/* when run out, add 5 more */

/*
 * Miscellaneous statistic counters which may be queried.
 */
u_long	peer_timereset;			/* time stat counters zeroed */
u_long	findpeer_calls;			/* calls to findpeer */
u_long	assocpeer_calls;		/* calls to findpeerbyassoc */
u_long	peer_allocations;		/* allocations from free list */
u_long	peer_demobilizations;		/* structs freed to free list */
int	total_peer_structs;		/* peer structs */
int	peer_associations;		/* mobilized associations */
int	peer_preempt;			/* preemptable associations */
static struct peer init_peer_alloc[INIT_PEER_ALLOC]; /* init alloc */

static void	    getmorepeermem	 (void);
static struct interface *select_peerinterface (struct peer *, sockaddr_u *, struct interface *, u_char);

static int score(struct peer *);

/*
 * init_peer - initialize peer data structures and counters
 *
 * N.B. We use the random number routine in here. It had better be
 * initialized prior to getting here.
 */
void
init_peer(void)
{
	register int i;

	/*
	 * Clear hash tables and counters.
	 */
	memset(peer_hash, 0, sizeof(peer_hash));
	memset(peer_hash_count, 0, sizeof(peer_hash_count));
	memset(assoc_hash, 0, sizeof(assoc_hash));
	memset(assoc_hash_count, 0, sizeof(assoc_hash_count));

	/*
	 * Clear stat counters
	 */
	findpeer_calls = peer_allocations = 0;
	assocpeer_calls = peer_demobilizations = 0;

	/*
	 * Initialize peer memory.
	 */
	peer_free = NULL;
	for (i = 0; i < INIT_PEER_ALLOC; i++)
		LINK_SLIST(peer_free, &init_peer_alloc[i], next);
	total_peer_structs = INIT_PEER_ALLOC;
	peer_free_count = INIT_PEER_ALLOC;

	/*
	 * Initialize our first association ID
	 */
	while ((current_association_ID = ntp_random() & 0xffff) == 0);
}


/*
 * getmorepeermem - add more peer structures to the free list
 */
static void
getmorepeermem(void)
{
	register int i;
	register struct peer *peer;

	peer = (struct peer *)emalloc(INC_PEER_ALLOC *
	    sizeof(struct peer));
	for (i = 0; i < INC_PEER_ALLOC; i++) {
		LINK_SLIST(peer_free, peer, next);
		peer++;
	}

	total_peer_structs += INC_PEER_ALLOC;
	peer_free_count += INC_PEER_ALLOC;
}


/*
 * findexistingpeer - return a pointer to a peer in the hash table
 */
struct peer *
findexistingpeer(
	sockaddr_u *	addr,
	struct peer *	start_peer,
	int		mode,
	u_char		cast_flags
	)
{
	register struct peer *peer;

	/*
	 * start_peer is included so we can locate instances of the
	 * same peer through different interfaces in the hash table.
	 * Without MDF_BCLNT, a match requires the same mode and remote
	 * address.  MDF_BCLNT associations start out as MODE_CLIENT
	 * if broadcastdelay is not specified, and switch to
	 * MODE_BCLIENT after estimating the one-way delay.  Duplicate
	 * associations are expanded in definition to match any other
	 * MDF_BCLNT with the same srcadr (remote, unicast address).
	 */
	if (NULL == start_peer)
		peer = peer_hash[NTP_HASH_ADDR(addr)];
	else
		peer = start_peer->next;
	
	while (peer != NULL) {
 		if (ADDR_PORT_EQ(addr, &peer->srcadr)
		    && (-1 == mode || peer->hmode == mode ||
			((MDF_BCLNT & peer->cast_flags) &&
			 (MDF_BCLNT & cast_flags))))
			break;
		peer = peer->next;
	}

	return peer;
}


/*
 * findpeer - find and return a peer match for a received datagram in
 *	      the peer_hash table.
 */
struct peer *
findpeer(
	struct recvbuf *rbufp,
	int		pkt_mode,
	int *		action
	)
{
	struct peer *	p;
	sockaddr_u *	srcadr;
	u_int		hash;
	struct pkt *	pkt;
	l_fp		pkt_org;

	findpeer_calls++;
	srcadr = &rbufp->recv_srcadr;
	hash = NTP_HASH_ADDR(srcadr);
	for (p = peer_hash[hash]; p != NULL; p = p->next) {
		if (SOCK_EQ(srcadr, &p->srcadr) &&
		    NSRCPORT(srcadr) == NSRCPORT(&p->srcadr)) {

			/*
			 * if the association matching rules determine
			 * that this is not a valid combination, then
			 * look for the next valid peer association.
			 */
			*action = MATCH_ASSOC(p->hmode, pkt_mode);

			/*
			 * A response to our manycastclient solicitation
			 * might be misassociated with an ephemeral peer
			 * already spun for the server.  If the packet's
			 * org timestamp doesn't match the peer's, check
			 * if it matches the ACST prototype peer's.  If
			 * so it is a redundant solicitation response,
			 * return AM_ERR to discard it.  [Bug 1762]
			 */
			if (MODE_SERVER == pkt_mode &&
			    AM_PROCPKT == *action) {
				pkt = &rbufp->recv_pkt;
				NTOHL_FP(&pkt->org, &pkt_org);
				if (!L_ISEQU(&p->aorg, &pkt_org) &&
				    findmanycastpeer(rbufp))
					*action = AM_ERR;
			}

			/*
			 * if an error was returned, exit back right
			 * here.
			 */
			if (*action == AM_ERR)
				return NULL;

			/*
			 * if a match is found, we stop our search.
			 */
			if (*action != AM_NOMATCH)
				break;
		}
	}

	/*
	 * If no matching association is found
	 */
	if (NULL == p) {
		*action = MATCH_ASSOC(NO_PEER, pkt_mode);
	} else if (p->dstadr != rbufp->dstadr) {
		set_peerdstadr(p, rbufp->dstadr);
		if (p->dstadr == rbufp->dstadr) {
			DPRINTF(1, ("Changed %s local address to match response\n",
				    stoa(&p->srcadr)));
			return findpeer(rbufp, pkt_mode, action);
		}
	}
	return p;
}

/*
 * findpeerbyassocid - find and return a peer using his association ID
 */
struct peer *
findpeerbyassoc(
	u_int assoc
	)
{
	struct peer *p;
	u_int hash;

	assocpeer_calls++;

	hash = assoc & NTP_HASH_MASK;
	for (p = assoc_hash[hash]; p != NULL; p = p->ass_next) {
		if (assoc == p->associd)
			return p;
	}
	return NULL;
}


/*
 * clear_all - flush all time values for all associations
 */
void
clear_all(void)
{
	struct peer *peer, *next_peer;
	int n;

	/*
	 * This routine is called when the clock is stepped, and so all
	 * previously saved time values are untrusted.
	 */
	for (n = 0; n < NTP_HASH_SIZE; n++) {
		for (peer = peer_hash[n]; peer != 0; peer = next_peer) {
			next_peer = peer->next;
			if (!(peer->cast_flags & (MDF_ACAST |
			    MDF_MCAST | MDF_BCAST))) {
				peer_clear(peer, "STEP");
			}
		}
	}
#ifdef DEBUG
	if (debug)
		printf("clear_all: at %lu\n", current_time);
#endif
}


/*
 * score_all() - determine if an association can be demobilized
 */
int
score_all(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct peer *speer, *next_peer;
	int	n;
	int	temp, tamp;

	/*
	 * This routine finds the minimum score for all ephemeral
	 * assocations and returns > 0 if the association can be
	 * demobilized.
	 */
	tamp = score(peer);
	temp = 100;
	for (n = 0; n < NTP_HASH_SIZE; n++) {
		for (speer = peer_hash[n]; speer != 0; speer =
		    next_peer) {
			int	x;

			next_peer = speer->next;
			if ((x = score(speer)) < temp && (peer->flags &
			    FLAG_PREEMPT))
				temp = x;
		}
	}
#ifdef DEBUG
	if (debug)
		printf("score_all: at %lu score %d min %d\n",
		    current_time, tamp, temp);
#endif
	if (tamp != temp)
		temp = 0;
	return (temp);
}


/*
 * score() - calculate preemption score
 */
static int
score(
	struct peer *peer	/* peer structure pointer */
	)
{
	int	temp;

	/*
	 * This routine calculates the premption score from the peer
	 * error bits and status. Increasing values are more cherished.
	 */
	temp = 0;
	if (!(peer->flash & TEST10))
		temp++;			/* 1 good synch and stratum */
	if (!(peer->flash & TEST13))
		temp++;			/* 2 reachable */
	if (!(peer->flash & TEST12))
		temp++;			/* 3 no loop */
	if (!(peer->flash & TEST11))
		temp++;			/* 4 good distance */
	if (peer->status >= CTL_PST_SEL_SELCAND)
		temp++;			/* 5 in the hunt */
	if (peer->status != CTL_PST_SEL_EXCESS)
		temp++;			/* 6 not spare tire */
	return (temp);			/* selection status */
}


/*
 * unpeer - remove peer structure from hash table and free structure
 */
void
unpeer(
	struct peer *peer_to_remove
	)
{
	register struct peer *unlinked;
	int	hash;
	char	tbuf[80];

	snprintf(tbuf, sizeof(tbuf), "assoc %d",
	    peer_to_remove->associd);
	report_event(PEVNT_DEMOBIL, peer_to_remove, tbuf);
	set_peerdstadr(peer_to_remove, NULL);
	hash = NTP_HASH_ADDR(&peer_to_remove->srcadr);
	peer_hash_count[hash]--;
	peer_demobilizations++;
	peer_associations--;
	if (peer_to_remove->flags & FLAG_PREEMPT)
		peer_preempt--;
#ifdef REFCLOCK
	/*
	 * If this peer is actually a clock, shut it down first
	 */
	if (peer_to_remove->flags & FLAG_REFCLOCK)
		refclock_unpeer(peer_to_remove);
#endif
	peer_to_remove->action = 0;	/* disable timeout actions */

	UNLINK_SLIST(unlinked, peer_hash[hash], peer_to_remove, next,
	    struct peer);

	if (NULL == unlinked) {
		peer_hash_count[hash]++;
		msyslog(LOG_ERR, "peer struct for %s not in table!",
		    stoa(&peer_to_remove->srcadr));
	}

	/*
	 * Remove him from the association hash as well.
	 */
	hash = peer_to_remove->associd & NTP_HASH_MASK;
	assoc_hash_count[hash]--;

	UNLINK_SLIST(unlinked, assoc_hash[hash], peer_to_remove,
	    ass_next, struct peer);

	if (NULL == unlinked) {
		assoc_hash_count[hash]++;
		msyslog(LOG_ERR,
		    "peer struct for %s not in association table!",
		    stoa(&peer_to_remove->srcadr));
	}

	LINK_SLIST(peer_free, peer_to_remove, next);
	peer_free_count++;
}


/*
 * peer_config - configure a new association
 */
struct peer *
peer_config(
	sockaddr_u *srcadr,
	struct interface *dstadr,
	int hmode,
	int version,
	int minpoll,
	int maxpoll,
	u_int flags,
	int ttl,
	keyid_t key,
	u_char *keystr
	)
{
	u_char cast_flags;

	/*
	 * We do a dirty little jig to figure the cast flags. This is
	 * probably not the best place to do this, at least until the
	 * configure code is rebuilt. Note only one flag can be set.
	 */
	switch (hmode) {
	case MODE_BROADCAST:
		if (IS_MCAST(srcadr))
			cast_flags = MDF_MCAST;
		else
			cast_flags = MDF_BCAST;
		break;

	case MODE_CLIENT:
		if (IS_MCAST(srcadr))
			cast_flags = MDF_ACAST;
		else
			cast_flags = MDF_UCAST;
		break;

	default:
		cast_flags = MDF_UCAST;
	}

	/*
	 * Mobilize the association and initialize its variables. If
	 * emulating ntpdate, force iburst.
	 */
	if (mode_ntpdate)
		flags |= FLAG_IBURST;
	return(newpeer(srcadr, dstadr, hmode, version, minpoll, maxpoll,
	    flags | FLAG_CONFIG, cast_flags, ttl, key));
}

/*
 * setup peer dstadr field keeping it in sync with the interface
 * structures
 */
void
set_peerdstadr(
	struct peer *	p,
	endpt *		dstadr
	)
{
	struct peer *	unlinked;

	if (p->dstadr == dstadr)
		return;

	/*
	 * Don't accept updates to a separate multicast receive-only
	 * endpt while a BCLNT peer is running its unicast protocol.
	 */
	if (dstadr != NULL && (FLAG_BC_VOL & p->flags) &&
	    (INT_MCASTIF & dstadr->flags) && MODE_CLIENT == p->hmode) {
		return;
	}
	if (p->dstadr != NULL) {
		p->dstadr->peercnt--;
		UNLINK_SLIST(unlinked, p->dstadr->peers, p, ilink,
			     struct peer);
		msyslog(LOG_INFO, "%s interface %s -> %s",
			stoa(&p->srcadr), stoa(&p->dstadr->sin),
			(dstadr != NULL)
			    ? stoa(&dstadr->sin)
			    : "(none)");
	}
	p->dstadr = dstadr;
	if (dstadr != NULL) {
		LINK_SLIST(dstadr->peers, p, ilink);
		dstadr->peercnt++;
	}
}

/*
 * attempt to re-rebind interface if necessary
 */
static void
peer_refresh_interface(
	struct peer *peer
	)
{
	endpt *	niface;
	endpt *	piface;

	niface = select_peerinterface(peer, &peer->srcadr, NULL,
				      peer->cast_flags);

	DPRINTF(4, (
	    "peer_refresh_interface: %s->%s mode %d vers %d poll %d %d flags 0x%x 0x%x ttl %d key %08x: new interface: ",
	    peer->dstadr == NULL ? "" :
	    stoa(&peer->dstadr->sin), stoa(&peer->srcadr),
	    peer->hmode, peer->version, peer->minpoll,
	    peer->maxpoll, peer->flags, peer->cast_flags,
	    peer->ttl, peer->keyid));
	if (niface != NULL) {
		DPRINTF(4, (
		    "fd=%d, bfd=%d, name=%.16s, flags=0x%x, ifindex=%u, sin=%s",
		    niface->fd,  niface->bfd, niface->name,
		    niface->flags, niface->ifindex,
		    stoa(&niface->sin)));
		if (niface->flags & INT_BROADCAST)
			DPRINTF(4, (", bcast=%s",
				stoa(&niface->bcast)));
		DPRINTF(4, (", mask=%s\n", stoa(&niface->mask)));
	} else {
		DPRINTF(4, ("\n"));
	}

	piface = peer->dstadr;
	set_peerdstadr(peer, niface);
	if (peer->dstadr) {
		/*
		 * clear crypto if we change the local address
		 */
		if (peer->dstadr != piface && !(peer->cast_flags &
		    MDF_ACAST) && peer->pmode != MODE_BROADCAST)
			peer_clear(peer, "XFAC");

		/*
	 	 * Broadcast needs the socket enabled for broadcast
	 	 */
		if (peer->cast_flags & MDF_BCAST) {
			enable_broadcast(peer->dstadr, &peer->srcadr);
		}

		/*
	 	 * Multicast needs the socket interface enabled for
		 * multicast
	 	 */
		if (peer->cast_flags & MDF_MCAST) {
			enable_multicast_if(peer->dstadr,
			    &peer->srcadr);
		}
	}
}

/*
 * refresh_all_peerinterfaces - see that all interface bindings are up
 * to date
 */
void
refresh_all_peerinterfaces(void)
{
	struct peer *peer, *next_peer;
	int n;

	/*
	 * this is called when the interface list has changed
	 * give all peers a chance to find a better interface
	 */
	for (n = 0; n < NTP_HASH_SIZE; n++) {
		for (peer = peer_hash[n]; peer != 0; peer = next_peer) {
			next_peer = peer->next;
			peer_refresh_interface(peer);
		}
	}
}

	
/*
 * find an interface suitable for the src address
 */
static endpt *
select_peerinterface(
	struct peer *	peer,
	sockaddr_u *	srcadr,
	endpt *		dstadr,
	u_char		cast_flags
	)
{
	endpt *ep;
	endpt *wild;

	wild = ANY_INTERFACE_CHOOSE(srcadr);

	/*
	 * Initialize the peer structure and dance the interface jig.
	 * Reference clocks step the loopback waltz, the others
	 * squaredance around the interface list looking for a buddy. If
	 * the dance peters out, there is always the wildcard interface.
	 * This might happen in some systems and would preclude proper
	 * operation with public key cryptography.
	 */
	if (ISREFCLOCKADR(srcadr)) {
		ep = loopback_interface;
	} else if (cast_flags & 
		   (MDF_BCLNT | MDF_ACAST | MDF_MCAST | MDF_BCAST)) {
		ep = findbcastinter(srcadr);
		if (ep != NULL)
			DPRINTF(4, ("Found *-cast interface %s for address %s\n",
				stoa(&ep->sin), stoa(srcadr)));
		else
			DPRINTF(4, ("No *-cast local address found for address %s\n",
				stoa(srcadr)));
	} else {
		ep = dstadr;
		if (NULL == ep)
			ep = wild;
	} 
	/*
	 * If it is a multicast address, findbcastinter() may not find
	 * it.  For unicast, we get to find the interface when dstadr is
	 * given to us as the wildcard (ANY_INTERFACE_CHOOSE).  Either
	 * way, try a little harder.
	 */
	if (wild == ep)
		ep = findinterface(srcadr);
	/*
	 * we do not bind to the wildcard interfaces for output 
	 * as our (network) source address would be undefined and
	 * crypto will not work without knowing the own transmit address
	 */
	if (ep != NULL && INT_WILDCARD & ep->flags)
		if (!accept_wildcard_if_for_winnt)  
			ep = NULL;

	return ep;
}

/*
 * newpeer - initialize a new peer association
 */
struct peer *
newpeer(
	sockaddr_u *srcadr,
	struct interface *dstadr,
	int	hmode,
	int	version,
	int	minpoll,
	int	maxpoll,
	u_int	flags,
	u_char	cast_flags,
	int	ttl,
	keyid_t	key
	)
{
	struct peer *peer;
	u_int	hash;
	char	tbuf[80];

#ifdef OPENSSL
	/*
	 * If Autokey is requested but not configured, complain loudly.
	 */
	if (!crypto_flags) {
		if (key > NTP_MAXKEY) {
			return (NULL);

		} else if (flags & FLAG_SKEY) {
			msyslog(LOG_ERR, "Autokey not configured");
			return (NULL);
		} 
	}
#endif /* OPENSSL */

	/*
	 * First search from the beginning for an association with given
	 * remote address and mode. If an interface is given, search
	 * from there to find the association which matches that
	 * destination. If the given interface is "any", track down the
	 * actual interface, because that's what gets put into the peer
	 * structure.
	 */
	if (dstadr != NULL) {
		peer = findexistingpeer(srcadr, NULL, hmode, cast_flags);
		while (peer != NULL) {
			if (peer->dstadr == dstadr ||
			    ((MDF_BCLNT & cast_flags) &&
			     (MDF_BCLNT & peer->cast_flags)))
				break;

			if (dstadr == ANY_INTERFACE_CHOOSE(srcadr) &&
			    peer->dstadr == findinterface(srcadr))
				break;

			peer = findexistingpeer(srcadr, peer, hmode,
						cast_flags);
		}
	} else {
		/* no endpt address given */
		peer = findexistingpeer(srcadr, NULL, hmode, cast_flags);
	}

	/*
	 * If a peer is found, this would be a duplicate and we don't
	 * allow that. This avoids duplicate ephemeral (broadcast/
	 * multicast) and preemptible (manycast and pool) client
	 * associations.
	 */
	if (peer != NULL)
		return (NULL);

	/*
	 * Allocate a new peer structure. Some dirt here, since some of
	 * the initialization requires knowlege of our system state.
	 */
	if (peer_free_count == 0)
		getmorepeermem();
	UNLINK_HEAD_SLIST(peer, peer_free, next);
	peer_free_count--;
	peer_associations++;
	if (flags & FLAG_PREEMPT)
		peer_preempt++;
	memset(peer, 0, sizeof(*peer));

	/*
	 * Assign an association ID and increment the system variable.
	 */
	peer->associd = current_association_ID;
	if (++current_association_ID == 0)
		++current_association_ID;

	DPRINTF(3, ("newpeer: cast flags: 0x%x for address: %s\n",
		    cast_flags, stoa(srcadr)));

	peer->srcadr = *srcadr;
	set_peerdstadr(peer, select_peerinterface(peer, srcadr, dstadr,
	    cast_flags));
	peer->hmode = (u_char)hmode;
	peer->version = (u_char)version;
	peer->flags = flags;

	/*
	 * It is an error to set minpoll less than NTP_MINPOLL or to
	 * set maxpoll greater than NTP_MAXPOLL. However, minpoll is
	 * clamped not greater than NTP_MAXPOLL and maxpoll is clamped
	 * not less than NTP_MINPOLL without complaint. Finally,
	 * minpoll is clamped not greater than maxpoll.
	 */
	if (minpoll == 0)
		peer->minpoll = NTP_MINDPOLL;
	else
		peer->minpoll = (u_char)min(minpoll, NTP_MAXPOLL);
	if (maxpoll == 0)
		peer->maxpoll = NTP_MAXDPOLL;
	else
		peer->maxpoll = (u_char)max(maxpoll, NTP_MINPOLL);
	if (peer->minpoll > peer->maxpoll)
		peer->minpoll = peer->maxpoll;

	if (peer->dstadr)
		DPRINTF(3, ("newpeer: using fd %d and our addr %s\n",
			    peer->dstadr->fd, stoa(&peer->dstadr->sin)));
	else
		DPRINTF(3, ("newpeer: local interface currently not bound\n"));	

	/*
	 * Broadcast needs the socket enabled for broadcast
	 */
	if ((cast_flags & MDF_BCAST) && peer->dstadr)
		enable_broadcast(peer->dstadr, srcadr);

	/*
	 * Multicast needs the socket interface enabled for multicast
	 */
	if ((cast_flags & MDF_MCAST) && peer->dstadr)
		enable_multicast_if(peer->dstadr, srcadr);

#ifdef OPENSSL
	if (key > NTP_MAXKEY)
		peer->flags |= FLAG_SKEY;
#endif /* OPENSSL */
	peer->cast_flags = cast_flags;
	peer->ttl = (u_char)ttl;
	peer->keyid = key;
	peer->precision = sys_precision;
	peer->hpoll = peer->minpoll;
	if (cast_flags & MDF_ACAST)
		peer_clear(peer, "ACST");
	else if (cast_flags & MDF_MCAST)
		peer_clear(peer, "MCST");
	else if (cast_flags & MDF_BCAST)
		peer_clear(peer, "BCST");
	else
		peer_clear(peer, "INIT");
	if (mode_ntpdate)
		peer_ntpdate++;

	/*
	 * Note time on statistics timers.
	 */
	peer->timereset = current_time;
	peer->timereachable = current_time;
	peer->timereceived = current_time;

#ifdef REFCLOCK
	if (ISREFCLOCKADR(&peer->srcadr)) {

		/*
		 * We let the reference clock support do clock
		 * dependent initialization.  This includes setting
		 * the peer timer, since the clock may have requirements
		 * for this.
		 */
		if (maxpoll == 0)
			peer->maxpoll = peer->minpoll;
		if (!refclock_newpeer(peer)) {
			/*
			 * Dump it, something screwed up
			 */
			set_peerdstadr(peer, NULL);
			LINK_SLIST(peer_free, peer, next);
			peer_free_count++;
			return (NULL);
		}
	}
#endif

	/*
	 * Put the new peer in the hash tables.
	 */
	hash = NTP_HASH_ADDR(&peer->srcadr);
	LINK_SLIST(peer_hash[hash], peer, next);
	peer_hash_count[hash]++;
	hash = peer->associd & NTP_HASH_MASK;
	LINK_SLIST(assoc_hash[hash], peer, ass_next);
	assoc_hash_count[hash]++;
	snprintf(tbuf, sizeof(tbuf), "assoc %d", peer->associd);
	report_event(PEVNT_MOBIL, peer, tbuf);
	DPRINTF(1, ("newpeer: %s->%s mode %d vers %d poll %d %d flags 0x%x 0x%x ttl %d key %08x\n",
	    peer->dstadr == NULL ? "" : stoa(&peer->dstadr->sin),
	    stoa(&peer->srcadr), peer->hmode, peer->version,
	    peer->minpoll, peer->maxpoll, peer->flags, peer->cast_flags,
	    peer->ttl, peer->keyid));
	return (peer);
}


/*
 * peer_clr_stats - clear peer module statiistics counters
 */
void
peer_clr_stats(void)
{
	findpeer_calls = 0;
	assocpeer_calls = 0;
	peer_allocations = 0;
	peer_demobilizations = 0;
	peer_timereset = current_time;
}

/*
 * peer_reset - reset statistics counters
 */
void
peer_reset(
	struct peer *peer
	)
{
	if (peer == NULL)
		return;

	peer->timereset = current_time;
	peer->sent = 0;
	peer->received = 0;
	peer->processed = 0;
	peer->badauth = 0;
	peer->bogusorg = 0;
	peer->oldpkt = 0;
	peer->seldisptoolarge = 0;
	peer->selbroken = 0;
}


/*
 * peer_all_reset - reset all peer statistics counters
 */
void
peer_all_reset(void)
{
	struct peer *peer;
	int hash;

	for (hash = 0; hash < NTP_HASH_SIZE; hash++)
	    for (peer = peer_hash[hash]; peer != 0; peer = peer->next)
		peer_reset(peer);
}


/*
 * findmanycastpeer - find and return a manycast peer
 */
struct peer *
findmanycastpeer(
	struct recvbuf *rbufp	/* receive buffer pointer */
	)
{
	register struct peer *peer;
	struct pkt *pkt;
	l_fp p_org;
	int i;

 	/*
 	 * This routine is called upon arrival of a server-mode message
	 * from a manycast client. Search the peer list for a manycast
	 * client association where the last transmit timestamp matches
	 * the originate timestamp. This assumes the transmit timestamps
	 * for possibly more than one manycast association are unique.
	 */
	pkt = &rbufp->recv_pkt;
	for (i = 0; i < NTP_HASH_SIZE; i++) {
		if (peer_hash_count[i] == 0)
			continue;

		for (peer = peer_hash[i]; peer != 0; peer =
		    peer->next) {
			if (peer->cast_flags & MDF_ACAST) {
				NTOHL_FP(&pkt->org, &p_org);
				if (L_ISEQU(&p_org, &peer->aorg))
					return (peer);
			}
		}
	}
	return (NULL);
}
ntp-4.2.6p5/ntpd/refclock_gpsvme.c0000644000175000017500000001745311332473274016113 0ustar  peterpeter/* refclock_psc.c:  clock driver for Brandywine PCI-SyncClock32/HP-UX 11.X */

#ifdef	HAVE_CONFIG_H
#include	
#endif	/* HAVE_CONFIG_H	*/

#if defined(REFCLOCK) && defined(CLOCK_GPSVME)

#include	"ntpd.h"
#include	"ntp_io.h"
#include	"ntp_refclock.h"
#include	"ntp_unixtime.h"
#include	"ntp_stdlib.h"

#ifdef	__hpux
#include		/* may already be included above	*/
#include		/* NEEDED for PROCLOCK			*/
#endif	/* __hpux	*/

#ifdef	__linux__
#include		/* for _IOR, ioctl			*/
#endif	/* __linux__	*/

enum {				/* constants	*/
    BUFSIZE			=	32,
    PSC_SYNC_OK			=	0x40,	/* Sync status bit	*/
    DP_LEAPSEC_DAY10DAY1 	= 	0x82,	/* DP RAM address	*/
    DP_LEAPSEC_DAY1000DAY100	=	0x83,
    DELAY			=	1,
    NUNIT			=	2	/* max UNITS		*/
};

/*	clock card registers	*/
struct psc_regs {
    uint32_t		low_time;	/* card base + 0x00	*/
    uint32_t		high_time;	/* card base + 0x04	*/
    uint32_t		ext_low_time;	/* card base + 0x08	*/
    uint32_t		ext_high_time;	/* card base + 0x0C	*/
    uint8_t		device_status;	/* card base + 0x10	*/
    uint8_t		device_control;	/* card base + 0x11	*/
    uint8_t		reserved0;	/* card base + 0x12	*/
    uint8_t		ext_100ns;	/* card base + 0x13	*/
    uint8_t		match_usec;	/* card base + 0x14	*/
    uint8_t		match_msec;	/* card base + 0x15	*/
    uint8_t		reserved1;	/* card base + 0x16	*/
    uint8_t		reserved2;	/* card base + 0x17	*/
    uint8_t		reserved3;	/* card base + 0x18	*/
    uint8_t		reserved4;	/* card base + 0x19	*/
    uint8_t		dp_ram_addr;	/* card base + 0x1A	*/
    uint8_t		reserved5;	/* card base + 0x1B	*/
    uint8_t		reserved6;	/* card base + 0x1C	*/
    uint8_t		reserved7;	/* card base + 0x1D	*/
    uint8_t		dp_ram_data;	/* card base + 0x1E	*/
    uint8_t		reserved8;	/* card base + 0x1F	*/
} *volatile regp[NUNIT];

#define	PSC_REGS	_IOR('K', 0, long)     	/* ioctl argument	*/

/* Macros to swap byte order and convert BCD to binary	*/
#define SWAP(val) ( ((val) >> 24) | (((val) & 0x00ff0000) >> 8) | \
(((val) & 0x0000ff00) << 8) | (((val) & 0x000000ff) << 24) )
#define BCD2INT2(val)  ( ((val) >> 4 & 0x0f)*10 + ((val) & 0x0f) )
#define BCD2INT3(val)  ( ((val) >> 8 & 0x0f)*100 + ((val) >> 4 & 0x0f)*10 + \
((val) & 0x0f) )

/* PSC interface definitions */
#define PRECISION	(-20)	/* precision assumed (1 us)	*/
#define REFID		"USNO"	/* reference ID	*/
#define DESCRIPTION	"Brandywine PCI-SyncClock32"
#define DEVICE		"/dev/refclock%1d"	/* device file	*/

/* clock unit control structure */
struct psc_unit {
    short	unit;		/* NTP refclock unit number	*/
    short	last_hour;	/* last hour (monitor leap sec)	*/
    int		msg_flag[2];	/* count error messages		*/
};
int	fd[NUNIT];		/* file descriptor	*/

/* Local function prototypes */
static int		psc_start(int, struct peer *);
static void		psc_shutdown(int, struct peer *);
static void		psc_poll(int, struct peer *);
static void		check_leap_sec(struct refclockproc *, int);

/* Transfer vector	*/
struct refclock	refclock_gpsvme = {
    psc_start, psc_shutdown, psc_poll, noentry, noentry, noentry, NOFLAGS
};

/* psc_start:  open device and initialize data for processing */
static int
psc_start(
    int		unit,
    struct peer	*peer
    )
{
    char			buf[BUFSIZE];
    struct refclockproc		*pp;
    struct psc_unit		*up = emalloc(sizeof *up);

    if (unit < 0 || unit > 1) {		/* support units 0 and 1	*/
	msyslog(LOG_ERR, "psc_start: bad unit: %d", unit);
	return 0;
    }

    memset(up, '\0', sizeof *up);

    snprintf(buf, sizeof(buf), DEVICE, unit);	/* dev file name	*/
    fd[unit] = open(buf, O_RDONLY);	/* open device file	*/
    if (fd[unit] < 0) {
	msyslog(LOG_ERR, "psc_start: unit: %d, open failed.  %m", unit);
	return 0;
    }
     
    /* get the address of the mapped regs	*/
    if (ioctl(fd[unit], PSC_REGS, ®p[unit]) < 0) {
	msyslog(LOG_ERR, "psc_start: unit: %d, ioctl failed.  %m", unit);
	return 0;
    }

    /* initialize peer variables	*/
    pp = peer->procptr;
    pp->io.clock_recv = noentry;
    pp->io.srcclock = (caddr_t) peer;
    pp->io.datalen = 0;
    pp->io.fd = -1;
    pp->unitptr = (caddr_t) up;
    get_systime(&pp->lastrec);
    memcpy(&pp->refid, REFID, 4);
    peer->precision = PRECISION;
    pp->clockdesc = DESCRIPTION;
    up->unit = unit;
#ifdef	__hpux     
    rtprio(0,120); 		/* set real time priority	*/
    plock(PROCLOCK); 		/* lock process in memory	*/
#endif	/* __hpux	*/     
    return 1;
}

/* psc_shutdown:  shut down the clock */
static void
psc_shutdown(
    int		unit,
    struct peer	*peer
    )
{
    if (NULL != peer->procptr->unitptr)
	free(peer->procptr->unitptr);
    if (fd[unit] > 0)
	close(fd[unit]);
}

/* psc_poll:  read, decode, and record device time */
static void
psc_poll(
    int		unit,
    struct peer	*peer
    )
{
    struct refclockproc	*pp = peer->procptr;
    struct psc_unit		*up;
    unsigned			tlo, thi;
    unsigned char		status;

    up = (struct psc_unit *) pp->unitptr;
    tlo = regp[unit]->low_time;		/* latch and read first 4 bytes	*/
    thi = regp[unit]->high_time;	/* read 4 higher order bytes	*/
    status = regp[unit]->device_status;	/* read device status byte	*/

    if (!(status & PSC_SYNC_OK)) {
	refclock_report(peer, CEVNT_BADTIME);
	if (!up->msg_flag[unit]) {	/* write once to system log	*/
	    msyslog(LOG_WARNING,
		"SYNCHRONIZATION LOST on unit %1d, status %02x\n",
		status, unit);
	    up->msg_flag[unit] = 1;
	}
	return;
    }

    get_systime(&pp->lastrec);
    pp->polls++;
     
    tlo = SWAP(tlo);			/* little to big endian swap on	*/
    thi = SWAP(thi);			/* copy of data			*/
    /* convert the BCD time to broken down time used by refclockproc	*/
    pp->day	= BCD2INT3((thi & 0x0FFF0000) >> 16);
    pp->hour	= BCD2INT2((thi & 0x0000FF00) >> 8);
    pp->minute	= BCD2INT2(thi & 0x000000FF);
    pp->second	= BCD2INT2(tlo >> 24);
    /* ntp_process() in ntp_refclock.c appears to use usec as fraction of
       second in microseconds if usec is nonzero. */
    pp->nsec	= 1000000*BCD2INT3((tlo & 0x00FFF000) >> 12) +
	BCD2INT3(tlo & 0x00000FFF);

    snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
	     "%3.3d %2.2d:%2.2d:%2.2d.%09ld %02x %08x %08x", pp->day,
	     pp->hour, pp->minute, pp->second, pp->nsec, status, thi,
	     tlo);
    pp->lencode = strlen(pp->a_lastcode);

    /* compute the timecode timestamp	*/
    if (!refclock_process(pp)) {
	refclock_report(peer, CEVNT_BADTIME);
	return;
    }
    /* simulate the NTP receive and packet procedures	*/
    refclock_receive(peer);
    /* write clock statistics to file	*/
    record_clock_stats(&peer->srcadr, pp->a_lastcode);	

    /* With the first timecode beginning the day, check for a GPS
       leap second notification.      */
    if (pp->hour < up->last_hour) {
	check_leap_sec(pp, unit);
	up->msg_flag[0] = up->msg_flag[1] = 0;	/* reset flags	*/
    }
    up->last_hour = pp->hour;
}

/* check_leap_sec:  read the Dual Port RAM leap second day registers.  The
   onboard GPS receiver should write the hundreds digit of day of year in
   DP_LeapSec_Day1000Day100 and the tens and ones digits in
   DP_LeapSec_Day10Day1.  If these values are nonzero and today, we have
   a leap second pending, so we set the pp->leap flag to LEAP_ADDSECOND.
   If the BCD data are zero or a date other than today, set pp->leap to
   LEAP_NOWARNING.  */
static void
check_leap_sec(struct refclockproc *pp, int unit)
{
    unsigned char	dhi, dlo;
    int			leap_day;
     
    regp[unit]->dp_ram_addr = DP_LEAPSEC_DAY10DAY1;
    usleep(DELAY);
    dlo = regp[unit]->dp_ram_data;
    regp[unit]->dp_ram_addr = DP_LEAPSEC_DAY1000DAY100;
    usleep(DELAY);
    dhi = regp[unit]->dp_ram_data;
    leap_day = BCD2INT2(dlo) + 100*(dhi & 0x0F);

    pp->leap = LEAP_NOWARNING;			/* default	*/
    if (leap_day && leap_day == pp->day) {
	pp->leap = LEAP_ADDSECOND;		/* leap second today	*/
	msyslog(LOG_ERR, "LEAP_ADDSECOND flag set, day %d (%x %x).",
	    leap_day, dhi, dlo);
    }
}

#else
int	refclock_gpsvme_bs;
#endif	/* REFCLOCK	*/
ntp-4.2.6p5/ntpd/ppsapi_timepps.h0000644000175000017500000000076110441361256015772 0ustar  peterpeter/* ppsapi_timepps.h */

/*
 * This logic first tries to get the timepps.h file from a standard
 * location, and then from our include/ subdirectory.
 */

#ifdef HAVE_TIMEPPS_H
# include 
#else
# ifdef HAVE_SYS_TIMEPPS_H
#  include 
# else
#  ifdef HAVE_CIOGETEV
#   include "timepps-SunOS.h"
#  else
#   ifdef HAVE_TIOCGPPSEV
#    include "timepps-Solaris.h"
#   else
#    ifdef TIOCDCDTIMESTAMP
#     include "timepps-SCO.h"
#    endif
#   endif
#  endif
# endif
#endif
ntp-4.2.6p5/ntpd/ntp_data_structures.c0000644000175000017500000001060111307651604017020 0ustar  peterpeter/* ntp_data_structures.c
 *
 * This file contains the data structures used by the ntp configuration
 * code and the discrete event simulator.
 *
 * Written By: Sachin Kamboj
 *             University of Delaware
 *             Newark, DE 19711
 * Copyright (c) 2006
 */


#include     /* Needed for malloc */
#include "ntp_data_structures.h"
#include "ntp_stdlib.h"

/* Priority Queue
 * --------------
 * Define a priority queue in which the relative priority of the elements
 * is determined by a function 'get_order' which is supplied to the
 * priority_queue
 */


queue *create_priority_queue(int (*get_order)(void *, void *))
{
    queue *my_queue = (queue *) emalloc(sizeof(queue));
    my_queue->get_order = get_order;
    my_queue->front = NULL;
    my_queue->no_of_elements = 0;
    return my_queue;
}


/* Define a function to "destroy" a priority queue, freeing-up
 * all the allocated resources in the process 
 */

void destroy_queue(queue *my_queue)
{
    node *temp = NULL;

    /* Empty out the queue elements if they are not already empty */
    while (my_queue->front != NULL) {
        temp = my_queue->front;
        my_queue->front = my_queue->front->node_next;
        free(temp);
    }

    /* Now free the queue */
    free(my_queue);
}


/* Define a function to allocate memory for one element 
 * of the queue. The allocated memory consists of size
 * bytes plus the number of bytes needed for bookkeeping
 */

void *get_node(size_t size)
{
    node *new_node = emalloc(sizeof(*new_node) + size);
    new_node->node_next = NULL; 
    return new_node + 1;
}

/* Define a function to free the allocated memory for a queue node */
void free_node(void *my_node)
{
    node *old_node = my_node;
    free(old_node - 1);
}


void *
next_node(
	void *pv
	)
{
	node *pn;

	pn = pv;
	pn--;

	if (pn->node_next == NULL)
		return NULL;

	return pn->node_next + 1;
}


/* Define a function to check if the queue is empty. */
int empty(queue *my_queue)
{
    return (!my_queue || !my_queue->front);
}


void *
queue_head(
	queue *q
	)
{
	if (NULL == q || NULL == q->front)
		return NULL;
		
	return q->front + 1;
}


/* Define a function to add an element to the priority queue.
 * The element is added according to its priority - 
 * relative priority is given by the get_order function
 */
queue *enqueue(queue *my_queue, void *my_node)
{
    node *new_node = ((node *) my_node) - 1;
    node *i = NULL;
    node *j = my_queue->front;

    while (j != NULL && ((*my_queue->get_order)(new_node + 1, j + 1) > 0)) {
        i = j;
        j = j->node_next;
    }
    
    if (i == NULL) {       /* Insert at beginning of the queue */
        new_node->node_next = my_queue->front;
        my_queue->front = new_node;
    }
    else {                /* Insert Elsewhere, including the end */
        new_node->node_next = i->node_next;
        i->node_next = new_node;
    }

    ++my_queue->no_of_elements;    
    return my_queue;
}


/* Define a function to dequeue the first element from the priority
 * queue and return it
 */

void *dequeue(queue *my_queue)
{
    node *my_node = my_queue->front;
    if (my_node != NULL) {
        my_queue->front = my_node->node_next;
        --my_queue->no_of_elements;    
        return (void *)(my_node + 1);
    }
    else
        return NULL;
}

/* Define a function that returns the number of elements in the 
 * priority queue
 */
int get_no_of_elements(queue *my_queue)
{
    return my_queue->no_of_elements;
}

/* Define a function to append a queue onto another.
 * Note: there is a faster way (O(1) as opposed to O(n))
 * to do this for simple (FIFO) queues, but we can't rely on
 * that for priority queues. (Given the current representation)
 * 
 * I don't anticipate this to be a problem. If it does turn
 * out to be a bottleneck, I will consider replacing the 
 * current implementation with a binomial or fibonacci heap.
 */

void append_queue(queue *q1, queue *q2) 
{
    while (!empty(q2))
        enqueue(q1, dequeue(q2));
    destroy_queue(q2);
}

/* FIFO Queue
 * ----------
 * Use the priority queue to create a traditional FIFO queue.
 * The only extra function needed is the create_queue 
 */

/* C is not Lisp and does not allow anonymous lambda functions :-(. 
 * So define a get_fifo_order function here
 */

int get_fifo_order(void *el1, void *el2)
{   return 1;
}

/* Define a function to create a FIFO queue */

queue *create_queue()
{    return create_priority_queue(get_fifo_order);
}
ntp-4.2.6p5/ntpd/ntp_filegen.c0000644000175000017500000003152011447435665015234 0ustar  peterpeter/*
 * ntp_filegen.c,v 3.12 1994/01/25 19:06:11 kardel Exp
 *
 *  implements file generations support for NTP
 *  logfiles and statistic files
 *
 *
 * Copyright (C) 1992, 1996 by Rainer Pruy
 * Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
 *
 * This code may be modified and used freely
 * provided credits remain intact.
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#include 
#include 
#include 

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_string.h"
#include "ntp_calendar.h"
#include "ntp_filegen.h"
#include "ntp_stdlib.h"

/*
 * NTP is intended to run long periods of time without restart.
 * Thus log and statistic files generated by NTP will grow large.
 *
 * this set of routines provides a central interface 
 * to generating files using file generations
 *
 * the generation of a file is changed according to file generation type
 */


/*
 * redefine this if your system dislikes filename suffixes like
 * X.19910101 or X.1992W50 or ....
 */
#define SUFFIX_SEP '.'

static	void	filegen_open	(FILEGEN *, u_long);
static	int	valid_fileref	(const char *, const char *);
static	void	filegen_init	(const char *, const char *, FILEGEN *);
#ifdef	DEBUG
static	void	filegen_uninit		(FILEGEN *);
#endif	/* DEBUG */


/*
 * filegen_init
 */

static void
filegen_init(
	const char *	prefix,
	const char *	basename,
	FILEGEN *	fgp
	)
{
	fgp->fp       = NULL;
	fgp->prefix   = prefix;		/* Yes, this is TOTALLY lame! */
	fgp->basename = estrdup(basename);
	fgp->id       = 0;
	fgp->type     = FILEGEN_DAY;
	fgp->flag     = FGEN_FLAG_LINK; /* not yet enabled !!*/
}


/*
 * filegen_uninit - free memory allocated by filegen_init
 */
#ifdef DEBUG
static void
filegen_uninit(
	FILEGEN *	fgp
	)
{
	free(fgp->basename);
}
#endif


/*
 * open a file generation according to the current settings of gen
 * will also provide a link to basename if requested to do so
 */

static void
filegen_open(
	FILEGEN *	gen,
	u_long		newid
	)
{
	char *filename;
	char *basename;
	u_int len;
	FILE *fp;
	struct calendar cal;

	len = strlen(gen->prefix) + strlen(gen->basename) + 1;
	basename = emalloc(len);
	snprintf(basename, len, "%s%s", gen->prefix, gen->basename);
  
	switch (gen->type) {

	default:
		msyslog(LOG_ERR, 
			"unsupported file generations type %d for "
			"\"%s\" - reverting to FILEGEN_NONE",
			gen->type, basename);
		gen->type = FILEGEN_NONE;
		/* fall through to FILEGEN_NONE */

	case FILEGEN_NONE:
		filename = estrdup(basename);
		break;

	case FILEGEN_PID:
		filename = emalloc(len + 1 + 1 + 10);
		snprintf(filename, len + 1 + 1 + 10,
			 "%s%c#%ld",
			 basename, SUFFIX_SEP, newid);
		break;

	case FILEGEN_DAY:
		/*
		 * You can argue here in favor of using MJD, but I
		 * would assume it to be easier for humans to interpret
		 * dates in a format they are used to in everyday life.
		 */
		caljulian(newid, &cal);
		filename = emalloc(len + 1 + 4 + 2 + 2);
		snprintf(filename, len + 1 + 4 + 2 + 2,
			 "%s%c%04d%02d%02d",
			 basename, SUFFIX_SEP,
			 cal.year, cal.month, cal.monthday);
		break;

	case FILEGEN_WEEK:
		/*
		 * This is still a hack
		 * - the term week is not correlated to week as it is used
		 *   normally - it just refers to a period of 7 days
		 *   starting at Jan 1 - 'weeks' are counted starting from zero
		 */
		caljulian(newid, &cal);
		filename = emalloc(len + 1 + 4 + 1 + 2);
		snprintf(filename, len + 1 + 4 + 1 + 2,
			 "%s%c%04dw%02d",
			 basename, SUFFIX_SEP,
			 cal.year, cal.yearday / 7);
		break;

	case FILEGEN_MONTH:
		caljulian(newid, &cal);
		filename = emalloc(len + 1 + 4 + 2);
		snprintf(filename, len + 1 + 4 + 2,
			 "%s%c%04d%02d",
			 basename, SUFFIX_SEP, cal.year, cal.month);
		break;

	case FILEGEN_YEAR:
		caljulian(newid, &cal);
		filename = emalloc(len + 1 + 4);
		snprintf(filename, len + 1 + 4,
			 "%s%c%04d",
			 basename, SUFFIX_SEP, cal.year);
		break;

	case FILEGEN_AGE:
		filename = emalloc(len + 1 + 2 + 10);
		snprintf(filename, len + 1 + 2 + 10,
			 "%s%ca%08ld",
			 basename, SUFFIX_SEP, newid);
	}
  
	if (FILEGEN_NONE != gen->type) {
		/*
		 * check for existence of a file with name 'basename'
		 * as we disallow such a file
		 * if FGEN_FLAG_LINK is set create a link
		 */
		struct stat stats;
		/*
		 * try to resolve name collisions
		 */
		static u_long conflicts = 0;

#ifndef	S_ISREG
#define	S_ISREG(mode)	(((mode) & S_IFREG) == S_IFREG)
#endif
		if (stat(basename, &stats) == 0) {
			/* Hm, file exists... */
			if (S_ISREG(stats.st_mode)) {
				if (stats.st_nlink <= 1)	{
					/*
					 * Oh, it is not linked - try to save it
					 */
					char *savename;
					
					savename = emalloc(len + 1 + 1 + 10 + 10);
					snprintf(savename, len + 1 + 1 + 10 + 10,
						"%s%c%dC%lu",
						basename, SUFFIX_SEP,
						(int)getpid(), conflicts++);

					if (rename(basename, savename) != 0)
						msyslog(LOG_ERR,
							"couldn't save %s: %m",
							basename);
					free(savename);
				} else {
					/*
					 * there is at least a second link to
					 * this file.
					 * just remove the conflicting one
					 */
					if (
#if !defined(VMS)
						unlink(basename) != 0
#else
						delete(basename) != 0
#endif
						)
						msyslog(LOG_ERR, 
							"couldn't unlink %s: %m",
							basename);
				}
			} else {
				/*
				 * Ehh? Not a regular file ?? strange !!!!
				 */
				msyslog(LOG_ERR, 
					"expected regular file for %s "
					"(found mode 0%lo)",
					basename,
					(unsigned long)stats.st_mode);
			}
		} else {
			/*
			 * stat(..) failed, but it is absolutely correct for
			 * 'basename' not to exist
			 */
			if (ENOENT != errno)
				msyslog(LOG_ERR, "stat(%s) failed: %m",
						 basename);
		}
	}

	/*
	 * now, try to open new file generation...
	 */
	fp = fopen(filename, "a");
  
	DPRINTF(4, ("opening filegen (type=%d/id=%lu) \"%s\"\n",
		    gen->type, newid, filename));

	if (NULL == fp)	{
		/* open failed -- keep previous state
		 *
		 * If the file was open before keep the previous generation.
		 * This will cause output to end up in the 'wrong' file,
		 * but I think this is still better than losing output
		 *
		 * ignore errors due to missing directories
		 */

		if (ENOENT != errno)
			msyslog(LOG_ERR, "can't open %s: %m", filename);
	} else {
		if (NULL != gen->fp) {
			fclose(gen->fp);
			gen->fp = NULL;
		}
		gen->fp = fp;
		gen->id = newid;

		if (gen->flag & FGEN_FLAG_LINK) {
			/*
			 * need to link file to basename
			 * have to use hardlink for now as I want to allow
			 * gen->basename spanning directory levels
			 * this would make it more complex to get the correct
			 * filename for symlink
			 *
			 * Ok, it would just mean taking the part following
			 * the last '/' in the name.... Should add it later....
			 */

			/* Windows NT does not support file links -Greg Schueman 1/18/97 */

#if defined SYS_WINNT || defined SYS_VXWORKS
			SetLastError(0); /* On WinNT, don't support FGEN_FLAG_LINK */
#elif defined(VMS)
			errno = 0; /* On VMS, don't support FGEN_FLAG_LINK */
#else  /* not (VMS) / VXWORKS / WINNT ; DO THE LINK) */
			if (link(filename, basename) != 0)
				if (EEXIST != errno)
					msyslog(LOG_ERR, 
						"can't link(%s, %s): %m",
						filename, basename);
#endif /* SYS_WINNT || VXWORKS */
		}		/* flags & FGEN_FLAG_LINK */
	}			/* else fp == NULL */
	
	free(basename);
	free(filename);
	return;
}

/*
 * this function sets up gen->fp to point to the correct
 * generation of the file for the time specified by 'now'
 *
 * 'now' usually is interpreted as second part of a l_fp as is in the cal...
 * library routines
 */

void
filegen_setup(
	FILEGEN *	gen,
	u_long		now
	)
{
	u_long new_gen = ~ (u_long) 0;
	struct calendar cal;

	if (!(gen->flag & FGEN_FLAG_ENABLED)) {
		if (NULL != gen->fp) {
			fclose(gen->fp);
			gen->fp = NULL;
		}
		return;
	}
	
	switch (gen->type) {

	case FILEGEN_NONE:
		if (NULL != gen->fp)
			return; /* file already open */
		break;

	case FILEGEN_PID:
		new_gen = getpid();
		break;

	case FILEGEN_DAY:
		caljulian(now, &cal);
		cal.hour = cal.minute = cal.second = 0;
		new_gen = caltontp(&cal);
		break;

	case FILEGEN_WEEK:
		/* Would be nice to have a calweekstart() routine */
		/* so just use a hack ... */
		/* just round time to integral 7 day period for actual year  */
		new_gen = now - (now - calyearstart(now)) % TIMES7(SECSPERDAY)
			+ 60;
		/*
		 * just to be sure -
		 * the computation above would fail in the presence of leap seconds
		 * so at least carry the date to the next day (+60 (seconds))
		 * and go back to the start of the day via calendar computations
		 */
		caljulian(new_gen, &cal);
		cal.hour = cal.minute = cal.second = 0;
		new_gen = caltontp(&cal);
		break;

	case FILEGEN_MONTH:
		caljulian(now, &cal);
		cal.yearday = (u_short) (cal.yearday - cal.monthday + 1);
		cal.monthday = 1;
		cal.hour = cal.minute = cal.second = 0;
		new_gen = caltontp(&cal);
		break;

	case FILEGEN_YEAR:
		new_gen = calyearstart(now);
		break;

	case FILEGEN_AGE:
		new_gen = current_time - (current_time % SECSPERDAY);
		break;
	}
	/*
	 * try to open file if not yet open
	 * reopen new file generation file on change of generation id
	 */
	if (NULL == gen->fp || gen->id != new_gen) {

		DPRINTF(1, ("filegen  %0x %lu %lu %lu\n", 
			    gen->type, now, gen->id, new_gen));

		filegen_open(gen, new_gen);
	}
}


/*
 * change settings for filegen files
 */
void
filegen_config(
	FILEGEN *	gen,
	const char *	basename,
	u_int		type,
	u_int		flag
	)
{
	int file_existed = 0;

	/*
	 * if nothing would be changed...
	 */
	if ((strcmp(basename, gen->basename) == 0) && type == gen->type
	    && flag == gen->flag)
		return;
  
	/*
	 * validate parameters
	 */
	if (!valid_fileref(gen->prefix, basename))
		return;
  
	if (NULL != gen->fp) {
		fclose(gen->fp);
		gen->fp = NULL;
		file_existed = 1;
	}

	DPRINTF(3, ("configuring filegen:\n"
		    "\tprefix:\t%s\n"
		    "\tbasename:\t%s -> %s\n"
		    "\ttype:\t%d -> %d\n"
		    "\tflag: %x -> %x\n",
		    gen->prefix,
		    gen->basename, basename,
		    gen->type, type,
		    gen->flag, flag));

	if (strcmp(gen->basename, basename) != 0) {
		free(gen->basename);
		gen->basename = estrdup(basename);
	}
	gen->type = (u_char)type;
	gen->flag = (u_char)flag;

	/*
	 * make filegen use the new settings
	 * special action is only required when a generation file
	 * is currently open
	 * otherwise the new settings will be used anyway at the next open
	 */
	if (file_existed) {
		l_fp now;

		get_systime(&now);
		filegen_setup(gen, now.l_ui);
	}
}


/*
 * check whether concatenating prefix and basename
 * yields a legal filename
 */
static int
valid_fileref(
	const char *	prefix,
	const char *	basename
	)
{
	/*
	 * prefix cannot be changed dynamically
	 * (within the context of filegen)
	 * so just reject basenames containing '..'
	 *
	 * ASSUMPTION:
	 * 		file system parts 'below' prefix may be
	 *		specified without infringement of security
	 *
	 *		restricting prefix to legal values
	 *		has to be ensured by other means
	 * (however, it would be possible to perform some checks here...)
	 */
	register const char *p = basename;
  
	/*
	 * Just to catch, dumb errors opening up the world...
	 */
	if (NULL == prefix || '\0' == *prefix)
		return 0;

	if (NULL == basename)
		return 0;
  
	for (p = basename; p; p = strchr(p, DIR_SEP)) {
		if ('.' == p[0] && '.' == p[1] 
		    && ('\0' == p[2] || DIR_SEP == p[2]))
			return 0;
	}
  
	return 1;
}


/*
 * filegen registry
 */

static struct filegen_entry {
	char *			name;
	FILEGEN *		filegen;
	struct filegen_entry *	next;
} *filegen_registry = NULL;


FILEGEN *
filegen_get(
	const char *	name
	)
{
	struct filegen_entry *f = filegen_registry;

	while (f) {
		if (f->name == name || strcmp(name, f->name) == 0) {
			DPRINTF(4, ("filegen_get(%s) = %p\n",
				    name, f->filegen));
			return f->filegen;
		}
		f = f->next;
	}
	DPRINTF(4, ("filegen_get(%s) = NULL\n", name));
	return NULL;
}


void
filegen_register(
	const char *	prefix,
	const char *	name,
	FILEGEN *	filegen
	)
{
	struct filegen_entry **ppfe;

	DPRINTF(4, ("filegen_register(%s, %p)\n", name, filegen));

	filegen_init(prefix, name, filegen);

	ppfe = &filegen_registry;
	while (NULL != *ppfe) {
		if ((*ppfe)->name == name 
		    || !strcmp((*ppfe)->name, name)) {

			DPRINTF(5, ("replacing filegen %p\n",
				    (*ppfe)->filegen));

			(*ppfe)->filegen = filegen;
			return;
		}
		ppfe = &((*ppfe)->next);
	}

	*ppfe = emalloc(sizeof **ppfe);

	(*ppfe)->next = NULL;
	(*ppfe)->name = estrdup(name);
	(*ppfe)->filegen = filegen;

	DPRINTF(6, ("adding new filegen\n"));
	
	return;
}


/*
 * filegen_unregister frees memory allocated by filegen_register for
 * name.
 */
#ifdef DEBUG
void
filegen_unregister(
	char *name
	)
{
	struct filegen_entry **	ppfe;
	struct filegen_entry *	pfe;
	FILEGEN *		fg;
			
	DPRINTF(4, ("filegen_unregister(%s)\n", name));

	ppfe = &filegen_registry;

	while (NULL != *ppfe) {
		if ((*ppfe)->name == name
		    || !strcmp((*ppfe)->name, name)) {
			pfe = *ppfe;
			*ppfe = (*ppfe)->next;
			fg = pfe->filegen;
			free(pfe->name);
			free(pfe);
			filegen_uninit(fg);
			break;
		}
		ppfe = &((*ppfe)->next);
	}
}	
#endif	/* DEBUG */
ntp-4.2.6p5/ntpd/refclock_tt560.c0000644000175000017500000001425411307651603015464 0ustar  peterpeter/*
 * refclock_tt560 - clock driver for the TrueTime 560 IRIG-B decoder
 */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_TT560)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "sys/tt560_api.h"
#include "ntp_stdlib.h"

#include 
#include 

/*
 * This driver supports the TrueTime 560 IRIG-B decoder for the PCI bus.
 */ 

/*
 * TT560 interface definitions
 */
#define	DEVICE		 "/dev/tt560%d" /* device name and unit */
#define	PRECISION	(-20)	/* precision assumed (1 us) */
#define	REFID		"IRIG"	/* reference ID */
#define	DESCRIPTION	"TrueTime 560 IRIG-B PCI Decoder"

/*
 * Unit control structure
 */
struct tt560unit {
	tt_mem_space_t	 *tt_mem;	/* mapped address of PCI board */
	time_freeze_reg_t tt560rawt;	/* data returned from PCI board */
};

typedef union byteswap_u
{
    unsigned int long_word;
    unsigned char byte[4];
} byteswap_t;

/*
 * Function prototypes
 */
static	int	tt560_start	(int, struct peer *);
static	void	tt560_shutdown	(int, struct peer *);
static	void	tt560_poll	(int unit, struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_tt560 = {
	tt560_start,		/* clock_start    */
	tt560_shutdown,		/* clock_shutdown */
	tt560_poll,		/* clock_poll     */
	noentry,		/* clock_control (not used) */
	noentry,		/* clock_init    (not used) */
	noentry,		/* clock_buginfo (not used) */
	NOFLAGS			/* clock_flags   (not used) */
};


/*
 * tt560_start - open the TT560 device and initialize data for processing
 */
static int
tt560_start(
	int unit,
	struct peer *peer
	)
{
	register struct tt560unit *up;
	struct refclockproc *pp;
	char device[20];
	int     fd;
        caddr_t membase;

	/*
	 * Open TT560 device
	 */
	(void)sprintf(device, DEVICE, unit);
	fd = open(device, O_RDWR);
	if (fd == -1) {
		msyslog(LOG_ERR, "tt560_start: open of %s: %m", device);
		return (0);
	}

	/*
	 * Map the device registers into user space.
	 */
	membase = mmap ((caddr_t) 0, TTIME_MEMORY_SIZE,
			PROT_READ | PROT_WRITE,
			MAP_SHARED, fd, (off_t)0);

	if (membase == (caddr_t) -1) {
		msyslog(LOG_ERR, "tt560_start: mapping of %s: %m", device);
		(void) close(fd);
		return (0);
	}

	/*
	 * Allocate and initialize unit structure
	 */
	if (!(up = (struct tt560unit *) emalloc(sizeof(struct tt560unit)))) {
		(void) close(fd);
		return (0);
	}
	memset((char *)up, 0, sizeof(struct tt560unit));
	up->tt_mem = (tt_mem_space_t *)membase;
	pp = peer->procptr;
	pp->io.clock_recv = noentry;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	pp->unitptr = (caddr_t)up;

	/*
	 * Initialize miscellaneous peer variables
	 */
	peer->precision = PRECISION;
	peer->burst = NSTAGE;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	return (1);
}


/*
 * tt560_shutdown - shut down the clock
 */
static void
tt560_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct tt560unit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct tt560unit *)pp->unitptr;
	io_closeclock(&pp->io);
	free(up);
}


/*
 * tt560_poll - called by the transmit procedure
 */
static void
tt560_poll(
	int unit,
	struct peer *peer
	)
{
	register struct tt560unit *up;
	struct refclockproc       *pp;
	time_freeze_reg_t         *tp;
	tt_mem_space_t            *mp;

	int i;
	unsigned int *p_time_t, *tt_mem_t;

	/*
	 * This is the main routine. It snatches the time from the TT560
	 * board and tacks on a local timestamp.
	 */
	pp = peer->procptr;
	up = (struct tt560unit *)pp->unitptr;
	mp = up->tt_mem;
	tp = &up->tt560rawt;

	p_time_t = (unsigned int *)tp;
	tt_mem_t = (unsigned int *)&mp->time_freeze_reg;

	*tt_mem_t = 0;		/* update the time freeze register */
				/* and copy time stamp to memory */
	for (i=0; i < TIME_FREEZE_REG_LEN; i++) {
	    *p_time_t = byte_swap(*tt_mem_t);
	     p_time_t++;
	     tt_mem_t++;
	}

	get_systime(&pp->lastrec);
	pp->polls++;

	/*
	 * We get down to business, check the timecode format and decode
	 * its contents. If the timecode has invalid length or is not in
	 * proper format, we declare bad format and exit. Note: we
	 * can't use the sec/usec conversion produced by the driver,
	 * since the year may be suspect. All format error checking is
	 * done by the sprintf() and sscanf() routines.
	 */
	sprintf(pp->a_lastcode,
	    "%1x%1x%1x %1x%1x:%1x%1x:%1x%1x.%1x%1x%1x%1x%1x%1x %1x",
	    tp->hun_day,  tp->tens_day,  tp->unit_day,
	                  tp->tens_hour, tp->unit_hour,
	                  tp->tens_min,  tp->unit_min,
	                  tp->tens_sec,  tp->unit_sec,
	    tp->hun_ms,   tp->tens_ms,   tp->unit_ms,
	    tp->hun_us,   tp->tens_us,   tp->unit_us,
	    tp->status);
	    pp->lencode = strlen(pp->a_lastcode);
#ifdef DEBUG
	if (debug)
		printf("tt560: time %s timecode %d %s\n",
		   ulfptoa(&pp->lastrec, 6), pp->lencode,
		   pp->a_lastcode);
#endif
	if (sscanf(pp->a_lastcode, "%3d %2d:%2d:%2d.%6ld", 
                  &pp->day, &pp->hour, &pp->minute, &pp->second, &pp->usec)
	    != 5) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	if ((tp->status & 0x6) != 0x6)
		pp->leap = LEAP_NOTINSYNC;
	else
		pp->leap = LEAP_NOWARNING;
	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	if (peer->burst > 0)
		return;
	if (pp->coderecv == pp->codeproc) {
		refclock_report(peer, CEVNT_TIMEOUT);
		return;
	}
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
	refclock_receive(peer);
	peer->burst = NSTAGE;
}

/******************************************************************
 *
 *  byte_swap
 *
 *  Inputs: 32 bit integer
 *
 *  Output: byte swapped 32 bit integer.
 *
 *  This routine is used to compensate for the byte alignment
 *  differences between big-endian and little-endian integers.
 *
 ******************************************************************/
static unsigned int
byte_swap(unsigned int input_num)
{
    byteswap_t    byte_swap;
    unsigned char temp;

    byte_swap.long_word = input_num;

    temp              = byte_swap.byte[3];
    byte_swap.byte[3] = byte_swap.byte[0];
    byte_swap.byte[0] = temp;

    temp              = byte_swap.byte[2];
    byte_swap.byte[2] = byte_swap.byte[1];
    byte_swap.byte[1] = temp;

    return (byte_swap.long_word);
}

#else
int refclock_tt560_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/Makefile.am0000644000175000017500000001603511510477207014623 0ustar  peterpeterNULL=
AUTOMAKE_OPTIONS= 

if NTP_BINSUBDIR_IS_BIN
bin_PROGRAMS=	ntpd @MAKE_NTPDSIM@
else
sbin_PROGRAMS=	ntpd @MAKE_NTPDSIM@
endif

noinst_LIBRARIES=	libntpd.a

AM_CPPFLAGS= -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \
	-I$(top_srcdir)/lib/isc/nothreads/include \
	-I$(top_srcdir)/lib/isc/unix/include $(LIBOPTS_CFLAGS)

# LDADD might need RESLIB and ADJLIB.
LDADD=	version.o libntpd.a @LIBPARSE@
AM_YFLAGS=	-d -t -r all

if SAVECONFIG_ENABLED
if NTP_CROSSCOMPILE
CHECK_SAVECONFIG=
else
CHECK_SAVECONFIG= check-saveconfig
endif
else !SAVECONFIG_ENABLED
CHECK_SAVECONFIG=
endif

#
# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as 
# BSD make) to work around issues specific to compiling
# ntp_parser.y into ntp_parser.h and ntp_parser.c in a vPATH
# configuration where we would like (for a change) the output
# files ntp_parser.[ch] to be placed in the source directory,
# as opposed to the build directory.  This allows a single
# host of a flock configured with Bison to update ntp_parser.[ch]
# used by the rest.
# 

if VPATH_HACK
VPHACK=	vphack
VPHACK_AFTER= vphack_after
else
VPHACK=
VPHACK_AFTER=
endif

vphack:
	test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c .
	test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h .

#
# ylwrap script which invokes Bison replaces ntp_parser.h
# symlink with the updated file, when ntp_parser.h changes.
# vphack_after detects this and copies the updated file to srcdir 
# and re-creates the ntp_parser.h symlink in its place.
#

vphack_after:
	test -L ntp_parser.h || ( \
		mv ntp_parser.h $(srcdir)/ntp_parser.h && \
		ln -s $(srcdir)/ntp_parser.h . \
		)

# BUILT_SOURCES which should also be in EXTRA_DIST
B_S_DIST=		\
	ntpd-opts.c 	\
	ntpd-opts.h 	\
	$(NULL)

BUILT_SOURCES=		\
	$(VPHACK) 	\
	ntp_parser.c 	\
	ntp_parser.h 	\
	$(VPHACK_AFTER)	\
	$(B_S_DIST)	\
	$(NULL)

man_MANS=	$(srcdir)/ntpd.1

# ntpdsim.1 is a remnant along with all the ntpdsim-opts.* files, the
# simulator currently uses ntpd-opts.[ch].  This also means there is no
# longer a reason to have ntpdbase-opts.def split off of ntpd-opts.def.

# ntpd may need:
# log10                               refclock_wwv.o
# sqrt                                ntp_control.o
# floor                               refclock_wwv.o
# which are (usually) provided by -lm.
ntpd_LDADD = $(LDADD) $(LIBOPTS_LDADD) ../libntp/libntp.a -lm @LCRYPTO@ @LSCF@
ntpdsim_LDADD = $(LDADD) $(LIBOPTS_LDADD) ../libntp/libntpsim.a -lm @LCRYPTO@ @LSCF@
ntpdsim_CFLAGS = $(CFLAGS) -DSIM
check_y2k_LDADD = $(LDADD) ../libntp/libntp.a
keyword_gen_LDADD = ../libntp/libntp.a	# we don't want $(LDADD) here

DISTCLEANFILES =		\
	keyword-gen		\
	.version		\
	version.c		\
	$(NULL)

CLEANFILES =			\
	check-saveconfig	\
	compsave.conf		\
	k-g-u-submake		\
	$(NULL)

EXTRA_DIST =			\
	complete.conf		\
	keyword-gen-utd		\
	ntpd.1			\
	ntpd-opts.def		\
	ntpd-opts.menu		\
	ntpd-opts.texi		\
	ntpdbase-opts.def	\
	refclock_msfees.c	\
	refclock_trak.c		\
	$(B_S_DIST)		\
	$(NULL)

ETAGS_ARGS = Makefile.am
###							Y2Kfixes
check_PROGRAMS = @MAKE_CHECK_Y2K@
EXTRA_PROGRAMS = check_y2k ntpdsim keyword-gen
noinst_DATA =	$(srcdir)/ntpd-opts.texi $(srcdir)/ntpd-opts.menu
run_ag=		cd $(srcdir) &&	env PATH="$(abs_builddir):$(PATH)"	\
		autogen -L ../include --writable
std_def_list=	$(top_srcdir)/include/autogen-version.def 	\
		$(top_srcdir)/include/copyright.def 		\
		$(top_srcdir)/include/version.def

check-local: @MAKE_CHECK_Y2K@ $(CHECK_SAVECONFIG)
	test -z "@MAKE_CHECK_Y2K@" || ./@MAKE_CHECK_Y2K@

ntpd_SOURCES =			\
	cmd_args.c		\
	ntp_config.c		\
	ntp_data_structures.c	\
	ntp_keyword.h		\
	ntp_io.c		\
	ntp_parser.y		\
	ntp_scanner.c		\
	ntp_scanner.h		\
	ntpd.c			\
	ntpd-opts.c		\
	ntpd-opts.h		\
	$(NULL)
	
ntpdsim_SOURCES =		\
	$(ntpd_SOURCES)		\
	ntpsim.c		\
	$(NULL)

# libntpd_a_SOURCES do not use #ifdef SIM

libntpd_a_SOURCES =		\
	jupiter.h		\
	ntp_control.c		\
	ntp_crypto.c		\
	ntp_filegen.c		\
	ntp_intres.c		\
	ntp_loopfilter.c	\
	ntp_monitor.c		\
	ntp_peer.c		\
	ntp_proto.c		\
	ntp_refclock.c		\
	ntp_request.c		\
	ntp_restrict.c		\
	ntp_signd.c		\
	ntp_timer.c		\
	ntp_util.c		\
	ppsapi_timepps.h	\
	refclock_acts.c		\
	refclock_arbiter.c	\
	refclock_arc.c		\
	refclock_as2201.c	\
	refclock_atom.c		\
	refclock_bancomm.c	\
	refclock_chronolog.c	\
	refclock_chu.c		\
	refclock_conf.c		\
	refclock_datum.c	\
	refclock_dumbclock.c	\
	refclock_fg.c		\
	refclock_gpsvme.c	\
	refclock_heath.c	\
	refclock_hopfser.c	\
	refclock_hopfpci.c	\
	refclock_hpgps.c	\
	refclock_irig.c		\
	refclock_jjy.c		\
	refclock_jupiter.c	\
	refclock_leitch.c	\
	refclock_local.c	\
	refclock_mx4200.c	\
	refclock_neoclock4x.c	\
	refclock_nmea.c		\
	refclock_oncore.c	\
	refclock_palisade.c	\
	refclock_palisade.h	\
	refclock_parse.c	\
	refclock_pcf.c		\
	refclock_pst.c		\
	refclock_ripencc.c	\
	refclock_shm.c		\
	refclock_tpro.c		\
	refclock_true.c		\
	refclock_tt560.c	\
	refclock_ulink.c	\
	refclock_wwv.c		\
	refclock_wwvb.c		\
	refclock_zyfer.c	\
	$(NULL)

k-g-u-submake: keyword-gen
	./keyword-gen $(srcdir)/ntp_parser.h > k-g.out
	@grep -v diff_ignore_line < k-g.out > cmp1
	@grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2
	@cmp cmp1 cmp2 > /dev/null || \
		{ mv -f k-g.out $(srcdir)/ntp_keyword.h && \
		  echo 'Generated changed ntp_keyword.h.' ;}
	@[ ! -f k-g.out ] || \
		{ rm k-g.out && echo 'ntp_keyword.h is up to date.' ;}
	@rm cmp1 cmp2
	@echo 'keyword-gen and ntp_keyword.h are up to date.' > $@

$(srcdir)/keyword-gen-utd: $(srcdir)/keyword-gen.c $(srcdir)/ntp_parser.h
	$(MAKE) k-g-u-submake	# avoid explicit dependency
	grep diff_ignore_line $(srcdir)/ntp_keyword.h > k-g-u
	mv -f k-g-u $@
	
$(srcdir)/ntp_keyword.h: $(srcdir)/keyword-gen-utd
	@: do-nothing action to avoid default SCCS get
	@: .h updated if needed by k-g-u-submake rule

$(srcdir)/ntpd-opts.h: $(srcdir)/ntpd-opts.c
	@: do-nothing action to avoid default SCCS get, .h built with .c
	
$(srcdir)/ntpd-opts.c: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
	$(run_ag) ntpd-opts.def

$(srcdir)/ntpd.1: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
	$(run_ag) -Tagman1.tpl -bntpd ntpd-opts.def

$(srcdir)/ntpd-opts.menu: $(srcdir)/ntpd-opts.texi
	@: do-nothing action to avoid default SCCS get, .menu built with .texi
	
$(srcdir)/ntpd-opts.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
	$(run_ag) -Taginfo.tpl -DLEVEL=section ntpd-opts.def
	$(top_srcdir)/scripts/check--help $@

$(PROGRAMS): $(LDADD)

compsave.conf: ntpd $(srcdir)/complete.conf
	./ntpd --configfile $(srcdir)/complete.conf --saveconfigquit $@

check-saveconfig: $(srcdir)/complete.conf compsave.conf
	cmp $(srcdir)/complete.conf compsave.conf && echo stamp > $@

../libopts/libopts.la:
	cd ../libopts && $(MAKE) libopts.la

../libntp/libntp.a:
	cd ../libntp && $(MAKE) libntp.a

../libparse/libparse.a:
	cd ../libparse && $(MAKE) libparse.a

$(top_srcdir)/version:
	cd $(top_srcdir) && $(MAKE) version

version.o: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/version
	env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpd
	$(COMPILE) -c version.c

include $(top_srcdir)/bincheck.mf
include $(top_srcdir)/depsver.mf
ntp-4.2.6p5/ntpd/refclock_ulink.c0000644000175000017500000004172011307651603015722 0ustar  peterpeter/*
 * refclock_ulink - clock driver for Ultralink  WWVB receiver
 */

/***********************************************************************
 *                                                                     *
 * Copyright (c) David L. Mills 1992-1998                              *
 *                                                                     *
 * Permission to use, copy, modify, and distribute this software and   *
 * its documentation for any purpose and without fee is hereby         *
 * granted, provided that the above copyright notice appears in all    *
 * copies and that both the copyright notice and this permission       *
 * notice appear in supporting documentation, and that the name        *
 * University of Delaware not be used in advertising or publicity      *
 * pertaining to distribution of the software without specific,        *
 * written prior permission. The University of Delaware makes no       *
 * representations about the suitability this software for any         *
 * purpose. It is provided "as is" without express or implied          *
 * warranty.                                                           *
 **********************************************************************/

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_ULINK)

#include 
#include 

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"

/* This driver supports ultralink Model 320,325,330,331,332 WWVB radios
 *
 * this driver was based on the refclock_wwvb.c driver
 * in the ntp distribution.
 *
 * Fudge Factors
 *
 * fudge flag1 0 don't poll clock
 *             1 send poll character
 *
 * revision history:
 *		99/9/09 j.c.lang	original edit's
 *		99/9/11 j.c.lang	changed timecode parse to 
 *                                      match what the radio actually
 *                                      sends. 
 *              99/10/11 j.c.lang       added support for continous
 *                                      time code mode (dipsw2)
 *		99/11/26 j.c.lang	added support for 320 decoder
 *                                      (taken from Dave Strout's
 *                                      Model 320 driver)
 *		99/11/29 j.c.lang	added fudge flag 1 to control
 *					clock polling
 *		99/12/15 j.c.lang	fixed 320 quality flag
 *		01/02/21 s.l.smith	fixed 33x quality flag
 *					added more debugging stuff
 *					updated 33x time code explanation
 *		04/01/23 frank migge	added support for 325 decoder
 *                                      (tested with ULM325.F)
 *
 * Questions, bugs, ideas send to:
 *	Joseph C. Lang
 *	tcnojl1@earthlink.net
 *
 *	Dave Strout
 *	dstrout@linuxfoundry.com
 *
 *      Frank Migge
 *      frank.migge@oracle.com
 *
 *
 * on the Ultralink model 33X decoder Dip switch 2 controls
 * polled or continous timecode 
 * set fudge flag1 if using polled (needed for model 320 and 325)
 * dont set fudge flag1 if dip switch 2 is set on model 33x decoder
*/


/*
 * Interface definitions
 */
#define	DEVICE		"/dev/wwvb%d" /* device name and unit */
#define	SPEED232	B9600	/* uart speed (9600 baud) */
#define	PRECISION	(-10)	/* precision assumed (about 10 ms) */
#define	REFID		"WWVB"	/* reference ID */
#define	DESCRIPTION	"Ultralink WWVB Receiver" /* WRU */

#define	LEN33X		32	/* timecode length Model 33X and 325 */
#define LEN320		24	/* timecode length Model 320 */

#define	SIGLCHAR33x	'S'	/* signal strength identifier char 325 */
#define	SIGLCHAR325	'R'	/* signal strength identifier char 33x */

/*
 *  unit control structure
 */
struct ulinkunit {
	u_char	tcswitch;	/* timecode switch */
	l_fp	laststamp;	/* last receive timestamp */
};

/*
 * Function prototypes
 */
static	int	ulink_start	(int, struct peer *);
static	void	ulink_shutdown	(int, struct peer *);
static	void	ulink_receive	(struct recvbuf *);
static	void	ulink_poll	(int, struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_ulink = {
	ulink_start,		/* start up driver */
	ulink_shutdown,		/* shut down driver */
	ulink_poll,		/* transmit poll message */
	noentry,		/* not used  */
	noentry,		/* not used  */
	noentry,		/* not used  */
	NOFLAGS
};


/*
 * ulink_start - open the devices and initialize data for processing
 */
static int
ulink_start(
	int unit,
	struct peer *peer
	)
{
	register struct ulinkunit *up;
	struct refclockproc *pp;
	int fd;
	char device[20];

	/*
	 * Open serial port. Use CLK line discipline, if available.
	 */
	(void)sprintf(device, DEVICE, unit);
	if (!(fd = refclock_open(device, SPEED232, LDISC_CLK)))
		return (0);

	/*
	 * Allocate and initialize unit structure
	 */
	if (!(up = (struct ulinkunit *)
	      emalloc(sizeof(struct ulinkunit)))) {
		(void) close(fd);
		return (0);
	}
	memset((char *)up, 0, sizeof(struct ulinkunit));
	pp = peer->procptr;
	pp->unitptr = (caddr_t)up;
	pp->io.clock_recv = ulink_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		(void) close(fd);
		free(up);
		return (0);
	}

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	peer->burst = NSTAGE;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	return (1);
}


/*
 * ulink_shutdown - shut down the clock
 */
static void
ulink_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct ulinkunit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct ulinkunit *)pp->unitptr;
	io_closeclock(&pp->io);
	free(up);
}


/*
 * ulink_receive - receive data from the serial interface
 */
static void
ulink_receive(
	struct recvbuf *rbufp
	)
{
	struct ulinkunit *up;
	struct refclockproc *pp;
	struct peer *peer;

	l_fp	trtmp;		/* arrival timestamp */
	int	quality;	/* quality indicator */
	int	temp;		/* int temp */
	char	syncchar;	/* synchronization indicator */
	char	leapchar;	/* leap indicator */
	char	modechar;	/* model 320 mode flag */
        char	siglchar;	/* model difference between 33x/325 */
	char	char_quality[2];	/* temp quality flag */

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct ulinkunit *)pp->unitptr;
	temp = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);

	/*
	 * Note we get a buffer and timestamp for both a  and ,
	 * but only the  timestamp is retained. 
	 */
	if (temp == 0) {
		if (up->tcswitch == 0) {
			up->tcswitch = 1;
			up->laststamp = trtmp;
		} else
		    up->tcswitch = 0;
		return;
	}
	pp->lencode = temp;
	pp->lastrec = up->laststamp;
	up->laststamp = trtmp;
	up->tcswitch = 1;
#ifdef DEBUG
	if (debug)
		printf("ulink: timecode %d %s\n", pp->lencode,
		    pp->a_lastcode);
#endif

	/*
	 * We get down to business, check the timecode format and decode
	 * its contents. If the timecode has invalid length or is not in
	 * proper format, we declare bad format and exit.
	 */
	syncchar = leapchar = modechar = siglchar = ' ';
	switch (pp->lencode ) {
		case LEN33X:

		/*
                 * First we check if the format is 33x or 325:
		 *   S9+D 00 YYYY+DDDUTCS HH:MM:SSL+5 (33x)
		 *   R5_1C00LYYYY+DDDUTCS HH:MM:SSL+5 (325)
		 * simply by comparing if the signal level is 'S' or 'R'
                 */

                 if (sscanf(pp->a_lastcode, "%c%*31c",
                            &siglchar) == 1) {

                    if(siglchar == SIGLCHAR325) {

       		   /*
		    * decode for a Model 325 decoder.
		    * Timecode format from January 23, 2004 datasheet is:
                    *
		    *   R5_1C00LYYYY+DDDUTCS HH:MM:SSL+5
                    *
		    *   R      WWVB decodersignal readability R1 - R5
		    *   5      R1 is unreadable, R5 is best
		    *   space  a space (0x20)
		    *   1      Data bit 0, 1, M (pos mark), or ? (unknown).
		    *   C      Reception from either (C)olorado or (H)awaii 
		    *   00     Hours since last good WWVB frame sync. Will 
		    *          be 00-99
		    *   space  Space char (0x20) or (0xa5) if locked to wwvb
		    *   YYYY   Current year, 2000-2099
		    *   +      Leap year indicator. '+' if a leap year,
		    *          a space (0x20) if not.
		    *   DDD    Day of year, 000 - 365.
		    *   UTC    Timezone (always 'UTC').
		    *   S      Daylight savings indicator
		    *             S - standard time (STD) in effect
		    *             O - during STD to DST day 0000-2400
		    *             D - daylight savings time (DST) in effect
		    *             I - during DST to STD day 0000-2400
		    *   space  Space character (0x20)
		    *   HH     Hours 00-23
		    *   :      This is the REAL in sync indicator (: = insync)	
		    *   MM     Minutes 00-59
		    *   :      : = in sync ? = NOT in sync
		    *   SS     Seconds 00-59
		    *   L      Leap second flag. Changes from space (0x20)
		    *          to 'I' or 'D' during month preceding leap
		    *          second adjustment. (I)nsert or (D)elete
		    *   +5     UT1 correction (sign + digit ))
		    */

   		       if (sscanf(pp->a_lastcode, 
                          "%*2c %*2c%2c%*c%4d%*c%3d%*4c %2d%c%2d:%2d%c%*2c",
   		          char_quality, &pp->year, &pp->day, 
                          &pp->hour, &syncchar, &pp->minute, &pp->second, 
                          &leapchar) == 8) { 
   		
   			  if (char_quality[0] == '0') {
   				quality = 0;
   			  } else if (char_quality[0] == '0') {
   				quality = (char_quality[1] & 0x0f);
   			  } else  {
   				quality = 99;
   			  }

   		          if (leapchar == 'I' ) leapchar = '+';
   		          if (leapchar == 'D' ) leapchar = '-';

		          /*
		          #ifdef DEBUG
		          if (debug) {
		             printf("ulink: char_quality %c %c\n", 
                                    char_quality[0], char_quality[1]);
			     printf("ulink: quality %d\n", quality);
			     printf("ulink: syncchar %x\n", syncchar);
			     printf("ulink: leapchar %x\n", leapchar);
                          }
                          #endif
                          */

                       }
		
                    } 
                    if(siglchar == SIGLCHAR33x) {
                
		   /*
		    * We got a Model 33X decoder.
		    * Timecode format from January 29, 2001 datasheet is:
		    *   S9+D 00 YYYY+DDDUTCS HH:MM:SSL+5
		    *   S      WWVB decoder sync indicator. S for in-sync(?)
		    *          or N for noisy signal.
		    *   9+     RF signal level in S-units, 0-9 followed by
		    *          a space (0x20). The space turns to '+' if the
		    *          level is over 9.
		    *   D      Data bit 0, 1, 2 (position mark), or
		    *          3 (unknown).
		    *   space  Space character (0x20)
		    *   00     Hours since last good WWVB frame sync. Will 
		    *          be 00-23 hrs, or '1d' to '7d'. Will be 'Lk'
                    *          if currently in sync. 
		    *   space  Space character (0x20)
		    *   YYYY   Current year, 1990-2089
		    *   +      Leap year indicator. '+' if a leap year,
		    *          a space (0x20) if not.
		    *   DDD    Day of year, 001 - 366.
		    *   UTC    Timezone (always 'UTC').
		    *   S      Daylight savings indicator
		    *             S - standard time (STD) in effect
		    *             O - during STD to DST day 0000-2400
		    *             D - daylight savings time (DST) in effect
		    *             I - during DST to STD day 0000-2400
		    *   space  Space character (0x20)
		    *   HH     Hours 00-23
		    *   :      This is the REAL in sync indicator (: = insync)	
		    *   MM     Minutes 00-59
		    *   :      : = in sync ? = NOT in sync
		    *   SS     Seconds 00-59
		    *   L      Leap second flag. Changes from space (0x20)
		    *          to '+' or '-' during month preceding leap
		    *          second adjustment.
		    *   +5     UT1 correction (sign + digit ))
		    */

		       if (sscanf(pp->a_lastcode, 
                           "%*4c %2c %4d%*c%3d%*4c %2d%c%2d:%2d%c%*2c",
		           char_quality, &pp->year, &pp->day, 
                           &pp->hour, &syncchar, &pp->minute, &pp->second, 
                           &leapchar) == 8) { 
		
			   if (char_quality[0] == 'L') {
				quality = 0;
			   } else if (char_quality[0] == '0') {
				quality = (char_quality[1] & 0x0f);
			   } else  {
				quality = 99;
		           }
	
                           /*
                           #ifdef DEBUG
         		   if (debug) {
         			printf("ulink: char_quality %c %c\n", 
                                        char_quality[0], char_quality[1]);
         			printf("ulink: quality %d\n", quality);
         			printf("ulink: syncchar %x\n", syncchar);
         			printf("ulink: leapchar %x\n", leapchar);
                           }
                           #endif
                           */

		        }
                    }
		    break;
		}

		case LEN320:

	        /*
		 * Model 320 Decoder
		 * The timecode format is:
		 *
		 *  SQRYYYYDDD+HH:MM:SS.mmLT
		 *
		 * where:
		 *
		 * S = 'S' -- sync'd in last hour,
		 *     '0'-'9' - hours x 10 since last update,
		 *     '?' -- not in sync
		 * Q = Number of correlating time-frames, from 0 to 5
		 * R = 'R' -- reception in progress,
		 *     'N' -- Noisy reception,
		 *     ' ' -- standby mode
		 * YYYY = year from 1990 to 2089
		 * DDD = current day from 1 to 366
		 * + = '+' if current year is a leap year, else ' '
		 * HH = UTC hour 0 to 23
		 * MM = Minutes of current hour from 0 to 59
		 * SS = Seconds of current minute from 0 to 59
		 * mm = 10's milliseconds of the current second from 00 to 99
		 * L  = Leap second pending at end of month
		 *     'I' = insert, 'D'= delete
		 * T  = DST <-> STD transition indicators
		 *
        	 */

		if (sscanf(pp->a_lastcode, "%c%1d%c%4d%3d%*c%2d:%2d:%2d.%2ld%c",
	               &syncchar, &quality, &modechar, &pp->year, &pp->day,
        	       &pp->hour, &pp->minute, &pp->second,
			&pp->nsec, &leapchar) == 10) {
		pp->nsec *= 10000000; /* M320 returns 10's of msecs */
		if (leapchar == 'I' ) leapchar = '+';
		if (leapchar == 'D' ) leapchar = '-';
		if (syncchar != '?' ) syncchar = ':';

 		break;
		}

		default:
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	/*
	 * Decode quality indicator
	 * For the 325 & 33x series, the lower the number the "better" 
	 * the time is. I used the dispersion as the measure of time 
	 * quality. The quality indicator in the 320 is the number of 
	 * correlating time frames (the more the better)
	 */

	/* 
	 * The spec sheet for the 325 & 33x series states the clock will
	 * maintain +/-0.002 seconds accuracy when locked to WWVB. This 
	 * is indicated by 'Lk' in the quality portion of the incoming 
	 * string. When not in lock, a drift of +/-0.015 seconds should 
	 * be allowed for.
	 * With the quality indicator decoding scheme above, the 'Lk' 
	 * condition will produce a quality value of 0. If the quality 
	 * indicator starts with '0' then the second character is the 
	 * number of hours since we were last locked. If the first 
	 * character is anything other than 'L' or '0' then we have been 
	 * out of lock for more than 9 hours so we assume the worst and 
	 * force a quality value that selects the 'default' maximum 
	 * dispersion. The dispersion values below are what came with the
	 * driver. They're not unreasonable so they've not been changed.
	 */

	if (pp->lencode == LEN33X) {
		switch (quality) {
			case 0 :
				pp->disp=.002;
				break;
			case 1 :
				pp->disp=.02;
				break;
			case 2 :
				pp->disp=.04;
				break;
			case 3 :
				pp->disp=.08;
				break;
			default:
				pp->disp=MAXDISPERSE;
				break;
		}
	} else {
		switch (quality) {
			case 5 :
				pp->disp=.002;
				break;
			case 4 :
				pp->disp=.02;
				break;
			case 3 :
				pp->disp=.04;
				break;
			case 2 :
				pp->disp=.08;
				break;
			case 1 :
				pp->disp=.16;
				break;
			default:
				pp->disp=MAXDISPERSE;
				break;
		}

	}

	/*
	 * Decode synchronization, and leap characters. If
	 * unsynchronized, set the leap bits accordingly and exit.
	 * Otherwise, set the leap bits according to the leap character.
	 */

	if (syncchar != ':')
		pp->leap = LEAP_NOTINSYNC;
	else if (leapchar == '+')
		pp->leap = LEAP_ADDSECOND;
	else if (leapchar == '-')
		pp->leap = LEAP_DELSECOND;
	else
		pp->leap = LEAP_NOWARNING;

	/*
	 * Process the new sample in the median filter and determine the
	 * timecode timestamp.
	 */
	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
	}

}

/*
 * ulink_poll - called by the transmit procedure
 */

static void
ulink_poll(
	int unit,
	struct peer *peer
	)
{
        struct refclockproc *pp;
        char pollchar;

        pp = peer->procptr;
        pollchar = 'T';
	if (pp->sloppyclockflag & CLK_FLAG1) {
	        if (write(pp->io.fd, &pollchar, 1) != 1)
        	        refclock_report(peer, CEVNT_FAULT);
        	else
      	            pp->polls++;
	}
	else
      	            pp->polls++;

        if (peer->burst > 0)
                return;
        if (pp->coderecv == pp->codeproc) {
                refclock_report(peer, CEVNT_TIMEOUT);
                return;
        }
        pp->lastref = pp->lastrec;
	refclock_receive(peer);
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
        peer->burst = NSTAGE;

}

#else
int refclock_ulink_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/ntpd-opts.menu0000644000175000017500000000006111675460564015407 0ustar  peterpeter* ntpd Invocation::                Invoking ntpd
ntp-4.2.6p5/ntpd/refclock_parse.c0000644000175000017500000047575111616416170015732 0ustar  peterpeter/*
 * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
 *
 * refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
 *
 * generic reference clock driver for several DCF/GPS/MSF/... receivers
 *
 * PPS notes:
 *   On systems that support PPSAPI (RFC2783) PPSAPI is the
 *   preferred interface.
 *
 *   Optionally make use of a STREAMS module for input processing where
 *   available and configured. This STREAMS module reduces the time
 *   stamp latency for serial and PPS events.
 *   Currently the STREAMS module is only available for Suns running
 *   SunOS 4.x and SunOS5.x.
 *
 * Copyright (c) 1995-2009 by Frank Kardel  ntp.org>
 * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
 *
 * 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.
 * 3. Neither the name of the author nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * 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.
 *
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#if defined(REFCLOCK) && defined(CLOCK_PARSE)

/*
 * 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 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)
 *
 *   - Meinberg GPS166/GPS167                               (GPS)
 *   - Trimble (TSIP and TAIP protocol)                     (GPS)
 *
 *   - RCC8000 MSF Receiver                                 (MSF)
 *   - VARITEXT clock					    (MSF)
 */

/*
 * Meinberg receivers are usually connected via a
 * 9600 baud 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
 *
 * Meinberg GPS16x setup:
 *      output time code every second
 *      Baudrate 19200 8N1
 *
 * This software supports the standard data formats used
 * in Meinberg receivers.
 *
 * Special software versions are only sensible for the
 * GPS 16x family of receivers.
 *
 * Meinberg can be reached via: http://www.meinberg.de/
 */

#include "ntpd.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"	/* includes  */
#include "ntp_control.h"
#include "ntp_string.h"

#include 
#include 
#ifndef TM_IN_SYS_TIME
# include 
#endif

#ifdef HAVE_UNISTD_H
# include 
#endif

#if !defined(STREAM) && !defined(HAVE_SYSV_TTYS) && !defined(HAVE_BSD_TTYS) && !defined(HAVE_TERMIOS)
# include "Bletch:  Define one of {STREAM,HAVE_SYSV_TTYS,HAVE_TERMIOS}"
#endif

#ifdef STREAM
# include 
# include 
#endif

#ifdef HAVE_TERMIOS
# define TTY_GETATTR(_FD_, _ARG_) tcgetattr((_FD_), (_ARG_))
# define TTY_SETATTR(_FD_, _ARG_) tcsetattr((_FD_), TCSANOW, (_ARG_))
# undef HAVE_SYSV_TTYS
#endif

#ifdef HAVE_SYSV_TTYS
# define TTY_GETATTR(_FD_, _ARG_) ioctl((_FD_), TCGETA, (_ARG_))
# define TTY_SETATTR(_FD_, _ARG_) ioctl((_FD_), TCSETAW, (_ARG_))
#endif

#ifdef HAVE_BSD_TTYS
/* #error CURRENTLY NO BSD TTY SUPPORT */
# include "Bletch: BSD TTY not currently supported"
#endif

#ifdef HAVE_SYS_IOCTL_H
# include 
#endif

#ifdef HAVE_PPSAPI
# include "ppsapi_timepps.h"
# include "refclock_atom.h"
#endif

#ifdef PPS
# ifdef HAVE_SYS_PPSCLOCK_H
#  include 
# endif
# ifdef HAVE_TIO_SERIAL_STUFF
#  include 
# endif
#endif

#define BUFFER_SIZE(_BUF, _PTR) ((_BUF) + sizeof(_BUF) - (_PTR))
#define BUFFER_SIZES(_BUF, _PTR, _SZ) ((_BUF) + (_SZ) - (_PTR))

/*
 * document type of PPS interfacing - copy of ifdef mechanism in local_input()
 */
#undef PPS_METHOD 

#ifdef HAVE_PPSAPI
#define PPS_METHOD "PPS API"
#else
#ifdef TIOCDCDTIMESTAMP
#define PPS_METHOD "TIOCDCDTIMESTAMP"
#else /* TIOCDCDTIMESTAMP */
#if defined(HAVE_STRUCT_PPSCLOCKEV) && (defined(HAVE_CIOGETEV) || defined(HAVE_TIOCGPPSEV))
#ifdef HAVE_CIOGETEV
#define PPS_METHOD "CIOGETEV"
#endif
#ifdef HAVE_TIOCGPPSEV
#define PPS_METHOD "TIOCGPPSEV"
#endif
#endif
#endif /* TIOCDCDTIMESTAMP */
#endif /* HAVE_PPSAPI */

#include "ntp_io.h"
#include "ntp_stdlib.h"

#include "parse.h"
#include "mbg_gps166.h"
#include "trimble.h"
#include "binio.h"
#include "ascii.h"
#include "ieee754io.h"
#include "recvbuff.h"

static char rcsid[] = "refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A+POWERUPTRUST";

/**===========================================================================
 ** external interface to ntp mechanism
 **/

static	int	parse_start	(int, struct peer *);
static	void	parse_shutdown	(int, struct peer *);
static	void	parse_poll	(int, struct peer *);
static	void	parse_control	(int, struct refclockstat *, struct refclockstat *, struct peer *);

struct	refclock refclock_parse = {
	parse_start,
	parse_shutdown,
	parse_poll,
	parse_control,
	noentry,
	noentry,
	NOFLAGS
};

/*
 * Definitions
 */
#define	MAXUNITS	4	/* maximum number of "PARSE" units permitted */
#define PARSEDEVICE	"/dev/refclock-%d" /* device to open %d is unit number */
#define PARSEPPSDEVICE	"/dev/refclockpps-%d" /* optional pps device to open %d is unit number */

#undef ABS
#define ABS(_X_) (((_X_) < 0) ? -(_X_) : (_X_))

#define PARSE_HARDPPS_DISABLE 0
#define PARSE_HARDPPS_ENABLE  1

/**===========================================================================
 ** function vector for dynamically binding io handling mechanism
 **/

struct parseunit;		/* to keep inquiring minds happy */

typedef struct bind
{
  const char *bd_description;	                                /* name of type of binding */
  int	(*bd_init)     (struct parseunit *);			/* initialize */
  void	(*bd_end)      (struct parseunit *);			/* end */
  int   (*bd_setcs)    (struct parseunit *, parsectl_t *);	/* set character size */
  int	(*bd_disable)  (struct parseunit *);			/* disable */
  int	(*bd_enable)   (struct parseunit *);			/* enable */
  int	(*bd_getfmt)   (struct parseunit *, parsectl_t *);	/* get format */
  int	(*bd_setfmt)   (struct parseunit *, parsectl_t *);	/* setfmt */
  int	(*bd_timecode) (struct parseunit *, parsectl_t *);	/* get time code */
  void	(*bd_receive)  (struct recvbuf *);			/* receive operation */
  int	(*bd_io_input) (struct recvbuf *);			/* input operation */
} bind_t;

#define PARSE_END(_X_)			(*(_X_)->binding->bd_end)(_X_)
#define PARSE_SETCS(_X_, _CS_)		(*(_X_)->binding->bd_setcs)(_X_, _CS_)
#define PARSE_ENABLE(_X_)		(*(_X_)->binding->bd_enable)(_X_)
#define PARSE_DISABLE(_X_)		(*(_X_)->binding->bd_disable)(_X_)
#define PARSE_GETFMT(_X_, _DCT_)	(*(_X_)->binding->bd_getfmt)(_X_, _DCT_)
#define PARSE_SETFMT(_X_, _DCT_)	(*(_X_)->binding->bd_setfmt)(_X_, _DCT_)
#define PARSE_GETTIMECODE(_X_, _DCT_)	(*(_X_)->binding->bd_timecode)(_X_, _DCT_)

/*
 * special handling flags
 */
#define PARSE_F_PPSONSECOND	0x00000001 /* PPS pulses are on second */
#define PARSE_F_POWERUPTRUST	0x00000100 /* POWERUP state ist trusted for */
                                           /* trusttime after SYNC was seen */
/**===========================================================================
 ** error message regression handling
 **
 ** there are quite a few errors that can occur in rapid succession such as
 ** noisy input data or no data at all. in order to reduce the amount of
 ** syslog messages in such case, we are using a backoff algorithm. We limit
 ** the number of error messages of a certain class to 1 per time unit. if a
 ** configurable number of messages is displayed that way, we move on to the
 ** next time unit / count for that class. a count of messages that have been
 ** suppressed is held and displayed whenever a corresponding message is
 ** displayed. the time units for a message class will also be displayed.
 ** whenever an error condition clears we reset the error message state,
 ** thus we would still generate much output on pathological conditions
 ** where the system oscillates between OK and NOT OK states. coping
 ** with that condition is currently considered too complicated.
 **/

#define ERR_ALL	        (unsigned)~0	/* "all" errors */
#define ERR_BADDATA	(unsigned)0	/* unusable input data/conversion errors */
#define ERR_NODATA	(unsigned)1	/* no input data */
#define ERR_BADIO	(unsigned)2	/* read/write/select errors */
#define ERR_BADSTATUS	(unsigned)3	/* unsync states */
#define ERR_BADEVENT	(unsigned)4	/* non nominal events */
#define ERR_INTERNAL	(unsigned)5	/* internal error */
#define ERR_CNT		(unsigned)(ERR_INTERNAL+1)

#define ERR(_X_)	if (list_err(parse, (_X_)))

struct errorregression
{
	u_long err_count;	/* number of repititions per class */
	u_long err_delay;	/* minimum delay between messages */
};

static struct errorregression
err_baddata[] =			/* error messages for bad input data */
{
	{ 1,       0 },		/* output first message immediately */
	{ 5,      60 },		/* output next five messages in 60 second intervals */
	{ 3,    3600 },		/* output next 3 messages in hour intervals */
	{ 0, 12*3600 }		/* repeat messages only every 12 hours */
};

static struct errorregression
err_nodata[] =			/* error messages for missing input data */
{
	{ 1,       0 },		/* output first message immediately */
	{ 5,      60 },		/* output next five messages in 60 second intervals */
	{ 3,    3600 },		/* output next 3 messages in hour intervals */
	{ 0, 12*3600 }		/* repeat messages only every 12 hours */
};

static struct errorregression
err_badstatus[] =		/* unsynchronized state messages */
{
	{ 1,       0 },		/* output first message immediately */
	{ 5,      60 },		/* output next five messages in 60 second intervals */
	{ 3,    3600 },		/* output next 3 messages in hour intervals */
	{ 0, 12*3600 }		/* repeat messages only every 12 hours */
};

static struct errorregression
err_badio[] =			/* io failures (bad reads, selects, ...) */
{
	{ 1,       0 },		/* output first message immediately */
	{ 5,      60 },		/* output next five messages in 60 second intervals */
	{ 5,    3600 },		/* output next 3 messages in hour intervals */
	{ 0, 12*3600 }		/* repeat messages only every 12 hours */
};

static struct errorregression
err_badevent[] =		/* non nominal events */
{
	{ 20,      0 },		/* output first message immediately */
	{ 6,      60 },		/* output next five messages in 60 second intervals */
	{ 5,    3600 },		/* output next 3 messages in hour intervals */
	{ 0, 12*3600 }		/* repeat messages only every 12 hours */
};

static struct errorregression
err_internal[] =		/* really bad things - basically coding/OS errors */
{
	{ 0,       0 },		/* output all messages immediately */
};

static struct errorregression *
err_tbl[] =
{
	err_baddata,
	err_nodata,
	err_badio,
	err_badstatus,
	err_badevent,
	err_internal
};

struct errorinfo
{
	u_long err_started;	/* begin time (ntp) of error condition */
	u_long err_last;	/* last time (ntp) error occurred */
	u_long err_cnt;	/* number of error repititions */
	u_long err_suppressed;	/* number of suppressed messages */
	struct errorregression *err_stage; /* current error stage */
};

/**===========================================================================
 ** refclock instance data
 **/

struct parseunit
{
	/*
	 * NTP management
	 */
	struct peer         *peer;		/* backlink to peer structure - refclock inactive if 0  */
	struct refclockproc *generic;		/* backlink to refclockproc structure */

	/*
	 * PARSE io
	 */
	bind_t	     *binding;	        /* io handling binding */
	
	/*
	 * parse state
	 */
	parse_t	      parseio;	        /* io handling structure (user level parsing) */

	/*
	 * type specific parameters
	 */
	struct parse_clockinfo   *parse_type;	        /* link to clock description */

	/*
	 * clock state handling/reporting
	 */
	u_char	      flags;	        /* flags (leap_control) */
	u_long	      lastchange;       /* time (ntp) when last state change accured */
	u_long	      statetime[CEVNT_MAX+1]; /* accumulated time of clock states */
	u_long        pollneeddata; 	/* current_time(!=0) for receive sample expected in PPS mode */
	u_short	      lastformat;       /* last format used */
	u_long        lastsync;		/* time (ntp) when clock was last seen fully synchronized */
        u_long        maxunsync;        /* max time in seconds a receiver is trusted after loosing synchronisation */
        double        ppsphaseadjust;   /* phase adjustment of PPS time stamp */
        u_long        lastmissed;       /* time (ntp) when poll didn't get data (powerup heuristic) */
	u_long        ppsserial;        /* magic cookie for ppsclock serials (avoids stale ppsclock data) */
	int	      ppsfd;	        /* fd to ise for PPS io */
#ifdef HAVE_PPSAPI
        int           hardppsstate;     /* current hard pps state */
	struct refclock_atom atom;      /* PPSAPI structure */
#endif
	parsetime_t   timedata;		/* last (parse module) data */
	void         *localdata;        /* optional local, receiver-specific data */
        unsigned long localstate;       /* private local state */
	struct errorinfo errors[ERR_CNT];  /* error state table for suppressing excessive error messages */
	struct ctl_var *kv;	        /* additional pseudo variables */
	u_long        laststatistic;    /* time when staticstics where output */
};


/**===========================================================================
 ** Clockinfo section all parameter for specific clock types
 ** includes NTP parameters, TTY parameters and IO handling parameters
 **/

static	void	poll_dpoll	(struct parseunit *);
static	void	poll_poll	(struct peer *);
static	int	poll_init	(struct parseunit *);

typedef struct poll_info
{
	u_long      rate;		/* poll rate - once every "rate" seconds - 0 off */
	const char *string;		/* string to send for polling */
	u_long      count;		/* number of characters in string */
} poll_info_t;

#define NO_CL_FLAGS	0
#define NO_POLL		0
#define NO_INIT		0
#define NO_END		0
#define NO_EVENT	0
#define NO_LCLDATA	0
#define NO_MESSAGE	0
#define NO_PPSDELAY     0

#define DCF_ID		"DCF"	/* generic DCF */
#define DCF_A_ID	"DCFa"	/* AM demodulation */
#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_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 DCF_TYPE		CTL_SST_TS_LF
#define GPS_TYPE		CTL_SST_TS_UHF

/*
 * receiver specific constants
 */
#define MBG_SPEED		(B9600)
#define MBG_CFLAG		(CS7|PARENB|CREAD|CLOCAL|HUPCL|CSTOPB)
#define MBG_IFLAG		(IGNBRK|IGNPAR|ISTRIP)
#define MBG_OFLAG		0
#define MBG_LFLAG		0
#define MBG_FLAGS               PARSE_F_PPSONSECOND

/*
 * Meinberg DCF77 receivers
 */
#define	DCFUA31_ROOTDELAY	0.0  /* 0 */
#define	DCFUA31_BASEDELAY	0.010  /* 10.7421875ms: 10 ms (+/- 3 ms) */
#define	DCFUA31_DESCRIPTION	"Meinberg DCF77 C51 or compatible"
#define DCFUA31_MAXUNSYNC       60*30       /* only trust clock for 1/2 hour */
#define DCFUA31_SPEED		MBG_SPEED
#define DCFUA31_CFLAG           MBG_CFLAG
#define DCFUA31_IFLAG           MBG_IFLAG
#define DCFUA31_OFLAG           MBG_OFLAG
#define DCFUA31_LFLAG           MBG_LFLAG
#define DCFUA31_SAMPLES		5
#define DCFUA31_KEEP		3
#define DCFUA31_FORMAT		"Meinberg Standard"

/*
 * Meinberg DCF PZF535/TCXO (FM/PZF) receiver
 */
#define	DCFPZF535_ROOTDELAY	0.0
#define	DCFPZF535_BASEDELAY	0.001968  /* 1.968ms +- 104us (oscilloscope) - relative to start (end of STX) */
#define	DCFPZF535_DESCRIPTION	"Meinberg DCF PZF 535/509 / TCXO"
#define DCFPZF535_MAXUNSYNC     60*60*12           /* only trust clock for 12 hours
						    * @ 5e-8df/f we have accumulated
						    * at most 2.16 ms (thus we move to
						    * NTP synchronisation */
#define DCFPZF535_SPEED		MBG_SPEED
#define DCFPZF535_CFLAG         MBG_CFLAG
#define DCFPZF535_IFLAG         MBG_IFLAG
#define DCFPZF535_OFLAG         MBG_OFLAG
#define DCFPZF535_LFLAG         MBG_LFLAG
#define DCFPZF535_SAMPLES	       5
#define DCFPZF535_KEEP		       3
#define DCFPZF535_FORMAT	"Meinberg Standard"

/*
 * Meinberg DCF PZF535/OCXO receiver
 */
#define	DCFPZF535OCXO_ROOTDELAY	0.0
#define	DCFPZF535OCXO_BASEDELAY	0.001968 /* 1.968ms +- 104us (oscilloscope) - relative to start (end of STX) */
#define	DCFPZF535OCXO_DESCRIPTION "Meinberg DCF PZF 535/509 / OCXO"
#define DCFPZF535OCXO_MAXUNSYNC     60*60*96       /* only trust clock for 4 days
						    * @ 5e-9df/f we have accumulated
						    * at most an error of 1.73 ms
						    * (thus we move to NTP synchronisation) */
#define DCFPZF535OCXO_SPEED	    MBG_SPEED
#define DCFPZF535OCXO_CFLAG         MBG_CFLAG
#define DCFPZF535OCXO_IFLAG         MBG_IFLAG
#define DCFPZF535OCXO_OFLAG         MBG_OFLAG
#define DCFPZF535OCXO_LFLAG         MBG_LFLAG
#define DCFPZF535OCXO_SAMPLES		   5
#define DCFPZF535OCXO_KEEP	           3
#define DCFPZF535OCXO_FORMAT	    "Meinberg Standard"

/*
 * Meinberg GPS16X receiver
 */
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_MAXUNSYNC        60*60*96       /* only trust clock for 4 days
						* @ 5e-9df/f we have accumulated
						* at most an error of 1.73 ms
						* (thus we move to NTP synchronisation) */
#define GPS16X_SPEED		B19200
#define GPS16X_CFLAG            (CS8|CREAD|CLOCAL|HUPCL)
#define GPS16X_IFLAG            (IGNBRK|IGNPAR)
#define GPS16X_OFLAG            MBG_OFLAG
#define GPS16X_LFLAG            MBG_LFLAG
#define GPS16X_POLLRATE	6
#define GPS16X_POLLCMD	""
#define GPS16X_CMDSIZE	0

static poll_info_t gps16x_pollinfo = { GPS16X_POLLRATE, GPS16X_POLLCMD, GPS16X_CMDSIZE };

#define GPS16X_INIT		gps16x_poll_init
#define GPS16X_POLL	        0
#define GPS16X_END		0
#define GPS16X_DATA		((void *)(&gps16x_pollinfo))
#define GPS16X_MESSAGE		gps16x_message
#define GPS16X_ID		GPS_ID
#define GPS16X_FORMAT		"Meinberg GPS Extended"
#define GPS16X_SAMPLES		5
#define GPS16X_KEEP		3

/*
 * ELV DCF7000 Wallclock-Receiver/Switching Clock (Kit)
 *
 * This is really not the hottest clock - but before you have nothing ...
 */
#define DCF7000_ROOTDELAY	0.0 /* 0 */
#define DCF7000_BASEDELAY	0.405 /* slow blow */
#define DCF7000_DESCRIPTION	"ELV DCF7000"
#define DCF7000_MAXUNSYNC	(60*5) /* sorry - but it just was not build as a clock */
#define DCF7000_SPEED		(B9600)
#define DCF7000_CFLAG           (CS8|CREAD|PARENB|PARODD|CLOCAL|HUPCL)
#define DCF7000_IFLAG		(IGNBRK)
#define DCF7000_OFLAG		0
#define DCF7000_LFLAG		0
#define DCF7000_SAMPLES		5
#define DCF7000_KEEP		3
#define DCF7000_FORMAT		"ELV DCF7000"

/*
 * Schmid DCF Receiver Kit
 *
 * When the WSDCF clock is operating optimally we want the primary clock
 * distance to come out at 300 ms.  Thus, peer.distance in the WSDCF peer
 * structure is set to 290 ms and we compute delays which are at least
 * 10 ms long.  The following are 290 ms and 10 ms expressed in u_fp format
 */
#define WS_POLLRATE	1	/* every second - watch interdependency with poll routine */
#define WS_POLLCMD	"\163"
#define WS_CMDSIZE	1

static poll_info_t wsdcf_pollinfo = { WS_POLLRATE, WS_POLLCMD, WS_CMDSIZE };

#define WSDCF_INIT		poll_init
#define WSDCF_POLL		poll_dpoll
#define WSDCF_END		0
#define WSDCF_DATA		((void *)(&wsdcf_pollinfo))
#define	WSDCF_ROOTDELAY		0.0	/* 0 */
#define	WSDCF_BASEDELAY	 	0.010	/*  ~  10ms */
#define WSDCF_DESCRIPTION	"WS/DCF Receiver"
#define WSDCF_FORMAT		"Schmid"
#define WSDCF_MAXUNSYNC		(60*60)	/* assume this beast hold at 1 h better than 2 ms XXX-must verify */
#define WSDCF_SPEED		(B1200)
#define WSDCF_CFLAG		(CS8|CREAD|CLOCAL)
#define WSDCF_IFLAG		0
#define WSDCF_OFLAG		0
#define WSDCF_LFLAG		0
#define WSDCF_SAMPLES		5
#define WSDCF_KEEP		3

/*
 * RAW DCF77 - input of DCF marks via RS232 - many variants
 */
#define RAWDCF_FLAGS		0
#define RAWDCF_ROOTDELAY	0.0 /* 0 */
#define RAWDCF_BASEDELAY	0.258
#define RAWDCF_FORMAT		"RAW DCF77 Timecode"
#define RAWDCF_MAXUNSYNC	(0) /* sorry - its a true receiver - no signal - no time */
#define RAWDCF_SPEED		(B50)
#ifdef NO_PARENB_IGNPAR /* Was: defined(SYS_IRIX4) || defined(SYS_IRIX5) */
/* somehow doesn't grok PARENB & IGNPAR (mj) */
# define RAWDCF_CFLAG            (CS8|CREAD|CLOCAL)
#else
# define RAWDCF_CFLAG            (CS8|CREAD|CLOCAL|PARENB)
#endif
#ifdef RAWDCF_NO_IGNPAR /* Was: defined(SYS_LINUX) && defined(CLOCK_RAWDCF) */
# define RAWDCF_IFLAG		0
#else
# define RAWDCF_IFLAG		(IGNPAR)
#endif
#define RAWDCF_OFLAG		0
#define RAWDCF_LFLAG		0
#define RAWDCF_SAMPLES		20
#define RAWDCF_KEEP		12
#define RAWDCF_INIT		0

/*
 * RAW DCF variants
 */
/*
 * Conrad receiver
 *
 * simplest (cheapest) DCF clock - e. g. DCF77 receiver by Conrad
 * (~40DM - roughly $30 ) followed by a level converter for RS232
 */
#define CONRAD_BASEDELAY	0.292 /* Conrad receiver @ 50 Baud on a Sun */
#define CONRAD_DESCRIPTION	"RAW DCF77 CODE (Conrad DCF77 receiver module)"

/* Gude Analog- und Digitalsystem GmbH 'Expert mouseCLOCK USB v2.0' */
#define GUDE_EMC_USB_V20_SPEED            (B4800)
#define GUDE_EMC_USB_V20_BASEDELAY        0.425 /* USB serial<->USB converter FTDI232R */
#define GUDE_EMC_USB_V20_DESCRIPTION      "RAW DCF77 CODE (Expert mouseCLOCK USB v2.0)"

/*
 * TimeBrick receiver
 */
#define TIMEBRICK_BASEDELAY	0.210 /* TimeBrick @ 50 Baud on a Sun */
#define TIMEBRICK_DESCRIPTION	"RAW DCF77 CODE (TimeBrick)"

/*
 * IGEL:clock receiver
 */
#define IGELCLOCK_BASEDELAY	0.258 /* IGEL:clock receiver */
#define IGELCLOCK_DESCRIPTION	"RAW DCF77 CODE (IGEL:clock)"
#define IGELCLOCK_SPEED		(B1200)
#define IGELCLOCK_CFLAG		(CS8|CREAD|HUPCL|CLOCAL)

/*
 * RAWDCF receivers that need to be powered from DTR
 * (like Expert mouse clock)
 */
static	int	rawdcf_init_1	(struct parseunit *);
#define RAWDCFDTRSET_DESCRIPTION	"RAW DCF77 CODE (DTR SET/RTS CLR)"
#define RAWDCFDTRSET75_DESCRIPTION	"RAW DCF77 CODE (DTR SET/RTS CLR @ 75 baud)"
#define RAWDCFDTRSET_INIT 		rawdcf_init_1

/*
 * RAWDCF receivers that need to be powered from
 * DTR CLR and RTS SET
 */
static	int	rawdcf_init_2	(struct parseunit *);
#define RAWDCFDTRCLRRTSSET_DESCRIPTION	"RAW DCF77 CODE (DTR CLR/RTS SET)"
#define RAWDCFDTRCLRRTSSET75_DESCRIPTION "RAW DCF77 CODE (DTR CLR/RTS SET @ 75 baud)"
#define RAWDCFDTRCLRRTSSET_INIT	rawdcf_init_2

/*
 * Trimble GPS receivers (TAIP and TSIP protocols)
 */
#ifndef TRIM_POLLRATE
#define TRIM_POLLRATE	0	/* only true direct polling */
#endif

#define TRIM_TAIPPOLLCMD	">SRM;FR_FLAG=F;EC_FLAG=F<>QTM<"
#define TRIM_TAIPCMDSIZE	(sizeof(TRIM_TAIPPOLLCMD)-1)

static poll_info_t trimbletaip_pollinfo = { TRIM_POLLRATE, TRIM_TAIPPOLLCMD, TRIM_TAIPCMDSIZE };
static	int	trimbletaip_init	(struct parseunit *);
static	void	trimbletaip_event	(struct parseunit *, int);

/* query time & UTC correction data */
static char tsipquery[] = { DLE, 0x21, DLE, ETX, DLE, 0x2F, DLE, ETX };

static poll_info_t trimbletsip_pollinfo = { TRIM_POLLRATE, tsipquery, sizeof(tsipquery) };
static	int	trimbletsip_init	(struct parseunit *);
static	void	trimbletsip_end   	(struct parseunit *);
static	void	trimbletsip_message	(struct parseunit *, parsetime_t *);
static	void	trimbletsip_event	(struct parseunit *, int);

#define TRIMBLETSIP_IDLE_TIME	    (300) /* 5 minutes silence at most */
#define TRIMBLE_RESET_HOLDOFF       TRIMBLETSIP_IDLE_TIME

#define TRIMBLETAIP_SPEED	    (B4800)
#define TRIMBLETAIP_CFLAG           (CS8|CREAD|CLOCAL)
#define TRIMBLETAIP_IFLAG           (BRKINT|IGNPAR|ISTRIP|ICRNL|IXON)
#define TRIMBLETAIP_OFLAG           (OPOST|ONLCR)
#define TRIMBLETAIP_LFLAG           (0)

#define TRIMBLETSIP_SPEED	    (B9600)
#define TRIMBLETSIP_CFLAG           (CS8|CLOCAL|CREAD|PARENB|PARODD)
#define TRIMBLETSIP_IFLAG           (IGNBRK)
#define TRIMBLETSIP_OFLAG           (0)
#define TRIMBLETSIP_LFLAG           (ICANON)

#define TRIMBLETSIP_SAMPLES	    5
#define TRIMBLETSIP_KEEP	    3
#define TRIMBLETAIP_SAMPLES	    5
#define TRIMBLETAIP_KEEP	    3

#define TRIMBLETAIP_FLAGS	    (PARSE_F_PPSONSECOND)
#define TRIMBLETSIP_FLAGS	    (TRIMBLETAIP_FLAGS)

#define TRIMBLETAIP_POLL	    poll_dpoll
#define TRIMBLETSIP_POLL	    poll_dpoll

#define TRIMBLETAIP_INIT	    trimbletaip_init
#define TRIMBLETSIP_INIT	    trimbletsip_init

#define TRIMBLETAIP_EVENT	    trimbletaip_event   

#define TRIMBLETSIP_EVENT	    trimbletsip_event   
#define TRIMBLETSIP_MESSAGE	    trimbletsip_message

#define TRIMBLETAIP_END		    0
#define TRIMBLETSIP_END		    trimbletsip_end

#define TRIMBLETAIP_DATA	    ((void *)(&trimbletaip_pollinfo))
#define TRIMBLETSIP_DATA	    ((void *)(&trimbletsip_pollinfo))

#define TRIMBLETAIP_ID		    GPS_ID
#define TRIMBLETSIP_ID		    GPS_ID

#define TRIMBLETAIP_FORMAT	    "Trimble TAIP"
#define TRIMBLETSIP_FORMAT	    "Trimble TSIP"

#define TRIMBLETAIP_ROOTDELAY        0x0
#define TRIMBLETSIP_ROOTDELAY        0x0

#define TRIMBLETAIP_BASEDELAY        0.0
#define TRIMBLETSIP_BASEDELAY        0.020	/* GPS time message latency */

#define TRIMBLETAIP_DESCRIPTION      "Trimble GPS (TAIP) receiver"
#define TRIMBLETSIP_DESCRIPTION      "Trimble GPS (TSIP) receiver"

#define TRIMBLETAIP_MAXUNSYNC        0
#define TRIMBLETSIP_MAXUNSYNC        0

#define TRIMBLETAIP_EOL		    '<'

/*
 * RadioCode Clocks RCC 800 receiver
 */
#define RCC_POLLRATE   0       /* only true direct polling */
#define RCC_POLLCMD    "\r"
#define RCC_CMDSIZE    1

static poll_info_t rcc8000_pollinfo = { RCC_POLLRATE, RCC_POLLCMD, RCC_CMDSIZE };
#define RCC8000_FLAGS		0
#define RCC8000_POLL            poll_dpoll
#define RCC8000_INIT            poll_init
#define RCC8000_END             0
#define RCC8000_DATA            ((void *)(&rcc8000_pollinfo))
#define RCC8000_ROOTDELAY       0.0
#define RCC8000_BASEDELAY       0.0
#define RCC8000_ID              "MSF"
#define RCC8000_DESCRIPTION     "RCC 8000 MSF Receiver"
#define RCC8000_FORMAT          "Radiocode RCC8000"
#define RCC8000_MAXUNSYNC       (60*60) /* should be ok for an hour */
#define RCC8000_SPEED		(B2400)
#define RCC8000_CFLAG           (CS8|CREAD|CLOCAL)
#define RCC8000_IFLAG           (IGNBRK|IGNPAR)
#define RCC8000_OFLAG           0
#define RCC8000_LFLAG           0
#define RCC8000_SAMPLES         5
#define RCC8000_KEEP	        3

/*
 * Hopf Radio clock 6021 Format 
 *
 */
#define HOPF6021_ROOTDELAY	0.0
#define HOPF6021_BASEDELAY	0.0
#define HOPF6021_DESCRIPTION	"HOPF 6021"
#define HOPF6021_FORMAT         "hopf Funkuhr 6021"
#define HOPF6021_MAXUNSYNC	(60*60)  /* should be ok for an hour */
#define HOPF6021_SPEED         (B9600)
#define HOPF6021_CFLAG          (CS8|CREAD|CLOCAL)
#define HOPF6021_IFLAG		(IGNBRK|ISTRIP)
#define HOPF6021_OFLAG		0
#define HOPF6021_LFLAG		0
#define HOPF6021_FLAGS          0
#define HOPF6021_SAMPLES        5
#define HOPF6021_KEEP	        3

/*
 * Diem's Computime Radio Clock Receiver
 */
#define COMPUTIME_FLAGS       0
#define COMPUTIME_ROOTDELAY   0.0
#define COMPUTIME_BASEDELAY   0.0
#define COMPUTIME_ID          DCF_ID
#define COMPUTIME_DESCRIPTION "Diem's Computime receiver"
#define COMPUTIME_FORMAT      "Diem's Computime Radio Clock"
#define COMPUTIME_TYPE        DCF_TYPE
#define COMPUTIME_MAXUNSYNC   (60*60)       /* only trust clock for 1 hour */
#define COMPUTIME_SPEED       (B9600)
#define COMPUTIME_CFLAG       (CSTOPB|CS7|CREAD|CLOCAL)
#define COMPUTIME_IFLAG       (IGNBRK|IGNPAR|ISTRIP)
#define COMPUTIME_OFLAG       0
#define COMPUTIME_LFLAG       0
#define COMPUTIME_SAMPLES     5
#define COMPUTIME_KEEP        3

/*
 * Varitext Radio Clock Receiver
 */
#define VARITEXT_FLAGS       0
#define VARITEXT_ROOTDELAY   0.0
#define VARITEXT_BASEDELAY   0.0
#define VARITEXT_ID          "MSF"
#define VARITEXT_DESCRIPTION "Varitext receiver"
#define VARITEXT_FORMAT      "Varitext Radio Clock"
#define VARITEXT_TYPE        DCF_TYPE
#define VARITEXT_MAXUNSYNC   (60*60)       /* only trust clock for 1 hour */
#define VARITEXT_SPEED       (B9600)
#define VARITEXT_CFLAG       (CS7|CREAD|CLOCAL|PARENB|PARODD)
#define VARITEXT_IFLAG       (IGNPAR|IGNBRK|INPCK) /*|ISTRIP)*/
#define VARITEXT_OFLAG       0
#define VARITEXT_LFLAG       0
#define VARITEXT_SAMPLES     32
#define VARITEXT_KEEP        20

static struct parse_clockinfo
{
	u_long  cl_flags;		/* operation flags (PPS interpretation, trust handling) */
  void  (*cl_poll)    (struct parseunit *);			/* active poll routine */
  int   (*cl_init)    (struct parseunit *);			/* active poll init routine */
  void  (*cl_event)   (struct parseunit *, int);		/* special event handling (e.g. reset clock) */
  void  (*cl_end)     (struct parseunit *);			/* active poll end routine */
  void  (*cl_message) (struct parseunit *, parsetime_t *);	/* process a lower layer message */
	void   *cl_data;		/* local data area for "poll" mechanism */
	double    cl_rootdelay;		/* rootdelay */
	double    cl_basedelay;		/* current offset by which the RS232
				time code is delayed from the actual time */
	const char *cl_id;		/* ID code */
	const char *cl_description;		/* device name */
	const char *cl_format;		/* fixed format */
	u_char  cl_type;		/* clock type (ntp control) */
	u_long  cl_maxunsync;		/* time to trust oscillator after losing synch */
	u_long  cl_speed;		/* terminal input & output baudrate */
	u_long  cl_cflag;             /* terminal control flags */
	u_long  cl_iflag;             /* terminal input flags */
	u_long  cl_oflag;             /* terminal output flags */
	u_long  cl_lflag;             /* terminal local flags */
	u_long  cl_samples;	      /* samples for median filter */
	u_long  cl_keep;              /* samples for median filter to keep */
} parse_clockinfo[] =
{
	{				/* mode 0 */
		MBG_FLAGS,
		NO_POLL,
		NO_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		DCFPZF535_ROOTDELAY,
		DCFPZF535_BASEDELAY,
		DCF_P_ID,
		DCFPZF535_DESCRIPTION,
		DCFPZF535_FORMAT,
		DCF_TYPE,
		DCFPZF535_MAXUNSYNC,
		DCFPZF535_SPEED,
		DCFPZF535_CFLAG,
		DCFPZF535_IFLAG,
		DCFPZF535_OFLAG,
		DCFPZF535_LFLAG,
		DCFPZF535_SAMPLES,
		DCFPZF535_KEEP
	},
	{				/* mode 1 */
		MBG_FLAGS,
		NO_POLL,
		NO_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		DCFPZF535OCXO_ROOTDELAY,
		DCFPZF535OCXO_BASEDELAY,
		DCF_P_ID,
		DCFPZF535OCXO_DESCRIPTION,
		DCFPZF535OCXO_FORMAT,
		DCF_TYPE,
		DCFPZF535OCXO_MAXUNSYNC,
		DCFPZF535OCXO_SPEED,
		DCFPZF535OCXO_CFLAG,
		DCFPZF535OCXO_IFLAG,
		DCFPZF535OCXO_OFLAG,
		DCFPZF535OCXO_LFLAG,
		DCFPZF535OCXO_SAMPLES,
		DCFPZF535OCXO_KEEP
	},
	{				/* mode 2 */
		MBG_FLAGS,
		NO_POLL,
		NO_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		DCFUA31_ROOTDELAY,
		DCFUA31_BASEDELAY,
		DCF_A_ID,
		DCFUA31_DESCRIPTION,
		DCFUA31_FORMAT,
		DCF_TYPE,
		DCFUA31_MAXUNSYNC,
		DCFUA31_SPEED,
		DCFUA31_CFLAG,
		DCFUA31_IFLAG,
		DCFUA31_OFLAG,
		DCFUA31_LFLAG,
		DCFUA31_SAMPLES,
		DCFUA31_KEEP
	},
	{				/* mode 3 */
		MBG_FLAGS,
		NO_POLL,
		NO_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		DCF7000_ROOTDELAY,
		DCF7000_BASEDELAY,
		DCF_A_ID,
		DCF7000_DESCRIPTION,
		DCF7000_FORMAT,
		DCF_TYPE,
		DCF7000_MAXUNSYNC,
		DCF7000_SPEED,
		DCF7000_CFLAG,
		DCF7000_IFLAG,
		DCF7000_OFLAG,
		DCF7000_LFLAG,
		DCF7000_SAMPLES,
		DCF7000_KEEP
	},
	{				/* mode 4 */
		NO_CL_FLAGS,
		WSDCF_POLL,
		WSDCF_INIT,
		NO_EVENT,
		WSDCF_END,
		NO_MESSAGE,
		WSDCF_DATA,
		WSDCF_ROOTDELAY,
		WSDCF_BASEDELAY,
		DCF_A_ID,
		WSDCF_DESCRIPTION,
		WSDCF_FORMAT,
		DCF_TYPE,
		WSDCF_MAXUNSYNC,
		WSDCF_SPEED,
		WSDCF_CFLAG,
		WSDCF_IFLAG,
		WSDCF_OFLAG,
		WSDCF_LFLAG,
		WSDCF_SAMPLES,
		WSDCF_KEEP
	},
	{				/* mode 5 */
		RAWDCF_FLAGS,
		NO_POLL,
		RAWDCF_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		RAWDCF_ROOTDELAY,
		CONRAD_BASEDELAY,
		DCF_A_ID,
		CONRAD_DESCRIPTION,
		RAWDCF_FORMAT,
		DCF_TYPE,
		RAWDCF_MAXUNSYNC,
		RAWDCF_SPEED,
		RAWDCF_CFLAG,
		RAWDCF_IFLAG,
		RAWDCF_OFLAG,
		RAWDCF_LFLAG,
		RAWDCF_SAMPLES,
		RAWDCF_KEEP
	},
	{				/* mode 6 */
		RAWDCF_FLAGS,
		NO_POLL,
		RAWDCF_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		RAWDCF_ROOTDELAY,
		TIMEBRICK_BASEDELAY,
		DCF_A_ID,
		TIMEBRICK_DESCRIPTION,
		RAWDCF_FORMAT,
		DCF_TYPE,
		RAWDCF_MAXUNSYNC,
		RAWDCF_SPEED,
		RAWDCF_CFLAG,
		RAWDCF_IFLAG,
		RAWDCF_OFLAG,
		RAWDCF_LFLAG,
		RAWDCF_SAMPLES,
		RAWDCF_KEEP
	},
	{				/* mode 7 */
		MBG_FLAGS,
		GPS16X_POLL,
		GPS16X_INIT,
		NO_EVENT,
		GPS16X_END,
		GPS16X_MESSAGE,
		GPS16X_DATA,
		GPS16X_ROOTDELAY,
		GPS16X_BASEDELAY,
		GPS16X_ID,
		GPS16X_DESCRIPTION,
		GPS16X_FORMAT,
		GPS_TYPE,
		GPS16X_MAXUNSYNC,
		GPS16X_SPEED,
		GPS16X_CFLAG,
		GPS16X_IFLAG,
		GPS16X_OFLAG,
		GPS16X_LFLAG,
		GPS16X_SAMPLES,
		GPS16X_KEEP
	},
	{				/* mode 8 */
		RAWDCF_FLAGS,
		NO_POLL,
		NO_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		RAWDCF_ROOTDELAY,
		IGELCLOCK_BASEDELAY,
		DCF_A_ID,
		IGELCLOCK_DESCRIPTION,
		RAWDCF_FORMAT,
		DCF_TYPE,
		RAWDCF_MAXUNSYNC,
		IGELCLOCK_SPEED,
		IGELCLOCK_CFLAG,
		RAWDCF_IFLAG,
		RAWDCF_OFLAG,
		RAWDCF_LFLAG,
		RAWDCF_SAMPLES,
		RAWDCF_KEEP
	},
	{				/* mode 9 */
		TRIMBLETAIP_FLAGS,
#if TRIM_POLLRATE		/* DHD940515: Allow user config */
		NO_POLL,
#else
		TRIMBLETAIP_POLL,
#endif
		TRIMBLETAIP_INIT,
		TRIMBLETAIP_EVENT,
		TRIMBLETAIP_END,
		NO_MESSAGE,
		TRIMBLETAIP_DATA,
		TRIMBLETAIP_ROOTDELAY,
		TRIMBLETAIP_BASEDELAY,
		TRIMBLETAIP_ID,
		TRIMBLETAIP_DESCRIPTION,
		TRIMBLETAIP_FORMAT,
		GPS_TYPE,
		TRIMBLETAIP_MAXUNSYNC,
		TRIMBLETAIP_SPEED,
		TRIMBLETAIP_CFLAG,
		TRIMBLETAIP_IFLAG,
		TRIMBLETAIP_OFLAG,
		TRIMBLETAIP_LFLAG,
		TRIMBLETAIP_SAMPLES,
		TRIMBLETAIP_KEEP
	},
	{				/* mode 10 */
		TRIMBLETSIP_FLAGS,
#if TRIM_POLLRATE		/* DHD940515: Allow user config */
		NO_POLL,
#else
		TRIMBLETSIP_POLL,
#endif
		TRIMBLETSIP_INIT,
		TRIMBLETSIP_EVENT,
		TRIMBLETSIP_END,
		TRIMBLETSIP_MESSAGE,
		TRIMBLETSIP_DATA,
		TRIMBLETSIP_ROOTDELAY,
		TRIMBLETSIP_BASEDELAY,
		TRIMBLETSIP_ID,
		TRIMBLETSIP_DESCRIPTION,
		TRIMBLETSIP_FORMAT,
		GPS_TYPE,
		TRIMBLETSIP_MAXUNSYNC,
		TRIMBLETSIP_SPEED,
		TRIMBLETSIP_CFLAG,
		TRIMBLETSIP_IFLAG,
		TRIMBLETSIP_OFLAG,
		TRIMBLETSIP_LFLAG,
		TRIMBLETSIP_SAMPLES,
		TRIMBLETSIP_KEEP
	},
	{                             /* mode 11 */
		NO_CL_FLAGS,
		RCC8000_POLL,
		RCC8000_INIT,
		NO_EVENT,
		RCC8000_END,
		NO_MESSAGE,
		RCC8000_DATA,
		RCC8000_ROOTDELAY,
		RCC8000_BASEDELAY,
		RCC8000_ID,
		RCC8000_DESCRIPTION,
		RCC8000_FORMAT,
		DCF_TYPE,
		RCC8000_MAXUNSYNC,
		RCC8000_SPEED,
		RCC8000_CFLAG,
		RCC8000_IFLAG,
		RCC8000_OFLAG,
		RCC8000_LFLAG,
		RCC8000_SAMPLES,
		RCC8000_KEEP
	},
	{                             /* mode 12 */
		HOPF6021_FLAGS,
		NO_POLL,     
		NO_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		HOPF6021_ROOTDELAY,
		HOPF6021_BASEDELAY,
		DCF_ID,
		HOPF6021_DESCRIPTION,
		HOPF6021_FORMAT,
		DCF_TYPE,
		HOPF6021_MAXUNSYNC,
		HOPF6021_SPEED,
		HOPF6021_CFLAG,
		HOPF6021_IFLAG,
		HOPF6021_OFLAG,
		HOPF6021_LFLAG,
		HOPF6021_SAMPLES,
		HOPF6021_KEEP
	},
	{                            /* mode 13 */
		COMPUTIME_FLAGS,
		NO_POLL,
		NO_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		COMPUTIME_ROOTDELAY,
		COMPUTIME_BASEDELAY,
		COMPUTIME_ID,
		COMPUTIME_DESCRIPTION,
		COMPUTIME_FORMAT,
		COMPUTIME_TYPE,
		COMPUTIME_MAXUNSYNC,
		COMPUTIME_SPEED,
		COMPUTIME_CFLAG,
		COMPUTIME_IFLAG,
		COMPUTIME_OFLAG,
		COMPUTIME_LFLAG,
		COMPUTIME_SAMPLES,
		COMPUTIME_KEEP
	},
	{				/* mode 14 */
		RAWDCF_FLAGS,
		NO_POLL,
		RAWDCFDTRSET_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		RAWDCF_ROOTDELAY,
		RAWDCF_BASEDELAY,
		DCF_A_ID,
		RAWDCFDTRSET_DESCRIPTION,
		RAWDCF_FORMAT,
		DCF_TYPE,
		RAWDCF_MAXUNSYNC,
		RAWDCF_SPEED,
		RAWDCF_CFLAG,
		RAWDCF_IFLAG,
		RAWDCF_OFLAG,
		RAWDCF_LFLAG,
		RAWDCF_SAMPLES,
		RAWDCF_KEEP
	},
	{				/* mode 15 */
		0,				/* operation flags (io modes) */
  		NO_POLL,			/* active poll routine */
		NO_INIT,			/* active poll init routine */
  		NO_EVENT,		        /* special event handling (e.g. reset clock) */
  		NO_END,				/* active poll end routine */
  		NO_MESSAGE,			/* process a lower layer message */
		NO_LCLDATA,			/* local data area for "poll" mechanism */
		0,				/* rootdelay */
		11.0 /* bits */ / 9600,		/* current offset by which the RS232
				           	time code is delayed from the actual time */
		DCF_ID,				/* ID code */
		"WHARTON 400A Series clock",	/* device name */
		"WHARTON 400A Series clock Output Format 1",	/* fixed format */
			/* Must match a format-name in a libparse/clk_xxx.c file */
		DCF_TYPE,			/* clock type (ntp control) */
		(1*60*60),		        /* time to trust oscillator after losing synch */
		B9600,				/* terminal input & output baudrate */
		(CS8|CREAD|PARENB|CLOCAL|HUPCL),/* terminal control flags */
		0,				/* terminal input flags */
		0,				/* terminal output flags */
		0,				/* terminal local flags */
		5,				/* samples for median filter */
		3,				/* samples for median filter to keep */
	},
	{				/* mode 16 - RAWDCF RTS set, DTR clr */
		RAWDCF_FLAGS,
		NO_POLL,
		RAWDCFDTRCLRRTSSET_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		RAWDCF_ROOTDELAY,
		RAWDCF_BASEDELAY,
		DCF_A_ID,
		RAWDCFDTRCLRRTSSET_DESCRIPTION,
		RAWDCF_FORMAT,
		DCF_TYPE,
		RAWDCF_MAXUNSYNC,
		RAWDCF_SPEED,
		RAWDCF_CFLAG,
		RAWDCF_IFLAG,
		RAWDCF_OFLAG,
		RAWDCF_LFLAG,
		RAWDCF_SAMPLES,
		RAWDCF_KEEP
	},
        {                            /* mode 17 */
                VARITEXT_FLAGS,
                NO_POLL,
                NO_INIT,
                NO_EVENT,
                NO_END,
                NO_MESSAGE,
                NO_LCLDATA,
                VARITEXT_ROOTDELAY,
                VARITEXT_BASEDELAY,
                VARITEXT_ID,
                VARITEXT_DESCRIPTION,
                VARITEXT_FORMAT,
                VARITEXT_TYPE,
                VARITEXT_MAXUNSYNC,
                VARITEXT_SPEED,
                VARITEXT_CFLAG,
                VARITEXT_IFLAG,
                VARITEXT_OFLAG,
                VARITEXT_LFLAG,
                VARITEXT_SAMPLES,
                VARITEXT_KEEP
        },
	{				/* mode 18 */
		MBG_FLAGS,
		NO_POLL,
		NO_INIT,
		NO_EVENT,
		GPS16X_END,
		GPS16X_MESSAGE,
		GPS16X_DATA,
		GPS16X_ROOTDELAY,
		GPS16X_BASEDELAY,
		GPS16X_ID,
		GPS16X_DESCRIPTION,
		GPS16X_FORMAT,
		GPS_TYPE,
		GPS16X_MAXUNSYNC,
		GPS16X_SPEED,
		GPS16X_CFLAG,
		GPS16X_IFLAG,
		GPS16X_OFLAG,
		GPS16X_LFLAG,
		GPS16X_SAMPLES,
		GPS16X_KEEP
	},
	{				/* mode 19 */
		RAWDCF_FLAGS,
		NO_POLL,
		RAWDCF_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		RAWDCF_ROOTDELAY,
		GUDE_EMC_USB_V20_BASEDELAY,
		DCF_A_ID,
		GUDE_EMC_USB_V20_DESCRIPTION,
		RAWDCF_FORMAT,
		DCF_TYPE,
		RAWDCF_MAXUNSYNC,
		GUDE_EMC_USB_V20_SPEED,
		RAWDCF_CFLAG,
		RAWDCF_IFLAG,
		RAWDCF_OFLAG,
		RAWDCF_LFLAG,
		RAWDCF_SAMPLES,
		RAWDCF_KEEP
	},
	{				/* mode 20, like mode 14 but driven by 75 baud */
		RAWDCF_FLAGS,
		NO_POLL,
		RAWDCFDTRSET_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		RAWDCF_ROOTDELAY,
		RAWDCF_BASEDELAY,
		DCF_A_ID,
		RAWDCFDTRSET75_DESCRIPTION,
		RAWDCF_FORMAT,
		DCF_TYPE,
		RAWDCF_MAXUNSYNC,
		B75,
		RAWDCF_CFLAG,
		RAWDCF_IFLAG,
		RAWDCF_OFLAG,
		RAWDCF_LFLAG,
		RAWDCF_SAMPLES,
		RAWDCF_KEEP
	},
	{				/* mode 21, like mode 16 but driven by 75 baud
					 - RAWDCF RTS set, DTR clr */
		RAWDCF_FLAGS,
		NO_POLL,
		RAWDCFDTRCLRRTSSET_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		RAWDCF_ROOTDELAY,
		RAWDCF_BASEDELAY,
		DCF_A_ID,
		RAWDCFDTRCLRRTSSET75_DESCRIPTION,
		RAWDCF_FORMAT,
		DCF_TYPE,
		RAWDCF_MAXUNSYNC,
		B75,
		RAWDCF_CFLAG,
		RAWDCF_IFLAG,
		RAWDCF_OFLAG,
		RAWDCF_LFLAG,
		RAWDCF_SAMPLES,
		RAWDCF_KEEP
	},
	{				/* mode 22 - like 2 with POWERUP trust */
		MBG_FLAGS | PARSE_F_POWERUPTRUST,
		NO_POLL,
		NO_INIT,
		NO_EVENT,
		NO_END,
		NO_MESSAGE,
		NO_LCLDATA,
		DCFUA31_ROOTDELAY,
		DCFUA31_BASEDELAY,
		DCF_A_ID,
		DCFUA31_DESCRIPTION,
		DCFUA31_FORMAT,
		DCF_TYPE,
		DCFUA31_MAXUNSYNC,
		DCFUA31_SPEED,
		DCFUA31_CFLAG,
		DCFUA31_IFLAG,
		DCFUA31_OFLAG,
		DCFUA31_LFLAG,
		DCFUA31_SAMPLES,
		DCFUA31_KEEP
	},
	{				/* mode 23 - like 7 with POWERUP trust */
		MBG_FLAGS | PARSE_F_POWERUPTRUST,
		GPS16X_POLL,
		GPS16X_INIT,
		NO_EVENT,
		GPS16X_END,
		GPS16X_MESSAGE,
		GPS16X_DATA,
		GPS16X_ROOTDELAY,
		GPS16X_BASEDELAY,
		GPS16X_ID,
		GPS16X_DESCRIPTION,
		GPS16X_FORMAT,
		GPS_TYPE,
		GPS16X_MAXUNSYNC,
		GPS16X_SPEED,
		GPS16X_CFLAG,
		GPS16X_IFLAG,
		GPS16X_OFLAG,
		GPS16X_LFLAG,
		GPS16X_SAMPLES,
		GPS16X_KEEP
	},
};

static int ncltypes = sizeof(parse_clockinfo) / sizeof(struct parse_clockinfo);

#define CLK_REALTYPE(x) ((int)(((x)->ttl) & 0x7F))
#define CLK_TYPE(x)	((CLK_REALTYPE(x) >= ncltypes) ? ~0 : CLK_REALTYPE(x))
#define CLK_UNIT(x)	((int)REFCLOCKUNIT(&(x)->srcadr))
#define CLK_PPS(x)	(((x)->ttl) & 0x80)

/*
 * Other constant stuff
 */
#define	PARSEHSREFID	0x7f7f08ff	/* 127.127.8.255 refid for hi strata */

#define PARSESTATISTICS   (60*60)	        /* output state statistics every hour */

static int notice = 0;

#define PARSE_STATETIME(parse, i) ((parse->generic->currentstatus == i) ? parse->statetime[i] + current_time - parse->lastchange : parse->statetime[i])

static void parse_event   (struct parseunit *, int);
static void parse_process (struct parseunit *, parsetime_t *);
static void clear_err     (struct parseunit *, u_long);
static int  list_err      (struct parseunit *, u_long);
static char * l_mktime    (u_long);

/**===========================================================================
 ** implementation error message regression module
 **/
static void
clear_err(
	struct parseunit *parse,
	u_long            lstate
	)
{
	if (lstate == ERR_ALL)
	{
		int i;

		for (i = 0; i < ERR_CNT; i++)
		{
			parse->errors[i].err_stage   = err_tbl[i];
			parse->errors[i].err_cnt     = 0;
			parse->errors[i].err_last    = 0;
			parse->errors[i].err_started = 0;
			parse->errors[i].err_suppressed = 0;
		}
	}
	else
	{
		parse->errors[lstate].err_stage   = err_tbl[lstate];
		parse->errors[lstate].err_cnt     = 0;
		parse->errors[lstate].err_last    = 0;
		parse->errors[lstate].err_started = 0;
		parse->errors[lstate].err_suppressed = 0;
	}
}

static int
list_err(
	struct parseunit *parse,
	u_long            lstate
	)
{
	int do_it;
	struct errorinfo *err = &parse->errors[lstate];

	if (err->err_started == 0)
	{
		err->err_started = current_time;
	}

	do_it = (current_time - err->err_last) >= err->err_stage->err_delay;

	if (do_it)
	    err->err_cnt++;
  
	if (err->err_stage->err_count &&
	    (err->err_cnt >= err->err_stage->err_count))
	{
		err->err_stage++;
		err->err_cnt = 0;
	}

	if (!err->err_cnt && do_it)
	    msyslog(LOG_INFO, "PARSE receiver #%d: interval for following error message class is at least %s",
		    CLK_UNIT(parse->peer), l_mktime(err->err_stage->err_delay));

	if (!do_it)
	    err->err_suppressed++;
	else
	    err->err_last = current_time;

	if (do_it && err->err_suppressed)
	{
		msyslog(LOG_INFO, "PARSE receiver #%d: %ld message%s suppressed, error condition class persists for %s",
			CLK_UNIT(parse->peer), err->err_suppressed, (err->err_suppressed == 1) ? " was" : "s where",
			l_mktime(current_time - err->err_started));
		err->err_suppressed = 0;
	}
  
	return do_it;
}

/*--------------------------------------------------
 * mkreadable - make a printable ascii string (without
 * embedded quotes so that the ntpq protocol isn't
 * fooled
 */
#ifndef isprint
#define isprint(_X_) (((_X_) > 0x1F) && ((_X_) < 0x7F))
#endif

static char *
mkreadable(
	char  *buffer,
	long  blen,
	const char  *src,
	u_long  srclen,
	int hex
	)
{
	char *b    = buffer;
	char *endb = NULL;

	if (blen < 4)
		return NULL;		/* don't bother with mini buffers */

	endb = buffer + blen - 4;

	blen--;			/* account for '\0' */

	while (blen && srclen--)
	{
		if (!hex &&             /* no binary only */
		    (*src != '\\') &&   /* no plain \ */
		    (*src != '"') &&    /* no " */
		    isprint((int)*src))	/* only printables */
		{			/* they are easy... */
			*buffer++ = *src++;
			blen--;
		}
		else
		{
			if (blen < 4)
			{
				while (blen--)
				{
					*buffer++ = '.';
				}
				*buffer = '\0';
				return b;
			}
			else
			{
				if (*src == '\\')
				{
					strcpy(buffer,"\\\\");
					buffer += 2;
					blen   -= 2;
					src++;
				}
				else
				{
					snprintf(buffer, blen, "\\x%02x", *src++);
					blen   -= 4;
					buffer += 4;
				}
			}
		}
		if (srclen && !blen && endb) /* overflow - set last chars to ... */
			strcpy(endb, "...");
	}

	*buffer = '\0';
	return b;
}


/*--------------------------------------------------
 * mkascii - make a printable ascii string
 * assumes (unless defined better) 7-bit ASCII
 */
static char *
mkascii(
	char  *buffer,
	long  blen,
	const char  *src,
	u_long  srclen
	)
{
	return mkreadable(buffer, blen, src, srclen, 0);
}

/**===========================================================================
 ** implementation of i/o handling methods
 ** (all STREAM, partial STREAM, user level)
 **/

/*
 * define possible io handling methods
 */
#ifdef STREAM
static int  ppsclock_init   (struct parseunit *);
static int  stream_init     (struct parseunit *);
static void stream_end      (struct parseunit *);
static int  stream_enable   (struct parseunit *);
static int  stream_disable  (struct parseunit *);
static int  stream_setcs    (struct parseunit *, parsectl_t *);
static int  stream_getfmt   (struct parseunit *, parsectl_t *);
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 *);
static int  local_setcs    (struct parseunit *, parsectl_t *);
static int  local_getfmt   (struct parseunit *, parsectl_t *);
static int  local_setfmt   (struct parseunit *, parsectl_t *);
static int  local_timecode (struct parseunit *, parsectl_t *);
static void local_receive  (struct recvbuf *);
static int  local_input    (struct recvbuf *);

static bind_t io_bindings[] =
{
#ifdef STREAM
	{
		"parse STREAM",
		stream_init,
		stream_end,
		stream_setcs,
		stream_disable,
		stream_enable,
		stream_getfmt,
		stream_setfmt,
		stream_timecode,
		stream_receive,
		0,
	},
	{
		"ppsclock STREAM",
		ppsclock_init,
		local_end,
		local_setcs,
		local_nop,
		local_nop,
		local_getfmt,
		local_setfmt,
		local_timecode,
		local_receive,
		local_input,
	},
#endif
	{
		"normal",
		local_init,
		local_end,
		local_setcs,
		local_nop,
		local_nop,
		local_getfmt,
		local_setfmt,
		local_timecode,
		local_receive,
		local_input,
	},
	{
		(char *)0,
	}
};

#ifdef STREAM

#define fix_ts(_X_) \
                        if ((&(_X_))->tv.tv_usec >= 1000000)                \
                          {                                                 \
			    (&(_X_))->tv.tv_usec -= 1000000;                \
			    (&(_X_))->tv.tv_sec  += 1;                      \
			  }

#define cvt_ts(_X_, _Y_) \
                        {                                                   \
			  l_fp ts;				            \
			  fix_ts((_X_));                                    \
			  if (!buftvtots((const char *)&(&(_X_))->tv, &ts)) \
			    {                                               \
                              ERR(ERR_BADDATA)	 		            \
                                msyslog(LOG_ERR,"parse: stream_receive: timestamp conversion error (buftvtots) (%s) (%ld.%06ld) ", (_Y_), (long)(&(_X_))->tv.tv_sec, (long)(&(_X_))->tv.tv_usec);\
			      return;                                       \
			    }                                               \
			  else                                              \
			    {                                               \
			      (&(_X_))->fp = ts;                            \
			    }                                               \
		        }

/*--------------------------------------------------
 * ppsclock STREAM init
 */
static int
ppsclock_init(
	struct parseunit *parse
	)
{
        static char m1[] = "ppsclocd";
	static char m2[] = "ppsclock";
	
	/*
	 * now push the parse streams module
	 * it will ensure exclusive access to the device
	 */
	if (ioctl(parse->ppsfd, I_PUSH, (caddr_t)m1) == -1 &&
	    ioctl(parse->ppsfd, I_PUSH, (caddr_t)m2) == -1)
	{
		if (errno != EINVAL)
		{
			msyslog(LOG_ERR, "PARSE receiver #%d: ppsclock_init: ioctl(fd, I_PUSH, \"ppsclock\"): %m",
				CLK_UNIT(parse->peer));
		}
		return 0;
	}
	if (!local_init(parse))
	{
		(void)ioctl(parse->ppsfd, I_POP, (caddr_t)0);
		return 0;
	}

	parse->flags |= PARSE_PPSCLOCK;
	return 1;
}

/*--------------------------------------------------
 * parse STREAM init
 */
static int
stream_init(
	struct parseunit *parse
	)
{
	static char m1[] = "parse";
	/*
	 * now push the parse streams module
	 * to test whether it is there (neat interface 8-( )
	 */
	if (ioctl(parse->generic->io.fd, I_PUSH, (caddr_t)m1) == -1)
	{
		if (errno != EINVAL) /* accept non-existence */
		{
			msyslog(LOG_ERR, "PARSE receiver #%d: stream_init: ioctl(fd, I_PUSH, \"parse\"): %m", CLK_UNIT(parse->peer));
		}
		return 0;
	}
	else
	{
		while(ioctl(parse->generic->io.fd, I_POP, (caddr_t)0) == 0)
		    /* empty loop */;

		/*
		 * now push it a second time after we have removed all
		 * module garbage
		 */
		if (ioctl(parse->generic->io.fd, I_PUSH, (caddr_t)m1) == -1)
		{
			msyslog(LOG_ERR, "PARSE receiver #%d: stream_init: ioctl(fd, I_PUSH, \"parse\"): %m", CLK_UNIT(parse->peer));
			return 0;
		}
		else
		{
			return 1;
		}
	}
}

/*--------------------------------------------------
 * parse STREAM end
 */
static void
stream_end(
	struct parseunit *parse
	)
{
	while(ioctl(parse->generic->io.fd, I_POP, (caddr_t)0) == 0)
	    /* empty loop */;
}

/*--------------------------------------------------
 * STREAM setcs
 */
static int
stream_setcs(
	struct parseunit *parse,
	parsectl_t  *tcl
	)
{
	struct strioctl strioc;
  
	strioc.ic_cmd     = PARSEIOC_SETCS;
	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)
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: stream_setcs: ioctl(fd, I_STR, PARSEIOC_SETCS): %m", CLK_UNIT(parse->peer));
		return 0;
	}
	return 1;
}

/*--------------------------------------------------
 * STREAM enable
 */
static int
stream_enable(
	struct parseunit *parse
	)
{
	struct strioctl strioc;
  
	strioc.ic_cmd     = PARSEIOC_ENABLE;
	strioc.ic_timout  = 0;
	strioc.ic_dp      = (char *)0;
	strioc.ic_len     = 0;

	if (ioctl(parse->generic->io.fd, I_STR, (caddr_t)&strioc) == -1)
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: stream_enable: ioctl(fd, I_STR, PARSEIOC_ENABLE): %m", CLK_UNIT(parse->peer));
		return 0;
	}
	parse->generic->io.clock_recv = stream_receive; /* ok - parse input in kernel */
	return 1;
}

/*--------------------------------------------------
 * STREAM disable
 */
static int
stream_disable(
	struct parseunit *parse
	)
{
	struct strioctl strioc;
  
	strioc.ic_cmd     = PARSEIOC_DISABLE;
	strioc.ic_timout  = 0;
	strioc.ic_dp      = (char *)0;
	strioc.ic_len     = 0;

	if (ioctl(parse->generic->io.fd, I_STR, (caddr_t)&strioc) == -1)
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: stream_disable: ioctl(fd, I_STR, PARSEIOC_DISABLE): %m", CLK_UNIT(parse->peer));
		return 0;
	}
	parse->generic->io.clock_recv = local_receive; /* ok - parse input in daemon */
	return 1;
}

/*--------------------------------------------------
 * STREAM getfmt
 */
static int
stream_getfmt(
	struct parseunit *parse,
	parsectl_t  *tcl
	)
{
	struct strioctl strioc;
  
	strioc.ic_cmd     = PARSEIOC_GETFMT;
	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)
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: ioctl(fd, I_STR, PARSEIOC_GETFMT): %m", CLK_UNIT(parse->peer));
		return 0;
	}
	return 1;
}

/*--------------------------------------------------
 * STREAM setfmt
 */
static int
stream_setfmt(
	struct parseunit *parse,
	parsectl_t  *tcl
	)
{
	struct strioctl strioc;
  
	strioc.ic_cmd     = PARSEIOC_SETFMT;
	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)
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: stream_setfmt: ioctl(fd, I_STR, PARSEIOC_SETFMT): %m", CLK_UNIT(parse->peer));
		return 0;
	}
	return 1;
}


/*--------------------------------------------------
 * STREAM timecode
 */
static int
stream_timecode(
	struct parseunit *parse,
	parsectl_t  *tcl
	)
{
	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)
			msyslog(LOG_ERR, "PARSE receiver #%d: stream_timecode: ioctl(fd, I_STR, PARSEIOC_TIMECODE): %m", CLK_UNIT(parse->peer));
		return 0;
	}
	clear_err(parse, ERR_INTERNAL);
	return 1;
}

/*--------------------------------------------------
 * STREAM receive
 */
static void
stream_receive(
	struct recvbuf *rbufp
	)
{
	struct parseunit *parse = (struct parseunit *)((void *)rbufp->recv_srcclock);
	parsetime_t parsetime;

	if (!parse->peer)
	    return;

	if (rbufp->recv_length != sizeof(parsetime_t))
	{
		ERR(ERR_BADIO)
			msyslog(LOG_ERR,"PARSE receiver #%d: stream_receive: bad size (got %d expected %d)",
				CLK_UNIT(parse->peer), rbufp->recv_length, (int)sizeof(parsetime_t));
		parse_event(parse, CEVNT_BADREPLY);
		return;
	}
	clear_err(parse, ERR_BADIO);
  
	memmove((caddr_t)&parsetime,
		(caddr_t)rbufp->recv_buffer,
		sizeof(parsetime_t));

#ifdef DEBUG
	if (debug > 3)
	  {
	    printf("PARSE receiver #%d: status %06x, state %08x, time %lx.%08lx, stime %lx.%08lx, ptime %lx.%08lx\n",
		   CLK_UNIT(parse->peer),
		   (unsigned int)parsetime.parse_status,
		   (unsigned int)parsetime.parse_state,
		   (unsigned long)parsetime.parse_time.tv.tv_sec,
		   (unsigned long)parsetime.parse_time.tv.tv_usec,
		   (unsigned long)parsetime.parse_stime.tv.tv_sec,
		   (unsigned long)parsetime.parse_stime.tv.tv_usec,
		   (unsigned long)parsetime.parse_ptime.tv.tv_sec,
		   (unsigned long)parsetime.parse_ptime.tv.tv_usec);
	  }
#endif

	/*
	 * switch time stamp world - be sure to normalize small usec field
	 * errors.
	 */

	cvt_ts(parsetime.parse_stime, "parse_stime");

	if (PARSE_TIMECODE(parsetime.parse_state))
	{
	    cvt_ts(parsetime.parse_time, "parse_time");
	}

	if (PARSE_PPS(parsetime.parse_state))
	    cvt_ts(parsetime.parse_ptime, "parse_ptime");

	parse_process(parse, &parsetime);
}
#endif

/*--------------------------------------------------
 * local init
 */
static int
local_init(
	struct parseunit *parse
	)
{
	return parse_ioinit(&parse->parseio);
}

/*--------------------------------------------------
 * local end
 */
static void
local_end(
	struct parseunit *parse
	)
{
	parse_ioend(&parse->parseio);
}


/*--------------------------------------------------
 * local nop
 */
static int
local_nop(
	struct parseunit *parse
	)
{
	return 1;
}

/*--------------------------------------------------
 * local setcs
 */
static int
local_setcs(
	struct parseunit *parse,
	parsectl_t  *tcl
	)
{
	return parse_setcs(tcl, &parse->parseio);
}

/*--------------------------------------------------
 * local getfmt
 */
static int
local_getfmt(
	struct parseunit *parse,
	parsectl_t  *tcl
	)
{
	return parse_getfmt(tcl, &parse->parseio);
}

/*--------------------------------------------------
 * local setfmt
 */
static int
local_setfmt(
	struct parseunit *parse,
	parsectl_t  *tcl
	)
{
	return parse_setfmt(tcl, &parse->parseio);
}

/*--------------------------------------------------
 * local timecode
 */
static int
local_timecode(
	struct parseunit *parse,
	parsectl_t  *tcl
	)
{
	return parse_timecode(tcl, &parse->parseio);
}


/*--------------------------------------------------
 * local input
 */
static int
local_input(
	struct recvbuf *rbufp
	)
{
	struct parseunit *parse = (struct parseunit *)((void *)rbufp->recv_srcclock);
	int count;
	unsigned char *s;
	timestamp_t ts;

	if (!parse->peer)
		return 0;

	/*
	 * eat all characters, parsing then and feeding complete samples
	 */
	count = rbufp->recv_length;
	s = (unsigned char *)rbufp->recv_buffer;
	ts.fp = rbufp->recv_time;

	while (count--)
	{
		if (parse_ioread(&parse->parseio, (unsigned int)(*s++), &ts))
		{
			struct recvbuf *buf;

			/*
			 * got something good to eat
			 */
			if (!PARSE_PPS(parse->parseio.parse_dtime.parse_state))
			{
#ifdef HAVE_PPSAPI
				if (parse->flags & PARSE_PPSCLOCK)
				{
					struct timespec pps_timeout;
					pps_info_t      pps_info;
				
					pps_timeout.tv_sec  = 0;
					pps_timeout.tv_nsec = 0;

					if (time_pps_fetch(parse->atom.handle, PPS_TSFMT_TSPEC, &pps_info,
							   &pps_timeout) == 0)
					{
						if (pps_info.assert_sequence + pps_info.clear_sequence != parse->ppsserial)
						{
							double dtemp;

						        struct timespec pts;
							/*
							 * add PPS time stamp if available via ppsclock module
							 * and not supplied already.
							 */
							if (parse->flags & PARSE_CLEAR)
							  pts = pps_info.clear_timestamp;
							else
							  pts = pps_info.assert_timestamp;

							parse->parseio.parse_dtime.parse_ptime.fp.l_ui = pts.tv_sec + JAN_1970;

							dtemp = pts.tv_nsec / 1e9;
							if (dtemp < 0.) {
								dtemp += 1;
								parse->parseio.parse_dtime.parse_ptime.fp.l_ui--;
							}
							if (dtemp > 1.) {
								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_state |= PARSEB_PPS|PARSEB_S_PPS;
#ifdef DEBUG
							if (debug > 3)
							{
								printf(
								       "parse: local_receive: fd %d PPSAPI seq %ld - PPS %s\n",
								       rbufp->fd,
								       (long)pps_info.assert_sequence + (long)pps_info.clear_sequence,
								       lfptoa(&parse->parseio.parse_dtime.parse_ptime.fp, 6));
							}
#endif
						}
#ifdef DEBUG
						else
						{
							if (debug > 3)
							{
								printf(
								       "parse: local_receive: fd %d PPSAPI seq assert %ld, seq clear %ld - NO PPS event\n",
								       rbufp->fd,
								       (long)pps_info.assert_sequence, (long)pps_info.clear_sequence);
							}
						}
#endif
						parse->ppsserial = pps_info.assert_sequence + pps_info.clear_sequence;
					}
#ifdef DEBUG
					else
					{
						if (debug > 3)
						{
							printf(
							       "parse: local_receive: fd %d PPSAPI time_pps_fetch errno = %d\n",
							       rbufp->fd,
							       errno);
						}
					}
#endif
				}
#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);
					if (ts.fp.l_ui == 0)
					{
#ifdef DEBUG
						if (debug)
						{
							printf(
							       "parse: local_receive: fd %d DCDTIMESTAMP %s\n",
							       parse->ppsfd,
							       lfptoa(&tstmp, 6));
							printf(" sigio %s\n",
							       lfptoa(&ts.fp, 6));
						}
#endif
						parse->parseio.parse_dtime.parse_ptime.fp = tstmp;
						parse->parseio.parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
					}
				}
#else /* TIOCDCDTIMESTAMP */
#if defined(HAVE_STRUCT_PPSCLOCKEV) && (defined(HAVE_CIOGETEV) || defined(HAVE_TIOCGPPSEV))
				if (parse->flags & PARSE_PPSCLOCK)
				  {
				    l_fp tts;
				    struct ppsclockev ev;

#ifdef HAVE_CIOGETEV
				    if (ioctl(parse->ppsfd, CIOGETEV, (caddr_t)&ev) == 0)
#endif
#ifdef HAVE_TIOCGPPSEV
				    if (ioctl(parse->ppsfd, TIOCGPPSEV, (caddr_t)&ev) == 0)
#endif
					{
					  if (ev.serial != parse->ppsserial)
					    {
					      /*
					       * add PPS time stamp if available via ppsclock module
					       * and not supplied already.
					       */
					      if (!buftvtots((const char *)&ev.tv, &tts))
						{
						  ERR(ERR_BADDATA)
						    msyslog(LOG_ERR,"parse: local_receive: timestamp conversion error (buftvtots) (ppsclockev.tv)");
						}
					      else
						{
						  parse->parseio.parse_dtime.parse_ptime.fp = tts;
						  parse->parseio.parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
						}
					    }
					  parse->ppsserial = ev.serial;
					}
				  }
#endif
#endif /* TIOCDCDTIMESTAMP */
#endif /* !HAVE_PPSAPI */
			}
			if (count)
			{	/* simulate receive */
				buf = get_free_recv_buffer();
				if (buf != NULL) {
					memmove((caddr_t)buf->recv_buffer,
						(caddr_t)&parse->parseio.parse_dtime,
						sizeof(parsetime_t));
					buf->recv_length  = sizeof(parsetime_t);
					buf->recv_time    = rbufp->recv_time;
					buf->srcadr       = rbufp->srcadr;
					buf->dstadr       = rbufp->dstadr;
					buf->receiver     = rbufp->receiver;
					buf->fd           = rbufp->fd;
					buf->X_from_where = rbufp->X_from_where;
					add_full_recv_buffer(buf);
				}
				parse_iodone(&parse->parseio);
			}
			else
			{
				memmove((caddr_t)rbufp->recv_buffer,
					(caddr_t)&parse->parseio.parse_dtime,
					sizeof(parsetime_t));
				parse_iodone(&parse->parseio);
				rbufp->recv_length = sizeof(parsetime_t);
				return 1; /* got something & in place return */
			}
		}
	}
	return 0;		/* nothing to pass up */
}

/*--------------------------------------------------
 * local receive
 */
static void
local_receive(
	struct recvbuf *rbufp
	)
{
	struct parseunit *parse = (struct parseunit *)((void *)rbufp->recv_srcclock);
	parsetime_t parsetime;

	if (!parse->peer)
	    return;

	if (rbufp->recv_length != sizeof(parsetime_t))
	{
		ERR(ERR_BADIO)
			msyslog(LOG_ERR,"PARSE receiver #%d: local_receive: bad size (got %d expected %d)",
				CLK_UNIT(parse->peer), rbufp->recv_length, (int)sizeof(parsetime_t));
		parse_event(parse, CEVNT_BADREPLY);
		return;
	}
	clear_err(parse, ERR_BADIO);
  
	memmove((caddr_t)&parsetime,
		(caddr_t)rbufp->recv_buffer,
		sizeof(parsetime_t));

#ifdef DEBUG
	if (debug > 3)
	  {
	    printf("PARSE receiver #%d: status %06x, state %08x, time(fp) %lx.%08lx, stime(fp) %lx.%08lx, ptime(fp) %lx.%08lx\n",
		   CLK_UNIT(parse->peer),
		   (unsigned int)parsetime.parse_status,
		   (unsigned int)parsetime.parse_state,
		   (unsigned long)parsetime.parse_time.fp.l_ui,
		   (unsigned long)parsetime.parse_time.fp.l_uf,
		   (unsigned long)parsetime.parse_stime.fp.l_ui,
		   (unsigned long)parsetime.parse_stime.fp.l_uf,
		   (unsigned long)parsetime.parse_ptime.fp.l_ui,
		   (unsigned long)parsetime.parse_ptime.fp.l_uf);
	  }
#endif

	parse_process(parse, &parsetime);
}

/*--------------------------------------------------
 * init_iobinding - find and initialize lower layers
 */
static bind_t *
init_iobinding(
	struct parseunit *parse
	)
{
  bind_t *b = io_bindings;

	while (b->bd_description != (char *)0)
	{
		if ((*b->bd_init)(parse))
		{
			return b;
		}
		b++;
	}
	return (bind_t *)0;
}

/**===========================================================================
 ** support routines
 **/

/*--------------------------------------------------
 * convert a flag field to a string
 */
static char *
parsestate(
	u_long lstate,
	char *buffer,
	int size
	)
{
	static struct bits
	{
		u_long      bit;
		const char *name;
	} flagstrings[] =
	  {
		  { PARSEB_ANNOUNCE,   "DST SWITCH WARNING" },
		  { PARSEB_POWERUP,    "NOT SYNCHRONIZED" },
		  { PARSEB_NOSYNC,     "TIME CODE NOT CONFIRMED" },
		  { PARSEB_DST,        "DST" },
		  { PARSEB_UTC,        "UTC DISPLAY" },
		  { PARSEB_LEAPADD,    "LEAP ADD WARNING" },
		  { PARSEB_LEAPDEL,    "LEAP DELETE WARNING" },
		  { PARSEB_LEAPSECOND, "LEAP SECOND" },
		  { PARSEB_ALTERNATE,  "ALTERNATE ANTENNA" },
		  { PARSEB_TIMECODE,   "TIME CODE" },
		  { PARSEB_PPS,        "PPS" },
		  { PARSEB_POSITION,   "POSITION" },
		  { 0 }
	  };

	static struct sbits
	{
		u_long      bit;
		const char *name;
	} sflagstrings[] =
	  {
		  { PARSEB_S_LEAP,     "LEAP INDICATION" },
		  { PARSEB_S_PPS,      "PPS SIGNAL" },
		  { PARSEB_S_ANTENNA,  "ANTENNA" },
		  { PARSEB_S_POSITION, "POSITION" },
		  { 0 }
	  };
	int i;
	char *s, *t;


	*buffer = '\0';
	s = t = buffer;

	i = 0;
	while (flagstrings[i].bit)
	{
		if (flagstrings[i].bit & lstate)
		{
			if (s != t)
				strncpy(t, "; ", BUFFER_SIZES(buffer, t, size));
			strncat(t, flagstrings[i].name, BUFFER_SIZES(buffer, t, size));
			t += strlen(t);
		}
		i++;
	}

	if (lstate & (PARSEB_S_LEAP|PARSEB_S_ANTENNA|PARSEB_S_PPS|PARSEB_S_POSITION))
	{
		if (s != t)
			strncpy(t, "; ", BUFFER_SIZES(buffer, t, size));

		t += strlen(t);

		strncpy(t, "(", BUFFER_SIZES(buffer, t, size));

		s = t = t + strlen(t);

		i = 0;
		while (sflagstrings[i].bit)
		{
			if (sflagstrings[i].bit & lstate)
			{
				if (t != s)
				{
					strncpy(t, "; ", BUFFER_SIZES(buffer, t, size));
					t += 2;
				}
	
				strncpy(t, sflagstrings[i].name, BUFFER_SIZES(buffer, t, size));
				t += strlen(t);
			}
			i++;
		}
		strncpy(t, ")", BUFFER_SIZES(buffer, t, size));
	}
	return buffer;
}

/*--------------------------------------------------
 * convert a status flag field to a string
 */
static char *
parsestatus(
	u_long lstate,
	char *buffer,
	int size
	)
{
	static struct bits
	{
		u_long      bit;
		const char *name;
	} flagstrings[] =
	  {
		  { CVT_OK,      "CONVERSION SUCCESSFUL" },
		  { CVT_NONE,    "NO CONVERSION" },
		  { CVT_FAIL,    "CONVERSION FAILED" },
		  { CVT_BADFMT,  "ILLEGAL FORMAT" },
		  { CVT_BADDATE, "DATE ILLEGAL" },
		  { CVT_BADTIME, "TIME ILLEGAL" },
		  { CVT_ADDITIONAL, "ADDITIONAL DATA" },
		  { 0 }
	  };
	int i;

	*buffer = '\0';

	i = 0;
	while (flagstrings[i].bit)
	{
		if (flagstrings[i].bit & lstate)
		{
			if (buffer[0])
				strncat(buffer, "; ", size);
			strncat(buffer, flagstrings[i].name, size);
		}
		i++;
	}

	return buffer;
}

/*--------------------------------------------------
 * convert a clock status flag field to a string
 */
static const char *
clockstatus(
	u_long lstate
	)
{
	static char buffer[20];
	static struct status
	{
		u_long      value;
		const char *name;
	} flagstrings[] =
	  {
		  { CEVNT_NOMINAL, "NOMINAL" },
		  { CEVNT_TIMEOUT, "NO RESPONSE" },
		  { CEVNT_BADREPLY,"BAD FORMAT" },
		  { CEVNT_FAULT,   "FAULT" },
		  { CEVNT_PROP,    "PROPAGATION DELAY" },
		  { CEVNT_BADDATE, "ILLEGAL DATE" },
		  { CEVNT_BADTIME, "ILLEGAL TIME" },
		  { (unsigned)~0L }
	  };
	int i;

	i = 0;
	while (flagstrings[i].value != ~0)
	{
		if (flagstrings[i].value == lstate)
		{
			return flagstrings[i].name;
		}
		i++;
	}

	snprintf(buffer, sizeof(buffer), "unknown #%ld", (u_long)lstate);

	return buffer;
}


/*--------------------------------------------------
 * l_mktime - make representation of a relative time
 */
static char *
l_mktime(
	u_long delta
	)
{
	u_long tmp, m, s;
	static char buffer[40];
	char *t;

	buffer[0] = '\0';

	if ((tmp = delta / (60*60*24)) != 0)
	{
		snprintf(buffer, BUFFER_SIZE(buffer, buffer), "%ldd+", (u_long)tmp);
		delta -= tmp * 60*60*24;
	}

	s = delta % 60;
	delta /= 60;
	m = delta % 60;
	delta /= 60;

	t = buffer + strlen(buffer);

	snprintf(t, BUFFER_SIZE(buffer, t), "%02d:%02d:%02d",
		 (int)delta, (int)m, (int)s);

	return buffer;
}


/*--------------------------------------------------
 * parse_statistics - list summary of clock states
 */
static void
parse_statistics(
	struct parseunit *parse
	)
{
	int i;

	NLOG(NLOG_CLOCKSTATIST) /* conditional if clause for conditional syslog */
		{
			msyslog(LOG_INFO, "PARSE receiver #%d: running time: %s",
				CLK_UNIT(parse->peer),
				l_mktime(current_time - parse->generic->timestarted));

			msyslog(LOG_INFO, "PARSE receiver #%d: current status: %s",
				CLK_UNIT(parse->peer),
				clockstatus(parse->generic->currentstatus));

			for (i = 0; i <= CEVNT_MAX; i++)
			{
				u_long s_time;
				u_long percent, d = current_time - parse->generic->timestarted;

				percent = s_time = PARSE_STATETIME(parse, i);

				while (((u_long)(~0) / 10000) < percent)
				{
					percent /= 10;
					d       /= 10;
				}

				if (d)
				    percent = (percent * 10000) / d;
				else
				    percent = 10000;

				if (s_time)
				    msyslog(LOG_INFO, "PARSE receiver #%d: state %18s: %13s (%3ld.%02ld%%)",
					    CLK_UNIT(parse->peer),
					    clockstatus((unsigned int)i),
					    l_mktime(s_time),
					    percent / 100, percent % 100);
			}
		}
}

/*--------------------------------------------------
 * cparse_statistics - wrapper for statistics call
 */
static void
cparse_statistics(
        struct parseunit *parse
	)
{
	if (parse->laststatistic + PARSESTATISTICS < current_time)
		parse_statistics(parse);
	parse->laststatistic = current_time;
}

/**===========================================================================
 ** ntp interface routines
 **/

/*--------------------------------------------------
 * parse_shutdown - shut down a PARSE clock
 */
static void
parse_shutdown(
	int unit,
	struct peer *peer
	)
{
	struct parseunit *parse = (struct parseunit *)0;

	if (peer && peer->procptr)
		parse = (struct parseunit *)peer->procptr->unitptr;

	if (!parse)
	{
		/* nothing to clean up */
		return;
	}

        if (!parse->peer)
	{
		msyslog(LOG_INFO, "PARSE receiver #%d: INTERNAL ERROR - unit already inactive - shutdown ignored", unit);
		return;
	}

#ifdef HAVE_PPSAPI
	if (parse->flags & PARSE_PPSCLOCK)
	{
		(void)time_pps_destroy(parse->atom.handle);
	}
#endif
	if (parse->generic->io.fd != parse->ppsfd && parse->ppsfd != -1)
		(void)close(parse->ppsfd);  /* close separate PPS source */

	/*
	 * print statistics a last time and
	 * stop statistics machine
	 */
	parse_statistics(parse);

	if (parse->parse_type->cl_end)
	{
		parse->parse_type->cl_end(parse);
	}
	
	/*
	 * cleanup before leaving this world
	 */
	if (parse->binding)
	    PARSE_END(parse);

	/*
	 * Tell the I/O module to turn us off.  We're history.
	 */
	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);

	parse->peer = (struct peer *)0; /* unused now */
	peer->procptr->unitptr = (caddr_t)0;
	free(parse);
}

#ifdef HAVE_PPSAPI
/*----------------------------------------
 * set up HARDPPS via PPSAPI
 */
static void
parse_hardpps(
	      struct parseunit *parse,
	      int mode
	      )
{
        if (parse->hardppsstate == mode)
	        return;

	if (CLK_PPS(parse->peer) && (parse->flags & PARSE_PPSKERNEL)) {
		int	i = 0;

		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",
				CLK_UNIT(parse->peer));
		} else {
		        NLOG(NLOG_CLOCKINFO)
		                msyslog(LOG_INFO, "PARSE receiver #%d: kernel PPS synchronisation %sabled",
					CLK_UNIT(parse->peer), (mode == PARSE_HARDPPS_ENABLE) ? "en" : "dis");
			/*
			 * tell the rest, that we have a kernel PPS source, iff we ever enable HARDPPS
			 */
			if (mode == PARSE_HARDPPS_ENABLE)
			        pps_enable = 1;
		}
	}

	parse->hardppsstate = mode;
}

/*----------------------------------------
 * set up PPS via PPSAPI
 */
static int
parse_ppsapi(
	     struct parseunit *parse
	)
{
	int cap, mode_ppsoffset;
	char *cp;
	
	parse->flags &= ~PARSE_PPSCLOCK;

	/*
	 * collect PPSAPI offset capability - should move into generic handling
	 */
	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;
	}

	/*
	 * initialize generic PPSAPI interface
	 *
	 * we leave out CLK_FLAG3 as time_pps_kcbind()
	 * is handled here for now. Ideally this should also
	 * be part of the generic PPSAPI interface
	 */
	if (!refclock_params(parse->flags & (CLK_FLAG1|CLK_FLAG2|CLK_FLAG4), &parse->atom))
		return 0;

	/* nb. only turn things on, if someone else has turned something
	 *	on before we get here, leave it alone!
	 */

	if (parse->flags & PARSE_CLEAR) {
		cp = "CLEAR";
		mode_ppsoffset = PPS_OFFSETCLEAR;
	} else {
		cp = "ASSERT";
		mode_ppsoffset = PPS_OFFSETASSERT;
	}

	msyslog(LOG_INFO, "PARSE receiver #%d: initializing PPS to %s",
		CLK_UNIT(parse->peer), cp);

	if (!(mode_ppsoffset & cap)) {
	  msyslog(LOG_WARNING, "PARSE receiver #%d: Cannot set PPS_%sCLEAR, this will increase jitter (PPS API capabilities=0x%x)",
		  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_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.mode |= mode_ppsoffset;

	if (time_pps_setparams(parse->atom.handle, &parse->atom.pps_params) < 0) {
	  msyslog(LOG_ERR, "PARSE receiver #%d: FAILED set PPS parameters: %m",
		  CLK_UNIT(parse->peer));
		return 0;
	}

	parse->flags |= PARSE_PPSCLOCK;
	return 1;
}
#else
#define parse_hardpps(_PARSE_, _MODE_) /* empty */
#endif

/*--------------------------------------------------
 * parse_start - open the PARSE devices and initialize data for processing
 */
static int
parse_start(
	int sysunit,
	struct peer *peer
	)
{
	u_int unit;
	int fd232;
#ifdef HAVE_TERMIOS
	struct termios tio;		/* NEEDED FOR A LONG TIME ! */
#endif
#ifdef HAVE_SYSV_TTYS
	struct termio tio;		/* NEEDED FOR A LONG TIME ! */
#endif
	struct parseunit * parse;
	char parsedev[sizeof(PARSEDEVICE)+20];
	char parseppsdev[sizeof(PARSEPPSDEVICE)+20];
	parsectl_t tmp_ctl;
	u_int type;

	/*
	 * get out Copyright information once
	 */
	if (!notice)
        {
		NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
			msyslog(LOG_INFO, "NTP PARSE support: Copyright (c) 1989-2009, Frank Kardel");
		notice = 1;
	}

	type = CLK_TYPE(peer);
	unit = CLK_UNIT(peer);

	if ((type == ~0) || (parse_clockinfo[type].cl_description == (char *)0))
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: unsupported clock type %d (max %d)",
			unit, CLK_REALTYPE(peer), ncltypes-1);
		return 0;
	}

	/*
	 * Unit okay, attempt to open the device.
	 */
	(void) snprintf(parsedev, sizeof(parsedev), PARSEDEVICE, unit);
	(void) snprintf(parseppsdev, sizeof(parsedev), PARSEPPSDEVICE, unit);

#ifndef O_NOCTTY
#define O_NOCTTY 0
#endif

	fd232 = open(parsedev, O_RDWR | O_NOCTTY
#ifdef O_NONBLOCK
		     | O_NONBLOCK
#endif
		     , 0777);

	if (fd232 == -1)
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: open of %s failed: %m", unit, parsedev);
		return 0;
	}

	parse = (struct parseunit *)emalloc(sizeof(struct parseunit));

	memset((char *)parse, 0, sizeof(struct parseunit));

	parse->generic = peer->procptr;	 /* link up */
	parse->generic->unitptr = (caddr_t)parse; /* link down */

	/*
	 * Set up the structures
	 */
	parse->generic->timestarted    = current_time;
	parse->lastchange     = current_time;

	parse->flags          = 0;
	parse->pollneeddata   = 0;
	parse->laststatistic  = current_time;
	parse->lastformat     = (unsigned short)~0;	/* assume no format known */
	parse->timedata.parse_status = (unsigned short)~0;	/* be sure to mark initial status change */
	parse->lastmissed     = 0;	/* assume got everything */
	parse->ppsserial      = 0;
	parse->ppsfd	      = -1;
	parse->localdata      = (void *)0;
	parse->localstate     = 0;
	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;

	parse->generic->fudgetime2 = 0.0;
	parse->ppsphaseadjust = parse->generic->fudgetime2;

	parse->generic->clockdesc  = parse->parse_type->cl_description;

	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 */

	/*
	 * configure terminal line
	 */
	if (TTY_GETATTR(fd232, &tio) == -1)
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: tcgetattr(%d, &tio): %m", unit, fd232);
		parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
		return 0;
	}
	else
	{
#ifndef _PC_VDISABLE
		memset((char *)tio.c_cc, 0, sizeof(tio.c_cc));
#else
		int disablec;
		errno = 0;		/* pathconf can deliver -1 without changing errno ! */

		disablec = fpathconf(parse->generic->io.fd, _PC_VDISABLE);
		if (disablec == -1 && errno)
		{
			msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: fpathconf(fd, _PC_VDISABLE): %m", CLK_UNIT(parse->peer));
			memset((char *)tio.c_cc, 0, sizeof(tio.c_cc)); /* best guess */
		}
		else
		    if (disablec != -1)
			memset((char *)tio.c_cc, disablec, sizeof(tio.c_cc));
#endif

#if defined (VMIN) || defined(VTIME)
		if ((parse_clockinfo[type].cl_lflag & ICANON) == 0)
		{
#ifdef VMIN
			tio.c_cc[VMIN]   = 1;
#endif
#ifdef VTIME
			tio.c_cc[VTIME]  = 0;
#endif
		}
#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;
	

#ifdef HAVE_TERMIOS
		if ((cfsetospeed(&tio, parse_clockinfo[type].cl_speed) == -1) ||
		    (cfsetispeed(&tio, 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 */
			return 0;
		}
#else
		tio.c_cflag     |= parse_clockinfo[type].cl_speed;
#endif

		/*
		 * set up pps device
		 * if the PARSEPPSDEVICE can be opened that will be used
		 * for PPS else PARSEDEVICE will be used
		 */
		parse->ppsfd = open(parseppsdev, O_RDWR | O_NOCTTY
#ifdef O_NONBLOCK
				    | O_NONBLOCK
#endif
				    , 0777);

		if (parse->ppsfd == -1)
		{
			parse->ppsfd = fd232;
		}

/*
 * Linux PPS - the old way
 */
#if defined(HAVE_TIO_SERIAL_STUFF)		/* Linux hack: define PPS interface */
		{
			struct serial_struct	ss;
			if (ioctl(parse->ppsfd, TIOCGSERIAL, &ss) < 0 ||
			    (
#ifdef ASYNC_LOW_LATENCY
			     ss.flags |= ASYNC_LOW_LATENCY,
#endif
#ifndef HAVE_PPSAPI
#ifdef ASYNC_PPS_CD_NEG
			     ss.flags |= ASYNC_PPS_CD_NEG,
#endif
#endif
			     ioctl(parse->ppsfd, TIOCSSERIAL, &ss)) < 0) {
				msyslog(LOG_NOTICE, "refclock_parse: TIOCSSERIAL fd %d, %m", parse->ppsfd);
				msyslog(LOG_NOTICE,
					"refclock_parse: optional PPS processing not available");
			} else {
				parse->flags    |= PARSE_PPSCLOCK;
#ifdef ASYNC_PPS_CD_NEG
				NLOG(NLOG_CLOCKINFO)
				  msyslog(LOG_INFO,
					  "refclock_parse: PPS detection on");
#endif
			}
		}
#endif

/*
 * SUN the Solaris way
 */
#ifdef HAVE_TIOCSPPS			/* SUN PPS support */
		if (CLK_PPS(parse->peer))
		    {
			int i = 1;
		    
			if (ioctl(parse->ppsfd, TIOCSPPS, (caddr_t)&i) == 0)
			    {
				parse->flags |= PARSE_PPSCLOCK;
			    }
		    }
#endif

/*
 * PPS via PPSAPI
 */
#if defined(HAVE_PPSAPI)
		parse->hardppsstate = PARSE_HARDPPS_DISABLE;
		if (CLK_PPS(parse->peer))
		{
		  if (!refclock_ppsapi(parse->ppsfd, &parse->atom))
		    {
		      msyslog(LOG_NOTICE, "PARSE receiver #%d: parse_start: could not set up PPS: %m", CLK_UNIT(parse->peer));
		    }
		  else
		    {
		      parse_ppsapi(parse);
		    }
		}
#endif

		if (TTY_SETATTR(fd232, &tio) == -1)
		{
			msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: tcsetattr(%d, &tio): %m", unit, fd232);
			parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
			return 0;
		}
	}

	/*
	 * pick correct input machine
	 */
	parse->generic->io.srcclock = (caddr_t)parse;
	parse->generic->io.datalen = 0;
	
	parse->binding = init_iobinding(parse);

	if (parse->binding == (bind_t *)0)
		{
			msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: io sub system initialisation failed.", CLK_UNIT(parse->peer));
			parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
			return 0;			/* well, ok - special initialisation broke */
		}      

	parse->generic->io.clock_recv = parse->binding->bd_receive; /* pick correct receive routine */
	parse->generic->io.io_input   = parse->binding->bd_io_input; /* pick correct input routine */

	/*
	 * as we always(?) get 8 bit chars we want to be
	 * sure, that the upper bits are zero for less
	 * than 8 bit I/O - so we pass that information on.
	 * note that there can be only one bit count format
	 * per file descriptor
	 */

	switch (tio.c_cflag & CSIZE)
	{
	    case CS5:
		tmp_ctl.parsesetcs.parse_cs = PARSE_IO_CS5;
		break;

	    case CS6:
		tmp_ctl.parsesetcs.parse_cs = PARSE_IO_CS6;
		break;

	    case CS7:
		tmp_ctl.parsesetcs.parse_cs = PARSE_IO_CS7;
		break;

	    case CS8:
		tmp_ctl.parsesetcs.parse_cs = PARSE_IO_CS8;
		break;
	}

	if (!PARSE_SETCS(parse, &tmp_ctl))
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: parse_setcs() FAILED.", unit);
		parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
		return 0;			/* well, ok - special initialisation broke */
	}
  
	strncpy(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);

	if (!PARSE_SETFMT(parse, &tmp_ctl))
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: parse_setfmt() FAILED.", unit);
		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
	 */
#ifdef HAVE_TERMIOS
	(void) tcflush(parse->generic->io.fd, TCIOFLUSH);
#else
#if defined(TCFLSH) && defined(TCIOFLUSH)
	{
		int flshcmd = TCIOFLUSH;

		(void) ioctl(parse->generic->io.fd, TCFLSH, (caddr_t)&flshcmd);
	}
#endif
#endif

	/*
	 * try to do any special initializations
	 */
	if (parse->parse_type->cl_init)
		{
			if (parse->parse_type->cl_init(parse))
				{
					parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
					return 0;		/* well, ok - special initialisation broke */
				}
		}
	
	/*
	 * Insert in async io device list.
	 */
	if (!io_addclock(&parse->generic->io))
        {
		msyslog(LOG_ERR,
			"PARSE receiver #%d: parse_start: addclock %s fails (ABORT - clock type requires async io)", CLK_UNIT(parse->peer), parsedev);
		parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
		return 0;
	}

	/*
	 * print out configuration
	 */
	NLOG(NLOG_CLOCKINFO)
		{
			/* conditional if clause for conditional syslog */
			msyslog(LOG_INFO, "PARSE receiver #%d: reference clock \"%s\" (I/O device %s, PPS device %s) added",
				CLK_UNIT(parse->peer),
				parse->parse_type->cl_description, parsedev,
				(parse->ppsfd != parse->generic->io.fd) ? parseppsdev : parsedev);

			msyslog(LOG_INFO, "PARSE receiver #%d: Stratum %d, trust time %s, precision %d",
				CLK_UNIT(parse->peer),
				parse->peer->stratum,
				l_mktime(parse->maxunsync), parse->peer->precision);

			msyslog(LOG_INFO, "PARSE receiver #%d: rootdelay %.6f s, phase adjustment %.6f s, PPS phase adjustment %.6f s, %s IO handling",
				CLK_UNIT(parse->peer),
				parse->parse_type->cl_rootdelay,
				parse->generic->fudgetime1,
				parse->ppsphaseadjust,
                                parse->binding->bd_description);

			msyslog(LOG_INFO, "PARSE receiver #%d: Format recognition: %s", CLK_UNIT(parse->peer),
				parse->parse_type->cl_format);
                        msyslog(LOG_INFO, "PARSE receiver #%d: %sPPS support%s", CLK_UNIT(parse->peer),
				CLK_PPS(parse->peer) ? "" : "NO ",
				CLK_PPS(parse->peer) ?
#ifdef PPS_METHOD
				" (implementation " PPS_METHOD ")"
#else
				""
#endif
				: ""
				);
		}

	return 1;
}

/*--------------------------------------------------
 * parse_ctl - process changes on flags/time values
 */
static void
parse_ctl(
	    struct parseunit *parse,
	    struct refclockstat *in
	    )
{
        if (in)
	{
		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));
#if defined(HAVE_PPSAPI)
		  if (CLK_PPS(parse->peer))
		    {
		      parse_ppsapi(parse);
		    }
#endif
		}
		
		if (in->haveflags & CLK_HAVETIME1)
                {
		  parse->generic->fudgetime1 = in->fudgetime1;
		  msyslog(LOG_INFO, "PARSE receiver #%d: new phase adjustment %.6f s",
			  CLK_UNIT(parse->peer),
			  parse->generic->fudgetime1);
		}
		
		if (in->haveflags & CLK_HAVETIME2)
                {
		  parse->generic->fudgetime2 = in->fudgetime2;
		  if (parse->flags & PARSE_TRUSTTIME) 
		    {
		      parse->maxunsync = (u_long)ABS(in->fudgetime2);
		      msyslog(LOG_INFO, "PARSE receiver #%d: new trust time %s",
			      CLK_UNIT(parse->peer),
			      l_mktime(parse->maxunsync));
		    }
		  else
		    {
		      parse->ppsphaseadjust = in->fudgetime2;
		      msyslog(LOG_INFO, "PARSE receiver #%d: new PPS phase adjustment %.6f s",
			  CLK_UNIT(parse->peer),
			      parse->ppsphaseadjust);
#if defined(HAVE_PPSAPI)
		      if (CLK_PPS(parse->peer))
		      {
			      parse_ppsapi(parse);
		      }
#endif
		    }
		}
	}
}

/*--------------------------------------------------
 * parse_poll - called by the transmit procedure
 */
static void
parse_poll(
	int unit,
	struct peer *peer
	)
{
	struct parseunit *parse = (struct parseunit *)peer->procptr->unitptr;

	if (peer != parse->peer)
	{
		msyslog(LOG_ERR,
			"PARSE receiver #%d: poll: INTERNAL: peer incorrect",
			unit);
		return;
	}

	/*
	 * Update clock stat counters
	 */
	parse->generic->polls++;

	if (parse->pollneeddata && 
	    ((current_time - parse->pollneeddata) > (1<<(max(min(parse->peer->hpoll, parse->peer->ppoll), parse->peer->minpoll)))))
	{
		/*
		 * start worrying when exceeding a poll inteval
		 * bad news - didn't get a response last time
		 */
		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));
	}

	/*
	 * we just mark that we want the next sample for the clock filter
	 */
	parse->pollneeddata = current_time;

	if (parse->parse_type->cl_poll)
	{
		parse->parse_type->cl_poll(parse);
	}

	cparse_statistics(parse);

	return;
}

#define LEN_STATES 300		/* length of state string */

/*--------------------------------------------------
 * parse_control - set fudge factors, return statistics
 */
static void
parse_control(
	int unit,
	struct refclockstat *in,
	struct refclockstat *out,
	struct peer *peer
	)
{
        struct parseunit *parse = (struct parseunit *)peer->procptr->unitptr;
	parsectl_t tmpctl;

	static char outstatus[400];	/* status output buffer */

	if (out)
	{
		out->lencode       = 0;
		out->p_lastcode    = 0;
		out->kv_list       = (struct ctl_var *)0;
	}

	if (!parse || !parse->peer)
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: parse_control: unit invalid (UNIT INACTIVE)",
			unit);
		return;
	}

	unit = CLK_UNIT(parse->peer);

	/*
	 * handle changes
	 */
	parse_ctl(parse, in);
		
	/*
	 * supply data
	 */
	if (out)
	{
		u_long sum = 0;
		char *tt, *start;
		int i;

		outstatus[0] = '\0';

		out->type       = REFCLK_PARSE;

		/*
		 * keep fudgetime2 in sync with TRUSTTIME/MAXUNSYNC flag1
		 */
		parse->generic->fudgetime2 = (parse->flags & PARSE_TRUSTTIME) ? (double)parse->maxunsync : parse->ppsphaseadjust;

		/*
		 * figure out skew between PPS and RS232 - just for informational
		 * purposes
		 */
		if (PARSE_SYNC(parse->timedata.parse_state))
		{
			if (PARSE_PPS(parse->timedata.parse_state) && PARSE_TIMECODE(parse->timedata.parse_state))
			{
				l_fp off;

				/*
				 * we have a PPS and RS232 signal - calculate the skew
				 * WARNING: assumes on TIMECODE == PULSE (timecode after pulse)
				 */
				off = parse->timedata.parse_stime.fp;
				L_SUB(&off, &parse->timedata.parse_ptime.fp); /* true offset */
				tt = add_var(&out->kv_list, 80, RO);
				snprintf(tt, 80, "refclock_ppsskew=%s", lfptoms(&off, 6));
			}
		}

		if (PARSE_PPS(parse->timedata.parse_state))
		{
			tt = add_var(&out->kv_list, 80, RO|DEF);
			snprintf(tt, 80, "refclock_ppstime=\"%s\"", gmprettydate(&parse->timedata.parse_ptime.fp));
		}

		start = tt = add_var(&out->kv_list, 128, RO|DEF);
		snprintf(tt, 128, "refclock_time=\"");
		tt += strlen(tt);

		if (parse->timedata.parse_time.fp.l_ui == 0)
		{
			strncpy(tt, "\"", BUFFER_SIZES(start, tt, 128));
		}
		else
		{
			snprintf(tt, 128, "%s\"", gmprettydate(&parse->timedata.parse_time.fp));
		}

		if (!PARSE_GETTIMECODE(parse, &tmpctl))
		{
			ERR(ERR_INTERNAL)
				msyslog(LOG_ERR, "PARSE receiver #%d: parse_control: parse_timecode() FAILED", unit);
		}
		else
		{
			start = tt = add_var(&out->kv_list, 512, RO|DEF);
			snprintf(tt, 512, "refclock_status=\"");
			tt += strlen(tt);

			/*
			 * copy PPS flags from last read transaction (informational only)
			 */
			tmpctl.parsegettc.parse_state |= parse->timedata.parse_state &
				(PARSEB_PPS|PARSEB_S_PPS);

			(void) parsestate(tmpctl.parsegettc.parse_state, tt, BUFFER_SIZES(start, tt, 512));

			strncat(tt, "\"", BUFFER_SIZES(start, tt, 512));

			if (tmpctl.parsegettc.parse_count)
			    mkascii(outstatus+strlen(outstatus), (int)(sizeof(outstatus)- strlen(outstatus) - 1),
				    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)
				msyslog(LOG_ERR, "PARSE receiver #%d: parse_control: parse_getfmt() FAILED", unit);
		}
		else
		{
			tt = add_var(&out->kv_list, 80, RO|DEF);
			snprintf(tt, 80, "refclock_format=\"");

			strncat(tt, tmpctl.parseformat.parse_buffer, tmpctl.parseformat.parse_count);
			strncat(tt,"\"", 80);
		}

		/*
		 * gather state statistics
		 */

		start = tt = add_var(&out->kv_list, LEN_STATES, RO|DEF);
		strncpy(tt, "refclock_states=\"", LEN_STATES);
		tt += strlen(tt);

		for (i = 0; i <= CEVNT_MAX; i++)
		{
			u_long s_time;
			u_long d = current_time - parse->generic->timestarted;
			u_long percent;

			percent = s_time = PARSE_STATETIME(parse, i);

			while (((u_long)(~0) / 10000) < percent)
			{
				percent /= 10;
				d       /= 10;
			}
	
			if (d)
			    percent = (percent * 10000) / d;
			else
			    percent = 10000;

			if (s_time)
			{
				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)))
					{
						strncpy(tt, item, BUFFER_SIZES(start, tt, LEN_STATES));
						tt  += count;
					}
				sum += s_time;
			}
		}
		
		snprintf(tt, BUFFER_SIZES(start, tt, LEN_STATES), "; 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))
			{
				set_var(&out->kv_list, k->text, strlen(k->text)+1, k->flags);
				k++;
			}
		}
      
		out->lencode       = strlen(outstatus);
		out->p_lastcode    = outstatus;
	}
}

/**===========================================================================
 ** processing routines
 **/

/*--------------------------------------------------
 * event handling - note that nominal events will also be posted
 * keep track of state dwelling times
 */
static void
parse_event(
	struct parseunit *parse,
	int event
	)
{
	if (parse->generic->currentstatus != (u_char) event)
	{
		parse->statetime[parse->generic->currentstatus] += current_time - parse->lastchange;
		parse->lastchange              = current_time;

		if (parse->parse_type->cl_event)
		    parse->parse_type->cl_event(parse, event);
      
		if (event == CEVNT_NOMINAL)
		{
			NLOG(NLOG_CLOCKSTATUS)
				msyslog(LOG_INFO, "PARSE receiver #%d: SYNCHRONIZED",
					CLK_UNIT(parse->peer));
		}

		refclock_report(parse->peer, event);
	}
}

/*--------------------------------------------------
 * process a PARSE time sample
 */
static void
parse_process(
	struct parseunit *parse,
	parsetime_t      *parsetime
	)
{
	l_fp off, rectime, reftime;
	double fudge;
	
	/*
	 * check for changes in conversion status
	 * (only one for each new status !)
	 */
	if (((parsetime->parse_status & CVT_MASK) != CVT_OK) &&
	    ((parsetime->parse_status & CVT_MASK) != CVT_NONE) &&
	    (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)
		{
			/*
			 * tell more about the story - list time code
			 * there is a slight change for a race condition and
			 * the time code might be overwritten by the next packet
			 */
			parsectl_t tmpctl;
			
			if (!PARSE_GETTIMECODE(parse, &tmpctl))
			{
				ERR(ERR_INTERNAL)
					msyslog(LOG_ERR, "PARSE receiver #%d: parse_process: parse_timecode() FAILED", CLK_UNIT(parse->peer));
			}
			else
			{
				ERR(ERR_BADDATA)
					msyslog(LOG_WARNING, "PARSE receiver #%d: FAILED TIMECODE: \"%s\" (check receiver configuration / wiring)",
						CLK_UNIT(parse->peer), mkascii(buffer, sizeof buffer, tmpctl.parsegettc.parse_buffer, (unsigned)(tmpctl.parsegettc.parse_count - 1)));
			}
		}
	}

	/*
	 * examine status and post appropriate events
	 */
	if ((parsetime->parse_status & CVT_MASK) != CVT_OK)
	{
		/*
		 * got bad data - tell the rest of the system
		 */
		switch (parsetime->parse_status & CVT_MASK)
		{
		case CVT_NONE:
			if ((parsetime->parse_status & CVT_ADDITIONAL) &&
			    parse->parse_type->cl_message)
				parse->parse_type->cl_message(parse, parsetime);
			/*
			 * save PPS information that comes piggyback
			 */
			if (PARSE_PPS(parsetime->parse_state))
			  {
			    parse->timedata.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
			    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)
			{
				parse_event(parse, CEVNT_BADREPLY);
			}
			else
				if (parsetime->parse_status & CVT_BADDATE)
				{
					parse_event(parse, CEVNT_BADDATE);
				}
				else
					if (parsetime->parse_status & CVT_BADTIME)
					{
						parse_event(parse, CEVNT_BADTIME);
					}
					else
					{
						parse_event(parse, CEVNT_BADREPLY); /* for the lack of something better */
					}
		}
		return;			/* skip the rest - useless */
	}

	/*
	 * check for format changes
	 * (in case somebody has swapped clocks 8-)
	 */
	if (parse->lastformat != parsetime->parse_format)
	{
		parsectl_t tmpctl;
	
		tmpctl.parseformat.parse_format = parsetime->parse_format;

		if (!PARSE_GETFMT(parse, &tmpctl))
		{
			ERR(ERR_INTERNAL)
				msyslog(LOG_ERR, "PARSE receiver #%d: parse_getfmt() FAILED", CLK_UNIT(parse->peer));
		}
		else
		{
			NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
				msyslog(LOG_INFO, "PARSE receiver #%d: packet format \"%s\"",
					CLK_UNIT(parse->peer), tmpctl.parseformat.parse_buffer);
		}
		parse->lastformat = parsetime->parse_format;
	}

	/*
	 * now, any changes ?
	 */
	if ((parse->timedata.parse_state ^ parsetime->parse_state) &
	    ~(unsigned)(PARSEB_PPS|PARSEB_S_PPS))
	{
		char tmp1[200];
		char tmp2[200];
		/*
		 * 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);
	}

	/*
	 * carry on PPS information if still usable
	 */
	if (PARSE_PPS(parse->timedata.parse_state) && !PARSE_PPS(parsetime->parse_state))
        {
	        parsetime->parse_state |= PARSEB_PPS|PARSEB_S_PPS;
		parsetime->parse_ptime  = parse->timedata.parse_ptime;
	}

	/*
	 * remember for future
	 */
	parse->timedata = *parsetime;

	/*
	 * check to see, whether the clock did a complete powerup or lost PZF signal
	 * and post correct events for current condition
	 */
	if (PARSE_POWERUP(parsetime->parse_state))
	{
		/*
		 * this is bad, as we have completely lost synchronisation
		 * well this is a problem with the receiver here
		 * for PARSE Meinberg DCF77 receivers the lost synchronisation
		 * is true as it is the powerup state and the time is taken
		 * from a crude real time clock chip
		 * for the PZF/GPS series this is only partly true, as
		 * PARSE_POWERUP only means that the pseudo random
		 * phase shift sequence cannot be found. this is only
		 * bad, if we have never seen the clock in the SYNC
		 * state, where the PHASE and EPOCH are correct.
		 * for reporting events the above business does not
		 * really matter, but we can use the time code
		 * even in the POWERUP state after having seen
		 * the clock in the synchronized state (PZF class
		 * receivers) unless we have had a telegram disruption
		 * after having seen the clock in the SYNC state. we
		 * thus require having seen the clock in SYNC state
		 * *after* having missed telegrams (noresponse) from
		 * the clock. one problem remains: we might use erroneously
		 * POWERUP data if the disruption is shorter than 1 polling
		 * interval. fortunately powerdowns last usually longer than 64
		 * seconds and the receiver is at least 2 minutes in the
		 * POWERUP or NOSYNC state before switching to SYNC
		 * for GPS receivers this can mean antenna problems and other causes.
		 * the additional grace period can be enables by a clock
		 * mode having the PARSE_F_POWERUPTRUST flag in cl_flag set.
		 */
		parse_event(parse, CEVNT_FAULT);
		NLOG(NLOG_CLOCKSTATUS)
			ERR(ERR_BADSTATUS)
			msyslog(LOG_ERR,"PARSE receiver #%d: NOT SYNCHRONIZED/RECEIVER PROBLEMS",
				CLK_UNIT(parse->peer));
	}
	else
	{
		/*
		 * we have two states left
		 *
		 * SYNC:
		 *  this state means that the EPOCH (timecode) and PHASE
		 *  information has be read correctly (at least two
		 *  successive PARSE timecodes were received correctly)
		 *  this is the best possible state - full trust
		 *
		 * NOSYNC:
		 *  The clock should be on phase with respect to the second
		 *  signal, but the timecode has not been received correctly within
		 *  at least the last two minutes. this is a sort of half baked state
		 *  for PARSE Meinberg DCF77 clocks this is bad news (clock running
		 *  without timecode confirmation)
		 *  PZF 535 has also no time confirmation, but the phase should be
		 *  very precise as the PZF signal can be decoded
		 */

		if (PARSE_SYNC(parsetime->parse_state))
		{
			/*
			 * currently completely synchronized - best possible state
			 */
			parse->lastsync = current_time;
			clear_err(parse, ERR_BADSTATUS);
		}
		else
		{
			/*
			 * we have had some problems receiving the time code
			 */
			parse_event(parse, CEVNT_PROP);
			NLOG(NLOG_CLOCKSTATUS)
				ERR(ERR_BADSTATUS)
				msyslog(LOG_ERR,"PARSE receiver #%d: TIMECODE NOT CONFIRMED",
					CLK_UNIT(parse->peer));
		}
	}

	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
		if (debug > 3)
			printf("PARSE receiver #%d: Reftime %s, Recvtime %s - initial offset %s\n",
			       CLK_UNIT(parse->peer),
			       prettydate(&reftime),
			       prettydate(&rectime),
			       lfptoa(&off,6));
#endif
	}

	if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer))
	{
		l_fp offset;
		double ppsphaseadjust = parse->ppsphaseadjust;

#ifdef HAVE_PPSAPI
		/*
		 * set fudge = 0.0 if already included in PPS time stamps
		 */
		if (parse->atom.pps_params.mode & (PPS_OFFSETCLEAR|PPS_OFFSETASSERT))
		        {
			        ppsphaseadjust = 0.0;
			}
#endif

		/*
		 * we have a PPS signal - much better than the RS232 stuff (we hope)
		 */
		offset = parsetime->parse_ptime.fp;

#ifdef DEBUG
		if (debug > 3)
			printf("PARSE receiver #%d: PPStime %s\n",
				CLK_UNIT(parse->peer),
				prettydate(&offset));
#endif
		if (PARSE_TIMECODE(parsetime->parse_state))
		{
			if (M_ISGEQ(off.l_i, off.l_f, -1, 0x80000000) &&
			    M_ISGEQ(0, 0x7fffffff, off.l_i, off.l_f))
			{
				fudge = ppsphaseadjust; /* pick PPS fudge factor */
			
				/*
				 * RS232 offsets within [-0.5..0.5[ - take PPS offsets
				 */

				if (parse->parse_type->cl_flags & PARSE_F_PPSONSECOND)
				{
					reftime = off = offset;
					if (reftime.l_uf & (unsigned)0x80000000)
						reftime.l_ui++;
					reftime.l_uf = 0;

					
					/*
					 * implied on second offset
					 */
					off.l_uf = ~off.l_uf; /* map [0.5..1[ -> [-0.5..0[ */
					off.l_ui = (off.l_f < 0) ? ~0 : 0; /* sign extend */
				}
				else
				{
					/*
					 * time code describes pulse
					 */
					reftime = off = parsetime->parse_time.fp;

					L_SUB(&off, &offset); /* true offset */
				}
			}
			/*
			 * take RS232 offset when PPS when out of bounds
			 */
		}
		else
		{
			fudge = ppsphaseadjust; /* pick PPS fudge factor */
			/*
			 * Well, no time code to guide us - assume on second pulse
			 * and pray, that we are within [-0.5..0.5[
			 */
			off = offset;
			reftime = offset;
			if (reftime.l_uf & (unsigned)0x80000000)
				reftime.l_ui++;
			reftime.l_uf = 0;
			/*
			 * implied on second offset
			 */
			off.l_uf = ~off.l_uf; /* map [0.5..1[ -> [-0.5..0[ */
			off.l_ui = (off.l_f < 0) ? ~0 : 0; /* sign extend */
		}
	}
	else
	{
		if (!PARSE_TIMECODE(parsetime->parse_state))
		{
			/*
			 * Well, no PPS, no TIMECODE, no more work ...
			 */
			if ((parsetime->parse_status & CVT_ADDITIONAL) &&
			    parse->parse_type->cl_message)
				parse->parse_type->cl_message(parse, parsetime);
			return;
		}
	}

#ifdef DEBUG
	if (debug > 3)
		printf("PARSE receiver #%d: Reftime %s, Recvtime %s - final offset %s\n",
			CLK_UNIT(parse->peer),
			prettydate(&reftime),
			prettydate(&rectime),
			lfptoa(&off,6));
#endif


	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",
			CLK_UNIT(parse->peer),
			prettydate(&reftime),
			prettydate(&rectime));
#endif

	if ((parsetime->parse_status & CVT_ADDITIONAL) &&
	    parse->parse_type->cl_message)
		parse->parse_type->cl_message(parse, parsetime);

	if (PARSE_SYNC(parsetime->parse_state))
	{
		/*
		 * log OK status
		 */
		parse_event(parse, CEVNT_NOMINAL);
	}

	clear_err(parse, ERR_BADIO);
	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 
	 * see the clock states section above for more reasoning
	 */
	if (((current_time - parse->lastsync) > parse->maxunsync)           ||
	    (parse->lastsync < parse->lastmissed)                           ||
	    ((parse->lastsync == 0) && !PARSE_SYNC(parsetime->parse_state)) ||
	    (((parse->parse_type->cl_flags & PARSE_F_POWERUPTRUST) == 0) &&
	     PARSE_POWERUP(parsetime->parse_state)))
	{
		parse->generic->leap = LEAP_NOTINSYNC;
		parse->lastsync = 0;	/* wait for full sync again */
	}
	else
	{
		if (PARSE_LEAPADD(parsetime->parse_state))
		{
			/*
			 * we pick this state also for time code that pass leap warnings
			 * without direction information (as earth is currently slowing
			 * down).
			 */
			parse->generic->leap = (parse->flags & PARSE_LEAP_DELETE) ? LEAP_DELSECOND : LEAP_ADDSECOND;
		}
		else
		    if (PARSE_LEAPDEL(parsetime->parse_state))
		    {
			    parse->generic->leap = LEAP_DELSECOND;
		    }
		    else
		    {
			    parse->generic->leap = LEAP_NOWARNING;
		    }
	}

	if (parse->generic->leap != LEAP_NOTINSYNC)
	{
	        /*
		 * 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",
				       CLK_UNIT(parse->peer),
				       prettydate(&reftime),
				       prettydate(&rectime),
				       fudge);
			}
#endif
		parse->generic->lastref = reftime;
		
		refclock_process_offset(parse->generic, reftime, rectime, fudge);

#ifdef HAVE_PPSAPI
		/*
		 * pass PPS information on to PPS clock
		 */
		if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer))
		        {
			  /* refclock_pps includes fudgetime1 - we keep the RS232 offset in there :-( */
			        double savedtime1 = parse->generic->fudgetime1;

				parse->generic->fudgetime1 = fudge;
				
				if (refclock_pps(parse->peer, &parse->atom,
						 parse->flags & (CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4))) {
					parse->peer->flags |= FLAG_PPS;
				} else {
					parse->peer->flags &= ~FLAG_PPS;
				}

				parse->generic->fudgetime1 = savedtime1;

				parse_hardpps(parse, PARSE_HARDPPS_ENABLE);
			}
#endif
	} else {
	        parse_hardpps(parse, PARSE_HARDPPS_DISABLE);
		parse->peer->flags &= ~FLAG_PPS;
	}

	/*
	 * ready, unless the machine wants a sample or 
	 * we are in fast startup mode (peer->dist > MAXDISTANCE)
	 */
	if (!parse->pollneeddata && parse->peer->disp <= MAXDISTANCE)
	    return;

	parse->pollneeddata = 0;

	parse->timedata.parse_state &= ~(unsigned)(PARSEB_PPS|PARSEB_S_PPS);

	refclock_receive(parse->peer);
}

/**===========================================================================
 ** special code for special clocks
 **/

static void
mk_utcinfo(
	   char *t,
	   int wnt,
	   int wnlsf,
	   int dn,
	   int dtls,
	   int dtlsf,
	   int size
	   )
{
  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));
    }
}

#ifdef CLOCK_MEINBERG
/**===========================================================================
 ** Meinberg GPS166/GPS167 support
 **/

/*------------------------------------------------------------
 * gps16x_message - process GPS16x messages
 */
static void
gps16x_message(
	       struct parseunit *parse,
	       parsetime_t      *parsetime
	       )
{
	if (parse->timedata.parse_msglen && parsetime->parse_msg[0] == SOH)
	{
		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),
				parsetime->parse_msglen,
				msgbuffer);
		}
#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))))
		{
			/*
			 * clean message
			 */
			switch (header.gps_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,
						gps_sw_rev.code & 0xFF,
						gps_sw_rev.name[0] ? " " : "",
						gps_sw_rev.name);
					set_var(&parse->kv, buffer, strlen(buffer)+1, RO|DEF);
				}
			break;

			case GPS_STAT:
				{
					static struct state
					{
						unsigned short flag; /* status flag */
						unsigned 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 *)"" }
					  };
					unsigned short status;
					struct state *s = states;
					char buffer[512];
					char *p, *b;
					
					status = get_lsb_short(&bufp);
					snprintf(buffer, sizeof(buffer), "meinberg_gps_status=\"[0x%04x] ", status);
					
					if (status)
					{
						p = b = buffer + strlen(buffer);
						while (s->flag)
						{
							if (status & s->flag)
							{
								if (p != b)
								{
									*p++ = ',';
									*p++ = ' ';
								}
								
								strncat(p, (const char *)s->string, sizeof(buffer));
							}
							s++;
						}
		
						*p++ = '"';
						*p   = '\0';
					}
					else
					{
						strncat(buffer, "\"", sizeof(buffer));
					}
		
					set_var(&parse->kv, buffer, strlen(buffer)+1, RO|DEF);
				}
			break;

			case GPS_POS_XYZ:
				{
					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[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;
					
					get_mbg_antinfo(&bufp, &antinfo);
					snprintf(buffer, sizeof(buffer), "meinberg_antenna_status=\"");
					p = buffer + strlen(buffer);
					
					switch (antinfo.status)
					{
					case ANT_INVALID:
						strncat(p, "", BUFFER_SIZE(buffer, p));
						p += strlen(p);
						break;
						
					case ANT_DISCONN:
						strncat(p, "DISCONNECTED since ", BUFFER_SIZE(buffer, p));
						NLOG(NLOG_CLOCKSTATUS)
							ERR(ERR_BADSTATUS)
							msyslog(LOG_ERR,"PARSE receiver #%d: ANTENNA FAILURE: %s",
								CLK_UNIT(parse->peer), p);
						
						p += strlen(p);
						mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p));
						*p = '\0';
						break;
		    
					case ANT_RECONN:
						strncat(p, "RECONNECTED on ", BUFFER_SIZE(buffer, p));
						p += strlen(p);
						mbg_tm_str(&p, &antinfo.tm_reconn, BUFFER_SIZE(buffer, p));
						snprintf(p, BUFFER_SIZE(buffer, p), ", reconnect clockoffset %c%ld.%07ld s, disconnect time ",
							(antinfo.delta_t < 0) ? '-' : '+',
							ABS(antinfo.delta_t) / 10000,
							ABS(antinfo.delta_t) % 10000);
						p += strlen(p);
						mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p));
						*p = '\0';
						break;
		    
					default:
						snprintf(p, BUFFER_SIZE(buffer, p), "bad status 0x%04x", antinfo.status);
						p += strlen(p);
						break;
					}
					
					strncat(p, "\"", BUFFER_SIZE(buffer, p));
					
					set_var(&parse->kv, buffer, strlen(buffer)+1, 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)
					{
						int i;
						
						p = buffer;
						strncpy(buffer, "gps_tot_51=\"", BUFFER_SIZE(buffer, p));
						p += strlen(p);
						mbg_tgps_str(&p, &cfgh.tot_51, BUFFER_SIZE(buffer, p));
						strncpy(p, "\"", BUFFER_SIZE(buffer, p));
						set_var(&parse->kv, buffer, strlen(buffer)+1, RO);
						
						p = buffer;
						strncpy(buffer, "gps_tot_63=\"", BUFFER_SIZE(buffer, p));
						p += strlen(p);
						mbg_tgps_str(&p, &cfgh.tot_63, BUFFER_SIZE(buffer, p));
						strncpy(p, "\"", BUFFER_SIZE(buffer, p));
						set_var(&parse->kv, buffer, strlen(buffer)+1, RO);
						
						p = buffer;
						strncpy(buffer, "gps_t0a=\"", BUFFER_SIZE(buffer, p));
						p += strlen(p);
						mbg_tgps_str(&p, &cfgh.t0a, BUFFER_SIZE(buffer, p));
						strncpy(p, "\"", BUFFER_SIZE(buffer, p));
						set_var(&parse->kv, buffer, strlen(buffer)+1, RO);
						
						for (i = MIN_SVNO; i < MAX_SVNO; i++)
						{
							p = buffer;
							snprintf(p, BUFFER_SIZE(buffer, p), "gps_cfg[%d]=\"[0x%x] ", i, cfgh.cfg[i]);
							p += strlen(p);
							switch (cfgh.cfg[i] & 0x7)
							{
							case 0:
								strncpy(p, "BLOCK I", BUFFER_SIZE(buffer, p));
								break;
							case 1:
								strncpy(p, "BLOCK II", BUFFER_SIZE(buffer, p));
								break;
							default:
								strncpy(p, "bad CFG", BUFFER_SIZE(buffer, p));
								break;
							}
							strncat(p, "\"", BUFFER_SIZE(buffer, p));
							set_var(&parse->kv, buffer, strlen(buffer)+1, RO);
							
							p = buffer;
							snprintf(p, BUFFER_SIZE(buffer, p), "gps_health[%d]=\"[0x%x] ", i, cfgh.health[i]);
							p += strlen(p);
							switch ((cfgh.health[i] >> 5) & 0x7 )
							{
							case 0:
								strncpy(p, "OK;", BUFFER_SIZE(buffer, p));
								break;
							case 1:
								strncpy(p, "PARITY;", BUFFER_SIZE(buffer, p));
								break;
							case 2:
								strncpy(p, "TLM/HOW;", BUFFER_SIZE(buffer, p));
								break;
							case 3:
								strncpy(p, "Z-COUNT;", BUFFER_SIZE(buffer, p));
								break;
							case 4:
								strncpy(p, "SUBFRAME 1,2,3;", BUFFER_SIZE(buffer, p));
								break;
							case 5:
								strncpy(p, "SUBFRAME 4,5;", BUFFER_SIZE(buffer, p));
								break;
							case 6:
								strncpy(p, "UPLOAD BAD;", BUFFER_SIZE(buffer, p));
								break;
							case 7:
								strncpy(p, "DATA BAD;", BUFFER_SIZE(buffer, p));
								break;
							}
							
							p += strlen(p);
							
							switch (cfgh.health[i] & 0x1F)
							{
							case 0:
								strncpy(p, "SIGNAL OK", BUFFER_SIZE(buffer, p));
								break;
							case 0x1C:
								strncpy(p, "SV TEMP OUT", BUFFER_SIZE(buffer, p));
								break;
							case 0x1D:
								strncpy(p, "SV WILL BE TEMP OUT", BUFFER_SIZE(buffer, p));
								break;
							case 0x1E:
								break;
							case 0x1F:
								strncpy(p, "MULTIPLE ERRS", BUFFER_SIZE(buffer, p));
								break;
							default:
								strncpy(p, "TRANSMISSION PROBLEMS", BUFFER_SIZE(buffer, p));
								break;
							}
							
							strncat(p, "\"", sizeof(buffer));
							set_var(&parse->kv, buffer, strlen(buffer)+1, RO);
						}
					}
				}
			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)
					{
						strncpy(p, "gps_utc_correction=\"", sizeof(buffer));
						p += strlen(p);
						mk_utcinfo(p, utc.t0t.wn, utc.WNlsf, utc.DNt, utc.delta_tls, utc.delta_tlsf, BUFFER_SIZE(buffer, p));
						strncat(p, "\"", BUFFER_SIZE(buffer, p));
					}
					else
					{
						strncpy(p, "gps_utc_correction=\"\"", BUFFER_SIZE(buffer, p));
					}
					set_var(&parse->kv, buffer, strlen(buffer)+1, 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
						strncpy(buffer, "gps_message=", sizeof(buffer));
					
					set_var(&parse->kv, buffer, strlen(buffer)+1, 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)",
				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)));
		}
	}
  
	return;
}

/*------------------------------------------------------------
 * gps16x_poll - query the reciver peridically
 */
static void
gps16x_poll(
	    struct peer *peer
	    )
{
	struct parseunit *parse = (struct parseunit *)peer->procptr->unitptr;
	
	static GPS_MSG_HDR sequence[] = 
	{
		{ GPS_SW_REV,          0, 0, 0 },
		{ GPS_STAT,            0, 0, 0 },
		{ GPS_UTC,             0, 0, 0 },
		{ GPS_ASCII_MSG,       0, 0, 0 },
		{ GPS_ANT_INFO,        0, 0, 0 },
		{ GPS_CFGH,            0, 0, 0 },
		{ GPS_POS_XYZ,         0, 0, 0 },
		{ GPS_POS_LLA,         0, 0, 0 },
		{ (unsigned short)~0,  0, 0, 0 }
	};
      
	int rtc;
	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->nextaction = current_time + ((poll_info_t *)parse->parse_type->cl_data)->rate;
	}

	if (sequence[parse->localstate].gps_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);
	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); 
	}
#endif
  
	rtc = write(parse->generic->io.fd, cmd_buffer, (unsigned long)(outp - cmd_buffer));
	
	if (rtc < 0)
	{
		ERR(ERR_BADIO)
			msyslog(LOG_ERR, "PARSE receiver #%d: gps16x_poll: failed to send cmd to clock: %m", CLK_UNIT(parse->peer));
	}
	else
	if (rtc != outp - cmd_buffer)
	{
		ERR(ERR_BADIO)
			msyslog(LOG_ERR, "PARSE receiver #%d: gps16x_poll: failed to send cmd incomplete (%d of %d bytes sent)", CLK_UNIT(parse->peer), rtc, (int)(outp - cmd_buffer));
	}

	clear_err(parse, ERR_BADIO);
	return;
}

/*--------------------------------------------------
 * init routine - setup timer
 */
static int
gps16x_poll_init(
	struct parseunit *parse
	)
{
	if (((poll_info_t *)parse->parse_type->cl_data)->rate)
	{
		parse->peer->action = gps16x_poll;
		gps16x_poll(parse->peer);
	}

	return 0;
}

#else
static void
gps16x_message(
	       struct parseunit *parse,
	       parsetime_t      *parsetime
	       )
{}
static int
gps16x_poll_init(
	struct parseunit *parse
	)
{
	return 1;
}
#endif /* CLOCK_MEINBERG */

/**===========================================================================
 ** clock polling support
 **/

/*--------------------------------------------------
 * direct poll routine
 */
static void
poll_dpoll(
	struct parseunit *parse
	)
{
	int rtc;
	const char *ps = ((poll_info_t *)parse->parse_type->cl_data)->string;
	int   ct = ((poll_info_t *)parse->parse_type->cl_data)->count;

	rtc = write(parse->generic->io.fd, ps, (unsigned long)ct);
	if (rtc < 0)
	{
		ERR(ERR_BADIO)
			msyslog(LOG_ERR, "PARSE receiver #%d: poll_dpoll: failed to send cmd to clock: %m", CLK_UNIT(parse->peer));
	}
	else
	    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);
	    }
	clear_err(parse, ERR_BADIO);
}

/*--------------------------------------------------
 * periodic poll routine
 */
static void
poll_poll(
	struct peer *peer
	)
{
	struct parseunit *parse = (struct parseunit *)peer->procptr->unitptr;
	
	if (parse->parse_type->cl_poll)
		parse->parse_type->cl_poll(parse);

	if (((poll_info_t *)parse->parse_type->cl_data)->rate)
	{
		parse->peer->nextaction = current_time + ((poll_info_t *)parse->parse_type->cl_data)->rate;
	}
}

/*--------------------------------------------------
 * init routine - setup timer
 */
static int
poll_init(
	struct parseunit *parse
	)
{
	if (((poll_info_t *)parse->parse_type->cl_data)->rate)
	{
		parse->peer->action = poll_poll;
		poll_poll(parse->peer);
	}

	return 0;
}

/**===========================================================================
 ** Trimble support
 **/

/*-------------------------------------------------------------
 * trimble TAIP init routine - setup EOL and then do poll_init.
 */
static int
trimbletaip_init(
	struct parseunit *parse
	)
{
#ifdef HAVE_TERMIOS
	struct termios tio;
#endif
#ifdef HAVE_SYSV_TTYS
	struct termio tio;
#endif
	/*
	 * configure terminal line for trimble receiver
	 */
	if (TTY_GETATTR(parse->generic->io.fd, &tio) == -1)
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_init: tcgetattr(fd, &tio): %m", CLK_UNIT(parse->peer));
		return 0;
	}
	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));
			return 0;
		}
	}
	return poll_init(parse);
}

/*--------------------------------------------------
 * trimble TAIP event routine - reset receiver upon data format trouble
 */
static const char *taipinit[] = {
	">FPV00000000<",
	">SRM;ID_FLAG=F;CS_FLAG=T;EC_FLAG=F;FR_FLAG=T;CR_FLAG=F<",
	">FTM00020001<",
	(char *)0
};
      
static void
trimbletaip_event(
	struct parseunit *parse,
	int event
	)
{
	switch (event)
	{
	    case CEVNT_BADREPLY:	/* reset on garbled input */
	    case CEVNT_TIMEOUT:		/* reset on no input */
		    {
			    const char **iv;

			    iv = taipinit;
			    while (*iv)
			    {
				    int rtc = 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));
					    return;
				    }
				    else
				    {
					    if (rtc != strlen(*iv))
					    {
						    msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_event: failed to send cmd incomplete (%d of %d bytes sent)",
							    CLK_UNIT(parse->peer), rtc, (int)strlen(*iv));
						    return;
					    }
				    }
				    iv++;
			    }

			    NLOG(NLOG_CLOCKINFO)
				    ERR(ERR_BADIO)
				    msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_event: RECEIVER INITIALIZED",
					    CLK_UNIT(parse->peer));
		    }
		    break;

	    default:			/* ignore */
		break;
	}
}

/*
 * This driver supports the Trimble SVee Six Plus GPS receiver module.
 * It should support other Trimble receivers which use the Trimble Standard
 * Interface Protocol (see below).
 *
 * The module has a serial I/O port for command/data and a 1 pulse-per-second
 * output, about 1 microsecond wide. The leading edge of the pulse is
 * coincident with the change of the GPS second. This is the same as
 * the change of the UTC second +/- ~1 microsecond. Some other clocks
 * specifically use a feature in the data message as a timing reference, but
 * the SVee Six Plus does not do this. In fact there is considerable jitter
 * on the timing of the messages, so this driver only supports the use
 * of the PPS pulse for accurate timing. Where it is determined that
 * the offset is way off, when first starting up ntpd for example,
 * the timing of the data stream is used until the offset becomes low enough
 * (|offset| < CLOCK_MAX), at which point the pps offset is used.
 *
 * It can use either option for receiving PPS information - the 'ppsclock'
 * stream pushed onto the serial data interface to timestamp the Carrier
 * Detect interrupts, where the 1PPS connects to the CD line. This only
 * works on SunOS 4.1.x currently. To select this, define PPSPPS in
 * Config.local. The other option is to use a pulse-stretcher/level-converter
 * to convert the PPS pulse into a RS232 start pulse & feed this into another
 * tty port. To use this option, define PPSCLK in Config.local. The pps input,
 * by whichever method, is handled in ntp_loopfilter.c
 *
 * The receiver uses a serial message protocol called Trimble Standard
 * Interface Protocol (it can support others but this driver only supports
 * TSIP). Messages in this protocol have the following form:
 *
 *  ...  ... 
 *
 * Any bytes within the  portion of value 10 hex () are doubled
 * on transmission and compressed back to one on reception. Otherwise
 * the values of data bytes can be anything. The serial interface is RS-422
 * asynchronous using 9600 baud, 8 data bits with odd party (**note** 9 bits
 * in total!), and 1 stop bit. The protocol supports byte, integer, single,
 * and double datatypes. Integers are two bytes, sent most significant first.
 * Singles are IEEE754 single precision floating point numbers (4 byte) sent
 * sign & exponent first. Doubles are IEEE754 double precision floating point
 * numbers (8 byte) sent sign & exponent first.
 * The receiver supports a large set of messages, only a small subset of
 * which are used here. From driver to receiver the following are used:
 *
 *  ID    Description
 *
 *  21    Request current time
 *  22    Mode Select
 *  2C    Set/Request operating parameters
 *  2F    Request UTC info
 *  35    Set/Request I/O options

 * From receiver to driver the following are recognised:
 *
 *  ID    Description
 *
 *  41    GPS Time
 *  44    Satellite selection, PDOP, mode
 *  46    Receiver health
 *  4B    Machine code/status
 *  4C    Report operating parameters (debug only)
 *  4F    UTC correction data (used to get leap second warnings)
 *  55    I/O options (debug only)
 *
 * All others are accepted but ignored.
 *
 */

#define PI		3.1415926535898	/* lots of sig figs */
#define D2R		PI/180.0

/*-------------------------------------------------------------------
 * sendcmd, sendbyte, sendetx, sendflt, sendint implement the command
 * interface to the receiver.
 *
 * CAVEAT: the sendflt, sendint routines are byte order dependend and
 * float implementation dependend - these must be converted to portable
 * versions !
 *
 * CURRENT LIMITATION: float implementation. This runs only on systems
 * with IEEE754 floats as native floats
 */

typedef struct trimble
{
	u_long last_msg;	/* last message received */
	u_long last_reset;	/* last time a reset was issued */
	u_char qtracking;	/* query tracking status */
	u_long ctrack;		/* current tracking set */
	u_long ltrack;		/* last tracking set */
} trimble_t;

union uval {
	u_char  bd[8];
	int     iv;
	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
	)
{
	buf->txt[0] = DLE;
	buf->txt[1] = (u_char)c;
	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
sendbyte(
	struct txbuf *buf,
	int b
	)
{
	if (b == DLE)
	    buf->txt[buf->idx++] = DLE;
	buf->txt[buf->idx++] = (u_char)b;
}

void
sendetx(
	struct txbuf *buf,
	struct parseunit *parse
	)
{
	buf->txt[buf->idx++] = DLE;
	buf->txt[buf->idx++] = ETX;

	if (write(parse->generic->io.fd, buf->txt, (unsigned long)buf->idx) != buf->idx)
	{
		ERR(ERR_BADIO)
			msyslog(LOG_ERR, "PARSE receiver #%d: sendetx: failed to send cmd to clock: %m", CLK_UNIT(parse->peer));
	}
	else
	{
#ifdef DEBUG
	  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); 
	  }
#endif
		clear_err(parse, ERR_BADIO);
	}
}

void  
sendint(
	struct txbuf *buf,
	int a
	)
{
	/* send 16bit int, msbyte first */
	sendbyte(buf, (u_char)((a>>8) & 0xff));
	sendbyte(buf, (u_char)(a & 0xff));
}

void
sendflt(
	struct txbuf *buf,
	double a
	)
{
	int i;
	union uval uval;

	uval.fv = a;
#ifdef WORDS_BIGENDIAN
	for (i=0; i<=3; i++)
#else
	    for (i=3; i>=0; i--)
#endif
		sendbyte(buf, uval.bd[i]);
}

#define TRIM_POS_OPT	0x13	/* output position with high precision */
#define TRIM_TIME_OPT	0x03	/* use UTC time stamps, on second */

/*--------------------------------------------------
 * trimble TSIP setup routine
 */
static int
trimbletsip_setup(
		  struct parseunit *parse,
		  const char *reason
		  )
{
	u_char buffer[256];
	struct txbuf buf;
	trimble_t *t = parse->localdata;

	if (t && t->last_reset &&
	    ((t->last_reset + TRIMBLE_RESET_HOLDOFF) > current_time)) {
		return 1;	/* not yet */
	}

	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 */
	sendflt(&buf, 4.0);	/* s/n ratio mask = 6 XXX */
	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);

	NLOG(NLOG_CLOCKINFO)
		ERR(ERR_BADIO)
		msyslog(LOG_ERR, "PARSE receiver #%d: trimbletsip_setup: RECEIVER RE-INITIALIZED (%s)", CLK_UNIT(parse->peer), reason);

	return 0;
}

/*--------------------------------------------------
 * TRIMBLE TSIP check routine
 */
static void
trimble_check(
	      struct peer *peer
	      )
{
	struct parseunit *parse = (struct parseunit *)peer->procptr->unitptr;
	trimble_t *t = parse->localdata;
	u_char buffer[256];
	struct txbuf buf;
	buf.txt = buffer;
	
	if (t)
	{
		if (current_time > t->last_msg + TRIMBLETSIP_IDLE_TIME)
			(void)trimbletsip_setup(parse, "message timeout");
	}

	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))
					{
						sendcmd(&buf, CMD_CSTATTRACK);
						sendbyte(&buf, i+1);	/* old sat */
						sendetx(&buf, parse);
					}
				oldsats &= ~(1 << i);
			}
		}
						
		sendcmd(&buf, CMD_CSTATTRACK);
		sendbyte(&buf, 0x00);	/* current tracking set */
		sendetx(&buf, parse);
	}
}

/*--------------------------------------------------
 * TRIMBLE TSIP end routine
 */
static void
trimbletsip_end(
	      struct parseunit *parse
	      )
{	trimble_t *t = parse->localdata;
	
	if (t)
	{
		free(t);
		parse->localdata = (void *)0;
	}
	parse->peer->nextaction = 0;
	parse->peer->action = (void (*) (struct peer *))0;
}

/*--------------------------------------------------
 * TRIMBLE TSIP init routine
 */
static int
trimbletsip_init(
	struct parseunit *parse
	)
{
#if defined(VEOL) || defined(VEOL2)
#ifdef HAVE_TERMIOS
	struct termios tio;		/* NEEDED FOR A LONG TIME ! */
#endif
#ifdef HAVE_SYSV_TTYS
	struct termio tio;		/* NEEDED FOR A LONG TIME ! */
#endif
	/*
	 * allocate local data area
	 */
	if (!parse->localdata)
	{
		trimble_t *t;
		
		t = (trimble_t *)(parse->localdata = emalloc(sizeof(trimble_t)));
		
		if (t)
		{
			memset((char *)t, 0, sizeof(trimble_t));
			t->last_msg = current_time;
		}
	}

	parse->peer->action     = trimble_check;
	parse->peer->nextaction = current_time;

	/*
	 * configure terminal line for ICANON mode with VEOL characters
	 */
	if (TTY_GETATTR(parse->generic->io.fd, &tio) == -1)
	{
		msyslog(LOG_ERR, "PARSE receiver #%d: trimbletsip_init: tcgetattr(%d, &tio): %m", CLK_UNIT(parse->peer), parse->generic->io.fd);
		return 0;
	}
	else
	{
		if ((parse_clockinfo[CLK_TYPE(parse->peer)].cl_lflag & ICANON))
		{
#ifdef VEOL
			tio.c_cc[VEOL]  = ETX;
#endif
#ifdef VEOL2
			tio.c_cc[VEOL2]  = DLE;
#endif
		}

		if (TTY_SETATTR(parse->generic->io.fd, &tio) == -1)
		{
			msyslog(LOG_ERR, "PARSE receiver #%d: trimbletsip_init: tcsetattr(%d, &tio): %m", CLK_UNIT(parse->peer), parse->generic->io.fd);
			return 0;
		}
	}
#endif
	return trimbletsip_setup(parse, "initial startup");
}

/*------------------------------------------------------------
 * trimbletsip_event - handle Trimble events
 * simple evente handler - attempt to re-initialize receiver
 */
static void
trimbletsip_event(
	struct parseunit *parse,
	int event
	)
{
	switch (event)
	{
	    case CEVNT_BADREPLY:	/* reset on garbled input */
	    case CEVNT_TIMEOUT:		/* reset on no input */
		    (void)trimbletsip_setup(parse, "event BAD_REPLY/TIMEOUT");
		    break;

	    default:			/* ignore */
		break;
	}
}

/*
 * getflt, getint convert fields in the incoming data into the
 * appropriate type of item
 *
 * CAVEAT: these routines are currently definitely byte order dependent
 * and assume Representation(float) == IEEE754
 * These functions MUST be converted to portable versions (especially
 * converting the float representation into ntp_fp formats in order
 * to avoid floating point operations at all!
 */

static float
getflt(
	u_char *bp
	)
{
	union uval uval;
	
#ifdef WORDS_BIGENDIAN
	uval.bd[0] = *bp++;
	uval.bd[1] = *bp++;
	uval.bd[2] = *bp++;
	uval.bd[3] = *bp;
#else  /* ! WORDS_BIGENDIAN */
	uval.bd[3] = *bp++;
	uval.bd[2] = *bp++;
	uval.bd[1] = *bp++;
	uval.bd[0] = *bp;
#endif /* ! WORDS_BIGENDIAN */
	return uval.fv;
}

static double
getdbl(
	u_char *bp
	)
{
	union uval uval;
	
#ifdef WORDS_BIGENDIAN
	uval.bd[0] = *bp++;
	uval.bd[1] = *bp++;
	uval.bd[2] = *bp++;
	uval.bd[3] = *bp++;
	uval.bd[4] = *bp++;
	uval.bd[5] = *bp++;
	uval.bd[6] = *bp++;
	uval.bd[7] = *bp;
#else  /* ! WORDS_BIGENDIAN */
	uval.bd[7] = *bp++;
	uval.bd[6] = *bp++;
	uval.bd[5] = *bp++;
	uval.bd[4] = *bp++;
	uval.bd[3] = *bp++;
	uval.bd[2] = *bp++;
	uval.bd[1] = *bp++;
	uval.bd[0] = *bp;
#endif /* ! WORDS_BIGENDIAN */
	return uval.dv;
}

static int
getshort(
	 unsigned char *p
	 )
{
	return get_msb_short(&p);
}

/*--------------------------------------------------
 * trimbletsip_message - process trimble messages
 */
#define RTOD (180.0 / 3.1415926535898)
#define mb(_X_) (buffer[2+(_X_)]) /* shortcut for buffer access */

static void
trimbletsip_message(
		    struct parseunit *parse,
		    parsetime_t      *parsetime
		    )
{
	unsigned char *buffer = parsetime->parse_msg;
	unsigned int   size   = parsetime->parse_msglen;
	
	if ((size < 4) ||
	    (buffer[0]      != DLE) ||
	    (buffer[size-1] != ETX) ||
	    (buffer[size-2] != DLE))
	{
#ifdef DEBUG
		if (debug > 2) {
			int i;

			printf("TRIMBLE BAD packet, size %d:\n	", size);
			for (i = 0; i < size; i++) {
				printf ("%2.2x, ", buffer[i]&0xff);
				if (i%16 == 15) printf("\n\t");
			}
			printf("\n");
		}
#endif
		return;
	}
	else
	{
		int 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) {
			int i;

			printf("TRIMBLE packet 0x%02x, size %d:\n	", cmd, size);
			for (i = 0; i < size; i++) {
				printf ("%2.2x, ", buffer[i]&0xff);
				if (i%16 == 15) printf("\n\t");
			}
			printf("\n");
		}
#endif

		if (tr)
			tr->last_msg = current_time;
		
		s = trimble_convert(cmd, trimble_rcmds);
		
		if (s)
		{
			snprintf(t, BUFFER_SIZE(pbuffer, t), "%s=\"", s->varname);
		}
		else
		{
			DPRINTF(1, ("TRIMBLE UNKNOWN COMMAND 0x%02x\n", cmd));
			return;
		}

		var_flag = s->varmode;

		t += strlen(t);
		
		switch(cmd)
		{
		case CMD_RCURTIME:
			snprintf(t, BUFFER_SIZE(pbuffer, t), "%f, %d, %f",
				 getflt((unsigned char *)&mb(0)), getshort((unsigned char *)&mb(4)),
				 getflt((unsigned char *)&mb(6)));
			break;
			
		case CMD_RBEST4:
			strncpy(t, "mode: ", BUFFER_SIZE(pbuffer, t));
			t += strlen(t);
			switch (mb(0) & 0xF)
			{
			default:
				snprintf(t, BUFFER_SIZE(pbuffer, t), "0x%x", mb(0) & 0x7);
				break;

			case 1:
				strncpy(t, "0D", BUFFER_SIZE(pbuffer, t));
				break;
				
			case 3:
				strncpy(t, "2D", BUFFER_SIZE(pbuffer, t));
				break;
				
			case 4:
				strncpy(t, "3D", BUFFER_SIZE(pbuffer, t));
				break;
			}
			t += strlen(t);
			if (mb(0) & 0x10)
				strncpy(t, "-MANUAL, ", BUFFER_SIZE(pbuffer, t));
			else
				strncpy(t, "-AUTO, ", BUFFER_SIZE(pbuffer, t));
			t += strlen(t);
			
			snprintf(t, BUFFER_SIZE(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)),
				getflt((unsigned char *)&mb(9)),
				getflt((unsigned char *)&mb(13)),
				getflt((unsigned char *)&mb(17)));

			break;
			
		case CMD_RVERSION:
			snprintf(t, BUFFER_SIZE(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[] =
			{
				"Battery backup failed",
				"Signal processor error",
				"Alignment error, channel or chip 1",
				"Alignment error, channel or chip 2",
				"Antenna feed line fault",
				"Excessive ref freq. error",
				"",
				""
			};
			
			int i, bits;
			
			switch (mb(0) & 0xFF)
			{
			default:
				snprintf(t, BUFFER_SIZE(pbuffer, t), "illegal value 0x%02x", mb(0) & 0xFF);
				break;
			case 0x00:
				strncpy(t, "doing position fixes", BUFFER_SIZE(pbuffer, t));
				break;
			case 0x01:
				strncpy(t, "no GPS time yet", BUFFER_SIZE(pbuffer, t));
				break;
			case 0x03:
				strncpy(t, "PDOP too high", BUFFER_SIZE(pbuffer, t));
				break;
			case 0x08:
				strncpy(t, "no usable satellites", BUFFER_SIZE(pbuffer, t));
				break;
			case 0x09:
				strncpy(t, "only ONE usable satellite", BUFFER_SIZE(pbuffer, t));
				break;
			case 0x0A:
				strncpy(t, "only TWO usable satellites", BUFFER_SIZE(pbuffer, t));
				break;
			case 0x0B:
				strncpy(t, "only THREE usable satellites", BUFFER_SIZE(pbuffer, t));
				break;
			case 0x0C:
				strncpy(t, "the chosen satellite is unusable", BUFFER_SIZE(pbuffer, t));
				break;
			}

			t += strlen(t);

			bits = mb(1) & 0xFF;
			
			for (i = 0; i < 8; i++)
				if (bits & (0x1<",
				"",
				""
			};
			
			int i, bits;

			snprintf(t, BUFFER_SIZE(pbuffer, t), "machine id 0x%02x", mb(0) & 0xFF);
			t += strlen(t);
			
			bits = mb(1) & 0xFF;
			
			for (i = 0; i < 8; i++)
				if (bits & (0x1<", BUFFER_SIZE(pbuffer, t));
			  }
		}
		break;

		case CMD_RSAT1BIAS:
			snprintf(t, BUFFER_SIZE(pbuffer, t), "%.1fm %.2fm/s at %.1fs",
				getflt(&mb(0)), getflt(&mb(4)), getflt(&mb(8)));
			break;

		case CMD_RIOOPTIONS:
		{
			snprintf(t, BUFFER_SIZE(pbuffer, t), "%02x %02x %02x %02x",
				mb(0), mb(1), mb(2), mb(3));
			if (mb(0) != TRIM_POS_OPT ||
			    mb(2) != TRIM_TIME_OPT)
			{
				(void)trimbletsip_setup(parse, "bad io options");
			}
		}
		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)
			  snprintf(t, BUFFER_SIZE(pbuffer, t), "x= %.1fm, y= %.1fm, z= %.1fm, time_of_fix= %f sec",
				  x, y, z,
				  f);
			else
			  return;
		}
		break;

		case CMD_RSLLAPOS:
		{
			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)
			  snprintf(t, BUFFER_SIZE(pbuffer, t), "lat %f %c, long %f %c, alt %.2fm",
				  ((lat < 0.0) ? (-lat) : (lat))*RTOD, (lat < 0.0 ? 'S' : 'N'),
				  ((lng < 0.0) ? (-lng) : (lng))*RTOD, (lng < 0.0 ? 'W' : 'E'),
				  getflt((unsigned char *)&mb(8)));
			else
			  return;
		}
		break;

		case CMD_RDOUBLEXYZ:
		{
			double x = getdbl((unsigned char *)&mb(0));
			double y = getdbl((unsigned char *)&mb(8));
			double z = getdbl((unsigned char *)&mb(16));
			snprintf(t, BUFFER_SIZE(pbuffer, t), "x= %.1fm, y= %.1fm, z= %.1fm",
				x, y, z);
		}
		break;
				
		case CMD_RDOUBLELLA:
		{
			double lat = getdbl((unsigned char *)&mb(0));
			double lng = getdbl((unsigned char *)&mb(8));
			snprintf(t, BUFFER_SIZE(pbuffer, t), "lat %f %c, lon %f %c, alt %.2fm",
				((lat < 0.0) ? (-lat) : (lat))*RTOD, (lat < 0.0 ? 'S' : 'N'),
				((lng < 0.0) ? (-lng) : (lng))*RTOD, (lng < 0.0 ? 'W' : 'E'),
				getdbl((unsigned char *)&mb(16)));
		}
		break;

		case CMD_RALLINVIEW:
		{
			int i, sats;
			
			strncpy(t, "mode: ", BUFFER_SIZE(pbuffer, t));
			t += strlen(t);
			switch (mb(0) & 0x7)
			{
			default:
				snprintf(t, BUFFER_SIZE(pbuffer, t), "0x%x", mb(0) & 0x7);
				break;

			case 3:
				strncpy(t, "2D", BUFFER_SIZE(pbuffer, t));
				break;
				
			case 4:
				strncpy(t, "3D", BUFFER_SIZE(pbuffer, t));
				break;
			}
			t += strlen(t);
			if (mb(0) & 0x8)
				strncpy(t, "-MANUAL, ", BUFFER_SIZE(pbuffer, t));
			else
				strncpy(t, "-AUTO, ", BUFFER_SIZE(pbuffer, t));
			t += strlen(t);
			
			sats = (mb(0)>>4) & 0xF;
			
			snprintf(t, BUFFER_SIZE(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)),
				getflt((unsigned char *)&mb(9)),
				getflt((unsigned char *)&mb(13)),
				sats, (sats == 1) ? "" : "s");
			t += strlen(t);

			for (i=0; i < sats; i++)
			{
				snprintf(t, BUFFER_SIZE(pbuffer, t), "%s%02d", i ? ", " : "", mb(17+i));
				t += strlen(t);
				if (tr)
					tr->ctrack |= (1 << (mb(17+i)-1));
			}

			if (tr)
                        { /* mark for tracking status query */
				tr->qtracking = 1;
			}
		}
		break;
		
		case CMD_RSTATTRACK:
		{
			snprintf(t-2, BUFFER_SIZE(pbuffer, t-2), "[%02d]=\"", mb(0)); /* add index to var name */
			t += strlen(t);

			if (getflt((unsigned char *)&mb(4)) < 0.0)
			{
				strncpy(t, "", BUFFER_SIZE(pbuffer, t));
				var_flag &= ~DEF;
			}
			else
			{	
				snprintf(t, BUFFER_SIZE(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",
					mb(3),
					getflt((unsigned char *)&mb(4)),
					getflt((unsigned char *)&mb(12)) * RTOD,
					getflt((unsigned char *)&mb(16)) * RTOD);
				t += strlen(t);
				if (mb(20))
				{
					var_flag &= ~DEF;
					strncpy(t, ", OLD", BUFFER_SIZE(pbuffer, t));
				}
				t += strlen(t);
				if (mb(22))
				{
					if (mb(22) == 1)
						strncpy(t, ", BAD PARITY", BUFFER_SIZE(pbuffer, t));
					else
						if (mb(22) == 2)
							strncpy(t, ", BAD EPH HEALTH", BUFFER_SIZE(pbuffer, t));
				}
				t += strlen(t);
				if (mb(23))
					strncpy(t, ", collecting data", BUFFER_SIZE(pbuffer, t));
			}
		}
		break;
		
		default:
			strncpy(t, "", BUFFER_SIZE(pbuffer, t));
			break;
		}
		t += strlen(t);

		strncpy(t,"\"", BUFFER_SIZE(pbuffer, t));
		set_var(&parse->kv, pbuffer, sizeof(pbuffer), var_flag);
	}
}


/**============================================================
 ** RAWDCF support
 **/

/*--------------------------------------------------
 * rawdcf_init_1 - set up modem lines for RAWDCF receivers
 * SET DTR line
 */
#if defined(TIOCMSET) && (defined(TIOCM_DTR) || defined(CIOCM_DTR))
static int
rawdcf_init_1(
	struct parseunit *parse
	)
{
	/* fixed 2000 for using with Linux by Wolfram Pienkoss  */
	/*
	 * You can use the RS232 to supply the power for a DCF77 receiver.
	 * Here a voltage between the DTR and the RTS line is used. Unfortunately
	 * the name has changed from CIOCM_DTR to TIOCM_DTR recently.
	 */
	int sl232;

	if (ioctl(parse->generic->io.fd, TIOCMGET, (caddr_t)&sl232) == -1)
	{
		msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_1: WARNING: ioctl(fd, TIOCMGET, [C|T]IOCM_DTR): %m", CLK_UNIT(parse->peer));
		return 0;
	}

#ifdef TIOCM_DTR
	sl232 = (sl232 & ~TIOCM_RTS) | TIOCM_DTR;	/* turn on DTR, clear RTS for power supply */
#else
	sl232 = (sl232 & ~CIOCM_RTS) | CIOCM_DTR;	/* turn on DTR, clear RTS for power supply */
#endif

	if (ioctl(parse->generic->io.fd, TIOCMSET, (caddr_t)&sl232) == -1)
	{
		msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_1: WARNING: ioctl(fd, TIOCMSET, [C|T]IOCM_DTR): %m", CLK_UNIT(parse->peer));
	}
	return 0;
}
#else
static int
rawdcfdtr_init_1(
	struct parseunit *parse
	)
{
	msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_1: WARNING: OS interface incapable of setting DTR to power DCF modules", CLK_UNIT(parse->peer));
	return 0;
}
#endif  /* DTR initialisation type */

/*--------------------------------------------------
 * rawdcf_init_2 - set up modem lines for RAWDCF receivers
 * CLR DTR line, SET RTS line
 */
#if defined(TIOCMSET) &&  (defined(TIOCM_RTS) || defined(CIOCM_RTS))
static int
rawdcf_init_2(
	struct parseunit *parse
	)
{
	/* fixed 2000 for using with Linux by Wolfram Pienkoss  */
	/*
	 * You can use the RS232 to supply the power for a DCF77 receiver.
	 * Here a voltage between the DTR and the RTS line is used. Unfortunately
	 * the name has changed from CIOCM_DTR to TIOCM_DTR recently.
	 */
	int sl232;

	if (ioctl(parse->generic->io.fd, TIOCMGET, (caddr_t)&sl232) == -1)
	{
		msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_2: WARNING: ioctl(fd, TIOCMGET, [C|T]IOCM_RTS): %m", CLK_UNIT(parse->peer));
		return 0;
	}

#ifdef TIOCM_RTS
	sl232 = (sl232 & ~TIOCM_DTR) | TIOCM_RTS;	/* turn on RTS, clear DTR for power supply */
#else
	sl232 = (sl232 & ~CIOCM_DTR) | CIOCM_RTS;	/* turn on RTS, clear DTR for power supply */
#endif

	if (ioctl(parse->generic->io.fd, TIOCMSET, (caddr_t)&sl232) == -1)
	{
		msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_2: WARNING: ioctl(fd, TIOCMSET, [C|T]IOCM_RTS): %m", CLK_UNIT(parse->peer));
	}
	return 0;
}
#else
static int
rawdcf_init_2(
	struct parseunit *parse
	)
{
	msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_2: WARNING: OS interface incapable of setting RTS to power DCF modules", CLK_UNIT(parse->peer));
	return 0;
}
#endif  /* DTR initialisation type */

#else	/* defined(REFCLOCK) && defined(PARSE) */
int refclock_parse_bs;
#endif	/* defined(REFCLOCK) && defined(PARSE) */

/*
 * History:
 *
 * refclock_parse.c,v
 * Revision 4.81  2009/05/01 10:15:29  kardel
 * use new refclock_ppsapi interface
 *
 * Revision 4.80  2007/08/11 12:06:29  kardel
 * update comments wrt/ to PPS
 *
 * Revision 4.79  2007/08/11 11:52:23  kardel
 * - terminate io bindings before io_closeclock() will close our file descriptor
 *
 * Revision 4.78  2006/12/22 20:08:27  kardel
 * Bug 746 (RFE): add configuration for Expert mouseCLOCK USB v2.0 as mode 19
 *
 * Revision 4.77  2006/08/05 07:44:49  kardel
 * support optionally separate PPS devices via /dev/refclockpps-{0..3}
 *
 * Revision 4.76  2006/06/22 18:40:47  kardel
 * clean up signedness (gcc 4)
 *
 * Revision 4.75  2006/06/22 16:58:10  kardel
 * Bug #632: call parse_ppsapi() in parse_ctl() when updating
 * the PPS offset. Fix sign of offset passed to kernel.
 *
 * Revision 4.74  2006/06/18 21:18:37  kardel
 * NetBSD Coverity CID 3796: possible NULL deref
 *
 * Revision 4.73  2006/05/26 14:23:46  kardel
 * cleanup of copyright info
 *
 * Revision 4.72  2006/05/26 14:19:43  kardel
 * cleanup of ioctl cruft
 *
 * Revision 4.71  2006/05/26 14:15:57  kardel
 * delay adding refclock to async refclock io after all initializations
 *
 * Revision 4.70  2006/05/25 18:20:50  kardel
 * bug #619
 * terminate parse io engine after de-registering
 * from refclock io engine
 *
 * Revision 4.69  2006/05/25 17:28:02  kardel
 * complete refclock io structure initialization *before* inserting it into the
 * refclock input machine (avoids null pointer deref) (bug #619)
 *
 * Revision 4.68  2006/05/01 17:02:51  kardel
 * copy receiver method also for newlwy created receive buffers
 *
 * Revision 4.67  2006/05/01 14:37:29  kardel
 * If an input buffer parses into more than one message do insert the
 * parsed message in a new input buffer instead of processing it
 * directly. This avoids deed complicated processing in signal
 * handling.
 *
 * Revision 4.66  2006/03/18 00:45:30  kardel
 * coverity fixes found in NetBSD coverity scan
 *
 * Revision 4.65  2006/01/26 06:08:33  kardel
 * output errno on PPS setup failure
 *
 * Revision 4.64  2005/11/09 20:44:47  kardel
 * utilize full PPS timestamp resolution from PPS API
 *
 * Revision 4.63  2005/10/07 22:10:25  kardel
 * bounded buffer implementation
 *
 * Revision 4.62.2.2  2005/09/25 10:20:16  kardel
 * avoid unexpected buffer overflows due to sprintf("%f") on strange floats:
 * replace almost all str* and *printf functions be their buffer bounded
 * counterparts
 *
 * Revision 4.62.2.1  2005/08/27 16:19:27  kardel
 * limit re-set rate of trimble clocks
 *
 * Revision 4.62  2005/08/06 17:40:00  kardel
 * cleanup size handling wrt/ to buffer boundaries
 *
 * Revision 4.61  2005/07/27 21:16:19  kardel
 * fix a long (> 11 years) misconfiguration wrt/ Meinberg cflag factory
 * default setup. CSTOPB was missing for the 7E2 default data format of
 * the DCF77 clocks.
 *
 * Revision 4.60  2005/07/17 21:14:44  kardel
 * change contents of version string to include the RCS/CVS Id
 *
 * Revision 4.59  2005/07/06 06:56:38  kardel
 * syntax error
 *
 * Revision 4.58  2005/07/04 13:10:40  kardel
 * fix bug 455: tripping over NULL pointer on cleanup
 * fix shadow storage logic for ppsphaseadjust and trustime wrt/ time2
 * fix compiler warnings for some platforms wrt/ printf formatstrings and
 *     varying structure element sizes
 * reorder assignment in binding to avoid tripping over NULL pointers
 *
 * Revision 4.57  2005/06/25 09:25:19  kardel
 * sort out log output sequence
 *
 * Revision 4.56  2005/06/14 21:47:27  kardel
 * collect samples only if samples are ok (sync or trusted flywheel)
 * propagate pps phase adjustment value to kernel via PPSAPI to help HARDPPS
 * en- and dis-able HARDPPS in correlation to receiver sync state
 *
 * Revision 4.55  2005/06/02 21:28:31  kardel
 * clarify trust logic
 *
 * Revision 4.54  2005/06/02 17:06:49  kardel
 * change status reporting to use fixed refclock_report()
 *
 * Revision 4.53  2005/06/02 16:33:31  kardel
 * fix acceptance of clocks unsync clocks right at start
 *
 * Revision 4.52  2005/05/26 21:55:06  kardel
 * cleanup status reporting
 *
 * Revision 4.51  2005/05/26 19:19:14  kardel
 * implement fast refclock startup
 *
 * Revision 4.50  2005/04/16 20:51:35  kardel
 * set pps_enable = 1 when binding a kernel PPS source
 *
 * Revision 4.49  2005/04/16 17:29:26  kardel
 * add non polling clock type 18 for just listenning to Meinberg clocks
 *
 * Revision 4.48  2005/04/16 16:22:27  kardel
 * bk sync 20050415 ntp-dev
 *
 * Revision 4.47  2004/11/29 10:42:48  kardel
 * bk sync ntp-dev 20041129
 *
 * Revision 4.46  2004/11/29 10:26:29  kardel
 * keep fudgetime2 in sync with trusttime/ppsphaseadjust depending in flag1
 *
 * Revision 4.45  2004/11/14 20:53:20  kardel
 * clear PPS flags after using them
 *
 * Revision 4.44  2004/11/14 15:29:41  kardel
 * support PPSAPI, upgrade Copyright to Berkeley style
 *
 * Revision 4.43  2001/05/26 22:53:16  kardel
 * 20010526 reconcilation
 *
 * Revision 4.42  2000/05/14 15:31:51  kardel
 * PPSAPI && RAWDCF modemline support
 *
 * Revision 4.41  2000/04/09 19:50:45  kardel
 * fixed rawdcfdtr_init() -> rawdcf_init_1
 *
 * Revision 4.40  2000/04/09 15:27:55  kardel
 * modem line fiddle in rawdcf_init_2
 *
 * Revision 4.39  2000/03/18 09:16:55  kardel
 * PPSAPI integration
 *
 * Revision 4.38  2000/03/05 20:25:06  kardel
 * support PPSAPI
 *
 * Revision 4.37  2000/03/05 20:11:14  kardel
 * 4.0.99g reconcilation
 *
 * Revision 4.36  1999/11/28 17:18:20  kardel
 * disabled burst mode
 *
 * Revision 4.35  1999/11/28 09:14:14  kardel
 * RECON_4_0_98F
 *
 * Revision 4.34  1999/05/14 06:08:05  kardel
 * store current_time in a suitable container (u_long)
 *
 * Revision 4.33  1999/05/13 21:48:38  kardel
 * double the no response timeout interval
 *
 * Revision 4.32  1999/05/13 20:09:13  kardel
 * complain only about missing polls after a full poll interval
 *
 * Revision 4.31  1999/05/13 19:59:32  kardel
 * add clock type 16 for RTS set DTR clr in RAWDCF
 *
 * Revision 4.30  1999/02/28 20:36:43  kardel
 * fixed printf fmt
 *
 * Revision 4.29  1999/02/28 19:58:23  kardel
 * updated copyright information
 *
 * Revision 4.28  1999/02/28 19:01:50  kardel
 * improved debug out on sent Meinberg messages
 *
 * Revision 4.27  1999/02/28 18:05:55  kardel
 * no linux/ppsclock.h stuff
 *
 * Revision 4.26  1999/02/28 15:27:27  kardel
 * wharton clock integration
 *
 * Revision 4.25  1999/02/28 14:04:46  kardel
 * added missing double quotes to UTC information string
 *
 * Revision 4.24  1999/02/28 12:06:50  kardel
 * (parse_control): using gmprettydate instead of prettydate()
 * (mk_utcinfo): new function for formatting GPS derived UTC information
 * (gps16x_message): changed to use mk_utcinfo()
 * (trimbletsip_message): changed to use mk_utcinfo()
 * ignoring position information in unsynchronized mode
 * (parse_start): augument linux support for optional ASYNC_LOW_LATENCY
 *
 * Revision 4.23  1999/02/23 19:47:53  kardel
 * fixed #endifs
 * (stream_receive): fixed formats
 *
 * Revision 4.22  1999/02/22 06:21:02  kardel
 * use new autoconfig symbols
 *
 * Revision 4.21  1999/02/21 12:18:13  kardel
 * 4.91f reconcilation
 *
 * Revision 4.20  1999/02/21 10:53:36  kardel
 * initial Linux PPSkit version
 *
 * Revision 4.19  1999/02/07 09:10:45  kardel
 * clarify STREAMS mitigation rules in comment
 *
 * Revision 4.18  1998/12/20 23:45:34  kardel
 * fix types and warnings
 *
 * Revision 4.17  1998/11/15 21:24:51  kardel
 * cannot access mbg_ routines when CLOCK_MEINBERG
 * is not defined
 *
 * Revision 4.16  1998/11/15 20:28:17  kardel
 * Release 4.0.73e13 reconcilation
 *
 * Revision 4.15  1998/08/22 21:56:08  kardel
 * fixed IO handling for non-STREAM IO
 *
 * Revision 4.14  1998/08/16 19:00:48  kardel
 * (gps16x_message): reduced UTC parameter information (dropped A0,A1)
 * made uval a local variable (killed one of the last globals)
 * (sendetx): added logging of messages when in debug mode
 * (trimble_check): added periodic checks to facilitate re-initialization
 * (trimbletsip_init): made use of EOL character if in non-kernel operation
 * (trimbletsip_message): extended message interpretation
 * (getdbl): fixed data conversion
 *
 * Revision 4.13  1998/08/09 22:29:13  kardel
 * Trimble TSIP support
 *
 * Revision 4.12  1998/07/11 10:05:34  kardel
 * Release 4.0.73d reconcilation
 *
 * Revision 4.11  1998/06/14 21:09:42  kardel
 * Sun acc cleanup
 *
 * Revision 4.10  1998/06/13 12:36:45  kardel
 * signed/unsigned, name clashes
 *
 * Revision 4.9  1998/06/12 15:30:00  kardel
 * prototype fixes
 *
 * Revision 4.8  1998/06/12 11:19:42  kardel
 * added direct input processing routine for refclocks in
 * order to avaiod that single character io gobbles up all
 * receive buffers and drops input data. (Problem started
 * with fast machines so a character a buffer was possible
 * one of the few cases where faster machines break existing
 * allocation algorithms)
 *
 * Revision 4.7  1998/06/06 18:35:20  kardel
 * (parse_start): added BURST mode initialisation
 *
 * Revision 4.6  1998/05/27 06:12:46  kardel
 * RAWDCF_BASEDELAY default added
 * old comment removed
 * casts for ioctl()
 *
 * Revision 4.5  1998/05/25 22:05:09  kardel
 * RAWDCF_SETDTR option removed
 * clock type 14 attempts to set DTR for
 * power supply of RAWDCF receivers
 *
 * Revision 4.4  1998/05/24 16:20:47  kardel
 * updated comments referencing Meinberg clocks
 * added RAWDCF clock with DTR set option as type 14
 *
 * Revision 4.3  1998/05/24 10:48:33  kardel
 * calibrated CONRAD RAWDCF default fudge factor
 *
 * Revision 4.2  1998/05/24 09:59:35  kardel
 * corrected version information (ntpq support)
 *
 * Revision 4.1  1998/05/24 09:52:31  kardel
 * use fixed format only (new IO model)
 * output debug to stdout instead of msyslog()
 * don't include >"< in ASCII output in order not to confuse
 * ntpq parsing
 *
 * Revision 4.0  1998/04/10 19:52:11  kardel
 * Start 4.0 release version numbering
 *
 * Revision 1.2  1998/04/10 19:28:04  kardel
 * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
 * derived from 3.105.1.2 from V3 tree
 *
 * Revision information 3.1 - 3.105 from log deleted 1998/04/10 kardel
 *
 */
ntp-4.2.6p5/ntpd/refclock_atom.c0000644000175000017500000001526511332473272015547 0ustar  peterpeter/*
 * refclock_atom - clock driver for 1-pps signals
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#include 
#include 

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_unixtime.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"

/*
 * This driver requires the PPSAPI interface (RFC 2783)
 */
#if defined(REFCLOCK) && defined(CLOCK_ATOM) && defined(HAVE_PPSAPI)
#include "ppsapi_timepps.h"
#include "refclock_atom.h"

/*
 * This driver furnishes an interface for pulse-per-second (PPS) signals
 * produced by a cesium clock, timing receiver or related equipment. It
 * can be used to remove accumulated jitter over a congested link and
 * retime a server before redistributing the time to clients. It can 
 *also be used as a holdover should all other synchronization sources
 * beconme unreachable.
 *
 * Before this driver becomes active, the local clock must be set to
 * within +-0.4 s by another means, such as a radio clock or NTP
 * itself. There are two ways to connect the PPS signal, normally at TTL
 * levels, to the computer. One is to shift to EIA levels and connect to
 * pin 8 (DCD) of a serial port. This requires a level converter and
 * may require a one-shot flipflop to lengthen the pulse. The other is
 * to connect the PPS signal directly to pin 10 (ACK) of a PC paralell
 * port. These methods are architecture dependent.
 *
 * This driver requires the Pulse-per-Second API for Unix-like Operating
 * Systems, Version 1.0, RFC-2783 (PPSAPI). Implementations are
 * available for FreeBSD, Linux, SunOS, Solaris and Tru64. However, at
 * present only the Tru64 implementation provides the full generality of
 * the API with multiple PPS drivers and multiple handles per driver. If
 * the PPSAPI is normally implemented in the /usr/include/sys/timepps.h
 * header file and kernel support specific to each operating system.
 *
 * This driver normally uses the PLL/FLL clock discipline implemented in
 * the ntpd code. Ordinarily, this is the most accurate means, as the
 * median filter in the driver interface is much larger than in the
 * kernel. However, if the systemic clock frequency error is large (tens
 * to hundreds of PPM), it's better to used the kernel support, if
 * available.
 *
 * This deriver is subject to the mitigation rules described in the
 * "mitigation rulse and the prefer peer" page. However, there is an
 * important difference. If this driver becomes the PPS driver according
 * to these rules, it is acrive only if (a) a prefer peer other than
 * this driver is among the survivors or (b) there are no survivors and
 * the minsane option of the tos command is zero. This is intended to
 * support space missions where updates from other spacecraft are
 * infrequent, but a reliable PPS signal, such as from an Ultra Stable
 * Oscillator (USO) is available.
 *
 * Fudge Factors
 *
 * The PPS timestamp is captured on the rising (assert) edge if flag2 is
 * dim (default) and on the falling (clear) edge if lit. If flag3 is dim
 * (default), the kernel PPS support is disabled; if lit it is enabled.
 * If flag4 is lit, each timesampt is copied to the clockstats file for
 * later analysis. This can be useful when constructing Allan deviation
 * plots. The time1 parameter can be used to compensate for
 * miscellaneous device driver and OS delays.
 */
/*
 * Interface definitions
 */
#define DEVICE		"/dev/pps%d" /* device name and unit */
#define	PRECISION	(-20)	/* precision assumed (about 1 us) */
#define	REFID		"PPS\0"	/* reference ID */
#define	DESCRIPTION	"PPS Clock Discipline" /* WRU */

/*
 * PPS unit control structure
 */
struct ppsunit {
	struct refclock_atom atom; /* atom structure pointer */
	int	fddev;		/* file descriptor */
};

/*
 * Function prototypes
 */
static	int	atom_start	(int, struct peer *);
static	void	atom_shutdown	(int, struct peer *);
static	void	atom_poll	(int, struct peer *);
static	void	atom_timer	(int, struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_atom = {
	atom_start,		/* start up driver */
	atom_shutdown,		/* shut down driver */
	atom_poll,		/* transmit poll message */
	noentry,		/* control (not used) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* buginfo (not used) */
	atom_timer,		/* called once per second */
};


/*
 * atom_start - initialize data for processing
 */
static int
atom_start(
	int unit,		/* unit number (not used) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct ppsunit *up;
	char	device[80];

	/*
	 * Allocate and initialize unit structure
	 */
	pp = peer->procptr;
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	pp->stratum = STRATUM_UNSPEC;
	memcpy((char *)&pp->refid, REFID, 4);
	up = emalloc(sizeof(struct ppsunit));
	memset(up, 0, sizeof(struct ppsunit));
	pp->unitptr = (caddr_t)up;

	/*
	 * Open PPS device. This can be any serial or parallel port and
	 * not necessarily the port used for the associated radio.
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
	up->fddev = tty_open(device, O_RDWR, 0777);
	if (up->fddev <= 0) {
		msyslog(LOG_ERR,
			"refclock_atom: %s: %m", device);
		return (0);
	}

	/*
	 * Light up the PPSAPI interface.
	 */
	return (refclock_ppsapi(up->fddev, &up->atom));
}


/*
 * atom_shutdown - shut down the clock
 */
static void
atom_shutdown(
	int unit,		/* unit number (not used) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct ppsunit *up;

	pp = peer->procptr;
	up = (struct ppsunit *)pp->unitptr;
	if (up->fddev > 0)
		close(up->fddev);
	free(up);
}

/*
 * atom_timer - called once per second
 */
void
atom_timer(
	int	unit,		/* unit pointer (not used) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct ppsunit *up;
	struct refclockproc *pp;
	char	tbuf[80];

	pp = peer->procptr;
	up = (struct ppsunit *)pp->unitptr;
	if (refclock_pps(peer, &up->atom, pp->sloppyclockflag) <= 0)
		return;

	peer->flags |= FLAG_PPS;

	/*
	 * If flag4 is lit, record each second offset to clockstats.
	 * That's so we can make awesome Allan deviation plots.
	 */
	if (pp->sloppyclockflag & CLK_FLAG4) {
		snprintf(tbuf, sizeof(tbuf), "%.9f",
			 pp->filter[pp->coderecv]);
		record_clock_stats(&peer->srcadr, tbuf);
	}
}


/*
 * atom_poll - called by the transmit procedure
 */
static void
atom_poll(
	int unit,		/* unit number (not used) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;

	/*
	 * Don't wiggle the clock until some other driver has numbered
	 * the seconds.
	 */
	if (sys_leap == LEAP_NOTINSYNC)
		return;

	pp = peer->procptr;
	pp->polls++;
	if (pp->codeproc == pp->coderecv) {
		peer->flags &= ~FLAG_PPS;
		refclock_report(peer, CEVNT_TIMEOUT);
		return;
	}
	pp->lastref = pp->lastrec;
	refclock_receive(peer);
}
#else
int refclock_atom_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/ntpsim.c0000644000175000017500000004000111307651603014231 0ustar  peterpeter/* ntpdsim.c
 *
 * The source code for the ntp discrete event simulator. 
 *
 * Written By:	Sachin Kamboj
 *		University of Delaware
 *		Newark, DE 19711
 * Copyright (c) 2006
 * (Some code shamelessly based on the original NTP discrete event simulator)
 */

#ifdef SIM
#include "ntpd.h"
#include "ntpsim.h"
#include "ntp_data_structures.h"


/* Global Variable Definitions */

sim_info simulation;		/* Simulation Control Variables */
local_clock_info simclock;	/* Local Clock Variables */
queue *event_queue;		/* Event Queue */
queue *recv_queue;		/* Receive Queue */
static double sys_residual = 0;	/* adjustment residue (s) */

void (*event_ptr[]) (Event *) = {
    sim_event_beep, sim_update_clocks, sim_event_timer, sim_event_recv_packet
};			/* Function pointer to the events */


/* Define a function to compare two events to determine which one occurs first
 */

int determine_event_ordering(Event *e1, Event *e2);

int determine_event_ordering(Event *e1, Event *e2)
{
    return (e1->time - e2->time);
}

/* Define a function to compare two received packets to determine which one
 * is received first
 */
int determine_recv_buf_ordering(struct recvbuf *b1, struct recvbuf *b2);

int determine_recv_buf_ordering(struct recvbuf *b1, struct recvbuf *b2)
{
    double recv_time1, recv_time2;

    /* Simply convert the time received to double and subtract */
    LFPTOD(&b1->recv_time, recv_time1);
    LFPTOD(&b2->recv_time, recv_time2);
    return ((int)(recv_time1 - recv_time2));
}

/* Define a function to create the server associations */
void create_server_associations()
{
    int i;
    for (i = 0;i < simulation.num_of_servers;++i) {
	printf("%s\n", stoa(simulation.servers[i].addr));
	if (peer_config(simulation.servers[i].addr,
			ANY_INTERFACE_CHOOSE(simulation.servers[i].addr),
			MODE_CLIENT,
			NTP_VERSION,
			NTP_MINDPOLL,
			NTP_MAXDPOLL,
			0, /* peerflags */
			0, /* ttl */
			0, /* peerkey */
			(u_char *)"*" /* peerkeystr */) == 0) {
	    fprintf(stderr, "ERROR!! Could not create association for: %s",
		    stoa(simulation.servers[i].addr));
	}
    }
}


/* Main Simulator Code */

int ntpsim(int argc, char *argv[])
{
    Event *curr_event;
    struct timeval seed;

    /* Initialize the local Clock 
     */
    simclock.local_time = 0;
    simclock.adj = 0;
    simclock.slew = 0;

    /* Initialize the simulation 
     */
    simulation.num_of_servers = 0;
    simulation.beep_delay = BEEP_DLY;
    simulation.sim_time = 0;
    simulation.end_time = SIM_TIME;

    /*
     * Initialize ntp variables
     */
    initializing = 1;
    init_auth();
    init_util();
    init_restrict();
    init_mon();
    init_timer();
    init_lib();
    init_request();
    init_control();
    init_peer();
    init_proto();
    init_io();
    init_loopfilter();
    mon_start(MON_OFF);    

    /* Call getconfig to parse the configuration file */
    getconfig(argc, argv);
    initializing = 0;
    loop_config(LOOP_DRIFTCOMP, old_drift / 1e6);

    /*
     * Watch out here, we want the real time, not the silly stuff.
     */
    gettimeofday(&seed, NULL);
    ntp_srandom(seed.tv_usec);


    /* Initialize the event queue */
    event_queue = create_priority_queue((int(*)(void *, void*)) 
					determine_event_ordering);

    /* Initialize the receive queue */
    recv_queue = create_priority_queue((int(*)(void *, void*))
				       determine_recv_buf_ordering);

    /* Push a beep and a timer on the event queue */
    enqueue(event_queue, event(0, BEEP));
    enqueue(event_queue, event(simulation.sim_time + 1.0, TIMER));
    /* 
     * Pop the queue until nothing is left or time is exceeded
     */
    /* maxtime = simulation.sim_time + simulation.end_time;*/
    while (simulation.sim_time <= simulation.end_time &&
	   (!empty(event_queue))) {
	curr_event = dequeue(event_queue);
	/* Update all the clocks to the time on the event */
	sim_update_clocks(curr_event);

	/* Execute the function associated with the event */
	event_ptr[curr_event->function](curr_event);
	free_node(curr_event);
    }
    return (0);
}



/* Define a function to create an return an Event  */

Event *event(double t, funcTkn f)
{
    Event *e;

    if ((e = get_node(sizeof(*e))) == NULL)
	abortsim("get_node failed in event");
    e->time = t;
    e->function = f;
    return (e);
}

/* NTP SIMULATION FUNCTIONS */

/* Define a function for processing a timer interrupt.
 * On every timer interrupt, call the NTP timer to send packets and process
 * the clock and then call the receive function to receive packets.
 */
void sim_event_timer(Event *e)
{
    struct recvbuf *rbuf;

    /* Call the NTP timer.
     * This will be responsible for actually "sending the packets."
     * Since this is a simulation, the packets sent over the network
     * will be processed by the simulate_server routine below.
     */
    timer();

    /* Process received buffers */
    while (!empty(recv_queue)) {
	rbuf = (struct recvbuf *)dequeue(recv_queue);
	(rbuf->receiver)(rbuf);
	free_node(rbuf);
    }

    /* Arm the next timer interrupt. */
    enqueue(event_queue, 
	    event(simulation.sim_time + (1 << EVENT_TIMEOUT), TIMER));
}



/* Define a function to simulate a server.
 * This function processes the sent packet according to the server script,
 * creates a reply packet and pushes the reply packet onto the event queue
 */
int simulate_server(
    sockaddr_u *serv_addr,		/* Address of the server */
    struct interface *inter,		/* Interface on which the reply should
					   be inserted */
    struct pkt *rpkt			/* Packet sent to the server that
					   needs to be processed. */
)
{
    struct pkt xpkt;	       /* Packet to be transmitted back
				  to the client */
    struct recvbuf rbuf;       /* Buffer for the received packet */
    Event *e;		       /* Packet receive event */
    server_info *server;       /* Pointer to the server being simulated */
    script_info *curr_script;  /* Current script being processed */
    int i;
    double d1, d2, d3;	       /* Delays while the packet is enroute */
    double t1, t2, t3, t4;     /* The four timestamps in the packet */

    memset(&xpkt, 0, sizeof(xpkt));
    memset(&rbuf, 0, sizeof(rbuf));

    /* Search for the server with the desired address */
    server = NULL;
    for (i = 0; i < simulation.num_of_servers; ++i) {
	fprintf(stderr,"Checking address: %s\n", stoa(simulation.servers[i].addr));
	if (memcmp(simulation.servers[i].addr, serv_addr, 
		   sizeof(*serv_addr)) == 0) { 
	    server = &simulation.servers[i];
	    break;
	}
    }

    fprintf(stderr, "Received packet for: %s\n", stoa(serv_addr));
    if (server == NULL)
	abortsim("Server with specified address not found!!!");
    
    /* Get the current script for the server */
    curr_script = server->curr_script;

    /* Create a server reply packet. 
     * Masquerade the reply as a stratum-1 server with a GPS clock
     */
    xpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, NTP_VERSION,
                                     MODE_SERVER);
    xpkt.stratum = STRATUM_TO_PKT(((u_char)1));
    memcpy(&xpkt.refid, "GPS", 4);
    xpkt.ppoll = rpkt->ppoll;
    xpkt.precision = rpkt->precision;
    xpkt.rootdelay = 0;
    xpkt.rootdisp = 0;

    /* TIMESTAMP CALCULATIONS
	    t1				 t4
	     \				/
	  d1  \			       / d3
	       \		      /
	       t2 ----------------- t3
			 d2
    */
    /* Compute the delays */
    d1 = poisson(curr_script->prop_delay, curr_script->jitter);
    d2 = poisson(curr_script->proc_delay, 0);
    d3 = poisson(curr_script->prop_delay, curr_script->jitter);

    /* Note: In the transmitted packet: 
     * 1. t1 and t4 are times in the client according to the local clock.
     * 2. t2 and t3 are server times according to the simulated server.
     * Compute t1, t2, t3 and t4
     * Note: This function is called at time t1. 
     */

    LFPTOD(&rpkt->xmt, t1);
    t2 = server->server_time + d1;
    t3 = server->server_time + d1 + d2;
    t4 = t1 + d1 + d2 + d3;

    /* Save the timestamps */
    xpkt.org = rpkt->xmt;     
    DTOLFP(t2, &xpkt.rec);
    DTOLFP(t3, &xpkt.xmt);
    xpkt.reftime = xpkt.xmt;



    /* Ok, we are done with the packet. Now initialize the receive buffer for
     * the packet.
     */
    rbuf.receiver = receive;   /* Function to call to process the packet */
    rbuf.recv_length = LEN_PKT_NOMAC;
    rbuf.recv_pkt = xpkt;
    rbuf.used = 1;

    memcpy(&rbuf.srcadr, serv_addr, sizeof(rbuf.srcadr));
    memcpy(&rbuf.recv_srcadr, serv_addr, sizeof(rbuf.recv_srcadr));
    if ((rbuf.dstadr = malloc(sizeof(*rbuf.dstadr))) == NULL)
	abortsim("malloc failed in simulate_server");
    memcpy(rbuf.dstadr, inter, sizeof(*rbuf.dstadr));
    /* rbuf.link = NULL; */

    /* Create a packet event and insert it onto the event_queue at the 
     * arrival time (t4) of the packet at the client 
     */
    e = event(t4, PACKET);
    e->rcv_buf = rbuf;
    enqueue(event_queue, e);
    

    /* Check if the time of the script has expired. If yes, delete the script.
     * If not, re-enqueue the script onto the server script queue 
     */
    if (curr_script->duration > simulation.sim_time && 
	!empty(server->script)) {
	printf("Hello\n");
	/* 
	 * For some reason freeing up the curr_script memory kills the
	 * simulation. Further debugging is needed to determine why.
	 * free_node(curr_script);
	 */
	curr_script = dequeue(server->script);
    }

    return (0);
}


/* Define a function to update all the clocks 
 * Most of the code is modified from the systime.c file by Prof. Mills
 */

void sim_update_clocks (Event *e)
{
    double time_gap;
    double adj;
    int i;

    /* Compute the time between the last update event and this update */
    time_gap = e->time - simulation.sim_time;

    /* Advance the client clock */
    simclock.local_time = e->time + time_gap;

    /* Advance the simulation time */
    simulation.sim_time = e->time;

    /* Advance the server clocks adjusted for systematic and random frequency
     * errors. The random error is a random walk computed as the
     * integral of samples from a Gaussian distribution.
     */
    for (i = 0;i < simulation.num_of_servers; ++i) {
	simulation.servers[i].curr_script->freq_offset +=
	    gauss(0, time_gap * simulation.servers[i].curr_script->wander);

	simulation.servers[i].server_time += time_gap * 
	    (1 + simulation.servers[i].curr_script->freq_offset);
    }


    /* Perform the adjtime() function. If the adjustment completed
     * in the previous interval, amortize the entire amount; if not,
     * carry the leftover to the next interval.
     */

    adj = time_gap * simclock.slew;
    if (adj < fabs(simclock.adj)) {
	if (simclock.adj < 0) {
	    simclock.adj += adj;
	    simclock.local_time -= adj;
	} 
	else {
	    simclock.adj -= adj;
	    simclock.local_time += adj;
	}    
    } 
    else {
	simclock.local_time += simclock.adj;
	simclock.adj = 0;
    }
}


/* Define a function that processes a receive packet event. 
 * This function simply inserts the packet received onto the receive queue
 */   

void sim_event_recv_packet(Event *e)
{
    struct recvbuf *rbuf;

    /* Allocate a receive buffer and copy the packet to it */
    if ((rbuf = get_node(sizeof(*rbuf))) == NULL)
	abortsim("get_node failed in sim_event_recv_packet");
    memcpy(rbuf, &e->rcv_buf, sizeof(*rbuf));

    /* Store the local time in the received packet */
    DTOLFP(simclock.local_time, &rbuf->recv_time);

    /* Insert the packet received onto the receive queue */
    enqueue(recv_queue, rbuf);
}



/* Define a function to output simulation statistics on a beep event
 */

/*** TODO: Need to decide on how to output for multiple servers ***/
void sim_event_beep(Event *e)
{
#if 0
    static int first_time = 1;
    char *dash = "-----------------";
#endif

    fprintf(stderr, "BEEP!!!\n");
    enqueue(event_queue, event(e->time + simulation.beep_delay, BEEP));
#if 0
    if(simulation.beep_delay > 0) {
	if (first_time) {
	    printf("\t%4c    T    %4c\t%4c  T+ERR  %3c\t%5cT+ERR+NTP\n", 
	           ' ', ' ', ' ', ' ',' ');
	    printf("\t%s\t%s\t%s\n", dash, dash, dash);
	    first_time = 0;

	    printf("\t%16.6f\t%16.6f\t%16.6f\n",
	           n->time, n->clk_time, n->ntp_time);
	    return;
	}
	printf("\t%16.6f\t%16.6f\t%16.6f\n",
	       simclock.local_time, 
	       n->time, n->clk_time, n->ntp_time);
#endif

}


/* Define a function to abort the simulation on an error and spit out an
 * error message
 */

void abortsim(char *errmsg)
{
    perror(errmsg);
    exit(1);
}



/* CODE ORIGINALLY IN libntp/systime.c 
 * -----------------------------------
 * This code was a part of the original NTP simulator and originally 
 * had its home in the libntp/systime.c file. 
 *
 * It has been shamelessly moved to here and has been modified for the
 * purposes of the current simulator.
 */


/*
 * get_systime - return the system time in NTP timestamp format 
 */
void
get_systime(
    l_fp *now		/* current system time in l_fp */        )
{
    /*
     * To fool the code that determines the local clock precision,
     * we advance the clock a minimum of 200 nanoseconds on every
     * clock read. This is appropriate for a typical modern machine
     * with nanosecond clocks. Note we make no attempt here to
     * simulate reading error, since the error is so small. This may
     * change when the need comes to implement picosecond clocks.
     */
    if (simclock.local_time == simclock.last_read_time)
        simclock.local_time += 200e-9;

    simclock.last_read_time = simclock.local_time;
    DTOLFP(simclock.local_time, now);
/* OLD Code
   if (ntp_node.ntp_time == ntp_node.last_time)
   ntp_node.ntp_time += 200e-9;
   ntp_node.last_time = ntp_node.ntp_time;
   DTOLFP(ntp_node.ntp_time, now);
*/
}
 
 
/*
 * adj_systime - advance or retard the system clock exactly like the
 * real thng.
 */
int				/* always succeeds */
adj_systime(
    double now		/* time adjustment (s) */
    )
{
    struct timeval adjtv;	/* new adjustment */
    double	dtemp;
    long	ticks;
    int	isneg = 0;

    /*
     * Most Unix adjtime() implementations adjust the system clock
     * in microsecond quanta, but some adjust in 10-ms quanta. We
     * carefully round the adjustment to the nearest quantum, then
     * adjust in quanta and keep the residue for later.
     */
    dtemp = now + sys_residual;
    if (dtemp < 0) {
	isneg = 1;
	dtemp = -dtemp;
    }
    adjtv.tv_sec = (long)dtemp;
    dtemp -= adjtv.tv_sec;
    ticks = (long)(dtemp / sys_tick + .5);
    adjtv.tv_usec = (long)(ticks * sys_tick * 1e6);
    dtemp -= adjtv.tv_usec / 1e6;
    sys_residual = dtemp;

    /*
     * Convert to signed seconds and microseconds for the Unix
     * adjtime() system call. Note we purposely lose the adjtime()
     * leftover.
     */
    if (isneg) {
	adjtv.tv_sec = -adjtv.tv_sec;
	adjtv.tv_usec = -adjtv.tv_usec;
	sys_residual = -sys_residual;
    }
    simclock.adj = now;
/*	ntp_node.adj = now; */
    return (1);
}
 
 
/*
 * step_systime - step the system clock. We are religious here.
 */
int				/* always succeeds */
step_systime(
    double now		/* step adjustment (s) */
    )
{
#ifdef DEBUG
    if (debug)
	printf("step_systime: time %.6f adj %.6f\n",
	       simclock.local_time, now);
#endif
    simclock.local_time += now;
    return (1);
}
 
/*
 * gauss() - returns samples from a gaussion distribution
 */
double				/* Gaussian sample */
gauss(
    double m,		/* sample mean */
    double s		/* sample standard deviation (sigma) */
    )
{
    double q1, q2;

    /*
     * Roll a sample from a Gaussian distribution with mean m and
     * standard deviation s. For m = 0, s = 1, mean(y) = 0,
     * std(y) = 1.
     */
    if (s == 0)
        return (m);
    while ((q1 = drand48()) == 0);
    q2 = drand48();
    return (m + s * sqrt(-2. * log(q1)) * cos(2. * PI * q2));
}

 
/*
 * poisson() - returns samples from a network delay distribution
 */
double				/* delay sample (s) */
poisson(
    double m,		/* fixed propagation delay (s) */
    double s		/* exponential parameter (mu) */
    )
{
    double q1;

    /*
     * Roll a sample from a composite distribution with propagation
     * delay m and exponential distribution time with parameter s.
     * For m = 0, s = 1, mean(y) = std(y) = 1.
     */
    if (s == 0)
        return (m);
    while ((q1 = drand48()) == 0);
    return (m - s * log(q1 * s));
}

#endif
ntp-4.2.6p5/ntpd/refclock_wwv.c0000644000175000017500000023661311307651605015434 0ustar  peterpeter/*
 * refclock_wwv - clock driver for NIST WWV/H time/frequency station
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_WWV)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_calendar.h"
#include "ntp_stdlib.h"
#include "audio.h"

#include 
#include 
#include 
#ifdef HAVE_SYS_IOCTL_H
# include 
#endif /* HAVE_SYS_IOCTL_H */

#define ICOM 1

#ifdef ICOM
#include "icom.h"
#endif /* ICOM */

/*
 * Audio WWV/H demodulator/decoder
 *
 * This driver synchronizes the computer time using data encoded in
 * radio transmissions from NIST time/frequency stations WWV in Boulder,
 * CO, and WWVH in Kauai, HI. Transmissions are made continuously on
 * 2.5, 5, 10 and 15 MHz from WWV and WWVH, and 20 MHz from WWV. An
 * ordinary AM shortwave receiver can be tuned manually to one of these
 * frequencies or, in the case of ICOM receivers, the receiver can be
 * tuned automatically using this program as propagation conditions
 * change throughout the weasons, both day and night.
 *
 * The driver requires an audio codec or sound card with sampling rate 8
 * kHz and mu-law companding. This is the same standard as used by the
 * telephone industry and is supported by most hardware and operating
 * systems, including Solaris, SunOS, FreeBSD, NetBSD and Linux. In this
 * implementation, only one audio driver and codec can be supported on a
 * single machine.
 *
 * The demodulation and decoding algorithms used in this driver are
 * based on those developed for the TAPR DSP93 development board and the
 * TI 320C25 digital signal processor described in: Mills, D.L. A
 * precision radio clock for WWV transmissions. Electrical Engineering
 * Report 97-8-1, University of Delaware, August 1997, 25 pp., available
 * from www.eecis.udel.edu/~mills/reports.html. The algorithms described
 * in this report have been modified somewhat to improve performance
 * under weak signal conditions and to provide an automatic station
 * identification feature.
 *
 * The ICOM code is normally compiled in the driver. It isn't used,
 * unless the mode keyword on the server configuration command specifies
 * a nonzero ICOM ID select code. The C-IV trace is turned on if the
 * debug level is greater than one.
 *
 * Fudge factors
 *
 * Fudge flag4 causes the dubugging output described above to be
 * recorded in the clockstats file. Fudge flag2 selects the audio input
 * port, where 0 is the mike port (default) and 1 is the line-in port.
 * It does not seem useful to select the compact disc player port. Fudge
 * flag3 enables audio monitoring of the input signal. For this purpose,
 * the monitor gain is set to a default value.
 *
 * CEVNT_BADTIME	invalid date or time
 * CEVNT_PROP		propagation failure - no stations heard
 * CEVNT_TIMEOUT	timeout (see newgame() below)
 */
/*
 * General definitions. These ordinarily do not need to be changed.
 */
#define	DEVICE_AUDIO	"/dev/audio" /* audio device name */
#define	AUDIO_BUFSIZ	320	/* audio buffer size (50 ms) */
#define	PRECISION	(-10)	/* precision assumed (about 1 ms) */
#define	DESCRIPTION	"WWV/H Audio Demodulator/Decoder" /* WRU */
#define SECOND		8000	/* second epoch (sample rate) (Hz) */
#define MINUTE		(SECOND * 60) /* minute epoch */
#define OFFSET		128	/* companded sample offset */
#define SIZE		256	/* decompanding table size */
#define	MAXAMP		6000.	/* max signal level reference */
#define	MAXCLP		100	/* max clips above reference per s */
#define MAXSNR		40.	/* max SNR reference */
#define MAXFREQ		1.5	/* max frequency tolerance (187 PPM) */
#define DATCYC		170	/* data filter cycles */
#define DATSIZ		(DATCYC * MS) /* data filter size */
#define SYNCYC		800	/* minute filter cycles */
#define SYNSIZ		(SYNCYC * MS) /* minute filter size */
#define TCKCYC		5	/* tick filter cycles */
#define TCKSIZ		(TCKCYC * MS) /* tick filter size */
#define NCHAN		5	/* number of radio channels */
#define	AUDIO_PHI	5e-6	/* dispersion growth factor */
#define	TBUF		128	/* max monitor line length */

/*
 * Tunable parameters. The DGAIN parameter can be changed to fit the
 * audio response of the radio at 100 Hz. The WWV/WWVH data subcarrier
 * is transmitted at about 20 percent percent modulation; the matched
 * filter boosts it by a factor of 17 and the receiver response does
 * what it does. The compromise value works for ICOM radios. If the
 * radio is not tunable, the DCHAN parameter can be changed to fit the
 * expected best propagation frequency: higher if further from the
 * transmitter, lower if nearer. The compromise value works for the US
 * right coast.
 */
#define DCHAN		3	/* default radio channel (15 Mhz) */
#define DGAIN		5.	/* subcarrier gain */

/*
 * General purpose status bits (status)
 *
 * SELV and/or SELH are set when WWV or WWVH have been heard and cleared
 * on signal loss. SSYNC is set when the second sync pulse has been
 * acquired and cleared by signal loss. MSYNC is set when the minute
 * sync pulse has been acquired. DSYNC is set when the units digit has
 * has reached the threshold and INSYNC is set when all nine digits have
 * reached the threshold. The MSYNC, DSYNC and INSYNC bits are cleared
 * only by timeout, upon which the driver starts over from scratch.
 *
 * DGATE is lit if the data bit amplitude or SNR is below thresholds and
 * BGATE is lit if the pulse width amplitude or SNR is below thresolds.
 * LEPSEC is set during the last minute of the leap day. At the end of
 * this minute the driver inserts second 60 in the seconds state machine
 * and the minute sync slips a second.
 */
#define MSYNC		0x0001	/* minute epoch sync */
#define SSYNC		0x0002	/* second epoch sync */
#define DSYNC		0x0004	/* minute units sync */
#define INSYNC		0x0008	/* clock synchronized */
#define FGATE		0x0010	/* frequency gate */
#define DGATE		0x0020	/* data pulse amplitude error */
#define BGATE		0x0040	/* data pulse width error */
#define	METRIC		0x0080	/* one or more stations heard */
#define LEPSEC		0x1000	/* leap minute */

/*
 * Station scoreboard bits
 *
 * These are used to establish the signal quality for each of the five
 * frequencies and two stations.
 */
#define SELV		0x0100	/* WWV station select */
#define SELH		0x0200	/* WWVH station select */

/*
 * Alarm status bits (alarm)
 *
 * These bits indicate various alarm conditions, which are decoded to
 * form the quality character included in the timecode.
 */
#define CMPERR		0x1	/* digit or misc bit compare error */
#define LOWERR		0x2	/* low bit or digit amplitude or SNR */
#define NINERR		0x4	/* less than nine digits in minute */
#define SYNERR		0x8	/* not tracking second sync */

/*
 * Watchcat timeouts (watch)
 *
 * If these timeouts expire, the status bits are mashed to zero and the
 * driver starts from scratch. Suitably more refined procedures may be
 * developed in future. All these are in minutes.
 */
#define ACQSN		6	/* station acquisition timeout */
#define DATA		15	/* unit minutes timeout */
#define SYNCH		40	/* station sync timeout */
#define PANIC		(2 * 1440) /* panic timeout */

/*
 * Thresholds. These establish the minimum signal level, minimum SNR and
 * maximum jitter thresholds which establish the error and false alarm
 * rates of the driver. The values defined here may be on the
 * adventurous side in the interest of the highest sensitivity.
 */
#define MTHR		13.	/* minute sync gate (percent) */
#define TTHR		50.	/* minute sync threshold (percent) */
#define AWND		20	/* minute sync jitter threshold (ms) */
#define ATHR		2500.	/* QRZ minute sync threshold */
#define ASNR		20.	/* QRZ minute sync SNR threshold (dB) */
#define QTHR		2500.	/* QSY minute sync threshold */
#define QSNR		20.	/* QSY minute sync SNR threshold (dB) */
#define STHR		2500.	/* second sync threshold */
#define	SSNR		15.	/* second sync SNR threshold (dB) */
#define SCMP		10 	/* second sync compare threshold */
#define DTHR		1000.	/* bit threshold */
#define DSNR		10.	/* bit SNR threshold (dB) */
#define AMIN		3	/* min bit count */
#define AMAX		6	/* max bit count */
#define BTHR		1000.	/* digit threshold */
#define BSNR		3.	/* digit likelihood threshold (dB) */
#define BCMP		3	/* digit compare threshold */
#define	MAXERR		40	/* maximum error alarm */

/*
 * Tone frequency definitions. The increments are for 4.5-deg sine
 * table.
 */
#define MS		(SECOND / 1000) /* samples per millisecond */
#define IN100		((100 * 80) / SECOND) /* 100 Hz increment */
#define IN1000		((1000 * 80) / SECOND) /* 1000 Hz increment */
#define IN1200		((1200 * 80) / SECOND) /* 1200 Hz increment */

/*
 * Acquisition and tracking time constants
 */
#define MINAVG		8	/* min averaging time */
#define MAXAVG		1024	/* max averaging time */
#define FCONST		3	/* frequency time constant */
#define TCONST		16	/* data bit/digit time constant */

/*
 * Miscellaneous status bits (misc)
 *
 * These bits correspond to designated bits in the WWV/H timecode. The
 * bit probabilities are exponentially averaged over several minutes and
 * processed by a integrator and threshold.
 */
#define DUT1		0x01	/* 56 DUT .1 */
#define DUT2		0x02	/* 57 DUT .2 */
#define DUT4		0x04	/* 58 DUT .4 */
#define DUTS		0x08	/* 50 DUT sign */
#define DST1		0x10	/* 55 DST1 leap warning */
#define DST2		0x20	/* 2 DST2 DST1 delayed one day */
#define SECWAR		0x40	/* 3 leap second warning */

/*
 * The on-time synchronization point is the positive-going zero crossing
 * of the first cycle of the 5-ms second pulse. The IIR baseband filter
 * phase delay is 0.91 ms, while the receiver delay is approximately 4.7
 * ms at 1000 Hz. The fudge value -0.45 ms due to the codec and other
 * causes was determined by calibrating to a PPS signal from a GPS
 * receiver. The additional propagation delay specific to each receiver
 * location can be  programmed in the fudge time1 and time2 values for
 * WWV and WWVH, respectively.
 *
 * The resulting offsets with a 2.4-GHz P4 running FreeBSD 6.1 are
 * generally within .02 ms short-term with .02 ms jitter. The long-term
 * offsets vary up to 0.3 ms due to ionosperhic layer height variations.
 * The processor load due to the driver is 5.8 percent.
 */
#define PDELAY	((.91 + 4.7 - 0.45) / 1000) /* system delay (s) */

/*
 * Table of sine values at 4.5-degree increments. This is used by the
 * synchronous matched filter demodulators.
 */
double sintab[] = {
 0.000000e+00,  7.845910e-02,  1.564345e-01,  2.334454e-01, /* 0-3 */
 3.090170e-01,  3.826834e-01,  4.539905e-01,  5.224986e-01, /* 4-7 */
 5.877853e-01,  6.494480e-01,  7.071068e-01,  7.604060e-01, /* 8-11 */
 8.090170e-01,  8.526402e-01,  8.910065e-01,  9.238795e-01, /* 12-15 */
 9.510565e-01,  9.723699e-01,  9.876883e-01,  9.969173e-01, /* 16-19 */
 1.000000e+00,  9.969173e-01,  9.876883e-01,  9.723699e-01, /* 20-23 */
 9.510565e-01,  9.238795e-01,  8.910065e-01,  8.526402e-01, /* 24-27 */
 8.090170e-01,  7.604060e-01,  7.071068e-01,  6.494480e-01, /* 28-31 */
 5.877853e-01,  5.224986e-01,  4.539905e-01,  3.826834e-01, /* 32-35 */
 3.090170e-01,  2.334454e-01,  1.564345e-01,  7.845910e-02, /* 36-39 */
-0.000000e+00, -7.845910e-02, -1.564345e-01, -2.334454e-01, /* 40-43 */
-3.090170e-01, -3.826834e-01, -4.539905e-01, -5.224986e-01, /* 44-47 */
-5.877853e-01, -6.494480e-01, -7.071068e-01, -7.604060e-01, /* 48-51 */
-8.090170e-01, -8.526402e-01, -8.910065e-01, -9.238795e-01, /* 52-55 */
-9.510565e-01, -9.723699e-01, -9.876883e-01, -9.969173e-01, /* 56-59 */
-1.000000e+00, -9.969173e-01, -9.876883e-01, -9.723699e-01, /* 60-63 */
-9.510565e-01, -9.238795e-01, -8.910065e-01, -8.526402e-01, /* 64-67 */
-8.090170e-01, -7.604060e-01, -7.071068e-01, -6.494480e-01, /* 68-71 */
-5.877853e-01, -5.224986e-01, -4.539905e-01, -3.826834e-01, /* 72-75 */
-3.090170e-01, -2.334454e-01, -1.564345e-01, -7.845910e-02, /* 76-79 */
 0.000000e+00};						    /* 80 */

/*
 * Decoder operations at the end of each second are driven by a state
 * machine. The transition matrix consists of a dispatch table indexed
 * by second number. Each entry in the table contains a case switch
 * number and argument.
 */
struct progx {
	int sw;			/* case switch number */
	int arg;		/* argument */
};

/*
 * Case switch numbers
 */
#define IDLE		0	/* no operation */
#define COEF		1	/* BCD bit */
#define COEF1		2	/* BCD bit for minute unit */
#define COEF2		3	/* BCD bit not used */
#define DECIM9		4	/* BCD digit 0-9 */
#define DECIM6		5	/* BCD digit 0-6 */
#define DECIM3		6	/* BCD digit 0-3 */
#define DECIM2		7	/* BCD digit 0-2 */
#define MSCBIT		8	/* miscellaneous bit */
#define MSC20		9	/* miscellaneous bit */		
#define MSC21		10	/* QSY probe channel */		
#define MIN1		11	/* latch time */		
#define MIN2		12	/* leap second */
#define SYNC2		13	/* latch minute sync pulse */		
#define SYNC3		14	/* latch data pulse */		

/*
 * Offsets in decoding matrix
 */
#define MN		0	/* minute digits (2) */
#define HR		2	/* hour digits (2) */
#define DA		4	/* day digits (3) */
#define YR		7	/* year digits (2) */

struct progx progx[] = {
	{SYNC2,	0},		/* 0 latch minute sync pulse */
	{SYNC3,	0},		/* 1 latch data pulse */
	{MSCBIT, DST2},		/* 2 dst2 */
	{MSCBIT, SECWAR},	/* 3 lw */
	{COEF,	0},		/* 4 1 year units */
	{COEF,	1},		/* 5 2 */
	{COEF,	2},		/* 6 4 */
	{COEF,	3},		/* 7 8 */
	{DECIM9, YR},		/* 8 */
	{IDLE,	0},		/* 9 p1 */
	{COEF1,	0},		/* 10 1 minute units */
	{COEF1,	1},		/* 11 2 */
	{COEF1,	2},		/* 12 4 */
	{COEF1,	3},		/* 13 8 */
	{DECIM9, MN},		/* 14 */
	{COEF,	0},		/* 15 10 minute tens */
	{COEF,	1},		/* 16 20 */
	{COEF,	2},		/* 17 40 */
	{COEF2,	3},		/* 18 80 (not used) */
	{DECIM6, MN + 1},	/* 19 p2 */
	{COEF,	0},		/* 20 1 hour units */
	{COEF,	1},		/* 21 2 */
	{COEF,	2},		/* 22 4 */
	{COEF,	3},		/* 23 8 */
	{DECIM9, HR},		/* 24 */
	{COEF,	0},		/* 25 10 hour tens */
	{COEF,	1},		/* 26 20 */
	{COEF2,	2},		/* 27 40 (not used) */
	{COEF2,	3},		/* 28 80 (not used) */
	{DECIM2, HR + 1},	/* 29 p3 */
	{COEF,	0},		/* 30 1 day units */
	{COEF,	1},		/* 31 2 */
	{COEF,	2},		/* 32 4 */
	{COEF,	3},		/* 33 8 */
	{DECIM9, DA},		/* 34 */
	{COEF,	0},		/* 35 10 day tens */
	{COEF,	1},		/* 36 20 */
	{COEF,	2},		/* 37 40 */
	{COEF,	3},		/* 38 80 */
	{DECIM9, DA + 1},	/* 39 p4 */
	{COEF,	0},		/* 40 100 day hundreds */
	{COEF,	1},		/* 41 200 */
	{COEF2,	2},		/* 42 400 (not used) */
	{COEF2,	3},		/* 43 800 (not used) */
	{DECIM3, DA + 2},	/* 44 */
	{IDLE,	0},		/* 45 */
	{IDLE,	0},		/* 46 */
	{IDLE,	0},		/* 47 */
	{IDLE,	0},		/* 48 */
	{IDLE,	0},		/* 49 p5 */
	{MSCBIT, DUTS},		/* 50 dut+- */
	{COEF,	0},		/* 51 10 year tens */
	{COEF,	1},		/* 52 20 */
	{COEF,	2},		/* 53 40 */
	{COEF,	3},		/* 54 80 */
	{MSC20, DST1},		/* 55 dst1 */
	{MSCBIT, DUT1},		/* 56 0.1 dut */
	{MSCBIT, DUT2},		/* 57 0.2 */
	{MSC21, DUT4},		/* 58 0.4 QSY probe channel */
	{MIN1,	0},		/* 59 p6 latch time */
	{MIN2,	0}		/* 60 leap second */
};

/*
 * BCD coefficients for maximum-likelihood digit decode
 */
#define P15	1.		/* max positive number */
#define N15	-1.		/* max negative number */

/*
 * Digits 0-9
 */
#define P9	(P15 / 4)	/* mark (+1) */
#define N9	(N15 / 4)	/* space (-1) */

double bcd9[][4] = {
	{N9, N9, N9, N9}, 	/* 0 */
	{P9, N9, N9, N9}, 	/* 1 */
	{N9, P9, N9, N9}, 	/* 2 */
	{P9, P9, N9, N9}, 	/* 3 */
	{N9, N9, P9, N9}, 	/* 4 */
	{P9, N9, P9, N9}, 	/* 5 */
	{N9, P9, P9, N9}, 	/* 6 */
	{P9, P9, P9, N9}, 	/* 7 */
	{N9, N9, N9, P9}, 	/* 8 */
	{P9, N9, N9, P9}, 	/* 9 */
	{0, 0, 0, 0}		/* backstop */
};

/*
 * Digits 0-6 (minute tens)
 */
#define P6	(P15 / 3)	/* mark (+1) */
#define N6	(N15 / 3)	/* space (-1) */

double bcd6[][4] = {
	{N6, N6, N6, 0}, 	/* 0 */
	{P6, N6, N6, 0}, 	/* 1 */
	{N6, P6, N6, 0}, 	/* 2 */
	{P6, P6, N6, 0}, 	/* 3 */
	{N6, N6, P6, 0}, 	/* 4 */
	{P6, N6, P6, 0}, 	/* 5 */
	{N6, P6, P6, 0}, 	/* 6 */
	{0, 0, 0, 0}		/* backstop */
};

/*
 * Digits 0-3 (day hundreds)
 */
#define P3	(P15 / 2)	/* mark (+1) */
#define N3	(N15 / 2)	/* space (-1) */

double bcd3[][4] = {
	{N3, N3, 0, 0}, 	/* 0 */
	{P3, N3, 0, 0}, 	/* 1 */
	{N3, P3, 0, 0}, 	/* 2 */
	{P3, P3, 0, 0}, 	/* 3 */
	{0, 0, 0, 0}		/* backstop */
};

/*
 * Digits 0-2 (hour tens)
 */
#define P2	(P15 / 2)	/* mark (+1) */
#define N2	(N15 / 2)	/* space (-1) */

double bcd2[][4] = {
	{N2, N2, 0, 0}, 	/* 0 */
	{P2, N2, 0, 0}, 	/* 1 */
	{N2, P2, 0, 0}, 	/* 2 */
	{0, 0, 0, 0}		/* backstop */
};

/*
 * DST decode (DST2 DST1) for prettyprint
 */
char dstcod[] = {
	'S',			/* 00 standard time */
	'I',			/* 01 set clock ahead at 0200 local */
	'O',			/* 10 set clock back at 0200 local */
	'D'			/* 11 daylight time */
};

/*
 * The decoding matrix consists of nine row vectors, one for each digit
 * of the timecode. The digits are stored from least to most significant
 * order. The maximum-likelihood timecode is formed from the digits
 * corresponding to the maximum-likelihood values reading in the
 * opposite order: yy ddd hh:mm.
 */
struct decvec {
	int radix;		/* radix (3, 4, 6, 10) */
	int digit;		/* current clock digit */
	int count;		/* match count */
	double digprb;		/* max digit probability */
	double digsnr;		/* likelihood function (dB) */
	double like[10];	/* likelihood integrator 0-9 */
};

/*
 * The station structure (sp) is used to acquire the minute pulse from
 * WWV and/or WWVH. These stations are distinguished by the frequency
 * used for the second and minute sync pulses, 1000 Hz for WWV and 1200
 * Hz for WWVH. Other than frequency, the format is the same.
 */
struct sync {
	double	epoch;		/* accumulated epoch differences */
	double	maxeng;		/* sync max energy */
	double	noieng;		/* sync noise energy */
	long	pos;		/* max amplitude position */
	long	lastpos;	/* last max position */
	long	mepoch;		/* minute synch epoch */

	double	amp;		/* sync signal */
	double	syneng;		/* sync signal max */
	double	synmax;		/* sync signal max latched at 0 s */
	double	synsnr;		/* sync signal SNR */
	double	metric;		/* signal quality metric */
	int	reach;		/* reachability register */
	int	count;		/* bit counter */
	int	select;		/* select bits */
	char	refid[5];	/* reference identifier */
};

/*
 * The channel structure (cp) is used to mitigate between channels.
 */
struct chan {
	int	gain;		/* audio gain */
	struct sync wwv;	/* wwv station */
	struct sync wwvh;	/* wwvh station */
};

/*
 * WWV unit control structure (up)
 */
struct wwvunit {
	l_fp	timestamp;	/* audio sample timestamp */
	l_fp	tick;		/* audio sample increment */
	double	phase, freq;	/* logical clock phase and frequency */
	double	monitor;	/* audio monitor point */
	double	pdelay;		/* propagation delay (s) */
#ifdef ICOM
	int	fd_icom;	/* ICOM file descriptor */
#endif /* ICOM */
	int	errflg;		/* error flags */
	int	watch;		/* watchcat */

	/*
	 * Audio codec variables
	 */
	double	comp[SIZE];	/* decompanding table */
 	int	port;		/* codec port */
	int	gain;		/* codec gain */
	int	mongain;	/* codec monitor gain */
	int	clipcnt;	/* sample clipped count */

	/*
	 * Variables used to establish basic system timing
	 */
	int	avgint;		/* master time constant */
	int	yepoch;		/* sync epoch */
	int	repoch;		/* buffered sync epoch */
	double	epomax;		/* second sync amplitude */
	double	eposnr;		/* second sync SNR */
	double	irig;		/* data I channel amplitude */
	double	qrig;		/* data Q channel amplitude */
	int	datapt;		/* 100 Hz ramp */
	double	datpha;		/* 100 Hz VFO control */
	int	rphase;		/* second sample counter */
	long	mphase;		/* minute sample counter */

	/*
	 * Variables used to mitigate which channel to use
	 */
	struct chan mitig[NCHAN]; /* channel data */
	struct sync *sptr;	/* station pointer */
	int	dchan;		/* data channel */
	int	schan;		/* probe channel */
	int	achan;		/* active channel */

	/*
	 * Variables used by the clock state machine
	 */
	struct decvec decvec[9]; /* decoding matrix */
	int	rsec;		/* seconds counter */
	int	digcnt;		/* count of digits synchronized */

	/*
	 * Variables used to estimate signal levels and bit/digit
	 * probabilities
	 */
	double	datsig;		/* data signal max */
	double	datsnr;		/* data signal SNR (dB) */

	/*
	 * Variables used to establish status and alarm conditions
	 */
	int	status;		/* status bits */
	int	alarm;		/* alarm flashers */
	int	misc;		/* miscellaneous timecode bits */
	int	errcnt;		/* data bit error counter */
};

/*
 * Function prototypes
 */
static	int	wwv_start	(int, struct peer *);
static	void	wwv_shutdown	(int, struct peer *);
static	void	wwv_receive	(struct recvbuf *);
static	void	wwv_poll	(int, struct peer *);

/*
 * More function prototypes
 */
static	void	wwv_epoch	(struct peer *);
static	void	wwv_rf		(struct peer *, double);
static	void	wwv_endpoc	(struct peer *, int);
static	void	wwv_rsec	(struct peer *, double);
static	void	wwv_qrz		(struct peer *, struct sync *, int);
static	void	wwv_corr4	(struct peer *, struct decvec *,
				    double [], double [][4]);
static	void	wwv_gain	(struct peer *);
static	void	wwv_tsec	(struct peer *);
static	int	timecode	(struct wwvunit *, char *);
static	double	wwv_snr		(double, double);
static	int	carry		(struct decvec *);
static	int	wwv_newchan	(struct peer *);
static	void	wwv_newgame	(struct peer *);
static	double	wwv_metric	(struct sync *);
static	void	wwv_clock	(struct peer *);
#ifdef ICOM
static	int	wwv_qsy		(struct peer *, int);
#endif /* ICOM */

static double qsy[NCHAN] = {2.5, 5, 10, 15, 20}; /* frequencies (MHz) */

/*
 * Transfer vector
 */
struct	refclock refclock_wwv = {
	wwv_start,		/* start up driver */
	wwv_shutdown,		/* shut down driver */
	wwv_poll,		/* transmit poll message */
	noentry,		/* not used (old wwv_control) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old wwv_buginfo) */
	NOFLAGS			/* not used */
};


/*
 * wwv_start - open the devices and initialize data for processing
 */
static int
wwv_start(
	int	unit,		/* instance number (used by PCM) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;
#ifdef ICOM
	int	temp;
#endif /* ICOM */

	/*
	 * Local variables
	 */
	int	fd;		/* file descriptor */
	int	i;		/* index */
	double	step;		/* codec adjustment */

	/*
	 * Open audio device
	 */
	fd = audio_init(DEVICE_AUDIO, AUDIO_BUFSIZ, unit);
	if (fd < 0)
		return (0);
#ifdef DEBUG
	if (debug)
		audio_show();
#endif /* DEBUG */

	/*
	 * Allocate and initialize unit structure
	 */
	if (!(up = (struct wwvunit *)emalloc(sizeof(struct wwvunit)))) {
		close(fd);
		return (0);
	}
	memset(up, 0, sizeof(struct wwvunit));
	pp = peer->procptr;
	pp->unitptr = (caddr_t)up;
	pp->io.clock_recv = wwv_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		free(up);
		return (0);
	}

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;

	/*
	 * The companded samples are encoded sign-magnitude. The table
	 * contains all the 256 values in the interest of speed.
	 */
	up->comp[0] = up->comp[OFFSET] = 0.;
	up->comp[1] = 1.; up->comp[OFFSET + 1] = -1.;
	up->comp[2] = 3.; up->comp[OFFSET + 2] = -3.;
	step = 2.;
	for (i = 3; i < OFFSET; i++) {
		up->comp[i] = up->comp[i - 1] + step;
		up->comp[OFFSET + i] = -up->comp[i];
                if (i % 16 == 0)
		    step *= 2.;
	}
	DTOLFP(1. / SECOND, &up->tick);

	/*
	 * Initialize the decoding matrix with the radix for each digit
	 * position.
	 */
	up->decvec[MN].radix = 10;	/* minutes */
	up->decvec[MN + 1].radix = 6;
	up->decvec[HR].radix = 10;	/* hours */
	up->decvec[HR + 1].radix = 3;
	up->decvec[DA].radix = 10;	/* days */
	up->decvec[DA + 1].radix = 10;
	up->decvec[DA + 2].radix = 4;
	up->decvec[YR].radix = 10;	/* years */
	up->decvec[YR + 1].radix = 10;

#ifdef ICOM
	/*
	 * Initialize autotune if available. Note that the ICOM select
	 * code must be less than 128, so the high order bit can be used
	 * to select the line speed 0 (9600 bps) or 1 (1200 bps). Note
	 * we don't complain if the ICOM device is not there; but, if it
	 * is, the radio better be working.
	 */
	temp = 0;
#ifdef DEBUG
	if (debug > 1)
		temp = P_TRACE;
#endif /* DEBUG */
	if (peer->ttl != 0) {
		if (peer->ttl & 0x80)
			up->fd_icom = icom_init("/dev/icom", B1200,
			    temp);
		else
			up->fd_icom = icom_init("/dev/icom", B9600,
			    temp);
	}
	if (up->fd_icom > 0) {
		if (wwv_qsy(peer, DCHAN) != 0) {
			msyslog(LOG_NOTICE, "icom: radio not found");
			close(up->fd_icom);
			up->fd_icom = 0;
		} else {
			msyslog(LOG_NOTICE, "icom: autotune enabled");
		}
	}
#endif /* ICOM */

	/*
	 * Let the games begin.
	 */
	wwv_newgame(peer);
	return (1);
}


/*
 * wwv_shutdown - shut down the clock
 */
static void
wwv_shutdown(
	int	unit,		/* instance number (not used) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;
	if (up == NULL)
		return;

	io_closeclock(&pp->io);
#ifdef ICOM
	if (up->fd_icom > 0)
		close(up->fd_icom);
#endif /* ICOM */
	free(up);
}


/*
 * wwv_receive - receive data from the audio device
 *
 * This routine reads input samples and adjusts the logical clock to
 * track the A/D sample clock by dropping or duplicating codec samples.
 * It also controls the A/D signal level with an AGC loop to mimimize
 * quantization noise and avoid overload.
 */
static void
wwv_receive(
	struct recvbuf *rbufp	/* receive buffer structure pointer */
	)
{
	struct peer *peer;
	struct refclockproc *pp;
	struct wwvunit *up;

	/*
	 * Local variables
	 */
	double	sample;		/* codec sample */
	u_char	*dpt;		/* buffer pointer */
	int	bufcnt;		/* buffer counter */
	l_fp	ltemp;

	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;

	/*
	 * Main loop - read until there ain't no more. Note codec
	 * samples are bit-inverted.
	 */
	DTOLFP((double)rbufp->recv_length / SECOND, <emp);
	L_SUB(&rbufp->recv_time, <emp);
	up->timestamp = rbufp->recv_time;
	dpt = rbufp->recv_buffer;
	for (bufcnt = 0; bufcnt < rbufp->recv_length; bufcnt++) {
		sample = up->comp[~*dpt++ & 0xff];

		/*
		 * Clip noise spikes greater than MAXAMP (6000) and
		 * record the number of clips to be used later by the
		 * AGC.
		 */
		if (sample > MAXAMP) {
			sample = MAXAMP;
			up->clipcnt++;
		} else if (sample < -MAXAMP) {
			sample = -MAXAMP;
			up->clipcnt++;
		}

		/*
		 * Variable frequency oscillator. The codec oscillator
		 * runs at the nominal rate of 8000 samples per second,
		 * or 125 us per sample. A frequency change of one unit
		 * results in either duplicating or deleting one sample
		 * per second, which results in a frequency change of
		 * 125 PPM.
		 */
		up->phase += (up->freq + clock_codec) / SECOND;
		if (up->phase >= .5) {
			up->phase -= 1.;
		} else if (up->phase < -.5) {
			up->phase += 1.;
			wwv_rf(peer, sample);
			wwv_rf(peer, sample);
		} else {
			wwv_rf(peer, sample);
		}
		L_ADD(&up->timestamp, &up->tick);
	}

	/*
	 * Set the input port and monitor gain for the next buffer.
	 */
	if (pp->sloppyclockflag & CLK_FLAG2)
		up->port = 2;
	else
		up->port = 1;
	if (pp->sloppyclockflag & CLK_FLAG3)
		up->mongain = MONGAIN;
	else
		up->mongain = 0;
}


/*
 * wwv_poll - called by the transmit procedure
 *
 * This routine keeps track of status. If no offset samples have been
 * processed during a poll interval, a timeout event is declared. If
 * errors have have occurred during the interval, they are reported as
 * well.
 */
static void
wwv_poll(
	int	unit,		/* instance number (not used) */
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;
	if (up->errflg)
		refclock_report(peer, up->errflg);
	up->errflg = 0;
	pp->polls++;
}


/*
 * wwv_rf - process signals and demodulate to baseband
 *
 * This routine grooms and filters decompanded raw audio samples. The
 * output signal is the 100-Hz filtered baseband data signal in
 * quadrature phase. The routine also determines the minute synch epoch,
 * as well as certain signal maxima, minima and related values.
 *
 * There are two 1-s ramps used by this program. Both count the 8000
 * logical clock samples spanning exactly one second. The epoch ramp
 * counts the samples starting at an arbitrary time. The rphase ramp
 * counts the samples starting at the 5-ms second sync pulse found
 * during the epoch ramp.
 *
 * There are two 1-m ramps used by this program. The mphase ramp counts
 * the 480,000 logical clock samples spanning exactly one minute and
 * starting at an arbitrary time. The rsec ramp counts the 60 seconds of
 * the minute starting at the 800-ms minute sync pulse found during the
 * mphase ramp. The rsec ramp drives the seconds state machine to
 * determine the bits and digits of the timecode. 
 *
 * Demodulation operations are based on three synthesized quadrature
 * sinusoids: 100 Hz for the data signal, 1000 Hz for the WWV sync
 * signal and 1200 Hz for the WWVH sync signal. These drive synchronous
 * matched filters for the data signal (170 ms at 100 Hz), WWV minute
 * sync signal (800 ms at 1000 Hz) and WWVH minute sync signal (800 ms
 * at 1200 Hz). Two additional matched filters are switched in
 * as required for the WWV second sync signal (5 cycles at 1000 Hz) and
 * WWVH second sync signal (6 cycles at 1200 Hz).
 */
static void
wwv_rf(
	struct peer *peer,	/* peerstructure pointer */
	double isig		/* input signal */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;
	struct sync *sp, *rp;

	static double lpf[5];	/* 150-Hz lpf delay line */
	double data;		/* lpf output */
	static double bpf[9];	/* 1000/1200-Hz bpf delay line */
	double syncx;		/* bpf output */
	static double mf[41];	/* 1000/1200-Hz mf delay line */
	double mfsync;		/* mf output */

	static int iptr;	/* data channel pointer */
	static double ibuf[DATSIZ]; /* data I channel delay line */
	static double qbuf[DATSIZ]; /* data Q channel delay line */

	static int jptr;	/* sync channel pointer */
	static int kptr;	/* tick channel pointer */

	static int csinptr;	/* wwv channel phase */
	static double cibuf[SYNSIZ]; /* wwv I channel delay line */
	static double cqbuf[SYNSIZ]; /* wwv Q channel delay line */
	static double ciamp;	/* wwv I channel amplitude */
	static double cqamp;	/* wwv Q channel amplitude */

	static double csibuf[TCKSIZ]; /* wwv I tick delay line */
	static double csqbuf[TCKSIZ]; /* wwv Q tick delay line */
	static double csiamp;	/* wwv I tick amplitude */
	static double csqamp;	/* wwv Q tick amplitude */

	static int hsinptr;	/* wwvh channel phase */
	static double hibuf[SYNSIZ]; /* wwvh I channel delay line */
	static double hqbuf[SYNSIZ]; /* wwvh Q channel delay line */
	static double hiamp;	/* wwvh I channel amplitude */
	static double hqamp;	/* wwvh Q channel amplitude */

	static double hsibuf[TCKSIZ]; /* wwvh I tick delay line */
	static double hsqbuf[TCKSIZ]; /* wwvh Q tick delay line */
	static double hsiamp;	/* wwvh I tick amplitude */
	static double hsqamp;	/* wwvh Q tick amplitude */

	static double epobuf[SECOND]; /* second sync comb filter */
	static double epomax, nxtmax; /* second sync amplitude buffer */
	static int epopos;	/* epoch second sync position buffer */

	static int iniflg;	/* initialization flag */
	int	epoch;		/* comb filter index */
	double	dtemp;
	int	i;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;

	if (!iniflg) {
		iniflg = 1;
		memset((char *)lpf, 0, sizeof(lpf));
		memset((char *)bpf, 0, sizeof(bpf));
		memset((char *)mf, 0, sizeof(mf));
		memset((char *)ibuf, 0, sizeof(ibuf));
		memset((char *)qbuf, 0, sizeof(qbuf));
		memset((char *)cibuf, 0, sizeof(cibuf));
		memset((char *)cqbuf, 0, sizeof(cqbuf));
		memset((char *)csibuf, 0, sizeof(csibuf));
		memset((char *)csqbuf, 0, sizeof(csqbuf));
		memset((char *)hibuf, 0, sizeof(hibuf));
		memset((char *)hqbuf, 0, sizeof(hqbuf));
		memset((char *)hsibuf, 0, sizeof(hsibuf));
		memset((char *)hsqbuf, 0, sizeof(hsqbuf));
		memset((char *)epobuf, 0, sizeof(epobuf));
	}

	/*
	 * Baseband data demodulation. The 100-Hz subcarrier is
	 * extracted using a 150-Hz IIR lowpass filter. This attenuates
	 * the 1000/1200-Hz sync signals, as well as the 440-Hz and
	 * 600-Hz tones and most of the noise and voice modulation
	 * components.
	 *
	 * The subcarrier is transmitted 10 dB down from the carrier.
	 * The DGAIN parameter can be adjusted for this and to
	 * compensate for the radio audio response at 100 Hz.
	 *
	 * Matlab IIR 4th-order IIR elliptic, 150 Hz lowpass, 0.2 dB
	 * passband ripple, -50 dB stopband ripple, phase delay 0.97 ms.
	 */
	data = (lpf[4] = lpf[3]) * 8.360961e-01;
	data += (lpf[3] = lpf[2]) * -3.481740e+00;
	data += (lpf[2] = lpf[1]) * 5.452988e+00;
	data += (lpf[1] = lpf[0]) * -3.807229e+00;
	lpf[0] = isig * DGAIN - data;
	data = lpf[0] * 3.281435e-03
	    + lpf[1] * -1.149947e-02
	    + lpf[2] * 1.654858e-02
	    + lpf[3] * -1.149947e-02
	    + lpf[4] * 3.281435e-03;

	/*
	 * The 100-Hz data signal is demodulated using a pair of
	 * quadrature multipliers, matched filters and a phase lock
	 * loop. The I and Q quadrature data signals are produced by
	 * multiplying the filtered signal by 100-Hz sine and cosine
	 * signals, respectively. The signals are processed by 170-ms
	 * synchronous matched filters to produce the amplitude and
	 * phase signals used by the demodulator. The signals are scaled
	 * to produce unit energy at the maximum value.
	 */
	i = up->datapt;
	up->datapt = (up->datapt + IN100) % 80;
	dtemp = sintab[i] * data / (MS / 2. * DATCYC);
	up->irig -= ibuf[iptr];
	ibuf[iptr] = dtemp;
	up->irig += dtemp;

	i = (i + 20) % 80;
	dtemp = sintab[i] * data / (MS / 2. * DATCYC);
	up->qrig -= qbuf[iptr];
	qbuf[iptr] = dtemp;
	up->qrig += dtemp;
	iptr = (iptr + 1) % DATSIZ;

	/*
	 * Baseband sync demodulation. The 1000/1200 sync signals are
	 * extracted using a 600-Hz IIR bandpass filter. This removes
	 * the 100-Hz data subcarrier, as well as the 440-Hz and 600-Hz
	 * tones and most of the noise and voice modulation components.
	 *
	 * Matlab 4th-order IIR elliptic, 800-1400 Hz bandpass, 0.2 dB
	 * passband ripple, -50 dB stopband ripple, phase delay 0.91 ms.
	 */
	syncx = (bpf[8] = bpf[7]) * 4.897278e-01;
	syncx += (bpf[7] = bpf[6]) * -2.765914e+00;
	syncx += (bpf[6] = bpf[5]) * 8.110921e+00;
	syncx += (bpf[5] = bpf[4]) * -1.517732e+01;
	syncx += (bpf[4] = bpf[3]) * 1.975197e+01;
	syncx += (bpf[3] = bpf[2]) * -1.814365e+01;
	syncx += (bpf[2] = bpf[1]) * 1.159783e+01;
	syncx += (bpf[1] = bpf[0]) * -4.735040e+00;
	bpf[0] = isig - syncx;
	syncx = bpf[0] * 8.203628e-03
	    + bpf[1] * -2.375732e-02
	    + bpf[2] * 3.353214e-02
	    + bpf[3] * -4.080258e-02
	    + bpf[4] * 4.605479e-02
	    + bpf[5] * -4.080258e-02
	    + bpf[6] * 3.353214e-02
	    + bpf[7] * -2.375732e-02
	    + bpf[8] * 8.203628e-03;

	/*
	 * The 1000/1200 sync signals are demodulated using a pair of
	 * quadrature multipliers and matched filters. However,
	 * synchronous demodulation at these frequencies is impractical,
	 * so only the signal amplitude is used. The I and Q quadrature
	 * sync signals are produced by multiplying the filtered signal
	 * by 1000-Hz (WWV) and 1200-Hz (WWVH) sine and cosine signals,
	 * respectively. The WWV and WWVH signals are processed by 800-
	 * ms synchronous matched filters and combined to produce the
	 * minute sync signal and detect which one (or both) the WWV or
	 * WWVH signal is present. The WWV and WWVH signals are also
	 * processed by 5-ms synchronous matched filters and combined to
	 * produce the second sync signal. The signals are scaled to
	 * produce unit energy at the maximum value.
	 *
	 * Note the master timing ramps, which run continuously. The
	 * minute counter (mphase) counts the samples in the minute,
	 * while the second counter (epoch) counts the samples in the
	 * second.
	 */
	up->mphase = (up->mphase + 1) % MINUTE;
	epoch = up->mphase % SECOND;

	/*
	 * WWV
	 */
	i = csinptr;
	csinptr = (csinptr + IN1000) % 80;

	dtemp = sintab[i] * syncx / (MS / 2.);
	ciamp -= cibuf[jptr];
	cibuf[jptr] = dtemp;
	ciamp += dtemp;
	csiamp -= csibuf[kptr];
	csibuf[kptr] = dtemp;
	csiamp += dtemp;

	i = (i + 20) % 80;
	dtemp = sintab[i] * syncx / (MS / 2.);
	cqamp -= cqbuf[jptr];
	cqbuf[jptr] = dtemp;
	cqamp += dtemp;
	csqamp -= csqbuf[kptr];
	csqbuf[kptr] = dtemp;
	csqamp += dtemp;

	sp = &up->mitig[up->achan].wwv;
	sp->amp = sqrt(ciamp * ciamp + cqamp * cqamp) / SYNCYC;
	if (!(up->status & MSYNC))
		wwv_qrz(peer, sp, (int)(pp->fudgetime1 * SECOND));

	/*
	 * WWVH
	 */
	i = hsinptr;
	hsinptr = (hsinptr + IN1200) % 80;

	dtemp = sintab[i] * syncx / (MS / 2.);
	hiamp -= hibuf[jptr];
	hibuf[jptr] = dtemp;
	hiamp += dtemp;
	hsiamp -= hsibuf[kptr];
	hsibuf[kptr] = dtemp;
	hsiamp += dtemp;

	i = (i + 20) % 80;
	dtemp = sintab[i] * syncx / (MS / 2.);
	hqamp -= hqbuf[jptr];
	hqbuf[jptr] = dtemp;
	hqamp += dtemp;
	hsqamp -= hsqbuf[kptr];
	hsqbuf[kptr] = dtemp;
	hsqamp += dtemp;

	rp = &up->mitig[up->achan].wwvh;
	rp->amp = sqrt(hiamp * hiamp + hqamp * hqamp) / SYNCYC;
	if (!(up->status & MSYNC))
		wwv_qrz(peer, rp, (int)(pp->fudgetime2 * SECOND));
	jptr = (jptr + 1) % SYNSIZ;
	kptr = (kptr + 1) % TCKSIZ;

	/*
	 * The following section is called once per minute. It does
	 * housekeeping and timeout functions and empties the dustbins.
	 */
	if (up->mphase == 0) {
		up->watch++;
		if (!(up->status & MSYNC)) {

			/*
			 * If minute sync has not been acquired before
			 * ACQSN timeout (6 min), or if no signal is
			 * heard, the program cycles to the next
			 * frequency and tries again.
			 */
			if (!wwv_newchan(peer))
				up->watch = 0;
		} else {

			/*
			 * If the leap bit is set, set the minute epoch
			 * back one second so the station processes
			 * don't miss a beat.
			 */
			if (up->status & LEPSEC) {
				up->mphase -= SECOND;
				if (up->mphase < 0)
					up->mphase += MINUTE;
			}
		}
	}

	/*
	 * When the channel metric reaches threshold and the second
	 * counter matches the minute epoch within the second, the
	 * driver has synchronized to the station. The second number is
	 * the remaining seconds until the next minute epoch, while the
	 * sync epoch is zero. Watch out for the first second; if
	 * already synchronized to the second, the buffered sync epoch
	 * must be set.
	 *
	 * Note the guard interval is 200 ms; if for some reason the
	 * clock drifts more than that, it might wind up in the wrong
	 * second. If the maximum frequency error is not more than about
	 * 1 PPM, the clock can go as much as two days while still in
	 * the same second.
	 */
	if (up->status & MSYNC) {
		wwv_epoch(peer);
	} else if (up->sptr != NULL) {
		sp = up->sptr;
		if (sp->metric >= TTHR && epoch == sp->mepoch % SECOND)
 		    {
			up->rsec = (60 - sp->mepoch / SECOND) % 60;
			up->rphase = 0;
			up->status |= MSYNC;
			up->watch = 0;
			if (!(up->status & SSYNC))
				up->repoch = up->yepoch = epoch;
			else
				up->repoch = up->yepoch;
			
		}
	}

	/*
	 * The second sync pulse is extracted using 5-ms (40 sample) FIR
	 * matched filters at 1000 Hz for WWV or 1200 Hz for WWVH. This
	 * pulse is used for the most precise synchronization, since if
	 * provides a resolution of one sample (125 us). The filters run
	 * only if the station has been reliably determined.
	 */
	if (up->status & SELV)
		mfsync = sqrt(csiamp * csiamp + csqamp * csqamp) /
		    TCKCYC;
	else if (up->status & SELH)
		mfsync = sqrt(hsiamp * hsiamp + hsqamp * hsqamp) /
		    TCKCYC;
	else
		mfsync = 0;

	/*
	 * Enhance the seconds sync pulse using a 1-s (8000-sample) comb
	 * filter. Correct for the FIR matched filter delay, which is 5
	 * ms for both the WWV and WWVH filters, and also for the
	 * propagation delay. Once each second look for second sync. If
	 * not in minute sync, fiddle the codec gain. Note the SNR is
	 * computed from the maximum sample and the envelope of the
	 * sample 6 ms before it, so if we slip more than a cycle the
	 * SNR should plummet. The signal is scaled to produce unit
	 * energy at the maximum value.
	 */
	dtemp = (epobuf[epoch] += (mfsync - epobuf[epoch]) /
	    up->avgint);
	if (dtemp > epomax) {
		int	j;

		epomax = dtemp;
		epopos = epoch;
		j = epoch - 6 * MS;
		if (j < 0)
			j += SECOND;
		nxtmax = fabs(epobuf[j]);
	}
	if (epoch == 0) {
		up->epomax = epomax;
		up->eposnr = wwv_snr(epomax, nxtmax);
		epopos -= TCKCYC * MS;
		if (epopos < 0)
			epopos += SECOND;
		wwv_endpoc(peer, epopos);
		if (!(up->status & SSYNC))
			up->alarm |= SYNERR;
		epomax = 0;
		if (!(up->status & MSYNC))
			wwv_gain(peer);
	}
}


/*
 * wwv_qrz - identify and acquire WWV/WWVH minute sync pulse
 *
 * This routine implements a virtual station process used to acquire
 * minute sync and to mitigate among the ten frequency and station
 * combinations. During minute sync acquisition the process probes each
 * frequency and station in turn for the minute pulse, which
 * involves searching through the entire 480,000-sample minute. The
 * process finds the maximum signal and RMS noise plus signal. Then, the
 * actual noise is determined by subtracting the energy of the matched
 * filter.
 *
 * Students of radar receiver technology will discover this algorithm
 * amounts to a range-gate discriminator. A valid pulse must have peak
 * amplitude at least QTHR (2500) and SNR at least QSNR (20) dB and the
 * difference between the current and previous epoch must be less than
 * AWND (20 ms). Note that the discriminator peak occurs about 800 ms
 * into the second, so the timing is retarded to the previous second
 * epoch.
 */
static void
wwv_qrz(
	struct peer *peer,	/* peer structure pointer */
	struct sync *sp,	/* sync channel structure */
	int	pdelay		/* propagation delay (samples) */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;
	char	tbuf[TBUF];	/* monitor buffer */
	long	epoch;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;

	/*
	 * Find the sample with peak amplitude, which defines the minute
	 * epoch. Accumulate all samples to determine the total noise
	 * energy.
	 */
	epoch = up->mphase - pdelay - SYNSIZ;
	if (epoch < 0)
		epoch += MINUTE;
	if (sp->amp > sp->maxeng) {
		sp->maxeng = sp->amp;
		sp->pos = epoch;
	}
	sp->noieng += sp->amp;

	/*
	 * At the end of the minute, determine the epoch of the minute
	 * sync pulse, as well as the difference between the current and
	 * previous epoches due to the intrinsic frequency error plus
	 * jitter. When calculating the SNR, subtract the pulse energy
	 * from the total noise energy and then normalize.
	 */
	if (up->mphase == 0) {
		sp->synmax = sp->maxeng;
		sp->synsnr = wwv_snr(sp->synmax, (sp->noieng -
		    sp->synmax) / MINUTE);
		if (sp->count == 0)
			sp->lastpos = sp->pos;
		epoch = (sp->pos - sp->lastpos) % MINUTE;
		sp->reach <<= 1;
		if (sp->reach & (1 << AMAX))
			sp->count--;
		if (sp->synmax > ATHR && sp->synsnr > ASNR) {
			if (abs(epoch) < AWND * MS) {
				sp->reach |= 1;
				sp->count++;
				sp->mepoch = sp->lastpos = sp->pos;
			} else if (sp->count == 1) {
				sp->lastpos = sp->pos;
			}
		}
		if (up->watch > ACQSN)
			sp->metric = 0;
		else
			sp->metric = wwv_metric(sp);
		if (pp->sloppyclockflag & CLK_FLAG4) {
			sprintf(tbuf,
			    "wwv8 %04x %3d %s %04x %.0f %.0f/%.1f %ld %ld",
			    up->status, up->gain, sp->refid,
			    sp->reach & 0xffff, sp->metric, sp->synmax,
			    sp->synsnr, sp->pos % SECOND, epoch);
			record_clock_stats(&peer->srcadr, tbuf);
#ifdef DEBUG
			if (debug)
				printf("%s\n", tbuf);
#endif /* DEBUG */
		}
		sp->maxeng = sp->noieng = 0;
	}
}


/*
 * wwv_endpoc - identify and acquire second sync pulse
 *
 * This routine is called at the end of the second sync interval. It
 * determines the second sync epoch position within the second and
 * disciplines the sample clock using a frequency-lock loop (FLL).
 *
 * Second sync is determined in the RF input routine as the maximum
 * over all 8000 samples in the second comb filter. To assure accurate
 * and reliable time and frequency discipline, this routine performs a
 * great deal of heavy-handed heuristic data filtering and grooming.
 */
static void
wwv_endpoc(
	struct peer *peer,	/* peer structure pointer */
	int epopos		/* epoch max position */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;
	static int epoch_mf[3]; /* epoch median filter */
	static int tepoch;	/* current second epoch */
 	static int xepoch;	/* last second epoch */
 	static int zepoch;	/* last run epoch */
	static int zcount;	/* last run end time */
	static int scount;	/* seconds counter */
	static int syncnt;	/* run length counter */
	static int maxrun;	/* longest run length */
	static int mepoch;	/* longest run end epoch */
	static int mcount;	/* longest run end time */
	static int avgcnt;	/* averaging interval counter */
	static int avginc;	/* averaging ratchet */
	static int iniflg;	/* initialization flag */
	char tbuf[TBUF];		/* monitor buffer */
	double dtemp;
	int tmp2;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;
	if (!iniflg) {
		iniflg = 1;
		memset((char *)epoch_mf, 0, sizeof(epoch_mf));
	}

	/*
	 * If the signal amplitude or SNR fall below thresholds, dim the
	 * second sync lamp and wait for hotter ions. If no stations are
	 * heard, we are either in a probe cycle or the ions are really
	 * cold. 
	 */
	scount++;
	if (up->epomax < STHR || up->eposnr < SSNR) {
		up->status &= ~(SSYNC | FGATE);
		avgcnt = syncnt = maxrun = 0;
		return;
	}
	if (!(up->status & (SELV | SELH)))
		return;

	/*
	 * A three-stage median filter is used to help denoise the
	 * second sync pulse. The median sample becomes the candidate
	 * epoch.
	 */
	epoch_mf[2] = epoch_mf[1];
	epoch_mf[1] = epoch_mf[0];
	epoch_mf[0] = epopos;
	if (epoch_mf[0] > epoch_mf[1]) {
		if (epoch_mf[1] > epoch_mf[2])
			tepoch = epoch_mf[1];	/* 0 1 2 */
		else if (epoch_mf[2] > epoch_mf[0])
			tepoch = epoch_mf[0];	/* 2 0 1 */
		else
			tepoch = epoch_mf[2];	/* 0 2 1 */
	} else {
		if (epoch_mf[1] < epoch_mf[2])
			tepoch = epoch_mf[1];	/* 2 1 0 */
		else if (epoch_mf[2] < epoch_mf[0])
			tepoch = epoch_mf[0];	/* 1 0 2 */
		else
			tepoch = epoch_mf[2];	/* 1 2 0 */
	}


	/*
	 * If the epoch candidate is the same as the last one, increment
	 * the run counter. If not, save the length, epoch and end
	 * time of the current run for use later and reset the counter.
	 * The epoch is considered valid if the run is at least SCMP
	 * (10) s, the minute is synchronized and the interval since the
	 * last epoch  is not greater than the averaging interval. Thus,
	 * after a long absence, the program will wait a full averaging
	 * interval while the comb filter charges up and noise
	 * dissapates..
	 */
	tmp2 = (tepoch - xepoch) % SECOND;
	if (tmp2 == 0) {
		syncnt++;
		if (syncnt > SCMP && up->status & MSYNC && (up->status &
		    FGATE || scount - zcount <= up->avgint)) {
			up->status |= SSYNC;
			up->yepoch = tepoch;
		}
	} else if (syncnt >= maxrun) {
		maxrun = syncnt;
		mcount = scount;
		mepoch = xepoch;
		syncnt = 0;
	}
	if ((pp->sloppyclockflag & CLK_FLAG4) && !(up->status &
	    MSYNC)) {
		sprintf(tbuf,
		    "wwv1 %04x %3d %4d %5.0f %5.1f %5d %4d %4d %4d",
		    up->status, up->gain, tepoch, up->epomax,
		    up->eposnr, tmp2, avgcnt, syncnt,
		    maxrun);
		record_clock_stats(&peer->srcadr, tbuf);
#ifdef DEBUG
		if (debug)
			printf("%s\n", tbuf);
#endif /* DEBUG */
	}
	avgcnt++;
	if (avgcnt < up->avgint) {
		xepoch = tepoch;
		return;
	}

	/*
	 * The sample clock frequency is disciplined using a first-order
	 * feedback loop with time constant consistent with the Allan
	 * intercept of typical computer clocks. During each averaging
	 * interval the candidate epoch at the end of the longest run is
	 * determined. If the longest run is zero, all epoches in the
	 * interval are different, so the candidate epoch is the current
	 * epoch. The frequency update is computed from the candidate
	 * epoch difference (125-us units) and time difference (seconds)
	 * between updates.
	 */
	if (syncnt >= maxrun) {
		maxrun = syncnt;
		mcount = scount;
		mepoch = xepoch;
	}
	xepoch = tepoch;
	if (maxrun == 0) {
		mepoch = tepoch;
		mcount = scount;
	}

	/*
	 * The master clock runs at the codec sample frequency of 8000
	 * Hz, so the intrinsic time resolution is 125 us. The frequency
	 * resolution ranges from 18 PPM at the minimum averaging
	 * interval of 8 s to 0.12 PPM at the maximum interval of 1024
	 * s. An offset update is determined at the end of the longest
	 * run in each averaging interval. The frequency adjustment is
	 * computed from the difference between offset updates and the
	 * interval between them.
	 *
	 * The maximum frequency adjustment ranges from 187 PPM at the
	 * minimum interval to 1.5 PPM at the maximum. If the adjustment
	 * exceeds the maximum, the update is discarded and the
	 * hysteresis counter is decremented. Otherwise, the frequency
	 * is incremented by the adjustment, but clamped to the maximum
	 * 187.5 PPM. If the update is less than half the maximum, the
	 * hysteresis counter is incremented. If the counter increments
	 * to +3, the averaging interval is doubled and the counter set
	 * to zero; if it decrements to -3, the interval is halved and
	 * the counter set to zero.
	 */
	dtemp = (mepoch - zepoch) % SECOND;
	if (up->status & FGATE) {
		if (abs(dtemp) < MAXFREQ * MINAVG) {
			up->freq += (dtemp / 2.) / ((mcount - zcount) *
			    FCONST);
			if (up->freq > MAXFREQ)
				up->freq = MAXFREQ;
			else if (up->freq < -MAXFREQ)
				up->freq = -MAXFREQ;
			if (abs(dtemp) < MAXFREQ * MINAVG / 2.) {
				if (avginc < 3) {
					avginc++;
				} else {
					if (up->avgint < MAXAVG) {
						up->avgint <<= 1;
						avginc = 0;
					}
				}
			}
		} else {
			if (avginc > -3) {
				avginc--;
			} else {
				if (up->avgint > MINAVG) {
					up->avgint >>= 1;
					avginc = 0;
				}
			}
		}
	}
	if (pp->sloppyclockflag & CLK_FLAG4) {
		sprintf(tbuf,
		    "wwv2 %04x %5.0f %5.1f %5d %4d %4d %4d %4.0f %7.2f",
		    up->status, up->epomax, up->eposnr, mepoch,
		    up->avgint, maxrun, mcount - zcount, dtemp,
		    up->freq * 1e6 / SECOND);
		record_clock_stats(&peer->srcadr, tbuf);
#ifdef DEBUG
		if (debug)
			printf("%s\n", tbuf);
#endif /* DEBUG */
	}

	/*
	 * This is a valid update; set up for the next interval.
	 */
	up->status |= FGATE;
	zepoch = mepoch;
	zcount = mcount;
	avgcnt = syncnt = maxrun = 0;
}


/*
 * wwv_epoch - epoch scanner
 *
 * This routine extracts data signals from the 100-Hz subcarrier. It
 * scans the receiver second epoch to determine the signal amplitudes
 * and pulse timings. Receiver synchronization is determined by the
 * minute sync pulse detected in the wwv_rf() routine and the second
 * sync pulse detected in the wwv_epoch() routine. The transmitted
 * signals are delayed by the propagation delay, receiver delay and
 * filter delay of this program. Delay corrections are introduced
 * separately for WWV and WWVH. 
 *
 * Most communications radios use a highpass filter in the audio stages,
 * which can do nasty things to the subcarrier phase relative to the
 * sync pulses. Therefore, the data subcarrier reference phase is
 * disciplined using the hardlimited quadrature-phase signal sampled at
 * the same time as the in-phase signal. The phase tracking loop uses
 * phase adjustments of plus-minus one sample (125 us). 
 */
static void
wwv_epoch(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;
	struct chan *cp;
	static double sigmin, sigzer, sigone, engmax, engmin;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;

	/*
	 * Find the maximum minute sync pulse energy for both the
	 * WWV and WWVH stations. This will be used later for channel
	 * and station mitigation. Also set the seconds epoch at 800 ms
	 * well before the end of the second to make sure we never set
	 * the epoch backwards.
	 */
	cp = &up->mitig[up->achan];
	if (cp->wwv.amp > cp->wwv.syneng) 
		cp->wwv.syneng = cp->wwv.amp;
	if (cp->wwvh.amp > cp->wwvh.syneng) 
		cp->wwvh.syneng = cp->wwvh.amp;
	if (up->rphase == 800 * MS)
		up->repoch = up->yepoch;

	/*
	 * Use the signal amplitude at epoch 15 ms as the noise floor.
	 * This gives a guard time of +-15 ms from the beginning of the
	 * second until the second pulse rises at 30 ms. There is a
	 * compromise here; we want to delay the sample as long as
	 * possible to give the radio time to change frequency and the
	 * AGC to stabilize, but as early as possible if the second
	 * epoch is not exact.
	 */
	if (up->rphase == 15 * MS)
		sigmin = sigzer = sigone = up->irig;

	/*
	 * Latch the data signal at 200 ms. Keep this around until the
	 * end of the second. Use the signal energy as the peak to
	 * compute the SNR. Use the Q sample to adjust the 100-Hz
	 * reference oscillator phase.
	 */
	if (up->rphase == 200 * MS) {
		sigzer = up->irig;
		engmax = sqrt(up->irig * up->irig + up->qrig *
		    up->qrig);
		up->datpha = up->qrig / up->avgint;
		if (up->datpha >= 0) {
			up->datapt++;
			if (up->datapt >= 80)
				up->datapt -= 80;
		} else {
			up->datapt--;
			if (up->datapt < 0)
				up->datapt += 80;
		}
	}


	/*
	 * Latch the data signal at 500 ms. Keep this around until the
	 * end of the second.
	 */
	else if (up->rphase == 500 * MS)
		sigone = up->irig;

	/*
	 * At the end of the second crank the clock state machine and
	 * adjust the codec gain. Note the epoch is buffered from the
	 * center of the second in order to avoid jitter while the
	 * seconds synch is diddling the epoch. Then, determine the true
	 * offset and update the median filter in the driver interface.
	 *
	 * Use the energy at the end of the second as the noise to
	 * compute the SNR for the data pulse. This gives a better
	 * measurement than the beginning of the second, especially when
	 * returning from the probe channel. This gives a guard time of
	 * 30 ms from the decay of the longest pulse to the rise of the
	 * next pulse.
	 */
	up->rphase++;
	if (up->mphase % SECOND == up->repoch) {
		up->status &= ~(DGATE | BGATE);
		engmin = sqrt(up->irig * up->irig + up->qrig *
		    up->qrig);
		up->datsig = engmax;
		up->datsnr = wwv_snr(engmax, engmin);

		/*
		 * If the amplitude or SNR is below threshold, average a
		 * 0 in the the integrators; otherwise, average the
		 * bipolar signal. This is done to avoid noise polution.
		 */
		if (engmax < DTHR || up->datsnr < DSNR) {
			up->status |= DGATE;
			wwv_rsec(peer, 0);
		} else {
			sigzer -= sigone;
			sigone -= sigmin;
			wwv_rsec(peer, sigone - sigzer);
		}
		if (up->status & (DGATE | BGATE))
			up->errcnt++;
		if (up->errcnt > MAXERR)
			up->alarm |= LOWERR;
		wwv_gain(peer);
		cp = &up->mitig[up->achan];
		cp->wwv.syneng = 0;
		cp->wwvh.syneng = 0;
		up->rphase = 0;
	}
}


/*
 * wwv_rsec - process receiver second
 *
 * This routine is called at the end of each receiver second to
 * implement the per-second state machine. The machine assembles BCD
 * digit bits, decodes miscellaneous bits and dances the leap seconds.
 *
 * Normally, the minute has 60 seconds numbered 0-59. If the leap
 * warning bit is set, the last minute (1439) of 30 June (day 181 or 182
 * for leap years) or 31 December (day 365 or 366 for leap years) is
 * augmented by one second numbered 60. This is accomplished by
 * extending the minute interval by one second and teaching the state
 * machine to ignore it.
 */
static void
wwv_rsec(
	struct peer *peer,	/* peer structure pointer */
	double bit
	)
{
	static int iniflg;	/* initialization flag */
	static double bcddld[4]; /* BCD data bits */
	static double bitvec[61]; /* bit integrator for misc bits */
	struct refclockproc *pp;
	struct wwvunit *up;
	struct chan *cp;
	struct sync *sp, *rp;
	char	tbuf[TBUF];	/* monitor buffer */
	int	sw, arg, nsec;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;
	if (!iniflg) {
		iniflg = 1;
		memset((char *)bitvec, 0, sizeof(bitvec));
	}

	/*
	 * The bit represents the probability of a hit on zero (negative
	 * values), a hit on one (positive values) or a miss (zero
	 * value). The likelihood vector is the exponential average of
	 * these probabilities. Only the bits of this vector
	 * corresponding to the miscellaneous bits of the timecode are
	 * used, but it's easier to do them all. After that, crank the
	 * seconds state machine.
	 */
	nsec = up->rsec;
	up->rsec++;
	bitvec[nsec] += (bit - bitvec[nsec]) / TCONST;
	sw = progx[nsec].sw;
	arg = progx[nsec].arg;

	/*
	 * The minute state machine. Fly off to a particular section as
	 * directed by the transition matrix and second number.
	 */
	switch (sw) {

	/*
	 * Ignore this second.
	 */
	case IDLE:			/* 9, 45-49 */
		break;

	/*
	 * Probe channel stuff
	 *
	 * The WWV/H format contains data pulses in second 59 (position
	 * identifier) and second 1, but not in second 0. The minute
	 * sync pulse is contained in second 0. At the end of second 58
	 * QSY to the probe channel, which rotates in turn over all
	 * WWV/H frequencies. At the end of second 0 measure the minute
	 * sync pulse. At the end of second 1 measure the data pulse and
	 * QSY back to the data channel. Note that the actions commented
	 * here happen at the end of the second numbered as shown.
	 *
	 * At the end of second 0 save the minute sync amplitude latched
	 * at 800 ms as the signal later used to calculate the SNR. 
	 */
	case SYNC2:			/* 0 */
		cp = &up->mitig[up->achan];
		cp->wwv.synmax = cp->wwv.syneng;
		cp->wwvh.synmax = cp->wwvh.syneng;
		break;

	/*
	 * At the end of second 1 use the minute sync amplitude latched
	 * at 800 ms as the noise to calculate the SNR. If the minute
	 * sync pulse and SNR are above thresholds and the data pulse
	 * amplitude and SNR are above thresolds, shift a 1 into the
	 * station reachability register; otherwise, shift a 0. The
	 * number of 1 bits in the last six intervals is a component of
	 * the channel metric computed by the wwv_metric() routine.
	 * Finally, QSY back to the data channel.
	 */
	case SYNC3:			/* 1 */
		cp = &up->mitig[up->achan];

		/*
		 * WWV station
		 */
		sp = &cp->wwv;
		sp->synsnr = wwv_snr(sp->synmax, sp->amp);
		sp->reach <<= 1;
		if (sp->reach & (1 << AMAX))
			sp->count--;
		if (sp->synmax >= QTHR && sp->synsnr >= QSNR &&
		    !(up->status & (DGATE | BGATE))) {
			sp->reach |= 1;
			sp->count++;
		}
		sp->metric = wwv_metric(sp);

		/*
		 * WWVH station
		 */
		rp = &cp->wwvh;
		rp->synsnr = wwv_snr(rp->synmax, rp->amp);
		rp->reach <<= 1;
		if (rp->reach & (1 << AMAX))
			rp->count--;
		if (rp->synmax >= QTHR && rp->synsnr >= QSNR &&
		    !(up->status & (DGATE | BGATE))) {
			rp->reach |= 1;
			rp->count++;
		}
		rp->metric = wwv_metric(rp);
		if (pp->sloppyclockflag & CLK_FLAG4) {
			sprintf(tbuf,
			    "wwv5 %04x %3d %4d %.0f/%.1f %.0f/%.1f %s %04x %.0f %.0f/%.1f %s %04x %.0f %.0f/%.1f",
			    up->status, up->gain, up->yepoch,
			    up->epomax, up->eposnr, up->datsig,
			    up->datsnr,
			    sp->refid, sp->reach & 0xffff,
			    sp->metric, sp->synmax, sp->synsnr,
			    rp->refid, rp->reach & 0xffff,
			    rp->metric, rp->synmax, rp->synsnr);
			record_clock_stats(&peer->srcadr, tbuf);
#ifdef DEBUG
			if (debug)
				printf("%s\n", tbuf);
#endif /* DEBUG */
		}
		up->errcnt = up->digcnt = up->alarm = 0;

		/*
		 * If synchronized to a station, restart if no stations
		 * have been heard within the PANIC timeout (2 days). If
		 * not and the minute digit has been found, restart if
		 * not synchronized withing the SYNCH timeout (40 m). If
		 * not, restart if the unit digit has not been found
		 * within the DATA timeout (15 m).
		 */
		if (up->status & INSYNC) {
			if (up->watch > PANIC) {
				wwv_newgame(peer);
				return;
			}
		} else if (up->status & DSYNC) {
			if (up->watch > SYNCH) {
				wwv_newgame(peer);
				return;
			}
		} else if (up->watch > DATA) {
			wwv_newgame(peer);
			return;
		}
		wwv_newchan(peer);
		break;

	/*
	 * Save the bit probability in the BCD data vector at the index
	 * given by the argument. Bits not used in the digit are forced
	 * to zero.
	 */
	case COEF1:			/* 4-7 */ 
		bcddld[arg] = bit;
		break;

	case COEF:			/* 10-13, 15-17, 20-23, 25-26,
					   30-33, 35-38, 40-41, 51-54 */
		if (up->status & DSYNC) 
			bcddld[arg] = bit;
		else
			bcddld[arg] = 0;
		break;

	case COEF2:			/* 18, 27-28, 42-43 */
		bcddld[arg] = 0;
		break;

	/*
	 * Correlate coefficient vector with each valid digit vector and
	 * save in decoding matrix. We step through the decoding matrix
	 * digits correlating each with the coefficients and saving the
	 * greatest and the next lower for later SNR calculation.
	 */
	case DECIM2:			/* 29 */
		wwv_corr4(peer, &up->decvec[arg], bcddld, bcd2);
		break;

	case DECIM3:			/* 44 */
		wwv_corr4(peer, &up->decvec[arg], bcddld, bcd3);
		break;

	case DECIM6:			/* 19 */
		wwv_corr4(peer, &up->decvec[arg], bcddld, bcd6);
		break;

	case DECIM9:			/* 8, 14, 24, 34, 39 */
		wwv_corr4(peer, &up->decvec[arg], bcddld, bcd9);
		break;

	/*
	 * Miscellaneous bits. If above the positive threshold, declare
	 * 1; if below the negative threshold, declare 0; otherwise
	 * raise the BGATE bit. The design is intended to avoid
	 * integrating noise under low SNR conditions.
	 */
	case MSC20:			/* 55 */
		wwv_corr4(peer, &up->decvec[YR + 1], bcddld, bcd9);
		/* fall through */

	case MSCBIT:			/* 2-3, 50, 56-57 */
		if (bitvec[nsec] > BTHR) {
			if (!(up->misc & arg))
				up->alarm |= CMPERR;
			up->misc |= arg;
		} else if (bitvec[nsec] < -BTHR) {
			if (up->misc & arg)
				up->alarm |= CMPERR;
			up->misc &= ~arg;
		} else {
			up->status |= BGATE;
		}
		break;

	/*
	 * Save the data channel gain, then QSY to the probe channel and
	 * dim the seconds comb filters. The www_newchan() routine will
	 * light them back up.
	 */
	case MSC21:			/* 58 */
		if (bitvec[nsec] > BTHR) {
			if (!(up->misc & arg))
				up->alarm |= CMPERR;
			up->misc |= arg;
		} else if (bitvec[nsec] < -BTHR) {
			if (up->misc & arg)
				up->alarm |= CMPERR;
			up->misc &= ~arg;
		} else {
			up->status |= BGATE;
		}
		up->status &= ~(SELV | SELH);
#ifdef ICOM
		if (up->fd_icom > 0) {
			up->schan = (up->schan + 1) % NCHAN;
			wwv_qsy(peer, up->schan);
		} else {
			up->mitig[up->achan].gain = up->gain;
		}
#else
		up->mitig[up->achan].gain = up->gain;
#endif /* ICOM */
		break;

	/*
	 * The endgames
	 *
	 * During second 59 the receiver and codec AGC are settling
	 * down, so the data pulse is unusable as quality metric. If
	 * LEPSEC is set on the last minute of 30 June or 31 December,
	 * the transmitter and receiver insert an extra second (60) in
	 * the timescale and the minute sync repeats the second. Once
	 * leaps occurred at intervals of about 18 months, but the last
	 * leap before the most recent leap in 1995 was in  1998.
	 */
	case MIN1:			/* 59 */
		if (up->status & LEPSEC)
			break;

		/* fall through */

	case MIN2:			/* 60 */
		up->status &= ~LEPSEC;
		wwv_tsec(peer);
		up->rsec = 0;
		wwv_clock(peer);
		break;
	}
	if ((pp->sloppyclockflag & CLK_FLAG4) && !(up->status &
	    DSYNC)) {
		sprintf(tbuf,
		    "wwv3 %2d %04x %3d %4d %5.0f %5.1f %5.0f %5.1f %5.0f",
		    nsec, up->status, up->gain, up->yepoch, up->epomax,
		    up->eposnr, up->datsig, up->datsnr, bit);
		record_clock_stats(&peer->srcadr, tbuf);
#ifdef DEBUG
		if (debug)
			printf("%s\n", tbuf);
#endif /* DEBUG */
	}
	pp->disp += AUDIO_PHI;
}

/*
 * The radio clock is set if the alarm bits are all zero. After that,
 * the time is considered valid if the second sync bit is lit. It should
 * not be a surprise, especially if the radio is not tunable, that
 * sometimes no stations are above the noise and the integrators
 * discharge below the thresholds. We assume that, after a day of signal
 * loss, the minute sync epoch will be in the same second. This requires
 * the codec frequency be accurate within 6 PPM. Practical experience
 * shows the frequency typically within 0.1 PPM, so after a day of
 * signal loss, the time should be within 8.6 ms.. 
 */
static void
wwv_clock(
	struct peer *peer	/* peer unit pointer */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;
	l_fp	offset;		/* offset in NTP seconds */

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;
	if (!(up->status & SSYNC))
		up->alarm |= SYNERR;
	if (up->digcnt < 9)
		up->alarm |= NINERR;
	if (!(up->alarm))
		up->status |= INSYNC;
	if (up->status & INSYNC && up->status & SSYNC) {
		if (up->misc & SECWAR)
			pp->leap = LEAP_ADDSECOND;
		else
			pp->leap = LEAP_NOWARNING;
		pp->second = up->rsec;
		pp->minute = up->decvec[MN].digit + up->decvec[MN +
		    1].digit * 10;
		pp->hour = up->decvec[HR].digit + up->decvec[HR +
		    1].digit * 10;
		pp->day = up->decvec[DA].digit + up->decvec[DA +
		    1].digit * 10 + up->decvec[DA + 2].digit * 100;
		pp->year = up->decvec[YR].digit + up->decvec[YR +
		    1].digit * 10;
		pp->year += 2000;
		L_CLR(&offset);
		if (!clocktime(pp->day, pp->hour, pp->minute,
		    pp->second, GMT, up->timestamp.l_ui,
		    &pp->yearstart, &offset.l_ui)) {
			up->errflg = CEVNT_BADTIME;
		} else {
			up->watch = 0;
			pp->disp = 0;
			pp->lastref = up->timestamp;
			refclock_process_offset(pp, offset,
			    up->timestamp, PDELAY + up->pdelay);
			refclock_receive(peer);
		}
	}
	pp->lencode = timecode(up, pp->a_lastcode);
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
#ifdef DEBUG
	if (debug)
		printf("wwv: timecode %d %s\n", pp->lencode,
		    pp->a_lastcode);
#endif /* DEBUG */
}


/*
 * wwv_corr4 - determine maximum-likelihood digit
 *
 * This routine correlates the received digit vector with the BCD
 * coefficient vectors corresponding to all valid digits at the given
 * position in the decoding matrix. The maximum value corresponds to the
 * maximum-likelihood digit, while the ratio of this value to the next
 * lower value determines the likelihood function. Note that, if the
 * digit is invalid, the likelihood vector is averaged toward a miss.
 */
static void
wwv_corr4(
	struct peer *peer,	/* peer unit pointer */
	struct decvec *vp,	/* decoding table pointer */
	double	data[],		/* received data vector */
	double	tab[][4]	/* correlation vector array */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;
	double	topmax, nxtmax;	/* metrics */
	double	acc;		/* accumulator */
	char	tbuf[TBUF];	/* monitor buffer */
	int	mldigit;	/* max likelihood digit */
	int	i, j;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;

	/*
	 * Correlate digit vector with each BCD coefficient vector. If
	 * any BCD digit bit is bad, consider all bits a miss. Until the
	 * minute units digit has been resolved, don't to anything else.
	 * Note the SNR is calculated as the ratio of the largest
	 * likelihood value to the next largest likelihood value.
 	 */
	mldigit = 0;
	topmax = nxtmax = -MAXAMP;
	for (i = 0; tab[i][0] != 0; i++) {
		acc = 0;
		for (j = 0; j < 4; j++)
			acc += data[j] * tab[i][j];
		acc = (vp->like[i] += (acc - vp->like[i]) / TCONST);
		if (acc > topmax) {
			nxtmax = topmax;
			topmax = acc;
			mldigit = i;
		} else if (acc > nxtmax) {
			nxtmax = acc;
		}
	}
	vp->digprb = topmax;
	vp->digsnr = wwv_snr(topmax, nxtmax);

	/*
	 * The current maximum-likelihood digit is compared to the last
	 * maximum-likelihood digit. If different, the compare counter
	 * and maximum-likelihood digit are reset.  When the compare
	 * counter reaches the BCMP threshold (3), the digit is assumed
	 * correct. When the compare counter of all nine digits have
	 * reached threshold, the clock is assumed correct.
	 *
	 * Note that the clock display digit is set before the compare
	 * counter has reached threshold; however, the clock display is
	 * not considered correct until all nine clock digits have
	 * reached threshold. This is intended as eye candy, but avoids
	 * mistakes when the signal is low and the SNR is very marginal.
	 */
	if (vp->digprb < BTHR || vp->digsnr < BSNR) {
		up->status |= BGATE;
	} else {
		if (vp->digit != mldigit) {
			up->alarm |= CMPERR;
			if (vp->count > 0)
				vp->count--;
			if (vp->count == 0)
				vp->digit = mldigit;
		} else {
			if (vp->count < BCMP)
				vp->count++;
			if (vp->count == BCMP) {
				up->status |= DSYNC;
				up->digcnt++;
			}
		}
	}
	if ((pp->sloppyclockflag & CLK_FLAG4) && !(up->status &
	    INSYNC)) {
		sprintf(tbuf,
		    "wwv4 %2d %04x %3d %4d %5.0f %2d %d %d %d %5.0f %5.1f",
		    up->rsec - 1, up->status, up->gain, up->yepoch,
		    up->epomax, vp->radix, vp->digit, mldigit,
		    vp->count, vp->digprb, vp->digsnr);
		record_clock_stats(&peer->srcadr, tbuf);
#ifdef DEBUG
		if (debug)
			printf("%s\n", tbuf);
#endif /* DEBUG */
	}
}


/*
 * wwv_tsec - transmitter minute processing
 *
 * This routine is called at the end of the transmitter minute. It
 * implements a state machine that advances the logical clock subject to
 * the funny rules that govern the conventional clock and calendar.
 */
static void
wwv_tsec(
	struct peer *peer	/* driver structure pointer */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;
	int minute, day, isleap;
	int temp;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;

	/*
	 * Advance minute unit of the day. Don't propagate carries until
	 * the unit minute digit has been found.
	 */
	temp = carry(&up->decvec[MN]);	/* minute units */
	if (!(up->status & DSYNC))
		return;

	/*
	 * Propagate carries through the day.
	 */ 
	if (temp == 0)			/* carry minutes */
		temp = carry(&up->decvec[MN + 1]);
	if (temp == 0)			/* carry hours */
		temp = carry(&up->decvec[HR]);
	if (temp == 0)
		temp = carry(&up->decvec[HR + 1]);

	/*
	 * Decode the current minute and day. Set leap day if the
	 * timecode leap bit is set on 30 June or 31 December. Set leap
	 * minute if the last minute on leap day, but only if the clock
	 * is syncrhronized. This code fails in 2400 AD.
	 */
	minute = up->decvec[MN].digit + up->decvec[MN + 1].digit *
	    10 + up->decvec[HR].digit * 60 + up->decvec[HR +
	    1].digit * 600;
	day = up->decvec[DA].digit + up->decvec[DA + 1].digit * 10 +
	    up->decvec[DA + 2].digit * 100;

	/*
	 * Set the leap bit on the last minute of the leap day.
	 */
	isleap = up->decvec[YR].digit & 0x3;
	if (up->misc & SECWAR && up->status & INSYNC) {
		if ((day == (isleap ? 182 : 183) || day == (isleap ?
		    365 : 366)) && minute == 1439)
			up->status |= LEPSEC;
	}

	/*
	 * Roll the day if this the first minute and propagate carries
	 * through the year.
	 */
	if (minute != 1440)
		return;

	minute = 0;
	while (carry(&up->decvec[HR]) != 0); /* advance to minute 0 */
	while (carry(&up->decvec[HR + 1]) != 0);
	day++;
	temp = carry(&up->decvec[DA]);	/* carry days */
	if (temp == 0)
		temp = carry(&up->decvec[DA + 1]);
	if (temp == 0)
		temp = carry(&up->decvec[DA + 2]);

	/*
	 * Roll the year if this the first day and propagate carries
	 * through the century.
	 */
	if (day != (isleap ? 365 : 366))
		return;

	day = 1;
	while (carry(&up->decvec[DA]) != 1); /* advance to day 1 */
	while (carry(&up->decvec[DA + 1]) != 0);
	while (carry(&up->decvec[DA + 2]) != 0);
	temp = carry(&up->decvec[YR]);	/* carry years */
	if (temp == 0)
		carry(&up->decvec[YR + 1]);
}


/*
 * carry - process digit
 *
 * This routine rotates a likelihood vector one position and increments
 * the clock digit modulo the radix. It returns the new clock digit or
 * zero if a carry occurred. Once synchronized, the clock digit will
 * match the maximum-likelihood digit corresponding to that position.
 */
static int
carry(
	struct decvec *dp	/* decoding table pointer */
	)
{
	int temp;
	int j;

	dp->digit++;
	if (dp->digit == dp->radix)
		dp->digit = 0;
	temp = dp->like[dp->radix - 1];
	for (j = dp->radix - 1; j > 0; j--)
		dp->like[j] = dp->like[j - 1];
	dp->like[0] = temp;
	return (dp->digit);
}


/*
 * wwv_snr - compute SNR or likelihood function
 */
static double
wwv_snr(
	double signal,		/* signal */
	double noise		/* noise */
	)
{
	double rval;

	/*
	 * This is a little tricky. Due to the way things are measured,
	 * either or both the signal or noise amplitude can be negative
	 * or zero. The intent is that, if the signal is negative or
	 * zero, the SNR must always be zero. This can happen with the
	 * subcarrier SNR before the phase has been aligned. On the
	 * other hand, in the likelihood function the "noise" is the
	 * next maximum down from the peak and this could be negative.
	 * However, in this case the SNR is truly stupendous, so we
	 * simply cap at MAXSNR dB (40).
	 */
	if (signal <= 0) {
		rval = 0;
	} else if (noise <= 0) {
		rval = MAXSNR;
	} else {
		rval = 20. * log10(signal / noise);
		if (rval > MAXSNR)
			rval = MAXSNR;
	}
	return (rval);
}


/*
 * wwv_newchan - change to new data channel
 *
 * The radio actually appears to have ten channels, one channel for each
 * of five frequencies and each of two stations (WWV and WWVH), although
 * if not tunable only the DCHAN channel appears live. While the radio
 * is tuned to the working data channel frequency and station for most
 * of the minute, during seconds 59, 0 and 1 the radio is tuned to a
 * probe frequency in order to search for minute sync pulse and data
 * subcarrier from other transmitters.
 *
 * The search for WWV and WWVH operates simultaneously, with WWV minute
 * sync pulse at 1000 Hz and WWVH at 1200 Hz. The probe frequency
 * rotates each minute over 2.5, 5, 10, 15 and 20 MHz in order and yes,
 * we all know WWVH is dark on 20 MHz, but few remember when WWV was lit
 * on 25 MHz.
 *
 * This routine selects the best channel using a metric computed from
 * the reachability register and minute pulse amplitude. Normally, the
 * award goes to the the channel with the highest metric; but, in case
 * of ties, the award goes to the channel with the highest minute sync
 * pulse amplitude and then to the highest frequency.
 *
 * The routine performs an important squelch function to keep dirty data
 * from polluting the integrators. In order to consider a station valid,
 * the metric must be at least MTHR (13); otherwise, the station select
 * bits are cleared so the second sync is disabled and the data bit
 * integrators averaged to a miss. 
 */
static int
wwv_newchan(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;
	struct sync *sp, *rp;
	double rank, dtemp;
	int i, j, rval;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;

	/*
	 * Search all five station pairs looking for the channel with
	 * maximum metric.
	 */
	sp = NULL;
	j = 0;
	rank = 0;
	for (i = 0; i < NCHAN; i++) {
		rp = &up->mitig[i].wwvh;
		dtemp = rp->metric;
		if (dtemp >= rank) {
			rank = dtemp;
			sp = rp;
			j = i;
		}
		rp = &up->mitig[i].wwv;
		dtemp = rp->metric;
		if (dtemp >= rank) {
			rank = dtemp;
			sp = rp;
			j = i;
		}
	}

	/*
	 * If the strongest signal is less than the MTHR threshold (13),
	 * we are beneath the waves, so squelch the second sync and
	 * advance to the next station. This makes sure all stations are
	 * scanned when the ions grow dim. If the strongest signal is
	 * greater than the threshold, tune to that frequency and
	 * transmitter QTH.
	 */
	up->status &= ~(SELV | SELH);
	if (rank < MTHR) {
		up->dchan = (up->dchan + 1) % NCHAN;
		if (up->status & METRIC) {
			up->status &= ~METRIC;
			refclock_report(peer, CEVNT_PROP);
		}
		rval = FALSE;
	} else {
		up->dchan = j;
		up->sptr = sp;
		memcpy(&pp->refid, sp->refid, 4);
		peer->refid = pp->refid;
		up->status |= METRIC;
		if (sp->select & SELV) {
			up->status |= SELV;
			up->pdelay = pp->fudgetime1;
		} else if (sp->select & SELH) {
			up->status |= SELH;
			up->pdelay = pp->fudgetime2;
		} else {
			up->pdelay = 0;
		}
		rval = TRUE;
	}
#ifdef ICOM
	if (up->fd_icom > 0)
		wwv_qsy(peer, up->dchan);
#endif /* ICOM */
	return (rval);
}


/*
 * wwv_newgame - reset and start over
 *
 * There are three conditions resulting in a new game:
 *
 * 1	After finding the minute pulse (MSYNC lit), going 15 minutes
 *	(DATA) without finding the unit seconds digit.
 *
 * 2	After finding good data (DSYNC lit), going more than 40 minutes
 *	(SYNCH) without finding station sync (INSYNC lit).
 *
 * 3	After finding station sync (INSYNC lit), going more than 2 days
 *	(PANIC) without finding any station. 
 */
static void
wwv_newgame(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;
	struct chan *cp;
	int i;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;

	/*
	 * Initialize strategic values. Note we set the leap bits
	 * NOTINSYNC and the refid "NONE".
	 */
	if (up->status)
		up->errflg = CEVNT_TIMEOUT;
	peer->leap = LEAP_NOTINSYNC;
	up->watch = up->status = up->alarm = 0;
	up->avgint = MINAVG;
	up->freq = 0;
	up->gain = MAXGAIN / 2;

	/*
	 * Initialize the station processes for audio gain, select bit,
	 * station/frequency identifier and reference identifier. Start
	 * probing at the strongest channel or the default channel if
	 * nothing heard.
	 */
	memset(up->mitig, 0, sizeof(up->mitig));
	for (i = 0; i < NCHAN; i++) {
		cp = &up->mitig[i];
		cp->gain = up->gain;
		cp->wwv.select = SELV;
		sprintf(cp->wwv.refid, "WV%.0f", floor(qsy[i])); 
		cp->wwvh.select = SELH;
		sprintf(cp->wwvh.refid, "WH%.0f", floor(qsy[i])); 
	}
	up->dchan = (DCHAN + NCHAN - 1) % NCHAN;
	wwv_newchan(peer);
	up->schan = up->dchan;
}

/*
 * wwv_metric - compute station metric
 *
 * The most significant bits represent the number of ones in the
 * station reachability register. The least significant bits represent
 * the minute sync pulse amplitude. The combined value is scaled 0-100.
 */
double
wwv_metric(
	struct sync *sp		/* station pointer */
	)
{
	double	dtemp;

	dtemp = sp->count * MAXAMP;
	if (sp->synmax < MAXAMP)
		dtemp += sp->synmax;
	else
		dtemp += MAXAMP - 1;
	dtemp /= (AMAX + 1) * MAXAMP;
	return (dtemp * 100.);
}


#ifdef ICOM
/*
 * wwv_qsy - Tune ICOM receiver
 *
 * This routine saves the AGC for the current channel, switches to a new
 * channel and restores the AGC for that channel. If a tunable receiver
 * is not available, just fake it.
 */
static int
wwv_qsy(
	struct peer *peer,	/* peer structure pointer */
	int	chan		/* channel */
	)
{
	int rval = 0;
	struct refclockproc *pp;
	struct wwvunit *up;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;
	if (up->fd_icom > 0) {
		up->mitig[up->achan].gain = up->gain;
		rval = icom_freq(up->fd_icom, peer->ttl & 0x7f,
		    qsy[chan]);
		up->achan = chan;
		up->gain = up->mitig[up->achan].gain;
	}
	return (rval);
}
#endif /* ICOM */


/*
 * timecode - assemble timecode string and length
 *
 * Prettytime format - similar to Spectracom
 *
 * sq yy ddd hh:mm:ss ld dut lset agc iden sig errs freq avgt
 *
 * s	sync indicator ('?' or ' ')
 * q	error bits (hex 0-F)
 * yyyy	year of century
 * ddd	day of year
 * hh	hour of day
 * mm	minute of hour
 * ss	second of minute)
 * l	leap second warning (' ' or 'L')
 * d	DST state ('S', 'D', 'I', or 'O')
 * dut	DUT sign and magnitude (0.1 s)
 * lset	minutes since last clock update
 * agc	audio gain (0-255)
 * iden	reference identifier (station and frequency)
 * sig	signal quality (0-100)
 * errs	bit errors in last minute
 * freq	frequency offset (PPM)
 * avgt	averaging time (s)
 */
static int
timecode(
	struct wwvunit *up,	/* driver structure pointer */
	char *ptr		/* target string */
	)
{
	struct sync *sp;
	int year, day, hour, minute, second, dut;
	char synchar, leapchar, dst;
	char cptr[50];
	

	/*
	 * Common fixed-format fields
	 */
	synchar = (up->status & INSYNC) ? ' ' : '?';
	year = up->decvec[YR].digit + up->decvec[YR + 1].digit * 10 +
	    2000;
	day = up->decvec[DA].digit + up->decvec[DA + 1].digit * 10 +
	    up->decvec[DA + 2].digit * 100;
	hour = up->decvec[HR].digit + up->decvec[HR + 1].digit * 10;
	minute = up->decvec[MN].digit + up->decvec[MN + 1].digit * 10;
	second = 0;
	leapchar = (up->misc & SECWAR) ? 'L' : ' ';
	dst = dstcod[(up->misc >> 4) & 0x3];
	dut = up->misc & 0x7;
	if (!(up->misc & DUTS))
		dut = -dut;
	sprintf(ptr, "%c%1X", synchar, up->alarm);
	sprintf(cptr, " %4d %03d %02d:%02d:%02d %c%c %+d",
	    year, day, hour, minute, second, leapchar, dst, dut);
	strcat(ptr, cptr);

	/*
	 * Specific variable-format fields
	 */
	sp = up->sptr;
	sprintf(cptr, " %d %d %s %.0f %d %.1f %d", up->watch,
	    up->mitig[up->dchan].gain, sp->refid, sp->metric,
	    up->errcnt, up->freq / SECOND * 1e6, up->avgint);
	strcat(ptr, cptr);
	return (strlen(ptr));
}


/*
 * wwv_gain - adjust codec gain
 *
 * This routine is called at the end of each second. During the second
 * the number of signal clips above the MAXAMP threshold (6000). If
 * there are no clips, the gain is bumped up; if there are more than
 * MAXCLP clips (100), it is bumped down. The decoder is relatively
 * insensitive to amplitude, so this crudity works just peachy. The
 * routine also jiggles the input port and selectively mutes the
 * monitor.
 */
static void
wwv_gain(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;
	struct wwvunit *up;

	pp = peer->procptr;
	up = (struct wwvunit *)pp->unitptr;

	/*
	 * Apparently, the codec uses only the high order bits of the
	 * gain control field. Thus, it may take awhile for changes to
	 * wiggle the hardware bits.
	 */
	if (up->clipcnt == 0) {
		up->gain += 4;
		if (up->gain > MAXGAIN)
			up->gain = MAXGAIN;
	} else if (up->clipcnt > MAXCLP) {
		up->gain -= 4;
		if (up->gain < 0)
			up->gain = 0;
	}
	audio_gain(up->gain, up->mongain, up->port);
	up->clipcnt = 0;
#if DEBUG
	if (debug > 1)
		audio_show();
#endif
}


#else
int refclock_wwv_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_pst.c0000644000175000017500000002043411332473276015413 0ustar  peterpeter/*
 * refclock_pst - clock driver for PSTI/Traconex WWV/WWVH receivers
 */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_PST)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"

#include 
#include 

/*
 * This driver supports the PSTI 1010 and Traconex 1020 WWV/WWVH
 * Receivers. No specific claim of accuracy is made for these receiver,
 * but actual experience suggests that 10 ms would be a conservative
 * assumption.
 * 
 * The DIPswitches should be set for 9600 bps line speed, 24-hour day-
 * of-year format and UTC time zone. Automatic correction for DST should
 * be disabled. It is very important that the year be set correctly in
 * the DIPswitches; otherwise, the day of year will be incorrect after
 * 28 April of a normal or leap year. The propagation delay DIPswitches
 * should be set according to the distance from the transmitter for both
 * WWV and WWVH, as described in the instructions. While the delay can
 * be set only to within 11 ms, the fudge time1 parameter can be used
 * for vernier corrections.
 *
 * Using the poll sequence QTQDQM, the response timecode is in three
 * sections totalling 50 ASCII printing characters, as concatenated by
 * the driver, in the following format:
 *
 * ahh:mm:ss.fffs yy/dd/mm/ddd frdzycchhSSFTttttuuxx
 *
 *	on-time = first 
 *	hh:mm:ss.fff = hours, minutes, seconds, milliseconds
 *	a = AM/PM indicator (' ' for 24-hour mode)
 *	yy = year (from internal switches)
 *	dd/mm/ddd = day of month, month, day of year
 *	s = daylight-saving indicator (' ' for 24-hour mode)
 *	f = frequency enable (O = all frequencies enabled)
 *	r = baud rate (3 = 1200, 6 = 9600)
 *	d = features indicator (@ = month/day display enabled)
 *	z = time zone (0 = UTC)
 *	y = year (5 = 91)
 *	cc = WWV propagation delay (52 = 22 ms)
 *	hh = WWVH propagation delay (81 = 33 ms)
 *	SS = status (80 or 82 = operating correctly)
 *	F = current receive frequency (4 = 15 MHz)
 *	T = transmitter (C = WWV, H = WWVH)
 *	tttt = time since last update (0000 = minutes)
 *	uu = flush character (03 = ^c)
 *	xx = 94 (unknown)
 *
 * The alarm condition is indicated by other than '8' at A, which occurs
 * during initial synchronization and when received signal is lost for
 * an extended period; unlock condition is indicated by other than
 * "0000" in the tttt subfield at Q.
 *
 * Fudge Factors
 *
 * There are no special fudge factors other than the generic.
 */

/*
 * Interface definitions
 */
#define	DEVICE		"/dev/wwv%d" /* device name and unit */
#define	SPEED232	B9600	/* uart speed (9600 baud) */
#define	PRECISION	(-10)	/* precision assumed (about 1 ms) */
#define	WWVREFID	"WWV\0"	/* WWV reference ID */
#define	WWVHREFID	"WWVH"	/* WWVH reference ID */
#define	DESCRIPTION	"PSTI/Traconex WWV/WWVH Receiver" /* WRU */
#define PST_PHI		(10e-6)	/* max clock oscillator offset */
#define LENPST		46	/* min timecode length */

/*
 * Unit control structure
 */
struct pstunit {
	int	tcswitch;	/* timecode switch */
	char	*lastptr;	/* pointer to timecode data */
};

/*
 * Function prototypes
 */
static	int	pst_start	(int, struct peer *);
static	void	pst_shutdown	(int, struct peer *);
static	void	pst_receive	(struct recvbuf *);
static	void	pst_poll	(int, struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_pst = {
	pst_start,		/* start up driver */
	pst_shutdown,		/* shut down driver */
	pst_poll,		/* transmit poll message */
	noentry,		/* not used (old pst_control) */
	noentry,		/* initialize driver */
	noentry,		/* not used (old pst_buginfo) */
	NOFLAGS			/* not used */
};


/*
 * pst_start - open the devices and initialize data for processing
 */
static int
pst_start(
	int unit,
	struct peer *peer
	)
{
	register struct pstunit *up;
	struct refclockproc *pp;
	int fd;
	char device[20];

	/*
	 * Open serial port. Use CLK line discipline, if available.
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
	if (!(fd = refclock_open(device, SPEED232, LDISC_CLK)))
		return (0);

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp = peer->procptr;
	pp->io.clock_recv = pst_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		pp->io.fd = -1;
		free(up);
		return (0);
	}
	pp->unitptr = (caddr_t)up;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, WWVREFID, 4);
	peer->burst = MAXSTAGE;
	return (1);
}


/*
 * pst_shutdown - shut down the clock
 */
static void
pst_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct pstunit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct pstunit *)pp->unitptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}


/*
 * pst_receive - receive data from the serial interface
 */
static void
pst_receive(
	struct recvbuf *rbufp
	)
{
	register struct pstunit *up;
	struct refclockproc *pp;
	struct peer *peer;
	l_fp trtmp;
	u_long ltemp;
	char ampmchar;		/* AM/PM indicator */
	char daychar;		/* standard/daylight indicator */
	char junque[10];	/* "yy/dd/mm/" discard */
	char info[14];		/* "frdzycchhSSFT" clock info */

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct pstunit *)pp->unitptr;
	up->lastptr += refclock_gtlin(rbufp, up->lastptr, pp->a_lastcode
	    + BMAX - 2 - up->lastptr, &trtmp);
	*up->lastptr++ = ' ';
	*up->lastptr = '\0';

	/*
	 * Note we get a buffer and timestamp for each , but only
	 * the first timestamp is retained.
	 */
	if (up->tcswitch == 0)
		pp->lastrec = trtmp;
	up->tcswitch++;
	pp->lencode = up->lastptr - pp->a_lastcode;
	if (up->tcswitch < 3)
		return;

	/*
	 * We get down to business, check the timecode format and decode
	 * its contents. If the timecode has invalid length or is not in
	 * proper format, we declare bad format and exit.
	 */
	if (pp->lencode < LENPST) {
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	/*
	 * Timecode format:
	 * "ahh:mm:ss.fffs yy/dd/mm/ddd frdzycchhSSFTttttuuxx"
	 */
	if (sscanf(pp->a_lastcode,
	    "%c%2d:%2d:%2d.%3ld%c %9s%3d%13s%4ld",
	    &mchar, &pp->hour, &pp->minute, &pp->second, &pp->nsec,
	    &daychar, junque, &pp->day, info, <emp) != 10) {
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}
	pp->nsec *= 1000000;

	/*
	 * Decode synchronization, quality and last update. If
	 * unsynchronized, set the leap bits accordingly and exit. Once
	 * synchronized, the dispersion depends only on when the clock
	 * was last heard, which depends on the time since last update,
	 * as reported by the clock.
	 */
	if (info[9] != '8')
		pp->leap = LEAP_NOTINSYNC;
	if (info[12] == 'H')
		memcpy((char *)&pp->refid, WWVHREFID, 4);
	else
		memcpy((char *)&pp->refid, WWVREFID, 4);
	if (peer->stratum <= 1)
		peer->refid = pp->refid;
	if (ltemp == 0)
		pp->lastref = pp->lastrec;
	pp->disp = PST_PHI * ltemp * 60;

	/*
	 * Process the new sample in the median filter and determine the
	 * timecode timestamp.
	 */
	if (!refclock_process(pp))
		refclock_report(peer, CEVNT_BADTIME);
	else if (peer->disp > MAXDISTANCE)
		refclock_receive(peer);
}


/*
 * pst_poll - called by the transmit procedure
 */
static void
pst_poll(
	int unit,
	struct peer *peer
	)
{
	register struct pstunit *up;
	struct refclockproc *pp;

	/*
	 * Time to poll the clock. The PSTI/Traconex clock responds to a
	 * "QTQDQMT" by returning a timecode in the format specified
	 * above. Note there is no checking on state, since this may not
	 * be the only customer reading the clock. Only one customer
	 * need poll the clock; all others just listen in. If the clock
	 * becomes unreachable, declare a timeout and keep going.
	 */
	pp = peer->procptr;
	up = (struct pstunit *)pp->unitptr;
	up->tcswitch = 0;
	up->lastptr = pp->a_lastcode;
	if (write(pp->io.fd, "QTQDQMT", 6) != 6)
		refclock_report(peer, CEVNT_FAULT);
	if (peer->burst > 0)
		return;
	if (pp->coderecv == pp->codeproc) {
		refclock_report(peer, CEVNT_TIMEOUT);
		return;
	}
	refclock_receive(peer);
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
#ifdef DEBUG
	if (debug)
		printf("pst: timecode %d %s\n", pp->lencode,
		    pp->a_lastcode);
#endif
	peer->burst = MAXSTAGE;
	pp->polls++;
}

#else
int refclock_pst_int;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/ntpd-opts.texi0000644000175000017500000004261611675460564015430 0ustar  peterpeter@node ntpd Invocation
@section Invoking ntpd
@pindex ntpd
@cindex NTP daemon program
@ignore
# 
# EDIT THIS FILE WITH CAUTION  (ntpd-opts.texi)
# 
# It has been AutoGen-ed  December 24, 2011 at 06:34:12 PM by AutoGen 5.12
# From the definitions    ntpd-opts.def
# and the template file   aginfo.tpl
@end ignore
This program has no explanation.



This section was generated by @strong{AutoGen},
the aginfo template and the option descriptions for the @command{ntpd} program.  It documents the @command{ntpd} usage text and option meanings.

This software is released under a specialized copyright license.

@menu
* ntpd usage::                  ntpd usage help (-?)
* ntpd authnoreq::             authnoreq option (-A)
* ntpd authreq::               authreq option (-a)
* ntpd bcastsync::             bcastsync option (-b)
* ntpd configfile::            configfile option (-c)
* ntpd debug-level::           debug-level option (-d)
* ntpd driftfile::             driftfile option (-f)
* ntpd dvar::                  dvar option
* ntpd interface::             interface option (-I)
* ntpd ipv4::                  ipv4 option (-4)
* ntpd ipv6::                  ipv6 option (-6)
* ntpd jaildir::               jaildir option (-i)
* ntpd keyfile::               keyfile option (-k)
* ntpd logfile::               logfile option (-l)
* ntpd modifymmtimer::         modifymmtimer option (-M)
* ntpd nice::                  nice option (-N)
* ntpd nofork::                nofork option (-n)
* ntpd novirtualips::          novirtualips option (-L)
* ntpd panicgate::             panicgate option (-g)
* ntpd pccfreq::               pccfreq option
* ntpd pidfile::               pidfile option (-p)
* ntpd priority::              priority option (-P)
* ntpd propagationdelay::      propagationdelay option (-r)
* ntpd quit::                  quit option (-q)
* ntpd saveconfigquit::        saveconfigquit option
* ntpd set-debug-level::       set-debug-level option (-D)
* ntpd slew::                  slew option (-x)
* ntpd statsdir::              statsdir option (-s)
* ntpd trustedkey::            trustedkey option (-t)
* ntpd updateinterval::        updateinterval option (-U)
* ntpd usepcc::                usepcc option
* ntpd user::                  user option (-u)
* ntpd var::                   var option
@end menu

@node ntpd usage
@subsection ntpd usage help (-?)
@cindex ntpd usage

This is the automatically generated usage text for ntpd:

@exampleindent 0
@example
ntpd - NTP daemon program - Ver. 4.2.6p5
USAGE:  ntpd [ - [] | --[@{=| @}] ]...
  Flg Arg Option-Name    Description
   -4 no  ipv4           Force IPv4 DNS name resolution
                                - prohibits these options:
                                ipv6
   -6 no  ipv6           Force IPv6 DNS name resolution
                                - prohibits these options:
                                ipv4
   -a no  authreq        Require crypto authentication
                                - prohibits these options:
                                authnoreq
   -A no  authnoreq      Do not require crypto authentication
                                - prohibits these options:
                                authreq
   -b no  bcastsync      Allow us to sync to broadcast servers
   -c Str configfile     configuration file name
   -d no  debug-level    Increase output debug message level
                                - may appear multiple times
   -D Str set-debug-level Set the output debug message level
                                - may appear multiple times
   -f Str driftfile      frequency drift file name
   -g no  panicgate      Allow the first adjustment to be Big
                                - may appear multiple times
   -i --- jaildir        built without --enable-clockctl or --enable-linuxcaps
   -I Str interface      Listen on an interface name or address
                                - may appear multiple times
   -k Str keyfile        path to symmetric keys
   -l Str logfile        path to the log file
   -L no  novirtualips   Do not listen to virtual interfaces
   -n no  nofork         Do not fork
   -N no  nice           Run at high priority
   -p Str pidfile        path to the PID file
   -P Num priority       Process priority
   -q no  quit           Set the time and quit
   -r Str propagationdelay Broadcast/propagation delay
      Str saveconfigquit Save parsed configuration and quit
   -s Str statsdir       Statistics file location
   -t Str trustedkey     Trusted key number
                                - may appear multiple times
   -u --- user           built without --enable-clockctl or --enable-linuxcaps
   -U Num updateinterval interval in seconds between scans for new or dropped interfaces
      Str var            make ARG an ntp variable (RW)
                                - may appear multiple times
      Str dvar           make ARG an ntp variable (RW|DEF)
                                - may appear multiple times
   -x no  slew           Slew up to 600 seconds
      opt version        Output version information and exit
   -? no  help           Display extended usage information and exit
   -! no  more-help      Extended usage information passed thru pager

Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.

The following option preset mechanisms are supported:
 - examining environment variables named NTPD_*



please send bug reports to:  http://bugs.ntp.org, bugs@@ntp.org
@end example
@exampleindent 4

@node ntpd authnoreq
@subsection authnoreq option (-A)
@cindex ntpd-authnoreq

This is the ``do not require crypto authentication'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must not appear in combination with any of the following options:
authreq.
@end itemize

Do not require cryptographic authentication for broadcast client,
multicast client and symmetric passive associations.
This is almost never a good idea.

@node ntpd authreq
@subsection authreq option (-a)
@cindex ntpd-authreq

This is the ``require crypto authentication'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must not appear in combination with any of the following options:
authnoreq.
@end itemize

Require cryptographic authentication for broadcast client,
multicast client and symmetric passive associations.
This is the default.

@node ntpd bcastsync
@subsection bcastsync option (-b)
@cindex ntpd-bcastsync

This is the ``allow us to sync to broadcast servers'' option.


@node ntpd configfile
@subsection configfile option (-c)
@cindex ntpd-configfile

This is the ``configuration file name'' option.
The name and path of the configuration file,
/etc/ntp.conf
by default.

@node ntpd debug-level
@subsection debug-level option (-d)
@cindex ntpd-debug-level

This is the ``increase output debug message level'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@item
must be compiled in by defining @code{DEBUG} during the compilation.
@end itemize

Increase the debugging message output level.

@node ntpd driftfile
@subsection driftfile option (-f)
@cindex ntpd-driftfile

This is the ``frequency drift file name'' option.
The name and path of the frequency file,
/etc/ntp.drift
by default.
This is the same operation as the
driftfile driftfile
configuration specification in the 
/etc/ntp.conf
file.

@node ntpd dvar
@subsection dvar option
@cindex ntpd-dvar

This is the ``make arg an ntp variable (rw|def)'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize



@node ntpd interface
@subsection interface option (-I)
@cindex ntpd-interface

This is the ``listen on an interface name or address'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

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
interface command, which is more versatile. 

@node ntpd ipv4
@subsection ipv4 option (-4)
@cindex ntpd-ipv4

This is the ``force ipv4 dns name resolution'' option.

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.

@node ntpd ipv6
@subsection ipv6 option (-6)
@cindex ntpd-ipv6

This is the ``force ipv6 dns name resolution'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must not appear in combination with any of the following options:
ipv4.
@end itemize

Force DNS resolution of following host names on the command line
to the IPv6 namespace.

@node ntpd jaildir
@subsection jaildir option (-i)
@cindex ntpd-jaildir

This is the ``jail directory'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must be compiled in by defining @code{HAVE_DROPROOT} during the compilation.
@end itemize

Chroot the server to the directory
jaildir
.
This option also implies that the server attempts to drop root privileges at startup.
You may need to also specify a
-u
option.
This option is only available if the OS supports adjusting the clock
without full root privileges.
This option is supported under NetBSD (configure with
--enable-clockctl
) and Linux (configure with
--enable-linuxcaps
).

@node ntpd keyfile
@subsection keyfile option (-k)
@cindex ntpd-keyfile

This is the ``path to symmetric keys'' option.
Specify the name and path of the symmetric key file.
/etc/ntp.keys
is the default.
This is the same operation as the
keys keyfile
configuration file directive.

@node ntpd logfile
@subsection logfile option (-l)
@cindex ntpd-logfile

This is the ``path to the log file'' option.
Specify the name and path of the log file.
The default is the system log file.
This is the same operation as the
logfile logfile
configuration file directive.

@node ntpd modifymmtimer
@subsection modifymmtimer option (-M)
@cindex ntpd-modifymmtimer

This is the ``modify multimedia timer (windows only)'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must be compiled in by defining @code{SYS_WINNT} during the compilation.
@end itemize

Set the Windows Multimedia Timer to highest resolution.  This
ensures the resolution does not change while ntpd is running,
avoiding timekeeping glitches associated with changes.

@node ntpd nice
@subsection nice option (-N)
@cindex ntpd-nice

This is the ``run at high priority'' option.
To the extent permitted by the operating system, run
ntpd
at the highest priority.

@node ntpd nofork
@subsection nofork option (-n)
@cindex ntpd-nofork

This is the ``do not fork'' option.


@node ntpd novirtualips
@subsection novirtualips option (-L)
@cindex ntpd-novirtualips

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
consider using the configuration file interface command, which
is more versatile.

@node ntpd panicgate
@subsection panicgate option (-g)
@cindex ntpd-panicgate

This is the ``allow the first adjustment to be big'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Normally,
ntpd
exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
ntpd
will exit with a message to the system log. This option can be used with the
-q
and
-x
options.
See the
tinker
configuration file directive for other options.

@node ntpd pccfreq
@subsection pccfreq option
@cindex ntpd-pccfreq

This is the ``force cpu cycle counter use (windows only)'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must be compiled in by defining @code{SYS_WINNT} during the compilation.
@end itemize

Force substitution the CPU counter for QueryPerformanceCounter.
The CPU counter (RDTSC on x86) is used unconditionally with the
given frequency (in Hz).

@node ntpd pidfile
@subsection pidfile option (-p)
@cindex ntpd-pidfile

This is the ``path to the pid file'' option.
Specify the name and path of the file used to record
ntpd's
process ID.
This is the same operation as the
pidfile pidfile
configuration file directive.

@node ntpd priority
@subsection priority option (-P)
@cindex ntpd-priority

This is the ``process priority'' option.
To the extent permitted by the operating system, run
ntpd
at the specified
sched_setscheduler(SCHED_FIFO)
priority.

@node ntpd propagationdelay
@subsection propagationdelay option (-r)
@cindex ntpd-propagationdelay

This is the ``broadcast/propagation delay'' option.
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.

@node ntpd quit
@subsection quit option (-q)
@cindex ntpd-quit

This is the ``set the time and quit'' option.
ntpd
will exit just after the first time the clock is set. This behavior mimics that of the
ntpdate
program, which is to be retired.
The
-g
and
-x
options can be used with this option.
Note: The kernel time discipline is disabled with this option.

@node ntpd saveconfigquit
@subsection saveconfigquit option
@cindex ntpd-saveconfigquit

This is the ``save parsed configuration and quit'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must be compiled in by defining @code{SAVECONFIG} during the compilation.
@end itemize

Cause ntpd to parse its startup configuration file and save an
equivalent to the given filename and exit.  This option was
designed for automated testing.

@node ntpd set-debug-level
@subsection set-debug-level option (-D)
@cindex ntpd-set-debug-level

This is the ``set the output debug message level'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@item
must be compiled in by defining @code{DEBUG} during the compilation.
@end itemize

Set the output debugging level.  Can be supplied multiple times,
but each overrides the previous value(s).

@node ntpd slew
@subsection slew option (-x)
@cindex ntpd-slew

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.
Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
Thus, an adjustment as much as 600 s will take almost 14 days to complete.
This option can be used with the
-g
and
-q
options.
See the
tinker
configuration file directive for other options.
Note: The kernel time discipline is disabled with this option.

@node ntpd statsdir
@subsection statsdir option (-s)
@cindex ntpd-statsdir

This is the ``statistics file location'' option.
Specify the directory path for files created by the statistics facility.
This is the same operation as the
statsdir statsdir
configuration file directive.

@node ntpd trustedkey
@subsection trustedkey option (-t)
@cindex ntpd-trustedkey

This is the ``trusted key number'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Add a key number to the trusted key list.

@node ntpd updateinterval
@subsection updateinterval option (-U)
@cindex ntpd-updateinterval

This is the ``interval in seconds between scans for new or dropped interfaces'' option.
Give the time in seconds between two scans for new or dropped interfaces.
For systems with routing socket support the scans will be performed shortly after the interface change
has been detected by the system.
Use 0 to disable scanning. 60 seconds is the minimum time between scans.

@node ntpd usepcc
@subsection usepcc option
@cindex ntpd-usepcc

This is the ``use cpu cycle counter (windows only)'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must be compiled in by defining @code{SYS_WINNT} during the compilation.
@end itemize

Attempt to substitute the CPU counter for QueryPerformanceCounter.
The CPU counter and QueryPerformanceCounter are compared, and if
they have the same frequency, the CPU counter (RDTSC on x86) is
used directly, saving the overhead of a system call.

@node ntpd user
@subsection user option (-u)
@cindex ntpd-user

This is the ``run as userid (or userid:groupid)'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must be compiled in by defining @code{HAVE_DROPROOT} during the compilation.
@end itemize

Specify a user, and optionally a group, to switch to.
This option is only available if the OS supports adjusting the clock
without full root privileges.
This option is supported under NetBSD (configure with
--enable-clockctl
) and Linux (configure with
--enable-linuxcaps
).

@node ntpd var
@subsection var option
@cindex ntpd-var

This is the ``make arg an ntp variable (rw)'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize
ntp-4.2.6p5/ntpd/ntp_scanner.h0000644000175000017500000001006111315077754015251 0ustar  peterpeter/* ntp_scanner.h
 *
 * The header file for a simple lexical analyzer. 
 *
 * Written By:	Sachin Kamboj
 *		University of Delaware
 *		Newark, DE 19711
 * Copyright (c) 2006
 */

#ifndef NTP_SCANNER_H
#define NTP_SCANNER_H

/*
 * ntp.conf syntax is slightly irregular in that some tokens such as
 * hostnames do not require quoting even if they might otherwise be
 * recognized as T_ terminal tokens.  This hand-crafted lexical scanner
 * uses a "followed by" value associated with each keyword to indicate
 * normal scanning of the next token, forced scanning of the next token
 * alone as a T_String, or forced scanning of all tokens to the end of
 * the command as T_String.
 * In the past the identifiers for this functionality ended in _ARG:
 *
 * NO_ARG	->	FOLLBY_TOKEN
 * SINGLE_ARG	->	FOLLBY_STRING
 * MULTIPLE_ARG	->	FOLLBY_STRINGS_TO_EOC
 *
 * Note that some tokens use FOLLBY_TOKEN even though they sometimes
 * are followed by strings.  FOLLBY_STRING is used only when needed to
 * avoid the keyword scanner matching a token where a string is needed.
 *
 * FOLLBY_NON_ACCEPT is an overloading of this field to distinguish
 * non-accepting states (where the state number does not match a T_
 * value).
 */
typedef enum {
	FOLLBY_TOKEN = 0,
	FOLLBY_STRING,
	FOLLBY_STRINGS_TO_EOC,
	FOLLBY_NON_ACCEPTING
} follby;

#define MAXLINE		1024	/* maximum length of line */
#define MAXINCLUDELEVEL	5	/* maximum include file levels */

/* STRUCTURES
 * ----------
 */

/* 
 * Define a structure to hold the FSA for the keywords.
 * The structure is actually a trie.
 *
 * To save space, a single u_int32 encodes four fields, and a fifth
 * (the token completed for terminal states) is implied by the index of
 * the rule within the scan state array, taking advantage of the fact
 * there are more scan states than the highest T_ token number.
 *
 * The lowest 8 bits hold the character the state matches on.
 * Bits 8 and 9 hold the followedby value (0 - 3).  For non-accepting
 *   states (which do not match a completed token) the followedby
 *   value 3 (FOLLBY_NONACCEPTING) denotes that fact.  For accepting
 *   states, values 0 - 2 control whether the scanner forces the
 *   following token(s) to strings.
 * Bits 10 through 20 hold the next state to check not matching
 * this state's character.
 * Bits 21 through 31 hold the next state to check matching the char.
 */

#define S_ST(ch, fb, match_n, other_n) (			\
	(u_char)((ch) & 0xff) |					\
	((u_int32)(fb) << 8) |					\
	((u_int32)(match_n) << 10) |				\
	((u_int32)(other_n) << 21)				\
)

#define SS_CH(ss)	((char)(u_char)((ss) & 0xff))
#define SS_FB(ss)	(((u_int)(ss) >>  8) & 0x3)
#define SS_MATCH_N(ss)	(((u_int)(ss) >> 10) & 0x7ff)
#define SS_OTHER_N(ss)	(((u_int)(ss) >> 21) & 0x7ff)

typedef u_int32 scan_state;


/* Structure to hold a filename, file pointer and positional info */
struct FILE_INFO {
	const char *	fname;			/* Path to the file */
	FILE *		fd;			/* File Descriptor */
	int		line_no;		/* Line Number */
	int		col_no;			/* Column Number */
	int		prev_line_col_no;	/* Col No on the 
						   previous line when a
						   '\n' was seen */
	int		prev_token_line_no;	/* Line at start of
						   token */
	int		prev_token_col_no;	/* Col No at start of
						   token */
	int		err_line_no;
	int		err_col_no;
};


/* SCANNER GLOBAL VARIABLES 
 * ------------------------
 */
extern struct config_tree cfgt;	  /* Parser output stored here */
extern int curr_include_level;    /* The current include level */

extern struct FILE_INFO *ip_file; /* Pointer to the configuration file stream */

/* VARIOUS EXTERNAL DECLARATIONS
 * -----------------------------
 */
extern int old_config_style;
extern int input_from_file;
extern struct FILE_INFO *fp[];

/* VARIOUS SUBROUTINE DECLARATIONS
 * -------------------------------
 */
extern const char *keyword(int token);
extern char *quote_if_needed(char *str);
int yylex(void);

struct FILE_INFO *F_OPEN(const char *path, const char *mode);
int FGETC(struct FILE_INFO *stream);
int UNGETC(int ch, struct FILE_INFO *stream);
int FCLOSE(struct FILE_INFO *stream);

void push_back_char(int ch);

#endif	/* NTP_SCANNER_H */
ntp-4.2.6p5/ntpd/refclock_zyfer.c0000644000175000017500000001662111307651604015742 0ustar  peterpeter/*
 * refclock_zyfer - clock driver for the Zyfer GPSTarplus Clock
 *
 * Harlan Stenn, Jan 2002
 */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_ZYFER)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_stdlib.h"
#include "ntp_unixtime.h"

#include 
#include 

#ifdef HAVE_SYS_TERMIOS_H
# include 
#endif
#ifdef HAVE_SYS_PPSCLOCK_H
# include 
#endif

/*
 * This driver provides support for the TOD serial port of a Zyfer GPStarplus.
 * This clock also provides PPS as well as IRIG outputs.
 * Precision is limited by the serial driver, etc.
 *
 * If I was really brave I'd hack/generalize the serial driver to deal
 * with arbitrary on-time characters.  This clock *begins* the stream with
 * `!`, the on-time character, and the string is *not* EOL-terminated.
 *
 * Configure the beast for 9600, 8N1.  While I see leap-second stuff
 * in the documentation, the published specs on the TOD format only show
 * the seconds going to '59'.  I see no leap warning in the TOD format.
 *
 * The clock sends the following message once per second:
 *
 *	!TIME,2002,017,07,59,32,2,4,1
 *	      YYYY DDD HH MM SS m T O
 *
 *	!		On-time character
 *	YYYY		Year
 *	DDD	001-366	Day of Year
 *	HH	00-23	Hour
 *	MM	00-59	Minute
 *	SS	00-59	Second (probably 00-60)
 *	m	1-5	Time Mode:
 *			1 = GPS time
 *			2 = UTC time
 *			3 = LGPS time (Local GPS)
 *			4 = LUTC time (Local UTC)
 *			5 = Manual time
 *	T	4-9	Time Figure Of Merit:
 *			4         x <= 1us
 *			5   1us < x <= 10 us
 *			6  10us < x <= 100us
 *			7 100us < x <= 1ms
 *			8   1ms < x <= 10ms
 *			9  10ms < x
 *	O	0-4	Operation Mode:
 *			0 Warm-up
 *			1 Time Locked
 *			2 Coasting
 *			3 Recovering
 *			4 Manual
 *
 */

/*
 * Interface definitions
 */
#define	DEVICE		"/dev/zyfer%d" /* device name and unit */
#define	SPEED232	B9600	/* uart speed (9600 baud) */
#define	PRECISION	(-20)	/* precision assumed (about 1 us) */
#define	REFID		"GPS\0"	/* reference ID */
#define	DESCRIPTION	"Zyfer GPStarplus" /* WRU */

#define	LENZYFER	29	/* timecode length */

/*
 * Unit control structure
 */
struct zyferunit {
	u_char	Rcvbuf[LENZYFER + 1];
	u_char	polled;		/* poll message flag */
	int	pollcnt;
	l_fp    tstamp;         /* timestamp of last poll */
	int	Rcvptr;
};

/*
 * Function prototypes
 */
static	int	zyfer_start	(int, struct peer *);
static	void	zyfer_shutdown	(int, struct peer *);
static	void	zyfer_receive	(struct recvbuf *);
static	void	zyfer_poll	(int, struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_zyfer = {
	zyfer_start,		/* start up driver */
	zyfer_shutdown,		/* shut down driver */
	zyfer_poll,		/* transmit poll message */
	noentry,		/* not used (old zyfer_control) */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used (old zyfer_buginfo) */
	NOFLAGS			/* not used */
};


/*
 * zyfer_start - open the devices and initialize data for processing
 */
static int
zyfer_start(
	int unit,
	struct peer *peer
	)
{
	register struct zyferunit *up;
	struct refclockproc *pp;
	int fd;
	char device[20];

	/*
	 * Open serial port.
	 * Something like LDISC_ACTS that looked for ! would be nice...
	 */
	(void)sprintf(device, DEVICE, unit);
	if ( !(fd = refclock_open(device, SPEED232, LDISC_RAW)) )
	    return (0);

	msyslog(LOG_NOTICE, "zyfer(%d) fd: %d dev <%s>", unit, fd, device);

	/*
	 * Allocate and initialize unit structure
	 */
	if (!(up = (struct zyferunit *)
	      emalloc(sizeof(struct zyferunit)))) {
		(void) close(fd);
		return (0);
	}
	memset((char *)up, 0, sizeof(struct zyferunit));
	pp = peer->procptr;
	pp->io.clock_recv = zyfer_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		(void) close(fd);
		free(up);
		return (0);
	}
	pp->unitptr = (caddr_t)up;

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	up->pollcnt = 2;
	up->polled = 0;		/* May not be needed... */

	return (1);
}


/*
 * zyfer_shutdown - shut down the clock
 */
static void
zyfer_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct zyferunit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct zyferunit *)pp->unitptr;
	io_closeclock(&pp->io);
	free(up);
}


/*
 * zyfer_receive - receive data from the serial interface
 */
static void
zyfer_receive(
	struct recvbuf *rbufp
	)
{
	register struct zyferunit *up;
	struct refclockproc *pp;
	struct peer *peer;
	int tmode;		/* Time mode */
	int tfom;		/* Time Figure Of Merit */
	int omode;		/* Operation mode */
	u_char *p;
#ifdef PPS
	struct ppsclockev ppsev;
	int request;
#ifdef HAVE_CIOGETEV
        request = CIOGETEV;
#endif
#ifdef HAVE_TIOCGPPSEV
        request = TIOCGPPSEV;
#endif
#endif /* PPS */

	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct zyferunit *)pp->unitptr;
	p = (u_char *) &rbufp->recv_space;
	/*
	 * If lencode is 0:
	 * - if *rbufp->recv_space is !
	 * - - call refclock_gtlin to get things going
	 * - else flush
	 * else stuff it on the end of lastcode
	 * If we don't have LENZYFER bytes
	 * - wait for more data
	 * Crack the beast, and if it's OK, process it.
	 *
	 * We use refclock_gtlin() because we might use LDISC_CLK.
	 *
	 * Under FreeBSD, we get the ! followed by two 14-byte packets.
	 */

	if (pp->lencode >= LENZYFER)
		pp->lencode = 0;

	if (!pp->lencode) {
		if (*p == '!')
			pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode,
						     BMAX, &pp->lastrec);
		else
			return;
	} else {
		memcpy(pp->a_lastcode + pp->lencode, p, rbufp->recv_length);
		pp->lencode += rbufp->recv_length;
		pp->a_lastcode[pp->lencode] = '\0';
	}

	if (pp->lencode < LENZYFER)
		return;

	record_clock_stats(&peer->srcadr, pp->a_lastcode);

	/*
	 * We get down to business, check the timecode format and decode
	 * its contents. If the timecode has invalid length or is not in
	 * proper format, we declare bad format and exit.
	 */

	if (pp->lencode != LENZYFER) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}

	/*
	 * Timecode sample: "!TIME,2002,017,07,59,32,2,4,1"
	 */
	if (sscanf(pp->a_lastcode, "!TIME,%4d,%3d,%2d,%2d,%2d,%d,%d,%d",
		   &pp->year, &pp->day, &pp->hour, &pp->minute, &pp->second,
		   &tmode, &tfom, &omode) != 8) {
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	if (tmode != 2) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}

	/* Should we make sure tfom is 4? */

	if (omode != 1) {
		pp->leap = LEAP_NOTINSYNC;
		return;
	}
#ifdef PPS
	if(ioctl(fdpps,request,(caddr_t) &ppsev) >=0) {
		ppsev.tv.tv_sec += (u_int32) JAN_1970;
		TVTOTS(&ppsev.tv,&up->tstamp);
	}
	/* record the last ppsclock event time stamp */
	pp->lastrec = up->tstamp;
#endif /* PPS */
	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
        }

	/*
	 * Good place for record_clock_stats()
	 */
	up->pollcnt = 2;

	if (up->polled) {
		up->polled = 0;
		refclock_receive(peer);
	}
}


/*
 * zyfer_poll - called by the transmit procedure
 */
static void
zyfer_poll(
	int unit,
	struct peer *peer
	)
{
	register struct zyferunit *up;
	struct refclockproc *pp;

	/*
	 * We don't really do anything here, except arm the receiving
	 * side to capture a sample and check for timeouts.
	 */
	pp = peer->procptr;
	up = (struct zyferunit *)pp->unitptr;
	if (!up->pollcnt)
		refclock_report(peer, CEVNT_TIMEOUT);
	else
		up->pollcnt--;
	pp->polls++;
	up->polled = 1;
}

#else
int refclock_zyfer_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_hopfser.c0000644000175000017500000001675211332473303016252 0ustar  peterpeter/*
 *
 * refclock_hopfser.c
 * - clock driver for hopf serial boards (GPS or DCF77)
 *
 * Date: 30.03.2000 Revision: 01.10
 *
 * latest source and further information can be found at:
 * http://www.ATLSoft.de/ntp
 *
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#if defined(REFCLOCK) && (defined(CLOCK_HOPF_SERIAL))

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_control.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"

#if defined HAVE_SYS_MODEM_H
# include 
# ifndef __QNXNTO__
#  define TIOCMSET MCSETA
#  define TIOCMGET MCGETA
#  define TIOCM_RTS MRTS
# endif
#endif

#ifdef HAVE_TERMIOS_H
# ifdef TERMIOS_NEEDS__SVID3
#  define _SVID3
# endif
# include 
# ifdef TERMIOS_NEEDS__SVID3
#  undef _SVID3
# endif
#endif

#ifdef HAVE_SYS_IOCTL_H
# include 
#endif

#ifdef SYS_WINNT
extern int async_write(int, const void *, unsigned int);
#undef write
#define write(fd, data, octets)	async_write(fd, data, octets)
#endif

/*
 * clock definitions
 */
#define	DESCRIPTION	"hopf Elektronik serial clock" /* Long name */
#define	PRECISION	(-10)	/* precision assumed (about 1 ms) */
#define	REFID		"hopf\0"	/* reference ID */
/*
 * I/O definitions
 */
#define	DEVICE		"/dev/hopfclock%d" 	/* device name and unit */
#define	SPEED232	B9600		    	/* uart speed (9600 baud) */


#define STX 0x02
#define ETX 0x03
#define CR  0x0c
#define LF  0x0a

/* parse states */
#define REC_QUEUE_EMPTY       0
#define REC_QUEUE_FULL        1

#define	HOPF_OPMODE	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_RADIOHP	0x0C	/* high precision radio clock */

/*
 * hopfclock unit control structure.
 */
struct hopfclock_unit {
	l_fp	laststamp;	/* last receive timestamp */
	short	unit;		/* NTP refclock unit number */
	u_long	polled;		/* flag to detect noreplies */
	char	leap_status;	/* leap second flag */
	int	rpt_next;
};

/*
 * Function prototypes
 */

static	int	hopfserial_start	(int, struct peer *);
static	void	hopfserial_shutdown	(int, struct peer *);
static	void	hopfserial_receive	(struct recvbuf *);
static	void	hopfserial_poll		(int, struct peer *);
/* static  void hopfserial_io		(struct recvbuf *); */
/*
 * Transfer vector
 */
struct refclock refclock_hopfser = {
	hopfserial_start,	/* start up driver */
	hopfserial_shutdown,	/* shut down driver */
	hopfserial_poll,	/* transmit poll message */
	noentry,		/* not used  */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used */
	NOFLAGS			/* not used */
};

/*
 * hopfserial_start - open the devices and initialize data for processing
 */
static int
hopfserial_start (
	int unit,
	struct peer *peer
	)
{
	register struct hopfclock_unit *up;
	struct refclockproc *pp;
	int fd;
	char gpsdev[20];

	snprintf(gpsdev, sizeof(gpsdev), DEVICE, unit);

	/* LDISC_STD, LDISC_RAW
	 * Open serial port. Use CLK line discipline, if available.
	 */
	fd = refclock_open(gpsdev, SPEED232, LDISC_CLK);
	if (fd <= 0) {
#ifdef DEBUG
		printf("hopfSerialClock(%d) start: open %s failed\n", unit, gpsdev);
#endif
		return 0;
	}

	msyslog(LOG_NOTICE, "hopfSerialClock(%d) fd: %d dev: %s", unit, fd,
		gpsdev);

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp = peer->procptr;
	pp->unitptr = (caddr_t)up;
	pp->io.clock_recv = hopfserial_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
#ifdef DEBUG
		printf("hopfSerialClock(%d) io_addclock\n", unit);
#endif
		close(fd);
		pp->io.fd = -1;
		free(up);
		pp->unitptr = NULL;
		return (0);
	}

	/*
	 * Initialize miscellaneous variables
	 */
	pp->clockdesc = DESCRIPTION;
	peer->precision = PRECISION;
	peer->burst = NSTAGE;
	memcpy((char *)&pp->refid, REFID, 4);

	up->leap_status = 0;
	up->unit = (short) unit;

	return (1);
}


/*
 * hopfserial_shutdown - shut down the clock
 */
static void
hopfserial_shutdown (
	int unit,
	struct peer *peer
	)
{
	register struct hopfclock_unit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct hopfclock_unit *)pp->unitptr;

	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}



/*
 * hopfserial_receive - receive data from the serial interface
 */

static void
hopfserial_receive (
	struct recvbuf *rbufp
	)
{
	struct hopfclock_unit *up;
	struct refclockproc *pp;
	struct peer *peer;

	int		synch;	/* synchhronization indicator */
	int		DoW;	/* Dow */

	int	day, month;	/* ddd conversion */

	/*
	 * Initialize pointers and read the timecode and timestamp.
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct hopfclock_unit *)pp->unitptr;

	if (up->rpt_next == 0 )
		return;


	up->rpt_next = 0; /* wait until next poll interval occur */

	pp->lencode = (u_short)refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &pp->lastrec);

	if (pp->lencode  == 0)
		return;

	sscanf(pp->a_lastcode,
#if 1
	       "%1x%1x%2d%2d%2d%2d%2d%2d",   /* ...cr,lf */
#else
	       "%*c%1x%1x%2d%2d%2d%2d%2d%2d", /* stx...cr,lf,etx */
#endif
	       &synch,
	       &DoW,
	       &pp->hour,
	       &pp->minute,
	       &pp->second,
	       &day,
	       &month,
	       &pp->year);


	/*
	  Validate received values at least enough to prevent internal
	  array-bounds problems, etc.
	*/
	if((pp->hour < 0) || (pp->hour > 23) ||
	   (pp->minute < 0) || (pp->minute > 59) ||
	   (pp->second < 0) || (pp->second > 60) /*Allow for leap seconds.*/ ||
	   (day < 1) || (day > 31) ||
	   (month < 1) || (month > 12) ||
	   (pp->year < 0) || (pp->year > 99)) {
		/* Data out of range. */
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}
	/*
	  some preparations
	*/
	pp->day    = ymd2yd(pp->year,month,day);
	pp->leap=0;

	/* Year-2000 check! */
	/* wrap 2-digit date into 4-digit */

	if(pp->year < YEAR_PIVOT) { pp->year += 100; }		/* < 98 */
	pp->year += 1900;

	/* preparation for timecode ntpq rl command ! */

#if 0
	snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
		 "STATUS: %1X%1X, DATE: %02d.%02d.%04d  TIME: %02d:%02d:%02d",
		 synch,
		 DoW,
		 day,
		 month,
		 pp->year,
		 pp->hour,
		 pp->minute,
		 pp->second);

	pp->lencode = strlen(pp->a_lastcode);
	if ((synch && 0xc) == 0 ){  /* time ok? */
		refclock_report(peer, CEVNT_BADTIME);
		pp->leap = LEAP_NOTINSYNC;
		return;
	}
#endif
	/*
	 * If clock has no valid status then report error and exit
	 */
	if ((synch & HOPF_OPMODE) == HOPF_INVALID ){  /* time ok? */
		refclock_report(peer, CEVNT_BADTIME);
		pp->leap = LEAP_NOTINSYNC;
		return;
	}

	/*
	 * Test if time is running on internal quarz
	 * if CLK_FLAG1 is set, sychronize even if no radio operation
	 */

	if ((synch & HOPF_OPMODE) == HOPF_INTERNAL){
		if ((pp->sloppyclockflag & CLK_FLAG1) == 0) {
			refclock_report(peer, CEVNT_BADTIME);
			pp->leap = LEAP_NOTINSYNC;
			return;
		}
	}


	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	pp->lastref = pp->lastrec;
	refclock_receive(peer);

#if 0
	msyslog(LOG_ERR, " D:%x  D:%d D:%d",synch,pp->minute,pp->second);
#endif

	record_clock_stats(&peer->srcadr, pp->a_lastcode);

	return;
}


/*
 * hopfserial_poll - called by the transmit procedure
 *
 */
static void
hopfserial_poll (
	int unit,
	struct peer *peer
	)
{
	register struct hopfclock_unit *up;
	struct refclockproc *pp;
	pp = peer->procptr;

	up = (struct hopfclock_unit *)pp->unitptr;

	pp->polls++;
	up->rpt_next = 1;

#if 0
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
#endif

	return;
}

#else
int refclock_hopfser_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_chronolog.c0000644000175000017500000001735211332473272016600 0ustar  peterpeter/*
 * refclock_chronolog - clock driver for Chronolog K-series WWVB receiver.
 */

/*
 * Must interpolate back to local time.  Very annoying.
 */
#define GET_LOCALTIME

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_CHRONOLOG)

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_calendar.h"
#include "ntp_stdlib.h"

#include 
#include 

/*
 * This driver supports the Chronolog K-series WWVB receiver.
 *
 * Input format:
 *
 *	Y YY/MM/DD
 *      Z hh:mm:ss
 *
 * YY/MM/DD -- what you'd expect.  This arrives a few seconds before the
 * timestamp.
 * hh:mm:ss -- what you'd expect.  We take time on the .
 *
 * Our Chronolog writes time out at 2400 bps 8/N/1, but it can be configured
 * otherwise.  The clock seems to appear every 60 seconds, which doesn't make
 * for good statistics collection.
 *
 * The original source of this module was the WWVB module.
 */

/*
 * Interface definitions
 */
#define	DEVICE		"/dev/chronolog%d" /* device name and unit */
#define	SPEED232	B2400	/* uart speed (2400 baud) */
#define	PRECISION	(-13)	/* precision assumed (about 100 us) */
#define	REFID		"chronolog"	/* reference ID */
#define	DESCRIPTION	"Chrono-log K" /* WRU */

#define MONLIN		15	/* number of monitoring lines */

/*
 * Chrono-log unit control structure
 */
struct chronolog_unit {
	u_char	tcswitch;	/* timecode switch */
	l_fp	laststamp;	/* last receive timestamp */
	u_char	lasthour;	/* last hour (for monitor) */
	int   	year;	        /* Y2K-adjusted year */
	int   	day;	        /* day-of-month */
        int   	month;	        /* month-of-year */
};

/*
 * Function prototypes
 */
static	int	chronolog_start		(int, struct peer *);
static	void	chronolog_shutdown	(int, struct peer *);
static	void	chronolog_receive	(struct recvbuf *);
static	void	chronolog_poll		(int, struct peer *);

/*
 * Transfer vector
 */
struct	refclock refclock_chronolog = {
	chronolog_start,	/* start up driver */
	chronolog_shutdown,	/* shut down driver */
	chronolog_poll,		/* poll the driver -- a nice fabrication */
	noentry,		/* not used */
	noentry,		/* not used */
	noentry,		/* not used */
	NOFLAGS			/* not used */
};


/*
 * chronolog_start - open the devices and initialize data for processing
 */
static int
chronolog_start(
	int unit,
	struct peer *peer
	)
{
	register struct chronolog_unit *up;
	struct refclockproc *pp;
	int fd;
	char device[20];

	/*
	 * Open serial port. Don't bother with CLK line discipline, since
	 * it's not available.
	 */
	snprintf(device, sizeof(device), DEVICE, unit);
#ifdef DEBUG
	if (debug)
		printf ("starting Chronolog with device %s\n",device);
#endif
	if (!(fd = refclock_open(device, SPEED232, 0)))
		return (0);

	/*
	 * Allocate and initialize unit structure
	 */
	up = emalloc(sizeof(*up));
	memset(up, 0, sizeof(*up));
	pp = peer->procptr;
	pp->unitptr = (caddr_t)up;
	pp->io.clock_recv = chronolog_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
		close(fd);
		pp->io.fd = -1;
		free(up);
		pp->unitptr = NULL;
		return (0);
	}

	/*
	 * Initialize miscellaneous variables
	 */
	peer->precision = PRECISION;
	pp->clockdesc = DESCRIPTION;
	memcpy((char *)&pp->refid, REFID, 4);
	return (1);
}


/*
 * chronolog_shutdown - shut down the clock
 */
static void
chronolog_shutdown(
	int unit,
	struct peer *peer
	)
{
	register struct chronolog_unit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct chronolog_unit *)pp->unitptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}


/*
 * chronolog_receive - receive data from the serial interface
 */
static void
chronolog_receive(
	struct recvbuf *rbufp
	)
{
	struct chronolog_unit *up;
	struct refclockproc *pp;
	struct peer *peer;

	l_fp	     trtmp;	/* arrival timestamp */
	int          hours;	/* hour-of-day */
	int	     minutes;	/* minutes-past-the-hour */
	int          seconds;	/* seconds */
	int	     temp;	/* int temp */
	int          got_good;	/* got a good time flag */

	/*
	 * Initialize pointers and read the timecode and timestamp
	 */
	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct chronolog_unit *)pp->unitptr;
	temp = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);

	if (temp == 0) {
		if (up->tcswitch == 0) {
			up->tcswitch = 1;
			up->laststamp = trtmp;
		} else
		    up->tcswitch = 0;
		return;
	}
	pp->lencode = temp;
	pp->lastrec = up->laststamp;
	up->laststamp = trtmp;
	up->tcswitch = 1;

#ifdef DEBUG
	if (debug)
		printf("chronolog: timecode %d %s\n", pp->lencode,
		    pp->a_lastcode);
#endif

	/*
	 * We get down to business. Check the timecode format and decode
	 * its contents. This code uses the first character to see whether
	 * we're looking at a date or a time.  We store data data across
	 * calls since it is transmitted a few seconds ahead of the
	 * timestamp.
	 */
	got_good=0;
	if (sscanf(pp->a_lastcode, "Y %d/%d/%d", &up->year,&up->month,&up->day))
	{
	    /*
	     * Y2K convert the 2-digit year
	     */
	    up->year = up->year >= 69 ? up->year : up->year + 100;
	    return;
	}
	if (sscanf(pp->a_lastcode,"Z %02d:%02d:%02d",
		   &hours,&minutes,&seconds) == 3)
	{
#ifdef GET_LOCALTIME
	    struct tm  local;
	    struct tm *gmtp;
	    time_t     unixtime;
	    int        adjyear;
	    int        adjmon;

	    /*
	     * Convert to GMT for sites that distribute localtime.  This
             * means we have to do Y2K conversion on the 2-digit year;
	     * otherwise, we get the time wrong.
	     */
	    
	    memset(&local, 0, sizeof(local));

	    local.tm_year  = up->year;
	    local.tm_mon   = up->month-1;
	    local.tm_mday  = up->day;
	    local.tm_hour  = hours;
	    local.tm_min   = minutes;
	    local.tm_sec   = seconds;
	    local.tm_isdst = -1;

	    unixtime = mktime (&local);
	    if ((gmtp = gmtime (&unixtime)) == NULL)
	    {
		refclock_report (peer, CEVNT_FAULT);
		return;
	    }
	    adjyear = gmtp->tm_year+1900;
	    adjmon  = gmtp->tm_mon+1;
	    pp->day = ymd2yd (adjyear, adjmon, gmtp->tm_mday);
	    pp->hour   = gmtp->tm_hour;
	    pp->minute = gmtp->tm_min;
	    pp->second = gmtp->tm_sec;
#ifdef DEBUG
	    if (debug)
		printf ("time is %04d/%02d/%02d %02d:%02d:%02d UTC\n",
			adjyear,adjmon,gmtp->tm_mday,pp->hour,pp->minute,
			pp->second);
#endif
	    
#else
	    /*
	     * For more rational sites distributing UTC
	     */
	    pp->day    = ymd2yd(year+1900,month,day);
	    pp->hour   = hours;
	    pp->minute = minutes;
	    pp->second = seconds;

#endif
	    got_good=1;
	}

	if (!got_good)
	    return;


	/*
	 * Process the new sample in the median filter and determine the
	 * timecode timestamp.
	 */
	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	pp->lastref = pp->lastrec;
	refclock_receive(peer);
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
	up->lasthour = pp->hour;
}


/*
 * chronolog_poll - called by the transmit procedure
 */
static void
chronolog_poll(
	int unit,
	struct peer *peer
	)
{
	/*
	 * Time to poll the clock. The Chrono-log clock is supposed to
	 * respond to a 'T' by returning a timecode in the format(s)
	 * specified above.  Ours does (can?) not, but this seems to be
	 * an installation-specific problem.  This code is dyked out,
	 * but may be re-enabled if anyone ever finds a Chrono-log that
	 * actually listens to this command.
	 */
#if 0
	register struct chronolog_unit *up;
	struct refclockproc *pp;
	char pollchar;

	pp = peer->procptr;
	up = (struct chronolog_unit *)pp->unitptr;
	if (peer->burst == 0 && peer->reach == 0)
		refclock_report(peer, CEVNT_TIMEOUT);
	if (up->linect > 0)
		pollchar = 'R';
	else
		pollchar = 'T';
	if (write(pp->io.fd, &pollchar, 1) != 1)
		refclock_report(peer, CEVNT_FAULT);
	else
		pp->polls++;
#endif
}

#else
int refclock_chronolog_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/refclock_palisade.c0000644000175000017500000007064711510477207016376 0ustar  peterpeter/*
 * This software was developed by the Software and Component Technologies
 * group of Trimble Navigation, Ltd.
 *
 * Copyright (c) 1997, 1998, 1999, 2000  Trimble Navigation Ltd.
 * 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.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *    This product includes software developed by Trimble Navigation, Ltd.
 * 4. The name of Trimble Navigation Ltd. may not be used to endorse or
 *    promote products derived from this software without specific prior
 *    written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY TRIMBLE NAVIGATION LTD. ``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 TRIMBLE NAVIGATION LTD. 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.
 */

/*
 * refclock_palisade - clock driver for the Trimble Palisade GPS
 * timing receiver
 *
 * For detailed information on this program, please refer to the html 
 * Refclock 29 page accompanying the NTP distribution.
 *
 * for questions / bugs / comments, contact:
 * sven_dietrich@trimble.com
 *
 * Sven-Thorsten Dietrich
 * 645 North Mary Avenue
 * Post Office Box 3642
 * Sunnyvale, CA 94088-3642
 *
 * Version 2.45; July 14, 1999
 *
 *
 *
 * 31/03/06: Added support for Thunderbolt GPS Disciplined Clock.
 *	     Contact: Fernando Pablo Hauscarriaga
 * 	     E-mail: fernandoph@iar.unlp.edu.ar
 * 	     Home page: www.iar.unlp.edu.ar/~fernandoph
 *		  Instituto Argentino de Radioastronomia
 *			    www.iar.unlp.edu.ar
 *
 * 14/01/07: Conditinal compilation for Thunderbolt support no longer needed
 *	     now we use mode 2 for decode thunderbolt packets.
 *	     Fernando P. Hauscarriaga
 *
 * 30/08/09: Added support for Trimble Acutime Gold Receiver.
 *	     Fernando P. Hauscarriaga (fernandoph@iar.unlp.edu.ar)
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#if defined(REFCLOCK) && defined(CLOCK_PALISADE)

#ifdef SYS_WINNT
extern int async_write(int, const void *, unsigned int);
#undef write
#define write(fd, data, octets)	async_write(fd, data, octets)
#endif

#include "refclock_palisade.h"
/* Table to get from month to day of the year */
const int days_of_year [12] = {
	0,  31,  59,  90, 120, 151, 181, 212, 243, 273, 304, 334
};

#ifdef DEBUG
const char * Tracking_Status[15][15] = { 
	{ "Doing Fixes\0" }, { "Good 1SV\0" }, { "Approx. 1SV\0" },
	{"Need Time\0" }, { "Need INIT\0" }, { "PDOP too High\0" },
	{ "Bad 1SV\0" }, { "0SV Usable\0" }, { "1SV Usable\0" },
	{ "2SV Usable\0" }, { "3SV Usable\0" }, { "No Integrity\0" },
	{ "Diff Corr\0" }, { "Overdet Clock\0" }, { "Invalid\0" } };
#endif

/*
 * Transfer vector
 */
struct refclock refclock_palisade = {
	palisade_start,		/* start up driver */
	palisade_shutdown,	/* shut down driver */
	palisade_poll,		/* transmit poll message */
	noentry,		/* not used  */
	noentry,		/* initialize driver (not used) */
	noentry,		/* not used */
	NOFLAGS			/* not used */
};

int day_of_year (char *dt);

/* Extract the clock type from the mode setting */
#define CLK_TYPE(x) ((int)(((x)->ttl) & 0x7F))

/* Supported clock types */
#define CLK_TRIMBLE	0	/* Trimble Palisade */
#define CLK_PRAECIS	1	/* Endrun Technologies Praecis */
#define CLK_THUNDERBOLT	2	/* Trimble Thunderbolt GPS Receiver */
#define CLK_ACUTIME     3	/* Trimble Acutime Gold */
#define CLK_ACUTIMEB    4	/* Trimble Actutime Gold Port B */

int praecis_msg;
static void praecis_parse(struct recvbuf *rbufp, struct peer *peer);

/* These routines are for sending packets to the Thunderbolt receiver
 * They are taken from Markus Prosch
 */

#ifdef PALISADE_SENDCMD_RESURRECTED
/*
 * sendcmd - Build data packet for sending
 */
static void 
sendcmd (
	struct packettx *buffer,
	int c
	)
{
	*buffer->data = DLE;
	*(buffer->data + 1) = (unsigned char)c;
	buffer->size = 2;
}
#endif	/* PALISADE_SENDCMD_RESURRECTED */

/*
 * sendsupercmd - Build super data packet for sending
 */
static void 
sendsupercmd (
	struct packettx *buffer,
	int c1,
	int c2
	)
{
	*buffer->data = DLE;
	*(buffer->data + 1) = (unsigned char)c1;
	*(buffer->data + 2) = (unsigned char)c2;
	buffer->size = 3;
}

/*
 * sendbyte -
 */
static void 
sendbyte (
	struct packettx *buffer,
	int b
	)
{
	if (b == DLE)
		*(buffer->data+buffer->size++) = DLE;
	*(buffer->data+buffer->size++) = (unsigned char)b;
}

/*
 * sendint -
 */
static void 
sendint (
	struct packettx *buffer,
	int a
	)
{
	sendbyte(buffer, (unsigned char)((a>>8) & 0xff));
	sendbyte(buffer, (unsigned char)(a & 0xff));
}

/*
 * sendetx - Send packet or super packet to the device
 */
static int 
sendetx (
	struct packettx *buffer,
	int fd
	)
{
	int result;
	
	*(buffer->data+buffer->size++) = DLE;
	*(buffer->data+buffer->size++) = ETX;
	result = write(fd, buffer->data, (unsigned long)buffer->size);
	
	if (result != -1)
		return (result);
	else
		return (-1);
}

/*
 * init_thunderbolt - Prepares Thunderbolt receiver to be used with
 *		      NTP (also taken from Markus Prosch).
 */
static void
init_thunderbolt (
	int fd
	)
{
	struct packettx tx;
	
	tx.size = 0;
	tx.data = (u_char *) malloc(100);

	/* set UTC time */
	sendsupercmd (&tx, 0x8E, 0xA2);
	sendbyte     (&tx, 0x3);
	sendetx      (&tx, fd);
	
	/* activate packets 0x8F-AB and 0x8F-AC */
	sendsupercmd (&tx, 0x8F, 0xA5);
	sendint      (&tx, 0x5);
	sendetx      (&tx, fd);

	free(tx.data);
}

/*
 * init_acutime - Prepares Acutime Receiver to be used with NTP
 */
static void
init_acutime (
	int fd
	)
{
	/* Disable all outputs, Enable Event-Polling on PortA so
	   we can ask for time packets */
	struct packettx tx;

	tx.size = 0;
	tx.data = (u_char *) malloc(100);

	sendsupercmd(&tx, 0x8E, 0xA5);
	sendbyte(&tx, 0x02);
	sendbyte(&tx, 0x00);
	sendbyte(&tx, 0x00);
	sendbyte(&tx, 0x00);
	sendetx(&tx, fd);

	free(tx.data);
}

/*
 * palisade_start - open the devices and initialize data for processing
 */
static int
palisade_start (
	int unit,
	struct peer *peer
	)
{
	struct palisade_unit *up;
	struct refclockproc *pp;
	int fd;
	char gpsdev[20];
	struct termios tio;

	snprintf(gpsdev, sizeof(gpsdev), DEVICE, unit);

	/*
	 * Open serial port. 
	 */
	fd = refclock_open(gpsdev, SPEED232, LDISC_RAW);
	if (fd <= 0) {
#ifdef DEBUG
		printf("Palisade(%d) start: open %s failed\n", unit, gpsdev);
#endif
		return 0;
	}

	msyslog(LOG_NOTICE, "Palisade(%d) fd: %d dev: %s", unit, fd,
		gpsdev);

	if (tcgetattr(fd, &tio) < 0) {
		msyslog(LOG_ERR, 
			"Palisade(%d) tcgetattr(fd, &tio): %m",unit);
#ifdef DEBUG
		printf("Palisade(%d) tcgetattr(fd, &tio)\n",unit);
#endif
		close(fd);
		return (0);
	}

	tio.c_cflag |= (PARENB|PARODD);
	tio.c_iflag &= ~ICRNL;

	/*
	 * Allocate and initialize unit structure
	 */
	up = (struct palisade_unit *) emalloc(sizeof(struct palisade_unit));

	memset((char *)up, 0, sizeof(struct palisade_unit));

	up->type = CLK_TYPE(peer);
	switch (up->type) {
	    case CLK_TRIMBLE:
		/* Normal mode, do nothing */
		break;
	    case CLK_PRAECIS:
		msyslog(LOG_NOTICE, "Palisade(%d) Praecis mode enabled\n"
			,unit);
		break;
	    case CLK_THUNDERBOLT:
		msyslog(LOG_NOTICE, "Palisade(%d) Thunderbolt mode enabled\n"
			,unit);
		tio.c_cflag = (CS8|CLOCAL|CREAD);
		break;
	    case CLK_ACUTIME:
		msyslog(LOG_NOTICE, "Palisade(%d) Acutime Gold mode enabled\n"
			,unit);
		break;
	    default:
		msyslog(LOG_NOTICE, "Palisade(%d) mode unknown\n",unit);
		break;
	}
	if (tcsetattr(fd, TCSANOW, &tio) == -1) {
		msyslog(LOG_ERR, "Palisade(%d) tcsetattr(fd, &tio): %m",unit);
#ifdef DEBUG
		printf("Palisade(%d) tcsetattr(fd, &tio)\n",unit);
#endif
		close(fd);
		free(up);
		return 0;
	}

	pp = peer->procptr;
	pp->io.clock_recv = palisade_io;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd;
	if (!io_addclock(&pp->io)) {
#ifdef DEBUG
		printf("Palisade(%d) io_addclock\n",unit);
#endif
		close(fd);
		pp->io.fd = -1;
		free(up);
		return (0);
	}

	/*
	 * Initialize miscellaneous variables
	 */
	pp->unitptr = (caddr_t)up;
	pp->clockdesc = DESCRIPTION;

	peer->precision = PRECISION;
	peer->sstclktype = CTL_SST_TS_UHF;
	peer->minpoll = TRMB_MINPOLL;
	peer->maxpoll = TRMB_MAXPOLL;
	memcpy((char *)&pp->refid, REFID, 4);
	
	up->leap_status = 0;
	up->unit = (short) unit;
	up->rpt_status = TSIP_PARSED_EMPTY;
	up->rpt_cnt = 0;

	if (up->type == CLK_THUNDERBOLT)
		init_thunderbolt(fd);
	if (up->type == CLK_ACUTIME)
		init_acutime(fd);

	return 1;
}


/*
 * palisade_shutdown - shut down the clock
 */
static void
palisade_shutdown (
	int unit,
	struct peer *peer
	)
{
	struct palisade_unit *up;
	struct refclockproc *pp;
	pp = peer->procptr;
	up = (struct palisade_unit *)pp->unitptr;
	if (-1 != pp->io.fd)
		io_closeclock(&pp->io);
	if (NULL != up)
		free(up);
}



/* 
 * unpack_date - get day and year from date
 */
int
day_of_year (
	char * dt
	)
{
	int day, mon, year;

	mon = dt[1];
	/* Check month is inside array bounds */
	if ((mon < 1) || (mon > 12)) 
		return -1;

	day = dt[0] + days_of_year[mon - 1];
	year = getint((u_char *) (dt + 2)); 

	if ( !(year % 4) && ((year % 100) || 
			     (!(year % 100) && !(year%400)))
	     &&(mon > 2))
		day ++; /* leap year and March or later */

	return day;
}


/* 
 * TSIP_decode - decode the TSIP data packets 
 */
int
TSIP_decode (
	struct peer *peer
	)
{
	int st;
	long   secint;
	double secs;
	double secfrac;
	unsigned short event = 0;

	struct palisade_unit *up;
	struct refclockproc *pp;

	pp = peer->procptr;
	up = (struct palisade_unit *)pp->unitptr;

	/*
	 * Check the time packet, decode its contents. 
	 * If the timecode has invalid length or is not in
	 * proper format, declare bad format and exit.
	 */

	if ((up->type != CLK_THUNDERBOLT) & (up->type != CLK_ACUTIME)){
		if ((up->rpt_buf[0] == (char) 0x41) ||
		    (up->rpt_buf[0] == (char) 0x46) ||
		    (up->rpt_buf[0] == (char) 0x54) ||
		    (up->rpt_buf[0] == (char) 0x4B) ||
		    (up->rpt_buf[0] == (char) 0x6D)) {

			/* standard time packet - GPS time and GPS week number */
#ifdef DEBUG
			printf("Palisade Port B packets detected. Connect to Port A\n");
#endif

			return 0;	
		}
	}

	/*
	 * We cast both to u_char to as 0x8f uses the sign bit on a char
	 */
	if ((u_char) up->rpt_buf[0] == (u_char) 0x8f) {
		/* 
		 * Superpackets
		 */
		event = (unsigned short) (getint((u_char *) &mb(1)) & 0xffff);
		if (!((pp->sloppyclockflag & CLK_FLAG2) || event)) 
			/* Ignore Packet */
			return 0;	   
	
		switch (mb(0) & 0xff) {
			int GPS_UTC_Offset;
			long tow;

		    case PACKET_8F0B: 

			if (up->polled <= 0)
				return 0;

			if (up->rpt_cnt != LENCODE_8F0B)  /* check length */
				break;
		
#ifdef DEBUG
			if (debug > 1) {
				int ts;
				double lat, lon, alt;
				lat = getdbl((u_char *) &mb(42)) * R2D;
				lon = getdbl((u_char *) &mb(50)) * R2D;
				alt = getdbl((u_char *) &mb(58));

				printf("TSIP_decode: unit %d: Latitude: %03.4f Longitude: %03.4f Alt: %05.2f m\n",
				       up->unit, lat,lon,alt);
				printf("TSIP_decode: unit %d: Sats:",
				       up->unit);
				for (st = 66, ts = 0; st <= 73; st++)
					if (mb(st)) {
						if (mb(st) > 0) ts++;
						printf(" %02d", mb(st));
					}
				printf(" : Tracking %d\n", ts); 
			}
#endif

			GPS_UTC_Offset = getint((u_char *) &mb(16));  
			if (GPS_UTC_Offset == 0) { /* Check UTC offset */ 
#ifdef DEBUG
				printf("TSIP_decode: UTC Offset Unknown\n");
#endif
				break;
			}

			secs = getdbl((u_char *) &mb(3));
			secint = (long) secs;
			secfrac = secs - secint; /* 0.0 <= secfrac < 1.0 */

			pp->nsec = (long) (secfrac * 1000000000); 

			secint %= 86400;    /* Only care about today */
			pp->hour = secint / 3600;
			secint %= 3600;
			pp->minute = secint / 60;
			secint %= 60;
			pp->second = secint % 60;
		
			if ((pp->day = day_of_year(&mb(11))) < 0) break;

			pp->year = getint((u_char *) &mb(13)); 

#ifdef DEBUG
			if (debug > 1)
				printf("TSIP_decode: unit %d: %02X #%d %02d:%02d:%02d.%06ld %02d/%02d/%04d UTC %02d\n",
				       up->unit, mb(0) & 0xff, event, pp->hour, pp->minute, 
				       pp->second, pp->nsec, mb(12), mb(11), pp->year, GPS_UTC_Offset);
#endif
			/* Only use this packet when no
			 * 8F-AD's are being received
			 */

			if (up->leap_status) {
				up->leap_status = 0;
				return 0;
			}

			return 2;
			break;

		    case PACKET_NTP:
			/* Palisade-NTP Packet */

			if (up->rpt_cnt != LENCODE_NTP) /* check length */
				break;
	
			up->leap_status = mb(19);

			if (up->polled  <= 0) 
				return 0;
				
			/* Check Tracking Status */
			st = mb(18);
			if (st < 0 || st > 14)
				st = 14;
			if ((st >= 2 && st <= 7) || st == 11 || st == 12) {
#ifdef DEBUG
				printf("TSIP_decode: Not Tracking Sats : %s\n",
				       *Tracking_Status[st]);
#endif
				refclock_report(peer, CEVNT_BADTIME);
				up->polled = -1;
				return 0;
				break;
			}

			if (up->leap_status & PALISADE_LEAP_PENDING) {
				if (up->leap_status & PALISADE_UTC_TIME)  
					pp->leap = LEAP_ADDSECOND;
				else
					pp->leap = LEAP_DELSECOND;
			}
			else if (up->leap_status)
				pp->leap = LEAP_NOWARNING;
		
			else {  /* UTC flag is not set:
				 * Receiver may have been reset, and lost
				 * its UTC almanac data */
				pp->leap = LEAP_NOTINSYNC;
#ifdef DEBUG
				printf("TSIP_decode: UTC Almanac unavailable: %d\n",
				       mb(19));	
#endif
				refclock_report(peer, CEVNT_BADTIME);
				up->polled = -1;
				return 0;
			}

			pp->nsec = (long) (getdbl((u_char *) &mb(3))
					   * 1000000000);

			if ((pp->day = day_of_year(&mb(14))) < 0) 
				break;
			pp->year = getint((u_char *) &mb(16)); 
			pp->hour = mb(11);
			pp->minute = mb(12);
			pp->second = mb(13);

#ifdef DEBUG
			if (debug > 1)
				printf("TSIP_decode: unit %d: %02X #%d %02d:%02d:%02d.%06ld %02d/%02d/%04d UTC %02x %s\n",
				       up->unit, mb(0) & 0xff, event, pp->hour, pp->minute, 
				       pp->second, pp->nsec, mb(15), mb(14), pp->year,
				       mb(19), *Tracking_Status[st]);
#endif
			return 1;
			break;

		    case PACKET_8FAC:   
			if (up->polled <= 0)
				return 0; 

			if (up->rpt_cnt != LENCODE_8FAC)/* check length */
				break;

#ifdef DEBUG
			if (debug > 1) {
				double lat, lon, alt;
				lat = getdbl((u_char *) &mb(36)) * R2D;
				lon = getdbl((u_char *) &mb(44)) * R2D;
				alt = getdbl((u_char *) &mb(52));

				printf("TSIP_decode: unit %d: Latitude: %03.4f Longitude: %03.4f Alt: %05.2f m\n",
				       up->unit, lat,lon,alt);
				printf("TSIP_decode: unit %d\n", up->unit);
			}
#endif
			if (getint((u_char *) &mb(10)) & 0x80) 
				pp->leap = LEAP_ADDSECOND;  /* we ASSUME addsecond */
			else 
				pp->leap = LEAP_NOWARNING;

#ifdef DEBUG
			if (debug > 1) 
				printf("TSIP_decode: unit %d: 0x%02x leap %d\n",
				       up->unit, mb(0) & 0xff, pp->leap);
			if (debug > 1) {
				printf("Receiver MODE: 0x%02X\n", (u_char)mb(1));
				if (mb(1) == 0x00)
					printf("                AUTOMATIC\n");
				if (mb(1) == 0x01)
					printf("                SINGLE SATELLITE\n");   
				if (mb(1) == 0x03)
					printf("                HORIZONTAL(2D)\n");
				if (mb(1) == 0x04)
					printf("                FULL POSITION(3D)\n");
				if (mb(1) == 0x05)
					printf("                DGPR REFERENCE\n");
				if (mb(1) == 0x06)
					printf("                CLOCK HOLD(2D)\n");
				if (mb(1) == 0x07)
					printf("                OVERDETERMINED CLOCK\n");

				printf("\n** Disciplining MODE 0x%02X:\n", (u_char)mb(2));
				if (mb(2) == 0x00)
					printf("                NORMAL\n");
				if (mb(2) == 0x01)
					printf("                POWER-UP\n");
				if (mb(2) == 0x02)
					printf("                AUTO HOLDOVER\n");
				if (mb(2) == 0x03)
					printf("                MANUAL HOLDOVER\n");
				if (mb(2) == 0x04)
					printf("                RECOVERY\n");
				if (mb(2) == 0x06)
					printf("                DISCIPLINING DISABLED\n");
			}
#endif   
			return 0;
			break;

		    case PACKET_8FAB:
			/* Thunderbolt Primary Timing Packet */

			if (up->rpt_cnt != LENCODE_8FAB) /* check length */
				break;

			if (up->polled  <= 0)
				return 0;

			GPS_UTC_Offset = getint((u_char *) &mb(7));

			if (GPS_UTC_Offset == 0){ /* Check UTC Offset */
#ifdef DEBUG
				printf("TSIP_decode: UTC Offset Unknown\n");
#endif
				break;
			}


			if ((mb(9) & 0x1d) == 0x0) {
				/* if we know the GPS time and the UTC offset,
				   we expect UTC timing information !!! */

				pp->leap = LEAP_NOTINSYNC;
				refclock_report(peer, CEVNT_BADTIME);
				up->polled = -1;
				return 0;
			}

			pp->nsec = 0;
#ifdef DEBUG		
			printf("\nTiming Flags are:\n");
			printf("Timing flag value is: 0x%X\n", mb(9));
			if ((mb(9) & 0x01) != 0)
				printf ("	Getting UTC time\n");
			else
				printf ("	Getting GPS time\n");
			if ((mb(9) & 0x02) != 0)
				printf ("	PPS is from UTC\n");
			else
				printf ("	PPS is from GPS\n");
			if ((mb(9) & 0x04) != 0)
				printf ("	Time is not Set\n");
			else
				printf ("	Time is Set\n");
			if ((mb(9) & 0x08) != 0)
				printf("	I dont have UTC info\n");
			else
				printf ("	I have UTC info\n");
			if ((mb(9) & 0x10) != 0)
				printf ("	Time is from USER\n\n");
			else
				printf ("	Time is from GPS\n\n");	
#endif		

			if ((pp->day = day_of_year(&mb(13))) < 0)
				break;
			tow = getlong((u_char *) &mb(1));
#ifdef DEBUG		
			if (debug > 1) {
				printf("pp->day: %d\n", pp->day); 
				printf("TOW: %ld\n", tow);
				printf("DAY: %d\n", mb(13));
			}
#endif
			pp->year = getint((u_char *) &mb(15));
			pp->hour = mb(12);
			pp->minute = mb(11);
			pp->second = mb(10);


#ifdef DEBUG
			if (debug > 1)
				printf("TSIP_decode: unit %d: %02X #%d %02d:%02d:%02d.%06ld %02d/%02d/%04d ",up->unit, mb(0) & 0xff, event, pp->hour, pp->minute, pp->second, pp->nsec, mb(14), mb(13), pp->year);
#endif
			return 1;
			break;

		    default:
			/* Ignore Packet */
			return 0;
		} /* switch */
	} /* if 8F packets */

	else if (up->rpt_buf[0] == (u_char)0x42) {
		printf("0x42\n");
		return 0;
	}
	else if (up->rpt_buf[0] == (u_char)0x43) {
		printf("0x43\n");
		return 0;
	}
	else if ((up->rpt_buf[0] == PACKET_41) & (up->type == CLK_THUNDERBOLT)){
		printf("Undocumented 0x41 packet on Thunderbolt\n");
		return 0;
	}
	else if ((up->rpt_buf[0] == PACKET_41A) & (up->type == CLK_ACUTIME)) {
#ifdef DEBUG
		printf("GPS TOW: %ld\n", getlong((u_char *) &mb(0)));
		printf("GPS WN: %d\n", getint((u_char *) &mb(4)));
		printf("GPS UTC-GPS Offser: %ld\n", getlong((u_char *) &mb(6)));
#endif
		return 0;
	}

	/* Health Status for Acutime Receiver */
	else if ((up->rpt_buf[0] == PACKET_46) & (up->type == CLK_ACUTIME)) {
#ifdef DEBUG
		if (debug > 1)
		/* Status Codes */
			switch (mb(0)) {
			    case 0x00:
				printf ("Doing Position Fixes\n");
				break;
			    case 0x01:
				printf ("Do no have GPS time yet\n");
				break;
			    case 0x03:
				printf ("PDOP is too high\n");
				break;
			    case 0x08:
				printf ("No usable satellites\n");
				break;
			    case 0x09:
				printf ("Only 1 usable satellite\n");
				break;
			    case 0x0A:
				printf ("Only 2 usable satellites\n");
				break;
			    case 0x0B:
				printf ("Only 3 usable satellites\n");
				break;
			    case 0x0C:
				printf("The Chosen satellite is unusable\n");
				break;
			}
#endif
		/* Error Codes */
		if (mb(1) != 0)	{
			
			refclock_report(peer, CEVNT_BADTIME);
			up->polled = -1;
#ifdef DEBUG
			if (debug > 1) {
				if (mb(1) && 0x01)
					printf ("Signal Processor Error, reset unit.\n");
				if (mb(1) && 0x02)
					printf ("Alignment error, channel or chip 1, reset unit.\n");
				if (mb(1) && 0x03)
					printf ("Alignment error, channel or chip 2, reset unit.\n");
				if (mb(1) && 0x04)
					printf ("Antenna feed line fault (open or short)\n");
				if (mb(1) && 0x05)
					printf ("Excessive reference frequency error, refer to packet 0x2D and packet 0x4D documentation for further information\n");
			}
#endif
		
		return 0;
		}
	}
	else if (up->rpt_buf[0] == 0x54)
		return 0;

	else if (up->rpt_buf[0] == PACKET_6D) {
#ifdef DEBUG
		int sats;

		if ((mb(0) & 0x01) && (mb(0) & 0x02))
			printf("2d Fix Dimension\n");
		if (mb(0) & 0x04)
			printf("3d Fix Dimension\n");

		if (mb(0) & 0x08)
			printf("Fix Mode is MANUAL\n");
		else
			printf("Fix Mode is AUTO\n");
	
		sats = mb(0) & 0xF0;
		sats = sats >> 4;
		printf("Tracking %d Satellites\n", sats);
#endif
		return 0;
	} /* else if not super packet */
	refclock_report(peer, CEVNT_BADREPLY);
	up->polled = -1;
#ifdef DEBUG
	printf("TSIP_decode: unit %d: bad packet %02x-%02x event %d len %d\n", 
	       up->unit, up->rpt_buf[0] & 0xff, mb(0) & 0xff, 
	       event, up->rpt_cnt);
#endif
	return 0;
}

/*
 * palisade__receive - receive data from the serial interface
 */

static void
palisade_receive (
	struct peer * peer
	)
{
	struct palisade_unit *up;
	struct refclockproc *pp;

	/*
	 * Initialize pointers and read the timecode and timestamp.
	 */
	pp = peer->procptr;
	up = (struct palisade_unit *)pp->unitptr;
		
	if (! TSIP_decode(peer)) return;
	
	if (up->polled <= 0) 
		return;   /* no poll pending, already received or timeout */

	up->polled = 0;  /* Poll reply received */
	pp->lencode = 0; /* clear time code */
#ifdef DEBUG
	if (debug) 
		printf(
			"palisade_receive: unit %d: %4d %03d %02d:%02d:%02d.%06ld\n",
			up->unit, pp->year, pp->day, pp->hour, pp->minute, 
			pp->second, pp->nsec);
#endif

	/*
	 * Process the sample
	 * Generate timecode: YYYY DoY HH:MM:SS.microsec 
	 * report and process 
	 */

	snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
		 "%4d %03d %02d:%02d:%02d.%06ld",
		 pp->year, pp->day,
		 pp->hour,pp->minute, pp->second, pp->nsec); 
	pp->lencode = 24;

	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);

#ifdef DEBUG
		printf("palisade_receive: unit %d: refclock_process failed!\n",
		       up->unit);
#endif
		return;
	}

	record_clock_stats(&peer->srcadr, pp->a_lastcode); 

#ifdef DEBUG
	if (debug)
		printf("palisade_receive: unit %d: %s\n",
		       up->unit, prettydate(&pp->lastrec));
#endif
	pp->lastref = pp->lastrec;
	refclock_receive(peer);
}


/*
 * palisade_poll - called by the transmit procedure
 *
 */
static void
palisade_poll (
	int unit,
	struct peer *peer
	)
{
	struct palisade_unit *up;
	struct refclockproc *pp;
	
	pp = peer->procptr;
	up = (struct palisade_unit *)pp->unitptr;

	pp->polls++;
	if (up->polled > 0) /* last reply never arrived or error */ 
		refclock_report(peer, CEVNT_TIMEOUT);

	up->polled = 2; /* synchronous packet + 1 event */
	
#ifdef DEBUG
	if (debug)
		printf("palisade_poll: unit %d: polling %s\n", unit,
		       (pp->sloppyclockflag & CLK_FLAG2) ? 
		       "synchronous packet" : "event");
#endif 

	if (pp->sloppyclockflag & CLK_FLAG2) 
		return;  /* using synchronous packet input */

	if(up->type == CLK_PRAECIS) {
		if(write(peer->procptr->io.fd,"SPSTAT\r\n",8) < 0)
			msyslog(LOG_ERR, "Palisade(%d) write: %m:",unit);
		else {
			praecis_msg = 1;
			return;
		}
	}

	if (HW_poll(pp) < 0) 
		refclock_report(peer, CEVNT_FAULT); 
}

static void
praecis_parse (
	struct recvbuf *rbufp,
	struct peer *peer
	)
{
	static char buf[100];
	static int p = 0;
	struct refclockproc *pp;

	pp = peer->procptr;

	memcpy(buf+p,rbufp->recv_space.X_recv_buffer, rbufp->recv_length);
	p += rbufp->recv_length;

	if(buf[p-2] == '\r' && buf[p-1] == '\n') {
		buf[p-2] = '\0';
		record_clock_stats(&peer->srcadr, buf);

		p = 0;
		praecis_msg = 0;

		if (HW_poll(pp) < 0)
			refclock_report(peer, CEVNT_FAULT);

	}
}

static void
palisade_io (
	struct recvbuf *rbufp
	)
{
	/*
	 * Initialize pointers and read the timecode and timestamp.
	 */
	struct palisade_unit *up;
	struct refclockproc *pp;
	struct peer *peer;

	char * c, * d;

	peer = (struct peer *)rbufp->recv_srcclock;
	pp = peer->procptr;
	up = (struct palisade_unit *)pp->unitptr;

	if(up->type == CLK_PRAECIS) {
		if(praecis_msg) {
			praecis_parse(rbufp,peer);
			return;
		}
	}

	c = (char *) &rbufp->recv_space;
	d = c + rbufp->recv_length;
		
	while (c != d) {

		/* Build time packet */
		switch (up->rpt_status) {

		    case TSIP_PARSED_DLE_1:
			switch (*c)
			{
			    case 0:
			    case DLE:
			    case ETX:
				up->rpt_status = TSIP_PARSED_EMPTY;
				break;

			    default:
				up->rpt_status = TSIP_PARSED_DATA;
				/* save packet ID */
				up->rpt_buf[0] = *c;
				break;
			}
			break;

		    case TSIP_PARSED_DATA:
			if (*c == DLE)
				up->rpt_status = TSIP_PARSED_DLE_2;
			else 
				mb(up->rpt_cnt++) = *c;
			break;

		    case TSIP_PARSED_DLE_2:
			if (*c == DLE) {
				up->rpt_status = TSIP_PARSED_DATA;
				mb(up->rpt_cnt++) = 
				    *c;
			}
			else if (*c == ETX) 
				up->rpt_status = TSIP_PARSED_FULL;
			else 	{
				/* error: start new report packet */
				up->rpt_status = TSIP_PARSED_DLE_1;
				up->rpt_buf[0] = *c;
			}
			break;

		    case TSIP_PARSED_FULL:
		    case TSIP_PARSED_EMPTY:
		    default:
			if ( *c != DLE)
				up->rpt_status = TSIP_PARSED_EMPTY;
			else 
				up->rpt_status = TSIP_PARSED_DLE_1;
			break;
		}
		
		c++;

		if (up->rpt_status == TSIP_PARSED_DLE_1) {
			up->rpt_cnt = 0;
			if (pp->sloppyclockflag & CLK_FLAG2) 
				/* stamp it */
				get_systime(&pp->lastrec);
		}
		else if (up->rpt_status == TSIP_PARSED_EMPTY)
			up->rpt_cnt = 0;

		else if (up->rpt_cnt > BMAX) 
			up->rpt_status =TSIP_PARSED_EMPTY;

		if (up->rpt_status == TSIP_PARSED_FULL) 
			palisade_receive(peer);

	} /* while chars in buffer */
}


/*
 * Trigger the Palisade's event input, which is driven off the RTS
 *
 * Take a system time stamp to match the GPS time stamp.
 *
 */
long
HW_poll (
	struct refclockproc * pp 	/* pointer to unit structure */
	)
{	
	int x;	/* state before & after RTS set */
	struct palisade_unit *up;

	up = (struct palisade_unit *) pp->unitptr;

	/* read the current status, so we put things back right */
	if (ioctl(pp->io.fd, TIOCMGET, &x) < 0) {
#ifdef DEBUG
		if (debug)
			printf("Palisade HW_poll: unit %d: GET %s\n", up->unit, strerror(errno));
#endif
		msyslog(LOG_ERR, "Palisade(%d) HW_poll: ioctl(fd,GET): %m", 
			up->unit);
		return -1;
	}
  
	x |= TIOCM_RTS;        /* turn on RTS  */

	/* Edge trigger */
	if (up->type == CLK_ACUTIME)
		write (pp->io.fd, "", 1);
		
	if (ioctl(pp->io.fd, TIOCMSET, &x) < 0) { 
#ifdef DEBUG
		if (debug)
			printf("Palisade HW_poll: unit %d: SET \n", up->unit);
#endif
		msyslog(LOG_ERR,
			"Palisade(%d) HW_poll: ioctl(fd, SET, RTS_on): %m", 
			up->unit);
		return -1;
	}

	x &= ~TIOCM_RTS;        /* turn off RTS  */
	
	/* poll timestamp */
	get_systime(&pp->lastrec);

	if (ioctl(pp->io.fd, TIOCMSET, &x) == -1) {
#ifdef DEBUG
		if (debug)
			printf("Palisade HW_poll: unit %d: UNSET \n", up->unit);
#endif
		msyslog(LOG_ERR,
			"Palisade(%d) HW_poll: ioctl(fd, UNSET, RTS_off): %m", 
			up->unit);
		return -1;
	}

	return 0;
}

#if 0 /* unused */
/*
 * this 'casts' a character array into a float
 */
float
getfloat (
	u_char *bp
	)
{
	float sval;
#ifdef WORDS_BIGENDIAN 
	((char *) &sval)[0] = *bp++;
	((char *) &sval)[1] = *bp++;
	((char *) &sval)[2] = *bp++;
	((char *) &sval)[3] = *bp++;
#else
	((char *) &sval)[3] = *bp++;
	((char *) &sval)[2] = *bp++;
	((char *) &sval)[1] = *bp++;
	((char *) &sval)[0] = *bp;
#endif  /* ! XNTP_BIG_ENDIAN */ 
	return sval;
}
#endif

/*
 * this 'casts' a character array into a double
 */
double
getdbl (
	u_char *bp
	)
{
	double dval;
#ifdef WORDS_BIGENDIAN 
	((char *) &dval)[0] = *bp++;
	((char *) &dval)[1] = *bp++;
	((char *) &dval)[2] = *bp++;
	((char *) &dval)[3] = *bp++;
	((char *) &dval)[4] = *bp++;
	((char *) &dval)[5] = *bp++;
	((char *) &dval)[6] = *bp++;
	((char *) &dval)[7] = *bp;
#else
	((char *) &dval)[7] = *bp++;
	((char *) &dval)[6] = *bp++;
	((char *) &dval)[5] = *bp++;
	((char *) &dval)[4] = *bp++;
	((char *) &dval)[3] = *bp++;
	((char *) &dval)[2] = *bp++;
	((char *) &dval)[1] = *bp++;
	((char *) &dval)[0] = *bp;
#endif  /* ! XNTP_BIG_ENDIAN */ 
	return dval;
}

/*
 * cast a 16 bit character array into a short (16 bit) int
 */
short
getint (
	u_char *bp
	)
{
	return (short) (bp[1] + (bp[0] << 8));
}

/*
 * cast a 32 bit character array into a long (32 bit) int
 */
long
getlong(
	u_char *bp
	)
{
	return (long) (bp[0] << 24) | 
		      (bp[1] << 16) |
		      (bp[2] << 8) |
		       bp[3];
}

#else	/* REFCLOCK && CLOCK_PALISADE*/
int refclock_palisade_c_notempty;
#endif
ntp-4.2.6p5/ntpd/ntp_timer.c0000644000175000017500000002546711665566225014757 0ustar  peterpeter/*
 * ntp_timer.c - event timer support routines
 */
#ifdef HAVE_CONFIG_H
# include 
#endif

#include "ntp_machine.h"
#include "ntpd.h"
#include "ntp_stdlib.h"

#include 
#include 
#ifdef HAVE_SYS_SIGNAL_H
# include 
#endif
#ifdef HAVE_UNISTD_H
# include 
#endif

#if defined(HAVE_IO_COMPLETION_PORT)
# include "ntp_iocompletionport.h"
# include "ntp_timer.h"
#endif

#ifdef KERNEL_PLL
#include "ntp_syscall.h"
#endif /* KERNEL_PLL */

#ifdef OPENSSL
#include 
#endif /* OPENSSL */

/*
 * These routines provide support for the event timer.	The timer is
 * implemented by an interrupt routine which sets a flag once every
 * 2**EVENT_TIMEOUT seconds (currently 4), and a timer routine which
 * is called when the mainline code gets around to seeing the flag.
 * The timer routine dispatches the clock adjustment code if its time
 * has come, then searches the timer queue for expiries which are
 * dispatched to the transmit procedure.  Finally, we call the hourly
 * procedure to do cleanup and print a message.
 */
volatile int interface_interval = 300;     /* update interface every 5 minutes as default */
	  
/*
 * Alarm flag. The mainline code imports this.
 */
volatile int alarm_flag;

/*
 * The counters and timeouts
 */
static  u_long interface_timer;	/* interface update timer */
static	u_long adjust_timer;	/* second timer */
static	u_long stats_timer;	/* stats timer */
static	u_long huffpuff_timer;	/* huff-n'-puff timer */
u_long	leapsec;		/* leapseconds countdown */
l_fp	sys_time;		/* current system time */
#ifdef OPENSSL
static	u_long revoke_timer;	/* keys revoke timer */
static	u_long keys_timer;	/* session key timer */
u_long	sys_revoke = KEY_REVOKE; /* keys revoke timeout (log2 s) */
u_long	sys_automax = NTP_AUTOMAX; /* key list timeout (log2 s) */
#endif /* OPENSSL */

/*
 * Statistics counter for the interested.
 */
volatile u_long alarm_overflow;

#define MINUTE	60
#define HOUR	(60 * MINUTE)
#define	DAY	(24 * HOUR)

u_long current_time;		/* seconds since startup */

/*
 * Stats.  Number of overflows and number of calls to transmit().
 */
u_long timer_timereset;
u_long timer_overflows;
u_long timer_xmtcalls;

#if defined(VMS)
static int vmstimer[2]; 	/* time for next timer AST */
static int vmsinc[2];		/* timer increment */
#endif /* VMS */

#if defined SYS_WINNT
static HANDLE WaitableTimerHandle = NULL;
#else
static	RETSIGTYPE alarming (int);
#endif /* SYS_WINNT */

#if !defined(VMS)
# if !defined SYS_WINNT || defined(SYS_CYGWIN32)
#  ifndef HAVE_TIMER_SETTIME
	struct itimerval itimer;
#  else 
	static timer_t ntpd_timerid;
	struct itimerspec itimer;
#  endif /* HAVE_TIMER_SETTIME */
# endif /* SYS_WINNT */
#endif /* VMS */

/*
 * reinit_timer - reinitialize interval timer.
 */
void 
reinit_timer(void)
{
#if !defined(SYS_WINNT) && !defined(VMS)
#  if defined(HAVE_TIMER_CREATE) && defined(HAVE_TIMER_SETTIME)
	timer_gettime(ntpd_timerid, &itimer);
	if (itimer.it_value.tv_sec < 0 || itimer.it_value.tv_sec > (1< (1<next;
				if (peer->flags & FLAG_REFCLOCK)
					refclock_timer(peer);
			}
		}
#endif /* REFCLOCK */
	}

	/*
	 * Now dispatch any peers whose event timer has expired. Be
	 * careful here, since the peer structure might go away as the
	 * result of the call.
	 */
	for (n = 0; n < NTP_HASH_SIZE; n++) {
		for (peer = peer_hash[n]; peer != 0; peer = next_peer) {
			next_peer = peer->next;
			if (peer->action && peer->nextaction <=
			    current_time)
				peer->action(peer);

			/*
			 * Restrain the non-burst packet rate not more
			 * than one packet every 16 seconds. This is
			 * usually tripped using iburst and minpoll of
			 * 128 s or less.
			 */
			if (peer->throttle > 0)
				peer->throttle--;
			if (peer->nextdate <= current_time) {
#ifdef REFCLOCK
				if (peer->flags & FLAG_REFCLOCK)
					refclock_transmit(peer);
				else
					transmit(peer);
#else /* REFCLOCK */
				transmit(peer);
#endif /* REFCLOCK */
			}
		}
	}

	/*
	 * Orphan mode is active when enabled and when no servers less
	 * than the orphan stratum are available. A server with no other
	 * synchronization source is an orphan. It shows offset zero and
	 * reference ID the loopback address.
	 */
	if (sys_orphan < STRATUM_UNSPEC && sys_peer == NULL) {
		if (sys_leap == LEAP_NOTINSYNC) {
			sys_leap = LEAP_NOWARNING;
#ifdef OPENSSL
			if (crypto_flags)	
				crypto_update();
#endif /* OPENSSL */
		}
		sys_stratum = (u_char)sys_orphan;
		if (sys_stratum > 1)
			sys_refid = htonl(LOOPBACKADR);
		else
			memcpy(&sys_refid, "LOOP", 4);
		sys_offset = 0;
		sys_rootdelay = 0;
		sys_rootdisp = 0;
	}

	/*
	 * Leapseconds. If a leap is pending, decrement the time
	 * remaining. If less than one day remains, set the leap bits.
	 * When no time remains, clear the leap bits and increment the
	 * TAI. If kernel suppport is not available, do the leap
	 * crudely. Note a leap cannot be pending unless the clock is
	 * set.
	 */
	if (leapsec > 0) {
		leapsec--;
		if (leapsec == 0) {
			sys_leap = LEAP_NOWARNING;
			sys_tai = leap_tai;
#ifdef KERNEL_PLL
			if (!(pll_control && kern_enable))
				step_systime(-1.0);
#else /* KERNEL_PLL */
#ifndef SYS_WINNT /* WinNT port has its own leap second handling */
			step_systime(-1.0);
#endif /* SYS_WINNT */
#endif /* KERNEL_PLL */
			report_event(EVNT_LEAP, NULL, NULL);
		} else {
			if (leapsec < DAY)
				sys_leap = LEAP_ADDSECOND;
			if (leap_tai > 0)
				sys_tai = leap_tai - 1;
		}
	}

	/*
	 * Update huff-n'-puff filter.
	 */
	if (huffpuff_timer <= current_time) {
		huffpuff_timer += HUFFPUFF;
		huffpuff();
	}

#ifdef OPENSSL
	/*
	 * Garbage collect expired keys.
	 */
	if (keys_timer <= current_time) {
		keys_timer += 1 << sys_automax;
		auth_agekeys();
	}

	/*
	 * Garbage collect key list and generate new private value. The
	 * timer runs only after initial synchronization and fires about
	 * once per day.
	 */
	if (revoke_timer <= current_time && sys_leap !=
	    LEAP_NOTINSYNC) {
		revoke_timer += 1 << sys_revoke;
		RAND_bytes((u_char *)&sys_private, 4);
	}
#endif /* OPENSSL */

	/*
	 * Interface update timer
	 */
	if (interface_interval && interface_timer <= current_time) {

		timer_interfacetimeout(current_time +
		    interface_interval);
		DPRINTF(2, ("timer: interface update\n"));
		interface_update(NULL, NULL);
	}
	
	/*
	 * Finally, write hourly stats.
	 */
	if (stats_timer <= current_time) {
		stats_timer += HOUR;
		write_stats();
		if (sys_tai != 0 && sys_time.l_ui > leap_expire)
			report_event(EVNT_LEAPVAL, NULL, NULL);
	}
}


#ifndef SYS_WINNT
/*
 * alarming - tell the world we've been alarmed
 */
static RETSIGTYPE
alarming(
	int sig
	)
{
#if !defined(VMS)
	if (initializing)
		return;
	if (alarm_flag)
		alarm_overflow++;
	else
		alarm_flag++;
#else /* VMS AST routine */
	if (!initializing) {
		if (alarm_flag) alarm_overflow++;
		else alarm_flag = 1;	/* increment is no good */
	}
	lib$addx(&vmsinc,&vmstimer,&vmstimer);
	sys$setimr(0,&vmstimer,alarming,alarming,0);
#endif /* VMS */
}
#endif /* SYS_WINNT */

void
timer_interfacetimeout(u_long timeout)
{
	interface_timer = timeout;
}


/*
 * timer_clr_stats - clear timer module stat counters
 */
void
timer_clr_stats(void)
{
	timer_overflows = 0;
	timer_xmtcalls = 0;
	timer_timereset = current_time;
}

ntp-4.2.6p5/ntpd/refclock_bancomm.c0000644000175000017500000003434111332473303016212 0ustar  peterpeter/* refclock_bancomm.c - clock driver for the  Datum/Bancomm bc635VME 
 * Time and Frequency Processor. It requires the BANCOMM bc635VME/
 * bc350VXI Time and Frequency Processor Module Driver for SunOS4.x 
 * and SunOS5.x UNIX Systems. It has been tested on a UltraSparc 
 * IIi-cEngine running Solaris 2.6.
 * 
 * Author(s): 	Ganesh Ramasivan & Gary Cliff, Computing Devices Canada,
 *		Ottawa, Canada
 *
 * Date: 	July 1999
 *
 * Note(s):	The refclock type has been defined as 16.
 *
 *		This program has been modelled after the Bancomm driver
 *		originally written by R. Schmidt of Time Service, U.S. 
 *		Naval Observatory for a HP-UX machine. Since the original
 *		authors no longer plan to maintain this code, all 
 *		references to the HP-UX vme2 driver subsystem bave been
 *		removed. Functions vme_report_event(), vme_receive(), 
 *		vme_control() and vme_buginfo() have been deleted because
 *		they are no longer being used.
 *
 *	04/28/2005 Rob Neal 
 *		Modified to add support for Symmetricom bc637PCI-U Time & 
 *		Frequency Processor. 
 *	2/21/2007 Ali Ghorashi
 *	        Modified to add support for Symmetricom bc637PCI-U Time & 
 *		Frequency Processor on Solaris.
 *		Tested on Solaris 10 with a bc635 card.
 *
 *		Card bus type (VME/VXI or PCI) and environment are specified via the
 *		"mode" keyword on the server command in ntp.conf.
 *		server 127.127.16.u prefer mode M
 *		where u is the id (usually 0) of the entry in /dev (/dev/stfp0)
 *	
 *		and M is one of the following modes: 
 *		1		: FreeBSD PCI 635/637.
 *		2		: Linux or Windows PCI 635/637.
 *		3		: Solaris PCI 635/637
 *		not specified, or other number: 
 *				: Assumed to be VME/VXI legacy Bancomm card on Solaris.
 *		Linux and Windows platforms require Symmetricoms' proprietary driver
 *		for the TFP card.
 *		Solaris requires Symmetricom's driver and its header file (freely distributed) to 
 *		be installed and running.
 */

#ifdef HAVE_CONFIG_H
#include 
#endif

#if defined(REFCLOCK) && defined(CLOCK_BANC) 

#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"

#include 
#include 
#include 

struct btfp_time                /* Structure for reading 5 time words   */
                                /* in one ioctl(2) operation.           */
{
	unsigned short btfp_time[5];  /* Time words 0,1,2,3, and 4. (16bit)*/
};
/* SunOS5 ioctl commands definitions.*/
#define BTFPIOC            ( 'b'<< 8 )
#define IOCIO( l, n )      ( BTFPIOC | n )
#define IOCIOR( l, n, s )  ( BTFPIOC | n )
#define IOCIORN( l, n, s ) ( BTFPIOC | n )
#define IOCIOWN( l, n, s ) ( BTFPIOC | n )

/***** Simple ioctl commands *****/
#define RUNLOCK     	IOCIOR(b, 19, int )  /* Release Capture Lockout */
#define RCR0      	IOCIOR(b, 22, int )  /* Read control register zero.*/
#define	WCR0		IOCIOWN(b, 23, int)	     /* Write control register zero*/
/***** Compound ioctl commands *****/

/* Read all 5 time words in one call.   */
#define READTIME	IOCIORN(b, 32, sizeof( struct btfp_time ))

#if defined(__FreeBSD__) 
#undef  READTIME
#define READTIME	_IOR('u', 5, struct btfp_time )
#endif 

/* Solaris specific section */
struct	stfp_tm {
	int32_t tm_sec; 
	int32_t tm_min;
	int32_t tm_hour;
	int32_t tm_mday;
	int32_t tm_mon;
	int32_t tm_year;
	int32_t tm_wday;
	int32_t tm_yday;
	int32_t tm_isdst;
};

struct stfp_time {
	struct stfp_tm	tm;
	int32_t 	usec;			/* usec 0 - 999999 */
	int32_t 	hnsec;			/* hnsec 0 - 9 (hundreds of nsecs) */
	int32_t 	status;
};

#define SELTIMEFORMAT	2	
#	define TIME_DECIMAL 0
#	define TIME_BINARY	1

#if defined(__sun__)
#undef	READTIME
#define READTIME		9
#endif /** __sun___ **/
/* end solaris specific section */

struct vmedate {			   /* structure returned by get_vmetime.c */
	unsigned short year;
	unsigned short day;
	unsigned short hr;
	unsigned short mn;
	unsigned short sec;
	long frac;
	unsigned short status;
};

typedef void *SYMMT_PCI_HANDLE;

/*
 * VME interface parameters. 
 */
#define VMEPRECISION    (-21)   /* precision assumed (1 us) */
#define USNOREFID       "BTFP"  /* or whatever */
#define VMEREFID        "BTFP"  /* reference id */
#define VMEDESCRIPTION  "Bancomm bc635 TFP" /* who we are */
#define VMEHSREFID      0x7f7f1000 /* 127.127.16.00 refid hi strata */
/* clock type 16 is used here  */
#define GMT           	0       /* hour offset from Greenwich */

/*
 * Imported from ntp_timer module
 */
extern u_long current_time;     /* current time(s) */

/*
 * Imported from ntpd module
 */
extern volatile int debug;               /* global debug flag */

/*
 * VME unit control structure.
 * Changes made to vmeunit structure. Most members are now available in the 
 * new refclockproc structure in ntp_refclock.h - 07/99 - Ganesh Ramasivan
 */
struct vmeunit {
	struct vmedate vmedata; /* data returned from vme read */
	u_long lasttime;        /* last time clock heard from */
};

/*
 * Function prototypes
 */
static  int     vme_start       (int, struct peer *);
static  void    vme_shutdown    (int, struct peer *);
static  void    vme_receive     (struct recvbuf *);
static  void    vme_poll        (int unit, struct peer *);
struct vmedate *get_datumtime(struct vmedate *);	
void	tvme_fill(struct vmedate *, uint32_t btm[2]);
void	stfp_time2tvme(struct vmedate *time_vme, struct stfp_time *stfp);
inline const char *DEVICE_NAME(int n);


/*
 * Define the bc*() functions as weak so we can compile/link without them.
 * Only clients with the card will have the proprietary vendor device driver
 * and interface library needed for use on Linux/Windows platforms.
 */
extern uint32_t __attribute__ ((weak)) bcReadBinTime(SYMMT_PCI_HANDLE, uint32_t *, uint32_t*, uint8_t*);
extern SYMMT_PCI_HANDLE __attribute__ ((weak)) bcStartPci(void);
extern void __attribute__ ((weak)) bcStopPci(SYMMT_PCI_HANDLE);

/*
 * Transfer vector
 */
struct  refclock refclock_bancomm = {
	vme_start, 		/* start up driver */
	vme_shutdown,		/* shut down driver */
	vme_poll,		/* transmit poll message */
	noentry,		/* not used (old vme_control) */
	noentry,		/* initialize driver */ 
	noentry,		/* not used (old vme_buginfo) */ 
	NOFLAGS			/* not used */
};

int fd_vme;  /* file descriptor for ioctls */
int regvalue;
int tfp_type;	/* mode selector, indicate platform and driver interface */
SYMMT_PCI_HANDLE stfp_handle;

/** 
 * this macro returns the device name based on
 * the platform we are running on and the device number
 */
#if defined(__sun__)
inline const char *DEVICE_NAME(int n) {static char s[20]={0}; snprintf(s,19,"/dev/stfp%d",n);return s;}
#else
inline const char* DEVICE_NAME(int n) {static char s[20]={0}; snprintf(s,19,"/dev/btfp%d",n);return s;}
#endif /**__sun__**/

/*
 * vme_start - open the VME device and initialize data for processing
 */
static int
vme_start(
	int unit,
	struct peer *peer
	)
{
	register struct vmeunit *vme;
	struct refclockproc *pp;
	int dummy;
	char vmedev[20];
	
	tfp_type = (int)(peer->ttl);
	switch (tfp_type) {		
		case 1:
		case 3:
			break;
		case 2:
			stfp_handle = bcStartPci(); 	/* init the card in lin/win */
			break;
		default:
			break;
	}
	/*
	 * Open VME device
	 */
#ifdef DEBUG

	printf("Opening DATUM DEVICE %s\n",DEVICE_NAME(peer->refclkunit));
#endif
	if ( (fd_vme = open(DEVICE_NAME(peer->refclkunit), O_RDWR)) < 0) {
		msyslog(LOG_ERR, "vme_start: failed open of %s: %m", vmedev);
		return (0);
	}
	else  { 
		switch (tfp_type) {
		  	case 1:	break;
			case 2: break;
			case 3:break;
			default: 
				/* Release capture lockout in case it was set before. */
				if( ioctl( fd_vme, RUNLOCK, &dummy ) )
		    		msyslog(LOG_ERR, "vme_start: RUNLOCK failed %m");

				regvalue = 0; /* More esoteric stuff to do... */
				if( ioctl( fd_vme, WCR0, ®value ) )
		    		msyslog(LOG_ERR, "vme_start: WCR0 failed %m");
				break;
		}
	}

	/*
	 * Allocate unit structure
	 */
	vme = (struct vmeunit *)emalloc(sizeof(struct vmeunit));
	bzero((char *)vme, sizeof(struct vmeunit));


	/*
	 * Set up the structures
	 */
	pp = peer->procptr;
	pp->unitptr = (caddr_t) vme;
	pp->timestarted = current_time;

	pp->io.clock_recv = vme_receive;
	pp->io.srcclock = (caddr_t)peer;
	pp->io.datalen = 0;
	pp->io.fd = fd_vme;

	/*
	 * All done.  Initialize a few random peer variables, then
 	 * return success. Note that root delay and root dispersion are
	 * always zero for this clock.
	 */
	peer->precision = VMEPRECISION;
	memcpy(&pp->refid, USNOREFID,4);
	return (1);
}


/*
 * vme_shutdown - shut down a VME clock
 */
static void
vme_shutdown(
	int unit, 
	struct peer *peer
	)
{
	register struct vmeunit *vme;
	struct refclockproc *pp;

	/*
	 * Tell the I/O module to turn us off.  We're history.
	 */
	pp = peer->procptr;
	vme = (struct vmeunit *)pp->unitptr;
	io_closeclock(&pp->io);
	pp->unitptr = NULL;
	if (NULL != vme)
		free(vme);
	if (tfp_type == 2)
		bcStopPci(stfp_handle); 
}


/*
 * vme_receive - receive data from the VME device.
 *
 * Note: This interface would be interrupt-driven. We don't use that
 * now, but include a dummy routine for possible future adventures.
 */
static void
vme_receive(
	struct recvbuf *rbufp
	)
{
}


/*
 * vme_poll - called by the transmit procedure
 */
static void
vme_poll(
	int unit,
	struct peer *peer
	)
{
	struct vmedate *tptr; 
	struct vmeunit *vme;
	struct refclockproc *pp;
	time_t tloc;
	struct tm *tadr;
        
	pp = peer->procptr;	 
	vme = (struct vmeunit *)pp->unitptr;        /* Here is the structure */

	tptr = &vme->vmedata; 
	if ((tptr = get_datumtime(tptr)) == NULL ) {
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	get_systime(&pp->lastrec);
	pp->polls++;
	vme->lasttime = current_time;

	/*
	 * Get VME time and convert to timestamp format. 
	 * The year must come from the system clock.
	 */
	
	  time(&tloc);
	  tadr = gmtime(&tloc);
	  tptr->year = (unsigned short)(tadr->tm_year + 1900);

	snprintf(pp->a_lastcode,
		 sizeof(pp->a_lastcode),
		 "%3.3d %2.2d:%2.2d:%2.2d.%.6ld %1d",
		 tptr->day, 
		 tptr->hr, 
		 tptr->mn,
		 tptr->sec, 
		 tptr->frac, 
		 tptr->status);

	pp->lencode = (u_short) strlen(pp->a_lastcode);

	pp->day =  tptr->day;
	pp->hour =   tptr->hr;
	pp->minute =  tptr->mn;
	pp->second =  tptr->sec;
	pp->nsec =   tptr->frac;	

#ifdef DEBUG
	if (debug)
	    printf("pp: %3d %02d:%02d:%02d.%06ld %1x\n",
		   pp->day, pp->hour, pp->minute, pp->second,
		   pp->nsec, tptr->status);
#endif
	if (tptr->status ) {       /*  Status 0 is locked to ref., 1 is not */
		refclock_report(peer, CEVNT_BADREPLY);
		return;
	}

	/*
	 * Now, compute the reference time value. Use the heavy
	 * machinery for the seconds and the millisecond field for the
	 * fraction when present. If an error in conversion to internal
	 * format is found, the program declares bad data and exits.
	 * Note that this code does not yet know how to do the years and
	 * relies on the clock-calendar chip for sanity.
	 */
	if (!refclock_process(pp)) {
		refclock_report(peer, CEVNT_BADTIME);
		return;
	}
	pp->lastref = pp->lastrec;
	refclock_receive(peer);
	record_clock_stats(&peer->srcadr, pp->a_lastcode);
}

struct vmedate *
get_datumtime(struct vmedate *time_vme)
{
	char cbuf[7];
	struct btfp_time vts;
	uint32_t btm[2];
	uint8_t dmy;
	struct stfp_time stfpm;
	
	if (time_vme == NULL)
  		time_vme = emalloc(sizeof(*time_vme));

	switch (tfp_type) {
		case 1:				/* BSD, PCI, 2 32bit time words */
			if (ioctl(fd_vme, READTIME, &btm)) {
	    		msyslog(LOG_ERR, "get_bc63x error: %m");
				return(NULL);
			}
			tvme_fill(time_vme, btm);
			break;

		case 2:				/* Linux/Windows, PCI, 2 32bit time words */
			if (bcReadBinTime(stfp_handle, &btm[1], &btm[0], &dmy) == 0) {
	    		msyslog(LOG_ERR, "get_datumtime error: %m"); 
				return(NULL);
			}
			tvme_fill(time_vme, btm);
			break;
			
		case 3: /** solaris **/
			memset(&stfpm,0,sizeof(stfpm));
			
			/* we need the time in decimal format */
			/* Here we rudely assume that we are the only user of the driver.
			 * Other programs will have to set their own time format before reading 
			 * the time.
			 */
			if(ioctl (fd_vme, SELTIMEFORMAT, TIME_DECIMAL)){	
					msyslog(LOG_ERR, "Could not set time format\n");
					return (NULL);	
			}
			/* read the time */
			if (ioctl(fd_vme, READTIME, &stfpm)) {
				msyslog(LOG_ERR, "ioctl error: %m");
				return(NULL);
			}
			stfp_time2tvme(time_vme,  &stfpm);
			break;			

		default:			/* legacy bancomm card */

			if (ioctl(fd_vme, READTIME, &vts)) {
				msyslog(LOG_ERR,
					"get_datumtime error: %m");
				return(NULL);
			}
			/* Get day */
			snprintf(cbuf, sizeof(cbuf), "%3.3x",
				 ((vts.btfp_time[ 0 ] & 0x000f) << 8) +
				  ((vts.btfp_time[ 1 ] & 0xff00) >> 8));  
			time_vme->day = (unsigned short)atoi(cbuf);

			/* Get hour */
			snprintf(cbuf, sizeof(cbuf), "%2.2x",
				 vts.btfp_time[ 1 ] & 0x00ff);
			time_vme->hr = (unsigned short)atoi(cbuf);

			/* Get minutes */
			snprintf(cbuf, sizeof(cbuf), "%2.2x",
				 (vts.btfp_time[ 2 ] & 0xff00) >> 8);
			time_vme->mn = (unsigned short)atoi(cbuf);

			/* Get seconds */
			snprintf(cbuf, sizeof(cbuf), "%2.2x",
				 vts.btfp_time[ 2 ] & 0x00ff);
			time_vme->sec = (unsigned short)atoi(cbuf);

			/* Get microseconds.  Yes, we ignore the 0.1 microsecond digit so
				 we can use the TVTOTSF function  later on...*/

			snprintf(cbuf, sizeof(cbuf), "%4.4x%2.2x",
				 vts.btfp_time[ 3 ],
				 vts.btfp_time[ 4 ] >> 8);
			time_vme->frac = (u_long) atoi(cbuf);

			/* Get status bit */
			time_vme->status = (vts.btfp_time[0] & 0x0010) >> 4;

			break;
	}

	if (time_vme->status) 
		return ((void *)NULL);
	else
	    return (time_vme);
}
/* Assign values to time_vme struct. Mostly for readability */
void
tvme_fill(struct vmedate *time_vme, uint32_t btm[2])
{
	struct tm maj;
	uint32_t dmaj, dmin;

	dmaj = btm[1];			/* syntax sugar */
	dmin = btm[0];

	gmtime_r(&dmaj, &maj);
	time_vme->day  = maj.tm_yday+1;
	time_vme->hr   = maj.tm_hour;
	time_vme->mn   = maj.tm_min;
	time_vme->sec  = maj.tm_sec;
	time_vme->frac = (dmin & 0x000fffff) * 1000; 
	time_vme->frac += ((dmin & 0x00f00000) >> 20) * 100;
	time_vme->status = (dmin & 0x01000000) >> 24;
	return;
}


/* Assign values to time_vme struct. Mostly for readability */
void
stfp_time2tvme(struct vmedate *time_vme, struct stfp_time *stfp)
{

	time_vme->day  = stfp->tm.tm_yday+1;
	time_vme->hr   = stfp->tm.tm_hour;
	time_vme->mn   = stfp->tm.tm_min;
	time_vme->sec  = stfp->tm.tm_sec;
	time_vme->frac = stfp->usec*1000;  
	time_vme->frac += stfp->hnsec * 100;
	time_vme->status = stfp->status;
	return;
}
#else
int refclock_bancomm_bs;
#endif /* REFCLOCK */
ntp-4.2.6p5/ntpd/ntp_intres.c0000644000175000017500000007453611455531713015133 0ustar  peterpeter/*
 * ripped off from ../ntpres/ntpres.c by Greg Troxel 4/2/92
 * routine callable from ntpd, rather than separate program
 * also, key info passed in via a global, so no key file needed.
 */

/*
 * ntpres - process configuration entries which require use of the resolver
 *
 * This is meant to be run by ntpd on the fly.  It is not guaranteed
 * to work properly if run by hand.  This is actually a quick hack to
 * stave off violence from people who hate using numbers in the
 * configuration file (at least I hope the rest of the daemon is
 * better than this).  Also might provide some ideas about how one
 * might go about autoconfiguring an NTP distribution network.
 *
 */

#ifdef HAVE_CONFIG_H
# include 
#endif

#include "ntp_intres.h"

#ifndef NO_INTRES

#include 
#include 
#include 

/**/
#ifdef HAVE_SYS_TYPES_H
# include 
#endif
#ifdef HAVE_NETINET_IN_H
#include 
#endif
#include 
/**/
#ifdef HAVE_SYS_PARAM_H
# include 		/* MAXHOSTNAMELEN (often) */
#endif

#if !defined(HAVE_RES_INIT) && defined(HAVE___RES_INIT)
# define HAVE_RES_INIT
#endif

#if defined(HAVE_RESOLV_H) && defined(HAVE_RES_INIT)
# ifdef HAVE_ARPA_NAMESER_H
#  include  /* DNS HEADER struct */
# endif
# ifdef HAVE_NETDB_H
#  include 
# endif
# include 
#endif

#ifdef RES_TIMEOUT
#undef RES_TIMEOUT	/* resolv.h has one, we want ours */
#endif

#include "ntp_machine.h"
#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_request.h"
#include "ntp_stdlib.h"
#include "ntp_syslog.h"
#include "ntp_config.h"

#include 
#include 

#define	STREQ(a, b)	(*(a) == *(b) && strcmp((a), (b)) == 0)

/*
 * Each item we are to resolve and configure gets one of these
 * structures defined for it.
 */
struct conf_entry {
	struct conf_entry *ce_next;
	char *ce_name;			/* name to resolve */
	struct conf_peer ce_config;	/* config info for peer */
	int no_needed;			/* number of addresses needed (pool) */
	/*  no_needed isn't used yet: It's needed to fix bug-975 */
	int type;			/* -4 and -6 flags */
	sockaddr_u peer_store;		/* address info for both fams */
};
#define	ce_peeraddr	ce_config.peeraddr
#define	ce_peeraddr6	ce_config.peeraddr6
#define	ce_hmode	ce_config.hmode
#define	ce_version	ce_config.version
#define ce_minpoll	ce_config.minpoll
#define ce_maxpoll	ce_config.maxpoll
#define	ce_flags	ce_config.flags
#define ce_ttl		ce_config.ttl
#define	ce_keyid	ce_config.keyid
#define ce_keystr	ce_config.keystr

/*
 * confentries is a pointer to the list of configuration entries
 * we have left to do.
 */
static struct conf_entry *confentries = NULL;

/*
 * We take an interrupt every thirty seconds, at which time we decrement
 * config_timer and resolve_timer.  The former is set to 2, so we retry
 * unsucessful reconfigurations every minute.  The latter is set to
 * an exponentially increasing value which starts at 2 and increases to
 * 32.  When this expires we retry failed name resolutions.
 *
 * We sleep SLEEPTIME seconds before doing anything, to give the server
 * time to arrange itself.
 */
#define	MINRESOLVE	2
#define	MAXRESOLVE	32
#define	CONFIG_TIME	2
#define	ALARM_TIME	30
#define	SLEEPTIME	2

static	volatile int config_timer = 0;
static	volatile int resolve_timer = 0;

static	int resolve_value;	/* next value of resolve timer */

/*
 * Big hack attack
 */
#define	SKEWTIME	0x08000000	/* 0.03125 seconds as a l_fp fraction */

/*
 * Select time out.  Set to 2 seconds.  The server is on the local machine,
 * after all.
 */
#define	TIMEOUT_SEC	2
#define	TIMEOUT_USEC	0


/*
 * Input processing.  The data on each line in the configuration file
 * is supposed to consist of entries in the following order
 */
#define	TOK_HOSTNAME	0
#define	TOK_NEEDED	1
#define	TOK_TYPE	2
#define	TOK_HMODE	3
#define	TOK_VERSION	4
#define	TOK_MINPOLL	5
#define	TOK_MAXPOLL	6
#define	TOK_FLAGS	7
#define	TOK_TTL		8
#define	TOK_KEYID	9
#define	TOK_KEYSTR	10
#define	NUMTOK		11

#define	MAXLINESIZE	512


/*
 * File descriptor for ntp request code.
 */
static	SOCKET sockfd = INVALID_SOCKET;	/* NT uses SOCKET */

/* stuff to be filled in by caller */

keyid_t req_keyid;	/* request keyid */
int	req_keytype;	/* OpenSSL NID such as NID_md5 */
size_t	req_hashlen;	/* digest size for req_keytype */
char *req_file;		/* name of the file with configuration info */

/* end stuff to be filled in */


static	void	checkparent	(void);
static	struct conf_entry *
		removeentry	(struct conf_entry *);
static	void	addentry	(char *, int, int, int, int, int, int, u_int,
				   int, keyid_t, char *);
static	int	findhostaddr	(struct conf_entry *);
static	void	openntp		(void);
static	int	request		(struct conf_peer *);
static	char *	nexttoken	(char **);
static	void	readconf	(FILE *, char *);
static	void	doconfigure	(int);

struct ntp_res_t_pkt {		/* Tagged packet: */
	void *tag;		/* For the caller */
	u_int32 paddr;		/* IP to look up, or 0 */
	char name[MAXHOSTNAMELEN]; /* Name to look up (if 1st byte is not 0) */
};

struct ntp_res_c_pkt {		/* Control packet: */
	char name[MAXHOSTNAMELEN];
	u_int32 paddr;
	int mode;
	int version;
	int minpoll;
	int maxpoll;
	u_int flags;
	int ttl;
	keyid_t keyid;
	u_char keystr[MAXFILENAME];
};


static void	resolver_exit (int);

/*
 * Call here instead of just exiting
 */

static void resolver_exit (int code)
{
#ifdef SYS_WINNT
	CloseHandle(ResolverEventHandle);
	ResolverEventHandle = NULL;
	_endthreadex(code);	/* Just to kill the thread not the process */
#else
	exit(code);		/* kill the forked process */
#endif
}

/*
 * ntp_res_recv: Process an answer from the resolver
 */

void
ntp_res_recv(void)
{
	/*
	  We have data ready on our descriptor.
	  It may be an EOF, meaning the resolver process went away.
	  Otherwise, it will be an "answer".
	*/
}


/*
 * ntp_intres needs;
 *
 *	req_key(???), req_keyid, req_file valid
 *	syslog still open
 */

void
ntp_intres(void)
{
	FILE *in;
#ifdef SYS_WINNT
	DWORD rc;
#else
	int	rc;
	struct	timeval tv;
	fd_set	fdset;
	int	time_left;
#endif

#ifdef DEBUG
	if (debug > 1) {
		msyslog(LOG_INFO, "NTP_INTRES running");
	}
#endif

	/* check out auth stuff */
	if (sys_authenticate) {
		if (!authistrusted(req_keyid)) {
			msyslog(LOG_ERR, "invalid request keyid %08x",
			    req_keyid );
			resolver_exit(1);
		}
	}

	/*
	 * Read the configuration info
	 * {this is bogus, since we are forked, but it is easier
	 * to keep this code - gdt}
	 */
	if ((in = fopen(req_file, "r")) == NULL) {
		msyslog(LOG_ERR, "can't open configuration file %s: %m",
			req_file);
		resolver_exit(1);
	}
	readconf(in, req_file);
	(void) fclose(in);

#ifdef DEBUG
	if (!debug)
#endif
		if (unlink(req_file))
			msyslog(LOG_WARNING,
				"unable to remove intres request file %s, %m",
				req_file);

	/*
	 * Set up the timers to do first shot immediately.
	 */
	resolve_timer = 0;
	resolve_value = MINRESOLVE;
	config_timer = CONFIG_TIME;

	for (;;) {
		checkparent();

		if (resolve_timer == 0) {
			/*
			 * Sleep a little to make sure the network is completely up
			 */
			sleep(SLEEPTIME);
			doconfigure(1);

			/* prepare retry, in case there's more work to do */
			resolve_timer = resolve_value;
#ifdef DEBUG
			if (debug > 2)
				msyslog(LOG_INFO, "resolve_timer: 0->%d", resolve_timer);
#endif
			if (resolve_value < MAXRESOLVE)
				resolve_value <<= 1;

			config_timer = CONFIG_TIME;
		} else if (config_timer == 0) {  /* MB: in which case would this be required ? */
			doconfigure(0);
			/* MB: should we check now if we could exit, similar to the code above? */
			config_timer = CONFIG_TIME;
#ifdef DEBUG
			if (debug > 2)
				msyslog(LOG_INFO, "config_timer: 0->%d", config_timer);
#endif
		}

		if (confentries == NULL)
			resolver_exit(0);   /* done */

#ifdef SYS_WINNT
		rc = WaitForSingleObject(ResolverEventHandle, 1000 * ALARM_TIME);  /* in milliseconds */

		if ( rc == WAIT_OBJECT_0 ) { /* signaled by the main thread */
			resolve_timer = 0;         /* retry resolving immediately */
			continue;
		}

		if ( rc != WAIT_TIMEOUT ) /* not timeout: error */
			resolver_exit(1);

#else  /* not SYS_WINNT */
		/* Bug 1386: fork() in NetBSD leaves timers running. */
		/* So we need to retry select on EINTR */
		time_left = ALARM_TIME;
		while (time_left > 0) {
		    tv.tv_sec = time_left;
		    tv.tv_usec = 0;
		    FD_ZERO(&fdset);
		    FD_SET(resolver_pipe_fd[0], &fdset);
		    rc = select(resolver_pipe_fd[0] + 1, &fdset, (fd_set *)0, (fd_set *)0, &tv);

		    if (rc == 0)		/* normal timeout */
			break;

		    if (rc > 0) {  /* parent process has written to the pipe */
			read(resolver_pipe_fd[0], (char *)&rc, sizeof(rc));  /* make pipe empty */
			resolve_timer = 0;   /* retry resolving immediately */
			break;
		    }

		    if ( rc < 0 ) {		/* select() returned error */
			if (errno == EINTR) {	/* Timer went off */
			    time_left -= (1< 0)
			config_timer--;
		if (resolve_timer > 0)
			resolve_timer--;
	}
}


#ifdef SYS_WINNT
/*
 * ntp_intres_thread wraps the slightly different interface of Windows
 * thread functions and ntp_intres
 */
unsigned WINAPI
ntp_intres_thread(void *UnusedThreadArg)
{
	UNUSED_ARG(UnusedThreadArg);

	ntp_intres();
	return 0;
}
#endif /* SYS_WINNT */


/*
 * checkparent - see if our parent process is still running
 *
 * No need to worry in the Windows NT environment whether the
 * main thread is still running, because if it goes
 * down it takes the whole process down with it (in
 * which case we won't be running this thread either)
 * Turn function into NOP;
 */

static void
checkparent(void)
{
#if !defined (SYS_WINNT) && !defined (SYS_VXWORKS)

	/*
	 * If our parent (the server) has died we will have been
	 * inherited by init.  If so, exit.
	 */
	if (getppid() == 1) {
		msyslog(LOG_INFO, "parent died before we finished, exiting");
		resolver_exit(0);
	}
#endif /* SYS_WINNT && SYS_VXWORKS*/
}



/*
 * removeentry - we are done with an entry, remove it from the list
 */
static struct conf_entry *
removeentry(
	struct conf_entry *entry
	)
{
	register struct conf_entry *ce;
	struct conf_entry *next_ce;

	ce = confentries;
	if (ce == entry)
		confentries = ce->ce_next;
	else
		while (ce != NULL) {
			if (ce->ce_next == entry) {
				ce->ce_next = entry->ce_next;
				break;
			}
			ce = ce->ce_next;
		}

	next_ce = entry->ce_next;
	if (entry->ce_name != NULL)
		free(entry->ce_name);
	free(entry);

	return next_ce;
}


/*
 * addentry - add an entry to the configuration list
 */
static void
addentry(
	char *name,
	int no_needed,
	int type,
	int mode,
	int version,
	int minpoll,
	int maxpoll,
	u_int flags,
	int ttl,
	keyid_t keyid,
	char *keystr
	)
{
	register struct conf_entry *ce;

#ifdef DEBUG
	if (debug > 1)
		msyslog(LOG_INFO, 
		    "intres: <%s> %d %d %d %d %d %d %x %d %x %s",
		    name, no_needed, type, mode, version,
		    minpoll, maxpoll, flags, ttl, keyid, keystr);
#endif
	ce = emalloc(sizeof(*ce));
	ce->ce_name = estrdup(name);
	ce->ce_peeraddr = 0;
#ifdef ISC_PLATFORM_HAVEIPV6
	ce->ce_peeraddr6 = in6addr_any;
#endif
	ZERO_SOCK(&ce->peer_store);
	ce->ce_hmode = (u_char)mode;
	ce->ce_version = (u_char)version;
	ce->ce_minpoll = (u_char)minpoll;
	ce->ce_maxpoll = (u_char)maxpoll;
	ce->no_needed = no_needed;	/* Not used after here. */
					/* Start of fixing bug-975 */
	ce->type = type;
	ce->ce_flags = (u_char)flags;
	ce->ce_ttl = (u_char)ttl;
	ce->ce_keyid = keyid;
	strncpy(ce->ce_keystr, keystr, sizeof(ce->ce_keystr) - 1);
	ce->ce_keystr[sizeof(ce->ce_keystr) - 1] = 0;
	ce->ce_next = NULL;

	if (confentries == NULL) {
		confentries = ce;
	} else {
		register struct conf_entry *cep;

		for (cep = confentries; cep->ce_next != NULL;
		     cep = cep->ce_next)
		    /* nothing */;
		cep->ce_next = ce;
	}
}


/*
 * findhostaddr - resolve a host name into an address (Or vice-versa)
 *
 * Given one of {ce_peeraddr,ce_name}, find the other one.
 * It returns 1 for "success" and 0 for an uncorrectable failure.
 * Note that "success" includes try again errors.  You can tell that you
 *  got a "try again" since {ce_peeraddr,ce_name} will still be zero.
 */
static int
findhostaddr(
	struct conf_entry *entry
	)
{
	static int eai_again_seen = 0;
	struct addrinfo *addr;
	struct addrinfo hints;
	int again;
	int error;

	checkparent();		/* make sure our guy is still running */

	if (entry->ce_name != NULL && !SOCK_UNSPEC(&entry->peer_store)) {
		/* HMS: Squawk? */
		msyslog(LOG_ERR, "findhostaddr: both ce_name and ce_peeraddr are defined...");
		return 1;
	}

	if (entry->ce_name == NULL && SOCK_UNSPEC(&entry->peer_store)) {
		msyslog(LOG_ERR, "findhostaddr: both ce_name and ce_peeraddr are undefined!");
		return 0;
	}

	if (entry->ce_name) {
		DPRINTF(2, ("findhostaddr: Resolving <%s>\n",
			entry->ce_name));

		memset(&hints, 0, sizeof(hints));
		hints.ai_family = entry->type;
		hints.ai_socktype = SOCK_DGRAM;
		hints.ai_protocol = IPPROTO_UDP;
		/*
		 * If IPv6 is not available look only for v4 addresses
		 */
		if (!ipv6_works)
			hints.ai_family = AF_INET;
		error = getaddrinfo(entry->ce_name, NULL, &hints, &addr);
		if (error == 0) {
			entry->peer_store = *((sockaddr_u *)(addr->ai_addr));
			if (IS_IPV4(&entry->peer_store)) {
				entry->ce_peeraddr =
				    NSRCADR(&entry->peer_store);
				entry->ce_config.v6_flag = 0;
			} else {
				entry->ce_peeraddr6 =
				    SOCK_ADDR6(&entry->peer_store);
				entry->ce_config.v6_flag = 1;
			}
			freeaddrinfo(addr);
		}
	} else {
		DPRINTF(2, ("findhostaddr: Resolving <%s>\n",
			stoa(&entry->peer_store)));

		entry->ce_name = emalloc(MAXHOSTNAMELEN);
		error = getnameinfo((const struct sockaddr *)&entry->peer_store,
				   SOCKLEN(&entry->peer_store),
				   (char *)&entry->ce_name, MAXHOSTNAMELEN,
				   NULL, 0, 0);
	}

	if (0 == error) {

		/* again is our return value, for success it is 1 */
		again = 1;

		DPRINTF(2, ("findhostaddr: %s resolved.\n", 
			(entry->ce_name) ? "name" : "address"));
	} else {
		/*
		 * If the resolver failed, see if the failure is
		 * temporary. If so, return success.
		 */
		again = 0;

		switch (error) {

		case EAI_FAIL:
			again = 1;
			break;

		case EAI_AGAIN:
			again = 1;
			eai_again_seen = 1;
			break;

		case EAI_NONAME:
#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
		case EAI_NODATA:
#endif
			msyslog(LOG_ERR, "host name not found%s%s: %s",
				(EAI_NONAME == error) ? "" : " EAI_NODATA",
				(eai_again_seen) ? " (permanent)" : "",
				entry->ce_name);
			again = !eai_again_seen;
			break;

#ifdef EAI_SYSTEM
		case EAI_SYSTEM:
			/* 
			 * EAI_SYSTEM means the real error is in errno.  We should be more
			 * discriminating about which errno values require retrying, but
			 * this matches existing behavior.
			 */
			again = 1;
			DPRINTF(1, ("intres: EAI_SYSTEM errno %d (%s) means try again, right?\n",
				errno, strerror(errno)));
			break;
#endif
		}

		/* do this here to avoid perturbing errno earlier */
		DPRINTF(2, ("intres: got error status of: %d\n", error));
	}

	return again;
}


/*
 * openntp - open a socket to the ntp server
 */
static void
openntp(void)
{
	const char	*localhost = "127.0.0.1";	/* Use IPv4 loopback */
	struct addrinfo	hints;
	struct addrinfo	*addr;
	u_long		on;
	int		err;

	if (sockfd != INVALID_SOCKET)
		return;

	memset(&hints, 0, sizeof(hints));

	/*
	 * For now only bother with IPv4
	 */
	hints.ai_family = AF_INET;
	hints.ai_socktype = SOCK_DGRAM;

	err = getaddrinfo(localhost, "ntp", &hints, &addr);

	if (err) {
#ifdef EAI_SYSTEM
		if (EAI_SYSTEM == err)
			msyslog(LOG_ERR, "getaddrinfo(%s) failed: %m",
				localhost);
		else
#endif
			msyslog(LOG_ERR, "getaddrinfo(%s) failed: %s",
				localhost, gai_strerror(err));
		resolver_exit(1);
	}

	sockfd = socket(addr->ai_family, addr->ai_socktype, 0);

	if (INVALID_SOCKET == sockfd) {
		msyslog(LOG_ERR, "socket() failed: %m");
		resolver_exit(1);
	}

#ifndef SYS_WINNT
	/*
	 * On Windows only the count of sockets must be less than
	 * FD_SETSIZE. On Unix each descriptor's value must be less
	 * than FD_SETSIZE, as fd_set is a bit array.
	 */
	if (sockfd >= FD_SETSIZE) {
		msyslog(LOG_ERR, "socket fd %d too large, FD_SETSIZE %d",
			(int)sockfd, FD_SETSIZE);
		resolver_exit(1);
	}

	/*
	 * Make the socket non-blocking.  We'll wait with select()
	 * Unix: fcntl(O_NONBLOCK) or fcntl(FNDELAY)
	 */
# ifdef O_NONBLOCK
	if (fcntl(sockfd, F_SETFL, O_NONBLOCK) == -1) {
		msyslog(LOG_ERR, "fcntl(O_NONBLOCK) failed: %m");
		resolver_exit(1);
	}
# else
#  ifdef FNDELAY
	if (fcntl(sockfd, F_SETFL, FNDELAY) == -1) {
		msyslog(LOG_ERR, "fcntl(FNDELAY) failed: %m");
		resolver_exit(1);
	}
#  else
#   include "Bletch: NEED NON BLOCKING IO"
#  endif	/* FNDDELAY */
# endif	/* O_NONBLOCK */
	(void)on;	/* quiet unused warning */
#else	/* !SYS_WINNT above */
	/*
	 * Make the socket non-blocking.  We'll wait with select()
	 * Windows: ioctlsocket(FIONBIO)
	 */
	on = 1;
	err = ioctlsocket(sockfd, FIONBIO, &on);
	if (SOCKET_ERROR == err) {
		msyslog(LOG_ERR, "ioctlsocket(FIONBIO) fails: %m");
		resolver_exit(1);
	}
#endif /* SYS_WINNT */

	err = connect(sockfd, addr->ai_addr, addr->ai_addrlen);
	if (SOCKET_ERROR == err) {
		msyslog(LOG_ERR, "openntp: connect() failed: %m");
		resolver_exit(1);
	}

	freeaddrinfo(addr);
}


/*
 * request - send a configuration request to the server, wait for a response
 */
static int
request(
	struct conf_peer *conf
	)
{
	struct sock_timeval tvout;
	struct req_pkt reqpkt;
	size_t	req_len;
	size_t	total_len;	/* req_len plus keyid & digest */
	fd_set	fdset;
	l_fp	ts;
	char *	pch;
	char *	pchEnd;
	l_fp *	pts;
	keyid_t *pkeyid;
	int n;
#ifdef SYS_WINNT
	HANDLE	hReadWriteEvent = NULL;
	BOOL	ret;
	DWORD	NumberOfBytesWritten, NumberOfBytesRead, dwWait;
	OVERLAPPED overlap;
#endif /* SYS_WINNT */

	checkparent();		/* make sure our guy is still running */

	if (sockfd == INVALID_SOCKET)
		openntp();
	
#ifdef SYS_WINNT
	hReadWriteEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
#endif /* SYS_WINNT */

	/*
	 * Try to clear out any previously received traffic so it
	 * doesn't fool us.  Note the socket is nonblocking.
	 */
	tvout.tv_sec =  0;
	tvout.tv_usec = 0;
	FD_ZERO(&fdset);
	FD_SET(sockfd, &fdset);
	while (select(sockfd + 1, &fdset, (fd_set *)0, (fd_set *)0, &tvout) >
	       0) {
		recv(sockfd, (char *)&reqpkt, sizeof(reqpkt), 0);
		FD_ZERO(&fdset);
		FD_SET(sockfd, &fdset);
	}

	/*
	 * Make up a request packet with the configuration info
	 */
	memset(&reqpkt, 0, sizeof(reqpkt));

	reqpkt.rm_vn_mode = RM_VN_MODE(0, 0, 0);
	reqpkt.auth_seq = AUTH_SEQ(1, 0);	/* authenticated, no seq */
	reqpkt.implementation = IMPL_XNTPD;	/* local implementation */
	reqpkt.request = REQ_CONFIG;		/* configure a new peer */
	reqpkt.err_nitems = ERR_NITEMS(0, 1);	/* one item */
	reqpkt.mbz_itemsize = MBZ_ITEMSIZE(sizeof(*conf));
	/* Make sure mbz_itemsize <= sizeof reqpkt.data */
	if (sizeof(*conf) > sizeof(reqpkt.data)) {
		msyslog(LOG_ERR,
			"Bletch: conf_peer is too big for reqpkt.data!");
		resolver_exit(1);
	}
	memcpy(reqpkt.data, conf, sizeof(*conf));

	if (sys_authenticate && req_hashlen > 16) {
		pch = reqpkt.data; 
		/* 32-bit alignment */
		pch += (sizeof(*conf) + 3) & ~3;
		pts = (void *)pch;
		pkeyid = (void *)(pts + 1);
		pchEnd = (void *)pkeyid;
		req_len = pchEnd - (char *)&reqpkt;
		pchEnd = (void *)(pkeyid + 1);
		pchEnd += req_hashlen;
		total_len = pchEnd - (char *)&reqpkt;
		if (total_len > sizeof(reqpkt)) {
			msyslog(LOG_ERR,
				"intres total_len %lu limit is %lu (%lu octet digest)\n",
				(u_long)total_len,
				(u_long)sizeof(reqpkt),
				(u_long)req_hashlen);
			resolver_exit(1);
		}
	} else {
		pts = &reqpkt.tstamp;
		pkeyid = &reqpkt.keyid;
		req_len = REQ_LEN_NOMAC;
	}

	*pkeyid = htonl(req_keyid);
	get_systime(&ts);
	L_ADDUF(&ts, SKEWTIME);
	HTONL_FP(&ts, pts);
	if (sys_authenticate) {
		n = authencrypt(req_keyid, (void *)&reqpkt, req_len);
		if ((size_t)n != req_hashlen + sizeof(reqpkt.keyid)) {
			msyslog(LOG_ERR,
				"intres maclen %d expected %lu\n",
				n, (u_long)(req_hashlen +
				sizeof(reqpkt.keyid)));
			resolver_exit(1);
		}
		req_len += n;
	}

	/*
	 * Done.  Send it.
	 */
#ifndef SYS_WINNT
	n = send(sockfd, (char *)&reqpkt, req_len, 0);
	if (n < 0) {
		msyslog(LOG_ERR, "send to NTP server failed: %m");
		return 0;	/* maybe should exit */
	}
#else
	/* In the NT world, documentation seems to indicate that there
	 * exist _write and _read routines that can be used to do blocking
	 * I/O on sockets. Problem is these routines require a socket
	 * handle obtained through the _open_osf_handle C run-time API
	 * of which there is no explanation in the documentation. We need
	 * nonblocking write's and read's anyway for our purpose here.
	 * We're therefore forced to deviate a little bit from the Unix
	 * model here and use the ReadFile and WriteFile Win32 I/O API's
	 * on the socket
	 */
	overlap.Offset = overlap.OffsetHigh = (DWORD)0;
	overlap.hEvent = hReadWriteEvent;
	ret = WriteFile((HANDLE)sockfd, (char *)&reqpkt, req_len,
			NULL, (LPOVERLAPPED)&overlap);
	if ((ret == FALSE) && (GetLastError() != ERROR_IO_PENDING)) {
		msyslog(LOG_ERR, "send to NTP server failed: %m");
		return 0;
	}
	dwWait = WaitForSingleObject(hReadWriteEvent, (DWORD) TIMEOUT_SEC * 1000);
	if ((dwWait == WAIT_FAILED) || (dwWait == WAIT_TIMEOUT)) {
		if (dwWait == WAIT_FAILED)
		    msyslog(LOG_ERR, "WaitForSingleObject failed: %m");
		return 0;
	}
	if (!GetOverlappedResult((HANDLE)sockfd, (LPOVERLAPPED)&overlap,
				(LPDWORD)&NumberOfBytesWritten, FALSE)) {
		msyslog(LOG_ERR, "GetOverlappedResult for WriteFile fails: %m");
		return 0;
	}
#endif /* SYS_WINNT */


	/*
	 * Wait for a response.  A weakness of the mode 7 protocol used
	 * is that there is no way to associate a response with a
	 * particular request, i.e. the response to this configuration
	 * request is indistinguishable from that to any other.  I should
	 * fix this some day.  In any event, the time out is fairly
	 * pessimistic to make sure that if an answer is coming back
	 * at all, we get it.
	 */
	for (;;) {
		FD_ZERO(&fdset);
		FD_SET(sockfd, &fdset);
		tvout.tv_sec = TIMEOUT_SEC;
		tvout.tv_usec = TIMEOUT_USEC;

		n = select(sockfd + 1, &fdset, (fd_set *)0,
			   (fd_set *)0, &tvout);

		if (n < 0) {
			if (errno != EINTR)
				msyslog(LOG_ERR, "select() fails: %m");
			return 0;
		} else if (n == 0) {
#ifdef DEBUG
			if (debug)
				msyslog(LOG_INFO, "ntp_intres select() returned 0.");
#endif
			return 0;
		}

#ifndef SYS_WINNT
		n = recv(sockfd, (char *)&reqpkt, sizeof(reqpkt), 0);
		if (n <= 0) {
			if (n < 0) {
				msyslog(LOG_ERR, "recv() fails: %m");
				return 0;
			}
			continue;
		}
#else /* Overlapped I/O used on non-blocking sockets on Windows NT */
		ret = ReadFile((HANDLE)sockfd, (char *)&reqpkt, sizeof(reqpkt),
			       NULL, (LPOVERLAPPED)&overlap);
		if ((ret == FALSE) && (GetLastError() != ERROR_IO_PENDING)) {
			msyslog(LOG_ERR, "ReadFile() fails: %m");
			return 0;
		}
		dwWait = WaitForSingleObject(hReadWriteEvent, (DWORD) TIMEOUT_SEC * 1000);
		if ((dwWait == WAIT_FAILED) || (dwWait == WAIT_TIMEOUT)) {
			if (dwWait == WAIT_FAILED) {
				msyslog(LOG_ERR, "WaitForSingleObject for ReadFile fails: %m");
				return 0;
			}
			continue;
		}
		if (!GetOverlappedResult((HANDLE)sockfd, (LPOVERLAPPED)&overlap,
					(LPDWORD)&NumberOfBytesRead, FALSE)) {
			msyslog(LOG_ERR, "GetOverlappedResult fails: %m");
			return 0;
		}
		n = NumberOfBytesRead;
#endif /* SYS_WINNT */

		/*
		 * Got one.  Check through to make sure it is what
		 * we expect.
		 */
		if (n < RESP_HEADER_SIZE) {
			msyslog(LOG_ERR, "received runt response (%d octets)",
				n);
			continue;
		}

		if (!ISRESPONSE(reqpkt.rm_vn_mode)) {
#ifdef DEBUG
			if (debug > 1)
			    msyslog(LOG_INFO, "received non-response packet");
#endif
			continue;
		}

		if (ISMORE(reqpkt.rm_vn_mode)) {
#ifdef DEBUG
			if (debug > 1)
			    msyslog(LOG_INFO, "received fragmented packet");
#endif
			continue;
		}

		if ( ( (INFO_VERSION(reqpkt.rm_vn_mode) < 2)
		       || (INFO_VERSION(reqpkt.rm_vn_mode) > NTP_VERSION))
		     || INFO_MODE(reqpkt.rm_vn_mode) != MODE_PRIVATE) {
#ifdef DEBUG
			if (debug > 1)
			    msyslog(LOG_INFO,
				    "version (%d/%d) or mode (%d/%d) incorrect",
				    INFO_VERSION(reqpkt.rm_vn_mode),
				    NTP_VERSION,
				    INFO_MODE(reqpkt.rm_vn_mode),
				    MODE_PRIVATE);
#endif
			continue;
		}

		if (INFO_SEQ(reqpkt.auth_seq) != 0) {
#ifdef DEBUG
			if (debug > 1)
			    msyslog(LOG_INFO,
				    "nonzero sequence number (%d)",
				    INFO_SEQ(reqpkt.auth_seq));
#endif
			continue;
		}

		if (reqpkt.implementation != IMPL_XNTPD ||
		    reqpkt.request != REQ_CONFIG) {
#ifdef DEBUG
			if (debug > 1)
			    msyslog(LOG_INFO,
				    "implementation (%d) or request (%d) incorrect",
				    reqpkt.implementation, reqpkt.request);
#endif
			continue;
		}

		if (INFO_NITEMS(reqpkt.err_nitems) != 0 ||
		    INFO_MBZ(reqpkt.mbz_itemsize) != 0 ||
		    INFO_ITEMSIZE(reqpkt.mbz_itemsize) != 0) {
#ifdef DEBUG
			if (debug > 1)
			    msyslog(LOG_INFO,
				    "nitems (%d) mbz (%d) or itemsize (%d) nonzero",
				    INFO_NITEMS(reqpkt.err_nitems),
				    INFO_MBZ(reqpkt.mbz_itemsize),
				    INFO_ITEMSIZE(reqpkt.mbz_itemsize));
#endif
			continue;
		}

		n = INFO_ERR(reqpkt.err_nitems);
		switch (n) {
		    case INFO_OKAY:
			/* success */
			return 1;
		
		    case INFO_ERR_NODATA:
			/*
			 * newpeer() refused duplicate association, no
			 * point in retrying so call it success.
			 */
			return 1;
		
		    case INFO_ERR_IMPL:
			msyslog(LOG_ERR,
				"ntp_intres.request: implementation mismatch");
			return 0;
		
		    case INFO_ERR_REQ:
			msyslog(LOG_ERR,
				"ntp_intres.request: request unknown");
			return 0;
		
		    case INFO_ERR_FMT:
			msyslog(LOG_ERR,
				"ntp_intres.request: format error");
			return 0;

		    case INFO_ERR_AUTH:
			msyslog(LOG_ERR,
				"ntp_intres.request: permission denied");
			return 0;

		    default:
			msyslog(LOG_ERR,
				"ntp_intres.request: unknown error code %d", n);
			return 0;
		}
	}
}


/*
 * nexttoken - return the next token from a line
 */
static char *
nexttoken(
	char **lptr
	)
{
	register char *cp;
	register char *tstart;

	cp = *lptr;

	/*
	 * Skip leading white space
	 */
	while (*cp == ' ' || *cp == '\t')
	    cp++;
	
	/*
	 * If this is the end of the line, return nothing.
	 */
	if (*cp == '\n' || *cp == '\0') {
		*lptr = cp;
		return NULL;
	}
	
	/*
	 * Must be the start of a token.  Record the pointer and look
	 * for the end.
	 */
	tstart = cp++;
	while (*cp != ' ' && *cp != '\t' && *cp != '\n' && *cp != '\0')
	    cp++;
	
	/*
	 * Terminate the token with a \0.  If this isn't the end of the
	 * line, space to the next character.
	 */
	if (*cp == '\n' || *cp == '\0')
	    *cp = '\0';
	else
	    *cp++ = '\0';

	*lptr = cp;
	return tstart;
}


/*
 * readconf - read the configuration information out of the file we
 *	      were passed.  Note that since the file is supposed to be
 *	      machine generated, we bail out at the first sign of trouble.
 */
static void
readconf(
	FILE *fp,
	char *name
	)
{
	register int i;
	char *token[NUMTOK];
	u_long intval[NUMTOK];
	u_int flags;
	char buf[MAXLINESIZE];
	char *bp;

	while (fgets(buf, MAXLINESIZE, fp) != NULL) {

		bp = buf;
		for (i = 0; i < NUMTOK; i++) {
			if ((token[i] = nexttoken(&bp)) == NULL) {
				msyslog(LOG_ERR,
					"tokenizing error in file `%s', quitting",
					name);
				resolver_exit(1);
			}
		}

		for (i = 1; i < NUMTOK - 1; i++) {
			if (!atouint(token[i], &intval[i])) {
				msyslog(LOG_ERR,
					"format error for integer token `%s', file `%s', quitting",
					token[i], name);
				resolver_exit(1);
			}
		}

#if 0 /* paranoid checking - these are done in newpeer() */
		if (intval[TOK_HMODE] != MODE_ACTIVE &&
		    intval[TOK_HMODE] != MODE_CLIENT &&
		    intval[TOK_HMODE] != MODE_BROADCAST) {
			msyslog(LOG_ERR, "invalid mode (%ld) in file %s",
				intval[TOK_HMODE], name);
			resolver_exit(1);
		}

		if (intval[TOK_VERSION] > NTP_VERSION ||
		    intval[TOK_VERSION] < NTP_OLDVERSION) {
			msyslog(LOG_ERR, "invalid version (%ld) in file %s",
				intval[TOK_VERSION], name);
			resolver_exit(1);
		}
		if (intval[TOK_MINPOLL] < ntp_minpoll ||
		    intval[TOK_MINPOLL] > NTP_MAXPOLL) {

			msyslog(LOG_ERR, "invalid MINPOLL value (%ld) in file %s",
				intval[TOK_MINPOLL], name);
			resolver_exit(1);
		}

		if (intval[TOK_MAXPOLL] < ntp_minpoll ||
		    intval[TOK_MAXPOLL] > NTP_MAXPOLL) {
			msyslog(LOG_ERR, "invalid MAXPOLL value (%ld) in file %s",
				intval[TOK_MAXPOLL], name);
			resolver_exit(1);
		}

		if ((intval[TOK_FLAGS] & ~(FLAG_PREFER | FLAG_NOSELECT |
		    FLAG_BURST | FLAG_IBURST | FLAG_SKEY)) != 0) {
			msyslog(LOG_ERR, "invalid flags (%ld) in file %s",
				intval[TOK_FLAGS], name);
			resolver_exit(1);
		}
#endif /* end paranoid checking */

		flags = 0;
		if (intval[TOK_FLAGS] & FLAG_PREFER)
		    flags |= CONF_FLAG_PREFER;
		if (intval[TOK_FLAGS] & FLAG_NOSELECT)
		    flags |= CONF_FLAG_NOSELECT;
		if (intval[TOK_FLAGS] & FLAG_BURST)
		    flags |= CONF_FLAG_BURST;
		if (intval[TOK_FLAGS] & FLAG_IBURST)
		    flags |= CONF_FLAG_IBURST;

#ifdef OPENSSL
		if (intval[TOK_FLAGS] & FLAG_SKEY)
		    flags |= CONF_FLAG_SKEY;
#endif /* OPENSSL */

		/*
		 * This is as good as we can check it.  Add it in.
		 */
		addentry(token[TOK_HOSTNAME],
			 (int)intval[TOK_NEEDED], (int)intval[TOK_TYPE],
			 (int)intval[TOK_HMODE], (int)intval[TOK_VERSION],
			 (int)intval[TOK_MINPOLL], (int)intval[TOK_MAXPOLL],
			 flags, (int)intval[TOK_TTL],
			 intval[TOK_KEYID], token[TOK_KEYSTR]);
	}
}


/*
 * doconfigure - attempt to resolve names and configure the server
 */
static void
doconfigure(
	int dores
	)
{
	register struct conf_entry *ce;

#ifdef DEBUG
		if (debug > 1)
			msyslog(LOG_INFO, "Running doconfigure %s DNS",
			    dores ? "with" : "without" );
#endif

#if defined(HAVE_RES_INIT)
	if (dores)	   /* Reload /etc/resolv.conf - bug 1226 */
		res_init();
#endif
	ce = confentries;
	while (ce != NULL) {
#ifdef DEBUG
		if (debug > 1)
			msyslog(LOG_INFO,
			    "doconfigure: <%s> has peeraddr %s",
			    ce->ce_name, stoa(&ce->peer_store));
#endif
		if (dores && SOCK_UNSPEC(&ce->peer_store)) {
			if (!findhostaddr(ce)) {
#ifndef IGNORE_DNS_ERRORS
				msyslog(LOG_ERR,
					"couldn't resolve `%s', giving up on it",
					ce->ce_name);
				ce = removeentry(ce);
				continue;
#endif
			} else if (!SOCK_UNSPEC(&ce->peer_store))
				msyslog(LOG_INFO,
					"DNS %s -> %s", ce->ce_name,
					stoa(&ce->peer_store));
		}

		if (!SOCK_UNSPEC(&ce->peer_store)) {
			if (request(&ce->ce_config)) {
				ce = removeentry(ce);
				continue;
			}
			/* 
			 * Failed case.  Should bump counter and give 
			 * up.
			 */
#ifdef DEBUG
			if (debug > 1) {
				msyslog(LOG_INFO,
				    "doconfigure: request() FAILED, maybe next time.");
			}
#endif
		}
		ce = ce->ce_next;
	}
}

#else	/* NO_INTRES follows */
int ntp_intres_nonempty_compilation_unit;
#endif
ntp-4.2.6p5/ntpd/ntp_crypto.c0000644000175000017500000033133411665566225015150 0ustar  peterpeter/*
 * ntp_crypto.c - NTP version 4 public key routines
 */
#ifdef HAVE_CONFIG_H
#include 
#endif

#ifdef OPENSSL
#include 
#include 
#include 
#include 
#include 

#include "ntpd.h"
#include "ntp_stdlib.h"
#include "ntp_unixtime.h"
#include "ntp_string.h"
#include "ntp_random.h"
#include "ntp_assert.h"

#include "openssl/asn1_mac.h"
#include "openssl/bn.h"
#include "openssl/err.h"
#include "openssl/evp.h"
#include "openssl/pem.h"
#include "openssl/rand.h"
#include "openssl/x509v3.h"

#ifdef KERNEL_PLL
#include "ntp_syscall.h"
#endif /* KERNEL_PLL */

/*
 * Extension field message format
 *
 * These are always signed and saved before sending in network byte
 * order. They must be converted to and from host byte order for
 * processing.
 *
 * +-------+-------+
 * |   op  |  len  | <- extension pointer
 * +-------+-------+
 * |    associd    |
 * +---------------+
 * |   timestamp   | <- value pointer
 * +---------------+
 * |   filestamp   |
 * +---------------+
 * |   value len   |
 * +---------------+
 * |               |
 * =     value     =
 * |               |
 * +---------------+
 * | signature len |
 * +---------------+
 * |               |
 * =   signature   =
 * |               |
 * +---------------+
 *
 * The CRYPTO_RESP bit is set to 0 for requests, 1 for responses.
 * Requests carry the association ID of the receiver; responses carry
 * the association ID of the sender. Some messages include only the
 * operation/length and association ID words and so have length 8
 * octets. Ohers include the value structure and associated value and
 * signature fields. These messages include the timestamp, filestamp,
 * value and signature words and so have length at least 24 octets. The
 * signature and/or value fields can be empty, in which case the
 * respective length words are zero. An empty value with nonempty
 * signature is syntactically valid, but semantically questionable.
 *
 * The filestamp represents the time when a cryptographic data file such
 * as a public/private key pair is created. It follows every reference
 * depending on that file and serves as a means to obsolete earlier data
 * of the same type. The timestamp represents the time when the
 * cryptographic data of the message were last signed. Creation of a
 * cryptographic data file or signing a message can occur only when the
 * creator or signor is synchronized to an authoritative source and
 * proventicated to a trusted authority.
 *
 * Note there are several conditions required for server trust. First,
 * the public key on the server certificate must be verified, which can
 * involve a hike along the certificate trail to a trusted host. Next,
 * the server trust must be confirmed by one of several identity
 * schemes. Valid cryptographic values are signed with attached
 * timestamp and filestamp. Individual packet trust is confirmed
 * relative to these values by a message digest with keys generated by a
 * reverse-order pseudorandom hash.
 *
 * State decomposition. These flags are lit in the order given. They are
 * dim only when the association is demobilized.
 *
 * CRYPTO_FLAG_ENAB	Lit upon acceptance of a CRYPTO_ASSOC message
 * CRYPTO_FLAG_CERT	Lit when a self-digned trusted certificate is
 *			accepted.
 * CRYPTO_FLAG_VRFY	Lit when identity is confirmed.
 * CRYPTO_FLAG_PROV	Lit when the first signature is verified.
 * CRYPTO_FLAG_COOK	Lit when a valid cookie is accepted.
 * CRYPTO_FLAG_AUTO	Lit when valid autokey values are accepted.
 * CRYPTO_FLAG_SIGN	Lit when the server signed certificate is
 *			accepted.
 * CRYPTO_FLAG_LEAP	Lit when the leapsecond values are accepted.
 */
/*
 * Cryptodefines
 */
#define TAI_1972	10	/* initial TAI offset (s) */
#define MAX_LEAP	100	/* max UTC leapseconds (s) */
#define VALUE_LEN	(6 * 4) /* min response field length */
#define YEAR		(60 * 60 * 24 * 365) /* seconds in year */

/*
 * Global cryptodata in host byte order
 */
u_int32	crypto_flags = 0x0;	/* status word */
int	crypto_nid = KEY_TYPE_MD5; /* digest nid */
char	*sys_hostname = NULL;	/* host name */
char	*sys_groupname = NULL;	/* group name */

/*
 * Global cryptodata in network byte order
 */
struct cert_info *cinfo = NULL;	/* certificate info/value cache */
struct cert_info *cert_host = NULL; /* host certificate */
struct pkey_info *pkinfo = NULL; /* key info/value cache */
struct value hostval;		/* host value */
struct value pubkey;		/* public key */
struct value tai_leap;		/* leapseconds values */
struct pkey_info *iffkey_info = NULL; /* IFF keys */
struct pkey_info *gqkey_info = NULL; /* GQ keys */
struct pkey_info *mvkey_info = NULL; /* MV keys */

/*
 * Private cryptodata in host byte order
 */
static char *passwd = NULL;	/* private key password */
static EVP_PKEY *host_pkey = NULL; /* host key */
static EVP_PKEY *sign_pkey = NULL; /* sign key */
static const EVP_MD *sign_digest = NULL; /* sign digest */
static u_int sign_siglen;	/* sign key length */
static char *rand_file = NULL;	/* random seed file */

/*
 * Cryptotypes
 */
static	int	crypto_verify	(struct exten *, struct value *,
				    struct peer *);
static	int	crypto_encrypt	(struct exten *, struct value *,
				    keyid_t *);
static	int	crypto_alice	(struct peer *, struct value *);
static	int	crypto_alice2	(struct peer *, struct value *);
static	int	crypto_alice3	(struct peer *, struct value *);
static	int	crypto_bob	(struct exten *, struct value *);
static	int	crypto_bob2	(struct exten *, struct value *);
static	int	crypto_bob3	(struct exten *, struct value *);
static	int	crypto_iff	(struct exten *, struct peer *);
static	int	crypto_gq	(struct exten *, struct peer *);
static	int	crypto_mv	(struct exten *, struct peer *);
static	int	crypto_send	(struct exten *, struct value *, int);
static	tstamp_t crypto_time	(void);
static	u_long	asn2ntp		(ASN1_TIME *);
static	struct cert_info *cert_parse (u_char *, long, tstamp_t);
static	int	cert_sign	(struct exten *, struct value *);
static	struct cert_info *cert_install (struct exten *, struct peer *);
static	int	cert_hike	(struct peer *, struct cert_info *);
static	void	cert_free	(struct cert_info *);
static	struct pkey_info *crypto_key (char *, char *, sockaddr_u *);
static	void	bighash		(BIGNUM *, BIGNUM *);
static	struct cert_info *crypto_cert (char *);

#ifdef SYS_WINNT
int
readlink(char * link, char * file, int len) {
	return (-1);
}
#endif

/*
 * session_key - generate session key
 *
 * This routine generates a session key from the source address,
 * destination address, key ID and private value. The value of the
 * session key is the MD5 hash of these values, while the next key ID is
 * the first four octets of the hash.
 *
 * Returns the next key ID or 0 if there is no destination address.
 */
keyid_t
session_key(
	sockaddr_u *srcadr, 	/* source address */
	sockaddr_u *dstadr, 	/* destination address */
	keyid_t	keyno,		/* key ID */
	keyid_t	private,	/* private value */
	u_long	lifetime 	/* key lifetime */
	)
{
	EVP_MD_CTX ctx;		/* message digest context */
	u_char dgst[EVP_MAX_MD_SIZE]; /* message digest */
	keyid_t	keyid;		/* key identifer */
	u_int32	header[10];	/* data in network byte order */
	u_int	hdlen, len;

	if (!dstadr)
		return 0;
	
	/*
	 * Generate the session key and key ID. If the lifetime is
	 * greater than zero, install the key and call it trusted.
	 */
	hdlen = 0;
	switch(AF(srcadr)) {
	case AF_INET:
		header[0] = NSRCADR(srcadr);
		header[1] = NSRCADR(dstadr);
		header[2] = htonl(keyno);
		header[3] = htonl(private);
		hdlen = 4 * sizeof(u_int32);
		break;

	case AF_INET6:
		memcpy(&header[0], PSOCK_ADDR6(srcadr),
		    sizeof(struct in6_addr));
		memcpy(&header[4], PSOCK_ADDR6(dstadr),
		    sizeof(struct in6_addr));
		header[8] = htonl(keyno);
		header[9] = htonl(private);
		hdlen = 10 * sizeof(u_int32);
		break;
	}
	EVP_DigestInit(&ctx, EVP_get_digestbynid(crypto_nid));
	EVP_DigestUpdate(&ctx, (u_char *)header, hdlen);
	EVP_DigestFinal(&ctx, dgst, &len);
	memcpy(&keyid, dgst, 4);
	keyid = ntohl(keyid);
	if (lifetime != 0) {
		MD5auth_setkey(keyno, crypto_nid, dgst, len);
		authtrust(keyno, lifetime);
	}
	DPRINTF(2, ("session_key: %s > %s %08x %08x hash %08x life %lu\n",
		    stoa(srcadr), stoa(dstadr), keyno,
		    private, keyid, lifetime));

	return (keyid);
}


/*
 * make_keylist - generate key list
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_ERR	protocol error
 *
 * This routine constructs a pseudo-random sequence by repeatedly
 * hashing the session key starting from a given source address,
 * destination address, private value and the next key ID of the
 * preceeding session key. The last entry on the list is saved along
 * with its sequence number and public signature.
 */
int
make_keylist(
	struct peer *peer,	/* peer structure pointer */
	struct interface *dstadr /* interface */
	)
{
	EVP_MD_CTX ctx;		/* signature context */
	tstamp_t tstamp;	/* NTP timestamp */
	struct autokey *ap;	/* autokey pointer */
	struct value *vp;	/* value pointer */
	keyid_t	keyid = 0;	/* next key ID */
	keyid_t	cookie;		/* private value */
	long	lifetime;
	u_int	len, mpoll;
	int	i;

	if (!dstadr)
		return XEVNT_ERR;
	
	/*
	 * Allocate the key list if necessary.
	 */
	tstamp = crypto_time();
	if (peer->keylist == NULL)
		peer->keylist = emalloc(sizeof(keyid_t) *
		    NTP_MAXSESSION);

	/*
	 * Generate an initial key ID which is unique and greater than
	 * NTP_MAXKEY.
	 */
	while (1) {
		keyid = ntp_random() & 0xffffffff;
		if (keyid <= NTP_MAXKEY)
			continue;

		if (authhavekey(keyid))
			continue;
		break;
	}

	/*
	 * Generate up to NTP_MAXSESSION session keys. Stop if the
	 * next one would not be unique or not a session key ID or if
	 * it would expire before the next poll. The private value
	 * included in the hash is zero if broadcast mode, the peer
	 * cookie if client mode or the host cookie if symmetric modes.
	 */
	mpoll = 1 << min(peer->ppoll, peer->hpoll);
	lifetime = min(1 << sys_automax, NTP_MAXSESSION * mpoll);
	if (peer->hmode == MODE_BROADCAST)
		cookie = 0;
	else
		cookie = peer->pcookie;
	for (i = 0; i < NTP_MAXSESSION; i++) {
		peer->keylist[i] = keyid;
		peer->keynumber = i;
		keyid = session_key(&dstadr->sin, &peer->srcadr, keyid,
		    cookie, lifetime + mpoll);
		lifetime -= mpoll;
		if (auth_havekey(keyid) || keyid <= NTP_MAXKEY ||
		    lifetime < 0 || tstamp == 0)
			break;
	}

	/*
	 * Save the last session key ID, sequence number and timestamp,
	 * then sign these values for later retrieval by the clients. Be
	 * careful not to use invalid key media. Use the public values
	 * timestamp as filestamp. 
	 */
	vp = &peer->sndval;
	if (vp->ptr == NULL)
		vp->ptr = emalloc(sizeof(struct autokey));
	ap = (struct autokey *)vp->ptr;
	ap->seq = htonl(peer->keynumber);
	ap->key = htonl(keyid);
	vp->tstamp = htonl(tstamp);
	vp->fstamp = hostval.tstamp;
	vp->vallen = htonl(sizeof(struct autokey));
	vp->siglen = 0;
	if (tstamp != 0) {
		if (vp->sig == NULL)
			vp->sig = emalloc(sign_siglen);
		EVP_SignInit(&ctx, sign_digest);
		EVP_SignUpdate(&ctx, (u_char *)vp, 12);
		EVP_SignUpdate(&ctx, vp->ptr, sizeof(struct autokey));
		if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
			vp->siglen = htonl(sign_siglen);
			peer->flags |= FLAG_ASSOC;
		}
	}
#ifdef DEBUG
	if (debug)
		printf("make_keys: %d %08x %08x ts %u fs %u poll %d\n",
		    peer->keynumber, keyid, cookie, ntohl(vp->tstamp),
		    ntohl(vp->fstamp), peer->hpoll);
#endif
	return (XEVNT_OK);
}


/*
 * crypto_recv - parse extension fields
 *
 * This routine is called when the packet has been matched to an
 * association and passed sanity, format and MAC checks. We believe the
 * extension field values only if the field has proper format and
 * length, the timestamp and filestamp are valid and the signature has
 * valid length and is verified. There are a few cases where some values
 * are believed even if the signature fails, but only if the proventic
 * bit is not set.
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_ERR	protocol error
 * XEVNT_LEN	bad field format or length
 */
int
crypto_recv(
	struct peer *peer,	/* peer structure pointer */
	struct recvbuf *rbufp	/* packet buffer pointer */
	)
{
	const EVP_MD *dp;	/* message digest algorithm */
	u_int32	*pkt;		/* receive packet pointer */
	struct autokey *ap, *bp; /* autokey pointer */
	struct exten *ep, *fp;	/* extension pointers */
	struct cert_info *xinfo; /* certificate info pointer */
	int	has_mac;	/* length of MAC field */
	int	authlen;	/* offset of MAC field */
	associd_t associd;	/* association ID */
	tstamp_t tstamp = 0;	/* timestamp */
	tstamp_t fstamp = 0;	/* filestamp */
	u_int	len;		/* extension field length */
	u_int	code;		/* extension field opcode */
	u_int	vallen = 0;	/* value length */
	X509	*cert;		/* X509 certificate */
	char	statstr[NTP_MAXSTRLEN]; /* statistics for filegen */
	keyid_t	cookie;		/* crumbles */
	int	hismode;	/* packet mode */
	int	rval = XEVNT_OK;
	u_char	*ptr;
	u_int32 temp32;

	/*
	 * Initialize. Note that the packet has already been checked for
	 * valid format and extension field lengths. First extract the
	 * field length, command code and association ID in host byte
	 * order. These are used with all commands and modes. Then check
	 * the version number, which must be 2, and length, which must
	 * be at least 8 for requests and VALUE_LEN (24) for responses.
	 * Packets that fail either test sink without a trace. The
	 * association ID is saved only if nonzero.
	 */
	authlen = LEN_PKT_NOMAC;
	hismode = (int)PKT_MODE((&rbufp->recv_pkt)->li_vn_mode);
	while ((has_mac = rbufp->recv_length - authlen) > MAX_MAC_LEN) {
		pkt = (u_int32 *)&rbufp->recv_pkt + authlen / 4;
		ep = (struct exten *)pkt;
		code = ntohl(ep->opcode) & 0xffff0000;
		len = ntohl(ep->opcode) & 0x0000ffff;
		associd = (associd_t)ntohl(pkt[1]);
		rval = XEVNT_OK;
#ifdef DEBUG
		if (debug)
			printf(
			    "crypto_recv: flags 0x%x ext offset %d len %u code 0x%x associd %d\n",
			    peer->crypto, authlen, len, code >> 16,
			    associd);
#endif

		/*
		 * Check version number and field length. If bad,
		 * quietly ignore the packet.
		 */
		if (((code >> 24) & 0x3f) != CRYPTO_VN || len < 8) {
			sys_badlength++;
			code |= CRYPTO_ERROR;
		}

		if (len >= VALUE_LEN) {
			tstamp = ntohl(ep->tstamp);
			fstamp = ntohl(ep->fstamp);
			vallen = ntohl(ep->vallen);
		}
		switch (code) {

		/*
		 * Install status word, host name, signature scheme and
		 * association ID. In OpenSSL the signature algorithm is
		 * bound to the digest algorithm, so the NID completely
		 * defines the signature scheme. Note the request and
		 * response are identical, but neither is validated by
		 * signature. The request is processed here only in
		 * symmetric modes. The server name field might be
		 * useful to implement access controls in future.
		 */
		case CRYPTO_ASSOC:

			/*
			 * If our state machine is running when this
			 * message arrives, the other fellow might have
			 * restarted. However, this could be an
			 * intruder, so just clamp the poll interval and
			 * find out for ourselves. Otherwise, pass the
			 * extension field to the transmit side.
			 */
			if (peer->crypto & CRYPTO_FLAG_CERT) {
				rval = XEVNT_ERR;
				break;
			}
			if (peer->cmmd) {
				if (peer->assoc != associd) {
					rval = XEVNT_ERR;
					break;
				}
			}
			fp = emalloc(len);
			memcpy(fp, ep, len);
			fp->associd = htonl(peer->associd);
			peer->cmmd = fp;
			/* fall through */

		case CRYPTO_ASSOC | CRYPTO_RESP:

			/*
			 * Discard the message if it has already been
			 * stored or the message has been amputated.
			 */
			if (peer->crypto) {
				if (peer->assoc != associd)
					rval = XEVNT_ERR;
				break;
			}
			if (vallen == 0 || vallen > MAXHOSTNAME ||
			    len < VALUE_LEN + vallen) {
				rval = XEVNT_LEN;
				break;
			}
#ifdef DEBUG
			if (debug)
				printf(
				    "crypto_recv: ident host 0x%x %d server 0x%x %d\n",
				    crypto_flags, peer->associd, fstamp,
				    peer->assoc);
#endif
			temp32 = crypto_flags & CRYPTO_FLAG_MASK;

			/*
			 * If the client scheme is PC, the server scheme
			 * must be PC. The public key and identity are
			 * presumed valid, so we skip the certificate
			 * and identity exchanges and move immediately
			 * to the cookie exchange which confirms the
			 * server signature.
			 */
			if (crypto_flags & CRYPTO_FLAG_PRIV) {
				if (!(fstamp & CRYPTO_FLAG_PRIV)) {
					rval = XEVNT_KEY;
					break;
				}
				fstamp |= CRYPTO_FLAG_CERT |
				    CRYPTO_FLAG_VRFY | CRYPTO_FLAG_SIGN;

			/*
			 * It is an error if either peer supports
			 * identity, but the other does not.
			 */
			} else if (hismode == MODE_ACTIVE || hismode ==
			    MODE_PASSIVE) {
				if ((temp32 && !(fstamp &
				    CRYPTO_FLAG_MASK)) ||
				    (!temp32 && (fstamp &
				    CRYPTO_FLAG_MASK))) {
					rval = XEVNT_KEY;
					break;
				}
			}

			/*
			 * Discard the message if the signature digest
			 * NID is not supported.
			 */
			temp32 = (fstamp >> 16) & 0xffff;
			dp =
			    (const EVP_MD *)EVP_get_digestbynid(temp32);
			if (dp == NULL) {
				rval = XEVNT_MD;
				break;
			}

			/*
			 * Save status word, host name and message
			 * digest/signature type. If this is from a
			 * broadcast and the association ID has changed,
			 * request the autokey values.
			 */
			peer->assoc = associd;
			if (hismode == MODE_SERVER)
				fstamp |= CRYPTO_FLAG_AUTO;
			if (!(fstamp & CRYPTO_FLAG_TAI))
				fstamp |= CRYPTO_FLAG_LEAP;
			RAND_bytes((u_char *)&peer->hcookie, 4);
			peer->crypto = fstamp;
			peer->digest = dp;
			if (peer->subject != NULL)
				free(peer->subject);
			peer->subject = emalloc(vallen + 1);
			memcpy(peer->subject, ep->pkt, vallen);
			peer->subject[vallen] = '\0';
			if (peer->issuer != NULL)
				free(peer->issuer);
			peer->issuer = emalloc(vallen + 1);
			strcpy(peer->issuer, peer->subject);
			snprintf(statstr, NTP_MAXSTRLEN,
			    "assoc %d %d host %s %s", peer->associd,
			    peer->assoc, peer->subject,
			    OBJ_nid2ln(temp32));
			record_crypto_stats(&peer->srcadr, statstr);
#ifdef DEBUG
			if (debug)
				printf("crypto_recv: %s\n", statstr);
#endif
			break;

		/*
		 * Decode X509 certificate in ASN.1 format and extract
		 * the data containing, among other things, subject
		 * name and public key. In the default identification
		 * scheme, the certificate trail is followed to a self
		 * signed trusted certificate.
		 */
		case CRYPTO_CERT | CRYPTO_RESP:

			/*
			 * Discard the message if empty or invalid.
			 */
			if (len < VALUE_LEN)
				break;

			if ((rval = crypto_verify(ep, NULL, peer)) !=
			    XEVNT_OK)
				break;

			/*
			 * Scan the certificate list to delete old
			 * versions and link the newest version first on
			 * the list. Then, verify the signature. If the
			 * certificate is bad or missing, just ignore
			 * it.
			 */
			if ((xinfo = cert_install(ep, peer)) == NULL) {
				rval = XEVNT_CRT;
				break;
			}
			if ((rval = cert_hike(peer, xinfo)) != XEVNT_OK)
				break;

			/*
			 * We plug in the public key and lifetime from
			 * the first certificate received. However, note
			 * that this certificate might not be signed by
			 * the server, so we can't check the
			 * signature/digest NID.
			 */
			if (peer->pkey == NULL) {
				ptr = (u_char *)xinfo->cert.ptr;
				cert = d2i_X509(NULL, &ptr,
				    ntohl(xinfo->cert.vallen));
				peer->pkey = X509_get_pubkey(cert);
				X509_free(cert);
			}
			peer->flash &= ~TEST8;
			temp32 = xinfo->nid;
			snprintf(statstr, NTP_MAXSTRLEN,
			    "cert %s %s 0x%x %s (%u) fs %u",
			    xinfo->subject, xinfo->issuer, xinfo->flags,
			    OBJ_nid2ln(temp32), temp32,
			    ntohl(ep->fstamp));
			record_crypto_stats(&peer->srcadr, statstr);
#ifdef DEBUG
			if (debug)
				printf("crypto_recv: %s\n", statstr);
#endif
			break;

		/*
		 * Schnorr (IFF) identity scheme. This scheme is
		 * designed for use with shared secret server group keys
		 * and where the certificate may be generated by a third
		 * party. The client sends a challenge to the server,
		 * which performs a calculation and returns the result.
		 * A positive result is possible only if both client and
		 * server contain the same secret group key.
		 */
		case CRYPTO_IFF | CRYPTO_RESP:

			/*
			 * Discard the message if invalid.
			 */
			if ((rval = crypto_verify(ep, NULL, peer)) !=
			    XEVNT_OK)
				break;

			/*
			 * If the challenge matches the response, the
			 * server public key, signature and identity are
			 * all verified at the same time. The server is
			 * declared trusted, so we skip further
			 * certificate exchanges and move immediately to
			 * the cookie exchange.
			 */
			if ((rval = crypto_iff(ep, peer)) != XEVNT_OK)
				break;

			peer->crypto |= CRYPTO_FLAG_VRFY;
			peer->flash &= ~TEST8;
			snprintf(statstr, NTP_MAXSTRLEN, "iff %s fs %u",
			    peer->issuer, ntohl(ep->fstamp));
			record_crypto_stats(&peer->srcadr, statstr);
#ifdef DEBUG
			if (debug)
				printf("crypto_recv: %s\n", statstr);
#endif
			break;

		/*
		 * Guillou-Quisquater (GQ) identity scheme. This scheme
		 * is designed for use with public certificates carrying
		 * the GQ public key in an extension field. The client
		 * sends a challenge to the server, which performs a
		 * calculation and returns the result. A positive result
		 * is possible only if both client and server contain
		 * the same group key and the server has the matching GQ
		 * private key.
		 */
		case CRYPTO_GQ | CRYPTO_RESP:

			/*
			 * Discard the message if invalid
			 */
			if ((rval = crypto_verify(ep, NULL, peer)) !=
			    XEVNT_OK)
				break;

			/*
			 * If the challenge matches the response, the
			 * server public key, signature and identity are
			 * all verified at the same time. The server is
			 * declared trusted, so we skip further
			 * certificate exchanges and move immediately to
			 * the cookie exchange.
			 */
			if ((rval = crypto_gq(ep, peer)) != XEVNT_OK)
				break;

			peer->crypto |= CRYPTO_FLAG_VRFY;
			peer->flash &= ~TEST8;
			snprintf(statstr, NTP_MAXSTRLEN, "gq %s fs %u",
			    peer->issuer, ntohl(ep->fstamp));
			record_crypto_stats(&peer->srcadr, statstr);
#ifdef DEBUG
			if (debug)
				printf("crypto_recv: %s\n", statstr);
#endif
			break;

		/*
		 * Mu-Varadharajan (MV) identity scheme. This scheme is
		 * designed for use with three levels of trust, trusted
		 * host, server and client. The trusted host key is
		 * opaque to servers and clients; the server keys are
		 * opaque to clients and each client key is different.
		 * Client keys can be revoked without requiring new key
		 * generations.
		 */
		case CRYPTO_MV | CRYPTO_RESP:

			/*
			 * Discard the message if invalid.
			 */
			if ((rval = crypto_verify(ep, NULL, peer)) !=
			    XEVNT_OK)
				break;

			/*
			 * If the challenge matches the response, the
			 * server public key, signature and identity are
			 * all verified at the same time. The server is
			 * declared trusted, so we skip further
			 * certificate exchanges and move immediately to
			 * the cookie exchange.
			 */
			if ((rval = crypto_mv(ep, peer)) != XEVNT_OK)
				break;

			peer->crypto |= CRYPTO_FLAG_VRFY;
			peer->flash &= ~TEST8;
			snprintf(statstr, NTP_MAXSTRLEN, "mv %s fs %u",
			    peer->issuer, ntohl(ep->fstamp));
			record_crypto_stats(&peer->srcadr, statstr);
#ifdef DEBUG
			if (debug)
				printf("crypto_recv: %s\n", statstr);
#endif
			break;


		/*
		 * Cookie response in client and symmetric modes. If the
		 * cookie bit is set, the working cookie is the EXOR of
		 * the current and new values.
		 */
		case CRYPTO_COOK | CRYPTO_RESP:

			/*
			 * Discard the message if invalid or signature
			 * not verified with respect to the cookie
			 * values.
			 */
			if ((rval = crypto_verify(ep, &peer->cookval,
			    peer)) != XEVNT_OK)
				break;

			/*
			 * Decrypt the cookie, hunting all the time for
			 * errors.
			 */
			if (vallen == (u_int)EVP_PKEY_size(host_pkey)) {
				if (RSA_private_decrypt(vallen,
				    (u_char *)ep->pkt,
				    (u_char *)&temp32,
				    host_pkey->pkey.rsa,
				    RSA_PKCS1_OAEP_PADDING) <= 0) {
					rval = XEVNT_CKY;
					break;
				} else {
					cookie = ntohl(temp32);
				}
			} else {
				rval = XEVNT_CKY;
				break;
			}

			/*
			 * Install cookie values and light the cookie
			 * bit. If this is not broadcast client mode, we
			 * are done here.
			 */
			key_expire(peer);
			if (hismode == MODE_ACTIVE || hismode ==
			    MODE_PASSIVE)
				peer->pcookie = peer->hcookie ^ cookie;
			else
				peer->pcookie = cookie;
			peer->crypto |= CRYPTO_FLAG_COOK;
			peer->flash &= ~TEST8;
			snprintf(statstr, NTP_MAXSTRLEN,
			    "cook %x ts %u fs %u", peer->pcookie,
			    ntohl(ep->tstamp), ntohl(ep->fstamp));
			record_crypto_stats(&peer->srcadr, statstr);
#ifdef DEBUG
			if (debug)
				printf("crypto_recv: %s\n", statstr);
#endif
			break;

		/*
		 * Install autokey values in broadcast client and
		 * symmetric modes. We have to do this every time the
		 * sever/peer cookie changes or a new keylist is
		 * rolled. Ordinarily, this is automatic as this message
		 * is piggybacked on the first NTP packet sent upon
		 * either of these events. Note that a broadcast client
		 * or symmetric peer can receive this response without a
		 * matching request.
		 */
		case CRYPTO_AUTO | CRYPTO_RESP:

			/*
			 * Discard the message if invalid or signature
			 * not verified with respect to the receive
			 * autokey values.
			 */
			if ((rval = crypto_verify(ep, &peer->recval,
			    peer)) != XEVNT_OK) 
				break;

			/*
			 * Discard the message if a broadcast client and
			 * the association ID does not match. This might
			 * happen if a broacast server restarts the
			 * protocol. A protocol restart will occur at
			 * the next ASSOC message.
			 */
			if ((peer->cast_flags & MDF_BCLNT) &&
			    peer->assoc != associd)
				break;

			/*
			 * Install autokey values and light the
			 * autokey bit. This is not hard.
			 */
			if (ep->tstamp == 0)
				break;

			if (peer->recval.ptr == NULL)
				peer->recval.ptr =
				    emalloc(sizeof(struct autokey));
			bp = (struct autokey *)peer->recval.ptr;
			peer->recval.tstamp = ep->tstamp;
			peer->recval.fstamp = ep->fstamp;
			ap = (struct autokey *)ep->pkt;
			bp->seq = ntohl(ap->seq);
			bp->key = ntohl(ap->key);
			peer->pkeyid = bp->key;
			peer->crypto |= CRYPTO_FLAG_AUTO;
			peer->flash &= ~TEST8;
			snprintf(statstr, NTP_MAXSTRLEN, 
			    "auto seq %d key %x ts %u fs %u", bp->seq,
			    bp->key, ntohl(ep->tstamp),
			    ntohl(ep->fstamp));
			record_crypto_stats(&peer->srcadr, statstr);
#ifdef DEBUG
			if (debug)
				printf("crypto_recv: %s\n", statstr);
#endif
			break;
	
		/*
		 * X509 certificate sign response. Validate the
		 * certificate signed by the server and install. Later
		 * this can be provided to clients of this server in
		 * lieu of the self signed certificate in order to
		 * validate the public key.
		 */
		case CRYPTO_SIGN | CRYPTO_RESP:

			/*
			 * Discard the message if invalid.
			 */
			if ((rval = crypto_verify(ep, NULL, peer)) !=
			    XEVNT_OK)
				break;

			/*
			 * Scan the certificate list to delete old
			 * versions and link the newest version first on
			 * the list.
			 */
			if ((xinfo = cert_install(ep, peer)) == NULL) {
				rval = XEVNT_CRT;
				break;
			}
			peer->crypto |= CRYPTO_FLAG_SIGN;
			peer->flash &= ~TEST8;
			temp32 = xinfo->nid;
			snprintf(statstr, NTP_MAXSTRLEN,
			    "sign %s %s 0x%x %s (%u) fs %u",
			    xinfo->subject, xinfo->issuer, xinfo->flags,
			    OBJ_nid2ln(temp32), temp32,
			    ntohl(ep->fstamp));
			record_crypto_stats(&peer->srcadr, statstr);
#ifdef DEBUG
			if (debug)
				printf("crypto_recv: %s\n", statstr);
#endif
			break;

		/*
		 * Install leapseconds values. While the leapsecond
		 * values epoch, TAI offset and values expiration epoch
		 * are retained, only the current TAI offset is provided
		 * via the kernel to other applications.
		 */
		case CRYPTO_LEAP | CRYPTO_RESP:

			/*
			 * Discard the message if invalid. We can't
			 * compare the value timestamps here, as they
			 * can be updated by different servers.
			 */
			if ((rval = crypto_verify(ep, NULL, peer)) !=
			    XEVNT_OK)
				break;

			/*
			 * If the packet leap values are more recent
			 * than the stored ones, install the new leap
			 * values and recompute the signatures.
			 */
			if (ntohl(ep->pkt[2]) > leap_expire) {
				char	tbuf[80], str1 [20], str2[20];

				tai_leap.tstamp = ep->tstamp;
				tai_leap.fstamp = ep->fstamp;
				tai_leap.vallen = ep->vallen;
				leap_tai = ntohl(ep->pkt[0]);
				leap_sec = ntohl(ep->pkt[1]);
				leap_expire = ntohl(ep->pkt[2]);
				crypto_update();
				strcpy(str1, fstostr(leap_sec));
				strcpy(str2, fstostr(leap_expire));
				snprintf(tbuf, sizeof(tbuf),
				    "%d leap %s expire %s", leap_tai, str1,
				    str2);
				    report_event(EVNT_TAI, peer, tbuf);
			}
			peer->crypto |= CRYPTO_FLAG_LEAP;
			peer->flash &= ~TEST8;
			snprintf(statstr, NTP_MAXSTRLEN,
			    "leap TAI offset %d at %u expire %u fs %u",
			    ntohl(ep->pkt[0]), ntohl(ep->pkt[1]),
			    ntohl(ep->pkt[2]), ntohl(ep->fstamp));
			record_crypto_stats(&peer->srcadr, statstr);
#ifdef DEBUG
			if (debug)
				printf("crypto_recv: %s\n", statstr);
#endif
			break;

		/*
		 * We come here in symmetric modes for miscellaneous
		 * commands that have value fields but are processed on
		 * the transmit side. All we need do here is check for
		 * valid field length. Note that ASSOC is handled
		 * separately.
		 */
		case CRYPTO_CERT:
		case CRYPTO_IFF:
		case CRYPTO_GQ:
		case CRYPTO_MV:
		case CRYPTO_COOK:
		case CRYPTO_SIGN:
			if (len < VALUE_LEN) {
				rval = XEVNT_LEN;
				break;
			}
			/* fall through */

		/*
		 * We come here in symmetric modes for requests
		 * requiring a response (above plus AUTO and LEAP) and
		 * for responses. If a request, save the extension field
		 * for later; invalid requests will be caught on the
		 * transmit side. If an error or invalid response,
		 * declare a protocol error.
		 */
		default:
			if (code & (CRYPTO_RESP | CRYPTO_ERROR)) {
				rval = XEVNT_ERR;
			} else if (peer->cmmd == NULL) {
				fp = emalloc(len);
				memcpy(fp, ep, len);
				peer->cmmd = fp;
			}
		}

		/*
		 * The first error found terminates the extension field
		 * scan and we return the laundry to the caller.
		 */
		if (rval != XEVNT_OK) {
			snprintf(statstr, NTP_MAXSTRLEN,
			    "%04x %d %02x %s", htonl(ep->opcode),
			    associd, rval, eventstr(rval));
			record_crypto_stats(&peer->srcadr, statstr);
#ifdef DEBUG
			if (debug)
				printf("crypto_recv: %s\n", statstr);
#endif
			return (rval);
		}
		authlen += (len + 3) / 4 * 4;
	}
	return (rval);
}


/*
 * crypto_xmit - construct extension fields
 *
 * This routine is called both when an association is configured and
 * when one is not. The only case where this matters is to retrieve the
 * autokey information, in which case the caller has to provide the
 * association ID to match the association.
 *
 * Side effect: update the packet offset.
 *
 * Errors
 * XEVNT_OK	success
 * XEVNT_CRT	bad or missing certificate
 * XEVNT_ERR	protocol error
 * XEVNT_LEN	bad field format or length
 * XEVNT_PER	host certificate expired
 */
int
crypto_xmit(
	struct peer *peer,	/* peer structure pointer */
	struct pkt *xpkt,	/* transmit packet pointer */
	struct recvbuf *rbufp,	/* receive buffer pointer */
	int	start,		/* offset to extension field */
	struct exten *ep,	/* extension pointer */
	keyid_t cookie		/* session cookie */
	)
{
	struct exten *fp;	/* extension pointers */
	struct cert_info *cp, *xp, *yp; /* cert info/value pointer */
	sockaddr_u *srcadr_sin; /* source address */
	u_int32	*pkt;		/* packet pointer */
	u_int	opcode;		/* extension field opcode */
	char	certname[MAXHOSTNAME + 1]; /* subject name buffer */
	char	statstr[NTP_MAXSTRLEN]; /* statistics for filegen */
	tstamp_t tstamp;
	u_int	vallen;
	struct value vtemp;
	associd_t associd;
	int	rval;
	int	len;
	keyid_t tcookie;

	/*
	 * Generate the requested extension field request code, length
	 * and association ID. If this is a response and the host is not
	 * synchronized, light the error bit and go home.
	 */
	pkt = (u_int32 *)xpkt + start / 4;
	fp = (struct exten *)pkt;
	opcode = ntohl(ep->opcode);
	if (peer != NULL) {
		srcadr_sin = &peer->srcadr;
		if (!(opcode & CRYPTO_RESP))
			peer->opcode = ep->opcode;
	} else {
		srcadr_sin = &rbufp->recv_srcadr;
	}
	associd = (associd_t) ntohl(ep->associd);
	len = 8;
	fp->opcode = htonl((opcode & 0xffff0000) | len);
	fp->associd = ep->associd;
	rval = XEVNT_OK;
	tstamp = crypto_time();
	switch (opcode & 0xffff0000) {

	/*
	 * Send association request and response with status word and
	 * host name. Note, this message is not signed and the filestamp
	 * contains only the status word.
	 */
	case CRYPTO_ASSOC:
	case CRYPTO_ASSOC | CRYPTO_RESP:
		len = crypto_send(fp, &hostval, start);
		fp->fstamp = htonl(crypto_flags);
		break;

	/*
	 * Send certificate request. Use the values from the extension
	 * field.
	 */
	case CRYPTO_CERT:
		memset(&vtemp, 0, sizeof(vtemp));
		vtemp.tstamp = ep->tstamp;
		vtemp.fstamp = ep->fstamp;
		vtemp.vallen = ep->vallen;
		vtemp.ptr = (u_char *)ep->pkt;
		len = crypto_send(fp, &vtemp, start);
		break;

	/*
	 * Send sign request. Use the host certificate, which is self-
	 * signed and may or may not be trusted.
	 */
	case CRYPTO_SIGN:
		if (tstamp < cert_host->first || tstamp >
		    cert_host->last)
			rval = XEVNT_PER;
		else
			len = crypto_send(fp, &cert_host->cert, start);
		break;

	/*
	 * Send certificate response. Use the name in the extension
	 * field to find the certificate in the cache. If the request
	 * contains no subject name, assume the name of this host. This
	 * is for backwards compatibility. Private certificates are
	 * never sent.
	 *
	 * There may be several certificates matching the request. First
	 * choice is a self-signed trusted certificate; second choice is
	 * any certificate signed by another host. There is no third
	 * choice. 
	 */
	case CRYPTO_CERT | CRYPTO_RESP:
		vallen = ntohl(ep->vallen);
		if (vallen == 0 || vallen > MAXHOSTNAME) {
			rval = XEVNT_LEN;
			break;

		} else {
			memcpy(certname, ep->pkt, vallen);
			certname[vallen] = '\0';
		}

		/*
		 * Find all public valid certificates with matching
		 * subject. If a self-signed, trusted certificate is
		 * found, use that certificate. If not, use the last non
		 * self-signed certificate.
		 */
		xp = yp = NULL;
		for (cp = cinfo; cp != NULL; cp = cp->link) {
			if (cp->flags & (CERT_PRIV | CERT_ERROR))
				continue;

			if (strcmp(certname, cp->subject) != 0)
				continue;

			if (strcmp(certname, cp->issuer) != 0)
				yp = cp;
			else if (cp ->flags & CERT_TRUST)
				xp = cp;
			continue;
		}

		/*
		 * Be careful who you trust. If the certificate is not
		 * found, return an empty response. Note that we dont
		 * enforce lifetimes here.
		 *
		 * The timestamp and filestamp are taken from the
		 * certificate value structure. For all certificates the
		 * timestamp is the latest signature update time. For
		 * host and imported certificates the filestamp is the
		 * creation epoch. For signed certificates the filestamp
		 * is the creation epoch of the trusted certificate at
		 * the root of the certificate trail. In principle, this
		 * allows strong checking for signature masquerade.
		 */
		if (xp == NULL)
			xp = yp;
		if (xp == NULL)
			break;

		if (tstamp == 0)
			break;

		len = crypto_send(fp, &xp->cert, start);
		break;

	/*
	 * Send challenge in Schnorr (IFF) identity scheme.
	 */
	case CRYPTO_IFF:
		if (peer == NULL)
			break;		/* hack attack */

		if ((rval = crypto_alice(peer, &vtemp)) == XEVNT_OK) {
			len = crypto_send(fp, &vtemp, start);
			value_free(&vtemp);
		}
		break;

	/*
	 * Send response in Schnorr (IFF) identity scheme.
	 */
	case CRYPTO_IFF | CRYPTO_RESP:
		if ((rval = crypto_bob(ep, &vtemp)) == XEVNT_OK) {
			len = crypto_send(fp, &vtemp, start);
			value_free(&vtemp);
		}
		break;

	/*
	 * Send challenge in Guillou-Quisquater (GQ) identity scheme.
	 */
	case CRYPTO_GQ:
		if (peer == NULL)
			break;		/* hack attack */

		if ((rval = crypto_alice2(peer, &vtemp)) == XEVNT_OK) {
			len = crypto_send(fp, &vtemp, start);
			value_free(&vtemp);
		}
		break;

	/*
	 * Send response in Guillou-Quisquater (GQ) identity scheme.
	 */
	case CRYPTO_GQ | CRYPTO_RESP:
		if ((rval = crypto_bob2(ep, &vtemp)) == XEVNT_OK) {
			len = crypto_send(fp, &vtemp, start);
			value_free(&vtemp);
		}
		break;

	/*
	 * Send challenge in MV identity scheme.
	 */
	case CRYPTO_MV:
		if (peer == NULL)
			break;		/* hack attack */

		if ((rval = crypto_alice3(peer, &vtemp)) == XEVNT_OK) {
			len = crypto_send(fp, &vtemp, start);
			value_free(&vtemp);
		}
		break;

	/*
	 * Send response in MV identity scheme.
	 */
	case CRYPTO_MV | CRYPTO_RESP:
		if ((rval = crypto_bob3(ep, &vtemp)) == XEVNT_OK) {
			len = crypto_send(fp, &vtemp, start);
			value_free(&vtemp);
		}
		break;

	/*
	 * Send certificate sign response. The integrity of the request
	 * certificate has already been verified on the receive side.
	 * Sign the response using the local server key. Use the
	 * filestamp from the request and use the timestamp as the
	 * current time. Light the error bit if the certificate is
	 * invalid or contains an unverified signature.
	 */
	case CRYPTO_SIGN | CRYPTO_RESP:
		if ((rval = cert_sign(ep, &vtemp)) == XEVNT_OK) {
			len = crypto_send(fp, &vtemp, start);
			value_free(&vtemp);
		}
		break;

	/*
	 * Send public key and signature. Use the values from the public
	 * key.
	 */
	case CRYPTO_COOK:
		len = crypto_send(fp, &pubkey, start);
		break;

	/*
	 * Encrypt and send cookie and signature. Light the error bit if
	 * anything goes wrong.
	 */
	case CRYPTO_COOK | CRYPTO_RESP:
		if ((opcode & 0xffff) < VALUE_LEN) {
			rval = XEVNT_LEN;
			break;
		}
		if (peer == NULL)
			tcookie = cookie;
		else
			tcookie = peer->hcookie;
		if ((rval = crypto_encrypt(ep, &vtemp, &tcookie)) ==
		    XEVNT_OK) {
			len = crypto_send(fp, &vtemp, start);
			value_free(&vtemp);
		}
		break;

	/*
	 * Find peer and send autokey data and signature in broadcast
	 * server and symmetric modes. Use the values in the autokey
	 * structure. If no association is found, either the server has
	 * restarted with new associations or some perp has replayed an
	 * old message, in which case light the error bit.
	 */
	case CRYPTO_AUTO | CRYPTO_RESP:
		if (peer == NULL) {
			if ((peer = findpeerbyassoc(associd)) == NULL) {
				rval = XEVNT_ERR;
				break;
			}
		}
		peer->flags &= ~FLAG_ASSOC;
		len = crypto_send(fp, &peer->sndval, start);
		break;

	/*
	 * Send leapseconds values and signature. Use the values from
	 * the tai structure. If no table has been loaded, just send an
	 * empty request.
	 */
	case CRYPTO_LEAP | CRYPTO_RESP:
		len = crypto_send(fp, &tai_leap, start);
		break;

	/*
	 * Default - Send a valid command for unknown requests; send
	 * an error response for unknown resonses.
	 */
	default:
		if (opcode & CRYPTO_RESP)
			rval = XEVNT_ERR;
	}

	/*
	 * In case of error, flame the log. If a request, toss the
	 * puppy; if a response, return so the sender can flame, too.
	 */
	if (rval != XEVNT_OK) {
		u_int32	uint32;

		uint32 = CRYPTO_ERROR;
		opcode |= uint32;
		fp->opcode |= htonl(uint32);
		snprintf(statstr, NTP_MAXSTRLEN,
		    "%04x %d %02x %s", opcode, associd, rval,
		    eventstr(rval));
		record_crypto_stats(srcadr_sin, statstr);
#ifdef DEBUG
		if (debug)
			printf("crypto_xmit: %s\n", statstr);
#endif
		if (!(opcode & CRYPTO_RESP))
			return (0);
	}
#ifdef DEBUG
	if (debug)
		printf(
		    "crypto_xmit: flags 0x%x offset %d len %d code 0x%x associd %d\n",
		    crypto_flags, start, len, opcode >> 16, associd);
#endif
	return (len);
}


/*
 * crypto_verify - verify the extension field value and signature
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_ERR	protocol error
 * XEVNT_FSP	bad filestamp
 * XEVNT_LEN	bad field format or length
 * XEVNT_PUB	bad or missing public key
 * XEVNT_SGL	bad signature length
 * XEVNT_SIG	signature not verified
 * XEVNT_TSP	bad timestamp
 */
static int
crypto_verify(
	struct exten *ep,	/* extension pointer */
	struct value *vp,	/* value pointer */
	struct peer *peer	/* peer structure pointer */
	)
{
	EVP_PKEY *pkey;		/* server public key */
	EVP_MD_CTX ctx;		/* signature context */
	tstamp_t tstamp, tstamp1 = 0; /* timestamp */
	tstamp_t fstamp, fstamp1 = 0; /* filestamp */
	u_int	vallen;		/* value length */
	u_int	siglen;		/* signature length */
	u_int	opcode, len;
	int	i;

	/*
	 * We are extremely parannoyed. We require valid opcode, length,
	 * association ID, timestamp, filestamp, public key, digest,
	 * signature length and signature, where relevant. Note that
	 * preliminary length checks are done in the main loop.
	 */
	len = ntohl(ep->opcode) & 0x0000ffff;
	opcode = ntohl(ep->opcode) & 0xffff0000;

	/*
	 * Check for valid value header, association ID and extension
	 * field length. Remember, it is not an error to receive an
	 * unsolicited response; however, the response ID must match
	 * the association ID.
	 */
	if (opcode & CRYPTO_ERROR)
		return (XEVNT_ERR);

 	if (len < VALUE_LEN)
		return (XEVNT_LEN);

	if (opcode == (CRYPTO_AUTO | CRYPTO_RESP) && (peer->pmode ==
	    MODE_BROADCAST || (peer->cast_flags & MDF_BCLNT))) {
		if (ntohl(ep->associd) != peer->assoc)
			return (XEVNT_ERR);
	} else {
		if (ntohl(ep->associd) != peer->associd)
			return (XEVNT_ERR);
	}

	/*
	 * We have a valid value header. Check for valid value and
	 * signature field lengths. The extension field length must be
	 * long enough to contain the value header, value and signature.
	 * Note both the value and signature field lengths are rounded
	 * up to the next word (4 octets).
	 */
	vallen = ntohl(ep->vallen);
	if (vallen == 0)
		return (XEVNT_LEN);

	i = (vallen + 3) / 4;
	siglen = ntohl(ep->pkt[i++]);
	if (len < VALUE_LEN + ((vallen + 3) / 4) * 4 + ((siglen + 3) /
	    4) * 4)
		return (XEVNT_LEN);

	/*
	 * Check for valid timestamp and filestamp. If the timestamp is
	 * zero, the sender is not synchronized and signatures are
	 * not possible. If nonzero the timestamp must not precede the
	 * filestamp. The timestamp and filestamp must not precede the
	 * corresponding values in the value structure, if present.
 	 */
	tstamp = ntohl(ep->tstamp);
	fstamp = ntohl(ep->fstamp);
	if (tstamp == 0)
		return (XEVNT_TSP);

	if (tstamp < fstamp)
		return (XEVNT_TSP);

	if (vp != NULL) {
		tstamp1 = ntohl(vp->tstamp);
		fstamp1 = ntohl(vp->fstamp);
		if (tstamp1 != 0 && fstamp1 != 0) {
			if (tstamp < tstamp1)
				return (XEVNT_TSP);

			if ((tstamp < fstamp1 || fstamp < fstamp1))
				return (XEVNT_FSP);
		}
	}

	/*
	 * At the time the certificate message is validated, the public
	 * key in the message is not available. Thus, don't try to
	 * verify the signature.
	 */
	if (opcode == (CRYPTO_CERT | CRYPTO_RESP))
		return (XEVNT_OK);

	/*
	 * Check for valid signature length, public key and digest
	 * algorithm.
	 */
	if (crypto_flags & peer->crypto & CRYPTO_FLAG_PRIV)
		pkey = sign_pkey;
	else
		pkey = peer->pkey;
	if (siglen == 0 || pkey == NULL || peer->digest == NULL)
		return (XEVNT_ERR);

	if (siglen != (u_int)EVP_PKEY_size(pkey))
		return (XEVNT_SGL);

	/*
	 * Darn, I thought we would never get here. Verify the
	 * signature. If the identity exchange is verified, light the
	 * proventic bit. What a relief.
	 */
	EVP_VerifyInit(&ctx, peer->digest);
	EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12);
	if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen,
	    pkey) <= 0)
		return (XEVNT_SIG);

	if (peer->crypto & CRYPTO_FLAG_VRFY)
		peer->crypto |= CRYPTO_FLAG_PROV;
	return (XEVNT_OK);
}


/*
 * crypto_encrypt - construct encrypted cookie and signature from
 * extension field and cookie
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_CKY	bad or missing cookie
 * XEVNT_PUB	bad or missing public key
 */
static int
crypto_encrypt(
	struct exten *ep,	/* extension pointer */
	struct value *vp,	/* value pointer */
	keyid_t	*cookie		/* server cookie */
	)
{
	EVP_PKEY *pkey;		/* public key */
	EVP_MD_CTX ctx;		/* signature context */
	tstamp_t tstamp;	/* NTP timestamp */
	u_int32	temp32;
	u_int	len;
	u_char	*ptr;

	/*
	 * Extract the public key from the request.
	 */
	len = ntohl(ep->vallen);
	ptr = (u_char *)ep->pkt;
	pkey = d2i_PublicKey(EVP_PKEY_RSA, NULL, &ptr, len);
	if (pkey == NULL) {
		msyslog(LOG_ERR, "crypto_encrypt: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		return (XEVNT_PUB);
	}

	/*
	 * Encrypt the cookie, encode in ASN.1 and sign.
	 */
	memset(vp, 0, sizeof(struct value));
	tstamp = crypto_time();
	vp->tstamp = htonl(tstamp);
	vp->fstamp = hostval.tstamp;
	len = EVP_PKEY_size(pkey);
	vp->vallen = htonl(len);
	vp->ptr = emalloc(len);
	ptr = vp->ptr;
	temp32 = htonl(*cookie);
	if (RSA_public_encrypt(4, (u_char *)&temp32, ptr,
	    pkey->pkey.rsa, RSA_PKCS1_OAEP_PADDING) <= 0) {
		msyslog(LOG_ERR, "crypto_encrypt: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		free(vp->ptr);
		EVP_PKEY_free(pkey);
		return (XEVNT_CKY);
	}
	EVP_PKEY_free(pkey);
	if (tstamp == 0)
		return (XEVNT_OK);

	vp->sig = emalloc(sign_siglen);
	EVP_SignInit(&ctx, sign_digest);
	EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
	EVP_SignUpdate(&ctx, vp->ptr, len);
	if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
		vp->siglen = htonl(sign_siglen);
	return (XEVNT_OK);
}


/*
 * crypto_ident - construct extension field for identity scheme
 *
 * This routine determines which identity scheme is in use and
 * constructs an extension field for that scheme.
 *
 * Returns
 * CRYTPO_IFF	IFF scheme
 * CRYPTO_GQ	GQ scheme
 * CRYPTO_MV	MV scheme
 * CRYPTO_NULL	no available scheme
 */
u_int
crypto_ident(
	struct peer *peer	/* peer structure pointer */
	)
{
	char	filename[MAXFILENAME];

	/*
	 * We come here after the group trusted host has been found; its
	 * name defines the group name. Search the key cache for all
	 * keys matching the same group name in order IFF, GQ and MV.
	 * Use the first one available.
	 */
	if (peer->crypto & CRYPTO_FLAG_IFF) {
		snprintf(filename, MAXFILENAME, "ntpkey_iffpar_%s",
		    peer->issuer);
		peer->ident_pkey = crypto_key(filename, NULL,
		    &peer->srcadr);
		if (peer->ident_pkey != NULL)
			return (CRYPTO_IFF);
	}
	if (peer->crypto & CRYPTO_FLAG_GQ) {
		snprintf(filename, MAXFILENAME, "ntpkey_gqpar_%s",
		    peer->issuer);
		peer->ident_pkey = crypto_key(filename, NULL,
		    &peer->srcadr);
		if (peer->ident_pkey != NULL)
			return (CRYPTO_GQ);
	}
	if (peer->crypto & CRYPTO_FLAG_MV) {
		snprintf(filename, MAXFILENAME, "ntpkey_mvpar_%s",
		    peer->issuer);
		peer->ident_pkey = crypto_key(filename, NULL,
		    &peer->srcadr);
		if (peer->ident_pkey != NULL)
			return (CRYPTO_MV);
	}
	msyslog(LOG_NOTICE,
	    "crypto_ident: no identity parameters found for group %s",
	    peer->issuer);
	return (CRYPTO_NULL);
}


/*
 * crypto_args - construct extension field from arguments
 *
 * This routine creates an extension field with current timestamps and
 * specified opcode, association ID and optional string. Note that the
 * extension field is created here, but freed after the crypto_xmit()
 * call in the protocol module.
 *
 * Returns extension field pointer (no errors)
 */
struct exten *
crypto_args(
	struct peer *peer,	/* peer structure pointer */
	u_int	opcode,		/* operation code */
	associd_t associd,	/* association ID */
	char	*str		/* argument string */
	)
{
	tstamp_t tstamp;	/* NTP timestamp */
	struct exten *ep;	/* extension field pointer */
	u_int	len;		/* extension field length */

	tstamp = crypto_time();
	len = sizeof(struct exten);
	if (str != NULL)
		len += strlen(str);
	ep = emalloc(len);
	memset(ep, 0, len);
	if (opcode == 0)
		return (ep);

	ep->opcode = htonl(opcode + len);
	ep->associd = htonl(associd);
	ep->tstamp = htonl(tstamp);
	ep->fstamp = hostval.tstamp;
	ep->vallen = 0;
	if (str != NULL) {
		ep->vallen = htonl(strlen(str));
		memcpy((char *)ep->pkt, str, strlen(str));
	}
	return (ep);
}


/*
 * crypto_send - construct extension field from value components
 *
 * The value and signature fields are zero-padded to a word boundary.
 * Note: it is not polite to send a nonempty signature with zero
 * timestamp or a nonzero timestamp with an empty signature, but those
 * rules are not enforced here.
 */
int
crypto_send(
	struct exten *ep,	/* extension field pointer */
	struct value *vp,	/* value pointer */
	int	start		/* buffer offset */
	)
{
	u_int	len, vallen, siglen, opcode;
	int	i, j;

	/*
	 * Calculate extension field length and check for buffer
	 * overflow. Leave room for the MAC.
	 */
	len = 16;
	vallen = ntohl(vp->vallen);
	len += ((vallen + 3) / 4 + 1) * 4; 
	siglen = ntohl(vp->siglen);
	len += ((siglen + 3) / 4 + 1) * 4; 
	if (start + len > sizeof(struct pkt) - MAX_MAC_LEN)
		return (0);

	/*
	 * Copy timestamps.
	 */
	ep->tstamp = vp->tstamp;
	ep->fstamp = vp->fstamp;
	ep->vallen = vp->vallen;

	/*
	 * Copy value. If the data field is empty or zero length,
	 * encode an empty value with length zero.
	 */
	i = 0;
	if (vallen > 0 && vp->ptr != NULL) {
		j = vallen / 4;
		if (j * 4 < vallen)
			ep->pkt[i + j++] = 0;
		memcpy(&ep->pkt[i], vp->ptr, vallen);
		i += j;
	}

	/*
	 * Copy signature. If the signature field is empty or zero
	 * length, encode an empty signature with length zero.
	 */
	ep->pkt[i++] = vp->siglen;
	if (siglen > 0 && vp->sig != NULL) {
		j = vallen / 4;
		if (j * 4 < siglen)
			ep->pkt[i + j++] = 0;
		memcpy(&ep->pkt[i], vp->sig, siglen);
		i += j;
	}
	opcode = ntohl(ep->opcode);
	ep->opcode = htonl((opcode & 0xffff0000) | len); 
	return (len);
}


/*
 * crypto_update - compute new public value and sign extension fields
 *
 * This routine runs periodically, like once a day, and when something
 * changes. It updates the timestamps on three value structures and one
 * value structure list, then signs all the structures:
 *
 * hostval	host name (not signed)
 * pubkey	public key
 * cinfo	certificate info/value list
 * tai_leap	leap values
 *
 * Filestamps are proventic data, so this routine runs only when the
 * host is synchronized to a proventicated source. Thus, the timestamp
 * is proventic and can be used to deflect clogging attacks.
 *
 * Returns void (no errors)
 */
void
crypto_update(void)
{
	EVP_MD_CTX ctx;		/* message digest context */
	struct cert_info *cp;	/* certificate info/value */
	char	statstr[NTP_MAXSTRLEN]; /* statistics for filegen */
	u_int32	*ptr;
	u_int	len;

	hostval.tstamp = htonl(crypto_time());
	if (hostval.tstamp == 0)
		return;


	/*
	 * Sign public key and timestamps. The filestamp is derived from
	 * the host key file extension from wherever the file was
	 * generated. 
	 */
	if (pubkey.vallen != 0) {
		pubkey.tstamp = hostval.tstamp;
		pubkey.siglen = 0;
		if (pubkey.sig == NULL)
			pubkey.sig = emalloc(sign_siglen);
		EVP_SignInit(&ctx, sign_digest);
		EVP_SignUpdate(&ctx, (u_char *)&pubkey, 12);
		EVP_SignUpdate(&ctx, pubkey.ptr, ntohl(pubkey.vallen));
		if (EVP_SignFinal(&ctx, pubkey.sig, &len, sign_pkey))
			pubkey.siglen = htonl(sign_siglen);
	}

	/*
	 * Sign certificates and timestamps. The filestamp is derived
	 * from the certificate file extension from wherever the file
	 * was generated. Note we do not throw expired certificates
	 * away; they may have signed younger ones.
	 */
	for (cp = cinfo; cp != NULL; cp = cp->link) {
		cp->cert.tstamp = hostval.tstamp;
		cp->cert.siglen = 0;
		if (cp->cert.sig == NULL)
			cp->cert.sig = emalloc(sign_siglen);
		EVP_SignInit(&ctx, sign_digest);
		EVP_SignUpdate(&ctx, (u_char *)&cp->cert, 12);
		EVP_SignUpdate(&ctx, cp->cert.ptr,
		    ntohl(cp->cert.vallen));
		if (EVP_SignFinal(&ctx, cp->cert.sig, &len, sign_pkey))
			cp->cert.siglen = htonl(sign_siglen);
	}

	/*
	 * Sign leapseconds values and timestamps. Note it is not an
	 * error to return null values.
	 */
	tai_leap.tstamp = hostval.tstamp;
	tai_leap.fstamp = hostval.fstamp;
	len = 3 * sizeof(u_int32);
	if (tai_leap.ptr == NULL)
		tai_leap.ptr = emalloc(len);
	tai_leap.vallen = htonl(len);
	ptr = (u_int32 *)tai_leap.ptr;
	ptr[0] = htonl(leap_tai);
	ptr[1] = htonl(leap_sec);
	ptr[2] = htonl(leap_expire);
	if (tai_leap.sig == NULL)
		tai_leap.sig = emalloc(sign_siglen);
	EVP_SignInit(&ctx, sign_digest);
	EVP_SignUpdate(&ctx, (u_char *)&tai_leap, 12);
	EVP_SignUpdate(&ctx, tai_leap.ptr, len);
	if (EVP_SignFinal(&ctx, tai_leap.sig, &len, sign_pkey))
		tai_leap.siglen = htonl(sign_siglen);
	if (leap_sec > 0)
		crypto_flags |= CRYPTO_FLAG_TAI;
	snprintf(statstr, NTP_MAXSTRLEN, "signature update ts %u",
	    ntohl(hostval.tstamp)); 
	record_crypto_stats(NULL, statstr);
#ifdef DEBUG
	if (debug)
		printf("crypto_update: %s\n", statstr);
#endif
}


/*
 * value_free - free value structure components.
 *
 * Returns void (no errors)
 */
void
value_free(
	struct value *vp	/* value structure */
	)
{
	if (vp->ptr != NULL)
		free(vp->ptr);
	if (vp->sig != NULL)
		free(vp->sig);
	memset(vp, 0, sizeof(struct value));
}


/*
 * crypto_time - returns current NTP time.
 *
 * Returns NTP seconds if in synch, 0 otherwise
 */
tstamp_t
crypto_time()
{
	l_fp	tstamp;		/* NTP time */

	L_CLR(&tstamp);
	if (sys_leap != LEAP_NOTINSYNC)
		get_systime(&tstamp);
	return (tstamp.l_ui);
}


/*
 * asn2ntp - convert ASN1_TIME time structure to NTP time.
 *
 * Returns NTP seconds (no errors)
 */
u_long
asn2ntp	(
	ASN1_TIME *asn1time	/* pointer to ASN1_TIME structure */
	)
{
	char	*v;		/* pointer to ASN1_TIME string */
	struct	tm tm;		/* used to convert to NTP time */

	/*
	 * Extract time string YYMMDDHHMMSSZ from ASN1 time structure.
	 * Note that the YY, MM, DD fields start with one, the HH, MM,
	 * SS fiels start with zero and the Z character is ignored.
	 * Also note that years less than 50 map to years greater than
	 * 100. Dontcha love ASN.1? Better than MIL-188.
	 */
	v = (char *)asn1time->data;
	tm.tm_year = (v[0] - '0') * 10 + v[1] - '0';
	if (tm.tm_year < 50)
		tm.tm_year += 100;
	tm.tm_mon = (v[2] - '0') * 10 + v[3] - '0' - 1;
	tm.tm_mday = (v[4] - '0') * 10 + v[5] - '0';
	tm.tm_hour = (v[6] - '0') * 10 + v[7] - '0';
	tm.tm_min = (v[8] - '0') * 10 + v[9] - '0';
	tm.tm_sec = (v[10] - '0') * 10 + v[11] - '0';
	tm.tm_wday = 0;
	tm.tm_yday = 0;
	tm.tm_isdst = 0;
	return ((u_long)timegm(&tm) + JAN_1970);
}


/*
 * bigdig() - compute a BIGNUM MD5 hash of a BIGNUM number.
 *
 * Returns void (no errors)
 */
static void
bighash(
	BIGNUM	*bn,		/* BIGNUM * from */
	BIGNUM	*bk		/* BIGNUM * to */
	)
{
	EVP_MD_CTX ctx;		/* message digest context */
	u_char dgst[EVP_MAX_MD_SIZE]; /* message digest */
	u_char	*ptr;		/* a BIGNUM as binary string */
	u_int	len;

	len = BN_num_bytes(bn);
	ptr = emalloc(len);
	BN_bn2bin(bn, ptr);
	EVP_DigestInit(&ctx, EVP_md5());
	EVP_DigestUpdate(&ctx, ptr, len);
	EVP_DigestFinal(&ctx, dgst, &len);
	BN_bin2bn(dgst, len, bk);
	free(ptr);
}


/*
 ***********************************************************************
 *								       *
 * The following routines implement the Schnorr (IFF) identity scheme  *
 *								       *
 ***********************************************************************
 *
 * The Schnorr (IFF) identity scheme is intended for use when
 * certificates are generated by some other trusted certificate
 * authority and the certificate cannot be used to convey public
 * parameters. There are two kinds of files: encrypted server files that
 * contain private and public values and nonencrypted client files that
 * contain only public values. New generations of server files must be
 * securely transmitted to all servers of the group; client files can be
 * distributed by any means. The scheme is self contained and
 * independent of new generations of host keys, sign keys and
 * certificates.
 *
 * The IFF values hide in a DSA cuckoo structure which uses the same
 * parameters. The values are used by an identity scheme based on DSA
 * cryptography and described in Stimson p. 285. The p is a 512-bit
 * prime, g a generator of Zp* and q a 160-bit prime that divides p - 1
 * and is a qth root of 1 mod p; that is, g^q = 1 mod p. The TA rolls a
 * private random group key b (0 < b < q) and public key v = g^b, then
 * sends (p, q, g, b) to the servers and (p, q, g, v) to the clients.
 * Alice challenges Bob to confirm identity using the protocol described
 * below.
 *
 * How it works
 *
 * The scheme goes like this. Both Alice and Bob have the public primes
 * p, q and generator g. The TA gives private key b to Bob and public
 * key v to Alice.
 *
 * Alice rolls new random challenge r (o < r < q) and sends to Bob in
 * the IFF request message. Bob rolls new random k (0 < k < q), then
 * computes y = k + b r mod q and x = g^k mod p and sends (y, hash(x))
 * to Alice in the response message. Besides making the response
 * shorter, the hash makes it effectivey impossible for an intruder to
 * solve for b by observing a number of these messages.
 * 
 * Alice receives the response and computes g^y v^r mod p. After a bit
 * of algebra, this simplifies to g^k. If the hash of this result
 * matches hash(x), Alice knows that Bob has the group key b. The signed
 * response binds this knowledge to Bob's private key and the public key
 * previously received in his certificate.
 *
 * crypto_alice - construct Alice's challenge in IFF scheme
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_ID	bad or missing group key
 * XEVNT_PUB	bad or missing public key
 */
static int
crypto_alice(
	struct peer *peer,	/* peer pointer */
	struct value *vp	/* value pointer */
	)
{
	DSA	*dsa;		/* IFF parameters */
	BN_CTX	*bctx;		/* BIGNUM context */
	EVP_MD_CTX ctx;		/* signature context */
	tstamp_t tstamp;
	u_int	len;

	/*
	 * The identity parameters must have correct format and content.
	 */
	if (peer->ident_pkey == NULL)
		return (XEVNT_ID);

	if ((dsa = peer->ident_pkey->pkey->pkey.dsa) == NULL) {
		msyslog(LOG_NOTICE, "crypto_alice: defective key");
		return (XEVNT_PUB);
	}

	/*
	 * Roll new random r (0 < r < q).
	 */
	if (peer->iffval != NULL)
		BN_free(peer->iffval);
	peer->iffval = BN_new();
	len = BN_num_bytes(dsa->q);
	BN_rand(peer->iffval, len * 8, -1, 1);	/* r mod q*/
	bctx = BN_CTX_new();
	BN_mod(peer->iffval, peer->iffval, dsa->q, bctx);
	BN_CTX_free(bctx);

	/*
	 * Sign and send to Bob. The filestamp is from the local file.
	 */
	memset(vp, 0, sizeof(struct value));
	tstamp = crypto_time();
	vp->tstamp = htonl(tstamp);
	vp->fstamp = htonl(peer->ident_pkey->fstamp);
	vp->vallen = htonl(len);
	vp->ptr = emalloc(len);
	BN_bn2bin(peer->iffval, vp->ptr);
	if (tstamp == 0)
		return (XEVNT_OK);

	vp->sig = emalloc(sign_siglen);
	EVP_SignInit(&ctx, sign_digest);
	EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
	EVP_SignUpdate(&ctx, vp->ptr, len);
	if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
		vp->siglen = htonl(sign_siglen);
	return (XEVNT_OK);
}


/*
 * crypto_bob - construct Bob's response to Alice's challenge
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_ERR	protocol error
 * XEVNT_ID	bad or missing group key
 */
static int
crypto_bob(
	struct exten *ep,	/* extension pointer */
	struct value *vp	/* value pointer */
	)
{
	DSA	*dsa;		/* IFF parameters */
	DSA_SIG	*sdsa;		/* DSA signature context fake */
	BN_CTX	*bctx;		/* BIGNUM context */
	EVP_MD_CTX ctx;		/* signature context */
	tstamp_t tstamp;	/* NTP timestamp */
	BIGNUM	*bn, *bk, *r;
	u_char	*ptr;
	u_int	len;

	/*
	 * If the IFF parameters are not valid, something awful
	 * happened or we are being tormented.
	 */
	if (iffkey_info == NULL) {
		msyslog(LOG_NOTICE, "crypto_bob: scheme unavailable");
		return (XEVNT_ID);
	}
	dsa = iffkey_info->pkey->pkey.dsa;

	/*
	 * Extract r from the challenge.
	 */
	len = ntohl(ep->vallen);
	if ((r = BN_bin2bn((u_char *)ep->pkt, len, NULL)) == NULL) {
		msyslog(LOG_ERR, "crypto_bob: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		return (XEVNT_ERR);
	}

	/*
	 * Bob rolls random k (0 < k < q), computes y = k + b r mod q
	 * and x = g^k mod p, then sends (y, hash(x)) to Alice.
	 */
	bctx = BN_CTX_new(); bk = BN_new(); bn = BN_new();
	sdsa = DSA_SIG_new();
	BN_rand(bk, len * 8, -1, 1);		/* k */
	BN_mod_mul(bn, dsa->priv_key, r, dsa->q, bctx); /* b r mod q */
	BN_add(bn, bn, bk);
	BN_mod(bn, bn, dsa->q, bctx);		/* k + b r mod q */
	sdsa->r = BN_dup(bn);
	BN_mod_exp(bk, dsa->g, bk, dsa->p, bctx); /* g^k mod p */
	bighash(bk, bk);
	sdsa->s = BN_dup(bk);
	BN_CTX_free(bctx);
	BN_free(r); BN_free(bn); BN_free(bk);
#ifdef DEBUG
	if (debug > 1)
		DSA_print_fp(stdout, dsa, 0);
#endif

	/*
	 * Encode the values in ASN.1 and sign. The filestamp is from
	 * the local file.
	 */
	len = i2d_DSA_SIG(sdsa, NULL);
	if (len == 0) {
		msyslog(LOG_ERR, "crypto_bob: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		DSA_SIG_free(sdsa);
		return (XEVNT_ERR);
	}
	memset(vp, 0, sizeof(struct value));
	tstamp = crypto_time();
	vp->tstamp = htonl(tstamp);
	vp->fstamp = htonl(iffkey_info->fstamp);
	vp->vallen = htonl(len);
	ptr = emalloc(len);
	vp->ptr = ptr;
	i2d_DSA_SIG(sdsa, &ptr);
	DSA_SIG_free(sdsa);
	if (tstamp == 0)
		return (XEVNT_OK);

	vp->sig = emalloc(sign_siglen);
	EVP_SignInit(&ctx, sign_digest);
	EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
	EVP_SignUpdate(&ctx, vp->ptr, len);
	if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
		vp->siglen = htonl(sign_siglen);
	return (XEVNT_OK);
}


/*
 * crypto_iff - verify Bob's response to Alice's challenge
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_FSP	bad filestamp
 * XEVNT_ID	bad or missing group key
 * XEVNT_PUB	bad or missing public key
 */
int
crypto_iff(
	struct exten *ep,	/* extension pointer */
	struct peer *peer	/* peer structure pointer */
	)
{
	DSA	*dsa;		/* IFF parameters */
	BN_CTX	*bctx;		/* BIGNUM context */
	DSA_SIG	*sdsa;		/* DSA parameters */
	BIGNUM	*bn, *bk;
	u_int	len;
	const u_char *ptr;
	int	temp;

	/*
	 * If the IFF parameters are not valid or no challenge was sent,
	 * something awful happened or we are being tormented.
	 */
	if (peer->ident_pkey == NULL) {
		msyslog(LOG_NOTICE, "crypto_iff: scheme unavailable");
		return (XEVNT_ID);
	}
	if (ntohl(ep->fstamp) != peer->ident_pkey->fstamp) {
		msyslog(LOG_NOTICE, "crypto_iff: invalid filestamp %u",
		    ntohl(ep->fstamp));
		return (XEVNT_FSP);
	}
	if ((dsa = peer->ident_pkey->pkey->pkey.dsa) == NULL) {
		msyslog(LOG_NOTICE, "crypto_iff: defective key");
		return (XEVNT_PUB);
	}
	if (peer->iffval == NULL) {
		msyslog(LOG_NOTICE, "crypto_iff: missing challenge");
		return (XEVNT_ID);
	}

	/*
	 * Extract the k + b r and g^k values from the response.
	 */
	bctx = BN_CTX_new(); bk = BN_new(); bn = BN_new();
	len = ntohl(ep->vallen);
	ptr = (u_char *)ep->pkt;
	if ((sdsa = d2i_DSA_SIG(NULL, &ptr, len)) == NULL) {
		BN_free(bn); BN_free(bk); BN_CTX_free(bctx);
		msyslog(LOG_ERR, "crypto_iff: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		return (XEVNT_ERR);
	}

	/*
	 * Compute g^(k + b r) g^(q - b)r mod p.
	 */
	BN_mod_exp(bn, dsa->pub_key, peer->iffval, dsa->p, bctx);
	BN_mod_exp(bk, dsa->g, sdsa->r, dsa->p, bctx);
	BN_mod_mul(bn, bn, bk, dsa->p, bctx);

	/*
	 * Verify the hash of the result matches hash(x).
	 */
	bighash(bn, bn);
	temp = BN_cmp(bn, sdsa->s);
	BN_free(bn); BN_free(bk); BN_CTX_free(bctx);
	BN_free(peer->iffval);
	peer->iffval = NULL;
	DSA_SIG_free(sdsa);
	if (temp == 0)
		return (XEVNT_OK);

	msyslog(LOG_NOTICE, "crypto_iff: identity not verified");
	return (XEVNT_ID);
}


/*
 ***********************************************************************
 *								       *
 * The following routines implement the Guillou-Quisquater (GQ)        *
 * identity scheme                                                     *
 *								       *
 ***********************************************************************
 *
 * The Guillou-Quisquater (GQ) identity scheme is intended for use when
 * the certificate can be used to convey public parameters. The scheme
 * uses a X509v3 certificate extension field do convey the public key of
 * a private key known only to servers. There are two kinds of files:
 * encrypted server files that contain private and public values and
 * nonencrypted client files that contain only public values. New
 * generations of server files must be securely transmitted to all
 * servers of the group; client files can be distributed by any means.
 * The scheme is self contained and independent of new generations of
 * host keys and sign keys. The scheme is self contained and independent
 * of new generations of host keys and sign keys.
 *
 * The GQ parameters hide in a RSA cuckoo structure which uses the same
 * parameters. The values are used by an identity scheme based on RSA
 * cryptography and described in Stimson p. 300 (with errors). The 512-
 * bit public modulus is n = p q, where p and q are secret large primes.
 * The TA rolls private random group key b as RSA exponent. These values
 * are known to all group members.
 *
 * When rolling new certificates, a server recomputes the private and
 * public keys. The private key u is a random roll, while the public key
 * is the inverse obscured by the group key v = (u^-1)^b. These values
 * replace the private and public keys normally generated by the RSA
 * scheme. Alice challenges Bob to confirm identity using the protocol
 * described below.
 *
 * How it works
 *
 * The scheme goes like this. Both Alice and Bob have the same modulus n
 * and some random b as the group key. These values are computed and
 * distributed in advance via secret means, although only the group key
 * b is truly secret. Each has a private random private key u and public
 * key (u^-1)^b, although not necessarily the same ones. Bob and Alice
 * can regenerate the key pair from time to time without affecting
 * operations. The public key is conveyed on the certificate in an
 * extension field; the private key is never revealed.
 *
 * Alice rolls new random challenge r and sends to Bob in the GQ
 * request message. Bob rolls new random k, then computes y = k u^r mod
 * n and x = k^b mod n and sends (y, hash(x)) to Alice in the response
 * message. Besides making the response shorter, the hash makes it
 * effectivey impossible for an intruder to solve for b by observing
 * a number of these messages.
 * 
 * Alice receives the response and computes y^b v^r mod n. After a bit
 * of algebra, this simplifies to k^b. If the hash of this result
 * matches hash(x), Alice knows that Bob has the group key b. The signed
 * response binds this knowledge to Bob's private key and the public key
 * previously received in his certificate.
 *
 * crypto_alice2 - construct Alice's challenge in GQ scheme
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_ID	bad or missing group key
 * XEVNT_PUB	bad or missing public key
 */
static int
crypto_alice2(
	struct peer *peer,	/* peer pointer */
	struct value *vp	/* value pointer */
	)
{
	RSA	*rsa;		/* GQ parameters */
	BN_CTX	*bctx;		/* BIGNUM context */
	EVP_MD_CTX ctx;		/* signature context */
	tstamp_t tstamp;
	u_int	len;

	/*
	 * The identity parameters must have correct format and content.
	 */
	if (peer->ident_pkey == NULL)
		return (XEVNT_ID);

	if ((rsa = peer->ident_pkey->pkey->pkey.rsa) == NULL) {
		msyslog(LOG_NOTICE, "crypto_alice2: defective key");
		return (XEVNT_PUB);
	}

	/*
	 * Roll new random r (0 < r < n).
	 */
	if (peer->iffval != NULL)
		BN_free(peer->iffval);
	peer->iffval = BN_new();
	len = BN_num_bytes(rsa->n);
	BN_rand(peer->iffval, len * 8, -1, 1);	/* r mod n */
	bctx = BN_CTX_new();
	BN_mod(peer->iffval, peer->iffval, rsa->n, bctx);
	BN_CTX_free(bctx);

	/*
	 * Sign and send to Bob. The filestamp is from the local file.
	 */
	memset(vp, 0, sizeof(struct value));
	tstamp = crypto_time();
	vp->tstamp = htonl(tstamp);
	vp->fstamp = htonl(peer->ident_pkey->fstamp);
	vp->vallen = htonl(len);
	vp->ptr = emalloc(len);
	BN_bn2bin(peer->iffval, vp->ptr);
	if (tstamp == 0)
		return (XEVNT_OK);

	vp->sig = emalloc(sign_siglen);
	EVP_SignInit(&ctx, sign_digest);
	EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
	EVP_SignUpdate(&ctx, vp->ptr, len);
	if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
		vp->siglen = htonl(sign_siglen);
	return (XEVNT_OK);
}


/*
 * crypto_bob2 - construct Bob's response to Alice's challenge
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_ERR	protocol error
 * XEVNT_ID	bad or missing group key
 */
static int
crypto_bob2(
	struct exten *ep,	/* extension pointer */
	struct value *vp	/* value pointer */
	)
{
	RSA	*rsa;		/* GQ parameters */
	DSA_SIG	*sdsa;		/* DSA parameters */
	BN_CTX	*bctx;		/* BIGNUM context */
	EVP_MD_CTX ctx;		/* signature context */
	tstamp_t tstamp;	/* NTP timestamp */
	BIGNUM	*r, *k, *g, *y;
	u_char	*ptr;
	u_int	len;

	/*
	 * If the GQ parameters are not valid, something awful
	 * happened or we are being tormented.
	 */
	if (gqkey_info == NULL) {
		msyslog(LOG_NOTICE, "crypto_bob2: scheme unavailable");
		return (XEVNT_ID);
	}
	rsa = gqkey_info->pkey->pkey.rsa;

	/*
	 * Extract r from the challenge.
	 */
	len = ntohl(ep->vallen);
	if ((r = BN_bin2bn((u_char *)ep->pkt, len, NULL)) == NULL) {
		msyslog(LOG_ERR, "crypto_bob2: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		return (XEVNT_ERR);
	}

	/*
	 * Bob rolls random k (0 < k < n), computes y = k u^r mod n and
	 * x = k^b mod n, then sends (y, hash(x)) to Alice. 
	 */
	bctx = BN_CTX_new(); k = BN_new(); g = BN_new(); y = BN_new();
	sdsa = DSA_SIG_new();
	BN_rand(k, len * 8, -1, 1);		/* k */
	BN_mod(k, k, rsa->n, bctx);
	BN_mod_exp(y, rsa->p, r, rsa->n, bctx); /* u^r mod n */
	BN_mod_mul(y, k, y, rsa->n, bctx);	/* k u^r mod n */
	sdsa->r = BN_dup(y);
	BN_mod_exp(g, k, rsa->e, rsa->n, bctx); /* k^b mod n */
	bighash(g, g);
	sdsa->s = BN_dup(g);
	BN_CTX_free(bctx);
	BN_free(r); BN_free(k); BN_free(g); BN_free(y);
#ifdef DEBUG
	if (debug > 1)
		RSA_print_fp(stdout, rsa, 0);
#endif
 
	/*
	 * Encode the values in ASN.1 and sign. The filestamp is from
	 * the local file.
	 */
	len = i2d_DSA_SIG(sdsa, NULL);
	if (len <= 0) {
		msyslog(LOG_ERR, "crypto_bob2: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		DSA_SIG_free(sdsa);
		return (XEVNT_ERR);
	}
	memset(vp, 0, sizeof(struct value));
	tstamp = crypto_time();
	vp->tstamp = htonl(tstamp);
	vp->fstamp = htonl(gqkey_info->fstamp);
	vp->vallen = htonl(len);
	ptr = emalloc(len);
	vp->ptr = ptr;
	i2d_DSA_SIG(sdsa, &ptr);
	DSA_SIG_free(sdsa);
	if (tstamp == 0)
		return (XEVNT_OK);

	vp->sig = emalloc(sign_siglen);
	EVP_SignInit(&ctx, sign_digest);
	EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
	EVP_SignUpdate(&ctx, vp->ptr, len);
	if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
		vp->siglen = htonl(sign_siglen);
	return (XEVNT_OK);
}


/*
 * crypto_gq - verify Bob's response to Alice's challenge
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_ERR	protocol error
 * XEVNT_FSP	bad filestamp
 * XEVNT_ID	bad or missing group keys
 * XEVNT_PUB	bad or missing public key
 */
int
crypto_gq(
	struct exten *ep,	/* extension pointer */
	struct peer *peer	/* peer structure pointer */
	)
{
	RSA	*rsa;		/* GQ parameters */
	BN_CTX	*bctx;		/* BIGNUM context */
	DSA_SIG	*sdsa;		/* RSA signature context fake */
	BIGNUM	*y, *v;
	const u_char *ptr;
	long	len;
	u_int	temp;

	/*
	 * If the GQ parameters are not valid or no challenge was sent,
	 * something awful happened or we are being tormented. Note that
	 * the filestamp on the local key file can be greater than on
	 * the remote parameter file if the keys have been refreshed.
	 */
	if (peer->ident_pkey == NULL) {
		msyslog(LOG_NOTICE, "crypto_gq: scheme unavailable");
		return (XEVNT_ID);
	}
	if (ntohl(ep->fstamp) < peer->ident_pkey->fstamp) {
		msyslog(LOG_NOTICE, "crypto_gq: invalid filestamp %u",
		    ntohl(ep->fstamp));
		return (XEVNT_FSP);
	}
	if ((rsa = peer->ident_pkey->pkey->pkey.rsa) == NULL) {
		msyslog(LOG_NOTICE, "crypto_gq: defective key");
		return (XEVNT_PUB);
	}
	if (peer->iffval == NULL) {
		msyslog(LOG_NOTICE, "crypto_gq: missing challenge");
		return (XEVNT_ID);
	}

	/*
	 * Extract the y = k u^r and hash(x = k^b) values from the
	 * response.
	 */
	bctx = BN_CTX_new(); y = BN_new(); v = BN_new();
	len = ntohl(ep->vallen);
	ptr = (u_char *)ep->pkt;
	if ((sdsa = d2i_DSA_SIG(NULL, &ptr, len)) == NULL) {
		BN_CTX_free(bctx); BN_free(y); BN_free(v);
		msyslog(LOG_ERR, "crypto_gq: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		return (XEVNT_ERR);
	}

	/*
	 * Compute v^r y^b mod n.
	 */
	if (peer->grpkey == NULL) {
		msyslog(LOG_NOTICE, "crypto_gq: missing group key");
		return (XEVNT_ID);
	}
	BN_mod_exp(v, peer->grpkey, peer->iffval, rsa->n, bctx);
						/* v^r mod n */
	BN_mod_exp(y, sdsa->r, rsa->e, rsa->n, bctx); /* y^b mod n */
	BN_mod_mul(y, v, y, rsa->n, bctx);	/* v^r y^b mod n */

	/*
	 * Verify the hash of the result matches hash(x).
	 */
	bighash(y, y);
	temp = BN_cmp(y, sdsa->s);
	BN_CTX_free(bctx); BN_free(y); BN_free(v);
	BN_free(peer->iffval);
	peer->iffval = NULL;
	DSA_SIG_free(sdsa);
	if (temp == 0)
		return (XEVNT_OK);

	msyslog(LOG_NOTICE, "crypto_gq: identity not verified");
	return (XEVNT_ID);
}


/*
 ***********************************************************************
 *								       *
 * The following routines implement the Mu-Varadharajan (MV) identity  *
 * scheme                                                              *
 *								       *
 ***********************************************************************
 *
 * The Mu-Varadharajan (MV) cryptosystem was originally intended when
 * servers broadcast messages to clients, but clients never send
 * messages to servers. There is one encryption key for the server and a
 * separate decryption key for each client. It operated something like a
 * pay-per-view satellite broadcasting system where the session key is
 * encrypted by the broadcaster and the decryption keys are held in a
 * tamperproof set-top box.
 *
 * The MV parameters and private encryption key hide in a DSA cuckoo
 * structure which uses the same parameters, but generated in a
 * different way. The values are used in an encryption scheme similar to
 * El Gamal cryptography and a polynomial formed from the expansion of
 * product terms (x - x[j]), as described in Mu, Y., and V.
 * Varadharajan: Robust and Secure Broadcasting, Proc. Indocrypt 2001,
 * 223-231. The paper has significant errors and serious omissions.
 *
 * Let q be the product of n distinct primes s1[j] (j = 1...n), where
 * each s1[j] has m significant bits. Let p be a prime p = 2 * q + 1, so
 * that q and each s1[j] divide p - 1 and p has M = n * m + 1
 * significant bits. Let g be a generator of Zp; that is, gcd(g, p - 1)
 * = 1 and g^q = 1 mod p. We do modular arithmetic over Zq and then
 * project into Zp* as exponents of g. Sometimes we have to compute an
 * inverse b^-1 of random b in Zq, but for that purpose we require
 * gcd(b, q) = 1. We expect M to be in the 500-bit range and n
 * relatively small, like 30. These are the parameters of the scheme and
 * they are expensive to compute.
 *
 * We set up an instance of the scheme as follows. A set of random
 * values x[j] mod q (j = 1...n), are generated as the zeros of a
 * polynomial of order n. The product terms (x - x[j]) are expanded to
 * form coefficients a[i] mod q (i = 0...n) in powers of x. These are
 * used as exponents of the generator g mod p to generate the private
 * encryption key A. The pair (gbar, ghat) of public server keys and the
 * pairs (xbar[j], xhat[j]) (j = 1...n) of private client keys are used
 * to construct the decryption keys. The devil is in the details.
 *
 * This routine generates a private server encryption file including the
 * private encryption key E and partial decryption keys gbar and ghat.
 * It then generates public client decryption files including the public
 * keys xbar[j] and xhat[j] for each client j. The partial decryption
 * files are used to compute the inverse of E. These values are suitably
 * blinded so secrets are not revealed.
 *
 * The distinguishing characteristic of this scheme is the capability to
 * revoke keys. Included in the calculation of E, gbar and ghat is the
 * product s = prod(s1[j]) (j = 1...n) above. If the factor s1[j] is
 * subsequently removed from the product and E, gbar and ghat
 * recomputed, the jth client will no longer be able to compute E^-1 and
 * thus unable to decrypt the messageblock.
 *
 * How it works
 *
 * The scheme goes like this. Bob has the server values (p, E, q, gbar,
 * ghat) and Alice has the client values (p, xbar, xhat).
 *
 * Alice rolls new random nonce r mod p and sends to Bob in the MV
 * request message. Bob rolls random nonce k mod q, encrypts y = r E^k
 * mod p and sends (y, gbar^k, ghat^k) to Alice.
 * 
 * Alice receives the response and computes the inverse (E^k)^-1 from
 * the partial decryption keys gbar^k, ghat^k, xbar and xhat. She then
 * decrypts y and verifies it matches the original r. The signed
 * response binds this knowledge to Bob's private key and the public key
 * previously received in his certificate.
 *
 * crypto_alice3 - construct Alice's challenge in MV scheme
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_ID	bad or missing group key
 * XEVNT_PUB	bad or missing public key
 */
static int
crypto_alice3(
	struct peer *peer,	/* peer pointer */
	struct value *vp	/* value pointer */
	)
{
	DSA	*dsa;		/* MV parameters */
	BN_CTX	*bctx;		/* BIGNUM context */
	EVP_MD_CTX ctx;		/* signature context */
	tstamp_t tstamp;
	u_int	len;

	/*
	 * The identity parameters must have correct format and content.
	 */
	if (peer->ident_pkey == NULL)
		return (XEVNT_ID);

	if ((dsa = peer->ident_pkey->pkey->pkey.dsa) == NULL) {
		msyslog(LOG_NOTICE, "crypto_alice3: defective key");
		return (XEVNT_PUB);
	}

	/*
	 * Roll new random r (0 < r < q).
	 */
	if (peer->iffval != NULL)
		BN_free(peer->iffval);
	peer->iffval = BN_new();
	len = BN_num_bytes(dsa->p);
	BN_rand(peer->iffval, len * 8, -1, 1);	/* r mod p */
	bctx = BN_CTX_new();
	BN_mod(peer->iffval, peer->iffval, dsa->p, bctx);
	BN_CTX_free(bctx);

	/*
	 * Sign and send to Bob. The filestamp is from the local file.
	 */
	memset(vp, 0, sizeof(struct value));
	tstamp = crypto_time();
	vp->tstamp = htonl(tstamp);
	vp->fstamp = htonl(peer->ident_pkey->fstamp);
	vp->vallen = htonl(len);
	vp->ptr = emalloc(len);
	BN_bn2bin(peer->iffval, vp->ptr);
	if (tstamp == 0)
		return (XEVNT_OK);

	vp->sig = emalloc(sign_siglen);
	EVP_SignInit(&ctx, sign_digest);
	EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
	EVP_SignUpdate(&ctx, vp->ptr, len);
	if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
		vp->siglen = htonl(sign_siglen);
	return (XEVNT_OK);
}


/*
 * crypto_bob3 - construct Bob's response to Alice's challenge
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_ERR	protocol error
 */
static int
crypto_bob3(
	struct exten *ep,	/* extension pointer */
	struct value *vp	/* value pointer */
	)
{
	DSA	*dsa;		/* MV parameters */
	DSA	*sdsa;		/* DSA signature context fake */
	BN_CTX	*bctx;		/* BIGNUM context */
	EVP_MD_CTX ctx;		/* signature context */
	tstamp_t tstamp;	/* NTP timestamp */
	BIGNUM	*r, *k, *u;
	u_char	*ptr;
	u_int	len;

	/*
	 * If the MV parameters are not valid, something awful
	 * happened or we are being tormented.
	 */
	if (mvkey_info == NULL) {
		msyslog(LOG_NOTICE, "crypto_bob3: scheme unavailable");
		return (XEVNT_ID);
	}
	dsa = mvkey_info->pkey->pkey.dsa;

	/*
	 * Extract r from the challenge.
	 */
	len = ntohl(ep->vallen);
	if ((r = BN_bin2bn((u_char *)ep->pkt, len, NULL)) == NULL) {
		msyslog(LOG_ERR, "crypto_bob3: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		return (XEVNT_ERR);
	}

	/*
	 * Bob rolls random k (0 < k < q), making sure it is not a
	 * factor of q. He then computes y = r A^k and sends (y, gbar^k,
	 * and ghat^k) to Alice.
	 */
	bctx = BN_CTX_new(); k = BN_new(); u = BN_new();
	sdsa = DSA_new();
	sdsa->p = BN_new(); sdsa->q = BN_new(); sdsa->g = BN_new();
	while (1) {
		BN_rand(k, BN_num_bits(dsa->q), 0, 0);
		BN_mod(k, k, dsa->q, bctx);
		BN_gcd(u, k, dsa->q, bctx);
		if (BN_is_one(u))
			break;
	}
	BN_mod_exp(u, dsa->g, k, dsa->p, bctx); /* A^k r */
	BN_mod_mul(sdsa->p, u, r, dsa->p, bctx);
	BN_mod_exp(sdsa->q, dsa->priv_key, k, dsa->p, bctx); /* gbar */
	BN_mod_exp(sdsa->g, dsa->pub_key, k, dsa->p, bctx); /* ghat */
	BN_CTX_free(bctx); BN_free(k); BN_free(r); BN_free(u);
#ifdef DEBUG
	if (debug > 1)
		DSA_print_fp(stdout, sdsa, 0);
#endif

	/*
	 * Encode the values in ASN.1 and sign. The filestamp is from
	 * the local file.
	 */
	memset(vp, 0, sizeof(struct value));
	tstamp = crypto_time();
	vp->tstamp = htonl(tstamp);
	vp->fstamp = htonl(mvkey_info->fstamp);
	len = i2d_DSAparams(sdsa, NULL);
	if (len == 0) {
		msyslog(LOG_ERR, "crypto_bob3: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		DSA_free(sdsa);
		return (XEVNT_ERR);
	}
	vp->vallen = htonl(len);
	ptr = emalloc(len);
	vp->ptr = ptr;
	i2d_DSAparams(sdsa, &ptr);
	DSA_free(sdsa);
	if (tstamp == 0)
		return (XEVNT_OK);

	vp->sig = emalloc(sign_siglen);
	EVP_SignInit(&ctx, sign_digest);
	EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
	EVP_SignUpdate(&ctx, vp->ptr, len);
	if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
		vp->siglen = htonl(sign_siglen);
	return (XEVNT_OK);
}


/*
 * crypto_mv - verify Bob's response to Alice's challenge
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_ERR	protocol error
 * XEVNT_FSP	bad filestamp
 * XEVNT_ID	bad or missing group key
 * XEVNT_PUB	bad or missing public key
 */
int
crypto_mv(
	struct exten *ep,	/* extension pointer */
	struct peer *peer	/* peer structure pointer */
	)
{
	DSA	*dsa;		/* MV parameters */
	DSA	*sdsa;		/* DSA parameters */
	BN_CTX	*bctx;		/* BIGNUM context */
	BIGNUM	*k, *u, *v;
	u_int	len;
	const u_char *ptr;
	int	temp;

	/*
	 * If the MV parameters are not valid or no challenge was sent,
	 * something awful happened or we are being tormented.
	 */
	if (peer->ident_pkey == NULL) {
		msyslog(LOG_NOTICE, "crypto_mv: scheme unavailable");
		return (XEVNT_ID);
	}
	if (ntohl(ep->fstamp) != peer->ident_pkey->fstamp) {
		msyslog(LOG_NOTICE, "crypto_mv: invalid filestamp %u",
		    ntohl(ep->fstamp));
		return (XEVNT_FSP);
	}
	if ((dsa = peer->ident_pkey->pkey->pkey.dsa) == NULL) {
		msyslog(LOG_NOTICE, "crypto_mv: defective key");
		return (XEVNT_PUB);
	}
	if (peer->iffval == NULL) {
		msyslog(LOG_NOTICE, "crypto_mv: missing challenge");
		return (XEVNT_ID);
	}

	/*
	 * Extract the y, gbar and ghat values from the response.
	 */
	bctx = BN_CTX_new(); k = BN_new(); u = BN_new(); v = BN_new();
	len = ntohl(ep->vallen);
	ptr = (u_char *)ep->pkt;
	if ((sdsa = d2i_DSAparams(NULL, &ptr, len)) == NULL) {
		msyslog(LOG_ERR, "crypto_mv: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		return (XEVNT_ERR);
	}

	/*
	 * Compute (gbar^xhat ghat^xbar) mod p.
	 */
	BN_mod_exp(u, sdsa->q, dsa->pub_key, dsa->p, bctx);
	BN_mod_exp(v, sdsa->g, dsa->priv_key, dsa->p, bctx);
	BN_mod_mul(u, u, v, dsa->p, bctx);
	BN_mod_mul(u, u, sdsa->p, dsa->p, bctx);

	/*
	 * The result should match r.
	 */
	temp = BN_cmp(u, peer->iffval);
	BN_CTX_free(bctx); BN_free(k); BN_free(u); BN_free(v);
	BN_free(peer->iffval);
	peer->iffval = NULL;
	DSA_free(sdsa);
	if (temp == 0)
		return (XEVNT_OK);

	msyslog(LOG_NOTICE, "crypto_mv: identity not verified");
	return (XEVNT_ID);
}


/*
 ***********************************************************************
 *								       *
 * The following routines are used to manipulate certificates          *
 *								       *
 ***********************************************************************
 */
/*
 * cert_sign - sign x509 certificate equest and update value structure.
 *
 * The certificate request includes a copy of the host certificate,
 * which includes the version number, subject name and public key of the
 * host. The resulting certificate includes these values plus the
 * serial number, issuer name and valid interval of the server. The
 * valid interval extends from the current time to the same time one
 * year hence. This may extend the life of the signed certificate beyond
 * that of the signer certificate.
 *
 * It is convenient to use the NTP seconds of the current time as the
 * serial number. In the value structure the timestamp is the current
 * time and the filestamp is taken from the extension field. Note this
 * routine is called only when the client clock is synchronized to a
 * proventic source, so timestamp comparisons are valid.
 *
 * The host certificate is valid from the time it was generated for a
 * period of one year. A signed certificate is valid from the time of
 * signature for a period of one year, but only the host certificate (or
 * sign certificate if used) is actually used to encrypt and decrypt
 * signatures. The signature trail is built from the client via the
 * intermediate servers to the trusted server. Each signature on the
 * trail must be valid at the time of signature, but it could happen
 * that a signer certificate expire before the signed certificate, which
 * remains valid until its expiration. 
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_CRT	bad or missing certificate
 * XEVNT_PER	host certificate expired
 * XEVNT_PUB	bad or missing public key
 * XEVNT_VFY	certificate not verified
 */
static int
cert_sign(
	struct exten *ep,	/* extension field pointer */
	struct value *vp	/* value pointer */
	)
{
	X509	*req;		/* X509 certificate request */
	X509	*cert;		/* X509 certificate */
	X509_EXTENSION *ext;	/* certificate extension */
	ASN1_INTEGER *serial;	/* serial number */
	X509_NAME *subj;	/* distinguished (common) name */
	EVP_PKEY *pkey;		/* public key */
	EVP_MD_CTX ctx;		/* message digest context */
	tstamp_t tstamp;	/* NTP timestamp */
	u_int	len;
	u_char	*ptr;
	int	i, temp;

	/*
	 * Decode ASN.1 objects and construct certificate structure.
	 * Make sure the system clock is synchronized to a proventic
	 * source.
	 */
	tstamp = crypto_time();
	if (tstamp == 0)
		return (XEVNT_TSP);

	ptr = (u_char *)ep->pkt;
	if ((req = d2i_X509(NULL, &ptr, ntohl(ep->vallen))) == NULL) {
		msyslog(LOG_ERR, "cert_sign: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		return (XEVNT_CRT);
	}
	/*
	 * Extract public key and check for errors.
	 */
	if ((pkey = X509_get_pubkey(req)) == NULL) {
		msyslog(LOG_ERR, "cert_sign: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		X509_free(req);
		return (XEVNT_PUB);
	}

	/*
	 * Generate X509 certificate signed by this server. If this is a
	 * trusted host, the issuer name is the group name; otherwise,
	 * it is the host name. Also copy any extensions that might be
	 * present.
	 */
	cert = X509_new();
	X509_set_version(cert, X509_get_version(req));
	serial = ASN1_INTEGER_new();
	ASN1_INTEGER_set(serial, tstamp);
	X509_set_serialNumber(cert, serial);
	X509_gmtime_adj(X509_get_notBefore(cert), 0L);
	X509_gmtime_adj(X509_get_notAfter(cert), YEAR);
	subj = X509_get_issuer_name(cert);
	X509_NAME_add_entry_by_txt(subj, "commonName", MBSTRING_ASC,
	    hostval.ptr, strlen(hostval.ptr), -1, 0);
	subj = X509_get_subject_name(req);
	X509_set_subject_name(cert, subj);
	X509_set_pubkey(cert, pkey);
	ext = X509_get_ext(req, 0);
	temp = X509_get_ext_count(req);
	for (i = 0; i < temp; i++) {
		ext = X509_get_ext(req, i);
		X509_add_ext(cert, ext, -1);
	}
	X509_free(req);

	/*
	 * Sign and verify the client certificate, but only if the host
	 * certificate has not expired.
	 */
	if (tstamp < cert_host->first || tstamp > cert_host->last) {
		X509_free(cert);
		return (XEVNT_PER);
	}
	X509_sign(cert, sign_pkey, sign_digest);
	if (X509_verify(cert, sign_pkey) <= 0) {
		msyslog(LOG_ERR, "cert_sign: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		X509_free(cert);
		return (XEVNT_VFY);
	}
	len = i2d_X509(cert, NULL);

	/*
	 * Build and sign the value structure. We have to sign it here,
	 * since the response has to be returned right away. This is a
	 * clogging hazard.
	 */
	memset(vp, 0, sizeof(struct value));
	vp->tstamp = htonl(tstamp);
	vp->fstamp = ep->fstamp;
	vp->vallen = htonl(len);
	vp->ptr = emalloc(len);
	ptr = vp->ptr;
	i2d_X509(cert, &ptr);
	vp->siglen = 0;
	if (tstamp != 0) {
		vp->sig = emalloc(sign_siglen);
		EVP_SignInit(&ctx, sign_digest);
		EVP_SignUpdate(&ctx, (u_char *)vp, 12);
		EVP_SignUpdate(&ctx, vp->ptr, len);
		if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
			vp->siglen = htonl(sign_siglen);
	}
#ifdef DEBUG
	if (debug > 1)
		X509_print_fp(stdout, cert);
#endif
	X509_free(cert);
	return (XEVNT_OK);
}


/*
 * cert_install - install certificate in certificate cache
 *
 * This routine encodes an extension field into a certificate info/value
 * structure. It searches the certificate list for duplicates and
 * expunges whichever is older. Finally, it inserts this certificate
 * first on the list.
 *
 * Returns certificate info pointer if valid, NULL if not.
 */
struct cert_info *
cert_install(
	struct exten *ep,	/* cert info/value */
	struct peer *peer	/* peer structure */
	)
{
	struct cert_info *cp, *xp, **zp;

	/*
	 * Parse and validate the signed certificate. If valid,
	 * construct the info/value structure; otherwise, scamper home
	 * empty handed.
	 */
	if ((cp = cert_parse((u_char *)ep->pkt, (long)ntohl(ep->vallen),
	    (tstamp_t)ntohl(ep->fstamp))) == NULL)
		return (NULL);

	/*
	 * Scan certificate list looking for another certificate with
	 * the same subject and issuer. If another is found with the
	 * same or older filestamp, unlink it and return the goodies to
	 * the heap. If another is found with a later filestamp, discard
	 * the new one and leave the building with the old one.
	 *
	 * Make a note to study this issue again. An earlier certificate
	 * with a long lifetime might be overtaken by a later
	 * certificate with a short lifetime, thus invalidating the
	 * earlier signature. However, we gotta find a way to leak old
	 * stuff from the cache, so we do it anyway. 
	 */
	zp = &cinfo;
	for (xp = cinfo; xp != NULL; xp = xp->link) {
		if (strcmp(cp->subject, xp->subject) == 0 &&
		    strcmp(cp->issuer, xp->issuer) == 0) {
			if (ntohl(cp->cert.fstamp) <=
			    ntohl(xp->cert.fstamp)) {
				cert_free(cp);
				cp = xp;
			} else {
				*zp = xp->link;
				cert_free(xp);
				xp = NULL;
			}
			break;
		}
		zp = &xp->link;
	}
	if (xp == NULL) {
		cp->link = cinfo;
		cinfo = cp;
	}
	cp->flags |= CERT_VALID;
	crypto_update();
	return (cp);
}


/*
 * cert_hike - verify the signature using the issuer public key
 *
 * Returns
 * XEVNT_OK	success
 * XEVNT_CRT	bad or missing certificate
 * XEVNT_PER	host certificate expired
 * XEVNT_VFY	certificate not verified
 */
int
cert_hike(
	struct peer *peer,	/* peer structure pointer */
	struct cert_info *yp	/* issuer certificate */
	)
{
	struct cert_info *xp;	/* subject certificate */
	X509	*cert;		/* X509 certificate */
	u_char	*ptr;

	/*
	 * Save the issuer on the new certificate, but remember the old
	 * one.
	 */
	if (peer->issuer != NULL)
		free(peer->issuer);
	peer->issuer = emalloc(strlen(yp->issuer) + 1);
	strcpy(peer->issuer, yp->issuer);
	xp = peer->xinfo;
	peer->xinfo = yp;

	/*
	 * If subject Y matches issuer Y, then the certificate trail is
	 * complete. If Y is not trusted, the server certificate has yet
	 * been signed, so keep trying. Otherwise, save the group key
	 * and light the valid bit. If the host certificate is trusted,
	 * do not execute a sign exchange. If no identity scheme is in
	 * use, light the identity and proventic bits.
	 */
	if (strcmp(yp->subject, yp->issuer) == 0) {
		if (!(yp->flags & CERT_TRUST))
			return (XEVNT_OK);

		peer->grpkey = yp->grpkey;
		peer->crypto |= CRYPTO_FLAG_CERT;
		if (!(peer->crypto & CRYPTO_FLAG_MASK))
			peer->crypto |= CRYPTO_FLAG_VRFY |
			    CRYPTO_FLAG_PROV;

		/*
		 * If the server has an an identity scheme, fetch the
		 * identity credentials. If not, the identity is
		 * verified only by the trusted certificate. The next
		 * signature will set the server proventic.
		 */
		if (!(peer->crypto & CRYPTO_FLAG_MASK) ||
		    sys_groupname == NULL)
			peer->crypto |= CRYPTO_FLAG_VRFY;
	}

	/*
	 * If X exists, verify signature X using public key Y.
	 */
	if (xp == NULL)
		return (XEVNT_OK);

	ptr = (u_char *)xp->cert.ptr;
	cert = d2i_X509(NULL, &ptr, ntohl(xp->cert.vallen));
	if (cert == NULL) {
		xp->flags |= CERT_ERROR;
		return (XEVNT_CRT);
	}
	if (X509_verify(cert, yp->pkey) <= 0) {
		X509_free(cert);
		xp->flags |= CERT_ERROR;
		return (XEVNT_VFY);
	}
	X509_free(cert);

	/*
	 * Signature X is valid only if it begins during the
	 * lifetime of Y. 
	 */
	if (xp->first < yp->first || xp->first > yp->last) {
		xp->flags |= CERT_ERROR;
		return (XEVNT_PER);
	}
	xp->flags |= CERT_SIGN;
	return (XEVNT_OK);
}


/*
 * cert_parse - parse x509 certificate and create info/value structures.
 *
 * The server certificate includes the version number, issuer name,
 * subject name, public key and valid date interval. If the issuer name
 * is the same as the subject name, the certificate is self signed and
 * valid only if the server is configured as trustable. If the names are
 * different, another issuer has signed the server certificate and
 * vouched for it. In this case the server certificate is valid if
 * verified by the issuer public key.
 *
 * Returns certificate info/value pointer if valid, NULL if not.
 */
struct cert_info *		/* certificate information structure */
cert_parse(
	u_char	*asn1cert,	/* X509 certificate */
	long	len,		/* certificate length */
	tstamp_t fstamp		/* filestamp */
	)
{
	X509	*cert;		/* X509 certificate */
	X509_EXTENSION *ext;	/* X509v3 extension */
	struct cert_info *ret;	/* certificate info/value */
	BIO	*bp;
	char	pathbuf[MAXFILENAME];
	u_char	*ptr;
	int	temp, cnt, i;

	/*
	 * Decode ASN.1 objects and construct certificate structure.
	 */
	ptr = asn1cert;
	if ((cert = d2i_X509(NULL, &ptr, len)) == NULL) {
		msyslog(LOG_ERR, "cert_parse: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		return (NULL);
	}
#ifdef DEBUG
	if (debug > 1)
		X509_print_fp(stdout, cert);
#endif

	/*
	 * Extract version, subject name and public key.
	 */
	ret = emalloc(sizeof(struct cert_info));
	memset(ret, 0, sizeof(struct cert_info));
	if ((ret->pkey = X509_get_pubkey(cert)) == NULL) {
		msyslog(LOG_ERR, "cert_parse: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		cert_free(ret);
		X509_free(cert);
		return (NULL);
	}
	ret->version = X509_get_version(cert);
	X509_NAME_oneline(X509_get_subject_name(cert), pathbuf,
	    MAXFILENAME);
	ptr = strstr(pathbuf, "CN=");
	if (ptr == NULL) {
		msyslog(LOG_NOTICE, "cert_parse: invalid subject %s",
		    pathbuf);
		cert_free(ret);
		X509_free(cert);
		return (NULL);
	}
	ret->subject = estrdup(ptr + 3);

	/*
	 * Extract remaining objects. Note that the NTP serial number is
	 * the NTP seconds at the time of signing, but this might not be
	 * the case for other authority. We don't bother to check the
	 * objects at this time, since the real crunch can happen only
	 * when the time is valid but not yet certificated.
	 */
	ret->nid = OBJ_obj2nid(cert->cert_info->signature->algorithm);
	ret->digest = (const EVP_MD *)EVP_get_digestbynid(ret->nid);
	ret->serial =
	    (u_long)ASN1_INTEGER_get(X509_get_serialNumber(cert));
	X509_NAME_oneline(X509_get_issuer_name(cert), pathbuf,
	    MAXFILENAME);
	if ((ptr = strstr(pathbuf, "CN=")) == NULL) {
		msyslog(LOG_NOTICE, "cert_parse: invalid issuer %s",
		    pathbuf);
		cert_free(ret);
		X509_free(cert);
		return (NULL);
	}
	ret->issuer = estrdup(ptr + 3);
	ret->first = asn2ntp(X509_get_notBefore(cert));
	ret->last = asn2ntp(X509_get_notAfter(cert));

	/*
	 * Extract extension fields. These are ad hoc ripoffs of
	 * currently assigned functions and will certainly be changed
	 * before prime time.
	 */
	cnt = X509_get_ext_count(cert);
	for (i = 0; i < cnt; i++) {
		ext = X509_get_ext(cert, i);
		temp = OBJ_obj2nid(ext->object);
		switch (temp) {

		/*
		 * If a key_usage field is present, we decode whether
		 * this is a trusted or private certificate. This is
		 * dorky; all we want is to compare NIDs, but OpenSSL
		 * insists on BIO text strings.
		 */
		case NID_ext_key_usage:
			bp = BIO_new(BIO_s_mem());
			X509V3_EXT_print(bp, ext, 0, 0);
			BIO_gets(bp, pathbuf, MAXFILENAME);
			BIO_free(bp);
			if (strcmp(pathbuf, "Trust Root") == 0)
				ret->flags |= CERT_TRUST;
			else if (strcmp(pathbuf, "Private") == 0)
				ret->flags |= CERT_PRIV;
#if DEBUG
			if (debug)
				printf("cert_parse: %s: %s\n",
				    OBJ_nid2ln(temp), pathbuf);
#endif
			break;

		/*
		 * If a NID_subject_key_identifier field is present, it
		 * contains the GQ public key.
		 */
		case NID_subject_key_identifier:
			ret->grpkey = BN_bin2bn(&ext->value->data[2],
			    ext->value->length - 2, NULL);
			/* fall through */
#if DEBUG
		default:
			if (debug)
				printf("cert_parse: %s\n",
				    OBJ_nid2ln(temp));
#endif
		}
	}
	if (strcmp(ret->subject, ret->issuer) == 0) {

		/*
		 * If certificate is self signed, verify signature.
		 */
		if (X509_verify(cert, ret->pkey) <= 0) {
			msyslog(LOG_NOTICE,
			    "cert_parse: signature not verified %s",
			    ret->subject);
			cert_free(ret);
			X509_free(cert);
			return (NULL);
		}
	} else {

		/*
		 * Check for a certificate loop.
		 */
		if (strcmp(hostval.ptr, ret->issuer) == 0) {
			msyslog(LOG_NOTICE,
			    "cert_parse: certificate trail loop %s",
			    ret->subject);
			cert_free(ret);
			X509_free(cert);
			return (NULL);
		}
	}

	/*
	 * Verify certificate valid times. Note that certificates cannot
	 * be retroactive.
	 */
	if (ret->first > ret->last || ret->first < fstamp) {
		msyslog(LOG_NOTICE,
		    "cert_parse: invalid times %s first %u last %u fstamp %u",
		    ret->subject, ret->first, ret->last, fstamp);
		cert_free(ret);
		X509_free(cert);
		return (NULL);
	}

	/*
	 * Build the value structure to sign and send later.
	 */
	ret->cert.fstamp = htonl(fstamp);
	ret->cert.vallen = htonl(len);
	ret->cert.ptr = emalloc(len);
	memcpy(ret->cert.ptr, asn1cert, len);
	X509_free(cert);
	return (ret);
}


/*
 * cert_free - free certificate information structure
 */
void
cert_free(
	struct cert_info *cinf	/* certificate info/value structure */ 
	)
{
	if (cinf->pkey != NULL)
		EVP_PKEY_free(cinf->pkey);
	if (cinf->subject != NULL)
		free(cinf->subject);
	if (cinf->issuer != NULL)
		free(cinf->issuer);
	if (cinf->grpkey != NULL)
		BN_free(cinf->grpkey);
	value_free(&cinf->cert);
	free(cinf);
}


/*
 * crypto_key - load cryptographic parameters and keys
 *
 * This routine searches the key cache for matching name in the form
 * ntpkey__, where  is one of host, sign, iff, gq, mv,
 * and  is the host/group name. If not found, it tries to load a
 * PEM-encoded file of the same name and extracts the filestamp from
 * the first line of the file name. It returns the key pointer if valid,
 * NULL if not.
 */
static struct pkey_info *
crypto_key(
	char	*cp,		/* file name */
	char	*passwd1,	/* password */
	sockaddr_u *addr 	/* IP address */
	)
{
	FILE	*str;		/* file handle */
	struct pkey_info *pkp;	/* generic key */
	EVP_PKEY *pkey = NULL;	/* public/private key */
	tstamp_t fstamp;
	char	filename[MAXFILENAME]; /* name of key file */
	char	linkname[MAXFILENAME]; /* filestamp buffer) */
	char	statstr[NTP_MAXSTRLEN]; /* statistics for filegen */
	char	*ptr;

	/*
	 * Search the key cache for matching key and name.
	 */
	for (pkp = pkinfo; pkp != NULL; pkp = pkp->link) {
		if (strcmp(cp, pkp->name) == 0)
			return (pkp);
	}  

	/*
	 * Open the key file. If the first character of the file name is
	 * not '/', prepend the keys directory string. If something goes
	 * wrong, abandon ship.
	 */
	if (*cp == '/')
		strcpy(filename, cp);
	else
		snprintf(filename, MAXFILENAME, "%s/%s", keysdir, cp);
	str = fopen(filename, "r");
	if (str == NULL)
		return (NULL);

	/*
	 * Read the filestamp, which is contained in the first line.
	 */
	if ((ptr = fgets(linkname, MAXFILENAME, str)) == NULL) {
		msyslog(LOG_ERR, "crypto_key: empty file %s",
		    filename);
		fclose(str);
		return (NULL);
	}
	if ((ptr = strrchr(ptr, '.')) == NULL) {
		msyslog(LOG_ERR, "crypto_key: no filestamp %s",
		    filename);
		fclose(str);
		return (NULL);
	}
	if (sscanf(++ptr, "%u", &fstamp) != 1) {
		msyslog(LOG_ERR, "crypto_key: invalid filestamp %s",
		    filename);
		fclose(str);
		return (NULL);
	}

	/*
	 * Read and decrypt PEM-encoded private key. If it fails to
	 * decrypt, game over.
	 */
	pkey = PEM_read_PrivateKey(str, NULL, NULL, passwd1);
	fclose(str);
	if (pkey == NULL) {
		msyslog(LOG_ERR, "crypto_key: %s",
		    ERR_error_string(ERR_get_error(), NULL));
		exit (-1);
	}

	/*
	 * Make a new entry in the key cache.
	 */
	pkp = emalloc(sizeof(struct pkey_info));
	pkp->link = pkinfo;
	pkinfo = pkp;
	pkp->pkey = pkey;
	pkp->name = emalloc(strlen(cp) + 1);
	pkp->fstamp = fstamp;
	strcpy(pkp->name, cp);

	/*
	 * Leave tracks in the cryptostats.
	 */
	if ((ptr = strrchr(linkname, '\n')) != NULL)
		*ptr = '\0'; 
	snprintf(statstr, NTP_MAXSTRLEN, "%s mod %d", &linkname[2],
	    EVP_PKEY_size(pkey) * 8);
	record_crypto_stats(addr, statstr);
#ifdef DEBUG
	if (debug)
		printf("crypto_key: %s\n", statstr);
	if (debug > 1) {
		if (pkey->type == EVP_PKEY_DSA)
			DSA_print_fp(stdout, pkey->pkey.dsa, 0);
		else if (pkey->type == EVP_PKEY_RSA)
			RSA_print_fp(stdout, pkey->pkey.rsa, 0);
	}
#endif
	return (pkp);
}


/*
 ***********************************************************************
 *								       *
 * The following routines are used only at initialization time         *
 *								       *
 ***********************************************************************
 */
/*
 * crypto_cert - load certificate from file
 *
 * This routine loads an X.509 RSA or DSA certificate from a file and
 * constructs a info/cert value structure for this machine. The
 * structure includes a filestamp extracted from the file name. Later
 * the certificate can be sent to another machine on request.
 *
 * Returns certificate info/value pointer if valid, NULL if not.
 */
static struct cert_info *	/* certificate information */
crypto_cert(
	char	*cp		/* file name */
	)
{
	struct cert_info *ret; /* certificate information */
	FILE	*str;		/* file handle */
	char	filename[MAXFILENAME]; /* name of certificate file */
	char	linkname[MAXFILENAME]; /* filestamp buffer */
	char	statstr[NTP_MAXSTRLEN]; /* statistics for filegen */
	tstamp_t fstamp;	/* filestamp */
	long	len;
	char	*ptr;
	char	*name, *header;
	u_char	*data;

	/*
	 * Open the certificate file. If the first character of the file
	 * name is not '/', prepend the keys directory string. If
	 * something goes wrong, abandon ship.
	 */
	if (*cp == '/')
		strcpy(filename, cp);
	else
		snprintf(filename, MAXFILENAME, "%s/%s", keysdir, cp);
	str = fopen(filename, "r");
	if (str == NULL)
		return (NULL);

	/*
	 * Read the filestamp, which is contained in the first line.
	 */
	if ((ptr = fgets(linkname, MAXFILENAME, str)) == NULL) {
		msyslog(LOG_ERR, "crypto_cert: empty file %s",
		    filename);
		fclose(str);
		return (NULL);
	}
	if ((ptr = strrchr(ptr, '.')) == NULL) {
		msyslog(LOG_ERR, "crypto_cert: no filestamp %s\n",
		    filename);
		fclose(str);
		return (NULL);
	}
	if (sscanf(++ptr, "%u", &fstamp) != 1) {
		msyslog(LOG_ERR, "crypto_cert: invalid filestamp %s\n",
		    filename);
		fclose(str);
		return (NULL);
	}

	/*
	 * Read PEM-encoded certificate and install.
	 */
	if (!PEM_read(str, &name, &header, &data, &len)) {
		msyslog(LOG_ERR, "crypto_cert: %s\n",
		    ERR_error_string(ERR_get_error(), NULL));
		fclose(str);
		return (NULL);
	}
	fclose(str);
	free(header);
	if (strcmp(name, "CERTIFICATE") != 0) {
		msyslog(LOG_NOTICE, "crypto_cert: wrong PEM type %s",
		    name);
		free(name);
		free(data);
		return (NULL);
	}
	free(name);

	/*
	 * Parse certificate and generate info/value structure. The
	 * pointer and copy nonsense is due something broken in Solaris.
	 */
	ret = cert_parse(data, len, fstamp);
	free(data);
	if (ret == NULL)
		return (NULL);

	if ((ptr = strrchr(linkname, '\n')) != NULL)
		*ptr = '\0'; 
	snprintf(statstr, NTP_MAXSTRLEN, "%s 0x%x len %lu",
	    &linkname[2], ret->flags, len);
	record_crypto_stats(NULL, statstr);
#ifdef DEBUG
	if (debug)
		printf("crypto_cert: %s\n", statstr);
#endif
	return (ret);
}


/*
 * crypto_setup - load keys, certificate and identity parameters
 *
 * This routine loads the public/private host key and certificate. If
 * available, it loads the public/private sign key, which defaults to
 * the host key. The host key must be RSA, but the sign key can be
 * either RSA or DSA. If a trusted certificate, it loads the identity
 * parameters. In either case, the public key on the certificate must
 * agree with the sign key.
 *
 * Required but missing files and inconsistent data and errors are
 * fatal. Allowing configuration to continue would be hazardous and
 * require really messy error checks.
 */
void
crypto_setup(void)
{
	struct pkey_info *pinfo; /* private/public key */
	char	filename[MAXFILENAME]; /* file name buffer */
	char *	randfile;
	char	statstr[NTP_MAXSTRLEN]; /* statistics for filegen */
	l_fp	seed;		/* crypto PRNG seed as NTP timestamp */
	u_int	len;
	int	bytes;
	u_char	*ptr;

	/*
	 * Check for correct OpenSSL version and avoid initialization in
	 * the case of multiple crypto commands.
	 */
	if (crypto_flags & CRYPTO_FLAG_ENAB) {
		msyslog(LOG_NOTICE,
		    "crypto_setup: spurious crypto command");
		return;
	}
	ssl_check_version();

	/*
	 * Load required random seed file and seed the random number
	 * generator. Be default, it is found as .rnd in the user home
	 * directory. The root home directory may be / or /root,
	 * depending on the system. Wiggle the contents a bit and write
	 * it back so the sequence does not repeat when we next restart.
	 */
	if (!RAND_status()) {
		if (rand_file == NULL) {
			RAND_file_name(filename, sizeof(filename));
			randfile = filename;
		} else if (*rand_file != '/') {
			snprintf(filename, sizeof(filename), "%s/%s",
			    keysdir, rand_file);
			randfile = filename;
		} else
			randfile = rand_file;

		if ((bytes = RAND_load_file(randfile, -1)) == 0) {
			msyslog(LOG_ERR,
			    "crypto_setup: random seed file %s missing",
			    randfile);
			exit (-1);
		}
		get_systime(&seed);
		RAND_seed(&seed, sizeof(l_fp));
		RAND_write_file(randfile);
#ifdef DEBUG
		if (debug)
			printf(
			    "crypto_setup: OpenSSL version %lx random seed file %s bytes read %d\n",
			    SSLeay(), randfile, bytes);
#endif
	}

	/*
	 * Initialize structures.
	 */
	if (sys_hostname == NULL) {
		gethostname(filename, MAXFILENAME);
		sys_hostname = emalloc(strlen(filename) + 1);
		strcpy(sys_hostname, filename);
	}
	if (passwd == NULL)
		passwd = sys_hostname;
	memset(&hostval, 0, sizeof(hostval));
	memset(&pubkey, 0, sizeof(pubkey));
	memset(&tai_leap, 0, sizeof(tai_leap));

	/*
	 * Load required host key from file "ntpkey_host_". If
	 * no host key file is not found or has invalid password, life
	 * as we know it ends. The host key also becomes the default
	 * sign key. 
	 */
	snprintf(filename, MAXFILENAME, "ntpkey_host_%s", sys_hostname);
	pinfo = crypto_key(filename, passwd, NULL);
	if (pinfo == NULL) {
		msyslog(LOG_ERR,
		    "crypto_setup: host key file %s not found or corrupt",
		    filename);
		exit (-1);
	}
	if (pinfo->pkey->type != EVP_PKEY_RSA) {
		msyslog(LOG_ERR,
		    "crypto_setup: host key is not RSA key type");
		exit (-1);
	}
	host_pkey = pinfo->pkey;
	sign_pkey = host_pkey;
	hostval.fstamp = htonl(pinfo->fstamp);
	
	/*
	 * Construct public key extension field for agreement scheme.
	 */
	len = i2d_PublicKey(host_pkey, NULL);
	ptr = emalloc(len);
	pubkey.ptr = ptr;
	i2d_PublicKey(host_pkey, &ptr);
	pubkey.fstamp = hostval.fstamp;
	pubkey.vallen = htonl(len);

	/*
	 * Load optional sign key from file "ntpkey_sign_". If
	 * available, it becomes the sign key.
	 */
	snprintf(filename, MAXFILENAME, "ntpkey_sign_%s", sys_hostname);
	pinfo = crypto_key(filename, passwd, NULL); if (pinfo != NULL)
	 	sign_pkey = pinfo->pkey;

	/*
	 * Load required certificate from file "ntpkey_cert_".
	 */
	snprintf(filename, MAXFILENAME, "ntpkey_cert_%s", sys_hostname);
	cinfo = crypto_cert(filename);
	if (cinfo == NULL) {
		msyslog(LOG_ERR,
		    "crypto_setup: certificate file %s not found or corrupt",
		    filename);
		exit (-1);
	}
	cert_host = cinfo;
	sign_digest = cinfo->digest;
	sign_siglen = EVP_PKEY_size(sign_pkey);
	if (cinfo->flags & CERT_PRIV)
		crypto_flags |= CRYPTO_FLAG_PRIV;

	/*
	 * The certificate must be self-signed.
	 */
	if (strcmp(cinfo->subject, cinfo->issuer) != 0) {
		msyslog(LOG_ERR,
		    "crypto_setup: certificate %s is not self-signed",
		    filename);
		exit (-1);
	}
	hostval.vallen = htonl(strlen(cinfo->subject));
	hostval.ptr = cinfo->subject;

	/*
	 * If trusted certificate, the subject name must match the group
	 * name.
	 */
	if (cinfo->flags & CERT_TRUST) {
		if (sys_groupname == NULL) {
			sys_groupname = hostval.ptr;
		} else if (strcmp(hostval.ptr, sys_groupname) != 0) {
			msyslog(LOG_ERR,
			    "crypto_setup: trusted certificate name %s does not match group name %s",
			    hostval.ptr, sys_groupname);
			exit (-1);
		}
	}
	if (sys_groupname != NULL) {

		/*
		 * Load optional IFF parameters from file
		 * "ntpkey_iffkey_".
		 */
		snprintf(filename, MAXFILENAME, "ntpkey_iffkey_%s",
		    sys_groupname);
		iffkey_info = crypto_key(filename, passwd, NULL);
		if (iffkey_info != NULL)
			crypto_flags |= CRYPTO_FLAG_IFF;

		/*
		 * Load optional GQ parameters from file
		 * "ntpkey_gqkey_".
		 */
		snprintf(filename, MAXFILENAME, "ntpkey_gqkey_%s",
		    sys_groupname);
		gqkey_info = crypto_key(filename, passwd, NULL);
		if (gqkey_info != NULL)
			crypto_flags |= CRYPTO_FLAG_GQ;

		/*
		 * Load optional MV parameters from file
		 * "ntpkey_mvkey_".
		 */
		snprintf(filename, MAXFILENAME, "ntpkey_mvkey_%s",
		    sys_groupname);
		mvkey_info = crypto_key(filename, passwd, NULL);
		if (mvkey_info != NULL)
			crypto_flags |= CRYPTO_FLAG_MV;
	}

	/*
	 * We met the enemy and he is us. Now strike up the dance.
	 */
	crypto_flags |= CRYPTO_FLAG_ENAB | (cinfo->nid << 16);
	snprintf(statstr, NTP_MAXSTRLEN,
	    "setup 0x%x host %s %s", crypto_flags, sys_hostname,
	    OBJ_nid2ln(cinfo->nid));
	record_crypto_stats(NULL, statstr);
#ifdef DEBUG
	if (debug)
		printf("crypto_setup: %s\n", statstr);
#endif
}


/*
 * crypto_config - configure data from the crypto command.
 */
void
crypto_config(
	int	item,		/* configuration item */
	char	*cp		/* item name */
	)
{
	int	nid;

#ifdef DEBUG
	if (debug > 1)
		printf("crypto_config: item %d %s\n", item, cp);
#endif
	switch (item) {

	/*
	 * Set host name (host).
	 */
	case CRYPTO_CONF_PRIV:
		sys_hostname = emalloc(strlen(cp) + 1);
		strcpy(sys_hostname, cp);
		break;

	/*
	 * Set group name (ident).
	 */
	case CRYPTO_CONF_IDENT:
		sys_groupname = emalloc(strlen(cp) + 1);
		strcpy(sys_groupname, cp);
		break;

	/*
	 * Set private key password (pw).
	 */
	case CRYPTO_CONF_PW:
		passwd = emalloc(strlen(cp) + 1);
		strcpy(passwd, cp);
		break;

	/*
	 * Set random seed file name (randfile).
	 */
	case CRYPTO_CONF_RAND:
		rand_file = emalloc(strlen(cp) + 1);
		strcpy(rand_file, cp);
		break;

	/*
	 * Set message digest NID.
	 */
	case CRYPTO_CONF_NID:
		nid = OBJ_sn2nid(cp);
		if (nid == 0)
			msyslog(LOG_ERR,
			    "crypto_config: invalid digest name %s", cp);
		else
			crypto_nid = nid;
		break;
	}
}
# else
int ntp_crypto_bs_pubkey;
# endif /* OPENSSL */
ntp-4.2.6p5/NOTES.y2kfixes0000644000175000017500000000520410017034516014165 0ustar  peterpeterName of the Application: xntp

Version Number:  4.0.91

Download Size: 4541953 bytes

Downloaded from: http://www.eecis.udel.edu/~ntp/

Operating Systems Supported: many

Operating Systems Tested: unix

Testing

Dates tested (CPU clock set)

	1999-12-31
	2000-01-01
	2000-02-29

	Critical fragments of code tested with other dates by special
	algorithms.

Hardware Platform: Sun Sparc

OS: Solaris 2.6

Compiler: gcc

Version: 2.8.1

Repairs:  9

No. of files Repaired: 13


Compilation of Patches Required: yes

Results Description:

1)	Tested suspicious code.

2)	Repaired problem code and added documentation to ntp.h.

3)	Verified ntpd works on critical Y2K dates.


Comments:

1)	Errors were found in improper use of tm_year within struct tm,
	calculations that did not support year 2000 as a leap year
	(it truly is, despite any unchanged comments remaining in 
	the NTP source), and some incorrect date calculations, while
	not traditional Y2K errors, would break in the year 2000.

2)	include/ntpd.h
    	Added some definitions and documentation about the right way
        of doing things.  Definitions used by most, if not all, of
        the Y2K repairs.

Cautions:

1)	Some of the Y2K repairs were to reference clock drivers that
	we did not have the local hardware to test.  While I believe
	the changes are sound, they really need to be tested.
	This includes:

		refclock_arc.c
		refclock_heath.c
		refclock_hpgps.c

	Also, parseutil/dcfd.c is another hardware dependent module that
	was repaired without live testing.

Non-Y2K Problems Observed:

1)	Inconsistent casts of variables containing time values may
	make expansion to 64 bit integer values in a portable manner
	difficult.

2)	libntp/caltontp.c:
        Has logic I believe will fail starting in year 2100 or so.
        Left unchanged/untested as it works well beyond basic NTP 2036 
	limit checked by check_y2k.c.
        If NTP is implemented on 64-bit machines, this should be fixed

3)	ntpd/refclock_acts.c:
	ACTS time format has changed somewhat since the code was written.
	In particular the '*' '#' character switch no longer occurs...
	only '*' is typed.

      NOTE: Author (falsely) stated Y2K is NOT a leap year when it 
      really is.

      TRUTH: ACTS will go beyond Y2K: it uses FourDigitYear % 100 values
      for year so year 2000 will revert to "00".


4)     ntpd/refclock_oncore.c
       Some very strange logic in manipulating year values:
       1122         instance->pp->year = buf[6]*256+buf[7];
       Multiply by 256????
 
    Response from PHK:
       The entire protocol is binary, the year is a 16 bit quantity 
       which according to the manual can have the range 1998-2018. 
 
ntp-4.2.6p5/html/0000755000175000017500000000000011675461367012575 5ustar  peterpeterntp-4.2.6p5/html/ntpd.html0000644000175000017500000006006011606456562014425 0ustar  peterpeter



	
		
		
		ntpd - Network Time Protocol (NTP) daemon
		
	

	
		

ntpd - Network Time Protocol (NTP) Daemon

gif
from The Wizard of Oz, L. Frank Baum

You need help from the monkeys.

Last update: 14-oct-09 22:23


Related Links

Table of Contents


Synopsis

ntpd [ -46aAbdDgLnNqx ] [ -c conffile ] [ -f driftfile ] [ -i jaildir ] [ -I iface ] [ -k keyfile ] [ -l logfile ] [ -p pidfile ] [ -P priority ] [ -r broadcastdelay ] [ -s statsdir ] [ -t key ] [ -u user[:group] ] [ -U interface_update_interval ] [ -v variable ] [ -V variable ]

Description

The ntpd program is an operating system daemon that synchronises the system clock with remote NTP time servers or local reference clocks. It is a complete implementation of the Network Time Protocol (NTP) version 4, but also retains compatibility with version 3, as defined by RFC-1305, and version 1 and 2, as defined by RFC-1059 and RFC-1119, respectively. The program can operate in any of several modes, as described on the Association Management page, and with both symmetric key and public key cryptography, as described on the Authentication Options page.

The ntpd program ordinarily requires a configuration file as desccribe on the Configuration Commands and Options collection above. However a client can discover remote servers and configure them automatically. This makes it possible to deploy a fleet of workstations without specifying configuration details specific to the local environment. Further details are on the Automatic Server Discovery page.

Once the NTP software distribution has been compiled and installed and the configuration file constructed, the next step is to verify correct operation and fix any bugs that may result. Usually, the command line that starts the daemon is included in the system startup file, so it is executed only at system boot time; however, the daemon can be stopped and restarted from root at any time. Once started, the daemon will begin sending and receiving messages, as specified in the configuration file.

Setting the Time and Frequency

The ntpd program operates by exchanging messages with one or more servers at designated intervals ranging from about one minute to about 17 minutes. When started, the program requires several exchanges while the algorithms accumulate and groom the data before setting the clock. The initial delay to set the clock can be reduced using options on the Server Options page.

Most compters today incorporate a time-of-year (TOY) chip to maintain the time during periods when the power is off. When the machine is booted, the chip is used to initialize the operating system time. In case there is no TOY chip or the TOY time is more than 1000 s from the server time, ntpd assumes something must be terribly wrong and exits with a panic message to the system operator. With the -g option the clock will be initially set to the server time regardless of the chip time. However, once the clock has been set, an error greater than 1000 s will cause ntpd to exit anyway.

Under ordinary conditions, ntpd slews the clock so that the time is effectively continuous and never runs backwards. If due to extreme network congestion an error spike exceeds the step threshold, by default 128 ms, the spike is discarded. However, if the error persists for more than the stepout threshold, by default 900 s, the system clock is stepped to the correct value. In practice the need for a step has is extremely rare and almost always the result of a hardware failure. With the -x option the step threshold is increased to 600 s. Other options are available using the tinker command on the Miscellaneous Options page.

The issues should be carefully considered before using these options. The maximum slew rate possible is limited to 500 parts-per-million (PPM) by the Unix kernel. As a result, the clock can take 2000 s for each second the clock is outside the acceptable range. During this interval the clock will not be consistent with any other network clock and the system cannot be used for distributed applications that require correctly synchronized network time.

The frequency file, usually called ntp.drift, contains the latest estimate of clock frequency. If this file does not exist when ntpd is started, it enters a special mode designed to measure the particular frequency directly. The measurement takes 15 minutes, after which the frequency is set and ntpd resumes normal mode where the time and frequency are continuously adjusted. The frequency file is updated at intervals of an hour or more depending on the measured clock stability.

Operating Modes

The ntpd program normally operates continuously while adjusting the time and frequency, but in some cases it may not be practical to run it continuously. With the -q option ntpd operates as in continous mode, but exits just after setting the clock for the first time with the configured servers. Most applications will probably want to specify the iburst option with the server command. With this option a volley of messages is exchanged to groom the data and set the clock in about 10 s. If nothing is heard after a few minutes, the daemon times out and exits.

Poll Interval Control

NTP uses an intricate heuristic algorithm to automatically control the poll interval for maximum accuracy consistent with minimum network overhead. The algorithm measures the incidental offset and jitter to determine the best poll interval. When ntpd starts, the interval is the default minimum 64 s. Under normal conditions when the clock discipline has stabilized, the interval increases in steps to the default maximum 1024 s. In addition, should a server become unreachable after some time, the interval increases in steps to the maximum in order to reduce network overhead.

The default poll interval range is suitable for most conditions, but can be changed using options on the Server Options and Miscellaneous Options pages. However, when using maximum intervals much larger than the default, the residual clock frequency error must be small enough for the discipline loop to capture and correct. The capture range is 500 PPM with a 64-s interval decreasing by a factor of two for each interval doubling. At a 36-hr interval, for example, the capture range is only 0.24 PPM.

The huff-n'-puff Filter

In scenarios where a considerable amount of data are to be downloaded or uploaded over telephone modems, timekeeping quality can be seriously degraded. This occurs because the differential delays on the two directions of transmission can be quite large. In many cases the apparent time errors are so large as to exceed the step threshold and a step correction can occur during and after the data transfer.

The huff-n'-puff filter is designed to correct the apparent time offset in these cases. It depends on knowledge of the propagation delay when no other traffic is present, such as during other than work hours. The filter remembers the minimum delay over the most recent interval measured usually in hours. Under conditions of severe delay, the filter corrects the apparent offset using the sign of the offset and the difference between the apparent delay and minimum delay. The name of the filter reflects the negative (huff) and positive (puff) correction, which depends on the sign of the offset. The filter is activated by the tinker huffpuff command, as described in the Miscellaneous Options page.

Leap Second Processing

As provided by international agreement, an extra second is sometimes inserted in Coordinated Universal Time (UTC) at the end of a selected month, usually June or December. The National Institutes of Standards and Technology (NIST) provides an historic leapseconds file at time.nist.gov for retrieval via FTP. When this file, usually called ntp-leapseconds.list, is copied and installed in a directory. The leapfile configuration command specifies the path to this file. At startup, ntpd reads it and initializes three leapsecond values: the NTP seconds at the next leap event, the offset of UTC relative to International Atomic Time (TAI) after the leap and the NTP seconds when the leapseconds file expires and should be retrieved again.

If a host does not have the leapsecond values, they can be obtained over the net using the Autokey security protocol. Ordinarily, the leapseconds file is installed on the primary servers and the values flow from them via secondary servers to the clients. When multiple servers are involved, the values with the latest expiration time are used.

If the latest leap is in the past, nothing further is done other than to install the TAI offset. If the leap is in the future less than 28 days, the leap warning bits are set. If in the future less than 23 hours, the kernel is armed to insert one second at the end of the current day. If the kernel is enabled, the leap is done automatically at that time; otherwise, the clock is effectively stopped for one second at the leap. Additional details are in the The NTP Timescale and Leap Seconds white paper

If none of the above provisions are available, dsependent servers and clients tally the leap warning bits of surviving servers and reference clocks. When a majority of the survivors show warning, a leap is programmed at the end of the current month. During the month and day of insertion, they operate as above. In this way the leap is is propagated at all dependent servers and clients.

Additional Features

A new experimental feature called interleaved modes can be used in NTP symmetric or broadcast modes. It is designed to improve accuracy by avoiding kernel latency and queueing delay, as described on the NTP Interleaved Modes page. It is activated by the xleave option with the peer or broadcast configuration commands. The NTP protocol automatically reconfigures in normal or interleaved mode as required. Ordinary broadcast clients can use the same servers as interleaved clients at the same time. Further details are in the white paper NTP Interleaved On-Wire Protocol and the briefing Interleaved Synchronization Protocols for LANs and Space Data Links.

If ntpd, is configured with NetInfo support, it will attempt to read its configuration from the NetInfo service if the default ntp.conf file cannot be read and no file is specified by the -c option.

In contexts where a host name is expected, a -4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS resolution to the IPv6 namespace.

Various internal ntpd variables can be displayed and configuration options altered while the ntpd is running using the ntpq and ntpdc utility programs.

When ntpd starts it looks at the value of umask, and if zero ntpd will set the umask to 022.

Unless the -n, -d or -D option is used, ntpd changes the current working directory to the root directory, so any options or commands specifying paths need to use an absolute path or a path relative to the root.

Command Line Options

-4
Force DNS resolution of host names to the IPv4 namespace.
-6
Force DNS resolution of host names to the IPv6 namespace.
-a
Require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the same operation as the enable auth command and is the default.
-A
Do not require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the same operation as the disable auth command and almost never a good idea.
-b
Enable the client to synchronize to broadcast servers.
-c conffile
Specify the name and path of the configuration file, default /etc/ntp.conf.
-d
Specify debugging mode. This option may occur more than once, with each occurrence indicating greater detail of display.
-D level
Specify debugging level directly.
-f driftfile
Specify the name and path of the frequency file. This is the same operation as the driftfile driftfile command.
-g
Normally, ntpd exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, ntpd will exit with a message to the system log. This option can be used with the -q and -x options. See the tinker command for other options.
-i jaildir
Chroot the server to the directory jaildir. This option also implies that the server attempts to drop root privileges at startup (otherwise, chroot gives very little additional security), and it is only available if the OS supports to run the server without full root privileges. You may need to also specify a -u option.
-I [address | interface name]
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 interface command, which is more versatile.
-k keyfile
Specify the name and path of the symmetric key file. This is the same operation as the keys keyfile command.
-l logfile
Specify the name and path of the log file. The default is the system log file. This is the same operation as the logfile logfile command.
-L
Do not listen to virtual interfaces, defined as those with names containing a colon. This option is deprecated. Please consider using the configuration file interface command, which is more versatile.
-M
Raise scheduler precision to its maximum (1 msec) using timeBeginPeriod. (Windows only)
-n
Don't fork.
-N
To the extent permitted by the operating system, run the ntpd at the highest priority.
-p pidfile
Specify the name and path of the file used to record the ntpd process ID. This is the same operation as the pidfile pidfile command.
-P priority
To the extent permitted by the operating system, run the ntpd at the specified priority.
-q
Exit the ntpd just after the first time the clock is set. This behavior mimics that of the ntpdate program, which is to be retired. The -g and -x options can be used with this option. Note: The kernel time discipline is disabled with this option.
-r broadcastdelay
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.
-s statsdir
Specify the directory path for files created by the statistics facility. This is the same operation as the statsdir statsdir command.
-t key
Add a key number to the trusted key list. This option can occur more than once. This is the same operation as the trustedkey key command.
-u user[:group]
Specify a user, and optionally a group, to switch to. This option is only available if the OS supports running the server without full root privileges. Currently, this option is supported under NetBSD (configure with --enable-clockctl) and Linux (configure with --enable-linuxcaps).
-U interface update interval
Number of seconds to wait between interface list scans to pick up new and delete network interface. Set to 0 to disable dynamic interface list updating. The default is to scan every 5 minutes.
-v variable
-V variable
Add a system variable listed by default.
-x
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. Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s. Thus, an adjustment as much as 600 s will take almost 14 days to complete. This option can be used with the -g and -q options. See the tinker command for other options. Note: The kernel time discipline is disabled with this option.
--pccfreq frequency
Substitute processor cycle counter for QueryPerformanceCounter unconditionally using the given frequency (in Hz). --pccfreq can be used on systems which do not use the PCC to implement QueryPerformanceCounter and have a fixed PCC frequency. The frequency specified must be accurate within 0.5 percent. --usepcc is equivalent on many systems and should be tried first, as it does not require determining the frequency of the processor cycle counter. For x86-compatible processors, the PCC is also referred to as RDTSC, which is the assembly-language instruction to retrieve the current value.  (Windows only)
--usepcc
Substitute processor cycle counter for QueryPerformanceCounter if they appear equivalent. This option should be used only if the PCC frequency is fixed. Power-saving functionality on many laptops varies the PCC frequency. (Windows only)

The Configuration File

Ordinarily, ntpd reads the ntp.conf configuration file at startup in order to determine the synchronization sources and operating modes. It is also possible to specify a working, although limited, configuration entirely on the command line, obviating the need for a configuration file. This may be particularly useful when the local host is to be configured as a broadcast client, with servers determined by listening to broadcasts at run time.

Usually, the configuration file is installed as/etc/ntp.conf, but could be installed elsewhere (see the -c conffile command line option). The file format is similar to other Unix configuration files - comments begin with a # character and extend to the end of the line; blank lines are ignored.

Configuration commands consist of an initial command keyword followed by a list of option keywords separated by whitespace. Commands may not be continued over multiple lines. Options may be host names, host addresses written in numeric, dotted-quad form, integers, floating point numbers (when specifying times in seconds) and text strings. Optional arguments are delimited by [ ] in the options pages, while alternatives are separated by |. The notation [ ... ] means an optional, indefinite repetition of the last item before the [ ... ].

Files

File Default Option Command
configuration file /etc/ntp.conf -c none
frequency file none -f driftfile
leapseconds file none leapfile
process ID file none -p pidfile
log file system log -l logfile
include file none none includefile
statistics path /var/NTP -s statsdir
keys path /usr/local/etc -k keysdir

Exit Codes

A non-zero exit code indicates an error. Any error messages are logged to the system log by default.

The exit code is 0 only when ntpd is terminated by a signal, or when the -q option is used and ntpd successfully sets the system clock.


ntp-4.2.6p5/html/icons/0000755000175000017500000000000011675461367013710 5ustar peterpeterntp-4.2.6p5/html/icons/home.gif0000644000175000017500000000172710017034534015313 0ustar peterpeterGIF89a$÷€€€€€€€€€ÀÀÀÀÜÀ¤ÈðUªÕ+U+€+ª+Õ+ÿ+UUU€UªUÕUÿUU€ª€Õ€ÿ€ªUª€ªªªÕªÿªÕUÕ€ÕªÕÕÕÿÕUÿ€ÿªÿÕÿUUU€UªUÕUÿU+UU+U€+Uª+UÕ+Uÿ+UUUUUU€UUªUUÕUUÿUU€UU€U€€Uª€UÕ€Uÿ€UªUUªU€ªUªªUÕªUÿªUÕUUÕU€ÕUªÕUÕÕUÿÕUÿUUÿU€ÿUªÿUÕÿUÿÿUU€ª€Õ€ÿ€+€U+€€+€ª+€Õ+€ÿ+€U€UU€€U€ªU€ÕU€ÿU€U€€ª€€Õ€€ÿ€€ª€Uª€€ª€ªª€Õª€ÿª€Õ€UÕ€€Õ€ªÕ€ÕÕ€ÿÕ€ÿ€Uÿ€€ÿ€ªÿ€Õÿ€ÿÿ€ªUª€ªªªÕªÿª+ªU+ª€+ªª+ªÕ+ªÿ+ªUªUUª€UªªUªÕUªÿUª€ªU€ª€€ªª€ªÕ€ªÿ€ªªªUªª€ªªªªªÕªªÿªªÕªUÕª€ÕªªÕªÕÕªÿ€ ÿªUÿª€ÿªªÿªÕÿªÿÿªÕUÕ€ÕªÕÕÕÿÕ+ÕU+Õ€+Õª+ÕÕ+Õÿ+ÕUÕUUÕ€UÕªUÕÕUÕÿUÕ€ÕU€Õ€€Õª€ÕÕ€Õÿ€ÕªÕUªÕ€ªÕªªÕÕªÕÿªÕÕÕUÕÕ€ÕÕªÕÕÕÕÕÿÕÕÿÕUÿÕ€ÿÕªÿÕÕÿÕÿÿÕUÿ€ÿªÿÕÿ+ÿU+ÿ€+ÿª+ÿÕ+ÿÿ+ÿUÿUUÿ€UÿªUÿÕUÿÿUÿ€ÿU€ÿ€€ÿª€ÿÕ€ÿÿ€ÿªÿUªÿ€ªÿªªÿÕªÿÿªÿÕÿUÕÿ€ÕÿªÕÿÕÕÿÿÕÿUÿÿ€ÿÿªÿÿÿûð  ¤€€€ÿÿÿÿÿÿÿÿÿÿÿÿ!ù,$´H° Áƒ*\˜ŸÃ‡#Jœø° ʼnþ.J,¨¢¿ Éïc?! †4ÙïdÆŽ;²lé²cA3iÖ¼XðbN;'¤øhЈ‰~\Ê´)Å‚DóIJuêK‰£îÛZuë¾|W#Ô à+Õ}eÁR,¨•ëY®a!ŒZµ®Ú‰éNÕÇ·j܇õJÕ@Ÿ_ŠçÓWøðÄ‚J›JF)± ÉËjÞ̹3Á€;ntp-4.2.6p5/html/icons/mail2.gif0000644000175000017500000000043710017034534015364 0ustar peterpeterGIF89a"ƒ„„ÿÿÿÿÅÞÖsœœsŒ”ÖïÖŒ¤¤)BZ”œ­­¤½µ½ÎÅ!ù,"ÌÈI«½7h{å’ €^&•H–S€¾”°’KÜ0Žsiã8€n·ú¼€A±÷:‘ÉÏø|"«œ…)ÉAQ@¬­ÕÂ/M0{F\…ÍÄs·Ù=ç»Nwn*ep}/l=Sz|rcˆb`c‘pqL¦¦¯-´-­•¶g¶‚®ºƒ£¬³¿¬2o¹Ä·2S¨É["#ш4Ï˪Ôa„¨ÔÙ<ÁÜÀÒeáÅß×ÜÚäå[hìï;ntp-4.2.6p5/html/howto.html0000644000175000017500000003172711307651603014617 0ustar peterpeter How to Write a Reference Clock Driver

How to Write a Reference Clock Driver

giffrom Pogo, Walt Kelly

You need a little magic.

Last update: 11-Jul-2009 20:44


Related Links

Table of Contents


Description

NTP reference clock support maintains the fiction that the clock is actually an ordinary server in the NTP tradition, but operating at a synthetic stratum of zero. The entire suite of algorithms filter the received data and select the best sources to correct the system clock. No packets are exchanged with a reference clock; however, the transmit, receive and packet procedures are replaced with code to simulate them.

The driver assumes three timescales: standard time maintained by a distant laboratory such as USNO or NIST, reference time maintained by the external radio and the system time maintained by NTP. The radio synchronizes reference time via radio, satellite or modem. As the transmission means may not always be reliable, most radios continue to provide clock updates for some time after signal loss using an internal reference oscillator. In such cases the radio may or may not reveal the time since last synchronized or the estimated time error.

All three timescales run only in Coordinated Universal Time (UTC) and are not adjusted for local timezone or standard/daylight time. The local timezone, standard/daylight indicator and year, if provided, are ignored. However, it is important to determine whether a leap second is to be inserted in the UTC timescale in the near future so NTP can insert it in the system timescale at the appropriate epoch.

The interface routines in the ntp_refclock.c source file call the following driver routines via a transfer vector:

startup
The association has just been mobilized. The driver may allocate a private structure and open the device(s) required.
shutdown
The association is about to be demobilized. The driver should close all device(s) and free private structures.
receive
A timecode string is ready for retrieval using the refclock_gtlin() or refclock_gtraw() routines and provide clock updates.
poll
Called at poll timeout, by default 64 s. Ordinarily, the driver will send a poll sequence to the radio as required.
timer
Called once per second. This can be used for housekeeping functions. In the case with pulse-per-second (PPS) signals, this can be used to process the signals and provide clock updates.

The receive routine retrieves a timecode string via serial or parallel port, PPS signal or other means. It decodes the timecode in days, hours, minutes, seconds and nanoseconds and checks for errors. It provides these data along with the on-time timestamp to the refclock_process routine, which saves the computed offset in a 60-sample circular buffer. On occasion, either by timeout, sample count or call to the poll routine, the driver calls refclock_receive to process the circular buffer samples and update the system clock.

The best way to understand how the clock drivers work is to study one of the drivers already implemented, such as refclock_wwvb.c. The main interface is the refclockproc structure, which contains for most drivers the decoded timecode, on-time timestamp, reference timestamp, exception reports and statistics tallies, etc. The support routines are passed a pointer to the peer structure, which contains a pointer to the refclockproc structure, which in turn contains a pointer to the unit structure, if used. For legacy purposes, a table typeunit[type][unit] contains the peer structure pointer for each configured clock type and unit. This structure should not be used for new implementations.

Radio and modem reference clocks by convention have addresses of the form 127.127.t.u, where t is the clock type and u in the range 0-3 is used to distinguish multiple instances of clocks of the same type. Most clocks require a serial or parallel port or special bus peripheral. The particular device is normally specified by adding a soft link /dev/deviceu to the particular hardware device.

By convention, reference clock drivers are named in the form refclock_xxxx.c, where xxxx is a unique string. Each driver is assigned a unique type number, long-form driver name, short-form driver name and device name. The existing assignments are in the Reference Clock Drivers page and its dependencies. All drivers supported by the particular hardware and operating system are automatically detected in the autoconfigure phase and conditionally compiled.

Conventions, Fudge Factors and Flags

Most drivers support manual or automatic calibration for systematic offset bias using values encoded in the fudge configuration command. By convention, the time1 value defines the calibration offset in seconds. For those drivers that support statistics collection using the filegen utility and the clockstats file, the flag4 switch enables the utility.

If the calibration feature has been enabled, the flag1 switch is set and the PPS signal is actively disciplining the system time, the time1 value is automatically adjusted to maintain a residual offset of zero. Once the its value has stabilized, the value can be inserted in the configuration file and the calibration feature disabled.

Files Which Need to be Changed

When a new reference clock driver is installed, the following files need to be edited. Note that changes are also necessary to properly integrate the driver in the configuration and makefile scripts, but these are decidedly beyond the scope of this page.

./include/ntp.h
The reference clock type defines are used in many places. Each driver is assigned a unique type number. Unused numbers are clearly marked in the list. A unique REFCLK_xxxx identification code should be recorded in the list opposite its assigned type number.
./libntp/clocktypes.c
The ./libntp/clktype array is used by certain display functions. A unique short-form name of the driver should be entered together with its assigned identification code.
./ntpd/ntp_control.c
The clocktypes array is used for certain control message displays functions. It should be initialized with the reference clock class assigned to the driver, as per the NTP specification RFC-1305. See the ./include/ntp_control.h header file for the assigned classes.
./ntpd/refclock_conf.c
This file contains a list of external structure definitions which are conditionally defined. A new set of entries should be installed similar to those already in the table. The refclock_conf array is a set of pointers to transfer vectors in the individual drivers. The external name of the transfer vector should be initialized in correspondence with the type number.

Interface Routine Overview

refclock_newpeer - initialize and start a reference clock.
This routine allocates and initializes the interface structure which supports a reference clock in the form of an ordinary NTP peer. A driver-specific support routine completes the initialization, if used. Default peer variables which identify the clock and establish its reference ID and stratum are set here. It returns one if success and zero if the clock address is invalid or already running, insufficient resources are available or the driver declares a bum rap.
refclock_unpeer - shut down a clock
This routine is used to shut down a clock and return its resources to the system.
refclock_transmit - simulate the transmit procedure
This routine implements the NTP transmit procedure for a reference clock. This provides a mechanism to call the driver at the NTP poll interval, as well as provides a reachability mechanism to detect a broken radio or other madness.
refclock_process - insert a sample in the circular buffer
This routine saves the offset computed from the on-time timestamp and the days, hours, minutes, seconds and nanoseconds in the circular buffer. Note that no provision is included for the year, as provided by some (but not all) radio clocks. Ordinarily, the year is implicit in the Unix file system and hardware/software clock support, so this is ordinarily not a problem.
refclock_receive - simulate the receive and packet procedures
This routine simulates the NTP receive and packet procedures for a reference clock. This provides a mechanism in which the ordinary NTP filter, selection and combining algorithms can be used to suppress misbehaving radios and to mitigate between them when more than one is available for backup.
refclock_gtraw, refclock_gtlin - read the buffer and on-time timestamp
These routines return the data received from the clock and the on-time timestamp. The refclock_gtraw routine returns a batch of one or more characters returned by the Unix terminal routines in raw mode. The refclock_gtlin routine removes the parity bit and control characters and returns all the characters up to and including the line terminator. Either routine returns the number of characters delivered.
refclock_open - open a serial port for reference clock
This routine opens a serial port for I/O and sets default options. It returns the file descriptor if success and zero if failure.
refclock_ioctl - set serial port control functions
This routine attempts to hide the internal, system-specific details of serial ports. It can handle POSIX (termios), SYSV (termio) and BSD (sgtty) interfaces with varying degrees of success. The routine returns one if success and zero if failure.
refclock_ppsapi
This routine initializes the Pulse-per-Second interface (see below).
refclock_pps
This routine is called once per second to read the latest PPS offset and save it in the circular buffer (see below).

Pulse-per-Second Interface

When the Pulse-per-Second Application Interface (RFC 2783) is present, a compact PPS interface is available to all drivers. See the Mitigation Rules and the Prefer Peer page for further information. To use this interface, include the timeppps.h and refclock_atom.h header files and define the refclock_atom structure in the driver private storage. The timepps.h file is specific to each operating system and may not be available for some systems.

To use the interface, call refclock_ppsapi from the startup routine passing the device file descriptor and refclock_atom structure pointer. Then, call refclock_pps from the timer routine passing the association pointer and refclock_atom structure pointer. See the refclock_atom.c file for examples and calling sequences. If the PPS signal is valid, the offset sample will be save in the circular buffer and a bit set in the association flags word indicating the sample is valid and the driver an be selected as a PPS peer. If this bit is set when the poll routine is called, the driver calls the refclock_receive routine to process the samples in the circular buffer and update the system clock.


gif

ntp-4.2.6p5/html/rate.html0000644000175000017500000003323511307651605014410 0ustar peterpeter Rate Management and the Kiss-o'-Death

Rate Management and the Kiss-o'-Death Packet

giffrom Pogo, Walt Kelly

Our junior managers and the administrators.

Last update: 03-May-2009 3:34 UTC


Related Links

Table of Contents


Introduction

This page describes the various rate management provisions in NTPv4. Details about the configuration commands and options are given on the Configuration Options page. Details about the cryptographic authentication schemes are given on the Authentication Options page. Details about the automatic server discovery schemes are described on the Automatic Server Discovery Schemes page. Additional information is available in the papers, reports, memoranda and briefings on the NTP Project page.

Some national time metrology laboratories, including NIST and USNO, use the ntpd reference implementation in their very busy public time servers. They operate multiple servers behind load-balancing devices to support aggregate rates up to several thousand packets per second. The servers need to defend themselves against all manner of broken implementations that can clog the server and and network infrastructure. On the other hand, friendly ntpd clients need to avoid configurations that can result in unfriendly rates.

There are several features in ntpd designed to defend the servers, clients and network against accidental or intentional flood attack. On the other hand these features are also used to insure ntpd is a good citizen, even if configured in unfriendly ways. The ground rules are:

  • Send at the lowest rate consistent with the expected accuracy expectations.
  • Maintain strict minimum average headway and guard times, even if multiple burst options and/or the Autokey protocol are operating.
  • When the first packet of a burst is sent to a server, do not send further packets until the first packet has been received from the server.
  • Upon receiving a Kiss-o'-Death packet (see below), immediately reduce the sending rate.

Rate management involves four algorithms to manage resources: (1) poll rate control, (2) burst control, (3) average headway time and (4) guard time. These are described in following sections.

Poll Rate Control

Control of the poll interval is an intricate balance between expected acuracy and network load. The poll interval is constrained by the lower limit minpoll and upper limit maxpoll options of the server command and represented by the poll exponent in log2 s units. The limits default to 6 (64 s) and 10 (1024 s), respectively, which are appropriate for the vast majority of cases. The default limits can be changed with these options to a minimum set by the average option of the discard command (see below) to a maximum of 17 (36 h). Unless the best possible accuracy is required, the well mannered NTP client automatically increases the poll interval to the maximum when possible, whether or not the server is reachable. The current poll interval for each association is displayed by the ntpq program pe command. The global poll interval/time constant is displayed as the poll system variable by the rv command. The minimum global poll interval/time constant is displayed as the minpoll system variable by the rv command.

As a rule of thumb, the expected errors increase by a factor of two as the poll interval increases by a factor of four. The ntpd poll interval algorithm slowly increases the poll interval when jitter dominates the error budget, but quickly reduces the interval when wander dominates it. The algorithm uses a jiggle counter which operates over the range from -30 to +30 and is initialized at 0. If the measured offset is less than four times the measured average jitter, the counter is increased by the pollcurrent exponent; if not, it is decreased by twice the poll exponent. If the counter reaches +30, the poll exponent is incremented by 1; if the counter reaches -30, the exponent is decremented by 1. In either case the counter is set to 0.

The poll interval is proportional to the time constant of the feedback loop which disciplines the system clock. The optimum time constant depends on the network time jitter and the clock oscillator frequency wander. Errors due to jitter decrease as the time constant increases, while errors due to wander decrease as the time constant decreases. The two error characteristics intersect at a point called the Allan intercept, which represents the ideal time constant. With a compromise Allan intercept of 2000 s, the optimim poll interval is about 64 s, which corresponds to a poll exponent of 6.

There is normally no need to change the poll limits, as the poll interval is managed automatically as a function of prevailing jitter and wander. The most common exceptions are the following.

  • With fast, lightly loaded LANs and modern processors, the nominal Allan intercept is about 500 s. In these cases the expected errors can be further reduced using a poll exponent of 4 (16 s). In the case of the pulse-per-second (PPS) driver, this is the recommended value.
  • With symmetric modes the most stable behavior results when both peers are configured in symmetric active mode with matching poll intervals of 6 (64 s).
  • The poll interval should not be modified for reference clocks, with the single exception the ACTS telephone modem driver. In this case the recommended minimum and maximum intervals are 12 (1.1 h) and 17 (36 h), respectively.

Burst Control

Occasionally it is necessary to send packets at intervals less than the poll interval. For instance, with the burst and iburst options of the server command, the poll algorithm sends a burst of several packets at 2-s intervals. The ntpd poll algorithm avoids sending needless packets if the server is not responding. The client begins a burst with a single packet. When the first packet is received from the server, the client continues with the remaining packets in the burst. If the first packet is not received within 64 s, it will be sent again for two additional retries before beginning backoff. The result is to minimize network load if the server is not responding.

For the iburst option the number of packets in the burst is six, which is the number normally needed to synchronize the clock; for the burst option, the number of packets in the burst is determined by the difference between the poll interval and the minimum poll interval set by the minpoll option of the server command. For instance, with a poll exponent of 6 (64 s), only a single packet is sent for every poll, while the full number of eight packets is sent at poll intervals of 9 (512 s) or more.

Average Headway Time

There are two features in ntpd to manage the interval between one packet and the next. These features make use of a set of counters: a client output counter for each association and a server input counter for each distinct client address. Each counter increments by a value called the headway when a packet is processed and decrements by one each second. The default minimum average headway in ntpd is 8 s, but this can be changed using the average option of the discard command, but not less than 3 (8 s).

If the iburst or burst options are present, the poll algorithm sends a burst of packets instead of a single packet at each poll opportunity. The NTPv4 specification requires that bursts contain no more than eight packets; so, starting from an output counter value of zero, the maximum counter value or ouput ceiling can be no more than eight times the minimum poll interval set by the minpoll option of the server command. However, if the burst starts with a counter value other than zero, there is a potential to exceed the ceiling. The poll algorithm avoids this by computing an additional headway time so that the next packet sent will not exceed the ceiling. Additional headway time can result from Autokey protocol operations. Designs such as this are often called leaky buckets. The current headway is displayed as the headway peer variable by the ntpq rv command.

The ntpd input packet routine uses a special list of entries, one for each distinct client address found. Each entry includes an IP address, input counter and interval since the last packet arrival. The entries are ordered by interval from the smallest to the largest. As each packet arrives, the IP source address is compared to the IP address in each entry in turn. If a match is found the entry is removed and inserted first on the list. If the IP source address does not match any entry, a new entry is created and inserted first, possibly discarding the last entry on the list if it is full. Observers will note this is the same algorithm used for page replacement in virtual memory systems.

In the virtual memory algorithm the entry of interest is the last, whereas here the entry of interest is the first. The input counter is decreased by the interval since it was last referenced, but not below zero. If the value of the counter plus the headway is greater than the input ceiling set by the average option, the packet is discarded. Otherwise, the counter is increased by the headway and the packet is processed. The result is, if the client maintains a maximum average headway not less than the input ceiling and transmits no more than eight packets in a burst, the input counter will not exceed the ceiling.

Guard Time

A review of past client abuse incidence shows the most frequent scenario is a broken client that attempts to send a number of packets at rates of one per second or more. On one occasion due to a defective client design, over 750,000 clients fell into this mode. There have been occasions where this abuse has persisted for days at a time. These scenarios are the most damaging, as they can threaten not only the victim server but the network infrastructure as well.

In the ntpd design the minimum headway between the last packet received and the current packet is called the guard time. If the headway is less than the guard time, the packet is discarded. The guard time defaults to 2 s, but this can be changed using the minimum option of the discard ommand.

The Kiss-of-Death Packet

Ordinarily, packets denied service are simply dropped with no further action except incrementing statistics counters. Sometimes a more proactive response is needed to cause the client to slow down. A special packet format has been created for this purpose called the kiss-o'-death (KoD) packet. KoD packets have leap indicator 3, stratum 0 and the reference identifier set to a four-byte ASCII code. At present, only one code RATE is sent by the server if the limited and kod flags are set in the restrict command and the rate limit is exceeded.

A client receiving a KoD packet is expected to slow down; however, no explicit mechanism is specified in the protocol to do this. In the current reference implementation, the server sets the packet poll to the greater of (a) minimum average headway and (b) client packet poll. The client sets the peer poll field to the maximum of (a) minimum average headway and (b) server packet poll. For KoD packets (only), the minimum peer poll is clamped not less than the peer poll and the headway temporarily increased.

At present there is only one KoD packet with code RATE. In order to make sure the client notices the KoD, the receive and transmit timestamps are set to the transmit timestamp of the client packet and all other fields left as in the client packet. Thus, even if the client ignores the KoD, it cannot do any useful time computations. KoDs themselves are rate limited in the same way as arriving packets in order to deflect a flood attack.


ntp-4.2.6p5/html/rdebug.html0000644000175000017500000001312511307651605014721 0ustar peterpeter Debugging Reference Clock Drivers

Debugging Reference Clock Drivers

giffrom The Wizard of Oz, L. Frank Baum

Call the girls and the'll sweep your bugs.

Last update: 01:24 UTC Saturday, November 24, 2007


Related Links


The ntpq and ntpdc utility programs can be used to debug reference clocks, either on the server itself or from another machine elsewhere in the network. The server is compiled, installed and started using the configuration file described in the ntpd page and its dependencies. If the clock appears in the ntpq utility and pe command, no errors have occurred and the daemon has started, opened the devices specified and waiting for peers and radios to come up. If not, the first thing to look for are error messages on the system log. These are usually due to improper configuration, missing links or multiple instances of the daemon.

It normally takes a minute or so for evidence to appear that the clock is running and the driver is operating correctly. The first indication is a nonzero value in the reach column in the pe billboard. If nothing appears after a few minutes, the next step is to be sure the RS232 messages, if used, are getting to and from the clock. The most reliable way to do this is with an RS232 tester and to look for data flashes as the driver polls the clock and/or as data arrive from the clock. Our experience is that the overwhelming fraction of problems occurring during installation are due to problems such as miswired connectors or improperly configured device links at this stage.

If RS232 messages are getting to and from the clock, the variables of interest can be inspected using the ntpq program and various commands described on the documentation page. First, use the pe and as commands to display billboards showing the peer configuration and association IDs for all peers, including the radio clock. The assigned clock address should appear in the pe billboard and the association ID for it at the same relative line position in the as billboard.

Additional information is available with the rv and clockvar commands, which take as argument the association ID shown in the as billboard. The rv command with no argument shows the system variables, while the rv command with association ID argument shows the peer variables for the clock, as well as other peers of interest. The clockvar command with argument shows the peer variables specific to reference clock peers, including the clock status, device name, last received timecode (if relevant), and various event counters. In addition, a subset of the fudge parameters is included. The poll and error counters in the clockvar billboard are useful debugging aids. The poll counts the poll messages sent to the clock, while the noreply, badformat and baddate count various errors. Check the timecode to be sure it matches what the driver expects. This may require consulting the clock hardware reference manual, which is probably pretty dusty at this stage.

The ntpdc utility program can be used for detailed inspection of the clock driver status. The most useful are the clockstat and clkbug commands described in the document page. While these commands permit getting quite personal with the particular driver involved, their use is seldom necessary, unless an implementation bug shows up. If all else fails, turn on the debugging trace using two -d flags in the ntpd startup command line. Most drivers will dump status at every received message in this case. While the displayed trace can be intimidating, this provides the most detailed and revealing indicator of how the driver and clock are performing and where bugs might lurk.

Most drivers write a message to the clockstats file as each timecode or surrogate is received from the radio clock. By convention, this is the last ASCII timecode (or ASCII gloss of a binary-coded one) received from the radio clock. This file is managed by the filegen facility described in the ntpd page and requires specific commands in the configuration file. This forms a highly useful record to discover anomalies during regular operation of the clock. The scripts included in the ./scripts/stats directory can be run from a cron job to collect and summarize these data on a daily or weekly basis. The summary files have proven inspirational to detect infrequent misbehavior due to clock implementation bugs in some radios.


ntp-4.2.6p5/html/sntp.html0000644000175000017500000001061711307651603014436 0ustar peterpeter <tt>sntp</tt> - Simple Network Time Protocol (SNTP) Client

sntp - Simple Network Time Protocol (SNTP) Client

giffrom Alice's Adventures in Wonderland, Lewis Carroll

S is for snakeoil.

Last update: 16:31 UTC Wednesday, March 12, 2008



Synopsis

sntp [{-h --help -?}][{ -v -V -W }][{-r -a}][-P prompt][-e minerr][-E maxerr][-c count][-d delay][address(es)]

Description

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 cron job. The program implements the SNTP protocol defined in RFC-4330, which is a subset of the NTP protocol defined in RFC-1305, but does not provide the sanity checks, access controls, security functions and mitigation algorithms as in the full NTP implementation.

By default, sntp writes the local date and time (i.e., not UTC) to the standard output in the format

1996 Oct 15 20:17:25.123 + 4.567 +/- 0.089 secs,

where the + 4.567 +/- 0.089 secs indicates the time offset and error bound of the system clock relative to the server clock.

If a NTP server address is explicitly specified, the program sends a single message to the server and waits up to delay seconds for a unicast server message. Otherwise, it sends no message and waits up to delay seconds for a broadcast server message.

Options

sntp recognizes the following options:

-h, --help
displays usage information.
-v
writes diagnostic messages and a limited amount of tracing to standard error. The -v, -V and -W give increasing levels of detail.
-r
steps the system clock to the correct time by the Unix settimeofday system call. Requires root priviledge.
-a
slews the system clock to the correct time by the Unix adjtime system call. Requires root priviledge.
-e minerr
sets the minimum offset to minerr seconds. Measured offsets less than this are ignored. Acceptable values are from 0.001 to 1 with default 0.1 if unicast mode and 0.5 for broadcast mode.
-E maxerr
sets the maximum offset to maxerr seconds. Measured offsets greater than this are ignored. Acceptable values are from 1 to 60 with default 5.
-P prompt
sets the maximum automatic offset to maxerr seconds. Acceptable values are from 1 to 3600 or no, with default 30. If the program is being run interactively, measured offsets greater than this will prompt the user for confirmation. Specifying no will disable this and the correction will be made regardless.
-c count
sets the maximum number of NTP packets required to count. Acceptable values are from 1 to 25 in unicast mode and 5 to 25 in broadcast mode. The default is 5 in either mode.
-d delay
sets the maximum waiting time in broadcast mode to delay seconds. Acceptable values are from 1 to 3600, with default 15 in unicast mode and 300 in broadcast mode.

Return Value

The program returns an exit status of zero for success and non-zero otherwise.

Author

sntp was developed by N.M. Maclaren of the University of Cambridge Computing Service.


ntp-4.2.6p5/html/kern.html0000644000175000017500000001011311307651605014402 0ustar peterpeter Kernel Model for Precision Timekeeping

Kernel Model for Precision Timekeeping

gif from Pogo, Walt Kelly

Alice finds the kernel a house of cards.

Last update: 15:42 UTC Sunday, March 02, 2008


Related Links


The technical report [2], which is a revision and update of an earlier report [3], describes an engineering model for a precision clock discipline function for a generic operating system. The model is the same hybrid phase/frequecy-lock feedback loop used by ntpd, but implemented in the kernel. The code described in [2] is included in Solaris and Digital/Compaq/HP Tru64. It provides two system calls ntp_gettime() and ntp_adjtime() and can discipline the system clock with microsecond resolution. However, newer hardware and kernels with the same system calls can discipline the clock with nanosecond resolution. The new code described in [1] is in FreeBSD and is an option for Linux, SunOS and Tru64; however, of the options, only the Linux implementation, which does not include licensed code, is readily available. The software and documentation, including a simulator used to verify correct behavior, but not involving licensed code, is available from nanokernel.tar.gz.

The kernel model also provides support for an external precision timing source, such as described in the Pulse-per-second (PPS) Signal Interfacing page. The new system calls are used by the PPSAPI interface and in turn by the PPS Clock Discipline driver (type 22) to provide synchronization limited in principle only by the accuracy and stability of the external timing source.

References

  1. Mills, D.L., and P.-H. Kamp. The nanokernel. Proc. Precision Time and Time Interval (PTTI) Applications and Planning Meeting (Reston VA, November 2000). Paper: PostScript | PDF, Slides: HTML | PostScript | PDF | PowerPoint
  2. Mills, D.L. Unix kernel modifications for precision time synchronization. Electrical Engineering Department Report 94-10-1, University of Delaware, October 1994, 24 pp. Abstract: PostScript | PDF, Body: PostScript | PDF
  3. Mills, D.L. A kernel model for precision timekeeping. Network Working Group Report RFC-1589, University of Delaware, March 1994. 31 pp. ASCII

ntp-4.2.6p5/html/copyright.html0000644000175000017500000002545211510477207015467 0ustar peterpeter Copyright Notice

Copyright Notice

jpg "Clone me," says Dolly sheepishly.

Last update: 1-Jan-2011 08:34 UTC



The following copyright notice applies to all files collectively called the Network Time Protocol Version 4 Distribution. Unless specifically declared otherwise in an individual file, this notice applies as if the text was explicitly included in the file.

***********************************************************************
*                                                                     *
* Copyright (c) University of Delaware 1992-2011                      *
*                                                                     *
* Permission to use, copy, modify, and distribute this software and   *
* its documentation for any purpose with or without fee is hereby     *
* granted, provided that the above copyright notice appears in all    *
* copies and that both the copyright notice and this permission       *
* notice appear in supporting documentation, and that the name        *
* University of Delaware not be used in advertising or publicity      *
* pertaining to distribution of the software without specific,        *
* written prior permission. The University of Delaware makes no       *
* representations about the suitability this software for any         *
* purpose. It is provided "as is" without express or implied          *
* warranty.                                                           *
*                                                                     *
***********************************************************************

The following individuals contributed in part to the Network Time Protocol Distribution Version 4 and are acknowledged as authors of this work.

  1. Takao Abe <takao_abe@xurb.jp> Clock driver for JJY receivers
  2. Mark Andrews <mark_andrews@isc.org> Leitch atomic clock controller
  3. Bernd Altmeier <altmeier@atlsoft.de> hopf Elektronik serial line and PCI-bus devices
  4. Viraj Bais <vbais@mailman1.intel.com> and Clayton Kirkwood <kirkwood@striderfm.intel.com> port to WindowsNT 3.5
  5. Michael Barone <michael,barone@lmco.com> GPSVME fixes
  6. Karl Berry <karl@owl.HQ.ileaf.com> syslog to file option
  7. Greg Brackley <greg.brackley@bigfoot.com> Major rework of WINNT port. Clean up recvbuf and iosignal code into separate modules.
  8. Marc Brett <Marc.Brett@westgeo.com> Magnavox GPS clock driver
  9. Piete Brooks <Piete.Brooks@cl.cam.ac.uk> MSF clock driver, Trimble PARSE support
  10. Nelson B Bolyard <nelson@bolyard.me> update and complete broadcast and crypto features in sntp
  11. Jean-Francois Boudreault <Jean-Francois.Boudreault@viagenie.qc.ca> IPv6 support
  12. Reg Clemens <reg@dwf.com> Oncore driver (Current maintainer)
  13. Steve Clift <clift@ml.csiro.au> OMEGA clock driver
  14. Casey Crellin <casey@csc.co.za> vxWorks (Tornado) port and help with target configuration
  15. Sven Dietrich <sven_dietrich@trimble.com> Palisade reference clock driver, NT adj. residuals, integrated Greg's Winnt port.
  16. John A. Dundas III <dundas@salt.jpl.nasa.gov> Apple A/UX port
  17. Torsten Duwe <duwe@immd4.informatik.uni-erlangen.de> Linux port
  18. Dennis Ferguson <dennis@mrbill.canet.ca> foundation code for NTP Version 2 as specified in RFC-1119
  19. John Hay <jhay@icomtek.csir.co.za> IPv6 support and testing
  20. Dave Hart <davehart@davehart.com> General maintenance, Windows port interpolation rewrite
  21. Claas Hilbrecht <neoclock4x@linum.com> NeoClock4X clock driver
  22. Glenn Hollinger <glenn@herald.usask.ca> GOES clock driver
  23. Mike Iglesias <iglesias@uci.edu> DEC Alpha port
  24. Jim Jagielski <jim@jagubox.gsfc.nasa.gov> A/UX port
  25. Jeff Johnson <jbj@chatham.usdesign.com> massive prototyping overhaul
  26. Hans Lambermont <Hans.Lambermont@nl.origin-it.com> or <H.Lambermont@chello.nl> ntpsweep
  27. Poul-Henning Kamp <phk@FreeBSD.ORG> Oncore driver (Original author)
  28. Frank Kardel <kardel (at) ntp (dot) org> PARSE <GENERIC> driver (>14 reference clocks), STREAMS modules for PARSE, support scripts, syslog cleanup, dynamic interface handling
  29. William L. Jones <jones@hermes.chpc.utexas.edu> RS/6000 AIX modifications, HPUX modifications
  30. Dave Katz <dkatz@cisco.com> RS/6000 AIX port
  31. Craig Leres <leres@ee.lbl.gov> 4.4BSD port, ppsclock, Magnavox GPS clock driver
  32. George Lindholm <lindholm@ucs.ubc.ca> SunOS 5.1 port
  33. Louis A. Mamakos <louie@ni.umd.edu> MD5-based authentication
  34. Lars H. Mathiesen <thorinn@diku.dk> adaptation of foundation code for Version 3 as specified in RFC-1305
  35. Danny Mayer <mayer@ntp.org>Network I/O, Windows Port, Code Maintenance
  36. David L. Mills <mills@udel.edu> Version 4 foundation: clock discipline, authentication, precision kernel; clock drivers: Spectracom, Austron, Arbiter, Heath, ATOM, ACTS, KSI/Odetics; audio clock drivers: CHU, WWV/H, IRIG
  37. Wolfgang Moeller <moeller@gwdgv1.dnet.gwdg.de> VMS port
  38. Jeffrey Mogul <mogul@pa.dec.com> ntptrace utility
  39. Tom Moore <tmoore@fievel.daytonoh.ncr.com> i386 svr4 port
  40. Kamal A Mostafa <kamal@whence.com> SCO OpenServer port
  41. Derek Mulcahy <derek@toybox.demon.co.uk> and Damon Hart-Davis <d@hd.org> ARCRON MSF clock driver
  42. Rob Neal <neal@ntp.org> Bancomm refclock and config/parse code maintenance
  43. Rainer Pruy <Rainer.Pruy@informatik.uni-erlangen.de> monitoring/trap scripts, statistics file handling
  44. Dirce Richards <dirce@zk3.dec.com> Digital UNIX V4.0 port
  45. Wilfredo Sánchez <wsanchez@apple.com> added support for NetInfo
  46. Nick Sayer <mrapple@quack.kfu.com> SunOS streams modules
  47. Jack Sasportas <jack@innovativeinternet.com> Saved a Lot of space on the stuff in the html/pic/ subdirectory
  48. Ray Schnitzler <schnitz@unipress.com> Unixware1 port
  49. Michael Shields <shields@tembel.org> USNO clock driver
  50. Jeff Steinman <jss@pebbles.jpl.nasa.gov> Datum PTS clock driver
  51. Harlan Stenn <harlan@pfcs.com> GNU automake/autoconfigure makeover, various other bits (see the ChangeLog)
  52. Kenneth Stone <ken@sdd.hp.com> HP-UX port
  53. Ajit Thyagarajan <ajit@ee.udel.edu>IP multicast/anycast support
  54. Tomoaki TSURUOKA <tsuruoka@nc.fukuoka-u.ac.jp>TRAK clock driver
  55. Paul A Vixie <vixie@vix.com> TrueTime GPS driver, generic TrueTime clock driver
  56. Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> corrected and validated HTML documents according to the HTML DTD

ntp-4.2.6p5/html/manyopt.html0000644000175000017500000003075311307651603015144 0ustar peterpeter Automatic Server Discovery

Automatic Server Discovery

giffrom Alice's Adventures in Wonderland, Lewis Carroll

Make sure who your friends are.

Last update: 25-Nov-2009 UTC


Related Links

Table of Contents


Introduction

This page describes the automatic server discovery schemes provided in NTPv4. Details about the configuration commands and options are described on the Configuration Options page. Details about the cryptographic authentication schemes are described on the Authentication Options page. Details about the other modes not directly involved in these schemes are described on the Association Management page. Additional information is available in the papers, reports, memoranda and briefings on the NTP Project page.

There are three automatic server discovery schemes: broadcast/multicast, manycast and server pool described on this page. The broadcast/multicast and manycast schemes utilize the ubiquitous broadcast or one-to-many paradigm native to IPv4 and IPv6. The server pool scheme uses DNS to resolve addresses of multiple volunteer servers scattered throughout the world. All three schemes work in much the same way and might be described as grab-n'-prune. Through one means or another they grab a number of associations either directly or indirectly from the configuration file, order them from best to worst according to a defined metric, then cast off the associations with the lowest metric until no more than the number specified by the maxclock option of the tos command remain.

Association Management

All schemes use a stratum filter to select just those servers with stratum considered useful. This can avoid large numbers of clients ganging up on a small number of low-stratum servers and avoid servers below or above specified stratum levels. By default, servers of all strata are acceptable; however, the tos command can be used to restrict the acceptable range from the floor option, inclusive, to the ceiling option, exclusive. Potential servers operating at the same stratum as the client will be avoided, unless the cohort option is present.

The pruning process is handled using a set of counters, one for each preemptible association. Once each poll interval the counter is increased by one. If the association survives the selection and clustering algorithms; that is, it is a candidate for synchronization, the counter is reset to zero. If not and the counter reaches a defined threshold and the number of assocations is greater than maxclock, the association becomes a candidate for pruning. The pruning algorithm assigns to each association a metric ranging from the lowest, corresponding to no possibility of synchronization, to the highest, corresponding to a very likely possibility of synchronization. Upon reaching the threshold, an association is demobilized if it has the lowest metric of all associations. Operation continues in this way until the number of remaining associations is not greater than maxclock.

Following is a summary of each scheme. Note that reference to option applies to the commands described on the Configuration Options page. See that page for applicability and defaults.

Broadcast/Multicast Scheme

A broadcast server generates messages continuously at intervals by default 64 s and time-to-live by default 127. These defaults can be overriden by the minpoll and ttl options, respectively. Not all kernels support the ttl option. A broadcast client responds to the first message received by waiting a randomized interval to avoid implosion at the server. It then polls the server in client/server mode using the iburst option in order to quickly authenticate the server, calibrate the propagation delay and set the host clock. This normally results in a volley of six client/server exchanges at 2-s intervals during which both the synchronization and cryptographic protocols run concurrently.

Following the volley, the server continues in listen-only mode and sends no further messages. If for some reason the broadcast server does not respond to these messages, the client will cease transmission and continue in listen-only mode with a default propagation delay. The volley can be avoided by using the authdelay command with nonzero argument.

A server is configured in broadcast mode using the broadcast command and specifying the broadcast address of a local interface. If two or more local interfaces are installed with different broadcast addresses, a broadcast command is needed for each address. This provides a way to limit exposure in a firewall, for example. A broadcast client is configured using the broadcastclient command.

NTP multicast mode can be used to extend the scope using IPv4 multicast or IPv6 broadcast with defined span. The IANA has assigned IPv4 multicast address 224.0.1.1 and IPv6 address FF05::101 (site local) to NTP, but these addresses should be used only where the multicast span can be reliably constrained to protect neighbor networks. In general, administratively scoped IPv4 group addresses should be used, as described in RFC-2365, or GLOP group addresses, as described in RFC-2770.

A multicast server is configured using the broadcast command, but specifying a multicast address instead of a broadcast address. A multicast client is configured using the multicastclient command specifying a list of one or more multicast addresses. Note that there is a subtle distinction between the IPv4 and IPv6 address families. The IPv4 broadcast or mulitcast mode is determined by the IPv4 class. For IPv6 the same distinction can be made using the link-local prefix FF02 for each interface and site-local prefix FF05 for all interfaces.

It is possible and frequently useful to configure a host as both broadcast client and broadcast server. A number of hosts configured this way and sharing a common broadcast address will automatically organize themselves in an optimum configuration based on stratum and synchronization distance.

Since an intruder can impersonate a broadcast server and inject false time values, broadcast mode should always be cryptographically authenticated. By default, a broadcast association will not be mobilized unless cryptographically authenticated. If necessary, the auth option of the disable command will disable this feature. The feature can be selectively enabled using the notrust option of the restrict command.

With symmetric key cryptography each broadcast server can use the same or different keys. In one scenario on a broadcast LAN, a set of broadcast clients and servers share the same key along with another set that share a different key. Only the clients with matching key will respond to a server broadcast.

Public key cryptography can be used with some restrictions. If multiple servers belonging to different secure groups share the same broadcast LAN, the clients on that LAN must have the client keys for all of them. This scenario is illustrated in the example on the Authentication Options page.

Manycast Scheme

Manycast is a automatic server discovery and configuration paradigm new to NTPv4. It is intended as a means for a client to troll the nearby network neighborhood to find cooperating servers, validate them using cryptographic means and evaluate their time values with respect to other servers that might be lurking in the vicinity. It uses the grab-n'-drop paradigm with the additional feature that active means are used to grab additional servers should the number of survivors fall below the minclock option of the tos command.

The manycast paradigm is not the anycast paradigm described in RFC-1546, which is designed to find a single server from a clique of servers providing the same service. The manycast paradigm is designed to find a plurality of redundant servers satisfying defined optimality criteria.

A manycast clients is configured using the manycastclient configuration command, which is similar to the server configuration command. It sends ordinary client mode messages, but with a broadcast address rather than a unicast address and sends only if less than minclock associateons remain and then only at the minimum feasible rate and minimum feasible time-to-live (TTL) hops. The polling strategy is designed to reduce as much as possible the volume of broadcast messages and the effects of implosion due to near-simultaneous arrival of manycast server messages. There can be as many manycast client associations as different addresses, each one serving as a template for a future unicast client/server association.

A manycast server is configured using the manycastserver command, which listens on the specified broadcast address for manycast client messages. If a manycast server is in scope of the current TTL and is itself synchronized to a valid source and operating at a stratum level equal to or lower than the manycast client, it replies with an ordinary unicast server message.

The manycast client receiving this message mobilizes a preemptable client association according to the matching manycast client template, but only if cryptographically authenticated and the server stratum is less than or equal to the client stratum.

It is possible and frequently useful to configure a host as both manycast client and manycast server. A number of hosts configured this way and sharing a common multicast group address will automatically organize themselves in an optimum configuration based on stratum and synchronization distance.

The use of cryptograpic authentication is always a good idea in any server descovery scheme. Both symmetric key and public key cryptography can be used in the same scenarios as described above for the broadast/multicast scheme.

Server Pool Scheme

The idea of targeting servers on a random basis to distribute and balance the load is not a new one; however, the NTP pool scheme puts this on steroids. At present, several hundred operators around the globe have volunteered their servers for public access. In general, NTP is a lightweight service and servers used for other purposes don't mind an additional small load. The trick is to randomize over the population and minimize the load on any one server while retaining the advantages of multiple servers using the NTP mitigation algorithms.

To support this service the DNS for some volunteer servers as been modified to collect a number of other volunteer servers and return a randomized list in response to a DNS query. The client receiving this list mobilizes some or all of them just as in the other discovery schemes and casts off the excess.

The pool scheme is configured using one or pool commands with the DNS name region.pool.ntp.org, where region is a region of the world, country of the region or state of the country or even the whole world if absent. The pool command can be used more than once; duplicate servers are detected and discarded. In principle, it is possible to use a configuration file containing a single line pool pool.ntp.org.


ntp-4.2.6p5/html/refclock.html0000644000175000017500000002552211307651604015244 0ustar peterpeter Reference Clock Drivers

Reference Clock Drivers

gifMaster Time Facility at the UDel Internet Research Laboratory

Last update: 20:45 UTC Thursday, January 03, 2008


Related Links

Table of Contents


Introduction

Drivers for most radio and modem reference clocks is included by default in the NTP distribution. Individual drivers can be activated using server commands as described in the ntpd program manual page. Drivers have addresses in the form 127.127.t.u, where t is the driver type and u is a unit number in the range 0-3 to distinguish multiple instances of the same driver. Most drivers require a serial or parallel port or special bus peripheral, but some can work directly from an audio codec or sound card when availble. The particular device is specified by adding a soft link from the name used by the driver to the device name.

All radio clock drivers require that the radio be set for Coordinated Universal Time (UTC) only. Timezone and standard/daylight adjustments are performed by the kernel. There are difference in the various Unix and Windows port interfaces detected at configuration time, so it is important that the NTP daemon and utilities be compiled on the target system or clone.

When a pulse-per-second (PPS) signal is available, the PPS Clock Discipline driver is can be used. It normally works in conjunction with the reference clock that produces the signal, but can work with another driver or remote server. When PPS kernel features are present, the driver can redirect the PPS signal to the kernel.

In general, performance can be improved, especially when more than one driver is supported, to use the prefer peer function described in the Mitigation Rules and the prefer Keyword page. The prefer peer is ordinarily designated the remote peer or local clock driver which provides the best quality time. All other things equal, only the prefer peer is used to discipline the system clock and jitter-producing "clockhopping" between sources is avoided. This is especially valuable when the PPS clock discipline driver is available.

There are audio drivers for each of the NIST time stations WWV and WWVH, Canadian time station CHU and generic IRIG signals. Currently, support for FreeBSD, Solaris and SunOS is in the distribution. It is left to the volunteer corps to confirm this works in other systems. Further information on hookup, debugging and monitoring is given in the Audio Drivers page.

The Undisciplined Local Clock driver can simulate a reference clock when no external synchronization sources are available. If a server with this driver is connected directly or indirectly to the public Internet, there is some danger that it can destabilize other clients. It is not recommended that the loccal clock driver be used in this way, as the orphan mode descibed on the Association Management page provides a generic backup capability.

The local clock driver can also be used when an external synchronization source such as the IEEE 1588 Precision Time Protocol or NIST Lockclock directly synchronizes the computer time. Further information is on the External Clock Discipline and the Local Clock Driver page.

Driver Calibration

Some drivers depending on longwave or shortwave radio services need to know the radio propagation time from the transmitter to the receiver. This must be calculated for each specific receiver location and requires the geographic coordinates of both the transmitter and receiver. The transmitter coordinates for various radio services are given in the Time and Frequency Standard Station Information page. Receiver coordinates can be obtained locally or from Google Earth. The actual calculations are beyond the scope of this document.

Depending on interface type, port speed, etc., a reference clock can have a small residual offset relative to another. To reduce the effects of jitter when switching from one driver to the another, it is useful to calibrate the drivers to a common ensemble offset. The enable calibrate configuration command described on the Miscellaneous Options page activates a special feature which automatically calculates a correction factor for each driver relative to an association designated the prefer peer.

Comprehensive List of Clock Drivers

Following is a list showing the type and title of each driver currently implemented. The compile-time identifier for each is shown in parentheses. Click on a selected type for specific description and configuration documentation, including the clock address, reference ID, driver ID, device name and serial line speed. For those drivers without specific documentation, please contact the author listed in the Copyright Notice page.

  • Type 1 Undisciplined Local Clock (LOCAL)
  • Type 2 Trak 8820 GPS Receiver (GPS_TRAK)
  • Type 3 PSTI/Traconex 1020 WWV/WWVH Receiver (WWV_PST)
  • Type 4 Spectracom WWVB/GPS Receivers (WWVB_SPEC)
  • Type 5 TrueTime GPS/GOES/OMEGA Receivers (TRUETIME)
  • Type 6 IRIG Audio Decoder (IRIG_AUDIO)
  • Type 7 Radio CHU Audio Demodulator/Decoder (CHU)
  • Type 8 Generic Reference Driver (PARSE)
  • Type 9 Magnavox MX4200 GPS Receiver (GPS_MX4200)
  • Type 10 Austron 2200A/2201A GPS Receivers (GPS_AS2201)
  • Type 11 Arbiter 1088A/B GPS Receiver (GPS_ARBITER)
  • Type 12 KSI/Odetics TPRO/S IRIG Interface (IRIG_TPRO)
  • Type 13 Leitch CSD 5300 Master Clock Controller (ATOM_LEITCH)
  • Type 14 EES M201 MSF Receiver (MSF_EES)
  • Type 15 reserved
  • Type 16 Bancomm GPS/IRIG Receiver (GPS_BANCOMM)
  • Type 17 Datum Precision Time System (GPS_DATUM)
  • Type 18 NIST/USNO/PTB Modem Time Services (ACTS_MODEM)
  • Type 19 Heath WWV/WWVH Receiver (WWV_HEATH)
  • Type 20 Generic NMEA GPS Receiver (NMEA)
  • Type 21 TrueTime GPS-VME Interface (GPS_VME)
  • Type 22 PPS Clock Discipline (PPS)
  • Type 23 reserved
  • Type 24 reserved
  • Type 25 reserved
  • Type 26 Hewlett Packard 58503A GPS Receiver (GPS_HP)
  • Type 27 Arcron MSF Receiver (MSF_ARCRON)
  • Type 28 Shared Memory Driver (SHM)
  • Type 29 Trimble Navigation Palisade GPS (GPS_PALISADE)
  • Type 30 Motorola UT Oncore GPS GPS_ONCORE)
  • Type 31 Rockwell Jupiter GPS (GPS_JUPITER)
  • Type 32 Chrono-log K-series WWVB receiver (CHRONOLOG)
  • Type 33 Dumb Clock (DUMBCLOCK)
  • Type 34 Ultralink WWVB Receivers (ULINK)
  • Type 35 Conrad Parallel Port Radio Clock (PCF)
  • Type 36 Radio WWV/H Audio Demodulator/Decoder (WWV)
  • Type 37 Forum Graphic GPS Dating station (FG)
  • Type 38 hopf GPS/DCF77 6021/komp for Serial Line (HOPF_S)
  • Type 39 hopf GPS/DCF77 6039 for PCI-Bus (HOPF_P)
  • Type 40 JJY Receivers (JJY)
  • Type 41 TrueTime 560 IRIG-B Decoder
  • Type 42 Zyfer GPStarplus Receiver
  • Type 43 RIPE NCC interface for Trimble Palisade
  • Type 44 NeoClock4X - DCF77 / TDF serial line

ntp-4.2.6p5/html/confopt.html0000644000175000017500000003005311307651604015117 0ustar peterpeter Server Options

Server Options

giffrom Pogo, Walt Kelly

The chicken is getting configuration advice.

Last update: 25-Nov-2009 4:46


Related Links

Table of Contents


Following is a description of the configuration commands in NTPv4. There are two classes of commands, configuration commands that configure an association with a remote server, peer or reference clock, and auxilliary commands that specify environmental variables that control various related operations.

The various modes described on the Association Management page are determined by the command keyword and the DNS name or IP address. Addresses are classed by type as (s) a remote server or peer (IPv4 class A, B and C), (b) the IP broadcast address of a local interface, (m) a multicast address (IPv4 class D), or (r) a reference clock address (127.127.x.x). For type m addresses the IANA has assigned the multicast group address IPv4 224.0.1.1 and IPv6 ff05::101 (site local) exclusively to NTP, but other nonconflicting addresses can be used.

If the Basic Socket Interface Extensions for IPv6 (RFC-2553) is detected, support for the IPv6 address family is generated in addition to the default IPv4 address family. IPv6 addresses can be identified by the presence of colons ":" in the address field. IPv6 addresses can be used almost everywhere where IPv4 addresses can be used, with the exception of reference clock addresses, which are always IPv4. Note that in contexts where a host name is expected, a -4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS resolution to the IPv6 namespace.

Configuration Commands

server address [options ...]
peer address [options ...]
broadcast address [options ...]
manycastclient address [options ...]
pool address [options ...]
unpeer [address | associd]
These commands specify the time server name or address to be used and the mode in which to operate. The address can be either a DNS name or a IPv4 or IPv6 address in standard notation. In general, multiple commands of each type can be used for different server and peer addresses or multicast groups.
server
For type s and r addresses (only), this command mobilizes a persistent client mode association with the specified remote server or local reference clock. If the preempt flag is specified, a preemptable client mode association is mobilized instead.
peer
For type s addresses (only), this command mobilizes a persistent symmetric-active mode association with the specified remote peer.
broadcast
For type b and m addressees (only), this command mobilizes a persistent broadcast or multicast server mode association. Note that type b messages go only to the interface specified, but type m messages go to all interfaces.
manycastclient
For type m addresses (only), this command mobilizes a manycast client mode association for the multicast group address specified. In this mode the address must match the address specified on the manycastserver command of one or more designated manycast servers.
pool
For type s messages (only) this command mobilizes a client mode association for servers implementing the pool automatic server discovery scheme described on the Association Management page. The address is a DNS name in the form area.pool.ntp.org, where area is a qualifier designating the server geographic area such as us or europe.
unpeer
This command removes a previously configured association. An address or association ID can be used to identify the association. Either an IP address or DNS name can be used. This command is most useful when supplied via ntpq runtime configuration commands :config and config-from-file.

Command Options

autokey
Send and receive packets authenticated by the Autokey scheme described in the Authentication Options page. This option is mutually exclusive with the key option.
burst
When the server is reachable, send a burst of eight packets instead of the usual one. The packet spacing is normally 2 s; however, the spacing between the first and second packets can be changed with the calldelay command to allow additional time for a modem or ISDN call to complete. This option is valid only with the server command and type s addressesa. It is a recommended option when the maxpoll option is greater than 10 (1024 s).
iburst
When the server is unreachable, send a burst of eight packets instead of the usual one. The packet spacing is normally 2 s; however, the spacing between the first and second packets can be changed with the calldelay command to allow additional time for a modem or ISDN call to complete. This option is valid only with the server command and type s addresses. It is a recommended option with this command.
key key
Send and receive packets authenticated by the symmetric key scheme described in the Authentication Options page. The key specifies the key identifier with values from 1 to 65534, inclusive. This option is mutually exclusive with the autokey option.
minpoll minpoll
maxpoll maxpoll
These options specify the minimum and maximum poll intervals for NTP messages, in seconds as a power of two. The maximum poll interval defaults to 10 (1024 s), but can be increased by the maxpoll option to an upper limit of 17 (36 h). The minimum poll interval defaults to 6 (64 s), but can be decreased by the minpoll option to a lower limit of 3 (8 s).
mode option
Pass the option to a reference clock driver, where option is an integer in the range from 0 to 255, inclusive. This option is valid only with type r addresses.
noselect
Marks the server or peer to be ignored by the selection algorithm but visible to the monitoring program. This option is ignored with the broadcast command.
preempt
Specifies the association as preemptable rather than the default persistent. This option is ignored with the broadcast command and is most useful with the manycastclient and pool commands.
prefer
Mark the server as preferred. All other things being equal, this host will be chosen for synchronization among a set of correctly operating hosts. See the Mitigation Rules and the prefer Keyword page for further information. This option is valid only with the server and peer commands.
true
Mark the association to assume truechimer status; that is, always survive the selection and clustering algorithms. This option can be used with any association, but is most useful for reference clocks with large jitter on the serial port and precision pulse-per-second (PPS) signals. Caution: this option defeats the algorithms designed to cast out falsetickers and can allow these sources to set the system clock. This option is valid only with the server and peer commands.
ttl ttl
This option specifies the time-to-live ttl for the broadcast command and the maximum ttl for the expanding ring search used by the manycastclient command. Selection of the proper value, which defaults to 127, is something of a black art and should be coordinated with the network administrator. This option is invalid with type r addresses.
version version
Specifies the version number to be used f or outgoing NTP packets. Versions 1-4 are the choices, with version 4 the default.
xleave
Operate in interleaved mode (symmetric and broadcast modes only). (see NTP Interleaved Modes)

Auxilliary Commands

broadcastclient
Enable reception of broadcast server messages to any local interface (type b address). Ordinarily, upon receiving a broadcast message for the first time, the broadcast client measures the nominal server propagation delay using a brief client/server exchange, after which it continues in listen-only mode. If a nonzero value is specified in the broadcastdelay command, the value becomes the delay and the volley is not executed. Note: the novolley option has been deprecated for future enhancements. Note that, in order to avoid accidental or malicious disruption in this mode, both the server and client should operate using symmetric key or public key authentication as described in the Authentication Options page. Note that the novolley keyword is incompatible with public key authentication.
manycastserver address [...]
Enable reception of manycast client messages (type m)to the multicast group address(es) (type m) specified. At least one address is required. Note that, in order to avoid accidental or malicious disruption, both the server and client should operate using symmetric key or public key authentication as described in the Authentication Options page.
multicastclient address [...]
Enable reception of multicast server messages to the multicast group address(es) (type m) specified. Upon receiving a message for the first time, the multicast client measures the nominal server propagation delay using a brief client/server exchange with the server, then enters the broadcast client mode, in which it synchronizes to succeeding multicast messages. Note that, in order to avoid accidental or malicious disruption in this mode, both the server and client should operate using symmetric key or public key authentication as described in the Authentication Options page.

Bugs

The syntax checking is not picky; some combinations of ridiculous and even hilarious options and modes may not be detected.


ntp-4.2.6p5/html/index.html0000644000175000017500000002312111307651604014554 0ustar peterpeter The Network Time Protocol (NTP) Distribution

The Network Time Protocol (NTP) Distribution

gifP.T. Bridgeport Bear; from Pogo, Walt Kelly

Pleased to meet you.

Last update: 07-Nov-2009 20:43 UTC


Related Links

  • A list of all links is on the Site Map page.

Table of Contents


Introduction

Note: The NTP Version 4 software contained in this distribution is available without charge under the conditions set forth in the Copyright Notice.

It is very important that readers understand that the NTP document collection began 25 years ago and remains today a work in progress. It has evolved as new features were invented and old features retired. It has been widely copied, cached and morphed to other formats, including man pages, with varying loss of fidelity. However, these HTML pages are the ONLY authoritative and definitive reference. Readers should always use the collection that comes with the distribution they use. A copy of the online collection at www.ntp.org is normally included in the most recent snapshot, but might not agree with an earlier snapshot or release version.

The Network Time Protocol (NTP) is widely used to synchronize a computer to Internet time servers or other sources, such as a radio or satellite receiver or telephone modem service. It can also be used as a server for dependent clients. It provides accuracies typically less than a millisecond on LANs and up to a few milliseconds on WANs. Typical NTP configurations utilize multiple redundant servers and diverse network paths in order to achieve high accuracy and reliability. Authentication is provided using symmetric key cryptography and the MD5 message digest algorithm included in the distribution. If the OpenSSL cryptographic library is installed, the SHA or SHA1 message digest algorithms can be used. If the OpenSSL library is installed, additional options based on public key cryptography are available.

NTP time synchronization services are widely available in the public Internet. The public NTP subnet in early 2008 includes several thousand servers in most countries and on every continent of the globe, including Antarctica. These servers support a total population estimated at over 25 million computers in the global Internet. The NTP subnet operates with a hierarchy of levels, where each level is assigned a number called the stratum. Stratum 1 (primary) servers at the lowest level are directly synchronized to national time services. Stratum 2 (secondary) servers at the next higher level are synchronize to stratum 1 servers and so on. Normally, NTP clients and servers with a relatively small number of clients do not synchronize to public primary servers. There are several hundred public secondary servers operating at higher strata and are the preferred choice.

Background information on computer network time synchronization is on the Executive Summary - Computer Network Time Synchronization page. Discussion on new features and interoperability with previous NTP versions is on the NTP Version 4 Release Notes page. Background information, bibliography and briefing slides suitable for presentations are on the Network Time Synchronization Research Project page. Additional information is at the NTP web site www.ntp.org.

Building and Installing NTP

NTP supports Unix, VMS and Windows (Vista, XP, NT4 and 2000) systems. The Building and Installing the Distribution page details the procedures for building and installing on a typical system. This distribution includes drivers for 44 radio and satellite receivers and telephone modem services in the US, Canada and Europe. A list of supported drivers is on the Reference Clock Drivers page. The default build includes the debugging options and all drivers that run on the target machine; however, options and drivers can be included or excluded using options on the Configuration Options page.

Configuring Clients and Servers

NTP is by its very nature a complex distributed network application and can be configured for widely divergent timekeeping scenarios. The documentation on these pages attempts to cover the entire suite of configuration, operation and maintenance features which this distribution supports. However, most applications will need only a few of these features. The Quick Start page may be useful to get a simple workstation on the air with existing servers.

The most important factor in providing accurate, reliable time is the selection of modes and servers in the configuration file. A discussion on the available modes is on the Association Management page. The current public server list is maintained at the www.ntp.org web site. In many cases the configuration can be automated using the schemes described on the Automatic Server Discovery Schemes page.

Features and Options

This distribution includes a statistics data recording facility which can record performance statistics and events of various types for retrospective analysis. These include time and frequency statistics, significant events and usage statistics described on the Monitoring Options page.

Some programs included in this distribution use cryptographic algorithms to verify server authenticity. Where local security policy permits relatively weak symmetric key cryptography, the required software is included in this distribution. Where local policy requires stronger public key cryptography, the OpenSSL library available from http://www.openssl.org is required. This library is also used by the Secure Shell facility, so is often already installed. Additional details are on the Authentication Options page.

This distribution includes features that can restrict access in various ways as described on the Access Control Options page. This can be used to deny service if not authenticated, deny service requiring persistent resources or deny service altogether.

This distribution includes a simulation framework in which substantially all the runtime NTP operations and most features can be tested and evaluated. This has been very useful in exploring in vitro response to unusual circumstances or over time periods impractical in vivo. Details are on the Network Time Protocol (NTP) Simulator page.

Resolving Problems

Like other things in modern Internet life, NTP problems can be devilishly intricate. This distribution includes a number of utilities designed to identify and repair problems using an integrated management protocol supported by the ntpq utility program In addition, the ntpdc utility program can be useful in some cases.

The NTP Debugging Techniques and Hints and Kinks pages contain useful information for identifying problems and devising solutions. Additional information on reference clock driver construction and debugging is in the Debugging Hints for Reference Clock Drivers page.

Users are invited to report bugs and offer suggestions via the NTP Bug Reporting Procedures page.

Further Information

The Site Map page contains a list of document collections arranged by topic. The Program Manual Pages collection may be the best place to start, followed by the Configuration Commands and Options collection. The Command Index collection contains a list of all configuration file commands together with a short function description. A great wealth of additional information is available via the External Links collection, including a book and numerous background papers and briefing presentations.


gif

ntp-4.2.6p5/html/pic/0000755000175000017500000000000011675461367013350 5ustar peterpeterntp-4.2.6p5/html/pic/alice61.gif0000644000175000017500000002600510017034535015244 0ustar peterpeterGIF89a„´Õð©©©üýIJF ¦¨ÖÖ Ÿ ôøTWgfgwwwÑÎŒŒŒ— [a100üŽŽ„{{ÑÑ J]­«²Ëª[úJM™†W30 ”­Œkk+0{Œ{vq Ì­ovjI ƒZ[Y¯ö& 9;”/yÿÿÿ½½½ÆÆÆµ­µ›œšŒŒ”çççÖÖÖ÷÷÷ÿÿÆÆ½œ¥¥ýÉÉ¥œ¥§}z3 z ^}cÿÿÿ!ù?,„´ÿÀŸpH,ȤrÉl:“/W úzZ¯Xã pÁ\Ù°xLÎÆ&µVk>F' ‡ÌU]pƤ]îû›/8j4 uC[1 14j3;]J-5/ š›E j.'|C. ¢jj 95021SG'3 œ·~/‘j†ZR39 ©30¢EË©0H.‘ѸÖG¥/j 8NQ28Ä©!18¿B¾jéC01î×H/£EQZ¾/4/bÁŽN2è·MßíjÀµ¬š2Zà˜`‘È€„ûzI‘%$Ð. ‘$scA£ Þ›ÐK¡˜{Ëyq"Ù¹ÿ_/þ1˜·3jÌÀAƒÆ"Y\|jÁ`¢½K i’1AM…]R9ò5¤’š€6Äq¡qA­šº¶˜É0ê²l×®EŒE‡†éJ#ÖRLjdŒÈëÐeó^ˆ0BÆ N˜p¸’¡fÓL}´ Q«Å=a.á@[aBâA‹Yƒì„ãUŒ0l*¡à•p!.2ÁÁ`¨Omk1 ’; Ì 0%•ã0 óÒ'ùô‚HГL‹4 ¹óã óm´è5Ñ\8 Q B*4RCL?ì§Æ.‰áò‚•Å0Ï_lXS8)bU½tUÆÓ\Gÿšf‰€-È0‘~©Œ0B4@Ñ„Ž['=i4äÐHäÒS*5LS‡t@ŽP#38 ¥Q·ÀnÀ€CzOLÛiœÀ@UNÀ †1ȼÀY-©†r·ý÷¤# Рä^¦"›Dxa WT>É8æqagjÔ°sI†K5i‘Y/™Ê‹Ú­QÇ \Å M7¹È/ñL€&„mhIdHJ8µTÃÜ P) ]uô 3ˆö~4™C©èUF4"ÇqMz0Eò 3Ô¤暨-¸ã[{Àä(Ç&¥&0Œ°€+pà³ÿD²^u„ň·¡“2IJvNaJq„ꯀžX Lè©/>¡X{çpÙpâí1†¡/ÌpŒIY飂﯎xò'%”q’‘%ß1ÆÂ?h6p *Î`*˜8L GK&žc+-ñBvp‚$s}lñZ^14™]ÆÄxAIa3LÃé10G;±æ*iÀB2Ø,GI{5À(ŽåmÎDÈ•˜ÌWL0Â0#äiÅiãH3c¸pC  ìtʸÎUD 5\^7¸#C#ñd}øøÐdhlÐpÄ âÃßΫC òpׯ ¿‘”Ú--wE¸àwbVEÿC tAH=e<Ãq24ÄDÇ¡)ÐÇØV&¤¢Ã'ÀÎû!R~¬Ä]«¬¬‘‘ÍèÐT„I°AkÄÔ‚Q½4°˜aä # 5ñÉ*šÎ C4ÿB 5’Ãh¨ÅRþ ŠáèJ'䢂›Å ø]z#ŒZüE#¿p€Ë†Wª,P ld¼Õ™-táUÖc‚ƒ^S0:xq”1ÓùÂ1 ÀXj` :Œ° ¶1Ámr+å@7à@P€Fp€À‰VSÞT%–Þ<¡ ÉØæR"ãí `rŠš"‡n5a#[C¦Ä«àO Àÿ`0ÒÜá6e hÙ Ö‘-‹ˆ L0›¶‚:®L- &Òå÷Æ8@6˜c: (àE‰²R%–"ˆÙP–—¥aÐÑdÑ9æ¸Ë283àÓ(=*qŽšL¢ˆ¿7-¡+FŸiìƒQ¸ ÷Í!¦ÑšLš%Â~à ( 18ž "€2%ˆd#ÕDG dò—Tþ‰Aœ# Ýœ™$³ˆešEˆž~ !%ÉgA*'._ó@%ôêQj¡;Ý9Gx@žó¬Ù\ G+&T!`˜@v" ¶!çrÈY@9AÕÌÜ€;ÿä«§?ÙQ°©ê °£vG$Š€øÃß-‰À®ŽÚáÜ]úCƒiô„S©J:~¡nò!ÐY¡Xðâ™f‹2H¢9 ÏMµ ݇xNpœÖt# çsÁ  Gp*9ñèEùQ…W%ç0^KSÍ切9eç0;0;R@EV³š9Å-À@!œ|8傆—NÝá É‘ƒðp›mqçé”Üà¶T UÏ\²ÓБ‹çYAŽ£ cöèÆ¥‚ÿÀŒ?È@$a”Ø|4HÅk_if„ÖR¬ôLÂk«ƒÿ‰åfU€ :ÉÄ'ÕnÞÿCcza\±ØÐGŠA +»â¼jA EÝ7ë$žªe-ˆ»&P8ŽÀ¶Iô$þÒ†@TÁ…¦ Ê·j A¤s xd@î „˜D<»¨£À*í,¨…iT:™Éc4¨ø ¿R3¢G[t@þÂùŒØð U8‡”’³-)ÈàlF` ¾Ög…®Üß2Mv:9Ç¿ø#Ô×Þ¤6 k‹çðŠƒXÜ!ÉÉ%Bz#¥Xô8î°n à›Âzz‰h@órhµ;ÎQEW~b†*¡*L)ÐAp3b5'øè.» i©¨—È\\ìljŸ#a¸ñmÿúØ+¹-;)àéYÍzÖ(@ËêdÅ=Ÿ Mšf—PÇu§!š¹…‘ÀmÕ Ô‰¯æXà 8åŽ'žd6Qgl2ñ×I2Ä €'SÔ•VMàÎ `A“|T:˜G‡½Àઈ@Ùù(— <@†ŽÀ}dÛü•ËÛÆã‹G €:d"28ÁÄK4O×#Xc BP…ÎmÃèÉ]oü&…Òf÷6íb¸S€ƒ þ~gÎCðT¬xŽ•§'—ã¤ÀáKXíý:àNø`|¨3…àÌúaƒì¼ Ž)}<úÐ`ͳcÿ¤È*xv €4Ú70^|Š1½"ò¡ T(˜k”KÓWy$Vý »à‹aX<†øK”S,«– ìpçNrÂâ·6ÐùŠãT%žÕH)0)Á)L è@ @°!Šgࡌ¿P«‡ƒ:­é8»¤ ƒûëÁnÙb°,@ü<àñ6°-pp™Ô'õÕb’ƒv ’ÐF˜’–]pdê§^†ö°0ˆ?¹þfëtV·—LdI5Èvh¥¶y;øD ÐW=ÓLJR;ñ Lqb=@‡hfC ¢2%èV=)a¯Â Æ#Šð²³> FD'X«s ÐI/Gžµùx޵Sv¤sFâ]Aå‰l˜N[üRqº:°neÐà—iøÃX×FÁq_Ù˜@ÿ”3v¹„Úé=sBàÐs@yQ#?Y›àXDŸœTL¼Ù—ñ¸€Û6ÜaÇt§:"65˜jp“V£T0Zô‡š Y1!@9'pyÝv* …”Φ§*O  kØ„yy-j}9E¨‚))#S'‹`sù£° òÖFS'*1@DÌÁu˜qVc"ÎV.$ÙÑžàlèlÇ·ŸøSvEÕ—JÇy´IÛ¶jy4%Ñ2áekqU)§dçã tlêÀ#Ý…Nzp„Z`ì0¡†YD€g$sagžµiJOφGÿÙÆnÔQ”äyV'aV°A>ßQO×h ŽÁ¤£†<Úz ’y¡¤{:¡7zžÛ¸Dp?„J¢¶ª "¸u|* ›Ð4çƒG Ös p“½q"''Œ =Kq"‹,qŠV™¹”‰ž=–mK˜NG2p†@`³Úž°y«Ÿx*¨+æIùT-õ¨ød$"• DKö âã@ŒÆAe=ß!€V’q Û˜qV‚ŠžÃ¹ó°S®·ÚžÜæ¡çÙ°DP4Có›Bt6ùgyHÐAb‘ðàQEäT%æ è´FÅÅÎÁ £ÿÎq*r Ïa¯±+®h¥” `bQ ˆ°—ˆWHÕ#m´ |tòXlg5\"µhqèDŠŸ·x(7*’ÑZ ·G¨ÆG¨‡J¢‘TÇ-6k“ð*ÀXfmÐÿªÊŠ*ç-b‹ý‘·ë3kåµ;H÷4vê$qÓÀ#Ž¡¹ûw|$ vž«¹µ¹žÞøz÷¤z‚‹†Të¦P!W $Pfסr…#­×†‹ ÚzùjДm”£‰'±4¦À<"›“„z±@®ÎKR²ÅJ¯òô[ð v‰GÀPŶ€µÈ$ÿà2tÐ:ñZc7Å•L—mÝØ™`—%R±õÛ¹íI·ù[›#à¼é&[5LÓ DêW p EÑ¢bCÄã+ °2ê܈;@yé´ÁgÅ :¾bX…°7€¼s+ŵù³ùk| f)²r™ˆKJª0'› 3…K6 \a‚ê%+šW”S©L‹”æ’aÃ9±ü´ø®‰Ê—AƒÛPJ‚?—SÒS\#8¤“!ÖY-§HgÀÙá)§À³<Çgu‰Í±@Å&̹|sXÌÁ—-BôVSN°a‡W¦Bư9<‚#. ÿâà{6ÚÓ ´`sUÄ—ÈÉ ¯â Ê)̹úWÅ;HmŽ`$–¶ÔPn%[À1~$¸²A©° ƒ’ \fî…Ĝܑ h$ÅTÜ̞˴W­7uû f;!0°8ÂGc µFYª`‡nj5tU^"—Ƽ\ tXR¿þÏ {“‹Ä^u §‹wšd'p;¾<.£<,ø$@©0/±TÐ=12/P3 Çs Y‡‡€¼#:·WL¥ó„?x¦cì]ôl¸ÄÈtiGO0‘Ac35Á-Ð^—p'Q6˪¬¢Ù¢ #ðÒ ½ƒ<~“îüÎÆG|ë©@ÿýñZ"ÅrwÊ.”c%!; %u²„.° ‹4Èð#²ȃp^j p£ñZY?ÏvÂ0 Ï6±Ê{Â{‰?==t Q”³güÑÈ!Ä £ub"Å =vý/ÌWs:†?µÐÒ+B:»É¿)ʃ~vØÕÿvžV<·ðr—¨©Óà¸â` Ò1BX20§Ñ—ø \€8â49àç [MJ¸Sá ²s°¿Ùo¶Í‚9™°-~ÈkÓÚ_`œtŠcǰ“‘î=°Z/*ñ°´¢HœÓ9ޱgq3°´2,‹]ð Dd ú›ÿÇ«“‰+¨ÐÞv(‹*`•‘G¡vÜ <2GAÁpB9=’5 h0g^åß@–÷SyKMÐ{-p[O¦q$AÁË0-ØþF—åm© Ð&0²h‡†ý¬²% ;%¨’„qèt Š~³ +*q'HA:C° ‰‚lF-° `ähs³ßQƒÑÜÜT~¥ƒ›V¼ä°ä€Þ0< ‹À£—È'°°@16’@wàŸrß?Æ h4 3)]\Ð2Ép·ÑbW­0ÈÀ ]6ìê)M }Vš;ÊXz«pëÿ·Þ pëÐëðr,¾%p #²g—ªrÀ ÖÖÁc’A†G\¤Ã2b"’\Í#>¥a?Ié\Ô 5™møK®·:±`¸Îëì^á&`‚Nè<­ç‘y@$b"Wà%Iò G&l}ÕL¿ö1ŒÐLרz 5sÆiÝ|oà *b J1WÉáÙúw¼-ÅpëèíÞîïNΛf†FžÓ<\aM¬Ú¿Á7[Pß¹ôGh°RT@=[Qó3bẤ>ÁOÒ^ÂqÁ!Ç{I«ÿÖçè‡=!¯ë#ÿñAÕ¾ÉLDsãO"çÛà)‘õÿ.$k!1 ~QÚË%÷¤ÏÞ15ç4 gQ3­ƒÒ­–ô&¼Ç÷îÛ<ïñNï»NïøC»þäp€gúé ú¹Ôc%AÕ,. Ð;aC"ç’@‹– }'üÃ%@S°EqrO»Ä#´Ñ®?ÊÏ–ø~§ Pá°ëLn5ƒèw:­‘µ`)Ƶ#Ð{Ïql…xD€¦~5NbƒÕwP´¢D÷j€µ ÿàÖ¹‘ÅTÇ׹ݞßë¸.øÿÊî 0º?T„OÌ0­ÓŠ¡ &¬ 'ÆÀ1ü~1$w:Í^ŽÖ”J­Õhÿ1*ìÕrq8‘Ž¢«µdÓÀ‹6Ëh´E!Rx¨,ÀC¯Òë,,!   F F\pê"Zº¨dh./ &\\dn~&^–¤ppªp§``¨f@I8ˆ:g^&¦bf®Ž "æøþ,¨õò&M»'ÁÎ-GF."¤Z&j"ž 0NX×ad~¼µÄ24ráŠpŠƒ_ H 8ñ‰Œ1´˜ñiŽ2Ì€áÉbžl€ª `ˆ›·D’ ¦9 .Ñl7b4*'@8•*#ù\Ä8ëEš «Ì‹ÿ3CŠƒ¤œa0‡Á .lfà¢T •°¥ôCÈ‘9HáS”oDÛ&òà:©F,'¢á QÇA]p1 ‰ TA‰J­  dD˜PÂÅ/ŠÀXÀ¦Æ®-`¸ ÑjšIk'ÿ¨ðÀœL™ÞØÎ…0„¢Œò8Q#èéΊÅpQ$ø‚#_$eücë‚8zsÑX I_TœACÃŽ10XµK$ {RP „öO “*Üš©-m ¯š .ŸO4`Š ‰!†UN ã9Pê‡#¦ûAâèÀe†h`H%Ÿx¦¡60HÀèzN ÿXÉ@®©†ÆlÎAä.G¸€ÿ1Á„{»‹&UˆÇ*Nx!‚"€½ˆ!€ dÀÁ…¥fqø:­ŠâÚá •*4€§< Àà”ØXí8¬!6×Ъh‰róÆú;¸C@øÍÀFø™œt!X¤òÁ.ÁK$®¬¡©(“R¹$#*0HµÍÈ+Áâ€;ò¤ÏZ§@óóæ¦q(à››„•k@oiÎ)2`„NòQ…J[ÖYŒ1nq`-~¢K8P"`h U1`³Í¼¬Óî:­Ás[¯áƒ›sË¥DÔ©Ä„ÿf*ð! ¤«‹–Mã:ò!¢€p B¦£G£\"Ĥ€%s «€0ÈG òš@S²ÁäkðÌ>}KdÈn!§€ÞÌ)à.›s$Ñšö΋à‘gŸ=a艔“rÑ ª FH—zn‚åN¸µ€ÙZC+@f–Ƕ‘ë›|(±y_J‚çÈàTxöÈZØä„ˆ¡òÖtË¥… ¡Œ9‹ªÆD¹¦ÉK¾ùiÍ‚,ˆëOq¼É1‘#AÇ{y;/T k‚jøð¢Tœ .¦‹!¦§pÏp\ˆB7(1צ‘okJGÄÿZr©q,™¹óÏAŸ©çJ§ Îã 9!´pÁ•édX²¦†ÁÛ§03¯v/@†Lz õ|—r˜þ$;ó¶ §Ï£¤Ä(pª¡ÁÝ 0Æ'8û<ôŠ]¤ 0@Å)„œ e~{­^s‡š$¯W‘ø#‚•Cü¨^1sIK€“8\lë84€”b­%LøRˆÐÂåÅT¨”úd€AùL.~%K T`<þtƒBDZ ñ›º,ï^(ìYõ €‹!, pØtˆFÌÀT¸ÀN"n aP2 €’É¥¤Q#ŽüQ1Q.Lÿ!¿d–ŹH}BRp¦P!ji zYÅŠ)ªvgºá~Hª 0%kâ56ViÐL.è°ÍN S0šó_R5P±qŽ•„G,C¢pò ’Áƒ¾3Švà%!Pé®´d^‹„M%àÐls(4[\d2¤¼¤€ˆQA^À—Ñ€¯‡>e>šƒÔáÂS‰ë€ lÐàxM~ ´F *A¨—u„²&9@M‚-·qÉ…®.¸§.à‹d ²€ iAR âø¡=eT‰ûØlp€¼Ä/^~¬Q b‚<^!ªe£¢Íi9¬ÿÉÇ—ÿâ T±G—p‹³»›€bpp:TÉ Ð Cû Ц{êscÈFk(9ApfB" €äÐãÁe»\¹¼Kœ ·¢™Ö1‚PdèB^@P¨êP!A4Y@Åžä±$@*͇lp’ÆáI’0«Co2$èYÎ…-3Ç@]ò£oü(ŒTXÆ*µ¾MÍ⯹p˜<¾‚·ø€.uÜ]ËØ|t€6`\ðþYÒQš–µ:ûY²1o…\|¡°ÌZôu†Yy_ \f!Ïfp$ÄÀyA)σ] · ;)>09h¾K¨lWeƒãÿÍ I³w Ò®Î! BÂ7aûÍn ¥¦¹jµ×JÌ+#ƒÓ‰4 ÈÂz‹Þô®#=@0@άb@ ÀDÐ<¼ëVz¦ÐýÍë„°GZówÐP  ‰dÄ8ªèä«XZ…Ž Ç4†°¦íðibÇÒÁè@>X…1 øÍ¬ÆÌö8¼UÌÆ™£Äf•ÚÌ 8L Õ)z 5ZF aÐbˆ$Ú³p˜l@¨Ãb¨ò°œÛŒ€Ë6A "Àĸ©X_Sè‚SPÐvƒ…—@žC¥—¸  8ÎQƒ=ÿ!°«O+ÿÑ!pu´¨öä@€•óQEó@àAoÐeÐA(íéæ#Â|”NÄÁ©:Žg ~bbHªL„a‚'ó8,÷³€OÊÂK…Ø .aayŸâjE÷¸ âŽ)º\ @Šy‹O}¦ÅƒÀµÑÁƒ÷DRV-p‘ÜDÄ¥9(g `Çøxy/¶Ã µ#8@€ï}½õ<>«¹uÙ%/yŸ¸Ë È<ÎY0€èWVÉOþ‰{¶¥ïd!=O= †L¡BÂ#Xà àª_a ˜… ¸` ˆÏ@Uþ}<ìûŒ UK•õ™¯·¬o£ìîÉà\4 ÿÀœÑ> ©$ bœ¥÷â0q+¹±Mˆm d˜éR®ôo¹‘* \p­‡žEöh9ô*:`'q: ¼šñý?àH%F"`®¦H·åQÊñºÎø¸‘ ’ëz #!Ò!ïïÜ1`>%@ Cº„”" ×ÏÂpÏN úñwüâ ô0Lr1H%j$¥²'RŠßx Hq!­(oñ à j0h"ÄÿnS†ÌJêÀö¦?`Rà+c|LëQ¦Ä@Æ ÆÌÑ'{"?†Và"'ŸÅþÿ²t µ8w1X¤Zøê(1N`HÐÖòžñpÀôŠ  ,ªgø*uh&J"€-/à"åÒ'-aæa$Öòäz@ب 1ÁÕ` ©à\m´%kíyâ%.yBA:bÜ*0LÍz‘` Ä!òÊ‚#)Ûòþ 9­+âl+Ö±  'G]:0aªsÕàÀ› T„(B ò€f}(™pÁ=~!ë'j EßDŽRá#›9ûŽ”¢& ­Jƒn±u|3`604õ¨Â é,“vFnÒU8,/ 8qRœeBóâøðÿ³gD$4ô2`†*±µ²£aà 4;˜#q´'±Ž¡ ¡„”d>u)ooá0¡+ <'Ôübà–àn¨žÀC"îE›æ &(`,ÐutéFuÉ¢8”J¨p@EíIÄ èü˜€ÎëœÁˆ&n§ôÌ ž4ÜZ@ãª&­4`dK­ËÞè2³ÓGf{Hi)\€‚á´K"Zs Íätñî!šãàÔ—rÑ{æàIÍ`†4oðÔG=58ƒÐ‚CL£ƒ`è@K’¢ –3 ãu*†'p‡ÐÔmR[‡vRUððÔkabOñ0 òS…µgæa@‘Õ@D ‚ÿâ48t < $NØYç¢2´ä )h2¥ :Jƒ¼"K›#w<5­SƒtH cÀ7GãÀô:ƒc",ŽintÀ¢^GÕJ‚´'†®êˆJŒ€\Ñå,É5"Ä‚î–.CR#$Å"8ÝáJžJÝB@qòJD.0B¢¤kÐ#±Dmc> ”ƒoHIfà88T â´€«®&žÃa› ‰h@‰0”÷è@3Q1T!Bš´!œ…THeHejo2>Àt`é°À>75‰j€¢cj€Y d8åJ@K¥ÞmXL Ä9 Í9”)¬%: ‚KnÚ}XyYakà*¼°öIt ÁШJ¬Ä’B1¢€©†(R \r²‘üSëLäB"ð¯9Í|Ü·Ži1öaéÒ(Rµo%"У ¼xà)1ˆ ‚Rã0þ¼d‘T¢¤=Ï’œz‰OûMLagÓ|1Ì@[‚í÷ÄY/ƒR$b"FhžÅTxûu ]”eQ<÷àêL`åšJøÁÇÑèÏ—€}‚a‡’é€Â·“Ì*ÿ,1VݦÄx ùÁjE²ÒB ¢0'1AÝŒf.ÁÊ®ì \8ÂYâa”q‰£; &|‡\åüì¬Eœ’'¸àhˆàBx Ô+’à¬SƒÈÓ)$â5ë€óv0tTÂL<Á&”ž „ÜHa Á;àB>ÒŽD£JL ‡°$CXd@àº^S×#>ü8%¹yÝ·9„7âeþ ó¶7q”RRSö@Ú5‚K!~æÓ]™5Ô”S#C^€E.41òÂä…ž1ôæÀ?uΠØl±«ã,öé^U›cè)΂ô⩹¾®Wé]ä+žþTJbºì£"[J¤DXïä]îñ>ïõ~ïù¾ïýþï?ðð ¿ðƒ;ntp-4.2.6p5/html/pic/pogo.gif0000644000175000017500000000357610017034537014776 0ustar peterpeterGIF89ad´¢ÿÿÿÿÿÿÌÌÌÿÿÿ!ù,d´ÿXºÜþ°‘H«½8c¦þ`(J7žhºpD«¾°Æ­ßøÒ­vî«3…ëG”Alâ’”0j–ÞȪYI¬5;mKÛ'÷)( Â]”¶u%R¡y~Mƒ²È~¿—æ€uvcB|‡zH€‹g…ƒZˆ’Œ•kLq4’ˆ[•‹Ž˜<œ“%Ÿš¢4‘‰‰“¨©e—¬+±p»-‡±žµ«v¡›¾Â¿»°¼ĶÈSÅmVpÌ-Ì¿}À‰ÑÒ·×ÓʾܯÏ,ÒÖ¬çµ[;p|½áâ‚Çó©V´ÝsöeÀ~iþÑSWÚs ?¡ñïŒ=tŒ D¸¤ÿ…¸_ѵ‘8qJD€ CŠ´²‘ UÒ1GÒåK… pª¤ii\Geö4˜Ñæ ˜BCòÌi4Ф ‰Î4æ&R¨QY%‡kV­ªÈÕà啨µ°˜°,[¬-±Éz­e;õ$ÕjóÍ¥»²œ¨±²öòlͧI6“`IUE˜±a“¼:„HùlÛ¦/9öVÙ™âÅñÒÊ*Å« é`W§ýõÜçt'רs®†íúíÒhý±¾š··@bwûn=œìû7‹kVnüí1æÐ5Ïdƒ<…mÉÑ}ÿ³úøÅõ|¿še‡Tkw “ì]ß<¾O]˜?|϶¥¶öˆTyˆ—5Clÿ¥±×ÞUUåŸ@€]ƒßg• 7*¸`þ<¸N7æ,˜ˆ<“]È}5t£a|Ny¦„‰hƒâˆ$zgâ…½xøá„çõgß:ßœ¸NqõéÕ" =#,2—`0B$”á‰y{þ òZ"é$yÂ䃤’šÍÇ‹‡ÚˆÏ+?ªqš—:VIqë•‚pÁ”¤‘“åÓÊaÑ©cdd|n˜Pmö6ås¤e(™ƒþy(oPºù&œøx9€‘:z¤•J)…\Ê ¦ºAŽœ‘ö©iD|j¨–«²ˆj´™¬“–¤[/c–*ižXz¥£…êM’nú)~±–†‹ÿ¦ñØ%ƒÄ.ËC†Xz«¯°v¶«,lQ]±Úb:Ñ·ÒN{·pí²>¥[nGÔu’Ë»9¸‘«²ÑÒ ƒþqA®¾„h¢ ü °.ÿëm·ÿºzéô …Á ›‹`ÄS\ñ6‡hºW,C#HÇë+pÂ&Ó ž@"oÐ1‚&wüðºiµñò6ÿsÀÛ|1/ü³רsñÊ7ãÜÓM³ uËG‹1ËJ£ uÕ<ÔLÉYG0×Þ^M3ÍZGMvÓ_vÂpWÍtÛí,vÐGO 7Öi÷œòÓ|C aÔƒ‹³ÞK~vѶÒ;uxõ€í1ã—ëwxÿ‚Kþ0åI{9äu»=yÝœª´Šn‹¾yè+›®3æ¬OÎ9“•ãò:Ü8ÊNú赃K2ØÀÏ^ø«·&`î«Ç´¨ŽGÞïÞÃïm"À9飶ƒOB}¿Övv_—*÷ÖN` ¨½åujÉ£ùòzNÜktnë'»ˆ®ÇœüóË#þ™ âŸÿ_¹òßšžD?‚ÄÉYŒ*`²Ô·§ÚN1÷º_úƒŒÎ¹HLµâÌrüâ€òü h¦z£TuF 8qš¹Òµ¾y˜è7ü¡¡Bs%f}aU¯‚”Yœ£†Ó‚Îzf nçU(W@oD°P.lWjqŠ*þp‰ñÚLŽÿ*•®(Šá)³èŽóÁLX¯TÔHa¦1"q;’i@•ˆF*-8Å~C<TïX²(Ë ÇÞ=*X¬ªE4Øx=ddŒ£|HHK”’¬b™’ÄíÆ:ð›“+ªB“˜Ì¤& 4•_…²{ZÔIMi +Òr&nd$:¼@Ç"*æ8"¹e P©[¾q(5BH/aq28ôä–A"óFY–ÌômÔ•%6J3•ïˆ '¯É,ÔK<“5ÝLz\†œ_4§ÿn¡–§ðeð|Â&ä5ÏØF—Ô À"ÉÇ!쉥Á’?MÄhÖ²ÉÄø|Tÿ›B$Ž€@å4‘©-3>cPŒƒçPÍi ’£áb‚:…C+¡Ñ¤å,×.jÊ|-åŒ.ò1C™2²¦†DÌd‰Î¾"šì'P/ ÁO2Ƙ ë‚O ~K.c9»Ó¦wZUa2Ó «¨]ì5_íèÈT5«nòo§âJ«9ÔP\¹µP(Tåú·k­´­P4+ùø*É Ü°›» K TBà °YõÔ^É ÆåH}"ªdŽÀ¡®-j¯¥-8äì¦dªèK!R tUQ£ ÂÎxš…™Ä¯OŠ*°FXF™ù5´Üš,BGxÛŠÐ¥®`6•Ð#ûC¡u¶t⬧ո¶¢\îO $[¦b÷†¼(^&s©Ýb‹Ð5oGkÞή&¢“Ðg‚6'Öz°¬n;-c赑{ 渒ïmÖ¼¶Ê67ô›Ù¿þ-¥¯¦Ö7Méž­' ½A¶VÙyk(.w {šçåm«wòUH»)ìõz–ÐÒMª kH†9ÖŒw¸ÿ]e·ëdU}eí ´6×2y¶ºl;^æ©[×:vM¯É{é¬Ý[˜XݺXölõ_^ç6Ÿw¾Ý®ý G]Åým£k#-ûœü¬­h|Ù]`†YíkœÀ_³õ“6œzÆPªd],Ä¢Èe{Yô¯¿ÓönþmŸù?ÑRwUÀt´_[wWS%£Z¶‹Lþc_³ôoÿ ©[•Ôú…,£¥9ÊǵÕËžÆKé1Õ¾ïÐý/fç~b@VÀ¥(«µv^5§}Ý?Ú[ëa4ÓkC„;óUÿñW3Þ³~Êq²w?#í kÞHo¦"Æ;Ô—:ªvÛJ8¹œFW–ößÒæ¹Õæ˜?¾ßc¶þ{ÙìCnev>·²ÐàͰêËK¢¸o¨Æ;Ùô¿šõ?Gô­¡»§vs6äŠîŇz~–U¼¤ìOP{Ùþ÷7úOôjWeÐì^£dâ¼M´¹¹Ž°=ßc®ÆoÉÿ„Ýéªç6̶edd¼[cÿWìbC6ë”Ýìý;vþ‡ìß ú·ó—!çuF?¨ã›¯õrž×YV1 k¤dc—zvþçÙômˆŸèv:Sz#íûtWUÔTÚ™H²Û kí³Õ¶±KVæÜælûMÊåŸ_:+r«ÅmYoº×²¶H0a fïQÿGܲsóqòëcØ-®·µ€ƒ«Cêež›Ûô˜öÙ[ýŽT1+®Î§ˆçq¾­~j6-Z?ÿÑõmv}µÄv.ªõN±…׳݄ÖÒ×rÝkëªÐ[U—ú˜”²üž¡}[ý_•ý‘yÞcúÞx`Ì¡™[³Ö±îäðØ·sw­>Žÿ­S¨GO̳ìJÝ[˜n5Šê/oê´—¹•2Æ1¿õ´ØÙñ>¯— E“Qï/Jýo;/§[ê¥Ù$h}jÝ\XÖímÌÇ­Öío¦ïN·ßúÂÁ³­Ôë]˜Õ¾ë6RwûOÑöÛ]ù뾫ëùúÙE…Ïs²Ú×N•6¯sÞý»™ïÙ³ü"&Ö†dÛ—ˆ.nUïmy–ú¬kô¿H÷±Û¶ÿ!8B_»/±o½‹üî?ñ¢ð÷uì{ÙcŽÑai;77hhN¯Í®»>Íoç©»ë&;ƒÿÉØþö†´‚é¯h-õ(÷~Žß¢ÿSþ ¥Øæa}gÉÈÁ£ªÐó{žë±Ãî¦ÏNÖíÙoèëc7»þ[·ë­Ö[[ñŸ}vÙ¹Ïć45¿§³Ô£ô¿¹ý„¸eû¥^î?óÿ/ÿ917î6€6íØ×ÝݯçúCÒ ³¬µõ+­õ¸÷kÁ™çvíÛ÷)w9/ë%ø×]O¾æúvVY‰½Í,o¿Ðg±Û½‹΋ˆl;ús†ë»Ôdå߬V=¾öÿ4ˆ„ÎÑ‘ú(eÇÓ$>’‹“õŠüŠ]E´Vá´¶½Œ‘àïIŒÜ£W^Å©»jÆ{,2 ¡À¸ƒßpw±Žöµk» a—87§YhhiÜËÐtqµß¤ÿEµ¿T=g4WÓ.ci©¯qÜÆÛì÷5Žr>ÜÇèKìAÍ®H}e3/ëK±ê6ä>æ°Ã+-h,ÓéNÅgO©c3(ZYŠÓé¶@/ aÜvÖÆ}s¿9¿Rrl¬XÌ|p× äuñý ßUóº}”n­­78š›MÆÂ\͆6mk=ÛÛô”QÉ È@IBqR©%ÚêÝE·WÔpq¬ª·eWh¤í/q-µ¶ú±·ôõ7³ýÕ.ÖÛo\éÕ¬h³&¶Ë™»úé°ïêã¬ÞrÙu7äãÙ°¾¶hækvÒÆ¶¿s™ìÝWç¬:—YÃëC#$æÕuVº¢Ö±»Øṕþ¾£?œsT’„€Ô§PÂ' R¾ÆöÿÒÖúµõi½4×——]@ZÀa•ŸÜ¥Îúvÿÿþ·é®_ ¹úÉÕ‹AÙ»$´îHÒ]ïþÒï0:“mèõujñì~ê…¢€Ó¼Ÿ‡î/ýâzUYÌ˯–[s®°czž™{^çdµÔ?eÕ6·¹¿g¯í—élTùiÊFf{íÿ ¶óD áè–λy´U[lqÍÊmxͪÆm{›±­ s¬m³ô³ú7ú/Ü[c¨Œ~™öœvϪf¢Ðunö¶w[éû½'})³ÕÿB¹6[››•n?üÚË;·z•5Å®ù·0¹Õ žßÑ­¯›ž0î³#êÆ}!זּÇd<¶­›ZÊ马Û]nÙïÙûÿMMÇãí 8 õû ¥Ñú•yÝW!¯¨‹(5±®²Ákší¯ÞÆ:·z{=&{ŸüøU_«õ×Õ—•K}OM˜åÅÕ¹¬üâ×»ô§Ó©¿¢¯ý«é~Uè™ùõÔr±~¬æ?|µ¶0ˆ Zæ³ucý©Õ:®CúŸ¥wÕüº®·iôÒ/yoéú=»¬ôظ;´+ƒZ×ìzlž£s:7Úë¶àÖ ¯±¥Á¡ÖUì6>ç[¯éÛK…ÇmŒ·ú¬sÙ’ç‚ÊØÙüϤýî¯g³ôþÿô5®«#¨u±?ýWê0€È÷NŒýïrçqz†Eî}”tLǸê:¦™$êÿÑûw%î 4GÚ4íµýRŠœl®§ïc]Yl¿p ôëeÄPÇ»wóÖè¥Ý}\³//3 6¦WkkµáÂÒßÒßÑ×½¾ÿM›*«ùµÇeç^ʇھ¯çm°‘60#lz>ïcœ·iêýn¼j±1¾­õ ñ^Ãg¦Hs¯ªçzŸôê{Ñ9 GÚ£ŒYßìj¯n¦¦3öEk³ö‚KÈö7s}/nôl_¬c®e¶‡àÓ‡özݵÕÝêïu–â°³ak?5¾¢Ñ§ë?Öš(ªŠ~¬åµ• ¼V% q®1Ûýoz¥Õþ³fåÕ•gÕÜh--fæíw¨íYS?œrdc‚$Hp‚?¬£îF¤9­ÈÎËúÏÔñîš2 ØL“[ë(Ùû»^¹OIýG¯¶°ÏSÖÈ’ÃÝ >gù Zø–õ*zõø¹8ÖbåeUuT×aÚâ뇭E§·ÛúþÍìÿH¯t N•…ž:¶tý±ö[öŸnßÑ–1Í·/ªíwè1Ùcm«þ¹_ñ_¤SÊ`ÄX„uÿÓîqý(vÄ ±Ä~nØOú¶çϧ·OSnßfýŸÊú ç–8ØyºÝúgô›fߣ>ÑlîëWúOûu©›é“¦æ?¶ÙwÝ»Ózù%9Üß ­þsÿýcN·ý]¿ï¥ÏÓ3¯‰Ô»UcÛ¿o”Çà¾jIW–Ý7軳ô©ÝoòúHnõgQgÌ»û—ÍÉ&Ï¢ø¿Gdû¼õw÷'=üù‰_8$”w\_¤Lw™üP,ô£¼ë?ëôWΩ)J#õ}×­êÜvafõ"ËMw]é»)´Çë é8ÖìªÛû÷eS³ý×<¦ñK²ÃÆ9`µ¥=ØMy~;=Þ§±Ž²ÿåú^šò´•Ÿòpíý_–ÿéñœYž]üwÿ ô¸ÿÿÙ8BIMÿâ XICC_PROFILE HLinomntrRGB XYZ Î 1acspMSFTIEC sRGBöÖÓ-HP cprtP3desc„lwtptðbkptrXYZgXYZ,bXYZ@dmndTpdmddĈvuedL†viewÔ$lumiømeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ óQÌXYZ XYZ o¢8õXYZ b™·…ÚXYZ $ „¶ÏdescIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view¤þ_.ÏíÌ \žXYZ L VPWçmeassig CRT curv #(-27;@EJOTY^chmrw|†‹•šŸ¤©®²·¼ÁÆËÐÕÛàåëðöû %+28>ELRY`gnu|ƒ‹’š¡©±¹ÁÉÑÙáéòú &/8AKT]gqz„Ž˜¢¬¶ÁËÕàëõ !-8COZfr~Š–¢®ºÇÓàìù -;HUcq~Œš¨¶ÄÓáðþ +:IXgw†–¦µÅÕåö'7HYj{Œ¯ÀÑãõ+=Oat†™¬¿Òåø 2FZn‚–ª¾Òçû  % : O d y ¤ º Ï å û  ' = T j ˜ ® Å Ü ó " 9 Q i € ˜ ° È á ù  * C \ u Ž § À Ù ó & @ Z t Ž © Ã Þ ø.Id›¶Òî %A^z–³Ïì &Ca~›¹×õ1OmŒªÉè&Ed„£Ãã#Ccƒ¤Åå'Ij‹­Îð4Vx›½à&Il²ÖúAe‰®Ò÷@eНÕú Ek‘·Ý*QwžÅì;cвÚ*R{£ÌõGp™Ãì@j”¾é>i”¿ê  A l ˜ Ä ð!!H!u!¡!Î!û"'"U"‚"¯"Ý# #8#f#”#Â#ð$$M$|$«$Ú% %8%h%—%Ç%÷&'&W&‡&·&è''I'z'«'Ü( (?(q(¢(Ô))8)k))Ð**5*h*›*Ï++6+i++Ñ,,9,n,¢,×- -A-v-«-á..L.‚.·.î/$/Z/‘/Ç/þ050l0¤0Û11J1‚1º1ò2*2c2›2Ô3 3F33¸3ñ4+4e4ž4Ø55M5‡5Â5ý676r6®6é7$7`7œ7×88P8Œ8È99B99¼9ù:6:t:²:ï;-;k;ª;è<' >`> >à?!?a?¢?â@#@d@¦@çA)AjA¬AîB0BrBµB÷C:C}CÀDDGDŠDÎEEUEšEÞF"FgF«FðG5G{GÀHHKH‘H×IIcI©IðJ7J}JÄK KSKšKâL*LrLºMMJM“MÜN%NnN·OOIO“OÝP'PqP»QQPQ›QæR1R|RÇSS_SªSöTBTTÛU(UuUÂVV\V©V÷WDW’WàX/X}XËYYiY¸ZZVZ¦Zõ[E[•[å\5\†\Ö]']x]É^^l^½__a_³``W`ª`üaOa¢aõbIbœbðcCc—cëd@d”dée=e’eçf=f’fèg=g“géh?h–hìiCišiñjHjŸj÷kOk§kÿlWl¯mm`m¹nnknÄooxoÑp+p†pàq:q•qðrKr¦ss]s¸ttptÌu(u…uáv>v›vøwVw³xxnxÌy*y‰yçzFz¥{{c{Â|!||á}A}¡~~b~Â#„å€G€¨ kÍ‚0‚’‚ôƒWƒº„„€„ã…G…«††r†×‡;‡ŸˆˆiˆÎ‰3‰™‰þŠdŠÊ‹0‹–‹üŒcŒÊ1˜ÿŽfŽÎ6žnÖ‘?‘¨’’z’ã“M“¶” ”Š”ô•_•É–4–Ÿ— —u—à˜L˜¸™$™™üšhšÕ›B›¯œœ‰œ÷dÒž@ž®ŸŸ‹Ÿú i Ø¡G¡¶¢&¢–££v£æ¤V¤Ç¥8¥©¦¦‹¦ý§n§à¨R¨Ä©7©©ªª««u«é¬\¬Ð­D­¸®-®¡¯¯‹°°u°ê±`±Ö²K²Â³8³®´%´œµµŠ¶¶y¶ð·h·à¸Y¸Ñ¹J¹Âº;ºµ».»§¼!¼›½½¾ ¾„¾ÿ¿z¿õÀpÀìÁgÁãÂ_ÂÛÃXÃÔÄQÄÎÅKÅÈÆFÆÃÇAÇ¿È=ȼÉ:ɹÊ8Ê·Ë6˶Ì5̵Í5͵Î6ζÏ7ϸÐ9кÑ<ѾÒ?ÒÁÓDÓÆÔIÔËÕNÕÑÖUÖØ×\×àØdØèÙlÙñÚvÚûÛ€ÜÜŠÝÝ–ÞÞ¢ß)߯à6à½áDáÌâSâÛãcãëäsäü儿 æ–çç©è2è¼éFéÐê[êåëpëûì†ííœî(î´ï@ïÌðXðåñrñÿòŒóó§ô4ôÂõPõÞömöû÷Šøø¨ù8ùÇúWúçûwüü˜ý)ýºþKþÜÿmÿÿÿþ&File written by Adobe Photoshop¨ 5.0ÿîAdobedÿÛ„         ÿÀl°ÿÝÿÄ¢  s!1AQa"q2‘¡±B#ÁRÑá3bð$r‚ñ%C4S’¢²csÂ5D'“£³6TdtÃÒâ&ƒ „”EF¤´VÓU(òãóÄÔäôeu…•¥µÅÕåõfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷8HXhxˆ˜¨¸ÈØèø)9IYiy‰™©¹ÉÙéù*:JZjzŠšªºÊÚêúm!1AQa"q‘2¡±ðÁÑá#BRbrñ3$4C‚’S%¢c²ÂsÒ5âDƒT“ &6E'dtU7ò£³Ã()Óã󄔤´ÄÔäôeu…•¥µÅÕåõFVfv†–¦¶ÆÖæöGWgw‡—§·Ç×ç÷8HXhxˆ˜¨¸ÈØèø9IYiy‰™©¹ÉÙéù*:JZjzŠšªºÊÚêúÿÚ ?õF*ÓtÈ”¹>ÈÀ„1ÔôðH7 Phwî0ØM4um0 ›”Ûß E¯Òú]+õ¨öë¾6ŠïÒšu+õ˜éãÈckMOO'k˜ÿà†6´ùÛó3ÊdÕ<ѨÝiút·PI34rGĆ × CÒÿ.¼õòméEv¯¤E:Pz¡–xÉnüIŸN>GÒ.üÝcçMRëÌ0Bð#XÁk¬ªy¥$‘ç©Å/)‘66H6óaî<ç ‹T¤I¥Ý ý1„hösš˜ƒI$l9ÅÂ4ØL°Ž Äì^ïm}m}W–®$¶¸E–‚ ¸¨Üm˜öÍ]N]]°¡ÿÐõF*ÓtÈ”¹: yJùëʾ_•†µõ—¸•œ †Yrý­¶jà‰m!,×¼í£yŠÖæ_/‰âŠÚÙÖid‡Ða#ƒ€Ú´ŽO.Ôo5]"ËG’MWR»›TŠI .8q1ÉÀ³V¹9FÎÔˆ‘Ö×Ûë×2H#–çVŒŽ§ë€|?»9T„¿£òÿ6ÒI•Ÿ™- *O6¸ïê-Ül?äÞ5>ø}¿­—‡µðÉÛþ_ê³O¯™¯Õ$aü¤Ðöë’œÀÓDy§-ùc©D‡˜ï˜ø·˜'U.àäˆ@¨#ëðîšõËÐH€×ñÁù²?…Ÿõ¯¡yÉA5e þÓ[‚GÈòÇóµÑ?–zùÏ2³2ù¢hùt_HP¿çÿ£ö±:h÷¯OËÏ<«y®Sãû‘×è8ÿ(æý¬.;ÐÚŸåÿžìôù=OAypx¨ð®]‡V' 8Z§Œ©v‡,÷ú~ž«·éK…¤>”9P±<Ãqÿ…ÌÃA©2“˺¸`¦õºî¯Óî88‚`±¾–R΄±Bcy×âVâFÑøä7ïûøñ7ý’_¬ØÜFÈ×÷Ã-¥-ËM!!w¢ÖõÉÂûØd”ôŠø³_ÊmI®|µ%¬’s}>êH%ÉôÜ ¢ÚEGUá'À~ÇŘݬ3pqJúìrHÿÑõF*¤eV,ƒí)¡õ䨟dax½yäë=CÖ×ãšg,á!Š6‘ «ñqxÊä"OFúAgËwv—ã˶’Zج$ÊÒ+GYˆ;ï#†›× ¾¨.Э|·¨ùG“Q¼µŽ{häN2•õ²øK}ŽÝ2R;µƒIàÒü•?ïžûL7÷†F,Y»¶ÍMò$6O-›P“EòŒ‘¿§ye‘O‚AÃa@x–?¯ Dª¯fUaæ=&9âs,dTz©½>œŒÁ"š¢wdÎz)Oüúæ'å{h˜@Ïæ}2Fj\DNüzöß|•—{`̵»j%ˆí°)Ö¾=0,»Óù€‹‡\±z¹– ¤Ñ¿xœ¶ðäŽ^KãÅÞ`ÓxHµÿ])¿û,ÑOÉ‹»Ì¾b°mú’²¼D ¨#á$N]ƒM8ÌÉ®s³ÂRÒ—M¶”sýOŠh‘È,á¡O‹®l·è×JSj?–0ͨÇ&Õ “¨éñPŠþ×L}]ÈAÛÞy¤¥Î©l I1úìAý‘ÇáýxïÜ‚§© ¬Îm/n.‡)/«%v4`x×$=Èzïäæ¡[Í^Õ¤fÇm{y.š†‰Ú·*®Ûªsuý×/‚?±•dæ l¥£&Ç$ÿÿÒõF*¡s:2ž2¯Øoà}²!R¬°W`Ák¶â´Ã{!à3èvz·Õîu üe¨iÁu«¨'~™i½ &›¥YEy§i…¥ø…¡fõÃ^%¾#ü¸Ý­!4ß.yÆËABú=½ÚÛÎþ••Õ¼ÒN=Jr  éíüØ2a•Ü¢¢Æ3 U%¶¿—~iÔg¹¹–ÑtõåÈDñÈŠy’i ÿ åñ ö² Dè>Q×RV‚M)|^­úLª¡GÙ)ö²#|‰õY@×E{­3S¶¹1…m›#Ô'(ÃÅInžùW†&ÛÁ~£k{`Ò#yzÒO²ÜLÑŠ¨Ø1aÿ]`ðó¤¦`tI.àÉ!+ÉU@_X¡©añþ×ÙÉŒgùÇìk3òTM7RÖî౱Ѣ±r]ÙÑP ¥ZFrÜR?æÿ+ù²PÏ ¯£/É—Ú8X¼ÁªKq|@õ!´^[mÈde"FÍsŒ«Óõ0MRç\Ž+:{qÿºQ(<‰ãêo³—D1Þ·Oü¹%¤i»Ô"ÓaôÀ2OÊŽÛ| @Û÷Èžm‰¥¦­l!½ŠMzÒßê¡Ï[¥%_Ý’Q‡Â¿gâÀ¥6¦eÑËbÈßJ㞟û¿YTšq+éìÃퟋìa´S^qÓ4­>ÒÙ¬5KMBI‹,Éi,r²£r"E!I®U‹?ìC)B‘¿•Ú•§›tË8î­¤’ãNžÞáb»ßÕÕÑd†ìúÞ¥¨¨¨‘¯,99[ö¯[m²¦T´ÈHÉ?ÿÓõFBÝÎ"’ ôwáô‘¶@Ùˆ+XÊ÷"Ÿ†,_>júž£a§Ùêw&Ú f™'xÚ0ÜÖFÙFD!*º^öZUÌ“GYEÃrzñDÌÚ†í ¿Ëú«¬Äí¡­±BÅžBd^4øBó}ذ ÐIu95+[é`M[XˆU’þà=ÛÑøõðÀ”çËšV¯«Û¿§«y…¦—3ëút¡+¼Ž '2@y ¤÷ך•ž©è^†Ú3I‹]3\mPÁCZrû8‘Os#\ÝÙÞk:åÄV±4“ÛÝI¡Z3É‹¯5Z ãÆ‡—§$ªc¿W›Õ±P­=1ëÿt(y`'cºŽiŸ­ç[" ü¾º©Æ4–9e—šÕG¥ûÔŽž•g—ÚÌl$ïrãg*®HÍJÕt ˆï4‹k+K—2G%ìv™½Uûur9~ñY_ý–^æÒeI«æ¿<5´¯½:²©*±Çoá°Äâ 2oÉŽyoWó­ÿšô˜ïu{Éa{È}Di[‰^`@4¦W!³;ÿÔõFI<Õ3C¦‹…ë ±¿ü52©³‡4ÃJ¿¶‚R¾œ¨Íñ©"2œ˜`ù×Ívþ\¹¹¾]zýì,๘‰cEóõXP‚W!ä%æÛËv:G£¢_5í±G•ÕSâjÙgáÉj§qæÕÓ5¥S¨Of"EhÞÕ=F,`/(Ôrþw9 = êšêÜš•ÛÞÌ–Z4ƒá'‘ë¸ Ëýjd€bBçÎqé×ÛM¨M¦ˆSÔ·x#i vcËáF_á@ÏH=êˆÕõË^g¾ <ŠB@ Zn[ŽÇ#kÙ«­oO—QÔ®ÒjÛjQÏ“ño¦ ¥*µ ~ÖC€ð€›Ý×½¤vÊá®`–I%~AeTÙplˆ”I5¾±+>«¥ƒÊ]¥·FÜ#FdZxq‘ÿàpÏeØe®ƒù‚grÚÝGñ7²‡3)—™ýßúª¹g jÚŒ‹Ñý q™“pRX ƒQ•²¤¾Kº…€·6¸”ÙÆ>•ßêñÂÞŸ6„ :Ê^¼4>ŠØË‘­KÔ¯ÃO³þVH%o„ö— Ñê²\±"ÎH#g‰To™•©Í¿ÝÛ7Ã’ O7M&‡•¤Eµ+{ä• ÜòE*Ä¢¿¼ôêü¦7ˆ*+`•ÒŽh¯0êþZ¸Õ4¹´­JþöÞ)Së_/§IÕ=wcñŽ\ÿgìæ>( ÄAœ›&×çY×U C"41kÕŒlGÌ:åðiaÓË_‡¨=rÖ´_”m­ÛÍZY*.ƒ¿mò…1‘·ÿÕõEr Iüǯ£ÝGP¤¥C‚„šøddÊ<ØŽƒç{›.®uOKPÑ”/š,ãk{y_ìŽpÈÍÊŠ>+›bð6JØÓÁüï–ïµ M¥Ž†7Ó= G 21d  ¨? ®F;7Õ†= i^W±Óe†K˜–I ÐH_ÓZ|+SNMÞ´Âd‘?³5ÄåîbO(~×}êßG MfÑm!±K•Õàžî@ŒÖkêS'T PÜ¢êßx“ÂPÚ¯—Âjvö¶º¼71LËyñ*U©Èo_±’á)òõ«_u֢Юn™ÝŸ—.>€@ÊœÛÿWð–¡òê½Äð~œ…#·e r­#½Eåö9qOKì7ö±â S¶Ñd–§mEa6Êߺ3II½-Éä[’ú¿²«‡‰xJQÎòÖøÜ#~ðñpÙø˜/6%¹'q ±$2cçS{f–z¡½[e<šÞÝÀ…Ïùq+î«"Çÿåb$3‘É ªùÎÝ-äýe4óÓá{’¡AÿŒi^_ìŸù †‹‚K¥G­_JÏõ†…ç ,²¼¼X¡j®Ü™¹9+aE;ý1ŒvësÏ@•îÄR¬ {Žø7ZDÜùòÂ==u,YÁ¸,†¢Ÿe|]7ÃEyÚ)"š;Ö½¸¨å —É_r+½>“È|m6M<Ø4kÔ¾“§Ò(¢Ÿ½‘«;ד±ÈVñßÈ?ÎiË·/r`RD'ˆß쇯L¸H5ÒU§ycΚã 3KÒ®oníb¤0¥]UHROû,YZ´ß•_šv“Eþ\ÔD— ±³ÕºÓà,ý–BVž]ó[êï£G§Ý¾¬ŒÈö(ŽÓQV§aŠm{yCÏXšÜhÚ‘žÚž¼BÞrÉÈTrv® ÿDù¤‰8Øß ”ˆ¦<~ÒµÂËÜVФë ™¾°!=%"@žk¦+k>»~¦ž¼€û±À¶ã©ßþô?üÀ¶V6­¨ËCÿÁ -•#¬j®dì²Tñ{=oQr–åœx9¨ür$(’;Uó ²ØF•ŠupZXöb´;`ˆ)%OÊ÷my¯ZA©]2Ø–&à³ðª€M9{°Ë`Ä­ii¥Ù^E6%ºß)-nÇŒò+EPò‡+ÜóJe¦Ë{5åäz•Û6©{ ñ[³8zþå¶UÝ[ƒq''º `wúG›ô¥’V›…¼ŒË"¨Rì(~&Oùx×r-8ü©º×óG[§RŒdj„Ž„zMÑÔ„Á¤Ç›ÿ×âóy³Q!Ò[”ÔñVõ ~‚§õåÊñOrÝ3ÌsÇõ”].;)®ÿ§GÍe@†¥Uˆ?íd„wæÄËnI®”|Ûu©Í>•-ëz‹¹ki$€(¼ÊŸ+’<˜Ä²o¯ù‚ÚÞæiîµJÚT\D·3‹p«ê €9WáÈÑl°‹®¼-a–iu›D¸þín¦ž2àö'— ØH òS¯4x¦¼³’öLä·•£3ËÄàOÁqç¿0Ú‹·“VÖ—ê̪xÌæ¥¶l‹]Ê‘ùë_+nbÕµ¡ãšGB;ÊÝjk滊§˜õh´Ÿ©ßjóiîÂ3f”\*ª‡c¾SîcóZyRëUº·¸Y弈–™Ú:‡*99çö4‹ ,t/,_ÛGs³œ°`è¡… 6ך6î@5‘–šhæEY½ü`Wµv¦?îT“ËÞNúÜv‘Å!šH½u¬bœJÔoµ:÷»”?Âd¶ÒOobgX¸óXÖ­ñ¸h½M]•vÁŵÞ̧ŒƒÃ[©¿î¨iåÛáN¿èÏ•~góâ§O?桟ȷ„Ñ|¿}òú´ŸÓ%ùœÏ‹'óJÝÉô}A5]>âÚGŒHbÖEQÉx?³÷ËãRäl4Èw‹o3»y¿O¾º½2È.FõU#'¹<~±·\$$£3<Çæk «%oCZ\À¶Æ(ÈXÚ«NDW~5Â#ÕIa^TóUþ¬iz„ Ìle4T¯%òOöJHÊæ6LNïÿЂi–ójQÚYÀfžcE‰IÌIžNtbI Ë¼ûùi‰ùms«\+I©$Ð)¼P«¸R+Ý·§,ÇÁœÏ ¡émÍŒFþ¤7ä~­sfú¤QpâÂy('`ß×7ÔÊ¡NUÙøóeÅ·óeÂôëÏ8­ƒ«a2^‰ 4q,Í,–ÅC,‘¡çDVûoðþΪ‘çM1ìŒ@‚ öþ’*5Á¬j—ÓÕXƒH³Iª»•§îµR¸#«”yS,•ŽDÈ™ú¿¤¯az~Ÿ4)h—JI•¡‡,Prû'ùi\2×J]#òAìœwõdÿN£qçØF‘5Ž¿®²H)p2FÑzu.d` àyäø~ÖGó&îƒ/äÈðpqN¯‹êõ¦By?L»Òn.n. Hä¹UtR¢¼ãcÞ¹dõÒ;T~H—eÀ׫&ßÓLîüɧX_Çöp«Ü¼r¸ú»9™9i@>§¦@ Ë u$ŽAìÈÄ‚%“oé)Xy–ßX¿¹a¦!m=‹¬ÒDµE‘Š+v+Ο³æhrŠ%Ù`›ãÉ¿ô•u{ûjêÞÏâ` õÂ" (JžNB­:×%YþlXžÊÏËþó¾¡ç»u¸’ßÕ³qO%"‰Ã;ó ±¬”ýç%ø“öW/üà»áƒäöŽ{y§v·±Íoê,h W’Ð|$užÏB&þžOôÉ,žv¶°ÕD3ÚÇúÓ@e’¬#ªìOÙ|™Õ‚>ˆ5þLƒ|sù½3ÈO¢êZD:³·»y!Hæ¸XØÆŽyH»üG)dg®̃.Ì‘ÿ+—ý3 ™%•ÚYXŠ̲YÆŒ‚†­yÚµðÌÐÕqa—¦1Øý.wfèΠœ™2öšÏåÛËhÛÖ%wØ,hv¯|ãqÉêe0y+XùgPwË]Å °•9bï8Ò¼¯gúqžö˜\j:ŒsE(­pZþªœì{7P!éŒù}O1ÚÚie Ïü-…kÒyO1ZÙ< ac VoN(È"ž®¿i…79´üä+û¸:Èh2D{’_ÖYù•¨Ùâjö¢Æ30x!¼Ô ¥ÉÝs9â Gßø›§¤™Ì'âO†1þïø%ý'ÙAssªC ˜_]ÈXùìµ§|™çÁÿÑŸù3É7–mV©ê]0X½VG>ŸeÉÉåÔË!ܽ$qF‚Wùå-ì–º”\Ö[)¦µ) ‹F…ÖQV‰‡óþÒ¿ûØh5Ä' UˆWW–~P¹š•GTƒð囉]HýOWÔ^ý#ì“ZEé;Kiq G)Æ$[‡1üfF^MŒ›8 _—ºõüúž¥xò~áaú¨†VÙä’æN(±#ZaÍãìÿ>-”@½Η^†‹ÁýYT7S´¨°ŸHÑ×Ñݾ«|Å‘Dmä·¾e×mthQ®âw•€:w£Ö>8‰PݹôÙg'a<ëþL¹2éQV;ƒ 0D÷QI$ÂGXÃ5L”£GÈGÅ?v¼2$îƒy£[¾ÿZµ«Ám‘ªHÞá e‘ÀIÚaÅ=fýï¥ýÎHIx +ɺÅÝǘoÚêæÞåÈKxÑ¡Y™å_Š€äú½ø·îW’ðAù -äÑÂH“I(ŽW¶XÊ,\ÔÆbä| /³ñ`‰b#o!EKß,ÜC6!]…#1!½yÙ±ýè_åáðe†kÀ™è–nº9‰xq’0#ôÄ¿` ñ;ò'í7í}¬¤Ow#ƒf3%½Å—˜£¹¹Ê…å-qoÐR7i6f‰aòþ+1ƒÔÿ+4û»ï4Oo%äú¬Z4·,dôêÒ¥´!mÊ?ëû?±ö[!)/ÖÌ?1’çGò¶«i Ì–Ú”kõiW”RIó#!b8ªýªâ(¼^}[ÏB²6½¨NWöÕÕ[é4Â!àÈ™!†»çÑ ³yƒPŠFuW[{wÃÁÐ1&OGò 쯤é_Yºk»Ø£5äÒ3»—>£ŽLà3 ¹dTÞM­ÚE?Ây^1w<>QöŒŒ¡W‘§Áו2s;0 ƒóÇ÷Z…ä1ݱ†CZ ʆ5§úÃDžlòóI“Sólq! èD÷ O„t¨ürŒÓ2Û†RÿÒëº Ýž¥§A{nUâ™C+;ýƘh½6BÁÿ>µ>/$Üé 9ÞLð9¥(вSîi›-=…œž{Ê,ï­4û»™/ ‚uVrŽÑò^LAeŸùº<}n×üëùtÚ—¯mª#:0q$jô ¹) e&¾3º·–¼Çù[©e¨]kkY3´P€ÌßäkËo‰¾ÖH*<Šksæ¯Ê™4MJ+¿6ÝÞß\‰¼ŽìȈƨ« B+çûXw®L@ߘ¦/§yƒÈŠ&Öhë*9šRõª/+1êá~1=ͼqïz&•ùùk§Ù¥­¾¹l±§rƤÉ;wÉoÜÓ!}Có'›¿/gÔÕíõhÚtšF‘ "5A ñûX8KddÜ£ü§æoËË"×’ëVË771$Js5g¡ý§'s™¾I—™<ïùs©i’C6µi#(-†äKS¥)½r[–^~þ`òL²mJ&•ÙYýJ€¦5â”cཾÎ<%·Š=è¥ó?•SoÒÖ£À <'¹x‡z˽ÈÄÉ­)e EX€d^/¸4©]¹d€,xƒ)ò—ž¿-¼½iõ«-r1z€WR@TRIãðïÈþÖFP=9¨–âë…wù¥ä‹±×ZÕ¼ÎO&ŠRZ”j€ÌkÌž¤ãG4ê2 ’°#ê²¹¿ç"üJaÕlJ€ÑýTª…é×Ô=]Åäáø~h=SþrÉRé×6ðk6²M"4q¹´àhàC ‰êßg%káù¼òßóÉ\O3j‘žp\ â &I¢díÝŸs„I3µó™×m¦æ“.RU~µTpÀŠîÙ+Ú˜ÙdŸ˜ä^]k -×+«{—f¼âv€‹©n1­rRåhè?•_•°y.Í¼×æøjWvÌ4/r¬ˆx“5Æÿu ðÿÁü»Ì\Æ4 ¹öMúxHÊ¢ÿÿÓé—¾U—ËZ:{»Ï)øåjž!e€ÎO.OVôr *ù)y§òÆÏ\¸k…Uj}jËzt`Fês+nG“2 ·‘|•qå©RAÆD´i>£§ÄXBaIY‹îÒ8Ù+ðÇþË.‡hT…Oñ5O Hܱí_þq‹òïW¿šïJ/cëm¦Ò=xn•Ì™qË|RâÍþ&œ"*qÿ>?J6ÏþqÃòÂÒÖ8.tY'’5£ÜJò†sÝUÿÌ)æÎªãðgÅŒòSÔ¿ç¿+î,¥†ÏHkIœQ.‘ævC✮Wù¼·±¶B0ê"‘éßó‹¾Nµ¾ŽkÉ¥¾·Z–µ*Ñ+6äÊܶöÉO]—’D1w}¬„Î<þSðѾ´ÿó^Djòÿ9 {ƒÖÿç<•uv&Ó¦›L„(V¶¦¿›“·-ü0ŽÑÉ{²ð z&š7üã§å…µ’Ci5ýÈ$½ËI,DÔì8#qr']žt‰cV¾ÿœxü¤’ÞHàÓe‚FRa4Ä¡#fš†žønQü_rÇê·ÿœ\òŒwJ×:¥Íźš´B10ðåÈÓîÉÔlÌiãÝö¦'þq£òʵ zG‡®?¦CùK7xeùxw õùÆ?"ÎÈlno,€tn3>5b´ÉG´òŽh:hw&Úwüã¯å•½‡¡yg5åÇÅ[Ó#Æô=(ªÜ~–'_”›µð#ÜÎ=~S,KiNäïiKsFðÇó™Oñ#€èüãïåJš •{™eÿšòšÍüåðáÜòþAþW)øtT§y漉Õfþs!‹óB‹þDþYš2òÿÍx¯/ó‹!ƒóCó§üã›IwÏ”-Hæ`’Ø("§Y9±øbþnG3tš©ÏÒw..§8î6Eù‹Éú‘¨i³j÷62jÚP·:…ãz“ÙÈR%kxå‹«Vž›rû|ÊÌü“1…Æ\\p•Àæ‹Î†¯¨ù²êf»žê×®ÖKtáZ…†Ýþ/IaxF¿µ˜™uÉ@ÿ±rq`œ ‡ÿÔî6ü¶§ã ô3F·/L×¾_.MšŒ4åûÊcÍœ¹uDIè|>¿§_دÚÿcû_vdCŠöæÓîµx¿KSý×ãÿÓÓÿ’¿¼§ú¹´Åù‡ûgã‰Ç—‡üUþoã…¡éÿ¹C×ïèrÉåð?‡‹ú ^«ôqWôw_Tâ~­ê}4ãøæ³7…ünF>;õR¿«Ç÷œ+í”É×F›ÓäkJþL©"Ú^?GÑ’‚•²Ö›VžÜkŒÓ<ž¥6ëÛ¦PÚ)Lýf›pöé\C?JŒŸ]çíþOã‡vC…V.\O©Ê”ÿ'-&2ò_ r§½?Ž[L%j­Ç—Ãôå›1澟÷•øiָǞÜÔòß’n5jñå]ë×ß"k«`¾‰oæ/øüuþô}oúZò¯Ö½*|^Ÿì×þ5û»Óx~îÿÎþs¯—‰ûÎÃü×é_௨§Ô>µús€ý'õÏWCŸ«Ëàû_Üú_><2Œ>/â¯ø¿›Âäfà­¯ø¬É<ÝËô=ÇÕùrÚµëOz÷ÌÌ—¡À Á!ÛËÖFx캴ò d“(©ñQ¹ç›78Óúè1&Jݵ-.\0 —©ÿLºZ¶™E¨ºUÃl*¥…FȈ@Éw"àÀ‚øªzX`!¾¡Ö+ߎÉ„)-ݨ›©”*Ë„’@-µ¤6ÍÛ;ln7z¶GœNž=MÉ*çMR:(¨dEA7OKåZóR¯,>€NòqPã*0чJ›&Ï¡çÖa¡bLK…Ø]¿•kùÂq’K¾’½äÀ°âD ìØ¢ùr%TØàC-)ã˜Ìíªû˜h  ïáéó'®ïGãŠWL.Ó$9ò"uÆ'½DÄÙL >$xúóAˆ] ÁP9PÀ€ÀC;·CT´òEI¤ÈŠ&àQÆÿan” ' Ükží.¸!åÍ´b¹)6Î ˜s c<æ2“z”ô4@5~iXÌ-ÝÙ‚Ê'N™Düå—U…CPõD!ØZöà¥.äs€ t©•RদK›°ùÛJ(­$'J^`A ¢¨'D;ÀÁu9.ÓP26Œ š×AO@éHã95ÕXc)̆Å7uà5£ÌwO”´ !ªá•¤6Z` êaí å=cñ”—^m)Ä“ù ™f6qj£Rv{Áˆè±¥L–4d°ç´b@8z³c.æÄÂ]·êQjÊ8âŒ×^yJæXÿ)²pdÌ3Úd,d’îái  Z}ø€`~¨íG¦ yÖà/~ûæs09ð[‚j÷€öë„÷ø»D˜­¦¯C˜‰o¯÷¨€ [E[ÌÆ„è^/ÁKRKŠ1ÃÔÖŒb +Ê]ŒÉj3%ÝŽ·¨9°‡®-ËìxЉ! Œ/¡õ‡Bõ&™»~z+¯ÀFÁlV ¬@¨^ÏÖ5D_ á@Ái¥€ P• Dl¶ÈåjV}Õq>"›ÜÄ]ÙWÒ²+ ï9œ@±ÍŒ{Ú é£O‰Ž{ã¢M3ºèÑ…-myN:]@IIvÑ9çvƒ¿!xJÍ*àq} DÁ%ð{ÿÏh èw• ø@`ƒ™ Ñn{ ¸Ã]ñï¯ví¯™#[ 60”ëY×ÐÏž`Ãâ·ûín0.~á£++ †.Üøú(î`ÃuåèÈ.ÀÑßùüÝæ@nÐÞÖ?æ<¹À¸Hèpýƒ™cnq/±dÉ%˜„@¶†!`W)X–`ß)‚¤ ¯¤u ŠjqYb€YV՚Šk}sÞž· ï=á;ô: ùÐ%3õ±ï‡¯ñ—èö»€¸ÄJŠe%x×Uí”J»âŠø?ÆŒc'pÂt,š’i Û bðç–iÂÙÈåKxŠp T )Ç,˜;ÿlx5ˆ0±'L)`Áº >FÍÖ ¨`h,‚ôè‘é•QkØË>6¨È¿9-Ó_årƒêYòe:P´¡ù„üCbÒÊAJ,ê–{˜AþÅ€€O\,A‡˜ý•2ÿ[*Äw,DUtf1»÷~8€’B2Ê7p š…žxç·isKÿ±‰¡Ç\2b–3 /KÅI”/–Äb8,…§P_£‚&’2ËÜ-JRDE¹ò”D›e2°r`à.y6‡˜tñŠù4OÐÈ!¹Š~ócHÈAÁT‚ ²qJbc€ H˜©¨•>mÕÛ Pj¥½zwF°79Ø/=Ä›7}BEWæ¨Å6Ã$¸Û†JY¨´`‹ê§?‰@)MúËb»Šøà ˆ äW4'p\lèþh¿-¬K4ÅE‘`»™)@Ñã—°’ÔW¿])_§ùL”6Á¹2äXŠP½/¹Ñ¦‰ýžGjµŸo% keÇ+~ Ÿæ¨ÿ(êÂH´¸×•ús¯þB×dVØÁNYÄzÚÅ0²”eT½h®ñä¨i¹)Uå±/™Ê?Xó•îx¥€¨@UÕü”¨²Ö•³á1¤zôcüxÁ¾M£{£ðÖ°›]sR®‘žìC@JދɽŒâ‰.ÆÎ‘‡‰ÿ”í(A+dÜhÙ«@›Eñ4T–³’bþäŽVÈ:¾OÎJâßC–YÜ[ïQ•Žb€„iSaBòfˆùƒùH¡¾*ææÖ m%æ˜P|/¶Å7d‰+ãÙ–\§~µ±¢ã–.:Z'@Œåx\4Ç7Ê:íky"ƒènˆA“ÿwTÄ×ÊòÒV.W“:Ú&ÞhÕ[.l2 ñ—¹sán°%ZÛÚS¾ãîÎ ÆdÞL€˜¨;Ã’Ú è¢Æ`Êч†-úÚP™l·HÀX^À^Í –³œå¢Ø«3Á f0¸`Ç™ÞQ€Zj"Ÿ’iX÷Є¤Pýíög«˜„ýs]‚Ü5" èGÀ æ«°LbÆC["6HÐU¦xÓ㱟}.PnÚ|ÈA)h€í’/È0[„4”Ÿ|¬|Ó9!%ޏà@'éË@ \0˸`:€­ŽÏ«?zŽr\T(WÓ_zÚh´gup8P0íõ #§\ÙVÿÔ!P=+AÁlV§„ÀL.q¿$æ<ž4dwS±§Ëq&Tƒè=œRåjò¾× TžùÑéù^šÇPöêaH+nÜ<ïfÀªØ€$(€ Ä-U÷¾´8æjÒ«|Þ¥©‹ ¬šø†#ua@õ é2b%ûº×}%•¢6E—EC¿“ðõt2ŒSjz‹›¾‹? σ `ø¹ F€”`$Á p¯föø Íw¾o$ßþÊü¼H·½úן‘—¬ç=Æ0}¯hà›¾ñ½4C»Jß耋:¤xdI $ Ù·€Ù§};\nÿ4:8JØTïÕ_LÖO›³Lì‚"ˆ¦P4I•^§³“E6–Ë:„e.·x¦66€-`sà‚±4y+`ƒÓ‘€Bx ¨Ó·}ÿ—rŠn¸rù‡<Z8Ñ_ä2+#x…Xø¦4ôDh+#4Ƃ䥡³EðhÈGƒ.0°7°< - _ !+`Ї}8„ 8}˜§}¡æmŽF@Ø„+÷rP(dpÚÓ*Y8‰#¨.<28›µàNbXcÈmg(@èm1'p 9@pÈ4P$6 ‡yh ‡µø‡~(„FH×§}ÿÔ HÉeCÑ Óh%¸…•²ÇA¸h0ÂXŒÅx1pDÔ·êx‡xˆ‡êh+p‹òø‡D8ˆ¾ÈŽn㘈£Ø}hx^år±&;­ YƒX²Œp*ÉqíenŠ1>ÔÐsÕŠÜ6kh6 ²r.ç+@¼¨€`íèŽ/¹îøŽ¶8„FxÚ§}×p†Â8€úø“Þ¶„D :^çb‡&Õh2KyúÂMWN%_ÔÆSã³ ¡‘”Ž:`ƒÅ2ÒÁ+yxÿ-Ù’,à’!Ð’mÉŽ0I“ê8‹ ȸ‹ 6ГgØ—>”Ù“ã:ঈ¡3.d‡ÃviÑ”JIXNÉ\ž•å4`¡d>[h *p¼Æ•ãµ6É‘€¼*°-é,À’.ÙšmÉ–®9“ë8‹zH‹u©‹ 8ˆ4@ø¨¾ù›&à›ô›ÄÉ—Â9Ž.Àm*Œ zDN¡{¿‘”˜§Â~2ã^?!(ÚX EÃŽ—âå™ Sž{R.ð+~’¨É9Àô™–öé–øù–w8—s‰‡µ)6‰—¾80Ài&оœÄ¹  ˜”„ÿAÙœs§Ø3‡ZVH©%uјZÏXE*NÀ*‹+­÷”K€¢N0ÔI€D³¤$`-@žrøwPÉ–ŒÉ˜üÁ#LŒÂý¢LÅ¥Ü+œÊª¼ì†Y1rÂ=ìö̤õy»l¹Ÿ³ÙËH ˆw¹€F¨}$À-ðRŒÌË|¦ÛúÌ- ®\ê¼TLÔF½­³×Œ÷€ç¾|wàkA‰šnLÎXýMÓãì¬Îù •D0<ä´ÏÿaÏ’ Ö]MÖ‡¼Ö‹ néyüGÉ û¸¶êÐŒÉ4ÌÉ|ÝÉ'|Ñ0Ê0`Ô-/ ÊŸŒ«lŽnxq×Á&Òp¤=lË?¬–>+Ä»|‡ðØ»3MÓ7©´öx`¼€ÌÊÜÓO[Å=ÅR<ÊÇœÌÇ,ÅE€0§5AÅ/~üÍv+° W}Õíœ\x¬Ãm\A·}h‚\GÃMÜÁRp#wŠA–|œç‘ìª mÁ íЗ¬×½ì×ÑÔ¥ § '@*°Ê­ì† Û ’³,@˔ͳIÊÒù —EìŸñè»Hü»HK„ÇyÙw}(pÌÿPÚQlÚ±mÚ=ÚÅ^^iT¨_‚¿Z#]~ºm¦A{è|ÆÈ5H$À1fB^}Gj ÖðšÀ$\l}Ï[r¯G Õ“ȉ`–Ö4ømÛ ¹ÝM«¹ªÁ­×"LÞämÂpÞé=ÊX,Ô+,ì?*ª£m!Ù“-æ+m»ýŸ/»ÏZàž­€ 8Â<}<°ðàv®ážçz¾ç¥}ç}žá@¾½CiÍ=èûƈ®G°5m¼âu”ÕÐ ÕB@WUÑÕù¬¿‰Êv]ýϯÖQ*Žš4õ4U±MxxEùhsä‘ëœ ÞÉšå& Ê¡œÑÿAå0`‰]ÅÖ†¼–îahP¬#BË*–õyæ?«Ÿ0íŸGœ‹ÑºÄWj}Pç~®áv¾íxèÛèzžá‚Þ;Õ‘¨€zbôAºMãoÆA£¿¿=Hó+ó«Ã]܃œtœÇ ãhË‘\Çø 1?~¸‡@ZåG”x œÉê:ê.›Áì¹yÉ PnÞ€ ÊüÌÖlØYß }ºZ!àÑ$1æ*ͳ.Ýši®æ´i´4]¥ ΋×w8 íÚîíB?ôßþíA/ ³ýL$ƒcMâìKlt¶Få,ÕCð¶6·k¼ÎÑ”\Ù[4p6ÿ¾ %“4¸‚‹Ò äÕM˜ò…s‰H†乑œÐäIñ”|ñ¿ÁÏÉå]ë½ÂíÚ¥ìÌ0ÉÐË!Y- E¢ ȾßËî³Ì¾¬/à¼+¥›õ¨à9)Eoô£_úEßíîœ+X1ٔƇŽèS-2«³qÕë¾î×›°xfé]¿%ž1&$Å6ü1û4Žî­ª*O݇„Enœÿw8ü¸u²ß]ÉvÉßñµnë€Ñ‚-ò-ŒÊªÌÊ'²Ì5îù/Oæûíß?+´™ýŽÐNàÒ>í Ÿ“;@a ",‘I岨p*¥Ú”ZÈ=ŸÿTVQ œÞi‚Pk*ÆS\#+Ug|ÌU0 *ȶvžÐþá¾ÐÝ Ú rÐNœÚ¦§Àž8vÐJž0Ю<©®ìHK¹&44&VYSM4tV/V[22lsm}2n|€Z†‡eŒQP6–— <¢£+`¨^²5R_b``pJdpkJÖÙ;Ú;:ÖXîY:ð÷ï Xþù è/„ T¸âàŠ Zà0‘C‹P±‘‰? °„dI %‡Øq€ÁƉœ¸0°A%„)›XVb¸¹óf x幨M0À¼¹Ò…P§Ahxÿ¡Cj 0bhÓpaÖ¬t…µåkÇ`-„;†lƒ2e ĉ“ Ü5lÙ^HÅ ÎÆ82 ìØ‘¡O»uÜÍc øž>~üþ8P`åƒ †`è⊉)b´¸QEGiðØ€’5I '‘Pp*©ÆŽ§·qçÖ½›wïÜ.XgÅõ† :¸â¸!vW/_Á€k¡–-3fq¥UÓ~ o·lß`<W!Ø-¦—Ø]½ÇïñU–o9!fÍïGM±"FŽ?*á#phmˆ“`K0€×„P0%¡è˜„Q|«Ð 1ÌÐ).p« f‘esøpZ¨¡—°¸¡…ÿÌ‚nºbŽqË:gäš‹pºã¯f€¡/pØ@†ÌÀöÔ[Ï=ì±Ç1È"›ÏJ̺o3Î"⯿‹Hû¯„ ¡%`;°Á5—HS‰Ùª PÃ9é¬ÓΧ¸N¸XV‰…ªTlx1uÆ_Î’N݇”! ™§Åp°H@­‚%çQ,±zØy2ø$“ìÊ‚ŠU³†zh?/E @Sƒ` Qr%§rºSÙe™]¶Dâ:슨š€ªPkÐ\|xNFbÔjÔÑ·&…&»ª±ëÇu…¯HcScÉT×Q¬zì’Õ~ÿ&»R „d5?ý>ƒ(4ÑH(SÀ X-………˜Á×(®¸b‰ÑlVã9n–Ãg¡5±UVÁP±Z„.:E“iËÆë(¥+ÝK×õæpÄ)aPÍ;¡ÉôšœÕwöݧÊ~­TȾY-p¨"ˆx¡3 ,ú’4Ó<ú¨…"Öâ¯Á–Øâ:.Ûì³}qDà>ì°ÏiY±¡Ûns!Ô,DWžŽ­¶ µ.ì¨à,ýÑ»ïÄ“ÔHn¨zk1ày§ž+ÚŸ~‘¶L3ƒ°œ•ƒ8X¡Â;L‹°Žú€ÖVM°i·xX´qÏ]wSØî³w¸­E…Ú fxÑÅ[ÿpÉ€—^d\ RÈýǹo »îºæ››O €LЩÁö*§üÞôð½'ߢ‘ît0x?,8†vµ„Ø„ ’€/‰%ÈÚZ@Š-(MÀr øµa½& hЉ€2 Á»óàÓ&¸ £ֵÀ è )y¶† Z€Œ½ñíF€£ 5*`\*<áh‹ l†t 'ÈA© S/õØK}ì{Ì« b@`Ø XR‚þùO0ÈDTà™‰ø'#YXdð+ÙhbmlPÁ6 >A â„#*X`@p¨UBá¡"„LÿE!'ƒ ¦D%Ws—1ÀjóÀ¢ªAf"ar`?L€˜ ˜5DÐk´cfí(–Ç)\0Sà€ÐpMJü²Ýìæ­Å'U2TùÓŸHÆŠà/šÔR Iö`Q3´Ñ[” côÀÇ€âcg`@ zñ88@hAkO¾ò5¥XƧþX „à~3±Á¾¸ƒýíïqÂ.éG5Ñ”FL 9€&¨¦ Úš“M>á\&›Tè NÿõèM¡~Ðä4ªQÏYÎàð¸&YO—¹…†×)N ³˜ ;:Ø‹¼W€È Gè–dʱ'Uu"¿ôPÊ)\Æû;@òw¤ã—ùóLˆ š\u¤4#0ÍhÀµ‡UlXôciרhnÓq XÁ”BŠ6¼a¨Å]TV1ÎC¢Bx‡D§ˆXáÚç*=˜™k:¼Ë+¤¢d# (4`pä &PŒÐŽ;/ˆ6Ñ1Í5ÚæFP› ÀGI½b€‚™¢ дHäVª;æ1 + Ò €ÃJÁc)ð°¸wXð/Åæ{ÿßøNVÔ\o!Kx–Àf+¤hÇY-v%ZâʤÅÌÀB%Q½èÙð†Õ¸™].µCKÍR¹†Óµgrle¢”Þ*™ËžÀ'( è,PƒÔ Æ%(ýÄX0þ°"oKc-.`‚ôͯ~_S_÷R¦QŽ 47“)@€ ŽÐ2".X`1/ëˆ$Y:¬¶gm†0›!œ• q²o7‚K4 šy#+ZÑÁ¬• ëYïzˆ™À µ.&‰õJ_æÖ`cR v?ƒì@€°º.CÈ šòaInÝ<€ìwÊSŽò°>êÇÿ´½ñ}˜©PÍ)ø¡§Ö"*;faßI„²€Ö›Û|»YÙnv¶@DgCDË‘ Á¡KÐÕm6®÷‚^Ú/¸^Ñ-\DÛrkMb©èáV|`nUO¼GilPG¼ ´"Áp5Æ‹à¼Qa7ðØ÷æ—øÃmípLœâ§€±¬4¬ ްÃ`P`Pa» ú°|ÍU t¿1OÐÎïõE ‘ŽÏæ ‚”Z~}!ùáŒCÂΟb®4í#HcÜã>_»Ç:Öx8õ'®wŠãØ*ê8Tn&žüZw²›]ìÁyÙ5w½ëÊPø+ÉòО<´‘Îh\à"€nçÿÉÃznl®Dd{*€¡8ÏIm‰ÐÇ|(§1œËÞ‚4 t.#`´$ìô£¼íLÿCJ íÜîÉb ïènâVmÕXâ"¦" ïÜ j¢×H‡û8«üxP7ràsÀÚ‚#ÖlÚä¡. 5¯þƒ“€Zf€6@· ^@x¦BÙÀZ”MlÑdOP¯^òïö*„FUê ëfi–þE—fVÏ`¼DàŒ©?6¢Œ>âù"@îêŽúªo絛áøNü¦ B þÎ|Jšv°)Q(†ËòXÎäØl8,ë/ÚäA‰B1 'ï¸ä!“.H&b gÀäÞ/Ù@ 7@érèc£îöÔJ_Üà +j2ú!æ`b¥Vl…˜˜ÿqȈÌj«? þð§1±±î¬±ú1Bjc þËûp0üÚ`À*ñy"Qñý`ýÞLß/ óo‰à­TFq1\`0À«b`‡bñ/ò +4Eú)árˆÐ  ÷íë^ØßãýEAçº2ÃA0àÐŽ¥®íèÎíªñ©1­ï­Ïá$Àá°ì÷Š&pP›"dÑñ&í`Ý‚0Úr æTpÚ01þB‘|DQ‰HÅ:ÄÂpSb`° 9bÎD|žª6`$†ÝÀéÎ!&¹&p}„9çJâ'`¶¤KÈÎìÀäjF@g$®%éòZÿ2ê²%¯1]R/¨µj³p²0K¡ÙdÎýï'{þ°2×Ððeòr *càl ­D¸p QာReÕ`Ý@•«¡Ë!Ê÷$­¢äÃ}<‡V¸¤Kîð?òàJ ÃÀ.?€êÎÚ®.ƒó.YR8ûÒÃLˆÆQš2€£ ³:ïæÈm'ÒÙ´óõæ2]l.Uâa0ÛZqÂÒÕ¬‡zF`¸ÆŠ ` öÞáTÐçÛŠÊ’_€ïhä#VbK<£3(bùF#D  Z28í²%¡a%éRþNR/?@>ÿËÂ¬Ž¦à ²É H4׬Ó0!ï'[n'ÕÑòŽHGÑTLåòJÞ8ˆ:D8Ó*ÃCÐÄ-<ˆ2ÀD€M¶R¸j•¢ÎöèA_¨”}â,¡¨øê`žuÅAÉ> XR/% /&ÔáD@ÒTDô .‹ §à§êtŽVô&× Ú0ñ{rPeé@ñ1íÅF‘22åAN±CòÑG©¥CJd'©M*g²EEZ@ˆ%M<År”I¦ÎI –bì¹lV4ã~è0Ô@ИNL&‰%àM?Nã4M…³MyW唲(„ œ`먠)úÿô&ƒRaÔE°æðÁÓTæå0‚†r.ó„€9.à‰ƒ¬§ád@…z`$ˆX1êQG%²r„†r@6­´6‘ BKŒìx3WÀ+É´HBñòMÓ´DÀ`á”MuõL?ôVáôB„oYqròÞ¯1òê/c=Q«õ(í±)§T(ï8$õ„:ÄÙB«ô¨0>}Õö‹I) ”!°rÒc yo"÷å‰1i?ޝ›ÑB½Ð+.e€LÉ4N+tWÙTØ”M? @¢Vb±v7,O'c.ò¢­Pgôˆ@ñcïÑ¡êöFÖb@m[Ñ\`ßÌ=+€Þÿ´àëS‡ t`^¬5†æétg{o7f?–o° k6€j—öiw5rÓôi«6N k1÷6ÜF2òäali´l‘2¹]ŸNåŽÛ° (ƒrºá£á$+XÖ$ÑÒ_lö!%Ò=tVp[¥J¾nqó)‚hI-l@#Xª# ¨Öj•6zß”`ÓN©jƒ5sµw'ÚìYaN=¯'¥•F=ÖÅÌСìñ1µUZǶÍÉän'†M(àôó|n"^ß*2Ô_4ÒøËÝ’Œ ë·×qöM ¶z§WWu5{··‚s’òTPÕ1‘ò:ÿÏó¨Õl“k„w±FÕ']·ô’±ž‰±œî|ÈÓlj¹ø—Uô“ù²¤iôVŒ÷-ÿcTÀ j«Öjj­7N—{/ׂ¡˜ hÎR¿þPñCøcGw±52Ípc‘0nCKõT“Aë(` =to‰Ð°­" Æ|—¢^…V†K4£'‚)m#n"®kÝŠXi©¶Ëô•Xrã4ŠÙ ‚²{ãñ'?X|CWG­u‹IWi”Ù>ÄÆpv‚(&?ò?Ó0ÞxSõwýE!4R‡‰7Ô˜²È‹£Ø±ÿ¸LxzxzYW™‘=±b+Ö1ÑP½ÿó˶(iÖ0À³>×Ù\÷^€Œ Œå<@Ýîљ߆Wø~¯s8ùVoEìhIþtà$@sYaëö`öV™8‚Ó4˜¡x¸J¤k•-F{Òƒ=˜ZuôZu™#3d)G);ÙLÀš‘à>2¢Djˆìe­Öãvs¶†œYÕŽt#bVæu@·ŠØrÉÔq•Öa#¸žwÕóYŸ-xñhÎõÔ1ƒ§µƒóÏɶ|’)gHGæ¡—•z©Y3BÀÚŠ?Mw›¨†]%ënV0#-?m`BøŽhIøz£·¬£w¦«÷ž vÖ¦+˜ClÙ^ÿ|—ð˜A÷§šf-Ù §’*:ö®±g°¹£!‡ Uì¥?ÍgJ1‡Þ¬ú¹(ÃsàÇŽ¢i„JH¥À¨±¬#€C;û¥gÚjA¦%€ìÒ­+ØñPw§»W AXu¶šT‹™­Z‹î¸ê¡›«4¸ËIIˆ³Qý`챇1²ã°>ìç t  þÖóò¥+ l•½û»½;Cߦ Và`ÙNT[{×íØ^îE_Tlø’éQ„5 3ϯ‡{·Õ·pë¨Æ‰´ °TÂ:ªah\©J5‡•­äºÒrïa†i61. ¶±³?¼Çô¥cÿš¼¯W½×;sá ZžEæbîˆ*‹é» M‘óBvce±ª©[èÐLý³Íî…¹7ÚrwæõTwv@gI«ß's®길­& ÜË»MRÃ7ÜÃ#¸¼9ij®—­ÙâšÙbq Atk–^€š¯åϨSo¸÷›šGk8<ÙtZÚlîó0­˜—Kâ¹çƒì!­Ô*"íœr¶§±¡Ü$¡Vž%W‚éË1ב å’Í'mnÎsô§)“2¡ÙP£9·‹j¸gü¿ÑŒÒsÚóðÌorv|±uo|ω|íf%3±éaRzn)à$£/=[aí¹‰­6r!ÿ=kG|ñØoÚSó:ïõ&gÓŸôÓ99eß·Æ*8Þ‘§ÃÜÙŸæ0Z‰ ùgú3Uªz"-’{¯Å×Jh.Ú?ÉÓó lTí$¡¼ÍúqŸv‚±×r¡öØ%öü”Ë)=ÇeÎ17VZ3oÚLÙF毚œ– §ão®ÙókïÜKÕ•„œ¢>º‰RÅZõé¤tGÛ{ÌÍ:Ôáîý³=;´—¶ß±·i)à­sÛ­P„1XšC$´Œ ЉÔÛ¼è%= ½–}‰èYÝï˜×ÁߘÑ|_æõoEñò.³Îq]<MÜÄ#MñÒVA¼óCÏr!7/q¾Oµÿ\Ùužýr<ê+5Óï̲]8\Dº›Íç›= »Ö®á¯¡ ‡FŽá£Ó÷±9ÂÞ¶öÜí¸¢ÐÜâkƒ³rí’M¿›La´E?z;_¼+´Bß¾Oãzà…CáñCMd†PÍû~‹íÍåšåÜìÄ}^÷óµ¿3¹oÖ|ò¡±ÕçÅóžåm™Ù00ÑZ'%弄=íÁÛ»—¶óOŸWo>õý”‡~è'^ôäöŒÔI]ÀÛüß±¿ü½Ý,FßÏÒÿ´åÊ<f«ŽoÃ:£ãä\£Y|2—Éëáù >‘-áEH¾ßˆ6‚à¢ÓŸ5:K–`áÖŠ9½n¿ãóú=¿ïÿ  NjL$&6"*:ê(jTZV¾h˜¼d¾˜h.:^ŒN ˜^˜J¥®¦æ¬ºš! É"Ášæ =1ù2,15íæä8u #Óö7Q5X]uID„‰õœ¥…‹«m•±E¦«¯³·»¿2d^.ZR†ÒWêäWš|úûË' Õ(‚¨T<¸J!BV²Ú2ed`Dx9VÌ Ç"–!["¤#.hxÙ-Y$lëÆMŒmà\’ g®L9Z;ntp-4.2.6p5/html/pic/neoclock4x.gif0000754000175000017500000003520110017034537016073 0ustar peterpeterGIF89a–Ã÷›m 0š_=õ.jkp¡†T391ûikj+¦ž&P[x´¹Ó£©Â32„‚€7;:^ZNܾ)¡˜•spL¸¶®<±¦Qƒz2Q•`ky!/]O2P:®›DæÛeKI:  ùK”k$|{w™¥˜‰ßÂTbbk»¥#t„´9K}+1/÷vj|¯¢da[#²¨ˆˆoNëâ×!!‰¡„#J>2,=qKLQȵC­'ÞÉJ—™¤ÀªU#1VkW7±‘:/9\:Yœ%:Z[bB:1ÔÈIÙ¸z^s­Jd¥¾ª5¼©Dql>ʺ9«”W\M#JKJ¯œ:›{"ä×R+1(œ•xŠŽ~L@)ÞÊC×Ãgjj€’v3ÓÑÖ¡:çÓy’‘„³’'rcMUj¥ÕÇ®q`#²©z9:1ѺJpl_?BB­…%…x_л#w`5+B“La›µ¡$’ˆ=5ñ9²©p#;lŸ¡¯ff3„zm;S‘))!”|o,­‘eEA:ŪhRDÜÏ1`Næ×KÌ¢,K“/06νA£˜W¡.Ì™3 Þ ~s?Á·š~l+÷îàLL1éÞW³¨EѾ1­EÒ>]ZCPïÜ5RG"‰Š-‹–½2KŒBB1®™u‘t@±©_‹†‰Â"ƒv,ÝÒdÕ¬ij^$Á¶W´gPK)“½…}€‰aÔÉ%NOBË­4™™fÓÈAD) JJBfffÔ«U²¦:Ûàæ®ª©§{#Š‚MªŸ1ÜÅ:ûöï8—£¦ÐaY1ãÕZ!ùÿ,–Ãÿ <&¥ ÁÃÈIA Ã%#.LAQ—E'9,–DZ€‰I’d³“(KŠ<Áò4-šYhÓ¦0lr² ¬R%X@V²`Á†Qr`ä(RK9o½,ðâ5¥ê” òiͧ(¯Óˆ0mÁ‚Òz(ˆð˜9ºÊiQÅŠº”"Ò8¤ßX/UÛH˜)É-Y¾„ÙNMša„±3ÈO €`=̨·ö9©E XQ©Z¼Uk0.\–%;Í íƒC-qˆcÄ»)êꢴWãF"t(_ަ¸sçË—‹˜NýïÇ—1z»£ûŽ A€šÿ«’ž6vÈhœ´é Q¥ª¡H‘V)^¼p;{Z>Ûj­•[(íôæ„\ ×%”¼ã`GQÇÄ„»ñfà…ND¤á„NXH¥}”IcŽ=ÆÝÇáxæU z (°„í5SZ9ðIeÕõýWÄÖXùÐc¤‘j±%n3¶Ò F$&è“­¼C˜GÓq¨á\ॆ…"¦˜·4¡ót¢æš 1b‰4½%GdR¬”Pç‚z3:±‘{8ö"ÊŽFmõcË 9€˜G©ä1cH#"FiQ;Tê£)<¼”%˜\Êå%aŽ)f[¨¦èA&i²©æ<ódÿ§œrÔ‰Yfåå‰URXy’87z £U6ôh~#È&–˜11ɳ·Eº•Ö•©>œvŠF–L€Y¡¥u½FªäÓª¬ºÚ ¬oš(§˜Løà €´h^g6(ŠRïŒ$°> 5hUFÕ‡–°û Él‡L¬Å³í耵QbJeYd Êy»D‚ G&ò:åäÙÉ'³‘b&é²Éî"‹¸ûV³óÒ›Ù‹xÂ=u3Ã}Þ0>Â÷§üÔB-àGŽJÌCž„©ÇD 4qš-0J#W…(ƒªu)‡ì…%âøÂ¸Ò‘®ã³Ÿe"¬ˆVX츰<ùÕLÓŒ¦²©ý¸(ŽrÿL"ûŹ:¡IeR˜‡;ÉR¡M¬#QrÈN^ˆAú« $@] Ô%kØ…™CtÇÌn6“ÿð,h?뤬©”i=-.Þ™ØÝX7;—˜b‰ÇŠî4·>åÐoÁ!ê(-f3§–-åN틤†$]é2ˆA±‰„'Œ]–ÁQ³þÀ?xÖñ BSæ=g)&Š–¶v¿Âá-õŒØjhF,&q»Üö5xñŽ~ŠÐäUO„ 6QÂ0rÐÍ!–ÌdBD1ê³ 8¦Le gŽœÀ°fÃÛaÐ ›Z(m%JÌÖ¤¼ƒ9Uq%Â4ÓÒÿ†ÀÁ˜ñëGÞÅH_¡@"t¸‘™SÍÈÖ;[)LaŒ8M4º¡2Ýè`¶üœñ1èl<#½+Ïúï^ˆ9à@CБÞtn16;Iª¼´^•¾MHzÊ›0!–1ü -¸CÏ€Ã(ªáé“\º”™!³;KŒI¢Vàƒ3àÀj•µ¹£p..s+3ÁTKœ®y lÆõ›SX…h+DCÃÛØÃÆR7¨…K+[ /›ð„™0|€¾ðE Z°8ðƒôX‡tíÝR–GÜøÿ<³$ê  iðc,Ží«a,ãIðd~¥˜w¡—ôº‹4s£&e(CÊH„>”x ÃzpÆ(®Žæe«ƒZÖ‚K"ñMXä[PFØù‘ŠW€+ 8Áºä` €˜3jß K•KBüÈÃ\ û¢LÀíþ¼PïiTHÔAF!ôÙù{¹ å”7”ñq d¡Ju‚ €x"yñ% ŠÍÙ}Ãât+àTO¬@yðÁÌ €T°Â(€R°öa ú¯ÐlZÇlâ:¢Y p€ƒ7t 9 oæ¦1l¾¿`¨ˆCÇc[®Ÿ#tÿÜ׌ÿ° =ìåÁ Z>б7XäÁ ötö©åÔó ÖE? €)4œ€_€wêÐá” „0 ¯`šÅ á& sç9¯6 î Êðh°wK’gh  —[×7!ôÀ,}¢Â%{á ‹óTËõoÙBF—|€~^â ƒn rñ']Cvz¨7 :  üÐ ÔU^° ' Ú: B A Õà ¸gÁgK´Ð¨5n¡ Y°p’ S讆4'Ô§[Að,Ï‚‚¡±ÔANu8UQ…„PÚà §ë€~”@Úà Õ%ãZ‹ÿ(ØÂ)Þõ¯Ðç8 ¹  ¯ðà _ Kð¼÷ ÒÉÇ ¬À ±`Z^ˆ ã1Ú  Í€K€l ‚ÐtL0kƒç"&^baH‡ƒ|ø8åHâ§ Õ@y è'ˆ0 QS Õ€$5Vî§ Tr ÷H  àÕ°ˆ‚0ð Ê ßðZ0…ðTpœàp`Á'yu}Ðît í ü 6$ Yà¡Ð2!lØQÅ|ø Kq\#qhMF|¨h³”-à êP £°ï ÃðÊppÆæ@Ê0 ˆÿÐ…` °FW “GZ0[ð '€Õ%îGp° ¾ð¬¸…0 ·Àý` ' ¯€IÍ =© + l   $`l,§ ž 9Á‹KðùG@{e}É0ñ³´\L†$™h!I±hP ‰ ÒPðOòh¯|`t-ð  ¹piðra° iP ´06'pvÚ€Py”à$ïX ¨Ö&2P•¶  ýÀ  …[é z€}°ÅHh’p«àqÚp jˆ<¾hCTŒÂ( )’oòâLà^‰æ‡™!9 ê ÕpHÈÿ |œ  Zð ¯ zÀ‰ÁWžÚðžX3a=m°àqõˆN±¢ n€šÕ –|šu ÐI€ýàÎà Á§z íÀEP ÅÐ ´° ÚÀV â€pP k©3o ‚\t‘R@SÖ—oÝSÿõ„ppŒ•¹(Y K†{΀žèi1) 4¸ Àp\ÿà¡Ê` )÷ç2ÀPòÀÚpVèÔ Vº Y€w¹MÊ    qP öà œ üP¦h\° ÀOZ’ðx‡) 3aX‘šÔ hŒ$ø|ƒeGzil2Z¨M6 h±°˜¯ÿpP*:ê Wp$ ê Nbü  ZŠIV ž žPHè i¢RãeàP©˜dc`• ýЪPvW Zù Ͱl€Z¸À›mà µ( º ½"\(%ê8'ÊA #Ñ7£…:£LÆÊ°˜À׫° uð >ª±P å°“å$Ê€¡Ò  ]e–*jú bú¹àPÏð‰Æ†Iaj«ÚP ý0[àºMÿàap¸Ðp  ( ,щH ¹H'Á õu‹¡`.ÖÇ/&U„A2ÉdÏdW\tjT°­Ê€ÃoxG 7y ÿ§ð @ Ô…³FÇî ßÅ ¯À–ªp ú`^¨š SÆy곯.P«Âà ` ¶ ·0ÂPv˜$ Gà«l Å  peÆêqÞ 0'žãÀð/&—{GSƈÀàH%+“U]˜K6 ƒY,K¹°© — $P ˆÐ”“ðYR0`*†'€a¬ –Z ‰K‹¯H › M úÐ ‘™ ýP p·*Ð Ž€·`Û$ <@8±g[ ™`^êÈÜèÊJ'±ÏôE̲'˜O1xðæ£ûL\$¸LÆz˜îÀŠ: zÿpª ¥€  Ð nЯ `h ˜Fy/°üà Ô…-是Kº é ÒPµÂ zð à‹ðÞ«Š™D”l  Å ›P ¤|Ü „ÐIÇ‹¼"0·ÿ¼Ñ ßcSs{½4t½ÇåH͸PL¦ 4Û 8E¸ç" úP ž«£0 ŸG¾û ÛaBWœ€@y(N Öp Æ™ (m±ð w`•.€µ À| m°©˜ö!õMë(€ °y ›ÄIž$\LÐ]ä8¡pså@ô€<ÿ Ìé3ƒ1xL±° Þ@Ž´d”7 ê ÜÿÆyÏ Vn 6rÀ›ÝPF™Ð é€H€w(0 Ò/Zð`  óÀ›2° APŸÐZ{ŵz[™© JÌ ©'žà»=Y Ïš,`‡ÈÆ(r—AS¨ûƒ ¿šRÇõ/Ž'‰öÇ8Y°HÃ@ ÚàÇà šÚÔ5øNwÁ¯½ p™€w®ð”·ÐV8"1€É' à + ›µªµ¶Ð¹ð ™à¹Î &—&TPtzP¡ÝPœ /à å`do;.AŒ""!Çæ" B©± JüÁ˵#QQ.xt„`ÒGðtˆ© jçôÎcÿåÎà «p …pº z@š[°©Ë›ÐlXÒ€n/¢pÓÑP«P] q 1@–›:J¥AΠ†  ÆŒ„i; @ ýa}à !Ç]! ¬l]J,ƒ1‹ô†¨"° î,­N€„°jÇÈŽì¡ ¡Ð¯^NjGxç ç Pjs׿  iE pP]« ðº0ÑPh°qâ@ аlé»+P OyÀ1^’ 0•@Œ>ð!€!ôÐ\à>J¬GpÑ¥!¶Î1A¢'êP " w~¸Gˆj·’zÐ~nÿÐ pν 4 Ne9 <Ðp™ÌÏÀN»˜ ¤`™‘Éòmê Úýð *P"е- Î0¥Ap ÎÀm ¬  ê ^"1r ùá /Ý3ô¯a$"Àp/ÌË=S…!Ð 9 7  1½á%ë°ÅôNn áºòЮø°Ó)°Ú ;¹G Ñp&®ÝàNA°’ü`âÐrhÇ¢°~ÀÏ PªÀ ¾±žû®[ Êw× r`.+À(ð[p:Gá  ùÑ iýÛÝÃí\p“@"€ÌÉl»Ó9ž  ÚÿPƯ§&5*ßí îø  áº:M+@ޝGº€"œ`Ê€¾=¹Î@ €Ð    a `Ê öP¾€Â[@é«à u ‰°@ωþ>Ðç¶#]atžá—ƒç € ¼·DŒå€Ì+ºíÔá1¿‘[b€ÀÒSè ^p \F\@`ï„<ÓAâ"Ð @žð>`ôr!A€· ¤°ï°ð,q&Ü`fÐÖΣ"&ùA ð@±ZñqNS•pOx®ÔŽÌÉŽáÛ¾í:çíK`*L²ò"TFž“@Eÿ4ß¾ÁœÃN-Å_LíÚž‹9AÛãaÞÐçd Pfàã±ðÂouõuÀç,/½@ñO`ñgq®DÑñ?}®5À Û.‡ÓéÄÓ-Áòn?&rRFyÖ=€Nò>p‚àSF`ÓR÷p î€.KîAoL ñ~Ðø›|ó,Þpøæp<Œâ½`œŸõæ‘\_Dñïñ&Hö50+*‡¬ßú“`*§sÎdóq8°q§qÔ)Bâ"27¿‹võPab•pøk–ùðï›!E"ù” —ùF²ùÿ½àŠÿúrî½@ú¥?öØ€ ?$ö¬¯ÏÒ(y?2$´¿U2Áœ¥ï uÐ¹ï €poq¿ïñÄœ¹:u.ÐCHσÀO*ËGoÒÄ'~,°옔‰“¼ äÆÍÏ)ùL&¬d@¥Ê^^)Róåœ9½ž\Àya=!jè”Øq¢)^¼xð@Tʱc;œ>}jCêÔ{Uï±aDëV­°ÌøräÈ&¡Ì†ÊÆê½c•*=Xð ‰°š{â…iPœi‰µw¢· Ÿá•Z* YÁÌšOëÜ™O¶Ë~ö`´W/¦Lw`EÍÆÆÖ­[㪠ñÿ16€EU‚UÇ×î±ôL–.̶—·pïæ8ÉGa¼M¼@ØœE#: çG‘~*¹<nã`Á"‡˜¬ˆæœ›8'úŽLØÛ…¤&‡6ê¥|0¬S§² @¼Ç6m³7ÝvkÁ‡P€ N¸+²è.·<À©o ¢Î‚µÓð£û¸. £“΢^‚yI1Šàz# ¦¨A²—¼°@¥ö€Šé§œ.hÉ(¥ö#Ò¿Õ0Éû`²I&msË›¯vófKó0G ý ®ÑP,¨ŽDQ>?h¡…É1”OD•Ê;†.í.#.x©=òÓ1§Ì|RJ FëÅC"ÿ¹àÂ@«ZSrGGP2'‡³¬ŽZ𥅠•Â-OU²(¤.a$ÌÒÄD“Ë6 ó 4ûð°’íä›®ºò"ê¨/êìä…—óò1ÊázO3EÊ/?Wg]‹4Ú$'Ì-‚,Í´J¤¶E .‹¸µ» ë0£\Ti1 ®0눱wÓ]5ÌZiqÎèä{¡ºnîÄSO£æÆúŒ%t´,-@”ß^•öQi%uòÉë¬-èÒSç£FoE5¡cqE-7ä]_ðƒÜë0§:4 °h]”ó¥×({çÌX_~õÜÓ¨aŸ@ʤÍÎ2a.I‰&ZɈ—†uBuCnó.ÿ¸‰¡ê<Éj­càæ…²ÖÚ 1W7d±ÍÙÃ^NÌiùã‡g~x{žg|ëªÍà|%¸Úô¦Ý})ýôÔ ²uE&j ^ŽÔ5FkaiSE7TQ¥rÈ›oàølTá_þ`Àþ©"ËkÀó w9?äË^3ö´÷îñBöA]/Vòÿñ)'AzÃÒ§>£Î}©Z‰×ÂEµúÙ¯ÃÓßþø@ÔІ7LBu¨ÃÖP€ü[Þó¸Öµ¯qÃeµê+xA“ %4 6¤™(šoaIRß‘¥4÷ ]*ñZYh?¢C†3üŸ w¸Æ$ŒÁo„ãÙ˜„ÚPìÁ:fßM2  /°!¤m=‘%U¬A"¹Že4Òaš‚‘Œ­% ΋_ c÷¼ü™Q†Tcã8%”Ò”§D%*G9†9Þð%˜ÀÂfêü‘‚ˆ:J! iD&²îzD#—A4ÖLå<ÇŠ“Žtõ4©0‘Ö–öS|^M<aŽ˜Þ¡ þSÁ5qªÓmþÔ¬gEkDO9JLài/‘­ŠÔ\€ª=óIÕªž§ƒYÕ*Õ¼hô¦cUB7{šÆ6Ö±ÿ…ìcÑêSo®õ.¸Re0ÒxÒµ©ûê•I­HL¾ö5âìVÍàÕ†õ°¤,%7yYÚÖÖ¶ì*[J9~C¿5@g™Ï‘‚OöÄÆÎ÷(טö¯r§9LÐ4†U”°UlCo»]îÚ6· íæ)]€ß¾ múì"Ãä.Œ´Ædés¡+ÝØT”:}hwõ»ßÈ~·²cø2Fâz¢ëeo{—û¨^Áת¨…n"bêÚkæ4±eÕ.5¼aÚš•›ã$†×Ü1bwhÕÀ^¯Ikà^óÂ?­óës;±â4Ùe(‡u¼cÜö”›Ÿ°Â H\â'Á¾”ÿâh‰Æ‹ë”§ƒOVVg|رÊ6Ã5D–µ¼å-ëx¶ŒÍ²—ú nØÄÀ|DŠkä×ñÍQˆ"”['šÀš@µò•#Ëå0kx±ZÎÀâ0‹ÚB Q„!Ÿø ohdšÙ¼»j\ã{p•î¦o·äú=«V Ð<¼dýæwsìX=þ ¨‰Oüˆ24¾ j—¢Øn€ßªÃíq‡{ÿb·|á&÷îOwkÊQŽ^œ]×ml»æ»ñŸøA,ÿz :þñw÷Üaî“ÂûÞ¯ü÷+Æ!oß ŸÃ ¯’¾¿>þ¦eW9Ø’>œ¬lã…™?èç?_? ©9X¯Ø“½õÊ>šà>îãƒäƒïƒ@ïˤòã> x¾…j?gë0žú;ùs£9b£â#¾$øÿé;­æë¿ç[Œ§ ‡ê›†œ†Ç ‡Š[Œ³ä0ðAŒ@2ï˃<(‚x¾A˦²Ú°‡ú°‰ú@¬#*Û!¸£h°…,T…†õ+¼8è¿‚1„ ð„FX¯Æ£Áÿ´Ápp·ŒóÁ8t…9¤CÄ€;,Âgx1ˆMÐDvX$|¾ª0Rʳ‘Ã-pòÀršÂ),A,ì‡Iì[ØBšÓÓ9=P†NT!ø"ƒ3DÃØ[ÃL37|CO˜:ü…4Hy˜…Yˆ€ˆ‡xøƒmðE@Ô„KƒgÈ>0\°;ø;¥›B(T2=®ë@Šâ!W" þɆ,ìàFnì‡Â:ÁLD…q$GTÄP†E!PÇ ¸|h„x4Ài6lÃìÃ|yˆ€(øƒÜÅZˆ€[œZ|†6hï[À…ä¾HÆXF+¬©PAÿ*CdÆ;¢¦,´…IìÆd€J”¹6ŠƒLÔ†rDPÉ•\ÉpI•<"xÇxä5T€z¬Á2@0|ć?ˆ‡‚$ðAWˆ¥¢Œ%0`È…t@ø–;+¤¡sD¨ÄFÂÂBޤÄmÉœD[ØŸ™ƒ.4I”\Éd4ËdÃS8…PE"81š¬¾2 Ç›´Ç\|p0 Ê¢¤Ã¿üKL4À;8L;@Â)Ä)šÛ¿ý£F:ò¡²¯7b¾õË9”,G–LL;Ã1üµ\Ë´$"ˆ‡?’ǹ,ƒ›´KUDÀ¼„ÇFÌÙÌ8üÁÁt@0x!@L§Ãÿ|Ì’ôB“ÔÄâ4ΓÔÌääÌsÄ•E— MÑ„ÎÐ$‚ €¸L†³SMº€_°ËÆK3|¤IÚ$O:´M0Ì;¼CWø†ZøÞdItôÄN,ºÌSLPÕëãSy Ò+¸B•ÕBÌYEÔ)ÕMy †H ÓéœTNÖ`V"M¨TaÝd€€Pý£dpVR}ƒSÅSÖTÕU}¼ ½ÓƃÕYåÖnÔ[½U$"ØUM¥ÔsÝÔaU×u=ˆ‡„Ug Òh•V¼ÉjÅðäÓ,rXr¸Co%XBWD}€„Ô(€Z(WN…Ôu•Øÿ‰ÍQ †Z @È6 1xVz ÒG³>}%YVE°|€­Ö-XoMØ—=Ø—•Ù™}€Q@"ȇ¥X`õÔžõYOe؆`Lƒ"DÈxüؤ Ùs‹=’ÕW~ÙÆÃ„A Z…mÙn¥Ù@ج%®õÚ%4ÀEvø€€C8„ýYO…†¶…d€†*8ƒm`¼„&h‚$ÍÐ7HÚ¾µS¦•Z’ ø[Õ$‡©¥ÚAÙ«åÖ¬uÜ™%"”\ÉÝØÊ­\=|†4x†?äÃ\ô\P¼õ,È[½5ÝFh‚¾UÝd0Ý\’]ZÃEÜÄ}YÆmÜÇuÜÈÜÝÕCÿ ðÝß^¥€:Ðß=Ýx<‡s@]¼eÞæe^1€ÞèÞÕÕÛ&pÝÁÅ^ìýÛØÄõ^bßð_bÀÝò}\ÝÝÝ<À\Ì ÞöõÝmX^çm^kÀùm^éÅßüÞÒ­ÞgÍÞÿØ`î%ïýÞñ _óU`™õÚÉ]ßîÝöm^|؆K çÞ&€(xÐõ`ÐýXýÍßöÍÐßíÛÿ‚€Uá¦ZÖ¤ÝNØ®UàT áTðÚ®u`^_÷½`¼mð]û],ð‡þàÕ]Ýà¥Éö^ÿÅÞîÞvaªE`ð­á+Æâ,Öâ¾aÎCŽ`n|HÞ n^ÿn, ÝFáÿí[æýÝ^üuâ'^aïeÍ<bØâ>öc?îb¯0æá Æâ&]p#…6Î^#Ndûmâ:Ná;NÜî¤Ð_„N„?Îâå@¾â@&=¤ÅTVåßÅ[àm<@dùEc5>cö‡[Æå"väÐdæMZHVaÈdMÞdOþdP6eÀâdffY\ßTv_ùÅ"VdÐe^[v]Þe(àöf!ö`HFá€æLÞd 5æcþãdÆâ\pç\…x…w¦gyžEUNåŒÍ`çýá&ÀƒÆGVãvd€æfoFè6bqg€-ç¦Pÿx€t6æ?¦ç‹Î…Æh{æèŽÆç4a1ø`|à€mðg€6âÑ]€Fé†â„†é\–陯er~èî”艦hOöcŒöiŸîè Žça#ö¸P`é€öàsð‡W^ê¨Æn†b°jØà 怭æê®Æå«¾j<þ…œ–hN®h-þé´¾h¡öh¢Ö_¾Ô=ƒjféV^¥–ê¨ë½ë¬öë¿þk¾¶jïíä±&ëVgµVl fk{Æçþ`O8Mé]…Hh‚9ð‡¼Æƒ™lÂöämѶÀ†ÁökOÞäœ.fž^ì×^ky.€Ù¦íÚ–‡Û¾mȶfÿO0‚Kðí¤väsè…F éâ¾å«Nít„ÑîcökÁ.gå>çÖödØ®çxVëçZ¼mÛÆíï–‡ÎõÜß¾„3ŒòöíŽPèP0nãlÕžnÄ„¬æë¬mæžnå¶në®íïoÏ%ðßn¸eôFïH8Cß.ð­Îjæ¦pÑVnªEí îä §pþîoÅþïÙðçGÏÅßö„'8WðxDï‡qÇítN\Ô¶†·gnÿðrï&qÜ6ñ¿oh‚ófñßÖPx-0EöHÞ*?‡‡ð¯påöä¾ÎêçñOçŸÐÿ27ó Gó!Çm‚,ò\ Æà€%_pðq`-@€…Jè…nh„7‚­Vc5†q7tOÖqû¶j¿ó0óêÆh4—ô WóÛfó"U$°[9ÿíHÈæFàåFPªJð=¯„ÑI†@ðä5ôW/mÓ†wtXoô(óI×õG^ïõ!¿tg‡6`†:p%÷ô÷E`öfw,àÂ}ƒnP•hV·rY×vC¯u[×rÈpç]Ÿt_7wö[öˆfà#¨`9÷Ãy÷ÃKˆ„mpö|ÏwhO: ôäÕvFçö0t,ðvkY`(@ÿr¯ís—øs/‚Š·x‚dsvˆ€< 2¨1 ÷yzw0ù“Gy“§؃=pv0€Nè@x‚3ô+ßë*uGGx?xS@†…G5(‚‡§í‰Wú¥ïu‹¿xŒŸ…ØxG`fP‡ºù¬Ÿ÷•Ÿlߎ„Hôf_ù”_y8‡nðq‡N¸Oh*·r+/xƒt+÷y,@ZPƒ*Xxhhø£Ÿm¦ü›uú§'ÈZ˜… i¤U@SéÅûÇfÙmÚ §Í~*´äˆÛ¤jתÙÑC×\ƒB¬áŠ;+е^ /žqF£¾æì•–{l³‘Ðà@9ë,´µ{—B-˜£I¦›…µÍ]Úf[ 1%³K.âJ\(S®aŠ»ÔcOî† l<:šy¬±ÛüHƒÿ¾ûªì¬Â-[[ž-´ FÁšBÄrË«`J.×4L 9L ¦¯R^(Ëõ¸’“£ðBÁ,H¯³ `´2ÖÛä¼5žÜøBA³ÌzºõªÐÈX1i_Ó§Ð{\£)²@B=`Ðø«Ó7ª4RÇCõ¾Ùe3Ùdk7H´Q3gûžç¬Ai7qÛD¿í¨ÐÔÒ…+Èäít`UPªÉ*?8øØn¬×`[ç¸ë¹!s´¹¨}M›77ºdñÜQML«‘·É'…eÊ—¼/U{°Þ¬ë-Wí‹Þºëùåp¢äÔ’ŠÏĤ²ÜPÀëXHneÊË?¿ÿòcB@¶ 9=õÕgÛìžáˆ6œkþËSsd>$ÞJ[ 0‹ J†(EˆßèLÁ{ØÃl2:ýB˜ w¸Ã.¾‘‹wÉÏ(ÊFÁHŽ÷Û"˜' Lf2Ñ[%6?™5RÆÀ mXà U–MM ñ¸F!G1 yQ2°G ®áŠ LàéÅå±DaÖâ™fëO †= cô£¦âA&lê¯*ã\%ëÚìèŒ#°Ô0Šo< ¹‡|ª`ŠxÌ»ØÅä‘ÏQ¤‚÷LÇI¿Q€(€Ñ&ÆØ\1 ”kPÔü)Øq±jjò¹(DÅRø‚¾Òp(N¤ž0x R^ Ä$öÐøÃ(îð€o¨3Þ:+ÿ:ÓA‚untj84h€}Ì 鈂¡Tj²ƒ{ j(pª¢qªb0fÀÑX„Õ¤£ÀÒQ$1‰ýœÅ5ЀÝyë‡Té,ò#™ žŒ¨;ȉº’ræ^ƒ*,À¦ñà|ì*#`…Ä&e%nÓ¸EyTÖ£¹èA Ôióž²T©LF(\!8gœ4䪮ÏxåbË ðæ=¯y¯\1F±Ì€D Ö%†Ku½ëšd-”¨K$Úã¹E Ѓ@W2RáL`ccñ0&¡â×€!±dÀ;ª°WdE ½N/TíÿËŽ<8‚̈)¨"•?”“öEá$Á¨O|Fa=ðcY“†<˜Àd0±‰K°Ãè;V¸”4L@1dàCâÇ×Û~½,ŽRÏ»¢Äd0eÈCÊTùÅ'!5á|.§òÀŒQâÕÎÀÄd Ö¸ÁŒD€æ5 M!™* hìÀÀQf@c`@ñ°J€ªìaËœw•ZfGø28ÂmМ²“†Cx¯å•t6ÑLM@t³H žQ;3)wæ4£óÄF@¤4žBÐ5Ü‹ÏàƒœÑi<*Fø5´MpJúFÀŒHaÿ_(ÅbÁšÅ=DÕ¼bü©™£¸d€Õ2š`£ò`â ð¡ Æ¨³ ÖÌbd˜Xí@;–<Ú¹g 1ˆ ¬@Š68å)ìØLŒð‡Jí›áVà¶²;m…ghâ ºÐÁOXíÇ–¶¡Œ¢{ÓÌ R0 w¦w—™4ÈR`¨ÎÀ<ÐñØ÷,†¢UaQiÔIÑp©“"V—z¨®`GÌÌ Eþ` ¡üàž<õÊÓ^í–¯E’ËbkñÜZ,¼Äƈ€1ò0 Yî]–ÏHÃ6ª0ôÁÐA=íÀ÷v Ñ€Øò¢·±.Ì@ÿ…Å“CÆ™¹øÇ›íjÿ<Ë«[ðºýí²ˆ;'¸`cT ȃÜ'ø”ƒ¿ýí‹$ }÷e_<ðƒ¿xY0åGøÙÑmÐ3_ô{=€ËõûÈ2 Ƹµ1 \‹G+^rÐÀ=ø‹NèVƒñb÷ëî/ýõS‰>^l7ÄÐùl>ÐÍ}ËM¡þr-Q8¬ €A³mÅïß÷ßÐÕŸÙ¬ÑýCA›éD \yQÚºzÕŸn ‘}°å_ô•Þâ‘›Á ßâ8!`îE$!ƒá ÕÆCìÚq  ÝýžÒ™ 6Ò€í© îA›ÜÈB õÿ•¯žlÅ 6¡þPÀÀUÛ¯í`žà¤€‹ K !áU¡äTA»ÕÂi  ‡>¡®áž—JßÂí,DÕîzá…ô È oh`¡ ú(F¹–"0š©âÎÇ÷ÝOLS¥˜‰üÔÂÌÝ¢4j ‚¢WiX&)]€”b CfâbRЀ^)Ï,ø†ªrüü`Ò4v"1Þÿž5B ý"0ú+F $bW1%žžW-ø…ÆÃ4¡Y¾£ÆãàÍ#íUÅ VÁ=~£bP±€7zãà‰ŽðFª`<ôMË™È1"¤*dFz•š‚+ˉȂ+ã^šEašN4U‰E a< ƒ¯ÛE#In Ižd}üÍXœ_ž*R$PÞÞEÝEbd-œ¢éDeMöŘ ^þeá åIRÊÔ˜¤;j¥Sz#(FeT’¡Z¶¥ VÌÐécB[LFÛ!Üe´ÝÞ]î%_â%5‚%Tº LÆ#„ fF^ä2 @› 10À ›K¯ä:Á4@/I  À«ê´'œ£qÌ9w©àR).œ£'T`BÇ®ªª“?q}t²%yÐûjKH@d¦s•57‚”³.اÔê•‘ç лª±ÐêÀQ µÐGà0€^Ý@ ÉjYaØ`Ã$ ¬ã¥TváBgØÿÆ{ª D†6XQELh#½4ÁEKTtµ¬=ÀèD†Á»€½ȱj®Z¿ý“áoçé?Ì>øç§: ÓÁ,ÍïËtÞR ”* )PÑaÆÃö™Ð€O:iP@, ‚ `x«ôâ\{žªÎN;Ç2:°Ÿ œÝÀÞÀ¡&0€54ðAèyzN¸§±e¨&¬B ® €¨ôçt5 €÷…¨ËT ñ¸p‚Ç\ƒEúƒò >4 nÄ °‡?´ìpÇ: P{ pXØc@8•7èa à ÿL\bxÑD5Xu·Pâ:xD'4±¥ðhÇ„ÂÐ ¼ *á¡D •(A R¨B³”ÅF62A¸‡$w¬<ÜC- ŒC"áˆDøq ð@ND°Pf3h€v¦’  =&À.H‹1,9ëD¸©ižñ Ž ù.(@y.É®p‚.Ɖ (€ >p ÀS:C@ž»ÙÊO*ëÿ¶b€ À0ñéÀÖ·ˆ  'ØWh¸¢O&àJû¥´¢'Ídò<[¤B€o"¸@+Í#OŠˆiíÙTŽrô7ÌÓ vXC"æpÿ¥ÜË$"8À`9È€ àrÎÁÜdÅÜ3­H…+hñ  à  ¡® &¨ƒ4Nl:(tÏ…€EOÆÂØ?( dâ‹j, Í PÒ…ÌÀx‚7°„®LZv&g`òð¤à…4„qÑáí= xfLI®]ưgM%ò¯dLã·xX´‚I5À@!Qµ ðÏ͈¸§&·§ <Î  @‡€º.È6µIhüš¡ ¦ÕRÈ1A6P* I@'!X#ÍÆ*CM-­@8ƒÍÈ@=ŠjRcYûv˜3§% °'^&æ1p |ݼÐÿ šA&Ê€LPN5˜QË L"´ñ!ðuXu¢·¸¥ “@à‚U©‹ÐŒ7ñզ˖d«ÚK¿&Ûe숃xFßH@8À à€q³ ¸À/aš7‹×9ƒ}Cm”¯U8K.A&ðXaYU @S©H@;Ì+Ú-ˆ¸Ÿè¾ÛµÌHM êňf¬ ÎAœmà ?Óuödg€Uö”Ü` éjî¨"`Ûäè>ÍœWMªq€³ÂghñŠm7eÚ­Ê|çkUMz‹#¾ÓÅÒ& €àz ¸‘cšÆ 2nÿ€yb ù håÁgx>ðølFÓ‚Xx« iŒ â h1¾á n°ƒøã˜ä F•kAÃŒ¸åq„̱Žt¬Þ0€<öѳ~À…ÞÏÊ`:— Ѐ¥91ˆÐAîhG:lû~F2ªSí ÌA~™ZˆJ€L.s „#œH¥2èñ…Ê|±±S÷vF€i[â®FD†À‡N¢c…pb»·`Âõ0ÊQ¶¡…†ÆÃ8Wƒ-áP¸³šu$lac@æKäê˜pK%Œ™‡N¨ûl_„Ls,À\ÿ£©¼D D€eæL`‚á˜Á ZžÍhAPê$t\0Ø”  ¤k?8ƒNpqgì n n…S’Aªïtåz¤c“§†ƒß-€ú¶ƒŒ®2&* B7;Z46 CÓFÀ¤æ0ZÔzà™ ”Ï!Àƒ.TK{9²AÄðBgÁéL FÏ»‰½MÊḠ½O)ì\xÁÓ]b Ÿ„ôÕ.m`dÄ"”ߪÉ\VÌfOø‘›lP‡NeØ9ä4³ Úç8àÈ*ÛýS_žø Àøû 2pL`œmv† ”)‰ÿ ôÎû#Ç4>•‘gƒl ÞˆQµ Æ´±ú[à0à‚4@ƒÙà¿Ö}À5Oƒ1J¡±6‘f'n  Õðy]À+”7âJ¢¤•¢{•ÚP9Ķ,ÿ€a°o  KC‚‡¸{íÑ\¸ˆaRS°, |¹5"ÑT%±0lÈPºB/#À]ÒrÝw0bÇÀ©Æ>t6Õð9‰Ó¸S'`½´# uÒ‹P Îð(Â@ÃøTÈñçä}Èá.Õ!  *WSPm2 Ðp   >Õ]¢8Ì÷Iæ‘ Œèñ@h%…|0 Í8°’Àåc#hý$KQ)ÕäpÐ….á‹óÒ1!à4t‹ØÈ/p%## +ð|y“{ú'IiRË•!dÂp`N.x' ÛÃ9Rÿ5.³¶hXERÛ&ôBPð. 'ÜØÄg31‚ ¡Cƒ²Pæ!²ôk¡cuËÓXÃr!ð`lT£¸; Ó]oB`ÕÂaŸƒ{¡uĈ–Ó-÷ó?hrÅ#úAN[0KBp\“C/ P¼P e\>A]>}§((ôèu]ðyr\ù°3pV3  ‘€3¸”ìa0@~Þ•‰%ÈM\W)ÀBsgè³*1±5”‡@qŽ€^pHØ•{Ç!Ǹ˜òˆˆ™H|Lf3o–›–ƒñæœ@ qðÊc19é[Ûµß.Èÿ!‚ÄX"°;:A>098Òù­'šÀ 8 >¶0•Ã`rù>Y¸$žœ‚\õ$' yr @¬’3CW0wgè¹¢+”úÂ` ·xYÛRü’WÕpoc,rÆ™ƒSzbT€>P °zEs™#¡CW‚#Õuˆ”yX¸a(6×’$8X¶bZ£`#0 gE 4¼Hµp[À[|5%‡ðØ1Ô1µÓbå#>D8a³¡W ±e-0@4 €¡ÿ°ar3p/¦K{ÿ±")°Øa@âÃ*³ó6+vgx&§éé*E}ʦÁ€ Ê€ s5Iÿ ¨@&¨«å .`!–¸ ] &8‡“+   ‡ƒ©†Ceqšg¢*¡Šå¨Ìð;¿S¼8 àp ºR`ÖS]ØXH5QÀP{š_£dV;糩ª²àÏø  ÏP k—1p:”f2@6$³е' nºY»sgNÉ1¶S;‹3*†3~x|Ð6õ7)pÐøð KCjÆRp²(kõ‡Q в-« в ¦I³ ÿ0r³mƒy Ðö'Ù0·ˆÄ¦JÛCãH´÷„t6 HJ«"o¿ÊŠ@ÖúÝ ¡Ru  Q KÎÆ qDŽ@ø° ×° Áˆ7™¬8¶¯ºjpº²2œ ‹ ë é€må ãâW)àvË£`òé\° × ˜À` çÀï°ã÷ ¿†^z´…fp’Ðg 5s÷`,  ðð»6p'$ ´ûx Ð ¡3Bœ` }°— U7oæîèð P]„•ù:¶oÐÿÒmÁ ’€p má™p3€Ô›kðcаzd+Ebm# —›ó·”Ð Š0@7Ñ ‡0@uàŠ@òüÀ=@ò€Ú@¨…R„ }Ún÷v@Mô=rga{ôŠÀy`ë ÁâðL)PMN«¯1NDpVÐ>à<À8€`!àJr€ xA •€ Ž–6ÇËnàëÖ› €ö %!^Wr0¯ „|@mtÆldS°pi ˜`ÅÆâ™@¾2R‘€¹Ó– ‰`Z'×0°íÁŠ2p:%ÿ0r €ÀÀ#0É1`¥!©qP#ÐA4?Mö9ø€yP ÷À%1B(C(˜éx[º‘ð<üG‹ÈI:nò ``„D@’²@ ‚Zõaœ¶1sÚ2¡´ ~÷€¿Lpð¨×&`P!\  P9ÂIÊu˜õÎxvJãggн.á0‹æ^Qq*k+îÎ 0‹—aœñax_eçI™1'ü° )bƒf…&ü‘W¦7 à­ïaxÒwË9b0'ðHQvÈ+] _óä‘]ÿp&@F p•BqpÁŠÉ_ÜUŸÜÐd6pÀ Á ÑÕÂ0ã¹)v©D×ÕUMpŒE zç'ý­'6h¨›Õ‚™ â´Y æúwïa3P‡Ù¬{býK6˜ Bø—1'n° 00ùG„ƒ%O Õs R BU'€`/%37ø &=â’&.`-}"ÝMÉIÍÓÙ¡Þ‘2$!Óo]ÍíÁ.X•A•‘çÁQÈá)¯‘#ü ]Q3Xè!l†Ú¸-Oé ¨ËÀ@ñ˜Vxg—ITX¦™DÃËIPÿ½>@­&»ná‘tZZ'LçAÏX¦·­•yO“È>@¦5}ß"”LhŠ˜AÙ h°'-".p°s]ÐB]ØMY¢"”…vRágîô #:ž D¶"ÓQØ:a {õÖ¾uÚ¢Ô ðÝ:yÐp—ZËŠmbfø‡v‡p²} ÒÉA'°5»…)+ —œ- -SŽW €†P@D=B/ Ü ÕÀtš¸“@xÝ%@~ aVh³U£°„HY@ D/rpÐŽ 5€´BÐd $ÿpA^R¨ ¢ fWRð ×%ž¶RìâoÐc€æ °€Ÿ@ ²à 5=¶6ãA"Àg` À%pÉítÖtJ» ¬  ³ ¿  ·³™œ.ƒP6@ºlšX³N0\¹U6«Ý#óuŠ˜#4 0›Ml'µ§ 0`/&z‰¾45 ¼½¸– Àëÿ€pàøØ¸H N V€  evšD:-¨Yv‹nî cÆX òsßaR>.\_ò^S&€ ˆP@1ÀySø[KIÚ ˆ=PDÿà)º’αm)Ôôá¾ñ…Ö¤e`ˆxÓçï„2ßdùAŽW÷ à*£”™."ÂÉâ}U p.?d?@Éð ј2ˆÈ€‘p2ÙR3Ð@Í-Ñ{qΰTc¯ò­QåyØáÒZéó%Õ ° ¢ *+ÜßÚú}Xì±1S)]PÑj€ Æ0î|„2p0Ü ÒölUJP o¿æ ² %{ôU¯. @¢¡õc  ±IÖ:¾“ )Ü$Ú*riÕ3ßwu+F‡°r,Bžxpg`0É1ÙØáCM—1ÿ´bÄŸmšÊÀŽ!Ö'  WÔoÔCCúQÚï˜Ð(²ršž%pU@1dˆ'ÀBƒ`‚' 0áAH$øbÀ ÿ4näØÑãG Y@ –,UhãràD—0] Ø#… 4v!’ÌË@aîìâ‚ ‹"|dÚôŸ„… lÉ’eZÆ|(±Ë…¸ !Ž bpê2èÛ‰\ÎØ˜8Ó@F§ym5°ðʪ(§аµ+LÄ]  €Á l0`x¨[¡.¹$XÓB€xó~” µHUÔWH ðÁkf˜\64Ðx@ÿ2# 88|ø²o.p´,zo¼·d„ šãˆ%ª ¶ZDª€—_¶Q€±ÈÚ}5ÔÞ@·mïí/S ÈĆülU( A‚ÿ&`\Îñ¾ê’8 ±ïp¡-Ć’ˆ† *Ø`¤´{-=™p .ÆcM€[ – €`àȘ¨Š’i¤ à‚  ª .> I ªq¸ôÐûÍ=ʸè†ÙFjŒ¨FÖØƒ#ð!†ü‘$ÞvÔδtDÐØ:’«ƒ^ Š  KÍh#iƒ$h2<@判­|»° \0ÿáÀ)j”MíÅ‘&.¸”6Û+ O~ÔSG:QÀt|ÔÐÂ0ÒíÎcÓF—€~ô¼Úh#€Ó:g€‘N:¹„’N H†ˆ"í-QôÜÌÌÐ5’µìÄ´ÎðØ(©6XNFÀ6PRLØ&’!.šÅ R#›I€ O'£m€]Ÿ2€¡¾ –’ϰ¯€á^jUA·,[X]ŠÚ…– ó5[Öê,Ó , ¶Ld% ¯Ò0áÐ"ëºÀ¼WŽ8e÷&¼N¤Œí†¾ì÷© úè„“J¨tRŧoƒ“ŒY4è å—1<Ì…+°ÿ¡ ‘€ƒ Èt²¶M5’@"YDc’XJj‘€š}Ï0hb‚RЪ͇6T †Ê;ˆL¨Ô÷ÞïÂ~Šš¯ùq) yO2\-h€ !Ö{Ç.dHŒ† pç8ás^opLùÜè/ifH¦"H ¥: ¹8 2¨áè0.¨‰C8Fï»D$PÆÛüëôÇ ²àTÆŸº…dä$˜€5kÐàl~×BVaHà„–\È:Ælñ\þ»°:b@qªZ¢ˆê눟[6ÚÞøçaK0€•ËXÕ…\€\|l#}GîËS¾T×'m WÀªðÿ @ÎÛP €_?bÈÝ$E6Ñà`@ñrõ¥ Âo‚xâaxò低HàB8X€g„bp›NÑF`Ȫ$÷d=„ èTà#ä½ïVŒ© áç$x(@:¨‚´Õ¦‘°6D 4ÚÉ2H‚SqÅpXˆÈ@ €6ȃ¾º”§\EðVîûN5 Æ`L®r¡‹‘TÏÈAÎS4B{ic!М‘n†’Dè ÕØ@N`È O<¤$á~HF2ޱ6DëHªÅ #ȰÅ@ô~…æ) 0˜-ê¨QÿÞæjïzAÚì#È àÎ4ã½(ØËXšsy@jÊ-pu€e,#Ïø€ Ø‚#Èž` T`k˜9A_Y$à6HÀ4ख़³‚vr 2†§øi`†<¥1 elbCÎ( °Dd0 ‰0ÄÕ8Àr du, O%wú£Ù zí$À.¤ ¤öb¢ìH0mÀÉJÙÍt³çù㛃c®rhN'ñò‡°"€b<ã¸@©öÅ8˜'s:éB?Ú5ªÕ¦À•ñŽ'Á®ŠQ¢úZH0ŽØâÖlâ~"J i"pAеu…èžµJ³ç¹îC‘\°€Ø+‚ +b™âN¤q‘$Ü(²Ò—0ÀA9ÃaOêWk!“{ðbƘ÷£Kº¶)öansŸÒ\ 0¶¹€nu­kŸì]W»¹E@;ntp-4.2.6p5/html/pic/alice11.gif0000644000175000017500000004312310017034535015237 0ustar peterpeterGIF89aö´Õ¯¯¯óòdªbÌ®tÞÞÞhH#“ÆÆÆitss¢¡ öÕ¶íöKJGb_ ² ñÊÉ¥k'$×úw’zS:7% †²éŽ3þþœLdnâ{¥²9¨ÌwdA¸B¬_0r>¥c)ÿÿÿÿÿï÷ï:†FhW<ÿÿµ<)^^_ÎÎÎÖÖÖ!œ!½!¹j{JcÆ÷ÿÿÿÿ!ù?,ö´ÿÀÅ‘û¿œa™@:ŸÐ¨tJ­Z¯NniH49€&çr[Z™X@¶8älQ €[Ëïûù\8PJ0{‡ˆ‰ˆ[JM7[ i a…K9˜K8e—9MŠ«¬­®¯°ˆ g”z0gg]‚?8½j`\]Ž Ž±ÎÏÐÑÒS78B7JaDhÇ£? ¦ZZKåh0”8^ÓíîïðW™7”z™£^ë—¥JáhªDpÓDM¼ƒºó’cÐ0B` =‚¼P³LA… CŠ”¥¢ jØà¨õh‚p”~,±  ˜#sêŒ' ™!ÿ'™ÄX3ES1<¿ i†dN!¾TíœJu%/X›d ³¬HL¬ÁÔ,(°@IŠ¢Y`àìÀ'yUK÷ÐÖ]+W"¢AKÏJë–™B#‡¢ pÐËÖÆá'aÖ®K¹ò”®jÈÀè¦!Ç­ˆ¢ÜH¬ÔšÀsX(T?ZžM›¨ëÂ`+1T>å±| ¶‚—A]Ž­1Ï[)•¶õœ “ÖæÙÜ¥sÎTóôËó˜q hH¸ÀY<ܰjI¥¤×‚u×óìä²έ¤Íé\2P=‰­¶Àz«èž{Ä$ð R»]ÒËCp10úuøÿŽFâhÎ>qh –gE”‰®ÅQ“ 8ˆ@z0PŠcéåÞ%\ÒEY,U·JVDfu™Fá°ãaH• á ŠÝ– ˆsq@¥Íb”„£ ÄŘYb¢A_¾ùÃ$lÄä .à 0¸`§?Aщ Ò-ÉÊU€fåæW  +u²€…ìæ[Cô"Ñ^x¨Î0Š=á Ô1£ yг j€Ucä9dsΙC«r $¡2’„AJþP¨¹úùDG3jjÁËT§„(˜|ç™0½œuM§é]²Î¢!ÆjXàÞ 7j !¨5–!G©y”"PJ±0²ÿ[ *¨ð T#P94ÚT)âgÄO¢pèk8êz«©¦=1ÁR$õÒY¨–6æHQ°œž¥Â#¨À 7@ éhcÙX‡(7¡›mE¬‚L* |¼¼Áïj‹ 26u1)¨Ž‚,‰ÿŽˆ@'²r“D¦¤u±h±hÜzdaí†]ÖÑP©`ÒAÈîA|CÅqóÎ܉ê€àÀPàÀÝuS#TvÒiÓ Gt•Ê2ânaʵZ“²¯f=ˆ´ãH—ùÚìVÊXÚ¢U@ŸÕi6wzK§¥v ±zi6tÇ LÒk+uàÿ²3°ÁÜxãMÜ ö†9ZÆM”¤ 9âXStÄ @Ä0°tÀnÙÌèƒ{/B˜Þrgc½—{5zü 0àszK–ƒ êŒP)ÕE©³®â1P0óÖûx·ÝáíAi‰“VæE¡$ˆãÆò’6 ¡c“XÉFážT¯'èõNƒ˜ð#õ`'{Ä‹kXKµõ8©}2ÌáY&W¥Å¨ ¯šÓð¶÷o hW6pèn7(„2p¡ÃaŽ8¶˜$¦ÀCP£yá‚Üó‰$ÅH<’ KøA¦ð*TöàÞÔÿZËáÙ ¥CÒ%íL`ÒŽJ=,&Sœ(@7¸gvëÝÝVI»‘,ÈS£«« Î[@¤;,ñ›¾á b1*–ñœ5É„!ì€ QxB8ª0z'8 [fº>V¬]1ºä±õò$£!j°„±‰²ŠD@$³ºInC”dØ¢‹-LNÈšC®v•VêNwêÛf`Ä­`%*¹Ð€F=Ò„)œçµ×¥é™îSdS±ä­æAÖº#ú1ãççâˆTõÌ'(*ˆÁ`43¹Eòvî’äÝàæž¥!YI¨²…³¥3Nÿ·€™ÊÖ ¼„jˆÁìéA}¾‘z)4¡?ûi½³ü2‡*Ø‹ZCÖA[,ÊÖéB5!è忍'æó,È)€1 €;ø@ xW  ‚Höîwšƒ9%|Ì.$aˆQÒI¶@2Àc©XB*‘"NÉ2…°Ü©ÂÔ „Õ‹AQuxCoU•~:ħÔÇ1­&- TÃh‚™Câ á2D‹g`1f…™â&R8RS])‡Æ¼Wñí¥J™*WÛ5lF ×JÛSÄ¢Æ-ýÂê`±ÀLZòØGŒFjQ6[¶…Q€»gYÿz’ ­}0Êæïl+@ ¸ÕšzX$þÑ "T4!'©×KçÄ´¶¸‡8Š`uÁì4…@ a§nèàŠp¹¤^ JÌ3‰O ÀFg“©v-¨©ÓЛT°d H‡Àô9Ñì²€Ü$»Q·ð·Õïn¾q‡P¥T°ÄZœ)sR ¸ æª1„“­‘O­gá.¡X† †*u8ÆNÅKsÙ… ` `I{ÄV²‘c€Æî‰ÁúW£&Ñ€½»$|Ø“+þ÷‹MèQ’_š­ÕFbEò%ÒñÍõ€°*n>Ô:…ãuÿ£ƒ‚óqHC¯ M Ì €°Ž5œÅWR!…RI@ Þ='n ‰* fRIn@¡ FMjšþŒdÁ‹¾ÓŒÂºÚj¯–S®Œ#ËP—Оn jƒ*Bâx¨|L³º½{Ã>"FÅàAÀd`<¨ÀK0!L <@SÝV¼ë¾M|Y»Þ%¿`O¡ÂåUà’™½F{F`‚­½Ú ¤Cm€NC˜ÑXâ3ÜáÞiô²L·[Ý0' §Làû4È*@€d@çhÏÀè¼J†ÔNã:t—õÖŠ7 ¿‹¤0’,ô|Ûv lÆeÚ侨ÿh§s§±Æ7þWѵpË«—=8^×íÑÍ0«5•‚}9»ò¨{t>Ô»€çyÏ3€˜*ê=Âât€?H£$-€ËÀôVômô]’àÁß•D²ëN<42! xýN0è’µ#ðh¤€IÕƒ  ­7fσ7b«rôuúá1GhšUÌUCHç±üÎ•ßæÐñ``f(D a§d@S“|Ð. ¹í.¿ìJëËØõÚî;ò%i~3V¢IƒôÁIg:Š•<Í­L8 bö/Œ¶”¢Š¥S#ÐSõôFa–QV|„TÇ#AÇPZÿ<àj±k‚kò†5Ü¥ ]p (²W ð3š¢Gl.S»ók¶å?Á†;æ§c—äHæD0rx"Ñ ›Ð7mq4 e@gJáÎ1Õg268pi)gBup€Ò#K20H#=ÀÇ€Â$0 xA—&ЀÈ×f(x<Çõ–0ƒ]±ÞpZÓv³=,8l0#[vSMuIß3Á<|ˆ;ôkHó ~ލmî8±S27#ް>óQdž!° s1º4,¨K2P€Š5=ÒU]ó$KyV=^Æ…iö…7†c“`q;,1Yƒ!„;u&{ñ,3E F¸W=¢=¼—O1@mH—C`xÆL°sg2Às³I³HXcÊ÷sÿ²voe¹j¿  ’E§h±Y‚ŒÙÔ}°3~)RH3"‰7p7`=.pS€2†¯–>'!Sæé*ÚG`Œ˜ bÂÅ)O³ Æq4Áv°„Ÿk=¶DBþéxI :wiÆs´¨sÅWË×sîAgøsÊ·oB—CE¸&Ùw†ÿÞY¡2t UÒ b ©J‘XuÒ2d7Óé;)ˆ;Ù¤gzl$I@Ð7SçCú‚I£s *f ¦e³h¤Ð‰8Ó ‚‘"æ6m@H¸9Ub*pB1 -:ÅeVndBSšbVú¯X Ldzol¦P«ùfoî!–è<p^Ú/ÈÒQ£ß1‹G§¶e—’ˆÔY@C¤goI=Ð5¼ñ@ †ºsb¨uç& èeéÔ5ÂlÀ ¬£Ä U{%+Kh s  qŸ]B#äOmgBPmTê8wµV: }o;·o¯V«ˆz°]xÿ³³!6 r6N’"È"¢P'™Y[tk¢·“DÖŠ;#E7ó•V;R¨?p}6Ú «y‡@’¹³ÃC"”à)ðN&?-´(qSðJ¹7€™¶\×…níbmíö¯†çª\X j¨ *v›³ø‹4–a±×ç«9´(51 ¢R™!S3±?ш/XM„_Òh”§Sw@Ý·Q¿Ð+×—o™«Ë'o`s³¹oÑ‚N¨¯x/[””pcÇq°4¢P³P +ºæiˆ‡‚ªyd¥nÆ5’ë†0G»ö®Ï'‹ú…ø–‹„«>Z:dÀ `"S7`ÿ6P³“Ð7`@@Æt½s¿óZy“¼Åf¢Ã[#0’ËÐ_(³Þzø¥1Ô tò „*åK¾ a¥-¨ú^»d?»‘zš¶FZ˜g×ÅOšRmÂÒªÞbü«¿1W»dZˆ!x‡Q¶¯F½ñ6o³Y5ÛGBá„K¸!Æ(°îÁ40¼U[ì±2˜—x“¢×V»“D’UG@x8€W¸Y¸&ð•u %• s Ür&Kx&€` aWm­¥mrEÐm«xi¾7€˜¦)SËšò¯u— œ]bÉO¬-±¦-jH»*x@‹Âwwcr€6Æÿ!€a¼)'.€Qyi’eU·wéD„7‡ˆDõ}|IŽ'HÀf{¬ë1¹Â§]£B{!\P¾!¹wÆqç®2±'%ÄÉ÷”BÛ#G·‡n¼f#X{¥gr^[sof›dºb¶J<°³Ø ùj4W«/¿*sѼÆ{Æ(À(tz;Ê›§ÎjMn mÕ¬Ç&7Ø”DŒ‚ÇF0¦ÐÈkžŒPK+ëñ‡á¸âÀ͇±TGÎÇzx†=ØS.Qp…j—i2ðX;j]¹ª¦kº¹ÏØs°6o`ÐhMÌkMDxi[¼#¨æ—VÄ}10t9„"ý𙍮,¡béX|… 1¡Â"ä»ÇQH=vg¯¡a’]¯¤Æ.KWÇØ30æ]T¥ö¯JÌÙKÌ…@goaU >o¦|l&«ðsÜY°)¦_Ú’×vd­ËéQ§¼Û;lÿw“Q|êDxŠ;$«VIãEˆ©†{‘*††¶©°eƒqã¸áÍCHH]…ŠºœÞú™{þDÄšâA =¡&ÿÊïÍÙ¥ÜGkÈfæ}×ß5êsH®÷f#±*äé¦)6°c¼6Àc×Z¶u‡‚Ãkl ®Ì®Qìb—48D‘LŃ˜É—‹ñF|(Š)|Ü‚QË)±EG£“δäAo„ešÒrCüJ˜4EõAÖcºuߨ˅úÆÇÅçx*¦‘kæßZ†wÕ6 åR®Ë ŽSžË NÆ\n²"yD_.7@VþC[½3D03­š2'³`ÿ¿ˆ;§›P³úÖ)?7kqEFrŒäkj2r¶äçì¬=øKÚ3€'”¯ÒóxKmµœýÙÙåwX|® UùVø²Úëîñwp¶Ä¤êìÞî n]ÂV"¥ê ~·¿F3íÒåÕ}rmu¶þš¦¦ñVoòF¦<`ß â¡Ó)#l".0‚4©¸ÎÒŽBÌÅreB2Q=Õi'˜g1°Ôu§,ÀÙU ›‰º†cx†[é•e©æÊÇsš’åî^ó½Ü% ‹ˆll¢o¬‡{¦Á$¥¼l¥Q÷ ~3&{‡ò*¬Âú=†ÜÂ)4yp7b#µŠšÖiA¥OÑ.=¶OHó¹ÿš‚ŸL½ðýã9–}—|öo6Z|g‚ Ú¶h6@ó6_ó(`D¾}7öuÑ ˆ@¦743¶µPv*¨Ãö2F/+L¼°É†©Íæ±6†ódnpŒ#b¨‚j’ÅÉO÷„e²äF@maŸš“ÕÉJ ,@Ê=°Ú¾µS͵,ßsÜ®ëq†ú–Ï÷é{?üa ïd5Çz뵕VÏù—’—Q¸£c)[p"[7(hut$!tWk1ô²?÷sï1596B#\¬qÞ"Y'7€x{^ïìϾŸZÿ`8N=¡ÆÙ`òúø šÂX4 ƒ o@ ðœÎÁ@c9Ð4ÿ„eÅÉðx&!*T6ŸÑé2jEt¼A Ï›â˜¿ñ—è½ù@†T6àøT/ì@(.T>>,@, „ ,,2L2´ 4-LœÀÀ2 r n,f„\C‰b:xNN:NFFb|OxGxw‡cTŒƒ‡•‹T®/±E±¹-ªÀ‘ –,xH13  h œ4hÊ 45ÈÔòÕRŠ>TÿᩃçÎBAÔ¡Cs>lУ‚‡TXHÏB _´”ZWE” “ 4@ÐÀ7n¨L0dAÇdĈñK€¯e*„ýÑl×PD”é0âh W¸Øÿ•ÍpW3{¢¥BM4@râB€Ô•\0YÀ·F_>lªU ˆGàAºŒ(øy´ÐN ‡Åq°!°ƒŽx2¢I†®äY€€€2‚ ÁU`A n©…y¦VC|ýÕ¡§T¨è9Wì›À‚ 뷧צFÕ„+©®>u %$˜@V¢ÁF[ë!ØØ°±ÂB1Ñï Î1ø˜'‡îŸ±½yF‘ðL9À…‡†Cfa )›¥&K«e%2bå3"‚ †˜Ý‚Ê©€†ÚÅÂcù…'"lË„*©,Hª¬ò&â†pŒ‹ ÿR@.¹(Æz‚ >‹¿sª»Î-îÚHÁ*ôO<ó£(¯¼bð'  ±àB,økÞ^î2° &W ì†Y(ɸÁ2´‡†"D „Êm·¡ˆ)f§anëp˜tB†g¢!bDo Ñ.±Š¸µ˜bä*PBF-´R.°(`-×xk}O#ÉŒ 8È«ãD±ã¯!î8ä‚‹âJ%Â2"0ùì†^± –2 NX0:#|Š©<’6OØ–:ªƒ¡¶­ÓaÅ0+¢ÒÀ\ªª¹æ 0á¸w»Àqœ®¸+ .Ę¢€ÿ>õQ;"º'/TÅ»`úÀ`>€²!À.„ƒ÷2Á¡žÈŒè膌b!6@ÏÚ$3ÀÌ|e‰¥!†Km'kYë €¥® ¦ƒØ¶ÍDfñLê½"¨ÒDQ"È]—E ” ©^z™3zwø£ž}ûu‹ l`ƒŸÁ‘ƒà>!ŒBäØc ƒìÈdˆô„&º”'ƒ·[0 s²jI¼ <Ö%Îö.Ä—YÛé&ez!<7b9J§"òd O`\6´\©Ð%"sµd×èz¹b‚+zÇ¢!…&œø$¿íØ2ãS2V(C»€¯ÊhëVÉóÇ®E؈ŠxØ!š6‚à ÿðÛ»ä¿mI @þ.`–[ÎÖ–Œ  ¦§Û^«íå—ód\rØd Ð o⫈ *¤’Ý!6:Ò“&€†$FÇqÔ·È–©0v ‹îp;:4Œ.¿ÃØbà,½ç"1Ø€Mn°‘+0!ÑãLG&ã¨@dÉ:²€š¤‚dF 0¤!€¢(c/›Fž¦¡›îBL™ U4 ¤°€‹AÔü @#Ð-±]éD»–Ã…Ž”ˆ_l(CìøUE+° ÄIàÖ60‚ÍeT­(†2”bó’+bQ!«úLŠTrš7¾`\ üØ8”ñâO-Cÿ†l\ lK{LSD$ôê*Æa¢½’ƒ4lªhÈi£S Åðk;ܱA TÐE¹Ca Œ•xªÔ@>¸çëg~)plY°(€T8·½©pŽæbž…D®f'@¹ÁUâTî¹qÜ¢zf¢÷!9Žý¾ùM-‚+!Ìø1ªØag”mP%T€P²ab4RÇ#ñT„DøÃ!±ÎÀC.PB“WTMdÂ>c‹—œFW@[Ñ÷ÐçCÃY'¬AŸãÀ%Ã¥ÀÐ>ØIlp3ó(§ŽÞ5–Œ® X…<†àNîÀå*jZ€ ÿ`pQ”1`¯zŒT‘ÁÅF"Ì ~©‰Ë´"3 Þ&2˨LdGJŒð¸]Á8k|‘“}ë†á£!3±y "Žè, Ç'ð‡4ˉB3À#¤ ;é ‡< à‚d"a»S (2žß=þ¼ÐÖ(Ø"¸‚AŸ9SY‚’Ra¦ ·Ä o”r”žìÆLiÙ¶˜b·â6»¨Ïèš9»! YˆW OÔè]&qá¾lÊI!Š5( Ã<¶=ö¤ƒœ±¥û›J€ÌÔÂ{3 ¬ÝXä Ôfó¥¸pÿ”îFBqí¶dˆÛÜns·ãÕ¼Æbq¾t @'€URÙo P¯ؤ^äÀ?¦½ã3âCÝ­ýa‚ ÂH+f"ˆÆ„3 PA˜T0™º ^¯ ?ÎN¦=ž`sÒ£<£p¸¡0zb¾b\h‘­$Ϫp FqÃ}À)ð$5ЄúU!Rï.Qü´ëˆ± zÓ TÎh¸½5‚‹ÿ)âZ7µ<‚U4àÞ!¤iXY2eH‹„wL6F@€‰©Æ7)»™F^k'n!r[•Ûlœ±ÍÑ`Êt5ì•‹0 .uDÓŸ–?§¿Ä ú딚Ë^öÿ¶âÆ8N–£"{0U%5æ1ˆy`¢ .â0G@Än`€)nLN¡˜Û˜R²ôRô%5^ÝàÀ‘á8ë¥{‚%L#¨Ì^ÓøÎ¾Æ¸¢ËM(d Ç1‡ˆ»œü²û[Z~Þ<‹Z¯×ªµ®D܈°~Q< p‘oA)üc>~ÏÁ|…ƒ[¤£›…7TÐÞ™€0é]@Íéå`±§ýž1ªÕ‹gŒueÇX$‡›·ÛÝ6Ñ1¨Q·ÐiGŽÁœ`…§}DŸ†€ b]ë–ÔE™}þaݼl€Võ¤‹\©<¡~¨x‰)ˆ%Yü-ÿÆ¿´… '8y®×.@Òë œ€AËÙ“p­”«ô"Á·a8c~ä‚Ê­ j#Xª+DçÓ´ü¶åTá8/*ÂL“5±tÏÁ pÐ„Ó Ÿ1ú77WŽú™NÈL# ‘Æ …(ñÜsfææ ª©z¥_ofRcۀᎠ>ãB?~ O¢IŒ£X`¬*è/Ú½íøC•$Þó;€p!åŽ.@À8ô˜ÂV¼B¿'nÖÆ0X… sÔ¿³üY x#2…?à¯F¶bߪ€< ^lÑ®gnL€n†Ï\lÌ’EÚ` ¨â@r`ÑÀ¡)~ÿŒúŒÄÊê­G‡À¶,n°D„®¥s@íü€ޢyÆBÌ¢`¯ðm†€,ºÄàï2°·­.lÐ~éïªÁPÊ)~+ PÁ++at/Xª LøfnP"MBhà*ÆX®TnÐTÂÛÀhÆqV‹¿rÆBxƒûÀ/ >¥êÍ] 9²‚  è œf >Á»ÀÂÁö(&ˆ¥õOM4ì2< hnéᎆ¯ìx Kf–€G½$îô†Öä3,lô*áMŒ ï*ðo©ô«ÉdH'Zë|v†]°á\$IòŽRx…ÓZ$éLÀä`>"u`ädînÿ,Ó \áø,Ðr Æ~ª… €u„¦˜èã=èjQŽøÈäXj!LpÀR%˜§Û `c®¢'ZPš"^C)¬EûD*» %u‘¾@t–À\’cÔ Tâ ¨€é…“2‘ÓLÀ~êh‚2ÒL#-lVAp<ðo²±R~ é`ªœx èÞ,àº&Á¶J@C˜ð¦ãh gÚ‘ÚZÁºMp̦Àbmë¤\\F Òl"º!ª’·x`àðcF Àš?„€KÎ ‘h%\ €jà qîÎ$Y˜Ë%Îï8ð㥞ÿPG2Ã]–Æ?Ú0î.EÆLâŽLÀk½(CJ4"Å„0Ê8ŒaËJ7§5´7œ’“ºäx|ƒ]FÞô2>¡+Qͯ^òœæ P¡Þ⌅„,côÔ+&pÌXeu Ð.cªÔN²Ä ˆ x ʸª%È¡vÒ¼¢®½ªÎ€’M@œ’EãÂíBœXCJjñ®L È.ÊVÊ#¾j,P¥ðã8¦€¯¶@i²R @Àà;3Àï€ÍFo½žê¤½Ò+õç·Â)Šâ%7Ïó="ãFãÓãZ!õ D…Ú‘ôÒ ‹Ò>.ƒ„„J l‚ŒÁÿ ‘¦³Þ!+XBÏ#zå´ 1¿Š1JÉÔ|+ʬÀŒNÕ” Úˆ9X3šÑmÇî“ê«p~êï,U|´êŒÔË¢=Áb,–æ“‹Aí("4:ÕŸ‘-Q¯X»-L‹ÀņN@æÇ¯ª`߈À²2[jV‰Cè¤È~ÂàÌIÌø5g ®N'ïnP‹uî6¦ààïþ&¸¾¬>áFËɱ¢2hŶÊ2~нœÓ9»Õ€ôȉJ¬P§pVðqØ%9c2†ÓÈ5°tQð•aõG*jÿï 4Ag€"À´¬âjo¬ Ž8eLëM"» nÔ<³‘4 ÐQjUˆ%†7L˜,÷cAµï=´óJ%]»© £I3&ÊŒ ÄeD±R`päòˆb}æP¤ Ë!?h¯V`mL Ë$z>Ç`Ó%ž¢ X” *1? Åt‘`@òÆj=æé„UPOƒu°sk±¾^FBT°ñ¾óã„ €E¨Zß¶ –&=Ýa+U’E¡²#„à‰0¡½Ž¶ÖàÄQx²½„Õ%:â;§€S5é èò°b')ã&*c«7?s@3` ê0[X‹d 6¾—3¹¤ŒÔy—ÿ«*ãä-à47Rˆ« ®€1é *ùaî*Û0ë~x±DS!,>³Œ+3p*£ Ÿ¯ó³kEHsk§=·¶¯šŠaç®QÎaØTD@˜C7‹ƒ.4 ðmÚ7bPìX³k×òÆ”MÞˆqì—žb¯˜¨KžB9Î÷*ü&§‡«÷_õ“ó”’ÒIxöǤúŒ+h8£i¸p$>¥ÇüîGîïaszpâ:ÝùU@úØžEh2 ;-Z¦¯ú6+º$㔡X|L]è'úe¼Ï·À…Ñ•žà_`‰ü$ÀBJñªíê ªª†Ð"^â7*¡#p}|)ų“H98g¤GPAcXròGßÿqÀ–ç>önîùõh`ïN̶ÏÉ'ÀRõïùè–âG `ßšÀÀ¢ …f× š@¢SÁ±:&b¢äl_ê€Y{îõåè¹ @_?v:´„û´ç½çcg¥²ñkWʹܵ’xà3?êÿûýÛ¿‘šà1ÐZ†ì·z1ù›mŸÄ¤»*àô#^ Â« Ò'ÏhZ=µZz(\B˜ så3… âWH‘ƒ¡aDºÙ@ÊŽÒê‚¥p8hÒÿ±X‡ÄTêXa¾.¨ð©™À™XÄý¥©´ýæáI´pH”¼´\b^¾pÈPZZ^rdf¾¼t^ÊÈðE¶”¤Y!$¸<ÀPÅÆèº,@P!ð4'7¤¬i WT šðP ¦hðöàx,Ü à ÄjäP@hhe1hXŒ¥e€%*`î…Šð|ÐÏEkÉXCƒÐF]¤Ä¡&Ž£0q¹ñ#É/$è(U*¢ Ž^Q1 o\qð|ÅÊW¬ÆŒÁùYìÀ€b4Öd#  S¥¸±I Õ04èAgàÆ *n¡GKJ7ÿÂxÁ×…A.l5lAÂ4pÖÜ¡£BÀˆ<#øÎѳWП  Èpq±KIH•ª¤ÉÊ”;r¨T™Ë2ôXÈ…s4é[¾2üDdA¨P xðp*»iÈx¨,Ç‚t0 ¨I€Á¸ºé~È•î† Àès›-Ûõâ ŠðÕð,è b!::Œ8/`}‡‹qˆ*f,ÿŽŒ‰ Xøtyÿ ŽAÉÀ&-àÁ¤!˜ .¨ÃCEÅZ˜P€SÔL#Í4Ó(–2„d0À8À€J7ÈÔ l,`Ž@µX°€ üÀ]8Zz0`ÿxi C‡|·_'œ “ uÀä'ÔÑÈ*0¤|jL⇴Ê( ˆŠJ‘Ý!(¡ä!ƒg1H ÀX ’Vâ81Ø"4HØ!›6nÈT4$U 2¸ ŒÀ8äpƒŒk,p~âùZ†]ø£‹€'idyåz’G 0‚$¹¥®ÎyH@O¹)fH–•Ù }Ò§R %ˆ´'–Dä_;tÖ‰Xxƒ•²VA&XÓk†Ke85±`€åX+–΀ºÜPv·2AøMPV¤¨BŒ°µ*Š”øJ«ºÔÿÃÿ1G Xã«ÂÆéŸf™p°—%€¼‰qvòß %ä!ÊgsCíhF°“ . >³"1¬-sh4Ò\Ès¹²QƒÀVöª‘)‹ðv£b]‰ÀÅ…½wqðw›ªF ‹¬z㬖¡å2”2%@̰$krŒ("AëÙ Ä™"²ª™-©R€1„ùRn.ë¢.Ã倃JÈóSˆÈàLa†àa¡åbÈTåÈ àÜJ€½BÃL@[t¡Bi¤@~j «¾áµ*ÔMæ „±Qv@X6¦ ,Ð\K¤”R‚1,+÷­Š ÜX%\CH|ÿÿ¸2Í“ƒ÷õ.‘†P˰†5C¹†Jõ\.ótã9;JZï;4±˜ÿ€>kœJúRƒ ";@@ @©x•Ò@¨¤†ïƒàoXYõdSða=|²ä€ÿ¨âx-`Þ÷'Pë ¡kÃr ?  }"ŸŸÎ×€øD®r…bß –bsd*Fº‘ W¾3ŽÐG>]8Dðq«/üÁ G RŠ^DÂN„L™ á­:hŠ€¤‚Ó+ ™2³,ý|ÐÍÙ$ GJTÂ#eº^ò’’­3À,†€ÇÀÉ!#úÔoMˆB< Á3VEÿDž]Òg48ÙãxE^UÁ x## )|nñŸ¿¶E.bd ØA t2ZŽd%·ÛX ­TÁ ^ŽÉ Șe’e,$'™H’¼5…„zX€ eØ„Þày[rd„|5¡ å¦}@› %5@ @`€¼Q¤Òð›äP>`ƒbØ"$Ej1ß9dRÁ6ašä&!›©˜VhÂŽa«DØÔ´ 1zä˜jÒD?ò‰0ë¡ÄªÌ&6¡ jóv ŒdUGZ 6¬ i@DB½T)p)2p`€9gEl@À¤‰ÈDX$I˜þ¡9MXŒÁ&š÷Бÿ¯¢b8ÿp”?¸É™•) tP k$ì8ìíeV-TlIîÇ †UñœZ½U[EªIäAÉ€9’ŒñÀÚ¢nºÖ€s m ð'@œ€ŽVß1ÉJ¼ÄYÆè³DÄ›&žgFÔ°Ÿ³2ª’¨¢:k0j$é³&íâ™kÆÑÀ Üç>é°|ÚfÄ&ñÁ¥ž„½êî+d€Ú¢m2Älê@@ËÆFƒ"¸Î)ôá…bŠìïæN‚aͬl„(žîµ@l-Ä$íó6kÚ)jfò0óB/ˆ «øUXeJh6¾[Ž"’•ŒµfÂ^Ð'Àᑬ¥ÉYêÊ,ÿ…œ,Ë^U°l è 4Çy"ôm乂Ž/Í]s›”ÉÁÞ‰b ìÅ?ÌÃïÓ¦ æ`*iCíC, H¹ÁÑx>†'¨'Ä}€™-õ“õuZGEruZ³,eILPsÀ¼zc-Ö@ú¦î„(’Ú¢+3¤ˆÛ&@@ dÀóÙëˆdðA ‡ ÊDC1$€‡ðÀ>–pD|PÙ<¬>n³.p(m;1Ón–­r”š|!˱AÅ€Ì(SÛ͸!‹ƒMTØ@ØqiªËA„m%°Šù²pª’kºš« 40—ë6¤A Ï®ÀŽïÎgÄ@F3ø úz^ÿU…c‚©?l7g2 'ÈIñá!&? ߈XØ@^ÞDL‚6!˜ñAHÉWÛ]e’™ò¦’AýÞߊë+”+º3ÊB€@«ê ³ì0@|Øn\AAìíÎ:™ZÏÞ0€œ¹«Ÿü\Í(œ-ò>-hYc²\@[»õ8ìE ­N+ªÅîð›‚>Ïz,P´–DÿP§\àþr ¸TëÃk´ìb´ù.Å@2´œ|”¨A(’˜@$…@µëNc-éó†uȉv&+íÓ¢öí¡õ  u8@[ l@”´õX]Ÿ2uªH8ÆgÅ ^}©„¬jþoäÈ,l¬mf»Ëôéªê”¡*6CÙA ÉYvhÀf›œî]&àóï`6+8c² $í'jj'pa2¯¢ÆÀ[w|À|€c6¡ƒeÆå>ê—j¥Þ¸Y"]¹.€s§ëéî±@ ~s¹t…ȰYÀDäÈig¦”!dö·@e9lG±Ã6ìÃŽ6K¨j££6 |Àÿ[»µ| €8€صÆdê…Mìî|§ž–¨RžðÀÀø ´ëÞJû–«ÚÖñUi”Ùw@ˆ©Þ>,À"sË=ù–<îy—4k«vx3®i§öxc²J'é| ‹À‹gùbä8¦VN.嚦ç(wFƒÌ~KêÒpž̲¬–ðIù®o~–­u[v«À‹êÐ=y\ÂÊY³ô¢µI?ì 昹˜Ÿ5‹_À‹Û5^¬b³'d$Ðp›¢¤* Ö›ÀU5ÚFuûV ¼ù”hÍŠ*¯ê'®A Q"ˆ{⣳¦¶m¥>I UB‡4Í„ÚU€W½Žðr5ì¯^®zÙ²åkÖ¢]mú(&ÿ $$ýC@Œ.À¨‘Sñš™Jp õæ^l›ðà‰*uÔ*뜠‰ÎeŸ™êÍÑt3³æ‡Ïx}!áªj¿H¨Pû`ËGÞ²Ø[·­E¯HpÄÃÂÞ½ÉJZÀ$a+פKXœ]”._pÐ\·7™²u[OÜ|Œ$ÍÁSµS ±á™,‰õ§„%b ’¡€0¼å".Œ“ȬŠÄ-àfXðS@x,X¥.TLì°Ò.Ä3è› ; C¯*”ʉ5šÔ+m3Ÿ8”¡ $@ò|jƒ5O<£ÆSüC%±2bÐ "V„h8`†h¥Ûÿ „ˆˆßÇ&iäÊH¿4c«0 °¦7è@Î×” °¦#ðd:L&X0h¼L%Áð$¦Y%É!f‘kÜzC+-· tè,à,sC³©+ÃK0¿ðÂt‚ªîa“ :ûT½ù<ä€Î‚B5 üTº(!@ ¢NSY ;Ì×5JÈ“XŒp%I+òÅ edNÙ´ZS‘‰R:ø°ËN.v­QP5ˆ}ì;¨#,’<¾8÷Ü­¾‚iÅ0 ‘ƒ7¿óS6„Ú ­è„‰‹”ÒG‹¨“NT`X0a­…˜à¹Ìyªú"+jc]#špþ9@ЀUz¿$§““µ³÷”ýl ”v(a°"oîô;–‹—·Ë³¶f°`:bÛÅ9i¥—fºi§™.¡Vp0sC SaÏ"»eÎé$@I¦ÝAl­Î}ÚiìÔ Ø´“ÞáÈvà‚;ntp-4.2.6p5/html/pic/driver43_2.jpg0000644000175000017500000001466010017034536015723 0ustar peterpeterÿØÿàJFIFHHÿí  Photoshop 3.08BIMí ResolutionHH8BIM FX Global Lighting Anglex8BIMFX Global Altitude8BIMó Print Flags 8BIM Copyright Flag8BIM'Japanese Print Flags 8BIMõColor Halftone SettingsH/fflff/ff¡™š2Z5-8BIMøColor Transfer Settingspÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿè8BIMGuides@@8BIM URL overrides8BIMSlices Èct_acutime_2000È 8BIMICC Untagged Flag8BIMLayer ID Generator Base'8BIM New Windows ThumbnailîpZPv ÒÿØÿàJFIFHHÿîAdobed€ÿÛ„            ÿÀZp"ÿÝÿÄ?   3!1AQa"q2‘¡±B#$RÁb34r‚ÑC%’Sðáñcs5¢²ƒ&D“TdE£t6ÒUâeò³„ÃÓuãóF'”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷5!1AQaq"2‘¡±B#ÁRÑð3$bár‚’CScs4ñ%¢²ƒ&5ÂÒD“T£dEU6teâò³„ÃÓuãóF”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·ÇÿÚ ?ᘚ™%B¶L+´Ôªä›‹*ª+L­*ëVk­U”˜‰`ÚÔÅHÍb˜goÁFd¶Úþ—’^’¼Ì,—ý œ~JOé¹µ·sèxý¥?ÚËWÁ/ñJxeعƯ%V®:²ØÜž ,ƒGD[Aõ*öSä´œÄ ¤Œ—äÛTvUžÅ©u|ªV²Œsd‰ÿÐä诅z¦B á^¥‹;$šò)*b²Æ¦­Šî)ÈȮ±c Øâ—{µARœ„b,cÔš ºwL·5Ò=•‰ýÖ-¯°Q‹^ÚÛùÇR¶iÁe¶ºY `†Æº|•<Ö8R@?ü‹}Ë[—åáˆmsý)ÿÞÿU±î]ί]Hî$‰©SÖ;öãôK‹¿*³Ô˜`ê¹ »ì§#C¤©Ž‹ÃÝãæÓš"êÚK´t õÛùÈS (9˜’üvëmgWV?}§ü%?½þ‰dtl¢÷4yøWyÒ^çT!E› rƤ5é.±[( h~×€s~ä º¬= tìÙ©»q²%õÌtþ’ŸêµÞ꿱^Å‘(Ê1–á¬AG:Ö*W±jZÅJöh¥„—Ä¿ÿÑç±Û¢¿KU¶–—·Õ$-–‡ïþ¿×r^ElÀ °ZàµîÚ?´ÏÍTŠÂZC›¡UžWœ8}$qD‘×äþè_'„XE‹‘·(»3ÿF²[uvæ9® qnú7úN÷~cÖOÖ\{‡Tž‘~ì;öú0}€mnââàç7Ýô–ÿPÈÂû™Yx;EŽ £söïýÆûž©}^û-ù®ºË(c¶›Anà7íÜÍÞý¾ý«\Ê&äèEWêž?­}P9ÔÒÏônqÿ9»tOª‹jìû7ÿÐô×`ù)ãí{&¿›£jñÁÁýWþo¨ÿÍåÑ%÷*ÿÑXÿTógêä¡»êÉ+¨û“}Ⱥ§õO&ÿªeʵ¿SK…Û&?$øûmÿÙ8BIM!Version compatibility infoUAdobe PhotoshopAdobe Photoshop 6.08BIM JPEG QualityÿîAdobed€ÿÛ„            ÿÀ È"ÿÝ ÿÄ?   3!1AQa"q2‘¡±B#$RÁb34r‚ÑC%’Sðáñcs5¢²ƒ&D“TdE£t6ÒUâeò³„ÃÓuãóF'”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷5!1AQaq"2‘¡±B#ÁRÑð3$bár‚’CScs4ñ%¢²ƒ&5ÂÒD“T£dEU6teâò³„ÃÓuãóF”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·ÇÿÚ ?áDhâZ;¢4T$¬%›[ÙŒáAVÕ ¤°•ØÉÑŒ±±­j„Éa,ZßP͵¨º&µ€b}ˆªA©¶‹F–Ôm¡-¨Z­Ķ#mKjV«A±6Ä}©‹Qµ[\±D´«Š%ˆ‚›k¡¹ŠÓš Xœ$›i=ˆObºæ ½œ©#%À´œÈì„á«og(l)£%àµË|Sscà’}è›ÿÐâZ%•ÊÅm ¬‹,ØÔzØ£[QÚÕŠÂY5¨­jf1­Q’°•šÄ@ØN`ˆà˜JÛ`œ5`G£ÛµhçÝÆR<1GÁB΀[[jPV›:Iåî#áÊ(ÁÅgÒ—G‰V£Èä?1ÿœÈ0ž¦œ}¥"ÓÞGÅk¼ôêÜêœãåÙXnMÈh-sšb™óR@Ö“ü{>. ‹Ví A5¸=¾ZT®éW4K=ÄrÒ!ÁA“”ËkˆWþõaÅ!âæíLZŒXA ‚ìt!@·ÉAk9ªj°G܆Zˆ) g5ÍVÜÔ'·• +ƒMìåíå\{y@{yRÄ®¦áÙ$K’–ô_z?ÿÑä+l«5± ±Â°À¨Ì°•­„f¶TÔf7E ŠÂÍ£E7É¢Td¬+´pˆÖ΃¾‰5º-ÎÒ‹ã"ѧ,'aÅ,³áSû¡1‰‘ ‡£—eÂÔ5k zël4€W™CZ ;[­|X¡Ž<1}åæÙŒDE6æÂ¡â;­¬¼§DÀRµÝžknÇ1¯Ž ä Œò] =†TÌ·hágý¬DÂiHQÔlŒ-:rlnçǺä±r&5[˜WLB!¶OH£9’=—£Àäÿ)syxwâ\i½»^5ò#÷—]ƒnà%©ôºzŽ6ÇCmh&·÷÷ªªs<°Ê"§ÿIdñ 7æðeª+Qe6:«kØK\bˆYž®Íî‚𬸠½¼§Õ{Plj´ð‚ö÷RÄ®¤öò’%‚RÞ‹ú?ÿÒåë Ía¡¨VXt‹^IX†7Å ¶« )2Í¡¡ ƒðFh•+Kk§bŒŒ¦VòÓ©'@@]­45•†´Ð¨ü\n—‡n-eõ‰-F‡PÏJuqö{žÁ:‚I|ÖÎ 1Å d[P€ˆÓV˘GeZá2™ØÝUŸÍÞ;n•\‹:½M.{Xæ´`k¢˜/Asd½ÇPÖüGÓÿ¾¬Ì–L«w[Ô«_KI’ã~k?"ûÌî¦>Q´9íÑs÷¯?Ñd;ճѯp.Õ¦â±ïÅÄs‰~[Xg»÷¦”…ðowÈ Ošèze’Öɘ÷h°±(À­áÃ5® ƒ£|>kcãÖKqw.l4™'Ï÷’ /WÓŸÀ[u h –þàbIìKHZô~Û±ÕµÖ<Î#è‘Piýié…ÍnuM—7Ûp‘ù¯\»š»ÿÙ7Y.ç>#Ú4rßXñ«ÇêeM ik]‰2³¹Ü"?­æ5!ûX3B½]ÜRÔ'5XpCpåSˆ5^Ô·•máWx H•Àµ,jH–”·¢çÿÓæê Õc…^µj¾Ë6Mbš±Â;°Ð¡%Œ³`EhPhEhQ•¯[õrç;­q'i#S%kÊç¾­¿ôv2xtÇ‘ |j¶°ÅŒÿT71›€òLÇ7ƒÝVÉhsÐAD|QA´©W52D’DvüËÉdÎh^|ÖnC¹Õâµ™õ¢Êƒô›7Òævþ²Åj Ráæ2b>“éýÞ‹£9GcôzJ>±bÚU`Ýbyø"ÛŸG$–ü–'Etu šxq ƒÁЕ§Ö6ÖÝÍh$­n[7½.|%³ ™FÑ[›ŒA‡9Y÷]S§kÁŸ³GQsœòê «i!Îf¦j¿ oư=Ì –pàF¾æ«¹&H:‚#¾¾ *«NØ?0»Ñö>¥Óo¹¥¾° °´èA‚¼Ã©âÙyóÄ”ÒSMº1mkÁqh¤®“§bä‡6·8x´JÄè=[™ÔA-¨™.?Ê]Tëƒ2˜ÎP÷?÷Rü]| ¦Wh¬‡"8þ²ÓÏê×`ÐÛVàóµ°îñ> ŠÀê¹ö[Q·—‘µ­ÕÄÞrè¾°eÓf&5 xsÛîp!CÌä0Å)¿GÍdåÃAÕ¡Ô:ÖnkMo!•v7@c÷–k‚›¸Q+S”ÍÈ™©‘&É´.CpEpCwt‚¸ X‡ ¼'ÅpjX’•‰):.èÿÿÕç©Öºû*T•rµ™6¬›l›Ù‡Dv•XS4jŠÔ6òˆÔµ˜ j-RA Øç1ÁÍ%®A‚vU÷·mŽ.=ÐÂ|3dÇòHÆû$H3ÁÅ©¬s[>îuæT]Óp©±×WHm®l™$"cØ+°ÇY¹Õ¸{H2¶9<ã.1ÄGt?¼¬ÙÇ>(êuq­¶Üw—ÒâÂt pB®(C =â ‚ëóFê€H×à¬ý_c]h/!°{è¬Gg§ô¬|j“p'h’ã©ÑfeX/´ØXÖƒ ÀZýc6ƒŒÌZ$:ÂÞ ¢±HY<þs){q>˜üÕûÍ|ӳƒóapøL¦BuFØXž ™P!%0pB=Ñœ‚îS‚Q?„ðQž‚äðÖ±$­IIÑ{ÿÖæiw íegÒUÚ ; kI»YV+*¥eYaÔ*òc-†öFj8Fa•ZR´)€ Õ0‚¤G*A.²¾´:;È$c80y Ue}hÿ‘ìþ»(R`þvÞ ¡óGÍä:½Ö}¹Û^à6·@LpmÑI=¥’d‘džç…Âu#»-ßþ@»ž…'¡tÏ!`ü‹[šþg/—ílåù  ˜§LV#Q‰LB‘Q<"¦%@ò¦xP<¤¦Br#ÊpJ' ¼òŒòf>+ƒZÄ’°¤¥è»£ÿ×äªr½S´T«­Àƒª·Kæ¨ä‹ƒr²¬ÖxU«¬ø+5°ùªò d6fØPYÓ•aŒ> " ‘½”ÔZÃàQ e-¥ÂLTƒ‚ªRÊúÓÿ#Yýf­}…eýg¬žŽðç5I„~¶Þ  =Qóx\Ó9ùÈ»¿«úô›åê.&—›‰×€»Ÿ«¬?°ðZA–ïüV·3üÎ_îþÖÖ_º ‘ ‰aðX´Ó`TO……D°¥JFBåaðP5ŸiH\‚ã¡*ØuåÌ)ÀÓ]嬾·*öV龜+ÀjXROmnð))kEÝÿÐ+~­<~j3>®¸~i]ÿتðOö:ÿuFq‚´Åá›Ð;#3¡¸¢»A‰XìŒJüaÀí‡oFpìˆÞà8]gÙX;ãž §–Š= òä¸vR)òê>ÎϾÎß>ë{AæGKw‚—ì·x.“Ðo‚^ƒRû¤Uíœý˜ïO¬ôw_€êÀ™p?rì=x(¿Žl- { @_.³ê»ÜâvÏ—GÒz;éÀ¢²#fïÅu'¯÷"3 yÇŠ2ïIFÅ<÷ìÃà‘é‡Átžƒôà«ýÖ,~Èy¯ÙnðMû-Þ ¥ô— ß¾é{!æOJ> '¤»Áugg‚_go‚_uн òné$öP=Dzë¾ÎϾÌÏ~í{Aã]Ñ\{ »¡¸þi]¿Ù™àZÏdG/ûaàlè/#è”—zpë=‚IÞÈOÿÙntp-4.2.6p5/html/pic/boom4.gif0000644000175000017500000003743511307651603015055 0ustar peterpeterGIF89aó´÷ÿÿÿÿ!!!)))999BBBJJJRRRZZZccckkk{{{„„„ŒŒŒ”””œœœ¥¥¥­­­µµµ½½½ÆÆÆÎÎÎÞÞÞïïï÷÷÷”ŒŒœ””Ö½½B99911cBB{JJ9!!çBB­))”!!÷119{”½Ö÷!1BJRcs„Œœ­µÎÞçÿJ9)B1!!)!RB1cJ19)9!)!­Œcœ{RÞµ{Ö­sÎ¥ksZ9{RÖŒ)ŒZcR9½œkµ”cÎŒ)µ{!Æ„!cB”cZJ1ŒsJRB)„kB¥s!R9„Z1!œkJ1Æ¥k½œc­{!½„!kJscB­”c¥ŒZZB9)sR1))!œœ”ZZRccZ””„sscssRœœ!kk­­!!))99BBJJRRZZccss{{„„ŒŒœœ­­µµ½½ÖÖÞÞçç÷÷ÿÿ9B1B!91191!!J)!”J!J1J)!{Jc9!ŒR1½s)¥cBRJ)91Z9!„R1Æ{B))­kkB!”Z)R1{J9JB1!1΄)µs9!!kJ)¥k!ŒZsJ„RZ9!œk1!1){Z1)Þçç½ÆÆ{„„9BB!))ZB{!)9JZk„Œœ­µÎÖÞïÿŒ„ŒZRZRJR)!Z9JR1B!ÿ­Îœc{½{”sJZ电µsŒkBRR9BÆ„œÿ¥ÆÖŒ¥ŒZk„RckRZ”csJ19΄œB)1{JZµ{Œ÷¥½­s„Z9BkJRcBJ{RZÀÀÀ!ùÿ,ó´@ÿÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3B¬ ! 4ŠI²¤É“+PHÉ7~ùرËwºàð‘G“&»{æüˆ7o¹ P*]Ê´©IBø›J®Ý¹v2ïñó—oܽ{1Â;ógM|œª]˶mAt šK÷ þ`À€~?c²k7Õ/á@)^ ê(S¥H5pK¹²åŠ LýPnܹ}èf~õ¸lؘ_Ý©Rl‹5¨Ö³^ËŽÊß+,Øýà²ïßlíÃúµø=Ïáüq’eJêT¯Z­r<»zëÖ®a»{ñ©[˜žÛÿÆ ¼¼yŒ œ‹ŸÀԩÇç¾»ýúÕßRe,Û6mÕ@óÜ3ÐÈÌTÑh³Í2ë%PAF8àÀ 4à€çe˜Q%¡œò^*³¨²ŠbÝ©R }ÛÍ'›ŠòµæX)Òl“M2þø÷_4ëå¨ãŽI%Ä€Hu@@0@DFð@%A@¤“N>I€?„¤á•ÿØ15Ùt¹Í—Û<Ý*¶”RÊ{Ôå—~·$fK+þTóå5ÉlcÍTr8U)$Êc€ò2â)¸ø“À<ÀmI& ¤ 4Ùh‘Q>@”“™äD€%pP¡²XlÝ’J,S1£Í4ÐhƒãT¤ˆÿZ&);ú³Ì5_VÃà4 :S++Œù èw¯¥¦š. )¦0€d ÀT H$¦O^»i<•8‰7¼bǧnUPI+ŽÝ‡_}¯ìèL4`~©Í3Íèx 6ÛL£#4Ù¸*ï­Ø˜*¶Ù PØ(`XA £í±Ç"ë1¦N*P€…Tb¥8»Às¢»Ô¸ÔÂË+© ¨v àbɃ ¬·Ì3Ó|IMbÖj´ÑªP‡ó|-¦ˆ‹(Çr0( p’P­iÇ€k³$”“Lõ¸DàÏ.«åÁ+¶„luݹ J)8 Pšÿí÷ßâÍì ‰øáÜZ)ÝHÝq¦Hàx$`‡ÅÙjK¤+?7ù¤e `Ae»…¾€•åIp‰™°€Ê}Ø¥((µ.ûŽgÖ½¢Ý8ßâ^‹ñ~@ä®x LÐè¬wÀ¿;à¨K•¡’Ä·? t v>ܰ 0È0 0ˆgÀD@ÿ 8øà¾í× ãÕTAs£¸IŽ·ÐwŠ.›(˜-HQ³ÇÐÊh•bNŠV8¯è}Zçš?iÇ>Æ8*rt€TâZ ˆR”àœÈ]  ˆR$p£q €Ä0ÏY@¯€ÁÜwƒÚ /˜ŠÿêgݬMzOúÑ”ž3ƒ¸`*5ðâ Cð‰b!xÀ ; `=/Øáf@F2Žo,ð ð€úñí6ûÓvl±ÁçÔB¬Yb~áþ½©=Ž1*RÁÀþ̪¸E»¬Ã¢ zˆŽ~kÀ“0‡oY«gSÀ ‰T¡$Ù¡ÀÀ.€L‹ÓO*'"dø ‘Ànmmk’Dly¹ä‘Ç Ù,—-l‹ ¨Üη€'Tá fÂ+’v·Wœh;±ÐãcZaR’‚ÛìA}èƒ"Á8\bu¡XE(lÁ ^xâu4 n·¢V¬ÆEú…‰s ȼ¦u­©Å+^!Èxå(ÂàÀ±8%”ˆ«ZJ¢iãÀž`’· Ë=ŒHX@0÷‘ (ª2=H”L%a´²Kßf[Œ„ö!H%bwé­Æÿ!  žHÀ¥pœp…  _°‚Ì`…= Á Wø‚´€-¬a Ø%€0»õà BC@⼄È*Â*Ö[B=سlå:ò à¾øÅo*‡ôÃZÔQ á†t­¾m‘‹1¼”0ú[Û©¥2zˆ¤R‰‰iÖÄ` P‰•£@†7t”!H”¥~D¤\ªrò…ÀJÙX¡ hp,ªP…+<5aðÇž)(áÈk`B´Ë„5( R¸D˜À„"<ç m8BÆà…,D :Bªà…'°!op¬P~àd20ÁÿÍiÜcì±rL—–#Rn¹ÃÀΩ:˜ÉPîð­ C =Î9ß?œSb N’’Yé }_œÊdê€Éèx=Ú›*à¶‹hðUÈ€€r¬0<á XžÊÜL†&{ÉMHƒ~-LáÍdè¦â7¯ cÈ‚xœ°íjÙÞ÷·Åíæ$t¡ dX‚’ÝüñÀ7G•Ððj+B"-)—-f’@ŒÊ) øÝÕPZ<[NQ’.®P"À‰¥92&ž€ŠW<Õ ù µ6~‰O¼e£R&Nò²Ý—ÿè®ÊŸ34œ! hÀ¾àáæ7×´§Ò†'õ @ÿ‚VNô¢ûÕ*'€§Œä¶9ýéPºC°{|&ûø†¡ ³ç'üˆµÔÇNö†P`]—É8drŽxÔƒåLM¾b–°ˆ&+caG<èPö¾G½…8¯àÏË>c*èK0çA÷°ð¤±ˆÅ-f1‹U ‚è¯KýÎù = üy‘xLÎÆÞQÑŒå+í¸ÄäUd0u’¢7ÏýoLr¸cí1iljNÑŠß×D&21‡80wÍÇvö±'0‘Æ׺Ï~IøFÓ°]ëìºÿ혆"a51·àE,ÜéW£ùùµÚ¿C&°ÒZ‘bwä7Üó)›ºNEÙp þÐ ÖÀ/`¢ ’/Í@ R+ °yAÀ<Žƒ5þ¦\”r~6$('rµò b0øMc‚s êäΰ Ø/þÀ/óœ€O„³V² NSGb ŸP >%0r"d5SBA”To0¶$TÒ2(p4Ï  Ïa f‚ Ф&´w ª/Ç Öp ù ÒÀ*Ïa Û/ùƒWk5,¦Ð ¢@r·9“2Sq¸1Œƒgv0 2…§p…!s£8£ƒÏÑ*Ûÿ Fs Ñ †Ö0 èôr r 3˜#±0A‡D ¾Õ( pB P5PŠsi‡9÷•@9–uQPòh\ÄX€(=5ÀÓ†h@‰±H¤b3Ýä}3Ó ES+Ì Ô` 8A Ð/«ŠŒÁˆÏ ¨ðrt «P ¥ö ¥1ãovPo ³0’Ä©¤Pe ‡…¿˜`dŒlÅRQÁ°7Hht³S §` ·NMƒ3!‚—ÕŽJ(×(v`€iíÈEÝ ¼D$¬†øØ ¾ØÀT ˆÕѤð 19“¤P“Æ ÿ©r´H¬ƒ"Ša B!“º ©P”$RéÈEC!Ò”MY[¼%†fpE2%ð9Ma/Dþð:ëñD !v 7À>–9BèQQ¶Ð®Ã4’Gܘ“âÁ ŽQŒ´wHåw0:"KwÆ 9À”Jy9 ÀîCÏ¡–9BÁXÜ“–QÄCâáOäðƒ@Dð pT‚Ög ­q ÙØ›P;°Ã'ІDW­À(ˆ‚oÈV´&k‚ y@ÞÕ`I‚+„Q«BÐ3"% bù5ÿ9 UjÅà:ÀC0ðš;ÒJ 1aà Sv@Qâ8»%Ü0oÆ h.¢Uôv9z–rbÀšñ |B(îq3Ùq& TGÆ ¦ ƒD·à¤À ¤Àe"‘¯ @)±ÀNï›~µ©à@™ V¦ð…¨ ºÀ õ<ŽƒRÞ Õb1Øb[T•`£ %Iôõnc¹+1<%,Ù( à¹â£‚*–_+ÆðMlµÞ”Ç|ÉÓ±8c.{4`Rî¶,0V$PØj‘9]‰h9%Öí ±‘k)R cÿù0 ê­ùt¿GžûS qþNΜ„#Nð *ü™øÏ1•Ð`ŠŸ°·¸¦™Â"D(`‚?ÿ.dØÐáÆ*(là‡þ4nôGC‡ò Ž|xH;|Àà¸qÀćŠU“Õ+R·NÅÓ¨Ÿ¶B• •)P³NµjÙTc«T³¢¦jÅ “ST©ˆþ$ Ôk×Y^ƒ½õó”*§•"@Ø–-8h»¶„$(` ÁÎ0@°`@% þìü³@A 0\ø `gL’ÄQ‰Ã†køÈáԟ̈v _ ”5zLv:€Bÿà ¤HñÜÚS¨Jqíi )ÑSa‰¢òêT-æåJÜ7òÞc³_'ÎuÖU§,ȶn hôVñty uëúm¹@ ànìØAƒ†iÀì¡ü9 ¾*ñ‡”^À´bxa#f°È‡nˬ‚ 8‚94Ú¡”|¨A#fx†]Ð!…Ū €Wªû ¬¤ˆb…çd)¥”Sl9e•Xº:%–[«å\x •¡r´Ž:*m”r;³Tyå‹y`­½°ã °ƒ#ñ"`Jàzë   ©¾¹‡lJÀ‘&¸Ó€ø Xàø„±ÿÃÃîðTˆft ­8ÍÑd°á”vøˆ…8(³3  `¬)sÌ‘*0Qå*á(+Å”[ÔÉTx:¥ç@Ù¥–Þ¾’%”…ìîJâž+8XQ%YÎò„– ør p€€›†)t­¶$H («¶&HÀO|OI‚ض.¼Ü*o-ó hS¾6c"@€·6Ám·-4°5Q«@„¸“¢Œ2…·°lA¥Þxµ%d!¯ËqH¸T…'T´™£W†ë)”-uÓÙ)Uˆ …•b^æ©cHA”%ýa ­þ5¸’¼¶5o  ÿZMÈÀŽ;   WØ8õS‹`€&À¬F]ó„Y 2À< ð§Jc@€¥…QàR‡ñÓ·Ì@¡²8ãò+²ðÇj—TÖ7VJ ë,^.Š”RT¹¥Ú A ¥•q…K§¢T™'å®r“RœÛ‰¬‡ReS0©% &[wHÀ` fà˽]€Ÿ˜- $€@ÂU` ê¶#\ I¢Àì*#€[ÆŠÚ€<Fמ€¤ PÛê}j*Ü„€(àpC„,\árv ]lÂ'7:…'TQS´â|ÐHŒc !M ·(ž"‡¶  2ñyÀžøŒ‡nÚ¡/‡z]žº‘S&AÀšpÄëaO›šÒ×?¶ú ¬†#cxšû1ˆ _P˜À 4 ZHFà! Á B¨«FÁC8⃠D! Qˆ>lÄ iHCÞjÀR¸xÔ¤ ¨ò·a׃@0€¸oØHoËs'Ät™aœ<9E|Ó@ YíF¦†ÝÑœ>@øZ‚š©& /hÏ®¦ØÅ"øÃ®Ð¸À gÈ FÞ„5La ×mŒL¶ Ù Jÿ`”P†4pä f@k¬à,‹Ë^@ë>%h3°! S@òu“üƒl M`¾[^ˆK¸f0Ãø»Ø£«¤s|›Fè"¿¬‡#ãÞ  :* ᔃ…+˜Þ./äŒKò˜š _pÃÌÓÈ ŽKÐð†Râx#[`ë‘‹\d&LA ]h5Šl 2PAþhƒ®`ji ‚™™°)$[ÙR`õ‘Ü5ìš#òèZ^7ŽRˆà@ž( x-„žÏAØDÊx£/ñ™^p×€dXAqVˆUÙ#¯ÑgäÁ0™„!n : ›ˆÿxÌ! ©Šjl€õ ¸4 k¦‚ ž ¯ˆL$PʸRÁoPÂÖììW;[èEº‘ÙÊÖ"o!OÀ€ì÷/n h‰ýW9”ÏŠu1-]2ì ÈÕ‰sfZ¿òÂ`Êp˜Stƒ€Ü–¹ÌsJ@.~H-ð³:F ¡À_ä,˸äV!õZ @Ô6R`]~j‡®Åù gøÂ„P€.La Æ~¶­mÍ„%$¡ ]@Æ€…ËÁ¼ Qxžð…RÒtôaz}ì_ÿÜØ~õ­)}ðóïû‘@Ó¸QŒ#´ÁôChÉL߆L/áá§?¦«üWS@þ¥Z @@,@<@L@\@l@|@Œ@ œ@ ¬@ ¼@ Ì@ Ü@¬”Î*¥¸»A,Á6zp ‡8€Æû¼v€Á{xu4AÌÁ,€vˆAv‡qX‡oÐq€Á|`‡|¸L‡¤R#B<ŒB)t@bh%¼Â´‡ïª‡{ȇ#¼Â|04ªK›B39Å xÒ–ù˜VQ™¹ŽÿÜŠS…MÐl †hØgˆC=Te€†fð‡h˜§H€8m# H€ŒJ@ €;r€[½Tœ?é?í #½ÐîˆÀZÕgÀ†C­ÖmÀ†h¸†m¸75 V†0§JHu[ I“ƒ0€¨TbýËyk‰W¸…Ux’VÀ!$íÔ‹ç@SmHÕf ÖjgˆU8Ûˆom#ÃCóx€<ƒaœ¸“ÀÈvªÿ €šS …«Ð %)ÞÈWW±ŽeEŽ¥†mHUghÕ”-XaɆP€ˆ&ü¹ 0¹8…•ð6¨Xé#U¨à‰²À¥L íÓØ‰Pz†CMUȆCµÓxˆÊZly”X°ld °ÁÑ›M€o;€l𢩩­ÁAO }ˆüi ^(ÓVxÔN¥Q¡<…VÚˆc@YiÐVmYŽ@…žW9…PPVàˆV –S¸…J79D±ªb¸Ÿ±=[¿ðÕ/a[øàÌ[‡È˜†nmŠãÀ’@=Ò ðÛ†dØjØmm NPVéŠP0…ÿ2}…T˜\Ý`…»Œ˜€;51 prc„‹"b0Ì4]Y m­ÖlÈ© €áýЮܦMŠ}õ‡H­ÖÛõk؆dàˆR¸W±(R×a…¡ØW„«¯:ì-¸(4uZ:7qC ð¶ÑÞ†ph†k¸ªVé ‹)ѾµÝ@ f@Ùm=†fІÁUßm XZ ßÞíJü%Šu4v™8#‚¹:t±ÅB)Jåd`6÷a(…j9 ¡´ë`ÂÝÖn ah€ÔŽ–¤ÓÞZ`]¸bLè†à€)šéž;³Þý ŒŠûrë6 ØÿŠ}#éÀ…¿åhІjÚH’M#Ú©Ýk XªÍŽH†h8SŽQ#MážÀ…aèecÅ ŒãôÇBk˜ô.¾A¹HtQ4fàƒYßà‰Ýf°†IÕcˆ¢¡Y(Uà…áˆeèÞhÕÖlpÓ …#•b⥗-þåH¾n‹a° ¸€›£ nò´`ffNØ€{!”db;°í=Óé¡¥Øh h8ÔE¥?9†î­F݆l8IbM*Q[¸ð_À)"-.-S HŽÜº<ã6fF€¿À¢«æ@lÚ(†º‘ÜùÛf˜cÜÿº*åª%åHåV?É fí‰U…JˆŸëI¾âó g;A €þ“Þã^ `‹Úò°šêÁ«Ø (’>-–YÐg0T n‰ex_%n ièc8†i˜†qn‰£ÕDn-0ñÂûž`¶æÂ3Wøèž{1ff&z I[šB€“ôð‡ì•S X•Mº’bI Õˆ8>Ôl°¼>Tm€Õ¦h†lhß–¨ ÞˆW0*!(e€²`;”8€qýgýê—ža²)1Ùb€ÃqÞa¥ðίÐÛ¹æfXmÖgÀ†f8å–˜†½–mM®`x',biÿ¼°p“¦y ÌnX@[ôø7¡€€ã¸]N˜ŽPÅ`)™k\.¯÷½vf¨i@TŽ0lê‹RHí eô6Vø„Vx €è†1cž%;5™;Ó €\²¯yÀíY ±"_ P8Ž m9†hÀØvY4ÔlXTñT¢°¡VøðVðXàU(†lºd¦¹£»!¨®ZꋱÆ6®ý+0.і͈°œ¡±îŸ(…—ø‡3áˆc°kjHòC•µð–8†øÙ æ["µ_T8©µ 5GS?€ûÙÙ¶õ&ñ69  ÿÌeî “S ._‡þqê €Û˜àêdpÙvr?ïúSï8Eö/`&ŸJ(¨¹onZ¬ò0[2ª‹y nðk ¨€žnÙ¼˜;qŽŸøO¥ŽH#ÐT>g(Ó YõT²¨Ùr·žžøøU£oÒd(‚ž°# n¬Üv•‹þlxî ¦õ…øÀS·ðݵú„k?Uo °à‚—"ŸñÀ\ú–ŸwE¬Åb°„WÍ ¡Z0mwK¤œ‘ewrS¨…Uy]Ê$…°Þ/<óU_­êp3ÎŒž«1<ʘ€â"V‹^ˆ…Ü©Ž!ÅŽVøY…ˆñvwYÿ‘Qg-£ìœb—uU/¿ÿzæOc¾¿±vóX€Sš„n×æÔˆB¾ŽP(ƒ×Ýxs‹x''–’ÑTÀ„’zï´ z¼\G[ލÞÅbØ>S€”oWnÔé/• ÑŠ°Hªx\›/¯N`õ"…M`…¬PÚ!."k&wÓ@/†¢/4¯Ù¥oWŒY¸¤h1T” …«Ï¨ž YÍyêàBÁ=Ó 8|Äg¾  Ç¿ˆ#è xû—¦ø€ƒM@bJΞԠH¨¦ OR*—’Ýû–Xa’ÉÜŠ£À¡T”té] ¨«4ƒµýÿfœL£æÅY ¥@ÀÜ ‘°– [qO`08À>¡¬K \Ú¿(€(™ø®àñS0Õ_}#&R‘µ¦ V(SØ:3{—°¢X°ÛžÝ°"†Дáˆ,hðàA t´`ñÂĈþ\ôÀá!ƃì¸áÃG%J¨€±‚„”˜²u ÌY0gÒ´e,¨SµFò”HêçÏžcÉ„i TQ£ Ž"¥¹ôå¬Sªzˆ`B¬$$0²€Õ°b!88ÐT}@€B V 0áç‚ &3"¬ð`€É PøÈÁsÆŽ3^ÿØ8À÷ñ?/r|ü(²'`ƒ,@¥Šæ+ÆLÕ"Í4g)T/—²:zŠ“P‰œœÎ Åjd,œM—òžyô´S[­_¢¢ZÀ( ­@h°ÀAƒ `l€Aƒ€Ey«°àÅŽÊ;Bt°²@þhØ÷d :|ìêþ@hAÔÍ?ôP™8ØpÙH™T|–Ô,³´2Ò-/¹dJ†FÕÓ)ŵr!O¥ÄÔÛo0²b-À5åbŠJíFŠ?Å@0pÕqVI°@UQUV)€•vd–È7@1Ý €ÂpCz6Dô 0DôBpÿÀ˜˜€`^ú3ƒ1`€-àO üÝPçG<øƒ #ÍЧƒU @¦ðVS©˜ *©Ä’¡k­”Õ¡ Ü‚É-9¥ÒÉ¢­ÌT¢¼¥(SR5·ÛnGÑØÓرVX=p€W=Áþ ÁqÊùêk¥5€¼¢OzÍ›?€iºf5äD3¬ÐHj Eà Ïòe¥§•- Ñ =ð@ƒ ú©'AÁðÊQ¥ÆH)¡œâ’¤«ÝËS¶eÚT)&ÂtË&ŠÚÃ2ÚKÛR¶ØbcO÷Y8`G5Àk¸,°#<À ,@¨? Dtÿ@•¸^}2뜷IàÌWà€|yä—Åàƒ 0|TB`Ö °ez;èpîÌÑ a4pSP¯©÷.å)·Ü‚ʤ…”À3¡¢ÚRÆ„¢âi¿­xZ©¦žHq7/iU#V¸)ЫXË€8 µòÄØÍ9‹ÑÎ<_t ´Ÿ6Ø ‘8|[À­[yÃÓ•8øQ4Ä ÃG+ŒàO àO-}§ÈS¡ ¼T¦¬¢?ÞBJ'/ÕÒ N¡l‚ËjE!\°K¾A,ãK¥L+­ÀÆÓàLÐ9ÐÜv𺠨Ԁ’c‡ÿ«?•D`Gs2›œ DA:Àü> 4@G 8Àè0$, Í"VÊ °.+[iÀ‘æÔ“Ô€3XŒÇ â;`‚6ÃûLTq Y¬yEq~â—<¯:éŠz#“S„bD¥ E,º—*§œÂ$²E-T¡ŠPȥȄ*d‘ŠZð³JY€ WlÉz$Tb-•ƒ7ìp |‡Wá`O쌌0­²Xã`Õ8^q :€´J%à¥Â$’Gð‘ã”Ô€(ÀÄä$Ѐ‚Z¡hr²‰ ñF'¸8‘*  Ϭb9‘MnO-eÿ`/B…1Fâ‰U¨ØoPÁ cðbUþø (BaŠeÞ &ËäP,ü!?¬4 a±#¡'°@ƒÇA€Hs+Ô,¸i$ ˜ÀöÈ— ø,b¹UÀ#±´ï*h$+E>Ȥ÷Ù¸´ŽIŽYÀÌ`…0ˆæn!jSNQ Uì+'ªØÄj210Rõƪ¹ IášYl"4ùåßRq —ö„Ý*B‘Š£„âcE/1ù%4¡d9Æ<+ ht[YÀ4º„Bu. xÂÎp3D¢«xI.›ÙUÐ )M"RPAŠœtÔ5¦øq>R”‚'¨øÔ¾“žj¨­È(L:‹ŠM¬BžðbtxÄ@ Õ“H°bê0x´×(P;{-ªJR⣕=`€L´:Y–J  ¸±jœúÖ2J’©í9Is 0×- G‚nŽP{ZE«vøGØÌp†õžÁ mM)<ñŠVøR¹dÊ*ŒÁQ˜ÈÓ×)dÑ Îd*<9íÂ~SŠ{ÙB&·0Å*tQ°‚åä¦ðRh!‘Á­ž˜@@-,€€TÀÿ®ŒG>·G±’Ú¢†€pG;Ák8 óFöc@wð€$UÈ(@Ï~‘d¤Œˆ‰ÐMÂ-É v81à,€ µÂÀ\/<á gx ±çÌP¬³>œńҊSÈĦè,/:¡¯‘†ÎFA¦Ú*›“™¬¸¡3=·,^Ê‹LZ7$0ãn|L%VIŽë†ÑV¥rz›Z‘Àúv¥•W­ÑkF@oE(Zþ1Ú§è`µÆ‚éÆLf `Õq€V]ÍF¯V‚¡I…À0º¼‚ɨ¢ÍÞ0ƒ™½^°Â ˆbøâþ`Å.tÿ± JLbME+^¡îW˜B_éVI½Gè©(ï`þ˜,£ïƒ±ÂÆxE/óŠ\JD~Â7¬b€b`t ¨ R—s€ÄÙ¿€ ÈXÁÕƒ¶ÉÈ’•x@¸rXD棳£ïx'‚ðø¨7ÈX! ‘z1Ȱ@íõV› q8‚z×{…1À€„"áF0"؃¶pCÀ°ªE,\j¨:»h7¿â-xaX^Ȱ™RÑóJC1·ž‰°»Ý¹¾œYÀ€ÈÚZ@:©'l̲Ùi5 HÔ±FÑx^#:Š4m‡ÿC:€‘œ¹A"Pb´®,h$ê_΂‘´Á 6ì§}…÷à¶?Ä "ˆ7X¢ =yE|» Ý"Â.YŒb¡/Y˜Âƒ€Ä <ÅZt–'¸8´Ê€ ‘*yÀâÔ¸ÿA—  ™Š»¸œW @€S–² ésö{ä´LͶ(§»qè´ Vè´’4w8D ] ûùC|ÐÅìÍ×!ÂÓ}à"ÂŒhõÄÜ|ÈjDSDÔõ³¼‚*Lßm\Ÿ‹ùˆU€DÀ)T“tWQÉ­…¤Ä4ÀHÿ€ÿðŠ„ß>‹Xi„Ë,¯¬ùyë4‰uè¡„|h\V UV†7Y>ÓðùZ=@–¹Z€Ô¡\›€ÙÒaÁøÃ|DÀ0ÁHÁ Ó} $‚P„M½B,ÐÈä,ÞrX¸\Çeů¸Ïlʇ|ÊNt̉=1PoqÃwÀ_l•ZË¥UpCTýƒ|{ÒÿžÒ¡A|æ#$”b!^#4ÁLLX¦?Nrˆ™’é h{yšª©LãzaAH鬬A\cØ'ø €>m¨n £§¨R%I1TB%ÇðŒV×I¡È=•\\P"A„@LŒŠÉ«hC)(‡Å ¦®Ä‰ÀðV¼UQ©tˆÇ?pƒ’ž“fDLhžZé•b£ÔgtA(Á DDÁ\ˆÓñDˆ$k`=t—Ú)6’A€æãâež È<.ÇïHàj~h‹5À¬• É…E% ¨â|(Víÿ##yE>£ÙÁuYÔ¢X€\§AʈNCihXp„†?`Œ×EH„Øç®fë•NAd]Øç5f,ŸÂä4^¬DÁ¬,XBOŒOŠ,!–lD\!*Á…&b}hŒf1þ–VŒŸÉ(€=ar$­–jn€7°hÉí«S]ü¥Z…@ñ賘GÎP€T€(!9%Ã6¬0Y„ç´Á{E„ "Düèê^iÝV&6檅’Áøä@P,DT&ÝV&â¢Æîê5n©@D¤AâÀÁ ÀèʆE:qÿêq$€hSkúÃŒ&SñâÔÞ`¬P\E„¾F ¿jÌÿ &Æ=@çUBuòŽIÌšy0˜î{TÀ”ØA7ô¥èn«BW¸k’¾A (:¦?ü€Æf)ÜÁ€DAˆZ€¤Á¬%€Áîøáj¬®2.þæmþââæ©´œNDXNü4@¤mZ‹NÇ@‘±nQuCøm=ÙÑ­0Ð-šf‹µ®$-­p]¦âã+,N ƒã‰d\© /\ Ä®1€7œ×lð@X91°TvÃJi°,0ÅiS€0Ä_ÉJ£H¼ÿÁˆ´]A(k4ÀÏÑ…¸¬?¤¢•â)Çâ/ãïMni¨Á+V…ÁÀíHŒ€)ä "Û¬È+A¢Ú–Ú2žV €|¼‚«U…«š¦|ÌaXyð‹BÙÇp@“„…°¥îšîD¸Ô×q†€M`$ÀŽÈZ^ÎEg§“^jÄ ¸‹úÄÁdADAŒ(äÅcLDˆÁ{ñ'ÜäÆê/ãi!&Á„@ÀA„2·ÁXAŒïãNI%|nó"‰ãäSætÕe¡pñÊò„(áÕSUpóVl…tðJ*b¦òÄWêèZ¬…7 ú£¤ÅÊÐòAˆóAL€tùEÀúÉÕ{Pdqd$±PŒî¬‰LÇ4L?fÖô%Û1×ys)M ‹è ²yH„&mQoÒ^T@Qo’,õIJĘ8 TGuå¸U×s,µ’Ø0l`õRuV'µX5YoR‰•µXÂŽX(EI„¨gy¶A8—5^çµ^“uâeØîõ&=4–ru „÷ b'¶b/öcˆ裫å–UÈcW¶e_ö?;ntp-4.2.6p5/html/pic/tribeb.gif0000644000175000017500000007311711307651604015302 0ustar peterpeterGIF89aø´÷ 2lˆcºÖ¯±É¨€r+1(^sS  ¸Î¤ÂØ®µÈ¥ÄÞ«¯ÀŸ  VÓ㽿ͫ}ŽcQ[B'7 »Ê¡Ðà´,8)5»ÃªÂТ'/ž°qenK¤°€1;»Ë‚ÑݨÓÞ®&.%, 06´Ê^…\^dH¹Á›q~6 »Í\Øâ¥½Ëd¤ª|¸¾•áâÛ¦³8ÃÐRÆÑhÞàÍ.1ÁÌL¿Ã–6:8;ÂÌ;ÅÍAÆÎK ½À˜âäÁÌÒdOÑÓ¢89ÜÞ\½¾› ÀÀÀÎÏ"øøN ‰ˆAff8EE&ªª{ððÐøøØëëÎøøàííÜèèØøøèøøðððèççßøðãßøðÚÔøð §¤>EDba;ÜÛ¡ÚÙ¸ñäôê ÖÎøð075 øð@gd3øñ€Ã¿fëæ—œ™j÷çÝÑ#òâ+96 NJ‹„-øë[ÚÔ‚³¯xÏÊÑ϶F@;6ãÎÁ¹qøØõ×̵¶©G¸¬X·¬`-&ðÓÍ·*òÛI²¤Jyq>È¿‰øÐñÌ K?)#?8?9{q?»®pÒ®ƪ75/óáš°«–øÀé»Ϊ'¾¡7hY#õ婽´“ìá¹éãÎß²Ú® 7-¾¯}öîÓM;) ( Àœ;dW4½±‘ô­ᤠâ¦@6בìž Ð›0qV~b*ðèØøðàé˜mKÃ’5¼Ž>ó•ÙŒ ËŒ"G6±¤æŠ0ÍzøãÄøèÐðãÐwNèÞÒ)íæÞ½d¹©˜øèØèàØøðè=Ⱥ­¸tøèà÷àÕ!ùr,ø´ÿåH° Áƒ*<jž¬-œH±¢Å‹3jÜȱ£GŒïÕ²BB‚.4qóq ¿–0cÊœI³¦BQ' 0HÀÀ@‚žŒ@¡ YntbÄɦӧP£Öl¥‡BO>  @¬: @@¢!Ù¼Š*Û·(RãÊK·à€ž4@ ¡Ê Àƒ8ì 5q0^ ˆ™ãU­®å˘; SÑäj†(}>˜Àk&x€á‰bì0áÅB]Yd™ÛmÇãÌÀƒ ȆH:$d`Ô€€@€ý9 /vÈÉ2AÀ‚ 'ÿd#ä·ÝæìH³1¼½{ºëºÞ@ÄÉ #Qž0‚g"¦‚4€ÇoIâ2è¡gG.(¼çàƒ6áÑD'TÜ.FÈÑH˜`²NFPÇQ%£Ë:Ì$È= BXW#.Ò…LÌÈ"Èh¢ânŸ BŒR‘ÂÆ"˜ÐBdŒÕôg€V@†rTS ,×ì&N‚ŸH£Ý’OË€¨惨ÈcÀ°7&*ÈÑUj4‚ ,?¢÷—gʤH5lTÉ%€JeŸÃEAÏ+èPÃÏÂt€Á7çåÉ;¹ü‡¨Gv|M¡~àAÌ$£„.ž~ œ0U˜ÿM6µ(R 8³"èeª¢;¯|éª@fÖ £BÊà’N$—„H8:ø’É$ÈÒÈ+’89,f`г;ÙqŠ^¥æ±@#¾6Ì@«Z]‘ ¥g`6ÂYP rýƒÛnµÑ^ÝAæ8у`¢m›>Û€Á -ì@Û½¨Í†Og¤©ˆ2>!­ãµ¡I&í"ÜÀˆQ ¡@†¥ ƒü‡9¶¨ ;‡ ¾€‚ÚnµÖí l 9‚× :`C´Ñ¦@pâÒaÂ6X¼"Š@ÁÃ$´Dž bÂá ÊZ‹ÿÀC(VÞA{«¾Ä.î=%ø Tðhw5 b-TÄ[<`bág‹„ŽÑ‰ŒDaöhÄ;ø! h Aƒ2”»E°U#ÊÅ8l¬³08Ã⮆"¼0Š6(9P‚jk‚¹âbJ„0ð áÔ &0\îï-¸ Î>:ÒaŠ(l#ã@G4øñ o4âË@;BŒd8kŽ~ÀPG”‰Oh6§è'ÂÍc7àa mÂæþï[ÿ@ Cö`KZa~² FÔö]A-ÿ0ÏdÁ‹7Ì@Îz…ˆ}7jІ;ÜÁoÜëIFÿˆHãµ Ç–-òŽ“Ùe`\N>0¸Á mÈ_.d@üÁ J#€P.oVa?€Öh4`|zxgpà‹w6“@ é–®°æÀj2æ‚ãP¼p`A Ð å ž÷y…£€ ¾à…ð ¿ d@õ×ø7£ h´WÈga€P DÐpða€`<Š€·¦0ev¹5hsÄuwfHˆà Õ¶É` æ "ˆ†æàèpóGZP } “P~"æ È*€@s1 Ç`cŸP¿Ð ‹P}<¶fø—s׿O·ÿær…‚ `à‹Q(OÐÍTÃöFp6#&Ps2×tï€tp6–JÑž°¨KãÀì`½0†=–ÈàY@‡•ð — s„_WvP “fÀ µ`r:M€ù{Càv[e?d9 á€ZO©E*bp3x?@Ð7@UpŦ•Y À‹A Fð…/ó±Vy Ü æ òà¸È ºpñ{0 ”Þ •€ þP(s–¥ð ±à ±À ÏÐ!:8B Ù˜£Àó¦[´×hj°÷à¤ð€ÿ°0&°æOFŠ…"ည á }‹ tÀ 'ð/ C6îKÚg•è€F¡Q@ { é`ˆðß ‘ v ï þ‹ ñ Åð ±ð ±°‹(Jj`\¤S˜ÐBmànmçgJp6/éáÀdd_€Z&h90SPª%Qq a)z ‹‡t 1Ã÷GX(¬Cûð-Ñp1ÀàYÀ²ð !æ ‘€ßÀ uh , ø QPo:°~4Ÿ` 6ø  —¤u$˜€Šp`i M0¡Pk¡ÐqGxŠÉU4(ÿ°€ ! ·&P¹µ^pPÉeZ™Šà}à… —–¤©/€ 0hð[°o0w´·˜ ݰ â p ¿€  À ¹ù à9ž Ÿp~ú@:Ï’A©cƒ¬€ RàGžÕp| † ÐÙ¹râ£-ÇÇpK™€ P–˜°a ¸%Pj@&Í„W ! `€á°x“P ¦ &0 €` ò0ôà-ò°%¼!l€ ð ¬  º ±à µp Š øð; ppQ ¸\ ¦¬0 ÍFR}ð†¢4üÿÐZ I°rÙ)£oG{—P6ð|0eP6‰P‰o0wvPN@†hÔÆ¡Y Fu°¡*0$À Ч wô¥æ€1‘ò•p—­P « u ²à ³€ Õà o€ ïà6`FÀ¤Ñ”à ŸÀ Üj ¤Ðk`D€ Ýè[Â0Ÿyp˜>˜I 5z˜ºÕw°D¯û÷¡Ø$˜€£à^ [D† ¹`‚  M øf‘P v°ö G˜•àòК¸d5ž F°•`ƒÝÀ ²  `Ó2b;à€€ ÇÀ‚_°‚ úh’©ó ‚emÿ° J8Q€ ãÚK ˰—ÊÀxÐgî ðº’ù§[õzkÆ&d˜*N®0 k°Å–Ç`0$±³ gj¹ÂÀë€ °…Ûð ò@¸4넌“ð ÅP ¬pã0 Åó9¤`PF+ ˰dòªÑ‘ƒ%X½  Â@tG• §[µ[ë@ `pU@‘ꮲ'>µo¥[&póêUpD 8pµ°] P[ Vú`󹘘P JfˆÐ°ÁÑ` ¦@ã°â Î)‹à›Ð Êù ³à ˆ° ‘°°0[q— ~ÿ ·—A ß:ÆÀ ½ YP¨¢ : A¶Càáx  âM ýŠI+>HûžaWaņ$pZxp² K!\ë`”A`°tm† ¼1ß°(©ƒ>â@ cá  ÆÐ ¿` ˜à `¬›p àP(É ÁS Úº0³Æ¡À‹0²fM lG0>Ð[æ,ú€õA)à¯m—ã³r8Úw\¯ôj%@N°x kpwP¤’ A¹ Ѽ‘ý€)à V¤>ù%B@ž±P ÆÀ­l ˆpN›P ) ÿP(Ð0 • ÃK°r°<3›vÀà ;¦_É lp.àY0˜@&~pJ€Äj0Gè¯Ø™‘ªA¶J[W˜º–[I`"pµ¸WK~àÁžÀ’°I—ñ°*€khÓ ›¼Â¬À ž§±pÈRÐ ~ÐvÐ €  0_à\±ŒŸ ¢è»³l°É²æ6pG€ùL|K`J`x0Kà<@ ¢Ð^°r®à ”`CØhöx¤V¢pµ?`ŒEv$! ‘p4Š—6‘`œÁà˜ð ˜ò _‚ R ÈÆÀºÿšð °p‘à)pU–ðUÕ°Õö ‰M3Ë $­_F #àÔY Ê„W*àK0¤àx Vë¼òà * ‚&ïŠ: dÆ6îšÐ?@U…¸q» ã0Šmh3 K=&P0<á¶ÙPÕÀ/YðÒ1­œ˜ Ÿ@¿ð•à üÀxÐ ²P(îôT¢mç*©“lpf'§#ZðT6pk´Ü@5Yq–v°2 Íl€#Àü‡{¶<ØÙr?€~…®qÕp „à qšis p°äÿ`½1p€ðÇé` Æ` Çð ¦0™P Á€½Ð ±0 ÎR ˜-uŒp ¦ð –L ƒ•´/Q’Ѥà Ìà¯Ô݈ƒ U&`ê ( `<ŠÞ¤3f¬/SyD±GVÙ¤’I"‰¥˜M"Y#˜xù#Lìˆ" OŽ í50Q¤ŽàØnDUk#Š'\ ;.âÍX.a#_ròå<´ Åâ”âJ)ã$„4Hƒ EŽ˜A)­´òà… "øƒÔ¶Ãñt…-B@<žØ…/Ø#‰‡jØØA EPècLR¢#BáÏ?^Ð8Å„2ÑdP‰äMd™”KÞáÿƒ(zÁD”^P‘CO⨃ˆø)qSNMR†’'xPb‰'ð€&B>AÕ6˜À# œYÌN0IÁǨSjIB˜Èˆ*n°aŠËa†`àˆL#idµVý¸<ð©¥\œÈ”;JÚÂAÊÝB˜c‰%6žÐA”b~1“;œ)%„ùÁM|‰…U‘%”cØèE‘Nri"iš¸áZø€':µxÓ(váa%†Pâˆ]r_ é2\H!”-ª™ETnépÝÕ‰ÜÈ庪΄ 0`è HA Ô %5#ªñ£ ?Á¼KiÿŒ]p.iF. ¥’K ÙCŒEDI „¬…8ÃrìYÄ™OLiÐ}ûÕ÷”S|9…˜WØxʼn眃‰88h¡…ˆ[ÈåbÆ[ãç…–¤næ'Ƶ£’Jºh‚J¨¨ã†œ¸Áa–üa~®æL8ª>?öùa(`Ö€àØÂ»Z’"LÔŒÃ>¦Îédª©>úXw$ \ åúë_†&Hò¥‘~ÄPÃÔeFé¥kâ›q 1d‚C$ÁMdYE•WzÙ 0^éÖ ‚®uȃw@¦¥@?àu8Æh@ ÊP†A B2PìUëº"‚Ô™@WÆñÑ $’"Œ@+.hÀ»¼² hVÚ£#|HPÄ"0ÑŠ Âó3"¬‘8вPD•ä´Nì⽨ÅõÖÀˆÿ¬‹î°ƒ<ÒáqD£Ǩ-”ñ OHBž°&\A‹o|ãžP&òàŠYüb`¡àÄ+âð?†áXD! š0ÌaeÀ‚†Pé,AÂàA\T€‚üôtD`È ¥,ÁxðRl°ŒH9`©DüÀ˜@ {)ZPÓ0@§[T‚6ŒzÐFuá ¤FÁ-¢„5Ô€ŒñD" `ÞHF`^ ¢¢M(, 1dîÈ/ÜáŽ}È;œ ÂÁ‡e,ã _ˆ+8$R ^°Áåè…=xQ ;8£Þ8Æ+vá LÁe¬I܉C”¡ÿ \hC †Ð†)ˆ! =,B`¨p &< vÀA¨€…Ñà*XBxÀƒa¥-„>vÀaE3À ´P`°¦w¿ÑÂ Ø ¾Ðˆ#˜‘´`Ctðd|‡zÓ}H2 xŒE"« ïÊî Ä7zñ y¤ÕxèC[í{_^|" ¼HG9xÁ‹Xx£Ѱ‡=^¡ˆQð"jlƒ‰Y.D ‰øD"äùY2àÁ‰hE"1Z*ì€ CPÝ’Žà„&˜ApÁlPŸeAÐM{+€ ŒÀ¨ŒÁ98 „ô¢d¯PEN áÆ†LÂ}ÊÿÄS)‡0  ¡`D"ÛÈ7€B,: Å(¾!XLÈ#¾òè Úº=,Yð@s¡÷Žh¸û@G4¾aÚÈã®`L(„0<¹ÁÝÅ,aDs!J àŠ" åA È@oí xNàA€t .`i©_,‘ptB x@rG€À€¦ÔGšã#àaZ*‰Âj¤<`ã̺  ÀÐŒwW~ƒŸ“Á1ƹÆ8>‘V<Ø@"z8¢2VÀx€ÍÙƒ2âÌ‹vp#éøF:Æ1ydCž{Ƚ’uÐ#ªF ¸ P.ÌÑžÿ\ñh(ŒÖxàÁ"î`Ð5At7Àˆ0 d€¤6áþ }¡(ÚM°­¤0 1@ª1‚•|Á¥X°§æ 1¸Õ š’ 'ÌQW./Ž‘eâFèÄ8öñfê¡ð8âL°‚d½šAFœ¿±l¬Ûîó8Ä!ÏpÄe,¤ÈÏ\QÕ}«&H°Ã&Ë…ÉB¡O4…q ;PÁFÄZÀ&(bµ¸é@ c}¡>OhÀî„ö‚G"(Öʃ•€ƒ…ðI[†lO z’°ƒ~°F²ÿ€ ]D£N“v1ƒ¬ -üÁ û}¸cí¨³ôÉ>Žh˜ÃŒ ?xшxü#àÀÄwÕ¸u`Â1 ÙDs¡®Ptfé¥î •A,p)x-šÊ€ (Ž•ò•kµÞy¤˜–z±pø‚ˆAƒ\`»•èƒG°9`hxS „€€x¥ xF¨&Txƒ^0…J€…9#R06‡r0ÒØdЕ6ð˜Ⱥ†Xˆ¾øB‡è²“‡ì“³ÔÀ„ð}h«p`ƒu@¿Õ0‚«‘¸&`‚RÈJ06`ƒ#†,Ѐx‚* L©@‚ÿ¸¨€ è­ ØÈ­xÀJ‚!›@Rˆ@¨9¿“@†(híÒ@l™§D@…gÀ€HL¨…Q@…PÐÄc0…TpŸTÈYx„MP=@ˆ†j+d  5 Ž+Xpë8†oȆtø„lpísvð†q0t臱À(Æû„(P*L e&P'¨'˜†«œ&"ƒ'° "¨‚'¨ƒ©¨0À"Èš (,µ2‚À 0¡X‚¾€˜€K )8Ä`˜„O „M`DlS0†3øWÈ€€e±‡ZÀÄP¨&S‡LÈ„ÿPL…Q4d¨/gx†,8³£S† ÊPë€ÀqƳrt@‡t']d‡ãZ‰j(F8Æe¸ŸZÆ–àF…U8‰ã7Ø0H¼¹ÀƒEО;‰] ĈCW˱(¡¤ø}¨7#À\Y‚Öú¸,p‚s8‡‡((‰`0oàL@…8x…O8…aRžGð*ÀNxƒ5HVp…H€Ìc¨Iy†K†hð…L0ÅHP0Y0Ez ɶ®n;"åCIEàsøÌÏäqÈl0qàvF—Ø…bćc”EПL ¨¨,øð†Gð„¤'j # ÿÂP% 1–AÐ¥,‡?X©\A¡(ä€*ð#û‰`h…X8Zˆ‚Q`Ohç`;@È76(J„cH„2Xƒ5xƒ7p€ ˜Vó„‰\/@~øGØ„PJ°6S\„(°Ì¶Š@؃¢X‚@Iè‡~(ŒlðLnè†_°‡^(‡r¨I•p|0Æ×Ÿ ›ÍF`ƒ;8‚)H:¹p.ðuy•íxš€â,!Èc©/ðƒ/0‚?ø‚âP‚t@ ©p@°‹wˆ\ R€†>¸„ û„&8*,Œ&À/8ý …7°„# €ÀlJÀD/ÿeÈ‚UH$J`ŸŽ„jHÅ׬¯r µØ€h E;ørT }†~(0^‹'ÀÉ×”< "EØ)((•`?h„QXƒ3`­4~Ї/(…OXpÐLX5` €Þ²Q•šSûh)8 Ÿ1””l4$‚>€ƒw€Ä&ƒž`ø†j:ƒ3è‚.(V°„0Xƒ.8/èKXMl6i}8ˆH€¸€gØ*]<ˆføU€ŒÜ*Å5LÐg°Á‰P ûÂÁxP ¤2´O –] Põ| d¬†]ÀœY†´< Àƒh„ÿ;E 8à…p…55ƒkŽ®|ÂF¸ƒº{ƒp¨†ßTVµ©ˆ–ò$Ö¹•’¥P>I’$¨‚H"„uàOÀT‰¨„Dx6x3(//xƒ.xO/ðÃDàãMäØZsd5è…jàyØ”ì€"ˆIr€Ÿ]=ð8(ZoHL(‚2h¶P°ž¦õÞÕ]ƒ& g¸Úò’ ¨D˜Eè…'ȾX§O`·rHcð&@¬\ø}È4x‚FEðQ-àû:º^aèLRØ<]À„F‡upTûz8áPØzœÞl‚nÁ—†cø„.…%“,øÜjà>ðÒ5˜Õý‚?Ó}^‡.XZAX†žL ˜€ÜPã¼Ã;4@ä78I‚$øÙ,€†O ‰0„OF`mFØ…Ú[ƒñuÚÿ8ˆS`™M…¸€ `€h€W¨7è 6po°°‹ø„;³p†pè4p` …/бp8>¢`¾•\a@*@#èžÕ@h#8ÊE˜‡b5ûj<ø8!‚]X¡&X¡\è„Nˆ8a]ö<ƒ6XdØP†6À„p¸e5ƒ…r<Ðá'|Âpø†2èùU„Ïm a ¡Üá€ó€äý‘®8¡\^I‚&"h °€]È]p˜…òZ†¦YÚkÚI¸VfÅ‚.XÛ\x…7¨ˆ`…{°€ 0½¸uÀgȃPPxȃÆäoø„rðg†ÿ ¶48"@0€;”‚G>¢%``É…ƒc *¸V;Ee?p9]Ø..Ö‰aÀƒ{„ˆ#PÝ7`„hŒ˜8]¸:˜Qˆe˜ € È…Q…hà6àò †ôLZ<uÀ#p‚AŒ!Їw8‚xœÑ hx‡w†£‘© ¢à€:H‰(˜‡6¿F$õ¸¯ FPó?¨EÐÿ‰{…'脤œ:ÆÐ\Ó=‰EØ…W]7`‚a¦2ºEïP(ƒ9 fb.ƒ2bØyàah0@÷RAеs‰u¨¼Ý4ÈÙ]åUH^X|P”<‚1%LX"Ð XEˆˆ>@†Y~Ø?x8'ð£\˜=ø~˜ÏÝÑ p†I°†qE…KH&ÀˆöRz84ˆ&èa„×І냷ZÅ£;"%î[`*P„ ¨‚”'XLx7ȇj+?àTži×dƒ]xþ)Jhƒ¢Š\¸·“ˆ70à„8H‚Õe„%0xvÿFhV…Z(…òQ$PƒPÀ;@W(žZ†Eø áÑÜ1ÒÊYWùœõô$@À ã0åC†o §pX6øø )H†:¨‚:8†ài˜ˆ=ð`¸`€˜€@^ˆñgàEx†gK°„&`]8 JCžöp¨²^Ð-06PXµèöæia0¸ ²ë’à‡ÄˆjƒjàáclŠæþû `†k|`¨Óˆ'€å&hå'` 5Hgè\gƒ6¨¬( [8‡XV…‚3°;. ƒ,Tt*øáÿÑ (—Ø›ªcA¬ƒèWÿPk•—Iry" 8$°€J4åeK8Rî5XÜc€Ï5@Øp‚DpB.:B«hÀà`6´~$£›ÞpF82[ `c˜P#F1ƒ8uè„Já S„Ω…Èè´OØA˜ðÄH!ŒÔUxÑ)¦hˆI\bn)@àÅå ÎÍ麈¹|á _Ûxð_”k¨Å1Ìô‰tÌâ±…Z Œ{@ `*0›Qh@Cž@‚BÂ…x TP%0ì » Æ¡ÛîÂmñ—æ^¤ÐG€ÂD`ùÚBÐåf´Ð2o¾rõ  …2fø†&1á˜VÔ"—Hz0ò‚{cï…,pÚ´A µ0BI$‘6èúv`¤P'H ³hÅ=„Ä2,BPÕ ÀÀTÛ…]äÜÑÜÁ1èÏp@àýR(Ô ^¡œØÌpR'Ô"Äà@tÀ¤lÞ€d8hƒ„V(Cfí0TŽFàA¼‚3(Â"`‚í2(Ì(Pˆœ`ÿÁ'xB"¨RE@”À ŒpB% Â¸ÅL€s@F%@¡€¡E”@h€>dì@(XÂ7DA-ð°AhA4B(B#Ã%„B5H@À!1À´/8C+0*(¡ìÁ1ü‚4Á.DèB/Tƒ»©ÍˆQÝW°@€A‡¡€þ¸À1Ü]†Q%ÐÝÝQA Xì€ \ÀpÛܨ„‚`GüC<äƒ08ää‚:$ €À@l   &pƒ3ìàhE(,Á¨žnéÜAÀ¨¼Ã%\‚ðÔÓD…ÜÓ1¬Ù4ÿoõË[ÈÅ+laÁqqóÚÌe”F¹Et øà¬Á'Cm`ÂDÁ0)à´A(øÜ8 Á8À8—"’À >ÀA4؃%ìBA4Æ/`‚T'Z 8C5dÁ(ˆA ‚+Cfy€ÙøÛä&,ƒµ%à@5ÜÝZáÀ€ú€ˆ„[0¢DG #>$Ã9ƒ4Ü€h?€Œ@L#Xã5fÄ €xC=~XœA¬@Á¤1B;V‚Â(Œ„Á ¦T2máÁ ´Á'üÂ3ˆ‚dÁàA8ôøÀŒ*XB+Â~œ€ ¸@äÐ+ÔA-ÚCZá@,Ñ"Hå¤@;(B5èBSVbVš„>èCfu>leGÄÀÄi¡–8? ÀY*€T ì@[Ê?Ô•3àÂa~TÌA= ÝÐ &^ÖÓHSà“t£S”hÀð@8L”€<.X¦!p¡+tBAšgž!Aei†&:@Ç}ÁØ ÿB/DAa#ÐB0Ã7lƒ9<&8‘ìÈÎ €© §<|Â2‚3¤À ˆÁrÖB/ü) @è€(G-ˆlY*ˆ0lA´Éƒ)¼B4Œ˜þHRFA†å´Íå….ÀA(¨.$ȱÍC¨„(>dª€úC‚iÕÔ=´C< ^(H¢6Á „xEXAe(‹ Õ²Øe<¦hŠž<žh=YU”$A.øAÍN@ €Á8LÑ#DA¸…Œz‘:WDZÌ$€Áqƒ% ‚’-|A~ù‚;\7\C3ØA @€a@@0ÿ©eÀ´ƒ<˜Ã5ƒÕ4BÏdÁÿy'B8¦Aßô,ÁhÁ(\H/ÐÂļ‚:àAK%9-¦Ez ì@µ-%¼@–‚5ð4B#|G°)(ƒ™@“€¦X,‚"ÀD2M™»A;ÌÃîY@HLL¨€C(HHäÐe<‚Å´H…U„®Ú¥`" ˆâ%€)xÂ1x`×<°EºH¼Â6à(!Ð2W¿8‘.ß&@¼\‘4áw‘”+$ƒ|¾²k7UÃa8€)W—âë D¿š74ÿéÁXg2Ô‚(tÍ ÀÀÐB´ÿ'HÃ+à%MÂÀJ%öÃ,ÄRÁYeXþ<Ê+ª¸´)|<„Š>ÀÃÓÄ<,‚‹ËƒÛ $S*&S.8AÐC…ÖH˜F ˜­Àà›6lÁœVl¨LšÈÔj¬ZA`A=…=Ý¥Â$‚Ÿzƒ#dÂ*B`ÎÀ)I[Ë|.$lÂ#Â$Ìd €::&¢á¡½@8ƒ_Z&¸B-\%”ƒ8\Ã5t7dC ÅR‡¹€ p/4‚ð>de8XÃ:Ä)Tƒ$H&”D8øVÖaTaåA=T¨À<ü¼€6 Hdé hÀ@…W¤/lµAœÁWà¥XAz$'AˆL(DŒA)8Â$$ç¢IÕ¼‚/¤C:C:|BTh&†rZóÚÝšC èA%\¬A€…B#„‚<´k7ñ«(ÔësEfÚX@ p7³&|Á À¸Á%iAàAHƒ'ð‚=<ƒ5'¾ÀD' °lÁ-B)| pÿ‚$'ÐtfÛËÉZÃ<ÄÃ<žÎC#`‚"„€8h%¸¼Í ˆê?üÁ XÀ8ÀyŒŽ „¯‘%Ã6f´Ã+° C.”)¸€ ænÀ&FrÀLœ€'D%ìn€^„g¸À.80ÿ 8|v4Âøƒ$ÓP"AxD5ÜÄ}üGL3àC5l@»t/^À@ üñæíÐØeˆNr(hC•)‡% Bx€ÁŒ.1à4NÏŒÁÄHæE‘A) Ÿ·BÉ¿L@h†fóYkT¿HÀ ¼ƒ¦ O÷1‚"¬ä³ KCP@€2‹$ÔA;ÄÂX+ðÂ7ü©)p,5äÁ‹åÁ'L"¬‚"ðÂ'ð‚7D]ÕÂÀA8ì>†E¶ Ü•€ ì&$Ã<c5¤À˜@<´Ç—Ä0)4B<ø?D>`B«ÌÿöØtGÐ'Á „j$t¨¦vY ð€úð šJ8„‚üÞSŒ‚Œ‚äJw¸H0h²/dB&|ÂMc÷YÂ,PA,ƒÝ6¿˜Ââ4"XB.°Hȹ…Óòg¤<3 ¡"{ì‚; . Óp7ÕM9ð€‘×A H”‚ sl9P5$Â7˜#/¸K•­ƒ'dN_Â3ðƒR´A7äÁ¿Ã”¼C$xkZãÀA=”D¦fê‹Í:jm¢¡[× ?Z¾9ÊDÐÿ½jY•£†©Ÿ=oãö)ª&Á ,Õ$ˆ,Ùpøøþû—¥ÚR_¾üù³lŠFóâ5æ'e‘]ÓœåªÓD8¤ü#Bĉh:uŠqM 'OHÉqývlÙ³8cSäR0WÀ¢Ì–]Ê[A_ 4æ ÆŽ*H€R5\Á"ôÆŽ|D™àdÉç,àAvÉe­Qi°¼¡Ô®ªgÏxUÛ÷­9¡C‹F{¥'¾ù%–OäqGs²é%ŠvÜÑ‚,?–(Å_ )ä;<ɪOfÑÀcbK‘à .¸`ðÊ++ðñëRh©f‘«ñ¤ÿ·acdÙA0€ÆNœpFRðQÆ"Ðø¬´Nê@£…,«@Ã!|ûL9îxÇv¢¹#ÌØp'“mN'UŠ#èä`Àƒ„x€;LÄ ë@á%†D*@P*逑 ( 0½5B‰IŒZ<ÑeŸq¾!' Š1j\¾…Ÿ<¢hã’fÐÇs̹†Z³éfŸ4¢ØGFÐë‡S Bå•vœå’qØ«6Rp ܱgPÀD:`Ø …’á#œrññGFtÕ•ñ\þ™‡@vqæ 0ré 0û‡Rà° %s!Œ:¬-ÿ<Ò\øµjà‘UZvÍ\2ÉÄGˆ¡®8G¾±€6ªðîƒ&€hØ£@¶p@Ào °@'0Á—5â8jD8`”#¼F“B‡%4°ABèW2¢@ 0ÄVBƒèJÎ\,1Lêpb™¢±:$(â… ]¿qŠÜb"Øà'Ü DBÜ@ˆt|B Ÿ(ÆÀв(Jo@ H@‚:P”Ux%FŠZAZpÉ"àP 5<#¤€Æ;da OÜ#V²º‰9˜‘ ™Î kò@…ÿ¾±ÉY°B IØdD1 —TBþûEÿ+D 1$ÁZÃŽ`l 9@)0ào ˜À5Û…®ñCÎØ3õ‚‡#}F~ø éª@ !)AªP)U!t¤£¨EI€Î/ £i2u&¶‹"tá €š“EÎ 8xÀC ¤0 t‚ ‡( JH£;˜h &  d`# 6P…edÁ1‰‚ŠpF¸àå*‚Ð5ª¡bõ›éýpе›d£í Ç4Xa V\W®Ø¤0ðàÇZ\B‰Ðä&- -ôB¢HF`€(ˆK"  ÜDˆÁ8`Ös9ƒ~a?Øÿ:/"ä hhÂ:"º:˜`#À€<`L€ )bhâà„*äâJ4ìl¢` ›Êнa˜" †.ÌvÖ™"ÌÀ2R"xØ 8°ƒQÇ:†ò'Ú!¼œ#XÑ8d€uü‚Àð TŒ  ;AvŽ>ã ºÚ5ºÑ‹oÈ´V’œ•Õê'ÉbØãêHÁ,ÑŠ_°B»®xÆ:ð`„#£d +fá?í&£®ÀD-ªQ‡¾í2¾ o,P PÀhÀR'œ±8u9‡ïÂC2´² 0€á –ƒ²ê&°ø;¨Æ@0`YJ>uhêâÿsÊÁK#v t›ŠC£DÎÐ…2˜! k˜Ã!1OB ‚0€.x àU°ˆà‰‚™ fˆF ¢pƒ4À+â1 8Р *8a-¸ }fC1¾Á«Ze´²G?¾5n4£VSs$^‹wô‚Òo+fÁIL¬˜˜å+S † š€ ¾gölz¤@X¬å½àD(𸠸à°À`:Æ/ÆÏ!ødäf$0¡rÁ2ꉎ Èà¡Ê ¸ ÿLšÎé‚ t*G’áìä–ÁuÖÎLa¬  Ì  æà «ÙºÀ ’À 6á (AD(Á<áP ÀáˆÀÁ6!L©@`aòª—ìÿ `Z`lP` (êáf¡Í®!ÒÁ²¤¾Á&žPö"i¹¡‚A¢á@O‚  ð@Á¬aàjA ²`JxêP ÄÀˆ  àÑ`.,pÀp¨À¨ z./Ññ ~.]ÖÁ ´a`š ˜TT Š zï´ÀÖ<  ‚è2ˆ  ÐÀ vA€òì’áÒQåÒ„ Ï“^Ú°À °À ¦RC€€vÁ d` ¥@Ba.a0 ª-A0€@E¬‘æˆa@Œ‰² 4AÍäÁÄ¡ôÿÈ „ÒŒŸð0¹¸.áâ@š `ð PA|¼ ¦@ ^i²à`@>£ž@Jæ¶êZ€šÀŠàA2òR€š ratÁú‹$IÁˆàn€ v 6` bR  Àf n­& t¤Ä ŠhÕvëìª!šaí”Ë¢Á‚¾¤šÒ ¼Òóîº ’  `³ÖÂÁ¾À<‹Ç4€¢à!! ¾`4`0!.@TÀ+@ ¤À^2Çœ@a *Iöa¢VÖ õ¸áÌ j*ÉÄÿhåD¡ Æ€ŽAð` j¡”A Ú Ú€¾@A‡@ Ä \2 ¦€& 5µ [>‚8v` x@p úáâa8ƒ$ôîÀvÀ\Ü€ È&\ XÀÂF ^À鬓²@†2 æ;+\A(B¡ì0Ê. Ì  ^" ¢ÀæÚ` ’@¬`Cq á,,2u @žÎ€à þ€CB/!Ô l B/€@ ˆž‰ î H@7× Í>ÁèA$)öaEIA¾ÁhÅ>Ø‘Ž®!Z¡ŽáváÔT ÿÚ@ C|.A¶à zt†`Ä€F¡ P  ´ æ<[ J[ò%UÀR p“ ú¡¬üë\ÂÜÀ xPp ì@³Ø`,P@4À6€4wRJž@a‰”á{JJðÁ(UÑ$<­ä!ø¡sx¡sè=£À €Á^š jÀ °@ž \ÔàfÀf`f X jàŽ0ç –!+ôÁr@d€†@ þ`î@ RD<“ÀJñ r:Ì 0!kˆp>A’PÁ†aAŠÁU:´lß@.Áìà( ´Ò²`ÿ ƒ–@ 0aAüàG[•!.@´êfà ä¢%ë@Œ€„Ø Fž ˜üË/ø¢\¢ 0r,p L1ò¾\Ë ÌŽ0‡N &`auF!Ìah-¬ááÖ! 0¼áΑ< ’ \üÀd@á r€\À ˜@žàÀ¡|vvVgyvVÀÞž`–I JàÎT]Š@ª¼`v@ B‚! dÁíàæá N’öõ˜ÁRôY2×®IÚ!õ$I‚ FA:áê €D |@ ÿ¤V Ú  hÀ|À ”!þ [Û`f€GiØ%ª –à½`]`uµ .à pÀ€ þ]Êê\àA-y€ P@NàùŒ@T $`ë`À¯žàU3ì:ýʯ–O„º¡n¥B¥ÉRo›¡Ä"¼Ê»  Ö@ ê Ôcp‘€ÃaR ü„F@xvg/µ"ÙVà†²Ô`ëÜ´"ìŠ@“] †€ (Ad¡ÎÖ ‚¡d!F óøÒá˜ÁöAä!ä ˆ# Œ ø’ˆAøA3‰ F@¦€x“!€átÀÿàÀFh@Ô`…ÇÕ†À›—`v^ „2ˆSS RDàð …š)aŒ©¬Gð€ÙÀ`€vàAS" v!ˆ$ã‹ýª êÔÐ tì€Ô¸š!~¡t¨a¨Ž‚&°Í Ù,E2] Öà¤CH!ˆþ@ FÀXF`}KàRW@’Wà顦 0àL=Y¨5¹|@ „Á6¡¥Œa r#,A Ha–•šAÆ!®W¯Áö¡ÖP  L€³ âÀ8 ¢@îà$iÆaä˜Á<PVÜÁ@àZ<Ú ÁHaBàî’ A àÀt  |@–Y 8ӛŵ3Åu þàÒ@ ˆ· QH`hðn“,tÀ ÿ[¶äY]gÇDÀžà%-€uO@ÞèÓ®æá›Àø ’$Õ”$Ö£6+6Ò6¢À¼  ô¸ûá=!’Û ÂÀß­@H p€ P@làLW f`jÀº#œÀJBÀ%ËÐ1’¼€rÁµëe”“(i ‚›<ÔôÞQ’Z/ra`—0À0îÂv  î`´ ×Ó`ª¼Hm@ ¢x€AÛT0á |` . Ê$ŠeHઠ²óBÁpÓ]~Ø  ²x ”ˆYäAm@0AŠÖ4ë``õx’Ø=6ÿÜ6´60ABÏàþÊàŽö½  ßó8à[Àì Âd žáÝ÷ºU hZíU€>{‚Ð{ëN†´L&éÕˆá†!,eÁló»’†áåA¶áÔAàœŒ`ü ´ð ›u`dÉúhU¤Jx@²I,ì ¦@ AûG€¬%s*ʈZ€´FT›†ê@HR]”¡˜`ÙE€X·ˆY$HÊáÔ¢ ‘:UÀ8©Ò 9 :|1bÄF’9lô§Q3]¸”9‹ ˜^o¼t9Y&%*'uìØábÄ+ÿfÔ\Q"ç MXt!ň .T¸8 ÓŽDEŠÒBCdG'L˜ªÝ¹…-•­Té¶¡»†í̱hò® ³uvصµÃ>™²e+ˆ ÀØDÅL´Œøø ØÇY|¤Ù‡#e!…¡¦M¨!Z’Ù¸€1Äà€M™6-0×4Eàðù{ Û>FOˆX¸Àƺ/ŒÀ#l‡°u/ê9îŒ3`DnÜ=:tR¤,:üòÅÌF.‰>}óÄÄÕ›5kÂXIY K6vPìaCÆM›%LԇфF‰`¨HáÂGŤ8(uB5ÇØ¡‹3½ÄŠ,îÀµ•ÿ;òDãN3¡èÍ6äõ!7טsM:Ñlu )MÀð )ìpÇFì°> áC|4L‘…Gø0Å;x1Ê(K4BŠCŒJŽ> ðB,@g@‚N4ñÅi¦)‚‡:ÕÜ[™øŒRÇ\°Ãýñp›)°ÁÏŠ<Ä@OTAÄM4ÑIÒ J()pÀñËxF"\pK,\4Á 2axQFa” +¹tB‰. Ÿ 3Ø´ÂM9©€„+t€G›0ì€BYkM ‚ Š´£ )Ÿl£…¦ì³Ï'ÍÔòÍ„®e–Zkm#ÏY©ðã &@ÖbM-µˆ±—ÿ 6LáÃŽÙ Å_b¸‚ *l`"J2iAªPÀ €@A1 ¤% MT㥗ú”>ÿÀƒÉ ܶ›¼9ŒB ÂHÆquü9ÇD¸ ¡"C§Å:¤8”C`„ó‰GÜ}ÃE.M„ŠV˜±i«ÓI´àŠ ¤ŠS +ØW’$!CEÁpT­J…kâ°ZC‡· •Ö&°l"ËêDó,´la3Œ;ÑžuÉ1ÎT£‚(µˆÂƵwµVˆÏ&0ŸO£¾ è@R“ ª ¨oYÐ…³Ð‚YÈ¡¨Eœ—aÀBªÈD*´ÿ"­ª"øÀÄ¢Àà¡-¨Bv°„ È$h€°A ˜Àƒ´0…jh! O(ÜÄ`ƒÓˆC'âà„žMƒ%Àƒ—–±Ž](‚@D8ü0‚EÀtHÄ7Q@Ý1A¯È…)$‘ Õ€AÄK§:“Ç]H‚ dhB.„:Žc$âsàÂ+vŽ`hjS¿ˆÔ+äx5è Uô¡I <ЄY¸ÂVS¨iå7 ØàÆá¡´ØB­„.& MŒíÁx,Òµ€Í›PF8Ú0a´€ŠÿŠŠFÀ€D x@jE„EÁxà x ‚ÿ]Ô>¬A„HcqF;Q4t"?+ðTÀ ˜ H 5Q5l R,t ² FЄ(7Àûò '• É ×€ € jð@x NÀŽ ¾ ߀„  sÐÜ“ló¸Tp ¸P Hè š€ ¸$ @àN0òÐ,‚,…Vh¢– ô0‡Îphô0_5$NQsUÒÐÎð ˜Pˆ† Û`!—è°ˆ‹øˆŽxód<ܤ.¢ L¡F‹À&PI`3©H©è X*€ 4‚7.À6p(°20½#µ",PR‚G! ¥ÿ>° ÄBdp "U Ê€À–Ày € ZqRžð5" ë0Ï`¼Ð y ›àƒ™ ƒi˜ƒ †ðƒ© ° ª †© ð L0:/ÀL  è |÷ó™í ‘¯ _ä„,í0¯0ÌÁ'À<÷š¦ð û µ  šôÇ ,·›$òˆ½iõ× Ý@ v &Æ#à m€€aà ”+¥¤+)`Ià^ Àp31% <`x  "¿a:ðËàáðx°B°lÀp 2Õ ®` TC5ç90pùní¶?•P üð„ù6ÿqiî íÆ÷!þc(ýH€ ®¡0 ™`™P˜‹¹˜„P˜Zx˜'z gà O0(OÀ@R`Ùfßð ¼ í@sÊ‘ í°ò0ãÀÇqΠ‘´y?ž©|ó‡éÐ ÀÙ›ÀiÙÐ ­PÞà ê€B¨E­/9“fð l ŠÒ ˜ð/ ( KðI ¼$ ( MU+D`Þö«óÇ]OR#÷>í£>¤òé™ú5z @h 6Ж€Ä@—¶€ ã ?ª | ( ¼Ð ¨ ˜P ˆðÿ!º˜'ª……  §ð[ ˜°`¢P¨I€|³+~ #gBë@#YÀ23 ¹ K pòÐY%Nu‘Ò0¤×ù¤èð Ü Ù0"Ù`¥Üà™ê Õü€“ÆSTø€9`8Ö^p# A ó p`Õ° ¹  F°‹`“n jð: Pi46ñx`?@Dá ~0 Ð! &@4> PIQŒs²ª@!Zñpýƒ ¼` À–€Õð˜i Ïð $RªÐ}°`à Gë Yõ.¨ðl)q§ µ{Üa%èΚ€Z GpÿZ(@1€o¤ lPX´tÑn/ ­Ò‘ý0 vð mær&ÉßÀðW¼iì`!ã°ã€è@ ¡`Z¤Š „#Lp a3¸ÖjP<»€ —¨zWO xX¹-+ð x€R JPž•8‘*2à>‚ ¤"'Œ€õ˜º ©ÐxlùB /‹€ îvR£à Õ2 'õ€ ’p´–` Â@ðÑUÀ1M0uÀ7p%W²9œ# pv# y Z (à @(Oð‹ vHÂÀàM8¤2а qè Î`ÿ Ç’@ßðÇrâàEZ›¢|¼™ ž°EF° :ðžÇw\ Ààðȸ ‹T ~ÐT+PGÃu0%'0+ @+À, ž1uº3ðY&ÐNÓc.@ ­°°?’©cƒ¦€r0q‰ײª0 Ä`ªÑ› ÁÐŒpÏ€ ­à x³ƒ@ # à`à©0£I*¤€Py·" Ö Â 0@ƒ² » q‘Çá  ¢ ŒÁÉrž‰ éèp®y p¼¹Ñ EŠjÐvà ­€ÿapFœ 6ðQm´K°>€ “(;° ͳ/P6€¨"x:|4Op+K3Ñ”Fc,pÃJlZMð³  ´5\_³?²P <Ж/tpYq—Ä• ÿö!'jÏŸ³ .[@£u¼Àx¬Çž:£ A³íŒ Y𠸿‰|z6/0(µAÌþê'¼#V Jº \¥ŒœfÙÊX(ù ã°¸"ƒ¦¬‹Î`®p#š’`ð‰ =aÐ;`ÀÇ@ÔA vxN”D Í4@ÄQ‰0v@©+)ðÃ@¼ÿ¸¨>á4¢xD  Ÿ0[,{,˲› Àùf5[¦ð» ˜àrõœ o Êpy ( ëPà``ƒPçÅÇÉÇ|à¦Öp˜Ï40UÂÁh{n0É ¡ V›žlîœôw¸èР̀¥Ý £Ì ¿mºÐ[T‹  º° )¬Äl>½{-côTv)Àâø `¹ §âxox`@P`*Pí2P)àGr» Em`Ö·™ϪP îÍ–(—ož€ !µ©0ÿ ” ĠדÀz@Ý•Ÿ‰\*¾`ÀÇ0£š9£ Ð °9 P ½ ¢Ð ŸÈ60p Àw*@0ݺ$Eld òœ»)ê:çz®ÝPö`Sš \®Á‰ žÀ6ÅÚŠ`]ÐÚr D0¹æa"ì Ÿ@ R“œ¶ÕàÞ1 Í2ü°ä3SRПÀ ‰@. ž5Û»>·ËŸGÅÚä  Ñ 6û] 0P¼É–ð ™z—T ‰Ö'% ¼ x@(½Z:ðg)"PÐ3zÐ Pÿ@â<°8±ZÈY@J.ne•ÄÀ Ñuð¤°;Jç½ Áö X¥Ÿ`k\ ŒÍ€!ÜÐ OW ~µ=tº€ ]€l˜˜€XžÀVÀOr0 '¼ ½ShðšÎàùî (Àu°xn ®P¬p @ Ÿ”€ÜômS\@©p  ð˰@%¿° —ª   Ë@©!…élw Cx0H•/`àú"Ùî©!Îó ŒyP˜À#6€0Ðë¾Þ÷ò  ô N ± `ÿ <oàÈrÑ ÌÐ ¥@u—Ð ˜° x€ Ö MN öð =ôuų¬« ßPb€ž°§ XÐ eàv8°)0;Ñ>. Ü5ÜÔyCW•á ;Ç8X42q…ãâ3Òõeý “~²ðïpGp ëð  •m€ •ƒñ` é0àÅrR•@ áà ºÐ7àUvì L!p Ùp@]Á$@Yðbé‹Lßж m9ðáUŽõA0ÜÐÁ è€ ¿Í òÀ Ôð ¦°XºP BÎ@9lœ9S§ÿN&‚ >|hOgº’x s,L3a XáÂ¥U˜2\T@°`¡D–)ËED˜µ²cM2e¼>¥»•ÊÔT©@Q §¨˜8N`¤€QE„ Ñ¡¶@àAá 0e)£ )0L¡ñV<p ÌHÃu Ý,jÔRλOظ½6—.µh¦8)bó°Q6lxÑRœ &uøÍûäÑS3̹H„Ä ¥0E\@ €'·pÕxv9Ë%j Dˆ`²aCX’ÿ$@`b“âÉ|mD^€Ö+Õ­µÃ@½[Ç›tÞÈBðl€P6yC 6²ø†™tÜi«?[Ryä(ø@‚ O<1¯(@aøË‚0௿  € 0Ì\aˆáœ"À € ƒ`h‰”]„«—׸1Gs²±c—•¸ã28ƒêg+ÂHÄ“O¾ùÄŽOX±cƒ 80‚JkÈ0¦K‚²Ø%—iðàˆ ^°ï…ê°ï `ÀxBE²C9ªÁÄ[TIE•`ø¡…œqŠ0 DaC3?¡EDÉD ÛšŽ7€ðÿjx@£xX ƒ­þš0Ì00YÂFà ‰88©¢Ž:sÁ2`!¥¥ n“hÌa—w¸ùåg„г^ˆÖ±O ` ‚ RR ,` 'êx käh$™rå€ †ì¨‘Œ¨† 0vÙE<ÀÀc†h"©™wªùdœa¢ æÏ `V¼QD–MT%‹qÚÊôþ0¬$‹>!ãOÈP¤4d8†& ðÀ†Á\d@€þ" äO>™CûH@c²€ƒc¬‰¢%5„SÆ›o~¡¦›rƱäEž¤¸ðÿžx RJiƒ'ª1¢‚ #Ùa  ç“jðk»à1"ª0AEžm¢²f`MfQ'X`‘“o€†å–¨`Ùd”/ ù„ŒjTæ`FÚ/°À@ç [  K OУŽ*Zh †Îÿõ¶„äÂ'²æ{x9ÆŽcç¼^ LðÀˆh‚T`àÁ)ÁNˆ¢IåÏ-ÁÄ£„‘Œ3ŒƒÙˆŠ*H‘|æî€Å7ŽÁ3PXCªØÄ&R L©¢ŠØ2˜ )ìà¯è„.ò †à1@1C! ‹)ÌÕ´ÿà‰X¸BN`‚ªo!(F Ò ´ÏpüpT5á(2Lì\Z‡øÁ™tà.€âÀÀ px` PÁ±9ÎUŸpÇ'zñŽ3D FðÆ*RAŒk\h#pÀp€ÃeÍ Å‚Á_íÀÛ,A eœ ýðÄT· P0bj³ØP€ !‰ xÀ]ô€ƒãHÄ7¢¡ N¼¢ ‚‚@¾e4@È 9M.±! : ÅPFðI©Á €@( 9" ¼é ç‚!qDCµ±C-‚ dL¢p#ÀÂlAŒ¨dÊ À@ÿOÈcš€Ã Õ‹Ÿe*…)„…!ŠOP‚ãHG& :\BpZTl!YHªR¬ÂŸ Ä# ñ†Pôž`B2@ Ì DÜ–¨9Tîx`ùøɌРÊá!OÁá—”Q‹Sh”Žp»ÌáÊco¡hô”RdŽ ~ÈÂ/PȳJ£¸Àzá[„ÑøÆ7b!«aÜb²E8ôq 4 ´È.`JBÐ!—¨ƒ“¥,l ©€3RØÐ`,cQŠcT"Á QUk/8ìàw#È:°¢ LLìÖ‚4£)î|ÿc¡el&²Ê®3`‚ß™û‚£?D^HÁ T #ÊÈBÆðˆq¬xÄøF:šJU€Á,>‚á&¤Éã°êFA¡ J¼  Qaþ²#]ÀYÉ:Ž¡ DDÀ….f Ñ­ÖÁù«Aò †uc;`H2x¡FYXG2 òLd¸Œ•‡Vß0ŠÔŒuFˆ°C0A R`bÕÈ#Á†c<ô¯²2+ø#øP¨`;̯€„!!åJT¢Ÿx͘UD«}aHh‹ÃPÁ›0ðCŠo(BĆóy‘‡‰AÄÿF "fÒ-‚Nr‹+îà‹£X«£fp…(ԃυŒÐˆ?ð# QP„5hŠ ÿ•••x‡‘üŽ5”©˜°Ç:FáC06 ØÃÎ èò0.úF`]‚í7-E%"1ìH„Éjœ•m¸,à!ªrà&ù6°UŸá‚~Â˰ƒ& â^ؘÂxªÝ¢° s&š%˜Àƒ.² ˆEDá YhÄ2àAäx9Ö}x2vA„¨F‚¢ÜPåJÔºP.V oP‚ 0aPÀafÌPA"ÒQ‹jx¢¡ð#@Œ(ÜaÙ/7ÿ\5ôHV)àaQ`Ã"ò À’‚ »pƒ3AŠEЂ£@zá†tl€Ãòñ‡e¬w€:çà°+¬gA ¢‰ÂåR ²› AÏvÈà8¶¥;ƒ±¾HG,Nq&*Ü! Þ‡# !qHÄBéP…–±8(‚ n8 ÌO15x‡c¹ƒ£¢ÀF6ì@Œó°àÐâÅ«vß8q!àžŽtøÂ¡%†/n‘ D\¢¼x:?ûz‘¢°­W2ÜM{“B…(´h qzBd"x„!þ“åòÞùχþIá3»ø©0~ò¥A?ªµ †¢{ŒœX? ­¸µ}„ÖÎÖÞçÞÞÞçèéèÆ½½çÞÖÞççµ­ÿÎÿÿÿÿ!ÿ ADOBE:IR1.0Þí!ù?,îÏÿÀŸpH,…Oˆ—ƒ8ШtJ­Z¯Ø¬vËírqÐhd$‚g‡kB¼ð¸|N¯Û³¡ …RVùac2)j!wŠ‹ŒŽ^9./*=0* cœ j£¤¥¦t!((bd *d j§¸¹º»B(/~ce› ¶¢¼ËÌÍs:(/šc€²žµiÎÜÝÞS ~®ƒœŸ¶ßïðÝ() ³c±œ´¶ñ ̵ÁÅ ­XÐ[PÛJœÈhƒ>0,pÔ;)ŠgÃAN'›ƒ‡$, I³&– )öPXâDCÿN‚46hçΦѣFLÊX±b —Á”©U£eP1à@8}]GÀ WÓÖÜà`O U(è¡@1`§‡ ‹ªÝ;qƒV¦q_üzAØîKPªò]mX ~Ao™¶Ð2ÞüŽíŠ>Ë`¢@N>˜¥Á¹u7“;-‡=Í)'ª9°vÍ»ÈS8Û>Û6ªÆÛ>pPÜ»”“'Ï4ÉAB&Գ縱ýFˆ;v„áÁDP$蘣Î=LØÕZ›nËIþ~þ#ºëÏMg]vØåÀà Þ÷Ýw;ˆààx°€y ,`¡„"X¸éé`ÿ†LX"é‘hbj$¢‘^ `C mP,.ÀB"¤à´!<0€ôå4Kˆ ÃnZü'€Óñ0 7è‚S2xCx8ˆž:¨¥—lX¡ˆ Hp†™fÐ ÈT¢ RƦ±azsšAC|êÐá†ÌØ€EʤÇ"*ŸT‘xhlÒ@ 2–‘^zÀàs8a§m– /!ãa—ãyð%˜$—DiHâ…ç¥Á€…®Šàê®Eöê z†¦†µ”b‰±p(iPå! p  $Fèœ2°(‹HÚf›|Î¥*èC)Œ)PZÿÈ€üÔPÂíX'œ`Ú ¦™FA»tpŽÀvO¨Dj')Üú*œ§Mrv¦‘´È" ’n 0৉¶¸Šk™ÂJ(!(Â)²˜äe«Lj–yV~ªð¥ú´PÈ0 ’‚ ¤îA¯½.ØKA¾¦ `ôÑ0@ÒÍtÒ <ÍtT'À V[õÖL ‹°|(råñpÇ{@kš ‘ @j àC²´†(­Ë'R«­É Tûb&3f6à°¨€ íªž :0¬­ ìQ2g Bµ”ËPÎÐ `P@AN7´§K­úÔPÝzÕ°Çîúë±c]ÿuë[g­; ­Km¶ßZ‹™—~ LïQ‚]'ËÛÉÁ gØ,¹wßÐV;g,å4éCOž/F_PÀÑ觤Ӣ' €Áé´8n0\C0œƒ×èZ0µ¨E­i‹i–†ºÛð€O[Úú(€ù ,ž[³ö:Ûa-¹{à-À§ ômaë@›pé’É8A'd¤~ 10H JP|Ù+2,ˆ Zg¯èÄèo§A žÎ‰JË×>×?• or5ÀWbP€®¡®h8ŸêV"$Z¦!¨{ÚÓ¨:ˆ¡oÁ%` ¨Ùÿ.k„ZÕ®f;Üõ„ H€$ éI0!ˆ~Cpâ3+Kq& =5à”¡ ûp‚¸ H€NÊÄ€” &P €j¤–6¬VL¨‘‘ìRä£Ñºh´Èt­u¨k WÂØ`Hcú0Ð?¦õñu§£P€Ðí¡iÝ4¦ê`'µÙ…qwÜš@hYJ{0œôˆ‘]`‹pþÒ³ ¨ X‚Æ$@—”¨ä“VCh,) Š²% €Õ@hº¤]‰Ÿã,·\ Ñd޶ÁÖA±œÌg¾’–‰( –ÿëC@ j½‹ê@ƒù%€ sYÚRTLŽ´›ÕlJkàÔ©¸jÁi·ÊÄ Mt! ´ŽùLTŠóN`$ÚhÐ#<vA OF®HæspYe*ÐÅ=¸`h]i,PË à°¸ÀpyL Q•2@%æò ­tRk N§F>ts¦@€[_ Jø²F(ˆBé:×)`}@hEZ‚ªdªÒP‚5³5*€ ì·‡ÿí’û{f!OˆÕ3É„Xòjhðå…%m;$ä¬ ZªxÀ0· àüÿin% •¬¬@dÀEŸ¼R ˜Áö‹XÅú÷$ PT„Ñ hûö÷Àq.ói“3ñŠ@ $ë¼@´¢] #hF´3@@ŠU¬â(lh,0†ì ¹ý_[ð¹œÀ‚ (@F‚—ž¾=WV‘.X[²­ÈÐb\­¼€ÃÑEˆÀm$ °@ØkBɇþ4/˜Á\ô»ß $ö°Š½3 äLàƒ@ëâ1 øJ=ê±jÔ€ÑÜjá¼ .„µ0£/¬a=†V¼'¦tŠgÀi¬ xÁÿfp)ç0¸¾ì¡½4'\áz0€åä.@ÙM1ш$€O.8ò3BÚŠ:ˆ³] e€j€£ë±¡y\"È@€oeå3' ¾†éºpš¿wƳV`9 ä‹a¢šu')]]µˆúÂWž‹[í¢‘®¼õ­°S€híV@ÒFAbR€_$ÇÀ±=1ðah*XO%é0´µ°ôˆ(Lg‘ƒ##Ö]ÒGÛEØÚ+ÞœÀ'@Á à ¼„Î ‚4`Û—æö >½‚oßÙ¿‰Íí ^àáE›Ò“00 .ÚÿHÖ†éüZ‡_ (úÞ¦ eVq›Ñ0~€@ צm›à*VÁ·.è „y8=@Z¹ÆE®P¥C)“xÁØè€Ñp!U@ËÆã@¯·@]·,¥>²h³6ä8»®øðJaýÊËi+оö^penOâ ØÊmgq‡ûTÿÅ{Äm ÔCi 0à _†`À¢· @Õ~á o%|Xàh#@¶ý¤Å;G_à;h˜_P€4¤ Ã& ã@àßìª¯ÂØ $&r¢*^Ò*æ¡r9ÑdÂÁ ÎCcµð=àCC5=ábÿ+!¤Š„fW#½³m vzv+€rM×{†•g†5TGà‡v’6r&`Ö¦Ñ9ôSf—aÜFiÐÚcBÕ-0cs IGppw§7ÐN+0¤ÕC†Ç/Kèu‘Z„Qb%¦…æa3d$Ð&€^bäÑBZÀñÒm/c"@åf`’%'€a”ÚÂÀ@wTÓš3´‡t“¦a*0ú…X–xX„¡À‡aw'i(p+"@pQtg`G93E5ÛÆ…A˜vŒ“1x’1‡Â4W pµ'it„-(jÿvb‚ñWô;NÁ…Àxp{ÏdŠþw ^BZ¦+ ^9;Ѳ!Ä¡ÒòP~¢5ÆS9’ðŒéa;[{„Z$†wçEx–g–[ubô7~V,š°K¯`ÇáJíæhã'i°Ð’Ãâ!°Èet1f—‹­Hp„aa×§'p ð…KHô' °‰ó(^ë#Y0  Ó¶†Ñ( ¡rÀf3¤ "w{öVàu ð¥.Ð#¥ ðI -À}C§ZëDSÂg`ÐNQ¶`ú¦v¡õS¸xaŸ&Â`ŠEÿ*4Š™°~­8•“1Z¦!ZÕ`Z#a„'ŽžFâðð*^ØfA55`%y{à×Vo%K¦È"E"€ÔHÖØ ð1Vê0€`Á@‰3` —TÇ…?e: ¯$€Ñ÷}ß§Z   4æ 37*°(DX{¦‰¦a‚QŒ´EB–H—'Ü28™àžƒDc§){P~Æi*†¸±PˆÉ ª…¢†¢ñ‰ŒàG[ж-¥8(€—'“Ú ™–ÁØ@¦@X¸4o³Q#C#4>³4vHäÆ×4ŒJI'' gåÐ0ið»ÄC„|)&W¦ @`+uÁ…¼e–$0Ðâ ¹X°Q ÀcÚcƒÃ>- ¦G{U%0%°¤øF~5=¡vº¢•ÿ!Y”<áK¥!ä 46E{Œ&}ȇ•pB”yyÎÊ8P‘D-0 Z 0a¤q¼ã9e#`&0$`<¤ æh¢–‰€T„¤—†®×–M›¸„Uw—¦AgvÖ{ÀXœÀŒ“š†$@5ùaÒ&ˆQ¡=fbšp¡ID‰²«{õ„,&ŽKW$ []+ðJQóZT#ˆÇ…¦ñIÆ—a³¼Õ €þ©eø­^ôQQÑC£Â Þh ÛJ©MöJ{6ðª5®Q„´zç®RËi@ _’–êJ 0}øEP`ÿð#°u†X#” `š‹µX& B¹§':9”6|R-`C²ù3 3EPo[0±„_?åPãàpª¤[R£ 6%~ˆˆfgvM5©»t>D8™7ë Ð*kÚ.¦§kB‹Ûz†Œòùm%Q@®#ðRTÇißV~øGáÙ: —ЂD’U0‡Iæã}!Šun†U½1`>CDkqÁYw ®€}FÆ"— —C>C© Zf'J@Q©fTsÓ©Jš*¡`™F¶¾À>˜ Xylh<ª’yfÓºLI2/ÿpê¥) ´…™;§‰D–úeÑàP¹ ª3pš ®`#e®4Kë™,b®$Ѐ3` 0£jÛ{Q%@PFUK5ÌCô`·¢Õ~-B'{Ã2Zô(@Ƕ¾{7u>ÛÔ:H3_!¹„ª¤4u•ÝDCc Âfv†ÇS—3™!!@8@ºØÕ¦!\‹"S…æZCt„D\´MÛ¤5[gа¼`‡@_A?8U¶˜|°«²zXüeX7,n`>XiŠ”Ú7ðZøoßw„t9v¢!B4 C$(°ëÔ#è»—Jž†K ÿ_Ê0eÐ7ÏéNÐb9€0fZs’*ĺ’Žà 6 *4ðUÒz­¡‘¡hð.° šJ`ò¡XÂÊijF® À»!|Q†…pkg1@Bå ¢*Qr¥´: «&P‹X7ŒÃÒ«4®0·sQâ•Ð8Zu+Í3‡pKƒ_ou¶þ¨v Ùe£-Øs9`—€Ð. q U©éàdøuÓFŠ1q gj<ÑLºZ¡t¬€œ©ÍâìŠi/ ¤–qúµWå:#À¤Òwšð¼—`—?Z4S´_§Ytú¼Ï–¬¶ˆ¥f=MKSÅqKå9=@ÿ‚c&Üb' ¬µŽ|2+7„öÓ.€ Ýd¼ ±’Ò öE‰aök4—“"àÑ:pÀªÂÒ¼³Æ1w§A‚c%Š#!U‚ ©a]t>3P¸f´weR˜Ôàv‰á R§™/´FÔ®4gJMÉðÚ‡%½sG9¡£Jø ¼hZ-mÚ221áTfaq¡‰1 |ÜÖeÍc ³p a‘5 Ñb`3<I¦ÑV)g µ é(ÒÓ›·Ó: §ä³>ØŒ(' V}=C0vn­L`óÍ»k{‰åVKpMi 0RH¤²£&ÛXÝ{Ãÿ`Š*vLao«hÐf|ìYdk&*x.eÀÖšHuø•‰qMc’Ua û"Ý-Á-`363;ᇚ³P*ÀÚÄ­0" pÀϬؤÛ*l›× vÒB•=po•ataÀv^W.®$Zh×ß8|X)ö §­áªX°MÕ\þ¼[þSèFXdebÚK}ç†Ãb ’„>o«çoUÐà<âÜ6…û „p B&Ýœ0ãëQ•{à‡L¡ªõà° †µÐ]ÐSÐÆs`4”Ù`\ƒ¨ `eóýV¡un¢vÜ+Ú®‚¬bß¶¶kÀhÿ§y†5,à w¶¡¥æ½·¤jÎåz0döBa—vÜW|[(v.2:X&3^« õ Fp5Ì×6Ö$k8„ 2„Ðd<³+ )&4!p J€p¨é­9§EK9IŸ°!˜‹Xîä‚NÞ{½Ëg°s†e‹¤ÔÐÑ4okë•|5nŸ¡IPJÓ:P9ŽŸofü#máR• (  5Ð¥i©=ä@T÷ˆ#CJf§£âGK(•-è^z¹4’ß®Õ'GøpÝý9Þƒ.ÂëÑ aàCP$@H½´¬"˜`!Ôhs ‡2)Q]¹$ó‡ôÙÖ'ÆNBg{m-‚V÷V–Z PAè¤$ÀpdÀ-<Cçƒ:K#m®Ô;ûGPÅIp~Oq‚/0{³ue«UŒçaãð(`Sn¥‰=a[ƃãPY.‚‘Õ’|°ƒr 5S ‘ 0Z…_ 0ïâmﬗ¹NGêôB ”ÅÑt4 Bñð:ÿ׃âqQ±ø`l^™€#PqT"°‘Ȱ4N T Ž, P4²ÂÞŒäP"X"./R_VW b< P^\%àÆ4f :TT(e†ž{Z3Z4693ˆX£Á hT1¼߈Aá@S&È$0hÏ8«fÌÈù à6$ˆùpUF8u>š¹gçŠb{ èP€:°$òRz+€'˜ —p .´`2#M’MdìsÐCEXm3ÀàÀ€æ±øü%‰Â8·×à(0W|_?,à·PÞÏwjÁ 2 0(>H§±Û Á® ²À œ!KsRè…ƒŒ:À–_Hëâ)Pá‚( £„ÿ^àÈ£,„Ì0 ¬»Én, &I. À‚¨h N8’n Ä…Pl,`¿ –qd hJv|‰²æjª§—7äH·ö’Kqد<ˆ1ËX“5 `«b´àÎ+ŒÁ ÂC倅yxyà:bBÆ‘`rZe´Î4¡PŒN3ç¹ 8+IZ“1*©ÝŠ™+9ib‚‚0  ‡Ê ,¸òV!­[Á8TØ)HhÙ ¨l)FY€•Žèa€`gPÁ¥(f†?î,·\Jø`M ¸“] ®ù«@ @ƒm÷ÿ l%²aP =ÂÔÀlz~Œ€¦CTÌŠÜ 0Ô€â”ÕÀJÞ«A`€ ÿ€Öµ–õ&0ƒ7¬–Ìú˜ßŠÁŠ–×ì…Ð¥]µh_׫…Ç )”fª P@#"†<2SžéœÖÔÙvÍë]ãƒ×5Š™© mô/ Aß$˜ûq˜ÑsT˜àŒžóÒœ®åGìðÏÌáÄ"¢™A)] Yh³¡™µ­ok‰CœÖ™x@Rt„‡’ÓBµ˜è•+0dT9-¹’¯T µ©‘‹Ì±D6E`š%/Àv.À¶ëJ€·~ã–Àg%À k\ã]E/P¼¾x;7Ý*°”‚oH„Abt„d bI=CßÈÈ€ðºQ°³ä" ¤¤,eÿ) 5#,®7|¦3 ¸­^ë ÐÚ eºÀ‰0Àëýð&Bª¨ÌL'³Nà(Rj- ä›,z`R-£ÇöêB¤Uós˜>2Ì™Ár¡•çULôµÀ[2`‘Uæ 8ÍÕ‹¿®‘.,€Ú¼z„°£¸®g(rà-þÝ‚½R . ÀtžX‹$ i\(‘zÄ0€l`´õÞkwˆëz: D“<îÈ'ÏA#øÞ<©­*Ü• ž³« ‚+8Â’aºZ`¼’€\`‘"`N VÁ‰`|vJ%à‹N{Œ£&B*æ&d+^€ HÿÀê2`Ñ~op Ä0Ä©~kb`€FŽÅ èÑ|JöTA4,#zb—P0`.Àîî×îΔìâNã ^f'Xà§= +?Ôâ«ËÿøÁ,’A-¬á/ºÃ;Æ£<‚æ*¼«æöáÒŠJK-{æà¤¸ ‚—€âDÍ8¸ë ÌÈ-¤@qPF"#?Œ- ,À²ÎëÀîª6X¥–&‘`vjAÉDTÀ¥0Âl "¤ /â$nÖ.yFDT5N€x"ŠCbñVb:ŒÄ*%¡‚Æ*–O>„„%¯Z@Õ`*kPÿ`Òlœ–Œ BA\(ð)ä ")P €;öh<Ñ¢ ¶ÜH1RPEìÐV §Dë}þé#`Ì\¹øavXB@ç’+°/ûN$EêNÖr`*hê!@!/J!R €/£C Ëqe6 ¢…ÿf‡iVhNjˆ‘²$² —Â"@²T.ðV@šRX+Kb \XÁb&w©L °­à8 ؈êG ŸêpRßà(Z@'egöÁ*` LÁ{b!šfPA¸âüDê!$ZáCØÿ !è•"iÐH`¯šæGb háv¬BZâ[¼¼0Îk@â` |.!&<Á¹@ï 4ÍÚc*ø28òƒYZ­ëC.ç ¶!#6É"³­þ€> "å2À0¢ò÷>lq\`¨­=´²„ä#…@Š:N!ÅBbç0fÉ R )&±j  -x”aæü©–âpW ^b`@¨‡ªðBÝe4"(]ꉘ(Û¬U(Š¡1kÁznÂ.€8ŠL~@o⇫LPÀ¦l:`_èÄ_œN÷À2 7¯n7éÿ/øîd6 6 ‚``hÀÓ²JüÍNêBM(eàÅlÖ*;a'í/$`¦'z#'4À΋ª/€³¢Í5≺'æ´€{ÎcŽÀ8r4Ó>ó`26 ­ Ghåx ”@ê4á?Anç ^"¾Ü"08à bKÂpÖ1qF¬ÄÆCqLT"bp­üˆÅ~®jЄ²,³ÓßNJÓØ©® &q|ôu\ VÖÉH À,0`ÝÜP9šÈ:æ'®ô (ç!ÁF3+çŒV3¦Lê’JÙ€ñêH¼%¦FMMÚT¡[¡ö‰6ÿèHúF0 œ2 üçOÍi¾HÀˆ,¬…N `F0€^¬* 4*xdE-q$Q]ÍuEa‡±˜`<’º#lé ´@‰Vª¤bd-âVÀb)(k`]* ök‰&«"/2à­À$@*’‡Ö8ª¡¢‡²–Dâvàgö£®‡NŠ E¿NB"x`àò’Cà…/*+¥ ¼"<‘Ó馇_‡$*;`Gd #•G‹U*#N 7Ç$)8jú‚ƒ0BD²*é¡o'¢J`X{Âe¿º´5ôpÓB+oHàÑÖÒ¡®ÿGå: Œ/ÂF&?’!Y²<Z©`Z;, àp¾Ž÷N„®anÄ" €lxtiÆa'9ÅŽ\`·Æ¦ði) d §#vK€ˆ$`·ŸnâG ¯”º&\•*ݱ@1ÍðJÁf3“¨ €rºÖa5…J# xÄ« šf¼PÀF@@ x†îB—°¢*ƒGè”ÃeÌ€[=à-fkPŠj©: ZàÑ6€<é6êG]æÂ}´2scDS=Í7u¦gÓh°#UWJ€c¼XÂ?eá@ ,¡ *âv<áR& *À æÐVDÌÿ ‰"“*©r D8y¶V#«Aüg NÀƒÏþ`jR®“¨ƒ†“Í*a@@®b¨$*,£áYv›âˆ6 ‰i ‰aà%Œ`vd§Ð¤7Ô‚^ s7¢GÁuF! Lȸ¢á  `5@HÍ €I=å!üîZÔ“2ètr—a=O‰zð˜€yÁXp‘J8{>85cÎ.½W‡®Ç2, ‰ßª¢L€F`JàjGÆA>b`?ÄÌé‘V«;Ðg'Ìà_ˆ€ MÐeÿ'j  ÷¤$_ÎdÁjVHO¤EHT:•±"õr,uÔîr&ÿ$~HƒUCX„çÀ:`ŽÛ©0ªxmÍb•ͼt-ù3DDD¤<ƒ^à21¤ñbqˆÆ”sHô0Š,ÿnä9š È †­’ dÃkn§¬Vä|¢Z6 Ûè|¸O2š€?ö£t€/à ¤`QìЄî =íušó¤æ€ÞØ)ko³$g’ç9èávn‡Ÿ ùL!Šfƒ1X2 k›?C,FD ér‚\gX…b%’Z€RÄÃ,4¹YLê H­J uëoR´¤c»«’éIHðX÷Ï"¨PV“©ÊápºÕl"Yÿ…/zÑæ"r à|!Ãb]’q_bÀ4ç#n‚¦ðè¤@ ƒ“Ç7au,ç–p¡J®ŒèÓîØš½4œ=»ÌðÁ(!N*úâàÅ '/c<0<‰©ó¯zu„¤š+™ŸqíÊ0*ˆƒ&YrtU ¡ ]޹CÃfHo %ä$t 8)À¬©zà<£Œö' œr/êG3Êåt O, {ÙÿVÀîáÁ&ÀJºD|0dÒ !³ƒ£FÀq.{b XÂòpFµ¯å;:©ÛŒ—!¼h%Àa&%YôyÂí „öÅž*ü&L‡žìÿ©zq,{“<²neÀ$Ùi ,‚¤Ä”Û%04ÃPÄêȪBo„Æá;)àNò:HïRÒÂ-bÏð¤’Ù…g¢%B8g\` åûˆ|¢„·Je.'Vw¤Ä÷ŽQé6(hš‡h ŠÁ f²òÀÂæ dAT`·Và&Úps¬Z¿åÙx£ÀèŽ*O8‹’GÀ†’¡ì\¨ÆžêV¶ €†Àà 6 0ŠŠe#}` »1Bà ´/8ê|†œe›à4Âa. ä_Œ¡šŠŽ]€x_^gÉS &ÌÙS2âJË–²p¡k1FUâÓPB8BbtÐgkn¥Ìqÿâ»>[œÈ rá¤GÓóV8ï&ôù«íi'vË…;b÷ö#Y”!­ ’$€ Zàu6vàFg ÄÝ"}³ÉC|¥ö%]ÔÅ@Xrİ<` ¼õzM rm@‚öÖFó.HºÈ„_»ÖͶ€†×ÜTwpTŸp \ˆÌU*Lb®k“w¥®Àãp†+U8Ö =Ëh4+\ p!… šC¢e)¤Ägþ‚8a!(Åߟƒ8Û#B)#@ç–)å˜, $½¨$‚Þ±¿Àz=Ñ, <&D©;: ÝÐ)^¢@´ÈGVGðcvð((~efÿpm2­à ÜÒ-MªzRáÂÀƲ`kúI7@I,f S#ÀBw³`²º‡ÔÌùZ}·vƒð&¸2 ÖfÍ"žcsó`/óÒ§Tr®Þ.€]qb$ÊFÁ3BÊŒÀ¬]Ôº•©þ|ý€X`ÿhH/àÅ,Üå£è„ÎöZ"ÊMædŠû(‘­Ø›.Õ J~¶á+çŽRÀ d   Éñ‚ZÊ9,,uËs.P…Ü‘*›¦79?ÆB1$Xp( “7PƒAbX¡‹ á8”D¡@Àõx ^áðá t€HE%p\ÿY€%³XÁƒ'päü Bl8t¨¨P¤1HH004T2d40ªH,èTJ4äLJÀ$$HèÀ°$°¼Â°D h ÌÌT”䢬¼D8Ø <P¼¨P¸¼È¼P0P ÈP8l¨ÀÀ|«4´È¸¸lË ÈÊF¼¾ lǹŻ]PPbE T$ƒ‚ Š^@L€`€Á%$Tœ¨õå ‚ ¢8°n€‰¬”Ò:Há! á$D€b† @¨À4N£0,th€ÇS%¥/%-`àBJI Z¤Š5‚¹^hx0cB¯[ÿˆ6@ÃHÂ@Æ Xhq@À `‚à( W(H\ÀÉ€Ç"À ñžÅ‚«V¨ð13&áÜ!*œ( AÃ\o•1óÀ€ HôÀ$À!ŽfR-\Aú‚ú„`QÀ‚ — 8ÄôðR9sBHAÄBM‚|à`‰"¥25)ƒÝH¢POJ*ÍDÀµ«D\2èõÍ'l° Q0À +(8€  €„H­sAb `#ÀµÉP€cÄ@K<»¡ÏS±à‚²À€B(0@/  À <. `ãltÿãB@††”imô€!™q #(p‡à1Çsx Ð`Ýu8ypÀF¨À…W¬sI1°€5%ÁQõ0×+ZვVZÑ·â}¼ Y%Ì€ .X8JAp¼u Éã*6+€ºÄ6îD†ÊdñÔ2Yò¼ €€¬¶€F>BdcZiA”¢‰ù§e P@jÆœ ‚  Ú¤e°` $ü¤†±.¢‚70xèR{ðÁ7‰S‰¾ç6W¬/\¨žé-A Á2_*,œƒ9.œ#»UÖ TÐÿ_GÐ.¦(ÀŽ!9zÀ(›À¶ "¦˜1`­T©ºêf+N  ,‡A÷}U†0/ؘ ¢hÀ+DÄ~!$ !ñÛO+Ðp DM>YCwØ”‹ Xˆ”‰5‰Œ"vbfº†Ð€B +¤@Á -8à‚+ÈP ðÙ9NStëÚ 'È C )´€áp±À`(ì2A 8É©±!‹,Ç!i°±‹1yCT(à+Σ‹¡q,¨¼f*sz%<žËW ÆÏ äx3D@[¯¦³2 Àï¹zþ Ô–ÀɹTÌ­u8·ÇùÖTÿÝØØåÞ{ÂlŸPYV5`×7ð} ƒÈ ¿6ÆÀ-@¦âNÛ¬½“Àn_„d QÐvU1œ¤Û˜GHg»Ÿu.‚S«¬€w:WÑ'?hX L@31

 ?™›Ú@€ \m¤Ú  † ¡ú}äd R€  9ªF1BAÏ Þ=0„%Ë&>æf³zEµÁ^”ÀENú.nF†œ kXA»¦ä†hay¸’(TF²„Aßp‚É€cÆ[ÆBÞ±¥IÜÁ\1ñÒ(°J$n HG—¨Ñl`– xÊZ¤¦²˜ ùéͨ&K9Àpîxé *e£ À‘b`ƒ.ÒÜ+cì\6o±»;&àîEê䡺 ÿƒäÈÁrÀ]A„coIÖBJv‚x Á•DÆxP¡ÇÀÀ-(@œYðm•Áð<³¸d%¦6¸ÀJð€™ðaT¼èö’¸Dj4±Ýè|¾V-[Ø‚éäQ“E?7HS¨X|.Š!WÚ$šG0ÁŽèj›&tA XôªUÁ#e–Œ§J†œ.î8UÌ © æ)èŠøFW6`~KX‚ à,ÿav'Ýàƒ2„Žjᨄ àNk¢"“<@رµò}K\âF#Ëqà °&Žx&Y‡¸f#À)Hx¦FlÊÎv! Ñ \9ÊýLÿÀ?[¤Qp Ø#ýp**— |¢3@BffÍ™ºqMÜ7Æ1¶ùo-8 x$™”¢Cp®A€‚ƒ* %(ØY.(bM,`]ú`£cƒ™˜÷¼gj%ÚÞ§DvÃR4W†@;1Ì öãâFb42ì(§A‰%,|DrµSpÁRÂ1@dŽZÉLêÈÄó@/;°FFR– ŒÂ :È`ºˆ‘ÃÓ€âJÀ.Ø›.p庠@ X–‰:° Q‚Ó 0ç#rLd&Á&YÉØŸ]É^Y†T–4ˆ/.qdI H6§ÇÿûÂT>j­IhD$ǽD½e€D]Žà 爴* mjŽ2@ ¾Êà, P <عS]‡]@ \&-€kàd 0m0@º€°`óF¾Ú:2‘‹4 1íxEPdëq²¾NzËæ…±£ |4µ^˜äxaØ×ÏÛ8h·V H·Ù¤p0L!©¬ŒQ~´-G\~­hC0ñY+q£-ÇGÁ3Å*N` ˜ÿ–~r `»F/hÔŽÃФM=àÆøKº´+oi@H‚8ˆdÆ´Ðt;Ô¯W`7Þ Ìh0XMfpèöг`àî¹ü®à h< °é†»IÄ6NÐâå‘€ Èà;‚,UÖfïüé²V'Øá|àšMÜþvCT|£Úÿh"‚’Ž`l0E’_ŽpŒFB|ÐV Ý: #*¨‘ZQI_(èÁ,“9l$Æ XÈ›$ÆamêH GôH/ÀX¼@,„ä‹©Xj$×Òõc@4®À|• ©9ȳ€ ´•4àˆf ôwÙ'ô p΄êfÿ bž"d7t øD ™@ FW¼ÀÒd¤$°@ðÁŽ .°Ô¤Â åÀ£t]A Æ9ϦÁÈ,G1ñ“APˆ”\…€JœlÖÜŒ €ßõ£ô˜ Hȹ¶ Ô!Æ«i’@8[@ÈüáaÈÊD0OÛP.—Â&—à ld+ `«AZ\ÝÔœ‚M[‘Rt€OSܹß dã€À°Ñ+ò„dâ$,1NHàT©¬>1—…XEàÓ:ʨÒAwI€,À”Z€X†ÿ,Éà9-GM}å‡0dÞEð1‡4ȼ€ ‚à ÿ‰¨À̉ýY JÌË&ÈW$8 TBMX”B ¨+m*rÃlÀ·6b´pÙÓf&¨Å†‹š†DH¶CñAOS¾EýÄÁC¼J[ E@[pB@ßY(‘çöAÎÒÚöÑ]9àÚ@×ÅCL9E°À «Ü΀Xˆ‡@ 4­“$Žp¦ø4Š_Àn¥ñSSÈ>-lÀÆx´… 2G&0À |Úò•ÀŽÄp‡; H”ÿ-²”-¶Ù´\/¨Ñp†°J-Xíˆé«^ÍÎÌ@2,‡?-Ý0Qš¡Àl@˜È/ÛlŸFù¦ç ÄþªÃØ \.ðÝH|(Ó~ßÍ@µ!‹Œ\@%‰T°r„m…È@l6ì­Œðü‡saâײƾrlȆ¨0 W!ö’ÐtÄCäÐ ⨨e¤G´à¤´Õôˆ\ ÖM‘çâÔFÅôY_n^.H‘¢,}Ñ,yklÀ„áâäÇGH*h ¶´Aa:²Œ ‡¥YÚOX”TÚ¨\Àpî™Å”â!sX€pürXänùlÃ,]B2€ƒ6³ÿd$uº“îŽÜ± õË-ûÆoÐ#´äG„x,ÂÕ¨€zˆ@°@ È)"r@(_èü~T äšH1×äo0®–j kÀ‰Úðè5ñN,¿ÀOXSm”I @ËñÚ¢mô€À.ì ]sîÂ’çV‚è€DíÉKðÁ`%Ç]36ƒóâQ¨MÁT†çö€˜%žV¨ÎfXïð]zÄÄ¿ÝB²(#¼ Ž‚ Ѐ0JW%Ø(Šò(~ÔŲ7pÍ`ÅCòÍbÔ‚†”ÏâWuØ«È6ž pÉôÀ7‚ÀR„‘(á1"GâD³Ý\‚(àÿ˜ö(ø•$¸tÜAJs<6óéÛ¯°0`e|Íæ&A¡ ¶Œ}ÄB,×k 9êâƒìM[‹‘l'p@ ¼#cH‡ø åFõFõs7ø3® ô*£B6`Q(Ä€J*,É~©”(—9íTóá¦à¾p‡ S„ì%)~.耞üŒEöÚK|åKÚ*E'´Ï©˜qŒ5èÀùœôxí‰w/€R:ÒÉ|[fÄBh kŒˆDv6åG qb„ˆ .€Lp@rÝŸ'nŠ2æjµoâÚIk×ɈAéåÌL¡33SÔÈ8<ÊüÙ‚ +Ûˆt3oˆ T·(T”Qöÿ 8‹›ËTÔ‹6ag@+¬€­Ú…|8§4É(À|ÀKyDùÕžÀãD€Ä · âŠìÐã €jÃU}‚ÚaX€y8ܘ¼Úm6ñ­qHT@Œ]…ž+(@ Ôm[)\ãE3$A¡R/Y ;sÌ8w¶D!øt‚‹Ÿ‹Š÷×`‚Š X3 +[ŨÀžÜAD½DEá|ãÔ^—M>`,ÔÀÌ4% 8H À@ÒÐ ˆ,ßpÆ/hȪc]—`w˜VdWveT϶?a7Œ诈GLM…ÿp¦8 @ÐîÄm±gHø«ýAúsÀ¸ws öÿ˜DÛB{ëà—ˆ‚€¢_3ÁaWL´£øÚû¥C%H-l ô G™Ãðèvb¤Â T v½ פÔ @x˜¸‚_( lÚÐÔ&àe쯢£Ã:ÃQ!#{hõH£¼FäX޵üÆ}Rú´Ã‹Û¦ü—ð9…9a e{Àì8Çdä®ä ¹ÓüŒ#`ÒKÁÏÀôMÁÕ;äRLK€áÂCðŒ”Ú`„KY xØ4±lkh7´@3<DA푊½OÍ ;›€ÙâXLo@IyƒÄH­Ý¹g;aO‡µÏÛ‘üõö„ÒD`·|L;¶í$¹›üŒçÁÿKxÀN„„GjÄ@`jLB¨¥kØÙ¤$6d9ØDB¤¯…|·¢bH‘y"FáyxNI€ÐpÄXÌ@eI°]Ø£§=µvEÉøÁíG;¥‹t\;·/Àà¹æ¼F~k¢ÛŸûL>ѨÕ´ð-ªªìT<}¸µ)ŸâxPp ­_ßåæÅl9çO”D¼DƒS ‹Zlhá`Á!¬Pà„$ðuËÎÊ\ofT˜‘ò…0šÃPC‘¡\´"=ÏY;Ùl}¢K…€Œn4¿m‰0ÀÉç’h÷â„‚™4Ä©×ò©=8"@{N„6 L´ÀAgDl@ÄKÿ BƒE'†Õ ›Œœp±‚… 'P|CCÇ^73fð’)ÌæÍn L%2­Єçìj€T¡ÛÁÂ$à$à‚\1“bú0Öñ3c, ßûaMª ]I Cœtœà”>€ ¥ * @µçœ€+`6»e(ÀR’œ L®Ù›Zp—… 6,‹,)c¢lÈÜÄh#¯0 ˆïÊ Œ m ©&Û2¡0¿ ‰UO*‚ §´»Z21$ÅOJP° ý¸!Ú€çÎõÆÍ Ìžª!Un¦¨ ¾ÿ@Iv7G„ =p¡›Ðy˜*àŸá̦V‡d¶à"€ ›s=¸1Efn‚‡-HhäwBP, 4Œ¸<°Òkà4§É£FüÒS†µàaÚ→=Œè­Dî˜Å/S „ Ô (xRP×Ù ‰S*8Fn…ÐO°}¤vSÜ]ê`.)‰¯tÅ>hÁ¹o Ì 0˜Ô'iÄÙY"ƒ<¸ ˜.¨UaÍÙ pà æ•BªŠx–!¸A,{ È÷²l»šþ"ž? ͸×IjÔ‚$ m1¦}~9(¤ ùp@œû T¨QÿJù+àu+h`@ªU=½¼B”†"w¸ 38g\+Pú¸ f®^m16ÊãüuÒJÕ="èàÓ KÁÂÌ÷¾%,gæ†Ao. + `’wq*ÃÑ€† ‡rÁ7¿Â6cÛ*À¤nÅV05œ€bÆÓüËGÊdLXÀ:ü€ Õµ±0jñ(=¼uy°É Ô;-–É'“æ=_ù:ùÉ9ÅÄBýBe$õ%Œh@ p@ã'9@€ÚuBRð\YÖ<ä ¹(@Àм¡ ešâŠê”625ã†eDÀ Vÿ¤€~ï³ÈO£WòF”ilæžbmF³‰`!È5?½îI(o³T&uEjf^oàç<Ž«ã°g4Ô-:‚ÄB2P€ZWzSÁ`V´ÇkV¨Éø<8;ÌÄÙ&­+²bÃÐu@l(Sñhôdá ®Á>Òa~ ð€Ð š³Ûæ–ˆ2¼7¶óR¢a<Š•óÚ>p¥2˜Ñ<2½ )Ñ$À;÷c6ébv=w“æ¨7 7zm–% xK/)@1ð2©¼ÚDh ^Nb5 :`éÌ}xúæ׋Dt>‘ºåM¤ {cÿP[3(.3 ‚‚è`9vƒ0uaRœC幨„ezÓÛÛâ§o¢lJ(kLIC ܤ€é'œ»4¡L+÷äªc.È1dÞw¿Þø•¼e‚p.ßÏùïh°Î±Àe €( ,#]0·yú@*¨8+®ø£Ð¢u*ÆÆ¤=c7 hÀ’T)ìÖ+ ˜)ƒQ i*à¦"3¯r:G`€˜˜K7û:¾ôŽäۄ棲p¢2Ä3Ñ+¹µj(Èó¥Ë0±a€ „€±§©CG¢ƒÒc‹8Hz02ðR€N9Œ 0&ëÁAëA¨Ä €‹ÿ £È³¿¤¼Ã#€ù"øR7tÂSI>Æ 2øæ‹°É9 2ñ÷@šÇ¸ €‹€  € °€˜ˆ±ƒJ2 ãͨZ0Ïà€°€  ¬^I Û;¬ È»á±ÈRhôŒàN{ÂH„2ÁÛ˜öø° ؘš‘¾w‹ü`€;tŒ 0Ëè>šQ 04 €9ìª$n˨“‰ iŽÏÐè0³C eR©R`ÿŠœi™žÐ4·t+>I”Æ!Ù‹Y¾“L¼D€žh€Í™CŽ¢¥!X™ ¸ ÿè<ò'°P°€9Ç¤Šƒ³è(›˜"*p‰è™Pù0Ä#˜«‹"p:ù•…”€MƒÄi”ÈË ÀHŒ^ÛÆÿBÄxáÚ8c¸Ã «H: @Pè<<À èžó«´x—+h ]q•rŒé(ÄcÈp› š%P B`À‰tÊ'«ÈéÈFŒ<Tž¸à€sò5ä8 `€„s€ à•˜ë• ¸Ù‘ ´+X¼¨8ŒÛSÉiø‚  Qˆ¡|—„;âxÄš{ÊÃd7ðÚù°fj&ãH؆ÿ¨Ê³³ÉÝ¡€.p¨€B³€JB‚˜)¸€Øé%w@™Øy,ÄK¡lHÙ‰C°Q„ÁD·¦DÌÜ|ˆÊ&D•Ì¢lÌ›áÌ›àD˜‚p3àaqˆ ó‚Œ,ˆ„[«Æ1à¢%ú¹'ùNèQFß‹œ×$¥ÄMÝTO¼ÈïÙß|Ť÷è5âÜãT‚0PÎ0ANQN¢â•Âpòë§Ú‘ ³€˜rP"jé' H†¤M§ƒÈô\Ï Í z øD>'Œ¬Tâ«dX²4 Ã`³ë¥¹l(*@%Ûƒçû?‚˜ÐÈÿ9‚t( ø¼ë'€ã&ÂÔPURïp­<@QIPLT²R±ZHÑÈ”€(€@3 ߨ©ä?'!‚¢;bKGPƀ鉅觱Y)qÆh\Ò;íŽؽ¬°ƒœˆFhœ¢ÐÒƒ+¬4JÑö€.e:%+€iH€cG–˜ ˜”;BÌ€F<Õûòñ0’z ¿ƒ€z™¢BmÕµb“ ÐIš"ˆ–;/ -$d©™Ði:Aøô´ÓP%Öµ #)U× , ‡ù¢¹š]鰆РMhºÆÁ†•³»"`ÇH¥TÛl²a-ÖqEžc]ŒÿÀˆW,qØAM³y†@ÔQ9!š!DÑÈi9›Ë(¯XÊ$%×}²c½ˆd5’ p¡´  çú%]®•DlHH]9óJo!â#ØŽ=>s$Œ@ÖQP¦3ÀƒÐ{®|³ ½<£Ô€¡Ô*L¥Y'4XeR¦‹@W•’ÌÜÁ‚Ș8`êÜX14ÚòVq­Ù¥]·cUX Ùe!x´‘˃Xˇ†’Ø$ Û ¥eÚ°µ9=MŒü Œô°¼š |° °Ð[±µÛO#Û»*ÛO0Á Ú;,•¨¸•†°Š)½ÛĽ9sudª*CWèÿq晽y’3hpã«ãšÓ»Ñ@¨œ>îcL@)hðèÉp0‹Ó³³›:adF3J¯…„8£c;–]‹Œ5îdF榀Ø@¥ÿœ"L´µiá€.nåýåçK^ª,NÓänT]ÞåôÍ£€ŠHŒçC¥q’i©ÞcneJnè©Ü¹V  æ]æhöd°‘4Þã$øæV®ÒCX;s¶‘aîæi^ç>ÎP¡^Ó¹m‚˜©ç]Π—‚Œ€7nþ‚¦fàÃt…6zVè]fh(è !©èæfi²Žé‘&é’VÜ ;ntp-4.2.6p5/html/pic/alice51.gif0000644000175000017500000003016310017034535015243 0ustar peterpeterGIF89a’´Õunµµµ°9ÍÍÍw¬Í‚òŠÌ파ŒMMPKK sssPsŒ0c©ùÙÙÙk—¸Qe þþþ g%,.0”Öÿôó/1 1‹Ôo ’ 1L1EUQ„þa\d— N ³ Ect n D#±>We°°]]Rçç__R:ŒÎ÷Z„œ^Z^„½ç¡¡©?F>==v&b01J18xG”Bçç­ÿÿÿ!ù?,’´ÿ@Úáp‘4¤¤RöɧSƒà$ÉN¬#óÁ}H¸²o×+)KoSÆŠºYmÛAá–. ÇíÙR^„…1‡ˆŠ„]b4T4B’•1Š™š™‰ˆ†MVakMG§M mQf¯kO§sRR NWppwp·rYP¸¸¥G$h4gOƒ›1i2Ë'ÇÈ'ª  £gÈÑ1„‡Ñ㊞ž™…ë„â¯Û\£cc¯óò¤¯É^¼'´Â¸=šFرȼl‹D¤]ºC‘Œ|qR¦…U³Ž C#H‹+’ž¡ëôlS¢É ‘tÆ^™G3Úv‰Á†ÅS‰&L’ÿ™¹tn# ’$§s¥9¢í“4h^=QºMº£EMf²ÇåH€§èìú…kKW-X†F5ó _ÊâT¨dÉu‘Ü©›Ô ˃ ˘<CpÊ.1$ÔŠÕ.¹BQõ­3 å–•ÛÈPe§¬+}-XÈr U¬H|õw×]Ýq€üòìÝÊ D.ÑgOß—M8.ºbVqCà k3‡É7y^œ$;¢ìPÔe*UÌÐÒ!ê I’ê4‹ŒWié®;÷åï­È^~” ·œ:"ŸÕä)»r„, HÚY‚F«´‘…ÅÖ{p#wˆTÂZeÌ‚ÆiXpÃÿB G0W†=fqÒlWXÓÀ/}Éx•|ÇЋ4ص6ÖVW8øECÅ,ÌIÒ…t¬²M\jL1„lB%QI÷Ï O<Á‚kh%QÁfâ+£M%Øb€ÑU–•ñ_8%=Tœo↠¶€v7­¤ÁŠ56’U5JÓM[e2©Å5 3ˆ),X y2´Yd,Ñ£Ra é‡ÕCǵiUY_®Á£Ñ)—1ß(ƒ)f#Zh 2Á%UãAÌxñË UŠjœa`#FwãU8êU£!ÑÔø62È1“_Õn,(•™|ÆFÖ“l°ÍS˜4êTÿ¬™V]‡Û‰R5ÁÜ6ç!»R§Ç½ã¢ç wc;õ­WcbfKŒd}]ÈM•a¹¥…0N eFšfÄøÅˆe–Ù„õ®öD†ÃlT;îy"C ±‰}š´SKDœ’s?g˜¸’Ð ,Ô'Ž:Ïœ"‡|JûØ&)µdÊðn{!„¦m|ño(™bd7VÉ€)œÀ£%#HT$XAFYY(ˆK´T4„¯PTd9H%Âfc¼DsvµU-€§Qã2”ì6n< š¨ú…7• !”#@B!ôP„W*b1NJcy&ÊÛiC56R$¹´´RTDuN{nÿöæÙÜD‚¤¹0XÇ;Å Bñ”ƒðÏTð0‡f(É„1Þòî\VLMôöñk$„4@r±@¾KIí_œ¥Âräb…s0]VÆWŽ)¤`¼«ñ†%1¹CµüT މiBˆ „ƒ›5keÁ‰ [¤P.(€$\€ÍZÈð…]b2ЩWÁ¢‡&ÔO°0ƒœp 3‹|S†+ýAÔà1ªö¾5Ðç*@dL&'®Q†*牉« ÷Q¨„ƒcˤ2!ÊåÏx3H@ €$`VdÁô^×4%& þYrÖ…¤äcàé^²Ó¨ÿÌuŒÆ“Â)c<# "Æf"AA ÀþüРH@"ÊOÜ–¯8Æ@ÜØí,8FÁNÐqœ‹Y‹¹R^f4(Ñl<@ obÑ…óH£BÝšZ‹PÌ)¨A0Ìa&  Hdåà*ð d%ÓË}ˆ“ U‹•bÓϼ'9¶©­zÀ5È@•ÙÍ0¤˜“¾DÜ(æD)1‡éÈÌÀòd¡  `(ôS2ŠXÄ‘9}‘Á;TÖMr"•Z!-IAŒ‚4à›&!D{ã!tI~ g ™EyF¿¬ j0ERÿÂ$Þœ3¨—€*ï£6ûõ&ã(«1XqIoŒq!@Ô.kêVU. ÆÉs5¸ß é|‘5X¡p€€ûáàEûÀØFþ¡Êîí”Yeõ×OMBŽœqÀ;† ¸ÖNxBbåf@I<Ò¤ŽükjÐÏDÞo•cÁßbôL2²©®@{(Ix$Ç RS$ŽÈP‰ÔàÈú+£iåØÒš–˜Ž €ú (…®#ZBvÙ¯¬@d$ãÞÏêbÙˆ"m CëÓ¸yÙð€~ËDíi—Øà“Ð"òÄ5mÙc`ÄeVN3 îZ2 Ш¸›hó¨µÝÿ-ÀÜ!…Äu•9µbþøÊÜú:2«5¨bù‰€ëÉ3ÝØ©7à|àÀÁ|ÀÇÍ@&ü¸æ¼ªãC÷2Môf…(Ü"Jéiß厴‹.ˆê`ÀªÑ ÁŠËq‡L 8ð„o|EOxÂ]ƒgfwœTÑmBäéÊG¹à‹%fîIO:çBwùÓ(MÛŽáFdbA&@fÏÀÁ‚üýø9þ@þpœ4TæthF @9ÆùS¹Q.-$ë¾â7(€ÒÀɹæKÞª>0‚ãØxeV° 2‚”—»–3åÿ$¬`Êâh­ Z–q).&€Ä6mPÕŬ’tÅ”{lm@ÒÀÅ$eÓ óÈྩµpÇDsÒ¥H{ÿï°Âñ,r› ÒÉmÚ¦sË ¬ÉËtrù—? ÊÍ,²Q«¡Y¤_ÜÖš+%›]+O €žúxZ.§@M4°H[9@·Ñ٦ѩ£tKgÈì™ü†Q&¡?: ²à‰®U ʬ¾WC)LÑLZ-ËRÄžÝ,hÒE©)06µqº¬Ú¡tÛ³̦a܈ï|½æá´ylÏzÊÐ\ÊR{fƃJšHŒ‘ÈtbÆZÅQ†?Û©$ŠÑ{“¹É$nJ·t«­èl<<º£ ;µ"4W´¤©®Š˜Á@«"Kr PŠˆÒHŒ¬ IYUË‚ÆxË•¶Ú SÙbƒ­ÿGj‹þ ÓaÌÓ°¦<Ôˆì™ 0¡A/epEEÜ‹v|ÇîZÊÔw<<ÇîzeÂtLÅ:œ¾ëO`÷ÖD3p $Mª<=Ñ¿ÌA]^¯«s£©xb"‘pºfÒàZv!¦¤yÄŠ¨îàÏÍ\à¾îàr)«›IIùõK‡õKÉ€¢ÁUk)Ï÷„6±oâœÎ&pi•ãlmIë±CLCS‡ ¤Qª*ª¤J)p,±ÿm%…˜e¯ØŠC3æ¦TK Q 0 †B‘Фð8ËѸ‡ˆ‹/J6A -Ž,pʬ*JŽœÊÌ´°–b5Ô`¯¬f¸¸¼Hàf\âê,òR,@b.G‰¢§‰.P®òG)aa¬qü4‰Ìù.’õTßc'å‰j+ K,­©R””–šG@3ç…Û| U¾EÂNÌbÍê D Ë$ÊI÷h¦o´ºÀï Šê+Ò¸’Yr³t¥™Ý'x3@a¹€‚K¹åÖVÝ„èþøƒ€µSåmI8ö&'l.q šv X@`…:¨r¶Ö µ)½fs™^Pÿò)h¶1T$l„$‡…Ý1¦"*Òäóç ¡»ShA@ $×QHòL"A!vtÒYAþùW€ÀþKSœÇ(XbË2‹›èq,tŠ V–Q@!­PÀ)3 › €=@»Ø,²#€îoA{B¢.¥Ý •И"J–d ~ö“Ÿ í•}5ÎYˆë]Ò°‰fýde¸@CÈ2°&lålÕ›CR€6©Ìêe›ðƒßpœÀ*Ïø›vˆD‰tçßpß92 ¯MØô##øöõ(ÝT X4\BŽÇ)}„AL¸ƒob”€±Å ð”#€Oo øÿ^L,p;ÈÀ*É%ÂÁ |¬·òÀ9Þ„Àt„lBtÂß­pkG`^óv*Ðpœ¤T½¡<\ ¿ø€2KÊ[Ñ=P¶¿Ü ¤­¤ìr7ð< x 6€lÉ Øš­¸.ÜÞBÿ#`)j°rj@Mð47w,/dbºØãJ@ÑËÚL`tôØÍ›@sóM¬ZÏäŸý|ÞM”8®îó¬0€D{ÁÊ)ÙÞÞÀ«B ¸Tø‰‡ð;JWhÂÓÒ=³ Šg×@¸¦C)P]íÖÎ ž˜À ¡•ˆ›|Žò{MÃä&6·)šX < ÃŒTIÜ-”A "F@½ÛœrPßûÇ  ¤p- ¼“+ xJS áÎÚÊ `¯¶g—*M c9‡v‡Åm»)eœcj]®‚`بåÙÑÌØÅwʌ쪼}ì4>^=Û\Ü { ƒèdØÿÛNbÌ2\à%x8t),î˜åì-U›jú*hiEõ‘]šøãO/xÈmÎ ÎQ€ÁàÐnžäªg ”;9¬oÎp |^ÊËÐOb’ò&ÊmbG°xçR÷e”çï[`ã2ê“"5‹ûK‚ˆ—›uzä i ©ä‘„ã?3(Õ.5ÁÚкȈçpžßºÛ!@ÀÞá”›á]g†œã«Ÿì—8Ú.8+k$ZJ&   øˆGͤn”E˜9å!Ìk¤b$F >2H* ç0dRíÅ0n-²¯âÈý,ЯrÈOÜ@SàÊêÿÀèI "ˆ.oê΄'4j š%%n!œÊ@ƒ˜m’àöZáöžG%³ÚKòRp`8\fSö©µâT ÜhiÆÏ î@L,ŽóB«r,®ù)&(nU²oS4á›Îc©hb ª@f€M& Ôr ÐA£ùš«2@&ÒiÔj€Ð"&ô© É!:ð °Äêû|£)û®0ÑVãÎ\"̾ÈPüâ5v«£tà âãpÂ^Ì ù,ÁD ` ؤ”èM’ƒQ:!píM¾Ê;°WÅäšðÑo mÒÁD¢ÂM 1À¤öŽÿÅ ëfâ| ü¥5ÎÀ(Œ þ¡jC¤` •ªºª ì?T?B«8’ˆ£õc'ÐDB‡€!Läq BÏDÀ®, ™Ž s~¯îc ‚h¬ ô¦‡š&`«F`F`¬:-62cž¬ï)ä 88mŠáåÑ0BòML,2ú)n%ì.¾ *˾‰!A¡ìkœ`ELnÄÆ€/Hÿê(  Õk–.ˆ¨¥MJ¬ÏÊÐ)¾ %ݤa¢°÷ÃÊÆ"ÃÐÄ­Ü6Å4tä°&óg-Ù(dV¸ ‚S‚Mq€y êã:!*‘­8'2|€üôà-®?Hd2O2¾­QlÑ Ád.Aᓈ» í›È át-4[¡¾”*`£Ufÿ @’…&ಶæMÐJ¢1Æ/€!Ã$O‰vfõlQ?ô±Ð,²Ï1@Aþ”ºt¢‰t  <1ÒP ”'ÄjDåø4ÁBðãè ­/2®0âŽä¬ 3Ñú#‰ÜÄÔ@)ÿ ó¤“,ÝäE¶i¢ÖÒt@ 2&òÿCVÔwËÒV( e›2–ζžBBUH’0å2öC¯ì=0DCÚ #DéN·žæIzg-R2(&ˆÇR@jQ”j&,M  €4aÀ8Á- ­ÄH „ÃÄÀp?êà‹ãÐÜã«ÜdN|c!.´¾FLSÒR%J)ð l+64t@ :%>n‚Žm2FLãD,8GÜäéõC1ûCÎÈ¯ÄøíÈšˆ :µDc2-ÀÅ)À°sjÏ·*Å N&ØæAjcðÒ!Ô@"6®aC‰0ó5g/!R€ÔÖ×ÐoÔØ`NIÿ ÜÜCâ“H„C4)¤šÀcUÐj⋚àJ‡¸Dq_’À¿~ÀdCM•Š[@ "æî <8à&è„1ãFÚ Ù ICRÎB­<ôHäÐX§s°¸KÊÎKŠˆyNF VT fH'Uô‡,€@5±R¿¦ æR(`â¨ÔMò&b6Öö£ Kä¬1­òî°§‡aüÜdU’#^ÉòIé”0_êþ˜Ñaub†Ôƒ :E:Å Ðb”ñ-’ƒ6A¦]ƒ´La_QrÎØ =«òMÝ5¾ cQÖ âFHKRÕ”Bð1ôfrg¸ig¶€˜³9» è¯f–¤ÿBÚ”Ö7¬åGç„*@!¾pÀâ ô ¾òSѦB+¹ "úc º@CBÖ·1®R³4a Zp_dAm2 ~ UFç–k¬uãé-|à<Æì0I8æàeõqOïЂ3T³ðF-$¯ÌâªLù ~”7‡2æ@©‚ Õ(.ñ÷ìEUhÓ*«ÉC) {Z·fÒ¢?°‡8Í{çÎBÙÐÊ1Ž4?v2ÿUãä•»b¢‰—0…afï08WKêÁs; Rv¡•àð BÚàãia„2#WUÞ”üf–ÖŠÃH33‚°,‰B´?ÊNr‹ÿ ~b C2 ­—ükðS HngiPL¡E r JãÞBããFPEï, g†/f@Ütñ6LÁl‚8$°â1S×’vvÔÀ0HÕÊ”"f61p@xPffòQ,ê $ö…ÉVK\ÀS9\ aã“Ãr¨õ¥4ŽàtÑÊtŒæ¬ÌÃÄ6øMW‘N~p DÖâZqÊ )GÀ¤˜‘yd¬m™×ã‚Í ¶4<é QÛ$vݤTBÖõMœb8om,Müú(Žð0LcïÜàeô0Òxü€"iy–”…877¸x†²7¸Tâ2bBÉ “QþHõÿƒsL% ³I÷ äì—¡~ÐWy*ÀÎ{Ô>QrfÄyœÅù÷—8WpŠ¢5® ÑéZ**^êi#‘Js2]0K¡X `טü¨µf7Ž ÷¥Zj8ˆÃ<›Ø)Èœ+)ŸŠ`èh?eÒÁ&è¢ Rédê“¶&*žòÐ(Pû³†´ÏÁ'øÞ8—%sÑ?0ÔÄvÌ¡‘R)Ì[™·aM)£| t5  gžÐæMH C”[ŠaH2â¨ùâ­Ü<”EãeÛ $7‚­l«È9œËy·j¨(Újö‡ø¨I lÿØvY B*¾€X­¯+7l÷=úú!^j³2kÜ€GÛÀ!\8Ø´ ‰_;õÖØà¹Æù¹9) ¯j>åJ°‘0t !_cåclq¯wq_å 2-T6oãM†ÃN㮻΂*6¸!BôÊÞ ©IMýšÐ´õTFžË(+ÛœçáNÆþAo²„¿' Îô˜±Iz0Qer©)|À ,Nk<ù)ø• )ÜÀ=’Ø “±g’ŸŸ˜²))'€"w¬YˆÂj†GFf¬ðKßL)/ò_ž‚FÆÊêâÂå,C«"p-r­Ö“rÚ„ÔNY8î1¯Ì$Iõ †mÎÿZFjÙ¸kasÓ¨Yžf¬Z÷†R¬ü{–){–•²Å“ò¿7ÁÄq‘1K~ir6ëtüô±1@ÌŸÝÃ9G.š/Zß"n„Ic"‚ÐA—ä ¦fü¬¥=„SàÉe¤Ã1>Æñ`kª¼`më×ïÉË|ÍCl©ËuìÓó²ÉÜÒM)i{£Ù´ãB9LaC{0arT^ÝÅJÀa`4=ÊqÀå½Ì[œÅ”"ÇȨ̂þØ¥~Hž zë^¾³Þ–íÝÏš\ë;ÉÍ|Ô“rÔN¡Nÿò§‚~–å6šUL|/ÝØg9äûÓ=žÝ£¼–×}ì  ÷>SîУ®  ?òIIÞya…t¬N#Û)Ëê‡}æò9H‹è†¢’[¸æÐÏêTÅŸœÒÙé¹jd–Þ–W¾ãm¹ê)’5qà(7=‘ϾŒ ˜>ʺ³™Q>.ÿÀØi;rD£©Cõæàx© 1€cÎbØ~öÙiÇòPåǹ(™\åí}Ї»ÅõýÓ‘ÒÙs}ÌÉþŸ|;ÇêÂó2£Ñ"£ª’G²¢I- €©t’¹^ED*…ø"‰–šq¹8ƒ$\ÿ.ÜpAŠ“<  ¥Rù Õ¥NìIá 9:.tåii :âQN*ùdh8 1•:!dlN-ŒdØi]¡f|y¹Æâ)ÔŒU²þ>X¶ UâýõIý±ªF²L Gf¹je|Èâ,$wB?Oeà…||xÙª¤hè”èh|¥l37+_.ì5&¯úÉŽ’BCÂÙ³ô¯ŸFÌ=Ëu(ƒ4ƒÏ¦ù` Z4Ž÷„cæoP(y* PáऊyÜ0ÄÇp9`Òèl*VqA¶>!µ$j¶I2@ m܇ñOu®mô1–±Ÿ„>vAZ÷s•/P_Œ¡§¤ æNWã®,6èÏ¢/šE ã*²Ø¼µÉÑ` Z«JÁûãºýãiG¸ÝC#…Ì]?™3Y!¨žzBÌ¢ÑyŒÁ2~WÉÇX5Âì· yà’Ÿ„OùòÙPœ Õ'ÊŒ P®&\L3fBÙn‡ÖÞŽ)bñÿ Y 5f}®ãaTE]²blÛ¸‰shÅPwPZÒ®8ó’w¸eESMÆ!Tæí6•l*à4ã “ lòe”STtÛB­™¦žÀa‡ˆR™„ …²`1˜5fBPv^…Þl‰Rf%nÌÌédkW²hៜöZ 8äáÔXu¡”*Ž&Íâ"Xl}C˜Ñ g›—øXe•–ÎùZlG-€À©È)p‘­R‰ ‰¤?¿>\0Þ=wŽ/!ì3¥ìÕµÖ´vÊ$ ¹°q*Œ!Š!ˆ.‹+ÂË«q’5 _LR‡g4›ÐÊÑ@PÊÔç½ïºèP¨ÁZù(¨Õ1l©“Üt—#€}¡ën¶P ²WÆIs×Awšë+µL'Æ€íÑè%‡y"LÀ2O¤9¢Vͪçf«.öcíH˜œôzV4¨÷&xtÆ w³ôÄI]'É™.Í3ÓVjàÂk}µ°{r§©Îc“)Ù·X¶Øg³Í6ÉQ†ÚôÖsÓ]·Ýwã·Þ{ó­tÞA;ntp-4.2.6p5/html/pic/oncore_evalbig.gif0000644000175000017500000001734010017034537017002 0ustar peterpeterGIF89a¶|Õÿ$cl½½µNNLÎÎÅÿÿývv„ÆÆ¿ÞÞΆ†‰™™”™šœttw–”Šjij&%(ÖççMpuëïë„zxf†‰§¥œ¶µ±„{ŒÙØÖƽ¹½Æ¼Žªª¸ÊÊ¥œ”„zCD?÷÷ôŒŒ”ZZUbd_-|ùñæÓo솋 ïÝß/¿~üûôñM®C³óÎ TZ'œä'”à1TQ@Cv‚}áZúU˜ß…öaha†nèÿ!†/ÄG¡†$vXâ,°‚m–@^ 00Aƒs1¡„dU#U#!Wâ‡& ä?–è^{H •$|î)Ù$“íAéd’T°Á+2£T$MÀåÏu† `#ÍE&U3-Ùd”kN馔p¶§št>)çIÆ×¦ ¼ÐçŸyþé§Ÿ èž1(P]TŒ6Ø™^ L%—g”¢cæg ¶Ák z(’žÚ©¡¢‚Jê…zšª¡«~ÚiŸ|†Hª y†((­kÚ:(®HÚúÐã—9BˆRÊc™”fW¬ŽÀ%­Òækµ½^b­Úò*_·ÜÞš­´Ø~ ë¹´¦+ÿ-µï©»-»ï®Ë'­/À0@¡5Úè\Œ:ÇåH ø0L°—# ªèêšî¼ñ¾ ±»£qÅíR+±ÅO̱¼ÛÚ®¸€ŠL.¡&o{+¡1lP@–ý꣤TÁä¬óÎ9Cà‚‘Ðð¼kÑ#}mÒ'Ý4Ó*«›4Ò"³Ë. Rc¬uÖRcmõ,à`ÌÍéëU LÀóÎôì6xIƒÕD×M÷ÝvçêÖxïÍ5Ý~þ0Ñì-øáR#ήâó^àMÌǬöÚpSÞ6Û>Î5Éw¾¸çó2Îùç¤×-xé†÷=¸ßªómú ”@u‘Ç|ÿ3å¸_þ6Ü›n¾ú﮳®7ðxñcýÖ0,¿¼ ÍG½óÌS?½ôÑ?Ÿý ŠV0líQù€;ϳ½6 1`Ÿ¼öÖg_½úð³ÿûò³¯nõ÷ÛüÐ_ß?öþ{ßÿ´ç¿Â  @¾ÉL` lg“CŸþÈA6ïD HÂBO}'ô ªš·¼èíz/t¡ûbØÂÚÐy=(cö=ˆ/wLX™˜eæL1€¡ •ÈÄ%2/}ûûàþ¦w½6ÑŠNŒ¡oÅ.zñ‹` £½˜|#*;ì—rÇÀÎ(KYHÛå&Å1Êÿ0Œ5ŒAöÈÇìÑ1d íHÈAŠÑ„L¤"¿xƒ è`è£Òˆ;„ÉL.9š  ˜ ¨ 7¨ã"ÅÈÇDÀ”H%RÉÊTþqM ä(g¹?QÒò–0H_ Ѐô+ ÐÝÎÒX¶I½±Yž l‰K=òñ”§l¥*[I€jZ³š­|e,ÉÌ.v3ŠPÔe.Ç)Îr’óœæLç8sɽQG’’¤å$xIšŽjË@ÕÉOtæš®Œ¦4UyÍ‚´ X%*ÿ¸Í@B¯ŸE§D#šN]Þ` ðÏhœ#Ìœ©(r3“Ë=¤ D`¢(-g r0Pk²R ÿÓLèAgJS—¦27H)7wÊÓžúô§@Õ%7+ 0 ’DÀÚ Ò~ÍŒfÏÑ$HÔª®Ô”Ê™£hP D›¬\¥XeZÓ²4¹ôiZ­ÊÖ¶öôà*$;Ϭž1["噑¾qní)NAФÀˆM¬R 3~5¬d5«d¯é”ÀZö²>€ˆ€Ñ u©‘Ó‹B էƈ˜]© ëx °Ull }bS¬×Œ€fpƒÉžH­p-;€Ø1À³òäY‡¥T-€´gëëg(pÙ ü³h­FÛÃ&¶»¯-_¾jÐV`ÿy}»Ê{m ïUoЃ He@ȇƼîÌN©i3€†µ)M¹ ^›]ô†àÁ"k ‚„ 8ÁP™Þ X@ìЀ °—70p­š#x¥0~±‹cLã¯tÆ2¾± f " J²£-øe¿„)™éˆK³|qŒã\àx RÀÝl÷Êèeðƒ/¼Ç  äzE°„@!XÀ |›Hg5`òkÈXæøÎu®1Œ÷lg=Ó™:dÀƒÉ³—ų¿Qf£2I©€ ̤8àsža|D¹šy­aeKåæ µé½À ÿPÜ çE¯ƒU½ÞšêÖÍ€³¤÷çÔ:θ¶µ®s½ë^ߺſÎuœUÛLw@‚M#0YĶMR`Û™ bÀë_òØ2Юíw_ Û,à'è% ðÕ  ùÌèñ™Ðê™~ ÊÒ À"ðë]Ó¹ÿþ7µ.ð€üà§¶Á ®ð¸l£ù1ÏíA«߯Îf”»’¯røÂéÜb§XŘ· ‚ìz·»‹ÛbÀt`¦$ ¬j‡õžéÉóí‚„ä"OºÒ—¾t[ãúéPgzÒ/` p€³ÂôÚÆÿTÚé®Dæ€ v‡A€;Ýì7.y‹]å(g ÀÐ  aˆ—݈Œ0`ÊJg`­ Aà‚Ü6²¹u³›q¤;ýìR¼ä'/ù€3Jˆìlx\g pvÖøqбá_HZ ËÕ¯>7ˆ½ì={úW,Ð øíw °|Õv÷AoŠø Û¸å—/uÈGþñf~ . €, FfÜväŽBœmè¸ÜÁâ¶—¢'½í²ŸyÚÕþb'—–7È€¢ÐY À h€Š( „@ P»×R×toø¶xp2 }Ì×€y=°a À@ÿÉ&L[Ç3ÏÕ\=#ASq Á7°€'¿´`i7plWgï÷O¯´G®”wf—`––ƒ^%M¸UPàfˆÐx“·€$x„%˜„5€„K¨„Lø„I¸€€3 FõyÕl;#>#;ôy&od;@‚5 Æä =€àP€/€m0XJÔV¦´G;S5S9e(€MXˆGˆ†PhˆN¸ˆŠØˆH(ÐKÇ0ü¥pCzpÓ/=#&5 Q8÷ÕW1£ `Š Q=ßÀm+8‘{HƒÄGMÖƒÖ€¨xHˆÿŽ…Œ˜ˆÂŒÁ( A™Ç°6’„…*2 ¤I›´WFXÕA)Q¡2`„i˜ÒR¶s\ö9 ‚ á†rè¶{Y1…‹à€¸‹‹w;PŒM¸Kh„ü¸þ¨Ùùý¸ô•Š‘L_è\Ç"~q à p ám& v PTÔ!!§9Š’â/Ã@t,‘„°@ äYôTŽ˜ÇrØxíˆxÕ´K+øŠŠ·m1°Üø“>)BID9F)”9`!¶’8qÀÒZ  (p£(q3‘ÞÆ4``}Ç¢W5pÛ8@3ÒCÿB&h.IÀ"nù–p©Wé?ÃÞøÒx8ðd@¨“ø†/>¹C ”E9˜ƒ¹;@b)K¸9Ð tµŒ˜€^€'  "q;£ùq ċũxÿÔ¹œ™üÈœš¡>‰˜«„ÓÑrç‰pÉwgh"МEWkÓýçÖ™0! >& Ü6‡0>PXÐ6# ‹™b§¸c  j€…%£‘rePÁ‰n©’À¹T¾©œÈ@°‹–ƀȜ©¡Íy¦ ¸8ÐHàFnÙ5½Ä`fXòH‘ĉ"0£3:ç‰f`eI£-$ð õ¥y0 @bv5>@>yQùƒ+ø nf©,——–'_j™r©º à–¥ œùÇ3.J p%¯Xœœ2 ¦J«ÛˆgˆA‰«ÿ2 «½š«·š«‹õ]±5[±Õô”šUV*bÚ…|ʧ7%ç™§¤Z07c' Û‰^°]p†³e9e$ p·‹pº œ["ŠSAÐ6:pBXqtªÀÙ;£› 9¦Æiú«½š¡¼ê«fš¡;°ŠU±ˆå]ˆÀ:«?‡‘К§ÓÊ]TæþGa€J0Ý ‚âm›äZ{Ú‚yQ³S.0;t/,¡%ÒŠ Å#ß­¦— d$€À¢X<69SqëfbZœ#¸«»± {«^Ûµ¾ª«¾Jk±ÿf‹X `®>‰˜¶®ÐÚK:3À§Ÿ†f °ÖªT>@q9:­±)æàx¡j4 Šø t¯z@| u!,© pyòÊ'À >^²a@¡a«µbûµ`»º¬ ±ˆ9{¶[Tsšº2P@+bg6²ÜÕ``}­EhÎÚ‰X97Ÿ7 º?¨§õ¥Þ€² ¯©Œo€£Æ(€£ÂÐ9££ÙKÖ'°AbÓ—9x8ð¾^ ±§¿ôÛºÁº ¼t'»Ð:`„Ⱥ2%àKÐ*bI0è%·£5×™ÿ[9ZÇ©¨û%x)ÐîËœ•y=„WÜÊ!30Л@ ¯"–3`\u=ðv(, @¨:µžG¥›ƒpï ¿©k»§ Ľ Äb›«Ð9% ¯y©80·"`°" »*¶ºjE|ª‹ÚiUfevçZ! m£¥æZÛÅ]°¶ð›b<’hŠ}PjiSêfžp  3(0v À@øù×Y и;|>ìÃ?ܰFŒÅ”ÄEü«€^ú''„\Ÿ•¦€2p±7¬«ˆi®ºz„…ª Ú 3:·°eX)ð§xÿ1Ú§–¢Û[°º°$@ÁR%býÒ×'ŽHUpI ‚(0 @¡gzÀÂÐ38Úì;‡=Œ’LÄA¶?œÎ“Œ«7»¼e°¡¥ŒÖ¼‘Y–]')<ñ¬¦ C¨Ú "b|ºX$ëZs«Æö"†q`XrKj:ÉñLJ&bqp^iÆÌtu§º™9,Ô 0„ª”ÃÈêPºÜÃ0½Î—ŒÅê\Ó? ñì«t™ävžÿ—¢vf¯µX!Í=°r"¦¼Äª7›–]F]"ðÐw‹ÑþÇ]PýÃ70ÝK)ê¢ÿæÔ¦›Ç’¼y9+ ÀIÂp€ˆšL`8w%Œµ/=Î6Ý×~ý¾;ÀÅšX3@«8¿¯eeŸ£¶ªøz@Y`Ôd–%`}ô§%*W_;'·ç‰XÚ•f‚Gfu×r‡E<ÉÍ ½Äú'I™cfTöÇ’Vz¥#½‰œçµÁ‰‘3 x¨,{0Í×}Üï{ Ë0Ù°ÁÅ¥]‹M²ƒm¬0º'ྌD­ÆnúËÝ…¬Ô £f—%,7ÐÜ ¬™ð Ù©¢ÿ€—­h_QÊà™^éí¦YfÖifêFE&@—4w›K4PÁø%0 àtçl•né/]åUnåŽíÜ^Ü@/Óç>ìõmèä[Wfe nÙ*a3p°ñ\Úµ]e{4þð¦ \©üÑÌí%Η™^,Á€fŸva­Õ<@& $€sÆe]¦œo˜–IÔq§ LªfÀ„ß~ò(ò@Ópfé­ØUf²‰°mBHtw²é•Ü %"P·¿\T4 òTžòVN-÷`<`®;°ð¬UF¥ñ$04p¦´—-FtI3žÜ¦eÂðìÿt¬’>P¥x ‡½nôj¿öV~9žÆ&û"¨Ìà9ÀóÐu÷§€=|ßöÐb¬Ð Àö„ïyP)ðš-È~úã À€Ù}J7€>°-Œs6 0ã'eÔÇõ•4|„ò±gʪ/{¬É©ßÃ…u²)€ÙÞ÷Ê1|ÞjLàþmÖæ ðÒ®¿ú©ßú¬oÊÅoÊð bw¦Ð-×™02J€¥ßïúÎÅ"ÀËß÷Ü~ÊOQ«¯üÈŸþÅOüíÏþƯüÀKV–ÆxËöœØàÕî­˜Ãx8Ì@…ÅBĸ ¡Di”úœNÿAÉ“|žPœê6h>Í%†Ò˜²Ãàv9øBž†Uʯû¬ª DR!S'SF=FÀ¾†žŒp†0npLí<S¡x´6¿B$$<ºJ*=L&L*6PH*¬x<pT™›S¯ž›ûŒª).%%+#ÅBÆ@Pç*f(@@8(Œ¤ ë‰:ºÍB$éòö¨V&j¨@B‚PˆfbE{ÄÌ8€ K6Öª% …Ĉñ"£¤,¨ÀÀ ú9àÀà›ƒZ>÷Q)æÇ :’h‘)³O¡F•ÿJ' :]С2·K_3‰´ä¡IÍ :>bA3h0° B¤D¦æ}zƒ‚‘cÂtX`æË¿/A+ù ‚.ÅÐÑ;™re©7öJƼY3BTȰdÆ4Œ¨u©K$K€-¥£"Ѐ)hÀé\<ëÌ™¸d€Ö\C)ò°GHe’Vb jqëñ_¿nY*fС€ ˆca.5ò"b‚y.`¦ÃsÄ<ëÅ âKùx+;ËJà¡ä¸Á$ ç”Cl’$B>î(¬Ð§A2˜¡¦ @Ƶ@ÈÀ³ ÷b ÿfP?Ì0Qö@ <Ë*P‚hä J¸¥F¶p0Á´@‚°¦ ¡¤Ð€Þ ¨ÒÊ+§4 ƒ–0à@ HŒ+©ì­·~p« J °ì µ´pK  K,³|jnyœ0ü2O„l"³ážêÓQ5ÒI%}4ÍJ{c§Ø €­‘IÌ Rüª¼4U!l„W—ûb¥I¨€J0¨.…4U<(À"«ÅµZBàr€Ž­$BÌøŒVÚi©­ÖZ+)8]¢‡ADMÂÁÖj a‘&Ñ$ Tì ƒ$ [¥Í@ÿíD‡è€ÞŠ,!Yö@ `cýz‘h¯X≥e „¸ZeXµå&¹†|©…†ÐkÍ‘dÍ(ÀÖÞx° l¡ÉZye¾ƒ*8çßuš8Ð £Øè£­Ì¥3`šé* xµ¢ÛEÇ79\Zk¦·†sJ™,v6 4AÞ ,PAí.<ÐW®áæK àôW+—Æ9»+00¼o†»kÁ ÜðÂÇuoOo^|ñ ˜zT~®¡áç,éÎ`o¥¿Ùs¦i h±-° Uî¦Am„ÕÄCÍ7ÿÜsÇa‡ÝSOmgüíØ53Í]x­‡çœøãÿO^váoo¾ùÞg¨mTÂМnœÏ^ûæ+P×ZhaÖÐ<—KàAØ ×¾öìßÿýöøçß~Üñ—ßùøùß?ûx»™xŠ%°G^â¸.&X—ZŽØÌ¤í⢀Úo€ôTB½‰pá¹÷AŽÐƒ,d aˆ3 êí ˜AΈÃêP†=ÔaÎf’šÄ€¡PÀ 8ƒ~ˆ4ÜáeˆCŠ?¬"8E'2ч=Ôâ¯D1Š1‡c4ãÑ8F\|C"(€hÆ4ΑŽu´ãñ˜G=î‘h™7nSı…4ÿä!IÇ.òç#gÉG6’ޤä$g€ÉœŠD@À‘XÉL^’”‹Ôä(EIIU¢r•§\å+SKXÎ’•‹Œä-q™K]î’—½ä%ÖPÀ—Å4æ1‘™Le.3™çèå[| ÍhâRšpÑ¥°I·@³šÔô&/»iÍe†3’ädæ9§yËmZŽí„K;áOyΓž–+ç;ë™O}ýôç?P” 5èA G…Ò@¡ÐC!úP‰js¡e( "JÑ‹fT¢ ˜(F1:Ñ.T£åhI/jQ“Š¢)u©J_S˜ÎT¦!m)6=ŠS`s§8õéOÿ{šSžê”¨C5ªP‘T¥5©L]êQŸÚT¨:•ªSµªT±Õ þ”«]õêWÁV±Ž•¬e5ëYÑšVµ®­Â,«[ÙW¹Îµ«Â\Ç]A€W½æ•¯{õk_ûWÁ 6°yea[ØÄ.V±eìcûLL–²•µìe1›YÍn–³õìgAZÑŽ–´¥5íiQ›ZÕ®¶³píka[ÙΖ¶µµímq›[Ýî–·½õío\á—¸Å5nnK—\å.—¹Íuîs¡]éN—ºÕµîu±+ÝX Ûí.w½^ðŽ÷»å¯yÉ{^õ¦—½èuïzßÛ^øÎW¾õï}éëë^îî×»ü/Ü_˜Àî® œàð®WÁ 6pËëàó:XÂìõow1œa o˜Ãöð‡Ab˜Ä%6ñ‰Qœb¯˜Å-vñ‹I¼%ÌXÆ5¦ñmœcïXÇ=æñ}d YÈE&ò‘œä$#™ÉKvr“¡üd)G™Ê>nÁ®œe,oYË]æò—½f0YÌe&ó™Íœf4¯YÍmfó› >9Ï™Îu¶óñœg=ï™Ï}öóŸè>¿ÙÍ…&ô¡ hD/Zѳ !iIOšÒ•¶ô¥1iMošÓöô§Aj>;ntp-4.2.6p5/html/pic/gps167.jpg0000644000175000017500000003634510544731166015103 0ustar peterpeterÿØÿàJFIFddÿìDucky<ÿîAdobedÀÿÛ„       ÿÀ,ÿÄ­ !1AQaq±"2r‘¡ÁBR‚²#Ñáb3s³4’¢ÂCc$%&6ðñÒSƒDt5“£ÃdâT1!AQ2aq"BÁ±ÿÚ ?ôÍy@P@P@P@P@P@P@P@P@P@P@P@PkÐkê:–›¦AÛêy`Aþ÷&T‰vx\о5›¼Š’wËÝÔÚœ~.¤ÙM;ˆÎ\19ʼn°í&`ªúEÅkã¬|Ñ»?zßŨǧ®·FT’­Å2#1µä•G]Ú§…_–7?ó®L:Ä:2k8³jy ÙÅ ö§ŒîVd ª}£O |ºç ¯ü——¯Œº¦+jÓqvxI*´¤ %U&ÆÃ¦§_’g …Õ´—ÔF˜™Øï©f÷%• Ü+ëx¶SƯœ=ï8¾õî¼~öT¸Æã^ׄo<â¶Þª˜«åñÇÚ˜x×¶U Ñq0§`%wÚ˜<£"<'Öµøzm×jar °Þ-C «r cÕ@XÐ@P@P@P@P…fÜ/C(`çÞJåÐ}kX¸Ž?˜ãí%ÿÓ‰þ*³[XÛ²G>Õÿ̆Ї.h¹z­¯ýk(Œ™•&>u˜4Ús<¹6af–åUn7ØÓÇщ:g2kZn£&N›¨K‰©Ì²ã;f溶ðò»]×ðT²pÝž¾œtæ}'R›3UŸSÉŒÁ4òHsódF±·gé"í:ªxD÷là÷‡Î:6NTðêóãeê #ÈÈÎzÊp¦ëÁãà;vRëæ6tÞô9ãDŸ#15I;lÔÉ“«·jNÛ†‹ìC‹Òé ÙêÛÓ»âçý,æe@ä6x[åêà,q•;û­oK×ÊÏvΓßg>ië›”ù#Q÷Ð-—©¨ƒ_BÌEŽà-RõÅ–ÆÎß¿;âãçÊí°ùELY™Š1±1™nf u î¥ë„ÚÑ;üç(!Îi-viÊ´9/»bb‘pÜ,vŠzª|pò±±¡ÿ˜>hŠ,ÕÉÆ‡_ˆÇhG»ãc[c+I¯–þ^£ÎÏÔöþbuÈÆlYøQkz„Œ§ º‡Ë-›ˆnéòÒõBvSúGùŠÔãl¸u]:-KP”©ÓðtÛŽÈí ³?§³vÚŸÎÊ™ÐûîÕ<§æ-.!!àãá7¦¦ûRffeÝ#o‚¥êY½÷Hr¯{™úÇ3béyzt0bæ³GBÎÒ#ð–^"Ö 6mÙSn¬Eó¹^uMO'!#ˆGÂÉÄK©;on†Zši,o}ñPqsîD“Íkå¬ídÇW*ŠÞ©s´)n¾§‡¹6¬›¼L4h;L7 ‘2À9!ïÃÇuÙ´Z§‰ä–Ä» Äku¬Š|ü5¿Š§Èps'L3"3Tøªü‘×ôók‰—Ç>kÔøéòC‹­io¾+¤Ž<â§Ç²ùÆCVÒÏüÔcÚ%|àTð«åKM+ÅïppõöŠ7yiãO(ªs{ü‹ ]gÈÈ͘_î°qå›wåÙcþ5juÚÍÝÎ5ßó'¬:Üz zt&öÎÖ$áòˆ‡œ×IÒç¶û{9æµÞ/:óÉûǘ2òq_cãéöÃĨÈÜ G×I×îUÌqˆ²•ÃXL×¹÷T9³ùf’ѯ’¶Ì“ƒ“ɘ,åsê®K¶vGÕ‚+Fµ÷,B|º¦å\ùh}ŒH6ù Rá—Þû¿¤$\S´+§bÛÀƒï^¦OÐq˜ÉÅ`>±ÂA‰ÖÉ—Óo% Ãka…c üàÓ£2ÉõòæØ)RLc$*ÆYèˆ6£™ü3÷i䪾…Ÿ% ’Q'cè{ëœÜ¢#?Ai•Ár ²fŽ=Y5Y8Gü<8¾Z%+‡’i–I1ÆÕ|¶8@~D é½ KË÷}¤øƒx„ í9ôÞ¥­N Žühñb–!²Xtµì ¥Ë“i«–oÀ‘¡Ä`%þsI^Öb?¥Ë“uE$lävQ2cå>ø°ÁÎÏký)¢žJ¬Á#®,Á¤1ád>ã)÷íEG¢†¢ð'"÷œ•LIv^¨Þñ”|1ã®ÅòÔ¤…”3(ËÈCÃoGPÖ[…m×*ïð\¤€–ËAÈùñ.ìÝ@û¶ÛýÜ#ÖøèVP$Ú§Ý㤺Ћe{¦™£ÅðŠ‹b^-™zž_ÕÓ4áîøÃÚ’ÜoäÇW%‰\u‡Ã$Ä€ïŠáÚ>³yMEϧ¡A·€Unì—´çíaáHÜ]!sXìâ˜õvŽd^,„[ÛŠ·ñ’+ŸWÛ[ìå˲ˆ†eÓ5¥\c˜sqæHøãwh–aœ†GR/·ßÁ\÷×8Ìá½ëyò䫬0ŒYs'Ž,8nÌä$„Œh<"çÀ+zg,ÕÛ‰‹Ë²»G:z€ ZoE`w‹Û®ƒ ì7[à I<—2C„ï,Š|â‹–¾F£dGÙϧãKïÀñ)[õÚÖ¦L´æäîRž.Æ]¢ÿv#~j¹2ÓÛr„Å‹1·¬°—Šþ2¤dËR>é;¾„¹ÇÓ;¿­$r¿Þ§$°øi“-Cܯ"v­2E’';¦yšf.׎ÔÉéôkOÜg(Í)–L¼Ù›æ ‰ª¾ÊÃñS&#^^ât‰§Ö³g„z˜Î#HGÔˆGzJz5¤î"2œzü±â ØÂ!öŒcˆü4Êb5Oqœ\I‡®câc·¬˜øå%ojfgj¹\F§ÿ¹’ C`ê|õ²8$—$ÒKpˆS0Äjäw%ÍÑ9š)0%uÚÙÙrI“8ð¤eV1LÄñie÷MÌí’Ë©eì!ó²Éà |7®$Ë_»¬ç9¥|y!‹Už{³d,0(oTŒx¬ÄxÚ·6–¥ëôå­òg6ixËû×Y1î8q1ž,<5¾ÏH†íu”K¯¢ fØpa”’v¶•¢'ërH$øOÇWÙ´žäL=¬ZQ“g¹éÃÞó¤ð<Ä· òù(ƒþÞ;fè…ýç(ûÖ¢÷êO™«Q[:NvSŒ¬\#cq¬kD³ŸÊ‡Û|Sãªa1/i¯¼j2K­eÒeþD mohŸL­‰7•œ*è&Ä@TQù*,£ÉEËÀöª„/³fÁôŽÊ…#:%žb}%¶âUsî›Qƒ3Ÿ´¸ B#2‰¼8°ZÏoÚší뇘¿j‡ôÊ5Ï«‡NÎQD[0uWW3~é~.Éxº …éƒ'TXXlT (@´@¢(€ ( € ( ¢¢ù‘óJ”aþÐÈâ? „%ð…c~NQnN“•«Œ©¦I‰ vJrªŽÑÞRU»vv>¿Ã\v¹¿£· päe×pHR'8Ó¤®@bWSºCé¬cj‚ï½}s|î7Sîêæ1±‰âw¸² mÛZ¿tf\k\ZL…8Sdܽ‚hºm'ªI@<_Žº¹á%ƒ êê…Oc˘ͱ†õéHIàúÌœæ\jºÌXø™pa †!!X#xãP 7.ÚÀuí®½}YåÇ~ÌL¬ù¼Û̺\hùZÆ,Ï ,˜±#~ȤM‚¯fšë9_ǽ·Ì“9Å0v<:^£C TLˆ]”oµÝÅüø}3+;vÝvñÚbÆž‰ÞÖ·ªÎaƒ@‚BƒŠI)ãU,¾³¯V׆·íš¦Ï?åÅ*C‘¡ÚWõ#‹?³{+"ÆM[ÓcìêÃ3¼ý;#jZ6¥ˆ’ yTž«¤µºöŽšöʰhÉ¢ëØ­“¥dvËx˜–2wC´_¯ufÇIr’¨€ (@PàÄ‚u\oòQT¤Ôµ?QÁ÷̲’áâ{‹B«éÙH?t›Dë1]¾‰"¸íœºI0µé‹”4Üa–¼=˜2§Ñ¹$/V»G5½¢NF€[Ñ[õë?åü5þ.]©kºfž8rf^Ô ˜°YŸëÃË[c1QÕ9ßPÈ'}Ö6Ø©¥+_­­‚‰k3“uœöí³[Ü m¤¸¼Íâ^-0¼®G/i:Zßfµ›&K4‡ËÑä«i„™aí’jepN#}µ˜¢¨ÈmµT¬…Et~âÒüͨ¾ÏG‹túR§à®}¼ýÎÌžÆö[Î*u{µØˆ®®b€7«[½ð§íAú婟Yû¦Ü8÷&ØsF=%ÿVÕëêååîáÖtœmU38Š|v%YlÄqoV[ö«ÛÕ7oð6þ>Öã9lcaG…¦{¬lYc‰Ço$‚IøMnkpãù_‘{»6ÞúeRîÈß÷³ò«=\3ßì‘Öùc?3Y÷Ìyc‘RîÇÒ“fÁÒ:vTÛKœ¾Oåþ6ý›Íµ¸¾wÙË9=$4Dׯë]œ>§UÆÈêór1ùã8Ø„ËYqò¡ÆÎ/âe¼ûOJ÷k˻޸º ½@PDjZ®zêði:rc¬íŒùÙYyœ}ŒP#öbÉVvfð€ÚœþxŸ '1é²¼ðeÏ‘"gl>à ¡ï"½ÕhÝWCMæŸÞZÃ`cሢHašFÉbÉáž!(hñŠÝã[ð³õº* ýGVO›9a’EÔ29càáŽW§$5ŽàhýåŠuoÝHZLÅ€äÌ]bŽö^Õ¯è—ùƒ¦Ô¸\Í•¨¦š"ÌÇÏhšt‡'XOd¦Åø˜pðßfý´fƒ‰ÿ˜Ìü¼eÓcÅwY'uB±ß‰‡›lÛXÿ/á»ö.I¦r^«›is›Ü`m¼'Ò”ý^-tà v— éz`þ©íO­þ”‡ëÞJep‘ƒéŠ.iB_mƒÑP¥«îÙV/³!Q—Nî/¬ë}X×ÃéIÿã\ûx]>çHæOÎcùÅNŸv»=‘®ØsTCs–‘¬ò®¥¦ãmÉ–0ð'Òx˜H«õ¸mR¥yûNÏŸLÕ"ÊTþ³‡!A%ÔÜ]]ox¯N›cÕçÚfad—šô †24Y˜Ò´ã(²å¢‹.ÂÃbø&ºùÇžõ_£gœôŒ=?"^\†u>ïBcn&^ÆåÙmâ©·dÂN«Æœ£¬Á¦¶LSH"íû"’±`—‰øŠ±PÄREíS¯i‡^Ýo¢Ëû÷æwM^?rÂ3\±^Õ,Š—–Þ•«¦f{­ió²Ë¹8¹Y°åeÏ2ÑÀ_‹oë[i;ú+Ÿm˜tëŸÙ¥Ýˆ'Ÿtpé%>A í®[q^Í€®¢€ mòqcWi&|\eGâkÜô ¦%ÌÅŠH£’@aÅÚx€ð‹Ðkj4YÓcfG<øyØêˊʳ’ÜHÁÖD‘ÀÙ”íÛA©ƒÊNVDaå“eÛðHf—1ÕåšBW׺ pØ ¹fè9YºÖvN.G½ãcL’pìÆH!»{”á¹=5 ÙÕ´É3äÓ$XÆŸk‚ ãXÕ×€[q<{êʨAÊ9k¯ûò QÅ© EõoLgö\68Váá1ŸVüVáù·¤©„¶‹¦dãË›¨j’꺌—£$¤PFHƒ2lxv›X“QjRˆåýìØê¸†Ã‰PÇxØwVgÝfìþª1ð›Ö«$â¢Ú©a ÊÒûm@ ÔZ[Ð(¿EX22:·p‰|­vSÑ:|,çä®]¼.œº2zøÞ'ó­:}×± ]\ËTAOï'DѲtµÍŸÍíãC•ÀR¥[au±;ºkZÛ–7ŽnÚ’NÈ8}–qòÖòçƒ-ËZa‰•‰îm¹P|ܯæ4ò\ ~NË›&(#Ê„4α«2°»/kî½\¬Ž¯È½ÛãòÆD™ÙYC;Ueh’DB‘D‡ÖìÃ]‹6âÇ¢¹í¾}#®ºás¬( (#²¹wHÊšI¦…Œ“e!ÚÍp«»æÔÈj>VÒ¢[CÚÄ¡™€WÝŰÕr2ÅåÜlLYñ±§•#Ÿ³°,l¢"¯¢ÀXÚÛ*d5&œÂP5|€’qÙ.À=ÿ8í¶Î¡ÐehºÌª!—iŠTv±ÍrIXZë‡mú<4QŸÌc°Š|ȤƎhÙÖ5{8 ­Ê“n;/{ôÛe_Dg?þJ¹Fxc†[v‘ˆËœø£`8—o˜ílÊŠwMuµ9°*bIÜ£egº*Ü›#Óé¶áDIPrîõÛûbÕù¯òÖgÜé~Õõ¦EHTÐ5Pµ·­E(¤£>šŠëÂ'Ýëò[çc%ü’åÝìºr¾s&ü_ŸÉ§Oºö!««‘h ”EZ+œÿþ ˜üÍMyg~릺aÌ^(…éª{¶ô¿û®ýD_¬iØúmã5ÅÔœTèô z€¢‹Ñl¢ ÑK@Q«½sý¹þ~ÂÖ'Ý]/Û‹ÖØ4?Ž‹Ï-P_ÁD÷-ê)Òô+!Aë¢aØ{„OìýrO¥< eüµÇµ­>ê¼ó/ü¯×þM:½ÚìB×g"ÐzÖ©‘£æj“¯xq4½˜ØY†Å[þS*Z8&¹ÏÜÙ«³ûÖ{Ç0uÄ*B„n°µÍºÉ®ºéŽ\¶Ùºö°»²K{J§äªÎ/3êÃah˜u”üUÁžN¯6gZ([ÅÄ>Za2uy¾[ޱÒ¾žLrKÅŸÏLÿfC\¼k·”mÃÞÏ!K¿>Xoþ÷ao*†¦)åñw…Ȳîâ‚z¼mEEÌnÁÍ<­5»kú€ÉˆŒŠ’ªB œYÅàȆo r£ý’j¡ñÇr<ôRoR2o[±wÏΫëûŒÞÇ+öi:Ú»7ñûð×Õ€ÈÒð¥[ú\h’ìàTðO7Få.oÓ9ŸO|œ5h2 !r𤠼dú¦ãc+t5bÆÓtW$ïTߘÀ=>ÂV'Ý[¿lSklÿP@·6ªB²йVW¨lñôÐvîâRܳ¨¿CfØ}X—ð×ÞZëæ­ÜÉ»ÆÿɧWºö!vr-ÐW;Çÿë_¡_Ö¥J›póÉ"÷øzrÅÇ¢Ýu‹ÂÅוGõ4ñWÆü¼y1Ú°Õ絉ßRêžE°µKªùz SÂryÜ^âÆ“HyÒñ7I¸«ì×ÉX<¿¯?_)󊹿RoZï¥ioëá@ßð×ðV§nÿZ³°Ãòæ‚ûð"Ïùˆ­ÿ³Ù=ɹ¶å-‰¶1OfG-_öûg»¤ík¿$è§Ô|„ñ8?iMnþgèÖ½°Ëò.ƒ2e꺡óZÿôö÷Žšî¯ëz4ÚNJDÒ c•xâ \bëïü_ÊÚÛôt¼z4xöשž] ¹I¤Ù—±¾ ™ •‘8~ Ö7t×—h®nŽEÞ™þòŸd}„¬Îk{}±NªçNÚ( ÑTj ¢”UÀ[ì¨2Ó¸Õ·&d7ÒÏ—gŠ4®¼·×î´ó/«ã0«Õîv!+³‘h ïx¿àMoô úÄ©Snw6¯F\nÃÑ#Á¾³· …Û•¿c[WÄü¿MØíá> q¢•œQRÔ‘œúZÿ% ^š4S²™ oôðTöªU«Jû+;:k²¡Ï„ûÆþÏñ…}?ùSÓkû=:ÜÅ_§Á_SÙ§CîD_šóÑÀŽT©¿šGi®NŽ?ÞƒyߦÂßÅZμֶâ*7òÖ˜‚û(´lÝS /¾ªõP ŠªR-(4#¾w$ä@Nã™9Å÷–ºýÖ>dõ1½§ó u{¯b»9–ˆZ ÷xƒû‰®ÓÖ-J›pó¹øëÐåX·©knŸauåSýQG‚¾'åýìöp°:kŒ¥¸;)8KŒ‹ì먙-X´ žÁzj{6RM2 ´L ™\ U©@SÙ¨¨s×íxKýã×Ñÿ—ÆÏW_ Ç‚¾¥k—Fî<_™µêÀóÌ•ÝuåÙ«›n7Þsßš%èá¿Äg^k{q;ֲȽõP(; P_}¨Œ†óSÙK~ª¡E¨2îdÝþ!ëÈÉ#ÿPן³—N¿t÷2~oÚ0«Õîv!+³ Z ÿx_àMsþ›ÿ‘jTÛ‡ˆÜ~:ôW+ìF„Ölô"çÊ¿²/M|_ÌŸÝϵ`Ù\cÁµõpÁoL.KÑQrZ‹’Ô­Í…BRûêáe.Úζ˜%À]ôönr¦óåý÷Á }ºú_ò¾Ý¿w«Yè¬ô×Óâ5'¸À¿«7V†e¬ïÃzáØë›£‹w÷朑U˜|uy­ïÄUÉÙZ¬ûi :þ*–€uÕ!nÂjx-o½|5Êë´öYÒ}r±[tŠ|µ›Ÿ¢üUâ;˜¹©ð³ãRßf¾%'Ÿlu<@:1üîkëÿÌŸ×oÝ»0¬Úíp,+è$ç.ÜRÿiëg¤c@>Mgw]yuÑ¿Ë\ÛpÞð <Õ›í¿ë³­å¾Î'쮃[¬šˆ(¥«AãÝD*勤·ª2gŽƒ wÔW¤û®w{¡Ûq…Ï”Êæ¼ýœºuð‘æOÌã{mök]\ÔìA×g!@P-QPï—´,½&MB|_PDžö¥I7 ÊG–šÜV6ÕÍ–´†ÜŽžËŸ–õÕŒnTÁù³Ì¿Áo’™Lzš~R]¼goÒAò¹ZmùS,z¹5º ²þ™ôJa¹gU_TDþöóW&)¦Ðu…³ßÙeo–™k>†NÔ£õ±eêR|שìÎM4s'¯§€«8«Ù‡ßm¨Kê=â×ë©bLå—X|§Œ®NBú²°:ÎÝZý™:ºŽjFfðV/FŸC7>‡“]ÕStÇËYÿSBíZy¹¹9“ rÉ TÀ€+·WTÒcSc"·ŸFd¹u.â‡õÝtôvâÿ]ëºiË­.ñ\Ý'ŸMù«7ÛÖ5gOv÷öý•ðMmÎ µ·4ݵBÐ( ÔRÞ‰ z¹0Ívíè·šƒÓ=ÛÅÙr‚ŸýUoá1o–¼ÝœºéÃw˜ÿ1úCök]\§b »9@´E=ÿ†äý<^sVr›pçÕÏ‚P*D/Mþ:⩑娥¹AÄÝdŠ.4Q?¯?´ ùÅ }7N_#â@<ÕS@ÒþX/…Y—Ìi•Á–å(îíSÄ÷óƒRÔ’nTÄ>®D«ã ß «“_”þï,x8ÓðeL7*êÕšþŸ5\§©ý+¹—UÌ8¸QÀÒ*—g’`Š/´_§ª³i3—cä.J•t¹b’a“¨å²¾dèAÀHã¾Þ¹Úwšçn]u× BúÃÇQ\ž<Ï›í¿ë±§þºoíû «¥`µ }•}ÂÞ¤‡mW?†¨Ã#'²2dB›ÙºOPëñRµýGXÈ0é±àO^YÀIüef½ÈhS‘¹yY¸˜iøåšÖ¹( Ù^Mùz4àÿ1þÏéÙ­urÏb »¹  ÔÕõ8t­'3SxâÃ…¦1ßÖ#Õ[þSXRÑÁ5ž~æÝ]ŸÞõLw`ã© Øú .mÖMuðÕڣS_ÖþÑiTü•¦sêy9ŸUÒìœxRÞb(°òófPõ±£cù,ÃðÕ‘'6§ó˜Œ=—Îg ^O§5iÇÖŽeðÙO˜ÕÂSÉÌz;o•ÓÚFù/Ië¬éM»21~‚JùÀ¨™?V,Ÿ›ÈüN§å©†½ÄlÚ<BÀî5Ü´ªMŸŽ€¿ú©S%µUžïöÖIêÅo¶µ¸kW@¬:=uñŠÎfüË›×Æßm«:ë}žß²Ó÷¥Oã¢Á¾ôA{ P«´\î¨4µoIƒµÉkÈßšÇ_]ÏÈ<5xŒL-_š2†^{˜4ä?v‹±@êAÒzÚ˜L®˜Øø˜X}†:â@l£¤Ûy=t²ådìùWDKX®ŸŠðö+^M¹wÓ†Çû,?¤þI®\³Ø‚®ÎB€è ¯w‡þÖÿ@?X´©xy嫾lY´^CÍÔôèóŽdxË0&(Ù ’ ÛˆV×ꮓ«1ÃnÛ.wi¬­ÌYxÒøhŸ#RõŸ?èÒ—9¥/àmû¹–çø\4øêÎùô@I‘JñJ¦9c%]Y”à×:í,§ 9ã&,ï z²ˆ”ø˜ V¦µ·×êiÁŽâE(zœóÔ‘fñ€hÉôXà4œBð¯P©xi’ÝMÕ˜x‰j¤§—79¡“*ÔíøjE¾§“ZÕÒÖËûVo8¦SëÌÚºüøÜ~Tcäµòs^xõà‰úíÄ¿)¦& ØNn?oO Ÿ„Säæ¼n8eO yˆ§ˆµò9rÎ6¯7¾f{˜šÎ'™P±plXvó²±´¸]/«¬ He`]H*AÜA5ÍÕ”cïÆ(<ÿÎûÉ›íþѬiÃ}“×øC_ðVØbOÁVP^ BÕLvÖßдD0sN>˜ Z|ó¹>l}Eíæ©W(Ý—2³§ýé­³;HC,-ë0èâ5|dek2¤h-dD°U¢®GSîǺ<`C®s$mŽm&&žn²dêòt¤G«{x·òß³7®™w€ªª€@°l ó»ÈŠæ/Øâý(û&ºurÇgîâJôîñO÷Zýþ±(›póÉÚ<›+ÑkŽ[–³pñ¹wJIæX™ñÙÐ6ˬWg=^ˆÚkÓ8y;=v©hõ6G(™P´€(x¬Ö ÚýY0 )‘’¤—·f®b㧇ÕéÛWÆaœ¹Lx"Mdiêä+dû°“y´à¿ŽÕÂLÜ=žX×.ŽÝÞò¿A Ê@±LüFÝ&÷_ŠºøGžvmõjËݦŠß›Ëʪæ7Ôð‹óTn¡Ý¤±c¼¸9æi#„ưlNþ­•›ÖÔîªn4dÍñ™&˜„Ž5ÞÌO†¹ã5è»b,wÍ­Öd=!&[ápÖ¯]qù§»RNPæˆïÅ¥Ê}‚öXÓÂå¹Ý­Gåéšž"qeáÏŽ—·‘²®ßÊ"Õœ†ÝÓ š—Æ‚t‹ÄPÅeŽ5Ufý“Òæè<:ÿ1®}ÏnÓú:fF¿…lø’¤‚HJíÁÈxvüÐ6øÅvËÉ 0iï 37iäx”7lôGfdG‹výýULÆÔ°òÎBc³ âY•£táknôÕvøªQ˹,_™ôßÒ7Øjå§Üõv_êë–¾Ëm®¯!H4ùѤ¸0Ê¡âx\:6ÐG ¥]kˆ%ì§Á^l½®¿ÜZÛO×O¼câ=sìövÒ:|_œ_®m¼ñÍ$`Ì·Ò58o³”IðV« G¤M­¼õQÍ‘4,®"Š=²JÛ¨ªf¥¬ê:þIÓ´´eÅ>¹õYÇÒsóWÁUš°hº&•ã´™L-$öÝàKîp%1àÈÊʇÈËÈq>f•˜øZœM‰•ádZÿ”¤ìe=W_,¸Z¼ò§?è˜úF>sÈ={+×®òÇ—³Lܬ°ó+K»S…I蓉ñ€­1á[Ðë:,ÂñjÎ7›LŸ)¢x×.æŒÌl¾`ÎÉÇq, áuÜÁ)#Á²¸{½zLkêêyPOŸ ¢=6d<±ÚJ¤lzª~soèß]ÞM¢*^_Ô–l׉ ÷|µDqñÅh uìãâÚ6ÆM€µújOEÉÔÀÕcÍÄ’ž :2½¶Ÿüm¶V"Ïq± Pl#ѾʹLú(:fÞoÇÙ¿Pßÿן¯—·oM]K+JÓò\¼Ð†“ˆ¿$#Š÷èW|‘ß41º{”S\XKc3 Ù×oÕ«óú1z0§?+sž•Cè¹ÑÍ ‰AÊ8”Þä `vÖu윺m=1…”w‹$ ?yhÙ8î¦Ã‰ý6*Ûá®ÿ&¿Wˆì=ærÔ–ã\ˆ‰èáGû-ZóŸV~*'ŸùoÝ&he–IŠ0ŽÉÔ–"ÂäìËKfu\¨œ±™Ÿ®àee7 1°ÛÂJßŶ¹ié^ŽÉ˜ë‘dẫ")AÜc‘[Ìk»Éu°éúTۮƉZú §å³l ¤“Ñè—…“ÕÄ£*âÕå¯tåØûÐõsÿÜŒ|V7uÖ:Rzëã®m¼çÌ"úÖY;ƒ ª+:pßg*Æ»ÌXºZðK˜ãîàwQ{nºÂµ£ê:öWï JF\s¸î,ÍŒt/†˜J¸C0DÀ‚(cH×p¢&9W”õîkÕF›£ÂÔÉË’â t'Ö‘€þ ¦–Ⱦµé¾HäM“´Ã‡§)—*[íF@;iØuÛÕAóPl=µåÛ{]õ× e¡@P>½c>8 A¶Hë®Ý^î]ˆy0pdüæ4/ãtÞÒröŠæþè©~˜ÙÓÌi€Äœ­¦ͼñxœ0øVù¯IM6vŽc"É! M€'zÔÏ©…}sdŽEìKq´›ôî±­d[4ܳ"¯þšµS1>ʃeâÁj ª¥ (Œƒ°ÜÄxEdf‘‡ 1`zhøè<+GÉ¿¼éØ“ßy“&? Z'ŒEäò#å_µÐ±=1!ˆü1•¦Ré’÷EÈ2\®ðþë*[#—|ª|q“Üg,9âÆÔ3qG†Qñª޵;6ú¥êËQû–Ô!ÛÌòÇmÁâ‘>8åù+S¿foKS7º¾ðäÇlßÐfc¶ÆŠI§@èñ#yêÞê“«3Ý>‰Ö?tÆ*M»a“f£¬îk>q|oÑÖy+•#å tþÔddÉ!Ÿ2u+HÀ ;xT Ö-ÍuÖa>ž°¨¯(÷…Í>ã­fáâ,ÛŽ9ôcºÃç5g^;~ä‰Êí3ŒýZîÏé¬ ë9?:CòVðåÊÐÄ6°`tTµeäïu¾tÏdÄ>ë¥@Ü9Ú£­Ñ7CçËc»péðãk‰êÔ™¯Lò×,蜵¤Ç¥høý†2mw;e•úd•÷³ŸÄ6WŸm­w×\%+*( € (!µïÚ öÎ+·W˱Ñ]X Z xî0Çô„àšÏ¸¥.Ù~P«¿L…•E÷ÕQn ÚŒÑ £*ÔÌK1²¨%PM)¸C{¼ÀqeRlzÀkÐd2áéžÜn>Js°‰°ž;õüv¨R­ê°oH="€¢’ˆ E*ïÿNª#˺ކ9·RÔå¶D²ŽÉO«‘EíÒÛ*iço®ÌXï¿”šÛŸ Çv½Õjã*çæ³árÔmfÉ]’dlSÿ7ešNŽ‹ØÛyk—¤tÝ3NÒôø4í710q—‚ xÅ•GÊNòNÒwךܻɆÍE@P.¼WÞq׈(Ä)"çÒÛ«Šåº<« àüÕ‚m Z ?]—]™ÈQá ŠÏ¹Z:,8ÌýäÃ{ž¿­`LÁ‰@úD> X2½Ðƒ ¯Ùfýý“A§¨fäGŸ¥àã2«å4’å9ŠbcÇw`K;"ƒA›ÌšŽ$ÐÆ±Å‘Úc¬ò¼f>ÚuŠŸH”HÊ¢ö]•FÆ_4@™X˜Â5ËX^6¸úĦ8¶8'j¤Žz‚ÒC,£Ö4¬J}4áß/åYHv`B±³¿hJl`¾Õúª`9¥j&¢¼ZsLÊ'vQ2* ׎>3~tô¼T¡Øµ .X£ž-RÐËš'i+Æ-wS*í_HmWe!gD·Ùoký%Ü|”æLaŒÊ¥œ'ú m,Çhܪj+GL×°3’7ÇÈYVG1”ôx—Ó(Ž2U‘ÊîÞ+3l­ÖÄ éðæ­2óN½"®­–Ìlí'Ä)¤þ­ö}ΉÝwsSk}޹ÌÑ<)³áéÍt—(o'ÎH@ÞÞ¿;öatËÐÇQ¤Q"Å j(EU ª6y­z$Áh € ( € æÍQÇ‚FÃ991¿È—ãXÈ$‹Ž‹×N»êçÙ÷\Y´l´ä› 'B¸½¬öÀ‚¡Øì ËÅo­ù3!Ÿü›6™¿x¹LHLÙS²B­{*+°ÚXmðUò¬øÓg‰v:²Ûé)zÖ@â–ˆ[Ð-ñ¾¶†>”HǬ¨üœ\n„á?Ì¿dŠ[Õ–Qõø¾Ðj³È¿£‘qÔè§ìðÐ/`&ð%ùZƒ \¨chÐqX3‡â\³„ËÔ0q œ¬ˆàí£Ú^¥«‚èiÓ0Xsqäf6UY£$“ÐïC¤ôc“ÀöM‡wƒû‘£þ…Ã#W’½õa ( € ( € ( € ( € ( æ ^&ë jL|y?9 oí*Ÿ8«š`Ãi:c^øÈ/ôn¾b+^wêÏŒ2Úšw+§‰ÉûW«òìŸ4ü¹Œ}Iä_h+³Zùj|f[–åù¹*}¤#ÌM_›ôOŒËòþ ¾©üLGœV§lO i´}MvööYOËVvjžËag'­ ðð“æ«å>©Še®»=Dç­#ëÐh#gÎXµI¢xZflIß5$qK <6$/hX\ö®šÏF”郑2dç‹5š8âqÆã‚>3*» ‚êGX5ÎV¬Hi™Sͤȼ0qþšðâBãÅ“(Sª\ɲ%ASüÉô7ÈL˜8`°„ÁB'Dœ3«œB°RAŽF„´€— LùS(Í™;2P€ÊÕâ•™:Ãì £Ç1*>©£óC:[F 5ᔂ ˆHA¤o_@œ âo •#f*à”BÜ&ÄàÂD&øQ"…g¾þAH@ €ƒŠü R,3˜?“]cC¤¤Œ¿@e¦±§Š8`àˆ#`¦œ/ %P€À $&X 2"€‰¤2dÀ€€LÿIÔ ž"âF **öòEâÔIp§XËD–,™ìÿ…Ð8Ì¡XSlñG[¤‘Æ &˜›døQ…€aŠ}Àžg'ˆ0ž 1ƒ þ ñágì•¢g%SL@œÆ‚Í)$`´0 ŸZ#@"‡JǨox°M!ºð D`P¢@èBHd€á!¯G—›òS` kX{¤DbëY!pP•D&€ÀƒÒ€¾-Ôá ¬‘䀇3œ|MCúðÐW<äs8k¶ÊØ3šÂ¨é;€Uq™È4€=ƒ@p ô¡Jê † kÀë.ö lÞHKÛ–ÿL€xpƒþp7¸aUHƒ†«14`²+Mm—ËÜæ:÷¹Mò§þ UèZ7"àÈC4‚2O1sèAD@J'=€5UÈL¿ëBºØ@\ì”±ÔA aÑ ô ÌA Ž[`€`+°ÇP¬; P ¬ÉjkDN¡+­²dlƒØíª°ÅcÈ$›îEˆ`u£ß±„E,c‰ƒ­â, ¨Û‘ ¦‚x†, B«ˆ‚ðE& r‚Ĩ /ÁxV †°§˜1Å%ÄP2a´2!/B<‘ ( ¶™Iþ°…©(hAdfMÎЂ4ÿ$P•gHP…t† Jð£ÄDHð üâ*8äì1ÂxÐ"†ñ%j'!EˆQŒbƒÈàÅ)¹<›4”A Ž¨GMj¾Êaq~ýkÖ°/ôAm¬Ä³Lä㙈 %XÁ D¸`HA¨¢`CD`*CÈ|Ø£ôp1T(À1ÈlšÓ q@píƒ<‹ >îAWe’`S™Ê¦6/G€‘ï|G˜ 䨀’D §8@Ú{àˆ4-2Ø>È ` 0 †"T F7§ÎÁæY²Ë¡´*©Õþ iÒ°Æzÿl@\n@ù 0ÆeOIW h¡D ú8&áÚŒËS€5=U@. äP…;åÌ¥`—?(pŠRYÝ1= [¤‘ gøš¹€?fÎ¥`S0ÀóHGö™ÉJ €Î‚ Üq"wÐ ¢€Ç@Ð1¤ÐšŸ6WÙ4€Ê‰;—0°6 S1 ðVÙ` œ7ß´2À2ºrm#P€ƒ¸¥.B&È@—(6§(oCpö&­•#E·Yòra©ê8UAÌP†Lù£m*k€~Ÿî°  ùîbU«A¿Ïè8 ÕEʲ­ì£÷™ô6ÿ* 2èO?÷(Ñ=p6Ä—)ê‘}ànRø ‡ †ä;tˆ "@ž!G0$â}hC§ð$Š"üTV’q@pÜq5`s§F™RPå^§@ &H ‰@ Þ4 ˆp‘ð‚/ 2 ŽÐŒÐ‹ƒ7¸ b pue”]U´®6ìÒAÒ ËPyà`u>7@q10ÝFãgoÌe Þ#13¢ìÇ=Ž@PÀQ¦¢>¿6梄ÐÐ Î úQxMB ¶wIZSp@¨`p°=²×ÇWFN2Eàñx} Ýÿ` ÕF© P*F~x˜9p‰Ä~PªÔ•à}ᔀ9ñxˆ˜N| b$ ¡$»¨£Q'QÁ#Ãd PDáx@‡8×,£A ðbDÑw‘`~™ý ñÔôðçÝÃa T ’ðGS‹±@ `$8´Xá 4`¤ }¤ÿ€(M5ˆ'…ÿA A0B@m† cDF2æB•% ° š  ÒôÌ$ š@‘¨ð9 dÄ4°Ô‘Z8U€UzB¡á àx¨3sábêSµÈ‡ÍÀ °@L’Q£ÿ¡{§ ss—¥‚‘5A c$U¥'¤0YPb%q\` ™DQUc{™|X à4]Å? ` !TÀ#ÑSà èÓŠ¬Á¬æ…PQ¦àe¶·0d™˜p € 0‘„UþÀ{ GrðTBu¡(ÿÐnPXn°ˆ•lù@и—¥%kɈÅZ¬!™ém ðÃ%wüƒ¥™®ùš°yHz›´IDXÅI0Ì,€#¤Šµ¹\Ú XpðA :pà`Áùœ²a À­¨8V©šûhŠÒâ\¿HðSb ÿ Up2(ePbcdàÞ²”ôp ¶÷0v4d 7wFº—w0¹q V ´I_2±ú…p ûUbpà|@vDA3Ô6žôÀªG[U½WD@ §`F @Œÿ00¦À¢ áÑœp7¾à×¹—#æì©už&ÆkÀb!§À^Î8,2ñ&0g%âŽÖ@!’-Y‹av¹!ƒ0DàdÅÆ", u0ZuP© à ´€ að  :(†?áxË&^¹-UgžÁÐ;–Yÿ ŒgàDd%€.€fBÚ š{TV0 É€ <·—?Guqá~NЙ3A!S÷&NÆBSpS$.à+ .à(eR^)ÿéf…A:†&ƒP«)pKÁ Ì€@!üQ ÁIƒà@  2Ñzª§'6bfÀf@`°!¬A"QÊUp<¹ñ1ѬB!<{q¡A¥7673!¦}QbPp!ip­Y›¢Å¦u`fЦmúm `ðûbPp@VpdpKðv±ä'àCbcŸ*p)0hÿàU€˜ñ, ñ³c M79ùgEU0&0›zZVЩtq R«^à] i€Ð^PZ@& b+ú%ŸÃjgŸq•*?(ð¬'@Qz‘þg)À± ùHì mPq^µ®I~QgP%õ8›»¨ˆâ¢``2ácñ6ošË,^@ya“ó°*þ’Y/®¹&ʦœ‚µ ÷ å0°†€1à1SFÕÅ¡"ï³¹ž¡+³±)âÒ—è*y++1•8šÏe @X:¤#(…‚‚r(ÿ9Y`õYÔ8)ù )“`(¦`-¯%  20631G°ge¢sZˆ6qÂ7 `”! °¡r=÷sÆ § ’aZÿPVè,fà¸ÎÒYt'û6S¤6Š'.@7¢3îT-€6JA'@0ºàa .¢‡y)­i>ç¯ —›£/ô¤:ÿ@'°ç,ЂK£29‹2eSA0Z; àIFþ0#Ô%©»F'Ðq3¹!0øˆO…`Æ\¶›<5X³T`J\š*Y”öÀe“6V‡y*ÓvÃIv[ÿ¼†\r%Š!.Ð>ä¨M¬ A• +ð'â #EПóƒŒBUðœqñ]¬A ëHFŽ!z¥à6Ò  Ù`7ÛP/Ø[*´ø¿31¿ãr2¬p¬!¤@hãðÌšx¸›ã¹ ”I¢»ƒp`°O-å@Ãn‘6'ót]bÐA3±A2ÑcSÐrw6ËS9171‚v¯âÌ„£<¥ºØv ÐW;á8,,up^Y6`O ‡3®«ÌD)/Y´E.£ `'dƒ3 , Ð?x \PáN&£¢[á—xÿ8râÂÈç¼uP|¡Ò“•\ 0CÅùÀR˜º¹ŽæßYàÊϱyÖ4‡ëq†r Xm(×ÕúÄ45f0OâÀÈB%Œí.û0T»ã¾S1¡!€h r­) 9p+FÐrˆ{LC{>ÜX  Œ°­ƒŠÙƒ Ù‘]ÙŠƒ”mÙf­ŠÀ· ‘ú{`ƒL“úŠ*g2Òg&ØÒ²a§kÇCä^—y™ñ¨OÂl#y$™>›âp n 5ûž"Â/„³UXÕ(K!FŠêWÝ0P†ëm Ï32Cÿ¨6¤ÀR¡kTŸÔAÕàT6 ÀŸÿ ¨wgp)àp=Ьf 7 [´ þ½ ³••\[·­x«-æsß@] ¨íq# }Ô ¦6¹aS-­À Ñ/ÌC¬  Í ®à ²à9€ ¨0 ©ã©0P㯺 ­P[›# ܃°+C“Ð=#z¸·ÞjÓÞ¬ÑRæâIÛà ò(7·ásºø´Nò·…`˜DGÛ3àdäV®Ÿ(.å¾ Öà ÝP €ÔwedþÆT¾¬V|[•°áÙM ÑY–xÛÏÀG}J(ÿ'2‘aÀsHú »•Àщ@)QE®çÞX ¹ ààá}óàÆ `­i·:×%òЉ ˆ — 0 c¸Ó\š- áé3± ÖpèÑ`áÕÐ 3a%f'U: ÄK=÷J0Q tÌ<õ©VÂ4®c½BC•‹gÖiÀ=‰} •°=`TЫ>£Yh® ÝÐNè]Âé6˜Øå,lu'ñ¨G1—ÿpVÀBUS Ϻ}F°ã颧1’pcÜ àÓ{ÛÞ®Û¢étª³sèd7ìhVÿu æîùÁmÀ#¤/ `†z P@`â„4%zt,,4â¢qÐÓp¤k'â5„b$1Z` •@àâÔT.éo!Uv¢"ÎA69^åþÀñÔõ±Ý¶DôQ²+¤y'Pù‚Pú£€‰³4Škr§ñ&‡PÎÙ(•õ%qøG Ähg3p  ëÁ*åq@'-]:Jù~I.Öº9Q¶D$«çÛ…t^úAþà…QQ0´”«þº‚¸Ž¬Ÿ~™:<’³KTI)zŠ×&“Âó<õzäW«¥l SÒ Ð'ïÿ%0ð`ù2ïxØù.u|‘Œ1›0à]À…°aÛª¬a€ˆªu§Ð|ràø÷Ô?„ þ£ð@ÂBˆ%N¤XÑâEŒ5n”H!B § JsÅßI”þÎÔIéÏÂ@ÊàÁsÏœ”SÎì¬b³åO …%ZÔèQˆ ZT˜Á”[hÊÁ“ç8p꼩#&M‚ŽñÙ(ÀÏ–i þ<…Ôí[¸q#F@¹'Z†*øS•©Œ¤úD8Á>iΞ‡Ì¹‘%O¦Ø§e;nvÞý) ÜtR&]Ú´Q ðÓEPŸÓœ¦]ÛöÿmܹuïæÝÛ÷oàÁ…·½ hïãÄ•O0·l X^w8€Á!ƒºuðá)^Ðè`PŽÌìØ!ä¥xøð+Ç8ád•8)aÜrbƒê(p²ø¬«ÀŒ$¼NÂ,ˆA"£€©‰H) ’˰@¡0€Œ–þHCŒ*Nü%.Äè©H!`´0ÀàL–3üI…#D +êcI&ÃÀbŠ?à8 ?cŠHn! zR €€ 2¢àÌÞøc‹-Rñ§“tA†•!'š@8<胳A˜ÄÂ'›\òŒüÖHc‚ Ê”ÿÈx„اJ+µ”Ò}üèˆSêÖ0c“’YÆ묈30°À"Œ6}ÕIW—i?&舰þ‘ "À{.5öÒS„³JÐ\ò—…‚%Þ¹Å(Ãc†Y¦÷‹H£¥1ªhµV&½BÙ9|¡"˜À  % 4ÄHAà"”(XÁ’à‚¸` %XŒ Ðÿœ¢ÝK’0R.c%¨ HxSôÅv3ôG1’QŒѯ#?àCƒªð†6Œ +J‰HDl¬r' BIPÁ b3p øã‚ ©ŠT` +Á*w„˜ Õ"Š+~‚ŒdäB‡$  `€‡ð€D â£zÔ¡ SAõ6fœ@jh @pŠf1à*Á ‚MGXªÈN €°!m°¤äôR”aäb½è….r‘ŒdÄbŽ9E´c”Œ »Ä W¬‡œ…A'1Ãûz¥ 0j(@Æ2F”àlIøÀÙˆ€ºÿT!c ´æÙR Q„’ƒ`刀*8ˆž#J7€@¸b³DˆšÀ™¤Vü›U­Ä@Ìþ dRÓ^JÆÆBkŠ` iÌ ’@„"­ŒT8 6F„y&„#@ÛXpHqTrg›B3²€`ðqHñÂŒD`? ©ÃG´Ô!?8ÀD0  (Ø 7æ Ayá›?–Ú4´Y/FK ,òTÔuó”¾êƒG°€Œ^$¤`ªÃ 0ÀøC!`P·Â`_0Ä ä:ˆÈu$x½kØ:…-9€ °6“–øÃŒAA q„#˜ ÿ%"e4Ç5‘.TÊ)ùGúÜRĈ&¥çB6ð»?¼à\xÁîp‡=8 i íÒ°ÜÞ [øƒ(‚ž$ iCšB@¾… ˆLÁI–4³!ö¬ 8Ö=þÁɸ`Û-]i5‚‡Ï à˜q@ªÀŒ†El ¨0ˆPiD%ª›6¶b pÛ¦¨HqøƒH¤ÂE•ºE»iiiI‘·ŠP` {@ˆÎJHà¼U„€?ˆˆÔPVªR`å.rŠ WѾu)@„ë(°)|ë]…@8qgø BtüÒ% Åç @‡·&R®cÿñˆ«‹ØxÈUŒÀ) €(À9ÿx pc‹‡¨€?Ϊ7 €[žHâ` ÛƒR÷ÈG?ØH œÅU<)*p&Ùü÷$h#j“%‡„]D2à @` çQ6ôg'à@ °IÏ*¤f°ƒ)äQ©xT@ÖEˆ«hSPñ¸™ÏTT1>Á9 ­1#8@R\ \@$¼2ÀúËÀ V:l+@Û§Ðöµ€€§Ü»†³ôq)v0‰RÜ”]f 0`ÃhI¯GŒÒVQnvh’<àÌÞ{‰ÿ.@í:U`q8½Œ¿A"‡ÿc÷°=Þã``ÊTD@J¿¶á té¦(9ËD0‚?$! (ÀX+ë*úÙ ­).€|_ä=`çOñR`W" @é( 8Gäxòœb¥¸$Qxó\cWqÙ9J4þ€`Z'€)؈wC x‹C÷ À ÈÁ ³†Z< ;‡€ @‰!4§j@(€ 0ÂE¡8€è”(#ÅXFñèa¤" ˜ ,Qœ„P *PƒSP¼L [‹< ɳ°«€†m8‰e°Ã“x3›9¬"”8€$  ¶ X •S4 ˆ(äÀ˜»ˆhT°JóK!Ÿ™Á€ƒf‹AÕ;>Žœ:Ï©€µK1R¸)kØk¸÷3ªCˆ S-‰ˆ”, ½°9GáŠ9³1C € ‘hÀÄ p›b2ˆM{>d<=R@G h›è€€ÿà …)ë´iPqšæ2…°¨ÃZ€ ŒJ6¨4àƒP 8 ˜’½ ?RÙ¬¼5´Í2Hˆȵ)‹€¢Ü8 PŠ-€¤x:ø5ð•80bH€‡Ä²º<ŠHÇÄ ¿gSÊCÌWk°ÛTÀ=¯@`cч¼H)Ê©œe"60ª×Ù9@ƒbê´p¡‹ â“1ˆP3gÓ!¡‰a–è€Q  ÑʲK•…X»  Õ° Ãc “&[&1é 3¨< X/°¸€ÓŒ ÁôÝ#³¨ «ß €F`„FøÒ/]„BX.à‚;àÜÿܲ-6mÓ-ðƒ)ÐM7pC?·Ø¸ˆ‰9ËóJcÁ‡“øµAP 4ƒt:‰ #à—A8ŽÅ¡¹ x€(8(‹á4pã6m‹1)€¸2x´ ØÀ À»ËÂݸ=rœU>º‘e¼“ŸÈ¿Ë€2£{Ø,ø‰²‚‘*¸#LÜ8¼Á­Ñ²c€X€SpÊîq€ð™†„ÕÝH¨p Wq¥r-WrWp-×J0WJH„D€,9Є°—)P¼iC ø‚_Ky½pžÊß8X„GEEXˆ]„FpGxÿGS‹­ØGØXH°XHèXH@Ix™×Lˆ€ °€?“€µh©dD*:€ª*4&Ó˜)¨Éá8Q;J i€/¿Ú¼ ÕŸXˆfñž+[>D)$4 O 7`€.Ø4«àÒÚ˜€]s›ÕäV߈t-[³=Ûp ™ˆ­©kÄ©ƒ5 :yÛ8{¬†mÈ[hh€L…\½)<”ÂW¸N0x8´m\³…„…hÃý‡2û²³8•íÛ\Ï ‹:¼í†Éô‡B4°;>åñ „P) ‘õ{­V­¹Á ˆÙ•ˆ 0d@†`ކ܅%ÿXêðˆ‰A˜ã=^vu\HH“’€“Ðè°ŸðOvKWÛH¨†ÉÌÛ¢“¼6lÙ¿‚F¯=…àÛ—#¡pKœ:•”X†eH)T?@WJˆ„H€Cx„H˜J°_è­§œ;ˆ·´‡A \Ü8²ôi†h0@xÄ‹>Š;ñ+jÉÎýTO8e8…S€vW€O(aX FaZ°–…å€FWȈpXqM„€ˆòB”ܵŸ˜J˜Åh¨¼ ]’óKıݘF×G˜Üˆ G×àÖS`7´€”5‡™Ã)£W¼ÕkhÈ[˜:®[ÿ%†‹³(p`ˆØ¨G0X… ³¾mÉŸÉF;‰2Î[AÎ[Àâ Yãçx^„ˆ€×$öžˆãáž[kC´à\*Zà¼5Ihèdk¨, ­È€ FäÒheÜ.žT5pýƒ,”®ÂЈWe>ZM`édÊdm` ÉC96e¸h;(€¥Š;„Jh®MˆøVF +|H ÕæY€ÀÛA®2&âr¬€æÓȇI¡”D †°cž¤ˆøÖE(Š3!ÚŸˆ]¶Cg¨†Å0€ñ" Zc €Ká‡*šAM „oåRR°ã…¤„•g´ÐælÈ[gâÿr$Š9¿3B»‡H4YˆÞKˆu†ˆz ¨³JÙ˜€´  „½„x„‘І®WS¸éŸKÊtǼàGƈ•ü‡¼‘ÀèãSK9‹µ Rص…;²L€´T@؇°êÀcÓ €v¸Dd³ó‡ÙƒvõžI(Ùas€ñá”PQákhm®çÉŒàËË;é(“¿nÍ `ж‡1j_Ñ”FŒL Kñâ#€Hp=P¨(ƺHH¼ÈáÂØŠŸ~GzކŸx€¨ÖFé;¸(³ƒhº¼”T„ËëÄÁKŒØBbËãô†R˜4†˜å˜E`ëqd„Cøßp-e€{ƽ hœÚ¾e˜L¯Üj€x@>°éèO¯®ˆc©À‘`4kˆÈ›‡ZÅÌèÞÔ±ÐCŸìN(BMùk†/ÈG°0€î¬Ý‰(€>ˆÐÿ*Â4Ý;.2…s”{•;!ë–ï…x(ãzhTñmgYßNûš;м£Ž/šˆ½f˜ÓÖ‹¡+Ÿ• ÍÔ‹Ú…±¦ °×úX)4VÁÏÙ®í͵9 1º„ÄëbˆÑbÙ àiF ØkX†oH‰x˜žE¦EÖ€ ó]èˆøŽœþ‡èO-/å™B ð-€F¤Ð •J–…àÊ΂0²ü 3>UŒçÕøˆ#TX Sv§SY`÷NYˆ÷NЄy÷{ß„MX0‹0…˜Ö¹W–"… ‹ I»Ÿ8·}€˜ö¹;àIý´ÿo;<Á —âÌFç fT4_¼aÛ* î—JƒŸ€_)!}p‡w8·KÁhº@‹ÈƒšÐ‚|ñ"mÃ`€gL( IÏFdW˜€  ¾3zR «£GyrV šjO…YH€gS 锞3¯€èFˆL ¤V]!‡cé‡yX>ʃH…;pe…8Q8c=–5€×xå€PTiÕk4ä@€/€í*ŒÌ. œ €J‰*ù °;ØNçh€N©k“ªcœAæ¾WPÈ·FTˆ¸¶„˜–ó›¨8HƒK ;`8Pƒèèƒ`WÛæ’ÿ éðÞY:¯q'wº>æ¶áÿ6ls §¸#=5€ã µÝ·˜J)\Ò –šÀ9`ƒ®k‰A › ’H8Ab<×{²ƒ©ç¤¹>Ô î 8`nl1G|¤±G~œÒL¸j¸!‡zø!ˆ!Š8"‰%šx"Š)ª¸"‹-b;ntp-4.2.6p5/html/pic/hornraba.gif0000644000175000017500000002112610017034537015615 0ustar peterpeterGIF89aŒ´ÕÿßßÛ¹¹¹©©©^_ýýΘ˜˜ ž350 mëìëÐЪûéwxwøfggg¡õõ†† FFE±±‰‰cVVU l ˬª ÕÕ ÎÎÎ33 ††(¾ Q„s{V )kkN; 5 wwfDBm22œP!M’M'-)kegÿÿÿŒŒŒÇÆÇ÷÷÷ŒŒ”ZcZbZc‘”€½µÆ‡ =¿ÁÖÖÖ„JcÆB{ïœ)ŒµŒ”Δÿÿÿ!ÿ ADOBE:IR1.0Þí!ù?,Œ´ÿÀŸpH,ȤrÉl:ŸÐ¨tJ­Z¯Ø¬Öù2€Û°xLåär”ÜLn»ß¿ÒÀÑj¹Öð¼Þj@ä\u-3L92{‰z/€1MilŠ—bh-9/L8%˜D¨U 9¢Ž-«ºU-/¡J­90-»ÍQ~ɹÆu1ÎÜL3 °ÃKœ-9ÝìG½ }4K£9- ëíþB3D‹g Ç’ ¾p`k`€€þ¨Õ¨@€Œ J Èaa‹^Û ƒ!O@2z1+ —¦A0(¨£€CÈn(À€1ÃÀÄÿî<$"ÀÅr +t2€ã¦39òUp0³NQ?E Ð14;ë|jêtײ¢)à ‚•B@øü´ÑÀ UÁ-‹ª•€[>źp›ƒì> ØÐ@føîr1‡8uá ÚÑ¿0 P1p¶~’QáÈL2^€ˆ àós@¼Èë@RêUîA¨ ‡íѳ±qíêÀŒèúüÖüO'„‹·ýð©`ñ™ 5”03´¥é—‚§CM#U%òid¬‚€.u8ÐBʵ£4ÂŒ iÒˆW€ &Cñ—žµ€ƒ î!6² ¦ÿÀnúíç`zvœ€†ø4ƒ†pÁ}à‚ÅŒ˜%DóRú8CQ ¸0Ó'²Ù¨ˆ& ÝÑ2w”ÐB£½Ð–»‰c’—4—Ì îéäàÀÁ“”È0ðè—dt‹ª¼pÁ—æðáüà }ÂGp’1¦ˆCI Ñ•ÃÅ‹ ¨Q…†q×bìö_ 0 à óEfQ9 €P[¶¥qJ¦YpASÉ€”Щ~̸J€°VAü´?°Ba†\ o]â‘g4r°ëAÛˆ ÚΠJ²Oø±,/,aPåPÿÂßä@G¹RXÄ΂Pç«.QØà3\€  Áp[a ¡‘ƒRŒ¸Ab/”à^šèë„!¹@ABŒé@2-à‚gºB“ÔÙ(ö·9bqZQ0.pû°Žò2 CÀä„rl-œY˜ ¼¡ˆ3 ñ-¼ÐeÁÉ„..Á  .æl€]™™&Å Ãý«/3¾å…; ”0 y5@>+5 L³Ñ 1w•×(Fú±!—Œ{DoêÀà *ñ2´êðúÕ`kÅv k¸<Îã+<=¢“ù±"F£{Ag¤uô ÿÁ1X‹ØL#Z>-8Чha«•êQÂÖA2ˆ·„‘°”P¤õ1àå$0èÇ8S螆÷Œ¸ºÏ˰Nè}¤ù–¾•Š™%ˆcZZãCLþ% ÀEŠ4 iˆiÓ¹€®˜ƒ¨o|ä6B&´UËÀDLÖ$t/8ÀÍbð‰a07è€vÐà 3#`y7ÃÙÚ‘@6à•®|%4DYÖ x€šèžsƒ.’’U\ÇÌ‘Ž‚ÀÌ„ uðÇŽ`À¯d6©! 2ƒA¡.%°´ ¤ Àmü@šÅ=Ðå#;0dÅÍt&²~clÎòš²<¤¿¹<Ü`œ¸€Ô€ˆ’àŒ¦Eh_#â)ƒN èÀ~.ÏQnS“æò ÐÔLjÀ,»i@2ÿ›€60N~tèÈ0 ˆÀq#ºÜÀE50P#ÀgG?`ƒ€à(5‚È T:€A¶Ô€¨–7#uÎqœÐI~„xAb‚9Èå:ÀÉ £6Ø>ðØ•™MUAWÀ.XŠ6ÆS®¹‘\•–ˆ$Á¼)H  70¦. ²–]'0]Fö"àlFéŠW5ÜZGþ`ƒ \ܬ¨éO#\yØFrŠ­ê+ECÏŠÊSe} |JLà4%çB€‚ 0qPji?ð<ɉD0£:¡ì­¢³½mmºÒZ6`–iÕÿ #ëYãrö­î5(Bu)l@̬nx€‚ö*P Ô ‚ØY €* `)åŽ1"j¹RÂÖ¶Š-o67"SçB¶³ó *9šKÑÒ“èSE™OÐÕ(°‹©K]»2U@‡‰È 38¤as`á«æ ³Õ"³Ú@÷L,*Q zÜC–Àò[5@ÎÖxÆÍ¼cîØLºÒ8À3è›BˆÄ H–ú± dÅ9¹m©7{Èó6â(çÊ•£qSLh¢®U½¹t`#Ú¨`u•xÅI ãŒà„λϱ—­•Ô‘ÈÓöæ,ùmj$'™–~Vx'JC÷¶'QŒB´µTÀwT]Ç7é»^| H€‘=Boü ÙdmñJÛþ;¥~’!s{ÿ?àã'¬y…jK¾P×´½ >­«†¤çì-½GÜr¼PÎZhÅ´kiØÅR•ê^·z‘N‚àd';ØðñoÄÌÖ5ðF`¬¡dî†×PW!ƒ<‡ºªgìJ©Þ÷ÃÂr ÈÀ,ŸÆ“ýí8€ÒU@W2;³â!pO€5„ô€î„BÍœI˜ XÑb©Ø@f•±§Æ­aGê@*±¬O½ÒãŽø¤7"Øev±îãýõ $‚Iv4cÀ`Qs$Î+KÝR‘Ñ·-õ¯õ«&€xydxI‡xðná7JãcÛgy]ÖRùpNöVÿRÓl3 %uW*%KæPÙtMîÁrWUHû‡}怼g~ÿ÷$xÕTÁFWp~åw+ têe@@á#•ð?˜8ßâ4 p›Ç†¤HBöMÛ4HîxFFjè7`øq­‡tp—{#z€ùô+9‡€'Àeò&!?È]XÄ(Ò!``"ð°‡{X®/`‚‚ÔJjK¯…³Ô—xµ5 à‰ p zþ€Nf{@‰²wxÐ-…v8ðl2ÛA|ØŠÀ±EHKØg‡x^×Ta]Q…Œcÿ à4 ‰‡G‰ÛwB‘˜7´çLÿwžÈm3H×ao}„2Ñ7®èŠXa50Ù¤R¹Xgø—u½x‰‰©·†XŒ¼wŒÉÈø¥g‰X(Š«g~8´‘3EœÆ&PÝ芽`rN€KfHפR‡„@jÉ‹éØZX‰Z€h@Ϙz`©wqÿ7‰öÕ#Ðzj¸}Tñ!/5œÁ(â p| P^QS…u&xçuH@^)°ridXì(‰‘ø‘)‰œå‘Z؆k5ZH‰ PŒ213ƒñ¨(7‰“Pÿp6or/PŸ=@HÿGIjIi@‘XÁØŽŸ¸’ w'‰2…‘¸ n_'‰­7ŒŸBEÑ–.P–8©P>%Áç¹Ñ?à'x‘Z“ˆ} ˜†ƒ•ø $ipÕ†§…æW‰œ¨F5#ë!#”Ù °“ `€°™{€—u‘a˜z@%°•çqr:·*øuÈ8bMd@ç—z9ðŒˆ§žØR_ÁŠfY` @GÕ+”©x[8й•³@«{A8wQp{a¨tZ¹î‘1àÅYf¹‡/°ÿ à" q %“”Í9‰Z8€Ÿ'à}ÀD‰ùŽ-%Š[ÙRøuĘ)ziä¿É‡ P`™ÐîñT˜^Ì锓¨+0‰9pƒÛwkQù‰‡Uš-U‰çgyðv#ð1ú@5E37ݸ“aÕR>²u‘áé”h8Ï8ÈV«€ ‰ézÞ©¤²×2Ð@^Ô®¸Ái ŸŠÐ9 I›€©†@šp’ªGl¥Ù‘ðh…Ú§¢‘¨!ê "‡¹‡p£|(—¹½€Qž³ ~aø$†7Œ–§¦“˜¨Où•¦Ø‘˜g›h@êÿ4à ”@`èI£*ª5wUQt POW¥Ÿ+†‡×‘|™p’˜" \’“X¦Ñz¶É¦ÒªtÈ4 ‡0¡hÀ‡ZíY[jð*ŠPX©Øë("À,p•ˆz& Š:ŒmÕŠÉ‚YY‰•8‰‘ú KîÚŠ   ¡ÁŠVæp® pRŠ0¤è—†°ç^YDõ^ÅYà'[T5˜«Y¤gH‰·iƒW5®0£{¸]Q„vrXê"±z´Ðð—q§†‡·ZÉ¡­w'€…p;5‹šÃ+p Ƥ¯,€ših¨ pUÿž˜,À³4*êTC=±j¢4@¦–È} ëª@›ª†'à\–—&°&€+௩®jÊx›zÂé‡á¶]q™4p¹Ë£y s­çpLj…ÓÙ‘:Ç‘²—ô$­‡š¸Ñú¨-5¬+ªP!ÄsË òÓLÔ¹Þɉ [Œ¾‡}˜˜´‰t @z¨ û´w»³ê®>vUØ˜Ñ ËŠ•w‹‘ÑZ „ZyHI»° Qpx秺[øu1¦ºJçºÁY q;Íà` »ˆ9®L›-u’໚ÆYh½{Œljx‘xjË®–¹ÿgsB21YÅp|Šp ¾ÓÙŽœèŽîñ{‘8ÀNz·v¬‹×¿ÎyX'¹5Š“`£{UÂ&úð~À²©G•Zh¤­ª¤p'­ OùV9×½æ×¿iy"ð éê®#ë1BDÄ uJÄ“¨˜”¨½Üžü€°‘œÈD8'І·ªÁ;qgfID¬¢2½ „Ra?À9 ¹p€Å2ˉªúÅJ;®03°¦œDGPÆ¢jè¤_ǦK€“%¿î‰(j0Ab¿HÀÇdð €¾Oi¯*¾ÇH$yy]&ö©çq¸©¾ä¼òû¸{œÿ«"0¿äb9¸]vlþX‰ ªœ¼6+É2 ¤Èx `\h¸‚Çx—‹H: —7ièz– `@"ÁÖR/¯³Ç± aÑ yUm€€Å—÷ÃY©aš¼Ÿ¸¬©ÁCªŸÚ©ÆAp“—9ι“/p§¼LV–R?÷A Ž„k¢Î±*$Ñ!8@'¹xQê»ìÏ‘ˆ0¤kÿ‡ÍØ· ‹x%à® ¡%ÀËÌžúº@ ¬!~@§ˆE?st8|_FÀñØzDÊN‰7à‰æGÏXŒj<ããq °“ j ZÿR#¡P缋zÒ!€ci°C3QtÒ`­¡‹—p¿'ÕÂY¬Ç‰&Ú‹H¬õ¬Ë”¯h"PœDªb)ƒ ¡³]/ó9u;thÁ@ˆÁZ`„y×O’Õ´ŠÒ‘x°•Ý*‰¼G›F–p™sÓœ"`R!¹ÔH7Î@ü€C9R$@óZ_ªÝRÄøŽ!i‰žØ‰‘(Y¸†¨l€}U[Y7œ²2 Â*Åd+ ½Ðâc @©d%_5?Ø Ãéë½ ûŽ Ë4˜¤Cü¹ ˾‘ Å˜z@œ1<ª"p ;yXöA“ë<ÿ/v7!X“M¦ºwû~ù¹Ÿ€•7†šBú‰y{­½7¨Úû(Ðd>†69&¹ d-žà`ÃŒâÀ.E0~5 4!M’Né{Òz²'­p'¥k(âF Ý@ê…(.ÓZ[£Òë@P\”`C2²"Cs;–±$qŠdÒ"t|ý‰ây’Ø€k8ð¡?,ÕJG­šZ{“ €î -)vB̆‡E0)á̈± ‰>åeCü´«Ë‘Lº}HWšsn›€¸µzŒEº¨Âˆàœ®å\‰²F>µà0:Èj'/ÂåÜÒ" á™ÿÈç~ÀVà KÚÙÕý)çNë°®û­ùq7¨À@Šx Ð4p’^«.A&#Áݵ!€E Ámk‹c sœõ´d›tת!¶i åÛ­HN›N‹îÚ‰«Ã¨}"@!y9ç/ð o!sUÓ7 ="ÓÜEÏo@C‹m\—Ê.ú”Èþ‰©»Ã™†ˆ›7øŒ)ú«¼Ny\`ÎÉwƒ—Û7Ã$Á£ŠPÀVº}è‹Ê¨Á¸É‘ÚóÀž¸‡z`4E5ƒÒ$'T»Ä 4ˆ±5pT ™ÿ_°æ‘(SâÉõ>ßéÿ&0ö,àÂê‹]_.ëÎåÃ!BEî—U@æ`3ö2`ð‰E»p+luÏ"0ïÉ«¸Šy~¤žz~|²‡IL´ë¥öpÖnæƒ 8/æo&'d@9Ùsƒ ¬ÁlÜ€™iÀVÈÕëh,@¡éýЇ÷84Œlï\T[t «á³Û º —›ãÀD¿øB&6c/Â#,-ð ¿ rðXœeAuZƲDŽ\²9ŸWåA5P8àSÔ0‡0 &=F!t@¸ÐË„….œ­ XA¸œwy—e$2Ž€à‚ \^ˆëâ]d0ÈåÿÀåR‚œ€c(¸ßšÝv¿áq9œRµ(Wì‚(¬rî ï(òªf\@º !A^üb @f\”²Ò)fd¤. ^¼æX[çp†KJ8@ QAZx{y_@Z 8® —p†q*`4)\J¿¿8\(¢Š esj* ZÌ\Ý]Ë †VÛhª(fØ9Ô}ý}…µ€P¡¢QàeæÅ @0%4 \(5À £@UÉA!KC PâPóŽ%Ë18 І5üÓÙ+€’w®PPg@Î<Ú‘%rp1ÿà  bô©çO)-~pÑ’ì±b!C !a%Và¥ÀA’€;ýK¦ÌÎGÈ= Ñ€P @’JTl> "Tp«Ÿne1Ï©„Ö½`(a¯/]Š…` †™-l0²"×´Ä€ ¢‘ˆØ¡£D02·Úœ–í‹CÄNS‹òW½p\ Fé’!˜QðÊD o ‹a îBêÇ+´2ËÈ0^`‹ƒ•’ƒ#@±ºéI-vhH£ق᫹è(“»üQn DsÁކ@ðh¾Ág6hˆ!‹0ÿöËÃr$”°€ !Y@(1FsÁ€ j@FjHk*˜„ˆ-·p¸) 4`Zb'n2B¤ %.èÀ®ëhÐç#dðIÒo²ý *èˆ.€ |\ƒvLã(d*à“;!BF,fp@€u2áÇx&è °‰®€ê •8Ü"Í>f$hFÿ¨r­$aŒá bxAŸÐÒ –‚J{t5DíÁb²‚H6sí˃‹QØeæC Hî,±JŒÂBK ‡ã’*#+)œ}!¢ZÛ‡vQg*Bfa(¾+ˆ41g`QpxÁVNñ!p`†U¿ØJ¤[ÀL!ÈL’i¦è…³ÐšHЏ˜K’ô‰Bî2‡€"‚ |(@# þÁžÓúÚ2;êÆÖ E¨š±D¸Ž|€¸2«D%—Ðé!H" ŠFfQÂÎH˜ŒÄÁ›VÂ@j˜*0ä…,¾Ã5†nj­ÕiLjÊ$âV.01ªÿˆÅi•^¶µtŠýEp vKCŒ ûr¦10±ä èƒhÀâ!ä eG¶ØRßâf¸€¯)~„;¢%O6ØQ¿ê9ðX'@ÔPÌÐ €$hC`Y­,ìâl©ðELr d`Byì øh)=OxˆÂ×P¡¼ýµäl € `‚63 +_«PØLBã+ E$ó…xFî™PƒX—–#POQPÂ$V‡1©IeSŸ b$#ab^0YƒO^ÀÉ|Š4(A YöƒL\@K#ä!‘ ¶àN° PÙA)y½2žB48¯Éb:ÿ KJ6!ÍoÀC¢Ø!ñÈ•„ƒX$¥0À,AR— ŒKvÁˆòà $¤“tT&ùË’­l“xQ Àñ&°Å'Y‹fM ¦LHÕñë„9®l¥³|ñ;ô,4"“K.0/ Å‘HNeö,À„*Æ,JV!Ëç\n•hˆrp8_8Óš 5˜tj6rÚ9Üí¦2çÜÑ›d‘G ~ ´°¥. É 8p.[ €YÚÂ%+8nÌÀ- B~‚GKq!aù`?ñÑUôïÏ*ésPÒ=™°¤,]2Ï´ÄÀ¡7èô Ÿ°-¹ª” ÿF8OƒÔÉIIÆú¹†±Ì ,a(”Ö°š¿¨Å_cÂ@eñšóœËÆ`ÖQA7äà &dÙ 8£³u¬«Š¡dq³ΉHضP2}ü@­rD¶äÔ DÈ—ª@ ¥ùbpÃ-ð)Sñˆ]Aü ƒÃí‘ e%€€’ €? ÄTÎ"Û¤4yc‰¬MxÑLB#*¹B¾æ•+b Qu¸È扅 L"y= ?“ê ~V '.À£UÌ 'aœ¤j,£Žâ…o“—!³’\“ a£E<"Œ°¦ìq 3ð!Ã"ÿX %X½Ä]ÀÀ31Ùä–V B!NQ<õbÆ&XÀѪ„«%”­Èﺳ¡uŒ%%°éQ*Z„¢²÷áHÒ»`“eâHû££Ðx¥EyD]w˜Á9ÒïoJx¦ŠüZ„ir>€7<Í’¢ÅQNrŸ¹™Ê®’nZ°0G Ò …ùl`ð‚T*R¦X«œf98«'-P/"Ò‚sáÐ "“E• JSóŸß ã]БCç V¦|I¸ŠEcàI4 ÕL¾¥“$2XJ iM¯Ðf1¨À^¶éA§œxÖ€TLQ¯ÔWô à;?cÿuñI¬vå†tw«Ñn ‰! phsþüzMðÕN7:òh[+'TÏ‹‚â—‡½éMU8—VF"¿>xÃ)î‰HO˜Dˆ üª7Ý4# ©4 “ìÄ¥%ˆCãa£~ 7,ÔóEFÄCT¢âãc¬vLCašÐl†¬œ ÍèN*¸K” q”ѬÓ_ŠèJWã#yèTÆ3¼Éø!ƒ’‘þð‡˜€`èæ éœÂs@ FÈÃÝjɄý¹!L£R6;Ÿÿ†«ñx|2ÈÂŒëi-à×us_Š@D´)–@\½Ü ØSfž3T€àŸb((¸Ö_0Õb}ù#)û³ ü-"³‡L—BA[#VX._¿da&vTÚâàXÿ Ó¼9¥´öò'‹ˆ’÷ð•äð_ÉŠ"€oÈ h²h"³E„ä±Ç[ÈÂA} òpÃõéû[›(óLPtAsl”§E" —C [ü±…EÔJàPÈ!–!‹wÅ%ç4RãÏ&l0'ä{Àâ‡C–×sçy€€?n IÆS‚XväÁSà3Ç@óŒ3Ð@#Ë3^mQ„dâv5{¸áÏ–‘‡š<¦¦PtÆRB…yL5ÓP#&4ÕÕC‰"±C‡„„í½÷ƒ?#HRá?ý±Ç {Œ6êÏG@ _E¸W7ÔÿàO@ôÐï!ÔŸ”?Ï@ã£?AÀçCªÆWÄFT iAÕöiþ Rré‡?1(‹Cªõí°Ãô½úPÚkA쩈UîbˆÆ™¦,ÆelAÆy¨»nB½qAÆ„å•,r°ˆPtÈËeÀÀ5ð˜,„¸áñÇa„xesìFP0§¤”+(ǹþ`qHš»v‡?eP,âï‡D:Ç"D4Û àgÅLûs‡ÀG-uA¡!@ b üã@aS–L3YÔ>ï쳎?Ü@ AoovS ø3O?îÔCÑ>ïÀÿ³Ï6¿iŒ,³œVÃ寀¸uÏ>àÜd‘?»# 3PÁB‰r¸XÜù“@¯¨™<–_ŠVÁÌ"Kšþ Fz0]±”0 ßÜݱÔC`6ºVº¨ù‡˜x <ʤøãʈÆ4L…§)5G XA²”YÔ õÁPЫ ¤XЊ#€¶‡/ÐaO €¾¥ •,a;Ðÿ1´ Qe|0L—ü¦i@cƒAŒÔ:}ÈŠ@›¢¼ŠÄœ0‡^[P„°ð.:‘LJ_pKX²DpÌx3¢ñDMC7á{$¤3XPw›qn ‹ï€§7Çx5•Hj˜JJ‚{†ƒø E@¡K¤+ÈíS]P†”Jõ X›4ŒFØIÑ|j “…"‚"@¡¬R H(W²vRBJÍ@é–ÈA{È„?º@¥æ”f<Фª’  %¿ [o84u![ð"sNæ,Ы kÐÞ'‡8Ì2`ÿ[ËÚ°¤æÐë`ÐñÇDÿ¯á"8äà @--„òÇ!ôÀœ-”¡E*•šÉ@…V™Œd$Šn±¢ø©V6=3_%s ƒÞŽüï¥0mµÀ!“‰äƒA)À €,@`$¨˜dl)›M1’ @` Y€Ð¡Õ6^’‡RÛáyÈáF š8@ H@g ÀÜr pÀA1Ö¼£ñ¸GEâÑŽvèUªÈŽ,¾Qj½b~ÀÉÎî05ÓTZ­?Ò¡‰ÕôÂ+³øÅèÌâIŒ µ@:Î!tÔ¯¾ÉŠb73Šã•¥©ë2@Qÿîdíˆ<üA‹Tä%/À@LáÚéhætŸZ@7úqŽ|̃Lì>P€]Ü¢•ø-Rg¸ÉðBqB!€ÿÀ££¦q¨»Y±Ž.†á `ÀŽvAaœQ“s É…+î%‹f’‡¹NímH;Àòà%°·¾€/-|AºNøwjÛœ…ñü’¸`£ö]šò0ÞF@P%1ÉH'°'Û©†’ F|ÕGš k‘€[|_bL¸š¦Q×Jh! u˜e]´Âš¬ãºY±ÅŠ¯êµ”á@d°hPhœ•aà‚×É /âû€ô0½N‹±h4HVd%_õmÿ%C‚4»žB€«>F¨ tƒ³€µ¬¤`Å8è“9{’EÂ`Fyy (NÝdñ £[xâ@ž%‘!H­ˆìdÁ;ð3Ø•óÞ›¦ÊŒFšÊ¯ ™›Š+›WsvQ%ù[à!šåWBâ1ƒLÑ í‡òÝdˆCÅU&$6œ'fÞå’} nÿÀÂÒüq1†{éKÔp†¢ªáŒIGÃÒð‡ ppƒA¶²xà•1ìaA±ƒ¡c_NÕ<©›Ý3’A8Ê|Ó¨t±7Aˆ, )^Á ”Á\Iä1d±Aa KÈÚ¤ÜsÆîG”Æ1¹Èg )(È|„°ƒPçÙ@˜µŽP„V D‚&à•…WˆPg Ê3Lå­ï@ñs‡å“ò`ÏÈXaH‰;v wXýà–œ|Mé ³M&:#(9ˆO@Ï  ô€‚„rÖO…/BŠ"‘‡àê=H¸ìë3ø€%оPÌ^¡_•é8£Ãÿ“å 'Ìš÷@x |ŠÀÇF{ù•?A‚2–±a ‡¨ß^ШPM 0{#¢„'#s%ça A2%U2ÍA1ð~Rsz² 9c›à„Pl0lÌ‘eÀJ—O"Qó$ð3K$0˜ÊePÆý'BawØ@×€:~°•EÍçb U42!vÀ‡àc0àr€ ØfMÑvÀ`PqÇq$³$aà‡ †TBEªFElІaPN_àÈ•7ƒ'[ylääy82r&eH!n@ã&a 4È2Ì¡~by†ÿáA¡H%õD'8(Ÿ¤%!° S3Å÷J Щã'™Èd¬ØŠ®HR`[óÞãTøŠãíøÕ9w0¶£aH¬Y{‘UA $q¼B ‚ÚäèpJà`:=Ab'Ñ_ °%q‹R36Þ¨Tüðò@¼r ð¢1T¶¡ŽQSAþ 7eÓðpî°çÀU˜hŠ.!#S„2JEZéë@ï¸QTÿ€@-2j6¦açpWß8Þ0ÚPý@`× ¯à 7F ÁÀY¡ƒÿKè``EìàòçÐ [ A!:®•830ZjsZ¡þ€”Z! ¶ ¶Ð è•Âá Ù8ܸü°IEð€ «Á ibb'æ޶.ð4{býþ8ñÀ öU ±³}q<ÂPy“ `ðÐð`’S‘ZÁà™ðrAñ:®U>Õ+uAà%pð˜ýµ3 €`y±k` {9:Ç[y0ðGá˜øÐïÀ±0 Ú…wp ÅÕ•«XÀ î€S›¡UA¸ »)©ub»^¦³.ë î@ù°÷ I%•™P ˜ÿ± –0 €¦1 «Id¹c5 iÑ.Læ»õ b1 ·ð7V [f5Óø_×ËS1l¹ ¸@ f”VŸSOò 뙟ý‰c›Ñr/5õÉA™~ a¡_j"Wà]¦¦wVÚ³n1=®õ˜ò ®0 Ä ÙÖXÀ¡#á²P  Ã`]¼€^ÀP €Œë¢Ãþp :(F f Ò©cn&J¶ ¶`¥ j¥²5ÿ“N–VI8¼ aÆ=f5 0ôX„AJa^¡Ÿâ,p“q!þ@eÀaúR  ¤ éãÿC¥¹À ZÑ•ZSQ[KSfdñ˜Æ£a®tU$–]@Ol n! (öÄp¾0 Ó³ ¦¢eð!@1A‘ Á‘•½ «|ÁSɱö„ƒ¦z;Â0 ·  W   ù?xw+u0ç‚©ZáªAQ3w«2*À‡ ðtê“JØP@¡™á'z>pg‹gMÁ6ÉÁ6аšI%’¹I`M‡ <¡R’}¡dL)AÀŠ÷“*5” ÊÀ àCçÖ†‘PNÓ䟦|Ô©SC(Ô0i˰EãçG€Ó„8 xº6OÅD6× žÿ€Be"0B;ðj"5<Ö “v A‘HBzÔgêGkAñŠºá³ „jD%ç† R G÷}â„À"Xjµ1 Ñ€j›À„d S *D0;*w)Ð7`.Ûgˆ ³²8©mAñDB'ñ¶Y@rþål\ðŒÀB J‡$ð#-ÅѲp{A'è"]€Nç‚XÐt§òK‚tàLBÆ1nVPlð²´ Hë)Ó8¨0Š /„hˆÃc ‚:`$H²a rà/E€@†A©# ‚´Ž@h ²€Fÿè€÷TOTr¦±´ë‡g4tð° *Aa =⟠]{$W¤2l8E]{%ð™¿æv¸eP-U›@1²d*nà‡rO($lnå±Ð[@µJÀRb'»K´HÓPs»ë딿L„êVOAr-ËgOvr'K;†•ñ– 1ºyW,›á€°Äëo'£‹!b÷0›qk_` Ã4›K$@Ì ,Âò 7Ç(¨Ë4Qiä¶vXp*ÊsŽ ° ‹§\òrÌ€(Õ`&X§¶²!¿”,@~`CãzðOS+5pÎÿSmTÇŠ¤H§¶ž›Gz´,þP_0ÃHá^Áƒäû GÂBs‹ ¨|›”Bq+@°²‚{ï-P!¡ÂD›Çv[L É ®z®ö|J +…T!™H›×vÌ€j” Ì•\w¢#‹T †¢H©¬D*Ã÷ç" 9Ð}z4‡àñ+²p([,&i‚,»ç¯Eà<§Q›+Ö< CÐ.ÛJñ‹Å”y'y”.ëÌJ`DIʲ}¯T`š‡jþ|@ÎÍ G + [!uƒzBwé'wCàD ̱GzKúrϰv€gl9À{ B5@óÌ >ÿ {cÎwì(ðaº”,°ÂÓÉòä¼ ›Àâ¹6 MB@Ѳ=0ÛÏ *„ðq›¡¯ï1.É’8@:À{yvRzÊ@ù'Šà!s‚´Ó8À­ñq× b¡æšÛ+@qáý¤þ@"ñ±z ’FÐÒõ±)èBÕ Á…,~NV%ev-wIÐuAa ñÚ+O¢¼,b 5Bö; ×ïq> ±|R àØŸÑ§†K‚«L£CïTÖë’P)|%Vò ósPˆ¸´!ò08¦>þ@°þK/T²%*c[-l'É­>u%„ÿ@aÀr0õd6‚2 ²qP¶æÉ·ÝÜszQB‡àXG¼fð×¶eSEtR°M{AÑMÍt0äÍ kOïmðu¶ss3xÐZ¤QP¶ ôG»Vò!i=ÏbñUà>W2Ì‘0²ÀPÌ»¾dÐàM3WÌ9CÝCB/£¶–E'%Gâl|¨/hPð¬+¡ŒøÁöÔ†mØq5$i, ]$/žQüãí1€{ðqC=(Há9KÁ-¼ã¸ºãk„Šè‡càdÐÊ+A($GsP `ð¼c…_°ãå¡Én ÓZ%‡äÌ‹»‡°ÈM:u@‚ç³ôkÐMç/k|€¶µëoâ­qa kÆ9¥ÛñàÃ}* U2 ¸OÊ>u–j^BѦà!7“ó‡"eä¤×;lE@˜rÜ+`Èþ }ðÛr5¯È%³Å À}ÛîâS;€ `«ã¾î¥;ntp-4.2.6p5/html/pic/gadget.jpg0000644000175000017500000006334510017034537015300 0ustar peterpeterÿØÿàJFIFHHÿíFPhotoshop 3.08BIMí ResolutionHH8BIM FX Global Lighting Angle8BIMFX Global Altitude8BIMó Print Flags 8BIM Copyright Flag8BIM'Japanese Print Flags 8BIMõColor Halftone SettingsH/fflff/ff¡™š2Z5-8BIMøColor Transfer Settingspÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿè8BIMGuides@@8BIM URL overrides8BIMSlicesm´ÕgadgetÕ´8BIMICC Untagged Flag8BIMLayer ID Generator Base8BIM New Windows Thumbnail¥p_P|°‰ÿØÿàJFIFHHÿîAdobed€ÿÛ„            ÿÀ_p"ÿÝÿÄ?   3!1AQa"q2‘¡±B#$RÁb34r‚ÑC%’Sðáñcs5¢²ƒ&D“TdE£t6ÒUâeò³„ÃÓuãóF'”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷5!1AQaq"2‘¡±B#ÁRÑð3$bár‚’CScs4ñ%¢²ƒ&5ÂÒD“T£dEU6teâò³„ÃÓuãóF”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·ÇÿÚ ?ÉgDéýHoéLÝùØ–¶4þî×*ù_T:³ÚXúlÛû̇~¨µŒu¯ ˆO"<ººS£h§3"¶ž°žGü'¨™Æjè7©tLËšüw±—²li“´îöýè=/¥Ó—Cm¶§IìGä+˜ú»öÞ·Ÿ~?QϵÔáÓöŠÍ°àÓ¹¬±ÒÖ7üîº^F§M>öä’ëšæØ,ôà˪¬3éú¦¯§ú=ŠXÂ%Žb¤A‹zÿÅÎ?÷å?ØØý™Ÿ÷­Pö®Ãðc¿ˆKsس”£g¹ûQC³Ÿû#j1«Ÿ‚cÒñGõš(Ïhÿ¿&ô²П››ÿ’FüW‡à枟P*¬OòGo’À¯÷?²?¹jš2ÈD‹Çð7ØòÏæ0|^ò_ЍöqrºUN¯G¦¾Øü‹ÊzÅNëY¥ÅÔ׿0—ǵ‡Óú?Ø^Þp2ÉÔUœï‹Årmy×v–ï{mËp³þšfC dÅí Y<øüÞßppø|Ôo„"»ßTóßîåBtfÿÐã+êX†ÍÁå“Îá’UƒucMVµÛtHñXÉ=.{-kêcHÙIwæ·n¿I0ãCÕíº^U˜ØýAô˜94·¸ÑÎmö·ÿaÛïýÏ^µÔ}SÍªŽ¤ËòȪ·Ss®0ÝÁõ»oö˜°ºN¤Ú±À_Q,s5ùi“kŒ}]Þ‹?à1=Eræô\FÔÚò7°X+ÜË!ï¯}¹Æ»w³OEÏoøoðlR@ˆÇ„KÉ”¸€{ç}cèlúYŒùIÿ©núÕЛÆNïƒÿ‘^K‡Ö.ÊÍ}nkYŠçí¥æK†ã¶­ÿšïk_cÖÅØy—5îlÖí¯÷D;÷¿o¹8~òÓ)zï®= ¼>Ç|Œ!»ë·G6ãý–ÿ¯>kƒ¶‰Û¿èíÿÉ-Žõ}ÙÝ7í¿hmnvòƦÚ÷5Åö)ÌDFX$ëH&b¬U!ä^ÿ^ºpú4ZïŽÑÿ~(/úÿ@ú8n?ÿ¾¹q-;€#¿ñKküÜíDzßr]ÞÄŒ Öý0;@ódÁí»Úßjóï¬gRÉ´°1×<ݱ³¿Üæû¶¿é~ò¼æd= *9¬ÚcQ"?é(óDØ2a‘â£ÕÊsˆƒØò|ÑëàŽfHV®éµŠžYl–Wê>§4‚ú{î­ÞåJ©´èáÇðUäݱ¨6ÿÿÑóBAákýYÅ/Î9d@ÂÚêä‡y,ÅçýÛrÿôbcíî#`{wÜ"G,üÿê¯FèÁ׌Ýéų‘•{\=οùÇ}{ë©ÔãogôFÏJ´µµ›˜ÌÔ½âX*o¦ÍuÜáîsⱿéä,«¥…vYRãéROÒ‡G¬[ýJ¾š×ÏÈeö3§a‘c·úL-;šçØí¯²·ýOÝéoÿFÏôj›òr¨Èµ¸mÅo§Sà—îp©·9‘¿}®ý#ë«èz–(¯‹!'hh<Ù+ƒï=ÁrºA}5‹…M¹Î,$;Fµ¶Ë=OúÞ?ÐÿÃk£7cØÇã‡!ζÛƒ?`úM7¦×Ò’ÇÜDzÆÖ涨.÷yýþu÷zµþ“ü" ÌÌF4fVÛU Ý[[ÛY^Ãô«ØöW½8‚w[&Å:×UN]ms^ÇÓ@¹ïoÑmÚÿÞÿÎÕ>•õ—« ¡„ûGØ.ÝXgÐõ ½JÿKþ’ËQ/¾œæ]Ôë³1ጮÀXàÆ“ê³Úø_ü .™ƒ„̯S ¥¦6ú`— î†3kž\æû3ùh؉5¹Ze¨»3ÃÅÆË³&Ûl»¨ØïX¡ßCÔõœïð[ïøD­ú¼Çnç‡k ¸9ºþîù±ªíwшò×7k-!²àeσ·÷½O äc˜Ì:]mísÙMBËØ!¡ß¤àý;6¥’Q‘â„lþ¯¥tH â;Ùþ³ÆÕ…“~MuWëQÓÃYk˜AÉ~÷4Ÿ¤ÏbŽGNÈ4âXÂÇ_‘].ÐŽ^=Ow·÷\º7tÜ—ö—_õ~ïòvÀ5éè’Ç»Úïä¹d KœZúš  }§þŠ¿Ñkô±ßH{Ú1ï%£B fÛ†ïê¾·×±3DÑ9`@²oW£«íùÕœœœjú;±ì²×: $î¬üæzÒçSº¿ç?®ˆü[,êX­{Ú*oé79À8ŠÿNýßEµ7ùº™êƒ©P§'ë9!™"ÖÀô›”oÇÔºšñ¯ÿ«O“Ô3l£ÓÌé®»{·\üK|Ù]¿¦³в½ìö$a n–¥†§Wȳ6ãv3üŒ«lqìŽ?E»žÓeþÿôê÷ÕüGW»{H¶£êZøæºÿù6æ]ÿmÒ«WŸÐ®±ç7ÖÀy†QëRêvù¾¯éêÙô}®·ÓýÅ{¦ÔëïiÁÏiiinSj5ÜײvúMu.uõÙîß]Mâ•‹/Upkjo7.ÌŒ{jmáåijÑo]íßû±»bÌê;§1Þ…‘hk솟x.h}»¸·víõïþEŠÝ};¬¦äÈÙê^æ¼mÚl-ª½ßÔ­žŸï«õtN“knÇ%®fÝ–×;[ôž×¹ûlm¶9î¾­›¨‘1&B½WûÝ¢/„ØÞžN7N'"ŠÛ•»'Ñ{Þl n†µ¦nߢÛ*g¨ôZˆº—WYi¢Óa~ù u7{NïWôž–ÿå U“—‰”qz{¨uÙ,,ÊL±Ïý+‹%®ÝþsnÏ¡Z·UM °8WCH:ŠGëWÚí}¬wè«ÿ­£ YìJ¤$*ïm/Å=½K¼Ü|[ÚÐZC£@6þÑô½ÇcŸþ SÏë/é¹ùy}%ÅùÖâ ¶1»Ú%þ˜¾ÖŸÐ:Æ×fúj¿ùÏB¯ßO’.êv»ªÜr²ÛDl¯‡m{HÜ‹œßÐ×_óÎÚªÛv;0úE®§&ûlªºìq±Î®Æ·Ì›-qw·ì{6Æoô˜ŸDW«_Òá=%éýßûö)¤tý!Ö>¯åò99vXÛÛ†ùqªªœ÷rëß_+~®ý#r®·z ¯Ý»Á?+]]¹wÝX/¶ËDküã­?ôÑ+ì“ÏsçÙU‘³}Ý(ÙÿÓæ*hocÄ69ø÷=¡ ¶Îuƒ-‘üS7|‡àTò{‘÷^1•Û2ˆ1¢é×Ön¬kCšÐ¹³§õêÿÈ«Uuœ;€ƒû$ú.ôÞ² pàŽ> 55¶Sc¹íãî hó¨þkå¢v$=mÀ°^þkôužÕý_éc±j/?á6;ã¾­‹œÆ€Zç°@& ゎoÍÇ|Ôæ½ Že®ÞÝ^Ïú•(Ï¡±ÿ9ˆòò‚ г£Û][1³r+gú;HȬÿc$=Eìëô¼9£8 O©Œø½Ž³üú–eX³ë`|øû_ÿU騝UõŸä6ðÐxÔšÏÝpÙÿ‚"2t#ùxIià¯gVm,kzŸIÉÄ`$ý¢ ÛÚÓÉ.¿×o§îÿD¬ÑÔ:>N5®ÆÊÆ7Û¼Ôöû ²ŸmÞ–÷V¬UÕ0,K˜82ÙoùÕúŒYÝ[§aúMËéãÔsí"º}ÍsC\ïQìfí»]ùèœÜå¡X2JÀ1±à[7WÔj¶ÊëkXöW[¤†×[(Þç€æYcík­XýbçÕƒcëh}¤ŠØHƒ^vݶÇö~„ÙôTÿfº†a\ìgcÚ÷9Ö\Û‰e µ÷݆ [¿sªÿ1S빸õ×cšë—:¶–´‡­ö=Ömöý/z>Üf{ìº96Öú9­ÛÀ˜. µ°Nᦞä—ÌÒ¦º U n[?ÿÔæøÜd©dk[\5öòèèà))©l$i ?æ”ØÇô`v~?.-ÄèA=‘Ÿm‡´8ÇÔKÚN£ºkà9ß 1⧪`qˆÓ]'Áê5Zðá ëª3ÍnúÆ¿H·D :&AäÞE'ÛåÝUKQ‰‹ê‡Wc¨s¾-ÿ¥Yb¶hêu´ZËíâ׺æ¶}'·wübª ÜÏà‰hÝS»x|Sã‚(‘ýÒ¶Pê™[,±£&¢ö4—0¶Ã¤èí­¼èÕ[1ç)ïx¬sa¡Úcó£rÞ¬ºž—¿"n,gÑx;=ßF77Ó{Õ…VÒïÛÀþïö“òä‘ 7×Åf¯ x P8òêIPÿ²'Ìäë&&¥3y;Ëhß‹m¶À•'õœ™Ÿz< …—ÊZ ®jè}1ür'Q#æ¾ eï“íM·¨š,k-åXA 0xòî_ ä¾iòœ¯Ä1AFêxÒ¿IZ 2œF؈×7äüäž»®ißš:¶€5Kû¢ÙZÃ-¤SDœ=rJÆàú•§Õä•òvš\@FÞOå=sS¹¹žÚmVòNt*ÒÜJƃ±Ísd•rr8ÈózЙ夅þ#±“ƵïÐe$™9Q€ˆ Ëìé,TaÉÃßÇ)á îÝI&½¦ü£l|L>™v9µREDà#áðqåOòüpõCÿÐàÞAÿœ¤“K)£yóF{ëIkþå,ÓÖF^þ¤ ’×!‡[+#=N†Qú_AéQ~G~gÄ·&£e Óý¨¬fI^âHd©WÀdΛMâ\Hñã<š¼ÿœaòÖ¢yÛyŽ(yH²@CáU`Oݘç³8¹IˇhpìBIsÿ8©KêÇk«YIËÄ·«*¦àn¤ ¬ö^A´H?"«Þ'æ/ùß5yzâo4ÏSiÚ·w‘^%€¯»í–bÑå†Qtâdgažþ^ùoQYáçwJxÆ[Ç6K]\1¨‰ï~ŸþUùjQ¢[;HŽ~•ÈŒB'›1¾ÛhœàÇ ôñ„rioˆoà2@õâ Ζ•ØxGzÛGK@)ßÃÞŽ0°ih7­>["õA›_¢à5øI=É9/w£ÉKôUµ Q‰ö;`8ÀꃓÉAô›zÑc5>'†;×ÄòC6“k¸1r¯Ù¯Žׯ—H¶U5‰ }°€l%’é–ÈM CãQ’¿$)‹ª ÂƒØ aÜÄ£>$…âXÓÓ`D‘²ƒ·mñÙ¼çÍÈ·Œ<@()Zx䪷Q»ð'ó«GÒ|çùÏù‡¯ßú®×ÚÍÄ0zRqŒ%-£ ”¢f‡WJ[=&“ —WœÅäýH¹À%/ÂŽ_$ô¨ ÊÁGAÙìÜÕÅ#âE\t$v9¬‰Ë2bø q#ãu€ä'¹d%²®£ÝC*šz‘±-~Òû'¾cb$Ü€Sø}2ü·ûï™6ãSÿÑùÓ«[Co>šC‚]+ ïšÍÞBbGpŸ\Yé×ÐÛO,I$¶éHî"E>Ò)>ƒ‚å U³Ë‡†á”éÞsóï—„qèž}×,­Ö0a¶–ä]‡z·+!§±9“Tœ)h±žLÇMüôüïô#ãù‡p 0ŸLµ“© û3øã-|ãɈìÜR(¥üùüðÖu_*ßùŸOÔt½vþÓIÔlÆ–ˆòÁyaó$³H’ •¥º³Êxй¦tЗŠh<~Is`>Xÿœ—ó5äú –«c¦\¶·y ”WQ£C_ZE‡“FK¥jœ¼é¡fÚa"e³îòç›ni Ö´ö!O¦ï@6wéÓ5Ç$A!ÍðåM/“|ÎáL¾aµº°ŽØÿÉ ñ áÉøY$³ù¡Ï§n£õ×ÌG¹|wªÿ€¯˜WÍ7gÇ„Q¯ãL?šËà®ÿ•y?¾ó.¥ ëNH¿ˆ ôH ùw¦}MSSš»ïqÇõS/&^ USòëAó¸Ô%ßöî›øcãÉUGåß–GÚ‚âOWþ8øòGåâ¸~]yCö´ ÿëI!ÿ²?˜’/Qä'/MØÓù?¬àñ¤R0Ä"ÉžTŒº§OÝúññ%ÞËÃr-|¯åÀy Æ£¡ôSúcâK½x#Ü­úCM×F³Ÿï„þ˜xåÞž÷ oô-âÂòÎãF³{kÈ^Þâ?A>(åR¬:w"x¤% €,¿™~WVóoš|°¢«¡jW–±ÔQŒpÌë/¿4ùcÁ*zd〷–Å9ôZ=–fcÀ¦26ÆAF'‚2|LœñÜÇ/b(;zqŽ$·2¬iRïóÊ¥Í4ŸY\#ÛÅ,¿i¨®Ë¿@k\Å”xy9cÔ7Sú•¿×~Ñâ`õ¹ûôÈñ–®ßÿÓùù¨Â‡ÖÕ ;í×9ñ9=ßš3J”ËÕ̜Ĩð9 Æ…¤M™Ø\Cºý^J-?‘ñ}Ê­É„¢Å^HÄ\$«W£x–ã—;j–ÜžŸå•Gó–®L <–ÚÖšðÛ¢òve¹‰‚ îI ³Dx_÷vûóïómüûùá­ë¶Ìí¥és~Œòúrô­j²1ý¦;,|"-áµ9y(ùoU´šçòÿQºŒ=´º­™DåRD·…8°ð¨ÌÜõ(’×§¸ÊŸ¼¶¶öp¥½¬ ob‘Ä‚€|³Ÿ ;‹Ù¡÷Äu0¥NžØ«bµÁJæ w¾8UE®"íÏ¿õ‘Š ¥Öt¨+ëjÖQû<迬â©\þuò¸f›ÍT\A$È;{r®¿%þi~]Ûí7t”>YŒŸ¸aÉ䃚#šKsùåùQk_SΖÔDYÿP9/}Ì1ö=qÿ9)ùAçiÓ´pÈ€Â4Ó,eª€Ho?ç,?(-'S¼œÅvæ§è'&4’cùÈ¥7¿ó”_—WºeÆ¡£Ë{z–¥~·¥ÁÐWb7=rÜzy#ó1ˆ_ó‘z΋æOÌ¿1y“A¶’ÇMó©x–wõB¥&,*†i{S †@]÷gf1’ùGQãºjßýtÌ(æMFîU¶xd 9çQ°=þ#'!«võØìƵö?~B\ÕiEUØŸˆéòÔ×1²9ÉNªüÁäyÔ¹Š›qä(¿,©²ƒÿÔø—þ©kXíïæ€ž¨²£ñÁÀÊ2˹“é¾}ó&”јîã¹1š<`ÿÃã––nØ5‰°ËtïÍûä[…¿ÒVsqöžÞ^ ×vjåÙ2ƒ ¶&â§ÚÿÎc~`=´¬zu¸š$*~¯È’Tu$÷ë˜_”Ü2ž°†-{ÿ9}ùŸ%U58 êiº ‡^Ç,ü¬B#ª™1Ùÿç+?5f;yžhÃJcM¿àrcK äÄê²ZO?üäŸætëY<á¨E~xÔ uÉþR,?1.æ?uùñùpKIæÍM‰ÿ—‡éÿ‡òQ)çÑ%¹üÜó”Ôçæ+ù+½ Ã÷öå’ð 6¦£’SëÉ'›ó Ìï&«på·<ÉüIËy/‰/âK$ó®ªõ-w1ö‹uûòC¦d”óUýH3Iï¾KÂE¡$óÑ$úìxÿ¸ )ì—^¸zVRp†(Yui‰VçP>Ñ8”¶mJf »l>ÈÀ„^æ†Ñ/…ÃÇ,°˜é/Õæh¦PÀ†ôÜW‹ºžÇ*—{n1D[üÖÔãó V·°Ëy©IjJIªêŽ'Ô'‰€ÜÎ.Èö¥íŒwwýƒ:œ z¾tÔ¬‹À¡çŸٜÛÓL“EÖmgWB~Æ8Ö‡¾XÚŒø’˜¥šÂpŒ ^!EÜäå¿%eÉÉ€@R¼Ô÷§qü2¬œ™§¤§Õ–zž~“U=êŽÉÿÕøˆÈI? ½5Ø °Æ‚)I…zïL¬-‹ iÊüSÒ˜@’™È´mkXÒÝ¡Ñî%ê`[8«ÊgñTnKotñÉ<Ò2ʃõoÉ^L‡ËÚg—¿/á‘#o!iòêߘڕ»p‰õË•_¯*¹¨v„˜í#'¸ja$bÇAÆ—ï %îš’nüÍ–<ƒ§i¤'Rd>œ‘Û¤SŽ#u4ÊàŽcÄİs&Í5_ÍfÞuüªò.ªù‚Ó_ò>™§O¢zIæo3é2Íeeêθ'¤Ê¯J׉BW¶X d8¶§&N pÈŠy÷Tò_–ü“}ç=7R¹›KŠ4˜QÖE•‰*ˆY€jUO]öÌxj'{rn:pM>/òoç™5½kJѵ ;‰µ)½%žÓÕæ¢…™Ì!dåÅôÍŒ5@lדJG'Óöznµ©iÖÚ…­”×V²ÅÊÞXÔµR¤Àn(APvËÿ7@ÚÜËHÙPš;¨ª²£DWˆ ÿ §û*d±ÌLìÕR«B™Z²¿55ÜÓ ñÈæÔǽ$òSBc¸ŠÛ)~­îÔÒCAQôŒÁÒv”uL#Ì=kv1Ñéã”òýHÛ=/P¿Õ¬´[ W¸Ôï¦Kk;TÝäšfˆ+A×Ç6™ Æï?Åôtßó‹žw]>ÐÛÅo©j.¥®4ëK”yâuûIG ŒG‚±Ì)j ¹qųæmBÒm:êæÖedx¬€ý¥egq#°ýo`zlœÑ¿vÀutÎ@zçAíe1ïÐ3‹¿É¿3HÂ]É5Ê'7“H¼¶¾cEƒ[Ç'¬´èjsg=JèëhaºßäòO2hwšMÁK¨åµ»^HÐODãR¬Ÿ À£Qld$,%šcˆ¸ É-JÖ¾"¹\ä `6È}(}Jr©ýQ7zo™¦PÍÿÖø‰! BòÙGÒ~œ"íPÌ@íürÂ@U4RÎI h ÷÷ÈðõWÓŸóŒ>PRóf³ù‡ªÄ³è?”öÑjVÖòý‹~éÌZ=½;…”4ïþD~õÉÀÞýL¾÷òuŒñ[D“Ý7¯zÉ}w¤³\NIx½N¼ˆ«HkÞk”8Éîhâá{柨Ãå%6¯¶Þ\Ö|Ù}Þ‹©í¡¹†×I–¶¿V[ÖKyYî++#0,µÍwkjg‹év=Ÿƒrðß0~u~aéñùÿK¿ºšíüéÊ/6Ç$ÙÝ\^ÈÁÃIgõ‰àŠI_ŠÞF…”Õ@lÒ`×ê2LDü›Š9'Üù#ó;WÖl4=É·÷Ëp–ÊúŽ¡h¼BÆwa øK_Ï\ë1™)äŒnfC“òNŸ'ûŸÕm¡ ¨YA—¤'¦Y&Ô/ˆäž)cäµ­©â‰®:¹‘ ܈UYäýü¤>YòÅÏ“SBÕ5?1.(¼ššMÅÚÉ7£Í`oD—<‹ÍD#~Y…£„È&\ÚrcÇ“43_ÜY %ŠKWõVÒ(e²=Án bV•ïÊ™“´ra6Ç”eÏÃÈ„ÝÅ©yŠúóOƒM‚ÛS†Õ x­ I‹ÈÌÎÇ]’‚rœZùê xšraÔô¾itú´7^kÓ¯d•í$Ôm’ ¢G÷k ‡åÃjP‘ìíd4¹e9y=§´r†§EŽè>àëùy§K§~eùX½¹¶¼Ò¢º–çW»ŠGImý8£¸d*>!ˆ&•ßmó©‡hxûÇ‘xËmú\uk{{aëÞF–ôU·‚²ÈHÀŠoR#23V“oȯÌ/6hZŸœü׫Þy§AZ†­ròÛ[\³í1V8£o S¹ÉCY‡á'vRÑgâØ|C _4yRV?óµÙ´‘‚e m!wâ8Ûd'Ú8O]–‘ªžæ«æ†—ÍÞSiÕW–f¸s鈴Ûý+ûh™T»W9øöV£’ãÎ:$ ÜN§)Œ=;`;ŸŽtÜxd–0ÕÛ/ä<Ç™@Ççñ..®®¶ö«Èú¶pERZ€/úSU·Ø|ó'oÂ<ƒl{-1Ù?0ôŽqÇ †±"†§66Q ÏqêKøáþWÅ_OÛûŽÆ?Îû?j[uùh¦D‹F¾e`yú·°(#¿÷væ™T»_ÃöþÆÏäC"=W×—íaž_Õ´íGÎ:—^9$¼Ô®é@^>«LሧÙT;æ‡OysíÉÜê¦1á#Êž¹æ)¥'•ª´(ûTb\2S½7ο#o' ޼Ø÷æý׫æ}EºoVëËþ]Ó`Ô „³»¨~»0w'“2zꛞßFs]£–²Ðz¾ÌÆL=Eâ.¢ ņÛxá`ÊôÞ‡s·p3Z\Ϥ².KõzPpƒMèG*uñÈ6?ÿ×ø„Üxòk¾Yj†júår‰è Ž«¹$q—…DSÊ‚¦€¿Ë-†ãtêå’"òG‘ü•äI!+©Ïó—æ ¨KýF{{GÚ¤ÚY…RíÈÃ$@®×>o¡ô­6MbãKÑ-ëùžèÙI:ŸW”4îì8€UjuØ8Æ8Ž÷¥)Ñ6üÇ×­-çžîÒ[½/OŽÞÞÇ@ô¬V[;d h¶ßX†m3PñçÂA,ªÄíœ^¿1É“s°zÞÌÓ+«çmÍ¡Ô$ž@‘[èñË{¨IoÁ2´pÐ'¢.Àì2îÎÇ.>1Ë—ÍËíÜñFó$[âO:yªãÌbÖï‰/ÓQ‘µi¹×|ê±c0§«É‘ÃÚÿ/Ù|µ ¤’¤:‚yCK¸ó>§m+=Åüá’Úxåm×z# uälFW)ʤ‰Àø|#•¾“üó.¹ù•¯yŽOðµôW/£dRX‘”30u?×`Hï”N`ÊÂà Ãóï^µó.‡«Üi6z¦ÇÖÓ¡2!XýW ÉUÙxó%j3U’j #K©ý8òšÑ¤]V„e ®bê´qâ1®n^<óà¹ã?œ~eÖ¢×aÑ|¹¨É¦Ífa—ëQ-B§ˆ4íð*Cr`A°ÐhI–ö Î#ªòó{ÏZ™e°›Íwš– Á§izœ—7ææi×âŠ6%A©p¬á{Û3óeœ"hòiðÇ ½«ósÍI{¢è õiŸNˆêú»¼Qú²P… ¡ Ôµ[®vÂvV-DçŸQ€á½µímFžÓà™ñ ™ë^lÏòïò«É¾`ò…þ»¦Üéz¥ìFvº²¹‘x¤Œ]Å(qP¦†”®qÑaÁ=^Aˆï{.Ã×êñé!ãJÍyþ´·ÿ8ͤÏr—:›½&…ƒÀ·ð^êÏŸ¿ŽhŽNæªowùƒþq¿Îñ¬“ØC°‰[ ”•ØWbc“ƒýÈË äçC´ Hñwæ£k¾JÓË÷‘ÜizõÅØ–æC ±ÆŠÂ0Q÷Ý©ÔPŒÉÐiü[ã Ôk8EÀ¦ú~™smgl“BÒÊÐF^c¸õiR(:o˜ÜBè‡"9Ä­¥]ÛÊ¿\G¶qÈÑ7ÚÀ 5+B7¨ÈN¢KŠ_IÙ;ÿœ{П_üñ¾-'¦š—ïÎ7à÷%a]éAÉy›ŽË…›týªLcOsÖtÛ=SÏ?•í%YƵªÛi÷&Ê‘r]o½8AïÚ¹»Ôˆ$‡OŽF$¾zó~±'˜<Ûæ?0Hhúþ¥sމÓ3F«à8¨ùg'’å’õ˜ 6cz¬&7‚hÇ 6@wø·#éÊÄAfE®õåúZ s55ßc÷e?ÅL­ÿÐø@š¤‡zÏ|š³ èÏço6è^^ODé\¬sË<Ío iûM$Š PûeGŒÏ¹”1ñÈÖ?–_óÚÿŸ5½nâöwòçòŸPK¿2j ñS¸„ú¶Úe²9S –OMˆû$·|ÄÐëŽjþ—/ƒ~¯†6}©åÝZÔäÔ<Õª¼w:η¨Íq%œje¯§*¼’È©ºÄ&u@HÜ t±”ýnºeì9·ÑtÍ{Íï4ZMÆ¥Ú–åy>§ q8®¡,s·Á3H¸ã_ž`v® 6½1’TùãÎO{wcj¶°ÃqÉ9·‚+E»õT¬®Âî9ŸfýÚI›ì6Î<–\=NÏo£Æ1ÜMÑ~_·Óõ*êz×™.<•æ‰ofºU/¢¾²œI"¸tV"Eìhiž“N!„@ /Ú™Ìó™^Ïüáÿ8ë—Bù†5Éæ ñ¨†¹Óî­¥³‡V¹šàË$r\ÄÒ$d©f<< )™^!ŒNüœXËÄ 3/!hæï^óé¶î.¦×mb¸{ÈhúšM)i&Žª¹549¨Ž\¤“È; F1ƒ'ªs£M&‡®YYÂ,¬¬î…ó"zqÂ..ÈTèh@ÄOÒ^,‰”¥ÜS)k³ifmjè,<¼Ãõ›ä?ic¸·,µÊOkÃ` _7ÒžO»k?(k^y¸…Ö2OH™#be¨¤pï^ٺŴ…9;žOòÍÏ–­u?=k¨hZᾯ)oo.µ-6Kó(sH`¿t’0+UÚ ð­s{¤öšZ=!à¼æ§°qk5#<Žà‡ÓRÕeòÌ6š¦4=XB:„–±Þ¬LFäÃ)ÿ&Û9“’Y ”¿ˆ»¬PPß…'°´¿»¾ôõ]Yùið¯Ö®íÑQ¥b $(Ûì‡l™4D‰äÈ ²Ö®,EÞ—®Hð|@%äK)¢š}¥*ݺæ8Ê$ YDñ‹~Yþaů~vÚÍæ%·šÂ1ÃÎÈÒ†ÂTæÊ\‚š™ò xŒœÑŽDs}Åu«ùcÏ?˜–úå­2K?3y†ÆßVótV¾ŒÖV­pž¡GP†ãZ; §a‰5ø¹ ¤‘ùyäÍ {ó"hfÕ4”ҼשXÙk.ë{õ´RËúȵbÇźåZ¬1”ªœŒzùáô–17åΉÿ8ÿ›<Ý£7˜ä󂆲µ†ÒKyÚÞÁ úd$öäpØdôŒóÙžiøâÎï“#µ˽cÎ~c–ÿXƒXò·•µÝZæèC[ íSŽ—e$i,—¦©ÂŸ5ÌüÚ¨ðÊÄ*Å/˜,RÆkt‹÷‰f>¯<æ…›†Üª­O¶rÚ|§)/K‹è =Ì[·b_€ä§` ô 䬆ě‰ôO‡Ü}èF4ÿÑø%$FÇà =ºe†vÙÁL÷òÒ[H<Õo%æ§“k ­ÝËOpòÇ­kÊr…$jÌW€Ú•;í˜z¨ñB»ËnRø?P¿*¿Åúåt‹¸`Öu0 CΗš<öiq¼3Èïgk,JcwnÌÎßg’² »M„`1hÏ›cÑõoäg”õiô?3Ÿ-Ï©y£êwõh®ÚÂþÆFŠydo߉–‚±‘ê?ÅÀÒ¹|²D S‡Š&WÜÅ<ûçK Ë_*Ø_ZéòynÎ xŶ±6<Ö²Æ;ܬ/c#Nò,W @ʬ|3—íYd”ýEè;'ND="ÞYù{‘{æ­SÍ>d³7ºG”­ßÌšý½Ä¶ís5±ú¶™ku º}]渻1£ðP²€M3 ²´ç.c#ÑèûKRtØ8?³Çµ-]ó&¾²ÞØH·²Í5ÔV±B5ܤ±ôíã^D*A¶tÀ‘°x‰Çc#ÞõïÈŸËÝ_ξcÕ´·‰ae$1]éPDò3ÜÃÉŒÒDU“‘PrqÇ)Ã{´g4N´_Ê»¯!ù“Ìw÷ŸTž+Ãlð<^Äv°0£¤€2žŽ6Ì|:yá³!±.f«YâF0òyf¯ç%éöþ`Ð5]dKQ¼I¯î)½)"cÊ5YãR>ØÖÙŸ‹N%7Z1ð4]C>šuKk¡©hšøŽí5Å`èïtÞŠ(BiNŠrƒƒÂÝŒ¡,„z“ÿ9-ùW«ù"Çòý,aº¾ôÞÛKxíîlæ´xB„•ÄÓM Ò1ø‚Ñ^‚«™÷Â8‡6G†á|º›å¿"XØK‹eŽöz2É5’Bw}ëß5¡–÷±e§!É’$w'–šì‚Û+·™DinÔOÛÄt;xæ‰#F¶§›”2Â_G”|½¢Ù_k:½#ëò­D’HH¤×‚lOÛ.Å,‘™èôlóž:¦yuw§Cc93›ivCp¤‚¦Eª°§zA9|õøIw]Ÿ†[šÝ4òïš"µY­¯™VÞ~M¦I4ÊòMïÂhhOÓŒI”¢êq̃.`sUÓ%’}+]Ö.e·KY®ã²·²¹šye ò²‘ðñ…¨÷ÊsË‹,è|ZoÉÔ#nÿ34+yzÂþþÚ{ âAoiy$¼›ÓÒ¼‚³‚ ž¤fµ»{¤iXïïJí|·¤y·Vn·¶´½°h¢¸ÒåÄÒ4eCò+P(v÷Ë5<“‘ Ð+ üâyž³çÙü»æ+9“oËE=¼eýE¸¶i½H_‹ ŒÀHKTu¾ì=Lxg—†}ïèê;GU“øâLzûº³ÍÎMfKkß(ë¼2~óWÒ'+'¯#þ¬'"jÄ$¶ýò¾ÔìÍF›Š_Pï Ðv¶ Iá°$”þ{éºÌ·V:lWR\iº^™RêüãŠY˜n+€ÁkJ®YÙøÌ±'7&jÈ|‰oúJÛòßóU³jO©ù—ËÚ ¼Òš:ÚÚ Jïñ !úNcjÏ ‚çèq“–ØMúz°0ê•!ÙùWÀ·¹ëšL&¹»úôƃÐzL™˜ü·'îËš‚Mé|y/0àr¯ìÖ´Å_ÿÒø›oäí?Y£Ð<Íì 7ŠÐ9' ¡9L§ÁÍÍ>” ×—õ¿)jÖ ­ª[Ç3´qL2P‚¥¥G\DÆAA¬ã8Í—èçä§™5Wò·Ë ¨Þ¾¨¦Ù­¥kƒÍŠBòD½ǧÅ“ %ŒÑÓj¦D¶}‹ùeoæ¯Ì=gô&¬&æ+H¡›Jó]ÜÁ=¯¤Yy±m;qv &¨âNW¬ÒF;†³xCÕ#5-7I×5;ÍYtNY4ëkˆâší5 ó_VßÕ ²ƯÔõéœÞ¿±e¬6$÷½?e{E §„“î@þ_ê^Pºò.½åi§DÔ5N;ÿ:z¬QOÓ£ §Â Ñ”Ã'9ISÔ×¶ai#>ˆóeÛÉj3‘¤rIüÇåÍ3N¹Ð5möxçÖ[J”É˺¯¨fä~:ñaC\Êœ®7Õçu‚­ÿÎ;YÄÚ/›µäž[kÝVõžKÖ’E–RíJôïï›=6Š5ÄZå˜J4ñ/Ì<ùÓXóGŸ<á}¬ÜkúN‡mmå¯-\Èë+JâŽæIƒ+¬®5§|¯Po,q†Ìw(ñw>UóVïlºTw½â¬pØ«qYå•Ü«nûñ?Fn3Ã( æÃÌämô?åî€özg™[ZVO,yB;O©Ça§Ô7i^B&¸Êg Õ©M³G“I²\¼ž¢wz‡—ÿçÿ*ty<¹¯k–÷ Æãô•Ô +LHâe‹·Ã^ü¸òWå••âþ˜·TÔ5™K¿©w¨9iØ+*’XHÌÀZ”™Dï.c«—#À8úr§•é~MÖ´k©µï5[}ZËLµ{Áu|ex'`*z°¬ÅK–r *Ýr¯Í ³ºÃ>2@äû?òÃMmCAòg‘f‚iõ;»»0yžæàþõãi Áõ»ó¾ç¡à6…‡U‹S|“nl<2â·­ù®æ®aÒþ´Ñ[O*Fµ£qÓ¨#m©›‰Ãõ$}®9U˹4M!ŸJ±}âÃSÔõû뇸xYD 7`ŠI ¨ãƬ&ð9¤Öhg’˜‰ÛŸ“²†¦cÝ ‹ËvVþ_üÄó–§¢ÍföC˜"œ ¶¼»œCy>3Ī– &•ëš®ñ çF®\Oœ?1'»M)tëÛ‹›øêz6¹,*òJñÉÃSÔç*JÁ e•¶#|ê4ʼnSªË/«¿£Í|³-¶«§ùž;H¦×áŠmKJ¶©ä_Sd²Ò­RUUTv+²ž[Tuͦ°BŽÝ\DßaiSˆüÅ©^_Û=Òèz”873 $ñ®áTÕºæŽ1•S——a@°ûkL¾ó®™}¤Æ¼Þa¨i«ð‚ò”·ƒœ]¹9ªÔtÌÌøa(ðSŽìîØy~mcÌžmó$õö›eå›ÕÑàÓ$·0Cr-¡vÿ¼?—q‘(S+œ%+ªÙ0a·;êͼåù™oåm;E·ŠÏ×V€GéÅh8‚hw5ÍTóê¼·›fYpC‹'$òƒóZÓÌš·˜4VÛôV½[Ƴ”ìö•ã‘—mÊþÐìsm¨ìüø£SuýÎu¸2ÊñLKÈú~ô/üäµåóä½fÿZ{ˆ¬tG¶¿²6Üýg»·™$·ô|LÞ ZPâ@ÍQ¹Hü$t=îÏ. ¶àí·sáOÏï>ê™>nÓRÅõŸÌo!hÑIs¤^Ù«h÷-­jŒ‡PÔ"‰ã‘ƒzb-"°“e #:HÇ,É h¸PŽž|8ʉF~qkèß›6Þ@²g¾Ò|‡¢èÞN6ޤ$-£ØÆ/2µÔ’âsœíÆs=ÏoØÚ@t²”ùñmî Æ­Dˆþ€âTT~œŽãéÍaä˜ ™ Ëh×'â©~UŒñÞƒvïÛ6%um½‚£à¥7©íøaãWÿÔøé{ùDê%6š²4‰J¬Ð²)$WfBß«5ÿžîí%¢!j–~lÑÐNlMÜ2Ù0–›õáð¸û³+¶<š2i EÓè_ùÆmQ´ë?:é—pL%³š+Ùm„lÓïR_h“Ãj ÜövQ.íF¶z¾ªòæ·—-íu/6ØnÓ˱3jM§oзÃÇÒ¸ ·¯Å¶Ô̽FQ›“‡ râ¢÷Ÿ,ÎS~Jß´q]ù†ÿÊw•JyM¸´‰XÖ­EÌcûEsE1#c£—áJ<žëc©ù'Í7¶^bÓ/´¿1ßEnWM½Óï`¼oH’Gãrïò ÇɃÕÅh1 lĵMßX²¹ý5mjÒ­¥—H›S°µ¶S鸑%ŽEGzÔÇR¿<Ùöd0᡹v‘”æ=i‡ç.³šg™u›;xã¶½– M l¦{›9z;Ëm)™3É+¸­;gQØqÁ“´qœ§Ógþ“Õú.Ҍ᥇3³ѵ-oHó_å¿–ì幄yOFvºiI õ«àÒ;ª‚I‘‘¸Z3 íívŸù#S©€L„GnœcôIÕvv› ×áøŒaÄ}ä_è{ƽuyuªÚX=«ZXEmssy¨©’ ’B´ é5"+n[ï¾xìõ9xb(s®Ol1DØîðsòÿϾbòÅô^KÖ%Ò´Ï­_^yªÝ® ž{LF÷Rx¸¤B5¨¨b7én—,qÆ6' 8&[ÃÒôâÔ¼£.‡í¶k¨'˜5u¯EgºBµµ­½m¸­dÝ”˜·Q¹e=©­êºLS$Óë¿Ëù¼§gùo­^ùªîãHÕu[‡½7·úMËiüç<¾˜€` òX"6™aÃ#vñß+ØÇ£]ëg°„ê7q{«Ye™¥·Ó!)g²ÊÒ׎Ù!s¢0Ù-®™©èß–NòüÐÝÉ®ùžån5t¿w’æ 5)žòãÕ'uôƒq§Aá™ÓŒ=A¦$Eœy—Ëö·þ]k-u`ú— b[‚82¼@BhTŽÄfª§0 òÙ–MLa ‘æùoÍšF­ä} N“É„¾ok©%…Üîv¶ý¾*«Ôw5 øga¤—k`¿Fqî×ļn¦=™žT ¡.ø{åÊÖüÓò¼ºÿž¼¡èçEòÝö­lö÷š†¡õ‡µ„Ím0TfØ9QE®aõ±i§#“M~Cõ;}—“P# Z™J>ó;I)€ó üŸ×µ"†ïÍ·6ö²Ùü/ma§éÑ}rãÐ *ǹMÍØ òýoh~kCÅB#ÈR4Ý-7ip l9›ê_zú¾¡¬ëÚ÷˜.L𖩬êwÓÇ#)õ»™$U'½€Ï9ÌA;>©„N%“[•µhžfõ‘¾#áóÛ)á ‘<<“Øà2̬ ¹yìÌRV_OsñTfNÎÈ93ìrvyã~y~~ùzi£ó¿äÞæ´¥eÕ4»[åˆý¿WK—ЯŠòÊŒÀ‘›®ÙçåŸüåO‘´»«¸õŸ#yëÊ·WäIyéÛÛkð †Õª¥•×6¡SLÁ†–8¥vÛñžÝ«yóÈ>}7šG¼ª—0Ê’Ëe«;h×Î:p1j(ª=Ç,¯U¥É?Tf-¸°À}{²9|—¦ùïQ6šç—­ï|œ-CIqm _[‹QXÊnìšDPÁGÃÊ›d1xП ¹6åà =Ùù"¡ù^-2ÒûJ´(élÀ°€Æ8ÂÑŠŠ+Jžƒ õ&9hæ>\¦œþ•Ú~—åmKÍÚþ«¤F·…”öZ…ÌHSƒ •Z TÔö¥2#V2iÎI€—.œÿ`G…(dd*G`z÷2GOÔ4y.’õ›o*K¦I4Tå30ŸÐš.absBí×'‹;X¶Ü¹ÅáÙî^[üÙ·°òå¨Ôü§®è/è:Z›V‹T†k{Vô¦¹ˆ"FÆ$rªåNپǗŒÜàO¢y¾5üÐÔü¥kæO=ùÃ[¾ŽþÏ\›OÓ´k;dŒÊ¶èò†’)5L²31?fƒ5}¨`$í;7K“S>ÉñÏ–ÿ/nõO9Ü7—¿3uk X73ê^]•¤%])ÈÁ"”w€ÌM¸äýÝþ°í.É––Ê“Óe‡´tú-?Å–CŸQ÷}î7ff×jÊkNé•¿(5»›mGÏÞ|¿º´óeì/…¤Y\HévÌUQʆCÖ¬+òÍF^ÛÖ x†r$oÏìw;3G?ÜÂáï§¡~@yëYò¦¢yóÏÁlü³åíSYò·žµˆ×ŠÝX=Ÿ'¹ž 8«´TduødàÝÆoðf‡khå2z+oŽî“”öF¶†øæw=ÝßkäoÈï=ÁªÛy‹P¶”Ú蟕~LÔ¢±žU1r¾×¯~«ndì³Zú•Ù§ÕjHÑxdr%ê´z!.ÑI¾-¾[¼ËQ{«îT¹a0,jImùW8èâž¾guU[…CÅâïÚ„nFMƒ)Óf3ÅQ/«,cÔUi”nH  ²Lj¼½NcÒÓØïü1M¿ÿÖùíõV{xC§)L€=ãµ>YÌGi zhƒL—HZZw惷S\ú­»@iñÅcæý P.cá%ͳò @“ǽIÿ)7‰ž0ÔY;:®×ÄgŠÃÜ­5 ż±DÒå jB¯jíÈŠøgkÇv"ò\;nú7y>úÚ8ä–K&,%Ê2i¹,¼ÒŸ<ˆ†à±0—NL¯OÓô­EérCb¬ö®’°Ã*šþ\œ~¨Ùôk'D‰x¤=7R÷ò¸Ê@òe°ä—?–X¨ŽýÈ«F¨Õ5?hÖ€ž™ts‘ÍŒäX¦¥ùo¢ëHÐë%–«©ÿM…%¥zÑœ–俱ɔ}<žW«Î1~Yê)*GåùôiÔÉa;ÇJÿ’ìéøf4ôšyì[³4vbúoüã&µå{èùó SòíÄKXÙ^[IT{Í`ñ±úAʲvoP[a®”¹³‹KŸùÊ ÒÖ-|ùek´cT·±Ôf)µ@’d†çþœÂ–Žq²A.V<Ñ;Þìž?Î=GJµ›MóŸåuƘ×JVòóE¹žÓ’¿Âßè÷‰s4?Î=³Zps‰äG0ïe¾Müéüªòþœöv¾eÔ|»lÄú6šöŽâ(è: %®TÔ÷h×ß1ôÚlx¬]Yµ[ó÷—üÉ£µ¤º{húMý‘½—îXQ]¡ºTiPR†½3g*ô˜ÑÕõ¿$i®£øÂÞæeGt´ÕRH–I¥&³ %æ+JòÌ FŒÏ›<:™aú ¤þTÙù{PƒSò7 ÌÖóG8¸o¬£z¡Wj×»Âü§…ê7*]¥“,x&vGÞyG¿½Ò<¯=ÛKRÿrbÍ4!b_E¹aİ4Û¨ëÓ2´³8Ǩî\ ÛòMüÕåû_,èzæ©tnbì×êÈ:ô l+]©Üæd‹ȸøÄ„ù<ñ òí·•¿%/uÙlµ¿=^j:¼Vò1‘^ÚÁŽœàUK¨øºþÎSùÃDw¦ï„É”~bù£NÑ´ûktŽYÝîmí Ä• -Ãq^G î~C&Ë(Æ÷°Ó‡á2­žC¨Ûéº×—õ/(êv—‘ùk[ž)õ{M*þK–H]¤B=Už0Hõ7 Tìs¨")Ä£ŽÁ|Óçý3ËXÓ&òƒk|ÑùŠú2ù›P›ê‹!·Ñb‘,-Œvâ5“Ôžà´‡ˆ­:f³XFž'Í9å–PŹy|Oqs ÔѨ¹™ÛÕP €XÐlÃj æ:’öZ3á‰Î“IÄ’-Èão-$Zü;n7÷ÈnJi¦J±?¦X¬ý×òï‰ 6‚ô¹ÞË—û´B%¯Áéõ¯Ë1kÕ~l¬?ÿ×ð|"XQĪY†Ü@èTщú3—™² Õ ƒ#ÐÂÈÁ9UÚQÇn•öÊòŸNÍøˆä{’0ihæàKöÄÑO@ÛŠý=²ý<¸wÜ|˜ø¢bUtQt‚ÜE©Ý[«·ïÔ,¶ÏÈwéLÏ:ÜÐ7{¸‡A‚]§é nÚháZÞ#±ô¹!ˆ]þÒwú3;IÛÙ`}BÜ\…Š[Ù —αZHïOº¶xêVKb²µ¯Ä=6ú3k‹·0Ìõù~×[—±r° óHüÖ¸ktŽÛÍÃeµ½$ ú ])ð'68õ¸'üNº]Ÿ–pôËÌËà Ýé¶×p š{v¡ï·©&¿Ë™&8åȇxÈæÖ™ù ÈŒ'kË#Ãà@“¡#­^6Ÿìr> ½˜š¶Oc®hº§-¯´ë¦+¼k:Å(=¿u0ûrÄc¹k£"ËÞÔ¨£Á#ÛB»}#+8æ:£d]¶ ²‘Fj€ðÇŠ¹²Œ…ì›þŠG*Kʧ¬OB­àjŠ}A€'pÚ%L+Xü¯òF¬Óü¯`å–¦H¢ôò’‡!-&9›!Nb9ƒy¯þq[ÈÛ³YKw¥ÎO$fôî#FñRÊ$ðXŽÎ‰äQùɘr~MÿÎGy]?-¿9uÓ»irßÌTSìÿ£Þ­Ì ¯§Ú½Ž¤åVÓ$D¹¬'%“±spqÀ yh·§úfD|ÎÃæõï%ÿÎNþOy“T¶óö“¯éŤ^ŒÓòƒQ{^ì‹[…©}9Íêtâ=@ƒîvQ©€bAÍíZ§æoåçœ4ϪÁç %¢ÔŠZj¦M1Ë­ܪÅZvæ~y~( š†îFœFÍ¡4ïË©uI´}r徿—­„:UÝ¡†êÒÞ3VP’Y´‘)%‰= ;審ÄÉÁ# mço%Ãg©é72_=Ì1^µñ‚Y˜Ì±”BÈh>Ûm¶U¤ÓHêDºy8pð„¤ŸŽ žCqOmó²=¹:k>§Ãß™1jzŸæÖ¾×H4«Hì¬m—~E´ŽàôøŽÞ9Æv®§ÄÈb:=—f`â$E‚…[‰¦ÄÄ,« ”:÷¯½3P%Þí ŒÏ*îMã•æxÖYI]ƒmµ)^¹%¤e”Kõ¨êÀz£÷`Ÿ €2õrAÙ”›-Ñ=_‹Ðf#oµÍ{øàà5KÄÿÐðÊZQȽdS¾ÆJ×9WªM´®VwÁJ’B*Fàdf,6bæŠÖÈ‘äQVR¿¼nå—qúòÜb‘‘'Ñ—œî©Cûï³M‚šú²ÌÓ¶¨sf7¼7ÊÌÞy\Æ€vp+O¿)„œ‰rAêÛ%’Xù™cøXŸÚ¦àîrÛšòqÄ¢ü» ¥Å” üŽË*·Ù#†» „¨r%œÜ1­{Iú†­ËM¸›O7äöÒ¼AˆT*£îÌüZœ‘‹…—GŽgp‡Só=‡©:«_ˆŒ|bº%ø <ÆÿMs?mfÆ(Ž/>Nû' ™˜ó¯l#iôˆ®à‡•­ç*ÇßÒwÿ‘™h¨ïïýŽ$û_ÃÉ7Ó¿7mô °wPòâºQ\ a€®Ãr…áï›hv–¼Lû7$7!ëúçª}/«Ýéž`€ ¬¼QÞ”í$®Ï3#Š9‡&3¸z~›ùÑî–ÿI¹ˆ±ýóA2\(mÆ9môÄ黋M_&{¦~fycT$>£«9ã_+[’»nK€Ö»r9\°J; Å‘ÃèÞ£ImÆê7? ¶¬·ÇÀ4d¿#ÂCYŽèûkKsª’$S´O±1¹ûðnƒT§>m¨¡·¼·[˜¨F)ÿ$Š}Á̼̘M‡_ŸAƒ>ÙÇôô|ïùƒÿ8ß¡yŠàêzE¹µÖânVÚ„9ùíÓ1Àn¤Tt„ˆãbbO¾Ûø{â‚AÊHÇ#©5-h)_ Œ$Ç d~­¯ßX^ F¯+Óæ2Î&<;?ÿÑðú7W•ø“`GzW®s!ê‘ÖlRkr z­îOƒR¹ P4Y³H‘²ÕÌ€±?å.Ùä1-1½+÷â´‰‚ƒN»‘SôfNH-ÅŒ3ëŠ)nÛÔDeT\öoÃ1€§/šA©HÀÄáy¢‘U¥A%kR=ŽØ@݌ūùl«\ÜÙÊÁR£c¸è0ä;&<•|Ï ˜¬n£CANOàz~ìž,—±cR]oq4o5Œe)JÓpkôeüdF‹Ez­žZN·:m&@䯑¸îÌYO‡“•ÅÕ‰^èš}ÜsÛ‚mØ—ãSµ$¥¯¸Ìèwåîqò0|³±Ãp±#¼5ZQÃÐ2îÈæ@œÆñ‘¿{ŽqBCp›ñ>žÑÇa®j#Ó„rwüÅÀfÿ‡v.ÓÔc<Ë>ÎÃ>”É×Î^i°EV:ªÆipk%¤ŒGÚ+OQ:S ¦laí ã¶@ÁÂËØp?A?œéÿšº}»‡¾Óµmãj­Â§ÖcCüÂKsÍ~”°ÅÛ:y)uÙ{#(5oaЛ<7i€Ö¤¢ &äõÛå›­'oâÏ. ÝV«°òb;Aòç王¦Ý=µ—æ!Ó’iZ(¿HI5¬RPÒo¢A¥zÐæÀj±eƒ«É¡Ël½_×7»A5µô­s,öKƒœ„’ãП$»æN09C`Æqw’þcê)õ»+Q8`‘ê»r~ïõç½£Éè®»;îÂÇg‰à^f³”ZÛÜýEk]ª)Ûlä4ò©=FP(%ÖŽòÛH8‚ËQ”<‚NþÙi7&©&Vp©2QhÕ&YËl2Û’-;´/È©t'·>ƒ1òÛ½½B¼“±"Ÿµ¸†We=_ÿÓñ5ä Â,N\ ¤'ÚµËQz§Hg‰ ÿºä*áHëN›ä 7RI/w§CU X :mñ‘ËÌ7Lø2Okvz,«·†dG“I!éZ<¯wÆZ¯nÊb#¥w;æ,þ¢ä@Š ÛÍ­ÙM½IDƒæw?‰È©ä“†>ªHˆy,¼«ìv#æ)†<ÚÙUЊuž §ý&Ü}Å+¿ã†2¢Øw0?Fv‚d)É–‚½Û‰§êËL¬¸ädºß¿k`Bó]cð|Ž@œeªAÀÊ%þF5ïJÐW*;òl,#QZHò øx¡Ï^L)¶_¥hÉV¹T$HL|i¾K+ŒEÀÉ ÙñqQ_¤eY ¶§w# ´gƒ4ç· +€dÙN;+lo/ãø¡™¸9åBjvÜÐo\ÌÜsˆw³MÍZÞÄòÀdEj8 Æ££W$u"ËW‚;Þ‹§Üy7PšXõKI+ÆA]ÁäY|E2ØdÅ>h&QäÄ<Éäÿ,\i·)¦êÇAŠì”¹µ†—W7ªžHà°ôáèÄ~×r›‹O‡ÐáfÉ9LJ\é‰é?•šî·c=Í–™-þ”èM³|1<Á>Ѥ¼‰ …21ÒúËtµy &©ä{¯,:]þмòÌÎVqfd±’­ñ«lÑ+ޤ„õsÁ?݆¸èãŸûÅ.oá·mKU¹Ô&#×d4¡˜"W¯R+îsWªžy'3žME ©éü´öŠ8úhÄ Øž`D‹rä 0ÛdFPbs)P ³‹‰=iã™!¤"Õ9àx‰o‹+°âj½;×l*¶Õš9åÜzªÌcqÇmÆVPŽúºzþ—!ËŸ2;רü2)ÿÔñ®¡Õ¤Y$ÈëÈÜ«ýs›ި쬫Æ?ÞR#ûµ_q¸§Ñ‚é”S­5Æ›$!¸†‰Š/pÁO åyy†q6 ¾·‘ÚBM#F¯½@Û- <—y~A± ‚„¨;Ó¥~ì¢|Én€°¢â–»zDËÆCd-™ä“Ý–Z˜ÀJ‡Üý­¾Œ²#v¢-“éì³Cm+GÈH« ‰Ý”Šþ^Hm²›"·¾šPá›Ó‰M~OS¿jí’{‚³?SÔ¡nAÄ ÅéÒ‡b?Ž^wˆ-b˵˜™ÒÚ•®èÍí×§1ã³q;1K«7R¨õx˜%iÔï–ÆBÐ`B.S=å»È¡ùÀ£°Ÿ~\IõŠ*BÉÎ¥GÆON¿W"-´\ò¬• è´eä÷úr¢`‘¤´•~¶Ý€í“ F%X !§ÃV%ÈêAgDa»$WSÜ¡¨pôïÒ™Iœ­¶1¤‡Z€4ZHWÖyJ\€v~Ônätñ̬ò]M9ñDîy¾€ü¤:Î¥i<×ÚœÍcn(ùHÿ QðÕ Û7LŽî«.jôÉžùäèÚ–u™P»º·dµ{†–AV¡ Vص{eºŒÀFè#OHó|ƒeWw²¡ˆG¨^ª~7G5©ëïœþqr·kc±GK0Ë¿¨ñ0V'nUÇ1ú¹DØyœé݆© –Ư )·µs"ÙÆ<ÖK ˆ‹Ç‘õ$Óì•b$;ˆ§øcå †~£Øÿ ªí‰4™ú&¿ZõVž9ÆßÃ#lŸÿÕñ®¯O^O_•yÃÃåû9ÎÓÕMQ~ÊV´ßÒ¯Jÿµ•K›(òd~]è¾xúmËÿ*þ½«Ô¸ú×^=M©Ç§,œ)Œí½#Ôõ,«_F£—.ŸM;aÉIÇoG_CëMZÿri_³ÆŸssn<˜Åÿ?†´ô}QÂyq?†dC››ùg—Ô—ÖûU>Ÿ.¼¨~Ïу7DãêÔ~¯úTW•iÚëÏn?†B?KÇÇÖÔë_µðø×/Hj<ÙöÿVƒë<½NIê×ùë˜íŸÂ—ŸWæ+áûêxa6étb2z^OC?о¡¯ð̨òqeÍ=NTOO…yü¿†Q.m±ä´ôN^;rû5©­=ð%Dý¤çöëðÿ«]ð¡bý¿Þ֜ǧNµíŠ %¶ô}5õ¹úþ¨çN”ÈÉ1µMOÒô£¯O_·Ozåºkñ<˜eºÝô’ÿÄÿUÒã¾¥é¯ú¼iJíË¿,èÒ)ÕˆÔ?9þ½êèþ§£ÇêrzßWåézœÏWo³×1ûKèäéx_0éÿ[ý%oéwÍzõôhi\Õdúór6EqO­MÇ)þcß1›Ç'™ßóúÕǧöýO‚¾í–C“Iæ¨Ôªòå×àðé½rà„%ǧèÅëW®ôéN&¿Ž0¦GÓ?þîþïé§?é‘ÚÙôÿÙntp-4.2.6p5/html/pic/pd_om006.gif0000644000175000017500000004050010017034537015342 0ustar peterpeterGIF89a¤dÕÿ‘wh×½­\J-ˆgVƨ—H2,µ”„¬Œkºœ‹—’¸±¬ÒÌËsmh2+*vVCPHB­”†àǸ‚m!l…±½½ÁëÚΛ„kodU·¥ŸÍµ¢žƒ,÷ïí/EöçÞ4'ÖµsÒÖëÆœ‹ÚëûªƒSak˜$URW“¹î71C1BnsW“½ÿÿÿ¥„r­Œ{B;>{g œœ²œrâÞ⌊Xƒ€„Z^BÇ¥ƒœZBÞçÞÄ™4àˆPÿÿÿ!ÿ ADOBE:IR1.0Þí!ù?,¤dÿ@—ÐȤrÉl:ŸP$Ê6ڊǪ ‰©âާZÁFÏè´ZI.¢Cöz¹‰ † q"†xw"0Œ’Ž0‘mœ |":y{¦˜‰sx/3 , ˜/•/rxsx0 m‘urv´{˜ Ï,½/ÑÔÓ0,,3 /ÚÜ3"º/ØÚ,3353,/Ùô3ÑÜÛ/Ì«G ßŒ*Ö(\ÈðH-Cd©rD! ÀŒèCà £äaCC¯L“PBÄi£:ÄæDˆ0#B†©2pŠo¦ÿw4èØD,€ ùêH’àˆQ„SŒÜH àÆUª6/dÈG A>7Ïh"HH—gTÂbqa³´s^Ô˜Ö ¿:3Ÿ9Þ`Ìà“÷¤¥ê¸Op?[³f`xGÀƒÈÔøÕ˜UE3!C‡vÀñ³-GpTq`DÆF!¬M;ôÙB+X„ w†¨ ±d(ªzöSi³nR50¡bTˆ•ÎʉJÇ×@¸CQ5 NO‚B»t¸ Ø*ƒzWx6“<Û«Àá´5@AÏŒáPÇ-/´1Ãý™§‰1‚9ƒ?,\Æ lÁcÇ<ïX³Y@ˆ#ÿgôDøt#˜-ý˜VÛŠ ÑPE1¸8DF 6€kC|a„Œ.ØÀÚ äÈâk$’J!¡ìbˆx‚¡Œe)xà@ L*:\Ù‰'"G"•¤BJ—T9å† üV€z’h6Á$PC$¢TC̰P‰LÐòˤ¤EŸ.çí¡Ws¬3 ô7ÌÌÀ“‡8@s 3”™¥¸³7}0&Ž‡Î¢Mã4p¶4¢€*ië¯)pD.Ðð£<ÒhÄE.èxl·&ëD\üÁP #TÑTÀäƒci0ås¹iQúù¦dý‘ÿˆ¡ÐTåL±™ˆK3ñ9ÌndEÇNº½Ëˆš¹y‡WÍÐщ:ì7 pÔQ ½ÔTà:4á‡GØâˆtL“@=Ý`€Ñ&¡- Í D 7ò#ëˆA?.!ÃÍ20±3=3á@ 9;±sÑLT¡kk Z Cpô±BÐPÑ («µ5@òl³žT¥S“:H`ˆ¶ T À¶9L ˆ†ÂæNÎòÜ•ÿ&’ …\¨#ì̤œMM0 3ÂÏ - ƒJÂÀå qÓIZ™43±#©>Å1Å\Í+³£Ma§r Ã\¡óBþM³2œv ÿk7Œ! ¼*P7ð4ƒ¬µ*CUp€ÃÔÄP 9}SDmìÏÃÆ0¯Äk.H”4EÙ»°ôĆo„jB °õûFrˆ Áœ¸ÉQÃ"[¹ÑÁ# B‚ ˜ À â%jà:’ó–‘ a”Ä­©oŒ¸_%D¡·y¢ fº‰'0QÌ'&)IèÎbBLh‚3 ¶95‘Ô0’ ’À®ã †60¡ ’ü¥0Y=¼q NMcx¡Eð0œ˜äh¤Pí!ñÈÀ¨1€GUÈÀdƒ6 © È«‚ –§„2VÿAX;ÒB0#øÁok"@ _D®$h€ °øŒ@G&8 ¶0pƒmh  ¼»·xâFºÒnþ §¸ a:±‰Þˆ—T<çNqêÅ D @DââÊÅ,…¡‹gìrm ƒW"À©8ƒ>xèT 8æ)†% Sr]:´(¾ cõÐÆla‹WõP °ƒ ¯ÉÀ^4äJ‘š;‡ x Aj@õÊ'ÆòõÈ.¨€ Æ_!A ésAÑæÉ/úñ}q˜Aq±@ð‡LOÂIÀ=bÁjp_Eò€ X[ !¸="ÿ ›qävÍâd &„ÊJšåª¤‡-¾¼'’è­H¥]zFèê„–ˆ€&ÚÌO""9mþ“èT%x9_°€–ÍèÔ9ž)Äl`‚€Ä9 ³;&F±!H…%È bĤá@bàW½Ö‚-B^éz£!ØÀå³AÏøú4&ÏŒ¥‚»Øämñ¡·" [¸Á(xjVV4Ð h œÙyÀDÚ d &È€NÀÄà€Ùº1E€¯Dì ¶8&ëÐ'¼ô‡à[&Ø¡‡u¼ƒcùÔ;H¾ˆ€1í<ФÓÿ& R«0_Ð"YR‰2&'ɨÕï4úD?J†w ¸Lf”­n¨*ð€AmÝzÎ$8àGåËû„€ÖLmÂŲ0(Ù!°†²ØëãÏn¢¥&³b̬Ôˆð "ðh‡T /½ÃÔ(['Ø”ŒÀ$ÐBðXÜÈ2ÀLP Àm¶&i‡ØÏ$Ñ"\Ö+‚•þ"&(®»ô/o9)aÁy“âÎC¨ç˜÷²L@ÂÜ®9ìD ÛT—CUbTƒ€pØI®#3×I‚»" mfˆ‰{èT85ºl ¤ÁR ?ÚN»ï°ZÈÀ§ÿÇH† Tà5‰°(KP/´X Ág¬:5 ¼|+žq²ˆ¡Oˆ«sVóh%ñ‚ÖŽà?àh"Ð< 9g `9 >ä 8@`¶3 X@ðÐ(ö•%e€„ƒY4ׄ’M€'.syÓy¦d¶PÈIÒqÃPˆqÓáˆ" Êô1Lö N1c½¼ML!Vÿ¸µ³œ…°‰Õv§µqL· dX_C„ᱦäùBùbdA åvÅ@Bݼ¸#Fhµ Ô(s- M×µ9käî°^=ª^àÈ'ZP‚Ú@W20Îpv£1Šo'ø~ÿ† |h@‚Ë7µÔ(¡È[*\¡8©sØ×¹«9¸)ÏxUò–Jõ"’p´QHÕƒ×5™*ªÛ†oô'¡Š†T„øÄ~ôÉQ‰†3 ZNcð¢C0§üßš)¡½Bˆó rÄMõ±N²Š‹5¯¼y0¯HEú…Pwz,Ž£ë[Ðͽ6NŠÀqC„ÅYtÈO€d€bt€ õ)²g2ˆNŒ é4ÍàN5ЀØÅ¤Ë]j3¨0›ž…¢­TEÀ,Ua\5v¤Ðe…à,çV-ص d".½6 õpÿ¢3î0áö º` ½àüQC;”*á@-„wMyA0À3WD°ÂÇr·‡a>çÓN°FOdÔªV{Üs#8„BX2 H×£OB¢A“>=rG€„v|C‚Þ• ð&Þ  ,ÐóÐ2`,€@AÓ àÜ74àÇ4r.°&8)à}"' 3I`z…’$}p …°Ý {w°kB ƒa$XxC ´ ’Bç•ÙÀÌ¥ 00<ñUd÷’ªðá óhŽ¡ ûAi°#"qyÑ)ïÐÿ}2˜æj>ˆ,í”RÄ÷ƒ`Œ7ÂW¤áa»’338ƒK€ñ45Pø‚6$UàU\¤YRÈ".Qˆ‹PtÄô90~àðð40u*Ð3€ `dX@„10( X30Ù &€m pR8°Ú¢-ÃAAp‡…H :ðÁ@Bœù0ÄÀˆpZ©¤ €à¼vB¶“b!ŸX á‘r194‘;jzt€ ³°Œ‘ŒÔpù€2©3¶P4 „BX#C`5ÑGÂ'F/Fë$P¹”ÃØ+Fðe{}ÄdĶ5T#G sÿV#|½Ò31>2Ž ás€7@!½!.mÑ6+¸€d& ( }P*ÐñEÀG0F uwø& i¾"ð&¶N4vÚ–wfLÒ@Íç:UI‰m ‰G ô€‡]< q ŠÑ‹Á;ÛÀK(i'ça2P´ßp£SœÂB9òP Ñp“`È›qxJ1{W©Wà#Pd䆟qÞ©EùtG\IŒ«·­§Ÿ–pk¿§b7—¡¡ý£700ÍR +X†¸0 Ð`‚)¬!~8ã à€!€ÿ®Á,P)ÐpùTΖO2P% v¤-7ÀIqcˆ †Ó HŽ  ’'HBqIyp'n_a@OE9"pgáJC÷.‚A æAK³ÝE¶0:²(Ò ÓeóÀå´×ÄMáà‚1žZð,gYVyF¥a5yÕrœæ¦,ç3é)çÞhä>c™¦ò¹"ÿr?ë5€>Á_ظÅ&`sŒñú`R×3išO€©JF‡`52ç1°1 2P˜(Ð °Ú+€† mp3‹pI—PBf£wõ" 6‘SÿýÑ upIs¶SâÒ${àù¤ØÐó x€(ªówÕp tgy<¸ ]0A &#©b2€pd¦Я„Qóze›{Že|ÕsO 05ÑØ•Màb¸f£¦”CðUÃ4à“©Ÿµ§ ñ%è §õ1,N°Qúˆõ´¡öªúŒŠY·¡_õ 9uE€p€((З¬ù1ª`G¹N@ \9°™rIfcˇvD™rõ"BµØ,úf¦ùLStÛqCØ¡Ò)Î`ã&Lz``¤7L¡ "ÿƒ§ãÔKV5€<ó?ós­q3r X&¶";„&?ó–‚P € ‚`0æP¥¡j¨dØó”J·p&àa–C`PŠ    *PP2 ,`V#À¡З à(P @P'€6Ðj#}ûCVæ@å&?* s%ùc ÀñIØ!.ƒQàuKS-‘ y‚± Ù19¿€güq½×¤$ 8d•q—MV‚qÛ¾îëGy`Ù«,¤Šêx®1°ð§u©}Dcù„²Îf²4À±bÀÐíD €ÿ}9³2p*€' Pa!êQÇ¡([yÔ¶6R†@ãä7‡ð,‡ 7FaK~V‚°RF‘C„ÂA®t…9‰æ! ¢€— ¡£ ¿ø¬ÿALÂޱqÑ!¸yÕ *ïÅRL$¡à-˜!'± Äp&0Yª1p€˜ŠË}Š{$¡ZbièÒ÷` à¸É@xì>¬ÑÀª#P€à0°p# ©¤±ÈÀ/€œ™7À8Þ2‘qÓ¡’{ók×! nà™RQAK¾€ `‘9"p|D, ^­“¾ø ÿScõÐ;ü€‡‹Äó` S|ÌÈ Ù Ä #'Ù»‚gù#`{Û9ÀVbâêl 0ut˜~Z©­±%@tD~iO%°ú˜p z ÀbU§¨w¨dšö°î×”q“üã œ &á î1 hñTðŸ< õü¯°L¯l7Ô²Lqñ’³Ã ý ÏD Ñ@£" œÌ,ÝÒg:Q\Fò0)ÐK§ih'°‘š–)€¹`WÀ&kâÊ ƒ&`ÎH/  ' : +s +è+p4Ss(`‡@ÿ`4ÀÇ P‘4v˜ì'—Ä¡`0Ä@f’ ³°‘c‚(%!Kj‘½ËD›¥ t½!" { r‘¡¢“Cnr5 ` .}Ù˜­]¡¼v7fÐ3Ñ(#`~l,²-f€HMXʲ)›ŒÿX,B!0¬ýÔpP©{è>–ûh’Ú¤Æ'p 'ˆ.Ï£‡ઓÔÒRÐY‹wõ³^Y¡v󬸤mV?…ÀwÈÀ¡†då ¢0 Ï) S ,Y ï8 qá ÕÙþÙœpe¶I/aUg( ‡–{#uÕNÿ7òÿXba§¸–™Œ"³˜„)@=Ò³6ð‹| 9`U@pepAÉ•KNà6p+°tX·‡ ,d¸5®š-ÂIÄ›Mòmeâ ‡H÷)¿@×$ÁÊ—RØPp¥2tI’ÄduM1§˜ÙðßfÎÒ¥óÒÝ%g ˆûØ—a `sÌ}¹¡ëÔ– ª[ɵ !ª“<%vðºRÇâ  [.Иç:¹sÐ* ™¹yb»¥‡€ 0Üg `²'[êØ¦8JU²^7 ‰ó˜ ø-ÿ¥†³Å¹¨¼” 0s¶ÚÐKâ1y!Æð1áû‹upæÎ>Å]n Þò  ‚04 Ž“;&þ2ð㧨§WÉ(7.‘^瀅u3°Ncy¡»5bùø© pn£„ÝùxàÀ+€<ŽŠz‡ps` y7p/øb’Su,±P * ÿ"S)pÚ€®uå"LGñsˆ'€³®…B º°È*€ Ya ð…ù zÕR àS )}%®t) rM£ðx¸!HuÍ\¢# ´igÊù80÷V« HQC :Ÿú{Zc ›K3Á)¯UW¬a=?rHŸ̓2õYTÁ’1õ´r4€ç`0ÜÑýº©‹¯´k 0eïpèú@)€Ï/ ï`èF³}©² ª ³Ð@ pIï¯ ®“{ïWIÙ¥¿‘DB“°ë™Õ¯‚)ˆ`ÿ0&€…@Da/ÖÌ{x]D/€sva±`‘×,Ì„ðyýžß÷ÿ  4`4„t44’."" ðN0TbdL *>0*2&ò*BdJ\jp">ðd0 Þ\^N: :>>b>lhn>pÆ6Q0bFFNB\\$@4Â?N &6&:Ú>p<<$$D<,<ÀåBƒ9rÀpáÅ ê‰t@‚ 8‚’,.Ì@€N– ¾h@€E‘“sÌxfF” ZdFˆãDQOŸ?:Ô'‘„d0R €/Pì’ÿ! jphðL L°ˆAÀÀçÌâ0‡‚<ÈpB€ 60h¡„ïÄ0A@8T6Ñn˜=ðàÂâ2BdžuÔM ËÃC XxОüƦ¦·à „7œŒ ICÞØt2Aî( D I`f†œš DšyAàÁƒ,§ÓÐñ™ˆ†?ž|ù¡ !³É slx×À ˆ 8±` pÀ…lpàµ:8áN†Ùㄦ¢Jà…øê€CÐÐ Àƒ Pp † Th0ÿc0Œƒptpd@A‚6 † BÃ@5 ,€ˆ)<€H h0¿Lh€†ÀÀ º¡ @ÒAF(Á‚t8©€jÒAŽ(Xxå(ÑB NŒõš@á™Ú¬Ì TÐA Ï#² B‘Ö ª`a‡DÁö0 À`hµY8€¾4‘†xƒN Ȇ x:† 0 WŠŒac@‚òøàe2˜Å‚ÐR˜a&€}ˆ Èš!ã¶ã HÚ—ÐA¦>nÝõ׉²È‘2Š  ÖÀ¸ô›JAûvfkç«ÿ h`dà‡< Ð08UmXJ¹ j0hë¬^ƒà‚dxG_\‘…20! P Á† n` † 7¹¡† €ï©Hpp \ø‡Û<  x@3ø› t0àöš  ®è"ôÀ%Êá tÀ"!š4P¦õPB=KÀ £CÒDÀ„9Ìp €À";!‘ˆ‚Ð ,â’í¨º¨OUˆÁ‚vÈ@1ˆCHNh™›‡õ†–38XX@Ë5 1‰jpº".“™D4 äP' †ÀÀñð0ƒ²PÅ*2°Ê ª3Ä‹*0»ƒM9€4 •\ô"À.veXÅŠùª@$}u@ŽÀk>€yÈ8A4€¾pHÀ3:°gzà™ƒj(€.©I‘Øü9A £êA )h  Á° 8"p  ‚`:Âa ÿö´œ!DÀr0øt˜ <‡Ð)-g†¥*Á Í´êU;6¦˜¡ °æ :á2b@ŠeÞìf`ŠW5˜³ZÜ¢7‹…H`‡Yådz¼CâDŒ R7 ô¬‘è¬vÎ×kðÃA­:3m©Š| P}x@]À@N—‘z9`> ((.Tñf ºy) ³jh­xˉE ÉÀÞt‹ˆ‘£ˆž4ÈÑËÜÚÿf@€4h@Ï.ÁN‡² U·àš À3ŠÍ^•‡ Ã1x] d lD8fáxà ŽH‚“œ,%ˆ#‚ €Ä;MPNG¤ 84,ª¸€å˜àÂJˆÁ¹E62Pnò‚àä@NHÐÝ·Ä—B'¸b‹rTä¼l…Ç_‰·V-&†½ÛEA ¢B\@]h%ÞËü2Nx¨ (ðO<—ƒ $¤1Pä0µ¬ ¡¹náöR%lÇãK;•I€sÑÙ\@èbF6pˆÂ! Pb""X2u3áÓ¹Ã`=“$ÿœÁ;pCCÀƒ™×½.Ä Ô”„¢²$¹WÔ6ãÂ]sV?}m dÀ  9Zë—³ˆß+Æ. ™ 6ø<xó.0KŒ9Íin-âÇÙð/2€l ÁJ# ppèu°H E §AÖ¸8fŠ*ð@*`@Šî• ÑÓO8 „I@¸±eD™2‚å÷ ¨ËÀã‚$¤Aaf`tžŒøšå-çƒf­q+4Ìpúi‡Cw± jØ Ú•§P à¼p@üÂùes«Ó€€.`@€þ†ŠH÷_NáeýŠT´ ÍŒ6X ^‡¾7 ¼x ÿ8 ˆ"—ï¶#1'ÈÁÜŽdào_sÕ"6 fžxÁÇ5‰'Ð’¦:µÈF0„35$Ê™ (aÂaZ‚aútùçYÞ”^¢vKyK“€Çè©Ä E4PÀ^¸m•Ä£9 Ðë©ñWÄXÑŠq9è^à-Ge¼Ä»òñ­øætWèÊX6 „Ðü™ßc—ÏfÎÙ¡j‰œêu‡LŠiwÀ± ˆ€N€ Ì@1PÀ\¨Í‚^ä@Eä ëDQ" t r1G  ¦ÀsÞà dôרÿÅ^P!ÙÞ›ìã>PÀp -Üê,Eú Ú^O8ÿ ¶ìõªè]RdBêƒ.à+¬Âêšïê¸Îø`¦BƒCà"Ô! þeX`ähjÀì& Tàü"<àD£/²«Ý<Àã5L€ï`yBMFൢaXâi.„Xâ ÿ4N×¢Àršc96'¹À` œ@ ¤`” ^`õй8¢tC&pàr ¶k»ˆ‹Í›C ç VAæ©ç -¨ T€J༬ˆB箩‚è]²N­ÎËœÎ銼¾+ëÃ,&À4 J`Öa‘8pаìn€ÚDÁCLë §ìEôFÒ`mÞRÿ  ã"À^ ‚ÜdlÆ :°ñ Òc¨2â=øD'`N|l&"T­t¾Är‚hÝѪ® 0$ ` €X¬b¦".´Ë¬¦h*Ž.ž'ŸGcŠÀ¿²«Š €* @8@ŽL ÀRš/»¬ËÞÌ/8ÄŠã" Ï ÊD‚ÐD ( €ÇNp   ZåVÃýbÒÂàÌ*àP UB ’â`|@.æ‹ «ƒ*H :¾À üÁ ˜ã˜¦À€J 4àöE× Ö„²À¨àÍr™8©¸Ðƒ@ À ÜŽ¬öñ,ÎÿŠîÞªê¨íõÚo$1À«­¬®*D eæA»TÑ˲è“/ÝŒïÍâ[dP,DH€< qð¡R ì¨Ã: UrÀ 8Äj4â'ÌÊŒøƒV\ý¸Çtð)“ëfè4§)h=t 7ìQòku jBÖøOׂƒβ9…È_%ÞØÒkžˆ.y$ì ïRÎÓ*Ú¡ù´Lr`ö>C’áæ#´òÇ,½8‘/´è"²&ãRàéAÊÁ* q¤€>îLÀ ‡ m@ D0@&ÿÆ,> tPÀàœÏFh:Š`Ö*ÿíÄèàêK–Š·¬ åq*tØ$¹Ä tä€ œ³F[G¬ Š‹–öƒ6ʳì Tqœ1­ðò¬1èhP ªh»@&d -©Á,²¯”ï=µmK9òŠp@ Ò/e|e2\Àlà’ü3ܧ¢’J``ƒrj& @ÞAæì,š:€%.$D@7«Ã8Ó 9\tÆE'p 昂ÎD \4#”#ÿâÀF9•c(A.áÕFÓXBŠ…4E¼é1¯íËÛ¸H ÕEæÃ´<ëvÜ‚rxÐMùÄéÍ’fTÑ€FãðT0ÿ)M/)¨YÃA6 €¤*ÀJâ®ö.¢„ž‡,L2À¾æTBÓMÚˆí FÇ–$áL˜¢ è€dM& '9ˆCæp” Jb:5`¥ òfàbø¦*@,  AP@.Ë"ÂjÊ<’¼t/I“tU;¼Käòú†Wç¬WQQÌVñ]p°IÈÂeÀ”ášÅFÔ”2  5A £‚}* NqrÀ Nñ(€¡d+Š_B¤bÚ„%ܤ&l‰$i'-™€) † 'ê–£µ^ˆtB¶ò ^H`Ѷ<¶rs¦j: Z@XÿökÀI?Ì¢MçnòœŠço3‹C?’gA,À/ÛËêÐ)­×ÜÊKXEáÂ2ã,^ ¡8€®jÄB@Mg„4‚ µ>>`4€<óÔV$Â\S¤Øtƒ|Æ/Wf`l °±:âÀöáC%•@µ–¨f€$¥’Çœà…œ@×ä`×Òöy‰‚.€!˜ª'b ?Eà5H!àB@m5çî–wv!»š/Ûäìe>ág]À´i/ÔIq{Õ­Ä ¿®MÛÖêÑ>€ÜgV ÞëL€8—T‰^(ƒ$6H2  J@\@.¦-Ti] ˆð%m ¦ÿÅÖ5ƒØòУ¸.¡!&UØÂ`8i^_m,Qtstãt<zmø'HS‘àbv¥{žÇß2€ õEk:lcoÒRT•î® ³H`ÐZà¾ÆgÌ‚~Å,1Êé¼ÞlK‰Ço^CªÄZ›ÁLÑ4MÅᔢ}gä ^ €l -€À\€Ñ Ô¦¬¤Ž3 Ü) Fiy'xS<x³ÀÍ@)nÈ€‹)^Í„#@Ûñ†=9Lb¨ØÒƒGc1b€-ÒTÚú&³ÚM>Y¦A”Aô xo­`ZJOÀ^d*ZuqóëÊÚ*œH¼ÿÄØ+ž¾ ÀL1sfgÄçŽY¸XàTnà0@F UN€ %ÚçB¢–:NG7á=€„!õãª@šB‡Þ`‰"æÕ=b’ëº>9  A'„#êHâ‘ †#ôvÅð¼Ô¥Ú ;3Á»,.*…£!g†I0€x2~ÛŠÇoÕ ¿Ô÷<€Î”V?ð§úx¦gÖFa¥çAŽ'¡¨ 4Á93¥™ýÞ"ŒÜ¤Ò°1ƒŠº @'–b+ ¸ÆewŸãH/ šrŽƒ cº«|°!¶òt<'ÂLà*¥@áÎAAZ–o6Dªÿ§R&ç"vÒðμéÜìR¿àA‹|µ~«¨Ap€` çxÎRœ!„f:Ü€Ìâ(tzÄÀ33¨‡à(Fƒ ¨c$ÈÐtâøK†—”BÖ^à(pvh'^@ –ã‡0`…Š+ ²À«ûú0 .ª´éwö–Õz]6(F£WHð:,ª†eœ(oã,>€bòŠx‹FV̆çŠ:ÒÀ,l1’Çc€NÄÔ C¸` >piHjG:WM3SfÓ§®Òø™Ç¨C)==ÂG-çã €·@Æ¥jb$RÂvj‹ÿõä’ ¸A|¢ ¦ÁíQ¶Øí’[Hà Œa4^£*¥úLÞx!–›AJ8àÑ\¦Š¼30‹”‹!—Õ·¯ŒxƒÌ½¿yC\¦Å±ë2àR€&è²&ä@8`Ø´YËZ@o\@m~!iÜ©•Fl%A–lŽ‚¨^ 3à¡ã¶gâµ+„è@B Ä}††X›©-G°€C JÆ×‹@] Êjˆœx¡Ýà2ާØÈ^N@^´´®ÉÛœäóoijâìBã,?Ô ï€n@Ô¥BBÞ€ Ä AXP²›Õ,@ÀE€‡ÿý£{]=Ñ™]Ép=H“ §rƒ`ø¯ ÖC$v7 €m^ÏQ4à=`ÐCÜvÇ hÊ–®ÀÅ!jÇÆÂÚx$ÄêV àÞˆ±œìôi(€z9¥¦!ù¸¨KôÚœ—ûÆrÀ4s¤J®w'€æâxx²"ñàEêƒØæiœ°t `nÀWþ[M‡}F¢}‡ Ö/g°‘jÀÍ!Bý0u&,yɤRãh¨)*F^Õ/ȱ9¬ÉsÄÄkaú#P¸`.ÕˆàjÅ`Ĭ¦­æÂ<$4ŸÎ ’Á”§AùC¡8ÁÆ«R±Ò-°KÖ‰—¦Xd€%ðDÿ46 K§-ì,âB>€¬i ^@kj€0€ÁÌYï¾<¤šÕ-Úw2Tþä;ÊÕ­ §$"pG%fË#ö¨LÍÖžO,¸b´†‹¾«ýï –ã˜Ez—W$Hý€÷òNgýØ ]­’ Þ²IðÖWš»úÂÉš˜­Hv­H1ˆÑ;ïCº & V€êœJAR aBÒ Êξ•æ~À9šÃ £‰ªcØ#@È÷ù>îˆF_±£1d$ —f®N c´×#–ªpÊÂ!±h<"“Ê%³é|B£ÒéôòšE ‘Ãá‰$`, ! `ˆ땈ÿš/€ðø ŸýIv”Åä@ää88$Ä|85É8ÄÄ@Ĩ\ª L\:h ài|ÈÈlèld à¸èLLä<Èx¸°Äœ|<<°ÌàHLÜt|@¸[ œ$ÌÐ(Øx$pL?34̰d\D,¼}h)hÀØÃdè‹$ôc°DxÆ*"L¨p!ÃãÁ˜N — ,`àF‹†ˆn2H ˜"^h| à}þ˜ DHχ`|ð`À#!ª8UÊ£ Ñ^ è™À,F¤EžÀ¡À ,PÀðìÖ à0õÁ„ÿP4À!D¹iDxÖ`€3}r„ži¨Ñ¥Ÿ—õ¾À p‘À—.¼»0ç ˜wÆ4̬y3çÎ x1æ…â$@Ý‹ ±K ðòŒ+0FJ˜“@Û*õœ@”óȇƒ0‹uçÃ}J‚”¨ŠAbPƒÆ‚htè±A< ZnhPõL€.^œÀAÀ® Á%äÄ¿P@ÆEÐ ”$Á8 \\„P ³ @¶Ð ,€mÚz„}ã™JÀ0€ä¨B`·y@{@Á¼“2!š{@/ö°•¸P•cƒ>b9Lj‘Ãë‡>^“È 2‘MÆ^ðÉ‹b´3—ÔÚ¼%¶Sl€LB¢èàun@Y½~N h1ÍÀkÓЊõcr"‘ˆJ~ÑÓcJ&€)…“ ÐÀßÔòäÿ˜ 1x€xÈâãÔ‚'²¨ 8pNT#˜pШ"^‘h€Azˆ€@£¾r…¢yjrª CÓ@uË^F1eL d4±ŠM`$30H@CÅœ¦ ·aÁòLªÔà®÷ÀG0Ù0¦©LD>µÊQÙ È f°°t%ã%€(I©*x÷x2è€ÿ1€ÌÀ=ã`è4(Ä @9ð©ö$ñp¯[z š!¤²± r "À) xJƒ$K^kHÙ…P9«D/€¬¶Øÿ¸ -M {·«1ÿy3zÀFeÓB+¼ +LIÑ0 ¦ô@’lH;7Уààkúß$ê:^b„¨Bx®N0 H #p<€âÈx† là•„€69€‚ÄÀ’è1S¼0ÄsÅ-là ŒXª†f£é¸€€(æ ,xéëô‘±Ã9ÎFM…o‘Ó€¶–µqè:š‘îŠg¡JƒŽ~ÁɶÈT†a(³PâJšJSXHcT6]¸}@3³  v-ª2i²$ü8¸@9رžö„rœ;nœh'À€{\€sºÀÿ¼4ËéÙtÑ5]vhر/°×”.$"øÂ‡4Eïa˜Dµ# ª¾pô×g´Q ivÕÚ_¦xA£$£Jã;5üæ\¨tÐÔgêaÁëFr ¸Îb”B‰@bê!÷Òú—] ÷…ñm%iï/Þ{pƒPâäèΠÁ4òzy†<÷lºªDI—Í?hÎÐX•xßiÀÀIdH¥Þ @:H@¢aØÒÄ”Á^šÐFIÍ»áÌe Ãe _ŒÄÈ®¬FëðCóØAó=D€HŒè€>Ôžò0R¯PÊ`ÿŒ>HÀkÑnhAe¨ ììâÝÁ|8Ç €ZT¡€L(@6¹¬Zd€, (Â9ýÍ@@àø`òhpfá_ ‘¾¸ÙÔ•ñL¯ü —u˜‰}ÈnØCÑIàªÎEXŒ`ŒÔ@Ì´»‰ˆÁ¼!@èϜٰ„–ç%ÀŒŽÈÏëüŠlñ •ÎbA–„à@#†DLÊKõ}0Ñþ™á)¤ÕÝ¥‚œ@TéZ…ÀSB× À|äÀ3¡#¸À-HG¢›±5ŠþÙàÖJl§ÙGºŒÒ"iƒª¤F8 5Â$¬HÞÌ€E¸G¡f‘a#ΈOš AÌH‰l]oL]tA܃ÀÀJÐÛ}A5c@xG,OnÔCW2¥ôƒDŒNöI€Q.€¸Ýyy¡¼X¸’ üÅ{ˆ tU¢Œ[][)bÄÁAÀ? Û)(É/ÚAÿ‰´Ž·QJh,O™ ôCLBf«ŒÌÊ ÔÀip`b„iTÖ¤ƒ‘Ûi ‰h ÃðΖ•L‰„娌YM¨ÐÛ"š™k( >„I@T<ÐT,ÀF)ÀDıÐÛ .@ãX€TL4ËyE1 G€Zq`@t@XDÞ< t$0~a až(жÜâ5J)Q&JCÍ飴aJD`FdÊ'ŠŒ›ÔØ]­˜(¥PÓ[òð’$ÆôJäžòTæ7yÔîÜdT½¡™ ŸkY8Ì=ÜÆdy"¥4Ka M]Æ CÍlÁäCCÅ8OO5ÑZºìÿÃÍ€Éy±ñWº$’¨XÂÀW\Qý"¥ËTíŸ0àNѤŠl_DÇèÃ|:ig𨌠&¯ð§)Íä7aVhµAhÙ^‰4ÀU¤Òn’0‘Æid]ÑXLM>ßa¼o¬’Æ0Í<–EÐCTÎí…€aT"_IÛ²äFntÒ!•^ì…°b€†it¡á/ú™,ѾØe&ÝÛ¹Ô@Ï Ã-õ!%iˆF„Óšjf€b €»Ü– ƒ(¶AÌdi$è—Î]= ÏŒÆÔ½ D:†Aª`JÚÓè VéhA(fI°AÍ=c蜩€¥@Í–Ø|”ÿ¢õ[ €0€zRÒÉmEY*ø‚/ Á°ÀY@»™ÆÌ¦b\`rZm` ehãâ$RjPÌtPAÑÈ©¬B,Q …0üÃÐüb I„ÐX˜h\€ŒôJ¯ÔÁÃ^¢®jHÍ ˜Ôˆ†)ñÍ´ŽUJÔ°HTΤ0@@p#}eG˜Ji§6üf,µª$åük?„D•%O­˜sîÓ‚¨ël ÃÃRظ¹ÛeÑÎì€X %:$”fåHóIIJ!KL– –ÞàŒDlÙÄb­¼jm˜£\ŒäŒkêKÍJ¼¢-]#¡Y]h(˜E¤ªˆ^A·‚lÿ=˜Î0Ô(Àe8ši1‘a0¥Ê P*ÐÑ[Åè ,RVrŠ2N”e<Ü)Î C³ü h”Î÷‘€bl#‰@$@ NZ¦ÔàäÔ tê±0Oi´Õ ™mñFÁd¾ ¼H£ì$hôL°0¤ªÃþÜIŒnÔ$-âÝnmM>FDbŒi~ˆè@ŒÆ¼QHÄ,Y(ãLÆÍuå°PŒrÂoØH²€H|ÖlMJ²†„ãÖoG˜†¢Pê±ÅÌÛ•˜@Ááµ1¢ñqaü+íEZ²ä†Ì@hc=J£ñŠ0ˆUÖ†!ÔAÏœiÜ!ÿ }@Û¦ŒôŒÏ\Æ0´ˆbDĺŒtAëà…É͈@ 8ãmŒÎüÆÔÆ`Šè@@ÔÌ/šÚæÄ,@J‘Œj„TŠHÌ üÒ7d΢†|”ÎÀ¼@°«ãpDC5ÎlaÁÄdJºЪÐToB›%ltp–ÁrŒ$f]ÅŽ"œ&}á¸9*øP •†DxÄEØÃU¤ÁjÄ$sYIáÌÕ=Æø^@oÈàaiƒñl ôJÑl- Í-É 'o~% ÈÁ‡Ä }A0À¯Ð@‹ Ëð<àTj>'IÀîÆ$Àl‘( ДdÿôQLeăiMŠ'êî"9h D!“s¬$\ ßÒ\a®ê€  Ãe±.Ô¦Yíe žÍ.…MR‹ ´aÑPŸD¬£QÒnF +š¥ÁÒµF3b:‡5@6Ž€JntD›òh€?†Ãmóè€ T«»ÃÄàX@Ì#Æ0O¦PŠH4À¤ä¶Q³cdŠ­¯šõ c´i9õÔ$ ÐÕöOc‘!Q5–XíÔçðá·@_‚£fÆ ŒðnÐĈkôÌO–θÍp–ÝðC çÊ úLò #IÆM‘ˆDéTN¿I+DmDÿôÆ› I C<À—µª¨cd€íFóQ©¯i€ãˆÝ0T<[LñÐüᎸ×K]A"ybèÀQ—3hô†E ˜|G‘Æ<Ý$é$ë¢×U؇¼kçÌÞŠµÄÚÆCðH®\VFà5‡Aže:D3Î-ÏñÜRA]P,P4çÒ‡DTDÔ‡€/½à²I@qVvtDV^L½!ÑHèã@ ÑFÀ¢áà €Ä¤ISšII;H’'’×Â!j“3ï©Ò ƒ6.Æ–Åv<›AÒáJq€ì¡J8j…‰ã«ŠF`Êž¥ÒÍ͸MÖ¯ i®ÌÈ’#b×ÒˆY7› ÿAd“Dp¦÷.EJ¬ Ÿ†c¼‘ã8Ú˜y"‰¢÷PLnPLЃ> ‰&Ɉ=š Š@Ú!Ôì†hpNJ„Ã=øó—’Øë¦b õš†56VNŽ’¸-Æi›c±yeϪøG±ÁXä°Ç‚y¦L[„àà äì(݉5 =¤ ˜}"ó´;܆ ç± TíDâZÌ…$vx°ãÊ 1ë §„ÅK™ ?`›@Ñ{i¡a%¥€_1”‡ Y—ò¸e„Š-ï·ÅÜþdföŽÃ²³jpaÎÐ×NlMjÈ'T˜‚;”ÈMzA…Ð’K²ªTm°ò×BԆʇÐ&…Š¿­ÁκF‡X°Ö´¾†êœ{QÎè1€,wŒµëôCq|µøåPÌQ=LªÚ0¸ÑA;ntp-4.2.6p5/html/pic/pzf509.jpg0000644000175000017500000003132311307651605015075 0ustar peterpeterÿØÿàJFIFÿþLEAD Technologies Inc. V1.01ÿÛ„   (1#%(:3=<9387@H\N@DWE78PmQW_bghg>Mqypdx\egc//cB8BccccccccccccccccccccccccccccccccccccccccccccccccccÿÄ¢  }!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúw!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÀ,ÿÚ ?ï+…P@P@ä¾·œ2cÆð ¶ß®>¢©E±\Œêvì€ÀâbOW³—Qs"Ò±,ÊF6÷õ¬Ú±C¨ € ( € ( € ( € ( € ( € ( € (µôÞU»mlH~èÏ&ª+]Ds7â6óo#*€·ÆA=¹üýkG®€´$Óµ´Í´Œ€8µ­ô±6Ôêÿ嫺?­r²Å¤@P@P@P@P@P@P@!!A,@©4BãR+ÉÄz~ª§Ü›ö3dv’ìXžù­ 1ïmî$Ú’ ÀtlŽO©Æ?•+‹:=˜·ž>O. ÏÔSNÑwS¯ÿ–Íþèþf¹ØÇR € ( € ( € ( € ( € ( € ( .nã·?3öQU9 »s\Ë9ùÛ²Ž‚·QKb.@iŽâPl7f“Mj£í1¾¿Î‡°ÓÔè?嫺?­s²…¤@P@P@P@P@P@ÙdlçøA4Ò»°Ž^=kìÍ,³!ÌÍ´‚x8ïÓùc­ke}qö׉up eO­m} µ‰x©4„ÐR%¿ü|Ãþúÿ1CØ¿ÿ-ÐZçe‹H€ ( € ( € ( € ( € ( € (² ’6CqBvwÄßYÊn^6‘]#v÷ëÏòÕË¥ÉE»8¼*ƒ·zZŠ`&x¤ZDŒ¨wUÜv®N2}Ml?Ò¡ÿ®‹üÅ'°ÑÐW;,)P@P@P@P@P@P@Ë\kÉŽáƒ)ÁÏ^k­]$eÔzôúP1ôÉ]cPK“šÎšögó–50ì@~qƒås»½\þ”½DŠi.ŠÈ?zÝÐaËgŸöUF};æ†ͧü}Ä?Ûõ¤öÜÝ_¼ÿ_è+™–:€ ( € ( € ( € ( € ( € ( €8ùÕ‹F•"\çë­™"Р.8PW‰ÚI)7ÞùHÁö票òöÜ7Ú…]FœãêsHdãÚ„Ö_ñùûÔ¥°ÑºŸ~O÷¿ ®vPê@P@P@P@P@P@P@rËÔýk°ÈxéH¤1MèØµOcÍì_ïCS-™HËñvµ{§êbÞÒvŠ7ˆ;£$’G\g°©I%r&ÚvEíWU‚ââBpIgl–<ÄÐ妦ß½©ÙŪØÊp·(û_/ó¬§]Ëhêê2ž„ƒLbÐ@P@P@P@P@P@ºŽ8®Ã!iáÞÅÍ&}(æ‹>žs{×§àje³)ïŽð5€1ÒÿÀš¡ìŒ§ñÖ—N^µ^áŒ>"þ{ÿZãMÜé9æšm;¡–¢Ôïa Çs'€[pÇN‡éZsK¨^ÅÈ5­IcyšH¤E!JºóŸ^1þséÀªw ²Ì~'` Ij w*øý1U·ÌY%´ÀÝÀ÷ÀúÓæW°\¹¯a1!.Pcûù_çNèw-E€ ( € ( € ( € ( Y;~uÚ̇T€´ ©s©ÚZ‚$™7áS–ü©1Ù³*ïăZÂsݤÿ­+”—s&çT»œ>ùØʼÈTó1Ù_ƒÙ-÷qž¼ö¥öX4®cüA/ý¾û‚ë“K¢3væÔÎÑó"Ä£ï1m¼}æÁÚ¿‰Àüj\n¬GÛ6)œŸÝž¸GNƒæQ“ÇB§?F±öm¡ðóÕn¢dnÀÃ?úãð¬Ú³³ ´Ÿk*²J¨¶Öáb,1»Ð}Hçšwr¿áÍEï±!Ö@CÅ ;€¸>”Ýì‹h—˜¨YOÝ$ñßü­To`± ¿»\bêu€œÃ4s4—"ñ¡;¤Ixèè?,UóŽì¹‰gDC=ª0q•(øã¿­>aßB×ü$¶YÇ•?×jÿ I‡2.ëXL K¨Æ?¾vÿœgšÒ1mØv$“füÄ[c+¸‚yP{{“JZIƒ ä´£„BϾqü¨I´$5XoRÙ¹qDg®¢, BõÉu8 2útªç°îË‘xPŒÆ9sÓztü±B˜ùš54Í|ÝJâ8ãSÿ-`3Þ´¼®5#\ÜÀ£&xÀõ.)Ù”J A¡ ( € (Æäl¹'Öºe»éq• &h”®1üþé¦uà‘˜"ÈÏÈ¥&—+¦'Ž9ñ4ÞЯò§ouTf-šoÓÑKm°Xä…äñÏšM¤ ãѺ}׎3ÃŽ3Ž@ú}qRmäkéÐÍk'ïZA€§wRjç’R›^1´^Hn¯ È1èz~5<«T&2Gò¡yv3¬k½‚ñ1ßÈ(-lÅaê’ô0Í»=FX¨Î¨ÇJrŒ¯h¢5’)”åÉc¨ãz¾ÔÒµµk™w£tÖ1¸c™dRùŽXλÐ,As·”¯–Á•å¹ ddtô÷ &š|ã'z~5g ·P¹ÒÝ’0‚ÙÚX°Â’¸Î9Ær9õ)¦¬s»Ye•_909Èç>ø?jʲ6l…¤`a°FA r ˜Ç__§5ƒ4Ù6W*ŪH`PàîÈ;•°zŽä+E§ Ò±zÒïí’0 Û²:œç5Jn:’Ñ287‹§ž}ên8Æì±wn!ˆ²¶qëþ}êlË•4•ÊÖÏ'“#GÒ*žJ)#ó®È{«S$ŸcR'K V"Ñ’ÆFw?¦8­-ÕŽý–Æû{EoåãåÆíÞƒÓð¬šêZ4*FP@xÁ<×Kшnj@(ÔhLûPš@5ÏÈßJ÷‚†a‹þ¹ŸéKìüG7ãÉJx’l “ÐÕý”e(Ý”ôˆZHâ‹knTd–ÏóïYÏáÐÍ5ÎjGj`S*J¸FVN »~ï;Gr¤ ÿ»\íÉ3uba˜mšUdÎ|½¿Ä:0aøŽ¾µ ÛQ1™%ã$,aG=‡j™¶ÁHÁPO Pžº qËöy¥kÇÝ…Èã’>ƒ¥vÁÊÁd͈î%’$.ÌÈH<Ž€g@+Êò±I”$æ÷NP þùÆÝ¹ÏÎ=ë¢:!1š”MçȪ‡ýk(yà×½6µ¸"ÅšÆu9R\1–'å8^~Z«]AšP鲯T|ÈÍ·åbØèH ãÇNsžÙ©¥+GQ5©Ì¸Ûs8%aŽ`è>•ÐQ£i(Љ;NW«ÿ-AþòÿŸNµœ_¾Ñ-u3-Ïî‡ùïZnR4´“ûÙzçšÆ³÷I‘nxóó!*ø8?¥s«§p‰šf¶;ÞGÚ2rýG­iÇÌɬA’æÄ®8ØZCÎÓuq"æŠÇír.FݯÀç+ß½\]ОŒì­íáKˆ™žsž?­e"Ñ¡P0 € lޱÆÒ9¨$Ÿ@(JîÈGŒ1]pR1~´ÁN‚€°R¶ 5¹VÔßø'ýL~ÑQQöXÞç3ã¶Äì@ì•§Dfú•íeŽH Pz/^£§¾Ǿ*SVF·..£e´&éà`„Ü áA=GRý6ç'8ÍÒ¿S ’V]›+œÖ °cÇ:ûÿ‘PõzŽÂ.& ÜÎÚ(Èàçñ?ì j©¦®C#XTL#žÞ|åpȆ 0'§®çžkX赸-ª¨D‘UŠ6î À?ïtÎ;Tr¶Uõ(]0[Ý=‹ml‡,ØÛó÷$cñæºVÀÐŽÉ%Ï˜Ž¾ZÈÌÙ<óÍ4m¸ÞËŽ»’1Øzæ­®ã{h_šâ8,q –V)ØH[;—ÓŒqíŸZÒ1\·[‘ÙÑC$'žK9,Ä·^æ¦ó,ØE *ÂÒ¤xÿW€OÎ'>Ÿ•ošì”úñ£¬K”aø{Ö·(ÑÒ•–I VdƒÍaYè¬&ÍýÚnhƒîÆÝÄúž+8Y|Z’QœlM­±YF9 çœcЍÙÜ:’iØò¥baQÇX<Âà]V¶OM´44_šéù'ä|g8ÆS¦{V±ÕÜì­!ÙxÒyq.þK¯Vàã#·L¶°Ñ£YP@õùÜÿ×&þFªØñò8­F7P)j0Å; âc†5øCô¡ ô."óÇ?¨¨û þ#˜ñš,¾$˜—ÚR5 ’NzVDŒ›Ü©¼·1¬0|Ò3 É'½ÏåIÙ#[‘6ób° ±ÆT“·#_¯èk>x­Î“jݦ¶…|²¾bí*ûA+€zg×<×3•·Ë öé¹#ó^ßÊÀI1&Ýõ÷êzÐÜm`æÔçoQ¿´bœÏøï[Qµ€/‡—ÿ-3·äÚ…Hm¸Ž>èÅlÚ`‘fÌ4vÊ%Üe‘ƒ’_€ ê3M“,J8ÅÔ€v)¸ ¡ ¹¤_úæô%¨žÅDâ¼Qƒ®ÞHrdÚSœŒ(ç¦1CèsÎ)¶îE§›>ßÔõ« ®Ñ±4Ö¦bU—søÝ–'v:g×ñ®^vt-‰D²=âÌ ‰^Pù8vsŸÎ©I·v& ÒÉ¿·’HõÍ)I§¨Î)Ý%PŽ\c8öüóW'`ò&2Á2ˆòÊ—ÁùÈüŽGåSª[]98Œ‚ ûRRv=Ñža˜È`Ý€O>™ÇáZ)·fö Ø‚ ‚yÚè8…fõw¸6Gö›h%òïTÜ>V\sò#ó®ˆSºÔ”Kö­=ªÝÉ…ÎÐÊN2séUìãµÊµ†ùöŒ^Ž¿»oçG³]ÂÌl‘‡Ž@é€8\“×AšÊP³ÕˆÉ6—¤+eÉlç€:‡ç[)¤¬»io*ZÊ7[ Οʱ¨Õ×(º™«è»v¶G¡®ŽdWBó+%¹Iˆ CÿïÛ¿åŽõ—VOQÚiSÆeXþèÁ¶Þü ¿Ö­|6¹HÓÐy¹ns„~s×”íÚµŽ„µ©ÚÚÿÇàå¿Õ©öèÏãJ[ È  € †÷þ<§ÿ®mü©ÇâB{Àé]fcÏ€pÆi\È aÆM¨Þ‘ÿÇþ¹ÿQY̸œ/ˆŽízðÿÓOéMô9e»&ÒL æùѳ“Tã ž cW• ¤Ë#Æ×ck… `Ý©´žá`nY\€ÅH;[£`ô4–›ŒDFxáÜv ódžûÂzdVŽÏT5¨ÈÐà²óÉÜr£Œõ'èj9t¸šcäË RÇj’@Ï4kk\/a“2’ˆªr9úçÞ­»½{™±ÍÄXlóÛ¦<¸ë²? )À79=˜¦QzöÝ`†x6Ä”`·8Ê©?…6¬$.šP[¹v 8Ëç½y?–kšqm‰–Ш?2’2ÃcÃüÿú«%dµ&öd¤2E¼T¢›z±¤xš Š*É 1±-p@Î1óš™Ù¯0Z;–¥CÚKdpAÈúþ5Ék%}F;ÅnÞlÓ~킆D`HnJ÷ç§qÎG#:BY¢’Ð’9"u/¹›w;¼²sÔzç¾}ûç¬hˆ§1FŒ³9\Ù–1ߨÿ뎃îtõ­"ôÜím˜¤êÌFß-óÉÆqS-Š4k"‚€ (ž¯ÿ Ùà?ú«¥ñ"e±Î3L6vžëÖº¶3Fˆ ØRl¡ÂDi1Œ0;GJ‘h;z³`ðTàdÑa wPÅ[Œ2GùÿõÒ$éLE­+þ?Oýsþ¢³žÅÄáuYõKÔÜv ß?í¹hÎYÍì"$RF‘Ï![?0]ÜŒãŒjÊZ-v*‹H¿k<ìÊ¢æwEù[e®v®Óüÿ/zÁÆÔìR•‰ç”ý£ýx›fÕlÚÀì~µœîä­©› QîwÝí9•ÕѾQ†-œŒžžÇ­iµvÅaJ1ymáþæ8`Ð}ðpÀþ4¦¥]!hE:ù0ò£v20û¥L{B‚:òïCõª»UÇmIH,®¢Ì¨É}Áå‚2{@úÖ7´Ad5".ê‘£' äÐ¥bl®d&p]0¬à.p}ý¿Â´„o{è=ÌÙ 6é†òy ä¼Ç#Ø~œj4¬ÊCZÑ?gû››¨'ûÞ€ŸÂ´s¾À4[F@o'ƒ’<€H$|ÜŒƒÍöÜ,]Š7²?&èÕˆ!Ú¸>ÄsŽ*%9XCäUXUƒe‹`¸Ç ß¿R? É¿2z_Y‰ãÜ®]Ür9àr}N8ª¦Ýô"ûÎ׈¹ˆ7p¸Pzdû‘ù×G;ê; !q™.H@¶Ïν»õïÓ½D_5Ú%Ø]+>]Æéc#ìÂ@Ò­+¡£GAíoŒ«äñÏ)Øt­c³Üía‹+2¦~@<àqüë7±HÑ¬Ê (  z¿üƒ%ÿ€ÿèB®ŸÄ‰–Ç6ʲ §¥u2†Œåzž) q|Õ“ÊzñëHò¿{¿wò(e…$ ‘Ë Žqþ!’sIh,é|^1ôOëQ=ЉÂê|êׇþ›¿þ„jå¹Ã-Ë*8bmÀ6|å NAæ²›ÐÖ…›Ôn˜É º™"Ä` žÙ®Y=v;£$£bÍÑ‹dÍcÛ Aôþ•1Š“Ñ™u)ê)±AK• Á`’³nÈ;˜ äõä~4Õž¬d¤’–?¾.C«+¸’r{ç?SN«ºÐ¤/!¸ŒFnVBìX|àäã=}xÍ*\ßh.SYçÜ1,¤‚Á=pqúgv@mGæÇÉ–D(J• ñœçž™®K¨ÌD«ö·yL“M¾?„¹'¨‚<÷¦ªM½@ªêª@WžÜV~£D7 6TŸºÁºñÐÿ\dГ±ZÓT·†Ü¢4©) a•‰<þ•Ó(6VåÀ„À¶è—û[.eÍ»¹Àe>Üš\¾B¹qcó1U_›–À rqž¬Fú çV’³Ø›‘ΰO•ŽÔÃàüØäj½F‡åM…¸û¸Í5wÔ.Ù£k$i#´n©Œ¸âî?ÏéZÓIh˜ÜZ"ÒÙ€˜¯Û0@ÿS&ñà×EÆ‘«áöÍÛ×kç9ÏT뚸ê˜=ÎÂÎà´ë p¡ÈÆ7õÏ<ñŽ˜=i5 #^±(( €)êÿò ›þÿ¡ º_&[uwâ9`¸’ci* É5Ñ}I±¥£^Éyg²˜ä냌Ñ{¡³Pr9 C‡JL€œR¸Ë:_ü~êŸÖ¦[…Ôä)wÿ]ßÿB4å£8'¸5ÓÚÂU]\ÊÙÁìzü%—èÇà‰i›ÑÔ‚]M¤È6ñdç$4œ’'ïuËnúô¨Q: .ÕÕ¥2wá–<(ÁqÎCgðõ¬gk‹Nƒm$†ê_+ 1Ã.EL`Ö¦nvèX–8m-.K€>E ŒyÙ$ñŽÎO¯­kÊïvÊ„“Öݯ÷HÍ#)?8y9'ùÿ>”ù&ú— É .R5~BA#‚;ŒqÉý?ÓŒucµõ'cæ3™œÿ´IÉ?¨'œg®t›wdzˆ“>æl”2È'’2=y#ßÚœ“Ž·dÈ%ûçéþvÌjï)@UHg8ãŸêj–⹊4é’D'iÎH9n#9à×k•‘W7I's¿™³t¬ Ü3¸‚ ãžœÿ{Û¬TôDÝ4²J ƒpW þ«ùû'‡’VlVžêÊÈ î8ÏBp¦±åQz³EM³>+«y­Y ¢Q!csøô®Ÿg‰#\E6·§ÉöeFËà®ò9Ï ‘ïN4RZç̬R“D¹Óâin-áel.ó!~MTÖ–%ü8¤JÌÁ€ ÀЗ§¯JÖ:\–õ:­?‹¹.¤•m»þVù—zƒ—§$Ò{1ÚÌݬ (  z¿üƒ%ÿ€ÿèB®ŸÄ‰–Ç2Ñ£) Šwpru\ÌXaH”*(U!ܘb†ô íCΟÿ,süÖ³—bâq7Ëÿ+®å³ÿèF®OSΛՎû7ÚH,#‘†à1ò©oéPÝ•ŽŠ7 ¸±òb‘Áˆ²çZ†¯B>¿çƒª¹¹N…æK2bÞf3¨%XLqŽGåIËK­Ð‹FÔýÓüª·0žÅz$0ʽ"ÎážNýUi«’ܵ¦JÝâgTÁ‹rr¸9þ‚ˆ´·6JÄ·f7™"BÂ.Þ½?žÀÖUª^ÉÃÃITQ¸„ÇHõàV\ÚÙì-ÄEwGf#äBÛrp~êŽ}zP½í.#6k五ue둎øþ•¤hµ¹HžÞôN]£[ÃÜüçJ¯ºÒpfÊQbÆíäc’ÙëèGåD§uf4‰dDò—{¨WáÀÎ9É~b²‚´•ˆ3EÙžàGòŽ_áQêº+®¤šWcJÚ›\ðÅd»¦Haœ°Í#¦C™€í²Îz–ú uKâFKc®ð;gtÌÀ|íi´Lú–u5xìnn.dŽ?>d#t{ñ…Æ0}Á?ÔÔNÊȤføx¯Û®Ó”|‘ÆyNݪá±2Üët‚¦æp®ç|èyñÎA vùpSÈÁ¤þ»7+€ (–±ÿ É¿à?ú«§ñ"e±ÍH¥ã cé]Fcâ]±ª’II<õ¤ÆIH` - ³§ÇÃÿº?g;ŽSVÓçk›‹”•Ùöó’2k Í)4Th¦®ÍCo!|ˆØÇÈ?¹ÔÛÝ›(ElŠÖwìÀ8^…ðXwã=°~¹8 ìéµX–P@õùËÿÿÐ…]?‰-Žmk¨Ìp¤4.jF(4Xh{P3þ>[ýÑYÍP–2—)»æbW÷®)üFö´.d,Ó}®$i7£-æ?#{ÿXTÔlîcÌÈvûdh¬¤ª’GtëÁÈÇOLõõªŒTa̘žä³ÆÀ¼%ž1°ªóƒè8ÀS2wzŠ÷V!’úÛÏ™Ö9$;›ïðíÐ÷ÏáŽùùtqMܰÑ{lCc|áHrÞÇ#Ÿ÷°:u^Í0NŵKçK™#BÈUU˜tûÜlgð¬é¥;ŠºÕª\;fmáP©û¼œû‚8üjýЉ£d¶ób9R ºW#ƒSåbØ‘d‚km ’J¯ Ë´’2GÜ9ô¿'Úºœ-dºŒÅs*”@#ÿlú*ÿ/Ë Ûq–t¼,¬Käg#ž¼sô úYÔÝ ×*\kÇ!·¸óÏñÝ›ùÿ‰ÓÐhÐÒ£_&c"nF8\cï`Æ­·Ü‘mVÚªWæçŸÆ°R“×rJ7Pa1òž½Ö´¦ÝÇ© 6Žö¨ªÑîWbAp¸Èëô­äìËGA _Á£E*\åšB1åá±õçÞšš± kq×7övÆ+p¤†VspÅ !v‚÷ÇáI¾Å¡<>¤]1ù°c~ ãªtÏj¸õ%îv¨!E"¹ÞûhsƒÎ~îp^:Mè •‘a@OWÿdßðýUÒø‘2ØæÖºˆ3HéHažh¾¼Òc4 µ¦ó<ŸîŠÎE#‘º”‹Ùö»¿^ƒïc¯ü²”W3Ði»nbOw#]>ÏÝ…]¼`ž¹É=ùçôéÅRаcyn!û Ç ²˜òÓ*œ‚Nvœ®r8…O¼£e°hõ%I3;ïp-Ò%%Xá‚ôävüªj¾k4\$’w ½³wí$E—Ì*¸ d;ÿœÔBªk• O[¢¬6ã.ägƒÐ{gð"µç¶âå} Aj$–d’ÞHÑ•Yqù¸<ñéYIµð£HÁ=Ùu£]‹‰^8H‡,T–#'Ôçµo{·dIYšV4V)ƒ 2âO¥rÎqsæFL»‘LÆÙ)k…bMÀõfí•Aõ5Q¨ïtRfñS}'ÌH%²r?¼Þ„×Rw@K§)s)8•Îᑎ{`ÿ#ô5•I+ }‘RXŸíPn §ÔåZs ¹«¥'•óMcÈã8Ç9õíŠç©$Þš‰–dS°3!;ÊqŽG¾:rx÷ ;7bFJ$R±Œî9è1ù•ã5¥)5{ìU—BšÁsÚe} †Ú1ÇÞÀëêÍùÕûT´)«!nTˆÈÃu‰?̚ÙßRnEfóFP¨V#†[ùŽ+¡>€¼Í«Bº\íæ)>F䓞xíÒ´½•[©ÔÙZÌòC8L¦às‘Ó4›C7+2‚€ (ž¯ÿ É¿à?ú«§ñ"e±Ì­u(?J\Ò°ÅŠ‘i€¹âËšf|×úëQ=ˉÇÜlûL¥K ’©ÚŸw霌ÿß]ûã9+µq-Œk¨ê-¶ùãk+“ž)©EGqšÑ:?“,ÊÌæ7D%þèzŒœý§e8Ùì+Yœ@ˆùo‰6ú\NVØ©«hA8o,€Ï\~á4$Ò'ÑcY|ª‘ÆzrÜUOYÓz ybíðŠ1ŽÝ8š•¶2¨õ!TºÏ¥7'±™2pF}E%(ÞÌEÛk8§G™·UqÆp:Ÿ­j’`•ÊòÛÚ«¿ú;6y=Øz³úÖœ½‹²'Qo>ÛD;AûîÇ‘øÐ•ÂȆáÊÆ+k}ÆMœG¸¸ëMA…³ç=Œ¢T ›XãË Œ0ÅÑ Ë¡·ƒîrÿY®ngð¢Íùs´’ ½¨øwØÍ§½$»"›orH짺SäÁ,»zìBqùSå"îứ¯”\ÛM¾N÷?)c=yÇj鎋Q¤t¯á‹,wL»ŸyÁ{×¥UÆkA Û±)$/sÖ“Ô (ÝÜVq &$);FSN1rvBnÁ彯<™•‰è:øPâÖárzC)êüi“Àô!WKâDËc•-Ï5×c;†ü{R÷¤ƒR‡ !r) ½¥ŸÞ9ëÒ¢e-ŽZäbæ_÷Ï?yõ_¾ÉL„ »ü+.aŠŠWhY%IÚÈ<cÚ­U’Ñ U 7Mê ¶.ÐÀ‚:ÓòDŽ´ci˜¶–g«)è3ÏækGf®k–C¤v•˰5•Èná/4#F‘ÏEQ’ ¤¯°¬Ymîy³¸ÿ¿MþÔö 3JÓLÕ"·*–|9 2‚:v'Ž•´º”•‹I¢ê#•³Ë7W9ôÏ&­·ÐÅ ^¸Ä׉:ƒÞ¹äP®2Õ¾€± Éy;>1¹p8üsF½Àö ³83Mq2÷G`ü€¥Ê±èzlnm‘Ù‰aùŠ9WaYfØÏ•·ýú_ð§dE•UE  *¨À`LbÐ@P_ˆT5Œa€#Í~†´¥¹29ß!—˜œ©÷é[²Kê÷ö§"õçæÏãÿê¨p‹Úy­=å·”ªŠ®O9È9✠¢î&ÛF[n±7Ö•‚â†>´¬1Áøõ©hhpnÙ¤‡ w4´“ó?§.;†õ)®[1¢+1;™Æ?Lšã©MÊWB± ð÷ym¿ï¦ÿ …G»‹Iá°o¼ã#È뚯b¯¸X²¾² MpXH**j”PYCá6<ïI%ÏMïŒ~Xªä`±nN…v¥œ$g?:î?™Í>T©afŽ- VSD`*{b˜Â€ ( € ( € ( € Ì×ÿãÊ?úê?‘­)nL¶0€æ·d¡ÂÈÞÛ’0}G­p!0Lƒäo3Øði¦&ˆÙ×vÙi÷I“dQ³N÷ †•až=©¤+‰ž}é4ƒR(ÔÑÉ))ՔˉÔÖP@P@P@P@P@fkÿñäŸõÐ#ZRÜ™la•½î@áI!‡"øIœÔ¶4nè¸òã×5,¤uÕP@P@P@P@P@P@VûN¶¿LLŸ0èëÃlú{SŒœvW0›FÔlçClVáL¸ú‚–zV¼é‰]nDt+»h„…D¬GÌä¯áßð¡M•|±4ÑG3.1þ¨¯ÌÝÉÏlO~vz+ìW¹ðÿöw—,·%÷É€z{ÒN-h+Innè(= œQCУ¬¬@( € ( € ( € ( € ( € ( € ( € (Žñ‘3êbàG#DÀáÓR}~¹ëíïZ¦š°¶)ÝÁq~Be˜FØTHÉ “Ü¥;%¨s\ÓЪ¾¿Î‰lê«…P@P@P@P@P@P@P@PfÞ1”ƾaÇÍN”]ÚÀI@P@P@P@P@P@ÿÙntp-4.2.6p5/html/pic/stack1a.jpg0000644000175000017500000007172710017034540015371 0ustar peterpeterÿØÿàJFIFHHÿíþPhotoshop 3.08BIMí ResolutionHH8BIM FX Global Lighting Anglex8BIMFX Global Altitude8BIMó Print Flags 8BIM Copyright Flag8BIM'Japanese Print Flags 8BIMõColor Halftone SettingsH/fflff/ff¡™š2Z5-8BIMøColor Transfer Settingspÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿè8BIMGuides@@8BIM URL overrides8BIMSlicesoØ£stack1a£Ø8BIMLayer ID Generator Base8BIM New Windows ThumbnailyUpp]ÿØÿàJFIFHHÿîAdobed€ÿÛ„            ÿÀpU"ÿÝÿÄ?   3!1AQa"q2‘¡±B#$RÁb34r‚ÑC%’Sðáñcs5¢²ƒ&D“TdE£t6ÒUâeò³„ÃÓuãóF'”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷5!1AQaq"2‘¡±B#ÁRÑð3$bár‚’CScs4ñ%¢²ƒ&5ÂÒD“T£dEU6teâò³„ÃÓuãóF”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·ÇÿÚ ?ÍéW°2¾¬d»+3í¯{0€;©hÙ[ëË®s1¬Þë=\OìYB盉Ðc«n>m®Æ*¾±ê݉sësvûÿKvÏô«£ú™EVôËÜ_êÒ÷00<ŠË_EnÝe?BËê¿FõŽ>®u|‹ï²ºCi±ö:·7Ü×9Ä@c‹Ûíýô؉@Ö»Cͬ1~®ƒ®.x?øj‘ÿº cêég¨q:†ÍÛw}®˜Ý¶ÿÉÿº®]õwë–›O®÷ðúÛôCkfŽu˜Ý©«ÿY=/Gì§Òßêlõ)ú{}=ó¿ó~Ôî éé?ËüqÃ÷£ö†‹©ú¤×m}y­päʇÿ”_SAýl“Ë~Ù^šxþÌÚ®3ê×^a.fZ÷^óed¸´Vàë½=ŒþCÿé.èXî­•œ*ZÚÈ-Œvj>Ží®÷r— ÿtý‹Ä°P¼šë`F&?Õõ{Ÿ÷.sq¾ª¾}:3¬ÛÎÜÚ´ž?ï5AØ¿W™ß¶UÿÈå¢ÿ«ŸXÞà÷â7vÐßkêlÁs·< vï÷¨ÿÍŸ¬?÷ÿ«ÿJ%Á>Çì[)ã³Ã+C.Ëü^)ÿÒh·êæƒìYóå™Oÿ#U®“Ѻw\éøeÈ,¾à-ªü–¼Ú×Ygôl\K?7é¶åj¯«j}M¬ë ¸?í²ÿ¤®ý[é½C ë^ ·Õµ¬‡79Žömß¼„£ ýЉ:ìñiÐGÖt__/Ðv³ ÷×ênm¬¥µnôvú;ÿ©[çývn©o¦Þ–nßê¿ÔÜìÆßüöïSfö}ÜI/±/ÿÐÎúŽëGFê;K}6ØÏT.;ª²¶ìÿ5t=™x¥Ì°~†Ú7 t»ÜíÍô×açuL\¶áYc(-ß”h‡:º,¶C¶þ‘Þ›ª³ ÈÍs.ecôÛË«Káìö¨ÎSŒÈç@uùP`'ÂÁFǪ»=@ñcœØˆ¿ÊÜíè·Ä}ëW ¹Cù¾ Æ-u·Ú3­ç¹®þÂÉúâìÎÒèÊé¦óu™§ï²û@ae¶6,ýúÛîN‡:4Œ2ï¤VVϤÐìÈø½<³Ä}ë½o«ý‰ùËslm{Ã?J=Ĺ­c‡­»óQ1ºÏS¸0»=Í{˜Ihì·Ûs·Wd~oýB“ïCOFÿÖˆnÿ y›ŠŽ-ú;rÎÄ}覼aÆCOž«™wÖLæôË2Nk†[í˜Ä]%ÁûYþû}/Ó]ž ï阙NûS®¾Šl±­ºÐ¬cgµÅîkç}^gˆD‰dÅþÏÙ—÷½ìyX2|>x(LÂ|BÇÍÿq(9ïm@Klkµàr©a>·}eÆap.ÎÏóo[ç§[¯èó=¿ðÏ!ÐcôrÃÿ‚¬®}>Γ€Þ±E×וNM-ÆsÜ·z›ÚúöÙô9!Ì\8 œäK'ÿãQÇùŒC K‹A]#ÅÿuÄé ³¿ñÁ5z•ý¯öHný§ÓŸU×} ßôR\?üåëŸó”uh³íäzhõ6ìû.ßG~íÿ¤þg×I·jÝ“ø¿ÿÑÏú þžzø÷ÓM™väå6§YPs¶¶ªìQÌwÐw»ÓÞ±ÏXËÃÈ~1Ç¥”ï¡î·› .ÚÖ»Ð²í®«c=þ£ý_ð‹sê-Œý“›Cœæ8†Hî£i-oçmQ£êŽkŸ›nEÙsÝPhÚÓ=ž×µîá203”€Zê‰L@Mtp¯ê]B‡úVU‚NÖ?Û‹Žá1¶·ÜÖvÇûÿqßXºÓñ=w¿Í6ú>ŸØñƒ¾ˆ»²¦»ÓüÕ·ÿ0úyf]ÕÌ1¦Ïr_óŸ·_>>Þ¤rV{ØûþV?Ö¯¬ö:œ¬:z¸?„úcuGD;¾²u׆Œ[]k¡ïm8¶o{½Û½µU³sÚ÷-¯ù€u9·âj¯ûÔ]þ/pÖúÍù$½‰ö ãÌràj%}H—üßnN@úÑõ…Ïu6?¤7Þß²PHŸÍvÆý-®Sÿœ]k’üBfDáÓðì›~ c2M}JæO…5ÿäÓŸ¨ŒíÕoÿ¶Yÿ¥û¹ìžcš$ Ò쟶¢ãÝõ“ª¹ÍÄ~ó¯êÍoýCÛÿEk}T̯¬æÞî§F;ñpq÷>§WzŽq‹ý-Ö1þŽ;_ï»èz–lDwÔlRݯ̵çH% j>“ö‡þwîþb¹õ;¤WÒóóC-6‹ƒ6înÝ¡®w¶w;znLrŒI"‡ša–24 ¡ßÒ?çöí”}‡ì^¦í£fïG¯»ÔüÍßÎ$œÛÿ¯h7þ ×óûÑ%ýã'ñÿÒÆú›Ôºn+2ñó,ZüŠ­¥Îa 5µ½·¼Ú¶–·u{÷9u=¬—à²ÁMŽ®Ï}O®»^×1Þæ¸=•¹Žoîl^iŒÚßöÙ]–²'e1¾v®næØÝ¬¾ßoóKµéŸZqÓðzuÝ©Y•Ó1™M¦˜ofÎc€vÛ6~zŠp‘”5½í1˜©tìôÂŒÍÛ6ÿé%\1ÙêdM 'h}­}m$þnë+kw*xß\êÅfÚ¾¯õFƒÞÖ’H¹ÒVÖ¬¯ôêð¿du+©ÿŽhê>³~ÁëŸÓë³g¤ÜmÜ¥ÿ¦’æ7·n—mæcß§;Òíÿ¦’Uùp¦ÿ7ÿÓä>¯Ž¿ŽÖ½–¹ŽÍpuw7kØïkš»¬+ýLŸZǾ°,,w8„²>®ü÷¯9ÂË™õfFáOéñãù?¾»~•~C½ezxô±ìf[¶Æñu%›ÿE±E1¨)ŽÏFËâ~ô­½íh÷8Ñ5?Ööª¬¹±ý3§ÿìDßQ ˜àC²º{ƒ´-9ƒò,LµÉ™‘5ïkÞᮽôòjfåÄùöÈ“¦áíÛÿ~CkÚÑ'¤ #åµ8³SúÖžÉoþA Nnx nwÆLh—®óÃÝç©@›;[Š~-ÿÈ&m6´Lcu1ÞߨJÔÊÛœ‰{ä qÛü­Íÿ3bÆéÎmù·˜,³1ŽmÖ¸»q¦_Ù4pg¡ý„pó–÷_MD[è×Zë*if®†²ê˜ßSúÌõ7^Æénå²Ák·7,°Ýöý¡­Ùéoo§úVÏø4ê;uU¸‚Áÿ=‹ôÛöðß-¾±fßóT†K?o;3Ýéý¤_Ç»n÷d}ÞØ’“ø,þ/ÿÔàz´u¦Üݶ—Ùê66Ë·8mŸoÒ[½Fמ™Òï!æ¦àuÕ°³þ‚çm{í¸Ùc‹Þù.sŒ’tçî]> º§FÁ©ŽpuUµÞÆzŽ;Kê€ÍÌýäÒ>U^åÊÝÎ÷}é‹ÜàCœHw ™ŸŠèp~¥Û’]¿%ô†F–ÐFéýÒ-Vþ/­?C=ñšœôbdˆнCÉ6¦8†íÕÎ µî0GÓÑÍÝïöziÛUcXi2á·a Û].ýæíö.´ýCÍo¥³/®¤\j¸ÎàëOæýõ;e9XîsË\--²Zíí ú?¥Ü‡¹ØÎfã· ¯žòñ{ùÎ/ðWÓ«÷÷¡»==£`qxl¤@awù­]?üÁê÷7üÛ?Pz‡lÜsý›ãØéå/k='££õ™¥½; Ö ¶6‹KXI-lú!Þ›¹¬ÜáïØ´s¾¤gÓŒ÷».‚8€×Ì•›õ­ÐzMè±]øØ[ÿ¢ÑÈ¢ªÐ¸þ°ãü¦úI7øRá@ÿ¢BIýV¿ÿÕó‚àc]ƒð½곫w¦64Vú^Ý€CbF›a¿Û\FnÒÌb×0…® ä÷´ ¿áv¹ià}bÈâ±ÓªœŠå¶š^×~àc™îÜ›0H ¨š}=ŽOVK,¾ê\@n÷ünh®Ï£gòמ·ë×Öfÿ€Å?ÿ}¹L}úÌ48˜„§oþô(}©x.ã‹ßÓk u·h¢Gaû "9­%®"K ´ø6ÿÔ¯?ÿÇ ëç`âþMÃÿG)ñ‰×»ôìSÿoÿéD=©ø(Hw{»2iªÚi±á¯ÈqmC÷ˆˆQ7cZë©Þ ñ¶ºæÉºz¬q-Ú¸qþ1zÐç¦càÓÿT¥ÿŽ7UÖzV>¼û®Õ/j_ȧˆ=GRȪþ˜/¥ÁõÚZXáÜJã:åxÖW{î`u”`Óögï ,{ï»s¶oc¯ÞÆz^“YwÓõ¶„RÏúùÔ2éôÓ*¬H!ÌuœŽ9 žSÁ»"¦ß¾û1ðë ,°=޶Ûýÿ¢©žƒ¬ÿ ]µßþý*t`AU‚~}óÿ ÿ˜¤›üïøIÿ¤’“ø¬ÿÙ8BIM!Version compatibility infoUAdobe PhotoshopAdobe Photoshop 6.08BIM JPEG Qualityÿâ XICC_PROFILE HLinomntrRGB XYZ Î 1acspMSFTIEC sRGBöÖÓ-HP cprtP3desc„lwtptðbkptrXYZgXYZ,bXYZ@dmndTpdmddĈvuedL†viewÔ$lumiømeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ óQÌXYZ XYZ o¢8õXYZ b™·…ÚXYZ $ „¶ÏdescIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view¤þ_.ÏíÌ \žXYZ L VPWçmeassig CRT curv #(-27;@EJOTY^chmrw|†‹•šŸ¤©®²·¼ÁÆËÐÕÛàåëðöû %+28>ELRY`gnu|ƒ‹’š¡©±¹ÁÉÑÙáéòú &/8AKT]gqz„Ž˜¢¬¶ÁËÕàëõ !-8COZfr~Š–¢®ºÇÓàìù -;HUcq~Œš¨¶ÄÓáðþ +:IXgw†–¦µÅÕåö'7HYj{Œ¯ÀÑãõ+=Oat†™¬¿Òåø 2FZn‚–ª¾Òçû  % : O d y ¤ º Ï å û  ' = T j ˜ ® Å Ü ó " 9 Q i € ˜ ° È á ù  * C \ u Ž § À Ù ó & @ Z t Ž © Ã Þ ø.Id›¶Òî %A^z–³Ïì &Ca~›¹×õ1OmŒªÉè&Ed„£Ãã#Ccƒ¤Åå'Ij‹­Îð4Vx›½à&Il²ÖúAe‰®Ò÷@eНÕú Ek‘·Ý*QwžÅì;cвÚ*R{£ÌõGp™Ãì@j”¾é>i”¿ê  A l ˜ Ä ð!!H!u!¡!Î!û"'"U"‚"¯"Ý# #8#f#”#Â#ð$$M$|$«$Ú% %8%h%—%Ç%÷&'&W&‡&·&è''I'z'«'Ü( (?(q(¢(Ô))8)k))Ð**5*h*›*Ï++6+i++Ñ,,9,n,¢,×- -A-v-«-á..L.‚.·.î/$/Z/‘/Ç/þ050l0¤0Û11J1‚1º1ò2*2c2›2Ô3 3F33¸3ñ4+4e4ž4Ø55M5‡5Â5ý676r6®6é7$7`7œ7×88P8Œ8È99B99¼9ù:6:t:²:ï;-;k;ª;è<' >`> >à?!?a?¢?â@#@d@¦@çA)AjA¬AîB0BrBµB÷C:C}CÀDDGDŠDÎEEUEšEÞF"FgF«FðG5G{GÀHHKH‘H×IIcI©IðJ7J}JÄK KSKšKâL*LrLºMMJM“MÜN%NnN·OOIO“OÝP'PqP»QQPQ›QæR1R|RÇSS_SªSöTBTTÛU(UuUÂVV\V©V÷WDW’WàX/X}XËYYiY¸ZZVZ¦Zõ[E[•[å\5\†\Ö]']x]É^^l^½__a_³``W`ª`üaOa¢aõbIbœbðcCc—cëd@d”dée=e’eçf=f’fèg=g“géh?h–hìiCišiñjHjŸj÷kOk§kÿlWl¯mm`m¹nnknÄooxoÑp+p†pàq:q•qðrKr¦ss]s¸ttptÌu(u…uáv>v›vøwVw³xxnxÌy*y‰yçzFz¥{{c{Â|!||á}A}¡~~b~Â#„å€G€¨ kÍ‚0‚’‚ôƒWƒº„„€„ã…G…«††r†×‡;‡ŸˆˆiˆÎ‰3‰™‰þŠdŠÊ‹0‹–‹üŒcŒÊ1˜ÿŽfŽÎ6žnÖ‘?‘¨’’z’ã“M“¶” ”Š”ô•_•É–4–Ÿ— —u—à˜L˜¸™$™™üšhšÕ›B›¯œœ‰œ÷dÒž@ž®ŸŸ‹Ÿú i Ø¡G¡¶¢&¢–££v£æ¤V¤Ç¥8¥©¦¦‹¦ý§n§à¨R¨Ä©7©©ªª««u«é¬\¬Ð­D­¸®-®¡¯¯‹°°u°ê±`±Ö²K²Â³8³®´%´œµµŠ¶¶y¶ð·h·à¸Y¸Ñ¹J¹Âº;ºµ».»§¼!¼›½½¾ ¾„¾ÿ¿z¿õÀpÀìÁgÁãÂ_ÂÛÃXÃÔÄQÄÎÅKÅÈÆFÆÃÇAÇ¿È=ȼÉ:ɹÊ8Ê·Ë6˶Ì5̵Í5͵Î6ζÏ7ϸÐ9кÑ<ѾÒ?ÒÁÓDÓÆÔIÔËÕNÕÑÖUÖØ×\×àØdØèÙlÙñÚvÚûÛ€ÜÜŠÝÝ–ÞÞ¢ß)߯à6à½áDáÌâSâÛãcãëäsäü儿 æ–çç©è2è¼éFéÐê[êåëpëûì†ííœî(î´ï@ïÌðXðåñrñÿòŒóó§ô4ôÂõPõÞömöû÷Šøø¨ù8ùÇúWúçûwüü˜ý)ýºþKþÜÿmÿÿÿîAdobed@ÿÛ„      ÿÀØ£ÿÝÿÄ¢  s!1AQa"q2‘¡±B#ÁRÑá3bð$r‚ñ%C4S’¢²csÂ5D'“£³6TdtÃÒâ&ƒ „”EF¤´VÓU(òãóÄÔäôeu…•¥µÅÕåõfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷8HXhxˆ˜¨¸ÈØèø)9IYiy‰™©¹ÉÙéù*:JZjzŠšªºÊÚêúm!1AQa"q‘2¡±ðÁÑá#BRbrñ3$4C‚’S%¢c²ÂsÒ5âDƒT“ &6E'dtU7ò£³Ã()Óã󄔤´ÄÔäôeu…•¥µÅÕåõFVfv†–¦¶ÆÖæöGWgw‡—§·Ç×ç÷8HXhxˆ˜¨¸ÈØèø9IYiy‰™©¹ÉÙéù*:JZjzŠšªºÊÚêúÿÚ ?ùÙÿ8éùÃ6¥§ùWò¦ÎO5ϪE6¡?“$ž(bq ~þâgeXœ']èÃfV‹ŸE Ò2$DŽ¿±„&@Ùè?ŸÿóŠwú‰¦þ`˦§åî¿­_Çg¬ùÑe•e—ë"[i%†>J›¤d­NÁ7âÔpŸGˆ÷Æéž E¼:ùÄïÏV{ŸðדÛÌ|EZˆ½±³åÍ÷†îæ)ŽT5N\3aærD{ÍŸWA4þp¯þrjM—òÔTn+­h£ï­öŸÿ+Ÿì_ }Ê«ÿ8?ÿ9Bæ«ùqlßâ󂿯P|}5×çûùy×$zÎÎQ˜–#ù}§ªƒZ?™¼¼7ÿ¸ŽFYtçü´>gõ/5cÿ8/ÿ9D꼋¤ ño5ytSïÔp^œ—‡Ïö$a—sCþpGþryhWÉ:Ûò>mòåýÌpÆXùh|Ïê_JËÿ8%ÿ9Z¨ûõ,#òýsCæR|)*/üàüäÙ 6ƒå4ùùÓË#õêHÓ×÷ÐùŸÔŸHÑÿ8ÿ9*Ѫ>‰å4UbC:ù`u¥é`FV|þZ3ú‘à›RùÀÏùÉ#RºW”ˆÔù×Ë.Ú†?¸?åaó?©F?èB¿ç&eѼœývÿyf¿†£‡üýZ3ú™ EB_ùÀ¿ùÉhÉç¡yF£ÃÎÞZÿ¼†qŠËÊ>sÖ#ÒSX‹QÓõC pÌÎ ³¹‘OZ|2ÍŽ"Ä„«¸þÄÇŸX]Ï´¿ç t]Zò)h¶~xòu„rKeæ6¹±±’ú&dõ¼×¤|’q?j•rèb†`%}ì Ì8Kåßð]¿^„Ýz”â+^\x­ßå‡òÒïëLÿÐãÿó‰~tü¿óGç?”ÿ1`²o(yîëNÕSÌþL±¶ytíZk‹Gy¦¬ ›w¨ç,Dq;²ÐìuóžL0”Hã±øÿëX‘:#›ë?ùÈ/7ý~ÆÎâ_/Gq}¥ 諨ÆBÁqèʱÜ4ípZñVÚ´=³W†S”êêù÷·§âϘ5¤Ôoo>¹kq7š“WÔÌ>fžéå{äi8Å„ü)éq;÷§@3r1€p×*ßæâñ^éÕ¯—5ytˆõámÓ–8ç7VÂBÍ'¤£Ð2 ~ÖÕ+Ó~›áá+Üž+ä²þÂm&îm>ö8>µl@™`–ˆê@;K :6dz1<·d±0¢ˆƒýˆ¦øx@@,»Ëú ëvÚíÈ¿±ÓÿAØ5ñ†èª5Ïþæ~Ô„@ÇŠ î›ïJ£š¿wöx铱ÑC—óL´½žÅ´‰%š 6ôãCZx¸*IÇy%ÃI¾@Z4~hiö† $òåÀGU™=H,‘‚7­ETô$…ß-þ.NM£Xä…‹‰ç ·|“ËïÎý&î ˜“È–¶[¯¬úöÖ…į …åzD8“B ¨ûX8¤z±å²ïè—Èþ¯#ò) üØÒnÛô „)•Ž2*Ý7öÁäÂe1`9r'~ŸáÕ4Ò<Ëgæ+{™bÓ>§õvôÂʉVîHË£æ DÆF$G{¥H˜ŸôxOà§ø`?ÚÅ-–(Ÿca·a¦C‡tYC¦Ÿ*bާ¿ÉpŽ‹T®ºg& ‰¥?e¦1€ä©Üz$WŠ6*+B‹Ô}N!‰·´Î'hzv½ÿ9Cùwõ ,XE¤=¼º’3ú‘Ï2Pq $v5¦Ù7ßvQ;ØMÖGaùmsqÀ!Ю\W¨ã š×2ôÀ“Íü¡}dÒœÇûÉË¡ùæwû¦—ÿÑùëÿ8±¥]y‹óÉ>\²Ögòí瘭µm&ß[¶¯­l÷:uÚZ2ŸcB ¡Ê5ã8HT׆^ ý"Õ¿/õo$~^é/™|×'œu];]°)ªL¬m¤3ª@ž£3‹±c]óO‹ƒŽ (S™Ø~Ay¢?«ù¿Í°ØÖ¯‡Ûý!öͬ~˜ûœ+¢VÃ)â F†‡—>*[oAÛÛ¦"}ͼdãá­¯ãóf^póž±ç¿2êžm×Å’júÓÆ÷ɧZÅekÊ(’ôíááŒVƒsS˜™Ùø»?O>à…×2;’MÈîw,e##e$YÉèA«3ˆ@f^XóÆ·å;_5YhâÅ£ó¦‹.­µå¬WL,ç‘$cnÒa“”b’.ãA‹SÐ:™Ô½’?&ù©ròÖ¤¥A¶é’þQÓªGæ·?ó%òW)ù’â}P†Þ2K3[¸DUêXÒ€ œ5úyž’$ûù°ž4E˜’V ‡Jeü‹Œ¸n6äé„2¥Áq°Ã}W¢å Ð ü0Ó iT#W¥r4 Òó¨ëÐá(kÒR “ô õV½.+@6§ŽIQPi·—IëÁ(¹ú^¡ t¯R7ß4}­í7föLÄ5y£ŽR»#•ì ¥ìÝF¨b §J½/ 9 ÍÞ?k5£ÛþÁ<µPûS“ü‡®ÿR.}6õ#2IXÁ£9+Mýë’·‚h ^;÷±=‹­䤃–‰PºÑ\¯PA V•Ç6½›ígö”Œt¹£Ï äѨÐçÓ€rÀÄö%æ¶+¤Îz \Ûe>–¬?Sü’¶k¿Í8¥Á _È ñôçðùç'Û†¡ïznÇ_¿ô>Óüìüʹ¸üœüûò¿èIí-t/"êví¨5[ê¾%z…`C)¥#zÔ ^“,üq Ûö;iF…¿oTýsì÷·=þ©Ó3·ü}Í4ÿÿÔùù ?Õ5/eo³ô²G±½ˆ„…ŽíÜÓ‹ŸÅû1ùõo§Ã5¤W0Ç{¥sÿTñüνCæŸÊf?Á/‘U¶Õ#BÕa?“Í_D¾J£Ëúè<†ª{RÆæŸòoæ±8|Ñù<ãø%ò*ƒËÞ`?gËú±>?P¹ÿªy/Íaþpù¤èó0üŠïðþ½Ðè­}ìnêžGó¯ê4~O7ó%ò+…®¾…ªÞ¶7?õO#ùŒu´‡Í”Ì?‚_"µ´mb•:¤8õ&ÊâŸòoÏùÃæ‘¥ÍüÃò)¦uæ-& --ô{–ŠI}R%±¸'•Ø…Û9?h}ì¯h2Ã.²Ì¡Ã.®ú;^Ïí n†&8£±6n$¢¿MëbC'è>/MÏÔî@ðÜtü3Ÿ?ð#övBªéÿcŸþ‰{HÿJ‡}kR Ü´„ZÔºµ¬üwÿ$팿àGØ—‰þŸö {IÚ ý ÿšRíGR¸¾·ŠÞkE·Š=@"‚D«R•5Ò{3ìWg{?’y4¦W0â—ùÀíÓÕë¢#–4è Êüó2&tyT„cBíÓp3ªÏ/A§O†|[ƒòyä/› _Í N¡ÃOH<µwêI+¨ IÄh ˆgZWlã;_,Œ!ÅW½×½êû7•]__sô§þrÍÍŸüâçMÅEdòºÂ†»Òk‹xé_öXt¿P>_¡Ê/æ‹ÕÿK¯#ÿj}U¦K~öž2ÿÿÕù¡]Ýéš•íÝÃÚ_iúˆ¹³º…¸É±°’9ŽŒ¬Ç+±ðjܽ‹^üéüÎó.ž-uO=ë—\T« îÚQN$;1õy!ZtÌ,ZhDìt¤dýÄò¯äO–m4&¼Åçèa[v‹‡œµè¿H¯nXšO å²ö–N) 3ÑÌ¢:2Áùåy\ù›óTÿ~<ù‡Zuôë¶Uü§ôÈ2ð¢‰OÈŸ(ÖüþHÜ·øã̵ûÿH`¥“º?éBøQîV_Èo$°«k~}oŸž¼Íÿy‘í¼ª?éC(ãéö”§ÌŸ’þIÑ<·æ-v=GÏwO¡éWÚŒV­ç¿3ªÊÖ–òN¨ÄjŠPœ”{C,¤§süÐÈb‰Þ¾÷䎓ÿ9=æ-NKXWÊÓÆnP8¯ž|ðiQ_ú¼ï›|Ñ–8“coèÅßö_³§]˜bŒ¨ËÉí:_ž¼ë~4ÙdÑ ¥¾§kw{ÓùçÎʉmaËë2½5–`©Á¶ãSO„«O ùøxx@”pÃê&;Së8?à( 8²j¹#eÅ’¸",€L¬uu!#×?4|í£kZÆÚNtKÔ.®æcW‚_LÆbå¬ìÂU!@åC¸9vLY±ÎxäcphF«nV?PÚ­ÐëÿàY,Y¸qfâÊ<'™‰YÜ‘wÃÜw Ü¿˜zµ±¶¿Ÿ@½Kk‹5ßü}çcX.§kxZƒX­ZD V›ôÌyÇS~/á n£ÊG„|ÏNíÞ‹ü¼Ypdx¸ŒHà;J1¿(‘¿+Ûš—˜ÿ3|÷å[xî5?.ê!Ôît– ùƒçPEÍ—¦.«µBW¡'cÕÇU¤æˆÊ<£ÎÅðß›ª×ÀŽ8c‡Uœ|ÀEG-ðÏ^·1Õê¶óyþMJ *aw§ÝO¤Ùê¢Iÿ0üõ?îA€¶·Ižô¬’?.±òwä㉣ z¹H@ØÁ­ù§sî±æÝ/øèF—óS”*8ã#xþ¹W‰q€þ— ÎÕa/ÿœfüÂ?ž_˜ºß‘5Ãçm-7E¹Õ­µ-/óÍr35µÌtžôŽ,&¨ íL¯&¯&Ó\?^ߎLv–k­‰îêÀaƶëÉzM«CóŸóŽäpggµó¶£2­;77؞ؔ²Žb?hý*q@/˜¿.oŸE7gçgæåÄW*VŸâû¹AñV6ù„ö¦^D·õ²Žž6üùÿœ©ü¿×&ôß˟̽7Ï>eÕ|éëwÚyŽâ VÖæhäh®-ø1Vc@êÃzÒ fdzsxüB@m¾Þm¨€E°?Í?ùËo>þa~TiÞFŸó#]Ö§ÖÛþ`i÷ÖvQ[Þ[D°ËQª4D\)Ù$<€©à(§c†2ŒÏ:èoæÑ#\ßúRúÞ§‡ô·©ZþÏ£é×ïÌž!uøåm_ÿÖù#åÝX×u½cLд›ÝsQf3ǧØA%ÌÌŠµfĬÔ^æ›eRä TæžåùùM'”tM'Uòý¯šu[)´ƒuæ¹µ}ãMLº‰_WãFˆÔÌU”ìþQ7ªª=íÒr~ÑùSþr¿þqîÿ@ò°·üÐÓå¸{;ªEm}$‚ñ-ä¶";fýê…bTh+Ó8½Fƒ8œÉûy» r·ýožuo0þRéÝùŸSüÐÒ4¯,ùŠùîìuMCGÕþ¨Ñ_1–! ²H‘0u׈ßr3+χ“ 7¯o‚gŠQ¾'þ]üáÿœAà—¾`üãòÝÖ£e9¹W5uDã"ºHx±]š›O ä§¤ÖéÅ/ýMbpï}£ÿÎ[ÿÎ9kw–šf•ù¹¦ëº¶¡)ŽÊÎÂÎþi§’œ¸GVÌÌÔÞ€e{[–bÃ2OJL³ã„lOüßùËùaqå4Ù\yŠóL†ÿFÔ-$Ôn´-m ‡ëÒB$•ͽXøfÃý ö®/\´Ù(nvå_¸öžšD’'âüHò×äóÛù‚ÛC¶üÎòF£®ØŽmÞ}a¯9P£êÿ¢}AÊ €Gq™Ú&\€ÇØ?Õ{Åö“‡U Òˆ÷s}}åŸ%ù¦9ô‹‹xôù“LÓ.ôx¯t˜õÈî„’\ÊóOçF,èìÑÔ© i\t93é¥Á"#ŽP'†CˆÙ&èôäCí§þ }“Ÿ¡8eRŒÈ”c8zb#ÀcÅ`jêþ¦ç¯É?Íä󯛵]?CÓ´{øÆ¡®ê–šôI¦C‰¤œO&’?…hîÆœkÒ¸3Œ¹ç—4ñ›Èo•ðòª7Ïj&·y^Õÿ‚†‹6CäaÁDÊ„½7{ Ý{mÜ‚ˆërùI¼§sç¿*_isouc ÷Ú“Gnðzœ½Ú}KêütÐfºYõ?•:S2aq"ïÓÃf€î²õzø.ö|'OårŒâ&&B ƒÃõžg‡‡Óï)w›íüÃùƒ¥èzü¬_&j÷^Py즿}bòyÁ2ô&v²%L[(SJ :ÍF}L1ÇS#.h›¹q'“¢íø$èsc#C§ž3,‘œ‡€¯OóŽò¾¬ºÏ\üàÓôá§é¾gü»‚Ö=tÈbÕVS!õc-¦Õg&Wå-yšîzeÔdÇåUDvÿÖþ—6à—§ÌNIèærqq’g“ym±[ÃÒ+Ò+’cÿ8s¥èÿ”Ÿ›>oóOŸ1<¸òôºH²Ó5o»º¶¸Q4Q[úp“W¡5ÊõqŒlÝt¡·™|›´õò×e3á&;Ôæ1äçY„‡0~E&½üÓüˆ›O±´Ô7t˜ôÝ&±X¥ÅòÅ&wgwv"•=v¢`ÄVï|Ëù~ž\òÇ•¼Ëm¯E¬?˜eÕ4´¶–Þm6XDMÆA)äê}N<øªòVQË®má>;$Wèq厅¼¿œ”¯/‡ëô¥?f´§ß¾N÷øþ†‡ÿ×ñŸüàµÛXÿÎNB¡Ê}oDÕ£åÒ ÙóëþÃ5úà ~:£ÖCôçó»Xm[Ⱦl·³Y [Xp¨f«\ÄJÇ+Ê  ØŠæ›H}CÞåKh¿7µÏùÈÍo#AæmËÿú«å­z+ ȱé2Gú2HZYn¾¾ð$G!xK?¥Øâ£ O=ìü4q‘ÈÑH#ÿœÆÿœ©’Ö«ù©«½Œ@GNÓÞãîlÊ-+OlIDﲟds^ÿó™ó”ÖéMù§¨ÀåC¦ÒôÄb­ºš54=| y~gõ¯—Çÿ9©ÿ9K,‘~oêH†¨éa¥©¶"ÌS ÆàŸ™ýhâ$Q)æÿ9ƒÿ9“­Úë7ZwæÎµ¨Zhfÿ\‘-4¶öœ¸z’†¶ZšlË& *ìŸóë`":ò :ÎkÿÎS«‰ó~ý%­}e°Òƒ×Ç—ÔëÛ#á ëó?­°L«Gÿ9Ëÿ9`€´?ÚǤüKiaÑ&»‹:V¸?- Ø™e"³ÿœèÿœŸ¹»µƒ]üòóÑ%•SU6¶:Tóz hþ”SÛ$nÔè€=ñ£ÎÏ̲à—sµ?ùÎ?ùÈà³ýùÛ¬ÉxLÿ¤WQÒ´ãTçûƒ GlìÅ“wäÙ¨ßjûKiž@9ŸšPŸóó“ˆXÅùÄyLy» 3H«7‰"ËsL„´Â·¿™Ùa’g‘?4ÖÏþsƒþrÖö_BÛórF~%Ø>•¤ñ ÖËÊø°ñò8üÊp?ç1?ç.aif_Í‹häœ)žTÑt~R(9°±«Pm¾XtÑ 7Û͇;'ˆüÊ(ÎfÿÎ]º¨—óKO”+,‹êhZ;Q×umìM=§€äRsLõ?2¯ÿC«ÿ9m2åüÁÒ¯ªÌ“yEeªšƒF²¥Aþ^·˜œÙ:ÈüÒùÿç6ç$¬#ŠÚãÌ>WšB«ò¦‚È0b¼~¤·§Žù*•ß¾lxÈ ºüæçÞ© †«¯ùË:uìrÇw¬Íäm HÐp,¨è–‹UwMHµ=1É“ Å#ñe çO®?ç¼É­yÇKó¯æ'š´ý"çÌ>bÕm¾¯¯XéVzxDQ::Ú XbôânJ ¶W0õ™%+Þï¿É·'¾ÿÎ]j üã‡æi’O÷²ßOµ,w¯«¨Û}=³³ÍæÊÜœ¿I~ýyùqç·éŸOýTûóqÀ7ÿÐùÿÿ8¢o[þrKËÖ:v t«ý^ÃS³±ÔÄk1·š}*é#›Ò…ý7£q;Pæ¬wøÜ1ǴߤŸ¡<å¢ù'ÏV¾t×­üÍyº_Õu{xM¿® ’%–gƒqÈÑ H¯J Òá” ‡êçKpüžüàŒÍï<)ås€Ê‚3›œV1ß›…/©'³óµk£Ýèê—©£Þ79´¤º™m’ ¶W¹bªMGa‘”xˆ!˜ @Šß¾ù|wægœt¯>ùuý#Êÿá A¦ØX êZ¡i,àI;\Þ%e`[‡Ù^ƒ¹8šL91C‡$¸}Uý§ûylÂ#É猜iÔË;&ÙÇ”<Õmå}3Ï}Æ„u—ó††ÚMÑÔ.ì—N¤WF+fUº!y(Šoƒâ­;f.§L²Ç(LÂ1•ÈP£ßÉíý¢ö¯²3ë<]–± £>†I˜Žõ;Œv—!»Ö<ǧjÖš½µÏ“’).f¬/•bi¢Ž‰êFH_Ø÷8Œ‰'µ=¬ì½V N:cã”|9mÅŽ8“ÖÌ='ŸªWÍ£ê~FÓtû3/“$»Õ,á¹Q;¤T’IHô݉<ÛöYG‘ßc×å·“™ÙÓv›GmÉ–È T§3è‘@ØuÂÏ-Ü\]jÓ^_°7SÇ,· @^Nî7mß ÀùvY ™ß8ÛŠìÀÈ"›ž™3*¾æ½¹./ÇqJPzbê¢Ô Á§ZšÓjøIÚ•‹yˆzU$Ná=E)¿¶@ræ¬3Q~6ìŸíà²J:?k?ç ¬¦‹ò?ËßUá ÒÙ[z- -­ žD.¢„Џ$R3]««$òý®N/¥ßó“p~géóŽÞyo>êÚV¡k{©h‘ØÇgYc} 76ôhŒ@aϧ¨Ñðx£‡¸®M¢_‰Þ¿Åö‡ü¤>äæÛâáñùuÿÑùßÿ8Åt,¿ç(?+%®ÓjÂOM¦ŠXã|ÆÔ‹Á/s GÖý†óŒq¿—|û :Ù™Sçÿç5¤>¡ïsçô—Á×ÿó‹ò´¼Õæ?8;þ‚úõȇôqÓ¾°SÑ‚$åêzñ×—ZqÛ;}fG6##¹/9­í_Ëå0á¿‹=_ùÃ}YIj5mn$…bMKô~¥ë#C(_ÒÞ™f"»­+ÐS2ÿ‘cÒgäOåêþ·ö/¾ÿœ-Ò¯…÷Õ<æèæí"ßVÓ¯¤ú©CWh„ú¤œŒÔåOÙ¦Gù<ÌÏÈ$öðþgÛûEÿœM‹~gµ{¸qÿexOaÃùåËßÐûb·ý|cù¤ÿ!£û+Äv,ñÿ/ÿCíýЉÿ8!Ðͧ‰ÑÇ_¢ï%üüE—¯ø>ߨ®¿ó‚‘®Ãó8ŸžŽ)ÿQy/äˆ8²þ_¼>ߨµ¿çËÔÌõQ¾ß¡úÿÓÞ?Èðþq_åïè}¿± /üàdö4£=¿ì¯Øñ¿¨£ùx3í@Éÿ8vÄÓóNNµÑÞ¿GúVv4ñÿ/ްûPÿ8|Ä•üÖ¶'­N §Ývr¿äX8ü‘ü¾?™ö¡Ïüà®*æÅ ¨I˜~«œ?Ȱþr?—Çó>Õ#ÿ8®-B~kØÐýtËú®1þD‰þ/±O´þaù¦Ú7üà½Ö›s<šÇœôß2Á$;{nÚ¥-As…ä-@âE7­vÈžÂIýŒ‡oÃù‡æšCÿ8]g¤1^\iZ…ôPªK¨›íV/RAö¤ô•YV¿Ê ä/éíîý¬‡o@ÿù¼ŸÏóˆ:¤ZM–Ÿæ &Â䨊þì›Ûrä(õr( ÔÑIëí”˱ÌÕÏɶ=³ á/ÑùÅMO+þUè~]šâ;©´ç†Ö[ˆÕ•ÚÀªÎ€îÅs’í(ðNQóý/A‚\Pïƒÿœó¸ú·üã½Â·žfÑb§ú­4‡þ!‘ìÝòqe—é?¿Xè?ãµÏðÍÅžçÇ›ÿÒùŸù7Õç#''­ ù‡LRÖ¹TíóÌl›á—¸ýÌ!õ‡ëï×|á¦yÚ×ÎZ&Ÿ¢kk¤Ü¼öšlò]ZÖ³¨ ;ªóF®Ç‘aÄqߞÉDÀذçâm.üµo‡X@kÆô1ðøíá9轎oJ=åâ;hV£à¾«° ý¬Ú:„\‡‰Üxäy)F€|G°ÀÆéUi^›žµÀ’¨z޾#±eàvðƒI¦Å{רá¥Ý¦ñcô ‘ „;5€ïˆC©×·zW"ih¯ÝØà¦6´¨­|GL›íi_n½vþH¦H9‡q¸ïˆd1çǦ£b?–P~íó?Ô=îfè/Eüœ»ºÓü”5 [ ^{¸º‡G´â'»eYaŒ¹ ɉW<ßµ=y¤.®_¤½þ”V(û‡ÜòïùÏÍvIÿ$ü©Õ&µŽÿÍ:l’I/&T±¾ybP#é• Ð€ötœ¨Þߤ2Í´_‚þ¸ÿ¹—,ÛÓ„ÿÿÓùmùktºçoåó2¢Aæ-1¹Jq¾†¤ûPå\$<šÀõ‚ýÕóJ/é5C‘¿©crGVý‡=ó•Óš÷‡cÐûž/ùFžfÔn./,¼½q{¥êR[˜VVa)—ù‡äTùŸ÷Ü«ãX¤­qüÆ/ç˜cùL¿Ì—È´d޵<–Ÿä7ôÉxøÿœ>a¬é²4üŠÖž*çµ:ÐÿL—ùÃæÇÀÈ?„üŠ‹ÜÂ:ȃcâÇùÃæ‘‡'óOÈþ¤$—6ä|›u¡Ëh£æŸ c¡ùοššÌz~¥a,kõ¥*¬ˆ¼õf,Eæ¿WœÄÄÆŽûî9;-8‘+ŽÝÇsÜöïùÇ E5o+éw6Ѹ„µÊ@V°2BXS±*ižuÚfòŸ{Ûá@'ŒÿÏÈîÄ_—_–Gf¹ó5åÇ uX¯ü•Ë{3øþ sr~ úÛôÿž_E3rá~·ÿÔø÷|Õ4W©žT?JÿfR95aê>WüÂ×|™gq•ÙtVíÊO¯Dë :³Âå—CÄ|$Ðu¥s&9‰]ݘä¨×Wíä7‘¿/µoùÇ/%þfù·ÉV¾jÖî|».§­^ÝÌðËu,SÌûÆ•"ŒQh¶súýNXꥎ2 X¯“›Ž€Qg¨Îj‘MºåZ‚tÇ,e1x‰ÆTHØWN¢Ý6øažp!’BðëˆGŠDP½öÛ}ö ÝüÓùÓkq ÛO>‹e™o­,´{©õ3Åÿ[·[^)?M€ñF#²ÖðŠåòìýp–8ÈW‰(Æ=Ò2ƒÃDh×ñlîáÿ~Ì”rJ:¬’8£)L q&<21á«ÚDŽ(ÄÕÃÔi‡êß›þ^ów•<©­>›¤]y-å¹7šŸší_O[‡* Ò6¸ eTs`FÊAÌ|¸³áœ1å<‰ßn3CŽÀ#—¸¸Y¿à]¢¼xðj%—øýQŒnG³áÑ"|_LOó¯¹é>qüÄüÇò–|é¯O®D.<²Ò6›a-÷šÑoíâ{43 ¢ó‘ ‘¯SÓ› j6®Ç7egÀ%9΄O§Ò=cÒ.ì×Ö8FöÇ_ÿ®ÏŽ›ÄÅ“!ôL*2rà”xc3^„ÍG„(îõ¿ùÃ9ßÿÎEy?ÎÚßœäÖ´›ÿ*ëi¶¢y«Ì±E,W¢â²$úœÄ2ª„vÍ6»Q—¢#.b÷õ>'¨ÒŒS®o¬µ"ùwE´7sy›Ï­Í„VÖÑyÃ\ç$‡¢)kÊ ûæ$uùÏQ·qåŽ#¢Q6‰å› ›‹-_͘¾_½¶p¯gsæÍežŒ¡ƒQnœAîrèk52«»—ö0ÆE¡âÑ´s5«Ÿ4~eÚØê[éúľjÔþ­3GO°MÁ&¤Ò”¨=q=¡ª‰æ>]Üþñj1ã'Íç^qü¶¾×u¨ôˆ¼çç[ØÙ©é]k×s*‚Fç™9L»O9úˆ?&8`:?+8¿2|éùyçï7þPùwÌ7Ú7–ü‡æÈ,5 *æ{-NrP±ÝE .¾¤¼ˆ¦ä çK¦ÅâbŒå¹½ù_¹Öç<2áƒç¯ÍÌO2yÒM2ßVóF»®éÚe™šÎÇY¿¹½ú½Ä–Y#ú̲]UjAí—i1Êõg¹§Pc#éäøÿ›R¿årëÞ´ÿ3™ôáìÿÿÕø÷ªÔ]hË¥Ñ_ø%¦Uwîi˜äôm;_òV™å5i:ï•Σæ½VH¤ò·™Öy£{ W‘4•c:«±Ø‚+˜òŒÉ<º·qF¨¿@ çâß“¿–¿’ÞKü°ó_’<תßùvÖâÂöïNVž9.e™L“Å"ü2E6#®j5Ý›6c’2r1ë!ˆõÏú)GüãG–ãò»Îvë'ÂѰ±äµÙ~»Ò¹‡üžþ¸ý­ß™ˆL’ùú¿ü㺄Qä;D±€«Æ×O4jmw•žÁÎOÕµF²É’ÿÏÖÿç©CåO< î~¥`iÿO¹Ø:çE˜ÖCÍeÿüý/þq¿RÓu-6_.ùîõ+Ií$tÓì‹*ÏFYA½¡ 5pŽÂÏÎãó_ÍÇ–ïÌ;?4Î;ÚÞE=¯æW[Ð9¼ŸjIP(9Ö€éÖ™°Ë¢Ë8È >±Üög´'G˜eŒA#½ìÚGüäwåœð³ùï^Õ ·Ó"Ò"²½òrz?U‚à]Ä´‡[FLŽ“]F\¤…†¯QC+ì6ߦDé3Ê3¯\Œ¥½\ïËÌÓÏk?à“¨Ï›ŠÄ j ߀ Hï^˜ß¹sù±ùaw¢Øh-ù³¬ 7NºšúÒòt•Y§H£Ôj„ÓŒKAZ¤æ$û/<ðÇ ‰0ŒŒ†ü‰¡Ïà=ÏUø7êc/iâ2™q”bIŠ®r;ó;_&=æ_=~\ùZÒ5Ù¿;u;{ýÖÚÓN˜ù6à”ŽÕBCöu©P£s¹ï™_•Í#y=R¨‹¾G*ùº>Óÿ‚Ž}N¢ñcŽ"$ƒ)›™ßùÄòå[/óænƒæ]RÐõ_ùÉ=jÿKÕ®~»©ØÜyWPô¦¸ «/×X pËç‹S0FIJ@›£+÷Óƒ®ÿ‚^«U„â0ÇÆŒ¸?š#äú‹þqþr«þqÃþq³É¾nòæ»çÌ÷þiÖãÕZòÃËsÛÁ q[%ºGInÙ J™ƒ®ììÚ‰ ܼm|2Kˆ¾°ºÿŸÎ!jðÇ þµæ9#I‘«èW+ÅÀ 5Gë¾aŽÇÔ‹åóqΦbRûŸùÏŸùÂÛùÞæóÌ`šâCYgŸGÔ]ØÓ©nLN0ìÍdÄ0±wª/üç¿üáŠýMÍÚÚÇe'«gšF¦c‰ö%•* #z ò'²µVHÏ>[³ŽlC«-³ÿŸ‚Î)]K$°yÓQfŒr’eÐ5U|IþHÔq0Ûù¨w¿4ÿ1ÿ/ÿ1ÿ;?0üÝaæ–<׿KÍCN¼07ÖžÑåJÀÛ«²@b)ûYÔâÅ8aˆ<âøºéäŒæKüÒO%[ù—V‹È:…Ϋå˜,`ú–£vë$Ò9¶ *³¤P«pv)U@ *2ì&RÈQcväùw‰á]¿»¯ÑΙ“nÏÿÖøó¬’™!Ø%â|÷Û*2×.¯?!ÿ*´ßÌß/ëó6›¢_ßhºþ¥.¶÷èƒHšMÄvâÆxH˜²ÕYê;f6l£]Ñîo„xƒØ|÷ÿ8åQòÏ™´Ï$Úè^HÔç)£¤W÷wZ€áêg3M"ª£áUZî*jvƬ’ÚLÆ]Óê-#ò3òbKKdÈÖ±Çé¨E<$¢µZDv'Üšå~$ÆÖÎÇ6D¿“l?å³Ün}8?Œ9 g˜äSAzÿÎ:~Jµò-¥)_îí¿W¡3Ì ÿè\?$E?çF²$to«ÙŸº¶Ç>L¸Pÿ8ëùÍ•¼™¦+¯ÛV‚£ç[m°D‚»Gþq§ò2jΉ§²°H´°;{ªä?36TÑÿœaüˆ#øÄù„±ýbØd¿1$pÒ[üã/üãíì·QAäË)%±“ѺE¶³¯þ’‰³;åÿœKü„vßɰ©#öaµª„j%É9çÿ!ZŸó©…vKú¥æ&¤!üáçä)éå†?¾ÿòKÔNÐb) ç ¿!vÿzQÞœ ÿš0T¼˜œ` æÿœ4ü‡ ? d$?À ™‘aá†?/üâGüã鸚Î*W»ˆVX=èëØá:©2yßæ?üã÷äß‘|µw¥éóÁ®K )bTFÕœòo€wßæ8¹„Œo3òüáf‰æu-[ÏV~jò¾°Õ½Ñ ´6ðXjv×rAÖa%‘‰n?m…p dë~]ìNš$ÛÀ:ÿ*ÇåN‘åX®tGËÚ¾½¥j7Z——u û=M­VÚ_B6IljÄR£2±ž>G¯Í¯,xCä-ý*ïþó׿_V™‘Á÷¸\Cíÿ×øí®ÿ¼¶íZñ»„ÿÃS(‡6©>íÿœL¼’ #óNÝ[oÑr€6ír‡0ußHr°ÔOz÷zfŸ²ŠÙ$ôP(ØÐ ÔuÍ\Ed·(—½h†±·§Ú¿¨fdšt2° µGo ‰ ¦+.Ý7=²¹QZó¼iñ«âM–%«£]\ò¸Ób6··ZG©I ?­$mûåhÒQTÒ›š³d€Êmn­g··žÏÕ™G¥Ç`~¶Û Fé´<ú¼q]ÇefyÙ‚º© éŠäKPJtß z©+bÕZi.ßOw–ÞAÊ,‘/@hÇ–ÄL„#l¯Rî7”)ŽHÙ£š"C`z6;o¢ÉRK¸#’(žEYnz1“»pj|«¾wP@©^Ø“ÕM¤RvÙS‚éTdkÔÕ„°¹/¸Ô`}.+6ÓãŽöÞæêYuD•ϯðô#h˜qCU~Õk•Gâ³óßqû‹YÚX2écŠ1¢z ŒoˆñT¼K¥ôÖϼù$zμðÝV8å…6;|S"¾œ¸ìè^«ù}ç-wÌ×/g«k·ú­‡—-VßK´»™æKegâDAÉ 8Æ£nÃ$x¸h‘°/„ÿç>®ó_•ãV‡Ê·Ãþ2^H?†fiO¤{Ü}Cówîz÷Š¿ò[2¸ÚàìÿÿÐøé®šXÈWJhÊ“eæÓ#O±¿çï$úçæ-¸–}*ÆbzPóùG\󯕢ó:F³Kåû{]Jêå#h½ew[t‘T4gäEFfáÓdÉÄŒOy 5Ê`ly»Ëš‡˜¼ûúF/+jšåÅ©ô嶺·¾²f$V±ýhFSºÔø3ÿƒŸXûmÕÉñoæ^±æ+k7ÇQú’3ÎÝYò“ÑôK9«šâAÈF\WÃͳéܲ)ç(?)ü§êZ'—¼Ïws¯ßXOÌvjê¶vW*Ljd†im}S½xƒJ½²X4ùOª`UòåhžX)ñÇüäWæ$™z”~aŠî}JH´-3LÔ59ì“N7VîæYRÒ9g+—ÙyœÏÁ½î6yñnùçÒýÏýºëÿ%rßÖâþ§ÿÒùQù»¡h¾Yóoš|¿åÇôKDôa¹œG$È=U,åZ­¸©§Ž`鲘ã"oÍŽj„ˆ>y9騂XIò‹¥I=³&·¶ýt¾óÕ÷(*tK‚¢//yn´ q5Ÿ ãT° ´ßç×5S¿D¹üâøçËšzž™ Úi¯¬yš;ëy~;û-bê1Õ~‚^ ìÛñî<3*qŒÛ~ž_­Ç;nŸ¯çO™#4Ížwdfn$ùŽæ2 Óˆ ˹;ŒÇ8ǗɳÄ7Í0?þa@Í›¼ù#PqWó$éÇsS^]¨(G¿¶DáÈ|”d*Kùíç`Í_9ùäB@ ó<À©¡­XÀk_ÄâÃäž:IµÎßÌéå¨~byºÎÎDTkiõ©î°ûDÈ¢.§¦ÛaðÇóGÉ"hüÝü×+ù—æÞ£Uºÿª™žƒäÜ86¾ÉüËó9t:¥Ï›á'øGÉ;õZ8?5×ùYe¯ý,®?æ¼L#Ü’Èÿåv~nÛ±†/Ì]ucáE7ˆl “÷à0‡X’ñ‡ç¯çÐÌnƒþ-_â˜|8_ Ž"‰_ùÈΘ”üÉÖ›€L,vùʼnÅæ…ã%‘_ÿÎH~i¶åјzÌz ³y‘gŠÚŸY1˜MAŒô{á8±ßÒe°¦*ÿž¿šÓ]I¨ÏæÁs¨H¼&½šÃO’V^•(ã_ù+\[ ûŸÿÓùIù¡¦K¥ù£Sµ’ÞþÕ§µ‚Q¥|º•ÑÉt•j vÀÐäãÃ{ú ûQ™ç¿›Í£%ôè6,L ­Äô¥í™rØ—ß§Ÿ—R¬ÿ”ß—wÊIe°ŽÖJšn¤Wý†j³ÿ{+v›|CCÅÔ5þêâUýW"Ÿ†fVÎ:(1§}úÓ"•P›öñÊé—šài¿ŽÎ’FÍ é\ÀLB"Á´«[0Ç«èÚ¶¡«Êo[G¹·œ}_÷¡~ª­ГQ™šIicœÑ”¥ÀxxMTÍp“ä=Wß`>ŸìÞ¿Ùl=—8kðJzºJ‰‘Pˆ¹ÙüÔKéyRh?Ck¶Þmý‰ɸõ#kà㔊” TWqÞ”Éøš3ˆú$2pø®&|[íB¢qô܉9?žöF}“(Œ3޳ÂýFò÷ø|÷ÚU„ÆH¼»ú¾·.¥vp$·.V&p \ÜH90¦üôî2'áK„KŽ£WU|òH÷oQŒÎ'¢öÎ_d#ÙÓ(ÎZžF$ñÇÎy7ÛÈŽ]ê¼íÆi(hšöüs^I·ÊÏ5Džrh¿µ{QźÞ[nzt®O5 e¾óÓ%c¢)|äA'ŵ:ãe‰ú·þpö–My€?¼ÔlÔÓüˆç?Ã0uÇÐiÈÒSãoÏ ½OùÈΙC¬ó¶^D¬À° GtʘåišÝL?{øîs±Ù‹åb«ëÚí½?¸Ôn”w Xm–ƒéhC;Šm°ÄóM¦¶Ú^¡t¾¥µ¬— IKPnMiZtÊ%–#«7ÍÓØ^[F²\@ðÇ-LNà€ô¥x7¥Ei‘Œã{œ±°/š( zÔÓç—-›†{æO*Éåëý¤’HuÔyíÄžU§!F'±ûó[§ÕcÏ)ˆ04|‹™›M“Œ¤(HX÷)Û(ü¥&œº„RÝÏwÁÓM‚ ‘㥅çÚàUþÍ|>ù•[ÛI&©OË~V»ó,:äöóEè¶R^0–Hã˜Ô±=GZ³S`*IØ àœ„¾¬£$‚I ;1$–5åãï‰kµ¡MÃJâ@åÕ"E Oa¶#™µ»k ~¬‘ÛšÄRÃZ×€GdR_¨[¾Ô>9dzµË›ì_ùÃe2oIµ¨•¼6†oëš¾ÐÛߣ™¢ÞO‚ÿ1ï ïç/æíê̈n|åªÈךýraÄn7 ÍÔîáýQ÷89eûÙ{Ø'™Ïúšõ-t*>J®K°šqéü¿Þ.?NU·Úž(ýÿÕøÛ,¯<ž«¹gTÿ¡0ü˜Ü‹MPÿÑôßóVLë2y$c ÿ8aù8vX5ANß]šŸñ,?Ÿ’|:A?üá‡äøû1jÕéþ÷KýqüäÈä@ ç_ùÄŸÊ]F¹º‚ VI%C_J7§^ù/ÎMKü•òž“ä]b=+Hõ…›ßAwÆy=F ñ? ‚  uÊõ3ñ1nÓ žÏÉ Và_ùÛΗ¬ê ç™u)—¿+™\^‡~¹ÐÕD{TÏï™I|ËZiQ®ü®çÑF Cš2r¢É¸šôÿuñê<2šlÿÖøÊ+lj4b*kSâ0¸²ä¡d"M 1f{©(”ÌÌv äžÀdHåg›0¡ÿ–¾^Óü­åäÑô™®e³i$¸Ý8wY˜¨TګЊæ¯$Ì—7¡Aú5äÛY¯ü¯å)àÔg°6Io;¬nBQ¡”:·ÂCV¢„9¨Ìxf[ŨÂÝ¿)'u4…è|?¦Eå`FÝŽÙ¨-RÒþò+Q¦êÍ£OowòÌ!Žáf‰ï!t“n. *7q(4SPWéè;äJ©Ôn<0Ò¥Zž£ya$F¢ºUûòך.5Ûæ±[‹µt[÷¹€Sú­á´†;‰Z0Œ÷ZdT¡7Ç_¥×K>|ؼ3ã S±g‡ÜëôºÿÌež1 Aïo#c}žŒ•UP\»(¹­îi¶g—bàÀ†oƒeZZ½þxy¤ç?é^Gmô«/O[{tá^ž;e6?scÿÐùTt¿.ËäÏ3]-<ɧܣ%ÁF¶¤¦ññóäHj’(vÈÌOˆt,xLyîòÄ ]\«…Ä ÍЄ~Œ)§Ý”çê:-ËG¤Ûé0bšØÇ ›ë1zÒæaB|kÓ5SæçâÙõ–?ç*ÿ$ü›¥Øy{ÌÞn’ÇXÓã¿¶‚ÆæácQ¨¬ð£(4Þ•Ì|º,¹I”@¯2ÙâDd3«_ùÍùÆæ ·æ£N¦]6ýv÷ýÁÊOfgî4 ð#›!¶ÿœÉÿœj}›óRÊ:ŸÛ´¾_×Dövqü?hO‹ôâùË¿ùÆÉ(æþŒè.”~0d“óÿ7îOð›Ãÿ9]ÿ8å'OÎ_.RŸµ4ˆá£Èf¿¤ý‹âG½Ÿó“ÿóG¥ùÉåjv­èMÏ 0~G1þ“(÷„bÎH~@»U9|¥O}NúÎÈgþiHœOTrÿÎB~Dµ)ùÅå_û[Û¿7Àty¿˜~L¸£ÞŠOÏÉ9Áù½äï£Y³ñ“å3à?%±Ñ }ù¥ù­Éê?˜¾EÕ^Ù¹Aõ­SO”!­j¡ä#¨Äé2ÿ4ü—ˆw§þkþNêMkqù›äû˜.Œð¾³bÁÕ»ëcùl½b~J zoŸ¿'4»ªhþzònŸj]¤ú½¦©ao´ä$¢¬i¹;àü¶ZúOÉm ™ÿ&F¤úÔ>kòqÕœµu1©XÇ!Å©'ªH¨ØÓ®#O柑I%応^qò}þƒèéžpЯ¦?î¸5+Y¯‚ÈrcúÄü™D‡ËÞ^ó:‘óãZ:Om¡é—/#`êìl˜¸IS\»,v„|Ùaç#äù§PšÆ_ùÆï-è6Þo±Å´[ºò[鋦³]Fuk¨õFZòeýÈ4"§3âxOÝ÷ú9Ç÷|÷|u¨Q¼Á§-h¸ú*Ìs0I>nˆâOþ>}CÆ?Ùò§Ê»æ=–çÿÑù}a«ùN*ù÷JÔdH<Ã}2hó´®Dˆ"!­Ä!H.ÒnDìðf┭҆üÞ+Òí–ŸnÞ*‘aˆîóS»:òïæ‡æ†Ñéú½é[Ê‚Ü1ÍFŠUB†RE£®Pqc—8ó-±Ë (!äò­ü²Ës-Ü2Í<$ÒšÕ‰,NÝÉÌžVÎ9œO>«”¯A 4¿´OöcRçLL€ê¸yJÿþ]Ïoµý˜8fG&Baßá àvŽÜ“ذÁÃ.äÜyÛGÉ÷ç—î!#Ù—"D¿šT÷¬>OÔ´„ûr\'¹—§½iòuóì£;tª\¡Ñ;,>M½$ÑÈkÞ©¿ã‰½¨ô’´ù*øôµ#ù‡ëžæ[w¬>K¼5Fä)Ø/_¿‘ûXˆŠ»SI½ ×E4;l‹÷mÿÚ¤y­ÿÜô:#“û4Œ`,è!åòMÙR‰"ÿ”"ñÄÌí¹bšKaò–³m8ÿp— ´"?Ó¦6J€mô?åïæ}×å‡üóåóä‹Í^ó_´¹†ÇTõÚÚ+%¸·’fˆFÞ¥ …¨H‹—L2dŒ®©ËşÉ‰ÞÐú¯çšy‹òsÊÿ”–V:M¿—îMÐó$Ó .®!-+›fU‰B¡yæG»W"4Ü3»%‘Ì 8kâùòoÌÈ?º*?Ø×¿Ï.¿Cül‚·û4úzÓ)r_ÿÙntp-4.2.6p5/html/pic/thunderbolt.jpg0000644000175000017500000011347611307651603016402 0ustar peterpeterÿØÿàJFIFÿÛC   ")$+*($''-2@7-0=0''8L9=CEHIH+6OUNFT@GHEÿÛC !!E.'.EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEÿÀœ^"ÿÄ ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?òÆc¸òzúÑ“Ó'ZCÔýh¬Ä.ãê:LŸSEÀ2}M.æÏçM¢€¿¼:pfþñÏÖ£ìúR±I’eºäþt›Èxþtä$á@É5r(Li¹íYÏ© ØÙ+•âžhùŽG\ú²5;´ó‰¥7Q/ j8ÞY°æÖ¢÷è^ÀºÍàãp4Óª\œüÔñ6žã扖’xlŒ[á›ÐÒÓª*=̯÷Ž}éžc€N>´œhëWd&ÄÜOñΤä.wŸÎ£Æiê:zžô؉­¦1È‚øê¼Ö¼’ZÎ ÉæEÆÉ¶–W¶Þdq#³wª÷^Îß½‹¶‹i”2X­ÀÄR»cD0DØJéëÍ]µŠ[Kµº·¹¦%óÜÌ#HP’x㥠¸ä[(NZyXŽ€©yqæ¶ÔgØ=M^Ô‘Á¶DITV:“FãK¨¬ÅFzr‚à Ì?a í✌²ŒãÚ˜ôûÁÁ$‚=zTB2[Ì8õÍM$›À,ç¦*-ç¦qBl›*žÌß/\ž´ð…ùÁëëP‰àƒFì¶sÏ ¥¨¬L¨þnåb«Ó©v“Éb~†ª<ŽŽ3J²>Ý«Ç~´Þ¡ÊÉåvèþuf#%‹LÒýî•"¬d`jn=ÐÌÃ’GãO¤PNK} ,úfœ"*2ÆzP™,F‘å<È÷§»€FzàÔ‰¹Fƒšd8«¾„Œx ‚ØúÓ<™‘v«•榎ààŠ°Š’“’{M(½‡©]Àf$ýiã=rßLÔ¶ÓŒô‡hS´’jÒ Çøç@Ê67Δ+)ÉäPÛˆÆÐ¿­;æcØœv9¨Ú\¸ŸÎ‘•‡9;GoZlŒ„€Ù&¥»ž`ÏúÃùÓüÒÄü{¬éUÏ=©„œ­È¨çhv4#¹9÷¤.FrÍùÕ%gÏÊ •dulõ§íÄža9õÍ#¡aÏ\Ô-†“9ÇãRœúñïB•Ä=&ÝòîËv ÓsÎI ŒmpTƒR³|ÿ†)«µ¨9 ãùÒã çŸzi#o§éÁ_n]±éNø¬p@ HëÁéH]†9=}i›|ãùÒƒ¶3Îüé.í™ÞîHíši''>ôÌ“’ÊXc­:6Ucž¢®$±c´†-»=3I¿‚2r=é¬9$gò¦Iç§cI¶€‘[§'ó¥‹gyÜÔ`ç¿>¢Œ•G5·08#–=ø4ö—+ŒÏ­W§j\ç9ÅRŸ`±1@•ÈoBzÔK¼® ßSH±å°~”õŒ¹<äjÂ`üýiÑ0.IrIëQ5Ÿ•²Ž3ŠC$cîî#ÐÒº[¥Ÿ5™±0Àõ 9FÎæaõª‘\*ç†õÏj{LÜÇ#±ëIOK±Ø¤`GùºM —ÌlÝ8ñP—Ü ùÛŠ\úŒ›{´±üóŠ|d³d¾N*À!8úŠb\"·$ƒŽõ\Én#—?xöæ’•¾ñúÒVÇ8RRÑ@ EPNÚšVq¼½ñIè4®Á¡pEiC¬Í…dVõšÆ?—Êg>¦«Æ‹4Ø"Ÿ^Õ“³Õ£¡v/ÿjÆÍ—¶SN•©'6ÆÌd4¹ÇzZYH>Y°}ÍGºPƽ´)l ÷ªSKæ¸`¡}…>êÝ`pÃéPíÇz¸¥º çØRhÚ (û¸íïVH½)A>ÔÁÉæœ"‘v-Nê •ªa®]‘ŒÊ³ÂœqNJ‹"¬Ëfòâå¿xç”¶·¦ÊbèëUC/éNeÜ=Í+ µw¨=ëeøöTçvzûÐ«Žªõ5*D7ðÚZ!ì1ç忤$<ÅN¶Û%ºõ§ª2gkŒبr%²R¹éI8WeÚ ÔÔïhù$Ÿ­AeU‹7N´&/1<Í…Æ*D‰9ÉùºœÔ³«‡ÞœC`ó×­1Ø“Éó3´‚½K¤cï?>‚ Œ²œL€‚F1S{ ¦XeLP¼I@Å9PääæœŽ}*\‰±ɵARAúѬ0Y 4öFvåS¤ ¼“Ú©”±äm4I.P€àb£‘Ó€gŠ|ÏbFÅÉÏ5pHй8öªíí4ä†F ‘D[[r1Œcžô ‡’*·–TÄ7F*„G–“Œtë@ÿÉ«"0HP¡QÌ*I8ɧˆîjÆÜô¾_AëK™…Š_fPr3š•`UÁïVB Øê}©V<œÍl5 X÷¶Éö§˜Ê6TñÄÃ;zö8©Í¾"ýéæ…bšùk÷²~”Æ Ï0>µ9µ'˜é »ÆrË×ò¤)å—2Ý…FË´nçž•0CÔqCE•>µ§AX¯´¶žõ¡®ídÇÝ‚ØHI'dÒ Xàci2p ûÕ§æcša‰”ò)l*—b0~Rh G\œô«>S2çÅ ­Œ‘Á¥p±XÆÛHÏ~´åFÏ­L®* æ‹ÜV ®á¸ô÷¥šËË]Ùià0#ð§î žç½iaØ WEE ö<÷}á@ ÈêsP4EOB*u[ŠÄ€§8ÍC2rH8#°«…9\Ó<±ŒŽ½ °(}ûS^0H݃žô­nË&äu¥) 唎Ɵ `‰V`Üuiñ¨R­ÕqÀ¨)éëŸJrÇûµ ß(ïÚ©2X’™2ÅHÚ?J½«@®O˜ÞõYrãp?Zr.2~ò}iÅ€õ/‡¢ŸÎ‘”îË0Ï­N›dª‘¡õ¨Ö݆Gš Ϊq{!\ŒFåK‘ÐÓ­çhƒ2jU!Tƒ„aÞ i ù@ú*Zå³C,©,¥J‘õ¦°Áçó¦ÂÏÊš“¸AéÍj¥tHÎÁàzÔ,7}ÓOû¼8'ÐÕv‘‹íPTÞ±c%°ß1Ûš~í¬v¶3H‘™<ÿZœ(Ü(HîÏr+ÈvŒsÆi>nnÑÚ‘£_”n9èkUn¤“Åóe³Üö¦1܇£zS×!ÞB稫,Â2Ÿ)ù†çàŠ¦ô ¼€ÊD|…ÈcŽ* I$6 ·+:Ç•é•ç™H ¤‘›$œÖVW,Xe¸lç±ô§JìTmNi›y#ø8ëHÀ«#œ`RhzMνÇÔÒ¢0©ºÔ{¼®F5,R|„íQf3Ÿo¼~´”­Ôýi+´ä (¤ ŽôQ@o0*.zÑE+ÝËqH®6I€=iÆÌ–ýÛ©Þªw➬{T8¾†ÊWܽÉ nxéUdf‘··9ïLÆ}éÃ8Á¤•µ-jsŠ]œf”):±Íi:bƒÏQH[žµ$kšq%}ŒôÅJ©ÜÔñF3Ó"¥çÓŠÍÌ»X¬ tÀ9©V"¬$ 9ïVoëY¹…ûDExj˜B8=jr˜$iÛxéÅK®D#ªUŒœRªdñßµN‹·!¸5 Üi¨üªtR}1î*H­Õ$ŸÂ¬"m¨℻Œ€CÇÍ8Cž0*Ï”GhXŠ1rNGjc û1RŽ9Í1â|ãžsVØ9*ËÛ¶)á7 :}(ŒlÛþ@ÍY3“ÃdœzPÖA[p89¥òî¹¢èCWc1ùHô"—fCÊ}êB”Ölá°Túõ¢à+ÚÂTã=G¬ŒûR¬PrIöÅHvn½é\ _b}ÇpéÁ4Ò ‚­hH¬¨T7ñÍ5ƒ"†ÇËŒsO˜,eùbmÎ9àSX´DãŽ;V„ ´±T’Gzl‘þøˆùäg¥;…ŒàëÐFOr=)¸IS ¹@ç‘ZîƒnÖxèU7#Èè;Ó½ÄQÄÌ@ÜüP`$(QŒTȘ„ «Ž~µqf¬¥7zü´ÂÆrÄN8(…Šä©ÅJd`IØ?»Šx›Ux÷=è¸X¦ £‚£™ÛoAWZUc€ 8üF±ï|¨»Ó¸$·Ø 1Ãzªñ•$Œf´¥…ŸIaØÓZÛr©+Ϧi5qXÊhwäA¥‘L¯«RB?•DÈÃŒŒw©»ŠÐƒóÿõêxؤ`°sC *Ny ÎýpZ¸îKÁQºðÝ*’d1?'qR2*›Štm¹?2c=3Z=]„#Qß"NL C‚sÐsQyðy¹*ŒR˜áŠ13 9úSO³hÕP"œò8æ£ivÇ€À烕éRÂÄG–eÞzTrNeŒùÈÃßmVÐA ÖöÆÂ\þf™,®ŽÔ~c[üñî‘sÆ*)d@í†cÉœQ«VBX»yõ4ý½I‡µDжI z t©"'ûKÛ=jRÖÀ?v;g©íJ¤1íLó œ¸ÛŸN”ôPI%³ŽxèjÕï ‰p6œçéž•».ziìíáXdóÅWFi˜3m_n”åØàÊ€µ ˰²³)•=Jþ3AR »ž¸Å6(c…‚Ë×±©z*«:êû[{´ŒË‘Á˜ÒbªYкjhömo-Hã£T—ÐBÂHƒÁAã©Àyœž隊6qT&Òyôíã 'ýŸJd’ÊÉ‚ƒ~Þ M> Lc±éP3•UÚO¶O&ŸØÿ2œ0È$`Ózê<ßxýi(<1úÒWAÎQE£éIN ojp“…b÷Zph³’µ,Ñy1âqŒ\{ –)`é"qê* `Ýʶ)ÞdCîÇùÔ5äj›îI71ä–÷ȨךgRH§g­-1Ÿã­DIϹÈ÷¦Œî¦‘2c¶ñš±u¨;â§ŒÕ2ب"ÂÔ·eJíU”(úÕ¤’%;G°‘LtdŒÔЏëÎ:PŒAR©^àþ“b{T¢ ÈýiÈøEÚ¸#©=êÌjŽwg½C!Kpy ãô:À¼sÏ¿zyܬ@#žÔðŽä`ò:@Äò±À© LPíSª˜À'©Äa“œþ”®tR‡Ž{xV~ \(mÙéÚ„bé\Ž•vB«»œVZ>ö@þ!Å xŸj\m#G'ëLŽÙ Ф¯FãšÒ´„£«c+œZ®½©g]’.ÓÕAþtî#š1‡8Çâ8¨Ö'w+ó;÷­æ·³…Uàsƒü©äDÐ(b©ÎáëNìz8yÜw¥{fY@”2ðž+uV'˜ýœg³É>¼Ôw!r®dPò`Ñp3ítò‹w7rqRGj#ñ…#‘Þ´E"™8ò{€vš©$²U1*íÆ1ÔQp)Ü”EÚ«óv9ÅS†5›²9 œÕ›©ã…YT(Îþ4Ò®e/Ó­R`A©¸ŸËEŸSçU."xØðéÉ«>cÄY¶ò}J©8~ äg±¤Ø2 I` qÜ3Hò2œ1܃ '4¾b#o'¸=iŠg#ÔzS¹Ðìf†8ëR?Ëy 7ƒó v¦ùIäHà1 ü`â¡\Û3R+®Te$50    õSÍ[w䌚­$9}ø;Gbx©IæcËåF'H×3GgŒlé¸zÑ¥¬) Ì8è ¢yÑQ•yr8ÀªUóÚ@¤Ðb¯‹„1y†"¬\`žAÜ­ .åÉAÏVè}ªÌ„*4¬êÞ›G Hgùãsß'¥D‘¾à®¬á#¯µ判",Þ½zÔˆùˆ``|ÕB2؃v©¡ÉBÌH*qŠ—°ÉU·8ÈÈížÔáŸ0„ÛŽ¹5\:³óéùSÔµ~~ë q‰dq½Ž}i ³I<}iX19>œÆêA ŒŽæžÝ,ŠHÇ4²Û¢õ`‡û¹æ­lÜv‚sœäµ ÌKæÜK qT„GKaI$`ãªëGª<À§æâ¨Éò|ѳœn¥I$2e9hÏ\ðM0‡Æ ÚsÈ5mæX€21G*:ÖzI#DÁ’1~bÇš`¼Žy”L6Ä£ ¦"ü“¤‘-ÆÑÇ=EK ¡‘‘\„屯+#u¤S+$¡Ð·ÝÎ%åÐSæ$¬Ü}ÑÚ„­ÍÕ¼V­n¿ fåÉý*”r@nåÆÁÀÏJÅ7.ÑÉÝÏz#˜«˜½Z{…Žá¡$ûžúSN#Œ*ô•»W1ö™O Ìê¼éR‹Ï,+=TœÊXÖeV,ÌüƒÎz7ÐT# ˆ+Ówñ}=*r΄£8àt Ts±”*ä9ï†Î(‡É4N†0[³*Œ–ÓÉædLg#,¾XE+:©ç~:Óc¹EÈd ¸Àfš·Q29íQBË &QØÓ’ÚYb’arƒËÈùV´ Ó㸈eW9'x*½ô¾b&S G]ÜþT¬‚å† Â²§Ì­Ô·jj—ðI*E2#þ„ ±$d(¨¸*¬ÄŽû)[°ùš2wä‘ÎMVE2~ï ÍŸ¥1äÃ9 xÈ©>М—SÈÀÁþuVŠc8Iö<‘@"W¤ ½‘Ò“to(!03ëQ¹Yð[=84ЙaÑíßp=~î:­G3¶@Ê•' Z|LòJ¥•¥\ sŠ ‰2åöPGýi zÈ|¸â‘œt'n8Ôá0W%]™[Œ6Ý‘d2ÇÊ@Py4Ý®#/Ý9*:àÒzŒ%8ž¹55¼xl© â«’®0zßµMjÛd àtÎ*Zv±WFAûÇëIJßxýi+¤å’Š(¢Š(¢Š(´¢’–¡ii)zR4D›C¯ô¥\ éLSƒÖœùëœÔùŽ/‘ȧÆFy¨TƒR`M 3N ƒä¯V­8Pü ©õ…lþ^HàŸZÒµ¸&M¬ž sJ6eXÒEe˜2±÷,qÈèwPÇ*¢»2à6j»@®ÃpŒÑŠ ¼ŽéPÊJg+€Oc‘RĬãpä³µ `J oUÿ ›VW„¢ˆÔ†#¿jtdíÇ8ô§˜ò„ Žœô¨‹0nç=ýEK)ÉŒ9íªQwxS·©Pð<6/tø·†Vã<®æx¡&Âé@*w‘×§ƒ¼n=1Oš7L¥HÇ*GPGcDhdeQÄÒÕ¾^Þ„£5:çççÓµ_kFÊ0õéQ›8Ž^]ʃ‚Þ´‚år }Â1ß#¥Xü ªŒ¸ëƒÖ¦š$J#+@pÄã>ÕiµÀ9 Žƒ¥0Wäc¹HÎzsJÒ†Ú¤á{’0iì6·îòO ¦:±äõé·½H, p§ úÓ‰y A€S`È;[}ÅK;8È–#ªœPs©Ú~éå…,;“4˜õ¨” 2z~59P,\¶ªÓIg‚*#Ž0F ¬ß: Œ% ǰÉÈ«þZÈsž§|’ÂÆHÀœci' Ф"“ß*8 Ëã'?úÕ ±™dó-åYr_ÂžÑ ù†Çtæƒp"A lA$‚0iŒd°ZÉ Á"IÝ™XïEààt$ã5 Ä,@–ÀäUr¤$Žà518Ü0G"¤óÔ±?)œw©<ñ1 e}*ª…hÈVQÎ:u¢àOçðväõ¨Ú@±…PW?7sN*C® ƒÛ=)²Ùƒîïœâî+Ý€ ž9ê~µ€2 ún×MªK²ŽIÈü)¦9| üÝ(qu'”P«dœ‚Ã8«é$˜“%rHû¹Ô$ †6–L>v‘ŽžõcKie‘š)(îTóøP¡$v‘#ÌÛ‡Vç¯õ¢çPÍÌ^Dq˜Çu䟭GsòZ,Œ!Þ­‚¸ÁÇ©¢òÞHâŠ/Ý£ã%ã qZ"X˹TËþ”8ÈUŸ¡ª‹ i — ŠŠÜn<~"¶b6‚(㘀Ur<Üý= WÕšG„ìmѺŒ)9ôÍ]‰)›½àÊ# ™ç>Õ[½Ä®©lÀd_½O–’µbÕÎþ»NÞ¸¡Ä®Qo¼~´ÚVûÇëI[áE´”Qõ¥ ¥Q@–’”}h”sM¥‹L\t¥‘KÆ}¨Úr0)`ñ‘ȧŽLnHRÎiâ& žÕ/Ì¥ä9d*}êÒÊJä·=±V-¼7©ÜªºYʱŸã“ä_Ìâ¶í<)Írˆ=#óøð?ZÎM'ÜÄ·‚cÖ¶-Ÿ e9­˜ü9¥Úå¦bÄõó$Àü‡øÕ•¼Ó¬Áè úF ~½ZÂI^ãI½‘XÛ\M±¶ÏVGæjÚiêü¶áÇðäÌàUY5Ç$ùmaüG“T'Ôn¥$<„sÛŠ‹Åª3~F¹´‚"LÒ…„ÿŸçPI§ÀÒò·b8þ_ãY–¶Âñˆy°Àt<š‚êÖKi60È?u‡z\Î×H¥J7³z—å×™3öh<ÿñýilµÉ ëæ¹Ys•`j›iæ$i{)&£¸Ód†?1X:ã>†©9î>JODvÉ<:²åŠÅx£†aòÈ=^¢ª‹42¼lÞTéËDç=AèG¸®cNÔÚ©+`Ž;WV’C«À\6É“ýTëÕÇéÞ©¨Í\ç”eMØG‰:6@¹;ªÕÀãÊdŒ *î4É&»°»×d¤¸Ê8?$£Õ}ýª'¹ýãß$Ö-; ;‘³»]TsÔuúTñ)>g x¨¡Úë,†dSµJç'Ò ;Bw `$7O†‡rggU9eÁ<:šis)` ê)þPf à ŒŒ p„— ÇÛ$äT€°¢0$ò£“íQ>âÿ.p9TÆa {#ÇU3,Ží’yÐ2M¹VŽ™¦ï(’&'¨j™eˆÂY³»n1Þ©HRI<´FR:óšh fdXbbNr3ÇãLGtêŠCÀÁëS­Â‚"e#‘Ž´Ÿi\ ¢¸9ߎ>˜¦"½ä ª²[ aÑÀÎ+1ݹBA¨#îý+ML°‚w³Ùà`Tx(ÄŽA鑜S¬LV'èPcæ<ì)’Üóœ¤dtÏ"Ÿ YPNð{ŒnúTq´ed Ì*œÓÙ'O'jÛîž´õ¶i#ÏîׂO?JˆÛùd\dƒÖ§ˆ„ÆòH~Tƒœ~À˜J)l+ÆT…idÜ6Ép =éÀ!^XFTàõ÷§ùd†‘°20vžð eVG‘0³*n)«võëþ5i`uгŸ€HïéM…¥Œ¼‹Ð€JhFqp%rqõâ®ÀÆ{€ÍlrED)¤ û³œ d{ÓˆŠ ÆÙ’~áÎ?:iÜÝÇ5Ç–-™¸ÚC~ØÝØ36ãq)–GÈïøR[YÏol×VÛ§‡œ# {Õè­’m9nR`‡oãÛ&´V!œÕ¼wFm÷[³rì:ûsÚ¬ßI`ÛîS·å5bXåš"®QŸmÇóÕ #ÜZ8°ANqÇÿ®¯a2¤—Ì\@£#q Á4Ÿèð9/ºWsÂãcV¬ª•·x”}öâ«oh%RÊÝnö5B,KªþXfæËàØS$…®‘!FبێÞ8¨NRbL¬ÆC¥rÇz?ÞÚªº0ÎA sõ5¢Ô–WщHS󑀌ÙãÚ™o4T±ƒž2ñ«KqD6©,¿ÆÔ†96Š‹› *¬"}Ñ*cylä€1ôÏj§$f¤anÑî“æd~5¡i ¾bÄ;ÁúÕ‰í¢¸xüÔ0éä)Úâ¹›h°´cËK)ËÉ9©dw3…„…“Ã?:·€¶•ÒÝS9=ÅSÕPÇP¦2Tãÿ];Y äS]¥»*L7J¼3*qJlw±²1UX±Ðu¬éNâY‰ç¦îµ\°'îâ¦÷ «¼EäÈI”çx#ýzÏräåÆ ç8ëMÀ¡‰-Ï_zd¶'9îjÌ7.±˜†0xñU±Å(>Ãñ¡‰;&šåT £Â’1Á¤ßn‰Ä„îä®Þ•› ˆ&z€E5YsºE-Ž:╊¸àªÿ2žsÒËñéIîS‚>”ø~g$zT²ítQo¼~´R·Þ?ZJÔÀ(¥ %´v¤QÞ—䜀ªI=ÑqØn(Ål[x[V¹PâÉãŒÿËIñþmŠÚ´ðƒux€v/úœ/ëRæ‘J,ã±NXÙˆdšôh<#¤Z`Ì)î%ÿÙWίÇ=…€ÛlŠ€v‚0Ÿ¯_Ö³u’ØÖ4¤ú§†õ[•–N±Ÿùi.6ÅlÙø"å°ÓÝÆ€õX¿êp¿­t2jÄ’b…CyÎ[óÿëÓLš…ØÈ,þ²uo±Ð¨IjÝŠöþÒ,þi÷Jzæi1ú.?^K:Áqm)óÅþ½Z€irŸžy@N95\Úy®~ÊZDèXñŠÍÎL¸Ò§Õ–dÖX±0À}¾fªsê7R–#P8©â†k(˳¢gø­Jöit‚t5úáºn*uf‹ÙÅí¡’ì]ÎâI?9m§f±¶O ‘ŠÚŠ8¥„ýV)WŽW•4È®L›­o$Æ9èÔ¹{Ú¾ˆ­mm=2Iõ¨úT³ÚÃp†â(ĬG8¢[‘§Ìc2 =0rWëP>¥2–¶Sµ¹en>¢â•‰å›wD–ñÛ]¶?&tþéÆ=êC*L^Úä1{ôÏ¡õ@ß]HìbP u**¤ «n¹“üm“ù »!¸kï;/¨ˆ Š\HGŒÿ:¤×vÊK’V?óÔäU.­cè%˜Žê6Π[ùfc´PÆq‘»æ'éžõj3{çN;BI+’‰’}´¬oÅ¡Ï*ôÝ’?*æÚêiK}¡åp8Æpôö©JE",3ÆÃÔ¯qMSåÔÎuù•¬zJM¥f-¯G™r®̧±±ÿ&².­¥ÓçXî[|.vÅpþËz5eh·Q‹É9<>„×a%Ì os¼n0Ctüǵ6¹•™ŠvÕBÌ¥QSv2ËÅ[ŽÞ î`,XrwUy"m%”Èí6›œ,¸ËÂ{ö÷«h[p# \Ò‹‹ÔÕ;¼˜úzÒ+¦Ý²=Ds—2 ÜUfrä°>üT”]fP¬<ÐAzàúU}›³‚>cI’'‚{ž;ÔrÍ*!vzH §ÌhG» øèj1:ÁyßwCM„<²g؇œæ“Èîaá…0 šlÁˆàæ¡ÚÞYÇÊ¡¨eŸd¥I+Ø€1S«G$g’úqL„ªåRIT÷wzÒÉ,jO—ÀN@ÎOçUÈÃüªCtŸZ‹Ê@K4„©é´ð?ƘÈe”å ç>•Û²*âe$sÈéW¢´’éÂÛîœú.sZxSQ’!çµAÎù˜þ5I_a6–ç<F”Žç$gùñJsv_˜9ê¿)ØG i¶Êâñ§aÉX¯âjÕ¸°¶l´ÄÎsºoš­S“!Í#™‡Jºº’6´Ëc’GÖ´àð–¡°‹é­¢Bs—ûߥnI{xË·p1ÑFÑUÀÜrÎ9äæµì‡S± ~Ó Mq<äcjƒU5/ ÐI§Í¹×‘  ú[Q"’ÜAҬƈz‚~µ·±‰Ÿ´‘åw),WL'Y~ò1ŽÕR¤–pÝ–½OXЭõx×ÏLH£ä‘~òÿˆö5ÃjVú¾Ä~U•T?ýcXN›‰ªš‘7{övŽæ‘Be’)Ç©Å6Þk+]8ª\8×#, Lõ$r]]éϸ7˜~ã$+êsPZÙ]@KO³j©Â2òM$K;‹¿1í *lòB¾@`=sŽióY Fp¬Jõù†ÓôÍE4r"›¨Ÿç^<—þU,Ww²0VH÷rì…h„C©Ü4ˆ‰ujaç’½ü*éÓã’Åœà#.IÝœLVZZN—'ˆJªq—n¿­hÜźƶ­´Œg!IíT"§œ¶÷LÅ@œ 1–«VÚ‰‚rÒ!Ç öÅCô;¥Äj„tu\ƒQ‹xîá'zÊùÈppÇÚ©i±,ÖhÚXãêªI'#­"£0dUFÚz6r ¡ ËÛÀ@âûË'$ý*Ý¥â̈ÊK?RkDɱ<€®#¤xÁR1B§ïBO${ýiÌïVÀãvOÑwt--VI>Ü•Çý{ÖšP >i¤•ø×1}©Í;˜÷Ÿ(⡞þâá˜4ŒTŸºMWï“À¨nàK#É)Ü9ã“MäÅdžœ~´ •÷¨† ¶äú hÆ~bpaÞŸ'ÌÙäžçj29úÕ"$.ÑÞœŠ­÷›ÃÏáH;:XxR ™‘_wQŒb£—”ñŒ‘Þ‘Žq–Î)²2e$‚¡éÅ>>¿7uõªë¸*x$ùŽãÎ*Z4Nè¨ßy¾´”7Þ?Z+S¢Š(§¨Í2œ &3¼ð†tíNÕ.'ò§;±.öoÜzeA×8®Áô´Ògh`E…GÝ0"Ǹzäsú×”èZÝΉ~—6Ä8toºëÝH÷¯dÓu+/éhð¾¢î9kwþáö=a$úšÅœíÕãÛÎBÂIæ'ñ¨ƒßÝò m?€­Kë#¹¡JºŸÊ³-îÎ_"s„ìÕÌÓ¾§tq÷V¤RX˜—}ĤƒÙFMMokfÊ%¿ß8ý*[“,Ò¦Á*Æ:5Ùdܰ‡ŒHszEs6µcnm"‘YíH;xe@Ï(P¾c: ñZam`mÓN¬Gð¯AøV}ô°I(xCß<­&iMßG©nÇPÇî§=Fž¿KeŒÑß‘øPÂPŠ•ïbõô–—póUdÇÏÐÖ}­ëÙ±+ó)ê§½BÓZ§ñ¼§ý‘ùš¯Œmû¨«üÇY½Hö”â¹w.½íÄÓy°Ç†èv þu ¢Gm×3"ŸöÛ'òZi'm†IØÆÿt ãòªä {‚IœCO—¹½¾Xiíýé&oöFÐ:F¸‘UŒVÈ…Fì¿Ì@õæ£x~Ñ!É#Œqµz}jõ¾‘©ÈŠ„”îcÈöªQFR«9nÌÏ´IvÆ7¸nGÊ3…>ÕRæ$L4nO8(ÝGåÚºËù®iSÜ ÅkZø^ÞÜŒ["·÷Ÿ“Z%c;œGqs(’ÒÞ`Ùä ù:·†/îæ2Ê#€³gôú^‰öâÀÎ~ƒÃÞãùÕ]!¬>BC]ÜÉ)êyÀ&¯Ã¦iö@í×#¾?©­VŒŒîç B3Ò•À¬×$ F€~¦(¸žE;Ï#8gb¯Zz|¤‘“Å;f6Ù‘€À¬§ÃÐJÍžÚM3|ö(e³¼%¡õ+꿨«¾h 6àçŽi¾{)Gò‘Ôæ¡¤Õ˜- y®¼èU×aVû¬§;ª¢¬NA=òkBóNóXÜØÇ‡'t¶££Ÿï'£{w¬¿–sº&ôçÐúÅÔÖ2¹kíX^ uö© ™?z&^ß(<Š‚Ìº6‚ŸžjÐx_!Áø9¬[¸Âm ‘ßš‚F⃠ÅGqÅAä¹7§¹õ©P¤nWy‘Ç‚ %ÁŽyTȬBûýê‹j1hãkð@†±•.Æ‘ŸsÌ®L© ɶ*r#ŸåX·(#!-UÖLòÃ¥kk:Uõ•á†æIÝ~9¢ªŠV)!i$îGAXꞦ¨Ræxã‰ËÌI?0ãú÷©™ftÛ…Þy(nÖ(‚0®Û÷Ïç¶+$Îc¸`n‰+Ü©úU­…byËŠø’3‡éMº…-JÇÄ‹•ʱ=áÒ9šx£Y†Ø$ºüj)¦öEÌxÎ÷ç>ÞÔqˆÆèÆy$2ÑKÕ»¡Ife}¼’»qíõª q!¸W‘ñ³qÀÇáW ‹Ì”Oæ(VÎUçêjâK.»%µ’LÒ¶þ c§½aÞÞÜ]LÞk°à ëVµkè®"FfÆ9ãò¬ü.ß”çJ¶ÉJã)Λž}{ÓÈàârhC~”™ùºÔƒ¡é’9¦7¥±s’G½ÃÉÏÒ›ŽàóJT® ϵRA¾R¶å¥°9«ñi·÷1"˜Jíé#œzSQD:³{²§ÚåšM³ÜQŒ}EBñìŽWw]á¸5¿†¤¸—}ÌŘó„^MlÙøAZî?Þ”ÿR‹fMœD 3‘«0ÇE]Ø5z=þíFè,t'‚?^‡‡•Üê˜þ֯ťÚDòËŸöÎj¹ æGžÚøYØl–áØg;#³iáÓZ÷¥?ã]’¨Œ|ŠzŠilôäiò¤+³#_À².*ذµ„ec þñÍ['=:ÔÙ\ÚTäòÅV•ÉäqëN‘Ï~*«¿AÊ‘b9Ãg úŠŠFîŽ=é$'ü WgÁäãŠB#úêsNgäâ¢sÁã4À\<ŸjPF9ÏTk»ž;Ó²:v vÏŸZsA¥Ü1Á£gÉÆFOQLôÆO5ZêÁ.Y¥ƒj]Ÿ¼„ŸÙ½ÐÔ„3“Nµ'PIà @c«ÈI¬…׸1ŸB?¯zž&g8çåë¸UùíÒëc«ˆ®p“c î°î¿Ê«Ó9âÍËÄN{©õ¬' jc;èÄ2;mʨ{N c-„SÒ´ô6ßSyòÇF3ëÍt–š&Ÿm‚Ñ àfO›ÿ­S9lšGÐ2•q§ï¹§”IPnùœ| g¯FÄDa(¥èÊj>HóG3­±ç7}+IRi]jJ¨žç;qj‘™Nì•ÎáœTP±dPxµÞÇRL-U# q%í¦p9ÂŒŸÀšÉÓÐ6Ö†óþ•”••ÙJWØÓO*úÓìzœæØô'ïÆ}T×-¯x:çIl°v»±¬©÷âöa]Ü &{âœ÷fÇ,a”Œ†„S§QÄRÎ+CñRJ°ß•…Uxdïÿë×]BÃt$ºµbêž²×£{d7c™- Àou®kOÔî´ å‚ïÍ]‡ýSƒÁï]š1hô í²äCÅY‹¶1þ‘¦jpjP,ñ0Qž•¦'Š,*ã¹ж3. üªÌkŽ3XøŸJ´á®C¿M± ƪ¿Œ.¦Ó´Æ+Ó̸m£ò¤çîÁE½ŽÅô扮`¶]×ÇŽîÀWs©ëYû^ª–ɹn1úÖT†ÉyI.¥çç‹VNºû*åªo©ÞÜx×I…¶Û´·’ÖèHüúVmÇŒuI”›k;{(ÏG¸}Ì?à"¸çÕ' VHÆ:(¬é¦–Rw¹?C©Qí¡|‘[N«4:Æ—<×úЖö˜¢E¨®:]Ò‰H¸äœ6)λTž8© …äF‘‘X åŠçô¬®ï©V¶ÆRI$m´€T›oSS·c|XàHãRLñC…Ž.§¯SL¸•-²’Ç"3ÁœÕjö {… ÑÌFÓÑéTäxØ6Âñ©è£‘Ks(vùw~3úT@°ÆqÀ㎕²‰ÜD.HŒzž5C9Àɰ©‰ÊfB~î EMØòÁɃëíUqr  žüuÔÞN}:âœp8üéBäòp1@ì5Ñ—pqÖ‡Øù`㎴¬sÆztæ“ œŽi’Ð…\rAõœ5KûéWnY•pI8áMŒ…À VÀd`óô¤Ëtç×µ9¹bsš]ß/ AÝœv¦+ '9È8§±çæ<‘LÁàS3hqà‚zÓG'ÓÞ”€@>´˜#½wê+Ž”øyý*1RÂ>sô¤ö È|Íõ¤¥#ç?Z*„'jZ( i(õéJ£5 BH^9õ¤Ùj7"`JANqƒMi‘%f[{”’—f%Lå€0ãõï[>ñº-ÎÖÜö’æÇÿ³zç)ÀàÔ¸¦¬4Þç»G,Ä ,2#Ê˘Ü%_CïU[Ãfîo2[<°ã/Åydž¼E&“'•#3Z¹€~áõìz>ªšŒ ŠÄ€UÁáÇ­amlÍo¦…[o¬@dŒzFµ¡“k% ÿ¼¥]Çÿ®—8úÕ¤‰»#XÖ!„EQè£ò 4¾œRLCOL´™ëϽñM& ¡7qÇJcsŸåéN,ãƒïÞ¢f-Œk±\œðÜsëOv?ÃÒ«39<Z’Ç#'ŸÂ«Èp8ÍI+€1Uø=)Œ›»f fÉíøÓå(bÀñÏš¬\ƒ¶Tc'pƽ!yíQ†;½¾´‰–ù·«+ò…Go¯z`MòntO”ü‡98þ”ÀVr£pV|sŒÒ1 …›;GãJ>gÎJ2páÞš_Ì“är6uP:Ó 2ï9ÉÀãÒš0ù‚îöô§9í*>ð<ý)$þ]›”õ9é@©-¹†°¡Ø£Çüâ¢4ÕËrÐÆ[9¥°kèPÉnœ;¨ûŸZ¤ÄŸzš+éÒ[˜D®‘±Ëå Ž˜¨H$qIh2#ךM¼úÒ°Á©/ñ0œ¬g’ò Fo Ž;UíGL,…ì))—‹w,¾©ýáQB¹€ùrìs ÚTóÀ5±q#;‹Ž}N:ö‡ãN0ö‰²'.WcÏݦʳ†0Æ)—¶¤¤ç“¸×wªèÑê´‡dãŸ;GûXëþðük¾Ó泺h§R˜äc¡Ž{ÒÖ.̸ÉIMŽWcåƒM+Æ•[dßÂ:õäTR¿on:VŠW-!’m8#q'®F)ª«nµ#aгÿ4Ò¾”Ó†ÈÍ"`sÈçœSü²NGçN²;pxÓ¸¬By9Š·i9Ç9©zzM¿/·×½%Äjïv9-ØqHIr8<•FÖ:Àn„dŒúŽi0@ÎÜ_JpRÜœûS[ñ¦&†–³Üô¦Ò÷äóIÛF Z:œgŠ;ô£½ñÅI ùûô¤Ez󞂤Š/ŸÔb“.̬ßxýi;S˜|çë@â¨I ŽiqK×­Ú‘iêtMê çSèjÄ`àqЉ3hD‚áqІ­Ý #rj¥T]ÑUï KIùÒŠ£4I`×MáŸ>—2Å+Ÿ³“GXϨ®XTŠØ¨”nZv>‡ÒõXõ—,7ã9zоXjñ xôéR\ùYù[ûŸýjõÍ7TŽþ ILdàðGb+µ£*×Õ[½) •GŸÀÓI9ëEÂÄŒÛGµF_ŸÎ›,«3ÈÁQFX±À•eE’6 ‡AàŠMŽÄÌÙ5^FŽôÍò3Éæ"¬`¬;½r;UYž}¬³ ˆ‚8V?ÔR)Kp1o—hÉÿª.XĈÿ# ƒÈ⣖q,û"œ+Dxç#Ò¢¸wf ž[ŒüáÏAô¤0ÞììÅ£1l*NOÖ aæÍóÄÀDr­»©úëK(òãXÒ"Tü¸BQëÿꨘ¤¨»€?(ÆXÿ_Ö€F.¤P‡$…Àolÿ…E#n¢H™æR2qOvò—“ÀgÇ&˜Šað_•¦!²*(e<žÔ¡"¡ ~Q·µœù…¹ëƒšT;¿yó¸Ý¿ `Â$PI;A<“HI lŸVãšrH,­”#ëMe,ÿ2)QÈ'“šhº‘’¹¤A€X©RÜ‘œÔ­`2O#œRÇë@¢–$î|7#=ªDVƒTtÇQO F½(Ž?1@TbáÐúTŠÄG·Ò£ TFy§ç9ìh7zÔ˜ŽŒ¢Hœa‘Ç = &21´zjre@¤žÀ œÓ‰­èq^Û|ìþDrbrÐ{?÷“ý®¢¹íàxKÄbmJÞF(2¢,6ðz=ÅzM®—#‰"„ ïæpáL½ð­«ÚÏo4¡ÑžLm…Ç< J¥Õ„Ú¹ÉxŸÅòxŠ‘i)oåéq+þñqÏú{ÖT:Σ-²‹© ‚Þlí•×ïcó#==*—ö\—ÒM;à‹’8÷éƒSG§Ém$ UM»ŠJÀ•«CRù_¨Ö‚_%œsC¿l£Šc Üõë6ËS’Ò]²äóž‡ëþ5®y4ûuWå*€\c8=»t5~ºtZÇ š>9ÉÞ?§åD@“êt–SÅv¡ánGÞ^â·­TlF sœÇnÕåñÍq§L“ÀøLü®½?ϵvºˆà½]“•ŠeÁ'¢žß…)A­F¥sµYÿÑÎ}+æ2ó»kINmúuªÜ[Á¼É"&?¼Ø­¥¤P–æ]ÄDœU$·2 Þ ã¸8«Rê°o%luqúš ×³ÎÅ¢‡‚N?xßÐV.Eh="HÎrYºdžiï´.•3üLp+=/ `ΕäÎ cõriÇQ‚Îì,ʧ’ê1“úÔÚMÙÑ$$Ixbòdf®>§ŸÒ¥‚kk;é‰&h‚›|§êß­f[Ïw$²´°3y,Í"³l-ŽÃ<ç§BhÚê2öÌK(ýìC çמ´{=lÅs¸Ó|Mb¤Ë<+o ù>Uó$~Ù,zcÐUýcÄ66H“2ÝÊ1è€?þ}kÏì®­ã„f%Mt­©Yji¶hå›z€ëœ~}*ÓpW ¯ÁÕºÚÄ'¶+ÎÏ•Ôûq€~•¼l#Õ4ÄšîÛË.ü‚„ÿ"xö>ÕŸ¤h>”‹1“a–8)+ŒðAÎsøt­.þ’Pa!@™ˆ?ˆ¯^­W½ñlg¶Ç¬øa¬!iÒ]è¤ !‡ô®l¯ÎKayôé^ÔmRâ È™B1µ×Ï·~s\f¹àÖ;®4ÐHÎLÇû¹þ_΢Tœ~HUé#‡ÀÛ‚_¥'–uçÚ­46+´‚!†h £Œ˘Þè®T>rNNN=é…9ëÀã5tÆwn"™/Ï#±IçåP¤+2’1ŒãÞ‡PÝxÇ¥Lc ›pçš6¶GEïƒÞÀª¥4 ^1Éëž1VYr~QŠn61 ¹ãÅRX¬P©99t eX£p9æ¬íÚ¼rrAéQ¹`¬Á#¿z¥"Z(·Þ<sJ£æà~b”§rzÓºco5­Îkj#'ÛùR``uÏz@ŒÜÔ¨»@ ÓÚ†•ÈFUºTñ7ÏÈìzÒ¸ä|Àõ¥C™;)=A«!ž_Ìs×4¾FHÉÀ5''“׊pví“õ£R×+è•ÎGk$–ÒλvDT7<óœqøTC+ЉF襡ïöë{<ýjÎòo x‘íÙ-®$ tŽCÛØûW¦Z_-Ô ñ¹~òƒúÖéÙ–[f9æ«\È_‹u’'I–húw© ˜9æ¡i8ÅC3$QGoH¨ÃbùCîsÚ –U‚4ˆÏ‡aµC’ÇúÓðÑ4Œó3äÆéP©vffxÙ1íãë@Ä-"ŵØ<€rqŒŸéUÕv«Hñ*ÊÃæ É>ÙïNtófýì+¶3”rsÏÓµFì%“feS HÈ ížô€jóLË"³UÛ út8“2¬…£a•ÇãëRL]¶ùnŸ›ŒäR1^sÎh —rIC>^ç4ÙÌ}²G” ç¿Òž Â€£Ð SÆ” ÅyÏÐäãê(àj0:v ,:ŠB}¼gâ“pqõÀfŸŽ)£“€ '°«ÖúMåÁ;vïÅ;¦Nôð¸Ær+Xé6Ö«»Q¿Ž/öTóUäÖ´K.-mžêNÌý?Z-mÙ¤)Î ¹Ò\7îcw=¶©5y4 Çï.+uîYª§öþ±¨–vëoãä_êi‡wtÛïï½@;5®ÈרrÿI~,¶Òhv_,·u'M©Ò£“Ä’"cKÓ‘èÄn?¥U”iú<»~Éö™T ÅÎBŸOLûUˆõŶy#·fsåäøŒÒ“qÝØkØ­£SãÄZ¬²æK©îŽåZzuì—vë$˜fÁí¸ãÿ¯XúåÌ3ɱŒ;ƒ‘ëRéwb7$¹ÇáJ”½ýάLa,:’Š_Ù×ï£IuqíÊ·î¿v6xÁqïÚ°gÓ!º¶Y¾Û!‘`2r~î;py5¾Þ3mRÞÎè,L™Ý"–h»mÏøÖ=à/¢4rÆÍ¾â bFõ t©W<¦sMgûá/¹›ˆàŽÜ~u¹‡lä³YQkÁ¿‡§÷zõÍRÔµ™õ"€ÂˆSœÆ0IîN+?2>8P8ÀàVÞóê :“¢}žs:¼}>c•?OJ¿öa´G Þ²Ǩ9ëøVX·{ç±ìkBÎs w Î%?úÕ}S+’Æ›F¶¶ùŽK•@7ãœí8÷5¤ñ}¢612«gq³Äõ©Ýš[tÚ¢BÙ*z¯çYÒ?Ê¡“Æáþ•KwV%nuâ.æÒJ®q#ü+â8t›•k˜–[@AIÑCoö…b[Ý^ØÜ4ƒ ­’Èy׊鴻Èõ |4ƒ|ƒ-Œ’½:wÈá*/š÷FÊQ©¦Ì’êçGÔl“íЭ¤ˆ2Ž£QŽ úV…Äuì£Ì)"“åÈ*Ãuõ­-WB’9d±V–^!ç1œòG¯Ò¹»K¡·ì×pù±1ÇO~•ÓJJ¤og5ÊìÍ‹»é×P+r’¤³cc>õn“ëVn4(Ø Ê^Ç1$ïŒ œuÇaŸzÇš£¶ñou%´@ {xì8®’ßÇÚ…¨Cw§Äv(P­&Þ¼/ζåêG1m¢\DÝO b@Ì Háˆ#Ö» o 5;[P%r¢%ù¦{ÕAãk=`¬÷J¶²$F-¥wl$õê+£Ñmu–W’nÀe6ЯL}9ªŒ"÷W%¶º™:O‰#kwŠbßåÜ>^œs]&—ök»q{D]‰Ìª$g5Ìßx-ŸSšXáTµ•÷6%áGSÆ+J SH°³Ž>xâE¿~ÙâŠtå6ö JêÅã®ÙRk â;¥ÆÂç唞­Cwtaßö‰P)#¦Ðs\n©u ö¤×bÜù™Kc:~ÛçIÙq¼üÍSž¹ª”fØÕ‘·5Ž›â¹'û3íš%ȸr}›ûß^)ÚWÃs Oq¨¡ùg²>§ü*-[µ…oEZHòƒA ¾õÊx{Æ—ÚÖQÌ1ùásòŸð>õ +y­FÝ¢zœ~Ð’ŒÛ»1óC¸{Žß¥pž#ðuæˆZU{NÓ(û¾Ì;}k¯“â-ŠÚC2ÚOûÅÜw`ü{ÓïõkígKfÑ爹÷–åFâè ïN¢…¶¹\òb›rÀ¨Ù3€9Çjµ,O ”•J2œ2·}E ™KŽBñõ®Us{ؤW®8Ï4„dÜÕ–Œïõ¨Ê0÷ÇSNå"¾9!:lçå/ä*ÁScUçWÉúUÅ݃*y|r8>”ª£wÍÐÕ6Ÿ˜55¢’BpÑÞµæ3劌`dŽ´™Î~¾ÿ…9­ä 02zqÚš©·;ÆuÍ+¡Ù¸ã¥> ä Ç)êU€ƒÆqÓñ©aPŽ8曕‘—)têy§*sÖ‘†Œ÷§ ÷«cŠ%jü'“õ§ŒïMÇÉëODeÉŽ= d͇ˆÕ"Üp~½©É)‹åéÒ£RÌo˜K#˜ò±®ŸZ›_@#–Mň9öªÒ&{S‹õ9ÓK`šÚ*Æs³Dl0i;SAMéVsØP)W­ /ZjiëfûÖóÎ J€c=yÏô¨¯c1lÌÈPn/Ô69LÕ½ I–iDűó:6cò<ý3ZÁu ¨XlåèÈÿ¦Š?öoüv‹]ö9ebv~ñ! –×-‰ˆäõö5Ëϧ][@²Í#|mèaúUE%FñÀsïYÊ7*ç¹ÛÝ­ÌDô=Ç¥ô5ÃxcÄ-+%¼Ïûà>RŒvI:Ì›”àŽ ö¬6ve‡VV—¡Ò ‘£1ô\c Çا3€xsŒ΀v¢S…QÎMFXt41=ê?oÈÐÍœQiÎGQLÉÿ '$â—Þ§ƒN»ºÇ•{žçW±c¶õØ`Ærj’l7Ñ%±Ö–(¤¶Â!ôQšÐmKA²ÿU·²ì0?Z`ñ©v6i–i °¹Àúô§¡¼põZ»V^zÃáëéWtÛ OW58Óô›1››¦€ÎØú~•Et­[PEåËnc÷wn?â´ßO³`r²pXŸ—#¯Jm5ª_x:t㼯èVÃlÆ=/MºnqÏä)ŒÞ!ÕÎæϾÁþ5¯ÙJù–þQÞˆŒSË4±Ä«÷ˆQWÝÛFÇߩÏ7‡Â6ë™ÞV?ÝýM_±·Ñ„¾\nª2ø]Øüj爖Y4û±Æfh™PD¤€íß'Ðf¼îêçS˜ý‰%[3œ_µÚ’Ñ7 ƒZ8F¢º|ºHÇñ­í­Ôi|ªX.TJ;7ÖŸ¦BfÓ 1°Éã­S‹Z²m3S‡zò?FCê3S>&‰Âʈ±3+tÜ0kžš‘×ö àG¿s‘YÞ&¾Ôâ[?¶[-´ð³*Íféí]1•´Fmw5ïì-®/ÚC$k ä/¡8Ÿ5´º¾¦"òáp«ëÜ×/¢ø– ݰßÇgÏÊÿàk¥=hºZ¤RW,XëóÆíÒ4±?ßIsô5çM}y¡j$‘“9!sòã=wS*rÒaWÔô¬Z÷N[vŠwÄÜmUÝϱìis_pqìKk£oæÂF žª}éþY-°=ûà…ɵº2XÉ" ?.î¤{â®\x†úq±d'¤cþ=jµ’:K•†Ý;¤g°úW?ªÝXÎû &^¤.ýiÖJÃÞç9<ֵͶ­­Î œ «:޳T¹w*ר·i¨[ëÚ¶pÂÞ{Tòá`0ê}y¨­gÔ<7v>ø J‚ÓFž[¨ì­Ö9%q• ãŽàš×´Ôs7YBñ¡)æ¿ÌVqœe¤‹qkc£ß¤øÂÛ÷Œ-õ ¼JSèÞ¢¸ý[H»Ñ®|›¸È”qʸõ¯^hW:1–y°’u®DÖàÕâ:n´ˆÈFIq÷=óÛëS:m2<ô’~¢£$óÀÇjÛñ›•©Émm'›Ã#ä©úV>0yí\Û;3e܉ãüj¬‹¾M½—žM]|lÕYTo^Íß=+H1Q¼–9àÅ\‰?v20Þ†«Fv'zç­Y'3ÉíJBbyAÿJ†E;ðTò“k;U`™8VÊc#œæˆ÷¡qÀù}3V#@¸õõ§ùb5ìÇ¿§ÀÁ=Hº’Òw¥S¸PjK/éžY–O6Ù§Y8_àä|ßÏó­WþÍ(xnáPüã9yÏéÄVFšÛg9¹û>Q†üuãîþ=+ ó¯LÙU·†È.?ÛSŸÌçð5Ka³<¦4J†úp0×ì?û7CUšKk9¥]§”ÀNWÐúúVÊ® Ë6¶sŒ¨#Ÿ¾£úþB«²»BLÚ:¶WïÇÛ1uý7~t¬+˜É'—(h˜ŒrÒ»Ï ë¿Ú vQvƒŽÂAþ5ÀÉHË*uÆAÅIo3A2Ët9v¬¤®h[$ƒ==Aê)ŽøéŠƒH¸MkFþÒ‘dóãaéqÇ sÒ´'>’]N÷ z*÷¨äv»S“´UÙ@¹g  ³vf­Á¤_N2±ykë!ÅV>+°‹JÓÒ2zew7ä)­g¯j˜7w űú •nš?V’Ö£Q/Ég¦Xs¨«8ÿ–qrj³x“Nµ;tí?{vy{Óíü)n™3»LÙè>QW¢Òí EÆ}Hþµi7ä/öxw—àŒiu]wQá¡CÙÁùÕxôY%m×S’}¹?™®¬ˆMÜÜæ«L6ð„1õ#ó¢§®âx¹%jiD©›gn‡oWæµ`•˜¬1®Y¸ 8¬±¹ŸgV?¥Mgp-oY)–­TRØçœå=dîYÔÚDØÆÌŠuÌë×ýÑ\³«_I~©a¾8SäŽÄõÍwú7ˆôýFâHòåL„¿;›°ÏëYþ.ðäd5å¢mprÇúÜÖu”t,¥i4#=Î…å¢Ã –BƒkW16½u¤Ü<’ÆÞdYXr '‡µ'Ñn¼ÝIä$Y±þ¬žÞ£úÓüUjbxÜMnÀ*ȧ${qï\ŠëÔÞQ³}™wIñÔqßZÃx¡-æSæ19ÃÿNµ«âMßT…æ³ÚÒ¹ƒÃíïÓß5æ×6-n«,™‘°T/qÔ\ö«–Ú܃ȆÙü¿ eX3|ÿ®áZÆn*Í©ÝÞ%½*âçÃíÕšN’+î÷‡Ú´µ[c­'Û r¬/ÀÜ1´ž»O~i$xµûrÊwè>eÎ<Ïþ½G¤h÷×QÝJo Z)cÏÍÆyʼnì\¥mÑRßÃ7q‘%¼ÊßïðHü?v´³Ó¯ŠH«•'p;qï\¯ªKªCHlV8ÎçGm’¼½Ò±ôÁ©XYR‰³ µùçÓ8ëß«‡ºô1“¾ŒôM[L²Y…¬f<.ð`)©ï/nît‹µø…Ê>1Æü~µÍéšÍ­Ý‰76òI $$±É·ð#ʶdº{æI8ª£¢Žx­ã+÷±œb¤Ö‡m<–³,±6ÖúçëW.ì­µ¸ B‹ÐÉ1{¯øUÐqŠr’„2ä2ô#‚ y©´î§IMY™ñ5ΛtþVØ‚§Ê§/ÏO¯µlhÁ6 ¿–EK9¸Ç=€ä“õâ¦y#ÔT ÈŠè}ÙzôÏ¿½cËg<¹uUxòÛÛ Ž:ärq[Æj[œ..›ÔßžÙ5Wx.â[]I;tI½Ôô±)¬eòfG 7ÌœÿUX›ÄwyPS*E‚¨Ã Þ§pèqŽk Ó´±¨íÔÆ¦×!F2ƒ³à?Òµi2£;˜-i%Û)µµz“Ò¦]"Þ]GuNãõ­-nù,b…î$7?6HˆÓÓŽ‡ñ5Ë[ßÛ‹çyƒPÝ“×ÿÕQfö)³Z(ìѱom-ÓŽíÂþ”·Í¹ûM‰i6Œ$l8_@_«O4Ö¡fŽáŒC€ÝF=ìj;Xõ]beá¢O˜J€*Äô>ÔãM‘ÝZ@,!–ÅÒGåà$¶ÓŽíùô«Za¹¶+pà”n݆1ÀükbÏÂç®%vör?ï¦Àü³ZÏ¥ÚY¿”Š»×üÛÏÓÓô­/¹Ÿ³»¹™WÈ×PÚˆdv18eÂ9Ç$÷ß¡¬OøsSÕnSÈdŠ1…‹vâ c¶k¨U`øû;KùT¶vƒž¸¥KªÛ­¼ÝZ——fD2Bñσ׵Ñ2½™çúï‚$Ñl’à_Á;mÜè2?/ò+2×ÄZ•µ¸‚ ýÖeÜÊ=tšÔi©Øn$ûFc#Æqƒý+‰·&é<Å#iùàù· %¡|ê73Kÿ d—<ǧá[¶*Lli,0È@ ŠÌ–(nQ‰úš­•ôpÇ4k2Û³•òw¦­9Di–5¬*×:{‰"/ a¾?ø®z½"Ö×JÔôè­ä1Ú]Å÷.ÔrÒP:{0à×1«øFÿIºòçhY\nG·+éN2²÷™޾é…`A9³¤jÂÒñ'»·K»e;^''ÿ_zÇx^¼¹AF§PVC—Úì0³{%f8¦vÿðYêó-î…z%iÛEê1ß·NµFu‰CóžAÆçà¨x}u/íkh4­Ð\4€nc”õüG^+STÕÕ®4ë>®„¾[Ï¥W#¯ÊxÁ¬*Eµ¡¬,ž¦Ç†üDlCuûÈä©ä~>¥esw5Üùi.0½‰îMrÛ~PAÀϯ4á,Š»c’ ñQ Cг4•+»¢MBdšãä9P;þµTð9äúRã×4cŽÜÖ2—3lÕ++Un@%pî¹ô«å}ùÅT™C¼â* õV+¨w*ùTôÆ?µ¿k çÛŠU]ŠÍüXô¦Ÿ“õ öªnä€Ì‡ 2;zÓ„\”ŽqÅ(äàp&=qPØÈJƒÏ§Z!EÝ’Ã¥9ÕHÁ#ŸÂ™œ–㎀Óè3#ø»õ8⎙ 9ô©KnÊ–džzÒ l8·ÖºîE…Pr¤òqÒ—qW 3š‡$Ó”˜Ùƒzc‘Ò¥”]ÃæÎzš2‡·­FzÓéÞ•rqŒä{Ña–ÌŠÄ=¸ÅQ»lÔѻؚŠyäôÏlQfKZ ÷Ó+¥2Vb«50åx¨)ÈûO=)48Ë£4t æý(Rg`ÀG&0r lÉTÝ.ŠTc9Œû)ÿëÿÀ« Í¡[¸ZงwÌc?0Õ²²Úy@Cª\Ävý×}Ο˜Å$hÅÛ§,»^+Ûr‘Ï9Ïä1øŠUëµcÕ¥ˆàq÷?¯F«+-Ùr`Õ­çPÙ`Á8u9üÎ:”Ç|]YZÜýÑŒõuùþB„`j{šì–¸D>gLü£Ã§áU“'ŸJ³©‚'BÖÂØ˜ìøá¿µjpGqP÷4[¿‚%"Öõ2pvçM¿¹{»¶s©ڸôßý¬u;Tÿ:‰Î'uÏF5•wî¤zYzW“êv$0ið!8ó\e›úWCoq ß.FH®vÖÊyâVE%p Iq+i–¾z|Χ,a[FšHóªÍÎm½Íëˈí›ËHËËŒàáT~&²§»¸“ JªIá-×s~gü*+MnÏ\²žG+ò áߦ3\¤þ?¹P°Ø@ŠÇ9eàu==+9'º!.çU¥Û’íA×}ÃdŠž;ÛKd’ µKuš@U7°ÙŸJò»ÏêzŒj÷o¶W(»Np\޽ÅgO2>BÌçw—Š~V©Ãr21ŠI;CÒ$œ\O%´në4@ùŠ9éÆr:І8æ[ù!ŸzB ¸ÁÆ*žŸ§Ò­^<¬Æ!»’285§6¥#EÔn"gˆmRÏ·Ü÷®†Õ¯ „$Ý¢®sÛ¶w HÄg'p>üW]¢ø³l‹ Ë´ñãk³ŽWž¾â±îukWP¿gY°x.8¬wËÝ ¡Qé±:~UÈêÆÝw;£„©5ï+Ÿˆt•·_·Ù*ÉnÃ$=·ò¬ë&Ô§³2 Em5é7(Wí“þÑëMÓ¼Cs¥Û´7P™-äq½^µfç^´ŽÖæßLIŒ·‡çi8Ø1Œô­´–§<ã8>Vd]jq–Ûc&àÎ$L2Ÿä~µV K–2¥¹%Xe•q‚~ŸZ¹Œv)öÉ9vSOïý*Ü—:ͱ Ž@X…Á!G\Ÿ¥sÉk«=,3ýÚi/S.hgÒ®£‘p$A¼9tÿõVŒž(¸Ô­ÞÚcƒÏÇœñç/Y^#IaÓÚYnY[¾O˃ëUí5{™´¤7ÙFà`]H1ðIü¾µtˌ·2eíJÚÙ¬…ŒLúáÄQÑsÔŸ ¤I.b-£]20få„K4;pÙ'Ôå¸Ï?Jçîµcß±ÞJóFÛ£x—b©ïîN;Õ_±j:ŒžmËHìŽg$þµ«inrFœê?u¶‘[ÁçÇg7n’°ŽOï é#oø§ç_úd­svvÂÒ‰I8ïï[ªOö%È'‹úÖw”Ÿ©êbbãB},s˜çs×8¥Û·'Öž:á€éÍ4òNkŒæx#€qíS¬‘Ï‚ðŒý×y?úÞÔ;Ÿ‰Í4ƒ‘z°§%fTÔmn4Ç $¬ð:â9ÕwdsÆsžõ^ËT¸Ó§Œi ¶Y±Ù ñÐóZØŠèÊD[¿ôü=+UÒź«"ÒÚžª~ôgßÓë]t¦¥£<ꔥMß¡­&®u)¹Üþ^3 ôFî@ÏJ£¨Û5ÌäµD8è?>õ†’ϳxY ˜$IÉÊ÷ϵnÚ]ßʯª#ÇvØešßoÝR:€?+wwÐmœënbß‘ÂêÒ~d9ê3ÔZõ=*A¤Û$†šÊ ~ÑÔžàqß5åÃ}-ºZ@ ‚)ïŸsØÉϧßYͺCw´H­„xfbÃŒc éJÖw4[Xèõ›dÕ yôc ·¿2çïLz×9¦_-ÍÓÂU¬î" ¼L¼:öÆ*9­ÍµËêZà·–/žKW|=½Gµdø—Y¤ñ™UÞ l 䜒{c®hn3Õ ³[;x‡EÓ ²·›/ñŽXýp2_j£uã«ÉЭ­¬qÛ´eƒM÷àsŽœ‘Ô×#ûÅxþXí7â!¼áÆ1œ60yã§ïPÜÚ<Ð’Þg˜[dÃa 0ù¸úcÞ“•·Ð9noÉ<:´[­Ö×»ü¸;Û<=ë/ÄÖ~,žÍíç•óv8ôÓ?ÅšTuQû˜£¸Ëó’:ÒfÉÉ99äõ¬½´c¢ÔÕR”–ºõÕΜ‡,ެ91œ…ö®»Áž,··Ó×JÕOdÄ‚¬9\÷D¢±*Ã+ß5Xé6¥ŽØöÝIãð¡bWT?aætZ熄CSÑ'{›Îc9hÇ¡õÆ£žçR³ðŒW·–Ö³ÙI0T‚BÛ÷e=@8éÎ+ÃVÔü;3˜äi u;“³ŽÿŽ)×:ÝÏŠe†‰k§Z ˆÊ¨õ'¹­T”•Ñ“‹NÄy·ÕcóÚÚ8јíqmœôÏZ­{¤+ǺØeê¹àÿõëfgµ‘£6pùíwÿõTxù¸Æ3é\nn÷^‡JÖ¥7Å3è‚­RKž|¹ŸþYçŽú ŸOX¡ŠGÔa3]Ý©±9+Îr}É«q\™ð‘' $ˆ2ŸÀƒŠˆ& ëϦkG_K$B¥­ÙÆÈðõ4˜ÏSÍJqÏ·Ö›´œçô®k›Xn)»HéR•ãÞ¨ÀÆ~´\uçZ¯9`Á”ŸÎ§˜|ïQ"…MÀœžMj¶2þªvqÞ E?xñš›Íp9#¨)ÖbÁ‰Èèi­c¶=E?'þ¦Ž'$cŠqÉ$÷ô©e"†îð{ŠW÷ÄNELÊn}i©÷ŽïN¢­10•³Ðž•!¸NsózSÔ#†árÇ$u¡` ~wÂ‘Ž§ð®–ÉòeÔ ÷{þu"¬sŽqPù $£`{sŠ nP78íÍwpq’HôéNiö4,jHÉ<=h\ØŠ9UŸ„Ï>”IF1»$Ô©#F1ÆAíL’U9v‘ÇÖ¦îàP˜sPVeªíÖºbrÕZ¢Š*ŽrHß t~¥wtc´Kx&*›T:ÀV~‡ôÍÕ›iжa»i=5F±wÑ4Ь×Z6 Ýàp§··þ…M#OY9–€0îxùÎ!úŠ«a:5£ùš”°J „d·Ï­E’í›0ê×#?Æ?ÛùœþtÖ¥lajY’/*á§Zƒ»øO?/ùõªñã9íWõ„dƒÏŠ(Ϋåó篾¥g¹›Üµ±Ùx1ñ-×=Qzýi—2î¥îCŸçQøAñy8õŒèB›yÅäßïŸçXbtŠg£—¿zHîôi¢ŠÑ‚¥ ô¨¯¯EõòÃnÏD“ò«vÉ=3Í`éú¤?fD™öŸ‰É®•'Ÿ˜Ô${6¦ó‡RG'åêzþbßH··d7§hÏ ÃjõÏ#©®¦ÁÑÑRÞ N6WnOÔdÔWZjíyæ“t’n#a{{œÔÉͫś…»IÓ_ÜÏ÷ä 0¼Ê«ç5§m£\ÊBuÀà~}juÜVvm³3P`‰dSíПƣ}Nåò7àÜtãzUq¾W ÷Ž©ªç¶ÌN„fÓšØÓ7ö±"€gFܯéìsïéU¥Õ®dÛµÊíçŽücœõéR øÄÎÑ„ H;Î1ŠÌÍ)J]K§ g[ ¼Cy ‰#’_ø½ë6- ægi1ÐiÒ€Xà ŸAP¥%±r¥ ;ÉÃo D«Žøæ¥ÍN–32î`}[ŠYaŽÖ0ò¬²‚B€ˆy&®4§.†SÄÑ¥¥þâº+HáTdš»4Û,gE9¤•ã·Rã·Ôœ±ü+.óV€@Ööê[y¤<z] œ]Þ§™_ë´¢´D{ÆpO=)wärzU§ Æ0:äš”I»¡â¸\,.bÉ“ÁÆ)Àç<úUS1È>”4‡;‡4r‡1+8ä“ǽ$w/m!d¿Îª¬¯ÎŒÊË‚5?Úí‰óÅ^~ìÌB~*;×J›jÌÁÒqwŠwï&Úl0uòïóÑ«¤[ë¨gó®–ÞÒ#“¶I~sø æäÕn˜Iÿv°~•E›sÜ“ÔÕ]v)S—Vuú‡ˆì33¤2Ê»–4ŒÆmÛ§Þx:çέºu—ìûdŒ…ŒÔóëYß6:õõ§u±ïI»îh ‘£ó Ù¤+ýØ—¯_Ö¥¸åŽO©æ³#ûÞ*Òoûۉ氜Gklh# SÀ8ëUb`Ýr>•*·<`úV ¤YB¤çæ‚ÀÎj¸mç‚) §¢‚8©åcæE‚랢Ÿ%ȺuÊ@6Œ~î0›©ÇSTüÆ-Ž{ j ×<Õ$ìC’¹qæ ƒŠF‘ ¸ñÏ\IÇÍN•4Nb+´Þ¾”ÔÈx碒E ·w–qÚ¬ŒضæÏ9ô ”SÙõcǧ³‰<ì­æÏçÕzR\ ƒüêy lņqïÔÓ[¯ 늟f»ö!Þ£®iƒ´äbžÊ1ˆãžÕJŒûšR‚[1© ™TõûæJ£ÊàdÛµM!Ë{Zo‘œ.(WB{‘à¨ÈêiXm;sŒúúÓ±ÜÔ›Aw~F›bHFF@Á÷Sˆõ튓o±Hq‘‘Ö¦æ– (s•åºT°1 žPã»Ab«ÿê¢0<ù¶œ}iÜ–f*—¸>jîLž¼Nž1m¿s íÀ+È]¤@–É9=sOš!æe_‚8ó]6×R¥%€ XÛÉæ«•À ·NÕ:*¦×f>Yè£ïŠI2q°Û×KÈ`[äíµzô+ ƒÍ1ˆUÆÐÙzbœÄ ûzUXd¥²>÷^ç½FqŒu4,ŠLŒsMwàÒH¤j;‘Ò¢lÖ&5))Æ’´9š”dtàÑŠ:YŠ@zõ­ø¯-/wìùT±òIéÏè:æ ç¥^´¼–^(åJ’=*v5O˜½ª}œë:`¾å—·ÍÆ?Ö¨''Æ´/§¸¼±¶žæå%Üïò¼§<çëÖ¨/ TËrã±ÒøMößH?é–ñáSêóÿ¾jŸ†˜-óäË&þ‡úUíWþB3öù³Xb~zŽ^…LÓ…6Ÿ$¿fҮ‹fÝã dã¥rB.R²=:•89¾„‘[Í;mŠ&ú(ÍYŠØü§hªS{+Óüræ*ÝkW÷ÈU#dcš¨¶®ÄnÂç «3jÚ‡ q%Ëáv®~µ7Ý2ºe”6ó7-OÙ§¬Ì^1¥jQ±­7–d’& I”V¾"òò¶°ˆý«*óY¿¿oô›©\wä*¹`W%¹ÏN´ôÂŒe:“øÝΖO …|‹4óñ†‘Û<ûV=潨]±\Sü)À¬æa´zžxôÕ|c'“A;†{Ò2äp~•H‡~…¸®w¥µ|qëÜö©’qé늦$ãÞ•Xõ5&—L¼Ò³(\àÔÒøÏ'_Ìà`S÷né“QË`%g w/J–åÀqUÔ1ëÖ¬EÜzŸ¥L¶Y^G<¥N21Q"óÈL‰‘É9õ®y #mç9ãò©AÚ1ŒqéQ¤gŽ:©çŽ1Y(pÌF=Iþ”ÍÌÄáNÑÆqNìÃqú`ö«àCêO¡§¢&亨‘$˜‘´vÍ0ÆÊ¹Ú¤cš°‘yÒª®'c€¾õ6ÐUÏÅ1Q˜ü€qÎÒ:R;ŽüƒŸÎ¦YGLRMù²¼jb d Çéìj2ÜåWëZ³#¬£/žIíÞ›¿Œap8Ó'•N2yþT›¾bY³ž ÷¥cÆ00=0¨ãhÏáÓÚ’É6ìùxà H¦ò>ö)¡]9éãv0àœõ¥ ‘ÄŽ®ª:õ¤ŽM‘²…W'?xgÖRÜZT‡{…@ÉåŽ1@ wÎ0ãÖ“v[ÆyÉíC&ÅÀüé<¼žz昇˜qaÛ±ïQ¬dž„c“žÕ)P§€px;jM¹;†Ç~9¥ÌRˆ‡*¼ðëQ Ç-Æx©Ù[w9À 0º¾à‚§5(²'Ù‚Iävê-§Ó¨ïRIµ›÷ÍFãž¹ÅR!ê708jž Žß2óŽŸw¿ëPíls“ÅKÚ¤*¸áyëõª$æ®$;mP¤œw¤ácµðqÎxâ£ùCT‘“R9ÈËn½«Ðµ´1ßP–FœÐV?“kä‘È=¿S¹T8íŸJk|ÛHÉÚ„1¥ŽÍ¹àJi#ŸÒŽüô¥#àcС œ€(9éIŸ¥“Žô àzõ¤Uù³éJF#šy|uÎhnÀ£v@E0ŒÔÎÈ~§ñ¦™2DxíE)¤ª2`i(4S$Z–|¶Áû§­EF) ]FÆ¥9w>¹S[Ú…œ“Ç Ñ.ì G^•Èxzùmµ;u‚Ä_ï1À^ÕÙM¬ØYD‚{¨÷Ô;ÏéQ8©G•4jºrçF|z}ÄŸǫ̀õn*ì0b7»?¨Aýk"÷Æ0²´v¶¦@F7Lp?!þ5‘uâ Rûå{†Dé²/”~•ŒhEntÏRZGC¬Õ/-4q$qC$ùFÒßZ殂¤ØàqþÕAÃ9<äô¥‘Ã’¢˜ŠIïéÁ«KA1¬ žMƒŠà,=ÀéQ´ETçzPGäàó@Ž˜©âôÏ$úÓ’,7«{ñŠW,+qÏZxŒ Œâ¥ÚXz矩§cåÀ#?Ê¥²’ 0‚A—ã#©8—qÓÞŸHõëÒ…UaŒOïJã+m+Œ{Ò¥0°G^´ &9fâ¥ÞŠÛY†XñšwŠŒ’ Üã9âŸA‡àãך±´SëõÐ@\wôõ£˜VòäªàößZaa±À=©¾ROÊz=)>îBSÚ‹ŽÄ{N0ŸåQ8bI'êO0~x8õß<ŒëM wäóêM3Ò§6îò:¨rqQÈrÆ}=*…¨Â¹ ÅvñÇ¥H8 Â>:÷5Èd'§''­IL¡H8¦2̱‘HpÜØ¥ÊH å“ÓœƒíDÈùbÇ8$õ¦¼†] ‚p¸ÀW£¹Î5P±Æ¶iMþ‡$½#p8lš¡\N8æ‚qÇ󤜶hÎzž)“qÄdŸÃ)ÏRsíFs@î‰c$sS¦KsŸ›ïU‘öŽ˜ç¨« ÊÅ[i'¹³‘¤^„l0~aÔôÛŠØä“ß¶*&Ç8Î3Öš`Ñ Ò1RÔŒÓJÑI ÍZ]§5$vîøÚ úSm"dȱ‘Í(´!Ò¤Œbµ-´x+3n$r+W„M£A½Î}awà)&¬C¦Í)û¤}k¥ŽÚ(À ƒž8…Bž?Zçx—Ñ*1[™PèØ½<öÛWcµ†W#<ç­Zè{:ÓŒExeÁ#±•IKvh¢–Å~ÈéšzÙUëœâ˜s¿Æ:ôä¼ãxëR"L Ãpú‘J'+œšPF¥ËaTòŒã¥!ˆy#œsÖšØ Œûfœ õô ‚Ù8äRÆBɨñÉíÒ¬#o©¤1ÿ0ëŒÓ@V;SŸ¥Fc ŸAÖ­lRÄ•àzE=`ÉÎJ¤Åb‡ÙÉP0Ç=)VÔ7 ’:ôÎ+M!@è)|½¨S+ì»ØŽËØw¦y8ÁÇ¡èkeÖ4S·œãŠ¢ñ±rUpÁõ4”›‘]`ã@ã&œc*øÆz°©»ƒ¯5!ŒŽrqÜPØ$P’-ž¿‰ !'æïWIPx#®)<­îëךi±4ŠËæµcÊM¹ûæäägœu§,cxÜØ^ärh`©Æ1Œr©Â¢{zž˜¨s”=z÷¤bzõþ•›E\•G@[ži ‡øW G\Ô`Àí=ièA9ãµ;!\O7œdéPo< ¨êGjs  Œôû óÏÖ¢ÜÑœÞ) ,Ä nËõêLm$ ݱP¬ÁóÇ>üf¹wüþ¼åªuÏ~¼‘ÐS'*"UÛµ2†ùH8è*,ëÂûÓK¸_°Ð9AÖ¤Ôv"¨ŒdŠŽG8äjw‹ 9o¯ZdË„éøRäŒÏsïC"1ç+>£äÝÅ(Óš~~îA#Þš3–$ü£Ó­+…€)Æv•çîi® #íÖ¥o ïša#p}Ç@{ñHc’Í–È=9éLPªX¨8Î9þ”0%›aƒ°íK“¸) |qëT‹Á'<žAQëSκ•Éb;ºc‘ýÞ”á„`yçœåV>Æ@ÛÀ$U˜lB€Xf³u"‘j%%Vm£®z`œŸ•ë[‹oƒ>½3R%¨ã (ì=ë/om‡Ê`'ç=jEÓ™€äÖ÷Ù—#ÉâmÿëRx‡Ð~Í‘éh¿{ÑMÎæ gž§«•M¥I8ãmG"¹zïPï Ás‚3S ›ù¹ŒóùÔGîä®îGJi2Z!\‡È'*F´ÊmC“üê¢Oå¶W†Ï§5ÜãqS¨h,YV9pAþ•*•”g•\ɽÎボ’8¥ßÕXçÒ¬DþFÖ6ëúTmÁ<ži©p¨2ò?­X,›j†Æ‘Xrzç¥8Í€2µ`Æ›²Ç 884ÂÑÆ˜'Ôf¦ã±Œ¨ÅÏCéG88'žFi@§ŒèG_zs?ÍŒƒš}D0àÖ”°ä¸íI“xäR€¤Žy=Çz`(EÙ“ÔÒà`cR9P09#¥3“Ž(¸Çª·P£µ9±ê@ôïNT#ï zŠxÉÈÀ9ô¨m"3`Iqô•!Äa\Ž¹Ï¡© œ¸ã=­#ëž6g=Í+±ØB@ŸNô R 3Ö‘À¯ÆqNå;ƒqÓHöæ˜d9eΠ¦¡V;X—'©‹±9sÓ4ÐÙ8`u8¦Épxµ4ò}0{S@HÀ[pǡʀÀ“õ¥0H|œõ4n=Ç­eÆÌœœ@É#¡ôöúT[K7ŸNÔíØ9¿ð¥`Éç 7s€Ùc¿Joq‚3޾´¹°pE)l`ÿõ©<Å>øíMàr3Ôäõ§¼u#Ö˜º‚C¼1šfv¨ƒš›*6“ÀéŠk•<Àý*“Ei2°9ý*<‘ƒŒzb¦ ƒ¡ëPç yúCVˆê8»ç†\›ùÓ Ü®ZWÁaÆÕ¦”wgŒ{QÙªnÀ ò(Ìr’Tydç‚~µkr‘èx«©*Å£ÝÎCg¥RsÓJœB:„`€g·<Ôœ “Ò³m—d1§cNî0A2iv¨,pTS‡$pžzõ©6^j éÔŠˆ~OzuÍC/'ëBF5m Ž´ð¼ p[ž¹¨Õ\ðÔŠ“y#®(½Æ:àRŽ0A!zã4á×'µB€I¿J Ç9¦O ÔðȆÈãŽzb£?7 u40õÁìpz OQ ’MÍ€W9•^Gn­ÉÇqW£`¨9MV¼ˆ  ‡¯Ò®.ä½ ÄæLžqH¥‘ºŒuçùP Ðc¨£$SVfY|”`ylñŒtþtÑ÷¸àvÅ$mòaÇCÇ=;ÑŸâۃס¤Z­€s韭%×Ð{6ŠTRÊq€qJÈw÷)òØŽN{P=àhXImŹTÉå(?¨'šV€ØÎ~éTÆ2àòE4¤ígŽiÄû‘Ž0G=ê¬ø Éàž£¾i1ÁUÏ¿4´6 ˜£-ÜçŠ,%€³`ŸsGB3Ïlt¥I6! §¡nÊàúÒµµ ܯ¸(ŽObG4 š„•à85Ê«€q€zçÖš“Èbòñó/ñÔÞ 6HÌŒV0BõNzŸ¥'@FsŸzMÙcœ`p)1…<“Ò€x·½Ž8¨Ã'Œ`sÒ•Ÿ¸è{Qa\qo›±âš[å œ{)¢EföõÍ5ˆ ž8ä SÇ ½AôéL9ÎW¥1›µDÌqßÞ©!\{|Ì[‚1Q³9¤/„<ò:ЬÎIÎx÷êkHÆæmêO¸d“Ž:œÒÇpªs¹ÇsФeÚÝG>´èæpÜ`ŒM_ ygs` œc¥;È H=;R7‘Æõ§m?tŠÏ™•b19ü}jB…”œSC(p29ô”¡ØžPm=xéL GÂã†4ܪÁë‚qŽià}ÒyÍ.í¼Œ@1S<È$ö§uS¹pcÖž¤zdúw¨€ §ï)ÇOZc¼3ck.{žõ9bBð}Ozz’®Àã ¨“‡'J, DÞµ›p‘KvÞlQ²·N1Òž\o*~ö3õ¥t&%'îƒÓ®j–äIhR#©8æ‚>”p;ÐèTì`Fy9£kg' ëV@¨GsÇ_­<2°AϧP~”Î@#nÈ`zóHd™F lw î'ŸZi$‘ž? š.Äœ‘éKa‘ÙÈ?Ê€åW§9«rB¿. ªñösÎi©‡Ÿ¾Pqîiw¶pFFsMa±éÒ˜ÒaÜôç¥RB’䲞sߌSÕ˜)ÝÐñŠŒ1‚NzûSÃ!ç¦2{SHHV=ý»ÐKey;OóQ¤ ¾sËñéMVo0’zr9ëI,Ì 7/#«“òáT€Ý=é%˜¹¿ZjË€NB{ vÐ/¨Öå9š•S{|DZ"¤HÔ£68#Žù4ÕÛ“±°}«'+–‘ÊûwÅ86\RùxaÔR2‘Çê”…a’8<ûÒ«18#éJ!cŒƒÏ­ WŸ\Ô¶˜Ò$àn錟Z3òŒu÷¦ò['{ÓÆ0^ƒ%Xa#ž¾Ô˜1îE8’8À¦3sŽKz†˜Xz®WØsژŸ*'ÐqMÃ\‚1G#Û#=(í¿(Éù»Œu§¹Û`*bzšbžÛJ9 ûP eÆXR…f\à㯥 8õ>ÔÇLOJiåxžßZfqÁ9ôÍHÌ?‡9÷¨Ë)##Êš9à‚áQ±#€Oj d䟥7€8éÐS$p$ç¡Ï¡¤Î9<Žþ‚˜OÌr)½{Ó°®L«g=ÍH·-œ2œîöª¥¶¶E (ÜrNzç4r…Ë‚QÓžh2ìàzU11 Q!Æ8úg4r˜´%§9Ò™sž‡žµPJ3Ó¿z<îx<ÑÊÅ–“wSÉìM0¹ ÅWiHöÊ‘œnÜ:žÃµ "¹>üŸ¼1ŽçŠipzàÔj†ÙLyŒç5J"¹;Ê0}=j»Ü¢ðAÍB[o~?:­+ Àà`qZÆše“+dÜSL%¤Éʆ­AæeG¸¨ÜíÀ^=kU=:çõ§Û:ù‡*Ž9ªîr¿¾qMˆç“Ò´åº3s±Ò?Ç’E?kÆÙHCÐãŒú ²"F-‘ëÒ›$ ÷rØôÍy×:¬@\:’ÀïÏQHΤ’3Њ“ÉòÍÅ %—s` b£œ67{R…ð9úP#åA8©š0;ž¦“é~P£$€9Áã50@žœÕ‚™*I<Žj&Œ<š‘æðOoæjuõ{æ˜Ñ “¹¸Æ9§[Ǿ5bÍŸZL ¨ÀçÖ¢v#Œsòý*  ü»SZPÝHDÙ ’y=vŠrdGóã9'Ó5"¯ NP“H"B³¼q@ UJ…$¸Ï•¤Ø€(Úx¥Ù¹XnaÏj’T iu.NsH7÷<çHO9-Œ ‘K³Ì O$søÓL ÈÀ³zŸj«Ç8%ð¸ÏQÏj0IÏãšt‘*F»G8ëøÑ·(rOJAqŒÉ¼¡0Î=J©çDè2T®Hî>”Al„÷ê‘§F»2ÊNz~”0Ü ¬SŽH#©>WÉ ö§ÜÆ<öÁ#>”ÅA¸uªó}vHB¸8èM][tmÄ–ùGD`L·^1M2YÌ%¿ –) =}êO%XóëŽ)c·BóøPDZc(Î6x\ÓÄ2dn`dÕ±n‰FrEF$|Ä}*oØkRlíÈïïM(у•üªÎÏ”üÇ¿áNŸæoº{úUs0±E—ÉàrqJÈIì9ö«‹‘â ÑȤ¹…b\©9/>•kRW ¹T88â£`¥—vAïØÔžJ„'&¤XTƒ8ÎÚb¹Q“ƒ»œ÷ÍM±ëÒ¬Éi‹ŒŒƉ©#8Ò³r¾Å(ØEÊà8Àê? É,TñÇJXS/ËP3(CÐÿE‹lŽCƒ×$u¦ÚØÛííR"n|< `òIàôíM!\h•”d¸=¸¤¸ŽÏB8Æ6)üi1ƒÉÀÏìÇ«`æò±çš‘£ OB?Z`Œ’M+ãÐo9à`zÔ2[¿ãSĸÈŒ$Œ4årFGjKpoBÇ#Œ Ž´æ`|Ò×$œÓÚÞ§''?Ö˜\„¹¦~”<…Ž[©êiÆ1ŒäõÅ3g'“Á¦!ìû†3Š@üŽ3NXWn2x\Ó^0£#4 ŠI06ãñ¨Äœã¦{š•†1ÏSŠc@¡”yªKB"ÝÅ#8#'QȘ,rx¥1†“×§)ËûÌÆiZNœŠ…ÐrO'Ü $^'‘UÊ€“Ígéš7x5 i–ÎãÁ­?ËžiòØÉ×$€* @l‚ÁZVŒduéý3L ƒ÷J¤€™žòûÑæàg޽éQìãvãë@ˆ9'µ>Tšq‚Tà}y£Í 2H9=Z‹ÊsdæÂ}æâŸ*O;<Ly>n§è 1œääñšãù‡ÌxªQBn´§1õ늉›8É4ñm¹cÍ4Æ3ÔÕ¤®E¸tΤݑÛëOhW®MP,¼š£'!‹÷±ž¾´"~ðí9bž"¦–(~0â™gÿÙntp-4.2.6p5/html/pic/beaver.gif0000644000175000017500000000541710017034536015271 0ustar peterpeterGIF89aîÄÿýöfȤnǧx·šq¬‹]©ƒOŒŒŒgW>^N8[X%YW$WU#J FD?7+===<9/808/$2(1 -#"!   ÿÿÿ!ù,îÿà'Ždižhª®lë¾p,Ïtmßx®ï|ïÿÀ Ð¥)‡È¤rÉ<ͨtJ}iXÀUSíz¿IcvÌ›ÏèYqÌÖ–Óð¸üÚÎ>=ò¼ÞK¯»‹x{‚ƒHk~l„Œ8b‡XOF‹Ž–—*†‘’b”˜Ÿ #š›O•¡¨„£›œv‰Š©±{}¬v®Š§²¼^Š´µY¸®¯½Æ|£[kc·ˆ€»ÇÒaÉÖlÎdÐÓÜJšË«Ãm€ÝèBÌ’nœ[͇¯Ñéô4ßÏîÀ¸ãÛõÿ6î¹—Xbʨ˜Á‡ˆ`)œØâ[‚ø ’‘H±# †Íië§Ë£ÉKÿÕ‚a»y'º f¨ÜÁD1cÎ\IǦ9œ9;þºFlÒÅž‘Î¥8Ô¥QZ,Ùý„¹]Ó›I sè†jUnWî¬)õ™×¯ÒÂ>‹TËͳh{¥¼)Ïi[®PâÒ³èç©ÊväZ„«7_š‡o´±pºÄ¬ܪ‹¡ÂŽAA&µ e]P1gÆÔ™L.Œ”@7=mgQÉ!/«¶#šµ#®b]¿}±¶mF¸ƒÑ…fñVËßÇ‚ _K¼ˆñ7ÈcY^oogУë)™I9uw¸n­Á®]è¹›ðþ\ËðüÜßò]¾Iåû¿·?ä ¾9úõ-ß}FíÇ_xîý ÿV¦z¢g„Vhá…VØ@®µ  æ÷ „ÐtÐA„(¦¨â˜xá$~˜Dˆ4z`â8æ¨#Ž,¦ØAƒ2ÆQãDâ·£‰ç€_ié$‘Gþ˜Þ}L6ùä•WF¸d•V¹Á—`†)æ˜ á–\ž1ä´éæ›pÂ)¦™h¦©æ€_Æ©çžm–éä”êÙùEƒyòi¨›~š©de‚ʦ i›’J:©¥•öYæ™t2Úè`öy¨¡ln€"‘‹zú©…BÊæ¥™Fê*¥“"úåyX¦ãª9¼ºç`©¡²jŠ%¼J᫞À ;j±ÜzlÉ&Q(ÿ¦µF*k¥’²¹í›ÝJ;­ªÕ*±| Žh¹?´Ê-¬pr»øR@o­íºû.¼8<:*¥–¾J¯úº©î)Œ ð\¬Á¯‹hÃÓ>Üëµ´n©·ß«¯$Ü&¤¬ò`æ¤Æ7´ª'˜’®¬²¦r>pÀÎ;sà³Ï5 ó Ëfz©¦¤ÌóD«p´l*½4Ï?s0ôçü¥Ô)lq›*OMµÏ»^M´Ì‡n­3Óxý´›a‹}ÀÏe›Cžóæ é°a§,j­´ µÜsm7dý,Üø=/Áp¯MxÏ#˜xøº€|ôæ˜Jjr½ë>9ÿ7¢gùå;d>pà'㻯º‚?ÀÁèᦣ®ƒê««›ïëp¦<;áøÚ!ît {™{ëó [êºÅߪ-v¾š¡òËãÐ<Úq†Û&ÉïÍzð’€}òÚ'¿}÷7Ü&¶´Š·â€ vØd¯ˆû,:ülPµª¥Ì~ Ë“˜Ì8Ƚé 0ûq"ö¥g€4(àÏè+¼A j¡*ì ¶nïG62]ëv¹ªÉŽû ÒÅ1ó K8¡.N4fà‡?Ä  |6¹Ý jáêWâj½8åÐt•1@@E*Qˆ)øY§Ö´ú•І-[bÑò··ÿ <Ñ-B¡2PÅ6 X4·ÈÅ15o†÷B´ÀÔ>Üuˆnt#ã8‚9Ò‘g,›“" %¦ƒ-‹ ìcòÈ*2ކ„3a™JÄfþ°—o¼äáX¹E« ƒ ;ß1Iõ¥x ™½Tå4ƒ)LkŠ›_ƒ­ÔÉ®nªà›”¬¤8ÍFÍÉîšÔsà:ëÕ-^¬"ÏD¥3¥ /rVóg(yUý²©Ï}¾MNäB8™JŽðªž„»gBÙu¾…®ÿs„NÛœ¸Î¢ˆ€ Ô¢«2èASÀ±òt ÛÓœ\0Q 2à(ý”J‹¨Ñ´ô¡ ÝÜßâ4ÓÔô‡7Í@Ní´ÓŒ"ô#d ¶Z/çÑ«ƒK=/­ˆ (§,tLS_È¬Š qÛÔ&2¯Ê§.Ó¨U4唩cÙX€V=BÎ¥kµêã°JS“Rq¸h^—öT¾~Qs „¤CÙÙ1Daˆhf²0:µÆzó±dH§Ê¬Fë²?Ìì/u:¼Vöôå ©Y§¿ðQ•_¨Í¿µXÆšÓhí“øF¨N½ýŠ]am‚+Í Îvö·Àµ*³ô÷8DýÕ|ÿV}k#<ÐÆÝ‚Â¹cƒnt?hÜX¦5² ´•#tî¶—¹—ï0Å[‘/Ò‹¸0*¸Üº^E´—ŠÞÅDoÃ[ƒˆ)´µ•*Uc«ÝApÀÜ­Ì{S1àÂÑ‹ôþ‚:)Ê„ÉM‚ÝXÖOA¾tc^ë$Bï+|Ðû¢‰‡ÐÚž¹Â3Vî€SÌö~„„9BS|B¨HSx U˜…Û5 \HH!;ntp-4.2.6p5/html/pic/pd_om011.gif0000644000175000017500000003106010017034537015337 0ustar peterpeterGIF89a¤dÕÿ¸”Us9ÖJZ)¥B½Jÿÿÿïc)9!sJ„)µ999cs9Z!)”!”œcBB1„„JRc1ïs1ŒŒR½½{!JZR9BR„„„JZ!¥­sÎÖœsŒZ­µs­Z1œœŒïïïcccJR)ÎÎÎ{{Zçï­½Z)ÿÿÎŒ”Z½½½çc1ÎÖ¥½µsÖµœ¥{9kJŒZÞÿÿÆŒkÆ„BïcJ樓„ïŒsc¥„­ÿÿÿ!ÿ ADOBE:IR1.0Þí!ù?,¤dÿÀ€P¸é¤6¡rÉl:ŸÍâ1 ­Z‡©‰zí % ×K.—z­ÞðøŠa¨Ã}°çãñ~||wxƒƒ{€†‡‹€’‹„ˆ}ƒ“™~tyutu §p+q p­m°jikih¶³ºµ¸µ¼¾¾ µC%ÊÊ.T$Ë)JÐcfKÈÐÍÇÐ×LÏÚÜBÚ(JçJ&(Ð(íßôõB¸    nôë÷fÅ…9¥ð!uIKž j„è£G9ÂôGSEŠw ^Ìd‘Ó§<¢è1P€eKT/߸YÐÊ_€úíâu‹—ÿZ}áú) ¾ZFÑEzKˆ¸s%(X·l‘eéì yª-ªÞì%Hvî€×æÎIØzNZ .Ê¢[«µn—]mèýY &Á7/æ´°“ÞBr„ÃPÈJ‡ =j4YÓ!L—4^x!i1¡“QªD‰ÒTBS§\²²©€€¿®ûŒE+MšŸöéSJ Aš|µø®¥©¯`å* Ð žºªv“Ë-±–êr{ð”—(WVª²ÐæÅUN®ù*üäf£`vßœqL­XQú|Vf”YrÇK†H´É/¼€g‰D†Ç#|FÙeÿ)˜Q&‘4)§•RÊjýÌäÿO_³ÑÖ†P½ðƒK‰½Ù–Âã1)^ l0ž2í@³ÝÙ°]3ÖxãíXw€=&èh=`ZeÍ“–6íHw y€5çu‹²ä¥Mþ(AoäAŸ‰–™T "‘ùG`…~3°ƒpgEý}¦g¡Jˆ~¢ˆbJ|Dj¦ DPÓ?ÿüÛ,Í¢†0'îVŒmÀô†F>ESÌpSúÈ£Y¬5$]„¥U«? O ±vÙ¤[Ô,S^«Â ‘d[$MyB ù¤—РËOz©× ŒP€¶ÐWÀæ·B&p¢'b‰Ä9ÿàG–…ôÂe²0$À €ŽMBh š/(ôÙb˜G*pŒÀ€}y¨éˆaÂr‹=C1)¦±/û¤øâ0´ú,Z)Ðj¤wSº°Da@Á²wCˆsÉ^6gk7n—2VN)Ó¤USÁl$ÐÑšw?µT;ÐkeÂ!€KâQ‡¢wì·G{lo‚Jh‘FÀBìp@`ÐG”•É |(ê™›ù…[Ç™.­âJ·#@M˜Æbñ/Bs´, ›H*È´z„'„un°A¼B޹UŽÃŒ7Fºu,‘NŒnÖsË@‰cXdqE4êÊäZôy,¶ÿ{Ø 0™g¾aÀš•²(iùÝñ‚Õé›C˜±  Gp€‚ÂÊX`½nTRH"™YÂYb†I½*éqßÁÔ#øÕQ¯  ‰Ÿ5ñÇÃÁxªÇ ˨ #S‚äp¶ ïp¥Xl9³ü~Ř‘®|ö#©ì Sê@(,y@£rK x²2;Ú8œˆ²¥»–dÈ{°Ú¾,ñ5=@BÙ‚öt‘ `ï@Ç[2 X€®¡ÌC0üÂ!Å#…B4„šÀÄw¿+@¤ÞÀ W\Š(jÀm(Æ‹0q/SQ©2F€©”%sJ¡–±£È)ÿƒW7z–a•ÇɽhF24L0:Ù1aHt”Rð”Ø‘Cà š„Z•Ð.xiMÒÚ£—öùÃ5ÃaJ€P¬XkÞCB'?(Â1üa[ºPh@* ¨5°@>€q}BA"ù×Jˆ7ÅRÂéw@Sï°e“`êC £?6¹õübG#N‰|S› ¾fOÑÁó£` ‘®r' ›¤#ïÒœfÉÎ딀H(dÐ:T† ¬D´!Ñè’^:JíöR&lÀ ¼ã– Wš<`Š{Ò„FËõÈb@‚ÈÈ &  €` @ TÀÿø€0|ï1{Ø!ÿ3°‰ÆâŒjdòÐ÷¼ 8™_Ò à¥þ£2ÊýP£·ŽÞ±RF÷¤V áFa°X¿pÕ;JE«Üé ]^†–õƒU™Ò$•Ñ€Ð-aHÊ —J1æãÕ c(GÐÞ±„”T ÅM1³®Ïl¦$–IDÖ MÀ»€<ЂÄàØ,L=8à-hŒDv Ò9uÏxƒØ(bÊ7B‹Zl|rÍÙÀ&'žRi0L¤PƒœÅaÊÇ”@¼2#­Ê @–‘Ó¹.!¡qÝì.#€Í-‹ÊîÙ3hÈNKÿï2Ù„EÖên„Ž;ŒÐ¤ÇñµGù ‰<•)£Æ‹¦GÅšd†¦Jp*"œ¥ðXÈ´–0=Á T@‚´8ILBQŒ À)Á½Á¡wpà$MˆFYädb#ºM©Š‚¸á¶f8¥G6 A—ð%+VŠz©$dð,‡¼oÑ‘’œ^ NC 1ƒ=ËI'‰„÷í+‹€³_‹/¡0P‰gQ "KtоˆËD`€XàT`˜€-…9,I " @ €Mè+#©ág€:ŠRï%  ÔQû†¯ObóRo.Æÿʈ¸±Qc.R#˜ëdïÜèFóXrx¨¬ÊYR„РZ_UÀnhC×ÎÉrê2€>É®Np']ÃŒ_áÚF¿°°T‡ª-³DÅŒàèÀ6ß êÛ±D%Tð €@&Ý€|à7H€¼Ü2H@,g9±§[”fßÑ·ªXCe’†=µŒ„;Ñq'. ƒ9ÈðÜÉüxŽ\™®t7[YÆaWå›i‰„ºî€TžbÁNʆ–’ÐeŒ/á×Ì3©ô«€|´§/fX SCÅg xÎt6ž¾™™ÊFÓ˜À/9 `¶°L Ýÿ 4 __ËRx˜ßNÔ‰1j¾Ô¬ÒƒI+÷>÷t*b@UíW¢'chÑSÀLÞ=ÚªUBCY®a@žùúɶ²™6È'ìFÂN«,¹ˆƒsÚÈ9=ô±2šÈ&¬i…™$ZáàËœÓ Ói:cBGÄ ‚ À¦ M‚@@Þ_—w$pü È@‚ñ¾øÓ‰Ñ OÀ¦Iq}~ P>¡üÇlj Î2* EcCmç‹pÈ4ø^î*¡GÌ:VVð/ȹ¼?þFÂe¶’.p#•FRKb$]%_óÇq1WláAÿ&àdì%zd*ûcF7¡) &J®'bpBb&ÁDtBCàSÀÐÐ3àp`$0:€|Êv>ÉÂH0@úV7åo– ÑÙ‡è350öÁ B¢Æ¹‰ÃÑ*AÊ¡ –DO dxsõ\–=¢2`†Õ…Ô*ûta˜î=ò,‘4ah_裺°w&Òº#iÖzkTâS("Æ6¢A( ð*0õÖnZ‡…& ÉGÊ—|aw|2Z0xpÃ3i„}‡.æ_í#¯ !2?ÿµ&?aq¾ULN¦$Kp@ž#çp€åõ?tko¤‡D;‚9{3LjUÐkÔõ@ò%P±ŒØ½ÐsCÁ_{ðÁE¥ËT}"&ù>P' hðu'Ð]ç‰+õ$pÇ×r=XŠ<È| °$ h0‹ˆB}"5ãb[½s&i†61w˜F=Q?P5\GNÆ‘*h  pU.@Ž 3Ò+J°1iI+y-9ZÕG[õ€.sU$@+ÄÖ“ï_¨’$àdòPŽß"`2ˆm`MÓ¤;‰èBœf ²ØoÃSFˆ`-Ò°ÿ' 'à (àuéƒ)—ɲfùŠQ=X3 ˜)Ö}¾ƒ& Ð>ñ!LõOEFOÙ 'R  ;¶JÐR€bÑ2OÐrä8˜išyI¡9ÐÒV–Ä”g°†£Iì¡)Šù.a0á2g²ÄC}PÖа&pk.åéƒÉw¤(oÍ v_48S  ãÒ<“[…@0÷(SÓwª's×)6á6¡ˆƒ ×cBa’m¤šôYŸöY¬Éš­Ñ6!X߬wXÚERgqòˆ%– P¦E–€ÿ¤è°nà–Ó—:—ÉðÇ©àrãZ®Ä„³•>W‘Â0 óüåò”8†"ù@N^èl÷¹£;…# s-ˆðc"¯ðP÷"ÖÔ•»fW`%€u˜ÅÀ2uh)@ ÔŠ³€ö"ÐD8œñϨ¼Ý؉PDM}—(5S*°» ~Vë}ç4¢4øR%UèTW½ýÇ¢ðáI4‘;Œ)Íí ¤kTàWžêТ¸ûi~³ÀI‰‰pÚ¢u°&ÿ?¥×lÛ= ÀòÒI]ƒa$ Äy¯ yoÕËã¶œîÖàØ?½o)¥&ànYŒÕF”¸ÜR,мW @¦o™x–}ßÃÎÀ‡+1`¦ûÖ7ƒy )wí¨E—r$i §Ö§êß%‰lõê‚XfK¾ºž~X*}«UóÍóˆíöK €Á4Hƒ# ,`¥U|hˆ ‹f¦ -Pò>}hò&Æ µãê,SGdZŒ«ê¼‚œZop@Zÿ0î§ô¢|Ë ìî$Šäqç4æYž6AÒkå¾H8Å0ðV_'Ô K*òØ?øk¤ÿ‡.ÂÍæ×0Ú6hÚ# Ê._LœÎ)u$p¥û¸R D=I=Í{1ågþY‡n,hÐ ÀKô&>+hZÐ,@nk9´%%–?‘bgbï ò±E,£¬‘cªr#9ÈWßú׌»ñ‹s½w›{Í}Áz.ûa²ÞJþðÁ÷Æx&蛥0PÉw|à‰äÊ‹ï`1÷Ž,ÃÉñ9=LˆK–·,ðá aX·VÀŸ”Ê+%0ä–¹4hZ' ÐýPd¬/,LÅŽÈ ‚€H0‰Bá‘p>¡Qé”Zµ^±ÿYí–Ûõ~ÁCÁIh qR±PuA^XÐñ‚¡/. -,0&02TT*@*<@2:6 LN'dT2**22Z>>:(Bj4BX&2@"AD\W1L4†A>08(N,2%@80$0><`>2Š1<0[,$zJT"èîàßâ芖Šh’†ÔÆð‘3`Aƒ&$8æÌ Êɧ@@7íä¼Ë“GOÇAz1€ÈP!e˜à*Å '*s ¡  P0a!@ƒs¢RÈøf¡‚eDXð°áćV„Q:ÿÑ A 8l ÌA •V:xäJl ᜵˜Ð@’‡ "€p¦k ÚDdÈVABˆ¶’  M¨$Ä í¹õâÀƒJÜX` 9õìâŽ8„°28(+"ȈÌÁ!Œ°1Ë@b ð1âŒàH°‹êÀc:<ÒCV8@HBd†ÿ°!„ fhE @`DG<€‚ 6ÀI§ 8!„FI@‚D©€„2±€ƒ&x­S¦©R…•T0+ ¨ ‚¬v¤4©@€ 0`áWÐÀ©X+† f¥P:à†^| þâ¹Ã {lG€ (`²‰x€ŒjBÂK1ÍTS(úÉ Í8sôSÓhÐþH•ÄAD2±DHŠ€øà€\`˜  ,¨A„ ”Ôé„%mR²‚a?ñ-Å>Ð`ÀÊ@ –K¥V2˜%B°ÀJf˜!‹q@ðD&†f,¸³(¬Æ— œà *ÿ\°‹¿ì8‚?£ ® ±2Œ¨°²M!ŽXb…pX€† ÃÙÀ7>{ÇÑüë((À¤ J Á¨…Ÿ|‰ƒ(¥}£àØ(°À6‚ `ƒ X’(9X%’ ˜•àä²Ä`®3³ò‚™©M Rø1 DhÀƒXÀ LLœÊ@) ò’À ö<† <h0xøáG1Ä”0bâÃO‹†ÍÀ§|J% ʈ ÈrGOã³VàÈ€:Bà…‘LC$†@Ý©SÊjÛÀpÇiLõävS`Š–™ØÚ¥]ÿãÂ¦Ý ¤enXP¡Í7!0¡Û¸á Ê…­=aÄòIî°>6Þñ4þ:8á;Ò ƒ$<ÍÇpÅñÏqÊÑ ÈÊ SË%¡#jhøÃ¹?¬`Ezè!ö`š` 0úê`Ä<DË&X’í€DZœ"=Á›ˆ†$±h7ªÀTÀ¸ íMÈÀÖ¶$ °=º¡Xö¤¹I`G J&ê€VÀ(€š”3“|@.HÀ¾tŽ"ï˜_æð¸Ša÷ÓßÑx©%4„A Õ+‡ zăDìÈ^•ÇBD€9ÊJ€‚œ.±ÿN„¢-É;9Á (‚ ép(9N (àŠiðŠÃÙàJ2p'Ä@à ¥&@‰ ”"4™„4À+±Tò„Œ,ÑLHKBÂ" Œ£ÂWFK¥‘™ÍtŒ$'i²ñbœÀ>ØpªÏlNdüéqDâ4 `@ÈpópÀˆ‰ÐBF ƒeišYÍn¡p £4MÊ¿Šø”0žA•:2T“Æ$çÜAb{âðÐj˜…zìšFHív@²]°! ¥0L“hA»â"–€N0À†¸Ôƒ£¨'b³¦ò 8%1p&VÒÑ’À3ëÀ ˆt‰H §75‡Ša~IL¥bºÿYýî× me0FÀù”ÃÜÜ6ˆ*£~„E¤#gÛ¹iâ•ÔYN* d@n޼'Ñ”(å,å+ Ø(C[2â¯0r (†Z§ `clT©@B/q‰ºØ -©l…D˜q”ãP¡ E„%óóc©bø›åýºñëG4“pδoÉœ. õ­ÊD}89[+&Aà p‹0è$€ Œø…I…DqsŠ „À8® ø ’H -àÕ™!–f|ΙnŽVV@’P9.&ZAŒº‚߀QÒ$ œò´½xÀæ õ—xÿ€X´ì(›_-ﺙr¾˜25ƒL1^Ž/š£1ß1o.ûdƒ€H ÁÁ–έÜT`6©r  0Nà¬ZJm’N,[¤9€,¸D~ø KÄuGVÜ@pM:!±8Û™8€ ŽzôèWë¦Ø,2ThA™qG1‹½€›Šúìàn:^oÜ™J`cf µÉUnÖŠ=Ή*ÑàÑdŠhð!øS™…KxÂ"˜’z*0–=_K!€+v…VVH•Y˜ðÀ¯ÀÁVWÄ€á°Nœ`מ|ÈNhù¨Ôxp3ƒQ a4™¹ wöSüôæEC9*ÿ0 6aÊq¹£§‘¢ˆMkM3T®šfmJUŽ@Ñ¢Dˆp3jˆÐJ= ±Õv‚$!h°©ƒ°«L Kå™à ZW,6i è`'JKÎD @€ÊáÖ]ðnJì8Þ¦@ÒÕƒÜä£>@a! !!(4ôøÌ(. 2N*1B˜ûóñ‡L5Th >}ÈÝíë¡7`D¨HL¥ŽŒîoÎcÌ¥))II€æ•„0Z1– ЮJÙÁ†ôD CH„ …ÁÐ|al`©N`%ØÄ²áF4 ߘG.ÚÅÑê‰ H¦@: 'v¡léê‚:‡ŽNÿÊ€À‹JK xŠŒúXðpÄÀb(¢!Êè2>…äâ+ð¸i<ÂÍFÃUø#1ƒq(…æ¬ÎÈ,¸ÄE~Å"a%Œ(Ç\¡l.aG´C_0 âBŒÐ.ªMxƒ„Á(Z"®k|z‰ß HúEˆÀ.`Ú‹êKš°(Ü 1 bê®îÔ€ &Ç~.T(¢CEF€/2‚#†J4t]EÔg¾, ¯Î|b.¤$>Z êD†0l¯|â-N@9Æê ,^b-x*ÀÂ4ÀÑ´ƒ7êɬÀpŒÝZ)ÕèŒ7°ª—:ñ 2F(ÿhüÃ?$‹Jpƒ©ý.K×qDø|Í2.ƧÄläú!Ž>£3‚J#T«dJäÙJ§Ù>& .RæÌñ€WÈáèÞäFRÉm~%¤G9R-Nf‡R€<à2êÚ a¢"A,@¾aÀâÔf–ê©•h¯• Â.=ÒM‡Dï€$ωP †ó²Qÿ…€²Q õY¹àP‹Ô˦u´ÊŽjÍ`„ ˜“˜ˆGM„9Of©Vd(MÊò&+†Sí•baL]Ϧ! ‡ ½æÉH˜"7ID@ÅP€x€IHJ€Ve@2àèèøý3±BÍÔSNчVàðRÖÚ@[ùa~‰Œ µd³ d½¬²uäÆÑšQ¥äŽøFÁ<Âå"¨2“ê4ˆªCrjS94‘DØd`Š>PÀ;€VŸó$ 'l£Dh`"6*`À‰œèî18ÁW9uÎ,‹Nÿ /þàöÆÚA%ÛA@è EÿÖdí¶ NdÐEål2¬óZÇHÖîä~2GÙñZ…UáðàŒtJC ±ræH‰&ìÏ,—&C¡ÃD¬9¦¡%ˆ&N,$À‹€d€„B(Xàb8@=î.çŒ]qðô¤„UƒÚ@Q¥ì:ãn‰7 `ŠŒÇ2òNÀÚ€"ÜÀ˜$í̓ͬ\7XË_`œT+¾¨R‚ý  ;J,`&ä’ÎP `€Î 6À%¸’ ¹ð,0¦n5êH`ÑMáæT¾Õœ(Qq A}4{uv/“R"¥rŸÐ–6’: À(Ø*ç̈rå%¸pÑ FP@\@uiO °Y" Ôo— ì(ï]MQþëš&x‚Ʀ>†ÿîeçˆø†)cåsxÔœXåð÷„U¸Ež… ø˜„ñÆ÷ š‚vKÀl@@c@‰p" Å,`æÉÖ"ÕºNJ`OÂVhkCD=|µQèA©úÂ?èè?sDÅâèÇO·PóV÷nôöâæ‹ä~·´TŠoâ å”jÁ`œúàðáðä¸RI‡…û–]¡@Æ®Nnrÿ¡_ÌdݦÄß¶…œ€ÀDÀ R@Ôœ > 9›l&×…mÊSåÞ ˜L0QÎ0ø²íN™‚»ø‚æDŒùNs¥ŒW’zj—ß …—tT„µJ£Š²!*dñ$Öñ [,À`@=‚Á%4JJ‚Lz©G²Â8fÑrL‰ñÁapê ™@¤ ¬}ÎIâ4â.Ý66cY3¹ï§ '*£B ’;%ýÁ§6wë€öí@%÷4nÅÀ®MV pº²CBäÒ`Q1z‘@¶ ür}¼©¨we ={ù­;Ú¤MÁWb¶'´Ô!d¡ÆšÊ,:’,°%ïâY¤›j+ƒŽFôá€éw Œª‘Ö°ˆ·K–¾iúרO3<«rÀLcF`âþƒÖþ`ûÎXcéÀåêˆ9ˆð23ŽM£œÿ©{ùŽ>ëv9‘Úž`JH_*H@êlr&­v¡¦"N¢Å#)%ñ×t:“#… 4VÚ å¤>dYóRÊ$ÀY¦zœ qCLeÅ“@R @ U. ˆ9Íi{•jœ”ÊqA¢Áô¨$þù„Så(éqćñ Â`ÀÔ…‡¨âMŒ"Nˆˆ“¶ ·™½ºyeóΦÀùôÆdÍd”5Ñ”‘<&)EÌ2æÀ/¸”$•€Ç“ûOüV dÏDTÆáR&tÈ|$. —Áå M—O&#îá7Ô „ka¡š*Ü¢–ÔB;Ï_±Ê¦å;X5 h@ÉUÿù/LD¿¥LP›OyÃb T¾Ó(AEŸ—f9ðú£X#u©œ¾|tÂI…S=ÃG¢4Lª±)ã IK‘;`&V£ê.AjœnL›’t'߀P†ï¥öPžG¶œ$/YýòÙÿ”A¨ïß Ó¾þ\æ|:Žwû †¹õIR6}¨@œÜ Úûd`űÝÙ]V ŽæSRŒ±»ë}nÔ{ƒ€a%mÜâŽ=³îªýT"`E̦ÝÝÖò¡}À/’Ý ªÑ/×á“­!}aÚ«0§'àMo(ÂXz?&ó6½QÊuÁί±šÝÝþïÿkæèÌñ<É@ Š¡'xåIÈšE¡O©O=ûcüȹCÚn3Ð6È‘@æšö¡Ø¥~EèeÔ¿ôZ ØËÌ6Ã_Êìc@Ù.`$»‰mÑŒäÑìÙÈ ÚÈ©4û—ÉœœReë;“S£€7L@LÞ#Rà–œë×+ŤId\!Q}>ÖoJÂuE8cñPE…Ù`òµsïÒºá*æ×ƒšôÎeA„´æ¡ÄoÍ>”ð>'E.“$º¼º/ _Õá?{sÙ@eñn—ÄŸ@] R 0 <IAÀ¢•Áˆ…EÁÀÝ* Ì4üÝrÜÈWðx2‹ÿò9½n¿ãóú=¿ïÿ 0$4%((,2!:1=0ž(>½…Œ€EaaDQ™ 0”0LYQM Ð" ¬ÎÒêîÚîòúžŠ=@$=<@$CÈIp4„È• @$ &b_¬vŸ^1@•~© ,Dˆ©¡(œ«—7-9Þãçëïó÷÷ hCIÑ!Go)x# Œ8%9#Œ™ì$†Â‚.ʪ.«nyLÕ«•­Y©d¹PRW/–*i]¸‹V©(õ ]»–¬3GNŒÒ¡¢PÀu£eåJ„䬨¨€Í00Œ2 =5Mü +v,YBÿ$$2ÔDZD”(!R0âAuÕk‡Ýˆ…é x¢š1Ì•QTXÆ5 Í”¶Ϥ©˜/—.«ÔÄT@’É„.+"!Š#Öˆ¦…" B«ÖK9bap•Š­+gÔAçŽÍ6Àdš¼)+|8ñâú¡­‡v‘@æ 8qT×P™µvýF¼E@ß0Q>B‡ëpb§Ì—š"«Ö[-+«ŸÙ뽬Q9+Q²3t ª%QT$ךGKY±.¡À€:áù¥†SM˜SáÆa˜¡†¦•MQR¨Z4Da™,T!' 4âICU…E]ŒÀ ,]g…*²`F°§ÿËy·Ð'_e®h‘Q=Æä¤Œ2H³ˆ”G¥‚`+ fv…M±VÀUžÄ¸FU,nÇ…9òı¡šk²ÉO œè¡”DáB Äi§\M4 L°ÀaŒ°x^FÅ 5µÖÚ-˜¥äè1­™+/¼LJ’Å7%sŒN Y£„€E- £b­¼òZG¸€ƒã–^~1Uê4$WæØÓ¦¯¿«ˆjQ(§"ÕEPtLÈŬdL„…8@iltå"¤R2e:EL‘åRn¦±9 }DÖòBMÈú†1¥J™-ÁÒ¨kÜð{Jª5¥:D„9¼B¬Â +ÿ§6h=—Ø@Gì"”4’^ѵXFne\À¢£Æï2ɪ.-YyØ.¬F¦ÞªlZYm2×â'šäwÚ5ԙÑ-˜Êv%,®”‚T+]¶f|+«õʰÕWçÖ5ÆRÌ™3x¥5Ý#þ‰P_¨Æ];ù5rx]pq˜ŒKKAÓ¸/¬€tcæÁÔ2§”Úâ-}ô¥” = ´NOxY®»4íÛ ¢!‘2Ž—Þ Ì†ŸY! `ºèc¡†~õB×Hx&BIRâIJ¨×³YtɘwaŠE_º‹#+¨’˜IH÷˜J¹¹´dî+Aºâí.X«±‡Ù«ÿ€*1Pü¦r+l_šL«lïð[N…hŽÞ¾ûùœ.@nI±#œ°5gŒˆa§OÔ({óXH¡(ÂŽ¦*U‰B̕ȣñ(¦HšÌ."Å)Ë `p˜Ùjl²z="|+mªŽR|IWiP(¨¤–ƒ+ x kè‡Ip† qjA¶¶±zéeÉ‚w¢Ã"ßðåA`ÚÈ(À1€¼°qä©,PB¼€hµ0—*Öu‹šIfG+“ˆCšcoÀê#z” —¾R4¨ƒUyÚ47†]ΆzÜ#˜Ð–lñ×Ñö‘èÍ ‰`‡$ÚQ0ÕDÁ;«J"p;(,¶Â] 4IÒ¬øÄ™uÃÛSYeba$æ±Ñfž‚Q½ &Jç±V¯hEø2³%Ö4¥0šCóÌT-;ntp-4.2.6p5/html/pic/pogo3a.gif0000644000175000017500000000711110017034540015201 0ustar peterpeterGIF89ak´ÕÿuuuîîîüIMVTýÇËrt—º¼§§§"""UUUÌ\ÛÛÛ#%”Ì”›¡ !&"ÿÿÿÿï÷÷ÿ„„„ŒŒŒ999BBBÆÆÆ½½½ccc111kkk÷÷÷ÎÎÎJJJœœœ½Æµµµçï÷”””ïÞ祥œ¥Æÿÿÿ!ÿ ADOBE:IR1.0Þí!ù?,k´ÿÀŸpH,ȤrÉl:ŸÐ¨tJ­Z¯Ï”ªTò˜°à0öà)›=±zÍ$g7t‹Øø<ª\˜ûAyƒa.&}~)„ŽU|Š—O, q’s•˜¢K)›žrŒ£«G¨ª¬³?1°±¡´«šœ¸r7e–»¢§¸ eÄ£$9¿Àe+ÌʼnєÕ—&·Ñr1ËÜàrÓäŽ+è  ‚너èÙÃól/ßàâ_ùy6Ázp-@6(º¸StŽNŒDÊäs¨ŒE7^ÝÕ'GÃ1sQÑxe4høKÅÙ$)‹xFbK*#eˆíO°ÿšeHܤB£Kd¨}1T W £ÅÚÊ ×ÀѤZµMŒ’ï²×I ¬ï5S¶UŒ¨iAˆ[K¶í=`㢤[× Š%:lØe«§^@| ôeRÂÌ:dXïV ,N¢Âƒ ȳ:”5îJ=¨ö¡ºµfLÛ”©¹‚¬J-ÔëÑ k×®{¸£¤ólÈ„±ê’÷Ýi3­/˜îƒ3Ä‘Œô@Á€ 3¸Y•©¬u®™Ì.˜éÁ¾&’§*p7PÓ«eÒŠ­Ùšo™'x€BóÙÐ]MÙ‚?RÑ¥šp|u ៰¶¹7 ~»áÿJ?…jþy@hò=fÀcòÕÒ,/””O ÄðO-gpП …v"h@HK¯04•C@÷`‰?öˆ"P7ÒâŒ%¼XÄHÓ•èÁ…N:Y“ öUSÑX Á¡–žuédeœ€9*  N iC“jnðŸ]JhÙš=Rð%ŸH é$ ÁwfÀG¡E¬u€ròeB ~pfx”þ°‚ c–C§¨¶ Â€mžPªü0f¨8Bj€.Àª«­¯BzêŒFQÚEF®»&Ûi h@z gü€Vë Êfû €B©BTÛ8h›-  ÿÌ]œ@C˜„îa‚¹Ùzi)í”@ o–µÇ£ô&‹Â ª+Á€AQ âÒâÂö¬+ œBÚB¯à9Q‘ LÊÌvóJ k¯ºÊé™Lp˜@!Dê.&ÀÐNQ‹Ì,ªfxjF¿Ct&!ˆ46£É"pÎe¤kF±C1Ë"T-´.ÄœIƒÈÈtÄ0Äù²Oy€@ÐBÂciº\{ºt§ÓtZ¶ 'ÜzÆÙiWBW£ÛqËê´(| êD” h³ôÌs€ÞÃÅ Àܨ¢ C ~£-Â2LíwÕ€{ï:g|€­Ä7£ªÂç’‡Þÿwí-³, M/ 5›°Õ§K®¶ß©oFÎëÀ ;ôm{ÚT×0\×°åÓpnn 0t1VS?}Õ:Äðù^Ü´]ÄÙz>À ‘«M¼Ði×0ƒãf#Àñ6-ÑÄV€¬]¡ z‘Z B°€,`ŒåjbÇUi("ÐÖveÓ% f GHÂ,`g@ÒP$¢Fé*`Ù€†;ã±L ˜`.E©Íå¬fÌZ`'€?Ô€àØÜD+"0`fð;A O—: ±Q0h"JA·¤mJ le  Ñ¥Kx𣭸éKÊêL•> Ý«@DÖicߌG´®‰è¬-ÇSY‡Ð[ºàfj!Ÿëæ'Y°aFú'JøY²ÿSP@sXo$ô¥GøÂµn'ˆwVüàu…Co…+VÊC²`¯SÀ¯7wä·Î:(­è‚¨EÆc4À`pÃÙe8¤Ljrz¾„ö°³\{J!êD3xðÈLª9·%`µ'ì:!aJw•69qSÕD®;I‚¯eÅD¨È˜éÕ‚‚—-(©ÞBºÝOaLÞÍc³Ç2å!ì¡¶±Óˆ«IÔ±` ¯72ýše  ¹ e(8µ,ö+HpÒ,Ñ]b³†ŠL7Õ‹,‘¹µƒ†üBJ]§dÖå´Û&!øgçWÐM°ŠiȉG Ì *¢‚äWÅC8P~ÿ…ÍbªH$]>ž0ÍMîNÒX¸~æM× b_KLÒ¨•€NÁL³ÚÏPq‘3ì‰ü2­¡°m%¼àd'B ÄŠnÒx‡QH|Ÿ¢¥(ô½P‰óZ ò`ë}"ù’Â!Òpø:±}Ž—OÂpš°‡Ó³"ê\¡Â!œàŒÛ¶r‡¥¬»\ß?®âüZ<…0Ñ* ½§%†¹`ÉpÈ /`!¦:n¸÷ÃÐîš r˜7ñ4¯BBšPr@[»`ZÃú…ᆯƒÆ8P"¹„=ÍØ¿WŽù??ˆÞú@´0&©× kÇ’·O7G[ÇyR´EØÿ®Âƒ }E@ !Á¢#ŽÃˆ€cÜ÷\§ `>6d5k³Pù€X÷nB»ä€•9¢3‰ÔÆ9¸ p˜$B€ƒCxø±2TãŠÿø€R7QŠ•ÒBJôn@нhwÍF?Ts= "5¡£’ˆ6à£Ð(gE`à7°(]9Ûø‹Ÿ¨6Žâ iSÒ‰,óFeð9YC÷Dƒ»0Q€B>¥#1~cScC¸S’¡øŒÈÕ@>"ðFµ¨„¬(©ã‹ ˆŽ!à…eБÕ0^49ì£{HÀ!ôx5`?Ûh’3F‡ ÉUóC5äóFRY(ÉÈ2ÿDC<6YD`–3 A„6^Ø2A£K¤‹‡ipeЋ #=çˆzHOS“¿X5^Ø“=à×C‘Ärt a9VÀq: ôôàA ÏÀPH-0;3æÐŒÙ§/Õ¥/5l»èx€Ê kwá@€eÛ#°—A æ°Á:\°ß‚!¹Ú‚ï[¿ƒxP5‰oAˆ ƒB ö ÿfüLÏ `S]è°]¤ŽED0T+0, ˜çòÉÁhxØø}€(ºÚµp o…6ˆ @»f€æ ‘}rA˜â^&gpÁ$¯Â¬€,–Q˜o ˜Ë:‚˜h€") \µÄ«UÉ ðÑ‚9 'R.7‚0 H@µèÀ7ðÀ 2Ð „ìì&³x‚ÜÃvÓh Bð€²áC-'„B §†€hA 2PàèÀÚH  ÀG$hÁ+þŸMi€gzKâàe ‹4Ø÷ŽÖƒÃ,ÿ`íXÛWp—áqUkÀ:{OJ DØ ú]OÎÕ€n kÀ"'·ËIN5€Od@Fd‘IEe0î)àuS>0*  0ß# PRDn)9b h‚Rà”¨,×Ò‡‚ MHI †·8îc Ì÷€x@0¸@'ñÇUràR_2‹° -Á ð‘  l´€Á¦=¥Îsç"°¬•3YïžOÖ9 Ð@ÜBH0>šÀgì­ ‚°žƒÁÈD0®À $ˆ@7 Á†þ@ÿ( @…ð€EÆ3Va]œ²€[Æë€ xäjPSÛu‚0ØÁ%7°†^%Óˆ@õFpGÔ)ˆÀ HP:jT@J ƒ²¡PëhÔ`¿d®b‘ilÁF@tù££èjT-x‰¶€¬xB¹ƒ”sx2Xç^ Óêý€ ¸A ‘À5AK5úŸIÝ@Â@ƒG>@ñ\ç J°Âa1¼Á6 ° Ü`è-u€Èš¦E”—A ’jX¬µ@mj$X¡”!¸s‘sAAlI€i@ˆ ëдJ}Yí X>T‚Ê$ÀÿäKmyºúl;XÀ-@×"²U$ðG«6Ð,Ñ>åE$e;ÚÜ!ŒÀ–+) ¼ÚSìõT¨ìÙ 0|,žÅ%D€“±Þ þB lPJì`ÂX€F‚,•z²àQtànÊ*ðHŸ¡"Ç"Iü€ž’ 2%@ˆ8@´-(0Pè‚tP[zO[¨×xsnAB  ôÀÑ«(–C\M‚¢%! 8À:ºX€ÄØ;@´˜Ä`cÏUR ‘(N@$©qék«@€Ls‘HA à›è¿’Ilƒú€Ü“Qèèðû-’ˆÜ J€l8¾I‚•Ñ×D\€¯“È3Ÿm0/0ÅZ(@Cš,å„p¦”`O÷\÷6€Á*¾ì *= ZU‹ž4âb xIY ăBÉ3’F&P‚bv4åp^!9$®îÄ値óX€žñÄØû87oéÿØ#\£ªíÁp#`K @mºÉ8 eÙs 8ÁiØÒ©zü:i À:–À€\w#8£U‰ýÕTòAOÚ!q†L 5ð1ˆ¢ëIƒÀ€IÐï¦à'wÜD¿: 1«}\ã}»š@˜ä(±Bh€i ã¥ð"pª4ÝŽ’j³P‚¯Ú×dáF‹Ô µØ¦(pŽÜ}\ ¨èœ0§þU½Ž› -QÀ>l,iZÃ3ÜSÖ¡àÊCè€Nýl N°Ì6°“1“àƒ`K,”{’2.½À:í‘ã5¢^0XCÿ¾2ÕodFö{r³B!°gð4)6µeS50€X³ ÈD7@Љ£at~O@EÃY$%00cîTYÐ,´d™ÁkÐ4¿!r ëVt\‰S€O§òSİu0\)Л%VMÀyÊa„oslî±-XÇxŸ€pG O+-H01(\öwä×q]‹JAH e}syB±3Ì2£â1m4Ø‘7(È -%åäðUz‡T' „Ág}=ó28®ÒQ/@€ ¿„Ê·ÍR*IÐÂö)Iã%ày$â ÿs[ÊJ $P·dMÌ…=ñ7§£’s¶óUÃWGPNýf2 Ù4‚U §¥`3<½vlP(ï @Õ TƒaøÄ1µ°6°„`2…0šc4€…䇄@pbFW˜ d@'8 à|$…592Dó°g0pè+ Y “ømðÐcF¶qu:0f7ð9Ô˜%`úð7q ‘&S'‚*Ø Å[¾Ê€)uhH"ð\kÑìBÊp]_e#—.ðW_µ¡BAb;®²)¢f@„ÿGЈ¾­âKyƒr, XügXƒf[o³ZøÇ. /ùH#€;²2†À:¦ñ 0`˜lư 5)ˆ€K–°l@EO™b«À3‰A"f{e† @c25#/ÀÜÒãx«0\!`”à€# ;˜rH^€ºñFg$qf°O-„Më(€Ì7‰m p;È3¾ Õ@t)sŠ·3O„'˜Op¬ƒgÊÑë0ÚQdgKω^®R@bc+¦€@ tB\ÐpPc¶X\¿8“K€_ï™»ã)4:€¤°3‡j¤‰^\(¦´¹¼_YŠª3Š9 c\ðtlÀ….jXL°gWD©;.ò³ €°]ë 1ë¢0±>]€WÿÃsas«¸J`&vͲN ÀÔ¹°‘ø`p‰—€‹=0aKaB[@²i¦\Œ5Õà¸D Ž…W†.ÕÙ¨2ܲW`0µ7  ì3E„ Žaä n{ÃÁ”@4ð \ („@R¼Õà¯"æ*µpF«0»L ó<ÛœÖb61G -)f¸aŒE1(µ™ý ÔJ ¦>Þ4'¼BNÜõóa+À½sü¯xÌõÀ‡Åø )£¹[Y°¡0¤»Èð o 1›Çûs—3Rg„ˆP’<#à!…2‡  ž¬5¤z>¥ #ÿý¤ü ¢ å*š¾~ÔQõ)R]?2´³l0f°5\`c¡"^@c£ë*·ä»6 *„‚º%0'H0ÀExšL,p] Ï 0Q” á]€< %ò*‹ô(ÜüM‘s­;ˆ¸¤úvTE ¬F>°6P š PÔlÀ ^ ^PÏZ€B˜‹+¤@P‚¶ßõWgÄž>\ÓQʧF _` @ÑL’0` Xð8ª)@½X`¯-ðM%­J{¶¡ VXÂÆE‹$–‹Ô—DÀ!‹ô’@b´“v]ð|ÑvÓ]}*€ÿ= ÐÇF à’S#F {˜6€r"P°;aT¼«lŒE°› w` pbb> @ÓM’*3ÐØ38í € 2Œ£TÓj_ðÓä»g«“< —ΟÖ3ª<ö¶;HÇt]s‘Ri6CÆã)¦m8}’íØ*0”í¼­Ó<ÀAéÊ@‚ i2ÐËNà£;a;­bƒ x—uYuFî”0Bˆ¶øpFf(T(×0•λ6 Ñ5-Ùí*à<ŽíÞ”-Ù 0ÐÐFpy^ãOÁÀ²×~JŒz§¢êè*¸‡^é\¼ÿî„ ILŒ$ z›v`,DgyH0¹Ó  @ß‘Mß @Ù¿Ó:-bípÜEÞ[)²c#)€ž\p,s}Š6àN:°¸Goý”àÕßœ>Û“R¾÷°q-ùNy§RT=.@ `“ÝÛ À%â%ž1‘]â=Ù @V Ô·¦ù'«w_ Ó¨H¹H Qê˜ÎJÌ—Õ­“>>:b´ÀtŸÃ!‰7)ZåˆÞå.Ü÷åÂ-&¾èZÜu@Ïq:Øã•sB'*ìKuÞµ3PמSçÏjð¶H;Q(פɬКðå &#Ñÿ‹-Ù”þØð=æ3 åY.¾}ß1p<  pÙ00'¦$7‚È7îÆ@"w¾UÉCRZµgý¬+´ƒ«nbPDÔj s{ã‚Ø*õÓL¢å^âÀ ìÂîå:-âÂ.}u0\ˆI%&0*ò ½J c38¨ß %Ó* §àf¶Ê7àîd6Ý´B®¢C `¾rèìÞÛ.03,àè<ßÀíØ,À¾èŒ-ÙðýîY®°Pà ô{@Ñ¢¦A°ŽB˜Î®MH¾UOyF¹ŠÒIÙF˜î¾üQæwÓ!þëÂæ Pòžïô½è._âÿ’þå ž J”üŒ…» .P7´àKÂÐ'É: oÿU ð…û$xdà @ÂËá  ØLßbî <òÁ°“OÙ#8ß^.Ù1À¼1£r * )ç Þ%m©Y›˜¦—³Bë¨f°ÎD ;`kð'ùÈ>à°fÏažÓ%~ò¢ö_î”oë ì,€C¤ý)ß<0éÀPÓb˜@ÖÉÁ -6l 00¥BYW´gz/=u›=±W€àW4‘Iå’Ù42 Âá ªÿÆåйª®‹÷õb0›K pÀR1ØKØ]*««š°¤``œ ™22@R2 :<DVD<DDH"H4"B^ZDl&'_t WY ¢bx jF!XÀÀ¾vx\0`Hb0rŠŠkzX€gî¬0[»™hVf>&A@V".VFVZvHäå£B"W¤tJÀi¼ÿ[ Å•=8X€€!ÁŒÆ ˆ!€ `¼ ˜B »F 0 FæŽÁ+<ºPAL+2„øÂˆ6¤ðŽ„N6¬H±B‡ +^ÿbfU'hb\™Í…4>(¼€a`"›]0`È#`P`@Ñ3-„8b^U$DëÁÍj«)ÔXAb…ˆ)§È óG:\Ò´Cc©2ø+<ºÈ+ ©Ta!@† j`HQcÁ!2,ÈÀ)Pd åI `0  Ä $\°h©ÂN V¤¨0 dÒ„„ð¨`…ACH~bƒÊ5 P‰Ä"nˆJ#Ä‚ï…è­®Á 8@€Jx†j(%`À`ˆ N¢A! €aÒ À“¨¡æ€¨°`ÿäqŽÿÁ·ÃÈàJ) €~Ð!.Fð±… Ô!á<ýR q&4¦¸ÎŠf€âL¯€ J‹0@@ËPá±HP„cØ#ŒÔ¨@;vˆ …Xs’‰d  d¡€0éχµB@arÁC!˜NôŸP£F8È€„ €€jj€„RH!H° .V8a9ÁÁÍ“ pXm /@…X^\ÀF!À‚@=]‚F(ˆ•'jðá‚ x€hx¡€È1‡ X¡ZVx6 ƒF5 P >ÿrAMˆƒ$ôÁ˜v€[H€¡€4`Öàá¬ê¨ˆB£0ia„t¸óïÝ% €,….¨Al  ò †©¨a€&˜¤€‘ ¹¡Ù¦ìB€4^ž àBà@@ º‰ñ‡@ØÆ6€„µjP Œby°&ÅÀvp¶3LDˆ`V¡† xn¢‚ 8AÛ HA€ÒƒÒáê„ >¨™a€€úæÐ@¨.(€…J P3L‚Xô.¦AÀ¯Zb¨ûlˆ@ƒ6ðX‡fþ‚Ä™ø „xj`*#ÿBá@¯à›hÖŠiüRak¨á€ 8€€‘R !¥ë¹f€Àjè  $Th¬¨äÁþ.TÌNžeÊPà#| Ðkh “ïü`R)øÚ×°#6k€ DÀ‡‰$@:](Ëà @Ü pAHÚp=Š@ [cÃÐ ´°l~I€ÔÊ"+ÈBc;ðîDÐìcÈAP‚,p‚Ià€œ2@„"@ ¨41hÀOƒ<ã„c؈6°€hƒÕ(çÚ€¸4`lÓSZhCЬ†1ÐC²£‰ÎŒ LAÿ >3$–`M¬Ê2@â Œ¨àaœL„"mà °–0€kmXÀÐÀX‰Ð€¨ '´¡ ¦A… èI$Ø ZP¸àˆ5ÉWO GÎ"PAKšÄ$qYŽ0:ɵ   ä:Ù†68È×ZtÊ& cY—;”…,1‚´ @¤"LfHdâ2Jˆ@&1¬ÁA/ùE…|€”mÈF,ÅÙ®u!$Ÿtà 4z²l<0vØ,íÈC·óØ J€‚³=  T@aº }Y’¦&¡)4y—-¬&•âDa,ÿëÄÎÉZOc†Š Lx¢Bvâ±´ L‚`–¨"¦]U‚ jMƒÞô‹á Á@pV@<`kjbj*LjÌ mX)Åɨ@ÞŸ”$‰`ÂíGD¢KWæUÅ*¡ Ô´©%É g @”&ÈaS¢,{zö VX–²c”Q´ LÁ'8® ³ù8`±µýX¥‰P›N–'hE«e‰‚-@¯1Pç„:Ïí\à62¶=uâ#A :˜ë°Æü§mc*›ÕtšÑ€YÏšÖœ ­¾ eÔ70¸µbžì$ <'ÿ ¦R©Xbð#5^4=ià‡TeJTÀá#~"qgàõêLskаF6­$¸$FÐ#}¦ÆüTÀ¸­Xñêš' ìœÉ=ç<`-€Ab,£dɦ$xj é0º$€ö&"àŽ¼*à®K““ðÚzÛ˜εe3la¹Áà&px\ˆœVÂñݤŸ7K;T…é<¼õ*Y½&`oNv(*„ }IÀ&Ÿà‡î@¤(U$rôÖud+hjø·EÖK ¨ÃôÝÃ;#˜q•À½0"0kWÝ»ë€ó0¿™‹_[‡û=<¥wozõ‚ó]CFÉzÃðéÅ‚Ý^º›Á„ŸVŽÕ¬&h SÒ/Ö0 ëä,ÿ€B oìÈkuë’`@ëyŠ 'ÌÙ¬ Óƒ ãoJɱ‚¸CQ&àˆ²Ñ·Ó À±Â¾(Ë‘-‰Ý^À×Ñ9 qM<8Qú(«É‘šÆjÍ`À¤h‹q¼’Ñ ’uË“ì~‡!÷1ÖïìG±$ò’*Üh #²"“qš¤ÑǤéð(«MrÃjëÊŠ WòÑÌ‹²'&yRÇíWÒ £é‹L€xò(‹À/ÈÒ RÍÖ¯²2*o ù.Ñ2Ò,¬l×`R*×ù0 ÍP`+¹rçñ¦ k댲,Ù’ìÆPq ÖØr.` ƒ$,<æ2/`ìlæ¬ÈR/{R4s0ÀŽ031s1‹ ;ntp-4.2.6p5/html/pic/boom3a.gif0000644000175000017500000004357410017034536015213 0ustar peterpeterGIF89a´÷ÿÿÿÿ!!!)))111999JJJRRRZZZccckkksss{{{„„„”””œœœ¥¥¥­­­µµµ½½½ÆÆÆÎÎÎÞÞÞïïï÷÷÷{ssskkcZZRJJŒ{{B99œ„„!B))R11{11BŒ11RZkRkŒœ!)JZck{„Œœ­½ÆÞç÷ÿJ9)B1!)!kR9R1)!„R¥„ZcBsJZ9„kJ{cBÖ­sÎ¥ksZ9{RÖŒ)­s!ŒZsJB)½œkµ”csR!ÎŒ)µ{!Æ„!cB”c”{RZJ1ŒsJRB)R9Ö”)1!œkJ1œ„ZÆ¥k½œcœs)µ„)­{!½„!kJkZ9œ„RcR19)1)RBœœ”„„{RRJRRBŒŒk„„ZRR!ss)ŒŒBB{{œœÎÎ))99BBRRZZkkss„„””œœ­­½½ÆÆÖÖÞÞçç÷÷ÿÿksJZ!)ZcZ)J)1R9)!!J1B)9!BRJ!cB)ŒZ)œc!„R1Æ{B))­k!”Z)R1{J1½{1΄)µs1{Z!kJ1­s)”csJ„RR1cBB)Z91!!kJZcc)11!))Rkk!{ïïÿJJR))19µRZ„)BRck„”¥µ½ÎÖç÷ÿµœ­1!)¥k„ÿ­ÎŒcs½{”电”{„R9BÆ„œÿ¥Æœ„ŒÎœ­Æ”¥Þ”­ÖŒ¥ŒZkŒs{諒”csJ19÷¥½­s„œcs­Œ”¥„Œ”s{cBJ½”œ{RZÀÀÀ!ùÿ,´@ÿÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠôŸ?@Rª"Ãߎ”?~ñß !ø“ÖÍ›OŸÖL.I´¨Ñ£œ\ÉTe0LJ5é¬çOoݬQ*`]½¯`¿²w`Ò³F)hÊ•*-T´^¹‚¥ª–,X¨x E»ñÀÔ¿þ¢Qãv•Zµ«X«™€ï+>pë\ˆg®¹°_Í}@çÏ€¾ %RPê ¬Sþ@0—.ÝZªLÇ®…ª•É”6-°?hÕ°ýÄ6µl?©™œf­´P­xIW…ªCØË˜-%GnœàËÿ—JU*èð­[‡/A€½¼ã#”@ê(X¦RéjuZW]T®øÃ )©˜R *¯™ŠT $ÀH€ÌT€`€'¶ Xˆ±ÍfZ-°ìÛk ‚Ø¡*¬ö—=äôóÎ>õˆS:ï, x$€1O‚‰»=ÄÀ€Pä‘ äöž80À Àä¾ð@ò5T¶È[‰t©RŠ,§”",°y)[˜®Qg[Q`€0*FÍV>)ö×+º|ˆ¦*#FWW𾦦*¼³Ý¢–¡s:å¼##‡XI –dªé¦šR"I"R4ÁÐ@¨¢ Aª«ªšªDÿà@¤*ë\pc<Ú øS@ „jT}ö™( mšÈ¦³#ÖõšmþX“`Ï ×S7ѨèíTÑtcU6ߦ[+  I¨‰Ë†Ùaš¦tRŽ:î€UïŒäø#B9ô¤Ž=àP€%QrJɪ««&Áªë4pcxÀ€g `«Æø_ZŒò +ƒþ™¦¡hêâÏayvOÝLóíË ³ùn¡°¬2ŠTÒxƒIÕÅŸ´øJh¡Ì }žI%Ø£Ž:3Öc² B€sOgUÁÖP@@W¶ºz°«xˆ€? DP’EQPß\¨¨rŠ+"rH*¨åì 7ÊMÿõŒpÞèù²·¬”笉Ð"Þæi8ëìÏVA™Ä *_ÂRJ+§¸»x]4×â‰)§àŠVõ1ëÂbC€À:©2@ Ä®ÀÀšºè(i¿ª€P|¹]Éx¡˜ã€á)øàR•wÊ+úé"½.¦´ù®¡'ÞmüTKr)©´â `¬´Ò–)¨,ø:âÄÛ:˜¤šØ¨ @çã–À¦¶ÎÀð*»`ùƒmF©€Rú„=Ó0îx;K^ʘ÷­VÐÆ5gšY³÷ÀÁ Æ8 !4ã ZYzÀ |’4` ‹Ÿ |ƒ¨L¥Vëx…À@ ‡À`@“ÿð€È/K©€åWdnC›S/L’³k¨eܿՋP¼¢zÖÛ Ñà²EoÝ‚r!: ûøò„B¤x‰JjŒX¹G*(€I€ð ¯ð‡é"ö‹¹(n{HRÐØÐ1ˆ P„€@* 8€ë0ËEÜæ™"E¯XEâ¢EŠ©&r®ôIËø—ÖÜZ›»[€*H9»xhD ðÇ µ  ÈLæ%·f‘`¡XÅ*NQ—\´@&sŒ] ñø™DÀ: 0¡7"Žh´Ù>ã+ `Еx €Â#ø ÈF6ÿ³Ä¡ÂdþØOº8Ç.@qhYª_)H„&º˜âs‡4—iPÓ‹ØÈ©PW ·eÑæ[Eƒ Ä£ñè#\Üב•˜­"Äìñ¡ÀŽ¥RÓ!”Ô÷D B ˆ€Wàø%þðE„6€á[GCJ«ÐÖ” >:FbE I,‚™„ÿ l E¡wtµÏþö»ÿýð¿üçOÿúÛ"%¡¤J~ ƒV`ðU0̤%JT´~÷·€ è <€KÑØ;`C@ŠÇ,£>aEïÑ€"8‚ ¡þ0C)Á:P/£7ˆ'‰1!—Ž‘$È`^ÿ „å!BW‚ ­´Æàò!~q'Ù  ÈP…Wq Íá €ÁLóù ?àíØaƒø[9èÆÄ'ªÀ@tA-¡` É¥ ­@7„µñE´1|¡:àú>ê‚K òÀ(`ãp\x ÿ €eh† ð §  Rç=–Szo¤ ¡ ¼°&Bc(§dp‚£bϰ<ÞÒ Ê5(ï’&D˜9ˆt‘aaûàó€áàûÀ458#î°ð@&Q“)”°¥h uxp:D'lÐ àCP8±ˆÃëDµÖ R!uÆÖDòŒm3 !Ó,œ³9„‚Au€B-þp ÝÀ ŵÿÀ5öÔ5´'ϰ ˆÁ ôÝ3W²°.…RºÐŠó(-¦YøYhûf—‘@ˆp`ä÷®—yÁ~–P äg ‚Ð !n°Rdc\Ó*¾B5 ÿ?`m `m¹¿ó F1á„,¯H óŽNõT¦P(8á ÖòZÄ<_ô%P¥p”ÉC.«ØKOÅ9eW&’"ép‘äP3¢‘ð™þ@å€5 t§bKÖ*K$¥Rt À•òƒ*·<•Wâ%P$E<ƒ}3ΰ2{S•ûUJÙóKü„ˆÄ3Ùð {òÒ2‘ì~²!@¢S5ªé÷- B ÐI¸3 ã\Ž8ļF+%1cð;dHPSaA”A­ •{£Š#K”YF€EÍÂOÐ2"ˆ ÛÑÀ Ùÿ0B€ñ‚ ¥à ·àé™9§Ñ Ôá Ç'z á:¢À:©o0€?\x#p¸,#@à,xÈ1Ç@ÜiÑ€B¶Iƃmƒ,¼0"t>Ch P±ð .xAqì|׊}<ÀzM)aŒŠ€óÚƒ‚C#?¿¼Ø MJ¡M¡‚,¨"ØÒ°ÝP Ð^Á(6ÈÇÚ1Œ—° ¡ÐE»p3H(‚MAÑ Üp ×°¢É2ØÛù P—aÐ=9mÿ 1³l†»•Àëq—艭}ÉÉ[À{¼` œÀI*=MŽ ·0‡!3(y1ì8J:8ë‰NuuJ£ ²ˆ¥×ƒáö#ê 4ö€¼pa¡ûУà1R¡–@ ‰°ê A:dkð¾B…cRñ Wòù„S XÐ%² ¥p oD ­° wžN«;«yYÇ.ôaÐ`X¡ ÚK‘.Ï2‚N4¡X(²  j‰‘äPä@ÜAò#_éð5‰ ’@ žB›ÿ·)öl,u¤Ï@¦Ï5ºw™0 :‡L ÇËÆ @ç Ñ+G.ñXP$F‹ã°± Èà³.'Â%Vø-(#¯à •Å,b ªë¸F±! ðL£æ>ÎsOû hšâGP‚@ÏôœÔŠ~ŠÈB\âÕÂ4I?°Cc3déÇ H?_¹"늳zõ÷ؘÉñ a/Èpµß Ú€ÜX!ñù9Kåq"w “#²i" ¡ 4™ä@÷B%T®W€ÛÅw%pF-w²,n°®þx½[¥óK‡,¢?Ëÿ¬ƒ1Áð«JÑà#¡Ñ‘²‰32yu"Ôò”ÐJ’Ù Ü@­/s”RõáÙºŠa °j LE –ªƒUÕ‚eªS9uõ$Ö#7Ñ\ þÀ¹K D€þ$YÒäI”)GR8Ð B/c΄)3BÐ`AxY¦þ¨dÚ”)…¯J™¢Z aB„YÖBE*ã³jÞ¸q£–Ѭ³kÞÄJ3ÛÖm[SX·.¼ºê•[jØÞúã…J«À«ªZŒÐªÀTþØ«Ñ=wêÔ]ô'¢Ü;{þ¼»§Q¤SРY:p0@±£4UÝÀ_°uø1!©ÿ¿¡u«¤  ×BX j%®+cØnÕÜ:³¦ví^èmY™bx8«`¬ O5[íš¿PSQ™*ÕJWp­ÖfŽØSÛáDØ 9‚ŠÁ €àónKª ‚ÿFª@˜8 ¦š^j€Õ*£"8@±Ô‚Qü L!ôäRÅ+iœ+«-´ÔêfšèZôg:áØ».»ÃV9+šg¨ñÆ·Hñ 0ª².;öò„ºQ&ÐpI’¨pµÕ À ^Z°&bz`€™p‚„ j€€ž”`6`˜ °‚ÞjEa)ÅŸ½éæD³žIë9÷ZåǹäjÏ0Da±ÿ1£h¶Ùæ™Fw4KT`A•‚P! ½ö„뤕OT9e Üt“E‰Í&™¦|i4ØiV pP   €mÔ`à4 PÒÔ7åCàTiÅŸhÔú/µ¶‰&P·B1•S⊱ÐôdHQ·Jä‘ÚmÖu« ]XÉè”Jk å”StéÐ-t(`ÖMð‡VŒÀ4 fUxá…+( ü9 b€a¥"ÎíßÝàôÇ¿ 2¥ í¨õF/lÕRŽÛnU %£TZùpHâ¬ChQ·¢ÉÆm¶”RbAEh¢/Í÷=˜Uù$e9f| Á¬W@Pÿ (˜êÓiá Àµ·FI ³˜6à ¼Æ€þÑØéÐ*X €óÆ]´Z”S^™å¤Q¡å®#ĽnHšµÂù-hªÁÆ9粡fƽɦhÀ3åoàfrrˆHx@ù~ÅÖ€a2P€€u47ªŒÌΪiý$ ñ?÷æÛ,zk餔é:ŒæêÐýÝÅTjq%epK|ø\t(ªú2ƒ 2˜UƒV×(×Gé•ufµ #2”¾Y³B …•Qt9…S„îÄóä½èȾ[žYˆ-ìÐ DÒ*à»’ŠÌO7Õ.<÷¹0@ J@œÚÿñíDƒèÞÀ6( ÃhŠm9@I ‚ð4øÜç^Xà$>¹ÉÙJŤ @ÀϪS{Jææìé-aT (¤õœë*íaˆ+˜ŠS¨Â/ÆžA³€Phñ¯¸àç`  À6ð ¨Tº$ŒqBã} p‹qçp É`èÀ@@è –´I@Iìû‡ ´!$Êa$¸PTmð)#)â[œØ–D!Ï0°°"óJ.À$$1 x¤MR‘ÌÆ¤ˆ/nPC Ô@òG ŽàHfÀò3:ƒxR4”)F›T@–ÀÖfu5ÍÿÑÎ,ˆ‹a6u(U¬ð8jѤ?šã -ïÇ#—ˆSÊŒ„QS´ E±“@X|b±ƒe@€ÄɃþø¥[½ù*éa)x€Ë(ej̈K—‘ãùÑ Va¦wɈHR°í¨R×0…EìÒÄ çþùCY€Š“/lÔ‰ôG! ‘E-Œ3No”“e¯è¦ˆðIœþ'!°0Î'4e3ºLuZf9Â’à†* á n(C ˆ†*Tá h(AW3B€V6Å5 ¨S.lxnuT ]Õ €©ãÒBPῌ„Ä$Áj’º ÿuX@KYPœj( @Žp…B.…J´ÔCÚ„Ük ¹K>t'O\e;@­"x´‚ŠV¤ŸøDpj‘ŠóÈB hhZ«`„!L¡ `CJ€7 Aºn€CZÑp„dÖ)ðÇBƒã[Üâf$ÆðÇ^¡€Ô4K¦YÅTÕES4±­t€ÄX•Þ¢¨î¾2YG»Žaä#!i š‘!ÄáEâªS*C)#vÊëW1žˆÈE‚Y1Å-¼‹ž¸Œj£/ÞVh >RE/®°„¯¾á ]¨Bà`„ !Æu BZÁà7œaC(o\OR_ À²kÿ2ËÆÈ›ô²f¿ ×T¦ÂL„Ä·ØÒ|S⫌` ó:8,ÖöÁ„( ` 3êJÓÁ ^pƒûLÝ?wÁ \°Â¾€"èÖ½)ªP¡šž­šF°(%i‘,¼Á LBÀàV •X™/ji"è˜ LØ3’„2œ ^põ[‡*٠̵Â/`äÅà¾1AJntØd¬c6Q.XJS^íE)NZ4…?  € À~etø]Y–AÐ`Q  @»*Óü\®ÖÁX¨Ã€¼Ü*LAßm°ºu WÐÂ'¸ÿ¼ä„ƒ¿%g¨Â˜ð†2ÁÞo`õ§÷ŠS$ÔCk…WùŒ&0 p`‚Œ+\ /ü pû•dó‡°#°^®TÆ3À—Ø$(x]¹d0ƒÅÉ ’Î5±€ÛH,43Ë‚~`…l9\’ǦÐg8ÜÛGX‚ølö°ƒu L@ùŒP‡)p! öÇæPàâ·È¢¢>ŠCL–€Ä#ˆÐcÁìnX{ÞþxVƒµþ0Ä#,oyH(¢-M೦pO! g0KDq¢À %Ýà0uÞÓÀ`Rfé0EÁ€àÞ4Ao@lÊÿ“<ì¾ë0€Ѐ p®-ˆ€S&ÀK1¥•5ØôÚ±8¡ p»Ÿ?=@ƒáíqH»hÝ„&ðÛIƒ§W0p LXBý‰¬G :â7‚ÙùÌ„;`‚ãj‚*h9€LÀŒ‚”‚–óc WR‰ç³¶à+õ’ œ€˜=,ÑÀû è—`€øY€}: Y€Îb6Ǻ9(«Ë6P ª3‹:z  €¨ ì¯Ì  9íë>@ó+¨;?«&Ø.0ƒ*(ƒ% =³8ƒ;*03ƒ&ø"3 Dh„F`Fð·@¸„B.pƒ/0‚ÿ2(ƒà¼'ì‚x‚5€-·(ˆ‚5¸C%°ƒ* ¹/`‚B,Ä8X‚7ÐBFL‚/èBÆC¿X· 2€ :–b¬–h@€˜ L#˜£†° ’Ø ³ Y€¯°´‰¦#X3` X€ é@*¡,_\‡€ B´î ;‹s‹!90ØB#¸ƒ/ŒŽ é2H1dýs‹\c‚&@ƒ°²‚)Ø>ðš p`,P@w\?üCy¼CT9x)|ÔÇ|ÄÇvDÀ1ÐGŒðèê"X;H™# î²¶`)£h) Q ³À@ÿb›Å`‰*™‰Ó 0I ŦŒ€Œ â[¾±›ŸS€ 8E ˜x€¹Q¨.ÚìÛ>@ »&ø$³Èc-€‚;t‚ ¦$ƒ£üC(p‚ô#à‚)à*)ä­tƒ&(ƒ&À"(ƒ) 8#È2àƒ'$p $‚1xGzT@9ºÄ¯ 9>+,XÈ’hHARœ“L¬ûâÅŽT/™ðDcØ ^ÊŒà@›ôAH2]ÑW¼>¦p‚òɰ«‚ÉcXÔ0 `Ȉ'@J(‚½(‚,ˆG?dÀ0˜Ê·('ƒ1p'˜ƒÿ,ðM1Ȉ3X50+Qà²ÔQ€38ƒ-04=»³‚$øB»{»àÅ™Z’4*„G„HP„H¼GÀ¿ò|„CH„B0 ³¸Ì®ÉƒBLˆ´ÿ*€âkC2{ðË”@€M·I¸Å†u0ÐÝÐ)P3ÍÈ’u Ä#¨×„GxôÜÇyŒ Q ½ÍÕPy¼M(³À5³‹ƒ¶™@”X½Bˆ„HKxʃJxCx¹Æj“`A¨K@³x„ÁY¦…›ç‹VÐÙýœØ@œhÀX±Ø=±ÐxÏzp'9›umZ´å˜¤Y’•¡èˆ†‚U‘l Ú—õ˜¼~¯´íÛI 6YÐ$èÈZçà†lÈ$£­†‰¨¼•\~…ò[ š€Ì‘ÿüO ,VîɈ¨-Ü@ÁØ´ ‹¸ »ˆv\Öm‡v8ËÄ\ÍYªIyi…ïÒŽQ 3c•Ðÿ‘i˜nð†k˜†i0Ú¢U]kˉ ¾]Z€¼•sàÏŠ¥Ý§éK-]°ªá°Š®è€_ tc)  =€Êi j(ÞÈIª¸µkX™WpÞzà‡sXÀ€`‰p]‹¸KÔÞ IJ2,]H…A…êY¤Õl¦Ä‘†Å™ßȱ†ipY 6^û5(ý­‡°Ö ˆ‡Š à>`ÆS`üxZ…¬@…æ”à˜–-û²‘ŸW½€®½† Ɔi ®ý`ƒ­ß!€|À|Xpà‡È%‡q•–€¨s`Š`‰H€yá“ W¤”ÿRHÅ®'¹Ð”"ñ ñ"›~U× ÆIbjІơ'þãjx†úi8‡é•\yh‡0¦ˆ8áYÉE¶¢ˆÜz@‡26ã’x…º™¥…S(Wð-ßú‹R08Ü«¹ìmU!âjXbÆÁÊ©P™K¹”ƒ‡Cãé ->á °\c‰ÌÄ:FL Wí0‹TpoJÑÑš"v @cvÕ´)ÌwÑ…o¹DINcJæe×x€˜täšà(€B°Ñ$u„p•øo¤£½ ÔÀu¸‹â£(.AßY„`€H akºcpU …(±†’æÿ#Ð]òð¦Á™"D ¸\7If³ˆ†hÀc•٠ݲ™R†…ûõ0«sˆ¼Ur(‡t؇E's;ˆ„A'MÔ'­„E8 ”ð'6L„‰Ù€ˆ“T4 àAoó6 þ8Ì`‘˜‹1ÕÞÈ*"ÙÝÅÆŠÁÉŽ©J cÜüpg¸ó<‹ -Z1Rð„ý)fW…T‹@‡oŒz(‡Dw2hR„#HKÿvK`¾5 šk³¯‘2šP šh©™P>á à..€ U„†Ô ð8¥ Š¢DÉ*¥Î_ð]Xz Š2 hp”±È†x} É›ÿ¶ $*Á1”r€t@t‰xr˜ @‚B¯qè#OR="H"­ôDe„…&‰I½€ººt?:,17†gÝbæC$ $›¥¸S €#Èõ¿ˆGËð¡JqXh…Q8‚j‹‚å†m‘³9Ë¡l5€9[>Ö`‰ïŽlp ÝŲö®­Ða­(…x0ôEöbH‡2éž#(„B ‚»GIØûFȈº·{"`„@w<«oÔÀD‰¬®1‹Ff˜‰R À¦‡Q:’¿pî¤ôã¹ ]8‚Aޤz†‡ß$gÈ«A†Ö‡ù=™ÒbAΈ²§*K%XÈÜ? ÿŒ~ˆJ~‡Év‰HŒ €rpúXÂTæW$™EVE‰‰ŠŸœO|'¿ ÜN˜†} {7˜ab/jßOi]wñ´x©g¥Ê`=ñ™O‚[µû¶0W ”f¯Qf&…ˆPþÊ©«W\=uë™ó‡¤¸tJøógÀ¿Œ7rìèñã? D(‚É“&Qž\L˜ˆÌ€„ $¨”€ÀßB‡zPñ(R¾TÁRU‹)SXO™>…‹”¿WþªyëJ-©³k]»u“–ôlÖ¬ªÖª²¥m4oØÐVLU«©ÔªUQµreÕiÕ¦½\hР¹þÀÿ•£—Ž€;{(­l¹‚+U–dÉRÂ* ð€çÉë @X]ÒgÅ –gw¬`{B€W¦j=½;õ®Ó¦À›šÒU‘«×¤Öºzã¶Í,ݤ¥¬úÆ›·Ô¨¤Ñº]CkopÀÔaµ:<+ö’Sgœ;ÄK Sçnñc‹hóçX„<=0`gœqÖ@®¥Ô€b €L@PýY˜Q  TPåEUT­lÅ\5I=óŒXÜp]tg2\UQUUÊ[M“Í39“c*ÔÅØ¡TãÉè¡*é `Ï;fEg• a]ØŸ0 €¢ô%g`šÄÿ€ÆL ‰?L@E LÉ_DЉx²¬äZér‹?ÓxÖrɵ-à '¢«¼ 7Ö×]*¨àÅ(¨Äœž˜BåÉQØß;ꤣØ"¤c÷(æR¾ù& ô€˜_jf­?©Éf…¯ÎAQå UŒà7¢7_%…\s,zÖtR`T™âËYÔtWQ(¦¤âO+éE$uÖ" o©°ÂÊ[P@ ìg¥¼Tàê«°¶/¿ûÚF€ûUÀë°NJ,9BJ¯™Bš(P‘¾Î¶Î(áé^S¨¸r\WŽ‚%V³ÏÒÅÊn˜ž×ÇL’ÿ­7"Å‹¥Ö§1^À9µ S¡L`1m 8XE}´†,À™0€èÀ,½Ö4€LR$s 4QäF,,––b®Ë {³-RÈu3Ét™¹ã®ürEÒ¼½ŽG½BJ¹¨€B³ŒzK+­/Óùò3Ù–±™€Õ Ÿ4€f&u)çœ? a Ó'¸€ C±l‘ƒdvE´œr,(™6ÕŠ3Ε5ÖÊÒj*\±ÄFÅ·?~w×{6Ðp{wÇ©Ð|¢âwŠ*®¤bJ'¸>Ä XíÙI °´€$°¾ú (ð¾ t®/©?ÐØ*IÿÛ÷¯¯zTÆ„C•»¬"y]ÛQzוýî(¬(o„µ8ãM0HÈ3àòbv”PœÂ²ë‹uJ=—Ý)¬X ,²ã½þUFhþ`OÈÌE`À@Lr“ (ÆXß p’Œ$bÀ zÅBÿ …Ît‹Rø#.r9 ŠØÀŠô–â¡n†3 ]°OÚp£Îx–T¨¨0Ezür—^°¢§Eyh¡˜W¬p‰Da¾ dô]@‡†4d„˜Ä$Q(?ÄÖù‘#fó„S@d¾Å…ÊBŠØÀR âX…¤¬R®U²m•e„†6¶ŠDƒÿ­àT‹B¡‹»…"Ù9‹((SÉ¡ "0ÜÌI€¼äÎ@"%ÄÌ€ Áè$i‘>3#fÜ]P¡ Sô…ŠU¼¢‰°¡Å¶‚£Ð%.ýÁ!ÛQ°(c·¡ jÌÒ½PE,bqŠT¤¢M)Ý8»ôÈS+f7…²Äà(âC J RÈÀIöu’u<@ÈPÀÓDŒPÍ4 P4DÉnV`Y1¨.‚ƒŠžQ 7DÙÀUÀ©ÐE-$Ž F÷¤‹eé@]‚­¨êUyñKi8o: àfD=b}ô3¨ˆP‘c5ÿ`€d²8`PÐlêTM(¦?À€À4¬ù¦.ª÷ÔsîŽwël “ªÇ‚¶,ŒhcÙbÑTod£že4<+Újp£³Ð8E,>ÈÖ#x€Àƒã@Êp€¨µEpÀ€è˜P`¯xÀ?°°¶C6M,fƒÃÉ·iö± <ªVŽÚ!½ä¬•Ò4ª‘ æ·+Øð¬ó*‚ZV¬¶¹1† ʪœ&ò pº`@Hc‚¸l2{AR6½‚žmclu½!Õ-…”ªàE 9¦X=˜ÂÑac(Ñ'w9ˆ-ÿd Ôhh5€A—¤V’—d@ÿÕI0à€u¬c9´@E@@âÚðêTå*mÑ7t:6¨®)yáVpqMíð“‘ÂÆZ°bCÖÈON[3£MªH!s˜¼Ä|8"RÁ4ðŠUñ‰(¼ÜMØù#X°0(B€œâID(ò$Õéä,Wd„ªÞ¥„c 0Úl´J+"ð嬃½ b«td®$÷=Jša’ ØkX¦8‘Ô=‰)€ÀF °°`±åA „¡ç%òYp§pãT‚ÄÓÜqC¨y†:WT黵ÂÕúKw­œY_š)ºxrIÿüü¢8ulk0 Ô$`UÆ0JŸ9ª\`b@1Ÿ‚ñ"ª ÂœkÕHTЃÙúã;И{à‚ `„ÀX€ùl˜°¶?xÀQÌs.[Åœ¹ëÆ'mëf™ÊÓ:¹p<–åíYåÛ"·Ø‹Vˆ9¶10FNSƒPî¾(¤4€p@_ðËͶ}€Œ<€?Ë Ò= @ ›K[Ç~€f|¢xÙ¾`îd&r’9ÛÃ^|4‘Pþ±-¶¢`H¸œÐ ¼ ÁPüƒ C¯°Ápà.ù‡zÂÀá[d;0\zrèà…ÀÀ‚°€ÿŒ‚ÀÉ«b…vaÁHÊ:òìYÂ"¨,{‚t—e1»v“]:H°8VܬW^Ä‚QGqЦ>@1­ÈÏoK p€¨°So¸É£,}†¿nL40H`ÄÂŒn¬Â½Q`R“Ò2½V¯£9‹Â§(E²õreXÌ-¡X…YÙÆoå¾6¶ù¿mXÌ~<€0\‰¥µ/àŠ (À:œÚàE€0 EZ-ÀI]–U¶È5Q@]€„DN(Æ(ü’/èÉ_G- È ÚQìˆX„Üï„_& ¦Jý é},Èž_(€«ØP–üR`‰÷ñÿG}‡o B. àÁÔRL@§8€`A€0”€¹$ò†4À €ÀjHª™xYPÀD Ø‹Å)¡'üHê*ÐBܨŸêÍMéFÍÜ`Î4•Uø¡?Yo )ø Ë8SðŸFmIÅ$A ÁÜQ@V† ˆÈ*pº¥[$II Jœ—´†è€ ¼‚ŒH_TðÔ¿iD$ÑY€Î—øD€/BÑŠˆÎ^UœeD€¼š?Ô‘·Ü`&IqÇ[,‡ŠÐ?<4@ƒ3ÔyàIp϶M(ŒÇíuÛÊpÌ·À/UÄÌ£&‚TÿÀ A§0£(‚Ë †“.D œX (j¬„"_—Ãð€ Œ#yE”tÄ"µ¢j訄mÉ2kˆús͆(!+4ÞF­½‚38ƒVÐB+$–,|Ë+hOVhÅ[¼ÂtPПqÛPÅSÙÅ]ðI*ÈFÅ'´B*yÈ·Ðã&VAA &VAœA à£p%Á^…¢PfhŸvAl"XÁèPÌZ…T !…lPÀ@ Œú(KhHþ©ÒhÌËÀáՒþƒ¬ÊGšIq,W¬@üCœpN”†– ƒ …ÙAWΦž–@XÁ¥?<(YvK~ËxWÒ5…,˜.­Í*Ä#•™Â•ã˘©8(/LæRɈúïIl~‚?0l¨¬k,A ÞiLA öiˆÿª€AÁŒjG`ÃDœPHP,Ø–À%y‚$¼!PfÛ* ÂDêvâ G8®¢…BH0øƒ—M€ÔªŒ•„Q ®@&ö) l>ªºZEÌc'dØ¥`)ÎTO­%EðÔßüç*РAˆ\' $µ„‡#ÆŽ*|‹AùøA 6ÔPè¸AØAPè=Z(ô©€ÁÁðëFÔ Ø –¸‰M9ÀÄ\ª EÕ–f,€¼Â¾©)TMI<¼ÙbFP›ô"Î üÄ×TNþ €÷ ®7­JLxÊvæbnÊbî€ÿAt§j’&)ΑÕB­yBI ßôBR­]×VA”Á†^Áºˆ$S(gx‚+ÄVTÄp Á$Á,A„jm…žÁ¡~í½ÚcEÀ1€ä:åtIÃøDë`ÄÜž­–F©…‰bLÇÇ€öjMEdMÈ¡ø˜dåÌmû@~Ä®Vmtb 0A XÁÈ#„ž8ï0ËrK)œÂ)äŸ!Ù1°30p¤-,ðOâÂ)tbTA$´ÁÜXA˜®B)˜^̾Q)ˆá$­?LÁærÁ Á|pòb-…"¯DG˜åGÔTŸí¥ 笪7%ÿc¼Uy&£$@ÄÊJH)Zµ*€ü<`ûjZe!RÀ¨jp†¬FPlÙ¼XÊ®?ÔA¼ÁÇq…AEpø#…±B(ôñn0TEB" B"¸”Á0#kb»¶A $‚!$Â&$¤ì`­p0ò"×Pè ­E€À¨ò*_o®!ß×H€&D2&l €0°ªåH@hIfpÎfÄå¼Bê„T)QŒõElfl¦âÚ…ìêʺæ¢<Ö6·«xÁmfmñ2ò4Á>F‡QT*„BBÝÓ/`‚$%XÂ#(ÿ‚#<Â` –AŸ2Áôs`A»š°?L²#HB"$‚"Tr (FpÁ†¢4ò$Á)#EˆÂ*£ç¯T±¾ÀЭ‰`1€"@ mFK=€Çò2ù¢­1*€œê:CÀÛ…^A³ÖdN4OóªTAÊ®,'Zæ†emvó7óé×22pAÔ4 0TcÁ”G[³¥Á@{í¤Á@¬‡“nh¡WÆA¤÷QAX˜Á£ßx£èv"0ßó}#0B!$YV-üfŸz‡ŸueÜ(y@>Œ’ã:®CÁw‹œÿ|‹Aœ™?oÁr-»+3?Iì2O¸üØû:ˆ²Dƒ1ªí„t€g(€Çn{F€NEú¸÷kØT,»Vì$À@‰Å5À:ÈaZ‘}Ù+†iû{XºýQ0¤u«£r‹€À<@ A Á!,‚û_‚?Фì,´fP@Á 0Ä2d‚ˆ1Ä ”(kÖ,Œâp!‰)V\å¢D$þš¸ñÒeÈ7LJPøweÊ”øó‡ Ę 8À`Bƒ$00bˆ…P4 F‹BHàèºý® €Žp„CbWîáI\°–E ‚@ß"¡¹Í¹oV‰0D’û}ˆA ÿêB„, `H"ÌåÝÁˆDƒ˜Dñ…'CHâ¬P‚Šb±âßòHXBŒ˜„$Ô7 ôU¢‰B!Ö$’y| & @h. @¡:^G[øc!K@„!„Ç‘%Y@B èB> ”O™ä£  J,¢/…eØtÇLž•*a“WUDF``S›h‰ÉTÞR%#´#.yÙK_þ˜Áæ0‰YLc™ÉTæ2™ÙLg>—;ntp-4.2.6p5/html/pic/rabbit.gif0000644000175000017500000000641610017034540015263 0ustar peterpeterGIF89az·³ÿÿÿÿÿÿÿÌÌÌf™ÿfffÿfÿÿÿ!ÿ ADOBE:IR1.0Þí!ù ,z·ÿ0ÉI«½8ëÍ»ÿ`(Ždižhª®lë¾p,Ïô8Ôx\ Hñ½œpÕÛ]xãpYBò,ÀÁÁ¬Š¤¥1åJŸÖðÆËóm“È/ŬªƒÎô÷Ö®'Ò@yT:µÛ½]=|{j~m€]|Š]†bˆ‚ƒrƒŽa“ˆ‹ŠZ•KŠy˜kœCSŸŒyX£ƒ§„ª«C€“´¢²B´š ’¹K|­Ÿ@;…¿¤s’N”ǺÁÃH¸Í5dÐŒ›Ô4\¡ÝÓÚ1ܯ·ßàá¥o·æºzx`ëÕ‰]Òåð0°¾öÛyÂsïú-vÂ`ÀZŒ”Õ38-Ðþ1l’Ðß@POL(.Q«…ÿ;(«ˆN^¬ È!–eJ…øXq‚ 8£Õr’f…[8s: ¦Î'‡Hy‚:¼…E¢Q7—ÊÂ1ÈÓɤ®„võˆ¤äNUtzu%¤nö Ip#Éq út•ðªä[5t(ÌìÚ l:²w~f›¨3 ÿ0>2ôð\ùž=• (Pi\ûˆÏ8ÌŒ€tæ¼"öÊ’úåˆVÒ<`“(CMëÑ  `Öݳ꿛­)3Mké̤‹Áæ¼…y¥âz¥"÷MórÎÎ+™™ jtêÊd~Œ# á=š:·Ý\¬—Ì-;∈˜ûkø¾™v\ÿl¾@ZtÁ±QéÞBO\¶r±‘'_…ò×\‚ JÒ "fœSX7Ý€$Rwa„Šùaˆ æQÙec‰¢8€{TDf$‚ø H5æ›@ÉQ ’z)ÿ–TÚ\jÑ¨ÙØo;^8{qþ°g–¬Þ¥ =Ð"›k¥æ¯Fvá-{`d{j–溚o„÷­{M8f®x¶G ­•²jƹµ(°ÕBKä¡rÖ'±­Qx[°ÁáêÉ0¿§&òQXŠécYÈgR4˜ñk_ÂÙ¢ÂÓÙ„ÈÓJ¬äÆ ˆ†›œ3ö`rT-5nšûìé¿2¨Õ~Õ¹{šCA2;apP>™B¯ o‘“x){Nl^ØíÁU‹¢T‘rq¤XªjŸ©—,j».ó#š—°Ýmk›2G}â;3õ¸pÃLƒÐ‡©?µdÅúá´kÌݸ‰ö¨ðú‡ôÿ™]¯Jx7 uœß@…[‰& Ú‹qn/Í¥/¨&eÉJ1ًϱí ë¶¹z¯†®Ê¸™Ÿtaº¶<mZ?›ÌX‹PXFÀôÓûZ† w½é:zuä§cÆÈ›ò^-õÔ_YÂâi¾C‡@ǯ<`í¥õã‹<ûÈúè[_±²‹ŽRÔ†1ðh÷ÓÉR:þ! zþ{Û–6˜¤p{éúÙÞS>ÞÍî,¶"ø0º¬¥t ~B·ÁûuЃ´ÙØ–ª›‰ÂÄC S¸Â rÉS0\JÖã@ÍnF÷"ŸàF öЉC#Nõ'"áin6Ÿ;šUNv1)ÿ PL—£Š@/VKZWld4­ÃE¯gÊœ÷%Dõîz¨š€Ãr¦ÆÆ SÛñ”–â3 :oÍ3‘‘€èp1#Ë€¹´}!í,3dä,Ô·1M\¹IÕãFD%š'‹Ðj˜7Ç>Qtšä™Yg&ÊmR´ŒsÔJr¥ñf°…w8@e¡B@*¢!phÙ Ç—‘¬"ÒphWfa<i¦+ŸHÌãÁ‹“p"ðZYÍÙ’8©t%)«e™-Ts›éB€-Ó¤ÍÒa“…ü¼–#*êlª9Õ¬§ÄÔ’Ê#.ìRx§<‰Á,)t“Ý€ä¹À¼á ÿ#@P§<3eu’¬ ¾£æ22ÚQ…  M!QQ°w L1:¹ƒDÏ<¸’™8(Ä PÓ^.¥œ½4€D»”ˆæ_ŠšO‰nU>€.n¦@uÈM·˜Ø%æ¡RíT¨¹Íž4ƒ¸‹ç>].hÁ3ªY]è|à:,åEžŒL+(¬y“8æww­˜— ¥LŸ’“6í%èÖùÌ)þŽ^…èM¸ú‹V“\èB±êÓmz€‚~šì\7+•©ÞD¢N¬«ª&ÆùäM+"Íh9ïéWÐ-M.YJ­a+›A»šN-²ÜèȺ>)Ôžºé`e*#ãÄ5ˆ…ŒenÐ&%óPÿÛæYË Ü¹âpˆ•4«9àY)rÖƒC z‚Ô æzç¥=,\¿;\’ÒT²³írs›¶æ" n+õ{Äž5¾¬Ú|ì&IxW¾U-IéŠ_+þO-83ý `ª=ˆÀËÅÅxk]êRsì½lÏnÚÓ çaHNàF^65ÔþöÃ=ð¬eIFÒŒ×ĵ Ê]\ñ4°. \½nT{ê»þÔx¿86ÎŽwì>T¡Ü•®f©*®sU*7†á’Ų‹ˆð„œ$²”e{”@X¬ÅqZtLn0O!y²tÇÕ£@ø¯/L²[ÚœŽ7§®Ï@=«™¹1cÄ`óÊ›Ê3ÿ€«Òæmù/¶éSëZÀ¸Äð­ðuÇÁå8øVìònWoûE–ޏÅçFð[ÓÐÎu4˜m&»b¿!Ï4Fkf““û°ÝÕ2GLÑë·´ã§ïŒëæ<ÿ[Üü7ÓS-¦{=™xþyÕƒâéÉe>t]æ¨Nsn8È !ú\%•½¹kØ„tYšÂÅz«5¬•»<ÄÅòän •õ ±›"ÖÉÆf—Ý®º¿¶»ºþ¢ Ö0¡êÍê=´w½¾º-Jµ²öð‚/ˆÍ5Pj¹w|AìfÆ3Ô¦°Ÿê©Å:HÎl¿ ©²é¯ÝÃÀ}rª¾ª×I}¸_t/ÝÞY‚c5+­øv¶6)$¹mÜp«®½Ï˜ÿS¶S÷ä ÃFU§^·^jÀVRW–]ô9ÓV®ñ3BUSÇ~—z4”Gj2#íô69Qrh×rã}èA|´ ÷Â"ݱ€›·g¦ußuG0pÌáH"")]`í@|7r8†Egk$Ó'gK'Õy}zV„®ÁJläo²À‚]=qj~ä‹î§†æÍÄ‚§¦Q9¡ŽT[£´D—–åoQ–ŠƒR !Rå„WrfM9“.¤‡ä Q‡d¡±BÔe‘~¥PÈØV–`q³¶Ry’unC¬6“±cgG\µWŒéòG+àgÅt0J\©‘ww[A—÷¤`g†v¹8_Úæ•¦degF²8Ó0aIŠ ÑÝÖŒ]Ø”úƒÓfl)g>ÁpHC¦i Ž– êQk1æJïÕŒ¨E{´ÇV$„.ãèAõW¶{à-9E]dMG©Êg4 ¹ È.,ØJ‰~hƒQ/w  !:ö0C!–˜YlSš—I¹!t!–¾ù›V;ntp-4.2.6p5/html/pic/barnstable.gif0000644000175000017500000000560210017034536016136 0ustar peterpeterGIF89aa´Äÿÿÿÿíkž©ƒOŠjJvYFaO6XX@X@@WO$F7!@@-#& & XXïé,& ÿÿÿ ÿ ÿÿÿ!ÿ ADOBE:IR1.0Þí!ù,a´ÿ 'Ždižhª®lë¾ð»Íqmßö6 ó†ÿÀ n@äù‚È ¶ìŠË¤´¥ë|ѦSKŒN¿¦a×ËÁöf[îÌ.©Çr•¸›ìÎжþ=î=‹P€bdzIMbEv€Œ‚…l\vuŽ}Œˆ_hM|}ŸFšS‰<—•cŽ„£8‰s‚¨Ž™¬†°˜¡ª«´9¶P¥±¢»HœN‚¸•³Â@=²±¡ºÊLÄ—ŸÐÑ2Ì€§<ܪÙBÓÝÞØá.jZˆŠp•èé,ë©yeðqò¼÷ŠÛàú”ÀúGç—±€5¦±£ÌÂÓ‹÷pDDF3ìÄH±âÅ‚¾Ž¥±R1ÅÇEp>ÿÊê(Oå™—S– ³1årõÒÌ$QªDÇ&q#93ã·sÉ-¼bò•T 'TcRtZÎÆ«öv–á`µË¥šÝ&ˆuƒ (PPmÕ®µøYÓssÙŠ¼«#Y^Fï®<ãf¬X?‚¾Ìš7ã^Œ<ÿÕ‹˜£Q©‹¯Í쉰á+™æÌXóhÒ;I/µ¸"ô\ÕŸ#«pÝXrlº¦Í¼|íºôª%¶sLsuÚu{&#Ùxp¸—ÝyjÚÍWGîÁÂëÓžGË®þÒ‚Óú”‡mòŒùóèÓo]|Æ{óñ³™q`}{VÕ,Ñ‚EÌWØzÔɱÿB3ßsÄ)èßÝÁ€æ'LƒÝ¡Fx¸•ñ^lî²¼g  z·A‰ò§•‰-º8Ÿt§9ÀÁ}4ŽèPy>†æpªÉc†ýiÂ$üp,žÁ—7’8ÌŠ„¹‡–Àa¸Á{k¾DftÖI§™B¸XC6é!Tö`ç „¦H "ÞŸ÷ùIÃgÌI褃jˆ‰>àw$£pÞwœ¤” ‡–§(Ÿqzª¨lZ:LŒ3‰âq¶m0騭&8Š“4ðè kr°À‘RbQ'®¹n€¡J ˜$°iöࢰİÿxZbè¶Ïb†Å&+êù¦ykúšá´ÃV‹íKÚr›%›\ ]+SÎ8®kâh~$ª k»9jIè»J·Àú¨ï½lnKš¼¶®:)žWìžÂ˜ZqFº%bñîKñF,q@¼à ú#¿Õ€ÁGÁ$H`2pž™Ý›=p1¿aö /Á0¯*Á)tX†ž‘œÑ-¤NŸëc¼‹lgÉ%ϱ¼iá ˜¸à* (°F½¯y¡ÊLóÚ/uý`Æà","¾34`.§ø }*46Ô›©ÎKoLß Ÿ‘X[zñ£“®Q½^*!nÅŽ­úyÔ.ÐWõG%5‹„W.“±v¼í÷XëÇô‰èÉ eLáîí‹ (üý’ßüˆ‡ŒˆK}êèüh`7ì |Šݵ F?Ù0;ËHœêG×i‰.ͪ @BjhìW,\“zÕ±x@éZà6‚TÏxŠ2Ãfà  Huík¡Ã¨(b-Í÷™"H¨€âñ®X¸S ¹‚X"€uN<’ µ¦á퀒ۀ‘ ¨„ÿ”=±yܳè2MZ)ewFüÍ#WÕ:ßû Á–ñðQ¾ZBˆ@0Àt0Þi°uEI€ràÏ(¾¥h‘‡v0Àæè„ëíI–·ôॠF€¹ä¶ì`COÖÑLPK–¢|…¾É’Yu3â”´„8PÎf+69ƒûö§ÌtÏMclcáPÓ1ºA„8G¸ g¶…¢FA°ˆîcÌ£EmE§BÚ`#yRÕÜ}Ì£‰–5- þk™:ÜáU|2MqY3~êÜV1Ýù­ZêHZ¸»G5r±'{6 Ÿ£Ô}‚%žý@©˜(³FWÂø«gY3N³–-:¢þÿ*4žºÁ:I>¬#5ÀaüJ¦P­8S_Z„€P Hñ=ªé¬Ö–¶ÇÀ1Á+Ã×õ¥¶žñHér 4[¦J‡% |2èéB5¦ÕhÕV"yN3HU‹X–î,žåI* )6*‚veÉ™gãt.KS*¼BÑ‹$À"v—wý4¤­+Æ À4ËPêsžT;€ä–·Ö@¡ç(ÅN8ÉXe–‘™igËKV¿Õ$‚)G"Î|émÿÏÍ¥eV«ð„=Œ0ݰœ&’ÚŸŽd·îÍêgj½¼ÄÐÜ£'\`†"™Û‹Ö}™i)Pa:_îê&iøŠy ¨ÕÚþŠ®Î€„á«R².æ­¹AÖ ÜN…b&]{ ág€»à£ëöà‹—<ÀU Õ.s$‡ÖÆw”&–°tëRuê0Mò,€üs"Âehl;°:5cs·_Ó„ÔN)’™€QcŸTÍiýwM.±ŒqÓ. óïŽÀÀ•‡Û @ýóàû/˜æ ì˜5Êiîhß–Ÿð,¨ Jå#ØØ«:‹93šÕsç dßoR¦^BBÿñˆ°)%CO˜a=¾d-ÕãË×iç ûç_-„\&Ó¹Îêµ [%š”`Ílnsa×S[úlYlðpÆy2@ÏHDìA íœc ЙÎwÍ"r„2X?º^ßSX¥‰]gS#ºylÊDœýÍÚËšš¶¥,ËSÁÊXÞS¤ÁÝ¿qç¸ÜV¥Âši›&v-̧&öN ï|Œ0x±·HîótÌĶÖñ‰-K0 Û7¤5˜ómë|ï›ß ßļém]º]á%¶8¹?ÐÙlüÙljr¾þqŒïz6Ëxº9Í™ƒ9Ì-/6±ï ©Blàä¬qäbtr&ßÜÐLÖöÿ€®ô²Í`å 7ñÇsŽjÉ3'p÷„nìC½ê»xxaÜ õ¨ß|Çe×€2~Îté[7úŽ/Nqœ¯é˜¡öÖõnç}{Ç€ç»Âm¾öœ'd¯;ß7`t¿ëøÔ-7:¿£ÁvôÐ}ð*o<¿%ukÿ;æâ½¼¾Cîd—}çQ7vÉw(pÍL<çÇ.=ãI,yÌëJE•'!z1/œöÕf4+~þâP²<ö¾?ƒïm-|«37q=²¿ïCþö…þiô^ýÁWîß9öמ{ã‡ß쓟ø»W¯ñâÿòúÝŸ»F_}öküÊ¿úëVnÇpl@ìõ¡ ]'yí9Å Äqˆ÷K,÷$ìóy͆ű>ýOoB f®'â7ˆ`<À ¢ Ú€öwG2· ˜wt x0VòsøhóàYÎÀ ¨¸uÐ|¨Ô1%øK~3ó¢>TñAh_‰TzeþfGC8„|µœP1;;S„dV¦°Â¥‰ðô0’SäsùÕ1fR[Lýö"mÀtH<žpDJH…t`A~؇!á“A]\MCƒèlx8tƒé0¨Ðr˜ˆ”Aø…‰Ø*”h9­¶‰žø‰á;ntp-4.2.6p5/html/pic/broad.gif0000644000175000017500000001314011307651604015110 0ustar peterpeterGIF89aqOw1!þSoftware: Microsoft Office!ù, LEÿÿÿ„©Ëí£œ´Ú²Þ¼û†âHrWT¦êʪç ÇòL×öçúþ ‡Ä¢ñˆL¹žò J•ÌõŠÍj·ÜîÍ9 ‹ÇÇê—ŒN“ÍÞ¶û Ëß`µý^nâ÷ü {(8HXׇ¨öGs˜è(¶X(9IYi Ñø¨ )“¹ šw9JZj÷ª*Ô“º +ÐzJ[k{+ñ«:û¢» Ú‹;L\<ú ¬)|œì¸l-=íÖìŒ]a}Í—Mý ÎhDZ䳬§¸a.Ëí'/?°à^t–ï—è=¡ß}?üG¯½…ÃØd `°?wc""˜+M&'ÿ-Ššç!C{4(xx¥É”fV"P‰²Á"|htqô“Áœ†s;eõ¬©®b™s8ëôèÉÎgN'H&pY¯ÊÊ©1¡€)¬¤H/C^=³ÞK±_Ÿ†u€ñiÍ¡‰ºõy°­Q¦8<Ú|+· ¿·sZpèõØ™cË 6›MëÖx­“] õ±áɘ\­5r/ž{ñ¤ÅtY߉œãÞIÛø©j‘);εz±8QiK^ÝRaaØ0ì²í·´fºgÖü6íVx[rMíÕv~»pnÛ”+ï–͵z쓆{á³l3ßx3ó\ê·¸PñrÉ/7¯Ôã9Ñ·ã®…}ìÒ^ÿÖÕv¯é—¡aÞ'ÊM´FP7\y. 3æ7ËYÿPüE£[WB×Õ`%‘ˆŠ Ühí,(QE>ÈJrÈmö"‚ÄADÝUVõ裉ˆÅ‰‹|vÖW^-J˜ž Jd£iÀáeƒHnÉ¥)JÆãOïwÞ”3V”T•z5¹ÙRijÙeœròå;Q|f «à9gŸ~ÖP§žTœ)è3Šèú‘”Œ¦“h¤’ª÷¨¡uUªÌ¤šnê ¦ð)“§–rJj©h‰ŠÐ¥¨öª©®v¹èªó©*«g¯Þêj¬²¶ Y­{ðŠk°[éº*°jùzš°ÊÿNÚB³Î>[‚ÐNKí´Ë^‹m¶ÚnËm·Þ~ ®·Dæjl¸æž›K¹HŽ‹n»îzb•©*¾Ko½Å[ê¼öî˯ˆønb¿÷p¾FŒ0º[pÂ+¬î‘ì>L1¸“zqÅk›1Ào òŸk:rÈ&“«lÉ'¯ìqʳ 3v*G:sÌ6÷Y3¢9ßÌó–;‹ürÏBƒó³ŸEôBGϹtÒN‡ÓtœQ?M5ˆAË6uÕZ'yõbYo ö)_¯ÛuØf2¶ÄeŸÍöiøvÛr²öHuÏ·¢w'´wÞ~ï·Ì}ÿM¸”ƒ3vxáŠ÷–8Ô/9.GN9ZÕÿ^Žy´MdÎyçWŽ0±¨~,º¨ƒÎHÝŸ[Qº§¤#›¬àZ¬NÉéMÍŽ ìÌѪ;œô‰{’´¨ž{ïQjüñ® |- &$4ñb$TLLoýõ%ŸÞ:¦¯'/# cÿôDRŸKc‘˜úÞ’Údí[Çam`=VÕuó×/“¾Wt_©ï/ åŠ_ýö‡–è`-Ñ_‰4$ÛÝ2±ÁÈ€:¡˜ 9? ì%ÀJ¡€¬©à_ìƒÁûpð?dõç? íÇ5òóWX4H?E‰€„ÚáE¤TBþ …3ä_käGbÀ…Üño3 (Ö†’i¡}8ÂÿbQ@|á shÄ ’%0þqb½´ÁÑ„EÌßÈB0N>oz¢ENˆÉŽÀ aÿhÆÝ2 |#•(Ãá‘/‚‰9Š´7MG{’¬dŠ†Èºå㎬È#bôÉ]¨KE?¢ˆL¤—Pe’és&%8™ñ§#5âD=y‘ZòQ” ¡šá%'GA;öø¦bÚ—ì©e1iLee.{œÂ/³pÍe½r6ëq&?€ƒž+}óFYäÝužX œ §ï—MÔý¥›¤%|à㤠ّ™¢H–Ô„%+²œò|X0Ñɦ€RH)Èé?ÑéL{þ“ÿL%hAvPŽ)GëLÐ@ïôPFôF÷\“‹ô9¨‹:,£#ÕLI—ÔÐwŽƒF-…éF©´Ñ ©£ái§DoÊ „Zyô<©MÃÓðíÔhtÐdŒÜ %£ˆS¦æ–YM<¿tšM~ónqR²ß¡^“®4 s1èR:ÔA"u5]„V¿:c²ŽGª¹ë^‡Ø;)ö“½ìßXzl·>Àµ³}n·“ÀÇ>w”Ÿ} pŸÜónŒº¿ãîj|W=‡xÎI+ñŒ¯–á‡v×aýýñ+‹!ɶIyn[žY˜ÏüR]ë±Í{~§ ¿¼èG_ЅɋŨÇxäEòúÖ›-öJ›¼ì+F{¾Ý>鹉íw¿Òß_¢÷ÀwñW|× ßÇO¾Ðšï8çïúD[¾ônýÚeÿúï¢~Û·ÏývyŸã¿ÉÊßð›ß\è·ÚúI¯~´Åÿýâš¿ ÚOÿƒÚ?øg럘F³tS rc_€7€n3€ÿ•€ð³€rо`b‚QJ!¡¶åiHy§ç ˆ ñ‚óÕY%Æ\ûƒ\Þ©S‚Í19ügJ6„aS”Aáuƒ-h8¥—:1È€<¸F(x9HD¨ƒâÓxI¨„KÈ„LH`bäÆÅ`Rx„™Ö„Wˆ…Y¨…)ð„^…*ö…GV…¾ðÀ$‚fø?eXa^(*T„n8†!ø‚ièƒxV‚x]+cz‡HV—(sˆW5•4^rˆ§Ô‡tˆ:Óˆ‹˜4@H33‰ÆG‰‡"‰•‰jÈy™¨‰›X‡ŸÈ6ÿÈ5¢87¤(¦(7¨h ¬¨ŠÙ⊊ôŠ£x†tP‹³È4·ÈWºˆ‹°Â‹`Õ‹a‹bó‹Á¨6¡hŒ–ˆŒÉˆ4Ãè%ÅÈŒXǾ4NVO㌥°ÙxyËè6ÓÇpá(ã8|åh޳¡Ž¬ÓŽëø}à'ƒŽÌ÷Žó˜~òˆ S•Ðûh†[(/3 Ä xÜ@xvúw\h{ÇwiǺçd©XÀƒMI"‘ÑwÉãWLôbt"’ÙŠ9+/—u!©‘XàUeˆZæ3ˆV=Í%h5)=‰’ ¹a\3É[(àH–hHj%ÒyOg@QF?@ÿy?â•e*(”I() i<,Ɇèõ>NioÖbR‰ ‚øX &„¼ÁfSfFøµW^b•<Ù_ZcV”–p¶–M¶D†† –—uIE‡h=´dÌ÷–XÙ;rù^„¶ ´—a™D‚)†tИ‘cb„O†—õu …I‘=™Y~ù€Œydå…™wö>˜FˆØ•fy‚væf¦i–—sýpimÙ6p° —d”˜–c_Ù‚$];Fd?è•ÖH@©!Åu[$A“ß…JÃcU¶ÄKÉÉæq¡€'¤4" È>©Ô¸åœDÙ1—7ò¢qGp{Òw4G±0 Y’$Óo7ñk:ÿ‡Lø‰›GnÕ¦QÏ$Mo•m]ös6"!C•ëRŸÑU,7W ºnlåŸÞ¤ëmã!o g5ò9{ šS…nIEWjMõSHµUz'Yn´vTUlºOÖin.J%B£ØÙ(+*-ºqõÔQFµm*™›6 ¤ãn:êc<ê<šP"T§l4š u£.šOê¹_L*6é9W jp):£DZ¤Yz¥g¦HçÙç"ê *‡fn tdš›lÒ  ¡Cš2ƒ@|ø'V,ÊejVvº&=÷¡sJ¢àVÃtVe¨Be ÷bWh@ü×^h!#É”SG§§A[Úÿp©Ø…šõ;‡eª¢ª©:´ ªuTšž×€˜ÍSŸY«µUJ©†/§v=¹•h¾5bÊ©e©¦ˆ8‰œª[vg˜ª{•«žµ«(ZA KÀª˜G‰CÃUZÌiž„EçÃf+È”Ï5œkØ\ƒ¹^°ù?œù©žÉ O®Å)®0ô†'ÈdöZ©øã\ÄÙ–°YceadÖ‡Ax¯÷•™€Ã®‰zvˆ™­kDb,ˆ`+˜ù:clé r®´°¨4IÿªdbÈb;; KmɰÔ% Ûf{amÔ—¬²«ªþº²ûEN”d/»bæ ™°ŠE¶™]'+\5KdùJaH¦³R©üÿ*©Å)œ\ •vÙYU6gwYgQÙ³ýy'aÆ kU²zT ÏàˆúU3Öfbi^—i³X›™êõ´ F†¸H¾Úg‰ö«Ey“-{­Û‘­ š_Ã&¥”e@KR{RsK*98jÑS·|©jx{”ƒ²††jûܲIUú)Zº£’¶KõFY‰ûª\Ú¥‚‹gµ¨úÉk#úµÌz›ƒTª‹oJ:‘¦ë–0Qãô¢º»úº°û»Zu¦íáq´‰»§+tîù£¥Pf¼  ¶-—%!ŠpcK¶ÉK˜hÂh/õ¼ø¥Ù rŠÚ½Õ¦ç¹¥«½Ã§e‚þðM堞ةÒÿK#ØKñ›蛾h·¾ì«ù¦š µ;¥í »÷¨5*o›ô¿›‰ºX¢å;¿¢û¹ãºlpÌ¿üÀÛÁ9Ei8Ei·ÆŸàÂqErá{½¤«¾Ö8©JG@a¦s×¨ÈæÁìlÕTÃ0zÃÓ¶<–1œ/£ b º“Ë ;³º‘©J4F,dHÜ‘†û³¶ê’e 5¨«ã«ÓÚ« ÕiÁ:–~aÉU$d¼ZfœIì³>’Ïúg«µ[^ G~öÅœX¬¯t¹g¬Æ{FßšcU–ôjƒåÚ¯h¶“¹†.¶e&«ÄÈâWðÈ{ˆ¯ûÚ†•|ÈŒ š½9šáÚÉÿ¶²$±«‰–9‰Èg¹ÆSüȾ"´Úñ¯CÊ«™¤LË}iÊU;´B4±Œœz{€[YËgt˨A²ö v­|^þ¡²o+Ǹœ3+_§ ±Àl¶nḚ̈|Íœlcú_ ßáWÅŒÁ{‡ÌÖ¬¯—|Ο|µ'ÔÍš¬à œ‰œÎ¯™‚j9µr–“ê•B3YBúLAáÌÆ:´0è´óŒ¶ç:FDµùì­ÿü”ÜáÏ”}{œ¡f?v|·¢&¬¥j¯3”WE2˜©ìÈmìtï*·K·m·|v­BÂÑA‚® Ó¬é3™šÉ§9ˆ™…‹§Ó;]Ä'4³/-16-Ô³Ìj8•ÿGÔhYÔÒˆ”ÕdI€+5T.—ÕI)Õ¹¶ÕU¹ OVM6] ÖÚÔ­8sÖe ‹x<‰ž¨Öõ§o 1q-×ì‡Ô™V×üòÕtr×y=Õtí×p-,{­1NQ¬S‹>{ŒØÞq[e Š¨Ç {}]WÄH­ÄÚJ«$žCùØÉµMšm9ÏéØb²Ù<=o[Ñ/{Ëî<¬X&;ƒ-›†<]§Î©]_«½˜=Ë´@­Î8œÚœ—ßÁÚK` IØ|ÛŠ|¯¥ùËM$ÜÑ ÝvˆÑÏ _ÇJ° ­ ݬÝÇÛŠôg$ËbœµñÜ´å.Šr€ñ3ÍÍ ‡[Üï=K” / ÿ‘Þá­ÉVôÜðM ‰ÏAHÝò¬Ú䕿,Zë,€Í§ýHÿýÊ)v"®=Ó!¯§œÝÜIÑ Ý[;ÚÛZÌ©ZÄÙÇMÐÁ‚Ž?¹[\¼Ñ¾Ú[üážÖâäJ"62N€M/4΀6~ãò‚:Þ}<¾f>.~@·B>×Ýmäç‚ãävàMŽä$NäP¾xONå·²ä#xå[Îå]îå_æa.æcNæenægŽæš‡ISîÒ!æ5Ͷ˜al~æ“ÌÞC}¶oÎ4ý¼ËÒ*YnÔØçݹ>tnãôuÐ`9 Üšµmè:Žèd„‹^ÝõšÐz~ŽŒ^Èè {šÿN®œŽéO\é6¨íéEXê¡Îž†4Î-én®êg_ø5é”ÎÌ­Nܳ>sŽÚwÞv¾^ÛÀÎëÎãç‰HìäwìB4ÞÅîìÏíÑ.íÓNíÕní׎íÖÙžz×ÍíŸG™ß¾lYаž‡­j Hèoxî}LÖâ¾<¾‰ê¿þÛîôþ\¼Yï» ï<››îÊí]€Ÿ¬ëŽÍý.ƒ¥YðO~ éꯗEÆéúlïžð _ñÍìÌ?ñ—¹Í¹Mw¹ñ®îíÄ Nš!ïÑ OñŸÌ-òèšofd|h﵃ïƒ\±Ãžì3ï(}ÑÕáç`\€EÿoˆD¿îFôMïôOõQ/õSOõUoõWõY¯õ[Ïõ]ïõ_öa/öcOöeoöWÍÖ½±ª?¯ögF'ÏÛûÐõMªnï&ßö§º>;JvÏÕÝîL¯>¤•[` ÞÊÌJl˜—=Ü~?ª<_ïyØè‘¿ò1/ùûëQÛÚŽO7)µ0ðö,ó%ò¸ë0¿Þœšy®´ñnð˜ÿòÄÝ¥ÿèÏnͪI”$ŸÆ)èF8(Þøç¼ÿ€^õ¹/ú§¯ü~Ib4Ôü5Ô@kgªO’°þùËÿü5–ýïLü¦_üÝŸúÔ/™DKùóúÛÓ¿üJïóžLùÍ.þI"©mØI¯Æóh£¹i˜›|r;ntp-4.2.6p5/html/pic/panda.gif0000644000175000017500000000317410017034537015107 0ustar peterpeterGIF89a~´‘ÿÿÿÿÿÿÿÿ!ÿ ADOBE:IR1.0Þí!ù,~´ÿœ©Ëí£œ´Ú‹³Þ¼û†âH–扦êʶî›2L—ò}×z‡ãûŸéõ€Ä‰ÐWL:ŽH¥Ál>ÑÜ”#Àä²±*÷ªBz€™÷¾D—7€û ŸÓ¯"Ïë«t£*£'˜ÇÔçÇg`6¸'f867Ã8Ùhõøp†C¹é&uÉ)À9Z6óÉ–I:jzºªJ:ðÕ xK:K›˜zËɪ»ëÕ» Ü5¼ú |ŒŒ[ìªÙLül,*=*K]{­š­-È›»l-ÞFI®~޾hYÌ~-”®-/ͼ§L{ÿnîäݳ~ƒ¢ÌWIÝ%w“ dBhß)†)ê Hh ¨ÿ-F$ÇÓDŽŒ 6Ùé7~ãè¥cÈQaŸ,!Oº,iÍœ<‰3IâÄX²Lʘð‘ô™å;9ì92ºç§ÃMN“òœBð¥Ç—!Ñ@š®W¨¢X‘Š4–쓬)Ï–Ò* Û¥bÓ 3•P£ºvŸRÙTŽÍ¾wך¤“)DÂj Ä%T1Æ"ó9·­äœ”ëxuÏçÈm;{-ÂXod¥«MW®Ñù-¯N®ý~®=V6nÏ.vûfLäwß7ˆ›þ!Ü®q–SÞ‘ÒÃ#Âè÷dZRR¹ƒHÒ·ÙU&LyØd²Ñf[‹dRÔ𤡙™¥ MNsr&¦ knô¦^:ɱ҈æe¹chm¤S"qFG¨AýÃ$Se@‡%Ÿp͹¦D­†x5¹iVWZ­—’y‘†hP€ ¹h*]²¦Jª`=´$—‘j¶ÚE|6tÒC2ééR8šuÔ§™&cUšÀÿ.&é±h!ªŸ}êTÈ …:[¦ó„ùÚ·®ª]T­’,oÜté±–JP´ØB»Æ è4e¨`¸æZ?Í&&X¼òÊVÀŸºû‘PÅþì0àùl¨»úZ- §|︱曉žÚöV±Íü¹T\"8EeÅù†Kñ^£Õ¨²Ðû(¬ÍÖ´°ÁбÜraçòËdV)ŒóÆ6ÓLòX;»›rмÚ;ÔЭ¶óÉ ¬27 ?sÄ/ûÔ½I ©ÊPoP´S—f¬É…µÖjÕÊB_Ü4‹Ì32þYÕÐc¥iâ’kð®óþ÷ÛÉUÒ§j©ÖwÛEŽ]W;ÿ]¸¨´Ù›ø!•»‰jÚLÓi©±ˆÚU &pÁžÉŸÜwÔvV€Ój˶å†;TÙª¾zë{Ó…§h¡s|¢Œv-º° C êhÏyÞzk›;éü7ï.ùilƒå›—Ë}fé×v¯óÁ‡¿w½ å*=úÎâP6Ípᓬ¿üþbºJ¡ªtÊ»NW%H¸{`j`lv™ß(.6¼0hÈåÕ‚‚M: ï ´: u=û`¤¤_mD_ÒÒj×Áî™Êw9«FhÃîFóÛßžf4P¤°„Â1Õ R"΄“IIÇÁúo4Cm¸®ßÿ)Ï #ôY’$téB­ƒlÜ‚wa”A‚r}»9„ ˆN29¶\‡+L©( p²\!nÉ h‡‘±„¤/{§Äj^¡‘Ù<å°VyÌ`Œd}‰8gúî N¹|A•ÅË «¾±E<Èð4ìè#¿‰M£œ’l®ÒÍ@n Ñ6‚O;KÔ(h>eù@·Yó™+&3ÇD"3–ИE ‚<" v(hDÝØ-”Ž,x2­©MoŠÓœêt§,(;ntp-4.2.6p5/html/pic/oncore_remoteant.jpg0000644000175000017500000001133410017034537017377 0ustar peterpeterÿØÿàJFIFddÿþAdobe ImageReadyÿìDucky<ÿîAdobedÀÿÛ„       ÿÀ¼²ÿÄ   !1AQ‘aq¡±Á"2ÑBRb’¢#3C$ár‚²ÂÒcDTðSƒ“³Ã%&61!AQ2ÿÚ ?•(1·Ú‡` »¿‚6p¹íâú#ÒVko –㙺R7pÇ,×'®žGkƒBé¿AŽþ‹”ÿ>ËÞ/íµþ–š•»0Ñ3ÏY¾;OÁÚ3V™}ÛC­.bœ_³{]ä+–rÖW* kY`1û ™Ì—dU¶4Ë)w¢ÝÞ­t·„µ©d¹™››‰˜Üs,ÛÑ=ãÁ}:ý˜ 7´®úø~ë7v¯–Î_Ôäs/‘§ðbyk6üØøBí¯ž³ðÏj´†ÓÍÕ=怶Êò6Ù|— }1‹?÷gµApÆÚÃñ¨Z¬Ø¬ÎøÏj}\ªÇe`ýüMcj™¢«°˜×¶­¸ÛÔZ~;ÕÂÙÚrðøf xÜöÕ®¯t_Z]ë y—½71œ‰Gk¨ÿÅÓJ²ÖrË]½Žåì$¶;½¼ É|·Öor¾ªÔݳÙÞÚÞ@'µ•³DíÎiéê+–rÚá@@@@@@@A©óQ̓ÁKs®Å*Èàv‚ÿ+3òrJæÍrOšH$F›;{<‹–ü²qã´×¾»°¼ˆ*‘wØ‚ê ‹1¡E]FJ®Ð ¸ˆP,Õ\° (ª€"*4QAéϳpâ4¡Ø¢²šßaoTàö°| Ÿ¿1­ZàØ€‚…õÛ--Ÿ;ýVJãξve˜û}-“ŸsåüÙ„ÇÂöPpñ5ÎØíÔî­i2_ŽYiÎnjÍΓTÞT”sÀкMc6¤×»î°“Rh(Ýy{%î^Êi"ÉI<žÖRç8º7ƒ„9”£W=£Nœ²9—=e ÓjV£‰iVã-Á5%¥Ý®+ÛåücŽÜ¶Xf±QT‹¸Â*ê ”‹˜‚ÍUÔapÀ* ܲµ]›”UV¢*(¡õOx Èè'ý®N>§ÆîÖ‘æ\ýÿ hÛ×±±ÌKÇÚé›§³aà*Uˆ=ª&tÙÈú’î*ý+¦œ&ÌN<ÄËyÄwÚx(ºF*M{žÀæéíG9p"[Ø@gÆo;kßâ\¶j$"ʹ¼ üïQ¨áجе·†..ÀiÝ^½6ÄŽ;FZ-SOÁúÁtîÏUÓ5x úÁ^é…Ìzʃî>²½×ªášÐÀúãàNçUÄzØðÿ\| ØÂášÜðãé3 +³\òÃéþÄÊas·®ûpïþÄøb²êÛsq ¡¼BªuU3®(hÛpïãý‰Ö 5ÔŸå[ôÿbuW¯ç©H?¦`þ#ð'Q´ò§+=ýÖX¾Æ4BCÅH©ãÙµp÷ü7£¢¯;b ?š5þUº§É*UˆI¨Øñ?´¯˜îýjõM˜ˆO¢à (<ël¥/ºFöÓMf33<þ[%rÈ­£è"Ù¤=ÿIü>•ßVUÆýá˜N¥F£ƒcÍYH, ½Zqvå’£©tŒ«26õ ÷•,½C±QY‘·¨vQZ8›°Ðv ®Ø›òGb ˆãoPìUã`ê H¹c@ ¢³ZƒÝ T”,ý.QÿÞÆÞÆ“ç^OúyŽÞn†¼Î‚ N¨±Žó s ‚ °ù«‹]Ú2Òîöî4Òµ¡³N†¥§RèÂqrÙ¶üŸÓMœvï”÷ä™îó®w– AÉùý.êQ¨Ž˜Ù¢dQq:”Ôk¹z|ïÇ-§Öb'µÂ­ ÷—XÂê5E³7*‹†t"Åv ¨•pѱi·b©U˜(ª*„:ÐRžîÒ }¤Ìg}À)•çòŽîw1ÍŽ{ŠÄâkXEzÞË]´ŸÚàØ€‚Ç6i‹¸?0ùb s2Cþ©tz=;*UÐÙ¦Á^µÑ„òäÔ>Ç•zU”§þ:ûÙÅç\ï-75¹­ô´z‡ûG6)V#¦¤ä¦¡ÆJùmžÊ“V×reZ]Ö;;ymͳ½äÓâØ·=+7WˆóG±Î|dt²½`û+f¸÷÷wÉRúS¢×ù¿3/£èÆêìcyX¾øjy®ì¬õŽaÁ°Ç1éuZKGಉí˜kÜ arÑu?%4ôÖ²Í8ÐH¢.Q£?ÿLÈ]Z´úŽ„ü+~|¦ÌlN¹y£\îÕÕ†BÞÂþOÄrÔ‰k'm§¯ŸJÊþÕ©ªe’‡HÜ8 ÌþÕ©¢vWþN“¦Gâ)ýge ô‹ÚÇ\h:Ó¡Ù!4o+´ô8\}ÌÐÏ-¼RHHøÎ`%x¶Ÿ]²Ýìð¸Û6†ÁZPC+àˆ‚ F«q+¢>Aò)V ÞºŽY¯.8\Y;žêt6…µí+Z5ÛlmõÀl[É4ó‘11¤¹ïvÆ´²º2ýÑ6sXèüœñº)í¬-¢–' 9®dMi`®uYµ¶E¼VS¶Ÿ"c¯àÿÙ¯›ÔIúÀ-yò»1xÛa°½9VÍcE6.‘–jÕ£bÐË@À¶Í\¶0ˆù,-,v΄TóƒbÏ“oì`_2òô/ZemYua4/õ\Ò R!§1ñQãõ ì,õ]]ŸÄ ºr»3ü˜Æ[d5ÆÞå‚H˜÷ÊFÊÞÞ.º8.ÛOŒKõ-ׄome4 ‡¼ÁŒ7X]´ün/̵çÊíÃc Ó«9jÁ@·—µbÔFZÞ”[erÝȃÁ#„ ¹ÛÉ;€EH&YÀÂ([GUù·—¡]@@@@@Aâ¹x ‡Üão©¹ïŸ*ºr·†ÁÈ8ÁרÊV — dy×}ÿ‹œå)±™Ç4ôŠ àœÉäæO%•}ý•Iq®Í†ª4çòò¿[Ú?Ðc7lªÔÞ§XÇd±:Ïšá…±Ž¶­O]“¤k—šïQÚÜ68Ÿ c]µ•5$2鯭f뮞‹˜yœUµý )ÚHxŒR¡Å»;¾ûef‘°YhNfÝŸ´¹|`ž†´SıýÛþפuN\ròç áw‘Ü]èÉ'¦æ÷‰Ü³v·š¸Ž¢;FM“[„mò¹wòŸö©É›!åžLOq'çJò¹ïÊÎÀŽ6îh•z@@@@@@@Aâoºx ˆ䣵MÙÚ]9[Ãn÷{‹ÿxŒüœ|ÄŽª½vôá‰ÊJ. 9Ç;ÜF–’EJ±l›úÀîžårôypçº_r‘áܸÁ)H ~ŒŽeË~Zœ6õ•S¸û‡þéJ!÷6Ϩ½ÿoŽÔÓ–¶oî껉·ˆñîþô¬eßÓ‡-yHÕÁ±<çL.“KLG@*Uˆ©bH»oH-àJïåÃ¥‡#î„ü¹Ç´›y'„÷8eqþ²Ç§+¯ ùaD®Í-¤?4 †¼Ò˪.é´q†Ÿ «ýU|ù][ݮԋìÄôÙ½¼Uî¹Îqò.¾¼1«¼®-4ÞjCít­Ðù¥J±à«oÚÒ(ÜÚ÷k_:íäÎÉ+îëzÙ4¶JʾµéSf¤Ö”õŸS^erh@@@@@@@Ae˜˜CŒç¡‡È¥X…úÊãóZ’áÀÕÆc³¬ ù×O(›¤»‹£Ó¹Kç ›¶Æ?àÆýů^YÕ×&„-kh.týÔt­Xï"•bdb6ÙyÙ·ìå­:(MŽ‹~wêlí>ï9Q§Ècɤwö¢V·ÀïìÈWOIó,ê+‹B o˜í³ÓwRO@©V!Ü®79™$;CKáy¯ßÊ|cz–˜Æ^ãxš[%ß´ºx?Þ¼ðý@=/Õ׆ð°¢ ð í%ˆŠ‡4„gãuLì#…²8ЧbkqZ«®^ê&áµ#.â[´Á·@Â}Y'c]â^›3¸Kæ=¯c^ÂÇZàj;ˆ+ÌÛÚEÏ­BÛ\?äÚú:O[oGJGÒ8{ŒÆRÚΓ>BfÄÞ°vŸájõO‘Êý©¥ag •½œ"ÛFÈ£5 Eæmp€€€€€€€€v à¾ðEÒ0d¡eiëiÅ1Sç5ÃcýaÔñý¥ßÏf6‰3É=jܾa/ÿ’Å46:²ÚîÃ÷=CàëYô×)­tÅÍ¡;™› ‘Æ¢¨"8u³:†KxÝÅ î ë^zæ›Vñîñ¤ ï'Ô3³ìmm¬ëÓ+€öŽºÝžÓÖþÖ;ÒâЀ€€€€€€€ƒª0åñ3ÚÈÐî&«* êì ÆžÏM -ˆ»a§waW[…±“Òyûì^^×)a ŠòÙÕÔµÍ#Òc©½Ž Ó1´r¿*Ri-_ŒÔØæÝZgpÀÍ›Èö‘8õõƒñ]¸®kejV}eD÷›:âÓ…–!'ê%,`ÚâOPI2¼#¦›Áå5& ŽuÝì•®ñ{ÜãóZœÔ×Öwñ]ÙÞ¾Òî!FJÃÐMxHÚ×0õn^‰fÑÏw]3ÍÛY¾£¶’87ƒ#¥jòwqR¦#ßÙÝ\öò³…›:$\BÙ­ädмU’1ÁÍpëTÅ¥T TšƒœëÞq`0Ëgc#rZPA ¬?ÞDj+G»òŽ%½ÂPbG*5«d§=ð¯zb2¸þJjË—·Û;َࢽêb7Ý5È{;w6\ƒÌ®¼'u{Ë+—PÄéÜV.&Çm[Na2Ê*‚ŽàøÔð §úZüJøÛìþ-ÿÙntp-4.2.6p5/html/pic/bustardfly.gif0000644000175000017500000002043410017034536016200 0ustar peterpeterGIF89aÅ´÷ÿÿÿÿ)))JJJRRRccckkksss{{{„„„”””¥¥¥µµµ½½½ççç„kk{cc!9)JZ{„œ­µÎçïÿ¥1!œ{sk¥Œ„cRJ{9œ„sœZ)cZRŒ{k„scB9191)1)!JB9)!­œ„ZB!J1¥”{œŒs„c)¥kνœÆµ”ZRBœŒkcB”cçœskZkcRkJƽ¥cZB{sZ)!¥œ{91έ!ÎÆœkZZRcZ¥”RJÿï„{œ”ƽÞÖŒŒc¥¥cŒŒJÞÞcïïB½½))1199BBcc{{„„ŒŒ¥¥­­µµÆÆÖÖïïÿÿck!ckJ!)9J!1)BJ{!9k1Z)c1{)œ!„)”!)­!!µœ)B­½cÖ„)9Rc{”­½Îç÷ÿÞ÷Ö!œµÆ1µBcZ!!))))99BBJJRRcckk„„””œœ½½ÆÆÖÖÞÞïïÿÿ÷ÿ­µŒ”s{µÆRZ{ŒÞÿ)1Z!J)„)BZk„œ­ÆÞ÷ÿcR”!ÎB{R­R1s„R­ÞÖÞÆ½Æ¥œ¥RJR”„”„s„919µœµcRcŒsŒ{c{ƜƔs”„c„ŒcŒkJkŒZŒ))9!9ÆsÆsBs„J„R)Rc)Zk9cÞsÆJ1B”c„­cŒ)!9)1Z9J„Rkk)JcBR¥s„kRZ{ZcÖsŒc9B”ks1µ{„­s{B”JRcÎ!cs¥½ÀÀÀ!ùÿ,Å´@ÿÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç‹ –-ðxÀŸSª\‰‘A60cÊô—À"ƒ3ý`ɳ§Ï ržIC´h”™Ï">ó7& —™5Jб€™`ŠjÝZ´IL €i¦¨™–ÂR]Ë–¡Õ™ƒÉ+É_Y®ZÑl‰9’  0Élý"AÛÈ.À)ÑÜÇçXÁ«•L }¯PNCF¦€Ä Ù˜)²iÓp ¡\&fÖÍh¬ÈìºöÇ+rúût •ïSª.ù”èôi7_({õ§ZyaÛÐ1ŽÎ Ê·õëØ³£2…IË"ȇ`Úÿlc+d´ÀÔ²:ú/_Ðt‰i˜cµsèrDˆ À9KHÀØL.DQPºÍd‰' ô¦Ýƒ¢ÂILº·‹LÁã‹kh4ñE`À'›N ST9cÅ9 (Ó9 èÐ_ RðÁ8æ¨ãŽp0LšŒ‚Ý)D^GŠ'¾ÉrË/À#S/¿ÔSE¡1ÆYþĸ  °Mè aÂ~逃Î6/IPD&ÂT Œ½•`›UÅP|Ñ\¨—`N~ú“I'¨YŠ'¤„âÉ„þØòË…þäŒ-þp!gFlþ¤£  Î* 3˜ª©ç¸À šàB ¤ÒÿÀ4ÿ$€Éÿ,p p>Ô@›9Y±V‚ác.j¡…Z¸èaŒqF{u¦ñE HÀ&RÊ„‹.ö“‡þÀZꨣšŠ.©¦ªp7À‹ƒ;,èÀ‚?közÑ€å$ˆ"ò'L‚ÒÈ!ƒ"ˆ Œ,p#ß'ñ\w( XêV 1È «¦ŠjjÈê–¬C9 ²ÊѰÓ꺣¦JúV4ÖÀ 2!„Â3!†’#ŒLlô\‹ bˆ Ì™€Ä ñB o;@€® . A.ø˜ *´ A¿¸À ¬Â-¬Ã½þd#MÍ -•SÔÖ‰†Y€ÿ±„ 8ÕÒ y„n¸áàæõ Èø3„ÔQ§ ðBíL4ÜðNàˆƒ€UÒ\eLhús ,  àlL;ôp9hI·A äd<êÈAûØ3pøñd‹Db‡%–`Ò­?µØbK-ÂÐ2KNE¨ÀŽè9 6Ô&ˆ>©í¨ó :çôëÏ›1ÀÌ6ÍPCM8Ü pÀRÛ Ý „„.P_L(` ܨÀÇÚ€‡ãí4¨, t R€‚¯›‰R ä`- Û̦¸Í?X VÀÂø€ Ê?Èq»‰ àuÀQìñ@8°‰Xéÿ°á ÚÔf @ Zp&f#8‚ à¶“4ƒ9ý¼AƒÌ„t[ÌŸ²µÔP%èð F4t@&(:£çHÇ:ÚñŽxÌ£kÓµœØÎ"¿’ ¯öHHL'&^HCØfL¤zŠgÌXÈ:¢`&]¨–„™†,¥ Di +YG»ÅÄ`x†R-NÁWÉ?@Y”MÊd¤øƒóô þ 0018À .¶ L‚Z0qgWòÉä ‡Ñ@CÑpP i¡rv`ºQ§ÆüÀúÿÀF˜À ¥@†…T£Àƒ³T ¹#Mb0Š’dYñfÙ°~ À 8± 1Ei tÃv†1aræ;˜Pó$T×Q µp À% ¨uL—‚g"(t‡ÄR7“b[h½ç…W34’ˆ¹Ø€– $W¨ § þà x‚ZP%PÛ§U± :°>Xèe[.Ð"è0+ito¨wt"'üb{1@`ÀÀ;¹ØP ª° @ § À ¹6WãZµ€ŒãLgPcÀ¹Áä0úØa& *ýh,ÿ *°.Cà/>%WHZ§dFY%ip—ª ¥ ª  à ™ ¾€ZN6.—"Êâ(°.µU“çÅBY#*?p6±20CcAuv´91GY—”¡‚â Ÿ€ sÅ ˜€!º0=¾W“XP2¢"*²%2ê3Ü/Hð +]“{$VótŽ Šp†ð3ƒà3Ò54FÓ|ÀŒ¡IPÈG^ 9º .¸°!þô –Y“%#[1³ ðYæéÐ5SXIp0¡Q@7„P„ ö† NÖ’ Dÿðí‘1º U–›”CÄÙa0*CðuÑà:àР..€Üo;)ÛàÓPIˆN@„3Ø Ò5ƒà‚ ßyvÀ\\à, è"–祘CÀ "¤˜90+Îà) 4öåb¢˜*03Ìô}2¡3Ò¥ö 8*10 p° + 50`_ Øì–耓a#@$ ë2ð6+Àç‘37Ž”c«# N8£Mb›Ä²7LIÐ^W9q ¹À ¾P )5È)h•óäÐ*,ÀZ¤>ÎYcƒýrÖ „Xsº’ \ ‚Gÿ™V 8x©Q"3P z¶ XF§Cpe7€œ! ü Wˆ.$÷ŸG2Ãm0 @‹5ÔCɦ1¡DP ÐÙ#€ ‘Ú«À@^Ce#à&97þ ÇY9OƒÙ¥Öølæ‰V`M°°xäL1QÙ€jø`l·°W¾Z8½W2A8ð’àB /ñÙmÙ0`9Ù÷’‘v)† Ö Ö` þà Ôp #Ñ? Û 媷3·Ø;Àû / }ð׆<‡@|€ {°—ð @uk© 9¡!@¦âEÌÿ‘&¶ÌÁã–кsu?²@¨vÂ#pàC¦  ­PkrŽ£–  /i““$`6øF9a{[²¥&P[C€ç`йÔÏySH‹f…#©Fö` c` #«‚›Dçpe‹o*{ÚP¶$F–ìæ62j‰/ qiy„"w:Ò0rµØ¦BÄÛÀU>Á\Ãn&5,ÄLĨêJt/è/±:p2)Gi SÀD=Uµau9£ 31Ö`±m±€Ï XÔä0 ´BßPf ")v&êÿÀ¤êc}´·ãl ’ `¼•ô*êµ ÂFÛtFü×SÏP¯xwC§w¶CkÆÀ<À\À|ÀœÀ ¼À ÜÀlt €–ùÀÁÏ€ÙÀ¾n!:ÍIÁñr1‘±ìÁ¡”б¿0q}&œ› ºá¥1‘¿/<1¬D*K—ñƒ0Q¡9 4¬è›b8&Ä’*xkêœ+þ@!_åÄÑEë¥WKk ·báÉá,%ÌÅ!£t©h¾nCa€Ï¨Æ ±züA}yÁNp\ÆÇ”o AlÇ †a¼ÃËÿ§dÆAæ"ƒLÈ«³ÔY‰,È !K‚!›2’Œ 쉱‰ñÃ5zÌÁOwèVÄ\,£q!zŒ«¼lbôÇDQÊ0QÅÌ·­×©t{u’1ó»Æ,˜.‚ß,£ð'að›•ÅþàÉa7EIǧüÉ,úrà£\o<…Çxi@Ç^hÇ èÿ“àµ|Lñf¸\—ì‘,É”ü̦Qó|N’f$K¯¡« —’ÜÍÀ,~LQ'¥Ì>H ³LÍëóÉÇ1ñÎÆlpÈ\qɡÚÇ}ÝÎø41€°¸hà'ÛdÒ›ÿáw—á¼ ¼Ã%h{ Í”QÊJÐJÚÄË Ì 9q£Gó\Ð#Íèdv]¾ƒÔG [ ÒZá'[0ÎéGÅŸ¼Ä;£ún ÕDAÍ/½ŽgÊ’,£1ÐãÒ³œÎ1Q”¸'iüÀ-› ¢à 8±=1“Ð\aÓù<ÏÁÅ;쾘Á`Õ§‹mwÝvÃ.‘™0†Úa›{°Ò§Q2pN#’ÙiÝÙ&üÃ1!Ž!Ș°Ór±^0cÀxn7Ð~E,BÆ3Ø%@f.°×v´6È‹@E†§ Ї4ÛV ÀBvŠ­Ï[ð›"IöÜÿ° óoÕ)D-#7”®@‰Ø‘ §  D8ƒS¦!J(eVÀ2‡}¼/à°ûÌ:’Vi• P¦ÖyäźÙê}©`  N•†Uߎ¬¦zÒcðÆy˜ÑB° ΋Y;Gî÷à!­p†îµ†E^=•fà!Q%¦¢WÙ *×@HôwôØ0Á ¬à‘-þ fx„TK HµvâdUÓÁá~0Ãó8á=u°¾8 ' .ö0Ή¥ ÚU$¨ Œâa!2Q G•Ì2`"~¢åa7ì3 € €ìÿ° @cÝSpæµ!—3g:âÒÆ®0‰qž¡’bŒ11âÍØ—"Š|¼Î 1 uÞV mÊxXG}-w+g`0Q ?¥Þ¦ ©õ«¦5),(Åb@QXMª¾v“Á! I# ÃÛL7D,@®9’ëG¾‘âV¾a ¥ ªP ê8êÐ#ì¬L,f ‡b Õ~¹Ñ>_ñ ÷3‹.7 ƒN7È+”®í:Ò¦ú cH š¾¤îþP!¼ 2åal%ÉTÂ…Œ!?X,ô)S°¹±ìÑ{!N7Fî ã ðiÅ8Á Öa ªð¨ÿ óç( ³@Œšè(KÅ_ÀOñøG €O:ì0û+& ¢4v¸ù#ë뫃ÜÐQòJÀIÀFÄpë*ÿëàš ó3?TçÈ ® þ€d1Á«HeP¥8± 0ô3ÄÆa²å€0T**ÀHnRÞpR¿3ÁÚ%Mz ¢°ü‘0‘[Ï;ýÀ€íò¨ð ªÐ £  ®àyW!¥ö³Ô«QÒ\¤³“縉²5Š{˜î *ãÀ.p)nGµŽHvdÌhfÀ’£Øç`'•\`D H ™® ªP ¬ kþ Æ(ê,ÿØW¦þðŠU[í)ûý8*ìFœ:€ËÐl‰R_3R'Qãü›å‘ ›þF¡b¥ÉŸ?LþnýªåÏ0\þ´ ùBæ „44ΠÁq# 3LÐ## þZhÔ8¤Ö‚ 8ðïßÑlîäÙÓçO A…êâàÑ£̤aÚÔéS¨Q¥Fu²Æ_'V jÒÄÊÒZ»l)ôu0Œ2VüýÉRãÈáj$Áî CFæð·l§6,h@Ôðaĉm"@Ú8 T4hÊ#æË—&_¸xñÒ… —.™Áˆ9ƒfêÔ1WC%l|”W0ºvŒbÑÿ˶pÛ‚Ä­1݃Áq”œÁÂ_ÅÉ•/ÿɸõÁ.eÀ¨õg…:y=Ú¾ýQ#ðŒ_ä(Ò¡@|Ü8j¥‰˜2¦§‚9T'ö}å•Ë_€/nãM.”‹%tHnA²Qa…㘓pÂÃxî(>æp‘CäBA)ÄBÄCoEYôÃŽ7´¨"ùš:c‹ÿ2ù¤5[ö«¥—±´¨ç-·Š,’#vܹ‡à‚À‡È1 Â(´òÊ(àB ï.[¤Ci¤BiDÍÛ\ñ@è°Â 1j4#¿ ÷˘±Pa£‘tã ®‘RàБÿà mš‘‡! €l"KL—[àœ Y3Ì£ iÄIL‘4ÅssU0L£Ë\t¹…b¢£·8*P$`5rgŠ-¶tN¢A‡5úÁ ªÌtÚÃÀ)AÔüDQQDÅDAD‘qUdõÜ7aƒÊp|ŽŒ¥@L§cp`›t8ç6†(2öü¢ö`øö¨CAµ1AÄýÙVAY„3ÑõxEGäÐâ½&´Èï™xÝ ”£•sX…ZЫ¥ðàŸmBp!€Hp…$ á$¼²‘a¤ƒr®1BÌýøi¨Ý|ä?æ ÿ 'R€a‘VÆ-`+t%ÁåŒ#·â@$X!…!Vp!l|á ä’Ö;¨*5DC A$EØŒúð6!$»\R+ΞË"pá_X`Á ¬x!…† ÁÆÀ…E«ƒÛ8PfoØZ€½sÀoP[[ø =J$ED‚~x9 Ä>Rw(˜rXR¸ L!‚ŒÚ"+\p£¾¹Ÿ“`•†ðA‚sÔÚ¦˜bWŸï-à €‹/J;Í)ÉØ 斆¬¥\‚Ñ¥`ÃÙøã è¸CÑ g4Øêr÷ι@Áú,”€KMˆÂü¢Bÿ‘s #€#$a G8þCyyžp–=áø@A X¢‚g=°>)0JR²1€, 0Œ4Ø+ŒÁƒOAà`äâ&¤b #2$`c6*8 Îa‚ÁöÈ9pðŽ)¬¡‹b†?о I€=àT˜ÐA ""ϸÌ…3òc ¤šà+h2ÈG?À*F¼ø“‚Sp1Œ7€™ ƒóàøÀäOК C@ €¼õDÊC €àXyÌ”…Z£`û¸Àˆ‰~ôƒø@3ùøC’”dYüqŽÿÐày#° ,é$ãà†7h<ä1ðÅ’BË ”v` Hä?­ãå•PÐ 0ó™ûä§3;`Ô‚š‘R{¼9‚œãJ²$*'EóÐÇŒò  (à@Ç3\ðŒÚ¥¯'Øè Pʘ0€ p†ŽVÏå(¬1è@?ûé`êÃV˜Ã$¼£Ü"»à…/~qT`õ¾Øl"Œ ±Â Hƒ&á þ`9Èñø@#S`Ï~Ò€(J €¢• j#䨣7ðÓƒ 5°©3ƒiyÈ €øº*“Å¢ž…(H‘ŠQd¢ÿ14€@:(w”¬a7øA~@¤xÍ ;ˆY‡"­8cÜÀ6´¡fà•ZhEÇL5°Oðc2 ‚â‡7­jrÃ&>! S¤"¨`nsQ¡ ƒ4&$H– 2²<ƒÛÚGXæ‘úò•­–&Øš l ™ÈÀne@@ |ÐD%J çæ§'.Är¤`-ÈfTàé`C‚²äż‘W}Ub€4 PÛ™^€™8åGæÁ‚;LípˆpÃ*”«_çš"’åÒ6V ±Àª$hÜH 9¸€ÀBÂrãç/•0µà·>‡ÿÈ@M?à T`mÈCaY5žSï#ÑIJŠ/ƒÌœ`ÍIàŽäx9‚æV°‚DÀe.øA ~,7´ù{à €H‹L-`ø KÖç>7€y´"n‘"QˆméPÒ  ¼áêm5n " àerËÁœ°UŒ€D ²Q×ýY1 ôAøŠ[~ØÃÀm“£+v‘m# Xaplå ËF@\@€@„Ù‰^Ý`9”Ú(,¸ñËXƒl¢Nv¾¦¦qœ£Òbg8F°³ƒøYÖAÑkcnÝÌT””€‹aˆm€Ò"ù^—ѵD®BˆÀ§§JUäÐlÀ5$c'§, t£Í[(Ø?*L LÀª¶%lÈ»È x¸ûÐa€ÀT#l*˜Á¸€cß3³C€7Fh)‚‹¼' (y˜$@È\é=ŒO ”p*ÁÛð7h0…¥[= •¦NuÜQÚ`õÙ%ÔhÑ Ç:€pc.~”sH]ép¼Ð9 €¶»ýJ|Bçruº½|ÔÝ3tÁ#Œ´yÔ`€ƒd‘çɯ9ƒq>v xÎxE/”bŸ>¸øõ®zØÇ^ö³§}ím{Ã;ntp-4.2.6p5/html/pic/alice31.gif0000644000175000017500000003300010017034535015232 0ustar peterpeterGIF89a—´ÕœbS8±dýýýööÿed}gHøøE Ž ‘xO r(! £ ® “5Î¥s®7îÇò¼@¢¢¢ ««Q=,çç q Z!¤¢ ªd81$ kk//¥„Z-# 2 9/‰spÌšJÞÆ¥mÿÖÖÿÖµ{½)罜j!R!ÎJÆÿÆcÍËËWŒ7ƒ|€ÿ½Zÿ­cÿÿÿ!ù?,—´ÿÀÆ¥Óq4L§£©Á,9NÏàT2E‘'“©Ø0.#¦R¶FÝ& Ôrëè4NI©“µÎíÒS~ºŸGëpPzƒ„YLˆ6EZLGDJGJ0––.—0™š‡m|¡V£¦§£z¡£lY6RS qD(´O¹GS£E«¨ÄŨ&ÀÆ£m‘E SnϡϵZ',ÜÝÞÞ0C Ï µÈ¦¹£ Éʲ¡衲]o¬êð ÖPPSž(H°`.[äÒ!y²€C¼Qà° âºÁˆ€(‚-ˤ€´ž2aÅNØ25ï”›P¬*U°¦Mbçò¨ÿ, Tì ñ[7K˜,T ²å)€ÄLÒ3ÖÅZ©&É9¨¢„TnŠ ÅÎ P|èÓè7*wÞËILÁ¼AÔH†Ú‰J$_4MÕQ@a urIËx`#hÀLpðY¡0„mn À ™k§xª<ƒWK4.¾|§‹ö˜. ^fʾsÛJÂ3‹bG,šÙ€ “¢†ý-ÛZ#  éaWëѸSmæõ[·W4´ ˜¨€Å‚Z'88wºØ¦ƒVjA–Ü‚ŸB{߯ ¬f=åˆ9tÄ×E* €;K„µ‡G™ôK<ÄäÓD=yU,ØÿZ#²´gLi Ð`Ž©W,º…T/8_æV/µ3nTE„síó™hmHQA… uCW@ Eä¤å HÅ$ÚOµ[‹ßÄæqFm6LHÆ@! § cVòq$;ˆ8¥ÅL"¯©gW(hÀ€&„Ba °‚ù)pè)X£&)¾×[¡Ý°‘¥˜q³â~,pàé3…Ùvãh>‚IaË8pÖ–„RN¡H×U @-p´C $ ÀÀ} `˜q¸Ö‡ºÆScz`DÁ–ÜSA-úqÓµÜDÔ §¨å"h©,S•iYÀaÿNh¨°“à8è¸áÌŽLìˆHìÈ×Á+Á¿0 ”0À!p`7õÄaoŸIF‘P xëVKt@7Ë*I©l,˜¢š[b¦ƒYòpJ¬åŽi-ñ­l"‡‚/¾p4yž÷o Á–- @‚{–ÐB´·ZêÂ…™5ÑbˆV‹™o±Ùú2óŒ[¦`UƒNt”Šb¢y9ÍLÁÔM·Üs·CB  …Ðbh€!„Rœ¥¡ri€o5>Õ¶ _{WiEkÉì&sN*È0èÜ1§Ñ%ò­­<÷½ùÊ­úÜLß~§$Æ(ÆEdÿ17Ôº°å’Åùv‘]ɘ )aÿP¤hux ÉCf£@\Ð;Œ 2-ëÆ’^¡pD÷éÞ«Þú'-tA…VàU†?µe©í¸gkpË^Î ¶š ®ê¥…ŠØ©ZFÚž°’ÏHåK´¢˜—!Dn=ÊWÝhÁѬè@ZT’¶°á˜`–1OE\¸Å}‹$¬ొÑ@4ƹ WþaŠØ'L ‰^Ì‚ í%¹†@C»DG!‘˜l!¾'Üð~…SÆ\°±n\ …ÛüaC†µ]¡!Œ…( ˆFZhYVšžèã‹‘É–±ž³ýÿ£ Céèaë!©CÆ7Pˆè=ß8ÌVdƒ«÷(aˆ"!D‚£>™LaCçùÊdnU‘Æ¥¢XarÊölŠt¤ a„£"Ÿg0lkšÑtå>@1À'"Øx£COpˆ<õ£t#•IËDNÑ©)`øR%=Ó1/sëp^1J“»@æ?Óp 9¾`—ñ…#÷ê‚E0Åkç#5å›Zð+RP¿~â€eǧa.Fµ,K{¯)áQ˜ QBÅB<kjT OD‚ ­‹;ÈGp$gûD\DI‚¾R*O Ïä'%fÊŸÿaÕCi°H0 À_BÊ0Åó)€Qɘæh#Õ¼Ë4Sõ8 ÁCà ÞƒjÅpi1‚ žøi…F‡ÐÀ0é”tÖq'G¢˜Gȶ‘‚›–â/Ï©ZE™Š.HA{òH9 àQåÕFùêȽN—:¹õæ!¸ªL[¼¡‡ (X»îÓÈ ihŠBy†V 0µk"OX‚)sŸà;…CªOêÄ;€aYi€ñ#•Ð-AÍ`ŠªÜ°:éŒ_ríÖí¸a îO3‰Â,Õ59¤71OPüÉÈn©1#…­,€ 3FS .76B×UA›dƒÿÃ8ÉàœqxTJTba‚XÅ) `¼"!QáÌÀÏSüÒB4#Â-jUÆ<¹8ÀFL›¾âè%ÃV.’\… qÚöò’ð•f³”èur w?¶Ò€zžP¸´ $04 [-lÁb?­mà@N€  ˆ† ˜ - 1™âÀ`‹QׂÑ2*ÙÈ òºG=²Ç p«Â–˜j0ý>ö_$€Žöõ‰73‹­@ vÞ‘Ž Èén¹ÞUÎ) (µiˆ5-ìa½ŒÃpÌc¢Ñ“GQhñ”:ª‰¢ž~cIÏÒ€$c ½âÛÏÿ ‹h0i_. µed°á/8€MpSb±ÕÍEô¢-ÎÕ,ÌÑÐF bŒÊP2_#VùœØØSA!%00@pu ø&,œïÞÎC´¸´ ÝòM+ëg÷ÐÐßPä*&\غ6Â7i¦R–ÈbȸJ.!’K·È¤`[³¨ûa ÔE@ g00 çs@i)Š-È fðïF¡îww§mnÓ©,Vp܉D ÚœÆ!Zb‹X+-¡²ymÔ—‚ûHÄç@yˆ7*@‡ø©Ú|ÛöÏþ%€ìmé|õ`¬é Ž4û ÏüôdÿßÈ"äÉÜž±N%S§âÒÌÚV¢×lß Xét %]&ÅS?Y‘pds!† ¯A¶“Nm÷JšŽA D½mÆ#@ hA!Ï©§-\K FLnSLèÈIœ `Ó\Âô‡€¡Ò Ä|é2êçÕ-ü828Zì7Î3ŠM“ÙÚ¡.<¯z%¸d»Ì‡ç›ñ© ÙÈŒÔBû ‹:İe™EÁÏC0ºeMm Yw> \HÂT-žò¹úÒ¤/]hwnnH±¾ƒÜWj‘–à€€ý‹Ìef|Æ'üg\ŸvxSRc\Hc[uiÃÕd‹ÿ$—G!€/çU•s'`i‹Ã½–WÌ@={å)3-AÑ$á§>(&‡%$4( üg|Gm½Rmef4F0/FŸfm’t@“f1@mÆyš&r¥;ßðÊòwµæ°T7àE¶!²¡˜!t>‚äð.Es 0-”±$Se;0àsl¨8 …30p0°m00v0²x%;j½bm|,Fc| ,T *1tXIá-ça ¦ùâsó ]±1nà€ŒÓÖ ËBAG3-m¨8C—UD€kFmiöp?, p08u×+ÿd¦t/6cúE41pjåÁ†ÛЂ¶ÜÐzÀ' P7Ð0‰…b2ÐçÁZ0@àYá^éÔ^…q×hc®¸8½—m÷bSy„„vHx¢Öt‚€žköx~2;ëg[RpÀôc•8‘5/='3P &Þ8I ÐQ /=bbáGùf,ò†RÐp¹¸7‚G4‡f{#,Àè‹Â’f}Hmkæ’H8!E<ñ‘}6 #2°“/@iZèÖ“FÖ¬ØFõGYá!=ÂÁÔ${‚Xþ&™Pmž–tO|d¦_/Ixþçi‹'ü÷xc4ÿÀ¢U¾ä¢´‡ w&<‰n@—?YrÙeP—¡kÈH€ö ÃÞÓG!ö¡"ÒCÑub‘mŒ'™tÕf’…—f?#jdVB€F§™E5)á²%”pÝP,°“ `dyt)0 IÖ2 <{Â\–Ð-^Ñ× =[–Ò`¼a;X¾I?¡$ê € çöø˜Àx\uèðxMWHý˜tKˆ 7-.@aÝвk²À`°˜/¬uIywÑÔgˆ" 6_èˆ8ꃊÓÅ?ÂÔ-¹u¸mÁÒ“y‹÷pDØ‹xÿ‚è€F'q¹XfŸFc&p¶Â 9ƒ•˜7 ÀvhP” ؈êØëty¼9I€/{üSVY’%øa1_cÖ¹8’ZR‘Åš u‡GfAGó'‚‘‚C€ðTT*bF°Qжð“/ ÅÞ¤5swÖs$SVê£$-B8°,¶Ò„+'¦{Ð š‡00¶¤Ô68×pÉ'½1ð'\OäX10cUŠ ¢¡yV…# 2 `ù‚$!&š¢!'0O¸Ó—KR>Ñ2x¡XX¢£ Ôœ©¦$ÁdjJ0£¤ü·7ÿÓI|ž–|ý„i T m²°fÒF¦P, žpg 02 Ù„/—È·³¦o«Cžn‘£*ø‚KÒrVƒ…å³i´˜•g98މv¨ƒ¹jS‡0©°xFç‘ÓB^±`t¤¥•d$Ь“3 ˜\™À)Dá-Ssrš8Æ; ª™™y‡§fFu¹¤ý™5@€0qS÷iQT0¼„4ªO¦Ù  S€ ¦`]‡3û°DÀñ9^}™Q1Š…KÌÅ(à”\@\Þ2ûø[)™ ×+‘ejFöXmP’W©ÿÞÆfë£z@c2»'ŒÕÃá`r?fdqÀ@…ò¡NÖsÙ–KÃ4°$°1&=°ð\“uÀ³˜|ÓYc™‡¹ZŒKê ¢–Ùém‚30Æ*40 0‘Ú2t„;Y”¿€3È žKC2àh¦JYºÇ1(àiö'& +Àh*\êV‡|–Èk‡Ú†€dYH€¨•S×pŠWAàÖbî` ¾ááãsÒzSÀvdГó Ä´ 0a"“£B,¸'ÈC»e—c`2"y |Ú+H„¼ètÒi™×„¢ÉK€g ap&Ð:­ÿ2°üeLf1 ðe!(%¡-Y’8ZâŠÃE!„’»p·ê‹×9&ÌŠW²uw4!y¨bP¬Å‰ã37)ÓŠ Ü %ô·ÓkL*!M†!9Rëxi%júu‡f¶ˆtc¨'‰04vÅT¬f¢I0²`¶ì²ràú-ÝÑúÃA%Úç™òU#& B~¥ (µà)aCeÕŠ~®£}cmu¨_xmú‹/6‹¾‚€ÊW“Zmœætck“©`Œ£@(FQw3>GðÙ%tp:'À?¡ EœNa 1±NGpr+p¨Ø>SÃ!Lb=ú™ÿƒóX¹hHÀÚÆC‡jjª|‘EwÖ]Áy 0À°“ šåÒ_’á ¡Ãùr3Ý®t˜È3«sýL›ÁQ¶ÀôÉs”áú>Þ~Fñw…¤Ô¦f5y™@ÊèXÆ¥²K‡„§¥"Z0Ìz —@°!Ò'ÔÁ:´P<™]}h`˜Û< ÇáP"ÎB á)S[5Ëck‹ÌÐÙ¹¼°C¹4&Ⱥع¿‚f;)—À¯B#°–]b< Á`ÆÁÑ“´Ó °' `y‹Q´0C›4¦›,€æÛˆ’aë—5ÿmJ³Sy! ¶œvqG(™Dƒ¤ÿr¬ø+-9–10qË,¢ðžïÆ“SO2à‹ƒ‰€©;"@Y— |H…(Hð0Ä(©!+¢>©P)Í%–ñ›òH¥%‹ÙF@xs¼|m½ÃÿbuÿW”û'ëV­ÒhZ«‰ ]›, ucZÑ#k@™nðàÀ¬Á*¯ñæà€aŸRS´O,(ÏPfr† ,Êp¿78yuH¹úeuŽU„‡h\}38¨@­AY‰ïÙÍ?œ):¦õL/ð¥{ -«< t¨¸)ѽÁ›s˜¬‹W¨*+ÿÀ;‡jÈgËi „Î'Œ‡ÈfKÂjÖ²Æšî½Ø"—Þf ýž‘ýÐ h@~¡@ªžHåY†¡( FS|*ɯ…*ȼ28¢+ŠG–ó/Sר0öx’Çð:×fäåÝ2 §ðq{½³¦õ“=©Ø<)¢¢dØyã6`qdq´ò£Ý·8'§‹cmêcR‚7–ÆÇäœYGsR3vqE£¿78%%xT@–Æwqâ-ûuå¬y k  3ßt›ÃmÑè Y¡¸q&&à­Œ%xS0± Xž×B6 ™‚"m½tÊú×b@4ý¸Ëz0‡Y…“ÿÿbt‚“0<‡§0!òut+2ö ”© Ø ö¥±öåƒQ´*K 8a hþ„p8Ú­®Z+(áIFƒÐ…´¶U²ÝË ‘t7cwÖŽUR1&¦v²›i\5y•Y¥¡¨€}×{dnÑÐÑ]vQ±¦`Çͽí ^Dp2Oà­2¬¼â€Ë€*}A4RPAØF½—xãž Zèd6q~"0z`\%•…꣦f¬·8¸ñFr°šy™³‘¢&pžàc˜¥cÄö$²RíÚ24G#Àd—U†ÄÏšy0Ó¼ÏüäøGj¦Ð‡·Úth# šü:²þ>š ÿç£UQÖ¦µ“ –¢é þÑsEe'ϱ& ôxb ~ªt5U¦ ‡üGóp{ÍBhH„#‚¬Aõꃽ2‡lv în3V¡àF8Þfu© TüµBù¥•¾íýè6Bæ IQDjG2m ÛÖ„3÷l¯óbF×Ë'ø‰.î8ø×ø?ópÕ&ñø¥³cj mtb\¥Z5@ô“í=ËPl µ­ä ò ôçXië£E³_§™¤ÿ{Ï ÷ÌSž †ŒÝQ,Žj 4üm K¥ÅÚXa= ‡Äk0 ÀeJQ©i4¨ÿÕ†ËÐõfO ´5’@€Ô‚3I¨ÕZ$R¬u*NKÈ$¢NZZ$$bþNJ,ÈOBþ68L&dŽF\:"&FZO#>¥":LŽ&`¼¼NÇÈÎHj$HÄ4ôÒ꘱%°?EKBÖÚD2!%4BØ4JÇÀKÝÊBŽ6/¥òSKœ’ÀH+ ñB–‰¶8hÐÁÁ¬` "d0¬˜1§N xJ4$hÉæ¶GÜš! òÏ ^!NEN: ÒÕA`AQpZÚ7Š'TLÿë.FD¸ñE€ˆJje46‚’ .eÀŘØóÃÀ:BÔôèep1ºk¤Ä CïŒ4r#†OL$òùñ#jiRFìÚ7AꓪSýuÝxa¢¿NÜê EŠQß*HÑјDCg¦@B¦J#ÙÄì®Û‚Ò¨jhêUJ‚|! ”ëK+Û®Ü:À©/ZÀÄ…G`L€AO´¾ÌA „%ØÖŽÂàÝkn(¡†Ä0i!g’CÉ1 ëf9#̹ƒ ÁBÐทœ³îA}¤€âžÊN0AÐZ‘ÁÃJ˜@V¨b‚ÿ’$‚÷&0è *:x1Ghë‚ËÌ1J ïz#°Œ™ÿô¨!)3ŽÌGŒœª;B'øz1Ä>Œ2PöHÃDÀ¼ÐЏ€E¬*šÅ Ú £„Ù*‚zì"ŠFüˆgIì)!°™ÉÙð¨Á £ñDŠ ÙØG' œIG¹K8Ñ‘}*шõÉh †xá1Û»<(8¡3‹02#öJÉj¾üº`áÏ4`4Žm$ÁÌ7„$¹¼Ø!償.CÊÐËÂØD€šñÍ·(¶`ïòW< ª6;8õŸ…T%5¢WÛ»Õ ,°µ^Ö‚Ùh—‰ÿú4àˆ©9#(ä²ÉB”å+†0Ü…°”ªŒ*±°²ËΈoUUµ•ŠÀD,ÀSó‰ÕÄ ‘‹@è=#°HÈd͇ÎÖNàÕÏÄ®`Hˆ[Ä9NICA>Јž¢Õ§œÈA²…̮ӺFèÊ;”½{€’³/ (¼+"!%N¨å¡`fI"_¨.³Ï0!بL54¥Rp‚à yi`»µÎPB5¢$™ÆôÆê#¼ë0€3» ¯*\ZÌbÜ*:…–ZðÄó©4â±­ F‰ÄQ=ÚàÏœgŽhç™k©±„.<Ò©ÀÇášh† Ü¡ß]CXÿÊ…Y ¼SsÕUÓámUË%Ý[8ä-¨Q9¨ÀÞ€zÄÂ4(Áª „Gì¡klœ1Þê†A)”gUò㔪ǔ5RI¡"#Õ·†æ…ç2ˆ‚¨àšuOC³ˆ1Ú @%ðTtÒ \BonÈI¨Þ d¼SÜ6‘¡•8ŠŸð_ÓX½=MÀD PÅÊ´‹<ÔÇTJ°†Võ*E)tæ("ÙP;Â@Q´!„z‡d(”3´Á…€8Dܧ8L'ÿsciu °é,&0¥7¢‘!S0× d`Gb‚Tÿˆöêcº¶taê–!Ú,l!ÆgÙA`ö£ƒ•‘Aý©Ð=w¹0_Wðáª0ŸC– &»P¶” ñ‰V DEìØ,À8A¦¢c¥:´àŠq¨f¥6Œòq–  ´ÄÉ1]7hÀ8Ó­8ä‡)àT¾uI!M°ÞöŽ;c|ê8` h€:œJ"’°C¸oo£`ƒpÈ;P<³q`&ïlQžtåȹ°Ò€t¥;D0âÊ"§2¬¼-+™¿X`xzáGu{t`L<«1(3þ€”bòÒ´ß(ÄPNÚÈ iRYyÿ¬·±±|m]Áš·DTëÌ"mt‚`l^. ž^PÂ& è€@°<{àScÂ'ŸPÂ#èG,dÔž@”k\â·ºëTOY9ªzrp—^XÀïÖp¯F­H1ØI;tÀ»Â´™«4—ÚÄÀ *ÐÈØ ç)°kMDX 6eD" € (à€ÂöêXIŒe|&Ö.’AÉLDN(AY[6³²£Ñc„_lÄ[É›eEE¶ªšÎ¬5øGJƒ  ®máÀï†6˜''pû%M9” ßj̆,îãô¸*V¤Lõ–?ÄéÿX|6 ÁB@ ¨G`6R/°ÀÇ!Ôèâ3Hlw+¥dÊp>@Cš£ô†N/‰YpÇV a•ÒDĶ¢E·TÂw _"(!õz-l€ P`4$¼Ç‚bQ†JÖP¢a‡Cð€Ië{§k¸×jà™] !ˆ U]ÎÙd<û B° 8AHYÁvu ˜ä]B€dvrQ»!ƒ4®Áä8)PþdI@å*¯J2HbʦB"¦IU“[U˜×@~gœQ°q`€]îØï“@†âŒLŠÔ¸ƒ 4šúo¸ó­†0uÐãÿugráÊ » æ±"º„ÍÖ†2îP@<©Jä'X;a©­c$8PÌŽGq~k˃&Åjÿ à˜@k‘Ý×XÚ]A¶4 Àåô# NPìîjzƒX³2ÁOe¢…úØ £Á ?wØS²Îaƒ®V˜óq¸€Õ,Q5¢®0O Ø‹÷l{åã.X«w;Núl3 ¡hâ¦7«·¡\é(ì¯b.ã,;Ô5€lM ïáQH•M T`,`AwÑv=@"Ts‡œwój“7³PWhµ2^„0õ©ò fmî‹R!Þ½R°Ž}Žæ^+p ›sN<Å¡tÜÿÏ_:Ù´Ö¢+´|FPÁ6` PÙí ê×"+ ™œ£cÊZzçÂu­nç^ÿQ#…xlx߀ <°dg­Íü{[d™œŽÁz*µ¡·ŸÂaRZývd®oÉ@0lÐËoÞ¬µlu×Ù–@ìwϘ3·èÂJ”|õ—„Æ“Nk„-< uùëØ, ÐOD~¾îzR›ÝÊ)d¸úÇQCõï}îÌSô¶Ä€„¹‡†>‰ŠÐøqÅ € |ŒhÀÇ*à.°Í÷NAÐLN¬…4Ê.´(®<øoþ0 T «þ‡@|ëel©#”ÿͶ ¶6h¨ƒ)Ôï½ c. Å„Úïq`  N@̪bf.àGþÀÁìö®)¢LCN`{…aË6ˆ–˜¤à>àFÀ W°qZ9@<ˆ“0.¿¤k ^Ä:Pª2vÇñÆ„°¶ØÂ¦(D'Êર ³ðäºP9\¨ªº€ðKc& mïA2F OA—|®Þ*À—Š˜ ãŽÏô°Ïö° !…á Ø¢\é\ÔI\fNŒ€®Ï7œ ;FÁ*C¯§_ _ôétK$!°9lh)D¥lêr#oǶ«»lÿk@ƒ`¨ ûhÁVp…RXd3T`)@4€÷Üë:ú„ŒÂƒèÀ"!@ˆ£J,!3Á Ë£ ðÎ ­ÄLB1l«‚*À` ¾"ŒH *FÚ†tn‘ @T ö§ŒÀ¾qïúÇíò£vKÐÁ²¤a ºç%t猤I„“ÚA: hTh)d+9@ãl0¢ÑØh&x©BÊúP ¾Ñ)–ã0Ïl`@`¤òÐÿ¾ë¥Ò‰Î%BPÁ?&wø€…Þ 1Ö &ÁíJz‚/âà:zS`ÞÚÿ"çNÇ'9€jPƒ   Ò&ò‰ffàÀ¦’Cô¡:ˆß¸%Õ ¬ÅÆ`@PB%% ŽÃ<È} E&ÙA¦™, ÂÇÇx2øHJçh0 €»Ë0`«â¢ã6o*AÀ, 1±îݤ( Cr+Mè1¦ *!¨!}Ì„®!'<á™öòØb“ÆØáX²äÓ@ŽÀÒÌçv̹ 5}d»H ð|R J`0AU`1Ó 1`8› là3ER`2aD¢)(K½Ì¡}ÚÁ?þ$îÍ#Xàö.ál²Ÿ´úRÍ~®/]s6;Ôÿ’7/ÁÊÀ<@*óÐ hlÒ9Di›n¬ÆpÂl€€/q¬ž1J 1n‘ , t‚Ô€Bk ÌÇzN=1Ô.?”p L@E-€?ã“D`f@E¥òJ@X‘«ErBø§H C3fq£tÇN¤z ¶ÎÀ(YÓGf“¾ $¡Ç §DÁ(áP=u,ÕÌÀñH”7€*3È”#«™¶%û€J@Î*‘ 5NJ?TÇ (4tçŒÒUÒ ±2m2°ñtVË“VÕlRÀ÷Ôª.U?í €ÿ°“Œ@¦ ’2Ж€¦'Fh™Î§T£Àz¬-¢hJ}N ÒçÌ žÒŒëØ@-Í9ÆsN¢±.ƒÇŽ OñôçhÐÀÕ ~ÓYs*“[0ëTj* ZY‘õá@øc ÖaTÕG+ÃC¹¶Òlƒ lçœÐGðòCÝ0|γx£Ü†ãLÀç4-X¥q/SÁJp69Í:`EÁÔ²4v”r1?©*À`;uL²¾¨F1çüT¤àÉØÂ‡ ÿoCÍsVWu‘”@ ¶9ø"¸¢`ØBçþQ]“x€LëOEYôX‡38K 1{áK­dS aOAP*ÿ(6ïOeÕ wIÍØ³QlÁhÀQ½öG®e`NhþñT5j.`z"y€1ÿõR/Õ_ís8g`RçÑë®a7+Ž/gó^ïj7/i0 ,6) R`5ÿï°MŸèÀ·wU+Ü6Z€?àK÷38õ“E÷µ~WéNàxpG5HuÎ<›0u¿vcÿC•ç\66‡± íà[E*R`ƒ¶kl)!LHx¡B6w*ƒó>‘8±Î}¥Õjø VKAr»Ì×zƒÏk»ÀØÂçþ4$$!θÁ‘ƒj1ƒ|·þ:àø7ZëoGwÿIGm,T4RïólÖ„O`yG gFçú²çø¶¿.û2|\SOa8üR÷ÀA ê&˜äÚ"f8 Ögá·l˜‘êÃ(ea›õ7%Õ_ó}§P`ŠðwI¤V× {n»D±W…5•M€/uØN—¸Cý´v ¤JšîÂO±Ç¿š¦x@¬œèl†À‰³‚ L`sK¸_AZÏðqL`b© k°:ÀØò´ç¦ ÁhRàIpçšPÙpÎbkznÁ±-æ‰00Æ¢»”ÂGaË'€DáwLN‰ÔUá)Q§=¸*"u„-àˆYqœUxÿ¯C¹ ”VÓ¬»àd£CƒõØDŠ2Í Œ’ªº ]`/Mç„UUy,(Q`G}rÍ\àØb–N Gw7øÜð äP-@ÅY±ÔÜögmV±"™§Ô#2V{Îç„´çö² ”Í–­'Ë 7tHgsçøöÿz%,¡€u./‰ÔL ›ŠL€_"u`)$u8É€ß XéÕoi³tCÊ ýRçô´Ÿ1Oy…\ï•tÒ÷Cið†O@Šà7h‰ôå:n~­L D óX' S—ÇŒR(±‡Òøc6÷– hC…uŒMOïR=™V žÿ²xr£Ej €Fd6í›õa{,Á`y@  ¢ë‚Ó*×8YzVyÎ~9m8@\Y`“ F RÀp,6+ÂÀ¢TÙx÷ ÷2u!àP`Þ(:GdD WǶ5#¤`àw °ßÂxƒ±A Þ*»<ë µ9¯iXGM€=ÔI6€ÒU}ò ÀÙÞb³»|Å(@°*¢¡WÕ'8ø&'àyÌ•† L !èO‘à-L@J€0€H2@ª¥@?S”1-€G(€/¹U†w(ÿOGÅÕ¦AZ+°‚"|i,»”V6ò4ÍÔìØÈÚÞfašE‘Vû[Í,ÿ:¶ÞÐz! k¨0º+ô+®qìÇÀWÒ ¢ °Bd¼`ÜÒòSRMx1‹áç 5¤ô’ÍÀb³­,¶§^ÒÆ‰>¡>ôj.Ëy/ey~ßh¡”U@J{UÀr Z™!hÑꬾ àм䯽3 P´„áùºªÄ›†á÷di„á ‚‚ÕØvÕCƒ2iuYHß#ÕŒ¬µyËF€;ôLô«ËªBÒ²À4¢® ¤àÍ ûÓ [ hD@“„ g‰À '›‘„\ͶB ´ -ü¸bS66({u£¹ÑSÓø™Í5#ÿU`­]ÓËXUþhN€c@H#ðä:`Í×|ª ¬°3ÀD€lIX‘=¤”@¶|‰—”M¶©¢|ˆ=H§"ÔXÇ•ª¸5y]¶òt[CÒQI¤‡ä9׺¬¢ôUÆ Mn¥Ó?ÝÓu{N ¾%^S˜³* }=™ë:à°™¦HCXƒtÞ(ç õ±Ã§ã§;Áž¹®}R® 4ÀcV¥T•C£àcL´Z&@Ž’ lådfC†êörù7y›Ï O-Ù(Ý0ìðƒI×|§è[FÀ/<:j'¢?ÿ(õZiŽ—‘—+ˆ€Ç)C\xžÚÑu0#_*a´Y€ôȉ]-Í-,  A„ÆšàÐÌ_W¬ÄX$¨@$E> 1‘‚ƒB*©ÇÏʸ&Üh TÝŒroßð¡Þa#|×­€ÔË € d«+Xd¯ãR#LŠFy$ǬÓÓ@à eâq¾ŽX€=Å##ª¿¦V×|ÂýÍí!ꮽz¢D,"bdS¦RAãD?T,‹C˱ KŒ×AŠ1qYU@Ù‘‚xVQPEœö‡ýp“Ö(•€HI*…s"°‡ÜJ¦€Ò Oí,µíèÓ3<ÿ`VVÅBE¹gNqE(¨”qá8Ð,P°A RØ¡€0[¬ÑEeXIóB« &2,@I%™fN”,N²’ ðgAŒ Xð€Œ ÔÖ_>à 2>P‚%ÈÂZ\Žv. á€<.2Ñ È14¥‘-Äe@à„i¬ÂOŠ^ñe3#ì!Èi%&pÀ ” š ‘,Á"‚KœðŸ¦ìxŠžkùQÂq€Â…š Q¦Ð¤BJ8u„R'ÌR“·Äy,ÍÕBGvdÔᥪat€Úšp &f:\ÐÖj/àzÄJˆcÄ3 Á 2æ#±‚ú)¬Rhÿ,TXQF#N¨Åd¶P4iB·,i\P8L4èTQp´nFž2M¬ª}–kKØê®qöÎ x`„Oÿ Bü¨ÁœË†ì”¨E¨4T0‡»šÃH¥¯,uÕÜ.犥ÅE¶Êu_Ê2âYg‚k5 =‚7j­$€Fx B k;x°ì²*Ø·Ô< €¤ W‡t,i«‹Q5`\ŽëìÚA{o*©vE¼¤Çe÷ÌèÐ ¡…"Û* ‚å°Âß*hðí¶û{{àÕ•R,,A‚L66ƒ–ZËkÔBXJ /Úa~Uq¼ÔG:':0ÿâ42´uú­•šÂ €$€/Û$”û·³ûl«sÂàX¹PE ®„›’7î  ÔL¸øÿâšD¯+ÑøŒØ"1¢LÀ%9]7Ê&ƒ žNÇÉž >“¯à)©% 0îÄÁ-%P~Ì Â*\#%0¢0¹ˆ#üg<øå ‰Àz¡€ÜoKaF?8PΉ{Fh@ LÁi #zùdpzE¥‡@âGö—œÇ„ë|ï[Éü°Ã4C[›‚N8ôç ƒ/ÜÒÏÆmFi4p‚ |q¡5´UTD !@¯l…#ÜKǘЀÿ5@Eˆà8<‚ÿ"IõË5„šZ ¿ 8£tæaÇÇi+PÀXQ‰†ÁBM‹,]°Á¨!NqHG”ÐwzÕK/¹Zøð‚@$À[9Ò¡¥2Â"@ ðãùN¤¨Á ié…‹T*¯³à•¢©r†* ÙN3\à¦+M•<€C€,²GIK ÄøY¾ò ‘’2™Ä?ÆLSŽÔßJÎ*0c(¸€Cf…-LyË["tA{!¾(iG#À †(P”8•$Äs†ðK©` }qBØÄô?ô‹ÿS„ÆN•—qËc„1ÇqŠÀÄÂ9S @öÿdQry, TÕãh 9Ž`¬*k^ ¹&RBå4p ’è‹ä¬v̇á!  $BͲÒPc_ü%§*©ª¹AQù¥-Ô¢¿+^¡ «Cñ"Ù8^EP(Ì"R "Ç)\U§<å)Ѐ IA?,Tw¶å’¼¤ÒC¥LrV*ò¥X…•Hj»ª*0Ò˜Â6ƒ Ý…3Ù&GŠn&W˜(/š+W9VrRu/üG@P¥;Z‚€nA í°¢~ ÀL_ÊÃöLòµáˆ­c£€IòPäX‰+Ä^ÔwÅIŸ$ªºVIÐWA†lDA óÞæÖ³ÿ¨³šhW õ–åÊli¡1xÊ °ÒP?ÁdE)‘TDËâ©( LˆRT4YØ1ú²7®`„\£Õ^蛓qòJWœµºg!,nÑŠXYȪ í) k˜ ˜¢|Ê©bÀ&PÊp Èü¸k1â—NÒÄu Õ¬5€„‘£”:ž‚æ ×ÂòW1í4/5Â\VïmÑB\Ñ¢_Ò«EEea*!å¢]CPš1Þ*t5ÁQ]¯]ð¢86ÏaÏ­ Ê¿.O´£Ý2 \ƒ¯ƒì€ Àîå_¢ (È50 E¬»fÆ‘ t ÷.gšº=´Ïa^Ø€=—ZD8À÷$G†_Ä,`;ntp-4.2.6p5/html/pic/alice35.gif0000644000175000017500000002141010017034535015240 0ustar peterpeterGIF89a|´Õººº÷ö­9dd++-  ©©©˜˜˜_[s$Míwwwö¡¡øøÉÉÉEECþþþVUUbbιœ**‹¤^| ºªÿÿ“1¡”w-+­Cè|etlU1‰C‰œÆœ05ççº29|M. cc¡™aZE„„„ccck{kÊÊçççcZcsksÀ¿1­$nŒÖÿÿRÞ¥Þÿÿÿ!ù?,|´ÿÀŸpH,ȤrÉl:ŸÐ¨tJ­Z¯Âá`•™÷‡ $”# @ ã¯ü8ÜW€˜xzËYp42‰?fw 43HosQlqSb43[  q”33ž…o‚Cu}˜M ÀV‹œf7³ É¡Æ?» e·µ88 [2[ŽD7¾ÇL2Î_ßÐ4plÀšÞ4E ­Z"ÕñôsÞ¾°ÏO0T ?U\#H7êá¨5m£„¸Žð: ±¢Vï(P@%á@šh„”ÑìÊ"ÿwšŽCƒ ?ÖÒF$Ô.—Á0šñ­\­"Xnk…4œ=Uø;`UF;¯Ô8´[ÇÉáCfT£¶b™SŠ\j:ƒ…¼šbjªB¶8Éä”´P)WqÌÁŠ—Q¨48 ©3d>gÑÂsҒ︷ ÝàIm!Êå&÷ÁwÃOi9l$È`‰À¸[x’9Ã.4  f×ħ¤o!ŠMg&¬Ö—–P„¡&y'Cn©Õ­Ñj¹ÑªV»Ge½­ðM•z rÊ,£Ü:I ±[;R,±4Kq –YîÜr=ôЀq‡MB”3O"·àЗ x ÿB „XÀ 2øGÄ]34#A%ì6 7pÐu©õUÏšP]ÃxqM‚°QÏ$¶”sB‡H&éÁ1ú‡uDÕ;V!dÊaA Ø;ÓÜPÛCì9Bu–xÎ b±Vƒ’lzP%ÆSAåNrQpLõqÐ)ï|õ]Æ@Ó:–$âE‚pC}2®‰dtÈ!’PÀdw…pTxÐŒ…종1Br’#•ái¹Ì5%$ÆAµ’t)’øuX)¦àA Áá6ƒ-jQ²` J“YpǺJÂi‚Än´ÈúƒZÂàU§‚Ôlz»æ¯fºÿé’„éDæÅM=p¬Â_jµtŠÈ’•3f]tHvãE–Ö ˜'óÔC5 i‡dêºp0€ ›ªàmMVhá×,‰RÐA€YuNp>QG3L5pi x‹4uË¡$iðÅ9#iK sè­fU ’äi¼d½ñHAð~ ôž¢í0FZPÃyˆóš*äg@ˆEm¢·d{ˆ_ÃIŠ-´°ÃÚZÅ<ÀÈâFyÍ*ñÆ-c“ZCð‚ŠÀ=¶›jã‡ß-› «ÂØ@ÿzö®ìâ ±¤;ênåœ!CVÅÖÛPð‰­Í€q|ÑZp8ÿ¹a? ´ÌÀ͸›=_ÀÅnæG¼‡”Ž4d`#z#¯XZ9ëÈjóðç…X7è4(ÜÉ7ܳ¥ûÞ¶¤h+¹i-'¹¾ìUpg=û…ŽÇQ1nþ¥!˜š.6‰ÅLI!jÓÄà–>Él|Ã’Ìj±#b&þâÉ_À n„ƒNÉhІ#¤!àX`ŒAvU@ß9lXdæ&1‹•+I@ûg€!ƒ}éÆl€uxe6­8‘ž’;›0ÆJ›T~Ì·¤ákIxX;"vˆ‡H‚Åv‚%ˆåpâIT———x¥×ªà6¦u ÌÿÐ[ŒÙüe¾ˆ‘ËW^\’ÌÚ§$œñL †iÊ€¨…ZÀ(E, ŘzR…œ$?¶ð¢Æ4÷EâÝâbHÊOÏvÖ0ßÁlŠ:ƒˆ Ç#PF5†¸Æ( “ˆä”"!¶ ¡ExÔ*…ÈŽ7ì§@ÉÅÞéì“\Ä™ –ÆÇåÑÔ<ÅTÌZ#þ´¤?DˆËðÊjXìqìÚÌrfLõAPSá¸@Î VŒan}ÑäÕâ&E43Â)j\ÐË~"‰žå4f€QÌ8•<œlÀÑæ8±A,šš2ŸÆ291Þ…ÒŸ{ ]ât„0ø¡hÚŒ®,HèPfÿ·0ž<‡7#‡iŠ¢ðôŠ¥²ø!Ì5 Y0å¤ @'4Ru›1>Ì£‘ftÏ»9€ Ææ¸Å”S8ÛØ"FL%Á¬€:ý"ƺ <­Æ“siX† ‰¨Ð '´1%‡¢„¨ðÆ6¼±ÅsrÇ㢠Íj€Zꦇ%l=Éç&qNO‰§ŒFo 8èT;~i Áˆ­R¨\RoѰ.6?cžÝgVó À 5á‰Z·á¨‹à¡ i(YØ05ŒØb¯Â‹ÙC{·3ˆaî“ÁjpÄxS˜Qq‚ #Ìœ)”£´X¤¸dü<²UñcÃ/ÒqAÿNV…Õ\ÄŽvµ¡dkfK„ìQmoÁ™Èe±DÝ´AOnLGE÷-Tžßº—Ô-‰* m˜³5çpŽ‚¬†.8 F\£:ˆá[~ G ¹XÏ™þÒ+àãã’֬Ŷ-¦BpBŽQ~`c û2‚N`õÐ:šk¢HúD½R@oM Á1ûUÁ¦O[•¾t "¡–$@¿|ðÂ/P124C-«P¯_)¹±*·R ’'ˆ¬ˆG7,lKo£H:Êx%@0ƒGÌF zúevñ—úð$½¡rˆ…Ê+L¹QœÚÈK©ž}¨ž†´`,;…Ì<‘9H€ÿB jáH-É8ÍD¨—BÃt"žE , 0ëÎ)wÖ&Ž)¥€ç+yòÒVu”b‰pÀà©óŒÜB¨XÃ4¼àÖ2æ A-pE³(ç¬:šB ÚP5Mî[h‹ ™ÀÂá ä9ÎÌZâ 5 ï—Xò‡Öô0œõÕ+hö«¥òÖŠ†t¹¦yš.™˜¡>cs°Nƒ'àÀhˆªÂ*L©á™mÀJïŠÂé+„d’Rùù»ÃPvr·r ‡"Ê/ àÀx!~é÷ƒ~<4f£ÊÔåg'w /¦W‹ck…'nÇÜ€óÇñQAÿ{âåk°ZF`°Yí'iìr16Vubí÷~@9çfág+†Ç\9cE‹'h11 1PŒÁ^f§9ì'@Ó9&—p(·‚OЂ´Y€gyV…‰1¬s'@)Ýp=‘jQ¤udƒJb]KwdtÇ„:d0ÕÈñ€I@Ux‡y–¸ ¿e²pq@5×BòÄU{C€§ô~ÁÂNTs{I Tx‡{–9o/WBÅfþ°:Õ @±;hk™ƒr9Õ†äVbSDQ  ð³£&P ÿÐ6° 'Ôfàf-Û §  Šá@? ^151£3‚ƒú·yÒbÀiQ tæJ j{v sêèp}ƒ#-ƒ,2á$`3RÐŒ(fk÷-dãcµOšÂ$T0/KÐð†3ë(sŸØD@$ð'ÍHe=G÷¸\Öø5AESù§p‘¸)O‰Ä`½xD ©nŦaC@d˜÷xàôÐ €Š÷H =㈙&÷x9VeD½!G¥!РϘ’*i}?@ž)$à1y•Îv§u°§‚Y1Ã6–ÔŽEfžØlÿ_¡ 4væ”tt• ÒX)CxhWnÜØb.’RÐGàñÖ‰_1aÆ pN9 o“áPöØBøu.7}ÏØy÷wÀ—Q€àèFáPjzø6Pꆘ°ãvÖ˜ð3bM*˜pö§\¥tš mÙâlЋ V$§ nÕ` E &œÐ+¯In)#áUE™Y°¯Í&I™Ð)YNxå`10 “ÎøœšÖ™ÁV)›²—W€gð.hél¤æÝµŽþ£·@Ml Hˆ¬Q Î!fvRnf HÐsY4,ÿt˜ 3A4½}˜¥¦êh’a™ÊyD…“ ÀUùF ŽåY\4¡"IŒðµ€…န!êÈ,«1žÅ‰œ@†Ý % —'ª”J1  À·IuèYif‰R7…?`º‰ŽÊv søjº@Ú8é P¨™·Àa  &Pnºá)66£O¸"À÷©Ÿ·Ðl*2 n¨1j‚B@Цjj @ ÀÉ)°à¤ÏhGp§ U aN»ÐH•·àlWÈ j0s…¹i„Ñè9gê÷ØœDež ±ž·ö-ÿM²©_FÑRÁ¥ª o¤ŽíYî —WÙŒgа*­D•œ`s:#òDzz§‚1ŽU*4‡‹È¢›æŠŽ2Çcö ð¬µJm — !—Àœj!sZ©ád!QªiàJ‰oõ”V‘ª£&ƒ~¢À”¥štÆÏÚÇ"¢÷„Ί“͹` rú P$Nà­t°P€'Å,p ¡)jÎVj++f»ù `2™3`¤fà®1ùƒ«ð +ÊK@¢5ÇR0‰)6` 1ëVë&l9+p À,0³,À°qµÿ KœBpé ´l›“ Ф ¯P¬YúAùQ”Q E£:³› Seеˆ+¸‚û·£&jW+¸5ר©më®Î² °¹µ§G« ab•Ð|K‡š ¸»™3{ c›¸¶…Ћ‘ë¸ÁÎz¹îÊøŠ´`0¼Ã›¯P{¢{}P’§;RK³û·+{¶üyµ]jµ1³5¶Œû­kË»k´ `´šK´ pI¼+(IŸ*hë»¶èØlakµ`°3›½5‹¸ø{¶Žt&iº»µÊœÌ  ¯áð±бq+ÿùÚá]Zæ£';$[ ¼)³b‹¸à ‹¿ÌÁWëœð×¶»8*ÈÒGËÁ²p ÂË+š¾ i¢+‰jÁO°‹+¿7ʉ[ ,»DŒ½cûÁ%,³, –ç`Šák4i:·&б·`©µÅ&°¢—šÃØQܰҙ?l€½VÄ%¬½3ËÁ!<¸ ÀW³ P¤ÌI)š"°¹qz pkékÞ—¯rd7 qAR[R #6`l i÷‹¿‚Ûĉ+½[³dÙ×fU„l¾„²•*§@·r¼c,(@´=í’ @4š³$ܵ$ìÿìÀ,a4°¢^á¹Ä»¢H{ÊÀÁ¹µ@ÌÏX›wûrü'h¼±  ëö…š®·»G¹%¼Æ_» édXl FK¼X\¾ÇŒ´Å¼ÎÄ«ÅòeŒšœæÃJ²*¹Íêh™á »Flɯ[ êˆM„ͼ"0¼ò|©H;·€§á¹ ÍÎ | ª<÷Üp¤ÏIp ’:ºŽ z^ëÆo\Ðóœêvë`ð•ÚÀG ·Äk©ÄûÅØŠ´8ÍÎ3ÜHÀ¨ Mu™¡’ sÄ £éû›Ëf »@6 nªKÃ"@´LJÈì<·A­Óÿ7ÝÅ„§AM¼ÐµÙуrI­œP¨œp?A 2"Õ¯KÕ ¶2;˜ ®Å,`ÈàÐrZ©0̤6 ¼¶ ¼ ¼¹_ÜÕ:m&ÐÖ·0'qŽ"swŠá$\‡Q4›¸4K  b·|Lkzd¨Ì6lÈ–Š,Ù:Ö6<¼"k©1qU’õ̰22÷ÜøâL³àØŒ°²ÝË¡ª[Ñ Ð .ð½yʆ̤›;õð8,Ó¾thjVa·D0š.=}iñ{ Ú{)é¡õ1¿R«nÝ\E+ •»k híÛ¤3ܤµ€ÑÿÄÜêío%l*c 270^¦á0¶¬Í”3·Žÿ·Ák©h¹„üÅåk äé²’ÍÐì<§Ðá‡Q,,˜Y­n6ࡤઠ®àÏ Ú6=§ù¬*^¾E ·8ŒüÓçíÀÝ ~P+P†FÁ”×i)PÐ /${ØÑz\«o+Ñäm´3²¹ƒü¶ýž¨C ÞlYnt3ÍÉNš&P^3B/›Ô8¾rÃs[0<¼7üÝÆœ¾_ÂÑVž¶zž èÊ eÞ´ÕÊõaþå)@èbžpG[¼Ç,ÛÞPT©›ëз·ÿ“Né3Æ„ón .s€Á(DnÐÐ`êb½š†¾Ãû¶j½«·æÀÑn¾ëa¬Ã¡·TÃf˜3÷œÀ°S•¾) ¸vÓÃۤ벨¬iéKÞ9íínæŸ U­ÃÖ[âZš*ÈOîé«î"¼YìÀä=ÊØþäò²­îÛ2íY<¼ªÌ …ÃeT° ÜÀãÿ§i0îO `)Ð(5k©Â;ÃqÑrúÇ·Æà·°à3Žï ì±—zsmd™‡×Ë É p¶0ð(»ý«ÉÂkE ç­œðº^Êö®ëýÂMjRá™ÿAïÌ ¸å¶òÇÆ„Îô¶@³Êµó2îäœk©ïâÓŽí­Öi}Ì€M±5oQÜX  ƒ[Þ§\©^ Lßø îFÑvóåkÙŸÛ(_Ñoñ½ÓR³ ®pc!еðMoì·ÐöLoêºìì^´t>·`­õo.à[ïã;í}o µ©§€#’áV&ç@³,機w¿úGßø(_‰ ¶|ëò¼âFû¶›à\,õ×.È7ßî5}Ìêë7¨'£'ü0l@˺lê+/æ°ê¥ŽúL¿Écûô ¦çó&¹1GfSa "¡ÿGÇ@û}Á`à@!Ðf ¿á`BÆ qT ÊCÏI¥¦ øòöèꕎ>LLB0…–²šŽ?²ª ¢>ªL"âÀØ$PH]dX 4 öp¹˜8L¦róô*2ê}M>9ª0L@§”z6§€£z2 ZFßhd((nÚÆ^ã$4f32t öøô÷+*0yðgX.;÷4ø’Æ!@‚Àžah%¶N{À¡‘ æ ’ C2È0J¥›y`dp8ÆÂAŠB)8àÉµÇ ®€)ð(Xf e ‘#Ć Aÿ²… µKX˜p3ÀèÛ.a²3 aJPü1æåŒÀ·!>;Öò€o!Ÿ´ŒMj †L"AÓ¨Eœ•![;fÍÄñ0&2â°™±‡T$‘à¥í ÆŽeàð€Ã°‚&r¸…KX®Ù¹×©åiAŽDpñ k%_½(GÒM “¯bÜ@Rä hPÃì¼riÈÀ"P׸ ü©‹‹}ß<€³ÀÇâ†F€AKp刀iN§Jnªð¦yÀ@€‚wØl¤È*c;(ìŽ\`€ ¸@¼ ±‰/ Ä/¿Î H¤j‘¦@­ÿ a‡äúk̈*(«O#Âኋ7nm uf0eФà‡2Øš‡6Ø€C¤ÿšø@@鯹«²êˆiC3 ðl‡‘ ð$ Š€/,$åšBC Xñ¨Œzá »øF8AšÊšA o³†Óþ6”Lj4àNw$˜´“á†ÒÑî‡‘Ú é© !„ ¥rU$§ò¬p (Aè  +OjT@„p&ÓD©¾¡¨Šþ€q‹ ðD¥hà€¬ë63E‚VæAÀ€8ØÏ€g˜ú5X@Љùÿ˜°ÃZôÝWàeªñEªM–áÀ·±,¤£ ³?&ÜPiAX×ñl$²Î"@A2Ø}%èBàÕâ J 3ïß™i®y<¢„BS+°˜¥~cJ“p¬¨,âma4%ž>ɲb+¬3€Ö ™&F!§nk®™Ø`XkþW°)2ä£ú¤‘j‹0ðÍ×D·Újm0Y`*Êz!™ÏÌ=’X[E+X«~庇`ç0&\x&€¦Ytƒ 0¿€ÌÅì0£yyõFïôÆbh B4A¢È‚ô9ç­ë(œë®Öîïq%h£40`@_FXå•ÿ | `ï ¶ Áv!²1âõoÌEƒ Q~J”HBÓ‰æT@ t®öÌØuü$€êß¿¸šjvP†_²†tï]H Êæ©¥ Q má P‘ •¤\Â5BAG'~.Y ‘Î2\åêj¬ IŠWɦ:ˆ$0á…˜$,@`¸&ºª¸ ¬{Ì&F— Tö‘›Kt޹d€øUè\ MføøJç,I hGCõV ÒÔnó´`³•ŠC‰®4i²þ† Ï …3€„äñÅ$îœÛôÊ’BÃA©5ÃzÔhÿ,h* ºÈ‰µÂ])-Õ8Ë Úqµ‡þÎ îrŽJåŠ%¨c³3 ó®a0áXÔ0²[Òà°ò+Öyµ4@§@B3Ž ØyU6EÅÄß {R'ºï ë"a[˜À®1ŠB2è "0¨ÔOªò­ŸT»…tBƒ°[PÍ”Ú,øŒ‰±•-¤êùÁáj˜)ÃÆN¸ÁL€¼ÃKè×BKf– ÚØçF\TÝí?E«ŠlO ÿ[õ=Rœóø¦HBƒ ¯6uIP¥„é> wçî f°L1àžFƒ´†€&§ü"­Ë° ‹_‚z %4 >A…•¿ 5C«Ô•ȵ à}_0Å ì®4 `éÓÕŽF•mT¢uù}¯tE\Ý=¢" CW$7Tuƒ°2à ¬“N8 €Á‡š l<¹%w¿Æ@Y)ÒëZ£t é@uƒ®h@Gfn›ÞßÑ€¼0hl`$q2¡›h’ñû¢g¢TÉŠ¥ *VÍ N®ìïÐgU­$5µF3z±QäØ¿²yÓc¸9úb\ÖY .ë,ÿÚ€¼ªr‡#éøæùºĤêÑç+ .ðȺ°dødlÀгتS¾™>äÈ& B µH_PÕTÜ4*8 ©~ÎcyΕ¥yÛ§Ñî–-!AÀpÀYYÁœ+ D*@fŠ@(¿g}„j›8ˆM|b ü|Ìfin8È ÓÞÌâuÖAÀ‘ü¢‚›c¨á˜¼b­1 ýGJ;–Áudûî¿ñS ®äü,ä´o¹ª€"ö-çË/ã`Â+Bˆ'Ye‡‰2`ð«"Ñ«|`ØX(N˾DS\ú›µ dYªX “r3é¸ìïðBé¬ëj_6yóöÞ­ÿ¬ó qúÐ’â—TÚ%§ ‰uF⾬‹P7! lU§ÄšBˆ€œwlÐzÄ4Ë:_ÅÂ~46ÃI\å>·œ%ë_@äP˜`ÇÚ+½@€Ÿ£+ðIG-]#«–Êú‰Ò£EË@²dØ–.M­dK€WT7W°cl šñ.ÉÒws0 ³0 ó031s1ó‚;ntp-4.2.6p5/html/pic/driver43_1.gif0000644000175000017500000011364210017034536015707 0ustar peterpeterGIF89aúÃ÷!!#&!%%'#!!%%%/)!)1%-9))/9.))1).3%!99)11!96!?9)=.3?115911@91919I=8)B-.E;=B99`==k9=s9ME;BJ=TN=BW>bV?Ul@.)D9)J/9C-1J91F<:E67RB-FH;JK@R9BJ>AZ7UR=gF=oH:EpJZALLRWGTC]WZ]Vq`_JlABwJQyBKoY^uVcoAspBx^\LfS\hWugWjqnxarhu”€\Œx|`ƒGq…EmŠRjŒcoˆxƒC•†F™žG‹ž^µ J¤’^­Ÿ]À›\ž£[«©F­­N­µJµµJ½µNµ½N½½N§¢X­¥R­ª`µ¢Xµ­Z­µR­½R¥±Z­¹^µµRµµZ½µZµ½Z½½Z…‘ayƒ~˜¢w«¤m¹µgµ½g¨µv¹¿̵PƽNéZÅ­ZνRƽZÊÀ_Ö¹\Ö½ZÇ­gɵaƽcɽo­~Ò¿x½ÆV·Ãe½ÃhÊÆRÎË`×Å\åÉ_ÆÊgÇÊÒÊyäËxWk…sk‡‚€—oƒ”†Ÿš„›«Ÿƒ¬ ž—£˜¥ ¨µŒ§¹ ƒ¢•©º²¦¹¦³¾·³½Å®Å¿ŸÉ³½»È‚½È ÀÓ·ÎÖ„ÕÊ™çÛ†äß ÆÓ¥ÐÔ³áÖ¯èé±­ÂŹÃȽÑÌÐÃÆËÖËÖÑÈÞÖÅÂÌßÖÎÞÞÊÚÖÖÞÞÖÞÞÞÚêÚÅéÖØÜèÅÒáÉÖáØÞçÚÞïÚìðÉëçÖçïÖïïÖçïÞ÷çÖ÷ïÖ÷ïÞç÷Öç÷Þï÷Ú÷÷Ö÷÷ÞÅÛäÖÖëÞÞëêÚæÎäêÖáæÚççÚëñëçâëâæëçëçïëïïëõæãùïéç÷çï÷çï÷ï÷÷çÿ÷ç÷÷ïÿ÷ï÷ÿïÿÿïïçóïïû÷ï÷ÿï÷äñôï÷÷ç÷ûï÷ÿ÷÷÷ÿ÷÷÷ÿ÷ÿÿ÷÷÷ÿÿ÷ÿ÷ÿÿÿÿÿ!ù,úÇ!!#&!%%'#!!%%%/)!)1%-9))/9.))1).3%!99)11!96!?9)=.3?115911@91919I=8)B-.E;=B99`==k9=s9ME;BJ=TN=BW>bV?Ul@.)D9)J/9C-1J91F<:E67RB-FH;JK@R9BJ>AZ7UR=gF=oH:EpJZALLRWGTC]WZ]Vq`_JlABwJQyBKoY^uVcoAspBx^\LfS\hWugWjqnxarhu”€\Œx|`ƒGq…EmŠRjŒcoˆxƒC•†F™žG‹ž^µ J¤’^­Ÿ]À›\ž£[«©F­­N­µJµµJ½µNµ½N½½N§¢X­¥R­ª`µ¢Xµ­Z­µR­½R¥±Z­¹^µµRµµZ½µZµ½Z½½Z…‘ayƒ~˜¢w«¤m¹µgµ½g¨µv¹¿̵PƽNéZÅ­ZνRƽZÊÀ_Ö¹\Ö½ZÇ­gɵaƽcɽo­~Ò¿x½ÆV·Ãe½ÃhÊÆRÎË`×Å\åÉ_ÆÊgÇÊÒÊyäËxWk…sk‡‚€—oƒ”†Ÿš„›«Ÿƒ¬ ž—£˜¥ ¨µŒ§¹ ƒ¢•©º²¦¹¦³¾·³½Å®Å¿ŸÉ³½»È‚½È ÀÓ·ÎÖ„ÕÊ™çÛ†äß ÆÓ¥ÐÔ³áÖ¯èé±­ÂŹÃȽÑÌÐÃÆËÖËÖÑÈÞÖÅÂÌßÖÎÞÞÊÚÖÖÞÞÖÞÞÞÚêÚÅéÖØÜèÅÒáÉÖáØÞçÚÞïÚìðÉëçÖçïÖïïÖçïÞ÷çÖ÷ïÖ÷ïÞç÷Öç÷Þï÷Ú÷÷Ö÷÷ÞÅÛäÖÖëÞÞëêÚæÎäêÖáæÚççÚëñëçâëâæëçëçïëïïëõæãùïéç÷çï÷çï÷ï÷÷çÿ÷ç÷÷ïÿ÷ï÷ÿïÿÿïïçóïïû÷ï÷ÿï÷äñôï÷÷ç÷ûï÷ÿ÷÷÷ÿ÷÷÷ÿ÷ÿÿ÷÷÷ÿÿ÷ÿ÷ÿÿÿÿÿþ륫'Pà;yß4(ïÝ@~!îã§/"D|-B¬8ñâF5VŒ’¤Æ“ûJzŒ8²£Åzó•”‘æÆ”7CêÃI‘§=œøôÝã‡_=|öî%­·´à@æÒ…c653cÉ€Ó5L1®_‰ÅZ5Ö©UªÒªUõ騶pÛÖ™K·Î»Wää•Ã7Jžp'!úÈ¡‡K‡™8¹´Ø “LNïØÑmŸ=‹÷ädzgI}ø\†ÞÌ™èæ¡-ù]y4Q¢E1%htÀt¸Ó™ 'µ\¸rݘu3 ˜WãÄry•+®XªbI?•ö¨·§ÜÆ[·î^¾{¯þD/'Šø(PÊG…Êzöê×»O¿¾ýûø£¡¨¢C(ŠBAñ¤1)¤‘ZŠ?0 OHŠ¥‘¡Næ–û•'ftÐa^þt”×—“:~²#¶Ž¹_¬õur…¡‡Ò×É*uÔŸªŠÒ .t,*.Å|¢ß¢ŠNKíµgæGª®×6zí¢Þ>nµ…ÊQšFL¼©Àœ @€AuB°®ž @`ÁM$Ó 0rü@)¤þñÃÀŸ ŒéÁ\iÀÊqÝA¸(¤€BG-µxB©´L<Å*µÐÑI1µDaiŸS̰۬B‹Å¸ˆ»´¶ÐR 1´C .RÈüÄ*™DÑÉ'™Ð³ƒ’t'tlSL«.ÓÊ*­â²ŠŒÖÑ .ˆ;İÊJD£Z)óc‹k©ÏeZk­ÚhÇ-ÄB  DuçM÷þÞBä0wÝF1…J9±®œˆÇ ¯œ(и41Ë&F@zöˆJ!Å ›\(¡þŠ€°Á¡ ì/Ŭ‚‹K¡M&$ÛB‡CJ86Ó2(¸dò ÄcqÝØÅHÊ6¶ÓhÄÅOm‹-΃B»Ì x"GË+ƒË¸ÈcÎ*Ç€køRÊ1¥ã.à€“ÉÀ?ä Å*<ä`ÿsðЉ &äÀ?EðA:@Àl`< 4P@j€`À8@¬à¨€7Xwu0NÜ 4ø.j=(i 29±kNî!  =UàEÆ& à¯L¬â:þ/ó„ÕèÀ¹ŸI­.[¦~„ ˆ~¦X&À‘R ™HBËVA f€âk¸°…'Š n@o Êš‚«‚wÅ/F¡KðÄ:ä±%„ª|dzÅ*:Æ”5k=CP…ôàH :¨‚sЙ1Ta‹ôD!;)‰‹—9¡:`@6YT Ÿ%(7ÈÉаq%AØÁ P€p00¸À$Ðf ˜ —:È„É!¡J@¦”€ &La LHBlÙA'†zzœœ,`{Y`O5\ärèN¡@E-¤ ,Zx"`Ï{-VQ;)ˆÎ`!þøÁ…‚~¢€{´b':1„b uØ…':AôÈsP(H¦ŠSà‚› B¨@…´Pá ±¨ƒ†¡Œap VÈ,†! Uè᤬àÊÈ@Ó5¤BwhÅX¡<¼BŒˆÅ+ôÀŠ;¸á ’ÀƒÑ VäA› Aœ'Zóª½Ü3{pL$ø >@˜éLgZb —˜Ã%2¡ ¶zâ­žà)F1WR”⮥ÀØ-0¶‹Zð¼à…/®ñ m\ãÛ¸Æ7 Ž]ðQ.È€ €±šˆ Â À` Ô‰›ï‚ Z œ› ‚À¤àCZЂSxþÙ€ !¨Âh¯]…z)Ñq.(€‚†K\2¼TràB¨ð‰&Tá ¬8…Ê@ê2 wÀ.#fЇ;¤Á lhCÒ€7xÁ èeƒØP^ñ®n€ï{×ÛõÖ· p€î‡;°qÐïò{‡8àá xˆÃ"â3p`”sÒ'n± ß"°‚õ0®±ao\ÃàPì7¾‡£òG=Þaw˜ƒÅæØ o‘â߀c*ช2´BŒb䂌aDÑ*J¡ŠR€‚œèD\KÁŒwÐb :ˆ 4A¸[\ :`B'nÑXà]ݤ¡8ït4aþÚþ >1()Ðöbss¡N¦( ø+7®pË`.t Vð‚ô0'd–hê]/”Á dXCí4¬Á äõ‚¦Ó0^L»Óm@¯ð;êPÃ÷ÔñEo}ÓVÇÀ ÆC~Ìàdž¸u­«€8 áùØK1d"ߣ¸'ª÷ÖN´U­…ž‚ y $(a É1„U`æ’¶¼¥ 0 îb€Ä€ºcÙƒ\¸=˜å„󚊔´uZÀž@Øv›X‚¥ÞC¨‚£¹ž˜«ØÉp'æ3D nŸïÒb˜ÃÕð„%. $xü¯i‰…þì€R*XÁ ­€N ö¦áåçuo€á Þ8|½/Ïo~Y­_ÃW ¯p~•àÿØÖ 699@2°†9.Ënð]%"0§R`pÁ \@¸`.ˆÁ Z ƒ[Êí:hA/y9î#(!±<{ ,¡ðšWwe Õ}„pøba?Á;è ||#_þò OÉÍ" £•{V1|QŒÍo~˜À„-|Q Qˆ¢ÜÇ6Ú§ 4Á ‚ˆÐƒ!\¤È}-l‘ûPø^˜°2Qй²Hœ˜ÃŒp…–£¤zøî^Îé »^øù¨uþÎ<è݇ox}ŽêøÕ6Ÿ5ÞÀà"(àé¸D=.±Á |ò]›œSø='È Gp H –  —p{–P ŠA Šá 8 7 L0 ¸+ ɦÐLÀš ¥µÐ.`n­ÔJè6v·À K0n;+tûÀ ;yø6'z¢ €9 •sñP÷Pù0„õÀ • ˜0Ö •P ô°õ`I00°\— <0K0] :03Pp`q´K° ü3Ì€ T0 ° ]Ñ ßåip kDGs æ‡i°T¬`‡% ³@‡þ©_ï¥sn~ 6k Æ~BÇqP4$'¥° :ÐAG°‰f''ùŠú·µÐWœ  »@ µP š€:€£À= yµtE žž  3°ÅwKG°q£€µ0J0B1À%Ø=1PB-P à0ä60hsÀ ¹èx€Üôò’ƒwr³ sðr@EX„ –` ¤àò` —À Q¸ò0?þˆT‚D EC0H@J0†@°$Ð œpPP`rU°«° d ¬0h©À/‡iÐ ²ÀRà {(_b0^È ,• x@þ z k€’P‡©0jÿ…^B7`È` 戇РC°œ„ Û@.p ×€ 4p€Äoû§ÐJ£ €“‹¥à à HÀ¸–š°‹žÐ•;  ¥€ jÅ.Ð Ôˆ:0P¼èJÐVêÖrE‚šà ¸@‚#„¥ÐSà‹g;/öâ·ð õ½Ð °.#' Éyä öÐŽõÀ »p ¢î ´à 1„ûh?p…e@Màg—F%`cˆv+Ðbv=p` Ég–Æ_°i/ ²à ‡ð Ê ³€k ^jþÀ%~#ÅÓˆi ³ ú¥^§6s vk¨_l ªÐ{"'µp 3 ˜Žg ¹€ :pJÙ”Êo# ðI  K2Y$(—ä¦_¦K%XpKê&n%T'„n'¸·` Õ ûJPB0 ÓHnˆ©>p'¢e/;p¡¹ /ÜdZ±Ð srÀ ûP–Ñ£õЄ׀ Õ0¤Ö…ò@ò°œs…V@i~æ\p±DPgøg¸YªVpi7§œšö¥šæ¡– „ ‚`%¥ à å•Aulpkà ¸^Ô·¯ rðÅs ö 6kþ©Æ^p|ô`óY ß01Ð¥@)VO·ûW†–*•ù÷täV2À:ð©HàL0L€ ³ˆ2p $¸Âg ¥jB$t‚Ÿ´:àà¶@uéæ î—P¤Á ‹ƒ™L'Qƒ°eÖ ÉЖ² *c =¦3¶€ 8P /ƒóD ‡$HÒc!p…X`]°]@\ JÀY:€ðŠïò~'dz f }Rš®èzi^`Wp®à ›°H± Ñj¯ xP§©€ ¯ÀãG^ÓÇxp°®–žA™_>ÉWD@IJ›4 Ü ¹'øg©–jþeè²ü –ªA.И‹—0 š` X š–¥€ ¡ —¾0 µ@ cx‚ àA]W']§¡&Ôšð«(š˜QN/Ü/J8üÐ_P­ ‡0M47° &°!ж7 6`g@O6à?0\dÀf`r ˜à 4 ¸J §G€½„ 0v‘kfkÀWÀQ\S¯ºÕ9 :%§Çp°­ÀR°Àß'k ¹Œðix0 Jˆ=wt6w~W*C ²€© à í@à €wŸD²ŠT³ ',[³:à‹¤€yþe œÀ ¤°V³ž°L ÅÇ´4C—¸I 4'@M¢…š°³ä×hû šà=àFà 'a¥|N`>€â`—"0M?ù40œ30!E"ð´S· `V€_C ³½^™ —à{¤ Õ‹V™0˜0œP ¦@ldÁÃp ª0 ‚9@sp„ð å © ©ˆ°°º’Tl ÌÀ Ò 99žÊаlr{¸^n€²Æ_KDpPt À6+›j÷.fçðv ªè›eèÅs ÐLjÅ sÀ ‚«P¦A5Lþдè{‰‡ã.dwwÕ$™pKˆ‰¬aúƒQú`å >pÀ30O¤OðÓN´õCI—\:K0€Š<H€0/@H0€©dK ΦdI&‘sðLSð ¦@t€D` rP º °€‡iðÌ,9}©ª à y0Å´kE,rŒ ^TìÃŒÐ_ðµPpPD0#[Cr"¼H Gà ·w¢P ¢  vu ŧŠ©lÌoæJu%äp’¼sb%d‚ŸT'§´Ð|â¾¢àP ú`Ô('Ýû™@n`µôVÒÏàþŠ")‹b%C°pr8K`2(`gOd€zqRdP¹}›u\ YpYÀQÊ"0?$I  þ¥ /püc†F-VªYC=ÔðÝ$Pž$@€Ý$`(ÐEåp r Ä€ V“ =µ/7»Þu}z ºÑrlå Î ÃÍå€Ö÷P ÃP°€^—+.Y,\,•ñWH —FV‚žp€ž`½žÐÅl¬KÉ.e) xžÐ¨è N0´ˆ¼‰Ý[ $p{$P¾½C¤vÄ'` õà  ó{Û·Ý Î  E4E¹l`vPM€ÜV Ûg\ 0O$@ tÛ¶PÐ ¶Ð #À P05ð.I{ßýÝ`Ÿ° ¹`þ'qEÀU°^Þç}‹ ^! ´ËiŠ®ç  ÄÀ z°SlyÌÐrz ×ÃPÃÐéùiW@YŒ]˜4$n‚éËI4ä×mÜy… wI À … Û‹ Ý€; ¾x ÄwLp ¸0«´4  µ0¾ô.ã†8Kk ïà ÷iµÍä· Ë vpw`”k\ð ±Ð F`ÜÏU'ÅOpKÔ°—ÕVÐ9€hŽcP ‰ðŠÖ90y`Žæ’Æ ^˜F}ñˆã5^H»˜&’ã™àx ±žw@©`nm hmþz åP‡—Žs¡Ž9DÐ…Ì[•ñgL'óºI1³5  0¼ ­ì4`´4 WLÀ JЗ° M¤· Õ¨ 2@a¸à : µ°‰ˆ3'°¸`Ï AUÅÕnKÐ^«í'Q ²  ›Ð]á~RF` °|NP\`ï\°v0OäD±Ù¶V€ãED`ÀlÎæÄÉPuð¼pÀE@}"¹ùŠn^æ%žÿi⬠ŸßÊð‘© ‘¾àÉG¬rx ÈPãŒiêŒ?MCÌÛF^óÐ3 Í+Ð]C –îþp—Ü@¼` F«ÏšÐõP +)p 5n—ð ¢þ¢0 L_ ¾ 2@ö÷§Ï¥àÏÈ“LàžðÙ”Ìö É 1çŽ;qÒɉ“S¦¸\áÂ…Œ™ ?Dü¨øãˆ&¬tiS¦ *VªP!R„$É\8¨C.Ppñâ%•®X²ˆÁr“¦—4EƒÂi“T©<ù š†)6l¨zYÃÆŒVe±òàуÏT°ôÜ‘$éΕ!D† ‚)Áܘ¸cBAF-^H0¸ÀÐ`.º4h àR._3,áÒ1£®]¢˜àª¥ã¨31pþ¢5e' 8Maâ Ô¥9ž<]"1³Bâ œJiòTÊ“%™1¼ã 8?}üŒGž\9òdÉte!hÆŒ#¦qº6jª,\ªDÄ3ÄbAB„°âC•.^FRñ‚ÆŠ.yÈÈB¢.à êb €戢Œabq%‘O’¹Cª4rò¢ ¡r° 8Òh%6Ü0«5Ò`è4Ð`cV”ŪaN‰dz‚å@VäpË­!¦ì0¨Ç ˜x§žP4)E æ:€°Á Ì…f¨À*˜€&t¨À˜(ˆ‰Ê˜ª°Ê VÀ`4*¹s¶ºh’ &tà¡êRþàwH‰ ƒo–ã³Ï㌠æ9‚¸°c:YN)%\êÑÅŽîÌX# 2¼@°ÁöÈ Š­ â“atÑ£„ (@ ‚V¨à°,ÿ"a ˆ€ÅH 1‚U`‘%¡ÚøBB“:ê•Xð(ÊÁ5‚ú0eSQFªØ¦ÚX†+UØÈÊ·àêk‚#ò¹¤‚@©¥‡˜rL€0rãÕј“N*uàR üE,¦²|•1ðÌ`“í݆1—N Žh‡„+ÎO‘ë&Tš0ãéîh¥!\Ò馹S"’ˆ¢0ªôô@ð€=’rÕŠXb1&fþ8à€ 8˜ & 0à0ê B•M(¡dcŒaæ§_%¤ؤ„‘W<‚ QÄïp1•ªÌhJ•hbL¥Å[¹Â-Pè%SEÝ0Õd’Þx 7à0p …\h@†ôB‰ø="ËÇ©<&h`¢‡#Üœ‰6/Q‚‰KB¹Ä…Kz<±,ý·Ë#¾¡E„¿¹gcÛùéF–[Œ c¬Bi%ƒL8Ù¡ŽVò°ã 2¸`㉀ÀȼÒû€Š“p.Š4ôعÔ%(pÀ`’!œ0:6qe]ÌÙy˜T JŒ­‹)aÙ`eX¹Ð¦¤â@ÒºƒXþðÀ =H"©+ð‹WèÁ[5B&@.(ᡨRb#¯Á,éo* Dq‰RÜ‚–ðE-.Á \”B¥`Â.fQìÆ¼(…/BÑQð»@/.‹QØâN …-b€‹$T ³‰ Àü´Ã9ø‹7ng»pèâ³" rp‚4f€LpAK0ǘ` À£ðˆG@DøHr/À±(*°š LKHsÁ€z:h „øD9ä‹V°ABJ±°î7”ª°B:$1” UŒÊZT± â @6À qûÖ.ˆðòðÄhFþ Ük^'BOÔâ–`‚&ª1ŠP0A†:°†%®±‹k\⿨Åkl!Ûpã×6œÉ$è@‰¥ÈE-h° &¬`\þú—êü¥xÃ:pA¶a|Œ±Oá'6€phÐzˆ` @Ѐ$ — ÁGÞc…yn#BLR5¾¡MÉJèA8€"ÄÂ ÄØY‹ÚÀ!®Ù¯(¡ÊÖØ‹k!CȨÖd‘TùÁ’)pÀTáp8¸ D€ Ý2€U`îðD 4q jj‚GЄ\s˜pB)`Â5¶q OŒÂ¤H×(ðêþ MøB¿(E-j! sñÕžP"8ލÖbµ@'jA Mh£HøW—ö™Eua<ÀÀ®QPƒTšÈ€ `Ãp´µ¯ERF;ÚˆÆK'èBNÒ}È k0UÐ0Ð ¬À¯âb0‡LátÆ8.¤UÕ ëWÖåPRì÷I¨Â–køx§µ![Âaœ%SÜp…'`•9Ø*“ÓEOD€žÐ-J1 L”¢ Kœ X²ŠŽ zõ„›§KÌ øÕÁðüRdŽyñ”€¸ JˆA 47”x& 8šêT÷¯ü2FiýŽþ`lh@C;*Ñ iÇAûqF9z @·Pà-„x›"ø‹K+ Ÿ"W0;! U¨Ã*J1Œ[(#ŸTŠO“¬0ƒRDä]Qœ"°µ¼cKØp¨\ð-CØjŽýpˆBš¸\tÀN&ÌA¶ELçĬ ‹ø”Óàb.A`J ‹ tE„ Ó™m¿Ð:ô¢<¸€ €‘1+§Œ¦˜ÄvœQ!wÔ£HâhÐr ä¹Á $qVN’,*tÀ$ÈÈT“ô`F°ò=0Bj¸–¤XW)¶ƒb¡4\È“G!¯j©î:þ¨Â¹Å´rÕ¶¼%ÿâ*^à ?û'Ÿ"DÌ’D¨¦Ùëß™î¦×äÒÁyæ]-x¤K²ÔþdšN+†@ nQÔ¤murÒ¡‹QLÇ=€RÎϸ.ˆA•Zì@7Ìaˆ ÛO´w Cn»†/x¡èÒ b3>¦_ÌŸ0ÂÐÑ ooM)j™­N,©\¨ªjˆŠÔP”uo¨*s(…=øaŽpøÁj[~ ÿÌE]× E>Ç5j%‹hÅ©4“8æ48Âô¢ø#è@Ž·„%t°ÐÅàTÆntÍn~¥˜Âœô>›}bþ ¼(F0ƒ‡\9éˆ*v¤st ¹ a.p?XxÃ÷¾/…æR„_ïjW"YC¾ð "pB;ÒVP'])v(ƒ„Ô¦s&P.0©øªp‘)pSÄ%@‚e‚UˆXéY¾«€ÀKhhh^  ´YQ.¡Þ HÀ{Q숣€á„š{œÃy¼Çk§³5ÅkAÓŒ Û#ð=ýZ&˜#ðHŒR°R_”SFwE¹ŽZ‚mè{½Wpà†kÅ'4UXƒaÐ RX`˜:ÈýÆ"8€¦û µ #H¾’z¢Èc0‚4êHay¢ ƒWêséŸX…(MuÙ½µ5bì((óí¶Q›ïøŽïtfTir·ŽŒ˜0£„Îdàãaä((LjB’Ú:Àa-ÎlhhPhϣ݀Å]‰…Sè 3¼t&mêPm¢"*ðÊ;8Ïë¼þràÔs¥oóU™Ï/wël€x€¨z%¡p?öhó8ö°{so÷Ž dû Wô—”sô”ƒ{ðwrxÙŠ—ñä‚OQØ[0²ÄŠ™\šq—%ø„*( SÀ.XƒUÐ(,x„DÐ…-€„A8”þ4Ë$ð„,™¾Y6åêPh‚ˆ…‹·H‚B«î9€…nXV¸‚"‚'@Hùê>{µ…úU1(ãBâVAþS9•4O’ z€þèH€åW~˜`Õþ€‰5‘c ðÉÙð·N³€S@ô£†f`ûðw¹_ÿ~w{º÷w¸²€±½Æô_q.Àä Ø38è˜QP‡$Œ,i‚&X©ôxYC+‡X%Ò•å‘ X°Ð¬)ÑcŠ H.1¡€á¥ «æô B„N&:C–dª1Å)\±r1£Æ •!O† é©/*8h`µ‚håþšÀ€Öb¹nm06«Ø®c¤Àá¶R%L¢*¹}€À,‚¬XÅšM  ÿ*¨P¸b 0Tà`¡Ç©}ü&S®lùòå`Í|¸ °bÅŒŸE» :th \|nqº‚œ:¡BÑ¢•-/»xAqÇjƒ.,ØÉG/hðèÉ£ÇÊšU.*”È©'*™Š•† V1 Á4%†˜Œcè% SL—ôˆRG1U©$½b„ç LB&JXÉ•(  *Á5ÔàPq°Â…¬€P€"6b ´õ¢`—[8°à $ÄšŒ2êðþ9ð =ðƒAöäYÈ!Gd˜)¹$e°˜Ál%ÀVyPÀVU:× ,xÆÂg€IÂuXRI5¡C‘n¼YqÁ 0ÃŽ$è`'B$ô`„E¤K,zè² tƒ$J@rJ,lA´Pž-„S ¨t2\Ì1êQPqfŠs¬¤¢‹*St²ÄBä`ÐŽ>êøA $@È£®BÙƒ°ÅK¬IÔš„²I0¡„˜-¢ˆ]t]"J(S\2&™L1ÅIH±ÄIL!Å·àNaºè.›‡p±(LÚ‹™,ÉÄ ¿ýP@¿÷{€þHàP CˆD\¨RŠÅ”¢Ì)»¥áÅ›3l5C ¡—çpŸPáÆ°À¢ ¡ª qÁ V"È-F8‹.Ñ()°6…%<„r kƒŠ$¥¢Jyp±4k8‡’LÒŠ1Êt"kS9èIß&A®¹a“ûíØé’}.¹i«»º´(Á ÒÊÝ"&¡â‰'9åMn»äÎqÉY ‚H"›xÂIu8'I¼WDŠ=÷J>Ù0ã!0•T å¿t.×@ ãÀƒI¬,™£ ,wxÑo“@Pr#ŒvÎð·er!4Çb‡*ha§`†*' Ê À‡>nh¯d¡ %°¬ ƒx*N0ˆéé‚ n(‚:1`¢ J˜Â!1€Šb4 ±Æ+e 3¬ rÈ2 ZˆB—ÔÄ.0±‹ZˆÂ ´E-jÑS\࢔O}šZóšcôo YhBLq \¨Â þy`ÃMC!ÚJlˆ ð X$-_¤¢}ícà l6˜AÅX‚v  –äBÝ!bCDÂQ˜Ã=üúWuøÀsS:@:1÷¯ÑK]ú ˜@C„5è¦ UÈ‚ÚPÚuá]œÁ% „&T‚ g…:a„á ”(„.Ò![Ú¡ /«ãn‘Ç4@t˜Î ¸å=“N§ªèR‘Jda ðÃÖ@„Aê@>„\ ˜‡ <Å%.i‹]°·9y`&üá;¤ v( ƒKxâ (….Ì\zôÀ-ÌA`_ôl+0’k ¦ `Ïîp&g¢¨¸% )YþÐB'ØA" Â3ƒ'T)¨—*tx‚ ¤&`Ã-¬Â#WDŽ„‚8Á(øÀyU‚wqÐ%ÑÂ8 (èG°¼"®sꟗÆA®Â³eçv:A€µ€ô œb èB0 ØÖ TtÖµ°|Aí´4|ñ뮥BèÀ&,*înüðþíAÁ0–=,Ü#0VRU”e Na_õ©ŠHŒ‚©y,ÒöÚIÇf\ÂÖ”1‚Ì(x‚dAh) AÊ#åþZB.Œ'ÜB) C,ÁpÂ4#qAyÈ€‚ð@Ýä/ÖAÌA?Ú¼Á&Šéàæä—ÞäþEÂ@A’ )0 '€äòËWèݵa[CÈO.ø€Ëìt ƒÁãñé-ëAp(D!%D¬Ö¿¥ÁºuÓxB”@Á$˜^Äæè‰U@ň„*ødæAõ¡_…åÁ„k D `&„Œ”È%PþÀlç¶ÌÁÝôaî)`B×ÂDX©.Ä1CªÆB+Ì ƒ.|³AÁ Á(\  a(Té0,ƒ$`²â*î¼jé¼2g½Â *ÐI'Ã((-N‰µa›µ•1lB,€ŸíãÕ²èê†-÷0o¸‰0€ Àp¨d̈ä€èFØòRÄ $&d@øå`PH`‚U °bÐÀ X‚&tX§ÁçêHtB&Ül8€D@a†Ä·L@`‚çlìb¬Â( A'ÜBV‘‚%ìÂ5Ô]’]1é,œ‚,DJIJ‚H|B¸ ±('þ„ÂI A D È]éOjôF6–*ÂF×+ ˆv€B'%0*„òˆræ´vÀp4ÁB'`€ýÁVöiÄ*cäu"Æll!ÒZÊÀ d€Ôð0nç'¤Y d Á%àl”B*¬Á>Ñ’`Â’…F§Õ‚-t I˜÷ '¼Œ¤À(ÜÂ(¸€%Ü/h‚ž‡ÂdB.ÖÍd×A00äB. [^׆øº 1µ¬H´A¬+¤$á$2A-ÜÂÂð€ ðÀAÿÅÁˆk"‰Óëþ)g Ì+u }‚>8.Œ*¨¶›‚0þ¿t1|‚]r€éíÁ `2‚í°`yÁ›ìŽ}¤JîgŒpBØŽl÷ì*lX'èÂàÌÛÖnœÀ ˜'(¼û»ß,´YžéÆ@$I•´À&y0-xP€'¼õü qËÔÁ0 i#¥BB `B5B,¸ü5,›Ì¼¦‡]þ¹A ¤úXÒp Áðdô'‚éO^²f_2 4®×8¡©1Ã-”òäòKŒ¯7º€ ³ èòF³gQgå€ Ð€U€јô€&PÁf± žþ ª€Øç¶AÀAEpÁ)\)¨Â&¨Â-,¹}.àóXÓüîAÇ:ΧøM".s‚#ÐP˜vvÆè¯Œ»iÓB'`Bäì `-ï4n íä;ÔÂÖ‡ @J âé)0AѰàf™wô˜ROݧü?Ę4åG|Â0(ME”y›7@xáÒe9G.]:Bâˆ%&$\0±ÔÃEÃ8L¡Uþ °dÃ’¥ÒCŒX,<Œê¸˜bäÍ7pÚ¼q#óM›qÞ´± ÇКB~H!A€ )bèæ@qžÞ|:"ªVe ¤(P 3QæìÃÇlY³gÑší6 •à68W@º¬Õɉƒ Tö ãÅ ˜Â]{ù⥋aÂ]¬XAâ ’5VdÞ°‚–FåÒÒ&bÅmsç ê4iH{!ºM6³òÄ‚ë1U^Ö÷â&¸b.kÖpY¢Í×”MPÕ¹cÊ(=@MqA¢„UÅJeêô)›SÃ`ÉÂs§Î¥Q·jÊÔ©œqtÞÔi&Èþ£Až8 )¤~(ªš Jp*¨I0¨¨ ¤ª§ºZ# 9ôÙ'­ 9äg­^ H`.D„+îÊë“N.a€ÀÁ¢°Äs Äë±.r(…†),AB †T‚‰Pæ0b•&Ê@ Ãh£ 1j£4ØZ«MKÒðXTòÐC6₌×JΊ4ÖHƒ 1ÝÀ#Iî8‰‘+²ƒ 3ʰâÍ9¦¸¤ |X IbQe=Þh¢”`>¹#Œ8ÆÀi ûlã7ÄÀï¾4†*ˆÿ$ꇈȪ¦|Ê*µÊŠÁ¬´ŠÄŒ'äȧÃ]ÏêF—\"(®F¬‹.TþQ¥“L8È ˆÀ°XÌ1 slGƣˆPXBŠ%¼]Â)ôô ÒªmãIu¿RJu«ÔR 7¶,­¸àÜÜd#® Íàðe#N7Ü€©;¨¸‚Š*â€i 6ä`“)¦@¢“NæÈD`¹#=81‘›H¶ Áü^Ò 7Fý À!ž•@"\µd›¼ŠÖFâª@܈ˆ{x-šŸpt†b`ú.d÷Êd»gC̱Å+ìFþè"MÃÌ› +Ê€Œ 2ð£ÝÂP £5ÙÜÕ’°-k;—à4½xÍ %Éň6ÜЛͼٰà6ìs£ +¨°Â üÒ»:þ¦`ÐK¦E•\ô@æ6dItm #&Js2y§ûÞ Â¿ÿ^. (ú¸©æ|©$ÜÊw ¡0£y5'l&xë®»ì‚ËPNY¨ÆbÚj ³úɹ® <à¸[|zßV×0ÓÃØãôýÄ= ¤Bö0DCðO¤•ý)¡ä Ù·Š\t¢ 0A“½v…"@¡T BŠÀ…ÆÉÇ€\Ð'21L°ˆ ÀÅnX‡7¤"=©ˆÃ¹p2)œÌ«RùÉ Þð—å(OÊ©rðŸ1g"™}rfE¢+€ˆÄ …poWõ†0&à4»À.Íþ(”• P ƒŒ¶7˜í=ikclŒéÀ@¥õ©Ë \Ã^ª……@¸‚€%\‘GJ¼‚ýsÿØ q$cøŸ  Á,”!#NiôЊ<œbv8EèÀ"”!eøzà‰K0¡£ *ä©™¼QûëáSP†¸‚î5[ lðƒ\îò&ð% ^ä@˜( ·rP‚Œ€;$ ‚vÖ•®p%†ÃºÁÄ¥cÀ¢ 0cM‘.žPÅ'<1ƒ ¡ƒØƒiœD-­{dT›»ì ÓqOk_¨aˆB¢š…ðƒæ×?¼ }èÃþÎ`-há XÈ‚Š 0/Ø$ p8àÐsŠVȱˆ…Ìp4 qµ¡t [Œ‚µàE=j!›¸ÁŒh˜†IpK™%( FФ^€L½@0U ¬.ÀÀU]Õªf"1ðê\ˆUpÁ8@…øeňDï"‡(,!ÒfZê ]H@œÃJ€‰Pt—N¬¢é$A°ðˆ=´ 6šg>¹÷$4†AŸZ3Ÿ=çé…V³‘áìgAûY*4á «i1J/Zú+ eȃ, ‘WÌbÃp ~.…8OéÄ %@Â.äáŽ|€ƒsÐ…þ&U“TèB#P€*`-ºÀ¬àÀY·#V±Ê`ÙA º›Õ°v¼1p Л^½G`Ât Ý"Hè)Ž ¢4Á*D!wÝP^•–€¾ëV ¬[ØXàapgmh´.{^¶ž”…lºÔF­4°M€`iöaM–¶Fø° ØSl"cŒÐƽ±!ªÐ‚!! BÄ=3©MGÇà†1ŽsAp€ Q„¢2à2$ÁCCð˜е*yÏ›^-Ë ½îu¯%,‘„h‚Ìœà„'81 3fE)J PxÍ£PÂtp­8Žhk$úþlÍ'ä®þ5 >b!Œ$@Do9À_ÇI:Ä¢°àÀ Ú¹1fkp“°§ÝEYuYx]¦)Li¬ Pä‚' Zœ 'X ’z‚"ôÀ$(T.j1 `è±`ˆ‡btâÛ:N¡ eèa6€;ô U .˜A%ÐÝSÄ‚«¢>]XBkVó»ÛLŠ3әΙÐ0ç„ÊMA K@¿u È à:  4q‰ W2ÈœF g á—šÖ„Â*ôah´ÀBi ÀæB¬ºT.˜a=¡—Á‰cd«eÙvádlM»º€þ5äÀ€¯*@#T€è˜@‚gà„8{iàÞÈ[Â4pB&ÐË LÄ`µø Þˆ­â¾¢âˆ€qZÉ8‚ˆˆEÃåÀp™¥A1œ ±ïtÒËÓ˜zVËÂZÛ^l"[*Á*(…% Ê„]ÈÀªž°„ JpOÈ ;¸„&À KìµHÔnL*c{ ¤1ðÄdàþOˆC€Ô¦¥Ĥ‡T £R :,tà¬LJ!ôl¨ Z ˜`¸ ,ád`Ž ò$b'P!ØÍúÒÌ d`FADF¡Ò¬<¡tà¶ÏÉ.!àj¡òì Á´‚+z¦+® Ja,V¯,LŽÀD$<î”ç.` b¡<Á, °€ü  Ê æbŽm CZŒŸž¤4šÀÄhÄ È€ pÁÌÒ F¡JánAc!ØrCÃîpt!^ãaØ`ëf Œ¾/¼!48¨Mµô`x <."èš®»t@R!þÁfAJ ¾Oê8áùB4¤îPA|á´alaŸ X  ján¡ÞK--AN|QFQz $¡gv¿õTAW‚,bAv@ö”ð<Ί` Pnx ¬€ôÀ à odæÆüp1¬€˜á>¬¨6¡êÀÈÃþ1òÀí ®À²À¸€ ê@OØØ`"Û9€Ã^¬à °HÎ8Ò.æ ª€ ‚à `!2áýrÀ‚Nîj »z ±F’¡*`ðpaœ@p4,áháûláþ0ÎDÎ4¡:HAÚ 4Áh!.FiYv€ žR.¡@°ûÈÍÚJš„‡2®ùašaDŽÀ`(à¯Þ" (m(§ ŠÀ Zõ øä©kºPžêÉÔC>Á†AŠ ˜P`¨*“[4)AŒ NàH 8 L@¨ˆ*™L LÀ ò8H€©² ËH`®‹8  ÜÀ Ta¦`brÀV€€t@6@ô š‘`R¦ªF ä+¡°)¥,sb ßd tÀß¶“á ®á´¬Ë™à<%☠b ZAþôD¯gˆˆˆ¸€>¡-«ñâ8é²iD¤V`ºË  x Ïtí;L¢l2k gdæ"tF¬`@bS  @:Ô* *  i}Þ@S Rj¢ªjZ ¼Ä«»®k‹ˆà\ÚÀ 8 ª®K÷f àhP6—  ä ˜€Ž$((€0A ÎXAg ä åˆÎú.ð+Ðñ ¯½ÐÌ,Á ƬÌÚ-ÍÞMÛŒÎ8aÎ0H2¨¦`t@¤â€ˆ!OqЭ¸ :ÁÜ’Tá†N.”0èÔ3d³T¡°8Œ ~%îÀj¼þ`0¬'So0(+ `€ß8@g’ Açàî ° ®à B‰nÒE°ÍÞ Íèm:ß*ç<—€ ’ zÀ^}ÕW n_µ,¾D©d@¤žâdAfAºÂ¸`ê ‚aô²i-8•À3‚nN®r 4†:2'2J6“„‰  `e¡€˜„ H`f€þ€xÀfy`ˆN%?À—<àþ@à‚4`Z) é0Ájàf• *A ÂK@7€6à* «8@÷è” ®ºKZ9€0¢h "f€;s Ó$! ¢@¨z@Ìu.!òu8¹‹»Àë5ÿ¼4ð Žà.àw½Ö Ø á2N9áîTA†¡ª)¸ æ€hÜò™€WT8½m V@˜ Âlp/oƒÑ7X!Ð ŽV6@4Àv×|wws7w?àv7 *à(`¯%ô2x U“t–`|—h=†ö/@ÿ­^oößh¶»V€èuZ+À\àX½VþJ@L à âG7`~kà”À˜€f{` ,)¤!„P†€@áè*ÀéT<{”»Îñ¸l&½ÈôvÀúöHpLÏS ²ŽàÌhÊRnê nrï”Z aßêV>×-õ!ÎA’`†“` f¸„ ä,Y’%’c†à ôÀ N¨v…öz¯|W‰‘{“‰‡7 ”à6tCA”à&³xI1@,±W‰xh72Ã2ãŒ[€2£ÌØŒ™` 6€€ï¦*}±~™õ5O²`’ 0„ J!ta†^aÒ e x hª,þ!å N˜€8aKK¡¦yÁj!Ìz pa½ÈÌ”@ÔhႸaDA‚¦t ’Ùs`ˆÖ`%Dï+†&Pc˜ %çw.x T!N7NAÈ  úä \x|‰Cà‹»ù‰¿˜‰ƒ6ŽŸ–Š{”J÷" Žg3vjÀl{ã¹>`P·V@ À h@jg é‚nªÞxlÿ¯ k·Ã}t·¶¦ ®V™? U?àE&J¡`vŽ< ˆŽ ,¹áJ!Žà¤Õl-¡*Dá.Á @hÁqwáHjáþáËl!ÌLHÁÛPuYP¾õ AœšpЄÙaÝ2¨á„@xÀ¸úx¤€òàˆ|CTVeY6’¸›CÀ­CÀÞæš®¿ØöB BA  .g/i6 ) Va«CàBÀnè@ 0ÁŒg€ ” ^yÀIó™U½-i/¡xåØ,M¼´ÖŽg“2¡ˆöªõjzZÁ&AÜ€ P 9DZèHnpa^Q&£ÈÝ.!ÌjA'™@!x!e€ d1à˜À@!‘àH¡Ý:y½’Ú d˜#Aö§ þh„fxÜrÐA†³ún@€ ¾ç;ž»5«©7hõ»­í:Dà­û¿çú­çš«;¡†÷º¯Ë¸U3@³5k+`ÛBàºÙpVcAÛÛ”^”ªÊ#( è6 g§êº¶v´U%²ÃL žƒ¶l 2!$a\"!h*3Bi·Sºàd€Î49ÂÊ h Pá'QÐ(—²€ß/¾d`¬²à¦àö—¸»W h0¼!abÁ`Ùî ”ˆ˜ŸáÀ‡æ¾çü Ü#“ ‰ù{Ýú¿o@À›ÀéÚ­±7 <¡é*ŠÏDçD‰.èˆþ®jA¸z±A¯)ðò7[õÑÕØUA4‹/¨]Õ¨¸úZCûº¯À (}—¸š«…`†…@2z©Xq›ç”€èv  <ößÀ«¼ÜhÖYq–» ÎY½ ¼®G•à„sq—ËV vÀ†Á!Ztãîô æ*¦ä[Î)ÜÎ{Þa¼™ÏùœÂéZ±ù=ÐýÀE€®1] ˆÕ ,ብÕ &œÂã+w“Pá žÑ@-`:a¦u.#à&À&àT`CUTàà§ ¤€±¾iÝÖy þî Œ`ç€|¯[UhÁ·á—ñ¼m¼¢ÝÛ®¼oÚe@8N<Å“©žËØ‹ nÁ^} `$’!J®†€0cá8áŠfÞÂ)ü­ æ, â™ÐçZ± À \ï=î¿Yl˜¦€T‚ET  ?à` VÒ{Ö¹ÚuàÞKŽ€uw šûTÀû4Aû( Ž F¡.óyŽ@FáF¡àÒ¹:(‚‚ÖkÒ‰à`Ata/.’3¡0 Ä¾tŸÞo/½º =3Ð ØÌ<áLÝ ÎØŒ¦ÚlÎ8Áþ”`|@`‚¡ôÇs"ÁØ\Ö:(Šâ@€t×®…`¦@ÎâF!BÜ h0ˆ‚ :|¸P!ˆ‰}üZ»~ ;¶ëXÏ8!"¤kƒþhXD :@>øµàB6 6—¨\"E‹’¬`Š„¦LJ(ð˜‚i†ƒ)Jt y‰æ‡ V8¨Áã…5(4ÐÁIIt¬`ÏA 8 y ¸)8‰'˜0ðs?hÅAQÜ <(1Ç)Ä´â "kåÐC&L¬Ð@ ž0‘ÄSOIVà 2ê0ƒ 2Æ`#Ž6ÎC3H¦ƒ :ĤGHè@Ù-˜\ÂK;d¦ÃÁHòÙ*M$ÒÊ,“‰CärlbŽÉ.éô²Ê- aoô¶ÐA „œCÉ=ÂKÎE·sÄôA 0^&+ð7Å 1þ:00Es|`‚ ˜‚ 9TÚA¸@à T@ VÀ‚ ` s”p %\à@%–X‚Á –\²C —h2ŠUdAÅ?Üp¬…Bq¬µ€b 1Ÿ¸’ˆžôÀ–l ¶í  6º@® 1ÔX.Ž’¹@¹âú(Ù: ä¸ q„&¥|s‰%¾9Ê;ô  •±3!­ ÃJ ‡\E)øIñk·¤“N8ÝÔ2Dp@,$Bu>dƒÍ=.¿LD1E6ßLÄYA­ÊP H(Ñ‚:\ŒX`QF}„FX„qF–€´þ3)·8A¥ 2GšØb €„Kðr-M8‹1›lòM<ÞèH€{,W?\Ø• ™p¢J&sP‚(´ôÃ%˜¬Ð-'šYã»äràæ—» C¹ôÎ@Bô†¤d¨(qÄ5£ð"Š&×tÄÉ%Q|H, ô…º4ħìSqð¹`ÌL:Ï\òÃ(@BA?$dÐ"›Pʵ V„Æaðñý܃ÏÇ”/~FàRË&‰ûK§ðâ‹)y ‚KfÒFÿ^¤‘/¬ ^ ƒ3ƒ$d"<àA0A‡<°"Ÿ D"(1ˆ6¤Áª€Å'Ì€þ‡êzPE*ð1èÍ ÌÒŠ…0dxb (ŒìÀ„Åå<3•&&G£vÕHså*¢¸Èu®|ŽHí¢Q¼dP %ÈÀ'µð-J %Ä.JSb„ív ¶Ý9ì Qk‚G1\<ãÌ8Ç3æ „ëyÔKNsŒã—äi"Úã^ÿÀ†0ahà û‡H<ÀB#ÌR+ð X¼"Œ„Ðð+ œä¤:Y.Ì! u°C)¹`†<Ø F¨Ãú0‰W¸b„ÈÃÖÀ†5èá&Ôƒ/O¡ŠS¸¡ pxC¬Ð·®\hB œ‰–à„1n —è!1 SÈ¡ w8„aŠRÀbÔ¤Fïbq dˆ't ]˜uøDn˜DìóÄs­kFóê7—Á’`Å'¤€ç(- 8P xÐ*të 4’‘Œd`#艜ëѹ†$ƒÏ IHò’²d"£ƒÈÀþ¯`D aÓ ÜdˆÂ¼_,¡«¸ÄS*q\âã@3P‘ ]èÉF0@q‹X¤*¿.r‘¦øêáÒþîY@!ß<ˆ÷Ñ<¯4³pI¨Tœ@(À‘NдԹØÌ*<…\Ü¢z F'’ì'蠺еÖ𿢨öJ¡—®ìk ÆŽô«t‚¹€Åú78 YÊì ²l7Äk  Pƒ%ˆBU øÜ…8ÎpîGùv²å/yÉ ;2Mæ|çÎ%¢4Ž0¢ „òãL°64!Š^좵@E7ÂÁ„$aþÏE':a8h)ãÊH†1Œqz#ŒNO᪌³´uiutf:é™Z2FpÂ|Ð ÏáÍvMóà‰¡1£Ð1J‘Œ<À"–`‚= T(sð>ÓP©  ¹ ÀÌ  i ¹´© ƒñ€$7 ’ AÌÂwËô.Akð…Ç8?p›UF ÃPÌPã0 ¤P þžP Ã` Η Æð u ÿE ¬` à1Ej`@j¥ö¡ ‚ À0 °JE`Hçu@ ÄSlÌ@ ªÀRÀ™p©å†„ gÒÿãlkð À ©@ z€K$J—Ʀ`Äp j@wõ}×7.\àó9é‡ @;è@Ø €ÅèŒÌˆËØ €°ŒÔ 0* à£Ò Ð3Ú¨åöÓŽP` ³P„¥g€ Ph€zõpFH ¡@ ûˆ –€:à L0$0² Á  ¹Àp0ÊP†¹p —Pþ ½P á  Êð §  Ÿ` M@snЮ†4h`wàh^ÀK€‰.0s ûçVV‹(^Y s`9cº`3'puÐä §À «° E åÐ å@ HAy_y0 yÀv N0rðjº°ý“`0o€É‚mzå9pDm¹$8*?øƒ£„Ý(£’ÊØÚȌژ— =„=SŽ `âXŽ€YT6 \⎊ PwKpcV1ï€ä±yÝ0L  x À Ìp  š° À¥ †¶à ¹`Êk¦ÆWGNuþp z8j’Ð ¦¦ w@j’` uP°p w ²P“U/å‡5ÅHZð ±° ÈVTð Ìy ¹0°`%T`¹b@^ ±0 p æhl—z ª ¬ ¬0µcO,ó7€óBÀ\mÙ–Bà 4°*<(—?˜ÐŒÞXŽåXnª¹Œ v‰ð¡Š) *Žç¢0îy¥W…pQá€PõÀ*ø142°3 Ëà G~Ùx« ù¡;` ç Ö ª,Å` Ë` ¦|—@    *§‡h°­ x Æ ~Ȳ þ’ ©À ÜuLaÕþãn€Y0›P› § fpC°Ð ªÐ z „mðb`Ha @l@xy@xn°y J¸”FÐ 2ilÀ£¦¨m0O0R78A@ªËòw6ð”’2Tq©Œ§¢ŒÒÈ—ÓH«:`«|Ù3:˜@« ŽPÐM0¿™p€€pq`Ž`Q°É z1@¡ÝÔ # âp.ð¡û1ÄÀ 2gG æÀÀ ñàùð ¨ Í©s°D0K`y0Bf ß ˆk’€~Ö?pnV@Pð¦”þ’[` Á >Ð ­€[p±UÖ *Ù,…)6W€ô4EŸ`çn Ép;à† ¦ —d‰ sÅP°ºøBaá5°& ‡¥ƒË( @yIŽM[ŒK[â˜á¨˜ ð¡ÀÚèXlš¥ GPY>PxPðHz¥qTÉÕ3À™Sp$<°Ãš ;   Þp ¼ å1eÈ µ õà` ñê4—›` »„Szp ± ÉÐ|zxH€Ô‚Ôb°°TP×çù Uÿ x ­` Í èà ²Ð yP©  °þúhT²@lÀD ¸à ÂÀ ›à¸† Ïða¨fH`ðyÂb½’m ðpžà3±ÊÌÈŒªäx«Ñˆ«Ó¸´ `ÞŽqIµÅæ½Ðð ðÐ šð[E€†kP3Pr £º zhf S` G€N4€º0º ØÐ GÜX äåÜFe åàÁáÐÁÿ: Æ ^Ô—€ñ%_ë_Œë‡+H~H [œÔ…7wŠk²ë­ ¦°g¡ ÚEt 5 ˰”ª@¾»tlG&‚¤0N°'ದà3Á€ø@þÒª2ªr,.±°0 ±*z滾|©¡åVŒš˜:=“.Ð20 øûºÕ Nà}o€pk©YPA0Q ª‡‰=ö€œàG ã é€ã€+B¸€E 0dÍ4¿ç ¶` µ€ §@•°pŒÊø…i€lÊ 6W^`}ðaà±~(9L]@¡SàY° s1é>“SÐ=° ɰ ê¥h­À»ô?k`¸Dsp – ±;௠1© 5Û?ÑÛPLgÌwaá\©º3 /@,@L¾ ¾ þð ))0-Э.0.ð0 ’UY•…/O! EW°‘µÐCЀ0PD 3É”&hä   « ¾÷ W— õðÉöÐ N€Å8Ív¼s37œ` :e ˜@K`KÃÐ 4õ‡3Õk1ÅûdKWP{ ’ðVâüR öe©à>€YOáJà…J Ysài¾gŒ€ŒúS¼V²kÀ¿× {Cë ·&.‡Eý7k0W%ÛŠ`Ì1=`W]‘Æ1±ëa"þˆ:‡>°À›5Lp W PÚ |PÝ™¹@‡±ÚVº ú°²þéÀ+%ðÀJY Qðк 'M1@Æ{Ä` ¨ü L`&Àpì0Ô-PÇf¶ ûôVÄ ŒF}Ÿ  §  K@wÌ|hÕ3ESi`pÅrEp}ðêÕ].]ËܸTÀK0™@ 4ü)x8u ›z^Ý}-™@ :A  `l`ª@ Òb;4´Z—z ½qPÉô\Õ ~‡ª°ôAI â Äâ<@ðñâ3#3Ð=½£3ã<€-Bðg

Reference Clock Audio Drivers

jpgICOM R-72 shortwave receiver and Sure audio mixer

Last update: 00:48 UTC Saturday, November 24, 2007


Related Links

Table of Contents


Sound Card Drivers

There are some applications in which the computer time can be disciplined to an audio signal, rather than a serial timecode and communications port or special purpose bus peripheral. This is useful in such cases where the audio signal is sent over a telephone circuit, for example, or received directly from a shortwave receiver. In such cases the audio signal can be connected via an ordinary sound card or baseboard audio codec. The suite of NTP reference clock drivers currently includes three drivers suitable for these applications. They include a driver for the Inter Range Instrumentation Group (IRIG) signals produced by many radio clocks and timing devices, another for the Canadian time/frequency radio station CHU and a third for the NIST time/frequency radio stations WWV and WWVH. The radio drivers are designed to work with ordinary inexpensive shortwave radios and may be one of the least expensive ways to build a good primary time server.

All three drivers make ample use of sophisticated digital signal processing algorithms designed to efficiently extract timing signals from noise and interference. The radio station drivers in particular implement optimum linear demodulation and decoding techniques, including maximum-likelihood and soft-decision methods. The documentation page for each driver contains an in-depth discussion on the algorithms and performance expectations. In some cases the algorithms are further analyzed, modeled and evaluated in a technical report.

Currently, the audio drivers work with with Sun operating systems and audio codecs, including SunOS 4.1.3 and Solaris from 2.6 and probably all others in between. They also work with FreeBSD from 4.1 with compatible sound card. In fact, the interface is quite generic and support for other systems, in particular the various Unix generics, should not be difficult. Volunteers are solicited.

The audio drivers include a number of common features designed to groom input signals, suppress spikes and normalize signal levels. An automatic gain control (AGC) feature provides protection against overdriven or underdriven input signals. It is designed to maintain adequate demodulator signal amplitude while avoiding occasional noise spikes. In order to assure reliable operation, the signal level must be in the range where the audio gain control is effective. In general, this means the input signal level must be such as to cause the AGC to set the gain somewhere in the middle of the range from 0 to 255, as indicated in the timecode displayed by the ntpq program.

The IRIG and WWV drivers operate by disciplining a logical clock based on the codec sample clock to the audio signal as received. This is done by stuffing or slipping samples as required to maintain exact frequency to the order of 0.1 PPM. In order for the driver to reliably lock on the audio signal, the sample clock frequency tolerance must be less than 250 PPM (.025 percent) for the IRIG driver and half that for the WWV driver. The largest error observed so far is about 60 PPM, but it is possible some sound cards or codecs may exceed that value. In any case, the configuration file command tinker codec command can be used to change the systematic offset in units of 125 PPM.

The drivers include provisions to select the input port and to monitor the input signal. The fudge flag 2 command selects the microphone port if set to zero or the line-in port if set to one. It does not seem useful to specify the compact disc player port. The fudge flag 3 command enables the input signal monitor using the previously selected output port and output gain. Both of these flags can be set in the configuration file or remotely using the ntpdc utility program.

Shortwave Radio Drivers

The WWV/H and CHU audio drivers require an external shortwave radio with the radio output - speaker or headphone jack - connected to either the microphone or line-in port on the computer. There is some degree of art in setting up the radio and antenna and getting the setup to work. While the drivers are highly sophisticated and efficient in extracting timing signals from noise and interference, it always helps to have as clear a signal as possible.

The most important factor affecting the radio signal is the antenna. It need not be long - even 15 feet is enough if it is located outside of a metal frame building, preferably on the roof, and away from metallic objects. An ordinary CB whip mounted on a PVC pipe and wooden X-frame on the roof should work well with most portable radios, as they are optimized for small antennas.

The radio need not be located near the computer; in fact, it generally works better if the radio is outside the near field of computers and other electromagnetic noisemakers. It can be in the elevator penthouse connected by house wiring, which can also be used to power the radio. A couple of center-tapped audio transformers will minimize noise pickup and provide phantom power to the radio with return via the building ground.

The WWV/H and CHU transmitters operate on several frequencies simultaneously, so that in most parts of North America at least one frequency supports propagation to the receiver location at any given hour. While both drivers support the ICOM CI-V radio interface and can tune the radio automatically, computer-tunable radios are expensive and probably not cost effective compared to a GPS receiver. So, the radio frequency must usually be fixed and chosen by compromise.

Shortwave (3-30 MHz) radio propagation phenomena are well known to shortwave enthusiasts. The phenomena generally obey the following rules:

  • The optimum frequency is higher in daytime than nighttime, stays high longer on summer days and low longer on winter nights.
  • Transitions between daytime and nighttime conditions generally occur somewhat after sunrise and sunset at the midpoint of the path from transmitter to receiver.
  • Ambient noise (static) on the lower frequencies follows the thunderstorm season, so is higher on summer afternoons and evenings.
  • The lower frequency bands are best for shorter distances, while the higher bands are best for longer distances.
  • The optimum frequencies are higher at the peak of the 11-year sunspot cycle and lower at the trough. The current sunspot cycle began at the minimum in late 2006 and should reach its peak in 2012.

The best way to choose a frequency is to listen at various times over the day and determine the highest (daytime) and lowest (nighttime) frequencies that work well. Choose the frequency that works for the most number of hours in the day, usually the highest frequency. For instance, on the east coast the best compromise CHU frequency is 7335 kHz and the best WWV frequency is 15 MHz.

Autotune Modes

The shortwave drivers include support for an optional autotune function compatible with ICOM receivers and transceivers. The mode keyword of the server configuration command specifies the ICOM ID select code in decimal. A missing or zero argument disables the CI-V interface. Since all ICOM select codes are less than 128, the high order bit of the code is used by the driver to specify the baud rate. If this bit is not set, the rate is 9600 bps for the newer radios; if set, the rate is 1200 bps for the older radios. Following are the ID select codes for the known radios.

Radio Hex Decimal Radio Hex Decimal
706 0x4e 78 775 0x46 70
706MKIIG 0x58 88 781 0x26 38
725 0x28 40 970 0x2e 46
726 0x30 48 7000 0x70 113
735 0x04 4 R71 0x1A 26
746 0x66 102 R72 0x32 50
751 0x1c 28 R75 0x5a 90
756PROII 0x64 100 R7000 0x08 8
761 0x1e 30 R7100 0x34 52
765 0x2c 44 R8500 0x4a 74
R9000 0x2a 42

Setup and Debugging Aids

The audio drivers include extensive setup and debugging support to help hook up the audio signals and monitor the driver operations. The documentation page for each driver describes the various messages that can be produced either in real time or written to the clockstats file for later analysis. Of particular help in verifying signal connections and compatibility is a provision to monitor the signal via headphones or speaker.

Connecting radios and IRIG devices to the computer and verifying correct configuration is somewhat of a black art. The signals have to be connected to the correct ports and the signal level maintained within tolerances. Some radios have recorder outputs which produce a microphone-level signal not affected by the volume control. These signals can be connected to the microphone port on the computer. If the radio does not have a recorder output, connect the headphone or speaker output to the line-in port and adjust the volume control so the driver indicates comfortably above the minimum specified and the AGC level somewhere in the middle of the range 0-255. IRIG signals are usually much larger than radio outputs, usually in the range to several volts and may even overload the line-in port. In such cases the signal is designed to drive a cable terminated with a 50-ohm resistor, which results in a level the line-in port can handle..

It is very easy to underdriven or overdrive the audio codec, in which case the drivers will not synchronize to the signal. The drivers use fudge flag2 to enable audio monitoring of the input signal. This is useful during setup to confirm the signal is actually reaching the audio codec and generally free of noise and interference. Note that the monitor volume must be set before the driver is started.

The drivers write a synthesized timecode to the clockstats file each time the clock is set or verified and at other times if verbose monitoring is enabled. The format includes several fixed-length fields defining the UTC time to the millisecond, together with additional variable-length fields specific to each driver. The data include the intervals since the clock was last set or verified, the audio gain and various state variables and counters specific to each driver.


ntp-4.2.6p5/html/hints.html0000644000175000017500000000356211307651603014600 0ustar peterpeter Hints and Kinks

Hints and Kinks

from Alice's Adventures in Wonderland, Lewis Carroll

Mother in law has all the answers.

Last update: 20:27 UTC Monday, December 02, 2002



This is an index for a set of troubleshooting notes contained in individual text files in the ./hints directory. They were supplied by various volunteers in the form of mail messages, patches or just plain word of mouth. Each note applies to a specific computer and operating system and gives information found useful in setting up the NTP distribution or site configuration. The notes are very informal and subject to errors; no attempt has been made to verify the accuracy of the information contained in them.

Additions or corrections to this list or the information contained in the notes is solicited. The most useful submissions include the name of the computer manufacturer (and model numbers where appropriate), operating system (specific version(s) where appropriate), problem description, problem solution and submitter's name and electric address. If the submitter is willing to continue debate on the problem, please so advise. See the directory listing.


ntp-4.2.6p5/html/scripts/0000755000175000017500000000000011675461367014264 5ustar peterpeterntp-4.2.6p5/html/scripts/confopt.txt0000644000175000017500000000202311307651603016454 0ustar peterpeterdocument.write("

Server Commands

")ntp-4.2.6p5/html/scripts/manual.txt0000644000175000017500000000222011307651605016262 0ustar peterpeterdocument.write("")ntp-4.2.6p5/html/scripts/authopt.txt0000644000175000017500000000147711307651603016504 0ustar peterpeterdocument.write("

Authentication Commands

")ntp-4.2.6p5/html/scripts/monopt.txt0000644000175000017500000000047411307651604016331 0ustar peterpeterdocument.write("

Monitoring Commands

")ntp-4.2.6p5/html/scripts/external.txt0000644000175000017500000000273611307651604016642 0ustar peterpeterdocument.write("")ntp-4.2.6p5/html/scripts/refclock.txt0000644000175000017500000000073111307651603016600 0ustar peterpeterdocument.write("")ntp-4.2.6p5/html/scripts/config.txt0000644000175000017500000000057511307651603016263 0ustar peterpeterdocument.write("")ntp-4.2.6p5/html/scripts/miscopt.txt0000644000175000017500000000314211307651605016467 0ustar peterpeterdocument.write("

Miscellaneous Commands

")ntp-4.2.6p5/html/scripts/install.txt0000644000175000017500000000146211307651605016462 0ustar peterpeterdocument.write("")ntp-4.2.6p5/html/scripts/footer.txt0000644000175000017500000000045210017034541016277 0ustar peterpeterdocument.write("\ \ \ \
gif\ Home Pagegif\ Contacts
")ntp-4.2.6p5/html/scripts/misc.txt0000644000175000017500000000121511307651604015742 0ustar peterpeterdocument.write("")ntp-4.2.6p5/html/scripts/style.css0000644000175000017500000000304410017034541016112 0ustar peterpeterbody {background: #FDF1E1; color: #006600; font-family: "verdana", sans-serif; text-align: justify; margin-left: 5px;} p, h4, hr, li {margin-top: .6em; margin-bottom: .6em} li.inline {text-align: left; margin-top: 0; margin-bottom: 0} ul, dl, ol, {margin-top: .6em; margin-bottom: .6em; margin-left 5em} dt {margin-top: .6em} dd {margin-bottom: .6em} div.header {text-align: center; font-style: italic;} div.footer {text-align: center; font-size: 60%;} img.cell {align: left;} td.sidebar {width: 40px; align: center; valign: top;} img.sidebar {align: center; margin-top: 5px;} h4.sidebar {align: center;} p.top {background: #FDF1E1; color: #006600; position: absolute; margin-left: -90px; text-align: center;} a:link.sidebar {background: transparent; color: #990033; font-weight: bold;} a:visited.sidebar {background: transparent; color: #990033; font-weight: bold;} a:hover.sidebar {background: #FDF1E1; color: #006600;} img {margin: 5px;} div {text-align: center;} h1 {text-align: center; font-size: 250%;} caption {background: #EEEEEE; color: #339999;} tx {text-align: center;} th {background: #FFFFCC; color: #006600; text-align: center; text-decoration: underline; padding-top: 5px;} th.caption {background: #EEEEEE; color: #006600; text-align: center;}ntp-4.2.6p5/html/scripts/clockopt.txt0000644000175000017500000000047711307651603016635 0ustar peterpeterdocument.write("

Reference Clock Commands

")ntp-4.2.6p5/html/scripts/accopt.txt0000644000175000017500000000050111307651603016254 0ustar peterpeterdocument.write("

Access Control Commands

")ntp-4.2.6p5/html/scripts/command.txt0000644000175000017500000000132711307651603016430 0ustar peterpeterdocument.write("")ntp-4.2.6p5/html/scripts/audio.txt0000644000175000017500000000074011307651603016111 0ustar peterpeterdocument.write("")ntp-4.2.6p5/html/config.html0000644000175000017500000000371711307651603014722 0ustar peterpeter Build Options

Build Options

giffrom Pogo, Walt Kelly

Gnu autoconfigure tools are in the backpack.

Last update: Monday, December 15, 2008 20:54 UTC



Most modern software distributions include an autoconfigure utility which customizes the build and install configuration according to the specific hardware, operating system and file system conventions. For NTP this utility is called configure, which is run before building and installing the program components. For most installations no additional actions are required other than running configure with no options. However, it is possible to customize the build and install configuration through the use of configure options.

The available options, together with a concise description, can be displayed by running configure with the --help option. Various options can be used to reduce the memory footprint, adjust the scheduling priority, enable or disable debugging support or reference clock driver support. The options can be used to specify where to install the program components or where to find various libraries if they are not in the default place.


ntp-4.2.6p5/html/assoc.html0000644000175000017500000003434311307651603014564 0ustar peterpeter Association Management

Association Management

giffrom Alice's Adventures in Wonderland, Lewis Carroll

Make sure who your friends are.

Last update: 21:56 UTC Friday, December 28, 2007


Related Links

Table of Contents


Association Modes

This page describes the various modes of operation provided in NTPv4. Details about the configuration commands and options are given on the Configuration Options page. Details about the cryptographic authentication schemes are given on the Authentication Options page. Details about the automatic server discovery schemes are described on the Automatic Server Discovery Schemes page. Additional information is available in the papers, reports, memoranda and briefings on the NTP Project page.

There are three types of associations in NTP: persistent, preemptable and ephemeral. Persistent associations are mobilized by a configuration command and never demobilized. Preemptable associations, which are new to NTPv4, are mobilized by a configuration command which includes the prempt option and are demobilized by a "better" server or by timeout, but only if the number of survivors exceeds the threshold set by the tos maxclock configuration command. Ephemeral associations are mobilized upon arrival of designated messages and demobilized by timeout.

Ordinarily, successful mobilization of ephemeral associations requires the server to be cryptographically authenticated to the client. This can be done using either symmetric key or Autokey public key cryptography, as described in the Authentication Options page.

There are three principal modes of operation in NTP: client/server, symmetric active/passive and broadcast/multicast. There are three automatic server discovery schemes in NTP: broadcast/multicast, manycast and pool described on the Automatic Server Discovery Schemes page. In addition, the orphan mode and burst options described on this page can be used in appropriate cases.

Following is a summary of the operations in each mode. Note that reference to option applies to the commands described on the Configuration Options page. See that page for applicability and defaults.

Client/Server Mode

Client/server mode is the most common configuration in the Internet today. It operates in the classic remote-procedure-call (RPC) paradigm with stateless servers and stateful clients. In this mode a host sends a client (mode 3) request to the specified server and expects a server (mode 4) reply at some future time. In some contexts this would be described as a "pull" operation, in that the host pulls the time and related values from the server.

A host is configured in client mode using the server (sic) command and specifying the server DNS name or IPv4 or IPv6 address; the server requires no prior configuration. The iburst option described later on this page is recommended for clients, as this speeds up initial synchronization from several minutes to several seconds. The burst option described later on this page can be useful to reduce jitter on very noisy dial-up or ISDN network links.

Ordinarily, the program automatically manages the poll interval between the default minimum and maximum values. The minpoll and maxpoll options can be used to bracket the range. Unless noted otherwise, these options should not be used with reference clock drivers.

Symmetric Active/Passive Mode

Symmetric active/passive mode is intended for configurations were a clique of low-stratum peers operate as mutual backups for each other. Each peer operates with one or more primary reference sources, such as a radio clock, or a set of secondary (stratum, 2) servers known to be reliable and authentic. Should one of the peers lose all reference sources or simply cease operation, the other peers will automatically reconfigure so that time and related values can flow from the surviving peers to all hosts in the subnet. In some contexts this would be described as a "push-pull" operation, in that the peer either pulls or pushes the time and related values depending on the particular configuration.

In symmetric active mode a peer symmetric active (mode 1) message to a designated peer. If a matching configured symmetric active association is found, the designated peer returns a symmetric active message. If no matching association is found, the designated peer mobilizes a ephemeral symmetric passive association and returns a symmetric passive (mode 2) message. Since an intruder can impersonate a symmetric active peer and cause a spurious symmetric passive association to be mobilized, symmetric passive mode should always be cryptographically validated.

A peer is configured in symmetric active mode using the peer command and specifying the other peer DNS name or IPv4 or IPv6 address. The burst and iburst options should not be used in symmetric modes, as this can upset the intended symmetry of the protocol and result in spurious duplicate or dropped messages.

As symmetric modes are most often used as root servers for moderate to large subnets where rapid response is required, it is generally best to set the minimum and maximum poll intervals of each root server to the same value using the minpoll and maxpoll options.

Broadcast/Multicast Modes

NTP broadcast and multicast modes are intended for configurations involving one or a few servers and a possibly very large client population. Broadcast mode can be used with Ethernet, FDDI and WiFi spans interconnected by hubs or switches. Ordinarily, broadcast packets do not extend beyond a level-3 router. Where service is intended beyond a level-3 router, multicast mode can be used. Additional information is on the Automatic NTP Configuration Options page.

Manycast Mode

Manycast mode is a automatic discovery and configuration paradigm new to NTPv4. It is intended as a means for a multicast client to troll the nearby network neighborhood to find cooperating manycast servers, validate them using cryptographic means and evaluate their time values with respect to other servers that might be lurking in the vicinity. The intended result is that each manycast client mobilizes ephemeral client associations with some number of the "best" of the nearby manycast servers, yet automatically reconfigures to sustain this number of servers should one or another fail. Additional information is on the Automatic NTP Configuration Options page.

Orphan Mode

Sometimes an NTP subnet becomes isolated from all UTC sources such as local reference clocks or Internet time servers. In such cases it may be necessary that the subnet servers and clients remain synchronized to a common timescale, not necessarily the UTC timescale. Previously, this function was provided by the local clock driver to simulate a UTC source. A server with this driver could be used to synchronize other hosts in the subnet directly or indirectly.

There are many disadvantages using the local clock driver, primarily that the subnet is vulnerable to single-point failures and multiple server redundancy is not possible. Orphan mode is intended to replace the local clock driver. It provides a single simulated UTC source with multiple servers and provides seamless switching as servers fail and recover.

A common configuration for private networks includes one or more core servers operating at the lowest stratum. Good practice is to configure each of these servers as backup for the others using symmetric or broadcast modes. As long as at least one core server can reach a UTC source, the entire subnet can synchronize to it.

If no UTC sources are available to any core server, one of them can provide a simulated UTC source for all other hosts in the subnet. However, only one core server can simulate the UTC source and all direct dependents, called orphan children, must select the same one, called the orphan parent.

A host is enabled for orphan mode using the tos orphan stratum command, where stratum is some stratum less than 16 and greater than any anticipated stratum that might occur with configured Internet time servers. However, sufficient headroom should remain so every subnet host dependent on the orphan children has stratum less than 16. Where no associations for other servers or reference clocks are configured, the orphan stratum can be set to 1. These are the same considerations that guide the local clock driver stratum selection.

A orphan parent with no sources shows reference ID LOOP if operating at stratum 1 and 127.0.0.1 (Unix loopback address) otherwise. While ordinary NTP clients use a selection metric based on delay and dispersion, orphan children use a metric computed from the IP address of each core server. Each orphan child chooses the orphan parent as the root server with the smallest metric.

For orphan mode to work well, each core server with available sources should operate at the same stratum. All core servers and orphan children should include the same tos command in the configuration file. Each orphan child should include in the configuration file all root servers.

gif

For example, consider the peer network configuration above, where two or more campus primary or secondary (stratum 2) servers are configured with reference clocks or public Internet primary servers and with each other using symmetric modes. With this configuration a server that loses all sources continues to discipline the system clock using the other servers as backup. Only the core servers and orphan children need to be enabled for orphan mode.

gif

For broadcast networks each core server is configured in both broadcast server and broadcast client modes as shown above. Orphan children operate as broadcast clients of all core servers. As in peer networks, the core servers back up each other and only they and the orphan children need to be enabled for orphan mode.

In normal operation subnet hosts operate below stratum 5, so the subnet is automatically configured as described in the NTP specification. If all UTC sources are lost, all core servers become orphans and the orphan children will select the same root server to become the orphan parent.

Burst Options

There are two burst options where a single poll event triggers a burst of eight packets at 2-s intervals instead of the normal one packet. They should be used only with the server and pool commands, but not with reference clock drivers nor symmetric peers. The burst option sends a burst when the server is reachable, while the iburst option sends a burst when the server is unreachable. Each mode is independently of the other and both can be used at the same time. In either mode the client sends one packet, waits for the reply, then sends the remaining packets in the burst. This may be useful to allow a modem to complete a call.

In both modes received server packets update the clock filter, which selects the best (most accurate) time values. When the last packet in the burst is sent, the next received packet updates the system variables and adjusts the system clock as if only a single packet exchange had occurred.

The iburst option is useful where the system clock must be set quickly or when the network attachment requires an initial calling or training sequence. The burst is initiated only when the server first becomes reachable. This improves accuracy with intermittent connections typical of PPP and ISDN services. Outliers due to initial dial-up delays, etc., are avoided and the client sets the clock within a few seconds after the first received packet.

The burst option can be configured in cases of excessive network jitter or when the network attachment requires an initial calling or training sequence. The burst is initiated at each poll interval when the server is reachable. The number of packets in the burst is determined by the poll interval so that the average interval between packets is no less than 16. At a poll interval of 16 s, only one packet is sent in the burst; at 32 s, two packets are sent and so forth until at 128 s and above eight packets are sent.


ntp-4.2.6p5/html/description_files/0000755000175000017500000000000011675461367016302 5ustar peterpeterntp-4.2.6p5/html/description_files/description.jpg0000644000175000017500000010257211307651605021322 0ustar peterpeterÿØÿàJFIFÿíPhotoshop 3.08BIMÿâ (ICC_PROFILE applmntrRGB XYZ ÕacspAPPLöÖÓ-applù [ÆHÖØ“OG§ŽîcyrXYZ,gXYZ@bXYZTwtpthchad|,rTRC¨gTRC¸bTRCÈvcgtØndinì>desc ,ddscm .mmod À(cprt è-XYZ q0D¼eXYZ a¹¡˜)(XYZ #íÇš˜XYZ óRÏsf32 BÞÿÿó&’ý‘ÿÿû¢ÿÿý£ÜÀlcurvÍcurvÍcurvÍvcgt !"$%'(*+,./1235689:<=>@ABDEGHIJLMNPQRTUVXYZ[\^_`abcefghijkmnopqrstuwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦¦§¨©ª«¬¬­®¯°±±²³´µ¶¶·¸¹ºº»¼½½¾¿ÀÀÁÂÃÃÄÅÆÆÇÈÉÉÊËËÌÍÎÎÏÐÐÑÒÒÓÔÔÕÖÖ×רÙÙÚÛÛÜÝÝÞÞßààáââãääåææçèééêëëìíîîïðññòóôõöö÷øùúúûüýþþÿ  !#$&')*+-.01345789;<=?@ACDEFHIJKMNOPRSTUVXYZ[\^_`abcdefhijklmnopqstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–——˜™š›œžŸ  ¡¢£¤¥¦¦§¨©ª«¬­­®¯°±²²³´µ¶··¸¹º»¼¼½¾¿ÀÁÁÂÃÄÅÅÆÇÈÉÉÊËÌÍÍÎÏÐÑÑÒÓÓÔÕÖÖרØÙÚÚÛÜÝÝÞßßàáââãääåæççèééêëììíîîïðññòóôôõöö÷øùùúûüüýþþÿ  !"#$%&'()*+,-./01234556789:;<=>?@ABCDEFGHIJJKLMNOPQRSTTUVWXYZ[\]]^_`abcddefghijjklmnoppqrstuuvwxyz{{|}~€‚‚ƒ„…†‡ˆˆ‰Š‹ŒŽŽ‘’“””•–—˜™™š›œžžŸ ¡¢£¤¤¥¦§¨©©ª«¬­®®¯°±²³´µµ¶·¸¹ºº»¼½¾¿¿ÀÁÂÃÄÅÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕרÙÛÝÞàâãåçéëìîñóõ÷ùüþÿndin6žWeM(†Â(!GP T9ó3£×¡G*6DSdu‡›³Ìäþ6RoޝÐó>e‘»å?l›Ëü/a•Ë@»ø6s³õ7y¾L•å 9 … Õ % v É  s É x Ñ , œ ý]¾ ƒèO³‡ò^Ð?¯#š"ª2»HØjü'½Ué…!½[ý ¡!I!ô"˜#A#ñ$¡%R&&µ'g((Ü)’*R++Õ,™-a.).ñ/¾01`2333Ü4¾5•6w7Z8>9"::ì;Ù<Ê=»>¬?ž@”A‹BƒCD…E‰FŒGŽHšIºJëLMUN‹OÀPùR9SƒTÌVW^X¯Z[X\·^_…`êbTcÓeGf¾h@iÊkQlänvpq´sXuv¶xiz{ç}®}Lƒ„í†Òˆ¹ŠœŒ‹Ž„{’o”h–t˜–šÜ9Ÿ¡í¤F¦©©«]­Å°$²Š´ò·X¹¶¼¾xÀÝÃ<ŘÇöÊNÌ«ÎüÑUÓªÕûØGÚ•ÜßÞ»á ãQå8çié¯ë´íËðò9ô2öyøÁú¡ýÿÿ $/;HWgw‰œ°ÅÜô)D`}œ¼Ý$Jp–¾èAnÍÿ2ešÑ C}ºù8w»E‰Òhµ  S ¥ û O ¦ ÿ Z ¶  p Ï / ” ûcË4ž yèYÌ@·/§"¡%ª3½IÕeù$½Xò*Êi ± [!!¶"d##Ç$%7%ð&ª'd(&(ë)ª*v+E, ,Þ-³.ƒ/Z0611ó2Ô3·4£5Š6y7l8_9Q:D;8<:=;>ÂĸÆþÉ:ˆÍÈÐÒeÔ³ÖüÙGÛŸÝðàIâäñçQé ëûîWð¿ó"õ‰÷íú\üÛÿÿ  /BWo‰©ÑôBk–Äõ(^ªä"a¢å+pºsÆnÇ"}Û<Ÿ , •  o ß S Ç = ´ 3 àaähïx ´Ià|Àk¿o$Ú“O ƆFÏ ›!k";# #á$»%•&q'G(-))÷*ã+Ð,Á-¶.¥/¡0Ÿ1ž2Ÿ3£4°5¶6É7Ü8ð:;<:=]>€?¤@ÐAòC%D\E•FÏGþI7JmK¢LÚNOOPQÁSTOU—VÚX+YtZÂ\]s^Ó`)aƒbédSeµghŒiýkllãnXoÔqSrÌtNuÔw[xàzk{û}$€º‚Lƒß…y‡ˆ½ŠZ‹ÿ­[‘’«”V– —º™Ršòœ‹žBŸð¡¥£b¥)¦ö¨½ª‘¬l®E°±ï³Ãµž·p¹M»¼ç¾µÀuÂ'ÃÖňÇ3ÈËÊfËüÍÎùÐqÑäÓQÔ½Ö×eضÚÛEÜ}ÝނߟàÅáåã ääóåâæ÷èéêëëÌìží™î’ï‡ðsñXò(òéó³ô—õzöX÷5øøæù úZû"ûòüÊý«þ·ÿÿdesc Color LCDmluc enUSColor LCDmmodœ*¸MrtextCopyright Apple Computer, Inc., 2005ÿÛC     ÿÛC  ÿÀÚ¾"ÿÄ ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?ýü¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢¹©¼iàë[x^ãÅžƒÄ×éo¤IªB·’²F%p°–ÞÅceráH'ƒšå´Ï? uGâ{_ˆÞ @’î{H¯®µh`ŠI ˜C S# ì˜aà #e$:“„±TS³šû×K_ó_yêRÈó*S†m;Y¨Éßšü½:òÊÝù]¶g§Q@ €AÈ®zxRçâç„-üOáëZ@..´XõšöˆR$xoUçÌF>aê+YN1µÞç ,=Z¼Îo•]Ù^Ë»ì¼Î†Šä´ïøXðÍÞ·¤x×ÂZ®kt-.¯ìõˆ&·‚rTžEbªäº¤ç,8äW)«|jð…ÇÃÈô­kNñwü&ºËiºš©g4r˜ÒFš}ï2+E–UŠm숙‚œg‹£w%ý;~zÌ«TtáBWW¾ZÑrw¾ŠÑNNý{±Eq<6—á‰5Fðö¥¯é±ê~“©ê–ÑݼnªÜ*ÈÊûK…-:ç£A=cêë¶ú\—¶‘êwIq›L¢ib‘d‘S9*¦XÃ0Eï é°’ºg%|¿F\µ)µ¿Mí»OªVwkBÝRÃP°Õt{}GK½´Ô´ùÓ|6³,±J¾ªÊH#Ü·Všjèåœ%8ÉY ¢Š)’QEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQE|±®|$ÕoüOãÝq<'¦\kWÿ<9®é·íö´6d4ušQ!;”F±j!!ˆi©ó>o,´ÐõŸ üm𶃩|¸ñ­ÔV=km)ô¯.k[ÝjÎhnÍp±¬/ ÊÛº¶%ÜŠýᄅ†8ÍÂÊQ ª¥UöüÀ3èp?!^5l–”¥Í4þ_ÍÍÕw?J˼MÇP¢¨Ö¥JÉ74ÿ‚è-c4죫J×w³]jìþÝÝ\þÐ?µ477ÃkñBÒT’BË xrBˆÝ]îíÆYRkÝêVMBêM»¦ŸN¾‹Ì韉Y£§:Q„T% BÞû²œ!fæÛv‚³mîúY/Ë;­>ãÀ_ 5/‡¾$ð~‰¯xÒö/Û ˆµÍ>[­hm4ëQg$ (¸gY ¸–³$ÑÉö‡;—WÒ´=¼%â/ ŧøGâµ§‰®´ [jwñ4Úµ½ú5ƒKÛ1«Ëk|Q*¶cz®8ú¦m#J¹ñž­q¦ióê¶ŠËky%²4Ð`ŽFåœjÌ–¶Ó^[ÜËo·åŒ¼`´E†i<ŒŽ:Šæ¥’8S5SGkh´³nþ©½<ü´=œoŠÅc0¸ª˜TåMÉÍsJÓæ§n6m¥ F JÊü­¥f¹žG…¼9¦ø?ះ¼'£$‘é.›Ÿd²6æCÆ›s…=ÍoQE{°ŠŒTRÑ”ׯR½YU©+ÊM¶Þí½[~¡EUQ@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@WñNÛÇŸ³_­¾j‘èŸdðýØðÍôG2Áä·ÙؤªÈG™·;•‡¨=(Ï> ÿÉÅ~Ö?öUlÿõðÕ{ý~Á*þ3þÓ_?kŸŽ~ ø‘ãEÕ|q^ø’Ù´;W»×%†ÒÆÙóɲÏL(Ȥ.QK&ç-_¹ôQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQESÄqn§Öˆn¦ƒ,€à…&€<£âÆoøF| x Â>¾ñïÄÝvÞ{­3Ãös­º%¬ Ïyupÿ%µº4Ñ&öË;ȪˆìH§[ý¬#á?ìü£ßâö©ŸýGk„ø#©mÁIþ;\Ì|Ö²ð…a€ž|±%ÿˆÌ€znòãÏûƒÒ¾Ê ›ÿ¶¿k?ú%?³ïþíSÿ™Ú?¶¿k?ú%?³ïþíSÿ™ÚúBŠù¿ûkö³ÿ¢Sû>ÿáÞÕ?ù£ûkö³ÿ¢Sû>ÿáÞÕ?ù¯¤( ›ÿ¶¿k?ú%?³ïþíSÿ™Ú?¶¿k?ú%?³ïþíSÿ™ÚúBŠøOá7ÂÏ¿á`ÿÂð{àE·ü&^/»ñ>¯öŒZ“íº¹Û¾8±áµÙíù#çnæçšõÏí¯ÚÏþ‰Oìûÿ‡{Tÿæv¾¢€>oþÚý¬ÿè”þÏ¿øwµOþghþÚý¬ÿè”þÏ¿øwµOþgké (æÿí¯ÚÏþ‰Oìûÿ‡{Tÿæví¯ÚÏþ‰Oìûÿ‡{Tÿæv¾¢€>oþÚý¬ÿè”þÏ¿øwµOþgk+[øµñ§á¶ƒ'Š>-|#𭯀­~}cYð/Œî5étˆ2Ý\[O§YÈmÐÎÐù¬ˆ®Å0¤×ԵʹšuÅ¥ÔI=´ñ´sDã*êÃb Ÿ¥kz¾›Ý•Ä76ÓF$ŠXœ2:‘ÀŽ äZõð÷ì[âKOö ø&·3¼óiGs’ÍörO¾kîr ÐÑETm,i÷œ Iß˵wôòÆ?xŸXøéðGáφÿå'ü3·‹èê?hoüð§ÿ(èé/¶ÚÿÏTüèûm¯üõOξmÿ†vñoýGí ÿ€^ÿåðÎÞ-ÿ£¨ý¡¿ð Ÿü£ ¤¾Ûkÿ=Só£í¶¿óÕ?:ù·þÛÅ¿ôu´7þxSÿ”tÃ;x·þŽ£ö†ÿÀ/ òŽ€>’ûm¯üõOζÚÿÏTüëæßøgoÿÑÔ~ÐßøáOþQÑÿ íâßú:Úÿ¼)ÿÊ:úKí¶¿óÕ?:>Ûkÿ=Só¯›á¼[ÿGQûCà…?ùGGü3·‹èê?hoüð§ÿ(èé/¶ÚÿÏTüèûm¯üõOξmÿ†vñoýGí ÿ€^ÿåðÎÞ-ÿ£¨ý¡¿ð Ÿü£ ¤¾Ûkÿ=Só£í¶¿óÕ?:ù·þÛÅ¿ôu´7þxSÿ”tÃ;x·þŽ£ö†ÿÀ/ òŽ€>’ûm¯üõOζÚÿÏTüëæßøgoÿÑÔ~ÐßøáOþQÑÿ íâßú:Úÿ¼)ÿÊ:úKí¶¿óÕ?:>ÛlOúäüëæßøgoÿÑÔ~ÐßøáOþQÒÙãÅ ä~Õ?´/þøSÿ”tô²Íý×SRׯÔü[ðûöîñÇà {⌾%hqx'@Öôé¼Ki¥Åqk=Õî·«XYÛ+FVÆØ€êÄØ88¯±,¦óìOQ@袊(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š+Žñ£c“¸k±®3Æßò*Oþé ‘¿f†-ÿ ý¢É9ÿŠ7Âú[âZû²¾ý™å!_´_ý‰ÞÿÒß×ÝÔQEQEóßÅOÚCÀ¿~Ó¬ÞkFþÞ[ˆ„v<’f(^Eò|ÝÑ«¹¨Ma|[ðoƇý«<ñ7á“ðÃÄ#Mðv³áýKOñv½w¦0kÛ>xg‰à³¸Ü¬Žô;7À ò>?²Ž|1ðCÃþÑ‚¼x4Kżñ&©á›×};M»´–æÓP°W›O›Ì¸VB¢`ñy±8÷PßîbþÕõÿÀåÓÊ<ºè½]جý¯—ÿjºÿŠþô¶©ûUþϺG‡¼5«]|JÒçÓ5Ý3ûVÎêÂÎæò8,|üºhbqel²+FÓ\ùQ«£«0e`4n¿iO‚6mþÏã»Sã9uHt³kŸu$]Ï Mo×+‚™LBIÍ9X÷0 |³§~Ï´Ÿ‡< â›+]cáŸõ¯ü?_ ø›Qñ&¹wæx}c¼Õe·–'[2Ú¨ŽßU17›öW™íUÙ•¶z ~Ì>%Ó~x¯ÂÚV±áéVûâç…|Ucqs$ˆÇNÒ#Ð#–9vÄqpÃIœªŒ¦d.¹m½¡NU¤¤ík>÷šOÓ–/šûK¥­bj9%îïgÿ¤Ý}òº¶[]ÑöÅQ\å…Q@Q@œŸ°»Ÿøb/ƒ£?ó&i_úG ~Œ¯úµúWçì-ÿ&Mð{þÄÍ+ÿHá¯ÑÔÿR¿JuQ@u#cþÍ|â‹™$ÿ‚Ÿ~ÌP±;Gµ&ÇýÊúí}÷ªÈo÷M~}ø“þR“û1ÿØé©ÿê/®Ðè¥Q@ ‘™-äu¥eRB.2ÇÐgŒ×ç—ÁÚ§ÇŸ>*ønßZñ_Á)Ô|Wð²; ½Æ Xà’UÞ·—Dê2‰»-¡ æ c%è=íª_h÷vRÉqw´NðJÑÈ¡«® ·<r5ñæ›û4|HÔõÏ…ÚÅŒÚGü#ðòüÞx~å|müKzém5´ÿS’îe”¬s#EM;¨,@,­™6×Ëñ¿éëÑÇr›\–ëý[ñù.ª[·ˆ¿jï…žø9áêIâ§Ñ5ÿéëk¥ù³¶œfÓáÆ­Ÿ;~§kû±œå°I97ŸµÏ‚´Ó&—ªxâæã¿øHmt8|.ƒjóÍymsse* 6ó¥À‚FѸ˜Ååɳæßˆ?²?Æ]+öQ¸Òôï‰öŸu? ü=³ð/€ô½+Á‘XÏelš®—8¾šIo]n.;Œ‹û¸ÜB»Qàý׌ÿg¯Ž2üuð'Äh¾#ø{]ø­yãË o|Ccà£o£èzNŸ¢k‘AØ=ûË*Kq¨J’²Ü‡&ívl†®ªžÅÊðºO£µÿˆíågfú^û½´NúÙ?›POîrºï§E©ëCö·ðUæ£ø â׋|Wt5Õ<¤h¾¯ ®2Á|׉$éùRº X¥‘¦, 0æ¹oˆß¶¿ƒ<9ðÇ^Ö>x'âÅ›ëO†©ã»y4+ÊÓbÓg·º–Úk»™™>ή֮¦=8ä¬Nö¦û1üLð§‰Ç^øÕ¢X|XÖaÔ¡ñ†±¬ø-¯´íAonVåÚÍoc{fµeÙiå]„‰’ji²6 ü!ø‹àÆZ„:/‰¾ éŸ-ä¸ÓÖ[‹(ì¡Ô¢ûs°uYžOí Æ0±€c88l.Ö•åñ[T»ûß ú|6¾»ßÊ¡Ëílþéþ­_¹¶ÓE×~‡öƒøÙâ/†_°]ÅM/ø'V¼Ôô+iÛÇ–-®‡¡km<—‘Û\&LÎìÁ&ÆSïY¿þ:ÍãJÂÏ\ø±ðoâúkºœö¥ðÃE¸¶³´šÖØÜÜÅvó_ÝeÌm.Ý¸Ï îz_Ž>êß¿gÏxGÄ)±‹[Ò5ýYÔ5[-£‚öm.þÖõÖ;vŒ)3[–C|þón ~-|9ñŸŒ¼Cà/|=ñÆ‹àoø^þæhgÖ<8ÚÅÌ76²[É—6îoWWŒÁV E[²çk¬¼—»müïçÜçŒfãÞ©+úë}¼­äp~!ý¬¼¢iZUÆàŠÞ3šûD¿ÖþÉáí;‰m¬lnþËu<»æEPŽ2ò#Wc¶¬Ý~Õ~—Dм-ñ+ÆLWZuŽ¥âmBézeæ£ SYZÎï"KæH—Ęãxâóãóž-Õ[áçìÛ?¾èÚ×§ñÕ—ÃËÏ Ï¨M¤žéînšá¯YD¤ËcIÎáÒ²ü'û9øûÀ~8ø?ãÞ×ö;Õíþèþ?mÿ´ü9k~ÔâðÆÏ²Ik®C¬ØÉsºaq²H9ULBU$¯”q]׆?gM~Åo|BÓüEãèeR\»tÿÀWNÜÞõ]J‹ûcü>»Ò<56‡àŸ‹>&Ôu.ãTÕ´m+BŠ]Gֶׯav÷–æpÎÐÜÅ4M¯Ú%&&(ޏcõ¢°xÕ×;Xddb¿>¹°’û\ºK½{áÒ^ê:Úž¯w©}³G»Žî)¬¯"+˜^XÜÛÃ'”„oÐK²iVÖ¾t÷>LK›3n’M  Ì{±ÆIõ©ºqó»üݾåný]õ²¹i;-¿á¿=z.ÖÒîÅQR3à/ˆü_Ä „€ÿ |5ŸÃTñø×Ü>mÞ„ž»E|-ñþS7®Ù)ðßþ"ðÂ}?â.·|º´ÜYYß[ÞImh–à3ÍrÒZm;HPÈìࢤ™7·>“¦üÑËN’õ줷–#Û#ý¬t›Ëû…øá½?ãÞŸ¦xVoëÚž‰â‹h--ìRYàD·”‡[›©%µ¸QQTBå¤RQ_Öü ðgBð»£êÐx‡Æ^&Ö,´)ô™¯üA¨­Ô×Â{¿¶M<Çbþñ¥' ›"E;5UP>~ý¦¾ üLñÇïu?…pjºEÆ»à‰¼5«êzŒ Ò$¸S3¼0^Ç=ÎmÏüëSÒ‘T‘&W–¼¦©®Eï>oKûÜ¿öïÃ}žú·diAEÎ\Û^6ô÷o·_‹º½´Jç;®Á@|¢üc²ðëé~]> ´[]t^øÖÎ×ZŠ}V+Ybû–ãο‚¼…¦”öþZÊQÂô¶ß¶,ö^$‡WñŸÂÛ¯ |$¹Ö|I£Yøµ¼CÍÄ·zßËpÆÅbmž-6줦]þd{LAJÈÝ–û+é:V½a}gñ#â>ƒ§Î4‹ŸøwA»¶µÓ5ûí:ÞÞ®dc]Â-mÒH ¸$H•][/¿¤¿ý™>jÞð¿…µf×õMDñ.»®­ÅÌe/eÖcÔ㼂|F ‡n­t!F,ØmÝ•ÔgìÝÞ¶íäþOo-Î|+o•Õ¾Êö·guëµúv²>jÑ࡚¯àÏÞÚxDñ»m¦éº¦‹¢ø?â›­Ëuö§k§%½Ü‘mKô’òÐ9xÈo’wÚå;ÿþ×÷ÞøýàÿxëÀ~ðÞ±ª^èºuþšßì¥ÕÍÖ©,P«iúxͽµ‚IBË;›|‘‘$ Ïeeû(hMá™4¯|WøËã»X“HƒK]gU³ ¦[éz„:…¼QǬqÈÍ-¼K$ó,“º.ß5zÓüaû)è,ø¥ãÛüMø¥á+kúoˆuME—M¯ªéÂÐZ]îžÎYŽÁeoû†ÀJdÇ“š›ÃÚCOvúú_ó¶ûûËMÊ\Ü’O~ŸrûÕïkÛÝwzÙuàoÚcã6½§ÚøbOƒ~×þ)ê>$ñ`±Ó­ü\,´Ø4U/4÷Mnì'ó&†D‰„¬¦V0+MM'ö‘ñwÆÍNOüðV¯á«Ë¿‡öþ#¹ñ~±{j†æºþІÞÝì˜9º”]X4lˆDf?1¼Õ"1'esû,iPkí®xSâÇÅx–=o[¿²Õ´¹tÉe³·Ön#»Ô4ôK‹)#kg¹gS"<Ѹùe òÖ–™ðÏá7Ãßß|YG®¾ØøcB¶ñ¢ZÂ6°7Ïk<Ò*‹´·ò¼ÎY‹àm rN2ÖŽ‹Þ·ãgoÒ÷ûWû:ò¯mdýÛé~ÜË•öén§©ü&ñä_eÿ‡Ÿ!³þÍOørÏV6~h“ìÍ< #DXu(X®}«ÐkŠømà‹†³Ï~iwwwúw†4 ="Úêèƒ4ém B$|70Lœ2MvµÑˆäö²äÚîÞŸ=Liß‘\üàý…¿äɾØ™¥é5ú:ŸêWé_œ_°·ü™7Áïû4¯ý#†¿GSýJý+ÇQEŸªÈo÷M~}ø“þR“û1ÿØé©ÿê/®×è&©ÿ i¿Ý5ù÷âOùJOìÇÿc¦§ÿ¨¾»@¢•ÁüQñeï?g?xÏN´¶¿¿Ñ4iï­í®ˆæxаV#1‘]ådxƒAÒ|SàWÚõšê.¥lö×¶Ìì‚XÜa”•!†G¡³«(4›[ùUl5,m˜˜óSR‹’ïÕÖëuuºõ>QñOÄ_V~(¹ðÎ¥ðÿG×ôÿøbYo4ý>æH&ÓõK×·6…^B|Å’V”`x'Ŧ«¬éWßê?Ùÿj¹·Ô®m¥&Âw¸´(ÑH¦6ŽIƒ&Òs†$ீ¾ðŒòë‹swsãA¨ê—¶Z„××wv2^ÜÍ#I”³4KåÈ#gDRÀ7@씰ظMZW÷›ßìÞ6V¶®É­Ö®ú½OÔ?Ö.Äes…L:…]•©­åFÍó)Ý%YsÞͨÙF-JQ]·Åê¾ ø[£ Øiú–½}¬XidWó4vË=åÜV©$¥AmˆeÞUy`¸g#çøYß<+¯|BÒõ½wÂRø²O[i–Í•©ê¶ñ@4KK–6ze³5˳]¢Yc2;³¸\¿Ñº—.ÔÖÂÚIZóí>vå²ïÚW¨ïYãp¸Ê³S¦ínîß‚OÏ[õÛKœ\/›ðÎ_„• tIÉ¿zRë j8Û•ÆW#RæÕµîžM§|fñþ­©xÆMqáMÃRü<ñ««èú”sZ£Ýé×VÐyŸ/n›H hѦ®Û6z7ÁŠ~$ñߌü[ x’ÚÐÏ¥iÚ~¡ìÔtU•.Úé|±o~<×mŽ'\$›ŽJ‘[ñ|øO„ô½ ? L4]:ËQ±³²þ×¼òcµÔûU¾ß7 ¤Fr¨Ê¬J‚,i?t? kw:Ï‚µsGñ ݼvº†¥©êך¼—F]£IÔí¸¡sµÏ̪J‚‘O ‡ÇR¬œÚqë«m¶ôi+^ß%¥¶}Y¾yÁØÌ zz§QÝS“„RŠöÒœyœe)7ìß#jîú>eµñ¯âŒ| aáãám6ßì·­ru jçÃ÷ÚÌw•hÖK[&Û!%|ï¹ÞA, øôÿ>(Ûx³ÄšÎ™wðÿÄZn¡§x@x{JŠYþÉo6¯u-»HnÔn’=ÁŽñʬxHmþÿ¬ü,°ñt¶76Õõ]SRÓ̃LÔtkËêÕ%MšÒdvŽM‘îBÛIE8È9> ü5‡R°¹ƒÃmö+M6ÖÚ5˜íÒ=6qqb<•FZ)9 T±”’¬A¹aq“­)sZ-«kªÒÏ¥½<õ¹–MŸð®/§C‡öµV’j ÆKÚÆz9J3»„y.¹mªŠW”§ÅÅñ[ÅVÖ³c ^k:GÄ=+·rXÅ,pN·)§çDgfR¦òRªXà"äžMy‡ˆþ*ümÕcýkâ>7Ãß èÚׄ.5ßH#šMCI oÌM·2<Xº"¬2¥eR öO|>ø%ÇkOx’}?Nñ|—±ë¶ö·>'žÚ.m–8øYùë HªcˆË哆 I ƒz€_ ­ìüAlž»’ÏWÓî´éífÖ¯$†ÚÖåüˈ-Q¥+i¸ VÜF2«Œm\L©bêû­¥k­$ûE&ýÝÛRvé}éÛ€ÏxS5ç„““p“楢’œ"K[))[]`â¢Úx§â¯ˆ­tÝq.ôíãPÒþ$é~À²,sGtºq–p¥‰ ¿l’0ƒ9ä×™_üyø•m øF´Ÿ Øk,¹ÔgÒe²ðö«®-•…‹¤o$ÖÖ`Ë$²¼±`)D\–f +{kü øg'Ä[M£j³ëwÖÚ„-/ˆ/žyoÃÛÂfò丢¡™Ô».C“m[á?µŸ hZ4úv¥eo¢Ë$šMÆ™¬ÝØÝÙ™ \Á*LÃË¿ ÆG#©MrÉE¯7ª÷ÞŠÍÚnÚÛ›}šâÁçüBTùð²švr|‘M?fÕ¢œå½¯,ý䮯­£ùòûö„ø…—ƒõ›Ï i Ðnt˜.µY|A¤jfÞ[ƒw,}®8ÀÓBG™îÞ ‘Hkí¿|]ãO‰þð€cðÜ#×,oµÔµøežÒÖÚÌÛ«&'ä‘亅GΡW{Äj׳÷ÂyìôËHü7u§iÖZdgØ4íbòÒÖòÒgŠ ¨b•Ré¤â`ùÞùÎã½{á|Ig z•޲“C©\ê^Xë÷Ö—pÍrœ$ð̲,N A„x òü«†°øõNqrM·tîÓµöøtºì´Û[¹Îø>xª0øyB1ö—NkÞ_ºvu/.I{ÍJO›kòÚ+­ð¶£©êß4=OY´°°Õîl£’öÞÆð\Á¥FõŽQàlỌVõfèÚ>—áï iš‰co¦hú}ªZÙZ@»c‚$P¨Š=V•{ME_sóLdéO9RV‹n˲¾‹wÓÍú½Ïϯˆßò™½sþÉO†ÿôéâ:ûŸÃŸò-Áþ识>#ÊfõÏû%>ÿÓ§ˆëîÈ·û¢¨æ7¨¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š+Žñ¢ç“qŸ×cX>!µ7Z ±“´ÐÅß³S,_ðQ?Ú )I.<áv…OWÞø„9îù±çýñë_w׿Å¿xÇFø¿§|BøyâcÁ^9Ó"šÞÛVÓ’9<ÛyH2ÛO ªñO FØêvº+©VPÕåw_¿m{¦~ xmÀ=O‚àÿâ¨öNŠücÿ…ûûiÐûá¯ü"àÿâ¨ÿ…ûûiÐûá¯ü"àÿâ¨örŠücÿ…ûûiÐûá¯ü"àÿâ¨ÿ…ûûiÐûá¯ü"àÿâ¨örŠücÿ…ûûiÐûá¯ü"àÿâ¨ÿ…ûûiÐûá¯ü"àÿâ¨örŠü@ð¯í;ûgø›ÂÓêqøãÃ,z­ýŽÑàè?e¼šÔ¶wwòsŽÙÅtð¿m/ú|5ÿ„\üU~ÎQ_Œð¿m/ú|5ÿ„\üUð¿m/ú|5ÿ„\üU~ÎQ_Œð¿m/ú|5ÿ„\üUð¿m/ú|5ÿ„\üU~ÎT70Yé×wR¤ÐFÒM+œ**Œ’}€×ãPøûûiÿ#ð‹ƒÿŠ©ïµ¿Ú[ã7ƒï<ñ'â4óx#TˆÛkZV‰¡ÛéÇS·nÞi”DN>VXÙ7©ebUˆ ýû[Ëoûü"†xÚ9£ðv–®Œ0T‹8¿ESˆ—é_9|ðŸö‡ìíÒÝ Š(Õ4P@a_GjZ(¢€3õOùMþé¯Ï¿ÊRf?û5?ýEõÚýÔÆti¿Ý¯ÏÿBéÿCý˜¤ í>5ÔÇþZúí~‡ÑEQEÄ‹IH$„‚;q_™ú…§‰nÿaÍ.ÿWøƒñÄrøÓàVµ¬kßëH’][Ãc4$(Äê€yÈq&ó’M(¯'2ÊÖ/í[F¶º×}.¯uuèϸàÞ3yÜ•;Î2Ý'îFi+ò¶½éFz}¨GKÙ¯Ï[¯iãâ—‹—@øÑâ»ÿiž(ðý¯€|;¾×Qj–7:[ÊþFïôä™f¤•÷ù@yªP’_îï]jÖ_ |C{ Z ývßLž]:ØôšuŒiø°QøÓ4¯ i.¹â=FÆK­sQúƒ<…ƒL- µAû£Ê·ˆ`qORk:ÏÀ^°Ôíï-4Ùb¸ÃÄÆöv áÁrâ)PÁb!NqsÖWÕ][}Uïw¯’Ñhuqe™”°ü´åeî£.f¡$íìíh¹}¦Üç'fÙñ ¿4˜ü §ÿ`üqø…­éš„Aø•©Ë¨K*ø|\LâyDç'L™Üd·M‚Þ3戠fë|%6§ãÛøSKø›ã½Káü%šœ·c¯IöRÆ-6ÑÚ¿_ÞMWr\*ΜùE|ÆÁ5öþÄØË±v¶w ps×4ªª‘ª"…P0VQÉåzzvI®©Ûâ~î›wo[{§¯Šñ.„¡SÙaœ¹¬å(>Vãe=)GߎÑjÉCÝ·7¾~wØÿlŸ\ø¶÷Å(ÔõØ>é–æâêø˜æ?ÛsBÒ<`22Ĥ¶:–<5Òè~:¿io[]üPñ4Þ?Ô¾$êú‰|=þØ,ôØaÔÚÑ~Æ!@‘Z:KÃN»06}Ù^geð£Ã6­¼Vמ(Ônlﮯôëýn{‹+ ›Ë4ÐÂìB±Y$U+Èá"¹¡“W¤éòT½Ûw_o½í^=oèÙßrì],BÅá¹[„Ô9y^ôÜ# c¤­;+j“M8¥/>"ü@Ð5‹šþ¡ñÅ ðäž Óu/‡'Ã÷MöÕäóÜù²CÇö”€-š}™·(YAØ ïk íëŠ ©e%A#¡#¥-{8\4©99J÷wëݾ­÷·¢Kd­ùö}žáñô0ôhÑtÕ$Öñkh­-´ß+”®äœ¥&”nÓ(¢Šì>`(¢Šüúøÿ)›×?ì”øoÿNž#¯¹ü9ÿ"ÜîŠøsâO'üc_* ð§ÃyÿÁ§ˆëîO)_ ÁŸîŠÝ¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¦º #*Ý :ŠâõYjj|Èѳê+…›á•$¥¾Í>«^ÝExWü)í'þ}¡ÿ¾hÿ…=¤ÿÏ´?÷Í{­á_ð§´Ÿùö‡þù£þö“ÿ>Ðÿß5î´P…žÒçÚûæøSÚOüûCÿ|׺Ñ@ ~ο ´ÍCöh–ñíâ-'ŒüNrW°ñ¢è{—ü)í'þ}¡ÿ¾j§ìÁÏìs¥Iÿ=|E¯Ëÿ}ëwíýkè ð¯øSÚOüûCÿ|Ñÿ {IÿŸhïš÷Z(¿áOi?óíýóGü)í'þ}¡ÿ¾kÝh  ô x¶‹þù­Í7áž›c2²ÛÆ1þÍzÍ›a¦ÃcXÔ ´¨¢€ (¯.¸øµá›Yèþ‡Rø‰¨Í©Üé×-ᘖîÓLžÝ"y’öè0‚Õ”Mîäq#!ʶÐJ¹Í³tõðOí!á_…Þ'k øÇJÑø|#àÝ}u_ X^LønMè–Ú9<í…2›÷nÚyÅ~çbéÿóÁ?*ò€¶¶·ì5ðcU:ºx¤ÞxH¸þÚûÙ?´wØÂßhòp<¯3;ü¼|»±Ú€?0á…þÿÑ;ðgþ­ÿøŠ?á…þÿÑ;ðgþ­ÿøŠý–þÅÓÿç‚~TbéÿóÁ?*üiÿ†ø{ÿDïÁŸø"·ÿâ(ÿ†ø{ÿDïÁŸø"·ÿâ+ö[ûOÿž ùQý‹§ÿÏü¨ñ§þ_áïý¿àŠßÿˆ£þ_áïý¿àŠßÿˆ¯Ùoì]?þx'åGö.Ÿÿ<ò ÆŸøa‡¿ôNüÿ‚+þ"¬ÚþÃ…â—øqà§\òA·#ÿ@¯Øßì]?þx'åJ4ksä'å@|ý¼!ðÊúæo øCÃ~’ìGö×Ò´¸mMÆÍÛ<ÃÛw¾3ÓqÇS_oið}ŸMHñŒ |VVðýÈÀü*ØQEQEQEQEQEQEG$‚8‹Ô%óŸ¾*|@²ý¢|!ðÏáƒ|â½wYðþ«­ÜÏâOO£[ÚAa>›U0X]´’;jH@*€Û’H\êÿµ±9ÿ…Yû>û«š§ÿ3Ôô¥óWö·ímÿD·ö}ÿùªó=Gö·ímÿD·ö}ÿùªó=@JÑ_5k~ÖßôKgßü;š§ÿ3ÕÄ|IøµûPü(øâOˆºÿÀï„þ"ð_PÖ-ü9ñZê[èí"çš8îtkxßËŒ;•2©!H8öeãÿ ~0hŸìu8ÏSð‹‘i¯øsXb¿Ò® † *«2²²é,lñH„2;)Ízò²º‚§"€EPE ó,b5ólj>/xª÷ã÷Ã µñçŠtËX®uÛOY:V“¤$Û¼ˆçºX'vž@¬â¡‘–1½ö‹Ì¤uÚØž>~Ï£þêæ©ÿÌõ})E|Õý­û[Ñ-ýŸ?ðîjŸüÏQý­û[Ñ-ýŸ?ðîjŸüÏPÒ´WÍ_Úßµ·ýßÙóÿæ©ÿÌõÚßµ·ýßÙóÿæ©ÿÌõ}+E|Õý­û[Ñ-ýŸ?ðîjŸüÏQý­û[Ñ-ýŸ?ðîjŸüÏPÒ´WÍ_Úßµ·ýßÙóÿæ©ÿÌõÚßµ·ýßÙóÿæ©ÿÌõ}+E|Õý­û[Ñ-ýŸ?ðîjŸüÏQý­û[Ñ-ýŸ?ðîjŸüÏPÒ´WÍCWý­ÿ’Yû>ÿáÜÕ?ùž¢ÓâçÄ? üDðþñ£áî‹àëMzçìZ?ˆ<9âgÖ´§¼ ²ZO$¶¶³A,€7–Z²”Þ£Y>•¢ªÚÝ%ÔЃV¨¢Š(¢Š(¢Š­sr–ÖåÜ@h¯šïþ1øÛÄÿ¼Eá‚ÞÓüqqáé–ÛÄ潯>¢ÙÝ2,‚Í.ÚæYî7GuŠH÷¨wv„:¿ílOü’ÏÙ÷ÿæ©ÿÌõ}+E|Õý­û[Ñ-ýŸ?ðîjŸüÏQý­û[Ñ-ýŸ?ðîjŸüÏPÒ´WÍ_Úßµ·ýßÙóÿæ©ÿÌõÚßµ·ýßÙóÿæ©ÿÌõ}+_5þ×ëñ6?ø&ßÅOà÷‰µ üBÒ4cªé·Ö1«ÌËjëq<*[-$1ʃhÎX{‚ŸÚßµ·ýßÙóÿæ©ÿÌõ1õ?ÚÎX^9>~ÏRFêUѾ-ê„0=Aðr(áŸø$Gˆ~7øëöeñÿŒþ$øÓVÖ¼ º¸Ó<+¥ÝCªL¬÷7·¶!žá!¶–óQ×êø¯á~?üø¢ü8øsðKözð÷ƒôŸ7ì6#ã±1ŒË+Í!/'‡ÙØ—‘ÎXž¸èwÿÚßµ·ýßÙóÿæ©ÿÌõ}+E|Õý­û[Ñ-ýŸ?ðîjŸüÏQý­û[Ñ-ýŸ?ðîjŸüÏPÒ´WÍ_Úßµ·ýßÙóÿæ©ÿÌõÚßµ·ýßÙóÿæ©ÿÌõ}+E|Ô5ÚØù%Ÿ³ïþÍSÿ™êæ|Cñg㟄u Bñ÷ÃÿøßÄ“¾—¥ø×Gñ$Þ#Ò´ÍFDŤwpIkc0Èv!Fp±™¤pÕš®«¥è~¼Ö5½JÃGÒm"2ÝÞß\,0@ƒ«»± ª=IÅyU÷Äíg^‹V±øKàûjV¿ejÚÌ’éZ «pž`–+Û¥D*Íöhä\²¡emÛ¡ü0еÅÖüm©jŸuÙt¨,nÛ[—všÞT±OæE§ôXœÏ rù‚3 (ƒy +Øz òi¾ßx‹_¹»ø…ã-cÄöø„jz.§Òll£ˆ·Ùá™`“}æÜ†=Ú'uV G¥éš^™¢èvúf§Xé:l ¶ K;u††s…E’O½^¢€ (¢€ ( œ š(¯+ø—ñOIøqà¤Ôï-5=bþêò #GÒáÞê—“6Èm B@.Ç«3*"«;²"3?ÿíau Ïoð‡àŒN2°j?oÒá=aÐ¥Œ÷daï@JQ_5k~ÖßôKgÏü;š§ÿ3Ôk~ÖßôKgÏü;š§ÿ3Ôô­óWö·ímÿD·ö|ÿùªó=Gö·ímÿD·ö|ÿùªó=@Jד|¾þÔý…¾ jÛßð”ý¯ÀšDÿÛ_bû'öŽû[íN•æg——v;Wý­û[Ñ-ýŸ?ðîjŸüÏW)à[_ÛÂ|á][Àÿ³ï‰uMC´Óï5øZ•¯ö„°À‘½Ç’¾+öRû!w`ŠûŠù«û[ö¶ÿ¢[û>áÜÕ?ùž£û[ö¶ÿ¢[û>áÜÕ?ùž ¥h¯š¿µ¿koú%¿³çþÍSÿ™ê?µ¿koú%¿³çþÍSÿ™êúVŠù±u¯ÚÎ1¾O…%Eä¤?õ"ì=7‡Ôé–Üu®³á·Å‘ãIuÍ\Ð5xç@º[_xzþT’KGe߱ʄ¤öÒ§ÏËà «‘$=žŠE`Èt4´QEQEQEQEQEQEVV±!E‘‡`kV±5ÿùMþéþTñ·…5'¾ÿ‚ÅxJ'bD? |OÇTð×øWÜ•ð€?å3ÿ²QâOý:xr¾ý Š( ¼/ö¡• ÿ‚gþÑ3É‘ü1׳è4Û‚kÝ( Ï_‰ÿ?fj^ø‡ðóö ýŸü-ñ·ÃÖ)ma¨·ôå¶×­T1:V¢Reµgvdp ÛÈ|Èó™#“èÏ€ß4Œ4ÿèÒÄ¥¦–ÒþÑn£¸6wpHÑO’2QöH¬¡*ëµ”•`O¾:$‘4r"ÈŒ0Êà ¥|ðšÓKðü'ö§Ð|;§iº†ÿl®“NÓíRÞžoh³\J¥’Fv8Ë1f9$šýê2(ªÖæXFÞ¢¬Ð\_Œï͇%u$¦»Jó‰M Ï×îñ_ÙV÷ûOÅÿ´æ¢øy[â´Q=v'†t .}g8õcêkëŠøÇö79?´©ÿª¹ÿºÞ_gPEPE|•ã¯Ú3Æ:gí/ão†ÿ ~ø[Ǻ§ƒ´«MCZÓõ¦•«ê qJ±é–f—í,qºY C!«Eºý£>é¿tOk>(}ƺ‰²‰´»:à>æñÚÚ^\"5½­Ì â8f‘^C²2©µ5x÷·ÎöüÐKG¯¯åþh÷ +À4ÏÚ“à6¯kâ{›ˆ­a iZÅõüÚmÜ“XÚ°K›»Yä‰c½‚&eW’Ù¥U, HË,jŸ€Z‡Ãx¾?ˆ–Vžðíõ¥ž±y¨i×vb»e[IÍ´NXyW)9*ì"”]¯ýjì¾÷§®€Ý›O§é¿Ü}E|þ¿µÀæø9oã¤ñãèóëRè°Ù/‡5«½üJ^[Q¦}Ÿí¾rF ¬žFD¼?'ÍZÚoíðSZø“àhŸ4sÄ^/ÒcÕ¼;i¦E5×ÛlŸÍÛsº4eH³Š]Ê…`ªHgPK;ÛúÕ]}ë_MCÏ×ðvsÑùžÕER¯—ÿlþÉû­úàKkñÁÒFýÐÿÂQ¥) öʳ)ö$w¯¨+å?ÛOØ Q?õ ºðÍþ¿НÕ5­JÚäG†ì¤¹·±†öpTîG¼¼µ€.W†‘óˆÈ<ߎ¿hÏ韴¿¾ü5øoáoêžÒ­5 kOÔÐ~ø/X°ñ½äÖþ»Õ¾%˦Ý&Áïdûe°Ò¦ì)jÉ/ÌH‘Ù|{ø·ñGàïìçñ'AøWá/éz‡®uÛ^xæM2[K#Gm‹ ÅÉ J77“÷›å¶šWbŽ­%Ôú6Šù§Hý£ô= ÄÖ~øç'‚þüL»±“V·ðþ—¯Üëp¦”‘Èæþk£en°D¦ €í"„B‰—ÌŠAá¯Ú_àŸ‹ZÙ42Íq©ÙiÖðêZ5îŸ,²Þ‰~ÄÊ—0ÆÍ Ç“(Šp<© ŽÇŠ|®ö^KæÝ’õ¾–ï¦ânÉ7¢ßå½ý-¯¦§»Q^âÚOàŸƒ~Öº÷Ž ŽkmZëKžÞËM»½'´Hžì˜ ‰ßÉfˆÍ><¨·î§"›«þÒÿt?M¥j?t$»‹ÃñøÌ+,ñ :U ×›2äÈoÞ1 »˜QÌ­Í}?Í_ò×ÓQ½¾_;ÛóÓ×CÝ(¯oÚ‡àz|)O·‹ï—OmiôQ¦Ÿj?Û?oHü×µ:_ÙþÜ&X±1CDDI÷jÕÓh¿‚š×ÄŸxCDø¤ëž"ñ~“­áÛM2)®¾ÛdþnÛÑ£*E˜$RîT+RC:ƒVw·ËæÕí÷kè/êþIÙýÏGæ{U|O¯ê§Jÿ‚¿øâÞ#å¥×ÂÏ Jê¼q©x‘w}¡F}ÕöÅ|ãöÇüSÄ|ÿÍ'ðßþÂ;ßÛ‹K‰?³£—ìÂÝ–2¦iÍÜ *L³³2ÄŽÈá@=ÒŠùñÿj€©ðËNñgü'ÑËa{­\h°ØC¤^É«-ý²–¹µ“MXMäRƒ̕$…LQïµHcÝ| øeñwöoð¯Ä6Ñ,´ÝzÙîlãKƒ2´>k¤n¢T8Ê‚7cµzMQ@bkÿò›ýÓü«n±5ÿùMþéþTðï€?å3ÿ²QâOý:xr½ËÇ´Ç„<ñVð~£á‰:Çö0Ó¤ñµ£è«q§h°_ÈÑÛÏ<†Ub›Ô†$Ž£ç+°àùLLJÿì”x“ÿNž¯¡¼aðSþ±ñþ*o°Âsg¦ÛÿÈ;ÌûØ÷|ß뙿wO—n;ÑÕ>k;nxï‡?lÈuëš±ðgâšx x÷\ðdžt}"ÒÞæmmtµW’ui'Ž8r“æ: <9÷8þ=|:Øøüp7š´~ ¶è_L”jån ¡±û.<ϵý¤$ Æ_”WËÞ&ýŸ¾6øöÔð>½ð¿Æú ¾•?‹¼QâIu=[ÁæúßH­¸k+¤[ø^ád•KE$>QËÂKz‚þÌzÉý‘døM/Å’ÙáþÕmTxr19ñ1Ö²Ú±_7i€Ý~ÆxØ6ù§­(ÝÒ\ߣ÷òûßù5Òó·ÙÔÕòûWü¼Ò·øyŸ/Ý?KßÞÐÑÿ†«Ð~Ç—ÿ £ãHø™6§-ŒŽh5¶AÌ—!Íר¾Ì±O ¾Õ·t‹|Ò#¬-_öÚøY§é)¥xWâÇ‹,¡ðñ^³6‘á®4=5nn-n%¼ÉŠH%´¸Y ¦ýÓìI6°^|ø×uñ@ø'ÇO ]|^Òn¯£µšëÀ’?‡aÓo-íb–Æ+~'CæYÁqç¶c'˜ØÁ ~ÉQx_Á_tÁñ óU¾ñÃi<+©ê::+µì÷ºµõÖ¦U$ |ÉõiX@…˜ÙÈšŽJ Ç~ßöëÓç+'êí¦£¢ ä”Ý—åï$ßÊ7iu믺w ~-ø·âGíYñ×Ã÷>}#À Ô,4Íö];dºŒ²ØÁy4Æo´6T­Ì%#òQ‹³;$#KñWáÃïø*gí/mãψþðEÄþ1Ó&†-ÄÖ"Â1¡®õ:’¹dqkï?†ß ?á^ëÿo¿¶¿µÿá'Öm5Ÿcò~Ëäi6vÌïmû¾ÃægåÇ™·næùÂßò“ÿÚ{þÇm3ÿQ} ·¨ ¬¢î¬¾ûkø˜C™«ËwøyýaûWþËi¦F¯ûJ|V£|BÓÿÑõwþÇöXÿ£–ýŸÿðáéü~½ÇNÿTJ½Y–|á«~×ß²î™á]OR‡ö‰ø©Kii$éimñLin )a?,ØÀ¦¾ð‡üWöuø½á(ô¯®±ð{Ån$¶ÖGÚ´æõXï"_º1÷æŽ_®ú¶™k­xWSѯƒµ•ý¤–×k‘J6c‚y¯Ïß ~Áÿ³'ÀÇsá/‡¶š÷‰aŒâ?0ÔoÝפ‹¹DP¿'˜cŽ€=ö3t’ÚFHÙ^6ø´YNAÃZ¯´kãØÛîþÒŸöVÿ÷[Ð+ìú(¯Ÿ¾#üjÖüñ Äú6ðîãÅv~ðœ^&×oƳ¨†Í¥¹FH£(Í,ûmduO•[C·w8Ÿü{oñÅ1ø{a®K/¢ðß…aµÖÄ;•ôeÔ¼Û§hÎÄTc2†`%*¨ídóµ°ÞÑÁ7u§ÂûÛ¶º¦´¾¨ûL'‡ùÖ'«ÂåqçW©M>_wVœ¯)ÆOšÞî»wñ÷à/ÄŠ>6ñÅ…ÿïÙßãOƒõ»DO ^xñ¤Óõ?9¶XfX Þæ&‘MÊ‘,+Èé»hB²ø/à_ÇO‡>"Ô|/£k? ü_àï뺵âx™®%ÖbšÃNÓ¬®, /òLtØ¥Žáî‘¡i¶;F¥þ«ø}ãükà9uíçÃzÍž¡q§jºd³ …½Ìä IÀd}«¹YIU9Î5ÏŽ‘é?µ„_ "ÐtÉdIí#¸{ÏÁe2Ü¡a=•œª>×X"VY—k…G*AßëÔiSŒ¹¬ªZÛëö—¦×oFíï6y˜~Í1xÊØjtï:”¤¹£h¥e)]»>–³ißÝZŸÇû~Ðz¯…õ‹Oêž ¿Öµ?…ž ðV§­j?uÍT^Üj k"jÙÏköm>-¨V²µETY3¾O-#¯¦þ!þÏ~*ñ‡í7â/XêƒC¿ŸÀOµÄ²‰U|?¯]jWa”DToŠdX°Ç.6ÀÇLøé¯êïwk;&å³ÒM;žñ öPø‰«þÓ"ø©¡ßiZµÔ¾:½Õl4(> ë>iìo4=#OrúŽ›šˆçÓ ÂÉÅ! C·Ô?goÙãÄŸ¾$&¹¬ÝxNHeø{a¢ÜC¤Ý_NSP]WUÔnÙ^ñ¤šH‹j²JÒHÈÌÊœ êázxÆëYðÿ†t„æûÇwçXKÍ:_E“i²[¤öŸ(³Ç'ÚcØÂ Ùe Š7ä5ßÛÂ>›¤êI²†Éü3câ VßWñ®j̱YÛIÍíÂ*3:+ ¨Vg`•Íý½‚§yÙ.[]4­ÉeÒÏÝwo§[T<1â\[P£‡Sr¿Ã:oþ^=t›²s‹Qz)ÛÝæÑŸbÑ^eá/ˆ7Þ(ñ_£ M¥xcÃ÷²YÅ­K|¯ý¡$aYÌpªî‡ÌOÞÈã5‘ðÏâg‰|~Ú^£ðãQðÇ…u½kÕ›SŽçÍš=‘ÝFª>Ípé*H±†•JîùÃ)Zë§¥QÅE¿{U£Û»ÓDí¥í~—<¼1˜Ò…YÎ)*j.^ü>ÒrI.kÊVM¸ÆòŸ2G²WÉ?·õŽ—ÿæ×u=Nò×NÓm”Îîì@UP $œ 5õµ|§ûjÉ€ê?ö;øCÿR&ºŸ-~Íÿþx÷EÔ´ÿüCð'5 #’òÛC×­¯¥¶F$u‰Ø $ $W1ñsÆ´×…j‡¾ð—‹>ZxWÆÚÅõ¦œú炵+‹­.+]:kÒóI©LXÀWåHÀ 8çØ> º¯ƒ™Y€,‹ëÖµ¼uðÆ|cø[â¹õw±‹Á×÷÷-d¶ÛþÜ.ôùìŠoÜ<½¢rùÃgn03š™^Í­ìÊ‹[3æ½wöÏÓ"ý–|OâÃ^!²ñü>Ô ð,v^k[‹;[ËxíÆ æíÅäñÛÄ‘)m娮Yv3Äß°Þ‹y£Ã:Ïcð.‘â÷ñ'ƒ< âϦ· hÒ\ÚÍ¡höÆæ!-¤)¹†40›y·gF½]6Ÿ/»î·è½Û»+«ö؈+/êÛ}ïÞ²ÖÚ_^§¡ê¶/ÃÈ|/¤ê:ƒ>-xÎ{½PÕnôÝá¯4¨t뿱ê u²ÇåKo0dhòYÊ‘à§Oý¦<­|t‡Áš†>"x†Ãí6—ž)ÓtU›KÓîo­#¼µ†à >Óx&…ŒÞG†EW•[*0>~ÌvŸ¼—iâ- x+QÐ.cÑü'm¤Ù ¯¯îIáµ·eH¢Fb‰ÌÛBï™Ûs· 'ì}ªKûBx ŲøçÁiá›k}R?­¿ŠcN†ÚÂZ¤Å…ÃBÍ$3Ã;m¸™ᔦtlä”ôÕ_ÓšIýÑQk­ß[X‰9'+.Žßt-÷·4úY-·>ŒøåñsÃßÿe/üPñÖŒèZ-ÕÝŽ£«G`5k¸ ’Xlc•ÁýôÌ‚4]‰nó;Dÿ‚œ~Íß|š~§¨jŸ üS,aZÃıjÎW'Ë»1ì7Kåé_«_¼¥|Jøã‡Zìú…®‡â¯ÞhšŒÖ2*\GÔ2²‡ !*YXŒ‚8¯…l¿cÙÇö}ð@“áïÃ+ûvÁ:þ±›ýEœ.7¬²çÊ$u„SéRh{oìWÿ&§ØïâÿýJujú²¾SýŠÿäÀtïûü_ÿ©N­_VPEyÿÄÿ?ß„^)‡A¼ñ=Ê_ÙY[é–· ·2Ý]ÃjŠ®øPwL§æ qÉkÈãGÄþ(xCÃ_ð€i> ,éuŸxšÛÁÖz>¥â êâÚçâ>·â»ës¤MtÒ#ÝêVþdÌâu‘1"0Ø#2¿ÑS|jñ£]É£iÿon|_¥iOªxŸI¸×£líÅÄðGöYLd]¼ÆÚgˆ‰J(.ñ s ý£n5?]^è_ï5?‡öz¾ayâ6ÕãŽCý« œ–ï¶ÂÎßAæt ­¹KT/í¼:šŸ3Þ?eÛIs.›)G^‰¦µ;!áÆyR”©F”ZIß÷”¯irÁ}½çuìúÔNðæZžâÙc⯊?hO‹Oß<â«ÝiõÍ_þ0Õ$½®¡§\ZÆ’ø~xÚÊ äyaw¾†ui<‚v9Ôrú'ìuñFëAÛâðV•¨éöÓ,%ŸâO‰[¥t›G¬Q_#ÅûCx¯Cø=k®xÏÃ>Òµ ¯ëštsê^6ƒLÓ£ŠÂòXU ÒÆ]îc""FÂO%¤c`¡’þÐ~)Šû_ñ®™à«Ï|4´ðâ«Ä“Q‚ÖëK¶¹KÉgòÓaûDÞ\HÆ3"®#8`X…œaœov¶oG¥Ójúi¢×·Sµx_ĞТÜSö´¤¦©ò§Íkó=­{iwdþ»¢¼ÏÇ>ÔøgãoŽþ·ÄÓÔtµ¹µÕo¤ƒìöÓÌY¶í$¹"2¹åFÊù`7”i¿²Ïˆ~ê÷×_¾([ü2Ò­üU6µáï ¿‡ä¸ðõ¤7VP[ÞXÜYÅuž&šµDÈÑ4HøÜ˜ßU/_¹­>w“o]V¾õ'¢åóüSûíhÚöÖúØàüCñËö…Oø'¾6x7Æ_³‰­|i«ÞMªi:}Þ±¦xªÚÖ$– mŒ’ 8–)`•® ºä6Þ¿dü9‹â<|QÖü¯xŠYÌ‘\x[D¹Ó-‰µ WW\6ü·˜~Q‚O‚Ú~ÌWÓ~ÇŸ´ÃÝwÇT¾,ø»-ýÆ»­é:uŒ÷6Ø©¶°ûC‰³žI7±q» õ…¼^E„nß審»Î3[6’ói}ö×ñíeÙ%¡“Z¯Y}×Óð¾÷}õ<_Xý¦?fÿx³RÐ|Aû@üÐõÍ:éíu ;PñÖosi4lUâ–7˜2:° «A_üYÿ‚§þÏŸ ¿jæøqrÃÆÞ —J·¸Ç> Ömu‹D¸•œI ‘ÆØ „%’Gr\,`ýD¯þ.~Ä?³çÅÿÚ²OŸ|5©xÇÄ‘é6öi—š‹¦™¤e—Ék;ûX;´d*ü€äœË>uð¯Å¯‡_¿nïÙwÆ ¼Saâ¿·Žõ8ZâÝ^6ŠAámqŒrG"«Æøe;YAÁ½~©W漞ðç„à¡ß²¶ƒáMEð·mãMMmôý*Ê;[x‡ü"úïÝŽ0~¿J(â?‰?² ?>&|kñ7ÄŸx‹Nºñ…àøü/âÍBÊ -6ÞßÌ„ÞÁGÄ¢þk©öH² _,¸¯ˆ¿³ÿÇO‰¼Ñþ%ü?ý—þ8ϪøvÒ ]KÄÓÏg?ƒ5°ÇïØ¥N’k«gê2^ÞUi] mWô=Ûd.øÎÕ'µñ­ÿí/ã{¯ÙÚÿźÂø¼?q©ü>¾ñW„æ¿×Rá%ŽÐCç„HÇ—…¸ŽXÐ;Tc tó±˜ì><µ/ªÙ&ö¿U³mîšmÚÇÓðï æ™ÕKàâ›RQ»”cg=V’iÉ%ôRQŠm«„ß¼Lž&ý—nfñ5¿ˆÃ45íOQyެϣM§ùÊ0ù‘åHÛß¡?3½‡Ç¿k¿bŠÿ ¼?s¦Ùëž'ð¥ö“a>¡#¥´sOÆ#"³†J«t¸¹þ8øžÇÅZÜ7¿ çðæ­§é~(Õ­õÔ”ÛOyoi(6Ј¸Žv‚Vc ¡Îå_}Ö5[ Âz¦·©Ì-ôÝ>ÒK«¹OðGvü&ºç˜Ó¬çRRÚíénîý4ßm,g ãòÏa^ú\–”g}"Ò÷\¬í(»;;I;j|áã/ƒ~?Õ~.|`ño„¼Iáÿj¾$ø=iáßÍM.Ÿ©A6§/Ú$£*aÍärÄ”l§wÏ^ý“þ+˦üZmhx[BÔ¼Ká<=yuñ+\ñmÖ•¯h··–2\j0+µ»M2HÑÅå¬b"‹ùŒõôª|oñœ³»Õþê:mî¼-?á·ärG¨ÉtÌ ©<±öI’1çJ L0ÅB¥iñ|pñEÞ°¾°ø`ÓüC‡[¹Òu)üCY[I œ7‹8»ò‰{y"¸‹ å 6 cšãþÔÃÂï™®›Jé¹7m¯Íy^ÛìíesÙ|;¯g–ÿ½¥kEFí¾{r¥Oe+Áµ+£æÝöDø‡c£ü-×¼;u£xŸÆúo†5{D¿uÏÅy©ê·±jWwñÞéjÓËÚÄßè’¨VGŒ†Fk»³ý–u¿þË?¼¤Ø|3שàÏhZu†¤ú„6KŒ¬±Hë#Ý[#o"Tši fY>fL6ÍÇÆ¿ëŸa½´°Ô|)àȼk«Mn—Vs\ ËCì¥ZÝ嘤PQÕpKĨ_MÓ¾6ê:‡Ä¿Y_Úø;^ñMç‡t}~]R/2k‹D»id{m»’&6sÛq,,±ü¡•,ãUrÆé7¦š|rZo§3z½5Kee¾7ÃŒë £Zj2qM¿~7V3M¶“Ÿ,y¹`Û²n×¹ò;þÊ.O†¼Y¨êÿÚš¦…âJ]#Á“|kñe§^ÙYÂÑÿÂKºjJ“ÚU%…ÐG3Eœ"0÷ÙÛöxñ'Áï‰ ®k7^’~Øh·é7WÓ”ÔUÕu¶W¼i&’"Ú‚,’´’232§½_ƼC£|SÕ|1á‡ZŽ¥Ðô‹mW_x5$¶’(.$™"ŠÖ6V77[ÌþY1® å˜-{GQšï£‰ŒÛQ{?>‰Çw¾îï]O—Çå¬% s®’U×½íxÍ7Ü£{Å®eh»«îù£ñ»â€<ÿ‹Õ¦ñߎ<à¨nþx{쯯k0X¬û5OoØeuÝ·rç7 õú]_üAÿ”Êx‹þÉ?†ÿôéâ:ÐóOdÐjÏÙv“~Ò?âp£*ÿtÀGç=mÿÃXþËôrß³ÿþ=/ÿ×°øsþE¸?ݽ@”ÿ ¿à®ÿ³_Š~"êÞøo¯|.¹¶Ôî-m5iGöž•wLÑÅ žÝw¡‘B¹-‹»ýcº¿Qt]kHñ'ƒtŸh•–³¡j–Q^麅œÂX.íå@ñËŽYX0à‚ |wðßþ ëû)ü7ø‰ªø¾†Öž5ñMþ¥=ój>/j~CK)—lp¸(F8FòüÀË“Í}©qÃoQF‘DŠ  p  ‡|%ðkö”ðÁ8>ø3Å_´/…ÖËÇ¢üC‡Qœø£OÐÚsqö?ìö³kW¼PÍj·fä)M³L€©uìùñJOxG»ü>_…Þø«­xÿL×­õK‡Öoä¾›T¹ŠÊK&µÁåͪº´éråã€b42ŸqÑ@뿲ŸÄOöBð'ÃÛmoÁÑêÚ/ìì|/º¸’êà@ú¥å¾‹s¡–6 éÓ–b€4xŒå¶ó_´üý³o¾=[Üx6üë~'ÖÚÊËYƒV]=,o4/ Û±¸¾²±º6wks ~î6…Òâ9YD”ª×oûB|}ø‹ðwþ ðøXÉk¨|Óü â‰zbéÍ=彊_ÙÙNÜÅHM¡ºI¥Lí6ËpB³„+æþ$|r¼ÿ‚~þÑÎIM¸Û=¸w‹|R.X|Gñá¯íð“áÆ­ûDüx]#Uð¿ˆumC\ð×ÃM7^Ö/n-®ôˆí¢’ÞÏEb·Hîîs"Û¦X w$¨?K~ÎÚïÄ?~È>Õþ)C©'Œ$šö)'Ô´Oì‹ËÛHïgŠÊîâËþ]gžÕ-æ’<Œ6¦6(ÌÞý>3|:øáß‹>Òþj9®¸5¿ k¿}ý¾ïí)ÿeoÿu½¾Ï¯‹?c©¡Mgö–ÓšD£â„wfüÂ<=¢ÆBðL£Ý }§@s¯ü1Ð Úööòy^Yæs*|ÌÜUQÐ( ÅÕþ ÿÂ[ãmoÅ>-ñ)µmNÏT½ðÕ¤ðË¥½Õ£ÆÐIM \@¹†"é ±«•$ƒ¹÷{urÀÑ”T¼U¬ºi²ôòØŠ|U˜S¯,E9%VW¼ì¹Ýï­ìïfšI¦“MXùÛþ¿Ãmàéü;?Œþ ]xz O²øM–òØÁ F.b¹An¢æùo*Ÿió¶¢lèÍ»£Ð¾ éšGŠ/õ«ïxÓÄš¥î¯e«]Í©Ih<Ë«Hž`°Ûƨ­"”P÷jT).[Ù¨¨†Y†Œ£% U­¿MWÝÐè¯ÆùÝZs§:í©^úG«Mëk®g)[â’æ•Þ§œiß ô 3ã· »ÖU‡ûOdRK„ÿhIk$Ù|¦Ò=Ÿ7Ÿ;²1ÃGû<ø~ËO°±ÐügñÚzèÖZF­›{okÖ›„"i HŸkº-š*ØÈ‘ôO.Ã4—&Û}Öü•½z]œQø+½’èÕ“rZ4Ö’“’í/yj“\E¿lläqi«ëÖÖók×½íºM—xÓDñ½¼£fL8p †ÜˆK<÷€~XxWµš×ž5×ìtí'û'BÓ5kÈZ×H³ÞŒ!‰b‰Bq(’v’@±¨ ËnõŠ+Há(ÆQ’ZÇoºß‘Íþ°æÆ¥/iîÎ×ÑkkõµÓ³jë[7‚¾Sýµ?äÀuûü!ÿ©N“_VWÉß¶¬ð¯ì*ÖM*-Õï<'¤dàÊÉâ-:wÔˆ¡•þˆk¤ñNûáü‹Pÿ»^ç^#ð1á¸r1ò×·PEPEP^ñ‡þEKŸúækÝkÃþ/F[·8ù p±_ü˜ÿc¿‹ÿõ)Õ«êÊù+ö(½µ—ö!¸Ò¢PÒ|â¨5ù­ä—_¿»[Ý ¹‚AþÌ‹_ZÐ-ãé¾7ðtZ&«5õ½¤z¥Ž¢ÑÕ\Égw ÜC,¬6—…C d© pG'«|&Ñõ/ŸÁ¬ø‹MÖŠañµ´°ì3ǧgHx›÷2[–V.JºœcÕh®Zø*5~8ÿKcÖÀç¸ü?gF«Q÷´ÒÖ—/2iî¥Ë÷±óG¿‚߀~x îÿŧ‰|eáß E¥iöÅÔO¦i-"Áöµ€ÃHêLAQ¥.UT(Ú ®ÿÄ>ñެ4øT­vÛI|<­¹6š|ÜÒr»“¿Ï×_³Þ—$%ì>"|LÒ5;Ý2m7Ä:µý³\ë°K<³°¤„L¯<ûÜBcYYW(^¢ßàÏ„,ü=â-*ÆMZËNÕõ­/T’fM¶Ï§%ŒvñE”8‹m„!ƒnc—à ¾³E8åØh¦”4ÿ‡ÿ7ómîÌëqžuVÜØ‡£¿Eª’’½–¶q-ïÊ’JËCÀüUð;F¼øm©ZéBÿTÕRß\m>ÚûSû,O>©|—òîš(‹ÄRxÓÊu !ÈÍ`ü.øQã]?â<]ãxÆßR×.4ºÖ-n¯|­=¥s´vé¦VCqä¨g.S·éª*[AWö©Yé馉ýÚzpã¼Ù`*àå%%Qݶ¯%yÆ£Jú%)ÅJZjÒ¾‰ÿ4¨üK­¥øïÇú%ô:†­q –²Ù1Š Râ;«»D2[1HÌÑïWÎMì˜À©û2x~==/ˆ£Ð%ðÕŸ†õ}-.l–[M´i¼˜&aj$_’g‰ž'Ù É,~•¢ˆåXU´ÚÝûinºßvM>>Ï¡,GþKüNIß–÷RnIî¥ï-u<³Ä_ mõíBßRƒÆ>2ÐuË-Mït}JÂkc&–’[¥¼¶°¤°QëÒXøÏU´—KñŸ‚î´;ÈÚßQ†). I ‚® ŽT‘É®òŠÆž]Fq[=ï­üúylzy‡ãñ®¿+äQQ´RååŒcuk{ÍF7{û±[$—ÏðþÏzBèëßĉší”V‘xvþëR€Í ­¤…áû8X;sµÞu•å@Ù‡ÕxWá&á[믭øÄ$þѺÔ/õ]NXLº…ÅÄ1[³H±Äˆª‘A"F¨ªpNIõj*¡€ÃÁÝG_Ÿ{ß×E®î˰b¸Ç9ÄS•:•Ý¥{è–Y­÷^î+G/y®mOà‡„âµ¸‰oüBDÚ,K/kiaiðÏÖw;N|©…þ½1Cè|¹âo£ŠØòϸü9ÿ"ÜîŠÞ¬? xn÷EnPEPEP_ü0ðÖ§ûJÙüR¾7×:å¿„nü/ö)6±šÎêæÞâ]ñ”,ϺÙÛv³§ ðçì‡ð£Â°?Œ?fïÏ∞!¹¾–Xÿ´K«$»›Íh`•ã88Dó¾Ñó3¶XýIEqWžÒ/h¿üM–çR]{Fðæ£¡ZÛ¤ˆ-žÞúâÂâVuÛ¸ÈO„) &U‰R½­PEPEPYš´FmDÁ­:k xÊž”ùµñ‹Á>;Óþ8i¿þxãÄÞñfŸ¤ÞéKw¥Yi÷"{[¹m&–9öÖtûöPʆΠà7~=ý³á¼d‹ö…ñ¹@x-á?gÿMuúëªøNÏR'Ì>¢¹)>iO!coÝ ÊïøX_¶Ÿý'ð“ðçÿ*èÿ……ûiÿÑÂx×ÿ ?ò®¿S¿áTé?óïýóGü*'þ}âÿ¾hòÇþí§ÿG ã_ü$ü9ÿʺ?áa~Úôpž5ÿÂOßü«¯ÔïøU:OüûÅÿ|Ñÿ §IÿŸx¿ïšüÀÓ¼sûf]_¬sþÐÞ9XÉä§…<8ë¥×Óß<âM;Æ^)ñW‹|M¯xÏÅž&ÕcÔµWU·´†IeŽÎÚÉc´‚•VHFdI$šúš…ÚTR†ñd³]¦•á»]5@qè(vÉ iÑ©ì*Õ TK@r^-ÓÍÿ‡åŒ.I\W[QÉËF€?,~$ü<ñdžþ2O㯆¾*ñ7€|ZÖßeŸQÑš".à ]"ž ã’ ÕX³'™,ûHá¼¢o~ÚQÎÊ¿´/JƒÁ>ðçÿ*ëõãTð…Ž¢I’$lõÈ®NO…šS9?g‹Ÿöhò»þí§ÿG ã_ü$ü9ÿʺ?áa~Úôpž5ÿÂOßü«¯ÔïøU:OüûÅÿ|Ñÿ §IÿŸx¿ïšü±ÿ……ûiÿÑÂx×ÿ ?ò®øX_¶Ÿý'ð“ðçÿ*ëõ;þN“ÿ>ñß4©ÒçÞ/ûæ€?,áa~Úôpž5ÿÂOßü«£þí§ÿG ã_ü$ü9ÿʺýNÿ…S¤ÿϼ_÷ÍðªtŸù÷‹þù ËøX_¶Ÿý'ð“ðçÿ*èÿ……ûiÿÑÂx×ÿ ?ò®¿S¿áTé?óïýóGü*'þ}âÿ¾hòÇþí§ÿG ã_ü$ü9ÿʺ?áa~Úôpž5ÿÂOßü«¯ÔïøU:OüûÅÿ|Ñÿ §IÿŸx¿ïšü³Oˆ¶›Hý¡ñß4ùcÿ öÓÿ£„ñ¯þ~ÿå]ð°¿m?ú8Oÿá'áÏþU×êwü*'þ}âÿ¾hÿ…S¤ÿϼ_÷Í~XÿÂÂý´ÿèáñß4ùfŸm6ûBx×ö)øsÿ•uÛøsÁ¿¾$|BðÖ³ñƒÇþ-ø.‰tnt‹}R ;[K9Ù fu·³‚š`Œè$ufUw FöÏèºü+ÒCôx¿ïšè´Ïéú{†H‘HôOÀCiº(Ë‚W¤TöñÛÂTôQEQET)æXȘÎEOGjøoãÿÂè¼eá;›ˆ't.²Ç$<3C"8xåŽD!ã‘UÕÔ†VPA_$ßø£öÁÑ Xi?´'ÄeÙÝh Ô˜Þ–m9äsîÌO½~Àj:-µüEdElúŠá®¾éw—h"$û ü¤ÿ……ûiÿÑÂx×ÿ ?ò®øX_¶Ÿý'ð“ðçÿ*ëõ;þV“Ÿø÷‹þù£þN“ÿ>ñß4ùcÿ öÓÿ£„ñ¯þ~ÿå]ð°¿m?ú8Oÿá'áÏþU×êwü*'þ}âÿ¾hÿ…S¤ÿϼ_÷Í~XÿÂÂý´ÿèáñß4ùaã_Û.úäAuûBxçÈ•Ä~ðôlAë†]0õØŠúKà7Â˽ûQÕuKV×u[³{«êÚ”í=Þ¡pʪešFå›jªÂª¢ª…UU[[ü0Ò¡”8·‹ úWm¦xzÓNŒÑW‚€4´Ø|&(ñŒ ¿H è)h¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(ÿÙntp-4.2.6p5/html/ntp_conf.html0000644000175000017500000004277411307651604015272 0ustar peterpeter Configuration File Definition (Advanced)

Configuration File Definition (Advanced)

giffrom Pogo, Walt Kelly

Racoon is shooting configuration bugs.

Last update: 02:20 UTC Monday, March 03, 2008



Table of Contents

Synopsis

The NTP configuration process is driven by a phrase-structure grammar which is used to specify the format of the configuration commands and the actions needed to build an abstract syntax tree (AST). The grammar is fed to a parser generator (Bison) which produces a parser for the configuration file.

The generated parser is used to parse an NTP configuration file and check it for syntax and semantic errors. The result of the parse is an AST, which contains a representation of the various commands and options. This AST is then traversed to set up the NTP daemon to the correct configuration.

This document is intended for developers who wish to modify the configuration code and/or add configuration commands and options. It contains a description of the files used in the configuration process as well as guidelines on how to construct them.

Files

A brief description of the files used by the configuration code is given below:

File Description
ntp_config.y This file is a Bison source file that contains the phrase-structure grammar and the actions that need to be performed to generate an AST.
ntp_config.c This file contains the major chunk of the configuration code. It contains all the functions that are called for building the AST as well as the functions that are needed for traversing the AST.
ntp_config.h This file is the header file for ntp_config.c. It mainly contains the structure definitions needed to build the AST.
ntp_scanner.c This file contains the code for a simple lexical analyzer. This file is directly included into the ntp_config.c file since this code is only used by the configuration code. The most important function in this file is yylex, which is called by the generated parser to get the next token on the input line.
ntp_data_structures.c This file contains a generic implementation of a priority queue and a simple queue. This code can be used to create a queue for any structure.
ntp_data_structures.h This header file contains the structure declarations and function prototypes needed to use the data structures defined in ntp_data_structures.c. This file forms the public interface of the data structures.
ntp_config.tab.c This file is generated by Bison from the ntp_config.y file. This file is also included directly into the configuration code.

High-Level Description

A high-level description of the configuration process showing where all the files fit in is given below:

JPEG

The scanner reads in an NTP configuration file and converts it into tokens. The Bison generated parser reads these tokens and converts them into an AST. The AST traverser consists of a set of functions that configure parts of NTP on the basis of what is on the tree. A more detailed description of these parts and the files used is given below:

Detailed Description

ntp_scanner.c
This file contains the scanner. The scanner is a small program that converts an input NTP configuration file into a set of tokens that correspond to lexemes in the input. Lexemes are strings in the input, delimited by whitespace and/or special characters. Tokens are basically unique integers that represent these lexemes. A different token is generated for each reserved word and special character in the input. There are two main functions in the public interface of this file:
int yylex()
This function is called yylex for historical reasons; lex is a program that takes a set of regular expressions and generates a scanner that returns tokens corresponding to those regular expressions. The name of the generated function is called yylex. We aren't using lex because it requires linking against an external library and we didn't want to increase the compile-time requirements of NTP.
History lessons aside, this function basically checks to see if the next input character is a special character as defined in the array char special_char[]. (The function int is_special(char ch), can be used for this.) If yes, the special character is returned as the token. If not, a set of characters is read until the next whitespace or special character is encountered. This set of characters forms the lexeme; yylex then checks whether this lexeme is an integer, a double, an IP address or a reserved word. If yes, the corresponding token is returned. If not, a token for a string is returned as the default token.
struct state *create_keyword_scanner(struct key_tok *keyword_list)
This function takes a list of (keyword, token) pairs and converts them into a trie that can recognize the keywords (reserved words). Every time the scanner reads a lexeme, it compares it against the list of reserved words. If it finds a match, it returns the corresponding token for that keyword.
ntp_data_structures.c
This file contains an implementation of a generic priority queue and FIFO queue. By generic, we mean that these queues can hold element of any type (integers, user-defined structs, etc.), provided that these elements are allocated on the heap using the function void *get_node(size_t size). Note that the prototype for this function is exactly the same as that of malloc and that it can be used in the exact same way. Behind the scenes, get_node calls malloc to allocate size plus some extra memory needed for bookkeeping. The allocated memory can be freed using the function void free_node (void *my_node). In addition to these two functions, the public interface of this file contains the following functions:
queue *create_priority_queue(int (*get_order)(void *, void*))
This function creates a priority queue in which the order of the elements is determined by the get_order function that is passed as input to the priority queue. The get_order function should return positive if the priority of the first element is less than the priority of the second element.
queue *create_queue(void)
This function creates a FIFO queue. It basically calls the create_priority_queue function with the get_fifo_order function as its argument.
void destroy_queue(queue *my_queue)
This function deletes my_queue and frees up all the memory allocated to it an its elements.
int empty(queue *my_queue)
This function checks to see if my_queue is empty. Returns true if my_queue does not have any elements, else it returns false.
queue *enqueue(queue *my_queue, void *my_node)
This function adds an element, my_node, to a queue, my_queue. my_node must be allocated on the heap using the get_node function instead of malloc.
void *dequeue(queue *my_queue)
This function returns the element at the front of the queue. This element will be element with the highest priority.
int get_no_of_elements(queue *my_queue)
This function returns the number of elements in my_queue.
void append_queue(queue *q1, queue *q2)
This function adds all the elements of q2 to q1. The queue q2 is destroyed in the process.
ntp_config.y
This file is structured as a standard Bison file and consists of three main parts, separated by %%:
  1. The prologue and bison declarations: This section contains a list of the terminal symbols, the non-terminal symbols and the types of these symbols.
  2. The rules section: This section contains a description of the actual phrase-structure rules that are used to parse the configuration commands. Each rule consists of a left-hand side (LHS), a right-hand side (RHS) and an optional action. As is standard with phrase-structure grammars, the LHS consists of a single non-terminal symbol. The RHS can contain both terminal and non-terminal symbols, while the optional action can consist of any arbitrary C code.
  3. The epilogue: This section is left empty on purpose. It is traditionally used to code the support functions needed to build the ASTs Since, we have moved all the support functions to ntp_config.c, this section is left empty.

Prologue and Bison Declarations

All the terminal symbols (also known as tokens) have to be declared in the prologue section. Note that terminals and non-terminals may have values associated with them and these values have types. (More on this later). An unnamed union has to be declared with all the possible types at the start of the prologue section. For example, we declare the following union at the start of the ntp_config.y file:

%union {
    char *String;
    double Double;
    int Integer;
    void *VoidPtr;
    queue *Queue;
    struct attr_val *Attr_val;
    struct address_node *Address_node;
    struct setvar_node *Set_var;
    /* Simulation types */
    server_info *Sim_server;
    script_info *Sim_script;
}

Some tokens may not have any types. For example, tokens that correspond to reserved words do not usually have types as they simply indicate that a reserved word has been read in the input file. Such tokens have to be declared as follows:

%token T_Discard
%token T_Dispersion

Other tokens do have types. For example, a T_Double token is returned by the scanner whenever it sees a floating-point double in the configuration file. The value associated with the token is the actual number that was read in the configuration file and its type (after conversion) is double. Hence, the token T_Double will have to be declared as follows in the prologue of ntp_config.y file:

%token <Double> T_Double

Note that the declaration given in the angled brackets is not double but Double, which is the name of the variable given in the %union {} declaration above.

Finally, non-terminal symbols may also have values associated with them, which have types. This is because Bison allows non-terminal symbols to have actions associated with them. Actions may be thought of as small functions which get executed whenever the RHS of a non-terminal is detected. The return values of these functions are the values associated with the non-terminals. The types of the non-terminals are specified with a %type declaration as shown below:

%type <Queue> address_list
%type <Integer> boolean

The %type declaration may be omitted for non-terminals that do not return any value and do not have type information associated with them.

The Rules Section

The rule section only consists of phrase-structure grammar rules. Each rule typically has the following format:

LHS : RHS [{ Actions }]
    ;

where LHS consists of a single non-terminal symbol and the RHS consists of one or more terminal and non-terminal symbols. The Actions are optional and may consist of any number of arbitrary C statements. Note that Bison can only process LALR(1) grammars, which imposes additional restrictions on the kind of rules that can be specified. Examples of rules are shown below:

orphan_mode_command
    : T_Tos tos_option_list
        { append_queue(my_config.orphan_cmds, $2); }
    ;

tos_option_list
    : tos_option_list tos_option { $$ = enqueue($1, $2); }
    | tos_option { $$ = enqueue_in_new_queue($1); }
    ;

The $n notation, where n is an integer, is used to refer to the value of a terminal or non-terminal symbol. All terminals and non-terminal symbols within a particular rule are numbered (starting from 1) according to the order in which they appear within the RHS of a rule. $$ is used to refer to the value of the LHS terminal symbol - it is used to return a value for the non-terminal symbol specified in the LHS of the rule.

Invoking Bison

Bison needs to be invoked in order to convert the ntp_config.y file into a C source file. To invoke Bison, simply enter the command:

bison ntp_config.y

at the command prompt. If no errors are detected, an ntp_config.tab.c file will be generated by default. This generated file can be directly included into the ntp_config.c file.

If Bison report shift-reduce errors or reduce-reduce errors, it means that the grammar specified using the rules in not LALR(1). To debug such a grammar, invoke Bison with a -v switch, as shown below. This will generate a ntp_config.output file, which will contain a description of the generated state machine, together with a list of states that have shift-reduce/reduce-reduce conflicts. You can then change the rules to remove such conflicts.

bison -v ntp_config.y

For more information, refer to the Bison manual.

ntp_config.c

This file contains the major chunk of the configuration code including all the support functions needed for building and traversing the ASTs. As such, most of the functions in this file can be divided into two groups:

  1. Functions that have a create_ prefix. These functions are used to build a node of the AST.
  2. Functions that have a config_ prefix. These functions are used to traverse the AST and configure NTP according to the nodes present on the tree.

Guidelines for Adding Configuration Commands

The following steps may be used to add a new configuration command to the NTP reference implementation:

  1. Write phrase-structure grammar rules for the syntax of the new command. Add these rules to the rules section of the ntp_config.y file.
  2. Write the action to be performed on recognizing the rules. These actions will be used to build the AST.
  3. If new reserved words are needed, add these to the struct key_tok keyword_list[]structure in the ntp_config.c file. This will allow the scanner to recognize these reserved words and generate the desired tokens on recognizing them.
  4. Specify the types of all the terminals and non-terminal symbols in the prologue section of the ntp_config.c file.
  5. Write a function with a config_ prefix that will be executed for this new command. Make sure this function is called in the config_ntpd()function.

Sachin Kamboj
ntp-4.2.6p5/html/kernpps.html0000644000175000017500000001076611307651605015143 0ustar peterpeter PPSAPI Interface for Precision Time Signals

PPSAPI Interface for Precision Time Signals

giffrom NBS Special Publication 432, 1979 (out of print)

Last update: 15:40 UTC Sunday, March 02, 2008


Related Links



Introduction

RFC-2783 describes the PPSAPI application programming interface for external precision time signals, such as the pulse-per-second (PPS) signal generated by some radio clocks and cesium oscillators. The PPSAPI provides a generic capability in the ubiquitous Unix kernel which can be used for a wide variety of measurement applications, including network time synchronization and related experiments. The hardware to do this requires only a serial port and a modem control lead, such as the data carrier detect (DCD) lead, which can be driven by an external source via a level converter/pulse generator such as described on the Pulse-per-second (PPS) Signal Interfacing page. In some systems a parallel port can be used for the same purpose.

The PPSAPI interface defined in RFC-2783 is the only PPS interface supported in NTP Version 4. The PPSAPI is supported in stock FreeBSD and, with the addition of the PPSkit kernel module, in Linux.

The special header file /usr/include/sys/timepps.h implements the PPSAPI using whatever primitives are available in each archeticture and operating system. It obsoletes previous APIs based on the tty_clock and ppsclock line disciplines and streams modules, which are no longer supported.

The PPS Clock Discipline driver (type 22) uses the PPSAPI in conjunction with a local radio clock or remote NTP server as a reference clock. The driver can also use the PPSAPI as an interface directly to the kernel PPS facility as described on the Kernel Model for Precision Timekeeping page.

PPSAPI Application Program Interface

The PPSAPI interface provides the following functions:

time_pps_create
Creates a PPS interface instance and returns a handle to it.
time_pps_destroy
Destroys a PPS interface and returns the resources used.
time_pps_setparams
Sets the parameters associated with a PPS interface instance, including offsets to be automatically added to captured timestamps.
time_pps_getparams
Returns the parameters associated with a PPS interface instance.
time_pps_getcap
Returns the capabilities of the current interface and kernel implementation.
time_pps_fetch
Returns the current timestamps associated with a PPS interface instance in either nanoseconds and nanoseconds (Unix timespec) or seconds and fraction (NTP) format.
time_pps_kcbind
If kernel PPS processing is supported, this binds the support to the associated PPS interface instance.

The entire PPS interface functionality is currently provided by inline code in the timepps.h header file. While not all implementations support the full PPSAPI specification, they do support all the functions required for the PPS driver described next. The FreeBSD, Linux and Solaris implementations can be used with the stock kernels provided with those systems; however, the Tru64 and SunOS kernels require additional functions not provided in the stock kernels. Solaris users are cautioned that these functions operate improperly in Solaris versions prior to 2.8 with patch Generic_108528-02. Header files for other systems can be found via the web at nanokernel.tar.gz.



ntp-4.2.6p5/html/debug.html0000644000175000017500000004435411334231166014543 0ustar peterpeter NTP Debugging Techniques

NTP Debugging Techniques

giffrom Pogo, Walt Kelly

We make house calls and bring our own bugs.

Last update: 16-Jul-2009 19:36 UTC

More Help


Initial Startup

This page discusses ntpd program monitoring and debugging techniques using the ntpq - standard NTP query program, either on the local server or from a remote machine. In special circumstances the ntpdc - special NTP query program, can be useful, but its use is not covered here. The ntpq program implements the management functions specified in the NTP specification RFC-1305, Appendix A. It is used to read and write the variables defined in the NTP Version 4 specification now navigating the standards process. In addition, the program can be used to send remote configuration commands to the server.

The ntpd daemon can operate in two modes, depending on the presence of the -d command-line option. Without the option the daemon detaches from the controlling terminal and proceeds autonomously. With one or more -d options the daemon does not detach and generates special trace output useful for debugging. In general, interpretation of this output requires reference to the sources. However, a single -d does produce only mildly cryptic output and can be very useful in finding problems with configuration and network troubles.

Some problems are immediately apparent when the daemon first starts running. The most common of these are the lack of a UDP port for NTP (123) in the Unix /etc/services file (or equivalent in some systems). Note that NTP does not use TCP in any form. Also note that NTP requires port 123 for both source and destination ports. These facts should be pointed out to firewall administrators.

Other problems are apparent in the system log, which ordinarily shows the startup banner, some cryptic initialization data and the computed precision value. Event messages at startup and during regular operation are sent to the optional protostats monitor file, as described on the Event Messages and Status Words page. These and other error messages are sent to the system log, as described on the ntpd System Log Messages page. In real emergencies the daemon will sent a terminal error message to the system log and then cease operation.

The next most common problem is incorrect DNS names. Check that each DNS name used in the configuration file exists and that the address responds to the Unix ping command. The Unix traceroute or Windows tracert utility can be used to verify a partial or complete path exists. Most problems reported to the NTP newsgroup are not NTP problems, but problems with the network or firewall configuration.

Verifying Correct Operation

Unless using the iburst option, the client normally takes a few minutes to synchronize to a server. If the client time at startup happens to be more than 1000 s distant from NTP time, the daemon exits with a message to the system log directing the operator to manually set the time within 1000 s and restart. If the time is less than 1000 s but more than 128 s distant, a step correction occurs and the daemon restarts automatically.

When started for the first time and a frequency file is not present, the daemon enters a special mode in order to calibrate the frequency. This takes 900 s during which the time is not disciplined. When calibration is complete, the daemon creates the frequency file and enters normal mode to amortize whatever residual offset remains.

The ntpq commands pe, as and rv are normally sufficient to verify correct operation and assess nominal performance. The pe command displays a list showing the DNS name or IP address for each association along with selected status and statistics variables. The first character in each line is the tally code, which shows which associations are candidates to set the system clock and of these which one is the system peer. The encoding is shown in the select field of the peer status word.

The as command displays a list of associations and association identifiers. Note the condition column, which reflects the tally code. The rv command displays the system variables billboard, including the system status word. The rv assocID command, where assocID is the association ID, displays the peer variables billboard, including the peer status word. Note that, except for explicit calendar dates, times are in milliseconds and frequencies are in parts-per-million (PPM).

A detailed explanation of the system, peer and clock variables in the billboards is beyond the scope of this page; however, a comprehensive explanation for each one is in the NTPv4 protocol specification. The following observations will be useful in debugging and monitoring.

  1. The server has successfully synchronized to its sources if the leap peer variable has value other than 3 (11b) The client has successfully synchronized to the server when the leap system variable has value other than 3.
  2. The reach peer variable is an 8-bit shift register displayed in octal format. When a valid packet is received, the rightmost bit is lit. When a packet is sent, the register is shifted left one bit with 0 replacing the rightmost bit. If the reach value is nonzero, the server is reachable; otherwise, it is unreachable. Note that, even if all servers become unreachable, the system continues to show valid time to dependent applications.
  3. A useful indicator of miscellaneous problems is the flash peer variable, which shows the result of 13 sanity tests. It contains the flash status word bits, commonly called flashers, which displays the current errors for the association. These bits should all be zero for a valid server.
  4. The three peer variables filtdelay, filtoffset and filtdisp show the delay, offset and jitter statistics for each of the last eight measurement rounds. These statistics and their trends are valuable performance indicators for the server, client and the network. For instance, large fluctuations in delay and jitter suggest network congestion. Missing clock filter stages suggest packet losses in the network.
  5. The synchronization distance, defined as one-half the delay plus the dispersion, represents the maximum error statistic. The jitter represents the expected error statistic. The maximum error and expected error calculated from the peer variables represents the quality metric for the server. The maximum error and expected error calculated from the system variables represents the quality metric for the client. If the root synchronization distance for any server exceeds 1.5 s, called the select threshold, the server is considered invalid.

Large Frequency Errors

The frequency tolerance of computer clock oscillators varies widely, sometimes above 500 PPM. While the daemon can handle frequency errors up to 500 PPM, or 43 seconds per day, values much above 100 PPM reduce the headroom, especially at the lowest poll intervals. To determine the particular oscillator frequency, start ntpd using the noselect option with the server configuration command.

Record the time of day and offset displayed by the ntpq pe command. Wait for an hour or so and record the time of day and offset. Calculate the frequency as the offset difference divided by the time difference. If the frequency is much above 100 PPM, the tickadj program might be useful to adjust the kernel clock frequency below that value. For systems that do not support this program, this might be one using a command in the system startup file.

Access Controls

Provisions are included in ntpd for access controls which deflect unwanted traffic from selected hosts or networks. The controls described on the Access Control Options include detailed packet filter operations based on source address and address mask. Normally, filtered packets are dropped without notice other than to increment tally counters. However, the server can be configured to send a "kiss-o'-death" (KOD) packet to the client either when explicitly configured or when cryptographic authentication fails for some reason. The client association is permanently disabled, the access denied bit (TEST4) is set in the flash variable and a message is sent to the system log.

The access control provisions include a limit on the packet rate from a host or network. If an incoming packet exceeds the limit, it is dropped and a KOD sent to the source. If this occurs after the client association has synchronized, the association is not disabled, but a message is sent to the system log. See the Access Control Options page for further information.

Large Delay Variations

In some reported scenarios an access line may show low to moderate network delays during some period of the day and moderate to high delays during other periods. Often the delay on one direction of transmission dominates, which can result in large time offset errors, sometimes in the range up to a few seconds. It is not usually convenient to run ntpd throughout the day in such scenarios, since this could result in several time steps, especially if the condition persists for greater than the stepout threshold.

Specific provisions have been built into ntpd to cope with these problems. The scheme is called "huff-'n-puff and is described on the Miscellaneous Options page. An alternative approach in such scenarios is first to calibrate the local clock frequency error by running ntpd in continuous mode during the quiet interval and let it write the frequency to the ntp.drift file. Then, run ntpd -q from a cron job each day at some time in the quiet interval. In systems with the nanokernel or microkernel performance enhancements, including Solaris, Tru64, Linux and FreeBSD, the kernel continuously disciplines the frequency so that the residual correction produced by ntpd is usually less than a few milliseconds.

Cryptographic Authentication

Reliable source authentication requires the use of symmetric key or public key cryptography, as described on the Authentication Options page. In symmetric key cryptography servers and clients share session keys contained in a secret key file In public key cryptography, which requires the OpenSSL software library, the server has a private key, never shared, and a public key with unrestricted distribution. The cryptographic media required are produced by the ntp-keygen program.

Problems with symmetric key authentication are usually due to mismatched keys or improper use of the trustedkey command. A simple way to check for problems is to use the trace facility, which is enabled using the ntpd -d command line. As each packet is received a trace line is displayed which shows the authentication status in the auth field. A status of 1 indicates the packet was successful authenticated; otherwise it has failed.

A common misconception is the implication of the auth bit in the enable and disable commands. This bit does not affect authentication in any way other than to enable or disable mobilization of a new persistent association in broadcast/multicast client, manycast client or symmetric passive modes. If enabled, which is the default, these associations require authentication; if not, an association is mobilized even if not authenticated. Users are cautioned that running with authentication disabled is very dangerous, since an intruder can easily strike up an association and inject false time values.

Public key cryptography is supported in NTPv4 using the Autokey protocol, which is described in briefings on the NTP Project page linked from www.ntp.org. Development of this protocol is mature and the ntpd implementation is basically complete. Autokey version 2, which is the latest and current version, includes provisions to hike certificate trails, operate as certificate authorities and verify identity using challenge/response identification schemes. Further details of the protocol are on the Authentication Options page. Common problems with configuration and key generation are mismatched key files, broken links and missing or broken random seed file.

As in the symmetric key cryptography case, the trace facility is a good way to verify correct operation. A statistics file cryptostats records protocol transactions and error messages. The daemon requires a random seed file, public/private key file and a valid certificate file; otherwise it exits immediately with a message to the system log. As each file is loaded a trace message appears with its filestamp. There are a number of checks to insure that only consistent data are used and that the certificate is valid. When the protocol is in operation a number of checks are done to verify the server has the expected credentials and its filestamps and timestamps are consistent. Errors found are reported using NTP control and monitoring protocol traps with extended trap codes shown in the Authentication Options page.

To assist debugging every NTP extension field is displayed in the trace along with the Autokey operation code. Every extension field carrying a verified signature is identified and displayed along with filestamp and timestamp where meaningful. In all except broadcast/multicast client mode, correct operation of the protocol is confirmed by the absence of extension fields and an auth value of one. It is normal in broadcast/multicast client mode that the broadcast server use one extension field to show the host name, status word and association ID.

Debugging Checklist

If the ntpq or ntpdc programs do not show that messages are being received by the daemon or that received messages do not result in correct synchronization, verify the following:

  1. Verify the /etc/services file host machine is configured to accept UDP packets on the NTP port 123. NTP is specifically designed to use UDP and does not respond to TCP.
  2. Check the system log for ntpd messages about configuration errors, name-lookup failures or initialization problems. Common system log messages are summarized on the ntpd System Log Messages page. Check to be sure that only one copy of ntpd is running.
  3. Verify using ping or other utility that packets actually do make the round trip between the client and server. Verify using nslookup or other utility that the DNS server names do exist and resolve to valid Internet addresses.
  4. Check that the remote NTP server is up and running. The usual evidence that it is not is a Connection refused message.
  5. Using the ntpdc program, verify that the packets received and packets sent counters are incrementing. If the sent counter does not increment and the configuration file includes configured servers, something may be wrong in the host network or interface configuration. If this counter does increment, but the received counter does not increment, something may be wrong in the network or the server NTP daemon may not be running or the server itself may be down or not responding.
  6. If both the sent and received counters do increment, but the reach values in the pe billboard with ntpq continues to show zero, received packets are probably being discarded for some reason. If this is the case, the cause should be evident from the flash variable as discussed above and on the ntpq page. It could be that the server has disabled access for the client address, in which case the refid field in the ntpq pe billboard will show a kiss code. See earlier on this page for a list of kiss codes and their meaning.
  7. If the reach values in the pe billboard show the servers are alive and responding, note the tattletale symbols at the left margin, which indicate the status of each server resulting from the various grooming and mitigation algorithms. The interpretation of these symbols is discussed on the ntpq page. After a few minutes of operation, one or another of the reachable server candidates should show a * tattletale symbol. If this doesn't happen, the intersection algorithm, which classifies the servers as truechimers or falsetickers, may be unable to find a majority of truechimers among the server population.
  8. If all else fails, see the FAQ and/or the discussion and briefings at the NTP Project page.

ntp-4.2.6p5/html/gadget.html0000644000175000017500000000447611307651604014714 0ustar peterpeter Gadget Box PPS Level Converter and CHU Modem

Gadget Box PPS Level Converter and CHU Modem

gifA Gadget Box built by Chuck Hanavin

Related Links


table of Contents


Introduction

Many radio clocks used as a primary reference source for NTP servers produce a pulse-per-second (PPS) signal that can be used to improve accuracy to a high degree. However, the signals produced are usually incompatible with the modem interface signals on the serial ports used to connect the signal to the host. The gadget box consists of a handful of electronic components assembled in a small aluminum box. It includes level converters and a optional radio modem designed to decode the radio timecode signals transmitted by the Canadian time and frequency station CHU. A complete set of schematics, PCB artwork, drill templates can be obtained via the web from ftp.udel.edu as gadget.tar.Z.

The gadget box is assembled in a 5"x3"x2" aluminum minibox containing the level converter and modem circuitry. It includes two subcircuits. One of these converts a TTL positive edge into a fixed-width pulse at EIA levels and is for use with a timecode receiver or oscillator including a TTL PPS output. The other converts the timecode modulation broadcast by Canadian time/frequency standard station CHU into a 300-bps serial character stream at EIA levels and is for use with the Radio CHU Audio Demodulator/Decoder driver.


ntp-4.2.6p5/html/pps.html0000644000175000017500000001413511307651604014254 0ustar peterpeter Pulse-per-second (PPS) Signal Interfacing

Pulse-per-second (PPS) Signal Interfacing

giffrom Alice's Adventures in Wonderland, Lewis Carroll

Alice is trying to find the PPS signal connector.

Last update: 22:01 UTC Wednesday, January 02, 2008


Related Links

Table of Contents


Introduction

Most radio clocks are connected using a serial port operating at speeds of 9600 bps. The accuracy using typical timecode formats, where the on-time epoch is indicated by a designated ASCII character like carriage-return <cr>, is normally limited to a hundred microseconds. Using carefuly crafted averaging techniques, the NTP algorithms can whittle this down to a few tens of microseconds. However, some radios produce a PPS signal which can be used to improve the accuracy to few microseconds. This page describes the hardware and software necessar for NTP to use the PPS signal.

gif
A Gadget Box built by Chuck Hanavin

Gadget Box

The PPS signal can be connected in either of two ways: via the DCD data carrier detect pin of a serial port or via the ACK acknowledge pin of a parallel port, depending on the hardware and operating system. Note that NTP no longer supports connection via the RD data pin of a serial port.

However, the PPS signal levels are usually incompatible with serial port levels. The gadget box consists of a handful of electronic components assembled in a small aluminum box. It includes level converters and a optional modem designed to decode the radio timecode signals transmitted by Canadian time and frequency station CHU. This can be used with the Radio CHU Audio Demodulator/Decoder. A complete set of schematics, PCB artwork and drill templates can be obrtained via the web at gadget.tar.Z.

Operating System Support

Both the serial and parallel port connection require operating system support, which is available in only a few operating systems, including FreeBSD, Linux (with PPSkit patch) and Solaris. Support on an experimental basis is available for several other systems, including SunOS and HP/Compaq/Digital Tru64. The kernel interface described on the PPSAPI Interface for Precision Time Signals page is the only interface currently supported. Older PPS interfaces based on the ppsclock and tty_clk streams modules are no longer supported.

PPS Driver

PPS support requires the PPS driver (described on the Type 22 PPS Clock Discipline page. The driver operates in conjunction with a prefer peer, as described in the Mitigation Rules and the prefer Keyword page. The prefer peer is ordinarily the radio clock that provides the PPS signal, but in principle another radio clock or remote Internet server could be designated prerred. A source is desgnated prefer using the prefer keyword, as described on the Mitigation Rules and the prefer keyword page. Only one source can be designated preferred. PPS signals are processed by the PPS driver and other clock drivers which might be involved need not know or care about PPS capability. Note that the pps configuration command has been obsoleted by this driver.

Using the Pulse-per-Second (PPS) Signal

The PPS signal can be used in two ways, one using the NTP grooming and mitigations algorithms and the other using PPS signal support in the kernel, as described in the Kernel Model for Precision Timekeeping page. In either case, the PPS signal must be present and within nominal jitter and wander tolerances. In addition, the PPS driver and prefer peer must survive the sanity checks and intersection algorithms. Finally, the offset of the system clock relative to the prefer peer must be less than 128 ms, or well within the 0.5-s unambiguous range. The PPS peer remains active as long as these conditions are met.

The presence of PPS kernel support is automatically detected during the NTP configuration process and supporting code automatically compiled. When kernel PPS support is enabled, the PPS driver can direct the signal directly to the kernel. Note that the PPS driver does not normally enable the PPS kernel, since performance is generally better with older systems. However, the kernel can be enabled by a driver fudge flag if necessary. This is advised for newer machines in the Pentium class.

The kernel maintains a watchdog timer for the PPS signal; if the signal has not been heard or is out of tolerance for more than some interval, currently two minutes, the kernel discipline is disabled and operation continues as if it were not present.


ntp-4.2.6p5/html/tickadj.html0000644000175000017500000001006511606456562015071 0ustar peterpeter tickadj - set time-related kernel variables

tickadj - set time-related kernel variables

Last update: 18:53 UTC Wednesday, January 16, 2008


Synopsis

tickadj [ tick ]

tickadj [ -Aqs ] [ -a tickadj ] [ -t tick ]

Description

The tickadj program reads, and optionally modifies, several timekeeping-related variables in older kernels that do not have support for precision ttimekeeping, including HP-UX, SunOS, Ultrix, SGI and probably others. Those machines provide means to patch the kernel /dev/kmem. Newer machines with kernel time support, including Solaris, Tru64, FreeBSD and Linux, should NOT use the program, even if it appears to work, as it will destabilize the kernel time support. Use the ntptime program instead.

The particular variables that can be changed with tickadj include tick, which is the number of microseconds added to the system time for a clock interrupt, tickadj, which sets the slew rate and resolution used by the adjtime system call, and dosynctodr, which indicates to the kernels on some machines whether they should internally adjust the system clock to keep it in line with time-of-day clock or not.

On Linux, only the tick variable is supported and the only allowed argument is the tick value.

By default, with no arguments, tickadj reads the variables of interest in the kernel and displays them. At the same time, it determines an "optimal" value for the value of the tickadj variable if the intent is to run the ntpd Network Time Protocol (NTP) daemon, and prints this as well. Since the operation of tickadj when reading the kernel mimics the operation of similar parts of the ntpd program fairly closely, this can be useful when debugging problems with ntpd.

Note that tickadj should be run with some caution when being used for the first time on different types of machines. The operations which tickadj tries to perform are not guaranteed to work on all Unix machines and may in rare cases cause the kernel to crash.

Command Line Options

-a tickadj
Set the kernel variable tickadj to the value tickadjspecified.
-A
Set the kernel variable tickadj to an internally computed "optimal" value.
-t tick
Set the kernel variable tick to the value tick specified.
-s
Set the kernel variable dosynctodr to zero, which disables the hardware time-of-year clock, a prerequisite for running the ntpd daemon under SunOS 4.x.
-q
Normally, tickadj is quite verbose about what it is doing. The -q flag tells it to shut up about everything except errors.

Files

/vmunix
/unix
/dev/kmem

Bugs

Fiddling with kernel variables at run time as a part of ordinary operations is a hideous practice which is only necessary to make up for deficiencies in the implementation of adjtime in many kernels and/or brokenness of the system clock in some vendors' kernels. It would be much better if the kernels were fixed and the tickadj program went away.
ntp-4.2.6p5/html/parsenew.html0000644000175000017500000002262211307651605015277 0ustar peterpeter Making PARSE Clocks

How to build new PARSE clocks

Here is an attempt to sketch out what you need to do in order to add another clock to the parse driver: Currently the implementation is being cleaned up - so not all information in here is completely correct. Refer to the included code where in doubt.

Prerequisites:

  • Does the system you want the clock connect to have the include files termio.h or termios.h ? (You need that for the parse driver)

What to do:

Make a conversion module (libparse/clk_*.c)

  1. What ist the time code format ?
    • find year, month, day, hour, minute, second, status (synchronised or not), possibly time zone information (you need to give the offset to UTC) You will have to convert the data from a string into a struct clocktime:
            struct clocktime                /* clock time broken up from time code */
            {
      	long day;
      	long month;
      	long year;
      	long hour;
      	long minute;
      	long second;
      	long usecond;
      	long utcoffset;       /* in seconds */
      	time_t utcoffset;     /* true utc time instead of date/time */
      	long flags;           /* current clock status */
            };
      

      Conversion is usually simple and straight forward. For the flags following values can be OR'ed together:

           PARSEB_ANNOUNCE           switch time zone warning (informational only)
           PARSEB_POWERUP            no synchronisation - clock confused (must set then)
           PARSEB_NOSYNC             timecode currently not confirmed (must set then)
                                     usually on reception error when there is still a
                                     chance the the generated time is still ok.
      
           PARSEB_DST                DST in effect (informational only)
           PARSEB_UTC                timecode contains UTC time (informational only)
           PARSEB_LEAPADD            LEAP addition warning (prior to leap happening - must set when imminent)
      			       also used for time code that do not encode the
      			       direction (as this is currently the default).
           PARSEB_LEAPDEL            LEAP deletion warning (prior to leap happening - must set when imminent)
           PARSEB_ALTERNATE          backup transmitter (informational only)
           PARSEB_POSITION           geographic position available (informational only)
           PARSEB_LEAPSECOND         actual leap second (this time code is the leap
                                     second - informational only)
      

      These are feature flags denoting items that are supported by the clock:

           PARSEB_S_LEAP             supports LEAP - might set PARSEB_LEAP
           PARSEB_S_ANTENNA          supports ANTENNA - might set PARSEB_ALTERNATE
           PARSEB_S_PPS              supports PPS time stamping
           PARSEB_S_POSITION         supports position information (GPS)
         

      If the utctime field is non zero this value will be take as time code value. This allows for conversion routines that already have the utc time value. The utctime field gives the seconds since Jan 1st 1970, 0:00:00. The useconds field gives the respective usec value. The fields for date and time (down to second resolution) will be ignored.

      Conversion is done in the cvt_* routine in parse/clk_*.c files. look in them for examples. The basic structure is:

           struct clockformat <yourclock>_format = {
             lots of fields for you to fill out (see below)
           };
      
           static cvt_<yourclock>()
             ...
           {
             if (<I do not recognize my time code>) {
               return CVT_NONE;
             } else {
               if (<conversion into clockformat is ok>) {
                 <set all necessary flags>;
                 return CVT_OK;
               } else {
                 return CVT_FAIL|CVT_BADFMT;
               }
             }
      

      The struct clockformat is the interface to the rest of the parse driver - it holds all information necessary for finding the clock message and doing the appropriate time stamping.

      struct clockformat
      {
        u_long (*input)();
        /* input routine - your routine - cvt_<yourclock> */
        u_long (*convert)();
        /* conversion routine - your routine - cvt_<yourclock> */
        /* routine for handling RS232 sync events (time stamps) - usually sync_simple */
        u_long (*syncpps)(); 
        /* PPS input routine - usually pps_one */
        void           *data;
        /* local parameters - any parameters/data/configuration info your conversion
           routine might need */
        char           *name;
        /* clock format name - Name of the time code */
        unsigned short  length;
        /* maximum length of data packet for your clock format */
        u_long   flags;
       /* information for the parser what to look for */
      };
      

      The above should have given you some hints on how to build a clk_*.c file with the time code conversion. See the examples and pick a clock closest to yours and tweak the code to match your clock.

      In order to make your clk_*.c file usable a reference to the clockformat structure must be put into parse_conf.c.

  2. TTY setup and initialisation/configuration will be done in ntpd/refclock_parse.c.
    • Find out the exact tty settings for your clock (baud rate, parity, stop bits, character size, ...) and note them in terms of termio*.h c_cflag macros.
    • in ntpd/refclock_parse.c fill out a new the struct clockinfo element (that allocates a new "IP" address - see comments) (see all the other clocks for example)
         struct clockinfo
           {
            u_long  cl_flags;             /* operation flags (io modes) */
      	 PARSE_F_PPSPPS       use loopfilter PPS code (CIOGETEV)
      	 PARSE_F_PPSONSECOND  PPS pulses are on second
      	 usually flags stay 0 as they are used only for special setups
      
          void  (*cl_poll)();           /* active poll routine */
               The routine to call when the clock needs data sent to it in order to
               get a time code from the clock (e.g. Trimble clock)
      
          int   (*cl_init)();           /* active poll init routine */
               The routine to call for very special initializations.
      
          void  (*cl_event)();          /* special event handling (e.g. reset clock) */
               What to do, when an event happens - used to re-initialize clocks on timeout.
      
          void  (*cl_end)();            /* active poll end routine */
               The routine to call to undo any special initialisation (free memory/timers)
      
          void   *cl_data;              /* local data area for "poll" mechanism */
               local data for polling routines
      
          u_fp    cl_rootdelay;         /* rootdelay */
               NTP rootdelay estimate (usually 0)
      
      	     u_long  cl_basedelay;         /* current offset - unsigned l_fp
                                                    fractional part (fraction) by
                                                    which the RS232 time code is
                                                    delayed from the actual time. */
      
          u_long  cl_ppsdelay;          /* current PPS offset - unsigned l_fp fractional
               time (fraction) by which the PPS time stamp is delayed (usually 0)
         part */
      
          char   *cl_id;                /* ID code (usually "DCF") */
               Refclock id - (max 4 chars)
      
          char   *cl_description;       /* device name */
               Name of this device.
      
          char   *cl_format;            /* fixed format */
               If the data format cann not ne detected automatically this is the name
      	 as in clk_*.c clockformat.
      
          u_char  cl_type;              /* clock type (ntp control) */
               Type if clock as in clock status word (ntp control messages) - usually 0
      	 
          u_long  cl_maxunsync;         /* time to trust oscillator after losing synch
        */
               seconds a clock can be trusted after losing synchronisation.
      
          u_long  cl_speed;             /* terminal input & output baudrate */
          u_long  cl_cflag;             /* terminal io flags */
          u_long  cl_iflag;             /* terminal io flags */
          u_long  cl_oflag;             /* terminal io flags */
          u_long  cl_lflag;             /* terminal io flags */
               termio*.h tty modes.
      
          u_long  cl_samples;           /* samples for median filter */
          u_long  cl_keep;              /* samples for median filter to keep */
               median filter parameters - smoothing and rejection of bad samples
        } clockinfo[] = {
        ...,<other clocks>,...
        { < your parameters> },
        };
      
      

Well, this is very sketchy, i know. But I hope it helps a little bit. The best way is to look which clock comes closest to your and tweak that code.

Two sorts of clocks are used with parse. Clocks that automatically send their time code (once a second) do not need entries in the poll routines because they send the data all the time. The second sort are the clocks that need a command sent to them in order to reply with a time code (like the Trimble clock).

For questions: kardel@acm.org.

Please include an exact description on how your clock works. (initialisation, TTY modes, strings to be sent to it, responses received from the clock).


ntp-4.2.6p5/html/extern.html0000644000175000017500000001357411307651603014764 0ustar peterpeter External Clock Discipline and the Local Clock Driver

External Clock Discipline and the Local Clock Driver

Last update: 18:38 UTC Thursday, July 28, 2005


The NTPv4 implementation includes provisions for an external clock, where the system clock is implemented by some external hardware device. One implementation might take the form of a bus peripheral with a high resolution counter disciplined by a GPS receiver, for example. Another implementation might involve another synchronization protocol, such as the Digital Time Synchronization Service (DTSS), where the system time is disciplined to this protocol and NTP clients of the server obtain synchronization indirectly via the server. A third implementation might be a completely separate clock discipline algorithm and synchronization protocol, such as the Lockclock algorithm used with NIST Automated Computer Time Service (ACTS) modem synchronized time.

When external clocks are used in conjunction with NTP service, some way needs to be provided for the external clock driver and NTP daemon ntpd to communicate and determine which discipline is in control. This is necessary in order to provide backup, for instance if the external clock or protocol were to fail and synchronization service fall back to other means, such as a local reference clock or another NTP server. In addition, when the external clock and driver are in control, some means needs to be provided for the clock driver to pass on status information and error statistics to the NTP daemon.

Control and monitoring functions for the external clock and driver are implemented using the Local Clock (type 1) driver and the ntp_adjtime() system call. This system call is implemented by special kernel provisions included in the kernel of several operating systems, including Solaris, Tru64, FreeBSD and Linux, and possibly others. When the external clock is disabled or not implemented, the system call is used to pass time and frequency information, as well as error statistics, to the kernel. Besides disciplining the system time, the same interface can be used by other applications to determine the operating parameters of the discipline.

When the external clock is enabled, ntpd does not discipline the system clock, nor does it maintain the error statistics. In this case, the external clock and driver do this using mechanisms unknown to ntpd; however, in this case the kernel state variables are retrieved at 64-s intervals by the Local Clock driver and used by the clock selection and mitigation algorithms to determine the system variables presented to other NTP clients and peers. In this way, downstream clients and servers in the NTP subnet can make an intelligent choice when more than one server is available.

In order to implement a reliable mitigation between ordinary NTP sources and the external clock source, a protocol is necessary between the local clock driver and the external clock driver. This is implemented using Boolean variables and certain bits in the kernel clock status word. The Boolean variables include the following:

ntp_enable. set/reset by the enable command. enables ntpd clock discipline

ntp_control. set during initial configuration if kernel support is available

kern_enable Set/reset by the enable command

If the kern_enable switch is set, the daemon computes the offset, frequency, maximum error, estimated error, time constant and status bits, then provides them to the kernel via ntp_adjtime(). If this switch is not set, these values are not passed to the kernel; however, the daemon retrieves their present values and uses them in place of the values computed by the daemon.

The pps_update bit set in the protocol routine if the prefer peer has survived and has offset less than 128 ms; otherwise set to zero.

The PPS control Updated to the current time by kernel support if the PPS signal is enabled and working correctly. Set to zero in the adjust routine if the interval since the last update exceeds 120 s.

The ntp_enable and kern_enable are set by the configuration module. Normally, both switches default on, so the daemon can control the time and the kernel discipline can be used, if available. The pps_update switch is set by the protocol module when it believes the PPS provider source is legitimate and operating within nominals. The ntp_control switch is set during configuration by interrogating the kernel. If both the kern_enable and ntp_control switches are set, the daemon disciplines the clock via the kernel and the internal daemon discipline is disabled.

The external clock driver controls the system time and clock selection in the following way. Normally, the driver adjusts the kernel time using the ntp_adjtime() system call in the same way as the daemon. In the case where the kernel discipline is to be used intact, the clock offset is provided in this call and the loop operates as specified. In the case where the driver steers only the frequency, the offset is specified as zero.


ntp-4.2.6p5/html/bugs.html0000644000175000017500000000456111307651604014414 0ustar peterpeter NTP Bug Reporting Procedures

NTP Bug Reporting Procedures

giffrom Alice's Adventures in Wonderland, Lewis Carroll

The rabbit toots to make sure you read this.

Last update: 04:05 UTC Sunday, March 02, 2008

.

Security Bug Reporting Procedures

If you find or suspect a security related program bug in this distribution, please send a report to security@ntp.org. Please do not contact developers directly.

Non-Security Bug Reporting Procedures

If you find or suspect a non-security related program bug in this distribution, please send a report to the NTP Public Service Project Bug Tracking System (Bugzilla) at http://bugs.ntp.org/. Bugs reported this way are immediately forwarded to the developers. Please do not contact the developers directly.

If you find or suspect an error in the program documentation pages, please send a report directly to the editor David Mills at mills@udel.edu. The master documentation pages are not controlled by the bug tracking system. You are invited to contribute new or revised pages in similar style and format.

If you wish to send a report via electronic mail, please remember that your report will be held until one of our volunteers enters it in Bugzilla. The email address for these reports is bugs@ntp.org. You will need to register at http://bugs.ntp.org/ so that you may participate directly in any e-mail discussion regarding your report.


ntp-4.2.6p5/html/hints/0000755000175000017500000000000011710605402013676 5ustar peterpeterntp-4.2.6p5/html/hints/aix0000644000175000017500000000551011307651605014413 0ustar peterpeterProblem with recent ANSI compilers On some systems, including AIX, the compiler quits on the ntp_refclock.c file when processing the refclock_report() routine. The problem, which is eithre a feature or a bug, has to do with an unwanted promotion of the u_char argument to an int and a failure of the compiler to recognize the preceding prototype. A workaround is to use ANSI syntax to delare the arguments. Since ANSI compilers are not universally available, this syntax can't be used in the stock distribution. (Message # 60: 2884 bytes, New) Date: Sat, 19 Aug 1995 13:20:50 -0400 From: "R. Bernstein" Newsgroups: comp.protocols.time.ntp to: mills@udel.edu return-receipt-to: rocky@panix.com Subject: time and AIX 3.2.5 raw tty bug This posting isn't strictly about NTP, any program that may stop the clock or set the clock backwards is subject to the AIX 3.2.5 bug. On AIX 3.2.5, there is a bug in the tty driver for a raw device which may crash the box under certain conditions: basically a read() on a raw tty in effect, a character was read but not as many as specified by VMIN when a read timeout occurred. VTIME specifies the timeout. See the AIX manual page on termios.h or that include file. for Information on VMIN (or MIN) VTIME (or TIME). A remedy other than to not use raw tty's is to apply patch U435110. Details of the problem report follow. > ABSTRACT: > IX43779: TRAP IN PSX_TIMEO > > ORIGINATING DETAILS: > Stacktrace shows: > IAR: 01460214 posixdd:psx_timeo + 8bf4: ti 4,r12,0x0 > *LR: 014601a0 posixdd:psx_timeo + 8b80 > 00212c60: 014604f4 posixdd:psx_timer + 8ed4 > 00212cc0: 0144b74c ttydd:tty_do_offlevel + 4284 > 00212d20: 000216fc .i_offlevel + 8c > 00212d70: 00021d78 .i_softint + c8 > 00001004: 00008714 .finish_interrupt + 80 > > RESPONDER SUMMARY: > AIX asserted in psx_timeo(). Reason for the assert was that > the current time was behind psx_ctime. Since this state > can occur when the current time is changed after a character > is received but before the VTIME interbyte timer pops, we > should not assert on this. > > RESPONDER CONCLUSION: > Removed the requirement that current time > psx_ctime by > adding a new L_ntimersub macro that is used instead of the > ntimersub macro in time.h. Also added a test for (current > time - psx_ctime) being negative, in that case we do not > adjust the new timeout. > > Reported to Correct a PTF in Error: NO > Reported as a Highly pervasive problem: NO > > PE Apar?: NoPE > Hiper Apar?: NoHiper > Status: CLOSED PER > Component Name: AIX V3 FOR RS/6 > Version: 320 > Component ID: 575603001 > Submitted: 94/05/03 > Closed: 94/05/05 > ChangeTeam: TX2527 > > APAR FIXED BY: U431696 U432151 U432844 U432870 U432979 > U433049 U433081 U433459 U433876 U433906 U434598 U434453 > U434672 U434737 U435110 ntp-4.2.6p5/html/hints/solaris.xtra.S99ntpd0000644000175000017500000000145511307651604017537 0ustar peterpeter#!/bin/sh if [ $1 = "start" ]; then if [ -x /usr/local/bin/xntpd ]; then echo "Starting NTP daemon, takes about 1 minute... " # dosynctodr may need to be left alone as of with Solaris 2.6 # The following line is unnecessary if you turn off # dosynctodr in /etc/system. /usr/local/bin/tickadj -s /usr/local/bin/ntpdate -v server1 server2 sleep 5 /usr/local/bin/xntpd fi else if [ $1 = "stop" ]; then pid=`/usr/bin/ps -e | /usr/bin/grep xntpd | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'` if [ "${pid}" != "" ]; then echo "Stopping Network Time Protocol daemon " /usr/bin/kill ${pid} fi fi fi ntp-4.2.6p5/html/hints/sun40000644000175000017500000000134211307651603014520 0ustar peterpeterNotes on CPU clock oscillator tolerance with SunOS 4.1.1 and 4.1.3 A bug in SunOS 4.1.1 results in the kernel time losing 1 microsecond per tick of the system clock. The bug was fixed (bugid 1094383) for SunOS 4.1.1 and corrected in SunOS 4.1.3. The easiest way to fix this is to replace the 4.1.1 binary clock.o with the corresponding 4.1.3 binary. Without this change it is necessary to use the tickadj program included in this distribution with the -t 9999 option. The tickadj option will work in all cases except when the kernel has been modified to correct the CPU clock oscillator frequency using a 1-pps signal from a precision source. The bugfix must be installed for this wrinkle to work properly. Dave Mills (mills@udel.edu) ntp-4.2.6p5/html/hints/refclocks0000644000175000017500000000305111307651603015601 0ustar peterpeterThis is a short overview for the reference clocks currently supported by xntp V3. (Ultimate wisdom can be obtained from xntpd/refclock_*.c this file was derived from that information - unfortunately some comments in the files tend to get stale - so use with caution) Refclock address Type 127.127.0.x no clock (fails to configure) 127.127.1.x local clock - use local clock as reference 127.127.2.x no clock (fails to configure) 127.127.3.x PSTI 1010/1020 WWV Clock 127.127.4.x SPECTRACOM WWVB receiver 8170 and Netclock/2 127.127.5.x Kinimetric Truetime 468-DC GOES receiver 127.127.6.x IRIG audio decode (Sun & modified BSD audio driver) 127.127.7.x CHU Timecode (via normal receiver & Bell 103 modem) 127.127.8.x PARSE (generic driver for a bunch of DCF/GPS clocks can be extended for other clocks too) 8.0-3 Meinberg PZF535/TCXO 8.4-7 Meinberg PZF535/OCXO 8.8-11 Meinberg DCF U/A 31 8.12-15 ELV DCF7000 8.16-19 Walter Schmid DCF receiver (Kit) 8.20-23 Conrad DCF77 receiver module + level converter (Kit) 8.24-27 TimeBrick (limited availability ask time@informatik.uni-erlangen.de) 8.28-31 Meinberg GPS166 8.32-35 Trimble SV6 GPS receiver 127.127.9.x MX4200 GPS receiver 127.127.10.x Austron 2201A GPS Timing Receiver 127.127.11.x Kinemetrics Truetime OM-DC OMEGA Receiver 127.127.12.x KSI/Odetecs TPRO-S IRIG-B / TPRO-SAT GPS 127.127.13.x Leitch: CSD 5300 Master Clock System Driver 127.127.14.x MSFEES 127/127.15.x TrueTime GPS/TM-TMD 127.127.16.x Bancomm GPS/IRIG Ticktock 127.127.17.x Datum Programmable Time System ntp-4.2.6p5/html/hints/a-ux0000644000175000017500000001720111307651604014503 0ustar peterpeter------------- INTRODUCTION: ------------- Last revision: 06-Jul-1994 Included in this distribution of XNTP V3 is a configuration file suitable for use under Apple's A/UX Version 3.x.x There is also one for A/UX 2.0.1 but it has not been fully tested. To make the executables follow the steps outlined below. *** NOTE: You must have gcc installed to successfully compile the current distribution; the native cc supplied with A/UX will NOT correctly compile this source. See the FAQ in comp.unix.aux for places to obtain gcc from and how to install it. ---------------------- MAKING XNTPD FOR A/UX: ---------------------- First, you need to create the makefiles (after you've downloaded the source, of course): % make clean % make refconf After that, you should edit Config.local to make sure that BINDIR is correct for where you wish the programs to be "installed". The default (and what I use) is /usr/local/etc. Make sure that DEFS_LOCAL and CLOCKDEFS are commented out! Presently, only the LOCAL_CLOCK/REFCLOCK clock is used and supported. After this is done (you should be told that your system is A/UX 3), make 'xntpd' (the options to 'gcc' are held in compilers/aux3.gcc): % make I do not normally use the `make install' option and so have not verified its compatibility with A/UX. Rather, I pull out each of the executables and place them in the locally appropriate locations. --------------- STARTING XNTPD: --------------- At this point you need to set things up so that 'xntpd' is started upon boot-up. You can do this in 1 of 2 ways: either add entries in /etc/inittab or, more ideally, create and use an /etc/rc.local file. Since rc.local is what I recommend, here's how you do it: By default, A/UX doesn't have rc.local, so you'll need to add the following to /etc/inittab: net6:2:wait:/etc/syslogd # set to "wait" to run a syslog daemon + jmj0:2:wait:/etc/rc.local 1>/dev/syscon 2>&1 # Local stuff dbg2::wait:/etc/telinit v # turn off init's verbose mode Now, the look of a sample /etc/rc.local is as follows: #!/bin/sh : : rc.local : # @(#)Copyright Apple Computer 1987 Version 1.17 of rc.sh on 91/11/08 15:56:21 (ATT 1.12) # Push line discipline/set the device so it will print /etc/line_sane 1 echo " " echo "Entering rc.local..." set `/bin/who -r` if [ "$7" = 2 ] then /bin/echo " now setting the time..." /usr/local/etc/ntpdate -s -b sleep 5 # # start up 'xntpd' if we want # if [ -f /etc/ntp.conf ] then /bin/echo " setting tick and tickadj..." /usr/local/etc/tickadj -t 16672 -a 54 sleep 5 /bin/echo " starting xntpd..." /usr/local/etc/xntpd <&- > /dev/null 2>&1 sleep 5 fi # fi echo "Leaving rc.local..." There are a few things to notice about the above: o When run, 'ntpdate' forces your clock to the time returned by the host(s) specified by (you'll need to replace this be the IP address(es) of your timehosts. This is good since it gets things close to start off with. You can use more than one time server. o 'tickadj' is also called. This does two things: changes the default value of 'tick' (which the the amount of time, in ms, that is added to the clock every 1/60 seconds) and changes the value of 'tickadj' which the the amount that is added or subtracted from 'tickadj' when adjtime() is called. Now Mac clocks are pretty bad and tend to be slow. Sooo, instead of having A/UX add the default of 16666ms every 1/60th of a second, you may want it to add more (or less) so that it keeps better time. The above value works for me but your "best" value may be different and will likely require some fooling around to find the best value. As a general rule of thumb, if you see 'xntpd' make a lot of negative clock adjustments, then your clock is fast and you'll need to _decrease_ the value of 'tick'. If your adjustments are positive, then you need to increase 'tick'. To make a guess on how fast/slow your clock is, use 'ntpdate' to sync your clock. Now watch 'xntpd' and see how it operates. If, for example, it resets your clock by 1 second every 30 minutes, then your clock is (1/(30*60)) is about 0.056% off and you'll need to adjust 'tick' by 16666*0.00056 or about 9 (i.e. 'tick' should be ~16675 if slow or ~16657 if fast) A/UX's default value of 'tickadj' is 1666 which is too big for 'xntpd'... so it also needs to be adjusted. I like using larger values then the recommended value of 9 for 'tickadj' (although not anything near as big as 1666) since this allows for quick slews when adjusting the clock. Even with semi-large values of 'tickadj' (~200), getting 5ms (1/200 s) accuracy is easy. Finally, before A/UX and 'xntpd' will work happily together, you need to patch the kernel. This is due to the fact that A/UX attempts to keep the UNIX-software clock and the Mac-hardware clock in sync. Neither the h/w or the s/w clock are too accurate. Also, 'xntpd' will be attempting to adjust the software clock as well, so having A/UX muck around with it is asking for headaches. What you therefore need to do is tell the kernel _not_ to sync the s/w clock with the h/w one. This is done using 'adb'. The following is a shell script that will do the patch for you: #! /bin/sh adb -w /unix < (xntpd/refclock_parse.c): - Added support to supply power from RS232 with CLOCK_RAWDCF. Known to work with Linux 1.2. - Made Linux ignore parity errors with CLOCK_RAWDCF. Ulrich Windl (parse/util/dcfd.c): - Removed conflicting prototype for Linux (sscanf) - Corrected spelling error - Made Linux ignore parity errors. - Added support to supply power from RS232 with CLOCK_RAWDCF. Ulrich Windl (parse/util/testdcf.c): - Made Linux ignore parity errors. ntp-4.2.6p5/html/hints/solaris.html0000644000175000017500000001235111307651603016250 0ustar peterpeter Solaris hints and kinks Information on compiling and executing ntpd under Solaris.
Last Updated: Sun Jun 21 01:32:18 EDT 1998, John Hawkinson, <jhawk@MIT.EDU>

If you're not running Solaris 2.5.1 or later, it is likely that you will have problems; upgrading would be a really good plan.

All Solaris versions

We have a report that says starting with Solaris 2.6 we should leave dosynctodr alone. Here is the report.

Proper operation of ntp under Solaris may require setting the kernel variable dosynctodr to zero (meaning "do not synchronize the clock to the hardware time-of-day clock"). This can be done with the tickadj utility:

tickadj -s
If you prefer, it can also be done with the native Solaris kernel debugger:
echo dosynctodr/W0 | adb -k -w /dev/ksyms /dev/mem

Or, it can also be set by adding a line to /etc/system:

set dosynctodr = 0

Instead of the tick kernel variable, which many operating systems use to control microseconds added to the system time every clock tick (c.f. Dealing with Frequency Tolerance Violations), Solaris has the variables nsec_per_tick and usec_per_tick.

nsec_per_tick and usec_per_tick control the number of nanoseconds and microseconds, respectively, added to the system clock each clock interrupt. Enterprising souls may set these based on information collected by ntpd in the /etc/ntp.drift file to correct for individual hardware variations.

On UltraSPARC systems, nsec_per_tick and usec_per_tick are ignored in favor of the cpu_tick_freq variable, which should be automatically be determined by the PROM in an accurate fashion.

In general, the same ntp binaries should not be used across multiple operating system releases. There is enough variation in the core operating system support for timekeeping that a rebuild of ntpd for the idiosyncracies of your specific operating system version is advisable.

It is recommended that ntp be started via a script like this one, installed in /etc/init.d/ntpd with a symbol link from /etc/rc2.d/S99ntpd.

Solaris 2.6

Solaris 2.6 adds support for kernel PLL timekeeping, but breaks this support in such a fashion that using it worse than not. This is SUN Bug ID 4095849, and it is not yet fixed as of June 1998.

Solaris 2.5 and 2.5.1

On UltraSPARC systems, calculation of cpu_tick_freq is broken such that values that are off by significant amounts may be used instead. This unfortunately means that ntpd may have severe problems keeping synchronization. This is SUN Bug ID 4023118. Bryan Cantrill of Sun posted patchfreq, a workaround script, to comp.protocols.time.ntp in March of 1997.


OLD DATA

I can't vouch for the accuracy the information below this rule. It may be significantly dated or incorrect.

Solaris 2.2

Solaris 2.2 and later contain completely re-written clock code to provide high resolution microsecond timers. A benefit of the re-written clock code is that adjtime does not round off its adjustments, so ntp does not have to compensate for this rounding. Under Solaris 2.2 and later, ntp #define's ADJTIME_IS_ACCURATE, and does not look for the tickadj kernel variable.

Solaris 2.1

(This originally written by William L. Jones <jones@chpc.utexas.edu>)

Solaris 2.1 contains fairly traditional clock code, with tick and tickadj.

Since settimeofday under Solaris 2.1 only sets the seconds part of timeval care must be used in starting xntpd. I suggest the following start up script:

tickadj -s -a 1000
ntpdate -v server1 server2
sleep 20
ntpdate -v server1 server2
sleep 20
tickadj -a 200
xntpd
The first tickadj turns of the time of day clock and sets the tick adjust value to 1 millisecond. This will insure that an adjtime value of at most 2 seconds will complete in 20 seconds.

The first ntpdate will set the time to within two seconds using settimeofday or it will adjust time using adjtime.

The first sleep insures the adjtime has completed for the first ntpdate.

The second ntpdate will use adjtime to set the time of day since the clock should be within 2 seconds of the correct time.

The second tickadj set the tick adjust system value to 5 microseconds.

The second sleeps insure that adjtime will complete before starting the next xntpd.

I tried running with a tickadj of 5 microseconds with out much success. 200 microseconds seems to work well.


Prior versions of this file had major text contributed by:
  • Denny Gentry <denny@eng.sun.com>
  • ntp-4.2.6p5/html/hints/svr4-dell0000644000175000017500000000025011307651603015440 0ustar peterpeterNotes on the DELL SVR4. You should use -DSETTIMEOFDAY_BROKEN. Philip.Gladstone@mail.citicorp.com (XXX But there is no checking for SETTIMEOFDAY_BROKEN in the code) ntp-4.2.6p5/html/hints/sco.html0000644000175000017500000000276311307651604015367 0ustar peterpeter SCO Unix hints

    SCO Unix hints

    Older SCO Unix versions

    NTP 4.0.x does not run on SCO Unix prior to version 3.2.5.0.0. If you need NTP on an older SCO Unix system and don't mind to modify your kernel, use 3.5.91 which has patches for SCO Unix 3.2.4.x. Apply the kernel modifications as described in XNTP on SCO 3.2.4.2.

    Compiling NTP

    Delete the old SCO supplied NTP programs using the "custom" utility. Run the NTP configure program with CFLAGS="-b elf -K processor-type" for best results.

    Running NTP

    Run "tickadj -As" after every reboot to set the variables "clock_drift" and "track_rtc" to the right values.

    Run "ntpd" with a high negative nice-value, i.e. "nice --19 ntpd" for best results.

    More information

    More information on the way SCO Unix and NTP interact can be found in NTP on SCO Unix, which includes links to precompiled versions of NTP.

    Kees Hendrikse, January 1999

    ntp-4.2.6p5/html/hints/decosf10000644000175000017500000000366011307651603015160 0ustar peterpeterSome major changes were necessary to make xntp v3 run on the DEC Alpha hardware running DEC OSF/1. All "long" and "u_long" declarations and casts in the code were changed to "LONG" and "U_LONG" and a new header file (include/ntp_types.h) was added. The new header file defines LONG as int and U_LONG as u_int for the Alpha hardware and as long and u_long for anything else. A couple of #ifs where changed in ntpq and xntpdc to get the result of a signal defined correctly. The Config.decosf1 file built the programs here with no problems. I don't have a radio clock here, so none of that code has been tested. I have run xntpd, xntpdc, xntpres, ntpq, ntpdate, and tickadj under DEC OSF/1 v1.2-2 (BL10). Mike Iglesias Internet: iglesias@draco.acs.uci.edu University of California, Irvine BITNET: iglesias@uci Office of Academic Computing uucp: ...!ucbvax!ucivax!iglesias Distributed Computing Support phone: (714) 856-6926 Support for NTP Version 2 is included with the current OSF/1 release. If you are upgrading to NTP Version 3 with this distribution, you should not use the xntpd or ntpq programs that come with the OSF/1 release. The older programs should be replaced by the newer programs of the same name, either in situ or via a link to a tranquil spot like /usr/local/bin. The make install script in the this distribution don't work due to a silly install program incompatibility, so you will need to copy the programs by hand. Don't use the setup utility to install or configure the xntpd installation, as it will cheerfully clobber your painstakingly crafted ntp.conf program. However, assuming you put this file in /etc/ntp.conf, you can use the /sbin/init.d/xntpd script to start and stop the daemon. This distribution compiles with nominal mumur with the stock cc compiler that comes with OSF/1. Dave Mills Electrical Engineering Department Unibergisty of Delabunch mills@udel.edu ntp-4.2.6p5/html/hints/solaris.xtra.40958490000644000175000017500000000557011307651603017134 0ustar peterpeter Bug Id: 4095849 Category: kernel Subcategory: syscall State: evaluated Synopsis: time_constant value >6 with PLL in use leads to integer divide zero trap panic Description: If the time_constant parameter is 7 or higher, and the phase-lock looping model is in use, the system will take a "integer divide zero trap" panic in the clock routine as soon as the time_offset becomes non-zero. time_constant defaults to 0. The only place it is set is in the ntp_adjtime system call, from the 'constant' element of the timex structure argument. Work around: Never set the constant element of the timex structure passed to ntp_adjtime to a value larger than 6. satish.mynam@Eng 1998-04-30 1. Use Sun's version of NTP software instead of PD version. This problem is not seen with Sun's NTP version (which is mostly eqivalent to PD NTP 3.4 plus some Sun's local functionality futures). 2. Workaround for the public domain NTP version ONLY: ===================================================== The workaround for public domain NTP version is to disable the KERNEL_PLL from the NTP code. This way ntp_Adjtime() system call is totally bypassed without sacrificing any of the functionality of the NTP. The only hit you might see is the way kernel precision timminig is done without the PLL algorithm in the kernel. The easiest way to disable ntp_adjtime option is(without changing any makefiles or other config files) to disable the KERNEL_PLL value in the ./config.h file. After doing a ./configure for probing for all the necessary tools(compilers, os version, libraries), please comment out KERNEL_PLL macro in the ./config.h file. This will disable the KERNEL_PLL part of the source code and the newly obtained xntpd is just similar to the old one but it does not use ntp_adjtime() system call. This prevents it from panic'ng the kernel. /*#define KERNEL_PLL 1*/ I complied a new xntpd binary this way and it does nothave any ntp_adjtime() related stuff. Default: ======= /net/divya/export/home/mynam/public_domain/ntp/xntp3-5.92/xntpd>strings xntpd | grep ntp_adjtime 354:adj_frequency: ntp_adjtime failed: %m 357:loop_config: ntp_adjtime() failed: %m 435:get_kernel_info: ntp_adjtime() failed: %m With KERNEL_PLL disabled in config.h file -======================= /net/divya/export/home/mynam/public_domain/ntp/xntp3-5.92/xntpd>strings xntpd.nopll | grep ntp_adjtime Integrated in releases: Duplicate of: Patch id: See also: 4133517 Summary: If the time_constant parameter is 7 or higher, and the phase-lock looping model is in use, the system will take a "integer divide zero trap" panic in the clock routine as soon as the time_offset becomes non-zero. time_constant defaults to 0. The only place it is set is in the ntp_adjtime system call, from the 'constant' element of the timex structure argument. ---------------------------------------------------------------------------- ntp-4.2.6p5/html/hints/todo0000644000175000017500000000037411307651604014601 0ustar peterpeterUlrich Windl : Any change in a source file in the lib directory causes all files to be recompiled (because the objects are removed). Add a better rule for make to update the library. Maybe just remove "-rm -f $?". ntp-4.2.6p5/html/hints/sgi0000644000175000017500000000546311307651605014423 0ustar peterpeteradjtime, tick and tickadj: -------------------------- The SGI value for HZ is 100 under Irix 4, with the system clock running in nominal mode (ftimer off), so the value for tick is 10000 usec. Tickadj is a bit more tricky because of the behaviour of adjtime(), which seems to try to perform the correction over 100-200 seconds, with a rate limit of 0.04 secs/sec for large corrections. Corrections of less than 0.017 seconds generally complete in less than a second, however. Some measured rates are as follows: Delta Rate (sec/sec) > 1 0.04 0.75 0.04 0.6 0.004 0.5 0.004 0.4 0.0026 0.3 0.0026 0.2 0.0013 0.1 0.0015 0.05 0.0015 0.02 0.0003 0.01 0.015 Strange. Anyway, since adjtime will complete adjustments of less than 17msec in less than a second, whether the fast clock is on or off, I have used a value of 150usec/tick for the tickadj value. Fast clock: ----------- I get smoother timekeeping if I turn on the fast clock, thereby making the clock tick at 1kHz rather than 100Hz. With the fast clock off, I see a sawtooth clock offset with an amplitude of 5msec. With it on, the amplitude drops to 0.5msec (surprise!). This may be a consequence of having a local reference clock which spits out the time at exactly one-second intervals - I am probably seeing sampling aliasing between that and the machine clock. This may all be irrelevant for machines without a local reference clock. Fiddling with the fast clock doesn't seem to compromise the above choices for tick and tickadj. I use the "ftimer" program to switch the fast clock on when the system goes into multiuser mode, but you can set the "fastclock" flag in /usr/sysgen/master.d/kernel to have it on by default. See ftimer(1). timetrim: --------- Irix has a kernel variable called timetrim which adjusts the system time increment, effectively trimming the clock frequency. Xntpd could use this rather than adjtime() to do it's frequency trimming, but I haven't the time to explore this. There is a utility program, "timetrim", in the util directory which allows manipulation of the timetrim value in both SGI and xntpd native units. You can fiddle with default timetrim value in /usr/sysgen/master.d/kernel, but I think that's ugly. I just use xntpd to figure out the right value for timetrim for a particular CPU and then set it using "timetrim" when going to multiuser mode. Serial I/O latency: ------------------- If you use a local clock on an RS-232 line, look into the kernel configuration stuff with regard to improving the input latency (check out /usr/sysgen/master.d/[sduart|cdsio]). I have a Kinemetrics OM-DC hooked onto /dev/ttyd2 (the second CPU board RS-232 port) on an SGI Crimson, and setting the duart_rsrv_duration flag to 0 improves things a bit. 12 Jan 93 Steve Clift, CSIRO Marine Labs, Hobart, Australia (clift@ml.csiro.au) ntp-4.2.6p5/html/hints/solaris.xtra.40231180000644000175000017500000000257111307651603017106 0ustar peterpeter Bug Id: 4023118 Category: kernel Subcategory: other State: integrated Synopsis: sun4u doesn't keep accurate time Description: [ bmc, 12/20/96 ] The clock on a sun4u drifts unacceptably. On a typical 143 mHz Ultra, the clock took 1.0001350 seconds to count 1 second. While this may seem trivial, it adds up quickly. In this case, the TOD chip will have to pull the clock forward by 2 seconds every 4 hours and 7 minutes. This drift rate is so high, that the clock is close to being too broken for NTP to guarantee correctness (in order for NTP's mechanism to work, it must be assured that the local clock drifts no more than 20 ms in 64 seconds; this particular 143 mHz Ultra will drift by nearly 9 ms in that period). This problem has been reproduced on virtually all sun4u classes. The fundamental problem lies in the kernel's perception of ticks per second. The PROM is responsible for determining this figure exactly, and the kernel extracts it into the variable cpu_tick_freq. On sun4u's, this number is disconcertingly round: 143000000, 167000000, 248000000, etc. Indeed, a simple experiment revealed that these numbers were quite far from the actual ticks per second. Typical was the 143 mHz Ultra which was discovered to tick around 142,980,806 (+/- 10) times per second. Work around: Integrated in releases: s297_27 Duplicate of: Patch id: See also: Summary: ntp-4.2.6p5/html/hints/vxworks.html0000644000175000017500000001332411307651604016321 0ustar peterpeter vxWorks Port of NTP

    VxWorks port of NTP

    Creating a port for vxWorks posed some problems. This port may help as a starting point for similar ports to real-time OS's and other embeddable kernels, particularly where main() is not allowed, and where the configure scripts need to be altered.

    Configuration issues

    I decided to do as little invasive surgery as possible on the NTP code, so I brought the vxWorks header tree in line with the standard Unix tree. The following changes were needed, as a side effect these changes will allow for easy porting of other autoconfigure enabled code.

    Where I have 386 you will need to put in your target type. The vxWorks tree entry point is /usr/wind. If these are the same for your system, you should be able to cut and paste the changes.

    WARNING: Check you are not overwriting files, before entering the following: there should be no conflict, but check first...

                export CC="cc386 -nostdlib -m486 -DCPU=I80486 -I/usr/wind/target/h"
                export RANLIB=ranlib386
                export AR=ar386
                export VX_KERNEL=/usr/wind/target/config/ims_std_bsp/vxWorks
    cd /usr/wind/target/sys ln -s ../signal.h ln -s ../time.h ln -s socket.h sockio.h ln -s ../selectLib.h select.h ln -s ../timers.h touch file.h param.h resource.h utsname.h var.h ../netdb.h ../a.out.h ../termios.h echo " ******ADD #include \"sys/times.h\" to sys/time.h "
    The configure script must be changed in the following way to get the linking tests to work, once in the correct directory issue the following commands:
          sed -e 's%main.*()%vxmain()%' configure > configure.vxnew
                mv configure.vxnew configure
                chmod 755 configure
          

    The new version 4 of NTP requires some maths functions so it links in the maths library (-lm) in the ./ntpd/Makefile.am file change the line ntpd_LDADD = $(LDADD) -lm by removing the "-lm".

    >You are now ready to compile

    The ./configure.in file needed to be altered to allow for a host-target configuration to take place.

    • The define SYS_VXWORKS was added to the compilation flags.
    • Little endianess is set if the target is of type iX86.
    • The size of char, integer, long values are all set. If Wind River ever changes these values they will need to be updated.
    • clock_settime() is defined to be used for setting the clock.
    • The Linking flags have -r added to allow for relinking into the vxWorks kernel

    Unfortunately I have had to make use of the ./include/ntp_machine.h file to add in the checks that would have been checked at linking stage by autoconf, a better method should be devised.

    • There is now a NO_MAIN_ALLOWED define that simulates command line args, this allows the use of the normal startup sysntax.
    • POSIX timers have been added.
    • Structures normally found in netdb.h have been added with, the corresponding code is in ./libntp/machines.c. Where possible the defines for these have been kept non-vxWorks specific.

    Unfortunately there are still quite a few SYS_VXWORKS type defines in the source, but I have eliminated as many as possible. You have the choice of using the usrtime.a library avaliable from the vxworks archives or forgoing adjtime() and using the clock_[get|set]time(). The ./include/ntp_machine.h file clearly marks how to do this.

    Compilation issues

    You will need autoconf and automake ... available free from the gnu archives worldwide.

    The variable arch is the target architecture (e.g. i486)

                mkdir A.vxworks)
                cd A.vxworks
                ../configure --target=arch-wrs-vxworks
                make
           

    Options I normally use are the --disable-all-clocks --enable-LOCAL-CLOCK flags. The program should proceed to compile without problem. The daemon ntpd, ntpdate, ntptrace, ntpdc, ntpq programs and of course the libraries are all fully ported. The other utilities are not, but they should be easy to port.

    Running the software

    Load in the various files, call them in the normal vxWorks function type manner. Here are some examples. Refer to the man pages for further information.

                ld < ntpdate/ntpdate
                ld < ntpd/ntpd
                ld < ntptrace/ntptrace
                ld < ntpq/ntpq
                ld < ntpdc/ntpdc
                ntpdate ("-b", "192.168.0.245")
                sp(ntpd, "-c", "/export/home/casey/ntp/ntp.conf")
                ntpdc("-c", "monlist", "192.168.0.244")
                ntpq("-c", "peers", "192.168.0.244")
                ntptrace("192.168.0.244")
            

    Casey Crellin, casey@csc.co.za

    ntp-4.2.6p5/html/hints/solaris.xtra.patchfreq0000644000175000017500000000476711307651604020253 0ustar peterpeter#!/bin/ksh # # File: patchfreq # Author: Bryan Cantrill (bmc@eng.sun.com), Solaris Performance # Modified: Sat Apr 26 04:00:59 PDT 1997 # # This is a little script to patch a 5.5 or 5.5.1 kernel to get around # the cpu_tick_freq inaccuracy. Before running this script, one must # know the true frequency of one's CPU; this can be derived by NTP, # or by observing the clock relative to the time-of-day chip over a # long period of time (the TOD will pull system time when it drifts # by more than two seconds). # # Patching a kernel can render a machine unbootable; do not run this # script unless you are prepared to accept that possibility. It # is advisable to have a backout path (e.g. net booting, an alternate # boot disk, an installation CD) should your machine fail to boot. # # This is not a product of Sun Microsystems, and is provided "as is", # without warranty of any kind expressed or implied including, but not # limited to, the suitability of this script for any purpose. # if [ $# -eq 0 ]; then echo "Usage: $0 cpu_tick_freq [ alternate_kernel ]" exit 1 fi cpu_tick_freq=$1 kernel=/platform/sun4u/kernel/unix if [ $# -eq 2 ]; then kernel=$2 fi if [ ! -w $kernel ]; then echo "$0: Cannot open $kernel for writing." exit 1 fi arch=`echo utsname+404?s | adb $kernel | cut -d: -f2` if [ ! $arch = "sun4u" ]; then echo "Patch only applies to sun4u" exit 1 fi rel=`echo utsname+202?s | adb $kernel | cut -d: -f2` if [ ! $rel = "5.5" ] && [ ! $rel = "5.5.1" ]; then echo "Patch only applies to 5.5 or 5.5.1..." exit 1 fi nop="1000000" # nop store_mask="ffffe000" # mask out low 13 bits store="da256000" # st %o5, [%l5 + offset] instr=`echo setcpudelay+34?X | adb $kernel | cut -d: -f 2 | nawk '{ print $1 }'` if [ $instr = $nop ]; then echo "Instruction already patched..." else let masked="(16#$store_mask & 16#$instr) - 16#$store" if [ $masked -ne 0 ]; then echo "Couldn't find instruction to patch; aborting." exit 1 fi if ! echo setcpudelay+34?W $nop | adb -w $kernel 1> /dev/null then echo "adb returned an unexpected error; aborting." fi fi echo "Patching cpu_tick_freq to $cpu_tick_freq..." if ! echo cpu_tick_freq?W 0t$cpu_tick_freq | adb -w $kernel 1> /dev/null; then echo "adb returned an unexpected error; aborting." exit 1 fi echo "$kernel successfully patched." exit 0 ntp-4.2.6p5/html/hints/mpeix0000644000175000017500000000450111307651603014751 0ustar peterpeterHP e3000 MPE/iX NTP Hints - May 29, 2001 ---------------------------------------- NTP was first ported to MPE several years ago, but those diffs were never submitted back to the official NTP distribution. For more information about that deprecated port, please see http://www.bixby.org/mark/xntpix.html. NTP was re-ported to MPE in May 2001. What follows are hints learned from working with NTP 4.0.99k23. For additional information about NTP on MPE, please see http://jazz.external.hp.com/src/hp_freeware/ntp/. MPE lacks the clock-related APIs expected by NTP, so adjtime(), gettimeofday(), and settimeofday() all had to be implemented from scratch by calling privileged, undocumented internal OS functions. Unfortunately the implementation of adjtime() has exposed a sub-second accuracy bug when slewing the system time. This bug is documented in SR 5003462838, and exists on all current versions of MPE. It has not been fixed at the time of this writing. The adjtime() code may possibly need to be altered if/when this bug is fixed. This bug has a side-effect whereby the ntpd daemon will screw up the hardware PDC clock time by many minutes if used for continuous clock adjustments or in the one-time -q mode. But note that you can safely run ntpd in order to become a time server if you include "disable ntp" in the ntp.conf configuration file. The one-time clock adjustment functionality of ntpdate and ntp_timeset is not affected by this bug side-effect. You can safely use these commands to alter your system time with reasonable accuracy. The only reference clock that has been tested on MPE is the local clock. So building NTP with --disable-all-clocks --enable-LOCAL_CLOCK is strongly recommended. NTP makes use of Privileged Mode (PM) capability in order to bind to the NTP network port (123) and to access the low-level clock functions. NTP was ported using the gcc compiler. Attempting to use the HP C/iX compiler is not recommended and has not been tested. Please note that NTP is not an HP product and is NOT supported by HP. The best place for asking MPE-specific questions about NTP is the HP3000-L mailing list at http://raven.utc.edu/Archives/hp3000-l.html or the associated Usenet newsgroup of comp.sys.hp.mpe. The original author of this port is: Mark Bixby HP CSY MPE Internet & Interoperability Engineer mark_bixby@hp.com ntp-4.2.6p5/html/hints/hpux0000644000175000017500000001456211307651604014624 0ustar peterpeterLast update: Sun Mar 13 15:05:31 PST 1994 This file hopefully describes the whatever and however of how to get xntp running on hpux 7.0 and later s300. s400, s700, and s800. First off, all the standard disclaimers hold here ... HP doesn't have anthing to do with this stuff. I fool with it in my spare time because we use it and because I like to. We just happen to have a lot of HP machines around here :-) Xntpd has been in use here for several years and has a fair amount of mileage on various HP platforms within the company. I can't really guarantee bug fixes but I'd certainly like to hear about bugs and I won't hestitate to look at any fixes sent to me. Now lets talk OS. If you don't have 7.0 or later, pretty much hang it up now. This stuff has run here on pretty much everything from 8.0 upward on s300, s700, and s800. It is known to run on 7.0 s300/s400 but all reports are from the field and not my personal experience. If you are lucky enough to have a s300 or s400 with 9.03, then you no longer have to worry about adjtimed as HP-UX now has adjtime(2). The rest of you will have to wait on 10.0 which will have adjtime(2) and a supported though a bit older version of xntpd. Next, let me explain a bit about how this stuff works on HP-UX's that do not have adjtime(2). The directory adjtime contains libadjtime.a and the adjtimed daemon. Instead of the adjtime(2) system call, we use a library routine to talk to adjtimed thru message queues. Adjtimed munges into /dev/kmem and causes the clock to skew properly as needed. PLEASE NOTE that the adjtime code provided here is NOT a general replacement for adjtime(2) ... use of this adjtime(3)/adjtimed(8) other than with xntpd may yield very odd results. What to do to get this stuff running ? * If you are running an OS less than 10.0 or do not have a s300/s400 with 9.03 or better -> cd machines -> vi hpux -> (change -DSYS_HPUX=? to match whatever you are running [7,8,9]) -> cd .. * Say "make makeconfig" * Say "make", sit back for a few minutes. * cd authstuff * Say "./authcert < certdata" and check the output. Every line should end with "OK" ... if not, we got trouble. * Now try "./authspeed auth.samplekeys". What we want to remember here is the "authentication delay in CPU time" * cd .. * Say "make install" * I'd suggest reading the xntp docs about now :-) ... seriously !! * One thing I have added to this version of xntpd is a way to select config files if you are sharing /usr/local thru NFS or whatever. If the file /usr/local/etc/xntp.conf happens to be a directory, the files in that directory are searched until a match is found. The rules for a match are: 1. Our hostname 2. default. (as in default.375 or default.850) 3. default * Ok, make sure adjtimed is running (just start it up for now with "/usr/local/etc/adjtimed"). Using -z as an option will get you a usage message. * Now start up xntpd and watch it work. * Make sure that adjtimed gets started at boot right before xntpd. We do this in /etc/netbsdsrc. They must both run as root !! Possible problems ? * On some 320's and 835's we have had to run adjtimed with "-p 45" or so to get rid of syslog messages about "last adjust did not finish". * At 9.0, there is a problem with DIAGMON (patch available from the response center) which causes it to delete the message queue that adjtimed/xntpd use to communicate. (see next note for result) * Xntpd has been known to get really ticked off when adjtime() fails which is usually only while running the emulation code on HP-UX. When it gets mad, it usually jumps the clock into never never land. Possible reasons for this are adjtimed being killed or just never started or adjtimed being completely swapped out on a really busy machine (newer adjtimed try to lock themselves in memory to prevent this one). Anything else ... just drop me a line at ken@sdd.hp.com Received: from louie.udel.edu by huey.udel.edu id aa14418; 15 Jun 95 9:19 EDT Received: from host5.colby.edu (host-05.colby.edu) by host-04.colby.edu with ESMTP (1.37.109.15/Colby 1.1) id AA165442355; Thu, 15 Jun 1995 09:19:16 -0400 Received: by host5.colby.edu (1.37.109.15/Colby 1.1) id AA056252339; Thu, 15 Jun 1995 09:18:59 -0400 Date: Thu, 15 Jun 1995 09:18:59 -0400 (EDT) From: "Jeff A. Earickson" To: Mills@huey.udel.edu Subject: More minor bugs in xntp3.4s In-Reply-To: <9506150022.aa12727@huey.udel.edu> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Dave, After reading the hpux hints file, I realized I didn't install or start adjtimed. In the course of doing this, I discovered that: --> $(TOP) is not defined in adjtime/Makefile, so "make install" can't find the install.sh script. --> "make install" from the main Makefile never goes into the adjtime directory, so I added the following two lines into the install target of the main Makefile: @echo installing from adjtime @cd adjtime && $(MAKE) $(MFLAGS) MFLAGS="$(MFLAGS)" MAKE="$(MAKE)" install This twiddle may not be right for all systems, but it got adjtimed installed for me. You might also want to add to the hpux hints file that one way to fire things up at boot time is to add the following lines to the localrc function of /etc/rc: #---daemons for Network Time Protocol (version 3.4s) #---note that adjtimed is only needed for HP-UX 9.X, not 10.0 #---adjtimed must be running or xntpd won't work right... if [ -x /usr/local/bin/adjtimed ]; then /usr/local/bin/adjtimed -r & echo -n ' adjtimed' if [ -x /usr/local/bin/xntpd ]; then /usr/local/bin/xntpd & echo -n ' xntpd' fi fi I discovered that the "-r" option of adjtimed is needed to clear out any trash from a previous execution of it. Otherwise adjtimed quietly dies and leaves xntpd in the lurch... Thanks for the help. ** Jeff A. Earickson, Ph.D PHONE: 207-872-3659 ** Senior UNIX Sysadmin, Information Technology EMAIL: jaearick@colby.edu ** Colby College, 4214 Mayflower Hill, FAX: 207-872-3555 ** Waterville ME, 04901-8842 On Thu, 15 Jun 1995 Mills@huey.udel.edu wrote: > Jeff, > > Read the hpux file in the hints directory. > > Dave > ntp-4.2.6p5/html/hints/linux0000644000175000017500000000014511307651603014766 0ustar peterpeterThe kernel PLL interface is broken, I know. Update RSN. Torsten (duwe@informatik.uni-erlangen.de) ntp-4.2.6p5/html/hints/bsdi0000644000175000017500000000474311307651604014561 0ustar peterpeterhints/bsdi Author: Bdale Garbee, bdale@gag.com Last revision: 27Oct94 (Paul Vixie) Included in this distribution of XNTP is a configuration file suitable for use with BSDI's BSD/OS 1.1 (formerly BSD/386 1.1). On this system, the "cc" command is GCC 1.4x rather than PCC or GCC 2.x. It is imperative that "cc" be used since it predefines the symbol __bsdi__; if you want to use another compiler you will need to add -D__bsdi__ to catch the various #ifdef's required for this system. The Kinemetrics/Truetime GPS-TM/TMD driver is known to work on this system. The GPS-805 and GOES should also work fine. Hell, they should all work fine but it's hard to test very many locally. Due to BNR2's strict interpretation of POSIX and XNTP's use of SIGIO, BSD/OS can only handle one refclock per daemon. We're working this out with the system architects. The config file is machine/bsdi, and the following steps should be all that are required to install and use the bits. Note that you will need GNU sed; the version supplied with BSD/OS 1.1 loops endlessly during "make refconf". Likewise you should get GNU make, which the instructions below assume that you have put in /usr/local/bin/gnumake. To build the software: rm -f Config.local gnumake refconf gnumake MAKE=gnumake To install the software: gnumake install This will place all of the executables in /usr/local/etc. The config file is expected to be /usr/local/etc/xntp.conf and the key file for the optional authentication is /etc/ntp.keys. Craft a config file and a key file, and put them in the right places. There is information on how to do this elsewhere in the documentation, the only thing I'll mention is that I put the drift file in /var/log/ntp.drift, and the authdelay on my 486DX/50 system is 0.000064. Your mileage will vary, learn to use the authspeed tools if you're going to authenticate. In the file /etc/rc.local, make sure that the invocation of ntpd is commented out, and add an invocation of xntpd. Here's what I'm using: echo -n 'starting local daemons:' if [ -f /etc/ntp.keys -a -f /usr/local/etc/xntp.conf ]; then echo -n ' xntpd'; /usr/local/etc/xntpd fi #XXX# echo -n ' ntpd'; /usr/libexec/ntpd -t At this point, you should be good to go. Try running /usr/local/etc/xntpd and using ntpq or xntpdc to see if things are working, then pay attention the next time you reboot to make sure that xntpd is being invoked, and use ntpq or xntpdc again to make sure all is well. Enjoy! ntp-4.2.6p5/html/hints/notes-xntp-v30000644000175000017500000001267011307651604016303 0ustar peterpeterNotes for NTP Version 3 This version operates in much the same manner as Version 2 with the following changes and additions: 1. The protocol machinery operates in conformance with the RFC1305 NTP Version 3 specification. The most visible characteristic of this version is that the poll intervals for all polls, even selected ones, is significantly increased. This is especially desirable when serving a large client population. This implementation supports previous versions as non-configured peers; for version-2 configured peers a "version 2" keyword should be included on the "peer" line. 2. The configuration file has a new keyword: statfile , where is the name of a statistics file." When present, each clock update generates an entry of the form: . where is the modified Julian day, . is the time of day, is the peer address and is the peer status. The , and are the measured offset, delay and dispersion, respectively, of the peer clock relative to the local clock. About once per day the current file is closed and a new one created with names ., where starts at one and increments for each new generation. 3. A number of additional platforms are supported. See ./Config file for details. 4. A driver for the TrueTime 468DC GOES Synchronized Clock is included. This driver (refclock_goes.c) should also work for other TrueTime radio clocks, since all use the same format. 5. A replacement driver for the Spectracom 8170 WWVB Synchronized Clock is included. This driver (refclock_wwvb.c) (a) does not require a 1-pulse-per-second signal, (b) supports both format 0 (original 8170) and format 2 (Netclock/2 and upgraded 8170), (c) can be connected to more than one computer and (d) automatically compensates for all serial baud rates. 6. A driver for the German time/frequency station DCF77 is included. This requires a special STREAMS module. 7. In Version 2 special line-discipline modules were required for the CHU and WWVB drivers. This code continues to work in Version 3, although it is no longer needed for the WWVB driver. However, this code does not work under STREAMS, as used in SunOS 4.1.1. Equivalent STREAMS modules are supplied with Version 3. 8. Support for an external 1-pulse-per-second (pps) signal is provided. The signal is connected to a serial port (see xntpd/ntp_loopfilter.c for details). When present the leading edge of the pulse establishes the on-time epoch within an interval established by the selected radio clock or other NTP time server. Use of the pps is indicated when the tattletale displayed by ntpq changes from "*" to "o". 9. The clock-selection and poll-update procedures have been modified slightly in order to achieve better performance on high speed LANs with compromise in performance on typical WANs. 10. In order to comply with U.S. Commerce Department regulations, the DES encryption routine lib/authdes.c cannot be exported. For exportable versions of this distribution a DES-encrypted version of this routine lib/authdes.c.des is included along with an unencrypted version lib/authdes.c.export, which allows normal operation, but without the NTP authentication feature. Further information is available in the lib/authdes.c.export file. 11. As an alternative to the DES-based authentication mechanism, an implementation of the RSA Message Digest 5 algorithm is provided. (see applicable copyright information in the library files). 12. A driver for the Magnavox MX4200 GPS clock. 13. A STREAMS module which captures carrier-detect data-lead transitions to connect a precision source of 1-pps, yet avoid the ugly overhead in the usual STREAMS processing. See the ppsclock subdirectory. 14. Support for the Apple A/UX operating system and enhanced support for the Hewlet-Packard HP/UX operating system. See the various README and Config files for further information. See the COPYRIGHT file for authors and copyright information. Note that some modules in this distribution contain copyright information that supersedes the copyright information in that file. If I missed something or neglected to give due credit, please advise. David L. Mills University of Delaware 31 May 1992, amended 23 July 1992, 25 October 1992 Bugs and notes A bug in the original tty_clk_STREAMS.c module has been fixed. The poll-interval randomization feature of poll_update (in xntpd/ntp_proto.c) has been extended to apply when the poll interval is increased, as well as reduced. This spreads the update messages in time and helps avoid unpleasant bursts of messages. In the clock_select algorithm the peers selected for combining are limited to those survivors at the lowest stratum, not the entire list. This helps avoid whiplash when large numbers of peers are at the same stratum. The number formerly displayed by ntpq as "compliance" is now the time constant of integration. The DNS resolver xntpd/ntp_intres.c is now integrated into xntpd, making configuration of multiple hosts easier. System and peer event are now written to the system log at priority LOG_INFO. The leap-second code was fixed to avoid broadcasting leap warnings on all except the last day of June and December. ntp-4.2.6p5/html/hints/winnt.html0000644000175000017500000004373211372205556015746 0ustar peterpeter NTP on Windows NT

    NTP 4.x for Windows NT

    Introduction

    The NTP 4 distribution runs as service on Windows Vista, Windows NT 4.0, Windows 2000, Windows XP, Windows .NET Server 2003. It will NOT run on Windows 95, 98, ME, etc. The binaries work on multi-processor systems. This port has not been tested on the Alpha platform. This release now uses OpenSSL for authentication. IPv6 is not implemented yet for Win32 platforms. A ready-to-run install distribution is available from Meinberg at http://www.meinberg.de/english/sw/ntp.htm.

    Users should note that the stock Windows client sends requests as mode-1 packets, which can have unintended consequences and create a security risk. The client should send requests as mode-3 (client) packets, which conform to the protocol specification. The issues and resolution are described in Microsoft KB 875424. A less desirable alternative that avoids changing registry keys is to use the --with-wintime option when building the executable.

    Authentication Keys

    With this release ntp-keygen is supported. See the ntp keygen documentation for details on how to use ntp-keygen.

    ntpd can now use the generated keys in the same way as on Unix platforms. Please refer to the Authentication Options for details on how to use these.

    NOTE: ntpd and ntp-keygen both use OpenSSL which requires a random character file called .rnd by default. Both of these programs will automatically generate this file if they are not found. The programs will look for an environmental variable called RANDFILE and use that for the name of the random character file if the variable exists. If it does not exist it will look for an environmental variable called HOME and use that directory to search for a file called .rnd in that directory. Finally, if neither RANDFILE nor HOME exists it will look in C:\ for a .rnd file. In each case it will search for and create the file if the environmental variable exists or in the C:\ directory if it doesn't.

    Note that ntpd normally runs as a service so that the only way that it will have either RANDFILE or HOME defined is if it is a System environmental variable or if the service is run under a specific account name and that account has one of those variables defined. Otherwise it will use the file c:\.rnd. This was done so that OpenSSL will work normally on Win32 systems. This obviates the need to ship the OpenSSL.exe file and explain how to generate the .rnd file. A future version may change this behavior.

    Refer to Compiling Requirements and Instructions for how to compile the program.

    Reference Clocks

    Reference clock support under Windows NT is tricky because the IO functions are so much different. Some of the clock types have been built into the ntpd executable and should work but have not been tested by the ntp project. If you have a clock that runs on Win32 and the driver is there but not implemented on Win32 you will have make the required configuration changes in config.h and then build ntpd from source and test it. The following reference clock is known to work and is supported by Windows NT: Type 1 Undisciplined Local Clock (LOCAL)

    Functions Supported

    All NTP functions are supported with some constraints. See the TODO list below. Note that the ntptrace executable is not supported and you should use the PERL script version instead.

    Accuracy

    Greg Brackley has implemented a fantastic interpolation scheme that improves the precision of the NTP clock using a realtime thread (is that poetic or what!) which captures a tick count from the 8253 counter after each OS tick. The count is used to interpolate the time between operating system ticks.

    On a typical 200+ MHz system NTP achieves a precision of about 5 microseconds and synchronizes the clock to +/-500 microseconds using the Trimble Palisade as UTC reference. This allows distributed applications to use the 10 milliseconds ticks available to them with high confidence.

    Binaries

    Recent InstallShield based executable versions of NTP for Windows NT (intel) are available from:

    ToDo

    These tasks are in no particular order of priority.

    • Create a proper install/uninstall program
    • Add sntp to the list of supported programs
    • Add support for Visual C++ 7.0 or later (.NET)
    • Add IPv6 support
    • See if precision can be improved by using CPU cycle counter for tick interpolation.
    • Make precision time available to applications using NTP_GETTIME API

    Compiling Requirements

    • Windows NT 4.0 Windows 2000, Windows XP,Windows Vista or Windows.NET Server 2003
    • Microsoft Visual C++ 2008 EE or Visual C++ 2010 EE
    • Some way of uncompressing and untarring the gzipped tar file.
    • OpenSSL must be built on the box before building NTP. Additional steps would be required to not use OpenSSL.
    • Microsoft Visual C++ redistributables
    Compiling Instructions
    1. Install Micosoft Visual C++ redistributables
    2. Install OpenSSL full installer for Windows. Add the following to your system environment variables in the control panel (adjusting paths as appropriate to point to the directory containing only an openssl subdirectory, for OPENSSL_INC, and to the directory containing openssl .lib files for OPENSSL_LIB:
      • OPENSSL_INC=C:\OpenSSL\include
      • OPENSSL_LIB=C:\OpenSSL\lib
    3. Unpack the NTP-4.x.tar.gz using utilities such as WinZip or WinRar.
    4. Run Microsoft Visual C++ 2008 EE. On Windows Vista and later, Run as Administrator.
    5. Open the ports\winnt\vs2008\ntp.sln solution file
    6. Batch build all projects (Build menu, Batch Build..., select all, build).
    7. The built binaries can be found in the ports\winnt\v2008\bin\ directory.
    8. If you are shipping binaries in a kit it is strongly recommended that you ship this file (winnt.html) along with the binaries.

    Configuration File

    The default NTP configuration file path is %SystemRoot%\system32\drivers\etc\. (%SystemRoot% is an environmental variable that can be determined by typing "set" at the "Command Prompt" or from the "System" icon in the "Control Panel").

    Refer to your system environment and create your ntp.conf file in the directory corresponding to your system  installation. The older <WINDIR>\ntp.conf is still supported but you will get a log entry reporting that the first file wasn't found.

    Installation Instructions

    The instsrv program in the instsrv subdirectory of the distribution can be used to install 'ntpd' as a service and start automatically at boot time. Instsrv is automatically compiled with the rest of the distribution if you followed the steps above.

    1. Start a command prompt and enter "instsrv.exe <pathname_for_ntpd.exe>"
    2. Clicking on the "Services" icon in the "Control Panel" will display the list of currently installed services in a dialog box. The NetworkTimeProtocol service should show up in this list. Select it in the list and hit the "Start" button in the dialog box. The NTP service should start.
    3. You can also stop and start the service by typing net start|stop NetworkTimeProtocol at the DOS prompt.
    4. View the event log by clicking on the "Event Viewer" icon in the "Administrative Tools" group, there should be several successful startup messages from NTP. NTP will keep running and restart automatically when the machine is rebooted.

    You can change the start mode (automatic/manual) and other startup parameters corresponding to the NTP service in the "Services" dialog box if you wish.

    Removing NTP

    You can also use instsrv to delete the NTP service by entering: >"instsrv.exe remove"

    Command Line Parameters and Registry Entries

    Unlike the Unix environment, there is no clean way to run 'ntpdate' and reset the clock before starting 'ntpd' at boot time. NTP will step the clock up to 1000 seconds by default. While there is no reason that the system clock should be that much off during bootup if ntpd was running before, you may wish to override this default and/or pass other command line directives.

    Use the registry editor to edit the value for the ntpd executable under LocalMachine\System\CurrentControlSet\Services\NTP.

    Add the -g option to the ImagePath key, behind "%INSTALLDIR>\ntpd.exe". This will force NTP to accept large time errors (including 1.1.1980 00:00)

    Bug Reports

    Send questions and bug reports to NTP Bug Reporting Procedures.

    Change Log

    Last revision 2 July 2003  Version 4.2.0

    by Danny Mayer (mayer@ntp.org>)

    Significant Changes:

    This latest release of NTP constitutes a major upgrade to its ability to build and run on Windows platforms and should now build and run cleanly. More importantly it is now able to support all authentication in the same way as Unix boxes. This does require the usage of OpenSSL which is now a prerequisite for build on Windows. ntp-keygen is now supported and builds on Win32 platforms.

    Last revision 16 February 1999 Version 4.0.99e.

    by Sven Dietrich (sven_dietrich@trimble.com)

    pSignificant Changes:

    • Perl 5 is no longer needed to compile NTP. The configuration script which creates version.c with the current date and time was modified by Frederick Czajka [w2k@austin.rr.com] so that Perl is no longer required.

    Last revision 15 November 1999  Version 4.0.98f.

    ignificant Changes:

    • Fixed I/O problem delaying packet responses which resulted in no-replys to NTPQ and others.
    • The default configuration file path is <WINDIR>\system32\drivers\etc\ntp.conf. The old <WINDIR>\ntp.conf is still supported but you will get a log entry reporting that the first file wasn't found. The NTP 3.x legacy ntp.ini file is no longer supported.

    Known Problems / TODO:

    • MD5 and name resolution do not yet get along. If you define MD5, you cannot use DNS names, only IP numbers.

    Last revision 27 July 1999  Version 4.0.95.

    This version compiled under WINNT with Visual C 6.0 by Greg Brackley and Sven Dietrich. Significant changes:

    • Visual Studio v6.0 support
    • Winsock 2.0 support
    • Use of I/O completion ports for sockets and comm port I/O
    • Removed the use of multimedia timers (from ntpd, others need removing)
    • Use of waitable timers (with user mode APC) and performance counters to fake getting a better time
    • Trimble Palisade NTP Reference Clock support
    • General cleanup, prototyping of functions
    • Moved receiver buffer code to a separate module (removed unused members from the recvbuff struct)
    • Moved io signal code to a separate module

    Last revision:  20-Oct-1996

    This version corrects problems with building the XNTPversion 3.5-86 distribution under Windows NT. The following files were modified:

    • blddbg.bat
    • bldrel.bat
    • include\ntp_machine.h
    • xntpd\ntp_unixclock.c
    • xntpd\ntp_refclock.c
    • scripts\wininstall\build.bat
    • scripts\wininstall\setup.rul
    • scripts\wininstall\readme.nt
    • scripts\wininstall\distrib\ntpog.wri
    • html\hints\winnt (this file)

    In order to build the entire Windows NT distribution you need to modify the file scripts\wininstall\build.bat with the installation directory of the InstallShield software.  Then, simply type "bldrel" for non-debug or "blddbg" for debug executables.

    Greg Schueman, schueman@acm.org>

    Last revision: 07-May-1996

    This set of changes fixes all known bugs, and it includes
    several major enhancements. Many changes have been made both to the build environment as well as the code.  There is no longer an ntp.mak file, instead there is a buildntall.bat file that will build the entire release in one shot. The batch file requires Perl.  Perl is easily available from the NT Resource Kit or on the Net.

    The multiple interface support was adapted from Larry Kahn's work on the BIND NT port.  I have not been able to test it, adequately as I only have NT servers with one network interfaces on which to test.

    Enhancements:

    • Event Logging now works correctly.
    • Version numbers now work (requires Perl during build)
    • Support for multiple network interface cards (untested)
    • NTP.CONF now default, but supports ntp.ini if not found
    • Installation procedure automated.
    • All paths now allow environment variables such as %windir%

    Bug fixes

    • INSTSRV replaced, works correctly
    • Cleaned up many warnings
    • Corrected use of an uninitialized variable in XNTPD
    • Fixed ntpdate -b option
    • Fixed ntpdate to accept names as well as IP addresses (Winsock WSAStartup was called after a gethostbyname())
    • Fixed problem with "longjmp" in xntpdc/ntpdc.c that caused a software exception on doing a Control-C in xntpdc. A Cntrl-C now terminates the program.

    See below for more detail

    Note: SIGINT is not supported for any Win32 application including; Windows NT and Windows 95. When a CTRL+C interrupt occurs, Win32 operating systems generate a new thread to specifically handle that interrupt. This can cause a single-thread application such as UNIX, to become multithreaded, resulting in unexpected behavior.

    Possible enhancements and things left to do:

    • Reference clock drivers for NT (at least Local Clock support)
    • Control Panel Applet
    • InstallShield based installation, like NT BIND has
    • Integration with NT Performance Monitor
    • SNMP integration
    • Fully test multiple interface support

    Known problems:

    • bug in ntptrace - if no Stratum 1 servers are available, such as on an IntraNet, the application crashes.

    Last revision: 12-Apr-1995

    This NTPv3 distribution includes a sample configuration file and the project makefiles for WindowsNT 3.5 platform using Microsoft Visual C++ 2.0 compiler. Also included is a small routine to install the NTP daemon as a "service" on a WindowsNT box. Besides xntpd, the utilities that have been ported are ntpdate and xntpdc. The port to WindowsNT 3.5 has been tested using a Bancomm TimeServe2000 GPS receiver clock that acts as a stratum 1 NTP server with no authentication (it has not been tested with any refclock drivers compiled in).

    Following are the known flaws in this port

    • Currently, I do not know of a way in NT to get information about multiple network interface cards. The current port uses just one socket bound to INADDR_ANY address. Therefore when dealing with a multihomed NT time server, clients should point to the default address on the server (otherwise the reply is not guaranteed to come from the same interface to which the request was sent). Working with Microsoft to get this resolved.
    • There is some problem with "longjmp" in xntpdc/ntpdc.c that causes a software exception on doing a Control-C in xntpdc. Be patient!> 3) The error messages logged by xntpd currently contain only the numerical error code. Corresponding error message string has to be looked up in "Books Online" on Visual C++ 2.0 under the topic "Numerical List of Error Codes".

    Last HTML Update: November 17, 1999

    by Sven_Dietrich@Trimble.COM

    ntp-4.2.6p5/html/hints/svr4_package0000644000175000017500000000256211307651604016206 0ustar peterpeterDate: Wed, 12 Apr 1995 12:42:03 +0100 Message-ID: <513.797686923@concurrent.co.uk> From: Andy Chittenden Dave Here is a uuencoded, compressed tar file. The only file I've changed is Makefile - I've included the full file rather than diffs. There are some new files as well: xntp shell script that starts up ntp during boot up (the packaging stuff creates links to it so it comes up at run level 2). As with all svr4 start/stop scripts, it takes one parameter which is either start or stop. It assumes that ntp.conf is in /etc/inet/ntp.conf (where it should be on svr4 machines). prototype describes the file contents of the package. You might like to review its contents to see whether you want to include any other files or remove some. NB I've made the man pages go into 1m as they should on svr4. preinstall runs before installation takes place. It ensures that ntp is down if it is up before installing a replacement package postinstall starts up ntp after package installation. preremove brings down ntp before removing the package. You create a package using "make package". This creates a file called xntp.pkg. To install this package, you use "pkgadd -d `pwd`/xntp.pkg xntp". This will start up ntp if /etc/inet/ntp.conf exists. If you don't want the package anymore, use "pkgrm xntp". I have tested this on Solaris 2.4. ntp-4.2.6p5/html/hints/freebsd0000644000175000017500000000072211307651605015244 0ustar peterpeterIf you are compiling under FreeBSD and see messages in the syslogs that indicate that the ntpd process is trying to use unavailable sched_ calls, it means you are running a kernel that does not have the POSIX scheduling calls enabled. You have two choices: - Ignore the messages - Generate a new kernel, where the kernel configuration file contains the lines: options "P1003_1B" options "_KPOSIX_PRIORITY_SCHEDULING" options "_KPOSIX_VERSION=199309L" ntp-4.2.6p5/html/hints/decosf20000644000175000017500000000317711307651603015164 0ustar peterpeterProblems with DEC OSF/1 V2.0 Compilation using gcc fails with ntp_config.c. The problem is an apparent error in the /usr/include/sys/procset.h and /usr/include/sys/wait.h include files. cowbird:/usr/include/sys# diff -c wait.h.orig wait.h *** wait.h.orig Tue Feb 22 02:41:38 1994 --- wait.h Thu Aug 25 14:52:57 1994 *************** *** 298,304 **** #else _BEGIN_CPLUSPLUS ! extern int waitid(idtype_t, id_t, siginfo_t *, int); _END_CPLUSPLUS #endif /* _NO_PROTO */ --- 298,304 ---- #else _BEGIN_CPLUSPLUS ! extern int waitid(idtype_t, pid_t, siginfo_t *, int); _END_CPLUSPLUS #endif /* _NO_PROTO */ cowbird:/usr/include/sys# diff -c procset.h.orig procset.h *** procset.h.orig Tue Feb 22 02:41:44 1994 --- procset.h Thu Aug 25 14:43:52 1994 *************** *** 86,95 **** */ idtype_t p_lidtype; /* The id type for the left set. */ ! id_t p_lid; /* The id for the left set. */ idtype_t p_ridtype; /* The id type of for right set. */ ! id_t p_rid; /* The id of the right set. */ } procset_t; --- 86,95 ---- */ idtype_t p_lidtype; /* The id type for the left set. */ ! pid_t p_lid; /* The id for the left set. */ idtype_t p_ridtype; /* The id type of for right set. */ ! pid_t p_rid; /* The id of the right set. */ } procset_t; Also, if using gcc from the freeware disk, either replace syscall.h in the directory /usr/local/lib/gcc-lib/alpha-dec-osf1/2.3.3/include or replace with a link to /usr/include/sys/syscall.h. ntp-4.2.6p5/html/hints/parse0000644000175000017500000000566311307651605014755 0ustar peterpeterCompilation: Usual thing: rm -f Config.local ; make for vanilla make refconf for reference clock (e. g. DCF77) Directory contents: hints/PARSE - this file xntpd/refclock_parse.c - reference clock support for DCF77/GPS in xntp parse/parse.c - Reference clock data parser framework parse/parse_conf.c - parser configuration (clock types) parse/clk_meinberg.c - Meinberg clock formats (DCF U/A 31, PZF 535, GPS166) parse/clk_schmid.c - Schmid receiver (DCF77) parse/clk_rawdcf.c - 100/200ms pulses via 50 Baud line (DCF77) parse/clk_dcf7000.c - ELV DCF7000 (DCF77) parse/clk_trimble.c - Trimble SV6 GPS receiver If you want to add new clock types please check with kardel@informatik.uni-erlangen.de. These files implement the conversion of RS232 data streams into timing information used by refclock_parse.c which is mostly generic except for NTP configuration constants. parse/Makefile.kernel - *SIMPLE* makefile to build a loadable STREAMS module for SunOS 4.x / SunOS 5.x systems parse/parsestreams.c - SUN Streams module (loadable) for radio clocks This streams module is designed for SunOS 4.1.X. parse/parsesolaris.c - SUN Streams module (loadable) for radio clocks. This streams module is designed for SunOS 5.x Beware this is still new - so it might crash your machine (we have seen it working, though). parse/parsetest.c - simple test program for STREAMS module. Its so simple, that it doesn't even set TTY-modes, thus they got to be correct on startup - works for Meinberg receivers parse/testdcf.c - test program for raw DCF77 (100/200ms pulses) receivers include/parse.h - interface to "parse" module and more include/parse_conf.h - interface to "parse" configuration include/sys/parsestreams.h - STREAMS specific definitions scripts/support - scripts (perl & sh) for statistics and rc startup the startup scripts are used in Erlangen for starting the daemon on a variety of Suns and HPs and for Reference Clock startup on Suns These scripts may or may not be helpful to you. Supported clocks: Meinberg DCF U/A 31 Meinberg PZF535/TCXO (Software revision PZFUERL 4.6) Meinberg PZF535/OCXO (Software revision PZFUERL 4.6) Meinberg GPS166 (Software version for Uni-Erlangen) ELV DCF7000 (not recommended - casual/emergency use only) Conrad DCF77 receiver (email: time@informatik.uni-erlangen.de) + level converter TimeBrick (email: time@informatik.uni-erlangen.de) Schmid Receiver Kit Trimble SV6 GPS receiver Addresses: Meinberg Funkuhren Auf der Landwehr 22 31812 Bad Pyrmont Germany Tel.: 05281/20 18 FAX: 05281/60 81 80 ELV Kundenservice Postfach 1000 26787 Leer Germany Tel.: 0491/60 08 88 Walter Schmidt Eichwisrain 14 8634 Hombrechtikon Switzerland If you have problems mail to: time@informatik.uni-erlangen.de We'll help (conditions permitting) ntp-4.2.6p5/html/authopt.html0000644000175000017500000007376411606456561015162 0ustar peterpeter Authentication Options

    Authentication Options

    giffrom Alice's Adventures in Wonderland, Lewis Carroll

    Our resident cryptographer; now you see him, now you don't.

    Last update: 14-Apr-2010 20:49 UTC


    Related Links

    Table of Contents


    Introduction

    This page describes the various cryptographic authentication provisions in NTPv4. Details about the configuration commands and options are given on the Configuration Options page. Details about the automatic server discovery schemes are described on the Automatic Server Discovery Schemes page. Additional information is available in the papers, reports, memoranda and briefings cited on the NTP Project page. Authentication support allows the NTP client to verify that servers are in fact known and trusted and not intruders intending accidentally or intentionally to masquerade as a legitimate server.

    The NTPv3 specification RFC-1305 defines a scheme properly described as symmetric key cryptography. It uses the Data Encryption Standard (DES) algorithm operating in cipher-block chaining (CBC) mode. Subsequently, this scheme was replaced by the RSA Message Digest 5 (MD5) algorithm commonly called keyed-MD5. Either algorithm computes a message digest or one-way hash which can be used to verify the client has the same key and key identifier as the server. If the OpenSSL cryptographic library is installed, support is available for all algorithms included in the library. Note however, if conformance to FIPS 140-2 is required, only a limited subset of these algorithms is available.

    NTPv4 includes the NTPv3 scheme and optionally a new scheme based on public key cryptography and called Autokey. Public key cryptography is generally considered more secure than symmetric key cryptography, since the security is based on private and public values which are generated by each participant and where the private value is never revealed. Autokey uses X.509 public certificates, which can be produced by commercial services, utility programs in the OpenSSL software library or the ntp-keygen utility program in the NTP software distribution.

    While the algorithms for MD5 symmetric key cryptography are included in the NTPv4 software distribution, modern algorithms for symmetric key and public key cryptograpny requires the OpenSSL software library to be installed before building the NTP distribution. This library is available from http://www.openssl.org and can be installed using the procedures outlined in the Building and Installing the Distribution page. Once installed, the configure and build process automatically detects the library and links the library routines required.

    Note that according to US law, NTP binaries including OpenSSL library components, including the OpenSSL library itself, cannot be exported outside the US without license from the US Department of Commerce. Builders outside the US are advised to obtain the OpenSSL library directly from OpenSSL, which is outside the US, and build outside the US.

    Authentication is configured separately for each association using the key or autokey option of the server configuration command, as described in the Server Options page, and the options described on this page. The ntp-keygen page describes the files required for the various authentication schemes. Further details are in the briefings, papers and reports at the NTP project page linked from www.ntp.org.

    Symmetric Key Cryptography

    The original RFC-1305 specification allows any one of possibly 65,534 keys (excluding zero), each distinguished by a 32-bit key ID, to authenticate an association. The servers and clients involved must agree on the key, key ID and key type to authenticate NTP packets. If an NTP packet includes a message authentication code (MAC), consisting of a key ID and message digest, it is accepted only if the key ID matches a trusted key and the message digest is verified with this key. Note that for historic reasons the message digest algorithm is not consistent with RFC-1828. The digest is computed directly from the concatenation of the key string followed by the packet contents with the exception of the MAC itself.

    Keys and related information are specified in a keys file, usually called ntp.keys, which must be distributed and stored using secure means beyond the scope of the NTP protocol itself. Besides the keys used for ordinary NTP associations, additional keys can be used as passwords for the ntpq and ntpdc utility programs. Ordinarily, the ntp.keys file is generated by the ntp-keygen program, but it can be constructed and edited using an ordinary text editor. The program generates pseudo-random keys, one key for each line. Each line consists of three fields, the key identifier as a decimal number from 1 to 65534 inclusive, a key type chosen from the keywords of the digest option of the crypto command, and a 20-character printable ASCII string or a 40-character hex string as the key itself.

    When ntpd is first started, it reads the key file specified by the keys command and installs the keys in the key cache. However, individual keys must be activated with the trustedkey configuration command before use. This allows, for instance, the installation of possibly several batches of keys and then activating a key remotely using ntpdc. The requestkey command selects the key ID used as the password for the ntpdc utility, while the controlkey command selects the key ID used as the password for the ntpq utility.

    By default, the message digest algorithm is MD5 selected by the key type M in the keys file. However, if the OpenSSL library is installed, any message digest algorithm supported by that library can be used. The key type is selected as the algorithm name given in the OpenSSL documentation. The key type is associated with the key and can be different for different keys. The server and client must share the same key, key ID and key type and both must be trusted. Note that if conformance to FIPS 140-2 is required, the message digest algorithm must conform to the Secure Hash Standard (SHS), which requires an algorithm from the Secure Hash Algorithm (SHA) family, and the digital signature encryption algorithm, if used, must conform to the Digital Signature Standard (DSS), which requires the Digital Signature Algorithm (DSA).

    In addition to the above means, ntpd now supports Microsoft Windows MS-SNTP authentication using Active Directory services. This support was contributed by the Samba Team and is still in development. It is enabled using the mssntp flag of the restrict command described on the Access Control Options page. Note: Potential users should be aware that these services involve a TCP connection to another process that could potentially block, denying services to other users. Therefore, this flag should be used only for a dedicated server with no clients other than MS-SNTP.

    Public Key Cryptography

    NTPv4 supports the Autokey security protocol, which is based on public key cryptography. The Autokey Version 2 protocol described on the Autokey Protocol page verifies packet integrity using MD5 message digests and verifies the source using digital signatures and any of several digest/signature schemes. Optional identity schemes described on the Autokey Identity Schemes page are based on cryptographic challenge/response exchanges. These schemes provide strong security against replay with or without message modification, spoofing, masquerade and most forms of clogging attacks. These schemes are described along with an executive summary, current status, briefing slides and reading list on the Autonomous Authentication page.

    Autokey authenticates individual packets using cookies bound to the IP source and destination addresses. The cookies must have the same addresses at both the server and client. For this reason operation with network address translation schemes is not possible. This reflects the intended robust security model where government and corporate NTP servers are operated outside firewall perimeters.

    There are three timeouts associated with the Autokey scheme. The key list timeout, which defaults to about 1.1 h, specifies the interval between generating new key lists. The revoke timeout, which defaults to about 36 h, specifies the interval between generating new private values. The restart timeout, with default about 5 d, specifies the interval between protocol restarts to refresh public values. In general, the behavior when these timeouts expire is not affected by the issues discussed on this page.

    NTP Secure Groups

    NTP secure groups are used to define cryptographic compartments and security hierarchies. All hosts belonging to a secure group have the same group name but different host names. The string specified in the host option of the crypto command is the name of the host and the name used in the host key, sign key and certificate files. The string specified in the ident option of the crypto command is the group name of all group hosts and the name used in the identity files. The file naming conventions are described on the ntp-keygen page.

    Each group includes one or more trusted hosts (THs) operating at the root, or lowest stratum in the group. The group name is used in the subject and issuer fields of the TH self-signed trusted certificate for these hosts. The host name is used in the subject and issuer fields of the self-signed certificates for all other hosts.

    All group hosts are configured to provide an unbroken path, called a certificate trail, from each host, possibly via intermediate hosts and ending at a TH. When a host starts up, it recursively retrieves the certificates along the trail in order to verify group membership and avoid masquerade and middleman attacks.

    Secure groups can be configured as hierarchies where a TH of one group can be a client of one or more other groups operating at a lower stratum. A certificate trail consist of a chain of hosts starting at a client, leading through secondary servers of progressively lower stratum and ending at a TH. In one scenario, groups RED and GREEN can be cryptographically distinct, but both be clients of group BLUE operating at a lower stratum. In another scenario, group CYAN can be a client of multiple groups YELLOW and MAGENTA, both operating at a lower stratum. There are many other scenarios, but all must be configured to include only acyclic certificate trails.

    Identity Schemes and Cryptotypes

    All configurations include a public/private host key pair and matching certificate. Absent an identity scheme, this is a Trusted Certificate (TC) scheme. There are three identity schemes, IFF, GQ and MV described on the Identity Schemes page. With these schemes all servers in the group have encrypted server identity keys, while clients have nonencrypted client identity parameters. The client parameters can be obtained from a trusted agent (TA), usually one of the THs of the lower stratum group. Further information on identity schemes is on the Autokey Identity Schemes page.

    A specific combination of authentication and identity schemes is called a cryptotype, which applies to clients and servers separately. A group can be configured using more than one cryptotype combination, although not all combinations are interoperable. Note however that some cryptotype combinations may successfully intemperate with each other, but may not represent good security practice. The server and client cryptotypes are defined by the the following codes.

    NONE
    A client or server is type NONE if authentication is not available or not configured. Packets exchanged between client and server have no MAC.
    AUTH
    A client or server is type AUTH if the key option is specified with the server configuration command and the client and server keys are compatible. Packets exchanged between clients and servers have a MAC.
    PC
    A client or server is type PC if the autokey option is specified with the server configuration command and compatible host key and private certificate files are present. Packets exchanged between clients and servers have a MAC.
    TC
    A client or server is type TC if the autokey option is specified with the server configuration command and compatible host key and public certificate files are present. Packets exchanged between clients and servers have a MAC.
    IDENT
    A client or server is type IDENT if the autokey option is specified with the server configuration command and compatible host key, public certificate and identity scheme files are present. Packets exchanged between clients and servers have a MAC.

    The compatible cryptotypes for clients and servers are listed in the following table.

    Client/Server NONE AUTH PC TC IDENT
    NONE yes yes* yes* yes* yes*
    AUTH no yes no no no
    PC no no yes no no
    TC no no no yes yes
    IDENT no no no no yes

    * These combinations are not valid if the restriction list includes the notrust option.

    Configuration

    Autokey has an intimidating number of configuration options, most of which are not necessary in typical scenarios. The simplest scenario consists of a TH where the host name of the TH is also the name of the group. For the simplest identity scheme TC, the TH generates host key and trusted certificate files using the ntp-keygen -T command, while the remaining group hosts use the same command with no options to generate the host key and public certificate files. All hosts use the crypto configuration command with no options. Configuration with passwords is described in the ntp-keygen page. All group hosts are configured as an acyclic tree with root the TH.

    When an identity scheme is included, for example IFF, the TH generates host key, trusted certificate and private server identity key files using the ntp-keygen -T -I -i group command, where group is the group name. The remaining group hosts use the same command as above. All hosts use the crypto ident group configuration command.

    Hosts with no dependent clients can retrieve client parameter files from an archive or web page. The ntp-keygen can export these data using the -e option. Hosts with dependent clients other than the TH must retrieve copies of the server key files using secure means. The ntp-keygen can export these data using the -q option. In either case the data are installed as a file and then renamed using the name given as the first line in the file, but without the filestamp.

    Examples

    gif

    Consider a scenario involving three secure groups RED, GREEN and BLUE. RED and BLUE are typical of national laboratories providing certified time to the Internet at large. As shown ion the figure, RED TH mort and BLUE TH macabre run NTP symmetric mode with each other for monitoring or backup. For the purpose of illustration, assume both THs are primary servers. GREEN is typical of a large university providing certified time to the campus community. GREEN TH howland is a broadcast client of both RED and BLUE. BLUE uses the IFF scheme, while both RED and GREEN use the GQ scheme, but with different keys. YELLOW is a client of GREEN and for purposes of illustration a TH for YELLOW.

    The BLUE TH macabre uses configuration commands

    crypto pw qqsv ident blue
    peer mort autokey
    broadcast address autokey

    where qqsv is the password for macabre files and address is the broadcast address for the local LAN. It generates BLUE files using the commands

    ntp-keygen -p qqsv -T -G -i blue
    ntp-keygen -p qqsv -e >ntpkey_gqpar_blue

    The first line generates the host, trusted certificate and private GQ server keys file. The second generates the public GQ client parameters file, which can have any nonconflicting mnemonic name.

    The RED TH mort uses configuration commands

    crypto pw xxx ident red
    peer macabre autokey
    broadcast address autokey

    where xxx is the password for mort files. It generates RED files using the commands

    ntp-keygen -p xxx -T -I -i red
    ntp-keygen -p xxx -e >ntpkey_iffpar_red

    The GREEN TH howland uses configuration commands

    crypto pw yyy ident green
    broadcastclient

    where yyy is the password for howland files. It generates GREEN files using the commands

    ntp-keygen -p yyy -T -G -i green
    ntp-keygen -p yyy -e >ntpkey_gqpar_green
    ntp-keygen -p yyy -q zzz >zzz_ntpkey_gqkey_green

    The first two lines serve the same purpose as the preceding examples. The third line generates a copy of the private GREEN server file for use on another server in the same group, say YELLOW, but encrypted with the zzz password.

    A client of GREEN, for example YELLOW, uses the configuration commands

    crypto pw abc ident green
    server howland autokey

    where abc is the password for its files. It generates files using the command

    ntp-keygen -p abc

    The client retrieves the client file for that group from a public archive or web page using nonsecure means. In addition, each server in a group retrieves the private server keys file from the TH of that group, but it is encrypted and so must be sent using secure means. The files are installed in the keys directory with name taken from the first line in the file, but without the filestamp.

    Note that if servers of different groups, in this case RED and BLUE, share the same broadcast media, each server must have client files for all groups other than its own, while each client must have client files for all groups. Note also that this scenario is for illustration only and probably would not be wise for practical use, as if one of the TH reference clocks fails, the certificate trail becomes cyclic. In such cases the symmetric path between RED and BLUE, each in a different group, would not be a good idea.

    Authentication Commands

    automax [logsec]
    Specifies the interval between regenerations of the session key list used with the Autokey protocol, as a power of 2 in seconds. Note that the size of the key list for each association depends on this interval and the current poll interval. The default interval is 12 (about 1.1 h). For poll intervals above the specified interval, a session key list with a single entry will be regenerated for every message sent.
    controlkey keyid
    Specifies the key ID to use with the ntpq utility, which uses the standard protocol defined in RFC-1305. The keyid argument is the key ID for a trusted key, where the value can be in the range 1 to 65534, inclusive.
    crypto [randfile file] [host name] [ident name] [pw password]
    This command requires the OpenSSL library. It activates public key cryptography and loads the required host key and public certificate. If one or more files are left unspecified, the default names are used as described below. Unless the complete path and name of the file are specified, the location of a file is relative to the keys directory specified in the keysdir configuration command or default /usr/local/etc. Following are the options.
    digest MD2 | MD4 | MD5 | MDC2 | RIPEMD160 | SHA | SHA1
    Specify the message digest algorithm, with default MD5. If the OpenSSL library is installed, name can be be any message digest algorithm supported by the library not exceeding 160 bits in length. However, all Autokey participants in an Autokey subnet must use the same algorithm. Note that the Autokey message digest algorithm is separate and distinct form the symmetric key message digest algorithms. Note: If compliance with FIPS 140-2 is required, the algorithm must be ether SHA or SHA1.
    host name
    Specifies the string used when constructing the names for the host, sign and certificate files generated by the ntp-keygen program with the -s name option.
    ident name
    Specifies the string used in constructing the identity files generated by the ntp-keygen program with the -i name option.
    pw password
    Specifies the password to decrypt files previously encrypted by the ntp-keygen program with the -p option.
    randfile file
    Specifies the location of the random seed file used by the OpenSSL library. The defaults are described on the ntp-keygen page.
    keys keyfile
    Specifies the complete path to the MD5 key file containing the keys and key IDs used by ntpd, ntpq and ntpdc when operating with symmetric key cryptography. This is the same operation as the -k command line option. Note that the directory path for Autokey media is specified by the keysdir command.
    keysdir pathK
    This command specifies the default directory path for Autokey cryptographic keys, parameters and certificates. The default is /usr/local/etc/. Note that the path for the symmetric keys file is specified by the keys command.
    requestkey keyid
    Specifies the key ID to use with the ntpdc utility program, which uses a proprietary protocol specific to this implementation of ntpd. The keyid argument is a key ID for a trusted key, in the range 1 to 65534, inclusive.
    revoke [logsec]
    Specifies the interval between re-randomization of certain cryptographic values used by the Autokey scheme, as a power of 2 in seconds. These values need to be updated frequently in order to deflect brute-force attacks on the algorithms; however, updating some values is a relatively expensive operation. The default interval is 17 (about 36 h). For poll intervals above the specified interval, the values will be updated for every message sent.
    trustedkey [keyid | (lowid ... highid)] [...]
    Specifies the key ID(s) which are trusted for the purposes of authenticating peers with symmetric key cryptography. Key IDs used to authenticate ntpq and ntpdc operations must be listed here and additionally be enabled with controlkey and/or requestkey. The authentication procedure for time transfer require that both the local and remote NTP servers employ the same key ID and secret for this purpose, although different keys IDs may be used with different servers. Ranges of trusted key IDs may be specified: "trustedkey (1 ... 19) 1000 (100 ... 199)" enables the lowest 120 key IDs which start with the digit 1. The spaces surrounding the ellipsis are required when specifying a range.

    Error Codes

    Errors can occur due to mismatched configurations, unexpected protocol restarts, expired certificates and unfriendly people. In most cases the protocol state machine recovers automatically by retransmission, timeout and restart, where necessary. Some errors are due to mismatched keys, digest schemes or identity schemes and must be corrected by installing the correct media and/or correcting the configuration file. One of the most common errors is expired certificates, which must be regenerated and signed at least once per year using the ntp-keygen - generate public and private keys program.

    The following error codes are reported via the NTP control and monitoring protocol trap mechanism and to the cryptostats monitoring file if configured.

    101 bad field format or length
    The packet has invalid version, length or format.
    102 bad timestamp
    The packet timestamp is the same or older than the most recent received. This could be due to a replay or a server clock time step.
    103 bad filestamp
    The packet filestamp is the same or older than the most recent received. This could be due to a replay or a key file generation error.
    104 bad or missing public key
    The public key is missing, has incorrect format or is an unsupported type.
    105 unsupported digest type
    The server requires an unsupported digest/signature scheme.
    106 unsupported identity type
    The client or server has requested an identity scheme the other does not support.
    107 bad signature length
    The signature length does not match the current public key.
    108 signature not verified
    The message fails the signature check. It could be bogus or signed by a different private key.
    109 certificate not verified
    The certificate is invalid or signed with the wrong key.
    110 host certificate expired
    The old server certificate has expired.
    111 bad or missing cookie
    The cookie is missing, corrupted or bogus.
    112 bad or missing leapseconds table
    The leapseconds table is missing, corrupted or bogus.
    113 bad or missing certificate
    The certificate is missing, corrupted or bogus.
    114 bad or missing group key
    The identity key is missing, corrupt or bogus.
    115 protocol error
    The protocol state machine has wedged due to unexpected restart.

    Files

    See the ntp-keygen page. Note that provisions to load leap second values from the NIST files have been removed. These provisions are now available whether or not the OpenSSL library is available. However, the functions that can download these values from servers remains available.


    ntp-4.2.6p5/html/xleave.html0000644000175000017500000001076711307651603014744 0ustar peterpeter NTP Interleaved Modes

    NTP Interleaved Modes

    giffrom Pogo, Walt Kelly

    You need a little magic.

    Last update: 03-May-2009 3:37 UTC



    In the protocol described in the NTP specification and implemented today the transmit timestamp is captured before the MD5 digest is computed and the packet is sent, while the receive timestamp is captured after the packet is received. For enhanced accuracy it is desirable to capture the timestamps as close to the wire as possible; i.e., with hardware assist or with a modified driver.

    The problem is, while the receive timestamp could in principle be piggybacked in the receive buffer, the transmit timestamp cannot ordinarily be transmitted in the same packet. A solution for this problem is the two-step or interleaved protocol described on this page and included in the the current reference implementation. In this experimental variant the transmit timestamp for one packet is actually carried in the immediately following packet. The trick, however, is to implement the interleaved protocol without changing the NTP packet header format, without compromising backwards compatibility and without compromising the error recovery properties.

    Currently, the reference implementation uses only software timestamps (softstamps). The receive softstamp is captured at software interrupt time and before the buffer is queued for later processing. The reference implementation captures a softstamp before the message digest routine and another after the send-packet routine. In this design the latter timestamp can be considered most accurate, as it avoids the kernel latencies and queueing mechanisms. The difference, called the interleaved or output delay, varies from 16 ms for a dual-core, 2.8 GHz Pentium 4 running FreeBSD 6.1 to 1100 ms for a Sun Blade 1500 running Solaris 10.

    Performacne varies widely between machines and network interface cards on a 100-Mb switched Ethernet where the NTP packet is about 1000 bits or 10 ms. On two identical Pentium 4 machines in symmetric mode, the measured output delay is 16 ms and remaining one-way delay components 45-150 ms. Two LAN segments account for 20 ms, which leaves 25-130 ms for input delay. On two identical UltraSPARC machines running Solaris 10 in symmetric mode, the measured output delay is 160 ms and remaining one-way delay components 195 ms. Two LAN segments account for 20 ms, which leaves 175 ms for input delay.

    Performance with the Pentia show a residual jitter of about 20 ms, which is by far the best performance so far. However, much better performance could result if the input delay could be reduced or elminated with driver or hardware timestamps. Should that be done, performance should be in the same order as the the PPS and kernel discipline, which is in the order of 2 ms.

    Interleaved modes can be used only in NTP symmetric and broadcast modes. It is activated by the xleave option with the peer or broadcast configuration commands. The NTP protocol automatically reconfigures in normal or interleaved mode as required. Ordinary broadcast clients can use the same servers as interleaved broadcast clients at the same time. Further details are in the white paper NTP Interleaved On-Wire Protocol and the briefing Interleaved Synchronization Protocols for LANs and Space Data Links.


    gif

    ntp-4.2.6p5/html/clockopt.html0000644000175000017500000002271511307651604015273 0ustar peterpeter Reference Clock Options

    Reference Clock Options

    gifMaster Time Facility at the UDel Internet Research Laboratory

    Last update: 04-Oct-2009 19:42 UTC


    Related Links

    Table of Contents


    Reference Clock Support

    The NTP Version 4 daemon supports some three dozen different radio, satellite and modem reference clocks plus a special pseudo-clock used for backup or when no other clock source is available. Detailed descriptions of individual device drivers and options can be found in the Reference Clock Drivers page. Additional information can be found in the pages linked there, including the Debugging Hints for Reference Clock Drivers and How To Write a Reference Clock Driver pages. In addition, support for a PPS signal is available as described in Pulse-per-second (PPS) Signal Interfacing page.

    A reference clock will generally (though not always) be a radio timecode receiver which is synchronized to a source of standard time such as the services offered by the NRC in Canada and NIST and USNO in the US. The interface between the computer and the timecode receiver is device dependent, but is usually a serial port. A device driver specific to each reference clock must be selected and compiled in the distribution; however, most common radio, satellite and modem clocks are included by default. Note that an attempt to configure a reference clock when the driver has not been compiled or the hardware port has not been appropriately configured results in a scalding remark to the system log file, but is otherwise non hazardous.

    For the purposes of configuration, ntpd treats reference clocks in a manner analogous to normal NTP peers as much as possible. Reference clocks are identified by a syntactically correct but invalid IP address, in order to distinguish them from normal NTP peers. Reference clock addresses are of the form 127.127.t.u, where t is an integer denoting the clock type and u indicates the unit number in the range 0-3. While it may seem overkill, it is in fact sometimes useful to configure multiple reference clocks of the same type, in which case the unit numbers must be unique.

    The server command is used to configure a reference clock, where the address argument in that command is the clock address. The key, version and ttl options are not used for reference clock support. The mode option is added for reference clock support, as described below. The prefer option can be useful to persuade the server to cherish a reference clock with somewhat more enthusiasm than other reference clocks or peers. Further information on this option can be found in the Mitigation Rules and the prefer Keyword page. The minpoll and maxpoll options have meaning only for selected clock drivers. See the individual clock driver document pages for additional information.

    The fudge command is used to provide additional information for individual clock drivers and normally follows immediately after the server command. The address argument specifies the clock address. The refid and stratum options control can be used to override the defaults for the device. There are two optional device-dependent time offsets and four flags that can be included in the fudge command as well.

    The stratum number of a reference clock is by default zero. Since the ntpd daemon adds one to the stratum of each peer, a primary server ordinarily displays an external stratum of one. In order to provide engineered backups, it is often useful to specify the reference clock stratum as greater than zero. The stratum option is used for this purpose. Also, in cases involving both a reference clock and a pulse-per-second (PPS) discipline signal, it is useful to specify the reference clock identifier as other than the default, depending on the driver. The refid option is used for this purpose. Except where noted, these options apply to all clock drivers.

    Reference Clock Commands

    server 127.127.t.u [prefer] [mode int] [minpoll int] [maxpoll int]
    This command can be used to configure reference clocks in special ways. The options are interpreted as follows:
    prefer
    Marks the reference clock as preferred. All other things being equal, this host will be chosen for synchronization among a set of correctly operating hosts. See the Mitigation Rules and the prefer Keyword page for further information.
    mode int
    Specifies a mode number which is interpreted in a device-specific fashion. For instance, it selects a dialing protocol in the ACTS driver and a device subtype in the parse drivers.
    minpoll int
    maxpoll int
    These options specify the minimum and maximum polling interval for reference clock messages in seconds, interpreted as dual logarithms (2 ^ x). For most directly connected reference clocks, both minpoll and maxpoll default to 6 (2^16 = 64 s). For modem reference clocks, minpoll defaults to 10 (2^10 = 1024 s = 17.1 m) and maxpoll defaults to 14 (2^14 = 16384 s = 4.5 h). The allowable range is 4 (16 s) to 17 (36.4 h) inclusive.
    fudge 127.127.t.u [time1 sec] [time2 sec] [stratum int] [refid string] [flag1 0|1] [flag2 0|1] [flag3 0|1] [flag4 0|1]
    This command can be used to configure reference clocks in special ways. It must immediately follow the server command which configures the driver. Note that the same capability is possible at run time using the ntpdc program. The options are interpreted as follows:
    time1 sec
    Specifies a constant to be added to the time offset produced by the driver, a fixed-point decimal number in seconds. This is used as a calibration constant to adjust the nominal time offset of a particular clock to agree with an external standard, such as a precision PPS signal. It also provides a way to correct a systematic error or bias due to serial port or operating system latencies, different cable lengths or receiver internal delay. The specified offset is in addition to the propagation delay provided by other means, such as internal DIPswitches. Where a calibration for an individual system and driver is available, an approximate correction is noted in the driver documentation pages.
    Note: in order to facilitate calibration when more than one radio clock or PPS signal is supported, a special calibration feature is available. It takes the form of an argument to the enable command described in the Miscellaneous Options page and operates as described in the Reference Clock Drivers page.
    time2 secs
    Specifies a fixed-point decimal number in seconds, which is interpreted in a driver-dependent way. See the descriptions of specific drivers in the reference clock drivers page.
    stratum int
    Specifies the stratum number assigned to the driver, an integer between 0 and 15. This number overrides the default stratum number ordinarily assigned by the driver itself, usually zero.
    refid string
    Specifies an ASCII string of from one to four characters which defines the reference identifier used by the driver. This string overrides the default identifier ordinarily assigned by the driver itself.
    flag1 flag2 flag3 flag4
    These four flags are used for customizing the clock driver. The interpretation of these values, and whether they are used at all, is a function of the particular clock driver. However, by convention flag4 is used to enable recording monitoring data to the clockstats file configured with the filegen command. Further information on the filegen command can be found in the Monitoring Options page.

    ntp-4.2.6p5/html/ntptrace.html0000644000175000017500000000533611606456562015305 0ustar peterpeter ntptrace - trace a chain of NTP servers back to the primary source

    ntptrace - trace a chain of NTP servers back to the primary source

    giffrom Alice's Adventures in Wonderland, Lewis Carroll

    The rabbit knows the way back.

    Last update: 19:06 UTC Wednesday, January 16, 2008



    Synopsis

    ntptrace [ -n ] [ -m maxhosts ] [ server ]

    Description

    ntptrace is a perl script that uses the ntpq utility program to follow the chain of NTP servers from a given host back to the primary time source. For ntptrace to work properly, each of these servers must implement the NTP Control and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.

    If given no arguments, ntptrace starts with localhost. Here is an example of the output from ntptrace:

    % ntptrace
    localhost: stratum 4, offset 0.0019529, synch distance 0.144135
    server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784
    usndh.edu: stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
    

    On each line, the fields are (left to right): the host name, the host stratum, the time offset between that host and the local host (as measured by ntptrace; this is why it is not always zero for "localhost"), the host synchronization distance, and (only for stratum-1 servers) the reference clock ID. All times are given in seconds. Note that the stratum is the server hop count to the primary source, while the synchronization distance is the estimated error relative to the primary source. These terms are precisely defined in RFC-1305.

    Options

    -n
    Turns off the printing of host names; instead, host IP addresses are given. This may be useful if a nameserver is down.

    Bugs

    This program makes no attempt to improve accuracy by doing multiple samples.


    ntp-4.2.6p5/html/prefer.html0000644000175000017500000003222611307651603014735 0ustar peterpeter Mitigation Rules and the prefer Keyword

    Mitigation Rules and the prefer Keyword

    gif from Alice's Adventures in Wonderland, Lewis Carroll

    Listen carefully to what I say; it is very complicated.

    Last update: 22-Apr-2009 14:04 UTC


    Related Links

    Table of Contents


    Introduction

    This page summarizes the criteria for choosing from among a number of potential sources suitable contributors to the clock discipline algorithm. The criteria are very meticulous, since they have to handle many different scenarios that may be optimized for peculiar circumstances, including some scenarios designed to support planetary and deep space missions.

    Recall the suite of NTP data acquisition and grooming algorithms as these algorithms proceed in five phases. Phase one discovers the available sources and mobilizes an association for each candidate found. These candidates can result from explicit configuration, broadcast discovery or the pool and manycast autonomous configuration schemes. Phase two grooms the selectable candidates excluding those sources showing one or more of the following errors

    1. A stratum error occurs if (1) the source had never been synchronized or (2) the stratum of the source is below the floor option or not below the ceiling option specified by the tos command. The default value for these options are 0 and 16, respectively.
    2. A distance error occurs for a remote source if the root distance is not below the distance threshold maxdist option of the tos command. The default value for this option is 1.5 s for networks including only the Earth, but this should be increased to 2.5 s for networks including the Moon.
    3. A loop error occurs if the source is synchronized to the client of if the source is synchronized to the same source as the client.
    4. An unreachable error occurs if the source is unreachable or if the server or peer command for the source includes the noselect option.

    Phase three uses an intersection algorithm to select the truechimers from among the candidates, leaving behind the falsetickers. A server or peer configured with the true option is ipso facto a truechimer independent of this algorithm. Phase four uses a clustering algorithm to cast off statistical outliers from the truechimers until a set of survivors not less than the number specified as the minclock option of the tos command, with default 3. Phase five uses a set of mitigation rules to select from among the survivors a system peer from which a set of system statistics can be inherited and passed along to a dependent client population. The clock offset developed from these algorithms can discipline the system clock either using the ntpd clock discipline algorithm or enable the kernel to discipline the system clock directly, as described on the A Kernel Model for Precision Timekeeping page. Phase five is the topic of this page.

    Peer Classification

    The behavior of the various algorithms and mitigation rules involved depends on how the various synchronization sources are classified. This depends on whether the source is local or remote and if local the type of source. The following classes are defined:

    1. An association configured for a remote server or peer is classified simply as a server. All other associations are classified as a device driver of one kind or another. In general, one or more sources of either or both types will be configured in each installation.
    2. If all sources have been lost and the orphan stratum has been specified by the orphan option of the tos command, a pseudo-source called the orphan parent is created with offset and jitter both zero. Dependent orphan children will see the orphan parent as if synchronized to a server at the orphan stratum.If the only survivor is the orphan parent, it becomes the system peer and its clock offset and jitter are inherited by the corresponding system variables. Note that by design all the orphan children having the same set of orphan parents will select the same parent.
    3. When a device driver has been configured for pulse-per-second (PPS) signals and PPS signals are being received, it is designated the PPS driver. Note that the Pulse-per-Second driver (type 22) is often used as a PPS driver, but any driver can be operated as a PPS driver as well. The PPS driver provides precision clock discipline only within +-0.5 s, so is always associated with another source or sources that provide the seconds numbering function.
    4. When the Undisciplined Local Clock driver (type 1) is configured, it is designated the local driver. This driver is used either as a backup source (stratum greater than zero) should all sources fail, or as the primary source (stratum zero) in cases where the kernel time is disciplined by some other means of synchronization, such as the NIST lockclock scheme, or another synchronization protocol such as the Digital Time Synchronization Service (DTSS).
    5. When the Automated Computer Time Service driver (type 18) is configured, it is designated the modem driver. This is used either as a backup source, should all other sources fail, or as the (only) primary source.

    The prefer Peer

    The mitigation rules are designed to provide an intelligent selection of the system peer from among the survivors of different types. When used with the server or peer commands, the prefer option designates one or more survivors as preferred over all others. While the rules do not forbid it, it is usually not useful to designate more than one source as preferred; however, if more than one source is so designated, they are used in the order specified in the configuration file; that is, if the first one becomes unselectable, the second one is considered and so forth. This order of priority is also applicable to multiple PPS drivers, multiple modem drivers and even multiple local drivers, although that would not normally be useful.

    The clustering algorithm works on the set of truechimers produced by the intersection algorithms. Ordinarily, any one of them can in principle provide correct time; however, due to various latency variations, not all can provide the most accurate and stable time. The clustering algorithm, processes the truechimers in one or more rounds to cast off a statistical outlier until no more than the minclock option of the tos command are left. The default for this option is 3.

    In the prefer scheme the clustering algorithm is modified so that the prefer peer is never discarded; on the contrary, its potential removal becomes a rounds-termination condition. However, the prefer peer can still be discarded by the intersection algorithm as a falseticker. To avoid this, it is usually wise to increase the mindist option of the tos command from the default .005 s to something like .05 s.

    Ordinarily, the combining algorithm computes a weighted average of the survivor offsets to produce the final synchronization source. However, if a prefer peer is among the survivors, the combining algorithm is not used. Instead, the offset of the prefer peer is used exclusively as the final synchronization source. In the common case involving a radio clock and a flock of remote backup servers, and with the radio clock designated a prefer peer, the result is that the radio clock normally disciplines the system clock as long as the radio itself remains operational. However, if the radio fails or becomes a falseticker, the averaged backup sources continue to discipline the system clock.

    Mitigation Rules

    As the selection algorithm scans the associations for selectable candidates, the modem driver and local driver are segregated for later, but only if not designated a prefer peer. If so designated, a driver is included among the candidate population. In addition, if orphan parents are found the parent with the lowest metric is segregated for later; the others are discarded. For this purpose the metric is defined as the four-octet IPv4 address or the first four octets of the hashed IPv6 address. The resulting candidates, including any prefer peers found, are processed by the intersection to produce a possibly empty set of truechimers. The clustering algorithm ranks the truechimers first by stratum then by synchronization distance and designates the survivor with the lowest distance as the potential system peer.

    If one or more truechimers support a pulse-per-second (PPS) signal and the PPS signal is operating correctly, it is designated a PPS driver. If more than one PPS diver are found, only the first one is used. The PPS driver is not included in the combining algorithm and is mitigated separately.

    At this point we have the following contributors to the system clock discipline:

    • (potential) system peer, if there are survivors;
    • orphan parent, if present;
    • local driver and zero offset, if present;
    • modem driver and modem offset, if present;
    • prefer peer and offset, if present;
    • PPS driver and offset, if present.

    The mitigation algorithm proceeds in three steps in turn.

    1. If there are no survivors, the modem driver becomes the only survivor if there is one. If not, the local driver becomes the only survivor if there is one. If not, the orphan parent becomes the only survivor if there is one. If the number of survivors at this point is less than the minsane option of the tos command, the algorithm is terminated and the system variables remain unchanged. Note that minsane is by default 1, but can be set at any value including 0.
    2. If the prefer peer is among the survivors, it becomes the system peer and its clock offset and jitter are inherited by the corresponding system variables. Otherwise, the combining algorithm computes these variables from the survivor population.
    3. If there is a PPS driver and the system clock offset at this point is less than 0.4 s, and if there is a prefer peer among the survivors or if the PPS peer is designated as a prefer peer, the PPS driver becomes the system peer and its offset and jitter are inherited by the system variables, thus overriding any variables already computed. Note that a PPS driver is present only if PPS signals are actually being received and enabled by the associated driver.

    If none of the above is the case, the data are disregarded and the system variables remain as they are.

    The minsane Option

    The minsane option of the tos command, the prefer option of the server and peer commands and the flag options of the fudge command for the PPS driver can be used with the mitigation rules to provide many useful configurations. The minsane option specifies the minimum number of survivors required to synchronized the system clock. The prefer option designates the prefer peer. The driver-dependent flag options enable the PPS driver for various conditions.

    A common scenario is a GPS driver with a serial timecode and PPS signal. The PPS signal is disabled until the system clock has been set by some means, not necessarily the GPS driver. If the serial timecode is within 0.4 s of the PPS signal, the GPS driver is designated the PPS driver and the PPS signal disciplines the system clock. If no GPS satellites are in view, or if the PPS signal is disconnected, the GPS driver stops updating the system clock and so eventually becomes unreachable and replaced by other sources..

    Whether or not the GPS driver disables the PPS signal when unreachable is at the discretion of the driver. Ordinarily, the PPS signal would be disabled in this case; however, When the GPS receiver has a precision holdover oscillator, the driver may elect to continue PPS operation. In this case the PPS signal continues to discipline the system clock.

     


    ntp-4.2.6p5/html/ntpdc.html0000644000175000017500000005541611606456562014601 0ustar peterpeter ntpdc - special NTP query program

    ntpdc - special NTP query program

    giffrom Alice's Adventures in Wonderland, Lewis Carroll

    This program is a big puppy.

    Last update: 01:11 UTC Saturday, November 24, 2007


    More Help


    Synopsis

    ntpdc [ -46dilnps ] [ -c command ] [ host ] [ ... ]

    Description

    ntpdc is used to query the ntpd daemon about its current state and to request changes in that state. The program may be run either in interactive mode or controlled using command line arguments. Extensive state and statistics information is available through the ntpdc interface. In addition, nearly all the configuration options which can be specified at startup using ntpd's configuration file may also be specified at run time using ntpdc.

    If one or more request options are included on the command line when ntpdc is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, ntpdc will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. ntpdc will prompt for commands if the standard input is a terminal device.

    ntpdc uses NTP mode 7 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. ntpdc makes no attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.

    The operation of ntpdc are specific to the particular implementation of the ntpd daemon and can be expected to work only with this and maybe some previous versions of the daemon. Requests from a remote ntpdc program which affect the state of the local server must be authenticated, which requires both the remote program and local server share a common key and key identifier.

    Note that in contexts where a host name is expected, a -4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS resolution to the IPv6 namespace.

    Command Line Options

    Specifying a command line option other than -i or -n will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, ntpdc will attempt to read interactive format commands from the standard input.

    -4
    Force DNS resolution of following host names on the command line to the IPv4 namespace.
    -6
    Force DNS resolution of following host names on the command line to the IPv6 namespace.
    -c command
    The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). Multiple -c options may be given.
    -d
    Turn on debugging mode.
    -i
    Force ntpdc to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input.
    -l
    Obtain a list of peers which are known to the server(s). This switch is equivalent to -c listpeers.
    -n
    Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names.
    -p
    Print a list of the peers known to the server as well as a summary of their state. This is equivalent to -c peers.
    -s
    Print a list of the peers known to the server as well as a summary of their state, but in a slightly different format than the -p switch. This is equivalent to -c dmpeers.

    Interactive Commands

    Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to uniquely identify the command need be typed. The output of a command is normally sent to the standard output, but optionally the output of individual commands may be sent to a file by appending a <, followed by a file name, to the command line.

    A number of interactive format commands are executed entirely within the ntpdc program itself and do not result in NTP mode 7 requests being sent to a server. These are described following.

    ? [ command_keyword ]
    help [ command_keyword ]
    A ? by itself will print a list of all the command keywords known to this incarnation of ntpq. A ? followed by a command keyword will print function and usage information about the command. This command is probably a better source of information about ntpq than this manual page.
    delay milliseconds
    Specify a time interval to be added to timestamps included in requests which require authentication. This is used to enable (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized. Actually the server does not now require timestamps in authenticated requests, so this command may be obsolete.
    host hostname
    Set the host to which future queries will be sent. Hostname may be either a host name or a numeric address.
    hostnames [ yes | no ]
    If yes is specified, host names are printed in information displays. If no is specified, numeric addresses are printed instead. The default is yes, unless modified using the command line -n switch.
    keyid keyid
    This command allows the specification of a key number to be used to authenticate configuration requests from ntpdc to the host(s). This must correspond to a key number which the host/server has been configured to use for this purpose (server options: trustedkey, and requestkey). If authentication is not enabled on the host(s) for ntpdc commands, the command "keyid 0" should be given; otherwise the keyid of the next subsequent addpeer/addserver/broadcast command will be used.
    quit
    Exit ntpdc.
    passwd
    This command prompts you to type in a password (which will not be echoed) which will be used to authenticate configuration requests. The password must correspond to the key configured for use by the NTP server for this purpose if such requests are to be successful.
    timeout milliseconds
    Specify a timeout period for responses to server queries. The default is about 8000 milliseconds. Note that since ntpdc retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set.

    Control Message Commands

    Query commands result in NTP mode 7 packets containing requests for information being sent to the server. These are read-only commands in that they make no modification of the server configuration state.

    listpeers
    Obtains and prints a brief list of the peers for which the server is maintaining state. These should include all configured peer associations as well as those peers whose stratum is such that they are considered by the server to be possible future synchronization candidates.
    peers
    Obtains a list of peers for which the server is maintaining state, along with a summary of that state. Summary information includes the address of the remote peer, the local interface address (0.0.0.0 if a local address has yet to be determined), the stratum of the remote peer (a stratum of 16 indicates the remote peer is unsynchronized), the polling interval, in seconds, the reachability register, in octal, and the current estimated delay, offset and dispersion of the peer, all in seconds.

    The character in the left margin indicates the mode this peer entry is operating in. A + denotes symmetric active, a - indicates symmetric passive, a = means the remote server is being polled in client mode, a ^ indicates that the server is broadcasting to this address, a ~ denotes that the remote peer is sending broadcasts and a * marks the peer the server is currently synchronizing to.

    The contents of the host field may be one of four forms. It may be a host name, an IP address, a reference clock implementation name with its parameter or REFCLK(implementation number, parameter). On hostnames no only IP-addresses will be displayed.

    dmpeers
    A slightly different peer summary list. Identical to the output of the peers command, except for the character in the leftmost column. Characters only appear beside peers which were included in the final stage of the clock selection algorithm. A . indicates that this peer was cast off in the falseticker detection, while a + indicates that the peer made it through. A * denotes the peer the server is currently synchronizing with.
    showpeer peer_address [...]
    Shows a detailed display of the current peer variables for one or more peers. Most of these values are described in the NTP Version 2 specification.
    pstats peer_address [...]
    Show per-peer statistic counters associated with the specified peer(s).
    clockinfo clock_peer_address [...]
    Obtain and print information concerning a peer clock. The values obtained provide information on the setting of fudge factors and other clock performance information.
    kerninfo
    Obtain and print kernel phase-lock loop operating parameters. This information is available only if the kernel has been specially modified for a precision timekeeping function.
    loopinfo [ oneline | multiline ]
    Print the values of selected loop filter variables. The loop filter is the part of NTP which deals with adjusting the local system clock. The offset is the last offset given to the loop filter by the packet processing code. The frequency is the frequency error of the local clock in parts-per-million (ppm). The time_const controls the stiffness of the phase-lock loop and thus the speed at which it can adapt to oscillator drift. The watchdog timer value is the number of seconds which have elapsed since the last sample offset was given to the loop filter. The oneline and multiline options specify the format in which this information is to be printed, with multiline as the default.
    sysinfo
    Print a variety of system state variables, i.e., state related to the local server. All except the last four lines are described in the NTP Version 3 specification, RFC-1305.

    The system flags show various system flags, some of which can be set and cleared by the enable and disable configuration commands, respectively. These are the auth, bclient, monitor, pll, pps and stats flags. See the ntpd documentation for the meaning of these flags. There are two additional flags which are read only, the kernel_pll and kernel_pps. These flags indicate the synchronization status when the precision time kernel modifications are in use. The kernel_pll indicates that the local clock is being disciplined by the kernel, while the kernel_pps indicates the kernel discipline is provided by the PPS signal.

    The stability is the residual frequency error remaining after the system frequency correction is applied and is intended for maintenance and debugging. In most architectures, this value will initially decrease from as high as 500 ppm to a nominal value in the range .01 to 0.1 ppm. If it remains high for some time after starting the daemon, something may be wrong with the local clock, or the value of the kernel variable tick may be incorrect.

    The broadcastdelay shows the default broadcast delay, as set by the broadcastdelay configuration command.

    The authdelay shows the default authentication delay, as set by the authdelay configuration command.

    sysstats
    Print statistics counters maintained in the protocol module.
    memstats
    Print statistics counters related to memory allocation code.
    iostats
    Print statistics counters maintained in the input-output module.
    timerstats
    Print statistics counters maintained in the timer/event queue support code.
    reslist
    Obtain and print the server's restriction list. This list is (usually) printed in sorted order and may help to understand how the restrictions are applied.
    ifstats
    List interface statistics for interfaces used by ntpd for network communication.
    ifreload
    Force rescan of current system interfaces. Outputs interface statistics for interfaces that could possibly change. Marks unchanged interfaces with ., added interfaces with + and deleted interfaces with -.
    monlist [ version ]
    Obtain and print traffic counts collected and maintained by the monitor facility. The version number should not normally need to be specified.
    clkbug clock_peer_address [...]
    Obtain debugging information for a reference clock driver. This information is provided only by some clock drivers and is mostly undecodable without a copy of the driver source in hand.

    Runtime Configuration Requests

    All requests which cause state changes in the server are authenticated by the server using a configured NTP key (the facility can also be disabled by the server by not configuring a key). The key number and the corresponding key must also be made known to ntpdc. This can be done using the keyid and passwd commands, the latter of which will prompt at the terminal for a password to use as the encryption key. You will also be prompted automatically for both the key number and password the first time a command which would result in an authenticated request to the server is given. Authentication not only provides verification that the requester has permission to make such changes, but also gives an extra degree of protection again transmission errors.

    Authenticated requests always include a timestamp in the packet data, which is included in the computation of the authentication code. This timestamp is compared by the server to its receive time stamp. If they differ by more than a small amount the request is rejected. This is done for two reasons. First, it makes simple replay attacks on the server, by someone who might be able to overhear traffic on your LAN, much more difficult. Second, it makes it more difficult to request configuration changes to your server from topologically remote hosts. While the reconfiguration facility will work well with a server on the local host, and may work adequately between time-synchronized hosts on the same LAN, it will work very poorly for more distant hosts. As such, if reasonable passwords are chosen, care is taken in the distribution and protection of keys and appropriate source address restrictions are applied, the run time reconfiguration facility should provide an adequate level of security.

    The following commands all make authenticated requests.

    addpeer peer_address [ keyid ] [ version ] [ minpoll# | prefer | iburst | burst | minpoll N | maxpoll N [...] ]
    addpeer peer_address [ prefer | iburst | burst | minpoll N | maxpoll N | keyid N | version N [...] ]
    Add a configured peer association at the given address and operating in symmetric active mode. Note that an existing association with the same peer may be deleted when this command is executed, or may simply be converted to conform to the new configuration, as appropriate. If the keyid is nonzero, all outgoing packets to the remote server will have an authentication field attached encrypted with this key. If the value is 0 (or not given) no authentication will be done. If ntpdc's key number has not yet been set (e.g., by the keyid command), it will be set to this value. The version# can be 1 through 4 and defaults to 3. The remaining options are either a numeric value for minpoll or literals prefer, iburst, burst, minpoll N, keyid N, version N, or maxpoll N (where N is a numeric value), and have the action as specified in the peer configuration file command of ntpd. See the Server Options page for further information. Each flag (or its absence) replaces the previous setting. The prefer keyword indicates a preferred peer (and thus will be used primarily for clock synchronisation if possible). The preferred peer also determines the validity of the PPS signal - if the preferred peer is suitable for synchronisation so is the PPS signal. The dynamic keyword allows association configuration even when no suitable network interface is found at configuration time. The dynamic interface update mechanism may complete the configuration when new interfaces appear (e.g. WLAN/PPP interfaces) at a later time and thus render the association operable.
    addserver peer_address [ keyid ] [ version ] [ minpoll# | prefer | iburst | burst | minpoll N | maxpoll N [...] ]
    addserver peer_address [ prefer | iburst | burst | minpoll N | maxpoll N | keyid N | version N [...] ]
    Identical to the addpeer command, except that the operating mode is client.
    broadcast peer_address [ keyid ] [ version ] [ prefer ]
    Identical to the addpeer command, except that the operating mode is broadcast. In this case a valid non-zero key identifier and key are required. The peer_address parameter can be the broadcast address of the local network or a multicast group address assigned to NTP. If a multicast address, a multicast-capable kernel is required.
    unconfig peer_address [...]
    This command causes the configured bit to be removed from the specified peer(s). In many cases this will cause the peer association to be deleted. When appropriate, however, the association may persist in an unconfigured mode if the remote peer is willing to continue on in this fashion.
    fudge peer_address [ time1 ] [ time2 ] [ stratum ] [ refid ]
    This command provides a way to set certain data for a reference clock. See the source listing for further information.
    enable [ auth | bclient | calibrate | kernel | monitor | ntp | pps | stats]
    disable [ auth | bclient | calibrate | kernel | monitor | ntp | pps | stats]
    These commands operate in the same way as the enable and disable configuration file commands of ntpd. See the Miscellaneous Options page for further information.
    restrict address mask flag [ flag ]
    This command operates in the same way as the restrict configuration file commands of ntpd.
    unrestrict address mask flag [ flag ]
    Unrestrict the matching entry from the restrict list.
    delrestrict address mask [ ntpport ]
    Delete the matching entry from the restrict list.
    readkeys
    Causes the current set of authentication keys to be purged and a new set to be obtained by rereading the keys file (which must have been specified in the ntpd configuration file). This allows encryption keys to be changed without restarting the server.
    trustedkey keyid [...]
    untrustedkey keyid [...]
    These commands operate in the same way as the trustedkey and untrustedkey configuration file commands of ntpd.
    authinfo
    Returns information concerning the authentication module, including known keys and counts of encryptions and decryptions which have been done.
    traps
    Display the traps set in the server. See the source listing for further information.
    addtrap [ address ] [ port ] [ interface ]
    Set a trap for asynchronous messages. See the source listing for further information.
    clrtrap [ address ] [ port ] [ interface]
    Clear a trap for asynchronous messages. See the source listing for further information.
    reset
    Clear the statistics counters in various modules of the server. See the source listing for further information.

    Bugs

    ntpdc is a crude hack. Much of the information it shows is deadly boring and could only be loved by its implementer. The program was designed so that new (and temporary) features were easy to hack in, at great expense to the program's ease of use. Despite this, the program is occasionally useful.


    ntp-4.2.6p5/html/accopt.html0000644000175000017500000002212111307651604014715 0ustar peterpeter Access Control Options

    Access Control Options

    giffrom Pogo, Walt Kelly

    The skunk watches for intruders and sprays.

    Last update: 30-Sep-2009 17:16 UTC


    Related Links

    Table of Contents


    Access Control Support

    The ntpd daemon implements a general purpose access control list (ACL) containing address/match entries sorted first by increasing address values and then by increasing mask values. A match occurs when the bitwise AND of the mask and the packet source address is equal to the bitwise AND of the mask and address in the list. The list is searched in order with the last match found defining the restriction flags associated with the entry.

    An example may clarify how it works. Our campus has two class-B networks, 128.4 for the ECE and CIS departments and 128.175 for the rest of campus. Let's assume (not true!) that subnet 128.4.1 homes critical services like class rosters and spread sheets. A suitable ACL might be

    restrict default nopeer					# deny new associations
    restrict 128.175.0.0 mask 255.255.0.0 		# allow campus access
    restrict 128.4.0.0 mask 255.255.0.0 none	# allow ECE and CIS access
    restrict 128.4.1.0 mask 255.255.255.0 notrust # require authentication on subnet 1
    restrict time.nist.gov						# allow access
    

    While this facility may be useful for keeping unwanted, broken or malicious clients from congesting innocent servers, it should not be considered an alternative to the NTP authentication facilities. Source address based restrictions are easily circumvented by a determined cracker.

    Access Control Commands

    discard [ average avg ][ minimum min ] [ monitor prob ]
    Set the parameters of the rate control facility which protects the server from client abuse. If the limited flag is present in the ACL, packets that violate these limits are discarded. If in addition the kod restriction is present, a kiss-o'-death packet is returned.
    average avg
    Specify the minimum average interpacket spacing (minimum average headway time) in log2 s with default 3.
    minimum min
    Specify the minimum interpacket spacing (guard time) in log2 s with default 1.
    monitor
    Specify the probability of discard for packets that overflow the rate-control window. This is a performance optimization for servers with aggregate arrivals of 1000 packets per second or more.
    restrict address [mask mask] [flag][...]
    The address argument expressed in dotted-quad form is the address of a host or network. Alternatively, the address argument can be a valid host DNS name. The mask argument expressed in dotted-quad form defaults to 255.255.255.255, meaning that the address is treated as the address of an individual host. A default entry (address 0.0.0.0, mask 0.0.0.0) is always included and is always the first entry in the list. Note that the text string default, with no mask option, may be used to indicate the default entry.
    Some flags have the effect to deny service, some have the effect to enable service and some are conditioned by other flags. The flags. are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags that deny service are classed in two categories, those that restrict time service and those that restrict informational queries and attempts to do run-time reconfiguration of the server. One or more of the following flags may be specified:
    flake
    Discard received NTP packets with probability 0.1; that is, on average drop one packet in ten. This is for testing and amusement. The name comes from Bob Braden's flakeway, which once did a similar thing for early Internet testing.
    ignore
    Deny packets of all kinds, including ntpq and ntpdc queries.
    kod
    Send a kiss-o'-death (KoD) packet if the limited flag is present and a packet violates the rate limits established by the discard command. KoD packets are themselves rate limited for each source address separately. If this flag is not present, packets that violate the rate limits are discarded.
    limited
    Deny time service if the packet violates the rate limits established by the discard command. This does not apply to ntpq and ntpdc queries.
    lowpriotrap
    Declare traps set by matching hosts to be low priority. The number of traps a server can maintain is limited (the current limit is 3). Traps are usually assigned on a first come, first served basis, with later trap requestors being denied service. This flag modifies the assignment algorithm by allowing low priority traps to be overridden by later requests for normal priority traps.
    mssntp
    Enable Microsoft Windows MS-SNTP authentication using Active Directory services. Note: Potential users should be aware that these services involve a TCP connection to another process that could potentially block, denying services to other users. Therefore, this flag should be used only for a dedicated server with no clients other than MS-SNTP.
    nomodify
    Deny ntpq and ntpdc queries which attempt to modify the state of the server (i.e., run time reconfiguration). Queries which return information are permitted.
    noquery
    Deny ntpq and ntpdc queries. Time service is not affected.
    nopeer
    Deny packets that might mobilize an association unless authenticated. This includes broadcast, symmetric-active and manycast server packets when a configured association does not exist. Note that this flag does not apply to packets that do not attempt to mobilize an association.
    noserve
    Deny all packets except ntpq and ntpdc queries.
    notrap
    Decline to provide mode 6 control message trap service to matching hosts. The trap service is a subsystem of the ntpdc control message protocol which is intended for use by remote event logging programs.
    notrust
    Deny packets that are not cryptographically authenticated. Note carefully how this flag interacts with the auth option of the enable and disable commands. If auth is enabled, which is the default, authentication is required for all packets that might mobilize an association. If auth is disabled, but the notrust flag is not present, an association can be mobilized whether or not authenticated. If auth is disabled, but the notrust flag is present, authentication is required only for the specified address/mask range.
    ntpport
    non-ntpport
    This is actually a match algorithm modifier, rather than a restriction flag. Its presence causes the restriction entry to be matched only if the source port in the packet is the standard NTP UDP port (123). Both ntpport and non-ntpport may be specified. The ntpport is considered more specific and is sorted later in the list.
    version
    Deny packets that do not match the current NTP version.
    Default restriction list entries with the flags ignore, ntpport, for each of the local host's interface addresses are inserted into the table at startup to prevent the server from attempting to synchronize to its own time. A default entry is also always present, though if it is otherwise unconfigured; no flags are associated with the default entry (i.e., everything besides your own NTP server is unrestricted).

    ntp-4.2.6p5/html/ntpdate.html0000644000175000017500000001761711606456561015130 0ustar peterpeter ntpdate - set the date and time via NTP

    ntpdate - set the date and time via NTP

    giffrom Alice's Adventures in Wonderland, Lewis Carroll

    I told you it was eyeball and wristwatch.

    Last update: 18:44 UTC Thursday, July 28, 2005



    Disclaimer: The functionality of this program is now available in the ntpd program. See the -q command line option in the ntpd - Network Time Protocol (NTP) daemon page. After a suitable period of mourning, the ntpdate program is to be retired from this distribution

    Synopsis

    ntpdate [ -46bBdqsuv ] [ -a key ] [ -e authdelay ] [ -k keyfile ] [ -o version ] [ -p samples ] [ -t timeout ] server [ ... ]

    Description

    ntpdate sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the server arguments to determine the correct time. It must be run as root on the local host. A number of samples are obtained from each of the servers specified and a subset of the NTP clock filter and selection algorithms are applied to select the best of these. Note that the accuracy and reliability of ntpdate depends on the number of servers, the number of polls each time it is run and the interval between runs.

    ntpdate can be run manually as necessary to set the host clock, or it can be run from the host startup script to set the clock at boot time. This is useful in some cases to set the clock initially before starting the NTP daemon ntpd. It is also possible to run ntpdate from a cron script. However, it is important to note that ntpdate with contrived cron scripts is no substitute for the NTP daemon, which uses sophisticated algorithms to maximize accuracy and reliability while minimizing resource use. Finally, since ntpdate does not discipline the host clock frequency as does ntpd, the accuracy using ntpdate is limited.

    Time adjustments are made by ntpdate in one of two ways. If ntpdate determines the clock is in error more than 0.5 second it will simply step the time by calling the system settimeofday() routine. If the error is less than 0.5 seconds, it will slew the time by calling the system adjtime() routine. The latter technique is less disruptive and more accurate when the error is small, and works quite well when ntpdate is run by cron every hour or two.

    ntpdate will decline to set the date if an NTP server daemon (e.g., ntpd) is running on the same host. When running ntpdate on a regular basis from cron as an alternative to running a daemon, doing so once every hour or two will result in precise enough timekeeping to avoid stepping the clock.

    Note that in contexts where a host name is expected, a -4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS resolution to the IPv6 namespace.

    If NetInfo support is compiled into ntpdate, then the server argument is optional if ntpdate can find a time server in the NetInfo configuration for ntpd.

    Command Line Options

    -4
    Force DNS resolution of following host names on the command line to the IPv4 namespace.
    -6
    Force DNS resolution of following host names on the command line to the IPv6 namespace.
    -a key
    Enable the authentication function and specify the key identifier to be used for authentication as the argument key. The keys and key identifiers must match in both the client and server key files. The default is to disable the authentication function.
    -B
    Force the time to always be slewed using the adjtime() system call, even if the measured offset is greater than +-500 ms. The default is to step the time using settimeofday() if the offset is greater than +-500 ms. Note that, if the offset is much greater than +-500 ms in this case, that it can take a long time (hours) to slew the clock to the correct value. During this time. the host should not be used to synchronize clients.
    -b
    Force the time to be stepped using the settimeofday() system call, rather than slewed (default) using the adjtime() system call. This option should be used when called from a startup file at boot time.
    -d
    Enable the debugging mode, in which ntpdate will go through all the steps, but not adjust the local clock. Information useful for general debugging will also be printed.
    -e authdelay
    Specify the processing delay to perform an authentication function as the value authdelay, in seconds and fraction (see ntpd for details). This number is usually small enough to be negligible for most purposes, though specifying a value may improve timekeeping on very slow CPU's.
    -k keyfile
    Specify the path for the authentication key file as the string keyfile. The default is /etc/ntp.keys. This file should be in the format described in ntpd.
    -o version
    Specify the NTP version for outgoing packets as the integer version, which can be 1 or 2. The default is 4. This allows ntpdate to be used with older NTP versions.
    -p samples
    Specify the number of samples to be acquired from each server as the integer samples, with values from 1 to 8 inclusive. The default is 4.
    -q
    Query only - don't set the clock.
    -s
    Divert logging output from the standard output (default) to the system syslog facility. This is designed primarily for convenience of cron scripts.
    -t timeout
    Specify the maximum time waiting for a server response as the value timeout, in seconds and fraction. The value is is rounded to a multiple of 0.2 seconds. The default is 1 second, a value suitable for polling across a LAN.
    -u
    Direct ntpdate to use an unprivileged port for outgoing packets. This is most useful when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronize with hosts beyond the firewall. Note that the -d option always uses unprivileged ports.
    -v
    Be verbose. This option will cause ntpdate's version identification string to be logged.

    Diagnostics

    ntpdate's exit status is zero if it finds a server and updates the clock, and nonzero otherwise.

    Files

    /etc/ntp.keys - encryption keys used by ntpdate.

    Bugs

    The slew adjustment is actually 50% larger than the measured offset, since this (it is argued) will tend to keep a badly drifting clock more accurate. This is probably not a good idea and may cause a troubling hunt for some values of the kernel variables tick and tickadj
    ntp-4.2.6p5/html/ntpdsim.html0000644000175000017500000001144711307651604015133 0ustar peterpeter ntpdsim - Network Time Protocol (NTP) simulator

    ntpdsim - Network Time Protocol (NTP) simulator

    giffrom The Wizard of Oz, L. Frank Baum

    All in a row.

    Last update: 15:55 UTC Sunday, March 02, 2008


    Related Links

    Table of Contents


    Synopsis

    ntpdsim [ -B bdly ] [ -C snse ] [ -O clk_time ] [ -S sim_time ] [ -T ferr ] [ -W fsne ] [ -Y ndly ] [ -X pdly ]

    Description

    The ntpdsim program is an adaptation of the ntpd operating system daemon. The program operates as a discrete time simulator using specified systematic and random driving sources. It includes all the mitigation and discipline algorithms of the actual daemon, but with the packet I/O and system clock algorithms driven by simulation. Most functions of the real ntpd remain intact, including the monitoring, statistics recording, trace and host name resolution features. Further information on the simulator is on the NTP Discrete Event Simulator page.

    The simulator is most useful to study NTP behavior in response to time and/or frequency transients under specific conditions of network jitter and oscillator wander. For this purpose the daemon can be driven by pseudorandom jitter and wander sample sequences characteristic of real networks and oscillators. The jitter generator produces samples from a Poisson distribution, while the wander generator produces samples from a Guassian distribution.

    The easiest way to use this program is to create a ntpstats directory, configuration file ntp.conf and frequency file ntp.drift and test shell test.sh in the base directory. The ntp.drift file and ntpstats directory can be empty to start. The test.sh script can contain something like

    rm ./ntpstats/*
    ntpdsim -O 0.1 -C .001 -T 400 -W 1 -c ./ntp.conf,
    

    which starts the simulator with a time offset 100 ms, network jitter 1 ms, frequency offset 400 PPM and oscillator wander 1 PPM/s. These parameters represent typical conditions with modern workstations on a Ethernet LAN. The ntp.conf file should contain something like

    disable kernel
    server pogo
    driftfile ./ntp.drift
    statsdir ./ntpstats/
    filegen loopstats type day enable
    filegen peerstats type day enable
    

    Command Line Options

    Note: The NTP development team is moving to the use of a syntax-directed configuration file design. When complete these options will be replaced by a new one. Most of the ntpd command line options apply also to ntpdsim. In addition, the following command line options apply to ntpdsim.
    -B bdly
    Specify beep delay (3600) s.
    -C snse
    Specify network jitter parameter (0) s.
    -O clk_time
    Specify initial time offset (0) s.
    -S sim_time
    Specify simulation duration (86400) s.
    -T ferr
    Specify initial frequency offset (0) PPM.
    -W fnse
    Specify oscillator wander parameter (0) PPM/s.
    -Y ndly
    Specify network propagation delay (.001) s.
    -Z pdly
    Specify server processing delay (.001) s.

    Files

    /etc/ntp.conf - the default name of the configuration file
    /etc/ntp.drift - the default name of the drift file
    /etc/ntp.keys - the default name of the key file
    ntp-4.2.6p5/html/parsedata.html0000644000175000017500000004011610544731163015415 0ustar peterpeter NTP PARSE clock data formats

    NTP PARSE clock data formats

    The parse driver currently supports several clocks with different query mechanisms. In order for you to find a sample that might be similar to a clock you might want to integrate into parse I'll sum up the major features of the clocks (this information is distributed in the parse/clk_*.c and ntpd/refclock_parse.c files).


    Meinberg clocks

    Meinberg: start=<STX>, end=<ETX>, sync on start
          pattern="\2D:  .  .  ;T: ;U:  .  .  ;    \3"
          pattern="\2  .  .  ;  ;   :  :  ;        \3"
          pattern="\2  .  .  ;  ;   :  :  ;    :  ;        ;   .         .       "
    

    Meinberg is a German manufacturer of time code receivers. Those clocks have a pretty common output format in the stock version. In order to support NTP Meinberg was so kind to produce some special versions of the firmware for the use with NTP. So, if you are going to use a Meinberg clock please ask whether there is a special Uni Erlangen version. You can reach Meinberg via the Web. Information can also be ordered via eMail from info@meinberg.de

    General characteristics:
    Meinberg clocks primarily output pulse per second and a describing ASCII string. This string can be produced in two modes: either upon the reception of a question mark or every second. NTP uses the latter mechanism. DCF77 AM clocks have a limited accuracy of a few milliseconds. The DCF77 PZF5xx variants provide higher accuracy and have a pretty good relationship between RS232 time code and the PPS signal. Except for early versions of the old GPS166 receiver type, Meinberg GPS receivers have a very good timing relationship between the datagram and the pulse. The beginning of the start bit of the first character has basically the same accuracy as the PPS signal, plus a jitter of up to 1 bit time depending on the selected baud rate, i.e. 52 μs @ 19200. PPS support should always be used, if possible, in order to yield the highest possible accuracy.

    The preferred tty setting for Meinberg DCF77 receivers is 9600/7E2:

    		CFLAG		(B9600|CS7|PARENB|CREAD|HUPCL)
    		IFLAG		(IGNBRK|IGNPAR|ISTRIP)
    		OFLAG		0
    		LFLAG		0
            

    The tty setting for Meinberg GPS16x/17x receivers is 19200/8N1:

    		CFLAG		(B19200|CS8|PARENB|CREAD|HUPCL)
    		IFLAG		(IGNBRK|IGNPAR|ISTRIP)
    		OFLAG		0
    		LFLAG		0
            

    All clocks should be run at datagram once per second.

    Format of the Meinberg standard time string:

            <STX>D:dd.mm.yy;T:w;U:hh.mm.ss;uvxy<ETX>
        pos:  0  000000001111111111222222222233  3
              1  234567890123456789012345678901  2
    
        <STX>         = start-of-text, ASCII code 0x02
        dd.mm.yy      = day of month, month, year of the century, separated by dots
        w             = day of week (1..7, Monday = 1)
        hh:mm:ss      = hour, minute, second, separated by dots
        u             = '#' for GPS receivers: time is not synchronized
                               '#' for older PZF5xx receivers: no correlation, not synchronized
                               '#' for other devices: never sync'ed since powerup
                               ' ' if nothing of the above applies
        v             = '*' for GPS receivers: position has not been verified
                               '*' for other devices: freewheeling based on internal quartz
                               ' ' if nothing of the above applies
        x             = 'U' if UTC time is transmitted
                               'S' if daylight saving time is active
                               ' ' if nothing of the above applies
        y             = '!' during the hour preceding start or end of daylight saving time
                               'A' during the hour preceding a leap second
                               ' ' if nothing of the above applies
        <ETX>         = end-of-text, ASCII code 0x03
    

    Format of the Uni Erlangen time string for PZF5xx receivers:

            <STX>dd.mm.yy; w; hh:mm:ss; tuvxyza<ETX>
        pos:  0  000000001111111111222222222233  3
              1  234567890123456789012345678901  2
    
        <STX>         = start-of-text, ASCII code 0x02
        dd.mm.yy      = day of month, month, year of the century, separated by dots
        w             = day of week (1..7, Monday = 1)
        hh:mm:ss      = hour, minute, second, separated by colons
    
        t             = 'U' if UTC time is transmitted, else ' '
        u             = '#' for older PZF5xx receivers: no correlation, not synchronized
                               '#' for PZF511 and newer: never sync'ed since powerup
                               ' ' if nothing of the above applies
        v             = '*' if freewheeling based on internal quartz, else ' '
        x             = 'S' if daylight saving time is active, else ' '
        y             = '!' during the hour preceding start or end of daylight saving time, else ' '
        z             = 'A' during the hour preceding a leap second, else ' '
        a             = 'R' alternate antenna (reminiscent of PZF5xx), usually ' ' for GPS receivers
        <ETX>         = end-of-text, ASCII code 0x03
    

    Format of the Uni Erlangen time string for GPS16x/GPS17x receivers:

            <STX>dd.mm.yy; w; hh:mm:ss; +uu:uu; uvxyzab; ll.lllln lll.lllle hhhhm<ETX>
        pos:  0  0000000011111111112222222222333333333344444444445555555555666666  6
              1  2345678901234567890123456789012345678901234567890123456789012345  6
    
        <STX>         = start-of-text, ASCII code 0x02
        dd.mm.yy      = day of month, month, year of the century, separated by dots
        w             = day of week (1..7, Monday = 1)
        hh:mm:ss      = hour, minute, second, separated by colons
        +uu:uu        = offset to UTC in hours and minutes, preceded by + or -
        u             = '#' if time is not synchronized, else ' '
        v             = '*' if position has not been verified, else ' '
        x             = 'S' if daylight saving time is active, else ' '
        y             = '!' during the hour preceding start or end of daylight saving time, else ' '
        z             = 'A' during the hour preceding a leap second, else ' '
        a             = 'R' alternate antenna (reminiscent of PZF5xx), usually ' ' for GPS receivers
        b             = 'L' during a leap second, i.e. if the seconds field is 60, else ' '
        ll.lllln      = position latitude in degrees, 'n' can actually be 'N' or 'S', i.e. North or South
        lll.lllle     = position longitude in degrees, 'e' can actually be 'E' or 'W', i.e. East or West
        hhhh          = position altitude in meters, always followed by 'm'
        <ETX>         = end-of-text, ASCII code 0x03
    

    Examples for Uni Erlangen strings from GPS receivers:

            \x02 09.07.93; 5; 08:48:26; +00:00;        ; 49.5736N  11.0280E  373m \x03
            \x02 08.11.06; 3; 14:39:39; +00:00;        ; 51.9828N   9.2258E  176m \x03
    

    The Uni Erlangen formats should be used preferably. Newer Meinberg GPS receivers can be configured to transmit that format, for older devices there may be a special firmware version available.

    For the Meinberg parse look into clk_meinberg.c


    Raw DCF77 Data via serial line

    RAWDCF: end=TIMEOUT>1.5s, sync each char (any char),generate psuedo time codes, fixed format

    direct DCF77 code input

    In Europe it is relatively easy/cheap the receive the german time code transmitter DCF77. The simplest version to process its signal is to feed the 100/200ms pulse of the demodulated AM signal via a level converter to an RS232 port at 50Baud. parse/clk_rawdcf.c holds all necessary decoding logic for the time code which is transmitted each minute for one minute. A bit of the time code is sent once a second.

    	The preferred tty setting is:
    		CFLAG           (B50|CS8|CREAD|CLOCAL)
    		IFLAG		0
    		OFLAG		0
     		LFLAG		0
    

    DCF77 raw time code

    From "Zur Zeit", Physikalisch-Technische Bundesanstalt (PTB), Braunschweig und Berlin, März 1989

    Timecode transmission:

    	AM:
    
    	time marks are send every second except for the second before the
    	next minute mark
    	time marks consist of a reduction of transmitter power to 25%
    	of the nominal level
    	the falling edge is the time indication (on time)
    	time marks of a 100ms duration constitute a logical 0
    	time marks of a 200ms duration constitute a logical 1
    

    see the spec. (basically a (non-)inverted psuedo random phase shift) encoding:

    	FM:
    
    	Second	Contents
    	0  - 10	AM: free, FM: 0
    	11 - 14	free
    	15		R     - alternate antenna
    	16		A1    - expect zone change (1 hour before)
    	17 - 18	Z1,Z2 - time zone
    		 0  0 illegal
    		 0  1 MEZ  (MET)
    		 1  0 MESZ (MED, MET DST)
    		 1  1 illegal
    	19	A2    - expect leap insertion/deletion (1 hour before)
    	20	S     - start of time code (1)
    	21 - 24	M1    - BCD (lsb first) Minutes
    	25 - 27	M10   - BCD (lsb first) 10 Minutes
    	28	P1    - Minute Parity (even)
    	29 - 32	H1    - BCD (lsb first) Hours
    	33 - 34	H10   - BCD (lsb first) 10 Hours
    	35	P2    - Hour Parity (even)
    	36 - 39	D1    - BCD (lsb first) Days
    	40 - 41	D10   - BCD (lsb first) 10 Days
    	42 - 44	DW    - BCD (lsb first) day of week (1: Monday -> 7: Sunday)
    	45 - 49	MO1   - BCD (lsb first) Month
    	50	MO10  - 10 Months
    	51 - 53	Y1    - BCD (lsb first) Years
    	54 - 57	Y10   - BCD (lsb first) 10 Years
    	58 	P3    - Date Parity (even)
    	59	      - usually missing (minute indication), except for leap insertion
    

    Schmid clock

    Schmid clock: needs poll, binary input, end='\xFC', sync start

    The Schmid clock is a DCF77 receiver that sends a binary time code at the reception of a flag byte. The contents if the flag byte determined the time code format. The binary time code is delimited by the byte 0xFC.

    	TTY setup is:
    		CFLAG		(B1200|CS8|CREAD|CLOCAL)
    		IFLAG		0
    		OFLAG		0
     		LFLAG		0
    
    

    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)
    	Bit 3:	time zone, 1 byte, 0=MET, 1=MEST. (unused here)
    	Bit 4:	clock status, 1 byte,	0=time invalid,
    					1=time from crystal backup,
    					3=time from DCF77
    	Bit 5:	transmitter status, 1 byte,
    					bit 0: backup antenna
    					bit 1: time zone change within 1h
    					bit 3,2: TZ 01=MEST, 10=MET
    					bit 4: leap second will be
    						added within one hour
    					bits 5-7: Zero
    	Bit 6:	time in backup mode, units of 5 minutes (unused here)
    

    Trimble SV6 ASCII time code (TAIP)

    Trimble SV6: needs poll, ascii timecode, start='>', end='<', query='>QTM<', eol='<'

    Trimble SV6 is a GPS receiver with PPS output. It needs to be polled. It also need a special tty mode setup (EOL='<').

    	TTY setup is:
    		CFLAG            (B4800|CS8|CREAD)
    		IFLAG            (BRKINT|IGNPAR|ISTRIP|ICRNL|IXON)
    		OFLAG            (OPOST|ONLCR)
    		LFLAG            (ICANON|ECHOK)
    

    Special flags are:

    		PARSE_F_PPSPPS	    - use CIOGETEV for PPS time stamping
    		PARSE_F_PPSONSECOND - the time code is not related to
    				      the PPS pulse (so use the time code
    				      only for the second epoch)
    
    	Timecode
    	0000000000111111111122222222223333333	/ char
    	0123456789012345678901234567890123456	\ posn
    	>RTMhhmmssdddDDMMYYYYoodnnvrrrrr;*xx<	Actual
    	----33445566600112222BB7__-_____--99-	Parse
    	>RTM                      1     ;*  < 	Check
    

    ELV DCF7000

    ELV DCF7000: end='\r', pattern=" - - - - - - - \r"

    The ELV DCF7000 is a cheap DCF77 receiver sending each second a time code (though not very precise!) delimited by '`r'

    	Timecode
    	  YY-MM-DD-HH-MM-SS-FF\r
    
    		FF&0x1	- DST
    		FF&0x2	- DST switch warning
    		FF&0x4  - unsynchronised
    

    HOPF 6021 und Kompatible

    HOPF Funkuhr 6021 mit serieller Schnittstelle Created by F.Schnekenbuehl <frank@comsys.dofn.de> from clk_rcc8000.c Nortel DASA Network Systems GmbH, Department: ND250 A Joint venture of Daimler-Benz Aerospace and Nortel.

     hopf Funkuhr 6021 
          used with 9600,8N1,
          UTC via serial line
          "Sekundenvorlauf" ON
          ETX zum Sekundenvorlauf ON
          dataformat 6021
          output time and date
          transmit with control characters
          transmit evry second
     

    Type 6021 Serial Output format

          000000000011111111 / char
          012345678901234567 \ position
          sABHHMMSSDDMMYYnre  Actual
           C4110046231195     Parse
          s              enr  Check
    
      s = STX (0x02), e = ETX (0x03)
      n = NL  (0x0A), r = CR  (0x0D)
    
      A B - Status and weekday
     
      A - Status
    
          8 4 2 1
          x x x 0  - no announcement
          x x x 1  - Summertime - wintertime - summertime announcement
          x x 0 x  - Wintertime
          x x 1 x  - Summertime
          0 0 x x  - Time/Date invalid
          0 1 x x  - Internal clock used 
          1 0 x x  - Radio clock
          1 1 x x  - Radio clock highprecision
    
      B - 8 4 2 1
          0 x x x  - MESZ/MEZ
          1 x x x  - UTC
          x 0 0 1  - Monday
          x 0 1 0  - Tuesday
          x 0 1 1  - Wednesday
          x 1 0 0  - Thursday
          x 1 0 1  - Friday
          x 1 1 0  - Saturday
          x 1 1 1  - Sunday
    

    Diem Computime Clock

    The Computime receiver sends a datagram in the following format every minute

       
       Timestamp	T:YY:MM:MD:WD:HH:MM:SSCRLF 
       Pos          0123456789012345678901 2 3
    		0000000000111111111122 2 2
       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
    

    WHARTON 400A Series Clock with a 404.2 Serial interface

    The WHARTON 400A Series clock is able to send date/time serial messages in 7 output formats. We use format 1 here because it is the shortest. We set up the clock to send a datagram every second. For use with this driver, the WHARTON 400A Series clock must be set-up as follows :

      					Programmable	Selected
      					Option No	Option
    	BST or CET display		3		9 or 11
    	No external controller		7		0
    	Serial Output Format 1		9		1
    	Baud rate 9600 bps		10		96
    	Bit length 8 bits		11		8
    	Parity even			12		E
    

    WHARTON 400A Series output format 1 is as follows :

       Timestamp	STXssmmhhDDMMYYSETX
       Pos		0  12345678901234
      		0  00000000011111
      
       STX	start transmission (ASCII 0x02)
       ETX	end transmission (ASCII 0x03)
       ss	Second expressed in reversed decimal (units then tens)
       mm	Minute expressed in reversed decimal
       hh	Hour expressed in reversed decimal
       DD	Day of month expressed in reversed decimal
       MM	Month expressed in reversed decimal (January is 1)
       YY	Year (without century) expressed in reversed decimal
       S	Status byte : 0x30 +
    		bit 0	0 = MSF source		1 = DCF source
    		bit 1	0 = Winter time		1 = Summer time
    		bit 2	0 = not synchronised	1 = synchronised
    		bit 3	0 = no early warning	1 = early warning
    

    ntp-4.2.6p5/html/monopt.html0000644000175000017500000003643211307651605014773 0ustar peterpeter Monitoring Options

    Monitoring Options

    giffrom Pogo, Walt Kelly

    Pig was hired to watch the logs.

    Last update: 10-May-2009 16:19 UTC


    Related Links

    Table of Contents


    Introduction

    The ntpd includes a comprehensive monitoring facility which collects statistical data of various types and writes the data to files associated with each type at defined events or intervals. The files associated with a particular type are collectively called the generation file set for that type. The files in the file set are the members of that set.

    File sets have names specific to the type and generation epoch. The names are constructed from three concatenated elements prefix, filename and suffix:

    prefix
    The directory path specified in the statsdir command.
    name
    The name specified by the file option of the filegen command.
    suffix
    A string of elements bdginning with . (dot) followed by a number of elements depending on the file set type.

    Statistics files can be managed using scripts, examples of which are in the ./scripts directory. Using these or similar scripts and Unix cron jobs, the files can be automatically summarized and archived for retrospective analysis.

    Monitoring Commands

    filegen name file filename [type type] [link | nolink] [enable | disable]
    name
    Specifies the file set type from the list in the next section.
    file filename
    Specfies the file set name.
    type typename
    Specifies the file set interval. The following intervals are supported with default day:
    none
    The file set is actually a single plain file.
    pid
    One file set member is created for every incarnation of ntpd. The file name suffix is the string .n, where n is the process ID of the ntpd server process.
    day
    One file set member is created per day. A day is defined as the period between 00:00 and 23:59 UTC. The file name suffix is the string .yyyymmdd, where yyyy is the year, mm the month of the year and dd the day of the month. Thus, member created on 10 December 1992 would have suffix .19921210.
    week
    One file set member is created per week. The week is defined as the day of year modulo 7. The file name suffix is the string .yyyyWww, where yyyy is the year, W stands for itself and ww the week number starting from 0. For example, The member created on 10 January 1992 would have suffix .1992W1.
    month
    One file set member is created per month. The file name suffix is the string .yyyymm, where yyyy is the year and mm the month of the year starting from 1. For example, The member created on 10 January 1992 would have suffix .199201.
    year
    One file set member is generated per year. The file name suffix is the string .yyyy, where yyyy is the year. For example, The member created on 1 January 1992 would have suffix .1992.
    age
    One file set member is generated every 24 hours of ntpd operation. The filename suffix is the string .adddddddd, where a stands for itself and dddddddd is the ntpd running time in seconds at the start of the corresponding 24-hour period.
    link | nolink
    It is convenient to be able to access the current file set members by file name, but without the suffix. This feature is enabled by link and disabled by nolink. If enabled, which is the default, a hard link from the current file set member to a file without suffix is created. When there is already a file with this name and the number of links to this file is one, it is renamed by appending a dot, the letter C, and the pid of the ntpd server process. When the number of links is greater than one, the file is unlinked. This allows the current file to be accessed by a constant name.
    enable | disable
    Enable or disable the recording function, with default enable. These options are intended for remote configutation commands.
    statsdir directory_path
    Specify the directory path prefix for statistics file names.

    File Set Types

    clockstats
    Record reference clock statistics. Each update received from a reference clock driver appends one line to the clockstats file set:
    49213 525.624 127.127.4.1 93 226 00:08:29.606 D
    Item Units Description
    49213 MJD date
    525.624 s time past midnight
    127.127.4.1 IP reference clock address
    message text log message
    The message field includes the last timecode received in decoded ASCII format, where meaningful. In some cases a good deal of additional information is displayed. See information specific to each reference clock for further details.
    cryptostats
    Record significant events in the Autokey protocol. This option requires the OpenSSL cryptographic software library. Each event appends one line to the cryptostats file set:
    49213 525.624 128.4.1.1 message
    Item Units Description
    49213 MJD date
    525.624 s time past midnight
    128.4.1.1 IP source address (0.0.0.0 for system)
    message text log message
    The message field includes the message type and certain ancillary information. See the Authentication Options page for further information.
    loopstats
    Record clock discipline loop statistics. Each system clock update appends one line to the loopstats file set:
    50935 75440.031 0.000006019 13.778 0.000351733 0.013380 6
    Item Units Description
    50935 MJD date
    75440.031 s time past midnight
    0.000006019 s clock offset
    13.778 PPM frequency offset
    0.000351733 s RMS jitter
    0.013380 PPM RMS frequency jitter (aka wander)
    6 log2 s clock discipline loop time constant
    peerstats
    Record peer statistics. Each NTP packet or reference clock update received appends one line to the peerstats file set:
    48773 10847.650 127.127.4.1 9714 -0.001605376 0.000000000 0.001424877 0.000958674
    Item Units Description
    48773 MJD date
    10847.650 s time past midnight
    127.127.4.1 IP source address
    9714 hex status word
    -0.001605376 s clock offset
    0.000000000 s roundtrip delay
    0.001424877 s dispersion
    0.000958674 s RMS jitter
    The status field is encoded in hex format as described in Appendix B of the NTP specification RFC 1305.
    protostats
    Record significant peer, system and [rptpcp; events. Each significant event appends one line to the protostats file set:
    49213 525.624 128.4.1.1 963a 8a message
    Item Units Description
    49213 MJD date
    525.624 s time past midnight
    128.4.1.1 IP source address (0.0.0.0 for system)
    963a code status word
    8a code event message code
    message text event message
    The event message code and message field are described on the Event Messages and Status Words page.
    rawstats
    Record timestamp statistics. Each NTP packet received appends one line to the rawstats file set:
    50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000 3102453281.58622800031 02453332.540806000 3102453332.541458000
    Item Units Description
    50928 MJD date
    2132.543 s time past midnight
    128.4.1.1 IP source address
    128.4.1.20 IP destination address
    3102453281.584327000 NTP s origin timestamp
    3102453281.586228000 NTP s receive timestamp
    3102453332.540806000 NTP s transmit timestamp
    3102453332.541458000 NTP s destination timestamp
    sysstats
    Record system statistics. Each hour one line is appended to the sysstats file set in the following format:
    50928 2132.543 3600 81965 0 9546 56 512 540 10 4 147 1
    Item Units Description
    50928 MJD date
    2132.543 s time past midnight
    3600 s time since reset
    81965 # packets received
    0 # packets for this host
    9546 # current versions
    56 # old version
    512 # access denied
    540 # bad length or format
    10 # bad authentication
    4 # declined
    147 # rate exceeded
    1 # kiss-o'-death packets sent
    timingstats
    (Only available when the deamon is compiled with process time debugging support (--enable-debug-timing - costs performance). Record processing time statistics for various selected code paths.
    53876 36.920 10.0.3.5 1 0.000014592 input processing delay
    Item Units Description
    53876 MJD date
    36.920 s time past midnight
    10.0.3.5 IP server address
    1 # event count
    0.000014592 s total time
    message text code path description (see source)

    ntp-4.2.6p5/html/ntpdsim_new.html0000644000175000017500000001334511307651604016003 0ustar peterpeter ntpdsim - Network Time Protocol (NTP) Simulator

    ntpdsim - Network Time Protocol (NTP) Simulator

    giffrom The Wizard of Oz, L. Frank Baum

    All in a row.

    Last update: 15:56 UTC Sunday, March 02, 2008


    Related Links

    Table of Contents

    Description

    The ntpdsim program is used to simulate and study the behavior of an NTP daemon that derives its time from a number of different simulated time sources (servers). Each simulated server can be configured to have a different time offset, frequency offset, propagation delay, processing delay, network jitter and oscillator wander.

    The ntpdsim program runs all the same selection, mitigation, and discipline algorithms as the actual ntpd daemon at the client. (It actually uses the same code). However, the input/output routines and servers are simulated. That is, instead of sending the client messages over the network to the actual servers, the client messages are intercepted by the ntpdsim program, which then generates the replies to those messages. The reply messages are carefully "inserted" into the input queue of the client at the right time according to the specified server properties (like propagation delay).

    Each simulated server runs according to a specified script that describes the server properties at a particular time. Each script consists of a series of consecutive acts. Each act runs for a particular duration and specifies the frequency offset, propagation delay, processing delay, network jitter and oscillator wander of the server for that duration. Once the duration of an act expires, the simulated server reconfigures itself according to the properties specified in the next act.

    Configuration

    The ntpdsim program is configured by providing a configuration file at startup. The crux of the simulator configuration is specified using a simulate command, the syntax of which is given below. Note that all time quantities are in seconds and all frequency quantities are in parts per million (PPM):

    <simulate_command> ::= simulate { <init_statement_list> <server_list> }
    <init_statement_list> ::= <init_statement_list> <init_statement> | <init_statement>
    <init_statement> ::= beep_delay = <number> | simulation_duration = <number>
    <server_list> ::= <server_list> <server> | <server>
    <server_list> ::= server = <address> { server_offset = <number> <act_list> }
    <act_list> ::= <act_list> <act> | <act>
    <act> ::= duration = <number> { <act_stmt_list> }
    <act_stmt_list> ::= <act_stmt_list> <act_stmt> | <act_stmt>
    <act_stmt> ::= freq_offset = <number> | wander = <number> | jitter = <number> | prop_delay = <number> | proc_delay = <number>

    In addition to the simulate command, other standard NTP configuration commands can be specified. These commands have the same meaning as in the ntpd configuration. Note that newlines are not significant within the simulate command even though they are used to mark the end of a normal NTP configuration command.

    Sample Configuration File

    A sample ntpdsim configuration file is given below. It specifies two simulated servers, each of which has two acts.

        # Client configuration 
        disable kernel
        server pogo
        driftfile ./ntp.drift
        statsdir ./ntpstats/
        filegen loopstats type day enable
        filegen peerstats type day enable
    
        # Simulation configuration
        simulate {
            simulation_duration = 86400
            beep_delay = 3600
    
            # Server 1
    	server = louie.udel.edu {
    	    server_offset = 0 
                duration = 50000 {
    		freq_offset = 400
    		wander = 1.0
    		jitter = 0.001
    		prop_delay = 0.001
    		proc_delay = 0.001
    	    }
                duration = 6400 {
    		freq_offset = 200
    		wander = 1.0
    		jitter = 0.001
    		prop_delay = 0.001
    		proc_delay = 0.001
    	    }
    	}
    
            # Server 2
    	server = baldwin.udel.edu {
    	    server_offset = 0.02
    	    duration = 10000 {
    		freq_offset = 400
    		wander = 1.0
    		jitter = 0.001
    		prop_delay = 0.5
    		proc_delay = 0.001
    	    }
    	    duration = 60000 {
    		freq_offset = 200
    		wander = 1.0
    		jitter = 0.05
    		prop_delay = 0.005
    		proc_delay = 0.001
    	    }
    	}
        }
      

    Sachin Kamboj
    ntp-4.2.6p5/html/ntptime.html0000644000175000017500000000443011307651604015127 0ustar peterpeter ntptime - read and set kernel time variables

    ntptime - read and set kernel time variables

    giffrom Pogo, Walt Kelly

    The turtle has been swimming in the kernel.

    Last update: 16:40 UTC Wednesday, March 12, 2008



    Synopsis

    ntptime [ -chr ] [ -e est_error ] [ -f frequency ] [ -m max_error ] [ -o offset ] [ -s status ] [ -t time_constant]

    Description

    This program is useful only with special kernels described in the A Kernel Model for Precision Timekeeping page. It reads and displays time-related kernel variables using the ntp_gettime() system call. A similar display can be obtained using the ntpdc program and kerninfo command.

    Options

    -c
    Display the execution time of ntptime itself.
    -e est_error
    Specify estimated error, in microseconds.
    -f frequency
    Specify frequency offset, in parts per million.
    -h
    Display help information.
    -m max_error
    Specify max possible errors, in microseconds.
    -o offset
    Specify clock offset, in microseconds.
    -r
    Display Unix and NTP times in raw format.
    -s status
    Specify clock status. Better know what you are doing.
    -t time_constant
    Specify time constant, an integer in the range 0-10.

    ntp-4.2.6p5/html/release.html0000644000175000017500000002674611307651603015104 0ustar peterpeter NTP Version 4 Release Notes

    NTP Version 4 Release Notes

    giffrom Alice's Adventures in Wonderland, Lewis Carroll

    The rabbit toots to make sure you read this.

    Last update: 16:10 UTC Sunday, March 02, 2008

    .

    NTP Version 4 Release Notes

    This release of the NTP Version 4 (NTPv4) daemon for Unix, VMS and Windows incorporates new features and refinements to the NTP Version 3 (NTPv3) algorithms. However, it continues the tradition of retaining backwards compatibility with older versions, including NTPv3 and NTPv2, but not NTPv1. Support for NTPv1 has been discontinued because of certain security vulnerabilities. The NTPv4 version has been under development for 25 years and the paint still isn't dry.

    The code compiles and runs properly in all test host configurations available to the developer corps, including Sun Microsystems, Digital/Compaq/Hewlett Packard, FreeBSD and Linux. Other volunteers have verified it works in IRIX and Windows NT and XP. We invite comments and corrections about the various architectures, operating systems and hardware complement that can't be verified by the developer corps. Of particular interest are other Windows versions, VMS and various reference clock drivers.

    This release has been compiled and tested on many systems, including SunOS 4.1.3, Solaris 2.5.1-2.10, Alpha Tru64 4.0-5.1, Ultrix 4.4, Linux 2.4.2, FreeBSD 4.5-6.2 and HP-UX 10.02. It has been compiled and tested by others on Windows NT4, 2000 and XP, but not yet on other Windows versions or for VMS. There are several new features apparently incompatible with Linux systems, including some modes used with the Autokey protocol. The developer corps looks for help elsewhere to resolve these differences.

    This note summarizes the differences between this software release of NTPv4, called ntp-4.x.x, and the previous NTPv3 version, called xntp3-5.x.x.

    New Features

    1. Support for the IPv6 addressing family is included in this distribution. If the Basic Socket Interface Extensions for IPv6 (RFC-2553) is detected, support for the IPv6 address family is generated in addition to the default support for the IPv4 address family.
    2. Most calculations are now done using 64-bit floating double format, rather than 64-bit fixed point format. The motivation for this is to reduce size, improve speed and avoid messy bounds checking.
    3. The clock discipline algorithm has been redesigned to improve accuracy, reduce the impact of network jitter and allow increased in poll intervals to 36 hours with only moderate sacrifice in accuracy.
    4. A new feature called "huffpuff" maximizes accuracy in cases of highly asymmetric network delays typical of ISDN and telephone modems.
    5. The clock selection algorithm has been redesigned to reduce "clockhopping" when the choice of servers changes frequently as the result of comparatively insignificant quality changes.
    6. This release includes support for the nanokernel precision time kernel modifications, which are now in stock FreeBSD and optional in Linux kernels. With this support the system clock can be disciplined to the order of one nanosecon. The older microtime kernel modifications in Digital/Compaq/HP Tru64, Digital Ultrix and Sun Microsystems SunOS and Solaris, continue to be supported. In either case the support eliminates sawtooth error, which can be in the hundreds of microseconds.
    7. This release includes support for Autokey public-key cryptography, which is the preferred scheme for authenticating servers to clients. Additional information about Autokey cryptography is on the Authentication Options page and links from there. See also the new cryptostats monitoring statistics file in the Monitoring Options page.
    8. The OpenSSL cryptographic library has replaced the library formerly available from RSA Laboratories. All cryptographic routines except a version of the MD5 message digest routine have been removed from the base distribution.
    9. As the result of the above, the authstuff directory, intended as a development and testing aid for porting cryptographic routines to exotic architectures, has been removed. Testing and conformance validation tools are in the OpenSSL software distrbution.
    10. This release includes support for a discrete event simulator (DES), which allows the NTP algorithms to be tested in an embedded environment with systematic and pseudorandom network delay and oscillator wander distributions. This has been used to verify correct operation under conditions of extreme error and misconfiguration. See the ntpdsim - Network Time Protocol (NTP) simulator page.
    11. NTPv4 includes three new server discovery schemes, which in most applications can avoid per-host configuration altogether. Two of these are based on IP multicast technology, while the remaining one is based on crafted DNS lookups. See the Automatic NTP Configuration Schemes page for further information.
    12. This release includes comprehensive packet rate management tools to help reduce the level of spurious network traffic and protect the busiest servers from overload. See the Rate Management and the Kiss-o'-Death Packet page for further information.
    13. This release includes support for the orphan mode, which replaces the local clock driver for most configurations. Orphan mode provides an automatic, subnet-wide synchronization feature with multiple sources. It can be used in isolated networks or in Internet subnets where the servers or Internet connection have failed. See the Automatic NTP Configuration Options page for further information.
    14. There are two new burst mode features available where special conditions apply. One of these is enabled by the iburst keyword in the server configuration command. It is intended for cases where it is important to set the clock quickly when an association is first mobilized. The other is enabled by the burst keyword in the server configuration command. It is intended for cases where the network attachment requires an initial calling or training procedure. See the Association Management page for further information.
    15. The reference clock driver interface is smaller, more rational and more accurate.
    16. Support for pulse-per-second (PPS) signals has been extended to all drivers as an intrinsic function. Most of the drivers in NTPv3 have been converted to the NTPv4 interface and continue to operate as before. New drivers have been added for several GPS receivers now on the market for a total of 44 drivers. Audio drivers for the Canadian standard time and frequency station CHU, the US standard time and frequency stations WWV/H and for IRIG signals have been updated and capabilities added to allow direct connection of these signals to an audio port. See the Reference Clock Audio Drivers page for further information.
    17. In all except a very few cases, all timing intervals are randomized, so that the tendency for NTPv3 to self-synchronize and bunch messages, especially with a large number of configured associations, is minimized.
    18. In NTPv3 a large number of weeds and useless code had grown over the years since the original NTP code was implemented 25 years ago. Using a powerful weedwacker, much of the shrubbery has been removed, with effect a substantial reduction in size of almost 40 percent.
    19. The entire distribution has been converted to gnu automake, which should greatly ease the task of porting to new and different programming environments, as well as reduce the incidence of bugs due to improper handling of idiosyncratic kernel functions. Version control is provided by Bitkeeper using an online repository at www.ntp.org. Trouble ticket reporting is provided using Bugzilla.
    20. Several new options have been added for the ntpd command line. For the inveterate knob twiddlers several of the more important performance variables can be changed to fit actual or perceived special conditions. In particular, the tos and tos commands can be used to adjust thresholds, throw switches and change limits.
    21. The ntpd daemon can be operated in a one-time mode similar to ntpdate, which program is headed for retirement. See the ntpd - Network Time Protocol (NTP) daemon page for the new features.

    Nasty Surprises

    There are a few things different about this release that have changed since the latest NTP Version 3 release. Following are a few things to worry about:

    1. Some configuration commands have been removed, others added and some changed in minor ways. See the Commands and Options collection on the Site Map page.
    2. When both IPv4 and IPv6 address families are in use, the host's resolver library may not choose the intended address family if a server has an IPv4 and IPv6 address associated with the same DNS name. The solution is to use the IPv4 or IPv6 address directly in such cases or use another DNS name that resolves to the intended address family. Older versions of ntpdc will show only the IPv4 associations with the peers and some other commands. Older versions of ntpq will show 0.0.0.0 for IPv6 associations with the peers and some other commands.
    3. There is a minor change to the reference ID field of the NTP packet header when operating with IPv6 associations. In IPv4 associations this field contains the 32-bit IPv4 address of the server, in order to detect and avoid loops. In IPv6 associations this field contains the first 32-bits of a MD5 hash formed from the IPv6 address. All programs in the distribution have been modified to work with both address families.
    4. The tty_clk and ppsclock pulse-per-second (PPS) line discipline/streams modules are no longer supported. The PPS function is now handled by the PPS Clock Discipline driver, which uses the new PPSAPI application program interface adopted by the IETF. Note that the pps configuration file command has been obsoleted by the driver. See the Pulse-per-second (PPS) Signal Interfacing page for further information.
    5. Support for the NTPv1 symmetric mode has been discontinued, since it hasn't worked for years. Support continues for the NTPv1 client mode, which is used by some SNTP clients.

    ntp-4.2.6p5/html/ntpq.html0000644000175000017500000006303511606456562014447 0ustar peterpeter ntpq - standard NTP query program

    ntpq - standard NTP query program

    giffrom Pogo, Walt Kelly

    A typical NTP monitoring packet

    Last update: 04-Nov-2009 0:12 UTC


    More Help


    Synopsis

    ntpq [-46dinp] [-c command] [host] [...]

    Description

    The ntpq utility program is used to monitor NTP daemon ntpd operations and determine performance. It uses the standard NTP mode 6 control message formats defined in Appendix B of the NTPv3 specification RFC1305. The same formats are used in NTPv4, although some of the variable names have changed and new ones added. The description on this page is for the NTPv4 variables.

    The program can be run either in interactive mode or controlled using command line arguments. Requests to read and write arbitrary variables can be assembled, with raw and pretty-printed output options being available. The ntpq can also obtain and print a list of peers in a common format by sending multiple queries to the server.

    If one or more request options is included on the command line when ntpq is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, ntpq will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. ntpq will prompt for commands if the standard input is a terminal device.

    ntpq uses NTP mode 6 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. ntpq makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.

    Note that in contexts where a host name is expected, a -4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS resolution to the IPv6 namespace.

    For examples and usage, see the NTP Debugging Techniques page.

    Command line options are described following. Specifying a command line option other than -i or -n will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, ntpq will attempt to read interactive format commands from the standard input.

    -4
    Force DNS resolution of following host names on the command line to the IPv4 namespace.
    -6
    Force DNS resolution of following host names on the command line to the IPv6 namespace.
    -c
    The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). Multiple -c options may be given.
    -d
    Turn on debugging mode.
    -i
    Force ntpq to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input.
    -n
    Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names.
    -p
    Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the peers interactive command.

    Internal Commands

    Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to uniquely identify the command need be typed. The output of a command is normally sent to the standard output, but optionally the output of individual commands may be sent to a file by appending a >, followed by a file name, to the command line. A number of interactive format commands are executed entirely within the ntpq program itself and do not result in NTP mode-6 requests being sent to a server. These are described following.

    ? [command_keyword]
    help [command_keyword]
    A ? by itself will print a list of all the command keywords known to ntpq. A ? followed by a command keyword will print function and usage information about the command.
    addvars name [ = value] [...]
    rmvars name [...]
    clearvars
    The arguments to this command consist of a list of items of the form name = value, where the = value is ignored, and can be omitted in read requests. ntpq maintains an internal list in which data to be included in control messages can be assembled, and sent using the readlist and writelist commands described below. The addvars command allows variables and optional values to be added to the list. If more than one variable is to be added, the list should be comma-separated and not contain white space. The rmvars command can be used to remove individual variables from the list, while the clearlist command removes all variables from the list.
    cooked
    Display server messages in prettyprint format.
    debug more | less | off
    Turns internal query program debugging on and off.
    delay milliseconds
    Specify a time interval to be added to timestamps included in requests which require authentication. This is used to enable (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized. Actually the server does not now require timestamps in authenticated requests, so this command may be obsolete.
    host name
    Set the host to which future queries will be sent. The name may be either a DNS name or a numeric address.
    hostnames [yes | no]
    If yes is specified, host names are printed in information displays. If no is specified, numeric addresses are printed instead. The default is yes, unless modified using the command line -n switch.
    keyid keyid
    This command specifies the key number to be used to authenticate configuration requests. This must correspond to a key number the server has been configured to use for this purpose.
    ntpversion 1 | 2 | 3 | 4
    Sets the NTP version number which ntpq claims in packets. Defaults to 2, Note that mode-6 control messages (and modes, for that matter) didn't exist in NTP version 1.
    passwd
    This command prompts for a password to authenticate configuration requests. The password must correspond to the key configured for NTP server for this purpose.
    quit
    Exit ntpq.
    raw
    Display server messages as received and without reformatting.
    timeout milliseconds
    Specify a timeout period for responses to server queries. The default is about 5000 milliseconds. Note that since ntpq retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set.

    Control Message Commands

    Association IDs are used to identify system, peer and clock variables. System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace. Most control commands send a single mode-6 message to the server and expect a single response message. The exceptions are the peers command, which sends a series of messages, and the mreadlist and mreadvar commands, which iterate over a range of associations.

    associations
    Display a list of mobilized associations in the form
    ind assid status conf reach auth condition last_event cnt
    Variable Description
    ind index on this list
    assid association ID
    status peer status word
    conf yes: persistent, no: ephemeral
    reach yes: reachable, no: unreachable
    auth ok, yes, bad and none
    condition selection status (see the select field of the peer status word)
    last_event event report (see the event field of the peer status word)
    cnt event count (see the count field of the peer status word)
    clockvar assocID [name [ = value [...]] [...]
    cv assocID [name [ = value [...] ][...]
    Display a list of clock variables for those assocations supporting a reference clock.
    :config [...]
    Send the remainder of the command line, including whitespace, to the server as a run-time configuration command in the same format as the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
    config-from-file filename
    Send the each line of filename to the server as run-time configuration commands in the same format as the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
    keyid
    Specify the key ID to use for write requests.
    lassociations
    Perform the same function as the associations command, execept display mobilized and unmobilized associations.
    mreadvar assocID assocID [ variable_name [ = value[ ... ]
    mrv assocID assocID [ variable_name [ = value[ ... ]
    Perform the same function as the readvar command, except for a range of association IDs. This range is determined from the association list cached by the most recent associations command.
    passociations
    Perform the same function as the associations command, except that it uses previously stored data rather than making a new query.
    passwd
    Specify the password to use for write requests.
    peers
    Display a list of peers in the form
    [tally]remote refid st t when pool reach delay offset jitter
    Variable Description
    [tally] single-character code indicating current value of the select field of the peer status word
    remote host name (or IP number) of peer
    refid association ID or kiss code
    st stratum
    t u: unicast, b: broadcast, l: local
    when sec/min/hr since last received packet
    poll poll interval (log2 s)
    reach reach shift register (octal)
    delay roundtrip delay
    offset offset
    jitter jitter
    readvar assocID name [ = value ] [,...]
    rv assocID [ name ] [,...]
    Display the specified variables. If assocID is zero, the variables are from the system variables name space, otherwise they are from the peer variables name space. The assocID is required, as the same name can occur in both spaces. If no name is included, all operative variables in the name space are displayed. In this case only, if the assocID is omitted, it is assumed zero. Multiple names are specified with comma separators and without whitespace. Note that time values are represented in milliseconds and frequency values in parts-per-million (PPM). Some NTP timestamps are represented in the format YYYYMMDDTTTT, where YYYY is the year, MM the month of year, DD the day of month and TTTT the time of day.
    saveconfig filename
    Write the current configuration, including any runtime modifications given with :config or config-from-file, to the ntpd host's file filename. This command will be rejected by the server unless saveconfigdir appears in the ntpd configuration file. filename can use strftime() format specifiers to substitute the current date and time, for example, saveconfig ntp-%Y%m%d-%H%M%S.conf. The filename used is stored in system variable savedconfig. Authentication is required.
    writevar assocID name = value [,...]
    Write the specified variables. If the assocID is zero, the variables are from the system variables name space, otherwise they are from the peer variables name space. The assocID is required, as the same name can occur in both spaces.

    Status Words and Kiss Codes

    The current state of the operating program is shown in a set of status words maintained by the system and each association separately. These words are displayed in the rv and as commands both in hexadecimal and decoded short tip strings. The codes, tips and short explanations are on the Event Messages and Status Words page. The page also includes a list of system and peer messages, the code for the latest of which is included in the status word.

    Information resulting from protocol machine state transitions is displayed using an informal set of ASCII strings called kiss codes. The original purpose was for kiss-o'-death (KoD) packets sent by the server to advise the client of an unusual condition. They are now displayed, when appropriate, in the reference identifier field in various billboards.

    System Variables

    The following system variables appear in the rv billboard. Not all variables are displayed in some configurations.

    Variable Description
    status system status word
    version NTP software version and build time
    processor hardware platform and version
    system operating system and version
    leap leap warning indicator (0-3)
    stratum stratum (1-15)
    precision precision (log2 s)
    rootdelay total roundtrip delay to the primary reference clock
    rootdisp total dispersion to the primary reference clock
    peer system peer association ID
    tc time constant and poll exponent (log2 s) (3-17)
    mintc minimum time constant (log2 s) (3-10)
    clock date and time of day
    refid reference ID or kiss code
    reftime reference time
    offset combined time offset
    sys_jitter combined system jitter
    frequency clock frequency offset (PPM)
    clk_wander clock frequency wander (PPM)
    clk_jitter clock jitter
    tai TAI-UTC offset (s)
    leapsec NTP seconds when the next leap second is/was inserted
    expire NTP seconds when the NIST leapseconds file expires
    The jitter and wander statistics are exponentially-weighted RMS averages. The system jitter is defined in the NTPv4 specification; the clock jitter statistic is computed by the clock discipline module.
    When the NTPv4 daemon is compiled with the OpenSSL software library, additional system variables are displayed, including some or all of the following, depending on the particular Autokey dance:
    Variable Description
    host Autokey host name
    group Autokey group name
    flags host flags (see Autokey specification)
    digest OpenSSL message digest algorithm
    signature OpenSSL digest/signature scheme
    update NTP seconds at last signature update
    cert certificate subject, issuer and certificate flags
    until NTP seconds when the certificate expires

    Peer Variables

    The following system variables apear in the rv billboard for each association. Not all variables are displayed in some configurations.

    Variable Description
    associd association ID
    status peer status word
    srcadr
    srcport
    source (remote) IP address and port
    dstadr
    dstport
    destination (local) IP address and port
    leap leap indicator (0-3)
    stratum stratum (0-15)
    precision precision (log2 s)
    rootdelay total roundtrip delay to the primary reference clock
    rootdisp total root dispersion to the primary reference clock
    refid reference ID or kiss code
    reftime reference time
    reach reach register (octal)
    unreach unreach counter
    hmode host mode (1-6)
    pmode peer mode (1-5)
    hpoll host poll exponent (log2 s) (3-17)
    ppoll peer poll exponent (log2 s) (3-17)
    headway headway (see Rate Management and the Kiss-o'-Death Packet)
    flash flash status word
    offset filter offset
    delay filter delay
    dispersion filter dispersion
    jitter filter jitter
    bias unicast/broadcast bias
    xleave interleave delay (see NTP Interleaved Modes)

    The bias vaqriable is calculated when the first broadcast packet is received after the calibration volley. It represents the offset of the broadcast subgraph relative to the unicast subgraph. The xleave variable appears only the interleaved symmetric and ingterleaved modes. It represents the internal queueing, buffering and transmission delays for the preceeding packet.

    When the NTPv4 daemon is compiled with the OpenSSL software library, additional peer variables are displayed, including the following:

    Variable Description
    flags peer flags (see Autokey specification)
    host Autokey server name
    flags peer flags (see Autokey specification)
    signature OpenSSL digest/signature shceme
    initsequence initial key ID
    initkey initial key index
    timestamp Autokey signature timestamp

    Clock Variables

    The following clock variables apear in the cv billboard for each association with a reference clock. Not all variables are displayed in some configurations.

    Variable Description
    associd association ID
    status clock status word
    device device description
    timecode ASCII timecode string (specific to device)
    poll poll messages sent
    noreply no reply
    badformat bad format
    baddata bad date or time
    fudgetime1 fudge time 1
    fudgetime2 fudge time 2
    stratum driver stratum
    refid driver reference ID
    flags driver flags

    ntp-4.2.6p5/html/comdex.html0000644000175000017500000000256111307651603014730 0ustar peterpeter Command Index

    Command Index

    giffrom Alice's Adventures in Wonderland, Lewis Carrol

    The Mad Hatter says "Bring it on".

    Last update: 08-Apr-2009 2:56 UTC


    Related Links



    ntp-4.2.6p5/html/drivers/0000755000175000017500000000000011675461367014253 5ustar peterpeterntp-4.2.6p5/html/drivers/driver32.html0000644000175000017500000000303610441361215016560 0ustar peterpeter Chrono-log K-series WWVB receiver

    Chrono-log K-series WWVB receiver


    Synopsis

    Address: 127.127.32.u
    Reference ID: CHRONOLOG
    Driver ID: CHRONOLOG
    Serial Port: /dev/chronologu; 2400 bps, 8-bits, no parity

    Features: (none)

    Description

    This driver supports the Chrono-log K-series WWVB receiver. This is a very old receiver without provisions for leap seconds, quality codes, etc. It assumes output in the local time zone, and that the C library mktime()/localtime() routines will correctly convert back and forth between local and UTC. There is a hack in the driver for permitting UTC, but it has not been tested.

    Most of this code is originally from refclock_wwvb.c with thanks. It has been so mangled that wwvb is not a recognizable ancestor.

    Timecode format: Y yy/mm/ddCLZhh:mm:ssCL
    Y - year/month/date line indicator
    yy/mm/dd -- two-digit year/month/day
    C - \r (carriage return)
    L - \n (newline)
    Z - timestamp indicator
    hh:mm:ss - local time
    
    Last modified: Sun Feb 14 11:57:27 EST 1999
    ntp-4.2.6p5/html/drivers/icons/0000755000175000017500000000000011675461367015366 5ustar peterpeterntp-4.2.6p5/html/drivers/icons/home.gif0000644000175000017500000000172710017034532016767 0ustar peterpeterGIF89a$÷€€€€€€€€€ÀÀÀÀÜÀ¤ÈðUªÕ+U+€+ª+Õ+ÿ+UUU€UªUÕUÿUU€ª€Õ€ÿ€ªUª€ªªªÕªÿªÕUÕ€ÕªÕÕÕÿÕUÿ€ÿªÿÕÿUUU€UªUÕUÿU+UU+U€+Uª+UÕ+Uÿ+UUUUUU€UUªUUÕUUÿUU€UU€U€€Uª€UÕ€Uÿ€UªUUªU€ªUªªUÕªUÿªUÕUUÕU€ÕUªÕUÕÕUÿÕUÿUUÿU€ÿUªÿUÕÿUÿÿUU€ª€Õ€ÿ€+€U+€€+€ª+€Õ+€ÿ+€U€UU€€U€ªU€ÕU€ÿU€U€€ª€€Õ€€ÿ€€ª€Uª€€ª€ªª€Õª€ÿª€Õ€UÕ€€Õ€ªÕ€ÕÕ€ÿÕ€ÿ€Uÿ€€ÿ€ªÿ€Õÿ€ÿÿ€ªUª€ªªªÕªÿª+ªU+ª€+ªª+ªÕ+ªÿ+ªUªUUª€UªªUªÕUªÿUª€ªU€ª€€ªª€ªÕ€ªÿ€ªªªUªª€ªªªªªÕªªÿªªÕªUÕª€ÕªªÕªÕÕªÿ€ ÿªUÿª€ÿªªÿªÕÿªÿÿªÕUÕ€ÕªÕÕÕÿÕ+ÕU+Õ€+Õª+ÕÕ+Õÿ+ÕUÕUUÕ€UÕªUÕÕUÕÿUÕ€ÕU€Õ€€Õª€ÕÕ€Õÿ€ÕªÕUªÕ€ªÕªªÕÕªÕÿªÕÕÕUÕÕ€ÕÕªÕÕÕÕÕÿÕÕÿÕUÿÕ€ÿÕªÿÕÕÿÕÿÿÕUÿ€ÿªÿÕÿ+ÿU+ÿ€+ÿª+ÿÕ+ÿÿ+ÿUÿUUÿ€UÿªUÿÕUÿÿUÿ€ÿU€ÿ€€ÿª€ÿÕ€ÿÿ€ÿªÿUªÿ€ªÿªªÿÕªÿÿªÿÕÿUÕÿ€ÕÿªÕÿÕÕÿÿÕÿUÿÿ€ÿÿªÿÿÿûð  ¤€€€ÿÿÿÿÿÿÿÿÿÿÿÿ!ù,$´H° Áƒ*\˜ŸÃ‡#Jœø° ʼnþ.J,¨¢¿ Éïc?! †4ÙïdÆŽ;²lé²cA3iÖ¼XðbN;'¤øhЈ‰~\Ê´)Å‚DóIJuêK‰£îÛZuë¾|W#Ô à+Õ}eÁR,¨•ëY®a!ŒZµ®Ú‰éNÕÇ·j܇õJÕ@Ÿ_ŠçÓWøðÄ‚J›JF)± ÉËjÞ̹3Á€;ntp-4.2.6p5/html/drivers/icons/mail2.gif0000644000175000017500000000043710017034532017040 0ustar peterpeterGIF89a"ƒ„„ÿÿÿÿÅÞÖsœœsŒ”ÖïÖŒ¤¤)BZ”œ­­¤½µ½ÎÅ!ù,"ÌÈI«½7h{å’ €^&•H–S€¾”°’KÜ0Žsiã8€n·ú¼€A±÷:‘ÉÏø|"«œ…)ÉAQ@¬­ÕÂ/M0{F\…ÍÄs·Ù=ç»Nwn*ep}/l=Sz|rcˆb`c‘pqL¦¦¯-´-­•¶g¶‚®ºƒ£¬³¿¬2o¹Ä·2S¨É["#ш4Ï˪Ôa„¨ÔÙ<ÁÜÀÒeáÅß×ÜÚäå[hìï;ntp-4.2.6p5/html/drivers/driver40.html0000644000175000017500000001423111200763100016547 0ustar peterpeter JJY Receivers

    JJY Receivers


    Synopsis

    Address: 127.127.40.u
    Reference ID: JJY
    Driver ID: JJY
    Serial Port: /dev/jjyu; 9600|4800(See corresponding receiver) baud, 8-bits, no parity, 1 stop bit

    Description

    This driver supports the following JJY receivers sold in Japan.

    • Tristate Ltd. JJY01 http://www.tristate.ne.jp/ (Japanese only)
      NTP configuration ( ntp.conf )

      server   127.127.40.X   mode 1


      RS-232C

      9600 Baud


      Time code format

      Command  -->  Reply
      date<CR><LF>  -->  YYYY/MM/DD WWW<CR><LF>
      stim<CR><LF>  -->  HH:MM:SS<CR><LF>

    • C-DEX Co.,Ltd. JST2000 http://www.c-dex.co.jp/ (Japanese only)
      NTP configuration ( ntp.conf )

      server   127.127.40.X   mode 2


      RS-232C

      9600 Baud


      Time code format

      Command  -->  Reply
      <ENQ>1J<ETX>  -->  <STX>JYYMMDD HHMMSSS<ETX>

    • Echo Keisokuki Co.,Ltd. LT-2000 http://www.clock.co.jp/ (Japanese only)

      NTP configuration ( ntp.conf )

      server   127.127.40.X   mode 3


      RS-232C

      9600 Baud


      Time code format

      Command  -->  Reply
      C  -->  ( Mode 2 : Continuous )
      ( Every second before 0.5 second ) YYMMDDWHHMMSS<ST1><ST2><ST3><ST4><CR>
      #  -->  ( Mode 1 : Request&Send )

    • CITIZEN T.I.C. CO.,LTD. JJY-200 http://www.tic-citizen.co.jp/ (Japanese only)

      NTP configuration ( ntp.conf )

      server   127.127.40.X   mode 4


      RS-232C

      4800 Baud


      Time code format

      Command  -->  Reply
      ( Every second ) 'XX YY/MM/DD W HH:MM:SS<CR>

    JJY is the radio station which transmites the JST (Japan Standard Time) in long wave radio. The station JJY is operated by the National Institute of Information and Communications Technology. An operating announcement and some information are avaiable from http://www.nict.go.jp/ (English and Japanese) and http://jjy.nict.go.jp/ (English and Japanese)

    The user is expected to provide a symbolic link to an available serial port device. This is typically performed by a command such as:

    ln -s /dev/ttyS0 /dev/jjy0

    Windows NT does not support symbolic links to device files. COMX: is the unit used by the driver, based on the refclock unit number, where unit 1 corresponds to COM1: and unit 3 corresponds to COM3:

    Monitor Data

    The driver writes each timecode as received to the clockstats file.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default JJY.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Not used by this driver.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Not used by this driver.

    ntp-4.2.6p5/html/drivers/driver27.html0000644000175000017500000004704511307651605016603 0ustar peterpeter Arcron MSF Receiver

    Arcron MSF Receiver


    Synopsis

    Address: 127.127.27.u
    Reference ID: MSFa / MSF / DCF / WWVB
    Driver ID: MSF_ARCRON
    Serial Port: /dev/arcu; 300 baud, 8-bits, 2-stop, no parity
    Features: tty_clk

    Description

    This driver supports the Arcron MSF, DCF and WWVB receivers. The clock reports its ID as "MSFa'', "MSF'', "DCF'' or "WWVB'' to indicate the time source.

    This documentation describes v1.3 (2003/2/21) of the source and has been tested against ntpd 4.1.0 on linux x86. Changes from v1.1 and v1.2 include patches to work with the new ntp-4 code, clock support for DCF and WWVB configurable via mode flag, an option to ignore resync request (for those of us at the fringes of the WWVB signal, for instance), averaging of the signal quality poll and several bug fixes, code cleanup and standardizations. In all other respects, the driver works as per v1.1 if a mode is not specified.

    To use the alternate modes, the mode flag must be specified. If the mode flag is 0, or unspecified, the original MSF version is assumed. This should assure backwards compatibility and should not break existing setups.

    The previous documentation described version V1.1 (1997/06/23) of the source and had been tested (amongst others) against ntpd3-5.90 on Solaris-1 (SunOS 4.1.3_U1 on an SS1 serving as a router and firewall) and against ntpd3-5.90 on Solaris-2.5 (on a SS1+ and TurboSPARC 170MHz). That code will claimed increased stability, reduced jitter and more efficiency (fewer context switches) with the tty_clk discipline/STREAMS module installed, but this has not been tested. For a to-do list see the comments at the start of the code.

    This code has been significantly slimmed down since the V1.0 version, roughly halving the memory footprint of its code and data.

    This driver is designed to allow the unit to run from batteries as designed, for something approaching the 2.5 years expected in the usual stand-alone mode, but no battery-life measurements have been taken.

    Much of this code is originally from the other refclock driver files with thanks. The code was originally made to work with the clock by Derek Mulcahy, with modifications by Damon Hart-Davis. Thanks also to Lyndon David for some of the specifications of the clock. Paul Alfille added support for the WWVB clock. Christopher Price added enhanced support for the MSF, DCF and WWVB clocks.

    There is support for a Tcl/Tk monitor written by Derek Mulcahy that examines the output stats; see the ARC Rugby MSF Receiver page for more details and the code. Information on the WWVB version is available from Atomic Time as their Atomic Time PC.

    Look at the notes at the start of the code for further information; some of the more important details follow.

    The driver interrogates the clock at each poll (ie every 64s by default) for a timestamp. The clock responds at the start of the next second (with the start bit of the first byte being on-time). In the default or original MSF mode, the time is in `local' format, including the daylight savings adjustment when it is in effect. The driver code converts the time back to UTC. In modes 1-3 the driver can be configured for UTC or local time depending on the setting of flag1.

    The clock claims to be accurate to within about 20ms of the broadcast time, and given the low data transmission speed from clock to host, and the fact that the clock is not in continuous sync with MSF, it seems sensible to set the `precision' of this clock to -5 or -4, -4 being used in this code, which builds in a reported dispersion of over 63ms (ie says ``This clock is not very good.''). You can improve the reported precision to -4 (and thus reduce the base dispersion to about 31ms) by setting the fudge flag3 to 1.

    Even a busy and slow IP link can yield lower dispersions than this from polls of primary time servers on the Internet, which reinforces the idea that this clock should be used as a backup in case of problems with such an IP link, or in the unfortunate event of failure of more accurate sources such as GPS.

    By default this clock reports itself to be at stratum 2 rather than the usual stratum 0 for a refclock, because it is not really suited to be used as other than a backup source. The stratum reported can be changed with the stratum directive to be whatever you like. After careful monitoring of your clock, and appropriate choice of the time1 fudge factor to remove systematic errors in the clock's reported time, you might fudge the clock to stratum 1 to allow a stratum-2 secondary server to sync to it.

    In default mode, the driver code arranges to resync the clock to MSF at intervals of a little less than an hour (deliberately avoiding the same time each hour to avoid any systematic problems with the signal or host). Whilst resyncing, the driver supplements the normal polls for time from the clock with polls for the reception signal quality reported by the clock. If the signal quality is too low (0--2 out of a range of 0--5), we chose not to trust the clock until the next resync (which we bring forward by about half an hour). If we don't catch the resync, and so don't know the signal quality, we do trust the clock (because this would generally be when the signal is very good and a resync happens quickly), but we still bring the next resync forward and reduce the reported precision (and thus increase reported dispersion).

    If we force resyncs to MSF too often we will needlessly exhaust the batteries the unit runs from. During clock resync this driver tries to take enough time samples to avoid ntpd losing sync in case this clock is the current peer. By default the clock would only resync to MSF about once per day, which would almost certainly not be acceptable for NTP purposes.

    The driver does not force an immediate resync of the clock to MSF when it starts up to avoid excessive battery drain in case ntpd is going to be repeatedly restarted for any reason, and also to allow enough samples of the clock to be taken for ntpd to sync immediately to this clock (and not remain unsynchronised or to sync briefly to another configured peer, only to hop back in a few poll times, causing unnecessary disturbance). This behaviour should not cause problems because the driver will not accept the timestamps from the clock if the status flag delivered with the time code indicates that the last resync attempt was unsuccessful, so the initial timestamps will be close to reality, even if with up to a day's clock drift in the worst case (the clock by default resyncs to MSF once per day).

    When alternate modes 1-3 are selected, the driver can be configured to ignore the resync requests by setting flag2 to 1. This allows clocks at the fringe of the signal to resync at night when signals are stronger.

    The clock has a peculiar RS232 arrangement where the transmit lines are powered from the receive lines, presumably to minimise battery drain. This arrangement has two consequences:

    • Your RS232 interface must drive both +ve and -ve
    • You must (in theory) wait for an echo and a further 10ms between characters

    This driver, running on standard Sun and x86 hardware, seems to work fine; note the use of the send_slow() routine to queue up command characters to be sent once every two seconds.

    Three commands are sent to the clock by this driver. Each command consists of a single letter (of which only the bottom four bits are significant), followed by a CR (ASCII 13). Each character sent to the clock should be followed by a delay to allow the unit to echo the character, and then by a further 10ms. Following the echo of the command string, there may be a response (ie in the case of the g and o commands below), which in the case of the o command may be delayed by up to 1 second so as the start bit of the first byte of the response can arrive on time. The commands and their responses are:

    g CR
    Request for signal quality. Answer only valid during (late part of) resync to MSF signal. The response consists of two characters as follows:
    bit 7
    parity
    bit 6
    always 0
    bit 5
    always 1
    bit 4
    always 1
    bit 3
    always 0
    bit 2
    always 0
    bit 1
    always 1
    bit 0
    = 0 if no reception attempt at the moment, = 1 if reception attempt (ie resync) in progress
    bit 7
    parity
    bit 6
    always 0
    bit 5
    always 1
    bit 4
    always 1
    bit 3
    always 0
    bit 2--0
    reception signal quality in the range 0--5 (very poor to very good); if in the range 0--2 no successful reception is to be expected. The reported value drops to zero when not resyncing, ie when first returned byte is not `3'.
    h CR
    Request to resync to signal. Can take up from about 30s to 360s. Drains batteries so should not be used excessively. After this the clock time and date should be correct and the phase within 20ms of time as transmitted from the source signal (remember to allow for propagation time). By default the clock resyncs once per day in the late evening/early morning (presumably to catch transitions to/from daylight saving time quickly). This driver code, by default, resyncs at least once per hour to minimise clock wander.
    o CR
    Request timestamp. Start bit of first byte of response is on-time, so may be delayed up to 1 second. Note that the driver will convert time to GMT, if required. The response data is as follows:
    1. hours tens (hours range from 00 to 23)
    2. hours units
    3. minutes tens (minutes range from 00 to 59)
    4. minutes units
    5. seconds tens (seconds presumed to range from 00 to 60 to allow for leap second)
    6. seconds units
    7. day of week 1 (Monday) to 7 (Sunday)
    8. day of month tens (day ranges from 01 to 31)
    9. day of month units
    10. month tens (months range from 01 to 12)
    11. month units
    12. year tens (years range from 00 to 99)
    13. year units
    14. BST/UTC status (Ignored in WWVB version)
      bit 7
      parity
      bit 6
      always 0
      bit 5
      always 1
      bit 4
      always 1
      bit 3
      (MSF) always 0
      (WWVB) Leap year indicator bit
      0 = non-leap year
      1 = leap year
      bit 2
      = (MSF) 1 if UTC is in effect (reverse of bit 1)
      (WWVB) Leap second warning bit
      bit 1
      = (MSF)1 if BST is in effect (reverse of bit 2)
      = (WWVB) 0 if ST is in effect, 1 if DST is in effect, 1 if transition from ST with bit 0 is set to 0
      bit 0
      = (MSF)1 if BST/UTC change pending
      = (WWVB) 0 if ST is in effect, 1 if DST is in effect, 0 if transition from DST with bit 1 is set to 0
    15. clock status
      bit 7
      parity
      bit 6
      always 0
      bit 5
      always 1
      bit 4
      always 1
      bit 3
      = 1 if low battery is detected
      bit 2
      = 1 if last resync failed (though officially undefined for the MSF clock, officially defined for WWVB)
      bit 1
      = 1 if at least one reception attempt was successful
      (MSF) since 0230
      (DCF) since 0300
      (WWVB) resets if not successful between 0300-0400
      bit 0
      = 1 if the clock has valid time---reset to zero when clock is reset (eg at power-up), and set to 1 after first successful resync attempt.

    The driver only accepts time from the clock if the bottom three bits of the status byte are 011 or flag2 is set to 1 to ignore resync requests. For the MSF clock, if the UK parliament decides to move us to +0100/+0200 time as opposed to the current +0000/+0100 time, it is not clear what effect that will have on the time broadcast by MSF, and therefore on this driver's usefulness.

    A typical ntp.conf configuration file for this driver might be:

    # hostname(n) means we expect (n) to be the stratum at which hostname runs.
    
    #------------------------------------------------------------------------------
    # SYNCHRONISATION PARTNERS
    # ========================
    
    # Default configuration (Original MSF mode)s...
    server 127.127.27.0 mode 333 # ARCRON MSF radio clock
    # Fudge stratum and other features as required.
    # ADJUST time1 VALUE FOR YOUR HOST, CLOCK AND LOCATION!
    fudge 127.127.27.0 stratum 1 time1 0.016 flag3 1
    # WWVB users should change that line to:
    server 127.127.27.0 mode 3 # ARCRON WWVB radio clock
    fudge 127.127.27.0 stratum 1 time1 0.030 flag1 1 flag3 1
    
    peer 11.22.33.9 # tick(1--2).
    peer 11.22.33.4 # tock(3), boot/NFS server.
    
    # This shouldn't get swept away unless left untouched for a long time.
    driftfile /var/tmp/ntp.drift
    
    #------------------------------------------------------------------------------
    # RESTRICTIONS
    # ============
    
    # By default, don't trust and don't allow modifications.  Ignore in fact.
    restrict default ignore notrust nomodify
    
    # Allow others in our subnet to check us out...
    restrict 11.22.33.0 mask 255.255.255.0 nomodify notrust
    
    # Trust our peers for time.  Don't trust others in case they are insane.
    restrict 127.127.27.0 nomodify
    restrict 11.22.33.4 nomodify
    restrict 11.22.33.9 nomodify
    
    # Allow anything from the local host.
    restrict 127.0.0.1
    There are a few #defines in the code that you might wish to play with:
    ARCRON_KEEN
    With this defined, the code is relatively trusting of the clock, and assumes that you will have the clock as one of a few time sources, so will bend over backwards to use the time from the clock when available and avoid ntpd dropping sync from the clock where possible. You may wish to undefine this, especially if you have better sources of time or your reception is ropey. However, there are many checks built in even with this flag defined.
    ARCRON_MULTIPLE_SAMPLES
    When is defined, we regard each character in the returned timecode as at a known delay from the start of the second, and use the smallest (most negative) offset implied by any such character, ie with the smallest kernel-induced display, and use that. This helps to reduce jitter and spikes.
    ARCRON_LEAPSECOND_KEEN
    When is defined, we try to do a resync to MSF as soon as possible in the first hour of the morning of the first day of the first and seventh months, ie just after a leap-second insertion or deletion would happen if it is going to. This should help compensate for the fact that this clock does not continuously sample MSF, which compounds the fact that MSF itself gives no warning of an impending leap-second event. This code did not seem functional at the leap-second insertion of 30th June 1997 so is by default disabled.
    PRECISION
    Currently set to -4, but you may wish to set it to -5 if you are more conservative, or to -6 if you have particularly good experience with the clock and you live on the edge. Note that the flag3 fudge value will improve the reported dispersion one notch if clock signal quality is known good. So maybe just leave this alone.

    Monitor Data

    Each timecode is written to the clockstats file with a signal quality value appended (`0'--`5' as reported by the clock, or `6' for unknown).

    Each resync and result (plus gaining or losing MSF sync) is logged to the system log at level LOG_NOTICE; note that each resync drains the unit's batteries, so the syslog entry seems justified.

    Syslog entries are of the form:

    May 10 10:15:24 oolong ntpd[615]: ARCRON: unit 0: sending resync command
    May 10 10:17:32 oolong ntpd[615]: ARCRON: sync finished, signal quality 5: OK, will use clock
    May 10 11:13:01 oolong ntpd[615]: ARCRON: unit 0: sending resync command
    May 10 11:14:06 oolong ntpd[615]: ARCRON: sync finished, signal quality -1: UNKNOWN, will use clock anyway
    May 10 11:41:49 oolong ntpd[615]: ARCRON: unit 0: sending resync command
    May 10 11:43:57 oolong ntpd[615]: ARCRON: sync finished, signal quality 5: OK, will use clock
    May 10 12:39:26 oolong ntpd[615]: ARCRON: unit 0: sending resync command
    May 10 12:41:34 oolong ntpd[615]: ARCRON: sync finished, signal quality 3: OK, will use clock

    Fudge Factors

    mode 0 | 1 | 2 | 3
    Specifies the clock hardware model. This parameter is optional, it defaults to the original mode of operation.
    Supported modes of operation:
    0 - Default, Original MSF
    1 - Updated MSF
    2 - New DCF77
    3 - New WWVB
    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. On a Sun SparcStation 1 running SunOS 4.1.3_U1, with the receiver in London, a value of 0.020 (20ms) seems to be appropriate.
    time2 time
    Not currently used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 2. It is suggested that the clock be not be fudged higher than stratum 1 so that it is used a backup time source rather than a primary when more accurate sources are available.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default MSFa. When used in modes 1-3, the driver will report either MSF, DCF, or WWVB respectively.
    flag1 0 | 1
    (Modes 1-3) If set to 0 (the default), the clock is set to UTC time. If set to 1, the clock is set to localtime.
    flag2 0 | 1
    (Modes 1-3) If set to 0 (the default), the clock will be forced to resync approximately every hour. If set to 1, the clock will resync per normal operations (approximately midnight).
    flag3 0 | 1
    If set to 1, better precision is reported (and thus lower dispersion) while clock's received signal quality is known to be good.
    flag4 0 | 1
    Not used by this driver.

    Additional Information

    Reference Clock Drivers
    ARC Rugby MSF Receiver


    ntp-4.2.6p5/html/drivers/driver18.html0000644000175000017500000001762011307651603016575 0ustar peterpeter NIST/USNO/PTB Modem Time Services

    NIST/USNO/PTB Modem Time Services


    Synopsis

    Address: 127.127.18.u
    Reference ID: NIST | USNO | PTB | WWVB
    Driver ID: ACTS_MODEM
    Serial Port: /dev/actsu; 9600 baud, 8-bits, no parity
    Features: tty_clk
    Requires: /usr/include/sys/termios.h header file with modem control and a dial-out (cua) device.

    Description

    This driver supports the US (NIST and USNO) and European (PTB (Germany), NPL (UK), etc.) modem time services, as well as Spectracom GPS and WWVB receivers connected via a modem. The driver periodically dials a number from a telephone list, receives the timecode data and calculates the local clock correction. It is designed primarily for backup when neither a radio clock nor connectivity to Internet time servers are available. It can also be configured to operate full period.

    For best results the indicated time must be corrected for the modem and telephone circuit propagation delays, which can reach 200 ms or more. For the NIST service, corrections are determined automatically by measuring the roundtrip delay of echoed characters. With this service the absolute accuracy is typically a millisecond or two. Corrections for the other services must be determined by other means. With these services variations from call to call and between messages during a call are typically a few milliseconds, occasionally higher.

    This driver requires a 9600-bps modem with a Hayes-compatible command set and control over the modem data terminal ready (DTR) control line. The actual line speed ranges from 1200 bps with USNO to 14,400 bps with NIST. The modem setup string is hard-coded in the driver and may require changes for nonstandard modems or special circumstances.

    There are three modes of operation selected by the mode keyword in the server configuration command. In manual mode (2) the calling program is initiated by setting fudge flag1. This can be done manually using ntpdc, or by a cron job. In auto mode (0) flag1 is set at each poll event. In backup mode (1) flag1 is set at each poll event, but only if no other synchronization sources are available.

    When flag1 is set, the calling program dials the first number in the list specified by the phone command. If the call fails for any reason, the program dials the second number and so on. The phone number is specified by the Hayes ATDT prefix followed by the number itself, including the prefix and long-distance digits and delay code, if necessary. The flag1 is reset and the calling program terminated if (a) valid clock update has been determined, (b) no more numbers remain in the list, (c) a device fault or timeout occurs or (d) fudge flag1 is reset manually using ntpdc.

    The driver automatically recognizes the message format of each modem time service. It selects the parsing algorithm depending on the message length. There is some hazard should the message be corrupted. However, the data format is checked carefully and only if all checks succeed is the message accepted. Corrupted lines are discarded without complaint. Once the service is known, the reference identifier for the driver is set to NIST, USNO, PTB or WWVB as appropriate.

    Ordinarily, the serial port is connected to a modem; however, if fudge flag3 is set, it can be connected directly to a Spectracom WWV or GPS radio for testing or calibration. The Spectracom radio can be connected via a modem if the radio is connfigured to send time codes continuoulsly at 1-s intervals. In principle, fudge flag2 enables port locking, allowing the modem to be shared when not in use by this driver. At least on Solaris with the current NTP I/O routines, this results in lots of ugly error messages.

    The minpoll and maxpoll keywords of the server configuration command can be used to limit the intervals between calls. The recommended settings are 12 (1.1 hours) for minpoll and 17 (36 hours) for maxpoll. Ordinarily, the poll interval will start at minpoll and ramp up to maxpoll in a day or two.

    US Phone Numbers and Formats

    Note: Phone numbers include the entire Hayes modem command, including the ATDT and other control codes as may be necessary. For most cases only the ATDT may be necessary.

    National Institute of Science and Technology (NIST)

    Phone: (303) 494-4774 (Boulder, CO); (808) 335-4721 (Hawaii)

    Data Format

    National Institute of Standards and Technology
    Telephone Time Service, Generator 3B
    Enter question mark "?" for HELP
    MJD YR MO DA H M S ST S UT1 msADV <OTM>
    47999 90-04-18 21:39:15 50 0 +.1 045.0 UTC(NIST) *
    47999 90-04-18 21:39:16 50 0 +.1 045.0 UTC(NIST) #
    ...

    MJD, YR, ST, UT1 and UTC(NIST) are not used by this driver. The <OTM> on-time character "*" changes to "#" when the delay correction is valid.

    US Naval Observatory (USNO)

    Phone: (202) 762-1594 (Washington, DC); (719) 567-6742 (Boulder, CO)

    Data Format (two lines, repeating at one-second intervals)

    jjjjj nnn hhmmss UTC

    * on-time character for previous timecode message
    jjjjj modified Julian day number (not used)
    nnn day of year
    hhmmss second of day

    European Phone Numbers and Formats

    Spectracom GPS and WWVB Receivers

    If a modem is connected to a Spectracom receiver, this driver will call it and retrieve the time in one of two formats, 0 and 2. Ordinarily, the receiver requires a T in order to return the timecode. As this driver does not send data via the modem, it must either be configured in continuous mode or be polled by another local driver.

    Monitor Data

    The received timecode is written as-is to the clockstats file along with the Hayes connection and hangup commands and result codes.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Set by the driver to (one of) NIST, USNO, PTB or WWVB.
    flag1 0 | 1
    Initiate a call if 1. Automatically reset by program.
    flag2 0 | 1
    Enables port locking if 1, disables if 0 (default).
    flag3 0 | 1
    Enables direct connection if 1, or modem if 0 (default). If set, the driver will send a single character 'T' at every poll event.
    flag4 0 | 1
    Not used by this driver.

    Additional Information

    Reference Clock Drivers 


    ntp-4.2.6p5/html/drivers/tf582_4.html0000644000175000017500000000666710441361220016224 0ustar peterpeter PTB Modem Time Service

    European Automated Computer Time Services


    Several European countries use the following message data format:

    Data format
    0000000000111111111122222222223333333333444444444455555555556666666666777777777 7
    0123456789012345678901234567890123456789012345678901234567890123456789012345678 9
    1995-01-23 20:58:51 MEZ 10402303260219950123195849740+40000500 *
    A B C D EF G H IJ K L M N O P Q R S T U V W XY Z<CR><LF>
    A year
    B month
    C day
    D hour
    E : normally
    A for DST to ST switch first hour
    B for DST to ST switch second hour if not marked in H
    F minute
    G second
    H timezone
    I day of week
    J week of year
    K day of year
    L month for next ST/DST changes
    M day
    N hour
    O UTC year
    P UTC month
    Q UTC day
    R UTC hour
    S UTC minute
    T modified julian day (MJD)
    U DUT1
    V direction and month if leap second
    W signal delay (assumed/measured)
    X sequence number for additional text line in Y
    Y additional text
    Z on time marker (* - assumed delay / # measured delay)
    <CR>!<LF> ! is second change !

    This format is an ITU-R Recommendation (ITU-R TF583.4) and is now available from the primary timing centres of the following countries: Austria, Belgium, Germany, Italy, The Netherlands, Poland, Portugal, Romania, Spain, Sweden, Switzerland, Turkey and United Kingdom. Some examples are:

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/driver33.html0000644000175000017500000000247210441361215016564 0ustar peterpeter Dumb Clock

    Dumb Clock


    Synopsis

    Address: 127.127.33.u
    Reference ID: DUMBCLOCK
    Driver ID: DUMBCLOCK
    Serial Port: /dev/dumbclocku; 9600 bps, 8-bits, no parity
    Features: (none)

    Description

    This driver supports a dumb ASCII clock that only emits localtime at a reliable interval. This has no provisions for leap seconds, quality codes, etc. It assumes output in the local time zone, and that the C library mktime()/localtime() routines will correctly convert back and forth between local and UTC.

    Most of this code is originally from refclock_wwvb.c with thanks. It has been so mangled that wwvb is not a recognizable ancestor.

    Timecode format: hh:mm:ssCL
    hh:mm:ss - local time
    C - \r (carriage return)
    L - \n (newline)
    

    Last modified: Sun Feb 14 12:07:01 EST 1999
    ntp-4.2.6p5/html/drivers/driver19.html0000644000175000017500000000725411307651603016600 0ustar peterpeter Heath WWV/WWVH Receiver

    Heath WWV/WWVH Receiver


    Synopsis

    Address: 127.127.19.u
    Reference ID: WWV
    Driver ID: WWV_HEATH
    Serial Port: /dev/heathu; 1200 baud, 8-bits, no parity
    Features: tty_clk
    Requires: /usr/include/sys/termios.h header file with modem control

    Description

    This driver supports the Heath GC-1000 Most Accurate Clock, with RS232C Output Accessory. This is a WWV/WWVH receiver somewhat less robust than other supported receivers. It's claimed accuracy is 100 ms when actually synchronized to the broadcast signal, but this doesn't happen even most of the time, due to propagation conditions, ambient noise sources, etc. When not synchronized, the accuracy is at the whim of the internal clock oscillator, which can wander into the sunset without warning. Since the indicated precision is 100 ms, expect a host synchronized only to this thing to wander to and fro, occasionally being rudely stepped when the offset exceeds the default CLOCK_MAX of 128 ms.

    The internal DIPswitches should be set to operate at 1200 baud in MANUAL mode and the current year. The external DIPswitches should be set to GMT and 24-hour format. It is very important that the year be set correctly in the DIPswitches; otherwise, the day of year will be incorrect after 28 April of a normal or leap year.

    In MANUAL mode the clock responds to a rising edge of the request to send (RTS) modem control line by sending the timecode. Therefore, it is necessary that the operating system implement the TIOCMBIC and TIOCMBIS ioctl system calls and TIOCM_RTS control bit. Present restrictions require the use of a POSIX-compatible programming interface, although other interfaces may work as well.

    The clock message consists of 23 ASCII printing characters in the following format:

    hh:mm:ss.f     dd/mm/yr<cr>
    
    hh:mm:ss.f = hours, minutes, seconds
    f = deciseconds ('?' when out of spec)
    dd/mm/yr = day, month, year

    The alarm condition is indicated by '?', rather than a digit, at A. Note that 0?:??:??.? is displayed before synchronization is first established and hh:mm:ss.? once synchronization is established and then lost again for about a day.

    A fudge time1 value of .07 s appears to center the clock offset residuals.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default WWV.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Not used by this driver.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Not used by this driver
    Additional Information

    Reference Clock Drivers 


    ntp-4.2.6p5/html/drivers/driver28.html0000644000175000017500000001511711307651605016577 0ustar peterpeter Shared memoy Driver

    Shared Memory Driver


    Synopsis

    Address: 127.127.28.u
    Reference ID: SHM
    Driver ID: SHM

    Description

    This driver receives its reference clock info from a shared memory-segment. The shared memory-segment is created with owner-only access for unit 0 and 1, and world access for unit 2 and 3

    Structure of shared memory-segment

    struct shmTime {
      int    mode; /* 0 - if valid set
                    *       use values, 
                    *       clear valid
                    * 1 - if valid set 
                    *       if count before and after read of 
                    *       values is equal,
                    *         use values 
                    *       clear valid
                    */
      int    count;
      time_t clockTimeStampSec;      /* external clock */
      int    clockTimeStampUSec;     /* external clock */
      time_t receiveTimeStampSec;    /* internal clock, when external value was received */
      int    receiveTimeStampUSec;   /* internal clock, when external value was received */
      int    leap;
      int    precision;
      int    nsamples;
      int    valid;
      int    dummy[10]; 
    };

    Operation mode=0

    Each second, the valid-flag of the shared memory-segment is checked:

    If set, the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are passed to ntp, and the valid-flag is cleared and a counter is bumped.

    If not set, a counter is bumped

    Operation mode=1

    Each second, the valid-flag of the shared memory-segment is checked:

    If set, the count-field of the record is remembered, and the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are read. Then, the remembered count is compared to the count now in the record. If both are equal, the values read from the record are passed to ntp. If they differ, another process has modified the record while it was read out (was not able to produce this case), and failure is reported to ntp. The valid flag is cleared and a counter is bumped.

    If not set, a counter is bumped

    gpsd

    gpsd knows how to talk to many GPS devices. It works with ntpd through the SHM driver.

    The gpsd man page suggests setting minpoll and maxpoll to 4. That was an attempt to reduce jitter. The SHM driver was fixed (ntp-4.2.5p138) to collect data each second rather than once per polling interval so that suggestion is no longer reasonable.

    Clockstats

    If flag4 is set when the driver is polled, a clockstats record is written. The first 3 fields are the normal date, time, and IP address common to all clockstats records.

    The 4th field is the number of second ticks since the last poll. The 5th field is the number of good data samples found. The last 64 will be used by ntpd. The 6th field is the number of sample that didn't have valid data ready. The 7th field is the number of bad samples. The 8th field is the number of times the the mode 1 info was update while nptd was trying to grab a sample.

    Here is a sample showing the GPS reception fading out:

    54364 84927.157 127.127.28.0  66  65   1   0   0
    54364 84990.161 127.127.28.0  63  63   0   0   0
    54364 85053.160 127.127.28.0  63  63   0   0   0
    54364 85116.159 127.127.28.0  63  62   1   0   0
    54364 85180.158 127.127.28.0  64  63   1   0   0
    54364 85246.161 127.127.28.0  66  66   0   0   0
    54364 85312.157 127.127.28.0  66  50  16   0   0
    54364 85375.160 127.127.28.0  63  41  22   0   0
    54364 85439.155 127.127.28.0  64  64   0   0   0
    54364 85505.158 127.127.28.0  66  36  30   0   0
    54364 85569.157 127.127.28.0  64   0  64   0   0
    54364 85635.157 127.127.28.0  66   0  66   0   0
    54364 85700.160 127.127.28.0  65   0  65   0   0
    

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default SHM.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Not used by this driver.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    If flag4 is set, clockstats records will be written when the driver is polled.

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/scripts/0000755000175000017500000000000011675461367015742 5ustar peterpeterntp-4.2.6p5/html/drivers/scripts/footer.txt0000644000175000017500000000045610054623677020000 0ustar peterpeterdocument.write("\ \ \ \
    gif\ Home Pagegif\ Contacts
    ")ntp-4.2.6p5/html/drivers/scripts/style.css0000644000175000017500000000274610054623677017617 0ustar peterpeterbody {background: #FDF1E1; color: #006600; font-family: "verdana", sans-serif; text-align: justify; margin-left: 5px;} p, h4, hr, li {margin-top: .6em; margin-bottom: .6em} li.inline {text-align: left; margin-top: 0; margin-bottom: 0} ul, dl, ol, {margin-top: .6em; margin-bottom: .6em; margin-left 5em} dt {margin-top: .6em} dd {margin-bottom: .6em} div.header {text-align: center; font-style: italic;} div.footer {text-align: center; font-size: 60%;} img.cell {align: left;} td.sidebar {width: 40px; align: center; valign: top;} img.sidebar {align: center; margin-top: 5px;} h4.sidebar {align: center;} p.top {background: #FDF1E1; color: #006600; position: absolute; margin-left: -90px; text-align: center;} a:link.sidebar {background: transparent; color: #990033; font-weight: bold;} a:visited.sidebar {background: transparent; color: #990033; font-weight: bold;} a:hover.sidebar {background: #FDF1E1; color: #006600;} img {margin: 5px;} div {text-align: center;} h1 {text-align: center; font-size: 250%;} caption {background: #EEEEEE; color: #339999;} tx {text-align: center;} th {background: #FFFFCC; color: #006600; text-align: center; text-decoration: underline; padding-top: 5px;} th.caption {background: #EEEEEE; color: #006600; text-align: center;}ntp-4.2.6p5/html/drivers/driver30.html0000644000175000017500000001421610441361215016560 0ustar peterpeter Motorola Oncore GPS Receiver

    Motorola Oncore GPS receiver


    Synopsis

    Address: 127.127.30.u
    Reference ID: GPS
    Driver ID: ONCORE
    Serial Port: /dev/oncore.serial.u;  9600 baud, 8-bits, no parity.
    PPS Port: /dev/oncore.pps.uPPS_CAPTUREASSERT required,  PPS_OFFSETASSERT supported.
    Configuration File: ntp.oncore, or ntp.oncore.u, or ntp.oncoreu, in /etc/ntp or /etc.

    Description

    This driver supports most models of the Motorola Oncore GPS receivers (Basic, PVT6, VP, UT, UT+, GT, GT+, SL, M12, M12+T), as long as they support the Motorola Binary Protocol.

    The interesting versions of the Oncore are the VP, the UT+, the "Remote" which is a prepackaged UT+, and the M12 Timing. The VP is no longer available new, and the UT, GT, and SL are at end-of-life. The Motorola evaluation kit can be recommended. It interfaces to a PC straightaway, using the serial (DCD) or parallel port for PPS input and packs the receiver in a nice and sturdy box. Less expensive interface kits are available from TAPR and Synergy.
     

    gif gif gif
    UT+ oncore
    Evaluation kit
    Oncore Remote

    The driver requires a standard PPS interface for the pulse-per-second output from the receiver. The serial data stream alone does not provide precision time stamps (0-50msec variance, according to the manual), whereas the PPS output is precise down to 50 nsec (1 sigma) for the VP/UT models and 25 nsec for the M12 Timing. If you do not have the PPS signal available, then you should probably be using the NMEA driver rather than the Oncore driver. Most of these are available on-line

    The driver will use the "position hold" mode with user provided coordinates, the receivers built-in site-survey, or a similar algorithm implemented in this driver to determine the antenna position.

    Monitor Data

    The driver always puts a lot of useful information on the clockstats file, and when run with debugging can be quite chatty on stdout. When first starting to use the driver you should definitely review the information written to the clockstats file to verify that the driver is running correctly.

    In addition, on platforms supporting Shared Memory, all of the messages received from the Oncore receiver are made available in shared memory for use by other programs. See the Oncore-SHMEM manual page for information on how to use this option. For either debugging or using the SHMEM option, an Oncore Reference Manual for the specific receiver in use will be required.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default GPS.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Not used by this driver.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Not used by this driver.

    Additional Information

    The driver was initially developed on FreeBSD, and has since been tested on Linux, SunOS and Solaris.

    Configuration

    There is a driver specific configuration file ntp.oncore (or ntp.oncore.u or ntp.oncoreu if you must distinguish between more than one Oncore receiver) that contains information on the startup mode, the location of the GPS receiver, an offset of the PPS signal from zero, and the cable delay. The offset shifts the PPS signal to avoid interrupt pileups `on' the second, and adjusts the timestamp accordingly. See the driver source for information on this file. The default with no file is: no delay, no offset, and a site survey is done to get the location of the gps receiver.

    The following three options can be set in the driver specific configuration file only if the driver is using the PPSAPI. The edge of the PPS signal that is `on-time' can be set with the keywords [ASSERT/CLEAR] and the word HARDPPS will cause the PPS signal to control the kernel PLL.

    Performance

    Really good. With the VP/UT+, the generated PPS pulse is referenced to UTC(GPS) with better than 50 nsec (1 sigma) accuracy. The limiting factor will be the timebase of the computer and the precision with which you can timestamp the rising flank of the PPS signal. Using FreeBSD, a FPGA based Timecounter/PPS interface, and an ovenized quartz oscillator, that performance has been reproduced. For more details on this aspect: Sub-Microsecond timekeeping under FreeBSD.


    ntp-4.2.6p5/html/drivers/driver44.html0000644000175000017500000001016510544731164016574 0ustar peterpeter NeoClock4X

    NeoClock4X - DCF77 / TDF serial line receiver


    Synopsis

    Adress
    127.127.44.u
    Reference ID
    neol
    Driver ID
    NEOCLK4X
    Serial Port
    /dev/neoclock4x-u

    NeoClock4X - DCF77 receiver

    Description

    The refclock_neoclock4x driver supports the NeoClock4X receiver available from Linum Software GmbH. The receiver is available as a DCF77 or TDF receiver. Both receivers have the same output string. For more information about the NeoClock4X receiver please visit http://www.linux-funkuhr.de.  

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor with the default value off 0.16958333 seconds. This offset is used  to correct serial line and operating system delays incurred in capturing time stamps. If you want to fudge the time1 offset ALWAYS add a value off 0.16958333. This is neccessary to compensate to delay that is caused by transmit the timestamp at 2400 Baud. If you want to compensate the delay that the DCF77 or TDF radio signal takes to travel to your site simply add the needed millisecond delay to the given value. Note that the time here is given in seconds.
    Default setting is 0.16958333 seconds.
    time2 time
    Not used by this driver.
    flag1 0 | 1
    When set to 1 the driver will feed ntp with timestampe even if the radio signal is lost. In this case an internal backup clock generates the timestamps. This is ok as long as the receiver is synced once since the receiver is able to keep time for a long period.
    Default setting is 0 = don't synchronize to CMOS clock.
    flag2 0 | 1
    You can allow the NeoClock4X driver to use the quartz clock even if it is never synchronized to a radio clock. This is usally not a good idea if you want preceise timestamps since the CMOS clock is maybe not adjusted to a dst status change. So PLEASE switch this only on if you now what you're doing.
    Default setting is 0 = don't synchronize to unsynchronized CMOS clock.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    It is recommended to allow extensive logging while you setup the NeoClock4X receiver. If you activate flag4 every received data is logged. You should turn off flag4 as soon as the clock works as expected to reduce logfile cluttering.
    Default setting is 0 = don't log received data and converted utc time.

    Please send any comments or question to neoclock4x@linum.com.
    ntp-4.2.6p5/html/drivers/driver43.html0000644000175000017500000001022010441361216016554 0ustar peterpeter RIPE NCC interface for Trimble Palisade

    RIPE NCC interface for Trimble Palisade


    Trimble Acutime 2000

    Synopsis

    Address: 127.127.43.u
    Reference ID: RIPENCC
    Driver ID: RIPENCC

    Description

    This is a special driver developed to be used in conjuction with the RIPE NCC clock card in the RIPE NCC Test Traffic Measurements project.

    Why this driver?

    The reason why we created a seperated driver for an antenna for which already a (vendor supplied) driver exist is a design decision. To be more specific, the standard Trimble interface uses a 12 pin connector. The cable sold by Trimble to connect to this wire is a very thick cable. Certainly not something you wish to run for several 100 meters through your building. And if you wanted to run it for 100 meters, you always would have to really run the cable, and didn't have the option to use existing wiring.

    This is where we wanted more flexibility. We wanted to be able to use existing wiring in buildings. That leaded us to CAT-5(UTP) which only gives us 8 wires. Therefor we decided to redesing the use of the Trimble antenna. The Trimble supports two modes: EVENT driver and PPS mode. The default is to use the EVENT mode which needs all 12 wires. We only use the PPS timestamps for which we have enough with 8 wires. For our purposes this is more than fine.

    More information about the project can be found on the Test Traffic Measurements website. RIPE NCC clock card

    RIPE NCC clock card

    The card is very a simple PCI card. The only feature on the bus it uses is the power supply. It uses this power supply to power the Trimble GPS antenna.

    The card basicly just is a RS422 to RS232 converter. It gets the Trimble's RS422 signal on a RJ45 connector and transforms that to RS232 on a DIN9 connector. This connector should be loopbacked on the back of the machine to the serial port. As said, the card doesn't do any PCI data transfers.

    The schematics of the interface card is available here: gps_interface_schematic.pdf. You are free to create this card yourself as long as you give some credit or reference to us. Note that we don't sell these cards on a commercial basis, but for interested parties we do have some spares to share.

    Monitor Data

    In the filegen clockstats file the following (example) data is collected:

    52445 41931.275 127.127.40.0 U1 20.6.2002 11:38:51 13 11
    52445 41931.395 127.127.40.0 C1 20062002 113851 6  364785 110.2 450 6.7 13 5222.374737 N 0453.268013 E 48  7 11 0 1 -14 20 0 -25
    52445 41931.465 127.127.40.0 S1 07 1 1 02 59.3 291.5 39.3
    52445 41931.485 127.127.40.0 S1 11 2 1 02 59.9 138.0 60.2
    52445 41931.525 127.127.40.0 S1 01 4 1 02 48.4 185.7 28.3
    52445 41931.555 127.127.40.0 S1 14 5 2 02 32.7  41.0 15.4
    52445 41931.585 127.127.40.0 S1 20 6 1 02 59.9 256.6 78.0
    52445 41931.615 127.127.40.0 S1 25 8 2 00  0.0  86.6 20.1
    

    This is in the form of:

    All output lines consist of a prefix and a message, the prefix is:
    [days since epoch] [sec.ms since start of day] [peer address] 
    
    And all individual messages:
    
    *Primary UTC time packet:
    U1 [date] [time] [trackstat] [utcflags]
    
    *Comprehensive time packet:
    C1 [date] [time] [mode] [bias] [biasunc] [rate] [rateunc] [utcoff] [latitude] [longtitude] [alt] [vis sat](x8)
    
    *Tracking status packet:
    S1 [prn] [channel] [aqflag] [ephstat] [snr] [azinuth] [elevation]
    

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/driver3.html0000644000175000017500000000774310441361214016506 0ustar peterpeter PSTI/Traconex 1020 WWV/WWVH Receiver

    PSTI/Traconex 1020 WWV/WWVH Receiver


    Synopsis

    Address: 127.127.3.u
    Reference ID: WWV
    Driver ID: WWV_PST
    Serial Port: /dev/wwvu; 9600 baud, 8-bits, no parity
    Features: tty_clk

    Description

    This driver supports the PSTI 1010 and Traconex 1020 WWV/WWVH Receivers. No specific claim of accuracy is made for these receiver, but actual experience suggests that 10 ms would be a conservative assumption.

    The dipswitches should be set for 9600 bps line speed, 24-hour day-of-year format and UTC time zone. Automatic correction for DST should be disabled. It is very important that the year be set correctly in the DIP-switches; otherwise, the day of year will be incorrect after 28 April of a normal or leap year. As the there are only four dipswitches to set the year and the base value of zero correspondes to 1986, years beyond 2001 recycle with the value of zero corresponding to 2002. The propagation delay DIP-switches should be set according to the distance from the transmitter for both WWV and WWVH, as described in the instructions. While the delay can be set only to within 11 ms, the fudge time1 parameter can be used for vernier corrections.

    Using the poll sequence QTQDQM, the response timecode is in three sections totalling 50 ASCII printing characters, as concatenated by the driver, in the following format:

    ahh:mm:ss.fffs<cr> yy/dd/mm/ddd<cr>
    frdzycchhSSFTttttuuxx<cr>
    
    on-time = first <cr>
    hh:mm:ss.fff = hours, minutes, seconds, milliseconds
    a = AM/PM indicator (' ' for 24-hour mode)
    yy = year (from DIPswitches)
    dd/mm/ddd = day of month, month, day of year
    s = daylight-saving indicator (' ' for 24-hour mode)
    f = frequency enable (O = all frequencies enabled)
    r = baud rate (3 = 1200, 6 = 9600)
    d = features indicator (@ = month/day display enabled)
    z = time zone (0 = UTC)
    y = year (5 = 91)
    cc = WWV propagation delay (52 = 22 ms)
    hh = WWVH propagation delay (81 = 33 ms)
    SS = status (80 or 82 = operating correctly)
    F = current receive frequency (4 = 15 MHz)
    T = transmitter (C = WWV, H = WWVH)
    tttt = time since last update (0000 = minutes)
    uu = flush character (03 = ^c)
    xx = 94 (unknown)

    The alarm condition is indicated by other than 8 at a, which occurs during initial synchronization and when received signal is lost for an extended period; unlock condition is indicated by other than 0000 in the tttt subfield.

    Monitor Data

    When enabled by the flag4 fudge flag, every received timecode is written as-is to the clockstats file.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default WWV.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Not used by this driver.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Not used by this driver.

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/driver31.html0000644000175000017500000001004210441361215016552 0ustar peterpeter Rockwell Jupiter GPS Receiver

    Rockwell Jupiter GPS receiver


    Synopsis

    Address: 127.127.31.u
    Reference ID: GPS
    Driver ID: JUPITER
    Serial Port: /dev/gpsu;  9600 baud, 8-bits, no parity.

    Description

    This driver supports at least some models of the Rockwell Jupiter GPS receivers (Jupiter 11, Jupiter-T), they must at least support the Zodiac Binary Protocol.

    The driver requires a standard PPS interface for the pulse-per-second output from the receiver. The serial data stream alone does not provide precision time stamps, whereas the PPS output is precise down to 40 ns (1 sigma) for the Jupiter 11 and 25 ns (1 sigma) for Jupiter-T according to the documentation. If you do not have the PPS signal available, then you should probably not be using the Jupiter receiver as a time source. This driver requires a PPS signal and the time output from Jupiter receivers is not predictable in NMEA mode; the reported time can take one second steps.

    Monitor Data

    The driver always puts a lot of useful information on the clockstats file, and when run with debugging can be quite chatty on stdout. When first starting to use the driver you should definitely review the information written to the clockstats file to verify that the driver is running correctly.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver. Should be left at zero.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default GPS.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Specifies the mobility of the GPS receiver: 0 for walking (default), 1 for driving.
    flag3 0 | 1
    Specifies the PPS signal on-time edge: 0 for assert (default), 1 for clear.
    flag4 0 | 1
    Not used by this driver.

    Additional Information

    The driver was resurrected from a sorry state using the Windows NT port and a Jupiter 11, and has since seen little testing on other platforms. On Windows there exist a barrier though, as there is no publicly available PPSAPI implementation, at least not to my knowledge. However, there has been one success report using Linux 2.4.20 and PPSkit 2.1.1.

    The Jupiter receivers seem to have quite a few names. They are referred to at least as Rockwell receivers, Navman receivers, Zodiac receivers, Conexant receivers and SiRF Technology receivers. Rockwell seems to be the original and most commonly used name and Navman seems to be the current supplier.

    Configuration

    The edge of the PPS signal that is `on-time' can be set with flag2. There is currently no way to cause the PPS signal to control the kernel PLL.

    Performance

    The performance is largely unexplored. I have achieved submillisecond stability using a Jupiter 11, but the poor result is more than likely due to the proprietary PPSAPI implementation or Windows itself.

    This driver does not handle leap seconds.


    =ntp-4.2.6p5/html/drivers/driver4.html0000644000175000017500000001364711307651604016516 0ustar peterpeter Spectracom WWVB/GPS Receivers

    Spectracom WWVB/GPS Receivers


    Last update: 22-Apr-2009 15:00 UTC

    Synopsis

    Address: 127.127.4.u
    Reference ID: WWVB
    Driver ID: WWVB_SPEC
    Serial Port: /dev/wwvbu; 9600 baud, 8-bits, no parity
    Features: Optional PPS signal processing, tty_clk
    Requires: Optional PPS signal processing requires the PPSAPI signal interface.

    Description

    This driver supports all known Spectracom radio and satellite clocks, including the Model 8170 and Netclock/2 WWVB Synchronized Clocks and the Netclock/GPS GPS Master Clock. The claimed accuracy of the WWVB clocks is 100 ms relative to the broadcast signal. These clocks have proven a reliable source of time, except in some parts of the country with high levels of conducted RF interference. WIth the GPS clock the claimed accuracy is 130 ns. However, in most cases the actual accuracy is limited by the precision of the timecode and the latencies of the serial interface and operating system.

    The DIPswitches on these clocks should be set to 24-hour display, AUTO DST off, data format 0 or 2 (see below) and baud rate 9600. If this clock is used as the source for the IRIG Audio Decoder (refclock_irig.c in this distribution), set the DIPswitches for AM IRIG output and IRIG format 1 (IRIG B with signature control).

    There are two timecode formats used by these clocks. Format 0, which is available with all clocks, and format 2, which is available with all clocks except the original (unmodified) Model 8170.

    Format 0 (22 ASCII printing characters):
    <cr><lf>i ddd hh:mm:ss TZ=zz<cr><lf>

    on-time = first <cr>
    i = synchronization flag (' ' = in synch, '?' = out synch)
    hh:mm:ss = hours, minutes, seconds

    The alarm condition is indicated by other than ' ' at i, which occurs during initial synchronization and when received signal is lost for about ten hours.

    Format 2 (24 ASCII printing characters):
    lt;cr>lf>iqyy ddd hh:mm:ss.fff ld

    on-time = <cr>
    i = synchronization flag (' ' = in synch, '?' = out synch)
    q = quality indicator (' ' = locked, 'A'...'D' = unlocked)
    yy = year (as broadcast)
    ddd = day of year
    hh:mm:ss.fff = hours, minutes, seconds, milliseconds

    The alarm condition is indicated by other than ' ' at i, which occurs during initial synchronization and when received signal is lost for about ten hours. The unlock condition is indicated by other than ' ' at q.

    The q is normally ' ' when the time error is less than 1 ms and a character in the set A...D when the time error is less than 10, 100, 500 and greater than 500 ms respectively. The l is normally ' ', but is set to L early in the month of an upcoming UTC leap second and reset to ' ' on the first day of the following month. The d is set to S for standard time S, I on the day preceding a switch to daylight time, D for daylight time and O on the day preceding a switch to standard time. The start bit of the first <cr> is synchronized to the indicated time as returned.

    This driver does not need to be told which format is in use - it figures out which one from the length of the message. A three-stage median filter is used to reduce jitter and provide a dispersion measure. The driver makes no attempt to correct for the intrinsic jitter of the radio itself, which is a known problem with the older radios.

    When PPS signal processing is enabled, and when the system clock has been set by this or another driver and the PPS signal offset is within 0.4 s of the system clock offset, the PPS signal replaces the timecode for as long as the PPS signal is active. If for some reason the PPS signal fails for one or more poll intervals, the driver reverts to the timecode. If the timecode fails for one or more poll intervals, the PPS signal is disconnected.

    Monitor Data

    The driver writes each timecode as received to the clockstats file. When enabled by the flag4 fudge flag, a table of quality data maintained internally by the Netclock/2 is retrieved and written to the clockstats file when the first timecode message of a new day is received.

    Fudge Factors

    time1 time
    Specifies the PPS time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Specifies the serial time offset calibration factor, in seconds and fraction, with default 0.0.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default WWVB.
    flag1 0 | 1
    Disable PPS signal processing if 0 (default); enable PPS signal processing if 1.
    flag2 0 | 1
    If PPS signal processing is enabled, capture the pulse on the rising edge if 0 (default); capture on the falling edge if 1.
    flag3 0 | 1
    If PPS signal processing is enabled, use the ntpd clock discipline if 0 (default); use the kernel discipline if 1.
    flag4 0 | 1
    Enable verbose clockstats recording if set.

    ntp-4.2.6p5/html/drivers/driver22.html0000644000175000017500000001615111307651603016566 0ustar peterpeter PPS Clock Discipline

    PPS Clock Discipline


    Last change: 22-Apr-2009 15:02 UTC

    Synopsis

    Address: 127.127.22.u
    Reference ID: PPS
    Driver ID: PPS
    Serial or Parallel Port: /dev/ppsu
    Requires: PPSAPI signal interface for PPS signal processing.

    Note: This driver supersedes an older one of the same name. The older driver operated with several somewhat archaic signal interface devices, required intricate configuration and was poorly documented. This driver requires the Pulse per Second API (PPSAPI)1. Note also that the pps configuration command has been obsoleted by this driver.

    Description

    This driver furnishes an interface for the pulse-per-second (PPS) signal produced by a cesium clock, radio clock or related devices. It can be used to augment the serial timecode generated by a GPS receiver, for example. It can be used to remove accumulated jitter and re-time a secondary server when synchronized to a primary server over a congested, wide-area network and before redistributing the time to local clients. The driver includes extensive signal sanity checks and grooming algorithms. A range gate and frequency discriminator reject noise and signals with incorrect frequency. A multiple-stage median filter rejects jitter due to hardware interrupt and operating system latencies. A trimmed-mean algorithm determines the best time samples. With typical workstations and processing loads, the incidental jitter can be reduced to a few microseconds.

    While this driver can discipline the time and frequency relative to the PPS source, it cannot number the seconds. For this purpose an auxiliary source is required, ordinarily a radio clock operated as a primary reference (stratum 1) source; however, another NTP time server can be used as well. For this purpose, the auxiliary source should be specified as the prefer peer, as described in the Mitigation Rules and the prefer Keyword page.

    The driver requires the PPSAPI interface1, which is a proposed IETF standard. The interface consists of the timepps.h header file and associated kernel support. Support for this interface is included in current versions of Solaris, FreeBSD and Linux and proprietary versions of Tru64 (Alpha) and SunOS. See the Pulse-per-second (PPS) Signal Interfacing page for further information.

    The PPS source can be connected via a serial or parallel port, depending on the hardware and operating system. A serial port can be dedicated to the PPS source or shared with another device; however, if dedicated the data leads should not be connected, as noise or unexpected signals can cause ntpd to exit.

    A radio clock is usually connected via a serial port and the PPS source connected via a level converter to the data carrier detect (DCD) pin (DB-9 pin 1, DB-25 pin 8) of the same connector. In some systems where a parallel port and driver are available, the PPS signal can be connected directly to the ACK pin (DB25 pin 10) of the connector. Whether the PPS signal is connected via a dedicated port or shared with another device, the driver opens the device /dev/pps%d, where %d is the unit number. As with other drivers, links can be used to redirect the logical name to the actual physical device.

    The driver normally operates like any other driver and uses the same mitigation algorithms and PLL/FLL clock discipline incorporated in the daemon. If kernel PLL/FLL support is available, the kernel PLL/FLL clock discipline can be used instead. The default behavior is not to use the kernel PPS clock discipline, even if present. This driver incorporates a good deal of signal processing to reduce jitter using the median filter algorithm in the driver. As the result, performance with minpoll configured at 4 (16s) is generally better than the kernel PPS discipline. However, fudge flag 3 can be used to enable the kernel PPS discipline if necessary.

    This driver is enabled only under one of two conditions (a) a prefer peer other than this driver is among the survivors of the mitigation algorithms or (b) there are no survivors and the minsane option of the tos command is 0. The prefer peer designates another source that can reliably number the seconds when available . However, if no sources are available, the system clock continues to be disciplined by the PPS driver on an indefinite basis.

    A scenario where the latter behavior can be most useful is a planetary orbiter fleet, for instance in the vicinity of Mars, where contact between orbiters and Earth only one or two times per Sol (Mars day). These orbiters have a precise timing reference based on an Ultra Stable Oscillator (USO) with accuracy in the order of a Cesium oscillator. A PPS signal is derived from the USO and can be disciplined from Earth on rare occasion or from another orbiter via NTP. In the above scenario the PPS signal disciplines the spacecraft clock between NTP updates.

    In a similar scenario a PPS signal can be used to discipline the clock between updates produced by the modem driver. This would provide precise synchronization without needing the Internet at all.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default PPS.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Specifies PPS capture on the rising (assert) pulse edge if 0; falling (clear) edge if 1. (default), 1 for clear.
    flag3 0 | 1
    Controls the kernel PPS discipline: 0 for disable (default), 1 for enable.
    flag4 0 | 1
    Record a timestamp once for each second if 1. Useful for constructing Allan deviation plots..

    Additional Information

    Reference Clock Drivers

    Reference

    1. Mogul, J., D. Mills, J. Brittenson, J. Stone and U. Windl. Pulse-per-second API for Unix-like operating systems, version 1. Request for Comments RFC-2783, Internet Engineering Task Force, March 2000, 31 pp.

    ntp-4.2.6p5/html/drivers/driver42.html0000644000175000017500000000221610441361216016561 0ustar peterpeter Zyfer GPStarplus Receiver

    Zyfer GPStarplus Receiver


    Synopsis

    Address: 127.127.42.u
    Reference ID: GPS
    Driver ID: Zyfer GPStarplus
    Serial Port: /dev/zyferu; 9600 baud, 8-bits, no parity
    Features: (none)

    Description

    This driver supports the Zyfer GPStarplus receiver.

    The receiver has a DB15 port on the back which has input TxD and RxD lines for configuration and control, and a separate TxD line for the once-per-second timestamp.

    Additionally, there are BNC connectors on the back for things like PPS and IRIG output.

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/driver7.html0000644000175000017500000004675611307651603016527 0ustar peterpeter Radio CHU Audio Demodulator/Decoder

    Radio CHU Audio Demodulator/Decoder


    Synopsis

    Address: 127.127.7.u
    Reference ID: CHU
    Driver ID: CHU
    Modem Port: /dev/chuu; 300 baud, 8-bits, no parity
    Autotune Port: /dev/icom; 1200/9600 baud, 8-bits, no parity
    Audio Device: /dev/audio and /dev/audioctl

    Description

    This driver synchronizes the computer time using shortwave radio transmissions from Canadian time/frequency station CHU in Ottawa, Ontario. CHU transmissions are made continuously on 3.330, 7.850 and 14.670 MHz in upper sideband, compatible AM mode. An ordinary shortwave receiver can be tuned manually to one of these frequencies or, in the case of ICOM receivers, the receiver can be tuned automatically as propagation conditions change throughout the day and season.

    The driver can be compiled to use either an audio codec or soundcard, or a Bell 103-compatible, 300-b/s modem or modem chip, as described on the Pulse-per-second (PPS) Signal Interfacing page. If compiled for a modem, the driver uses it to receive the radio signal and demodulate the data. If compiled for the audio codec, it requires a sampling rate of 8 kHz and m-law companding to demodulate the data. This is the same standard as used by the telephone industry and is supported by most hardware and operating systems, including Solaris, FreeBSD and Linux, among others. The radio is connected via an optional attenuator and cable to either the microphone or line-in port of a workstation or PC. In this implementation, only one audio driver and codec can be supported on a single machine.

    In general and without calibration, the driver is accurate within 1 ms relative to the broadcast time when tracking a station. However, variations up to 0.3 ms can be expected due to diurnal variations in ionospheric layer height and ray geometry. In Newark DE, 625 km from the transmitter, the predicted one-hop propagation delay varies from 2.8 ms in sunlight to 2.6 ms in moonlight. When not tracking the station the accuracy depends on the computer clock oscillator stability, ordinarily better than 0.5 PPM.

    After calibration relative to the PPS signal from a GPS receiver, the mean offset with a 2.4-GHz P4 running FreeBSD 6.1 is generally within 0.2 ms short-term with 0.4 ms jitter. The long-term mean offset varies up to 0.3 ms due to propagation path geometry variations. The processor load due to the driver is 0.4 percent on the P4.

    The driver performs a number of error checks to protect against overdriven or underdriven input signal levels, incorrect signal format or improper hardware configuration. The specific checks are detailed later in this page. Note that additional checks are done elsewhere in the reference clock interface routines.

    This driver incorporates several features in common with other audio drivers such as described in the Radio WWV/H Audio Demodulator/Decoder and the IRIG Audio Decoder pages. They include automatic gain control (AGC), selectable audio codec port and signal monitoring capabilities. For a discussion of these common features, as well as a guide to hookup, debugging and monitoring, see the Reference Clock Audio Drivers page.

    Technical Overview

    The driver processes 8-kHz m-law companded codec samples using maximum-likelihood techniques which exploit the considerable degree of redundancy available in each broadcast message or burst. As described below, every character is sent twice and, in the case of format A bursts, the burst is sent eight times every minute. The single format B burst is considered correct only if every character matches its repetition in the burst. For the eight format A bursts, a majority decoder requires more than half of the 16 repetitions for each digit decode to the same value. Every character in every burst provides an independent timestamp upon arrival with a potential total of 60 timestamps for each minute.

    The CHU timecode format is described on the CHU website. A timecode is assembled when all bursts have been received in each minute. The timecode is considered valid and the clock set when at least one valid format B burst has been decoded and the majority decoder declares success. Once the driver has synchronized for the first time, it will appear reachable and selectable to discipline the system clock. It is normal on occasion to miss a minute or two due to signal fades or noise. If eight successive minutes are missed, the driver is considered unreachable and the system clock will free-wheel at the latest determined frequency offset. Since the signals are almost always available during some period of the day and the NTP clock discipline algorithms are designed to work well even with long intervals between updates, it is unlikely that the system clock will drift more than a few milliseconds during periods of signal loss.

    Baseband Signal Processing

    The program consists of four major parts: the DSP modem, maximum-likelihood UART, burst assembler and majority decoder. The DSP modem demodulates Bell 103 modem answer-frequency signals; that is, frequency-shift keyed (FSK) tones of 2225 Hz (mark) and 2025 Hz (space). It consists of a 500-Hz bandpass filter centered on 2125 Hz followed by a limiter/discriminator and raised-cosine lowpass filter optimized for the 300-b/s data rate.

    The maximum likelihood UART is implemented using a set of eight 11-stage shift registers, one for each of eight phases of the 300-b/s bit clock. At each phase a new baseband signal from the DSP modem is shifted into the corresponding register and the maximum and minimum over all 11 samples computed. This establishes a span (difference) and slice level (average) over all 11 stages. For each stage, a signal level above the slice is a mark (1) and below that is a space (0). A quality metric is calculated for each register with respect to the slice level and the a-priori signal consisting of a start bit (space), eight arbitrary information bits and two stop bits (mark).

    The shift registers are processed in round-robin order as the phases of each bit arrive. At the end of each bit all eight phases are searched for valid framing bits, sufficient span and best metric. The best candidate found in this way represents the maximum-likelihood character. The process then continues for all ten characters in the burst.

    The burst assembler processes characters either from the maximum-likelihood UART or directly from the serial port as configured. A burst begins when a character is received and is processed after a timeout interval when no characters are received. If the interval between characters is greater than two characters, but less than the timeout interval, the burst is rejected as a runt and a new burst begun. As each character is received, a timestamp is captured and saved for later processing.

    A valid burst consists of ten characters in two replicated five-character blocks, each block representing ten 4-bit BCD digits. The format B blocks sent in second 31 contain the year and other information in ten digits. The eight format A blocks sent in seconds 32-39 contain the timecode in ten digits, the first of which is a framing code (6). The burst assembler must deal with cases where the first character of a format A burst is lost or is noise. This is done using the framing codes to correct the discrepancy, either one character early or one character late.

    The burst distance is incremented by one for each bit in the first block that matches the corresponding bit in the second block and decremented by one otherwise. In a format B burst the second block is bit-inverted relative to the first, so a perfect burst of five 8-bit characters has distance -40. In a format A burst the two blocks are identical, so a perfect burst has distance +40. Format B bursts must be perfect to be acceptable; however, format A bursts, which are further processed by the majority decoder, are acceptable if the distance is at least 28.

    Majority Decoder

    Each minute of transmission includes eight format A bursts containing two timecodes for each second from 32 through 39. The majority decoder uses a decoding matrix of ten rows, one for each digit position in the timecode, and 16 columns, one for each 4-bit code combination that might be decoded at that position. In order to use the character timestamps, it is necessary to reliably determine the second number of each burst. In a valid burst, the last digit of the two timecodes in the burst must match and the value must be in the range 2-9 and greater than in the previous burst.

    As each digit of a valid burst is processed, the value at the row corresponding to the digit position in the timecode and column corresponding to the code found at that position is incremented. At the end of the minute, each row of the decoding matrix encodes the number of occurrences of each code found at the corresponding position.

    The maximum over all occurrences at each digit position is the distance for that position and the corresponding code is the maximum-likelihood digit. If the distance is not more than half the total number of occurrences, the decoder assumes a soft error and discards all information collected during the minute. The decoding distance is defined as the sum of the distances over the first nine digits; the tenth digit varies over the seconds and is uncounted.

    The result of the majority decoder is a nine-digit timecode representing the maximum-likelihood candidate for the transmitted timecode in that minute. Note that the second and fraction within the minute are always zero and that the actual reference point to calculate timestamp offsets is backdated to the first second of the minute. At this point the timecode block is reformatted and the year, days, hours and minutes extracted along with other information from the format B burst, including DST state, DUT1 correction and leap warning. The reformatting operation checks the timecode for invalid code combinations that might have been left by the majority decoder and rejects the entire timecode if found.

    If the timecode is valid, it is passed to the reference clock interface along with the backdated timestamps accumulated over the minute. A perfect set of eight bursts could generate as many as 80 timestamps, but the maximum the interface can handle is 60. These are processed using a median filter and trimmed-mean average, so the resulting system clock correction is usually much better than would otherwise be the case with radio noise, UART jitter and occasional burst errors.

    Autotune

    The driver includes provisions to automatically tune the radio in response to changing radio propagation conditions throughout the day and night. The radio interface is compatible with the ICOM CI-V standard, which is a bidirectional serial bus operating at TTL levels. The bus can be connected to a standard serial port using a level converter such as the CT-17. Further details are on the Reference Clock Audio Drivers page.

    If specified, the driver will attempt to open the device /dev/icom and, if successful will tune the radio to 3.331 MHz. The 1-kHz offset is useful with a narrowband SSB filter where the passband includes the carrier and modem signals. However, the driver is liberal in what it assumes of the configuration. If the /dev/icom link is not present or the open fails or the CI-V bus is inoperative, the driver continues in single-frequency mode.

    As long as no bursts are received, the driver cycles over the three frequencies in turn, one minute for each station. When bursts are received from one or more stations, the driver operates in a five-minute cycle. During the first four minutes it tunes to the station with the highest metric. During the last minute it alternates between the other two stations in turn in order to measure the metric.

    Debugging Aids

    The most convenient way to track the program status is using the ntpq program and the clockvar command. This displays the last determined timecode and related status and error counters, even when the program is not discipline the system clock. If the debugging trace feature (-d on the ntpd command line) is enabled, the program produces detailed status messages as it operates. If the fudge flag 4 is set, these messages are written to the clockstats file. All messages produced by this driver have the prefix chu for convenient filtering with the Unix grep command.

    With debugging enabled the driver produces messages in the following formats: A single message beginning with chuB is produced for each format B burst received in second 31, while eight messages beginning with chuA are produced for each format A burst received in seconds 32 through 39 of the minute. The first four fields are

    stat sig n b

    where stat is the status code, sig the character span, n the number of characters in the burst (9-11) and b the burst distance (0-40). Good bursts will have spans of a 800 or more and the other numbers near the top of the range specified. See the source for the interpretation of the remaining data in the burst. Note that each character of the burst is encoded as two digits in nibble-swapped order.

    If the CI-V interface for ICOM radios is active, a debug level greater than 1 will produce a trace of the CI-V command and response messages. Interpretation of these messages requires knowledge of the CI-V protocol, which is beyond the scope of this document.

    Monitor Data

    When enabled by the filegen facility, every received timecode is written to the clockstats file in the following format:
            sq yyyy ddd hh:mm:ss lw dst du lset agc rfrq bcnt dist tsmp
    
            s       sync indicator
            q       quality character
            yyyy    Gregorian year
            ddd     day of year
            hh      hour of day
            mm      minute of hour
            ss      second of minute
            lw      leap second warning
            dst     DST state
            dut     DUT sign and magnitude in deciseconds
            lset    minutes since last set
            agc     audio gain (0-255)
            ident   CHU identifier code
            dist    decoder distance
            tsmp    timestamps captured
    
    The fields beginning with year and extending through dut are decoded from the received data and are in fixed-length format. The agc and lset fields, as well as the following driver-dependent fields, are in variable-length format.
    s
    The sync indicator is initially ? before the clock is set, but turns to space when the clock has been correctly set.
    q
    The quality character is a four-bit hexadecimal code showing which alarms have been raised during the most recent minute. Each bit is associated with a specific alarm condition according to the following:
    8
    Timestamp alarm. Fewer than 20 timestamps have been determined.
    4
    Decoder alarm. A majority of repetitions for at least one digit of the timecode fails to agree.
    2
    Format alarm. One or more bursts contained invalid data or was improperly formatted.
    1
    Frame alarm. One or more bursts was improperly framed or contained too many repetition errors.

    The timestamp and decoder alarms are fatal; the data accumulated during the minute are not used to set the clock. The format and fram alarm are nonfatal; only the data in the burst are discarded.

    yyyy ddd hh:mm:ss
    The timecode format itself is self explanatory. Note that the Gregorian year is decoded directly from the transmitted timecode.
    lw
    The leap second warning is normally space, but changes to L if a leap second is to occur at the end of the month.
    dst
    The DST code for Canada encodes the state for all provinces. It is encoded as two hex characters.
    dut
    The DUT sign and magnitude shows the current UT1 offset relative to the displayed UTC time, in deciseconds. It is encoded as one digit preceeded by sign.
    lset
    Before the clock is set, this is the number of minutes since the program was started; after the clock is set, this is the number of minutes since the time was last verified relative to the broadcast signal.
    agc
    The audio gain shows the current codec gain setting in the range 0 to 255. Ordinarily, the receiver audio gain control should be set for a value midway in this range.
    ident
    The CHU identifier CHU followed by the current radio frequency code, if the CI-V interface is active, or CHU if not. The radio frequncy is encoded as 0 for 3.330 MHz, 1 for 7.850 MHz and 2 for 14.670 MHz.
    dist
    The decoding distance determined during the most recent minute bursts were received. The values range from 0 to 160, with the higher values indicating better signals. The decoding algorithms require the distance at least 50; otherwise all data in the minute are discarded.
    tsmp
    The number of timestamps determined during the most recent minute bursts were received. The values range from 0 to 60, with the higher values indicating better signals. The decoding algoriths require at least 20 timestamps in the minute; otherwise all data in the minute are discarded.

    Fudge Factors

    time1 time
    Specifies the propagation delay for CHU (45:18N 75:45N), in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default CHU.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    When the audio driver is compiled, this flag selects the audio input port, where 0 is the mike port (default) and 1 is the line-in port. It does not seem useful to select the compact disc player port.
    flag3 0 | 1
    When the audio driver is compiled, this flag enables audio monitoring of the input signal. For this purpose, the speaker volume must be set before the driver is started.
    flag4 0 | 1
    Enable verbose clockstats recording if set.

    ntp-4.2.6p5/html/drivers/driver9.html0000644000175000017500000000662511307651603016520 0ustar peterpeter Magnavox MX4200 GPS Receiver

    Magnavox MX4200 GPS Receiver


    Synopsis

    Address: 127.127.9.u
    Reference ID: GPS
    Driver ID: GPS_MX4200
    Serial Port: /dev/gpsu; 4800 baud, 8-bits, no parity
    Features: ppsclock (required)

    Description

    This driver supports the Magnavox MX4200 Navigation Receiver adapted to precision timing applications. This driver supports all compatible receivers such as the 6-channel MX4200, MX4200D, and the 12-channel MX9212, MX9012R, MX9112.

    Leica MX9400N Navigator Leica Geosystems acquired the Magnavox commercial GPS technology business in February of 1994. They now market and support former Magnavox GPS products such as the MX4200 and its successors.


    Leica MX9400N Navigator.

    Operating Modes

    This driver supports two modes of operation, static and mobile, controlled by clock flag 2.

    In static mode (the default) the driver assumes that the GPS antenna is in a fixed location. The receiver is initially placed in a "Static, 3D Nav" mode, where latitude, longitude, elevation and time are calculated for a fixed station. An average position is calculated from this data. After 24 hours, the receiver is placed into a "Known Position" mode, initialized with the calculated position, and then solves only for time.

    In mobile mode, the driver assumes the GPS antenna is mounted on a moving platform such as a car, ship, or aircraft. The receiver is placed in "Dynamic, 3D Nav" mode and solves for position, altitude and time while moving. No position averaging is performed.

    Monitor Data

    The driver writes each timecode as received to the clockstats file. Documentation for the NMEA-0183 proprietary sentences produced by the MX4200 can be found in MX4200 Receiver Data Format.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default GPS.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Assume GPS receiver is on a mobile platform if set.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Not used by this driver.

    Additional Information

    Reference Clock Drivers 


    ntp-4.2.6p5/html/drivers/driver6.html0000644000175000017500000002404611307651604016513 0ustar peterpeter IRIG Audio Decoder

    IRIG Audio Decoder


    Synopsis

    Address: 127.127.6.u
    Reference ID: IRIG
    Driver ID: IRIG_AUDIO
    Audio Device: /dev/audio and /dev/audioctl

    Description

    This driver synchronizes the computer time using the Inter-Range Instrumentation Group (IRIG) standard time distribution signal. This signal is generated by several radio clocks, including those made by Arbiter, Austron, Bancomm, Odetics, Spectracom, Symmetricom and TrueTime, among others, although it is often an add-on option. The signal is connected via an optional attenuator and cable to either the microphone or line-in port of a workstation or PC.

    The driver requires an audio codec or sound card with sampling rate 8 kHz and m-law companding to demodulate the data. This is the same standard as used by the telephone industry and is supported by most hardware and operating systems, including Solaris, FreeBSD and Linux, among others. In this implementation, only one audio driver and codec can be supported on a single machine. In order to assure reliable signal capture, the codec frequency error must be less than 250 PPM (.025 percent). If necessary, the tinker codec configuration command can be used to bracket the codec frequency to this range.

    For proper operation the IRIG signal source should be configured for analog signal levels, not digital TTL levels. In most radios the IRIG signal is driven ±10 V behind 50 Ohms. In such cases the cable should be terminated at the line-in port with a 50-Ohm resistor to avoid overloading the codec. Where feasible, the IRIG signal source should be operated with signature control so that, if the signal is lost or mutilated, the source produces an unmodulated signal, rather than possibly random digits. The driver automatically rejects the data and declares itself unsynchronized in this case. Some devices, in particular Spectracom radio/satellite clocks, provide additional year and status indication; other devices may not.

    In general and without calibration, the driver is accurate within 500 ms relative to the IRIG time. After calibrating relative to the PPS signal from a GPS receiver, the mean offset with a 2.4-GHz P4 running FreeBSD 6.1 is less than 20 ms with standard deviation 10 ms. Most of this is due to residuals after filtering and averaging the raw codec samples, which have an inherent jitter of 125 ms. The processor load due to the driver is 0.6 percent on the P4.

    However, be acutely aware that the accuracy with Solaris 2.8 and beyond has been seriously degraded to the order of several milliseconds. The Sun kernel driver has a sawtooth modulation with amplitude over 5 ms P-P and period 5.5 s. This distortion is especially prevalent with Sun Blade 1000 and possibly other systems.

    The driver performs a number of error checks to protect against overdriven or underdriven input signal levels, incorrect signal format or improper hardware configuration. The specific checks are detailed later in this page. Note that additional checks are done elsewhere in the reference clock interface routines.

    This driver incorporates several features in common with other audio drivers such as described in the Radio CHU Audio Demodulator/Decoder and the Radio WWV/H Audio Demodulator/Decoder pages. They include automatic gain control (AGC), selectable audio codec port and signal monitoring capabilities. For a discussion of these common features, as well as a guide to hookup, debugging and monitoring, see the Reference Clock Audio Drivers page.

    Technical Overview

    The IRIG signal format uses an amplitude-modulated carrier with pulse-width modulated data bits. For IRIG-B, the carrier frequency is 1000 Hz and bit rate 100 b/s; for IRIG-E, the carrier frequenchy is 100 Hz and bit rate 10 b/s. While IRIG-B provides the best accuracy, generally within a few tens of microseconds relative to IRIG time, it can also generate a significant processor load with older workstations. Generally, the accuracy with IRIG-E is about ten times worse than IRIG-B, but the processor load is somewhat less. Technical details about the IRIG formats can be found in IRIG Standard 200-98.

    The driver processes 8000-Hz m-law companded samples using separate signal filters for IRIG-B and IRIG-E, a comb filter, envelope detector and automatic threshold corrector. An infinite impulse response (IIR) 1000-Hz bandpass filter is used for IRIG-B and an IIR 130-Hz lowpass filter for IRIG-E. These are intended for use with noisy signals, such as might be received over a telephone line or radio circuit, or when interfering signals may be present in the audio passband. The driver determines which IRIG format is in use by sampling the amplitude of each filter output and selecting the one with maximum signal.

    Cycle crossings relative to the corrected slice level determine the width of each pulse and its value - zero, one or position identifier (PI). The data encode ten characters (20 BCD digits) which determine the second, minute, hour and day of the year and with some IRIG generators the year and synchronization condition. The comb filter exponentially averages the corresponding samples of successive baud intervals in order to reliably identify the reference carrier cycle.

    A type-II phase-lock loop (PLL) performs additional integration and interpolation to accurately determine the zero crossing of that cycle, which determines the reference timestamp. A pulse-width discriminator demodulates the data pulses, which are then encoded as the BCD digits of the timecode. The timecode and reference timestamp are updated once each second with IRIG-B (ten seconds with IRIG-E) and local clock offset samples saved for later processing. At poll intervals of 64 s, the saved samples are processed by a median filter and used to update the system clock.

    Monitor Data

    The timecode format used for debugging and data recording includes data helpful in diagnosing problems with the IRIG signal and codec connections. The driver produces one line for each timecode in the following format:

    00 00 98 23 19:26:52 2782 143 0.694 10 0.3 66.5 3094572411.00027

    If clockstats is enabled, the most recent line is written to the clockstats file every 64 s. If verbose recording is enabled (fudge flag 4) each line is written as generated.

    The first field containes the error flags in hex, where the hex bits are interpreted as below. This is followed by the year of century, day of year and time of day. Note that the time of day is for the previous minute, not the current time. The status indicator and year are not produced by some IRIG devices and appear as zeros. Following these fields are the carrier amplitude (0-3000), codec gain (0-255), modulation index (0-1), time constant (4-10), carrier phase error (0±0.5) and carrier frequency error (PPM). The last field is the on-time timestamp in NTP format.

    The error flags are defined as follows in hex:

    x01
    Low signal. The carrier amplitude is less than 100 units. This is usually the result of no signal or wrong input port.
    x02
    Frequency error. The codec frequency error is greater than 250 PPM. This may be due to wrong signal format or (rarely) defective codec.
    x04
    Modulation error. The IRIG modulation index is less than 0.5. This is usually the result of an overdriven codec, wrong signal format or wrong input port.
    x08
    Frame synch error. The decoder frame does not match the IRIG frame. This is usually the result of an overdriven codec, wrong signal format or noisy IRIG signal. It may also be the result of an IRIG signature check which indicates a failure of the IRIG signal synchronization source.
    x10
    Data bit error. The data bit length is out of tolerance. This is usually the result of an overdriven codec, wrong signal format or noisy IRIG signal.
    x20
    Seconds numbering discrepancy. The decoder second does not match the IRIG second. This is usually the result of an overdriven codec, wrong signal format or noisy IRIG signal.
    x40
    Codec error (overrun). The machine is not fast enough to keep up with the codec.
    x80
    Device status error (Spectracom).

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default IRIG.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Specifies the microphone port if set to zero or the line-in port if set to one. It does not seem useful to specify the compact disc player port.
    flag3 0 | 1
    Enables audio monitoring of the input signal. For this purpose, the speaker volume must be set before the driver is started.
    flag4 0 | 1
    Enable verbose clockstats recording if set.

    ntp-4.2.6p5/html/drivers/driver26.html0000644000175000017500000000763610441361213016573 0ustar peterpeter Hewlett Packard 58503A GPS Receiver and HP Z3801A

    Hewlett Packard 58503A GPS Receiver and HP Z3801A


    Synopsis

    Address: 127.127.26.u
    Reference ID: GPS
    Driver ID: GPS_HP
    Serial Port: /dev/hpgpsu; 9600 baud, 8-bits, no parity, 19200 baud 7-bits, odd parity for the HP Z3801A

    Description

    This driver supports the HP 58503A Time and Frequency Reference Receiver and HP Z3801A GPS Receiver. They use HP SmartClock (TM) to implement an Enhanced GPS receiver. The receiver accuracy when locked to GPS in normal operation is better than 1 usec. The accuracy when operating in holdover is typically better than 10 us per day. It receiver should be operated with factory default settings. Initial driver operation: expects the receiver to be already locked to GPS, configured and able to output timecode format 2 messages.

    The driver uses the poll sequence :PTIME:TCODE? to get a response from the receiver. The receiver responds with a timecode string of ASCII printing characters, followed by a <cr><lf>, followed by a prompt string issued by the receiver, in the following format:

    T#yyyymmddhhmmssMFLRVcc<cr><lf>scpi >
    The driver processes the response at the <cr> and <lf>, so what the driver sees is the prompt from the previous poll, followed by this timecode. The prompt from the current poll is (usually) left unread until the next poll. So (except on the very first poll) the driver sees this:
    scpi >T#yyyymmddhhmmssMFLRVcc<cr><lf>

    The T is the on-time character, at 980 msec. before the next 1PPS edge. The # is the timecode format type. We look for format 2. Without any of the CLK or PPS stuff, then, the receiver buffer timestamp at the <cr> is 24 characters later, which is about 25 msec. at 9600 bps, so the first approximation for fudge time1 is nominally -0.955 seconds. This number probably needs adjusting for each machine / OS type, so far: -0.955000 on an HP 9000 Model 712/80 HP-UX 9.05 -0.953175 on an HP 9000 Model 370 HP-UX 9.10

    This driver will probably work with the 58503B and 59551A if they are setup appropriately.

    To use an HP Z3801A, specify mode 1 on the server config line to setup the right line paramters.

    The timekeeping portion of HP's business has been sold to Symmetricom.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default GPS.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Not used by this driver.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Not used by this driver.

    ntp-4.2.6p5/html/drivers/driver34.html0000644000175000017500000001064011307651603016566 0ustar peterpeter Ultralink Clock

    Ultralink Clock


    Synopsis

    Address: 127.127.34.u
    Reference ID: WWVB
    Driver ID: ULINK
    Serial Port: /dev/wwvbu; 9600 bps, 8-bits, no parity
    Features: (none)

    Description

    This driver supports the Ultralink Model 325 (replacement for Model 320) RS-232 powered WWVB receiver. PDF specs available on http://www.ulio.com/. This driver also supports the Model 320, 330,331,332 decoders in both polled or continous time code mode.Leap second and quality are supported. Most of this code is originally from refclock_wwvb.c with thanks. Any mistakes are mine. Any improvements are welcome.

    Model 325 timecode format

    <cr><lf>RQ_1C00LYYYY+DDDUTCS_HH:MM:SSL+5

    R = Signal readability indicator, ranging from R1 to R5 Q R1 is unreadable, R5 is best reception
    _ = Space
    1 = prev. received data bit, values: 0, 1 ,M or ? unknown C = Signal reception from (C)olorado or (H)awaii 0 = Hours since last WWVB time and flag code update, values 0 00 to 99 (hopefully always 00)
    L = HEX A5 if receiver is locked to WWVB, Space if not
    YYYY = Year from 2000 to 2099
    + = '+' if current year is a leap year, else ' '
    DDD = current day in the year from 1 to 365/366
    UTC = timezone (always UTC)
    S = Daylight savings indicator, (S)TD, (D)ST, (O) transition into DST, (I) transition out of DST
    _ = Space
    HH = UTC hour 0 to 23
    : = Time delimiter, ':' if synced, Space if not
    MM = Minutes of current hour from 0 to 59
    : = Time delimiter, ':' if synced, Space if not
    SS = Seconds of current minute from 0 to 59
    mm = 10's milliseconds of the current second from 00 to 99
    L = Leap second pending at end of month, (I)nsert, (D)elete or Space
    +5 = UT1 correction, +/- .1 sec increments

    Note that Model 325 reports a very similar output like Model 33X series. The driver for this clock is similar to Model 33X behavior. On a unmodified new ULM325 clock, the polling flag (flag1 =1) needs to be set.

    Model 320 timecode format

    <cr><lf>SQRYYYYDDD+HH:MM:SS.mmLT<cr>

    S = 'S' -- sync'd in last hour, '0'-'9' - hours x 10 since last update, else '?'
    Q = Number of correlating time-frames, from 0 to 5
    R = 'R' -- reception in progress,'N' -- Noisy reception, ' ' -- standby mode
    YYYY = year from 1990 to 2089
    DDD = current day from 1 to 366 + = '+' if current year is a leap year, else ' '
    HH = UTC hour 0 to 23
    MM = Minutes of current hour from 0 to 59
    SS = Seconds of current minute from 0 to 59
    mm = 10's milliseconds of the current second from 00 to 99
    L = Leap second pending at end of month -- 'I' = insert, 'D'=delete
    T = DST <-> STD transition indicators

    Note that this driver does not do anything with the T flag. The M320 also has a 'U' command which returns UT1 correction information. It is not used in this driver.

    Model 33x timecode format

    S9+D 00 YYYY+DDDUTCS HH:MM:SSl+5

    S = sync indicator S insync N not in sync the sync flag is WWVB decoder sync nothing to do with time being correct

    9+ = signal level 0 thru 9+ If over 9 indicated as 9
    D = data bit (fun to watch but useless ;-) space
    00 = hours since last GOOD WWVB frame sync space
    YYYY = current year + = leap year indicator
    DDD = day of year
    UTC = timezone (always UTC)
    S = daylight savings indicator space
    HH = hours : = This is the REAL in sync indicator (: = insync)
    MM = minutes : = : = in sync ? = NOT in sync
    SS = seconds
    L = leap second flag
    +5 = UT1 correction (sign + digit ))

    This driver ignores UT1 correction, DST indicator,Leap year and signal level.

    Fudge factors

    flag1 polling enable (1=poll 0=no poll)


    ntp-4.2.6p5/html/drivers/oncore-shmem.html0000644000175000017500000002426610441361220017520 0ustar peterpeter ONCORE - SHMEM

    Motorola ONCORE - The Shared Memory Interface


    Introduction

    In NMEA mode, the Oncore GPS receiver provides the user with the same information as other GPS receivers. In BINARY mode, it can provide a lot of additional information.

    In particular, you can ask for satellite positions, satellite health, signal levels, the ephemeris and the almanac, and you can set many operational parameters. In the case of the VP, you can get the pseudorange corrections necessary to act as a DGPS base station, and you can see the raw satellite data messages themselves.

    When using the Oncore GPS receiver with NTP, this additional information is usually not available since the receiver is only talking to the oncore driver in NTPD. To make this information available for use in other programs, (say graphic displays of satellites positions, plots of SA, etc.), a shared memory interface (SHMEM) has been added to the refclock_oncore driver on those operating systems that support shared memory.

    To make use of this information you will need an Oncore Reference Manual for the Oncore GPS receiver that you have. The Manual for the VP only exists as a paper document, the UT+/GT+/M12 manuals are available as a pdf documents at Synergy .

    This interface was written by Poul-Henning Kamp (phk@FreeBSD.org), and modified by Reg Clemens (reg@dwf.com). The interface is known to work in FreeBSD, Linux, and Solaris.

    Activating the Interface

    Although the Shared Memory Interface will be compiled into the Oncore driver on those systems where Shared Memory is supported, to activate this interface you must include a STATUS or SHMEM line in the /etc/ntp.oncore data file that looks like

            STATUS < file_name >
    or
    SHMEM < file_name >
    Thus a line like
            SHMEM /var/adm/ntpstats/ONCORE
    

    would be acceptable. This file name will be used to access the Shared Memory.

    In addition, one the two keywords Posn2D and Posn3D can be added to see @@Ea records containing the 2D or 3D position of the station (see below). Thus to activate the interface, and see 3D positions, something like

            SHMEM /var/adm/ntpstats/ONCORE
            Posn3D
    

    would be required.

    Storage of Messages in Shared Memory

    With the shared memory interface, the oncore driver (refclock_oncore) allocates space for all of the messages that it is configured to receive, and then puts each message in the appropriate slot in shared memory as it arrives from the receiver. Since there is no easy way for a client program to know when the shared memory has been updated, a sequence number is associated with each message, and is incremented when a new message arrives. With the sequence number it is easy to check through the shared memory segment for messages that have changed.

    The Oncore binary messages are kept in their full length, as described in the Reference manual, that is everything from the @@ prefix thru the <checksum><CR><LF>.

    The data starts at location ONE of SHMEM (NOT location ZERO).

    The messages are stacked in a series of variable length structures, that look like

            struct message {
                    u_int   length;
                    u_char  sequence;
                    u_char  message[length];
            }
    

    if something like that were legal. That is, there are two bytes (caution, these may NOT be aligned with word boundaries, so the field needs to be treated as a pair of u_char), that contains the length of the next message. This is followed by a u_char sequence number, that is incremented whenever a new message of this type is received. This is followed by 'length' characters of the actual message.

    The next structure starts immediately following the last char of the previous message (no alignment). Thus, each structure starts a distance of 'length+3' from the previous structure.

    Following the last structure, is a u_int containing a zero length to indicate the end of the data.

    The messages are recognized by reading the headers in the data itself, viz @@Ea or whatever.

    There are two special cases.

    (1) The almanac takes a total of 34 submessages all starting with @@Cb.
    35 slots are allocated in shared memory. Each @@Cb message is initially placed in the first of these locations, and then later it is moved to the appropriate location for that submessage. The submessages can be distinguished by the first two characters following the @@Cb header, and new data is received only when the almanac changes.

    (2) The @@Ea message contains the calculated location of the antenna, and is received once per second. However, when in timekeeping mode, the receiver is normally put in 0D mode, with the position fixed, to get better accuracy. In 0D mode no position is calculated.

    When the SHMEM option is active, and if one of Posn2D or Posn3D is specified, one @@Ea record is hijacked each 15s, and the receiver is put back in 2D/3D mode so the the current location can be determined (for position determination, or for tracking SA). The timekeeping code is careful NOT to use the time associated with this (less accurate) 2D/3D tick in its timekeeping functions.

    Following the initial @@Ea message are 3 additional slots for a total of four. As with the almanac, the first gets filled each time a new record becomes available, later in the code, the message is distributed to the appropriate slot. The additional slots are for messages containing 0D, 2D and 3D positions. These messages can be distinguished by different bit patterns in the last data byte of the record.

    Opening the Shared Memory File

    The shared memory segment is accessed through a file name given on a SHMEM card in the /etc/ntp.oncore input file. The following code could be used to open the Shared Memory Segment:

            char *Buf, *file;
            int size, fd;
            struct stat statbuf;
    
            file = "/var/adm/ntpstats/ONCORE";  /* the file name on my ACCESS card */
            if ((fd=open(file, O_RDONLY)) < 0) {
                    fprintf(stderr, "Cant open %s\n", file);
                    exit(1);
            }
    
            if (stat(file, &statbuf) < 0) {
                    fprintf(stderr, "Cant stat %s\n", file);
                    exit(1);
            }
    
            size = statbuf.st_size;
            if ((Buf=mmap(0, size, PROT_READ, MAP_SHARED, fd, (off_t) 0)) < 0) {
                    fprintf(stderr, "MMAP failed\n");
                    exit(1);
            }
    

    Accessing the data

    The following code shows how to get to the individual records.

            void    oncore_msg_Ea(), oncore_msg_As(), oncore_msg_Bb();
    
            struct Msg {
                char         c[5];
                unsigned int seq;
                void         (*go_to)(uchar *);
            };
    
            struct Msg Hdr[] = { {"@@Bb", 0, &oncore_msg_Bb},
                                 {"@@Ea", 0, &oncore_msg_Ea},
                                 {"@@As", 0, &oncore_msg_As}};
    
            void
            read_data()
            {
                int     i, j, k, n, iseq, jseq;
                uchar   *cp, *cp1;
    
    
                for(cp=Buf+1; (n = 256*(*cp) + *(cp+1)) != 0;  cp+=(n+3)) {
                    for (k=0; k < sizeof(Hdr)/sizeof(Hdr[0]);  k++) {
                        if (!strncmp(cp+3, Hdr[k].c, 4)) {      /* am I interested? */
                            iseq = *(cp+2);
                            jseq = Hdr[k].seq;
                            Hdr[k].seq = iseq;
                            if (iseq > jseq) {              /* has it changed? */
                                /* verify checksum */
                                j = 0;
                                cp1 = cp+3;             /* points to start of oncore response */
                                for (i=2; i < n-3; i++)
                                    j ^= cp1[i];
                                if (j == cp1[n-3]) {    /* good checksum */
                                        Hdr[k].go_to(cp1);
                                } else {
                                    fprintf(stderr, "Bad Checksum for %s\n", Hdr[k].c);
                                    break;
                                }
                            }
                        }
                    }
                    if (!strncmp(cp+3, "@@Ea", 4))
                        cp += 3*(n+3);
                    if (!strncmp(cp+3, "@@Cb", 4))
                        cp += 34*(n+3);
                }
            }
    
            oncore_msg_Bb(uchar *buf)
            {
                    /* process Bb messages */
            }
    
            oncore_msg_Ea(uchar *buf)
            {
                    /* process Ea messages */
            }
    
            oncore_msg_As(uchar *buf)
            {
                    /* process As messages */
            }
    

    The structure Hdr contains the Identifying string for each of the messages that we want to examine, and the name of a program to call when a new message of that type is arrives. The loop can be run every few seconds to check for new data.

    Examples

    There are two complete examples available. The first plots satellite positions and the station position as affected by SA, and keeps track of the mean station position, so you can run it for periods of days to get a better station position. The second shows the effective horizon by watching satellite tracks. The examples will be found in the GNU-zipped tar file ftp://ftp.udel.edu/pub/ntp/software/OncorePlot.tar.gz.

    Try the new interface, enjoy.


    Reg.Clemens (reg@dwf.com), Poul-Henning Kamp (phk@FreeBSD.org)

    ntp-4.2.6p5/html/drivers/driver11.html0000644000175000017500000001166011307651604016565 0ustar peterpeter Arbiter 1088A/B GPS Receiver

    Arbiter 1088A/B GPS Receiver


    Synopsis

    Address: 127.127.11.u
    Reference ID: GPS
    Driver ID: GPS_ARBITER
    Serial Port: /dev/gpsu; 9600 baud, 8-bits, no parity
    Features: tty_clk

    Description

    This driver supports the Arbiter 1088A/B Satellite Controlled Clock. The claimed accuracy of this clock is 100 ns relative to the PPS output when receiving four or more satellites.

    The receiver should be configured before starting the NTP daemon, in order to establish reliable position and operating conditions. It does not initiate surveying or hold mode. For use with NTP, the daylight savings time feature should be disables (D0 command) and the broadcast mode set to operate in UTC (BU command).

    The timecode format supported by this driver is selected by the poll sequence B5, which initiates a line in the following format to be repeated once per second until turned off by the B0 command.

    Format B5 (24 ASCII printing characters):

    <cr><lf>i yy ddd hh:mm:ss.000bbb
    
    on-time = <cr>
    i = synchronization flag (' ' = locked, '?' = unlocked)
    yy = year of century
    ddd = day of year
    hh:mm:ss = hours, minutes, seconds
    .000 = fraction of second (not used)
    bbb = tailing spaces for fill

    The alarm condition is indicated by a '?' at i, which indicates the receiver is not synchronized. In normal operation, a line consisting of the timecode followed by the time quality character (TQ) followed by the receiver status string (SR) is written to the clockstats file.

    The time quality character is encoded in IEEE P1344 standard:

    Format TQ (IEEE P1344 estimated worst-case time quality)

    0       clock locked, maximum accuracy
    F       clock failure, time not reliable
    4       clock unlocked, accuracy < 1 us
    5       clock unlocked, accuracy < 10 us
    6       clock unlocked, accuracy < 100 us
    7       clock unlocked, accuracy < 1 ms
    8       clock unlocked, accuracy < 10 ms
    9       clock unlocked, accuracy < 100 ms
    A       clock unlocked, accuracy < 1 s
    B       clock unlocked, accuracy < 10 s

    The status string is encoded as follows:

    Format SR (25 ASCII printing characters)

    V=vv S=ss T=t P=pdop E=ee
    
    vv = satellites visible
    ss = relative signal strength
    t = satellites tracked
    pdop = position dilution of precision (meters)
    ee = hardware errors

    A three-stage median filter is used to reduce jitter and provide a dispersion measure. The driver makes no attempt to correct for the intrinsic jitter of the radio itself.

    Monitor Data

    When enabled by the flag4 fudge flag, an additional line containing the latitude, longitude, elevation and optional deviation data is written to the clockstats file. The deviation data operates with an external pulse-per-second (PPS) input, such as a cesium oscillator or another radio clock. The PPS input should be connected to the B event channel and the radio initialized for deviation data on that channel. The deviation data consists of the mean offset and standard deviation of the external PPS signal relative the GPS signal, both in microseconds over the last 16 seconds.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default GPS.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Not used by this driver.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Enable verbose clockstats recording if set.

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/driver37.html0000644000175000017500000000425410441361216016571 0ustar peterpeter Forum Graphic GPS Dating station

    Forum Graphic GPS Dating station


    Synopsis

    Address: 127.127.37.u
    Reference ID: GPS
    Driver ID: GPS
    Parallel Port: /dev/fgclocku

    Description

    This driver supports the Forum Graphic GPS Dating station sold by EMR company.

    Unfortunately sometime FG GPS start continues reporting of the same date. The only way to fix this problem is GPS power cycling and ntpd restart after GPS power-up.

    After Jan,10 2000 my FG GPS unit start send a wrong answer after 10:00am till 11:00am. It repeat hour value in result string twice. I wroite a small code to avoid such problem. Unfortunately I have no second FG GPS unit to evaluate this problem. Please let me know if your GPS has no problems after Y2K.

    Monitor Data

    Each timecode is written to the clockstats file in the format YYYY YD HH MI SS.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default FG.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Not used by this driver.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Not used by this driver.

    Dmitry Smirnov (das@amt.ru)

    ntp-4.2.6p5/html/drivers/driver39.html0000644000175000017500000001037210441361216016571 0ustar peterpeter hopf clock drivers by ATLSoft

    hopf PCI-Bus Receiver (6039 GPS/DCF77)


    Synopsis

    Address:  
    127.127.39.X
    Reference ID:  
    .hopf. (default), GPS, DCF
    Driver ID:  
    HOPF_P
    gif

    Description

    The refclock_hopf_pci driver supports the hopf PCI-bus interface 6039 GPS/DCF77.
    Additional software and information about the software drivers maybe available from: http://www.ATLSoft.de/ntp.
    Latest NTP driver source, executables and documentation is maintained at: http://www.ATLSoft.de/ntp

    Operating System Compatibility

    The hopf clock driver has been tested on the following software and hardware platforms:
     

    Platform

    Operating System

    i386 (PC) 

    Linux

    i386 (PC) 

    Windows NT

    i386 (PC) 

    Windows 2000

    O/S System Configuration

    UNIX

    The driver attempts to open the device /dev/hopf6039 . The device entry will be made by the installation process of the kernel module for the PCI-bus board. The driver sources belongs to the delivery equipment of the PCI-board.

    Windows NT/2000

    The driver attempts to open the device by calling the function "OpenHopfDevice()". This function will be installed by the Device Driver for the PCI-bus board. The driver belongs to the delivery equipment of the PCI-board.


    Fudge Factors

    refid string
    Specifies the driver reference identifier, GPS or DCF.
    flag1 0 | 1
    When set to 1, driver sync's even if only crystal driven.

    Questions or Comments:

    Bernd Altmeier
    Ing.-Büro für Software www.ATLSoft.de

    (last updated 03/02/2001)
     


    ntp-4.2.6p5/html/drivers/driver16.html0000644000175000017500000000276610054623676016607 0ustar peterpeter Bancomm bc635VME Time and Frequency Processor

    bc635VME/bc350VXI Time and Frequency Processor


    Synopsis

    Address: 127.127.16.u
    Reference ID: BTFP
    Driver ID: GPS_BANCOMM
    Bancomm Device /dev/btfp0
    Requires: Bancomm bc635 TFP device module driver for SunOS 4.x/SunOS 5.x

    Description

    This is the clock driver for the Bancomm bc635VME Time and Frequency Processor. It requires the BANCOMM bc635VME bc350VXI Time and Frequency Processor Module Driver for SunOS 4.x/SunOS 5.x UNIX Systems.

    Most of this code is originally from refclock_bancomm.c with thanks. It has been modified and tested on an UltraSparc IIi-cEngine running Solaris 2.6. A port for HPUX is not available henceforth.

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/driver36.html0000644000175000017500000007157211307651604016604 0ustar peterpeter Radio WWV/H Audio Demodulator/Decoder

    Radio WWV/H Audio Demodulator/Decoder


    Synopsis

    Address: 127.127.36.u
    Reference ID: WVf or WHf
    Driver ID: WWV_AUDIO
    Autotune Port: /dev/icom; 1200/9600 baud, 8-bits, no parity
    Audio Device: /dev/audio and /dev/audioctl

    Description

    This driver synchronizes the computer time using shortwave radio transmissions from NIST time/frequency stations WWV in Ft. Collins, CO, and WWVH in Kauai, HI. Transmissions are made continuously on 2.5, 5, 10 and 15 MHz from both stations and on 20 MHz from WWV. An ordinary shortwave receiver can be tuned manually to one of these frequencies or, in the case of ICOM receivers, the receiver can be tuned automatically by the driver as propagation conditions change throughout the day and season. The radio is connected via an optional attenuator and cable to either the microphone or line-in port of a workstation or PC.

    The driver requires an audio codec or sound card with sampling rate 8 kHz and m-law companding to demodulate the data. This is the same standard as used by the telephone industry and is supported by most hardware and operating systems, including Solaris, FreeBSD and Linux, among others. In this implementation only one audio driver and codec can be supported on a single machine. In order to assure reliable signal capture, the codec frequency error must be less than 187 PPM (.0187 percent). If necessary, the tinker codec configuration command can be used to bracket the codec frequency to this range.

    In general and without calibration, the driver is accurate within 1 ms relative to the broadcast time when tracking a station. However, variations up to 0.3 ms can be expected due to diurnal variations in ionospheric layer height and ray geometry. In Newark DE, 2479 km from the transmitter, the predicted two-hop propagation delay varies from 9.3 ms in sunlight to 9.0 ms in moonlight. When not tracking the station the accuracy depends on the computer clock oscillator stability, ordinarily better than 0.5 PPM.

    After calibration relative to the PPS signal from a GPS receiver, the mean offset with a 2.4-GHz P4 running FreeBSD 6.1 is generally within 0.1 ms short-term with 0.4 ms jitter. The long-term mean offset varies up to 0.3 ms due to propagation path geometry variations. The processor load due to the driver is 0.4 percent on the P4.

    The driver performs a number of error checks to protect against overdriven or underdriven input signal levels, incorrect signal format or improper hardware configuration. The specific checks are detailed later in this page. Note that additional checks are done elsewhere in the reference clock interface routines.

    This driver incorporates several features in common with other audio drivers such as described in the Radio CHU Audio Demodulator/Decoder and the IRIG Audio Decoder pages. They include automatic gain control (AGC), selectable audio codec port and signal monitoring capabilities. For a discussion of these common features, as well as a guide to hookup, debugging and monitoring, see the Reference Clock Audio Drivers page.

    Technical Overview

    The driver processes 8-kHz m-law companded codec samples using maximum-likelihood techniques which exploit the considerable degree of redundancy available in the broadcast signal. The WWV signal format is described in NIST Special Publication 432 (Revised 1990) and also available on the WWV/H web site. It consists of three elements, a 5-ms, 1000-Hz pulse, which occurs at the beginning of each second, a 800-ms, 1000-Hz pulse, which occurs at the beginning of each minute, and a pulse-width modulated 100-Hz subcarrier for the data bits, one bit per second. The WWVH format is identical, except that the 1000-Hz pulses are sent at 1200 Hz. Each minute encodes nine BCD digits for the time of century plus seven bits for the daylight savings time (DST) indicator, leap warning indicator and DUT1 correction.

    The demodulation and decoding algorithms used by this driver are based on a machine language program developed for the TAPR DSP93 DSP unit, which uses the TI 320C25 DSP chip. The analysis, design and performance of the program for this unit is described in: Mills, D.L. A precision radio clock for WWV transmissions. Electrical Engineering Report 97-8-1, University of Delaware, August 1997, 25 pp. Available from www.eecis.udel.edu/~mills/reports.htm. For use in this driver, the original program was rebuilt in the C language and adapted to the NTP driver interface. The algorithms have been modified to improve performance, especially under weak signal conditions and to provide an automatic frequency and station selection feature.

    As in the original program, the clock discipline is modelled as a Markov process, with probabilistic state transitions corresponding to a conventional clock and the probabilities of received decimal digits. The result is a performance level with very high accuracy and reliability, even under conditions when the minute beep of the signal, normally its most prominent feature, can barely be detected by ear using a communications receiver.

    Baseband Signal Processing

    The 1000/1200-Hz pulses and 100-Hz subcarrier are first separated using a 600-Hz bandpass filter centered on 1100 Hz and a 150-Hz lowpass filter. The minute pulse is extracted using an 800-ms synchronous matched filter and pulse grooming logic which discriminates between WWV and WWVH signals and noise. The second pulse is extracted using a 5-ms FIR matched filter for each station and a single 8000-stage comb filter.

    The phase of the 100-Hz subcarrier relative to the second pulse is fixed at the transmitter; however, the audio stage in many radios affects the phase response at 100 Hz in unpredictable ways. The driver adjusts for each radio using two 170-ms synchronous matched filters. The I (in-phase) filter is used to demodulate the subcarrier envelope, while the Q (quadrature-phase) filter is used in a type-1 phase-lock loop (PLL) to discipline the demodulator phase.

    A bipolar data signal is determined from the matched filter subcarrier envelope using a pulse-width discriminator. The discriminator samples the I channel at 15 ms (n), 200 ms (s0) and 500 ms (s1), and the envelope (RMS I and Q channels) at 200 ms (e1) and the end of the second (e0). The bipolar data signal is expressed 2s1 - s0 - n, where positive values correspond to data 1 and negative values correspond to data 0. Note that, since the signals s0 and s1 include the noise n, the noise component cancels out. The data bit SNR is calculated as 20 log10(e1 / e0). If the driver has not synchronized to the minute pulse, or if the data bit amplitude e1 or SNR are below thresholds, the bit is considered invalid and the bipolar signal is forced to zero.

    The bipolar signal is exponentially averaged in a set of 60 accumulators, one for each second, to determine the semi-static miscellaneous bits, such as DST indicator, leap second warning and DUT1 correction. In this design a data average value larger than a positive threshold is interpreted as +1 (hit) and a value smaller than a negative threshold as a -1 (miss). Values between the two thresholds, which can occur due to signal fades, are interpreted as an erasure and result in no change of indication.

    Maximum-Likelihood Decoder

    The BCD digit in each digit position of the timecode is represented as four data bits. The bits are correlated with the bits corresponding to each of the valid decimal digits in this position. If any of the four bits are invalid, the correlated value for all digits in this position is assumed zero. In either case, the values for all digits are exponentially averaged in a likelihood vector associated with this position. The digit associated with the maximum over all averaged values then becomes the maximum-likelihood candidate for this position and the ratio of the maximum over the next lower value represents the digit SNR.

    The decoding matrix contains nine row vectors, one for each digit position. Each row vector includes the maximum-likelihood digit, likelihood vector and other related data. The maximum-likelihood digit for each of the nine digit positions becomes the maximum-likelihood time of the century. A built-in transition function implements a conventional clock with decimal digits that count the minutes, hours, days and years, as corrected for leap seconds and leap years. The counting operation also rotates the likelihood vector corresponding to each digit as it advances. Thus, once the clock is set, each clock digit should correspond to the maximum-likelihood digit as transmitted.

    Each row of the decoding matrix also includes a compare counter and the most recently determined maximum-likelihood digit. If a digit likelihood exceeds the decision level and compares with previous digits for a number of successive minutes in any row, the maximum-likelihood digit replaces the clock digit in that row. When this condition is true for all rows and the second epoch has been reliably determined, the clock is set (or verified if it has already been set) and delivers correct time to the integral second. The fraction within the second is derived from the logical master clock, which runs at 8000 Hz and drives all system timing functions.

    Master Clock Discipline

    The logical master clock is derived from the audio codec clock. Its frequency is disciplined by a frequency-lock loop (FLL) which operates independently of the data recovery functions. The maximum value of the 5-ms pulse after the comb filter represents the on-time epoch of the second. At averaging intervals determined by the measured jitter, the frequency error is calculated as the difference between the epoches over the interval divided by the interval itself. The sample clock frequency is then corrected by this amount divided by a time constant of 8.

    When first started, the frequency averaging interval is 8 seconds, in order to compensate for intrinsic codec clock frequency offsets up to 125 PPM. Under most conditions, the averaging interval doubles in stages from the initial value to 1024 s, which results in an ultimate frequency resolution of 0.125 PPM, or about 11 ms/day.

    The data demodulation functions operate using the subcarrier clock, which is independent of the epoch. However, the data decoding functions are driven by the epoch. The decoder is phase-locked to the epoch in such a way that, when the clock state machine has reliably decoded the broadcast time to the second, the epoch timestamp of that second becomes a candidate to set the system clock.

    The comb filter can have a long memory and is vulnerable to noise and stale data, especially when coming up after a long fade. Therefore, a candidate is considered valid only if the 5-ms signal amplitude and SNR are above thresholds. In addition, the system clock is not set until after one complete averaging interval has passed with valid candidates.

    Station Identification

    It is important that the logical clock frequency is stable and accurately determined, since in many applications the shortwave radio will be tuned to a fixed frequency where WWV or WWVH signals are not available throughout the day. In addition, in some parts of the US, especially on the west coast, signals from either or both WWV and WWVH may be available at different times or even at the same time. Since the propagation times from either station are almost always different, each station must be reliably identified before attempting to set the clock.

    Reliable station identification requires accurate discrimination between very weak signals in noise and noise alone. The driver very aggressively soaks up every scrap of signal information, but has to be careful to avoid making pseudo-sense of noise alone. The signal quality metric depends on the minute pulse amplitude and SNR measured in second 0 of the minute, together with the data subcarrier amplitude and SNR measured in second 1. If all four values are above defined thresholds a hit is declared, otherwise a miss. In principle, the data pulse in second 58 is usable, but the AGC in most radios is not fast enough for a reliable measurement.

    The number of hits declared in the last 6 minutes for each station represents the high order bits of the metric, while the current minute pulse amplitude represents the low order bits. Only if the metric is above a defined threshold is the station signal considered acceptable. The metric is also used by the autotune function described below and reported in the timecode string.

    Performance

    It is the intent of the design that the accuracy and stability of the indicated time be limited only by the characteristics of the ionospheric propagation medium. Conventional wisdom is that manual synchronization via oscilloscope and HF medium is good only to a millisecond under the best propagation conditions. The performance of the NTP daemon disciplined by this driver is clearly better than this, even under marginal conditions.

    The figure below shows the measured offsets over a typical day near the bottom of the sunspot cycle ending in October, 2006. Variations up to ±0.4 ms can be expected due to changing ionospheric layer height and ray geometry over the day and night.

    gif

    The figure was constructed using a 2.4-GHz P4 running FreeBSD 6.1. For these measurements the computer clock was disciplined within a few microseconds of UTC using a PPS signal and GPS receiver and the measured offsets determined from the filegen peerstats data.

    The predicted propagation delay from the WWV transmitter at Boulder, CO, to the receiver at Newark, DE, varies over 9.0-9.3 ms. In addition, the receiver contributes 4.7 ms and the 600-Hz bandpass filter 0.9 ms. With these values, the mean error is less than 0.1 ms and varies ±0.3 ms over the day as the result of changing ionospheric height and ray geometry.

    Program Operation

    The driver begins operation immediately upon startup. It first searches for one or both of the stations WWV and WWVH and attempts to acquire minute synch. This may take some fits and starts, as the driver expects to see several consecutive minutes with good signals and low jitter. If the autotune function is active, the driver will rotate over all five frequencies and both WWV and WWVH stations until finding a station and frequency with acceptable metric.

    While this is going on the the driver acquires second synch, which can take up to several minutes, depending on signal quality. When minute synch has been acquired, the driver accumulates likelihood values for the unit (seconds) digit of the nine timecode digits, plus the seven miscellaneous bits included in the WWV/H transmission format. When a good unit digit has been found, the driver accumulated likelihood values for the remaining eight digits of the timecode. When three repetitions of all nine digits have decoded correctly, which normally takes 15 minutes with good signals, and up to 40 minutes when buried in noise, and the second synch has been acquired, the clock is set (or verified) and is selectable to discipline the system clock.

    Once the clock is set, it continues to provide correct timecodes as long as the signal metric is above threshold, as described in the previous section. As long as the clock is correctly set or verified, the system clock offsets are provided once each minute to the reference clock interface, where they are processed using the same algorithms as with other reference clocks and remote servers.

    It may happen as the hours progress around the clock that WWV and WWVH signals may appear alone, together or not at all. When the driver has mitigated which station and frequency is best, it sets the reference identifier to the string WVf for WWV and WHf for WWVH, where f is the frequency in megahertz. If the propagation delays have been properly set with the fudge time1 (WWV) and fudge time2 (WWVH) commands in the configuration file, handover from one station to the other is seamless.

    Operation continues as long as the signal metric from at least one station on at least one frequency is acceptable. A consequence of this design is that, once the clock is set, the time and frequency are disciplined only by the second synch pulse and the clock digits themselves are driven by the clock state machine. If for some reason the state machine drifts to the wrong second, it would never resynchronize. To protect against this most unlikely situation, if after two days with no signals, the clock is considered unset and resumes the synchronization procedure from the beginning.

    Once the system clock been set correctly it will continue to read correctly even during the holdover interval, but with increasing dispersion. Assuming the system clock frequency can be disciplined within 1 PPM, it can coast without signals for several days without exceeding the NTP step threshold of 128 ms. During such periods the root distance increases at 15 ms per second, which makes the driver appear less likely for selection as time goes on. Eventually, when the distance due all causes exceeds 1 s, it is no longer suitable for synchronization. Ordinarily, this happens after about 18 hours with no signals. The tinker maxdist configuration command can be used to change this value.

    Autotune

    The driver includes provisions to automatically tune the radio in response to changing radio propagation conditions throughout the day and night. The radio interface is compatible with the ICOM CI-V standard, which is a bidirectional serial bus operating at TTL levels. The bus can be connected to a standard serial port using a level converter such as the CT-17. Further details are on the Reference Clock Audio Drivers page.

    If specified, the driver will attempt to open the device /dev/icom and, if successful will activate the autotune function and tune the radio to each operating frequency in turn while attempting to acquire minute synch from either WWV or WWVH. However, the driver is liberal in what it assumes of the configuration. If the /dev/icom link is not present or the open fails or the CI-V bus is inoperative, the driver quietly gives up with no harm done.

    Once acquiring minute synch, the driver operates as described above to set the clock. However, during seconds 59, 0 and 1 of each minute it tunes the radio to one of the five broadcast frequencies to measure the signal metric as described above. Each of the five frequencies are probed in a five-minute rotation to build a database of current propagation conditions for all signals that can be heard at the time. At the end of each probe a mitigation procedure scans the database and retunes the radio to the best frequency and station found. For this to work well, the radio should be set for a fast AGC recovery time. This is most important while tracking a strong signal, which is normally the case, and then probing another frequency, which may have much weaker signals.

    The mitigation procedure selects the frequency and station with the highest valid metric, ties going first to the highest frequency and then to WWV in order. A station is considered valid only if the metric is above a specified threshold; if no station is above the metric, the rotating probes continue until a valid station is found.

    The behavior of the autotune function over a typical day is shown in the figure below.

    gif

    As expected, the lower frequencies prevail when the ray path is in moonlight (0100-1300 UTC) and the higher frequencies when the path is in sunlight (1300-0100 UTC). Note three periods in the figure show zero frequency when signals are below the minimum for all frequencies and stations.

    Debugging Aids

    The most convenient way to track the driver status is using the ntpq program and the clockvar command. This displays the last determined timecode and related status and error counters, even when the driver is not disciplining the system clock. If the debugging trace feature (-d on the ntpd command line) is enabled, the driver produces detailed status messages as it operates. If the fudge flag 4 is set, these messages are written to the clockstats file. All messages produced by this driver have the prefix wwv for convenient filtering with the Unix grep command.

    The autotune process produces diagnostic information along with the timecode. This is very useful for evaluating the performance of the algorithms, as well as radio propagation conditions in general. The message is produced once each minute for each frequency in turn after minute synch has been acquired.

    wwv5 status agc epoch secamp/secsnr datamp/datsnr wwv wwvh

    where the fields after the wwv5 identifier are: status contains status bits, agc audio gain, epoch second epoch, secamp/secsnr second pulse amplitude/SNR, and wwv and wwvh are two sets of fields, one each for WWV and WWVH. Each of the two fields has the format

    ident score metric minamp/minsnr

    where ident encodes the station (WV for WWV, WH for WWVH) and frequency (2, 5, 10, 15 or 20), score 32-bit shift register recording the hits (1) and misses (0) of the last 32 probes (hits and misses enter from the right), metric is described above, and minamp/minsnr is the minute pulse ampliture/SNR. An example is:

    wwv5 000d 111 5753 3967/20.1 3523/10.2 WV20 bdeff 100 8348/30.0 WH20 0000 1 22/-12.4

    There are several other messages that can occur; these are documented in the source listing.

    Monitor Data

    When enabled by the filegen facility, every received timecode is written to the clockstats file in the following format:

    sq yyyy ddd hh:mm:ss l d du lset agc ident metric errs freq avg

    The fields beginning with yyyy and extending through du are decoded from the received data and are in fixed-length format. The remaining fields are in variable-length format. The fields are as follows:
    s
    The synch indicator is initially ? before the clock is set, but turns to space when all nine digits of the timecode are correctly set and the decoder is synchronized to the station within 125 ms.
    q
    The quality character is a four-bit hexadecimal code showing which alarms have been raised. Each bit is associated with a specific alarm condition according to the following:
    0x8
    synch alarm. The decoder is not synchronized to the station within 125 ms.
    0x4
    Digit error alarm. Less than nine decimal digits were found in the last minute.
    0x2
    Error alarm. More than 40 data bit errors were found in the last minute.
    0x1
    Compare alarm. A maximum-likelihood digit failed to agree with the current associated clock digit in the last minute.
    It is important to note that one or more of the above alarms does not necessarily indicate a clock error, but only that the decoder has detected a marginal condition.
    yyyy ddd hh:mm:ss
    The timecode format itself is self explanatory. Since the driver latches the on-time epoch directly from the second synch pulse, the seconds fraction is always zero. Although the transmitted timecode includes only the year of century, the Gregorian year is augmented by 2000.
    l
    The leap second warning is normally space, but changes to L if a leap second is to occur at the end of the month.
    d
    The DST state is S or D when standard time or daylight time is in effect, respectively. The state is I or O when daylight time is about to go into effect or out of effect, respectively.
    du
    The DUT sign and magnitude shows the current UT1 offset relative to the displayed UTC time, in deciseconds.
    lset
    Before the clock is set, the interval since last set is the number of minutes since the driver was started; after the clock is set, this is number of minutes since the decoder was last synchronized to the station within 125 ms.
    agc
    The audio gain shows the current codec gain setting in the range 0 to 255. Ordinarily, the receiver audio gain control should be set for a value midway in this range.
    ident
    The station identifier shows the station, WVf for WWV or WHf for WWVH, and frequency f being tracked. If neither station is heard on any frequency, the reference identifier shows NONE.
    metric
    The signal metric described above from 0 (no signal) to 100 (best).
    errs
    The bit error counter is useful to determine the quality of the data signal received in the most recent minute. It is normal to drop a couple of data bits even under good signal conditions and increasing numbers as conditions worsen. While the decoder performs moderately well even with half the bits are in error in any minute, usually by that point the metric drops below threshold and the decoder switches to a different frequency.
    freq
    The frequency offset is the current estimate of the codec frequency offset to within 0.1 PPM. This may wander a bit over the day due to local temperature fluctuations and propagation conditions.
    avg
    The averaging time is the interval between frequency updates in powers of two to a maximum of 1024 s. Attainment of the maximum indicates the driver is operating at the best possible resolution in time and frequency.

    An example timecode is:

    0 2000 006 22:36:00 S +3 1 115 WV20 86 5 66.4 1024

    Here the clock has been set and no alarms are raised. The year, day and time are displayed along with no leap warning, standard time and DUT +0.3 s. The clock was set on the last minute, the AGC is safely in the middle ot the range 0-255, and the receiver is tracking WWV on 20 MHz. Good receiving conditions prevail, as indicated by the metric 86 and 5 bit errors during the last minute. The current frequency is 66.4 PPM and the averaging interval is 1024 s, indicating the maximum precision available.

    Fudge Factors

    time1 time
    Specifies the propagation delay for WWV (40:40:49.0N 105:02:27.0W), in seconds and fraction, with default 0.0.
    time2 time
    Specifies the propagation delay for WWVH (21:59:26.0N 159:46:00.0W), in seconds and fraction, with default 0.0.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Ordinarily, this field specifies the driver reference identifier; however, the driver sets the reference identifier automatically as described above.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Specifies the microphone port if set to zero or the line-in port if set to one. It does not seem useful to specify the compact disc player port.
    flag3 0 | 1
    Enables audio monitoring of the input signal. For this purpose, the speaker volume must be set before the driver is started.
    flag4 0 | 1
    Enable verbose clockstats recording if set.

    ntp-4.2.6p5/html/drivers/driver10.html0000644000175000017500000000610611307651604016563 0ustar peterpeter Austron 2200A/2201A GPS Receivers

    Austron 2200A/2201A GPS Receivers


    Synopsis

    Address: 127.127.10.u
    Reference ID: GPS
    Driver ID: GPS_AS2201
    Serial Port: /dev/gpsu; 9600 baud, 8-bits, no parity
    Features: tty_clk

    Description

    This driver supports the Austron 2200A/2201A GPS/LORAN Synchronized Clock and Timing Receiver connected via a serial port. It supports several special features of the clock, including the Input Buffer Module, Output Buffer Module, IRIG-B Interface Module and LORAN Assist Module. It requires the RS232 Buffered Serial Interface module for communication with the driver.

    For use with a single computer, the receiver can be connected directly to the receiver. For use with multiple computers, one of them is connected directly to the receiver and generates the polling messages. The other computers just listen to the receiver output directly or through a buffer amplifier. For computers that just listen, fudge flag2 must be set and the ppsclock streams module configured on each of them.

    This receiver is capable of a comprehensive and large volume of statistics and operational data. The specific data collection commands and attributes are embedded in the driver source code; however, the collection process can be enabled or disabled using the flag4 flag. If set, collection is enabled; if not, which is the default, it is disabled. A comprehensive suite of data reduction and summary scripts is in the ./scripts/stats directory

    of the ntp3 distribution.

    Monitor Data

    When enabled by the flag4 fudge flag, every received timecode is written as-is to the clockstats file.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default GPS.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Set for computers that listen-only.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Enable verbose clockstats recording if set.

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/driver5.html0000644000175000017500000001236210441361216016503 0ustar peterpeter TrueTime GPS/GOES/OMEGA Receivers

    TrueTime GPS/GOES/OMEGA Receivers


    Synopsis

    Address: 127.127.5.u
    Reference ID: GPS, OMEGA, GOES
    Driver ID: TRUETIME
    Serial Port: /dev/trueu; 9600 baud, 8-bits, no parity
    Features: tty_clk

    Description

    This driver supports several models models of Kinemetrics/TrueTime timing receivers, including 468-DC MK III GOES Synchronized Clock, GPS- DC MK III and GPS/TM-TMD GPS Synchronized Clock, XL-DC (a 151-602-210, reported by the driver as a GPS/TM-TMD), GPS-800 TCU (an 805-957 with the RS232 Talker/Listener module), OM-DC OMEGA Synchronized Clock, and very likely others in the same model family that use the same timecode formats.

    Most of this code is originally from refclock_wwvb.c with thanks. It has been so mangled that wwvb is not a recognizable ancestor.

    Timcode format: ADDD:HH:MM:SSQCL A - control A (this is stripped before we see it) Q - Quality indication (see below) C - Carriage return L - Line feed Quality codes indicate possible error of

    468-DC GOES Receiver
    GPS-TM/TMD Receiver
    ? +/- 500 milliseconds # +/- 50 milliseconds
    * +/- 5 milliseconds . +/- 1 millisecond
    space less than 1 millisecond
    OM-DC OMEGA Receiver:
    > +/- 5 seconds
    ? +/- 500 milliseconds # +/- 50 milliseconds
    * +/- 5 milliseconds . +/- 1 millisecond
    A-H less than 1 millisecond. Character indicates which station is being received as follows
    A = Norway, B = Liberia, C = Hawaii, D = North Dakota, E = La Reunion, F = Argentina, G = Australia, H = Japan
    The carriage return start bit begins on 0 seconds and extends to 1 bit time.

    Notes on 468-DC and OMEGA receiver:

    Send the clock a R or C and once per second a timestamp will appear. Send a R to get the satellite position once (GOES only).

    Notes on the 468-DC receiver:

    Since the old east/west satellite locations are only historical, you can't set your clock propagation delay settings correctly and still use automatic mode. The manual says to use a compromise when setting the switches. This results in significant errors. The solution; use fudge time1 and time2 to incorporate corrections. If your clock is set for 50 and it should be 58 for using the west and 46 for using the east, use the line

    fudge 127.127.5.0 time1 +0.008 time2 -0.004

    This corrects the 4 milliseconds advance and 8 milliseconds retard needed. The software will ask the clock which satellite it sees.

    The PCL720 from PC Labs has an Intel 8253 look-alike, as well as a bunch of TTL input and output pins, all brought out to the back panel. If you wire a PPS signal (such as the TTL PPS coming out of a GOES or other Kinemetrics/Truetime clock) to the 8253's GATE0, and then also wire the 8253's OUT0 to the PCL720's INPUT3.BIT0, then we can read CTR0 to get the number of microseconds since the last PPS upward edge, mediated by reading OUT0 to find out if the counter has wrapped around (this happens if more than 65535us (65ms) elapses between the PPS event and our being called.)

    Monitor Data

    When enabled by the flag4 fudge flag, every received timecode is written as-is to the clockstats file.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, to be used for the West satellite, with default 0.0.
    time2 time
    . Specifies the time offset calibration factor, in seconds and fraction, to be used for the East satellite, with default 0.0.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default TRUE.
    flag1 0 | 1
    Silence the clock side of ntpd, just reading the clock without trying to write to it.
    flag2 0 | 1
    Generate a debug file /tmp/true%d.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Not used by this driver.

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/driver38.html0000644000175000017500000001267710441361216016602 0ustar peterpeter hopf clock drivers by ATLSoft

    hopf Serial Line Receivers (6021 and  kompatible)


    Synopsis

    Address:  
    127.127.38.X
    Reference ID:  
    .hopf. (default), GPS, DCF
    Driver ID:  
    HOPF_S
    Serial Port:  
    /dev/hopfclockX
    Serial I/O:  
    9600 baud, 8-bits, 1-stop, no parity
    gif

    Description

    The refclock_hopf_serial driver supports hopf electronic receivers with serial Interface kompatibel 6021.

    Additional software and information about the software drivers is available from: http://www.ATLSoft.de/ntp.

    Latest NTP driver source, executables and documentation is maintained at: http://www.ATLSoft.de/ntp


    Operating System Compatibility

    The hopf clock driver has been tested on the following software and hardware platforms:
     

    Platform

    Operating System

    i386 (PC) 

    Linux

    i386 (PC) 

    Windows NT

    i386 (PC) 

    Windows 2000

    O/S Serial Port Configuration

    The driver attempts to open the device /dev/hopfclockX where X is the NTP refclock unit number as defined by the LSB of the refclock address.  Valid refclock unit numbers are 0 - 3.

    The user is expected to provide a symbolic link to an available serial port device.  This is typically performed by a command such as:

    ln -s /dev/ttyS0 /dev/hopfclock0
    Windows NT does not support symbolic links to device files. 
    COMx: is used by the driver, based on the refclock unit number, where unit 1 corresponds to COM1: and unit 3 corresponds to COM3:
     

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. Should be set to 20 milliseconds to correct serial line and operating system delays incurred in capturing time stamps from the synchronous packets.
    refid string
    Specifies the driver reference identifier, GPS or DCF.
    flag1 0 | 1
    When set to 1, driver sync's even if only crystal driven.

    Data Format

    as specified in clock manual under pt. [ Data String for NTP ( Network Time Protocol ) ]


    Questions or Comments:

    Bernd Altmeier
    Ing.-Büro für Software www.ATLSoft.de

    (last updated 02/28/2001)
     


    ntp-4.2.6p5/html/drivers/driver1.html0000644000175000017500000000611211307651604016500 0ustar peterpeter Undisciplined Local Clock

    Undisciplined Local Clock


    Synopsis

    Address: 127.127.1.u
    Reference ID: LCL
    Driver ID: LOCAL

    Description

    Not: This driver is not recommended for new installations. A much more flexible replacement is available in the form of orphan mode described on the Association Management page.

    This driver is intended for use in an isolated network where no external source of synchronization such as a radio clock or modem is available. It allows a designated time server to act as a primary server to provide synchronization to other clients on the network. Pick a machine that has a good clock oscillator (Digital machines are good, Sun machines are not) and configure it with this driver. Set the clock using the best means available, like eyeball-and-wristwatch. Then, point all the other machines at this one or use broadcast mode to distribute time.

    Another application for this driver is if a particular server clock is to be used as the clock of last resort when all other normal synchronization sources have gone away. This is especially useful if that server has an ovenized oscillator. For this you would usually, but not necessarily, configure this driver at a stratum greater than any other likely sources of time, such as the default 5 for this driver, to prevent this driver taking over when legitimate sources elsewher in the network are available. To further protect the Internet infrastructure from accidental or malicious exposure to this driver, the driver is desabled if another source is available and operating.

    Monitor Data

    No filegen clockstats monitor data are produced by this driver.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Specifies the frequency offset calibration factor, in parts per million, with default 0.0.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 3.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default LCL.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Not used by this driver.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Not used by this driver.

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/driver29.html0000644000175000017500000011472311307651605016603 0ustar peterpeter Trimble Palisade and Thunderbolt Receivers

    Trimble Palisade and Thunderbolt Receivers

    gif

    jpg

    Synopsis

    Address: 
    127.127.29.u
    Reference ID:
    GPS
    Driver ID:
    GPS_PALISADE
    Serial Port:
    /dev/palisadeu
    Serial I/O:
    9600 baud, 8-bits, 1-stop, odd parity
    Serial I/O (Thunderbolt):
    9600 baud, 8-bits, 1-stop, no parity

    Description

    The refclock_palisade driver supports Trimble Navigation's Palisade Smart Antenna GPS receiver.
    Additional software and information about the Palisade GPS is available from: http://www.trimble.com/oem/ntp.
    Latest NTP driver source, executables and documentation is maintained at: ftp://ftp.trimble.com/pub/ntp

    This documentation describes version 7.12 of the GPS Firmware and version 2.46 (July 15, 1999) and later, of the driver source.
     

    This documentation describes version 1 of the Thunderbolt Receiver Firmware, no tests have been made on further firmwares, please read "Notes on the Thunderbolt Receiver's Firmware" at the end of this documentation for more information.

    Operating System Compatibility

    The Palisade driver has been tested on the following software and hardware platforms:
     
    Platform Operating System NTP Sources Accuracy
    i386 (PC)  Linux NTP Distribution 10 us
    i386 (PC)  Windows NT ftp://ftp.trimble.com/pub/ntp 1 ms
    SUN Solaris 2.x NTP Distribution 50 us
    Hewlett-Packard HPUX 9, 10, 11 http://us-support.external.hp.com 50 us
    Various Free BSD NTP Distribution 20 us

    Attention: Thunderbolt Receiver has not being tested on the previous software and hardware plataforms.

    GPS Receiver

    The Palisade GPS receiver is an 8-channel smart antenna, housing the GPS receiver, antenna and interface in a single unit, and is designed for rooftop deployment in static timing applications.

    Palisade generates a PPS synchronized to UTC within +/- 100 ns.  The Palisade's external event input with 40 nanosecond resolution is utilized by the Palisade NTP driver for asynchronous precision time transfer.

    No user initialization of the receiver is required. This driver is compatible with the following versions of Palisade:
     

    Version
    Event Input
    Trimble Part Number
    7.02
    No
    26664-00
    7.02E
    Yes
    26664-10
    7.12
    Yes
    38158-00
    Note: When using Palisade 26664-00, you must set fudge flag2 to 1 in ntp.conf. See configuration.

    GPS Installation

    A location with unobstructed view of the horizon is recommended. Palisade is designed to be securely mounted atop standard 3/4 inch threaded pipe.

    The 12 conductor (dia. 10 mm)  power and I/O cable must be routed from the rooftop site to the NTP server and properly strain relieved.

    GPS Connection

    The Palisade is equipped with dual (A & B) RS-422 serial interfaces and a differential TTL PPS output. An RS-232 / RS-422 Interface Module is supplied with the Palisade NTP Synchronization Kit. Palisade port A must be connected to the NTP host server. Maximum antenna cable length is 500 meters. See the pinouts table for detailed connection Information.

    Palisade's port B provides a TSIP (Trimble Standard Interface Protocol) interface for diagnostics, configuration, and monitoring. Port B and the PPS output are not currently used by the Palisade NTP reference clock driver.
     

    O/S Serial Port Configuration

    The driver attempts to open the device /dev/palisadeu where u is the NTP refclock unit number as defined by the LSB of the refclock address.  Valid refclock unit numbers are 0 - 3.

    The user is expected to provide a symbolic link to an available serial port device.  This is typically performed by a command such as:

    ln -s /dev/ttyS0 /dev/palisade0
    Windows NT does not support symbolic links to device files. COMx: is used by the driver, based on the refclock unit number, where unit 1 corresponds to COM1: and unit 3 corresponds to COM3:
     

    NTP Configuration

    Palisade NTP configuration file "ntp.conf" with event polling:
    #------------------------------------------------------------------------------
    # The Primary reference
    server 127.127.29.0 # Trimble Palisade GPS Refclock Unit #0
    peer terrapin.csc.ncsu.edu # internet server
    # Drift file for expedient re-synchronization after downtime or reboot.
    driftfile /etc/ntp.drift
    #------------------------------------------------------------------------------

    Configuration without event polling:
    #------------------------------------------------------------------------------
    # The Primary reference
    server 127.127.29.0 # Trimble Palisade GPS (Stratum 1).
    # Set packet delay
    fudge 127.127.29.0 time1 0.020
    # and set flag2 to turn off event polling.
    fudge 127.127.29.0 flag2 1
    #------------------------------------------------------------------------------
     

    Thunderbolt NTP Configuration file

    #------------------------------------------------------------------------------

    Configuration without event polling:
    #------------------------------------------------------------------------------
    # The Primary reference
    server 127.127.29.0 mode 2 # Trimble Thunderbolt GPS (Stratum 1).
    # Set packet delay
    fudge 127.127.29.0 time1 0.020
    # and set flag2 to turn off event polling.
    fudge 127.127.29.0 flag2 1
    #------------------------------------------------------------------------------
     

    Currently the Thunderbolt mode doesn't support event polling, the reasons are explained on the "Notes on the Thunderbolt Receiver's Firmware" section at the end of this documentation.

    Time Transfer and Polling

    Time transfer to the NTP host is performed via the Palisade's comprehensive time packet output. The time packets are output once per second, and whenever an event timestamp is requested.

    The driver requests an event time stamp at the end of each polling interval, by pulsing the RTS (request to send) line on the serial port. The Palisade GPS responds with a time stamped event packet.

    Time stamps are reported by the Palisade with respect to UTC time. The GPS receiver must download UTC offset information from GPS satellites. After an initial UTC download, the receiver will always start with correct UTC offset information.
     

    Run NTP in Debugging Mode

    The following procedure is recommended for installing and testing a Palisade NTP driver:
    1. Perform initial checkout procedures. Place the GPS receiver outdoors; with clear view of the sky. Allow the receiver to obtain an UTC almanac.
    2. Verify presence of timing packets by observing the 1 Hz (PPS) led on the interface module. It should flash once per second.
    3. Connect Palisade's port A to the NTP host.
    4. Configure NTP and the serial I/O port on the host system.
    5. Initially use fudge flag2 in ntp.conf, to disable event polling (see configuration).
    6. Run NTP in debug mode (-d -d), to observe Palisade_receive events.
    7. The driver reports the tracking status of the receiver. Make sure it is tracking several satellites.
    8. Remove fudge flag2 and restart ntpd in debug mode to observe palisade_receive events.
    9. If event polling fails, verify the connections and that the host hardware supports RTS control.

    Event Logging

    System and Event log entries are generated by NTP to report significant system events. Administrators should monitor the system log to observe NTP error messages. Log entries generated by the Palisade NTP reference clock driver will be of the form:
    Nov 14 16:16:21 terrapin ntpd[1127]: Palisade #0: message

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. If event capture is not used, time1 should be set to 20 milliseconds to correct serial line and operating system delays incurred in capturing time stamps from the synchronous packets.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, GPS.
    flag2 0 | 1
    When set to 1, driver does not use hardware event capture. The synchronous packet output by the receiver at the beginning of each second is time stamped by the driver. If triggering the event pulse fails, the driver falls back to this mode automatically.

    Mode Parameter

    mode number
    The mode parameter to the server command specifies the specific hardware this driver is for. The default is 0 for a normal Trimble Palisade. The other options are 1 for an Endrun Praecis in Trimble emulation mode, and 2 for the Trimble Thunderbolt GPS Disciplined Clock Receiver.

    DEFINEs

    The following constants are defined in the driver source code. These defines may be modified to improve performance or adapt to new operating systems.
     
    Label Definition Default Value
    DEVICE The serial port device to be used by the driver /dev/palisadeu
    PRECISION Accuracy of time transfer 1 microsecond
    CURRENT_UTC Valid GPS - UTC offset 13
    SPEED232 Host RS-232 baud rate B9600
    TRMB_MINPOLL  Minimum polling interval 5 (32 seconds)
    TRMB_MAXPOLL Maximum interval between polls 7 (128 seconds)

    Data Format

    Palisade port A can output two synchronous time packets. The NTP driver can use either packet for synchronization. Packets are formatted as follows:

    Packet 8F-AD (Primary NTP Packet)

    Byte Item Type Meaning
    0 Sub-Packet ID BYTE Subcode 0xAD
    1 - 2 Event Count INTEGER External event count recorded (0 = PPS)
    3 - 10 Fractional Second DOUBLE Time elapsed in current second (s)
    11 Hour BYTE Hour (0 - 23)
    12 Minute BYTE Minute (0 - 59)
    13 Second BYTE Second (0 - 59; 60 = leap)
    14 Day BYTE Date (1 - 31)
    15 Month BYTE Month (1 - 12)
    16 - 17 Year INTEGER Year (4 digit)
    18 Receiver Status BYTE Tracking Status
    19 UTC Flags BYTE Leap Second Flags
    20 Reserved BYTE Contains 0xFF
    21 Reserved BYTE Contains 0xFF

    Leap Second Flag Definition:

    Bit 0:  (1) UTC Time is available
    Bits 1 - 3: Undefined
    Bit 4:  (1) Leap Scheduled: Leap second pending asserted by GPS control segment.
    Bit 5:  (1) Leap Pending: set 24 hours before, until beginning of leap second.
    Bit 6:  (1) GPS Leap Warning: 6 hours before until 6 hours after leap event
    Bit 7:  (1) Leap In Progress. Only set during the leap second.

    Tracking Status Flag Definitions:

    Code Meaning Accuracy Receiver Mode
    0 Receiver is Navigating +/- 1 us Self Survey
    1 Static 1 Sat. Timing Mode  +/- 1 us 1-D Timing
    2 Approximate Time 20 - 50 ms Acquisition
    3 Startup N/A Initialization
    4 Startup N/A Initialization
    5 Dilution of Position too High  5 ppm Self Survey
    6 Static 1 Sat. Timing: Sat. not usable 5 ppm 1-D Timing
    7 No Satellites Usable N/A Self Survey
    8 Only 1 Satellite Usable 20 - 50 ms Self Survey
    9 Only 2 Satellite Usable 20 - 50 ms Self Survey
    10 Only 3 Satellites Usable 20 - 50 ms Self Survey
    11 Invalid Solution N/A Error
    12 Differential Corrections  N/A N/A
    13 Overdetermined Fixes +/- 100 ns Timing Steady State

    Packet 8F-0B (Comprehensive Timing Packet)

    Byte Item Type Meaning
    0 Sub-Packet ID BYTE Subcode 0x0B
    1 - 2 Event Count INTEGER External event count recorded (0 = PPS)
    3 - 10 UTC / GPS TOW DOUBLE UTC / GPS time of week (seconds)
    11 Date BYTE Day of Month
    12 Month BYTE Month of Event
    13 - 14 Year INT Year of event
    15 Receiver Mode BYTE Receiver operating dimensions: 
    0: Horizontal (2D) 
    1: Full Position (3D) 
    2: Single Satellite (0D) 
    3: Automatic (2D / 3D) 
    4: DGPS reference 
    5: Clock hold (2D) 
    6: Over determined Clock
    15 - 17 UTC Offset INTEGER UTC Offset value (seconds)
    18 - 25 Oscillator Bias DOUBLE Oscillator BIAS (meters)
    26 - 33 Oscillator Drift Rate DOUBLE Oscillator Drift (meters / second)
    34 - 37 Bias Uncertainty SINGLE Oscillator bias uncertainty (meters)
    38 - 41 Drift Uncertainty SINGLE Oscillator bias rate uncertainty (m / sec)
    42 - 49 Latitude DOUBLE Latitude in radians
    50 - 57 Longitude DOUBLE Longitude in radians
    58 - 65 Altitude DOUBLE Altitude above mean sea level, in meters
    66 - 73 Satellite ID BYTE SV Id No. of tracked satellites

    Thunderbolt Timing packets Data Format

    Thunderbolt can output 2 synchronous packets.

    Primary Timing Packet - 0x8FAB

    Byte Bit Item Type Value Description
    0 Subcode UINT8 0xAB
    1-4 Time of Week UINT32 GPS seconds of week
    5-6 Week Number UINT16 GPS Week Number
    7-8 UTC Offset SINT16 UTC Offset (seconds)
    9
    0
    1
    2
    3
    4
    Timing Flag Bit field
    0 or 1
    0 or 1
    0 or 1
    0 or 1
    0 or 1
    GPS Time or UTC Time
    GPS PPS or UTC PPS
    time is set or time is not set
    have UTC info or no UTC info
    Time from GPS or time from user
    10 Seconds UINT8 0-59 (60 for UTC leap second event)
    11 Minutes UINT8 0-59 Minutes of Hour
    12 Hours UINT8 0-23 Hour of Day
    13 Day of Month UINT8 1-31 Day of Month
    14 Month UINT8 1-12 Month of Year
    15-16 Year UINT16 Four digits of Year (e.g. 1998)

    Supplemental Timing Packet - 0x8FAC

    Byte Bit Item Type Value Description
    0 Subcode UINT8 0xAC
    1 Receiver Mode UINT8
    0
    1
    2
    3
    4
    5
    6
    Automatic (2D/3D)
    Single Satellite (Time)
    Horizontal (2D)
    Full Position (3D)
    DGPS Reference
    Clock Hold (2D)
    Overdetermined Clock
    2 Disciplining Mode UINT8
    0
    1
    2
    3
    4
    5
    6
    Normal
    Power-Up
    Auto Holdover
    Manual Holdover
    Recovery
    Not Used
    Disciplining disabled
    3 Self-Survey Progress UINT 8 0-100%
    4-7 Holdover Duration UINT 32 seconds
    8-9
    0
    1
    2
    3
    4
    Critical Alarms UINT16 Bit field
    ROM checksum error
    RAM check has failed
    Power supply failure
    FPGA check has failed
    Oscillator control voltage at rail
    10-11
    0
    1
    2
    3
    4
    5
    6
    Minor Alarms UINT16 Bit field
    Normal
    Power-Up
    Auto Holdover
    Manual Holdover
    Recovery
    Not Used
    Disciplining disabled
    12 GPS Decoding Status UINT8
    0
    1
    3
    8
    9
    0x0A
    0x0B
    0x0C
    0x10
    Doing fixes
    Don t have GPS time
    PDOP is too high
    No usable sats
    Only 1 usable sat
    Only 2 usable sats
    Only 3 usable sats
    The chosen sat is unusable
    TRAIM rejected the fix
    13 Disciplining Activity UINT8
    0
    1
    2
    3
    4
    5
    6
    7
    8
    Phase locking
    Oscillator warming up
    Frequency locking
    Placing PPS
    Initializing loop filter
    Compensating OCXO
    Inactive
    Not used
    Recovery mode
    14 Spare Status 1 UINT8 0
    15 Spare Status 2 UINT8 0
    16-19 PPS Offset Single Estimate of UTC/GPS offset (ns)
    20-23 10 MHz Offset Single Estimate of UTC/GPS offset (ns)
    24-27 DAC Value UINT32 Offset binary (0x00 - 0xFFFFF)
    28-31 DAC Voltage Single Volts
    32-35 Temperature Single degrees C
    36-43 Latitude Double radians
    44-51 Longitude Double radians
    52-59 Altitude Double Meters
    60-67 Spare For Future Expantion

    Pinouts

    The following connections are required when connecting Palisade with a host:
     
     
    Description Host Palisade 
    Port A DB-9 DB-25 RS-232 RS-422 Palisade Pin
    Receive Data  2 3 <--> Green Green / Blue 8 (T-) & 10 (T+)
    Request to Send 7 4 <--> Gray Gray / White 6 (R-) & 7 (R+)
    Signal Ground 5 7 <--> Black Black 9 (GND)
    Port B
    Receive Data  2 3 <--> Brown Brown / Yellow 4 (T-) & 5 (T+)
    Transmit Data 3 2 <--> Violet Orange/ Violet 2 (R-) & 3 (R+)
    Signal Ground 5 7 <--> Black Black 9 (GND)
    Note: If driving the RS-422 inputs on the Palisade single ended, i.e. using the Green and Gray connections only, does not work on all serial ports. Use of the Palisade NTP Synchronization Interface Module is recommended.
    The 12 pin connector pinout definition:
    Face the round 12 pin connector at the end of the cable, with the notch turned upwards.
    Pin 1 is to the left of the notch. Pins 2 - 8 wrap around the bottom, counterclockwise to pin 9 on the right of the notch. Pin 10 is just below the notch. Pins 10 (top), 11 (bottom left) and 12 (bottom right) form a triangle in the center of the connector.
    Pinouts for the Palisade NTP host adapter (Trimble PN 37070) DB-25 M connector are as follows:
    DB-25M Conductor  Palisade Description
    Red 1 Power
    Black 9 Ground
    9 Black/White 12 PPS -
    10  Green 8 Transmit Port A (T-)
    11  Brown 4 Transmit Port B (T-)
    12  Gray 7 Receive Port A (R+)
    13 Orange 3 Receive Port B (R+)
    21 Orange/White 11 PPS +
    22 Blue 10 Transmit Port A (T+)
    23 Yellow 5 Transmit Port B (T+)
    24 White 6 Receive Port A (R-)
    25 Violet 2 Receive Port B (R-)

    Notes on the Thunderbolt Receiver's Firmware

    The support for Thunderbolt Receiver in the palisade driver doesn't support (for now) event-polling, the reason is that the Thunderbolt receiver the patch is written for doesn't support time-on-request, so you just have to sit there and wait for the time to arrive with the PPS. We tried to contact Trimble because there's presumably a firmware update that support it, but we didn't have much luck. Here is a link explaining the situation:

    https://lists.ntp.isc.org/pipermail/hackers/2006-April/002216.html


    Questions or Comments:
    Sven Dietrich
    Trimble Navigation Ltd.

    Fernando P. Hauscarriaga

    (last updated January 15, 2007)


    ; ntp-4.2.6p5/html/drivers/driver12.html0000644000175000017500000000541010054623676016570 0ustar peterpeter KSI/Odetics TPRO/S IRIG Interface

    KSI/Odetics TPRO/S IRIG Interface


    Synopsis

    Address: 127.127.12.u
    Reference ID: IRIG
    Driver ID: IRIG_TPRO
    TPRO Device: /dev/tprou
    Requires: KSI/Odetics device driver, /usr/include/sys/tpro.h header file

    Description

    This driver supports the KSI/Odetics TPRO and TPRO-SAT IRIG-B Decoder, which is a module connected directly to the SBus of a Sun workstation. The module works with the IRIG-B signal generated by several radio clocks, including those made by Arbiter, Austron, Odetics, Spectracom and TrueTime, among others, although it is generally an add- on option. In the case of the TPRO-SAT, the module is an integral part of a GPS receiver, which serves as the primary timing source.

    Using the TPRO interface as a NTP reference clock provides precision time only to ntpd and its clients. With suitable kernel modifications, it is possible to use the TPRO as the CPU system clock, avoiding errors introduced by the CPU clock oscillator wander. See the A Kernel Model for Precision Timekeeping page for further details.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default IRIG.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Not used by this driver.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Not used by this driver.

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/driver35.html0000644000175000017500000000515210441361215016564 0ustar peterpeter Conrad parallel port radio clock

    Conrad parallel port radio clock


    Synopsis

    Address: 127.127.35.u
    Reference ID: PCF
    Driver ID: PCF
    Parallel Port: /dev/pcfclocks/u or /dev/pcfclocku

    Description

    This driver supports the parallel port radio clock sold by Conrad Electronic under order numbers 967602 and 642002. This clock is put between a parallel port and your printer. It receives the legal German time, which is either CET or CEST, from the DCF77 transmitter and uses it to set its internal quartz clock. The DCF77 transmitter is located near to Frankfurt/Main and covers a radius of more than 1500 kilometers.

    The pcfclock device driver is required in order to use this reference clock driver. Currently device drivers for Linux and FreeBSD are available.

    This driver uses C library functions to convert the received timecode to UTC and thus requires that the local timezone be CET or CEST. If your server is not located in Central Europe you have to set the environment variable TZ to CET before starting ntpd.

    Monitor Data

    Each timecode is written to the clockstats file in the format YYYY MM DD HH MI SS.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.1725.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default PCF.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    If set to 1, the radio clock's synchronisation status bit is ignored, ie the timecode is used without a check.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Not used by this driver.

    ntp-4.2.6p5/html/drivers/driver8.html0000644000175000017500000005067111616416167016526 0ustar peterpeter Generic Reference Driver

    Generic Reference Driver


    Synopsis

    Address: 127.127.8.u
    Reference ID: PARSE
    Driver ID: GENERIC
    Serial Port: /dev/refclock-u; TTY mode according to clock type
    PPS device: /dev/refclockpps-u; alternate PPS device (if not available via the serial port)

    Description

    The PARSE driver supports 20 different clock types/configurations. PARSE is actually a multi-clock driver.

    The actual receiver status is mapped into various synchronization states generally used by receivers. The driver is configured to interpret the time codes of Meinberg DCF77 AM receivers, DCF77 FM receivers, Meinberg GPS16x/17x receivers, Trimble SV6 GPS, ELV DCF7000, Schmid, Wharton 400A and low cost receivers (see list below).

    The reference clock support in NTP contains the necessary configuration tables for those receivers. In addition to supporting several different clock types and up to 4 devices, the processing of a PPS signal is also provided as a configuration option. The PPS configuration option uses the receiver-generated time stamps for feeding the PPS loopfilter control for much finer clock synchronization.

    CAUTION: The PPS configuration option is different from the hardware PPS signal, which is also supported (see below), as it controls the way ntpd is synchronized to the reference clock, while the hardware PPS signal controls the way time offsets are determined.

    The use of the PPS option requires receivers with an accuracy of better than 1ms.

    Timecode variables listed by ntpq (8)

    The ntpq program can read and display several clock variables. These hold the following information:

    refclock_format
    A qualification of the decoded time code format.
    refclock_states
    The overall running time and the accumulated times for the clock event states.
    refclock_status
    Lists the currently active receiver flags. Additional feature flags for the receiver are optionally listed in parentheses.
    refclock_time
    The local time with the offset to UTC (format HHMM).
    timecode
    The actual time code.

    If PPS information is present, additional variables are available:

    refclock_ppsskew
    The difference between the RS-232-derived timestamp and the PPS timestamp.
    refclock_ppstime
    The PPS timestamp.

    Supported Devices

    Currently, nineteen clock types (devices /dev/refclock-0 - /dev/refclock-3) are supported by the PARSE driver.
    A note on the implementations:

    • These implementations were mainly done without actual access to the hardware, thus not all implementations provide full support. The development was done with the help of many kind souls who had the hardware and kindly lent me their time and patience during the development and debugging cycle. Thus for continued support and quality, direct access to the receivers is a big help. Nevertheless I am not prepared to buy these reference clocks - donations to (kardel <AT> ntp.org) are welcome as long as they work within Europe 8-).

      Verified implementations are:

      • RAWDCF variants

        These variants have been tested for correct decoding with my own homegrown receivers. Interfacing with specific commercial products may involve some fiddling with cables. In particular, commercial RAWDCF receivers have a seemingly unlimited number of ways to draw power from the RS-232 port and to encode the DCF77 datastream. You are mainly on your own here unless I have a sample of the receiver.

      • Meinberg clocks

        These implementations have been verified by the Meinberg people themselves and I have access to one of these clocks.

    The pictures below have been taken from and are linked to the vendors' web pages.

    • server 127.127.8.0-3 mode 0

      Meinberg PZF5xx receiver family (FM demodulation/TCXO / 50μs)

    • server 127.127.8.0-3 mode 1

      Meinberg PZF5xx receiver family (FM demodulation/OCXO / 50μs)
      Image PZF511

    • server 127.127.8.0-3 mode 2

      Meinberg DCF C51 receiver and similar (AM demodulation / 4ms)
      Image C51

      This mode expects the Meinberg standard time string format with 9600/7E2.

      Note: mode 2 must also be used for Meinberg PCI cards under Linux, e.g. the GPS PCI card or the DCF77 PCI card. Please note the Meinberg Linux driver must be installed. That driver emulates a refclock device in order to allow ntpd to access those cards. For details, please refer to the README file that comes with the Meinberg driver package.

    • server 127.127.8.0-3 mode 3

      ELV DCF7000 (sloppy AM demodulation / 50ms)

    • server 127.127.8.0-3 mode 4

      Walter Schmid DCF receiver Kit (AM demodulation / 1ms)

    • server 127.127.8.0-3 mode 5

      RAW DCF77 100/200ms pulses (Conrad DCF77 receiver module / 5ms)

    • server 127.127.8.0-3 mode 6

      RAW DCF77 100/200ms pulses (TimeBrick DCF77 receiver module / 5ms)

    • server 127.127.8.0-3 mode 7

      Meinberg GPS16x/GPS17x receivers (GPS / <<1μs)
      Image GPS167

      This mode expects either the University of Erlangen time string format or the Meinberg standard time string format at 19200/8N1.

      The University of Erlangen format is preferred. Newer Meinberg GPS receivers can be configured to transmit that format; for older devices, a special firmware version may be available.

      In this mode some additional GPS receiver status information is also read. However, this requires a point-to-point connection. Mode 18 should be used if the device is accessed by a multidrop connection.

      Note: mode 7 must not be used with Meinberg PCI cards; use mode 2 instead.

    • server 127.127.8.0-3 mode 8

      IGEL clock
      Image IGEL clock

    • server 127.127.8.0-3 mode 9

      Trimble SVeeSix GPS receiver TAIP protocol (GPS / <<1μs)

    • server 127.127.8.0-3 mode 10

      Trimble SVeeSix GPS receiver TSIP protocol (GPS / <<1μs) (no kernel support yet)
      Image SVeeSix-CM3
      Image Lassen-SK8

    • server 127.127.8.0-3 mode 11

      Radiocode Clocks Ltd RCC 8000 Intelligent Off-Air Master Clock support

    • server 127.127.8.0-3 mode 12

      HOPF Funkuhr 6021
      Image DCF77 Interface Board

    • server 127.127.8.0-3 mode 13

      Diem's Computime Radio Clock

    • server 127.127.8.0-3 mode 14

      RAWDCF receiver (DTR=high/RTS=low)

    • server 127.127.8.0-3 mode 15

      WHARTON 400A Series Clocks with a 404.2 Serial Interface

    • server 127.127.8.0-3 mode 16

      RAWDCF receiver (DTR=low/RTS=high)

    • server 127.127.8.0-3 mode 17

      VARITEXT Receiver (MSF)

    • server 127.127.8.0-3 mode 18

      Meinberg GPS16x/GPS17x receivers (GPS / <<1μs)

      This mode works without additional data communication (version, GPS status etc.) and thus should be used with multidrop, heterogeneous multiclient operation.

      Note: mode 18 must not be used with Meinberg PCI cards, use mode 2 instead.

    • server 127.127.8.0-3 mode 19

      Gude Analog- und Digitalsystem GmbH 'Expert mouseCLOCK USB v2.0'

    • server 127.127.8.0-3 mode 20

      RAWDCF receiver similar to mode 14, but operating @ 75 baud (DTR=high/RTS=low)

      Driving the DCF clocks at 75 baud may help to get them to work with a bunch of common USB serial converters, that do 75 but cannot do 50 baud at all, e.g. those based on Prolific PL2303.

    • server 127.127.8.0-3 mode 21

      RAWDCF receiver similar to mode 16, but operating @ 75 baud (DTR=low/RTS=high)

      See comment from mode 20 clock.

    • server 127.127.8.0-3 mode 22

      MEINBERG, mode 2 but with POWERUP trust

    • server 127.127.8.0-3 mode 23

      MEINBERG, mode 7 but with POWERUP trust

    Actual data formats and setup requirements of the various clocks can be found in NTP PARSE clock data formats.

    Operation

    The reference clock support software carefully monitors the state transitions of the receiver. All state changes and exceptional events (such as loss of time code transmission) are logged via the syslog facility. Every hour a summary of the accumulated times for the clock states is listed via syslog.

    PPS support is only available when the receiver is completely synchronized. The receiver is believed to deliver correct time for an additional period of time after losing synchronization, unless a disruption in time code transmission is detected (possible power loss). The trust period is dependent on the receiver oscillator and thus is a function of clock type.

    Raw DCF77 pulses can be fed via a level converter to the RXD pin of an RS-232 serial port (pin 3 of a 25-pin connector or pin 2 of a 9-pin connector). The telegrams are decoded and used for synchronization. DCF77 AM receivers can be bought for as little as $25. The accuracy is dependent on the receiver and is somewhere between 2ms (expensive) and 10ms (cheap). Synchronization ceases when reception of the DCF77 signal deteriorates, since no backup oscillator is available as usually found in other reference clock receivers. So it is important to have a good place for the DCF77 antenna. During transmitter shutdowns you are out of luck unless you have other NTP servers with alternate time sources available.

    In addition to the PPS loopfilter control, a true PPS hardware signal can be utilized via the PPSAPI interface. PPS pulses are usually fed via a level converter to the DCD pin of an RS-232 serial port (pin 8 of a 25-pin connector or pin 1 of a 9-pin connector). To select PPS support, the mode parameter is the mode value as above plus 128. If 128 is not added to the mode value, PPS will be detected to be available but will not be used.

    Hardware PPS support

    For PPS to be used, add 128 to the mode parameter.

    If the PPS signal is fed in from a device different from the device providing the serial communication (/dev/refclock-{0..3}), this device is configured as /dev/refclockpps-{0..3}. This allows the PPS information to be fed in e.g. via the parallel port (if supported by the underlying operation system) and the date/time telegrams to be handled via the serial port.

    Monitor Data

    Clock state statistics are written hourly to the syslog service. Online information can be found by examining the clock variables via the ntpq cv command.
    Some devices have quite extensive additional information (GPS16x/GPS17x, Trimble). The driver reads out much of the internal GPS data and makes it accessible via clock variables. To find out about additional variable names, query for the clock_var_list variable on a specific clock association as shown below.

    First let ntpq display the table of associations:

      ntpq> as
      ind assID status  conf reach auth condition  last_event cnt
      ===========================================================
        1 19556  9154   yes   yes  none falsetick   reachable  5
        2 19557  9435   yes   yes  none  candidat  clock expt  3
        3 19558  9714   yes   yes  none  pps.peer   reachable  1
    		

    Then switch to raw output. This may be required because of display limitations in ntpq/ntpd - so large lists need to be retrieved in several queries.

      ntpq> raw
      Output set to raw
    		

    Use the cv command to read the list of clock variables of a selected association:

      ntpq> cv 19557 clock_var_list
    		

    The long output of the command above looks similar to:

      assID=19557 status=0x0000,
      clock_var_list="type,timecode,poll,noreply,badformat,baddata,fudgetime1,
      fudgetime2,stratum,refid,flags,device,clock_var_list,refclock_time,refclock_status,
      refclock_format,refclock_states,refclock_id,refclock_iomode,refclock_driver_version,
      meinberg_gps_status,gps_utc_correction,gps_message,meinberg_antenna_status,gps_tot_51,
      gps_tot_63,gps_t0a,gps_cfg[1],gps_health[1],gps_cfg[2],gps_health[2],gps_cfg[3],
      gps_health[3],gps_cfg[4],gps_health[4],gps_cfg[5]"
    		

    Then use the cv command again to list selected clock variables. The following command must be entered as a single line:

      ntpq> cv 19557 refclock_status,refclock_format,refclock_states,refclock_id,
      refclock_iomode,refclock_driver_version,meinberg_gps_status,gps_utc_correction,
      gps_message,meinberg_antenna_status,gps_tot_51,gps_tot_63,gps_t0a,gps_cfg[1],
      gps_health[1],gps_cfg[2],gps_health[2],gps_cfg[3],gps_health[3],gps_cfg[4],
      gps_health[4],gps_cfg[5]
    		

    The output of the command above is wrapped around depending on the screen width and looks similar to:

      status=0x0003,
      refclock_status="UTC DISPLAY; TIME CODE; PPS; POSITION; (LEAP INDICATION;
      PPS SIGNAL; POSITION)",
      refclock_format="Meinberg GPS Extended",
      refclock_states="*NOMINAL: 21:21:36 (99.99%); FAULT: 00:00:03 (0.00%);
      running time: 21:21:39",
      refclock_id="GPS", refclock_iomode="normal",
      refclock_driver_version="refclock_parse.c,v 4.77 2006/08/05 07:44:49
      kardel RELEASE_20060805_A",
      meinberg_gps_status="[0x0000] <OK>",
      gps_utc_correction="current correction 14 sec, last correction
      on c7619a00.00000000  Sun, Jan  1 2006  0:00:00.000",
      gps_message="/PFU3SOP-4WG14EPU0V1KA",
      meinberg_antenna_status="RECONNECTED on 2006-07-18 08:13:20.0000000 (+0000)
      UTC CORR, LOCAL TIME, reconnect clockoffset +0.0000000 s,
      disconnect time 0000-00-00 00:00:00.0000000 (+0000) ",
      gps_tot_51="week 1400 + 3 days + 42300.0000000 sec",
      gps_tot_63="week 1400 + 3 days + 42294.0000000 sec",
      gps_t0a="week 1400 + 5 days + 71808.0000000 sec",
      gps_cfg[1]="[0x9] BLOCK II", gps_health[1]="[0x0] OK;SIGNAL OK",
      gps_cfg[2]="[0x0] BLOCK I", gps_health[2]="[0x3f] PARITY;MULTIPLE ERRS",
      gps_cfg[3]="[0x9] BLOCK II", gps_health[3]="[0x0] OK;SIGNAL OK",
      gps_cfg[4]="[0x9] BLOCK II", gps_health[6]="[0x0] OK;SIGNAL OK",
      gps_cfg[5]="[0x9] BLOCK II"
    		

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction. The default value depends on the clock type.
    time2 time
    If flag1 is 0, time2 specifies the offset of the PPS signal from the actual time (PPS fine tuning).
    If flag1 is 1, time2 specifies the number of seconds a receiver with a premium local oscillator can be trusted after losing synchronisation.
    stratum stratum
    The stratum for this reference clock.
    refid refid
    The refid for this reference clock.
    flag1 { 0 | 1 }
    If 0, the fudge factor time2 refers to the PPS offset.
    If 1, time2 refers to the TRUST TIME.
    flag2 { 0 | 1 }
    If flag2 is 1, sample PPS on CLEAR instead of on ASSERT.
    flag3 { 0 | 1 }
    If flag3 is 1, link kernel PPS tracking to this refclock instance.
    flag4 { 0 | 1 }
    Delete next leap second instead of adding it. (You'll need to wait a bit for that to happen 8-)
    Note about auxiliary Sun STREAMS modules (SunOS and Solaris):
    The timecode of these receivers can be sampled via a STREAMS module in the kernel. (The STREAMS module has been designed for use with Sun systems under SunOS 4.1.x or Solaris 2.3 - 2.8. It can be linked directly into the kernel or loaded via the loadable driver mechanism.) This STREAMS module can be adapted to convert different time code formats. Nowadays the PPSAPI mechanism is usually used.

    Making your own PARSE clocks

    The parse clock mechanism deviates from the way other NTP reference clocks work. For a short description of how to build parse reference clocks, see making PARSE clocks.

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/driver2.html0000644000175000017500000001106010054623676016505 0ustar peterpeter Trak 8820 GPS Receiver

    Trak 8820 GPS Receiver


    Synopsis

    Address: 127.127.2.u
    Reference ID: GPS
    Driver ID: GPS_TRAK
    Serial Port: /dev/traku; 9600 baud, 8-bits, no parity
    Features: tty_clk

    Description

    This driver supports the Trak 8820 GPS Station Clock. The claimed accuracy at the 1-PPS output is 200-300 ns relative to the broadcast signal; however, in most cases the actual accuracy is limited by the precision of the timecode and the latencies of the serial interface and operating system.

    For best accuracy, this radio requires the tty_clk line discipline, which captures a timestamp at the * on-time character of the timecode. Using this discipline the jitter is in the order of 1 ms and systematic error about 0.5 ms. If unavailable, the buffer timestamp is used, which is captured at the \r ending the timecode message. This introduces a systematic error of 23 character times, or about 24 ms at 9600 bps, together with a jitter well over 8 ms on Sun IPC-class machines.

    Using the menus, the radio should be set for 9600 bps, one stop bit and no parity. It should be set to operate in computer (no echo) mode. The timecode format includes neither the year nor leap-second warning.

    In operation, this driver sends a RQTS\r request to the radio at initialization in order to put it in continuous time output mode. The radio then sends the following message once each second:

    *RQTS U,ddd:hh:mm:ss.0,q<cr><lf>
    on-time = '*'
    ddd = day of year
    hh:mm:ss = hours, minutes, seconds
    q = quality indicator (phase error), 0-6:
         0 > 20 us
         6 > 10 us
         5 > 1 us
         4 > 100 ns
         3 > 10 ns
         2 < 10 ns
    The alarm condition is indicated by 0 at Q, which means the radio has a phase error greater than 20 us relative to the broadcast time. The absence of year, DST and leap-second warning in this format is also alarmed.

    The continuous time mode is disabled using the RQTX\r request, following which the radio sends a RQTX DONE<cr><lf> response. In the normal mode, other control and status requests are effective, including the leap-second status request RQLS<cr>. The radio responds with RQLS yy,mm,dd<cr><lf>, where yy,mm,dd are the year, month and day. Presumably, this gives the epoch of the next leap second, RQLS 00,00,00 if none is specified in the GPS message. Specified in this form, the information is generally useless and is ignored by the driver.

    Monitor Data

    When enabled by the flag4 fudge flag, every received timecode is written as-is to the clockstats file.

    Fudge Factors

    time1 time
    Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Not used by this driver.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default GPS.
    flag1 0 | 1
    Not used by this driver.
    flag2 0 | 1
    Not used by this driver.
    flag3 0 | 1
    Not used by this driver.
    flag4 0 | 1
    Not used by this driver.

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/drivers/mx4200data.html0000644000175000017500000006300111307651603016707 0ustar peterpeter MX4200 Receiver Data Format

    MX4200 Receiver Data Format


    Table of Contents


    Control Port Sentences

    The Control (CDU) Port is used to initialize, monitor, and control the receiver. The structure of the control port sentences is based on the NMEA-0183 Standard for Interfacing Marine Electronics Navigation Devices (version 1.5). For more details, please refer to the NMEA-0183 Specification available from the National Marine Electronics Association.

    Reserved characters are used to indicate the beginning and the end of records in the data stream, and to delimit data fields within a sentence. Only printable ASCII characters (Hex 20 through 7F) may be used in a sentence. Table 2 lists the reserved characters and defines their usage. Table 1 illustrates the general Magnavox proprietary NMEA sentence format.

    Table 1. Magnavox Proprietary NMEA Sentence Format

    $PMVXG,XXX,...................*CK

    Character Meaning
    $ Sentence Start Character
    P Special ID (P = Proprietary)
    MVX Originator ID (MVX = Magnavox)
    G Interface ID (G = GPS)
    XXX Sentence Type
    ... Data
    * Optional Checksum Field Delimiter
    CK Optional Checksum

    Table 2. NMEA Sentence Reserved Characters

    Character Hex Value Usage
    $ 24 Start of Sentence Identifier
    {cr}{lf} 0D 0A End of Sentence Identifier
    , 2C Sentence Delimiter
    * 2A Optional Checksum Field Delimiter

    Following the start character $, are five characters which constitute the block label of the sentence. For Magnavox proprietary sentences, this label is always PMVXG. The next field after the block label is the sentence type, consisting of three decimal digits.

    The data, delimited by commas, follows the sentence type. Note that the receiver uses a free-format parsing algorithm, so you need not send the exact number of characters shown in the examples. You will need to use the commas to determine how many bytes of data need to be retrieved.

    The notation CK shown in Table 1 symbolically indicates the optional checksum in the examples. The checksum is computed by exclusive-ORing all of the bytes between the $ and the * characters. The $, * and the checksum are not included in the checksum computation.

    Checksums are optional for Control Port input sentences, but are highly recommended to limit the effects of communication errors. Magnavox receivers always generate checksums for Control Port output sentences.

    ASCII data characters are transmitted in the following format:

    Data Bits 8 (msb always 0)
    Parity None
    Stop Bits 1

    NULL fields are fields which do not contain any data. They would appear as two commas together in the sentence format, except for the final field. Some Magnavox proprietary sentences require that the format contain NULL fields. mandatory NULL fields are identified by an '*' next to the respective field.


    Control Port Input Sentences

    These are the subset of the MX4200 control port input sentences sent by the NTP driver to the GPS receiver.

    $PMVXG,000

    Initialization/Mode Control - Part A

    Initializes the time, position and antenna height of the MX4200.

    Field Description Units Format Default Range
    1 Day   Int   1-31
    2 Month   Int   1-12
    3 Year   Int   1991-9999
    4 GMT Time HHMMSS Int   000000-235959
    5 WGS-84 Latitude DDMM.MMMM Float 0.0 0 - 8959.9999
    6 North/South Indicator   Char N N,S
    7 WGS-84 Longitude DDDMM.MMMM Float 0.0 0 - 17959.9999
    8 East/West Indicator   Char E E,W
    9 Altitude (height above Mean Sea Level) in meters (WGS-84) Meters Float 0.0 +/-99999.0
    10 Not Used        
    Example:
    $PMVXG,000,,,,,,,,,,*48
    $PMVXG,000,,,,,5128.4651,N,00020.0715,W,58.04,*4F

    $PMVXG,001

    Initialization/Mode Control - Part B

    Specifies various navigation parameters: Altitude aiding, acceleration DOP limits, and satellite elevation limits.

    Field Description Units Format Default Range
    *1 Constrain Altitude   Int 1 0=3D Only
    1=Auto
    2=2D Only
    2 Not Used        
    *3 Horizontal Acceleration Factor m/sec^2 Float 1.0 0.5-10.0
    *4 Not Used        
    *5 VDOP Limit   Int 10 1-9999
    *6 HDOP Limit   Int 10 1-9999
    7 Elevation Limit Deg Int 5 0-90
    8 Time Output Mode   Char U U=UTC
    L=Local Time
    9 Local Time Offset HHMM Int 0 +/- 0-2359
    Example:
    $PMVXG,001,3,,0.1,0.1,10,10,5,U,0*06

    $PMVXG,007

    Control Port Output Configuration

    This message enables or disables output of the specified sentence and defines the output rate. The user sends this message for each sentence that the receiver is to output.

    Field Description Units Format Default Range
    1 Control Port Output Block Label   Char    
    2 Clear Current Output List   Int   0=No
    1=Yes
    3 Add/Delete Sentence from List   Int   1=Append
    2=Delete
    4 Not Used        
    5 Sentence Output Rate Sec Int   1-9999
    6 # digits of Precision for CGA and GLL sentences   Int 2 2-4
    7 Not Used        
    8 Not Used        
    Example:
    $PMVXG,007,022,0,1,,1,,,*4F

    $PMVXG,023

    Time Recovery Configuration

    This message is used to enable/disable the time recovery feature of the receiver. The time synchronization for the 1PPS output is specified in addition to a user time bias and an error tolerance for a valid pulse. This record is accepted in units configured for time recovery. If the back panel contains a 1PPS outlet, the receiver is a time recovery unit.

    Field Description Units Format Default Range
    *1 Time Recovery Mode   Char D D=Dynamic
    S=Static
    K=Known Position
    N=No Time Recovery
    2 Time Synchronization   Char G U=UTC
    G=GPS
    3 Time Mark Mode   Char A A=Always
    V=Valid Pulses Only
    4 Maximum Time Error Nsec Int 100 50-1000
    5 User Time Bias Nsec Int 0 +/- 99999
    6 ASCII Time Message Control   Int 0 0=No Output
    1=830 to Control Port
    2=830 to Equipment Port
    7 Known Pos PRN   Int 0 1-32
    0=Track All Sats
    Example:
    $PMVXG,023,S,U,A,500,0,1,*16

    $CDGPQ,YYY

    Query From a Remote Device / Request to Output a Sentence

    Enables the controller to request a one-time transmission of a specific block label. To output messages at a periodic rate, refer to input sentence $PMVXG,007.

    Field Description Units Format Default Range
    1:CD ID of Remote Device   Char   (See NMEA-0183)
    2:GP GPS   Char   (See NMEA-0183)
    3:Q Query   Char   (See NMEA-0183)
    4:YYY Label of Desired Sentence   Char   Any Valid NMEA or Magnavox Sentence Type
    Example:
    $CDGPQ,030*5E

    Control Port Output Sentences

    These are the subset of the MX4200 control port output sentences recognized by the NTP driver.

    $PMVXG,000

    Receiver Status

    Returns the current status of the receiver including the operating mode, number of satellites visible, and the number of satellites being tracked.

    Field Description Units Format Range
    1 Current Receiver Status   Char ACQ=Reacquisition
    ALT=Constellation Selection
    IAC=Initial Acquisition
    IDL=Idle, No Satellites
    NAV=Navigating
    STS=Search The Sky
    TRK=Tracking
    2 Number of Satellites that should be Visible   Int 0-12
    3 Number of Satellites being Tracked   Int 0-12
    4 Time since Last Navigation HHMM Int 0-2359
    5 Initialization Status   Int 0=Waiting for Initialization
    1=Initialization Complete
    Example:
    $PMVXG,000,TRK,3,3,0122,1*19

    $PMVXG,021

    Position, Height, Velocity

    This sentence gives the receiver position, height, navigation mode and velocity north/east. This sentence is intended for post analysis applications.

    Field Description Units Format Range
    1 UTC Measurement Time Seconds into the week Float 0-604800.00
    2 WGS-84 Latitude DDMM.MMMM Float 0-89.9999
    3 North/South Indicator   Char N, S
    4 WGS-84 Longitude DDDMM.MMMM Float 0-179.9999
    5 East/West Indicator   Char E, W
    6 Altitude (MSL) Meters Float  
    7 Geoidal Height Meters Float  
    8 Velocity East M/Sec Float  
    9 Velocity North M/Sec Float  
    10 Navigation Mode   Int Navigating
    1=Position From a Remote Device
    2=2D
    3=3D
    4=2D differential
    5=3D differential
    Not Navigating
    51=Too Few Satellites
    52=DOPs too large
    53=Position STD too large
    54=Velocity STD too large
    55=Too many iterations for velocity
    56=Too many iterations for position
    57=3 Sat Startup failed
    Example:
    $PMVXG,021,142244.00,5128.4744,N,00020.0593,W,00054.4,0047.4,0000.1,-000.2,03*66

    $PMVXG,022

    DOPs

    This sentence reports the DOP (Dilution Of Precision) values actually used in the measurement processing corresponding to the satellites listed. The satellites are listed in receiver channel order. Fields 11-16 are output only on 12-channel receivers.

    Field Description Units Format Range
    1 UTC Measurement Time Seconds into the week Float 0-604800.00
    2 East DOP (EDOP)   Float  
    3 North DOP (NDOP)   Float  
    4 Vertical DOP (VDOP)   Float  
    5 PRN on Channel #1   Int 1-32
    6 PRN on Channel #2   Int 1-32
    7 PRN on Channel #3   Int 1-32
    8 PRN on Channel #4   Int 1-32
    9 PRN on Channel #5   Int 1-32
    10 PRN on Channel #6   Int 1-32
    11 PRN on Channel #7   Int 1-32
    12 PRN on Channel #8   Int 1-32
    13 PRN on Channel #9   Int 1-32
    14 PRN on Channel #10   Int 1-32
    15 PRN on Channel #11   Int 1-32
    16 PRN on Channel #12   Int 1-32
    Example:
    $PMVXG,022,142243.00,00.7,00.8,01.9,27,26,10,09,13,23*77

    $PMVXG,030

    Software Configuration

    This sentence contains the navigation processor and baseband firmware version numbers.

    Field Description Units Format Range
    1 Nav Processor Version Number   Char  
    2 Baseband Firmware Version Number   Char  
    Example:
    $PMVXG,030,DA35,015

    $PMVXG,101

    Control Sentence Accept/Reject

    This sentence is returned (on the Control Port) for every $PMVXG and $XXGPQ sentence that is received.

    Field Description Units Format Range
    1 Sentence ID   Char  
    2 Accept/Reject Status   Int 0=Sentence Accepted
    1=Bad Checksum
    2=Illegal Value
    3=Unrecognized ID
    4=Wrong # of fields
    5=Required Data Field Missing
    6=Requested Sentence Unavailable
    3 Bad Field Index   Int  
    4 Requested Sentence ID (If field #1 = GPQ)   Char  
    Example:
    $PMVXG,101,GPQ,0,,030*0D

    $PMVXG,523

    Time Recovery Configuration

    This sentence contains the configuration of the time recovery function of the receiver.

    Field Description Units Format Range
    1 Time Recovery Mode   Char D=Dynamic
    S=Static
    K=Known Position
    N=No Time Recovery
    2 Time Synchronization   Char U=UTC Time
    G=GPS Time
    3 Time Mark Mode   Char A=Always Output Time Pulse
    V=Only when Valid
    4 Maximum Time Error for which a time mark will be considered valid Nsec Int  
    5 User Time Bias Nsec Int  
    6 Time Message Control   Int 0=No Message
    1=830 to Control Port
    2=830 to Equipment Port
    7 Not Used      
    Example:
    $PMVXG,523,S,U,A,0500,000000,1,0*23

    $PMVXG,830

    Time Recovery Results

    This sentence is output approximately 1 second preceding the 1PPS output. It indicates the exact time of the next pulse, whether or not the time mark will be valid (based on operator-specified error tolerance), the time to which the pulse is synchronized, the receiver operating mode, and the time error of the last 1PPS output. The leap second flag (Field #11) is not output by older receivers.

    Field Description Units Format Range
    1 Time Mark Valid   Char T=Valid
    F=Not Valid
    2 Year   Int 1993-
    3 Month   Int 1-12
    4 Day Nsec Int 1-31
    5 Time HH:MM:SS Int 00:00:00-23:59:59
    6 Time Synchronization   Char U=UTC
    G=GPS
    7 Operating Mode   Char D=Dynamic
    S=Static
    K=Known Position
    8 Oscillator Offset - estimate of oscillator frequency error PPB Int  
    9 Time Mark Error of last pulse Nsec Int  
    10 User Time Bias Nsec Int  
    11 Leap Second Flag - indicates that a leap second will occur. This value is usually zero except during the week prior to a leap second occurrence, when this value will be set to +/-1. A value of +1 indicates that GPS time will be 1 second further ahead of UTC time.   Int -1,0,1
    Example:
    $PMVXG,830,T,1998,10,12,15:30:46,U,S,000298,00003,000000,01*02
    ntp-4.2.6p5/html/drivers/driver20.html0000644000175000017500000001750011307651603016563 0ustar peterpeter Generic NMEA GPS Receiver

    Generic NMEA GPS Receiver


    Synopsis

    Address: 127.127.20.u
    Reference ID: GPS
    Driver ID: GPS_NMEA
    Serial Port: /dev/gpsu; 4800 - 115200 bps, 8-bits, no parity
    Serial Port: /dev/gpsppsu; for just the PPS signal (this is tried first for PPS, before /dev/gpsu)
    Serial Port: /dev/gpsu; symlink to server:port (for nmead) Features: tty_clk

    Description

    This driver supports GPS receivers with the $GPRMC, $GPGLL, $GPGGA, $GPZDA, and $GPZDG NMEA sentences by default.  Note that Accord's custom NMEA sentence $GPZDG reports using the GPS timescale, while the rest of the sentences report UTC.  The difference between the two is a whole number of seconds which increases with each leap second insertion in UTC.  To avoid problems mixing UTC and GPS timescales, the driver disables processing of UTC sentences once $GPZDG is received.

    The driver expects the receiver to be set up to transmit at least one supported sentence every second.

    The accuracy depends on the receiver used. Inexpensive GPS models are available with a claimed PPS signal accuracy of 1 ms or better relative to the broadcast signal. However, in most cases the actual accuracy is limited by the precision of the timecode and the latencies of the serial interface and operating system.

    If the Operating System supports PPSAPI (RFC 2783), fudge flag1 1 enables its use.
     

    The various GPS sentences that this driver recognises look like this:
    (others quietly ignored)

    $GPRMC,UTC,POS_STAT,LAT,LAT_REF,LON,LON_REF,SPD,HDG,DATE,MAG_VAR,MAG_REF*CS<cr><lf>
    $GPGLL,LAT,LAT_REF,LONG,LONG_REF,UTC,POS_STAT*CS<cr><lf>
    $GPGGA,UTC,LAT,LAT_REF,LONG,LONG_REF,FIX_MODE,SAT_USED,HDOP,ALT,ALT_UNIT,GEO,G_UNIT,D_AGE,D_REF*CS<cr><lf>
    $GPZDA,UTC,DD,MM,YYYY,TH,TM,*CS<cr><lf>
    $GPZDG,GPSTIME,DD,MM,YYYY,AA.BB,V*CS<cr><lf>
    
      UTC      - Time of day on UTC timescale. Hours, minutes and seconds [fraction (opt.)]. (hhmmss[.fff])
      POS_STAT - Position status. (A = Data valid, V = Data invalid)
      LAT      - Latitude (llll.ll)
      LAT_REF  - Latitude direction. (N = North, S = South)
      LON      - Longitude (yyyyy.yy)
      LON_REF  - Longitude direction (E = East, W = West)
      SPD      - Speed over ground. (knots) (x.x)
      HDG      - Heading/track made good (degrees True) (x.x)
      DATE     - Date (ddmmyy)
      MAG_VAR  - Magnetic variation (degrees) (x.x)
      MAG_REF  - Magnetic variation (E = East, W = West)
      FIX_MODE - Position Fix Mode (0 = Invalid, >0 = Valid)
      SAT_USED - Number Satellites used in solution
      HDOP     - Horizontal Dilution of Precision
      ALT      - Antenna Altitude
      ALT_UNIT - Altitude Units (Metres/Feet)
      GEO      - Geoid/Elipsoid separation
      G_UNIT   - Geoid units (M/F)
      D_AGE    - Age of last DGPS Fix
      D_REF    - Reference ID of DGPS station
      GPSTIME  - Time of day on GPS timescale. Hours, minutes and seconds [fraction (opt.)]. (hhmmss[.f])
      DD       - Day of the month (1-31)
      MM       - Month of the year (1-12)
      YYYY     - Year
      AA.BB    - Denotes the signal strength (should be < 05.00)
      V        - GPS sync status
                '0' => INVALID time,
                '1' => accuracy of +/- 20ms,
                '2' => accuracy of +/- 100ns	
      CS       - Checksum
      <cr><lf> - Sentence terminator.

    Specific GPS sentences and bitrates may be selected by setting bits of the 'mode' in the server configuration line:
      server 127.127.20.x mode X
        bit 0 - process $GPMRC    (value = 1)
        bit 1 - process $GPGGA    (value = 2)
        bit 2 - process $GPGLL    (value = 4)
        bit 4 - process $GPZDA or $GPZDG    (value = 8)

    The default (mode 0) is to process all supported sentences, which results in the last received each cycle being used.  Multiple sentences may be selected by adding their mode bit values.  The driver uses 4800 bits per second by default.  Faster bitrates can be selected using bits 4, 5, and 6 of the mode field:

        bits 4/5/6 - select serial bitrate   (0 for 4800 - the default, 16 for 9600, 32 for 19200, 48 for 38400, 64 for 57600, 80 for 115200)

    The driver will send a $PMOTG,RMC,0000*1D<cr><lf> command each poll interval.  This is not needed on most GPS receivers because they automatically send $GPRMC every second, but helps a Motorola GPS receiver that is otherwise silent.  NMEA devices ignore commands they do not understand.

    Setting up the Garmin GPS-25XL

    Switch off all output with by sending it the following string.
    "$PGRMO,,2<cr><lf>"

    Now switch only $GPRMC on by sending it the following string.

    "$PGRMO,GPRMC,1<cr><lf>"

    On some systems the PPS signal isn't switched on by default. It can be switched on by sending the following string.

    "$PGRMC,,,,,,,,,,,,2<cr><lf>"

    Monitor Data

    The GPS sentence that is used is written to the clockstats file and available with ntpq -c clockvar.

    Fudge Factors

    time1 time
    Specifies the PPS time offset calibration factor, in seconds and fraction, with default 0.0.
    time2 time
    Specifies the serial end of line time offset calibration factor, in seconds and fraction, with default 0.0.
    stratum number
    Specifies the driver stratum, in decimal from 0 to 15, with default 0.
    refid string
    Specifies the driver reference identifier, an ASCII string from one to four characters, with default GPS.
    flag1 0 | 1
    Disable PPS signal processing if 0 (default); enable PPS signal processing if 1.
    flag2 0 | 1
    If PPS signal processing is enabled, capture the pulse on the rising edge if 0 (default); capture on the falling edge if 1.
    flag3 0 | 1
    If PPS signal processing is enabled, use the ntpd clock discipline if 0 (default); use the kernel discipline if 1.
    flag4 0 | 1
    Obscures location in timecode: 0 for disable (default), 1 for enable.

    Additional Information

    Reference Clock Drivers


    ntp-4.2.6p5/html/ntp-wait.html0000644000175000017500000000216111616416170015211 0ustar peterpeter ntp-wait - waits until ntpd is in synchronized state

    ntp-wait - waits until ntpd is in synchronized state


    Synopsis

    ntp-wait [ -v ] [ -n tries ] [ -s seconds ]

    Description

    The ntp-wait program blocks until ntpd is in synchronized state. This can be useful at boot time, to delay the boot sequence until after "ntpd -g" has set the time.

    Command Line Options

    -n tries
    Number of tries before giving up. The default is 1000.
    -s seconds
    Seconds to sleep between tries. The default is 6 seconds.
    -v
    Be verbose.
    ntp-4.2.6p5/html/decode.html0000644000175000017500000004375011367517350014707 0ustar peterpeter ntpd Event Messages and Status Words

    Event Messages and Status Words

    giffrom Alice's Adventures in Wonderland, Lewis Carroll

    Caterpillar knows all the error codes, which is more than most of us do.

    Last update: 30-Apr-2010 23:13 UTC


    Related Links

    Table of Contents


    Introduction

    This page lists the status words, event messages and error codes used for ntpd reporting and monitoring. Status words are used to display the current status of the running program. There is one system status word and a peer status word for each association. There is a clock status word for each association that supports a reference clock. There is a flash code for each association which shows errors found in the last packet received (pkt) and during protocol processing (peer). These are commonly viewed using the ntpq program.

    Significant changes in program state are reported as events. There is one set of system events and a set of peer events for each association. In addition, there is a set of clock events for each association that supports a reference clock. Events are normally reported to the protostats monitoring file and optionally to the system log. In addition, if the trap facility is configured, events can be reported to a remote program that can page an administrator.

    This page also includes a description of the error messages produced by the Autokey protocol. These messages are normally sent to the cryptostats monitoring file.

    In the following tables the Code Field is the status or event code assigned and the Message Field a short string used for display and event reporting. The Description field contains a longer explanation of the status or event. Some messages include additional information useful for error diagnosis and performance assessment.

    System Status Word

    The system status word consists of four fields LI (0-1), Source (2-7), Count (8-11) and Code (12-15). It is reported in the first line of the rv display produced by the ntpq program.

    Leap
    Source
    Count
    Code

    The Leap Field displays the system leap indicator bits coded as follows:

    Code Message Description
    0 leap_none normal synchronized state
    1 leap_add_sec insert second after 23:59:59 of the current day
    2 leap_del_sec delete second 23:59:59 of the current day
    3 leap_alarm never synchronized

    The Source Field displays the current synchronization source coded as follows:.

    Code Message Description
    0 sync_unspec not yet synchronized
    1 sync_pps pulse-per-second signal (Cs, Ru, GPS, etc.)
    2 sync_lf_radio VLF/LF radio (WWVB, DCF77, etc.)
    3 sync_hf_radio MF/HF radio (WWV, etc.)
    4 sync_uhf_radio VHF/UHF radio/satellite (GPS, Galileo, etc.)
    5 sync_local local timecode (IRIG, LOCAL driver, etc.)
    6 sync_ntp NTP
    7 sync_other other (IEEE 1588, openntp, crony, etc.)
    8 sync_wristwatch eyeball and wristwatch
    9 sync_telephone telephone modem (ACTS, PTB, etc.)

    The Count Field displays the number of events since the last time the code changed. Upon reaching 15, subsequent events with the same code are ignored.

    The Event Field displays the most recent event message coded as follows:

    Code Message Description
    00 unspecified unspecified
    01 freq_not_set frequency file not available
    02 freq_set frequency set from frequency file
    03 spike_detect spike detected
    04 freq_mode initial frequency training mode
    05 clock_sync clock synchronized
    06 restart program restart
    07 panic_stop clock error more than 600 s
    08 no_system_peer no system peer
    09 leap_armed leap second armed from file or Autokey
    0a leap_disarmed leap second disarmed
    0b leap_event leap event
    0c clock_step clock stepped
    0d kern kernel information message
    0e TAI... leapsecond values update from file
    0f stale leapsecond values new NIST leapseconds file needed
    10 clockhop spurious clock hop suppressed

    Peer Status Word

    The peer status word consists of four fields: Status (0-4), Select (5-7), Count (8-11) and Code (12-15). It is reported in the first line of the rv associd display produced by the ntpq program.

    Status
    Select
    Count
    Code

    The Status Field displays the peer status code bits in hexadecimal; each bit is an independent flag. (Note this field is 5 bits wide, and combines with the the 3-bit-wide Select Field to create the first full byte of the peer status word.) The meaning of each bit in the Status Field is listed in the following table:

    Code Message Description
    08 bcst broadcast association
    10 reach host reachable
    20 authenb authentication enabled
    40 auth authentication ok
    80 config persistent association

    The Select Field displays the current selection status. (The T Field in the following table gives the corresponding tally codes used in the ntpq peers display.) The values are coded as follows:

    Code Message T Description
    0 sel_reject   discarded as not valid (TEST10-TEST13)
    1 sel_falsetick x discarded by intersection algorithm
    2 sel_excess . discarded by table overflow (not used)
    3 sel_outlyer - discarded by the cluster algorithm
    4 sel_candidate + included by the combine algorithm
    5 sel_backup # backup (more than tos maxclock sources)
    6 sel_sys.peer * system peer
    7 sel_pps.peer o PPS peer (when the prefer peer is valid)

    The Count Field displays the number of events since the last time the code changed. Upon reaching 15, subsequent events with the same code are ignored.

    The Event Field displays the most recent event message coded as follows:

    Code Message Description
    01 mobilize association mobilized
    02 demobilize association demobilized
    03 unreachable server unreachable
    04 reachable server reachable
    05 restart association restart
    06 no_reply no server found (ntpdate mode)
    07 rate_exceeded rate exceeded (kiss code RATE)
    08 access_denied access denied (kiss code DENY)
    09 leap_armed leap armed from server LI code
    0a sys_peer become system peer
    0b clock_event see clock status word
    0c bad_auth authentication failure
    0d popcorn popcorn spike suppressor
    0e interleave_mode entering interleave mode
    0f interleave_error interleave error (recovered)
    10 TAI... leapsecond values update from server

    Clock Status Word

    The clock status word consists of four fields: Unused (0-7), Count (8-11) and Code (12-15). It is reported in the first line of the clockvar associd display produced by the ntpq program.

    Unused
    Count
    Code

    The Count Field displays the number of events since the last lockvar command, while the Event Field displays the most recent event message coded as follows:

    Code Message Description
    00 clk_unspe nominal
    01 clk_noreply no reply to poll
    02 clk_badformat bad timecode format
    03 clk_fault hardware or software fault
    04 clk_bad_signal signal loss
    05 clk_bad_date bad date format
    06 clk_bad_time bad time format

    When the clock driver sets the code to a new value, a clock_alarm (11) peer event is reported.

    Flash Status Word

    The flash status word is displayed by the ntpq program rv command. It consists of a number of bits coded in hexadecimal as follows:

    Code Tag Message Description
    0001 TEST1 pkt_dup duplicate packet
    0002 TEST2 pkt_bogus bogus packet
    0004 TEST3 pkt_unsync protocol unsynchronized
    0008 TEST4 pkt_denied access denied
    0010 TEST5 pkt_auth bad authentication
    0020 TEST6 pkt_stratum bad synch or stratum
    0040 TEST7 pkt_header bad header
    0080 TEST8 pkt_autokey bad autokey
    0100 TEST9 pkt_crypto bad crypto
    0200 TEST10 peer_stratum peer bad synch or stratum
    0400 TEST11 peer_dist peer distance exceeded
    0800 TEST12 peer_loop peer synchronization loop
    1000 TEST13 peer_unreach peer unreachable

    Kiss Codes

    Kiss codes are used in kiss-o'-death (koD) packets, billboard displays and log messages. They consist of a string of four zero-padded ASCII charactes. In practice they are informal and tend to change with time and implementation. Some of these codes can appear in the reference identifier field in ntpq billboards. Following is the current list:

    Code Description
    ACST manycast server
    AUTH authentication error
    AUTO Autokey sequence error
    BCST broadcast server
    CRYPT Autokey protocol error
    DENY access denied by server
    INIT association initialized
    MCST multicast server
    RATE rate exceeded
    TIME association timeout
    STEP step time change

    Crypto Messages

    These messages are sent to the cryptostats file when an error is detected in the Autokey protocol.

    Code Message Description
    01 bad_format bad extension field format or length
    02 bad_timestamp bad timestamp
    03 bad_filestamp bad filestamp
    04 bad_public_key bad or missing public key
    05 bad_digest unsupported digest type
    06 bad_identity unsupported identity type
    07 bad_siglength bad signature length
    08 bad signature extension field signature not verified
    09 cert_not_verified certificate signature not verified
    0a cert_expired host certificate expired
    0b bad_cookie bad or missing cookie
    0c bad_leapseconds bad or missing leapseconds values
    0d cert_missing bad or missing certificate
    0e bad_group_key bad or missing group key
    0f proto_error protocol error

    ntp-4.2.6p5/html/miscopt.html0000644000175000017500000004307411307651604015134 0ustar peterpeter Miscellaneous Options

    Miscellaneous Options

    giffrom Pogo, Walt Kelly

    We have three, now looking for more.

    Last update: 13-Nov-2009 19:08 UTC


    Related Links


    broadcastdelay seconds
    The broadcast and multicast modes require a special calibration to determine the network delay between the local and remote servers. Ordinarily, this is done automatically by the initial protocol exchanges between the client and server. In some cases, the calibration procedure may fail due to network or server access controls, for example. This command specifies the default delay to be used under these circumstances. Typically (for Ethernet), a number between 0.003 and 0.007 seconds is appropriate.
    driftfile driftfile { tolerance ]
    This command specifies the complete path and name of the file used to record the frequency of the local clock oscillator. This is the same operation as the -f command linke option. If the file exists, it is read at startup in order to set the initial frequency and then updated once per hour or more with the current frequency computed by the daemon. If the file name is specified, but the file itself does not exist, the starts with an initial frequency of zero and creates the file when writing it for the first time. If this command is not given, the daemon will always start with an initial frequency of zero.
    The file format consists of a single line containing a single floating point number, which records the frequency offset measured in parts-per-million (PPM). The file is updated by first writing the current drift value into a temporary file and then renaming this file to replace the old version. This implies that ntpd must have write permission for the directory the drift file is located in, and that file system links, symbolic or otherwise, should be avoided.
    The parameter tolerance is the wander threshold to skip writing the new value. If the value of wander computed from recent frequency changes is greater than this threshold the file will be updated once per hour. If below the threshold, the file will not be written.
    enable [ auth | bclient | calibrate | kernel | monitor | ntp | pps | stats]
    disable [ auth | bclient | calibrate | kernel | monitor | ntp | pps | stats ]
    Provides a way to enable or disable various system options. Flags not mentioned are unaffected. Note that all of these flags can be controlled remotely using the ntpdc utility program.
    auth
    Enables the server to synchronize with unconfigured peers only if the peer has been correctly authenticated using either public key or private key cryptography. The default for this flag is enable.
    bclient
    Enables the server to listen for a message from a broadcast or multicast server, as in the multicastclient command with default address. The default for this flag is disable.
    calibrate
    Enables the calibrate feature for reference clocks. The default for this flag is disable.
    kernel
    Enables the kernel time discipline, if available. The default for this flag is enable if support is available, otherwise disable.
    monitor
    Enables the monitoring facility. See the ntpdc program and the monlist command or further information. The default for this flag is enable.
    ntp
    Enables time and frequency discipline. In effect, this switch opens and closes the feedback loop, which is useful for testing. The default for this flag is enable.
    stats
    Enables the statistics facility. See the Monitoring Options page for further information. The default for this flag is disable.
    includefile includefile
    This command allows additional configuration commands to be included from a separate file. Include files may be nested to a depth of five; upon reaching the end of any include file, command processing resumes in the previous configuration file. This option is useful for sites that run ntpd on multiple hosts, with (mostly) common options (e.g., a restriction list).
    interface [listen | ignore | drop] [all | ipv4 | ipv6 | wildcard | name | address[/prefixlen]]
    This command controls which network addresses ntpd opens, and whether input is dropped without processing. The first parameter determines the action for addresses which match the second parameter. That parameter specifies a class of addresses, or a specific interface name, or an address. In the address case, prefixlen determines how many bits must match for this rule to apply. ignore prevents opening matching addresses, drop causes ntpd to open the address and drop all received packets without examination. Multiple interface commands can be used. The last rule which matches a particular address determines the action for it. interface commands are disabled if any -I, --interface, -L, or --novirtualips command-line options are used. If none of those options are used and no interface actions are specified in the configuration file, all available network addresses are opened. The nic command is an alias for interface.
    leapfile leapfile
    This command loads the NIST leapseconds file and initializes the leapsecond values for the next leapsecond time, expiration time and TAI offset. The file can be obtained directly from NIST national time servers using ftp as the ASCII file pub/leap-seconds.
    While not strictly a security function, the Autokey protocol provides means to securely retrieve the current or updated leapsecond values from a server.
    logconfig configkeyword
    This command controls the amount and type of output written to the system syslog facility or the alternate logfile log file. All configkeyword keywords can be prefixed with =, + and -, where = sets the syslogmask, + adds and - removes messages. syslog messages can be controlled in four classes (clock, peer, sys and sync). Within these classes four types of messages can be controlled: informational messages (info), event messages (events), statistics messages (statistics) and status messages (status).
    Configuration keywords are formed by concatenating the message class with the event class. The all prefix can be used instead of a message class. A message class may also be followed by the all keyword to enable/disable all messages of the respective message class. By default, logconfig output is set to allsync.
    Thus, a minimal log configuration could look like this:
    logconfig=syncstatus +sysevents
    This would just list the synchronizations state of ntpd and the major system events. For a simple reference server, the following minimum message configuration could be useful:
    logconfig allsync +allclock
    This configuration will list all clock information and synchronization information. All other events and messages about peers, system events and so on is suppressed.
    logfile logfile
    This command specifies the location of an alternate log file to be used instead of the default system syslog facility. This is the same operation as the -l command line option.
    phone dial1 dial2 ...
    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.
    saveconfigdir directory_path
    Specify the directory in which to write configuration snapshots requested with ntpq's saveconfig command. If saveconfigdir does not appear in the configuration file, saveconfig requests are rejected by ntpd.
    setvar variable [default]
    This command adds an additional system variable. These variables can be used to distribute additional information such as the access policy. If the variable of the form name = value is followed by the default keyword, the variable will be listed as part of the default system variables (ntpq rv command). These additional variables serve informational purposes only. They are not related to the protocol other that they can be listed. The known protocol variables will always override any variables defined via the setvar mechanism. There are three special variables that contain the names of all variable of the same group. The sys_var_list holds the names of all system variables. The peer_var_list holds the names of all peer variables and the clock_var_list holds the names of the reference clock variables.
    tinker [ allan allan | dispersion dispersion | freq freq | huffpuff huffpuff | panic panic | step step | stepout stepout ]
    This command alters certain system variables used by the clock discipline algorithm. The default values of these variables have been carefully optimized for a wide range of network speeds and reliability expectations. Very rarely is it necessary to change the default values; but, some folks can't resist twisting the knobs. The options are as follows:
    allan allan
    Spedifies the Allan intercept, which is a parameter of the PLL/FLL clock discipline algorithm, in seconds with default 1500 s.
    dispersion dispersion
    Specifies the dispersion increase rate in parts-per-million (PPM) with default 15 PPM.
    freq freq
    Spedifies the frequency offset in parts-per-million (PPM) with default the value in the frequency file.
    huffpuff huffpuff
    Spedifies the huff-n'-puff filter span, which determines the most recent interval the algorithm will search for a minimum delay. The lower limit is 900 s (15 m), but a more reasonable value is 7200 (2 hours).
    panic panic
    Spedifies the panic threshold in seconds with default 1000 s. If set to zero, the panic sanity check is disabled and a clock offset of any value will be accepted.
    step step
    Spedifies the step threshold in seconds. The default without this command is 0.128 s. If set to zero, step adjustments will never occur. Note: The kernel time discipline is disabled if the step threshold is set to zero or greater than 0.5 s.
    stepout stepout
    Specifies the stepout threshold in seconds. The default without this command is 900 s. If set to zero, popcorn spikes will not be suppressed.
    tos [ beacon beacon | ceiling ceiling | cohort {0 | 1} | floor floor | maxclock maxclock | maxdist maxdist | minclock minclock | mindist mindist | minsane minsane | orphan stratum ]
    This command alters certain system variables used by the the clock selection and clustering algorithms. The default values of these variables have been carefully optimized for a wide range of network speeds and reliability expectations. Very rarely is it necessary to change the default values; but, some folks can't resist twisting the knobs. It can be used to select the quality and quantity of peers used to synchronize the system clock and is most useful in dynamic server discovery schemes. The options are as follows:
    beacon beacon
    The manycast server sends packets at intervals of 64 s if less than maxclock servers are available. Otherwise, it sends packets at the beacon interval in seconds. The default is 3600 s. See the Automatic Server Discovery page for further details.
    ceiling ceiling
    Specify the maximum stratum (exclusive) for acceptable server packets. The default is 16. See the Automatic Server Discovery page for further details.
    cohort { 0 | 1 }
    Specify whether (1) or whether not (0) a server packet will be accepted for the same stratum as the client. The default is 0. See the Automatic Server Discovery page for further details.
    floor floor
    Specify the minimum stratum (inclusive) for acceptable server packest. The default is 1. See the Automatic Server Discovery page for further details.
    maxclock maxclock
    Specify the maximum number of servers retained by the server discovery schemes. The default is 10. See the Automatic Server Discovery page for further details.
    maxdist maxdistance
    Specify the synchronization distance threshold used by the clock selection algorithm. The default is 1.5 s. This determines both the minimum number of packets to set the system clock and the maximum roundtrip delay. It can be decreased to improve reliability or increased to synchronize clocks on the Moon or planets.
    minclock minclock
    Specify the number of servers used by the clustering algorithm as the minimum to include on the candidate list. The default is 3. This is also the number of servers to be averaged by the combining algorithm.
    mindist mindistance
    Specify the minimum distance used by the selection and anticlockhop algorithm. Larger values increase the tolerance for outliers; smaller values increase the selectivity. The default is .001 s. In some cases, such as reference clocks with high jitter and a PPS signal, it is useful to increase the value to insure the intersection interval is always nonempty.
    minsane minsane
    Specify the number of servers used by the selection algorithm as the minimum to set the system clock. The default is 1 for legacy purposes; however, for critical applications the value should be somewhat higher but less than minclock.
    orphan stratum
    Specify the orphan stratum with default 16. If less than 16 this is the stratum assumed by the root servers. See the Association Management page for further details.
    trap host_address [port port_number] [interface interfSace_address]
    This command configures a trap receiver at the given host address and port number for sending messages with the specified local interface address. If the port number is unspecified, a value of 18447 is used. If the interface address is not specified, the message is sent with a source address of the local interface the message is sent through. Note that on a multihomed host the interface used may vary from time to time with routing changes.
    The trap receiver will generally log event messages and other information from the server in a log file. While such monitor programs may also request their own trap dynamically, configuring a trap receiver will ensure that no messages are lost when the server is started.
    ttl hop ...
    This command specifies a list of TTL values in increasing order. up to 8 values can be specified. In manycast mode these values are used in turn in an expanding-ring search. The default is eight multiples of 32 starting at 31.

    ntp-4.2.6p5/html/sitemap.html0000644000175000017500000000310111307651603015102 0ustar peterpeter Site Map

    Site Map

    giffrom Alice in Wonderland, Lewis Carroll

    Welcome to the tea party.

    Last update: 08-Apr-2009 2:54 UTC

    Related Links


    gif

    ntp-4.2.6p5/html/keygen.html0000644000175000017500000004775211606456562014757 0ustar peterpeter ntp-keygen - generate public and private keys

    ntp-keygen - generate public and private keys

    giffrom Alice's Adventures in Wonderland, Lewis Carroll

    Alice holds the key.

    Last update: 13-Nov-2009 0:44


    Related Links

    Table of Contents


    Synopsis

    ntp-keygen [ -deGHIMPT ] [ -c [RSA-MD2 | RSA-MD5 | RSA-SHA | RSA-SHA1 | RSA-MDC2 | RSA-RIPEMD160 | DSA-SHA | DSA-SHA1 ] ] [ -i group ] [ -m modulus ] [ -p passwd2 ] [ -q passwd1 ] [ -S [ RSA | DSA ] ] [ -s host ] [ -V nkeys ]

    Description

    This program generates cryptographic data files used by the NTPv4 authentication and identity schemes. It can generate message digest keys used in symmetric key cryptography and, if the OpenSSL software library has been installed, it can generate host keys, sign keys, certificates and identity keys used by the Autokey public key cryptography. The message digest keys file is generated in a format compatible with NTPv3. All other files are in PEM-encoded printable ASCII format so they can be embedded as MIME attachments in mail to other sites.

    When used to generate message digest keys, the program produces a file containing ten pseudo-random printable ASCII strings suitable for the MD5 message digest algorithm included in the distribution. If the OpenSSL library is installed, it produces an additional ten hex-encoded random bit strings suitable for the SHA1 and other message digest algorithms. Printable ASCII keys can have length from one to 20 characters, inclusive. Bit string keys have length 20 octets (40 hex characters). All keys are 160 bits in length.

    The file can be edited later with purpose-chosen passwords for the ntpq and ntpdc programs. Each line of the file contains three fields, first an integer between 1 and 65534, inclusive, representing the key identifier used in the server and peer configuration commands. Next is the key type for the message digest algorithm, which in the absence of the OpenSSL library should be the string MD5 to designate the MD5 message digest algorithm. If the OpenSSL library is installed, the key type can be any message digest algorithm supported by that library. However, if compatibility with FIPS 140-2 is required, the key type must be either SHA or SHA1.Finally is the key itself as a printable ASCII string excluding the space and # characters. If not greater than 20 characters in length, the string is the key itself; otherwise, it is interpreted as a hex-encoded bit string. As is custom, # and the remaining characters on the line are ignored. Later, this file can be edited to include the passwords for the ntpq and ntpdc utilities. If this is the only need, run ntp-keygen with the -M option and disregard the remainder of this page.

    The remaining generated files are compatible with other OpenSSL applications and other Public Key Infrastructure (PKI) resources. Certificates generated by this program should be compatible with extant industry practice, although some users might find the interpretation of X509v3 extension fields somewhat liberal. However, the identity keys are probably not compatible with anything other than Autokey.

    Most files used by this program are encrypted using a private password. The -p option specifies the password for local files and the -q option the password for files sent to remote sites. If no local password is specified, the host name returned by the Unix gethostname() function, normally the DNS name of the host, is used. If no remote password is specified, the local password is used.

    The pw option of the crypto configuration command specifies the read password for previously encrypted files. This must match the local password used by this program. If not specified, the host name is used. Thus, if files are generated by this program without password, they can be read back by ntpd without password, but only on the same host.

    All files and links are usually installed in the directory /usr/local/etc, which is normally in a shared filesystem in NFS-mounted networks and cannot be changed by shared clients. The location of the keys directory can be changed by the keysdir configuration command in such cases. Normally, encrypted files for each host are generated by that host and used only by that host, although exceptions exist as noted later on this page.

    This program directs commentary and error messages to the standard error stream stderr and remote files to the standard output stream stdout where they can be piped to other applications or redirected to a file. The names used for generated files and links all begin with the string ntpkey and include the file type, generating host and filestamp, as described in the Cryptographic Data Files section below

    Running the Program

    To test and gain experience with Autokey concepts, log in as root and change to the keys directory, usually /usr/local/etc. When run for the first time, or if all files with names beginning ntpkey have been removed, use the ntp-keygen command without arguments to generate a default RSA host key and matching RSA-MD5 certificate with expiration date one year hence. If run again, the program uses the existing keys and parameters and generates only a new certificate with new expiration date one year hence; however, the certificate is not generated if the -e or -q options are present.

    Run the command on as many hosts as necessary. Designate one of them as the trusted host (TH) using ntp-keygen with the -T option and configure it to synchronize from reliable Internet servers. Then configure the other hosts to synchronize to the TH directly or indirectly. A certificate trail is created when Autokey asks the immediately ascendant host towards the TH to sign its certificate, which is then provided to the immediately descendant host on request. All group hosts should have acyclic certificate trails ending on the TH.

    The host key is used to encrypt the cookie when required and so must be RSA type. By default, the host key is also the sign key used to encrypt signatures. A different sign key can be assigned using the -S option and this can be either RSA or DSA type. By default, the signature message digest type is MD5, but any combination of sign key type and sign digest type supported by the OpenSSL library can be specified using the -c option. At the moment, legacy considerations require the NTP packet header digest type to be MD5.

    Trusted Hosts and Secure Groups

    As described on the Authentication Options page, an NTP secure group consists of one or more low-stratum THs as the root from which all other group hosts derive synchronization directly or indirectly. For authentication purposes all hosts in a group must have the same group name specified by the -i option and matching the ident option of the crypto configuration command. The group name is used in the subject and issuer fields of trusted, self-signed certificates and when constructing the file names for identity keys. All hosts must have different host names, either the default host name or as specified by the -s option and matching the host option of the crypto configuration command. Most installations need not specify the -i option nor the host option. Host names are used in the subject and issuer fields of self-signed, nontrusted certificates and when constructing the file names for host and sign keys and certificates. Host and group names are used only for authentication purposes and have nothing to do with DNS names.

    Identity Schemes

    As described on the Authentication Options page, there are five identity schemes, three of which - IFF, GQ and MV - require identity keys specific to each scheme. There are two types of files for each scheme, an encrypted keys file and a nonencrypted parameters file, which usually contains a subset of the keys file. In general, NTP secondary servers operating as certificate signing authorities (CSA) use the keys file and clients use the parameters file. Both files are generated by the TA operating as a certificate authority (CA) on behalf of all servers and clients in the group.

    The parameters files are public; they can be stored in a public place and sent in the clear. The keys files are encrypted with the local password. To retrieve the keys file, a host can send a mail request to the TA including its local password. The TA encrypts the keys file with this password and returns it as an attachment. The attachment is then copied intact to the keys directory with name given in the first line of the file, but all in lower case and with the filestamp deleted. Alternatively, the parameters file can be retrieved from a secure web site.

    For example, the TA generates default host key, IFF keys and trusted certificate using the command

    ntp-keygen -p local_passwd -T -I -igroup_name

    Each group host generates default host keys and nontrusted certificate use the same command line but omitting the -i option. Once these media have been generated, the TA can then generate the public parameters using the command

    ntp-keygen -p local_passwd -e >parameters_file

    where the -e option redirects the unencrypted parameters to the standard output stream for a mail application or stored locally for later distribution. In a similar fashion the -q option redirects the encrypted server keys to the standard output stream.

    Command Line Options

    -c [ RSA-MD2 | RSA-MD5 | RSA-SHA | RSA-SHA1 | RSA-MDC2 | RSA-RIPEMD160 | DSA-SHA | DSA-SHA1 ]
    Select certificate and message digest/signature encryption scheme. Note that RSA schemes must be used with a RSA sign key and DSA schemes must be used with a DSA sign key. The default without this option is RSA-MD5. If compatibility with FIPS 140-2 is required, either the DSA-SHA or DSA-SHA1 scheme must be used.
    -d
    Enable debugging. This option displays the cryptographic data produced for eye-friendly billboards.
    -e
    Extract the IFF or GQ public parameters from the IFFkey or GQkey keys file previously specified. Send the unencrypted data to the standard output stream stdout. While the IFF parameters do not reveal the private group key,  the GQ parameters should be used with caution, as they include the group key. Use the -q option with password instead. Note: a new certificate is not generated when this option is present. This allows multiple commands with this option but without disturbing existing media.
    -G
    Generate a new encrypted GQ key file and link for the Guillou-Quisquater (GQ) identity scheme.
    -H
    Generate a new encrypted RSA public/private host key file and link. Note that if the sign key is the same as the host key, generating a new host key invalidates all certificates signed with the old host key.
    -i group
    Set the group name to group. This is used in the identity file names. It must match the group name specified in the ident option of the crypto configuration command.
    -I
    Generate a new encrypted IFF key file and link for the Schnorr (IFF) identity scheme.
    -m modulus
    Set the modulus for generating files to modulus bits. The modulus defaults to 512, but can be set from 256 (32 octets) to 2048 (256 octets).
    -M
    Generate a new MD5 key file containing 16, 128-bit pseudo-random keys for symmetric cryptography..
    -P
    Generate a new private certificate used by the PC identity scheme. By default, the program generates public certificates. Note: the PC identity scheme is not recommended for new installations.
    -p passwd
    Set the password for reading and writing encrypted files to passwd. By default, the password is the host name.
    -q passwd
    Extract the encrypted IFF or GQ server keys from the IFFkey or GQkey key file previously generated. The data are sent to the standard output stream stdout. Set the password for writing the data, which is also the password to read the data file in another host. By default, the password is the host name. Note: a new certificate is not generated when this option is present. This allows multiple commands with this option but without disturbing existing media.
    -S [ RSA | DSA ]
    Generate a new sign key of the specified type. By default, the sign key is the host key and has the same type. If compatibly with FIPS 140-2 is required, the sign key type must be DSA. Note that generating a new sign key invalidates all certificates signed with the old sign key.
    -s host
    Set the host name to host. This is used in the host and sign key file names. It must match the host name specified in the host option of the crypto configuration command.
    -T
    Generate a trusted certificate. By default, the program generates nontrusted certificates.
    -V nkeys
    Generate server parameters MV and nkeys client keys for the Mu-Varadharajan (MV) identity scheme. Note: support for this option should be considered a work in progress.

    Random Seed File

    All cryptographically sound key generation schemes must have means to randomize the entropy seed used to initialize the internal pseudo-random number generator used by the OpenSSL library routines. If a site supports ssh, it is very likely that means to do this are already available. The entropy seed used by the OpenSSL library is contained in a file, usually called .rnd, which must be available when starting the ntp-keygen program or ntpd daemon.

    The OpenSSL library looks for the file using the path specified by the RANDFILE environment variable in the user home directory, whether root or some other user. If the RANDFILE environment variable is not present, the library looks for the .rnd file in the user home directory. Since both the ntp-keygen program and ntpd daemon must run as root, the logical place to put this file is in /.rnd or /root/.rnd. If the file is not available or cannot be written, the program exits with a message to the system log.

    On systems that provide /dev/urandom, the randomness device is used instead and the file specified by the randfile subcommand or the RANDFILE environment variable is ignored.

    Cryptographic Data Files

    File and link names are in the form ntpkey_key_name.fstamp, where key is the key or parameter type, name is the host or group name and fstamp is the filestamp (NTP seconds) when the file was created). By convention, key fields in generated file names include both upper and lower case alphanumeric characters, while key fields in generated link names include only lower case characters. The filestamp is not used in generated link names.

    The key type is a string defining the cryptographic function. Key types include public/private keys host and sign, certificate cert and several challenge/response key types. By convention, files used for challenges have a par subtype, as in the IFF challenge IFFpar, while files for responses have a key subtype, as in the GQ response GQkey.

    All files begin with two nonencrypted lines. The first line contains the file name in the format ntpkey_key_host.fstamp. The second line contains the datestamp in conventional Unix date format. Lines beginning with # are ignored.

    The remainder of the file contains cryptographic data encoded first using ASN.1 rules, then encrypted using the DES-CBC algorithm and given password and finally written in PEM-encoded printable ASCII text preceded and followed by MIME content identifier lines.

    The format of the symmetric keys file is somewhat different than the other files in the interest of backward compatibility. Since DES-CBC is deprecated in NTPv4, the only key format of interest is MD5 alphanumeric strings. Following the header the keys are entered one per line in the format

    keyno type key

    where keyno is a positive integer in the range 1-65,535, type is the string MD5 defining the key format and key is the key itself, which is a printable ASCII string 16 characters or less in length. Each character is chosen from the 93 printable characters in the range 0x21 through 0x7f excluding space and the '#' character.

    Note that the keys used by the ntpq and ntpdc programs are checked against passwords requested by the programs and entered by hand, so it is generally appropriate to specify these keys in human readable ASCII format.

    The ntp-keygen program generates a MD5 symmetric keys file ntpkey_MD5key_hostname.filestamp. Since the file contains private shared keys, it should be visible only to root and distributed by secure means to other subnet hosts. The NTP daemon loads the file ntp.keys, so ntp-keygen installs a soft link from this name to the generated file. Subsequently, similar soft links must be installed by manual or automated means on the other subnet hosts. While this file is not used with the Autokey Version 2 protocol, it is needed to authenticate some remote configuration commands used by the ntpq and ntpdc utilities.

    Bugs

    It can take quite a while to generate some cryptographic values, from one to several minutes with modern architectures such as UltraSPARC and up to tens of minutes to an hour with older architectures such as SPARC IPC.


    ntp-4.2.6p5/html/quick.html0000644000175000017500000001130411307651603014560 0ustar peterpeter Quick Start

    Quick Start

    gifFAX test image for SATNET (1979).

    The baby panda was scanned at University College London and used as a FAX test image for a demonstration of the DARPA Atlantic SATNET Program and the first transatlantic Internet connection in 1978. The computing system used for that demonstration was called the Fuzzball. As it happened, this was also the first Internet multimedia presentation and the first to use NTP in regular operation. The image was widely copied and used for testing purpose throughout much of the 1980s.

    Last update: 25-nov-09 22:13 UTC

    Related Links


    For the rank amateur the sheer volume of the documentation collection must be intimidating. However, it doesn't take much to fly the ntpd daemon with a simple configuration where a workstation needs to synchronize to some server elsewhere in the Internet. The first thing is to build the distribution for the particular workstation and install in the usual place. The Building and Installing the Distribution page describes how to do this.

    While it is possible that certain configurations do not need a configuration file, most do. The file, called by default /etc/ntp.conf, need only contain one command specifying a remote server, for instance

    server foo.bar.com

    Choosing an appropriate remote server is somewhat of a black art, but a suboptimal choice is seldom a problem. The simplest is to use the Server Pool Scheme on the Automatic Server Discovery page. There are about two dozen public time servers operated by the National Institutes of Science and Technology (NIST), US Naval Observatory (USNO), Canadian Metrology Centre (CMC) and many others available on the Internet. Lists of public primary and secondary NTP servers maintained on the Public NTP Time Servers page, which is updated frequently.The lists are sorted by country and, in the case of the US, by state. Usually, the best choice is the nearest in geographical terms, but the terms of engagement specified in each list entry should be carefully respected.

    During operation ntpd measures and corrects for incidental clock frequency error and occasionally writes the current value to a file specified by the

    driftfile /etc/ntp.drift

    configuration command. If ntpd is stopped and restarted, it initializes the frequency from this file and avoids the potentially lengthy interval to relearn the correction.

    That's all there is to it, unless some problem in network connectivity or local operating system configuration occurs. The most common problem is some firewall between the workstation and server. System administrators should understand NTP uses UDP port 123 as both the source and destination port and that NTP does not involve any operating system interaction other than to set the system clock. While almost all modern Unix systems have included NTP and UDP port 123 defined in the services file, this should be checked if ntpd fails to come up at all.

    The best way to confirm NTP is working is using the ntpq utility, although the ntpdc utility may be useful in extreme cases. See the documentation pages for further information. Don't forget to check for system log messages. In the most extreme cases the -d option on the ntpd command line results in a blow-by-blow trace of the daemon operations. While the trace output can be cryptic, to say the least, it gives a general idea of what the program is doing and, in particular, details the arriving and departing packets and any errors found.


    ntp-4.2.6p5/html/msyslog.html0000644000175000017500000001710711307651604015151 0ustar peterpeter ntpd System Log Messages

    ntpd System Log Messages

    giffrom Alice's Adventures in Wonderland, Lewis Carroll

    The log can be shrill at times.

    Last update: 02:22 UTC Monday, March 03, 2008


    Related Links


    You have come here because you found a cryptic message in the system log. This page by no means lists all messages that might be found, since new ones come and old ones go. Generally, however, the most common ones will be found here. They are listed by program module and log severity code in bold: LOG_ERR, LOG_NOTICE and LOG_INFO.

    Most of the time LOG_ERR messages are fatal, but often ntpd limps onward in the hopes of discovering more errors. The LOG_NOTICE messages usually mean the time has changed or some other condition that probably should be noticed. The LOG_INFO messages usually say something about the system operations, but do not affect the time.

    In the following a '?' character stands for text in the message. The meaning should be clear from context.

    Protocol Module

    LOG_ERR

    buffer overflow ?
    Fatal error. An input packet is too long for processing.

    LOG_NOTICE

    no reply; clock not set
    In ntpdate mode no servers have been found. The server(s) and/or network may be down. Standard debugging procedures apply.

    LOG_INFO

    proto_config: illegal item ?, value ?
    Program error. Bugs can be reported here.
    receive: autokey requires two-way communication
    Configuration error on the broadcastclient command.
    receive: server server maaximum rate exceeded
    A kiss-o'death packet has been received. The transmit rate is automatically reduced.
    pps sync enabled
    The PPS signal has been detected and enabled.
    transmit: encryption key ? not found
    The encryption key is not defined or not trusted.
    precision = ? usec
    This reports the precision measured for this machine.
    using 10ms tick adjustments
    Gotcha for some machines with dirty rotten clock hardware.
    no servers reachable
    The system clock is running on internal batteries. The server(s) and/or network may be down.

    Clock Discipline Module

    LOG_ERR

    time correction of ? seconds exceeds sanity limit (?); set clock manually to the correct UTC time.
    Fatal error. Better do what it says, then restart the daemon. Be advised NTP and Unix know nothing about local time zones. The clock must be set to Coordinated Universal Time (UTC). Believe it; by international agreement abbreviations are in French and descriptions are in English.
    sigaction() fails to save SIGSYS trap: ?
    sigaction() fails to restore SIGSYS trap: ?
    Program error. Bugs can be reported here.

    LOG_NOTICE

    frequency error ? exceeds tolerance 500 PPM
    The hardware clock frequency error exceeds the rate the kernel can correct. This could be a hardware or a kernel problem.
    time slew ? s
    The time error exceeds the step threshold and is being slewed to the correct time. You may have to wait a very long time.
    time reset ? s
    The time error exceeds the step threshold and has been reset to the correct time. Computer scientists don't like this, but they can set the ntpd -x option and wait forever.
    kernel time sync disabled ?
    The kernel reports an error. See the codes in the timex.h file.
    pps sync disabled
    The PPS signal has died, probably due to a dead radio, broken wire or loose connector.

    LOG_INFO

    kernel time sync status ?
    For information only. See the codes in the timex.h file.

    Cryptographic Module

    LOG_ERR

    cert_parse ?
    cert_sign ?
    crypto_cert ?
    crypto_encrypt ?
    crypto_gq ?
    crypto_iff ?
    crypto_key ?
    crypto_mv ?
    crypto_setup ?
    make_keys ?
    Usually fatal errors. These messages display error codes returned from the OpenSSL library. See the OpenSSL documentation for explanation.
    crypto_setup: certificate ? is trusted, but not self signed.
    crypto_setup: certificate ? not for this host
    crypto_setup: certificate file ? not found or corrupt
    crypto_setup: host key file ? not found or corrupt
    crypto_setup: host key is not RSA key type
    crypto_setup: random seed file ? not found
    rypto_setup: random seed file not specified
    Fatal errors. These messages show problems during the initialization procedure.

    LOG_INFO

    cert_parse: expired ?
    cert_parse: invalid issuer ?
    cert_parse: invalid signature ?
    cert_parse: invalid subject ?
    There is a problem with a certificate. Operation cannot proceed untill the problem is fixed. If the certificate is local, it can be regenerated using the ntp-keygen program. If it is held somewhere else, it must be fixed by the holder.
    crypto_?: defective key
    crypto_?: invalid filestamp
    crypto_?: missing challenge
    crypto_?: scheme unavailable
    There is a problem with the identity scheme. Operation cannot proceed untill the problem is fixed. Usually errors are due to misconfiguration or an orphan association. If the latter, ntpd will usually time out and recover by itself.
    crypto_cert: wrong PEM type ?
    The certificate does not have MIME type CERTIFICATE. You are probably using the wrong type from OpenSSL or an external certificate authority.
    crypto_ident: no compatible identity scheme found
    Configuration error. The server and client identity schemes are incompatible.
    crypto_tai: kernel TAI update failed
    The kernel does not support this function. You may need a new kernel or patch.
    crypto_tai: leapseconds file ? error ?
    The leapseconds file is corrupt. Obtain the latest file from time.nist.gov.

    ntp-4.2.6p5/html/build.html0000644000175000017500000001507711307651603014556 0ustar peterpeter Building and Installing the Distribution

    Building and Installing the Distribution

    giffrom Pogo, Walt Kelly

    For putting out compiler fires.

    Last update: 16:45 UTC Sunday, March 02, 2008


    Related Links

    Table of Contents


    Building and Installing the Distribution

    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 ./configure, make and install in that order and the autoconfigure system does the rest. There are some exceptions, as noted below and on the Hints and Kinks pages.

    If available, the OpenSSL library from http://www.openssl.org 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 libcrypto.a library file and openssl header files are needed. If the library is not available or disabled, this step is not required.

    The Build Options 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.

    Building and Installing for Unix

    This distribution uses common compilers and tools that come with most Unix distributions. Not all of these tools exist in the standard distribution of modern Unix versions (compilers are likely to be an add-on product). If this is the case, consider using the GNU tools and gcc compiler included as freeware in some systems. For a successful build, all of these tools should be accessible via the current path.

    The first thing to do is uncompress the distribution and extract the source tree. In the distribution base directory use the ./configure command to perform an automatic configuration procedure. This command inspects the hardware and software environment and configures the build process accordingly. Use the make command to compile and link the distribution and the install command to install the executables by default in /usr/local/bin.

    If your site supports multiple architectures and uses NFS to share files, you can use a single source tree to build executables for multiple architectures. While running on a particular architecture, change to the base directory and create a subdirectory using a command like mkdir A.machine, which will create an architecture-specific directory, then change to this directory and mumble ../configure. The remaining steps are the same whether building in the base directory or in the subdirectory.

    Building and Installing for Windows

    NTP supports Windows Vista, XP, NT4 and 2000 systems. See the NTP 4.x for Windows NT page for directions to compile the sources and install the executables. A precompiled executable is available.

    Configuration

    You are now ready to configure the daemon. You will need to create a NTP configuration file by default in /etc/ntp.conf. Newbies should see the Quick Start page for orientation. Seasoned veterans can start with the ntpd - Network Time Protocol (NTP) daemon page and move on to the specific configuration option pages from there.

    If You Have Problems

    If you have problems with your hardware and software environment (e.g. operating system-specific issues), browse the Hints and Kinks pages. For other problems a tutorial on debugging technique is in the NTP Debugging Technique page. A list of important system log messages is on the ntpd System Log Messages page.

    The first line of general assistance is the NTP web site www.ntp.org and the helpful documents resident there. Requests for assistance of a general nature and of interest to other timekeepers should be sent to the NTP newsgroup comp.protocols.time.ntp.

    Users are invited to report bugs and offer suggestions via the NTPáBug Reporting Procedures page.

    Additional make commands

    make clean
    Cleans out object files, programs and temporary files.
    make distclean
    Does the work of clean, but cleans out all directories in preparation for a new distribution release.
    make dist
    Does the work of make distclean, but constructs compressed tar files for distribution. You must have GNU automake to perform this function.

    ntp-4.2.6p5/m4/0000755000175000017500000000000011675461357012150 5ustar peterpeterntp-4.2.6p5/m4/ntp_cacheversion.m40000644000175000017500000000741611505336024015734 0ustar peterpeter# NTP_CACHEVERSION(component, version) # ------------------------------------ # compare this configure script's cache version stamp with the stamp # saved by the prior run in config.cache. If they differ, clear all # cache variables to avoid using results cached with a script that # is known to differ in a cache-invalidating manner. # # Note: use immediately following AC_INIT in configure.ac, as clearing # all _cv_ variables only makes sense immediately after loading, before # use or modification. # # It is assumed that parent configure.ac files which use # AC_CONFIG_SUBDIR to invoke child configure.ac files have used # NTP_CACHEVERSION if any children do. The top-level configure script # will clear a previous cache lacking any saved cache version number, # while children do not. The reason is the children can rely on the # parent having cleared any cache variables predating this mechanism. # Therefore the child can rely on the config.cache generated by the # parent on the first run despite not finding its version stamp # previously saved. In this case top-level means a configure script # not invoked by another configure script in its parent directory. AC_DEFUN_ONCE([NTP_CACHEVERSION], [ AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl AC_BEFORE([$0], [AM_CONFIG_HEADER])dnl AC_BEFORE([$0], [AC_PROG_CC])dnl AC_BEFORE([$0], [AC_CONFIG_SUBDIRS])dnl ntp_cache_flush=1 case "$ntp_cv_[$1]_cache_version" in [$2]) # same version, good ntp_cache_flush=0 ;; '') # No cache, predates ntp_cv_$1_cache_version, or is empty. case "$cache_file" in /dev/null) ntp_cache_flush=0 ;; *) case "$NTP_CACHEVERSION_PARENT" in '') # Do not clear the cache immediately after it is created # empty as it is noisy. Differentiate a newly-created # config.cache from one predating the cache version # mechanism by looking for the first cached variable set # by Autoconf case "$ac_cv_path_install" in '') # empty config.cache file ntp_cache_flush=0 esac ;; *) # Parent configure just created cache from empty, # flushing would be counterproductive. ntp_cache_flush=0; esac esac ;; *) # configure cache version mismatches config.cache version esac case "$ntp_cache_flush" in 1) c_version="${ntp_cv_[$1]_cache_version:-(no version found)}" # Do we flush all variables or exclude others' version stamps? case "$NTP_CACHEVERSION_PARENT" in '') # Clear all *_cv_* variables including our child subdirs' # ntp_cv_*_cache_version variables. This prevents subdir # configure scripts from noticing a version mismatch just # after the top configure in the invocation cleared and # recreated the cache. c_varname_list=`set | sed -n -e 's/=.*$//' \ -e '/_cv_/p' ` ;; *) # This is not the top configure this particular invocation. # Clear all *_cv_* variables sparing the version stamps # of other configure scripts, so we don't trigger # useless repeated clearings. c_varname_list=`set | sed -n -e 's/=.*$//' \ -e '/ntp_cv_.*_cache_version/d' \ -e '/_cv_/p' ` esac for c_varname in $c_varname_list do AS_UNSET([$c_varname]) done AC_MSG_NOTICE([[$cache_file saved by another version, ignored.]]) AC_MSG_NOTICE([[configure script cache version: ]][$2]) AC_MSG_NOTICE([[$cache_file version: $c_version]]) AS_UNSET([c_varname]) AS_UNSET([c_varname_list]) AS_UNSET([c_version]) esac AS_UNSET([ntp_cache_flush]) # save configure version in config.cache for next time ntp_cv_[$1]_cache_version="[$2]" # let any subdir configure.ac NTP_CACHEVERSION invocations # know they are not the top level. NTP_CACHEVERSION_PARENT='[$1]' ; export NTP_CACHEVERSION_PARENT ])dnl ntp-4.2.6p5/m4/libtool.m40000644000175000017500000104474111564122342014052 0ustar peterpeter# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2010 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; haiku*) version_type=linux need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS ntp-4.2.6p5/m4/ntp_vpathhack.m40000644000175000017500000000153611505336024015231 0ustar peterpeterdnl ###################################################################### dnl NTP_VPATH_HACK dnl dnl Are we using FreeBSD's make? dnl if we are building outside the srcdir and either dnl force_ntp_vpath_hack is set dnl or dnl we're on freebsd and not using GNU make dnl then we want VPATH_HACK to be true in automake tests dnl AC_DEFUN([NTP_VPATH_HACK], [ AC_MSG_CHECKING([to see if we need a VPATH hack]) ntp_vpath_hack="no" case "$srcdir::$build_os::${force_ntp_vpath_hack+set}" in .::*::*) ;; *::*::set) ntp_vpath_hack="yes" ;; *::freebsd*::) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | grep 'GNU Make'`" in '') ntp_vpath_hack="yes" esac esac AC_MSG_RESULT([$ntp_vpath_hack]) AM_CONDITIONAL([VPATH_HACK], [test x$ntp_vpath_hack = xyes]) ]) dnl ====================================================================== ntp-4.2.6p5/m4/ntp_lineeditlibs.m40000644000175000017500000000563311505336022015727 0ustar peterpeterAC_DEFUN([NTP_LINEEDITLIBS], [ NTP_ORIG_LIBS="$LIBS" AC_ARG_WITH( [lineeditlibs], [AS_HELP_STRING( [--with-lineeditlibs], [edit,editline (readline may be specified if desired)] )], [use_lineeditlibs="$withval"], [use_lineeditlibs="edit,editline"] ) AC_MSG_CHECKING([line editing libraries]) AC_MSG_RESULT([$use_lineeditlibs]) case "$use_lineeditlibs" in no) ntp_lib_lineedit=no ;; *) for lineedit_lib in `echo $use_lineeditlibs | sed -e 's/,/ /'`; do for term_lib in "" termcap curses ncurses; do case "$term_lib" in '') TRY_LIB="-l$lineedit_lib" ;; *) TRY_LIB="-l$lineedit_lib -l$term_lib" ;; esac LIBS="$NTP_ORIG_LIBS $TRY_LIB" AC_MSG_CHECKING([for readline() with $TRY_LIB]) AC_TRY_LINK_FUNC([readline], [ntp_lib_lineedit="$TRY_LIB"]) case "$ntp_lib_lineedit" in '') AC_MSG_RESULT([no]) ;; *) # Use readline() AC_MSG_RESULT([yes]) break esac case "$term_lib" in '') # do not try el_gets without a terminal library ;; *) AC_MSG_CHECKING([for el_gets() with $TRY_LIB]) AC_TRY_LINK_FUNC([el_gets], [ntp_lib_lineedit="$TRY_LIB"]) case "$ntp_lib_lineedit" in '') AC_MSG_RESULT([no]) ;; *) # Use el_gets() AC_MSG_RESULT([yes]) break ;; esac # $ntp_lib_lineedit esac # $term_lib done case "$ntp_lib_lineedit" in '') ;; *) break ;; esac done LIBS="$NTP_ORIG_LIBS" ;; esac # $use_lineeditlibs case "$ntp_lib_lineedit" in '') ntp_lib_lineedit="no" ;; no) ;; *) EDITLINE_LIBS="$ntp_lib_lineedit" AC_SUBST([EDITLINE_LIBS]) ;; esac # $ntp_lib_lineedit case "$ntp_lib_lineedit" in no) ;; *) AC_CHECK_HEADERS([readline.h readline/readline.h histedit.h]) AC_CHECK_HEADERS([history.h readline/history.h]) case "$ac_cv_header_histedit_h" in yes) AC_CACHE_CHECK( [number of arguments to el_init()], [ntp_cv_el_init_args], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[ el_init("conftest", stdin, stdout, stderr); ]] )], [ntp_cv_el_init_args=4], [ntp_cv_el_init_args=3] )] ) AC_DEFINE_UNQUOTED( [EL_INIT_ARGS], [$ntp_cv_el_init_args], [number of args to el_init()] ) esac AC_MSG_CHECKING([whether readline supports history]) ntp_lib_lineedit_history="no" ORIG_LIBS="$LIBS" LIBS="$ORIG_LIBS $ntp_lib_lineedit" AC_TRY_LINK_FUNC([add_history], [ntp_lib_lineedit_history="yes"]) LIBS="$ORIG_LIBS" AC_MSG_RESULT([$ntp_lib_lineedit_history]) case "$ntp_lib_lineedit_history" in yes) AC_DEFINE([HAVE_READLINE_HISTORY], [1], [Define if your readline library has \`add_history']) esac esac # $ntp_lib_lineedit AS_UNSET([NTP_ORIG_LIBS]) AS_UNSET([ORIG_LIBS]) AS_UNSET([TRY_LIB]) AS_UNSET([use_lineeditlibs]) ])dnl ntp-4.2.6p5/m4/ltversion.m40000644000175000017500000000125611564122344014426 0ustar peterpeter# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file 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. # @configure_input@ # serial 3293 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4]) m4_define([LT_PACKAGE_REVISION], [1.3293]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4' macro_revision='1.3293' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) ntp-4.2.6p5/m4/define_dir.m40000644000175000017500000000162411505336022014463 0ustar peterpeterdnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) dnl dnl This macro defines (with AC_DEFINE) VARNAME to the expansion of the DIR dnl variable, taking care of fixing up ${prefix} and such. dnl dnl Note that the 3 argument form is only supported with autoconf 2.13 and dnl later (i.e. only where AC_DEFINE supports 3 arguments). dnl dnl Examples: dnl dnl AC_DEFINE_DIR(DATADIR, datadir) dnl AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries]) dnl dnl @version $Id: acinclude.m4,v 1.3 2000/08/04 03:26:22 stenn Exp $ dnl @author Alexandre Oliva AC_DEFUN([AC_DEFINE_DIR], [ ac_expanded=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""[$]$2"\" )` ifelse([$3], [], AC_DEFINE_UNQUOTED([$1], ["$ac_expanded"]), AC_DEFINE_UNQUOTED([$1], ["$ac_expanded"], [$3])) ]) ntp-4.2.6p5/m4/os_cflags.m40000644000175000017500000000455411315077754014355 0ustar peterpeterdnl ###################################################################### dnl Specify additional compile options based on the OS and the compiler AC_DEFUN([NTP_OS_CFLAGS], [ AC_MSG_CHECKING([additional compiler flags]) # allow ntp_os_flags to be preset to skip this stuff case "${ntp_os_cflags+set}" in set) ;; *) ntp_os_cflags="" case "$host_os" in aix[[1-3]]*) ;; aix4.[[0-2]]*) # turn on additional headers ntp_os_cflags="-D_XOPEN_EXTENDED_SOURCE" ;; aix5.3*) # avoid circular dependencies in yp headers, and more ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE" ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS -D_MSGQSUPPORT" ;; aix*) # avoid circular dependencies in yp headers ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE" ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS" ;; amigaos) ntp_os_cflags="-DSYS_AMIGA" ;; darwin*|macosx*|rhapsody*) ntp_os_cflags="-D_P1003_1B_VISIBLE" ;; hpux10.*) # at least for hppa2.0-hp-hpux10.20 case "$GCC" in yes) ;; *) # use Ansi compiler on HPUX, and some -Wp magic ntp_os_cflags="-Ae -Wp,-H18816" ;; esac ntp_os_cflags="${ntp_os_cflags} -D_HPUX_SOURCE" ;; hpux*) case "$GCC" in yes) ;; *) # use Ansi compiler on HPUX ntp_os_cflags="-Ae" esac ntp_os_cflags="${ntp_os_cflags} -D_HPUX_SOURCE" ;; irix6*) case "$CC" in cc) # do not use 64-bit compiler ntp_os_cflags="-n32 -mips3 -Wl,-woff,84" esac ;; nextstep3) ntp_os_cflags="-posix" ;; solaris1*|solaris2.[[0-5]]|solaris2.5.*) ;; sunos[[34]]*|sunos5.[[0-5]]|sunos5.5.*) ;; solaris2*|sunos5*) # turn on 64-bit file offset interface ntp_os_cflags="-D_LARGEFILE64_SOURCE" ;; vxworks*) case "$build" in $host) ;; *) # Quick and dirty sanity check case "$VX_KERNEL" in '') AC_MSG_ERROR([See html/build/hints/vxworks.html]) esac ntp_os_cflags="-DSYS_VXWORKS" esac ;; esac esac case "$ntp_os_flags" in '') ntp_os_cflags_msg="none needed" ;; *) ntp_os_cflags_msg="$ntp_os_cflags" CFLAGS="$CFLAGS $ntp_os_cflags" esac AC_MSG_RESULT([$ntp_os_cflags_msg]) AS_UNSET([ntp_os_cflags_msg]) ]) dnl ====================================================================== ntp-4.2.6p5/m4/ntp_lib_m.m40000644000175000017500000000060411505336023014334 0ustar peterpeterdnl ###################################################################### dnl What do we need for math libraries? AC_DEFUN([NTP_LIB_M], [ LIBM= case "$host" in *-*-darwin*) ;; *) _libs=$LIBS AC_SEARCH_LIBS([cos], [m], [LIBM="-lm"]) LIBS=$_libs ;; esac AC_SUBST([LIBM]) AS_UNSET([_libs]) ]) dnl ====================================================================== ntp-4.2.6p5/m4/ntp_openssl.m40000644000175000017500000001233011505336024014735 0ustar peterpeterdnl ###################################################################### dnl OpenSSL support shared by top-level and sntp/configure.ac AC_DEFUN([NTP_OPENSSL], [ AC_SUBST([OPENSSL]) AC_SUBST([OPENSSL_INC]) AC_SUBST([OPENSSL_LIB]) AC_MSG_CHECKING([for openssl library directory]) AC_ARG_WITH( [openssl-libdir], [AS_HELP_STRING( [--with-openssl-libdir], [+ =/something/reasonable] )], [ans=$withval], [ case "$build" in $host) ans=yes ;; *) ans=no ;; esac ] ) case "$ans" in no) ;; yes) # Look in: ans="/usr/lib /usr/lib/openssl /usr/sfw/lib /usr/local/lib /usr/local/ssl/lib /lib" ;; *) # Look where they said ;; esac case "$ans" in no) ;; *) # Look for libcrypto.a and libssl.a: for i in $ans no do case "$host" in *-*-darwin*) test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break ;; *) test -f $i/libcrypto.so -a -f $i/libssl.so && break test -f $i/libcrypto.a -a -f $i/libssl.a && break ;; esac done case "$i" in no) ans=no OPENSSL_LIB= ;; *) ans=$i OPENSSL_LIB=$ans ;; esac ;; esac AC_MSG_RESULT([$ans]) AC_MSG_CHECKING([for openssl include directory]) AC_ARG_WITH( [openssl-incdir], [AS_HELP_STRING( [--with-openssl-incdir], [+ =/something/reasonable] )], [ans=$withval], [ case "$build" in $host) ans=yes ;; *) ans=no ;; esac ] ) case "$ans" in no) ;; yes) # look in: ans="/usr/include /usr/sfw/include /usr/local/include /usr/local/ssl/include" ;; *) # Look where they said ;; esac case "$ans" in no) ;; *) # look for openssl/opensslconf.h: for i in $ans no do test -f $i/openssl/opensslconf.h && break done case "$i" in no) ans=no OPENSSL_INC= ;; *) ans=$i OPENSSL_INC=$ans ;; esac ;; esac AC_MSG_RESULT([$ans]) AC_MSG_CHECKING([if we will use crypto]) AC_ARG_WITH( [crypto], [AS_HELP_STRING( [--with-crypto], [+ =openssl] )], [ans=$withval], [ans=yes] ) case "$ans" in no) ;; yes|openssl) if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC" then ans=no else ans=yes fi esac ntp_openssl=$ans AC_MSG_RESULT([$ans]) case "$ntp_openssl" in yes) # We have OpenSSL inc/lib - use them. case "$OPENSSL_INC" in /usr/include) ;; *) CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC" ;; esac case "$OPENSSL_LIB" in /usr/lib) ;; *) LDFLAGS="$LDFLAGS -L$OPENSSL_LIB" case "$need_dash_r" in 1) LDFLAGS="$LDFLAGS -R$OPENSSL_LIB" esac ;; esac AC_SUBST([LCRYPTO], [-lcrypto]) AC_DEFINE([OPENSSL], [1], [Use OpenSSL?]) esac # # check for linking with -lcrypto failure, and try -lz -lcrypto. # Helps m68k-atari-mint # case "$ntp_openssl" in yes) NTPO_SAVED_LIBS="$LIBS" LIBS="$NTPO_SAVED_LIBS $LCRYPTO" AC_CACHE_CHECK( [if linking with $LCRYPTO alone works], [ntp_cv_bare_lcrypto], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include "openssl/err.h" #include "openssl/evp.h" ]], [[ ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); ]] )], [ntp_cv_bare_lcrypto=yes], [ntp_cv_bare_lcrypto=no] )] ) case "$ntp_cv_bare_lcrypto" in no) LIBS="$NTPO_SAVED_LIBS $LCRYPTO -lz" AC_CACHE_CHECK( [if linking with $LCRYPTO -lz works], [ntp_cv_lcrypto_lz], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include "openssl/err.h" #include "openssl/evp.h" ]], [[ ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); ]] )], [ntp_cv_lcrypto_lz=yes], [ntp_cv_lcrypto_lz=no] )] ) case "$ntp_cv_lcrypto_lz" in yes) LCRYPTO="$LCRYPTO -lz" esac esac LIBS="$NTPO_SAVED_LIBS" AS_UNSET([NTPO_SAVED_LIBS]) esac # # Older OpenSSL headers have a number of callback prototypes inside # other function prototypes which trigger copious warnings with gcc's # -Wstrict-prototypes, which is included in -Wall. # # An example: # # int i2d_RSA_NET(const RSA *a, unsigned char **pp, # int (*cb)(), int sgckey); # ^^^^^^^^^^^ # # # openssl_triggers_warnings=unknown SAVED_CFLAGS="$CFLAGS" case "$GCC$ntp_openssl" in yesyes) CFLAGS="$CFLAGS -Werror" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ ]], [[ /* see if -Werror breaks gcc */ ]] )], [gcc_handles_Werror=yes], [gcc_handles_Werror=no] ) case "$gcc_handles_Werror" in no) # if this gcc doesn't do -Werror go ahead and use # -Wstrict-prototypes. openssl_triggers_warnings=yes ;; yes) CFLAGS="$CFLAGS -Wstrict-prototypes" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include "openssl/asn1_mac.h" #include "openssl/bn.h" #include "openssl/err.h" #include "openssl/evp.h" #include "openssl/pem.h" #include "openssl/rand.h" #include "openssl/x509v3.h" ]], [[ /* empty body */ ]] )], [openssl_triggers_warnings=no], [openssl_triggers_warnings=yes] ) esac case "$openssl_triggers_warnings" in yes) CFLAGS="$SAVED_CFLAGS -Wno-strict-prototypes" ;; *) CFLAGS="$SAVED_CFLAGS -Wstrict-prototypes" esac ;; yesno) # gcc without OpenSSL CFLAGS="$SAVED_CFLAGS -Wstrict-prototypes" esac ]) dnl ====================================================================== ntp-4.2.6p5/m4/lt~obsolete.m40000644000175000017500000001375611564122345014764 0ustar peterpeter# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file 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. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) ntp-4.2.6p5/m4/ltoptions.m40000644000175000017500000002725611564122343014443 0ustar peterpeter# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) ntp-4.2.6p5/m4/ltsugar.m40000644000175000017500000001042411564122343014056 0ustar peterpeter# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) ntp-4.2.6p5/m4/ntp_dir_sep.m40000644000175000017500000000111711505336022014676 0ustar peterpeterdnl ###################################################################### dnl What directory path separator do we use? AC_DEFUN([NTP_DIR_SEP], [ AC_CACHE_CHECK( [for directory path separator], [ntp_cv_dir_sep], [ case "$ntp_cv_dir_sep" in '') case "$target_os" in *djgpp | *mingw32* | *emx*) ntp_cv_dir_sep="'\\'" ;; *) ntp_cv_dir_sep="'/'" ;; esac esac ] ) AC_DEFINE_UNQUOTED([DIR_SEP], [$ntp_cv_dir_sep], [Directory separator character, usually / or \\]) ]) dnl ====================================================================== ntp-4.2.6p5/README.patches0000644000175000017500000000317711307651603014131 0ustar peterpeterSee README.hackers for notes on coding styles. The master copy of this information can be found at: http://support.ntp.org/Dev/MaintainerIssues#How_to_work_on_a_bug_using_BitKe If you are going to patch both ntp-stable and ntp-dev please do it this way: > cd ntp-stable > (make and test your changes to ntp-stable first) > (commit your changes to ntp-stable) > cd ../ntp-dev > bk pull ../ntp-stable (get your changes from ntp-stable) > (resolve any problems and test your changes) > (commit your changes to ntp-dev) With the current release of bitkeeper it is *much* easier to move changes from ntp-stable to ntp-dev than it is to move changes from ntp-dev to ntp-stable. If you make your changes in the above order and then submit them, it will be trivial to apply your patches. Otherwise, it will be much more difficult to apply your patches. You are pretty much done now if your repos are on pogo.udel.edu. If these patches are for a bugzilla issue, mark the issue as Resolved/READY with a comment of "Please pick up the patches in pogo:/wherever" --- Please read (and follow) the previous section if you want to submit patches for both ntp-stable and ntp-dev. If you cannot easily get your patches to pogo, you may submit patches via the 'bk send' command: > cd REPO > bk citool (or bk ci ... ; bk commit ... ) > bk pull # make sure your repo is up-to-date > bk send -d -ubk://www.ntp.org/home/bk/REPO - > file-containing-the-patch > bk receive -vv -a < file-containing-the-patch # Sanity check. # Open a bugzilla item at # After the bug is opened, visit the bug and attach file-containing-the-patch ntp-4.2.6p5/results.y2kfixes0000644000175000017500000000555610017034520015003 0ustar peterpeterScript started on Sat Jan 1 04:14:09 2000 [root@timetest ntpdate]# date Sat Jan 1 04:14:11 EST 2000 [root@timetest ntpdate]# ./ntpdate -b timelord.att.com 14 Jul 13:44:39 ntpdate[11723]: step time server 135.16.xxxx.xxxx offset -14740193.210537 sec [root@timetest ntpdate]# date Wed Jul 14 13:44:42 EST 1999 [root@timetest ntpdate]# cd ../ntptrace [root@timetest ntptrace]# ./ntptrace timelord.att.com timelord.att.com: stratum 2, offset -0.000879, synch distance 0.07207 timemaster.att.com: stratum 1, offset -0.004876, synch distance 0.03485, refid 'GPS' [root@timetest ntptrace]# cd - [root@timetest ntpdate]# date Mon Feb 28 01:00:04 EST 2000 [root@timetest ntpdate]# ./ntpdate -b timelord.att.com 14 Jul 13:49:01 ntpdate[11760]: step time server 135.16.xxxx.xxxx offset -19739467.533126 sec [root@timetest ntpdate]# date Wed Jul 14 13:49:03 EST 1999 [root@timetest ntpdate]# cd - [root@timetest ntptrace]# ./ntptrace timelord.att.com timelord.att.com: stratum 2, offset 0.001383, synch distance 0.05644 timemaster.att.com: stratum 1, offset -0.006355, synch distance 0.04178, refid 'GPS' [root@timetest ntptrace]# cd - [root@timetest ntpdate]# date Tue Feb 29 01:00:05 EST 2000 [root@timetest ntpdate]# ./ntpdate -b timelord.att.com 14 Jul 13:57:41 ntpdate[12423]: step time server 135.16.xxxx.xxxx offset -19825349.396585 sec [root@timetest ntpdate]# date Wed Jul 14 13:57:43 EST 1999 [root@timetest ntpdate]# cd - [root@timetest ntptrace]# ./ntptrace timelord.att.com timelord.att.com: stratum 2, offset -0.000094, synch distance 0.06522 timemaster.att.com: stratum 1, offset -0.010803, synch distance 0.03078, refid 'GPS' [root@timetest ntptrace]# cd - [root@timetest ntpdate]# date Wed Mar 1 01:00:03 EST 2000 [root@timetest ntpdate]# ./ntpdate -b timelord.att.com 14 Jul 13:58:10 ntpdate[12525]: step time server 135.16.xxxx.xxxx offset -19911719.766061 sec [root@timetest ntpdate]# date Wed Jul 14 13:58:12 EST 1999 [root@timetest ntpdate]# cd - [root@timetest ntptrace]# ./ntptrace timelord.att.com timelord.att.com: stratum 2, offset -0.000719, synch distance 0.06561 timemaster.att.com: stratum 1, offset -0.013598, synch distance 0.03116, refid 'GPS' Script done on Wed Jul 14 13:58:28 1999 RESULTS OK. --------------------END OF TEST1-------------------- ### freeware test configuration server 127.127.1.0 prefer fudge 127.127.1.0 stratum 0 driftfile drift.log ntpdate timelord.att.com server 135.16.xxxx.xxxx stratum 1, offset 0.000033, delay 0.02975 31 Dec 23:58:59 ntpdate[83551]: adjust time server 135.16.74.3 offset 0.039057 s ec ntpdate timelord.att.com server 135.16.xxxx.xxxx stratum 1, offset 0.000019, delay 0.02504 01 Jan 00:01:05 ntpdate[8352]: adjust time server 135.16.74.3 offset 0.039057 s ec ntpdate timelord.att.com server 135.25.xxxx.xxxx, stratum 1, offset -0.000023, delay 0.02731 29 Feb 00:02:15 ntpdate[8353]: adjust time server 135.25.xxxx.xxxx offset -0.000023 sec ntp-4.2.6p5/config.h.in0000644000175000017500000010165111675460443013652 0ustar peterpeter/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Is adjtime() accurate? */ #undef ADJTIME_IS_ACCURATE /* CHU audio/decoder? */ #undef AUDIO_CHU /* ACTS modem service */ #undef CLOCK_ACTS /* Arbiter 1088A/B GPS receiver */ #undef CLOCK_ARBITER /* ARCRON support? */ #undef CLOCK_ARCRON_MSF /* Austron 2200A/2201A GPS receiver? */ #undef CLOCK_AS2201 /* PPS interface? */ #undef CLOCK_ATOM /* Datum/Bancomm bc635/VME interface? */ #undef CLOCK_BANC /* Chronolog K-series WWVB receiver? */ #undef CLOCK_CHRONOLOG /* CHU modem/decoder */ #undef CLOCK_CHU /* Diems Computime Radio Clock? */ #undef CLOCK_COMPUTIME /* Datum Programmable Time System? */ #undef CLOCK_DATUM /* ELV/DCF7000 clock? */ #undef CLOCK_DCF7000 /* Dumb generic hh:mm:ss local clock? */ #undef CLOCK_DUMBCLOCK /* Forum Graphic GPS datating station driver? */ #undef CLOCK_FG /* TrueTime GPS receiver/VME interface? */ #undef CLOCK_GPSVME /* Heath GC-1000 WWV/WWVH receiver? */ #undef CLOCK_HEATH /* HOPF 6021 clock? */ #undef CLOCK_HOPF6021 /* HOPF PCI clock device? */ #undef CLOCK_HOPF_PCI /* HOPF serial clock device? */ #undef CLOCK_HOPF_SERIAL /* HP 58503A GPS receiver? */ #undef CLOCK_HPGPS /* IRIG audio decoder? */ #undef CLOCK_IRIG /* JJY receiver? */ #undef CLOCK_JJY /* Rockwell Jupiter GPS clock? */ #undef CLOCK_JUPITER /* Leitch CSD 5300 Master Clock System Driver? */ #undef CLOCK_LEITCH /* local clock reference? */ #undef CLOCK_LOCAL /* Meinberg clocks */ #undef CLOCK_MEINBERG /* Magnavox MX4200 GPS receiver */ #undef CLOCK_MX4200 /* NeoClock4X */ #undef CLOCK_NEOCLOCK4X /* NMEA GPS receiver */ #undef CLOCK_NMEA /* Motorola UT Oncore GPS */ #undef CLOCK_ONCORE /* Palisade clock */ #undef CLOCK_PALISADE /* PARSE driver interface */ #undef CLOCK_PARSE /* Conrad parallel port radio clock */ #undef CLOCK_PCF /* PCL 720 clock support */ #undef CLOCK_PPS720 /* PST/Traconex 1020 WWV/WWVH receiver */ #undef CLOCK_PST /* DCF77 raw time code */ #undef CLOCK_RAWDCF /* RCC 8000 clock */ #undef CLOCK_RCC8000 /* RIPE NCC Trimble clock */ #undef CLOCK_RIPENCC /* Schmid DCF77 clock */ #undef CLOCK_SCHMID /* clock thru shared memory */ #undef CLOCK_SHM /* Spectracom 8170/Netclock/2 WWVB receiver */ #undef CLOCK_SPECTRACOM /* KSI/Odetics TPRO/S GPS receiver/IRIG interface */ #undef CLOCK_TPRO /* Trimble GPS receiver/TAIP protocol */ #undef CLOCK_TRIMTAIP /* Trimble GPS receiver/TSIP protocol */ #undef CLOCK_TRIMTSIP /* Kinemetrics/TrueTime receivers */ #undef CLOCK_TRUETIME /* TrueTime 560 IRIG-B decoder? */ #undef CLOCK_TT560 /* Ultralink M320 WWVB receiver? */ #undef CLOCK_ULINK /* VARITEXT clock */ #undef CLOCK_VARITEXT /* WHARTON 400A Series clock */ #undef CLOCK_WHARTON_400A /* WWV audio driver */ #undef CLOCK_WWV /* Zyfer GPStarplus */ #undef CLOCK_ZYFER /* Enable ntpd debugging code? */ #undef DEBUG /* Enable processing time debugging? */ #undef DEBUG_TIMING /* Declaration style */ #undef DECL_ADJTIME_0 /* Declaration style */ #undef DECL_BCOPY_0 /* Declaration style */ #undef DECL_BZERO_0 /* Declaration style */ #undef DECL_CFSETISPEED_0 /* Declare errno? */ #undef DECL_ERRNO /* Declaration style */ #undef DECL_HSTRERROR_0 /* Declare h_errno? */ #undef DECL_H_ERRNO /* Declaration style */ #undef DECL_INET_NTOA_0 /* Declaration style */ #undef DECL_IOCTL_0 /* Declaration style */ #undef DECL_IPC_0 /* Declaration style */ #undef DECL_MEMMOVE_0 /* Declaration style */ #undef DECL_MKSTEMP_0 /* Declaration style */ #undef DECL_MKTEMP_0 /* Declaration style */ #undef DECL_NLIST_0 /* Declaration style */ #undef DECL_PLOCK_0 /* Declaration style */ #undef DECL_RENAME_0 /* Declaration style */ #undef DECL_SELECT_0 /* Declaration style */ #undef DECL_SETITIMER_0 /* Declaration style */ #undef DECL_SETPRIORITY_0 /* Declaration style */ #undef DECL_SETPRIORITY_1 /* Declaration style */ #undef DECL_SIGVEC_0 /* Declaration style */ #undef DECL_STDIO_0 /* Declaration style */ #undef DECL_STIME_0 /* Declaration style */ #undef DECL_STIME_1 /* Declaration style */ #undef DECL_STRERROR_0 /* Declaration style */ #undef DECL_STRTOL_0 /* Declare syscall()? */ #undef DECL_SYSCALL /* Declaration style */ #undef DECL_SYSLOG_0 /* Declaration style */ #undef DECL_TIMEOFDAY_0 /* Declaration style */ #undef DECL_TIME_0 /* Declaration style */ #undef DECL_TOLOWER_0 /* Declaration style */ #undef DECL_TOUPPER_0 /* What is the fallback value for HZ? */ #undef DEFAULT_HZ /* Directory separator character, usually / or \\ */ #undef DIR_SEP /* use old autokey session key behavior? */ #undef DISABLE_BUG1243_FIX /* synch TODR hourly? */ #undef DOSYNCTODR /* The number of minutes in a DST adjustment */ #undef DSTMINUTES /* number of args to el_init() */ #undef EL_INIT_ARGS /* Force deferred DNS lookups? */ #undef FORCE_DEFER_DNS /* force ntpdate to step the clock if !defined(STEP_SLEW) ? */ #undef FORCE_NTPDATE_STEP /* What is getsockname()'s socklen type? */ #undef GETSOCKNAME_SOCKLEN_TYPE /* Do we have a routing socket (rt_msghdr or rtattr)? */ #undef HAS_ROUTING_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_NAMESER_H /* Do we have audio support? */ #undef HAVE_AUDIO /* Define to 1 if you have the header file. */ #undef HAVE_BSTRING_H /* Define to 1 if you have the `canonicalize_file_name' function. */ #undef HAVE_CANONICALIZE_FILE_NAME /* Do we have the CIOGETEV ioctl (SunOS, Linux)? */ #undef HAVE_CIOGETEV /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the `clock_settime' function. */ #undef HAVE_CLOCK_SETTIME /* Define to 1 if you have the `daemon' function. */ #undef HAVE_DAEMON /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Use Rendezvous/DNS-SD registration */ #undef HAVE_DNSREGISTRATION /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Can we drop root privileges? */ #undef HAVE_DROPROOT /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `finite' function. */ #undef HAVE_FINITE /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `getbootfile' function. */ #undef HAVE_GETBOOTFILE /* Define to 1 if you have the `getclock' function. */ #undef HAVE_GETCLOCK /* Define to 1 if you have the `getdtablesize' function. */ #undef HAVE_GETDTABLESIZE /* Define to 1 if you have the `getifaddrs' function. */ #undef HAVE_GETIFADDRS /* Define to 1 if you have the `getpassphrase' function. */ #undef HAVE_GETPASSPHRASE /* Define to 1 if you have the `getrusage' function. */ #undef HAVE_GETRUSAGE /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID /* Define to 1 if you have the header file. */ #undef HAVE_HISTEDIT_H /* Define to 1 if you have the header file. */ #undef HAVE_HISTORY_H /* Define to 1 if you have the `hstrerror' function. */ #undef HAVE_HSTRERROR /* Obvious */ #undef HAVE_HZ_IN_STRUCT_CLOCKINFO /* Define to 1 if you have the header file. */ #undef HAVE_IEEEFP_H /* have iflist_sysctl? */ #undef HAVE_IFLIST_SYSCTL /* Define to 1 if you have the `if_nametoindex' function. */ #undef HAVE_IF_NAMETOINDEX /* inline keyword or macro available */ #undef HAVE_INLINE /* Define to 1 if the system has the type `int16_t'. */ #undef HAVE_INT16_T /* Define to 1 if the system has the type `int32_t'. */ #undef HAVE_INT32_T /* Define to 1 if the system has the type `int8_t'. */ #undef HAVE_INT8_T /* Define to 1 if the system has the type `intptr_t'. */ #undef HAVE_INTPTR_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Do we have IPTOS support? */ #undef HAVE_IPTOS_SUPPORT /* Define to 1 if you have the `isfinite' function. */ #undef HAVE_ISFINITE /* Define to 1 if you have the header file. */ #undef HAVE_KVM_H /* Define to 1 if you have the `kvm_open' function. */ #undef HAVE_KVM_OPEN /* Define to 1 if you have the `elf' library (-lelf). */ #undef HAVE_LIBELF /* Define to 1 if you have the `gen' library (-lgen). */ #undef HAVE_LIBGEN /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H /* Define to 1 if you have the `kvm' library (-lkvm). */ #undef HAVE_LIBKVM /* Define to 1 if you have the `ld' library (-lld). */ #undef HAVE_LIBLD /* Define to 1 if you have the `mld' library (-lmld). */ #undef HAVE_LIBMLD /* Define to 1 if you have the `posix4' library (-lposix4). */ #undef HAVE_LIBPOSIX4 /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT /* Define to 1 if you have the header file. */ #undef HAVE_LIBSCF_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Do we have Linux capabilities? */ #undef HAVE_LINUX_CAPABILITIES /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_IF_ADDR_H /* Define to 1 if the system has the type `long'. */ #undef HAVE_LONG /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_INLINE_H /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_SOUNDCARD_H /* Define to 1 if you have the header file. */ #undef HAVE_MATH_H /* Define to 1 if you have the `MD5Init' function. */ #undef HAVE_MD5INIT /* Define to 1 if you have the header file. */ #undef HAVE_MD5_H /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the `memlk' function. */ #undef HAVE_MEMLK /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if you have the `mktime' function. */ #undef HAVE_MKTIME /* Define to 1 if you have the `mlockall' function. */ #undef HAVE_MLOCKALL /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_SYSTEM_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_SYSTM_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_VAR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IP_H /* NetInfo support? */ #undef HAVE_NETINFO /* Define to 1 if you have the header file. */ #undef HAVE_NETINFO_NI_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF6_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_VAR_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_NETMP_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_ROUTE_H /* Define to 1 if you have the `nice' function. */ #undef HAVE_NICE /* Define to 1 if you have the `nlist' function. */ #undef HAVE_NLIST /* Define to 1 if you have the header file. */ #undef HAVE_NLIST_H /* Define to 1 if you have the `ntp_adjtime' function. */ #undef HAVE_NTP_ADJTIME /* Define to 1 if you have the `ntp_gettime' function. */ #undef HAVE_NTP_GETTIME /* Do we want support for Samba's signing daemon? */ #undef HAVE_NTP_SIGND /* Define to 1 if the system has the type `pid_t'. */ #undef HAVE_PID_T /* Define to 1 if you have the `plock' function. */ #undef HAVE_PLOCK /* Define to 1 if you have the header file. */ #undef HAVE_POLL_H /* Do we have the PPS API per the Draft RFC? */ #undef HAVE_PPSAPI /* Define to 1 if you have the `pututline' function. */ #undef HAVE_PUTUTLINE /* Define to 1 if you have the `pututxline' function. */ #undef HAVE_PUTUTXLINE /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_H /* Define if your readline library has \`add_history' */ #undef HAVE_READLINE_HISTORY /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* Define to 1 if you have the `readlink' function. */ #undef HAVE_READLINK /* Define to 1 if you have the `recvmsg' function. */ #undef HAVE_RECVMSG /* Define to 1 if you have the header file. */ #undef HAVE_RESOLV_H /* Define to 1 if you have the `res_init' function. */ #undef HAVE_RES_INIT /* Do we have Linux routing socket? */ #undef HAVE_RTNETLINK /* Define to 1 if you have the `rtprio' function. */ #undef HAVE_RTPRIO /* Define to 1 if you have the header file. */ #undef HAVE_RUNETYPE_H /* Obvious */ #undef HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION /* Define to 1 if you have the header file. */ #undef HAVE_SCHED_H /* Define to 1 if you have the `sched_setscheduler' function. */ #undef HAVE_SCHED_SETSCHEDULER /* Define to 1 if you have the header file. */ #undef HAVE_SETJMP_H /* Define to 1 if you have the `setlinebuf' function. */ #undef HAVE_SETLINEBUF /* Define to 1 if you have the `setpgid' function. */ #undef HAVE_SETPGID /* define if setpgrp takes 0 arguments */ #undef HAVE_SETPGRP_0 /* Define to 1 if you have the `setpriority' function. */ #undef HAVE_SETPRIORITY /* Define to 1 if you have the `setrlimit' function. */ #undef HAVE_SETRLIMIT /* Define to 1 if you have the `setsid' function. */ #undef HAVE_SETSID /* Define to 1 if you have the `settimeofday' function. */ #undef HAVE_SETTIMEOFDAY /* Define to 1 if you have the `setvbuf' function. */ #undef HAVE_SETVBUF /* Define to 1 if you have the header file. */ #undef HAVE_SGTTY_H /* Define to 1 if you have the `sigaction' function. */ #undef HAVE_SIGACTION /* Can we use SIGIO for tcp and udp IO? */ #undef HAVE_SIGNALED_IO /* Define to 1 if you have the `sigset' function. */ #undef HAVE_SIGSET /* Define to 1 if you have the `sigsuspend' function. */ #undef HAVE_SIGSUSPEND /* Define to 1 if you have the `sigvec' function. */ #undef HAVE_SIGVEC /* Define to 1 if the system has the type `size_t'. */ #undef HAVE_SIZE_T /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Are Solaris privileges available? */ #undef HAVE_SOLARIS_PRIVS /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `stime' function. */ #undef HAVE_STIME /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strsignal' function. */ #undef HAVE_STRSIGNAL /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Do we have struct ntptimeval? */ #undef HAVE_STRUCT_NTPTIMEVAL /* Define to 1 if `time.tv_nsec' is a member of `struct ntptimeval'. */ #undef HAVE_STRUCT_NTPTIMEVAL_TIME_TV_NSEC /* Does a system header define struct ppsclockev? */ #undef HAVE_STRUCT_PPSCLOCKEV /* Do we have struct snd_size? */ #undef HAVE_STRUCT_SND_SIZE /* Does a system header define struct sockaddr_storage? */ #undef HAVE_STRUCT_SOCKADDR_STORAGE /* struct timespec declared? */ #undef HAVE_STRUCT_TIMESPEC /* Define to 1 if you have the header file. */ #undef HAVE_SUN_AUDIOIO_H /* Define to 1 if you have the `sysconf' function. */ #undef HAVE_SYSCONF /* Define to 1 if you have the `sysctl' function. */ #undef HAVE_SYSCTL /* Define to 1 if you have the header file. */ #undef HAVE_SYSEXITS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_AUDIOIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CAPABILITY_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CLKDEFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CLOCKCTL_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_I8253_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IPC_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_LOCK_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MODEM_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PCL720_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_POLL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PPSCLOCK_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PPSTIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PRCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PROCSET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PROC_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SCHED_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SHM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SIGNAL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOUNDCARD_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STREAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STROPTS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSSGI_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSTUNE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMEPPS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMERS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMEX_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TPRO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Use sys/uio.h for struct iovec help */ #undef HAVE_SYS_UIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VAR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if the system has the type `s_char'. */ #undef HAVE_S_CHAR /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIO_H /* Obvious */ #undef HAVE_TICKADJ_IN_STRUCT_CLOCKINFO /* Define to 1 if you have the `timegm' function. */ #undef HAVE_TIMEGM /* Define to 1 if you have the header file. */ #undef HAVE_TIMEPPS_H /* Define to 1 if you have the `timer_create' function. */ #undef HAVE_TIMER_CREATE /* Define to 1 if you have the `timer_settime' function. */ #undef HAVE_TIMER_SETTIME /* Define to 1 if you have the header file. */ #undef HAVE_TIMEX_H /* Define to 1 if the system has the type `time_t'. */ #undef HAVE_TIME_T /* Do we have the TIOCGPPSEV ioctl (Solaris)? */ #undef HAVE_TIOCGPPSEV /* Do we have the TIOCSPPS ioctl (Solaris)? */ #undef HAVE_TIOCSPPS /* Do we have the TIO serial stuff? */ #undef HAVE_TIO_SERIAL_STUFF /* Does u_int64_t exist? */ #undef HAVE_TYPE_U_INT64_T /* Does u_int8_t exist? */ #undef HAVE_TYPE_U_INT8_T /* Define to 1 if the system has the type `uint16_t'. */ #undef HAVE_UINT16_T /* Define to 1 if the system has the type `uint32_t'. */ #undef HAVE_UINT32_T /* Define to 1 if the system has the type `uint8_t'. */ #undef HAVE_UINT8_T /* Define to 1 if the system has the type `uintptr_t'. */ #undef HAVE_UINTPTR_T /* Define to 1 if the system has the type `uint_t'. */ #undef HAVE_UINT_T /* Define to 1 if you have the `umask' function. */ #undef HAVE_UMASK /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `updwtmp' function. */ #undef HAVE_UPDWTMP /* Define to 1 if you have the `updwtmpx' function. */ #undef HAVE_UPDWTMPX /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UTMPX_H /* Define to 1 if you have the header file. */ #undef HAVE_UTMP_H /* Define to 1 if you have the header file. */ #undef HAVE_VALUES_H /* Define to 1 if you have the header file. */ #undef HAVE_VARARGS_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the `vsprintf' function. */ #undef HAVE_VSPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if the system has the type `wchar_t'. */ #undef HAVE_WCHAR_T /* Define to 1 if the system has the type `wint_t'. */ #undef HAVE_WINT_T /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if you have the header file. */ #undef HAVE__SYS_SYNC_QUEUE_H /* Define to 1 if you have the header file. */ #undef HAVE__SYS_SYNC_SEMA_H /* Define to 1 if you have the `__adjtimex' function. */ #undef HAVE___ADJTIMEX /* Define to 1 if you have the `__ntp_gettime' function. */ #undef HAVE___NTP_GETTIME /* Define to 1 if you have the `__res_init' function. */ #undef HAVE___RES_INIT /* Does struct sockaddr_storage have __ss_family? */ #undef HAVE___SS_FAMILY_IN_SS /* Handle sockaddr_storage.__ss_family */ #ifdef HAVE___SS_FAMILY_IN_SS # define ss_family __ss_family #endif /* HAVE___SS_FAMILY_IN_SS */ /* Does struct sockaddr_storage have __ss_len? */ #undef HAVE___SS_LEN_IN_SS /* Handle sockaddr_storage.__ss_len */ #ifdef HAVE___SS_LEN_IN_SS # define ss_len __ss_len #endif /* HAVE___SS_LEN_IN_SS */ /* Retry queries on _any_ DNS error? */ #undef IGNORE_DNS_ERRORS /* Should we use the IRIG sawtooth filter? */ #undef IRIG_SUCKS /* Do we need to fix in6isaddr? */ #undef ISC_PLATFORM_FIXIN6ISADDR /* ISC: do we have if_nametoindex()? */ #undef ISC_PLATFORM_HAVEIFNAMETOINDEX /* have struct if_laddrconf? */ #undef ISC_PLATFORM_HAVEIF_LADDRCONF /* have struct if_laddrreq? */ #undef ISC_PLATFORM_HAVEIF_LADDRREQ /* have struct in6_pktinfo? */ #undef ISC_PLATFORM_HAVEIN6PKTINFO /* have IPv6? */ #undef ISC_PLATFORM_HAVEIPV6 /* struct sockaddr has sa_len? */ #undef ISC_PLATFORM_HAVESALEN /* sin6_scope_id? */ #undef ISC_PLATFORM_HAVESCOPEID /* missing in6addr_any? */ #undef ISC_PLATFORM_NEEDIN6ADDRANY /* Do we need netinet6/in6.h? */ #undef ISC_PLATFORM_NEEDNETINET6IN6H /* ISC: provide inet_ntop() */ #undef ISC_PLATFORM_NEEDNTOP /* Declare in_port_t? */ #undef ISC_PLATFORM_NEEDPORTT /* ISC: provide inet_pton() */ #undef ISC_PLATFORM_NEEDPTON /* Does the kernel have an FLL bug? */ #undef KERNEL_FLL_BUG /* Does the kernel support precision time discipline? */ #undef KERNEL_PLL /* What is (probably) the name of DOSYNCTODR in the kernel? */ #undef K_DOSYNCTODR_NAME /* What is (probably) the name of NOPRINTF in the kernel? */ #undef K_NOPRINTF_NAME /* What is the name of TICKADJ in the kernel? */ #undef K_TICKADJ_NAME /* What is the name of TICK in the kernel? */ #undef K_TICK_NAME /* Should we align with the NIST lockclock scheme? */ #undef LOCKCLOCK /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Does the target support multicast IP? */ #undef MCAST /* Should we recommend a minimum value for tickadj? */ #undef MIN_REC_TICKADJ /* Do we need HPUX adjtime() library support? */ #undef NEED_HPUX_ADJTIME /* Do we want the HPUX FindConfig()? */ #undef NEED_HPUX_FINDCONFIG /* We need to provide netsnmp_daemonize() */ #undef NEED_NETSNMP_DAEMONIZE /* Do we need the qnx adjtime call? */ #undef NEED_QNX_ADJTIME /* Do we need extra room for SO_RCVBUF? (HPUX < 8) */ #undef NEED_RCVBUF_SLOP /* Do we need an s_char typedef? */ #undef NEED_S_CHAR_TYPEDEF /* Might nlist() values require an extra level of indirection (AIX)? */ #undef NLIST_EXTRA_INDIRECTION /* does struct nlist use a name union? */ #undef NLIST_NAME_UNION /* nlist stuff */ #undef NLIST_STRUCT /* Should we NOT read /dev/kmem? */ #undef NOKMEM /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Should we avoid #warning on option name collisions? */ #undef NO_OPTION_NAME_WARNINGS /* Is there a problem using PARENB and IGNPAR? */ #undef NO_PARENB_IGNPAR /* Default location of crypto key info */ #undef NTP_KEYSDIR /* Path to sign daemon rendezvous socket */ #undef NTP_SIGND_PATH /* Do we have ntp_{adj,get}time in libc? */ #undef NTP_SYSCALLS_LIBC /* Do we have ntp_{adj,get}time in the kernel? */ #undef NTP_SYSCALLS_STD /* Do we have support for SHMEM_STATUS? */ #undef ONCORE_SHMEM_STATUS /* Use OpenSSL? */ #undef OPENSSL /* Should we open the broadcast socket? */ #undef OPEN_BCAST_SOCKET /* need to recreate sockets on changed routing? */ #undef OS_MISSES_SPECIFIC_ROUTE_UPDATES /* wildcard socket needs REUSEADDR to bind interface addresses */ #undef OS_NEEDS_REUSEADDR_FOR_IFADDRBIND /* Do we need to override the system's idea of HZ? */ #undef OVERRIDE_HZ /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* define to a working POSIX compliant shell */ #undef POSIX_SHELL /* Do we have the ppsclock streams module? */ #undef PPS /* PARSE kernel PLL PPS support */ #undef PPS_SYNC /* Preset a value for 'tick'? */ #undef PRESET_TICK /* Preset a value for 'tickadj'? */ #undef PRESET_TICKADJ /* Does qsort expect to work on "void *" stuff? */ #undef QSORT_USES_VOID_P /* Should we not IGNPAR (Linux)? */ #undef RAWDCF_NO_IGNPAR /* Basic refclock support? */ #undef REFCLOCK /* Do we want the ReliantUNIX clock hacks? */ #undef RELIANTUNIX_CLOCK /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* saveconfig mechanism */ #undef SAVECONFIG /* Do we want the SCO clock hacks? */ #undef SCO5_CLOCK /* The size of `char*', as computed by sizeof. */ #undef SIZEOF_CHARP /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* The size of `signed char', as computed by sizeof. */ #undef SIZEOF_SIGNED_CHAR /* The size of `time_t', as computed by sizeof. */ #undef SIZEOF_TIME_T /* Does SIOCGIFCONF return size in the buffer? */ #undef SIZE_RETURNED_IN_BUFFER /* Slew always? */ #undef SLEWALWAYS /* *s*printf() functions are char* */ #undef SPRINTF_CHAR /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Step, then slew the clock? */ #undef STEP_SLEW /* canonical system (cpu-vendor-os) of where we should run */ #undef STR_SYSTEM /* Does Xettimeofday take 1 arg? */ #undef SYSV_TIMEOFDAY /* Do we need to #define _SVID3 when we #include ? */ #undef TERMIOS_NEEDS__SVID3 /* Is K_TICKADJ_NAME in nanoseconds? */ #undef TICKADJ_NANO /* Is K_TICK_NAME in nanoseconds? */ #undef TICK_NANO /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Do we have the tty_clk line discipline/streams module? */ #undef TTYCLK /* Provide a typedef for uintptr_t? */ #ifndef HAVE_UINTPTR_T typedef unsigned int uintptr_t; #define HAVE_UINTPTR_T 1 #endif /* What type to use for setsockopt */ #undef TYPEOF_IP_MULTICAST_LOOP /* Do we set process groups with -pid? */ #undef UDP_BACKWARDS_SETOWN /* Must we have a CTTY for fsetown? */ #undef USE_FSETOWNCTTY /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Can we use SIGPOLL for tty IO? */ #undef USE_TTY_SIGPOLL /* Can we use SIGPOLL for UDP? */ #undef USE_UDP_SIGPOLL /* Version number of package */ #undef VERSION /* configure --enable-ipv6 */ #undef WANT_IPV6 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Are we _special_? */ #undef __APPLE_USE_RFC_3542 /* Define to 1 if type `char' is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ # undef __CHAR_UNSIGNED__ #endif /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t /* Define as `fork' if `vfork' does not work. */ #undef vfork /* define away volatile? */ #undef volatile #ifndef MPINFOU_PREDECLARED # define MPINFOU_PREDECLARED typedef union mpinfou { /* For lint */ struct pdk_mpinfo *pdkptr; struct mpinfo *pikptr; } mpinfou_t; #endif ntp-4.2.6p5/ylwrap0000755000175000017500000001404311307652134013061 0ustar peterpeter#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, # 2007, 2009 Free Software Foundation, Inc. # # Written by Tom Tromey . # # 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 2, 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 . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ntp-4.2.6p5/config.sub0000755000175000017500000010457111606457142013612 0ustar peterpeter#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-06-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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 2 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, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ntp-4.2.6p5/Makefile.in0000644000175000017500000007014311675460302013667 0ustar peterpeter# 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 = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure ChangeLog INSTALL NEWS TODO compile \ config.guess config.sub depcomp install-sh ltmain.sh missing \ ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/define_dir.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_cacheversion.m4 \ $(top_srcdir)/m4/ntp_dir_sep.m4 \ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \ $(top_srcdir)/m4/ntp_openssl.m4 \ $(top_srcdir)/m4/ntp_vpathhack.m4 \ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ 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@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SH = @PATH_SH@ PATH_TEST = @PATH_TEST@ POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CFLAGS = @SNMP_CFLAGS@ SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ SNMP_LIBS = @SNMP_LIBS@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ VERSION = @VERSION@ 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_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@ AUTOMAKE_OPTIONS = foreign 1.10 ACLOCAL_AMFLAGS = -I m4 -I sntp/libopts/m4 NULL = SUBDIRS = scripts include ElectricFence libntp sntp libparse ntpd \ ntpdate ntpdc ntpq ntpsnmpd parseutil adjtimed clockstuff \ kernel util $(NULL) DIST_SUBDIRS = \ scripts \ include \ ElectricFence \ libntp \ libparse \ sntp \ ntpd \ ntpdate \ ntpdc \ ntpq \ ntpsnmpd \ parseutil \ adjtimed \ clockstuff \ kernel \ util \ $(NULL) DISTCHECK_CONFIGURE_FLAGS = -C EXTRA_DIST = \ $(srcdir)/COPYRIGHT \ ChangeLog \ CommitLog \ CommitLog-4.1.0 \ NEWS \ NOTES.y2kfixes \ README.bk \ README.hackers \ README.patches \ README.refclocks \ README.versions \ TODO \ WHERE-TO-START \ bootstrap \ build \ config.guess \ config.h.in \ config.sub \ dot.emacs \ excludes \ flock-build \ install-sh \ packageinfo.sh \ readme.y2kfixes \ results.y2kfixes \ \ conf \ html \ lib/isc \ ports \ \ bincheck.mf \ depsver.mf \ deps-ver \ $(srcdir)/version \ version.m4 \ \ $(NULL) CLEANFILES = DISTCLEANFILES = .gcc-warning ETAGS_ARGS = Makefile.am configure.ac # HMS: Keep .gcc-warning first, as that way it gets printed first. BUILT_SOURCES = \ .gcc-warning \ libtool \ $(srcdir)/COPYRIGHT \ $(srcdir)/version \ $(srcdir)/version.m4 \ $(srcdir)/include/version.def \ $(srcdir)/include/version.texi \ $(srcdir)/.checkChangeLog \ $(NULL) # HMS: The following seems to be a work-in-progress... CVO = `$(srcdir)/config.guess` BHOST = `(hostname || uname -n)` all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ ctags-recursive install install-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am $(srcdir)/COPYRIGHT: $(srcdir)/html/copyright.html { echo "This file is automatically generated from html/copyright.html" ; \ lynx -dump $(srcdir)/html/copyright.html ;} > COPYRIGHT.new \ && mv -f COPYRIGHT.new $(srcdir)/COPYRIGHT COPYRIGHT-please: $(srcdir)/COPYRIGHT @: do-nothing action to prevent default \ This target is needed by sntp/Makefile.am on decrepit \ FreeBSD 6.x make which fails with "make COPYRIGHT" \ configured in $(srcdir) but "make ./COPYRIGHT" succeeds. \ Rather than determine our $(srcdir) from sntp/Makefile.am \ COPYRIGHT-please serves as a fixed target. # HMS: The next bit is still suboptimal. If bk is present but this NTP # repo is not a bk repo, we'll get an error message from the prs command. # Unfortunately, I haven't found the necessary magic to redirect this error # output to /dev/null under ancient/unique shells like the one Ultrix uses. # We'll also get an error if srcdir or version is unwritable. $(srcdir)/version: FRC.version -(bk version) >/dev/null 2>&1 && \ cd $(srcdir) && \ x=`bk -R prs -hr+ -nd:I: ChangeSet` && \ y=`cat version 2>/dev/null` || true && \ case "$$x" in ''|$$y) ;; *) echo $$x > version ;; esac $(srcdir)/version.m4: $(srcdir)/packageinfo.sh TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \ ./scripts/genver version.m4 $(srcdir)/include/version.def: $(srcdir)/packageinfo.sh TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \ ./scripts/genver include/version.def $(srcdir)/include/version.texi: $(srcdir)/packageinfo.sh TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \ ./scripts/genver include/version.texi $(srcdir)/.checkChangeLog: $(srcdir)/ChangeLog $(srcdir)/scripts/checkChangeLog cd $(srcdir) && \ ./scripts/checkChangeLog libtool: $(LIBTOOL_DEPS) ./config.status --recheck dist-hook: @find $(distdir) -type d -name SCCS -print | xargs rm -rf .gcc-warning: @echo "Compiling with GCC now generates lots of new warnings." @echo " " @echo "Don't be concerned. They're just warnings." @echo " " @echo "Don't send bug reports about the warnings, either." @echo " " @echo "Feel free to send patches that fix these warnings, though." @echo " " @sleep 1 @touch $@ CommitLog: FRC.CommitLog cd $(srcdir) \ && $(PATH_TEST) -e CommitLog \ -a SCCS/s.ChangeSet -ot CommitLog \ || scripts/genCommitLog .buildcvo: echo "$(CVO)" > .buildcvo .checkcvo: .buildcvo FRC.checkcvo @if [ "`cat .buildcvo`" != "$(CVO)" ];then \ echo "This directory was configured for `cat .buildcvo`"; \ echo "but this machine is a $(CVO)"; \ exit 1; \ fi .buildhost: echo "$(BHOST)" > .buildhost .checkhost: .buildhost FRC.checkhost @if [ "`cat .buildhost`" != "$(BHOST)" ];then \ echo "Built on `cat .buildhost` but this is $(BHOST)"; \ echo " "; \ fi FRC.CommitLog FRC.distwarn FRC.checkcvo FRC.checkhost FRC.version: @: do-nothing action prevents any default # HMS: what was I trying to do with this? #dot.emacs: FRC.distwarn # 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: ntp-4.2.6p5/util/0000755000175000017500000000000011710605402012562 5ustar peterpeterntp-4.2.6p5/util/ntp-keygen.c0000644000175000017500000017045611675457724015052 0ustar peterpeter/* * Program to generate cryptographic keys for ntp clients and servers * * This program generates password encrypted data files for use with the * Autokey security protocol and Network Time Protocol Version 4. Files * are prefixed with a header giving the name and date of creation * followed by a type-specific descriptive label and PEM-encoded data * structure compatible with programs of the OpenSSL library. * * All file names are like "ntpkey__.", where * is the file type, the generating host name and * the generation time in NTP seconds. The NTP programs * expect generic names such as "ntpkey__whimsy.udel.edu" with the * association maintained by soft links. Following is a list of file * types; the first line is the file name and the second link name. * * ntpkey_MD5key_. * MD5 (128-bit) keys used to compute message digests in symmetric * key cryptography * * ntpkey_RSAhost_. * ntpkey_host_ * RSA private/public host key pair used for public key signatures * * ntpkey_RSAsign_. * ntpkey_sign_ * RSA private/public sign key pair used for public key signatures * * ntpkey_DSAsign_. * ntpkey_sign_ * DSA Private/public sign key pair used for public key signatures * * Available digest/signature schemes * * RSA: RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, EVP-RIPEMD160 * DSA: DSA-SHA, DSA-SHA1 * * ntpkey_XXXcert_. * ntpkey_cert_ * X509v3 certificate using RSA or DSA public keys and signatures. * XXX is a code identifying the message digest and signature * encryption algorithm * * Identity schemes. The key type par is used for the challenge; the key * type key is used for the response. * * ntpkey_IFFkey_. * ntpkey_iffkey_ * Schnorr (IFF) identity parameters and keys * * ntpkey_GQkey_., * ntpkey_gqkey_ * Guillou-Quisquater (GQ) identity parameters and keys * * ntpkey_MVkeyX_., * ntpkey_mvkey_ * Mu-Varadharajan (MV) identity parameters and keys * * Note: Once in a while because of some statistical fluke this program * fails to generate and verify some cryptographic data, as indicated by * exit status -1. In this case simply run the program again. If the * program does complete with exit code 0, the data are correct as * verified. * * These cryptographic routines are characterized by the prime modulus * size in bits. The default value of 512 bits is a compromise between * cryptographic strength and computing time and is ordinarily * considered adequate for this application. The routines have been * tested with sizes of 256, 512, 1024 and 2048 bits. Not all message * digest and signature encryption schemes work with sizes less than 512 * bits. The computing time for sizes greater than 2048 bits is * prohibitive on all but the fastest processors. An UltraSPARC Blade * 1000 took something over nine minutes to generate and verify the * values with size 2048. An old SPARC IPC would take a week. * * The OpenSSL library used by this program expects a random seed file. * As described in the OpenSSL documentation, the file name defaults to * first the RANDFILE environment variable in the user's home directory * and then .rnd in the user's home directory. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include "ntp_types.h" #include "ntp_random.h" #include "ntp_stdlib.h" #include "ntp_assert.h" #include "ntp_libopts.h" #include "ntp-keygen-opts.h" #ifdef OPENSSL #include "openssl/bn.h" #include "openssl/evp.h" #include "openssl/err.h" #include "openssl/rand.h" #include "openssl/pem.h" #include "openssl/x509v3.h" #include #endif /* OPENSSL */ #include /* * Cryptodefines */ #define MD5KEYS 10 /* number of keys generated of each type */ #define MD5SIZE 20 /* maximum key size */ #define JAN_1970 2208988800UL /* NTP seconds */ #define YEAR ((long)60*60*24*365) /* one year in seconds */ #define MAXFILENAME 256 /* max file name length */ #define MAXHOSTNAME 256 /* max host name length */ #ifdef OPENSSL #define PLEN 512 /* default prime modulus size (bits) */ #define ILEN 256 /* default identity modulus size (bits) */ #define MVMAX 100 /* max MV parameters */ /* * Strings used in X509v3 extension fields */ #define KEY_USAGE "digitalSignature,keyCertSign" #define BASIC_CONSTRAINTS "critical,CA:TRUE" #define EXT_KEY_PRIVATE "private" #define EXT_KEY_TRUST "trustRoot" #endif /* OPENSSL */ /* * Prototypes */ FILE *fheader (const char *, const char *, const char *); int gen_md5 (char *); #ifdef OPENSSL EVP_PKEY *gen_rsa (char *); EVP_PKEY *gen_dsa (char *); EVP_PKEY *gen_iffkey (char *); EVP_PKEY *gen_gqkey (char *); EVP_PKEY *gen_mvkey (char *, EVP_PKEY **); void gen_mvserv (char *, EVP_PKEY **); int x509 (EVP_PKEY *, const EVP_MD *, char *, char *, char *); void cb (int, int, void *); EVP_PKEY *genkey (char *, char *); EVP_PKEY *readkey (char *, char *, u_int *, EVP_PKEY **); void writekey (char *, char *, u_int *, EVP_PKEY **); u_long asn2ntp (ASN1_TIME *); #endif /* OPENSSL */ /* * Program variables */ extern char *optarg; /* command line argument */ char *progname; volatile int debug = 0; /* debug, not de bug */ #ifdef OPENSSL u_int modulus = PLEN; /* prime modulus size (bits) */ u_int modulus2 = ILEN; /* identity modulus size (bits) */ #endif int nkeys; /* MV keys */ time_t epoch; /* Unix epoch (seconds) since 1970 */ u_int fstamp; /* NTP filestamp */ char *hostname = NULL; /* host name (subject name) */ char *groupname = NULL; /* trusted host name (issuer name) */ char filename[MAXFILENAME + 1]; /* file name */ char *passwd1 = NULL; /* input private key password */ char *passwd2 = NULL; /* output private key password */ #ifdef OPENSSL long d0, d1, d2, d3; /* callback counters */ #endif /* OPENSSL */ #ifdef SYS_WINNT BOOL init_randfile(); /* * Don't try to follow symbolic links */ int readlink(char *link, char *file, int len) { return (-1); } /* * Don't try to create a symbolic link for now. * Just move the file to the name you need. */ int symlink(char *filename, char *linkname) { DeleteFile(linkname); MoveFile(filename, linkname); return (0); } void InitWin32Sockets() { WORD wVersionRequested; WSADATA wsaData; wVersionRequested = MAKEWORD(2,0); if (WSAStartup(wVersionRequested, &wsaData)) { fprintf(stderr, "No useable winsock.dll\n"); exit(1); } } #endif /* SYS_WINNT */ /* * Main program */ int main( int argc, /* command line options */ char **argv ) { struct timeval tv; /* initialization vector */ int md5key = 0; /* generate MD5 keys */ #ifdef OPENSSL X509 *cert = NULL; /* X509 certificate */ X509_EXTENSION *ext; /* X509v3 extension */ EVP_PKEY *pkey_host = NULL; /* host key */ EVP_PKEY *pkey_sign = NULL; /* sign key */ EVP_PKEY *pkey_iffkey = NULL; /* IFF sever keys */ EVP_PKEY *pkey_gqkey = NULL; /* GQ server keys */ EVP_PKEY *pkey_mvkey = NULL; /* MV trusted agen keys */ EVP_PKEY *pkey_mvpar[MVMAX]; /* MV cleient keys */ int hostkey = 0; /* generate RSA keys */ int iffkey = 0; /* generate IFF keys */ int gqkey = 0; /* generate GQ keys */ int mvkey = 0; /* update MV keys */ int mvpar = 0; /* generate MV parameters */ char *sign = NULL; /* sign key */ EVP_PKEY *pkey = NULL; /* temp key */ const EVP_MD *ectx; /* EVP digest */ char pathbuf[MAXFILENAME + 1]; const char *scheme = NULL; /* digest/signature scheme */ char *exten = NULL; /* private extension */ char *grpkey = NULL; /* identity extension */ int nid; /* X509 digest/signature scheme */ FILE *fstr = NULL; /* file handle */ #define iffsw HAVE_OPT(ID_KEY) #endif /* OPENSSL */ char hostbuf[MAXHOSTNAME + 1]; char groupbuf[MAXHOSTNAME + 1]; progname = argv[0]; #ifdef SYS_WINNT /* Initialize before OpenSSL checks */ InitWin32Sockets(); if (!init_randfile()) fprintf(stderr, "Unable to initialize .rnd file\n"); ssl_applink(); #endif #ifdef OPENSSL ssl_check_version(); #endif /* OPENSSL */ /* * Process options, initialize host name and timestamp. */ gethostname(hostbuf, MAXHOSTNAME); hostname = hostbuf; gettimeofday(&tv, 0); epoch = tv.tv_sec; { int optct = ntpOptionProcess(&ntp_keygenOptions, argc, argv); argc -= optct; argv += optct; } #ifdef OPENSSL if (SSLeay() == SSLEAY_VERSION_NUMBER) fprintf(stderr, "Using OpenSSL version %s\n", SSLeay_version(SSLEAY_VERSION)); else fprintf(stderr, "Built against OpenSSL %s, using version %s\n", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); #endif /* OPENSSL */ debug = DESC(DEBUG_LEVEL).optOccCt; if (HAVE_OPT( MD5KEY )) md5key++; #ifdef OPENSSL passwd1 = hostbuf; if (HAVE_OPT( PVT_PASSWD )) passwd1 = strdup(OPT_ARG( PVT_PASSWD )); if (HAVE_OPT( GET_PVT_PASSWD )) passwd2 = strdup(OPT_ARG( GET_PVT_PASSWD )); if (HAVE_OPT( HOST_KEY )) hostkey++; if (HAVE_OPT( SIGN_KEY )) sign = strdup(OPT_ARG( SIGN_KEY )); if (HAVE_OPT( GQ_PARAMS )) gqkey++; if (HAVE_OPT( IFFKEY )) iffkey++; if (HAVE_OPT( MV_PARAMS )) { mvkey++; nkeys = OPT_VALUE_MV_PARAMS; } if (HAVE_OPT( MV_KEYS )) { mvpar++; nkeys = OPT_VALUE_MV_KEYS; } if (HAVE_OPT( MODULUS )) modulus = OPT_VALUE_MODULUS; if (HAVE_OPT( CERTIFICATE )) scheme = OPT_ARG( CERTIFICATE ); if (HAVE_OPT( SUBJECT_NAME )) hostname = strdup(OPT_ARG( SUBJECT_NAME )); if (HAVE_OPT( ISSUER_NAME )) groupname = strdup(OPT_ARG( ISSUER_NAME )); if (HAVE_OPT( PVT_CERT )) exten = EXT_KEY_PRIVATE; if (HAVE_OPT( TRUSTED_CERT )) exten = EXT_KEY_TRUST; /* * Seed random number generator and grow weeds. */ ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); if (!RAND_status()) { u_int temp; if (RAND_file_name(pathbuf, MAXFILENAME) == NULL) { fprintf(stderr, "RAND_file_name %s\n", ERR_error_string(ERR_get_error(), NULL)); exit (-1); } temp = RAND_load_file(pathbuf, -1); if (temp == 0) { fprintf(stderr, "RAND_load_file %s not found or empty\n", pathbuf); exit (-1); } fprintf(stderr, "Random seed file %s %u bytes\n", pathbuf, temp); RAND_add(&epoch, sizeof(epoch), 4.0); } /* * Load previous certificate if available. */ sprintf(filename, "ntpkey_cert_%s", hostname); if ((fstr = fopen(filename, "r")) != NULL) { cert = PEM_read_X509(fstr, NULL, NULL, NULL); fclose(fstr); } if (cert != NULL) { /* * Extract subject name. */ X509_NAME_oneline(X509_get_subject_name(cert), groupbuf, MAXFILENAME); /* * Extract digest/signature scheme. */ if (scheme == NULL) { nid = OBJ_obj2nid(cert->cert_info-> signature->algorithm); scheme = OBJ_nid2sn(nid); } /* * If a key_usage extension field is present, determine * whether this is a trusted or private certificate. */ if (exten == NULL) { BIO *bp; int i, cnt; char *ptr; ptr = strstr(groupbuf, "CN="); cnt = X509_get_ext_count(cert); for (i = 0; i < cnt; i++) { ext = X509_get_ext(cert, i); if (OBJ_obj2nid(ext->object) == NID_ext_key_usage) { bp = BIO_new(BIO_s_mem()); X509V3_EXT_print(bp, ext, 0, 0); BIO_gets(bp, pathbuf, MAXFILENAME); BIO_free(bp); if (strcmp(pathbuf, "Trust Root") == 0) exten = EXT_KEY_TRUST; else if (strcmp(pathbuf, "Private") == 0) exten = EXT_KEY_PRIVATE; if (groupname == NULL) groupname = ptr + 3; } } } } if (scheme == NULL) scheme = "RSA-MD5"; if (groupname == NULL) groupname = hostname; fprintf(stderr, "Using host %s group %s\n", hostname, groupname); if ((iffkey || gqkey || mvkey) && exten == NULL) fprintf(stderr, "Warning: identity files may not be useful with a nontrusted certificate.\n"); #endif /* OPENSSL */ /* * Create new unencrypted MD5 keys file if requested. If this * option is selected, ignore all other options. */ if (md5key) { gen_md5("md5"); exit (0); } #ifdef OPENSSL /* * Create a new encrypted RSA host key file if requested; * otherwise, look for an existing host key file. If not found, * create a new encrypted RSA host key file. If that fails, go * no further. */ if (hostkey) pkey_host = genkey("RSA", "host"); if (pkey_host == NULL) { sprintf(filename, "ntpkey_host_%s", hostname); pkey_host = readkey(filename, passwd1, &fstamp, NULL); if (pkey_host != NULL) { readlink(filename, filename, sizeof(filename)); fprintf(stderr, "Using host key %s\n", filename); } else { pkey_host = genkey("RSA", "host"); } } if (pkey_host == NULL) { fprintf(stderr, "Generating host key fails\n"); exit (-1); } /* * Create new encrypted RSA or DSA sign keys file if requested; * otherwise, look for an existing sign key file. If not found, * use the host key instead. */ if (sign != NULL) pkey_sign = genkey(sign, "sign"); if (pkey_sign == NULL) { sprintf(filename, "ntpkey_sign_%s", hostname); pkey_sign = readkey(filename, passwd1, &fstamp, NULL); if (pkey_sign != NULL) { readlink(filename, filename, sizeof(filename)); fprintf(stderr, "Using sign key %s\n", filename); } else if (pkey_host != NULL) { pkey_sign = pkey_host; fprintf(stderr, "Using host key as sign key\n"); } } /* * Create new encrypted GQ server keys file if requested; * otherwise, look for an exisiting file. If found, fetch the * public key for the certificate. */ if (gqkey) pkey_gqkey = gen_gqkey("gqkey"); if (pkey_gqkey == NULL) { sprintf(filename, "ntpkey_gqkey_%s", groupname); pkey_gqkey = readkey(filename, passwd1, &fstamp, NULL); if (pkey_gqkey != NULL) { readlink(filename, filename, sizeof(filename)); fprintf(stderr, "Using GQ parameters %s\n", filename); } } if (pkey_gqkey != NULL) grpkey = BN_bn2hex(pkey_gqkey->pkey.rsa->q); /* * Write the nonencrypted GQ client parameters to the stdout * stream. The parameter file is the server key file with the * private key obscured. */ if (pkey_gqkey != NULL && HAVE_OPT(ID_KEY)) { RSA *rsa; epoch = fstamp - JAN_1970; sprintf(filename, "ntpkey_gqpar_%s.%u", groupname, fstamp); fprintf(stderr, "Writing GQ parameters %s to stdout\n", filename); fprintf(stdout, "# %s\n# %s\n", filename, ctime(&epoch)); rsa = pkey_gqkey->pkey.rsa; BN_copy(rsa->p, BN_value_one()); BN_copy(rsa->q, BN_value_one()); pkey = EVP_PKEY_new(); EVP_PKEY_assign_RSA(pkey, rsa); PEM_write_PrivateKey(stdout, pkey, NULL, NULL, 0, NULL, NULL); fclose(stdout); if (debug) RSA_print_fp(stderr, rsa, 0); } /* * Write the encrypted GQ server keys to the stdout stream. */ if (pkey_gqkey != NULL && passwd2 != NULL) { RSA *rsa; sprintf(filename, "ntpkey_gqkey_%s.%u", groupname, fstamp); fprintf(stderr, "Writing GQ keys %s to stdout\n", filename); fprintf(stdout, "# %s\n# %s\n", filename, ctime(&epoch)); rsa = pkey_gqkey->pkey.rsa; pkey = EVP_PKEY_new(); EVP_PKEY_assign_RSA(pkey, rsa); PEM_write_PrivateKey(stdout, pkey, EVP_des_cbc(), NULL, 0, NULL, passwd2); fclose(stdout); if (debug) RSA_print_fp(stderr, rsa, 0); } /* * Create new encrypted IFF server keys file if requested; * otherwise, look for existing file. */ if (iffkey) pkey_iffkey = gen_iffkey("iffkey"); if (pkey_iffkey == NULL) { sprintf(filename, "ntpkey_iffkey_%s", groupname); pkey_iffkey = readkey(filename, passwd1, &fstamp, NULL); if (pkey_iffkey != NULL) { readlink(filename, filename, sizeof(filename)); fprintf(stderr, "Using IFF keys %s\n", filename); } } /* * Write the nonencrypted IFF client parameters to the stdout * stream. The parameter file is the server key file with the * private key obscured. */ if (pkey_iffkey != NULL && HAVE_OPT(ID_KEY)) { DSA *dsa; epoch = fstamp - JAN_1970; sprintf(filename, "ntpkey_iffpar_%s.%u", groupname, fstamp); fprintf(stderr, "Writing IFF parameters %s to stdout\n", filename); fprintf(stdout, "# %s\n# %s\n", filename, ctime(&epoch)); dsa = pkey_iffkey->pkey.dsa; BN_copy(dsa->priv_key, BN_value_one()); pkey = EVP_PKEY_new(); EVP_PKEY_assign_DSA(pkey, dsa); PEM_write_PrivateKey(stdout, pkey, NULL, NULL, 0, NULL, NULL); fclose(stdout); if (debug) DSA_print_fp(stderr, dsa, 0); } /* * Write the encrypted IFF server keys to the stdout stream. */ if (pkey_iffkey != NULL && passwd2 != NULL) { DSA *dsa; epoch = fstamp - JAN_1970; sprintf(filename, "ntpkey_iffkey_%s.%u", groupname, fstamp); fprintf(stderr, "Writing IFF keys %s to stdout\n", filename); fprintf(stdout, "# %s\n# %s\n", filename, ctime(&epoch)); dsa = pkey_iffkey->pkey.dsa; pkey = EVP_PKEY_new(); EVP_PKEY_assign_DSA(pkey, dsa); PEM_write_PrivateKey(stdout, pkey, EVP_des_cbc(), NULL, 0, NULL, passwd2); fclose(stdout); if (debug) DSA_print_fp(stderr, dsa, 0); } /* * Create new encrypted MV trusted-authority keys file if * requested; otherwise, look for existing keys file. */ if (mvkey) pkey_mvkey = gen_mvkey("mv", pkey_mvpar); if (pkey_mvkey == NULL) { sprintf(filename, "ntpkey_mvta_%s", groupname); pkey_mvkey = readkey(filename, passwd1, &fstamp, pkey_mvpar); if (pkey_mvkey != NULL) { readlink(filename, filename, sizeof(filename)); fprintf(stderr, "Using MV keys %s\n", filename); } } /* * Write the nonencrypted MV client parameters to the stdout * stream. For the moment, we always use the client parameters * associated with client key 1. */ if (pkey_mvkey != NULL && HAVE_OPT(ID_KEY)) { epoch = fstamp - JAN_1970; sprintf(filename, "ntpkey_mvpar_%s.%u", groupname, fstamp); fprintf(stderr, "Writing MV parameters %s to stdout\n", filename); fprintf(stdout, "# %s\n# %s\n", filename, ctime(&epoch)); pkey = pkey_mvpar[2]; PEM_write_PrivateKey(stdout, pkey, NULL, NULL, 0, NULL, NULL); fclose(stdout); if (debug) DSA_print_fp(stderr, pkey->pkey.dsa, 0); } /* * Write the encrypted MV server keys to the stdout stream. */ if (pkey_mvkey != NULL && passwd2 != NULL) { epoch = fstamp - JAN_1970; sprintf(filename, "ntpkey_mvkey_%s.%u", groupname, fstamp); fprintf(stderr, "Writing MV keys %s to stdout\n", filename); fprintf(stdout, "# %s\n# %s\n", filename, ctime(&epoch)); pkey = pkey_mvpar[1]; PEM_write_PrivateKey(stdout, pkey, EVP_des_cbc(), NULL, 0, NULL, passwd2); fclose(stdout); if (debug) DSA_print_fp(stderr, pkey->pkey.dsa, 0); } /* * Don't generate a certificate if no host keys or extracting * encrypted or nonencrypted keys to the standard output stream. */ if (pkey_host == NULL || HAVE_OPT(ID_KEY) || passwd2 != NULL) exit (0); /* * Decode the digest/signature scheme. If trusted, set the * subject and issuer names to the group name; if not set both * to the host name. */ ectx = EVP_get_digestbyname(scheme); if (ectx == NULL) { fprintf(stderr, "Invalid digest/signature combination %s\n", scheme); exit (-1); } if (exten == NULL) x509(pkey_sign, ectx, grpkey, exten, hostname); else x509(pkey_sign, ectx, grpkey, exten, groupname); #endif /* OPENSSL */ exit (0); } /* * Generate semi-random MD5 keys compatible with NTPv3 and NTPv4. Also, * if OpenSSL is around, generate random SHA1 keys compatible with * symmetric key cryptography. */ int gen_md5( char *id /* file name id */ ) { u_char md5key[MD5SIZE + 1]; /* MD5 key */ FILE *str; int i, j; #ifdef OPENSSL u_char keystr[MD5SIZE]; u_char hexstr[2 * MD5SIZE + 1]; u_char hex[] = "0123456789abcdef"; #endif /* OPENSSL */ str = fheader("MD5key", id, groupname); ntp_srandom((u_long)epoch); for (i = 1; i <= MD5KEYS; i++) { for (j = 0; j < MD5SIZE; j++) { int temp; while (1) { temp = ntp_random() & 0xff; if (temp == '#') continue; if (temp > 0x20 && temp < 0x7f) break; } md5key[j] = (u_char)temp; } md5key[j] = '\0'; fprintf(str, "%2d MD5 %s # MD5 key\n", i, md5key); } #ifdef OPENSSL for (i = 1; i <= MD5KEYS; i++) { RAND_bytes(keystr, 20); for (j = 0; j < MD5SIZE; j++) { hexstr[2 * j] = hex[keystr[j] >> 4]; hexstr[2 * j + 1] = hex[keystr[j] & 0xf]; } hexstr[2 * MD5SIZE] = '\0'; fprintf(str, "%2d SHA1 %s # SHA1 key\n", i + MD5KEYS, hexstr); } #endif /* OPENSSL */ fclose(str); return (1); } #ifdef OPENSSL /* * readkey - load cryptographic parameters and keys * * This routine loads a PEM-encoded file of given name and password and * extracts the filestamp from the file name. It returns a pointer to * the first key if valid, NULL if not. */ EVP_PKEY * /* public/private key pair */ readkey( char *cp, /* file name */ char *passwd, /* password */ u_int *estamp, /* file stamp */ EVP_PKEY **evpars /* parameter list pointer */ ) { FILE *str; /* file handle */ EVP_PKEY *pkey = NULL; /* public/private key */ u_int gstamp; /* filestamp */ char linkname[MAXFILENAME]; /* filestamp buffer) */ EVP_PKEY *parkey; char *ptr; int i; /* * Open the key file. */ str = fopen(cp, "r"); if (str == NULL) return (NULL); /* * Read the filestamp, which is contained in the first line. */ if ((ptr = fgets(linkname, MAXFILENAME, str)) == NULL) { fprintf(stderr, "Empty key file %s\n", cp); fclose(str); return (NULL); } if ((ptr = strrchr(ptr, '.')) == NULL) { fprintf(stderr, "No filestamp found in %s\n", cp); fclose(str); return (NULL); } if (sscanf(++ptr, "%u", &gstamp) != 1) { fprintf(stderr, "Invalid filestamp found in %s\n", cp); fclose(str); return (NULL); } /* * Read and decrypt PEM-encoded private keys. The first one * found is returned. If others are expected, add them to the * parameter list. */ for (i = 0; i <= MVMAX - 1;) { parkey = PEM_read_PrivateKey(str, NULL, NULL, passwd); if (evpars != NULL) { evpars[i++] = parkey; evpars[i] = NULL; } if (parkey == NULL) break; if (pkey == NULL) pkey = parkey; if (debug) { if (parkey->type == EVP_PKEY_DSA) DSA_print_fp(stderr, parkey->pkey.dsa, 0); else if (parkey->type == EVP_PKEY_RSA) RSA_print_fp(stderr, parkey->pkey.rsa, 0); } } fclose(str); if (pkey == NULL) { fprintf(stderr, "Corrupt file %s or wrong key %s\n%s\n", cp, passwd, ERR_error_string(ERR_get_error(), NULL)); exit (-1); } *estamp = gstamp; return (pkey); } /* * Generate RSA public/private key pair */ EVP_PKEY * /* public/private key pair */ gen_rsa( char *id /* file name id */ ) { EVP_PKEY *pkey; /* private key */ RSA *rsa; /* RSA parameters and key pair */ FILE *str; fprintf(stderr, "Generating RSA keys (%d bits)...\n", modulus); rsa = RSA_generate_key(modulus, 3, cb, "RSA"); fprintf(stderr, "\n"); if (rsa == NULL) { fprintf(stderr, "RSA generate keys fails\n%s\n", ERR_error_string(ERR_get_error(), NULL)); return (NULL); } /* * For signature encryption it is not necessary that the RSA * parameters be strictly groomed and once in a while the * modulus turns out to be non-prime. Just for grins, we check * the primality. */ if (!RSA_check_key(rsa)) { fprintf(stderr, "Invalid RSA key\n%s\n", ERR_error_string(ERR_get_error(), NULL)); RSA_free(rsa); return (NULL); } /* * Write the RSA parameters and keys as a RSA private key * encoded in PEM. */ if (strcmp(id, "sign") == 0) str = fheader("RSAsign", id, hostname); else str = fheader("RSAhost", id, hostname); pkey = EVP_PKEY_new(); EVP_PKEY_assign_RSA(pkey, rsa); PEM_write_PrivateKey(str, pkey, EVP_des_cbc(), NULL, 0, NULL, passwd1); fclose(str); if (debug) RSA_print_fp(stderr, rsa, 0); return (pkey); } /* * Generate DSA public/private key pair */ EVP_PKEY * /* public/private key pair */ gen_dsa( char *id /* file name id */ ) { EVP_PKEY *pkey; /* private key */ DSA *dsa; /* DSA parameters */ u_char seed[20]; /* seed for parameters */ FILE *str; /* * Generate DSA parameters. */ fprintf(stderr, "Generating DSA parameters (%d bits)...\n", modulus); RAND_bytes(seed, sizeof(seed)); dsa = DSA_generate_parameters(modulus, seed, sizeof(seed), NULL, NULL, cb, "DSA"); fprintf(stderr, "\n"); if (dsa == NULL) { fprintf(stderr, "DSA generate parameters fails\n%s\n", ERR_error_string(ERR_get_error(), NULL)); return (NULL); } /* * Generate DSA keys. */ fprintf(stderr, "Generating DSA keys (%d bits)...\n", modulus); if (!DSA_generate_key(dsa)) { fprintf(stderr, "DSA generate keys fails\n%s\n", ERR_error_string(ERR_get_error(), NULL)); DSA_free(dsa); return (NULL); } /* * Write the DSA parameters and keys as a DSA private key * encoded in PEM. */ str = fheader("DSAsign", id, hostname); pkey = EVP_PKEY_new(); EVP_PKEY_assign_DSA(pkey, dsa); PEM_write_PrivateKey(str, pkey, EVP_des_cbc(), NULL, 0, NULL, passwd1); fclose(str); if (debug) DSA_print_fp(stderr, dsa, 0); return (pkey); } /* *********************************************************************** * * * The following routines implement the Schnorr (IFF) identity scheme * * * *********************************************************************** * * The Schnorr (IFF) identity scheme is intended for use when * certificates are generated by some other trusted certificate * authority and the certificate cannot be used to convey public * parameters. There are two kinds of files: encrypted server files that * contain private and public values and nonencrypted client files that * contain only public values. New generations of server files must be * securely transmitted to all servers of the group; client files can be * distributed by any means. The scheme is self contained and * independent of new generations of host keys, sign keys and * certificates. * * The IFF values hide in a DSA cuckoo structure which uses the same * parameters. The values are used by an identity scheme based on DSA * cryptography and described in Stimson p. 285. The p is a 512-bit * prime, g a generator of Zp* and q a 160-bit prime that divides p - 1 * and is a qth root of 1 mod p; that is, g^q = 1 mod p. The TA rolls a * private random group key b (0 < b < q) and public key v = g^b, then * sends (p, q, g, b) to the servers and (p, q, g, v) to the clients. * Alice challenges Bob to confirm identity using the protocol described * below. * * How it works * * The scheme goes like this. Both Alice and Bob have the public primes * p, q and generator g. The TA gives private key b to Bob and public * key v to Alice. * * Alice rolls new random challenge r (o < r < q) and sends to Bob in * the IFF request message. Bob rolls new random k (0 < k < q), then * computes y = k + b r mod q and x = g^k mod p and sends (y, hash(x)) * to Alice in the response message. Besides making the response * shorter, the hash makes it effectivey impossible for an intruder to * solve for b by observing a number of these messages. * * Alice receives the response and computes g^y v^r mod p. After a bit * of algebra, this simplifies to g^k. If the hash of this result * matches hash(x), Alice knows that Bob has the group key b. The signed * response binds this knowledge to Bob's private key and the public key * previously received in his certificate. */ /* * Generate Schnorr (IFF) keys. */ EVP_PKEY * /* DSA cuckoo nest */ gen_iffkey( char *id /* file name id */ ) { EVP_PKEY *pkey; /* private key */ DSA *dsa; /* DSA parameters */ u_char seed[20]; /* seed for parameters */ BN_CTX *ctx; /* BN working space */ BIGNUM *b, *r, *k, *u, *v, *w; /* BN temp */ FILE *str; u_int temp; /* * Generate DSA parameters for use as IFF parameters. */ fprintf(stderr, "Generating IFF keys (%d bits)...\n", modulus2); RAND_bytes(seed, sizeof(seed)); dsa = DSA_generate_parameters(modulus2, seed, sizeof(seed), NULL, NULL, cb, "IFF"); fprintf(stderr, "\n"); if (dsa == NULL) { fprintf(stderr, "DSA generate parameters fails\n%s\n", ERR_error_string(ERR_get_error(), NULL)); return (NULL);; } /* * Generate the private and public keys. The DSA parameters and * private key are distributed to the servers, while all except * the private key are distributed to the clients. */ b = BN_new(); r = BN_new(); k = BN_new(); u = BN_new(); v = BN_new(); w = BN_new(); ctx = BN_CTX_new(); BN_rand(b, BN_num_bits(dsa->q), -1, 0); /* a */ BN_mod(b, b, dsa->q, ctx); BN_sub(v, dsa->q, b); BN_mod_exp(v, dsa->g, v, dsa->p, ctx); /* g^(q - b) mod p */ BN_mod_exp(u, dsa->g, b, dsa->p, ctx); /* g^b mod p */ BN_mod_mul(u, u, v, dsa->p, ctx); temp = BN_is_one(u); fprintf(stderr, "Confirm g^(q - b) g^b = 1 mod p: %s\n", temp == 1 ? "yes" : "no"); if (!temp) { BN_free(b); BN_free(r); BN_free(k); BN_free(u); BN_free(v); BN_free(w); BN_CTX_free(ctx); return (NULL); } dsa->priv_key = BN_dup(b); /* private key */ dsa->pub_key = BN_dup(v); /* public key */ /* * Here is a trial round of the protocol. First, Alice rolls * random nonce r mod q and sends it to Bob. She needs only * q from parameters. */ BN_rand(r, BN_num_bits(dsa->q), -1, 0); /* r */ BN_mod(r, r, dsa->q, ctx); /* * Bob rolls random nonce k mod q, computes y = k + b r mod q * and x = g^k mod p, then sends (y, x) to Alice. He needs * p, q and b from parameters and r from Alice. */ BN_rand(k, BN_num_bits(dsa->q), -1, 0); /* k, 0 < k < q */ BN_mod(k, k, dsa->q, ctx); BN_mod_mul(v, dsa->priv_key, r, dsa->q, ctx); /* b r mod q */ BN_add(v, v, k); BN_mod(v, v, dsa->q, ctx); /* y = k + b r mod q */ BN_mod_exp(u, dsa->g, k, dsa->p, ctx); /* x = g^k mod p */ /* * Alice verifies x = g^y v^r to confirm that Bob has group key * b. She needs p, q, g from parameters, (y, x) from Bob and the * original r. We omit the detail here thatt only the hash of y * is sent. */ BN_mod_exp(v, dsa->g, v, dsa->p, ctx); /* g^y mod p */ BN_mod_exp(w, dsa->pub_key, r, dsa->p, ctx); /* v^r */ BN_mod_mul(v, w, v, dsa->p, ctx); /* product mod p */ temp = BN_cmp(u, v); fprintf(stderr, "Confirm g^k = g^(k + b r) g^(q - b) r: %s\n", temp == 0 ? "yes" : "no"); BN_free(b); BN_free(r); BN_free(k); BN_free(u); BN_free(v); BN_free(w); BN_CTX_free(ctx); if (temp != 0) { DSA_free(dsa); return (NULL); } /* * Write the IFF keys as an encrypted DSA private key encoded in * PEM. * * p modulus p * q modulus q * g generator g * priv_key b * public_key v * kinv not used * r not used */ str = fheader("IFFkey", id, groupname); pkey = EVP_PKEY_new(); EVP_PKEY_assign_DSA(pkey, dsa); PEM_write_PrivateKey(str, pkey, EVP_des_cbc(), NULL, 0, NULL, passwd1); fclose(str); if (debug) DSA_print_fp(stderr, dsa, 0); return (pkey); } /* *********************************************************************** * * * The following routines implement the Guillou-Quisquater (GQ) * * identity scheme * * * *********************************************************************** * * The Guillou-Quisquater (GQ) identity scheme is intended for use when * the certificate can be used to convey public parameters. The scheme * uses a X509v3 certificate extension field do convey the public key of * a private key known only to servers. There are two kinds of files: * encrypted server files that contain private and public values and * nonencrypted client files that contain only public values. New * generations of server files must be securely transmitted to all * servers of the group; client files can be distributed by any means. * The scheme is self contained and independent of new generations of * host keys and sign keys. The scheme is self contained and independent * of new generations of host keys and sign keys. * * The GQ parameters hide in a RSA cuckoo structure which uses the same * parameters. The values are used by an identity scheme based on RSA * cryptography and described in Stimson p. 300 (with errors). The 512- * bit public modulus is n = p q, where p and q are secret large primes. * The TA rolls private random group key b as RSA exponent. These values * are known to all group members. * * When rolling new certificates, a server recomputes the private and * public keys. The private key u is a random roll, while the public key * is the inverse obscured by the group key v = (u^-1)^b. These values * replace the private and public keys normally generated by the RSA * scheme. Alice challenges Bob to confirm identity using the protocol * described below. * * How it works * * The scheme goes like this. Both Alice and Bob have the same modulus n * and some random b as the group key. These values are computed and * distributed in advance via secret means, although only the group key * b is truly secret. Each has a private random private key u and public * key (u^-1)^b, although not necessarily the same ones. Bob and Alice * can regenerate the key pair from time to time without affecting * operations. The public key is conveyed on the certificate in an * extension field; the private key is never revealed. * * Alice rolls new random challenge r and sends to Bob in the GQ * request message. Bob rolls new random k, then computes y = k u^r mod * n and x = k^b mod n and sends (y, hash(x)) to Alice in the response * message. Besides making the response shorter, the hash makes it * effectivey impossible for an intruder to solve for b by observing * a number of these messages. * * Alice receives the response and computes y^b v^r mod n. After a bit * of algebra, this simplifies to k^b. If the hash of this result * matches hash(x), Alice knows that Bob has the group key b. The signed * response binds this knowledge to Bob's private key and the public key * previously received in his certificate. */ /* * Generate Guillou-Quisquater (GQ) parameters file. */ EVP_PKEY * /* RSA cuckoo nest */ gen_gqkey( char *id /* file name id */ ) { EVP_PKEY *pkey; /* private key */ RSA *rsa; /* RSA parameters */ BN_CTX *ctx; /* BN working space */ BIGNUM *u, *v, *g, *k, *r, *y; /* BN temps */ FILE *str; u_int temp; /* * Generate RSA parameters for use as GQ parameters. */ fprintf(stderr, "Generating GQ parameters (%d bits)...\n", modulus2); rsa = RSA_generate_key(modulus2, 3, cb, "GQ"); fprintf(stderr, "\n"); if (rsa == NULL) { fprintf(stderr, "RSA generate keys fails\n%s\n", ERR_error_string(ERR_get_error(), NULL)); return (NULL); } ctx = BN_CTX_new(); u = BN_new(); v = BN_new(); g = BN_new(); k = BN_new(); r = BN_new(); y = BN_new(); /* * Generate the group key b, which is saved in the e member of * the RSA structure. The group key is transmitted to each group * member encrypted by the member private key. */ ctx = BN_CTX_new(); BN_rand(rsa->e, BN_num_bits(rsa->n), -1, 0); /* b */ BN_mod(rsa->e, rsa->e, rsa->n, ctx); /* * When generating his certificate, Bob rolls random private key * u, then computes inverse v = u^-1. */ BN_rand(u, BN_num_bits(rsa->n), -1, 0); /* u */ BN_mod(u, u, rsa->n, ctx); BN_mod_inverse(v, u, rsa->n, ctx); /* u^-1 mod n */ BN_mod_mul(k, v, u, rsa->n, ctx); /* * Bob computes public key v = (u^-1)^b, which is saved in an * extension field on his certificate. We check that u^b v = * 1 mod n. */ BN_mod_exp(v, v, rsa->e, rsa->n, ctx); BN_mod_exp(g, u, rsa->e, rsa->n, ctx); /* u^b */ BN_mod_mul(g, g, v, rsa->n, ctx); /* u^b (u^-1)^b */ temp = BN_is_one(g); fprintf(stderr, "Confirm u^b (u^-1)^b = 1 mod n: %s\n", temp ? "yes" : "no"); if (!temp) { BN_free(u); BN_free(v); BN_free(g); BN_free(k); BN_free(r); BN_free(y); BN_CTX_free(ctx); RSA_free(rsa); return (NULL); } BN_copy(rsa->p, u); /* private key */ BN_copy(rsa->q, v); /* public key */ /* * Here is a trial run of the protocol. First, Alice rolls * random nonce r mod n and sends it to Bob. She needs only n * from parameters. */ BN_rand(r, BN_num_bits(rsa->n), -1, 0); /* r */ BN_mod(r, r, rsa->n, ctx); /* * Bob rolls random nonce k mod n, computes y = k u^r mod n and * g = k^b mod n, then sends (y, g) to Alice. He needs n, u, b * from parameters and r from Alice. */ BN_rand(k, BN_num_bits(rsa->n), -1, 0); /* k */ BN_mod(k, k, rsa->n, ctx); BN_mod_exp(y, rsa->p, r, rsa->n, ctx); /* u^r mod n */ BN_mod_mul(y, k, y, rsa->n, ctx); /* y = k u^r mod n */ BN_mod_exp(g, k, rsa->e, rsa->n, ctx); /* g = k^b mod n */ /* * Alice verifies g = v^r y^b mod n to confirm that Bob has * private key u. She needs n, g from parameters, public key v = * (u^-1)^b from the certificate, (y, g) from Bob and the * original r. We omit the detaul here that only the hash of g * is sent. */ BN_mod_exp(v, rsa->q, r, rsa->n, ctx); /* v^r mod n */ BN_mod_exp(y, y, rsa->e, rsa->n, ctx); /* y^b mod n */ BN_mod_mul(y, v, y, rsa->n, ctx); /* v^r y^b mod n */ temp = BN_cmp(y, g); fprintf(stderr, "Confirm g^k = v^r y^b mod n: %s\n", temp == 0 ? "yes" : "no"); BN_CTX_free(ctx); BN_free(u); BN_free(v); BN_free(g); BN_free(k); BN_free(r); BN_free(y); if (temp != 0) { RSA_free(rsa); return (NULL); } /* * Write the GQ parameter file as an encrypted RSA private key * encoded in PEM. * * n modulus n * e group key b * d not used * p private key u * q public key (u^-1)^b * dmp1 not used * dmq1 not used * iqmp not used */ BN_copy(rsa->d, BN_value_one()); BN_copy(rsa->dmp1, BN_value_one()); BN_copy(rsa->dmq1, BN_value_one()); BN_copy(rsa->iqmp, BN_value_one()); str = fheader("GQkey", id, groupname); pkey = EVP_PKEY_new(); EVP_PKEY_assign_RSA(pkey, rsa); PEM_write_PrivateKey(str, pkey, EVP_des_cbc(), NULL, 0, NULL, passwd1); fclose(str); if (debug) RSA_print_fp(stderr, rsa, 0); return (pkey); } /* *********************************************************************** * * * The following routines implement the Mu-Varadharajan (MV) identity * * scheme * * * *********************************************************************** * * The Mu-Varadharajan (MV) cryptosystem was originally intended when * servers broadcast messages to clients, but clients never send * messages to servers. There is one encryption key for the server and a * separate decryption key for each client. It operated something like a * pay-per-view satellite broadcasting system where the session key is * encrypted by the broadcaster and the decryption keys are held in a * tamperproof set-top box. * * The MV parameters and private encryption key hide in a DSA cuckoo * structure which uses the same parameters, but generated in a * different way. The values are used in an encryption scheme similar to * El Gamal cryptography and a polynomial formed from the expansion of * product terms (x - x[j]), as described in Mu, Y., and V. * Varadharajan: Robust and Secure Broadcasting, Proc. Indocrypt 2001, * 223-231. The paper has significant errors and serious omissions. * * Let q be the product of n distinct primes s1[j] (j = 1...n), where * each s1[j] has m significant bits. Let p be a prime p = 2 * q + 1, so * that q and each s1[j] divide p - 1 and p has M = n * m + 1 * significant bits. Let g be a generator of Zp; that is, gcd(g, p - 1) * = 1 and g^q = 1 mod p. We do modular arithmetic over Zq and then * project into Zp* as exponents of g. Sometimes we have to compute an * inverse b^-1 of random b in Zq, but for that purpose we require * gcd(b, q) = 1. We expect M to be in the 500-bit range and n * relatively small, like 30. These are the parameters of the scheme and * they are expensive to compute. * * We set up an instance of the scheme as follows. A set of random * values x[j] mod q (j = 1...n), are generated as the zeros of a * polynomial of order n. The product terms (x - x[j]) are expanded to * form coefficients a[i] mod q (i = 0...n) in powers of x. These are * used as exponents of the generator g mod p to generate the private * encryption key A. The pair (gbar, ghat) of public server keys and the * pairs (xbar[j], xhat[j]) (j = 1...n) of private client keys are used * to construct the decryption keys. The devil is in the details. * * This routine generates a private server encryption file including the * private encryption key E and partial decryption keys gbar and ghat. * It then generates public client decryption files including the public * keys xbar[j] and xhat[j] for each client j. The partial decryption * files are used to compute the inverse of E. These values are suitably * blinded so secrets are not revealed. * * The distinguishing characteristic of this scheme is the capability to * revoke keys. Included in the calculation of E, gbar and ghat is the * product s = prod(s1[j]) (j = 1...n) above. If the factor s1[j] is * subsequently removed from the product and E, gbar and ghat * recomputed, the jth client will no longer be able to compute E^-1 and * thus unable to decrypt the messageblock. * * How it works * * The scheme goes like this. Bob has the server values (p, E, q, gbar, * ghat) and Alice has the client values (p, xbar, xhat). * * Alice rolls new random nonce r mod p and sends to Bob in the MV * request message. Bob rolls random nonce k mod q, encrypts y = r E^k * mod p and sends (y, gbar^k, ghat^k) to Alice. * * Alice receives the response and computes the inverse (E^k)^-1 from * the partial decryption keys gbar^k, ghat^k, xbar and xhat. She then * decrypts y and verifies it matches the original r. The signed * response binds this knowledge to Bob's private key and the public key * previously received in his certificate. */ EVP_PKEY * /* DSA cuckoo nest */ gen_mvkey( char *id, /* file name id */ EVP_PKEY **evpars /* parameter list pointer */ ) { EVP_PKEY *pkey, *pkey1; /* private keys */ DSA *dsa, *dsa2, *sdsa; /* DSA parameters */ BN_CTX *ctx; /* BN working space */ BIGNUM *a[MVMAX]; /* polynomial coefficient vector */ BIGNUM *g[MVMAX]; /* public key vector */ BIGNUM *s1[MVMAX]; /* private enabling keys */ BIGNUM *x[MVMAX]; /* polynomial zeros vector */ BIGNUM *xbar[MVMAX], *xhat[MVMAX]; /* private keys vector */ BIGNUM *b; /* group key */ BIGNUM *b1; /* inverse group key */ BIGNUM *s; /* enabling key */ BIGNUM *biga; /* master encryption key */ BIGNUM *bige; /* session encryption key */ BIGNUM *gbar, *ghat; /* public key */ BIGNUM *u, *v, *w; /* BN scratch */ int i, j, n; FILE *str; u_int temp; /* * Generate MV parameters. * * The object is to generate a multiplicative group Zp* modulo a * prime p and a subset Zq mod q, where q is the product of n * distinct primes s1[j] (j = 1...n) and q divides p - 1. We * first generate n m-bit primes, where the product n m is in * the order of 512 bits. One or more of these may have to be * replaced later. As a practical matter, it is tough to find * more than 31 distinct primes for 512 bits or 61 primes for * 1024 bits. The latter can take several hundred iterations * and several minutes on a Sun Blade 1000. */ n = nkeys; fprintf(stderr, "Generating MV parameters for %d keys (%d bits)...\n", n, modulus2 / n); ctx = BN_CTX_new(); u = BN_new(); v = BN_new(); w = BN_new(); b = BN_new(); b1 = BN_new(); dsa = DSA_new(); dsa->p = BN_new(); dsa->q = BN_new(); dsa->g = BN_new(); dsa->priv_key = BN_new(); dsa->pub_key = BN_new(); temp = 0; for (j = 1; j <= n; j++) { s1[j] = BN_new(); while (1) { BN_generate_prime(s1[j], modulus2 / n, 0, NULL, NULL, NULL, NULL); for (i = 1; i < j; i++) { if (BN_cmp(s1[i], s1[j]) == 0) break; } if (i == j) break; temp++; } } fprintf(stderr, "Birthday keys regenerated %d\n", temp); /* * Compute the modulus q as the product of the primes. Compute * the modulus p as 2 * q + 1 and test p for primality. If p * is composite, replace one of the primes with a new distinct * one and try again. Note that q will hardly be a secret since * we have to reveal p to servers, but not clients. However, * factoring q to find the primes should be adequately hard, as * this is the same problem considered hard in RSA. Question: is * it as hard to find n small prime factors totalling n bits as * it is to find two large prime factors totalling n bits? * Remember, the bad guy doesn't know n. */ temp = 0; while (1) { BN_one(dsa->q); for (j = 1; j <= n; j++) BN_mul(dsa->q, dsa->q, s1[j], ctx); BN_copy(dsa->p, dsa->q); BN_add(dsa->p, dsa->p, dsa->p); BN_add_word(dsa->p, 1); if (BN_is_prime(dsa->p, BN_prime_checks, NULL, ctx, NULL)) break; temp++; j = temp % n + 1; while (1) { BN_generate_prime(u, modulus2 / n, 0, 0, NULL, NULL, NULL); for (i = 1; i <= n; i++) { if (BN_cmp(u, s1[i]) == 0) break; } if (i > n) break; } BN_copy(s1[j], u); } fprintf(stderr, "Defective keys regenerated %d\n", temp); /* * Compute the generator g using a random roll such that * gcd(g, p - 1) = 1 and g^q = 1. This is a generator of p, not * q. This may take several iterations. */ BN_copy(v, dsa->p); BN_sub_word(v, 1); while (1) { BN_rand(dsa->g, BN_num_bits(dsa->p) - 1, 0, 0); BN_mod(dsa->g, dsa->g, dsa->p, ctx); BN_gcd(u, dsa->g, v, ctx); if (!BN_is_one(u)) continue; BN_mod_exp(u, dsa->g, dsa->q, dsa->p, ctx); if (BN_is_one(u)) break; } /* * Setup is now complete. Roll random polynomial roots x[j] * (j = 1...n) for all j. While it may not be strictly * necessary, Make sure each root has no factors in common with * q. */ fprintf(stderr, "Generating polynomial coefficients for %d roots (%d bits)\n", n, BN_num_bits(dsa->q)); for (j = 1; j <= n; j++) { x[j] = BN_new(); while (1) { BN_rand(x[j], BN_num_bits(dsa->q), 0, 0); BN_mod(x[j], x[j], dsa->q, ctx); BN_gcd(u, x[j], dsa->q, ctx); if (BN_is_one(u)) break; } } /* * Generate polynomial coefficients a[i] (i = 0...n) from the * expansion of root products (x - x[j]) mod q for all j. The * method is a present from Charlie Boncelet. */ for (i = 0; i <= n; i++) { a[i] = BN_new(); BN_one(a[i]); } for (j = 1; j <= n; j++) { BN_zero(w); for (i = 0; i < j; i++) { BN_copy(u, dsa->q); BN_mod_mul(v, a[i], x[j], dsa->q, ctx); BN_sub(u, u, v); BN_add(u, u, w); BN_copy(w, a[i]); BN_mod(a[i], u, dsa->q, ctx); } } /* * Generate g[i] = g^a[i] mod p for all i and the generator g. */ for (i = 0; i <= n; i++) { g[i] = BN_new(); BN_mod_exp(g[i], dsa->g, a[i], dsa->p, ctx); } /* * Verify prod(g[i]^(a[i] x[j]^i)) = 1 for all i, j. Note the * a[i] x[j]^i exponent is computed mod q, but the g[i] is * computed mod p. also note the expression given in the paper * is incorrect. */ temp = 1; for (j = 1; j <= n; j++) { BN_one(u); for (i = 0; i <= n; i++) { BN_set_word(v, i); BN_mod_exp(v, x[j], v, dsa->q, ctx); BN_mod_mul(v, v, a[i], dsa->q, ctx); BN_mod_exp(v, dsa->g, v, dsa->p, ctx); BN_mod_mul(u, u, v, dsa->p, ctx); } if (!BN_is_one(u)) temp = 0; } fprintf(stderr, "Confirm prod(g[i]^(x[j]^i)) = 1 for all i, j: %s\n", temp ? "yes" : "no"); if (!temp) { return (NULL); } /* * Make private encryption key A. Keep it around for awhile, * since it is expensive to compute. */ biga = BN_new(); BN_one(biga); for (j = 1; j <= n; j++) { for (i = 0; i < n; i++) { BN_set_word(v, i); BN_mod_exp(v, x[j], v, dsa->q, ctx); BN_mod_exp(v, g[i], v, dsa->p, ctx); BN_mod_mul(biga, biga, v, dsa->p, ctx); } } /* * Roll private random group key b mod q (0 < b < q), where * gcd(b, q) = 1 to guarantee b^-1 exists, then compute b^-1 * mod q. If b is changed, the client keys must be recomputed. */ while (1) { BN_rand(b, BN_num_bits(dsa->q), 0, 0); BN_mod(b, b, dsa->q, ctx); BN_gcd(u, b, dsa->q, ctx); if (BN_is_one(u)) break; } BN_mod_inverse(b1, b, dsa->q, ctx); /* * Make private client keys (xbar[j], xhat[j]) for all j. Note * that the keys for the jth client do not s1[j] or the product * s1[j]) (j = 1...n) which is q by construction. * * Compute the factor w such that w s1[j] = s1[j] for all j. The * easy way to do this is to compute (q + s1[j]) / s1[j]. * Exercise for the student: prove the remainder is always zero. */ for (j = 1; j <= n; j++) { xbar[j] = BN_new(); xhat[j] = BN_new(); BN_add(w, dsa->q, s1[j]); BN_div(w, u, w, s1[j], ctx); BN_zero(xbar[j]); BN_set_word(v, n); for (i = 1; i <= n; i++) { if (i == j) continue; BN_mod_exp(u, x[i], v, dsa->q, ctx); BN_add(xbar[j], xbar[j], u); } BN_mod_mul(xbar[j], xbar[j], b1, dsa->q, ctx); BN_mod_exp(xhat[j], x[j], v, dsa->q, ctx); BN_mod_mul(xhat[j], xhat[j], w, dsa->q, ctx); } /* * We revoke client j by dividing q by s1[j]. The quotient * becomes the enabling key s. Note we always have to revoke * one key; otherwise, the plaintext and cryptotext would be * identical. For the present there are no provisions to revoke * additional keys, so we sail on with only token revocations. */ s = BN_new(); BN_copy(s, dsa->q); BN_div(s, u, s, s1[n], ctx); /* * For each combination of clients to be revoked, make private * encryption key E = A^s and partial decryption keys gbar = g^s * and ghat = g^(s b), all mod p. The servers use these keys to * compute the session encryption key and partial decryption * keys. These values must be regenerated if the enabling key is * changed. */ bige = BN_new(); gbar = BN_new(); ghat = BN_new(); BN_mod_exp(bige, biga, s, dsa->p, ctx); BN_mod_exp(gbar, dsa->g, s, dsa->p, ctx); BN_mod_mul(v, s, b, dsa->q, ctx); BN_mod_exp(ghat, dsa->g, v, dsa->p, ctx); /* * Notes: We produce the key media in three steps. The first * step is to generate the system parameters p, q, g, b, A and * the enabling keys s1[j]. Associated with each s1[j] are * parameters xbar[j] and xhat[j]. All of these parameters are * retained in a data structure protecteted by the trusted-agent * password. The p, xbar[j] and xhat[j] paremeters are * distributed to the j clients. When the client keys are to be * activated, the enabled keys are multipied together to form * the master enabling key s. This and the other parameters are * used to compute the server encryption key E and the partial * decryption keys gbar and ghat. * * In the identity exchange the client rolls random r and sends * it to the server. The server rolls random k, which is used * only once, then computes the session key E^k and partial * decryption keys gbar^k and ghat^k. The server sends the * encrypted r along with gbar^k and ghat^k to the client. The * client completes the decryption and verifies it matches r. */ /* * Write the MV trusted-agent parameters and keys as a DSA * private key encoded in PEM. * * p modulus p * q modulus q * g generator g * priv_key A mod p * pub_key b mod q * (remaining values are not used) */ i = 0; str = fheader("MVta", "mvta", groupname); fprintf(stderr, "Generating MV trusted-authority keys\n"); BN_copy(dsa->priv_key, biga); BN_copy(dsa->pub_key, b); pkey = EVP_PKEY_new(); EVP_PKEY_assign_DSA(pkey, dsa); PEM_write_PrivateKey(str, pkey, EVP_des_cbc(), NULL, 0, NULL, passwd1); evpars[i++] = pkey; if (debug) DSA_print_fp(stderr, dsa, 0); /* * Append the MV server parameters and keys as a DSA key encoded * in PEM. * * p modulus p * q modulus q (used only when generating k) * g bige * priv_key gbar * pub_key ghat * (remaining values are not used) */ fprintf(stderr, "Generating MV server keys\n"); dsa2 = DSA_new(); dsa2->p = BN_dup(dsa->p); dsa2->q = BN_dup(dsa->q); dsa2->g = BN_dup(bige); dsa2->priv_key = BN_dup(gbar); dsa2->pub_key = BN_dup(ghat); pkey1 = EVP_PKEY_new(); EVP_PKEY_assign_DSA(pkey1, dsa2); PEM_write_PrivateKey(str, pkey1, EVP_des_cbc(), NULL, 0, NULL, passwd1); evpars[i++] = pkey1; if (debug) DSA_print_fp(stderr, dsa2, 0); /* * Append the MV client parameters for each client j as DSA keys * encoded in PEM. * * p modulus p * priv_key xbar[j] mod q * pub_key xhat[j] mod q * (remaining values are not used) */ fprintf(stderr, "Generating %d MV client keys\n", n); for (j = 1; j <= n; j++) { sdsa = DSA_new(); sdsa->p = BN_dup(dsa->p); sdsa->q = BN_dup(BN_value_one()); sdsa->g = BN_dup(BN_value_one()); sdsa->priv_key = BN_dup(xbar[j]); sdsa->pub_key = BN_dup(xhat[j]); pkey1 = EVP_PKEY_new(); EVP_PKEY_set1_DSA(pkey1, sdsa); PEM_write_PrivateKey(str, pkey1, EVP_des_cbc(), NULL, 0, NULL, passwd1); evpars[i++] = pkey1; if (debug) DSA_print_fp(stderr, sdsa, 0); /* * The product gbar^k)^xbar[j] (ghat^k)^xhat[j] and E * are inverses of each other. We check that the product * is one for each client except the ones that have been * revoked. */ BN_mod_exp(v, dsa2->priv_key, sdsa->pub_key, dsa->p, ctx); BN_mod_exp(u, dsa2->pub_key, sdsa->priv_key, dsa->p, ctx); BN_mod_mul(u, u, v, dsa->p, ctx); BN_mod_mul(u, u, bige, dsa->p, ctx); if (!BN_is_one(u)) { fprintf(stderr, "Revoke key %d\n", j); continue; } } evpars[i++] = NULL; fclose(str); /* * Free the countries. */ for (i = 0; i <= n; i++) { BN_free(a[i]); BN_free(g[i]); } for (j = 1; j <= n; j++) { BN_free(x[j]); BN_free(xbar[j]); BN_free(xhat[j]); BN_free(s1[j]); } return (pkey); } /* * Generate X509v3 certificate. * * The certificate consists of the version number, serial number, * validity interval, issuer name, subject name and public key. For a * self-signed certificate, the issuer name is the same as the subject * name and these items are signed using the subject private key. The * validity interval extends from the current time to the same time one * year hence. For NTP purposes, it is convenient to use the NTP seconds * of the current time as the serial number. */ int x509 ( EVP_PKEY *pkey, /* generic signature algorithm */ const EVP_MD *md, /* generic digest algorithm */ char *gqpub, /* identity extension (hex string) */ char *exten, /* private cert extension */ char *name /* subject/issuer namd */ ) { X509 *cert; /* X509 certificate */ X509_NAME *subj; /* distinguished (common) name */ X509_EXTENSION *ex; /* X509v3 extension */ FILE *str; /* file handle */ ASN1_INTEGER *serial; /* serial number */ const char *id; /* digest/signature scheme name */ char pathbuf[MAXFILENAME + 1]; /* * Generate X509 self-signed certificate. * * Set the certificate serial to the NTP seconds for grins. Set * the version to 3. Set the initial validity to the current * time and the finalvalidity one year hence. */ id = OBJ_nid2sn(md->pkey_type); fprintf(stderr, "Generating new certificate %s %s\n", name, id); cert = X509_new(); X509_set_version(cert, 2L); serial = ASN1_INTEGER_new(); ASN1_INTEGER_set(serial, (long)epoch + JAN_1970); X509_set_serialNumber(cert, serial); ASN1_INTEGER_free(serial); X509_time_adj(X509_get_notBefore(cert), 0L, &epoch); X509_time_adj(X509_get_notAfter(cert), YEAR, &epoch); subj = X509_get_subject_name(cert); X509_NAME_add_entry_by_txt(subj, "commonName", MBSTRING_ASC, (unsigned char *) name, strlen(name), -1, 0); subj = X509_get_issuer_name(cert); X509_NAME_add_entry_by_txt(subj, "commonName", MBSTRING_ASC, (unsigned char *) name, strlen(name), -1, 0); if (!X509_set_pubkey(cert, pkey)) { fprintf(stderr, "Assign key fails\n%s\n", ERR_error_string(ERR_get_error(), NULL)); X509_free(cert); return (0); } /* * Add X509v3 extensions if present. These represent the minimum * set defined in RFC3280 less the certificate_policy extension, * which is seriously obfuscated in OpenSSL. */ /* * The basic_constraints extension CA:TRUE allows servers to * sign client certficitates. */ fprintf(stderr, "%s: %s\n", LN_basic_constraints, BASIC_CONSTRAINTS); ex = X509V3_EXT_conf_nid(NULL, NULL, NID_basic_constraints, BASIC_CONSTRAINTS); if (!X509_add_ext(cert, ex, -1)) { fprintf(stderr, "Add extension field fails\n%s\n", ERR_error_string(ERR_get_error(), NULL)); return (0); } X509_EXTENSION_free(ex); /* * The key_usage extension designates the purposes the key can * be used for. */ fprintf(stderr, "%s: %s\n", LN_key_usage, KEY_USAGE); ex = X509V3_EXT_conf_nid(NULL, NULL, NID_key_usage, KEY_USAGE); if (!X509_add_ext(cert, ex, -1)) { fprintf(stderr, "Add extension field fails\n%s\n", ERR_error_string(ERR_get_error(), NULL)); return (0); } X509_EXTENSION_free(ex); /* * The subject_key_identifier is used for the GQ public key. * This should not be controversial. */ if (gqpub != NULL) { fprintf(stderr, "%s\n", LN_subject_key_identifier); ex = X509V3_EXT_conf_nid(NULL, NULL, NID_subject_key_identifier, gqpub); if (!X509_add_ext(cert, ex, -1)) { fprintf(stderr, "Add extension field fails\n%s\n", ERR_error_string(ERR_get_error(), NULL)); return (0); } X509_EXTENSION_free(ex); } /* * The extended key usage extension is used for special purpose * here. The semantics probably do not conform to the designer's * intent and will likely change in future. * * "trustRoot" designates a root authority * "private" designates a private certificate */ if (exten != NULL) { fprintf(stderr, "%s: %s\n", LN_ext_key_usage, exten); ex = X509V3_EXT_conf_nid(NULL, NULL, NID_ext_key_usage, exten); if (!X509_add_ext(cert, ex, -1)) { fprintf(stderr, "Add extension field fails\n%s\n", ERR_error_string(ERR_get_error(), NULL)); return (0); } X509_EXTENSION_free(ex); } /* * Sign and verify. */ X509_sign(cert, pkey, md); if (X509_verify(cert, pkey) <= 0) { fprintf(stderr, "Verify %s certificate fails\n%s\n", id, ERR_error_string(ERR_get_error(), NULL)); X509_free(cert); return (0); } /* * Write the certificate encoded in PEM. */ sprintf(pathbuf, "%scert", id); str = fheader(pathbuf, "cert", hostname); PEM_write_X509(str, cert); fclose(str); if (debug) X509_print_fp(stderr, cert); X509_free(cert); return (1); } #if 0 /* asn2ntp is used only with commercial certificates */ /* * asn2ntp - convert ASN1_TIME time structure to NTP time */ u_long asn2ntp ( ASN1_TIME *asn1time /* pointer to ASN1_TIME structure */ ) { char *v; /* pointer to ASN1_TIME string */ struct tm tm; /* time decode structure time */ /* * Extract time string YYMMDDHHMMSSZ from ASN.1 time structure. * Note that the YY, MM, DD fields start with one, the HH, MM, * SS fiels start with zero and the Z character should be 'Z' * for UTC. Also note that years less than 50 map to years * greater than 100. Dontcha love ASN.1? */ if (asn1time->length > 13) return (-1); v = (char *)asn1time->data; tm.tm_year = (v[0] - '0') * 10 + v[1] - '0'; if (tm.tm_year < 50) tm.tm_year += 100; tm.tm_mon = (v[2] - '0') * 10 + v[3] - '0' - 1; tm.tm_mday = (v[4] - '0') * 10 + v[5] - '0'; tm.tm_hour = (v[6] - '0') * 10 + v[7] - '0'; tm.tm_min = (v[8] - '0') * 10 + v[9] - '0'; tm.tm_sec = (v[10] - '0') * 10 + v[11] - '0'; tm.tm_wday = 0; tm.tm_yday = 0; tm.tm_isdst = 0; return (mktime(&tm) + JAN_1970); } #endif /* * Callback routine */ void cb ( int n1, /* arg 1 */ int n2, /* arg 2 */ void *chr /* arg 3 */ ) { switch (n1) { case 0: d0++; fprintf(stderr, "%s %d %d %lu\r", (char *)chr, n1, n2, d0); break; case 1: d1++; fprintf(stderr, "%s\t\t%d %d %lu\r", (char *)chr, n1, n2, d1); break; case 2: d2++; fprintf(stderr, "%s\t\t\t\t%d %d %lu\r", (char *)chr, n1, n2, d2); break; case 3: d3++; fprintf(stderr, "%s\t\t\t\t\t\t%d %d %lu\r", (char *)chr, n1, n2, d3); break; } } /* * Generate key */ EVP_PKEY * /* public/private key pair */ genkey( char *type, /* key type (RSA or DSA) */ char *id /* file name id */ ) { if (type == NULL) return (NULL); if (strcmp(type, "RSA") == 0) return (gen_rsa(id)); else if (strcmp(type, "DSA") == 0) return (gen_dsa(id)); fprintf(stderr, "Invalid %s key type %s\n", id, type); return (NULL); } #endif /* OPENSSL */ /* * Generate file header and link */ FILE * fheader ( const char *file, /* file name id */ const char *ulink, /* linkname */ const char *owner /* owner name */ ) { FILE *str; /* file handle */ char linkname[MAXFILENAME]; /* link name */ int temp; sprintf(filename, "ntpkey_%s_%s.%lu", file, owner, epoch + JAN_1970); if ((str = fopen(filename, "w")) == NULL) { perror("Write"); exit (-1); } sprintf(linkname, "ntpkey_%s_%s", ulink, owner); remove(linkname); temp = symlink(filename, linkname); if (temp < 0) perror(file); fprintf(stderr, "Generating new %s file and link\n", ulink); fprintf(stderr, "%s->%s\n", linkname, filename); fprintf(str, "# %s\n# %s\n", filename, ctime(&epoch)); return (str); } ntp-4.2.6p5/util/hist.c0000644000175000017500000000373011307651604013707 0ustar peterpeter/* * This program can be used to calibrate the clock reading jitter of a * particular CPU and operating system. It first tickles every element * of an array, in order to force pages into memory, then repeatedly calls * gettimeofday() and, finally, writes out the time values for later * analysis. From this you can determine the jitter and if the clock ever * runs backwards. */ #ifdef HAVE_CONFIG_H # include #endif #include "ntp_types.h" #include #include #define NBUF 100001 /* size of basic histogram */ #define NSRT 20000 /* size of overflow histogram */ #define NCNT (600 * 1000000) /* sample interval (us) */ int col (long *, long *); int main( int argc, char *argv[] ) { struct timeval ts, tr, tp; struct timezone tzp; int i, j, n; long t, u, v, w, gtod[NBUF], ovfl[NSRT]; /* * Force pages into memory */ for (i = 0; i < NBUF; i++) gtod[i] = 0; for (i = 0; i < NSRT; i++) ovfl[i] = 0; /* * Construct histogram */ n = 0; gettimeofday(&ts, &tzp); t = ts.tv_sec * 1000000 + ts.tv_usec; v = t; while (1) { gettimeofday(&tr, &tzp); u = tr.tv_sec * 1000000 + tr.tv_usec; if (u - v > NCNT) break; w = u - t; if (w <= 0) { /* printf("error <= 0 %ld %d %d, %d %d\n", w, ts.tv_sec, ts.tv_usec, tr.tv_sec, tr.tv_usec); */ } else if (w > NBUF - 1) { ovfl[n] = w; if (n < NSRT - 1) n++; } else { gtod[w]++; } ts = tr; t = u; } /* * Write out histogram */ for (i = 0; i < NBUF - 1; i++) { if (gtod[i] > 0) printf("%ld %ld\n", i, gtod[i]); } if (n == 0) return; qsort( #ifdef QSORT_USES_VOID_P (void *) #else (char *) #endif ovfl, (size_t)n, sizeof(long), col); w = 0; j = 0; for (i = 0; i < n; i++) { if (ovfl[i] != w) { if (j > 0) printf("%ld %ld\n", w, j); w = ovfl[i]; j = 1; } else j++; } if (j > 0) printf("%ld %ld\n", w, j); exit(0); } int col( long *x, long *y ) { return (*x - *y); } ntp-4.2.6p5/util/kern.c0000644000175000017500000001271210017034610013664 0ustar peterpeter/* * This program simulates a first-order, type-II phase-lock loop using * actual code segments from modified kernel distributions for SunOS, * Ultrix and OSF/1 kernels. These segments do not use any licensed code. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #ifdef HAVE_TIMEX_H # include "timex.h" #endif /* * Phase-lock loop definitions */ #define HZ 100 /* timer interrupt frequency (Hz) */ #define MAXPHASE 512000 /* max phase error (us) */ #define MAXFREQ 200 /* max frequency error (ppm) */ #define TAU 2 /* time constant (shift 0 - 6) */ #define POLL 16 /* interval between updates (s) */ #define MAXSEC 1200 /* max interval between updates (s) */ /* * Function declarations */ void hardupdate(); void hardclock(); void second_overflow(); /* * Kernel variables */ int tick; /* timer interrupt period (us) */ int fixtick; /* amortization constant (ppm) */ struct timeval timex; /* ripoff of kernel time variable */ /* * Phase-lock loop variables */ int time_status = TIME_BAD; /* clock synchronization status */ long time_offset = 0; /* time adjustment (us) */ long time_constant = 0; /* pll time constant */ long time_tolerance = MAXFREQ; /* frequency tolerance (ppm) */ long time_precision = 1000000 / HZ; /* clock precision (us) */ long time_maxerror = MAXPHASE; /* maximum error (us) */ long time_esterror = MAXPHASE; /* estimated error (us) */ long time_phase = 0; /* phase offset (scaled us) */ long time_freq = 0; /* frequency offset (scaled ppm) */ long time_adj = 0; /* tick adjust (scaled 1 / HZ) */ long time_reftime = 0; /* time at last adjustment (s) */ /* * Simulation variables */ double timey = 0; /* simulation time (us) */ long timez = 0; /* current error (us) */ long poll_interval = 0; /* poll counter */ /* * Simulation test program */ int main( int argc, char *argv[] ) { tick = 1000000 / HZ; fixtick = 1000000 % HZ; timex.tv_sec = 0; timex.tv_usec = MAXPHASE; time_freq = 0; time_constant = TAU; printf("tick %d us, fixtick %d us\n", tick, fixtick); printf(" time offset freq _offset _freq _adj\n"); /* * Grind the loop until ^C */ while (1) { timey += (double)(1000000) / HZ; if (timey >= 1000000) timey -= 1000000; hardclock(); if (timex.tv_usec >= 1000000) { timex.tv_usec -= 1000000; timex.tv_sec++; second_overflow(); poll_interval++; if (!(poll_interval % POLL)) { timez = (long)timey - timex.tv_usec; if (timez > 500000) timez -= 1000000; if (timez < -500000) timez += 1000000; hardupdate(timez); printf("%10li%10li%10.2f %08lx %08lx %08lx\n", timex.tv_sec, timez, (double)time_freq / (1 << SHIFT_KF), time_offset, time_freq, time_adj); } } } } /* * This routine simulates the ntp_adjtime() call * * For default SHIFT_UPDATE = 12, offset is limited to +-512 ms, the * maximum interval between updates is 4096 s and the maximum frequency * offset is +-31.25 ms/s. */ void hardupdate( long offset ) { long ltemp, mtemp; time_offset = offset << SHIFT_UPDATE; mtemp = timex.tv_sec - time_reftime; time_reftime = timex.tv_sec; if (mtemp > MAXSEC) mtemp = 0; /* ugly multiply should be replaced */ if (offset < 0) time_freq -= (-offset * mtemp) >> (time_constant + time_constant); else time_freq += (offset * mtemp) >> (time_constant + time_constant); ltemp = time_tolerance << SHIFT_KF; if (time_freq > ltemp) time_freq = ltemp; else if (time_freq < -ltemp) time_freq = -ltemp; if (time_status == TIME_BAD) time_status = TIME_OK; } /* * This routine simulates the timer interrupt */ void hardclock(void) { int ltemp, time_update; time_update = tick; /* computed by adjtime() */ time_phase += time_adj; if (time_phase < -FINEUSEC) { ltemp = -time_phase >> SHIFT_SCALE; time_phase += ltemp << SHIFT_SCALE; time_update -= ltemp; } else if (time_phase > FINEUSEC) { ltemp = time_phase >> SHIFT_SCALE; time_phase -= ltemp << SHIFT_SCALE; time_update += ltemp; } timex.tv_usec += time_update; } /* * This routine simulates the overflow of the microsecond field * * With SHIFT_SCALE = 23, the maximum frequency adjustment is +-256 us * per tick, or 25.6 ms/s at a clock frequency of 100 Hz. The time * contribution is shifted right a minimum of two bits, while the frequency * contribution is a right shift. Thus, overflow is prevented if the * frequency contribution is limited to half the maximum or 15.625 ms/s. */ void second_overflow(void) { int ltemp; time_maxerror += time_tolerance; if (time_offset < 0) { ltemp = -time_offset >> (SHIFT_KG + time_constant); time_offset += ltemp; time_adj = -(ltemp << (SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE)); } else { ltemp = time_offset >> (SHIFT_KG + time_constant); time_offset -= ltemp; time_adj = ltemp << (SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE); } if (time_freq < 0) time_adj -= -time_freq >> (SHIFT_KF + SHIFT_HZ - SHIFT_SCALE); else time_adj += time_freq >> (SHIFT_KF + SHIFT_HZ - SHIFT_SCALE); time_adj += fixtick << (SHIFT_SCALE - SHIFT_HZ); /* ugly divide should be replaced */ if (timex.tv_sec % 86400 == 0) { switch (time_status) { case TIME_INS: timex.tv_sec--; /* !! */ time_status = TIME_OOP; break; case TIME_DEL: timex.tv_sec++; time_status = TIME_OK; break; case TIME_OOP: time_status = TIME_OK; break; } } } ntp-4.2.6p5/util/ntp-keygen-opts.h0000644000175000017500000002301711675460620016015 0ustar peterpeter/* * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h) * * It has been AutoGen-ed December 24, 2011 at 06:34:40 PM by AutoGen 5.12 * From the definitions ntp-keygen-opts.def * and the template file options * * Generated from AutoOpts 35:0:10 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the ntp-keygen author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * This source file is copyrighted and licensed under the following terms: * * see html/copyright.html * */ /* * This file contains the programmatic interface to the Automated * Options generated for the ntp-keygen program. * These macros are documented in the AutoGen info file in the * "AutoOpts" chapter. Please refer to that doc for usage help. */ #ifndef AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD #define AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD 1 #include "config.h" #include /* * Ensure that the library used for compiling this generated header is at * least as new as the version current when the header template was released * (not counting patch version increments). Also ensure that the oldest * tolerable version is at least as old as what was current when the header * template was released. */ #define AO_TEMPLATE_VERSION 143360 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header Choke Me. #endif /* * Enumeration of each option: */ typedef enum { INDEX_OPT_CERTIFICATE = 0, INDEX_OPT_DEBUG_LEVEL = 1, INDEX_OPT_SET_DEBUG_LEVEL = 2, INDEX_OPT_ID_KEY = 3, INDEX_OPT_GQ_PARAMS = 4, INDEX_OPT_HOST_KEY = 5, INDEX_OPT_IFFKEY = 6, INDEX_OPT_ISSUER_NAME = 7, INDEX_OPT_MD5KEY = 8, INDEX_OPT_MODULUS = 9, INDEX_OPT_PVT_CERT = 10, INDEX_OPT_PVT_PASSWD = 11, INDEX_OPT_GET_PVT_PASSWD = 12, INDEX_OPT_SIGN_KEY = 13, INDEX_OPT_SUBJECT_NAME = 14, INDEX_OPT_TRUSTED_CERT = 15, INDEX_OPT_MV_PARAMS = 16, INDEX_OPT_MV_KEYS = 17, INDEX_OPT_VERSION = 18, INDEX_OPT_HELP = 19, INDEX_OPT_MORE_HELP = 20, INDEX_OPT_SAVE_OPTS = 21, INDEX_OPT_LOAD_OPTS = 22 } teOptIndex; #define OPTION_CT 23 #define NTP_KEYGEN_VERSION "4.2.6p5" #define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.6p5" /* * Interface defines for all options. Replace "n" with the UPPER_CASED * option name (as in the teOptIndex enumeration above). * e.g. HAVE_OPT(CERTIFICATE) */ #define DESC(n) (ntp_keygenOptions.pOptDesc[INDEX_OPT_## n]) #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) #define OPT_ARG(n) (DESC(n).optArg.argString) #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) #define COUNT_OPT(n) (DESC(n).optOccCt) #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) #define CLEAR_OPT(n) STMTS( \ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ DESC(n).fOptState |= OPTST_DISABLED; \ DESC(n).optCookie = NULL ) /* * * * * * * * Enumeration of ntp-keygen exit codes */ typedef enum { NTP_KEYGEN_EXIT_SUCCESS = 0, NTP_KEYGEN_EXIT_FAILURE = 1 } ntp_keygen_exit_code_t; /* * Make sure there are no #define name conflicts with the option names */ #ifndef NO_OPTION_NAME_WARNINGS # ifdef CERTIFICATE # warning undefining CERTIFICATE due to option name conflict # undef CERTIFICATE # endif # ifdef DEBUG_LEVEL # warning undefining DEBUG_LEVEL due to option name conflict # undef DEBUG_LEVEL # endif # ifdef SET_DEBUG_LEVEL # warning undefining SET_DEBUG_LEVEL due to option name conflict # undef SET_DEBUG_LEVEL # endif # ifdef ID_KEY # warning undefining ID_KEY due to option name conflict # undef ID_KEY # endif # ifdef GQ_PARAMS # warning undefining GQ_PARAMS due to option name conflict # undef GQ_PARAMS # endif # ifdef HOST_KEY # warning undefining HOST_KEY due to option name conflict # undef HOST_KEY # endif # ifdef IFFKEY # warning undefining IFFKEY due to option name conflict # undef IFFKEY # endif # ifdef ISSUER_NAME # warning undefining ISSUER_NAME due to option name conflict # undef ISSUER_NAME # endif # ifdef MD5KEY # warning undefining MD5KEY due to option name conflict # undef MD5KEY # endif # ifdef MODULUS # warning undefining MODULUS due to option name conflict # undef MODULUS # endif # ifdef PVT_CERT # warning undefining PVT_CERT due to option name conflict # undef PVT_CERT # endif # ifdef PVT_PASSWD # warning undefining PVT_PASSWD due to option name conflict # undef PVT_PASSWD # endif # ifdef GET_PVT_PASSWD # warning undefining GET_PVT_PASSWD due to option name conflict # undef GET_PVT_PASSWD # endif # ifdef SIGN_KEY # warning undefining SIGN_KEY due to option name conflict # undef SIGN_KEY # endif # ifdef SUBJECT_NAME # warning undefining SUBJECT_NAME due to option name conflict # undef SUBJECT_NAME # endif # ifdef TRUSTED_CERT # warning undefining TRUSTED_CERT due to option name conflict # undef TRUSTED_CERT # endif # ifdef MV_PARAMS # warning undefining MV_PARAMS due to option name conflict # undef MV_PARAMS # endif # ifdef MV_KEYS # warning undefining MV_KEYS due to option name conflict # undef MV_KEYS # endif #else /* NO_OPTION_NAME_WARNINGS */ # undef CERTIFICATE # undef DEBUG_LEVEL # undef SET_DEBUG_LEVEL # undef ID_KEY # undef GQ_PARAMS # undef HOST_KEY # undef IFFKEY # undef ISSUER_NAME # undef MD5KEY # undef MODULUS # undef PVT_CERT # undef PVT_PASSWD # undef GET_PVT_PASSWD # undef SIGN_KEY # undef SUBJECT_NAME # undef TRUSTED_CERT # undef MV_PARAMS # undef MV_KEYS #endif /* NO_OPTION_NAME_WARNINGS */ /* * * * * * * * Interface defines for specific options. */ #define VALUE_OPT_CERTIFICATE 'c' #define VALUE_OPT_DEBUG_LEVEL 'd' #define VALUE_OPT_SET_DEBUG_LEVEL 'D' #define VALUE_OPT_ID_KEY 'e' #define VALUE_OPT_GQ_PARAMS 'G' #define VALUE_OPT_HOST_KEY 'H' #define VALUE_OPT_IFFKEY 'I' #define VALUE_OPT_ISSUER_NAME 'i' #define VALUE_OPT_MD5KEY 'M' #define VALUE_OPT_MODULUS 'm' #ifdef OPENSSL #define OPT_VALUE_MODULUS (DESC(MODULUS).optArg.argInt) #endif /* OPENSSL */ #define VALUE_OPT_PVT_CERT 'P' #define VALUE_OPT_PVT_PASSWD 'p' #define VALUE_OPT_GET_PVT_PASSWD 'q' #define VALUE_OPT_SIGN_KEY 'S' #define VALUE_OPT_SUBJECT_NAME 's' #define VALUE_OPT_TRUSTED_CERT 'T' #define VALUE_OPT_MV_PARAMS 'V' #ifdef OPENSSL #define OPT_VALUE_MV_PARAMS (DESC(MV_PARAMS).optArg.argInt) #endif /* OPENSSL */ #define VALUE_OPT_MV_KEYS 'v' #ifdef OPENSSL #define OPT_VALUE_MV_KEYS (DESC(MV_KEYS).optArg.argInt) #endif /* OPENSSL */ #define VALUE_OPT_HELP '?' #define VALUE_OPT_MORE_HELP '!' #define VALUE_OPT_VERSION INDEX_OPT_VERSION #define VALUE_OPT_SAVE_OPTS '>' #define VALUE_OPT_LOAD_OPTS '<' #define SET_OPT_SAVE_OPTS(a) STMTS( \ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \ DESC(SAVE_OPTS).fOptState |= OPTST_SET; \ DESC(SAVE_OPTS).optArg.argString = (char const*)(a) ) /* * Interface defines not associated with particular options */ #define ERRSKIP_OPTERR STMTS(ntp_keygenOptions.fOptSet &= ~OPTPROC_ERRSTOP) #define ERRSTOP_OPTERR STMTS(ntp_keygenOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_OPT(n) STMTS( \ ntp_keygenOptions.curOptIdx = (n); \ ntp_keygenOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) #define USAGE(c) (*ntp_keygenOptions.pUsageProc)(&ntp_keygenOptions, c) /* extracted from opthead.tlib near line 451 */ #ifdef __cplusplus extern "C" { #endif /* * * * * * * * Declare the ntp-keygen option descriptor. */ extern tOptions ntp_keygenOptions; #if defined(ENABLE_NLS) # ifndef _ # include static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); } # define _(s) aoGetsText(s) # endif /* _() */ # define OPT_NO_XLAT_CFG_NAMES STMTS(ntp_keygenOptions.fOptSet |= \ OPTPROC_NXLAT_OPT_CFG;) # define OPT_NO_XLAT_OPT_NAMES STMTS(ntp_keygenOptions.fOptSet |= \ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) # define OPT_XLAT_CFG_NAMES STMTS(ntp_keygenOptions.fOptSet &= \ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) # define OPT_XLAT_OPT_NAMES STMTS(ntp_keygenOptions.fOptSet &= \ ~OPTPROC_NXLAT_OPT;) #else /* ENABLE_NLS */ # define OPT_NO_XLAT_CFG_NAMES # define OPT_NO_XLAT_OPT_NAMES # define OPT_XLAT_CFG_NAMES # define OPT_XLAT_OPT_NAMES # ifndef _ # define _(_s) _s # endif #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif #endif /* AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD */ /* ntp-keygen-opts.h ends here */ ntp-4.2.6p5/util/ntptime.c0000644000175000017500000002357011307651603014423 0ustar peterpeter/* * NTP test program * * This program tests to see if the NTP user interface routines * ntp_gettime() and ntp_adjtime() have been implemented in the kernel. * If so, each of these routines is called to display current timekeeping * data. * * For more information, see the README.kern file in the doc directory * of the xntp3 distribution. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_syscall.h" #include "ntp_stdlib.h" #include #include #include #include #ifdef NTP_SYSCALLS_STD # ifndef SYS_DECOSF1 # define BADCALL -1 /* this is supposed to be a bad syscall */ # endif /* SYS_DECOSF1 */ #endif #ifdef HAVE_STRUCT_NTPTIMEVAL_TIME_TV_NSEC #define tv_frac_sec tv_nsec #else #define tv_frac_sec tv_usec #endif #define TIMEX_MOD_BITS \ "\20\1OFFSET\2FREQUENCY\3MAXERROR\4ESTERROR\5STATUS\6TIMECONST\ \13PLL\14FLL\15MICRO\16NANO\17CLKB\20CLKA" #define TIMEX_STA_BITS \ "\20\1PLL\2PPSFREQ\3PPSTIME\4FLL\5INS\6DEL\7UNSYNC\10FREQHOLD\ \11PPSSIGNAL\12PPSJITTER\13PPSWANDER\14PPSERROR\15CLOCKERR\ \16NANO\17MODE\20CLK" #define SCALE_FREQ 65536 /* frequency scale */ /* * Function prototypes */ char *sprintb (u_int, const char *); const char *timex_state (int); #ifdef SIGSYS void pll_trap (int); static struct sigaction newsigsys; /* new sigaction status */ static struct sigaction sigsys; /* current sigaction status */ static sigjmp_buf env; /* environment var. for pll_trap() */ #endif static volatile int pll_control; /* (0) daemon, (1) kernel loop */ static volatile int status; /* most recent status bits */ static volatile int flash; /* most recent ntp_adjtime() bits */ char* progname; volatile int debug; /* for libntp */ static char optargs[] = "MNT:cde:f:hm:o:rs:t:"; int main( int argc, char *argv[] ) { extern int ntp_optind; extern char *ntp_optarg; #ifdef SUBST_ADJTIMEX struct timex ntv; #else struct ntptimeval ntv; #endif struct timeval tv; struct timex ntx, _ntx; int times[20]; double ftemp, gtemp, htemp; long time_frac; /* ntv.time.tv_frac_sec (us/ns) */ l_fp ts; volatile unsigned ts_mask = TS_MASK; /* defaults to 20 bits (us) */ volatile unsigned ts_roundbit = TS_ROUNDBIT; /* defaults to 20 bits (us) */ volatile int fdigits = 6; /* fractional digits for us */ int c; int errflg = 0; int cost = 0; volatile int rawtime = 0; memset((char *)&ntx, 0, sizeof(ntx)); progname = argv[0]; while ((c = ntp_getopt(argc, argv, optargs)) != EOF) switch (c) { #ifdef MOD_MICRO case 'M': ntx.modes |= MOD_MICRO; break; #endif #ifdef MOD_NANO case 'N': ntx.modes |= MOD_NANO; break; #endif #ifdef NTP_API # if NTP_API > 3 case 'T': ntx.modes = MOD_TAI; ntx.constant = atoi(ntp_optarg); break; # endif #endif case 'c': cost++; break; case 'e': ntx.modes |= MOD_ESTERROR; ntx.esterror = atoi(ntp_optarg); break; case 'f': ntx.modes |= MOD_FREQUENCY; ntx.freq = (long)(atof(ntp_optarg) * SCALE_FREQ); break; case 'm': ntx.modes |= MOD_MAXERROR; ntx.maxerror = atoi(ntp_optarg); break; case 'o': ntx.modes |= MOD_OFFSET; ntx.offset = atoi(ntp_optarg); break; case 'r': rawtime++; break; case 's': ntx.modes |= MOD_STATUS; ntx.status = atoi(ntp_optarg); if (ntx.status < 0 || ntx.status >= 0x100) errflg++; break; case 't': ntx.modes |= MOD_TIMECONST; ntx.constant = atoi(ntp_optarg); break; default: errflg++; } if (errflg || (ntp_optind != argc)) { (void) fprintf(stderr, "usage: %s [-%s]\n\n\ %s%s%s\ -c display the time taken to call ntp_gettime (us)\n\ -e esterror estimate of the error (us)\n\ -f frequency Frequency error (-500 .. 500) (ppm)\n\ -h display this help info\n\ -m maxerror max possible error (us)\n\ -o offset current offset (ms)\n\ -r print the unix and NTP time raw\n\ -s status Set the status bits\n\ -t timeconstant log2 of PLL time constant (0 .. %d)\n", progname, optargs, #ifdef MOD_MICRO "-M switch to microsecond mode\n", #else "", #endif #ifdef MOD_NANO "-N switch to nanosecond mode\n", #else "", #endif #ifdef NTP_API # if NTP_API > 3 "-T tai_offset set TAI offset\n", # else "", # endif #else "", #endif MAXTC); exit(2); } #ifdef SIGSYS /* * Test to make sure the sigaction() works in case of invalid * syscall codes. */ newsigsys.sa_handler = pll_trap; newsigsys.sa_flags = 0; if (sigaction(SIGSYS, &newsigsys, &sigsys)) { perror("sigaction() fails to save SIGSYS trap"); exit(1); } #endif /* SIGSYS */ #ifdef BADCALL /* * Make sure the trapcatcher works. */ pll_control = 1; #ifdef SIGSYS if (sigsetjmp(env, 1) == 0) { #endif status = syscall(BADCALL, &ntv); /* dummy parameter */ if ((status < 0) && (errno == ENOSYS)) --pll_control; #ifdef SIGSYS } #endif if (pll_control) printf("sigaction() failed to catch an invalid syscall\n"); #endif /* BADCALL */ if (cost) { #ifdef SIGSYS if (sigsetjmp(env, 1) == 0) { #endif for (c = 0; c < sizeof times / sizeof times[0]; c++) { status = ntp_gettime(&ntv); if ((status < 0) && (errno == ENOSYS)) --pll_control; if (pll_control < 0) break; times[c] = ntv.time.tv_frac_sec; } #ifdef SIGSYS } #endif if (pll_control >= 0) { printf("[ us %06d:", times[0]); for (c = 1; c < sizeof times / sizeof times[0]; c++) printf(" %d", times[c] - times[c - 1]); printf(" ]\n"); } } #ifdef SIGSYS if (sigsetjmp(env, 1) == 0) { #endif status = ntp_gettime(&ntv); if ((status < 0) && (errno == ENOSYS)) --pll_control; #ifdef SIGSYS } #endif _ntx.modes = 0; /* Ensure nothing is set */ #ifdef SIGSYS if (sigsetjmp(env, 1) == 0) { #endif status = ntp_adjtime(&_ntx); if ((status < 0) && (errno == ENOSYS)) --pll_control; flash = _ntx.status; #ifdef SIGSYS } #endif if (pll_control < 0) { printf("NTP user interface routines are not configured in this kernel.\n"); goto lexit; } /* * Fetch timekeeping data and display. */ status = ntp_gettime(&ntv); if (status < 0) perror("ntp_gettime() call fails"); else { printf("ntp_gettime() returns code %d (%s)\n", status, timex_state(status)); time_frac = ntv.time.tv_frac_sec; #ifdef STA_NANO if (flash & STA_NANO) { ntv.time.tv_frac_sec /= 1000; ts_mask = 0xfffffffc; /* 1/2^30 */ ts_roundbit = 0x00000002; fdigits = 9; } #endif tv.tv_sec = ntv.time.tv_sec; tv.tv_usec = ntv.time.tv_frac_sec; TVTOTS(&tv, &ts); ts.l_ui += JAN_1970; ts.l_uf += ts_roundbit; ts.l_uf &= ts_mask; printf(" time %s, (.%0*d),\n", prettydate(&ts), fdigits, (int) time_frac); printf(" maximum error %lu us, estimated error %lu us", (u_long)ntv.maxerror, (u_long)ntv.esterror); if (rawtime) printf(" ntptime=%x.%x unixtime=%x.%0*d %s", (unsigned int) ts.l_ui, (unsigned int) ts.l_uf, (int) ntv.time.tv_sec, fdigits, (int) time_frac, ctime((const time_t *) &ntv.time.tv_sec)); #if NTP_API > 3 printf(", TAI offset %ld\n", (long)ntv.tai); #else printf("\n"); #endif /* NTP_API */ } status = ntp_adjtime(&ntx); if (status < 0) perror((errno == EPERM) ? "Must be root to set kernel values\nntp_adjtime() call fails" : "ntp_adjtime() call fails"); else { flash = ntx.status; printf("ntp_adjtime() returns code %d (%s)\n", status, timex_state(status)); printf(" modes %s,\n", sprintb(ntx.modes, TIMEX_MOD_BITS)); ftemp = (double)ntx.offset; #ifdef STA_NANO if (flash & STA_NANO) ftemp /= 1000.0; #endif printf(" offset %.3f", ftemp); ftemp = (double)ntx.freq / SCALE_FREQ; printf(" us, frequency %.3f ppm, interval %d s,\n", ftemp, 1 << ntx.shift); printf(" maximum error %lu us, estimated error %lu us,\n", (u_long)ntx.maxerror, (u_long)ntx.esterror); printf(" status %s,\n", sprintb((u_int)ntx.status, TIMEX_STA_BITS)); ftemp = (double)ntx.tolerance / SCALE_FREQ; gtemp = (double)ntx.precision; #ifdef STA_NANO if (flash & STA_NANO) gtemp /= 1000.0; #endif printf( " time constant %lu, precision %.3f us, tolerance %.0f ppm,\n", (u_long)ntx.constant, gtemp, ftemp); if (ntx.shift == 0) exit (0); ftemp = (double)ntx.ppsfreq / SCALE_FREQ; gtemp = (double)ntx.stabil / SCALE_FREQ; htemp = (double)ntx.jitter; #ifdef STA_NANO if (flash & STA_NANO) htemp /= 1000.0; #endif printf( " pps frequency %.3f ppm, stability %.3f ppm, jitter %.3f us,\n", ftemp, gtemp, htemp); printf(" intervals %lu, jitter exceeded %lu, stability exceeded %lu, errors %lu.\n", (u_long)ntx.calcnt, (u_long)ntx.jitcnt, (u_long)ntx.stbcnt, (u_long)ntx.errcnt); return (0); } /* * Put things back together the way we found them. */ lexit: #ifdef SIGSYS if (sigaction(SIGSYS, &sigsys, (struct sigaction *)NULL)) { perror("sigaction() fails to restore SIGSYS trap"); exit(1); } #endif exit(0); } #ifdef SIGSYS /* * pll_trap - trap processor for undefined syscalls */ void pll_trap( int arg ) { pll_control--; siglongjmp(env, 1); } #endif /* * Print a value a la the %b format of the kernel's printf */ char * sprintb( register u_int v, register const char *bits ) { register char *cp; register int i, any = 0; register char c; static char buf[132]; if (bits && *bits == 8) (void)sprintf(buf, "0%o", v); else (void)sprintf(buf, "0x%x", v); cp = buf + strlen(buf); if (bits) { bits++; *cp++ = ' '; *cp++ = '('; while ((i = *bits++) != 0) { if (v & (1 << (i-1))) { if (any) *cp++ = ','; any = 1; for (; (c = *bits) > 32; bits++) *cp++ = c; } else for (; *bits > 32; bits++) continue; } *cp++ = ')'; } *cp = '\0'; return (buf); } const char *timex_states[] = { "OK", "INS", "DEL", "OOP", "WAIT", "ERROR" }; const char * timex_state( register int s ) { static char buf[32]; if (s >= 0 && s < sizeof(timex_states) / sizeof(timex_states[0])) return (timex_states[s]); sprintf(buf, "TIME-#%d", s); return (buf); } ntp-4.2.6p5/util/ntp-keygen.10000644000175000017500000001333411675460625014751 0ustar peterpeter.TH NTP-KEYGEN 1 2011-12-24 "(ntp 4.2.6p5)" "Programmer's Manual" .\" EDIT THIS FILE WITH CAUTION (ntp-keygen.1) .\" .\" It has been AutoGen-ed December 24, 2011 at 06:34:45 PM by AutoGen 5.12 .\" From the definitions ntp-keygen-opts.def .\" and the template file agman1.tpl .\" .SH NAME ntp-keygen \- Create a NTP host key .SH SYNOPSIS .B ntp-keygen .\" Mixture of short (flag) options and long options .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..." .PP All arguments must be options. .SH "DESCRIPTION" This manual page briefly documents the \fBntp-keygen\fP command. If there is no new host key, look for an existing one. If one is not found, create it. .SH OPTIONS .TP .BR \-c " \fIscheme\fP, " \--certificate "=" \fIscheme\fP certificate scheme. .sp scheme is one of RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160, DSA-SHA, or DSA-SHA1. Select the certificate message digest/signature encryption scheme. Note that RSA schemes must be used with a RSA sign key and DSA schemes must be used with a DSA sign key. The default without this option is RSA-MD5. .TP .BR \-d ", " \--debug-level Increase output debug message level. This option may appear an unlimited number of times. .sp Increase the debugging message output level. .TP .BR \-D " \fIstring\fP, " \--set-debug-level "=" \fIstring\fP Set the output debug message level. This option may appear an unlimited number of times. .sp Set the output debugging level. Can be supplied multiple times, but each overrides the previous value(s). .TP .BR \-e ", " \--id-key Write IFF or GQ identity keys. .sp Write the IFF or GQ client keys to the standard output. This is intended for automatic key distribution by mail. .TP .BR \-G ", " \--gq-params Generate GQ parameters and keys. .sp Generate parameters and keys for the GQ identification scheme, obsoleting any that may exist. .TP .BR \-H ", " \--host-key generate RSA host key. .sp Generate new host keys, obsoleting any that may exist. .TP .BR \-I ", " \--iffkey generate IFF parameters. .sp Generate parameters for the IFF identification scheme, obsoleting any that may exist. .TP .BR \-i " \fIissuer-name\fP, " \--issuer-name "=" \fIissuer-name\fP set issuer name. .sp Set the suject name to name. This is used as the subject field in certificates and in the file name for host and sign keys. .TP .BR \-M ", " \--md5key generate MD5 keys. .sp Generate MD5 keys, obsoleting any that may exist. .TP .BR \-m " \fImodulus\fP, " \--modulus "=" \fImodulus\fP modulus. This option takes an integer number as its argument. The value of \fImodulus\fP is constrained to being: .in +4 .nf .na in the range 256 through 2048 .fi .in -4 .sp The number of bits in the prime modulus. The default is 512. .TP .BR \-P ", " \--pvt-cert generate PC private certificate. .sp Generate a private certificate. By default, the program generates public certificates. .TP .BR \-p " \fIpasswd\fP, " \--pvt-passwd "=" \fIpasswd\fP output private password. .sp Encrypt generated files containing private data with the specified password and the DES-CBC algorithm. .TP .BR \-q " \fIpasswd\fP, " \--get-pvt-passwd "=" \fIpasswd\fP input private password. .sp Set the password for reading files to the specified password. .TP .BR \-S " \fIsign\fP, " \--sign-key "=" \fIsign\fP generate sign key (RSA or DSA). .sp Generate a new sign key of the designated type, obsoleting any that may exist. By default, the program uses the host key as the sign key. .TP .BR \-s " \fIhost\fP, " \--subject-name "=" \fIhost\fP set subject name. .sp Set the issuer name to name. This is used for the issuer field in certificates and in the file name for identity files. .TP .BR \-T ", " \--trusted-cert trusted certificate (TC scheme). .sp Generate a trusted certificate. By default, the program generates a non-trusted certificate. .TP .BR \-V " \fInum\fP, " \--mv-params "=" \fInum\fP generate MV parameters. This option takes an integer number as its argument. .sp Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme. .TP .BR \-v " \fInum\fP, " \--mv-keys "=" \fInum\fP update MV keys. This option takes an integer number as its argument. .sp This option has not been fully documented. .TP .BR \-? , " \--help" Display extended usage information and exit. .TP .BR \-! , " \--more-help" Extended usage information passed thru pager. .TP .BR \-> " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]" Save the option state to \fIrcfile\fP. The default is the \fIlast\fP configuration file listed in the \fBOPTION PRESETS\fP section, below. .TP .BR \-< " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts" Load options from \fIrcfile\fP. The \fIno-load-opts\fP form will disable the loading of earlier RC/INI files. \fI--no-load-opts\fP is handled early, out of order. .TP .BR \- " [{\fIv|c|n\fP}]," " \--version" "[=\fI{v|c|n}\fP]" 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. .SH OPTION PRESETS Any option that is not marked as \fInot presettable\fP may be preset by loading values from configuration ("RC" or ".INI") file(s) and values from environment variables named: .nf \fBNTP_KEYGEN_\fP or \fBNTP_KEYGEN\fP .fi .ad The environmental presets take precedence (are processed later than) the configuration files. The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". If any of these are directories, then the file \fI.ntprc\fP is searched for within those directories. .SH AUTHOR David L. Mills and/or others .br Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org .PP .nf .na see html/copyright.html .fi .ad .PP This manual page was \fIAutoGen\fP-erated from the \fBntp-keygen\fP option definitions. ntp-4.2.6p5/util/pps-api.c0000644000175000017500000000447010017034611014301 0ustar peterpeter/* Try to run this program to see what the PPS-API finds. You give it the device as argument and you may have to modify the pp.mode = BLA assignment. Poul-Henning */ #include #include #include #include #include #include #include #include #define timespecsub(vvp, uvp) \ do { \ (vvp)->tv_sec -= (uvp)->tv_sec; \ (vvp)->tv_nsec -= (uvp)->tv_nsec; \ if ((vvp)->tv_nsec < 0) { \ (vvp)->tv_sec--; \ (vvp)->tv_nsec += 1000000000; \ } \ } while (0) void Chew(struct timespec *tsa, struct timespec *tsc, unsigned sa, unsigned sc) { static int idx; struct timespec ts; printf("%d.%09d ", tsa->tv_sec, tsa->tv_nsec); printf("%d.%09d ", tsc->tv_sec, tsc->tv_nsec); printf("%u %u ", sa, sc); ts = *tsc; timespecsub(&ts,tsa); printf("%.9f ", ts.tv_sec + ts.tv_nsec / 1e9); printf("\n"); fflush(stdout); } int main(int argc, char **argv) { int fd; pps_info_t pi; pps_params_t pp; pps_handle_t ph; int i, mode; u_int olda, oldc; double d = 0; struct timespec to; if (argc < 2) argv[1] = "/dev/cuaa1"; setbuf(stdout, 0); fd = open(argv[1], O_RDONLY); if (fd < 0) err(1, argv[1]); i = time_pps_create(fd, &ph); if (i < 0) err(1, "time_pps_create"); i = time_pps_getcap(ph, &mode); if (i < 0) err(1, "time_pps_getcap"); pp.mode = PPS_CAPTUREASSERT | PPS_ECHOASSERT; pp.mode = PPS_CAPTUREBOTH; /* pp.mode = PPS_CAPTUREASSERT; */ i = time_pps_setparams(ph, &pp); if (i < 0) err(1, "time_pps_setparams"); while (1) { to.tv_nsec = 0; to.tv_sec = 0; i = time_pps_fetch(ph, PPS_TSFMT_TSPEC, &pi, &to); if (i < 0) err(1, "time_pps_fetch"); if (olda == pi.assert_sequence && oldc == pi.clear_sequence) { usleep(10000); continue; } Chew(&pi.assert_timestamp, &pi.clear_timestamp, pi.assert_sequence, pi.clear_sequence); olda = pi.assert_sequence; oldc = pi.clear_sequence; } return(0); } ntp-4.2.6p5/util/ntp-keygen-opts.texi0000644000175000017500000002562211675460625016550 0ustar peterpeter@node ntp-keygen Invocation @section Invoking ntp-keygen @pindex ntp-keygen @cindex Create a NTP host key @ignore # # EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.texi) # # It has been AutoGen-ed December 24, 2011 at 06:34:45 PM by AutoGen 5.12 # From the definitions ntp-keygen-opts.def # and the template file aginfo.tpl @end ignore This program has no explanation. If there is no new host key, look for an existing one. If one is not found, create it. This section was generated by @strong{AutoGen}, the aginfo template and the option descriptions for the @command{ntp-keygen} program. It documents the @command{ntp-keygen} usage text and option meanings. This software is released under a specialized copyright license. @menu * ntp-keygen usage:: ntp-keygen usage help (-?) * ntp-keygen certificate:: certificate option (-c) * ntp-keygen debug-level:: debug-level option (-d) * ntp-keygen get-pvt-passwd:: get-pvt-passwd option (-q) * ntp-keygen gq-params:: gq-params option (-G) * ntp-keygen host-key:: host-key option (-H) * ntp-keygen id-key:: id-key option (-e) * ntp-keygen iffkey:: iffkey option (-I) * ntp-keygen issuer-name:: issuer-name option (-i) * ntp-keygen md5key:: md5key option (-M) * ntp-keygen modulus:: modulus option (-m) * ntp-keygen mv-keys:: mv-keys option (-v) * ntp-keygen mv-params:: mv-params option (-V) * ntp-keygen pvt-cert:: pvt-cert option (-P) * ntp-keygen pvt-passwd:: pvt-passwd option (-p) * ntp-keygen set-debug-level:: set-debug-level option (-D) * ntp-keygen sign-key:: sign-key option (-S) * ntp-keygen subject-name:: subject-name option (-s) * ntp-keygen trusted-cert:: trusted-cert option (-T) @end menu @node ntp-keygen usage @subsection ntp-keygen usage help (-?) @cindex ntp-keygen usage This is the automatically generated usage text for ntp-keygen: @exampleindent 0 @example ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.6p5 USAGE: ntp-keygen [ - [] | --[@{=| @}] ]... Flg Arg Option-Name Description -c Str certificate certificate scheme -d no debug-level Increase output debug message level - may appear multiple times -D Str set-debug-level Set the output debug message level - may appear multiple times -e no id-key Write IFF or GQ identity keys -G no gq-params Generate GQ parameters and keys -H no host-key generate RSA host key -I no iffkey generate IFF parameters -i Str issuer-name set issuer name -M no md5key generate MD5 keys -m Num modulus modulus - It must be in the range: 256 to 2048 -P no pvt-cert generate PC private certificate -p Str pvt-passwd output private password -q Str get-pvt-passwd input private password -S Str sign-key generate sign key (RSA or DSA) -s Str subject-name set subject name -T no trusted-cert trusted certificate (TC scheme) -V Num mv-params generate MV parameters -v Num mv-keys update MV keys opt version Output version information and exit -? no help Display extended usage information and exit -! no more-help Extended usage information passed thru pager -> opt save-opts Save the option state to a config file -< Str load-opts Load options from a config file - disabled as --no-load-opts - may appear multiple times Options are specified by doubled hyphens and their name or by a single hyphen and the flag character. The following option preset mechanisms are supported: - reading file $HOME/.ntprc - reading file ./.ntprc - examining environment variables named NTP_KEYGEN_* If there is no new host key, look for an existing one. If one is not found, create it. please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org @end example @exampleindent 4 @node ntp-keygen certificate @subsection certificate option (-c) @cindex ntp-keygen-certificate This is the ``certificate scheme'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize scheme is one of RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160, DSA-SHA, or DSA-SHA1. Select the certificate message digest/signature encryption scheme. Note that RSA schemes must be used with a RSA sign key and DSA schemes must be used with a DSA sign key. The default without this option is RSA-MD5. @node ntp-keygen debug-level @subsection debug-level option (-d) @cindex ntp-keygen-debug-level This is the ``increase output debug message level'' option. This option has some usage constraints. It: @itemize @bullet @item may appear an unlimited number of times. @end itemize Increase the debugging message output level. @node ntp-keygen get-pvt-passwd @subsection get-pvt-passwd option (-q) @cindex ntp-keygen-get-pvt-passwd This is the ``input private password'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize Set the password for reading files to the specified password. @node ntp-keygen gq-params @subsection gq-params option (-G) @cindex ntp-keygen-gq-params This is the ``generate gq parameters and keys'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize Generate parameters and keys for the GQ identification scheme, obsoleting any that may exist. @node ntp-keygen host-key @subsection host-key option (-H) @cindex ntp-keygen-host-key This is the ``generate rsa host key'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize Generate new host keys, obsoleting any that may exist. @node ntp-keygen id-key @subsection id-key option (-e) @cindex ntp-keygen-id-key This is the ``write iff or gq identity keys'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize Write the IFF or GQ client keys to the standard output. This is intended for automatic key distribution by mail. @node ntp-keygen iffkey @subsection iffkey option (-I) @cindex ntp-keygen-iffkey This is the ``generate iff parameters'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize Generate parameters for the IFF identification scheme, obsoleting any that may exist. @node ntp-keygen issuer-name @subsection issuer-name option (-i) @cindex ntp-keygen-issuer-name This is the ``set issuer name'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize Set the suject name to name. This is used as the subject field in certificates and in the file name for host and sign keys. @node ntp-keygen md5key @subsection md5key option (-M) @cindex ntp-keygen-md5key This is the ``generate md5 keys'' option. Generate MD5 keys, obsoleting any that may exist. @node ntp-keygen modulus @subsection modulus option (-m) @cindex ntp-keygen-modulus This is the ``modulus'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize The number of bits in the prime modulus. The default is 512. @node ntp-keygen mv-keys @subsection mv-keys option (-v) @cindex ntp-keygen-mv-keys This is the ``update mv keys'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize This option has no @samp{doc} documentation. @node ntp-keygen mv-params @subsection mv-params option (-V) @cindex ntp-keygen-mv-params This is the ``generate mv parameters'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme. @node ntp-keygen pvt-cert @subsection pvt-cert option (-P) @cindex ntp-keygen-pvt-cert This is the ``generate pc private certificate'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize Generate a private certificate. By default, the program generates public certificates. @node ntp-keygen pvt-passwd @subsection pvt-passwd option (-p) @cindex ntp-keygen-pvt-passwd This is the ``output private password'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize Encrypt generated files containing private data with the specified password and the DES-CBC algorithm. @node ntp-keygen set-debug-level @subsection set-debug-level option (-D) @cindex ntp-keygen-set-debug-level This is the ``set the output debug message level'' option. This option has some usage constraints. It: @itemize @bullet @item may appear an unlimited number of times. @end itemize Set the output debugging level. Can be supplied multiple times, but each overrides the previous value(s). @node ntp-keygen sign-key @subsection sign-key option (-S) @cindex ntp-keygen-sign-key This is the ``generate sign key (rsa or dsa)'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize Generate a new sign key of the designated type, obsoleting any that may exist. By default, the program uses the host key as the sign key. @node ntp-keygen subject-name @subsection subject-name option (-s) @cindex ntp-keygen-subject-name This is the ``set subject name'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize Set the issuer name to name. This is used for the issuer field in certificates and in the file name for identity files. @node ntp-keygen trusted-cert @subsection trusted-cert option (-T) @cindex ntp-keygen-trusted-cert This is the ``trusted certificate (tc scheme)'' option. This option has some usage constraints. It: @itemize @bullet @item must be compiled in by defining @code{OPENSSL} during the compilation. @end itemize Generate a trusted certificate. By default, the program generates a non-trusted certificate. ntp-4.2.6p5/util/jitter.h0000644000175000017500000003004411307651604014244 0ustar peterpeter/* * 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 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) (((x_i) >= 0x00010000) ? 0x7fffffff : \ (((x_i) <= -0x00010000) ? 0x80000000 : \ (((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) ntp-4.2.6p5/util/timetrim.c0000644000175000017500000000522610017034611014562 0ustar peterpeter#if defined(sgi) || defined(_UNICOSMP) /* * timetrim.c * * "timetrim" allows setting and adjustment of the system clock frequency * trim parameter on Silicon Graphics machines. The trim value native * units are nanoseconds per second (10**-9), so a trim value of 1 makes * the system clock step ahead 1 nanosecond more per second than a value * of zero. Xntpd currently uses units of 2**-20 secs for its frequency * offset (drift) values; to convert to a timetrim value, multiply by * 1E9 / 2**20 (about 954). * * "timetrim" with no arguments just prints out the current kernel value. * With a numeric argument, the kernel value is set to the supplied value. * The "-i" flag causes the supplied value to be added to the kernel value. * The "-n" option causes all input and output to be in xntpd units rather * than timetrim native units. * * Note that there is a limit of +-3000000 (0.3%) on the timetrim value * which is (silently?) enforced by the kernel. * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #ifdef HAVE_SYS_SYSSGI_H # include #endif #ifdef HAVE_SYS_SYSTUNE_H # include #endif #define abs(X) (((X) < 0) ? -(X) : (X)) #define USAGE "usage: timetrim [-n] [[-i] value]\n" #define SGITONTP(X) ((double)(X) * 1048576.0/1.0e9) #define NTPTOSGI(X) ((long)((X) * 1.0e9/1048576.0)) int main( int argc, char *argv[] ) { char *rem; int incremental = 0, ntpunits = 0; long timetrim; double value; while (--argc && **++argv == '-' && isalpha((int)argv[0][1])) { switch (argv[0][1]) { case 'i': incremental++; break; case 'n': ntpunits++; break; default: fprintf(stderr, USAGE); exit(1); } } #ifdef HAVE_SYS_SYSSGI_H if (syssgi(SGI_GETTIMETRIM, &timetrim) < 0) { perror("syssgi"); exit(2); } #endif #ifdef HAVE_SYS_SYSTUNE_H if (systune(SYSTUNE_GET, "timetrim", &timetrim) < 0) { perror("systune"); exit(2); } #endif if (argc == 0) { if (ntpunits) fprintf(stdout, "%0.5f\n", SGITONTP(timetrim)); else fprintf(stdout, "%ld\n", timetrim); } else if (argc != 1) { fprintf(stderr, USAGE); exit(1); } else { value = strtod(argv[0], &rem); if (*rem != '\0') { fprintf(stderr, USAGE); exit(1); } if (ntpunits) value = NTPTOSGI(value); if (incremental) timetrim += value; else timetrim = value; #ifdef HAVE_SYS_SYSSGI_H if (syssgi(SGI_SETTIMETRIM, timetrim) < 0) { perror("syssgi"); exit(2); } #endif #ifdef HAVE_SYS_SYSTUNE_H if (systune(SYSTUNE_SET, "timer", "timetrim", &timetrim) < 0) { perror("systune"); exit(2); } #endif } return 0; } #endif ntp-4.2.6p5/util/jitter.c0000644000175000017500000000544711307651603014247 0ustar peterpeter/* * This program can be used to calibrate the clock reading jitter of a * particular CPU and operating system. It first tickles every element * of an array, in order to force pages into memory, then repeatedly * reads the system clock and, finally, writes out the time values for * later analysis. From this you can determine the jitter and if the * clock ever runs backwards. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "jitter.h" #define NBUF 800002 #define FRAC 4294967296. /* a bbbbillion */ #define JAN_1970 2208988800UL /* Unix base epoch */ #define CLOCK_GETTIME /* Solaris hires clock */ int debug; char progname[10]; double sys_residual; double average; void sys_gettime(l_fp *); int main( int argc, char *argv[] ) { l_fp tr; int i, j; double dtemp, gtod[NBUF]; /* * Force pages into memory */ for (i = 0; i < NBUF; i ++) gtod[i] = 0; /* * Construct gtod array */ for (i = 0; i < NBUF; i ++) { get_systime(&tr); LFPTOD(&tr, gtod[i]); } /* * Write out gtod array for later processing with Matlab */ average = 0; for (i = 0; i < NBUF - 2; i++) { gtod[i] = gtod[i + 1] - gtod[i]; printf("%13.9f\n", gtod[i]); average += gtod[i]; } /* * Sort the gtod array and display deciles */ for (i = 0; i < NBUF - 2; i++) { for (j = 0; j <= i; j++) { if (gtod[j] > gtod[i]) { dtemp = gtod[j]; gtod[j] = gtod[i]; gtod[i] = dtemp; } } } average = average / (NBUF - 2); fprintf(stderr, "Average %13.9f\n", average); fprintf(stderr, "First rank\n"); for (i = 0; i < 10; i++) fprintf(stderr, "%2d %13.9f\n", i, gtod[i]); fprintf(stderr, "Last rank\n"); for (i = NBUF - 12; i < NBUF - 2; i++) fprintf(stderr, "%2d %13.9f\n", i, gtod[i]); exit(0); } /* * get_systime - return system time in NTP timestamp format. */ void get_systime( l_fp *now /* system time */ ) { double dtemp; #if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_GETCLOCK) struct timespec ts; /* seconds and nanoseconds */ /* * Convert Unix clock from seconds and nanoseconds to seconds. */ # ifdef HAVE_CLOCK_GETTIME clock_gettime(CLOCK_REALTIME, &ts); # else getclock(TIMEOFDAY, &ts); # endif now->l_i = ts.tv_sec + JAN_1970; dtemp = ts.tv_nsec / 1e9; #else /* HAVE_CLOCK_GETTIME || HAVE_GETCLOCK */ struct timeval tv; /* seconds and microseconds */ /* * Convert Unix clock from seconds and microseconds to seconds. */ gettimeofday(&tv, NULL); now->l_i = tv.tv_sec + JAN_1970; dtemp = tv.tv_usec / 1e6; #endif /* HAVE_CLOCK_GETTIME || HAVE_GETCLOCK */ /* * Renormalize to seconds past 1900 and fraction. */ dtemp += sys_residual; if (dtemp >= 1) { dtemp -= 1; now->l_i++; } else if (dtemp < -1) { dtemp += 1; now->l_i--; } dtemp *= FRAC; now->l_uf = (u_int32)dtemp; } ntp-4.2.6p5/util/testrs6000.c0000644000175000017500000000243710017034611014563 0ustar peterpeter/* Checks for the RS/6000 AIX adjtime() bug, in which if a negative * offset is given, the system gets messed up and never completes the * adjustment. If the problem is fixed, this program will print the * time, sit there for 10 seconds, and exit. If the problem isn't fixed, * the program will print an occasional "result=nnnnnn" (the residual * slew from adjtime()). * * Compile this with bsdcc and run it as root! */ #include #include #include #include int timeout(); struct timeval adjustment, result; int main ( int argc, char *argv[] ) { struct itimerval value, oldvalue; int i; time_t curtime; curtime = time(0); printf("Starting: %s", ctime(&curtime)); value.it_interval.tv_sec = value.it_value.tv_sec = 1; value.it_interval.tv_usec = value.it_value.tv_usec = 0; adjustment.tv_sec = 0; adjustment.tv_usec = -2000; signal(SIGALRM, timeout); setitimer(ITIMER_REAL, &value, &oldvalue); for (i=0; i<10; i++) { pause(); } } int timeout( int sig, int code, struct sigcontext *scp ) { signal (SIGALRM, timeout); if (adjtime(&adjustment, &result)) printf("adjtime call failed\n"); if (result.tv_sec != 0 || result.tv_usec != 0) { printf("result.u = %d.%06.6d ", (int) result.tv_sec, (int) result.tv_usec); } } ntp-4.2.6p5/util/audio-pcm.c0000644000175000017500000000706410017034610014607 0ustar peterpeter/* * audio-pcm.c - Scope out the PCM audio stuff */ #ifdef HAVE_CONFIG_H # include #endif #if defined(HAVE_MACHINE_SOUNDCARD_H) || defined(HAVE_SYS_SOUNDCARD_H) #include "audio.h" #include "ntp_stdlib.h" #include "ntp_syslog.h" #ifdef HAVE_UNISTD_H # include #endif #include #include "ntp_string.h" #ifdef HAVE_SYS_IOCTL_H #include #endif /* HAVE_SYS_IOCTL_H */ #include #ifdef HAVE_MACHINE_SOUNDCARD_H # include # define PCM_STYLE_SOUND #else # ifdef HAVE_SYS_SOUNDCARD_H # include # define PCM_STYLE_SOUND # endif #endif /* * Global variables */ static int ctl_fd; /* audio control file descriptor */ const char *m_names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES ; void d_fmt( unsigned int format ) { if (format & AFMT_MU_LAW) printf("MU_LAW "); if (format & AFMT_A_LAW) printf("A_LAW "); if (format & AFMT_IMA_ADPCM) printf("IMA_ADPCM "); if (format & AFMT_U8) printf("U8 "); if (format & AFMT_S16_LE) printf("S16_LE "); if (format & AFMT_S16_BE) printf("S16_BE "); if (format & AFMT_S8) printf("S8 "); if (format & AFMT_U16_LE) printf("U16_LE "); if (format & AFMT_U16_BE) printf("U16_BE "); if (format & AFMT_MPEG) printf("MPEG "); if (format & AFMT_AC3) printf("AC3 "); printf("\n"); } void d_mixer( unsigned int mixer ) { int i; int n = 0; for (i = 0; i < SOUND_MIXER_NRDEVICES; ++i) if ((1 << i) & mixer) { if (n) printf(", "); printf("%s", m_names[i]); n = 1; } printf("\n"); } int main( ) { int unit = 0; /* device unit (0-3) */ # define AI_DEV "/dev/audio%d" # define AC_DEV "/dev/mixer%d" char ai_dev[30]; char ac_dev[30]; struct snd_size s_size; snd_chan_param s_c_p; snd_capabilities s_c; int fd; int rval; char *dname = ai_dev; /* device name */ char *actl = ac_dev; int devmask = 0, recmask = 0, recsrc = 0; (void)sprintf(ai_dev, AI_DEV, unit); (void)sprintf(ac_dev, AC_DEV, unit); /* * Open audio device. Do not complain if not there. */ fd = open(dname, O_RDWR | O_NONBLOCK, 0777); if (fd < 0) return (fd); /* * Open audio control device. */ ctl_fd = open(actl, O_RDWR); if (ctl_fd < 0) { fprintf(stderr, "invalid control device <%s>\n", actl); close(fd); return(ctl_fd); } printf("input: <%s> %d\n", dname, fd); printf("control: <%s> %d\n", actl, ctl_fd); if (ioctl(ctl_fd, SOUND_MIXER_READ_DEVMASK, &devmask) == -1) printf("SOUND_MIXER_READ_DEVMASK: %s\n", strerror(errno)); if (ioctl(ctl_fd, SOUND_MIXER_READ_RECMASK, &recmask) == -1) printf("SOUND_MIXER_READ_RECMASK: %s\n", strerror(errno)); if (ioctl(ctl_fd, SOUND_MIXER_READ_RECSRC, &recsrc) == -1) printf("SOUND_MIXER_READ_RECSRC: %s\n", strerror(errno)); printf("devmask: %#x recmask: %#x recsrc: %#x\n", devmask, recmask, recsrc); printf("Devmask: "); d_mixer(devmask); printf("Recmask: "); d_mixer(recmask); printf("RecSrc: "); d_mixer(recsrc); /* * Set audio device parameters. */ rval = fd; if (ioctl(fd, AIOGSIZE, &s_size) == -1) printf("AIOGSIZE: %s\n", strerror(errno)); else printf("play_size %d, rec_size %d\n", s_size.play_size, s_size.rec_size); if (ioctl(fd, AIOGFMT, &s_c_p) == -1) printf("AIOGFMT: %s\n", strerror(errno)); else { printf("play_rate %lu, rec_rate %lu, play_format %#lx, rec_format %#lx\n", s_c_p.play_rate, s_c_p.rec_rate, s_c_p.play_format, s_c_p.rec_format); printf("Play format: "); d_fmt(s_c_p.play_format); printf("Rec format: "); d_fmt(s_c_p.rec_format); } } #endif /* HAVE_{MACHINE_SOUNDCARD,SYS_SOUNDCARD}_H */ ntp-4.2.6p5/util/Makefile.in0000644000175000017500000010265711675460302014652 0ustar peterpeter# 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@ # we traditionally installed software in bindir, while it should have gone # in sbindir. Now that we offer a choice, look in the "other" installation # subdir to warn folks if there is another version there. 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@ @NTP_BINSUBDIR_IS_BIN_TRUE@bin_PROGRAMS = @MAKE_NTPTIME@ \ @NTP_BINSUBDIR_IS_BIN_TRUE@ @MAKE_TICKADJ@ @MAKE_TIMETRIM@ \ @NTP_BINSUBDIR_IS_BIN_TRUE@ ntp-keygen$(EXEEXT) @NTP_BINSUBDIR_IS_BIN_FALSE@sbin_PROGRAMS = @MAKE_NTPTIME@ \ @NTP_BINSUBDIR_IS_BIN_FALSE@ @MAKE_TICKADJ@ @MAKE_TIMETRIM@ \ @NTP_BINSUBDIR_IS_BIN_FALSE@ ntp-keygen$(EXEEXT) EXTRA_PROGRAMS = audio-pcm$(EXEEXT) byteorder$(EXEEXT) hist$(EXEEXT) \ jitter$(EXEEXT) kern$(EXEEXT) longsize$(EXEEXT) \ ntptime$(EXEEXT) pps-api$(EXEEXT) precision$(EXEEXT) \ sht$(EXEEXT) testrs6000$(EXEEXT) tg$(EXEEXT) tickadj$(EXEEXT) \ timetrim$(EXEEXT) DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf ansi2knr.1 \ ansi2knr.c subdir = util ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/define_dir.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_cacheversion.m4 \ $(top_srcdir)/m4/ntp_dir_sep.m4 \ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \ $(top_srcdir)/m4/ntp_openssl.m4 \ $(top_srcdir)/m4/ntp_vpathhack.m4 \ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) audio_pcm_SOURCES = audio-pcm.c audio_pcm_OBJECTS = audio-pcm.$(OBJEXT) audio_pcm_LDADD = $(LDADD) audio_pcm_DEPENDENCIES = ../libntp/libntp.a byteorder_SOURCES = byteorder.c byteorder_OBJECTS = byteorder.$(OBJEXT) byteorder_LDADD = $(LDADD) byteorder_DEPENDENCIES = ../libntp/libntp.a hist_SOURCES = hist.c hist_OBJECTS = hist.$(OBJEXT) hist_LDADD = $(LDADD) hist_DEPENDENCIES = ../libntp/libntp.a am_jitter_OBJECTS = jitter.$(OBJEXT) jitter_OBJECTS = $(am_jitter_OBJECTS) jitter_DEPENDENCIES = kern_SOURCES = kern.c kern_OBJECTS = kern.$(OBJEXT) kern_LDADD = $(LDADD) kern_DEPENDENCIES = ../libntp/libntp.a longsize_SOURCES = longsize.c longsize_OBJECTS = longsize.$(OBJEXT) longsize_LDADD = $(LDADD) longsize_DEPENDENCIES = ../libntp/libntp.a am_ntp_keygen_OBJECTS = ntp-keygen.$(OBJEXT) ntp-keygen-opts.$(OBJEXT) ntp_keygen_OBJECTS = $(am_ntp_keygen_OBJECTS) am__DEPENDENCIES_1 = ntp_keygen_DEPENDENCIES = version.o $(am__DEPENDENCIES_1) \ ../libntp/libntp.a ntptime_SOURCES = ntptime.c ntptime_OBJECTS = ntptime.$(OBJEXT) ntptime_LDADD = $(LDADD) ntptime_DEPENDENCIES = ../libntp/libntp.a pps_api_SOURCES = pps-api.c pps_api_OBJECTS = pps-api.$(OBJEXT) pps_api_LDADD = $(LDADD) pps_api_DEPENDENCIES = ../libntp/libntp.a precision_SOURCES = precision.c precision_OBJECTS = precision.$(OBJEXT) precision_LDADD = $(LDADD) precision_DEPENDENCIES = ../libntp/libntp.a sht_SOURCES = sht.c sht_OBJECTS = sht.$(OBJEXT) sht_LDADD = $(LDADD) sht_DEPENDENCIES = ../libntp/libntp.a testrs6000_SOURCES = testrs6000.c testrs6000_OBJECTS = testrs6000.$(OBJEXT) testrs6000_LDADD = $(LDADD) testrs6000_DEPENDENCIES = ../libntp/libntp.a tg_SOURCES = tg.c tg_OBJECTS = tg.$(OBJEXT) tg_LDADD = $(LDADD) tg_DEPENDENCIES = ../libntp/libntp.a tickadj_SOURCES = tickadj.c tickadj_OBJECTS = tickadj.$(OBJEXT) tickadj_LDADD = $(LDADD) tickadj_DEPENDENCIES = ../libntp/libntp.a timetrim_SOURCES = timetrim.c timetrim_OBJECTS = timetrim.$(OBJEXT) timetrim_LDADD = $(LDADD) timetrim_DEPENDENCIES = ../libntp/libntp.a DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = audio-pcm.c byteorder.c hist.c $(jitter_SOURCES) kern.c \ longsize.c $(ntp_keygen_SOURCES) ntptime.c pps-api.c \ precision.c sht.c testrs6000.c tg.c tickadj.c timetrim.c DIST_SOURCES = audio-pcm.c byteorder.c hist.c $(jitter_SOURCES) kern.c \ longsize.c $(ntp_keygen_SOURCES) ntptime.c pps-api.c \ precision.c sht.c testrs6000.c tg.c tickadj.c timetrim.c 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' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DATA = $(noinst_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ 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@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SH = @PATH_SH@ PATH_TEST = @PATH_TEST@ POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CFLAGS = @SNMP_CFLAGS@ SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ SNMP_LIBS = @SNMP_LIBS@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ VERSION = @VERSION@ 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_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 = #AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies AUTOMAKE_OPTIONS = AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include $(LIBOPTS_CFLAGS) # LDADD might need RESLIB and ADJLIB LDADD = ../libntp/libntp.a ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h ntp_keygen_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a @LCRYPTO@ ETAGS_ARGS = Makefile.am #EXTRA_DIST= README TAGS EXTRA_DIST = ntp-keygen-opts.def ntp-keygen.1 ntp-keygen-opts.texi ntp-keygen-opts.menu BUILT_SOURCES = ntp-keygen-opts.c ntp-keygen-opts.h .deps-ver CLEANFILES = .deps-ver DISTCLEANFILES = .version version.c noinst_DATA = $(srcdir)/ntp-keygen-opts.texi $(srcdir)/ntp-keygen-opts.menu man_MANS = $(srcdir)/ntp-keygen.1 run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \ autogen -L ../include --writable std_def_list = $(top_srcdir)/include/debug-opt.def \ $(top_srcdir)/include/autogen-version.def \ $(top_srcdir)/include/copyright.def \ $(top_srcdir)/include/homerc.def \ $(top_srcdir)/include/version.def jitter_SOURCES = jitter.c jitter.h jitter_LDADD = all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf $(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 util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign util/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-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list audio-pcm$(EXEEXT): $(audio_pcm_OBJECTS) $(audio_pcm_DEPENDENCIES) @rm -f audio-pcm$(EXEEXT) $(LINK) $(audio_pcm_OBJECTS) $(audio_pcm_LDADD) $(LIBS) byteorder$(EXEEXT): $(byteorder_OBJECTS) $(byteorder_DEPENDENCIES) @rm -f byteorder$(EXEEXT) $(LINK) $(byteorder_OBJECTS) $(byteorder_LDADD) $(LIBS) hist$(EXEEXT): $(hist_OBJECTS) $(hist_DEPENDENCIES) @rm -f hist$(EXEEXT) $(LINK) $(hist_OBJECTS) $(hist_LDADD) $(LIBS) jitter$(EXEEXT): $(jitter_OBJECTS) $(jitter_DEPENDENCIES) @rm -f jitter$(EXEEXT) $(LINK) $(jitter_OBJECTS) $(jitter_LDADD) $(LIBS) kern$(EXEEXT): $(kern_OBJECTS) $(kern_DEPENDENCIES) @rm -f kern$(EXEEXT) $(LINK) $(kern_OBJECTS) $(kern_LDADD) $(LIBS) longsize$(EXEEXT): $(longsize_OBJECTS) $(longsize_DEPENDENCIES) @rm -f longsize$(EXEEXT) $(LINK) $(longsize_OBJECTS) $(longsize_LDADD) $(LIBS) ntp-keygen$(EXEEXT): $(ntp_keygen_OBJECTS) $(ntp_keygen_DEPENDENCIES) @rm -f ntp-keygen$(EXEEXT) $(LINK) $(ntp_keygen_OBJECTS) $(ntp_keygen_LDADD) $(LIBS) ntptime$(EXEEXT): $(ntptime_OBJECTS) $(ntptime_DEPENDENCIES) @rm -f ntptime$(EXEEXT) $(LINK) $(ntptime_OBJECTS) $(ntptime_LDADD) $(LIBS) pps-api$(EXEEXT): $(pps_api_OBJECTS) $(pps_api_DEPENDENCIES) @rm -f pps-api$(EXEEXT) $(LINK) $(pps_api_OBJECTS) $(pps_api_LDADD) $(LIBS) precision$(EXEEXT): $(precision_OBJECTS) $(precision_DEPENDENCIES) @rm -f precision$(EXEEXT) $(LINK) $(precision_OBJECTS) $(precision_LDADD) $(LIBS) sht$(EXEEXT): $(sht_OBJECTS) $(sht_DEPENDENCIES) @rm -f sht$(EXEEXT) $(LINK) $(sht_OBJECTS) $(sht_LDADD) $(LIBS) testrs6000$(EXEEXT): $(testrs6000_OBJECTS) $(testrs6000_DEPENDENCIES) @rm -f testrs6000$(EXEEXT) $(LINK) $(testrs6000_OBJECTS) $(testrs6000_LDADD) $(LIBS) tg$(EXEEXT): $(tg_OBJECTS) $(tg_DEPENDENCIES) @rm -f tg$(EXEEXT) $(LINK) $(tg_OBJECTS) $(tg_LDADD) $(LIBS) tickadj$(EXEEXT): $(tickadj_OBJECTS) $(tickadj_DEPENDENCIES) @rm -f tickadj$(EXEEXT) $(LINK) $(tickadj_OBJECTS) $(tickadj_LDADD) $(LIBS) timetrim$(EXEEXT): $(timetrim_OBJECTS) $(timetrim_DEPENDENCIES) @rm -f timetrim$(EXEEXT) $(LINK) $(timetrim_OBJECTS) $(timetrim_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio-pcm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/byteorder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jitter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kern.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/longsize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp-keygen-opts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp-keygen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntptime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pps-api.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/precision.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sht.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testrs6000.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickadj.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timetrim.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; 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=''; 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; } ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man \ uninstall-sbinPROGRAMS uninstall-man: uninstall-man1 .MAKE: all check install install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 uninstall-sbinPROGRAMS $(srcdir)/ntp-keygen-opts.h: $(srcdir)/ntp-keygen-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntp-keygen-opts.c: $(srcdir)/ntp-keygen-opts.def $(std_def_list) $(run_ag) ntp-keygen-opts.def $(srcdir)/ntp-keygen.1: $(srcdir)/ntp-keygen-opts.def $(std_def_list) $(run_ag) -Tagman1.tpl -bntp-keygen ntp-keygen-opts.def $(srcdir)/ntp-keygen-opts.menu: $(srcdir)/ntp-keygen-opts.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/ntp-keygen-opts.texi: $(srcdir)/ntp-keygen-opts.def $(std_def_list) $(run_ag) -Taginfo.tpl -DLEVEL=section ntp-keygen-opts.def $(top_srcdir)/scripts/check--help $@ ../libntp/libntp.a: cd ../libntp && $(MAKE) kern.o: kern.c $(COMPILE) -DHAVE_TIMEX_H -c kern.c $(top_srcdir)/version : cd $(top_srcdir) && $(MAKE) version version.o: $(ntpq_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntp-keygen $(COMPILE) -c version.c install-exec-hook: @case ${BINSUBDIR} in \ bin) ODIR=${sbindir} ;; \ sbin) ODIR=${bindir} ;; \ esac; \ test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \ test ! -f $$ODIR/$$i || echo "*** $$i is also in $$ODIR!"; \ done # $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ chmod ug+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ $(MAKE) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ mkdir $(DEPDIR) && \ case "$(top_builddir)" in \ .) \ ./config.status Makefile depfiles \ ;; \ ..) \ cd .. && \ ./config.status $(subdir)/Makefile depfiles && \ cd $(subdir) \ ;; \ *) \ echo 'Fatal: depsver.mf Automake fragment limited' \ 'to immediate subdirectories.' && \ echo "top_builddir: $(top_builddir)" && \ echo "subdir: $(subdir)" && \ exit 1 \ ;; \ esac && \ echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver @touch $@ # # depsver.mf included in Makefile.am for directories with .deps # # When building in the same directory with sources that change over # time, such as when tracking using bk, the .deps files can become # stale with respect to moved, deleted, or superceded headers. Most # commonly, this would exhibit as make reporting a failure to make a # header file which is no longer in the location given. To address # this issue, we use a deps-ver file which is updated with each change # that breaks old .deps files. A copy of deps-ver is made into # $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present # with different contents than deps-ver, we make clean to ensure all # .o files built before the incompatible change are rebuilt along with # their updated .deps files, then remove $(DEPDIR) and recreate it as # empty stubs. # # It is normal when configured with --disable-dependency-tracking for # the DEPDIR to not have been created. For this reason, we use the # intermediate target .deps-ver, which invokes make recursively if # DEPDIR exists. # # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # # This comment block follows rather than leads the related code so that # it stays with it in the generated Makefile.in and Makefile. # # 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: ntp-4.2.6p5/util/ntp-keygen-opts.menu0000644000175000017500000000006711675460625016537 0ustar peterpeter* ntp-keygen Invocation:: Invoking ntp-keygen ntp-4.2.6p5/util/sht.c0000644000175000017500000001056610017034611013531 0ustar peterpeter/* * sht.c - Testprogram for shared memory refclock * read/write shared memory segment; see usage */ #ifndef SYS_WINNT #include #include #include #include #include #include #include #else #include #include #include #include #include #define sleep(x) Sleep(x*1000) #endif #include struct shmTime { int mode; /* 0 - if valid set * use values, * clear valid * 1 - if valid set * if count before and after read of values is equal, * use values * clear valid */ int count; time_t clockTimeStampSec; int clockTimeStampUSec; time_t receiveTimeStampSec; int receiveTimeStampUSec; int leap; int precision; int nsamples; int valid; }; struct shmTime * getShmTime ( int unit ) { #ifndef SYS_WINNT int shmid=shmget (0x4e545030+unit, sizeof (struct shmTime), IPC_CREAT|0777); if (shmid==-1) { perror ("shmget"); exit (1); } else { struct shmTime *p=(struct shmTime *)shmat (shmid, 0, 0); if ((int)(long)p==-1) { perror ("shmat"); p=0; } assert (p!=0); return p; } #else char buf[10]; LPSECURITY_ATTRIBUTES psec=0; sprintf (buf,"NTP%d",unit); SECURITY_DESCRIPTOR sd; SECURITY_ATTRIBUTES sa; HANDLE shmid; assert (InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION)); assert (SetSecurityDescriptorDacl(&sd,1,0,0)); sa.nLength=sizeof (SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor=&sd; sa.bInheritHandle=0; shmid=CreateFileMapping ((HANDLE)0xffffffff, 0, PAGE_READWRITE, psec, sizeof (struct shmTime),buf); if (!shmid) { shmid=CreateFileMapping ((HANDLE)0xffffffff, 0, PAGE_READWRITE, 0, sizeof (struct shmTime),buf); cout <<"CreateFileMapping with psec!=0 failed"<nsamples=atoi(&argv[1][1]); } break; case 'l': { p->leap=atoi(&argv[1][1]); } break; case 'p': { p->precision=-atoi(&argv[1][1]); } break; case 'r': { char *ap=&argv[1][1]; int clear=0; int loop=0; printf ("reader\n"); while (*ap) { switch (*ap) { case 'l' : loop=1; break; case 'c' : clear=1; break; } ap++; } do { printf ("mode=%d, count=%d, clock=%d.%d, rec=%d.%d,\n", p->mode,p->count,p->clockTimeStampSec,p->clockTimeStampUSec, p->receiveTimeStampSec,p->receiveTimeStampUSec); printf (" leap=%d, precision=%d, nsamples=%d, valid=%d\n", p->leap, p->precision, p->nsamples, p->valid); if (!p->valid) printf ("***\n"); if (clear) { p->valid=0; printf ("cleared\n"); } if (loop) sleep (1); } while (loop); } break; case 'w': { printf ("writer\n"); p->mode=0; if (!p->valid) { p->clockTimeStampSec=time(0)-20; p->clockTimeStampUSec=0; p->receiveTimeStampSec=time(0)-1; p->receiveTimeStampUSec=0; printf ("%d %d\n",p->clockTimeStampSec, p->receiveTimeStampSec); p->valid=1; } else { printf ("p->valid still set\n"); /* not an error! */ } } break; } } ntp-4.2.6p5/util/Makefile.am0000644000175000017500000000500111510477207014622 0ustar peterpeterNULL= #AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies AUTOMAKE_OPTIONS= if NTP_BINSUBDIR_IS_BIN bin_PROGRAMS= @MAKE_NTPTIME@ @MAKE_TICKADJ@ @MAKE_TIMETRIM@ \ ntp-keygen else sbin_PROGRAMS= @MAKE_NTPTIME@ @MAKE_TICKADJ@ @MAKE_TIMETRIM@ \ ntp-keygen endif EXTRA_PROGRAMS= audio-pcm byteorder hist jitter kern longsize \ ntptime pps-api precision sht testrs6000 tg tickadj timetrim AM_CPPFLAGS= -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include $(LIBOPTS_CFLAGS) # LDADD might need RESLIB and ADJLIB LDADD= ../libntp/libntp.a ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h ntp_keygen_LDADD= version.o $(LIBOPTS_LDADD) ../libntp/libntp.a @LCRYPTO@ ETAGS_ARGS= Makefile.am #EXTRA_DIST= README TAGS EXTRA_DIST= ntp-keygen-opts.def ntp-keygen.1 ntp-keygen-opts.texi ntp-keygen-opts.menu BUILT_SOURCES= ntp-keygen-opts.c ntp-keygen-opts.h CLEANFILES= DISTCLEANFILES= .version version.c noinst_DATA= $(srcdir)/ntp-keygen-opts.texi $(srcdir)/ntp-keygen-opts.menu man_MANS= $(srcdir)/ntp-keygen.1 run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \ autogen -L ../include --writable std_def_list= $(top_srcdir)/include/debug-opt.def \ $(top_srcdir)/include/autogen-version.def \ $(top_srcdir)/include/copyright.def \ $(top_srcdir)/include/homerc.def \ $(top_srcdir)/include/version.def $(srcdir)/ntp-keygen-opts.h: $(srcdir)/ntp-keygen-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntp-keygen-opts.c: $(srcdir)/ntp-keygen-opts.def $(std_def_list) $(run_ag) ntp-keygen-opts.def $(srcdir)/ntp-keygen.1: $(srcdir)/ntp-keygen-opts.def $(std_def_list) $(run_ag) -Tagman1.tpl -bntp-keygen ntp-keygen-opts.def $(srcdir)/ntp-keygen-opts.menu: $(srcdir)/ntp-keygen-opts.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/ntp-keygen-opts.texi: $(srcdir)/ntp-keygen-opts.def $(std_def_list) $(run_ag) -Taginfo.tpl -DLEVEL=section ntp-keygen-opts.def $(top_srcdir)/scripts/check--help $@ jitter_SOURCES= jitter.c jitter.h jitter_LDADD= ../libntp/libntp.a: cd ../libntp && $(MAKE) kern.o: kern.c $(COMPILE) -DHAVE_TIMEX_H -c kern.c $(top_srcdir)/version : cd $(top_srcdir) && $(MAKE) version version.o: $(ntpq_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntp-keygen $(COMPILE) -c version.c include $(top_srcdir)/bincheck.mf include $(top_srcdir)/depsver.mf ntp-4.2.6p5/util/ntp-keygen-opts.def0000644000175000017500000001201311307651603016311 0ustar peterpeter/* -*- Mode: Text -*- */ autogen definitions options; #include copyright.def #include homerc.def #include autogen-version.def prog-name = "ntp-keygen"; prog-title = "Create a NTP host key"; package = ntp; test-main; include = '#include '; #include version.def flag = { value = c; name = certificate; arg-type = string; arg-name = scheme; ifdef = OPENSSL; descrip = "certificate scheme"; doc = <<- _EndOfDoc_ scheme is one of RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160, DSA-SHA, or DSA-SHA1. Select the certificate message digest/signature encryption scheme. Note that RSA schemes must be used with a RSA sign key and DSA schemes must be used with a DSA sign key. The default without this option is RSA-MD5. _EndOfDoc_; }; #include debug-opt.def flag = { value = e; name = id-key; ifdef = OPENSSL; descrip = "Write IFF or GQ identity keys"; doc = <<- _EndOfDoc_ Write the IFF or GQ client keys to the standard output. This is intended for automatic key distribution by mail. _EndOfDoc_; }; flag = { value = G; name = gq-params; ifdef = OPENSSL; descrip = "Generate GQ parameters and keys"; doc = <<- _EndOfDoc_ Generate parameters and keys for the GQ identification scheme, obsoleting any that may exist. _EndOfDoc_; }; flag = { value = H; name = host-key; ifdef = OPENSSL; descrip = "generate RSA host key"; doc = <<- _EndOfDoc_ Generate new host keys, obsoleting any that may exist. _EndOfDoc_; }; flag = { value = I; name = iffkey; ifdef = OPENSSL; descrip = "generate IFF parameters"; doc = <<- _EndOfDoc_ Generate parameters for the IFF identification scheme, obsoleting any that may exist. _EndOfDoc_; }; flag = { value = i; name = issuer-name; ifdef = OPENSSL; arg-type = string; arg-name = issuer-name; descrip = "set issuer name"; doc = <<- _EndOfDoc_ Set the suject name to name. This is used as the subject field in certificates and in the file name for host and sign keys. _EndOfDoc_; }; flag = { value = M; name = md5key; descrip = "generate MD5 keys"; doc = <<- _EndOfDoc_ Generate MD5 keys, obsoleting any that may exist. _EndOfDoc_; }; flag = { value = m; name = modulus; arg-type = number; arg-name = modulus; arg-range = '256->2048'; ifdef = OPENSSL; descrip = "modulus"; doc = <<- _EndOfDoc_ The number of bits in the prime modulus. The default is 512. _EndOfDoc_; }; flag = { value = P; name = pvt-cert; ifdef = OPENSSL; descrip = "generate PC private certificate"; doc = <<- _EndOfDoc_ Generate a private certificate. By default, the program generates public certificates. _EndOfDoc_; }; flag = { value = p; name = pvt-passwd; ifdef = OPENSSL; arg-type = string; arg-name = passwd; descrip = "output private password"; doc = <<- _EndOfDoc_ Encrypt generated files containing private data with the specified password and the DES-CBC algorithm. _EndOfDoc_; }; flag = { value = q; name = get-pvt-passwd; ifdef = OPENSSL; arg-type = string; arg-name = passwd; descrip = "input private password"; doc = <<- _EndOfDoc_ Set the password for reading files to the specified password. _EndOfDoc_; }; flag = { value = S; name = sign-key; arg-type = string; arg-name = sign; ifdef = OPENSSL; descrip = "generate sign key (RSA or DSA)"; doc = <<- _EndOfDoc_ Generate a new sign key of the designated type, obsoleting any that may exist. By default, the program uses the host key as the sign key. _EndOfDoc_; }; flag = { value = s; name = subject-name; arg-type = string; arg-name = host; ifdef = OPENSSL; descrip = "set subject name"; doc = <<- _EndOfDoc_ Set the issuer name to name. This is used for the issuer field in certificates and in the file name for identity files. _EndOfDoc_; }; flag = { value = T; name = trusted-cert; ifdef = OPENSSL; descrip = "trusted certificate (TC scheme)"; doc = <<- _EndOfDoc_ Generate a trusted certificate. By default, the program generates a non-trusted certificate. _EndOfDoc_; }; flag = { value = V; name = mv-params; arg-type = number; arg-name = num; ifdef = OPENSSL; descrip = "generate MV parameters"; doc = <<- _EndOfDoc_ Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme. _EndOfDoc_; }; flag = { value = v; name = mv-keys; arg-type = number; arg-name = num; ifdef = OPENSSL; descrip = "update MV keys"; }; detail = <<- _EODetail_ If there is no new host key, look for an existing one. If one is not found, create it. _EODetail_; ntp-4.2.6p5/util/byteorder.c0000644000175000017500000000150710017034610014724 0ustar peterpeter/* * This works on: * Crays * Conven * sparc's * Dec mip machines * Dec alpha machines * RS6000 * SGI's */ #include int main( int argc, char *argv[] ) { int i; int big; union { unsigned long l; char c[sizeof(long)]; } u; #if defined(LONG8) u.l = (((long)0x08070605) << 32) | (long)0x04030201; #else u.l = 0x04030201; #endif if (sizeof(long) > 4) { if (u.c[0] == 0x08) big = 1; else big = 0; } else { if (u.c[0] == 0x04) big = 1; else big = 0; } for (i=0; i< sizeof(long); i++) { if (big == 1 && (u.c[i] == (sizeof(long) - i))) { continue; } else if (big == 0 && (u.c[i] == (i+1))) { continue; } else { big = -1; break; } } if (big == 1) { printf("XNTP_BIG_ENDIAN\n"); } else if (big == 0) { printf("XNTP_LITTLE_ENDIAN\n"); } exit(0); } ntp-4.2.6p5/util/README0000644000175000017500000000360310017034610013440 0ustar peterpeterREADME file for directory ./util of the NTP Version 4 distribution This directory contains the sources for the various utility programs. See the README and RELNOTES files in the parent directory for directions on how to make and install these programs. The ntptime.c program checks the kernel configuration for the NTP user interface syscalls ntp_gettime() and ntp_adjtime(). If present, the current timekeeping data are displayed. If not, a dissapointment is displayed. See the kernel page file in the HTML documentation in distribution for further details. ntptime will be built be if configure believes your system can use it. The jitter.c program can be used to determine the timing jitter due to the operating system in a gettimeofday() call. For most systems the dominant contribution to the jitter budget is the period of the hardware interrupt, usually in the range 10 us-1 ms. For those systems with microsecond counters, such as recent Sun and certain HP and DEC systems, the jitter is dominated only by the operating system. The timetrim.c program can be used with SGI machines to implement a scheme to discipline the hardware clock frequency. See the source code for further information. The byteorder.c and longsize.c programs are used during the configuration process to determine the byte order (little or big endian) and longword size (32 or 64 bits). See the configure scripts for further details. The testrs6000.c program is used for testing purposes with the IBM RS/6000 AIX machines. Bill Jones reports: "I could not get a tickadj of less than 40 us to work on a RS6000. If you set it less than 40 us do so at your own risk!" The tickadj.c program can be used to read and set various kernel parameters affecting NTP operations. See the tickadj page in the HTML documentation for further details. tickadj will be built if configure believes your system can use it. ntp-4.2.6p5/util/longsize.c0000644000175000017500000000022610017034611014555 0ustar peterpeter#include main() { if (sizeof(long) == 8) { printf("-DLONG8\n"); } else if (sizeof(long) == 4) { printf("-DLONG4\n"); } exit(0); } ntp-4.2.6p5/util/tg.c0000644000175000017500000004053710441361316013354 0ustar peterpeter/* * tg.c generate WWV or IRIG signals for test */ /* * This program can generate audio signals that simulate the WWV/H * broadcast timecode. Alternatively, it can generate the IRIG-B * timecode commonly used to synchronize laboratory equipment. It is * intended to test the WWV/H driver (refclock_wwv.c) and the IRIG * driver (refclock_irig.c) in the NTP driver collection. * * Besides testing the drivers themselves, this program can be used to * synchronize remote machines over audio transmission lines or program * feeds. The program reads the time on the local machine and sets the * initial epoch of the signal generator within one millisecond. * Alernatively, the initial epoch can be set to an arbitrary time. This * is useful when searching for bugs and testing for correct response to * a leap second in UTC. Note however, the ultimate accuracy is limited * by the intrinsic frequency error of the codec sample clock, which can # reach well over 100 PPM. * * The default is to route generated signals to the line output * jack; the s option on the command line routes these signals to the * internal speaker as well. The v option controls the speaker volume * over the range 0-255. The signal generator by default uses WWV * format; the h option switches to WWVH format and the i option * switches to IRIG-B format. * * Once started the program runs continuously. The default initial epoch * for the signal generator is read from the computer system clock when * the program starts. The y option specifies an alternate epoch using a * string yydddhhmmss, where yy is the year of century, ddd the day of * year, hh the hour of day and mm the minute of hour. For instance, * 1946Z on 1 January 2006 is 060011946. The l option lights the leap * warning bit in the WWV/H timecode, so is handy to check for correct * behavior at the next leap second epoch. The remaining options are * specified below under the Parse Options heading. Most of these are * for testing. * * During operation the program displays the WWV/H timecode (9 digits) * or IRIG timecode (20 digits) as each new string is constructed. The * display is followed by the BCD binary bits as transmitted. Note that * the transmissionorder is low-order first as the frame is processed * left to right. For WWV/H The leap warning L preceeds the first bit. * For IRIG the on-time marker M preceeds the first (units) bit, so its * code is delayed one bit and the next digit (tens) needs only three * bits. * * The program has been tested with the Sun Blade 1500 running Solaris * 10, but not yet with other machines. It uses no special features and * should be readily portable to other hardware and operating systems. */ #include #include #include #include #include #include #include #include #include #include #include #define SECOND 8000 /* one second of 125-us samples */ #define BUFLNG 400 /* buffer size */ #define DEVICE "/dev/audio" /* default audio device */ #define WWV 0 /* WWV encoder */ #define IRIG 1 /* IRIG-B encoder */ #define OFF 0 /* zero amplitude */ #define LOW 1 /* low amplitude */ #define HIGH 2 /* high amplitude */ #define DATA0 200 /* WWV/H 0 pulse */ #define DATA1 500 /* WWV/H 1 pulse */ #define PI 800 /* WWV/H PI pulse */ #define M2 2 /* IRIG 0 pulse */ #define M5 5 /* IRIG 1 pulse */ #define M8 8 /* IRIG PI pulse */ /* * Companded sine table amplitude 3000 units */ int c3000[] = {1, 48, 63, 70, 78, 82, 85, 89, 92, 94, /* 0-9 */ 96, 98, 99, 100, 101, 101, 102, 103, 103, 103, /* 10-19 */ 103, 103, 103, 103, 102, 101, 101, 100, 99, 98, /* 20-29 */ 96, 94, 92, 89, 85, 82, 78, 70, 63, 48, /* 30-39 */ 129, 176, 191, 198, 206, 210, 213, 217, 220, 222, /* 40-49 */ 224, 226, 227, 228, 229, 229, 230, 231, 231, 231, /* 50-59 */ 231, 231, 231, 231, 230, 229, 229, 228, 227, 226, /* 60-69 */ 224, 222, 220, 217, 213, 210, 206, 198, 191, 176}; /* 70-79 */ /* * Companded sine table amplitude 6000 units */ int c6000[] = {1, 63, 78, 86, 93, 98, 101, 104, 107, 110, /* 0-9 */ 112, 113, 115, 116, 117, 117, 118, 118, 119, 119, /* 10-19 */ 119, 119, 119, 118, 118, 117, 117, 116, 115, 113, /* 20-29 */ 112, 110, 107, 104, 101, 98, 93, 86, 78, 63, /* 30-39 */ 129, 191, 206, 214, 221, 226, 229, 232, 235, 238, /* 40-49 */ 240, 241, 243, 244, 245, 245, 246, 246, 247, 247, /* 50-59 */ 247, 247, 247, 246, 246, 245, 245, 244, 243, 241, /* 60-69 */ 240, 238, 235, 232, 229, 226, 221, 214, 206, 191}; /* 70-79 */ /* * Decoder operations at the end of each second are driven by a state * machine. The transition matrix consists of a dispatch table indexed * by second number. Each entry in the table contains a case switch * number and argument. */ struct progx { int sw; /* case switch number */ int arg; /* argument */ }; /* * Case switch numbers */ #define DATA 0 /* send data (0, 1, PI) */ #define COEF 1 /* send BCD bit */ #define DEC 2 /* decrement to next digit */ #define MIN 3 /* minute pulse */ #define LEAP 4 /* leap warning */ #define DUT1 5 /* DUT1 bits */ #define DST1 6 /* DST1 bit */ #define DST2 7 /* DST2 bit */ /* * WWV/H format (100-Hz, 9 digits, 1 m frame) */ struct progx progx[] = { {MIN, 800}, /* 0 minute sync pulse */ {DATA, DATA0}, /* 1 */ {DST2, 0}, /* 2 DST2 */ {LEAP, 0}, /* 3 leap warning */ {COEF, 1}, /* 4 1 year units */ {COEF, 2}, /* 5 2 */ {COEF, 4}, /* 6 4 */ {COEF, 8}, /* 7 8 */ {DEC, DATA0}, /* 8 */ {DATA, PI}, /* 9 p1 */ {COEF, 1}, /* 10 1 minute units */ {COEF, 2}, /* 11 2 */ {COEF, 4}, /* 12 4 */ {COEF, 8}, /* 13 8 */ {DEC, DATA0}, /* 14 */ {COEF, 1}, /* 15 10 minute tens */ {COEF, 2}, /* 16 20 */ {COEF, 4}, /* 17 40 */ {COEF, 8}, /* 18 80 (not used) */ {DEC, PI}, /* 19 p2 */ {COEF, 1}, /* 20 1 hour units */ {COEF, 2}, /* 21 2 */ {COEF, 4}, /* 22 4 */ {COEF, 8}, /* 23 8 */ {DEC, DATA0}, /* 24 */ {COEF, 1}, /* 25 10 hour tens */ {COEF, 2}, /* 26 20 */ {COEF, 4}, /* 27 40 (not used) */ {COEF, 8}, /* 28 80 (not used) */ {DEC, PI}, /* 29 p3 */ {COEF, 1}, /* 30 1 day units */ {COEF, 2}, /* 31 2 */ {COEF, 4}, /* 32 4 */ {COEF, 8}, /* 33 8 */ {DEC, DATA0}, /* 34 not used */ {COEF, 1}, /* 35 10 day tens */ {COEF, 2}, /* 36 20 */ {COEF, 4}, /* 37 40 */ {COEF, 8}, /* 38 80 */ {DEC, PI}, /* 39 p4 */ {COEF, 1}, /* 40 100 day hundreds */ {COEF, 2}, /* 41 200 */ {COEF, 4}, /* 42 400 (not used) */ {COEF, 8}, /* 43 800 (not used) */ {DEC, DATA0}, /* 44 */ {DATA, DATA0}, /* 45 */ {DATA, DATA0}, /* 46 */ {DATA, DATA0}, /* 47 */ {DATA, DATA0}, /* 48 */ {DATA, PI}, /* 49 p5 */ {DUT1, 8}, /* 50 DUT1 sign */ {COEF, 1}, /* 51 10 year tens */ {COEF, 2}, /* 52 20 */ {COEF, 4}, /* 53 40 */ {COEF, 8}, /* 54 80 */ {DST1, 0}, /* 55 DST1 */ {DUT1, 1}, /* 56 0.1 DUT1 fraction */ {DUT1, 2}, /* 57 0.2 */ {DUT1, 4}, /* 58 0.4 */ {DATA, PI}, /* 59 p6 */ {DATA, DATA0}, /* 60 leap */ }; /* * IRIG format except first frame (1000 Hz, 20 digits, 1 s frame) */ struct progx progy[] = { {COEF, 1}, /* 0 1 units */ {COEF, 2}, /* 1 2 */ {COEF, 4}, /* 2 4 */ {COEF, 8}, /* 3 8 */ {DEC, M2}, /* 4 im */ {COEF, 1}, /* 5 10 tens */ {COEF, 2}, /* 6 20 */ {COEF, 4}, /* 7 40 */ {COEF, 8}, /* 8 80 */ {DEC, M8}, /* 9 pi */ }; /* * IRIG format first frame (1000 Hz, 20 digits, 1 s frame) */ struct progx progz[] = { {MIN, M8}, /* 0 pi (second) */ {COEF, 1}, /* 1 1 units */ {COEF, 2}, /* 2 2 */ {COEF, 4}, /* 3 4 */ {COEF, 8}, /* 4 8 */ {DEC, M2}, /* 5 im */ {COEF, 1}, /* 6 10 tens */ {COEF, 2}, /* 7 20 */ {COEF, 4}, /* 8 40 */ {DEC, M8}, /* 9 pi */ }; /* * Forward declarations */ void sec(int); /* send second */ void digit(int); /* encode digit */ void peep(int, int, int); /* send cycles */ void delay(int); /* delay samples */ /* * Global variables */ char buffer[BUFLNG]; /* output buffer */ int bufcnt = 0; /* buffer counter */ int second = 0; /* seconds counter */ int fd; /* audio codec file descriptor */ int tone = 1000; /* WWV sync frequency */ int level = AUDIO_MAX_GAIN / 8; /* output level */ int port = AUDIO_LINE_OUT; /* output port */ int encode = WWV; /* encoder select */ int leap = 0; /* leap indicator */ int dst = 0; /* winter/summer time */ int dut1 = 0; /* DUT1 correction (sign, magnitude) */ int utc = 0; /* option epoch */ /* * Main program */ int main( int argc, /* command line options */ char **argv /* poiniter to list of tokens */ ) { struct timeval tv; /* system clock at startup */ audio_info_t info; /* Sun audio structure */ struct tm *tm = NULL; /* structure returned by gmtime */ char device[50]; /* audio device */ char code[100]; /* timecode */ int rval, temp, arg, sw, ptr; int minute, hour, day, year; int i; /* * Parse options */ strcpy(device, DEVICE); year = 0; while ((temp = getopt(argc, argv, "a:dhilsu:v:y:")) != -1) { switch (temp) { case 'a': /* specify audio device (/dev/audio) */ strcpy(device, optarg); break; case 'd': /* set DST for summer (WWV/H only) */ dst++; break; case 'h': /* select WWVH sync frequency */ tone = 1200; break; case 'i': /* select irig format */ encode = IRIG; break; case 'l': /* set leap warning bit (WWV/H only) */ leap++; break; case 's': /* enable speaker */ port |= AUDIO_SPEAKER; break; case 'u': /* set DUT1 offset (-7 to +7) */ sscanf(optarg, "%d", &dut1); if (dut1 < 0) dut1 = abs(dut1); else dut1 |= 0x8; break; case 'v': /* set output level (0-255) */ sscanf(optarg, "%d", &level); break; case 'y': /* set initial date and time */ sscanf(optarg, "%2d%3d%2d%2d", &year, &day, &hour, &minute); utc++; break; defult: printf("invalid option %c\n", temp); break; } } /* * Open audio device and set options */ fd = open("/dev/audio", O_WRONLY); if (fd <= 0) { printf("audio open %s\n", strerror(errno)); exit(1); } rval = ioctl(fd, AUDIO_GETINFO, &info); if (rval < 0) { printf("audio control %s\n", strerror(errno)); exit(0); } info.play.port = port; info.play.gain = level; info.play.sample_rate = SECOND; info.play.channels = 1; info.play.precision = 8; info.play.encoding = AUDIO_ENCODING_ULAW; printf("port %d gain %d rate %d chan %d prec %d encode %d\n", info.play.port, info.play.gain, info.play.sample_rate, info.play.channels, info.play.precision, info.play.encoding); ioctl(fd, AUDIO_SETINFO, &info); /* * Unless specified otherwise, read the system clock and * initialize the time. */ if (!utc) { gettimeofday(&tv, NULL); tm = gmtime(&tv.tv_sec); minute = tm->tm_min; hour = tm->tm_hour; day = tm->tm_yday + 1; year = tm->tm_year % 100; second = tm->tm_sec; /* * Delay the first second so the generator is accurately * aligned with the system clock within one sample (125 * microseconds ). */ delay(SECOND - tv.tv_usec * 8 / 1000); } memset(code, 0, sizeof(code)); switch (encode) { /* * For WWV/H and default time, carefully set the signal * generator seconds number to agree with the current time. */ case WWV: printf("year %d day %d time %02d:%02d:%02d tone %d\n", year, day, hour, minute, second, tone); sprintf(code, "%01d%03d%02d%02d%01d", year / 10, day, hour, minute, year % 10); printf("%s\n", code); ptr = 8; for (i = 0; i <= second; i++) { if (progx[i].sw == DEC) ptr--; } break; /* * For IRIG the signal generator runs every second, so requires * no additional alignment. */ case IRIG: printf("sbs %x year %d day %d time %02d:%02d:%02d\n", 0, year, day, hour, minute, second); break; } /* * Run the signal generator to generate new timecode strings * once per minute for WWV/H and once per second for IRIG. */ while(1) { /* * Crank the state machine to propagate carries to the * year of century. Note that we delayed up to one * second for alignment after reading the time, so this * is the next second. */ second = (second + 1) % 60; if (second == 0) { minute++; if (minute >= 60) { minute = 0; hour++; } if (hour >= 24) { hour = 0; day++; } /* * At year rollover check for leap second. */ if (day >= (year & 0x3 ? 366 : 367)) { if (leap) { sec(DATA0); printf("\nleap!"); leap = 0; } day = 1; year++; } if (encode == WWV) { sprintf(code, "%01d%03d%02d%02d%01d", year / 10, day, hour, minute, year % 10); printf("\n%s\n", code); ptr = 8; } } if (encode == IRIG) { sprintf(code, "%04x%04d%06d%02d%02d%02d", 0, year, day, hour, minute, second); printf("%s\n", code); ptr = 19; } /* * Generate data for the second */ switch(encode) { /* * The IRIG second consists of 20 BCD digits of width- * modulateod pulses at 2, 5 and 8 ms and modulated 50 * percent on the 1000-Hz carrier. */ case IRIG: for (i = 0; i < 100; i++) { if (i < 10) { sw = progz[i].sw; arg = progz[i].arg; } else { sw = progy[i % 10].sw; arg = progy[i % 10].arg; } switch(sw) { case COEF: /* send BCD bit */ if (code[ptr] & arg) { peep(M5, 1000, HIGH); peep(M5, 1000, LOW); printf("1"); } else { peep(M2, 1000, HIGH); peep(M8, 1000, LOW); printf("0"); } break; case DEC: /* send IM/PI bit */ ptr--; printf(" "); peep(arg, 1000, HIGH); peep(10 - arg, 1000, LOW); break; case MIN: /* send data bit */ peep(arg, 1000, HIGH); peep(10 - arg, 1000, LOW); printf("M "); break; } if (ptr < 0) break; } printf("\n"); break; /* * The WWV/H second consists of 9 BCD digits of width- * modulateod pulses 200, 500 and 800 ms at 100-Hz. */ case WWV: sw = progx[second].sw; arg = progx[second].arg; switch(sw) { case DATA: /* send data bit */ sec(arg); break; case COEF: /* send BCD bit */ if (code[ptr] & arg) { sec(DATA1); printf("1"); } else { sec(DATA0); printf("0"); } break; case LEAP: /* send leap bit */ if (leap) { sec(DATA1); printf("L "); } else { sec(DATA0); printf(" "); } break; case DEC: /* send data bit */ ptr--; sec(arg); printf(" "); break; case MIN: /* send minute sync */ peep(arg, tone, HIGH); peep(1000 - arg, tone, OFF); break; case DUT1: /* send DUT1 bits */ if (dut1 & arg) sec(DATA1); else sec(DATA0); break; case DST1: /* send DST1 bit */ ptr--; if (dst) sec(DATA1); else sec(DATA0); printf(" "); break; case DST2: /* send DST2 bit */ if (dst) sec(DATA1); else sec(DATA0); break; } } } } /* * Generate WWV/H 0 or 1 data pulse. */ void sec( int code /* DATA0, DATA1, PI */ ) { /* * The WWV data pulse begins with 5 ms of 1000 Hz follwed by a * guard time of 25 ms. The data pulse is 170, 570 or 770 ms at * 100 Hz corresponding to 0, 1 or position indicator (PI), * respectively. Note the 100-Hz data pulses are transmitted 6 * dB below the 1000-Hz sync pulses. Originally the data pulses * were transmited 10 dB below the sync pulses, but the station * engineers increased that to 6 dB because the Heath GC-1000 * WWV/H radio clock worked much better. */ peep(5, tone, HIGH); /* send seconds tick */ peep(25, tone, OFF); peep(code - 30, 100, LOW); /* send data */ peep(1000 - code, 100, OFF); } /* * Generate cycles of 100 Hz or any multiple of 100 Hz. */ void peep( int pulse, /* pulse length (ms) */ int freq, /* frequency (Hz) */ int amp /* amplitude */ ) { int increm; /* phase increment */ int i, j; if (amp == OFF || freq == 0) increm = 10; else increm = freq / 100; j = 0; for (i = 0 ; i < pulse * 8; i++) { switch (amp) { case HIGH: buffer[bufcnt++] = ~c6000[j]; break; case LOW: buffer[bufcnt++] = ~c3000[j]; break; default: buffer[bufcnt++] = ~0; } if (bufcnt >= BUFLNG) { write(fd, buffer, BUFLNG); bufcnt = 0; } j = (j + increm) % 80; } } /* * Delay for initial phasing */ void delay ( int delay /* delay in samples */ ) { int samples; /* samples remaining */ samples = delay; memset(buffer, 0, BUFLNG); while (samples >= BUFLNG) { write(fd, buffer, BUFLNG); samples -= BUFLNG; } write(fd, buffer, samples); } ntp-4.2.6p5/util/ntp-keygen-opts.c0000644000175000017500000007725711675460620016027 0ustar peterpeter/* * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c) * * It has been AutoGen-ed December 24, 2011 at 06:34:40 PM by AutoGen 5.12 * From the definitions ntp-keygen-opts.def * and the template file options * * Generated from AutoOpts 35:0:10 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the ntp-keygen author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * This source file is copyrighted and licensed under the following terms: * * see html/copyright.html * */ #include #include #include #include #include #define OPTION_CODE_COMPILE 1 #include "ntp-keygen-opts.h" #ifdef __cplusplus extern "C" { #endif extern FILE * option_usage_fp; /* TRANSLATORS: choose the translation for option names wisely because you cannot ever change your mind. */ static char const zCopyright[50] = "ntp-keygen (ntp) 4.2.6p5\n\ see html/copyright.html\n"; static char const zLicenseDescrip[25] = "see html/copyright.html\n"; extern tUsageProc optionUsage; /* * global included definitions */ #include #ifdef __windows extern int atoi(const char*); #else # include #endif #ifndef NULL # define NULL 0 #endif /* * Certificate option description: */ #ifdef OPENSSL static char const zCertificateText[] = "certificate scheme"; static char const zCertificate_NAME[] = "CERTIFICATE"; static char const zCertificate_Name[] = "certificate"; #define CERTIFICATE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) #else /* disable Certificate */ #define CERTIFICATE_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zCertificate_NAME NULL #define zCertificateText NULL #define zCertificate_Name NULL #endif /* OPENSSL */ /* * Debug_Level option description: */ static char const zDebug_LevelText[] = "Increase output debug message level"; static char const zDebug_Level_NAME[] = "DEBUG_LEVEL"; static char const zDebug_Level_Name[] = "debug-level"; #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) /* * Set_Debug_Level option description: */ static char const zSet_Debug_LevelText[] = "Set the output debug message level"; static char const zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL"; static char const zSet_Debug_Level_Name[] = "set-debug-level"; #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Id_Key option description: */ #ifdef OPENSSL static char const zId_KeyText[] = "Write IFF or GQ identity keys"; static char const zId_Key_NAME[] = "ID_KEY"; static char const zId_Key_Name[] = "id-key"; #define ID_KEY_FLAGS (OPTST_DISABLED) #else /* disable Id_Key */ #define ID_KEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zId_Key_NAME NULL #define zId_KeyText NULL #define zId_Key_Name NULL #endif /* OPENSSL */ /* * Gq_Params option description: */ #ifdef OPENSSL static char const zGq_ParamsText[] = "Generate GQ parameters and keys"; static char const zGq_Params_NAME[] = "GQ_PARAMS"; static char const zGq_Params_Name[] = "gq-params"; #define GQ_PARAMS_FLAGS (OPTST_DISABLED) #else /* disable Gq_Params */ #define GQ_PARAMS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zGq_Params_NAME NULL #define zGq_ParamsText NULL #define zGq_Params_Name NULL #endif /* OPENSSL */ /* * Host_Key option description: */ #ifdef OPENSSL static char const zHost_KeyText[] = "generate RSA host key"; static char const zHost_Key_NAME[] = "HOST_KEY"; static char const zHost_Key_Name[] = "host-key"; #define HOST_KEY_FLAGS (OPTST_DISABLED) #else /* disable Host_Key */ #define HOST_KEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zHost_Key_NAME NULL #define zHost_KeyText NULL #define zHost_Key_Name NULL #endif /* OPENSSL */ /* * Iffkey option description: */ #ifdef OPENSSL static char const zIffkeyText[] = "generate IFF parameters"; static char const zIffkey_NAME[] = "IFFKEY"; static char const zIffkey_Name[] = "iffkey"; #define IFFKEY_FLAGS (OPTST_DISABLED) #else /* disable Iffkey */ #define IFFKEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zIffkey_NAME NULL #define zIffkeyText NULL #define zIffkey_Name NULL #endif /* OPENSSL */ /* * Issuer_Name option description: */ #ifdef OPENSSL static char const zIssuer_NameText[] = "set issuer name"; static char const zIssuer_Name_NAME[] = "ISSUER_NAME"; static char const zIssuer_Name_Name[] = "issuer-name"; #define ISSUER_NAME_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) #else /* disable Issuer_Name */ #define ISSUER_NAME_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zIssuer_Name_NAME NULL #define zIssuer_NameText NULL #define zIssuer_Name_Name NULL #endif /* OPENSSL */ /* * Md5key option description: */ static char const zMd5keyText[] = "generate MD5 keys"; static char const zMd5key_NAME[] = "MD5KEY"; static char const zMd5key_Name[] = "md5key"; #define MD5KEY_FLAGS (OPTST_DISABLED) /* * Modulus option description: */ #ifdef OPENSSL static char const zModulusText[] = "modulus"; static char const zModulus_NAME[] = "MODULUS"; static char const zModulus_Name[] = "modulus"; #define MODULUS_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) #else /* disable Modulus */ #define MODULUS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zModulus_NAME NULL #define zModulusText NULL #define zModulus_Name NULL #endif /* OPENSSL */ /* * Pvt_Cert option description: */ #ifdef OPENSSL static char const zPvt_CertText[] = "generate PC private certificate"; static char const zPvt_Cert_NAME[] = "PVT_CERT"; static char const zPvt_Cert_Name[] = "pvt-cert"; #define PVT_CERT_FLAGS (OPTST_DISABLED) #else /* disable Pvt_Cert */ #define PVT_CERT_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zPvt_Cert_NAME NULL #define zPvt_CertText NULL #define zPvt_Cert_Name NULL #endif /* OPENSSL */ /* * Pvt_Passwd option description: */ #ifdef OPENSSL static char const zPvt_PasswdText[] = "output private password"; static char const zPvt_Passwd_NAME[] = "PVT_PASSWD"; static char const zPvt_Passwd_Name[] = "pvt-passwd"; #define PVT_PASSWD_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) #else /* disable Pvt_Passwd */ #define PVT_PASSWD_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zPvt_Passwd_NAME NULL #define zPvt_PasswdText NULL #define zPvt_Passwd_Name NULL #endif /* OPENSSL */ /* * Get_Pvt_Passwd option description: */ #ifdef OPENSSL static char const zGet_Pvt_PasswdText[] = "input private password"; static char const zGet_Pvt_Passwd_NAME[] = "GET_PVT_PASSWD"; static char const zGet_Pvt_Passwd_Name[] = "get-pvt-passwd"; #define GET_PVT_PASSWD_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) #else /* disable Get_Pvt_Passwd */ #define GET_PVT_PASSWD_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zGet_Pvt_Passwd_NAME NULL #define zGet_Pvt_PasswdText NULL #define zGet_Pvt_Passwd_Name NULL #endif /* OPENSSL */ /* * Sign_Key option description: */ #ifdef OPENSSL static char const zSign_KeyText[] = "generate sign key (RSA or DSA)"; static char const zSign_Key_NAME[] = "SIGN_KEY"; static char const zSign_Key_Name[] = "sign-key"; #define SIGN_KEY_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) #else /* disable Sign_Key */ #define SIGN_KEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zSign_Key_NAME NULL #define zSign_KeyText NULL #define zSign_Key_Name NULL #endif /* OPENSSL */ /* * Subject_Name option description: */ #ifdef OPENSSL static char const zSubject_NameText[] = "set subject name"; static char const zSubject_Name_NAME[] = "SUBJECT_NAME"; static char const zSubject_Name_Name[] = "subject-name"; #define SUBJECT_NAME_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) #else /* disable Subject_Name */ #define SUBJECT_NAME_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zSubject_Name_NAME NULL #define zSubject_NameText NULL #define zSubject_Name_Name NULL #endif /* OPENSSL */ /* * Trusted_Cert option description: */ #ifdef OPENSSL static char const zTrusted_CertText[] = "trusted certificate (TC scheme)"; static char const zTrusted_Cert_NAME[] = "TRUSTED_CERT"; static char const zTrusted_Cert_Name[] = "trusted-cert"; #define TRUSTED_CERT_FLAGS (OPTST_DISABLED) #else /* disable Trusted_Cert */ #define TRUSTED_CERT_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zTrusted_Cert_NAME NULL #define zTrusted_CertText NULL #define zTrusted_Cert_Name NULL #endif /* OPENSSL */ /* * Mv_Params option description: */ #ifdef OPENSSL static char const zMv_ParamsText[] = "generate MV parameters"; static char const zMv_Params_NAME[] = "MV_PARAMS"; static char const zMv_Params_Name[] = "mv-params"; #define MV_PARAMS_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) #else /* disable Mv_Params */ #define MV_PARAMS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMv_Params_NAME NULL #define zMv_ParamsText NULL #define zMv_Params_Name NULL #endif /* OPENSSL */ /* * Mv_Keys option description: */ #ifdef OPENSSL static char const zMv_KeysText[] = "update MV keys"; static char const zMv_Keys_NAME[] = "MV_KEYS"; static char const zMv_Keys_Name[] = "mv-keys"; #define MV_KEYS_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) #else /* disable Mv_Keys */ #define MV_KEYS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMv_Keys_NAME NULL #define zMv_KeysText NULL #define zMv_Keys_Name NULL #endif /* OPENSSL */ /* * Help/More_Help/Version option descriptions: */ static char const zHelpText[] = "Display extended usage information and exit"; static char const zHelp_Name[] = "help"; #ifdef HAVE_WORKING_FORK #define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) static char const zMore_Help_Name[] = "more-help"; static char const zMore_HelpText[] = "Extended usage information passed thru pager"; #else #define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMore_Help_Name NULL #define zMore_HelpText NULL #endif #ifdef NO_OPTIONAL_OPT_ARGS # define OPTST_VERSION_FLAGS OPTST_IMM | OPTST_NO_INIT #else # define OPTST_VERSION_FLAGS OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif static char const zVersionText[] = "Output version information and exit"; static char const zVersion_Name[] = "version"; static char const zSave_OptsText[] = "Save the option state to a config file"; static char const zSave_Opts_Name[] = "save-opts"; static char const zLoad_OptsText[] = "Load options from a config file"; static char const zLoad_Opts_NAME[] = "LOAD_OPTS"; static char const zNotLoad_Opts_Name[] = "no-load-opts"; static char const zNotLoad_Opts_Pfx[] = "no"; #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3) /* * Declare option callback procedures */ #ifdef OPENSSL static tOptProc doOptModulus; #else /* not OPENSSL */ # define doOptModulus NULL #endif /* def/not OPENSSL */ #if defined(TEST_NTP_KEYGEN_OPTS) /* * Under test, omit argument processing, or call optionStackArg, * if multiple copies are allowed. */ static tOptProc doUsageOpt; /* * #define map the "normal" callout procs to the test ones... */ #define SET_DEBUG_LEVEL_OPT_PROC optionStackArg #else /* NOT defined TEST_NTP_KEYGEN_OPTS */ /* * When not under test, there are different procs to use */ extern tOptProc optionBooleanVal, optionNestedVal, optionNumericVal, optionPagedUsage, optionPrintVersion, optionResetOpt, optionStackArg, optionTimeDate, optionTimeVal, optionUnstackArg, optionVersionStderr; static tOptProc doOptSet_Debug_Level, doUsageOpt; /* * #define map the "normal" callout procs */ #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level #endif /* defined(TEST_NTP_KEYGEN_OPTS) */ #ifdef TEST_NTP_KEYGEN_OPTS # define DOVERPROC optionVersionStderr #else # define DOVERPROC optionPrintVersion #endif /* TEST_NTP_KEYGEN_OPTS */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the Ntp_Keygen Option Descriptions. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_CERTIFICATE, /* equiv idx, value */ 0, VALUE_OPT_CERTIFICATE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ CERTIFICATE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zCertificateText, zCertificate_NAME, zCertificate_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 1, VALUE_OPT_DEBUG_LEVEL, /* equiv idx, value */ 1, VALUE_OPT_DEBUG_LEVEL, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ DEBUG_LEVEL_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zDebug_LevelText, zDebug_Level_NAME, zDebug_Level_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 2, VALUE_OPT_SET_DEBUG_LEVEL, /* equiv idx, value */ 2, VALUE_OPT_SET_DEBUG_LEVEL, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ SET_DEBUG_LEVEL_OPT_PROC, /* desc, NAME, name */ zSet_Debug_LevelText, zSet_Debug_Level_NAME, zSet_Debug_Level_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 3, VALUE_OPT_ID_KEY, /* equiv idx, value */ 3, VALUE_OPT_ID_KEY, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ ID_KEY_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zId_KeyText, zId_Key_NAME, zId_Key_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 4, VALUE_OPT_GQ_PARAMS, /* equiv idx, value */ 4, VALUE_OPT_GQ_PARAMS, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ GQ_PARAMS_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zGq_ParamsText, zGq_Params_NAME, zGq_Params_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 5, VALUE_OPT_HOST_KEY, /* equiv idx, value */ 5, VALUE_OPT_HOST_KEY, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ HOST_KEY_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zHost_KeyText, zHost_Key_NAME, zHost_Key_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 6, VALUE_OPT_IFFKEY, /* equiv idx, value */ 6, VALUE_OPT_IFFKEY, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ IFFKEY_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zIffkeyText, zIffkey_NAME, zIffkey_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 7, VALUE_OPT_ISSUER_NAME, /* equiv idx, value */ 7, VALUE_OPT_ISSUER_NAME, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ ISSUER_NAME_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zIssuer_NameText, zIssuer_Name_NAME, zIssuer_Name_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 8, VALUE_OPT_MD5KEY, /* equiv idx, value */ 8, VALUE_OPT_MD5KEY, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ MD5KEY_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zMd5keyText, zMd5key_NAME, zMd5key_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 9, VALUE_OPT_MODULUS, /* equiv idx, value */ 9, VALUE_OPT_MODULUS, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ MODULUS_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doOptModulus, /* desc, NAME, name */ zModulusText, zModulus_NAME, zModulus_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 10, VALUE_OPT_PVT_CERT, /* equiv idx, value */ 10, VALUE_OPT_PVT_CERT, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PVT_CERT_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zPvt_CertText, zPvt_Cert_NAME, zPvt_Cert_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 11, VALUE_OPT_PVT_PASSWD, /* equiv idx, value */ 11, VALUE_OPT_PVT_PASSWD, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PVT_PASSWD_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zPvt_PasswdText, zPvt_Passwd_NAME, zPvt_Passwd_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 12, VALUE_OPT_GET_PVT_PASSWD, /* equiv idx, value */ 12, VALUE_OPT_GET_PVT_PASSWD, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ GET_PVT_PASSWD_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zGet_Pvt_PasswdText, zGet_Pvt_Passwd_NAME, zGet_Pvt_Passwd_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 13, VALUE_OPT_SIGN_KEY, /* equiv idx, value */ 13, VALUE_OPT_SIGN_KEY, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SIGN_KEY_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zSign_KeyText, zSign_Key_NAME, zSign_Key_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 14, VALUE_OPT_SUBJECT_NAME, /* equiv idx, value */ 14, VALUE_OPT_SUBJECT_NAME, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SUBJECT_NAME_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zSubject_NameText, zSubject_Name_NAME, zSubject_Name_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 15, VALUE_OPT_TRUSTED_CERT, /* equiv idx, value */ 15, VALUE_OPT_TRUSTED_CERT, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ TRUSTED_CERT_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zTrusted_CertText, zTrusted_Cert_NAME, zTrusted_Cert_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 16, VALUE_OPT_MV_PARAMS, /* equiv idx, value */ 16, VALUE_OPT_MV_PARAMS, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ MV_PARAMS_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionNumericVal, /* desc, NAME, name */ zMv_ParamsText, zMv_Params_NAME, zMv_Params_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 17, VALUE_OPT_MV_KEYS, /* equiv idx, value */ 17, VALUE_OPT_MV_KEYS, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ MV_KEYS_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionNumericVal, /* desc, NAME, name */ zMv_KeysText, zMv_Keys_NAME, zMv_Keys_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_VERSION_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ DOVERPROC, /* desc, NAME, name */ zVersionText, NULL, zVersion_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doUsageOpt, /* desc, NAME, name */ zHelpText, NULL, zHelp_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_MORE_HELP_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionPagedUsage, /* desc, NAME, name */ zMore_HelpText, NULL, zMore_Help_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zSave_OptsText, NULL, zSave_Opts_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_DISABLE_IMM, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionLoadOpt, /* desc, NAME, name */ zLoad_OptsText, zLoad_Opts_NAME, zLoad_Opts_Name, /* disablement strs */ zNotLoad_Opts_Name, zNotLoad_Opts_Pfx } }; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the Ntp_Keygen Option Environment */ static char const zPROGNAME[11] = "NTP_KEYGEN"; static char const zUsageTitle[114] = "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.6p5\n\ USAGE: %s [ - [] | --[{=| }] ]...\n"; static char const zRcName[7] = ".ntprc"; static char const * const apzHomeList[3] = { "$HOME", ".", NULL }; static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org"; #define zExplain NULL static char const zDetail[99] = "\n\ If there is no new host key, look for an existing one. If one is not\n\ found, create it.\n"; static char const zFullVersion[] = NTP_KEYGEN_FULL_VERSION; /* extracted from optcode.tlib near line 515 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE static tOptionXlateProc translate_option_strings; #else # define OPTPROC_BASE OPTPROC_NONE # define translate_option_strings NULL #endif /* ENABLE_NLS */ #define ntp_keygen_full_usage NULL #define ntp_keygen_short_usage NULL #ifndef PKGDATADIR # define PKGDATADIR "" #endif #ifndef WITH_PACKAGER # define ntp_keygen_packager_info NULL #else static char const ntp_keygen_packager_info[] = "Packaged by " WITH_PACKAGER # ifdef WITH_PACKAGER_VERSION " ("WITH_PACKAGER_VERSION")" # endif # ifdef WITH_PACKAGER_BUG_REPORTS "\nReport ntp_keygen bugs to " WITH_PACKAGER_BUG_REPORTS # endif "\n"; #endif tOptions ntp_keygenOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ ( OPTPROC_BASE + OPTPROC_ERRSTOP + OPTPROC_SHORTOPT + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT + OPTPROC_ENVIRON + OPTPROC_NO_ARGS + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zLicenseDescrip, zFullVersion, apzHomeList, zUsageTitle, zExplain, zDetail, optDesc, zBugsAddr, /* address to send bugs to */ NULL, NULL, /* extensions/saved state */ optionUsage, /* usage procedure */ translate_option_strings, /* translation procedure */ /* * Indexes to special options */ { INDEX_OPT_MORE_HELP, /* more-help option index */ INDEX_OPT_SAVE_OPTS, /* save option index */ NO_EQUIVALENT, /* '-#' option index */ NO_EQUIVALENT /* index of default opt */ }, 23 /* full option count */, 18 /* user option count */, ntp_keygen_full_usage, ntp_keygen_short_usage, NULL, NULL, PKGDATADIR, ntp_keygen_packager_info }; /* * Create the static procedure(s) declared above. */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { (void)pOptions; USAGE(NTP_KEYGEN_EXIT_SUCCESS); } #if ! defined(TEST_NTP_KEYGEN_OPTS) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * For the set-debug-level option. */ static void doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc) { /* extracted from debug-opt.def, line 27 */ DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); } #endif /* defined(TEST_NTP_KEYGEN_OPTS) */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * For the modulus option, when OPENSSL is #define-d. */ #ifdef OPENSSL static void doOptModulus(tOptions* pOptions, tOptDesc* pOptDesc) { static const struct {long const rmin, rmax;} rng[1] = { { 256, 2048 } }; int ix; if (pOptions <= OPTPROC_EMIT_LIMIT) goto emit_ranges; optionNumericVal(pOptions, pOptDesc); for (ix = 0; ix < 1; ix++) { if (pOptDesc->optArg.argInt < rng[ix].rmin) continue; /* ranges need not be ordered. */ if (pOptDesc->optArg.argInt == rng[ix].rmin) return; if (rng[ix].rmax == LONG_MIN) continue; if (pOptDesc->optArg.argInt <= rng[ix].rmax) return; } option_usage_fp = stderr; emit_ranges: optionShowRange(pOptions, pOptDesc, (void *)rng, 1); } #endif /* defined OPENSSL */ /* extracted from optmain.tlib near line 128 */ #if defined(TEST_NTP_KEYGEN_OPTS) /* TEST MAIN PROCEDURE: */ extern void optionPutShell(tOptions*); int main(int argc, char ** argv) { int res = NTP_KEYGEN_EXIT_SUCCESS; (void)optionProcess(&ntp_keygenOptions, argc, argv); optionPutShell(&ntp_keygenOptions); res = ferror(stdout); if (res != 0) fputs("output error writing to stdout\n", stderr); return res; } #endif /* defined TEST_NTP_KEYGEN_OPTS */ /* extracted from optcode.tlib near line 666 */ #if ENABLE_NLS #include #include #include #include #include static char* AO_gettext(char const* pz); static void coerce_it(void** s); static char* AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) return NULL; pzRes = _(pz); if (pzRes == pz) return pzRes; pzRes = strdup(pzRes); if (pzRes == NULL) { fputs(_("No memory for duping translated strings\n"), stderr); exit(NTP_KEYGEN_EXIT_FAILURE); } return pzRes; } static void coerce_it(void** s) { *s = AO_gettext(*s); } /* * This invokes the translation code (e.g. gettext(3)). */ static void translate_option_strings(void) { tOptions * const pOpt = &ntp_keygenOptions; /* * Guard against re-translation. It won't work. The strings will have * been changed by the first pass through this code. One shot only. */ if (option_usage_text.field_ct != 0) { /* * Do the translations. The first pointer follows the field count * field. The field count field is the size of a pointer. */ tOptDesc * pOD = pOpt->pOptDesc; char ** ppz = (char**)(void*)&(option_usage_text); int ix = option_usage_text.field_ct; do { ppz++; *ppz = AO_gettext(*ppz); } while (--ix > 0); coerce_it((void*)&(pOpt->pzCopyright)); coerce_it((void*)&(pOpt->pzCopyNotice)); coerce_it((void*)&(pOpt->pzFullVersion)); coerce_it((void*)&(pOpt->pzUsageTitle)); coerce_it((void*)&(pOpt->pzExplain)); coerce_it((void*)&(pOpt->pzDetail)); coerce_it((void*)&(pOpt->pzPackager)); option_usage_text.field_ct = 0; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) coerce_it((void*)&(pOD->pzText)); } if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) { tOptDesc * pOD = pOpt->pOptDesc; int ix; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) { coerce_it((void*)&(pOD->pz_Name)); coerce_it((void*)&(pOD->pz_DisableName)); coerce_it((void*)&(pOD->pz_DisablePfx)); } /* prevent re-translation */ ntp_keygenOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT; } } #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif /* ntp-keygen-opts.c ends here */ ntp-4.2.6p5/util/tickadj.c0000644000175000017500000004003311505336022014340 0ustar peterpeter/* * tickadj - read, and possibly modify, the kernel `tick' and * `tickadj' variables, as well as `dosynctodr'. Note that * this operates on the running kernel only. I'd like to be * able to read and write the binary as well, but haven't * mastered this yet. * * HMS: The #includes here are different from those in xntpd/ntp_unixclock.c * These seem "worse". */ #ifdef HAVE_CONFIG_H # include #endif #include "ntp_types.h" #include "l_stdlib.h" #include #ifdef HAVE_UNISTD_H # include #endif /* HAVE_UNISTD_H */ #ifdef HAVE___ADJTIMEX /* Linux */ #include struct timex txc; #if 0 int main( int argc, char *argv[] ) { int c, i; int quiet = 0; int errflg = 0; char *progname; extern int ntp_optind; extern char *ntp_optarg; progname = argv[0]; if (argc==2 && argv[1][0] != '-') { /* old Linux format, for compatability */ if ((i = atoi(argv[1])) > 0) { txc.time_tick = i; txc.modes = ADJ_TIMETICK; } else { fprintf(stderr, "Silly value for tick: %s\n", argv[1]); errflg++; } } else { while ((c = ntp_getopt(argc, argv, "a:qt:")) != EOF) { switch (c) { case 'a': if ((i=atoi(ntp_optarg)) > 0) { txc.tickadj = i; txc.modes |= ADJ_TICKADJ; } else { (void) fprintf(stderr, "%s: unlikely value for tickadj: %s\n", progname, ntp_optarg); errflg++; } break; case 'q': quiet = 1; break; case 't': if ((i=atoi(ntp_optarg)) > 0) { txc.time_tick = i; txc.modes |= ADJ_TIMETICK; } else { (void) fprintf(stderr, "%s: unlikely value for tick: %s\n", progname, ntp_optarg); errflg++; } break; default: fprintf(stderr, "Usage: %s [tick_value]\n-or- %s [ -q ] [ -t tick ] [ -a tickadj ]\n", progname, progname); errflg++; break; } } } if (!errflg) { if (__adjtimex(&txc) < 0) perror("adjtimex"); else if (!quiet) printf("tick = %ld\ntick_adj = %d\n", txc.time_tick, txc.tickadj); } exit(errflg ? 1 : 0); } #else int main( int argc, char *argv[] ) { if (argc > 2) { fprintf(stderr, "Usage: %s [tick_value]\n", argv[0]); exit(-1); } else if (argc == 2) { #ifdef ADJ_TIMETICK if ( (txc.time_tick = atoi(argv[1])) < 1 ) #else if ( (txc.tick = atoi(argv[1])) < 1 ) #endif { fprintf(stderr, "Silly value for tick: %s\n", argv[1]); exit(-1); } #ifdef ADJ_TIMETICK txc.modes = ADJ_TIMETICK; #else #ifdef MOD_OFFSET txc.modes = ADJ_TICK; #else txc.mode = ADJ_TICK; #endif #endif } else { #ifdef ADJ_TIMETICK txc.modes = 0; #else #ifdef MOD_OFFSET txc.modes = 0; #else txc.mode = 0; #endif #endif } if (__adjtimex(&txc) < 0) { perror("adjtimex"); } else { #ifdef ADJ_TIMETICK printf("tick = %ld\ntick_adj = %ld\n", txc.time_tick, txc.tickadj); #else printf("tick = %ld\n", txc.tick); #endif } exit(0); } #endif #else /* not Linux... kmem tweaking: */ #ifdef HAVE_SYS_FILE_H # include #endif #include #ifdef HAVE_SYS_PARAM_H # include #endif #ifdef NLIST_STRUCT # include #else /* not NLIST_STRUCT */ /* was defined(SYS_AUX3) || defined(SYS_AUX2) */ # include # include # include # ifdef HAVE_SYS_VAR_H # include # endif #endif #include "ntp_stdlib.h" #include "ntp_io.h" #ifdef hz /* Was: RS6000 */ # undef hz #endif /* hz */ #ifdef HAVE_KVM_OPEN # include #endif #ifdef SYS_VXWORKS /* vxWorks needs mode flag -casey*/ #define open(name, flags) open(name, flags, 0777) #endif #ifndef L_SET /* Was: defined(SYS_PTX) || defined(SYS_IX86OSF1) */ # define L_SET SEEK_SET #endif #ifndef HZ # define HZ DEFAULT_HZ #endif #define KMEM "/dev/kmem" #define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0) char *progname; volatile int debug; int dokmem = 1; int writetickadj = 0; int writeopttickadj = 0; int unsetdosync = 0; int writetick = 0; int quiet = 0; int setnoprintf = 0; const char *kmem = KMEM; const char *file = NULL; int fd = -1; static void getoffsets (off_t *, off_t *, off_t *, off_t *); static int openfile (const char *, int); static void writevar (int, off_t, int); static void readvar (int, off_t, int *); /* * main - parse arguments and handle options */ int main( int argc, char *argv[] ) { int c; int errflg = 0; off_t tickadj_offset; off_t tick_offset; off_t dosync_offset; off_t noprintf_offset; int tickadj, ktickadj; /* HMS: Why isn't this u_long? */ int tick, ktick; /* HMS: Why isn't this u_long? */ int dosynctodr; int noprintf; int hz; int hz_int, hz_hundredths; int recommend_tickadj; long tmp; progname = argv[0]; while ((c = ntp_getopt(argc, argv, "a:Adkpqst:")) != EOF) { switch (c) { case 'a': writetickadj = atoi(ntp_optarg); if (writetickadj <= 0) { (void) fprintf(stderr, "%s: unlikely value for tickadj: %s\n", progname, ntp_optarg); errflg++; } #if defined SCO5_CLOCK if (writetickadj % HZ) { writetickadj = (writetickadj / HZ) * HZ; (void) fprintf(stderr, "tickadj truncated to: %d\n", writetickadj); } #endif /* SCO5_CLOCK */ break; case 'A': writeopttickadj = 1; break; case 'd': ++debug; break; case 'k': dokmem = 1; break; case 'p': setnoprintf = 1; break; case 'q': quiet = 1; break; case 's': unsetdosync = 1; break; case 't': writetick = atoi(ntp_optarg); if (writetick <= 0) { (void) fprintf(stderr, "%s: unlikely value for tick: %s\n", progname, ntp_optarg); errflg++; } break; default: errflg++; break; } } if (errflg || ntp_optind != argc) { (void) fprintf(stderr, "usage: %s [-Adkpqs] [-a newadj] [-t newtick]\n", progname); exit(2); } getoffsets(&tick_offset, &tickadj_offset, &dosync_offset, &noprintf_offset); if (debug) { (void) printf("tick offset = %lu\n", (unsigned long)tick_offset); (void) printf("tickadj offset = %lu\n", (unsigned long)tickadj_offset); (void) printf("dosynctodr offset = %lu\n", (unsigned long)dosync_offset); (void) printf("noprintf offset = %lu\n", (unsigned long)noprintf_offset); } if (writetick && (tick_offset == 0)) { (void) fprintf(stderr, "No tick kernel variable\n"); errflg++; } if (writeopttickadj && (tickadj_offset == 0)) { (void) fprintf(stderr, "No tickadj kernel variable\n"); errflg++; } if (unsetdosync && (dosync_offset == 0)) { (void) fprintf(stderr, "No dosynctodr kernel variable\n"); errflg++; } if (setnoprintf && (noprintf_offset == 0)) { (void) fprintf(stderr, "No noprintf kernel variable\n"); errflg++; } if (tick_offset != 0) { readvar(fd, tick_offset, &tick); #if defined(TICK_NANO) && defined(K_TICK_NAME) if (!quiet) (void) printf("KERNEL %s = %d nsec\n", K_TICK_NAME, tick); #endif /* TICK_NANO && K_TICK_NAME */ #ifdef TICK_NANO tick /= 1000; #endif } else { tick = 0; } if (tickadj_offset != 0) { readvar(fd, tickadj_offset, &tickadj); #ifdef SCO5_CLOCK /* scale from nsec/sec to usec/tick */ tickadj /= (1000L * HZ); #endif /*SCO5_CLOCK */ #if defined(TICKADJ_NANO) && defined(K_TICKADJ_NAME) if (!quiet) (void) printf("KERNEL %s = %d nsec\n", K_TICKADJ_NAME, tickadj); #endif /* TICKADJ_NANO && K_TICKADJ_NAME */ #ifdef TICKADJ_NANO tickadj += 999; tickadj /= 1000; #endif } else { tickadj = 0; } if (dosync_offset != 0) { readvar(fd, dosync_offset, &dosynctodr); } if (noprintf_offset != 0) { readvar(fd, noprintf_offset, &noprintf); } (void) close(fd); if (unsetdosync && dosync_offset == 0) { (void) fprintf(stderr, "%s: can't find %s in namelist\n", progname, #ifdef K_DOSYNCTODR_NAME K_DOSYNCTODR_NAME #else /* not K_DOSYNCTODR_NAME */ "dosynctodr" #endif /* not K_DOSYNCTODR_NAME */ ); exit(1); } hz = HZ; #if defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK) hz = (int) sysconf (_SC_CLK_TCK); #endif /* not HAVE_SYSCONF && _SC_CLK_TCK */ #ifdef OVERRIDE_HZ hz = DEFAULT_HZ; #endif ktick = tick; #ifdef PRESET_TICK tick = PRESET_TICK; #endif /* PRESET_TICK */ #ifdef TICKADJ_NANO tickadj /= 1000; if (tickadj == 0) tickadj = 1; #endif ktickadj = tickadj; #ifdef PRESET_TICKADJ tickadj = (PRESET_TICKADJ) ? PRESET_TICKADJ : 1; #endif /* PRESET_TICKADJ */ if (!quiet) { if (tick_offset != 0) { (void) printf("KERNEL tick = %d usec (from %s kernel variable)\n", ktick, #ifdef K_TICK_NAME K_TICK_NAME #else "" #endif ); } #ifdef PRESET_TICK (void) printf("PRESET tick = %d usec\n", tick); #endif /* PRESET_TICK */ if (tickadj_offset != 0) { (void) printf("KERNEL tickadj = %d usec (from %s kernel variable)\n", ktickadj, #ifdef K_TICKADJ_NAME K_TICKADJ_NAME #else "" #endif ); } #ifdef PRESET_TICKADJ (void) printf("PRESET tickadj = %d usec\n", tickadj); #endif /* PRESET_TICKADJ */ if (dosync_offset != 0) { (void) printf("dosynctodr is %s\n", dosynctodr ? "on" : "off"); } if (noprintf_offset != 0) { (void) printf("kernel level printf's: %s\n", noprintf ? "off" : "on"); } } if (tick <= 0) { (void) fprintf(stderr, "%s: the value of tick is silly!\n", progname); exit(1); } hz_int = (int)(1000000L / (long)tick); hz_hundredths = (int)((100000000L / (long)tick) - ((long)hz_int * 100L)); if (!quiet) { (void) printf("KERNEL hz = %d\n", hz); (void) printf("calculated hz = %d.%02d Hz\n", hz_int, hz_hundredths); } #if defined SCO5_CLOCK recommend_tickadj = 100; #else /* SCO5_CLOCK */ tmp = (long) tick * 500L; recommend_tickadj = (int)(tmp / 1000000L); if (tmp % 1000000L > 0) { recommend_tickadj++; } #ifdef MIN_REC_TICKADJ if (recommend_tickadj < MIN_REC_TICKADJ) { recommend_tickadj = MIN_REC_TICKADJ; } #endif /* MIN_REC_TICKADJ */ #endif /* SCO5_CLOCK */ if ((!quiet) && (tickadj_offset != 0)) { (void) printf("recommended value of tickadj = %d us\n", recommend_tickadj); } if ( writetickadj == 0 && !writeopttickadj && !unsetdosync && writetick == 0 && !setnoprintf) { exit(errflg ? 1 : 0); } if (writetickadj == 0 && writeopttickadj) { writetickadj = recommend_tickadj; } fd = openfile(file, O_WRONLY); if (setnoprintf && (noprintf_offset != 0)) { if (!quiet) { (void) fprintf(stderr, "setting noprintf: "); (void) fflush(stderr); } writevar(fd, noprintf_offset, 1); if (!quiet) { (void) fprintf(stderr, "done!\n"); } } if ((writetick > 0) && (tick_offset != 0)) { if (!quiet) { (void) fprintf(stderr, "writing tick, value %d: ", writetick); (void) fflush(stderr); } writevar(fd, tick_offset, writetick); if (!quiet) { (void) fprintf(stderr, "done!\n"); } } if ((writetickadj > 0) && (tickadj_offset != 0)) { if (!quiet) { (void) fprintf(stderr, "writing tickadj, value %d: ", writetickadj); (void) fflush(stderr); } #ifdef SCO5_CLOCK /* scale from usec/tick to nsec/sec */ writetickadj *= (1000L * HZ); #endif /* SCO5_CLOCK */ writevar(fd, tickadj_offset, writetickadj); if (!quiet) { (void) fprintf(stderr, "done!\n"); } } if (unsetdosync && (dosync_offset != 0)) { if (!quiet) { (void) fprintf(stderr, "zeroing dosynctodr: "); (void) fflush(stderr); } writevar(fd, dosync_offset, 0); if (!quiet) { (void) fprintf(stderr, "done!\n"); } } (void) close(fd); return(errflg ? 1 : 0); } /* * getoffsets - read the magic offsets from the specified file */ static void getoffsets( off_t *tick_off, off_t *tickadj_off, off_t *dosync_off, off_t *noprintf_off ) { #ifndef NOKMEM # ifndef HAVE_KVM_OPEN const char **kname; # endif #endif #ifndef NOKMEM # ifdef NLIST_NAME_UNION # define NL_B {{ # define NL_E }} # else # define NL_B { # define NL_E } # endif #endif #define K_FILLER_NAME "DavidLetterman" #ifdef NLIST_EXTRA_INDIRECTION int i; #endif #ifndef NOKMEM static struct nlist nl[] = { NL_B #ifdef K_TICKADJ_NAME #define N_TICKADJ 0 K_TICKADJ_NAME #else K_FILLER_NAME #endif NL_E, NL_B #ifdef K_TICK_NAME #define N_TICK 1 K_TICK_NAME #else K_FILLER_NAME #endif NL_E, NL_B #ifdef K_DOSYNCTODR_NAME #define N_DOSYNC 2 K_DOSYNCTODR_NAME #else K_FILLER_NAME #endif NL_E, NL_B #ifdef K_NOPRINTF_NAME #define N_NOPRINTF 3 K_NOPRINTF_NAME #else K_FILLER_NAME #endif NL_E, NL_B "" NL_E, }; #ifndef HAVE_KVM_OPEN static const char *kernels[] = { #ifdef HAVE_GETBOOTFILE NULL, /* *** SEE BELOW! *** */ #endif "/kernel/unix", "/kernel", "/vmunix", "/unix", "/mach", "/hp-ux", "/386bsd", "/netbsd", "/stand/vmunix", "/bsd", NULL }; #endif /* not HAVE_KVM_OPEN */ #ifdef HAVE_KVM_OPEN /* * Solaris > 2.5 doesn't have a kernel file. Use the kvm_* interface * to read the kernel name list. -- stolcke 3/4/96 */ kvm_t *kvm_handle = kvm_open(NULL, NULL, NULL, O_RDONLY, progname); if (kvm_handle == NULL) { (void) fprintf(stderr, "%s: kvm_open failed\n", progname); exit(1); } if (kvm_nlist(kvm_handle, nl) == -1) { (void) fprintf(stderr, "%s: kvm_nlist failed\n", progname); exit(1); } kvm_close(kvm_handle); #else /* not HAVE_KVM_OPEN */ #ifdef HAVE_GETBOOTFILE /* *** SEE HERE! *** */ if (kernels[0] == NULL) { char * cp = (char *)getbootfile(); if (cp) { kernels[0] = cp; } else { kernels[0] = "/Placeholder"; } } #endif /* HAVE_GETBOOTFILE */ for (kname = kernels; *kname != NULL; kname++) { struct stat stbuf; if (stat(*kname, &stbuf) == -1) { continue; } if (nlist(*kname, nl) >= 0) { break; } else { (void) fprintf(stderr, "%s: nlist didn't find needed symbols from <%s>: %s\n", progname, *kname, strerror(errno)); } } if (*kname == NULL) { (void) fprintf(stderr, "%s: Couldn't find the kernel\n", progname); exit(1); } #endif /* HAVE_KVM_OPEN */ if (dokmem) { file = kmem; fd = openfile(file, O_RDONLY); #ifdef NLIST_EXTRA_INDIRECTION /* * Go one more round of indirection. */ for (i = 0; i < (sizeof(nl) / sizeof(struct nlist)); i++) { if ((nl[i].n_value) && (nl[i].n_sclass == 0x6b)) { readvar(fd, nl[i].n_value, &nl[i].n_value); } } #endif /* NLIST_EXTRA_INDIRECTION */ } #endif /* not NOKMEM */ *tickadj_off = 0; *tick_off = 0; *dosync_off = 0; *noprintf_off = 0; #if defined(N_TICKADJ) *tickadj_off = nl[N_TICKADJ].n_value; #endif #if defined(N_TICK) *tick_off = nl[N_TICK].n_value; #endif #if defined(N_DOSYNC) *dosync_off = nl[N_DOSYNC].n_value; #endif #if defined(N_NOPRINTF) *noprintf_off = nl[N_NOPRINTF].n_value; #endif return; } #undef N_TICKADJ #undef N_TICK #undef N_DOSYNC #undef N_NOPRINTF /* * openfile - open the file, check for errors */ static int openfile( const char *name, int mode ) { int ifd; ifd = open(name, mode); if (ifd < 0) { (void) fprintf(stderr, "%s: open %s: ", progname, name); perror(""); exit(1); } return ifd; } /* * writevar - write a variable into the file */ static void writevar( int ofd, off_t off, int var ) { if (lseek(ofd, off, L_SET) == -1) { (void) fprintf(stderr, "%s: lseek fails: ", progname); perror(""); exit(1); } if (write(ofd, (char *)&var, sizeof(int)) != sizeof(int)) { (void) fprintf(stderr, "%s: write fails: ", progname); perror(""); exit(1); } return; } /* * readvar - read a variable from the file */ static void readvar( int ifd, off_t off, int *var ) { int i; if (lseek(ifd, off, L_SET) == -1) { (void) fprintf(stderr, "%s: lseek fails: ", progname); perror(""); exit(1); } i = read(ifd, (char *)var, sizeof(int)); if (i < 0) { (void) fprintf(stderr, "%s: read fails: ", progname); perror(""); exit(1); } if (i != sizeof(int)) { (void) fprintf(stderr, "%s: read expected %d, got %d\n", progname, (int)sizeof(int), i); exit(1); } return; } #endif /* not Linux */ ntp-4.2.6p5/util/precision.c0000644000175000017500000001210110017034611014711 0ustar peterpeter#include "ntp_unixtime.h" #include #define DEFAULT_SYS_PRECISION -99 int default_get_resolution(); int default_get_precision(); int main( int argc, char *argv[] ) { printf("log2(resolution) = %d, log2(precision) = %d\n", default_get_resolution(), default_get_precision()); return 0; } /* Find the resolution of the system clock by watching how the current time * changes as we read it repeatedly. * * struct timeval is only good to 1us, which may cause problems as machines * get faster, but until then the logic goes: * * If a machine has resolution (i.e. accurate timing info) > 1us, then it will * probably use the "unused" low order bits as a counter (to force time to be * a strictly increaing variable), incrementing it each time any process * requests the time [[ or maybe time will stand still ? ]]. * * SO: the logic goes: * * IF the difference from the last time is "small" (< MINSTEP) * THEN this machine is "counting" with the low order bits * ELIF this is not the first time round the loop * THEN this machine *WAS* counting, and has now stepped * ELSE this machine has resolution < time to read clock * * SO: if it exits on the first loop, assume "full accuracy" (1us) * otherwise, take the log2(observered difference, rounded UP) * * MINLOOPS > 1 ensures that even if there is a STEP between the initial call * and the first loop, it doesn't stop too early. * Making it even greater allows MINSTEP to be reduced, assuming that the * chance of MINSTEP-1 other processes getting in and calling gettimeofday * between this processes's calls. * Reducing MINSTEP may be necessary as this sets an upper bound for the time * to actually call gettimeofday. */ #define DUSECS 1000000 #define HUSECS (1024 * 1024) #define MINSTEP 5 /* some systems increment uS on each call */ /* Don't use "1" as some *other* process may read too*/ /*We assume no system actually *ANSWERS* in this time*/ #define MAXSTEP 20000 /* maximum clock increment (us) */ #define MINLOOPS 5 /* minimum number of step samples */ #define MAXLOOPS HUSECS /* Assume precision < .1s ! */ int default_get_resolution(void) { struct timeval tp; struct timezone tzp; long last; int i; long diff; long val; int minsteps = MINLOOPS; /* need at least this many steps */ gettimeofday(&tp, &tzp); last = tp.tv_usec; for (i = - --minsteps; i< MAXLOOPS; i++) { gettimeofday(&tp, &tzp); diff = tp.tv_usec - last; if (diff < 0) diff += DUSECS; if (diff > MINSTEP) if (minsteps-- <= 0) break; last = tp.tv_usec; } printf("resolution = %ld usec after %d loop%s\n", diff, i, (i==1) ? "" : "s"); diff = (diff *3)/2; if (i >= MAXLOOPS) { printf( " (Boy this machine is fast ! %d loops without a step)\n", MAXLOOPS); diff = 1; /* No STEP, so FAST machine */ } if (i == 0) { printf( " (The resolution is less than the time to read the clock -- Assume 1us)\n"); diff = 1; /* time to read clock >= resolution */ } for (i=0, val=HUSECS; val>0; i--, val >>= 1) if (diff >= val) return i; printf(" (Oh dear -- that wasn't expected ! I'll guess !)\n"); return DEFAULT_SYS_PRECISION /* Something's BUST, so lie ! */; } /* ===== Rest of this code lifted straight from xntpd/ntp_proto.c ! ===== */ /* * This routine calculates the differences between successive calls to * gettimeofday(). If a difference is less than zero, the us field * has rolled over to the next second, so we add a second in us. If * the difference is greater than zero and less than MINSTEP, the * clock has been advanced by a small amount to avoid standing still. * If the clock has advanced by a greater amount, then a timer interrupt * has occurred and this amount represents the precision of the clock. * In order to guard against spurious values, which could occur if we * happen to hit a fat interrupt, we do this for MINLOOPS times and * keep the minimum value obtained. */ int default_get_precision(void) { struct timeval tp; struct timezone tzp; #ifdef HAVE_GETCLOCK struct timespec ts; #endif long last; int i; long diff; long val; long usec; usec = 0; val = MAXSTEP; #ifdef HAVE_GETCLOCK (void) getclock(TIMEOFDAY, &ts); tp.tv_sec = ts.tv_sec; tp.tv_usec = ts.tv_nsec / 1000; #else /* not HAVE_GETCLOCK */ GETTIMEOFDAY(&tp, &tzp); #endif /* not HAVE_GETCLOCK */ last = tp.tv_usec; for (i = 0; i < MINLOOPS && usec < HUSECS;) { #ifdef HAVE_GETCLOCK (void) getclock(TIMEOFDAY, &ts); tp.tv_sec = ts.tv_sec; tp.tv_usec = ts.tv_nsec / 1000; #else /* not HAVE_GETCLOCK */ GETTIMEOFDAY(&tp, &tzp); #endif /* not HAVE_GETCLOCK */ diff = tp.tv_usec - last; last = tp.tv_usec; if (diff < 0) diff += DUSECS; usec += diff; if (diff > MINSTEP) { i++; if (diff < val) val = diff; } } printf("precision = %ld usec after %d loop%s\n", val, i, (i == 1) ? "" : "s"); if (usec >= HUSECS) { printf(" (Boy this machine is fast ! usec was %ld)\n", usec); val = MINSTEP; /* val <= MINSTEP; fast machine */ } diff = HUSECS; for (i = 0; diff > val; i--) diff >>= 1; return (i); } ntp-4.2.6p5/COPYRIGHT0000644000175000017500000002241211510500215013073 0ustar peterpeterThis file is automatically generated from html/copyright.html Copyright Notice jpg "Clone me," says Dolly sheepishly. Last update: 1-Jan-2011 08:34 UTC _________________________________________________________________ The following copyright notice applies to all files collectively called the Network Time Protocol Version 4 Distribution. Unless specifically declared otherwise in an individual file, this notice applies as if the text was explicitly included in the file. *********************************************************************** * * * Copyright (c) University of Delaware 1992-2011 * * * * Permission to use, copy, modify, and distribute this software and * * its documentation for any purpose with or without fee is hereby * * granted, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission * * notice appear in supporting documentation, and that the name * * University of Delaware not be used in advertising or publicity * * pertaining to distribution of the software without specific, * * written prior permission. The University of Delaware makes no * * representations about the suitability this software for any * * purpose. It is provided "as is" without express or implied * * warranty. * * * *********************************************************************** The following individuals contributed in part to the Network Time Protocol Distribution Version 4 and are acknowledged as authors of this work. 1. [1]Takao Abe Clock driver for JJY receivers 2. [2]Mark Andrews Leitch atomic clock controller 3. [3]Bernd Altmeier hopf Elektronik serial line and PCI-bus devices 4. [4]Viraj Bais and [5]Clayton Kirkwood port to WindowsNT 3.5 5. [6]Michael Barone GPSVME fixes 6. [7]Karl Berry syslog to file option 7. [8]Greg Brackley Major rework of WINNT port. Clean up recvbuf and iosignal code into separate modules. 8. [9]Marc Brett Magnavox GPS clock driver 9. [10]Piete Brooks MSF clock driver, Trimble PARSE support 10. [11]Nelson B Bolyard update and complete broadcast and crypto features in sntp 11. [12]Jean-Francois Boudreault IPv6 support 12. [13]Reg Clemens Oncore driver (Current maintainer) 13. [14]Steve Clift OMEGA clock driver 14. [15]Casey Crellin vxWorks (Tornado) port and help with target configuration 15. [16]Sven Dietrich Palisade reference clock driver, NT adj. residuals, integrated Greg's Winnt port. 16. [17]John A. Dundas III Apple A/UX port 17. [18]Torsten Duwe Linux port 18. [19]Dennis Ferguson foundation code for NTP Version 2 as specified in RFC-1119 19. [20]John Hay IPv6 support and testing 20. [21]Dave Hart General maintenance, Windows port interpolation rewrite 21. [22]Claas Hilbrecht NeoClock4X clock driver 22. [23]Glenn Hollinger GOES clock driver 23. [24]Mike Iglesias DEC Alpha port 24. [25]Jim Jagielski A/UX port 25. [26]Jeff Johnson massive prototyping overhaul 26. [27]Hans Lambermont or [28] ntpsweep 27. [29]Poul-Henning Kamp Oncore driver (Original author) 28. [30]Frank Kardel [31] PARSE driver (>14 reference clocks), STREAMS modules for PARSE, support scripts, syslog cleanup, dynamic interface handling 29. [32]William L. Jones RS/6000 AIX modifications, HPUX modifications 30. [33]Dave Katz RS/6000 AIX port 31. [34]Craig Leres 4.4BSD port, ppsclock, Magnavox GPS clock driver 32. [35]George Lindholm SunOS 5.1 port 33. [36]Louis A. Mamakos MD5-based authentication 34. [37]Lars H. Mathiesen adaptation of foundation code for Version 3 as specified in RFC-1305 35. [38]Danny Mayer Network I/O, Windows Port, Code Maintenance 36. [39]David L. Mills Version 4 foundation: clock discipline, authentication, precision kernel; clock drivers: Spectracom, Austron, Arbiter, Heath, ATOM, ACTS, KSI/Odetics; audio clock drivers: CHU, WWV/H, IRIG 37. [40]Wolfgang Moeller VMS port 38. [41]Jeffrey Mogul ntptrace utility 39. [42]Tom Moore i386 svr4 port 40. [43]Kamal A Mostafa SCO OpenServer port 41. [44]Derek Mulcahy and [45]Damon Hart-Davis ARCRON MSF clock driver 42. [46]Rob Neal Bancomm refclock and config/parse code maintenance 43. [47]Rainer Pruy monitoring/trap scripts, statistics file handling 44. [48]Dirce Richards Digital UNIX V4.0 port 45. [49]Wilfredo Sánchez added support for NetInfo 46. [50]Nick Sayer SunOS streams modules 47. [51]Jack Sasportas Saved a Lot of space on the stuff in the html/pic/ subdirectory 48. [52]Ray Schnitzler Unixware1 port 49. [53]Michael Shields USNO clock driver 50. [54]Jeff Steinman Datum PTS clock driver 51. [55]Harlan Stenn GNU automake/autoconfigure makeover, various other bits (see the ChangeLog) 52. [56]Kenneth Stone HP-UX port 53. [57]Ajit Thyagarajan IP multicast/anycast support 54. [58]Tomoaki TSURUOKA TRAK clock driver 55. [59]Paul A Vixie TrueTime GPS driver, generic TrueTime clock driver 56. [60]Ulrich Windl corrected and validated HTML documents according to the HTML DTD _________________________________________________________________ References 1. mailto:%20takao_abe@xurb.jp 2. mailto:%20mark_andrews@isc.org 3. mailto:%20altmeier@atlsoft.de 4. mailto:%20vbais@mailman1.intel.co 5. mailto:%20kirkwood@striderfm.intel.com 6. mailto:%20michael.barone@lmco.com 7. mailto:%20karl@owl.HQ.ileaf.com 8. mailto:%20greg.brackley@bigfoot.com 9. mailto:%20Marc.Brett@westgeo.com 10. mailto:%20Piete.Brooks@cl.cam.ac.uk 11. mailto:%20nelson@bolyard.me 12. mailto:%20Jean-Francois.Boudreault@viagenie.qc.ca 13. mailto:%20reg@dwf.com 14. mailto:%20clift@ml.csiro.au 15. mailto:casey@csc.co.za 16. mailto:%20Sven_Dietrich@trimble.COM 17. mailto:%20dundas@salt.jpl.nasa.gov 18. mailto:%20duwe@immd4.informatik.uni-erlangen.de 19. mailto:%20dennis@mrbill.canet.ca 20. mailto:%20jhay@icomtek.csir.co.za 21. mailto:%20davehart@davehart.com 22. mailto:%20neoclock4x@linum.com 23. mailto:%20glenn@herald.usask.ca 24. mailto:%20iglesias@uci.edu 25. mailto:%20jagubox.gsfc.nasa.gov 26. mailto:%20jbj@chatham.usdesign.com 27. mailto:Hans.Lambermont@nl.origin-it.com 28. mailto:H.Lambermont@chello.nl 29. mailto:%20phk@FreeBSD.ORG 30. http://www4.informatik.uni-erlangen.de/%7ekardel 31. mailto:%20kardel(at)ntp(dot)org 32. mailto:%20jones@hermes.chpc.utexas.edu 33. mailto:%20dkatz@cisco.com 34. mailto:%20leres@ee.lbl.gov 35. mailto:%20lindholm@ucs.ubc.ca 36. mailto:%20louie@ni.umd.edu 37. mailto:%20thorinn@diku.dk 38. mailto:%20mayer@ntp.org 39. mailto:%20mills@udel.edu 40. mailto:%20moeller@gwdgv1.dnet.gwdg.de 41. mailto:%20mogul@pa.dec.com 42. mailto:%20tmoore@fievel.daytonoh.ncr.com 43. mailto:%20kamal@whence.com 44. mailto:%20derek@toybox.demon.co.uk 45. mailto:%20d@hd.org 46. mailto:%20neal@ntp.org 47. mailto:%20Rainer.Pruy@informatik.uni-erlangen.de 48. mailto:%20dirce@zk3.dec.com 49. mailto:%20wsanchez@apple.com 50. mailto:%20mrapple@quack.kfu.com 51. mailto:%20jack@innovativeinternet.com 52. mailto:%20schnitz@unipress.com 53. mailto:%20shields@tembel.org 54. mailto:%20pebbles.jpl.nasa.gov 55. mailto:%20harlan@pfcs.com 56. mailto:%20ken@sdd.hp.com 57. mailto:%20ajit@ee.udel.edu 58. mailto:%20tsuruoka@nc.fukuoka-u.ac.jp 59. mailto:%20vixie@vix.com 60. mailto:%20Ulrich.Windl@rz.uni-regensburg.de ntp-4.2.6p5/compile0000755000175000017500000000717310377564334013213 0ustar peterpeter#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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 2, 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ntp-4.2.6p5/clockstuff/0000755000175000017500000000000011675461365013772 5ustar peterpeterntp-4.2.6p5/clockstuff/propdelay.c0000644000175000017500000002756110441361172016131 0ustar peterpeter/* propdelay.c,v 3.1 1993/07/06 01:05:24 jbj Exp * propdelay - compute propagation delays * * cc -o propdelay propdelay.c -lm * * "Time and Frequency Users' Manual", NBS Technical Note 695 (1977). */ /* * This can be used to get a rough idea of the HF propagation delay * between two points (usually between you and the radio station). * The usage is * * propdelay latitudeA longitudeA latitudeB longitudeB * * where points A and B are the locations in question. You obviously * need to know the latitude and longitude of each of the places. * The program expects the latitude to be preceded by an 'n' or 's' * and the longitude to be preceded by an 'e' or 'w'. It understands * either decimal degrees or degrees:minutes:seconds. Thus to compute * the delay between the WWVH (21:59:26N, 159:46:00W) and WWV (40:40:49N, * 105:02:27W) you could use: * * propdelay n21:59:26 w159:46 n40:40:49 w105:02:27 * * By default it prints out a summer (F2 average virtual height 350 km) and * winter (F2 average virtual height 250 km) number. The results will be * quite approximate but are about as good as you can do with HF time anyway. * You might pick a number between the values to use, or use the summer * value in the summer and switch to the winter value when the static * above 10 MHz starts to drop off in the fall. You can also use the * -h switch if you want to specify your own virtual height. * * You can also do a * * propdelay -W n45:17:47 w75:45:22 * * to find the propagation delays to WWV and WWVH (from CHU in this * case), a * * propdelay -C n40:40:49 w105:02:27 * * to find the delays to CHU, and a * * propdelay -G n52:03:17 w98:34:18 * * to find delays to GOES via each of the three satellites. */ #include #include #include "ntp_stdlib.h" extern double sin (double); extern double cos (double); extern double acos (double); extern double tan (double); extern double atan (double); extern double sqrt (double); #define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0) /* * Program constants */ #define EARTHRADIUS (6370.0) /* raduis of earth (km) */ #define LIGHTSPEED (299800.0) /* speed of light, km/s */ #define PI (3.1415926536) #define RADPERDEG (PI/180.0) /* radians per degree */ #define MILE (1.609344) /* km in a mile */ #define SUMMERHEIGHT (350.0) /* summer height in km */ #define WINTERHEIGHT (250.0) /* winter height in km */ #define SATHEIGHT (6.6110 * 6378.0) /* geosync satellite height in km from centre of earth */ #define WWVLAT "n40:40:49" #define WWVLONG "w105:02:27" #define WWVHLAT "n21:59:26" #define WWVHLONG "w159:46:00" #define CHULAT "n45:17:47" #define CHULONG "w75:45:22" #define GOES_UP_LAT "n37:52:00" #define GOES_UP_LONG "w75:27:00" #define GOES_EAST_LONG "w75:00:00" #define GOES_STBY_LONG "w105:00:00" #define GOES_WEST_LONG "w135:00:00" #define GOES_SAT_LAT "n00:00:00" char *wwvlat = WWVLAT; char *wwvlong = WWVLONG; char *wwvhlat = WWVHLAT; char *wwvhlong = WWVHLONG; char *chulat = CHULAT; char *chulong = CHULONG; char *goes_up_lat = GOES_UP_LAT; char *goes_up_long = GOES_UP_LONG; char *goes_east_long = GOES_EAST_LONG; char *goes_stby_long = GOES_STBY_LONG; char *goes_west_long = GOES_WEST_LONG; char *goes_sat_lat = GOES_SAT_LAT; int hflag = 0; int Wflag = 0; int Cflag = 0; int Gflag = 0; int height; char *progname; volatile int debug; static void doit (double, double, double, double, double, char *); static double latlong (char *, int); static double greatcircle (double, double, double, double); static double waveangle (double, double, int); static double propdelay (double, double, int); static int finddelay (double, double, double, double, double, double *); static void satdoit (double, double, double, double, double, double, char *); static void satfinddelay (double, double, double, double, double *); static double satpropdelay (double); /* * main - parse arguments and handle options */ int main( int argc, char *argv[] ) { int c; int errflg = 0; double lat1, long1; double lat2, long2; double lat3, long3; progname = argv[0]; while ((c = ntp_getopt(argc, argv, "dh:CWG")) != EOF) switch (c) { case 'd': ++debug; break; case 'h': hflag++; height = atof(ntp_optarg); if (height <= 0.0) { (void) fprintf(stderr, "height %s unlikely\n", ntp_optarg); errflg++; } break; case 'C': Cflag++; break; case 'W': Wflag++; break; case 'G': Gflag++; break; default: errflg++; break; } if (errflg || (!(Cflag || Wflag || Gflag) && ntp_optind+4 != argc) || ((Cflag || Wflag || Gflag) && ntp_optind+2 != argc)) { (void) fprintf(stderr, "usage: %s [-d] [-h height] lat1 long1 lat2 long2\n", progname); (void) fprintf(stderr," - or -\n"); (void) fprintf(stderr, "usage: %s -CWG [-d] lat long\n", progname); exit(2); } if (!(Cflag || Wflag || Gflag)) { lat1 = latlong(argv[ntp_optind], 1); long1 = latlong(argv[ntp_optind + 1], 0); lat2 = latlong(argv[ntp_optind + 2], 1); long2 = latlong(argv[ntp_optind + 3], 0); if (hflag) { doit(lat1, long1, lat2, long2, height, ""); } else { doit(lat1, long1, lat2, long2, (double)SUMMERHEIGHT, "summer propagation, "); doit(lat1, long1, lat2, long2, (double)WINTERHEIGHT, "winter propagation, "); } } else if (Wflag) { /* * Compute delay from WWV */ lat1 = latlong(argv[ntp_optind], 1); long1 = latlong(argv[ntp_optind + 1], 0); lat2 = latlong(wwvlat, 1); long2 = latlong(wwvlong, 0); if (hflag) { doit(lat1, long1, lat2, long2, height, "WWV "); } else { doit(lat1, long1, lat2, long2, (double)SUMMERHEIGHT, "WWV summer propagation, "); doit(lat1, long1, lat2, long2, (double)WINTERHEIGHT, "WWV winter propagation, "); } /* * Compute delay from WWVH */ lat2 = latlong(wwvhlat, 1); long2 = latlong(wwvhlong, 0); if (hflag) { doit(lat1, long1, lat2, long2, height, "WWVH "); } else { doit(lat1, long1, lat2, long2, (double)SUMMERHEIGHT, "WWVH summer propagation, "); doit(lat1, long1, lat2, long2, (double)WINTERHEIGHT, "WWVH winter propagation, "); } } else if (Cflag) { lat1 = latlong(argv[ntp_optind], 1); long1 = latlong(argv[ntp_optind + 1], 0); lat2 = latlong(chulat, 1); long2 = latlong(chulong, 0); if (hflag) { doit(lat1, long1, lat2, long2, height, "CHU "); } else { doit(lat1, long1, lat2, long2, (double)SUMMERHEIGHT, "CHU summer propagation, "); doit(lat1, long1, lat2, long2, (double)WINTERHEIGHT, "CHU winter propagation, "); } } else if (Gflag) { lat1 = latlong(goes_up_lat, 1); long1 = latlong(goes_up_long, 0); lat3 = latlong(argv[ntp_optind], 1); long3 = latlong(argv[ntp_optind + 1], 0); lat2 = latlong(goes_sat_lat, 1); long2 = latlong(goes_west_long, 0); satdoit(lat1, long1, lat2, long2, lat3, long3, "GOES Delay via WEST"); long2 = latlong(goes_stby_long, 0); satdoit(lat1, long1, lat2, long2, lat3, long3, "GOES Delay via STBY"); long2 = latlong(goes_east_long, 0); satdoit(lat1, long1, lat2, long2, lat3, long3, "GOES Delay via EAST"); } exit(0); } /* * doit - compute a delay and print it */ static void doit( double lat1, double long1, double lat2, double long2, double h, char *str ) { int hops; double delay; hops = finddelay(lat1, long1, lat2, long2, h, &delay); printf("%sheight %g km, hops %d, delay %g seconds\n", str, h, hops, delay); } /* * latlong - decode a latitude/longitude value */ static double latlong( char *str, int islat ) { register char *cp; register char *bp; double arg; double divby; int isneg; char buf[32]; char *colon; if (islat) { /* * Must be north or south */ if (*str == 'N' || *str == 'n') isneg = 0; else if (*str == 'S' || *str == 's') isneg = 1; else isneg = -1; } else { /* * East is positive, west is negative */ if (*str == 'E' || *str == 'e') isneg = 0; else if (*str == 'W' || *str == 'w') isneg = 1; else isneg = -1; } if (isneg >= 0) str++; colon = strchr(str, ':'); if (colon != NULL) { /* * in hhh:mm:ss form */ cp = str; bp = buf; while (cp < colon) *bp++ = *cp++; *bp = '\0'; cp++; arg = atof(buf); divby = 60.0; colon = strchr(cp, ':'); if (colon != NULL) { bp = buf; while (cp < colon) *bp++ = *cp++; *bp = '\0'; cp++; arg += atof(buf) / divby; divby = 3600.0; } if (*cp != '\0') arg += atof(cp) / divby; } else { arg = atof(str); } if (isneg == 1) arg = -arg; if (debug > 2) (void) printf("latitude/longitude %s = %g\n", str, arg); return arg; } /* * greatcircle - compute the great circle distance in kilometers */ static double greatcircle( double lat1, double long1, double lat2, double long2 ) { double dg; double l1r, l2r; l1r = lat1 * RADPERDEG; l2r = lat2 * RADPERDEG; dg = EARTHRADIUS * acos( (cos(l1r) * cos(l2r) * cos((long2-long1)*RADPERDEG)) + (sin(l1r) * sin(l2r))); if (debug >= 2) printf( "greatcircle lat1 %g long1 %g lat2 %g long2 %g dist %g\n", lat1, long1, lat2, long2, dg); return dg; } /* * waveangle - compute the wave angle for the given distance, virtual * height and number of hops. */ static double waveangle( double dg, double h, int n ) { double theta; double delta; theta = dg / (EARTHRADIUS * (double)(2 * n)); delta = atan((h / (EARTHRADIUS * sin(theta))) + tan(theta/2)) - theta; if (debug >= 2) printf("waveangle dist %g height %g hops %d angle %g\n", dg, h, n, delta / RADPERDEG); return delta; } /* * propdelay - compute the propagation delay */ static double propdelay( double dg, double h, int n ) { double phi; double theta; double td; theta = dg / (EARTHRADIUS * (double)(2 * n)); phi = (PI/2.0) - atan((h / (EARTHRADIUS * sin(theta))) + tan(theta/2)); td = dg / (LIGHTSPEED * sin(phi)); if (debug >= 2) printf("propdelay dist %g height %g hops %d time %g\n", dg, h, n, td); return td; } /* * finddelay - find the propagation delay */ static int finddelay( double lat1, double long1, double lat2, double long2, double h, double *delay ) { double dg; /* great circle distance */ double delta; /* wave angle */ int n; /* number of hops */ dg = greatcircle(lat1, long1, lat2, long2); if (debug) printf("great circle distance %g km %g miles\n", dg, dg/MILE); n = 1; while ((delta = waveangle(dg, h, n)) < 0.0) { if (debug) printf("tried %d hop%s, no good\n", n, n>1?"s":""); n++; } if (debug) printf("%d hop%s okay, wave angle is %g\n", n, n>1?"s":"", delta / RADPERDEG); *delay = propdelay(dg, h, n); return n; } /* * satdoit - compute a delay and print it */ static void satdoit( double lat1, double long1, double lat2, double long2, double lat3, double long3, char *str ) { double up_delay,down_delay; satfinddelay(lat1, long1, lat2, long2, &up_delay); satfinddelay(lat3, long3, lat2, long2, &down_delay); printf("%s, delay %g seconds\n", str, up_delay + down_delay); } /* * satfinddelay - calculate the one-way delay time between a ground station * and a satellite */ static void satfinddelay( double lat1, double long1, double lat2, double long2, double *delay ) { double dg; /* great circle distance */ dg = greatcircle(lat1, long1, lat2, long2); *delay = satpropdelay(dg); } /* * satpropdelay - calculate the one-way delay time between a ground station * and a satellite */ static double satpropdelay( double dg ) { double k1, k2, dist; double theta; double td; theta = dg / (EARTHRADIUS); k1 = EARTHRADIUS * sin(theta); k2 = SATHEIGHT - (EARTHRADIUS * cos(theta)); if (debug >= 2) printf("Theta %g k1 %g k2 %g\n", theta, k1, k2); dist = sqrt(k1*k1 + k2*k2); td = dist / LIGHTSPEED; if (debug >= 2) printf("propdelay dist %g height %g time %g\n", dg, dist, td); return td; } ntp-4.2.6p5/clockstuff/Makefile.in0000644000175000017500000004535411675460275016051 0ustar peterpeter# 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@ EXTRA_PROGRAMS = propdelay$(EXEEXT) chutest$(EXEEXT) clktest$(EXEEXT) DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depsver.mf subdir = clockstuff ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/define_dir.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_cacheversion.m4 \ $(top_srcdir)/m4/ntp_dir_sep.m4 \ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \ $(top_srcdir)/m4/ntp_openssl.m4 \ $(top_srcdir)/m4/ntp_vpathhack.m4 \ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 = PROGRAMS = $(noinst_PROGRAMS) chutest_SOURCES = chutest.c chutest_OBJECTS = chutest.$(OBJEXT) chutest_DEPENDENCIES = ../libntp/libntp.a clktest_SOURCES = clktest.c clktest_OBJECTS = clktest.$(OBJEXT) clktest_DEPENDENCIES = ../libntp/libntp.a propdelay_SOURCES = propdelay.c propdelay_OBJECTS = propdelay.$(OBJEXT) propdelay_DEPENDENCIES = ../libntp/libntp.a DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = chutest.c clktest.c propdelay.c DIST_SOURCES = chutest.c clktest.c propdelay.c ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ 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@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SH = @PATH_SH@ PATH_TEST = @PATH_TEST@ POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CFLAGS = @SNMP_CFLAGS@ SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ SNMP_LIBS = @SNMP_LIBS@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ VERSION = @VERSION@ 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_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@ #AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies AUTOMAKE_OPTIONS = noinst_PROGRAMS = @PROPDELAY@ @CHUTEST@ @CLKTEST@ INCLUDES = -I$(top_srcdir)/include # We need -lm (and perhaps $(COMPAT) for propdelay, -lntp for {chu,clk}test propdelay_LDADD = -lm ../libntp/libntp.a chutest_LDADD = ../libntp/libntp.a clktest_LDADD = ../libntp/libntp.a ETAGS_ARGS = Makefile.am #EXTRA_DIST = TAGS BUILT_SOURCES = .deps-ver CLEANFILES = .deps-ver all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(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 clockstuff/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign clockstuff/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): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list propdelay$(EXEEXT): $(propdelay_OBJECTS) $(propdelay_DEPENDENCIES) @rm -f propdelay$(EXEEXT) $(LINK) $(propdelay_OBJECTS) $(propdelay_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chutest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clktest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propdelay.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # clktest-opts.def wants ../include/copyright.def ../include/homerc.def chutest$(EXEEXT): ../libntp/libntp.a clktest$(EXEEXT): ../libntp/libntp.a $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ chmod ug+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ $(MAKE) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ mkdir $(DEPDIR) && \ case "$(top_builddir)" in \ .) \ ./config.status Makefile depfiles \ ;; \ ..) \ cd .. && \ ./config.status $(subdir)/Makefile depfiles && \ cd $(subdir) \ ;; \ *) \ echo 'Fatal: depsver.mf Automake fragment limited' \ 'to immediate subdirectories.' && \ echo "top_builddir: $(top_builddir)" && \ echo "subdir: $(subdir)" && \ exit 1 \ ;; \ esac && \ echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver @touch $@ # # depsver.mf included in Makefile.am for directories with .deps # # When building in the same directory with sources that change over # time, such as when tracking using bk, the .deps files can become # stale with respect to moved, deleted, or superceded headers. Most # commonly, this would exhibit as make reporting a failure to make a # header file which is no longer in the location given. To address # this issue, we use a deps-ver file which is updated with each change # that breaks old .deps files. A copy of deps-ver is made into # $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present # with different contents than deps-ver, we make clean to ensure all # .o files built before the incompatible change are rebuilt along with # their updated .deps files, then remove $(DEPDIR) and recreate it as # empty stubs. # # It is normal when configured with --disable-dependency-tracking for # the DEPDIR to not have been created. For this reason, we use the # intermediate target .deps-ver, which invokes make recursively if # DEPDIR exists. # # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # # This comment block follows rather than leads the related code so that # it stays with it in the generated Makefile.in and Makefile. # # 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: ntp-4.2.6p5/clockstuff/chutest.c0000644000175000017500000004662110017034522015602 0ustar peterpeter/* chutest.c,v 3.1 1993/07/06 01:05:21 jbj Exp * chutest - test the CHU clock */ #include #include #include #include #include #include #include #include #include "../include/ntp_fp.h" #include "../include/ntp.h" #include "../include/ntp_unixtime.h" #ifdef CHULDISC #ifdef STREAM # ifdef HAVE_SYS_CHUDEFS_H #include #endif #include #endif #endif #ifdef CHULDISC # ifdef HAVE_SYS_CHUDEFS_H #include #endif #endif #ifndef CHULDISC #ifndef STREAM #define NCHUCHARS (10) struct chucode { u_char codechars[NCHUCHARS]; /* code characters */ u_char ncodechars; /* number of code characters */ u_char chustatus; /* not used currently */ struct timeval codetimes[NCHUCHARS]; /* arrival times */ }; #endif #endif #define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0) char *progname; int debug; int dofilter = 0; /* set to 1 when we should run filter algorithm */ int showtimes = 0; /* set to 1 when we should show char arrival times */ int doprocess = 0; /* set to 1 when we do processing analogous to driver */ #ifdef CHULDISC int usechuldisc = 0; /* set to 1 when CHU line discipline should be used */ #endif #ifdef STREAM int usechuldisc = 0; /* set to 1 when CHU line discipline should be used */ #endif struct timeval lasttv; struct chucode chudata; extern u_long ustotslo[]; extern u_long ustotsmid[]; extern u_long ustotshi[]; /* * main - parse arguments and handle options */ int main( int argc, char *argv[] ) { int c; int errflg = 0; extern int ntp_optind; extern char *ntp_optarg; void init_chu(); progname = argv[0]; while ((c = ntp_getopt(argc, argv, "cdfpt")) != EOF) switch (c) { case 'c': #ifdef STREAM usechuldisc = 1; break; #endif #ifdef CHULDISC usechuldisc = 1; break; #endif #ifndef STREAM #ifndef CHULDISC (void) fprintf(stderr, "%s: CHU line discipline not available on this machine\n", progname); exit(2); #endif #endif case 'd': ++debug; break; case 'f': dofilter = 1; break; case 'p': doprocess = 1; case 't': showtimes = 1; break; default: errflg++; break; } if (errflg || ntp_optind+1 != argc) { #ifdef STREAM (void) fprintf(stderr, "usage: %s [-dft] tty_device\n", progname); #endif #ifdef CHULDISC (void) fprintf(stderr, "usage: %s [-dft] tty_device\n", progname); #endif #ifndef STREAM #ifndef CHULDISC (void) fprintf(stderr, "usage: %s [-cdft] tty_device\n", progname); #endif #endif exit(2); } (void) gettimeofday(&lasttv, (struct timezone *)0); c = openterm(argv[ntp_optind]); init_chu(); #ifdef STREAM if (usechuldisc) process_ldisc(c); else #endif #ifdef CHULDISC if (usechuldisc) process_ldisc(c); else #endif process_raw(c); /*NOTREACHED*/ } /* * openterm - open a port to the CHU clock */ int openterm( char *dev ) { int s; struct sgttyb ttyb; if (debug) (void) fprintf(stderr, "Doing open..."); if ((s = open(dev, O_RDONLY, 0777)) < 0) error("open(%s)", dev, ""); if (debug) (void) fprintf(stderr, "open okay\n"); if (debug) (void) fprintf(stderr, "Setting exclusive use..."); if (ioctl(s, TIOCEXCL, (char *)0) < 0) error("ioctl(TIOCEXCL)", "", ""); if (debug) (void) fprintf(stderr, "done\n"); ttyb.sg_ispeed = ttyb.sg_ospeed = B300; ttyb.sg_erase = ttyb.sg_kill = 0; ttyb.sg_flags = EVENP|ODDP|RAW; if (debug) (void) fprintf(stderr, "Setting baud rate et al..."); if (ioctl(s, TIOCSETP, (char *)&ttyb) < 0) error("ioctl(TIOCSETP, raw)", "", ""); if (debug) (void) fprintf(stderr, "done\n"); #ifdef CHULDISC if (usechuldisc) { int ldisc; if (debug) (void) fprintf(stderr, "Switching to CHU ldisc..."); ldisc = CHULDISC; if (ioctl(s, TIOCSETD, (char *)&ldisc) < 0) error("ioctl(TIOCSETD, CHULDISC)", "", ""); if (debug) (void) fprintf(stderr, "okay\n"); } #endif #ifdef STREAM if (usechuldisc) { if (debug) (void) fprintf(stderr, "Poping off streams..."); while (ioctl(s, I_POP, 0) >=0) ; if (debug) (void) fprintf(stderr, "okay\n"); if (debug) (void) fprintf(stderr, "Pushing CHU stream..."); if (ioctl(s, I_PUSH, "chu") < 0) error("ioctl(I_PUSH, \"chu\")", "", ""); if (debug) (void) fprintf(stderr, "okay\n"); } #endif return s; } /* * process_raw - process characters in raw mode */ int process_raw( int s ) { u_char c; int n; struct timeval tv; struct timeval difftv; while ((n = read(s, &c, sizeof(char))) > 0) { (void) gettimeofday(&tv, (struct timezone *)0); if (dofilter) raw_filter((unsigned int)c, &tv); else { difftv.tv_sec = tv.tv_sec - lasttv.tv_sec; difftv.tv_usec = tv.tv_usec - lasttv.tv_usec; if (difftv.tv_usec < 0) { difftv.tv_sec--; difftv.tv_usec += 1000000; } (void) printf("%02x\t%lu.%06lu\t%lu.%06lu\n", c, tv.tv_sec, tv.tv_usec, difftv.tv_sec, difftv.tv_usec); lasttv = tv; } } if (n == 0) { (void) fprintf(stderr, "%s: zero returned on read\n", progname); exit(1); } else error("read()", "", ""); } /* * raw_filter - run the line discipline filter over raw data */ int raw_filter( unsigned int c, struct timeval *tv ) { static struct timeval diffs[10] = { 0 }; struct timeval diff; l_fp ts; void chufilter(); if ((c & 0xf) > 9 || ((c>>4)&0xf) > 9) { if (debug) (void) fprintf(stderr, "character %02x failed BCD test\n"); chudata.ncodechars = 0; return; } if (chudata.ncodechars > 0) { diff.tv_sec = tv->tv_sec - chudata.codetimes[chudata.ncodechars].tv_sec; diff.tv_usec = tv->tv_usec - chudata.codetimes[chudata.ncodechars].tv_usec; if (diff.tv_usec < 0) { diff.tv_sec--; diff.tv_usec += 1000000; } /* if (diff.tv_sec != 0 || diff.tv_usec > 900000) { if (debug) (void) fprintf(stderr, "character %02x failed time test\n"); chudata.ncodechars = 0; return; } */ } chudata.codechars[chudata.ncodechars] = c; chudata.codetimes[chudata.ncodechars] = *tv; if (chudata.ncodechars > 0) diffs[chudata.ncodechars] = diff; if (++chudata.ncodechars == 10) { if (doprocess) { TVTOTS(&chudata.codetimes[NCHUCHARS-1], &ts); ts.l_ui += JAN_1970; chufilter(&chudata, &chudata.codetimes[NCHUCHARS-1]); } else { register int i; for (i = 0; i < chudata.ncodechars; i++) { (void) printf("%x%x\t%lu.%06lu\t%lu.%06lu\n", chudata.codechars[i] & 0xf, (chudata.codechars[i] >>4 ) & 0xf, chudata.codetimes[i].tv_sec, chudata.codetimes[i].tv_usec, diffs[i].tv_sec, diffs[i].tv_usec); } } chudata.ncodechars = 0; } } /* #ifdef CHULDISC*/ /* * process_ldisc - process line discipline */ int process_ldisc( int s ) { struct chucode chu; int n; register int i; struct timeval diff; l_fp ts; void chufilter(); while ((n = read(s, (char *)&chu, sizeof chu)) > 0) { if (n != sizeof chu) { (void) fprintf(stderr, "Expected %d, got %d\n", sizeof chu, n); continue; } if (doprocess) { TVTOTS(&chu.codetimes[NCHUCHARS-1], &ts); ts.l_ui += JAN_1970; chufilter(&chu, &ts); } else { for (i = 0; i < NCHUCHARS; i++) { if (i == 0) diff.tv_sec = diff.tv_usec = 0; else { diff.tv_sec = chu.codetimes[i].tv_sec - chu.codetimes[i-1].tv_sec; diff.tv_usec = chu.codetimes[i].tv_usec - chu.codetimes[i-1].tv_usec; if (diff.tv_usec < 0) { diff.tv_sec--; diff.tv_usec += 1000000; } } (void) printf("%x%x\t%lu.%06lu\t%lu.%06lu\n", chu.codechars[i] & 0xf, (chu.codechars[i]>>4)&0xf, chu.codetimes[i].tv_sec, chu.codetimes[i].tv_usec, diff.tv_sec, diff.tv_usec); } } } if (n == 0) { (void) fprintf(stderr, "%s: zero returned on read\n", progname); exit(1); } else error("read()", "", ""); } /*#endif*/ /* * error - print an error message */ void error( char *fmt, char *s1, char *s2 ) { (void) fprintf(stderr, "%s: ", progname); (void) fprintf(stderr, fmt, s1, s2); (void) fprintf(stderr, ": "); perror(""); exit(1); } /* * Definitions */ #define MAXUNITS 4 /* maximum number of CHU units permitted */ #define CHUDEV "/dev/chu%d" /* device we open. %d is unit number */ #define NCHUCODES 9 /* expect 9 CHU codes per minute */ /* * When CHU is operating optimally we want the primary clock distance * to come out at 300 ms. Thus, peer.distance in the CHU peer structure * is set to 290 ms and we compute delays which are at least 10 ms long. * The following are 290 ms and 10 ms expressed in u_fp format */ #define CHUDISTANCE 0x00004a3d #define CHUBASEDELAY 0x0000028f /* * To compute a quality for the estimate (a pseudo delay) we add a * fixed 10 ms for each missing code in the minute and add to this * the sum of the differences between the remaining offsets and the * estimated sample offset. */ #define CHUDELAYPENALTY 0x0000028f /* * Other constant stuff */ #define CHUPRECISION (-9) /* what the heck */ #define CHUREFID "CHU\0" /* * Default fudge factors */ #define DEFPROPDELAY 0x00624dd3 /* 0.0015 seconds, 1.5 ms */ #define DEFFILTFUDGE 0x000d1b71 /* 0.0002 seconds, 200 us */ /* * Hacks to avoid excercising the multiplier. I have no pride. */ #define MULBY10(x) (((x)<<3) + ((x)<<1)) #define MULBY60(x) (((x)<<6) - ((x)<<2)) /* watch overflow */ #define MULBY24(x) (((x)<<4) + ((x)<<3)) /* * Constants for use when multiplying by 0.1. ZEROPTONE is 0.1 * as an l_fp fraction, NZPOBITS is the number of significant bits * in ZEROPTONE. */ #define ZEROPTONE 0x1999999a #define NZPOBITS 29 /* * The CHU table. This gives the expected time of arrival of each * character after the on-time second and is computed as follows: * The CHU time code is sent at 300 bps. Your average UART will * synchronize at the edge of the start bit and will consider the * character complete at the center of the first stop bit, i.e. * 0.031667 ms later. Thus the expected time of each interrupt * is the start bit time plus 0.031667 seconds. These times are * in chutable[]. To this we add such things as propagation delay * and delay fudge factor. */ #define CHARDELAY 0x081b4e80 static u_long chutable[NCHUCHARS] = { 0x2147ae14 + CHARDELAY, /* 0.130 (exactly) */ 0x2ac08312 + CHARDELAY, /* 0.167 (exactly) */ 0x34395810 + CHARDELAY, /* 0.204 (exactly) */ 0x3db22d0e + CHARDELAY, /* 0.241 (exactly) */ 0x472b020c + CHARDELAY, /* 0.278 (exactly) */ 0x50a3d70a + CHARDELAY, /* 0.315 (exactly) */ 0x5a1cac08 + CHARDELAY, /* 0.352 (exactly) */ 0x63958106 + CHARDELAY, /* 0.389 (exactly) */ 0x6d0e5604 + CHARDELAY, /* 0.426 (exactly) */ 0x76872b02 + CHARDELAY, /* 0.463 (exactly) */ }; /* * Keep the fudge factors separately so they can be set even * when no clock is configured. */ static l_fp propagation_delay; static l_fp fudgefactor; static l_fp offset_fudge; /* * We keep track of the start of the year, watching for changes. * We also keep track of whether the year is a leap year or not. * All because stupid CHU doesn't include the year in the time code. */ static u_long yearstart; /* * Imported from the timer module */ extern u_long current_time; extern struct event timerqueue[]; /* * Time conversion tables imported from the library */ extern u_long ustotslo[]; extern u_long ustotsmid[]; extern u_long ustotshi[]; /* * init_chu - initialize internal chu driver data */ void init_chu(void) { /* * Initialize fudge factors to default. */ propagation_delay.l_ui = 0; propagation_delay.l_uf = DEFPROPDELAY; fudgefactor.l_ui = 0; fudgefactor.l_uf = DEFFILTFUDGE; offset_fudge = propagation_delay; L_ADD(&offset_fudge, &fudgefactor); yearstart = 0; } void chufilter( struct chucode *chuc, l_fp *rtime ) { register int i; register u_long date_ui; register u_long tmp; register u_char *code; int isneg; int imin; int imax; u_long reftime; l_fp off[NCHUCHARS]; l_fp ts; int day, hour, minute, second; static u_char lastcode[NCHUCHARS]; extern u_long calyearstart(); extern char *mfptoa(); void chu_process(); extern char *prettydate(); /* * We'll skip the checks made in the kernel, but assume they've * been done. This means that all characters are BCD and * the intercharacter spacing isn't unreasonable. */ /* * print the code */ for (i = 0; i < NCHUCHARS; i++) printf("%c%c", (chuc->codechars[i] & 0xf) + '0', ((chuc->codechars[i]>>4) & 0xf) + '0'); printf("\n"); /* * Format check. Make sure the two halves match. */ for (i = 0; i < NCHUCHARS/2; i++) if (chuc->codechars[i] != chuc->codechars[i+(NCHUCHARS/2)]) { (void) printf("Bad format, halves don't match\n"); return; } /* * Break out the code into the BCD nibbles. Only need to fiddle * with the first half since both are identical. Note the first * BCD character is the low order nibble, the second the high order. */ code = lastcode; for (i = 0; i < NCHUCHARS/2; i++) { *code++ = chuc->codechars[i] & 0xf; *code++ = (chuc->codechars[i] >> 4) & 0xf; } /* * If the first nibble isn't a 6, we're up the creek */ code = lastcode; if (*code++ != 6) { (void) printf("Bad format, no 6 at start\n"); return; } /* * Collect the day, the hour, the minute and the second. */ day = *code++; day = MULBY10(day) + *code++; day = MULBY10(day) + *code++; hour = *code++; hour = MULBY10(hour) + *code++; minute = *code++; minute = MULBY10(minute) + *code++; second = *code++; second = MULBY10(second) + *code++; /* * Sanity check the day and time. Note that this * only occurs on the 31st through the 39th second * of the minute. */ if (day < 1 || day > 366 || hour > 23 || minute > 59 || second < 31 || second > 39) { (void) printf("Failed date sanity check: %d %d %d %d\n", day, hour, minute, second); return; } /* * Compute seconds into the year. */ tmp = (u_long)(MULBY24((day-1)) + hour); /* hours */ tmp = MULBY60(tmp) + (u_long)minute; /* minutes */ tmp = MULBY60(tmp) + (u_long)second; /* seconds */ /* * Now the fun begins. We demand that the received time code * be within CLOCK_WAYTOOBIG of the receive timestamp, but * there is uncertainty about the year the timestamp is in. * Use the current year start for the first check, this should * work most of the time. */ date_ui = tmp + yearstart; if (date_ui < (rtime->l_ui + CLOCK_WAYTOOBIG) && date_ui > (rtime->l_ui - CLOCK_WAYTOOBIG)) goto codeokay; /* looks good */ /* * Trouble. Next check is to see if the year rolled over and, if * so, try again with the new year's start. */ date_ui = calyearstart(rtime->l_ui); if (date_ui != yearstart) { yearstart = date_ui; date_ui += tmp; (void) printf("time %u, code %u, difference %d\n", date_ui, rtime->l_ui, (long)date_ui-(long)rtime->l_ui); if (date_ui < (rtime->l_ui + CLOCK_WAYTOOBIG) && date_ui > (rtime->l_ui - CLOCK_WAYTOOBIG)) goto codeokay; /* okay this time */ } ts.l_uf = 0; ts.l_ui = yearstart; printf("yearstart %s\n", prettydate(&ts)); printf("received %s\n", prettydate(rtime)); ts.l_ui = date_ui; printf("date_ui %s\n", prettydate(&ts)); /* * Here we know the year start matches the current system * time. One remaining possibility is that the time code * is in the year previous to that of the system time. This * is only worth checking if the receive timestamp is less * than CLOCK_WAYTOOBIG seconds into the new year. */ if ((rtime->l_ui - yearstart) < CLOCK_WAYTOOBIG) { date_ui = tmp + calyearstart(yearstart - CLOCK_WAYTOOBIG); if ((rtime->l_ui - date_ui) < CLOCK_WAYTOOBIG) goto codeokay; } /* * One last possibility is that the time stamp is in the year * following the year the system is in. Try this one before * giving up. */ date_ui = tmp + calyearstart(yearstart + (400*24*60*60)); /* 400 days */ if ((date_ui - rtime->l_ui) >= CLOCK_WAYTOOBIG) { printf("Date hopelessly off\n"); return; /* hopeless, let it sync to other peers */ } codeokay: reftime = date_ui; /* * We've now got the integral seconds part of the time code (we hope). * The fractional part comes from the table. We next compute * the offsets for each character. */ for (i = 0; i < NCHUCHARS; i++) { register u_long tmp2; off[i].l_ui = date_ui; off[i].l_uf = chutable[i]; tmp = chuc->codetimes[i].tv_sec + JAN_1970; TVUTOTSF(chuc->codetimes[i].tv_usec, tmp2); M_SUB(off[i].l_ui, off[i].l_uf, tmp, tmp2); } /* * Here is a *big* problem. What one would normally * do here on a machine with lots of clock bits (say * a Vax or the gizmo board) is pick the most positive * offset and the estimate, since this is the one that * is most likely suffered the smallest interrupt delay. * The trouble is that the low order clock bit on an IBM * RT, which is the machine I had in mind when doing this, * ticks at just under the millisecond mark. This isn't * precise enough. What we can do to improve this is to * average all 10 samples and rely on the second level * filtering to pick the least delayed estimate. Trouble * is, this means we have to divide a 64 bit fixed point * number by 10, a procedure which really sucks. Oh, well. * First compute the sum. */ date_ui = 0; tmp = 0; for (i = 0; i < NCHUCHARS; i++) M_ADD(date_ui, tmp, off[i].l_ui, off[i].l_uf); if (M_ISNEG(date_ui, tmp)) isneg = 1; else isneg = 0; /* * Here is a multiply-by-0.1 optimization that should apply * just about everywhere. If the magnitude of the sum * is less than 9 we don't have to worry about overflow * out of a 64 bit product, even after rounding. */ if (date_ui < 9 || date_ui > 0xfffffff7) { register u_long prod_ui; register u_long prod_uf; prod_ui = prod_uf = 0; /* * This code knows the low order bit in 0.1 is zero */ for (i = 1; i < NZPOBITS; i++) { M_LSHIFT(date_ui, tmp); if (ZEROPTONE & (1<=0 ) ; if (ioctl(fd, I_PUSH, "clk") < 0) { (void) fprintf(stderr, "%s: ioctl(I_PUSH): ", progname); perror(""); exit(1); } if (ioctl(fd, CLK_SETSTR, magic) < 0) { (void) fprintf(stderr, "%s: ioctl(CLK_SETSTR): ", progname); perror(""); exit(1); } #endif (void) gettimeofday(&lasttv, (struct timezone *)0); if (HAVE_OPT(TIMEOUT)) { /* * set non-blocking, async I/O on the descriptor */ iosig = 0; (void) signal(SIGIO, ioready); if (fcntl(fd, F_SETFL, FNDELAY|FASYNC) < 0) { (void) fprintf(stderr, "%s: fcntl(F_SETFL): ", progname); perror(""); exit(1); } /* * Set up the alarm interrupt. */ wasalarmed = 0; (void) signal(SIGALRM, alarming); timeout.tv_sec = OPT_VALUE_TIMEOUT; itimer.it_interval = itimer.it_value = timeout; setitimer(ITIMER_REAL, &itimer, (struct itimerval *)0); doboth(fd); } doioonly(fd); } /* * doboth - handle both I/O and alarms via SIGIO */ int doboth( int fd ) { int n; int sawalarm; int sawiosig; int omask; fd_set fds; struct timeval tvzero; sawalarm = 0; sawiosig = 0; FD_ZERO(&fds); for (;;) { omask = sigblock(BLOCKSIGMASK); if (wasalarmed) { /* alarmed? */ sawalarm = 1; wasalarmed = 0; } if (iosig) { sawiosig = 1; iosig = 0; } if (!sawalarm && !sawiosig) { /* * Nothing to do. Wait for something. */ sigpause(omask); if (wasalarmed) { /* alarmed? */ sawalarm = 1; wasalarmed = 0; } if (iosig) { sawiosig = 1; iosig = 0; } } (void)sigsetmask(omask); if (sawiosig) { do { tvzero.tv_sec = tvzero.tv_usec = 0; FD_SET(fd, &fds); n = select(fd+1, &fds, (fd_set *)0, (fd_set *)0, &tvzero); if (n > 0) doio(fd); } while (n > 0); if (n == -1) { (void) fprintf(stderr, "%s: select: ", progname); perror(""); exit(1); } sawiosig = 0; } if (sawalarm) { doalarm(fd); sawalarm = 0; } } } /* * doioonly - do I/O. This avoids the use of signals */ int doioonly( int fd ) { int n; fd_set fds; FD_ZERO(&fds); for (;;) { FD_SET(fd, &fds); n = select(fd+1, &fds, (fd_set *)0, (fd_set *)0, (struct timeval *)0); if (n > 0) doio(fd); } } /* * doio - read a buffer full of stuff and print it out */ int doio( int fd ) { register char *rp, *rpend; register char *cp; register int i; char raw[512]; struct timeval tv, tvd; int rlen; int ind; char cooked[2049]; static char *digits = "0123456789abcdef"; rlen = read(fd, raw, sizeof(raw)); if (rlen < 0) { (void) fprintf(stderr, "%s: read(): ", progname); perror(""); return; } if (rlen == 0) { (void) printf("Zero length read\n"); return; } cp = cooked; rp = raw; rpend = &raw[rlen]; ind = 0; while (rp < rpend) { ind = 1; if (isprint(*rp)) *cp++ = *rp; else { *cp++ = '<'; *cp++ = digits[((*rp)>>4) & 0xf]; *cp++ = digits[*rp & 0xf]; *cp++ = '>'; } if ( #ifdef CLKLDISC (*rp == (char)magic1 || *rp == (char)magic2) #else ( strchr( magic, *rp) != NULL ) #endif ) { rp++; ind = 0; *cp = '\0'; if ((rpend - rp) < sizeof(struct timeval)) { (void)printf( "Too little data (%d): %s\n", rpend-rp, cooked); return; } tv.tv_sec = 0; for (i = 0; i < 4; i++) { tv.tv_sec <<= 8; tv.tv_sec |= ((long)*rp++) & 0xff; } tv.tv_usec = 0; for (i = 0; i < 4; i++) { tv.tv_usec <<= 8; tv.tv_usec |= ((long)*rp++) & 0xff; } tvd.tv_sec = tv.tv_sec - lasttv.tv_sec; tvd.tv_usec = tv.tv_usec - lasttv.tv_usec; if (tvd.tv_usec < 0) { tvd.tv_usec += 1000000; tvd.tv_sec--; } (void)printf("%lu.%06lu %lu.%06lu %s\n", tv.tv_sec, tv.tv_usec, tvd.tv_sec, tvd.tv_usec, cooked); lasttv = tv; } else { rp++; } } if (ind) { *cp = '\0'; (void)printf("Incomplete data: %s\n", cooked); } } /* * doalarm - send a string out the port, if we have one. */ int doalarm( int fd ) { int n; if (! HAVE_OPT(COMMAND)) return; n = write(fd, cmd, cmdlen); if (n < 0) { (void) fprintf(stderr, "%s: write(): ", progname); perror(""); } else if (n < cmdlen) { (void) printf("Short write (%d bytes, should be %d)\n", n, cmdlen); } } /* * alarming - receive alarm interupt */ void alarming(void) { wasalarmed = 1; } /* * ioready - handle SIGIO interrupt */ void ioready(void) { iosig = 1; } ntp-4.2.6p5/clockstuff/README0000644000175000017500000000232310017034522014626 0ustar peterpeterREADME file for directory ./clockstuff of the NTP Version 4 distribution This directory contains the sources for utility programs designed to support radio clocks. The chutest.c and clktest.c are desgined to test the chu_clk and tty_clk line disciplines and STREAMS modules in the ../kernel directory. These files have been modified to work with either the line disciplines or the STREAMS modules. Be sure to define -DSTREAM if appropriate. These are random bits of things written to help with clocks. You can make things in here by typing one or more of: make propdelay (or `make') make chutest make clktest Propdelay computes high frequency propagation delays, given the longitude and latitude of the transmitter and receiver. Use this for WWV/H and CHU. Don't use it for WWVB (the computation is easier for that). Chutest can be used to input and process data from a CHU modem attached to a serial port. It will use the CHU line discipline (if installed), or raw mode otherwise. This was used to test out the initial reduction algorithms, and may not be up to date. Clktest can be used to test the clock line discipline (CLKLDISC, it must be available), and to take a look at radio clocks attached to a serial port. ntp-4.2.6p5/ltmain.sh0000755000175000017500000105017111564122341013440 0ustar peterpeter # libtool (GNU libtool) 2.4 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4 TIMESTAMP="" package_revision=1.3293 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${EGREP="grep -E"} : ${FGREP="grep -F"} : ${GREP="grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_apped perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 ntp-4.2.6p5/ntpdate/0000755000175000017500000000000011675461363013264 5ustar peterpeterntp-4.2.6p5/ntpdate/ntpdate.h0000644000175000017500000000761611362536523015100 0ustar peterpeter/* * ntpdate.h - declarations for the ntpdate and ntptimeset programs */ #include "ntp_malloc.h" extern void loadservers (char *cfgpath); /* * The server structure is a much simplified version of the * peer structure, for ntpdate's use. Since we always send * in client mode and expect to receive in server mode, this * leaves only a very limited number of things we need to * remember about the server. */ struct server { struct server *next_server; /* next server in build list */ sockaddr_u srcadr; /* address of remote host */ u_char version; /* version to use */ u_char leap; /* leap indicator */ u_char stratum; /* stratum of remote server */ s_char precision; /* server's clock precision */ u_char trust; /* trustability of the filtered data */ u_fp rootdelay; /* distance from primary clock */ u_fp rootdisp; /* peer clock dispersion */ u_int32 refid; /* peer reference ID */ l_fp reftime; /* time of peer's last update */ u_long event_time; /* time for next timeout */ u_long last_xmit; /* time of last transmit */ u_short xmtcnt; /* number of packets transmitted */ u_short rcvcnt; /* number of packets received */ u_char reach; /* reachability, NTP_WINDOW bits */ u_short filter_nextpt; /* index into filter shift register */ s_fp filter_delay[NTP_SHIFT]; /* delay part of shift register */ l_fp filter_offset[NTP_SHIFT]; /* offset part of shift register */ s_fp filter_soffset[NTP_SHIFT]; /* offset in s_fp format, for disp */ u_fp filter_error[NTP_SHIFT]; /* error part of shift register */ l_fp org; /* peer's originate time stamp */ l_fp xmt; /* transmit time stamp */ u_fp delay; /* filter estimated delay */ u_fp dispersion; /* filter estimated dispersion */ l_fp offset; /* filter estimated clock offset */ s_fp soffset; /* fp version of above */ }; /* * ntpdate runs everything on a simple, short timeout. It sends a * packet and sets the timeout (by default, to a small value suitable * for a LAN). If it receives a response it sends another request. * If it times out it shifts zeroes into the filter and sends another * request. * * The timer routine is run often (once every 1/5 second currently) * so that time outs are done with reasonable precision. */ #define TIMER_HZ (5) /* 5 per second */ /* * ntpdate will make a long adjustment using adjtime() if the times * are close, or step the time if the times are farther apart. The * following defines what is "close". */ #define NTPDATE_THRESHOLD (FP_SECOND >> 1) /* 1/2 second */ #define NTP_MAXAGE 86400 /* one day in seconds */ /* * When doing adjustments, ntpdate actually overadjusts (currently * by 50%, though this may change). While this will make it take longer * to reach a steady state condition, it will typically result in * the clock keeping more accurate time, on average. The amount of * overshoot is limited. */ #ifdef NOTNOW #define ADJ_OVERSHOOT 1/2 /* this is hard coded */ #endif /* NOTNOW */ #define ADJ_MAXOVERSHOOT 0x10000000 /* 50 ms as a ts fraction */ /* * Since ntpdate isn't aware of some of the things that normally get * put in an NTP packet, we fix some values. */ #define NTPDATE_PRECISION (-6) /* use this precision */ #define NTPDATE_DISTANCE FP_SECOND /* distance is 1 sec */ #define NTPDATE_DISP FP_SECOND /* so is the dispersion */ #define NTPDATE_REFID (0) /* reference ID to use */ #define PEER_MAXDISP (64*FP_SECOND) /* maximum dispersion (fp 64) */ /* * Some defaults */ #define MINTIMEOUT (2 * TIMER_HZ) /* 2s min. between packets */ #define DEFTIMEOUT MINTIMEOUT /* (to the same server) */ #define DEFSAMPLES 4 /* get 4 samples per server */ #define DEFPRECISION (-5) /* the precision we claim */ #define DEFMAXPERIOD 60 /* maximum time to wait */ #define DEFMINSERVERS 3 /* minimum responding servers */ #define DEFMINVALID 1 /* mimimum servers with valid time */ /* * Define the max number of sockets we can open */ #define MAX_AF 2 ntp-4.2.6p5/ntpdate/Makefile.in0000644000175000017500000005725611675460300015336 0ustar peterpeter# 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@ # we traditionally installed software in bindir, while it should have gone # in sbindir. Now that we offer a choice, look in the "other" installation # subdir to warn folks if there is another version there. 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@ @NTP_BINSUBDIR_IS_BIN_TRUE@bin_PROGRAMS = ntpdate$(EXEEXT) @NTP_BINSUBDIR_IS_BIN_FALSE@sbin_PROGRAMS = ntpdate$(EXEEXT) EXTRA_PROGRAMS = ntptimeset$(EXEEXT) DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/bincheck.mf \ $(top_srcdir)/depsver.mf subdir = ntpdate ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/define_dir.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_cacheversion.m4 \ $(top_srcdir)/m4/ntp_dir_sep.m4 \ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \ $(top_srcdir)/m4/ntp_openssl.m4 \ $(top_srcdir)/m4/ntp_vpathhack.m4 \ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) ntpdate_SOURCES = ntpdate.c ntpdate_OBJECTS = ntpdate.$(OBJEXT) ntpdate_DEPENDENCIES = $(LDADD) am_ntptimeset_OBJECTS = ntptimeset.$(OBJEXT) ntptime_config.$(OBJEXT) ntptimeset_OBJECTS = $(am_ntptimeset_OBJECTS) ntptimeset_LDADD = $(LDADD) ntptimeset_DEPENDENCIES = version.o ../libntp/libntp.a DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = ntpdate.c $(ntptimeset_SOURCES) DIST_SOURCES = ntpdate.c $(ntptimeset_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ 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@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SH = @PATH_SH@ PATH_TEST = @PATH_TEST@ POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CFLAGS = @SNMP_CFLAGS@ SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ SNMP_LIBS = @SNMP_LIBS@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ VERSION = @VERSION@ 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_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 = AUTOMAKE_OPTIONS = BUILT_SOURCES = .deps-ver CLEANFILES = .deps-ver ntptimeset_SOURCES = ntptimeset.c ntptime_config.c AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include # LDADD might need RESLIB and ADJLIB LDADD = version.o ../libntp/libntp.a ntpdate_LDADD = $(LDADD) @LCRYPTO@ DISTCLEANFILES = .version version.c stamp-v noinst_HEADERS = ntpdate.h ETAGS_ARGS = Makefile.am all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf $(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 ntpdate/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign ntpdate/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-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ntpdate$(EXEEXT): $(ntpdate_OBJECTS) $(ntpdate_DEPENDENCIES) @rm -f ntpdate$(EXEEXT) $(LINK) $(ntpdate_OBJECTS) $(ntpdate_LDADD) $(LIBS) ntptimeset$(EXEEXT): $(ntptimeset_OBJECTS) $(ntptimeset_DEPENDENCIES) @rm -f ntptimeset$(EXEEXT) $(LINK) $(ntptimeset_OBJECTS) $(ntptimeset_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntptime_config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntptimeset.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS .MAKE: all check install install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-sbinPROGRAMS $(PROGRAMS): $(LDADD) ../libntp/libntp.a: cd ../libntp && $(MAKE) $(top_srcdir)/version : cd $(top_srcdir) && $(MAKE) version version.o: $(ntpdate_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpdate $(COMPILE) -c version.c install-exec-hook: @case ${BINSUBDIR} in \ bin) ODIR=${sbindir} ;; \ sbin) ODIR=${bindir} ;; \ esac; \ test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \ test ! -f $$ODIR/$$i || echo "*** $$i is also in $$ODIR!"; \ done # $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ chmod ug+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ $(MAKE) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ mkdir $(DEPDIR) && \ case "$(top_builddir)" in \ .) \ ./config.status Makefile depfiles \ ;; \ ..) \ cd .. && \ ./config.status $(subdir)/Makefile depfiles && \ cd $(subdir) \ ;; \ *) \ echo 'Fatal: depsver.mf Automake fragment limited' \ 'to immediate subdirectories.' && \ echo "top_builddir: $(top_builddir)" && \ echo "subdir: $(subdir)" && \ exit 1 \ ;; \ esac && \ echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver @touch $@ # # depsver.mf included in Makefile.am for directories with .deps # # When building in the same directory with sources that change over # time, such as when tracking using bk, the .deps files can become # stale with respect to moved, deleted, or superceded headers. Most # commonly, this would exhibit as make reporting a failure to make a # header file which is no longer in the location given. To address # this issue, we use a deps-ver file which is updated with each change # that breaks old .deps files. A copy of deps-ver is made into # $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present # with different contents than deps-ver, we make clean to ensure all # .o files built before the incompatible change are rebuilt along with # their updated .deps files, then remove $(DEPDIR) and recreate it as # empty stubs. # # It is normal when configured with --disable-dependency-tracking for # the DEPDIR to not have been created. For this reason, we use the # intermediate target .deps-ver, which invokes make recursively if # DEPDIR exists. # # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # # This comment block follows rather than leads the related code so that # it stays with it in the generated Makefile.in and Makefile. # # 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: ntp-4.2.6p5/ntpdate/ntptime_config.c0000644000175000017500000002745410017034572016434 0ustar peterpeter/* * ntptime_config.c * * What follows is a simplified version of the config parsing code * in ntpd/ntp_config.c. We only parse a subset of the configuration * syntax, and don't bother whining about things we don't understand. * */ #ifdef HAVE_CONFIG_H # include #endif #include "ntp_fp.h" #include "ntp.h" #include "ntp_io.h" #include "ntp_unixtime.h" #include "ntp_filegen.h" #include "ntpdate.h" #include "ntp_syslog.h" #include "ntp_stdlib.h" #include #include #include /* * These routines are used to read the configuration file at * startup time. An entry in the file must fit on a single line. * Entries are processed as multiple tokens separated by white space * Lines are considered terminated when a '#' is encountered. Blank * lines are ignored. */ /* * Configuration file name */ #ifndef CONFIG_FILE # ifndef SYS_WINNT # define CONFIG_FILE "/etc/ntp.conf" # else /* SYS_WINNT */ # define CONFIG_FILE "%windir%\\ntp.conf" # define ALT_CONFIG_FILE "%windir%\\ntp.ini" # endif /* SYS_WINNT */ #endif /* not CONFIG_FILE */ /* * * We understand the following configuration entries and defaults. * * peer [ addr ] [ version 3 ] [ key 0 ] [ minpoll 6 ] [ maxpoll 10 ] * server [ addr ] [ version 3 ] [ key 0 ] [ minpoll 6 ] [ maxpoll 10 ] * keys file_name */ #define CONFIG_UNKNOWN 0 #define CONFIG_PEER 1 #define CONFIG_SERVER 2 #define CONFIG_KEYS 8 #define CONF_MOD_VERSION 1 #define CONF_MOD_KEY 2 #define CONF_MOD_MINPOLL 3 #define CONF_MOD_MAXPOLL 4 #define CONF_MOD_PREFER 5 #define CONF_MOD_BURST 6 #define CONF_MOD_SKEY 7 #define CONF_MOD_TTL 8 #define CONF_MOD_MODE 9 /* * Translation table - keywords to function index */ struct keyword { const char *text; int keytype; }; /* * Command keywords */ static struct keyword keywords[] = { { "peer", CONFIG_PEER }, { "server", CONFIG_SERVER }, { "keys", CONFIG_KEYS }, { "", CONFIG_UNKNOWN } }; /* * "peer", "server", "broadcast" modifier keywords */ static struct keyword mod_keywords[] = { { "version", CONF_MOD_VERSION }, { "key", CONF_MOD_KEY }, { "minpoll", CONF_MOD_MINPOLL }, { "maxpoll", CONF_MOD_MAXPOLL }, { "prefer", CONF_MOD_PREFER }, { "burst", CONF_MOD_BURST }, { "autokey", CONF_MOD_SKEY }, { "mode", CONF_MOD_MODE }, /* reference clocks */ { "ttl", CONF_MOD_TTL }, /* NTP peers */ { "", CONFIG_UNKNOWN } }; /* * Limits on things */ #define MAXTOKENS 20 /* 20 tokens on line */ #define MAXLINE 1024 /* maximum length of line */ #define MAXFILENAME 128 /* maximum length of a file name (alloca()?) */ /* * Miscellaneous macros */ #define STRSAME(s1, s2) (*(s1) == *(s2) && strcmp((s1), (s2)) == 0) #define ISEOL(c) ((c) == '#' || (c) == '\n' || (c) == '\0') #define ISSPACE(c) ((c) == ' ' || (c) == '\t') #define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0) /* * Systemwide parameters and flags */ extern struct server **sys_servers; /* the server list */ extern int sys_numservers; /* number of servers to poll */ extern char *key_file; /* * Function prototypes */ static int gettokens P((FILE *, char *, char **, int *)); static int matchkey P((char *, struct keyword *)); static int getnetnum P((const char *num, struct sockaddr_in *addr, int complain)); /* * loadservers - load list of NTP servers from configuration file */ void loadservers( char *cfgpath ) { register int i; int errflg; int peerversion; int minpoll; int maxpoll; /* int ttl; */ int srvcnt; /* u_long peerkey; */ int peerflags; struct sockaddr_in peeraddr; FILE *fp; char line[MAXLINE]; char *(tokens[MAXTOKENS]); int ntokens; int tok; const char *config_file; #ifdef SYS_WINNT char *alt_config_file; LPTSTR temp; char config_file_storage[MAX_PATH]; char alt_config_file_storage[MAX_PATH]; #endif /* SYS_WINNT */ struct server *server, *srvlist; /* * Initialize, initialize */ srvcnt = 0; srvlist = 0; errflg = 0; #ifdef DEBUG debug = 0; #endif /* DEBUG */ #ifndef SYS_WINNT config_file = cfgpath ? cfgpath : CONFIG_FILE; #else if (cfgpath) { config_file = cfgpath; } else { temp = CONFIG_FILE; if (!ExpandEnvironmentStrings((LPCTSTR)temp, (LPTSTR)config_file_storage, (DWORD)sizeof(config_file_storage))) { msyslog(LOG_ERR, "ExpandEnvironmentStrings CONFIG_FILE failed: %m\n"); exit(1); } config_file = config_file_storage; } temp = ALT_CONFIG_FILE; if (!ExpandEnvironmentStrings((LPCTSTR)temp, (LPTSTR)alt_config_file_storage, (DWORD)sizeof(alt_config_file_storage))) { msyslog(LOG_ERR, "ExpandEnvironmentStrings ALT_CONFIG_FILE failed: %m\n"); exit(1); } alt_config_file = alt_config_file_storage; M #endif /* SYS_WINNT */ if ((fp = fopen(FindConfig(config_file), "r")) == NULL) { fprintf(stderr, "getconfig: Couldn't open <%s>\n", FindConfig(config_file)); msyslog(LOG_INFO, "getconfig: Couldn't open <%s>", FindConfig(config_file)); #ifdef SYS_WINNT /* Under WinNT try alternate_config_file name, first NTP.CONF, then NTP.INI */ if ((fp = fopen(FindConfig(alt_config_file), "r")) == NULL) { /* * Broadcast clients can sometimes run without * a configuration file. */ fprintf(stderr, "getconfig: Couldn't open <%s>\n", FindConfig(alt_config_file)); msyslog(LOG_INFO, "getconfig: Couldn't open <%s>", FindConfig(alt_config_file)); return; } #else /* not SYS_WINNT */ return; #endif /* not SYS_WINNT */ } while ((tok = gettokens(fp, line, tokens, &ntokens)) != CONFIG_UNKNOWN) { switch(tok) { case CONFIG_PEER: case CONFIG_SERVER: if (ntokens < 2) { msyslog(LOG_ERR, "No address for %s, line ignored", tokens[0]); break; } if (!getnetnum(tokens[1], &peeraddr, 1)) { /* Resolve now, or lose! */ break; } else { errflg = 0; /* Shouldn't be able to specify multicast */ if (IN_CLASSD(ntohl(peeraddr.sin_addr.s_addr)) || ISBADADR(&peeraddr)) { msyslog(LOG_ERR, "attempt to configure invalid address %s", ntoa(&peeraddr)); break; } } peerversion = NTP_VERSION; minpoll = NTP_MINDPOLL; maxpoll = NTP_MAXDPOLL; /* peerkey = 0; */ peerflags = 0; /* ttl = 0; */ for (i = 2; i < ntokens; i++) switch (matchkey(tokens[i], mod_keywords)) { case CONF_MOD_VERSION: if (i >= ntokens-1) { msyslog(LOG_ERR, "peer/server version requires an argument"); errflg = 1; break; } peerversion = atoi(tokens[++i]); if ((u_char)peerversion > NTP_VERSION || (u_char)peerversion < NTP_OLDVERSION) { msyslog(LOG_ERR, "inappropriate version number %s, line ignored", tokens[i]); errflg = 1; } break; case CONF_MOD_KEY: if (i >= ntokens-1) { msyslog(LOG_ERR, "key: argument required"); errflg = 1; break; } ++i; /* peerkey = (int)atol(tokens[i]); */ peerflags |= FLAG_AUTHENABLE; break; case CONF_MOD_MINPOLL: if (i >= ntokens-1) { msyslog(LOG_ERR, "minpoll: argument required"); errflg = 1; break; } minpoll = atoi(tokens[++i]); if (minpoll < NTP_MINPOLL) minpoll = NTP_MINPOLL; break; case CONF_MOD_MAXPOLL: if (i >= ntokens-1) { msyslog(LOG_ERR, "maxpoll: argument required" ); errflg = 1; break; } maxpoll = atoi(tokens[++i]); if (maxpoll > NTP_MAXPOLL) maxpoll = NTP_MAXPOLL; break; case CONF_MOD_PREFER: peerflags |= FLAG_PREFER; break; case CONF_MOD_BURST: peerflags |= FLAG_BURST; break; case CONF_MOD_SKEY: peerflags |= FLAG_SKEY | FLAG_AUTHENABLE; break; case CONF_MOD_TTL: if (i >= ntokens-1) { msyslog(LOG_ERR, "ttl: argument required"); errflg = 1; break; } ++i; /* ttl = atoi(tokens[i]); */ break; case CONF_MOD_MODE: if (i >= ntokens-1) { msyslog(LOG_ERR, "mode: argument required"); errflg = 1; break; } ++i; /* ttl = atoi(tokens[i]); */ break; case CONFIG_UNKNOWN: errflg = 1; break; } if (minpoll > maxpoll) { msyslog(LOG_ERR, "config error: minpoll > maxpoll"); errflg = 1; } if (errflg == 0) { server = (struct server *)emalloc(sizeof(struct server)); memset((char *)server, 0, sizeof(struct server)); server->srcadr = peeraddr; server->version = peerversion; server->dispersion = PEER_MAXDISP; server->next_server = srvlist; srvlist = server; srvcnt++; } break; case CONFIG_KEYS: if (ntokens >= 2) { key_file = (char *) emalloc(strlen(tokens[1]) + 1); strcpy(key_file, tokens[1]); } break; } } (void) fclose(fp); /* build final list */ sys_numservers = srvcnt; sys_servers = (struct server **) emalloc(sys_numservers * sizeof(struct server *)); for(i=0;inext_server; } } /* * gettokens - read a line and return tokens */ static int gettokens( FILE *fp, char *line, char **tokenlist, int *ntokens ) { register char *cp; register int eol; register int ntok; register int quoted = 0; /* * Find start of first token */ again: while ((cp = fgets(line, MAXLINE, fp)) != NULL) { cp = line; while (ISSPACE(*cp)) cp++; if (!ISEOL(*cp)) break; } if (cp == NULL) { *ntokens = 0; return CONFIG_UNKNOWN; /* hack. Is recognized as EOF */ } /* * Now separate out the tokens */ eol = 0; ntok = 0; while (!eol) { tokenlist[ntok++] = cp; while (!ISEOL(*cp) && (!ISSPACE(*cp) || quoted)) quoted ^= (*cp++ == '"'); if (ISEOL(*cp)) { *cp = '\0'; eol = 1; } else { /* must be space */ *cp++ = '\0'; while (ISSPACE(*cp)) cp++; if (ISEOL(*cp)) eol = 1; } if (ntok == MAXTOKENS) eol = 1; } /* * Return the match */ *ntokens = ntok; ntok = matchkey(tokenlist[0], keywords); if (ntok == CONFIG_UNKNOWN) goto again; return ntok; } /* * matchkey - match a keyword to a list */ static int matchkey( register char *word, register struct keyword *keys ) { for (;;) { if (keys->keytype == CONFIG_UNKNOWN) { return CONFIG_UNKNOWN; } if (STRSAME(word, keys->text)) return keys->keytype; keys++; } } /* * getnetnum - return a net number (this is crude, but careful) */ static int getnetnum( const char *num, struct sockaddr_in *addr, int complain ) { register const char *cp; register char *bp; register int i; register int temp; char buf[80]; /* will core dump on really stupid stuff */ u_int32 netnum; /* XXX ELIMINATE replace with decodenetnum */ cp = num; netnum = 0; for (i = 0; i < 4; i++) { bp = buf; while (isdigit((int)*cp)) *bp++ = *cp++; if (bp == buf) break; if (i < 3) { if (*cp++ != '.') break; } else if (*cp != '\0') break; *bp = '\0'; temp = atoi(buf); if (temp > 255) break; netnum <<= 8; netnum += temp; #ifdef DEBUG if (debug > 3) printf("getnetnum %s step %d buf %s temp %d netnum %lu\n", num, i, buf, temp, (u_long)netnum); #endif } if (i < 4) { if (complain) msyslog(LOG_ERR, "getnetnum: \"%s\" invalid host number, line ignored", num); #ifdef DEBUG if (debug > 3) printf( "getnetnum: \"%s\" invalid host number, line ignored\n", num); #endif return 0; } /* * make up socket address. Clear it out for neatness. */ memset((void *)addr, 0, sizeof(struct sockaddr_in)); addr->sin_family = AF_INET; addr->sin_port = htons(NTP_PORT); addr->sin_addr.s_addr = htonl(netnum); #ifdef DEBUG if (debug > 1) printf("getnetnum given %s, got %s (%lx)\n", num, ntoa(addr), (u_long)netnum); #endif return 1; } ntp-4.2.6p5/ntpdate/ntptimeset.c0000644000175000017500000015003310441361274015614 0ustar peterpeter/* * ntptimeset - get/set the time via ntp * * GOAL: * The goal of ntptime is to set the current time on system startup * to the best possible time using the network very wisely. It is assumed * that after a resonable time has been sett then ntp daemon will * maintain it. * * PROBLEM DOMAIN: * We have three sets of issues related to acheiving the goal. The first * issue is using the network when normal traffic is happening or when * the entire network world is recovering from a campus wide power failure * and is restarting. The second issue is the class of machine whether it * is a user's office workstation being handled by an uneducated user or * a server computer being handled by a trained operations staff. The third * issue is whether the ratio of people to computers and whether the * environment is stable and viable or not. * * NETWORK USAGE: * The first issue of using the network wisely is a question of whether * the network load and time server load and state are normal. If things * are normal ntptime can do what ntpdate does of sending out 4 packets * quickly to each server (new transmit done with each ack). However * if network or time load is high then this scheme will simply contribute * to problems. Given we have minimal state, we simply weight lost packets * significantly and make sure we throttle output as much as possible * without performance lost for quick startups. * * TRAINING AND KNOWLEDGE: * The second issue of uneducated user of a office workstation versus a * trained operation staff of a server machine translates into simply an * issue of untrained and trained users. * * The training issue implies that for the sake of the users involved in the * handling of their office workstation, problems and options should be * communicated simply and effectively and not in terse expert related * descriptions without possible options to be taken. The operator's training * and education enables them to deal with either type of communication and * control. * * AUTOMATION AND MANUAL CONTROL: * The last issue boils down to a design problem. If the design tends to go * into a manual mode when the environment is non-viable then one person * handling many computers all at the same time will be heavily impacted. On * the other hand, if the design tends to be automatic and does not indicate * a way for the user to take over control then the computer will be * unavailable for the user until the proble is resolved by someone else or * the user. * * NOTE: Please do not have this program print out every minute some line, * of output. If this happens and the environment is in trouble then * many pages of paper on many different machines will be filled up. * Save some tress in your lifetime. * * CONCLUSION: * The behavior of the program derived from these three issues should be * that during normal situations it quickly sets the time and allow the * system to startup. * * However during abnormal conditions as detected by unresponsive servers, * out-of-sync or bad responses and other detections, it should print out * a simple but clear message and continue in a mellow way to get the best * possible time. It may never get the time and if so should also indicate * this. * * Rudy Nedved * 18-May-1993 * **************************************************************** * * Much of the above is confusing or no longer relevant. For example, * it is rare these days for a machine's console to be a printing terminal, * so the comment about saving trees doesn't mean much. Nonetheless, * the basic principles still stand: * * - Work automatically, without human control or intervention. To * this end, we use the same configuration file as ntpd itself, so * you don't have to specify servers or other information on the * command line. We also recognize that sometimes we won't be able * to contact any servers, and give up in that event instead of * hanging forever. * * - Behave in a sane way, both internally and externally, even in the * face of insane conditions. That means we back off quickly when * we don't hear a response, to avoid network congestion. Like * ntpd, we verify responses from several servers before accepting * the new time data. * * However, we don't assume that the local clock is right, or even * close, because it might not be at boot time, and we want to catch * and correct that situation. This behaviour has saved us in several * instances. On HP-UX 9.0x, there used to be a bug in adjtimed which * would cause the time to be set to some wild value, making the machine * essentially unusable (we use Kerberos authentication pervasively, * and it requires workstations and servers to have a time within five * minutes of the Kerberos server). We also have problems on PC's * running both Linux and some Microsoft OS -- they tend to disagree * on what the BIOS clock should say, and who should update it, and * when. On those systems, we not only run ntptimeset at boot, we * also reset the BIOS clock based on the result, so the correct * time will be retained across reboots. * * For these reasons, and others, we have continued to use this tool * rather than ntpdate. It is run automatically at boot time on every * workstation and server in our facility. * * In the past, we called this program 'ntptime'. Unfortunately, the * ntp v4 distribution also includes a program with that name. In * order to avoid confusion, we have renamed our program 'ntptimeset', * which more accurately describes what it does. * * Jeffrey T. Hutzelman (N3NHS) * School of Computer Science - Research Computing Facility * Carnegie Mellon University - Pittsburgh, PA * 16-Aug-1999 * */ #ifdef HAVE_CONFIG_H # include #endif #include "ntp_machine.h" #include "ntp_fp.h" #include "ntp.h" #include "ntp_io.h" #include "iosignal.h" #include "ntp_unixtime.h" #include "ntpdate.h" #include "ntp_string.h" #include "ntp_syslog.h" #include "ntp_select.h" #include "ntp_stdlib.h" #ifdef HAVE_UNISTD_H # include #endif #include #include #include #ifndef SYS_WINNT # ifdef HAVE_SYS_SIGNAL_H # include # else # include # endif # include #endif /* SYS_WINNT */ #ifdef HAVE_SYS_RESOURCE_H # include #endif /* HAVE_SYS_RESOURCE_H */ #ifdef SYS_VXWORKS # include "ioLib.h" # include "sockLib.h" # include "timers.h" #endif #include "recvbuff.h" #ifdef SYS_WINNT # define TARGET_RESOLUTION 1 /* Try for 1-millisecond accuracy on Windows NT timers. */ #pragma comment(lib, "winmm") #endif /* SYS_WINNT */ /* * Scheduling priority we run at */ #ifndef SYS_VXWORKS # define NTPDATE_PRIO (-12) #else # define NTPDATE_PRIO (100) #endif #if defined(HAVE_TIMER_SETTIME) || defined (HAVE_TIMER_CREATE) /* POSIX TIMERS - vxWorks doesn't have itimer - casey */ static timer_t ntpdate_timerid; #endif /* * Compatibility stuff for Version 2 */ #define NTP_MAXSKW 0x28f /* 0.01 sec in fp format */ #define NTP_MINDIST 0x51f /* 0.02 sec in fp format */ #define NTP_INFIN 15 /* max stratum, infinity a la Bellman-Ford */ #define NTP_MAXWGT (8*FP_SECOND) /* maximum select weight 8 seconds */ #define NTP_MAXLIST 5 /* maximum select list size */ #define PEER_SHIFT 8 /* 8 suitable for crystal time base */ /* * Debugging flag */ volatile int debug = 0; /* * File descriptor masks etc. for call to select */ int fd; fd_set fdmask; /* * Initializing flag. All async routines watch this and only do their * thing when it is clear. */ int initializing = 1; /* * Alarm flag. Set when an alarm occurs */ volatile int alarm_flag = 0; /* * Set the time if valid time determined */ int set_time = 0; /* * transmission rate control */ #define MINTRANSMITS (3) /* minimum total packets per server */ #define MAXXMITCOUNT (2) /* maximum packets per time interrupt */ /* * time setting constraints */ #define DESIREDDISP (4*FP_SECOND) /* desired dispersion, (fp 4) */ int max_period = DEFMAXPERIOD; int min_servers = DEFMINSERVERS; int min_valid = DEFMINVALID; /* * counters related to time setting constraints */ int contacted = 0; /* # of servers we have sent to */ int responding = 0; /* servers responding */ int validcount = 0; /* servers with valid time */ int valid_n_low = 0; /* valid time servers with low dispersion */ /* * Unpriviledged port flag. */ int unpriv_port = 0; /* * Program name. */ char *progname; /* * Systemwide parameters and flags */ struct server **sys_servers; /* the server list */ int sys_numservers = 0; /* number of servers to poll */ int sys_authenticate = 0; /* true when authenticating */ u_int32 sys_authkey = 0; /* set to authentication key in use */ u_long sys_authdelay = 0; /* authentication delay */ /* * The current internal time */ u_long current_time = 0; /* * File of encryption keys */ #ifndef KEYFILE # ifndef SYS_WINNT #define KEYFILE "/etc/ntp.keys" # else #define KEYFILE "%windir%\\ntp.keys" # endif /* SYS_WINNT */ #endif /* KEYFILE */ #ifndef SYS_WINNT const char *key_file = KEYFILE; #else char key_file_storage[MAX_PATH+1], *key_file ; #endif /* SYS_WINNT */ /* * total packet counts */ u_long total_xmit = 0; u_long total_recv = 0; /* * Miscellaneous flags */ int verbose = 0; #define HORRIBLEOK 3 /* how many packets to let out */ int horrible = 0; /* how many packets we drop for testing */ int secondhalf = 0; /* second half of timeout period */ int printmsg = 0; /* print time response analysis */ /* * The half time and finish time in internal time */ u_long half_time = 0; u_long finish_time = 0; int ntptimesetmain P((int argc, char *argv[])); static void analysis P((int final)); static int have_enough P((void)); static void transmit P((register struct server *server)); static void receive P((struct recvbuf *rbufp)); static void clock_filter P((register struct server *server, s_fp d, l_fp *c)); static void clock_count P((void)); static struct server *clock_select P((void)); static void set_local_clock P((void)); static struct server *findserver P((struct sockaddr_in *addr)); static void timer P((void)); #ifndef SYS_WINNT static RETSIGTYPE alarming P((int sig)); #endif /* SYS_WINNT */ static void init_alarm P((void)); static void init_io P((void)); static int sendpkt P((struct sockaddr_in *dest, struct pkt *pkt, int len)); void input_handler P((l_fp *xts)); static void printserver P((register struct server *pp, FILE *fp)); #if !defined(HAVE_VSPRINTF) int vsprintf P((char *str, const char *fmt, va_list ap)); #endif #ifdef HAVE_SIGNALED_IO extern void wait_for_signal P((void)); extern void unblock_io_and_alarm P((void)); extern void block_io_and_alarm P((void)); #endif #ifdef NO_MAIN_ALLOWED CALL(ntptimeset,"ntptimeset",ntptimesetmain); void clear_globals() { /* * Debugging flag */ debug = 0; ntp_optind = 0; /* * Initializing flag. All async routines watch this and only do their * thing when it is clear. */ initializing = 1; /* * Alarm flag. Set when an alarm occurs */ alarm_flag = 0; /* * Unpriviledged port flag. */ unpriv_port = 0; /* * Systemwide parameters and flags */ sys_numservers = 0; /* number of servers to poll */ sys_authenticate = 0; /* true when authenticating */ sys_authkey = 0; /* set to authentication key in use */ sys_authdelay = 0; /* authentication delay */ /* * The current internal time */ current_time = 0; verbose = 0; } #endif /* NO_MAIN_ALLOWED */ /* * Main program. Initialize us and loop waiting for I/O and/or * timer expiries. */ #ifndef NO_MAIN_ALLOWED int main( int argc, char *argv[] ) { return ntptimesetmain(argc, argv); } #endif /* NO_MAIN_ALLOWED */ int ntptimesetmain( int argc, char *argv[] ) { int was_alarmed; int tot_recvbufs; struct recvbuf *rbuf; l_fp tmp; int errflg; int c; extern char *ntp_optarg; extern int ntp_optind; int ltmp; char *cfgpath; #ifdef SYS_WINNT HANDLE process_handle; wVersionRequested = MAKEWORD(1,1); if (WSAStartup(wVersionRequested, &wsaData)) { msyslog(LOG_ERR, "No useable winsock.dll: %m"); exit(1); } #endif /* SYS_WINNT */ #ifdef NO_MAIN_ALLOWED clear_globals(); #endif errflg = 0; cfgpath = 0; progname = argv[0]; syslogit = 0; /* * Decode argument list */ while ((c = ntp_getopt(argc, argv, "a:c:de:slt:uvHS:V:")) != EOF) switch (c) { case 'a': c = atoi(ntp_optarg); sys_authenticate = 1; sys_authkey = c; break; case 'c': cfgpath = ntp_optarg; break; case 'd': ++debug; break; case 'e': if (!atolfp(ntp_optarg, &tmp) || tmp.l_ui != 0) { (void) fprintf(stderr, "%s: encryption delay %s is unlikely\n", progname, ntp_optarg); errflg++; } else { sys_authdelay = tmp.l_uf; } break; case 's': set_time = 1; break; case 'l': syslogit = 1; break; case 't': ltmp = atoi(ntp_optarg); if (ltmp <= 0) { (void) fprintf(stderr, "%s: maximum time period (%d) is invalid\n", progname, ltmp); errflg++; } else max_period = ltmp; break; case 'u': unpriv_port = 1; break; case 'v': ++verbose; break; case 'H': horrible++; break; case 'S': ltmp = atoi(ntp_optarg); if (ltmp <= 0) { (void) fprintf(stderr, "%s: minimum responding (%d) is invalid\n", progname, ltmp); errflg++; } else min_servers = ltmp; break; case 'V': ltmp = atoi(ntp_optarg); if (ltmp <= 0) { (void) fprintf(stderr, "%s: minimum valid (%d) is invalid\n", progname, ltmp); errflg++; } else min_valid = ltmp; break; case '?': ++errflg; break; default: break; } if (errflg || ntp_optind < argc) { fprintf(stderr,"usage: %s [switches...]\n",progname); fprintf(stderr," -v (verbose)\n"); fprintf(stderr," -c path (set config file path)\n"); fprintf(stderr," -a key (authenticate using key)\n"); fprintf(stderr," -e delay (authentication delay)\n"); fprintf(stderr," -S num (# of servers that must respond)\n"); fprintf(stderr," -V num (# of servers that must valid)\n"); fprintf(stderr," -s (set the time based if okay)\n"); fprintf(stderr," -t secs (time period before ending)\n"); fprintf(stderr," -l (use syslog facility)\n"); fprintf(stderr," -u (use unprivileged port)\n"); fprintf(stderr," -H (drop packets for debugging)\n"); fprintf(stderr," -d (debug output)\n"); exit(2); } /* * Logging. Open the syslog if we have to */ if (syslogit) { #if !defined (SYS_WINNT) && !defined (SYS_VXWORKS) && !defined SYS_CYGWIN32 # ifndef LOG_DAEMON openlog("ntptimeset", LOG_PID); # else # ifndef LOG_NTP # define LOG_NTP LOG_DAEMON # endif openlog("ntptimeset", LOG_PID | LOG_NDELAY, LOG_NTP); if (debug) setlogmask(LOG_UPTO(LOG_DEBUG)); else setlogmask(LOG_UPTO(LOG_INFO)); # endif /* LOG_DAEMON */ #endif /* SYS_WINNT */ } if (debug || verbose) msyslog(LOG_INFO, "%s", Version); if (horrible) msyslog(LOG_INFO, "Dropping %d out of %d packets", horrible,horrible+HORRIBLEOK); /* * Add servers we are going to be polling */ loadservers(cfgpath); if (sys_numservers < min_servers) { msyslog(LOG_ERR, "Found %d servers, require %d servers", sys_numservers,min_servers); exit(2); } /* * determine when we will end at least */ finish_time = max_period * TIMER_HZ; half_time = finish_time >> 1; /* * Initialize the time of day routines and the I/O subsystem */ if (sys_authenticate) { init_auth(); #ifdef SYS_WINNT if (!key_file) key_file = KEYFILE; if (!ExpandEnvironmentStrings(key_file, key_file_storage, MAX_PATH)) { msyslog(LOG_ERR, "ExpandEnvironmentStrings(%s) failed: %m\n", key_file); } else { key_file = key_file_storage; } #endif /* SYS_WINNT */ if (!authreadkeys(key_file)) { msyslog(LOG_ERR, "no key file, exiting"); exit(1); } if (!authistrusted(sys_authkey)) { char buf[10]; (void) sprintf(buf, "%lu", (unsigned long)sys_authkey); msyslog(LOG_ERR, "authentication key %s unknown", buf); exit(1); } } init_io(); init_alarm(); /* * Set the priority. */ #ifdef SYS_VXWORKS taskPrioritySet( taskIdSelf(), NTPDATE_PRIO); #endif #if defined(HAVE_ATT_NICE) nice (NTPDATE_PRIO); #endif #if defined(HAVE_BSD_NICE) (void) setpriority(PRIO_PROCESS, 0, NTPDATE_PRIO); #endif #ifdef SYS_WINNT process_handle = GetCurrentProcess(); if (!SetPriorityClass(process_handle, (DWORD) REALTIME_PRIORITY_CLASS)) { msyslog(LOG_ERR, "SetPriorityClass failed: %m"); } #endif /* SYS_WINNT */ initializing = 0; /* * Use select() on all on all input fd's for unlimited * time. select() will terminate on SIGALARM or on the * reception of input. Using select() means we can't do * robust signal handling and we get a potential race * between checking for alarms and doing the select(). * Mostly harmless, I think. * Keep going until we have enough information, or time is up. */ /* On VMS, I suspect that select() can't be interrupted * by a "signal" either, so I take the easy way out and * have select() time out after one second. * System clock updates really aren't time-critical, * and - lacking a hardware reference clock - I have * yet to learn about anything else that is. */ was_alarmed = 0; while (finish_time > current_time) { #if !defined(HAVE_SIGNALED_IO) fd_set rdfdes; int nfound; #elif defined(HAVE_SIGNALED_IO) block_io_and_alarm(); #endif tot_recvbufs = full_recvbuffs(); /* get received buffers */ if (printmsg) { printmsg = 0; analysis(0); } if (alarm_flag) { /* alarmed? */ was_alarmed = 1; alarm_flag = 0; } if (!was_alarmed && tot_recvbufs > 0) { /* * Nothing to do. Wait for something. */ #ifndef HAVE_SIGNALED_IO rdfdes = fdmask; # if defined(VMS) || defined(SYS_VXWORKS) /* make select() wake up after one second */ { struct timeval t1; t1.tv_sec = 1; t1.tv_usec = 0; nfound = select(fd+1, &rdfdes, (fd_set *)0, (fd_set *)0, &t1); } # else nfound = select(fd+1, &rdfdes, (fd_set *)0, (fd_set *)0, (struct timeval *)0); # endif /* VMS */ if (nfound > 0) { l_fp ts; get_systime(&ts); (void)input_handler(&ts); } else if (nfound == -1 && errno != EINTR) msyslog(LOG_ERR, "select() error: %m"); else if (debug) { # if !defined SYS_VXWORKS && !defined SYS_CYGWIN32 /* to unclutter log */ msyslog(LOG_DEBUG, "select(): nfound=%d, error: %m", nfound); # endif } #else /* HAVE_SIGNALED_IO */ wait_for_signal(); #endif /* HAVE_SIGNALED_IO */ if (alarm_flag) /* alarmed? */ { was_alarmed = 1; alarm_flag = 0; } tot_recvbufs = full_recvbuffs(); /* get received buffers */ } #ifdef HAVE_SIGNALED_IO unblock_io_and_alarm(); #endif /* HAVE_SIGNALED_IO */ /* * Out here, signals are unblocked. Call timer routine * to process expiry. */ if (was_alarmed) { timer(); was_alarmed = 0; } /* * Call the data procedure to handle each received * packet. */ rbuf = get_full_recv_buffer(); while (rbuf != NULL) { receive(rbuf); freerecvbuf(rbuf); rbuf = get_full_recv_buffer(); } /* * Do we have enough information to stop now? */ if (have_enough()) break; /* time to end */ /* * Go around again */ } /* * adjust the clock and exit accordingly */ set_local_clock(); /* * if we get here then we are in trouble */ return(1); } /* * analysis - print a message indicating what is happening with time service * must mimic have_enough() procedure. */ static void analysis( int final ) { if (contacted < sys_numservers) { printf("%d servers of %d have been probed with %d packets\n", contacted,sys_numservers,MINTRANSMITS); return; } if (!responding) { printf("No response from any of %d servers, network problem?\n", sys_numservers); return; } else if (responding < min_servers) { printf("%d servers out of %d responding, need at least %d.\n", responding, sys_numservers, min_servers); return; } if (!validcount) { printf("%d servers responding but none have valid time\n", responding); return; } else if (validcount < min_valid) { printf("%d servers responding, %d are valid, need %d valid\n", responding,validcount,min_valid); return; } if (!final && valid_n_low != validcount) { printf("%d valid servers but only %d have low dispersion\n", validcount,valid_n_low); return; } } /* have_enough - see if we have enough information to terminate probing */ static int have_enough(void) { /* have we contacted all servers yet? */ if (contacted < sys_numservers) return 0; /* no...try some more */ /* have we got at least minimum servers responding? */ if (responding < min_servers) return 0; /* no...try some more */ /* count the clocks */ (void) clock_count(); /* have we got at least minimum valid clocks? */ if (validcount <= 0 || validcount < min_valid) return 0; /* no...try some more */ /* do we have all valid servers with low dispersion */ if (!secondhalf && valid_n_low != validcount) return 0; /* if we get into the secondhalf then we ignore dispersion */ /* all conditions have been met...end */ return 1; } /* * transmit - transmit a packet to the given server, or mark it completed. * This is called by the timeout routine and by the receive * procedure. */ static void transmit( register struct server *server ) { struct pkt xpkt; int timeout; if (debug > 2) printf("transmit(%s)\n", ntoa(&server->srcadr)); if ((server->reach & 01) == 0) { l_fp ts; /* * Last message to this server timed out. Shift * zeros into the filter. */ L_CLR(&ts); clock_filter(server, 0, &ts); } /* * shift reachable register over */ server->reach <<= 1; /* * If we're here, send another message to the server. Fill in * the packet and let 'er rip. */ xpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC, server->version, MODE_CLIENT); xpkt.stratum = STRATUM_TO_PKT(STRATUM_UNSPEC); xpkt.ppoll = NTP_MINPOLL; xpkt.precision = NTPDATE_PRECISION; xpkt.rootdelay = htonl(NTPDATE_DISTANCE); xpkt.rootdispersion = htonl(NTPDATE_DISP); xpkt.refid = htonl(NTPDATE_REFID); L_CLR(&xpkt.reftime); L_CLR(&xpkt.org); L_CLR(&xpkt.rec); /* * Determine whether to authenticate or not. If so, * fill in the extended part of the packet and do it. * If not, just timestamp it and send it away. */ if (sys_authenticate) { int len; xpkt.exten[0] = htonl(sys_authkey); get_systime(&server->xmt); L_ADDUF(&server->xmt, sys_authdelay); HTONL_FP(&server->xmt, &xpkt.xmt); len = authencrypt(sys_authkey, (u_int32 *)&xpkt, LEN_PKT_NOMAC); if (sendpkt(&(server->srcadr), &xpkt, (int)(LEN_PKT_NOMAC + len))) { if (debug > 1) printf("failed transmit auth to %s\n", ntoa(&(server->srcadr))); return; } if (debug > 1) printf("transmit auth to %s\n", ntoa(&(server->srcadr))); } else { get_systime(&(server->xmt)); HTONL_FP(&server->xmt, &xpkt.xmt); if (sendpkt(&(server->srcadr), &xpkt, LEN_PKT_NOMAC)) { if (debug > 1) printf("failed transmit to %s\n", ntoa(&(server->srcadr))); return; } if (debug > 1) printf("transmit to %s\n", ntoa(&(server->srcadr))); } /* * count transmits, record contacted count and set transmit time */ if (++server->xmtcnt == MINTRANSMITS) contacted++; server->last_xmit = current_time; /* * determine timeout for this packet. The more packets we send * to the host, the slower we get. If the host indicates that * it is not "sane" then we expect even less. */ if (server->xmtcnt < MINTRANSMITS) { /* we have not sent enough */ timeout = TIMER_HZ; /* 1 second probe */ } else if (server->rcvcnt <= 0) { /* we have heard nothing */ if (secondhalf) timeout = TIMER_HZ<<4; /* 16 second probe */ else timeout = TIMER_HZ<<3; /* 8 second probe */ } else { /* if we have low dispersion then probe infrequently */ if (server->dispersion <= DESIREDDISP) timeout = TIMER_HZ<<4; /* 16 second probe */ /* if the server is not in sync then let it alone */ else if (server->leap == LEAP_NOTINSYNC) timeout = TIMER_HZ<<4; /* 16 second probe */ /* if the server looks broken ignore it */ else if (server->org.l_ui < server->reftime.l_ui) timeout = TIMER_HZ<<5; /* 32 second probe */ else if (secondhalf) timeout = TIMER_HZ<<2; /* 4 second probe */ else timeout = TIMER_HZ<<1; /* 2 second probe */ } /* * set next transmit time based on timeout */ server->event_time = current_time + timeout; } /* * receive - receive and process an incoming frame */ static void receive( struct recvbuf *rbufp ) { register struct pkt *rpkt; register struct server *server; register s_fp di; l_fp t10, t23; l_fp org; l_fp rec; l_fp ci; int has_mac; int is_authentic; if (debug > 2) printf("receive(%s)\n", ntoa(&rbufp->srcadr)); /* * Check to see if the packet basically looks like something * intended for us. */ if (rbufp->recv_length == LEN_PKT_NOMAC) has_mac = 0; else if (rbufp->recv_length >= LEN_PKT_NOMAC) has_mac = 1; else { if (debug > 2) printf("receive: packet length %d\n", rbufp->recv_length); return; /* funny length packet */ } rpkt = &(rbufp->recv_pkt); if (PKT_VERSION(rpkt->li_vn_mode) < NTP_OLDVERSION || PKT_VERSION(rpkt->li_vn_mode) > NTP_VERSION) { if (debug > 1) printf("receive: bad version %d\n", PKT_VERSION(rpkt->li_vn_mode)); return; } if ((PKT_MODE(rpkt->li_vn_mode) != MODE_SERVER && PKT_MODE(rpkt->li_vn_mode) != MODE_PASSIVE) || rpkt->stratum >=STRATUM_UNSPEC) { if (debug > 1) printf("receive: mode %d stratum %d\n", PKT_MODE(rpkt->li_vn_mode), rpkt->stratum); return; } /* * So far, so good. See if this is from a server we know. */ server = findserver(&(rbufp->srcadr)); if (server == NULL) { if (debug > 1) printf("receive: server not found\n"); return; } /* * Decode the org timestamp and make sure we're getting a response * to our last request. */ NTOHL_FP(&rpkt->org, &org); if (!L_ISEQU(&org, &server->xmt)) { if (debug > 1) printf("receive: pkt.org and peer.xmt differ\n"); return; } /* * Check out the authenticity if we're doing that. */ if (!sys_authenticate) is_authentic = 1; else { is_authentic = 0; if (debug > 3) printf("receive: rpkt keyid=%ld sys_authkey=%ld decrypt=%ld\n", (long int)ntohl(rpkt->exten[0]), (long int)sys_authkey, (long int)authdecrypt(sys_authkey, (u_int32 *)rpkt, LEN_PKT_NOMAC, (int)(rbufp->recv_length - LEN_PKT_NOMAC))); if (has_mac && ntohl(rpkt->exten[0]) == sys_authkey && authdecrypt(sys_authkey, (u_int32 *)rpkt, LEN_PKT_NOMAC, (int)(rbufp->recv_length - LEN_PKT_NOMAC))) is_authentic = 1; if (debug) printf("receive: authentication %s\n", is_authentic ? "passed" : "failed"); } server->trust <<= 1; if (!is_authentic) server->trust |= 1; /* * Looks good. Record info from the packet. */ server->leap = PKT_LEAP(rpkt->li_vn_mode); server->stratum = PKT_TO_STRATUM(rpkt->stratum); server->precision = rpkt->precision; server->rootdelay = ntohl(rpkt->rootdelay); server->rootdispersion = ntohl(rpkt->rootdispersion); server->refid = rpkt->refid; NTOHL_FP(&rpkt->reftime, &server->reftime); NTOHL_FP(&rpkt->rec, &rec); NTOHL_FP(&rpkt->xmt, &server->org); /* * count this guy as responding */ server->reach |= 1; if (server->rcvcnt++ == 0) responding++; /* * Make sure the server is at least somewhat sane. If not, ignore * it for later. */ if (L_ISZERO(&rec) || !L_ISHIS(&server->org, &rec)) { if (debug > 1) printf("receive: pkt insane\n"); return; } /* * Calculate the round trip delay (di) and the clock offset (ci). * We use the equations (reordered from those in the spec): * * d = (t2 - t3) - (t1 - t0) * c = ((t2 - t3) + (t1 - t0)) / 2 */ t10 = server->org; /* pkt.xmt == t1 */ L_SUB(&t10, &rbufp->recv_time); /* recv_time == t0*/ t23 = rec; /* pkt.rec == t2 */ L_SUB(&t23, &org); /* pkt->org == t3 */ /* now have (t2 - t3) and (t0 - t1). Calculate (ci) and (di) */ ci = t10; L_ADD(&ci, &t23); L_RSHIFT(&ci); /* * Calculate di in t23 in full precision, then truncate * to an s_fp. */ L_SUB(&t23, &t10); di = LFPTOFP(&t23); if (debug > 3) printf("offset: %s, delay %s\n", lfptoa(&ci, 6), fptoa(di, 5)); di += (FP_SECOND >> (-(int)NTPDATE_PRECISION)) + (FP_SECOND >> (-(int)server->precision)) + NTP_MAXSKW; if (di <= 0) { /* value still too raunchy to use? */ L_CLR(&ci); di = 0; } else { di = max(di, NTP_MINDIST); } /* * This one is valid. Give it to clock_filter(), */ clock_filter(server, di, &ci); if (debug > 1) printf("receive from %s\n", ntoa(&rbufp->srcadr)); /* * See if we should goes the transmission. If not return now * otherwise have the next event time be shortened */ if (server->stratum <= NTP_INFIN) return; /* server does not have a stratum */ if (server->leap == LEAP_NOTINSYNC) return; /* just booted server or out of sync */ if (!L_ISHIS(&server->org, &server->reftime)) return; /* broken host */ if (server->trust != 0) return; /* can not trust it */ if (server->dispersion < DESIREDDISP) return; /* we have the desired dispersion */ server->event_time -= (TIMER_HZ+1); } /* * clock_filter - add clock sample, determine a server's delay, dispersion * and offset */ static void clock_filter( register struct server *server, s_fp di, l_fp *c ) { register int i, j; int ord[NTP_SHIFT]; /* * Insert sample and increment nextpt */ i = server->filter_nextpt; server->filter_delay[i] = di; server->filter_offset[i] = *c; server->filter_soffset[i] = LFPTOFP(c); server->filter_nextpt++; if (server->filter_nextpt >= NTP_SHIFT) server->filter_nextpt = 0; /* * Sort indices into increasing delay order */ for (i = 0; i < NTP_SHIFT; i++) ord[i] = i; for (i = 0; i < (NTP_SHIFT-1); i++) { for (j = i+1; j < NTP_SHIFT; j++) { if (server->filter_delay[ord[j]] == 0) continue; if (server->filter_delay[ord[i]] == 0 || (server->filter_delay[ord[i]] > server->filter_delay[ord[j]])) { register int tmp; tmp = ord[i]; ord[i] = ord[j]; ord[j] = tmp; } } } /* * Now compute the dispersion, and assign values to delay and * offset. If there are no samples in the register, delay and * offset go to zero and dispersion is set to the maximum. */ if (server->filter_delay[ord[0]] == 0) { server->delay = 0; L_CLR(&server->offset); server->soffset = 0; server->dispersion = PEER_MAXDISP; } else { register s_fp d; server->delay = server->filter_delay[ord[0]]; server->offset = server->filter_offset[ord[0]]; server->soffset = LFPTOFP(&server->offset); server->dispersion = 0; for (i = 1; i < NTP_SHIFT; i++) { if (server->filter_delay[ord[i]] == 0) d = PEER_MAXDISP; else { d = server->filter_soffset[ord[i]] - server->filter_soffset[ord[0]]; if (d < 0) d = -d; if (d > PEER_MAXDISP) d = PEER_MAXDISP; } /* * XXX This *knows* PEER_FILTER is 1/2 */ server->dispersion += (u_fp)(d) >> i; } } /* * We're done */ } /* clock_count - count the clock sources we have */ static void clock_count(void) { register struct server *server; register int n; /* reset counts */ validcount = valid_n_low = 0; /* go through the list of servers and count the clocks we believe * and that have low dispersion */ for (n = 0; n < sys_numservers; n++) { server = sys_servers[n]; if (server->delay == 0) { continue; /* no data */ } if (server->stratum > NTP_INFIN) { continue; /* stratum no good */ } if (server->delay > NTP_MAXWGT) { continue; /* too far away */ } if (server->leap == LEAP_NOTINSYNC) continue; /* he's in trouble */ if (!L_ISHIS(&server->org, &server->reftime)) { continue; /* very broken host */ } if ((server->org.l_ui - server->reftime.l_ui) >= NTP_MAXAGE) { continue; /* too long without sync */ } if (server->trust != 0) { continue; } /* * This one is a valid time source.. */ validcount++; /* * See if this one has a okay low dispersion */ if (server->dispersion <= DESIREDDISP) valid_n_low++; } if (debug > 1) printf("have %d, valid %d, low %d\n", responding, validcount, valid_n_low); } /* * clock_select - select the pick-of-the-litter clock from the samples * we've got. */ static struct server * clock_select(void) { register struct server *server; register int i; register int nlist; register s_fp d; register int j; register int n; s_fp local_threshold; struct server *server_list[NTP_MAXCLOCK]; u_fp server_badness[NTP_MAXCLOCK]; struct server *sys_server; /* * This first chunk of code is supposed to go through all * servers we know about to find the NTP_MAXLIST servers which * are most likely to succeed. We run through the list * doing the sanity checks and trying to insert anyone who * looks okay. We are at all times aware that we should * only keep samples from the top two strata and we only need * NTP_MAXLIST of them. */ nlist = 0; /* none yet */ for (n = 0; n < sys_numservers; n++) { server = sys_servers[n]; if (server->delay == 0) continue; /* no data */ if (server->stratum > NTP_INFIN) continue; /* stratum no good */ if (server->delay > NTP_MAXWGT) { continue; /* too far away */ } if (server->leap == LEAP_NOTINSYNC) continue; /* he's in trouble */ if (!L_ISHIS(&server->org, &server->reftime)) { continue; /* very broken host */ } if ((server->org.l_ui - server->reftime.l_ui) >= NTP_MAXAGE) { continue; /* too long without sync */ } if (server->trust != 0) { continue; } /* * This one seems sane. Find where he belongs * on the list. */ d = server->dispersion + server->dispersion; for (i = 0; i < nlist; i++) if (server->stratum <= server_list[i]->stratum) break; for ( ; i < nlist; i++) { if (server->stratum < server_list[i]->stratum) break; if (d < (s_fp) server_badness[i]) break; } /* * If i points past the end of the list, this * guy is a loser, else stick him in. */ if (i >= NTP_MAXLIST) continue; for (j = nlist; j > i; j--) if (j < NTP_MAXLIST) { server_list[j] = server_list[j-1]; server_badness[j] = server_badness[j-1]; } server_list[i] = server; server_badness[i] = d; if (nlist < NTP_MAXLIST) nlist++; } /* * Got the five-or-less best. Cut the list where the number of * strata exceeds two. */ j = 0; for (i = 1; i < nlist; i++) if (server_list[i]->stratum > server_list[i-1]->stratum) if (++j == 2) { nlist = i; break; } /* * Whew! What we should have by now is 0 to 5 candidates for * the job of syncing us. If we have none, we're out of luck. * If we have one, he's a winner. If we have more, do falseticker * detection. */ if (nlist == 0) sys_server = 0; else if (nlist == 1) { sys_server = server_list[0]; } else { /* * Re-sort by stratum, bdelay estimate quality and * server.delay. */ for (i = 0; i < nlist-1; i++) for (j = i+1; j < nlist; j++) { if (server_list[i]->stratum < server_list[j]->stratum) break; /* already sorted by stratum */ if (server_list[i]->delay < server_list[j]->delay) continue; server = server_list[i]; server_list[i] = server_list[j]; server_list[j] = server; } /* * Calculate the fixed part of the dispersion limit */ local_threshold = (FP_SECOND >> (-(int)NTPDATE_PRECISION)) + NTP_MAXSKW; /* * Now drop samples until we're down to one. */ while (nlist > 1) { for (n = 0; n < nlist; n++) { server_badness[n] = 0; for (j = 0; j < nlist; j++) { if (j == n) /* with self? */ continue; d = server_list[j]->soffset - server_list[n]->soffset; if (d < 0) /* absolute value */ d = -d; /* * XXX This code *knows* that * NTP_SELECT is 3/4 */ for (i = 0; i < j; i++) d = (d>>1) + (d>>2); server_badness[n] += d; } } /* * We now have an array of nlist badness * coefficients. Find the badest. Find * the minimum precision while we're at * it. */ i = 0; n = server_list[0]->precision;; for (j = 1; j < nlist; j++) { if (server_badness[j] >= server_badness[i]) i = j; if (n > server_list[j]->precision) n = server_list[j]->precision; } /* * i is the index of the server with the worst * dispersion. If his dispersion is less than * the threshold, stop now, else delete him and * continue around again. */ if (server_badness[i] < (local_threshold + (FP_SECOND >> (-n)))) break; for (j = i + 1; j < nlist; j++) server_list[j-1] = server_list[j]; nlist--; } /* * What remains is a list of less than 5 servers. Take * the best. */ sys_server = server_list[0]; } /* * That's it. Return our server. */ return sys_server; } /* * set_local_clock -- handle setting the local clock or displaying info. */ static void set_local_clock(void) { register int i; register struct server *server; time_t tmp; double dtemp; /* * if setting time then print final analysis */ if (set_time) analysis(1); /* * pick a clock */ server = clock_select(); /* * do some display of information */ if (debug || verbose) { for (i = 0; i < sys_numservers; i++) printserver(sys_servers[i], stdout); if (debug) printf("packets sent %ld, received %ld\n", total_xmit, total_recv); } /* * see if we have a server to set the time with */ if (server == 0) { if (!set_time || verbose) fprintf(stdout,"No servers available to sync time with\n"); exit(1); } /* * we have a valid and selected time to use!!!!! */ /* * if we are not setting the time then display offset and exit */ if (!set_time) { fprintf(stdout, "Your clock is off by %s seconds. (%s) [%ld/%ld]\n", lfptoa(&server->offset, 7), ntoa(&server->srcadr), total_xmit, total_recv); exit(0); } /* * set the clock * XXX: Examine the more flexible approach used by ntpdate. * Note that a design consideration here is that we sometimes * _want_ to step the clock by a _huge_ amount in either * direction, because the local clock is completely bogus. * This condition must be recognized and dealt with, so * that we always get a good time when this completes. * -- jhutz+@cmu.edu, 16-Aug-1999 */ LFPTOD(&server->offset, dtemp); step_systime(dtemp); time(&tmp); fprintf(stdout,"Time set to %.20s [%s %s %ld/%ld]\n", ctime(&tmp)+4, ntoa(&server->srcadr), lfptoa(&server->offset, 7), total_xmit, total_recv); exit(0); } /* * findserver - find a server in the list given its address */ static struct server * findserver( struct sockaddr_in *addr ) { register int i; register u_int32 netnum; if (htons(addr->sin_port) != NTP_PORT) return 0; netnum = addr->sin_addr.s_addr; for (i = 0; i < sys_numservers; i++) { if (netnum == sys_servers[i]->srcadr.sin_addr.s_addr) return sys_servers[i]; } return 0; } /* * timer - process a timer interrupt */ static void timer(void) { register int k; /* * Bump the current idea of the time */ current_time++; /* * see if we have reached half time */ if (current_time >= half_time && !secondhalf) { secondhalf++; if (debug) printf("\nSecond Half of Timeout!\n"); printmsg++; } /* * We only want to send a few packets per transmit interrupt * to throttle things */ for(k = 0;k < MAXXMITCOUNT;k++) { register int i, oldi; register u_long oldxtime; /* * We want to send a packet out for a server that has an * expired event time. However to be mellow about this, we only * use one expired event timer and to avoid starvation we use * the one with the oldest last transmit time. */ oldi = -1; oldxtime = 0; for (i = 0; i < sys_numservers; i++) { if (sys_servers[i]->event_time <= current_time) { if (oldi < 0 || oldxtime > sys_servers[i]->last_xmit) { oldxtime = sys_servers[i]->last_xmit; oldi = i; } } } if (oldi >= 0) transmit(sys_servers[oldi]); else break; /* no expired event */ } /* end of transmit loop */ } #ifndef SYS_WINNT /* * alarming - record the occurance of an alarm interrupt */ static RETSIGTYPE alarming( int sig ) #else void CALLBACK alarming(UINT uTimerID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) #endif /* SYS_WINNT */ { alarm_flag++; } /* * init_alarm - set up the timer interrupt */ static void init_alarm(void) { #ifndef SYS_WINNT # ifndef HAVE_TIMER_SETTIME struct itimerval itimer; # else struct itimerspec ntpdate_itimer; # endif #else TIMECAPS tc; UINT wTimerRes, wTimerID; # endif /* SYS_WINNT */ #if defined SYS_CYGWIN32 || defined SYS_WINNT HANDLE hToken; TOKEN_PRIVILEGES tkp; DWORD dwUser = 0; #endif /* SYS_WINNT */ alarm_flag = 0; #ifndef SYS_WINNT # if defined(HAVE_TIMER_CREATE) && defined(HAVE_TIMER_SETTIME) alarm_flag = 0; /* this code was put in as setitimer() is non existant this us the * POSIX "equivalents" setup - casey */ /* ntpdate_timerid is global - so we can kill timer later */ if (timer_create (CLOCK_REALTIME, NULL, &ntpdate_timerid) == # ifdef SYS_VXWORKS ERROR # else -1 # endif ) { fprintf (stderr, "init_alarm(): timer_create (...) FAILED\n"); return; } /* TIMER_HZ = (5) * Set up the alarm interrupt. The first comes 1/(2*TIMER_HZ) * seconds from now and they continue on every 1/TIMER_HZ seconds. */ (void) signal_no_reset(SIGALRM, alarming); ntpdate_itimer.it_interval.tv_sec = ntpdate_itimer.it_value.tv_sec = 0; ntpdate_itimer.it_interval.tv_nsec = 1000000000/TIMER_HZ; ntpdate_itimer.it_value.tv_nsec = 1000000000/(TIMER_HZ<<1); timer_settime(ntpdate_timerid, 0 /* !TIMER_ABSTIME */, &ntpdate_itimer, NULL); # else /* * Set up the alarm interrupt. The first comes 1/(2*TIMER_HZ) * seconds from now and they continue on every 1/TIMER_HZ seconds. */ (void) signal_no_reset(SIGALRM, alarming); itimer.it_interval.tv_sec = itimer.it_value.tv_sec = 0; itimer.it_interval.tv_usec = 1000000/TIMER_HZ; itimer.it_value.tv_usec = 1000000/(TIMER_HZ<<1); setitimer(ITIMER_REAL, &itimer, (struct itimerval *)0); # endif #if defined SYS_CYGWIN32 /* * Get previleges needed for fiddling with the clock */ /* get the current process token handle */ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) { msyslog(LOG_ERR, "OpenProcessToken failed: %m"); exit(1); } /* get the LUID for system-time privilege. */ LookupPrivilegeValue(NULL, SE_SYSTEMTIME_NAME, &tkp.Privileges[0].Luid); tkp.PrivilegeCount = 1; /* one privilege to set */ tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; /* get set-time privilege for this process. */ AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,(PTOKEN_PRIVILEGES) NULL, 0); /* cannot test return value of AdjustTokenPrivileges. */ if (GetLastError() != ERROR_SUCCESS) msyslog(LOG_ERR, "AdjustTokenPrivileges failed: %m"); #endif #else /* SYS_WINNT */ _tzset(); /* * Get previleges needed for fiddling with the clock */ /* get the current process token handle */ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) { msyslog(LOG_ERR, "OpenProcessToken failed: %m"); exit(1); } /* get the LUID for system-time privilege. */ LookupPrivilegeValue(NULL, SE_SYSTEMTIME_NAME, &tkp.Privileges[0].Luid); tkp.PrivilegeCount = 1; /* one privilege to set */ tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; /* get set-time privilege for this process. */ AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,(PTOKEN_PRIVILEGES) NULL, 0); /* cannot test return value of AdjustTokenPrivileges. */ if (GetLastError() != ERROR_SUCCESS) msyslog(LOG_ERR, "AdjustTokenPrivileges failed: %m"); /* * Set up timer interrupts for every 2**EVENT_TIMEOUT seconds * Under Win/NT, expiry of timer interval leads to invocation * of a callback function (on a different thread) rather than * generating an alarm signal */ /* determine max and min resolution supported */ if(timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR) { msyslog(LOG_ERR, "timeGetDevCaps failed: %m"); exit(1); } wTimerRes = min(max(tc.wPeriodMin, TARGET_RESOLUTION), tc.wPeriodMax); /* establish the minimum timer resolution that we'll use */ timeBeginPeriod(wTimerRes); /* start the timer event */ wTimerID = timeSetEvent( (UINT) (1000/TIMER_HZ), /* Delay */ wTimerRes, /* Resolution */ (LPTIMECALLBACK) alarming, /* Callback function */ (DWORD) dwUser, /* User data */ TIME_PERIODIC); /* Event type (periodic) */ if (wTimerID == 0) { msyslog(LOG_ERR, "timeSetEvent failed: %m"); exit(1); } #endif /* SYS_WINNT */ } /* * init_io - initialize I/O data and open socket */ static void init_io(void) { #ifdef SYS_WINNT WORD wVersionRequested; WSADATA wsaData; init_transmitbuff(); #endif /* SYS_WINNT */ /* * Init buffer free list and stat counters */ init_recvbuff(sys_numservers + 2); #if defined(HAVE_SIGNALED_IO) set_signal(); #endif #ifdef SYS_WINNT wVersionRequested = MAKEWORD(1,1); if (WSAStartup(wVersionRequested, &wsaData)) { msyslog(LOG_ERR, "No useable winsock.dll: %m"); exit(1); } #endif /* SYS_WINNT */ BLOCKIO(); /* create a datagram (UDP) socket */ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { msyslog(LOG_ERR, "socket() failed: %m"); exit(1); /*NOTREACHED*/ } /* * bind the socket to the NTP port */ if (!debug && set_time && !unpriv_port) { struct sockaddr_in addr; memset((char *)&addr, 0, sizeof addr); addr.sin_family = AF_INET; addr.sin_port = htons(NTP_PORT); addr.sin_addr.s_addr = htonl(INADDR_ANY); if (bind(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { #ifndef SYS_WINNT if (errno == EADDRINUSE) #else if (WSAGetLastError() == WSAEADDRINUSE) #endif msyslog(LOG_ERR, "the NTP socket is in use, exiting"); else msyslog(LOG_ERR, "bind() fails: %m"); exit(1); } } FD_ZERO(&fdmask); FD_SET(fd, &fdmask); /* * set non-blocking, */ #ifdef USE_FIONBIO /* in vxWorks we use FIONBIO, but the others are defined for old systems, so * all hell breaks loose if we leave them defined */ #undef O_NONBLOCK #undef FNDELAY #undef O_NDELAY #endif #if defined(O_NONBLOCK) /* POSIX */ if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) { msyslog(LOG_ERR, "fcntl(O_NONBLOCK) fails: %m"); exit(1); /*NOTREACHED*/ } #elif defined(FNDELAY) if (fcntl(fd, F_SETFL, FNDELAY) < 0) { msyslog(LOG_ERR, "fcntl(FNDELAY) fails: %m"); exit(1); /*NOTREACHED*/ } #elif defined(O_NDELAY) /* generally the same as FNDELAY */ if (fcntl(fd, F_SETFL, O_NDELAY) < 0) { msyslog(LOG_ERR, "fcntl(O_NDELAY) fails: %m"); exit(1); /*NOTREACHED*/ } #elif defined(FIONBIO) if ( # if defined(VMS) (ioctl(fd,FIONBIO,&1) < 0) # elif defined(SYS_WINNT) (ioctlsocket(fd,FIONBIO,(u_long *) &on) == SOCKET_ERROR) # else (ioctl(fd,FIONBIO,&on) < 0) # endif ) { msyslog(LOG_ERR, "ioctl(FIONBIO) fails: %m"); exit(1); /*NOTREACHED*/ } #elif defined(FIOSNBIO) if (ioctl(fd,FIOSNBIO,&on) < 0) { msyslog(LOG_ERR, "ioctl(FIOSNBIO) fails: %m"); exit(1); /*NOTREACHED*/ } #else # include "Bletch: Need non-blocking I/O!" #endif #ifdef HAVE_SIGNALED_IO init_socket_sig(fd); #endif /* not HAVE_SIGNALED_IO */ UNBLOCKIO(); } /* * sendpkt - send a packet to the specified destination */ static int sendpkt( struct sockaddr_in *dest, struct pkt *pkt, int len ) { int cc; static int horriblecnt = 0; #ifdef SYS_WINNT DWORD err; #endif /* SYS_WINNT */ total_xmit++; /* count it */ if (horrible) { if (++horriblecnt > HORRIBLEOK) { if (debug > 3) printf("dropping send (%s)\n", ntoa(dest)); if (horriblecnt >= HORRIBLEOK+horrible) horriblecnt = 0; return 0; } } cc = sendto(fd, (char *)pkt, (size_t)len, 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in)); #ifndef SYS_WINNT if (cc == -1) { if (errno != EWOULDBLOCK && errno != ENOBUFS) #else if (cc == SOCKET_ERROR) { err = WSAGetLastError(); if (err != WSAEWOULDBLOCK && err != WSAENOBUFS) #endif /* SYS_WINNT */ msyslog(LOG_ERR, "sendto(%s): %m", ntoa(dest)); return -1; } return 0; } /* * input_handler - receive packets asynchronously */ void input_handler(l_fp *xts) { register int n; register struct recvbuf *rb; struct timeval tvzero; int fromlen; fd_set fds; l_fp ts; ts = *xts; /* we ignore xts, but make the compiler happy */ /* * Do a poll to see if we have data */ for (;;) { fds = fdmask; tvzero.tv_sec = tvzero.tv_usec = 0; n = select(fd+1, &fds, (fd_set *)0, (fd_set *)0, &tvzero); /* * If nothing to do, just return. If an error occurred, * complain and return. If we've got some, freeze a * timestamp. */ if (n == 0) return; else if (n == -1) { if (errno != EINTR) { msyslog(LOG_ERR, "select() error: %m"); } return; } get_systime(&ts); /* * Get a buffer and read the frame. If we * haven't got a buffer, or this is received * on the wild card socket, just dump the packet. */ if (initializing || free_recvbuffs == 0) { char buf[100]; #ifndef SYS_WINNT (void) read(fd, buf, sizeof buf); #else /* NT's _read does not operate on nonblocking sockets * either recvfrom or ReadFile() has to be used here. * ReadFile is used in [ntpd]ntp_intres() and ntpdc, * just to be different use recvfrom() here */ recvfrom(fd, buf, sizeof(buf), 0, (struct sockaddr *)0, NULL); #endif /* SYS_WINNT */ continue; } rb = get_free_recv_buffer(); fromlen = sizeof(struct sockaddr_in); rb->recv_length = recvfrom(fd, (char *)&rb->recv_pkt, sizeof(rb->recv_pkt), 0, (struct sockaddr *)&rb->srcadr, &fromlen); if (rb->recv_length == -1) { freerecvbuf(rb); continue; } /* * Got one. Mark how and when it got here, * put it on the full list. */ rb->recv_time = ts; add_full_recv_buffer(rb); total_recv++; /* count it */ } } /* XXX ELIMINATE printserver similar in ntptrace.c, ntpdate.c */ /* * printserver - print detail information for a server */ static void printserver( register struct server *pp, FILE *fp ) { register int i; char junk[5]; char *str; if (!debug) { (void) fprintf(fp, "%-15s %d/%d %03o v%d s%d offset %9s delay %s disp %s\n", ntoa(&pp->srcadr), pp->xmtcnt,pp->rcvcnt,pp->reach, pp->version,pp->stratum, lfptoa(&pp->offset, 6), ufptoa(pp->delay, 5), ufptoa(pp->dispersion, 4)); return; } (void) fprintf(fp, "server %s, port %d\n", ntoa(&pp->srcadr), ntohs(pp->srcadr.sin_port)); (void) fprintf(fp, "stratum %d, precision %d, leap %c%c, trust %03o\n", pp->stratum, pp->precision, pp->leap & 0x2 ? '1' : '0', pp->leap & 0x1 ? '1' : '0', pp->trust); if (pp->stratum == 1) { junk[4] = 0; memmove(junk, (char *)&pp->refid, 4); str = junk; } else { str = numtoa(pp->refid); } (void) fprintf(fp, "refid [%s], delay %s, dispersion %s\n", str, fptoa((s_fp)pp->delay, 5), ufptoa(pp->dispersion, 5)); (void) fprintf(fp, "transmitted %d, received %d, reachable %03o\n", pp->xmtcnt, pp->rcvcnt, pp->reach); (void) fprintf(fp, "reference time: %s\n", prettydate(&pp->reftime)); (void) fprintf(fp, "originate timestamp: %s\n", prettydate(&pp->org)); (void) fprintf(fp, "transmit timestamp: %s\n", prettydate(&pp->xmt)); (void) fprintf(fp, "filter delay: "); for (i = 0; i < NTP_SHIFT; i++) { (void) fprintf(fp, " %-8.8s", fptoa(pp->filter_delay[i], 5)); if (i == (NTP_SHIFT>>1)-1) (void) fprintf(fp, "\n "); } (void) fprintf(fp, "\n"); (void) fprintf(fp, "filter offset:"); for (i = 0; i < PEER_SHIFT; i++) { (void) fprintf(fp, " %-8.8s", lfptoa(&pp->filter_offset[i], 6)); if (i == (PEER_SHIFT>>1)-1) (void) fprintf(fp, "\n "); } (void) fprintf(fp, "\n"); (void) fprintf(fp, "delay %s, dispersion %s\n", fptoa((s_fp)pp->delay, 5), ufptoa(pp->dispersion, 5)); (void) fprintf(fp, "offset %s\n\n", lfptoa(&pp->offset, 6)); } #if !defined(HAVE_VSPRINTF) int vsprintf( char *str, const char *fmt, va_list ap ) { FILE f; int len; f._flag = _IOWRT+_IOSTRG; f._ptr = str; f._cnt = 32767; len = _doprnt(fmt, ap, &f); *f._ptr = 0; return (len); } #endif ntp-4.2.6p5/ntpdate/Makefile.am0000644000175000017500000000166611314114376015316 0ustar peterpeterNULL= AUTOMAKE_OPTIONS= BUILT_SOURCES= CLEANFILES= if NTP_BINSUBDIR_IS_BIN bin_PROGRAMS= ntpdate else sbin_PROGRAMS= ntpdate endif EXTRA_PROGRAMS= ntptimeset ntptimeset_SOURCES= ntptimeset.c ntptime_config.c AM_CPPFLAGS= -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include # LDADD might need RESLIB and ADJLIB LDADD= version.o ../libntp/libntp.a ntpdate_LDADD= $(LDADD) @LCRYPTO@ DISTCLEANFILES= .version version.c stamp-v noinst_HEADERS= ntpdate.h ETAGS_ARGS= Makefile.am $(PROGRAMS): $(LDADD) ../libntp/libntp.a: cd ../libntp && $(MAKE) $(top_srcdir)/version : cd $(top_srcdir) && $(MAKE) version version.o: $(ntpdate_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpdate $(COMPILE) -c version.c include $(top_srcdir)/bincheck.mf include $(top_srcdir)/depsver.mf ntp-4.2.6p5/ntpdate/README0000644000175000017500000000050410017034571014125 0ustar peterpeterREADME file for directory ./ntpdate of the NTP Version 4 distribution This directory contains the sources for the ntpdate utility program. See the README and RELNOTES files in the parent directory for directions on how to make and install this program. The current version number of this program is in the version.c file. ntp-4.2.6p5/ntpdate/ntpdate.c0000644000175000017500000014212311567107101015055 0ustar peterpeter/* * ntpdate - set the time of day by polling one or more NTP servers */ #ifdef HAVE_CONFIG_H # include #endif #ifdef HAVE_NETINFO #include #endif #include "ntp_machine.h" #include "ntp_fp.h" #include "ntp.h" #include "ntp_io.h" #include "ntp_unixtime.h" #include "ntpdate.h" #include "ntp_string.h" #include "ntp_syslog.h" #include "ntp_select.h" #include "ntp_stdlib.h" #include "ntp_assert.h" #include #include "isc/net.h" #include "isc/result.h" #include "isc/sockaddr.h" #ifdef HAVE_UNISTD_H # include #endif #include #include #include #ifdef HAVE_POLL_H # include #endif #ifdef HAVE_SYS_SIGNAL_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_RESOURCE_H # include #endif #include #ifdef SYS_VXWORKS # include "ioLib.h" # include "sockLib.h" # include "timers.h" /* select wants a zero structure ... */ struct timeval timeout = {0,0}; #elif defined(SYS_WINNT) /* * Windows does not abort a select select call if SIGALRM goes off * so a 200 ms timeout is needed (TIMER_HZ is 5). */ struct sock_timeval timeout = {0,1000000/TIMER_HZ}; #else struct timeval timeout = {60,0}; #endif #ifdef HAVE_NETINFO #include #endif #include "recvbuff.h" #ifdef SYS_WINNT #define TARGET_RESOLUTION 1 /* Try for 1-millisecond accuracy on Windows NT timers. */ #pragma comment(lib, "winmm") isc_boolean_t ntp_port_inuse(int af, u_short port); UINT wTimerRes; #endif /* SYS_WINNT */ /* * Scheduling priority we run at */ #ifndef SYS_VXWORKS # define NTPDATE_PRIO (-12) #else # define NTPDATE_PRIO (100) #endif #ifdef HAVE_TIMER_CREATE /* POSIX TIMERS - vxWorks doesn't have itimer - casey */ static timer_t ntpdate_timerid; #endif /* * Compatibility stuff for Version 2 */ #define NTP_MAXSKW 0x28f /* 0.01 sec in fp format */ #define NTP_MINDIST 0x51f /* 0.02 sec in fp format */ #define PEER_MAXDISP (64*FP_SECOND) /* maximum dispersion (fp 64) */ #define NTP_INFIN 15 /* max stratum, infinity a la Bellman-Ford */ #define NTP_MAXWGT (8*FP_SECOND) /* maximum select weight 8 seconds */ #define NTP_MAXLIST 5 /* maximum select list size */ #define PEER_SHIFT 8 /* 8 suitable for crystal time base */ /* * for get_systime() */ s_char sys_precision; /* local clock precision (log2 s) */ /* * Debugging flag */ volatile int debug = 0; /* * File descriptor masks etc. for call to select */ int ai_fam_templ; int nbsock; /* the number of sockets used */ SOCKET fd[MAX_AF]; int fd_family[MAX_AF]; /* to remember the socket family */ #ifdef HAVE_POLL_H struct pollfd fdmask[MAX_AF]; #else fd_set fdmask; SOCKET maxfd; #endif int polltest = 0; /* * Initializing flag. All async routines watch this and only do their * thing when it is clear. */ int initializing = 1; /* * Alarm flag. Set when an alarm occurs */ volatile int alarm_flag = 0; /* * Simple query flag. */ int simple_query = 0; /* * Unprivileged port flag. */ int unpriv_port = 0; /* * Program name. */ char *progname; /* * Systemwide parameters and flags */ int sys_samples = DEFSAMPLES; /* number of samples/server */ u_long sys_timeout = DEFTIMEOUT; /* timeout time, in TIMER_HZ units */ struct server *sys_servers; /* the server list */ int sys_numservers = 0; /* number of servers to poll */ int sys_authenticate = 0; /* true when authenticating */ u_int32 sys_authkey = 0; /* set to authentication key in use */ u_long sys_authdelay = 0; /* authentication delay */ int sys_version = NTP_VERSION; /* version to poll with */ /* * The current internal time */ u_long current_time = 0; /* * Counter for keeping track of completed servers */ int complete_servers = 0; /* * File of encryption keys */ #ifndef KEYFILE # ifndef SYS_WINNT #define KEYFILE "/etc/ntp.keys" # else #define KEYFILE "%windir%\\ntp.keys" # endif /* SYS_WINNT */ #endif /* KEYFILE */ #ifndef SYS_WINNT const char *key_file = KEYFILE; #else char key_file_storage[MAX_PATH+1], *key_file ; #endif /* SYS_WINNT */ /* * Miscellaneous flags */ int verbose = 0; int always_step = 0; int never_step = 0; int ntpdatemain (int, char **); static void transmit (struct server *); static void receive (struct recvbuf *); static void server_data (struct server *, s_fp, l_fp *, u_fp); static void clock_filter (struct server *); static struct server *clock_select (void); static int clock_adjust (void); static void addserver (char *); static struct server *findserver (sockaddr_u *); void timer (void); static void init_alarm (void); #ifndef SYS_WINNT static RETSIGTYPE alarming (int); #endif /* SYS_WINNT */ static void init_io (void); static void sendpkt (sockaddr_u *, struct pkt *, int); void input_handler (void); static int l_adj_systime (l_fp *); static int l_step_systime (l_fp *); static void printserver (struct server *, FILE *); #ifdef SYS_WINNT int on = 1; WORD wVersionRequested; WSADATA wsaData; #endif /* SYS_WINNT */ #ifdef NO_MAIN_ALLOWED CALL(ntpdate,"ntpdate",ntpdatemain); void clear_globals() { /* * Debugging flag */ debug = 0; ntp_optind = 0; /* * Initializing flag. All async routines watch this and only do their * thing when it is clear. */ initializing = 1; /* * Alarm flag. Set when an alarm occurs */ alarm_flag = 0; /* * Simple query flag. */ simple_query = 0; /* * Unprivileged port flag. */ unpriv_port = 0; /* * Systemwide parameters and flags */ sys_numservers = 0; /* number of servers to poll */ sys_authenticate = 0; /* true when authenticating */ sys_authkey = 0; /* set to authentication key in use */ sys_authdelay = 0; /* authentication delay */ sys_version = NTP_VERSION; /* version to poll with */ /* * The current internal time */ current_time = 0; /* * Counter for keeping track of completed servers */ complete_servers = 0; verbose = 0; always_step = 0; never_step = 0; } #endif #ifdef HAVE_NETINFO static ni_namelist *getnetinfoservers (void); #endif /* * Main program. Initialize us and loop waiting for I/O and/or * timer expiries. */ #ifndef NO_MAIN_ALLOWED int main( int argc, char *argv[] ) { return ntpdatemain (argc, argv); } #endif /* NO_MAIN_ALLOWED */ int ntpdatemain ( int argc, char *argv[] ) { int was_alarmed; int tot_recvbufs; struct recvbuf *rbuf; l_fp tmp; int errflg; int c; int nfound; #ifdef HAVE_NETINFO ni_namelist *netinfoservers; #endif #ifdef SYS_WINNT key_file = key_file_storage; if (!ExpandEnvironmentStrings(KEYFILE, key_file, MAX_PATH)) msyslog(LOG_ERR, "ExpandEnvironmentStrings(KEYFILE) failed: %m\n"); ssl_applink(); #endif /* SYS_WINNT */ #ifdef NO_MAIN_ALLOWED clear_globals(); #endif init_lib(); /* sets up ipv4_works, ipv6_works */ /* Check to see if we have IPv6. Otherwise default to IPv4 */ if (!ipv6_works) ai_fam_templ = AF_INET; errflg = 0; progname = argv[0]; syslogit = 0; /* * Decode argument list */ while ((c = ntp_getopt(argc, argv, "46a:bBde:k:o:p:qst:uv")) != EOF) switch (c) { case '4': ai_fam_templ = AF_INET; break; case '6': ai_fam_templ = AF_INET6; break; case 'a': c = atoi(ntp_optarg); sys_authenticate = 1; sys_authkey = c; break; case 'b': always_step++; never_step = 0; break; case 'B': never_step++; always_step = 0; break; case 'd': ++debug; break; case 'e': if (!atolfp(ntp_optarg, &tmp) || tmp.l_ui != 0) { (void) fprintf(stderr, "%s: encryption delay %s is unlikely\n", progname, ntp_optarg); errflg++; } else { sys_authdelay = tmp.l_uf; } break; case 'k': key_file = ntp_optarg; break; case 'o': sys_version = atoi(ntp_optarg); break; case 'p': c = atoi(ntp_optarg); if (c <= 0 || c > NTP_SHIFT) { (void) fprintf(stderr, "%s: number of samples (%d) is invalid\n", progname, c); errflg++; } else { sys_samples = c; } break; case 'q': simple_query = 1; break; case 's': syslogit = 1; break; case 't': if (!atolfp(ntp_optarg, &tmp)) { (void) fprintf(stderr, "%s: timeout %s is undecodeable\n", progname, ntp_optarg); errflg++; } else { sys_timeout = ((LFPTOFP(&tmp) * TIMER_HZ) + 0x8000) >> 16; sys_timeout = max(sys_timeout, MINTIMEOUT); } break; case 'v': verbose = 1; break; case 'u': unpriv_port = 1; break; case '?': ++errflg; break; default: break; } if (errflg) { (void) fprintf(stderr, "usage: %s [-46bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-t timeo] server ...\n", progname); exit(2); } if (debug || simple_query) { #ifdef HAVE_SETVBUF static char buf[BUFSIZ]; setvbuf(stdout, buf, _IOLBF, BUFSIZ); #else setlinebuf(stdout); #endif } /* * Logging. Open the syslog if we have to */ if (syslogit) { #if !defined (SYS_WINNT) && !defined (SYS_VXWORKS) && !defined SYS_CYGWIN32 # ifndef LOG_DAEMON openlog("ntpdate", LOG_PID); # else # ifndef LOG_NTP # define LOG_NTP LOG_DAEMON # endif openlog("ntpdate", LOG_PID | LOG_NDELAY, LOG_NTP); if (debug) setlogmask(LOG_UPTO(LOG_DEBUG)); else setlogmask(LOG_UPTO(LOG_INFO)); # endif /* LOG_DAEMON */ #endif /* SYS_WINNT */ } if (debug || verbose) msyslog(LOG_NOTICE, "%s", Version); /* * Add servers we are going to be polling */ #ifdef HAVE_NETINFO netinfoservers = getnetinfoservers(); #endif for ( ; ntp_optind < argc; ntp_optind++) addserver(argv[ntp_optind]); #ifdef HAVE_NETINFO if (netinfoservers) { if ( netinfoservers->ni_namelist_len && *netinfoservers->ni_namelist_val ) { u_int servercount = 0; while (servercount < netinfoservers->ni_namelist_len) { if (debug) msyslog(LOG_DEBUG, "Adding time server %s from NetInfo configuration.", netinfoservers->ni_namelist_val[servercount]); addserver(netinfoservers->ni_namelist_val[servercount++]); } } ni_namelist_free(netinfoservers); free(netinfoservers); } #endif if (sys_numservers == 0) { msyslog(LOG_ERR, "no servers can be used, exiting"); exit(1); } /* * Initialize the time of day routines and the I/O subsystem */ if (sys_authenticate) { init_auth(); if (!authreadkeys(key_file)) { msyslog(LOG_ERR, "no key file <%s>, exiting", key_file); exit(1); } authtrust(sys_authkey, 1); if (!authistrusted(sys_authkey)) { msyslog(LOG_ERR, "authentication key %lu unknown", (unsigned long) sys_authkey); exit(1); } } init_io(); init_alarm(); /* * Set the priority. */ #ifdef SYS_VXWORKS taskPrioritySet( taskIdSelf(), NTPDATE_PRIO); #endif #if defined(HAVE_ATT_NICE) nice (NTPDATE_PRIO); #endif #if defined(HAVE_BSD_NICE) (void) setpriority(PRIO_PROCESS, 0, NTPDATE_PRIO); #endif initializing = 0; was_alarmed = 0; while (complete_servers < sys_numservers) { #ifdef HAVE_POLL_H struct pollfd* rdfdes; rdfdes = fdmask; #else fd_set rdfdes; rdfdes = fdmask; #endif if (alarm_flag) { /* alarmed? */ was_alarmed = 1; alarm_flag = 0; } tot_recvbufs = full_recvbuffs(); /* get received buffers */ if (!was_alarmed && tot_recvbufs == 0) { /* * Nothing to do. Wait for something. */ #ifdef HAVE_POLL_H nfound = poll(rdfdes, (unsigned int)nbsock, timeout.tv_sec * 1000); #else nfound = select(maxfd, &rdfdes, (fd_set *)0, (fd_set *)0, &timeout); #endif if (nfound > 0) input_handler(); else if (nfound == SOCKET_ERROR) { #ifndef SYS_WINNT if (errno != EINTR) #else if (WSAGetLastError() != WSAEINTR) #endif msyslog(LOG_ERR, #ifdef HAVE_POLL_H "poll() error: %m" #else "select() error: %m" #endif ); } else if (errno != 0) { #ifndef SYS_VXWORKS msyslog(LOG_DEBUG, #ifdef HAVE_POLL_H "poll(): nfound = %d, error: %m", #else "select(): nfound = %d, error: %m", #endif nfound); #endif } if (alarm_flag) { /* alarmed? */ was_alarmed = 1; alarm_flag = 0; } tot_recvbufs = full_recvbuffs(); /* get received buffers */ } /* * Out here, signals are unblocked. Call receive * procedure for each incoming packet. */ rbuf = get_full_recv_buffer(); while (rbuf != NULL) { receive(rbuf); freerecvbuf(rbuf); rbuf = get_full_recv_buffer(); } /* * Call timer to process any timeouts */ if (was_alarmed) { timer(); was_alarmed = 0; } /* * Go around again */ } /* * When we get here we've completed the polling of all servers. * Adjust the clock, then exit. */ #ifdef SYS_WINNT WSACleanup(); #endif #ifdef SYS_VXWORKS close (fd); timer_delete(ntpdate_timerid); #endif return clock_adjust(); } /* * transmit - transmit a packet to the given server, or mark it completed. * This is called by the timeout routine and by the receive * procedure. */ static void transmit( register struct server *server ) { struct pkt xpkt; if (debug) printf("transmit(%s)\n", stoa(&server->srcadr)); if (server->filter_nextpt < server->xmtcnt) { l_fp ts; /* * Last message to this server timed out. Shift * zeros into the filter. */ L_CLR(&ts); server_data(server, 0, &ts, 0); } if ((int)server->filter_nextpt >= sys_samples) { /* * Got all the data we need. Mark this guy * completed and return. */ server->event_time = 0; complete_servers++; return; } /* * If we're here, send another message to the server. Fill in * the packet and let 'er rip. */ xpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC, sys_version, MODE_CLIENT); xpkt.stratum = STRATUM_TO_PKT(STRATUM_UNSPEC); xpkt.ppoll = NTP_MINPOLL; xpkt.precision = NTPDATE_PRECISION; xpkt.rootdelay = htonl(NTPDATE_DISTANCE); xpkt.rootdisp = htonl(NTPDATE_DISP); xpkt.refid = htonl(NTPDATE_REFID); L_CLR(&xpkt.reftime); L_CLR(&xpkt.org); L_CLR(&xpkt.rec); /* * Determine whether to authenticate or not. If so, * fill in the extended part of the packet and do it. * If not, just timestamp it and send it away. */ if (sys_authenticate) { int len; xpkt.exten[0] = htonl(sys_authkey); get_systime(&server->xmt); L_ADDUF(&server->xmt, sys_authdelay); HTONL_FP(&server->xmt, &xpkt.xmt); len = authencrypt(sys_authkey, (u_int32 *)&xpkt, LEN_PKT_NOMAC); sendpkt(&server->srcadr, &xpkt, (int)(LEN_PKT_NOMAC + len)); if (debug > 1) printf("transmit auth to %s\n", stoa(&server->srcadr)); } else { get_systime(&(server->xmt)); HTONL_FP(&server->xmt, &xpkt.xmt); sendpkt(&server->srcadr, &xpkt, LEN_PKT_NOMAC); if (debug > 1) printf("transmit to %s\n", stoa(&server->srcadr)); } /* * Update the server timeout and transmit count */ server->event_time = current_time + sys_timeout; server->xmtcnt++; } /* * receive - receive and process an incoming frame */ static void receive( struct recvbuf *rbufp ) { register struct pkt *rpkt; register struct server *server; register s_fp di; l_fp t10, t23, tmp; l_fp org; l_fp rec; l_fp ci; int has_mac; int is_authentic; if (debug) printf("receive(%s)\n", stoa(&rbufp->recv_srcadr)); /* * Check to see if the packet basically looks like something * intended for us. */ if (rbufp->recv_length == LEN_PKT_NOMAC) has_mac = 0; else if (rbufp->recv_length >= LEN_PKT_NOMAC) has_mac = 1; else { if (debug) printf("receive: packet length %d\n", rbufp->recv_length); return; /* funny length packet */ } rpkt = &(rbufp->recv_pkt); if (PKT_VERSION(rpkt->li_vn_mode) < NTP_OLDVERSION || PKT_VERSION(rpkt->li_vn_mode) > NTP_VERSION) { return; } if ((PKT_MODE(rpkt->li_vn_mode) != MODE_SERVER && PKT_MODE(rpkt->li_vn_mode) != MODE_PASSIVE) || rpkt->stratum >= STRATUM_UNSPEC) { if (debug) printf("receive: mode %d stratum %d\n", PKT_MODE(rpkt->li_vn_mode), rpkt->stratum); return; } /* * So far, so good. See if this is from a server we know. */ server = findserver(&(rbufp->recv_srcadr)); if (server == NULL) { if (debug) printf("receive: server not found\n"); return; } /* * Decode the org timestamp and make sure we're getting a response * to our last request. */ NTOHL_FP(&rpkt->org, &org); if (!L_ISEQU(&org, &server->xmt)) { if (debug) printf("receive: pkt.org and peer.xmt differ\n"); return; } /* * Check out the authenticity if we're doing that. */ if (!sys_authenticate) is_authentic = 1; else { is_authentic = 0; if (debug > 3) printf("receive: rpkt keyid=%ld sys_authkey=%ld decrypt=%ld\n", (long int)ntohl(rpkt->exten[0]), (long int)sys_authkey, (long int)authdecrypt(sys_authkey, (u_int32 *)rpkt, LEN_PKT_NOMAC, (int)(rbufp->recv_length - LEN_PKT_NOMAC))); if (has_mac && ntohl(rpkt->exten[0]) == sys_authkey && authdecrypt(sys_authkey, (u_int32 *)rpkt, LEN_PKT_NOMAC, (int)(rbufp->recv_length - LEN_PKT_NOMAC))) is_authentic = 1; if (debug) printf("receive: authentication %s\n", is_authentic ? "passed" : "failed"); } server->trust <<= 1; if (!is_authentic) server->trust |= 1; /* * Check for a KoD (rate limiting) response, cease and decist. */ if (LEAP_NOTINSYNC == PKT_LEAP(rpkt->li_vn_mode) && STRATUM_PKT_UNSPEC == rpkt->stratum && !memcmp("RATE", &rpkt->refid, 4)) { msyslog(LOG_ERR, "%s rate limit response from server.\n", stoa(&rbufp->recv_srcadr)); server->event_time = 0; complete_servers++; return; } /* * Looks good. Record info from the packet. */ server->leap = PKT_LEAP(rpkt->li_vn_mode); server->stratum = PKT_TO_STRATUM(rpkt->stratum); server->precision = rpkt->precision; server->rootdelay = ntohl(rpkt->rootdelay); server->rootdisp = ntohl(rpkt->rootdisp); server->refid = rpkt->refid; NTOHL_FP(&rpkt->reftime, &server->reftime); NTOHL_FP(&rpkt->rec, &rec); NTOHL_FP(&rpkt->xmt, &server->org); /* * Make sure the server is at least somewhat sane. If not, try * again. */ if (L_ISZERO(&rec) || !L_ISHIS(&server->org, &rec)) { server->event_time = current_time + sys_timeout; return; } /* * Calculate the round trip delay (di) and the clock offset (ci). * We use the equations (reordered from those in the spec): * * d = (t2 - t3) - (t1 - t0) * c = ((t2 - t3) + (t1 - t0)) / 2 */ t10 = server->org; /* pkt.xmt == t1 */ L_SUB(&t10, &rbufp->recv_time); /* recv_time == t0*/ t23 = rec; /* pkt.rec == t2 */ L_SUB(&t23, &org); /* pkt->org == t3 */ /* now have (t2 - t3) and (t0 - t1). Calculate (ci) and (di) */ /* * Calculate (ci) = ((t1 - t0) / 2) + ((t2 - t3) / 2) * For large offsets this may prevent an overflow on '+' */ ci = t10; L_RSHIFT(&ci); tmp = t23; L_RSHIFT(&tmp); L_ADD(&ci, &tmp); /* * Calculate di in t23 in full precision, then truncate * to an s_fp. */ L_SUB(&t23, &t10); di = LFPTOFP(&t23); if (debug > 3) printf("offset: %s, delay %s\n", lfptoa(&ci, 6), fptoa(di, 5)); di += (FP_SECOND >> (-(int)NTPDATE_PRECISION)) + (FP_SECOND >> (-(int)server->precision)) + NTP_MAXSKW; if (di <= 0) { /* value still too raunchy to use? */ L_CLR(&ci); di = 0; } else { di = max(di, NTP_MINDIST); } /* * Shift this data in, then schedule another transmit. */ server_data(server, (s_fp) di, &ci, 0); if ((int)server->filter_nextpt >= sys_samples) { /* * Got all the data we need. Mark this guy * completed and return. */ server->event_time = 0; complete_servers++; return; } server->event_time = current_time + sys_timeout; } /* * server_data - add a sample to the server's filter registers */ static void server_data( register struct server *server, s_fp d, l_fp *c, u_fp e ) { u_short i; i = server->filter_nextpt; if (i < NTP_SHIFT) { server->filter_delay[i] = d; server->filter_offset[i] = *c; server->filter_soffset[i] = LFPTOFP(c); server->filter_error[i] = e; server->filter_nextpt = (u_short)(i + 1); } } /* * clock_filter - determine a server's delay, dispersion and offset */ static void clock_filter( register struct server *server ) { register int i, j; int ord[NTP_SHIFT]; /* * Sort indices into increasing delay order */ for (i = 0; i < sys_samples; i++) ord[i] = i; for (i = 0; i < (sys_samples-1); i++) { for (j = i+1; j < sys_samples; j++) { if (server->filter_delay[ord[j]] == 0) continue; if (server->filter_delay[ord[i]] == 0 || (server->filter_delay[ord[i]] > server->filter_delay[ord[j]])) { register int tmp; tmp = ord[i]; ord[i] = ord[j]; ord[j] = tmp; } } } /* * Now compute the dispersion, and assign values to delay and * offset. If there are no samples in the register, delay and * offset go to zero and dispersion is set to the maximum. */ if (server->filter_delay[ord[0]] == 0) { server->delay = 0; L_CLR(&server->offset); server->soffset = 0; server->dispersion = PEER_MAXDISP; } else { register s_fp d; server->delay = server->filter_delay[ord[0]]; server->offset = server->filter_offset[ord[0]]; server->soffset = LFPTOFP(&server->offset); server->dispersion = 0; for (i = 1; i < sys_samples; i++) { if (server->filter_delay[ord[i]] == 0) d = PEER_MAXDISP; else { d = server->filter_soffset[ord[i]] - server->filter_soffset[ord[0]]; if (d < 0) d = -d; if (d > PEER_MAXDISP) d = PEER_MAXDISP; } /* * XXX This *knows* PEER_FILTER is 1/2 */ server->dispersion += (u_fp)(d) >> i; } } /* * We're done */ } /* * clock_select - select the pick-of-the-litter clock from the samples * we've got. */ static struct server * clock_select(void) { struct server *server; u_int nlist; s_fp d; u_int count; u_int i; u_int j; u_int k; int n; s_fp local_threshold; struct server *server_list[NTP_MAXCLOCK]; u_fp server_badness[NTP_MAXCLOCK]; struct server *sys_server; /* * This first chunk of code is supposed to go through all * servers we know about to find the NTP_MAXLIST servers which * are most likely to succeed. We run through the list * doing the sanity checks and trying to insert anyone who * looks okay. We are at all times aware that we should * only keep samples from the top two strata and we only need * NTP_MAXLIST of them. */ nlist = 0; /* none yet */ for (server = sys_servers; server != NULL; server = server->next_server) { if (server->delay == 0) { if (debug) printf("%s: Server dropped: no data\n", ntoa(&server->srcadr)); continue; /* no data */ } if (server->stratum > NTP_INFIN) { if (debug) printf("%s: Server dropped: strata too high\n", ntoa(&server->srcadr)); continue; /* stratum no good */ } if (server->delay > NTP_MAXWGT) { if (debug) printf("%s: Server dropped: server too far away\n", ntoa(&server->srcadr)); continue; /* too far away */ } if (server->leap == LEAP_NOTINSYNC) { if (debug) printf("%s: Server dropped: Leap not in sync\n", ntoa(&server->srcadr)); continue; /* he's in trouble */ } if (!L_ISHIS(&server->org, &server->reftime)) { if (debug) printf("%s: Server dropped: server is very broken\n", ntoa(&server->srcadr)); continue; /* very broken host */ } if ((server->org.l_ui - server->reftime.l_ui) >= NTP_MAXAGE) { if (debug) printf("%s: Server dropped: Server has gone too long without sync\n", ntoa(&server->srcadr)); continue; /* too long without sync */ } if (server->trust != 0) { if (debug) printf("%s: Server dropped: Server is untrusted\n", ntoa(&server->srcadr)); continue; } /* * This one seems sane. Find where he belongs * on the list. */ d = server->dispersion + server->dispersion; for (i = 0; i < nlist; i++) if (server->stratum <= server_list[i]->stratum) break; for ( ; i < nlist; i++) { if (server->stratum < server_list[i]->stratum) break; if (d < (s_fp) server_badness[i]) break; } /* * If i points past the end of the list, this * guy is a loser, else stick him in. */ if (i >= NTP_MAXLIST) continue; for (j = nlist; j > i; j--) if (j < NTP_MAXLIST) { server_list[j] = server_list[j-1]; server_badness[j] = server_badness[j-1]; } server_list[i] = server; server_badness[i] = d; if (nlist < NTP_MAXLIST) nlist++; } /* * Got the five-or-less best. Cut the list where the number of * strata exceeds two. */ count = 0; for (i = 1; i < nlist; i++) if (server_list[i]->stratum > server_list[i-1]->stratum) { count++; if (2 == count) { nlist = i; break; } } /* * Whew! What we should have by now is 0 to 5 candidates for * the job of syncing us. If we have none, we're out of luck. * If we have one, he's a winner. If we have more, do falseticker * detection. */ if (0 == nlist) sys_server = NULL; else if (1 == nlist) { sys_server = server_list[0]; } else { /* * Re-sort by stratum, bdelay estimate quality and * server.delay. */ for (i = 0; i < nlist-1; i++) for (j = i+1; j < nlist; j++) { if (server_list[i]->stratum < server_list[j]->stratum) /* already sorted by stratum */ break; if (server_list[i]->delay < server_list[j]->delay) continue; server = server_list[i]; server_list[i] = server_list[j]; server_list[j] = server; } /* * Calculate the fixed part of the dispersion limit */ local_threshold = (FP_SECOND >> (-(int)NTPDATE_PRECISION)) + NTP_MAXSKW; /* * Now drop samples until we're down to one. */ while (nlist > 1) { for (k = 0; k < nlist; k++) { server_badness[k] = 0; for (j = 0; j < nlist; j++) { if (j == k) /* with self? */ continue; d = server_list[j]->soffset - server_list[k]->soffset; if (d < 0) /* abs value */ d = -d; /* * XXX This code *knows* that * NTP_SELECT is 3/4 */ for (i = 0; i < j; i++) d = (d>>1) + (d>>2); server_badness[k] += d; } } /* * We now have an array of nlist badness * coefficients. Find the badest. Find * the minimum precision while we're at * it. */ i = 0; n = server_list[0]->precision;; for (j = 1; j < nlist; j++) { if (server_badness[j] >= server_badness[i]) i = j; if (n > server_list[j]->precision) n = server_list[j]->precision; } /* * i is the index of the server with the worst * dispersion. If his dispersion is less than * the threshold, stop now, else delete him and * continue around again. */ if ( (s_fp) server_badness[i] < (local_threshold + (FP_SECOND >> (-n)))) break; for (j = i + 1; j < nlist; j++) server_list[j-1] = server_list[j]; nlist--; } /* * What remains is a list of less than 5 servers. Take * the best. */ sys_server = server_list[0]; } /* * That's it. Return our server. */ return sys_server; } /* * clock_adjust - process what we've received, and adjust the time * if we got anything decent. */ static int clock_adjust(void) { register struct server *sp, *server; s_fp absoffset; int dostep; for (sp = sys_servers; sp != NULL; sp = sp->next_server) clock_filter(sp); server = clock_select(); if (debug || simple_query) { for (sp = sys_servers; sp != NULL; sp = sp->next_server) printserver(sp, stdout); } if (server == 0) { msyslog(LOG_ERR, "no server suitable for synchronization found"); return(1); } if (always_step) { dostep = 1; } else if (never_step) { dostep = 0; } else { absoffset = server->soffset; if (absoffset < 0) absoffset = -absoffset; dostep = (absoffset >= NTPDATE_THRESHOLD || absoffset < 0); } if (dostep) { if (simple_query || debug || l_step_systime(&server->offset)){ msyslog(LOG_NOTICE, "step time server %s offset %s sec", stoa(&server->srcadr), lfptoa(&server->offset, 6)); } } else { #ifndef SYS_WINNT if (simple_query || l_adj_systime(&server->offset)) { msyslog(LOG_NOTICE, "adjust time server %s offset %s sec", stoa(&server->srcadr), lfptoa(&server->offset, 6)); } #else /* The NT SetSystemTimeAdjustment() call achieves slewing by * changing the clock frequency. This means that we cannot specify * it to slew the clock by a definite amount and then stop like * the Unix adjtime() routine. We can technically adjust the clock * frequency, have ntpdate sleep for a while, and then wake * up and reset the clock frequency, but this might cause some * grief if the user attempts to run ntpd immediately after * ntpdate and the socket is in use. */ printf("\nThe -b option is required by ntpdate on Windows NT platforms\n"); exit(1); #endif /* SYS_WINNT */ } return(0); } /* * is_unreachable - check to see if we have a route to given destination * (non-blocking). */ static int is_reachable (sockaddr_u *dst) { SOCKET sockfd; sockfd = socket(AF(dst), SOCK_DGRAM, 0); if (sockfd == -1) { return 0; } if (connect(sockfd, &dst->sa, SOCKLEN(dst))) { closesocket(sockfd); return 0; } closesocket(sockfd); return 1; } /* XXX ELIMINATE: merge BIG slew into adj_systime in lib/systime.c */ /* * addserver - determine a server's address and allocate a new structure * for it. */ static void addserver( char *serv ) { register struct server *server; /* Address infos structure to store result of getaddrinfo */ struct addrinfo *addrResult, *ptr; /* Address infos structure to store hints for getaddrinfo */ struct addrinfo hints; /* Error variable for getaddrinfo */ int error; /* Service name */ char service[5]; sockaddr_u addr; strncpy(service, "ntp", sizeof(service)); /* Get host address. Looking for UDP datagram connection. */ ZERO(hints); hints.ai_family = ai_fam_templ; hints.ai_socktype = SOCK_DGRAM; #ifdef DEBUG if (debug) printf("Looking for host %s and service %s\n", serv, service); #endif error = getaddrinfo(serv, service, &hints, &addrResult); if (error != 0) { /* Conduct more refined error analysis */ if (error == EAI_FAIL || error == EAI_AGAIN){ /* Name server is unusable. Exit after failing on the first server, in order to shorten the timeout caused by waiting for resolution of several servers */ fprintf(stderr, "Exiting, name server cannot be used: %s (%d)", gai_strerror(error), error); msyslog(LOG_ERR, "name server cannot be used: %s (%d)\n", gai_strerror(error), error); exit(1); } fprintf(stderr, "Error resolving %s: %s (%d)\n", serv, gai_strerror(error), error); msyslog(LOG_ERR, "Can't find host %s: %s (%d)\n", serv, gai_strerror(error), error); return; } #ifdef DEBUG if (debug) { ZERO(addr); INSIST(addrResult->ai_addrlen <= sizeof(addr)); memcpy(&addr, addrResult->ai_addr, addrResult->ai_addrlen); fprintf(stderr, "host found : %s\n", stohost(&addr)); } #endif /* We must get all returned server in case the first one fails */ for (ptr = addrResult; ptr != NULL; ptr = ptr->ai_next) { ZERO(addr); INSIST(ptr->ai_addrlen <= sizeof(addr)); memcpy(&addr, ptr->ai_addr, ptr->ai_addrlen); if (is_reachable(&addr)) { server = emalloc_zero(sizeof(*server)); memcpy(&server->srcadr, ptr->ai_addr, ptr->ai_addrlen); server->event_time = ++sys_numservers; if (sys_servers == NULL) sys_servers = server; else { struct server *sp; for (sp = sys_servers; sp->next_server != NULL; sp = sp->next_server) /* empty */; sp->next_server = server; } } } freeaddrinfo(addrResult); } /* * findserver - find a server in the list given its address * ***(For now it isn't totally AF-Independant, to check later..) */ static struct server * findserver( sockaddr_u *addr ) { struct server *server; struct server *mc_server; mc_server = NULL; if (SRCPORT(addr) != NTP_PORT) return 0; for (server = sys_servers; server != NULL; server = server->next_server) { if (SOCK_EQ(addr, &server->srcadr)) return server; if (AF(addr) == AF(&server->srcadr)) { if (IS_MCAST(&server->srcadr)) mc_server = server; } } if (mc_server != NULL) { struct server *sp; if (mc_server->event_time != 0) { mc_server->event_time = 0; complete_servers++; } server = emalloc_zero(sizeof(*server)); server->srcadr = *addr; server->event_time = ++sys_numservers; for (sp = sys_servers; sp->next_server != NULL; sp = sp->next_server) /* empty */; sp->next_server = server; transmit(server); } return NULL; } /* * timer - process a timer interrupt */ void timer(void) { struct server *server; /* * Bump the current idea of the time */ current_time++; /* * Search through the server list looking for guys * who's event timers have expired. Give these to * the transmit routine. */ for (server = sys_servers; server != NULL; server = server->next_server) { if (server->event_time != 0 && server->event_time <= current_time) transmit(server); } } /* * The code duplication in the following subroutine sucks, but * we need to appease ansi2knr. */ #ifndef SYS_WINNT /* * alarming - record the occurance of an alarm interrupt */ static RETSIGTYPE alarming( int sig ) { alarm_flag++; } #else /* SYS_WINNT follows */ void CALLBACK alarming(UINT uTimerID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) { UNUSED_ARG(uTimerID); UNUSED_ARG(uMsg); UNUSED_ARG(dwUser); UNUSED_ARG(dw1); UNUSED_ARG(dw2); alarm_flag++; } static void callTimeEndPeriod(void) { timeEndPeriod( wTimerRes ); wTimerRes = 0; } #endif /* SYS_WINNT */ /* * init_alarm - set up the timer interrupt */ static void init_alarm(void) { #ifndef SYS_WINNT # ifdef HAVE_TIMER_CREATE struct itimerspec its; # else struct itimerval itv; # endif #else /* SYS_WINNT follows */ TIMECAPS tc; UINT wTimerID; HANDLE hToken; TOKEN_PRIVILEGES tkp; DWORD dwUser = 0; #endif /* SYS_WINNT */ alarm_flag = 0; #ifndef SYS_WINNT # ifdef HAVE_TIMER_CREATE alarm_flag = 0; /* this code was put in as setitimer() is non existant this us the * POSIX "equivalents" setup - casey */ /* ntpdate_timerid is global - so we can kill timer later */ if (timer_create (CLOCK_REALTIME, NULL, &ntpdate_timerid) == # ifdef SYS_VXWORKS ERROR # else -1 # endif ) { fprintf (stderr, "init_alarm(): timer_create (...) FAILED\n"); return; } /* TIMER_HZ = (5) * Set up the alarm interrupt. The first comes 1/(2*TIMER_HZ) * seconds from now and they continue on every 1/TIMER_HZ seconds. */ signal_no_reset(SIGALRM, alarming); its.it_interval.tv_sec = 0; its.it_value.tv_sec = 0; its.it_interval.tv_nsec = 1000000000/TIMER_HZ; its.it_value.tv_nsec = 1000000000/(TIMER_HZ<<1); timer_settime(ntpdate_timerid, 0 /* !TIMER_ABSTIME */, &its, NULL); # else /* !HAVE_TIMER_CREATE follows */ /* * Set up the alarm interrupt. The first comes 1/(2*TIMER_HZ) * seconds from now and they continue on every 1/TIMER_HZ seconds. */ signal_no_reset(SIGALRM, alarming); itv.it_interval.tv_sec = 0; itv.it_value.tv_sec = 0; itv.it_interval.tv_usec = 1000000/TIMER_HZ; itv.it_value.tv_usec = 1000000/(TIMER_HZ<<1); setitimer(ITIMER_REAL, &itv, NULL); # endif /* !HAVE_TIMER_CREATE */ #else /* SYS_WINNT follows */ _tzset(); /* * Get privileges needed for fiddling with the clock */ /* get the current process token handle */ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) { msyslog(LOG_ERR, "OpenProcessToken failed: %m"); exit(1); } /* get the LUID for system-time privilege. */ LookupPrivilegeValue(NULL, SE_SYSTEMTIME_NAME, &tkp.Privileges[0].Luid); tkp.PrivilegeCount = 1; /* one privilege to set */ tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; /* get set-time privilege for this process. */ AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,(PTOKEN_PRIVILEGES) NULL, 0); /* cannot test return value of AdjustTokenPrivileges. */ if (GetLastError() != ERROR_SUCCESS) msyslog(LOG_ERR, "AdjustTokenPrivileges failed: %m"); /* * Set up timer interrupts for every 2**EVENT_TIMEOUT seconds * Under Win/NT, expiry of timer interval leads to invocation * of a callback function (on a different thread) rather than * generating an alarm signal */ /* determine max and min resolution supported */ if(timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR) { msyslog(LOG_ERR, "timeGetDevCaps failed: %m"); exit(1); } wTimerRes = min(max(tc.wPeriodMin, TARGET_RESOLUTION), tc.wPeriodMax); /* establish the minimum timer resolution that we'll use */ timeBeginPeriod(wTimerRes); atexit(callTimeEndPeriod); /* start the timer event */ wTimerID = timeSetEvent( (UINT) (1000/TIMER_HZ), /* Delay */ wTimerRes, /* Resolution */ (LPTIMECALLBACK) alarming, /* Callback function */ (DWORD) dwUser, /* User data */ TIME_PERIODIC); /* Event type (periodic) */ if (wTimerID == 0) { msyslog(LOG_ERR, "timeSetEvent failed: %m"); exit(1); } #endif /* SYS_WINNT */ } /* * We do asynchronous input using the SIGIO facility. A number of * recvbuf buffers are preallocated for input. In the signal * handler we poll to see if the socket is ready and read the * packets from it into the recvbuf's along with a time stamp and * an indication of the source host and the interface it was received * through. This allows us to get as accurate receive time stamps * as possible independent of other processing going on. * * We allocate a number of recvbufs equal to the number of servers * plus 2. This should be plenty. */ /* * init_io - initialize I/O data and open socket */ static void init_io(void) { struct addrinfo *res, *ressave; struct addrinfo hints; sockaddr_u addr; char service[5]; int rc; int optval = 1; int check_ntp_port_in_use = !debug && !simple_query && !unpriv_port; /* * Init buffer free list and stat counters */ init_recvbuff(sys_numservers + 2); /* * Open the socket */ strncpy(service, "ntp", sizeof(service)); /* * Init hints addrinfo structure */ ZERO(hints); hints.ai_family = ai_fam_templ; hints.ai_flags = AI_PASSIVE; hints.ai_socktype = SOCK_DGRAM; if (getaddrinfo(NULL, service, &hints, &res) != 0) { msyslog(LOG_ERR, "getaddrinfo() failed: %m"); exit(1); /*NOTREACHED*/ } #ifdef SYS_WINNT if (check_ntp_port_in_use && ntp_port_inuse(AF_INET, NTP_PORT)){ msyslog(LOG_ERR, "the NTP socket is in use, exiting: %m"); exit(1); } #endif /* Remember the address of the addrinfo structure chain */ ressave = res; /* * For each structure returned, open and bind socket */ for(nbsock = 0; (nbsock < MAX_AF) && res ; res = res->ai_next) { /* create a datagram (UDP) socket */ fd[nbsock] = socket(res->ai_family, res->ai_socktype, res->ai_protocol); if (fd[nbsock] == SOCKET_ERROR) { #ifndef SYS_WINNT if (errno == EPROTONOSUPPORT || errno == EAFNOSUPPORT || errno == EPFNOSUPPORT) #else int err = WSAGetLastError(); if (err == WSAEPROTONOSUPPORT || err == WSAEAFNOSUPPORT || err == WSAEPFNOSUPPORT) #endif continue; msyslog(LOG_ERR, "socket() failed: %m"); exit(1); /*NOTREACHED*/ } /* set socket to reuse address */ if (setsockopt(fd[nbsock], SOL_SOCKET, SO_REUSEADDR, (void*) &optval, sizeof(optval)) < 0) { msyslog(LOG_ERR, "setsockopt() SO_REUSEADDR failed: %m"); exit(1); /*NOTREACHED*/ } #ifdef IPV6_V6ONLY /* Restricts AF_INET6 socket to IPv6 communications (see RFC 2553bis-03) */ if (res->ai_family == AF_INET6) if (setsockopt(fd[nbsock], IPPROTO_IPV6, IPV6_V6ONLY, (void*) &optval, sizeof(optval)) < 0) { msyslog(LOG_ERR, "setsockopt() IPV6_V6ONLY failed: %m"); exit(1); /*NOTREACHED*/ } #endif /* Remember the socket family in fd_family structure */ fd_family[nbsock] = res->ai_family; /* * bind the socket to the NTP port */ if (check_ntp_port_in_use) { ZERO(addr); INSIST(res->ai_addrlen <= sizeof(addr)); memcpy(&addr, res->ai_addr, res->ai_addrlen); rc = bind(fd[nbsock], &addr.sa, SOCKLEN(&addr)); if (rc < 0) { if (EADDRINUSE == socket_errno()) msyslog(LOG_ERR, "the NTP socket is in use, exiting"); else msyslog(LOG_ERR, "bind() fails: %m"); exit(1); } } #ifdef HAVE_POLL_H fdmask[nbsock].fd = fd[nbsock]; fdmask[nbsock].events = POLLIN; #else FD_SET(fd[nbsock], &fdmask); if (maxfd < fd[nbsock]+1) { maxfd = fd[nbsock]+1; } #endif /* * set non-blocking, */ #ifndef SYS_WINNT # ifdef SYS_VXWORKS { int on = TRUE; if (ioctl(fd[nbsock],FIONBIO, &on) == ERROR) { msyslog(LOG_ERR, "ioctl(FIONBIO) fails: %m"); exit(1); } } # else /* not SYS_VXWORKS */ # if defined(O_NONBLOCK) if (fcntl(fd[nbsock], F_SETFL, O_NONBLOCK) < 0) { msyslog(LOG_ERR, "fcntl(FNDELAY|FASYNC) fails: %m"); exit(1); /*NOTREACHED*/ } # else /* not O_NONBLOCK */ # if defined(FNDELAY) if (fcntl(fd[nbsock], F_SETFL, FNDELAY) < 0) { msyslog(LOG_ERR, "fcntl(FNDELAY|FASYNC) fails: %m"); exit(1); /*NOTREACHED*/ } # else /* FNDELAY */ # include "Bletch: Need non blocking I/O" # endif /* FNDELAY */ # endif /* not O_NONBLOCK */ # endif /* SYS_VXWORKS */ #else /* SYS_WINNT */ if (ioctlsocket(fd[nbsock], FIONBIO, (u_long *) &on) == SOCKET_ERROR) { msyslog(LOG_ERR, "ioctlsocket(FIONBIO) fails: %m"); exit(1); } #endif /* SYS_WINNT */ nbsock++; } freeaddrinfo(ressave); } /* * sendpkt - send a packet to the specified destination */ static void sendpkt( sockaddr_u *dest, struct pkt *pkt, int len ) { int i; int cc; SOCKET sock = INVALID_SOCKET; #ifdef SYS_WINNT DWORD err; #endif /* SYS_WINNT */ /* Find a local family compatible socket to send ntp packet to ntp server */ for(i = 0; (i < MAX_AF); i++) { if(AF(dest) == fd_family[i]) { sock = fd[i]; break; } } if (INVALID_SOCKET == sock) { msyslog(LOG_ERR, "cannot find family compatible socket to send ntp packet"); exit(1); /*NOTREACHED*/ } cc = sendto(sock, (char *)pkt, len, 0, (struct sockaddr *)dest, SOCKLEN(dest)); if (SOCKET_ERROR == cc) { #ifndef SYS_WINNT if (errno != EWOULDBLOCK && errno != ENOBUFS) #else err = WSAGetLastError(); if (err != WSAEWOULDBLOCK && err != WSAENOBUFS) #endif /* SYS_WINNT */ msyslog(LOG_ERR, "sendto(%s): %m", stohost(dest)); } } /* * input_handler - receive packets asynchronously */ void input_handler(void) { register int n; register struct recvbuf *rb; struct sock_timeval tvzero; GETSOCKNAME_SOCKLEN_TYPE fromlen; l_fp ts; int i; #ifdef HAVE_POLL_H struct pollfd fds[MAX_AF]; #else fd_set fds; #endif int fdc = 0; /* * Do a poll to see if we have data */ for (;;) { tvzero.tv_sec = tvzero.tv_usec = 0; #ifdef HAVE_POLL_H memcpy(fds, fdmask, sizeof(fdmask)); n = poll(fds, (unsigned int)nbsock, tvzero.tv_sec * 1000); /* * Determine which socket received data */ for(i=0; i < nbsock; i++) { if(fds[i].revents & POLLIN) { fdc = fd[i]; break; } } #else fds = fdmask; n = select(maxfd, &fds, (fd_set *)0, (fd_set *)0, &tvzero); /* * Determine which socket received data */ for(i=0; i < nbsock; i++) { if(FD_ISSET(fd[i], &fds)) { fdc = fd[i]; break; } } #endif /* * If nothing to do, just return. If an error occurred, * complain and return. If we've got some, freeze a * timestamp. */ if (n == 0) return; else if (n == -1) { if (errno != EINTR) msyslog(LOG_ERR, #ifdef HAVE_POLL_H "poll() error: %m" #else "select() error: %m" #endif ); return; } get_systime(&ts); /* * Get a buffer and read the frame. If we * haven't got a buffer, or this is received * on the wild card socket, just dump the packet. */ if (initializing || free_recvbuffs() == 0) { char buf[100]; #ifndef SYS_WINNT (void) read(fdc, buf, sizeof buf); #else /* NT's _read does not operate on nonblocking sockets * either recvfrom or ReadFile() has to be used here. * ReadFile is used in [ntpd]ntp_intres() and ntpdc, * just to be different use recvfrom() here */ recvfrom(fdc, buf, sizeof(buf), 0, (struct sockaddr *)0, NULL); #endif /* SYS_WINNT */ continue; } rb = get_free_recv_buffer(); fromlen = sizeof(rb->recv_srcadr); rb->recv_length = recvfrom(fdc, (char *)&rb->recv_pkt, sizeof(rb->recv_pkt), 0, (struct sockaddr *)&rb->recv_srcadr, &fromlen); if (rb->recv_length == -1) { freerecvbuf(rb); continue; } /* * Got one. Mark how and when it got here, * put it on the full list. */ rb->recv_time = ts; add_full_recv_buffer(rb); } } #if !defined SYS_WINNT && !defined SYS_CYGWIN32 /* * adj_systime - do a big long slew of the system time */ static int l_adj_systime( l_fp *ts ) { struct timeval adjtv, oadjtv; int isneg = 0; l_fp offset; #ifndef STEP_SLEW l_fp overshoot; #endif /* * Take the absolute value of the offset */ offset = *ts; if (L_ISNEG(&offset)) { isneg = 1; L_NEG(&offset); } #ifndef STEP_SLEW /* * Calculate the overshoot. XXX N.B. This code *knows* * ADJ_OVERSHOOT is 1/2. */ overshoot = offset; L_RSHIFTU(&overshoot); if (overshoot.l_ui != 0 || (overshoot.l_uf > ADJ_MAXOVERSHOOT)) { overshoot.l_ui = 0; overshoot.l_uf = ADJ_MAXOVERSHOOT; } L_ADD(&offset, &overshoot); #endif TSTOTV(&offset, &adjtv); if (isneg) { adjtv.tv_sec = -adjtv.tv_sec; adjtv.tv_usec = -adjtv.tv_usec; } if (adjtv.tv_usec != 0 && !debug) { if (adjtime(&adjtv, &oadjtv) < 0) { msyslog(LOG_ERR, "Can't adjust the time of day: %m"); return 0; } } return 1; } #endif /* SYS_WINNT */ /* * This fuction is not the same as lib/systime step_systime!!! */ static int l_step_systime( l_fp *ts ) { double dtemp; #ifdef SLEWALWAYS #ifdef STEP_SLEW l_fp ftmp; int isneg; int n; if (debug) return 1; /* * Take the absolute value of the offset */ ftmp = *ts; if (L_ISNEG(&ftmp)) { L_NEG(&ftmp); isneg = 1; } else isneg = 0; if (ftmp.l_ui >= 3) { /* Step it and slew - we might win */ LFPTOD(ts, dtemp); n = step_systime(dtemp); if (!n) return n; if (isneg) ts->l_ui = ~0; else ts->l_ui = ~0; } /* * Just add adjustment into the current offset. The update * routine will take care of bringing the system clock into * line. */ #endif if (debug) return 1; #ifdef FORCE_NTPDATE_STEP LFPTOD(ts, dtemp); return step_systime(dtemp); #else l_adj_systime(ts); return 1; #endif #else /* SLEWALWAYS */ if (debug) return 1; LFPTOD(ts, dtemp); return step_systime(dtemp); #endif /* SLEWALWAYS */ } /* XXX ELIMINATE printserver similar in ntptrace.c, ntpdate.c */ /* * printserver - print detail information for a server */ static void printserver( register struct server *pp, FILE *fp ) { register int i; char junk[5]; const char *str; if (!debug) { (void) fprintf(fp, "server %s, stratum %d, offset %s, delay %s\n", stoa(&pp->srcadr), pp->stratum, lfptoa(&pp->offset, 6), fptoa((s_fp)pp->delay, 5)); return; } (void) fprintf(fp, "server %s, port %d\n", stoa(&pp->srcadr), ntohs(((struct sockaddr_in*)&(pp->srcadr))->sin_port)); (void) fprintf(fp, "stratum %d, precision %d, leap %c%c, trust %03o\n", pp->stratum, pp->precision, pp->leap & 0x2 ? '1' : '0', pp->leap & 0x1 ? '1' : '0', pp->trust); if (pp->stratum == 1) { junk[4] = 0; memmove(junk, (char *)&pp->refid, 4); str = junk; } else { str = stoa(&pp->srcadr); } (void) fprintf(fp, "refid [%s], delay %s, dispersion %s\n", str, fptoa((s_fp)pp->delay, 5), ufptoa(pp->dispersion, 5)); (void) fprintf(fp, "transmitted %d, in filter %d\n", pp->xmtcnt, pp->filter_nextpt); (void) fprintf(fp, "reference time: %s\n", prettydate(&pp->reftime)); (void) fprintf(fp, "originate timestamp: %s\n", prettydate(&pp->org)); (void) fprintf(fp, "transmit timestamp: %s\n", prettydate(&pp->xmt)); (void) fprintf(fp, "filter delay: "); for (i = 0; i < NTP_SHIFT; i++) { (void) fprintf(fp, " %-8.8s", fptoa(pp->filter_delay[i], 5)); if (i == (NTP_SHIFT>>1)-1) (void) fprintf(fp, "\n "); } (void) fprintf(fp, "\n"); (void) fprintf(fp, "filter offset:"); for (i = 0; i < PEER_SHIFT; i++) { (void) fprintf(fp, " %-8.8s", lfptoa(&pp->filter_offset[i], 6)); if (i == (PEER_SHIFT>>1)-1) (void) fprintf(fp, "\n "); } (void) fprintf(fp, "\n"); (void) fprintf(fp, "delay %s, dispersion %s\n", fptoa((s_fp)pp->delay, 5), ufptoa(pp->dispersion, 5)); (void) fprintf(fp, "offset %s\n\n", lfptoa(&pp->offset, 6)); } #ifdef HAVE_NETINFO static ni_namelist * getnetinfoservers(void) { ni_status status; void *domain; ni_id confdir; ni_namelist *namelist = emalloc(sizeof(ni_namelist)); /* Find a time server in NetInfo */ if ((status = ni_open(NULL, ".", &domain)) != NI_OK) return NULL; while (status = ni_pathsearch(domain, &confdir, NETINFO_CONFIG_DIR) == NI_NODIR) { void *next_domain; if (ni_open(domain, "..", &next_domain) != NI_OK) break; ni_free(domain); domain = next_domain; } if (status != NI_OK) return NULL; NI_INIT(namelist); if (ni_lookupprop(domain, &confdir, "server", namelist) != NI_OK) { ni_namelist_free(namelist); free(namelist); return NULL; } return(namelist); } #endif #ifdef SYS_WINNT isc_boolean_t ntp_port_inuse(int af, u_short port) { /* * Check if NTP socket is already in use on this system * This is only for Windows Systems, as they tend not to fail on the real bind() below */ SOCKET checksocket; struct sockaddr_in checkservice; checksocket = socket(af, SOCK_DGRAM, 0); if (checksocket == INVALID_SOCKET) { return (ISC_TRUE); } checkservice.sin_family = (short) AF_INET; checkservice.sin_addr.s_addr = INADDR_LOOPBACK; checkservice.sin_port = htons(port); if (bind(checksocket, (struct sockaddr *)&checkservice, sizeof(checkservice)) == SOCKET_ERROR) { if ( WSAGetLastError() == WSAEADDRINUSE ){ closesocket(checksocket); return (ISC_TRUE); } } closesocket(checksocket); return (ISC_FALSE); } #endif ntp-4.2.6p5/readme.y2kfixes0000644000175000017500000002000010017034520014514 0ustar peterpeter AT&T Freeware Year 2000 Certification ==================================== This is the "readme" file for the freeware application which has been certified by AT&T Labs as part of the "Freeware Y2K Certification Project". DISCLAIMER ---------- For its own internal business purposes AT&T Labs has assessed various programs obtained from the Internet for Year-2000 (Y2K) readiness that were not sufficiently certified for AT&T's needs. As a service to the computing community AT&T Labs is freely releasing this information to the public as a series of "Y2K Application Updates", one update for what AT&T Labs considers an "application". For use outside of AT&T, AT&T Labs is not certifying this information is correct, that any software, including repairs and tests, will help others in any way, survive the year 2000, nor work with current applications. Nor is AT&T taking any responsibility for repairing any Y2K problems that were overlooked nor repairing any bugs in any "Y2K Application Update". All risk of using this Y2K Application Update remains with the user who is expected to test that this update meets their needs. LICENSE TO USE AT&T's intent is to ensure these Y2K patches are freely available to the public but will not maintain a public web site for their distribution. Any copyright claims only only apply to the specific changes made by Y2K to the code. Any original copyright holders retain rights to unchanged code. Wherever possible patches will be returned to the current owner(s) of the code. Owners and publishers are free to incorporate appropriate patches, upgrades, and tests within legal future distributions as long as they include the credit: Various Y2K updates and tests provided by AT&T Labs. Copyright 1999 AT&T. and any AT&T "comments" on the changed code remain intact. Any distributions of the updates must keep the entire update intact, without any change, including copyright and disclaimer information. If integrated with the original application items not needed for an integrated release may be omitted. When distributed on the same media as the original application there must be no charge for this "Y2k Application Update". CONTACTS If you find any overlooked Y2K problems, or have other strictly Y2K repairs for the software, please E-mail: y2k@y2k.labs.att.com This address is strictly reserved for the topic at hand. AT&T makes no commitments to answer any E-mail to this address. AT&T is free to use any submissions, including publishing in future Y2K related release notes, without payment or advance notice to the submitting person or persons... appropriate credit will be given in any future publications to the first person submitting something that AT&T uses. ====================================================================== Perl ver - 4.036 No. of Repairs: 2 Repairs Compilation of Patches Required: No OS Tested: Solaris 2.6 ====================================================================== ORGANIZATION OF THE "Y2KFixes" DIRECTORY The "Y2KFixes" directory has been included in the archive to give you information about the Y2K testing that was conducted and their results. The Y2KFixes directory contains at least the following three files: |----> NOTES.y2kfixes -- Technical details about the Y2K Testing |----> Readme.y2kfixes -- this Readme file |----> Results.y2kfixes -- The results of Y2K Environment Tests The directory may contain additional files and/or directories, as appropriate to the application, to provide the exact snapshots. ====================================================================== INSTALLING THE "PATCHES" If you have downloaded a "patch", then you may install it as follows: At the same level as the source directory, invoke: patch -p < *.patches The patch file contains a header which has a manifest of changed files. ====================================================================== ADDITIONAL INSTRUCTIONS: 1) Extract the patches into perl-4.036 directory which is top level directory for the perl4 source. 2) cd to Y2KFixes. 3) It will have y2k directory which contains regression tests for Y2K testing. 4) now cd to ../t which contains TEST file for running this regression tests. 5) run TEST, see the results & apply patches. 6) Once you apply the patch, you need to run a shell script in x2p/find2perl.SH which will generate find2perl. ====================================================================== SUPPORT See http://y2k.labs.att.com/freeware. There will be no ongoing support for the project. But if you have some very important issue, you may email us at: y2k@y2k.labs.att.com ntp-4.2.6p5/README.hackers0000644000175000017500000000053411307651603014114 0ustar peterpeterNotes to hackers. See README.patches for information about submitting patches. --- Dave likes this code indented formatted in a consistent way. The file "dot.emacs" has the emacs C-mode indentation style that Dave likes. --- We'd like to see *all* system function declarations live in include/l_stdlib.h and NEVER appear in the .c files. --- ntp-4.2.6p5/adjtimed/0000755000175000017500000000000011675461365013410 5ustar peterpeterntp-4.2.6p5/adjtimed/Makefile.in0000644000175000017500000005467411675460274015473 0ustar peterpeter# 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@ # we traditionally installed software in bindir, while it should have gone # in sbindir. Now that we offer a choice, look in the "other" installation # subdir to warn folks if there is another version there. 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@ EXTRA_PROGRAMS = adjtimed$(EXEEXT) DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf subdir = adjtimed ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/define_dir.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_cacheversion.m4 \ $(top_srcdir)/m4/ntp_dir_sep.m4 \ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \ $(top_srcdir)/m4/ntp_openssl.m4 \ $(top_srcdir)/m4/ntp_vpathhack.m4 \ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) adjtimed_SOURCES = adjtimed.c adjtimed_OBJECTS = adjtimed.$(OBJEXT) adjtimed_LDADD = $(LDADD) adjtimed_DEPENDENCIES = ../libntp/libntp.a DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = adjtimed.c DIST_SOURCES = adjtimed.c ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ 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@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SH = @PATH_SH@ PATH_TEST = @PATH_TEST@ POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CFLAGS = @SNMP_CFLAGS@ SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ SNMP_LIBS = @SNMP_LIBS@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ VERSION = @VERSION@ 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_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@ AUTOMAKE_OPTIONS = @NTP_BINSUBDIR_IS_BIN_TRUE@bin_PROGRAMS = @MAKE_ADJTIMED@ @NTP_BINSUBDIR_IS_BIN_FALSE@sbin_PROGRAMS = @MAKE_ADJTIMED@ BUILT_SOURCES = .deps-ver CLEANFILES = .deps-ver AM_CPPFLAGS = -I$(top_srcdir)/include LDADD = ../libntp/libntp.a ETAGS_ARGS = Makefile.am all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf $(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 adjtimed/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign adjtimed/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-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list adjtimed$(EXEEXT): $(adjtimed_OBJECTS) $(adjtimed_DEPENDENCIES) @rm -f adjtimed$(EXEEXT) $(LINK) $(adjtimed_OBJECTS) $(adjtimed_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimed.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS .MAKE: all check install install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-sbinPROGRAMS install-exec-hook: @case ${BINSUBDIR} in \ bin) ODIR=${sbindir} ;; \ sbin) ODIR=${bindir} ;; \ esac; \ test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \ test ! -f $$ODIR/$$i || echo "*** $$i is also in $$ODIR!"; \ done # $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ chmod ug+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ $(MAKE) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ mkdir $(DEPDIR) && \ case "$(top_builddir)" in \ .) \ ./config.status Makefile depfiles \ ;; \ ..) \ cd .. && \ ./config.status $(subdir)/Makefile depfiles && \ cd $(subdir) \ ;; \ *) \ echo 'Fatal: depsver.mf Automake fragment limited' \ 'to immediate subdirectories.' && \ echo "top_builddir: $(top_builddir)" && \ echo "subdir: $(subdir)" && \ exit 1 \ ;; \ esac && \ echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver @touch $@ # # depsver.mf included in Makefile.am for directories with .deps # # When building in the same directory with sources that change over # time, such as when tracking using bk, the .deps files can become # stale with respect to moved, deleted, or superceded headers. Most # commonly, this would exhibit as make reporting a failure to make a # header file which is no longer in the location given. To address # this issue, we use a deps-ver file which is updated with each change # that breaks old .deps files. A copy of deps-ver is made into # $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present # with different contents than deps-ver, we make clean to ensure all # .o files built before the incompatible change are rebuilt along with # their updated .deps files, then remove $(DEPDIR) and recreate it as # empty stubs. # # It is normal when configured with --disable-dependency-tracking for # the DEPDIR to not have been created. For this reason, we use the # intermediate target .deps-ver, which invokes make recursively if # DEPDIR exists. # # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # # This comment block follows rather than leads the related code so that # it stays with it in the generated Makefile.in and Makefile. # # 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: ntp-4.2.6p5/adjtimed/Makefile.am0000644000175000017500000000050511314114377015430 0ustar peterpeterAUTOMAKE_OPTIONS= if NTP_BINSUBDIR_IS_BIN bin_PROGRAMS= @MAKE_ADJTIMED@ else sbin_PROGRAMS= @MAKE_ADJTIMED@ endif BUILT_SOURCES= CLEANFILES= EXTRA_PROGRAMS= adjtimed AM_CPPFLAGS= -I$(top_srcdir)/include LDADD= ../libntp/libntp.a ETAGS_ARGS= Makefile.am include $(top_srcdir)/bincheck.mf include $(top_srcdir)/depsver.mf ntp-4.2.6p5/adjtimed/README0000644000175000017500000000200610017034521014241 0ustar peterpeter------------------------------------------------------------------------------ The adjtimed daemon emulates the BSD adjtime(2) system call. The adjtime() routine communicates with this daemon via SYSV messages. The emulation uses an undocumented kernel variable (as of 6.0/2.0 and later releases) and as such it cannot be guaranteed to work in future HP-UX releases. Perhaps HP-UX will have a real adjtime(2) system call in the future. Author: Tai Jin (tai@sde.hp.com) ------------------------------------------------------------------------------ IMPORTANT NOTE: This stuff must be compiled with no optimization !! NOTE: This code is known to work as of 8.0 on s300's, s700's and s800's. PLEASE do not modify it unless you have access to kernel sources and fully understand the implications of any changes you are making. One person already has trashed adjtimed by making it do "the right thing". This is not an exact replacement for BSD adjtime(2), don't try to make it into one. -- Ken ntp-4.2.6p5/adjtimed/adjtimed.c0000644000175000017500000002673710017034521015327 0ustar peterpeter/*************************************************************************/ /* (c) Copyright Tai Jin, 1988. All Rights Reserved. */ /* Hewlett-Packard Laboratories. */ /* */ /* Permission is hereby granted for unlimited modification, use, and */ /* distribution. This software is made available with no warranty of */ /* any kind, express or implied. This copyright notice must remain */ /* intact in all versions of this software. */ /* */ /* The author would appreciate it if any bug fixes and enhancements were */ /* to be sent back to him for incorporation into future versions of this */ /* software. Please send changes to tai@iag.hp.com or ken@sdd.hp.com. */ /*************************************************************************/ #ifndef lint static char RCSid[] = "adjtimed.c,v 3.1 1993/07/06 01:04:45 jbj Exp"; #endif /* * Adjust time daemon. * This daemon adjusts the rate of the system clock a la BSD's adjtime(). * The adjtime() routine uses SYSV messages to communicate with this daemon. * * Caveat: This emulation uses an undocumented kernel variable. As such, it * cannot be guaranteed to work in future HP-UX releases. Fortunately, * it will no longer be needed in HPUX 10.01 and later. */ #include #include #include #include #include #include #include #include #include #include #include #include "ntp_syslog.h" #include "ntp_stdlib.h" #include "adjtime.h" double atof (const char *); int InitClockRate (void); int AdjustClockRate (register struct timeval *delta, register struct timeval *olddelta); long GetClockRate (void); int SetClockRate (long); void ResetClockRate (void); void Cleanup (void); void Exit (int); #define MILLION 1000000L /* emacs cc-mode goes nuts if we split the next line... */ #define tvtod(tv) ((double)tv.tv_sec + ((double)tv.tv_usec / (double)MILLION)) char *progname = NULL; int verbose = 0; int sysdebug = 0; static int mqid; static double oldrate = 0.0; int main( int argc, char *argv[] ) { struct timeval remains; struct sigvec vec; MsgBuf msg; char ch; int nofork = 0; int fd; progname = argv[0]; #ifdef LOG_LOCAL6 openlog("adjtimed", LOG_PID, LOG_LOCAL6); #else openlog("adjtimed", LOG_PID); #endif while ((ch = ntp_getopt(argc, argv, "hkrvdfp:")) != EOF) { switch (ch) { case 'k': case 'r': if ((mqid = msgget(KEY, 0)) != -1) { if (msgctl(mqid, IPC_RMID, (struct msqid_ds *)0) == -1) { msyslog(LOG_ERR, "remove old message queue: %m"); perror("adjtimed: remove old message queue"); exit(1); } } if (ch == 'k') exit(0); break; case 'v': ++verbose, nofork = 1; break; case 'd': ++sysdebug; break; case 'f': nofork = 1; break; case 'p': fputs("adjtimed: -p option ignored\n", stderr); break; default: puts("usage: adjtimed -hkrvdf"); puts("-h\thelp"); puts("-k\tkill existing adjtimed, if any"); puts("-r\trestart (kills existing adjtimed, if any)"); puts("-v\tdebug output (repeat for more output)"); puts("-d\tsyslog output (repeat for more output)"); puts("-f\tno fork"); msyslog(LOG_ERR, "usage error"); exit(1); } /* switch */ } /* while */ if (!nofork) { switch (fork()) { case 0: close(fileno(stdin)); close(fileno(stdout)); close(fileno(stderr)); #ifdef TIOCNOTTY if ((fd = open("/dev/tty")) != -1) { ioctl(fd, TIOCNOTTY, 0); close(fd); } #else setpgrp(); #endif break; case -1: msyslog(LOG_ERR, "fork: %m"); perror("adjtimed: fork"); exit(1); default: exit(0); } /* switch */ } /* if */ if (nofork) { setvbuf(stdout, NULL, _IONBF, BUFSIZ); setvbuf(stderr, NULL, _IONBF, BUFSIZ); } msyslog(LOG_INFO, "started"); if (verbose) printf("adjtimed: started\n"); if (InitClockRate() == -1) Exit(2); (void)signal(SIGHUP, SIG_IGN); (void)signal(SIGINT, SIG_IGN); (void)signal(SIGQUIT, SIG_IGN); (void)signal(SIGTERM, Cleanup); vec.sv_handler = ResetClockRate; vec.sv_flags = 0; vec.sv_mask = ~0; sigvector(SIGALRM, &vec, (struct sigvec *)0); if (msgget(KEY, IPC_CREAT|IPC_EXCL) == -1) { if (errno == EEXIST) { msyslog(LOG_ERR, "message queue already exists, use -r to remove it"); fputs("adjtimed: message queue already exists, use -r to remove it\n", stderr); Exit(1); } msyslog(LOG_ERR, "create message queue: %m"); perror("adjtimed: create message queue"); Exit(1); } if ((mqid = msgget(KEY, 0)) == -1) { msyslog(LOG_ERR, "get message queue id: %m"); perror("adjtimed: get message queue id"); Exit(1); } /* Lock process in memory to improve response time */ if (plock(PROCLOCK)) { msyslog(LOG_ERR, "plock: %m"); perror("adjtimed: plock"); Cleanup(); } /* Also raise process priority. * If we do not get run when we want, this leads to bad timekeeping * and "Previous time adjustment didn't complete" gripes from xntpd. */ if (nice(-10) == -1) { msyslog(LOG_ERR, "nice: %m"); perror("adjtimed: nice"); Cleanup(); } for (;;) { if (msgrcv(mqid, &msg.msgp, MSGSIZE, CLIENT, 0) == -1) { if (errno == EINTR) continue; msyslog(LOG_ERR, "read message: %m"); perror("adjtimed: read message"); Cleanup(); } switch (msg.msgb.code) { case DELTA1: case DELTA2: AdjustClockRate(&msg.msgb.tv, &remains); if (msg.msgb.code == DELTA2) { msg.msgb.tv = remains; msg.msgb.mtype = SERVER; while (msgsnd(mqid, &msg.msgp, MSGSIZE, 0) == -1) { if (errno == EINTR) continue; msyslog(LOG_ERR, "send message: %m"); perror("adjtimed: send message"); Cleanup(); } } if (remains.tv_sec + remains.tv_usec != 0L) { if (verbose) { printf("adjtimed: previous correction remaining %.6fs\n", tvtod(remains)); } if (sysdebug) { msyslog(LOG_INFO, "previous correction remaining %.6fs", tvtod(remains)); } } break; default: fprintf(stderr, "adjtimed: unknown message code %d\n", msg.msgb.code); msyslog(LOG_ERR, "unknown message code %d", msg.msgb.code); } /* switch */ } /* loop */ } /* main */ /* * Default clock rate (old_tick). */ #define DEFAULT_RATE (MILLION / HZ) #define UNKNOWN_RATE 0L #define TICK_ADJ 5 /* standard adjustment rate, microsec/tick */ static long default_rate = DEFAULT_RATE; static long tick_rate = HZ; /* ticks per sec */ static long slew_rate = TICK_ADJ * HZ; /* in microsec/sec */ int AdjustClockRate( register struct timeval *delta, register struct timeval *olddelta ) { register long rate, dt, leftover; struct itimerval period, remains; dt = (delta->tv_sec * MILLION) + delta->tv_usec; if (verbose) printf("adjtimed: new correction %.6fs\n", (double)dt / (double)MILLION); if (sysdebug) msyslog(LOG_INFO, "new correction %.6fs", (double)dt / (double)MILLION); if (verbose > 2) printf("adjtimed: leftover %ldus\n", leftover); if (sysdebug > 2) msyslog(LOG_INFO, "leftover %ldus", leftover); rate = dt; /* * Apply a slew rate of slew_rate over a period of dt/slew_rate seconds. */ if (dt > 0) { rate = slew_rate; } else { rate = -slew_rate; dt = -dt; } period.it_value.tv_sec = dt / slew_rate; period.it_value.tv_usec = (dt % slew_rate) * (MILLION / slew_rate); /* * Note: we assume the kernel will convert the specified period into ticks * using the modified clock rate rather than an assumed nominal clock rate, * and therefore will generate the timer interrupt after the specified * number of true seconds, not skewed seconds. */ if (verbose > 1) printf("adjtimed: will be complete in %lds %ldus\n", period.it_value.tv_sec, period.it_value.tv_usec); if (sysdebug > 1) msyslog(LOG_INFO, "will be complete in %lds %ldus", period.it_value.tv_sec, period.it_value.tv_usec); /* * adjust the clock rate */ if (dt) { if (SetClockRate((rate / tick_rate) + default_rate) == -1) { msyslog(LOG_ERR, "set clock rate: %m"); perror("adjtimed: set clock rate"); } } /* * start the timer * (do this after changing the rate because the period has been rounded down) */ period.it_interval.tv_sec = period.it_interval.tv_usec = 0L; setitimer(ITIMER_REAL, &period, &remains); /* * return old delta */ if (olddelta) { dt = ((remains.it_value.tv_sec * MILLION) + remains.it_value.tv_usec) * oldrate; olddelta->tv_sec = dt / MILLION; olddelta->tv_usec = dt - (olddelta->tv_sec * MILLION); } oldrate = (double)rate / (double)MILLION; return(0); } /* AdjustClockRate */ static struct nlist nl[] = { #ifdef __hp9000s800 #ifdef PRE7_0 { "tick" }, #else { "old_tick" }, #endif #else { "_old_tick" }, #endif { "" } }; static int kmem; /* * The return value is the clock rate in old_tick units or -1 if error. */ long GetClockRate(void) { long rate, mask; if (lseek(kmem, (off_t)nl[0].n_value, 0) == -1L) return (-1L); mask = sigblock(sigmask(SIGALRM)); if (read(kmem, (caddr_t)&rate, sizeof(rate)) != sizeof(rate)) rate = UNKNOWN_RATE; sigsetmask(mask); return (rate); } /* GetClockRate */ /* * The argument is the new rate in old_tick units. */ int SetClockRate( long rate ) { long mask; if (lseek(kmem, (off_t)nl[0].n_value, 0) == -1L) return (-1); mask = sigblock(sigmask(SIGALRM)); if (write(kmem, (caddr_t)&rate, sizeof(rate)) != sizeof(rate)) { sigsetmask(mask); return (-1); } sigsetmask(mask); if (rate != default_rate) { if (verbose > 3) { printf("adjtimed: clock rate (%lu) %ldus/s\n", rate, (rate - default_rate) * tick_rate); } if (sysdebug > 3) { msyslog(LOG_INFO, "clock rate (%lu) %ldus/s", rate, (rate - default_rate) * tick_rate); } } return (0); } /* SetClockRate */ int InitClockRate(void) { if ((kmem = open("/dev/kmem", O_RDWR)) == -1) { msyslog(LOG_ERR, "open(/dev/kmem): %m"); perror("adjtimed: open(/dev/kmem)"); return (-1); } nlist("/hp-ux", nl); if (nl[0].n_type == 0) { fputs("adjtimed: /hp-ux has no symbol table\n", stderr); msyslog(LOG_ERR, "/hp-ux has no symbol table"); return (-1); } /* * Set the default to the system's original value */ default_rate = GetClockRate(); if (default_rate == UNKNOWN_RATE) default_rate = DEFAULT_RATE; tick_rate = (MILLION / default_rate); slew_rate = TICK_ADJ * tick_rate; fprintf(stderr,"default_rate=%ld, tick_rate=%ld, slew_rate=%ld\n",default_rate,tick_rate,slew_rate); return (0); } /* InitClockRate */ /* * Reset the clock rate to the default value. */ void ResetClockRate(void) { struct itimerval it; it.it_value.tv_sec = it.it_value.tv_usec = 0L; setitimer(ITIMER_REAL, &it, (struct itimerval *)0); if (verbose > 2) puts("adjtimed: resetting the clock"); if (sysdebug > 2) msyslog(LOG_INFO, "resetting the clock"); if (GetClockRate() != default_rate) { if (SetClockRate(default_rate) == -1) { msyslog(LOG_ERR, "set clock rate: %m"); perror("adjtimed: set clock rate"); } } oldrate = 0.0; } /* ResetClockRate */ void Cleanup(void) { ResetClockRate(); if (msgctl(mqid, IPC_RMID, (struct msqid_ds *)0) == -1) { if (errno != EINVAL) { msyslog(LOG_ERR, "remove message queue: %m"); perror("adjtimed: remove message queue"); } } Exit(2); } /* Cleanup */ void Exit(status) int status; { msyslog(LOG_ERR, "terminated"); closelog(); if (kmem != -1) close(kmem); exit(status); } /* Exit */ ntp-4.2.6p5/Makefile.am0000644000175000017500000001105711505336023013647 0ustar peterpeter## LIBOPTS_CHECK_NOBUILD works with Automake 1.10 now AUTOMAKE_OPTIONS = foreign 1.10 ACLOCAL_AMFLAGS = -I m4 -I sntp/libopts/m4 NULL = SUBDIRS = SUBDIRS += \ scripts \ include \ ElectricFence \ libntp \ sntp \ libparse \ ntpd \ ntpdate \ ntpdc \ ntpq \ ntpsnmpd \ parseutil \ adjtimed \ clockstuff \ kernel \ util \ $(NULL) DIST_SUBDIRS = \ scripts \ include \ ElectricFence \ libntp \ libparse \ sntp \ ntpd \ ntpdate \ ntpdc \ ntpq \ ntpsnmpd \ parseutil \ adjtimed \ clockstuff \ kernel \ util \ $(NULL) DISTCHECK_CONFIGURE_FLAGS = -C EXTRA_DIST = \ $(srcdir)/COPYRIGHT \ ChangeLog \ CommitLog \ CommitLog-4.1.0 \ NEWS \ NOTES.y2kfixes \ README.bk \ README.hackers \ README.patches \ README.refclocks \ README.versions \ TODO \ WHERE-TO-START \ bootstrap \ build \ config.guess \ config.h.in \ config.sub \ dot.emacs \ excludes \ flock-build \ install-sh \ packageinfo.sh \ readme.y2kfixes \ results.y2kfixes \ \ conf \ html \ lib/isc \ ports \ \ bincheck.mf \ depsver.mf \ deps-ver \ $(srcdir)/version \ version.m4 \ \ $(NULL) CLEANFILES = DISTCLEANFILES = .gcc-warning ETAGS_ARGS = Makefile.am configure.ac # HMS: Keep .gcc-warning first, as that way it gets printed first. BUILT_SOURCES = \ .gcc-warning \ libtool \ $(srcdir)/COPYRIGHT \ $(srcdir)/version \ $(srcdir)/version.m4 \ $(srcdir)/include/version.def \ $(srcdir)/include/version.texi \ $(srcdir)/.checkChangeLog \ $(NULL) $(srcdir)/COPYRIGHT: $(srcdir)/html/copyright.html { echo "This file is automatically generated from html/copyright.html" ; \ lynx -dump $(srcdir)/html/copyright.html ;} > COPYRIGHT.new \ && mv -f COPYRIGHT.new $(srcdir)/COPYRIGHT COPYRIGHT-please: $(srcdir)/COPYRIGHT @: do-nothing action to prevent default \ This target is needed by sntp/Makefile.am on decrepit \ FreeBSD 6.x make which fails with "make COPYRIGHT" \ configured in $(srcdir) but "make ./COPYRIGHT" succeeds. \ Rather than determine our $(srcdir) from sntp/Makefile.am \ COPYRIGHT-please serves as a fixed target. # HMS: The next bit is still suboptimal. If bk is present but this NTP # repo is not a bk repo, we'll get an error message from the prs command. # Unfortunately, I haven't found the necessary magic to redirect this error # output to /dev/null under ancient/unique shells like the one Ultrix uses. # We'll also get an error if srcdir or version is unwritable. $(srcdir)/version: FRC.version -(bk version) >/dev/null 2>&1 && \ cd $(srcdir) && \ x=`bk -R prs -hr+ -nd:I: ChangeSet` && \ y=`cat version 2>/dev/null` || true && \ case "$$x" in ''|$$y) ;; *) echo $$x > version ;; esac $(srcdir)/version.m4: $(srcdir)/packageinfo.sh TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \ ./scripts/genver version.m4 $(srcdir)/include/version.def: $(srcdir)/packageinfo.sh TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \ ./scripts/genver include/version.def $(srcdir)/include/version.texi: $(srcdir)/packageinfo.sh TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \ ./scripts/genver include/version.texi $(srcdir)/.checkChangeLog: $(srcdir)/ChangeLog $(srcdir)/scripts/checkChangeLog cd $(srcdir) && \ ./scripts/checkChangeLog libtool: $(LIBTOOL_DEPS) ./config.status --recheck dist-hook: @find $(distdir) -type d -name SCCS -print | xargs rm -rf .gcc-warning: @echo "Compiling with GCC now generates lots of new warnings." @echo " " @echo "Don't be concerned. They're just warnings." @echo " " @echo "Don't send bug reports about the warnings, either." @echo " " @echo "Feel free to send patches that fix these warnings, though." @echo " " @sleep 1 @touch $@ CommitLog: FRC.CommitLog cd $(srcdir) \ && $(PATH_TEST) -e CommitLog \ -a SCCS/s.ChangeSet -ot CommitLog \ || scripts/genCommitLog # HMS: The following seems to be a work-in-progress... CVO=`$(srcdir)/config.guess` .buildcvo: echo "$(CVO)" > .buildcvo .checkcvo: .buildcvo FRC.checkcvo @if [ "`cat .buildcvo`" != "$(CVO)" ];then \ echo "This directory was configured for `cat .buildcvo`"; \ echo "but this machine is a $(CVO)"; \ exit 1; \ fi BHOST=`(hostname || uname -n)` .buildhost: echo "$(BHOST)" > .buildhost .checkhost: .buildhost FRC.checkhost @if [ "`cat .buildhost`" != "$(BHOST)" ];then \ echo "Built on `cat .buildhost` but this is $(BHOST)"; \ echo " "; \ fi FRC.CommitLog FRC.distwarn FRC.checkcvo FRC.checkhost FRC.version: @: do-nothing action prevents any default # HMS: what was I trying to do with this? #dot.emacs: FRC.distwarn ntp-4.2.6p5/README.bk0000644000175000017500000000033311307651604013066 0ustar peterpeterIn order to use the BitKeeper repository version of NTP you should visit http://support.ntp.org/Main/SoftwareDevelopment for important information. If you want to submit patches, please see the README.hackers file. ntp-4.2.6p5/bincheck.mf0000644000175000017500000000100211314114375013674 0ustar peterpeter# we traditionally installed software in bindir, while it should have gone # in sbindir. Now that we offer a choice, look in the "other" installation # subdir to warn folks if there is another version there. install-exec-hook: @case ${BINSUBDIR} in \ bin) ODIR=${sbindir} ;; \ sbin) ODIR=${bindir} ;; \ esac; \ test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \ test ! -f $$ODIR/$$i || echo "*** $$i is also in $$ODIR!"; \ done # ntp-4.2.6p5/INSTALL0000644000175000017500000001657010457662574012673 0ustar peterpeterBasic Installation ================== These are generic *nix installation instructions. For Windows/NT, please see ports/winnt and html/build/hints/winnt.html. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. ntp-4.2.6p5/README0000644000175000017500000001270411307651603012477 0ustar peterpeter Submit patches, bug reports, and enhancement requests via http://bugs.ntp.org The ntp Distribution Base Directory This directory and its subdirectories contain the Network Time Protocol Version 4 (NTP) distribution for Unix and Windows/NT systems. This release may still work on VxWorks, too. The contents of the base directory are given in this file. The contents of subdirectories are given in the README files in each subdirectory. A complete explanation of the configure, compile and install process, as well as setting up an NTP subnet, is in the HTML pages in the ./html/ directory. For more information on NTP and how to get a working setup, read WHERE-TO-START. For Windows/NT, visit html/build/hints/winnt.html . The base directory ./ contains the autoconfiguration files, source directories and related stuff: COPYRIGHT Excerpt from the HTML file ./html/copyright.html. This file specifies copyright conditions, together with a list of major authors and electric addresses. INSTALL Generic installation instructions for autoconf-based programs. Unless you really know what you are doing, you should read the directions in the HTML pages, starting with ./html/index.html. NEWS What's new in this release. README This file. README.bk Instructions for folks who use the BitKeeper-repository version of NTP. README.hackers Notes to folks who want to hack on the code. TODO List of items the NTP developers are working on. WHERE-TO-START Hints on what to read in order to get a working configuration. Makefile.am Automake file configuration file. Edit only if you have the GNU automake and autoconf utilities installed. Makefile.in Autoconf make file template for Unix. adjtimed Directory containing the sources for the adjtime daemon for HP/UX systems prior to HP-UX 10.0. authstuff Directory containing sources for miscellaneous programs to test, calibrate and certify the cryptographic mechanisms for DES and MD5 based authentication. These programs do not include the cryptographic routines themselves, so are free of U.S. export restrictions. build A script to build the distribution in A.`config.guess` subdirectory (more or less). clockstuff Directory containing sources for miscellaneous programs to test certain auxiliary programs used with some kernel configurations, together with a program to calculate propagation delays for use with radio clocks and national time dissemination services such as WWV/WWVH, WWVB and CHU. conf Directory containing a motley collection of configuration files for various systems. For example only. config.guess Script used to identify the machine architecture and operating system. config.h.in Configuration file generated automatically from configure.in. Do not edit. configure Script used to configure the distribution. See the HTML pages (./html/index.html) for a complete description of the options available. configure.in Master configuration template. Edit only if you have the GNU automake and autoconf utilities installed. dot.emacs C-mode indentation rules for code "Just the way Dave likes it". flock_build (UDel only) Build the distribution on a number of different platforms. html Directory containing a complete set of documentation on building and configuring a NTP server or client. The documentation is in the form of HTML files suitable for browsing and contains links to additional documentation at various web sites. If a browser is unavailable, an ordinary text editor can be used. include Directory containing include header files used by most programs in the distribution. install-sh Script to install a program, script or data file. kernel Directory containing sources for kernel programs such as line disciplines and STREAMS modules used with the CHU decoder and precision PPS signals. libntp Directory containing library source code used by most programs in the distribution. ntpdate Directory containing sources for a program to set the local machine time from one or more remote machines running NTP. Operates like rdate, but much more accurate. ntpq Directory containing sources for a utility program to query local and remote NTP peers for state variables and related timekeeping information. This program conforms to Appendix A of the NTP Version 3 Specification RFC 1305. ntptrace Directory containing sources for a utility program that can be used to reveal the chain of NTP peers from a designated peer to the primary server at the root of the timekeeping subnet. parse Directory containing files belonging to the generic parse reference clock driver. For reasonably simple clocks it is possible to get away with about 3-4Kb of code. additionally the SunOS 4.x/Solaris 5.3 streams module for parse squats here. patches Directory containing patches already applied to this distribution. These are included for record and to help in possible porting problems. scripts Directory containing scripts to build the configuration files in this directory and then the makefiles used in various dependent directories. the subdirectories monitoring and support hold various perl and shell scripts for visualizing synchronization and daemon startup. stamp.h.in Configuration file generated automatically from configure.in. Do not edit. util Directory containing sources for various utility and testing programs. David L. Mills (mills@udel.edu) 21 June 1998 ntp-4.2.6p5/README.refclocks0000644000175000017500000000404110441361166014444 0ustar peterpeterThis is a list of the #define REFCLK_* stuff. If you want to add a new refclock let us know and we'll assign you a number. Should this list also include the name of the party responsible for the refclock? LOCALCLOCK 1 /* external (e.g., lockclock) */ GPS_TRAK 2 /* TRAK 8810 GPS Receiver */ WWV_PST 3 /* PST/Traconex 1020 WWV/H */ SPECTRACOM 4 /* Spectracom (generic) Receivers */ TRUETIME 5 /* TrueTime (generic) Receivers */ IRIG_AUDIO 6 /* IRIG-B/W audio decoder */ CHU_AUDIO 7 /* CHU audio demodulator/decoder */ PARSE 8 /* generic driver (usually DCF77,GPS,MSF) */ GPS_MX4200 9 /* Magnavox MX4200 GPS */ GPS_AS2201 10 /* Austron 2201A GPS */ GPS_ARBITER 11 /* Arbiter 1088A/B/ GPS */ IRIG_TPRO 12 /* KSI/Odetics TPRO-S IRIG */ ATOM_LEITCH 13 /* Leitch CSD 5300 Master Clock */ MSF_EES 14 /* EES M201 MSF Receiver */ GPSTM_TRUE 15 /* OLD TrueTime GPS/TM-TMD Receiver */ IRIG_BANCOMM 16 /* Bancomm GPS/IRIG Interface */ GPS_DATUM 17 /* Datum Programmable Time System */ NIST_ACTS 18 /* NIST Auto Computer Time Service */ WWV_HEATH 19 /* Heath GC1000 WWV/WWVH Receiver */ GPS_NMEA 20 /* NMEA based GPS clock */ GPS_VME 21 /* TrueTime GPS-VME Interface */ ATOM_PPS 22 /* 1-PPS Clock Discipline */ PTB_ACTS NIST_ACTS USNO NIST_ACTS GPS_HP 26 /* HP 58503A Time/Frequency Receiver */ ARCRON_MSF 27 /* ARCRON MSF radio clock. */ SHM 28 /* clock attached thru shared memory */ PALISADE 29 /* Trimble Navigation Palisade GPS */ ONCORE 30 /* Motorola UT Oncore GPS */ GPS_JUPITER 31 /* Rockwell Jupiter GPS receiver */ CHRONOLOG 32 /* Chrono-log K WWVB receiver */ DUMBCLOCK 33 /* Dumb localtime clock */ ULINK 34 /* Ultralink M320 WWVB receiver */ PCF 35 /* Conrad parallel port radio clock */ WWV_AUDIO 36 /* WWV/H audio demodulator/decoder */ FG 37 /* Forum Graphic GPS */ HOPF_SERIAL 38 /* hopf DCF77/GPS serial line receiver */ HOPF_PCI 39 /* hopf DCF77/GPS PCI receiver */ JJY 40 /* JJY receiver */ TT560 41 /* TrueTime 560 IRIG-B decoder */ ZYFER 42 /* Zyfer GPStarplus receiver */ RIPENCC 43 /* RIPE NCC Trimble driver */ ??????? 44 Claas Hilbrecht (20020711) ntp-4.2.6p5/aclocal.m40000644000175000017500000010753711675460265013502 0ustar peterpeter# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file 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. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file 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. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file 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. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file 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. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file 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. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([sntp/libopts/m4/libopts.m4]) m4_include([m4/define_dir.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/ntp_cacheversion.m4]) m4_include([m4/ntp_dir_sep.m4]) m4_include([m4/ntp_lineeditlibs.m4]) m4_include([m4/ntp_openssl.m4]) m4_include([m4/ntp_vpathhack.m4]) m4_include([m4/os_cflags.m4]) ntp-4.2.6p5/ntpq/0000755000175000017500000000000011675461364012610 5ustar peterpeterntp-4.2.6p5/ntpq/ntpq-subs.c0000644000175000017500000012213411675457723014717 0ustar peterpeter/* * ntpq_ops.c - subroutines which are called to perform operations by ntpq */ #include #include #include #include #include "ntp_stdlib.h" #include "ntpq.h" #include "ntpq-opts.h" extern char * chosts[]; extern char currenthost[]; extern int currenthostisnum; extern int numhosts; int maxhostlen; /* * Declarations for command handlers in here */ static associd_t checkassocid (u_int32); static struct varlist *findlistvar (struct varlist *, char *); static void doaddvlist (struct varlist *, const char *); static void dormvlist (struct varlist *, const char *); static void doclearvlist (struct varlist *); static void makequerydata (struct varlist *, int *, char *); static int doquerylist (struct varlist *, int, associd_t, int, u_short *, int *, const char **); static void doprintvlist (struct varlist *, FILE *); static void addvars (struct parse *, FILE *); static void rmvars (struct parse *, FILE *); static void clearvars (struct parse *, FILE *); static void showvars (struct parse *, FILE *); static int dolist (struct varlist *, associd_t, int, int, FILE *); static void readlist (struct parse *, FILE *); static void writelist (struct parse *, FILE *); static void readvar (struct parse *, FILE *); static void writevar (struct parse *, FILE *); static void clocklist (struct parse *, FILE *); static void clockvar (struct parse *, FILE *); static int findassidrange (u_int32, u_int32, int *, int *); static void mreadlist (struct parse *, FILE *); static void mreadvar (struct parse *, FILE *); static int dogetassoc (FILE *); static void printassoc (int, FILE *); static void associations (struct parse *, FILE *); static void lassociations (struct parse *, FILE *); static void passociations (struct parse *, FILE *); static void lpassociations (struct parse *, FILE *); #ifdef UNUSED static void radiostatus (struct parse *, FILE *); #endif /* UNUSED */ static void pstatus (struct parse *, FILE *); static long when (l_fp *, l_fp *, l_fp *); static char * prettyinterval (char *, size_t, long); static int doprintpeers (struct varlist *, int, int, int, const char *, FILE *, int); static int dogetpeers (struct varlist *, associd_t, FILE *, int); static void dopeers (int, FILE *, int); static void peers (struct parse *, FILE *); static void lpeers (struct parse *, FILE *); static void doopeers (int, FILE *, int); static void opeers (struct parse *, FILE *); static void lopeers (struct parse *, FILE *); static void config (struct parse *, FILE *); static void saveconfig (struct parse *, FILE *); static void config_from_file(struct parse *, FILE *); /* * Commands we understand. Ntpdc imports this. */ struct xcmd opcmds[] = { { "saveconfig", saveconfig, { NTP_STR, NO, NO, NO }, { "filename", "", "", ""}, "save ntpd configuration to file, . for current config file"}, { "associations", associations, { NO, NO, NO, NO }, { "", "", "", "" }, "print list of association ID's and statuses for the server's peers" }, { "passociations", passociations, { NO, NO, NO, NO }, { "", "", "", "" }, "print list of associations returned by last associations command" }, { "lassociations", lassociations, { NO, NO, NO, NO }, { "", "", "", "" }, "print list of associations including all client information" }, { "lpassociations", lpassociations, { NO, NO, NO, NO }, { "", "", "", "" }, "print last obtained list of associations, including client information" }, { "addvars", addvars, { NTP_STR, NO, NO, NO }, { "name[=value][,...]", "", "", "" }, "add variables to the variable list or change their values" }, { "rmvars", rmvars, { NTP_STR, NO, NO, NO }, { "name[,...]", "", "", "" }, "remove variables from the variable list" }, { "clearvars", clearvars, { NO, NO, NO, NO }, { "", "", "", "" }, "remove all variables from the variable list" }, { "showvars", showvars, { NO, NO, NO, NO }, { "", "", "", "" }, "print variables on the variable list" }, { "readlist", readlist, { OPT|NTP_UINT, NO, NO, NO }, { "assocID", "", "", "" }, "read the system or peer variables included in the variable list" }, { "rl", readlist, { OPT|NTP_UINT, NO, NO, NO }, { "assocID", "", "", "" }, "read the system or peer variables included in the variable list" }, { "writelist", writelist, { OPT|NTP_UINT, NO, NO, NO }, { "assocID", "", "", "" }, "write the system or peer variables included in the variable list" }, { "readvar", readvar, { OPT|NTP_UINT, OPT|NTP_STR, NO, NO }, { "assocID", "name=value[,...]", "", "" }, "read system or peer variables" }, { "rv", readvar, { OPT|NTP_UINT, OPT|NTP_STR, NO, NO }, { "assocID", "name=value[,...]", "", "" }, "read system or peer variables" }, { "writevar", writevar, { NTP_UINT, NTP_STR, NO, NO }, { "assocID", "name=value,[...]", "", "" }, "write system or peer variables" }, { "mreadlist", mreadlist, { NTP_UINT, NTP_UINT, NO, NO }, { "assocID", "assocID", "", "" }, "read the peer variables in the variable list for multiple peers" }, { "mrl", mreadlist, { NTP_UINT, NTP_UINT, NO, NO }, { "assocID", "assocID", "", "" }, "read the peer variables in the variable list for multiple peers" }, { "mreadvar", mreadvar, { NTP_UINT, NTP_UINT, OPT|NTP_STR, NO }, { "assocID", "assocID", "name=value[,...]", "" }, "read peer variables from multiple peers" }, { "mrv", mreadvar, { NTP_UINT, NTP_UINT, OPT|NTP_STR, NO }, { "assocID", "assocID", "name=value[,...]", "" }, "read peer variables from multiple peers" }, { "clocklist", clocklist, { OPT|NTP_UINT, NO, NO, NO }, { "assocID", "", "", "" }, "read the clock variables included in the variable list" }, { "cl", clocklist, { OPT|NTP_UINT, NO, NO, NO }, { "assocID", "", "", "" }, "read the clock variables included in the variable list" }, { "clockvar", clockvar, { OPT|NTP_UINT, OPT|NTP_STR, NO, NO }, { "assocID", "name=value[,...]", "", "" }, "read clock variables" }, { "cv", clockvar, { OPT|NTP_UINT, OPT|NTP_STR, NO, NO }, { "assocID", "name=value[,...]", "", "" }, "read clock variables" }, { "pstatus", pstatus, { NTP_UINT, NO, NO, NO }, { "assocID", "", "", "" }, "print status information returned for a peer" }, { "peers", peers, { OPT|IP_VERSION, NO, NO, NO }, { "-4|-6", "", "", "" }, "obtain and print a list of the server's peers [IP version]" }, { "lpeers", lpeers, { OPT|IP_VERSION, NO, NO, NO }, { "-4|-6", "", "", "" }, "obtain and print a list of all peers and clients [IP version]" }, { "opeers", opeers, { OPT|IP_VERSION, NO, NO, NO }, { "-4|-6", "", "", "" }, "print peer list the old way, with dstadr shown rather than refid [IP version]" }, { "lopeers", lopeers, { OPT|IP_VERSION, NO, NO, NO }, { "-4|-6", "", "", "" }, "obtain and print a list of all peers and clients showing dstadr [IP version]" }, { ":config", config, { NTP_STR, NO, NO, NO }, { "", "", "", "" }, "send a remote configuration command to ntpd" }, { "config-from-file", config_from_file, { NTP_STR, NO, NO, NO }, { "", "", "", "" }, "configure ntpd using the configuration filename" }, { 0, 0, { NO, NO, NO, NO }, { "-4|-6", "", "", "" }, "" } }; /* * Variable list data space */ #define MAXLINE 512 /* maximum length of a line */ #define MAXLIST 64 /* maximum number of variables in list */ #define LENHOSTNAME 256 /* host name is 256 characters long */ /* * Old CTL_PST defines for version 2. */ #define OLD_CTL_PST_CONFIG 0x80 #define OLD_CTL_PST_AUTHENABLE 0x40 #define OLD_CTL_PST_AUTHENTIC 0x20 #define OLD_CTL_PST_REACH 0x10 #define OLD_CTL_PST_SANE 0x08 #define OLD_CTL_PST_DISP 0x04 #define OLD_CTL_PST_SEL_REJECT 0 #define OLD_CTL_PST_SEL_SELCAND 1 #define OLD_CTL_PST_SEL_SYNCCAND 2 #define OLD_CTL_PST_SEL_SYSPEER 3 char flash2[] = " .+* "; /* flash decode for version 2 */ char flash3[] = " x.-+#*o"; /* flash decode for peer status version 3 */ struct varlist { char *name; char *value; } g_varlist[MAXLIST] = { { 0, 0 } }; /* * Imported from ntpq.c */ extern int showhostnames; extern int rawmode; extern struct servent *server_entry; extern struct association assoc_cache[]; extern int numassoc; extern u_char pktversion; extern struct ctl_var peer_var[]; /* * For quick string comparisons */ #define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0) /* * checkassocid - return the association ID, checking to see if it is valid */ static associd_t checkassocid( u_int32 value ) { associd_t associd; u_long ulvalue; associd = (associd_t)value; if (0 == associd || value != associd) { ulvalue = value; fprintf(stderr, "***Invalid association ID %lu specified\n", ulvalue); return 0; } return associd; } /* * findlistvar - look for the named variable in a list and return if found */ static struct varlist * findlistvar( struct varlist *list, char *name ) { register struct varlist *vl; for (vl = list; vl < list + MAXLIST && vl->name != 0; vl++) if (STREQ(name, vl->name)) return vl; if (vl < list + MAXLIST) return vl; return (struct varlist *)0; } /* * doaddvlist - add variable(s) to the variable list */ static void doaddvlist( struct varlist *vlist, const char *vars ) { register struct varlist *vl; int len; char *name; char *value; len = strlen(vars); while (nextvar(&len, &vars, &name, &value)) { vl = findlistvar(vlist, name); if (vl == 0) { (void) fprintf(stderr, "Variable list full\n"); return; } if (vl->name == 0) { vl->name = estrdup(name); } else if (vl->value != 0) { free(vl->value); vl->value = 0; } if (value != 0) vl->value = estrdup(value); } } /* * dormvlist - remove variable(s) from the variable list */ static void dormvlist( struct varlist *vlist, const char *vars ) { register struct varlist *vl; int len; char *name; char *value; len = strlen(vars); while (nextvar(&len, &vars, &name, &value)) { vl = findlistvar(vlist, name); if (vl == 0 || vl->name == 0) { (void) fprintf(stderr, "Variable `%s' not found\n", name); } else { free((void *)vl->name); if (vl->value != 0) free(vl->value); for ( ; (vl+1) < (g_varlist + MAXLIST) && (vl+1)->name != 0; vl++) { vl->name = (vl+1)->name; vl->value = (vl+1)->value; } vl->name = vl->value = 0; } } } /* * doclearvlist - clear a variable list */ static void doclearvlist( struct varlist *vlist ) { register struct varlist *vl; for (vl = vlist; vl < vlist + MAXLIST && vl->name != 0; vl++) { free((void *)vl->name); vl->name = 0; if (vl->value != 0) { free(vl->value); vl->value = 0; } } } /* * makequerydata - form a data buffer to be included with a query */ static void makequerydata( struct varlist *vlist, int *datalen, char *data ) { register struct varlist *vl; register char *cp, *cpend; register int namelen, valuelen; register int totallen; cp = data; cpend = data + *datalen; for (vl = vlist; vl < vlist + MAXLIST && vl->name != 0; vl++) { namelen = strlen(vl->name); if (vl->value == 0) valuelen = 0; else valuelen = strlen(vl->value); totallen = namelen + valuelen + (valuelen != 0) + (cp != data); if (cp + totallen > cpend) break; if (cp != data) *cp++ = ','; memmove(cp, vl->name, (unsigned)namelen); cp += namelen; if (valuelen != 0) { *cp++ = '='; memmove(cp, vl->value, (unsigned)valuelen); cp += valuelen; } } *datalen = cp - data; } /* * doquerylist - send a message including variables in a list */ static int doquerylist( struct varlist *vlist, int op, associd_t associd, int auth, u_short *rstatus, int *dsize, const char **datap ) { char data[CTL_MAX_DATA_LEN]; int datalen; datalen = sizeof(data); makequerydata(vlist, &datalen, data); return doquery(op, associd, auth, datalen, data, rstatus, dsize, datap); } /* * doprintvlist - print the variables on a list */ static void doprintvlist( struct varlist *vlist, FILE *fp ) { register struct varlist *vl; if (vlist->name == 0) { (void) fprintf(fp, "No variables on list\n"); } else { for (vl = vlist; vl < vlist + MAXLIST && vl->name != 0; vl++) { if (vl->value == 0) { (void) fprintf(fp, "%s\n", vl->name); } else { (void) fprintf(fp, "%s=%s\n", vl->name, vl->value); } } } } /* * addvars - add variables to the variable list */ /*ARGSUSED*/ static void addvars( struct parse *pcmd, FILE *fp ) { doaddvlist(g_varlist, pcmd->argval[0].string); } /* * rmvars - remove variables from the variable list */ /*ARGSUSED*/ static void rmvars( struct parse *pcmd, FILE *fp ) { dormvlist(g_varlist, pcmd->argval[0].string); } /* * clearvars - clear the variable list */ /*ARGSUSED*/ static void clearvars( struct parse *pcmd, FILE *fp ) { doclearvlist(g_varlist); } /* * showvars - show variables on the variable list */ /*ARGSUSED*/ static void showvars( struct parse *pcmd, FILE *fp ) { doprintvlist(g_varlist, fp); } /* * dolist - send a request with the given list of variables */ static int dolist( struct varlist *vlist, associd_t associd, int op, int type, FILE *fp ) { const char *datap; int res; int dsize; u_short rstatus; int quiet; /* * if we're asking for specific variables don't include the * status header line in the output. */ if (old_rv) quiet = 0; else quiet = (vlist->name != NULL); res = doquerylist(vlist, op, associd, 0, &rstatus, &dsize, &datap); if (res != 0) return 0; if (numhosts > 1) (void) fprintf(fp, "server=%s ", currenthost); if (dsize == 0) { if (associd == 0) (void) fprintf(fp, "No system%s variables returned\n", (type == TYPE_CLOCK) ? " clock" : ""); else (void) fprintf(fp, "No information returned for%s association %u\n", (type == TYPE_CLOCK) ? " clock" : "", associd); return 1; } if (!quiet) fprintf(fp,"associd=%d ",associd); printvars(dsize, datap, (int)rstatus, type, quiet, fp); return 1; } /* * readlist - send a read variables request with the variables on the list */ static void readlist( struct parse *pcmd, FILE *fp ) { associd_t associd; int type; if (pcmd->nargs == 0) { associd = 0; } else { /* HMS: I think we want the u_int32 target here, not the u_long */ if (pcmd->argval[0].uval == 0) associd = 0; else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0) return; } type = (0 == associd) ? TYPE_SYS : TYPE_PEER; dolist(g_varlist, associd, CTL_OP_READVAR, type, fp); } /* * writelist - send a write variables request with the variables on the list */ static void writelist( struct parse *pcmd, FILE *fp ) { const char *datap; int res; associd_t associd; int dsize; u_short rstatus; if (pcmd->nargs == 0) { associd = 0; } else { /* HMS: Do we really want uval here? */ if (pcmd->argval[0].uval == 0) associd = 0; else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0) return; } res = doquerylist(g_varlist, CTL_OP_WRITEVAR, associd, 1, &rstatus, &dsize, &datap); if (res != 0) return; if (numhosts > 1) (void) fprintf(fp, "server=%s ", currenthost); if (dsize == 0) (void) fprintf(fp, "done! (no data returned)\n"); else { (void) fprintf(fp,"associd=%d ",associd); printvars(dsize, datap, (int)rstatus, (associd != 0) ? TYPE_PEER : TYPE_SYS, 0, fp); } return; } /* * readvar - send a read variables request with the specified variables */ static void readvar( struct parse *pcmd, FILE *fp ) { associd_t associd; int type; struct varlist tmplist[MAXLIST]; /* HMS: uval? */ if (pcmd->nargs == 0 || pcmd->argval[0].uval == 0) associd = 0; else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0) return; memset(tmplist, 0, sizeof(tmplist)); if (pcmd->nargs >= 2) doaddvlist(tmplist, pcmd->argval[1].string); type = (0 == associd) ? TYPE_SYS : TYPE_PEER; dolist(tmplist, associd, CTL_OP_READVAR, type, fp); doclearvlist(tmplist); } /* * writevar - send a write variables request with the specified variables */ static void writevar( struct parse *pcmd, FILE *fp ) { const char *datap; int res; associd_t associd; int type; int dsize; u_short rstatus; struct varlist tmplist[MAXLIST]; /* HMS: uval? */ if (pcmd->argval[0].uval == 0) associd = 0; else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0) return; memset((char *)tmplist, 0, sizeof(tmplist)); doaddvlist(tmplist, pcmd->argval[1].string); res = doquerylist(tmplist, CTL_OP_WRITEVAR, associd, 1, &rstatus, &dsize, &datap); doclearvlist(tmplist); if (res != 0) return; if (numhosts > 1) fprintf(fp, "server=%s ", currenthost); if (dsize == 0) fprintf(fp, "done! (no data returned)\n"); else { fprintf(fp,"associd=%d ",associd); type = (0 == associd) ? TYPE_SYS : TYPE_PEER; printvars(dsize, datap, (int)rstatus, type, 0, fp); } return; } /* * clocklist - send a clock variables request with the variables on the list */ static void clocklist( struct parse *pcmd, FILE *fp ) { associd_t associd; /* HMS: uval? */ if (pcmd->nargs == 0) { associd = 0; } else { if (pcmd->argval[0].uval == 0) associd = 0; else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0) return; } dolist(g_varlist, associd, CTL_OP_READCLOCK, TYPE_CLOCK, fp); } /* * clockvar - send a clock variables request with the specified variables */ static void clockvar( struct parse *pcmd, FILE *fp ) { associd_t associd; struct varlist tmplist[MAXLIST]; /* HMS: uval? */ if (pcmd->nargs == 0 || pcmd->argval[0].uval == 0) associd = 0; else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0) return; memset(tmplist, 0, sizeof(tmplist)); if (pcmd->nargs >= 2) doaddvlist(tmplist, pcmd->argval[1].string); dolist(tmplist, associd, CTL_OP_READCLOCK, TYPE_CLOCK, fp); doclearvlist(tmplist); } /* * findassidrange - verify a range of association ID's */ static int findassidrange( u_int32 assid1, u_int32 assid2, int *from, int *to ) { associd_t assids[2]; int ind[COUNTOF(assids)]; int i; size_t a; assids[0] = checkassocid(assid1); if (0 == assids[0]) return 0; assids[1] = checkassocid(assid2); if (0 == assids[1]) return 0; for (a = 0; a < COUNTOF(assids); a++) { ind[a] = -1; for (i = 0; i < numassoc; i++) if (assoc_cache[i].assid == assids[a]) ind[a] = i; } for (a = 0; a < COUNTOF(assids); a++) if (-1 == ind[a]) { fprintf(stderr, "***Association ID %u not found in list\n", assids[a]); return 0; } if (ind[0] < ind[1]) { *from = ind[0]; *to = ind[1]; } else { *to = ind[0]; *from = ind[1]; } return 1; } /* * mreadlist - send a read variables request for multiple associations */ static void mreadlist( struct parse *pcmd, FILE *fp ) { int i; int from; int to; /* HMS: uval? */ if (!findassidrange(pcmd->argval[0].uval, pcmd->argval[1].uval, &from, &to)) return; for (i = from; i <= to; i++) { if (i != from) (void) fprintf(fp, "\n"); if (!dolist(g_varlist, (int)assoc_cache[i].assid, CTL_OP_READVAR, TYPE_PEER, fp)) return; } return; } /* * mreadvar - send a read variables request for multiple associations */ static void mreadvar( struct parse *pcmd, FILE *fp ) { int i; int from; int to; struct varlist tmplist[MAXLIST]; struct varlist *pvars; /* HMS: uval? */ if (!findassidrange(pcmd->argval[0].uval, pcmd->argval[1].uval, &from, &to)) return; if (pcmd->nargs >= 3) { memset(tmplist, 0, sizeof(tmplist)); doaddvlist(tmplist, pcmd->argval[2].string); pvars = tmplist; } else { pvars = g_varlist; } for (i = from; i <= to; i++) { if (i != from) fprintf(fp, "\n"); if (!dolist(pvars, (int)assoc_cache[i].assid, CTL_OP_READVAR, TYPE_PEER, fp)) break; } doclearvlist(tmplist); return; } /* * dogetassoc - query the host for its list of associations */ static int dogetassoc( FILE *fp ) { const char *datap; int res; int dsize; u_short rstatus; res = doquery(CTL_OP_READSTAT, 0, 0, 0, (char *)0, &rstatus, &dsize, &datap); if (res != 0) return 0; if (dsize == 0) { if (numhosts > 1) (void) fprintf(fp, "server=%s ", currenthost); (void) fprintf(fp, "No association ID's returned\n"); return 0; } if (dsize & 0x3) { if (numhosts > 1) (void) fprintf(stderr, "server=%s ", currenthost); (void) fprintf(stderr, "***Server returned %d octets, should be multiple of 4\n", dsize); return 0; } numassoc = 0; while (dsize > 0) { assoc_cache[numassoc].assid = ntohs(*((const u_short *)datap)); datap += sizeof(u_short); assoc_cache[numassoc].status = ntohs(*((const u_short *)datap)); datap += sizeof(u_short); if (++numassoc >= MAXASSOC) break; dsize -= sizeof(u_short) + sizeof(u_short); } sortassoc(); return 1; } /* * printassoc - print the current list of associations */ static void printassoc( int showall, FILE *fp ) { register char *bp; int i; u_char statval; int event; u_long event_count; const char *conf; const char *reach; const char *auth; const char *condition = ""; const char *last_event; const char *cnt; char buf[128]; if (numassoc == 0) { (void) fprintf(fp, "No association ID's in list\n"); return; } /* * Output a header */ (void) fprintf(fp, "\nind assid status conf reach auth condition last_event cnt\n"); (void) fprintf(fp, "===========================================================\n"); for (i = 0; i < numassoc; i++) { statval = (u_char) CTL_PEER_STATVAL(assoc_cache[i].status); if (!showall && !(statval & (CTL_PST_CONFIG|CTL_PST_REACH))) continue; event = CTL_PEER_EVENT(assoc_cache[i].status); event_count = CTL_PEER_NEVNT(assoc_cache[i].status); if (statval & CTL_PST_CONFIG) conf = "yes"; else conf = "no"; if (statval & CTL_PST_BCAST) { reach = "none"; if (statval & CTL_PST_AUTHENABLE) auth = "yes"; else auth = "none"; } else { if (statval & CTL_PST_REACH) reach = "yes"; else reach = "no"; if (statval & CTL_PST_AUTHENABLE) { if (statval & CTL_PST_AUTHENTIC) auth = "ok "; else auth = "bad"; } else { auth = "none"; } } if (pktversion > NTP_OLDVERSION) { switch (statval & 0x7) { case CTL_PST_SEL_REJECT: condition = "reject"; break; case CTL_PST_SEL_SANE: condition = "falsetick"; break; case CTL_PST_SEL_CORRECT: condition = "excess"; break; case CTL_PST_SEL_SELCAND: condition = "outlyer"; break; case CTL_PST_SEL_SYNCCAND: condition = "candidate"; break; case CTL_PST_SEL_EXCESS: condition = "backup"; break; case CTL_PST_SEL_SYSPEER: condition = "sys.peer"; break; case CTL_PST_SEL_PPS: condition = "pps.peer"; break; } } else { switch (statval & 0x3) { case OLD_CTL_PST_SEL_REJECT: if (!(statval & OLD_CTL_PST_SANE)) condition = "insane"; else if (!(statval & OLD_CTL_PST_DISP)) condition = "hi_disp"; else condition = ""; break; case OLD_CTL_PST_SEL_SELCAND: condition = "sel_cand"; break; case OLD_CTL_PST_SEL_SYNCCAND: condition = "sync_cand"; break; case OLD_CTL_PST_SEL_SYSPEER: condition = "sys_peer"; break; } } switch (PEER_EVENT|event) { case PEVNT_MOBIL: last_event = "mobilize"; break; case PEVNT_DEMOBIL: last_event = "demobilize"; break; case PEVNT_REACH: last_event = "reachable"; break; case PEVNT_UNREACH: last_event = "unreachable"; break; case PEVNT_RESTART: last_event = "restart"; break; case PEVNT_REPLY: last_event = "no_reply"; break; case PEVNT_RATE: last_event = "rate_exceeded"; break; case PEVNT_DENY: last_event = "access_denied"; break; case PEVNT_ARMED: last_event = "leap_armed"; break; case PEVNT_NEWPEER: last_event = "sys_peer"; break; case PEVNT_CLOCK: last_event = "clock_alarm"; break; default: last_event = ""; break; } cnt = uinttoa(event_count); snprintf(buf, sizeof(buf), "%3d %5u %04x %3.3s %4s %4.4s %9.9s %11s %2s", i + 1, assoc_cache[i].assid, assoc_cache[i].status, conf, reach, auth, condition, last_event, cnt); bp = buf + strlen(buf); while (bp > buf && ' ' == bp[-1]) --bp; bp[0] = '\0'; fprintf(fp, "%s\n", buf); } } /* * associations - get, record and print a list of associations */ /*ARGSUSED*/ static void associations( struct parse *pcmd, FILE *fp ) { if (dogetassoc(fp)) printassoc(0, fp); } /* * lassociations - get, record and print a long list of associations */ /*ARGSUSED*/ static void lassociations( struct parse *pcmd, FILE *fp ) { if (dogetassoc(fp)) printassoc(1, fp); } /* * passociations - print the association list */ /*ARGSUSED*/ static void passociations( struct parse *pcmd, FILE *fp ) { printassoc(0, fp); } /* * lpassociations - print the long association list */ /*ARGSUSED*/ static void lpassociations( struct parse *pcmd, FILE *fp ) { printassoc(1, fp); } /* * saveconfig - dump ntp server configuration to server file */ static void saveconfig( struct parse *pcmd, FILE *fp ) { const char *datap; int res; int dsize; u_short rstatus; if (0 == pcmd->nargs) return; res = doquery(CTL_OP_SAVECONFIG, 0, 1, strlen(pcmd->argval[0].string), pcmd->argval[0].string, &rstatus, &dsize, &datap); if (res != 0) return; if (0 == dsize) fprintf(fp, "(no response message, curiously)"); else fprintf(fp, "%.*s", dsize, datap); } #ifdef UNUSED /* * radiostatus - print the radio status returned by the server */ /*ARGSUSED*/ static void radiostatus( struct parse *pcmd, FILE *fp ) { char *datap; int res; int dsize; u_short rstatus; res = doquery(CTL_OP_READCLOCK, 0, 0, 0, (char *)0, &rstatus, &dsize, &datap); if (res != 0) return; if (numhosts > 1) (void) fprintf(fp, "server=%s ", currenthost); if (dsize == 0) { (void) fprintf(fp, "No radio status string returned\n"); return; } asciize(dsize, datap, fp); } #endif /* UNUSED */ /* * pstatus - print peer status returned by the server */ static void pstatus( struct parse *pcmd, FILE *fp ) { const char *datap; int res; associd_t associd; int dsize; u_short rstatus; /* HMS: uval? */ if ((associd = checkassocid(pcmd->argval[0].uval)) == 0) return; res = doquery(CTL_OP_READSTAT, associd, 0, 0, NULL, &rstatus, &dsize, &datap); if (res != 0) return; if (numhosts > 1) fprintf(fp, "server=%s ", currenthost); if (dsize == 0) { fprintf(fp, "No information returned for association %u\n", associd); return; } fprintf(fp, "associd=%u ", associd); printvars(dsize, datap, (int)rstatus, TYPE_PEER, 0, fp); } /* * when - print how long its been since his last packet arrived */ static long when( l_fp *ts, l_fp *rec, l_fp *reftime ) { l_fp *lasttime; if (rec->l_ui != 0) lasttime = rec; else if (reftime->l_ui != 0) lasttime = reftime; else return 0; return (ts->l_ui - lasttime->l_ui); } /* * Pretty-print an interval into the given buffer, in a human-friendly format. */ static char * prettyinterval( char *buf, size_t cb, long diff ) { if (diff <= 0) { buf[0] = '-'; buf[1] = 0; return buf; } if (diff <= 2048) { snprintf(buf, cb, "%ld", diff); return buf; } diff = (diff + 29) / 60; if (diff <= 300) { snprintf(buf, cb, "%ldm", diff); return buf; } diff = (diff + 29) / 60; if (diff <= 96) { snprintf(buf, cb, "%ldh", diff); return buf; } diff = (diff + 11) / 24; snprintf(buf, cb, "%ldd", diff); return buf; } static char decodeaddrtype( sockaddr_u *sock ) { char ch = '-'; u_int32 dummy; switch(AF(sock)) { case AF_INET: dummy = SRCADR(sock); ch = (char)(((dummy&0xf0000000)==0xe0000000) ? 'm' : ((dummy&0x000000ff)==0x000000ff) ? 'b' : ((dummy&0xffffffff)==0x7f000001) ? 'l' : ((dummy&0xffffffe0)==0x00000000) ? '-' : 'u'); break; case AF_INET6: if (IN6_IS_ADDR_MULTICAST(PSOCK_ADDR6(sock))) ch = 'm'; else ch = 'u'; break; default: ch = '-'; break; } return ch; } /* * A list of variables required by the peers command */ struct varlist opeervarlist[] = { { "srcadr", 0 }, /* 0 */ { "dstadr", 0 }, /* 1 */ { "stratum", 0 }, /* 2 */ { "hpoll", 0 }, /* 3 */ { "ppoll", 0 }, /* 4 */ { "reach", 0 }, /* 5 */ { "delay", 0 }, /* 6 */ { "offset", 0 }, /* 7 */ { "jitter", 0 }, /* 8 */ { "dispersion", 0 }, /* 9 */ { "rec", 0 }, /* 10 */ { "reftime", 0 }, /* 11 */ { "srcport", 0 }, /* 12 */ { 0, 0 } }; struct varlist peervarlist[] = { { "srcadr", 0 }, /* 0 */ { "refid", 0 }, /* 1 */ { "stratum", 0 }, /* 2 */ { "hpoll", 0 }, /* 3 */ { "ppoll", 0 }, /* 4 */ { "reach", 0 }, /* 5 */ { "delay", 0 }, /* 6 */ { "offset", 0 }, /* 7 */ { "jitter", 0 }, /* 8 */ { "dispersion", 0 }, /* 9 */ { "rec", 0 }, /* 10 */ { "reftime", 0 }, /* 11 */ { "srcport", 0 }, /* 12 */ { 0, 0 } }; #define HAVE_SRCADR 0 #define HAVE_DSTADR 1 #define HAVE_REFID 1 #define HAVE_STRATUM 2 #define HAVE_HPOLL 3 #define HAVE_PPOLL 4 #define HAVE_REACH 5 #define HAVE_DELAY 6 #define HAVE_OFFSET 7 #define HAVE_JITTER 8 #define HAVE_DISPERSION 9 #define HAVE_REC 10 #define HAVE_REFTIME 11 #define HAVE_SRCPORT 12 #define MAXHAVE 13 /* * Decode an incoming data buffer and print a line in the peer list */ static int doprintpeers( struct varlist *pvl, int associd, int rstatus, int datalen, const char *data, FILE *fp, int af ) { char *name; char *value = NULL; int i; int c; sockaddr_u srcadr; sockaddr_u dstadr; sockaddr_u refidadr; u_long srcport = 0; char *dstadr_refid = "0.0.0.0"; char *serverlocal; size_t drlen; u_long stratum = 0; long ppoll = 0; long hpoll = 0; u_long reach = 0; l_fp estoffset; l_fp estdelay; l_fp estjitter; l_fp estdisp; l_fp reftime; l_fp rec; l_fp ts; u_char havevar[MAXHAVE]; u_long poll_sec; char type = '?'; char refid_string[10]; char whenbuf[8], pollbuf[8]; char clock_name[LENHOSTNAME]; memset((char *)havevar, 0, sizeof(havevar)); get_systime(&ts); ZERO_SOCK(&srcadr); ZERO_SOCK(&dstadr); /* Initialize by zeroing out estimate variables */ memset((char *)&estoffset, 0, sizeof(l_fp)); memset((char *)&estdelay, 0, sizeof(l_fp)); memset((char *)&estjitter, 0, sizeof(l_fp)); memset((char *)&estdisp, 0, sizeof(l_fp)); while (nextvar(&datalen, &data, &name, &value)) { sockaddr_u dum_store; i = findvar(name, peer_var, 1); if (i == 0) continue; /* don't know this one */ switch (i) { case CP_SRCADR: if (decodenetnum(value, &srcadr)) { havevar[HAVE_SRCADR] = 1; } break; case CP_DSTADR: if (decodenetnum(value, &dum_store)) { type = decodeaddrtype(&dum_store); havevar[HAVE_DSTADR] = 1; dstadr = dum_store; if (pvl == opeervarlist) { dstadr_refid = trunc_left(stoa(&dstadr), 15); } } break; case CP_REFID: if (pvl == peervarlist) { havevar[HAVE_REFID] = 1; if (*value == '\0') { dstadr_refid = ""; } else if (strlen(value) <= 4) { refid_string[0] = '.'; (void) strcpy(&refid_string[1], value); i = strlen(refid_string); refid_string[i] = '.'; refid_string[i+1] = '\0'; dstadr_refid = refid_string; } else if (decodenetnum(value, &refidadr)) { if (SOCK_UNSPEC(&refidadr)) dstadr_refid = "0.0.0.0"; else if (ISREFCLOCKADR(&refidadr)) dstadr_refid = refnumtoa(&refidadr); else dstadr_refid = stoa(&refidadr); } else { havevar[HAVE_REFID] = 0; } } break; case CP_STRATUM: if (decodeuint(value, &stratum)) havevar[HAVE_STRATUM] = 1; break; case CP_HPOLL: if (decodeint(value, &hpoll)) { havevar[HAVE_HPOLL] = 1; if (hpoll < 0) hpoll = NTP_MINPOLL; } break; case CP_PPOLL: if (decodeint(value, &ppoll)) { havevar[HAVE_PPOLL] = 1; if (ppoll < 0) ppoll = NTP_MINPOLL; } break; case CP_REACH: if (decodeuint(value, &reach)) havevar[HAVE_REACH] = 1; break; case CP_DELAY: if (decodetime(value, &estdelay)) havevar[HAVE_DELAY] = 1; break; case CP_OFFSET: if (decodetime(value, &estoffset)) havevar[HAVE_OFFSET] = 1; break; case CP_JITTER: if (pvl == peervarlist) if (decodetime(value, &estjitter)) havevar[HAVE_JITTER] = 1; break; case CP_DISPERSION: if (decodetime(value, &estdisp)) havevar[HAVE_DISPERSION] = 1; break; case CP_REC: if (decodets(value, &rec)) havevar[HAVE_REC] = 1; break; case CP_SRCPORT: if (decodeuint(value, &srcport)) havevar[HAVE_SRCPORT] = 1; break; case CP_REFTIME: havevar[HAVE_REFTIME] = 1; if (!decodets(value, &reftime)) L_CLR(&reftime); break; default: break; } } /* * Check to see if the srcport is NTP's port. If not this probably * isn't a valid peer association. */ if (havevar[HAVE_SRCPORT] && srcport != NTP_PORT) return (1); /* * Got everything, format the line */ poll_sec = 1< NTP_OLDVERSION) c = flash3[CTL_PEER_STATVAL(rstatus) & 0x7]; else c = flash2[CTL_PEER_STATVAL(rstatus) & 0x3]; if (numhosts > 1) { if (peervarlist == pvl && havevar[HAVE_DSTADR]) { serverlocal = nntohost_col(&dstadr, (size_t)min(LIB_BUFLENGTH - 1, maxhostlen), TRUE); } else { if (currenthostisnum) serverlocal = trunc_left(currenthost, maxhostlen); else serverlocal = currenthost; } fprintf(fp, "%-*s ", maxhostlen, serverlocal); } if (AF_UNSPEC == af || AF(&srcadr) == af) { strncpy(clock_name, nntohost(&srcadr), sizeof(clock_name)); fprintf(fp, "%c%-15.15s ", c, clock_name); drlen = strlen(dstadr_refid); makeascii(drlen, dstadr_refid, fp); while (drlen++ < 15) fputc(' ', fp); fprintf(fp, " %2ld %c %4.4s %4.4s %3lo %7.7s %8.7s %7.7s\n", stratum, type, prettyinterval(whenbuf, sizeof(whenbuf), when(&ts, &rec, &reftime)), prettyinterval(pollbuf, sizeof(pollbuf), (int)poll_sec), reach, lfptoms(&estdelay, 3), lfptoms(&estoffset, 3), (havevar[HAVE_JITTER]) ? lfptoms(&estjitter, 3) : lfptoms(&estdisp, 3)); return (1); } else return(1); } #undef HAVE_SRCADR #undef HAVE_DSTADR #undef HAVE_STRATUM #undef HAVE_PPOLL #undef HAVE_HPOLL #undef HAVE_REACH #undef HAVE_ESTDELAY #undef HAVE_ESTOFFSET #undef HAVE_JITTER #undef HAVE_ESTDISP #undef HAVE_REFID #undef HAVE_REC #undef HAVE_SRCPORT #undef HAVE_REFTIME #undef MAXHAVE /* * dogetpeers - given an association ID, read and print the spreadsheet * peer variables. */ static int dogetpeers( struct varlist *pvl, associd_t associd, FILE *fp, int af ) { const char *datap; int res; int dsize; u_short rstatus; #ifdef notdef res = doquerylist(pvl, CTL_OP_READVAR, associd, 0, &rstatus, &dsize, &datap); #else /* * Damn fuzzballs */ res = doquery(CTL_OP_READVAR, associd, 0, 0, NULL, &rstatus, &dsize, &datap); #endif if (res != 0) return 0; if (dsize == 0) { if (numhosts > 1) fprintf(stderr, "server=%s ", currenthost); fprintf(stderr, "***No information returned for association %u\n", associd); return 0; } return doprintpeers(pvl, associd, (int)rstatus, dsize, datap, fp, af); } /* * peers - print a peer spreadsheet */ static void dopeers( int showall, FILE *fp, int af ) { int i; char fullname[LENHOSTNAME]; sockaddr_u netnum; char * name_or_num; size_t sl; if (!dogetassoc(fp)) return; for (i = 0; i < numhosts; ++i) { if (getnetnum(chosts[i], &netnum, fullname, af)) { name_or_num = nntohost(&netnum); sl = strlen(name_or_num); maxhostlen = max(maxhostlen, (int)sl); } } if (numhosts > 1) fprintf(fp, "%-*.*s ", maxhostlen, maxhostlen, "server (local)"); fprintf(fp, " remote refid st t when poll reach delay offset jitter\n"); if (numhosts > 1) for (i = 0; i <= maxhostlen; ++i) fprintf(fp, "="); fprintf(fp, "==============================================================================\n"); for (i = 0; i < numassoc; i++) { if (!showall && !(CTL_PEER_STATVAL(assoc_cache[i].status) & (CTL_PST_CONFIG|CTL_PST_REACH))) continue; if (!dogetpeers(peervarlist, (int)assoc_cache[i].assid, fp, af)) { return; } } return; } /* * peers - print a peer spreadsheet */ /*ARGSUSED*/ static void peers( struct parse *pcmd, FILE *fp ) { int af = 0; if (pcmd->nargs == 1) { if (pcmd->argval->ival == 6) af = AF_INET6; else af = AF_INET; } dopeers(0, fp, af); } /* * lpeers - print a peer spreadsheet including all fuzzball peers */ /*ARGSUSED*/ static void lpeers( struct parse *pcmd, FILE *fp ) { int af = 0; if (pcmd->nargs == 1) { if (pcmd->argval->ival == 6) af = AF_INET6; else af = AF_INET; } dopeers(1, fp, af); } /* * opeers - print a peer spreadsheet */ static void doopeers( int showall, FILE *fp, int af ) { register int i; char fullname[LENHOSTNAME]; sockaddr_u netnum; if (!dogetassoc(fp)) return; for (i = 0; i < numhosts; ++i) { if (getnetnum(chosts[i], &netnum, fullname, af)) if ((int)strlen(fullname) > maxhostlen) maxhostlen = strlen(fullname); } if (numhosts > 1) (void) fprintf(fp, "%-*.*s ", maxhostlen, maxhostlen, "server"); (void) fprintf(fp, " remote local st t when poll reach delay offset disp\n"); if (numhosts > 1) for (i = 0; i <= maxhostlen; ++i) (void) fprintf(fp, "="); (void) fprintf(fp, "==============================================================================\n"); for (i = 0; i < numassoc; i++) { if (!showall && !(CTL_PEER_STATVAL(assoc_cache[i].status) & (CTL_PST_CONFIG|CTL_PST_REACH))) continue; if (!dogetpeers(opeervarlist, (int)assoc_cache[i].assid, fp, af)) { return; } } return; } /* * opeers - print a peer spreadsheet the old way */ /*ARGSUSED*/ static void opeers( struct parse *pcmd, FILE *fp ) { int af = 0; if (pcmd->nargs == 1) { if (pcmd->argval->ival == 6) af = AF_INET6; else af = AF_INET; } doopeers(0, fp, af); } /* * lopeers - print a peer spreadsheet including all fuzzball peers */ /*ARGSUSED*/ static void lopeers( struct parse *pcmd, FILE *fp ) { int af = 0; if (pcmd->nargs == 1) { if (pcmd->argval->ival == 6) af = AF_INET6; else af = AF_INET; } doopeers(1, fp, af); } /* * config - send a configuration command to a remote host */ static void config ( struct parse *pcmd, FILE *fp ) { char *cfgcmd; u_short rstatus; int rsize; const char *rdata; char *resp; int res; int col; int i; cfgcmd = pcmd->argval[0].string; if (debug > 2) fprintf(stderr, "In Config\n" "Keyword = %s\n" "Command = %s\n", pcmd->keyword, cfgcmd); res = doquery(CTL_OP_CONFIGURE, 0, 1, strlen(cfgcmd), cfgcmd, &rstatus, &rsize, &rdata); if (res != 0) return; if (rsize > 0 && '\n' == rdata[rsize - 1]) rsize--; resp = emalloc(rsize + 1); memcpy(resp, rdata, rsize); resp[rsize] = '\0'; col = -1; if (1 == sscanf(resp, "column %d syntax error", &col) && col >= 0 && (size_t)col <= strlen(cfgcmd) + 1) { if (interactive) { printf("______"); /* "ntpq> " */ printf("________"); /* ":config " */ } else printf("%s\n", cfgcmd); for (i = 1; i < col; i++) putchar('_'); printf("^\n"); } printf("%s\n", resp); free(resp); } /* * config_from_file - remotely configure an ntpd daemon using the * specified configuration file * SK: This function is a kludge at best and is full of bad design * bugs: * 1. ntpq uses UDP, which means that there is no guarantee of in-order, * error-free delivery. * 2. The maximum length of a packet is constrained, and as a result, the * maximum length of a line in a configuration file is constrained. * Longer lines will lead to unpredictable results. * 3. Since this function is sending a line at a time, we can't update * the control key through the configuration file (YUCK!!) */ static void config_from_file ( struct parse *pcmd, FILE *fp ) { u_short rstatus; int rsize; const char *rdata; int res; FILE *config_fd; char config_cmd[MAXLINE]; size_t config_len; int i; int retry_limit; if (debug > 2) fprintf(stderr, "In Config\n" "Keyword = %s\n" "Filename = %s\n", pcmd->keyword, pcmd->argval[0].string); config_fd = fopen(pcmd->argval[0].string, "r"); if (NULL == config_fd) { printf("ERROR!! Couldn't open file: %s\n", pcmd->argval[0].string); return; } printf("Sending configuration file, one line at a time.\n"); i = 0; while (fgets(config_cmd, MAXLINE, config_fd) != NULL) { config_len = strlen(config_cmd); /* ensure even the last line has newline, if possible */ if (config_len > 0 && config_len + 2 < sizeof(config_cmd) && '\n' != config_cmd[config_len - 1]) config_cmd[config_len++] = '\n'; ++i; retry_limit = 2; do res = doquery(CTL_OP_CONFIGURE, 0, 1, strlen(config_cmd), config_cmd, &rstatus, &rsize, &rdata); while (res != 0 && retry_limit--); if (res != 0) { printf("Line No: %d query failed: %s", i, config_cmd); printf("Subsequent lines not sent.\n"); fclose(config_fd); return; } if (rsize > 0 && '\n' == rdata[rsize - 1]) rsize--; if (rsize > 0 && '\r' == rdata[rsize - 1]) rsize--; printf("Line No: %d %.*s: %s", i, rsize, rdata, config_cmd); } printf("Done sending file\n"); fclose(config_fd); } ntp-4.2.6p5/ntpq/ntpq.h0000644000175000017500000000516111675457723013752 0ustar peterpeter/* * ntpq.h - definitions of interest to ntpq */ #include "ntp_fp.h" #include "ntp.h" #include "ntp_control.h" #include "ntp_string.h" #include "ntp_malloc.h" #include "lib_strbuf.h" /* * Maximum number of arguments */ #define MAXARGS 4 /* * Flags for forming descriptors. */ /* * Flags for forming descriptors. */ #define OPT 0x80 /* this argument is optional, or'd with type */ #define NO 0x0 #define NTP_STR 0x1 /* string argument */ #define NTP_UINT 0x2 /* unsigned integer */ #define NTP_INT 0x3 /* signed integer */ #define NTP_ADD 0x4 /* IP network address */ #define IP_VERSION 0x5 /* IP version */ /* * Arguments are returned in a union */ typedef union { char *string; long ival; u_long uval; sockaddr_u netnum; } arg_v; /* * Structure for passing parsed command line */ struct parse { const char *keyword; arg_v argval[MAXARGS]; int nargs; }; /* * ntpdc includes a command parser which could charitably be called * crude. The following structure is used to define the command * syntax. */ struct xcmd { const char *keyword; /* command key word */ void (*handler) (struct parse *, FILE *); /* command handler */ u_char arg[MAXARGS]; /* descriptors for arguments */ const char *desc[MAXARGS]; /* descriptions for arguments */ const char *comment; }; /* * Structure to hold association data */ struct association { associd_t assid; u_short status; }; #define MAXASSOC 1024 /* * Structure for translation tables between text format * variable indices and text format. */ struct ctl_var { u_short code; u_short fmt; const char *text; }; extern int interactive; /* are we prompting? */ extern int old_rv; /* use old rv behavior? --old-rv */ extern void asciize (int, char *, FILE *); extern int getnetnum (const char *, sockaddr_u *, char *, int); extern void sortassoc (void); extern void show_error_msg (int, associd_t); extern int doquery (int, associd_t, int, int, char *, u_short *, int *, const char **); extern int doqueryex (int, associd_t, int, int, char *, u_short *, int *, const char **, int); extern char * nntohost (sockaddr_u *); extern char * nntohost_col (sockaddr_u *, size_t, int); extern int decodets (char *, l_fp *); extern int decodeuint (char *, u_long *); extern int nextvar (int *, const char **, char **, char **); extern int decodetime (char *, l_fp *); extern void printvars (int, const char *, int, int, int, FILE *); extern int decodeint (char *, long *); extern int findvar (char *, struct ctl_var *, int code); extern void makeascii (int, const char *, FILE *); extern char * trunc_left (const char *, size_t); extern char * trunc_right (const char *, size_t); ntp-4.2.6p5/ntpq/ntpq-opts.def0000644000175000017500000002411211307651604015223 0ustar peterpeter/* -*- Mode: Text -*- */ autogen definitions options; #include copyright.def #include homerc.def #include autogen-version.def prog-name = "ntpq"; prog-title = "standard NTP query program"; argument = '[ host ...]'; test-main; flag = { name = ipv4; flags-cant = ipv6; value = 4; descrip = "Force IPv4 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; value = 6; descrip = "Force IPv6 DNS name resolution"; doc = <<- _EndOfDoc_ Force DNS resolution of following host names on the command line to the IPv6 namespace. _EndOfDoc_; }; flag = { name = command; value = c; arg-type = string; descrip = "run a command and exit"; max = NOLIMIT; arg-name = cmd; call-proc = ntpq_custom_opt_handler; doc = <<- _EndOfDoc_ The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). _EndOfDoc_; }; #include debug-opt.def flag = { name = peers; value = p; descrip = "Print a list of the peers"; flags-cant = interactive; call-proc = ntpq_custom_opt_handler; doc = <<- _EndOfDoc_ Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'peers' interactive command. _EndOfDoc_; }; flag = { name = interactive; value = i; flags-cant = command, peers; descrip = "Force ntpq to operate in interactive mode"; doc = <<- _EndOfDoc_ Force ntpq to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input. _EndOfDoc_; }; flag = { name = numeric; value = n; descrip = "numeric host addresses"; doc = <<- _EndOfDoc_ Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names. _EndOfDoc_; }; flag = { name = old-rv; descrip = "Always output status line with readvar"; doc = <<- _EndOfDoc_ By default, ntpq now suppresses the associd=... line that precedes the output of "readvar" (alias "rv") when a single variable is requested, such as ntpq -c "rv 0 offset". This option causes ntpq to include both lines of output for a single-variable readvar. Using an environment variable to preset this option in a script will enable both older and newer ntpq to behave identically in this regard. _EndOfDoc_; }; detail = <<- _END_DETAIL The [= prog-name =] utility program is used to query NTP servers which implement the standard NTP mode 6 control message formats defined in Appendix B of the NTPv3 specification RFC1305, requesting information about current state and/or changes in that state. The same formats are used in NTPv4, although some of the variables have changed and new ones added. _END_DETAIL; prog-man-descrip = <<- _END_PROG_MAN_DESCRIP The [= prog-name =] utility program is used to query NTP servers which implement the standard NTP mode 6 control message formats defined in Appendix B of the NTPv3 specification RFC1305, requesting information about current state and/or changes in that state. The same formats are used in NTPv4, although some of the variables have changed and new ones added. The description on this page is for the NTPv4 variables. The program may be run either in interactive mode or controlled using command line arguments. Requests to read and write arbitrary variables can be assembled, with raw and pretty-printed output options being available. The [= prog-name =] utility can also obtain and print a list of peers in a common format by sending multiple queries to the server. If one or more request options is included on the command line when [= prog-name =] is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, [= prog-name =] will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. The [= prog-name =] utility will prompt for commands if the standard input is a terminal device. The [= prog-name =] utility uses NTP mode 6 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. The [= prog-name =] utility makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time. Specifying a command line option other than .Fl i or .Fl n will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, [= prog-name =] will attempt to read interactive format commands from the standard input. .Ss "Internal Commands" Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to uniquely identify the command need be typed. A number of interactive format commands are executed entirely within the [= prog-name =] utility itself and do not result in NTP mode 6 requests being sent to a server. These are described following. @table @code @item ? [command_keyword] @itemx help [command_keyword] A .Ql \&? by itself will print a list of all the command keywords known to this incarnation of [= prog-name =] . A .Ql \&? followed by a command keyword will print function and usage information about the command. This command is probably a better source of information about [= prog-name =] than this manual page. @item addvars .Ar variable_name [=value] ... .Xc @item rmvars variable_name ... @item clearvars The data carried by NTP mode 6 messages consists of a list of items of the form .Ql variable_name=value , where the .Ql =value is ignored, and can be omitted, in requests to the server to read variables. The [= prog-name =] utility maintains an internal list in which data to be included in control messages can be assembled, and sent using the .Ic readlist and .Ic writelist commands described below. The .Ic addvars command allows variables and their optional values to be added to the list. If more than one variable is to be added, the list should be comma-separated and not contain white space. The .Ic rmvars command can be used to remove individual variables from the list, while the .Ic clearlist command removes all variables from the list. @item authenticate [ yes | no ] Normally [= prog-name =] does not authenticate requests unless they are write requests. The command .Ql authenticate yes causes [= prog-name =] to send authentication with all requests it makes. Authenticated requests causes some servers to handle requests slightly differently, and can occasionally melt the CPU in fuzzballs if you turn authentication on before doing a .Ic peer display. The command .Ql authenticate causes [= prog-name =] to display whether or not [= prog-name =] is currently autheinticating requests. @item cooked Causes output from query commands to be "cooked", so that variables which are recognized by [= prog-name =] will have their values reformatted for human consumption. Variables which [= prog-name =] thinks should have a decodable value but didn't are marked with a trailing .Ql \&? . .@item debug [ .Cm more | .Cm less | .Cm off ] .Xc With no argument, displays the current debug level. Otherwise, the debug level is changed to the indicated level. @item delay milliseconds Specify a time interval to be added to timestamps included in requests which require authentication. This is used to enable (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized. Actually the server does not now require timestamps in authenticated requests, so this command may be obsolete. @item host hostname Set the host to which future queries will be sent. Hostname may be either a host name or a numeric address. @item hostnames Cm yes | Cm no If .Cm yes is specified, host names are printed in information displays. If .Cm no is specified, numeric addresses are printed instead. The default is .Cm yes , unless modified using the command line .Fl n switch. @item keyid keyid This command allows the specification of a key number to be used to authenticate configuration requests. This must correspond to a key number the server has been configured to use for this purpose. @item ntpversion [ .Cm 1 | .Cm 2 | .Cm 3 | .Cm 4 ] .Xc Sets the NTP version number which [= prog-name =] claims in packets. Defaults to 3, Note that mode 6 control messages (and modes, for that matter) didn't exist in NTP version 1. There appear to be no servers left which demand version 1. With no argument, displays the current NTP version that will be used when communicating with servers. @item quit Exit [= prog-name =] . @item passwd This command prompts you to type in a password (which will not be echoed) which will be used to authenticate configuration requests. The password must correspond to the key configured for use by the NTP server for this purpose if such requests are to be successful. @item raw Causes all output from query commands is printed as received from the remote server. The only formating/interpretation done on the data is to transform nonascii data into a printable (but barely understandable) form. @item timeout Ar milliseconds Specify a timeout period for responses to server queries. The default is about 5000 milliseconds. Note that since [= prog-name =] retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set. @end table _END_PROG_MAN_DESCRIP; ntp-4.2.6p5/ntpq/libntpq_subs.c0000644000175000017500000000234511505336022015445 0ustar peterpeter/***************************************************************************** * * libntpq_subs.c * * This is the second part of the wrapper library for ntpq, the NTP query utility. * This library reuses the sourcecode from ntpq and exports a number * of useful functions in a library that can be linked against applications * that need to query the status of a running ntpd. The whole * communcation is based on mode 6 packets. * * This source file exports the (private) functions from ntpq-subs.c * ****************************************************************************/ #include "ntpq-subs.c" #include "libntpq.h" /* the following functions are required internally by a number of libntpq functions * and since they are defined as static in ntpq-subs.c, they need to be exported here */ int ntpq_dogetassoc(void) { if ( dogetassoc(NULL)) { return numassoc; } else { return 0; } } char ntpq_decodeaddrtype(sockaddr_u *sock) { return decodeaddrtype(sock); } int ntpq_doquerylist( struct ntpq_varlist *vlist, int op, associd_t associd, int auth, u_short *rstatus, int *dsize, const char **datap ) { return doquerylist((struct varlist *)vlist, op, associd, auth, rstatus, dsize, datap); } ntp-4.2.6p5/ntpq/ntpq.c0000644000175000017500000021510611675457723013747 0ustar peterpeter/* * ntpq - query an NTP server using mode 6 commands */ #include #include #include #include #include #include #include "ntpq.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" #include "ntp_io.h" #include "ntp_select.h" #include "ntp_stdlib.h" #include "ntp_assert.h" #include "ntp_lineedit.h" #include "ntp_debug.h" #include "isc/net.h" #include "isc/result.h" #include #include "ntp_libopts.h" #include "ntpq-opts.h" #ifdef SYS_WINNT # include # include #endif /* SYS_WINNT */ #ifdef SYS_VXWORKS /* vxWorks needs mode flag -casey*/ # define open(name, flags) open(name, flags, 0777) # define SERVER_PORT_NUM 123 #endif /* we use COMMAND as an autogen keyword */ #ifdef COMMAND # undef COMMAND #endif /* * Because we potentially understand a lot of commands we will run * interactive if connected to a terminal. */ int interactive = 0; /* set to 1 when we should prompt */ const char *prompt = "ntpq> "; /* prompt to ask him about */ /* * use old readvars behavior? --old-rv processing in ntpq resets * this value based on the presence or absence of --old-rv. It is * initialized to 1 here to maintain backward compatibility with * libntpq clients such as ntpsnmpd, which are free to reset it as * desired. */ int old_rv = 1; /* * for get_systime() */ s_char sys_precision; /* local clock precision (log2 s) */ /* * Keyid used for authenticated requests. Obtained on the fly. */ u_long info_auth_keyid = 0; static int info_auth_keytype = NID_md5; /* MD5 */ static size_t info_auth_hashlen = 16; /* MD5 */ u_long current_time; /* needed by authkeys; not used */ /* * Flag which indicates we should always send authenticated requests */ int always_auth = 0; /* * Flag which indicates raw mode output. */ int rawmode = 0; /* * Packet version number we use */ u_char pktversion = NTP_OLDVERSION + 1; /* * Don't jump if no set jmp. */ volatile int jump = 0; /* * Format values */ #define PADDING 0 #define TS 1 /* time stamp */ #define FL 2 /* l_fp type value */ #define FU 3 /* u_fp type value */ #define FS 4 /* s_fp type value */ #define UI 5 /* unsigned integer value */ #define SI 6 /* signed integer value */ #define HA 7 /* host address */ #define NA 8 /* network address */ #define ST 9 /* string value */ #define RF 10 /* refid (sometimes string, sometimes not) */ #define LP 11 /* leap (print in binary) */ #define OC 12 /* integer, print in octal */ #define MD 13 /* mode */ #define AR 14 /* array of times */ #define FX 15 /* test flags */ #define EOV 255 /* end of table */ /* * System variable values. The array can be indexed by * the variable index to find the textual name. */ struct ctl_var sys_var[] = { { 0, PADDING, "" }, /* 0 */ { CS_LEAP, LP, "leap" }, /* 1 */ { CS_STRATUM, UI, "stratum" }, /* 2 */ { CS_PRECISION, SI, "precision" }, /* 3 */ { CS_ROOTDELAY, FS, "rootdelay" }, /* 4 */ { CS_ROOTDISPERSION, FU, "rootdispersion" }, /* 5 */ { CS_REFID, RF, "refid" }, /* 6 */ { CS_REFTIME, TS, "reftime" }, /* 7 */ { CS_POLL, UI, "poll" }, /* 8 */ { CS_PEERID, UI, "peer" }, /* 9 */ { CS_OFFSET, FL, "offset" }, /* 10 */ { CS_DRIFT, FS, "frequency" }, /* 11 */ { CS_JITTER, FU, "jitter" }, /* 12 */ { CS_CLOCK, TS, "clock" }, /* 13 */ { CS_PROCESSOR, ST, "processor" }, /* 14 */ { CS_SYSTEM, ST, "system" }, /* 15 */ { CS_VERSION, ST, "version" }, /* 16 */ { CS_STABIL, FS, "stability" }, /* 17 */ { CS_VARLIST, ST, "sys_var_list" }, /* 18 */ { 0, EOV, "" } }; /* * Peer variable list */ struct ctl_var peer_var[] = { { 0, PADDING, "" }, /* 0 */ { CP_CONFIG, UI, "config" }, /* 1 */ { CP_AUTHENABLE, UI, "authenable" }, /* 2 */ { CP_AUTHENTIC, UI, "authentic" }, /* 3 */ { CP_SRCADR, HA, "srcadr" }, /* 4 */ { CP_SRCPORT, UI, "srcport" }, /* 5 */ { CP_DSTADR, NA, "dstadr" }, /* 6 */ { CP_DSTPORT, UI, "dstport" }, /* 7 */ { CP_LEAP, LP, "leap" }, /* 8 */ { CP_HMODE, MD, "hmode" }, /* 9 */ { CP_STRATUM, UI, "stratum" }, /* 10 */ { CP_PPOLL, UI, "ppoll" }, /* 11 */ { CP_HPOLL, UI, "hpoll" }, /* 12 */ { CP_PRECISION, SI, "precision" }, /* 13 */ { CP_ROOTDELAY, FS, "rootdelay" }, /* 14 */ { CP_ROOTDISPERSION, FU, "rootdisp" }, /* 15 */ { CP_REFID, RF, "refid" }, /* 16 */ { CP_REFTIME, TS, "reftime" }, /* 17 */ { CP_ORG, TS, "org" }, /* 18 */ { CP_REC, TS, "rec" }, /* 19 */ { CP_XMT, TS, "xmt" }, /* 20 */ { CP_REACH, OC, "reach" }, /* 21 */ { CP_UNREACH, UI, "unreach" }, /* 22 */ { CP_TIMER, UI, "timer" }, /* 23 */ { CP_DELAY, FS, "delay" }, /* 24 */ { CP_OFFSET, FL, "offset" }, /* 25 */ { CP_JITTER, FU, "jitter" }, /* 26 */ { CP_DISPERSION, FU, "dispersion" }, /* 27 */ { CP_KEYID, UI, "keyid" }, /* 28 */ { CP_FILTDELAY, AR, "filtdelay" }, /* 29 */ { CP_FILTOFFSET, AR, "filtoffset" }, /* 30 */ { CP_PMODE, ST, "pmode" }, /* 31 */ { CP_RECEIVED, UI, "received" }, /* 32 */ { CP_SENT, UI, "sent" }, /* 33 */ { CP_FILTERROR, AR, "filtdisp" }, /* 34 */ { CP_FLASH, FX, "flash" }, /* 35 */ { CP_TTL, UI, "ttl" }, /* 36 */ /* * These are duplicate entries so that we can * process deviant version of the ntp protocol. */ { CP_SRCADR, HA, "peeraddr" }, /* 4 */ { CP_SRCPORT, UI, "peerport" }, /* 5 */ { CP_PPOLL, UI, "peerpoll" }, /* 11 */ { CP_HPOLL, UI, "hostpoll" }, /* 12 */ { CP_FILTERROR, AR, "filterror" }, /* 34 */ { 0, EOV, "" } }; /* * Clock variable list */ struct ctl_var clock_var[] = { { 0, PADDING, "" }, /* 0 */ { CC_TYPE, UI, "type" }, /* 1 */ { CC_TIMECODE, ST, "timecode" }, /* 2 */ { CC_POLL, UI, "poll" }, /* 3 */ { CC_NOREPLY, UI, "noreply" }, /* 4 */ { CC_BADFORMAT, UI, "badformat" }, /* 5 */ { CC_BADDATA, UI, "baddata" }, /* 6 */ { CC_FUDGETIME1, FL, "fudgetime1" }, /* 7 */ { CC_FUDGETIME2, FL, "fudgetime2" }, /* 8 */ { CC_FUDGEVAL1, UI, "stratum" }, /* 9 */ { CC_FUDGEVAL2, RF, "refid" }, /* 10 */ { CC_FLAGS, UI, "flags" }, /* 11 */ { CC_DEVICE, ST, "device" }, /* 12 */ { 0, EOV, "" } }; /* * flasher bits */ static const char *tstflagnames[] = { "pkt_dup", /* TEST1 */ "pkt_bogus", /* TEST2 */ "pkt_unsync", /* TEST3 */ "pkt_denied", /* TEST4 */ "pkt_auth", /* TEST5 */ "pkt_stratum", /* TEST6 */ "pkt_header", /* TEST7 */ "pkt_autokey", /* TEST8 */ "pkt_crypto", /* TEST9 */ "peer_stratum", /* TEST10 */ "peer_dist", /* TEST11 */ "peer_loop", /* TEST12 */ "peer_unreach" /* TEST13 */ }; int ntpqmain (int, char **); /* * Built in command handler declarations */ static int openhost (const char *); static int sendpkt (void *, size_t); static int getresponse (int, int, u_short *, int *, const char **, int); static int sendrequest (int, int, int, int, char *); static char * tstflags (u_long); #ifndef BUILD_AS_LIB static void getcmds (void); #ifndef SYS_WINNT static RETSIGTYPE abortcmd (int); #endif /* SYS_WINNT */ static void docmd (const char *); static void tokenize (const char *, char **, int *); static int getarg (char *, int, arg_v *); #endif /* BUILD_AS_LIB */ static int findcmd (char *, struct xcmd *, struct xcmd *, struct xcmd **); static int rtdatetolfp (char *, l_fp *); static int decodearr (char *, int *, l_fp *); static void help (struct parse *, FILE *); static int helpsort (const void *, const void *); static void printusage (struct xcmd *, FILE *); static void timeout (struct parse *, FILE *); static void auth_delay (struct parse *, FILE *); static void host (struct parse *, FILE *); static void ntp_poll (struct parse *, FILE *); static void keyid (struct parse *, FILE *); static void keytype (struct parse *, FILE *); static void passwd (struct parse *, FILE *); static void hostnames (struct parse *, FILE *); static void setdebug (struct parse *, FILE *); static void quit (struct parse *, FILE *); static void version (struct parse *, FILE *); static void raw (struct parse *, FILE *); static void cooked (struct parse *, FILE *); static void authenticate (struct parse *, FILE *); static void ntpversion (struct parse *, FILE *); static void warning (const char *, const char *, const char *); static void error (const char *, const char *, const char *); static u_long getkeyid (const char *); static void atoascii (const char *, size_t, char *, size_t); static void cookedprint (int, int, const char *, int, int, FILE *); static void rawprint (int, int, const char *, int, int, FILE *); static void startoutput (void); static void output (FILE *, char *, char *); static void endoutput (FILE *); static void outputarr (FILE *, char *, int, l_fp *); static int assoccmp (const void *, const void *); void ntpq_custom_opt_handler (tOptions *, tOptDesc *); /* * Built-in commands we understand */ struct xcmd builtins[] = { { "?", help, { OPT|NTP_STR, NO, NO, NO }, { "command", "", "", "" }, "tell the use and syntax of commands" }, { "help", help, { OPT|NTP_STR, NO, NO, NO }, { "command", "", "", "" }, "tell the use and syntax of commands" }, { "timeout", timeout, { OPT|NTP_UINT, NO, NO, NO }, { "msec", "", "", "" }, "set the primary receive time out" }, { "delay", auth_delay, { OPT|NTP_INT, NO, NO, NO }, { "msec", "", "", "" }, "set the delay added to encryption time stamps" }, { "host", host, { OPT|NTP_STR, OPT|NTP_STR, NO, NO }, { "-4|-6", "hostname", "", "" }, "specify the host whose NTP server we talk to" }, { "poll", ntp_poll, { OPT|NTP_UINT, OPT|NTP_STR, NO, NO }, { "n", "verbose", "", "" }, "poll an NTP server in client mode `n' times" }, { "passwd", passwd, { NO, NO, NO, NO }, { "", "", "", "" }, "specify a password to use for authenticated requests"}, { "hostnames", hostnames, { OPT|NTP_STR, NO, NO, NO }, { "yes|no", "", "", "" }, "specify whether hostnames or net numbers are printed"}, { "debug", setdebug, { OPT|NTP_STR, NO, NO, NO }, { "no|more|less", "", "", "" }, "set/change debugging level" }, { "quit", quit, { NO, NO, NO, NO }, { "", "", "", "" }, "exit ntpq" }, { "exit", quit, { NO, NO, NO, NO }, { "", "", "", "" }, "exit ntpq" }, { "keyid", keyid, { OPT|NTP_UINT, NO, NO, NO }, { "key#", "", "", "" }, "set keyid to use for authenticated requests" }, { "version", version, { NO, NO, NO, NO }, { "", "", "", "" }, "print version number" }, { "raw", raw, { NO, NO, NO, NO }, { "", "", "", "" }, "do raw mode variable output" }, { "cooked", cooked, { NO, NO, NO, NO }, { "", "", "", "" }, "do cooked mode variable output" }, { "authenticate", authenticate, { OPT|NTP_STR, NO, NO, NO }, { "yes|no", "", "", "" }, "always authenticate requests to this server" }, { "ntpversion", ntpversion, { OPT|NTP_UINT, NO, NO, NO }, { "version number", "", "", "" }, "set the NTP version number to use for requests" }, { "keytype", keytype, { OPT|NTP_STR, NO, NO, NO }, { "key type (md5|des)", "", "", "" }, "set key type to use for authenticated requests (des|md5)" }, { 0, 0, { NO, NO, NO, NO }, { "", "", "", "" }, "" } }; /* * Default values we use. */ #define DEFHOST "localhost" /* default host name */ #define DEFTIMEOUT (5) /* 5 second time out */ #define DEFSTIMEOUT (2) /* 2 second time out after first */ #define DEFDELAY 0x51EB852 /* 20 milliseconds, l_fp fraction */ #define LENHOSTNAME 256 /* host name is 256 characters long */ #define MAXCMDS 100 /* maximum commands on cmd line */ #define MAXHOSTS 200 /* maximum hosts on cmd line */ #define MAXLINE 512 /* maximum line length */ #define MAXTOKENS (1+MAXARGS+2) /* maximum number of usable tokens */ #define MAXVARLEN 256 /* maximum length of a variable name */ #define MAXVALLEN 400 /* maximum length of a variable value */ #define MAXOUTLINE 72 /* maximum length of an output line */ #define SCREENWIDTH 76 /* nominal screen width in columns */ /* * Some variables used and manipulated locally */ struct sock_timeval tvout = { DEFTIMEOUT, 0 }; /* time out for reads */ struct sock_timeval tvsout = { DEFSTIMEOUT, 0 };/* secondary time out */ l_fp delay_time; /* delay time */ char currenthost[LENHOSTNAME]; /* current host name */ int currenthostisnum; /* is prior text from IP? */ struct sockaddr_in hostaddr = { 0 }; /* host address */ int showhostnames = 1; /* show host names by default */ int ai_fam_templ; /* address family */ int ai_fam_default; /* default address family */ SOCKET sockfd; /* fd socket is opened on */ int havehost = 0; /* set to 1 when host open */ int s_port = 0; struct servent *server_entry = NULL; /* server entry for ntp */ /* * Sequence number used for requests. It is incremented before * it is used. */ u_short sequence; /* * Holds data returned from queries. Declare buffer long to be sure of * alignment. */ #define MAXFRAGS 24 /* maximum number of fragments */ #define DATASIZE (MAXFRAGS*480) /* maximum amount of data */ long pktdata[DATASIZE/sizeof(long)]; /* * Holds association data for use with the &n operator. */ struct association assoc_cache[MAXASSOC]; int numassoc = 0; /* number of cached associations */ /* * For commands typed on the command line (with the -c option) */ int numcmds = 0; const char *ccmds[MAXCMDS]; #define ADDCMD(cp) if (numcmds < MAXCMDS) ccmds[numcmds++] = (cp) /* * When multiple hosts are specified. */ int numhosts = 0; const char *chosts[MAXHOSTS]; #define ADDHOST(cp) if (numhosts < MAXHOSTS) chosts[numhosts++] = (cp) /* * Error codes for internal use */ #define ERR_UNSPEC 256 #define ERR_INCOMPLETE 257 #define ERR_TIMEOUT 258 #define ERR_TOOMUCH 259 /* * Macro definitions we use */ #define ISSPACE(c) ((c) == ' ' || (c) == '\t') #define ISEOL(c) ((c) == '\n' || (c) == '\r' || (c) == '\0') #define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0) /* * Jump buffer for longjumping back to the command level */ jmp_buf interrupt_buf; /* * Points at file being currently printed into */ FILE *current_output; /* * Command table imported from ntpdc_ops.c */ extern struct xcmd opcmds[]; char *progname; volatile int debug; #ifdef NO_MAIN_ALLOWED #ifndef BUILD_AS_LIB CALL(ntpq,"ntpq",ntpqmain); void clear_globals(void) { extern int ntp_optind; showhostnames = 0; /* don'tshow host names by default */ ntp_optind = 0; server_entry = NULL; /* server entry for ntp */ havehost = 0; /* set to 1 when host open */ numassoc = 0; /* number of cached associations */ numcmds = 0; numhosts = 0; } #endif /* !BUILD_AS_LIB */ #endif /* NO_MAIN_ALLOWED */ /* * main - parse arguments and handle options */ #ifndef NO_MAIN_ALLOWED int main( int argc, char *argv[] ) { return ntpqmain(argc, argv); } #endif #ifndef BUILD_AS_LIB int ntpqmain( int argc, char *argv[] ) { extern int ntp_optind; #ifdef SYS_VXWORKS clear_globals(); taskPrioritySet(taskIdSelf(), 100 ); #endif delay_time.l_ui = 0; delay_time.l_uf = DEFDELAY; init_lib(); /* sets up ipv4_works, ipv6_works */ ssl_applink(); /* Check to see if we have IPv6. Otherwise default to IPv4 */ if (!ipv6_works) ai_fam_default = AF_INET; progname = argv[0]; { int optct = ntpOptionProcess(&ntpqOptions, argc, argv); argc -= optct; argv += optct; } /* * Process options other than -c and -p, which are specially * handled by ntpq_custom_opt_handler(). */ debug = DESC(DEBUG_LEVEL).optOccCt; if (HAVE_OPT(IPV4)) ai_fam_templ = AF_INET; else if (HAVE_OPT(IPV6)) ai_fam_templ = AF_INET6; else ai_fam_templ = ai_fam_default; if (HAVE_OPT(INTERACTIVE)) interactive = 1; if (HAVE_OPT(NUMERIC)) showhostnames = 0; old_rv = HAVE_OPT(OLD_RV); #if 0 while ((c = ntp_getopt(argc, argv, "46c:dinp")) != EOF) switch (c) { case '4': ai_fam_templ = AF_INET; break; case '6': ai_fam_templ = AF_INET6; break; case 'c': ADDCMD(ntp_optarg); break; case 'd': ++debug; break; case 'i': interactive = 1; break; case 'n': showhostnames = 0; break; case 'p': ADDCMD("peers"); break; default: errflg++; break; } if (errflg) { (void) fprintf(stderr, "usage: %s [-46dinp] [-c cmd] host ...\n", progname); exit(2); } #endif NTP_INSIST(ntp_optind <= argc); if (ntp_optind == argc) { ADDHOST(DEFHOST); } else { for (; ntp_optind < argc; ntp_optind++) ADDHOST(argv[ntp_optind]); } if (numcmds == 0 && interactive == 0 && isatty(fileno(stdin)) && isatty(fileno(stderr))) { interactive = 1; } #ifndef SYS_WINNT /* Under NT cannot handle SIGINT, WIN32 spawns a handler */ if (interactive) (void) signal_no_reset(SIGINT, abortcmd); #endif /* SYS_WINNT */ if (numcmds == 0) { (void) openhost(chosts[0]); getcmds(); } else { int ihost; int icmd; for (ihost = 0; ihost < numhosts; ihost++) { if (openhost(chosts[ihost])) for (icmd = 0; icmd < numcmds; icmd++) docmd(ccmds[icmd]); } } #ifdef SYS_WINNT WSACleanup(); #endif /* SYS_WINNT */ return 0; } #endif /* !BUILD_AS_LIB */ /* * openhost - open a socket to a host */ static int openhost( const char *hname ) { char temphost[LENHOSTNAME]; int a_info, i; struct addrinfo hints, *ai = NULL; register const char *cp; char name[LENHOSTNAME]; char service[5]; /* * We need to get by the [] if they were entered */ cp = hname; if (*cp == '[') { cp++; for (i = 0; *cp && *cp != ']'; cp++, i++) name[i] = *cp; if (*cp == ']') { name[i] = '\0'; hname = name; } else { return 0; } } /* * First try to resolve it as an ip address and if that fails, * do a fullblown (dns) lookup. That way we only use the dns * when it is needed and work around some implementations that * will return an "IPv4-mapped IPv6 address" address if you * give it an IPv4 address to lookup. */ strcpy(service, "ntp"); ZERO(hints); hints.ai_family = ai_fam_templ; hints.ai_protocol = IPPROTO_UDP; hints.ai_socktype = SOCK_DGRAM; hints.ai_flags = Z_AI_NUMERICHOST; a_info = getaddrinfo(hname, service, &hints, &ai); if (a_info == EAI_NONAME #ifdef EAI_NODATA || a_info == EAI_NODATA #endif ) { hints.ai_flags = AI_CANONNAME; #ifdef AI_ADDRCONFIG hints.ai_flags |= AI_ADDRCONFIG; #endif a_info = getaddrinfo(hname, service, &hints, &ai); } #ifdef AI_ADDRCONFIG /* Some older implementations don't like AI_ADDRCONFIG. */ if (a_info == EAI_BADFLAGS) { hints.ai_flags = AI_CANONNAME; a_info = getaddrinfo(hname, service, &hints, &ai); } #endif if (a_info != 0) { (void) fprintf(stderr, "%s\n", gai_strerror(a_info)); return 0; } if (!showhostnames || ai->ai_canonname == NULL) { strncpy(temphost, stoa((sockaddr_u *)ai->ai_addr), LENHOSTNAME); currenthostisnum = TRUE; } else { strncpy(temphost, ai->ai_canonname, LENHOSTNAME); currenthostisnum = FALSE; } temphost[LENHOSTNAME-1] = '\0'; if (debug > 2) printf("Opening host %s\n", temphost); if (havehost == 1) { if (debug > 2) printf("Closing old host %s\n", currenthost); (void) closesocket(sockfd); havehost = 0; } (void) strcpy(currenthost, temphost); /* port maps to the same location in both families */ s_port = ((struct sockaddr_in6 *)ai->ai_addr)->sin6_port; #ifdef SYS_VXWORKS ((struct sockaddr_in6 *)&hostaddr)->sin6_port = htons(SERVER_PORT_NUM); if (ai->ai_family == AF_INET) *(struct sockaddr_in *)&hostaddr= *((struct sockaddr_in *)ai->ai_addr); else *(struct sockaddr_in6 *)&hostaddr= *((struct sockaddr_in6 *)ai->ai_addr); #endif /* SYS_VXWORKS */ #ifdef SYS_WINNT { int optionValue = SO_SYNCHRONOUS_NONALERT; int err; err = setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *)&optionValue, sizeof(optionValue)); if (err) { err = WSAGetLastError(); fprintf(stderr, "setsockopt(SO_SYNCHRONOUS_NONALERT) " "error: %s\n", strerror(err)); exit(1); } } #endif /* SYS_WINNT */ sockfd = socket(ai->ai_family, SOCK_DGRAM, 0); if (sockfd == INVALID_SOCKET) { error("socket", "", ""); } #ifdef NEED_RCVBUF_SLOP # ifdef SO_RCVBUF { int rbufsize = DATASIZE + 2048; /* 2K for slop */ if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, &rbufsize, sizeof(int)) == -1) error("setsockopt", "", ""); } # endif #endif #ifdef SYS_VXWORKS if (connect(sockfd, (struct sockaddr *)&hostaddr, sizeof(hostaddr)) == -1) #else if (connect(sockfd, (struct sockaddr *)ai->ai_addr, ai->ai_addrlen) == -1) #endif /* SYS_VXWORKS */ error("connect", "", ""); if (a_info == 0) freeaddrinfo(ai); havehost = 1; return 1; } /* XXX ELIMINATE sendpkt similar in ntpq.c, ntpdc.c, ntp_io.c, ntptrace.c */ /* * sendpkt - send a packet to the remote host */ static int sendpkt( void * xdata, size_t xdatalen ) { if (debug >= 3) printf("Sending %lu octets\n", (u_long)xdatalen); if (send(sockfd, xdata, (size_t)xdatalen, 0) == -1) { warning("write to %s failed", currenthost, ""); return -1; } if (debug >= 4) { int first = 8; char *cdata = xdata; printf("Packet data:\n"); while (xdatalen-- > 0) { if (first-- == 0) { printf("\n"); first = 7; } printf(" %02x", *cdata++ & 0xff); } printf("\n"); } return 0; } /* * getresponse - get a (series of) response packet(s) and return the data */ static int getresponse( int opcode, int associd, u_short *rstatus, int *rsize, const char **rdata, int timeo ) { struct ntp_control rpkt; struct sock_timeval tvo; u_short offsets[MAXFRAGS+1]; u_short counts[MAXFRAGS+1]; u_short offset; u_short count; size_t numfrags; size_t f; size_t ff; int seenlastfrag; int shouldbesize; fd_set fds; int n; int len; int first; char *data; /* * This is pretty tricky. We may get between 1 and MAXFRAG packets * back in response to the request. We peel the data out of * each packet and collect it in one long block. When the last * packet in the sequence is received we'll know how much data we * should have had. Note we use one long time out, should reconsider. */ *rsize = 0; if (rstatus) *rstatus = 0; *rdata = (char *)pktdata; numfrags = 0; seenlastfrag = 0; FD_ZERO(&fds); /* * Loop until we have an error or a complete response. Nearly all * code paths to loop again use continue. */ for (;;) { if (numfrags == 0) tvo = tvout; else tvo = tvsout; FD_SET(sockfd, &fds); n = select(sockfd + 1, &fds, NULL, NULL, &tvo); if (n == -1) { warning("select fails", "", ""); return -1; } if (n == 0) { /* * Timed out. Return what we have */ if (numfrags == 0) { if (timeo) fprintf(stderr, "%s: timed out, nothing received\n", currenthost); return ERR_TIMEOUT; } if (timeo) fprintf(stderr, "%s: timed out with incomplete data\n", currenthost); if (debug) { fprintf(stderr, "ERR_INCOMPLETE: Received fragments:\n"); for (f = 0; f < numfrags; f++) fprintf(stderr, "%2u: %5d %5d\t%3d octets\n", f, offsets[f], offsets[f] + counts[f], counts[f]); fprintf(stderr, "last fragment %sreceived\n", (seenlastfrag) ? "" : "not "); } return ERR_INCOMPLETE; } n = recv(sockfd, (char *)&rpkt, sizeof(rpkt), 0); if (n == -1) { warning("read", "", ""); return -1; } if (debug >= 4) { len = n; first = 8; data = (char *)&rpkt; printf("Packet data:\n"); while (len-- > 0) { if (first-- == 0) { printf("\n"); first = 7; } printf(" %02x", *data++ & 0xff); } printf("\n"); } /* * Check for format errors. Bug proofing. */ if (n < CTL_HEADER_LEN) { if (debug) printf("Short (%d byte) packet received\n", n); continue; } if (PKT_VERSION(rpkt.li_vn_mode) > NTP_VERSION || PKT_VERSION(rpkt.li_vn_mode) < NTP_OLDVERSION) { if (debug) printf("Packet received with version %d\n", PKT_VERSION(rpkt.li_vn_mode)); continue; } if (PKT_MODE(rpkt.li_vn_mode) != MODE_CONTROL) { if (debug) printf("Packet received with mode %d\n", PKT_MODE(rpkt.li_vn_mode)); continue; } if (!CTL_ISRESPONSE(rpkt.r_m_e_op)) { if (debug) printf("Received request packet, wanted response\n"); continue; } /* * Check opcode and sequence number for a match. * Could be old data getting to us. */ if (ntohs(rpkt.sequence) != sequence) { if (debug) printf("Received sequnce number %d, wanted %d\n", ntohs(rpkt.sequence), sequence); continue; } if (CTL_OP(rpkt.r_m_e_op) != opcode) { if (debug) printf( "Received opcode %d, wanted %d (sequence number okay)\n", CTL_OP(rpkt.r_m_e_op), opcode); continue; } /* * Check the error code. If non-zero, return it. */ if (CTL_ISERROR(rpkt.r_m_e_op)) { int errcode; errcode = (ntohs(rpkt.status) >> 8) & 0xff; if (debug && CTL_ISMORE(rpkt.r_m_e_op)) { printf("Error code %d received on not-final packet\n", errcode); } if (errcode == CERR_UNSPEC) return ERR_UNSPEC; return errcode; } /* * Check the association ID to make sure it matches what * we sent. */ if (ntohs(rpkt.associd) != associd) { if (debug) printf("Association ID %d doesn't match expected %d\n", ntohs(rpkt.associd), associd); /* * Hack for silly fuzzballs which, at the time of writing, * return an assID of sys.peer when queried for system variables. */ #ifdef notdef continue; #endif } /* * Collect offset and count. Make sure they make sense. */ offset = ntohs(rpkt.offset); count = ntohs(rpkt.count); /* * validate received payload size is padded to next 32-bit * boundary and no smaller than claimed by rpkt.count */ if (n & 0x3) { if (debug) printf("Response packet not padded, " "size = %d\n", n); continue; } shouldbesize = (CTL_HEADER_LEN + count + 3) & ~3; if (n < shouldbesize) { printf("Response packet claims %u octets " "payload, above %d received\n", count, n - CTL_HEADER_LEN ); return ERR_INCOMPLETE; } if (debug >= 3 && shouldbesize > n) { u_int32 key; u_int32 *lpkt; int maclen; /* * Usually we ignore authentication, but for debugging purposes * we watch it here. */ /* round to 8 octet boundary */ shouldbesize = (shouldbesize + 7) & ~7; maclen = n - shouldbesize; if (maclen >= MIN_MAC_LEN) { printf( "Packet shows signs of authentication (total %d, data %d, mac %d)\n", n, shouldbesize, maclen); lpkt = (u_int32 *)&rpkt; printf("%08lx %08lx %08lx %08lx %08lx %08lx\n", (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) - 3]), (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) - 2]), (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) - 1]), (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32)]), (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) + 1]), (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) + 2])); key = ntohl(lpkt[(n - maclen) / sizeof(u_int32)]); printf("Authenticated with keyid %lu\n", (u_long)key); if (key != 0 && key != info_auth_keyid) { printf("We don't know that key\n"); } else { if (authdecrypt(key, (u_int32 *)&rpkt, n - maclen, maclen)) { printf("Auth okay!\n"); } else { printf("Auth failed!\n"); } } } } if (debug >= 2) printf("Got packet, size = %d\n", n); if ((int)count > (n - CTL_HEADER_LEN)) { if (debug) printf("Received count of %d octets, " "data in packet is %d\n", count, n-CTL_HEADER_LEN); continue; } if (count == 0 && CTL_ISMORE(rpkt.r_m_e_op)) { if (debug) printf("Received count of 0 in non-final fragment\n"); continue; } if (offset + count > sizeof(pktdata)) { if (debug) printf("Offset %d, count %d, too big for buffer\n", offset, count); return ERR_TOOMUCH; } if (seenlastfrag && !CTL_ISMORE(rpkt.r_m_e_op)) { if (debug) printf("Received second last fragment packet\n"); continue; } /* * So far, so good. Record this fragment, making sure it doesn't * overlap anything. */ if (debug >= 2) printf("Packet okay\n");; if (numfrags > (MAXFRAGS - 1)) { if (debug) printf("Number of fragments exceeds maximum %d\n", MAXFRAGS - 1); return ERR_TOOMUCH; } /* * Find the position for the fragment relative to any * previously received. */ for (f = 0; f < numfrags && offsets[f] < offset; f++) { /* empty body */ ; } if (f < numfrags && offset == offsets[f]) { if (debug) printf("duplicate %u octets at %u ignored, prior %u at %u\n", count, offset, counts[f], offsets[f]); continue; } if (f > 0 && (offsets[f-1] + counts[f-1]) > offset) { if (debug) printf("received frag at %u overlaps with %u octet frag at %u\n", offset, counts[f-1], offsets[f-1]); continue; } if (f < numfrags && (offset + count) > offsets[f]) { if (debug) printf("received %u octet frag at %u overlaps with frag at %u\n", count, offset, offsets[f]); continue; } for (ff = numfrags; ff > f; ff--) { offsets[ff] = offsets[ff-1]; counts[ff] = counts[ff-1]; } offsets[f] = offset; counts[f] = count; numfrags++; /* * Got that stuffed in right. Figure out if this was the last. * Record status info out of the last packet. */ if (!CTL_ISMORE(rpkt.r_m_e_op)) { seenlastfrag = 1; if (rstatus != 0) *rstatus = ntohs(rpkt.status); } /* * Copy the data into the data buffer. */ memcpy((char *)pktdata + offset, rpkt.data, count); /* * If we've seen the last fragment, look for holes in the sequence. * If there aren't any, we're done. */ if (seenlastfrag && offsets[0] == 0) { for (f = 1; f < numfrags; f++) if (offsets[f-1] + counts[f-1] != offsets[f]) break; if (f == numfrags) { *rsize = offsets[f-1] + counts[f-1]; if (debug) fprintf(stderr, "%u packets reassembled into response\n", numfrags); return 0; } } } /* giant for (;;) collecting response packets */ } /* getresponse() */ /* * sendrequest - format and send a request packet */ static int sendrequest( int opcode, int associd, int auth, int qsize, char *qdata ) { struct ntp_control qpkt; int pktsize; u_long key_id; char * pass; int maclen; /* * Check to make sure the data will fit in one packet */ if (qsize > CTL_MAX_DATA_LEN) { fprintf(stderr, "***Internal error! qsize (%d) too large\n", qsize); return 1; } /* * Fill in the packet */ qpkt.li_vn_mode = PKT_LI_VN_MODE(0, pktversion, MODE_CONTROL); qpkt.r_m_e_op = (u_char)(opcode & CTL_OP_MASK); qpkt.sequence = htons(sequence); qpkt.status = 0; qpkt.associd = htons((u_short)associd); qpkt.offset = 0; qpkt.count = htons((u_short)qsize); pktsize = CTL_HEADER_LEN; /* * If we have data, copy and pad it out to a 32-bit boundary. */ if (qsize > 0) { memcpy(qpkt.data, qdata, (size_t)qsize); pktsize += qsize; while (pktsize & (sizeof(u_int32) - 1)) { qpkt.data[qsize++] = 0; pktsize++; } } /* * If it isn't authenticated we can just send it. Otherwise * we're going to have to think about it a little. */ if (!auth && !always_auth) { return sendpkt(&qpkt, pktsize); } /* * Pad out packet to a multiple of 8 octets to be sure * receiver can handle it. */ while (pktsize & 7) { qpkt.data[qsize++] = 0; pktsize++; } /* * Get the keyid and the password if we don't have one. */ if (info_auth_keyid == 0) { key_id = getkeyid("Keyid: "); if (key_id == 0 || key_id > NTP_MAXKEY) { fprintf(stderr, "Invalid key identifier\n"); return 1; } info_auth_keyid = key_id; } if (!authistrusted(info_auth_keyid)) { pass = getpass_keytype(info_auth_keytype); if ('\0' == pass[0]) { fprintf(stderr, "Invalid password\n"); return 1; } authusekey(info_auth_keyid, info_auth_keytype, (u_char *)pass); authtrust(info_auth_keyid, 1); } /* * Do the encryption. */ maclen = authencrypt(info_auth_keyid, (void *)&qpkt, pktsize); if (!maclen) { fprintf(stderr, "Key not found\n"); return 1; } else if ((size_t)maclen != (info_auth_hashlen + sizeof(keyid_t))) { fprintf(stderr, "%d octet MAC, %lu expected with %lu octet digest\n", maclen, (u_long)(info_auth_hashlen + sizeof(keyid_t)), (u_long)info_auth_hashlen); return 1; } return sendpkt((char *)&qpkt, pktsize + maclen); } /* * show_error_msg - display the error text for a mode 6 error response. */ void show_error_msg( int m6resp, associd_t associd ) { if (numhosts > 1) fprintf(stderr, "server=%s ", currenthost); switch(m6resp) { case CERR_BADFMT: fprintf(stderr, "***Server reports a bad format request packet\n"); break; case CERR_PERMISSION: fprintf(stderr, "***Server disallowed request (authentication?)\n"); break; case CERR_BADOP: fprintf(stderr, "***Server reports a bad opcode in request\n"); break; case CERR_BADASSOC: fprintf(stderr, "***Association ID %d unknown to server\n", associd); break; case CERR_UNKNOWNVAR: fprintf(stderr, "***A request variable unknown to the server\n"); break; case CERR_BADVALUE: fprintf(stderr, "***Server indicates a request variable was bad\n"); break; case ERR_UNSPEC: fprintf(stderr, "***Server returned an unspecified error\n"); break; case ERR_TIMEOUT: fprintf(stderr, "***Request timed out\n"); break; case ERR_INCOMPLETE: fprintf(stderr, "***Response from server was incomplete\n"); break; case ERR_TOOMUCH: fprintf(stderr, "***Buffer size exceeded for returned data\n"); break; default: fprintf(stderr, "***Server returns unknown error code %d\n", m6resp); } } /* * doquery - send a request and process the response, displaying * error messages for any error responses. */ int doquery( int opcode, associd_t associd, int auth, int qsize, char *qdata, u_short *rstatus, int *rsize, const char **rdata ) { return doqueryex(opcode, associd, auth, qsize, qdata, rstatus, rsize, rdata, FALSE); } /* * doqueryex - send a request and process the response, optionally * displaying error messages for any error responses. */ int doqueryex( int opcode, associd_t associd, int auth, int qsize, char *qdata, u_short *rstatus, int *rsize, const char **rdata, int quiet ) { int res; int done; /* * Check to make sure host is open */ if (!havehost) { fprintf(stderr, "***No host open, use `host' command\n"); return -1; } done = 0; sequence++; again: /* * send a request */ res = sendrequest(opcode, associd, auth, qsize, qdata); if (res != 0) return res; /* * Get the response. If we got a standard error, print a message */ res = getresponse(opcode, associd, rstatus, rsize, rdata, done); if (res > 0) { if (!done && (res == ERR_TIMEOUT || res == ERR_INCOMPLETE)) { if (res == ERR_INCOMPLETE) { /* * better bump the sequence so we don't * get confused about differing fragments. */ sequence++; } done = 1; goto again; } if (!quiet) show_error_msg(res, associd); } return res; } #ifndef BUILD_AS_LIB /* * getcmds - read commands from the standard input and execute them */ static void getcmds(void) { char * line; int count; ntp_readline_init(interactive ? prompt : NULL); for (;;) { line = ntp_readline(&count); if (NULL == line) break; docmd(line); free(line); } ntp_readline_uninit(); } #endif /* !BUILD_AS_LIB */ #if !defined(SYS_WINNT) && !defined(BUILD_AS_LIB) /* * abortcmd - catch interrupts and abort the current command */ static RETSIGTYPE abortcmd( int sig ) { if (current_output == stdout) (void) fflush(stdout); putc('\n', stderr); (void) fflush(stderr); if (jump) longjmp(interrupt_buf, 1); } #endif /* !SYS_WINNT && !BUILD_AS_LIB */ #ifndef BUILD_AS_LIB /* * docmd - decode the command line and execute a command */ static void docmd( const char *cmdline ) { char *tokens[1+MAXARGS+2]; struct parse pcmd; int ntok; static int i; struct xcmd *xcmd; /* * Tokenize the command line. If nothing on it, return. */ tokenize(cmdline, tokens, &ntok); if (ntok == 0) return; /* * Find the appropriate command description. */ i = findcmd(tokens[0], builtins, opcmds, &xcmd); if (i == 0) { (void) fprintf(stderr, "***Command `%s' unknown\n", tokens[0]); return; } else if (i >= 2) { (void) fprintf(stderr, "***Command `%s' ambiguous\n", tokens[0]); return; } /* * Save the keyword, then walk through the arguments, interpreting * as we go. */ pcmd.keyword = tokens[0]; pcmd.nargs = 0; for (i = 0; i < MAXARGS && xcmd->arg[i] != NO; i++) { if ((i+1) >= ntok) { if (!(xcmd->arg[i] & OPT)) { printusage(xcmd, stderr); return; } break; } if ((xcmd->arg[i] & OPT) && (*tokens[i+1] == '>')) break; if (!getarg(tokens[i+1], (int)xcmd->arg[i], &pcmd.argval[i])) return; pcmd.nargs++; } i++; if (i < ntok && *tokens[i] == '>') { char *fname; if (*(tokens[i]+1) != '\0') fname = tokens[i]+1; else if ((i+1) < ntok) fname = tokens[i+1]; else { (void) fprintf(stderr, "***No file for redirect\n"); return; } current_output = fopen(fname, "w"); if (current_output == NULL) { (void) fprintf(stderr, "***Error opening %s: ", fname); perror(""); return; } i = 1; /* flag we need a close */ } else { current_output = stdout; i = 0; /* flag no close */ } if (interactive && setjmp(interrupt_buf)) { jump = 0; return; } else { jump++; (xcmd->handler)(&pcmd, current_output); jump = 0; /* HMS: 961106: was after fclose() */ if (i) (void) fclose(current_output); } } /* * tokenize - turn a command line into tokens * * SK: Modified to allow a quoted string * * HMS: If the first character of the first token is a ':' then (after * eating inter-token whitespace) the 2nd token is the rest of the line. */ static void tokenize( const char *line, char **tokens, int *ntok ) { register const char *cp; register char *sp; static char tspace[MAXLINE]; sp = tspace; cp = line; for (*ntok = 0; *ntok < MAXTOKENS; (*ntok)++) { tokens[*ntok] = sp; /* Skip inter-token whitespace */ while (ISSPACE(*cp)) cp++; /* If we're at EOL we're done */ if (ISEOL(*cp)) break; /* If this is the 2nd token and the first token begins * with a ':', then just grab to EOL. */ if (*ntok == 1 && tokens[0][0] == ':') { do { *sp++ = *cp++; } while (!ISEOL(*cp)); } /* Check if this token begins with a double quote. * If yes, continue reading till the next double quote */ else if (*cp == '\"') { ++cp; do { *sp++ = *cp++; } while ((*cp != '\"') && !ISEOL(*cp)); /* HMS: a missing closing " should be an error */ } else { do { *sp++ = *cp++; } while ((*cp != '\"') && !ISSPACE(*cp) && !ISEOL(*cp)); /* HMS: Why check for a " in the previous line? */ } *sp++ = '\0'; } } /* * getarg - interpret an argument token */ static int getarg( char *str, int code, arg_v *argp ) { int isneg; char *cp, *np; static const char *digits = "0123456789"; switch (code & ~OPT) { case NTP_STR: argp->string = str; break; case NTP_ADD: if (!getnetnum(str, &(argp->netnum), (char *)0, 0)) { return 0; } break; case NTP_INT: case NTP_UINT: isneg = 0; np = str; if (*np == '&') { np++; isneg = atoi(np); if (isneg <= 0) { (void) fprintf(stderr, "***Association value `%s' invalid/undecodable\n", str); return 0; } if (isneg > numassoc) { if (numassoc == 0) { (void) fprintf(stderr, "***Association for `%s' unknown (max &%d)\n", str, numassoc); return 0; } else { isneg = numassoc; } } argp->uval = assoc_cache[isneg-1].assid; break; } if (*np == '-') { np++; isneg = 1; } argp->uval = 0; do { cp = strchr(digits, *np); if (cp == NULL) { (void) fprintf(stderr, "***Illegal integer value %s\n", str); return 0; } argp->uval *= 10; argp->uval += (cp - digits); } while (*(++np) != '\0'); if (isneg) { if ((code & ~OPT) == NTP_UINT) { (void) fprintf(stderr, "***Value %s should be unsigned\n", str); return 0; } argp->ival = -argp->ival; } break; case IP_VERSION: if (!strcmp("-6", str)) argp->ival = 6 ; else if (!strcmp("-4", str)) argp->ival = 4 ; else { (void) fprintf(stderr, "***Version must be either 4 or 6\n"); return 0; } break; } return 1; } #endif /* !BUILD_AS_LIB */ /* * findcmd - find a command in a command description table */ static int findcmd( register char *str, struct xcmd *clist1, struct xcmd *clist2, struct xcmd **cmd ) { register struct xcmd *cl; register int clen; int nmatch; struct xcmd *nearmatch = NULL; struct xcmd *clist; clen = strlen(str); nmatch = 0; if (clist1 != 0) clist = clist1; else if (clist2 != 0) clist = clist2; else return 0; again: for (cl = clist; cl->keyword != 0; cl++) { /* do a first character check, for efficiency */ if (*str != *(cl->keyword)) continue; if (strncmp(str, cl->keyword, (unsigned)clen) == 0) { /* * Could be extact match, could be approximate. * Is exact if the length of the keyword is the * same as the str. */ if (*((cl->keyword) + clen) == '\0') { *cmd = cl; return 1; } nmatch++; nearmatch = cl; } } /* * See if there is more to do. If so, go again. Sorry about the * goto, too much looking at BSD sources... */ if (clist == clist1 && clist2 != 0) { clist = clist2; goto again; } /* * If we got extactly 1 near match, use it, else return number * of matches. */ if (nmatch == 1) { *cmd = nearmatch; return 1; } return nmatch; } /* * getnetnum - given a host name, return its net number * and (optional) full name */ int getnetnum( const char *hname, sockaddr_u *num, char *fullhost, int af ) { struct addrinfo hints, *ai = NULL; ZERO(hints); hints.ai_flags = AI_CANONNAME; #ifdef AI_ADDRCONFIG hints.ai_flags |= AI_ADDRCONFIG; #endif /* * decodenetnum only works with addresses, but handles syntax * that getaddrinfo doesn't: [2001::1]:1234 */ if (decodenetnum(hname, num)) { if (fullhost != NULL) getnameinfo(&num->sa, SOCKLEN(num), fullhost, LENHOSTNAME, NULL, 0, 0); return 1; } else if (getaddrinfo(hname, "ntp", &hints, &ai) == 0) { NTP_INSIST(sizeof(*num) >= ai->ai_addrlen); memcpy(num, ai->ai_addr, ai->ai_addrlen); if (fullhost != NULL) { if (ai->ai_canonname != NULL) { strncpy(fullhost, ai->ai_canonname, LENHOSTNAME); fullhost[LENHOSTNAME - 1] = '\0'; } else { getnameinfo(&num->sa, SOCKLEN(num), fullhost, LENHOSTNAME, NULL, 0, 0); } } return 1; } fprintf(stderr, "***Can't find host %s\n", hname); return 0; } /* * nntohost - convert network number to host name. This routine enforces * the showhostnames setting. */ char * nntohost( sockaddr_u *netnum ) { return nntohost_col(netnum, LIB_BUFLENGTH - 1, FALSE); } /* * nntohost_col - convert network number to host name in fixed width. * This routine enforces the showhostnames setting. * When displaying hostnames longer than the width, * the first part of the hostname is displayed. When * displaying numeric addresses longer than the width, * Such as IPv6 addresses, the caller decides whether * the first or last of the numeric address is used. */ char * nntohost_col( sockaddr_u * addr, size_t width, int preserve_lowaddrbits ) { const char * out; if (!showhostnames) { if (preserve_lowaddrbits) out = trunc_left(stoa(addr), width); else out = trunc_right(stoa(addr), width); } else if (ISREFCLOCKADR(addr)) { out = refnumtoa(addr); } else { out = trunc_right(socktohost(addr), width); } return out; } /* * rtdatetolfp - decode an RT-11 date into an l_fp */ static int rtdatetolfp( char *str, l_fp *lfp ) { register char *cp; register int i; struct calendar cal; char buf[4]; static const char *months[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; cal.yearday = 0; /* * An RT-11 date looks like: * * d[d]-Mth-y[y] hh:mm:ss * * (No docs, but assume 4-digit years are also legal...) * * d[d]-Mth-y[y[y[y]]] hh:mm:ss */ cp = str; if (!isdigit((int)*cp)) { if (*cp == '-') { /* * Catch special case */ L_CLR(lfp); return 1; } return 0; } cal.monthday = (u_char) (*cp++ - '0'); /* ascii dependent */ if (isdigit((int)*cp)) { cal.monthday = (u_char)((cal.monthday << 3) + (cal.monthday << 1)); cal.monthday = (u_char)(cal.monthday + *cp++ - '0'); } if (*cp++ != '-') return 0; for (i = 0; i < 3; i++) buf[i] = *cp++; buf[3] = '\0'; for (i = 0; i < 12; i++) if (STREQ(buf, months[i])) break; if (i == 12) return 0; cal.month = (u_char)(i + 1); if (*cp++ != '-') return 0; if (!isdigit((int)*cp)) return 0; cal.year = (u_short)(*cp++ - '0'); if (isdigit((int)*cp)) { cal.year = (u_short)((cal.year << 3) + (cal.year << 1)); cal.year = (u_short)(*cp++ - '0'); } if (isdigit((int)*cp)) { cal.year = (u_short)((cal.year << 3) + (cal.year << 1)); cal.year = (u_short)(cal.year + *cp++ - '0'); } if (isdigit((int)*cp)) { cal.year = (u_short)((cal.year << 3) + (cal.year << 1)); cal.year = (u_short)(cal.year + *cp++ - '0'); } /* * Catch special case. If cal.year == 0 this is a zero timestamp. */ if (cal.year == 0) { L_CLR(lfp); return 1; } if (*cp++ != ' ' || !isdigit((int)*cp)) return 0; cal.hour = (u_char)(*cp++ - '0'); if (isdigit((int)*cp)) { cal.hour = (u_char)((cal.hour << 3) + (cal.hour << 1)); cal.hour = (u_char)(cal.hour + *cp++ - '0'); } if (*cp++ != ':' || !isdigit((int)*cp)) return 0; cal.minute = (u_char)(*cp++ - '0'); if (isdigit((int)*cp)) { cal.minute = (u_char)((cal.minute << 3) + (cal.minute << 1)); cal.minute = (u_char)(cal.minute + *cp++ - '0'); } if (*cp++ != ':' || !isdigit((int)*cp)) return 0; cal.second = (u_char)(*cp++ - '0'); if (isdigit((int)*cp)) { cal.second = (u_char)((cal.second << 3) + (cal.second << 1)); cal.second = (u_char)(cal.second + *cp++ - '0'); } /* * For RT-11, 1972 seems to be the pivot year */ if (cal.year < 72) cal.year += 2000; if (cal.year < 100) cal.year += 1900; lfp->l_ui = caltontp(&cal); lfp->l_uf = 0; return 1; } /* * decodets - decode a timestamp into an l_fp format number, with * consideration of fuzzball formats. */ int decodets( char *str, l_fp *lfp ) { char *cp; char buf[30]; size_t b; /* * If it starts with a 0x, decode as hex. */ if (*str == '0' && (*(str+1) == 'x' || *(str+1) == 'X')) return hextolfp(str+2, lfp); /* * If it starts with a '"', try it as an RT-11 date. */ if (*str == '"') { cp = str + 1; b = 0; while ('"' != *cp && '\0' != *cp && b < COUNTOF(buf) - 1) buf[b++] = *cp++; buf[b] = '\0'; return rtdatetolfp(buf, lfp); } /* * Might still be hex. Check out the first character. Talk * about heuristics! */ if ((*str >= 'A' && *str <= 'F') || (*str >= 'a' && *str <= 'f')) return hextolfp(str, lfp); /* * Try it as a decimal. If this fails, try as an unquoted * RT-11 date. This code should go away eventually. */ if (atolfp(str, lfp)) return 1; return rtdatetolfp(str, lfp); } /* * decodetime - decode a time value. It should be in milliseconds */ int decodetime( char *str, l_fp *lfp ) { return mstolfp(str, lfp); } /* * decodeint - decode an integer */ int decodeint( char *str, long *val ) { if (*str == '0') { if (*(str+1) == 'x' || *(str+1) == 'X') return hextoint(str+2, (u_long *)val); return octtoint(str, (u_long *)val); } return atoint(str, val); } /* * decodeuint - decode an unsigned integer */ int decodeuint( char *str, u_long *val ) { if (*str == '0') { if (*(str + 1) == 'x' || *(str + 1) == 'X') return (hextoint(str + 2, val)); return (octtoint(str, val)); } return (atouint(str, val)); } /* * decodearr - decode an array of time values */ static int decodearr( char *str, int *narr, l_fp *lfparr ) { register char *cp, *bp; register l_fp *lfp; char buf[60]; lfp = lfparr; cp = str; *narr = 0; while (*narr < 8) { while (isspace((int)*cp)) cp++; if (*cp == '\0') break; bp = buf; while (!isspace((int)*cp) && *cp != '\0') *bp++ = *cp++; *bp++ = '\0'; if (!decodetime(buf, lfp)) return 0; (*narr)++; lfp++; } return 1; } /* * Finally, the built in command handlers */ /* * help - tell about commands, or details of a particular command */ static void help( struct parse *pcmd, FILE *fp ) { struct xcmd *xcp = NULL; /* quiet warning */ char *cmd; const char *list[100]; size_t word, words; size_t row, rows; size_t col, cols; size_t length; if (pcmd->nargs == 0) { words = 0; for (xcp = builtins; xcp->keyword != NULL; xcp++) { if (*(xcp->keyword) != '?') list[words++] = xcp->keyword; } for (xcp = opcmds; xcp->keyword != NULL; xcp++) list[words++] = xcp->keyword; qsort((void *)list, (size_t)words, sizeof(list[0]), helpsort); col = 0; for (word = 0; word < words; word++) { length = strlen(list[word]); col = max(col, length); } cols = SCREENWIDTH / ++col; rows = (words + cols - 1) / cols; fprintf(fp, "ntpq commands:\n"); for (row = 0; row < rows; row++) { for (word = row; word < words; word += rows) fprintf(fp, "%-*.*s", col, col-1, list[word]); fprintf(fp, "\n"); } } else { cmd = pcmd->argval[0].string; words = findcmd(cmd, builtins, opcmds, &xcp); if (words == 0) { fprintf(stderr, "Command `%s' is unknown\n", cmd); return; } else if (words >= 2) { fprintf(stderr, "Command `%s' is ambiguous\n", cmd); return; } fprintf(fp, "function: %s\n", xcp->comment); printusage(xcp, fp); } } /* * helpsort - do hostname qsort comparisons */ static int helpsort( const void *t1, const void *t2 ) { const char * const * name1 = t1; const char * const * name2 = t2; return strcmp(*name1, *name2); } /* * printusage - print usage information for a command */ static void printusage( struct xcmd *xcp, FILE *fp ) { register int i; (void) fprintf(fp, "usage: %s", xcp->keyword); for (i = 0; i < MAXARGS && xcp->arg[i] != NO; i++) { if (xcp->arg[i] & OPT) (void) fprintf(fp, " [ %s ]", xcp->desc[i]); else (void) fprintf(fp, " %s", xcp->desc[i]); } (void) fprintf(fp, "\n"); } /* * timeout - set time out time */ static void timeout( struct parse *pcmd, FILE *fp ) { int val; if (pcmd->nargs == 0) { val = (int)tvout.tv_sec * 1000 + tvout.tv_usec / 1000; (void) fprintf(fp, "primary timeout %d ms\n", val); } else { tvout.tv_sec = pcmd->argval[0].uval / 1000; tvout.tv_usec = (pcmd->argval[0].uval - ((long)tvout.tv_sec * 1000)) * 1000; } } /* * auth_delay - set delay for auth requests */ static void auth_delay( struct parse *pcmd, FILE *fp ) { int isneg; u_long val; if (pcmd->nargs == 0) { val = delay_time.l_ui * 1000 + delay_time.l_uf / 4294967; (void) fprintf(fp, "delay %lu ms\n", val); } else { if (pcmd->argval[0].ival < 0) { isneg = 1; val = (u_long)(-pcmd->argval[0].ival); } else { isneg = 0; val = (u_long)pcmd->argval[0].ival; } delay_time.l_ui = val / 1000; val %= 1000; delay_time.l_uf = val * 4294967; /* 2**32/1000 */ if (isneg) L_NEG(&delay_time); } } /* * host - set the host we are dealing with. */ static void host( struct parse *pcmd, FILE *fp ) { int i; if (pcmd->nargs == 0) { if (havehost) (void) fprintf(fp, "current host is %s\n", currenthost); else (void) fprintf(fp, "no current host\n"); return; } i = 0; ai_fam_templ = ai_fam_default; if (pcmd->nargs == 2) { if (!strcmp("-4", pcmd->argval[i].string)) ai_fam_templ = AF_INET; else if (!strcmp("-6", pcmd->argval[i].string)) ai_fam_templ = AF_INET6; else { if (havehost) (void) fprintf(fp, "current host remains %s\n", currenthost); else (void) fprintf(fp, "still no current host\n"); return; } i = 1; } if (openhost(pcmd->argval[i].string)) { (void) fprintf(fp, "current host set to %s\n", currenthost); numassoc = 0; } else { if (havehost) (void) fprintf(fp, "current host remains %s\n", currenthost); else (void) fprintf(fp, "still no current host\n"); } } /* * poll - do one (or more) polls of the host via NTP */ /*ARGSUSED*/ static void ntp_poll( struct parse *pcmd, FILE *fp ) { (void) fprintf(fp, "poll not implemented yet\n"); } /* * keyid - get a keyid to use for authenticating requests */ static void keyid( struct parse *pcmd, FILE *fp ) { if (pcmd->nargs == 0) { if (info_auth_keyid == 0) (void) fprintf(fp, "no keyid defined\n"); else (void) fprintf(fp, "keyid is %lu\n", (u_long)info_auth_keyid); } else { /* allow zero so that keyid can be cleared. */ if(pcmd->argval[0].uval > NTP_MAXKEY) (void) fprintf(fp, "Invalid key identifier\n"); info_auth_keyid = pcmd->argval[0].uval; } } /* * keytype - get type of key to use for authenticating requests */ static void keytype( struct parse *pcmd, FILE *fp ) { const char * digest_name; size_t digest_len; int key_type; if (!pcmd->nargs) { fprintf(fp, "keytype is %s with %lu octet digests\n", keytype_name(info_auth_keytype), (u_long)info_auth_hashlen); return; } digest_name = pcmd->argval[0].string; digest_len = 0; key_type = keytype_from_text(digest_name, &digest_len); if (!key_type) { fprintf(fp, "keytype must be 'md5'%s\n", #ifdef OPENSSL " or a digest type provided by OpenSSL"); #else ""); #endif return; } info_auth_keytype = key_type; info_auth_hashlen = digest_len; } /* * passwd - get an authentication key */ /*ARGSUSED*/ static void passwd( struct parse *pcmd, FILE *fp ) { char *pass; if (info_auth_keyid == 0) { int u_keyid = getkeyid("Keyid: "); if (u_keyid == 0 || u_keyid > NTP_MAXKEY) { (void)fprintf(fp, "Invalid key identifier\n"); return; } info_auth_keyid = u_keyid; } if (pcmd->nargs >= 1) pass = pcmd->argval[0].string; else { pass = getpass_keytype(info_auth_keytype); if ('\0' == pass[0]) { fprintf(fp, "Password unchanged\n"); return; } } authusekey(info_auth_keyid, info_auth_keytype, (u_char *)pass); authtrust(info_auth_keyid, 1); } /* * hostnames - set the showhostnames flag */ static void hostnames( struct parse *pcmd, FILE *fp ) { if (pcmd->nargs == 0) { if (showhostnames) (void) fprintf(fp, "hostnames being shown\n"); else (void) fprintf(fp, "hostnames not being shown\n"); } else { if (STREQ(pcmd->argval[0].string, "yes")) showhostnames = 1; else if (STREQ(pcmd->argval[0].string, "no")) showhostnames = 0; else (void)fprintf(stderr, "What?\n"); } } /* * setdebug - set/change debugging level */ static void setdebug( struct parse *pcmd, FILE *fp ) { if (pcmd->nargs == 0) { (void) fprintf(fp, "debug level is %d\n", debug); return; } else if (STREQ(pcmd->argval[0].string, "no")) { debug = 0; } else if (STREQ(pcmd->argval[0].string, "more")) { debug++; } else if (STREQ(pcmd->argval[0].string, "less")) { debug--; } else { (void) fprintf(fp, "What?\n"); return; } (void) fprintf(fp, "debug level set to %d\n", debug); } /* * quit - stop this nonsense */ /*ARGSUSED*/ static void quit( struct parse *pcmd, FILE *fp ) { if (havehost) closesocket(sockfd); /* cleanliness next to godliness */ exit(0); } /* * version - print the current version number */ /*ARGSUSED*/ static void version( struct parse *pcmd, FILE *fp ) { (void) fprintf(fp, "%s\n", Version); return; } /* * raw - set raw mode output */ /*ARGSUSED*/ static void raw( struct parse *pcmd, FILE *fp ) { rawmode = 1; (void) fprintf(fp, "Output set to raw\n"); } /* * cooked - set cooked mode output */ /*ARGSUSED*/ static void cooked( struct parse *pcmd, FILE *fp ) { rawmode = 0; (void) fprintf(fp, "Output set to cooked\n"); return; } /* * authenticate - always authenticate requests to this host */ static void authenticate( struct parse *pcmd, FILE *fp ) { if (pcmd->nargs == 0) { if (always_auth) { (void) fprintf(fp, "authenticated requests being sent\n"); } else (void) fprintf(fp, "unauthenticated requests being sent\n"); } else { if (STREQ(pcmd->argval[0].string, "yes")) { always_auth = 1; } else if (STREQ(pcmd->argval[0].string, "no")) { always_auth = 0; } else (void)fprintf(stderr, "What?\n"); } } /* * ntpversion - choose the NTP version to use */ static void ntpversion( struct parse *pcmd, FILE *fp ) { if (pcmd->nargs == 0) { (void) fprintf(fp, "NTP version being claimed is %d\n", pktversion); } else { if (pcmd->argval[0].uval < NTP_OLDVERSION || pcmd->argval[0].uval > NTP_VERSION) { (void) fprintf(stderr, "versions %d to %d, please\n", NTP_OLDVERSION, NTP_VERSION); } else { pktversion = (u_char) pcmd->argval[0].uval; } } } /* * warning - print a warning message */ static void warning( const char *fmt, const char *st1, const char *st2 ) { (void) fprintf(stderr, "%s: ", progname); (void) fprintf(stderr, fmt, st1, st2); (void) fprintf(stderr, ": "); perror(""); } /* * error - print a message and exit */ static void error( const char *fmt, const char *st1, const char *st2 ) { warning(fmt, st1, st2); exit(1); } /* * getkeyid - prompt the user for a keyid to use */ static u_long getkeyid( const char *keyprompt ) { int c; FILE *fi; char pbuf[20]; size_t i; size_t ilim; #ifndef SYS_WINNT if ((fi = fdopen(open("/dev/tty", 2), "r")) == NULL) #else if ((fi = _fdopen(open("CONIN$", _O_TEXT), "r")) == NULL) #endif /* SYS_WINNT */ fi = stdin; else setbuf(fi, (char *)NULL); fprintf(stderr, "%s", keyprompt); fflush(stderr); for (i = 0, ilim = COUNTOF(pbuf) - 1; i < ilim && (c = getc(fi)) != '\n' && c != EOF; ) pbuf[i++] = (char)c; pbuf[i] = '\0'; if (fi != stdin) fclose(fi); return (u_long) atoi(pbuf); } /* * atoascii - printable-ize possibly ascii data using the character * transformations cat -v uses. */ static void atoascii( const char *in, size_t in_octets, char *out, size_t out_octets ) { register const u_char * pchIn; const u_char * pchInLimit; register u_char * pchOut; register u_char c; pchIn = (const u_char *)in; pchInLimit = pchIn + in_octets; pchOut = (u_char *)out; if (NULL == pchIn) { if (0 < out_octets) *pchOut = '\0'; return; } #define ONEOUT(c) \ do { \ if (0 == --out_octets) { \ *pchOut = '\0'; \ return; \ } \ *pchOut++ = (c); \ } while (0) for ( ; pchIn < pchInLimit; pchIn++) { c = *pchIn; if ('\0' == c) break; if (c & 0x80) { ONEOUT('M'); ONEOUT('-'); c &= 0x7f; } if (c < ' ') { ONEOUT('^'); ONEOUT((u_char)(c + '@')); } else if (0x7f == c) { ONEOUT('^'); ONEOUT('?'); } else ONEOUT(c); } ONEOUT('\0'); #undef ONEOUT } /* * makeascii - print possibly ascii data using the character * transformations that cat -v uses. */ void makeascii( int length, const char *data, FILE *fp ) { const u_char *data_u_char; const u_char *cp; int c; data_u_char = (const u_char *)data; for (cp = data_u_char; cp < data_u_char + length; cp++) { c = (int)*cp; if (c & 0x80) { putc('M', fp); putc('-', fp); c &= 0x7f; } if (c < ' ') { putc('^', fp); putc(c + '@', fp); } else if (0x7f == c) { putc('^', fp); putc('?', fp); } else putc(c, fp); } } /* * asciize - same thing as makeascii except add a newline */ void asciize( int length, char *data, FILE *fp ) { makeascii(length, data, fp); putc('\n', fp); } /* * truncate string to fit clipping excess at end. * "too long" -> "too l" * Used for hostnames. */ char * trunc_right( const char * src, size_t width ) { size_t sl; char * out; sl = strlen(src); if (sl > width && LIB_BUFLENGTH - 1 > width && width > 0) { LIB_GETBUF(out); memcpy(out, src, width); out[width] = '\0'; return out; } return src; } /* * truncate string to fit by preserving right side and using '_' to hint * "too long" -> "_long" * Used for local IPv6 addresses, where low bits differentiate. */ char * trunc_left( const char * src, size_t width ) { size_t sl; char * out; sl = strlen(src); if (sl > width && LIB_BUFLENGTH - 1 > width && width > 1) { LIB_GETBUF(out); out[0] = '_'; memcpy(&out[1], &src[sl + 1 - width], width); return out; } return src; } /* * Some circular buffer space */ #define CBLEN 80 #define NUMCB 6 char circ_buf[NUMCB][CBLEN]; int nextcb = 0; /* * nextvar - find the next variable in the buffer */ int nextvar( int *datalen, const char **datap, char **vname, char **vvalue ) { const char *cp; char *np; const char *cpend; char *npend; /* character after last */ int quoted = 0; static char name[MAXVARLEN]; static char value[MAXVALLEN]; cp = *datap; cpend = cp + *datalen; /* * Space past commas and white space */ while (cp < cpend && (*cp == ',' || isspace((int)*cp))) cp++; if (cp == cpend) return 0; /* * Copy name until we hit a ',', an '=', a '\r' or a '\n'. Backspace * over any white space and terminate it. */ np = name; npend = &name[MAXVARLEN]; while (cp < cpend && np < npend && *cp != ',' && *cp != '=' && *cp != '\r' && *cp != '\n') *np++ = *cp++; /* * Check if we ran out of name space, without reaching the end or a * terminating character */ if (np == npend && !(cp == cpend || *cp == ',' || *cp == '=' || *cp == '\r' || *cp == '\n')) return 0; while (isspace((int)(*(np-1)))) np--; *np = '\0'; *vname = name; /* * Check if we hit the end of the buffer or a ','. If so we are done. */ if (cp == cpend || *cp == ',' || *cp == '\r' || *cp == '\n') { if (cp != cpend) cp++; *datap = cp; *datalen = cpend - cp; *vvalue = (char *)0; return 1; } /* * So far, so good. Copy out the value */ cp++; /* past '=' */ while (cp < cpend && (isspace((int)*cp) && *cp != '\r' && *cp != '\n')) cp++; np = value; npend = &value[MAXVALLEN]; while (cp < cpend && np < npend && ((*cp != ',') || quoted)) { quoted ^= ((*np++ = *cp++) == '"'); } /* * Check if we overran the value buffer while still in a quoted string * or without finding a comma */ if (np == npend && (quoted || *cp != ',')) return 0; /* * Trim off any trailing whitespace */ while (np > value && isspace((int)(*(np-1)))) np--; *np = '\0'; /* * Return this. All done. */ if (cp != cpend) cp++; *datap = cp; *datalen = cpend - cp; *vvalue = value; return 1; } /* * findvar - see if this variable is known to us. * If "code" is 1, return ctl_var->code. * Otherwise return the ordinal position of the found variable. */ int findvar( char *varname, struct ctl_var *varlist, int code ) { register char *np; register struct ctl_var *vl; vl = varlist; np = varname; while (vl->fmt != EOV) { if (vl->fmt != PADDING && STREQ(np, vl->text)) return (code) ? vl->code : (vl - varlist) ; vl++; } return 0; } /* * printvars - print variables returned in response packet */ void printvars( int length, const char *data, int status, int sttype, int quiet, FILE *fp ) { if (rawmode) rawprint(sttype, length, data, status, quiet, fp); else cookedprint(sttype, length, data, status, quiet, fp); } /* * rawprint - do a printout of the data in raw mode */ static void rawprint( int datatype, int length, const char *data, int status, int quiet, FILE *fp ) { const char *cp; const char *cpend; /* * Essentially print the data as is. We reformat unprintables, though. */ cp = data; cpend = data + length; if (!quiet) (void) fprintf(fp, "status=0x%04x,\n", status); while (cp < cpend) { if (*cp == '\r') { /* * If this is a \r and the next character is a * \n, supress this, else pretty print it. Otherwise * just output the character. */ if (cp == (cpend - 1) || *(cp + 1) != '\n') makeascii(1, cp, fp); } else if (isspace(*cp) || isprint(*cp)) putc(*cp, fp); else makeascii(1, cp, fp); cp++; } } /* * Global data used by the cooked output routines */ int out_chars; /* number of characters output */ int out_linecount; /* number of characters output on this line */ /* * startoutput - get ready to do cooked output */ static void startoutput(void) { out_chars = 0; out_linecount = 0; } /* * output - output a variable=value combination */ static void output( FILE *fp, char *name, char *value ) { size_t len; /* strlen of "name=value" */ len = strlen(name) + 1 + strlen(value); if (out_chars != 0) { out_chars += 2; if ((out_linecount + len + 2) > MAXOUTLINE) { fputs(",\n", fp); out_linecount = 0; } else { fputs(", ", fp); out_linecount += 2; } } fputs(name, fp); putc('=', fp); fputs(value, fp); out_chars += len; out_linecount += len; } /* * endoutput - terminate a block of cooked output */ static void endoutput( FILE *fp ) { if (out_chars != 0) putc('\n', fp); } /* * outputarr - output an array of values */ static void outputarr( FILE *fp, char *name, int narr, l_fp *lfp ) { register char *bp; register char *cp; register int i; register int len; char buf[256]; bp = buf; /* * Hack to align delay and offset values */ for (i = (int)strlen(name); i < 11; i++) *bp++ = ' '; for (i = narr; i > 0; i--) { if (i != narr) *bp++ = ' '; cp = lfptoms(lfp, 2); len = strlen(cp); if (len > 7) { cp[7] = '\0'; len = 7; } while (len < 7) { *bp++ = ' '; len++; } while (*cp != '\0') *bp++ = *cp++; lfp++; } *bp = '\0'; output(fp, name, buf); } static char * tstflags( u_long val ) { register char *cp, *s; size_t cb; register int i; register const char *sep; sep = ""; i = 0; s = cp = circ_buf[nextcb]; if (++nextcb >= NUMCB) nextcb = 0; cb = sizeof(circ_buf[0]); snprintf(cp, cb, "%02lx", val); cp += strlen(cp); cb -= strlen(cp); if (!val) { strncat(cp, " ok", cb); cp += strlen(cp); cb -= strlen(cp); } else { if (cb) { *cp++ = ' '; cb--; } for (i = 0; i < COUNTOF(tstflagnames); i++) { if (val & 0x1) { snprintf(cp, cb, "%s%s", sep, tstflagnames[i]); sep = ", "; cp += strlen(cp); cb -= strlen(cp); } val >>= 1; } } if (cb) *cp = '\0'; return s; } /* * cookedprint - output variables in cooked mode */ static void cookedprint( int datatype, int length, const char *data, int status, int quiet, FILE *fp ) { register int varid; char *name; char *value; char output_raw; int fmt; struct ctl_var *varlist; l_fp lfp; long ival; sockaddr_u hval; u_long uval; l_fp lfparr[8]; int narr; switch (datatype) { case TYPE_PEER: varlist = peer_var; break; case TYPE_SYS: varlist = sys_var; break; case TYPE_CLOCK: varlist = clock_var; break; default: fprintf(stderr, "Unknown datatype(0x%x) in cookedprint\n", datatype); return; } if (!quiet) fprintf(fp, "status=%04x %s,\n", status, statustoa(datatype, status)); startoutput(); while (nextvar(&length, &data, &name, &value)) { varid = findvar(name, varlist, 0); if (varid == 0) { output_raw = '*'; } else { output_raw = 0; fmt = varlist[varid].fmt; switch(fmt) { case TS: if (!decodets(value, &lfp)) output_raw = '?'; else output(fp, name, prettydate(&lfp)); break; case FL: case FU: case FS: if (!decodetime(value, &lfp)) output_raw = '?'; else { switch (fmt) { case FL: output(fp, name, lfptoms(&lfp, 3)); break; case FU: output(fp, name, ulfptoms(&lfp, 3)); break; case FS: output(fp, name, lfptoms(&lfp, 3)); break; } } break; case UI: if (!decodeuint(value, &uval)) output_raw = '?'; else output(fp, name, uinttoa(uval)); break; case SI: if (!decodeint(value, &ival)) output_raw = '?'; else output(fp, name, inttoa(ival)); break; case HA: case NA: if (!decodenetnum(value, &hval)) output_raw = '?'; else if (fmt == HA){ output(fp, name, nntohost(&hval)); } else { output(fp, name, stoa(&hval)); } break; case ST: output_raw = '*'; break; case RF: if (decodenetnum(value, &hval)) { if (ISREFCLOCKADR(&hval)) output(fp, name, refnumtoa(&hval)); else output(fp, name, stoa(&hval)); } else if ((int)strlen(value) <= 4) output(fp, name, value); else output_raw = '?'; break; case LP: if (!decodeuint(value, &uval) || uval > 3) output_raw = '?'; else { char b[3]; b[0] = b[1] = '0'; if (uval & 0x2) b[0] = '1'; if (uval & 0x1) b[1] = '1'; b[2] = '\0'; output(fp, name, b); } break; case OC: if (!decodeuint(value, &uval)) output_raw = '?'; else { char b[12]; (void) snprintf(b, sizeof b, "%03lo", uval); output(fp, name, b); } break; case MD: if (!decodeuint(value, &uval)) output_raw = '?'; else output(fp, name, uinttoa(uval)); break; case AR: if (!decodearr(value, &narr, lfparr)) output_raw = '?'; else outputarr(fp, name, narr, lfparr); break; case FX: if (!decodeuint(value, &uval)) output_raw = '?'; else output(fp, name, tstflags(uval)); break; default: (void) fprintf(stderr, "Internal error in cookedprint, %s=%s, fmt %d\n", name, value, fmt); break; } } if (output_raw != 0) { char bn[401]; char bv[401]; int len; atoascii(name, MAXVARLEN, bn, sizeof(bn)); atoascii(value, MAXVARLEN, bv, sizeof(bv)); if (output_raw != '*') { len = strlen(bv); bv[len] = output_raw; bv[len+1] = '\0'; } output(fp, bn, bv); } } endoutput(fp); } /* * sortassoc - sort associations in the cache into ascending order */ void sortassoc(void) { if (numassoc > 1) qsort((void *)assoc_cache, (size_t)numassoc, sizeof(assoc_cache[0]), assoccmp); } /* * assoccmp - compare two associations */ static int assoccmp( const void *t1, const void *t2 ) { const struct association *ass1 = t1; const struct association *ass2 = t2; if (ass1->assid < ass2->assid) return -1; if (ass1->assid > ass2->assid) return 1; return 0; } /* * ntpq_custom_opt_handler - autoopts handler for -c and -p * * By default, autoopts loses the relative order of -c and -p options * on the command line. This routine replaces the default handler for * those routines and builds a list of commands to execute preserving * the order. */ void ntpq_custom_opt_handler( tOptions *pOptions, tOptDesc *pOptDesc ) { switch (pOptDesc->optValue) { default: fprintf(stderr, "ntpq_custom_opt_handler unexpected option '%c' (%d)\n", pOptDesc->optValue, pOptDesc->optValue); exit(-1); case 'c': ADDCMD(pOptDesc->pzLastArg); break; case 'p': ADDCMD("peers"); break; } } ntp-4.2.6p5/ntpq/ntpq-opts.texi0000644000175000017500000001660111675460613015450 0ustar peterpeter@node ntpq Invocation @section Invoking ntpq @pindex ntpq @cindex standard NTP query program @ignore # # EDIT THIS FILE WITH CAUTION (ntpq-opts.texi) # # It has been AutoGen-ed December 24, 2011 at 06:34:35 PM by AutoGen 5.12 # From the definitions ntpq-opts.def # and the template file aginfo.tpl @end ignore This program has no explanation. The [= prog-name =] utility program is used to query NTP servers which implement the standard NTP mode 6 control message formats defined in Appendix B of the NTPv3 specification RFC1305, requesting information about current state and/or changes in that state. The same formats are used in NTPv4, although some of the variables have changed and new ones added. This section was generated by @strong{AutoGen}, the aginfo template and the option descriptions for the @command{ntpq} program. It documents the @command{ntpq} usage text and option meanings. This software is released under a specialized copyright license. @menu * ntpq usage:: ntpq usage help (-?) * ntpq command:: command option (-c) * ntpq debug-level:: debug-level option (-d) * ntpq interactive:: interactive option (-i) * ntpq ipv4:: ipv4 option (-4) * ntpq ipv6:: ipv6 option (-6) * ntpq numeric:: numeric option (-n) * ntpq old-rv:: old-rv option * ntpq peers:: peers option (-p) * ntpq set-debug-level:: set-debug-level option (-D) @end menu @node ntpq usage @subsection ntpq usage help (-?) @cindex ntpq usage This is the automatically generated usage text for ntpq: @exampleindent 0 @example ntpq - standard NTP query program - Ver. 4.2.6p5 USAGE: ntpq [ - [] | --[@{=| @}] ]... [ host ...] Flg Arg Option-Name Description -4 no ipv4 Force IPv4 DNS name resolution - prohibits these options: ipv6 -6 no ipv6 Force IPv6 DNS name resolution - prohibits these options: ipv4 -c Str command run a command and exit - may appear multiple times -d no debug-level Increase output debug message level - may appear multiple times -D Str set-debug-level Set the output debug message level - may appear multiple times -p no peers Print a list of the peers - prohibits these options: interactive -i no interactive Force ntpq to operate in interactive mode - prohibits these options: command peers -n no numeric numeric host addresses no old-rv Always output status line with readvar opt version Output version information and exit -? no help Display extended usage information and exit -! no more-help Extended usage information passed thru pager -> opt save-opts Save the option state to a config file -< Str load-opts Load options from a config file - disabled as --no-load-opts - may appear multiple times Options are specified by doubled hyphens and their name or by a single hyphen and the flag character. The following option preset mechanisms are supported: - reading file $HOME/.ntprc - reading file ./.ntprc - examining environment variables named NTPQ_* The [= prog-name =] utility program is used to query NTP servers which implement the standard NTP mode 6 control message formats defined in Appendix B of the NTPv3 specification RFC1305, requesting information about current state and/or changes in that state. The same formats are used in NTPv4, although some of the variables have changed and new ones added. please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org @end example @exampleindent 4 @node ntpq command @subsection command option (-c) @cindex ntpq-command This is the ``run a command and exit'' option. This option has some usage constraints. It: @itemize @bullet @item may appear an unlimited number of times. @end itemize The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). @node ntpq debug-level @subsection debug-level option (-d) @cindex ntpq-debug-level This is the ``increase output debug message level'' option. This option has some usage constraints. It: @itemize @bullet @item may appear an unlimited number of times. @end itemize Increase the debugging message output level. @node ntpq interactive @subsection interactive option (-i) @cindex ntpq-interactive This is the ``force ntpq to operate in interactive mode'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: command, peers. @end itemize Force ntpq to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input. @node ntpq ipv4 @subsection ipv4 option (-4) @cindex ntpq-ipv4 This is the ``force ipv4 dns name resolution'' option. 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. @node ntpq ipv6 @subsection ipv6 option (-6) @cindex ntpq-ipv6 This is the ``force ipv6 dns name resolution'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: ipv4. @end itemize Force DNS resolution of following host names on the command line to the IPv6 namespace. @node ntpq numeric @subsection numeric option (-n) @cindex ntpq-numeric This is the ``numeric host addresses'' option. Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names. @node ntpq old-rv @subsection old-rv option @cindex ntpq-old-rv This is the ``always output status line with readvar'' option. By default, ntpq now suppresses the associd=... line that precedes the output of "readvar" (alias "rv") when a single variable is requested, such as ntpq -c "rv 0 offset". This option causes ntpq to include both lines of output for a single-variable readvar. Using an environment variable to preset this option in a script will enable both older and newer ntpq to behave identically in this regard. @node ntpq peers @subsection peers option (-p) @cindex ntpq-peers This is the ``print a list of the peers'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: interactive. @end itemize Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'peers' interactive command. @node ntpq set-debug-level @subsection set-debug-level option (-D) @cindex ntpq-set-debug-level This is the ``set the output debug message level'' option. This option has some usage constraints. It: @itemize @bullet @item may appear an unlimited number of times. @end itemize Set the output debugging level. Can be supplied multiple times, but each overrides the previous value(s). ntp-4.2.6p5/ntpq/ntpq-opts.menu0000644000175000017500000000006111675460613015434 0ustar peterpeter* ntpq Invocation:: Invoking ntpq ntp-4.2.6p5/ntpq/Makefile.in0000644000175000017500000010024011675460300014637 0ustar peterpeter# 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@ # we traditionally installed software in bindir, while it should have gone # in sbindir. Now that we offer a choice, look in the "other" installation # subdir to warn folks if there is another version there. 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@ @NTP_BINSUBDIR_IS_BIN_TRUE@bin_PROGRAMS = ntpq$(EXEEXT) @NTP_BINSUBDIR_IS_BIN_FALSE@sbin_PROGRAMS = ntpq$(EXEEXT) DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/bincheck.mf \ $(top_srcdir)/depsver.mf subdir = ntpq ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/define_dir.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_cacheversion.m4 \ $(top_srcdir)/m4/ntp_dir_sep.m4 \ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \ $(top_srcdir)/m4/ntp_openssl.m4 \ $(top_srcdir)/m4/ntp_vpathhack.m4 \ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libntpq_a_AR = $(AR) $(ARFLAGS) libntpq_a_LIBADD = am_libntpq_a_OBJECTS = libntpq_a-libntpq.$(OBJEXT) \ libntpq_a-libntpq_subs.$(OBJEXT) libntpq_a_OBJECTS = $(am_libntpq_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) am_ntpq_OBJECTS = ntpq.$(OBJEXT) ntpq-subs.$(OBJEXT) \ ntpq-opts.$(OBJEXT) ntpq_OBJECTS = $(am_ntpq_OBJECTS) am__DEPENDENCIES_1 = ntpq_DEPENDENCIES = version.o $(am__DEPENDENCIES_1) ../libntp/libntp.a DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libntpq_a_SOURCES) $(ntpq_SOURCES) DIST_SOURCES = $(libntpq_a_SOURCES) $(ntpq_SOURCES) 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' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DATA = $(noinst_DATA) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ 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@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SH = @PATH_SH@ PATH_TEST = @PATH_TEST@ POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CFLAGS = @SNMP_CFLAGS@ SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ SNMP_LIBS = @SNMP_LIBS@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ VERSION = @VERSION@ 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_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 = AUTOMAKE_OPTIONS = AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include $(LIBOPTS_CFLAGS) # LDADD might need RESLIB and ADJLIB ntpq_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a \ @EDITLINE_LIBS@ @LCRYPTO@ noinst_HEADERS = ntpq.h noinst_LIBRARIES = libntpq.a libntpq_a_CFLAGS = -DNO_MAIN_ALLOWED -DBUILD_AS_LIB CLEANFILES = .deps-ver DISTCLEANFILES = .version version.c ETAGS_ARGS = Makefile.am EXTRA_DIST = ntpq-opts.def ntpq.1 ntpq-opts.texi ntpq-opts.menu BUILT_SOURCES = ntpq-opts.c ntpq-opts.h .deps-ver man_MANS = $(srcdir)/ntpq.1 noinst_DATA = $(srcdir)/ntpq-opts.texi $(srcdir)/ntpq-opts.menu run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \ autogen -L ../include --writable std_def_list = $(top_srcdir)/include/debug-opt.def \ $(top_srcdir)/include/autogen-version.def \ $(top_srcdir)/include/copyright.def \ $(top_srcdir)/include/homerc.def \ $(top_srcdir)/include/version.def ntpq_SOURCES = ntpq.c ntpq-subs.c ntpq-opts.c ntpq-opts.h libntpq_a_SOURCES = libntpq.c libntpq.h libntpq_subs.c all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf $(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 ntpq/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign ntpq/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): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libntpq.a: $(libntpq_a_OBJECTS) $(libntpq_a_DEPENDENCIES) -rm -f libntpq.a $(libntpq_a_AR) libntpq.a $(libntpq_a_OBJECTS) $(libntpq_a_LIBADD) $(RANLIB) libntpq.a install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ntpq$(EXEEXT): $(ntpq_OBJECTS) $(ntpq_DEPENDENCIES) @rm -f ntpq$(EXEEXT) $(LINK) $(ntpq_OBJECTS) $(ntpq_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libntpq_a-libntpq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libntpq_a-libntpq_subs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpq-opts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpq-subs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpq.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libntpq_a-libntpq.o: libntpq.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -MT libntpq_a-libntpq.o -MD -MP -MF $(DEPDIR)/libntpq_a-libntpq.Tpo -c -o libntpq_a-libntpq.o `test -f 'libntpq.c' || echo '$(srcdir)/'`libntpq.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libntpq_a-libntpq.Tpo $(DEPDIR)/libntpq_a-libntpq.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libntpq.c' object='libntpq_a-libntpq.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -c -o libntpq_a-libntpq.o `test -f 'libntpq.c' || echo '$(srcdir)/'`libntpq.c libntpq_a-libntpq.obj: libntpq.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -MT libntpq_a-libntpq.obj -MD -MP -MF $(DEPDIR)/libntpq_a-libntpq.Tpo -c -o libntpq_a-libntpq.obj `if test -f 'libntpq.c'; then $(CYGPATH_W) 'libntpq.c'; else $(CYGPATH_W) '$(srcdir)/libntpq.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libntpq_a-libntpq.Tpo $(DEPDIR)/libntpq_a-libntpq.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libntpq.c' object='libntpq_a-libntpq.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -c -o libntpq_a-libntpq.obj `if test -f 'libntpq.c'; then $(CYGPATH_W) 'libntpq.c'; else $(CYGPATH_W) '$(srcdir)/libntpq.c'; fi` libntpq_a-libntpq_subs.o: libntpq_subs.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -MT libntpq_a-libntpq_subs.o -MD -MP -MF $(DEPDIR)/libntpq_a-libntpq_subs.Tpo -c -o libntpq_a-libntpq_subs.o `test -f 'libntpq_subs.c' || echo '$(srcdir)/'`libntpq_subs.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libntpq_a-libntpq_subs.Tpo $(DEPDIR)/libntpq_a-libntpq_subs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libntpq_subs.c' object='libntpq_a-libntpq_subs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -c -o libntpq_a-libntpq_subs.o `test -f 'libntpq_subs.c' || echo '$(srcdir)/'`libntpq_subs.c libntpq_a-libntpq_subs.obj: libntpq_subs.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -MT libntpq_a-libntpq_subs.obj -MD -MP -MF $(DEPDIR)/libntpq_a-libntpq_subs.Tpo -c -o libntpq_a-libntpq_subs.obj `if test -f 'libntpq_subs.c'; then $(CYGPATH_W) 'libntpq_subs.c'; else $(CYGPATH_W) '$(srcdir)/libntpq_subs.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libntpq_a-libntpq_subs.Tpo $(DEPDIR)/libntpq_a-libntpq_subs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libntpq_subs.c' object='libntpq_a-libntpq_subs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -c -o libntpq_a-libntpq_subs.obj `if test -f 'libntpq_subs.c'; then $(CYGPATH_W) 'libntpq_subs.c'; else $(CYGPATH_W) '$(srcdir)/libntpq_subs.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; 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=''; 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; } ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstLIBRARIES clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man \ uninstall-sbinPROGRAMS uninstall-man: uninstall-man1 .MAKE: all check install install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-noinstLIBRARIES \ clean-sbinPROGRAMS ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 uninstall-sbinPROGRAMS $(srcdir)/ntpq-opts.h: $(srcdir)/ntpq-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntpq-opts.c: $(srcdir)/ntpq-opts.def $(std_def_list) $(run_ag) ntpq-opts.def $(srcdir)/ntpq.1: $(srcdir)/ntpq-opts.def $(std_def_list) $(run_ag) -Tagman1.tpl -bntpq ntpq-opts.def $(srcdir)/ntpq-opts.menu: $(srcdir)/ntpq-opts.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/ntpq-opts.texi: $(srcdir)/ntpq-opts.def $(std_def_list) $(run_ag) -Taginfo.tpl -DLEVEL=section ntpq-opts.def $(top_srcdir)/scripts/check--help $@ $(PROGRAMS): $(LDADD) ../libntp/libntp.a: cd ../libntp && $(MAKE) $(top_srcdir)/version : cd $(top_srcdir) && $(MAKE) version version.o: $(ntpq_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpq $(COMPILE) -c version.c install-exec-hook: @case ${BINSUBDIR} in \ bin) ODIR=${sbindir} ;; \ sbin) ODIR=${bindir} ;; \ esac; \ test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \ test ! -f $$ODIR/$$i || echo "*** $$i is also in $$ODIR!"; \ done # $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ chmod ug+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ $(MAKE) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ mkdir $(DEPDIR) && \ case "$(top_builddir)" in \ .) \ ./config.status Makefile depfiles \ ;; \ ..) \ cd .. && \ ./config.status $(subdir)/Makefile depfiles && \ cd $(subdir) \ ;; \ *) \ echo 'Fatal: depsver.mf Automake fragment limited' \ 'to immediate subdirectories.' && \ echo "top_builddir: $(top_builddir)" && \ echo "subdir: $(subdir)" && \ exit 1 \ ;; \ esac && \ echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver @touch $@ # # depsver.mf included in Makefile.am for directories with .deps # # When building in the same directory with sources that change over # time, such as when tracking using bk, the .deps files can become # stale with respect to moved, deleted, or superceded headers. Most # commonly, this would exhibit as make reporting a failure to make a # header file which is no longer in the location given. To address # this issue, we use a deps-ver file which is updated with each change # that breaks old .deps files. A copy of deps-ver is made into # $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present # with different contents than deps-ver, we make clean to ensure all # .o files built before the incompatible change are rebuilt along with # their updated .deps files, then remove $(DEPDIR) and recreate it as # empty stubs. # # It is normal when configured with --disable-dependency-tracking for # the DEPDIR to not have been created. For this reason, we use the # intermediate target .deps-ver, which invokes make recursively if # DEPDIR exists. # # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # # This comment block follows rather than leads the related code so that # it stays with it in the generated Makefile.in and Makefile. # # 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: ntp-4.2.6p5/ntpq/libntpq.h0000644000175000017500000000671211636775105014436 0ustar peterpeter/***************************************************************************** * * libntpq.h * * This is the wrapper library for ntpq, the NTP query utility. * This library reuses the sourcecode from ntpq and exports a number * of useful functions in a library that can be linked against applications * that need to query the status of a running ntpd. The whole * communcation is based on mode 6 packets. * * This header file can be used in applications that want to link against * libntpq. * ****************************************************************************/ #include "ntp_net.h" /* general purpose buffer size */ #define NTPQ_BUFLEN 2048 /* max. number of associations */ #ifndef MAXASSOC #define MAXASSOC 1024 #endif /* general purpose max array size definition */ #ifndef MAXLIST #define MAXLIST 64 #endif #ifndef LENHOSTNAME #define LENHOSTNAME 256 /* host name is max. 256 characters long */ #endif /* NTP Status codes */ #define NTP_STATUS_INVALID 0 #define NTP_STATUS_FALSETICKER 1 #define NTP_STATUS_EXCESS 2 #define NTP_STATUS_OUTLYER 3 #define NTP_STATUS_CANDIDATE 4 #define NTP_STATUS_SELECTED 5 #define NTP_STATUS_SYSPEER 6 #define NTP_STATUS_PPSPEER 7 /* NTP association type identifier */ #define NTP_CLOCKTYPE_UNKNOWN '-' #define NTP_CLOCKTYPE_BROADCAST 'b' #define NTP_CLOCKTYPE_LOCAL 'l' #define NTP_CLOCKTYPE_UNICAST 'u' #define NTP_CLOCKTYPE_MULTICAST 'm' /* Variable Sets */ #define PEERVARS CTL_OP_READVAR #define CLOCKVARS CTL_OP_CLOCKVAR /* Variable list struct */ struct ntpq_varlist { char *name; char *value; }; /* global variables used for holding snapshots of data */ #ifndef LIBNTPQ_C extern char peervars[]; extern int peervarlen; extern int peervar_assoc; extern char clockvars[]; extern int clockvarlen; extern int clockvar_assoc; extern char sysvars[]; extern int sysvarlen; extern char *ntpq_resultbuffer[]; extern struct ntpq_varlist ntpq_varlist[MAXLIST]; #endif /* * Prototypes of exported libary functions */ /* from libntpq.c */ extern int ntpq_openhost(char *); extern int ntpq_closehost(void); extern int ntpq_queryhost(unsigned short VARSET, associd_t association, char *resultbuf, int maxlen); extern size_t ntpq_getvar(const char *resultbuf, size_t datalen, const char *varname, char *varvalue, size_t maxlen); extern int ntpq_stripquotes ( char *resultbuf, char *srcbuf, int datalen, int maxlen ); extern int ntpq_queryhost_peervars(associd_t association, char *resultbuf, int maxlen); extern int ntpq_get_peervar( const char *varname, char *varvalue, int maxlen); extern size_t ntpq_read_sysvars(char *resultbuf, size_t maxsize); extern int ntpq_get_sysvars( void ); extern int ntpq_read_associations ( unsigned short resultbuf[], int max_entries ); extern int ntpq_get_assocs ( void ); extern int ntpq_get_assoc_number ( associd_t associd ); extern int ntpq_get_assoc_peervars( associd_t associd ); extern int ntpq_get_assoc_clockvars( associd_t associd ); extern int ntpq_get_assoc_allvars( associd_t associd ); extern int ntpq_get_assoc_clocktype(int assoc_index); extern int ntpq_read_assoc_peervars( associd_t associd, char *resultbuf, int maxsize ); extern int ntpq_read_assoc_clockvars( associd_t associd, char *resultbuf, int maxsize ); /* in libntpq_subs.c */ extern int ntpq_dogetassoc(void); extern char ntpq_decodeaddrtype(sockaddr_u *sock); extern int ntpq_doquerylist(struct ntpq_varlist *, int , associd_t , int , u_short *, int *, const char **datap ); ntp-4.2.6p5/ntpq/Makefile.am0000644000175000017500000000415511510477207014640 0ustar peterpeterNULL= AUTOMAKE_OPTIONS= if NTP_BINSUBDIR_IS_BIN bin_PROGRAMS= ntpq else sbin_PROGRAMS= ntpq endif AM_CPPFLAGS= -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include $(LIBOPTS_CFLAGS) # LDADD might need RESLIB and ADJLIB ntpq_LDADD= version.o $(LIBOPTS_LDADD) ../libntp/libntp.a \ @EDITLINE_LIBS@ @LCRYPTO@ noinst_HEADERS= ntpq.h noinst_LIBRARIES= libntpq.a libntpq_a_CFLAGS= -DNO_MAIN_ALLOWED -DBUILD_AS_LIB CLEANFILES= DISTCLEANFILES= .version version.c ETAGS_ARGS= Makefile.am EXTRA_DIST= ntpq-opts.def ntpq.1 ntpq-opts.texi ntpq-opts.menu BUILT_SOURCES= ntpq-opts.c ntpq-opts.h man_MANS= $(srcdir)/ntpq.1 noinst_DATA= $(srcdir)/ntpq-opts.texi $(srcdir)/ntpq-opts.menu run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \ autogen -L ../include --writable std_def_list= $(top_srcdir)/include/debug-opt.def \ $(top_srcdir)/include/autogen-version.def \ $(top_srcdir)/include/copyright.def \ $(top_srcdir)/include/homerc.def \ $(top_srcdir)/include/version.def ntpq_SOURCES= ntpq.c ntpq-subs.c ntpq-opts.c ntpq-opts.h libntpq_a_SOURCES = libntpq.c libntpq.h libntpq_subs.c $(srcdir)/ntpq-opts.h: $(srcdir)/ntpq-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntpq-opts.c: $(srcdir)/ntpq-opts.def $(std_def_list) $(run_ag) ntpq-opts.def $(srcdir)/ntpq.1: $(srcdir)/ntpq-opts.def $(std_def_list) $(run_ag) -Tagman1.tpl -bntpq ntpq-opts.def $(srcdir)/ntpq-opts.menu: $(srcdir)/ntpq-opts.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/ntpq-opts.texi: $(srcdir)/ntpq-opts.def $(std_def_list) $(run_ag) -Taginfo.tpl -DLEVEL=section ntpq-opts.def $(top_srcdir)/scripts/check--help $@ $(PROGRAMS): $(LDADD) ../libntp/libntp.a: cd ../libntp && $(MAKE) $(top_srcdir)/version : cd $(top_srcdir) && $(MAKE) version version.o: $(ntpq_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpq $(COMPILE) -c version.c include $(top_srcdir)/bincheck.mf include $(top_srcdir)/depsver.mf ntp-4.2.6p5/ntpq/ntpq-opts.h0000644000175000017500000001630411675460602014724 0ustar peterpeter/* * EDIT THIS FILE WITH CAUTION (ntpq-opts.h) * * It has been AutoGen-ed December 24, 2011 at 06:34:27 PM by AutoGen 5.12 * From the definitions ntpq-opts.def * and the template file options * * Generated from AutoOpts 35:0:10 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the ntpq author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * This source file is copyrighted and licensed under the following terms: * * see html/copyright.html * */ /* * This file contains the programmatic interface to the Automated * Options generated for the ntpq program. * These macros are documented in the AutoGen info file in the * "AutoOpts" chapter. Please refer to that doc for usage help. */ #ifndef AUTOOPTS_NTPQ_OPTS_H_GUARD #define AUTOOPTS_NTPQ_OPTS_H_GUARD 1 #include "config.h" #include /* * Ensure that the library used for compiling this generated header is at * least as new as the version current when the header template was released * (not counting patch version increments). Also ensure that the oldest * tolerable version is at least as old as what was current when the header * template was released. */ #define AO_TEMPLATE_VERSION 143360 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header Choke Me. #endif /* * Enumeration of each option: */ typedef enum { INDEX_OPT_IPV4 = 0, INDEX_OPT_IPV6 = 1, INDEX_OPT_COMMAND = 2, INDEX_OPT_DEBUG_LEVEL = 3, INDEX_OPT_SET_DEBUG_LEVEL = 4, INDEX_OPT_PEERS = 5, INDEX_OPT_INTERACTIVE = 6, INDEX_OPT_NUMERIC = 7, INDEX_OPT_OLD_RV = 8, INDEX_OPT_VERSION = 9, INDEX_OPT_HELP = 10, INDEX_OPT_MORE_HELP = 11, INDEX_OPT_SAVE_OPTS = 12, INDEX_OPT_LOAD_OPTS = 13 } teOptIndex; #define OPTION_CT 14 #define NTPQ_VERSION "4.2.6p5" #define NTPQ_FULL_VERSION "ntpq 4.2.6p5" /* * Interface defines for all options. Replace "n" with the UPPER_CASED * option name (as in the teOptIndex enumeration above). * e.g. HAVE_OPT(IPV4) */ #define DESC(n) (ntpqOptions.pOptDesc[INDEX_OPT_## n]) #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) #define OPT_ARG(n) (DESC(n).optArg.argString) #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) #define COUNT_OPT(n) (DESC(n).optOccCt) #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) #define CLEAR_OPT(n) STMTS( \ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ DESC(n).fOptState |= OPTST_DISABLED; \ DESC(n).optCookie = NULL ) /* * * * * * * * Enumeration of ntpq exit codes */ typedef enum { NTPQ_EXIT_SUCCESS = 0, NTPQ_EXIT_FAILURE = 1 } ntpq_exit_code_t; /* * Make sure there are no #define name conflicts with the option names */ #ifndef NO_OPTION_NAME_WARNINGS # ifdef IPV4 # warning undefining IPV4 due to option name conflict # undef IPV4 # endif # ifdef IPV6 # warning undefining IPV6 due to option name conflict # undef IPV6 # endif # ifdef COMMAND # warning undefining COMMAND due to option name conflict # undef COMMAND # endif # ifdef DEBUG_LEVEL # warning undefining DEBUG_LEVEL due to option name conflict # undef DEBUG_LEVEL # endif # ifdef SET_DEBUG_LEVEL # warning undefining SET_DEBUG_LEVEL due to option name conflict # undef SET_DEBUG_LEVEL # endif # ifdef PEERS # warning undefining PEERS due to option name conflict # undef PEERS # endif # ifdef INTERACTIVE # warning undefining INTERACTIVE due to option name conflict # undef INTERACTIVE # endif # ifdef NUMERIC # warning undefining NUMERIC due to option name conflict # undef NUMERIC # endif # ifdef OLD_RV # warning undefining OLD_RV due to option name conflict # undef OLD_RV # endif #else /* NO_OPTION_NAME_WARNINGS */ # undef IPV4 # undef IPV6 # undef COMMAND # undef DEBUG_LEVEL # undef SET_DEBUG_LEVEL # undef PEERS # undef INTERACTIVE # undef NUMERIC # undef OLD_RV #endif /* NO_OPTION_NAME_WARNINGS */ /* * * * * * * * Interface defines for specific options. */ #define VALUE_OPT_IPV4 '4' #define VALUE_OPT_IPV6 '6' #define VALUE_OPT_COMMAND 'c' #define VALUE_OPT_DEBUG_LEVEL 'd' #define VALUE_OPT_SET_DEBUG_LEVEL 'D' #define VALUE_OPT_PEERS 'p' #define VALUE_OPT_INTERACTIVE 'i' #define VALUE_OPT_NUMERIC 'n' #define VALUE_OPT_OLD_RV 8 #define VALUE_OPT_HELP '?' #define VALUE_OPT_MORE_HELP '!' #define VALUE_OPT_VERSION INDEX_OPT_VERSION #define VALUE_OPT_SAVE_OPTS '>' #define VALUE_OPT_LOAD_OPTS '<' #define SET_OPT_SAVE_OPTS(a) STMTS( \ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \ DESC(SAVE_OPTS).fOptState |= OPTST_SET; \ DESC(SAVE_OPTS).optArg.argString = (char const*)(a) ) /* * Interface defines not associated with particular options */ #define ERRSKIP_OPTERR STMTS(ntpqOptions.fOptSet &= ~OPTPROC_ERRSTOP) #define ERRSTOP_OPTERR STMTS(ntpqOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_OPT(n) STMTS( \ ntpqOptions.curOptIdx = (n); \ ntpqOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) #define USAGE(c) (*ntpqOptions.pUsageProc)(&ntpqOptions, c) /* extracted from opthead.tlib near line 451 */ #ifdef __cplusplus extern "C" { #endif /* * * * * * * * Declare the ntpq option descriptor. */ extern tOptions ntpqOptions; #if defined(ENABLE_NLS) # ifndef _ # include static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); } # define _(s) aoGetsText(s) # endif /* _() */ # define OPT_NO_XLAT_CFG_NAMES STMTS(ntpqOptions.fOptSet |= \ OPTPROC_NXLAT_OPT_CFG;) # define OPT_NO_XLAT_OPT_NAMES STMTS(ntpqOptions.fOptSet |= \ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) # define OPT_XLAT_CFG_NAMES STMTS(ntpqOptions.fOptSet &= \ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) # define OPT_XLAT_OPT_NAMES STMTS(ntpqOptions.fOptSet &= \ ~OPTPROC_NXLAT_OPT;) #else /* ENABLE_NLS */ # define OPT_NO_XLAT_CFG_NAMES # define OPT_NO_XLAT_OPT_NAMES # define OPT_XLAT_CFG_NAMES # define OPT_XLAT_OPT_NAMES # ifndef _ # define _(_s) _s # endif #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif #endif /* AUTOOPTS_NTPQ_OPTS_H_GUARD */ /* ntpq-opts.h ends here */ ntp-4.2.6p5/ntpq/README0000644000175000017500000000047510017034573013461 0ustar peterpeterREADME file for directory ./ntpq of the NTP Version 4 distribution This directory contains the sources for the ntpq utility program. See the README and RELNOTES files in the parent directory for directions on how to make and install this program. The current version number of this program is in the version.c file. ntp-4.2.6p5/ntpq/ntpq-opts.c0000644000175000017500000005144611675460602014725 0ustar peterpeter/* * EDIT THIS FILE WITH CAUTION (ntpq-opts.c) * * It has been AutoGen-ed December 24, 2011 at 06:34:27 PM by AutoGen 5.12 * From the definitions ntpq-opts.def * and the template file options * * Generated from AutoOpts 35:0:10 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the ntpq author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * This source file is copyrighted and licensed under the following terms: * * see html/copyright.html * */ #include #include #include #include #define OPTION_CODE_COMPILE 1 #include "ntpq-opts.h" #ifdef __cplusplus extern "C" { #endif extern FILE * option_usage_fp; /* TRANSLATORS: choose the translation for option names wisely because you cannot ever change your mind. */ static char const zCopyright[38] = "ntpq 4.2.6p5\n\ see html/copyright.html\n"; static char const zLicenseDescrip[25] = "see html/copyright.html\n"; extern tUsageProc optionUsage; /* * global included definitions */ #ifdef __windows extern int atoi(const char*); #else # include #endif #ifndef NULL # define NULL 0 #endif /* * Ipv4 option description with * "Must also have options" and "Incompatible options": */ static char const zIpv4Text[] = "Force IPv4 DNS name resolution"; static char const zIpv4_NAME[] = "IPV4"; static char const zIpv4_Name[] = "ipv4"; static const int aIpv4CantList[] = { INDEX_OPT_IPV6, NO_EQUIVALENT }; #define IPV4_FLAGS (OPTST_DISABLED) /* * Ipv6 option description with * "Must also have options" and "Incompatible options": */ static char const zIpv6Text[] = "Force IPv6 DNS name resolution"; static char const zIpv6_NAME[] = "IPV6"; static char const zIpv6_Name[] = "ipv6"; static const int aIpv6CantList[] = { INDEX_OPT_IPV4, NO_EQUIVALENT }; #define IPV6_FLAGS (OPTST_DISABLED) /* * Command option description: */ static char const zCommandText[] = "run a command and exit"; static char const zCommand_NAME[] = "COMMAND"; static char const zCommand_Name[] = "command"; #define COMMAND_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Debug_Level option description: */ static char const zDebug_LevelText[] = "Increase output debug message level"; static char const zDebug_Level_NAME[] = "DEBUG_LEVEL"; static char const zDebug_Level_Name[] = "debug-level"; #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) /* * Set_Debug_Level option description: */ static char const zSet_Debug_LevelText[] = "Set the output debug message level"; static char const zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL"; static char const zSet_Debug_Level_Name[] = "set-debug-level"; #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Peers option description with * "Must also have options" and "Incompatible options": */ static char const zPeersText[] = "Print a list of the peers"; static char const zPeers_NAME[] = "PEERS"; static char const zPeers_Name[] = "peers"; static const int aPeersCantList[] = { INDEX_OPT_INTERACTIVE, NO_EQUIVALENT }; #define PEERS_FLAGS (OPTST_DISABLED) /* * Interactive option description with * "Must also have options" and "Incompatible options": */ static char const zInteractiveText[] = "Force ntpq to operate in interactive mode"; static char const zInteractive_NAME[] = "INTERACTIVE"; static char const zInteractive_Name[] = "interactive"; static const int aInteractiveCantList[] = { INDEX_OPT_COMMAND, INDEX_OPT_PEERS, NO_EQUIVALENT }; #define INTERACTIVE_FLAGS (OPTST_DISABLED) /* * Numeric option description: */ static char const zNumericText[] = "numeric host addresses"; static char const zNumeric_NAME[] = "NUMERIC"; static char const zNumeric_Name[] = "numeric"; #define NUMERIC_FLAGS (OPTST_DISABLED) /* * Old_Rv option description: */ static char const zOld_RvText[] = "Always output status line with readvar"; static char const zOld_Rv_NAME[] = "OLD_RV"; static char const zOld_Rv_Name[] = "old-rv"; #define OLD_RV_FLAGS (OPTST_DISABLED) /* * Help/More_Help/Version option descriptions: */ static char const zHelpText[] = "Display extended usage information and exit"; static char const zHelp_Name[] = "help"; #ifdef HAVE_WORKING_FORK #define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) static char const zMore_Help_Name[] = "more-help"; static char const zMore_HelpText[] = "Extended usage information passed thru pager"; #else #define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMore_Help_Name NULL #define zMore_HelpText NULL #endif #ifdef NO_OPTIONAL_OPT_ARGS # define OPTST_VERSION_FLAGS OPTST_IMM | OPTST_NO_INIT #else # define OPTST_VERSION_FLAGS OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif static char const zVersionText[] = "Output version information and exit"; static char const zVersion_Name[] = "version"; static char const zSave_OptsText[] = "Save the option state to a config file"; static char const zSave_Opts_Name[] = "save-opts"; static char const zLoad_OptsText[] = "Load options from a config file"; static char const zLoad_Opts_NAME[] = "LOAD_OPTS"; static char const zNotLoad_Opts_Name[] = "no-load-opts"; static char const zNotLoad_Opts_Pfx[] = "no"; #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3) /* * Declare option callback procedures */ #if defined(TEST_NTPQ_OPTS) /* * Under test, omit argument processing, or call optionStackArg, * if multiple copies are allowed. */ extern tOptProc optionStackArg; static tOptProc doUsageOpt; /* * #define map the "normal" callout procs to the test ones... */ #define COMMAND_OPT_PROC optionStackArg #define SET_DEBUG_LEVEL_OPT_PROC optionStackArg #define PEERS_OPT_PROC optionStackArg #else /* NOT defined TEST_NTPQ_OPTS */ /* * When not under test, there are different procs to use */ extern tOptProc ntpq_custom_opt_handler, optionBooleanVal, optionNestedVal, optionNumericVal, optionPagedUsage, optionPrintVersion, optionResetOpt, optionStackArg, optionTimeDate, optionTimeVal, optionUnstackArg, optionVersionStderr; static tOptProc doOptSet_Debug_Level, doUsageOpt; /* * #define map the "normal" callout procs */ #define COMMAND_OPT_PROC ntpq_custom_opt_handler #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level #define PEERS_OPT_PROC ntpq_custom_opt_handler #define COMMAND_OPT_PROC ntpq_custom_opt_handler #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level #define PEERS_OPT_PROC ntpq_custom_opt_handler #endif /* defined(TEST_NTPQ_OPTS) */ #ifdef TEST_NTPQ_OPTS # define DOVERPROC optionVersionStderr #else # define DOVERPROC optionPrintVersion #endif /* TEST_NTPQ_OPTS */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the Ntpq Option Descriptions. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_IPV4, /* equiv idx, value */ 0, VALUE_OPT_IPV4, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ IPV4_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aIpv4CantList, /* option proc */ NULL, /* desc, NAME, name */ zIpv4Text, zIpv4_NAME, zIpv4_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 1, VALUE_OPT_IPV6, /* equiv idx, value */ 1, VALUE_OPT_IPV6, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ IPV6_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aIpv6CantList, /* option proc */ NULL, /* desc, NAME, name */ zIpv6Text, zIpv6_NAME, zIpv6_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 2, VALUE_OPT_COMMAND, /* equiv idx, value */ 2, VALUE_OPT_COMMAND, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ COMMAND_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ COMMAND_OPT_PROC, /* desc, NAME, name */ zCommandText, zCommand_NAME, zCommand_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 3, VALUE_OPT_DEBUG_LEVEL, /* equiv idx, value */ 3, VALUE_OPT_DEBUG_LEVEL, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ DEBUG_LEVEL_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zDebug_LevelText, zDebug_Level_NAME, zDebug_Level_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL, /* equiv idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ SET_DEBUG_LEVEL_OPT_PROC, /* desc, NAME, name */ zSet_Debug_LevelText, zSet_Debug_Level_NAME, zSet_Debug_Level_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 5, VALUE_OPT_PEERS, /* equiv idx, value */ 5, VALUE_OPT_PEERS, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PEERS_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aPeersCantList, /* option proc */ PEERS_OPT_PROC, /* desc, NAME, name */ zPeersText, zPeers_NAME, zPeers_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 6, VALUE_OPT_INTERACTIVE, /* equiv idx, value */ 6, VALUE_OPT_INTERACTIVE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ INTERACTIVE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aInteractiveCantList, /* option proc */ NULL, /* desc, NAME, name */ zInteractiveText, zInteractive_NAME, zInteractive_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 7, VALUE_OPT_NUMERIC, /* equiv idx, value */ 7, VALUE_OPT_NUMERIC, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ NUMERIC_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zNumericText, zNumeric_NAME, zNumeric_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 8, VALUE_OPT_OLD_RV, /* equiv idx, value */ 8, VALUE_OPT_OLD_RV, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OLD_RV_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zOld_RvText, zOld_Rv_NAME, zOld_Rv_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_VERSION_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ DOVERPROC, /* desc, NAME, name */ zVersionText, NULL, zVersion_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doUsageOpt, /* desc, NAME, name */ zHelpText, NULL, zHelp_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_MORE_HELP_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionPagedUsage, /* desc, NAME, name */ zMore_HelpText, NULL, zMore_Help_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zSave_OptsText, NULL, zSave_Opts_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_DISABLE_IMM, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionLoadOpt, /* desc, NAME, name */ zLoad_OptsText, zLoad_Opts_NAME, zLoad_Opts_Name, /* disablement strs */ zNotLoad_Opts_Name, zNotLoad_Opts_Pfx } }; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the Ntpq Option Environment */ static char const zPROGNAME[5] = "NTPQ"; static char const zUsageTitle[119] = "ntpq - standard NTP query program - Ver. 4.2.6p5\n\ USAGE: %s [ - [] | --[{=| }] ]... [ host ...]\n"; static char const zRcName[7] = ".ntprc"; static char const * const apzHomeList[3] = { "$HOME", ".", NULL }; static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org"; #define zExplain NULL static char const zDetail[384] = "\n\ The [= prog-name =] utility program is used to query NTP servers which\n\ implement the standard NTP mode 6 control message formats defined in\n\ Appendix B of the NTPv3 specification RFC1305, requesting information\n\ about current state and/or changes in that state. The same formats are\n\ used in NTPv4, although some of the variables have changed and new ones\n\ added.\n"; static char const zFullVersion[] = NTPQ_FULL_VERSION; /* extracted from optcode.tlib near line 515 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE static tOptionXlateProc translate_option_strings; #else # define OPTPROC_BASE OPTPROC_NONE # define translate_option_strings NULL #endif /* ENABLE_NLS */ #define ntpq_full_usage NULL #define ntpq_short_usage NULL #ifndef PKGDATADIR # define PKGDATADIR "" #endif #ifndef WITH_PACKAGER # define ntpq_packager_info NULL #else static char const ntpq_packager_info[] = "Packaged by " WITH_PACKAGER # ifdef WITH_PACKAGER_VERSION " ("WITH_PACKAGER_VERSION")" # endif # ifdef WITH_PACKAGER_BUG_REPORTS "\nReport ntpq bugs to " WITH_PACKAGER_BUG_REPORTS # endif "\n"; #endif tOptions ntpqOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ ( OPTPROC_BASE + OPTPROC_ERRSTOP + OPTPROC_SHORTOPT + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT + OPTPROC_ENVIRON + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zLicenseDescrip, zFullVersion, apzHomeList, zUsageTitle, zExplain, zDetail, optDesc, zBugsAddr, /* address to send bugs to */ NULL, NULL, /* extensions/saved state */ optionUsage, /* usage procedure */ translate_option_strings, /* translation procedure */ /* * Indexes to special options */ { INDEX_OPT_MORE_HELP, /* more-help option index */ INDEX_OPT_SAVE_OPTS, /* save option index */ NO_EQUIVALENT, /* '-#' option index */ NO_EQUIVALENT /* index of default opt */ }, 14 /* full option count */, 9 /* user option count */, ntpq_full_usage, ntpq_short_usage, NULL, NULL, PKGDATADIR, ntpq_packager_info }; /* * Create the static procedure(s) declared above. */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { (void)pOptions; USAGE(NTPQ_EXIT_SUCCESS); } #if ! defined(TEST_NTPQ_OPTS) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * For the set-debug-level option. */ static void doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc) { /* extracted from debug-opt.def, line 27 */ DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); } #endif /* defined(TEST_NTPQ_OPTS) */ /* extracted from optmain.tlib near line 128 */ #if defined(TEST_NTPQ_OPTS) /* TEST MAIN PROCEDURE: */ extern void optionPutShell(tOptions*); int main(int argc, char ** argv) { int res = NTPQ_EXIT_SUCCESS; (void)optionProcess(&ntpqOptions, argc, argv); optionPutShell(&ntpqOptions); res = ferror(stdout); if (res != 0) fputs("output error writing to stdout\n", stderr); return res; } #endif /* defined TEST_NTPQ_OPTS */ /* extracted from optcode.tlib near line 666 */ #if ENABLE_NLS #include #include #include #include #include static char* AO_gettext(char const* pz); static void coerce_it(void** s); static char* AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) return NULL; pzRes = _(pz); if (pzRes == pz) return pzRes; pzRes = strdup(pzRes); if (pzRes == NULL) { fputs(_("No memory for duping translated strings\n"), stderr); exit(NTPQ_EXIT_FAILURE); } return pzRes; } static void coerce_it(void** s) { *s = AO_gettext(*s); } /* * This invokes the translation code (e.g. gettext(3)). */ static void translate_option_strings(void) { tOptions * const pOpt = &ntpqOptions; /* * Guard against re-translation. It won't work. The strings will have * been changed by the first pass through this code. One shot only. */ if (option_usage_text.field_ct != 0) { /* * Do the translations. The first pointer follows the field count * field. The field count field is the size of a pointer. */ tOptDesc * pOD = pOpt->pOptDesc; char ** ppz = (char**)(void*)&(option_usage_text); int ix = option_usage_text.field_ct; do { ppz++; *ppz = AO_gettext(*ppz); } while (--ix > 0); coerce_it((void*)&(pOpt->pzCopyright)); coerce_it((void*)&(pOpt->pzCopyNotice)); coerce_it((void*)&(pOpt->pzFullVersion)); coerce_it((void*)&(pOpt->pzUsageTitle)); coerce_it((void*)&(pOpt->pzExplain)); coerce_it((void*)&(pOpt->pzDetail)); coerce_it((void*)&(pOpt->pzPackager)); option_usage_text.field_ct = 0; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) coerce_it((void*)&(pOD->pzText)); } if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) { tOptDesc * pOD = pOpt->pOptDesc; int ix; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) { coerce_it((void*)&(pOD->pz_Name)); coerce_it((void*)&(pOD->pz_DisableName)); coerce_it((void*)&(pOD->pz_DisablePfx)); } /* prevent re-translation */ ntpqOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT; } } #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif /* ntpq-opts.c ends here */ ntp-4.2.6p5/ntpq/ntpq.10000644000175000017500000002643211675460613013657 0ustar peterpeter.TH NTPQ 1 2011-12-24 "( 4.2.6p5)" "Programmer's Manual" .\" EDIT THIS FILE WITH CAUTION (ntpq.1) .\" .\" It has been AutoGen-ed December 24, 2011 at 06:34:35 PM by AutoGen 5.12 .\" From the definitions ntpq-opts.def .\" and the template file agman1.tpl .\" .SH NAME ntpq \- standard NTP query program .SH SYNOPSIS .B ntpq .\" Mixture of short (flag) options and long options .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..." .br .in +8 [ host ...] .SH "DESCRIPTION" This manual page briefly documents the \fBntpq\fP command. The [= prog-name =] utility program is used to query NTP servers which implement the standard NTP mode 6 control message formats defined in Appendix B of the NTPv3 specification RFC1305, requesting information about current state and/or changes in that state. The same formats are used in NTPv4, although some of the variables have changed and new ones added. The description on this page is for the NTPv4 variables. The program may be run either in interactive mode or controlled using command line arguments. Requests to read and write arbitrary variables can be assembled, with raw and pretty-printed output options being available. The [= prog-name =] utility can also obtain and print a list of peers in a common format by sending multiple queries to the server. If one or more request options is included on the command line when [= prog-name =] is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, [= prog-name =] will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. The [= prog-name =] utility will prompt for commands if the standard input is a terminal device. The [= prog-name =] utility uses NTP mode 6 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. The [= prog-name =] utility makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time. Specifying a command line option other than .Fl i or .Fl n will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, [= prog-name =] will attempt to read interactive format commands from the standard input. .Ss "Internal Commands" Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to uniquely identify the command need be typed. A number of interactive format commands are executed entirely within the [= prog-name =] utility itself and do not result in NTP mode 6 requests being sent to a server. These are described following. .sp .IR "? [command_keyword]" .sp 1x help [command_keyword] A .Ql \&? by itself will print a list of all the command keywords known to this incarnation of [= prog-name =] . A .Ql \&? followed by a command keyword will print function and usage information about the command. This command is probably a better source of information about [= prog-name =] than this manual page. .sp .IR "addvars" .Ar variable_name [=value] ... .Xc .sp .IR "rmvars variable_name ..." .sp .IR "clearvars" The data carried by NTP mode 6 messages consists of a list of items of the form .Ql variable_name=value , where the .Ql =value is ignored, and can be omitted, in requests to the server to read variables. The [= prog-name =] utility maintains an internal list in which data to be included in control messages can be assembled, and sent using the .Ic readlist and .Ic writelist commands described below. The .Ic addvars command allows variables and their optional values to be added to the list. If more than one variable is to be added, the list should be comma-separated and not contain white space. The .Ic rmvars command can be used to remove individual variables from the list, while the .Ic clearlist command removes all variables from the list. .sp .IR "authenticate [ yes | no ]" Normally [= prog-name =] does not authenticate requests unless they are write requests. The command .Ql authenticate yes causes [= prog-name =] to send authentication with all requests it makes. Authenticated requests causes some servers to handle requests slightly differently, and can occasionally melt the CPU in fuzzballs if you turn authentication on before doing a .Ic peer display. The command .Ql authenticate causes [= prog-name =] to display whether or not [= prog-name =] is currently autheinticating requests. .sp .IR "cooked" Causes output from query commands to be "cooked", so that variables which are recognized by [= prog-name =] will have their values reformatted for human consumption. Variables which [= prog-name =] thinks should have a decodable value but didn't are marked with a trailing .Ql \&? . .@item debug [ .Cm more | .Cm less | .Cm off ] .Xc With no argument, displays the current debug level. Otherwise, the debug level is changed to the indicated level. .sp .IR "delay milliseconds" Specify a time interval to be added to timestamps included in requests which require authentication. This is used to enable (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized. Actually the server does not now require timestamps in authenticated requests, so this command may be obsolete. .sp .IR "host hostname" Set the host to which future queries will be sent. Hostname may be either a host name or a numeric address. .sp .IR "hostnames Cm yes | Cm no" If .Cm yes is specified, host names are printed in information displays. If .Cm no is specified, numeric addresses are printed instead. The default is .Cm yes , unless modified using the command line .Fl n switch. .sp .IR "keyid keyid" This command allows the specification of a key number to be used to authenticate configuration requests. This must correspond to a key number the server has been configured to use for this purpose. .sp .IR "ntpversion [" .Cm 1 | .Cm 2 | .Cm 3 | .Cm 4 ] .Xc Sets the NTP version number which [= prog-name =] claims in packets. Defaults to 3, Note that mode 6 control messages (and modes, for that matter) didn't exist in NTP version 1. There appear to be no servers left which demand version 1. With no argument, displays the current NTP version that will be used when communicating with servers. .sp .IR "quit" Exit [= prog-name =] . .sp .IR "passwd" This command prompts you to type in a password (which will not be echoed) which will be used to authenticate configuration requests. The password must correspond to the key configured for use by the NTP server for this purpose if such requests are to be successful. .sp .IR "raw" Causes all output from query commands is printed as received from the remote server. The only formating/interpretation done on the data is to transform nonascii data into a printable (but barely understandable) form. .sp .IR "timeout Ar milliseconds" Specify a timeout period for responses to server queries. The default is about 5000 milliseconds. Note that since [= prog-name =] retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set. .br .SH OPTIONS .TP .BR \-4 ", " \--ipv4 Force IPv4 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. .TP .BR \-6 ", " \--ipv6 Force IPv6 DNS name resolution. This option must not appear in combination with any of the following options: ipv4. .sp Force DNS resolution of following host names on the command line to the IPv6 namespace. .TP .BR \-c " \fIcmd\fP, " \--command "=" \fIcmd\fP run a command and exit. This option may appear an unlimited number of times. .sp The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). .TP .BR \-d ", " \--debug-level Increase output debug message level. This option may appear an unlimited number of times. .sp Increase the debugging message output level. .TP .BR \-D " \fIstring\fP, " \--set-debug-level "=" \fIstring\fP Set the output debug message level. This option may appear an unlimited number of times. .sp Set the output debugging level. Can be supplied multiple times, but each overrides the previous value(s). .TP .BR \-p ", " \--peers Print a list of the peers. This option must not appear in combination with any of the following options: interactive. .sp Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'peers' interactive command. .TP .BR \-i ", " \--interactive Force ntpq to operate in interactive mode. This option must not appear in combination with any of the following options: command, peers. .sp Force ntpq to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input. .TP .BR \-n ", " \--numeric numeric host addresses. .sp Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names. .TP .BR \--old-rv Always output status line with readvar. .sp By default, ntpq now suppresses the associd=... line that precedes the output of "readvar" (alias "rv") when a single variable is requested, such as ntpq \-c "rv 0 offset". This option causes ntpq to include both lines of output for a single-variable readvar. Using an environment variable to preset this option in a script will enable both older and newer ntpq to behave identically in this regard. .TP .BR \-? , " \--help" Display extended usage information and exit. .TP .BR \-! , " \--more-help" Extended usage information passed thru pager. .TP .BR \-> " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]" Save the option state to \fIrcfile\fP. The default is the \fIlast\fP configuration file listed in the \fBOPTION PRESETS\fP section, below. .TP .BR \-< " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts" Load options from \fIrcfile\fP. The \fIno-load-opts\fP form will disable the loading of earlier RC/INI files. \fI--no-load-opts\fP is handled early, out of order. .TP .BR \- " [{\fIv|c|n\fP}]," " \--version" "[=\fI{v|c|n}\fP]" 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. .SH OPTION PRESETS Any option that is not marked as \fInot presettable\fP may be preset by loading values from configuration ("RC" or ".INI") file(s) and values from environment variables named: .nf \fBNTPQ_\fP or \fBNTPQ\fP .fi .ad The environmental presets take precedence (are processed later than) the configuration files. The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". If any of these are directories, then the file \fI.ntprc\fP is searched for within those directories. .SH AUTHOR David L. Mills and/or others .br Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org .PP .nf .na see html/copyright.html .fi .ad .PP This manual page was \fIAutoGen\fP-erated from the \fBntpq\fP option definitions. ntp-4.2.6p5/ntpq/libntpq.c0000644000175000017500000004777011636775106014443 0ustar peterpeter/***************************************************************************** * * libntpq.c * * This is the wrapper library for ntpq, the NTP query utility. * This library reuses the sourcecode from ntpq and exports a number * of useful functions in a library that can be linked against applications * that need to query the status of a running ntpd. The whole * communcation is based on mode 6 packets. * ****************************************************************************/ #define LIBNTPQ_C #define NO_MAIN_ALLOWED 1 /* #define BUILD_AS_LIB Already provided by the Makefile */ #include "ntpq.c" #include "libntpq.h" /* Function Prototypes */ const char *Version = "libntpq 0.3beta"; /* global variables used for holding snapshots of data */ char peervars[NTPQ_BUFLEN]; int peervarlen = 0; associd_t peervar_assoc = 0; char clockvars[NTPQ_BUFLEN]; int clockvarlen = 0; int clockvar_assoc = 0; char sysvars[NTPQ_BUFLEN]; int sysvarlen = 0; char *ntpq_resultbuffer[NTPQ_BUFLEN]; unsigned short ntpq_associations[MAXASSOC]; struct ntpq_varlist ntpq_varlist[MAXLIST]; /***************************************************************************** * * ntpq_stripquotes * * Parses a given character buffer srcbuf and removes all quoted * characters. The resulting string is copied to the specified * resultbuf character buffer. E.g. \" will be translated into " * **************************************************************************** * Parameters: * resultbuf char* The resulting string without quoted * characters * srcbuf char* The buffer holding the original string * datalen int The number of bytes stored in srcbuf * maxlen int Max. number of bytes for resultbuf * * Returns: * int number of chars that have been copied to * resultbuf ****************************************************************************/ int ntpq_stripquotes ( char *resultbuf, char *srcbuf, int datalen, int maxlen ) { char* tmpbuf = srcbuf; while ( *tmpbuf != 0 ) { if ( *tmpbuf == '\"' ) { tmpbuf++; continue; } if ( *tmpbuf == '\\' ) { tmpbuf++; switch ( *tmpbuf ) { /* ignore if end of string */ case 0: continue; /* skip and do not copy */ case '\"': /* quotes */ case 'n': /*newline*/ case 'r': /*carriage return*/ case 'g': /*bell*/ case 't': /*tab*/ tmpbuf++; continue; } } *resultbuf++ = *tmpbuf++; } *resultbuf = 0; return strlen(resultbuf); } /***************************************************************************** * * ntpq_getvar * * This function parses a given buffer for a variable/value pair and * copies the value of the requested variable into the specified * varvalue buffer. * * It returns the number of bytes copied or zero for an empty result * (=no matching variable found or empty value) * **************************************************************************** * Parameters: * resultbuf char* The resulting string without quoted * characters * datalen size_t The number of bytes stored in * resultbuf * varname char* Name of the required variable * varvalue char* Where the value of the variable should * be stored * maxlen size_t Max. number of bytes for varvalue * * Returns: * size_t number of chars that have been copied to * varvalue ****************************************************************************/ size_t ntpq_getvar( const char * resultbuf, size_t datalen, const char * varname, char * varvalue, size_t maxlen) { char * name; char * value; int idatalen; value = NULL; idatalen = (int)datalen; while (nextvar(&idatalen, &resultbuf, &name, &value)) { if (strcmp(varname, name) == 0) { ntpq_stripquotes(varvalue, value, strlen(value), maxlen); return strlen(varvalue); } } return 0; } /***************************************************************************** * * ntpq_queryhost * * Sends a mode 6 query packet to the current open host (see * ntpq_openhost) and stores the requested variable set in the specified * character buffer. * It returns the number of bytes read or zero for an empty result * (=no answer or empty value) * **************************************************************************** * Parameters: * VARSET u_short Which variable set should be * read (PEERVARS or CLOCKVARS) * association int The association ID that should be read * 0 represents the ntpd instance itself * resultbuf char* The resulting string without quoted * characters * maxlen int Max. number of bytes for varvalue * * Returns: * int number of bytes that have been copied to * resultbuf * - OR - * 0 (zero) if no reply has been received or * another failure occured ****************************************************************************/ int ntpq_queryhost(unsigned short VARSET, unsigned short association, char *resultbuf, int maxlen) { const char *datap; int res; int dsize; u_short rstatus; if ( numhosts > 0 ) res = doquery(VARSET,association,0,0, (char *)0, &rstatus, &dsize, &datap); else return 0; if ( ( res != 0) || ( dsize == 0 ) ) /* no data */ return 0; if ( dsize > maxlen) dsize = maxlen; /* fill result resultbuf */ memcpy(resultbuf, datap, dsize); return dsize; } /***************************************************************************** * * ntpq_openhost * * Sets up a connection to the ntpd instance of a specified host. Note: * There is no real "connection" established because NTP solely works * based on UDP. * **************************************************************************** * Parameters: * hostname char* Hostname/IP of the host running ntpd * * Returns: * int 1 if the host connection could be set up, i.e. * name resolution was succesful and/or IP address * has been validated * - OR - * 0 (zero) if a failure occured ****************************************************************************/ int ntpq_openhost(char *hostname) { if ( openhost(hostname) ) { numhosts = 1; } else { numhosts = 0; } return numhosts; } /***************************************************************************** * * ntpq_closehost * * Cleans up a connection by closing the used socket. Should be called * when no further queries are required for the currently used host. * **************************************************************************** * Parameters: * - none - * * Returns: * int 0 (zero) if no host has been opened before * - OR - * the resultcode from the closesocket function call ****************************************************************************/ int ntpq_closehost(void) { if ( numhosts ) return closesocket(sockfd); return 0; } /***************************************************************************** * * ntpq_read_associations * * This function queries the ntp host for its associations and returns the * number of associations found. * * It takes an u_short array as its first parameter, this array holds the * IDs of the associations, * the function will not write more entries than specified with the * max_entries parameter. * * However, if more than max_entries associations were found, the return * value of this function will reflect the real number, even if not all * associations have been stored in the array. * **************************************************************************** * Parameters: * resultbuf u_short*Array that should hold the list of * association IDs * maxentries int maximum number of association IDs that can * be stored in resultbuf * * Returns: * int number of association IDs stored in resultbuf * - OR - * 0 (zero) if a failure occured or no association has * been returned. ****************************************************************************/ int ntpq_read_associations ( u_short resultbuf[], int max_entries ) { int i = 0; if (ntpq_dogetassoc()) { if(numassoc < max_entries) max_entries = numassoc; for (i=0;i 1) fprintf(stderr, "server=%s ", currenthost); fprintf(stderr, "***No information returned for association %d\n", associd); return 0; } if (dsize > maxsize) dsize = maxsize; memcpy(resultbuf, datap, dsize); return dsize; } /***************************************************************************** * * ntpq_read_sysvars * * This function reads the sysvars variable-set from a NTP host and writes it * to the result buffer specified, honoring the maxsize limit. * * It returns the number of bytes written or 0 when the variable-set is empty * or could not be read. * **************************************************************************** * Parameters: * resultbuf char* character buffer where the variable set * should be stored * maxsize int the maximum number of bytes that can be * written to resultbuf * * Returns: * int number of chars that have been copied to * resultbuf * - OR - * 0 (zero) if an error occured ****************************************************************************/ size_t ntpq_read_sysvars( char * resultbuf, size_t maxsize ) { const char * datap; int res; int i_dsize; size_t dsize; u_short rstatus; res = doquery(CTL_OP_READVAR, 0, 0, 0, NULL, &rstatus, &i_dsize, &datap); if (res != 0) return 0; if (i_dsize == 0) { if (numhosts > 1) fprintf(stderr, "server=%s ", currenthost); fprintf(stderr, "***No sysvar information returned\n"); return 0; } else { dsize = max(0, i_dsize); dsize = min(dsize, maxsize); memcpy(resultbuf, datap, dsize); } return dsize; } /***************************************************************************** * ntpq_get_assoc_allvars * * With this function all association variables for the specified association * ID can be requested from a NTP host. They are stored internally and can be * read by using the ntpq_get_peervar or ntpq_get_clockvar functions. * * Basically this is only a combination of the ntpq_get_assoc_peervars and * ntpq_get_assoc_clockvars functions. * * It returns 1 if both variable-sets (peervars and clockvars) were * received successfully. If one variable-set or both of them weren't * received, * **************************************************************************** * Parameters: * associd int requested associaton ID * * Returns: * int nonzero if at least one variable set could be read * - OR - * 0 (zero) if an error occured and both variable sets * could not be read ****************************************************************************/ int ntpq_get_assoc_allvars( associd_t associd ) { return ntpq_get_assoc_peervars ( associd ) & ntpq_get_assoc_clockvars( associd ); } /***************************************************************************** * * ntpq_get_sysvars * * The system variables of a NTP host can be requested by using this function * and afterwards using ntpq_get_sysvar to read the single variable values. * **************************************************************************** * Parameters: * - none - * * Returns: * int nonzero if the variable set could be read * - OR - * 0 (zero) if an error occured and the sysvars * could not be read ****************************************************************************/ int ntpq_get_sysvars(void) { sysvarlen = ntpq_read_sysvars(sysvars, sizeof(sysvars)); if (sysvarlen <= 0) return 0; else return 1; } /***************************************************************************** * * ntp_get_peervar * * This function uses the variable-set which was read by using * ntp_get_peervars and searches for a variable specified with varname. If * such a variable exists, it writes its value into * varvalue (maxlen specifies the size of this target buffer). * **************************************************************************** * Parameters: * varname char* requested variable name * varvalue char* the buffer where the value should go into * maxlen int maximum number of bytes that can be copied to * varvalue * * Returns: * int number of bytes copied to varvalue * - OR - * 0 (zero) if an error occured or the variable could * not be found ****************************************************************************/ int ntpq_get_peervar( const char *varname, char *varvalue, int maxlen) { return ( ntpq_getvar(peervars,peervarlen,varname,varvalue,maxlen) ); } /***************************************************************************** * * ntpq_get_assoc_peervars * * This function requests the peer variables of the specified association * from a NTP host. In order to access the variable values, the function * ntpq_get_peervar must be used. * **************************************************************************** * Parameters: * associd int requested associaton ID * * Returns: * int 1 (one) if the peervars have been read * - OR - * 0 (zero) if an error occured and the variable set * could not be read ****************************************************************************/ int ntpq_get_assoc_peervars( associd_t associd ) { peervarlen = ntpq_read_assoc_peervars(associd, peervars, sizeof(peervars)); if (peervarlen <= 0) { peervar_assoc = 0; return 0; } peervar_assoc = associd; return 1; } /***************************************************************************** * * ntp_read_assoc_clockvars * * This function reads the clockvars variable-set of a specified association * from a NTP host and writes it to the result buffer specified, honoring * the maxsize limit. * * It returns the number of bytes written or 0 when the variable-set is * empty or failed to read. * **************************************************************************** * Parameters: * associd int requested associaton ID * resultbuf char* character buffer where the variable set * should be stored * maxsize int the maximum number of bytes that can be * written to resultbuf * * Returns: * int number of chars that have been copied to * resultbuf * - OR - * 0 (zero) if an error occured ****************************************************************************/ int ntpq_read_assoc_clockvars( associd_t associd, char * resultbuf, int maxsize ) { const char *datap; int res; int dsize; u_short rstatus; res = ntpq_doquerylist(ntpq_varlist, CTL_OP_READCLOCK, associd, 0, &rstatus, &dsize, &datap); if (res != 0) return 0; if (dsize == 0) { if (numhosts > 1) /* no information returned from server */ return 0; } else { if (dsize > maxsize) dsize = maxsize; memcpy(resultbuf, datap, dsize); } return dsize; } /***************************************************************************** * * ntpq_get_assoc_clocktype * * This function returns a clocktype value for a given association number * (not ID!): * * NTP_CLOCKTYPE_UNKNOWN Unknown clock type * NTP_CLOCKTYPE_BROADCAST Broadcast server * NTP_CLOCKTYPE_LOCAL Local clock * NTP_CLOCKTYPE_UNICAST Unicast server * NTP_CLOCKTYPE_MULTICAST Multicast server * ****************************************************************************/ int ntpq_get_assoc_clocktype( int assoc_index ) { associd_t associd; int i; int rc; sockaddr_u dum_store; char dstadr[LENHOSTNAME]; char resultbuf[NTPQ_BUFLEN]; if (assoc_index < 0 || assoc_index >= numassoc) return -1; associd = assoc_cache[assoc_index].assid; if (associd == peervar_assoc) { rc = ntpq_get_peervar("dstadr", dstadr, sizeof(dstadr)); } else { i = ntpq_read_assoc_peervars(associd, resultbuf, sizeof(resultbuf)); if (i <= 0) return -1; rc = ntpq_getvar(resultbuf, i, "dstadr", dstadr, sizeof(dstadr)); } if (0 != rc && decodenetnum(dstadr, &dum_store)) return ntpq_decodeaddrtype(&dum_store); return -1; } /***************************************************************************** * * ntpq_get_assoc_clockvars * * With this function the clock variables of the specified association are * requested from a NTP host. This makes only sense for associations with * the type 'l' (Local Clock) and you should check this with * ntpq_get_assoc_clocktype for each association, before you use this function * on it. * **************************************************************************** * Parameters: * associd int requested associaton ID * * Returns: * int 1 (one) if the clockvars have been read * - OR - * 0 (zero) if an error occured and the variable set * could not be read ****************************************************************************/ int ntpq_get_assoc_clockvars( associd_t associd ) { if (NTP_CLOCKTYPE_LOCAL != ntpq_get_assoc_clocktype( ntpq_get_assoc_number(associd))) return 0; clockvarlen = ntpq_read_assoc_clockvars( associd, clockvars, sizeof(clockvars) ); if ( clockvarlen <= 0 ) { clockvar_assoc = 0; return 0; } else { clockvar_assoc = associd; return 1; } } ntp-4.2.6p5/dot.emacs0000644000175000017500000000101111307651604013405 0ustar peterpeter;; This is how Dave Mills likes to see the NTP code formatted. (defconst ntp-c-style '((c-basic-offset . 8) (fill-column . 72) (c-offsets-alist . ((arglist-intro . +) (case-label . *) (statement-case-intro . *) (statement-cont . *) (substatement-open . 0)))) "David L. Mills; NTP code indentation style") (defun ntp-c-mode-common-hook () ;; add ntp c style (c-add-style "ntp" ntp-c-style nil)) (add-hook 'c-mode-common-hook 'ntp-c-mode-common-hook) ;; 1997112600 ntp-4.2.6p5/conf/0000755000175000017500000000000011675461367012556 5ustar peterpeterntp-4.2.6p5/conf/beauregard.conf0000644000175000017500000000141211307651605015510 0ustar peterpeter# # NTP configuration file (ntp.conf) # beauregard.udel.edu # server 127.127.18.1 # NIST ACTS modem driver fudge 127.127.18.1 time1 .0035 phone atdt913034944774 atdt913034944785 atdt913034944774 #phone atdt913034944812 atdt913034948497 atdt913034948022 # # Miscellaneous stuff # driftfile /etc/ntp.drift # path for drift file statsdir /beauregard/ntpstats/ # directory for statistics files filegen peerstats file peerstats type day enable filegen loopstats file loopstats type day enable filegen clockstats file clockstats type day enable # # Authentication stuff # keys /usr/local/etc/ntp.keys # path for keys file trustedkey 3 4 5 6 14 15 # define trusted keys requestkey 15 # key (7) for accessing server variables controlkey 15 # key (6) for accessing server variables ntp-4.2.6p5/conf/pogo.conf0000644000175000017500000000256210017034523014351 0ustar peterpeter# # NTP configuration file (ntp.conf) # SunOS pogo.udel.edu 5.8 Generic sun4u sparc SUNW,Ultra-1 # server 127.127.6.1 prefer # IRIG from GPS1 fudge 127.127.6.1 refid GPS1 time1 -.002777 flag2 1 server 127.127.4.1 # spectracom GPS receiver # delays: prop 0.0088 ant .0002 rcvr .0173 = 26.3 ms; os .0035 fudge 127.127.4.1 refid GPS2 time1 .000221 server 127.127.22.0 # PPS from GPS2 fudge 127.127.22.0 flag3 1 # kernel PPS # # Backups # server 128.4.1.2 # mizbeaver server 128.175.60.175 version 3 # ntp1.nss # # Services # manycastclient 239.1.1.1 autokey maxpoll 12 ttl 7 manycastserver 239.1.1.1 # # Access control stuff # restrict default noserve # default deny restrict 127.0.0.1 # allow local host restrict 128.4.0.0 mask 255.255.0.0 # allow DCnet clients restrict 128.175.0.0 mask 255.255.0.0 # allow UDel clients restrict 140.173.0.0 mask 255.255.0.0 # allow DARTnet/CAIRN clients # # Authentication stuff # crypto # enable public key keys /usr/local/etc/ntp.keys # path for keys file trustedkey 3 4 5 14 # define trusted keys requestkey 14 # key (7) for accessing server variables controlkey 14 # key (6) for accessing server variables # # Miscellaneous stuff # driftfile /etc/ntp.drift # path for drift file statsdir /var/spool/ntpstats/ # directory for statistics files filegen loopstats file loopstats type day enable filegen cryptostats file cryptostats type day enable ntp-4.2.6p5/conf/malarky.conf0000644000175000017500000000145310017034523015043 0ustar peterpeter# # NTP configuration file (ntp.conf) # # This is for a broadcast/multicast client. Except for the statistics # stuff, this can be done with only a commmand line of the form # # /usr/local/bin/ntpd -a -k /usr/local/bin/ntp.keys -m -t 3 # multicastclient # listen on default 224.0.1.1 # # Miscellaneous stuff # driftfile /etc/ntp.drift # path for drift file statsdir /malarky/ntpstats/ # directory for statistics files filegen peerstats file peerstats type day enable filegen loopstats file loopstats type day enable filegen clockstats file clockstats type day enable # # Authentication stuff # keys /usr/local/etc/ntp.keys # path for key file trustedkey 3 4 5 6 14 # define trusted keys requestkey 14 # key (7) for accessing server variables controlkey 14 # key (6) for accessing server variables ntp-4.2.6p5/conf/grundoon.conf0000644000175000017500000000224410017034522015234 0ustar peterpeter# # NTP configuration file (ntp.conf) # grundoon.udel.edu # server 127.127.11.1 prefer # Arbiter 1088 GPS receiver fudge 127.127.11.1 time1 .00487 flag1 1 flag4 1 server 127.127.22.1 minpoll 4 # PPS quick poll fudge 127.127.22.1 # default use PLL/FLL loop broadcast 128.4.2.255 key 5 # brpadcast on LAN shared key broadcast 239.1.1.2 autokey # multicast on WAN autokey manycastclient 239.1.1.1 autokey maxpoll 12 ttl 7 manycastserver 239.1.1.1 # # Access control stuff # restrict default noserve # default deny restrict 127.0.0.1 # allow local host restrict 128.4.0.0 mask 255.255.0.0 # allow DCnet clients restrict 128.175.0.0 mask 255.255.0.0 # allow UDel clients restrict 140.173.0.0 mask 255.255.0.0 # allow DARTnet/CAIRN clients # # Authentication stuff # crypto # enable public key keys /usr/local/etc/ntp.keys # path for keys file trustedkey 3 4 5 14 # define trusted keys requestkey 14 # key (7) for accessing server variables controlkey 14 # key (6) for accessing server variables # # Miscellaneous stuff # driftfile /etc/ntp.drift # path for drift file statsdir /var/spool/ntpstats/ # directory for statistics files filegen loopstats file loopstats type day enable ntp-4.2.6p5/conf/rackety.conf0000644000175000017500000000421510017034523015044 0ustar peterpeter# # NTP configuration file (ntp.conf) # SunOS rackety.u 4.1.3 243 sun4c # # This is for a dedicated primary server connected to four reference # clocks and providing service via multicast, broadcast, manycast and # the usual suspects. It blocks previous versions and limits clients # per network to two and returnd a kiss-of-death packet if the # sender is blocked. Note that the precise fudge factors were # determined using the calibrate feature and that the kernel PPS # discipline is selected. # server 127.127.4.0 prefer # Spectracom GPS receiver #1 fudge 127.127.4.0 refid GPS1 time1 -.000097 flag1 1 server 127.127.4.1 # Spectracom GPS receiver #2 fudge 127.127.4.1 refid GPS2 time1 -.000097 flag1 1 server 127.127.4.2 # Spectracom WWVB receiver #1 # delays: prop 0.0088 ant .0002 rcvr .0173 = 26.3 ms; os .0035 fudge 127.127.4.2 refid WVB1 time1 .0021 flag4 1 flag1 1 server 127.127.4.3 # Spectracom WWVB receiver #2 # delays: prop 0.0088 ant .0002 rcvr .0173 = 26.3 ms; os .0035 fudge 127.127.4.3 refid WVB2 time1 .0021 flag4 1 flag1 1 server 127.127.22.1 # PPS fudge 127.127.22.1 flag3 1 # kernel PPS # # Services # broadcast 224.0.1.1 autokey # multicast broadcast 128.4.1.255 autokey # local subnet broadcast manycastclient 239.1.1.1 autokey maxpoll 12 ttl 7 # manycast manycastserver 239.1.1.1 # manycast # # Access controls # restrict default limited version kod # default limit clients per net restrict 127.0.0.1 # allow local host restrict 128.4.0.0 mask 255.255.0.0 # allow DCnet clients restrict 128.175.0.0 mask 255.255.0.0 # allow UDELnet clients restrict 140.173.0.0 mask 255.255.0.0 # allow DARTnet/CAIRN clients # # Authentication stuff # crypto # enable public key keys /usr/local/etc/ntp.keys # symmetric keys file trustedkey 3 4 5 14 # define trusted keys requestkey 14 # key (7) for accessing server variables controlkey 14 # key (6) for accessing server variables # # Miscellaneous stuff # driftfile /etc/ntp.drift # frequency offset statsdir /rackety/ntpstats/ # directory for statistics files filegen peerstats file peerstats type day enable filegen loopstats file loopstats type day enable filegen clockstats file clockstats type day enable ntp-4.2.6p5/conf/README0000644000175000017500000000134210017034522013410 0ustar peterpeterREADME file for directory ./conf of the NTP Version 4 distribution This directory contains example run-time configuration files for the NTP Version 4 daemon ntpd. These files illustrate some of the more obtuse configurations you may run into. They are not likely to do anything good if run on machines other than their native spot, so don't just blindly copy something and put it up. Additional information can be found in the ./doc directory of the base directory. Included also are example public key and symmetric key files produced by the ntp-genkeys program with names prefixed by ntpkey. These are ordinarily kept in /usr/local/etc and used by the Autokey scheme. See the authopt.htm pnd genkeys.htm ages for further information. ntp-4.2.6p5/conf/baldwin.conf0000644000175000017500000000053510017034522015022 0ustar peterpeter# # NTP manycast configuration file (ntp.conf) for DCnet hosts # # Note that the .rnd random seed file must pe in the root # directory and the public and private keys in /usr/local/etc. # manycastclient 239.1.1.1 autokey maxpoll 12 manycastserver 239.1.1.1 crypto randfile /.rnd # enable public key driftfile /etc/ntp.drift # path for drift file ntp-4.2.6p5/ntpdc/0000755000175000017500000000000011675461363012735 5ustar peterpeterntp-4.2.6p5/ntpdc/ntpdc-layout.c0000644000175000017500000000046311675457723015534 0ustar peterpeter/* * ntpdc-layout - print layout of NTP mode 7 request/response packets */ #include #include #include "ntpdc.h" #include "ntp_stdlib.h" #if defined(IMPL_XNTPD_OLD) && IMPL_XNTPD != 3 #error Unexpected IMPL_XNTPD #endif int main(void) { #include "nl.c" return (EXIT_SUCCESS); } ntp-4.2.6p5/ntpdc/ntpdc.h0000644000175000017500000000275511675457723014234 0ustar peterpeter/* * ntpdc.h - definitions of interest to ntpdc */ #include "ntp_fp.h" #include "ntp.h" #include "ntp_request.h" #include "ntp_string.h" #include "ntp_malloc.h" /* * Maximum number of arguments */ #define MAXARGS 4 #define MOREARGS 10 /* * Flags for forming descriptors. */ #define OPT 0x80 /* this argument is optional, or'd with type */ #define NO 0x0 #define NTP_STR 0x1 /* string argument */ #define NTP_UINT 0x2 /* unsigned integer */ #define NTP_INT 0x3 /* signed integer */ #define NTP_ADD 0x4 /* IP network address */ #define IP_VERSION 0x5 /* IP version */ /* * Arguments are returned in a struct - no * union space saving is attempted. */ typedef struct { u_char type; char *string; long ival; u_long uval; sockaddr_u netnum; } arg_v; /* * Structure for passing parsed command line */ struct parse { char *keyword; arg_v argval[MAXARGS + MOREARGS]; int nargs; }; /* * ntpdc includes a command parser which could charitably be called * crude. The following structure is used to define the command * syntax. */ struct xcmd { const char *keyword; /* command key word */ void (*handler) (struct parse *, FILE *); /* command handler */ u_char arg[MAXARGS]; /* descriptors for arguments */ const char *desc[MAXARGS]; /* descriptions for arguments */ const char *comment; }; extern int impl_ver; extern int showhostnames; extern int s_port; extern int doquery (int, int, int, int, int, char *, int *, int *, char **, int, int); extern char * nntohost (sockaddr_u *); ntp-4.2.6p5/ntpdc/ntpdc-opts.h0000644000175000017500000001667011675460570015212 0ustar peterpeter/* * EDIT THIS FILE WITH CAUTION (ntpdc-opts.h) * * It has been AutoGen-ed December 24, 2011 at 06:34:16 PM by AutoGen 5.12 * From the definitions ntpdc-opts.def * and the template file options * * Generated from AutoOpts 35:0:10 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the ntpdc author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * This source file is copyrighted and licensed under the following terms: * * see html/copyright.html * */ /* * This file contains the programmatic interface to the Automated * Options generated for the ntpdc program. * These macros are documented in the AutoGen info file in the * "AutoOpts" chapter. Please refer to that doc for usage help. */ #ifndef AUTOOPTS_NTPDC_OPTS_H_GUARD #define AUTOOPTS_NTPDC_OPTS_H_GUARD 1 #include "config.h" #include /* * Ensure that the library used for compiling this generated header is at * least as new as the version current when the header template was released * (not counting patch version increments). Also ensure that the oldest * tolerable version is at least as old as what was current when the header * template was released. */ #define AO_TEMPLATE_VERSION 143360 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header Choke Me. #endif /* * Enumeration of each option: */ typedef enum { INDEX_OPT_IPV4 = 0, INDEX_OPT_IPV6 = 1, INDEX_OPT_COMMAND = 2, INDEX_OPT_LISTPEERS = 3, INDEX_OPT_PEERS = 4, INDEX_OPT_SHOWPEERS = 5, INDEX_OPT_INTERACTIVE = 6, INDEX_OPT_DEBUG_LEVEL = 7, INDEX_OPT_SET_DEBUG_LEVEL = 8, INDEX_OPT_NUMERIC = 9, INDEX_OPT_VERSION = 10, INDEX_OPT_HELP = 11, INDEX_OPT_MORE_HELP = 12, INDEX_OPT_SAVE_OPTS = 13, INDEX_OPT_LOAD_OPTS = 14 } teOptIndex; #define OPTION_CT 15 #define NTPDC_VERSION "4.2.6p5" #define NTPDC_FULL_VERSION "ntpdc 4.2.6p5" /* * Interface defines for all options. Replace "n" with the UPPER_CASED * option name (as in the teOptIndex enumeration above). * e.g. HAVE_OPT(IPV4) */ #define DESC(n) (ntpdcOptions.pOptDesc[INDEX_OPT_## n]) #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) #define OPT_ARG(n) (DESC(n).optArg.argString) #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) #define COUNT_OPT(n) (DESC(n).optOccCt) #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) #define CLEAR_OPT(n) STMTS( \ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ DESC(n).fOptState |= OPTST_DISABLED; \ DESC(n).optCookie = NULL ) /* * * * * * * * Enumeration of ntpdc exit codes */ typedef enum { NTPDC_EXIT_SUCCESS = 0, NTPDC_EXIT_FAILURE = 1 } ntpdc_exit_code_t; /* * Make sure there are no #define name conflicts with the option names */ #ifndef NO_OPTION_NAME_WARNINGS # ifdef IPV4 # warning undefining IPV4 due to option name conflict # undef IPV4 # endif # ifdef IPV6 # warning undefining IPV6 due to option name conflict # undef IPV6 # endif # ifdef COMMAND # warning undefining COMMAND due to option name conflict # undef COMMAND # endif # ifdef LISTPEERS # warning undefining LISTPEERS due to option name conflict # undef LISTPEERS # endif # ifdef PEERS # warning undefining PEERS due to option name conflict # undef PEERS # endif # ifdef SHOWPEERS # warning undefining SHOWPEERS due to option name conflict # undef SHOWPEERS # endif # ifdef INTERACTIVE # warning undefining INTERACTIVE due to option name conflict # undef INTERACTIVE # endif # ifdef DEBUG_LEVEL # warning undefining DEBUG_LEVEL due to option name conflict # undef DEBUG_LEVEL # endif # ifdef SET_DEBUG_LEVEL # warning undefining SET_DEBUG_LEVEL due to option name conflict # undef SET_DEBUG_LEVEL # endif # ifdef NUMERIC # warning undefining NUMERIC due to option name conflict # undef NUMERIC # endif #else /* NO_OPTION_NAME_WARNINGS */ # undef IPV4 # undef IPV6 # undef COMMAND # undef LISTPEERS # undef PEERS # undef SHOWPEERS # undef INTERACTIVE # undef DEBUG_LEVEL # undef SET_DEBUG_LEVEL # undef NUMERIC #endif /* NO_OPTION_NAME_WARNINGS */ /* * * * * * * * Interface defines for specific options. */ #define VALUE_OPT_IPV4 '4' #define VALUE_OPT_IPV6 '6' #define VALUE_OPT_COMMAND 'c' #define VALUE_OPT_LISTPEERS 'l' #define VALUE_OPT_PEERS 'p' #define VALUE_OPT_SHOWPEERS 's' #define VALUE_OPT_INTERACTIVE 'i' #define VALUE_OPT_DEBUG_LEVEL 'd' #define VALUE_OPT_SET_DEBUG_LEVEL 'D' #define VALUE_OPT_NUMERIC 'n' #define VALUE_OPT_HELP '?' #define VALUE_OPT_MORE_HELP '!' #define VALUE_OPT_VERSION INDEX_OPT_VERSION #define VALUE_OPT_SAVE_OPTS '>' #define VALUE_OPT_LOAD_OPTS '<' #define SET_OPT_SAVE_OPTS(a) STMTS( \ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \ DESC(SAVE_OPTS).fOptState |= OPTST_SET; \ DESC(SAVE_OPTS).optArg.argString = (char const*)(a) ) /* * Interface defines not associated with particular options */ #define ERRSKIP_OPTERR STMTS(ntpdcOptions.fOptSet &= ~OPTPROC_ERRSTOP) #define ERRSTOP_OPTERR STMTS(ntpdcOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_OPT(n) STMTS( \ ntpdcOptions.curOptIdx = (n); \ ntpdcOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) #define USAGE(c) (*ntpdcOptions.pUsageProc)(&ntpdcOptions, c) /* extracted from opthead.tlib near line 451 */ #ifdef __cplusplus extern "C" { #endif /* * * * * * * * Declare the ntpdc option descriptor. */ extern tOptions ntpdcOptions; #if defined(ENABLE_NLS) # ifndef _ # include static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); } # define _(s) aoGetsText(s) # endif /* _() */ # define OPT_NO_XLAT_CFG_NAMES STMTS(ntpdcOptions.fOptSet |= \ OPTPROC_NXLAT_OPT_CFG;) # define OPT_NO_XLAT_OPT_NAMES STMTS(ntpdcOptions.fOptSet |= \ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) # define OPT_XLAT_CFG_NAMES STMTS(ntpdcOptions.fOptSet &= \ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) # define OPT_XLAT_OPT_NAMES STMTS(ntpdcOptions.fOptSet &= \ ~OPTPROC_NXLAT_OPT;) #else /* ENABLE_NLS */ # define OPT_NO_XLAT_CFG_NAMES # define OPT_NO_XLAT_OPT_NAMES # define OPT_XLAT_CFG_NAMES # define OPT_XLAT_OPT_NAMES # ifndef _ # define _(_s) _s # endif #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif #endif /* AUTOOPTS_NTPDC_OPTS_H_GUARD */ /* ntpdc-opts.h ends here */ ntp-4.2.6p5/ntpdc/ntpdc_ops.c0000644000175000017500000022531111675457723015103 0ustar peterpeter/* * ntpdc_ops.c - subroutines which are called to perform operations by * ntpdc */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include "ntpdc.h" #include "ntp_net.h" #include "ntp_control.h" #include "ntp_refclock.h" #include "ntp_stdlib.h" #include #ifdef HAVE_SYS_TIMEX_H # include #endif #if !defined(__bsdi__) && !defined(apollo) #ifdef HAVE_NETINET_IN_H #include #endif #endif #include /* * utility functions */ static int checkitems (int, FILE *); static int checkitemsize (int, int); static int check1item (int, FILE *); /* * Declarations for command handlers in here */ static void peerlist (struct parse *, FILE *); static void peers (struct parse *, FILE *); static void doconfig (struct parse *pcmd, FILE *fp, int mode, int refc); static void dmpeers (struct parse *, FILE *); static void dopeers (struct parse *, FILE *, int); static void printpeer (struct info_peer *, FILE *); static void showpeer (struct parse *, FILE *); static void peerstats (struct parse *, FILE *); static void loopinfo (struct parse *, FILE *); static void sysinfo (struct parse *, FILE *); static void sysstats (struct parse *, FILE *); static void iostats (struct parse *, FILE *); static void memstats (struct parse *, FILE *); static void timerstats (struct parse *, FILE *); static void addpeer (struct parse *, FILE *); static void addserver (struct parse *, FILE *); static void addrefclock (struct parse *, FILE *); static void broadcast (struct parse *, FILE *); static void doconfig (struct parse *, FILE *, int, int); static void unconfig (struct parse *, FILE *); static void set (struct parse *, FILE *); static void sys_clear (struct parse *, FILE *); static void doset (struct parse *, FILE *, int); static void reslist (struct parse *, FILE *); static void new_restrict (struct parse *, FILE *); static void unrestrict (struct parse *, FILE *); static void delrestrict (struct parse *, FILE *); static void do_restrict (struct parse *, FILE *, int); static void monlist (struct parse *, FILE *); static void reset (struct parse *, FILE *); static void preset (struct parse *, FILE *); static void readkeys (struct parse *, FILE *); static void trustkey (struct parse *, FILE *); static void untrustkey (struct parse *, FILE *); static void do_trustkey (struct parse *, FILE *, int); static void authinfo (struct parse *, FILE *); static void traps (struct parse *, FILE *); static void addtrap (struct parse *, FILE *); static void clrtrap (struct parse *, FILE *); static void do_addclr_trap (struct parse *, FILE *, int); static void requestkey (struct parse *, FILE *); static void controlkey (struct parse *, FILE *); static void do_changekey (struct parse *, FILE *, int); static void ctlstats (struct parse *, FILE *); static void clockstat (struct parse *, FILE *); static void fudge (struct parse *, FILE *); static void clkbug (struct parse *, FILE *); static void kerninfo (struct parse *, FILE *); static void get_if_stats (struct parse *, FILE *); static void do_if_reload (struct parse *, FILE *); /* * Commands we understand. Ntpdc imports this. */ struct xcmd opcmds[] = { { "listpeers", peerlist, { OPT|IP_VERSION, NO, NO, NO }, { "-4|-6", "", "", "" }, "display list of peers the server knows about [IP Version]" }, { "peers", peers, { OPT|IP_VERSION, NO, NO, NO }, { "-4|-6", "", "", "" }, "display peer summary information [IP Version]" }, { "dmpeers", dmpeers, { OPT|IP_VERSION, NO, NO, NO }, { "-4|-6", "", "", "" }, "display peer summary info the way Dave Mills likes it (IP Version)" }, { "showpeer", showpeer, { NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD}, { "peer_address", "peer2_addr", "peer3_addr", "peer4_addr" }, "display detailed information for one or more peers" }, { "pstats", peerstats, { NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD }, { "peer_address", "peer2_addr", "peer3_addr", "peer4_addr" }, "display statistical information for one or more peers" }, { "loopinfo", loopinfo, { OPT|NTP_STR, NO, NO, NO }, { "oneline|multiline", "", "", "" }, "display loop filter information" }, { "sysinfo", sysinfo, { NO, NO, NO, NO }, { "", "", "", "" }, "display local server information" }, { "sysstats", sysstats, { NO, NO, NO, NO }, { "", "", "", "" }, "display local server statistics" }, { "memstats", memstats, { NO, NO, NO, NO }, { "", "", "", "" }, "display peer memory usage statistics" }, { "iostats", iostats, { NO, NO, NO, NO }, { "", "", "", "" }, "display I/O subsystem statistics" }, { "timerstats", timerstats, { NO, NO, NO, NO }, { "", "", "", "" }, "display event timer subsystem statistics" }, { "addpeer", addpeer, { NTP_ADD, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR }, { "addr", "keyid", "version", "minpoll#|prefer|burst|iburst|'minpoll N'|'maxpoll N'|'keyid N'|'version N' ..." }, "configure a new peer association" }, { "addserver", addserver, { NTP_ADD, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR }, { "addr", "keyid", "version", "minpoll#|prefer|burst|iburst|'minpoll N'|'maxpoll N'|'keyid N'|'version N' ..." }, "configure a new server" }, { "addrefclock",addrefclock, { NTP_ADD, OPT|NTP_UINT, OPT|NTP_STR, OPT|NTP_STR }, { "addr", "mode", "minpoll|prefer", "minpoll|prefer" }, "configure a new server" }, { "broadcast", broadcast, { NTP_ADD, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR }, { "addr", "keyid", "version", "minpoll" }, "configure broadcasting time service" }, { "unconfig", unconfig, { NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD }, { "peer_address", "peer2_addr", "peer3_addr", "peer4_addr" }, "unconfigure existing peer assocations" }, { "enable", set, { NTP_STR, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR }, { "auth|bclient|monitor|pll|kernel|stats", "...", "...", "..." }, "set a system flag (auth, bclient, monitor, pll, kernel, stats)" }, { "disable", sys_clear, { NTP_STR, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR }, { "auth|bclient|monitor|pll|kernel|stats", "...", "...", "..." }, "clear a system flag (auth, bclient, monitor, pll, kernel, stats)" }, { "reslist", reslist, {OPT|IP_VERSION, NO, NO, NO }, { "-4|-6", "", "", "" }, "display the server's restrict list" }, { "restrict", new_restrict, { NTP_ADD, NTP_ADD, NTP_STR, OPT|NTP_STR }, { "address", "mask", "ntpport|ignore|noserve|notrust|noquery|nomodify|nopeer|version|kod", "..." }, "create restrict entry/add flags to entry" }, { "unrestrict", unrestrict, { NTP_ADD, NTP_ADD, NTP_STR, OPT|NTP_STR }, { "address", "mask", "ntpport|ignore|noserve|notrust|noquery|nomodify|nopeer|version|kod", "..." }, "remove flags from a restrict entry" }, { "delrestrict", delrestrict, { NTP_ADD, NTP_ADD, OPT|NTP_STR, NO }, { "address", "mask", "ntpport", "" }, "delete a restrict entry" }, { "monlist", monlist, { OPT|NTP_INT, NO, NO, NO }, { "version", "", "", "" }, "display data the server's monitor routines have collected" }, { "reset", reset, { NTP_STR, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR }, { "io|sys|mem|timer|auth|allpeers", "...", "...", "..." }, "reset various subsystem statistics counters" }, { "preset", preset, { NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD }, { "peer_address", "peer2_addr", "peer3_addr", "peer4_addr" }, "reset stat counters associated with particular peer(s)" }, { "readkeys", readkeys, { NO, NO, NO, NO }, { "", "", "", "" }, "request a reread of the keys file and re-init of system keys" }, { "trustedkey", trustkey, { NTP_UINT, OPT|NTP_UINT, OPT|NTP_UINT, OPT|NTP_UINT }, { "keyid", "keyid", "keyid", "keyid" }, "add one or more key ID's to the trusted list" }, { "untrustedkey", untrustkey, { NTP_UINT, OPT|NTP_UINT, OPT|NTP_UINT, OPT|NTP_UINT }, { "keyid", "keyid", "keyid", "keyid" }, "remove one or more key ID's from the trusted list" }, { "authinfo", authinfo, { NO, NO, NO, NO }, { "", "", "", "" }, "display the state of the authentication code" }, { "traps", traps, { NO, NO, NO, NO }, { "", "", "", "" }, "display the traps set in the server" }, { "addtrap", addtrap, { NTP_ADD, OPT|NTP_UINT, OPT|NTP_ADD, NO }, { "address", "port", "interface", "" }, "configure a trap in the server" }, { "clrtrap", clrtrap, { NTP_ADD, OPT|NTP_UINT, OPT|NTP_ADD, NO }, { "address", "port", "interface", "" }, "remove a trap (configured or otherwise) from the server" }, { "requestkey", requestkey, { NTP_UINT, NO, NO, NO }, { "keyid", "", "", "" }, "change the keyid the server uses to authenticate requests" }, { "controlkey", controlkey, { NTP_UINT, NO, NO, NO }, { "keyid", "", "", "" }, "change the keyid the server uses to authenticate control messages" }, { "ctlstats", ctlstats, { NO, NO, NO, NO }, { "", "", "", "" }, "display packet count statistics from the control module" }, { "clockstat", clockstat, { NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD }, { "address", "address", "address", "address" }, "display clock status information" }, { "fudge", fudge, { NTP_ADD, NTP_STR, NTP_STR, NO }, { "address", "time1|time2|val1|val2|flags", "value", "" }, "set/change one of a clock's fudge factors" }, { "clkbug", clkbug, { NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD }, { "address", "address", "address", "address" }, "display clock debugging information" }, { "kerninfo", kerninfo, { NO, NO, NO, NO }, { "", "", "", "" }, "display the kernel pll/pps variables" }, { "ifstats", get_if_stats, { NO, NO, NO, NO }, { "", "", "", "" }, "list interface statistics" }, { "ifreload", do_if_reload, { NO, NO, NO, NO }, { "", "", "", "" }, "reload interface configuration" }, { 0, 0, { NO, NO, NO, NO }, { "", "", "", "" }, "" } }; /* * For quick string comparisons */ #define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0) /* * SET_SS_LEN_IF_PRESENT - used by SET_ADDR, SET_ADDRS macros */ #ifdef ISC_PLATFORM_HAVESALEN #define SET_SS_LEN_IF_PRESENT(psau) \ do { \ (psau)->sa.sa_len = SOCKLEN(psau); \ } while (0) #else #define SET_SS_LEN_IF_PRESENT(psau) do { } while (0) #endif /* * SET_ADDR - setup address for v4/v6 as needed */ #define SET_ADDR(address, v6flag, v4addr, v6addr) \ do { \ memset(&(address), 0, sizeof(address)); \ if (v6flag) { \ AF(&(address)) = AF_INET6; \ SOCK_ADDR6(&(address)) = (v6addr); \ } else { \ AF(&(address)) = AF_INET; \ NSRCADR(&(address)) = (v4addr); \ } \ SET_SS_LEN_IF_PRESENT(&(address)); \ } while (0) /* * SET_ADDRS - setup source and destination addresses for * v4/v6 as needed */ #define SET_ADDRS(a1, a2, info, a1prefix, a2prefix) \ do { \ memset(&(a1), 0, sizeof(a1)); \ memset(&(a2), 0, sizeof(a2)); \ if ((info)->v6_flag) { \ AF(&(a1)) = AF_INET6; \ AF(&(a2)) = AF_INET6; \ SOCK_ADDR6(&(a1)) = (info)->a1prefix##6; \ SOCK_ADDR6(&(a2)) = (info)->a2prefix##6; \ } else { \ AF(&(a1)) = AF_INET; \ AF(&(a2)) = AF_INET; \ NSRCADR(&(a1)) = (info)->a1prefix; \ NSRCADR(&(a2)) = (info)->a2prefix; \ } \ SET_SS_LEN_IF_PRESENT(&(a1)); \ SET_SS_LEN_IF_PRESENT(&(a2)); \ } while (0) /* * SET_ADDRS - setup source and destination addresses for * v4/v6 as needed */ #if 0 #define SET_ADDR_MASK(address, addrmask, info) \ do { \ memset(&(address), 0, sizeof(address)); \ memset(&(mask), 0, sizeof(mask)); \ if ((info)->v6_flag) { \ AF(&(address)) = AF_INET6; \ AF(&(addrmask)) = AF_INET6; \ SOCK_ADDR6(&(address)) = (info)->addr6; \ SOCK_ADDR6(&(addrmask)) = (info)->mask6; \ } else { \ AF(&(address)) = AF_INET; \ AF(&(addrmask)) = AF_INET; \ NSRCADR(&(address)) = (info)->addr; \ NSRCADR(&(addrmask)) = (info)->mask; \ } \ SET_SS_LEN_IF_PRESENT(&(address)); \ SET_SS_LEN_IF_PRESENT(&(addrmask)); \ } while (0) #endif /* * checkitems - utility to print a message if no items were returned */ static int checkitems( int items, FILE *fp ) { if (items == 0) { (void) fprintf(fp, "No data returned in response to query\n"); return 0; } return 1; } /* * checkitemsize - utility to print a message if the item size is wrong */ static int checkitemsize( int itemsize, int expected ) { if (itemsize != expected) { (void) fprintf(stderr, "***Incorrect item size returned by remote host (%d should be %d)\n", itemsize, expected); return 0; } return 1; } /* * check1item - check to make sure we have exactly one item */ static int check1item( int items, FILE *fp ) { if (items == 0) { (void) fprintf(fp, "No data returned in response to query\n"); return 0; } if (items > 1) { (void) fprintf(fp, "Expected one item in response, got %d\n", items); return 0; } return 1; } /* * peerlist - get a short list of peers */ /*ARGSUSED*/ static void peerlist( struct parse *pcmd, FILE *fp ) { struct info_peer_list *plist; sockaddr_u paddr; int items; int itemsize; int res; again: res = doquery(impl_ver, REQ_PEER_LIST, 0, 0, 0, (char *)NULL, &items, &itemsize, (void *)&plist, 0, sizeof(struct info_peer_list)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!checkitems(items, fp)) return; if (!checkitemsize(itemsize, sizeof(struct info_peer_list)) && !checkitemsize(itemsize, v4sizeof(struct info_peer_list))) return; while (items > 0) { SET_ADDR(paddr, plist->v6_flag, plist->addr, plist->addr6); if ((pcmd->nargs == 0) || ((pcmd->argval->ival == 6) && (plist->v6_flag != 0)) || ((pcmd->argval->ival == 4) && (plist->v6_flag == 0))) (void) fprintf(fp, "%-9s %s\n", modetoa(plist->hmode), nntohost(&paddr)); plist++; items--; } } /* * peers - show peer summary */ static void peers( struct parse *pcmd, FILE *fp ) { dopeers(pcmd, fp, 0); } /* * dmpeers - show peer summary, Dave Mills style */ static void dmpeers( struct parse *pcmd, FILE *fp ) { dopeers(pcmd, fp, 1); } /* * peers - show peer summary */ /*ARGSUSED*/ static void dopeers( struct parse *pcmd, FILE *fp, int dmstyle ) { struct info_peer_summary *plist; sockaddr_u dstadr; sockaddr_u srcadr; int items; int itemsize; int ntp_poll; int res; int c; l_fp tempts; again: res = doquery(impl_ver, REQ_PEER_LIST_SUM, 0, 0, 0, (char *)NULL, &items, &itemsize, (void *)&plist, 0, sizeof(struct info_peer_summary)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!checkitems(items, fp)) return; if (!checkitemsize(itemsize, sizeof(struct info_peer_summary)) && !checkitemsize(itemsize, v4sizeof(struct info_peer_summary))) return; (void) fprintf(fp, " remote local st poll reach delay offset disp\n"); (void) fprintf(fp, "=======================================================================\n"); while (items > 0) { if (!dmstyle) { if (plist->flags & INFO_FLAG_SYSPEER) c = '*'; else if (plist->hmode == MODE_ACTIVE) c = '+'; else if (plist->hmode == MODE_PASSIVE) c = '-'; else if (plist->hmode == MODE_CLIENT) c = '='; else if (plist->hmode == MODE_BROADCAST) c = '^'; else if (plist->hmode == MODE_BCLIENT) c = '~'; else c = ' '; } else { if (plist->flags & INFO_FLAG_SYSPEER) c = '*'; else if (plist->flags & INFO_FLAG_SHORTLIST) c = '+'; else if (plist->flags & INFO_FLAG_SEL_CANDIDATE) c = '.'; else c = ' '; } NTOHL_FP(&(plist->offset), &tempts); ntp_poll = 1<ppoll, plist->hpoll, NTP_MAXPOLL), NTP_MINPOLL); SET_ADDRS(dstadr, srcadr, plist, dstadr, srcadr); if ((pcmd->nargs == 0) || ((pcmd->argval->ival == 6) && (plist->v6_flag != 0)) || ((pcmd->argval->ival == 4) && (plist->v6_flag == 0))) (void) fprintf(fp, "%c%-15.15s %-15.15s %2u %4d %3o %7.7s %9.9s %7.7s\n", c, nntohost(&srcadr), stoa(&dstadr), plist->stratum, ntp_poll, plist->reach, fptoa(NTOHS_FP(plist->delay), 5), lfptoa(&tempts, 6), ufptoa(NTOHS_FP(plist->dispersion), 5)); plist++; items--; } } /* Convert a refid & stratum (in host order) to a string */ static char* refid_string( u_int32 refid, int stratum ) { if (stratum <= 1) { static char junk[5]; junk[4] = 0; memmove(junk, (char *)&refid, 4); return junk; } return numtoa(refid); } static void print_pflag( FILE *fp, u_int32 flags ) { const char *str; if (flags == 0) { (void) fprintf(fp, " none\n"); } else { str = ""; if (flags & INFO_FLAG_SYSPEER) { (void) fprintf(fp, " system_peer"); str = ","; } if (flags & INFO_FLAG_CONFIG) { (void) fprintf(fp, "%s config", str); str = ","; } if (flags & INFO_FLAG_REFCLOCK) { (void) fprintf(fp, "%s refclock", str); str = ","; } if (flags & INFO_FLAG_AUTHENABLE) { (void) fprintf(fp, "%s auth", str); str = ","; } if (flags & INFO_FLAG_BCLIENT) { (void) fprintf(fp, "%s bclient", str); str = ","; } if (flags & INFO_FLAG_PREFER) { (void) fprintf(fp, "%s prefer", str); str = ","; } if (flags & INFO_FLAG_IBURST) { (void) fprintf(fp, "%s iburst", str); str = ","; } if (flags & INFO_FLAG_BURST) { (void) fprintf(fp, "%s burst", str); } (void) fprintf(fp, "\n"); } } /* * printpeer - print detail information for a peer */ static void printpeer( register struct info_peer *pp, FILE *fp ) { register int i; l_fp tempts; sockaddr_u srcadr, dstadr; SET_ADDRS(dstadr, srcadr, pp, dstadr, srcadr); (void) fprintf(fp, "remote %s, local %s\n", stoa(&srcadr), stoa(&dstadr)); (void) fprintf(fp, "hmode %s, pmode %s, stratum %d, precision %d\n", modetoa(pp->hmode), modetoa(pp->pmode), pp->stratum, pp->precision); (void) fprintf(fp, "leap %c%c, refid [%s], rootdistance %s, rootdispersion %s\n", pp->leap & 0x2 ? '1' : '0', pp->leap & 0x1 ? '1' : '0', refid_string(pp->refid, pp->stratum), fptoa(NTOHS_FP(pp->rootdelay), 5), ufptoa(NTOHS_FP(pp->rootdispersion), 5)); (void) fprintf(fp, "ppoll %d, hpoll %d, keyid %lu, version %d, association %u\n", pp->ppoll, pp->hpoll, (u_long)pp->keyid, pp->version, ntohs(pp->associd)); (void) fprintf(fp, "reach %03o, unreach %d, flash 0x%04x, ", pp->reach, pp->unreach, pp->flash2); (void) fprintf(fp, "boffset %s, ttl/mode %d\n", fptoa(NTOHS_FP(pp->estbdelay), 5), pp->ttl); (void) fprintf(fp, "timer %lds, flags", (long)ntohl(pp->timer)); print_pflag(fp, pp->flags); NTOHL_FP(&pp->reftime, &tempts); (void) fprintf(fp, "reference time: %s\n", prettydate(&tempts)); NTOHL_FP(&pp->org, &tempts); (void) fprintf(fp, "originate timestamp: %s\n", prettydate(&tempts)); NTOHL_FP(&pp->rec, &tempts); (void) fprintf(fp, "receive timestamp: %s\n", prettydate(&tempts)); NTOHL_FP(&pp->xmt, &tempts); (void) fprintf(fp, "transmit timestamp: %s\n", prettydate(&tempts)); (void) fprintf(fp, "filter delay: "); for (i = 0; i < NTP_SHIFT; i++) { (void) fprintf(fp, " %-8.8s", fptoa(NTOHS_FP(pp->filtdelay[i]), 5)); if (i == (NTP_SHIFT>>1)-1) (void) fprintf(fp, "\n "); } (void) fprintf(fp, "\n"); (void) fprintf(fp, "filter offset:"); for (i = 0; i < NTP_SHIFT; i++) { NTOHL_FP(&pp->filtoffset[i], &tempts); (void) fprintf(fp, " %-8.8s", lfptoa(&tempts, 6)); if (i == (NTP_SHIFT>>1)-1) (void) fprintf(fp, "\n "); } (void) fprintf(fp, "\n"); (void) fprintf(fp, "filter order: "); for (i = 0; i < NTP_SHIFT; i++) { (void) fprintf(fp, " %-8d", pp->order[i]); if (i == (NTP_SHIFT>>1)-1) (void) fprintf(fp, "\n "); } (void) fprintf(fp, "\n"); NTOHL_FP(&pp->offset, &tempts); (void) fprintf(fp, "offset %s, delay %s, error bound %s, filter error %s\n", lfptoa(&tempts, 6), fptoa(NTOHS_FP(pp->delay), 5), ufptoa(NTOHS_FP(pp->dispersion), 5), ufptoa(NTOHS_FP(pp->selectdisp), 5)); } /* * showpeer - show detailed information for a peer */ static void showpeer( struct parse *pcmd, FILE *fp ) { struct info_peer *pp; /* 4 is the maximum number of peers which will fit in a packet */ struct info_peer_list *pl, plist[min(MAXARGS, 4)]; int qitemlim; int qitems; int items; int itemsize; int res; int sendsize; again: if (impl_ver == IMPL_XNTPD) sendsize = sizeof(struct info_peer_list); else sendsize = v4sizeof(struct info_peer_list); qitemlim = min(pcmd->nargs, COUNTOF(plist)); for (qitems = 0, pl = plist; qitems < qitemlim; qitems++) { if (IS_IPV4(&pcmd->argval[qitems].netnum)) { pl->addr = NSRCADR(&pcmd->argval[qitems].netnum); if (impl_ver == IMPL_XNTPD) pl->v6_flag = 0; } else { if (impl_ver == IMPL_XNTPD_OLD) { fprintf(stderr, "***Server doesn't understand IPv6 addresses\n"); return; } pl->addr6 = SOCK_ADDR6(&pcmd->argval[qitems].netnum); pl->v6_flag = 1; } pl->port = (u_short)s_port; pl->hmode = pl->flags = 0; pl = (struct info_peer_list *)((char *)pl + sendsize); } res = doquery(impl_ver, REQ_PEER_INFO, 0, qitems, sendsize, (char *)plist, &items, &itemsize, (void *)&pp, 0, sizeof(struct info_peer)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!checkitems(items, fp)) return; if (!checkitemsize(itemsize, sizeof(struct info_peer)) && !checkitemsize(itemsize, v4sizeof(struct info_peer))) return; while (items-- > 0) { printpeer(pp, fp); if (items > 0) (void) fprintf(fp, "\n"); pp++; } } /* * peerstats - return statistics for a peer */ static void peerstats( struct parse *pcmd, FILE *fp ) { struct info_peer_stats *pp; /* 4 is the maximum number of peers which will fit in a packet */ struct info_peer_list *pl, plist[min(MAXARGS, 4)]; sockaddr_u src, dst; int qitemlim; int qitems; int items; int itemsize; int res; int sendsize; again: if (impl_ver == IMPL_XNTPD) sendsize = sizeof(struct info_peer_list); else sendsize = v4sizeof(struct info_peer_list); memset(plist, 0, sizeof(plist)); qitemlim = min(pcmd->nargs, COUNTOF(plist)); for (qitems = 0, pl = plist; qitems < qitemlim; qitems++) { if (IS_IPV4(&pcmd->argval[qitems].netnum)) { pl->addr = NSRCADR(&pcmd->argval[qitems].netnum); if (impl_ver == IMPL_XNTPD) pl->v6_flag = 0; } else { if (impl_ver == IMPL_XNTPD_OLD) { fprintf(stderr, "***Server doesn't understand IPv6 addresses\n"); return; } pl->addr6 = SOCK_ADDR6(&pcmd->argval[qitems].netnum); pl->v6_flag = 1; } pl->port = (u_short)s_port; pl->hmode = plist[qitems].flags = 0; pl = (struct info_peer_list *)((char *)pl + sendsize); } res = doquery(impl_ver, REQ_PEER_STATS, 0, qitems, sendsize, (char *)plist, &items, &itemsize, (void *)&pp, 0, sizeof(struct info_peer_stats)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!checkitems(items, fp)) return; if (!checkitemsize(itemsize, sizeof(struct info_peer_stats)) && !checkitemsize(itemsize, v4sizeof(struct info_peer_stats))) return; while (items-- > 0) { ZERO_SOCK(&dst); ZERO_SOCK(&src); if (pp->v6_flag != 0) { AF(&dst) = AF_INET6; AF(&src) = AF_INET6; SOCK_ADDR6(&dst) = pp->dstadr6; SOCK_ADDR6(&src) = pp->srcadr6; } else { AF(&dst) = AF_INET; AF(&src) = AF_INET; NSRCADR(&dst) = pp->dstadr; NSRCADR(&src) = pp->srcadr; } #ifdef ISC_PLATFORM_HAVESALEN src.sa.sa_len = SOCKLEN(&src); dst.sa.sa_len = SOCKLEN(&dst); #endif fprintf(fp, "remote host: %s\n", nntohost(&src)); fprintf(fp, "local interface: %s\n", stoa(&dst)); fprintf(fp, "time last received: %lus\n", (u_long)ntohl(pp->timereceived)); fprintf(fp, "time until next send: %lus\n", (u_long)ntohl(pp->timetosend)); fprintf(fp, "reachability change: %lus\n", (u_long)ntohl(pp->timereachable)); fprintf(fp, "packets sent: %lu\n", (u_long)ntohl(pp->sent)); fprintf(fp, "packets received: %lu\n", (u_long)ntohl(pp->processed)); fprintf(fp, "bad authentication: %lu\n", (u_long)ntohl(pp->badauth)); fprintf(fp, "bogus origin: %lu\n", (u_long)ntohl(pp->bogusorg)); fprintf(fp, "duplicate: %lu\n", (u_long)ntohl(pp->oldpkt)); fprintf(fp, "bad dispersion: %lu\n", (u_long)ntohl(pp->seldisp)); fprintf(fp, "bad reference time: %lu\n", (u_long)ntohl(pp->selbroken)); fprintf(fp, "candidate order: %u\n", pp->candidate); if (items > 0) fprintf(fp, "\n"); fprintf(fp, "flags: "); print_pflag(fp, ntohs(pp->flags)); pp++; } } /* * loopinfo - show loop filter information */ static void loopinfo( struct parse *pcmd, FILE *fp ) { struct info_loop *il; int items; int itemsize; int oneline = 0; int res; l_fp tempts; if (pcmd->nargs > 0) { if (STREQ(pcmd->argval[0].string, "oneline")) oneline = 1; else if (STREQ(pcmd->argval[0].string, "multiline")) oneline = 0; else { (void) fprintf(stderr, "How many lines?\n"); return; } } again: res = doquery(impl_ver, REQ_LOOP_INFO, 0, 0, 0, (char *)NULL, &items, &itemsize, (void *)&il, 0, sizeof(struct info_loop)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!check1item(items, fp)) return; if (!checkitemsize(itemsize, sizeof(struct info_loop))) return; if (oneline) { l_fp temp2ts; NTOHL_FP(&il->last_offset, &tempts); NTOHL_FP(&il->drift_comp, &temp2ts); (void) fprintf(fp, "offset %s, frequency %s, time_const %ld, watchdog %ld\n", lfptoa(&tempts, 6), lfptoa(&temp2ts, 3), (long)(int32)ntohl((u_long)il->compliance), (u_long)ntohl((u_long)il->watchdog_timer)); } else { NTOHL_FP(&il->last_offset, &tempts); (void) fprintf(fp, "offset: %s s\n", lfptoa(&tempts, 6)); NTOHL_FP(&il->drift_comp, &tempts); (void) fprintf(fp, "frequency: %s ppm\n", lfptoa(&tempts, 3)); (void) fprintf(fp, "poll adjust: %ld\n", (long)(int32)ntohl(il->compliance)); (void) fprintf(fp, "watchdog timer: %ld s\n", (u_long)ntohl(il->watchdog_timer)); } } /* * sysinfo - show current system state */ /*ARGSUSED*/ static void sysinfo( struct parse *pcmd, FILE *fp ) { struct info_sys *is; sockaddr_u peeraddr; int items; int itemsize; int res; l_fp tempts; again: res = doquery(impl_ver, REQ_SYS_INFO, 0, 0, 0, (char *)NULL, &items, &itemsize, (void *)&is, 0, sizeof(struct info_sys)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!check1item(items, fp)) return; if (!checkitemsize(itemsize, sizeof(struct info_sys)) && !checkitemsize(itemsize, v4sizeof(struct info_sys))) return; SET_ADDR(peeraddr, is->v6_flag, is->peer, is->peer6); (void) fprintf(fp, "system peer: %s\n", nntohost(&peeraddr)); (void) fprintf(fp, "system peer mode: %s\n", modetoa(is->peer_mode)); (void) fprintf(fp, "leap indicator: %c%c\n", is->leap & 0x2 ? '1' : '0', is->leap & 0x1 ? '1' : '0'); (void) fprintf(fp, "stratum: %d\n", (int)is->stratum); (void) fprintf(fp, "precision: %d\n", (int)is->precision); (void) fprintf(fp, "root distance: %s s\n", fptoa(NTOHS_FP(is->rootdelay), 5)); (void) fprintf(fp, "root dispersion: %s s\n", ufptoa(NTOHS_FP(is->rootdispersion), 5)); (void) fprintf(fp, "reference ID: [%s]\n", refid_string(is->refid, is->stratum)); NTOHL_FP(&is->reftime, &tempts); (void) fprintf(fp, "reference time: %s\n", prettydate(&tempts)); (void) fprintf(fp, "system flags: "); if ((is->flags & (INFO_FLAG_BCLIENT | INFO_FLAG_AUTHENABLE | INFO_FLAG_NTP | INFO_FLAG_KERNEL| INFO_FLAG_CAL | INFO_FLAG_PPS_SYNC | INFO_FLAG_MONITOR | INFO_FLAG_FILEGEN)) == 0) { (void) fprintf(fp, "none\n"); } else { if (is->flags & INFO_FLAG_BCLIENT) (void) fprintf(fp, "bclient "); if (is->flags & INFO_FLAG_AUTHENTICATE) (void) fprintf(fp, "auth "); if (is->flags & INFO_FLAG_MONITOR) (void) fprintf(fp, "monitor "); if (is->flags & INFO_FLAG_NTP) (void) fprintf(fp, "ntp "); if (is->flags & INFO_FLAG_KERNEL) (void) fprintf(fp, "kernel "); if (is->flags & INFO_FLAG_FILEGEN) (void) fprintf(fp, "stats "); if (is->flags & INFO_FLAG_CAL) (void) fprintf(fp, "calibrate "); if (is->flags & INFO_FLAG_PPS_SYNC) (void) fprintf(fp, "pps "); (void) fprintf(fp, "\n"); } (void) fprintf(fp, "jitter: %s s\n", fptoa(ntohl(is->frequency), 6)); (void) fprintf(fp, "stability: %s ppm\n", ufptoa(ntohl(is->stability), 3)); (void) fprintf(fp, "broadcastdelay: %s s\n", fptoa(NTOHS_FP(is->bdelay), 6)); NTOHL_FP(&is->authdelay, &tempts); (void) fprintf(fp, "authdelay: %s s\n", lfptoa(&tempts, 6)); } /* * sysstats - print system statistics */ /*ARGSUSED*/ static void sysstats( struct parse *pcmd, FILE *fp ) { struct info_sys_stats *ss; int items; int itemsize; int res; again: res = doquery(impl_ver, REQ_SYS_STATS, 0, 0, 0, (char *)NULL, &items, &itemsize, (void *)&ss, 0, sizeof(struct info_sys_stats)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!check1item(items, fp)) return; if (itemsize != sizeof(struct info_sys_stats) && itemsize != sizeof(struct old_info_sys_stats)) { /* issue warning according to new structure size */ checkitemsize(itemsize, sizeof(struct info_sys_stats)); return; } fprintf(fp, "time since restart: %lu\n", (u_long)ntohl(ss->timeup)); fprintf(fp, "time since reset: %lu\n", (u_long)ntohl(ss->timereset)); fprintf(fp, "packets received: %lu\n", (u_long)ntohl(ss->received)); fprintf(fp, "packets processed: %lu\n", (u_long)ntohl(ss->processed)); fprintf(fp, "current version: %lu\n", (u_long)ntohl(ss->newversionpkt)); fprintf(fp, "previous version: %lu\n", (u_long)ntohl(ss->oldversionpkt)); fprintf(fp, "declined: %lu\n", (u_long)ntohl(ss->unknownversion)); fprintf(fp, "access denied: %lu\n", (u_long)ntohl(ss->denied)); fprintf(fp, "bad length or format: %lu\n", (u_long)ntohl(ss->badlength)); fprintf(fp, "bad authentication: %lu\n", (u_long)ntohl(ss->badauth)); if (itemsize != sizeof(struct info_sys_stats)) return; fprintf(fp, "rate exceeded: %lu\n", (u_long)ntohl(ss->limitrejected)); } /* * iostats - print I/O statistics */ /*ARGSUSED*/ static void iostats( struct parse *pcmd, FILE *fp ) { struct info_io_stats *io; int items; int itemsize; int res; again: res = doquery(impl_ver, REQ_IO_STATS, 0, 0, 0, NULL, &items, &itemsize, (void *)&io, 0, sizeof(*io)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!check1item(items, fp)) return; if (!checkitemsize(itemsize, sizeof(*io))) return; fprintf(fp, "time since reset: %lu\n", (u_long)ntohl(io->timereset)); fprintf(fp, "receive buffers: %u\n", (u_int)ntohs(io->totalrecvbufs)); fprintf(fp, "free receive buffers: %u\n", (u_int)ntohs(io->freerecvbufs)); fprintf(fp, "used receive buffers: %u\n", (u_int)ntohs(io->fullrecvbufs)); fprintf(fp, "low water refills: %u\n", (u_int)ntohs(io->lowwater)); fprintf(fp, "dropped packets: %lu\n", (u_long)ntohl(io->dropped)); fprintf(fp, "ignored packets: %lu\n", (u_long)ntohl(io->ignored)); fprintf(fp, "received packets: %lu\n", (u_long)ntohl(io->received)); fprintf(fp, "packets sent: %lu\n", (u_long)ntohl(io->sent)); fprintf(fp, "packets not sent: %lu\n", (u_long)ntohl(io->notsent)); fprintf(fp, "interrupts handled: %lu\n", (u_long)ntohl(io->interrupts)); fprintf(fp, "received by int: %lu\n", (u_long)ntohl(io->int_received)); } /* * memstats - print peer memory statistics */ /*ARGSUSED*/ static void memstats( struct parse *pcmd, FILE *fp ) { struct info_mem_stats *mem; int i; int items; int itemsize; int res; again: res = doquery(impl_ver, REQ_MEM_STATS, 0, 0, 0, NULL, &items, &itemsize, (void *)&mem, 0, sizeof(*mem)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!check1item(items, fp)) return; if (!checkitemsize(itemsize, sizeof(*mem))) return; fprintf(fp, "time since reset: %lu\n", (u_long)ntohl(mem->timereset)); fprintf(fp, "total peer memory: %u\n", (u_int)ntohs(mem->totalpeermem)); fprintf(fp, "free peer memory: %u\n", (u_int)ntohs(mem->freepeermem)); fprintf(fp, "calls to findpeer: %lu\n", (u_long)ntohl(mem->findpeer_calls)); fprintf(fp, "new peer allocations: %lu\n", (u_long)ntohl(mem->allocations)); fprintf(fp, "peer demobilizations: %lu\n", (u_long)ntohl(mem->demobilizations)); fprintf(fp, "hash table counts: "); for (i = 0; i < NTP_HASH_SIZE; i++) { fprintf(fp, "%4d", (int)mem->hashcount[i]); if ((i % 8) == 7 && i != (NTP_HASH_SIZE-1)) fprintf(fp, "\n "); } fprintf(fp, "\n"); } /* * timerstats - print timer statistics */ /*ARGSUSED*/ static void timerstats( struct parse *pcmd, FILE *fp ) { struct info_timer_stats *tim; int items; int itemsize; int res; again: res = doquery(impl_ver, REQ_TIMER_STATS, 0, 0, 0, NULL, &items, &itemsize, (void *)&tim, 0, sizeof(*tim)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!check1item(items, fp)) return; if (!checkitemsize(itemsize, sizeof(*tim))) return; fprintf(fp, "time since reset: %lu\n", (u_long)ntohl(tim->timereset)); fprintf(fp, "alarms handled: %lu\n", (u_long)ntohl(tim->alarms)); fprintf(fp, "alarm overruns: %lu\n", (u_long)ntohl(tim->overflows)); fprintf(fp, "calls to transmit: %lu\n", (u_long)ntohl(tim->xmtcalls)); } /* * addpeer - configure an active mode association */ static void addpeer( struct parse *pcmd, FILE *fp ) { doconfig(pcmd, fp, MODE_ACTIVE, 0); } /* * addserver - configure a client mode association */ static void addserver( struct parse *pcmd, FILE *fp ) { doconfig(pcmd, fp, MODE_CLIENT, 0); } /* * addrefclock - configure a reference clock association */ static void addrefclock( struct parse *pcmd, FILE *fp ) { doconfig(pcmd, fp, MODE_CLIENT, 1); } /* * broadcast - configure a broadcast mode association */ static void broadcast( struct parse *pcmd, FILE *fp ) { doconfig(pcmd, fp, MODE_BROADCAST, 0); } /* * config - configure a new peer association */ static void doconfig( struct parse *pcmd, FILE *fp, int mode, int refc ) { struct conf_peer cpeer; int items; int itemsize; char *dummy; u_long keyid; u_int version; u_char minpoll; u_char maxpoll; u_int flags; u_char cmode; int res; int sendsize; int numtyp; long val; again: keyid = 0; version = 3; flags = 0; res = FALSE; cmode = 0; minpoll = NTP_MINDPOLL; maxpoll = NTP_MAXDPOLL; numtyp = 1; if (refc) numtyp = 5; if (impl_ver == IMPL_XNTPD) sendsize = sizeof(struct conf_peer); else sendsize = v4sizeof(struct conf_peer); items = 1; while (pcmd->nargs > items) { if (STREQ(pcmd->argval[items].string, "prefer")) flags |= CONF_FLAG_PREFER; else if (STREQ(pcmd->argval[items].string, "burst")) flags |= CONF_FLAG_BURST; else if (STREQ(pcmd->argval[items].string, "iburst")) flags |= CONF_FLAG_IBURST; else if (!refc && STREQ(pcmd->argval[items].string, "keyid")) numtyp = 1; else if (!refc && STREQ(pcmd->argval[items].string, "version")) numtyp = 2; else if (STREQ(pcmd->argval[items].string, "minpoll")) numtyp = 3; else if (STREQ(pcmd->argval[items].string, "maxpoll")) numtyp = 4; else { if (!atoint(pcmd->argval[items].string, &val)) numtyp = 0; switch (numtyp) { case 1: keyid = val; numtyp = 2; break; case 2: version = (u_int)val; numtyp = 0; break; case 3: minpoll = (u_char)val; numtyp = 0; break; case 4: maxpoll = (u_char)val; numtyp = 0; break; case 5: cmode = (u_char)val; numtyp = 0; break; default: fprintf(fp, "*** '%s' not understood\n", pcmd->argval[items].string); res = TRUE; numtyp = 0; } if (val < 0) { fprintf(stderr, "*** Value '%s' should be unsigned\n", pcmd->argval[items].string); res = TRUE; } } items++; } if (keyid > 0) flags |= CONF_FLAG_AUTHENABLE; if (version > NTP_VERSION || version < NTP_OLDVERSION) { fprintf(fp, "***invalid version number: %u\n", version); res = TRUE; } if (minpoll < NTP_MINPOLL || minpoll > NTP_MAXPOLL || maxpoll < NTP_MINPOLL || maxpoll > NTP_MAXPOLL || minpoll > maxpoll) { fprintf(fp, "***min/max-poll must be within %d..%d\n", NTP_MINPOLL, NTP_MAXPOLL); res = TRUE; } if (res) return; memset(&cpeer, 0, sizeof(cpeer)); if (IS_IPV4(&pcmd->argval[0].netnum)) { cpeer.peeraddr = NSRCADR(&pcmd->argval[0].netnum); if (impl_ver == IMPL_XNTPD) cpeer.v6_flag = 0; } else { if (impl_ver == IMPL_XNTPD_OLD) { fprintf(stderr, "***Server doesn't understand IPv6 addresses\n"); return; } cpeer.peeraddr6 = SOCK_ADDR6(&pcmd->argval[0].netnum); cpeer.v6_flag = 1; } cpeer.hmode = (u_char) mode; cpeer.keyid = keyid; cpeer.version = (u_char) version; cpeer.minpoll = minpoll; cpeer.maxpoll = maxpoll; cpeer.flags = (u_char)flags; cpeer.ttl = cmode; res = doquery(impl_ver, REQ_CONFIG, 1, 1, sendsize, (char *)&cpeer, &items, &itemsize, &dummy, 0, sizeof(struct conf_peer)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res == INFO_ERR_FMT) { (void) fprintf(fp, "***Retrying command with old conf_peer size\n"); res = doquery(impl_ver, REQ_CONFIG, 1, 1, sizeof(struct old_conf_peer), (char *)&cpeer, &items, &itemsize, &dummy, 0, sizeof(struct conf_peer)); } if (res == 0) (void) fprintf(fp, "done!\n"); return; } /* * unconfig - unconfigure some associations */ static void unconfig( struct parse *pcmd, FILE *fp ) { /* 8 is the maximum number of peers which will fit in a packet */ struct conf_unpeer *pl, plist[min(MAXARGS, 8)]; int qitemlim; int qitems; int items; int itemsize; char *dummy; int res; int sendsize; again: if (impl_ver == IMPL_XNTPD) sendsize = sizeof(struct conf_unpeer); else sendsize = v4sizeof(struct conf_unpeer); qitemlim = min(pcmd->nargs, COUNTOF(plist)); for (qitems = 0, pl = plist; qitems < qitemlim; qitems++) { if (IS_IPV4(&pcmd->argval[0].netnum)) { pl->peeraddr = NSRCADR(&pcmd->argval[qitems].netnum); if (impl_ver == IMPL_XNTPD) pl->v6_flag = 0; } else { if (impl_ver == IMPL_XNTPD_OLD) { fprintf(stderr, "***Server doesn't understand IPv6 addresses\n"); return; } pl->peeraddr6 = SOCK_ADDR6(&pcmd->argval[qitems].netnum); pl->v6_flag = 1; } pl = (struct conf_unpeer *)((char *)pl + sendsize); } res = doquery(impl_ver, REQ_UNCONFIG, 1, qitems, sendsize, (char *)plist, &items, &itemsize, &dummy, 0, sizeof(struct conf_unpeer)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res == 0) (void) fprintf(fp, "done!\n"); } /* * set - set some system flags */ static void set( struct parse *pcmd, FILE *fp ) { doset(pcmd, fp, REQ_SET_SYS_FLAG); } /* * clear - clear some system flags */ static void sys_clear( struct parse *pcmd, FILE *fp ) { doset(pcmd, fp, REQ_CLR_SYS_FLAG); } /* * doset - set/clear system flags */ static void doset( struct parse *pcmd, FILE *fp, int req ) { struct conf_sys_flags sys; int items; int itemsize; char *dummy; int res; sys.flags = 0; res = 0; for (items = 0; items < pcmd->nargs; items++) { if (STREQ(pcmd->argval[items].string, "auth")) sys.flags |= SYS_FLAG_AUTH; else if (STREQ(pcmd->argval[items].string, "bclient")) sys.flags |= SYS_FLAG_BCLIENT; else if (STREQ(pcmd->argval[items].string, "calibrate")) sys.flags |= SYS_FLAG_CAL; else if (STREQ(pcmd->argval[items].string, "kernel")) sys.flags |= SYS_FLAG_KERNEL; else if (STREQ(pcmd->argval[items].string, "monitor")) sys.flags |= SYS_FLAG_MONITOR; else if (STREQ(pcmd->argval[items].string, "ntp")) sys.flags |= SYS_FLAG_NTP; else if (STREQ(pcmd->argval[items].string, "pps")) sys.flags |= SYS_FLAG_PPS; else if (STREQ(pcmd->argval[items].string, "stats")) sys.flags |= SYS_FLAG_FILEGEN; else { (void) fprintf(fp, "Unknown flag %s\n", pcmd->argval[items].string); res = 1; } } sys.flags = htonl(sys.flags); if (res || sys.flags == 0) return; again: res = doquery(impl_ver, req, 1, 1, sizeof(struct conf_sys_flags), (char *)&sys, &items, &itemsize, &dummy, 0, sizeof(struct conf_sys_flags)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res == 0) (void) fprintf(fp, "done!\n"); } /* * data for printing/interrpreting the restrict flags */ struct resflags { const char *str; int bit; }; /* XXX: HMS: we apparently don't report set bits we do not recognize. */ static struct resflags resflagsV2[] = { { "ignore", 0x001 }, { "noserve", 0x002 }, { "notrust", 0x004 }, { "noquery", 0x008 }, { "nomodify", 0x010 }, { "nopeer", 0x020 }, { "notrap", 0x040 }, { "lptrap", 0x080 }, { "limited", 0x100 }, { "", 0 } }; static struct resflags resflagsV3[] = { { "ignore", RES_IGNORE }, { "noserve", RES_DONTSERVE }, { "notrust", RES_DONTTRUST }, { "noquery", RES_NOQUERY }, { "nomodify", RES_NOMODIFY }, { "nopeer", RES_NOPEER }, { "notrap", RES_NOTRAP }, { "lptrap", RES_LPTRAP }, { "limited", RES_LIMITED }, { "version", RES_VERSION }, { "kod", RES_KOD }, { "timeout", RES_TIMEOUT }, { "", 0 } }; static struct resflags resmflags[] = { { "ntpport", RESM_NTPONLY }, { "interface", RESM_INTERFACE }, { "", 0 } }; /* * reslist - obtain and print the server's restrict list */ /*ARGSUSED*/ static void reslist( struct parse *pcmd, FILE *fp ) { struct info_restrict *rl; sockaddr_u resaddr; sockaddr_u maskaddr; int items; int itemsize; int res; int skip; char *addr; char *mask; struct resflags *rf; u_int32 count; u_short flags; u_short mflags; char flagstr[300]; static const char *comma = ", "; again: res = doquery(impl_ver, REQ_GET_RESTRICT, 0, 0, 0, (char *)NULL, &items, &itemsize, (void *)&rl, 0, sizeof(struct info_restrict)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!checkitems(items, fp)) return; if (!checkitemsize(itemsize, sizeof(struct info_restrict)) && !checkitemsize(itemsize, v4sizeof(struct info_restrict))) return; (void) fprintf(fp, " address mask count flags\n"); (void) fprintf(fp, "=====================================================================\n"); while (items > 0) { SET_ADDRS(resaddr, maskaddr, rl, addr, mask); if (rl->v6_flag != 0) { addr = nntohost(&resaddr); } else { if ((rl->mask == (u_int32)0xffffffff)) addr = nntohost(&resaddr); else addr = stoa(&resaddr); } mask = stoa(&maskaddr); skip = 1; if ((pcmd->nargs == 0) || ((pcmd->argval->ival == 6) && (rl->v6_flag != 0)) || ((pcmd->argval->ival == 4) && (rl->v6_flag == 0))) skip = 0; count = ntohl(rl->count); flags = ntohs(rl->flags); mflags = ntohs(rl->mflags); flagstr[0] = '\0'; res = 1; rf = &resmflags[0]; while (rf->bit != 0) { if (mflags & rf->bit) { if (!res) (void) strcat(flagstr, comma); res = 0; (void) strcat(flagstr, rf->str); } rf++; } rf = (impl_ver == IMPL_XNTPD_OLD) ? &resflagsV2[0] : &resflagsV3[0] ; while (rf->bit != 0) { if (flags & rf->bit) { if (!res) (void) strcat(flagstr, comma); res = 0; (void) strcat(flagstr, rf->str); } rf++; } if (flagstr[0] == '\0') strcpy(flagstr, "none"); if (!skip) fprintf(fp, "%-15.15s %-15.15s %9lu %s\n", addr, mask, (u_long)count, flagstr); rl++; items--; } } /* * new_restrict - create/add a set of restrictions */ static void new_restrict( struct parse *pcmd, FILE *fp ) { do_restrict(pcmd, fp, REQ_RESADDFLAGS); } /* * unrestrict - remove restriction flags from existing entry */ static void unrestrict( struct parse *pcmd, FILE *fp ) { do_restrict(pcmd, fp, REQ_RESSUBFLAGS); } /* * delrestrict - delete an existing restriction */ static void delrestrict( struct parse *pcmd, FILE *fp ) { do_restrict(pcmd, fp, REQ_UNRESTRICT); } /* * do_restrict - decode commandline restrictions and make the request */ static void do_restrict( struct parse *pcmd, FILE *fp, int req_code ) { struct conf_restrict cres; int items; int itemsize; char *dummy; u_int32 num; u_long bit; int i; int res; int err; int sendsize; /* Initialize cres */ cres.addr = 0; cres.mask = 0; cres.flags = 0; cres.mflags = 0; cres.v6_flag = 0; again: if (impl_ver == IMPL_XNTPD) sendsize = sizeof(struct conf_restrict); else sendsize = v4sizeof(struct conf_restrict); if (IS_IPV4(&pcmd->argval[0].netnum)) { cres.addr = NSRCADR(&pcmd->argval[0].netnum); cres.mask = NSRCADR(&pcmd->argval[1].netnum); if (impl_ver == IMPL_XNTPD) cres.v6_flag = 0; } else { if (impl_ver == IMPL_XNTPD_OLD) { fprintf(stderr, "***Server doesn't understand IPv6 addresses\n"); return; } cres.addr6 = SOCK_ADDR6(&pcmd->argval[0].netnum); cres.v6_flag = 1; } cres.flags = 0; cres.mflags = 0; err = FALSE; for (res = 2; res < pcmd->nargs; res++) { if (STREQ(pcmd->argval[res].string, "ntpport")) { cres.mflags |= RESM_NTPONLY; } else { for (i = 0; resflagsV3[i].bit != 0; i++) { if (STREQ(pcmd->argval[res].string, resflagsV3[i].str)) break; } if (resflagsV3[i].bit != 0) { cres.flags |= resflagsV3[i].bit; if (req_code == REQ_UNRESTRICT) { fprintf(fp, "Flag %s inappropriate\n", resflagsV3[i].str); err = TRUE; } } else { fprintf(fp, "Unknown flag %s\n", pcmd->argval[res].string); err = TRUE; } } } cres.flags = htons(cres.flags); cres.mflags = htons(cres.mflags); /* * Make sure mask for default address is zero. Otherwise, * make sure mask bits are contiguous. */ if (IS_IPV4(&pcmd->argval[0].netnum)) { if (cres.addr == 0) { cres.mask = 0; } else { num = ntohl(cres.mask); for (bit = 0x80000000; bit != 0; bit >>= 1) if ((num & bit) == 0) break; for ( ; bit != 0; bit >>= 1) if ((num & bit) != 0) break; if (bit != 0) { fprintf(fp, "Invalid mask %s\n", numtoa(cres.mask)); err = TRUE; } } } else { /* XXX IPv6 sanity checking stuff */ } if (err) return; res = doquery(impl_ver, req_code, 1, 1, sendsize, (char *)&cres, &items, &itemsize, &dummy, 0, sizeof(cres)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res == 0) (void) fprintf(fp, "done!\n"); return; } /* * monlist - obtain and print the server's monitor data */ /*ARGSUSED*/ static void monlist( struct parse *pcmd, FILE *fp ) { char *struct_star; sockaddr_u addr; sockaddr_u dstadr; int items; int itemsize; int res; int version = -1; if (pcmd->nargs > 0) { version = pcmd->argval[0].ival; } again: res = doquery(impl_ver, (version == 1 || version == -1) ? REQ_MON_GETLIST_1 : REQ_MON_GETLIST, 0, 0, 0, (char *)NULL, &items, &itemsize, &struct_star, (version < 0) ? (1 << INFO_ERR_REQ) : 0, sizeof(struct info_monitor_1)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res == INFO_ERR_REQ && version < 0) res = doquery(impl_ver, REQ_MON_GETLIST, 0, 0, 0, (char *)NULL, &items, &itemsize, &struct_star, 0, sizeof(struct info_monitor)); if (res != 0) return; if (!checkitems(items, fp)) return; if (itemsize == sizeof(struct info_monitor_1) || itemsize == v4sizeof(struct info_monitor_1)) { struct info_monitor_1 *ml = (struct info_monitor_1 *) struct_star; (void) fprintf(fp, "remote address port local address count m ver rstr avgint lstint\n"); (void) fprintf(fp, "===============================================================================\n"); while (items > 0) { SET_ADDRS(dstadr, addr, ml, daddr, addr); if ((pcmd->nargs == 0) || ((pcmd->argval->ival == 6) && (ml->v6_flag != 0)) || ((pcmd->argval->ival == 4) && (ml->v6_flag == 0))) fprintf(fp, "%-22.22s %5d %-15s %8lu %1u %1u %6lx %6lu %7lu\n", nntohost(&addr), ntohs(ml->port), stoa(&dstadr), (u_long)ntohl(ml->count), ml->mode, ml->version, (u_long)ntohl(ml->restr), (u_long)ntohl(ml->lasttime), (u_long)ntohl(ml->firsttime)); ml++; items--; } } else if (itemsize == sizeof(struct info_monitor) || itemsize == v4sizeof(struct info_monitor)) { struct info_monitor *ml = (struct info_monitor *) struct_star; (void) fprintf(fp, " address port count mode ver rstr avgint lstint\n"); (void) fprintf(fp, "===============================================================================\n"); while (items > 0) { SET_ADDR(dstadr, ml->v6_flag, ml->addr, ml->addr6); if ((pcmd->nargs == 0) || ((pcmd->argval->ival == 6) && (ml->v6_flag != 0)) || ((pcmd->argval->ival == 4) && (ml->v6_flag == 0))) (void) fprintf(fp, "%-25.25s %5u %9lu %4u %2u %9lx %9lu %9lu\n", nntohost(&dstadr), ntohs(ml->port), (u_long)ntohl(ml->count), ml->mode, ml->version, (u_long)ntohl(ml->restr), (u_long)ntohl(ml->lasttime), (u_long)ntohl(ml->firsttime)); ml++; items--; } } else if (itemsize == sizeof(struct old_info_monitor)) { struct old_info_monitor *oml = (struct old_info_monitor *)struct_star; (void) fprintf(fp, " address port count mode version lasttime firsttime\n"); (void) fprintf(fp, "======================================================================\n"); while (items > 0) { SET_ADDR(dstadr, oml->v6_flag, oml->addr, oml->addr6); (void) fprintf(fp, "%-20.20s %5u %9lu %4u %3u %9lu %9lu\n", nntohost(&dstadr), ntohs(oml->port), (u_long)ntohl(oml->count), oml->mode, oml->version, (u_long)ntohl(oml->lasttime), (u_long)ntohl(oml->firsttime)); oml++; items--; } } else { /* issue warning according to new info_monitor size */ checkitemsize(itemsize, sizeof(struct info_monitor)); } } /* * Mapping between command line strings and stat reset flags */ struct statreset { const char *str; int flag; } sreset[] = { { "io", RESET_FLAG_IO }, { "sys", RESET_FLAG_SYS }, { "mem", RESET_FLAG_MEM }, { "timer", RESET_FLAG_TIMER }, { "auth", RESET_FLAG_AUTH }, { "allpeers", RESET_FLAG_ALLPEERS }, { "", 0 } }; /* * reset - reset statistic counters */ static void reset( struct parse *pcmd, FILE *fp ) { struct reset_flags rflags; int items; int itemsize; char *dummy; int i; int res; int err; err = 0; rflags.flags = 0; for (res = 0; res < pcmd->nargs; res++) { for (i = 0; sreset[i].flag != 0; i++) { if (STREQ(pcmd->argval[res].string, sreset[i].str)) break; } if (sreset[i].flag == 0) { (void) fprintf(fp, "Flag %s unknown\n", pcmd->argval[res].string); err++; } else { rflags.flags |= sreset[i].flag; } } rflags.flags = htonl(rflags.flags); if (err) { (void) fprintf(fp, "Not done due to errors\n"); return; } again: res = doquery(impl_ver, REQ_RESET_STATS, 1, 1, sizeof(struct reset_flags), (char *)&rflags, &items, &itemsize, &dummy, 0, sizeof(struct reset_flags)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res == 0) (void) fprintf(fp, "done!\n"); return; } /* * preset - reset stat counters for particular peers */ static void preset( struct parse *pcmd, FILE *fp ) { /* 8 is the maximum number of peers which will fit in a packet */ struct conf_unpeer *pl, plist[min(MAXARGS, 8)]; int qitemlim; int qitems; int items; int itemsize; char *dummy; int res; int sendsize; again: if (impl_ver == IMPL_XNTPD) sendsize = sizeof(struct conf_unpeer); else sendsize = v4sizeof(struct conf_unpeer); qitemlim = min(pcmd->nargs, COUNTOF(plist)); for (qitems = 0, pl = plist; qitems < qitemlim; qitems++) { if (IS_IPV4(&pcmd->argval[qitems].netnum)) { pl->peeraddr = NSRCADR(&pcmd->argval[qitems].netnum); if (impl_ver == IMPL_XNTPD) pl->v6_flag = 0; } else { if (impl_ver == IMPL_XNTPD_OLD) { fprintf(stderr, "***Server doesn't understand IPv6 addresses\n"); return; } pl->peeraddr6 = SOCK_ADDR6(&pcmd->argval[qitems].netnum); pl->v6_flag = 1; } pl = (struct conf_unpeer *)((char *)pl + sendsize); } res = doquery(impl_ver, REQ_RESET_PEER, 1, qitems, sendsize, (char *)plist, &items, &itemsize, &dummy, 0, sizeof(struct conf_unpeer)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res == 0) (void) fprintf(fp, "done!\n"); } /* * readkeys - request the server to reread the keys file */ /*ARGSUSED*/ static void readkeys( struct parse *pcmd, FILE *fp ) { int items; int itemsize; char *dummy; int res; again: res = doquery(impl_ver, REQ_REREAD_KEYS, 1, 0, 0, (char *)0, &items, &itemsize, &dummy, 0, sizeof(dummy)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res == 0) (void) fprintf(fp, "done!\n"); return; } /* * trustkey - add some keys to the trusted key list */ static void trustkey( struct parse *pcmd, FILE *fp ) { do_trustkey(pcmd, fp, REQ_TRUSTKEY); } /* * untrustkey - remove some keys from the trusted key list */ static void untrustkey( struct parse *pcmd, FILE *fp ) { do_trustkey(pcmd, fp, REQ_UNTRUSTKEY); } /* * do_trustkey - do grunge work of adding/deleting keys */ static void do_trustkey( struct parse *pcmd, FILE *fp, int req ) { u_long keyids[MAXARGS]; int i; int items; int itemsize; char *dummy; int ritems; int res; ritems = 0; for (i = 0; i < pcmd->nargs; i++) { keyids[ritems++] = pcmd->argval[i].uval; } again: res = doquery(impl_ver, req, 1, ritems, sizeof(u_long), (char *)keyids, &items, &itemsize, &dummy, 0, sizeof(dummy)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res == 0) (void) fprintf(fp, "done!\n"); return; } /* * authinfo - obtain and print info about authentication */ /*ARGSUSED*/ static void authinfo( struct parse *pcmd, FILE *fp ) { struct info_auth *ia; int items; int itemsize; int res; again: res = doquery(impl_ver, REQ_AUTHINFO, 0, 0, 0, NULL, &items, &itemsize, (void *)&ia, 0, sizeof(*ia)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!check1item(items, fp)) return; if (!checkitemsize(itemsize, sizeof(*ia))) return; fprintf(fp, "time since reset: %lu\n", (u_long)ntohl(ia->timereset)); fprintf(fp, "stored keys: %lu\n", (u_long)ntohl(ia->numkeys)); fprintf(fp, "free keys: %lu\n", (u_long)ntohl(ia->numfreekeys)); fprintf(fp, "key lookups: %lu\n", (u_long)ntohl(ia->keylookups)); fprintf(fp, "keys not found: %lu\n", (u_long)ntohl(ia->keynotfound)); fprintf(fp, "uncached keys: %lu\n", (u_long)ntohl(ia->keyuncached)); fprintf(fp, "encryptions: %lu\n", (u_long)ntohl(ia->encryptions)); fprintf(fp, "decryptions: %lu\n", (u_long)ntohl(ia->decryptions)); fprintf(fp, "expired keys: %lu\n", (u_long)ntohl(ia->expired)); } /* * traps - obtain and print a list of traps */ /*ARGSUSED*/ static void traps( struct parse *pcmd, FILE *fp ) { int i; struct info_trap *it; sockaddr_u trap_addr, local_addr; int items; int itemsize; int res; again: res = doquery(impl_ver, REQ_TRAPS, 0, 0, 0, (char *)NULL, &items, &itemsize, (void *)&it, 0, sizeof(struct info_trap)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!checkitems(items, fp)) return; if (!checkitemsize(itemsize, sizeof(struct info_trap)) && !checkitemsize(itemsize, v4sizeof(struct info_trap))) return; for (i = 0; i < items; i++ ) { if (i != 0) (void) fprintf(fp, "\n"); SET_ADDRS(trap_addr, local_addr, it, trap_address, local_address); (void) fprintf(fp, "address %s, port %d\n", stoa(&trap_addr), ntohs(it->trap_port)); (void) fprintf(fp, "interface: %s, ", (it->local_address == 0) ? "wildcard" : stoa(&local_addr)); if (ntohl(it->flags) & TRAP_CONFIGURED) (void) fprintf(fp, "configured\n"); else if (ntohl(it->flags) & TRAP_NONPRIO) (void) fprintf(fp, "low priority\n"); else (void) fprintf(fp, "normal priority\n"); (void) fprintf(fp, "set for %ld secs, last set %ld secs ago\n", (long)ntohl(it->origtime), (long)ntohl(it->settime)); (void) fprintf(fp, "sequence %d, number of resets %ld\n", ntohs(it->sequence), (long)ntohl(it->resets)); } } /* * addtrap - configure a trap */ static void addtrap( struct parse *pcmd, FILE *fp ) { do_addclr_trap(pcmd, fp, REQ_ADD_TRAP); } /* * clrtrap - clear a trap from the server */ static void clrtrap( struct parse *pcmd, FILE *fp ) { do_addclr_trap(pcmd, fp, REQ_CLR_TRAP); } /* * do_addclr_trap - do grunge work of adding/deleting traps */ static void do_addclr_trap( struct parse *pcmd, FILE *fp, int req ) { struct conf_trap ctrap; int items; int itemsize; char *dummy; int res; int sendsize; again: if (impl_ver == IMPL_XNTPD) sendsize = sizeof(struct conf_trap); else sendsize = v4sizeof(struct conf_trap); if (IS_IPV4(&pcmd->argval[0].netnum)) { ctrap.trap_address = NSRCADR(&pcmd->argval[0].netnum); if (impl_ver == IMPL_XNTPD) ctrap.v6_flag = 0; } else { if (impl_ver == IMPL_XNTPD_OLD) { fprintf(stderr, "***Server doesn't understand IPv6 addresses\n"); return; } ctrap.trap_address6 = SOCK_ADDR6(&pcmd->argval[0].netnum); ctrap.v6_flag = 1; } ctrap.local_address = 0; ctrap.trap_port = htons(TRAPPORT); ctrap.unused = 0; if (pcmd->nargs > 1) { ctrap.trap_port = htons((u_short)pcmd->argval[1].uval); if (pcmd->nargs > 2) { if (AF(&pcmd->argval[2].netnum) != AF(&pcmd->argval[0].netnum)) { fprintf(stderr, "***Cannot mix IPv4 and IPv6 addresses\n"); return; } if (IS_IPV4(&pcmd->argval[2].netnum)) ctrap.local_address = NSRCADR(&pcmd->argval[2].netnum); else ctrap.local_address6 = SOCK_ADDR6(&pcmd->argval[2].netnum); } } res = doquery(impl_ver, req, 1, 1, sendsize, (char *)&ctrap, &items, &itemsize, &dummy, 0, sizeof(struct conf_trap)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res == 0) (void) fprintf(fp, "done!\n"); return; } /* * requestkey - change the server's request key (a dangerous request) */ static void requestkey( struct parse *pcmd, FILE *fp ) { do_changekey(pcmd, fp, REQ_REQUEST_KEY); } /* * controlkey - change the server's control key */ static void controlkey( struct parse *pcmd, FILE *fp ) { do_changekey(pcmd, fp, REQ_CONTROL_KEY); } /* * do_changekey - do grunge work of changing keys */ static void do_changekey( struct parse *pcmd, FILE *fp, int req ) { u_long key; int items; int itemsize; char *dummy; int res; key = htonl((u_int32)pcmd->argval[0].uval); again: res = doquery(impl_ver, req, 1, 1, sizeof(u_int32), (char *)&key, &items, &itemsize, &dummy, 0, sizeof(dummy)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res == 0) (void) fprintf(fp, "done!\n"); return; } /* * ctlstats - obtain and print info about authentication */ /*ARGSUSED*/ static void ctlstats( struct parse *pcmd, FILE *fp ) { struct info_control *ic; int items; int itemsize; int res; again: res = doquery(impl_ver, REQ_GET_CTLSTATS, 0, 0, 0, NULL, &items, &itemsize, (void *)&ic, 0, sizeof(*ic)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!check1item(items, fp)) return; if (!checkitemsize(itemsize, sizeof(*ic))) return; fprintf(fp, "time since reset: %lu\n", (u_long)ntohl(ic->ctltimereset)); fprintf(fp, "requests received: %lu\n", (u_long)ntohl(ic->numctlreq)); fprintf(fp, "responses sent: %lu\n", (u_long)ntohl(ic->numctlresponses)); fprintf(fp, "fragments sent: %lu\n", (u_long)ntohl(ic->numctlfrags)); fprintf(fp, "async messages sent: %lu\n", (u_long)ntohl(ic->numasyncmsgs)); fprintf(fp, "error msgs sent: %lu\n", (u_long)ntohl(ic->numctlerrors)); fprintf(fp, "total bad pkts: %lu\n", (u_long)ntohl(ic->numctlbadpkts)); fprintf(fp, "packet too short: %lu\n", (u_long)ntohl(ic->numctltooshort)); fprintf(fp, "response on input: %lu\n", (u_long)ntohl(ic->numctlinputresp)); fprintf(fp, "fragment on input: %lu\n", (u_long)ntohl(ic->numctlinputfrag)); fprintf(fp, "error set on input: %lu\n", (u_long)ntohl(ic->numctlinputerr)); fprintf(fp, "bad offset on input: %lu\n", (u_long)ntohl(ic->numctlbadoffset)); fprintf(fp, "bad version packets: %lu\n", (u_long)ntohl(ic->numctlbadversion)); fprintf(fp, "data in pkt too short: %lu\n", (u_long)ntohl(ic->numctldatatooshort)); fprintf(fp, "unknown op codes: %lu\n", (u_long)ntohl(ic->numctlbadop)); } /* * clockstat - get and print clock status information */ static void clockstat( struct parse *pcmd, FILE *fp ) { struct info_clock *cl; /* 8 is the maximum number of clocks which will fit in a packet */ u_long clist[min(MAXARGS, 8)]; int qitemlim; int qitems; int items; int itemsize; int res; l_fp ts; struct clktype *clk; qitemlim = min(pcmd->nargs, COUNTOF(clist)); for (qitems = 0; qitems < qitemlim; qitems++) clist[qitems] = NSRCADR(&pcmd->argval[qitems].netnum); again: res = doquery(impl_ver, REQ_GET_CLOCKINFO, 0, qitems, sizeof(u_int32), (char *)clist, &items, &itemsize, (void *)&cl, 0, sizeof(struct info_clock)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!checkitems(items, fp)) return; if (!checkitemsize(itemsize, sizeof(struct info_clock))) return; while (items-- > 0) { (void) fprintf(fp, "clock address: %s\n", numtoa(cl->clockadr)); for (clk = clktypes; clk->code >= 0; clk++) if (clk->code == cl->type) break; if (clk->code >= 0) (void) fprintf(fp, "clock type: %s\n", clk->clocktype); else (void) fprintf(fp, "clock type: unknown type (%d)\n", cl->type); (void) fprintf(fp, "last event: %d\n", cl->lastevent); (void) fprintf(fp, "current status: %d\n", cl->currentstatus); (void) fprintf(fp, "number of polls: %lu\n", (u_long)ntohl(cl->polls)); (void) fprintf(fp, "no response to poll: %lu\n", (u_long)ntohl(cl->noresponse)); (void) fprintf(fp, "bad format responses: %lu\n", (u_long)ntohl(cl->badformat)); (void) fprintf(fp, "bad data responses: %lu\n", (u_long)ntohl(cl->baddata)); (void) fprintf(fp, "running time: %lu\n", (u_long)ntohl(cl->timestarted)); NTOHL_FP(&cl->fudgetime1, &ts); (void) fprintf(fp, "fudge time 1: %s\n", lfptoa(&ts, 6)); NTOHL_FP(&cl->fudgetime2, &ts); (void) fprintf(fp, "fudge time 2: %s\n", lfptoa(&ts, 6)); (void) fprintf(fp, "stratum: %ld\n", (u_long)ntohl(cl->fudgeval1)); (void) fprintf(fp, "reference ID: %s\n", refid_string(ntohl(cl->fudgeval2), 0)); (void) fprintf(fp, "fudge flags: 0x%x\n", cl->flags); if (items > 0) (void) fprintf(fp, "\n"); cl++; } } /* * fudge - set clock fudge factors */ static void fudge( struct parse *pcmd, FILE *fp ) { struct conf_fudge fudgedata; int items; int itemsize; char *dummy; l_fp ts; int res; long val; u_long u_val; int err; err = 0; memset((char *)&fudgedata, 0, sizeof fudgedata); fudgedata.clockadr = NSRCADR(&pcmd->argval[0].netnum); if (STREQ(pcmd->argval[1].string, "time1")) { fudgedata.which = htonl(FUDGE_TIME1); if (!atolfp(pcmd->argval[2].string, &ts)) err = 1; else NTOHL_FP(&ts, &fudgedata.fudgetime); } else if (STREQ(pcmd->argval[1].string, "time2")) { fudgedata.which = htonl(FUDGE_TIME2); if (!atolfp(pcmd->argval[2].string, &ts)) err = 1; else NTOHL_FP(&ts, &fudgedata.fudgetime); } else if (STREQ(pcmd->argval[1].string, "val1")) { fudgedata.which = htonl(FUDGE_VAL1); if (!atoint(pcmd->argval[2].string, &val)) err = 1; else fudgedata.fudgeval_flags = htonl(val); } else if (STREQ(pcmd->argval[1].string, "val2")) { fudgedata.which = htonl(FUDGE_VAL2); if (!atoint(pcmd->argval[2].string, &val)) err = 1; else fudgedata.fudgeval_flags = htonl((u_int32)val); } else if (STREQ(pcmd->argval[1].string, "flags")) { fudgedata.which = htonl(FUDGE_FLAGS); if (!hextoint(pcmd->argval[2].string, &u_val)) err = 1; else fudgedata.fudgeval_flags = htonl((u_int32)(u_val & 0xf)); } else { (void) fprintf(stderr, "What fudge is %s?\n", pcmd->argval[1].string); return; } if (err) { (void) fprintf(stderr, "Unknown fudge parameter %s\n", pcmd->argval[2].string); return; } again: res = doquery(impl_ver, REQ_SET_CLKFUDGE, 1, 1, sizeof(struct conf_fudge), (char *)&fudgedata, &items, &itemsize, &dummy, 0, sizeof(dummy)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res == 0) (void) fprintf(fp, "done!\n"); return; } /* * clkbug - get and print clock debugging information */ static void clkbug( struct parse *pcmd, FILE *fp ) { register int i; register int n; register u_int32 s; struct info_clkbug *cl; /* 8 is the maximum number of clocks which will fit in a packet */ u_long clist[min(MAXARGS, 8)]; u_int32 ltemp; int qitemlim; int qitems; int items; int itemsize; int res; int needsp; l_fp ts; qitemlim = min(pcmd->nargs, COUNTOF(clist)); for (qitems = 0; qitems < qitemlim; qitems++) clist[qitems] = NSRCADR(&pcmd->argval[qitems].netnum); again: res = doquery(impl_ver, REQ_GET_CLKBUGINFO, 0, qitems, sizeof(u_int32), (char *)clist, &items, &itemsize, (void *)&cl, 0, sizeof(struct info_clkbug)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!checkitems(items, fp)) return; if (!checkitemsize(itemsize, sizeof(struct info_clkbug))) return; while (items-- > 0) { (void) fprintf(fp, "clock address: %s\n", numtoa(cl->clockadr)); n = (int)cl->nvalues; (void) fprintf(fp, "values: %d", n); s = ntohs(cl->svalues); if (n > NUMCBUGVALUES) n = NUMCBUGVALUES; for (i = 0; i < n; i++) { ltemp = ntohl(cl->values[i]); ltemp &= 0xffffffff; /* HMS: This does nothing now */ if ((i & 0x3) == 0) (void) fprintf(fp, "\n"); if (s & (1 << i)) (void) fprintf(fp, "%12ld", (u_long)ltemp); else (void) fprintf(fp, "%12lu", (u_long)ltemp); } (void) fprintf(fp, "\n"); n = (int)cl->ntimes; (void) fprintf(fp, "times: %d", n); s = ntohl(cl->stimes); if (n > NUMCBUGTIMES) n = NUMCBUGTIMES; needsp = 0; for (i = 0; i < n; i++) { if ((i & 0x1) == 0) { (void) fprintf(fp, "\n"); } else { for (;needsp > 0; needsp--) putc(' ', fp); } NTOHL_FP(&cl->times[i], &ts); if (s & (1 << i)) { (void) fprintf(fp, "%17s", lfptoa(&ts, 6)); needsp = 22; } else { (void) fprintf(fp, "%37s", uglydate(&ts)); needsp = 2; } } (void) fprintf(fp, "\n"); if (items > 0) { cl++; (void) fprintf(fp, "\n"); } } } /* * kerninfo - display the kernel pll/pps variables */ static void kerninfo( struct parse *pcmd, FILE *fp ) { struct info_kernel *ik; int items; int itemsize; int res; unsigned status; double tscale = 1e-6; again: res = doquery(impl_ver, REQ_GET_KERNEL, 0, 0, 0, (char *)NULL, &items, &itemsize, (void *)&ik, 0, sizeof(struct info_kernel)); if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) { impl_ver = IMPL_XNTPD_OLD; goto again; } if (res != 0) return; if (!check1item(items, fp)) return; if (!checkitemsize(itemsize, sizeof(struct info_kernel))) return; status = ntohs(ik->status) & 0xffff; /* * pll variables. We know more than we should about the NANO bit. */ #ifdef STA_NANO if (status & STA_NANO) tscale = 1e-9; #endif (void)fprintf(fp, "pll offset: %g s\n", (int32)ntohl(ik->offset) * tscale); (void)fprintf(fp, "pll frequency: %s ppm\n", fptoa((s_fp)ntohl(ik->freq), 3)); (void)fprintf(fp, "maximum error: %g s\n", (u_long)ntohl(ik->maxerror) * 1e-6); (void)fprintf(fp, "estimated error: %g s\n", (u_long)ntohl(ik->esterror) * 1e-6); (void)fprintf(fp, "status: %04x ", status); #ifdef STA_PLL if (status & STA_PLL) (void)fprintf(fp, " pll"); #endif #ifdef STA_PPSFREQ if (status & STA_PPSFREQ) (void)fprintf(fp, " ppsfreq"); #endif #ifdef STA_PPSTIME if (status & STA_PPSTIME) (void)fprintf(fp, " ppstime"); #endif #ifdef STA_FLL if (status & STA_FLL) (void)fprintf(fp, " fll"); #endif #ifdef STA_INS if (status & STA_INS) (void)fprintf(fp, " ins"); #endif #ifdef STA_DEL if (status & STA_DEL) (void)fprintf(fp, " del"); #endif #ifdef STA_UNSYNC if (status & STA_UNSYNC) (void)fprintf(fp, " unsync"); #endif #ifdef STA_FREQHOLD if (status & STA_FREQHOLD) (void)fprintf(fp, " freqhold"); #endif #ifdef STA_PPSSIGNAL if (status & STA_PPSSIGNAL) (void)fprintf(fp, " ppssignal"); #endif #ifdef STA_PPSJITTER if (status & STA_PPSJITTER) (void)fprintf(fp, " ppsjitter"); #endif #ifdef STA_PPSWANDER if (status & STA_PPSWANDER) (void)fprintf(fp, " ppswander"); #endif #ifdef STA_PPSERROR if (status & STA_PPSERROR) (void)fprintf(fp, " ppserror"); #endif #ifdef STA_CLOCKERR if (status & STA_CLOCKERR) (void)fprintf(fp, " clockerr"); #endif #ifdef STA_NANO if (status & STA_NANO) (void)fprintf(fp, " nano"); #endif #ifdef STA_MODE if (status & STA_MODE) (void)fprintf(fp, " mode=fll"); #endif #ifdef STA_CLK if (status & STA_CLK) (void)fprintf(fp, " src=B"); #endif (void)fprintf(fp, "\n"); (void)fprintf(fp, "pll time constant: %ld\n", (u_long)ntohl(ik->constant)); (void)fprintf(fp, "precision: %g s\n", (u_long)ntohl(ik->precision) * tscale); (void)fprintf(fp, "frequency tolerance: %s ppm\n", fptoa((s_fp)ntohl(ik->tolerance), 0)); /* * For backwards compatibility (ugh), we find the pps variables * only if the shift member is nonzero. */ if (!ik->shift) return; /* * pps variables */ (void)fprintf(fp, "pps frequency: %s ppm\n", fptoa((s_fp)ntohl(ik->ppsfreq), 3)); (void)fprintf(fp, "pps stability: %s ppm\n", fptoa((s_fp)ntohl(ik->stabil), 3)); (void)fprintf(fp, "pps jitter: %g s\n", (u_long)ntohl(ik->jitter) * tscale); (void)fprintf(fp, "calibration interval: %d s\n", 1 << ntohs(ik->shift)); (void)fprintf(fp, "calibration cycles: %ld\n", (u_long)ntohl(ik->calcnt)); (void)fprintf(fp, "jitter exceeded: %ld\n", (u_long)ntohl(ik->jitcnt)); (void)fprintf(fp, "stability exceeded: %ld\n", (u_long)ntohl(ik->stbcnt)); (void)fprintf(fp, "calibration errors: %ld\n", (u_long)ntohl(ik->errcnt)); } #define IF_LIST_FMT "%2d %c %48s %c %c %12.12s %03lx %3lu %2lu %5lu %5lu %5lu %2lu %3lu %7lu\n" #define IF_LIST_FMT_STR "%2s %c %48s %c %c %12.12s %3s %3s %2s %5s %5s %5s %2s %3s %7s\n" #define IF_LIST_AFMT_STR " %48s %c\n" #define IF_LIST_LABELS "#", 'A', "Address/Mask/Broadcast", 'T', 'E', "IF name", "Flg", "TL", "#M", "recv", "sent", "drop", "S", "PC", "uptime" #define IF_LIST_LINE "==================================================================================================================\n" static void iflist( FILE *fp, struct info_if_stats *ifs, int items, int itemsize, int res ) { static char *actions = "?.+-"; sockaddr_u saddr; if (res != 0) return; if (!checkitems(items, fp)) return; if (!checkitemsize(itemsize, sizeof(struct info_if_stats))) return; fprintf(fp, IF_LIST_FMT_STR, IF_LIST_LABELS); fprintf(fp, IF_LIST_LINE); while (items > 0) { SET_ADDR(saddr, ntohl(ifs->v6_flag), ifs->unaddr.addr.s_addr, ifs->unaddr.addr6); fprintf(fp, IF_LIST_FMT, ntohl(ifs->ifnum), actions[(ifs->action >= 1 && ifs->action < 4) ? ifs->action : 0], stoa((&saddr)), 'A', ifs->ignore_packets ? 'D' : 'E', ifs->name, (u_long)ntohl(ifs->flags), (u_long)ntohl(ifs->last_ttl), (u_long)ntohl(ifs->num_mcast), (u_long)ntohl(ifs->received), (u_long)ntohl(ifs->sent), (u_long)ntohl(ifs->notsent), (u_long)ntohl(ifs->scopeid), (u_long)ntohl(ifs->peercnt), (u_long)ntohl(ifs->uptime)); SET_ADDR(saddr, ntohl(ifs->v6_flag), ifs->unmask.addr.s_addr, ifs->unmask.addr6); fprintf(fp, IF_LIST_AFMT_STR, stoa(&saddr), 'M'); if (!ntohl(ifs->v6_flag) && ntohl(ifs->flags) & (INT_BCASTOPEN)) { SET_ADDR(saddr, ntohl(ifs->v6_flag), ifs->unbcast.addr.s_addr, ifs->unbcast.addr6); fprintf(fp, IF_LIST_AFMT_STR, stoa(&saddr), 'B'); } ifs++; items--; } } /*ARGSUSED*/ static void get_if_stats( struct parse *pcmd, FILE *fp ) { struct info_if_stats *ifs; int items; int itemsize; int res; res = doquery(impl_ver, REQ_IF_STATS, 1, 0, 0, (char *)NULL, &items, &itemsize, (void *)&ifs, 0, sizeof(struct info_if_stats)); iflist(fp, ifs, items, itemsize, res); } /*ARGSUSED*/ static void do_if_reload( struct parse *pcmd, FILE *fp ) { struct info_if_stats *ifs; int items; int itemsize; int res; res = doquery(impl_ver, REQ_IF_RELOAD, 1, 0, 0, (char *)NULL, &items, &itemsize, (void *)&ifs, 0, sizeof(struct info_if_stats)); iflist(fp, ifs, items, itemsize, res); } ntp-4.2.6p5/ntpdc/nl.pl.in0000644000175000017500000000143410017034572014275 0ustar peterpeter#! @PATH_PERL@ -w $found = 0; $last = 0; $debug = 0; while (<>) { next if /^#/; next if /^\s*$/; if (/^struct req_pkt/) { $found = 1; } if (/^struct info_dns_assoc/) { $last = 1; } if ($found) { if (/^(struct\s*\w*)\s*{\s*$/) { $type = $1; print STDERR "type = '$type'\n" if $debug; printf " printf(\"sizeof($type) = %%d\\n\", \n\t (int) sizeof($type));\n"; next; } if (/\s*\w+\s+(\w*)\s*(\[.*\])?\s*;\s*$/) { $field = $1; print STDERR "\tfield = '$field'\n" if $debug; printf " printf(\"offsetof($field) = %%d\\n\", \n\t (int) offsetof($type, $field));\n"; next; } if (/^}\s*;\s*$/) { printf " printf(\"\\n\");\n\n"; $found = 0 if $last; next; } print STDERR "Unmatched line: $_"; exit 1; } } ntp-4.2.6p5/ntpdc/ntpdc.c0000644000175000017500000012310011675457723014213 0ustar peterpeter/* * ntpdc - control and monitor your ntpd daemon */ #include #include #include #include #include #include "ntpdc.h" #include "ntp_select.h" #include "ntp_io.h" #include "ntp_stdlib.h" #include "ntp_assert.h" #include "ntp_lineedit.h" #include "isc/net.h" #include "isc/result.h" #include #include "ntp_libopts.h" #include "ntpdc-opts.h" #ifdef SYS_WINNT # include # include #endif /* SYS_WINNT */ #ifdef SYS_VXWORKS /* vxWorks needs mode flag -casey*/ # define open(name, flags) open(name, flags, 0777) # define SERVER_PORT_NUM 123 #endif /* We use COMMAND as an autogen keyword */ #ifdef COMMAND # undef COMMAND #endif /* * Because we now potentially understand a lot of commands (and * it requires a lot of commands to talk to ntpd) we will run * interactive if connected to a terminal. */ static int interactive = 0; /* set to 1 when we should prompt */ static const char * prompt = "ntpdc> "; /* prompt to ask him about */ /* * Keyid used for authenticated requests. Obtained on the fly. */ static u_long info_auth_keyid; static int keyid_entered = 0; static int info_auth_keytype = NID_md5; /* MD5 */ static size_t info_auth_hashlen = 16; /* MD5 */ u_long current_time; /* needed by authkeys; not used */ /* * for get_systime() */ s_char sys_precision; /* local clock precision (log2 s) */ int ntpdcmain (int, char **); /* * Built in command handler declarations */ static int openhost (const char *); static int sendpkt (void *, size_t); static void growpktdata (void); static int getresponse (int, int, int *, int *, char **, int); static int sendrequest (int, int, int, u_int, size_t, char *); static void getcmds (void); static RETSIGTYPE abortcmd (int); static void docmd (const char *); static void tokenize (const char *, char **, int *); static int findcmd (char *, struct xcmd *, struct xcmd *, struct xcmd **); static int getarg (char *, int, arg_v *); static int getnetnum (const char *, sockaddr_u *, char *, int); static void help (struct parse *, FILE *); static int helpsort (const void *, const void *); static void printusage (struct xcmd *, FILE *); static void timeout (struct parse *, FILE *); static void my_delay (struct parse *, FILE *); static void host (struct parse *, FILE *); static void keyid (struct parse *, FILE *); static void keytype (struct parse *, FILE *); static void passwd (struct parse *, FILE *); static void hostnames (struct parse *, FILE *); static void setdebug (struct parse *, FILE *); static void quit (struct parse *, FILE *); static void version (struct parse *, FILE *); static void warning (const char *, const char *, const char *); static void error (const char *, const char *, const char *); static u_long getkeyid (const char *); /* * Built-in commands we understand */ static struct xcmd builtins[] = { { "?", help, { OPT|NTP_STR, NO, NO, NO }, { "command", "", "", "" }, "tell the use and syntax of commands" }, { "help", help, { OPT|NTP_STR, NO, NO, NO }, { "command", "", "", "" }, "tell the use and syntax of commands" }, { "timeout", timeout, { OPT|NTP_UINT, NO, NO, NO }, { "msec", "", "", "" }, "set the primary receive time out" }, { "delay", my_delay, { OPT|NTP_INT, NO, NO, NO }, { "msec", "", "", "" }, "set the delay added to encryption time stamps" }, { "host", host, { OPT|NTP_STR, OPT|NTP_STR, NO, NO }, { "-4|-6", "hostname", "", "" }, "specify the host whose NTP server we talk to" }, { "passwd", passwd, { OPT|NTP_STR, NO, NO, NO }, { "", "", "", "" }, "specify a password to use for authenticated requests"}, { "hostnames", hostnames, { OPT|NTP_STR, NO, NO, NO }, { "yes|no", "", "", "" }, "specify whether hostnames or net numbers are printed"}, { "debug", setdebug, { OPT|NTP_STR, NO, NO, NO }, { "no|more|less", "", "", "" }, "set/change debugging level" }, { "quit", quit, { NO, NO, NO, NO }, { "", "", "", "" }, "exit ntpdc" }, { "exit", quit, { NO, NO, NO, NO }, { "", "", "", "" }, "exit ntpdc" }, { "keyid", keyid, { OPT|NTP_UINT, NO, NO, NO }, { "key#", "", "", "" }, "set/show keyid to use for authenticated requests" }, { "keytype", keytype, { OPT|NTP_STR, NO, NO, NO }, { "(md5|des)", "", "", "" }, "set/show key authentication type for authenticated requests (des|md5)" }, { "version", version, { NO, NO, NO, NO }, { "", "", "", "" }, "print version number" }, { 0, 0, { NO, NO, NO, NO }, { "", "", "", "" }, "" } }; /* * Default values we use. */ #define DEFHOST "localhost" /* default host name */ #define DEFTIMEOUT (5) /* 5 second time out */ #define DEFSTIMEOUT (2) /* 2 second time out after first */ #define DEFDELAY 0x51EB852 /* 20 milliseconds, l_fp fraction */ #define LENHOSTNAME 256 /* host name is 256 characters long */ #define MAXCMDS 100 /* maximum commands on cmd line */ #define MAXHOSTS 200 /* maximum hosts on cmd line */ #define MAXLINE 512 /* maximum line length */ #define MAXTOKENS (1+1+MAXARGS+MOREARGS+2) /* maximum number of usable tokens */ #define SCREENWIDTH 78 /* nominal screen width in columns */ /* * Some variables used and manipulated locally */ static struct sock_timeval tvout = { DEFTIMEOUT, 0 }; /* time out for reads */ static struct sock_timeval tvsout = { DEFSTIMEOUT, 0 };/* secondary time out */ static l_fp delay_time; /* delay time */ static char currenthost[LENHOSTNAME]; /* current host name */ int showhostnames = 1; /* show host names by default */ static int ai_fam_templ; /* address family */ static int ai_fam_default; /* default address family */ static SOCKET sockfd; /* fd socket is opened on */ static int havehost = 0; /* set to 1 when host open */ int s_port = 0; /* * Holds data returned from queries. We allocate INITDATASIZE * octets to begin with, increasing this as we need to. */ #define INITDATASIZE (sizeof(struct resp_pkt) * 16) #define INCDATASIZE (sizeof(struct resp_pkt) * 8) static char *pktdata; static int pktdatasize; /* * These are used to help the magic with old and new versions of ntpd. */ int impl_ver = IMPL_XNTPD; static int req_pkt_size = REQ_LEN_NOMAC; /* * For commands typed on the command line (with the -c option) */ static int numcmds = 0; static const char *ccmds[MAXCMDS]; #define ADDCMD(cp) if (numcmds < MAXCMDS) ccmds[numcmds++] = (cp) /* * When multiple hosts are specified. */ static int numhosts = 0; static const char *chosts[MAXHOSTS]; #define ADDHOST(cp) if (numhosts < MAXHOSTS) chosts[numhosts++] = (cp) /* * Error codes for internal use */ #define ERR_INCOMPLETE 16 #define ERR_TIMEOUT 17 /* * Macro definitions we use */ #define ISSPACE(c) ((c) == ' ' || (c) == '\t') #define ISEOL(c) ((c) == '\n' || (c) == '\r' || (c) == '\0') #define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0) /* * For converting time stamps to dates */ #define JAN_1970 2208988800 /* 1970 - 1900 in seconds */ /* * Jump buffer for longjumping back to the command level */ static jmp_buf interrupt_buf; static volatile int jump = 0; /* * Pointer to current output unit */ static FILE *current_output; /* * Command table imported from ntpdc_ops.c */ extern struct xcmd opcmds[]; char *progname; volatile int debug; #ifdef NO_MAIN_ALLOWED CALL(ntpdc,"ntpdc",ntpdcmain); #else int main( int argc, char *argv[] ) { return ntpdcmain(argc, argv); } #endif #ifdef SYS_VXWORKS void clear_globals(void) { showhostnames = 0; /* show host names by default */ havehost = 0; /* set to 1 when host open */ numcmds = 0; numhosts = 0; } #endif /* * main - parse arguments and handle options */ int ntpdcmain( int argc, char *argv[] ) { extern int ntp_optind; delay_time.l_ui = 0; delay_time.l_uf = DEFDELAY; #ifdef SYS_VXWORKS clear_globals(); taskPrioritySet(taskIdSelf(), 100 ); #endif init_lib(); /* sets up ipv4_works, ipv6_works */ ssl_applink(); /* Check to see if we have IPv6. Otherwise default to IPv4 */ if (!ipv6_works) ai_fam_default = AF_INET; progname = argv[0]; { int optct = ntpOptionProcess(&ntpdcOptions, argc, argv); argc -= optct; argv += optct; } if (HAVE_OPT(IPV4)) ai_fam_templ = AF_INET; else if (HAVE_OPT(IPV6)) ai_fam_templ = AF_INET6; else ai_fam_templ = ai_fam_default; if (HAVE_OPT(COMMAND)) { int cmdct = STACKCT_OPT( COMMAND ); const char** cmds = STACKLST_OPT( COMMAND ); while (cmdct-- > 0) { ADDCMD(*cmds++); } } debug = DESC(DEBUG_LEVEL).optOccCt; if (HAVE_OPT(INTERACTIVE)) { interactive = 1; } if (HAVE_OPT(NUMERIC)) { showhostnames = 0; } if (HAVE_OPT(LISTPEERS)) { ADDCMD("listpeers"); } if (HAVE_OPT(PEERS)) { ADDCMD("peers"); } if (HAVE_OPT(SHOWPEERS)) { ADDCMD("dmpeers"); } if (ntp_optind == argc) { ADDHOST(DEFHOST); } else { for (; ntp_optind < argc; ntp_optind++) ADDHOST(argv[ntp_optind]); } if (numcmds == 0 && interactive == 0 && isatty(fileno(stdin)) && isatty(fileno(stderr))) { interactive = 1; } #if 0 ai_fam_templ = ai_fam_default; while ((c = ntp_getopt(argc, argv, "46c:dilnps")) != EOF) switch (c) { case '4': ai_fam_templ = AF_INET; break; case '6': ai_fam_templ = AF_INET6; break; case 'c': ADDCMD(ntp_optarg); break; case 'd': ++debug; break; case 'i': interactive = 1; break; case 'l': ADDCMD("listpeers"); break; case 'n': showhostnames = 0; break; case 'p': ADDCMD("peers"); break; case 's': ADDCMD("dmpeers"); break; default: errflg++; break; } if (errflg) { (void) fprintf(stderr, "usage: %s [-46dilnps] [-c cmd] host ...\n", progname); exit(2); } if (ntp_optind == argc) { ADDHOST(DEFHOST); } else { for (; ntp_optind < argc; ntp_optind++) ADDHOST(argv[ntp_optind]); } if (numcmds == 0 && interactive == 0 && isatty(fileno(stdin)) && isatty(fileno(stderr))) { interactive = 1; } #endif #ifndef SYS_WINNT /* Under NT cannot handle SIGINT, WIN32 spawns a handler */ if (interactive) (void) signal_no_reset(SIGINT, abortcmd); #endif /* SYS_WINNT */ /* * Initialize the packet data buffer */ pktdatasize = INITDATASIZE; pktdata = emalloc(INITDATASIZE); if (numcmds == 0) { (void) openhost(chosts[0]); getcmds(); } else { int ihost; int icmd; for (ihost = 0; ihost < numhosts; ihost++) { if (openhost(chosts[ihost])) for (icmd = 0; icmd < numcmds; icmd++) { if (numhosts > 1) printf ("--- %s ---\n",chosts[ihost]); docmd(ccmds[icmd]); } } } #ifdef SYS_WINNT WSACleanup(); #endif return(0); } /* main end */ /* * openhost - open a socket to a host */ static int openhost( const char *hname ) { char temphost[LENHOSTNAME]; int a_info, i; struct addrinfo hints, *ai = NULL; register const char *cp; char name[LENHOSTNAME]; char service[5]; /* * We need to get by the [] if they were entered */ cp = hname; if (*cp == '[') { cp++; for (i = 0; *cp && *cp != ']'; cp++, i++) name[i] = *cp; if (*cp == ']') { name[i] = '\0'; hname = name; } else { return 0; } } /* * First try to resolve it as an ip address and if that fails, * do a fullblown (dns) lookup. That way we only use the dns * when it is needed and work around some implementations that * will return an "IPv4-mapped IPv6 address" address if you * give it an IPv4 address to lookup. */ strcpy(service, "ntp"); memset((char *)&hints, 0, sizeof(struct addrinfo)); hints.ai_family = ai_fam_templ; hints.ai_protocol = IPPROTO_UDP; hints.ai_socktype = SOCK_DGRAM; hints.ai_flags = Z_AI_NUMERICHOST; a_info = getaddrinfo(hname, service, &hints, &ai); if (a_info == EAI_NONAME #ifdef EAI_NODATA || a_info == EAI_NODATA #endif ) { hints.ai_flags = AI_CANONNAME; #ifdef AI_ADDRCONFIG hints.ai_flags |= AI_ADDRCONFIG; #endif a_info = getaddrinfo(hname, service, &hints, &ai); } /* Some older implementations don't like AI_ADDRCONFIG. */ if (a_info == EAI_BADFLAGS) { hints.ai_flags = AI_CANONNAME; a_info = getaddrinfo(hname, service, &hints, &ai); } if (a_info != 0) { (void) fprintf(stderr, "%s\n", gai_strerror(a_info)); if (ai != NULL) freeaddrinfo(ai); return 0; } /* * getaddrinfo() has returned without error so ai should not * be NULL. */ NTP_INSIST(ai != NULL); if (ai->ai_canonname == NULL) { strncpy(temphost, stoa((sockaddr_u *)ai->ai_addr), LENHOSTNAME); temphost[LENHOSTNAME-1] = '\0'; } else { strncpy(temphost, ai->ai_canonname, LENHOSTNAME); temphost[LENHOSTNAME-1] = '\0'; } if (debug > 2) printf("Opening host %s\n", temphost); if (havehost == 1) { if (debug > 2) printf("Closing old host %s\n", currenthost); (void) closesocket(sockfd); havehost = 0; } (void) strcpy(currenthost, temphost); /* port maps to the same in both families */ s_port = ((struct sockaddr_in6 *)ai->ai_addr)->sin6_port; #ifdef SYS_VXWORKS ((struct sockaddr_in6 *)&hostaddr)->sin6_port = htons(SERVER_PORT_NUM); if (ai->ai_family == AF_INET) *(struct sockaddr_in *)&hostaddr= *((struct sockaddr_in *)ai->ai_addr); else *(struct sockaddr_in6 *)&hostaddr= *((struct sockaddr_in6 *)ai->ai_addr); #endif /* SYS_VXWORKS */ #ifdef SYS_WINNT { int optionValue = SO_SYNCHRONOUS_NONALERT; int err; err = setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *)&optionValue, sizeof(optionValue)); if (err != NO_ERROR) { (void) fprintf(stderr, "cannot open nonoverlapped sockets\n"); exit(1); } } sockfd = socket(ai->ai_family, SOCK_DGRAM, 0); if (sockfd == INVALID_SOCKET) { error("socket", "", ""); exit(-1); } #else sockfd = socket(ai->ai_family, SOCK_DGRAM, 0); if (sockfd == -1) error("socket", "", ""); #endif /* SYS_WINNT */ #ifdef NEED_RCVBUF_SLOP # ifdef SO_RCVBUF { int rbufsize = INITDATASIZE + 2048; /* 2K for slop */ if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, &rbufsize, sizeof(int)) == -1) error("setsockopt", "", ""); } # endif #endif #ifdef SYS_VXWORKS if (connect(sockfd, (struct sockaddr *)&hostaddr, sizeof(hostaddr)) == -1) #else if (connect(sockfd, (struct sockaddr *)ai->ai_addr, ai->ai_addrlen) == -1) #endif /* SYS_VXWORKS */ error("connect", "", ""); freeaddrinfo(ai); havehost = 1; req_pkt_size = REQ_LEN_NOMAC; impl_ver = IMPL_XNTPD; return 1; } /* XXX ELIMINATE sendpkt similar in ntpq.c, ntpdc.c, ntp_io.c, ntptrace.c */ /* * sendpkt - send a packet to the remote host */ static int sendpkt( void * xdata, size_t xdatalen ) { if (send(sockfd, xdata, xdatalen, 0) == -1) { warning("write to %s failed", currenthost, ""); return -1; } return 0; } /* * growpktdata - grow the packet data area */ static void growpktdata(void) { pktdatasize += INCDATASIZE; pktdata = erealloc(pktdata, (size_t)pktdatasize); } /* * getresponse - get a (series of) response packet(s) and return the data */ static int getresponse( int implcode, int reqcode, int *ritems, int *rsize, char **rdata, int esize ) { struct resp_pkt rpkt; struct sock_timeval tvo; int items; int i; int size; int datasize; char *datap; char *tmp_data; char haveseq[MAXSEQ+1]; int firstpkt; int lastseq; int numrecv; int seq; fd_set fds; int n; int pad; /* * This is pretty tricky. We may get between 1 and many packets * back in response to the request. We peel the data out of * each packet and collect it in one long block. When the last * packet in the sequence is received we'll know how many we * should have had. Note we use one long time out, should reconsider. */ *ritems = 0; *rsize = 0; firstpkt = 1; numrecv = 0; *rdata = datap = pktdata; lastseq = 999; /* too big to be a sequence number */ memset(haveseq, 0, sizeof(haveseq)); FD_ZERO(&fds); again: if (firstpkt) tvo = tvout; else tvo = tvsout; FD_SET(sockfd, &fds); n = select(sockfd+1, &fds, (fd_set *)0, (fd_set *)0, &tvo); if (n == -1) { warning("select fails", "", ""); return -1; } if (n == 0) { /* * Timed out. Return what we have */ if (firstpkt) { (void) fprintf(stderr, "%s: timed out, nothing received\n", currenthost); return ERR_TIMEOUT; } else { (void) fprintf(stderr, "%s: timed out with incomplete data\n", currenthost); if (debug) { printf("Received sequence numbers"); for (n = 0; n <= MAXSEQ; n++) if (haveseq[n]) printf(" %d,", n); if (lastseq != 999) printf(" last frame received\n"); else printf(" last frame not received\n"); } return ERR_INCOMPLETE; } } n = recv(sockfd, (char *)&rpkt, sizeof(rpkt), 0); if (n == -1) { warning("read", "", ""); return -1; } /* * Check for format errors. Bug proofing. */ if (n < RESP_HEADER_SIZE) { if (debug) printf("Short (%d byte) packet received\n", n); goto again; } if (INFO_VERSION(rpkt.rm_vn_mode) > NTP_VERSION || INFO_VERSION(rpkt.rm_vn_mode) < NTP_OLDVERSION) { if (debug) printf("Packet received with version %d\n", INFO_VERSION(rpkt.rm_vn_mode)); goto again; } if (INFO_MODE(rpkt.rm_vn_mode) != MODE_PRIVATE) { if (debug) printf("Packet received with mode %d\n", INFO_MODE(rpkt.rm_vn_mode)); goto again; } if (INFO_IS_AUTH(rpkt.auth_seq)) { if (debug) printf("Encrypted packet received\n"); goto again; } if (!ISRESPONSE(rpkt.rm_vn_mode)) { if (debug) printf("Received request packet, wanted response\n"); goto again; } if (INFO_MBZ(rpkt.mbz_itemsize) != 0) { if (debug) printf("Received packet with nonzero MBZ field!\n"); goto again; } /* * Check implementation/request. Could be old data getting to us. */ if (rpkt.implementation != implcode || rpkt.request != reqcode) { if (debug) printf( "Received implementation/request of %d/%d, wanted %d/%d", rpkt.implementation, rpkt.request, implcode, reqcode); goto again; } /* * Check the error code. If non-zero, return it. */ if (INFO_ERR(rpkt.err_nitems) != INFO_OKAY) { if (debug && ISMORE(rpkt.rm_vn_mode)) { printf("Error code %d received on not-final packet\n", INFO_ERR(rpkt.err_nitems)); } return (int)INFO_ERR(rpkt.err_nitems); } /* * Collect items and size. Make sure they make sense. */ items = INFO_NITEMS(rpkt.err_nitems); size = INFO_ITEMSIZE(rpkt.mbz_itemsize); if (esize > size) pad = esize - size; else pad = 0; datasize = items * size; if ((size_t)datasize > (n-RESP_HEADER_SIZE)) { if (debug) printf( "Received items %d, size %d (total %d), data in packet is %lu\n", items, size, datasize, (u_long)(n-RESP_HEADER_SIZE)); goto again; } /* * If this isn't our first packet, make sure the size matches * the other ones. */ if (!firstpkt && esize != *rsize) { if (debug) printf("Received itemsize %d, previous %d\n", size, *rsize); goto again; } /* * If we've received this before, +toss it */ seq = INFO_SEQ(rpkt.auth_seq); if (haveseq[seq]) { if (debug) printf("Received duplicate sequence number %d\n", seq); goto again; } haveseq[seq] = 1; /* * If this is the last in the sequence, record that. */ if (!ISMORE(rpkt.rm_vn_mode)) { if (lastseq != 999) { printf("Received second end sequence packet\n"); goto again; } lastseq = seq; } /* * So far, so good. Copy this data into the output array. */ if ((datap + datasize + (pad * items)) > (pktdata + pktdatasize)) { int offset = datap - pktdata; growpktdata(); *rdata = pktdata; /* might have been realloced ! */ datap = pktdata + offset; } /* * We now move the pointer along according to size and number of * items. This is so we can play nice with older implementations */ tmp_data = rpkt.data; for (i = 0; i < items; i++) { memcpy(datap, tmp_data, (unsigned)size); tmp_data += size; memset(datap + size, 0, pad); datap += size + pad; } if (firstpkt) { firstpkt = 0; *rsize = size + pad; } *ritems += items; /* * Finally, check the count of received packets. If we've got them * all, return */ ++numrecv; if (numrecv <= lastseq) goto again; return INFO_OKAY; } /* * sendrequest - format and send a request packet * * Historically, ntpdc has used a fixed-size request packet regardless * of the actual payload size. When authenticating, the timestamp, key * ID, and digest have been placed just before the end of the packet. * With the introduction in late 2009 of support for authenticated * ntpdc requests using larger 20-octet digests (vs. 16 for MD5), we * come up four bytes short. * * To maintain interop while allowing for larger digests, the behavior * is unchanged when using 16-octet digests. For larger digests, the * timestamp, key ID, and digest are placed immediately following the * request payload, with the overall packet size variable. ntpd can * distinguish 16-octet digests by the overall request size being * REQ_LEN_NOMAC + 4 + 16 with the auth bit enabled. When using a * longer digest, that request size should be avoided. * * With the form used with 20-octet and larger digests, the timestamp, * key ID, and digest are located by ntpd relative to the start of the * packet, and the size of the digest is then implied by the packet * size. */ static int sendrequest( int implcode, int reqcode, int auth, u_int qitems, size_t qsize, char *qdata ) { struct req_pkt qpkt; size_t datasize; size_t reqsize; u_long key_id; l_fp ts; l_fp * ptstamp; int maclen; char * pass; memset(&qpkt, 0, sizeof(qpkt)); qpkt.rm_vn_mode = RM_VN_MODE(0, 0, 0); qpkt.implementation = (u_char)implcode; qpkt.request = (u_char)reqcode; datasize = qitems * qsize; if (datasize && qdata != NULL) { memcpy(qpkt.data, qdata, datasize); qpkt.err_nitems = ERR_NITEMS(0, qitems); qpkt.mbz_itemsize = MBZ_ITEMSIZE(qsize); } else { qpkt.err_nitems = ERR_NITEMS(0, 0); qpkt.mbz_itemsize = MBZ_ITEMSIZE(qsize); /* allow for optional first item */ } if (!auth || (keyid_entered && info_auth_keyid == 0)) { qpkt.auth_seq = AUTH_SEQ(0, 0); return sendpkt(&qpkt, req_pkt_size); } if (info_auth_keyid == 0) { key_id = getkeyid("Keyid: "); if (!key_id) { fprintf(stderr, "Invalid key identifier\n"); return 1; } info_auth_keyid = key_id; } if (!authistrusted(info_auth_keyid)) { pass = getpass_keytype(info_auth_keytype); if ('\0' == pass[0]) { fprintf(stderr, "Invalid password\n"); return 1; } authusekey(info_auth_keyid, info_auth_keytype, (u_char *)pass); authtrust(info_auth_keyid, 1); } qpkt.auth_seq = AUTH_SEQ(1, 0); if (info_auth_hashlen > 16) { /* * Only ntpd which expects REQ_LEN_NOMAC plus maclen * octets in an authenticated request using a 16 octet * digest (that is, a newer ntpd) will handle digests * larger than 16 octets, so for longer digests, do * not attempt to shorten the requests for downlevel * ntpd compatibility. */ if (REQ_LEN_NOMAC != req_pkt_size) return 1; reqsize = REQ_LEN_HDR + datasize + sizeof(*ptstamp); /* align to 32 bits */ reqsize = (reqsize + 3) & ~3; } else reqsize = req_pkt_size; ptstamp = (void *)((char *)&qpkt + reqsize); ptstamp--; get_systime(&ts); L_ADD(&ts, &delay_time); HTONL_FP(&ts, ptstamp); maclen = authencrypt(info_auth_keyid, (void *)&qpkt, reqsize); if (!maclen) { fprintf(stderr, "Key not found\n"); return 1; } else if (maclen != (info_auth_hashlen + sizeof(keyid_t))) { fprintf(stderr, "%d octet MAC, %lu expected with %lu octet digest\n", maclen, (u_long)(info_auth_hashlen + sizeof(keyid_t)), (u_long)info_auth_hashlen); return 1; } return sendpkt(&qpkt, reqsize + maclen); } /* * doquery - send a request and process the response */ int doquery( int implcode, int reqcode, int auth, int qitems, int qsize, char *qdata, int *ritems, int *rsize, char **rdata, int quiet_mask, int esize ) { int res; char junk[512]; fd_set fds; struct sock_timeval tvzero; /* * Check to make sure host is open */ if (!havehost) { (void) fprintf(stderr, "***No host open, use `host' command\n"); return -1; } /* * Poll the socket and clear out any pending data */ again: do { tvzero.tv_sec = tvzero.tv_usec = 0; FD_ZERO(&fds); FD_SET(sockfd, &fds); res = select(sockfd+1, &fds, (fd_set *)0, (fd_set *)0, &tvzero); if (res == -1) { warning("polling select", "", ""); return -1; } else if (res > 0) (void) recv(sockfd, junk, sizeof junk, 0); } while (res > 0); /* * send a request */ res = sendrequest(implcode, reqcode, auth, qitems, qsize, qdata); if (res != 0) return res; /* * Get the response. If we got a standard error, print a message */ res = getresponse(implcode, reqcode, ritems, rsize, rdata, esize); /* * Try to be compatible with older implementations of ntpd. */ if (res == INFO_ERR_FMT && req_pkt_size != 48) { int oldsize; oldsize = req_pkt_size; switch(req_pkt_size) { case REQ_LEN_NOMAC: req_pkt_size = 160; break; case 160: req_pkt_size = 48; break; } if (impl_ver == IMPL_XNTPD) { fprintf(stderr, "***Warning changing to older implementation\n"); return INFO_ERR_IMPL; } fprintf(stderr, "***Warning changing the request packet size from %d to %d\n", oldsize, req_pkt_size); goto again; } /* log error message if not told to be quiet */ if ((res > 0) && (((1 << res) & quiet_mask) == 0)) { switch(res) { case INFO_ERR_IMPL: /* Give us a chance to try the older implementation. */ if (implcode == IMPL_XNTPD) break; (void) fprintf(stderr, "***Server implementation incompatable with our own\n"); break; case INFO_ERR_REQ: (void) fprintf(stderr, "***Server doesn't implement this request\n"); break; case INFO_ERR_FMT: (void) fprintf(stderr, "***Server reports a format error in the received packet (shouldn't happen)\n"); break; case INFO_ERR_NODATA: (void) fprintf(stderr, "***Server reports data not found\n"); break; case INFO_ERR_AUTH: (void) fprintf(stderr, "***Permission denied\n"); break; case ERR_TIMEOUT: (void) fprintf(stderr, "***Request timed out\n"); break; case ERR_INCOMPLETE: (void) fprintf(stderr, "***Response from server was incomplete\n"); break; default: (void) fprintf(stderr, "***Server returns unknown error code %d\n", res); break; } } return res; } /* * getcmds - read commands from the standard input and execute them */ static void getcmds(void) { char * line; int count; ntp_readline_init(interactive ? prompt : NULL); for (;;) { line = ntp_readline(&count); if (NULL == line) break; docmd(line); free(line); } ntp_readline_uninit(); } #ifndef SYS_WINNT /* Under NT cannot handle SIGINT, WIN32 spawns a handler */ /* * abortcmd - catch interrupts and abort the current command */ static RETSIGTYPE abortcmd( int sig ) { if (current_output == stdout) (void) fflush(stdout); putc('\n', stderr); (void) fflush(stderr); if (jump) longjmp(interrupt_buf, 1); } #endif /* SYS_WINNT */ /* * docmd - decode the command line and execute a command */ static void docmd( const char *cmdline ) { char *tokens[1+MAXARGS+MOREARGS+2]; struct parse pcmd; int ntok; int i, ti; int rval; struct xcmd *xcmd; ai_fam_templ = ai_fam_default; /* * Tokenize the command line. If nothing on it, return. */ tokenize(cmdline, tokens, &ntok); if (ntok == 0) return; /* * Find the appropriate command description. */ i = findcmd(tokens[0], builtins, opcmds, &xcmd); if (i == 0) { (void) fprintf(stderr, "***Command `%s' unknown\n", tokens[0]); return; } else if (i >= 2) { (void) fprintf(stderr, "***Command `%s' ambiguous\n", tokens[0]); return; } /* * Save the keyword, then walk through the arguments, interpreting * as we go. */ pcmd.keyword = tokens[0]; pcmd.nargs = 0; ti = 1; for (i = 0; i < MAXARGS && xcmd->arg[i] != NO;) { if ((i+ti) >= ntok) { if (!(xcmd->arg[i] & OPT)) { printusage(xcmd, stderr); return; } break; } if ((xcmd->arg[i] & OPT) && (*tokens[i+ti] == '>')) break; rval = getarg(tokens[i+ti], (int)xcmd->arg[i], &pcmd.argval[i]); if (rval == -1) { ti++; continue; } if (rval == 0) return; pcmd.nargs++; i++; } /* Any extra args are assumed to be "OPT|NTP_STR". */ for ( ; i < MAXARGS + MOREARGS;) { if ((i+ti) >= ntok) break; rval = getarg(tokens[i+ti], (int)(OPT|NTP_STR), &pcmd.argval[i]); if (rval == -1) { ti++; continue; } if (rval == 0) return; pcmd.nargs++; i++; } i += ti; if (i < ntok && *tokens[i] == '>') { char *fname; if (*(tokens[i]+1) != '\0') fname = tokens[i]+1; else if ((i+1) < ntok) fname = tokens[i+1]; else { (void) fprintf(stderr, "***No file for redirect\n"); return; } current_output = fopen(fname, "w"); if (current_output == NULL) { (void) fprintf(stderr, "***Error opening %s: ", fname); perror(""); return; } } else { current_output = stdout; } if (interactive && setjmp(interrupt_buf)) { return; } else { jump = 1; (xcmd->handler)(&pcmd, current_output); jump = 0; if (current_output != stdout) (void) fclose(current_output); current_output = NULL; } } /* * tokenize - turn a command line into tokens */ static void tokenize( const char *line, char **tokens, int *ntok ) { register const char *cp; register char *sp; static char tspace[MAXLINE]; sp = tspace; cp = line; for (*ntok = 0; *ntok < MAXTOKENS; (*ntok)++) { tokens[*ntok] = sp; while (ISSPACE(*cp)) cp++; if (ISEOL(*cp)) break; do { *sp++ = *cp++; } while (!ISSPACE(*cp) && !ISEOL(*cp)); *sp++ = '\0'; } } /* * findcmd - find a command in a command description table */ static int findcmd( register char *str, struct xcmd *clist1, struct xcmd *clist2, struct xcmd **cmd ) { register struct xcmd *cl; register int clen; int nmatch; struct xcmd *nearmatch = NULL; struct xcmd *clist; clen = strlen(str); nmatch = 0; if (clist1 != 0) clist = clist1; else if (clist2 != 0) clist = clist2; else return 0; again: for (cl = clist; cl->keyword != 0; cl++) { /* do a first character check, for efficiency */ if (*str != *(cl->keyword)) continue; if (strncmp(str, cl->keyword, (unsigned)clen) == 0) { /* * Could be extact match, could be approximate. * Is exact if the length of the keyword is the * same as the str. */ if (*((cl->keyword) + clen) == '\0') { *cmd = cl; return 1; } nmatch++; nearmatch = cl; } } /* * See if there is more to do. If so, go again. Sorry about the * goto, too much looking at BSD sources... */ if (clist == clist1 && clist2 != 0) { clist = clist2; goto again; } /* * If we got extactly 1 near match, use it, else return number * of matches. */ if (nmatch == 1) { *cmd = nearmatch; return 1; } return nmatch; } /* * getarg - interpret an argument token * * string is always set. * type is set to the decoded type. * * return: 0 - failure * 1 - success * -1 - skip to next token */ static int getarg( char *str, int code, arg_v *argp ) { int isneg; char *cp, *np; static const char *digits = "0123456789"; memset(argp, 0, sizeof(*argp)); argp->string = str; argp->type = code & ~OPT; switch (argp->type) { case NTP_STR: break; case NTP_ADD: if (!strcmp("-6", str)) { ai_fam_templ = AF_INET6; return -1; } else if (!strcmp("-4", str)) { ai_fam_templ = AF_INET; return -1; } if (!getnetnum(str, &(argp->netnum), (char *)0, 0)) { return 0; } break; case NTP_INT: case NTP_UINT: isneg = 0; np = str; if (*np == '-') { np++; isneg = 1; } argp->uval = 0; do { cp = strchr(digits, *np); if (cp == NULL) { (void) fprintf(stderr, "***Illegal integer value %s\n", str); return 0; } argp->uval *= 10; argp->uval += (cp - digits); } while (*(++np) != '\0'); if (isneg) { if ((code & ~OPT) == NTP_UINT) { (void) fprintf(stderr, "***Value %s should be unsigned\n", str); return 0; } argp->ival = -argp->ival; } break; case IP_VERSION: if (!strcmp("-6", str)) argp->ival = 6 ; else if (!strcmp("-4", str)) argp->ival = 4 ; else { (void) fprintf(stderr, "***Version must be either 4 or 6\n"); return 0; } break; } return 1; } /* * getnetnum - given a host name, return its net number * and (optional) full name */ static int getnetnum( const char *hname, sockaddr_u *num, char *fullhost, int af ) { struct addrinfo hints, *ai = NULL; ZERO(hints); hints.ai_flags = AI_CANONNAME; #ifdef AI_ADDRCONFIG hints.ai_flags |= AI_ADDRCONFIG; #endif /* * decodenetnum only works with addresses, but handles syntax * that getaddrinfo doesn't: [2001::1]:1234 */ if (decodenetnum(hname, num)) { if (fullhost != NULL) getnameinfo(&num->sa, SOCKLEN(num), fullhost, LENHOSTNAME, NULL, 0, 0); return 1; } else if (getaddrinfo(hname, "ntp", &hints, &ai) == 0) { NTP_INSIST(sizeof(*num) >= ai->ai_addrlen); memcpy(num, ai->ai_addr, ai->ai_addrlen); if (fullhost != NULL) { if (ai->ai_canonname != NULL) { strncpy(fullhost, ai->ai_canonname, LENHOSTNAME); fullhost[LENHOSTNAME - 1] = '\0'; } else { getnameinfo(&num->sa, SOCKLEN(num), fullhost, LENHOSTNAME, NULL, 0, 0); } } return 1; } fprintf(stderr, "***Can't find host %s\n", hname); return 0; } /* * nntohost - convert network number to host name. This routine enforces * the showhostnames setting. */ char * nntohost( sockaddr_u *netnum ) { if (!showhostnames) return stoa(netnum); if (ISREFCLOCKADR(netnum)) return refnumtoa(netnum); return socktohost(netnum); } /* * Finally, the built in command handlers */ /* * help - tell about commands, or details of a particular command */ static void help( struct parse *pcmd, FILE *fp ) { struct xcmd *xcp; char *cmd; const char *list[100]; size_t word, words; size_t row, rows; size_t col, cols; size_t length; if (pcmd->nargs == 0) { words = 0; for (xcp = builtins; xcp->keyword != 0; xcp++) { if (*(xcp->keyword) != '?') list[words++] = xcp->keyword; } for (xcp = opcmds; xcp->keyword != 0; xcp++) list[words++] = xcp->keyword; qsort((void *)list, (size_t)words, sizeof(list[0]), helpsort); col = 0; for (word = 0; word < words; word++) { length = strlen(list[word]); col = max(col, length); } cols = SCREENWIDTH / ++col; rows = (words + cols - 1) / cols; fprintf(fp, "ntpdc commands:\n"); for (row = 0; row < rows; row++) { for (word = row; word < words; word += rows) fprintf(fp, "%-*.*s", col, col-1, list[word]); fprintf(fp, "\n"); } } else { cmd = pcmd->argval[0].string; words = findcmd(cmd, builtins, opcmds, &xcp); if (words == 0) { fprintf(stderr, "Command `%s' is unknown\n", cmd); return; } else if (words >= 2) { fprintf(stderr, "Command `%s' is ambiguous\n", cmd); return; } fprintf(fp, "function: %s\n", xcp->comment); printusage(xcp, fp); } } /* * helpsort - do hostname qsort comparisons */ static int helpsort( const void *t1, const void *t2 ) { const char * const * name1 = t1; const char * const * name2 = t2; return strcmp(*name1, *name2); } /* * printusage - print usage information for a command */ static void printusage( struct xcmd *xcp, FILE *fp ) { int i, opt46; opt46 = 0; (void) fprintf(fp, "usage: %s", xcp->keyword); for (i = 0; i < MAXARGS && xcp->arg[i] != NO; i++) { if (opt46 == 0 && (xcp->arg[i] & ~OPT) == NTP_ADD) { (void) fprintf(fp, " [ -4|-6 ]"); opt46 = 1; } if (xcp->arg[i] & OPT) (void) fprintf(fp, " [ %s ]", xcp->desc[i]); else (void) fprintf(fp, " %s", xcp->desc[i]); } (void) fprintf(fp, "\n"); } /* * timeout - set time out time */ static void timeout( struct parse *pcmd, FILE *fp ) { int val; if (pcmd->nargs == 0) { val = tvout.tv_sec * 1000 + tvout.tv_usec / 1000; (void) fprintf(fp, "primary timeout %d ms\n", val); } else { tvout.tv_sec = pcmd->argval[0].uval / 1000; tvout.tv_usec = (pcmd->argval[0].uval - (tvout.tv_sec * 1000)) * 1000; } } /* * my_delay - set delay for auth requests */ static void my_delay( struct parse *pcmd, FILE *fp ) { int isneg; u_long val; if (pcmd->nargs == 0) { val = delay_time.l_ui * 1000 + delay_time.l_uf / 4294967; (void) fprintf(fp, "delay %lu ms\n", val); } else { if (pcmd->argval[0].ival < 0) { isneg = 1; val = (u_long)(-pcmd->argval[0].ival); } else { isneg = 0; val = (u_long)pcmd->argval[0].ival; } delay_time.l_ui = val / 1000; val %= 1000; delay_time.l_uf = val * 4294967; /* 2**32/1000 */ if (isneg) L_NEG(&delay_time); } } /* * host - set the host we are dealing with. */ static void host( struct parse *pcmd, FILE *fp ) { int i; if (pcmd->nargs == 0) { if (havehost) (void) fprintf(fp, "current host is %s\n", currenthost); else (void) fprintf(fp, "no current host\n"); return; } i = 0; if (pcmd->nargs == 2) { if (!strcmp("-4", pcmd->argval[i].string)) ai_fam_templ = AF_INET; else if (!strcmp("-6", pcmd->argval[i].string)) ai_fam_templ = AF_INET6; else { if (havehost) (void) fprintf(fp, "current host remains %s\n", currenthost); else (void) fprintf(fp, "still no current host\n"); return; } i = 1; } if (openhost(pcmd->argval[i].string)) { (void) fprintf(fp, "current host set to %s\n", currenthost); } else { if (havehost) (void) fprintf(fp, "current host remains %s\n", currenthost); else (void) fprintf(fp, "still no current host\n"); } } /* * keyid - get a keyid to use for authenticating requests */ static void keyid( struct parse *pcmd, FILE *fp ) { if (pcmd->nargs == 0) { if (info_auth_keyid == 0 && !keyid_entered) (void) fprintf(fp, "no keyid defined\n"); else if (info_auth_keyid == 0 && keyid_entered) (void) fprintf(fp, "no keyid will be sent\n"); else (void) fprintf(fp, "keyid is %lu\n", (u_long)info_auth_keyid); } else { info_auth_keyid = pcmd->argval[0].uval; keyid_entered = 1; } } /* * keytype - get type of key to use for authenticating requests */ static void keytype( struct parse *pcmd, FILE *fp ) { const char * digest_name; size_t digest_len; int key_type; if (!pcmd->nargs) { fprintf(fp, "keytype is %s with %lu octet digests\n", keytype_name(info_auth_keytype), (u_long)info_auth_hashlen); return; } digest_name = pcmd->argval[0].string; digest_len = 0; key_type = keytype_from_text(digest_name, &digest_len); if (!key_type) { fprintf(fp, "keytype must be 'md5'%s\n", #ifdef OPENSSL " or a digest type provided by OpenSSL"); #else ""); #endif return; } info_auth_keytype = key_type; info_auth_hashlen = digest_len; } /* * passwd - get an authentication key */ /*ARGSUSED*/ static void passwd( struct parse *pcmd, FILE *fp ) { char *pass; if (info_auth_keyid == 0) { info_auth_keyid = getkeyid("Keyid: "); if (info_auth_keyid == 0) { (void)fprintf(fp, "Keyid must be defined\n"); return; } } if (!interactive) { authusekey(info_auth_keyid, info_auth_keytype, (u_char *)pcmd->argval[0].string); authtrust(info_auth_keyid, 1); } else { pass = getpass_keytype(info_auth_keytype); if (*pass == '\0') (void) fprintf(fp, "Password unchanged\n"); else { authusekey(info_auth_keyid, info_auth_keytype, (u_char *)pass); authtrust(info_auth_keyid, 1); } } } /* * hostnames - set the showhostnames flag */ static void hostnames( struct parse *pcmd, FILE *fp ) { if (pcmd->nargs == 0) { if (showhostnames) (void) fprintf(fp, "hostnames being shown\n"); else (void) fprintf(fp, "hostnames not being shown\n"); } else { if (STREQ(pcmd->argval[0].string, "yes")) showhostnames = 1; else if (STREQ(pcmd->argval[0].string, "no")) showhostnames = 0; else (void)fprintf(stderr, "What?\n"); } } /* * setdebug - set/change debugging level */ static void setdebug( struct parse *pcmd, FILE *fp ) { if (pcmd->nargs == 0) { (void) fprintf(fp, "debug level is %d\n", debug); return; } else if (STREQ(pcmd->argval[0].string, "no")) { debug = 0; } else if (STREQ(pcmd->argval[0].string, "more")) { debug++; } else if (STREQ(pcmd->argval[0].string, "less")) { debug--; } else { (void) fprintf(fp, "What?\n"); return; } (void) fprintf(fp, "debug level set to %d\n", debug); } /* * quit - stop this nonsense */ /*ARGSUSED*/ static void quit( struct parse *pcmd, FILE *fp ) { if (havehost) closesocket(sockfd); exit(0); } /* * version - print the current version number */ /*ARGSUSED*/ static void version( struct parse *pcmd, FILE *fp ) { (void) fprintf(fp, "%s\n", Version); return; } /* * warning - print a warning message */ static void warning( const char *fmt, const char *st1, const char *st2 ) { (void) fprintf(stderr, "%s: ", progname); (void) fprintf(stderr, fmt, st1, st2); (void) fprintf(stderr, ": "); perror(""); } /* * error - print a message and exit */ static void error( const char *fmt, const char *st1, const char *st2 ) { warning(fmt, st1, st2); exit(1); } /* * getkeyid - prompt the user for a keyid to use */ static u_long getkeyid( const char *keyprompt ) { int c; FILE *fi; char pbuf[20]; size_t i; size_t ilim; #ifndef SYS_WINNT if ((fi = fdopen(open("/dev/tty", 2), "r")) == NULL) #else if ((fi = _fdopen(open("CONIN$", _O_TEXT), "r")) == NULL) #endif /* SYS_WINNT */ fi = stdin; else setbuf(fi, (char *)NULL); fprintf(stderr, "%s", keyprompt); fflush(stderr); for (i = 0, ilim = COUNTOF(pbuf) - 1; i < ilim && (c = getc(fi)) != '\n' && c != EOF; ) pbuf[i++] = (char)c; pbuf[i] = '\0'; if (fi != stdin) fclose(fi); return (u_long) atoi(pbuf); } ntp-4.2.6p5/ntpdc/ntpdc-opts.texi0000644000175000017500000002105511675460601015720 0ustar peterpeter@node ntpdc Invocation @section Invoking ntpdc @pindex ntpdc @cindex vendor-specific NTP query program @ignore # # EDIT THIS FILE WITH CAUTION (ntpdc-opts.texi) # # It has been AutoGen-ed December 24, 2011 at 06:34:25 PM by AutoGen 5.12 # From the definitions ntpdc-opts.def # and the template file aginfo.tpl @end ignore This program has no explanation. The [= prog-name =] utility program is used to query an NTP daemon about its current state and to request changes in that state. It uses NTP mode 7 control message formats described in the source code. The program may be run either in interactive mode or controlled using command line arguments. Extensive state and statistics information is available through the [= prog-name =] interface. In addition, nearly all the configuration options which can be specified at startup using ntpd's configuration file may also be specified at run time using [= prog-name =] . This section was generated by @strong{AutoGen}, the aginfo template and the option descriptions for the @command{ntpdc} program. It documents the @command{ntpdc} usage text and option meanings. This software is released under a specialized copyright license. @menu * ntpdc usage:: ntpdc usage help (-?) * ntpdc command:: command option (-c) * ntpdc debug-level:: debug-level option (-d) * ntpdc interactive:: interactive option (-i) * ntpdc ipv4:: ipv4 option (-4) * ntpdc ipv6:: ipv6 option (-6) * ntpdc listpeers:: listpeers option (-l) * ntpdc numeric:: numeric option (-n) * ntpdc peers:: peers option (-p) * ntpdc set-debug-level:: set-debug-level option (-D) * ntpdc showpeers:: showpeers option (-s) @end menu @node ntpdc usage @subsection ntpdc usage help (-?) @cindex ntpdc usage This is the automatically generated usage text for ntpdc: @exampleindent 0 @example ntpdc - vendor-specific NTP query program - Ver. 4.2.6p5 USAGE: ntpdc [ - [] | --[@{=| @}] ]... [ host ...] Flg Arg Option-Name Description -4 no ipv4 Force IPv4 DNS name resolution - prohibits these options: ipv6 -6 no ipv6 Force IPv6 DNS name resolution - prohibits these options: ipv4 -c Str command run a command and exit - may appear multiple times -l no listpeers Print a list of the peers - prohibits these options: command -p no peers Print a list of the peers - prohibits these options: command -s no showpeers Show a list of the peers - prohibits these options: command -i no interactive Force ntpq to operate in interactive mode - prohibits these options: command listpeers peers showpeers -d no debug-level Increase output debug message level - may appear multiple times -D Str set-debug-level Set the output debug message level - may appear multiple times -n no numeric numeric host addresses opt version Output version information and exit -? no help Display extended usage information and exit -! no more-help Extended usage information passed thru pager -> opt save-opts Save the option state to a config file -< Str load-opts Load options from a config file - disabled as --no-load-opts - may appear multiple times Options are specified by doubled hyphens and their name or by a single hyphen and the flag character. The following option preset mechanisms are supported: - reading file $HOME/.ntprc - reading file ./.ntprc - examining environment variables named NTPDC_* The [= prog-name =] utility program is used to query an NTP daemon about its current state and to request changes in that state. It uses NTP mode 7 control message formats described in the source code. The program may be run either in interactive mode or controlled using command line arguments. Extensive state and statistics information is available through the [= prog-name =] interface. In addition, nearly all the configuration options which can be specified at startup using ntpd's configuration file may also be specified at run time using [= prog-name =] . please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org @end example @exampleindent 4 @node ntpdc command @subsection command option (-c) @cindex ntpdc-command This is the ``run a command and exit'' option. This option has some usage constraints. It: @itemize @bullet @item may appear an unlimited number of times. @end itemize The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). @node ntpdc debug-level @subsection debug-level option (-d) @cindex ntpdc-debug-level This is the ``increase output debug message level'' option. This option has some usage constraints. It: @itemize @bullet @item may appear an unlimited number of times. @end itemize Increase the debugging message output level. @node ntpdc interactive @subsection interactive option (-i) @cindex ntpdc-interactive This is the ``force ntpq to operate in interactive mode'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: command, listpeers, peers, showpeers. @end itemize Force ntpq to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input. @node ntpdc ipv4 @subsection ipv4 option (-4) @cindex ntpdc-ipv4 This is the ``force ipv4 dns name resolution'' option. 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. @node ntpdc ipv6 @subsection ipv6 option (-6) @cindex ntpdc-ipv6 This is the ``force ipv6 dns name resolution'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: ipv4. @end itemize Force DNS resolution of following host names on the command line to the IPv6 namespace. @node ntpdc listpeers @subsection listpeers option (-l) @cindex ntpdc-listpeers This is the ``print a list of the peers'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: command. @end itemize Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'listpeers' interactive command. @node ntpdc numeric @subsection numeric option (-n) @cindex ntpdc-numeric This is the ``numeric host addresses'' option. Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names. @node ntpdc peers @subsection peers option (-p) @cindex ntpdc-peers This is the ``print a list of the peers'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: command. @end itemize Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'peers' interactive command. @node ntpdc set-debug-level @subsection set-debug-level option (-D) @cindex ntpdc-set-debug-level This is the ``set the output debug message level'' option. This option has some usage constraints. It: @itemize @bullet @item may appear an unlimited number of times. @end itemize Set the output debugging level. Can be supplied multiple times, but each overrides the previous value(s). @node ntpdc showpeers @subsection showpeers option (-s) @cindex ntpdc-showpeers This is the ``show a list of the peers'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: command. @end itemize Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'dmpeers' interactive command. ntp-4.2.6p5/ntpdc/nl_in.c0000644000175000017500000000010010017034572014152 0ustar peterpeter#include #include "ntpdc.h" #include "ntp_request.h" ntp-4.2.6p5/ntpdc/layout.std0000644000175000017500000002315311307651603014760 0ustar peterpetersizeof(struct req_pkt) = 216 offsetof(rm_vn_mode) = 0 offsetof(auth_seq) = 1 offsetof(implementation) = 2 offsetof(request) = 3 offsetof(err_nitems) = 4 offsetof(mbz_itemsize) = 6 offsetof(data) = 8 offsetof(tstamp) = 184 offsetof(keyid) = 192 offsetof(mac) = 196 sizeof(struct req_pkt_tail) = 32 offsetof(tstamp) = 0 offsetof(keyid) = 8 offsetof(mac) = 12 sizeof(struct resp_pkt) = 508 offsetof(rm_vn_mode) = 0 offsetof(auth_seq) = 1 offsetof(implementation) = 2 offsetof(request) = 3 offsetof(err_nitems) = 4 offsetof(mbz_itemsize) = 6 offsetof(data) = 8 sizeof(struct info_peer_list) = 32 offsetof(addr) = 0 offsetof(port) = 4 offsetof(hmode) = 6 offsetof(flags) = 7 offsetof(v6_flag) = 8 offsetof(unused1) = 12 offsetof(addr6) = 16 sizeof(struct info_peer_summary) = 72 offsetof(dstadr) = 0 offsetof(srcadr) = 4 offsetof(srcport) = 8 offsetof(stratum) = 10 offsetof(hpoll) = 11 offsetof(ppoll) = 12 offsetof(reach) = 13 offsetof(flags) = 14 offsetof(hmode) = 15 offsetof(delay) = 16 offsetof(offset) = 20 offsetof(dispersion) = 28 offsetof(v6_flag) = 32 offsetof(unused1) = 36 offsetof(dstadr6) = 40 offsetof(srcadr6) = 56 sizeof(struct info_peer) = 280 offsetof(dstadr) = 0 offsetof(srcadr) = 4 offsetof(srcport) = 8 offsetof(flags) = 10 offsetof(leap) = 11 offsetof(hmode) = 12 offsetof(pmode) = 13 offsetof(stratum) = 14 offsetof(ppoll) = 15 offsetof(hpoll) = 16 offsetof(precision) = 17 offsetof(version) = 18 offsetof(unused8) = 19 offsetof(reach) = 20 offsetof(unreach) = 21 offsetof(flash) = 22 offsetof(ttl) = 23 offsetof(flash2) = 24 offsetof(associd) = 26 offsetof(keyid) = 28 offsetof(pkeyid) = 32 offsetof(refid) = 36 offsetof(timer) = 40 offsetof(rootdelay) = 44 offsetof(rootdispersion) = 48 offsetof(reftime) = 52 offsetof(org) = 60 offsetof(rec) = 68 offsetof(xmt) = 76 offsetof(filtdelay) = 84 offsetof(filtoffset) = 116 offsetof(order) = 180 offsetof(delay) = 188 offsetof(dispersion) = 192 offsetof(offset) = 196 offsetof(selectdisp) = 204 offsetof(unused1) = 208 offsetof(unused2) = 212 offsetof(unused3) = 216 offsetof(unused4) = 220 offsetof(unused5) = 224 offsetof(unused6) = 228 offsetof(unused7) = 232 offsetof(estbdelay) = 236 offsetof(v6_flag) = 240 offsetof(unused9) = 244 offsetof(dstadr6) = 248 offsetof(srcadr6) = 264 sizeof(struct info_peer_stats) = 120 offsetof(dstadr) = 0 offsetof(srcadr) = 4 offsetof(srcport) = 8 offsetof(flags) = 10 offsetof(timereset) = 12 offsetof(timereceived) = 16 offsetof(timetosend) = 20 offsetof(timereachable) = 24 offsetof(sent) = 28 offsetof(unused1) = 32 offsetof(processed) = 36 offsetof(unused2) = 40 offsetof(badauth) = 44 offsetof(bogusorg) = 48 offsetof(oldpkt) = 52 offsetof(unused3) = 56 offsetof(unused4) = 60 offsetof(seldisp) = 64 offsetof(selbroken) = 68 offsetof(unused5) = 72 offsetof(candidate) = 76 offsetof(unused6) = 77 offsetof(unused7) = 78 offsetof(unused8) = 79 offsetof(v6_flag) = 80 offsetof(unused9) = 84 offsetof(dstadr6) = 88 offsetof(srcadr6) = 104 sizeof(struct info_loop) = 24 offsetof(last_offset) = 0 offsetof(drift_comp) = 8 offsetof(compliance) = 16 offsetof(watchdog_timer) = 20 sizeof(struct info_sys) = 80 offsetof(peer) = 0 offsetof(peer_mode) = 4 offsetof(leap) = 5 offsetof(stratum) = 6 offsetof(precision) = 7 offsetof(rootdelay) = 8 offsetof(rootdispersion) = 12 offsetof(refid) = 16 offsetof(reftime) = 20 offsetof(poll) = 28 offsetof(flags) = 32 offsetof(unused1) = 33 offsetof(unused2) = 34 offsetof(unused3) = 35 offsetof(bdelay) = 36 offsetof(frequency) = 40 offsetof(authdelay) = 44 offsetof(stability) = 52 offsetof(v6_flag) = 56 offsetof(unused4) = 60 offsetof(peer6) = 64 sizeof(struct info_sys_stats) = 44 offsetof(timeup) = 0 offsetof(timereset) = 4 offsetof(denied) = 8 offsetof(oldversionpkt) = 12 offsetof(newversionpkt) = 16 offsetof(unknownversion) = 20 offsetof(badlength) = 24 offsetof(processed) = 28 offsetof(badauth) = 32 offsetof(received) = 36 offsetof(limitrejected) = 40 sizeof(struct old_info_sys_stats) = 40 offsetof(timeup) = 0 offsetof(timereset) = 4 offsetof(denied) = 8 offsetof(oldversionpkt) = 12 offsetof(newversionpkt) = 16 offsetof(unknownversion) = 20 offsetof(badlength) = 24 offsetof(processed) = 28 offsetof(badauth) = 32 offsetof(wanderhold) = 36 sizeof(struct info_mem_stats) = 148 offsetof(timereset) = 0 offsetof(totalpeermem) = 4 offsetof(freepeermem) = 6 offsetof(findpeer_calls) = 8 offsetof(allocations) = 12 offsetof(demobilizations) = 16 offsetof(hashcount) = 20 sizeof(struct info_io_stats) = 40 offsetof(timereset) = 0 offsetof(totalrecvbufs) = 4 offsetof(freerecvbufs) = 6 offsetof(fullrecvbufs) = 8 offsetof(lowwater) = 10 offsetof(dropped) = 12 offsetof(ignored) = 16 offsetof(received) = 20 offsetof(sent) = 24 offsetof(notsent) = 28 offsetof(interrupts) = 32 offsetof(int_received) = 36 sizeof(struct info_timer_stats) = 16 offsetof(timereset) = 0 offsetof(alarms) = 4 offsetof(overflows) = 8 offsetof(xmtcalls) = 12 sizeof(struct old_conf_peer) = 16 offsetof(peeraddr) = 0 offsetof(hmode) = 4 offsetof(version) = 5 offsetof(minpoll) = 6 offsetof(maxpoll) = 7 offsetof(flags) = 8 offsetof(ttl) = 9 offsetof(unused) = 10 offsetof(keyid) = 12 sizeof(struct conf_peer) = 168 offsetof(peeraddr) = 0 offsetof(hmode) = 4 offsetof(version) = 5 offsetof(minpoll) = 6 offsetof(maxpoll) = 7 offsetof(flags) = 8 offsetof(ttl) = 9 offsetof(unused1) = 10 offsetof(keyid) = 12 offsetof(keystr) = 16 offsetof(v6_flag) = 144 offsetof(unused2) = 148 offsetof(peeraddr6) = 152 sizeof(struct conf_unpeer) = 24 offsetof(peeraddr) = 0 offsetof(v6_flag) = 4 offsetof(peeraddr6) = 8 sizeof(struct conf_sys_flags) = 4 offsetof(flags) = 0 sizeof(struct info_restrict) = 56 offsetof(addr) = 0 offsetof(mask) = 4 offsetof(count) = 8 offsetof(flags) = 12 offsetof(mflags) = 14 offsetof(v6_flag) = 16 offsetof(unused1) = 20 offsetof(addr6) = 24 offsetof(mask6) = 40 sizeof(struct conf_restrict) = 48 offsetof(addr) = 0 offsetof(mask) = 4 offsetof(flags) = 8 offsetof(mflags) = 10 offsetof(v6_flag) = 12 offsetof(addr6) = 16 offsetof(mask6) = 32 sizeof(struct info_monitor_1) = 72 offsetof(lasttime) = 0 offsetof(firsttime) = 4 offsetof(restr) = 8 offsetof(count) = 12 offsetof(addr) = 16 offsetof(daddr) = 20 offsetof(flags) = 24 offsetof(port) = 28 offsetof(mode) = 30 offsetof(version) = 31 offsetof(v6_flag) = 32 offsetof(unused1) = 36 offsetof(addr6) = 40 offsetof(daddr6) = 56 sizeof(struct info_monitor) = 48 offsetof(lasttime) = 0 offsetof(firsttime) = 4 offsetof(restr) = 8 offsetof(count) = 12 offsetof(addr) = 16 offsetof(port) = 20 offsetof(mode) = 22 offsetof(version) = 23 offsetof(v6_flag) = 24 offsetof(unused1) = 28 offsetof(addr6) = 32 sizeof(struct old_info_monitor) = 40 offsetof(lasttime) = 0 offsetof(firsttime) = 4 offsetof(count) = 8 offsetof(addr) = 12 offsetof(port) = 16 offsetof(mode) = 18 offsetof(version) = 19 offsetof(v6_flag) = 20 offsetof(addr6) = 24 sizeof(struct reset_flags) = 4 offsetof(flags) = 0 sizeof(struct info_auth) = 36 offsetof(timereset) = 0 offsetof(numkeys) = 4 offsetof(numfreekeys) = 8 offsetof(keylookups) = 12 offsetof(keynotfound) = 16 offsetof(encryptions) = 20 offsetof(decryptions) = 24 offsetof(expired) = 28 offsetof(keyuncached) = 32 sizeof(struct info_trap) = 64 offsetof(local_address) = 0 offsetof(trap_address) = 4 offsetof(trap_port) = 8 offsetof(sequence) = 10 offsetof(settime) = 12 offsetof(origtime) = 16 offsetof(resets) = 20 offsetof(flags) = 24 offsetof(v6_flag) = 28 offsetof(local_address6) = 32 offsetof(trap_address6) = 48 sizeof(struct conf_trap) = 48 offsetof(local_address) = 0 offsetof(trap_address) = 4 offsetof(trap_port) = 8 offsetof(unused) = 10 offsetof(v6_flag) = 12 offsetof(local_address6) = 16 offsetof(trap_address6) = 32 sizeof(struct info_control) = 60 offsetof(ctltimereset) = 0 offsetof(numctlreq) = 4 offsetof(numctlbadpkts) = 8 offsetof(numctlresponses) = 12 offsetof(numctlfrags) = 16 offsetof(numctlerrors) = 20 offsetof(numctltooshort) = 24 offsetof(numctlinputresp) = 28 offsetof(numctlinputfrag) = 32 offsetof(numctlinputerr) = 36 offsetof(numctlbadoffset) = 40 offsetof(numctlbadversion) = 44 offsetof(numctldatatooshort) = 48 offsetof(numctlbadop) = 52 offsetof(numasyncmsgs) = 56 sizeof(struct info_clock) = 52 offsetof(clockadr) = 0 offsetof(type) = 4 offsetof(flags) = 5 offsetof(lastevent) = 6 offsetof(currentstatus) = 7 offsetof(polls) = 8 offsetof(noresponse) = 12 offsetof(badformat) = 16 offsetof(baddata) = 20 offsetof(timestarted) = 24 offsetof(fudgetime1) = 28 offsetof(fudgetime2) = 36 offsetof(fudgeval1) = 44 offsetof(fudgeval2) = 48 sizeof(struct conf_fudge) = 20 offsetof(clockadr) = 0 offsetof(which) = 4 offsetof(fudgetime) = 8 offsetof(fudgeval_flags) = 16 sizeof(struct info_clkbug) = 332 offsetof(clockadr) = 0 offsetof(nvalues) = 4 offsetof(ntimes) = 5 offsetof(svalues) = 6 offsetof(stimes) = 8 offsetof(values) = 12 offsetof(times) = 76 sizeof(struct info_kernel) = 60 offsetof(offset) = 0 offsetof(freq) = 4 offsetof(maxerror) = 8 offsetof(esterror) = 12 offsetof(status) = 16 offsetof(shift) = 18 offsetof(constant) = 20 offsetof(precision) = 24 offsetof(tolerance) = 28 offsetof(ppsfreq) = 32 offsetof(jitter) = 36 offsetof(stabil) = 40 offsetof(jitcnt) = 44 offsetof(calcnt) = 48 offsetof(errcnt) = 52 offsetof(stbcnt) = 56 sizeof(struct info_if_stats) = 136 offsetof(unaddr) = 0 offsetof(unbcast) = 16 offsetof(unmask) = 32 offsetof(v6_flag) = 48 offsetof(name) = 52 offsetof(flags) = 84 offsetof(last_ttl) = 88 offsetof(num_mcast) = 92 offsetof(received) = 96 offsetof(sent) = 100 offsetof(notsent) = 104 offsetof(uptime) = 108 offsetof(scopeid) = 112 offsetof(ifindex) = 116 offsetof(ifnum) = 120 offsetof(peercnt) = 124 offsetof(family) = 128 offsetof(ignore_packets) = 130 offsetof(action) = 131 offsetof(_filler0) = 132 sizeof(struct info_dns_assoc) = 32 offsetof(peeraddr) = 0 offsetof(associd) = 4 offsetof(hostname) = 6 ntp-4.2.6p5/ntpdc/nl.pl0000755000175000017500000000145711675460433013712 0ustar peterpeter#! /usr/local/perl-5.8.8/bin/perl -w $found = 0; $last = 0; $debug = 0; while (<>) { next if /^#/; next if /^\s*$/; if (/^struct req_pkt/) { $found = 1; } if (/^struct info_dns_assoc/) { $last = 1; } if ($found) { if (/^(struct\s*\w*)\s*{\s*$/) { $type = $1; print STDERR "type = '$type'\n" if $debug; printf " printf(\"sizeof($type) = %%d\\n\", \n\t (int) sizeof($type));\n"; next; } if (/\s*\w+\s+(\w*)\s*(\[.*\])?\s*;\s*$/) { $field = $1; print STDERR "\tfield = '$field'\n" if $debug; printf " printf(\"offsetof($field) = %%d\\n\", \n\t (int) offsetof($type, $field));\n"; next; } if (/^}\s*;\s*$/) { printf " printf(\"\\n\");\n\n"; $found = 0 if $last; next; } print STDERR "Unmatched line: $_"; exit 1; } } ntp-4.2.6p5/ntpdc/ntpdc-opts.c0000644000175000017500000005352511675460570015205 0ustar peterpeter/* * EDIT THIS FILE WITH CAUTION (ntpdc-opts.c) * * It has been AutoGen-ed December 24, 2011 at 06:34:16 PM by AutoGen 5.12 * From the definitions ntpdc-opts.def * and the template file options * * Generated from AutoOpts 35:0:10 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the ntpdc author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * This source file is copyrighted and licensed under the following terms: * * see html/copyright.html * */ #include #include #include #include #define OPTION_CODE_COMPILE 1 #include "ntpdc-opts.h" #ifdef __cplusplus extern "C" { #endif extern FILE * option_usage_fp; /* TRANSLATORS: choose the translation for option names wisely because you cannot ever change your mind. */ static char const zCopyright[39] = "ntpdc 4.2.6p5\n\ see html/copyright.html\n"; static char const zLicenseDescrip[25] = "see html/copyright.html\n"; extern tUsageProc optionUsage; /* * global included definitions */ #ifdef __windows extern int atoi(const char*); #else # include #endif #ifndef NULL # define NULL 0 #endif /* * Ipv4 option description with * "Must also have options" and "Incompatible options": */ static char const zIpv4Text[] = "Force IPv4 DNS name resolution"; static char const zIpv4_NAME[] = "IPV4"; static char const zIpv4_Name[] = "ipv4"; static const int aIpv4CantList[] = { INDEX_OPT_IPV6, NO_EQUIVALENT }; #define IPV4_FLAGS (OPTST_DISABLED) /* * Ipv6 option description with * "Must also have options" and "Incompatible options": */ static char const zIpv6Text[] = "Force IPv6 DNS name resolution"; static char const zIpv6_NAME[] = "IPV6"; static char const zIpv6_Name[] = "ipv6"; static const int aIpv6CantList[] = { INDEX_OPT_IPV4, NO_EQUIVALENT }; #define IPV6_FLAGS (OPTST_DISABLED) /* * Command option description: */ static char const zCommandText[] = "run a command and exit"; static char const zCommand_NAME[] = "COMMAND"; static char const zCommand_Name[] = "command"; #define COMMAND_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Listpeers option description with * "Must also have options" and "Incompatible options": */ static char const zListpeersText[] = "Print a list of the peers"; static char const zListpeers_NAME[] = "LISTPEERS"; static char const zListpeers_Name[] = "listpeers"; static const int aListpeersCantList[] = { INDEX_OPT_COMMAND, NO_EQUIVALENT }; #define LISTPEERS_FLAGS (OPTST_DISABLED) /* * Peers option description with * "Must also have options" and "Incompatible options": */ static char const zPeersText[] = "Print a list of the peers"; static char const zPeers_NAME[] = "PEERS"; static char const zPeers_Name[] = "peers"; static const int aPeersCantList[] = { INDEX_OPT_COMMAND, NO_EQUIVALENT }; #define PEERS_FLAGS (OPTST_DISABLED) /* * Showpeers option description with * "Must also have options" and "Incompatible options": */ static char const zShowpeersText[] = "Show a list of the peers"; static char const zShowpeers_NAME[] = "SHOWPEERS"; static char const zShowpeers_Name[] = "showpeers"; static const int aShowpeersCantList[] = { INDEX_OPT_COMMAND, NO_EQUIVALENT }; #define SHOWPEERS_FLAGS (OPTST_DISABLED) /* * Interactive option description with * "Must also have options" and "Incompatible options": */ static char const zInteractiveText[] = "Force ntpq to operate in interactive mode"; static char const zInteractive_NAME[] = "INTERACTIVE"; static char const zInteractive_Name[] = "interactive"; static const int aInteractiveCantList[] = { INDEX_OPT_COMMAND, INDEX_OPT_LISTPEERS, INDEX_OPT_PEERS, INDEX_OPT_SHOWPEERS, NO_EQUIVALENT }; #define INTERACTIVE_FLAGS (OPTST_DISABLED) /* * Debug_Level option description: */ static char const zDebug_LevelText[] = "Increase output debug message level"; static char const zDebug_Level_NAME[] = "DEBUG_LEVEL"; static char const zDebug_Level_Name[] = "debug-level"; #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) /* * Set_Debug_Level option description: */ static char const zSet_Debug_LevelText[] = "Set the output debug message level"; static char const zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL"; static char const zSet_Debug_Level_Name[] = "set-debug-level"; #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Numeric option description: */ static char const zNumericText[] = "numeric host addresses"; static char const zNumeric_NAME[] = "NUMERIC"; static char const zNumeric_Name[] = "numeric"; #define NUMERIC_FLAGS (OPTST_DISABLED) /* * Help/More_Help/Version option descriptions: */ static char const zHelpText[] = "Display extended usage information and exit"; static char const zHelp_Name[] = "help"; #ifdef HAVE_WORKING_FORK #define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) static char const zMore_Help_Name[] = "more-help"; static char const zMore_HelpText[] = "Extended usage information passed thru pager"; #else #define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMore_Help_Name NULL #define zMore_HelpText NULL #endif #ifdef NO_OPTIONAL_OPT_ARGS # define OPTST_VERSION_FLAGS OPTST_IMM | OPTST_NO_INIT #else # define OPTST_VERSION_FLAGS OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif static char const zVersionText[] = "Output version information and exit"; static char const zVersion_Name[] = "version"; static char const zSave_OptsText[] = "Save the option state to a config file"; static char const zSave_Opts_Name[] = "save-opts"; static char const zLoad_OptsText[] = "Load options from a config file"; static char const zLoad_Opts_NAME[] = "LOAD_OPTS"; static char const zNotLoad_Opts_Name[] = "no-load-opts"; static char const zNotLoad_Opts_Pfx[] = "no"; #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3) /* * Declare option callback procedures */ #if defined(TEST_NTPDC_OPTS) /* * Under test, omit argument processing, or call optionStackArg, * if multiple copies are allowed. */ static tOptProc doUsageOpt; /* * #define map the "normal" callout procs to the test ones... */ #define SET_DEBUG_LEVEL_OPT_PROC optionStackArg #else /* NOT defined TEST_NTPDC_OPTS */ /* * When not under test, there are different procs to use */ extern tOptProc optionBooleanVal, optionNestedVal, optionNumericVal, optionPagedUsage, optionPrintVersion, optionResetOpt, optionStackArg, optionTimeDate, optionTimeVal, optionUnstackArg, optionVersionStderr; static tOptProc doOptSet_Debug_Level, doUsageOpt; /* * #define map the "normal" callout procs */ #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level #define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level #endif /* defined(TEST_NTPDC_OPTS) */ #ifdef TEST_NTPDC_OPTS # define DOVERPROC optionVersionStderr #else # define DOVERPROC optionPrintVersion #endif /* TEST_NTPDC_OPTS */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the Ntpdc Option Descriptions. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_IPV4, /* equiv idx, value */ 0, VALUE_OPT_IPV4, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ IPV4_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aIpv4CantList, /* option proc */ NULL, /* desc, NAME, name */ zIpv4Text, zIpv4_NAME, zIpv4_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 1, VALUE_OPT_IPV6, /* equiv idx, value */ 1, VALUE_OPT_IPV6, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ IPV6_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aIpv6CantList, /* option proc */ NULL, /* desc, NAME, name */ zIpv6Text, zIpv6_NAME, zIpv6_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 2, VALUE_OPT_COMMAND, /* equiv idx, value */ 2, VALUE_OPT_COMMAND, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ COMMAND_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionStackArg, /* desc, NAME, name */ zCommandText, zCommand_NAME, zCommand_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 3, VALUE_OPT_LISTPEERS, /* equiv idx, value */ 3, VALUE_OPT_LISTPEERS, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ LISTPEERS_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aListpeersCantList, /* option proc */ NULL, /* desc, NAME, name */ zListpeersText, zListpeers_NAME, zListpeers_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 4, VALUE_OPT_PEERS, /* equiv idx, value */ 4, VALUE_OPT_PEERS, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PEERS_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aPeersCantList, /* option proc */ NULL, /* desc, NAME, name */ zPeersText, zPeers_NAME, zPeers_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 5, VALUE_OPT_SHOWPEERS, /* equiv idx, value */ 5, VALUE_OPT_SHOWPEERS, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SHOWPEERS_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aShowpeersCantList, /* option proc */ NULL, /* desc, NAME, name */ zShowpeersText, zShowpeers_NAME, zShowpeers_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 6, VALUE_OPT_INTERACTIVE, /* equiv idx, value */ 6, VALUE_OPT_INTERACTIVE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ INTERACTIVE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aInteractiveCantList, /* option proc */ NULL, /* desc, NAME, name */ zInteractiveText, zInteractive_NAME, zInteractive_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 7, VALUE_OPT_DEBUG_LEVEL, /* equiv idx, value */ 7, VALUE_OPT_DEBUG_LEVEL, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ DEBUG_LEVEL_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zDebug_LevelText, zDebug_Level_NAME, zDebug_Level_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 8, VALUE_OPT_SET_DEBUG_LEVEL, /* equiv idx, value */ 8, VALUE_OPT_SET_DEBUG_LEVEL, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ SET_DEBUG_LEVEL_OPT_PROC, /* desc, NAME, name */ zSet_Debug_LevelText, zSet_Debug_Level_NAME, zSet_Debug_Level_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 9, VALUE_OPT_NUMERIC, /* equiv idx, value */ 9, VALUE_OPT_NUMERIC, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ NUMERIC_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zNumericText, zNumeric_NAME, zNumeric_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_VERSION_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ DOVERPROC, /* desc, NAME, name */ zVersionText, NULL, zVersion_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doUsageOpt, /* desc, NAME, name */ zHelpText, NULL, zHelp_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_MORE_HELP_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionPagedUsage, /* desc, NAME, name */ zMore_HelpText, NULL, zMore_Help_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zSave_OptsText, NULL, zSave_Opts_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_DISABLE_IMM, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionLoadOpt, /* desc, NAME, name */ zLoad_OptsText, zLoad_Opts_NAME, zLoad_Opts_Name, /* disablement strs */ zNotLoad_Opts_Name, zNotLoad_Opts_Pfx } }; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the Ntpdc Option Environment */ static char const zPROGNAME[6] = "NTPDC"; static char const zUsageTitle[127] = "ntpdc - vendor-specific NTP query program - Ver. 4.2.6p5\n\ USAGE: %s [ - [] | --[{=| }] ]... [ host ...]\n"; static char const zRcName[7] = ".ntprc"; static char const * const apzHomeList[3] = { "$HOME", ".", NULL }; static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org"; #define zExplain NULL static char const zDetail[601] = "\n\ The [= prog-name =] utility program is used to query an NTP daemon about\n\ its current state and to request changes in that state. It uses NTP mode\n\ 7 control message formats described in the source code. The program may\n\ be run either in interactive mode or controlled using command line\n\ arguments. Extensive state and statistics information is available\n\ through the [= prog-name =] interface. In addition, nearly all the\n\ configuration options which can be specified at startup using ntpd's\n\ configuration file may also be specified at run time using [= prog-name =]\n\ .\n"; static char const zFullVersion[] = NTPDC_FULL_VERSION; /* extracted from optcode.tlib near line 515 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE static tOptionXlateProc translate_option_strings; #else # define OPTPROC_BASE OPTPROC_NONE # define translate_option_strings NULL #endif /* ENABLE_NLS */ #define ntpdc_full_usage NULL #define ntpdc_short_usage NULL #ifndef PKGDATADIR # define PKGDATADIR "" #endif #ifndef WITH_PACKAGER # define ntpdc_packager_info NULL #else static char const ntpdc_packager_info[] = "Packaged by " WITH_PACKAGER # ifdef WITH_PACKAGER_VERSION " ("WITH_PACKAGER_VERSION")" # endif # ifdef WITH_PACKAGER_BUG_REPORTS "\nReport ntpdc bugs to " WITH_PACKAGER_BUG_REPORTS # endif "\n"; #endif tOptions ntpdcOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ ( OPTPROC_BASE + OPTPROC_ERRSTOP + OPTPROC_SHORTOPT + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT + OPTPROC_ENVIRON + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zLicenseDescrip, zFullVersion, apzHomeList, zUsageTitle, zExplain, zDetail, optDesc, zBugsAddr, /* address to send bugs to */ NULL, NULL, /* extensions/saved state */ optionUsage, /* usage procedure */ translate_option_strings, /* translation procedure */ /* * Indexes to special options */ { INDEX_OPT_MORE_HELP, /* more-help option index */ INDEX_OPT_SAVE_OPTS, /* save option index */ NO_EQUIVALENT, /* '-#' option index */ NO_EQUIVALENT /* index of default opt */ }, 15 /* full option count */, 10 /* user option count */, ntpdc_full_usage, ntpdc_short_usage, NULL, NULL, PKGDATADIR, ntpdc_packager_info }; /* * Create the static procedure(s) declared above. */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { (void)pOptions; USAGE(NTPDC_EXIT_SUCCESS); } #if ! defined(TEST_NTPDC_OPTS) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * For the set-debug-level option. */ static void doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc) { /* extracted from debug-opt.def, line 27 */ DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); } #endif /* defined(TEST_NTPDC_OPTS) */ /* extracted from optmain.tlib near line 128 */ #if defined(TEST_NTPDC_OPTS) /* TEST MAIN PROCEDURE: */ extern void optionPutShell(tOptions*); int main(int argc, char ** argv) { int res = NTPDC_EXIT_SUCCESS; (void)optionProcess(&ntpdcOptions, argc, argv); optionPutShell(&ntpdcOptions); res = ferror(stdout); if (res != 0) fputs("output error writing to stdout\n", stderr); return res; } #endif /* defined TEST_NTPDC_OPTS */ /* extracted from optcode.tlib near line 666 */ #if ENABLE_NLS #include #include #include #include #include static char* AO_gettext(char const* pz); static void coerce_it(void** s); static char* AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) return NULL; pzRes = _(pz); if (pzRes == pz) return pzRes; pzRes = strdup(pzRes); if (pzRes == NULL) { fputs(_("No memory for duping translated strings\n"), stderr); exit(NTPDC_EXIT_FAILURE); } return pzRes; } static void coerce_it(void** s) { *s = AO_gettext(*s); } /* * This invokes the translation code (e.g. gettext(3)). */ static void translate_option_strings(void) { tOptions * const pOpt = &ntpdcOptions; /* * Guard against re-translation. It won't work. The strings will have * been changed by the first pass through this code. One shot only. */ if (option_usage_text.field_ct != 0) { /* * Do the translations. The first pointer follows the field count * field. The field count field is the size of a pointer. */ tOptDesc * pOD = pOpt->pOptDesc; char ** ppz = (char**)(void*)&(option_usage_text); int ix = option_usage_text.field_ct; do { ppz++; *ppz = AO_gettext(*ppz); } while (--ix > 0); coerce_it((void*)&(pOpt->pzCopyright)); coerce_it((void*)&(pOpt->pzCopyNotice)); coerce_it((void*)&(pOpt->pzFullVersion)); coerce_it((void*)&(pOpt->pzUsageTitle)); coerce_it((void*)&(pOpt->pzExplain)); coerce_it((void*)&(pOpt->pzDetail)); coerce_it((void*)&(pOpt->pzPackager)); option_usage_text.field_ct = 0; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) coerce_it((void*)&(pOD->pzText)); } if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) { tOptDesc * pOD = pOpt->pOptDesc; int ix; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) { coerce_it((void*)&(pOD->pz_Name)); coerce_it((void*)&(pOD->pz_DisableName)); coerce_it((void*)&(pOD->pz_DisablePfx)); } /* prevent re-translation */ ntpdcOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT; } } #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif /* ntpdc-opts.c ends here */ ntp-4.2.6p5/ntpdc/ntpdc-opts.def0000644000175000017500000000636511307651605015512 0ustar peterpeter/* -*- Mode: Text -*- */ autogen definitions options; prog-name = "ntpdc"; prog-title = "vendor-specific NTP query program"; argument = '[ host ...]'; #include copyright.def #include homerc.def #include autogen-version.def test-main; flag = { name = ipv4; value = 4; flags-cant = ipv6; descrip = "Force IPv4 DNS name resolution"; doc = <<- _EndOfDoc_ Force DNS resolution of following host names on the command line to the IPv4 namespace. _EndOfDoc_; }; flag = { name = ipv6; value = 6; flags-cant = ipv4; descrip = "Force IPv6 DNS name resolution"; doc = <<- _EndOfDoc_ Force DNS resolution of following host names on the command line to the IPv6 namespace. _EndOfDoc_; }; flag = { name = command; value = c; arg-type = string; descrip = "run a command and exit"; max = NOLIMIT; arg-name = cmd; stack-arg; doc = <<- _EndOfDoc_ The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). _EndOfDoc_; }; flag = { name = listpeers; value = l; descrip = "Print a list of the peers"; flags-cant = command; doc = <<- _EndOfDoc_ Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'listpeers' interactive command. _EndOfDoc_; }; flag = { name = peers; value = p; descrip = "Print a list of the peers"; flags-cant = command; doc = <<- _EndOfDoc_ Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'peers' interactive command. _EndOfDoc_; }; flag = { name = showpeers; value = s; descrip = "Show a list of the peers"; flags-cant = command; doc = <<- _EndOfDoc_ Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'dmpeers' interactive command. _EndOfDoc_; }; flag = { name = interactive; value = i; flags-cant = command, listpeers, peers, showpeers; descrip = "Force ntpq to operate in interactive mode"; doc = <<- _EndOfDoc_ Force ntpq to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input. _EndOfDoc_; }; #include debug-opt.def flag = { name = numeric; value = n; descrip = "numeric host addresses"; doc = <<- _EndOfDoc_ Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names. _EndOfDoc_; }; detail = <<- _END_DETAIL The [= prog-name =] utility program is used to query an NTP daemon about its current state and to request changes in that state. It uses NTP mode 7 control message formats described in the source code. The program may be run either in interactive mode or controlled using command line arguments. Extensive state and statistics information is available through the [= prog-name =] interface. In addition, nearly all the configuration options which can be specified at startup using ntpd's configuration file may also be specified at run time using [= prog-name =] . _END_DETAIL; ntp-4.2.6p5/ntpdc/Makefile.in0000644000175000017500000007211111675460300014772 0ustar peterpeter# 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@ # we traditionally installed software in bindir, while it should have gone # in sbindir. Now that we offer a choice, look in the "other" installation # subdir to warn folks if there is another version there. 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@ @NTP_BINSUBDIR_IS_BIN_TRUE@bin_PROGRAMS = ntpdc$(EXEEXT) @NTP_BINSUBDIR_IS_BIN_FALSE@sbin_PROGRAMS = ntpdc$(EXEEXT) EXTRA_PROGRAMS = ntpdc-layout$(EXEEXT) DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/nl.pl.in \ $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf subdir = ntpdc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/define_dir.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_cacheversion.m4 \ $(top_srcdir)/m4/ntp_dir_sep.m4 \ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \ $(top_srcdir)/m4/ntp_openssl.m4 \ $(top_srcdir)/m4/ntp_vpathhack.m4 \ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 = nl.pl CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) am_ntpdc_OBJECTS = ntpdc.$(OBJEXT) ntpdc_ops.$(OBJEXT) \ ntpdc-opts.$(OBJEXT) ntpdc_OBJECTS = $(am_ntpdc_OBJECTS) am__DEPENDENCIES_1 = ntpdc_DEPENDENCIES = version.o $(am__DEPENDENCIES_1) \ ../libntp/libntp.a ntpdc_layout_SOURCES = ntpdc-layout.c ntpdc_layout_OBJECTS = ntpdc-layout.$(OBJEXT) ntpdc_layout_DEPENDENCIES = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(ntpdc_SOURCES) ntpdc-layout.c DIST_SOURCES = $(ntpdc_SOURCES) ntpdc-layout.c 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' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DATA = $(noinst_DATA) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ 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@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SH = @PATH_SH@ PATH_TEST = @PATH_TEST@ POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CFLAGS = @SNMP_CFLAGS@ SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ SNMP_LIBS = @SNMP_LIBS@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ VERSION = @VERSION@ 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_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 = AUTOMAKE_OPTIONS = EXTRA_DATA = check-layout BUILT_SOURCES = @MAKE_CHECK_LAYOUT@ ntpdc-opts.c ntpdc-opts.h \ .deps-ver AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include $(LIBOPTS_CFLAGS) # LDADD might need RESLIB and ADJLIB ntpdc_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a \ @EDITLINE_LIBS@ @LCRYPTO@ # ntpdc-layout doesn't need any additional libraries at all ntpdc_layout_LDADD = DISTCLEANFILES = .version version.c CLEANFILES = check-layout layout.here nl.c ntpdc-layout .deps-ver noinst_HEADERS = ntpdc.h ETAGS_ARGS = Makefile.am EXTRA_DIST = nl_in.c nl.pl layout.std \ ntpdc-opts.def ntpdc.1 ntpdc-opts.texi ntpdc-opts.menu man_MANS = $(srcdir)/ntpdc.1 noinst_DATA = $(srcdir)/ntpdc-opts.texi $(srcdir)/ntpdc-opts.menu run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \ autogen -L ../include --writable std_def_list = $(top_srcdir)/include/debug-opt.def \ $(top_srcdir)/include/autogen-version.def \ $(top_srcdir)/include/copyright.def \ $(top_srcdir)/include/homerc.def \ $(top_srcdir)/include/version.def ntpdc_SOURCES = ntpdc.c ntpdc_ops.c ntpdc-opts.c ntpdc-opts.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf $(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 ntpdc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign ntpdc/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): nl.pl: $(top_builddir)/config.status $(srcdir)/nl.pl.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ntpdc$(EXEEXT): $(ntpdc_OBJECTS) $(ntpdc_DEPENDENCIES) @rm -f ntpdc$(EXEEXT) $(LINK) $(ntpdc_OBJECTS) $(ntpdc_LDADD) $(LIBS) ntpdc-layout$(EXEEXT): $(ntpdc_layout_OBJECTS) $(ntpdc_layout_DEPENDENCIES) @rm -f ntpdc-layout$(EXEEXT) $(LINK) $(ntpdc_layout_OBJECTS) $(ntpdc_layout_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdc-layout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdc-opts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdc_ops.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; 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=''; 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; } ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man \ uninstall-sbinPROGRAMS uninstall-man: uninstall-man1 .MAKE: all check install install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 uninstall-sbinPROGRAMS $(srcdir)/ntpdc-opts.h: $(srcdir)/ntpdc-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntpdc-opts.c: $(srcdir)/ntpdc-opts.def $(std_def_list) $(run_ag) ntpdc-opts.def $(srcdir)/ntpdc.1: $(srcdir)/ntpdc-opts.def $(std_def_list) $(run_ag) -Tagman1.tpl -bntpdc ntpdc-opts.def $(srcdir)/ntpdc-opts.menu: $(srcdir)/ntpdc-opts.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/ntpdc-opts.texi: $(srcdir)/ntpdc-opts.def $(std_def_list) $(run_ag) -Taginfo.tpl -DLEVEL=section ntpdc-opts.def $(top_srcdir)/scripts/check--help $@ ntpdc-layout.o: nl.c layout.here: ntpdc-layout ./ntpdc-layout > $@ check-layout: ntpdc-layout $(srcdir)/layout.std layout.here cmp $(srcdir)/layout.std layout.here && echo stamp > $@ $(PROGRAMS): $(LDADD) ../libntp/libntp.a: cd ../libntp && $(MAKE) $(top_srcdir)/version : cd $(top_srcdir) && $(MAKE) version version.o: $(ntpdc_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpdc $(COMPILE) -c version.c # I ran nl_in.c (attached, to be installed into ntpdc) through # $(CC) -E nl_in.c | nl.pl > nl.c nl.c: nl_in.c nl.pl Makefile.am ../config.h ../include/ntp_request.h ntpdc.h $(CC) -E $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srcdir)/nl_in.c | ./nl.pl > nl.c install-exec-hook: @case ${BINSUBDIR} in \ bin) ODIR=${sbindir} ;; \ sbin) ODIR=${bindir} ;; \ esac; \ test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \ test ! -f $$ODIR/$$i || echo "*** $$i is also in $$ODIR!"; \ done # $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ chmod ug+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ $(MAKE) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ mkdir $(DEPDIR) && \ case "$(top_builddir)" in \ .) \ ./config.status Makefile depfiles \ ;; \ ..) \ cd .. && \ ./config.status $(subdir)/Makefile depfiles && \ cd $(subdir) \ ;; \ *) \ echo 'Fatal: depsver.mf Automake fragment limited' \ 'to immediate subdirectories.' && \ echo "top_builddir: $(top_builddir)" && \ echo "subdir: $(subdir)" && \ exit 1 \ ;; \ esac && \ echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver @touch $@ # # depsver.mf included in Makefile.am for directories with .deps # # When building in the same directory with sources that change over # time, such as when tracking using bk, the .deps files can become # stale with respect to moved, deleted, or superceded headers. Most # commonly, this would exhibit as make reporting a failure to make a # header file which is no longer in the location given. To address # this issue, we use a deps-ver file which is updated with each change # that breaks old .deps files. A copy of deps-ver is made into # $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present # with different contents than deps-ver, we make clean to ensure all # .o files built before the incompatible change are rebuilt along with # their updated .deps files, then remove $(DEPDIR) and recreate it as # empty stubs. # # It is normal when configured with --disable-dependency-tracking for # the DEPDIR to not have been created. For this reason, we use the # intermediate target .deps-ver, which invokes make recursively if # DEPDIR exists. # # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # # This comment block follows rather than leads the related code so that # it stays with it in the generated Makefile.in and Makefile. # # 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: ntp-4.2.6p5/ntpdc/ntpdc.10000644000175000017500000001224111675460601014121 0ustar peterpeter.TH NTPDC 1 2011-12-24 "( 4.2.6p5)" "Programmer's Manual" .\" EDIT THIS FILE WITH CAUTION (ntpdc.1) .\" .\" It has been AutoGen-ed December 24, 2011 at 06:34:25 PM by AutoGen 5.12 .\" From the definitions ntpdc-opts.def .\" and the template file agman1.tpl .\" .SH NAME ntpdc \- vendor-specific NTP query program .SH SYNOPSIS .B ntpdc .\" Mixture of short (flag) options and long options .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..." .br .in +8 [ host ...] .SH "DESCRIPTION" This manual page briefly documents the \fBntpdc\fP command. The [= prog-name =] utility program is used to query an NTP daemon about its current state and to request changes in that state. It uses NTP mode 7 control message formats described in the source code. The program may be run either in interactive mode or controlled using command line arguments. Extensive state and statistics information is available through the [= prog-name =] interface. In addition, nearly all the configuration options which can be specified at startup using ntpd's configuration file may also be specified at run time using [= prog-name =] . .SH OPTIONS .TP .BR \-4 ", " \--ipv4 Force IPv4 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. .TP .BR \-6 ", " \--ipv6 Force IPv6 DNS name resolution. This option must not appear in combination with any of the following options: ipv4. .sp Force DNS resolution of following host names on the command line to the IPv6 namespace. .TP .BR \-c " \fIcmd\fP, " \--command "=" \fIcmd\fP run a command and exit. This option may appear an unlimited number of times. .sp The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). .TP .BR \-l ", " \--listpeers Print a list of the peers. This option must not appear in combination with any of the following options: command. .sp Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'listpeers' interactive command. .TP .BR \-p ", " \--peers Print a list of the peers. This option must not appear in combination with any of the following options: command. .sp Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'peers' interactive command. .TP .BR \-s ", " \--showpeers Show a list of the peers. This option must not appear in combination with any of the following options: command. .sp Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'dmpeers' interactive command. .TP .BR \-i ", " \--interactive Force ntpq to operate in interactive mode. This option must not appear in combination with any of the following options: command, listpeers, peers, showpeers. .sp Force ntpq to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input. .TP .BR \-d ", " \--debug-level Increase output debug message level. This option may appear an unlimited number of times. .sp Increase the debugging message output level. .TP .BR \-D " \fIstring\fP, " \--set-debug-level "=" \fIstring\fP Set the output debug message level. This option may appear an unlimited number of times. .sp Set the output debugging level. Can be supplied multiple times, but each overrides the previous value(s). .TP .BR \-n ", " \--numeric numeric host addresses. .sp Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names. .TP .BR \-? , " \--help" Display extended usage information and exit. .TP .BR \-! , " \--more-help" Extended usage information passed thru pager. .TP .BR \-> " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]" Save the option state to \fIrcfile\fP. The default is the \fIlast\fP configuration file listed in the \fBOPTION PRESETS\fP section, below. .TP .BR \-< " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts" Load options from \fIrcfile\fP. The \fIno-load-opts\fP form will disable the loading of earlier RC/INI files. \fI--no-load-opts\fP is handled early, out of order. .TP .BR \- " [{\fIv|c|n\fP}]," " \--version" "[=\fI{v|c|n}\fP]" 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. .SH OPTION PRESETS Any option that is not marked as \fInot presettable\fP may be preset by loading values from configuration ("RC" or ".INI") file(s) and values from environment variables named: .nf \fBNTPDC_\fP or \fBNTPDC\fP .fi .ad The environmental presets take precedence (are processed later than) the configuration files. The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". If any of these are directories, then the file \fI.ntprc\fP is searched for within those directories. .SH AUTHOR David L. Mills and/or others .br Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org .PP .nf .na see html/copyright.html .fi .ad .PP This manual page was \fIAutoGen\fP-erated from the \fBntpdc\fP option definitions. ntp-4.2.6p5/ntpdc/Makefile.am0000644000175000017500000000527511510477207014772 0ustar peterpeterNULL= AUTOMAKE_OPTIONS= if NTP_BINSUBDIR_IS_BIN bin_PROGRAMS= ntpdc else sbin_PROGRAMS= ntpdc endif EXTRA_PROGRAMS= ntpdc-layout EXTRA_DATA= check-layout BUILT_SOURCES= @MAKE_CHECK_LAYOUT@ ntpdc-opts.c ntpdc-opts.h AM_CPPFLAGS= -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include $(LIBOPTS_CFLAGS) # LDADD might need RESLIB and ADJLIB ntpdc_LDADD= version.o $(LIBOPTS_LDADD) ../libntp/libntp.a \ @EDITLINE_LIBS@ @LCRYPTO@ # ntpdc-layout doesn't need any additional libraries at all ntpdc_layout_LDADD= DISTCLEANFILES= .version version.c CLEANFILES= check-layout layout.here nl.c ntpdc-layout noinst_HEADERS= ntpdc.h ETAGS_ARGS= Makefile.am EXTRA_DIST= nl_in.c nl.pl layout.std \ ntpdc-opts.def ntpdc.1 ntpdc-opts.texi ntpdc-opts.menu man_MANS= $(srcdir)/ntpdc.1 noinst_DATA= $(srcdir)/ntpdc-opts.texi $(srcdir)/ntpdc-opts.menu run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \ autogen -L ../include --writable std_def_list= $(top_srcdir)/include/debug-opt.def \ $(top_srcdir)/include/autogen-version.def \ $(top_srcdir)/include/copyright.def \ $(top_srcdir)/include/homerc.def \ $(top_srcdir)/include/version.def $(srcdir)/ntpdc-opts.h: $(srcdir)/ntpdc-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntpdc-opts.c: $(srcdir)/ntpdc-opts.def $(std_def_list) $(run_ag) ntpdc-opts.def $(srcdir)/ntpdc.1: $(srcdir)/ntpdc-opts.def $(std_def_list) $(run_ag) -Tagman1.tpl -bntpdc ntpdc-opts.def $(srcdir)/ntpdc-opts.menu: $(srcdir)/ntpdc-opts.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/ntpdc-opts.texi: $(srcdir)/ntpdc-opts.def $(std_def_list) $(run_ag) -Taginfo.tpl -DLEVEL=section ntpdc-opts.def $(top_srcdir)/scripts/check--help $@ ntpdc_SOURCES = ntpdc.c ntpdc_ops.c ntpdc-opts.c ntpdc-opts.h ntpdc-layout.o: nl.c layout.here: ntpdc-layout ./ntpdc-layout > $@ check-layout: ntpdc-layout $(srcdir)/layout.std layout.here cmp $(srcdir)/layout.std layout.here && echo stamp > $@ $(PROGRAMS): $(LDADD) ../libntp/libntp.a: cd ../libntp && $(MAKE) $(top_srcdir)/version : cd $(top_srcdir) && $(MAKE) version version.o: $(ntpdc_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpdc $(COMPILE) -c version.c # I ran nl_in.c (attached, to be installed into ntpdc) through # $(CC) -E nl_in.c | nl.pl > nl.c nl.c: nl_in.c nl.pl Makefile.am ../config.h ../include/ntp_request.h ntpdc.h $(CC) -E $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srcdir)/nl_in.c | ./nl.pl > nl.c include $(top_srcdir)/bincheck.mf include $(top_srcdir)/depsver.mf ntp-4.2.6p5/ntpdc/ntpdc-opts.menu0000644000175000017500000000006211675460601015706 0ustar peterpeter* ntpdc Invocation:: Invoking ntpdc ntp-4.2.6p5/ntpdc/README0000644000175000017500000000050110017034572013574 0ustar peterpeterREADME file for directory ./xntpdc of the NTP Version 4 distribution This directory contains the sources for the xntpdc utility program. See the README and RELNOTES files in the parent directory for directions on how to make and install this program. The current version number of this program is in the version.c file. ntp-4.2.6p5/libntp/0000755000175000017500000000000011710605402013075 5ustar peterpeterntp-4.2.6p5/libntp/clocktime.c0000644000175000017500000000575410017034554015231 0ustar peterpeter/* * clocktime - compute the NTP date from a day of year, hour, minute * and second. */ #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_stdlib.h" /* * Hacks to avoid excercising the multiplier. I have no pride. */ #define MULBY10(x) (((x)<<3) + ((x)<<1)) #define MULBY60(x) (((x)<<6) - ((x)<<2)) /* watch overflow */ #define MULBY24(x) (((x)<<4) + ((x)<<3)) /* * Two days, in seconds. */ #define TWODAYS (2*24*60*60) /* * We demand that the time be within CLOSETIME seconds of the receive * time stamp. This is about 4 hours, which hopefully should be * wide enough to collect most data, while close enough to keep things * from getting confused. */ #define CLOSETIME (4*60*60) int clocktime( int yday, int hour, int minute, int second, int tzoff, u_long rec_ui, u_long *yearstart, u_int32 *ts_ui ) { register long tmp; register u_long date; register u_long yst; /* * Compute the offset into the year in seconds. Note that * this could come out to be a negative number. */ tmp = (long)(MULBY24((yday-1)) + hour + tzoff); tmp = MULBY60(tmp) + (long)minute; tmp = MULBY60(tmp) + (long)second; /* * Initialize yearstart, if necessary. */ yst = *yearstart; if (yst == 0) { yst = calyearstart(rec_ui); *yearstart = yst; } /* * Now the fun begins. We demand that the received clock time * be within CLOSETIME of the receive timestamp, but * there is uncertainty about the year the timestamp is in. * Use the current year start for the first check, this should * work most of the time. */ date = (u_long)(tmp + (long)yst); if (date < (rec_ui + CLOSETIME) && date > (rec_ui - CLOSETIME)) { *ts_ui = date; return 1; } /* * Trouble. Next check is to see if the year rolled over and, if * so, try again with the new year's start. */ yst = calyearstart(rec_ui); if (yst != *yearstart) { date = (u_long)((long)yst + tmp); *ts_ui = date; if (date < (rec_ui + CLOSETIME) && date > (rec_ui - CLOSETIME)) { *yearstart = yst; return 1; } } /* * Here we know the year start matches the current system * time. One remaining possibility is that the time code * is in the year previous to that of the system time. This * is only worth checking if the receive timestamp is less * than a couple of days into the new year. */ if ((rec_ui - yst) < TWODAYS) { yst = calyearstart(yst - TWODAYS); if (yst != *yearstart) { date = (u_long)(tmp + (long)yst); if (date < (rec_ui + CLOSETIME) && date > (rec_ui - CLOSETIME)) { *yearstart = yst; *ts_ui = date; return 1; } } } /* * One last possibility is that the time stamp is in the year * following the year the system is in. Try this one before * giving up. */ yst = calyearstart(rec_ui + TWODAYS); if (yst != *yearstart) { date = (u_long)((long)yst + tmp); if (date < (rec_ui + CLOSETIME) && date > (rec_ui - CLOSETIME)) { *yearstart = yst; *ts_ui = date; return 1; } } /* * Give it up. */ return 0; } ntp-4.2.6p5/libntp/ntp_random.c0000644000175000017500000004211711307651604015416 0ustar peterpeter/* * Copyright (c) 1983, 1993 * The Regents of the University of California. 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. * * $FreeBSD: src/lib/libc/stdlib/random.c,v 1.4.2.2 1999/09/05 11:16:45 peter Exp $ * */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95"; #endif /* LIBC_SCCS and not lint */ #include "config.h" #include #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include /* * random.c: * * An improved random number generation package. In addition to the standard * rand()/srand() like interface, this package also has a special state info * interface. The initstate() routine is called with a seed, an array of * bytes, and a count of how many bytes are being passed in; this array is * then initialized to contain information for random number generation with * that much state information. Good sizes for the amount of state * information are 32, 64, 128, and 256 bytes. The state can be switched by * calling the setstate() routine with the same array as was initiallized * with initstate(). By default, the package runs with 128 bytes of state * information and generates far better random numbers than a linear * congruential generator. If the amount of state information is less than * 32 bytes, a simple linear congruential R.N.G. is used. * * Internally, the state information is treated as an array of longs; the * zeroeth element of the array is the type of R.N.G. being used (small * integer); the remainder of the array is the state information for the * R.N.G. Thus, 32 bytes of state information will give 7 longs worth of * state information, which will allow a degree seven polynomial. (Note: * the zeroeth word of state information also has some other information * stored in it -- see setstate() for details). * * The random number generation technique is a linear feedback shift register * approach, employing trinomials (since there are fewer terms to sum up that * way). In this approach, the least significant bit of all the numbers in * the state table will act as a linear feedback shift register, and will * have period 2^deg - 1 (where deg is the degree of the polynomial being * used, assuming that the polynomial is irreducible and primitive). The * higher order bits will have longer periods, since their values are also * influenced by pseudo-random carries out of the lower bits. The total * period of the generator is approximately deg*(2**deg - 1); thus doubling * the amount of state information has a vast influence on the period of the * generator. Note: the deg*(2**deg - 1) is an approximation only good for * large deg, when the period of the shift register is the dominant factor. * With deg equal to seven, the period is actually much longer than the * 7*(2**7 - 1) predicted by this formula. * * Modified 28 December 1994 by Jacob S. Rosenberg. * The following changes have been made: * All references to the type u_int have been changed to unsigned long. * All references to type int have been changed to type long. Other * cleanups have been made as well. A warning for both initstate and * setstate has been inserted to the effect that on Sparc platforms * the 'arg_state' variable must be forced to begin on word boundaries. * This can be easily done by casting a long integer array to char *. * The overall logic has been left STRICTLY alone. This software was * tested on both a VAX and Sun SpacsStation with exactly the same * results. The new version and the original give IDENTICAL results. * The new version is somewhat faster than the original. As the * documentation says: "By default, the package runs with 128 bytes of * state information and generates far better random numbers than a linear * congruential generator. If the amount of state information is less than * 32 bytes, a simple linear congruential R.N.G. is used." For a buffer of * 128 bytes, this new version runs about 19 percent faster and for a 16 * byte buffer it is about 5 percent faster. */ /* * For each of the currently supported random number generators, we have a * break value on the amount of state information (you need at least this * many bytes of state info to support this random number generator), a degree * for the polynomial (actually a trinomial) that the R.N.G. is based on, and * the separation between the two lower order coefficients of the trinomial. */ #define TYPE_0 0 /* linear congruential */ #define BREAK_0 8 #define DEG_0 0 #define SEP_0 0 #define TYPE_1 1 /* x**7 + x**3 + 1 */ #define BREAK_1 32 #define DEG_1 7 #define SEP_1 3 #define TYPE_2 2 /* x**15 + x + 1 */ #define BREAK_2 64 #define DEG_2 15 #define SEP_2 1 #define TYPE_3 3 /* x**31 + x**3 + 1 */ #define BREAK_3 128 #define DEG_3 31 #define SEP_3 3 #define TYPE_4 4 /* x**63 + x + 1 */ #define BREAK_4 256 #define DEG_4 63 #define SEP_4 1 /* * Array versions of the above information to make code run faster -- * relies on fact that TYPE_i == i. */ #define MAX_TYPES 5 /* max number of types above */ static long degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; static long seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; /* * Initially, everything is set up as if from: * * initstate(1, randtbl, 128); * * Note that this initialization takes advantage of the fact that srandom() * advances the front and rear pointers 10*rand_deg times, and hence the * rear pointer which starts at 0 will also end up at zero; thus the zeroeth * element of the state information, which contains info about the current * position of the rear pointer is just * * MAX_TYPES * (rptr - state) + TYPE_3 == TYPE_3. */ static long randtbl[DEG_3 + 1] = { TYPE_3, #ifdef USE_WEAK_SEEDING /* Historic implementation compatibility */ /* The random sequences do not vary much with the seed */ 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, 0xde3b81e0, 0xdf0a6fb5, 0xf103bc02, 0x48f340fb, 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd, 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88, 0xe369735d, 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc, 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e, 0x8999220b, 0x27fb47b9, #else /* !USE_WEAK_SEEDING */ 0x991539b1, 0x16a5bce3, 0x6774a4cd, 0x3e01511e, 0x4e508aaa, 0x61048c05, 0xf5500617, 0x846b7115, 0x6a19892c, 0x896a97af, 0xdb48f936, 0x14898454, 0x37ffd106, 0xb58bff9c, 0x59e17104, 0xcf918a49, 0x09378c83, 0x52c7a471, 0x8d293ea9, 0x1f4fc301, 0xc3db71be, 0x39b44e1c, 0xf8a44ef9, 0x4c8b80b1, 0x19edc328, 0x87bf4bdd, 0xc9b240e5, 0xe9ee4b1b, 0x4382aee7, 0x535b6b41, 0xf3bec5da #endif /* !USE_WEAK_SEEDING */ }; /* * fptr and rptr are two pointers into the state info, a front and a rear * pointer. These two pointers are always rand_sep places aparts, as they * cycle cyclically through the state information. (Yes, this does mean we * could get away with just one pointer, but the code for random() is more * efficient this way). The pointers are left positioned as they would be * from the call * * initstate(1, randtbl, 128); * * (The position of the rear pointer, rptr, is really 0 (as explained above * in the initialization of randtbl) because the state table pointer is set * to point to randtbl[1] (as explained below). */ static long *fptr = &randtbl[SEP_3 + 1]; static long *rptr = &randtbl[1]; /* * The following things are the pointer to the state information table, the * type of the current generator, the degree of the current polynomial being * used, and the separation between the two pointers. Note that for efficiency * of random(), we remember the first location of the state information, not * the zeroeth. Hence it is valid to access state[-1], which is used to * store the type of the R.N.G. Also, we remember the last location, since * this is more efficient than indexing every time to find the address of * the last element to see if the front and rear pointers have wrapped. */ static long *state = &randtbl[1]; static long rand_type = TYPE_3; static long rand_deg = DEG_3; static long rand_sep = SEP_3; static long *end_ptr = &randtbl[DEG_3 + 1]; static inline long good_rand (long); static inline long good_rand ( register long x ) { #ifdef USE_WEAK_SEEDING /* * Historic implementation compatibility. * The random sequences do not vary much with the seed, * even with overflowing. */ return (1103515245 * x + 12345); #else /* !USE_WEAK_SEEDING */ /* * Compute x = (7^5 * x) mod (2^31 - 1) * wihout overflowing 31 bits: * (2^31 - 1) = 127773 * (7^5) + 2836 * From "Random number generators: good ones are hard to find", * Park and Miller, Communications of the ACM, vol. 31, no. 10, * October 1988, p. 1195. */ register long hi, lo; hi = x / 127773; lo = x % 127773; x = 16807 * lo - 2836 * hi; if (x <= 0) x += 0x7fffffff; return (x); #endif /* !USE_WEAK_SEEDING */ } /* * srandom: * * Initialize the random number generator based on the given seed. If the * type is the trivial no-state-information type, just remember the seed. * Otherwise, initializes state[] based on the given "seed" via a linear * congruential generator. Then, the pointers are set to known locations * that are exactly rand_sep places apart. Lastly, it cycles the state * information a given number of times to get rid of any initial dependencies * introduced by the L.C.R.N.G. Note that the initialization of randtbl[] * for default usage relies on values produced by this routine. */ void ntp_srandom( unsigned long x ) { register long i; if (rand_type == TYPE_0) state[0] = x; else { state[0] = x; for (i = 1; i < rand_deg; i++) state[i] = good_rand(state[i - 1]); fptr = &state[rand_sep]; rptr = &state[0]; for (i = 0; i < 10 * rand_deg; i++) (void)ntp_random(); } } /* * srandomdev: * * Many programs choose the seed value in a totally predictable manner. * This often causes problems. We seed the generator using the much more * secure urandom(4) interface. Note that this particular seeding * procedure can generate states which are impossible to reproduce by * calling srandom() with any value, since the succeeding terms in the * state buffer are no longer derived from the LC algorithm applied to * a fixed seed. */ #ifdef NEED_SRANDOMDEV void ntp_srandomdev( void ) { struct timeval tv; unsigned long junk; /* Purposely used uninitialized */ GETTIMEOFDAY(&tv, NULL); ntp_srandom(getpid() ^ tv.tv_sec ^ tv.tv_usec ^ junk); return; } #endif /* * initstate: * * Initialize the state information in the given array of n bytes for future * random number generation. Based on the number of bytes we are given, and * the break values for the different R.N.G.'s, we choose the best (largest) * one we can and set things up for it. srandom() is then called to * initialize the state information. * * Note that on return from srandom(), we set state[-1] to be the type * multiplexed with the current value of the rear pointer; this is so * successive calls to initstate() won't lose this information and will be * able to restart with setstate(). * * Note: the first thing we do is save the current state, if any, just like * setstate() so that it doesn't matter when initstate is called. * * Returns a pointer to the old state. * * Note: The Sparc platform requires that arg_state begin on a long * word boundary; otherwise a bus error will occur. Even so, lint will * complain about mis-alignment, but you should disregard these messages. */ char * ntp_initstate( unsigned long seed, /* seed for R.N.G. */ char *arg_state, /* pointer to state array */ long n /* # bytes of state info */ ) { register char *ostate = (char *)(&state[-1]); register long *long_arg_state = (long *) arg_state; if (rand_type == TYPE_0) state[-1] = rand_type; else state[-1] = MAX_TYPES * (rptr - state) + rand_type; if (n < BREAK_0) { (void)fprintf(stderr, "random: not enough state (%ld bytes); ignored.\n", n); return(0); } if (n < BREAK_1) { rand_type = TYPE_0; rand_deg = DEG_0; rand_sep = SEP_0; } else if (n < BREAK_2) { rand_type = TYPE_1; rand_deg = DEG_1; rand_sep = SEP_1; } else if (n < BREAK_3) { rand_type = TYPE_2; rand_deg = DEG_2; rand_sep = SEP_2; } else if (n < BREAK_4) { rand_type = TYPE_3; rand_deg = DEG_3; rand_sep = SEP_3; } else { rand_type = TYPE_4; rand_deg = DEG_4; rand_sep = SEP_4; } state = (long *) (long_arg_state + 1); /* first location */ end_ptr = &state[rand_deg]; /* must set end_ptr before srandom */ ntp_srandom(seed); if (rand_type == TYPE_0) long_arg_state[0] = rand_type; else long_arg_state[0] = MAX_TYPES * (rptr - state) + rand_type; return(ostate); } /* * setstate: * * Restore the state from the given state array. * * Note: it is important that we also remember the locations of the pointers * in the current state information, and restore the locations of the pointers * from the old state information. This is done by multiplexing the pointer * location into the zeroeth word of the state information. * * Note that due to the order in which things are done, it is OK to call * setstate() with the same state as the current state. * * Returns a pointer to the old state information. * * Note: The Sparc platform requires that arg_state begin on a long * word boundary; otherwise a bus error will occur. Even so, lint will * complain about mis-alignment, but you should disregard these messages. */ char * ntp_setstate( char *arg_state /* pointer to state array */ ) { register long *new_state = (long *) arg_state; register long type = new_state[0] % MAX_TYPES; register long rear = new_state[0] / MAX_TYPES; char *ostate = (char *)(&state[-1]); if (rand_type == TYPE_0) state[-1] = rand_type; else state[-1] = MAX_TYPES * (rptr - state) + rand_type; switch(type) { case TYPE_0: case TYPE_1: case TYPE_2: case TYPE_3: case TYPE_4: rand_type = type; rand_deg = degrees[type]; rand_sep = seps[type]; break; default: (void)fprintf(stderr, "random: state info corrupted; not changed.\n"); } state = (long *) (new_state + 1); if (rand_type != TYPE_0) { rptr = &state[rear]; fptr = &state[(rear + rand_sep) % rand_deg]; } end_ptr = &state[rand_deg]; /* set end_ptr too */ return(ostate); } /* * random: * * If we are using the trivial TYPE_0 R.N.G., just do the old linear * congruential bit. Otherwise, we do our fancy trinomial stuff, which is * the same in all the other cases due to all the global variables that have * been set up. The basic operation is to add the number at the rear pointer * into the one at the front pointer. Then both pointers are advanced to * the next location cyclically in the table. The value returned is the sum * generated, reduced to 31 bits by throwing away the "least random" low bit. * * Note: the code takes advantage of the fact that both the front and * rear pointers can't wrap on the same call by not testing the rear * pointer if the front one has wrapped. * * Returns a 31-bit random number. */ long ntp_random( void ) { register long i; register long *f, *r; if (rand_type == TYPE_0) { i = state[0]; state[0] = i = (good_rand(i)) & 0x7fffffff; } else { /* * Use local variables rather than static variables for speed. */ f = fptr; r = rptr; *f += *r; i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */ if (++f >= end_ptr) { f = state; ++r; } else if (++r >= end_ptr) { r = state; } fptr = f; rptr = r; } return(i); } ntp-4.2.6p5/libntp/icom.c0000644000175000017500000000775511616416167014223 0ustar peterpeter/* * Program to control ICOM radios * * This is a ripoff of the utility routines in the ICOM software * distribution. The only function provided is to load the radio * frequency. All other parameters must be manually set before use. */ #include #include "icom.h" #include #include #include #include #include "ntp_tty.h" #include "l_stdlib.h" #ifdef SYS_WINNT #undef write /* ports/winnt/include/config.h: #define write _write */ extern int async_write(int, const void *, unsigned int); #define write(fd, data, octets) async_write(fd, data, octets) #endif /* * Packet routines * * These routines send a packet and receive the response. If an error * (collision) occurs on transmit, the packet is resent. If an error * occurs on receive (timeout), all input to the terminating FI is * discarded and the packet is resent. If the maximum number of retries * is not exceeded, the program returns the number of octets in the user * buffer; otherwise, it returns zero. * * ICOM frame format * * Frames begin with a two-octet preamble PR-PR followyd by the * transceiver address RE, controller address TX, control code CN, zero * or more data octets DA (depending on command), and terminator FI. * Since the bus is bidirectional, every octet output is echoed on * input. Every valid frame sent is answered with a frame in the same * format, but with the RE and TX fields interchanged. The CN field is * set to NAK if an error has occurred. Otherwise, the data are returned * in this and following DA octets. If no data are returned, the CN * octet is set to ACK. * * +------+------+------+------+------+--//--+------+ * | PR | PR | RE | TX | CN | DA | FI | * +------+------+------+------+------+--//--+------+ */ /* * Scraps */ #define DICOM /dev/icom/ /* ICOM port link */ /* * Local function prototypes */ static void doublefreq (double, u_char *, int); /* * icom_freq(fd, ident, freq) - load radio frequency */ int icom_freq( /* returns 0 (ok), EIO (error) */ int fd, /* file descriptor */ int ident, /* ICOM radio identifier */ double freq /* frequency (MHz) */ ) { u_char cmd[] = {PAD, PR, PR, 0, TX, V_SFREQ, 0, 0, 0, 0, FI, FI}; int temp; cmd[3] = (char)ident; if (ident == IC735) temp = 4; else temp = 5; doublefreq(freq * 1e6, &cmd[6], temp); temp = write(fd, cmd, temp + 7); return (0); } /* * doublefreq(freq, y, len) - double to ICOM frequency with padding */ static void doublefreq( /* returns void */ double freq, /* frequency */ u_char *x, /* radio frequency */ int len /* length (octets) */ ) { int i; char s1[16]; char *y; snprintf(s1, sizeof(s1), " %10.0f", freq); y = s1 + 10; i = 0; while (*y != ' ') { x[i] = *y-- & 0x0f; x[i] = x[i] | ((*y-- & 0x0f) << 4); i++; } for ( ; i < len; i++) x[i] = 0; x[i] = FI; } /* * icom_init() - open and initialize serial interface * * This routine opens the serial interface for raw transmission; that * is, character-at-a-time, no stripping, checking or monkeying with the * bits. For Unix, an input operation ends either with the receipt of a * character or a 0.5-s timeout. */ int icom_init( char *device, /* device name/link */ int speed, /* line speed */ int trace /* trace flags */ ) { TTY ttyb; int fd; int flags; int rc; int saved_errno; flags = trace; fd = tty_open(device, O_RDWR, 0777); if (fd < 0) return -1; rc = tcgetattr(fd, &ttyb); if (rc < 0) { saved_errno = errno; close(fd); errno = saved_errno; return -1; } ttyb.c_iflag = 0; /* input modes */ ttyb.c_oflag = 0; /* output modes */ ttyb.c_cflag = IBAUD|CS8|CLOCAL; /* control modes (no read) */ ttyb.c_lflag = 0; /* local modes */ ttyb.c_cc[VMIN] = 0; /* min chars */ ttyb.c_cc[VTIME] = 5; /* receive timeout */ cfsetispeed(&ttyb, (u_int)speed); cfsetospeed(&ttyb, (u_int)speed); rc = tcsetattr(fd, TCSANOW, &ttyb); if (rc < 0) { saved_errno = errno; close(fd); errno = saved_errno; return -1; } return (fd); } /* end program */ ntp-4.2.6p5/libntp/adjtimex.c0000644000175000017500000000051610017034553015052 0ustar peterpeter/* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint _sccsid:.asciz "11/19/91 ULTRIX @(#)adjtime.c 6.1" #endif not lint #include "SYS.h" SYSCALL(adjtimex) ret ntp-4.2.6p5/libntp/ntp_lineedit.c0000644000175000017500000000761311505336022015727 0ustar peterpeter/* * ntp_lineedit.c - generic interface to various line editing libs */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #if defined(HAVE_READLINE_HISTORY) && \ (!defined(HAVE_READLINE_HISTORY_H) || \ !defined(HAVE_READLINE_READLINE_H)) # undef HAVE_READLINE_HISTORY #endif #if defined(HAVE_READLINE_HISTORY) # include # include # define LE_READLINE #elif defined(HAVE_HISTEDIT_H) # include # define LE_EDITLINE #else # define LE_NONE #endif #include "ntp.h" #include "ntp_stdlib.h" #include "ntp_lineedit.h" #define MAXEDITLINE 512 /* * external references */ extern char * progname; /* * globals, private prototypes */ static int ntp_readline_initted; static char * lineedit_prompt; #ifdef LE_EDITLINE # ifndef H_SETSIZE # define H_SETSIZE H_EVENT # endif static EditLine * ntp_el; static History * ntp_hist; static HistEvent hev; char * ntp_prompt_callback(EditLine *); #endif /* LE_EDITLINE */ /* * ntp_readline_init - setup, set or reset prompt string */ int ntp_readline_init( const char * prompt ) { int success; success = 1; if (prompt) { if (lineedit_prompt) free(lineedit_prompt); lineedit_prompt = estrdup(prompt); } #ifdef LE_EDITLINE if (NULL == ntp_el) { # if 4 == EL_INIT_ARGS ntp_el = el_init(progname, stdin, stdout, stderr); # else ntp_el = el_init(progname, stdin, stdout); # endif if (ntp_el) { el_set(ntp_el, EL_PROMPT, ntp_prompt_callback); el_set(ntp_el, EL_EDITOR, "emacs"); ntp_hist = history_init(); if (NULL == ntp_hist) { fprintf(stderr, "history_init(): %s\n", strerror(errno)); fflush(stderr); el_end(ntp_el); ntp_el = NULL; success = 0; } else { memset(&hev, 0, sizeof(hev)); #ifdef H_SETSIZE history(ntp_hist, &hev, H_SETSIZE, 128); #endif el_set(ntp_el, EL_HIST, history, ntp_hist); /* use any .editrc */ el_source(ntp_el, NULL); } } else success = 0; } #endif /* LE_EDITLINE */ ntp_readline_initted = success; return success; } /* * ntp_readline_uninit - release resources */ void ntp_readline_uninit( void ) { #ifdef LE_EDITLINE if (ntp_el) { el_end(ntp_el); ntp_el = NULL; history_end(ntp_hist); ntp_hist = NULL; } #endif /* LE_EDITLINE */ if (lineedit_prompt) { free(lineedit_prompt); lineedit_prompt = NULL; } ntp_readline_initted = 0; } /* * ntp_readline - read a line with the line editor available * * The string returned must be released with free() */ char * ntp_readline( int * pcount ) { char * line; #ifdef LE_NONE char line_buf[MAXEDITLINE]; #endif #ifdef LE_EDITLINE const char * cline; #endif if (!ntp_readline_initted) return NULL; *pcount = 0; #ifdef LE_READLINE line = readline(lineedit_prompt ? lineedit_prompt : ""); if (NULL != line) { if (*line) { add_history(line); *pcount = strlen(line); } else { free(line); line = NULL; } } #endif /* LE_READLINE */ #ifdef LE_EDITLINE cline = el_gets(ntp_el, pcount); if (NULL != cline && *cline) { history(ntp_hist, &hev, H_ENTER, cline); *pcount = strlen(cline); line = estrdup(cline); } else line = NULL; #endif /* LE_EDITLINE */ #ifdef LE_NONE /* stone hammers */ if (lineedit_prompt) { # ifdef VMS /* * work around problem mixing * stdout & stderr */ fputs("", stdout); # endif /* VMS */ fputs(lineedit_prompt, stderr); fflush(stderr); } line = fgets(line_buf, sizeof(line_buf), stdin); if (NULL != line && *line) { *pcount = strlen(line); line = estrdup(line); } else line = NULL; #endif /* LE_NONE */ if (!line) /* EOF */ fputs("\n", stderr); return line; } #ifdef LE_EDITLINE /* * ntp_prompt_callback - return prompt string to el_gets() */ char * ntp_prompt_callback( EditLine *el ) { UNUSED_ARG(el); return lineedit_prompt; } #endif /* LE_EDITLINE */ ntp-4.2.6p5/libntp/memmove.c0000644000175000017500000001011310017034556014707 0ustar peterpeter/*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #ifdef HAVE_CONFIG_H # include #endif #ifndef HAVE_MEMMOVE #ifdef HAVE_SYS_TYPES_H #include #endif #include #include "l_stdlib.h" /* * sizeof(word) MUST BE A POWER OF TWO * SO THAT wmask BELOW IS ALL ONES */ typedef int word; /* "word" used for optimal copy speed */ #define wsize sizeof(word) #define wmask (wsize - 1) /* * Copy a block of memory, handling overlap. * This is the routine that actually implements * (the portable versions of) bcopy, memcpy, and memmove. */ void * memmove( void *dst0, const void *src0, register size_t length ) { register char *dst = dst0; register const char *src = src0; register size_t t; if (length == 0 || dst == src) /* nothing to do */ goto done; /* * Macros: loop-t-times; and loop-t-times, t>0 */ #define TLOOP(s) if (t) TLOOP1(s) #define TLOOP1(s) do { s; } while (--t) if ((unsigned long)dst < (unsigned long)src) { /* * Copy forward. */ t = (int)src; /* only need low bits */ if ((t | (int)dst) & wmask) { /* * Try to align operands. This cannot be done * unless the low bits match. */ if ((t ^ (int)dst) & wmask || length < wsize) t = length; else t = wsize - (t & wmask); length -= t; TLOOP1(*dst++ = *src++); } /* * Copy whole words, then mop up any trailing bytes. */ t = length / wsize; TLOOP(*(word *)dst = *(const word *)src; src += wsize; dst += wsize); t = length & wmask; TLOOP(*dst++ = *src++); } else { /* * Copy backwards. Otherwise essentially the same. * Alignment works as before, except that it takes * (t&wmask) bytes to align, not wsize-(t&wmask). */ src += length; dst += length; t = (int)src; if ((t | (int)dst) & wmask) { if ((t ^ (int)dst) & wmask || length <= wsize) t = length; else t &= wmask; length -= t; TLOOP1(*--dst = *--src); } t = length / wsize; TLOOP(src -= wsize; dst -= wsize; *(word *)dst = *(const word *)src); t = length & wmask; TLOOP(*--dst = *--src); } done: return (dst0); } #else int memmove_bs; #endif ntp-4.2.6p5/libntp/ymd2yd.c0000644000175000017500000000124510017034561014454 0ustar peterpeter/* * ymd2yd - compute the date in the year from y/m/d */ #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_stdlib.h" /* * Tables to compute the day of year from yyyymmdd timecode. * Viva la leap. */ static int day1tab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; static int day2tab[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int ymd2yd( int y, int m, int d ) { int i, *t; if (m < 1 || m > 12 || d < 1) return (-1); if (((y%4 == 0) && (y%100 != 0)) || (y%400 == 0)) t = day2tab; /* leap year */ else t = day1tab; /* not a leap year */ if (d > t[m - 1]) return (-1); for (i = 0; i < m - 1; i++) d += t[i]; return d; } ntp-4.2.6p5/libntp/authkeys.c0000644000175000017500000002351211307651603015107 0ustar peterpeter/* * authkeys.c - routines to manage the storage of authentication keys */ #ifdef HAVE_CONFIG_H # include #endif #include #include "ntp_types.h" #include "ntp_fp.h" #include "ntp.h" #include "ntpd.h" #include "ntp_string.h" #include "ntp_malloc.h" #include "ntp_stdlib.h" /* * Structure to store keys in in the hash table. */ struct savekey { struct savekey *next; union { u_char MD5_key[64]; /* for keys up to to 512 bits */ } k; keyid_t keyid; /* key identifier */ int type; /* key type */ u_short flags; /* flags that wave */ u_long lifetime; /* remaining lifetime */ int keylen; /* key length */ }; #define KEY_TRUSTED 0x001 /* this key is trusted */ /* * The hash table. This is indexed by the low order bits of the * keyid. We make this fairly big for potentially busy servers. */ #define HASHSIZE 64 #define HASHMASK ((HASHSIZE)-1) #define KEYHASH(keyid) ((keyid) & HASHMASK) struct savekey *key_hash[HASHSIZE]; u_long authkeynotfound; /* keys not found */ u_long authkeylookups; /* calls to lookup keys */ u_long authnumkeys; /* number of active keys */ u_long authkeyexpired; /* key lifetime expirations */ u_long authkeyuncached; /* cache misses */ u_long authnokey; /* calls to encrypt with no key */ u_long authencryptions; /* calls to encrypt */ u_long authdecryptions; /* calls to decrypt */ /* * Storage for free key structures. We malloc() such things but * never free them. */ struct savekey *authfreekeys; int authnumfreekeys; #define MEMINC 12 /* number of new free ones to get */ /* * The key cache. We cache the last key we looked at here. */ keyid_t cache_keyid; /* key identifier */ u_char *cache_key; /* key pointer */ u_int cache_keylen; /* key length */ int cache_type; /* key type */ u_short cache_flags; /* flags that wave */ /* * init_auth - initialize internal data */ void init_auth(void) { /* * Initialize hash table and free list */ memset((char *)key_hash, 0, sizeof key_hash); } /* * auth_findkey - find a key in the hash table */ struct savekey * auth_findkey( keyid_t keyno ) { struct savekey *sk; sk = key_hash[KEYHASH(keyno)]; while (sk != 0) { if (keyno == sk->keyid) return (sk); sk = sk->next; } return (0); } /* * auth_havekey - return one if the key is known */ int auth_havekey( keyid_t keyno ) { struct savekey *sk; if (keyno == 0 || (keyno == cache_keyid)) return (1); sk = key_hash[KEYHASH(keyno)]; while (sk != 0) { if (keyno == sk->keyid) return (1); sk = sk->next; } return (0); } /* * authhavekey - return one and cache the key, if known and trusted. */ int authhavekey( keyid_t keyno ) { struct savekey *sk; authkeylookups++; if (keyno == 0 || keyno == cache_keyid) return (1); /* * Seach the bin for the key. If found and the key type * is zero, somebody marked it trusted without specifying * a key or key type. In this case consider the key missing. */ authkeyuncached++; sk = key_hash[KEYHASH(keyno)]; while (sk != NULL) { if (keyno == sk->keyid) { if (sk->type == 0) { authkeynotfound++; return (0); } break; } sk = sk->next; } /* * If the key is not found, or if it is found but not trusted, * the key is not considered found. */ if (sk == NULL) { authkeynotfound++; return (0); } if (!(sk->flags & KEY_TRUSTED)) { authnokey++; return (0); } /* * The key is found and trusted. Initialize the key cache. */ cache_keyid = sk->keyid; cache_type = sk->type; cache_flags = sk->flags; cache_key = sk->k.MD5_key; cache_keylen = sk->keylen; return (1); } /* * auth_moremem - get some more free key structures */ int auth_moremem(void) { struct savekey *sk; int i; sk = (struct savekey *)calloc(MEMINC, sizeof(struct savekey)); if (sk == 0) return (0); for (i = MEMINC; i > 0; i--) { sk->next = authfreekeys; authfreekeys = sk++; } authnumfreekeys += MEMINC; return (authnumfreekeys); } /* * authtrust - declare a key to be trusted/untrusted */ void authtrust( keyid_t keyno, u_long trust ) { struct savekey *sk; /* * Search bin for key; if it does not exist and is untrusted, * forget it. */ sk = key_hash[KEYHASH(keyno)]; while (sk != 0) { if (keyno == sk->keyid) break; sk = sk->next; } if (sk == 0 && !trust) return; /* * There are two conditions remaining. Either it does not * exist and is to be trusted or it does exist and is or is * not to be trusted. */ if (sk != 0) { if (cache_keyid == keyno) { cache_flags = 0; cache_keyid = 0; } /* * Key exists. If it is to be trusted, say so and * update its lifetime. If not, return it to the * free list. */ if (trust > 0) { sk->flags |= KEY_TRUSTED; if (trust > 1) sk->lifetime = current_time + trust; else sk->lifetime = 0; return; } sk->flags &= ~KEY_TRUSTED; { struct savekey *skp; skp = key_hash[KEYHASH(keyno)]; if (skp == sk) { key_hash[KEYHASH(keyno)] = sk->next; } else { while (skp->next != sk) skp = skp->next; skp->next = sk->next; } authnumkeys--; sk->next = authfreekeys; authfreekeys = sk; authnumfreekeys++; } return; } /* * Here there is not key, but the key is to be trusted. There * seems to be a disconnect here. Here we allocate a new key, * but do not specify a key type, key or key length. */ if (authnumfreekeys == 0) if (auth_moremem() == 0) return; sk = authfreekeys; authfreekeys = sk->next; authnumfreekeys--; sk->keyid = keyno; sk->type = 0; sk->keylen = 0; sk->flags = KEY_TRUSTED; sk->next = key_hash[KEYHASH(keyno)]; key_hash[KEYHASH(keyno)] = sk; authnumkeys++; return; } /* * authistrusted - determine whether a key is trusted */ int authistrusted( keyid_t keyno ) { struct savekey *sk; if (keyno == cache_keyid) return ((cache_flags & KEY_TRUSTED) != 0); authkeyuncached++; sk = key_hash[KEYHASH(keyno)]; while (sk != 0) { if (keyno == sk->keyid) break; sk = sk->next; } if (sk == 0) { authkeynotfound++; return (0); } else if (!(sk->flags & KEY_TRUSTED)) { authkeynotfound++; return (0); } return (1); } void MD5auth_setkey( keyid_t keyno, int keytype, const u_char *key, const int len ) { struct savekey *sk; /* * See if we already have the key. If so just stick in the * new value. */ sk = key_hash[KEYHASH(keyno)]; while (sk != NULL) { if (keyno == sk->keyid) { sk->type = keytype; sk->keylen = min(len, sizeof(sk->k.MD5_key)); #ifndef DISABLE_BUG1243_FIX memcpy(sk->k.MD5_key, key, sk->keylen); #else strncpy((char *)sk->k.MD5_key, (const char *)key, sizeof(sk->k.MD5_key)); #endif if (cache_keyid == keyno) { cache_flags = 0; cache_keyid = 0; } return; } sk = sk->next; } /* * Need to allocate new structure. Do it. */ if (0 == authnumfreekeys && !auth_moremem()) return; sk = authfreekeys; authfreekeys = sk->next; authnumfreekeys--; sk->keyid = keyno; sk->type = keytype; sk->flags = 0; sk->lifetime = 0; sk->keylen = min(len, sizeof(sk->k.MD5_key)); #ifndef DISABLE_BUG1243_FIX memcpy(sk->k.MD5_key, key, sk->keylen); #else strncpy((char *)sk->k.MD5_key, (const char *)key, sizeof(sk->k.MD5_key)); #endif sk->next = key_hash[KEYHASH(keyno)]; key_hash[KEYHASH(keyno)] = sk; #ifdef DEBUG if (debug > 1) { char hex[] = "0123456789abcdef"; int j; printf("auth_setkey: key %d type %d len %d ", sk->keyid, sk->type, sk->keylen); for (j = 0; j < sk->keylen; j++) printf("%c%c", hex[key[j] >> 4], hex[key[j] & 0xf]); printf("\n"); } #endif authnumkeys++; } /* * auth_delkeys - delete all known keys, in preparation for rereading * the keys file (presumably) */ void auth_delkeys(void) { struct savekey *sk; struct savekey **skp; int i; for (i = 0; i < HASHSIZE; i++) { skp = &(key_hash[i]); sk = key_hash[i]; /* * Leave autokey keys alone. */ while (sk != 0 && sk->keyid <= NTP_MAXKEY) { /* * Don't lose info as to which keys are trusted. */ if (sk->flags & KEY_TRUSTED) { skp = &(sk->next); memset(&sk->k, 0, sizeof(sk->k)); sk->lifetime = 0; sk->keylen = 0; sk = sk->next; } else { *skp = sk->next; authnumkeys--; sk->next = authfreekeys; authfreekeys = sk; authnumfreekeys++; sk = *skp; } } } } /* * auth_agekeys - delete keys whose lifetimes have expired */ void auth_agekeys(void) { struct savekey *sk; struct savekey *skp; int i; for (i = 0; i < HASHSIZE; i++) { sk = skp = key_hash[i]; while (sk != 0) { skp = sk->next; if (sk->lifetime > 0 && current_time > sk->lifetime) { authtrust(sk->keyid, 0); authkeyexpired++; } sk = skp; } } #ifdef DEBUG if (debug) printf("auth_agekeys: at %lu keys %lu expired %lu\n", current_time, authnumkeys, authkeyexpired); #endif } /* * authencrypt - generate message authenticator * * Returns length of authenticator field, zero if key not found. */ int authencrypt( keyid_t keyno, u_int32 *pkt, int length ) { /* * A zero key identifier means the sender has not verified * the last message was correctly authenticated. The MAC * consists of a single word with value zero. */ authencryptions++; pkt[length / 4] = htonl(keyno); if (keyno == 0) { return (4); } if (!authhavekey(keyno)) return (0); return (MD5authencrypt(cache_type, cache_key, pkt, length)); } /* * authdecrypt - verify message authenticator * * Returns one if authenticator valid, zero if invalid or key not found. */ int authdecrypt( keyid_t keyno, u_int32 *pkt, int length, int size ) { /* * A zero key identifier means the sender has not verified * the last message was correctly authenticated. Nevertheless, * the authenticator itself is considered valid. */ authdecryptions++; if (keyno == 0) return (0); if (!authhavekey(keyno) || size < 4) return (0); return (MD5authdecrypt(cache_type, cache_key, pkt, length, size)); } ntp-4.2.6p5/libntp/machines.c0000644000175000017500000003260711636775106015060 0ustar peterpeter/* machines.c - provide special support for peculiar architectures * * Real bummers unite ! * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ntp.h" #include "ntp_machine.h" #include "ntp_syslog.h" #include "ntp_stdlib.h" #include "ntp_unixtime.h" #include "lib_strbuf.h" #ifdef HAVE_UNISTD_H #include #endif #ifdef SYS_WINNT int _getch(void); /* Declare the one function rather than include conio.h */ #else #ifdef SYS_VXWORKS #include "taskLib.h" #include "sysLib.h" #include "time.h" #include "ntp_syslog.h" /* some translations to the world of vxWorkings -casey */ /* first some netdb type things */ #include "ioLib.h" #include int h_errno; struct hostent *gethostbyname(char *name) { struct hostent *host1; h_errno = 0; /* we are always successful!!! */ host1 = (struct hostent *) malloc (sizeof(struct hostent)); host1->h_name = name; host1->h_addrtype = AF_INET; host1->h_aliases = name; host1->h_length = 4; host1->h_addr_list[0] = (char *)hostGetByName (name); host1->h_addr_list[1] = NULL; return host1; } struct hostent *gethostbyaddr(char *name, int size, int addr_type) { struct hostent *host1; h_errno = 0; /* we are always successful!!! */ host1 = (struct hostent *) malloc (sizeof(struct hostent)); host1->h_name = name; host1->h_addrtype = AF_INET; host1->h_aliases = name; host1->h_length = 4; host1->h_addr_list = NULL; return host1; } struct servent *getservbyname (char *name, char *type) { struct servent *serv1; serv1 = (struct servent *) malloc (sizeof(struct servent)); serv1->s_name = "ntp"; /* official service name */ serv1->s_aliases = NULL; /* alias list */ serv1->s_port = 123; /* port # */ serv1->s_proto = "udp"; /* protocol to use */ return serv1; } /* second * vxworks thinks it has insomnia * we have to sleep for number of seconds */ #define CLKRATE sysClkRateGet() /* I am not sure how valid the granularity is - it is from G. Eger's port */ #define CLK_GRANULARITY 1 /* Granularity of system clock in usec */ /* Used to round down # usecs/tick */ /* On a VCOM-100, PIT gets 8 MHz clk, */ /* & it prescales by 32, thus 4 usec */ /* on mv167, granularity is 1usec anyway*/ /* To defeat rounding, set to 1 */ #define USECS_PER_SEC MILLION /* Microseconds per second */ #define TICK (((USECS_PER_SEC / CLKRATE) / CLK_GRANULARITY) * CLK_GRANULARITY) /* emulate unix sleep * casey */ void sleep(int seconds) { taskDelay(seconds*TICK); } /* emulate unix alarm * that pauses and calls SIGALRM after the seconds are up... * so ... taskDelay() fudged for seconds should amount to the same thing. * casey */ void alarm (int seconds) { sleep(seconds); } #endif /* SYS_VXWORKS */ #ifdef SYS_PTX /* Does PTX still need this? */ /*#include */ #include int gettimeofday( struct timeval *tvp ) { /* * hi, this is Sequents sneak path to get to a clock * this is also the most logical syscall for such a function */ return (get_process_stats(tvp, PS_SELF, (struct procstats *) 0, (struct procstats *) 0)); } #endif /* SYS_PTX */ #ifdef MPE /* This is a substitute for bind() that if called for an AF_INET socket port less than 1024, GETPRIVMODE() and GETUSERMODE() calls will be done. */ #undef bind #include #include #include #include extern void GETPRIVMODE(void); extern void GETUSERMODE(void); int __ntp_mpe_bind(int s, void *addr, int addrlen); int __ntp_mpe_bind(int s, void *addr, int addrlen) { int priv = 0; int result; if (addrlen == sizeof(struct sockaddr_in)) { /* AF_INET */ if (((struct sockaddr_in *)addr)->sin_port > 0 && ((struct sockaddr_in *)addr)->sin_port < 1024) { priv = 1; GETPRIVMODE(); } /* ((struct sockaddr_in *)addr)->sin_addr.s_addr = 0; */ result = bind(s,addr,addrlen); if (priv == 1) GETUSERMODE(); } else /* AF_UNIX */ result = bind(s,addr,addrlen); return result; } /* * MPE stupidly requires sfcntl() to be used on sockets instead of fcntl(), * so we define a wrapper to analyze the file descriptor and call the correct * function. */ #undef fcntl #include #include int __ntp_mpe_fcntl(int fd, int cmd, int arg); int __ntp_mpe_fcntl(int fd, int cmd, int arg) { int len; struct sockaddr sa; extern int sfcntl(int, int, int); len = sizeof sa; if (getsockname(fd, &sa, &len) == -1) { if (errno == EAFNOSUPPORT) /* AF_UNIX socket */ return sfcntl(fd, cmd, arg); if (errno == ENOTSOCK) /* file or pipe */ return fcntl(fd, cmd, arg); return (-1); /* unknown getsockname() failure */ } else /* AF_INET socket */ return sfcntl(fd, cmd, arg); } /* * Setitimer emulation support. Note that we implement this using alarm(), * and since alarm() only delivers one signal, we must re-enable the alarm * by enabling our own SIGALRM setitimer_mpe_handler routine to be called * before the real handler routine and re-enable the alarm at that time. * * Note that this solution assumes that sigaction(SIGALRM) is called before * calling setitimer(). If it should ever to become necessary to support * sigaction(SIGALRM) after calling setitimer(), it will be necessary to trap * those sigaction() calls. */ #include #include /* * Some global data that needs to be shared between setitimer() and * setitimer_mpe_handler(). */ struct { unsigned long current_msec; /* current alarm() value in effect */ unsigned long interval_msec; /* next alarm() value from setitimer */ unsigned long value_msec; /* first alarm() value from setitimer */ struct itimerval current_itimerval; /* current itimerval in effect */ struct sigaction oldact; /* SIGALRM state saved by setitimer */ } setitimer_mpe_ctx = { 0, 0, 0 }; /* * Undocumented, unsupported function to do alarm() in milliseconds. */ extern unsigned int px_alarm(unsigned long, int *); /* * The SIGALRM handler routine enabled by setitimer(). Re-enable the alarm or * restore the original SIGALRM setting if no more alarms are needed. Then * call the original SIGALRM handler (if any). */ static RETSIGTYPE setitimer_mpe_handler(int sig) { int alarm_hpe_status; /* Update the new current alarm value */ setitimer_mpe_ctx.current_msec = setitimer_mpe_ctx.interval_msec; if (setitimer_mpe_ctx.interval_msec > 0) { /* Additional intervals needed; re-arm the alarm timer */ px_alarm(setitimer_mpe_ctx.interval_msec,&alarm_hpe_status); } else { /* No more intervals, so restore previous original SIGALRM handler */ sigaction(SIGALRM, &setitimer_mpe_ctx.oldact, NULL); } /* Call the original SIGALRM handler if it is a function and not just a flag */ if (setitimer_mpe_ctx.oldact.sa_handler != SIG_DFL && setitimer_mpe_ctx.oldact.sa_handler != SIG_ERR && setitimer_mpe_ctx.oldact.sa_handler != SIG_IGN) (*setitimer_mpe_ctx.oldact.sa_handler)(SIGALRM); } /* * Our implementation of setitimer(). */ int setitimer(int which, struct itimerval *value, struct itimerval *ovalue) { int alarm_hpe_status; unsigned long remaining_msec, value_msec, interval_msec; struct sigaction newact; /* * Convert the initial interval to milliseconds */ if (value->it_value.tv_sec > (UINT_MAX / 1000)) value_msec = UINT_MAX; else value_msec = value->it_value.tv_sec * 1000; value_msec += value->it_value.tv_usec / 1000; /* * Convert the reset interval to milliseconds */ if (value->it_interval.tv_sec > (UINT_MAX / 1000)) interval_msec = UINT_MAX; else interval_msec = value->it_interval.tv_sec * 1000; interval_msec += value->it_interval.tv_usec / 1000; if (value_msec > 0 && interval_msec > 0) { /* * We'll be starting an interval timer that will be repeating, so we need to * insert our own SIGALRM signal handler to schedule the repeats. */ /* Read the current SIGALRM action */ if (sigaction(SIGALRM, NULL, &setitimer_mpe_ctx.oldact) < 0) { fprintf(stderr,"MPE setitimer old handler failed, errno=%d\n",errno); return -1; } /* Initialize the new action to call our SIGALRM handler instead */ newact.sa_handler = &setitimer_mpe_handler; newact.sa_mask = setitimer_mpe_ctx.oldact.sa_mask; newact.sa_flags = setitimer_mpe_ctx.oldact.sa_flags; if (sigaction(SIGALRM, &newact, NULL) < 0) { fprintf(stderr,"MPE setitimer new handler failed, errno=%d\n",errno); return -1; } } /* * Return previous itimerval if desired */ if (ovalue != NULL) *ovalue = setitimer_mpe_ctx.current_itimerval; /* * Save current parameters for later usage */ setitimer_mpe_ctx.current_itimerval = *value; setitimer_mpe_ctx.current_msec = value_msec; setitimer_mpe_ctx.value_msec = value_msec; setitimer_mpe_ctx.interval_msec = interval_msec; /* * Schedule the first alarm */ remaining_msec = px_alarm(value_msec, &alarm_hpe_status); if (alarm_hpe_status == 0) return (0); else return (-1); } /* * MPE lacks gettimeofday(), so we define our own. */ int gettimeofday(struct timeval *tvp) { /* Documented, supported MPE functions. */ extern void GETPRIVMODE(void); extern void GETUSERMODE(void); /* Undocumented, unsupported MPE functions. */ extern long long get_time(void); extern void get_time_change_info(long long *, char *, char *); extern long long ticks_to_micro(long long); char pwf_since_boot, recover_pwf_time; long long mpetime, offset_ticks, offset_usec; GETPRIVMODE(); mpetime = get_time(); /* MPE local time usecs since Jan 1 1970 */ get_time_change_info(&offset_ticks, &pwf_since_boot, &recover_pwf_time); offset_usec = ticks_to_micro(offset_ticks); /* UTC offset usecs */ GETUSERMODE(); mpetime = mpetime - offset_usec; /* Convert from local time to UTC */ tvp->tv_sec = mpetime / 1000000LL; tvp->tv_usec = mpetime % 1000000LL; return 0; } /* * MPE lacks settimeofday(), so we define our own. */ #define HAVE_SETTIMEOFDAY int settimeofday(struct timeval *tvp) { /* Documented, supported MPE functions. */ extern void GETPRIVMODE(void); extern void GETUSERMODE(void); /* Undocumented, unsupported MPE functions. */ extern void get_time_change_info(long long *, char *, char *); extern void initialize_system_time(long long, int); extern void set_time_correction(long long, int, int); extern long long ticks_to_micro(long long); char pwf_since_boot, recover_pwf_time; long long big_sec, big_usec, mpetime, offset_ticks, offset_usec; big_sec = tvp->tv_sec; big_usec = tvp->tv_usec; mpetime = (big_sec * 1000000LL) + big_usec; /* Desired UTC microseconds */ GETPRIVMODE(); set_time_correction(0LL,0,0); /* Cancel previous time correction, if any */ get_time_change_info(&offset_ticks, &pwf_since_boot, &recover_pwf_time); offset_usec = ticks_to_micro(offset_ticks); /* UTC offset microseconds */ mpetime = mpetime + offset_usec; /* Convert from UTC to local time */ initialize_system_time(mpetime,1); GETUSERMODE(); return 0; } #endif /* MPE */ #define SET_TOD_UNDETERMINED 0 #define SET_TOD_CLOCK_SETTIME 1 #define SET_TOD_SETTIMEOFDAY 2 #define SET_TOD_STIME 3 const char * const set_tod_used[] = { "undetermined", "clock_settime", "settimeofday", "stime" }; pset_tod_using set_tod_using = NULL; int ntp_set_tod( struct timeval *tvp, void *tzp ) { static int tod; int rc = -1; int saved_errno = 0; #ifdef DEBUG if (debug) printf("In ntp_set_tod\n"); #endif #ifdef HAVE_CLOCK_SETTIME if (rc && (SET_TOD_CLOCK_SETTIME == tod || !tod)) { struct timespec ts; /* Convert timeval to timespec */ ts.tv_sec = tvp->tv_sec; ts.tv_nsec = 1000 * tvp->tv_usec; errno = 0; rc = clock_settime(CLOCK_REALTIME, &ts); saved_errno = errno; #ifdef DEBUG if (debug) { printf("ntp_set_tod: clock_settime: %d: %s\n", rc, strerror(saved_errno)); } #endif if (!tod && !rc) tod = SET_TOD_CLOCK_SETTIME; } #endif /* HAVE_CLOCK_SETTIME */ #ifdef HAVE_SETTIMEOFDAY if (rc && (SET_TOD_SETTIMEOFDAY == tod || !tod)) { struct timeval adjtv; /* * Some broken systems don't reset adjtime() when the * clock is stepped. */ adjtv.tv_sec = adjtv.tv_usec = 0; adjtime(&adjtv, NULL); errno = 0; rc = SETTIMEOFDAY(tvp, tzp); saved_errno = errno; #ifdef DEBUG if (debug) { printf("ntp_set_tod: settimeofday: %d: %s\n", rc, strerror(saved_errno)); } #endif if (!tod && !rc) tod = SET_TOD_SETTIMEOFDAY; } #endif /* HAVE_SETTIMEOFDAY */ #ifdef HAVE_STIME if (rc && (SET_TOD_STIME == tod || !tod)) { long tp = tvp->tv_sec; errno = 0; rc = stime(&tp); /* lie as bad as SysVR4 */ saved_errno = errno; #ifdef DEBUG if (debug) { printf("ntp_set_tod: stime: %d: %s\n", rc, strerror(saved_errno)); } #endif if (!tod && !rc) tod = SET_TOD_STIME; } #endif /* HAVE_STIME */ #ifdef DEBUG if (debug) { printf("ntp_set_tod: Final result: %s: %d: %s\n", set_tod_used[tod], rc, strerror(saved_errno)); } #endif /* * Say how we're setting the time of day */ if (!rc && NULL != set_tod_using) { (*set_tod_using)(set_tod_used[tod]); set_tod_using = NULL; } if (rc) errno = saved_errno; return rc; } #endif /* not SYS_WINNT */ #if defined (SYS_WINNT) || defined (SYS_VXWORKS) || defined(MPE) /* getpass is used in ntpq.c and ntpdc.c */ char * getpass(const char * prompt) { int c, i; static char password[32]; fprintf(stderr, "%s", prompt); fflush(stderr); for (i=0; i 0) *a++ = (char) x; } #endif /*POSIX*/ ntp-4.2.6p5/libntp/humandate.c0000644000175000017500000000137311332473276015227 0ustar peterpeter/* * humandate - convert an NTP (or the current) time to something readable */ #include #include "ntp_fp.h" #include "ntp_unixtime.h" /* includes and */ #include "lib_strbuf.h" #include "ntp_stdlib.h" extern const char *months[]; /* prettydate.c */ /* This is used in msyslog.c; we don't want to clutter up the log with the year and day of the week, etc.; just the minimal date and time. */ char * humanlogtime(void) { char * bp; time_t cursec; struct tm * tm; cursec = time(NULL); tm = localtime(&cursec); if (!tm) return "-- --- --:--:--"; LIB_GETBUF(bp); snprintf(bp, LIB_BUFLENGTH, "%2d %s %02d:%02d:%02d", tm->tm_mday, months[tm->tm_mon], tm->tm_hour, tm->tm_min, tm->tm_sec); return bp; } ntp-4.2.6p5/libntp/calyearstart.c0000644000175000017500000000310111307651603015740 0ustar peterpeter/* * calyearstart - determine the NTP time at midnight of January 1 in * the year of the given date. */ #include #include "ntp_types.h" #include "ntp_calendar.h" #include "ntp_stdlib.h" #include "ntp_assert.h" /* * Juergen Perlinger, 2008-11-12 * Use the result of 'caljulian' to get the delta from the time stamp to the * beginning of the year. Do not make a second trip through 'caltontp' after * fixing the date, apart for invariant tests. */ u_long calyearstart(u_long ntp_time) { struct calendar jt; ntp_u_int32_t delta; caljulian(ntp_time,&jt); /* * Now we have days since yearstart (unity-based) and the time in that * day. Simply merge these together to seconds and subtract that from * input time. That's faster than going through the calendar stuff * again... */ delta = (ntp_u_int32_t)jt.yearday * SECSPERDAY + (ntp_u_int32_t)jt.hour * MINSPERHR * SECSPERMIN + (ntp_u_int32_t)jt.minute * SECSPERMIN + (ntp_u_int32_t)jt.second - SECSPERDAY; /* yearday is unity-based... */ # if ISC_CHECK_INVARIANT /* * check that this computes properly: do a roundtrip! That's the only * sensible test here, but it's a rather expensive invariant... */ jt.yearday = 0; jt.month = 1; jt.monthday = 1; jt.hour = 0; jt.minute = 0; jt.second = 0; NTP_INVARIANT((ntp_u_int32_t)(caltontp(&jt) + delta) == (ntp_u_int32_t)ntp_time); # endif /* The NTP time stamps (l_fp) count seconds unsigned mod 2**32, so we * have to calculate this in the proper way! */ return (ntp_u_int32_t)(ntp_time - delta); } ntp-4.2.6p5/libntp/systime_s.c0000644000175000017500000000004110017034560015253 0ustar peterpeter#define SIM #include "systime.c" ntp-4.2.6p5/libntp/refnumtoa.c0000644000175000017500000000123111307651603015244 0ustar peterpeter/* * refnumtoa - return asciized refclock addresses stored in local array space */ #include #include "ntp_net.h" #include "lib_strbuf.h" #include "ntp_stdlib.h" char * refnumtoa( sockaddr_u *num ) { register u_int32 netnum; register char *buf; register const char *rclock; LIB_GETBUF(buf); if (ISREFCLOCKADR(num)) { netnum = SRCADR(num); rclock = clockname((int)((u_long)netnum >> 8) & 0xff); if (rclock != NULL) snprintf(buf, LIB_BUFLENGTH, "%s(%lu)", rclock, (u_long)netnum & 0xff); else snprintf(buf, LIB_BUFLENGTH, "REFCLK(%lu,%lu)", ((u_long)netnum >> 8) & 0xff, (u_long)netnum & 0xff); } return buf; } ntp-4.2.6p5/libntp/bsd_strerror.c0000644000175000017500000000253411307651603015765 0ustar peterpeter#include #if !HAVE_STRERROR /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the University of California, Berkeley. The name of the * University may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)strerror.c 5.1 (Berkeley) 4/9/89"; #endif /* LIBC_SCCS and not lint */ #include #include #include #include "l_stdlib.h" char * strerror( int errnum ) { extern int sys_nerr; extern char *sys_errlist[]; static char ebuf[20]; if ((unsigned int)errnum < sys_nerr) return(sys_errlist[errnum]); (void)sprintf(ebuf, "Unknown error: %d", errnum); return(ebuf); } #else int strerror_bs; #endif ntp-4.2.6p5/libntp/tsftomsu.c0000644000175000017500000000130010017034560015117 0ustar peterpeter/* * tsftomsu - convert from a time stamp fraction to milliseconds */ #include "ntp_fp.h" #include "ntp_stdlib.h" int tsftomsu( u_long tsf, int round ) { register long val_ui, val_uf; register long tmp_ui, tmp_uf; register int i; /* * Essentially, multiply by 10 three times in l_fp form. * The integral part is the milliseconds. */ val_ui = 0; val_uf = tsf; for (i = 3; i > 0; i--) { M_LSHIFT(val_ui, val_uf); tmp_ui = val_ui; tmp_uf = val_uf; M_LSHIFT(val_ui, val_uf); M_LSHIFT(val_ui, val_uf); M_ADD(val_ui, val_uf, tmp_ui, tmp_uf); } /* * Round the value if need be, then return it. */ if (round && (val_uf & 0x80000000)) val_ui++; return (int)val_ui; } ntp-4.2.6p5/libntp/atouint.c0000644000175000017500000000107710017034553014733 0ustar peterpeter/* * atouint - convert an ascii string to an unsigned long, with error checking */ #include #include #include "ntp_types.h" #include "ntp_stdlib.h" int atouint( const char *str, u_long *uval ) { register u_long u; register const char *cp; cp = str; if (*cp == '\0') return 0; u = 0; while (*cp != '\0') { if (!isdigit((int)*cp)) return 0; if (u > 429496729 || (u == 429496729 && *cp >= '6')) return 0; /* overflow */ u = (u << 3) + (u << 1); u += *cp++ - '0'; /* ascii dependent */ } *uval = u; return 1; } ntp-4.2.6p5/libntp/strstr.c0000644000175000017500000000333510017034560014606 0ustar peterpeter#include #if !HAVE_STRSTR /* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: James da Silva, Systems Design and Analysis Group * Computer Science Department * University of Maryland at College Park */ /* * $Id$ * * replacement for missing ANSI-C strstr function */ char *strstr(a, b) char *a, *b; { int alen, blen, i; alen = strlen(a); blen = strlen(b); for(i=0; i <= alen-blen; i++, a++) if(strncmp(a, b, blen) == 0) return a; return NULL; } #else int strstr_bs; #endif ntp-4.2.6p5/libntp/mstolfp.c0000644000175000017500000000367510017034556014745 0ustar peterpeter/* * mstolfp - convert an ascii string in milliseconds to an l_fp number */ #include #include #include "ntp_fp.h" #include "ntp_stdlib.h" int mstolfp( const char *str, l_fp *lfp ) { register const char *cp; register char *bp; register const char *cpdec; char buf[100]; /* * We understand numbers of the form: * * [spaces][-][digits][.][digits][spaces|\n|\0] * * This is one enormous hack. Since I didn't feel like * rewriting the decoding routine for milliseconds, what * is essentially done here is to make a copy of the string * with the decimal moved over three places so the seconds * decoding routine can be used. */ bp = buf; cp = str; while (isspace((int)*cp)) cp++; if (*cp == '-') { *bp++ = '-'; cp++; } if (*cp != '.' && !isdigit((int)*cp)) return 0; /* * Search forward for the decimal point or the end of the string. */ cpdec = cp; while (isdigit((int)*cpdec)) cpdec++; /* * Found something. If we have more than three digits copy the * excess over, else insert a leading 0. */ if ((cpdec - cp) > 3) { do { *bp++ = (char)*cp++; } while ((cpdec - cp) > 3); } else { *bp++ = '0'; } /* * Stick the decimal in. If we've got less than three digits in * front of the millisecond decimal we insert the appropriate number * of zeros. */ *bp++ = '.'; if ((cpdec - cp) < 3) { register int i = 3 - (cpdec - cp); do { *bp++ = '0'; } while (--i > 0); } /* * Copy the remainder up to the millisecond decimal. If cpdec * is pointing at a decimal point, copy in the trailing number too. */ while (cp < cpdec) *bp++ = (char)*cp++; if (*cp == '.') { cp++; while (isdigit((int)*cp)) *bp++ = (char)*cp++; } *bp = '\0'; /* * Check to make sure the string is properly terminated. If * so, give the buffer to the decoding routine. */ if (*cp != '\0' && !isspace((int)*cp)) return 0; return atolfp(buf, lfp); } ntp-4.2.6p5/libntp/ntp_libopts.c0000644000175000017500000000215511505336022015602 0ustar peterpeter/* * ntp_libopts.c * * Common code interfacing with Autogen's libopts command-line option * processing. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include "ntp_libopts.h" #include "ntp_stdlib.h" extern const char *Version; /* version.c for each program */ /* * ntpOptionProcess() is a clone of libopts' optionProcess which * overrides the --version output, appending detail from version.c * which was not available at Autogen time. */ int ntpOptionProcess( tOptions * pOpts, int argc, char ** argv ) { char * pchOpts; char ** ppzFullVersion; char * pzNewFV; char * pzAutogenFV; size_t octets; int rc; pchOpts = (void *)pOpts; ppzFullVersion = (char **)(pchOpts + offsetof(tOptions, pzFullVersion)); pzAutogenFV = *ppzFullVersion; octets = strlen(pzAutogenFV) + 1 + /* '\n' */ strlen(Version) + 1; /* '\0' */ pzNewFV = emalloc(octets); snprintf(pzNewFV, octets, "%s\n%s", pzAutogenFV, Version); *ppzFullVersion = pzNewFV; rc = optionProcess(pOpts, argc, argv); *ppzFullVersion = pzAutogenFV; free(pzNewFV); return rc; } ntp-4.2.6p5/libntp/caltontp.c0000644000175000017500000001016011307651603015071 0ustar peterpeter/* * caltontp - convert a date to an NTP time */ #include #include "ntp_types.h" #include "ntp_calendar.h" #include "ntp_stdlib.h" #include "ntp_assert.h" /* * Juergen Perlinger, 2008-11-12 * Add support for full calendar calculatios. If the day-of-year is provided * (that is, not zero) it will be used instead of month and day-of-month; * otherwise a full turn through the calendar calculations will be taken. * * I know that Harlan Stenn likes to see assertions in production code, and I * agree there, but it would be a tricky thing here. The algorithm is quite * capable of producing sensible answers even to seemingly weird inputs: the * date -03-00, the 0.th March of the year, will be automtically * treated as the last day of February, no matter whether the year is a leap * year or not. So adding constraints is merely for the benefit of the callers, * because the only thing we can check for consistency is our input, produced * by somebody else. * * BTW: A total roundtrip using 'caljulian' would be a quite shaky thing: * Because of the truncation of the NTP time stamp to 32 bits and the epoch * unfolding around the current time done by 'caljulian' the roundtrip does * *not* necessarily reproduce the input, especially if the time spec is more * than 68 years off from the current time... */ u_long caltontp( const struct calendar *jt ) { ntp_u_int32_t days; /* full days in NTP epoch */ ntp_u_int32_t years; /* complete ACE years before date */ ntp_u_int32_t month; /* adjusted month for calendar */ NTP_INSIST(jt != NULL); NTP_REQUIRE(jt->month <= 13); /* permit month 0..13! */ NTP_REQUIRE(jt->monthday <= 32); NTP_REQUIRE(jt->yearday <= 366); NTP_REQUIRE(jt->hour <= 24); NTP_REQUIRE(jt->minute <= MINSPERHR); NTP_REQUIRE(jt->second <= SECSPERMIN); /* * First convert the date to fully elapsed days since NTP epoch. The * expressions used here give us initially days since 0001-01-01, the * beginning of the christian era in the proleptic gregorian calendar; * they are rebased on-the-fly into days since beginning of the NTP * epoch, 1900-01-01. */ if (jt->yearday) { /* * Assume that the day-of-year contains a useable value and * avoid all calculations involving month and day-of-month. */ years = jt->year - 1; days = years * DAYSPERYEAR /* days in previous years */ + years / 4 /* plus prior years's leap days */ - years / 100 /* minus leapless century years */ + years / 400 /* plus leapful Gregorian yrs */ + jt->yearday /* days this year */ - DAY_NTP_STARTS; /* rebase to NTP epoch */ } else { /* * The following code is according to the excellent book * 'Calendrical Calculations' by Nachum Dershowitz and Edward * Reingold. It does a full calendar evaluation, using one of * the alternate algorithms: Shift to a hypothetical year * starting on the previous march,1st; merge years, month and * days; undo the the 9 month shift (which is 306 days). The * advantage is that we do NOT need to now whether a year is a * leap year or not, because the leap day is the LAST day of * the year. */ month = (ntp_u_int32_t)jt->month + 9; years = jt->year - 1 + month / 12; month %= 12; days = years * DAYSPERYEAR /* days in previous years */ + years / 4 /* plus prior years's leap days */ - years / 100 /* minus leapless century years */ + years / 400 /* plus leapful Gregorian yrs */ + (month * 153 + 2) / 5 /* plus days before month */ + jt->monthday /* plus day-of-month */ - 306 /* minus 9 months */ - DAY_NTP_STARTS; /* rebase to NTP epoch */ } /* * Do the obvious: Merge everything together, making sure integer * promotion doesn't play dirty tricks on us; there is probably some * redundancy in the casts, but this drives it home with force. All * arithmetic is done modulo 2**32, because the result is truncated * anyway. */ return days * SECSPERDAY + (ntp_u_int32_t)jt->hour * MINSPERHR*SECSPERMIN + (ntp_u_int32_t)jt->minute * SECSPERMIN + (ntp_u_int32_t)jt->second; } ntp-4.2.6p5/libntp/atolfp.c0000644000175000017500000000346311307651603014542 0ustar peterpeter/* * atolfp - convert an ascii string to an l_fp number */ #include #include #include "ntp_fp.h" #include "ntp_string.h" #include "ntp_assert.h" /* * Powers of 10 */ static u_long ten_to_the_n[10] = { 0, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, }; int atolfp( const char *str, l_fp *lfp ) { register const char *cp; register u_long dec_i; register u_long dec_f; char *ind; int ndec; int isneg; static const char *digits = "0123456789"; NTP_REQUIRE(str != NULL); isneg = 0; dec_i = dec_f = 0; ndec = 0; cp = str; /* * We understand numbers of the form: * * [spaces][-|+][digits][.][digits][spaces|\n|\0] */ while (isspace((int)*cp)) cp++; if (*cp == '-') { cp++; isneg = 1; } if (*cp == '+') cp++; if (*cp != '.' && !isdigit((int)*cp)) return 0; while (*cp != '\0' && (ind = strchr(digits, *cp)) != NULL) { dec_i = (dec_i << 3) + (dec_i << 1); /* multiply by 10 */ dec_i += (ind - digits); cp++; } if (*cp != '\0' && !isspace((int)*cp)) { if (*cp++ != '.') return 0; while (ndec < 9 && *cp != '\0' && (ind = strchr(digits, *cp)) != NULL) { ndec++; dec_f = (dec_f << 3) + (dec_f << 1); /* *10 */ dec_f += (ind - digits); cp++; } while (isdigit((int)*cp)) cp++; if (*cp != '\0' && !isspace((int)*cp)) return 0; } if (ndec > 0) { register u_long tmp; register u_long bit; register u_long ten_fact; ten_fact = ten_to_the_n[ndec]; tmp = 0; bit = 0x80000000; while (bit != 0) { dec_f <<= 1; if (dec_f >= ten_fact) { tmp |= bit; dec_f -= ten_fact; } bit >>= 1; } if ((dec_f << 1) > ten_fact) tmp++; dec_f = tmp; } if (isneg) M_NEG(dec_i, dec_f); lfp->l_ui = dec_i; lfp->l_uf = dec_f; return 1; } ntp-4.2.6p5/libntp/mfptoa.c0000644000175000017500000000050510017034556014534 0ustar peterpeter/* * mfptoa - Return an asciized representation of a signed long fp number */ #include "ntp_fp.h" #include "ntp_stdlib.h" char * mfptoa( u_long fpi, u_long fpf, short ndec ) { int isneg; if (M_ISNEG(fpi, fpf)) { isneg = 1; M_NEG(fpi, fpf); } else isneg = 0; return dolfptoa(fpi, fpf, isneg, ndec, 0); } ntp-4.2.6p5/libntp/hextoint.c0000644000175000017500000000117611307651603015116 0ustar peterpeter/* * hextoint - convert an ascii string in hex to an unsigned * long, with error checking */ #include #include "ntp_stdlib.h" int hextoint( const char *str, u_long *pu ) { register u_long u; register const char *cp; cp = str; if (*cp == '\0') return 0; u = 0; while (*cp != '\0') { if (!isxdigit(*cp)) return 0; if (u & 0xF0000000) return 0; /* overflow */ u <<= 4; if ('0' <= *cp && *cp <= '9') u += *cp++ - '0'; else if ('a' <= *cp && *cp <= 'f') u += *cp++ - 'a' + 10; else if ('A' <= *cp && *cp <= 'F') u += *cp++ - 'A' + 10; else return 0; } *pu = u; return 1; } ntp-4.2.6p5/libntp/octtoint.c0000644000175000017500000000104410017034557015111 0ustar peterpeter/* * octtoint - convert an ascii string in octal to an unsigned * long, with error checking */ #include #include #include "ntp_stdlib.h" int octtoint( const char *str, u_long *ival ) { register u_long u; register const char *cp; cp = str; if (*cp == '\0') return 0; u = 0; while (*cp != '\0') { if (!isdigit((int)*cp) || *cp == '8' || *cp == '9') return 0; if (u >= 0x20000000) return 0; /* overflow */ u <<= 3; u += *cp++ - '0'; /* ascii dependent */ } *ival = u; return 1; } ntp-4.2.6p5/libntp/dofptoa.c0000644000175000017500000000343710017034554014707 0ustar peterpeter/* * dofptoa - do the grunge work to convert an fp number to ascii */ #include #include "ntp_fp.h" #include "lib_strbuf.h" #include "ntp_string.h" #include "ntp_stdlib.h" char * dofptoa( u_fp fpv, int neg, short ndec, int msec ) { register u_char *cp, *cpend; register u_long val; register short dec; u_char cbuf[12]; u_char *cpdec; char *buf; char *bp; /* * Get a string buffer before starting */ LIB_GETBUF(buf); /* * Zero out the buffer */ memset((char *)cbuf, 0, sizeof cbuf); /* * Set the pointers to point at the first * decimal place. Get a local copy of the value. */ cp = cpend = &cbuf[5]; val = fpv; /* * If we have to, decode the integral part */ if (!(val & 0xffff0000)) cp--; else { register u_short sv = (u_short)(val >> 16); register u_short tmp; register u_short ten = 10; do { tmp = sv; sv = (u_short) (sv/ten); *(--cp) = (u_char)(tmp - ((sv<<3) + (sv<<1))); } while (sv != 0); } /* * Figure out how much of the fraction to do */ if (msec) { dec = (short)(ndec + 3); if (dec < 3) dec = 3; cpdec = &cbuf[8]; } else { dec = ndec; cpdec = cpend; } if (dec > 6) dec = 6; if (dec > 0) { do { val &= 0xffff; val = (val << 3) + (val << 1); *cpend++ = (u_char)(val >> 16); } while (--dec > 0); } if (val & 0x8000) { register u_char *tp; /* * Round it. Ick. */ tp = cpend; *(--tp) += 1; while (*tp >= 10) { *tp = 0; *(--tp) += 1; } } /* * Remove leading zeroes if necessary */ while (cp < (cpdec -1) && *cp == 0) cp++; /* * Copy it into the buffer, asciizing as we go. */ bp = buf; if (neg) *bp++ = '-'; while (cp < cpend) { if (cp == cpdec) *bp++ = '.'; *bp++ = (char)(*cp++ + '0'); } *bp = '\0'; return buf; } ntp-4.2.6p5/libntp/tvtots.c0000644000175000017500000001574410017034560014617 0ustar peterpeter/* * tvtots - tables for converting from Unix struct timeval's to * NTP time stamp format. */ #include #include "ntp_types.h" /* * Tables to calculate time stamp fractions from usecs. The entries * in these tables are offset into using each of the two low order * bytes plus the next 4 bits in a usec value (from a struct timeval). * These are summed to produce the time stamp fraction. * * Note that these tables are rounded (not truncated) to the nearest * low order bit in the fraction. The timestamp computed should be * +- 1.5 low order bits. */ u_long ustotslo[256] = { 0x00000000, 0x000010c7, 0x0000218e, 0x00003255, 0x0000431c, 0x000053e3, 0x000064aa, 0x00007571, 0x00008638, 0x000096ff, 0x0000a7c6, 0x0000b88d, 0x0000c954, 0x0000da1b, 0x0000eae2, 0x0000fba9, 0x00010c6f, 0x00011d36, 0x00012dfd, 0x00013ec4, 0x00014f8b, 0x00016052, 0x00017119, 0x000181e0, 0x000192a7, 0x0001a36e, 0x0001b435, 0x0001c4fc, 0x0001d5c3, 0x0001e68a, 0x0001f751, 0x00020818, 0x000218df, 0x000229a6, 0x00023a6d, 0x00024b34, 0x00025bfb, 0x00026cc2, 0x00027d89, 0x00028e50, 0x00029f17, 0x0002afde, 0x0002c0a5, 0x0002d16c, 0x0002e233, 0x0002f2fa, 0x000303c0, 0x00031487, 0x0003254e, 0x00033615, 0x000346dc, 0x000357a3, 0x0003686a, 0x00037931, 0x000389f8, 0x00039abf, 0x0003ab86, 0x0003bc4d, 0x0003cd14, 0x0003dddb, 0x0003eea2, 0x0003ff69, 0x00041030, 0x000420f7, 0x000431be, 0x00044285, 0x0004534c, 0x00046413, 0x000474da, 0x000485a1, 0x00049668, 0x0004a72f, 0x0004b7f6, 0x0004c8bd, 0x0004d984, 0x0004ea4b, 0x0004fb12, 0x00050bd8, 0x00051c9f, 0x00052d66, 0x00053e2d, 0x00054ef4, 0x00055fbb, 0x00057082, 0x00058149, 0x00059210, 0x0005a2d7, 0x0005b39e, 0x0005c465, 0x0005d52c, 0x0005e5f3, 0x0005f6ba, 0x00060781, 0x00061848, 0x0006290f, 0x000639d6, 0x00064a9d, 0x00065b64, 0x00066c2b, 0x00067cf2, 0x00068db9, 0x00069e80, 0x0006af47, 0x0006c00e, 0x0006d0d5, 0x0006e19c, 0x0006f263, 0x00070329, 0x000713f0, 0x000724b7, 0x0007357e, 0x00074645, 0x0007570c, 0x000767d3, 0x0007789a, 0x00078961, 0x00079a28, 0x0007aaef, 0x0007bbb6, 0x0007cc7d, 0x0007dd44, 0x0007ee0b, 0x0007fed2, 0x00080f99, 0x00082060, 0x00083127, 0x000841ee, 0x000852b5, 0x0008637c, 0x00087443, 0x0008850a, 0x000895d1, 0x0008a698, 0x0008b75f, 0x0008c826, 0x0008d8ed, 0x0008e9b4, 0x0008fa7b, 0x00090b41, 0x00091c08, 0x00092ccf, 0x00093d96, 0x00094e5d, 0x00095f24, 0x00096feb, 0x000980b2, 0x00099179, 0x0009a240, 0x0009b307, 0x0009c3ce, 0x0009d495, 0x0009e55c, 0x0009f623, 0x000a06ea, 0x000a17b1, 0x000a2878, 0x000a393f, 0x000a4a06, 0x000a5acd, 0x000a6b94, 0x000a7c5b, 0x000a8d22, 0x000a9de9, 0x000aaeb0, 0x000abf77, 0x000ad03e, 0x000ae105, 0x000af1cc, 0x000b0292, 0x000b1359, 0x000b2420, 0x000b34e7, 0x000b45ae, 0x000b5675, 0x000b673c, 0x000b7803, 0x000b88ca, 0x000b9991, 0x000baa58, 0x000bbb1f, 0x000bcbe6, 0x000bdcad, 0x000bed74, 0x000bfe3b, 0x000c0f02, 0x000c1fc9, 0x000c3090, 0x000c4157, 0x000c521e, 0x000c62e5, 0x000c73ac, 0x000c8473, 0x000c953a, 0x000ca601, 0x000cb6c8, 0x000cc78f, 0x000cd856, 0x000ce91d, 0x000cf9e4, 0x000d0aaa, 0x000d1b71, 0x000d2c38, 0x000d3cff, 0x000d4dc6, 0x000d5e8d, 0x000d6f54, 0x000d801b, 0x000d90e2, 0x000da1a9, 0x000db270, 0x000dc337, 0x000dd3fe, 0x000de4c5, 0x000df58c, 0x000e0653, 0x000e171a, 0x000e27e1, 0x000e38a8, 0x000e496f, 0x000e5a36, 0x000e6afd, 0x000e7bc4, 0x000e8c8b, 0x000e9d52, 0x000eae19, 0x000ebee0, 0x000ecfa7, 0x000ee06e, 0x000ef135, 0x000f01fb, 0x000f12c2, 0x000f2389, 0x000f3450, 0x000f4517, 0x000f55de, 0x000f66a5, 0x000f776c, 0x000f8833, 0x000f98fa, 0x000fa9c1, 0x000fba88, 0x000fcb4f, 0x000fdc16, 0x000fecdd, 0x000ffda4, 0x00100e6b, 0x00101f32, 0x00102ff9, 0x001040c0, 0x00105187, 0x0010624e, 0x00107315, 0x001083dc, 0x001094a3, 0x0010a56a, 0x0010b631, }; u_long ustotsmid[256] = { 0x00000000, 0x0010c6f8, 0x00218def, 0x003254e7, 0x00431bde, 0x0053e2d6, 0x0064a9ce, 0x007570c5, 0x008637bd, 0x0096feb4, 0x00a7c5ac, 0x00b88ca4, 0x00c9539b, 0x00da1a93, 0x00eae18a, 0x00fba882, 0x010c6f7a, 0x011d3671, 0x012dfd69, 0x013ec460, 0x014f8b58, 0x01605250, 0x01711947, 0x0181e03f, 0x0192a736, 0x01a36e2e, 0x01b43526, 0x01c4fc1d, 0x01d5c315, 0x01e68a0c, 0x01f75104, 0x020817fc, 0x0218def3, 0x0229a5eb, 0x023a6ce3, 0x024b33da, 0x025bfad2, 0x026cc1c9, 0x027d88c1, 0x028e4fb9, 0x029f16b0, 0x02afdda8, 0x02c0a49f, 0x02d16b97, 0x02e2328f, 0x02f2f986, 0x0303c07e, 0x03148775, 0x03254e6d, 0x03361565, 0x0346dc5c, 0x0357a354, 0x03686a4b, 0x03793143, 0x0389f83b, 0x039abf32, 0x03ab862a, 0x03bc4d21, 0x03cd1419, 0x03dddb11, 0x03eea208, 0x03ff6900, 0x04102ff7, 0x0420f6ef, 0x0431bde7, 0x044284de, 0x04534bd6, 0x046412cd, 0x0474d9c5, 0x0485a0bd, 0x049667b4, 0x04a72eac, 0x04b7f5a3, 0x04c8bc9b, 0x04d98393, 0x04ea4a8a, 0x04fb1182, 0x050bd879, 0x051c9f71, 0x052d6669, 0x053e2d60, 0x054ef458, 0x055fbb4f, 0x05708247, 0x0581493f, 0x05921036, 0x05a2d72e, 0x05b39e25, 0x05c4651d, 0x05d52c15, 0x05e5f30c, 0x05f6ba04, 0x060780fb, 0x061847f3, 0x06290eeb, 0x0639d5e2, 0x064a9cda, 0x065b63d2, 0x066c2ac9, 0x067cf1c1, 0x068db8b8, 0x069e7fb0, 0x06af46a8, 0x06c00d9f, 0x06d0d497, 0x06e19b8e, 0x06f26286, 0x0703297e, 0x0713f075, 0x0724b76d, 0x07357e64, 0x0746455c, 0x07570c54, 0x0767d34b, 0x07789a43, 0x0789613a, 0x079a2832, 0x07aaef2a, 0x07bbb621, 0x07cc7d19, 0x07dd4410, 0x07ee0b08, 0x07fed200, 0x080f98f7, 0x08205fef, 0x083126e6, 0x0841edde, 0x0852b4d6, 0x08637bcd, 0x087442c5, 0x088509bc, 0x0895d0b4, 0x08a697ac, 0x08b75ea3, 0x08c8259b, 0x08d8ec92, 0x08e9b38a, 0x08fa7a82, 0x090b4179, 0x091c0871, 0x092ccf68, 0x093d9660, 0x094e5d58, 0x095f244f, 0x096feb47, 0x0980b23e, 0x09917936, 0x09a2402e, 0x09b30725, 0x09c3ce1d, 0x09d49514, 0x09e55c0c, 0x09f62304, 0x0a06e9fb, 0x0a17b0f3, 0x0a2877ea, 0x0a393ee2, 0x0a4a05da, 0x0a5accd1, 0x0a6b93c9, 0x0a7c5ac1, 0x0a8d21b8, 0x0a9de8b0, 0x0aaeafa7, 0x0abf769f, 0x0ad03d97, 0x0ae1048e, 0x0af1cb86, 0x0b02927d, 0x0b135975, 0x0b24206d, 0x0b34e764, 0x0b45ae5c, 0x0b567553, 0x0b673c4b, 0x0b780343, 0x0b88ca3a, 0x0b999132, 0x0baa5829, 0x0bbb1f21, 0x0bcbe619, 0x0bdcad10, 0x0bed7408, 0x0bfe3aff, 0x0c0f01f7, 0x0c1fc8ef, 0x0c308fe6, 0x0c4156de, 0x0c521dd5, 0x0c62e4cd, 0x0c73abc5, 0x0c8472bc, 0x0c9539b4, 0x0ca600ab, 0x0cb6c7a3, 0x0cc78e9b, 0x0cd85592, 0x0ce91c8a, 0x0cf9e381, 0x0d0aaa79, 0x0d1b7171, 0x0d2c3868, 0x0d3cff60, 0x0d4dc657, 0x0d5e8d4f, 0x0d6f5447, 0x0d801b3e, 0x0d90e236, 0x0da1a92d, 0x0db27025, 0x0dc3371d, 0x0dd3fe14, 0x0de4c50c, 0x0df58c03, 0x0e0652fb, 0x0e1719f3, 0x0e27e0ea, 0x0e38a7e2, 0x0e496ed9, 0x0e5a35d1, 0x0e6afcc9, 0x0e7bc3c0, 0x0e8c8ab8, 0x0e9d51b0, 0x0eae18a7, 0x0ebedf9f, 0x0ecfa696, 0x0ee06d8e, 0x0ef13486, 0x0f01fb7d, 0x0f12c275, 0x0f23896c, 0x0f345064, 0x0f45175c, 0x0f55de53, 0x0f66a54b, 0x0f776c42, 0x0f88333a, 0x0f98fa32, 0x0fa9c129, 0x0fba8821, 0x0fcb4f18, 0x0fdc1610, 0x0fecdd08, 0x0ffda3ff, 0x100e6af7, 0x101f31ee, 0x102ff8e6, 0x1040bfde, 0x105186d5, 0x10624dcd, 0x107314c4, 0x1083dbbc, 0x1094a2b4, 0x10a569ab, 0x10b630a3, }; u_long ustotshi[16] = { 0x00000000, 0x10c6f79a, 0x218def35, 0x3254e6cf, 0x431bde6a, 0x53e2d604, 0x64a9cd9f, 0x7570c539, 0x8637bcd3, 0x96feb46e, 0xa7c5ac08, 0xb88ca3a3, 0xc9539b3d, 0xda1a92d7, 0xeae18a72, 0xfba8820c, }; ntp-4.2.6p5/libntp/netof.c0000644000175000017500000000223411307651603014363 0ustar peterpeter/* * netof - return the net address part of an ip address in a sockaddr_storage structure * (zero out host part) */ #include #include #include "ntp_fp.h" #include "ntp_net.h" #include "ntp_stdlib.h" #include "ntp.h" sockaddr_u * netof( sockaddr_u *hostaddr ) { static sockaddr_u netofbuf[8]; static int next_netofbuf; u_int32 netnum; sockaddr_u * netaddr; netaddr = &netofbuf[next_netofbuf]; next_netofbuf = (next_netofbuf + 1) % COUNTOF(netofbuf); memcpy(netaddr, hostaddr, sizeof(*netaddr)); if (IS_IPV4(netaddr)) { netnum = SRCADR(netaddr); /* * We live in a modern CIDR world where the basement nets, which * used to be class A, are now probably associated with each * host address. So, for class-A nets, all bits are significant. */ if (IN_CLASSC(netnum)) netnum &= IN_CLASSC_NET; else if (IN_CLASSB(netnum)) netnum &= IN_CLASSB_NET; SET_ADDR4(netaddr, netnum); } else if (IS_IPV6(netaddr)) /* assume the typical /64 subnet size */ memset(&NSRCADR6(netaddr)[8], 0, 8); #ifdef DEBUG else { msyslog(LOG_ERR, "netof unknown AF %d", AF(netaddr)); exit(1); } #endif return netaddr; } ntp-4.2.6p5/libntp/authreadkeys.c0000644000175000017500000000771311307651604015751 0ustar peterpeter/* * authreadkeys.c - routines to support the reading of the key file */ #include #include #include #include "ntp_fp.h" #include "ntp.h" #include "ntp_syslog.h" #include "ntp_stdlib.h" #ifdef OPENSSL #include "openssl/objects.h" #endif /* OPENSSL */ /* Forwards */ static char *nexttok (char **); /* * nexttok - basic internal tokenizing routine */ static char * nexttok( char **str ) { register char *cp; char *starttok; cp = *str; /* * Space past white space */ while (*cp == ' ' || *cp == '\t') cp++; /* * Save this and space to end of token */ starttok = cp; while (*cp != '\0' && *cp != '\n' && *cp != ' ' && *cp != '\t' && *cp != '#') cp++; /* * If token length is zero return an error, else set end of * token to zero and return start. */ if (starttok == cp) return (NULL); if (*cp == ' ' || *cp == '\t') *cp++ = '\0'; else *cp = '\0'; *str = cp; return starttok; } /* * authreadkeys - (re)read keys from a file. */ int authreadkeys( const char *file ) { FILE *fp; char *line; char *token; keyid_t keyno; int keytype; char buf[512]; /* lots of room for line */ u_char keystr[20]; int len; int j; /* * Open file. Complain and return if it can't be opened. */ fp = fopen(file, "r"); if (fp == NULL) { msyslog(LOG_ERR, "authreadkeys: file %s: %m", file); return (0); } INIT_SSL(); /* * Remove all existing keys */ auth_delkeys(); /* * Now read lines from the file, looking for key entries */ while ((line = fgets(buf, sizeof buf, fp)) != NULL) { token = nexttok(&line); if (token == NULL) continue; /* * First is key number. See if it is okay. */ keyno = atoi(token); if (keyno == 0) { msyslog(LOG_ERR, "authreadkeys: cannot change key %s", token); continue; } if (keyno > NTP_MAXKEY) { msyslog(LOG_ERR, "authreadkeys: key %s > %d reserved for Autokey", token, NTP_MAXKEY); continue; } /* * Next is keytype. See if that is all right. */ token = nexttok(&line); if (token == NULL) { msyslog(LOG_ERR, "authreadkeys: no key type for key %d", keyno); continue; } #ifdef OPENSSL /* * The key type is the NID used by the message digest * algorithm. There are a number of inconsistencies in * the OpenSSL database. We attempt to discover them * here and prevent use of inconsistent data later. */ keytype = keytype_from_text(token, NULL); if (keytype == 0) { msyslog(LOG_ERR, "authreadkeys: invalid type for key %d", keyno); continue; } if (EVP_get_digestbynid(keytype) == NULL) { msyslog(LOG_ERR, "authreadkeys: no algorithm for key %d", keyno); continue; } #else /* OPENSSL */ /* * The key type is unused, but is required to be 'M' or * 'm' for compatibility. */ if (!(*token == 'M' || *token == 'm')) { msyslog(LOG_ERR, "authreadkeys: invalid type for key %d", keyno); continue; } keytype = KEY_TYPE_MD5; #endif /* OPENSSL */ /* * Finally, get key and insert it. If it is longer than 20 * characters, it is a binary string encoded in hex; * otherwise, it is a text string of printable ASCII * characters. */ token = nexttok(&line); if (token == NULL) { msyslog(LOG_ERR, "authreadkeys: no key for key %d", keyno); continue; } len = strlen(token); if (len <= 20) { MD5auth_setkey(keyno, keytype, (u_char *)token, len); } else { char hex[] = "0123456789abcdef"; u_char temp; char *ptr; int jlim; jlim = min(len, 2 * sizeof(keystr)); for (j = 0; j < jlim; j++) { ptr = strchr(hex, tolower(token[j])); if (ptr == NULL) { msyslog(LOG_ERR, "authreadkeys: invalid hex digit for key %d", keyno); continue; } temp = (u_char)(ptr - hex); if (j & 1) keystr[j / 2] |= temp; else keystr[j / 2] = temp << 4; } MD5auth_setkey(keyno, keytype, keystr, jlim / 2); } } fclose(fp); return (1); } ntp-4.2.6p5/libntp/syssignal.c0000644000175000017500000000361411307651603015267 0ustar peterpeter#ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "ntp_syslog.h" #include "ntp_stdlib.h" #ifdef HAVE_SIGACTION void signal_no_reset( #if defined(__STDC__) || defined(HAVE_STDARG_H) int sig, void (*func) (int) #else sig, func #endif ) #if defined(__STDC__) || defined(HAVE_STDARG_H) #else int sig; void (*func) (int); #endif { int n; struct sigaction vec; vec.sa_handler = func; sigemptyset(&vec.sa_mask); #if 0 #ifdef SA_RESTART vec.sa_flags = SA_RESTART; #else vec.sa_flags = 0; #endif #else vec.sa_flags = 0; #endif #ifdef SA_RESTART /* Added for PPS clocks on Solaris 7 which get EINTR errors */ # ifdef SIGPOLL if (sig == SIGPOLL) vec.sa_flags = SA_RESTART; # endif # ifdef SIGIO if (sig == SIGIO) vec.sa_flags = SA_RESTART; # endif #endif while (1) { struct sigaction ovec; n = sigaction(sig, &vec, &ovec); if (n == -1 && errno == EINTR) continue; if (ovec.sa_flags #ifdef SA_RESTART && ovec.sa_flags != SA_RESTART #endif ) msyslog(LOG_DEBUG, "signal_no_reset: signal %d had flags %x", sig, ovec.sa_flags); break; } if (n == -1) { perror("sigaction"); exit(1); } } #elif HAVE_SIGVEC void signal_no_reset( int sig, RETSIGTYPE (*func) (int) ) { struct sigvec sv; int n; bzero((char *) &sv, sizeof(sv)); sv.sv_handler = func; n = sigvec(sig, &sv, (struct sigvec *)NULL); if (n == -1) { perror("sigvec"); exit(1); } } #elif HAVE_SIGSET void signal_no_reset( int sig, RETSIGTYPE (*func) (int) ) { int n; n = sigset(sig, func); if (n == -1) { perror("sigset"); exit(1); } } #else /* Beware! This implementation resets the signal to SIG_DFL */ void signal_no_reset( int sig, RETSIGTYPE (*func) (int) ) { #ifdef SIG_ERR if (SIG_ERR == signal(sig, func)) { #else int n; n = signal(sig, func); if (n == -1) { #endif perror("signal"); exit(1); } } #endif ntp-4.2.6p5/libntp/dolfptoa.c0000644000175000017500000000644710441361232015064 0ustar peterpeter/* * dolfptoa - do the grunge work of converting an l_fp number to decimal */ #include #include "ntp_fp.h" #include "lib_strbuf.h" #include "ntp_string.h" #include "ntp_stdlib.h" char * dolfptoa( u_long fpi, u_long fpv, int neg, short ndec, int msec ) { register u_char *cp, *cpend; register u_long lwork; register int dec; u_char cbuf[24]; u_char *cpdec; char *buf; char *bp; /* * Get a string buffer before starting */ LIB_GETBUF(buf); /* * Zero the character buffer */ memset((char *) cbuf, 0, sizeof(cbuf)); /* * safeguard against sign extensions and other mishaps on 64 bit platforms * the code following is designed for and only for 32-bit inputs and * only 32-bit worth of input are supplied. */ fpi &= 0xffffffff; fpv &= 0xffffffff; /* * Work on the integral part. This is biased by what I know * compiles fairly well for a 68000. */ cp = cpend = &cbuf[10]; lwork = fpi; if (lwork & 0xffff0000) { register u_long lten = 10; register u_long ltmp; do { ltmp = lwork; lwork /= lten; ltmp -= (lwork << 3) + (lwork << 1); if (cp < cbuf) abort(); /* rather die a horrible death than trash the memory */ *--cp = (u_char)ltmp; } while (lwork & 0xffff0000); } if (lwork != 0) { register u_short sten = 10; register u_short stmp; register u_short swork = (u_short)lwork; do { stmp = swork; swork = (u_short) (swork/sten); stmp = (u_short)(stmp - ((swork<<3) + (swork<<1))); if (cp < cbuf) abort(); /* rather die a horrible death than trash the memory */ *--cp = (u_char)stmp; } while (swork != 0); } /* * Done that, now deal with the problem of the fraction. First * determine the number of decimal places. */ if (msec) { dec = ndec + 3; if (dec < 3) dec = 3; cpdec = &cbuf[13]; } else { dec = ndec; if (dec < 0) dec = 0; cpdec = &cbuf[10]; } if (dec > 12) dec = 12; /* * If there's a fraction to deal with, do so. */ if (fpv != 0) { l_fp work; work.l_ui = 0; work.l_uf = fpv; while (dec > 0) { l_fp ftmp; dec--; /* * The scheme here is to multiply the * fraction (0.1234...) by ten. This moves * a junk of BCD into the units part. * record that and iterate. */ work.l_ui = 0; L_LSHIFT(&work); ftmp = work; L_LSHIFT(&work); L_LSHIFT(&work); L_ADD(&work, &ftmp); *cpend++ = (u_char)work.l_ui; if (work.l_uf == 0) break; if (cpend > (cbuf + sizeof(cbuf))) abort(); /* rather die a horrible death than trash the memory */ } /* * Rounding is rotten */ if (work.l_uf & 0x80000000) { register u_char *tp = cpend; *(--tp) += 1; while (*tp >= 10) { *tp = 0; *(--tp) += 1; }; if (tp < cp) cp = tp; } } cpend += dec; /* * We've now got the fraction in cbuf[], with cp pointing at * the first character, cpend pointing past the last, and * cpdec pointing at the first character past the decimal. * Remove leading zeros, then format the number into the * buffer. */ while (cp < cpdec) { if (*cp != 0) break; cp++; } if (cp == cpdec) --cp; bp = buf; if (neg) *bp++ = '-'; while (cp < cpend) { if (cp == cpdec) *bp++ = '.'; *bp++ = (char)(*cp++ + '0'); /* ascii dependent? */ } *bp = '\0'; /* * Done! */ return buf; } ntp-4.2.6p5/libntp/snprintf.c0000644000175000017500000000154210017034557015114 0ustar peterpeter#include #if !HAVE_SNPRINTF #include #ifdef __STDC__ #include #else #include #endif #include #include "l_stdlib.h" #ifdef __STDC__ int snprintf(char *str, size_t n, const char *fmt, ...) #else int snprintf(str, n, fmt, va_alist) char *str; size_t n; const char *fmt; va_dcl #endif { va_list ap; int rval; #ifdef VSPRINTF_CHARSTAR char *rp; #endif #ifdef __STDC__ va_start(ap, fmt); #else va_start(ap); #endif #ifdef VSPRINTF_CHARSTAR rp = vsprintf(str, fmt, ap); va_end(ap); return (strlen(rp)); #else rval = vsprintf(str, fmt, ap); va_end(ap); return (rval); #endif } int vsnprintf( char *str, size_t n, const char *fmt, va_list ap ) { #ifdef VSPRINTF_CHARSTAR return (strlen(vsprintf(str, fmt, ap))); #else return (vsprintf(str, fmt, ap)); #endif } #else int snprintf_bs; #endif ntp-4.2.6p5/libntp/numtoa.c0000644000175000017500000000112211307651603014546 0ustar peterpeter/* * numtoa - return asciized network numbers store in local array space */ #include #include #ifdef HAVE_NETINET_IN_H #include /* ntohl */ #endif #include #include "ntp_fp.h" #include "lib_strbuf.h" #include "ntp_stdlib.h" char * numtoa( u_int32 num ) { register u_int32 netnum; register char *buf; netnum = ntohl(num); LIB_GETBUF(buf); snprintf(buf, LIB_BUFLENGTH, "%lu.%lu.%lu.%lu", ((u_long)netnum >> 24) & 0xff, ((u_long)netnum >> 16) & 0xff, ((u_long)netnum >> 8) & 0xff, (u_long)netnum & 0xff); return buf; } ntp-4.2.6p5/libntp/recvbuff.c0000644000175000017500000001174211307651603015056 0ustar peterpeter#ifdef HAVE_CONFIG_H # include #endif #include #include "ntp_machine.h" #include "ntp_assert.h" #include "ntp_fp.h" #include "ntp_syslog.h" #include "ntp_stdlib.h" #include "ntp_io.h" #include "ntp_lists.h" #include "recvbuff.h" #include "iosignal.h" #ifdef DEBUG static void uninit_recvbuff(void); #endif /* * Memory allocation */ static u_long volatile full_recvbufs; /* number of recvbufs on fulllist */ static u_long volatile free_recvbufs; /* number of recvbufs on freelist */ static u_long volatile total_recvbufs; /* total recvbufs currently in use */ static u_long volatile lowater_adds; /* number of times we have added memory */ static u_long volatile buffer_shortfall;/* number of missed free receive buffers between replenishments */ static ISC_LIST(recvbuf_t) full_recv_list; /* Currently used recv buffers */ static recvbuf_t * free_recv_list; /* Currently unused buffers */ #if defined(SYS_WINNT) /* * For Windows we need to set up a lock to manipulate the * recv buffers to prevent corruption. We keep it lock for as * short a time as possible */ static CRITICAL_SECTION RecvLock; # define LOCK() EnterCriticalSection(&RecvLock) # define UNLOCK() LeaveCriticalSection(&RecvLock) #else # define LOCK() # define UNLOCK() #endif u_long free_recvbuffs (void) { return free_recvbufs; } u_long full_recvbuffs (void) { return full_recvbufs; } u_long total_recvbuffs (void) { return total_recvbufs; } u_long lowater_additions(void) { return lowater_adds; } static inline void initialise_buffer(recvbuf_t *buff) { memset(buff, 0, sizeof(*buff)); } static void create_buffers(int nbufs) { register recvbuf_t *bufp; int i, abuf; abuf = nbufs + buffer_shortfall; buffer_shortfall = 0; #ifndef DEBUG bufp = emalloc(abuf * sizeof(*bufp)); #endif for (i = 0; i < abuf; i++) { #ifdef DEBUG /* * Allocate each buffer individually so they can be * free()d during ntpd shutdown on DEBUG builds to * keep them out of heap leak reports. */ bufp = emalloc(sizeof(*bufp)); #endif memset(bufp, 0, sizeof(*bufp)); LINK_SLIST(free_recv_list, bufp, link.next); bufp++; free_recvbufs++; total_recvbufs++; } lowater_adds++; } void init_recvbuff(int nbufs) { /* * Init buffer free list and stat counters */ ISC_LIST_INIT(full_recv_list); free_recvbufs = total_recvbufs = 0; full_recvbufs = lowater_adds = 0; create_buffers(nbufs); #if defined(SYS_WINNT) InitializeCriticalSection(&RecvLock); #endif #ifdef DEBUG atexit(&uninit_recvbuff); #endif } #ifdef DEBUG static void uninit_recvbuff(void) { recvbuf_t *rbunlinked; while ((rbunlinked = ISC_LIST_HEAD(full_recv_list)) != NULL) { ISC_LIST_DEQUEUE_TYPE(full_recv_list, rbunlinked, link, recvbuf_t); free(rbunlinked); } do { UNLINK_HEAD_SLIST(rbunlinked, free_recv_list, link.next); if (rbunlinked != NULL) free(rbunlinked); } while (rbunlinked != NULL); } #endif /* DEBUG */ /* * freerecvbuf - make a single recvbuf available for reuse */ void freerecvbuf(recvbuf_t *rb) { if (rb == NULL) { msyslog(LOG_ERR, "freerecvbuff received NULL buffer"); return; } LOCK(); (rb->used)--; if (rb->used != 0) msyslog(LOG_ERR, "******** freerecvbuff non-zero usage: %d *******", rb->used); LINK_SLIST(free_recv_list, rb, link.next); free_recvbufs++; UNLOCK(); } void add_full_recv_buffer(recvbuf_t *rb) { if (rb == NULL) { msyslog(LOG_ERR, "add_full_recv_buffer received NULL buffer"); return; } LOCK(); ISC_LINK_INIT(rb, link); ISC_LIST_APPEND(full_recv_list, rb, link); full_recvbufs++; UNLOCK(); } recvbuf_t * get_free_recv_buffer(void) { recvbuf_t *buffer; LOCK(); UNLINK_HEAD_SLIST(buffer, free_recv_list, link.next); if (buffer != NULL) { free_recvbufs--; initialise_buffer(buffer); (buffer->used)++; } else buffer_shortfall++; UNLOCK(); return (buffer); } #ifdef HAVE_IO_COMPLETION_PORT recvbuf_t * get_free_recv_buffer_alloc(void) { recvbuf_t *buffer; buffer = get_free_recv_buffer(); if (NULL == buffer) { create_buffers(RECV_INC); buffer = get_free_recv_buffer(); } NTP_ENSURE(buffer != NULL); return (buffer); } #endif recvbuf_t * get_full_recv_buffer(void) { recvbuf_t *rbuf; LOCK(); #ifdef HAVE_SIGNALED_IO /* * make sure there are free buffers when we * wander off to do lengthy packet processing with * any buffer we grab from the full list. * * fixes malloc() interrupted by SIGIO risk * (Bug 889) */ if (NULL == free_recv_list || buffer_shortfall > 0) { /* * try to get us some more buffers */ create_buffers(RECV_INC); } #endif /* * try to grab a full buffer */ rbuf = ISC_LIST_HEAD(full_recv_list); if (rbuf != NULL) { ISC_LIST_DEQUEUE_TYPE(full_recv_list, rbuf, link, recvbuf_t); --full_recvbufs; } else /* * Make sure we reset the full count to 0 */ full_recvbufs = 0; UNLOCK(); return (rbuf); } /* * Checks to see if there are buffers to process */ isc_boolean_t has_full_recv_buffer(void) { if (ISC_LIST_HEAD(full_recv_list) != NULL) return (ISC_TRUE); else return (ISC_FALSE); } ntp-4.2.6p5/libntp/tstotv.c0000644000175000017500000001352010017034560014605 0ustar peterpeter/* * tstotv - tables for converting from NTP time stamps to struct timeval */ #include "ntp_types.h" /* * Tables to convert from a time stamp fraction to usecs. Note that * the units of these tables are actually (usec<<3). We carry three * guard bits so that the result can be properly truncated (or rounded) * to be correct to the least significant bit. * * These tables are rounded. */ long tstoushi[256] = { 0x000000, 0x007a12, 0x00f424, 0x016e36, 0x01e848, 0x02625a, 0x02dc6c, 0x03567e, 0x03d090, 0x044aa2, 0x04c4b4, 0x053ec6, 0x05b8d8, 0x0632ea, 0x06acfc, 0x07270e, 0x07a120, 0x081b32, 0x089544, 0x090f56, 0x098968, 0x0a037a, 0x0a7d8c, 0x0af79e, 0x0b71b0, 0x0bebc2, 0x0c65d4, 0x0cdfe6, 0x0d59f8, 0x0dd40a, 0x0e4e1c, 0x0ec82e, 0x0f4240, 0x0fbc52, 0x103664, 0x10b076, 0x112a88, 0x11a49a, 0x121eac, 0x1298be, 0x1312d0, 0x138ce2, 0x1406f4, 0x148106, 0x14fb18, 0x15752a, 0x15ef3c, 0x16694e, 0x16e360, 0x175d72, 0x17d784, 0x185196, 0x18cba8, 0x1945ba, 0x19bfcc, 0x1a39de, 0x1ab3f0, 0x1b2e02, 0x1ba814, 0x1c2226, 0x1c9c38, 0x1d164a, 0x1d905c, 0x1e0a6e, 0x1e8480, 0x1efe92, 0x1f78a4, 0x1ff2b6, 0x206cc8, 0x20e6da, 0x2160ec, 0x21dafe, 0x225510, 0x22cf22, 0x234934, 0x23c346, 0x243d58, 0x24b76a, 0x25317c, 0x25ab8e, 0x2625a0, 0x269fb2, 0x2719c4, 0x2793d6, 0x280de8, 0x2887fa, 0x29020c, 0x297c1e, 0x29f630, 0x2a7042, 0x2aea54, 0x2b6466, 0x2bde78, 0x2c588a, 0x2cd29c, 0x2d4cae, 0x2dc6c0, 0x2e40d2, 0x2ebae4, 0x2f34f6, 0x2faf08, 0x30291a, 0x30a32c, 0x311d3e, 0x319750, 0x321162, 0x328b74, 0x330586, 0x337f98, 0x33f9aa, 0x3473bc, 0x34edce, 0x3567e0, 0x35e1f2, 0x365c04, 0x36d616, 0x375028, 0x37ca3a, 0x38444c, 0x38be5e, 0x393870, 0x39b282, 0x3a2c94, 0x3aa6a6, 0x3b20b8, 0x3b9aca, 0x3c14dc, 0x3c8eee, 0x3d0900, 0x3d8312, 0x3dfd24, 0x3e7736, 0x3ef148, 0x3f6b5a, 0x3fe56c, 0x405f7e, 0x40d990, 0x4153a2, 0x41cdb4, 0x4247c6, 0x42c1d8, 0x433bea, 0x43b5fc, 0x44300e, 0x44aa20, 0x452432, 0x459e44, 0x461856, 0x469268, 0x470c7a, 0x47868c, 0x48009e, 0x487ab0, 0x48f4c2, 0x496ed4, 0x49e8e6, 0x4a62f8, 0x4add0a, 0x4b571c, 0x4bd12e, 0x4c4b40, 0x4cc552, 0x4d3f64, 0x4db976, 0x4e3388, 0x4ead9a, 0x4f27ac, 0x4fa1be, 0x501bd0, 0x5095e2, 0x510ff4, 0x518a06, 0x520418, 0x527e2a, 0x52f83c, 0x53724e, 0x53ec60, 0x546672, 0x54e084, 0x555a96, 0x55d4a8, 0x564eba, 0x56c8cc, 0x5742de, 0x57bcf0, 0x583702, 0x58b114, 0x592b26, 0x59a538, 0x5a1f4a, 0x5a995c, 0x5b136e, 0x5b8d80, 0x5c0792, 0x5c81a4, 0x5cfbb6, 0x5d75c8, 0x5defda, 0x5e69ec, 0x5ee3fe, 0x5f5e10, 0x5fd822, 0x605234, 0x60cc46, 0x614658, 0x61c06a, 0x623a7c, 0x62b48e, 0x632ea0, 0x63a8b2, 0x6422c4, 0x649cd6, 0x6516e8, 0x6590fa, 0x660b0c, 0x66851e, 0x66ff30, 0x677942, 0x67f354, 0x686d66, 0x68e778, 0x69618a, 0x69db9c, 0x6a55ae, 0x6acfc0, 0x6b49d2, 0x6bc3e4, 0x6c3df6, 0x6cb808, 0x6d321a, 0x6dac2c, 0x6e263e, 0x6ea050, 0x6f1a62, 0x6f9474, 0x700e86, 0x708898, 0x7102aa, 0x717cbc, 0x71f6ce, 0x7270e0, 0x72eaf2, 0x736504, 0x73df16, 0x745928, 0x74d33a, 0x754d4c, 0x75c75e, 0x764170, 0x76bb82, 0x773594, 0x77afa6, 0x7829b8, 0x78a3ca, 0x791ddc, 0x7997ee }; long tstousmid[256] = { 0x0000, 0x007a, 0x00f4, 0x016e, 0x01e8, 0x0262, 0x02dc, 0x0356, 0x03d1, 0x044b, 0x04c5, 0x053f, 0x05b9, 0x0633, 0x06ad, 0x0727, 0x07a1, 0x081b, 0x0895, 0x090f, 0x0989, 0x0a03, 0x0a7e, 0x0af8, 0x0b72, 0x0bec, 0x0c66, 0x0ce0, 0x0d5a, 0x0dd4, 0x0e4e, 0x0ec8, 0x0f42, 0x0fbc, 0x1036, 0x10b0, 0x112b, 0x11a5, 0x121f, 0x1299, 0x1313, 0x138d, 0x1407, 0x1481, 0x14fb, 0x1575, 0x15ef, 0x1669, 0x16e3, 0x175d, 0x17d8, 0x1852, 0x18cc, 0x1946, 0x19c0, 0x1a3a, 0x1ab4, 0x1b2e, 0x1ba8, 0x1c22, 0x1c9c, 0x1d16, 0x1d90, 0x1e0a, 0x1e84, 0x1eff, 0x1f79, 0x1ff3, 0x206d, 0x20e7, 0x2161, 0x21db, 0x2255, 0x22cf, 0x2349, 0x23c3, 0x243d, 0x24b7, 0x2531, 0x25ac, 0x2626, 0x26a0, 0x271a, 0x2794, 0x280e, 0x2888, 0x2902, 0x297c, 0x29f6, 0x2a70, 0x2aea, 0x2b64, 0x2bde, 0x2c59, 0x2cd3, 0x2d4d, 0x2dc7, 0x2e41, 0x2ebb, 0x2f35, 0x2faf, 0x3029, 0x30a3, 0x311d, 0x3197, 0x3211, 0x328b, 0x3306, 0x3380, 0x33fa, 0x3474, 0x34ee, 0x3568, 0x35e2, 0x365c, 0x36d6, 0x3750, 0x37ca, 0x3844, 0x38be, 0x3938, 0x39b3, 0x3a2d, 0x3aa7, 0x3b21, 0x3b9b, 0x3c15, 0x3c8f, 0x3d09, 0x3d83, 0x3dfd, 0x3e77, 0x3ef1, 0x3f6b, 0x3fe5, 0x405f, 0x40da, 0x4154, 0x41ce, 0x4248, 0x42c2, 0x433c, 0x43b6, 0x4430, 0x44aa, 0x4524, 0x459e, 0x4618, 0x4692, 0x470c, 0x4787, 0x4801, 0x487b, 0x48f5, 0x496f, 0x49e9, 0x4a63, 0x4add, 0x4b57, 0x4bd1, 0x4c4b, 0x4cc5, 0x4d3f, 0x4db9, 0x4e34, 0x4eae, 0x4f28, 0x4fa2, 0x501c, 0x5096, 0x5110, 0x518a, 0x5204, 0x527e, 0x52f8, 0x5372, 0x53ec, 0x5466, 0x54e1, 0x555b, 0x55d5, 0x564f, 0x56c9, 0x5743, 0x57bd, 0x5837, 0x58b1, 0x592b, 0x59a5, 0x5a1f, 0x5a99, 0x5b13, 0x5b8d, 0x5c08, 0x5c82, 0x5cfc, 0x5d76, 0x5df0, 0x5e6a, 0x5ee4, 0x5f5e, 0x5fd8, 0x6052, 0x60cc, 0x6146, 0x61c0, 0x623a, 0x62b5, 0x632f, 0x63a9, 0x6423, 0x649d, 0x6517, 0x6591, 0x660b, 0x6685, 0x66ff, 0x6779, 0x67f3, 0x686d, 0x68e7, 0x6962, 0x69dc, 0x6a56, 0x6ad0, 0x6b4a, 0x6bc4, 0x6c3e, 0x6cb8, 0x6d32, 0x6dac, 0x6e26, 0x6ea0, 0x6f1a, 0x6f94, 0x700f, 0x7089, 0x7103, 0x717d, 0x71f7, 0x7271, 0x72eb, 0x7365, 0x73df, 0x7459, 0x74d3, 0x754d, 0x75c7, 0x7641, 0x76bc, 0x7736, 0x77b0, 0x782a, 0x78a4, 0x791e, 0x7998 }; long tstouslo[128] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79 }; ntp-4.2.6p5/libntp/msyslog.c0000644000175000017500000001066211636775106014763 0ustar peterpeter/* * msyslog - either send a message to the terminal or print it on * the standard output. * * Converted to use varargs, much better ... jks */ #ifdef HAVE_CONFIG_H # include #endif #include #ifdef HAVE_UNISTD_H # include #endif #include #include "ntp.h" #include "ntp_string.h" #include "ntp_syslog.h" #ifdef SYS_WINNT # include # include "..\ports\winnt\libntp\messages.h" #endif int syslogit = 1; int msyslog_term = FALSE; /* duplicate to stdout/err */ FILE * syslog_file; u_int32 ntp_syslogmask = ~(u_int32)0; /* libntp default is all lit */ extern char * progname; /* Declare the local functions */ void addto_syslog (int, const char *); void format_errmsg (char *, size_t, const char *, int); /* * This routine adds the contents of a buffer to the syslog or an * application-specific logfile. */ void addto_syslog( int level, const char * msg ) { static char * prevcall_progname; static char * prog; const char nl[] = "\n"; const char empty[] = ""; FILE * term_file; int log_to_term; int log_to_file; const char * nl_or_empty; const char * human_time; /* setup program basename static var prog if needed */ if (progname != prevcall_progname) { prevcall_progname = progname; prog = strrchr(progname, DIR_SEP); if (prog != NULL) prog++; else prog = progname; } log_to_term = msyslog_term; log_to_file = FALSE; #if !defined(VMS) && !defined(SYS_VXWORKS) if (syslogit) syslog(level, "%s", msg); else #endif if (syslog_file != NULL) log_to_file = TRUE; else log_to_term = TRUE; #if DEBUG if (debug > 0) log_to_term = TRUE; #endif if (!(log_to_file || log_to_term)) return; /* syslog() adds the timestamp, name, and pid */ human_time = humanlogtime(); /* syslog() adds trailing \n if not present */ if ('\n' != msg[strlen(msg) - 1]) nl_or_empty = nl; else nl_or_empty = empty; if (log_to_term) { term_file = (level <= LOG_ERR) ? stderr : stdout; fprintf(term_file, "%s %s[%d]: %s%s", human_time, prog, (int)getpid(), msg, nl_or_empty); fflush(term_file); } if (log_to_file) { fprintf(syslog_file, "%s %s[%d]: %s%s", human_time, prog, (int)getpid(), msg, nl_or_empty); fflush(syslog_file); } } void format_errmsg( char * nfmt, size_t lennfmt, const char * fmt, int errval ) { char c; char *n; const char *f; size_t len; char *err; n = nfmt; f = fmt; while ((c = *f++) != '\0' && n < (nfmt + lennfmt - 1)) { if (c != '%') { *n++ = c; continue; } if ((c = *f++) != 'm') { *n++ = '%'; if ('\0' == c) break; *n++ = c; continue; } err = strerror(errval); len = strlen(err); /* Make sure we have enough space for the error message */ if ((n + len) < (nfmt + lennfmt - 1)) { memcpy(n, err, len); n += len; } } *n = '\0'; } int mvsnprintf( char * buf, size_t bufsiz, const char * fmt, va_list ap ) { #ifndef VSNPRINTF_PERCENT_M char nfmt[256]; #else const char * nfmt = fmt; #endif int errval; /* * Save the error value as soon as possible */ #ifdef SYS_WINNT errval = GetLastError(); if (NO_ERROR == errval) #endif /* SYS_WINNT */ errval = errno; #ifndef VSNPRINTF_PERCENT_M format_errmsg(nfmt, sizeof(nfmt), fmt, errval); #else errno = errval; #endif return vsnprintf(buf, bufsiz, nfmt, ap); } int mvfprintf( FILE * fp, const char * fmt, va_list ap ) { #ifndef VSNPRINTF_PERCENT_M char nfmt[256]; #else const char * nfmt = fmt; #endif int errval; /* * Save the error value as soon as possible */ #ifdef SYS_WINNT errval = GetLastError(); if (NO_ERROR == errval) #endif /* SYS_WINNT */ errval = errno; #ifndef VSNPRINTF_PERCENT_M format_errmsg(nfmt, sizeof(nfmt), fmt, errval); #else errno = errval; #endif return vfprintf(fp, nfmt, ap); } int mfprintf( FILE * fp, const char * fmt, ... ) { va_list ap; int rc; va_start(ap, fmt); rc = mvfprintf(fp, fmt, ap); va_end(ap); return rc; } int mprintf( const char * fmt, ... ) { va_list ap; int rc; va_start(ap, fmt); rc = mvfprintf(stdout, fmt, ap); va_end(ap); return rc; } int msnprintf( char * buf, size_t bufsiz, const char * fmt, ... ) { va_list ap; size_t rc; va_start(ap, fmt); rc = mvsnprintf(buf, bufsiz, fmt, ap); va_end(ap); return rc; } void msyslog( int level, const char * fmt, ... ) { char buf[1024]; va_list ap; va_start(ap, fmt); mvsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); addto_syslog(level, buf); } ntp-4.2.6p5/libntp/mktime.c0000644000175000017500000002031011616416170014532 0ustar peterpeter/* * Copyright (c) 1987, 1989 Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * Arthur David Olson of the National Cancer Institute. * * 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ /*static char *sccsid = "from: @(#)ctime.c 5.26 (Berkeley) 2/23/91";*/ /* * This implementation of mktime is lifted straight from the NetBSD (BSD 4.4) * version. I modified it slightly to divorce it from the internals of the * ctime library. Thus this version can't use details of the internal * timezone state file to figure out strange unnormalized struct tm values, * as might result from someone doing date math on the tm struct then passing * it to mktime. * * It just does as well as it can at normalizing the tm input, then does a * binary search of the time space using the system's localtime() function. * * The original binary search was defective in that it didn't consider the * setting of tm_isdst when comparing tm values, causing the search to be * flubbed for times near the dst/standard time changeover. The original * code seems to make up for this by grubbing through the timezone info * whenever the binary search barfed. Since I don't have that luxury in * portable code, I have to take care of tm_isdst in the comparison routine. * This requires knowing how many minutes offset dst is from standard time. * * So, if you live somewhere in the world where dst is not 60 minutes offset, * and your vendor doesn't supply mktime(), you'll have to edit this variable * by hand. Sorry about that. */ #include "ntp_machine.h" #if !defined(HAVE_MKTIME) || !defined(HAVE_TIMEGM) #if SIZEOF_TIME_T >= 8 #error libntp supplied mktime()/timegm() do not support 64-bit time_t #endif #ifndef DSTMINUTES #define DSTMINUTES 60 #endif #define FALSE 0 #define TRUE 1 /* some constants from tzfile.h */ #define SECSPERMIN 60 #define MINSPERHOUR 60 #define HOURSPERDAY 24 #define DAYSPERWEEK 7 #define DAYSPERNYEAR 365 #define DAYSPERLYEAR 366 #define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) #define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY) #define MONSPERYEAR 12 #define TM_YEAR_BASE 1900 #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) static int mon_lengths[2][MONSPERYEAR] = { { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } }; static int year_lengths[2] = { DAYSPERNYEAR, DAYSPERLYEAR }; /* ** Adapted from code provided by Robert Elz, who writes: ** The "best" way to do mktime I think is based on an idea of Bob ** Kridle's (so its said...) from a long time ago. (mtxinu!kridle now). ** It does a binary search of the time_t space. Since time_t's are ** just 32 bits, its a max of 32 iterations (even at 64 bits it ** would still be very reasonable). */ #ifndef WRONG #define WRONG (-1) #endif /* !defined WRONG */ static void normalize( int * tensptr, int * unitsptr, int base ) { if (*unitsptr >= base) { *tensptr += *unitsptr / base; *unitsptr %= base; } else if (*unitsptr < 0) { --*tensptr; *unitsptr += base; if (*unitsptr < 0) { *tensptr -= 1 + (-*unitsptr) / base; *unitsptr = base - (-*unitsptr) % base; } } } static struct tm * mkdst( struct tm * tmp ) { /* jds */ static struct tm tmbuf; tmbuf = *tmp; tmbuf.tm_isdst = 1; tmbuf.tm_min += DSTMINUTES; normalize(&tmbuf.tm_hour, &tmbuf.tm_min, MINSPERHOUR); return &tmbuf; } static int tmcomp( register struct tm * atmp, register struct tm * btmp ) { register int result; /* compare down to the same day */ if ((result = (atmp->tm_year - btmp->tm_year)) == 0 && (result = (atmp->tm_mon - btmp->tm_mon)) == 0) result = (atmp->tm_mday - btmp->tm_mday); if(result != 0) return result; /* get rid of one-sided dst bias */ if(atmp->tm_isdst == 1 && !btmp->tm_isdst) btmp = mkdst(btmp); else if(btmp->tm_isdst == 1 && !atmp->tm_isdst) atmp = mkdst(atmp); /* compare the rest of the way */ if ((result = (atmp->tm_hour - btmp->tm_hour)) == 0 && (result = (atmp->tm_min - btmp->tm_min)) == 0) result = atmp->tm_sec - btmp->tm_sec; return result; } static time_t time2( struct tm * tmp, int * okayp, int usezn ) { register int dir; register int bits; register int i; register int saved_seconds; time_t t; struct tm yourtm, mytm; *okayp = FALSE; yourtm = *tmp; if (yourtm.tm_sec >= SECSPERMIN + 2 || yourtm.tm_sec < 0) normalize(&yourtm.tm_min, &yourtm.tm_sec, SECSPERMIN); normalize(&yourtm.tm_hour, &yourtm.tm_min, MINSPERHOUR); normalize(&yourtm.tm_mday, &yourtm.tm_hour, HOURSPERDAY); normalize(&yourtm.tm_year, &yourtm.tm_mon, MONSPERYEAR); while (yourtm.tm_mday <= 0) { --yourtm.tm_year; yourtm.tm_mday += year_lengths[isleap(yourtm.tm_year + TM_YEAR_BASE)]; } for ( ; ; ) { i = mon_lengths[isleap(yourtm.tm_year + TM_YEAR_BASE)][yourtm.tm_mon]; if (yourtm.tm_mday <= i) break; yourtm.tm_mday -= i; if (++yourtm.tm_mon >= MONSPERYEAR) { yourtm.tm_mon = 0; ++yourtm.tm_year; } } saved_seconds = yourtm.tm_sec; yourtm.tm_sec = 0; /* ** Calculate the number of magnitude bits in a time_t ** (this works regardless of whether time_t is ** signed or unsigned, though lint complains if unsigned). */ for (bits = 0, t = 1; t > 0; ++bits, t <<= 1) ; /* ** If time_t is signed, then 0 is the median value, ** if time_t is unsigned, then 1 << bits is median. */ t = (t < 0) ? 0 : ((time_t) 1 << bits); for ( ; ; ) { if (usezn) mytm = *localtime(&t); else mytm = *gmtime(&t); dir = tmcomp(&mytm, &yourtm); if (dir != 0) { if (bits-- < 0) return WRONG; if (bits < 0) --t; else if (dir > 0) t -= (time_t) 1 << bits; else t += (time_t) 1 << bits; continue; } if (yourtm.tm_isdst < 0 || mytm.tm_isdst == yourtm.tm_isdst) break; return WRONG; } t += saved_seconds; if (usezn) *tmp = *localtime(&t); else *tmp = *gmtime(&t); *okayp = TRUE; return t; } #else int mktime_bs; #endif /* !HAVE_MKTIME || !HAVE_TIMEGM */ #ifndef HAVE_MKTIME static time_t time1( struct tm * tmp ) { register time_t t; int okay; if (tmp->tm_isdst > 1) tmp->tm_isdst = 1; t = time2(tmp, &okay, 1); if (okay || tmp->tm_isdst < 0) return t; return WRONG; } time_t mktime( struct tm * tmp ) { return time1(tmp); } #endif /* !HAVE_MKTIME */ #ifndef HAVE_TIMEGM time_t timegm( struct tm * tmp ) { register time_t t; int okay; tmp->tm_isdst = 0; t = time2(tmp, &okay, 0); if (okay || tmp->tm_isdst < 0) return t; return WRONG; } #endif /* !HAVE_TIMEGM */ ntp-4.2.6p5/libntp/ssl_init.c0000644000175000017500000000655311505336022015077 0ustar peterpeter/* * ssl_init.c Common OpenSSL initialization code for the various * programs which use it. * * Moved from ntpd/ntp_crypto.c crypto_setup() */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #ifdef OPENSSL #include "openssl/err.h" #include "openssl/evp.h" int ssl_init_done; void ssl_init(void) { if (ssl_init_done) return; ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); ssl_init_done = 1; } void ssl_check_version(void) { if ((SSLeay() ^ OPENSSL_VERSION_NUMBER) & ~0xff0L) { msyslog(LOG_WARNING, "OpenSSL version mismatch. Built against %lx, you have %lx", OPENSSL_VERSION_NUMBER, SSLeay()); fprintf(stderr, "OpenSSL version mismatch. Built against %lx, you have %lx\n", OPENSSL_VERSION_NUMBER, SSLeay()); } INIT_SSL(); } #endif /* OPENSSL */ /* * keytype_from_text returns OpenSSL NID for digest by name, and * optionally the associated digest length. * * Used by ntpd authreadkeys(), ntpq and ntpdc keytype() */ int keytype_from_text( const char *text, size_t *pdigest_len ) { const u_long max_digest_len = MAX_MAC_LEN - sizeof(keyid_t); int key_type; u_int digest_len; #ifdef OPENSSL u_char digest[EVP_MAX_MD_SIZE]; char * upcased; char * pch; EVP_MD_CTX ctx; /* * OpenSSL digest short names are capitalized, so uppercase the * digest name before passing to OBJ_sn2nid(). If it is not * recognized but begins with 'M' use NID_md5 to be consistent * with past behavior. */ INIT_SSL(); LIB_GETBUF(upcased); strncpy(upcased, text, LIB_BUFLENGTH); for (pch = upcased; '\0' != *pch; pch++) *pch = (char)toupper(*pch); key_type = OBJ_sn2nid(upcased); #else key_type = 0; #endif if (!key_type && 'm' == tolower(text[0])) key_type = NID_md5; if (!key_type) return 0; if (NULL != pdigest_len) { #ifdef OPENSSL EVP_DigestInit(&ctx, EVP_get_digestbynid(key_type)); EVP_DigestFinal(&ctx, digest, &digest_len); if (digest_len + sizeof(keyid_t) > MAX_MAC_LEN) { fprintf(stderr, "key type %s %u octet digests are too big, max %lu\n", keytype_name(key_type), digest_len, max_digest_len); msyslog(LOG_ERR, "key type %s %u octet digests are too big, max %lu\n", keytype_name(key_type), digest_len, max_digest_len); return 0; } #else digest_len = 16; #endif *pdigest_len = digest_len; } return key_type; } /* * keytype_name returns OpenSSL short name for digest by NID. * * Used by ntpq and ntpdc keytype() */ const char * keytype_name( int nid ) { static const char unknown_type[] = "(unknown key type)"; const char *name; #ifdef OPENSSL INIT_SSL(); name = OBJ_nid2sn(nid); if (NULL == name) name = unknown_type; #else /* !OPENSSL follows */ if (NID_md5 == nid) name = "MD5"; else name = unknown_type; #endif return name; } /* * Use getpassphrase() if configure.ac detected it, as Suns that * have it truncate the password in getpass() to 8 characters. */ #ifdef HAVE_GETPASSPHRASE # define getpass(str) getpassphrase(str) #endif /* * getpass_keytype() -- shared between ntpq and ntpdc, only vaguely * related to the rest of ssl_init.c. */ char * getpass_keytype( int keytype ) { char pass_prompt[64 + 11 + 1]; /* 11 for " Password: " */ snprintf(pass_prompt, sizeof(pass_prompt), "%.64s Password: ", keytype_name(keytype)); return getpass(pass_prompt); } ntp-4.2.6p5/libntp/atoint.c0000644000175000017500000000140310017034553014537 0ustar peterpeter/* * atoint - convert an ascii string to a signed long, with error checking */ #include #include #include "ntp_types.h" #include "ntp_stdlib.h" int atoint( const char *str, long *ival ) { register long u; register const char *cp; register int isneg; register int oflow_digit; cp = str; if (*cp == '-') { cp++; isneg = 1; oflow_digit = '8'; } else { isneg = 0; oflow_digit = '7'; } if (*cp == '\0') return 0; u = 0; while (*cp != '\0') { if (!isdigit((int)*cp)) return 0; if (u > 214748364 || (u == 214748364 && *cp > oflow_digit)) return 0; /* overflow */ u = (u << 3) + (u << 1); u += *cp++ - '0'; /* ascii dependent */ } if (isneg) *ival = -u; else *ival = u; return 1; } ntp-4.2.6p5/libntp/decodenetnum.c0000644000175000017500000000336211616416167015734 0ustar peterpeter/* * decodenetnum - return a net number (this is crude, but careful) */ #include #include #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #include "ntp.h" #include "ntp_stdlib.h" #include "ntp_assert.h" /* * decodenetnum convert text IP address and port to sockaddr_u * * Returns 0 for failure, 1 for success. */ int decodenetnum( const char *num, sockaddr_u *netnum ) { struct addrinfo hints, *ai = NULL; int err; u_short port; const char *cp; const char *port_str; char *pp; char *np; char name[80]; NTP_REQUIRE(num != NULL); NTP_REQUIRE(strlen(num) < sizeof(name)); port_str = NULL; if ('[' != num[0]) { /* * to distinguish IPv6 embedded colons from a port * specification on an IPv4 address, assume all * legal IPv6 addresses have at least two colons. */ pp = strchr(num, ':'); if (NULL == pp) cp = num; /* no colons */ else if (NULL != strchr(pp + 1, ':')) cp = num; /* two or more colons */ else { /* one colon */ strncpy(name, num, sizeof(name)); name[sizeof(name) - 1] = '\0'; cp = name; pp = strchr(cp, ':'); *pp = '\0'; port_str = pp + 1; } } else { cp = num + 1; np = name; while (*cp && ']' != *cp) *np++ = *cp++; *np = 0; if (']' == cp[0] && ':' == cp[1] && '\0' != cp[2]) port_str = &cp[2]; cp = name; } ZERO(hints); hints.ai_flags = Z_AI_NUMERICHOST; err = getaddrinfo(cp, "ntp", &hints, &ai); if (err != 0) return 0; NTP_INSIST(ai->ai_addrlen <= sizeof(*netnum)); memcpy(netnum, ai->ai_addr, ai->ai_addrlen); freeaddrinfo(ai); if (NULL == port_str || 1 != sscanf(port_str, "%hu", &port)) port = NTP_PORT; SET_PORT(netnum, port); return 1; } ntp-4.2.6p5/libntp/ntp_rfc2553.c0000644000175000017500000002702411307651605015230 0ustar peterpeter/* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * 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. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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. */ /* * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. * */ /* * Compatability shims with the rfc2553 API to simplify ntp. */ #include #include #include #ifdef HAVE_SYS_SOCKET_H #include #endif #include #ifdef HAVE_NETINET_IN_H #include #endif #include "ntp_rfc2553.h" #include "ntpd.h" #include "ntp_malloc.h" #include "ntp_stdlib.h" #include "ntp_string.h" #ifndef ISC_PLATFORM_HAVEIPV6 static char *ai_errlist[] = { "Success", "Address family for hostname not supported", /* EAI_ADDRFAMILY */ "Temporary failure in name resolution", /* EAI_AGAIN */ "Invalid value for ai_flags", /* EAI_BADFLAGS */ "Non-recoverable failure in name resolution", /* EAI_FAIL */ "ai_family not supported", /* EAI_FAMILY */ "Memory allocation failure", /* EAI_MEMORY */ "No address associated with hostname", /* EAI_NODATA */ "hostname nor servname provided, or not known", /* EAI_NONAME */ "servname not supported for ai_socktype", /* EAI_SERVICE */ "ai_socktype not supported", /* EAI_SOCKTYPE */ "System error returned in errno", /* EAI_SYSTEM */ "Invalid value for hints", /* EAI_BADHINTS */ "Resolved protocol is unknown", /* EAI_PROTOCOL */ "Unknown error", /* EAI_MAX */ }; /* * Local declaration */ int DNSlookup_name( const char *name, int ai_family, struct hostent **Addresses ); #ifndef SYS_WINNT /* * Encapsulate gethostbyname to control the error code */ int DNSlookup_name( const char *name, int ai_family, struct hostent **Addresses ) { *Addresses = gethostbyname(name); return (h_errno); } #endif static int do_nodename (const char *nodename, struct addrinfo *ai, const struct addrinfo *hints); int getaddrinfo (const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res) { int rval; struct servent *sp; struct addrinfo *ai = NULL; int port; const char *proto = NULL; int family, socktype, flags, protocol; /* * If no name is provide just return an error */ if (nodename == NULL && servname == NULL) return (EAI_NONAME); ai = calloc(sizeof(struct addrinfo), 1); if (ai == NULL) return (EAI_MEMORY); /* * Copy default values from hints, if available */ if (hints != NULL) { ai->ai_flags = hints->ai_flags; ai->ai_family = hints->ai_family; ai->ai_socktype = hints->ai_socktype; ai->ai_protocol = hints->ai_protocol; family = hints->ai_family; socktype = hints->ai_socktype; protocol = hints->ai_protocol; flags = hints->ai_flags; switch (family) { case AF_UNSPEC: switch (hints->ai_socktype) { case SOCK_STREAM: proto = "tcp"; break; case SOCK_DGRAM: proto = "udp"; break; } break; case AF_INET: case AF_INET6: switch (hints->ai_socktype) { case 0: break; case SOCK_STREAM: proto = "tcp"; break; case SOCK_DGRAM: proto = "udp"; break; case SOCK_RAW: break; default: return (EAI_SOCKTYPE); } break; #ifdef AF_LOCAL case AF_LOCAL: switch (hints->ai_socktype) { case 0: break; case SOCK_STREAM: break; case SOCK_DGRAM: break; default: return (EAI_SOCKTYPE); } break; #endif default: return (EAI_FAMILY); } } else { protocol = 0; family = 0; socktype = 0; flags = 0; } rval = do_nodename(nodename, ai, hints); if (rval != 0) { freeaddrinfo(ai); return (rval); } /* * First, look up the service name (port) if it was * requested. If the socket type wasn't specified, then * try and figure it out. */ if (servname != NULL) { char *e; port = strtol(servname, &e, 10); if (*e == '\0') { if (socktype == 0) return (EAI_SOCKTYPE); if (port < 0 || port > 65535) return (EAI_SERVICE); port = htons((unsigned short) port); } else { sp = getservbyname(servname, proto); if (sp == NULL) return (EAI_SERVICE); port = sp->s_port; if (socktype == 0) { if (strcmp(sp->s_proto, "tcp") == 0) socktype = SOCK_STREAM; else if (strcmp(sp->s_proto, "udp") == 0) socktype = SOCK_DGRAM; } } } else port = 0; /* * * Set up the port number */ if (ai->ai_family == AF_INET) ((struct sockaddr_in *)ai->ai_addr)->sin_port = (unsigned short) port; else if (ai->ai_family == AF_INET6) ((struct sockaddr_in6 *)ai->ai_addr)->sin6_port = (unsigned short) port; *res = ai; return (0); } void freeaddrinfo(struct addrinfo *ai) { if (ai->ai_canonname != NULL) { free(ai->ai_canonname); ai->ai_canonname = NULL; } if (ai->ai_addr != NULL) { free(ai->ai_addr); ai->ai_addr = NULL; } free(ai); ai = NULL; } int getnameinfo (const struct sockaddr *sa, u_int salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags) { struct hostent *hp; int namelen; if (sa->sa_family != AF_INET) return (EAI_FAMILY); hp = gethostbyaddr( (const char *)&((const struct sockaddr_in *)sa)->sin_addr, 4, AF_INET); if (hp == NULL) { if (h_errno == TRY_AGAIN) return (EAI_AGAIN); else return (EAI_FAIL); } if (host != NULL && hostlen > 0) { /* * Don't exceed buffer */ namelen = min(strlen(hp->h_name), hostlen - 1); if (namelen > 0) { strncpy(host, hp->h_name, namelen); host[namelen] = '\0'; } } return (0); } char * gai_strerror(int ecode) { if (ecode < 0 || ecode > EAI_MAX) ecode = EAI_MAX; return ai_errlist[ecode]; } static int do_nodename( const char *nodename, struct addrinfo *ai, const struct addrinfo *hints) { struct hostent *hp = NULL; struct sockaddr_in *sockin; struct sockaddr_in6 *sockin6; int errval; ai->ai_addr = calloc(sizeof(struct sockaddr_storage), 1); if (ai->ai_addr == NULL) return (EAI_MEMORY); /* * For an empty node name just use the wildcard. * NOTE: We need to assume that the address family is * set elsewhere so that we can set the appropriate wildcard */ if (nodename == NULL) { ai->ai_addrlen = sizeof(struct sockaddr_storage); if (ai->ai_family == AF_INET) { sockin = (struct sockaddr_in *)ai->ai_addr; sockin->sin_family = (short) ai->ai_family; sockin->sin_addr.s_addr = htonl(INADDR_ANY); } else { sockin6 = (struct sockaddr_in6 *)ai->ai_addr; sockin6->sin6_family = (short) ai->ai_family; /* * we have already zeroed out the address * so we don't actually need to do this * This assignment is causing problems so * we don't do what this would do. sockin6->sin6_addr = in6addr_any; */ } #ifdef ISC_PLATFORM_HAVESALEN ai->ai_addr->sa_len = SOCKLEN(ai->ai_addr); #endif return (0); } /* * See if we have an IPv6 address */ if(strchr(nodename, ':') != NULL) { if (inet_pton(AF_INET6, nodename, &((struct sockaddr_in6 *)ai->ai_addr)->sin6_addr) == 1) { ((struct sockaddr_in6 *)ai->ai_addr)->sin6_family = AF_INET6; ai->ai_family = AF_INET6; ai->ai_addrlen = sizeof(struct sockaddr_in6); return (0); } } /* * See if we have an IPv4 address */ if (inet_pton(AF_INET, nodename, &((struct sockaddr_in *)ai->ai_addr)->sin_addr) == 1) { ((struct sockaddr *)ai->ai_addr)->sa_family = AF_INET; ai->ai_family = AF_INET; ai->ai_addrlen = sizeof(struct sockaddr_in); return (0); } /* * If the numeric host flag is set, don't attempt resolution */ if (hints != NULL && (hints->ai_flags & AI_NUMERICHOST)) return (EAI_NONAME); /* * Look for a name */ errval = DNSlookup_name(nodename, AF_INET, &hp); if (hp == NULL) { if (errval == TRY_AGAIN || errval == EAI_AGAIN) return (EAI_AGAIN); else if (errval == EAI_NONAME) { if (inet_pton(AF_INET, nodename, &((struct sockaddr_in *)ai->ai_addr)->sin_addr) == 1) { ((struct sockaddr *)ai->ai_addr)->sa_family = AF_INET; ai->ai_family = AF_INET; ai->ai_addrlen = sizeof(struct sockaddr_in); return (0); } return (errval); } else { return (errval); } } ai->ai_family = hp->h_addrtype; ai->ai_addrlen = sizeof(struct sockaddr); sockin = (struct sockaddr_in *)ai->ai_addr; memcpy(&sockin->sin_addr, hp->h_addr, hp->h_length); ai->ai_addr->sa_family = hp->h_addrtype; #ifdef ISC_PLATFORM_HAVESALEN ai->ai_addr->sa_len = sizeof(struct sockaddr); #endif if (hints != NULL && hints->ai_flags & AI_CANONNAME) ai->ai_canonname = estrdup(hp->h_name); return (0); } #endif /* !ISC_PLATFORM_HAVEIPV6 */ ntp-4.2.6p5/libntp/Makefile.in0000644000175000017500000023657311675460276015204 0ustar peterpeter# 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@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depsver.mf subdir = libntp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/define_dir.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_cacheversion.m4 \ $(top_srcdir)/m4/ntp_dir_sep.m4 \ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \ $(top_srcdir)/m4/ntp_openssl.m4 \ $(top_srcdir)/m4/ntp_vpathhack.m4 \ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libntp_a_AR = $(AR) $(ARFLAGS) libntp_a_LIBADD = am__objects_1 = am__objects_2 = a_md5encrypt.$(OBJEXT) adjtime.$(OBJEXT) \ atoint.$(OBJEXT) atolfp.$(OBJEXT) atouint.$(OBJEXT) \ audio.$(OBJEXT) authkeys.$(OBJEXT) authreadkeys.$(OBJEXT) \ authusekey.$(OBJEXT) bsd_strerror.$(OBJEXT) \ buftvtots.$(OBJEXT) caljulian.$(OBJEXT) caltontp.$(OBJEXT) \ calyearstart.$(OBJEXT) clocktime.$(OBJEXT) \ clocktypes.$(OBJEXT) decodenetnum.$(OBJEXT) dofptoa.$(OBJEXT) \ dolfptoa.$(OBJEXT) emalloc.$(OBJEXT) findconfig.$(OBJEXT) \ fptoa.$(OBJEXT) fptoms.$(OBJEXT) getopt.$(OBJEXT) \ hextoint.$(OBJEXT) hextolfp.$(OBJEXT) humandate.$(OBJEXT) \ icom.$(OBJEXT) inttoa.$(OBJEXT) iosignal.$(OBJEXT) \ lib_strbuf.$(OBJEXT) machines.$(OBJEXT) memmove.$(OBJEXT) \ mfptoa.$(OBJEXT) ntp_lineedit.$(OBJEXT) mfptoms.$(OBJEXT) \ mktime.$(OBJEXT) modetoa.$(OBJEXT) mstolfp.$(OBJEXT) \ msutotsf.$(OBJEXT) msyslog.$(OBJEXT) netof.$(OBJEXT) \ ntp_libopts.$(OBJEXT) ntp_rfc2553.$(OBJEXT) numtoa.$(OBJEXT) \ numtohost.$(OBJEXT) octtoint.$(OBJEXT) prettydate.$(OBJEXT) \ ntp_random.$(OBJEXT) recvbuff.$(OBJEXT) refnumtoa.$(OBJEXT) \ snprintf.$(OBJEXT) socktoa.$(OBJEXT) socktohost.$(OBJEXT) \ ssl_init.$(OBJEXT) statestr.$(OBJEXT) strdup.$(OBJEXT) \ strstr.$(OBJEXT) syssignal.$(OBJEXT) tsftomsu.$(OBJEXT) \ tstotv.$(OBJEXT) tvtots.$(OBJEXT) uglydate.$(OBJEXT) \ uinttoa.$(OBJEXT) ymd2yd.$(OBJEXT) assertions.$(OBJEXT) \ buffer.$(OBJEXT) condition.$(OBJEXT) dir.$(OBJEXT) \ error.$(OBJEXT) errno2result.$(OBJEXT) event.$(OBJEXT) \ file.$(OBJEXT) inet_ntop.$(OBJEXT) inet_pton.$(OBJEXT) \ interfaceiter.$(OBJEXT) lib.$(OBJEXT) log.$(OBJEXT) \ md5.$(OBJEXT) msgcat.$(OBJEXT) net.$(OBJEXT) netaddr.$(OBJEXT) \ netscope.$(OBJEXT) ondestroy.$(OBJEXT) random.$(OBJEXT) \ result.$(OBJEXT) stdio.$(OBJEXT) stdtime.$(OBJEXT) \ strerror.$(OBJEXT) task.$(OBJEXT) thread.$(OBJEXT) \ time.$(OBJEXT) sockaddr.$(OBJEXT) $(am__objects_1) am_libntp_a_OBJECTS = systime.$(OBJEXT) $(am__objects_2) libntp_a_OBJECTS = $(am_libntp_a_OBJECTS) libntpsim_a_AR = $(AR) $(ARFLAGS) libntpsim_a_LIBADD = am_libntpsim_a_OBJECTS = systime_s.$(OBJEXT) $(am__objects_2) libntpsim_a_OBJECTS = $(am_libntpsim_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libntp_a_SOURCES) $(EXTRA_libntp_a_SOURCES) \ $(libntpsim_a_SOURCES) DIST_SOURCES = $(libntp_a_SOURCES) $(EXTRA_libntp_a_SOURCES) \ $(libntpsim_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ 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@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SH = @PATH_SH@ PATH_TEST = @PATH_TEST@ POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CFLAGS = @SNMP_CFLAGS@ SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ SNMP_LIBS = @SNMP_LIBS@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ VERSION = @VERSION@ 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_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 = #AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies AUTOMAKE_OPTIONS = BUILT_SOURCES = .deps-ver CLEANFILES = .deps-ver noinst_LIBRARIES = libntp.a @MAKE_LIBNTPSIM@ EXTRA_LIBRARIES = libntpsim.a libntp_a_SRCS = \ a_md5encrypt.c \ adjtime.c \ atoint.c \ atolfp.c \ atouint.c \ audio.c \ authkeys.c \ authreadkeys.c \ authusekey.c \ bsd_strerror.c \ buftvtots.c \ caljulian.c \ caltontp.c \ calyearstart.c \ clocktime.c \ clocktypes.c \ decodenetnum.c \ dofptoa.c \ dolfptoa.c \ emalloc.c \ findconfig.c \ fptoa.c \ fptoms.c \ getopt.c \ hextoint.c \ hextolfp.c \ humandate.c \ icom.c \ inttoa.c \ iosignal.c \ lib_strbuf.c \ machines.c \ memmove.c \ mfptoa.c \ ntp_lineedit.c \ mfptoms.c \ mktime.c \ modetoa.c \ mstolfp.c \ msutotsf.c \ msyslog.c \ netof.c \ ntp_libopts.c \ ntp_rfc2553.c \ numtoa.c \ numtohost.c \ octtoint.c \ prettydate.c \ ntp_random.c \ recvbuff.c \ refnumtoa.c \ snprintf.c \ socktoa.c \ socktohost.c \ ssl_init.c \ statestr.c \ strdup.c \ strstr.c \ syssignal.c \ tsftomsu.c \ tstotv.c \ tvtots.c \ uglydate.c \ uinttoa.c \ ymd2yd.c \ $(srcdir)/../lib/isc/assertions.c \ $(srcdir)/../lib/isc/buffer.c \ $(srcdir)/../lib/isc/nothreads/condition.c \ $(srcdir)/../lib/isc/unix/dir.c \ $(srcdir)/../lib/isc/error.c \ $(srcdir)/../lib/isc/unix/errno2result.c \ $(srcdir)/../lib/isc/event.c \ $(srcdir)/../lib/isc/unix/file.c \ $(srcdir)/../lib/isc/inet_ntop.c \ $(srcdir)/../lib/isc/inet_pton.c \ $(srcdir)/../lib/isc/unix/interfaceiter.c \ $(srcdir)/../lib/isc/lib.c \ $(srcdir)/../lib/isc/log.c \ $(srcdir)/../lib/isc/md5.c \ $(srcdir)/../lib/isc/nls/msgcat.c \ $(srcdir)/../lib/isc/unix/net.c \ $(srcdir)/../lib/isc/netaddr.c \ $(srcdir)/../lib/isc/netscope.c \ $(srcdir)/../lib/isc/ondestroy.c \ $(srcdir)/../lib/isc/random.c \ $(srcdir)/../lib/isc/result.c \ $(srcdir)/../lib/isc/unix/stdio.c \ $(srcdir)/../lib/isc/unix/stdtime.c \ $(srcdir)/../lib/isc/unix/strerror.c \ $(srcdir)/../lib/isc/task.c \ $(srcdir)/../lib/isc/nothreads/thread.c \ $(srcdir)/../lib/isc/unix/time.c \ $(srcdir)/../lib/isc/sockaddr.c \ $(NULL) libntp_a_SOURCES = systime.c $(libntp_a_SRCS) libntpsim_a_SOURCES = systime_s.c $(libntp_a_SRCS) EXTRA_libntp_a_SOURCES = adjtimex.c ETAGS_ARGS = Makefile.am INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include $(LIBOPTS_CFLAGS) EXTRA_DIST = README all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(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 libntp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libntp/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): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libntp.a: $(libntp_a_OBJECTS) $(libntp_a_DEPENDENCIES) -rm -f libntp.a $(libntp_a_AR) libntp.a $(libntp_a_OBJECTS) $(libntp_a_LIBADD) $(RANLIB) libntp.a libntpsim.a: $(libntpsim_a_OBJECTS) $(libntpsim_a_DEPENDENCIES) -rm -f libntpsim.a $(libntpsim_a_AR) libntpsim.a $(libntpsim_a_OBJECTS) $(libntpsim_a_LIBADD) $(RANLIB) libntpsim.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_md5encrypt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assertions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atoint.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atolfp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atouint.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authkeys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authreadkeys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authusekey.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_strerror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buftvtots.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caljulian.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caltontp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calyearstart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clocktime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clocktypes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/condition.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decodenetnum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dofptoa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dolfptoa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emalloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errno2result.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findconfig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fptoa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fptoms.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hextoint.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hextolfp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/humandate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_pton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interfaceiter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inttoa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iosignal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_strbuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/machines.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memmove.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mfptoa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mfptoms.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modetoa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msgcat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mstolfp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msutotsf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msyslog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netaddr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netof.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netscope.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_libopts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_lineedit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_random.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_rfc2553.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numtoa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numtohost.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/octtoint.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ondestroy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prettydate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvbuff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refnumtoa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/result.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socktoa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socktohost.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_init.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statestr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdtime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strstr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syssignal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systime_s.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/task.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsftomsu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tstotv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvtots.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uglydate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uinttoa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ymd2yd.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< assertions.o: $(srcdir)/../lib/isc/assertions.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT assertions.o -MD -MP -MF $(DEPDIR)/assertions.Tpo -c -o assertions.o `test -f '$(srcdir)/../lib/isc/assertions.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/assertions.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/assertions.Tpo $(DEPDIR)/assertions.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/assertions.c' object='assertions.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o assertions.o `test -f '$(srcdir)/../lib/isc/assertions.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/assertions.c assertions.obj: $(srcdir)/../lib/isc/assertions.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT assertions.obj -MD -MP -MF $(DEPDIR)/assertions.Tpo -c -o assertions.obj `if test -f '$(srcdir)/../lib/isc/assertions.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/assertions.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/assertions.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/assertions.Tpo $(DEPDIR)/assertions.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/assertions.c' object='assertions.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o assertions.obj `if test -f '$(srcdir)/../lib/isc/assertions.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/assertions.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/assertions.c'; fi` buffer.o: $(srcdir)/../lib/isc/buffer.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buffer.o -MD -MP -MF $(DEPDIR)/buffer.Tpo -c -o buffer.o `test -f '$(srcdir)/../lib/isc/buffer.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/buffer.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/buffer.Tpo $(DEPDIR)/buffer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/buffer.c' object='buffer.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o buffer.o `test -f '$(srcdir)/../lib/isc/buffer.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/buffer.c buffer.obj: $(srcdir)/../lib/isc/buffer.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buffer.obj -MD -MP -MF $(DEPDIR)/buffer.Tpo -c -o buffer.obj `if test -f '$(srcdir)/../lib/isc/buffer.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/buffer.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/buffer.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/buffer.Tpo $(DEPDIR)/buffer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/buffer.c' object='buffer.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o buffer.obj `if test -f '$(srcdir)/../lib/isc/buffer.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/buffer.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/buffer.c'; fi` condition.o: $(srcdir)/../lib/isc/nothreads/condition.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT condition.o -MD -MP -MF $(DEPDIR)/condition.Tpo -c -o condition.o `test -f '$(srcdir)/../lib/isc/nothreads/condition.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/nothreads/condition.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/condition.Tpo $(DEPDIR)/condition.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/nothreads/condition.c' object='condition.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o condition.o `test -f '$(srcdir)/../lib/isc/nothreads/condition.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/nothreads/condition.c condition.obj: $(srcdir)/../lib/isc/nothreads/condition.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT condition.obj -MD -MP -MF $(DEPDIR)/condition.Tpo -c -o condition.obj `if test -f '$(srcdir)/../lib/isc/nothreads/condition.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/nothreads/condition.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/nothreads/condition.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/condition.Tpo $(DEPDIR)/condition.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/nothreads/condition.c' object='condition.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o condition.obj `if test -f '$(srcdir)/../lib/isc/nothreads/condition.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/nothreads/condition.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/nothreads/condition.c'; fi` dir.o: $(srcdir)/../lib/isc/unix/dir.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dir.o -MD -MP -MF $(DEPDIR)/dir.Tpo -c -o dir.o `test -f '$(srcdir)/../lib/isc/unix/dir.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/dir.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dir.Tpo $(DEPDIR)/dir.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/dir.c' object='dir.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dir.o `test -f '$(srcdir)/../lib/isc/unix/dir.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/dir.c dir.obj: $(srcdir)/../lib/isc/unix/dir.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dir.obj -MD -MP -MF $(DEPDIR)/dir.Tpo -c -o dir.obj `if test -f '$(srcdir)/../lib/isc/unix/dir.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/dir.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/dir.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dir.Tpo $(DEPDIR)/dir.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/dir.c' object='dir.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dir.obj `if test -f '$(srcdir)/../lib/isc/unix/dir.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/dir.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/dir.c'; fi` error.o: $(srcdir)/../lib/isc/error.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT error.o -MD -MP -MF $(DEPDIR)/error.Tpo -c -o error.o `test -f '$(srcdir)/../lib/isc/error.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/error.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/error.Tpo $(DEPDIR)/error.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/error.c' object='error.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o error.o `test -f '$(srcdir)/../lib/isc/error.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/error.c error.obj: $(srcdir)/../lib/isc/error.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT error.obj -MD -MP -MF $(DEPDIR)/error.Tpo -c -o error.obj `if test -f '$(srcdir)/../lib/isc/error.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/error.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/error.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/error.Tpo $(DEPDIR)/error.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/error.c' object='error.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o error.obj `if test -f '$(srcdir)/../lib/isc/error.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/error.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/error.c'; fi` errno2result.o: $(srcdir)/../lib/isc/unix/errno2result.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT errno2result.o -MD -MP -MF $(DEPDIR)/errno2result.Tpo -c -o errno2result.o `test -f '$(srcdir)/../lib/isc/unix/errno2result.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/errno2result.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/errno2result.Tpo $(DEPDIR)/errno2result.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/errno2result.c' object='errno2result.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o errno2result.o `test -f '$(srcdir)/../lib/isc/unix/errno2result.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/errno2result.c errno2result.obj: $(srcdir)/../lib/isc/unix/errno2result.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT errno2result.obj -MD -MP -MF $(DEPDIR)/errno2result.Tpo -c -o errno2result.obj `if test -f '$(srcdir)/../lib/isc/unix/errno2result.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/errno2result.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/errno2result.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/errno2result.Tpo $(DEPDIR)/errno2result.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/errno2result.c' object='errno2result.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o errno2result.obj `if test -f '$(srcdir)/../lib/isc/unix/errno2result.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/errno2result.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/errno2result.c'; fi` event.o: $(srcdir)/../lib/isc/event.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT event.o -MD -MP -MF $(DEPDIR)/event.Tpo -c -o event.o `test -f '$(srcdir)/../lib/isc/event.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/event.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/event.Tpo $(DEPDIR)/event.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/event.c' object='event.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o event.o `test -f '$(srcdir)/../lib/isc/event.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/event.c event.obj: $(srcdir)/../lib/isc/event.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT event.obj -MD -MP -MF $(DEPDIR)/event.Tpo -c -o event.obj `if test -f '$(srcdir)/../lib/isc/event.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/event.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/event.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/event.Tpo $(DEPDIR)/event.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/event.c' object='event.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o event.obj `if test -f '$(srcdir)/../lib/isc/event.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/event.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/event.c'; fi` file.o: $(srcdir)/../lib/isc/unix/file.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.o -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.o `test -f '$(srcdir)/../lib/isc/unix/file.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/file.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/file.c' object='file.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.o `test -f '$(srcdir)/../lib/isc/unix/file.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/file.c file.obj: $(srcdir)/../lib/isc/unix/file.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.obj -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.obj `if test -f '$(srcdir)/../lib/isc/unix/file.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/file.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/file.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/file.c' object='file.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.obj `if test -f '$(srcdir)/../lib/isc/unix/file.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/file.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/file.c'; fi` inet_ntop.o: $(srcdir)/../lib/isc/inet_ntop.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inet_ntop.o -MD -MP -MF $(DEPDIR)/inet_ntop.Tpo -c -o inet_ntop.o `test -f '$(srcdir)/../lib/isc/inet_ntop.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/inet_ntop.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/inet_ntop.Tpo $(DEPDIR)/inet_ntop.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/inet_ntop.c' object='inet_ntop.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inet_ntop.o `test -f '$(srcdir)/../lib/isc/inet_ntop.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/inet_ntop.c inet_ntop.obj: $(srcdir)/../lib/isc/inet_ntop.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inet_ntop.obj -MD -MP -MF $(DEPDIR)/inet_ntop.Tpo -c -o inet_ntop.obj `if test -f '$(srcdir)/../lib/isc/inet_ntop.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/inet_ntop.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/inet_ntop.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/inet_ntop.Tpo $(DEPDIR)/inet_ntop.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/inet_ntop.c' object='inet_ntop.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inet_ntop.obj `if test -f '$(srcdir)/../lib/isc/inet_ntop.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/inet_ntop.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/inet_ntop.c'; fi` inet_pton.o: $(srcdir)/../lib/isc/inet_pton.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inet_pton.o -MD -MP -MF $(DEPDIR)/inet_pton.Tpo -c -o inet_pton.o `test -f '$(srcdir)/../lib/isc/inet_pton.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/inet_pton.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/inet_pton.Tpo $(DEPDIR)/inet_pton.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/inet_pton.c' object='inet_pton.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inet_pton.o `test -f '$(srcdir)/../lib/isc/inet_pton.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/inet_pton.c inet_pton.obj: $(srcdir)/../lib/isc/inet_pton.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inet_pton.obj -MD -MP -MF $(DEPDIR)/inet_pton.Tpo -c -o inet_pton.obj `if test -f '$(srcdir)/../lib/isc/inet_pton.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/inet_pton.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/inet_pton.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/inet_pton.Tpo $(DEPDIR)/inet_pton.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/inet_pton.c' object='inet_pton.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inet_pton.obj `if test -f '$(srcdir)/../lib/isc/inet_pton.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/inet_pton.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/inet_pton.c'; fi` interfaceiter.o: $(srcdir)/../lib/isc/unix/interfaceiter.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT interfaceiter.o -MD -MP -MF $(DEPDIR)/interfaceiter.Tpo -c -o interfaceiter.o `test -f '$(srcdir)/../lib/isc/unix/interfaceiter.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/interfaceiter.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/interfaceiter.Tpo $(DEPDIR)/interfaceiter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/interfaceiter.c' object='interfaceiter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o interfaceiter.o `test -f '$(srcdir)/../lib/isc/unix/interfaceiter.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/interfaceiter.c interfaceiter.obj: $(srcdir)/../lib/isc/unix/interfaceiter.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT interfaceiter.obj -MD -MP -MF $(DEPDIR)/interfaceiter.Tpo -c -o interfaceiter.obj `if test -f '$(srcdir)/../lib/isc/unix/interfaceiter.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/interfaceiter.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/interfaceiter.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/interfaceiter.Tpo $(DEPDIR)/interfaceiter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/interfaceiter.c' object='interfaceiter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o interfaceiter.obj `if test -f '$(srcdir)/../lib/isc/unix/interfaceiter.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/interfaceiter.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/interfaceiter.c'; fi` lib.o: $(srcdir)/../lib/isc/lib.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lib.o -MD -MP -MF $(DEPDIR)/lib.Tpo -c -o lib.o `test -f '$(srcdir)/../lib/isc/lib.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/lib.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/lib.Tpo $(DEPDIR)/lib.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/lib.c' object='lib.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib.o `test -f '$(srcdir)/../lib/isc/lib.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/lib.c lib.obj: $(srcdir)/../lib/isc/lib.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lib.obj -MD -MP -MF $(DEPDIR)/lib.Tpo -c -o lib.obj `if test -f '$(srcdir)/../lib/isc/lib.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/lib.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/lib.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/lib.Tpo $(DEPDIR)/lib.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/lib.c' object='lib.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib.obj `if test -f '$(srcdir)/../lib/isc/lib.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/lib.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/lib.c'; fi` log.o: $(srcdir)/../lib/isc/log.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log.o -MD -MP -MF $(DEPDIR)/log.Tpo -c -o log.o `test -f '$(srcdir)/../lib/isc/log.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/log.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/log.Tpo $(DEPDIR)/log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/log.c' object='log.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o log.o `test -f '$(srcdir)/../lib/isc/log.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/log.c log.obj: $(srcdir)/../lib/isc/log.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log.obj -MD -MP -MF $(DEPDIR)/log.Tpo -c -o log.obj `if test -f '$(srcdir)/../lib/isc/log.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/log.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/log.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/log.Tpo $(DEPDIR)/log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/log.c' object='log.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o log.obj `if test -f '$(srcdir)/../lib/isc/log.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/log.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/log.c'; fi` md5.o: $(srcdir)/../lib/isc/md5.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5.o -MD -MP -MF $(DEPDIR)/md5.Tpo -c -o md5.o `test -f '$(srcdir)/../lib/isc/md5.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/md5.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/md5.Tpo $(DEPDIR)/md5.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/md5.c' object='md5.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5.o `test -f '$(srcdir)/../lib/isc/md5.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/md5.c md5.obj: $(srcdir)/../lib/isc/md5.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5.obj -MD -MP -MF $(DEPDIR)/md5.Tpo -c -o md5.obj `if test -f '$(srcdir)/../lib/isc/md5.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/md5.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/md5.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/md5.Tpo $(DEPDIR)/md5.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/md5.c' object='md5.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5.obj `if test -f '$(srcdir)/../lib/isc/md5.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/md5.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/md5.c'; fi` msgcat.o: $(srcdir)/../lib/isc/nls/msgcat.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT msgcat.o -MD -MP -MF $(DEPDIR)/msgcat.Tpo -c -o msgcat.o `test -f '$(srcdir)/../lib/isc/nls/msgcat.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/nls/msgcat.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/msgcat.Tpo $(DEPDIR)/msgcat.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/nls/msgcat.c' object='msgcat.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o msgcat.o `test -f '$(srcdir)/../lib/isc/nls/msgcat.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/nls/msgcat.c msgcat.obj: $(srcdir)/../lib/isc/nls/msgcat.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT msgcat.obj -MD -MP -MF $(DEPDIR)/msgcat.Tpo -c -o msgcat.obj `if test -f '$(srcdir)/../lib/isc/nls/msgcat.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/nls/msgcat.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/nls/msgcat.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/msgcat.Tpo $(DEPDIR)/msgcat.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/nls/msgcat.c' object='msgcat.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o msgcat.obj `if test -f '$(srcdir)/../lib/isc/nls/msgcat.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/nls/msgcat.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/nls/msgcat.c'; fi` net.o: $(srcdir)/../lib/isc/unix/net.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT net.o -MD -MP -MF $(DEPDIR)/net.Tpo -c -o net.o `test -f '$(srcdir)/../lib/isc/unix/net.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/net.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/net.Tpo $(DEPDIR)/net.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/net.c' object='net.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o net.o `test -f '$(srcdir)/../lib/isc/unix/net.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/net.c net.obj: $(srcdir)/../lib/isc/unix/net.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT net.obj -MD -MP -MF $(DEPDIR)/net.Tpo -c -o net.obj `if test -f '$(srcdir)/../lib/isc/unix/net.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/net.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/net.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/net.Tpo $(DEPDIR)/net.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/net.c' object='net.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o net.obj `if test -f '$(srcdir)/../lib/isc/unix/net.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/net.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/net.c'; fi` netaddr.o: $(srcdir)/../lib/isc/netaddr.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netaddr.o -MD -MP -MF $(DEPDIR)/netaddr.Tpo -c -o netaddr.o `test -f '$(srcdir)/../lib/isc/netaddr.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/netaddr.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/netaddr.Tpo $(DEPDIR)/netaddr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/netaddr.c' object='netaddr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netaddr.o `test -f '$(srcdir)/../lib/isc/netaddr.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/netaddr.c netaddr.obj: $(srcdir)/../lib/isc/netaddr.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netaddr.obj -MD -MP -MF $(DEPDIR)/netaddr.Tpo -c -o netaddr.obj `if test -f '$(srcdir)/../lib/isc/netaddr.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/netaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/netaddr.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/netaddr.Tpo $(DEPDIR)/netaddr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/netaddr.c' object='netaddr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netaddr.obj `if test -f '$(srcdir)/../lib/isc/netaddr.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/netaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/netaddr.c'; fi` netscope.o: $(srcdir)/../lib/isc/netscope.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netscope.o -MD -MP -MF $(DEPDIR)/netscope.Tpo -c -o netscope.o `test -f '$(srcdir)/../lib/isc/netscope.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/netscope.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/netscope.Tpo $(DEPDIR)/netscope.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/netscope.c' object='netscope.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netscope.o `test -f '$(srcdir)/../lib/isc/netscope.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/netscope.c netscope.obj: $(srcdir)/../lib/isc/netscope.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netscope.obj -MD -MP -MF $(DEPDIR)/netscope.Tpo -c -o netscope.obj `if test -f '$(srcdir)/../lib/isc/netscope.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/netscope.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/netscope.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/netscope.Tpo $(DEPDIR)/netscope.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/netscope.c' object='netscope.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netscope.obj `if test -f '$(srcdir)/../lib/isc/netscope.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/netscope.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/netscope.c'; fi` ondestroy.o: $(srcdir)/../lib/isc/ondestroy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ondestroy.o -MD -MP -MF $(DEPDIR)/ondestroy.Tpo -c -o ondestroy.o `test -f '$(srcdir)/../lib/isc/ondestroy.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/ondestroy.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ondestroy.Tpo $(DEPDIR)/ondestroy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/ondestroy.c' object='ondestroy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ondestroy.o `test -f '$(srcdir)/../lib/isc/ondestroy.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/ondestroy.c ondestroy.obj: $(srcdir)/../lib/isc/ondestroy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ondestroy.obj -MD -MP -MF $(DEPDIR)/ondestroy.Tpo -c -o ondestroy.obj `if test -f '$(srcdir)/../lib/isc/ondestroy.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/ondestroy.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/ondestroy.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ondestroy.Tpo $(DEPDIR)/ondestroy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/ondestroy.c' object='ondestroy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ondestroy.obj `if test -f '$(srcdir)/../lib/isc/ondestroy.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/ondestroy.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/ondestroy.c'; fi` random.o: $(srcdir)/../lib/isc/random.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT random.o -MD -MP -MF $(DEPDIR)/random.Tpo -c -o random.o `test -f '$(srcdir)/../lib/isc/random.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/random.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/random.Tpo $(DEPDIR)/random.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/random.c' object='random.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o random.o `test -f '$(srcdir)/../lib/isc/random.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/random.c random.obj: $(srcdir)/../lib/isc/random.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT random.obj -MD -MP -MF $(DEPDIR)/random.Tpo -c -o random.obj `if test -f '$(srcdir)/../lib/isc/random.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/random.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/random.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/random.Tpo $(DEPDIR)/random.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/random.c' object='random.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o random.obj `if test -f '$(srcdir)/../lib/isc/random.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/random.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/random.c'; fi` result.o: $(srcdir)/../lib/isc/result.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT result.o -MD -MP -MF $(DEPDIR)/result.Tpo -c -o result.o `test -f '$(srcdir)/../lib/isc/result.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/result.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/result.Tpo $(DEPDIR)/result.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/result.c' object='result.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o result.o `test -f '$(srcdir)/../lib/isc/result.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/result.c result.obj: $(srcdir)/../lib/isc/result.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT result.obj -MD -MP -MF $(DEPDIR)/result.Tpo -c -o result.obj `if test -f '$(srcdir)/../lib/isc/result.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/result.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/result.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/result.Tpo $(DEPDIR)/result.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/result.c' object='result.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o result.obj `if test -f '$(srcdir)/../lib/isc/result.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/result.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/result.c'; fi` stdio.o: $(srcdir)/../lib/isc/unix/stdio.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdio.o -MD -MP -MF $(DEPDIR)/stdio.Tpo -c -o stdio.o `test -f '$(srcdir)/../lib/isc/unix/stdio.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/stdio.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/stdio.Tpo $(DEPDIR)/stdio.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/stdio.c' object='stdio.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdio.o `test -f '$(srcdir)/../lib/isc/unix/stdio.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/stdio.c stdio.obj: $(srcdir)/../lib/isc/unix/stdio.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdio.obj -MD -MP -MF $(DEPDIR)/stdio.Tpo -c -o stdio.obj `if test -f '$(srcdir)/../lib/isc/unix/stdio.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/stdio.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/stdio.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/stdio.Tpo $(DEPDIR)/stdio.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/stdio.c' object='stdio.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdio.obj `if test -f '$(srcdir)/../lib/isc/unix/stdio.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/stdio.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/stdio.c'; fi` stdtime.o: $(srcdir)/../lib/isc/unix/stdtime.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdtime.o -MD -MP -MF $(DEPDIR)/stdtime.Tpo -c -o stdtime.o `test -f '$(srcdir)/../lib/isc/unix/stdtime.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/stdtime.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/stdtime.Tpo $(DEPDIR)/stdtime.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/stdtime.c' object='stdtime.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdtime.o `test -f '$(srcdir)/../lib/isc/unix/stdtime.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/stdtime.c stdtime.obj: $(srcdir)/../lib/isc/unix/stdtime.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdtime.obj -MD -MP -MF $(DEPDIR)/stdtime.Tpo -c -o stdtime.obj `if test -f '$(srcdir)/../lib/isc/unix/stdtime.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/stdtime.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/stdtime.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/stdtime.Tpo $(DEPDIR)/stdtime.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/stdtime.c' object='stdtime.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdtime.obj `if test -f '$(srcdir)/../lib/isc/unix/stdtime.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/stdtime.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/stdtime.c'; fi` strerror.o: $(srcdir)/../lib/isc/unix/strerror.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strerror.o -MD -MP -MF $(DEPDIR)/strerror.Tpo -c -o strerror.o `test -f '$(srcdir)/../lib/isc/unix/strerror.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/strerror.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/strerror.Tpo $(DEPDIR)/strerror.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/strerror.c' object='strerror.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strerror.o `test -f '$(srcdir)/../lib/isc/unix/strerror.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/strerror.c strerror.obj: $(srcdir)/../lib/isc/unix/strerror.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strerror.obj -MD -MP -MF $(DEPDIR)/strerror.Tpo -c -o strerror.obj `if test -f '$(srcdir)/../lib/isc/unix/strerror.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/strerror.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/strerror.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/strerror.Tpo $(DEPDIR)/strerror.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/strerror.c' object='strerror.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strerror.obj `if test -f '$(srcdir)/../lib/isc/unix/strerror.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/strerror.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/strerror.c'; fi` task.o: $(srcdir)/../lib/isc/task.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT task.o -MD -MP -MF $(DEPDIR)/task.Tpo -c -o task.o `test -f '$(srcdir)/../lib/isc/task.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/task.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/task.Tpo $(DEPDIR)/task.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/task.c' object='task.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o task.o `test -f '$(srcdir)/../lib/isc/task.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/task.c task.obj: $(srcdir)/../lib/isc/task.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT task.obj -MD -MP -MF $(DEPDIR)/task.Tpo -c -o task.obj `if test -f '$(srcdir)/../lib/isc/task.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/task.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/task.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/task.Tpo $(DEPDIR)/task.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/task.c' object='task.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o task.obj `if test -f '$(srcdir)/../lib/isc/task.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/task.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/task.c'; fi` thread.o: $(srcdir)/../lib/isc/nothreads/thread.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT thread.o -MD -MP -MF $(DEPDIR)/thread.Tpo -c -o thread.o `test -f '$(srcdir)/../lib/isc/nothreads/thread.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/nothreads/thread.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/thread.Tpo $(DEPDIR)/thread.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/nothreads/thread.c' object='thread.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o thread.o `test -f '$(srcdir)/../lib/isc/nothreads/thread.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/nothreads/thread.c thread.obj: $(srcdir)/../lib/isc/nothreads/thread.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT thread.obj -MD -MP -MF $(DEPDIR)/thread.Tpo -c -o thread.obj `if test -f '$(srcdir)/../lib/isc/nothreads/thread.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/nothreads/thread.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/nothreads/thread.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/thread.Tpo $(DEPDIR)/thread.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/nothreads/thread.c' object='thread.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o thread.obj `if test -f '$(srcdir)/../lib/isc/nothreads/thread.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/nothreads/thread.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/nothreads/thread.c'; fi` time.o: $(srcdir)/../lib/isc/unix/time.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT time.o -MD -MP -MF $(DEPDIR)/time.Tpo -c -o time.o `test -f '$(srcdir)/../lib/isc/unix/time.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/time.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/time.Tpo $(DEPDIR)/time.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/time.c' object='time.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o time.o `test -f '$(srcdir)/../lib/isc/unix/time.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/time.c time.obj: $(srcdir)/../lib/isc/unix/time.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT time.obj -MD -MP -MF $(DEPDIR)/time.Tpo -c -o time.obj `if test -f '$(srcdir)/../lib/isc/unix/time.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/time.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/time.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/time.Tpo $(DEPDIR)/time.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/time.c' object='time.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o time.obj `if test -f '$(srcdir)/../lib/isc/unix/time.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/time.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/time.c'; fi` sockaddr.o: $(srcdir)/../lib/isc/sockaddr.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sockaddr.o -MD -MP -MF $(DEPDIR)/sockaddr.Tpo -c -o sockaddr.o `test -f '$(srcdir)/../lib/isc/sockaddr.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/sockaddr.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/sockaddr.Tpo $(DEPDIR)/sockaddr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/sockaddr.c' object='sockaddr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sockaddr.o `test -f '$(srcdir)/../lib/isc/sockaddr.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/sockaddr.c sockaddr.obj: $(srcdir)/../lib/isc/sockaddr.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sockaddr.obj -MD -MP -MF $(DEPDIR)/sockaddr.Tpo -c -o sockaddr.obj `if test -f '$(srcdir)/../lib/isc/sockaddr.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/sockaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/sockaddr.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/sockaddr.Tpo $(DEPDIR)/sockaddr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/sockaddr.c' object='sockaddr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sockaddr.obj `if test -f '$(srcdir)/../lib/isc/sockaddr.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/sockaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/sockaddr.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LIBRARIES) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ chmod ug+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ $(MAKE) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ mkdir $(DEPDIR) && \ case "$(top_builddir)" in \ .) \ ./config.status Makefile depfiles \ ;; \ ..) \ cd .. && \ ./config.status $(subdir)/Makefile depfiles && \ cd $(subdir) \ ;; \ *) \ echo 'Fatal: depsver.mf Automake fragment limited' \ 'to immediate subdirectories.' && \ echo "top_builddir: $(top_builddir)" && \ echo "subdir: $(subdir)" && \ exit 1 \ ;; \ esac && \ echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver @touch $@ # # depsver.mf included in Makefile.am for directories with .deps # # When building in the same directory with sources that change over # time, such as when tracking using bk, the .deps files can become # stale with respect to moved, deleted, or superceded headers. Most # commonly, this would exhibit as make reporting a failure to make a # header file which is no longer in the location given. To address # this issue, we use a deps-ver file which is updated with each change # that breaks old .deps files. A copy of deps-ver is made into # $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present # with different contents than deps-ver, we make clean to ensure all # .o files built before the incompatible change are rebuilt along with # their updated .deps files, then remove $(DEPDIR) and recreate it as # empty stubs. # # It is normal when configured with --disable-dependency-tracking for # the DEPDIR to not have been created. For this reason, we use the # intermediate target .deps-ver, which invokes make recursively if # DEPDIR exists. # # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # # This comment block follows rather than leads the related code so that # it stays with it in the generated Makefile.in and Makefile. # # 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: ntp-4.2.6p5/libntp/uinttoa.c0000644000175000017500000000040311332473302014723 0ustar peterpeter/* * uinttoa - return an asciized unsigned integer */ #include #include "lib_strbuf.h" #include "ntp_stdlib.h" char * uinttoa( u_long uval ) { register char *buf; LIB_GETBUF(buf); snprintf(buf, LIB_BUFLENGTH, "%lu", uval); return buf; } ntp-4.2.6p5/libntp/inttoa.c0000644000175000017500000000041711407063137014547 0ustar peterpeter/* * inttoa - return an asciized signed integer */ #include #include #include "lib_strbuf.h" #include "ntp_stdlib.h" char * inttoa( long val ) { register char *buf; LIB_GETBUF(buf); snprintf(buf, LIB_BUFLENGTH, "%ld", val); return buf; } ntp-4.2.6p5/libntp/fptoa.c0000644000175000017500000000050210017034554014352 0ustar peterpeter/* * fptoa - return an asciized representation of an s_fp number */ #include "ntp_fp.h" #include "ntp_stdlib.h" char * fptoa( s_fp fpv, short ndec ) { u_fp plusfp; int neg; if (fpv < 0) { plusfp = (u_fp)(-fpv); neg = 1; } else { plusfp = (u_fp)fpv; neg = 0; } return dofptoa(plusfp, neg, ndec, 0); } ntp-4.2.6p5/libntp/getopt.c0000644000175000017500000000430010017034555014544 0ustar peterpeter/* * getopt - get option letter from argv * * This is a version of the public domain getopt() implementation by * Henry Spencer, changed for 4.3BSD compatibility (in addition to System V). * It allows rescanning of an option list by setting optind to 0 before * calling, which is why we use it even if the system has its own (in fact, * this one has a unique name so as not to conflict with the system's). * Thanks to Dennis Ferguson for the appropriate modifications. * * This file is in the Public Domain. */ /*LINTLIBRARY*/ #include #include "ntp_stdlib.h" #ifdef lint #undef putc #define putc fputc #endif /* lint */ char *ntp_optarg; /* Global argument pointer. */ int ntp_optind = 0; /* Global argv index. */ int ntp_opterr = 1; /* for compatibility, should error be printed? */ int ntp_optopt; /* for compatibility, option character checked */ static char *scan = NULL; /* Private scan pointer. */ static const char *prog = "amnesia"; /* * Print message about a bad option. */ static int badopt( const char *mess, int ch ) { if (ntp_opterr) { fputs(prog, stderr); fputs(mess, stderr); (void) putc(ch, stderr); (void) putc('\n', stderr); } return ('?'); } int ntp_getopt( int argc, char *argv[], const char *optstring ) { register char c; register const char *place; prog = argv[0]; ntp_optarg = NULL; if (ntp_optind == 0) { scan = NULL; ntp_optind++; } if (scan == NULL || *scan == '\0') { if (ntp_optind >= argc || argv[ntp_optind][0] != '-' || argv[ntp_optind][1] == '\0') { return (EOF); } if (argv[ntp_optind][1] == '-' && argv[ntp_optind][2] == '\0') { ntp_optind++; return (EOF); } scan = argv[ntp_optind++]+1; } c = *scan++; ntp_optopt = c & 0377; for (place = optstring; place != NULL && *place != '\0'; ++place) if (*place == c) break; if (place == NULL || *place == '\0' || c == ':' || c == '?') { return (badopt(": unknown option -", c)); } place++; if (*place == ':') { if (*scan != '\0') { ntp_optarg = scan; scan = NULL; } else if (ntp_optind >= argc) { return (badopt(": option requires argument -", c)); } else { ntp_optarg = argv[ntp_optind++]; } } return (c & 0377); } ntp-4.2.6p5/libntp/lib_strbuf.c0000644000175000017500000000110411307651603015376 0ustar peterpeter/* * lib_strbuf - library string storage */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "ntp_stdlib.h" #include "lib_strbuf.h" /* * Storage declarations */ char lib_stringbuf[LIB_NUMBUFS][LIB_BUFLENGTH]; int lib_nextbuf; int ipv4_works; int ipv6_works; int lib_inited = 0; /* * initialization routine. Might be needed if the code is ROMized. */ void init_lib(void) { lib_nextbuf = 0; ipv4_works = (ISC_R_SUCCESS == isc_net_probeipv4()); ipv6_works = (ISC_R_SUCCESS == isc_net_probeipv6()); lib_inited = 1; } ntp-4.2.6p5/libntp/socktoa.c0000644000175000017500000000172511505336022014712 0ustar peterpeter/* * socktoa - return a numeric host name from a sockaddr_storage structure */ #ifdef HAVE_CONFIG_H #include #endif #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #include #ifdef ISC_PLATFORM_NEEDNTOP #include #endif #include #include "ntp_fp.h" #include "lib_strbuf.h" #include "ntp_stdlib.h" #include "ntp.h" char * socktoa( const sockaddr_u *sock ) { register char *buffer; LIB_GETBUF(buffer); if (NULL == sock) strncpy(buffer, "(null)", LIB_BUFLENGTH); else { switch(AF(sock)) { case AF_INET: case AF_UNSPEC: inet_ntop(AF_INET, PSOCK_ADDR4(sock), buffer, LIB_BUFLENGTH); break; case AF_INET6: inet_ntop(AF_INET6, PSOCK_ADDR6(sock), buffer, LIB_BUFLENGTH); break; default: snprintf(buffer, LIB_BUFLENGTH, "(socktoa unknown family %d)", AF(sock)); } } return buffer; } ntp-4.2.6p5/libntp/strdup.c0000644000175000017500000000056411567107101014572 0ustar peterpeter#include #include #include "ntp_malloc.h" #ifndef HAVE_STRDUP char *strdup(const char *s); char * strdup( const char *s ) { size_t octets; char * cp; if (s) { octets = 1 + strlen(s); cp = malloc(octets); if (NULL != cp) memcpy(cp, s, octets); else cp = NULL; return(cp); } #else int strdup_c_nonempty_compilation_unit; #endif ntp-4.2.6p5/libntp/findconfig.c0000644000175000017500000000266711332473302015364 0ustar peterpeter #ifdef HAVE_CONFIG_H # include #endif #ifdef NEED_HPUX_FINDCONFIG #include #include #include #include #include #include const char * FindConfig( const char *base ) { static char result[BUFSIZ]; char hostname[BUFSIZ], *cp; struct stat sbuf; struct utsname unamebuf; /* All keyed by initial target being a directory */ (void) strcpy(result, base); if (stat(result, &sbuf) == 0) { if (S_ISDIR(sbuf.st_mode)) { /* First choice is my hostname */ if (gethostname(hostname, BUFSIZ) >= 0) { snprintf(result, sizeof(result), "%s/%s", base, hostname); if (stat(result, &sbuf) == 0) { goto outahere; } else { /* Second choice is of form default.835 */ (void) uname(&unamebuf); if (strncmp(unamebuf.machine, "9000/", 5) == 0) cp = unamebuf.machine + 5; else cp = unamebuf.machine; snprintf(result, sizeof(result), "%s/default.%s", base, cp); if (stat(result, &sbuf) == 0) { goto outahere; } else { /* Last choice is just default */ snprintf(result, sizeof(result), "%s/default", base); if (stat(result, &sbuf) == 0) { goto outahere; } else { (void) strcpy(result, "/not/found"); } } } } } } outahere: return(result); } #else #include "ntp_stdlib.h" const char * FindConfig( const char *base ) { return base; } #endif ntp-4.2.6p5/libntp/modetoa.c0000644000175000017500000000075011332473301014674 0ustar peterpeter/* * modetoa - return an asciized mode */ #include #include "lib_strbuf.h" #include "ntp_stdlib.h" const char * modetoa( int mode ) { char *bp; static const char *modestrings[] = { "unspec", "sym_active", "sym_passive", "client", "server", "broadcast", "control", "private", "bclient", }; if (mode < 0 || mode >= COUNTOF(modestrings)) { LIB_GETBUF(bp); snprintf(bp, LIB_BUFLENGTH, "mode#%d", mode); return bp; } return modestrings[mode]; } ntp-4.2.6p5/libntp/msutotsf.c0000644000175000017500000000233310017034556015133 0ustar peterpeter/* * msutotsf - tables for converting from a subsecond millisecond value * to a time stamp fraction. */ #include #include "ntp_types.h" /* * Index each of these tables with five bits of the (less than) 10 * bit millisecond value. Note that the tables are rounded (not * truncated). The error in the result will thus be +-1 low order * bit in the time stamp fraction. */ u_long msutotsflo[32] = { 0x00000000, 0x00418937, 0x0083126f, 0x00c49ba6, 0x010624dd, 0x0147ae14, 0x0189374c, 0x01cac083, 0x020c49ba, 0x024dd2f2, 0x028f5c29, 0x02d0e560, 0x03126e98, 0x0353f7cf, 0x03958106, 0x03d70a3d, 0x04189375, 0x045a1cac, 0x049ba5e3, 0x04dd2f1b, 0x051eb852, 0x05604189, 0x05a1cac1, 0x05e353f8, 0x0624dd2f, 0x06666666, 0x06a7ef9e, 0x06e978d5, 0x072b020c, 0x076c8b44, 0x07ae147b, 0x07ef9db2 }; u_long msutotsfhi[32] = { 0x00000000, 0x083126e9, 0x10624dd3, 0x189374bc, 0x20c49ba6, 0x28f5c28f, 0x3126e979, 0x39581062, 0x4189374c, 0x49ba5e35, 0x51eb851f, 0x5a1cac08, 0x624dd2f2, 0x6a7ef9db, 0x72b020c5, 0x7ae147ae, 0x83126e98, 0x8b439581, 0x9374bc6a, 0x9ba5e354, 0xa3d70a3d, 0xac083127, 0xb4395810, 0xbc6a7efa, 0xc49ba5e3, 0xcccccccd, 0xd4fdf3b6, 0xdd2f1aa0, 0xe5604189, 0xed916873, 0xf5c28f5c, 0xfdf3b646 }; ntp-4.2.6p5/libntp/uglydate.c0000644000175000017500000000165211332473274015075 0ustar peterpeter/* * uglydate - convert a time stamp to something barely readable * The string returned is 37 characters long. */ #include #include "ntp_fp.h" #include "ntp_unixtime.h" #include "lib_strbuf.h" #include "ntp_stdlib.h" char * uglydate( l_fp *ts ) { char *bp; char *timep; struct tm *tm; time_t sec; long msec; int year; timep = ulfptoa(ts, 6); /* returns max 17 characters */ LIB_GETBUF(bp); sec = ts->l_ui - JAN_1970; msec = ts->l_uf / 4294967; /* fract / (2**32/1000) */ tm = gmtime(&sec); if (ts->l_ui == 0) { /* * Probably not a real good thing to do. Oh, well. */ year = 0; tm->tm_yday = 0; tm->tm_hour = 0; tm->tm_min = 0; tm->tm_sec = 0; } else { year = tm->tm_year; while (year >= 100) year -= 100; } snprintf(bp, LIB_BUFLENGTH, "%17s %02d:%03d:%02d:%02d:%02d.%03ld", timep, year, tm->tm_yday, tm->tm_hour, tm->tm_min, tm->tm_sec, msec); return bp; } ntp-4.2.6p5/libntp/clocktypes.c0000644000175000017500000000702011307651605015430 0ustar peterpeter/* * Data for pretty printing clock types */ #include #include "ntp_fp.h" #include "ntp.h" #include "lib_strbuf.h" #include "ntp_refclock.h" #include "ntp_stdlib.h" struct clktype clktypes[] = { { REFCLK_NONE, "unspecified type (0)", "UNKNOWN" }, { REFCLK_LOCALCLOCK, "Undisciplined local clock (1)", "LOCAL" }, { REFCLK_GPS_TRAK, "TRAK 8810 GPS Receiver (2)", "GPS_TRAK" }, { REFCLK_WWV_PST, "PSTI/Traconex WWV/WWVH Receiver (3)", "WWV_PST" }, { REFCLK_SPECTRACOM, "Spectracom (generic) Receivers (4)", "SPECTRACOM" }, { REFCLK_TRUETIME, "TrueTime (generic) Receivers (5)", "TRUETIME" }, { REFCLK_IRIG_AUDIO, "IRIG Audio Decoder (6)", "IRIG_AUDIO" }, { REFCLK_CHU_AUDIO, "CHU Audio Demodulator/Decoder (7)", "CHU_AUDIO" }, { REFCLK_PARSE, "Generic reference clock driver (8)", "GENERIC" }, { REFCLK_GPS_MX4200, "Magnavox MX4200 GPS Receiver (9)", "GPS_MX4200" }, { REFCLK_GPS_AS2201, "Austron 2201A GPS Receiver (10)", "GPS_AS2201" }, { REFCLK_GPS_ARBITER, "Arbiter 1088A/B GPS Receiver (11)", "GPS_ARBITER" }, { REFCLK_IRIG_TPRO, "KSI/Odetics TPRO/S IRIG Interface (12)", "IRIG_TPRO" }, { REFCLK_ATOM_LEITCH, "Leitch CSD 5300 Master Clock Controller (13)", "ATOM_LEITCH" }, { REFCLK_MSF_EES, "EES M201 MSF Receiver (14)", "MSF_EES" }, { REFCLK_NONE, "not used (15)", "NOT_USED" }, { REFCLK_IRIG_BANCOMM, "Bancomm GPS/IRIG Receiver (16)", "GPS_BANC" }, { REFCLK_GPS_DATUM, "Datum Precision Time System (17)", "GPS_DATUM" }, { REFCLK_ACTS, "Automated Computer Time Service (18)", "ACTS_MODEM" }, { REFCLK_WWV_HEATH, "Heath WWV/WWVH Receiver (19)", "WWV_HEATH" }, { REFCLK_GPS_NMEA, "Generic NMEA GPS Receiver (20)", "GPS_NMEA" }, { REFCLK_GPS_VME, "TrueTime GPS-VME Interface (21)", "GPS_VME" }, { REFCLK_ATOM_PPS, "PPS Clock Discipline (22)", "PPS" }, { REFCLK_NONE, "not used (23)", "NOT_USED" }, { REFCLK_NONE, "not used (24)", "NOT_USED" }, { REFCLK_NONE, "not used (25)", "NOT_USED" }, { REFCLK_GPS_HP, "HP 58503A GPS Time & Frequency Receiver (26)", "GPS_HP" }, { REFCLK_ARCRON_MSF, "ARCRON MSF (and DCF77) Receiver (27)", "MSF_ARCRON" }, { REFCLK_SHM, "Clock attached thru shared Memory (28)", "SHM" }, { REFCLK_PALISADE, "Trimble Navigation Palisade GPS (29)", "GPS_PALISADE" }, { REFCLK_ONCORE, "Motorola UT Oncore GPS (30)", "GPS_ONCORE" }, { REFCLK_GPS_JUPITER, "Rockwell Jupiter GPS (31)", "GPS_JUPITER" }, { REFCLK_CHRONOLOG, "Chrono-log K (32)", "CHRONOLOG" }, { REFCLK_DUMBCLOCK, "Dumb generic hh:mm:ss local clock (33)", "DUMBCLOCK" }, { REFCLK_ULINK, "Ultralink M320 WWVB receiver (34)", "ULINK_M320"}, { REFCLK_PCF, "Conrad parallel port radio clock (35)", "PCF"}, { REFCLK_WWV_AUDIO, "WWV/H Audio Demodulator/Decoder (36)", "WWV_AUDIO"}, { REFCLK_FG, "Forum Graphic GPS Dating Station (37)", "GPS_FG"}, { REFCLK_HOPF_SERIAL, "hopf Elektronic serial line receiver (38)", "HOPF_S"}, { REFCLK_HOPF_PCI, "hopf Elektronic PCI receiver (39)", "HOPF_P"}, { REFCLK_JJY, "JJY receiver (40)", "JJY"}, { REFCLK_TT560, "TrueTime 560 IRIG-B decoder (41)", "TT_IRIG"}, { REFCLK_ZYFER, "Zyfer GPStarplus receiver (42)", "GPS_ZYFER" }, { REFCLK_RIPENCC, "RIPE NCC Trimble driver (43)", "GPS_RIPENCC" }, { REFCLK_NEOCLOCK4X, "NeoClock4X DCF77 / TDF receiver (44)", "NEOCLK4X"}, { -1, "", "" } }; const char * clockname( int num ) { register struct clktype *clk; for (clk = clktypes; clk->code != -1; clk++) { if (num == clk->code) return (clk->abbrev); } return (NULL); } ntp-4.2.6p5/libntp/mfptoms.c0000644000175000017500000000050310017034556014731 0ustar peterpeter/* * mfptoms - Return an asciized signed long fp number in milliseconds */ #include "ntp_fp.h" #include "ntp_stdlib.h" char * mfptoms( u_long fpi, u_long fpf, short ndec ) { int isneg; if (M_ISNEG(fpi, fpf)) { isneg = 1; M_NEG(fpi, fpf); } else isneg = 0; return dolfptoa(fpi, fpf, isneg, ndec, 1); } ntp-4.2.6p5/libntp/Makefile.am0000644000175000017500000000537511505336024015146 0ustar peterpeterNULL= #AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies AUTOMAKE_OPTIONS = BUILT_SOURCES = CLEANFILES = noinst_LIBRARIES = libntp.a @MAKE_LIBNTPSIM@ EXTRA_LIBRARIES = libntpsim.a libntp_a_SRCS = \ a_md5encrypt.c \ adjtime.c \ atoint.c \ atolfp.c \ atouint.c \ audio.c \ authkeys.c \ authreadkeys.c \ authusekey.c \ bsd_strerror.c \ buftvtots.c \ caljulian.c \ caltontp.c \ calyearstart.c \ clocktime.c \ clocktypes.c \ decodenetnum.c \ dofptoa.c \ dolfptoa.c \ emalloc.c \ findconfig.c \ fptoa.c \ fptoms.c \ getopt.c \ hextoint.c \ hextolfp.c \ humandate.c \ icom.c \ inttoa.c \ iosignal.c \ lib_strbuf.c \ machines.c \ memmove.c \ mfptoa.c \ ntp_lineedit.c \ mfptoms.c \ mktime.c \ modetoa.c \ mstolfp.c \ msutotsf.c \ msyslog.c \ netof.c \ ntp_libopts.c \ ntp_rfc2553.c \ numtoa.c \ numtohost.c \ octtoint.c \ prettydate.c \ ntp_random.c \ recvbuff.c \ refnumtoa.c \ snprintf.c \ socktoa.c \ socktohost.c \ ssl_init.c \ statestr.c \ strdup.c \ strstr.c \ syssignal.c \ tsftomsu.c \ tstotv.c \ tvtots.c \ uglydate.c \ uinttoa.c \ ymd2yd.c \ $(srcdir)/../lib/isc/assertions.c \ $(srcdir)/../lib/isc/buffer.c \ $(srcdir)/../lib/isc/nothreads/condition.c \ $(srcdir)/../lib/isc/unix/dir.c \ $(srcdir)/../lib/isc/error.c \ $(srcdir)/../lib/isc/unix/errno2result.c \ $(srcdir)/../lib/isc/event.c \ $(srcdir)/../lib/isc/unix/file.c \ $(srcdir)/../lib/isc/inet_ntop.c \ $(srcdir)/../lib/isc/inet_pton.c \ $(srcdir)/../lib/isc/unix/interfaceiter.c \ $(srcdir)/../lib/isc/lib.c \ $(srcdir)/../lib/isc/log.c \ $(srcdir)/../lib/isc/md5.c \ $(srcdir)/../lib/isc/nls/msgcat.c \ $(srcdir)/../lib/isc/unix/net.c \ $(srcdir)/../lib/isc/netaddr.c \ $(srcdir)/../lib/isc/netscope.c \ $(srcdir)/../lib/isc/ondestroy.c \ $(srcdir)/../lib/isc/random.c \ $(srcdir)/../lib/isc/result.c \ $(srcdir)/../lib/isc/unix/stdio.c \ $(srcdir)/../lib/isc/unix/stdtime.c \ $(srcdir)/../lib/isc/unix/strerror.c \ $(srcdir)/../lib/isc/task.c \ $(srcdir)/../lib/isc/nothreads/thread.c \ $(srcdir)/../lib/isc/unix/time.c \ $(srcdir)/../lib/isc/sockaddr.c \ $(NULL) libntp_a_SOURCES = systime.c $(libntp_a_SRCS) libntpsim_a_SOURCES = systime_s.c $(libntp_a_SRCS) EXTRA_libntp_a_SOURCES = adjtimex.c ETAGS_ARGS = Makefile.am INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include $(LIBOPTS_CFLAGS) EXTRA_DIST = README include $(top_srcdir)/depsver.mf ntp-4.2.6p5/libntp/README0000644000175000017500000000042010017034553013753 0ustar peterpeterREADME file for directory ./libntp of the NTP Version 4 distribution This directory contains the sources for the NTP library used by most programs in this distribution. See the README and RELNOTES files in the parent directory for directions on how to make this library. ntp-4.2.6p5/libntp/socktohost.c0000644000175000017500000000106611505336024015447 0ustar peterpeter/* * socktoa - return a numeric host name from a sockaddr_storage structure */ #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #include #include #include "ntp_fp.h" #include "lib_strbuf.h" #include "ntp_stdlib.h" #include "ntp.h" char * socktohost( const sockaddr_u *sock ) { register char *buffer; LIB_GETBUF(buffer); if (getnameinfo(&sock->sa, SOCKLEN(sock), buffer, LIB_BUFLENGTH, NULL, 0, 0)) return stoa(sock); return buffer; } ntp-4.2.6p5/libntp/prettydate.c0000644000175000017500000001313311332473300015427 0ustar peterpeter/* * prettydate - convert a time stamp to something readable */ #include #include "ntp_fp.h" #include "ntp_unixtime.h" /* includes */ #include "lib_strbuf.h" #include "ntp_stdlib.h" #include "ntp_assert.h" static char *common_prettydate(l_fp *, int); const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; static const char *days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; /* Helper function to handle possible wraparound of the ntp epoch. Works by periodic extension of the ntp time stamp in the NTP epoch. If the 'time_t' is 32 bit, use solar cycle warping to get the value in a suitable range. Also uses solar cycle warping to work around really buggy implementations of 'gmtime()' / 'localtime()' that cannot work with a negative time value, that is, times before 1970-01-01. (MSVCRT...) Apart from that we're assuming that the localtime/gmtime library functions have been updated so that they work... */ /* solar cycle in secs, unsigned secs and years. And the cycle limits. ** ** And an explanation. The julian calendar repeats ever 28 years, because it's ** the LCM of 7 and 4, the week and leap year cycles. This is called a 'solar ** cycle'. The gregorian calendar does the same as long as no centennial year ** (divisible by 100, but not 400) goes in the way. So between 1901 and 2099 ** (inclusive) we can warp time stamps by 28 years to make them suitable for ** localtime() and gmtime() if we have trouble. Of course this will play ** hubbubb with the DST zone switches, so we should do it only if necessary; ** but as we NEED a proper conversion to dates via gmtime() we should try to ** cope with as many idiosyncrasies as possible. */ #define SOLAR_CYCLE_SECS 0x34AADC80UL /* 7*1461*86400*/ #define SOLAR_CYCLE_YEARS 28 #define MINFOLD -3 #define MAXFOLD 3 struct tm * ntp2unix_tm( u_long ntp, int local ) { struct tm *tm; int32 folds = 0; time_t t = time(NULL); u_int32 dwlo = (int32)t; /* might expand for SIZEOF_TIME_T < 4 */ #if ( SIZEOF_TIME_T > 4 ) int32 dwhi = (int32)(t >> 16 >> 16);/* double shift: avoid warnings */ #else /* * Get the correct sign extension in the high part. * (now >> 32) may not work correctly on every 32 bit * system, e.g. it yields garbage under Win32/VC6. */ int32 dwhi = (int32)(t >> 31); #endif /* Shift NTP to UN*X epoch, then unfold around currrent time. It's * important to use a 32 bit max signed value -- LONG_MAX is 64 bit on * a 64-bit system, and it will give wrong results. */ M_ADD(dwhi, dwlo, 0, ((1UL << 31)-1)); /* 32-bit max signed */ if ((ntp -= JAN_1970) > dwlo) --dwhi; dwlo = ntp; # if SIZEOF_TIME_T < 4 # error sizeof(time_t) < 4 -- this will not work! # elif SIZEOF_TIME_T == 4 /* ** If the result will not fit into a 'time_t' we have to warp solar ** cycles. That's implemented by looped addition / subtraction with ** M_ADD and M_SUB to avoid implicit 64 bit operations, especially ** division. As he number of warps is rather limited there's no big ** performance loss here. ** ** note: unless the high word doesn't match the sign-extended low word, ** the combination will not fit into time_t. That's what we use for ** loop control here... */ while (dwhi != ((int32)dwlo >> 31)) { if (dwhi < 0 && --folds >= MINFOLD) M_ADD(dwhi, dwlo, 0, SOLAR_CYCLE_SECS); else if (dwhi >= 0 && ++folds <= MAXFOLD) M_SUB(dwhi, dwlo, 0, SOLAR_CYCLE_SECS); else return NULL; } # else /* everything fine -- no reduction needed for the next thousand years */ # endif /* combine hi/lo to make time stamp */ t = ((time_t)dwhi << 16 << 16) | dwlo; /* double shift: avoid warnings */ # ifdef _MSC_VER /* make this an autoconf option? */ /* ** The MSDN says that the (Microsoft) Windoze versions of 'gmtime()' ** and 'localtime()' will bark on time stamps < 0. Better to fix it ** immediately. */ while (t < 0) { if (--folds < MINFOLD) return NULL; t += SOLAR_CYCLE_SECS; } # endif /* Microsoft specific */ /* 't' should be a suitable value by now. Just go ahead. */ while ( (tm = (*(local ? localtime : gmtime))(&t)) == 0) /* seems there are some other pathological implementations of ** 'gmtime()' and 'localtime()' somewhere out there. No matter ** if we have 32-bit or 64-bit 'time_t', try to fix this by ** solar cycle warping again... */ if (t < 0) { if (--folds < MINFOLD) return NULL; t += SOLAR_CYCLE_SECS; } else { if ((++folds > MAXFOLD) || ((t -= SOLAR_CYCLE_SECS) < 0)) return NULL; /* That's truely pathological! */ } /* 'tm' surely not NULL here... */ NTP_INSIST(tm != NULL); if (folds != 0) { tm->tm_year += folds * SOLAR_CYCLE_YEARS; if (tm->tm_year <= 0 || tm->tm_year >= 200) return NULL; /* left warp range... can't help here! */ } return tm; } static char * common_prettydate( l_fp *ts, int local ) { char *bp; struct tm *tm; u_long sec; u_long msec; LIB_GETBUF(bp); sec = ts->l_ui; msec = ts->l_uf / 4294967; /* fract / (2 ** 32 / 1000) */ tm = ntp2unix_tm(sec, local); if (!tm) snprintf(bp, LIB_BUFLENGTH, "%08lx.%08lx --- --- -- ---- --:--:--", (u_long)ts->l_ui, (u_long)ts->l_uf); else snprintf(bp, LIB_BUFLENGTH, "%08lx.%08lx %s, %s %2d %4d %2d:%02d:%02d.%03lu", (u_long)ts->l_ui, (u_long)ts->l_uf, days[tm->tm_wday], months[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year, tm->tm_hour, tm->tm_min, tm->tm_sec, msec); return bp; } char * prettydate( l_fp *ts ) { return common_prettydate(ts, 1); } char * gmprettydate( l_fp *ts ) { return common_prettydate(ts, 0); } ntp-4.2.6p5/libntp/statestr.c0000644000175000017500000001701111307651603015120 0ustar peterpeter/* * pretty printing of status information */ #ifdef HAVE_CONFIG_H #include #endif #include #include "ntp_stdlib.h" #include "ntp_fp.h" #include "ntp.h" #include "lib_strbuf.h" #include "ntp_refclock.h" #include "ntp_control.h" #include "ntp_string.h" /* * Structure for turning various constants into a readable string. */ struct codestring { int code; const char *string; }; /* * Leap status (leap) */ static struct codestring leap_codes[] = { { LEAP_NOWARNING, "leap_none" }, { LEAP_ADDSECOND, "leap_add_sec" }, { LEAP_DELSECOND, "leap_del_sec" }, { LEAP_NOTINSYNC, "leap_alarm" }, { -1, "leap" } }; /* * Clock source status (sync) */ static struct codestring sync_codes[] = { { CTL_SST_TS_UNSPEC, "sync_unspec" }, { CTL_SST_TS_ATOM, "sync_pps" }, { CTL_SST_TS_LF, "sync_lf_radio" }, { CTL_SST_TS_HF, "sync_hf_radio" }, { CTL_SST_TS_UHF, "sync_uhf_radio" }, { CTL_SST_TS_LOCAL, "sync_local" }, { CTL_SST_TS_NTP, "sync_ntp" }, { CTL_SST_TS_UDPTIME, "sync_other" }, { CTL_SST_TS_WRSTWTCH, "sync_wristwatch" }, { CTL_SST_TS_TELEPHONE, "sync_telephone" }, { -1, "sync" } }; /* * Peer selection status (sel) */ static struct codestring select_codes[] = { { CTL_PST_SEL_REJECT, "sel_reject" }, { CTL_PST_SEL_SANE, "sel_falsetick" }, { CTL_PST_SEL_CORRECT, "sel_excess" }, { CTL_PST_SEL_SELCAND, "sel_outlyer" }, { CTL_PST_SEL_SYNCCAND, "sel_candidate" }, { CTL_PST_SEL_EXCESS, "sel_backup" }, { CTL_PST_SEL_SYSPEER, "sel_sys.peer" }, { CTL_PST_SEL_PPS, "sel_pps.peer" }, { -1, "sel" } }; /* * Clock status (clk) */ static struct codestring clock_codes[] = { { CTL_CLK_OKAY, "clk_unspec" }, { CTL_CLK_NOREPLY, "clk_no_reply" }, { CTL_CLK_BADFORMAT, "clk_bad_format" }, { CTL_CLK_FAULT, "clk_fault" }, { CTL_CLK_PROPAGATION, "clk_bad_signal" }, { CTL_CLK_BADDATE, "clk_bad_date" }, { CTL_CLK_BADTIME, "clk_bad_time" }, { -1, "clk" } }; #ifdef FLASH_CODES_UNUSED /* * Flash bits -- see ntpq.c tstflags & tstflagnames */ static struct codestring flash_codes[] = { { TEST1, "pkt_dup" }, { TEST2, "pkt_bogus" }, { TEST3, "pkt_unsync" }, { TEST4, "pkt_denied" }, { TEST5, "pkt_auth" }, { TEST6, "pkt_stratum" }, { TEST7, "pkt_header" }, { TEST8, "pkt_autokey" }, { TEST9, "pkt_crypto" }, { TEST10, "peer_stratum" }, { TEST11, "peer_dist" }, { TEST12, "peer_loop" }, { TEST13, "peer_unreach" }, { -1, "flash" } }; #endif /* * System events (sys) */ static struct codestring sys_codes[] = { { EVNT_UNSPEC, "unspecified" }, { EVNT_NSET, "freq_not_set" }, { EVNT_FSET, "freq_set" }, { EVNT_SPIK, "spike_detect" }, { EVNT_FREQ, "freq_mode" }, { EVNT_SYNC, "clock_sync" }, { EVNT_SYSRESTART, "restart" }, { EVNT_SYSFAULT, "panic_stop" }, { EVNT_NOPEER, "no_sys_peer" }, { EVNT_ARMED, "leap_armed" }, { EVNT_DISARMED, "leap_disarmed" }, { EVNT_LEAP, "leap_event" }, { EVNT_CLOCKRESET, "clock_step" }, { EVNT_KERN, "kern" }, { EVNT_TAI, "TAI" }, { EVNT_LEAPVAL, "stale_leapsecond_values" }, { EVNT_CLKHOP, "clockhop" }, { -1, "" } }; /* * Peer events (peer) */ static struct codestring peer_codes[] = { { PEVNT_MOBIL & ~PEER_EVENT, "mobilize" }, { PEVNT_DEMOBIL & ~PEER_EVENT, "demobilize" }, { PEVNT_UNREACH & ~PEER_EVENT, "unreachable" }, { PEVNT_REACH & ~PEER_EVENT, "reachable" }, { PEVNT_RESTART & ~PEER_EVENT, "restart" }, { PEVNT_REPLY & ~PEER_EVENT, "no_reply" }, { PEVNT_RATE & ~PEER_EVENT, "rate_exceeded" }, { PEVNT_DENY & ~PEER_EVENT, "access_denied" }, { PEVNT_ARMED & ~PEER_EVENT, "leap_armed" }, { PEVNT_NEWPEER & ~PEER_EVENT, "sys_peer" }, { PEVNT_CLOCK & ~PEER_EVENT, "clock_event" }, { PEVNT_AUTH & ~PEER_EVENT, "bad_auth" }, { PEVNT_POPCORN & ~PEER_EVENT, "popcorn" }, { PEVNT_XLEAVE & ~PEER_EVENT, "interleave_mode" }, { PEVNT_XERR & ~PEER_EVENT, "interleave_error" }, { PEVNT_TAI & ~PEER_EVENT, "TAI" }, { -1, "" } }; #ifdef OPENSSL /* * Crypto events (cryp) */ static struct codestring crypto_codes[] = { { XEVNT_OK & ~CRPT_EVENT, "success" }, { XEVNT_LEN & ~CRPT_EVENT, "bad_field_format_or_length" }, { XEVNT_TSP & ~CRPT_EVENT, "bad_timestamp" }, { XEVNT_FSP & ~CRPT_EVENT, "bad_filestamp" }, { XEVNT_PUB & ~CRPT_EVENT, "bad_or_missing_public_key" }, { XEVNT_MD & ~CRPT_EVENT, "unsupported_digest_type" }, { XEVNT_KEY & ~CRPT_EVENT, "unsupported_identity_type" }, { XEVNT_SGL & ~CRPT_EVENT, "bad_signature_length" }, { XEVNT_SIG & ~CRPT_EVENT, "signature_not_verified" }, { XEVNT_VFY & ~CRPT_EVENT, "certificate_not_verified" }, { XEVNT_PER & ~CRPT_EVENT, "host_certificate_expired" }, { XEVNT_CKY & ~CRPT_EVENT, "bad_or_missing_cookie" }, { XEVNT_DAT & ~CRPT_EVENT, "bad_or_missing_leapseconds" }, { XEVNT_CRT & ~CRPT_EVENT, "bad_or_missing_certificate" }, { XEVNT_ID & ~CRPT_EVENT, "bad_or_missing_group key" }, { XEVNT_ERR & ~CRPT_EVENT, "protocol_error" }, { -1, "" } }; #endif /* OPENSSL */ /* Forwards */ static const char *getcode (int, struct codestring *); static const char *getevents (int); /* * getcode - return string corresponding to code */ static const char * getcode( int code, struct codestring *codetab ) { static char buf[30]; while (codetab->code != -1) { if (codetab->code == code) return codetab->string; codetab++; } snprintf(buf, sizeof(buf), "%s_%d", codetab->string, code); return buf; } /* * getevents - return a descriptive string for the event count */ static const char * getevents( int cnt ) { static char buf[20]; if (cnt == 0) return "no events"; snprintf(buf, sizeof(buf), "%d event%s", cnt, (cnt==1) ? "" : "s"); return buf; } /* * statustoa - return a descriptive string for a peer status */ char * statustoa( int type, int st ) { char *cb; u_char pst; LIB_GETBUF(cb); switch (type) { case TYPE_SYS: strcpy(cb, getcode(CTL_SYS_LI(st), leap_codes)); strcat(cb, ", "); strcat(cb, getcode(CTL_SYS_SOURCE(st), sync_codes)); strcat(cb, ", "); strcat(cb, getevents(CTL_SYS_NEVNT(st))); strcat(cb, ", "); strcat(cb, getcode(CTL_SYS_EVENT(st), sys_codes)); break; case TYPE_PEER: /* * Handcraft the bits */ pst = (u_char) CTL_PEER_STATVAL(st); if (pst & CTL_PST_CONFIG) strcpy(cb, "conf"); if (pst & CTL_PST_AUTHENABLE) { if (pst & CTL_PST_CONFIG) strcat(cb, ", authenb"); else strcat(cb, "authenb"); } if (pst & CTL_PST_AUTHENTIC) { if (pst & (CTL_PST_CONFIG | CTL_PST_AUTHENABLE)) strcat(cb, ", auth"); else strcat(cb, "auth"); } if (pst & CTL_PST_REACH) { if (pst & (CTL_PST_CONFIG | CTL_PST_AUTHENABLE | CTL_PST_AUTHENTIC)) strcat(cb, ", reach"); else strcat(cb, "reach"); } if (pst & CTL_PST_BCAST) { if (pst & (CTL_PST_CONFIG | CTL_PST_AUTHENABLE | CTL_PST_AUTHENTIC | CTL_PST_REACH)) strcat(cb, ", bcst"); else strcat(cb, "bcst"); } /* * Now the codes */ strcat(cb, ", "); strcat(cb, getcode(pst & 0x7, select_codes)); strcat(cb, ", "); strcat(cb, getevents(CTL_PEER_NEVNT(st))); if (CTL_PEER_EVENT(st) != EVNT_UNSPEC) { strcat(cb, ", "); strcat(cb, getcode(CTL_PEER_EVENT(st), peer_codes)); } break; case TYPE_CLOCK: strcat(cb, ", "); strcat(cb, getevents(CTL_SYS_NEVNT(st))); strcat(cb, ", "); strcat(cb, getcode((st) & 0xf, clock_codes)); break; } return cb; } const char * eventstr( int num ) { if (num & PEER_EVENT) return (getcode(num & ~PEER_EVENT, peer_codes)); #ifdef OPENSSL else if (num & CRPT_EVENT) return (getcode(num & ~CRPT_EVENT, crypto_codes)); #endif /* OPENSSL */ else return (getcode(num, sys_codes)); } const char * ceventstr( int num ) { return getcode(num, clock_codes); } ntp-4.2.6p5/libntp/audio.c0000644000175000017500000003066411616416167014370 0ustar peterpeter/* * audio.c - audio interface for reference clock audio drivers */ #ifdef HAVE_CONFIG_H # include #endif #if defined(HAVE_SYS_AUDIOIO_H) || defined(HAVE_SUN_AUDIOIO_H) || \ defined(HAVE_SYS_SOUNDCARD_H) || defined(HAVE_MACHINE_SOUNDCARD_H) #include "audio.h" #include "ntp_stdlib.h" #include "ntp_syslog.h" #ifdef HAVE_UNISTD_H # include #endif #include #include "ntp_string.h" #ifdef HAVE_SYS_AUDIOIO_H # include #endif /* HAVE_SYS_AUDIOIO_H */ #ifdef HAVE_SUN_AUDIOIO_H # include # include #endif /* HAVE_SUN_AUDIOIO_H */ #ifdef HAVE_SYS_IOCTL_H # include #endif /* HAVE_SYS_IOCTL_H */ #include #ifdef HAVE_MACHINE_SOUNDCARD_H # include # define PCM_STYLE_SOUND #else # ifdef HAVE_SYS_SOUNDCARD_H # include # define PCM_STYLE_SOUND # endif #endif #ifdef PCM_STYLE_SOUND # include #endif /* * Global variables */ #ifdef HAVE_SYS_AUDIOIO_H static struct audio_device device; /* audio device ident */ #endif /* HAVE_SYS_AUDIOIO_H */ #ifdef PCM_STYLE_SOUND # define INIT_FILE "/etc/ntp.audio" int agc = SOUND_MIXER_WRITE_RECLEV; /* or IGAIN or LINE */ int monitor = SOUND_MIXER_WRITE_VOLUME; /* or OGAIN */ int devmask = 0; int recmask = 0; char cf_c_dev[100], cf_i_dev[100], cf_agc[100], cf_monitor[100]; const char *m_names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES; #else /* not PCM_STYLE_SOUND */ static struct audio_info info; /* audio device info */ #endif /* not PCM_STYLE_SOUND */ static int ctl_fd; /* audio control file descriptor */ #ifdef PCM_STYLE_SOUND static void audio_config_read (int, char **, char **); static int mixer_name (const char *, int); int mixer_name( const char *m_name, int m_mask ) { int i; for (i = 0; i < SOUND_MIXER_NRDEVICES; ++i) if (((1 << i) & m_mask) && !strcmp(m_names[i], m_name)) break; return (SOUND_MIXER_NRDEVICES == i) ? -1 : i ; } /* * Check: * * /etc/ntp.audio# where # is the unit number * /etc/ntp.audio.# where # is the unit number * /etc/ntp.audio * * for contents of the form: * * idev /dev/input_device * cdev /dev/control_device * agc pcm_input_device {igain,line,line1,...} * monitor pcm_monitor_device {ogain,...} * * The device names for the "agc" and "monitor" keywords * can be found by running either the "mixer" program or the * util/audio-pcm program. * * Great hunks of this subroutine were swiped from refclock_oncore.c */ static void audio_config_read( int unit, char **c_dev, /* Control device */ char **i_dev /* input device */ ) { FILE *fd; char device[20], line[100], ab[100]; snprintf(device, sizeof(device), "%s%d", INIT_FILE, unit); if ((fd = fopen(device, "r")) == NULL) { printf("audio_config_read: <%s> NO\n", device); snprintf(device, sizeof(device), "%s.%d", INIT_FILE, unit); if ((fd = fopen(device, "r")) == NULL) { printf("audio_config_read: <%s> NO\n", device); snprintf(device, sizeof(device), "%s", INIT_FILE); if ((fd = fopen(device, "r")) == NULL) { printf("audio_config_read: <%s> NO\n", device); return; } } } printf("audio_config_read: reading <%s>\n", device); while (fgets(line, sizeof line, fd)) { char *cp, *cc, *ca; int i; /* Remove comments */ if ((cp = strchr(line, '#'))) *cp = '\0'; /* Remove any trailing spaces */ for (i = strlen(line); i > 0 && isascii((int)line[i - 1]) && isspace((int)line[i - 1]); ) line[--i] = '\0'; /* Remove leading space */ for (cc = line; *cc && isascii((int)*cc) && isspace((int)*cc); cc++) continue; /* Stop if nothing left */ if (!*cc) continue; /* Uppercase the command and find the arg */ for (ca = cc; *ca; ca++) { if (isascii((int)*ca)) { if (islower((int)*ca)) { *ca = toupper(*ca); } else if (isspace((int)*ca) || (*ca == '=')) break; } } /* Remove space (and possible =) leading the arg */ for (; *ca && isascii((int)*ca) && (isspace((int)*ca) || (*ca == '=')); ca++) continue; if (!strncmp(cc, "IDEV", 4) && 1 == sscanf(ca, "%99s", ab)) { strncpy(cf_i_dev, ab, sizeof(cf_i_dev)); printf("idev <%s>\n", ab); } else if (!strncmp(cc, "CDEV", 4) && 1 == sscanf(ca, "%99s", ab)) { strncpy(cf_c_dev, ab, sizeof(cf_c_dev)); printf("cdev <%s>\n", ab); } else if (!strncmp(cc, "AGC", 3) && 1 == sscanf(ca, "%99s", ab)) { strncpy(cf_agc, ab, sizeof(cf_agc)); printf("agc <%s> %d\n", ab, i); } else if (!strncmp(cc, "MONITOR", 7) && 1 == sscanf(ca, "%99s", ab)) { strncpy(cf_monitor, ab, sizeof(cf_monitor)); printf("monitor <%s> %d\n", ab, mixer_name(ab, -1)); } } fclose(fd); return; } #endif /* PCM_STYLE_SOUND */ /* * audio_init - open and initialize audio device * * This code works with SunOS 4.x, Solaris 2.x, and PCM; however, it is * believed generic and applicable to other systems with a minor twid * or two. All it does is open the device, set the buffer size (Solaris * only), preset the gain and set the input port. It assumes that the * codec sample rate (8000 Hz), precision (8 bits), number of channels * (1) and encoding (ITU-T G.711 mu-law companded) have been set by * default. */ int audio_init( char *dname, /* device name */ int bufsiz, /* buffer size */ int unit /* device unit (0-3) */ ) { #ifdef PCM_STYLE_SOUND # define ACTL_DEV "/dev/mixer%d" char actl_dev[30]; # ifdef HAVE_STRUCT_SND_SIZE struct snd_size s_size; # endif # ifdef AIOGFMT snd_chan_param s_c_p; # endif #endif int fd; int rval; char *actl = #ifdef PCM_STYLE_SOUND actl_dev #else "/dev/audioctl" #endif ; #ifdef PCM_STYLE_SOUND snprintf(actl_dev, sizeof(actl_dev), ACTL_DEV, unit); audio_config_read(unit, &actl, &dname); /* If we have values for cf_c_dev or cf_i_dev, use them. */ if (*cf_c_dev) actl = cf_c_dev; if (*cf_i_dev) dname = cf_i_dev; #endif /* * Open audio device */ fd = open(dname, O_RDWR | O_NONBLOCK, 0777); if (fd < 0) { msyslog(LOG_ERR, "audio_init: %s %m\n", dname); return (fd); } /* * Open audio control device. */ ctl_fd = open(actl, O_RDWR); if (ctl_fd < 0) { msyslog(LOG_ERR, "audio_init: invalid control device <%s>\n", actl); close(fd); return(ctl_fd); } /* * Set audio device parameters. */ #ifdef PCM_STYLE_SOUND printf("audio_init: <%s> bufsiz %d\n", dname, bufsiz); rval = fd; # ifdef HAVE_STRUCT_SND_SIZE if (ioctl(fd, AIOGSIZE, &s_size) == -1) printf("audio_init: AIOGSIZE: %s\n", strerror(errno)); else printf("audio_init: orig: play_size %d, rec_size %d\n", s_size.play_size, s_size.rec_size); s_size.play_size = s_size.rec_size = bufsiz; printf("audio_init: want: play_size %d, rec_size %d\n", s_size.play_size, s_size.rec_size); if (ioctl(fd, AIOSSIZE, &s_size) == -1) printf("audio_init: AIOSSIZE: %s\n", strerror(errno)); else printf("audio_init: set: play_size %d, rec_size %d\n", s_size.play_size, s_size.rec_size); # endif /* HAVE_STRUCT_SND_SIZE */ # ifdef SNDCTL_DSP_SETFRAGMENT { int tmp = (16 << 16) + 6; /* 16 fragments, each 2^6 bytes */ if (ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &tmp) == -1) printf("audio_init: SNDCTL_DSP_SETFRAGMENT: %s\n", strerror(errno)); } # endif /* SNDCTL_DSP_SETFRAGMENT */ # ifdef AIOGFMT if (ioctl(fd, AIOGFMT, &s_c_p) == -1) printf("audio_init: AIOGFMT: %s\n", strerror(errno)); else printf("audio_init: play_rate %lu, rec_rate %lu, play_format %#lx, rec_format %#lx\n", s_c_p.play_rate, s_c_p.rec_rate, s_c_p.play_format, s_c_p.rec_format); # endif /* Grab the device and record masks */ if (ioctl(ctl_fd, SOUND_MIXER_READ_DEVMASK, &devmask) == -1) printf("SOUND_MIXER_READ_DEVMASK: %s\n", strerror(errno)); if (ioctl(ctl_fd, SOUND_MIXER_READ_RECMASK, &recmask) == -1) printf("SOUND_MIXER_READ_RECMASK: %s\n", strerror(errno)); /* validate and set any specified config file stuff */ if (cf_agc[0] != '\0') { int i; i = mixer_name(cf_agc, devmask); if (i >= 0) agc = MIXER_WRITE(i); else printf("input %s not in recmask %#x\n", cf_agc, recmask); } if (cf_monitor[0] != '\0') { int i; /* devmask */ i = mixer_name(cf_monitor, devmask); if (i >= 0) monitor = MIXER_WRITE(i); else printf("monitor %s not in devmask %#x\n", cf_monitor, devmask); } #else /* not PCM_STYLE_SOUND */ AUDIO_INITINFO(&info); info.play.gain = AUDIO_MAX_GAIN; info.play.port = AUDIO_SPEAKER; # ifdef HAVE_SYS_AUDIOIO_H info.record.buffer_size = bufsiz; # endif /* HAVE_SYS_AUDIOIO_H */ rval = ioctl(ctl_fd, (int)AUDIO_SETINFO, (char *)&info); if (rval < 0) { msyslog(LOG_ERR, "audio: invalid control device parameters\n"); close(ctl_fd); close(fd); return(rval); } rval = fd; #endif /* not PCM_STYLE_SOUND */ return (rval); } /* * audio_gain - adjust codec gains and port */ int audio_gain( int gain, /* volume level (gain) 0-255 */ int mongain, /* input to output mix (monitor gain) 0-255 */ int port /* selected I/O port: 1 mic/2 line in */ ) { int rval; static int o_mongain = -1; static int o_port = -1; #ifdef PCM_STYLE_SOUND int l, r; rval = 0; r = l = 100 * gain / 255; /* Normalize to 0-100 */ # ifdef DEBUG if (debug > 1) printf("audio_gain: gain %d/%d\n", gain, l); # endif #if 0 /* not a good idea to do this; connector wiring dependency */ /* figure out what channel(s) to use. just nuke right for now. */ r = 0 ; /* setting to zero nicely mutes the channel */ #endif l |= r << 8; if (cf_agc[0] != '\0') rval = ioctl(ctl_fd, agc, &l); else if (2 == port) rval = ioctl(ctl_fd, SOUND_MIXER_WRITE_LINE, &l); else rval = ioctl(ctl_fd, SOUND_MIXER_WRITE_MIC, &l); if (-1 == rval) { printf("audio_gain: agc write: %s\n", strerror(errno)); return rval; } if (o_mongain != mongain) { r = l = 100 * mongain / 255; /* Normalize to 0-100 */ # ifdef DEBUG if (debug > 1) printf("audio_gain: mongain %d/%d\n", mongain, l); # endif l |= r << 8; if (cf_monitor[0] != '\0') rval = ioctl(ctl_fd, monitor, &l ); else rval = ioctl(ctl_fd, SOUND_MIXER_WRITE_VOLUME, &l); if (-1 == rval) { printf("audio_gain: mongain write: %s\n", strerror(errno)); return (rval); } o_mongain = mongain; } if (o_port != port) { # ifdef DEBUG if (debug > 1) printf("audio_gain: port %d\n", port); # endif l = (1 << ((port == 2) ? SOUND_MIXER_LINE : SOUND_MIXER_MIC)); rval = ioctl(ctl_fd, SOUND_MIXER_WRITE_RECSRC, &l); if (rval == -1) { printf("SOUND_MIXER_WRITE_RECSRC: %s\n", strerror(errno)); return (rval); } # ifdef DEBUG if (debug > 1) { if (ioctl(ctl_fd, SOUND_MIXER_READ_RECSRC, &l) == -1) printf("SOUND_MIXER_WRITE_RECSRC: %s\n", strerror(errno)); else printf("audio_gain: recsrc is %d\n", l); } # endif o_port = port; } #else /* not PCM_STYLE_SOUND */ ioctl(ctl_fd, (int)AUDIO_GETINFO, (char *)&info); info.record.encoding = AUDIO_ENCODING_ULAW; info.record.error = 0; info.record.gain = gain; if (o_mongain != mongain) o_mongain = info.monitor_gain = mongain; if (o_port != port) o_port = info.record.port = port; rval = ioctl(ctl_fd, (int)AUDIO_SETINFO, (char *)&info); if (rval < 0) { msyslog(LOG_ERR, "audio_gain: %m"); return (rval); } rval = info.record.error; #endif /* not PCM_STYLE_SOUND */ return (rval); } /* * audio_show - display audio parameters * * This code doesn't really do anything, except satisfy curiousity and * verify the ioctl's work. */ void audio_show(void) { #ifdef PCM_STYLE_SOUND int recsrc = 0; printf("audio_show: ctl_fd %d\n", ctl_fd); if (ioctl(ctl_fd, SOUND_MIXER_READ_RECSRC, &recsrc) == -1) printf("SOUND_MIXER_READ_RECSRC: %s\n", strerror(errno)); #else /* not PCM_STYLE_SOUND */ # ifdef HAVE_SYS_AUDIOIO_H ioctl(ctl_fd, (int)AUDIO_GETDEV, &device); printf("audio: name %s, version %s, config %s\n", device.name, device.version, device.config); # endif /* HAVE_SYS_AUDIOIO_H */ ioctl(ctl_fd, (int)AUDIO_GETINFO, (char *)&info); printf( "audio: rate %d, chan %d, prec %d, code %d, gain %d, mon %d, port %d\n", info.record.sample_rate, info.record.channels, info.record.precision, info.record.encoding, info.record.gain, info.monitor_gain, info.record.port); printf( "audio: samples %d, eof %d, pause %d, error %d, waiting %d, balance %d\n", info.record.samples, info.record.eof, info.record.pause, info.record.error, info.record.waiting, info.record.balance); #endif /* not PCM_STYLE_SOUND */ } #else int audio_bs; #endif /* HAVE_{SYS_AUDIOIO,SUN_AUDIOIO,MACHINE_SOUNDCARD,SYS_SOUNDCARD}_H */ ntp-4.2.6p5/libntp/caljulian.c0000644000175000017500000001373611307651603015223 0ustar peterpeter/* * caljulian - determine the Julian date from an NTP time. */ #include #include "ntp_types.h" #include "ntp_calendar.h" #include "ntp_stdlib.h" #include "ntp_fp.h" #include "ntp_unixtime.h" #if !(defined(ISC_CHECK_ALL) || defined(ISC_CHECK_NONE) || \ defined(ISC_CHECK_ENSURE) || defined(ISC_CHECK_INSIST) || \ defined(ISC_CHECK_INVARIANT)) # define ISC_CHECK_ALL #endif #include "ntp_assert.h" #if 1 /* Updated 2008-11-10 Juergen Perlinger * * Make the conversion 2038-proof with proper NTP epoch unfolding and extended * precision calculations. Though we should really get a 'time_t' with more * than 32 bits at least until 2037, because the unfolding cannot work after * the wrap of the 32-bit 'time_t'. */ void caljulian( u_long ntptime, register struct calendar *jt ) { u_long saved_time = ntptime; u_long ntp_day; /* days (since christian era or in year) */ u_long n400; /* # of Gregorian cycles */ u_long n100; /* # of normal centuries */ u_long n4; /* # of 4-year cycles */ u_long n1; /* # of years into a leap year cycle */ u_long sclday; /* scaled days for month conversion */ int leaps; /* # of leaps days in year */ time_t now; /* current system time */ u_int32 tmplo; /* double precision tmp value / lo part */ int32 tmphi; /* double precision tmp value / hi part */ NTP_INSIST(NULL != jt); /* * First we have to unfold the ntp time stamp around the current time * to make sure we are in the right epoch. Also we we do *NOT* fold * before the begin of the first NTP epoch, so we WILL have a * non-negative time stamp afterwards. Though at the time of this * writing (2008 A.D.) it would be really strange to have systems * running with clock set to he 1960's or before... * * But's important to use a 32 bit max signed value -- LONG_MAX is 64 * bit on a 64-bit system, and it will give wrong results. */ now = time(NULL); tmplo = (u_int32)now; #if ( SIZEOF_TIME_T > 4 ) tmphi = (int32)(now >> 16 >> 16); #else /* * Get the correct sign extension in the high part. * (now >> 32) may not work correctly on every 32 bit * system, e.g. it yields garbage under Win32/VC6. */ tmphi = (int32)(now >> 31); #endif M_ADD(tmphi, tmplo, 0, ((1UL << 31)-1)); /* 32-bit max signed */ M_ADD(tmphi, tmplo, 0, JAN_1970); if ((ntptime > tmplo) && (tmphi > 0)) --tmphi; tmplo = ntptime; /* * Now split into days and seconds-of-day, using the fact that * SECSPERDAY (86400) == 675 * 128; we can get roughly 17000 years of * time scale, using only 32-bit calculations. Some magic numbers here, * sorry for that. (This could be streamlined for 64 bit machines, but * is worth the trouble?) */ ntptime = tmplo & 127; /* save remainder bits */ tmplo = (tmplo >> 7) | (tmphi << 25); ntp_day = (u_int32)tmplo / 675; ntptime += ((u_int32)tmplo % 675) << 7; /* some checks for the algorithm * There's some 64-bit trouble out there: the original NTP time stamp * had only 32 bits, so our calculation invariant only holds in 32 bits! */ NTP_ENSURE(ntptime < SECSPERDAY); NTP_INVARIANT((u_int32)(ntptime + ntp_day * SECSPERDAY) == (u_int32)saved_time); /* * Do the easy stuff first: take care of hh:mm:ss, ignoring leap * seconds */ jt->second = (u_char)(ntptime % SECSPERMIN); ntptime /= SECSPERMIN; jt->minute = (u_char)(ntptime % MINSPERHR); ntptime /= MINSPERHR; jt->hour = (u_char)(ntptime); /* check time invariants */ NTP_ENSURE(jt->second < SECSPERMIN); NTP_ENSURE(jt->minute < MINSPERHR); NTP_ENSURE(jt->hour < HRSPERDAY); /* * Find the day past 1900/01/01 00:00 UTC */ ntp_day += DAY_NTP_STARTS - 1; /* convert to days in CE */ n400 = ntp_day / GREGORIAN_CYCLE_DAYS; /* split off cycles */ ntp_day %= GREGORIAN_CYCLE_DAYS; n100 = ntp_day / GREGORIAN_NORMAL_CENTURY_DAYS; ntp_day %= GREGORIAN_NORMAL_CENTURY_DAYS; n4 = ntp_day / GREGORIAN_NORMAL_LEAP_CYCLE_DAYS; ntp_day %= GREGORIAN_NORMAL_LEAP_CYCLE_DAYS; n1 = ntp_day / DAYSPERYEAR; ntp_day %= DAYSPERYEAR; /* now zero-based day-of-year */ NTP_ENSURE(ntp_day < 366); /* * Calculate the year and day-of-year */ jt->year = (u_short)(400*n400 + 100*n100 + 4*n4 + n1); if ((n100 | n1) > 3) { /* * If the cycle year ever comes out to 4, it must be December * 31st of a leap year. */ jt->month = 12; jt->monthday = 31; jt->yearday = 366; } else { /* * The following code is according to the excellent book * 'Calendrical Calculations' by Nachum Dershowitz and Edward * Reingold. It converts the day-of-year into month and * day-of-month, using a linear transformation with integer * truncation. Magic numbers again, but they will not be used * anywhere else. */ sclday = ntp_day * 7 + 217; leaps = ((n1 == 3) && ((n4 != 24) || (n100 == 3))) ? 1 : 0; if (ntp_day >= (u_long)(JAN + FEB + leaps)) sclday += (2 - leaps) * 7; ++jt->year; jt->month = (u_char)(sclday / 214); jt->monthday = (u_char)((sclday % 214) / 7 + 1); jt->yearday = (u_short)(1 + ntp_day); } /* check date invariants */ NTP_ENSURE(1 <= jt->month && jt->month <= 12); NTP_ENSURE(1 <= jt->monthday && jt->monthday <= 31); NTP_ENSURE(1 <= jt->yearday && jt->yearday <= 366); } #else /* Updated 2003-12-30 TMa Uses common code with the *prettydate functions to convert an ntp seconds count into a calendar date. Will handle ntp epoch wraparound as long as the underlying os/library does so for the unix epoch, i.e. works after 2038. */ void caljulian( u_long ntptime, register struct calendar *jt ) { struct tm *tm; NTP_REQUIRE(jt != NULL); tm = ntp2unix_tm(ntptime, 0); NTP_INSIST(tm != NULL); jt->hour = (u_char) tm->tm_hour; jt->minute = (u_char) tm->tm_min; jt->month = (u_char) (tm->tm_mon + 1); jt->monthday = (u_char) tm->tm_mday; jt->second = (u_char) tm->tm_sec; jt->year = (u_short) (tm->tm_year + 1900); jt->yearday = (u_short) (tm->tm_yday + 1); /* Assumes tm_yday starts with day 0! */ } #endif ntp-4.2.6p5/libntp/numtohost.c0000644000175000017500000000166311307651603015315 0ustar peterpeter/* * numtohost - convert network number to host name. */ #include #include #ifdef HAVE_NETINET_IN_H #include /* ntohl */ #endif #include "ntp_fp.h" #include "ntp_stdlib.h" #include "lib_strbuf.h" #define LOOPBACKNET 0x7f000000 #define LOOPBACKHOST 0x7f000001 #define LOOPBACKNETMASK 0xff000000 char * numtohost( u_int32 netnum ) { char *bp; struct hostent *hp; /* * This is really gross, but saves lots of hanging looking for * hostnames for the radio clocks. Don't bother looking up * addresses on the loopback network except for the loopback * host itself. */ if ((((ntohl(netnum) & LOOPBACKNETMASK) == LOOPBACKNET) && (ntohl(netnum) != LOOPBACKHOST)) || ((hp = gethostbyaddr((char *)&netnum, sizeof netnum, AF_INET)) == 0)) return numtoa(netnum); LIB_GETBUF(bp); bp[LIB_BUFLENGTH-1] = '\0'; (void) strncpy(bp, hp->h_name, LIB_BUFLENGTH-1); return bp; } ntp-4.2.6p5/libntp/a_md5encrypt.c0000644000175000017500000000502011665566225015652 0ustar peterpeter/* * digest support for NTP, MD5 and with OpenSSL more */ #ifdef HAVE_CONFIG_H #include #endif #include "ntp_fp.h" #include "ntp_string.h" #include "ntp_stdlib.h" #include "ntp.h" #ifdef OPENSSL # include "openssl/evp.h" #else # include "ntp_md5.h" /* provides clone of OpenSSL MD5 API */ #endif /* * MD5authencrypt - generate message digest * * Returns length of MAC including key ID and digest. */ int MD5authencrypt( int type, /* hash algorithm */ u_char *key, /* key pointer */ u_int32 *pkt, /* packet pointer */ int length /* packet length */ ) { u_char digest[EVP_MAX_MD_SIZE]; u_int len; EVP_MD_CTX ctx; /* * Compute digest of key concatenated with packet. Note: the * key type and digest type have been verified when the key * was creaded. */ INIT_SSL(); EVP_DigestInit(&ctx, EVP_get_digestbynid(type)); EVP_DigestUpdate(&ctx, key, (u_int)cache_keylen); EVP_DigestUpdate(&ctx, (u_char *)pkt, (u_int)length); EVP_DigestFinal(&ctx, digest, &len); memmove((u_char *)pkt + length + 4, digest, len); return (len + 4); } /* * MD5authdecrypt - verify MD5 message authenticator * * Returns one if digest valid, zero if invalid. */ int MD5authdecrypt( int type, /* hash algorithm */ u_char *key, /* key pointer */ u_int32 *pkt, /* packet pointer */ int length, /* packet length */ int size /* MAC size */ ) { u_char digest[EVP_MAX_MD_SIZE]; u_int len; EVP_MD_CTX ctx; /* * Compute digest of key concatenated with packet. Note: the * key type and digest type have been verified when the key * was created. */ INIT_SSL(); EVP_DigestInit(&ctx, EVP_get_digestbynid(type)); EVP_DigestUpdate(&ctx, key, (u_int)cache_keylen); EVP_DigestUpdate(&ctx, (u_char *)pkt, (u_int)length); EVP_DigestFinal(&ctx, digest, &len); if ((u_int)size != len + 4) { msyslog(LOG_ERR, "MAC decrypt: MAC length error"); return (0); } return (!memcmp(digest, (char *)pkt + length + 4, len)); } /* * Calculate the reference id from the address. If it is an IPv4 * address, use it as is. If it is an IPv6 address, do a md5 on * it and use the bottom 4 bytes. * The result is in network byte order. */ u_int32 addr2refid(sockaddr_u *addr) { u_char digest[20]; u_int32 addr_refid; EVP_MD_CTX ctx; u_int len; if (IS_IPV4(addr)) return (NSRCADR(addr)); INIT_SSL(); EVP_DigestInit(&ctx, EVP_get_digestbynid(NID_md5)); EVP_DigestUpdate(&ctx, (u_char *)PSOCK_ADDR6(addr), sizeof(struct in6_addr)); EVP_DigestFinal(&ctx, digest, &len); memcpy(&addr_refid, digest, 4); return (addr_refid); } ntp-4.2.6p5/libntp/hextolfp.c0000644000175000017500000000243110017034555015076 0ustar peterpeter/* * hextolfp - convert an ascii hex string to an l_fp number */ #include #include #include "ntp_fp.h" #include "ntp_string.h" #include "ntp_stdlib.h" int hextolfp( const char *str, l_fp *lfp ) { register const char *cp; register const char *cpstart; register u_long dec_i; register u_long dec_f; char *ind = NULL; static const char *digits = "0123456789abcdefABCDEF"; dec_i = dec_f = 0; cp = str; /* * We understand numbers of the form: * * [spaces]8_hex_digits[.]8_hex_digits[spaces|\n|\0] */ while (isspace((int)*cp)) cp++; cpstart = cp; while (*cp != '\0' && (cp - cpstart) < 8 && (ind = strchr(digits, *cp)) != NULL) { dec_i = dec_i << 4; /* multiply by 16 */ dec_i += ((ind - digits) > 15) ? (ind - digits) - 6 : (ind - digits); cp++; } if ((cp - cpstart) < 8 || ind == NULL) return 0; if (*cp == '.') cp++; cpstart = cp; while (*cp != '\0' && (cp - cpstart) < 8 && (ind = strchr(digits, *cp)) != NULL) { dec_f = dec_f << 4; /* multiply by 16 */ dec_f += ((ind - digits) > 15) ? (ind - digits) - 6 : (ind - digits); cp++; } if ((cp - cpstart) < 8 || ind == NULL) return 0; if (*cp != '\0' && !isspace((int)*cp)) return 0; lfp->l_ui = dec_i; lfp->l_uf = dec_f; return 1; } ntp-4.2.6p5/libntp/authusekey.c0000644000175000017500000000140711307651605015442 0ustar peterpeter/* * authusekey - decode a key from ascii and use it */ #include #include #include "ntp_types.h" #include "ntp_string.h" #include "ntp_stdlib.h" /* * Types of ascii representations for keys. "Standard" means a 64 bit * hex number in NBS format, i.e. with the low order bit of each byte * a parity bit. "NTP" means a 64 bit key in NTP format, with the * high order bit of each byte a parity bit. "Ascii" means a 1-to-8 * character string whose ascii representation is used as the key. */ int authusekey( keyid_t keyno, int keytype, const u_char *str ) { const u_char *cp; int len; cp = str; len = strlen((const char *)cp); if (len == 0) return 0; MD5auth_setkey(keyno, keytype, str, (int)strlen((const char *)str)); return 1; } ntp-4.2.6p5/libntp/iosignal.c0000644000175000017500000003076711307651603015071 0ustar peterpeter/* * iosignal.c - input/output routines for ntpd. The socket-opening code * was shamelessly stolen from ntpd. */ /* * [Bug 158] * Do the #includes differently, as under some versions of Linux * sys/param.h has a #undef CONFIG_PHONE line in it. * * As we have ~40 CONFIG_ variables, I don't feel like renaming them * every time somebody adds a new macro to some system header. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #ifdef HAVE_SYS_PARAM_H # include #endif /* HAVE_SYS_PARAM_H */ #ifdef HAVE_SYS_IOCTL_H # include #endif #include #if _BSDI_VERSION >= 199510 # include #endif # ifdef __QNXNTO__ # include # include # define FNDELAY O_NDELAY # endif #include "ntp_machine.h" #include "ntpd.h" #include "ntp_io.h" #include "ntp_if.h" #include "ntp_stdlib.h" #include "iosignal.h" #if defined(HAVE_SIGNALED_IO) static int sigio_block_count = 0; # if defined(HAVE_SIGACTION) /* * If sigaction() is used for signal handling and a signal is * pending then the kernel blocks the signal before it calls * the signal handler. * * The variable below is used to take care that the SIGIO signal * is not unintentionally unblocked inside the sigio_handler() * if the handler executes a piece of code that is normally * bracketed by BLOCKIO()/UNBLOCKIO() calls. */ static int sigio_handler_active = 0; # endif extern void input_handler (l_fp *); /* * SIGPOLL and SIGIO ROUTINES. */ /* * Some systems (MOST) define SIGPOLL == SIGIO, others SIGIO == SIGPOLL, and * a few have separate SIGIO and SIGPOLL signals. This code checks for the * SIGIO == SIGPOLL case at compile time. * Do not define USE_SIGPOLL or USE_SIGIO. * these are interal only to iosignal.c! */ # if defined(USE_SIGPOLL) # undef USE_SIGPOLL # endif # if defined(USE_SIGIO) # undef USE_SIGIO # endif # if defined(USE_TTY_SIGPOLL) || defined(USE_UDP_SIGPOLL) # define USE_SIGPOLL # endif # if !defined(USE_TTY_SIGPOLL) || !defined(USE_UDP_SIGPOLL) # define USE_SIGIO # endif # if defined(USE_SIGIO) && defined(USE_SIGPOLL) # if SIGIO == SIGPOLL # define USE_SIGIO # undef USE_SIGPOLL # endif /* SIGIO == SIGPOLL */ # endif /* USE_SIGIO && USE_SIGIO */ /* * TTY initialization routines. */ int init_clock_sig( struct refclockio *rio ) { # ifdef USE_TTY_SIGPOLL { /* DO NOT ATTEMPT TO MAKE CLOCK-FD A CTTY: not portable, unreliable */ if (ioctl(rio->fd, I_SETSIG, S_INPUT) < 0) { msyslog(LOG_ERR, "init_clock_sig: ioctl(I_SETSIG, S_INPUT) failed: %m"); return 1; } return 0; } # else /* * Special cases first! */ /* Was: defined(SYS_HPUX) */ # if defined(FIOSSAIOOWN) && defined(FIOSNBIO) && defined(FIOSSAIOSTAT) #define CLOCK_DONE { int pgrp, on = 1; /* DO NOT ATTEMPT TO MAKE CLOCK-FD A CTTY: not portable, unreliable */ pgrp = getpid(); if (ioctl(rio->fd, FIOSSAIOOWN, (char *)&pgrp) == -1) { msyslog(LOG_ERR, "ioctl(FIOSSAIOOWN) fails for clock I/O: %m"); exit(1); /*NOTREACHED*/ } /* * set non-blocking, async I/O on the descriptor */ if (ioctl(rio->fd, FIOSNBIO, (char *)&on) == -1) { msyslog(LOG_ERR, "ioctl(FIOSNBIO) fails for clock I/O: %m"); exit(1); /*NOTREACHED*/ } if (ioctl(rio->fd, FIOSSAIOSTAT, (char *)&on) == -1) { msyslog(LOG_ERR, "ioctl(FIOSSAIOSTAT) fails for clock I/O: %m"); exit(1); /*NOTREACHED*/ } return 0; } # endif /* SYS_HPUX: FIOSSAIOOWN && FIOSNBIO && FIOSSAIOSTAT */ /* Was: defined(SYS_AIX) && !defined(_BSD) */ # if !defined(_BSD) && defined(_AIX) && defined(FIOASYNC) && defined(FIOSETOWN) /* * SYSV compatibility mode under AIX. */ #define CLOCK_DONE { int pgrp, on = 1; /* DO NOT ATTEMPT TO MAKE CLOCK-FD A CTTY: not portable, unreliable */ if (ioctl(rio->fd, FIOASYNC, (char *)&on) == -1) { msyslog(LOG_ERR, "ioctl(FIOASYNC) fails for clock I/O: %m"); return 1; } pgrp = -getpid(); if (ioctl(rio->fd, FIOSETOWN, (char*)&pgrp) == -1) { msyslog(LOG_ERR, "ioctl(FIOSETOWN) fails for clock I/O: %m"); return 1; } if (fcntl(rio->fd, F_SETFL, FNDELAY|FASYNC) < 0) { msyslog(LOG_ERR, "fcntl(FNDELAY|FASYNC) fails for clock I/O: %m"); return 1; } return 0; } # endif /* AIX && !BSD: !_BSD && FIOASYNC && FIOSETOWN */ # ifndef CLOCK_DONE { /* DO NOT ATTEMPT TO MAKE CLOCK-FD A CTTY: not portable, unreliable */ # if defined(TIOCSCTTY) && defined(USE_FSETOWNCTTY) /* * there are, however, always exceptions to the rules * one is, that OSF accepts SETOWN on TTY fd's only, iff they are * CTTYs. SunOS and HPUX do not semm to have this restriction. * another question is: how can you do multiple SIGIO from several * ttys (as they all should be CTTYs), wondering... * * kd 95-07-16 */ if (ioctl(rio->fd, TIOCSCTTY, 0) == -1) { msyslog(LOG_ERR, "ioctl(TIOCSCTTY, 0) fails for clock I/O: %m"); return 1; } # endif /* TIOCSCTTY && USE_FSETOWNCTTY */ if (fcntl(rio->fd, F_SETOWN, getpid()) == -1) { msyslog(LOG_ERR, "fcntl(F_SETOWN) fails for clock I/O: %m"); return 1; } if (fcntl(rio->fd, F_SETFL, FNDELAY|FASYNC) < 0) { msyslog(LOG_ERR, "fcntl(FNDELAY|FASYNC) fails for clock I/O: %m"); return 1; } return 0; } # endif /* CLOCK_DONE */ # endif /* !USE_TTY_SIGPOLL */ } void init_socket_sig( int fd ) { # ifdef USE_UDP_SIGPOLL { if (ioctl(fd, I_SETSIG, S_INPUT) < 0) { msyslog(LOG_ERR, "init_socket_sig: ioctl(I_SETSIG, S_INPUT) failed: %m"); exit(1); } } # else /* USE_UDP_SIGPOLL */ { int pgrp; # ifdef FIOASYNC int on = 1; # endif # if defined(FIOASYNC) if (ioctl(fd, FIOASYNC, (char *)&on) == -1) { msyslog(LOG_ERR, "ioctl(FIOASYNC) fails: %m"); exit(1); /*NOTREACHED*/ } # elif defined(FASYNC) { int flags; if ((flags = fcntl(fd, F_GETFL, 0)) == -1) { msyslog(LOG_ERR, "fcntl(F_GETFL) fails: %m"); exit(1); /*NOTREACHED*/ } if (fcntl(fd, F_SETFL, flags|FASYNC) < 0) { msyslog(LOG_ERR, "fcntl(...|FASYNC) fails: %m"); exit(1); /*NOTREACHED*/ } } # else # include "Bletch: Need asynchronous I/O!" # endif # ifdef UDP_BACKWARDS_SETOWN pgrp = -getpid(); # else pgrp = getpid(); # endif # if defined(SIOCSPGRP) if (ioctl(fd, SIOCSPGRP, (char *)&pgrp) == -1) { msyslog(LOG_ERR, "ioctl(SIOCSPGRP) fails: %m"); exit(1); /*NOTREACHED*/ } # elif defined(FIOSETOWN) if (ioctl(fd, FIOSETOWN, (char*)&pgrp) == -1) { msyslog(LOG_ERR, "ioctl(FIOSETOWN) fails: %m"); exit(1); /*NOTREACHED*/ } # elif defined(F_SETOWN) if (fcntl(fd, F_SETOWN, pgrp) == -1) { msyslog(LOG_ERR, "fcntl(F_SETOWN) fails: %m"); exit(1); /*NOTREACHED*/ } # else # include "Bletch: Need to set process(group) to receive SIG(IO|POLL)" # endif } # endif /* USE_UDP_SIGPOLL */ } RETSIGTYPE sigio_handler( int sig ) { int saved_errno = errno; l_fp ts; get_systime(&ts); # if defined(HAVE_SIGACTION) sigio_handler_active++; if (sigio_handler_active != 1) /* This should never happen! */ msyslog(LOG_ERR, "sigio_handler: sigio_handler_active != 1"); # endif (void)input_handler(&ts); # if defined(HAVE_SIGACTION) sigio_handler_active--; if (sigio_handler_active != 0) /* This should never happen! */ msyslog(LOG_ERR, "sigio_handler: sigio_handler_active != 0"); # endif errno = saved_errno; } /* * Signal support routines. */ # ifdef HAVE_SIGACTION void set_signal(void) { # ifdef USE_SIGIO (void) signal_no_reset(SIGIO, sigio_handler); # endif # ifdef USE_SIGPOLL (void) signal_no_reset(SIGPOLL, sigio_handler); # endif } void block_io_and_alarm(void) { sigset_t set; if (sigemptyset(&set)) msyslog(LOG_ERR, "block_io_and_alarm: sigemptyset() failed: %m"); # if defined(USE_SIGIO) if (sigaddset(&set, SIGIO)) msyslog(LOG_ERR, "block_io_and_alarm: sigaddset(SIGIO) failed: %m"); # endif # if defined(USE_SIGPOLL) if (sigaddset(&set, SIGPOLL)) msyslog(LOG_ERR, "block_io_and_alarm: sigaddset(SIGPOLL) failed: %m"); # endif if (sigaddset(&set, SIGALRM)) msyslog(LOG_ERR, "block_io_and_alarm: sigaddset(SIGALRM) failed: %m"); if (sigprocmask(SIG_BLOCK, &set, NULL)) msyslog(LOG_ERR, "block_io_and_alarm: sigprocmask() failed: %m"); } void block_sigio(void) { if ( sigio_handler_active == 0 ) /* not called from within signal handler */ { sigset_t set; ++sigio_block_count; if (sigio_block_count > 1) msyslog(LOG_INFO, "block_sigio: sigio_block_count > 1"); if (sigio_block_count < 1) msyslog(LOG_INFO, "block_sigio: sigio_block_count < 1"); if (sigemptyset(&set)) msyslog(LOG_ERR, "block_sigio: sigemptyset() failed: %m"); # if defined(USE_SIGIO) if (sigaddset(&set, SIGIO)) msyslog(LOG_ERR, "block_sigio: sigaddset(SIGIO) failed: %m"); # endif # if defined(USE_SIGPOLL) if (sigaddset(&set, SIGPOLL)) msyslog(LOG_ERR, "block_sigio: sigaddset(SIGPOLL) failed: %m"); # endif if (sigprocmask(SIG_BLOCK, &set, NULL)) msyslog(LOG_ERR, "block_sigio: sigprocmask() failed: %m"); } } void unblock_io_and_alarm(void) { sigset_t unset; if (sigemptyset(&unset)) msyslog(LOG_ERR, "unblock_io_and_alarm: sigemptyset() failed: %m"); # if defined(USE_SIGIO) if (sigaddset(&unset, SIGIO)) msyslog(LOG_ERR, "unblock_io_and_alarm: sigaddset(SIGIO) failed: %m"); # endif # if defined(USE_SIGPOLL) if (sigaddset(&unset, SIGPOLL)) msyslog(LOG_ERR, "unblock_io_and_alarm: sigaddset(SIGPOLL) failed: %m"); # endif if (sigaddset(&unset, SIGALRM)) msyslog(LOG_ERR, "unblock_io_and_alarm: sigaddset(SIGALRM) failed: %m"); if (sigprocmask(SIG_UNBLOCK, &unset, NULL)) msyslog(LOG_ERR, "unblock_io_and_alarm: sigprocmask() failed: %m"); } void unblock_sigio(void) { if ( sigio_handler_active == 0 ) /* not called from within signal handler */ { sigset_t unset; --sigio_block_count; if (sigio_block_count > 0) msyslog(LOG_INFO, "unblock_sigio: sigio_block_count > 0"); if (sigio_block_count < 0) msyslog(LOG_INFO, "unblock_sigio: sigio_block_count < 0"); if (sigemptyset(&unset)) msyslog(LOG_ERR, "unblock_sigio: sigemptyset() failed: %m"); # if defined(USE_SIGIO) if (sigaddset(&unset, SIGIO)) msyslog(LOG_ERR, "unblock_sigio: sigaddset(SIGIO) failed: %m"); # endif # if defined(USE_SIGPOLL) if (sigaddset(&unset, SIGPOLL)) msyslog(LOG_ERR, "unblock_sigio: sigaddset(SIGPOLL) failed: %m"); # endif if (sigprocmask(SIG_UNBLOCK, &unset, NULL)) msyslog(LOG_ERR, "unblock_sigio: sigprocmask() failed: %m"); } } void wait_for_signal(void) { sigset_t old; if (sigprocmask(SIG_UNBLOCK, NULL, &old)) msyslog(LOG_ERR, "wait_for_signal: sigprocmask() failed: %m"); # if defined(USE_SIGIO) if (sigdelset(&old, SIGIO)) msyslog(LOG_ERR, "wait_for_signal: sigdelset(SIGIO) failed: %m"); # endif # if defined(USE_SIGPOLL) if (sigdelset(&old, SIGPOLL)) msyslog(LOG_ERR, "wait_for_signal: sigdelset(SIGPOLL) failed: %m"); # endif if (sigdelset(&old, SIGALRM)) msyslog(LOG_ERR, "wait_for_signal: sigdelset(SIGALRM) failed: %m"); if (sigsuspend(&old) && (errno != EINTR)) msyslog(LOG_ERR, "wait_for_signal: sigsuspend() failed: %m"); } # else /* !HAVE_SIGACTION */ /* * Must be an old bsd system. * We assume there is no SIGPOLL. */ void block_io_and_alarm(void) { int mask; mask = sigmask(SIGIO) | sigmask(SIGALRM); if (sigblock(mask)) msyslog(LOG_ERR, "block_io_and_alarm: sigblock() failed: %m"); } void block_sigio(void) { int mask; ++sigio_block_count; if (sigio_block_count > 1) msyslog(LOG_INFO, "block_sigio: sigio_block_count > 1"); if (sigio_block_count < 1) msyslog(LOG_INFO, "block_sigio: sigio_block_count < 1"); mask = sigmask(SIGIO); if (sigblock(mask)) msyslog(LOG_ERR, "block_sigio: sigblock() failed: %m"); } void set_signal(void) { (void) signal_no_reset(SIGIO, sigio_handler); } void unblock_io_and_alarm(void) { int mask, omask; mask = sigmask(SIGIO) | sigmask(SIGALRM); omask = sigblock(0); omask &= ~mask; (void) sigsetmask(omask); } void unblock_sigio(void) { int mask, omask; --sigio_block_count; if (sigio_block_count > 0) msyslog(LOG_INFO, "unblock_sigio: sigio_block_count > 0"); if (sigio_block_count < 0) msyslog(LOG_INFO, "unblock_sigio: sigio_block_count < 0"); mask = sigmask(SIGIO); omask = sigblock(0); omask &= ~mask; (void) sigsetmask(omask); } void wait_for_signal(void) { int mask, omask; mask = sigmask(SIGIO) | sigmask(SIGALRM); omask = sigblock(0); omask &= ~mask; if (sigpause(omask) && (errno != EINTR)) msyslog(LOG_ERR, "wait_for_signal: sigspause() failed: %m"); } # endif /* HAVE_SIGACTION */ #else int NotAnEmptyCompilationUnit; #endif ntp-4.2.6p5/libntp/emalloc.c0000644000175000017500000000343411567107101014664 0ustar peterpeter/* * emalloc - return new memory obtained from the system. Belch if none. */ #include #include "ntp_types.h" #include "ntp_malloc.h" #include "ntp_syslog.h" #include "ntp_stdlib.h" /* * When using the debug MS CRT allocator, each allocation stores the * callsite __FILE__ and __LINE__, which is then displayed at process * termination, to track down leaks. We don't want all of our * allocations to show up as coming from emalloc.c, so we preserve the * original callsite's source file and line using macros which pass * __FILE__ and __LINE__ as parameters to these routines. * Other debug malloc implementations can be used by defining * EREALLOC_IMPL() as ports/winnt/include/config.h does. */ void * ereallocz( void * ptr, size_t newsz, size_t priorsz, int zero_init #ifdef EREALLOC_CALLSITE /* ntp_malloc.h */ , const char * file, int line #endif ) { char * mem; size_t allocsz; if (0 == newsz) allocsz = 1; else allocsz = newsz; mem = EREALLOC_IMPL(ptr, allocsz, file, line); if (NULL == mem) { msyslog_term = TRUE; #ifndef EREALLOC_CALLSITE msyslog(LOG_ERR, "fatal out of memory (%lu bytes)", (u_long)newsz); #else msyslog(LOG_ERR, "fatal out of memory %s line %d (%lu bytes)", file, line, (u_long)newsz); #endif exit(1); } if (zero_init && newsz > priorsz) zero_mem(mem + priorsz, newsz - priorsz); return mem; } char * estrdup_impl( const char * str #ifdef EREALLOC_CALLSITE , const char * file, int line #endif ) { char * copy; size_t bytes; bytes = strlen(str) + 1; copy = ereallocz(NULL, bytes, 0, FALSE #ifdef EREALLOC_CALLSITE , file, line #endif ); memcpy(copy, str, bytes); return copy; } #ifndef EREALLOC_CALLSITE void * emalloc(size_t newsz) { return ereallocz(NULL, newsz, 0, FALSE); } #endif ntp-4.2.6p5/libntp/fptoms.c0000644000175000017500000000044710017034555014562 0ustar peterpeter/* * fptoms - return an asciized s_fp number in milliseconds */ #include "ntp_fp.h" char * fptoms( s_fp fpv, short ndec ) { u_fp plusfp; int neg; if (fpv < 0) { plusfp = (u_fp)(-fpv); neg = 1; } else { plusfp = (u_fp)fpv; neg = 0; } return dofptoa(plusfp, neg, ndec, 1); } ntp-4.2.6p5/libntp/buftvtots.c0000644000175000017500000000161611307651603015313 0ustar peterpeter/* * buftvtots - pull a Unix-format (struct timeval) time stamp out of * an octet stream and convert it to a l_fp time stamp. * This is useful when using the clock line discipline. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ntp_fp.h" #include "ntp_string.h" #include "ntp_unixtime.h" #ifndef SYS_WINNT int buftvtots( const char *bufp, l_fp *ts ) { struct timeval tv; /* * copy to adhere to alignment restrictions */ memcpy(&tv, bufp, sizeof(tv)); /* * and use it */ ts->l_ui = tv.tv_sec + (u_long)JAN_1970; if (tv.tv_usec > 999999) return 0; TVUTOTSF(tv.tv_usec, ts->l_uf); return 1; } #else /* SYS_WINNT */ /* * Windows doesn't have the tty_clock line discipline, so * don't look for a timestamp where there is none. */ int buftvtots( const char *bufp, l_fp *ts ) { UNUSED_ARG(bufp); UNUSED_ARG(ts); return 0; } #endif /* SYS_WINNT */ ntp-4.2.6p5/libntp/systime.c0000644000175000017500000002170311670265725014760 0ustar peterpeter/* * systime -- routines to fiddle a UNIX clock. * * ATTENTION: Get approval from Dave Mills on all changes to this file! * */ #include "ntp_machine.h" #include "ntp_fp.h" #include "ntp_syslog.h" #include "ntp_unixtime.h" #include "ntp_stdlib.h" #include "ntp_random.h" #include "ntpd.h" /* for sys_precision */ #ifdef HAVE_SYS_PARAM_H # include #endif #ifdef HAVE_UTMP_H # include #endif /* HAVE_UTMP_H */ #ifdef HAVE_UTMPX_H # include #endif /* HAVE_UTMPX_H */ #define FUZZ 500e-6 /* fuzz pivot */ /* * These routines (get_systime, step_systime, adj_systime) implement an * interface between the system independent NTP clock and the Unix * system clock in various architectures and operating systems. Time is * a precious quantity in these routines and every effort is made to * minimize errors by unbiased rounding and amortizing adjustment * residues. * * In order to improve the apparent resolution, provide unbiased * rounding and insure that the readings cannot be predicted, the low- * order unused portion of the time below the resolution limit is filled * with an unbiased random fuzz. * * The sys_tick variable secifies the system clock tick interval in * seconds. For systems that can interpolate between timer interrupts, * the resolution is presumed much less than the time to read the system * clock, which is the value of sys_tick after the precision has been * determined. For those systems that cannot interpolate between timer * interrupts, sys_tick will be much larger in the order of 10 ms, so the * fuzz should be that value. For Sunses the tick is not interpolated, but * the system clock is derived from a 2-MHz oscillator, so the resolution * is 500 ns and sys_tick is 500 ns. */ double sys_tick = 0; /* precision (time to read the clock) */ double sys_residual = 0; /* adjustment residue (s) */ #ifndef SIM /* * get_systime - return system time in NTP timestamp format. */ void get_systime( l_fp *now /* system time */ ) { double dtemp; #if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_GETCLOCK) struct timespec ts; /* seconds and nanoseconds */ /* * Convert Unix timespec from seconds and nanoseconds to NTP * seconds and fraction. */ # ifdef HAVE_CLOCK_GETTIME clock_gettime(CLOCK_REALTIME, &ts); # else getclock(TIMEOFDAY, &ts); # endif now->l_i = (int32)ts.tv_sec + JAN_1970; dtemp = 0; if (sys_tick > FUZZ) dtemp = ntp_random() * 2. / FRAC * sys_tick * 1e9; else if (sys_tick > 0) dtemp = ntp_random() * 2. / FRAC; dtemp = (ts.tv_nsec + dtemp) * 1e-9; if (dtemp >= 1.) { dtemp -= 1.; now->l_i++; } else if (dtemp < 0) { dtemp += 1.; now->l_i--; } now->l_uf = (u_int32)(dtemp * FRAC); #else /* HAVE_CLOCK_GETTIME || HAVE_GETCLOCK */ struct timeval tv; /* seconds and microseconds */ /* * Convert Unix timeval from seconds and microseconds to NTP * seconds and fraction. */ GETTIMEOFDAY(&tv, NULL); now->l_i = tv.tv_sec + JAN_1970; dtemp = 0; if (sys_tick > FUZZ) dtemp = ntp_random() * 2. / FRAC * sys_tick * 1e6; else if (sys_tick > 0) dtemp = ntp_random() * 2. / FRAC; dtemp = (tv.tv_usec + dtemp) * 1e-6; if (dtemp >= 1.) { dtemp -= 1.; now->l_i++; } else if (dtemp < 0) { dtemp += 1.; now->l_i--; } now->l_uf = (u_int32)(dtemp * FRAC); #endif /* HAVE_CLOCK_GETTIME || HAVE_GETCLOCK */ } /* * adj_systime - adjust system time by the argument. */ #if !defined SYS_WINNT int /* 0 okay, 1 error */ adj_systime( double now /* adjustment (s) */ ) { struct timeval adjtv; /* new adjustment */ struct timeval oadjtv; /* residual adjustment */ double dtemp; long ticks; int isneg = 0; /* * Most Unix adjtime() implementations adjust the system clock * in microsecond quanta, but some adjust in 10-ms quanta. We * carefully round the adjustment to the nearest quantum, then * adjust in quanta and keep the residue for later. */ dtemp = now + sys_residual; if (dtemp < 0) { isneg = 1; dtemp = -dtemp; } adjtv.tv_sec = (long)dtemp; dtemp -= adjtv.tv_sec; ticks = (long)(dtemp / sys_tick + .5); adjtv.tv_usec = (long)(ticks * sys_tick * 1e6); dtemp -= adjtv.tv_usec / 1e6; sys_residual = dtemp; /* * Convert to signed seconds and microseconds for the Unix * adjtime() system call. Note we purposely lose the adjtime() * leftover. */ if (isneg) { adjtv.tv_sec = -adjtv.tv_sec; adjtv.tv_usec = -adjtv.tv_usec; sys_residual = -sys_residual; } if (adjtv.tv_sec != 0 || adjtv.tv_usec != 0) { if (adjtime(&adjtv, &oadjtv) < 0) { msyslog(LOG_ERR, "adj_systime: %m"); return (0); } } return (1); } #endif /* * step_systime - step the system clock. */ int step_systime( double now ) { struct timeval timetv, adjtv, oldtimetv; int isneg = 0; double dtemp; #if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_GETCLOCK) struct timespec ts; #endif dtemp = sys_residual + now; if (dtemp < 0) { isneg = 1; dtemp = - dtemp; adjtv.tv_sec = (int32)dtemp; adjtv.tv_usec = (u_int32)((dtemp - (double)adjtv.tv_sec) * 1e6 + .5); } else { adjtv.tv_sec = (int32)dtemp; adjtv.tv_usec = (u_int32)((dtemp - (double)adjtv.tv_sec) * 1e6 + .5); } #if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_GETCLOCK) # ifdef HAVE_CLOCK_GETTIME (void) clock_gettime(CLOCK_REALTIME, &ts); # else (void) getclock(TIMEOFDAY, &ts); # endif timetv.tv_sec = ts.tv_sec; timetv.tv_usec = ts.tv_nsec / 1000; #else /* not HAVE_GETCLOCK */ (void) GETTIMEOFDAY(&timetv, (struct timezone *)0); #endif /* not HAVE_GETCLOCK */ oldtimetv = timetv; #ifdef DEBUG if (debug) printf("step_systime: step %.6f residual %.6f\n", now, sys_residual); #endif if (isneg) { timetv.tv_sec -= adjtv.tv_sec; timetv.tv_usec -= adjtv.tv_usec; if (timetv.tv_usec < 0) { timetv.tv_sec--; timetv.tv_usec += 1000000; } } else { timetv.tv_sec += adjtv.tv_sec; timetv.tv_usec += adjtv.tv_usec; if (timetv.tv_usec >= 1000000) { timetv.tv_sec++; timetv.tv_usec -= 1000000; } } if (ntp_set_tod(&timetv, NULL) != 0) { msyslog(LOG_ERR, "step-systime: %m"); return (0); } sys_residual = 0; #ifdef NEED_HPUX_ADJTIME /* * CHECKME: is this correct when called by ntpdate????? */ _clear_adjtime(); #endif /* * FreeBSD, for example, has: * struct utmp { * char ut_line[UT_LINESIZE]; * char ut_name[UT_NAMESIZE]; * char ut_host[UT_HOSTSIZE]; * long ut_time; * }; * and appends line="|", name="date", host="", time for the OLD * and appends line="{", name="date", host="", time for the NEW * to _PATH_WTMP . * * Some OSes have utmp, some have utmpx. */ /* * Write old and new time entries in utmp and wtmp if step * adjustment is greater than one second. * * This might become even Uglier... */ if (oldtimetv.tv_sec != timetv.tv_sec) { #ifdef HAVE_UTMP_H struct utmp ut; #endif #ifdef HAVE_UTMPX_H struct utmpx utx; #endif #ifdef HAVE_UTMP_H memset((char *)&ut, 0, sizeof(ut)); #endif #ifdef HAVE_UTMPX_H memset((char *)&utx, 0, sizeof(utx)); #endif /* UTMP */ #ifdef UPDATE_UTMP # ifdef HAVE_PUTUTLINE ut.ut_type = OLD_TIME; (void)strcpy(ut.ut_line, OTIME_MSG); ut.ut_time = oldtimetv.tv_sec; pututline(&ut); setutent(); ut.ut_type = NEW_TIME; (void)strcpy(ut.ut_line, NTIME_MSG); ut.ut_time = timetv.tv_sec; pututline(&ut); endutent(); # else /* not HAVE_PUTUTLINE */ # endif /* not HAVE_PUTUTLINE */ #endif /* UPDATE_UTMP */ /* UTMPX */ #ifdef UPDATE_UTMPX # ifdef HAVE_PUTUTXLINE utx.ut_type = OLD_TIME; (void)strcpy(utx.ut_line, OTIME_MSG); utx.ut_tv = oldtimetv; pututxline(&utx); setutxent(); utx.ut_type = NEW_TIME; (void)strcpy(utx.ut_line, NTIME_MSG); utx.ut_tv = timetv; pututxline(&utx); endutxent(); # else /* not HAVE_PUTUTXLINE */ # endif /* not HAVE_PUTUTXLINE */ #endif /* UPDATE_UTMPX */ /* WTMP */ #ifdef UPDATE_WTMP # ifdef HAVE_PUTUTLINE utmpname(WTMP_FILE); ut.ut_type = OLD_TIME; (void)strcpy(ut.ut_line, OTIME_MSG); ut.ut_time = oldtimetv.tv_sec; pututline(&ut); ut.ut_type = NEW_TIME; (void)strcpy(ut.ut_line, NTIME_MSG); ut.ut_time = timetv.tv_sec; pututline(&ut); endutent(); # else /* not HAVE_PUTUTLINE */ # endif /* not HAVE_PUTUTLINE */ #endif /* UPDATE_WTMP */ /* WTMPX */ #ifdef UPDATE_WTMPX # ifdef HAVE_PUTUTXLINE utx.ut_type = OLD_TIME; utx.ut_tv = oldtimetv; (void)strcpy(utx.ut_line, OTIME_MSG); # ifdef HAVE_UPDWTMPX updwtmpx(WTMPX_FILE, &utx); # else /* not HAVE_UPDWTMPX */ # endif /* not HAVE_UPDWTMPX */ # else /* not HAVE_PUTUTXLINE */ # endif /* not HAVE_PUTUTXLINE */ # ifdef HAVE_PUTUTXLINE utx.ut_type = NEW_TIME; utx.ut_tv = timetv; (void)strcpy(utx.ut_line, NTIME_MSG); # ifdef HAVE_UPDWTMPX updwtmpx(WTMPX_FILE, &utx); # else /* not HAVE_UPDWTMPX */ # endif /* not HAVE_UPDWTMPX */ # else /* not HAVE_PUTUTXLINE */ # endif /* not HAVE_PUTUTXLINE */ #endif /* UPDATE_WTMPX */ } return (1); } #else /* SIM */ /* * Clock routines for the simulator - Harish Nair, with help */ /* SK: * The code that used to be here has been moved to ntpsim.c, * where, IMHO, it rightfully belonged. */ #endif ntp-4.2.6p5/lib/0000755000175000017500000000000011675461347012375 5ustar peterpeterntp-4.2.6p5/lib/isc/0000755000175000017500000000000011675461367013155 5ustar peterpeterntp-4.2.6p5/lib/isc/mem.c0000644000175000017500000014310011307651603014060 0ustar peterpeter/* * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1997-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: mem.c,v 1.145.120.4 2009/02/16 03:17:05 marka Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MCTXLOCK(m, l) if (((m)->flags & ISC_MEMFLAG_NOLOCK) == 0) LOCK(l) #define MCTXUNLOCK(m, l) if (((m)->flags & ISC_MEMFLAG_NOLOCK) == 0) UNLOCK(l) #ifndef ISC_MEM_DEBUGGING #define ISC_MEM_DEBUGGING 0 #endif LIBISC_EXTERNAL_DATA unsigned int isc_mem_debugging = ISC_MEM_DEBUGGING; /* * Constants. */ #define DEF_MAX_SIZE 1100 #define DEF_MEM_TARGET 4096 #define ALIGNMENT_SIZE 8U /*%< must be a power of 2 */ #define NUM_BASIC_BLOCKS 64 /*%< must be > 1 */ #define TABLE_INCREMENT 1024 #define DEBUGLIST_COUNT 1024 /* * Types. */ #if ISC_MEM_TRACKLINES typedef struct debuglink debuglink_t; struct debuglink { ISC_LINK(debuglink_t) link; const void *ptr[DEBUGLIST_COUNT]; unsigned int size[DEBUGLIST_COUNT]; const char *file[DEBUGLIST_COUNT]; unsigned int line[DEBUGLIST_COUNT]; unsigned int count; }; #define FLARG_PASS , file, line #define FLARG , const char *file, int line #else #define FLARG_PASS #define FLARG #endif typedef struct element element; struct element { element * next; }; typedef struct { /*! * This structure must be ALIGNMENT_SIZE bytes. */ union { size_t size; isc_mem_t *ctx; char bytes[ALIGNMENT_SIZE]; } u; } size_info; struct stats { unsigned long gets; unsigned long totalgets; unsigned long blocks; unsigned long freefrags; }; #define MEM_MAGIC ISC_MAGIC('M', 'e', 'm', 'C') #define VALID_CONTEXT(c) ISC_MAGIC_VALID(c, MEM_MAGIC) #if ISC_MEM_TRACKLINES typedef ISC_LIST(debuglink_t) debuglist_t; #endif /* List of all active memory contexts. */ static ISC_LIST(isc_mem_t) contexts; static isc_once_t once = ISC_ONCE_INIT; static isc_mutex_t lock; /*% * Total size of lost memory due to a bug of external library. * Locked by the global lock. */ static isc_uint64_t totallost; struct isc_mem { unsigned int magic; isc_ondestroy_t ondestroy; unsigned int flags; isc_mutex_t lock; isc_memalloc_t memalloc; isc_memfree_t memfree; void * arg; size_t max_size; isc_boolean_t checkfree; struct stats * stats; unsigned int references; char name[16]; void * tag; size_t quota; size_t total; size_t inuse; size_t maxinuse; size_t hi_water; size_t lo_water; isc_boolean_t hi_called; isc_mem_water_t water; void * water_arg; ISC_LIST(isc_mempool_t) pools; unsigned int poolcnt; /* ISC_MEMFLAG_INTERNAL */ size_t mem_target; element ** freelists; element * basic_blocks; unsigned char ** basic_table; unsigned int basic_table_count; unsigned int basic_table_size; unsigned char * lowest; unsigned char * highest; #if ISC_MEM_TRACKLINES debuglist_t * debuglist; unsigned int debuglistcnt; #endif unsigned int memalloc_failures; ISC_LINK(isc_mem_t) link; }; #define MEMPOOL_MAGIC ISC_MAGIC('M', 'E', 'M', 'p') #define VALID_MEMPOOL(c) ISC_MAGIC_VALID(c, MEMPOOL_MAGIC) struct isc_mempool { /* always unlocked */ unsigned int magic; /*%< magic number */ isc_mutex_t *lock; /*%< optional lock */ isc_mem_t *mctx; /*%< our memory context */ /*%< locked via the memory context's lock */ ISC_LINK(isc_mempool_t) link; /*%< next pool in this mem context */ /*%< optionally locked from here down */ element *items; /*%< low water item list */ size_t size; /*%< size of each item on this pool */ unsigned int maxalloc; /*%< max number of items allowed */ unsigned int allocated; /*%< # of items currently given out */ unsigned int freecount; /*%< # of items on reserved list */ unsigned int freemax; /*%< # of items allowed on free list */ unsigned int fillcount; /*%< # of items to fetch on each fill */ /*%< Stats only. */ unsigned int gets; /*%< # of requests to this pool */ /*%< Debugging only. */ #if ISC_MEMPOOL_NAMES char name[16]; /*%< printed name in stats reports */ #endif }; /* * Private Inline-able. */ #if ! ISC_MEM_TRACKLINES #define ADD_TRACE(a, b, c, d, e) #define DELETE_TRACE(a, b, c, d, e) #else #define ADD_TRACE(a, b, c, d, e) \ do { \ if ((isc_mem_debugging & (ISC_MEM_DEBUGTRACE | \ ISC_MEM_DEBUGRECORD)) != 0 && \ b != NULL) \ add_trace_entry(a, b, c, d, e); \ } while (0) #define DELETE_TRACE(a, b, c, d, e) delete_trace_entry(a, b, c, d, e) static void print_active(isc_mem_t *ctx, FILE *out); /*! * mctx must be locked. */ static inline void add_trace_entry(isc_mem_t *mctx, const void *ptr, unsigned int size FLARG) { debuglink_t *dl; unsigned int i; if ((isc_mem_debugging & ISC_MEM_DEBUGTRACE) != 0) fprintf(stderr, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_ADDTRACE, "add %p size %u " "file %s line %u mctx %p\n"), ptr, size, file, line, mctx); if (mctx->debuglist == NULL) return; if (size > mctx->max_size) size = mctx->max_size; dl = ISC_LIST_HEAD(mctx->debuglist[size]); while (dl != NULL) { if (dl->count == DEBUGLIST_COUNT) goto next; for (i = 0; i < DEBUGLIST_COUNT; i++) { if (dl->ptr[i] == NULL) { dl->ptr[i] = ptr; dl->size[i] = size; dl->file[i] = file; dl->line[i] = line; dl->count++; return; } } next: dl = ISC_LIST_NEXT(dl, link); } dl = malloc(sizeof(debuglink_t)); INSIST(dl != NULL); ISC_LINK_INIT(dl, link); for (i = 1; i < DEBUGLIST_COUNT; i++) { dl->ptr[i] = NULL; dl->size[i] = 0; dl->file[i] = NULL; dl->line[i] = 0; } dl->ptr[0] = ptr; dl->size[0] = size; dl->file[0] = file; dl->line[0] = line; dl->count = 1; ISC_LIST_PREPEND(mctx->debuglist[size], dl, link); mctx->debuglistcnt++; } static inline void delete_trace_entry(isc_mem_t *mctx, const void *ptr, unsigned int size, const char *file, unsigned int line) { debuglink_t *dl; unsigned int i; if ((isc_mem_debugging & ISC_MEM_DEBUGTRACE) != 0) fprintf(stderr, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_DELTRACE, "del %p size %u " "file %s line %u mctx %p\n"), ptr, size, file, line, mctx); if (mctx->debuglist == NULL) return; if (size > mctx->max_size) size = mctx->max_size; dl = ISC_LIST_HEAD(mctx->debuglist[size]); while (dl != NULL) { for (i = 0; i < DEBUGLIST_COUNT; i++) { if (dl->ptr[i] == ptr) { dl->ptr[i] = NULL; dl->size[i] = 0; dl->file[i] = NULL; dl->line[i] = 0; INSIST(dl->count > 0); dl->count--; if (dl->count == 0) { ISC_LIST_UNLINK(mctx->debuglist[size], dl, link); free(dl); } return; } } dl = ISC_LIST_NEXT(dl, link); } /* * If we get here, we didn't find the item on the list. We're * screwed. */ INSIST(dl != NULL); } #endif /* ISC_MEM_TRACKLINES */ static inline size_t rmsize(size_t size) { /* * round down to ALIGNMENT_SIZE */ return (size & (~(ALIGNMENT_SIZE - 1))); } static inline size_t quantize(size_t size) { /*! * Round up the result in order to get a size big * enough to satisfy the request and be aligned on ALIGNMENT_SIZE * byte boundaries. */ if (size == 0U) return (ALIGNMENT_SIZE); return ((size + ALIGNMENT_SIZE - 1) & (~(ALIGNMENT_SIZE - 1))); } static inline isc_boolean_t more_basic_blocks(isc_mem_t *ctx) { void *new; unsigned char *curr, *next; unsigned char *first, *last; unsigned char **table; unsigned int table_size; size_t increment; int i; /* Require: we hold the context lock. */ /* * Did we hit the quota for this context? */ increment = NUM_BASIC_BLOCKS * ctx->mem_target; if (ctx->quota != 0U && ctx->total + increment > ctx->quota) return (ISC_FALSE); INSIST(ctx->basic_table_count <= ctx->basic_table_size); if (ctx->basic_table_count == ctx->basic_table_size) { table_size = ctx->basic_table_size + TABLE_INCREMENT; table = (ctx->memalloc)(ctx->arg, table_size * sizeof(unsigned char *)); if (table == NULL) { ctx->memalloc_failures++; return (ISC_FALSE); } if (ctx->basic_table_size != 0) { memcpy(table, ctx->basic_table, ctx->basic_table_size * sizeof(unsigned char *)); (ctx->memfree)(ctx->arg, ctx->basic_table); } ctx->basic_table = table; ctx->basic_table_size = table_size; } new = (ctx->memalloc)(ctx->arg, NUM_BASIC_BLOCKS * ctx->mem_target); if (new == NULL) { ctx->memalloc_failures++; return (ISC_FALSE); } ctx->total += increment; ctx->basic_table[ctx->basic_table_count] = new; ctx->basic_table_count++; curr = new; next = curr + ctx->mem_target; for (i = 0; i < (NUM_BASIC_BLOCKS - 1); i++) { ((element *)curr)->next = (element *)next; curr = next; next += ctx->mem_target; } /* * curr is now pointing at the last block in the * array. */ ((element *)curr)->next = NULL; first = new; last = first + NUM_BASIC_BLOCKS * ctx->mem_target - 1; if (first < ctx->lowest || ctx->lowest == NULL) ctx->lowest = first; if (last > ctx->highest) ctx->highest = last; ctx->basic_blocks = new; return (ISC_TRUE); } static inline isc_boolean_t more_frags(isc_mem_t *ctx, size_t new_size) { int i, frags; size_t total_size; void *new; unsigned char *curr, *next; /*! * Try to get more fragments by chopping up a basic block. */ if (ctx->basic_blocks == NULL) { if (!more_basic_blocks(ctx)) { /* * We can't get more memory from the OS, or we've * hit the quota for this context. */ /* * XXXRTH "At quota" notification here. */ return (ISC_FALSE); } } total_size = ctx->mem_target; new = ctx->basic_blocks; ctx->basic_blocks = ctx->basic_blocks->next; frags = total_size / new_size; ctx->stats[new_size].blocks++; ctx->stats[new_size].freefrags += frags; /* * Set up a linked-list of blocks of size * "new_size". */ curr = new; next = curr + new_size; total_size -= new_size; for (i = 0; i < (frags - 1); i++) { ((element *)curr)->next = (element *)next; curr = next; next += new_size; total_size -= new_size; } /* * Add the remaining fragment of the basic block to a free list. */ total_size = rmsize(total_size); if (total_size > 0U) { ((element *)next)->next = ctx->freelists[total_size]; ctx->freelists[total_size] = (element *)next; ctx->stats[total_size].freefrags++; } /* * curr is now pointing at the last block in the * array. */ ((element *)curr)->next = NULL; ctx->freelists[new_size] = new; return (ISC_TRUE); } static inline void * mem_getunlocked(isc_mem_t *ctx, size_t size) { size_t new_size = quantize(size); void *ret; if (size >= ctx->max_size || new_size >= ctx->max_size) { /* * memget() was called on something beyond our upper limit. */ if (ctx->quota != 0U && ctx->total + size > ctx->quota) { ret = NULL; goto done; } ret = (ctx->memalloc)(ctx->arg, size); if (ret == NULL) { ctx->memalloc_failures++; goto done; } ctx->total += size; ctx->inuse += size; ctx->stats[ctx->max_size].gets++; ctx->stats[ctx->max_size].totalgets++; /* * If we don't set new_size to size, then the * ISC_MEM_FILL code might write over bytes we * don't own. */ new_size = size; goto done; } /* * If there are no blocks in the free list for this size, get a chunk * of memory and then break it up into "new_size"-sized blocks, adding * them to the free list. */ if (ctx->freelists[new_size] == NULL && !more_frags(ctx, new_size)) return (NULL); /* * The free list uses the "rounded-up" size "new_size". */ ret = ctx->freelists[new_size]; ctx->freelists[new_size] = ctx->freelists[new_size]->next; /* * The stats[] uses the _actual_ "size" requested by the * caller, with the caveat (in the code above) that "size" >= the * max. size (max_size) ends up getting recorded as a call to * max_size. */ ctx->stats[size].gets++; ctx->stats[size].totalgets++; ctx->stats[new_size].freefrags--; ctx->inuse += new_size; done: #if ISC_MEM_FILL if (ret != NULL) memset(ret, 0xbe, new_size); /* Mnemonic for "beef". */ #endif return (ret); } #if ISC_MEM_FILL && ISC_MEM_CHECKOVERRUN static inline void check_overrun(void *mem, size_t size, size_t new_size) { unsigned char *cp; cp = (unsigned char *)mem; cp += size; while (size < new_size) { INSIST(*cp == 0xbe); cp++; size++; } } #endif static inline void mem_putunlocked(isc_mem_t *ctx, void *mem, size_t size) { size_t new_size = quantize(size); if (size == ctx->max_size || new_size >= ctx->max_size) { /* * memput() called on something beyond our upper limit. */ #if ISC_MEM_FILL memset(mem, 0xde, size); /* Mnemonic for "dead". */ #endif (ctx->memfree)(ctx->arg, mem); INSIST(ctx->stats[ctx->max_size].gets != 0U); ctx->stats[ctx->max_size].gets--; INSIST(size <= ctx->total); ctx->inuse -= size; ctx->total -= size; return; } #if ISC_MEM_FILL #if ISC_MEM_CHECKOVERRUN check_overrun(mem, size, new_size); #endif memset(mem, 0xde, new_size); /* Mnemonic for "dead". */ #endif /* * The free list uses the "rounded-up" size "new_size". */ ((element *)mem)->next = ctx->freelists[new_size]; ctx->freelists[new_size] = (element *)mem; /* * The stats[] uses the _actual_ "size" requested by the * caller, with the caveat (in the code above) that "size" >= the * max. size (max_size) ends up getting recorded as a call to * max_size. */ INSIST(ctx->stats[size].gets != 0U); ctx->stats[size].gets--; ctx->stats[new_size].freefrags++; ctx->inuse -= new_size; } /*! * Perform a malloc, doing memory filling and overrun detection as necessary. */ static inline void * mem_get(isc_mem_t *ctx, size_t size) { char *ret; #if ISC_MEM_CHECKOVERRUN size += 1; #endif ret = (ctx->memalloc)(ctx->arg, size); if (ret == NULL) ctx->memalloc_failures++; #if ISC_MEM_FILL if (ret != NULL) memset(ret, 0xbe, size); /* Mnemonic for "beef". */ #else # if ISC_MEM_CHECKOVERRUN if (ret != NULL) ret[size-1] = 0xbe; # endif #endif return (ret); } /*! * Perform a free, doing memory filling and overrun detection as necessary. */ static inline void mem_put(isc_mem_t *ctx, void *mem, size_t size) { #if ISC_MEM_CHECKOVERRUN INSIST(((unsigned char *)mem)[size] == 0xbe); #endif #if ISC_MEM_FILL memset(mem, 0xde, size); /* Mnemonic for "dead". */ #else UNUSED(size); #endif (ctx->memfree)(ctx->arg, mem); } /*! * Update internal counters after a memory get. */ static inline void mem_getstats(isc_mem_t *ctx, size_t size) { ctx->total += size; ctx->inuse += size; if (size > ctx->max_size) { ctx->stats[ctx->max_size].gets++; ctx->stats[ctx->max_size].totalgets++; } else { ctx->stats[size].gets++; ctx->stats[size].totalgets++; } } /*! * Update internal counters after a memory put. */ static inline void mem_putstats(isc_mem_t *ctx, void *ptr, size_t size) { UNUSED(ptr); INSIST(ctx->inuse >= size); ctx->inuse -= size; if (size > ctx->max_size) { INSIST(ctx->stats[ctx->max_size].gets > 0U); ctx->stats[ctx->max_size].gets--; } else { INSIST(ctx->stats[size].gets > 0U); ctx->stats[size].gets--; } } /* * Private. */ static void * default_memalloc(void *arg, size_t size) { UNUSED(arg); if (size == 0U) size = 1; return (malloc(size)); } static void default_memfree(void *arg, void *ptr) { UNUSED(arg); free(ptr); } static void initialize_action(void) { RUNTIME_CHECK(isc_mutex_init(&lock) == ISC_R_SUCCESS); ISC_LIST_INIT(contexts); totallost = 0; } /* * Public. */ isc_result_t isc_mem_createx(size_t init_max_size, size_t target_size, isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg, isc_mem_t **ctxp) { return (isc_mem_createx2(init_max_size, target_size, memalloc, memfree, arg, ctxp, ISC_MEMFLAG_DEFAULT)); } isc_result_t isc_mem_createx2(size_t init_max_size, size_t target_size, isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg, isc_mem_t **ctxp, unsigned int flags) { isc_mem_t *ctx; isc_result_t result; REQUIRE(ctxp != NULL && *ctxp == NULL); REQUIRE(memalloc != NULL); REQUIRE(memfree != NULL); INSIST((ALIGNMENT_SIZE & (ALIGNMENT_SIZE - 1)) == 0); RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); ctx = (memalloc)(arg, sizeof(*ctx)); if (ctx == NULL) return (ISC_R_NOMEMORY); if ((flags & ISC_MEMFLAG_NOLOCK) == 0) { result = isc_mutex_init(&ctx->lock); if (result != ISC_R_SUCCESS) { (memfree)(arg, ctx); return (result); } } if (init_max_size == 0U) ctx->max_size = DEF_MAX_SIZE; else ctx->max_size = init_max_size; ctx->flags = flags; ctx->references = 1; memset(ctx->name, 0, sizeof(ctx->name)); ctx->tag = NULL; ctx->quota = 0; ctx->total = 0; ctx->inuse = 0; ctx->maxinuse = 0; ctx->hi_water = 0; ctx->lo_water = 0; ctx->hi_called = ISC_FALSE; ctx->water = NULL; ctx->water_arg = NULL; ctx->magic = MEM_MAGIC; isc_ondestroy_init(&ctx->ondestroy); ctx->memalloc = memalloc; ctx->memfree = memfree; ctx->arg = arg; ctx->stats = NULL; ctx->checkfree = ISC_TRUE; #if ISC_MEM_TRACKLINES ctx->debuglist = NULL; ctx->debuglistcnt = 0; #endif ISC_LIST_INIT(ctx->pools); ctx->poolcnt = 0; ctx->freelists = NULL; ctx->basic_blocks = NULL; ctx->basic_table = NULL; ctx->basic_table_count = 0; ctx->basic_table_size = 0; ctx->lowest = NULL; ctx->highest = NULL; ctx->stats = (memalloc)(arg, (ctx->max_size+1) * sizeof(struct stats)); if (ctx->stats == NULL) { result = ISC_R_NOMEMORY; goto error; } memset(ctx->stats, 0, (ctx->max_size + 1) * sizeof(struct stats)); if ((flags & ISC_MEMFLAG_INTERNAL) != 0) { if (target_size == 0U) ctx->mem_target = DEF_MEM_TARGET; else ctx->mem_target = target_size; ctx->freelists = (memalloc)(arg, ctx->max_size * sizeof(element *)); if (ctx->freelists == NULL) { result = ISC_R_NOMEMORY; goto error; } memset(ctx->freelists, 0, ctx->max_size * sizeof(element *)); } #if ISC_MEM_TRACKLINES if ((isc_mem_debugging & ISC_MEM_DEBUGRECORD) != 0) { unsigned int i; ctx->debuglist = (memalloc)(arg, (ctx->max_size+1) * sizeof(debuglist_t)); if (ctx->debuglist == NULL) { result = ISC_R_NOMEMORY; goto error; } for (i = 0; i <= ctx->max_size; i++) ISC_LIST_INIT(ctx->debuglist[i]); } #endif ctx->memalloc_failures = 0; LOCK(&lock); ISC_LIST_INITANDAPPEND(contexts, ctx, link); UNLOCK(&lock); *ctxp = ctx; return (ISC_R_SUCCESS); error: if (ctx != NULL) { if (ctx->stats != NULL) (memfree)(arg, ctx->stats); if (ctx->freelists != NULL) (memfree)(arg, ctx->freelists); #if ISC_MEM_TRACKLINES if (ctx->debuglist != NULL) (ctx->memfree)(ctx->arg, ctx->debuglist); #endif /* ISC_MEM_TRACKLINES */ if ((ctx->flags & ISC_MEMFLAG_NOLOCK) == 0) DESTROYLOCK(&ctx->lock); (memfree)(arg, ctx); } return (result); } isc_result_t isc_mem_create(size_t init_max_size, size_t target_size, isc_mem_t **ctxp) { return (isc_mem_createx2(init_max_size, target_size, default_memalloc, default_memfree, NULL, ctxp, ISC_MEMFLAG_DEFAULT)); } isc_result_t isc_mem_create2(size_t init_max_size, size_t target_size, isc_mem_t **ctxp, unsigned int flags) { return (isc_mem_createx2(init_max_size, target_size, default_memalloc, default_memfree, NULL, ctxp, flags)); } static void destroy(isc_mem_t *ctx) { unsigned int i; isc_ondestroy_t ondest; ctx->magic = 0; LOCK(&lock); ISC_LIST_UNLINK(contexts, ctx, link); totallost += ctx->inuse; UNLOCK(&lock); INSIST(ISC_LIST_EMPTY(ctx->pools)); #if ISC_MEM_TRACKLINES if (ctx->debuglist != NULL) { if (ctx->checkfree) { for (i = 0; i <= ctx->max_size; i++) { if (!ISC_LIST_EMPTY(ctx->debuglist[i])) print_active(ctx, stderr); INSIST(ISC_LIST_EMPTY(ctx->debuglist[i])); } } else { debuglink_t *dl; for (i = 0; i <= ctx->max_size; i++) for (dl = ISC_LIST_HEAD(ctx->debuglist[i]); dl != NULL; dl = ISC_LIST_HEAD(ctx->debuglist[i])) { ISC_LIST_UNLINK(ctx->debuglist[i], dl, link); free(dl); } } (ctx->memfree)(ctx->arg, ctx->debuglist); } #endif INSIST(ctx->references == 0); if (ctx->checkfree) { for (i = 0; i <= ctx->max_size; i++) { #if ISC_MEM_TRACKLINES if (ctx->stats[i].gets != 0U) print_active(ctx, stderr); #endif INSIST(ctx->stats[i].gets == 0U); } } (ctx->memfree)(ctx->arg, ctx->stats); if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { for (i = 0; i < ctx->basic_table_count; i++) (ctx->memfree)(ctx->arg, ctx->basic_table[i]); (ctx->memfree)(ctx->arg, ctx->freelists); if (ctx->basic_table != NULL) (ctx->memfree)(ctx->arg, ctx->basic_table); } ondest = ctx->ondestroy; if ((ctx->flags & ISC_MEMFLAG_NOLOCK) == 0) DESTROYLOCK(&ctx->lock); (ctx->memfree)(ctx->arg, ctx); isc_ondestroy_notify(&ondest, ctx); } void isc_mem_attach(isc_mem_t *source, isc_mem_t **targetp) { REQUIRE(VALID_CONTEXT(source)); REQUIRE(targetp != NULL && *targetp == NULL); MCTXLOCK(source, &source->lock); source->references++; MCTXUNLOCK(source, &source->lock); *targetp = source; } void isc_mem_detach(isc_mem_t **ctxp) { isc_mem_t *ctx; isc_boolean_t want_destroy = ISC_FALSE; REQUIRE(ctxp != NULL); ctx = *ctxp; REQUIRE(VALID_CONTEXT(ctx)); MCTXLOCK(ctx, &ctx->lock); INSIST(ctx->references > 0); ctx->references--; if (ctx->references == 0) want_destroy = ISC_TRUE; MCTXUNLOCK(ctx, &ctx->lock); if (want_destroy) destroy(ctx); *ctxp = NULL; } /* * isc_mem_putanddetach() is the equivalent of: * * mctx = NULL; * isc_mem_attach(ptr->mctx, &mctx); * isc_mem_detach(&ptr->mctx); * isc_mem_put(mctx, ptr, sizeof(*ptr); * isc_mem_detach(&mctx); */ void isc__mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size FLARG) { isc_mem_t *ctx; isc_boolean_t want_destroy = ISC_FALSE; size_info *si; size_t oldsize; REQUIRE(ctxp != NULL); ctx = *ctxp; REQUIRE(VALID_CONTEXT(ctx)); REQUIRE(ptr != NULL); /* * Must be before mem_putunlocked() as ctxp is usually within * [ptr..ptr+size). */ *ctxp = NULL; if ((isc_mem_debugging & (ISC_MEM_DEBUGSIZE|ISC_MEM_DEBUGCTX)) != 0) { if ((isc_mem_debugging & ISC_MEM_DEBUGSIZE) != 0) { si = &(((size_info *)ptr)[-1]); oldsize = si->u.size - ALIGNMENT_SIZE; if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) oldsize -= ALIGNMENT_SIZE; INSIST(oldsize == size); } isc__mem_free(ctx, ptr FLARG_PASS); MCTXLOCK(ctx, &ctx->lock); ctx->references--; if (ctx->references == 0) want_destroy = ISC_TRUE; MCTXUNLOCK(ctx, &ctx->lock); if (want_destroy) destroy(ctx); return; } if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { MCTXLOCK(ctx, &ctx->lock); mem_putunlocked(ctx, ptr, size); } else { mem_put(ctx, ptr, size); MCTXLOCK(ctx, &ctx->lock); mem_putstats(ctx, ptr, size); } DELETE_TRACE(ctx, ptr, size, file, line); INSIST(ctx->references > 0); ctx->references--; if (ctx->references == 0) want_destroy = ISC_TRUE; MCTXUNLOCK(ctx, &ctx->lock); if (want_destroy) destroy(ctx); } void isc_mem_destroy(isc_mem_t **ctxp) { isc_mem_t *ctx; /* * This routine provides legacy support for callers who use mctxs * without attaching/detaching. */ REQUIRE(ctxp != NULL); ctx = *ctxp; REQUIRE(VALID_CONTEXT(ctx)); MCTXLOCK(ctx, &ctx->lock); #if ISC_MEM_TRACKLINES if (ctx->references != 1) print_active(ctx, stderr); #endif REQUIRE(ctx->references == 1); ctx->references--; MCTXUNLOCK(ctx, &ctx->lock); destroy(ctx); *ctxp = NULL; } isc_result_t isc_mem_ondestroy(isc_mem_t *ctx, isc_task_t *task, isc_event_t **event) { isc_result_t res; MCTXLOCK(ctx, &ctx->lock); res = isc_ondestroy_register(&ctx->ondestroy, task, event); MCTXUNLOCK(ctx, &ctx->lock); return (res); } void * isc__mem_get(isc_mem_t *ctx, size_t size FLARG) { void *ptr; isc_boolean_t call_water = ISC_FALSE; REQUIRE(VALID_CONTEXT(ctx)); if ((isc_mem_debugging & (ISC_MEM_DEBUGSIZE|ISC_MEM_DEBUGCTX)) != 0) return (isc__mem_allocate(ctx, size FLARG_PASS)); if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { MCTXLOCK(ctx, &ctx->lock); ptr = mem_getunlocked(ctx, size); } else { ptr = mem_get(ctx, size); MCTXLOCK(ctx, &ctx->lock); if (ptr != NULL) mem_getstats(ctx, size); } ADD_TRACE(ctx, ptr, size, file, line); if (ctx->hi_water != 0U && !ctx->hi_called && ctx->inuse > ctx->hi_water) { call_water = ISC_TRUE; } if (ctx->inuse > ctx->maxinuse) { ctx->maxinuse = ctx->inuse; if (ctx->hi_water != 0U && ctx->inuse > ctx->hi_water && (isc_mem_debugging & ISC_MEM_DEBUGUSAGE) != 0) fprintf(stderr, "maxinuse = %lu\n", (unsigned long)ctx->inuse); } MCTXUNLOCK(ctx, &ctx->lock); if (call_water) (ctx->water)(ctx->water_arg, ISC_MEM_HIWATER); return (ptr); } void isc__mem_put(isc_mem_t *ctx, void *ptr, size_t size FLARG) { isc_boolean_t call_water = ISC_FALSE; size_info *si; size_t oldsize; REQUIRE(VALID_CONTEXT(ctx)); REQUIRE(ptr != NULL); if ((isc_mem_debugging & (ISC_MEM_DEBUGSIZE|ISC_MEM_DEBUGCTX)) != 0) { if ((isc_mem_debugging & ISC_MEM_DEBUGSIZE) != 0) { si = &(((size_info *)ptr)[-1]); oldsize = si->u.size - ALIGNMENT_SIZE; if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) oldsize -= ALIGNMENT_SIZE; INSIST(oldsize == size); } isc__mem_free(ctx, ptr FLARG_PASS); return; } if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { MCTXLOCK(ctx, &ctx->lock); mem_putunlocked(ctx, ptr, size); } else { mem_put(ctx, ptr, size); MCTXLOCK(ctx, &ctx->lock); mem_putstats(ctx, ptr, size); } DELETE_TRACE(ctx, ptr, size, file, line); /* * The check against ctx->lo_water == 0 is for the condition * when the context was pushed over hi_water but then had * isc_mem_setwater() called with 0 for hi_water and lo_water. */ if (ctx->hi_called && (ctx->inuse < ctx->lo_water || ctx->lo_water == 0U)) { if (ctx->water != NULL) call_water = ISC_TRUE; } MCTXUNLOCK(ctx, &ctx->lock); if (call_water) (ctx->water)(ctx->water_arg, ISC_MEM_LOWATER); } void isc_mem_waterack(isc_mem_t *ctx, int flag) { REQUIRE(VALID_CONTEXT(ctx)); MCTXLOCK(ctx, &ctx->lock); if (flag == ISC_MEM_LOWATER) ctx->hi_called = ISC_FALSE; else if (flag == ISC_MEM_HIWATER) ctx->hi_called = ISC_TRUE; MCTXUNLOCK(ctx, &ctx->lock); } #if ISC_MEM_TRACKLINES static void print_active(isc_mem_t *mctx, FILE *out) { if (mctx->debuglist != NULL) { debuglink_t *dl; unsigned int i, j; const char *format; isc_boolean_t found; fprintf(out, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_DUMPALLOC, "Dump of all outstanding " "memory allocations:\n")); found = ISC_FALSE; format = isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_PTRFILELINE, "\tptr %p size %u file %s line %u\n"); for (i = 0; i <= mctx->max_size; i++) { dl = ISC_LIST_HEAD(mctx->debuglist[i]); if (dl != NULL) found = ISC_TRUE; while (dl != NULL) { for (j = 0; j < DEBUGLIST_COUNT; j++) if (dl->ptr[j] != NULL) fprintf(out, format, dl->ptr[j], dl->size[j], dl->file[j], dl->line[j]); dl = ISC_LIST_NEXT(dl, link); } } if (!found) fprintf(out, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_NONE, "\tNone.\n")); } } #endif /* * Print the stats[] on the stream "out" with suitable formatting. */ void isc_mem_stats(isc_mem_t *ctx, FILE *out) { size_t i; const struct stats *s; const isc_mempool_t *pool; REQUIRE(VALID_CONTEXT(ctx)); MCTXLOCK(ctx, &ctx->lock); for (i = 0; i <= ctx->max_size; i++) { s = &ctx->stats[i]; if (s->totalgets == 0U && s->gets == 0U) continue; fprintf(out, "%s%5lu: %11lu gets, %11lu rem", (i == ctx->max_size) ? ">=" : " ", (unsigned long) i, s->totalgets, s->gets); if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0 && (s->blocks != 0U || s->freefrags != 0U)) fprintf(out, " (%lu bl, %lu ff)", s->blocks, s->freefrags); fputc('\n', out); } /* * Note that since a pool can be locked now, these stats might be * somewhat off if the pool is in active use at the time the stats * are dumped. The link fields are protected by the isc_mem_t's * lock, however, so walking this list and extracting integers from * stats fields is always safe. */ pool = ISC_LIST_HEAD(ctx->pools); if (pool != NULL) { fprintf(out, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_POOLSTATS, "[Pool statistics]\n")); fprintf(out, "%15s %10s %10s %10s %10s %10s %10s %10s %1s\n", isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_POOLNAME, "name"), isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_POOLSIZE, "size"), isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_POOLMAXALLOC, "maxalloc"), isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_POOLALLOCATED, "allocated"), isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_POOLFREECOUNT, "freecount"), isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_POOLFREEMAX, "freemax"), isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_POOLFILLCOUNT, "fillcount"), isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, ISC_MSG_POOLGETS, "gets"), "L"); } while (pool != NULL) { fprintf(out, "%15s %10lu %10u %10u %10u %10u %10u %10u %s\n", pool->name, (unsigned long) pool->size, pool->maxalloc, pool->allocated, pool->freecount, pool->freemax, pool->fillcount, pool->gets, (pool->lock == NULL ? "N" : "Y")); pool = ISC_LIST_NEXT(pool, link); } #if ISC_MEM_TRACKLINES print_active(ctx, out); #endif MCTXUNLOCK(ctx, &ctx->lock); } /* * Replacements for malloc() and free() -- they implicitly remember the * size of the object allocated (with some additional overhead). */ static void * isc__mem_allocateunlocked(isc_mem_t *ctx, size_t size) { size_info *si; size += ALIGNMENT_SIZE; if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) size += ALIGNMENT_SIZE; if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) si = mem_getunlocked(ctx, size); else si = mem_get(ctx, size); if (si == NULL) return (NULL); if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) { si->u.ctx = ctx; si++; } si->u.size = size; return (&si[1]); } void * isc__mem_allocate(isc_mem_t *ctx, size_t size FLARG) { size_info *si; isc_boolean_t call_water = ISC_FALSE; REQUIRE(VALID_CONTEXT(ctx)); if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { MCTXLOCK(ctx, &ctx->lock); si = isc__mem_allocateunlocked(ctx, size); } else { si = isc__mem_allocateunlocked(ctx, size); MCTXLOCK(ctx, &ctx->lock); if (si != NULL) mem_getstats(ctx, si[-1].u.size); } #if ISC_MEM_TRACKLINES ADD_TRACE(ctx, si, si[-1].u.size, file, line); #endif if (ctx->hi_water != 0U && !ctx->hi_called && ctx->inuse > ctx->hi_water) { ctx->hi_called = ISC_TRUE; call_water = ISC_TRUE; } if (ctx->inuse > ctx->maxinuse) { ctx->maxinuse = ctx->inuse; if (ctx->hi_water != 0U && ctx->inuse > ctx->hi_water && (isc_mem_debugging & ISC_MEM_DEBUGUSAGE) != 0) fprintf(stderr, "maxinuse = %lu\n", (unsigned long)ctx->inuse); } MCTXUNLOCK(ctx, &ctx->lock); if (call_water) (ctx->water)(ctx->water_arg, ISC_MEM_HIWATER); return (si); } void * isc__mem_reallocate(isc_mem_t *ctx, void *ptr, size_t size FLARG) { void *new_ptr = NULL; size_t oldsize, copysize; REQUIRE(VALID_CONTEXT(ctx)); /* * This function emulates the realloc(3) standard library function: * - if size > 0, allocate new memory; and if ptr is non NULL, copy * as much of the old contents to the new buffer and free the old one. * Note that when allocation fails the original pointer is intact; * the caller must free it. * - if size is 0 and ptr is non NULL, simply free the given ptr. * - this function returns: * pointer to the newly allocated memory, or * NULL if allocation fails or doesn't happen. */ if (size > 0U) { new_ptr = isc__mem_allocate(ctx, size FLARG_PASS); if (new_ptr != NULL && ptr != NULL) { oldsize = (((size_info *)ptr)[-1]).u.size; INSIST(oldsize >= ALIGNMENT_SIZE); oldsize -= ALIGNMENT_SIZE; copysize = oldsize > size ? size : oldsize; memcpy(new_ptr, ptr, copysize); isc__mem_free(ctx, ptr FLARG_PASS); } } else if (ptr != NULL) isc__mem_free(ctx, ptr FLARG_PASS); return (new_ptr); } void isc__mem_free(isc_mem_t *ctx, void *ptr FLARG) { size_info *si; size_t size; isc_boolean_t call_water= ISC_FALSE; REQUIRE(VALID_CONTEXT(ctx)); REQUIRE(ptr != NULL); if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) { si = &(((size_info *)ptr)[-2]); REQUIRE(si->u.ctx == ctx); size = si[1].u.size; } else { si = &(((size_info *)ptr)[-1]); size = si->u.size; } if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { MCTXLOCK(ctx, &ctx->lock); mem_putunlocked(ctx, si, size); } else { mem_put(ctx, si, size); MCTXLOCK(ctx, &ctx->lock); mem_putstats(ctx, si, size); } DELETE_TRACE(ctx, ptr, size, file, line); /* * The check against ctx->lo_water == 0 is for the condition * when the context was pushed over hi_water but then had * isc_mem_setwater() called with 0 for hi_water and lo_water. */ if (ctx->hi_called && (ctx->inuse < ctx->lo_water || ctx->lo_water == 0U)) { ctx->hi_called = ISC_FALSE; if (ctx->water != NULL) call_water = ISC_TRUE; } MCTXUNLOCK(ctx, &ctx->lock); if (call_water) (ctx->water)(ctx->water_arg, ISC_MEM_LOWATER); } /* * Other useful things. */ char * isc__mem_strdup(isc_mem_t *mctx, const char *s FLARG) { size_t len; char *ns; REQUIRE(VALID_CONTEXT(mctx)); REQUIRE(s != NULL); len = strlen(s); ns = isc__mem_allocate(mctx, len + 1 FLARG_PASS); if (ns != NULL) strncpy(ns, s, len + 1); return (ns); } void isc_mem_setdestroycheck(isc_mem_t *ctx, isc_boolean_t flag) { REQUIRE(VALID_CONTEXT(ctx)); MCTXLOCK(ctx, &ctx->lock); ctx->checkfree = flag; MCTXUNLOCK(ctx, &ctx->lock); } /* * Quotas */ void isc_mem_setquota(isc_mem_t *ctx, size_t quota) { REQUIRE(VALID_CONTEXT(ctx)); MCTXLOCK(ctx, &ctx->lock); ctx->quota = quota; MCTXUNLOCK(ctx, &ctx->lock); } size_t isc_mem_getquota(isc_mem_t *ctx) { size_t quota; REQUIRE(VALID_CONTEXT(ctx)); MCTXLOCK(ctx, &ctx->lock); quota = ctx->quota; MCTXUNLOCK(ctx, &ctx->lock); return (quota); } size_t isc_mem_inuse(isc_mem_t *ctx) { size_t inuse; REQUIRE(VALID_CONTEXT(ctx)); MCTXLOCK(ctx, &ctx->lock); inuse = ctx->inuse; MCTXUNLOCK(ctx, &ctx->lock); return (inuse); } void isc_mem_setwater(isc_mem_t *ctx, isc_mem_water_t water, void *water_arg, size_t hiwater, size_t lowater) { isc_boolean_t callwater = ISC_FALSE; isc_mem_water_t oldwater; void *oldwater_arg; REQUIRE(VALID_CONTEXT(ctx)); REQUIRE(hiwater >= lowater); MCTXLOCK(ctx, &ctx->lock); oldwater = ctx->water; oldwater_arg = ctx->water_arg; if (water == NULL) { callwater = ctx->hi_called; ctx->water = NULL; ctx->water_arg = NULL; ctx->hi_water = 0; ctx->lo_water = 0; ctx->hi_called = ISC_FALSE; } else { if (ctx->hi_called && (ctx->water != water || ctx->water_arg != water_arg || ctx->inuse < lowater || lowater == 0U)) callwater = ISC_TRUE; ctx->water = water; ctx->water_arg = water_arg; ctx->hi_water = hiwater; ctx->lo_water = lowater; ctx->hi_called = ISC_FALSE; } MCTXUNLOCK(ctx, &ctx->lock); if (callwater && oldwater != NULL) (oldwater)(oldwater_arg, ISC_MEM_LOWATER); } void isc_mem_setname(isc_mem_t *ctx, const char *name, void *tag) { REQUIRE(VALID_CONTEXT(ctx)); LOCK(&ctx->lock); memset(ctx->name, 0, sizeof(ctx->name)); strncpy(ctx->name, name, sizeof(ctx->name) - 1); ctx->tag = tag; UNLOCK(&ctx->lock); } const char * isc_mem_getname(isc_mem_t *ctx) { REQUIRE(VALID_CONTEXT(ctx)); return (ctx->name); } void * isc_mem_gettag(isc_mem_t *ctx) { REQUIRE(VALID_CONTEXT(ctx)); return (ctx->tag); } /* * Memory pool stuff */ isc_result_t isc_mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp) { isc_mempool_t *mpctx; REQUIRE(VALID_CONTEXT(mctx)); REQUIRE(size > 0U); REQUIRE(mpctxp != NULL && *mpctxp == NULL); /* * Allocate space for this pool, initialize values, and if all works * well, attach to the memory context. */ mpctx = isc_mem_get(mctx, sizeof(isc_mempool_t)); if (mpctx == NULL) return (ISC_R_NOMEMORY); mpctx->magic = MEMPOOL_MAGIC; mpctx->lock = NULL; mpctx->mctx = mctx; mpctx->size = size; mpctx->maxalloc = UINT_MAX; mpctx->allocated = 0; mpctx->freecount = 0; mpctx->freemax = 1; mpctx->fillcount = 1; mpctx->gets = 0; #if ISC_MEMPOOL_NAMES mpctx->name[0] = 0; #endif mpctx->items = NULL; *mpctxp = mpctx; MCTXLOCK(mctx, &mctx->lock); ISC_LIST_INITANDAPPEND(mctx->pools, mpctx, link); mctx->poolcnt++; MCTXUNLOCK(mctx, &mctx->lock); return (ISC_R_SUCCESS); } void isc_mempool_setname(isc_mempool_t *mpctx, const char *name) { REQUIRE(name != NULL); #if ISC_MEMPOOL_NAMES if (mpctx->lock != NULL) LOCK(mpctx->lock); strncpy(mpctx->name, name, sizeof(mpctx->name) - 1); mpctx->name[sizeof(mpctx->name) - 1] = '\0'; if (mpctx->lock != NULL) UNLOCK(mpctx->lock); #else UNUSED(mpctx); UNUSED(name); #endif } void isc_mempool_destroy(isc_mempool_t **mpctxp) { isc_mempool_t *mpctx; isc_mem_t *mctx; isc_mutex_t *lock; element *item; REQUIRE(mpctxp != NULL); mpctx = *mpctxp; REQUIRE(VALID_MEMPOOL(mpctx)); #if ISC_MEMPOOL_NAMES if (mpctx->allocated > 0) UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_mempool_destroy(): mempool %s " "leaked memory", mpctx->name); #endif REQUIRE(mpctx->allocated == 0); mctx = mpctx->mctx; lock = mpctx->lock; if (lock != NULL) LOCK(lock); /* * Return any items on the free list */ MCTXLOCK(mctx, &mctx->lock); while (mpctx->items != NULL) { INSIST(mpctx->freecount > 0); mpctx->freecount--; item = mpctx->items; mpctx->items = item->next; if ((mctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { mem_putunlocked(mctx, item, mpctx->size); } else { mem_put(mctx, item, mpctx->size); mem_putstats(mctx, item, mpctx->size); } } MCTXUNLOCK(mctx, &mctx->lock); /* * Remove our linked list entry from the memory context. */ MCTXLOCK(mctx, &mctx->lock); ISC_LIST_UNLINK(mctx->pools, mpctx, link); mctx->poolcnt--; MCTXUNLOCK(mctx, &mctx->lock); mpctx->magic = 0; isc_mem_put(mpctx->mctx, mpctx, sizeof(isc_mempool_t)); if (lock != NULL) UNLOCK(lock); *mpctxp = NULL; } void isc_mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock) { REQUIRE(VALID_MEMPOOL(mpctx)); REQUIRE(mpctx->lock == NULL); REQUIRE(lock != NULL); mpctx->lock = lock; } void * isc__mempool_get(isc_mempool_t *mpctx FLARG) { element *item; isc_mem_t *mctx; unsigned int i; REQUIRE(VALID_MEMPOOL(mpctx)); mctx = mpctx->mctx; if (mpctx->lock != NULL) LOCK(mpctx->lock); /* * Don't let the caller go over quota */ if (mpctx->allocated >= mpctx->maxalloc) { item = NULL; goto out; } /* * if we have a free list item, return the first here */ item = mpctx->items; if (item != NULL) { mpctx->items = item->next; INSIST(mpctx->freecount > 0); mpctx->freecount--; mpctx->gets++; mpctx->allocated++; goto out; } /* * We need to dip into the well. Lock the memory context here and * fill up our free list. */ MCTXLOCK(mctx, &mctx->lock); for (i = 0; i < mpctx->fillcount; i++) { if ((mctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { item = mem_getunlocked(mctx, mpctx->size); } else { item = mem_get(mctx, mpctx->size); if (item != NULL) mem_getstats(mctx, mpctx->size); } if (item == NULL) break; item->next = mpctx->items; mpctx->items = item; mpctx->freecount++; } MCTXUNLOCK(mctx, &mctx->lock); /* * If we didn't get any items, return NULL. */ item = mpctx->items; if (item == NULL) goto out; mpctx->items = item->next; mpctx->freecount--; mpctx->gets++; mpctx->allocated++; out: if (mpctx->lock != NULL) UNLOCK(mpctx->lock); #if ISC_MEM_TRACKLINES if (item != NULL) { MCTXLOCK(mctx, &mctx->lock); ADD_TRACE(mctx, item, mpctx->size, file, line); MCTXUNLOCK(mctx, &mctx->lock); } #endif /* ISC_MEM_TRACKLINES */ return (item); } void isc__mempool_put(isc_mempool_t *mpctx, void *mem FLARG) { isc_mem_t *mctx; element *item; REQUIRE(VALID_MEMPOOL(mpctx)); REQUIRE(mem != NULL); mctx = mpctx->mctx; if (mpctx->lock != NULL) LOCK(mpctx->lock); INSIST(mpctx->allocated > 0); mpctx->allocated--; #if ISC_MEM_TRACKLINES MCTXLOCK(mctx, &mctx->lock); DELETE_TRACE(mctx, mem, mpctx->size, file, line); MCTXUNLOCK(mctx, &mctx->lock); #endif /* ISC_MEM_TRACKLINES */ /* * If our free list is full, return this to the mctx directly. */ if (mpctx->freecount >= mpctx->freemax) { if ((mctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { MCTXLOCK(mctx, &mctx->lock); mem_putunlocked(mctx, mem, mpctx->size); MCTXUNLOCK(mctx, &mctx->lock); } else { mem_put(mctx, mem, mpctx->size); MCTXLOCK(mctx, &mctx->lock); mem_putstats(mctx, mem, mpctx->size); MCTXUNLOCK(mctx, &mctx->lock); } if (mpctx->lock != NULL) UNLOCK(mpctx->lock); return; } /* * Otherwise, attach it to our free list and bump the counter. */ mpctx->freecount++; item = (element *)mem; item->next = mpctx->items; mpctx->items = item; if (mpctx->lock != NULL) UNLOCK(mpctx->lock); } /* * Quotas */ void isc_mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit) { REQUIRE(VALID_MEMPOOL(mpctx)); if (mpctx->lock != NULL) LOCK(mpctx->lock); mpctx->freemax = limit; if (mpctx->lock != NULL) UNLOCK(mpctx->lock); } unsigned int isc_mempool_getfreemax(isc_mempool_t *mpctx) { unsigned int freemax; REQUIRE(VALID_MEMPOOL(mpctx)); if (mpctx->lock != NULL) LOCK(mpctx->lock); freemax = mpctx->freemax; if (mpctx->lock != NULL) UNLOCK(mpctx->lock); return (freemax); } unsigned int isc_mempool_getfreecount(isc_mempool_t *mpctx) { unsigned int freecount; REQUIRE(VALID_MEMPOOL(mpctx)); if (mpctx->lock != NULL) LOCK(mpctx->lock); freecount = mpctx->freecount; if (mpctx->lock != NULL) UNLOCK(mpctx->lock); return (freecount); } void isc_mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit) { REQUIRE(limit > 0); REQUIRE(VALID_MEMPOOL(mpctx)); if (mpctx->lock != NULL) LOCK(mpctx->lock); mpctx->maxalloc = limit; if (mpctx->lock != NULL) UNLOCK(mpctx->lock); } unsigned int isc_mempool_getmaxalloc(isc_mempool_t *mpctx) { unsigned int maxalloc; REQUIRE(VALID_MEMPOOL(mpctx)); if (mpctx->lock != NULL) LOCK(mpctx->lock); maxalloc = mpctx->maxalloc; if (mpctx->lock != NULL) UNLOCK(mpctx->lock); return (maxalloc); } unsigned int isc_mempool_getallocated(isc_mempool_t *mpctx) { unsigned int allocated; REQUIRE(VALID_MEMPOOL(mpctx)); if (mpctx->lock != NULL) LOCK(mpctx->lock); allocated = mpctx->allocated; if (mpctx->lock != NULL) UNLOCK(mpctx->lock); return (allocated); } void isc_mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit) { REQUIRE(limit > 0); REQUIRE(VALID_MEMPOOL(mpctx)); if (mpctx->lock != NULL) LOCK(mpctx->lock); mpctx->fillcount = limit; if (mpctx->lock != NULL) UNLOCK(mpctx->lock); } unsigned int isc_mempool_getfillcount(isc_mempool_t *mpctx) { unsigned int fillcount; REQUIRE(VALID_MEMPOOL(mpctx)); if (mpctx->lock != NULL) LOCK(mpctx->lock); fillcount = mpctx->fillcount; if (mpctx->lock != NULL) UNLOCK(mpctx->lock); return (fillcount); } void isc_mem_printactive(isc_mem_t *ctx, FILE *file) { REQUIRE(VALID_CONTEXT(ctx)); REQUIRE(file != NULL); #if !ISC_MEM_TRACKLINES UNUSED(ctx); UNUSED(file); #else print_active(ctx, file); #endif } void isc_mem_printallactive(FILE *file) { #if !ISC_MEM_TRACKLINES UNUSED(file); #else isc_mem_t *ctx; RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); LOCK(&lock); for (ctx = ISC_LIST_HEAD(contexts); ctx != NULL; ctx = ISC_LIST_NEXT(ctx, link)) { fprintf(file, "context: %p\n", ctx); print_active(ctx, file); } UNLOCK(&lock); #endif } void isc_mem_checkdestroyed(FILE *file) { RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); LOCK(&lock); if (!ISC_LIST_EMPTY(contexts)) { #if ISC_MEM_TRACKLINES isc_mem_t *ctx; for (ctx = ISC_LIST_HEAD(contexts); ctx != NULL; ctx = ISC_LIST_NEXT(ctx, link)) { fprintf(file, "context: %p\n", ctx); print_active(ctx, file); } fflush(file); #endif INSIST(0); } UNLOCK(&lock); } unsigned int isc_mem_references(isc_mem_t *ctx) { unsigned int references; REQUIRE(VALID_CONTEXT(ctx)); MCTXLOCK(ctx, &ctx->lock); references = ctx->references; MCTXUNLOCK(ctx, &ctx->lock); return (references); } #ifdef HAVE_LIBXML2 typedef struct summarystat { isc_uint64_t total; isc_uint64_t inuse; isc_uint64_t blocksize; isc_uint64_t contextsize; } summarystat_t; static void renderctx(isc_mem_t *ctx, summarystat_t *summary, xmlTextWriterPtr writer) { REQUIRE(VALID_CONTEXT(ctx)); xmlTextWriterStartElement(writer, ISC_XMLCHAR "context"); xmlTextWriterStartElement(writer, ISC_XMLCHAR "id"); xmlTextWriterWriteFormatString(writer, "%p", ctx); xmlTextWriterEndElement(writer); /* id */ if (ctx->name[0] != 0) { xmlTextWriterStartElement(writer, ISC_XMLCHAR "name"); xmlTextWriterWriteFormatString(writer, "%s", ctx->name); xmlTextWriterEndElement(writer); /* name */ } REQUIRE(VALID_CONTEXT(ctx)); MCTXLOCK(ctx, &ctx->lock); summary->contextsize += sizeof(*ctx) + (ctx->max_size + 1) * sizeof(struct stats) + ctx->max_size * sizeof(element *) + ctx->basic_table_count * sizeof(char *); #if ISC_MEM_TRACKLINES if (ctx->debuglist != NULL) { summary->contextsize += (ctx->max_size + 1) * sizeof(debuglist_t) + ctx->debuglistcnt * sizeof(debuglink_t); } #endif xmlTextWriterStartElement(writer, ISC_XMLCHAR "references"); xmlTextWriterWriteFormatString(writer, "%d", ctx->references); xmlTextWriterEndElement(writer); /* references */ summary->total += ctx->total; xmlTextWriterStartElement(writer, ISC_XMLCHAR "total"); xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", (isc_uint64_t)ctx->total); xmlTextWriterEndElement(writer); /* total */ summary->inuse += ctx->inuse; xmlTextWriterStartElement(writer, ISC_XMLCHAR "inuse"); xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", (isc_uint64_t)ctx->inuse); xmlTextWriterEndElement(writer); /* inuse */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "maxinuse"); xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", (isc_uint64_t)ctx->maxinuse); xmlTextWriterEndElement(writer); /* maxinuse */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "blocksize"); if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) { summary->blocksize += ctx->basic_table_count * NUM_BASIC_BLOCKS * ctx->mem_target; xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", (isc_uint64_t) ctx->basic_table_count * NUM_BASIC_BLOCKS * ctx->mem_target); } else xmlTextWriterWriteFormatString(writer, "%s", "-"); xmlTextWriterEndElement(writer); /* blocksize */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "pools"); xmlTextWriterWriteFormatString(writer, "%u", ctx->poolcnt); xmlTextWriterEndElement(writer); /* pools */ summary->contextsize += ctx->poolcnt * sizeof(isc_mempool_t); xmlTextWriterStartElement(writer, ISC_XMLCHAR "hiwater"); xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", (isc_uint64_t)ctx->hi_water); xmlTextWriterEndElement(writer); /* hiwater */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "lowater"); xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", (isc_uint64_t)ctx->lo_water); xmlTextWriterEndElement(writer); /* lowater */ MCTXUNLOCK(ctx, &ctx->lock); xmlTextWriterEndElement(writer); /* context */ } void isc_mem_renderxml(xmlTextWriterPtr writer) { isc_mem_t *ctx; summarystat_t summary; isc_uint64_t lost; memset(&summary, 0, sizeof(summary)); xmlTextWriterStartElement(writer, ISC_XMLCHAR "contexts"); RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); LOCK(&lock); lost = totallost; for (ctx = ISC_LIST_HEAD(contexts); ctx != NULL; ctx = ISC_LIST_NEXT(ctx, link)) { renderctx(ctx, &summary, writer); } UNLOCK(&lock); xmlTextWriterEndElement(writer); /* contexts */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "summary"); xmlTextWriterStartElement(writer, ISC_XMLCHAR "TotalUse"); xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", summary.total); xmlTextWriterEndElement(writer); /* TotalUse */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "InUse"); xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", summary.inuse); xmlTextWriterEndElement(writer); /* InUse */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "BlockSize"); xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", summary.blocksize); xmlTextWriterEndElement(writer); /* BlockSize */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "ContextSize"); xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", summary.contextsize); xmlTextWriterEndElement(writer); /* ContextSize */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "Lost"); xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u", lost); xmlTextWriterEndElement(writer); /* Lost */ xmlTextWriterEndElement(writer); /* summary */ } #endif /* HAVE_LIBXML2 */ ntp-4.2.6p5/lib/isc/result.c0000644000175000017500000001355011307651604014626 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: result.c,v 1.71 2008/09/25 04:02:39 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include #include typedef struct resulttable { unsigned int base; unsigned int last; const char ** text; isc_msgcat_t * msgcat; int set; ISC_LINK(struct resulttable) link; } resulttable; static const char *text[ISC_R_NRESULTS] = { "success", /*%< 0 */ "out of memory", /*%< 1 */ "timed out", /*%< 2 */ "no available threads", /*%< 3 */ "address not available", /*%< 4 */ "address in use", /*%< 5 */ "permission denied", /*%< 6 */ "no pending connections", /*%< 7 */ "network unreachable", /*%< 8 */ "host unreachable", /*%< 9 */ "network down", /*%< 10 */ "host down", /*%< 11 */ "connection refused", /*%< 12 */ "not enough free resources", /*%< 13 */ "end of file", /*%< 14 */ "socket already bound", /*%< 15 */ "reload", /*%< 16 */ "lock busy", /*%< 17 */ "already exists", /*%< 18 */ "ran out of space", /*%< 19 */ "operation canceled", /*%< 20 */ "socket is not bound", /*%< 21 */ "shutting down", /*%< 22 */ "not found", /*%< 23 */ "unexpected end of input", /*%< 24 */ "failure", /*%< 25 */ "I/O error", /*%< 26 */ "not implemented", /*%< 27 */ "unbalanced parentheses", /*%< 28 */ "no more", /*%< 29 */ "invalid file", /*%< 30 */ "bad base64 encoding", /*%< 31 */ "unexpected token", /*%< 32 */ "quota reached", /*%< 33 */ "unexpected error", /*%< 34 */ "already running", /*%< 35 */ "ignore", /*%< 36 */ "address mask not contiguous", /*%< 37 */ "file not found", /*%< 38 */ "file already exists", /*%< 39 */ "socket is not connected", /*%< 40 */ "out of range", /*%< 41 */ "out of entropy", /*%< 42 */ "invalid use of multicast address", /*%< 43 */ "not a file", /*%< 44 */ "not a directory", /*%< 45 */ "queue is full", /*%< 46 */ "address family mismatch", /*%< 47 */ "address family not supported", /*%< 48 */ "bad hex encoding", /*%< 49 */ "too many open files", /*%< 50 */ "not blocking", /*%< 51 */ "unbalanced quotes", /*%< 52 */ "operation in progress", /*%< 53 */ "connection reset", /*%< 54 */ "soft quota reached", /*%< 55 */ "not a valid number", /*%< 56 */ "disabled", /*%< 57 */ "max size", /*%< 58 */ "invalid address format", /*%< 59 */ "bad base32 encoding", /*%< 60 */ }; #define ISC_RESULT_RESULTSET 2 #define ISC_RESULT_UNAVAILABLESET 3 static isc_once_t once = ISC_ONCE_INIT; static ISC_LIST(resulttable) tables; static isc_mutex_t lock; static isc_result_t register_table(unsigned int base, unsigned int nresults, const char **text, isc_msgcat_t *msgcat, int set) { resulttable *table; REQUIRE(base % ISC_RESULTCLASS_SIZE == 0); REQUIRE(nresults <= ISC_RESULTCLASS_SIZE); REQUIRE(text != NULL); /* * We use malloc() here because we we want to be able to use * isc_result_totext() even if there is no memory context. */ table = malloc(sizeof(*table)); if (table == NULL) return (ISC_R_NOMEMORY); table->base = base; table->last = base + nresults - 1; table->text = text; table->msgcat = msgcat; table->set = set; ISC_LINK_INIT(table, link); LOCK(&lock); ISC_LIST_APPEND(tables, table, link); UNLOCK(&lock); return (ISC_R_SUCCESS); } static void initialize_action(void) { isc_result_t result; RUNTIME_CHECK(isc_mutex_init(&lock) == ISC_R_SUCCESS); ISC_LIST_INIT(tables); result = register_table(ISC_RESULTCLASS_ISC, ISC_R_NRESULTS, text, isc_msgcat, ISC_RESULT_RESULTSET); if (result != ISC_R_SUCCESS) UNEXPECTED_ERROR(__FILE__, __LINE__, "register_table() %s: %u", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), result); } static void initialize(void) { isc_lib_initmsgcat(); RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); } const char * isc_result_totext(isc_result_t result) { resulttable *table; const char *text, *default_text; int index; initialize(); LOCK(&lock); text = NULL; for (table = ISC_LIST_HEAD(tables); 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]; /* * Note: we use 'index + 1' as the message number * instead of index because isc_msgcat_get() requires * the message number to be > 0. */ text = isc_msgcat_get(table->msgcat, table->set, index + 1, default_text); break; } } if (text == NULL) text = isc_msgcat_get(isc_msgcat, ISC_RESULT_UNAVAILABLESET, 1, "(result code text not available)"); UNLOCK(&lock); return (text); } isc_result_t isc_result_register(unsigned int base, unsigned int nresults, const char **text, isc_msgcat_t *msgcat, int set) { initialize(); return (register_table(base, nresults, text, msgcat, set)); } ntp-4.2.6p5/lib/isc/base32.c0000644000175000017500000002312311307651604014364 0ustar peterpeter/* * Copyright (C) 2008, 2009 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: base32.c,v 1.3.116.2 2009/01/18 23:47:41 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include #define RETERR(x) do { \ isc_result_t _r = (x); \ if (_r != ISC_R_SUCCESS) \ return (_r); \ } while (0) /*@{*/ /*! * These static functions are also present in lib/dns/rdata.c. I'm not * sure where they should go. -- bwelling */ static isc_result_t str_totext(const char *source, isc_buffer_t *target); static isc_result_t mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length); /*@}*/ static const char base32[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=abcdefghijklmnopqrstuvwxyz234567"; static const char base32hex[] = "0123456789ABCDEFGHIJKLMNOPQRSTUV=0123456789abcdefghijklmnopqrstuv"; static isc_result_t base32_totext(isc_region_t *source, int wordlength, const char *wordbreak, isc_buffer_t *target, const char base[]) { char buf[9]; unsigned int loops = 0; if (wordlength >= 0 && wordlength < 8) wordlength = 8; memset(buf, 0, sizeof(buf)); while (source->length > 0) { buf[0] = base[((source->base[0]>>3)&0x1f)]; /* 5 + */ if (source->length == 1) { buf[1] = base[(source->base[0]<<2)&0x1c]; buf[2] = buf[3] = buf[4] = '='; buf[5] = buf[6] = buf[7] = '='; RETERR(str_totext(buf, target)); break; } buf[1] = base[((source->base[0]<<2)&0x1c)| /* 3 = 8 */ ((source->base[1]>>6)&0x03)]; /* 2 + */ buf[2] = base[((source->base[1]>>1)&0x1f)]; /* 5 + */ if (source->length == 2) { buf[3] = base[(source->base[1]<<4)&0x10]; buf[4] = buf[5] = buf[6] = buf[7] = '='; RETERR(str_totext(buf, target)); break; } buf[3] = base[((source->base[1]<<4)&0x10)| /* 1 = 8 */ ((source->base[2]>>4)&0x0f)]; /* 4 + */ if (source->length == 3) { buf[4] = base[(source->base[2]<<1)&0x1e]; buf[5] = buf[6] = buf[7] = '='; RETERR(str_totext(buf, target)); break; } buf[4] = base[((source->base[2]<<1)&0x1e)| /* 4 = 8 */ ((source->base[3]>>7)&0x01)]; /* 1 + */ buf[5] = base[((source->base[3]>>2)&0x1f)]; /* 5 + */ if (source->length == 4) { buf[6] = base[(source->base[3]<<3)&0x18]; buf[7] = '='; RETERR(str_totext(buf, target)); break; } buf[6] = base[((source->base[3]<<3)&0x18)| /* 2 = 8 */ ((source->base[4]>>5)&0x07)]; /* 3 + */ buf[7] = base[source->base[4]&0x1f]; /* 5 = 8 */ RETERR(str_totext(buf, target)); isc_region_consume(source, 5); loops++; if (source->length != 0 && wordlength >= 0 && (int)((loops + 1) * 8) >= wordlength) { loops = 0; RETERR(str_totext(wordbreak, target)); } } return (ISC_R_SUCCESS); } isc_result_t isc_base32_totext(isc_region_t *source, int wordlength, const char *wordbreak, isc_buffer_t *target) { return (base32_totext(source, wordlength, wordbreak, target, base32)); } isc_result_t isc_base32hex_totext(isc_region_t *source, int wordlength, const char *wordbreak, isc_buffer_t *target) { return (base32_totext(source, wordlength, wordbreak, target, base32hex)); } /*% * State of a base32 decoding process in progress. */ typedef struct { int length; /*%< Desired length of binary data or -1 */ isc_buffer_t *target; /*%< Buffer for resulting binary data */ int digits; /*%< Number of buffered base32 digits */ isc_boolean_t seen_end; /*%< True if "=" end marker seen */ int val[8]; const char *base; /*%< Which encoding we are using */ int seen_32; /*%< Number of significant bytes if non zero */ } base32_decode_ctx_t; static inline void base32_decode_init(base32_decode_ctx_t *ctx, int length, const char base[], isc_buffer_t *target) { ctx->digits = 0; ctx->seen_end = ISC_FALSE; ctx->seen_32 = 0; ctx->length = length; ctx->target = target; ctx->base = base; } static inline isc_result_t base32_decode_char(base32_decode_ctx_t *ctx, int c) { char *s; unsigned int last; if (ctx->seen_end) return (ISC_R_BADBASE32); if ((s = strchr(ctx->base, c)) == NULL) return (ISC_R_BADBASE32); last = s - ctx->base; /* * Handle lower case. */ if (last > 32) last -= 33; /* * Check that padding is contiguous. */ if (last != 32 && ctx->seen_32 != 0) return (ISC_R_BADBASE32); /* * Check that padding starts at the right place and that * bits that should be zero are. * Record how many significant bytes in answer (seen_32). */ if (last == 32 && ctx->seen_32 == 0) switch (ctx->digits) { case 0: case 1: return (ISC_R_BADBASE32); case 2: if ((ctx->val[1]&0x03) != 0) return (ISC_R_BADBASE32); ctx->seen_32 = 1; break; case 3: return (ISC_R_BADBASE32); case 4: if ((ctx->val[3]&0x0f) != 0) return (ISC_R_BADBASE32); ctx->seen_32 = 3; break; case 5: if ((ctx->val[4]&0x01) != 0) return (ISC_R_BADBASE32); ctx->seen_32 = 3; break; case 6: return (ISC_R_BADBASE32); case 7: if ((ctx->val[6]&0x07) != 0) return (ISC_R_BADBASE32); ctx->seen_32 = 4; break; } /* * Zero fill pad values. */ ctx->val[ctx->digits++] = (last == 32) ? 0 : last; if (ctx->digits == 8) { int n = 5; unsigned char buf[5]; if (ctx->seen_32 != 0) { ctx->seen_end = ISC_TRUE; n = ctx->seen_32; } buf[0] = (ctx->val[0]<<3)|(ctx->val[1]>>2); buf[1] = (ctx->val[1]<<6)|(ctx->val[2]<<1)|(ctx->val[3]>>4); buf[2] = (ctx->val[3]<<4)|(ctx->val[4]>>1); buf[3] = (ctx->val[4]<<7)|(ctx->val[5]<<2)|(ctx->val[6]>>3); buf[4] = (ctx->val[6]<<5)|(ctx->val[7]); RETERR(mem_tobuffer(ctx->target, buf, n)); if (ctx->length >= 0) { if (n > ctx->length) return (ISC_R_BADBASE32); else ctx->length -= n; } ctx->digits = 0; } return (ISC_R_SUCCESS); } static inline isc_result_t base32_decode_finish(base32_decode_ctx_t *ctx) { if (ctx->length > 0) return (ISC_R_UNEXPECTEDEND); if (ctx->digits != 0) return (ISC_R_BADBASE32); return (ISC_R_SUCCESS); } static isc_result_t base32_tobuffer(isc_lex_t *lexer, const char base[], isc_buffer_t *target, int length) { base32_decode_ctx_t ctx; isc_textregion_t *tr; isc_token_t token; isc_boolean_t eol; base32_decode_init(&ctx, length, base, target); while (!ctx.seen_end && (ctx.length != 0)) { unsigned int i; if (length > 0) eol = ISC_FALSE; else eol = ISC_TRUE; RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, eol)); if (token.type != isc_tokentype_string) break; tr = &token.value.as_textregion; for (i = 0; i < tr->length; i++) RETERR(base32_decode_char(&ctx, tr->base[i])); } if (ctx.length < 0 && !ctx.seen_end) isc_lex_ungettoken(lexer, &token); RETERR(base32_decode_finish(&ctx)); return (ISC_R_SUCCESS); } isc_result_t isc_base32_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { return (base32_tobuffer(lexer, base32, target, length)); } isc_result_t isc_base32hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { return (base32_tobuffer(lexer, base32hex, target, length)); } static isc_result_t base32_decodestring(const char *cstr, const char base[], isc_buffer_t *target) { base32_decode_ctx_t ctx; base32_decode_init(&ctx, -1, base, target); for (;;) { int c = *cstr++; if (c == '\0') break; if (c == ' ' || c == '\t' || c == '\n' || c== '\r') continue; RETERR(base32_decode_char(&ctx, c)); } RETERR(base32_decode_finish(&ctx)); return (ISC_R_SUCCESS); } isc_result_t isc_base32_decodestring(const char *cstr, isc_buffer_t *target) { return (base32_decodestring(cstr, base32, target)); } isc_result_t isc_base32hex_decodestring(const char *cstr, isc_buffer_t *target) { return (base32_decodestring(cstr, base32hex, target)); } static isc_result_t base32_decoderegion(isc_region_t *source, const char base[], isc_buffer_t *target) { base32_decode_ctx_t ctx; base32_decode_init(&ctx, -1, base, target); while (source->length != 0) { int c = *source->base; RETERR(base32_decode_char(&ctx, c)); isc_region_consume(source, 1); } RETERR(base32_decode_finish(&ctx)); return (ISC_R_SUCCESS); } isc_result_t isc_base32_decoderegion(isc_region_t *source, isc_buffer_t *target) { return (base32_decoderegion(source, base32, target)); } isc_result_t isc_base32hex_decoderegion(isc_region_t *source, isc_buffer_t *target) { return (base32_decoderegion(source, base32hex, target)); } static isc_result_t str_totext(const char *source, isc_buffer_t *target) { unsigned int l; isc_region_t region; isc_buffer_availableregion(target, ®ion); l = strlen(source); if (l > region.length) return (ISC_R_NOSPACE); memcpy(region.base, source, l); isc_buffer_add(target, l); return (ISC_R_SUCCESS); } static isc_result_t mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) { isc_region_t tr; isc_buffer_availableregion(target, &tr); if (length > tr.length) return (ISC_R_NOSPACE); memcpy(tr.base, base, length); isc_buffer_add(target, length); return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/hex.c0000644000175000017500000001143611307651603014074 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: hex.c,v 1.20 2008/09/25 04:02:39 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include #define RETERR(x) do { \ isc_result_t _r = (x); \ if (_r != ISC_R_SUCCESS) \ return (_r); \ } while (0) /* * BEW: These static functions are copied from lib/dns/rdata.c. */ static isc_result_t str_totext(const char *source, isc_buffer_t *target); static isc_result_t mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length); static const char hex[] = "0123456789ABCDEF"; isc_result_t isc_hex_totext(isc_region_t *source, int wordlength, const char *wordbreak, isc_buffer_t *target) { char buf[3]; unsigned int loops = 0; if (wordlength < 2) wordlength = 2; memset(buf, 0, sizeof(buf)); while (source->length > 0) { buf[0] = hex[(source->base[0] >> 4) & 0xf]; buf[1] = hex[(source->base[0]) & 0xf]; RETERR(str_totext(buf, target)); isc_region_consume(source, 1); loops++; if (source->length != 0 && (int)((loops + 1) * 2) >= wordlength) { loops = 0; RETERR(str_totext(wordbreak, target)); } } return (ISC_R_SUCCESS); } /*% * State of a hex decoding process in progress. */ typedef struct { int length; /*%< Desired length of binary data or -1 */ isc_buffer_t *target; /*%< Buffer for resulting binary data */ int digits; /*%< Number of buffered hex digits */ int val[2]; } hex_decode_ctx_t; static inline void hex_decode_init(hex_decode_ctx_t *ctx, int length, isc_buffer_t *target) { ctx->digits = 0; ctx->length = length; ctx->target = target; } static inline isc_result_t hex_decode_char(hex_decode_ctx_t *ctx, int c) { char *s; if ((s = strchr(hex, toupper(c))) == NULL) return (ISC_R_BADHEX); ctx->val[ctx->digits++] = s - hex; if (ctx->digits == 2) { unsigned char num; num = (ctx->val[0] << 4) + (ctx->val[1]); RETERR(mem_tobuffer(ctx->target, &num, 1)); if (ctx->length >= 0) { if (ctx->length == 0) return (ISC_R_BADHEX); else ctx->length -= 1; } ctx->digits = 0; } return (ISC_R_SUCCESS); } static inline isc_result_t hex_decode_finish(hex_decode_ctx_t *ctx) { if (ctx->length > 0) return (ISC_R_UNEXPECTEDEND); if (ctx->digits != 0) return (ISC_R_BADHEX); return (ISC_R_SUCCESS); } isc_result_t isc_hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { hex_decode_ctx_t ctx; isc_textregion_t *tr; isc_token_t token; isc_boolean_t eol; hex_decode_init(&ctx, length, target); while (ctx.length != 0) { unsigned int i; if (length > 0) eol = ISC_FALSE; else eol = ISC_TRUE; RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, eol)); if (token.type != isc_tokentype_string) break; tr = &token.value.as_textregion; for (i = 0; i < tr->length; i++) RETERR(hex_decode_char(&ctx, tr->base[i])); } if (ctx.length < 0) isc_lex_ungettoken(lexer, &token); RETERR(hex_decode_finish(&ctx)); return (ISC_R_SUCCESS); } isc_result_t isc_hex_decodestring(const char *cstr, isc_buffer_t *target) { hex_decode_ctx_t ctx; hex_decode_init(&ctx, -1, target); for (;;) { int c = *cstr++; if (c == '\0') break; if (c == ' ' || c == '\t' || c == '\n' || c== '\r') continue; RETERR(hex_decode_char(&ctx, c)); } RETERR(hex_decode_finish(&ctx)); return (ISC_R_SUCCESS); } static isc_result_t str_totext(const char *source, isc_buffer_t *target) { unsigned int l; isc_region_t region; isc_buffer_availableregion(target, ®ion); l = strlen(source); if (l > region.length) return (ISC_R_NOSPACE); memcpy(region.base, source, l); isc_buffer_add(target, l); return (ISC_R_SUCCESS); } static isc_result_t mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) { isc_region_t tr; isc_buffer_availableregion(target, &tr); if (length > tr.length) return (ISC_R_NOSPACE); memcpy(tr.base, base, length); isc_buffer_add(target, length); return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/error.c0000644000175000017500000000564311307651603014444 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: error.c,v 1.21 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include /*% Default unexpected callback. */ static void default_unexpected_callback(const char *, int, const char *, va_list) ISC_FORMAT_PRINTF(3, 0); /*% Default fatal callback. */ static void default_fatal_callback(const char *, int, const char *, va_list) ISC_FORMAT_PRINTF(3, 0); /*% unexpected_callback */ static isc_errorcallback_t unexpected_callback = default_unexpected_callback; static isc_errorcallback_t fatal_callback = default_fatal_callback; void isc_error_setunexpected(isc_errorcallback_t cb) { if (cb == NULL) unexpected_callback = default_unexpected_callback; else unexpected_callback = cb; } void isc_error_setfatal(isc_errorcallback_t cb) { if (cb == NULL) fatal_callback = default_fatal_callback; else fatal_callback = cb; } void isc_error_unexpected(const char *file, int line, const char *format, ...) { va_list args; va_start(args, format); (unexpected_callback)(file, line, format, args); va_end(args); } void isc_error_fatal(const char *file, int line, const char *format, ...) { va_list args; va_start(args, format); (fatal_callback)(file, line, format, args); va_end(args); abort(); } void isc_error_runtimecheck(const char *file, int line, const char *expression) { isc_error_fatal(file, line, "RUNTIME_CHECK(%s) %s", expression, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); } static void default_unexpected_callback(const char *file, int line, const char *format, va_list args) { fprintf(stderr, "%s:%d: ", file, line); vfprintf(stderr, format, args); fprintf(stderr, "\n"); fflush(stderr); } static void default_fatal_callback(const char *file, int line, const char *format, va_list args) { fprintf(stderr, "%s:%d: %s: ", file, line, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FATALERROR, "fatal error")); vfprintf(stderr, format, args); fprintf(stderr, "\n"); fflush(stderr); } ntp-4.2.6p5/lib/isc/log.c0000644000175000017500000013140711307651614014074 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: log.c,v 1.94.332.5 2009/02/16 02:04:05 marka Exp $ */ /*! \file * \author Principal Authors: DCL */ #include #include #include #include #include #include /* dev_t FreeBSD 2.1 */ #include #include #include #include #include #include #include #include #include #include #include #include #define LCTX_MAGIC ISC_MAGIC('L', 'c', 't', 'x') #define VALID_CONTEXT(lctx) ISC_MAGIC_VALID(lctx, LCTX_MAGIC) #define LCFG_MAGIC ISC_MAGIC('L', 'c', 'f', 'g') #define VALID_CONFIG(lcfg) ISC_MAGIC_VALID(lcfg, LCFG_MAGIC) /* * XXXDCL make dynamic? */ #define LOG_BUFFER_SIZE (8 * 1024) #ifndef PATH_MAX #define PATH_MAX 1024 /* AIX and others don't define this. */ #endif /*! * This is the structure that holds each named channel. A simple linked * list chains all of the channels together, so an individual channel is * found by doing strcmp()s with the names down the list. Their should * be no performance penalty from this as it is expected that the number * of named channels will be no more than a dozen or so, and name lookups * from the head of the list are only done when isc_log_usechannel() is * called, which should also be very infrequent. */ typedef struct isc_logchannel isc_logchannel_t; struct isc_logchannel { char * name; unsigned int type; int level; unsigned int flags; isc_logdestination_t destination; ISC_LINK(isc_logchannel_t) link; }; /*! * The logchannellist structure associates categories and modules with * channels. First the appropriate channellist is found based on the * category, and then each structure in the linked list is checked for * a matching module. It is expected that the number of channels * associated with any given category will be very short, no more than * three or four in the more unusual cases. */ typedef struct isc_logchannellist isc_logchannellist_t; struct isc_logchannellist { const isc_logmodule_t * module; isc_logchannel_t * channel; ISC_LINK(isc_logchannellist_t) link; }; /*! * This structure is used to remember messages for pruning via * isc_log_[v]write1(). */ typedef struct isc_logmessage isc_logmessage_t; struct isc_logmessage { char * text; isc_time_t time; ISC_LINK(isc_logmessage_t) link; }; /*! * The isc_logconfig structure is used to store the configurable information * about where messages are actually supposed to be sent -- the information * that could changed based on some configuration file, as opposed to the * the category/module specification of isc_log_[v]write[1] that is compiled * into a program, or the debug_level which is dynamic state information. */ struct isc_logconfig { unsigned int magic; isc_log_t * lctx; ISC_LIST(isc_logchannel_t) channels; ISC_LIST(isc_logchannellist_t) *channellists; unsigned int channellist_count; unsigned int duplicate_interval; int highest_level; char * tag; isc_boolean_t dynamic; }; /*! * This isc_log structure provides the context for the isc_log functions. * The log context locks itself in isc_log_doit, the internal backend to * isc_log_write. The locking is necessary both to provide exclusive access * to the buffer into which the message is formatted and to guard against * competing threads trying to write to the same syslog resource. (On * some systems, such as BSD/OS, stdio is thread safe but syslog is not.) * Unfortunately, the lock cannot guard against a _different_ logging * context in the same program competing for syslog's attention. Thus * There Can Be Only One, but this is not enforced. * XXXDCL enforce it? * * Note that the category and module information is not locked. * This is because in the usual case, only one isc_log_t is ever created * in a program, and the category/module registration happens only once. * XXXDCL it might be wise to add more locking overall. */ struct isc_log { /* Not locked. */ unsigned int magic; isc_mem_t * mctx; isc_logcategory_t * categories; unsigned int category_count; isc_logmodule_t * modules; unsigned int module_count; int debug_level; isc_mutex_t lock; /* Locked by isc_log lock. */ isc_logconfig_t * logconfig; char buffer[LOG_BUFFER_SIZE]; ISC_LIST(isc_logmessage_t) messages; }; /*! * Used when ISC_LOG_PRINTLEVEL is enabled for a channel. */ static const char *log_level_strings[] = { "debug", "info", "notice", "warning", "error", "critical" }; /*! * Used to convert ISC_LOG_* priorities into syslog priorities. * XXXDCL This will need modification for NT. */ static const int syslog_map[] = { LOG_DEBUG, LOG_INFO, LOG_NOTICE, LOG_WARNING, LOG_ERR, LOG_CRIT }; /*! * When adding new categories, a corresponding ISC_LOGCATEGORY_foo * definition needs to be added to . * * The default category is provided so that the internal default can * be overridden. Since the default is always looked up as the first * channellist in the log context, it must come first in isc_categories[]. */ LIBISC_EXTERNAL_DATA isc_logcategory_t isc_categories[] = { { "default", 0 }, /* "default" must come first. */ { "general", 0 }, { NULL, 0 } }; /*! * See above comment for categories on LIBISC_EXTERNAL_DATA, and apply it to modules. */ LIBISC_EXTERNAL_DATA isc_logmodule_t isc_modules[] = { { "socket", 0 }, { "time", 0 }, { "interface", 0 }, { "timer", 0 }, { "file", 0 }, { NULL, 0 } }; /*! * This essentially constant structure must be filled in at run time, * because its channel member is pointed to a channel that is created * dynamically with isc_log_createchannel. */ static isc_logchannellist_t default_channel; /*! * libisc logs to this context. */ LIBISC_EXTERNAL_DATA isc_log_t *isc_lctx = NULL; /*! * Forward declarations. */ static isc_result_t assignchannel(isc_logconfig_t *lcfg, unsigned int category_id, const isc_logmodule_t *module, isc_logchannel_t *channel); static isc_result_t sync_channellist(isc_logconfig_t *lcfg); static isc_result_t greatest_version(isc_logchannel_t *channel, int *greatest); static isc_result_t roll_log(isc_logchannel_t *channel); static void isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_boolean_t write_once, isc_msgcat_t *msgcat, int msgset, int msg, const char *format, va_list args) ISC_FORMAT_PRINTF(9, 0); /*@{*/ /*! * Convenience macros. */ #define FACILITY(channel) (channel->destination.facility) #define FILE_NAME(channel) (channel->destination.file.name) #define FILE_STREAM(channel) (channel->destination.file.stream) #define FILE_VERSIONS(channel) (channel->destination.file.versions) #define FILE_MAXSIZE(channel) (channel->destination.file.maximum_size) #define FILE_MAXREACHED(channel) (channel->destination.file.maximum_reached) /*@}*/ /**** **** Public interfaces. ****/ /* * Establish a new logging context, with default channels. */ isc_result_t isc_log_create(isc_mem_t *mctx, isc_log_t **lctxp, isc_logconfig_t **lcfgp) { isc_log_t *lctx; isc_logconfig_t *lcfg = NULL; isc_result_t result; REQUIRE(mctx != NULL); REQUIRE(lctxp != NULL && *lctxp == NULL); REQUIRE(lcfgp == NULL || *lcfgp == NULL); lctx = isc_mem_get(mctx, sizeof(*lctx)); if (lctx != NULL) { lctx->mctx = mctx; lctx->categories = NULL; lctx->category_count = 0; lctx->modules = NULL; lctx->module_count = 0; lctx->debug_level = 0; ISC_LIST_INIT(lctx->messages); result = isc_mutex_init(&lctx->lock); if (result != ISC_R_SUCCESS) { isc_mem_put(mctx, lctx, sizeof(*lctx)); return (result); } /* * Normally setting the magic number is the last step done * in a creation function, but a valid log context is needed * by isc_log_registercategories and isc_logconfig_create. * If either fails, the lctx is destroyed and not returned * to the caller. */ lctx->magic = LCTX_MAGIC; isc_log_registercategories(lctx, isc_categories); isc_log_registermodules(lctx, isc_modules); result = isc_logconfig_create(lctx, &lcfg); } else result = ISC_R_NOMEMORY; if (result == ISC_R_SUCCESS) result = sync_channellist(lcfg); if (result == ISC_R_SUCCESS) { lctx->logconfig = lcfg; *lctxp = lctx; if (lcfgp != NULL) *lcfgp = lcfg; } else { if (lcfg != NULL) isc_logconfig_destroy(&lcfg); if (lctx != NULL) isc_log_destroy(&lctx); } return (result); } isc_result_t isc_logconfig_create(isc_log_t *lctx, isc_logconfig_t **lcfgp) { isc_logconfig_t *lcfg; isc_logdestination_t destination; isc_result_t result = ISC_R_SUCCESS; int level = ISC_LOG_INFO; REQUIRE(lcfgp != NULL && *lcfgp == NULL); REQUIRE(VALID_CONTEXT(lctx)); lcfg = isc_mem_get(lctx->mctx, sizeof(*lcfg)); if (lcfg != NULL) { lcfg->lctx = lctx; lcfg->channellists = NULL; lcfg->channellist_count = 0; lcfg->duplicate_interval = 0; lcfg->highest_level = level; lcfg->tag = NULL; lcfg->dynamic = ISC_FALSE; ISC_LIST_INIT(lcfg->channels); /* * Normally the magic number is the last thing set in the * structure, but isc_log_createchannel() needs a valid * config. If the channel creation fails, the lcfg is not * returned to the caller. */ lcfg->magic = LCFG_MAGIC; } else result = ISC_R_NOMEMORY; /* * Create the default channels: * default_syslog, default_stderr, default_debug and null. */ if (result == ISC_R_SUCCESS) { destination.facility = LOG_DAEMON; result = isc_log_createchannel(lcfg, "default_syslog", ISC_LOG_TOSYSLOG, level, &destination, 0); } if (result == ISC_R_SUCCESS) { destination.file.stream = stderr; destination.file.name = NULL; destination.file.versions = ISC_LOG_ROLLNEVER; destination.file.maximum_size = 0; result = isc_log_createchannel(lcfg, "default_stderr", ISC_LOG_TOFILEDESC, level, &destination, ISC_LOG_PRINTTIME); } if (result == ISC_R_SUCCESS) { /* * Set the default category's channel to default_stderr, * which is at the head of the channels list because it was * just created. */ default_channel.channel = ISC_LIST_HEAD(lcfg->channels); destination.file.stream = stderr; destination.file.name = NULL; destination.file.versions = ISC_LOG_ROLLNEVER; destination.file.maximum_size = 0; result = isc_log_createchannel(lcfg, "default_debug", ISC_LOG_TOFILEDESC, ISC_LOG_DYNAMIC, &destination, ISC_LOG_PRINTTIME); } if (result == ISC_R_SUCCESS) result = isc_log_createchannel(lcfg, "null", ISC_LOG_TONULL, ISC_LOG_DYNAMIC, NULL, 0); if (result == ISC_R_SUCCESS) *lcfgp = lcfg; else if (lcfg != NULL) isc_logconfig_destroy(&lcfg); return (result); } isc_logconfig_t * isc_logconfig_get(isc_log_t *lctx) { REQUIRE(VALID_CONTEXT(lctx)); ENSURE(lctx->logconfig != NULL); return (lctx->logconfig); } isc_result_t isc_logconfig_use(isc_log_t *lctx, isc_logconfig_t *lcfg) { isc_logconfig_t *old_cfg; isc_result_t result; REQUIRE(VALID_CONTEXT(lctx)); REQUIRE(VALID_CONFIG(lcfg)); REQUIRE(lcfg->lctx == lctx); /* * Ensure that lcfg->channellist_count == lctx->category_count. * They won't be equal if isc_log_usechannel has not been called * since any call to isc_log_registercategories. */ result = sync_channellist(lcfg); if (result != ISC_R_SUCCESS) return (result); LOCK(&lctx->lock); old_cfg = lctx->logconfig; lctx->logconfig = lcfg; UNLOCK(&lctx->lock); isc_logconfig_destroy(&old_cfg); return (ISC_R_SUCCESS); } void isc_log_destroy(isc_log_t **lctxp) { isc_log_t *lctx; isc_logconfig_t *lcfg; isc_mem_t *mctx; isc_logmessage_t *message; REQUIRE(lctxp != NULL && VALID_CONTEXT(*lctxp)); lctx = *lctxp; mctx = lctx->mctx; if (lctx->logconfig != NULL) { lcfg = lctx->logconfig; lctx->logconfig = NULL; isc_logconfig_destroy(&lcfg); } DESTROYLOCK(&lctx->lock); while ((message = ISC_LIST_HEAD(lctx->messages)) != NULL) { ISC_LIST_UNLINK(lctx->messages, message, link); isc_mem_put(mctx, message, sizeof(*message) + strlen(message->text) + 1); } lctx->buffer[0] = '\0'; lctx->debug_level = 0; lctx->categories = NULL; lctx->category_count = 0; lctx->modules = NULL; lctx->module_count = 0; lctx->mctx = NULL; lctx->magic = 0; isc_mem_put(mctx, lctx, sizeof(*lctx)); *lctxp = NULL; } void isc_logconfig_destroy(isc_logconfig_t **lcfgp) { isc_logconfig_t *lcfg; isc_mem_t *mctx; isc_logchannel_t *channel; isc_logchannellist_t *item; char *filename; unsigned int i; REQUIRE(lcfgp != NULL && VALID_CONFIG(*lcfgp)); lcfg = *lcfgp; /* * This function cannot be called with a logconfig that is in * use by a log context. */ REQUIRE(lcfg->lctx != NULL && lcfg->lctx->logconfig != lcfg); mctx = lcfg->lctx->mctx; while ((channel = ISC_LIST_HEAD(lcfg->channels)) != NULL) { ISC_LIST_UNLINK(lcfg->channels, channel, link); if (channel->type == ISC_LOG_TOFILE) { /* * The filename for the channel may have ultimately * started its life in user-land as a const string, * but in isc_log_createchannel it gets copied * into writable memory and is not longer truly const. */ DE_CONST(FILE_NAME(channel), filename); isc_mem_free(mctx, filename); if (FILE_STREAM(channel) != NULL) (void)fclose(FILE_STREAM(channel)); } isc_mem_free(mctx, channel->name); isc_mem_put(mctx, channel, sizeof(*channel)); } for (i = 0; i < lcfg->channellist_count; i++) while ((item = ISC_LIST_HEAD(lcfg->channellists[i])) != NULL) { ISC_LIST_UNLINK(lcfg->channellists[i], item, link); isc_mem_put(mctx, item, sizeof(*item)); } if (lcfg->channellist_count > 0) isc_mem_put(mctx, lcfg->channellists, lcfg->channellist_count * sizeof(ISC_LIST(isc_logchannellist_t))); lcfg->dynamic = ISC_FALSE; if (lcfg->tag != NULL) isc_mem_free(lcfg->lctx->mctx, lcfg->tag); lcfg->tag = NULL; lcfg->highest_level = 0; lcfg->duplicate_interval = 0; lcfg->magic = 0; isc_mem_put(mctx, lcfg, sizeof(*lcfg)); *lcfgp = NULL; } void isc_log_registercategories(isc_log_t *lctx, isc_logcategory_t categories[]) { isc_logcategory_t *catp; REQUIRE(VALID_CONTEXT(lctx)); REQUIRE(categories != NULL && categories[0].name != NULL); /* * XXXDCL This somewhat sleazy situation of using the last pointer * in one category array to point to the next array exists because * this registration function returns void and I didn't want to have * change everything that used it by making it return an isc_result_t. * It would need to do that if it had to allocate memory to store * pointers to each array passed in. */ if (lctx->categories == NULL) lctx->categories = categories; else { /* * Adjust the last (NULL) pointer of the already registered * categories to point to the incoming array. */ for (catp = lctx->categories; catp->name != NULL; ) if (catp->id == UINT_MAX) /* * The name pointer points to the next array. * Ick. */ DE_CONST(catp->name, catp); else catp++; catp->name = (void *)categories; catp->id = UINT_MAX; } /* * Update the id number of the category with its new global id. */ for (catp = categories; catp->name != NULL; catp++) catp->id = lctx->category_count++; } isc_logcategory_t * isc_log_categorybyname(isc_log_t *lctx, const char *name) { isc_logcategory_t *catp; REQUIRE(VALID_CONTEXT(lctx)); REQUIRE(name != NULL); for (catp = lctx->categories; catp->name != NULL; ) if (catp->id == UINT_MAX) /* * catp is neither modified nor returned to the * caller, so removing its const qualifier is ok. */ DE_CONST(catp->name, catp); else { if (strcmp(catp->name, name) == 0) return (catp); catp++; } return (NULL); } void isc_log_registermodules(isc_log_t *lctx, isc_logmodule_t modules[]) { isc_logmodule_t *modp; REQUIRE(VALID_CONTEXT(lctx)); REQUIRE(modules != NULL && modules[0].name != NULL); /* * XXXDCL This somewhat sleazy situation of using the last pointer * in one category array to point to the next array exists because * this registration function returns void and I didn't want to have * change everything that used it by making it return an isc_result_t. * It would need to do that if it had to allocate memory to store * pointers to each array passed in. */ if (lctx->modules == NULL) lctx->modules = modules; else { /* * Adjust the last (NULL) pointer of the already registered * modules to point to the incoming array. */ for (modp = lctx->modules; modp->name != NULL; ) if (modp->id == UINT_MAX) /* * The name pointer points to the next array. * Ick. */ DE_CONST(modp->name, modp); else modp++; modp->name = (void *)modules; modp->id = UINT_MAX; } /* * Update the id number of the module with its new global id. */ for (modp = modules; modp->name != NULL; modp++) modp->id = lctx->module_count++; } isc_logmodule_t * isc_log_modulebyname(isc_log_t *lctx, const char *name) { isc_logmodule_t *modp; REQUIRE(VALID_CONTEXT(lctx)); REQUIRE(name != NULL); for (modp = lctx->modules; modp->name != NULL; ) if (modp->id == UINT_MAX) /* * modp is neither modified nor returned to the * caller, so removing its const qualifier is ok. */ DE_CONST(modp->name, modp); else { if (strcmp(modp->name, name) == 0) return (modp); modp++; } return (NULL); } isc_result_t isc_log_createchannel(isc_logconfig_t *lcfg, const char *name, unsigned int type, int level, const isc_logdestination_t *destination, unsigned int flags) { isc_logchannel_t *channel; isc_mem_t *mctx; REQUIRE(VALID_CONFIG(lcfg)); REQUIRE(name != NULL); REQUIRE(type == ISC_LOG_TOSYSLOG || type == ISC_LOG_TOFILE || type == ISC_LOG_TOFILEDESC || type == ISC_LOG_TONULL); REQUIRE(destination != NULL || type == ISC_LOG_TONULL); REQUIRE(level >= ISC_LOG_CRITICAL); REQUIRE((flags & (unsigned int)~(ISC_LOG_PRINTALL | ISC_LOG_DEBUGONLY)) == 0); /* XXXDCL find duplicate names? */ mctx = lcfg->lctx->mctx; channel = isc_mem_get(mctx, sizeof(*channel)); if (channel == NULL) return (ISC_R_NOMEMORY); channel->name = isc_mem_strdup(mctx, name); if (channel->name == NULL) { isc_mem_put(mctx, channel, sizeof(*channel)); return (ISC_R_NOMEMORY); } channel->type = type; channel->level = level; channel->flags = flags; ISC_LINK_INIT(channel, link); switch (type) { case ISC_LOG_TOSYSLOG: FACILITY(channel) = destination->facility; break; case ISC_LOG_TOFILE: /* * The file name is copied because greatest_version wants * to scribble on it, so it needs to be definitely in * writable memory. */ FILE_NAME(channel) = isc_mem_strdup(mctx, destination->file.name); FILE_STREAM(channel) = NULL; FILE_VERSIONS(channel) = destination->file.versions; FILE_MAXSIZE(channel) = destination->file.maximum_size; FILE_MAXREACHED(channel) = ISC_FALSE; break; case ISC_LOG_TOFILEDESC: FILE_NAME(channel) = NULL; FILE_STREAM(channel) = destination->file.stream; FILE_MAXSIZE(channel) = 0; FILE_VERSIONS(channel) = ISC_LOG_ROLLNEVER; break; case ISC_LOG_TONULL: /* Nothing. */ break; default: isc_mem_put(mctx, channel->name, strlen(channel->name) + 1); isc_mem_put(mctx, channel, sizeof(*channel)); return (ISC_R_UNEXPECTED); } ISC_LIST_PREPEND(lcfg->channels, channel, link); /* * If default_stderr was redefined, make the default category * point to the new default_stderr. */ if (strcmp(name, "default_stderr") == 0) default_channel.channel = channel; return (ISC_R_SUCCESS); } isc_result_t isc_log_usechannel(isc_logconfig_t *lcfg, const char *name, const isc_logcategory_t *category, const isc_logmodule_t *module) { isc_log_t *lctx; isc_logchannel_t *channel; isc_result_t result = ISC_R_SUCCESS; unsigned int i; REQUIRE(VALID_CONFIG(lcfg)); REQUIRE(name != NULL); lctx = lcfg->lctx; REQUIRE(category == NULL || category->id < lctx->category_count); REQUIRE(module == NULL || module->id < lctx->module_count); for (channel = ISC_LIST_HEAD(lcfg->channels); channel != NULL; channel = ISC_LIST_NEXT(channel, link)) if (strcmp(name, channel->name) == 0) break; if (channel == NULL) return (ISC_R_NOTFOUND); if (category != NULL) result = assignchannel(lcfg, category->id, module, channel); else /* * Assign to all categories. Note that this includes * the default channel. */ for (i = 0; i < lctx->category_count; i++) { result = assignchannel(lcfg, i, module, channel); if (result != ISC_R_SUCCESS) break; } return (result); } void isc_log_write(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *format, ...) { va_list args; /* * Contract checking is done in isc_log_doit(). */ va_start(args, format); isc_log_doit(lctx, category, module, level, ISC_FALSE, NULL, 0, 0, format, args); va_end(args); } void isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *format, va_list args) { /* * Contract checking is done in isc_log_doit(). */ isc_log_doit(lctx, category, module, level, ISC_FALSE, NULL, 0, 0, format, args); } void isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *format, ...) { va_list args; /* * Contract checking is done in isc_log_doit(). */ va_start(args, format); isc_log_doit(lctx, category, module, level, ISC_TRUE, NULL, 0, 0, format, args); va_end(args); } void isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *format, va_list args) { /* * Contract checking is done in isc_log_doit(). */ isc_log_doit(lctx, category, module, level, ISC_TRUE, NULL, 0, 0, format, args); } void isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int msg, const char *format, ...) { va_list args; /* * Contract checking is done in isc_log_doit(). */ va_start(args, format); isc_log_doit(lctx, category, module, level, ISC_FALSE, msgcat, msgset, msg, format, args); va_end(args); } void isc_log_ivwrite(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int msg, const char *format, va_list args) { /* * Contract checking is done in isc_log_doit(). */ isc_log_doit(lctx, category, module, level, ISC_FALSE, msgcat, msgset, msg, format, args); } void isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int msg, const char *format, ...) { va_list args; /* * Contract checking is done in isc_log_doit(). */ va_start(args, format); isc_log_doit(lctx, category, module, level, ISC_TRUE, msgcat, msgset, msg, format, args); va_end(args); } void isc_log_ivwrite1(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int msg, const char *format, va_list args) { /* * Contract checking is done in isc_log_doit(). */ isc_log_doit(lctx, category, module, level, ISC_TRUE, msgcat, msgset, msg, format, args); } void isc_log_setcontext(isc_log_t *lctx) { isc_lctx = lctx; } void isc_log_setdebuglevel(isc_log_t *lctx, unsigned int level) { isc_logchannel_t *channel; REQUIRE(VALID_CONTEXT(lctx)); LOCK(&lctx->lock); lctx->debug_level = level; /* * Close ISC_LOG_DEBUGONLY channels if level is zero. */ if (lctx->debug_level == 0) for (channel = ISC_LIST_HEAD(lctx->logconfig->channels); channel != NULL; channel = ISC_LIST_NEXT(channel, link)) if (channel->type == ISC_LOG_TOFILE && (channel->flags & ISC_LOG_DEBUGONLY) != 0 && FILE_STREAM(channel) != NULL) { (void)fclose(FILE_STREAM(channel)); FILE_STREAM(channel) = NULL; } UNLOCK(&lctx->lock); } unsigned int isc_log_getdebuglevel(isc_log_t *lctx) { REQUIRE(VALID_CONTEXT(lctx)); return (lctx->debug_level); } void isc_log_setduplicateinterval(isc_logconfig_t *lcfg, unsigned int interval) { REQUIRE(VALID_CONFIG(lcfg)); lcfg->duplicate_interval = interval; } unsigned int isc_log_getduplicateinterval(isc_logconfig_t *lcfg) { REQUIRE(VALID_CONTEXT(lcfg)); return (lcfg->duplicate_interval); } isc_result_t isc_log_settag(isc_logconfig_t *lcfg, const char *tag) { REQUIRE(VALID_CONFIG(lcfg)); if (tag != NULL && *tag != '\0') { if (lcfg->tag != NULL) isc_mem_free(lcfg->lctx->mctx, lcfg->tag); lcfg->tag = isc_mem_strdup(lcfg->lctx->mctx, tag); if (lcfg->tag == NULL) return (ISC_R_NOMEMORY); } else { if (lcfg->tag != NULL) isc_mem_free(lcfg->lctx->mctx, lcfg->tag); lcfg->tag = NULL; } return (ISC_R_SUCCESS); } char * isc_log_gettag(isc_logconfig_t *lcfg) { REQUIRE(VALID_CONFIG(lcfg)); return (lcfg->tag); } /* XXXDCL NT -- This interface will assuredly be changing. */ void isc_log_opensyslog(const char *tag, int options, int facility) { (void)openlog(tag, options, facility); } void isc_log_closefilelogs(isc_log_t *lctx) { isc_logchannel_t *channel; REQUIRE(VALID_CONTEXT(lctx)); LOCK(&lctx->lock); for (channel = ISC_LIST_HEAD(lctx->logconfig->channels); channel != NULL; channel = ISC_LIST_NEXT(channel, link)) if (channel->type == ISC_LOG_TOFILE && FILE_STREAM(channel) != NULL) { (void)fclose(FILE_STREAM(channel)); FILE_STREAM(channel) = NULL; } UNLOCK(&lctx->lock); } /**** **** Internal functions ****/ static isc_result_t assignchannel(isc_logconfig_t *lcfg, unsigned int category_id, const isc_logmodule_t *module, isc_logchannel_t *channel) { isc_logchannellist_t *new_item; isc_log_t *lctx; isc_result_t result; REQUIRE(VALID_CONFIG(lcfg)); lctx = lcfg->lctx; REQUIRE(category_id < lctx->category_count); REQUIRE(module == NULL || module->id < lctx->module_count); REQUIRE(channel != NULL); /* * Ensure lcfg->channellist_count == lctx->category_count. */ result = sync_channellist(lcfg); if (result != ISC_R_SUCCESS) return (result); new_item = isc_mem_get(lctx->mctx, sizeof(*new_item)); if (new_item == NULL) return (ISC_R_NOMEMORY); new_item->channel = channel; new_item->module = module; ISC_LIST_INITANDPREPEND(lcfg->channellists[category_id], new_item, link); /* * Remember the highest logging level set by any channel in the * logging config, so isc_log_doit() can quickly return if the * message is too high to be logged by any channel. */ if (channel->type != ISC_LOG_TONULL) { if (lcfg->highest_level < channel->level) lcfg->highest_level = channel->level; if (channel->level == ISC_LOG_DYNAMIC) lcfg->dynamic = ISC_TRUE; } return (ISC_R_SUCCESS); } /* * This would ideally be part of isc_log_registercategories(), except then * that function would have to return isc_result_t instead of void. */ static isc_result_t sync_channellist(isc_logconfig_t *lcfg) { unsigned int bytes; isc_log_t *lctx; void *lists; REQUIRE(VALID_CONFIG(lcfg)); lctx = lcfg->lctx; REQUIRE(lctx->category_count != 0); if (lctx->category_count == lcfg->channellist_count) return (ISC_R_SUCCESS); bytes = lctx->category_count * sizeof(ISC_LIST(isc_logchannellist_t)); lists = isc_mem_get(lctx->mctx, bytes); if (lists == NULL) return (ISC_R_NOMEMORY); memset(lists, 0, bytes); if (lcfg->channellist_count != 0) { bytes = lcfg->channellist_count * sizeof(ISC_LIST(isc_logchannellist_t)); memcpy(lists, lcfg->channellists, bytes); isc_mem_put(lctx->mctx, lcfg->channellists, bytes); } lcfg->channellists = lists; lcfg->channellist_count = lctx->category_count; return (ISC_R_SUCCESS); } static isc_result_t greatest_version(isc_logchannel_t *channel, int *greatestp) { /* XXXDCL HIGHLY NT */ char *basename, *digit_end; const char *dirname; int version, greatest = -1; unsigned int basenamelen; isc_dir_t dir; isc_result_t result; char sep = '/'; #ifdef _WIN32 char *basename2; #endif REQUIRE(channel->type == ISC_LOG_TOFILE); /* * 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); #ifdef _WIN32 basename2 = strrchr(FILE_NAME(channel), '\\'); if ((basename != NULL && basename2 != NULL && basename2 > basename) || (basename == NULL && basename2 != NULL)) { basename = basename2; sep = '\\'; } #endif if (basename != NULL) { *basename++ = '\0'; dirname = FILE_NAME(channel); } else { DE_CONST(FILE_NAME(channel), basename); dirname = "."; } basenamelen = strlen(basename); isc_dir_init(&dir); result = isc_dir_open(&dir, dirname); /* * Replace the file separator if it was taken out. */ if (basename != FILE_NAME(channel)) *(basename - 1) = sep; /* * Return if the directory open failed. */ if (result != ISC_R_SUCCESS) return (result); while (isc_dir_read(&dir) == ISC_R_SUCCESS) { if (dir.entry.length > basenamelen && strncmp(dir.entry.name, basename, basenamelen) == 0 && dir.entry.name[basenamelen] == '.') { version = strtol(&dir.entry.name[basenamelen + 1], &digit_end, 10); if (*digit_end == '\0' && version > greatest) greatest = version; } } isc_dir_close(&dir); *greatestp = ++greatest; return (ISC_R_SUCCESS); } static isc_result_t roll_log(isc_logchannel_t *channel) { int i, n, greatest; char current[PATH_MAX + 1]; char new[PATH_MAX + 1]; const char *path; isc_result_t result; /* * Do nothing (not even excess version trimming) if ISC_LOG_ROLLNEVER * is specified. Apparently complete external control over the log * files is desired. */ if (FILE_VERSIONS(channel) == ISC_LOG_ROLLNEVER) return (ISC_R_SUCCESS); path = FILE_NAME(channel); /* * Set greatest_version to the greatest existing version * (not the maximum requested version). This is 1 based even * though the file names are 0 based, so an oldest log of log.1 * is a greatest_version of 2. */ result = greatest_version(channel, &greatest); if (result != ISC_R_SUCCESS) return (result); /* * Now greatest should be set to the highest version number desired. * Since the highest number is one less than FILE_VERSIONS(channel) * when not doing infinite log rolling, greatest will need to be * decremented when it is equal to -- or greater than -- * FILE_VERSIONS(channel). When greatest is less than * FILE_VERSIONS(channel), it is already suitable for use as * the maximum version number. */ if (FILE_VERSIONS(channel) == ISC_LOG_ROLLINFINITE || FILE_VERSIONS(channel) > greatest) ; /* Do nothing. */ else /* * When greatest is >= FILE_VERSIONS(channel), it needs to * be reduced until it is FILE_VERSIONS(channel) - 1. * Remove any excess logs on the way to that value. */ while (--greatest >= FILE_VERSIONS(channel)) { n = snprintf(current, sizeof(current), "%s.%d", path, greatest); if (n >= (int)sizeof(current) || n < 0) result = ISC_R_NOSPACE; else result = isc_file_remove(current); if (result != ISC_R_SUCCESS && result != ISC_R_FILENOTFOUND) syslog(LOG_ERR, "unable to remove log file '%s.%d': %s", path, greatest, isc_result_totext(result)); } for (i = greatest; i > 0; i--) { result = ISC_R_SUCCESS; n = snprintf(current, sizeof(current), "%s.%d", path, i - 1); if (n >= (int)sizeof(current) || n < 0) result = ISC_R_NOSPACE; if (result == ISC_R_SUCCESS) { n = snprintf(new, sizeof(new), "%s.%d", path, i); if (n >= (int)sizeof(new) || n < 0) result = ISC_R_NOSPACE; } if (result == ISC_R_SUCCESS) result = isc_file_rename(current, new); if (result != ISC_R_SUCCESS && result != ISC_R_FILENOTFOUND) syslog(LOG_ERR, "unable to rename log file '%s.%d' to " "'%s.%d': %s", path, i - 1, path, i, isc_result_totext(result)); } if (FILE_VERSIONS(channel) != 0) { n = snprintf(new, sizeof(new), "%s.0", path); if (n >= (int)sizeof(new) || n < 0) result = ISC_R_NOSPACE; else result = isc_file_rename(path, new); if (result != ISC_R_SUCCESS && result != ISC_R_FILENOTFOUND) syslog(LOG_ERR, "unable to rename log file '%s' to '%s.0': %s", path, path, isc_result_totext(result)); } else { result = isc_file_remove(path); if (result != ISC_R_SUCCESS && result != ISC_R_FILENOTFOUND) syslog(LOG_ERR, "unable to remove log file '%s': %s", path, isc_result_totext(result)); } return (ISC_R_SUCCESS); } static isc_result_t isc_log_open(isc_logchannel_t *channel) { struct stat statbuf; isc_boolean_t regular_file; isc_boolean_t roll = ISC_FALSE; isc_result_t result = ISC_R_SUCCESS; const char *path; REQUIRE(channel->type == ISC_LOG_TOFILE); REQUIRE(FILE_STREAM(channel) == NULL); path = FILE_NAME(channel); REQUIRE(path != NULL && *path != '\0'); /* * Determine type of file; only regular files will be * version renamed, and only if the base file exists * and either has no size limit or has reached its size limit. */ if (stat(path, &statbuf) == 0) { regular_file = S_ISREG(statbuf.st_mode) ? ISC_TRUE : ISC_FALSE; /* XXXDCL if not regular_file complain? */ if ((FILE_MAXSIZE(channel) == 0 && FILE_VERSIONS(channel) != ISC_LOG_ROLLNEVER) || (FILE_MAXSIZE(channel) > 0 && statbuf.st_size >= FILE_MAXSIZE(channel))) roll = regular_file; } else if (errno == ENOENT) regular_file = ISC_TRUE; else result = ISC_R_INVALIDFILE; /* * Version control. */ if (result == ISC_R_SUCCESS && roll) { if (FILE_VERSIONS(channel) == ISC_LOG_ROLLNEVER) return (ISC_R_MAXSIZE); result = roll_log(channel); if (result != ISC_R_SUCCESS) { if ((channel->flags & ISC_LOG_OPENERR) == 0) { syslog(LOG_ERR, "isc_log_open: roll_log '%s' " "failed: %s", FILE_NAME(channel), isc_result_totext(result)); channel->flags |= ISC_LOG_OPENERR; } return (result); } } result = isc_stdio_open(path, "a", &FILE_STREAM(channel)); return (result); } isc_boolean_t isc_log_wouldlog(isc_log_t *lctx, int level) { /* * Try to avoid locking the mutex for messages which can't * possibly be logged to any channels -- primarily debugging * messages that the debug level is not high enough to print. * * If the level is (mathematically) less than or equal to the * highest_level, or if there is a dynamic channel and the level is * less than or equal to the debug level, the main loop must be * entered to see if the message should really be output. * * NOTE: this is UNLOCKED access to the logconfig. However, * the worst thing that can happen is that a bad decision is made * about returning without logging, and that's not a big concern, * because that's a risk anyway if the logconfig is being * dynamically changed. */ if (lctx == NULL || lctx->logconfig == NULL) return (ISC_FALSE); return (ISC_TF(level <= lctx->logconfig->highest_level || (lctx->logconfig->dynamic && level <= lctx->debug_level))); } static void isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_boolean_t write_once, isc_msgcat_t *msgcat, int msgset, int msg, const char *format, va_list args) { int syslog_level; char time_string[64]; char level_string[24]; const char *iformat; struct stat statbuf; isc_boolean_t matched = ISC_FALSE; isc_boolean_t printtime, printtag; isc_boolean_t printcategory, printmodule, printlevel; isc_logconfig_t *lcfg; isc_logchannel_t *channel; isc_logchannellist_t *category_channels; isc_result_t result; REQUIRE(lctx == NULL || VALID_CONTEXT(lctx)); REQUIRE(category != NULL); REQUIRE(module != NULL); REQUIRE(level != ISC_LOG_DYNAMIC); REQUIRE(format != NULL); /* * Programs can use libraries that use this logging code without * wanting to do any logging, thus the log context is allowed to * be non-existent. */ if (lctx == NULL) return; REQUIRE(category->id < lctx->category_count); REQUIRE(module->id < lctx->module_count); if (! isc_log_wouldlog(lctx, level)) return; if (msgcat != NULL) iformat = isc_msgcat_get(msgcat, msgset, msg, format); else iformat = format; time_string[0] = '\0'; level_string[0] = '\0'; LOCK(&lctx->lock); lctx->buffer[0] = '\0'; lcfg = lctx->logconfig; category_channels = ISC_LIST_HEAD(lcfg->channellists[category->id]); /* * XXXDCL add duplicate filtering? (To not write multiple times to * the same source via various channels). */ do { /* * If the channel list end was reached and a match was made, * everything is finished. */ if (category_channels == NULL && matched) break; if (category_channels == NULL && ! matched && category_channels != ISC_LIST_HEAD(lcfg->channellists[0])) /* * No category/module pair was explicitly configured. * Try the category named "default". */ category_channels = ISC_LIST_HEAD(lcfg->channellists[0]); if (category_channels == NULL && ! matched) /* * No matching module was explicitly configured * for the category named "default". Use the internal * default channel. */ category_channels = &default_channel; if (category_channels->module != NULL && category_channels->module != module) { category_channels = ISC_LIST_NEXT(category_channels, link); continue; } matched = ISC_TRUE; channel = category_channels->channel; category_channels = ISC_LIST_NEXT(category_channels, link); if (((channel->flags & ISC_LOG_DEBUGONLY) != 0) && lctx->debug_level == 0) continue; if (channel->level == ISC_LOG_DYNAMIC) { if (lctx->debug_level < level) continue; } else if (channel->level < level) continue; if ((channel->flags & ISC_LOG_PRINTTIME) != 0 && time_string[0] == '\0') { isc_time_t isctime; TIME_NOW(&isctime); isc_time_formattimestamp(&isctime, time_string, sizeof(time_string)); } if ((channel->flags & ISC_LOG_PRINTLEVEL) != 0 && level_string[0] == '\0') { if (level < ISC_LOG_CRITICAL) snprintf(level_string, sizeof(level_string), isc_msgcat_get(isc_msgcat, ISC_MSGSET_LOG, ISC_MSG_LEVEL, "level %d: "), level); else if (level > ISC_LOG_DYNAMIC) snprintf(level_string, sizeof(level_string), "%s %d: ", log_level_strings[0], level); else snprintf(level_string, sizeof(level_string), "%s: ", log_level_strings[-level]); } /* * Only format the message once. */ if (lctx->buffer[0] == '\0') { (void)vsnprintf(lctx->buffer, sizeof(lctx->buffer), iformat, args); /* * Check for duplicates. */ if (write_once) { isc_logmessage_t *message, *new; isc_time_t oldest; isc_interval_t interval; isc_interval_set(&interval, lcfg->duplicate_interval, 0); /* * 'oldest' is the age of the oldest messages * which fall within the duplicate_interval * range. */ TIME_NOW(&oldest); if (isc_time_subtract(&oldest, &interval, &oldest) != ISC_R_SUCCESS) /* * Can't effectively do the checking * without having a valid time. */ message = NULL; else message =ISC_LIST_HEAD(lctx->messages); while (message != NULL) { if (isc_time_compare(&message->time, &oldest) < 0) { /* * This message is older * than the duplicate_interval, * so it should be dropped from * the history. * * Setting the interval to be * to be longer will obviously * not cause the expired * message to spring back into * existence. */ new = ISC_LIST_NEXT(message, link); ISC_LIST_UNLINK(lctx->messages, message, link); isc_mem_put(lctx->mctx, message, sizeof(*message) + 1 + strlen(message->text)); message = new; continue; } /* * This message is in the duplicate * filtering interval ... */ if (strcmp(lctx->buffer, message->text) == 0) { /* * ... and it is a duplicate. * Unlock the mutex and * get the hell out of Dodge. */ UNLOCK(&lctx->lock); return; } message = ISC_LIST_NEXT(message, link); } /* * It wasn't in the duplicate interval, * so add it to the message list. */ new = isc_mem_get(lctx->mctx, sizeof(isc_logmessage_t) + strlen(lctx->buffer) + 1); if (new != NULL) { /* * Put the text immediately after * the struct. The strcpy is safe. */ new->text = (char *)(new + 1); strcpy(new->text, lctx->buffer); TIME_NOW(&new->time); ISC_LIST_APPEND(lctx->messages, new, link); } } } printtime = ISC_TF((channel->flags & ISC_LOG_PRINTTIME) != 0); printtag = ISC_TF((channel->flags & ISC_LOG_PRINTTAG) != 0 && lcfg->tag != NULL); printcategory = ISC_TF((channel->flags & ISC_LOG_PRINTCATEGORY) != 0); printmodule = ISC_TF((channel->flags & ISC_LOG_PRINTMODULE) != 0); printlevel = ISC_TF((channel->flags & ISC_LOG_PRINTLEVEL) != 0); switch (channel->type) { case ISC_LOG_TOFILE: if (FILE_MAXREACHED(channel)) { /* * If the file can be rolled, OR * If the file no longer exists, OR * If the file is less than the maximum size, * (such as if it had been renamed and * a new one touched, or it was truncated * in place) * ... then close it to trigger reopening. */ if (FILE_VERSIONS(channel) != ISC_LOG_ROLLNEVER || (stat(FILE_NAME(channel), &statbuf) != 0 && errno == ENOENT) || statbuf.st_size < FILE_MAXSIZE(channel)) { (void)fclose(FILE_STREAM(channel)); FILE_STREAM(channel) = NULL; FILE_MAXREACHED(channel) = ISC_FALSE; } else /* * Eh, skip it. */ break; } if (FILE_STREAM(channel) == NULL) { result = isc_log_open(channel); if (result != ISC_R_SUCCESS && result != ISC_R_MAXSIZE && (channel->flags & ISC_LOG_OPENERR) == 0) { syslog(LOG_ERR, "isc_log_open '%s' failed: %s", FILE_NAME(channel), isc_result_totext(result)); channel->flags |= ISC_LOG_OPENERR; } if (result != ISC_R_SUCCESS) break; channel->flags &= ~ISC_LOG_OPENERR; } /* FALLTHROUGH */ case ISC_LOG_TOFILEDESC: fprintf(FILE_STREAM(channel), "%s%s%s%s%s%s%s%s%s%s\n", printtime ? time_string : "", printtime ? " " : "", printtag ? lcfg->tag : "", printtag ? ": " : "", printcategory ? category->name : "", printcategory ? ": " : "", printmodule ? (module != NULL ? module->name : "no_module") : "", printmodule ? ": " : "", printlevel ? level_string : "", lctx->buffer); fflush(FILE_STREAM(channel)); /* * If the file now exceeds its maximum size * threshold, note it so that it will not be logged * to any more. */ if (FILE_MAXSIZE(channel) > 0) { INSIST(channel->type == ISC_LOG_TOFILE); /* XXXDCL NT fstat/fileno */ /* XXXDCL complain if fstat fails? */ if (fstat(fileno(FILE_STREAM(channel)), &statbuf) >= 0 && statbuf.st_size > FILE_MAXSIZE(channel)) FILE_MAXREACHED(channel) = ISC_TRUE; } break; case ISC_LOG_TOSYSLOG: if (level > 0) syslog_level = LOG_DEBUG; else if (level < ISC_LOG_CRITICAL) syslog_level = LOG_CRIT; else syslog_level = syslog_map[-level]; (void)syslog(FACILITY(channel) | syslog_level, "%s%s%s%s%s%s%s%s%s%s", printtime ? time_string : "", printtime ? " " : "", printtag ? lcfg->tag : "", printtag ? ": " : "", printcategory ? category->name : "", printcategory ? ": " : "", printmodule ? (module != NULL ? module->name : "no_module") : "", printmodule ? ": " : "", printlevel ? level_string : "", lctx->buffer); break; case ISC_LOG_TONULL: break; } } while (1); UNLOCK(&lctx->lock); } ntp-4.2.6p5/lib/isc/nls/0000755000175000017500000000000011675461367013751 5ustar peterpeterntp-4.2.6p5/lib/isc/nls/msgcat.c0000644000175000017500000000603311307651604015360 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: msgcat.c,v 1.18 2007/06/19 23:47:18 tbox Exp $ */ /*! \file msgcat.c * * \author Principal Author: Bob Halley */ #include #include #include #include #include #include #ifdef HAVE_CATGETS #include /* Required for nl_catd. */ #endif /* * Implementation Notes: * * We use malloc() and free() instead of isc_mem_get() and isc_mem_put() * because we don't want to require a memory context to be specified * in order to use a message catalog. */ struct isc_msgcat { unsigned int magic; #ifdef HAVE_CATGETS nl_catd catalog; #endif }; #define MSGCAT_MAGIC ISC_MAGIC('M', 'C', 'a', 't') #define VALID_MSGCAT(m) ISC_MAGIC_VALID(m, MSGCAT_MAGIC) void isc_msgcat_open(const char *name, isc_msgcat_t **msgcatp) { isc_msgcat_t *msgcat; /* * Open a message catalog. */ REQUIRE(name != NULL); REQUIRE(msgcatp != NULL && *msgcatp == NULL); msgcat = malloc(sizeof(*msgcat)); if (msgcat == NULL) { *msgcatp = NULL; return; } #ifdef HAVE_CATGETS /* * We don't check if catopen() fails because we don't care. * If it does fail, then when we call catgets(), it will use * the default string. */ msgcat->catalog = catopen(name, 0); #endif msgcat->magic = MSGCAT_MAGIC; *msgcatp = msgcat; } void isc_msgcat_close(isc_msgcat_t **msgcatp) { isc_msgcat_t *msgcat; /* * Close a message catalog. */ REQUIRE(msgcatp != NULL); msgcat = *msgcatp; REQUIRE(VALID_MSGCAT(msgcat) || msgcat == NULL); if (msgcat != NULL) { #ifdef HAVE_CATGETS if (msgcat->catalog != (nl_catd)(-1)) (void)catclose(msgcat->catalog); #endif msgcat->magic = 0; free(msgcat); } *msgcatp = NULL; } const char * isc_msgcat_get(isc_msgcat_t *msgcat, int set, int message, const char *default_text) { /* * Get message 'message' from message set 'set' in 'msgcat'. If it * is not available, use 'default'. */ REQUIRE(VALID_MSGCAT(msgcat) || msgcat == NULL); REQUIRE(set > 0); REQUIRE(message > 0); REQUIRE(default_text != NULL); #ifdef HAVE_CATGETS if (msgcat == NULL) return (default_text); return (catgets(msgcat->catalog, set, message, default_text)); #else return (default_text); #endif } ntp-4.2.6p5/lib/isc/alpha/0000755000175000017500000000000011307651602014223 5ustar peterpeterntp-4.2.6p5/lib/isc/alpha/include/0000755000175000017500000000000011307651602015646 5ustar peterpeterntp-4.2.6p5/lib/isc/alpha/include/isc/0000755000175000017500000000000011675461367016443 5ustar peterpeterntp-4.2.6p5/lib/isc/alpha/include/isc/atomic.h0000644000175000017500000001324311307651604020056 0ustar peterpeter/* * Copyright (C) 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: atomic.h,v 1.5.332.2 2009/04/08 06:47:32 tbox Exp $ */ /* * This code was written based on FreeBSD's kernel source whose copyright * follows: */ /*- * Copyright (c) 1998 Doug Rabson * 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. * * $FreeBSD: src/sys/alpha/include/atomic.h,v 1.18.6.1 2004/09/13 21:52:04 wilko Exp $ */ #ifndef ISC_ATOMIC_H #define ISC_ATOMIC_H 1 #include #include #ifdef ISC_PLATFORM_USEOSFASM #include #pragma intrinsic(asm) /* * This routine atomically increments the value stored in 'p' by 'val', and * returns the previous value. Memory access ordering around this function * can be critical, so we add explicit memory block instructions at the * beginning and the end of it (same for other functions). */ static inline isc_int32_t isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { return (asm("mb;" "1:" "ldl_l %t0, 0(%a0);" /* load old value */ "mov %t0, %v0;" /* copy the old value */ "addl %t0, %a1, %t0;" /* calculate new value */ "stl_c %t0, 0(%a0);" /* attempt to store */ "beq %t0, 1b;" /* spin if failed */ "mb;", p, val)); } /* * This routine atomically stores the value 'val' in 'p'. */ static inline void isc_atomic_store(isc_int32_t *p, isc_int32_t val) { (void)asm("mb;" "1:" "ldl_l %t0, 0(%a0);" /* load old value */ "mov %a1, %t0;" /* value to store */ "stl_c %t0, 0(%a0);" /* attempt to store */ "beq %t0, 1b;" /* spin if failed */ "mb;", p, val); } /* * This routine atomically replaces the value in 'p' with 'val', if the * original value is equal to 'cmpval'. The original value is returned in any * case. */ static inline isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { return(asm("mb;" "1:" "ldl_l %t0, 0(%a0);" /* load old value */ "mov %t0, %v0;" /* copy the old value */ "cmpeq %t0, %a1, %t0;" /* compare */ "beq %t0, 2f;" /* exit if not equal */ "mov %a2, %t0;" /* value to store */ "stl_c %t0, 0(%a0);" /* attempt to store */ "beq %t0, 1b;" /* if it failed, spin */ "2:" "mb;", p, cmpval, val)); } #elif defined (ISC_PLATFORM_USEGCCASM) static inline isc_int32_t isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { isc_int32_t temp, prev; __asm__ volatile( "mb;" "1:" "ldl_l %0, %1;" /* load old value */ "mov %0, %2;" /* copy the old value */ "addl %0, %3, %0;" /* calculate new value */ "stl_c %0, %1;" /* attempt to store */ "beq %0, 1b;" /* spin if failed */ "mb;" : "=&r"(temp), "+m"(*p), "=&r"(prev) : "r"(val) : "memory"); return (prev); } static inline void isc_atomic_store(isc_int32_t *p, isc_int32_t val) { isc_int32_t temp; __asm__ volatile( "mb;" "1:" "ldl_l %0, %1;" /* load old value */ "mov %2, %0;" /* value to store */ "stl_c %0, %1;" /* attempt to store */ "beq %0, 1b;" /* if it failed, spin */ "mb;" : "=&r"(temp), "+m"(*p) : "r"(val) : "memory"); } static inline isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { isc_int32_t temp, prev; __asm__ volatile( "mb;" "1:" "ldl_l %0, %1;" /* load old value */ "mov %0, %2;" /* copy the old value */ "cmpeq %0, %3, %0;" /* compare */ "beq %0, 2f;" /* exit if not equal */ "mov %4, %0;" /* value to store */ "stl_c %0, %1;" /* attempt to store */ "beq %0, 1b;" /* if it failed, spin */ "2:" "mb;" : "=&r"(temp), "+m"(*p), "=&r"(prev) : "r"(cmpval), "r"(val) : "memory"); return (prev); } #else #error "unsupported compiler. disable atomic ops by --disable-atomic" #endif #endif /* ISC_ATOMIC_H */ ntp-4.2.6p5/lib/isc/hmacmd5.c0000644000175000017500000000626411307651603014631 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: hmacmd5.c,v 1.14 2007/06/19 23:47:17 tbox Exp $ */ /*! \file * This code implements the HMAC-MD5 keyed hash algorithm * described in RFC2104. */ #include "config.h" #include #include #include #include #include #include #define PADLEN 64 #define IPAD 0x36 #define OPAD 0x5C /*! * Start HMAC-MD5 process. Initialize an md5 context and digest the key. */ void isc_hmacmd5_init(isc_hmacmd5_t *ctx, const unsigned char *key, unsigned int len) { unsigned char ipad[PADLEN]; int i; memset(ctx->key, 0, sizeof(ctx->key)); if (len > sizeof(ctx->key)) { isc_md5_t md5ctx; isc_md5_init(&md5ctx); isc_md5_update(&md5ctx, key, len); isc_md5_final(&md5ctx, ctx->key); } else memcpy(ctx->key, key, len); isc_md5_init(&ctx->md5ctx); memset(ipad, IPAD, sizeof(ipad)); for (i = 0; i < PADLEN; i++) ipad[i] ^= ctx->key[i]; isc_md5_update(&ctx->md5ctx, ipad, sizeof(ipad)); } void isc_hmacmd5_invalidate(isc_hmacmd5_t *ctx) { isc_md5_invalidate(&ctx->md5ctx); memset(ctx->key, 0, sizeof(ctx->key)); } /*! * Update context to reflect the concatenation of another buffer full * of bytes. */ void isc_hmacmd5_update(isc_hmacmd5_t *ctx, const unsigned char *buf, unsigned int len) { isc_md5_update(&ctx->md5ctx, buf, len); } /*! * Compute signature - finalize MD5 operation and reapply MD5. */ void isc_hmacmd5_sign(isc_hmacmd5_t *ctx, unsigned char *digest) { unsigned char opad[PADLEN]; int i; isc_md5_final(&ctx->md5ctx, digest); memset(opad, OPAD, sizeof(opad)); for (i = 0; i < PADLEN; i++) opad[i] ^= ctx->key[i]; isc_md5_init(&ctx->md5ctx); isc_md5_update(&ctx->md5ctx, opad, sizeof(opad)); isc_md5_update(&ctx->md5ctx, digest, ISC_MD5_DIGESTLENGTH); isc_md5_final(&ctx->md5ctx, digest); isc_hmacmd5_invalidate(ctx); } /*! * Verify signature - finalize MD5 operation and reapply MD5, then * compare to the supplied digest. */ isc_boolean_t isc_hmacmd5_verify(isc_hmacmd5_t *ctx, unsigned char *digest) { return (isc_hmacmd5_verify2(ctx, digest, ISC_MD5_DIGESTLENGTH)); } isc_boolean_t isc_hmacmd5_verify2(isc_hmacmd5_t *ctx, unsigned char *digest, size_t len) { unsigned char newdigest[ISC_MD5_DIGESTLENGTH]; REQUIRE(len <= ISC_MD5_DIGESTLENGTH); isc_hmacmd5_sign(ctx, newdigest); return (ISC_TF(memcmp(digest, newdigest, len) == 0)); } ntp-4.2.6p5/lib/isc/hmacsha.c0000644000175000017500000003043111307651604014711 0ustar peterpeter/* * Copyright (C) 2005-2007 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: hmacsha.c,v 1.8 2007/08/27 03:27:53 marka Exp $ */ /* * This code implements the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384 * and HMAC-SHA512 keyed hash algorithm described in RFC 2104 and * draft-ietf-dnsext-tsig-sha-01.txt. */ #include "config.h" #include #include #include #include #include #include #include #define IPAD 0x36 #define OPAD 0x5C /* * Start HMAC-SHA1 process. Initialize an sha1 context and digest the key. */ void isc_hmacsha1_init(isc_hmacsha1_t *ctx, const unsigned char *key, unsigned int len) { unsigned char ipad[ISC_SHA1_BLOCK_LENGTH]; unsigned int i; memset(ctx->key, 0, sizeof(ctx->key)); if (len > sizeof(ctx->key)) { isc_sha1_t sha1ctx; isc_sha1_init(&sha1ctx); isc_sha1_update(&sha1ctx, key, len); isc_sha1_final(&sha1ctx, ctx->key); } else memcpy(ctx->key, key, len); isc_sha1_init(&ctx->sha1ctx); memset(ipad, IPAD, sizeof(ipad)); for (i = 0; i < ISC_SHA1_BLOCK_LENGTH; i++) ipad[i] ^= ctx->key[i]; isc_sha1_update(&ctx->sha1ctx, ipad, sizeof(ipad)); } void isc_hmacsha1_invalidate(isc_hmacsha1_t *ctx) { isc_sha1_invalidate(&ctx->sha1ctx); memset(ctx->key, 0, sizeof(ctx->key)); memset(ctx, 0, sizeof(ctx)); } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void isc_hmacsha1_update(isc_hmacsha1_t *ctx, const unsigned char *buf, unsigned int len) { isc_sha1_update(&ctx->sha1ctx, buf, len); } /* * Compute signature - finalize SHA1 operation and reapply SHA1. */ void isc_hmacsha1_sign(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len) { unsigned char opad[ISC_SHA1_BLOCK_LENGTH]; unsigned char newdigest[ISC_SHA1_DIGESTLENGTH]; unsigned int i; REQUIRE(len <= ISC_SHA1_DIGESTLENGTH); isc_sha1_final(&ctx->sha1ctx, newdigest); memset(opad, OPAD, sizeof(opad)); for (i = 0; i < ISC_SHA1_BLOCK_LENGTH; i++) opad[i] ^= ctx->key[i]; isc_sha1_init(&ctx->sha1ctx); isc_sha1_update(&ctx->sha1ctx, opad, sizeof(opad)); isc_sha1_update(&ctx->sha1ctx, newdigest, ISC_SHA1_DIGESTLENGTH); isc_sha1_final(&ctx->sha1ctx, newdigest); isc_hmacsha1_invalidate(ctx); memcpy(digest, newdigest, len); memset(newdigest, 0, sizeof(newdigest)); } /* * Verify signature - finalize SHA1 operation and reapply SHA1, then * compare to the supplied digest. */ isc_boolean_t isc_hmacsha1_verify(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len) { unsigned char newdigest[ISC_SHA1_DIGESTLENGTH]; REQUIRE(len <= ISC_SHA1_DIGESTLENGTH); isc_hmacsha1_sign(ctx, newdigest, ISC_SHA1_DIGESTLENGTH); return (ISC_TF(memcmp(digest, newdigest, len) == 0)); } /* * Start HMAC-SHA224 process. Initialize an sha224 context and digest the key. */ void isc_hmacsha224_init(isc_hmacsha224_t *ctx, const unsigned char *key, unsigned int len) { unsigned char ipad[ISC_SHA224_BLOCK_LENGTH]; unsigned int i; memset(ctx->key, 0, sizeof(ctx->key)); if (len > sizeof(ctx->key)) { isc_sha224_t sha224ctx; isc_sha224_init(&sha224ctx); isc_sha224_update(&sha224ctx, key, len); isc_sha224_final(ctx->key, &sha224ctx); } else memcpy(ctx->key, key, len); isc_sha224_init(&ctx->sha224ctx); memset(ipad, IPAD, sizeof(ipad)); for (i = 0; i < ISC_SHA224_BLOCK_LENGTH; i++) ipad[i] ^= ctx->key[i]; isc_sha224_update(&ctx->sha224ctx, ipad, sizeof(ipad)); } void isc_hmacsha224_invalidate(isc_hmacsha224_t *ctx) { memset(ctx->key, 0, sizeof(ctx->key)); memset(ctx, 0, sizeof(ctx)); } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void isc_hmacsha224_update(isc_hmacsha224_t *ctx, const unsigned char *buf, unsigned int len) { isc_sha224_update(&ctx->sha224ctx, buf, len); } /* * Compute signature - finalize SHA224 operation and reapply SHA224. */ void isc_hmacsha224_sign(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len) { unsigned char opad[ISC_SHA224_BLOCK_LENGTH]; unsigned char newdigest[ISC_SHA224_DIGESTLENGTH]; unsigned int i; REQUIRE(len <= ISC_SHA224_DIGESTLENGTH); isc_sha224_final(newdigest, &ctx->sha224ctx); memset(opad, OPAD, sizeof(opad)); for (i = 0; i < ISC_SHA224_BLOCK_LENGTH; i++) opad[i] ^= ctx->key[i]; isc_sha224_init(&ctx->sha224ctx); isc_sha224_update(&ctx->sha224ctx, opad, sizeof(opad)); isc_sha224_update(&ctx->sha224ctx, newdigest, ISC_SHA224_DIGESTLENGTH); isc_sha224_final(newdigest, &ctx->sha224ctx); memcpy(digest, newdigest, len); memset(newdigest, 0, sizeof(newdigest)); } /* * Verify signature - finalize SHA224 operation and reapply SHA224, then * compare to the supplied digest. */ isc_boolean_t isc_hmacsha224_verify(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len) { unsigned char newdigest[ISC_SHA224_DIGESTLENGTH]; REQUIRE(len <= ISC_SHA224_DIGESTLENGTH); isc_hmacsha224_sign(ctx, newdigest, ISC_SHA224_DIGESTLENGTH); return (ISC_TF(memcmp(digest, newdigest, len) == 0)); } /* * Start HMAC-SHA256 process. Initialize an sha256 context and digest the key. */ void isc_hmacsha256_init(isc_hmacsha256_t *ctx, const unsigned char *key, unsigned int len) { unsigned char ipad[ISC_SHA256_BLOCK_LENGTH]; unsigned int i; memset(ctx->key, 0, sizeof(ctx->key)); if (len > sizeof(ctx->key)) { isc_sha256_t sha256ctx; isc_sha256_init(&sha256ctx); isc_sha256_update(&sha256ctx, key, len); isc_sha256_final(ctx->key, &sha256ctx); } else memcpy(ctx->key, key, len); isc_sha256_init(&ctx->sha256ctx); memset(ipad, IPAD, sizeof(ipad)); for (i = 0; i < ISC_SHA256_BLOCK_LENGTH; i++) ipad[i] ^= ctx->key[i]; isc_sha256_update(&ctx->sha256ctx, ipad, sizeof(ipad)); } void isc_hmacsha256_invalidate(isc_hmacsha256_t *ctx) { memset(ctx->key, 0, sizeof(ctx->key)); memset(ctx, 0, sizeof(ctx)); } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void isc_hmacsha256_update(isc_hmacsha256_t *ctx, const unsigned char *buf, unsigned int len) { isc_sha256_update(&ctx->sha256ctx, buf, len); } /* * Compute signature - finalize SHA256 operation and reapply SHA256. */ void isc_hmacsha256_sign(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len) { unsigned char opad[ISC_SHA256_BLOCK_LENGTH]; unsigned char newdigest[ISC_SHA256_DIGESTLENGTH]; unsigned int i; REQUIRE(len <= ISC_SHA256_DIGESTLENGTH); isc_sha256_final(newdigest, &ctx->sha256ctx); memset(opad, OPAD, sizeof(opad)); for (i = 0; i < ISC_SHA256_BLOCK_LENGTH; i++) opad[i] ^= ctx->key[i]; isc_sha256_init(&ctx->sha256ctx); isc_sha256_update(&ctx->sha256ctx, opad, sizeof(opad)); isc_sha256_update(&ctx->sha256ctx, newdigest, ISC_SHA256_DIGESTLENGTH); isc_sha256_final(newdigest, &ctx->sha256ctx); memcpy(digest, newdigest, len); memset(newdigest, 0, sizeof(newdigest)); } /* * Verify signature - finalize SHA256 operation and reapply SHA256, then * compare to the supplied digest. */ isc_boolean_t isc_hmacsha256_verify(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len) { unsigned char newdigest[ISC_SHA256_DIGESTLENGTH]; REQUIRE(len <= ISC_SHA256_DIGESTLENGTH); isc_hmacsha256_sign(ctx, newdigest, ISC_SHA256_DIGESTLENGTH); return (ISC_TF(memcmp(digest, newdigest, len) == 0)); } /* * Start HMAC-SHA384 process. Initialize an sha384 context and digest the key. */ void isc_hmacsha384_init(isc_hmacsha384_t *ctx, const unsigned char *key, unsigned int len) { unsigned char ipad[ISC_SHA384_BLOCK_LENGTH]; unsigned int i; memset(ctx->key, 0, sizeof(ctx->key)); if (len > sizeof(ctx->key)) { isc_sha384_t sha384ctx; isc_sha384_init(&sha384ctx); isc_sha384_update(&sha384ctx, key, len); isc_sha384_final(ctx->key, &sha384ctx); } else memcpy(ctx->key, key, len); isc_sha384_init(&ctx->sha384ctx); memset(ipad, IPAD, sizeof(ipad)); for (i = 0; i < ISC_SHA384_BLOCK_LENGTH; i++) ipad[i] ^= ctx->key[i]; isc_sha384_update(&ctx->sha384ctx, ipad, sizeof(ipad)); } void isc_hmacsha384_invalidate(isc_hmacsha384_t *ctx) { memset(ctx->key, 0, sizeof(ctx->key)); memset(ctx, 0, sizeof(ctx)); } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void isc_hmacsha384_update(isc_hmacsha384_t *ctx, const unsigned char *buf, unsigned int len) { isc_sha384_update(&ctx->sha384ctx, buf, len); } /* * Compute signature - finalize SHA384 operation and reapply SHA384. */ void isc_hmacsha384_sign(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len) { unsigned char opad[ISC_SHA384_BLOCK_LENGTH]; unsigned char newdigest[ISC_SHA384_DIGESTLENGTH]; unsigned int i; REQUIRE(len <= ISC_SHA384_DIGESTLENGTH); isc_sha384_final(newdigest, &ctx->sha384ctx); memset(opad, OPAD, sizeof(opad)); for (i = 0; i < ISC_SHA384_BLOCK_LENGTH; i++) opad[i] ^= ctx->key[i]; isc_sha384_init(&ctx->sha384ctx); isc_sha384_update(&ctx->sha384ctx, opad, sizeof(opad)); isc_sha384_update(&ctx->sha384ctx, newdigest, ISC_SHA384_DIGESTLENGTH); isc_sha384_final(newdigest, &ctx->sha384ctx); memcpy(digest, newdigest, len); memset(newdigest, 0, sizeof(newdigest)); } /* * Verify signature - finalize SHA384 operation and reapply SHA384, then * compare to the supplied digest. */ isc_boolean_t isc_hmacsha384_verify(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len) { unsigned char newdigest[ISC_SHA384_DIGESTLENGTH]; REQUIRE(len <= ISC_SHA384_DIGESTLENGTH); isc_hmacsha384_sign(ctx, newdigest, ISC_SHA384_DIGESTLENGTH); return (ISC_TF(memcmp(digest, newdigest, len) == 0)); } /* * Start HMAC-SHA512 process. Initialize an sha512 context and digest the key. */ void isc_hmacsha512_init(isc_hmacsha512_t *ctx, const unsigned char *key, unsigned int len) { unsigned char ipad[ISC_SHA512_BLOCK_LENGTH]; unsigned int i; memset(ctx->key, 0, sizeof(ctx->key)); if (len > sizeof(ctx->key)) { isc_sha512_t sha512ctx; isc_sha512_init(&sha512ctx); isc_sha512_update(&sha512ctx, key, len); isc_sha512_final(ctx->key, &sha512ctx); } else memcpy(ctx->key, key, len); isc_sha512_init(&ctx->sha512ctx); memset(ipad, IPAD, sizeof(ipad)); for (i = 0; i < ISC_SHA512_BLOCK_LENGTH; i++) ipad[i] ^= ctx->key[i]; isc_sha512_update(&ctx->sha512ctx, ipad, sizeof(ipad)); } void isc_hmacsha512_invalidate(isc_hmacsha512_t *ctx) { memset(ctx->key, 0, sizeof(ctx->key)); memset(ctx, 0, sizeof(ctx)); } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void isc_hmacsha512_update(isc_hmacsha512_t *ctx, const unsigned char *buf, unsigned int len) { isc_sha512_update(&ctx->sha512ctx, buf, len); } /* * Compute signature - finalize SHA512 operation and reapply SHA512. */ void isc_hmacsha512_sign(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) { unsigned char opad[ISC_SHA512_BLOCK_LENGTH]; unsigned char newdigest[ISC_SHA512_DIGESTLENGTH]; unsigned int i; REQUIRE(len <= ISC_SHA512_DIGESTLENGTH); isc_sha512_final(newdigest, &ctx->sha512ctx); memset(opad, OPAD, sizeof(opad)); for (i = 0; i < ISC_SHA512_BLOCK_LENGTH; i++) opad[i] ^= ctx->key[i]; isc_sha512_init(&ctx->sha512ctx); isc_sha512_update(&ctx->sha512ctx, opad, sizeof(opad)); isc_sha512_update(&ctx->sha512ctx, newdigest, ISC_SHA512_DIGESTLENGTH); isc_sha512_final(newdigest, &ctx->sha512ctx); memcpy(digest, newdigest, len); memset(newdigest, 0, sizeof(newdigest)); } /* * Verify signature - finalize SHA512 operation and reapply SHA512, then * compare to the supplied digest. */ isc_boolean_t isc_hmacsha512_verify(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) { unsigned char newdigest[ISC_SHA512_DIGESTLENGTH]; REQUIRE(len <= ISC_SHA512_DIGESTLENGTH); isc_hmacsha512_sign(ctx, newdigest, ISC_SHA512_DIGESTLENGTH); return (ISC_TF(memcmp(digest, newdigest, len) == 0)); } ntp-4.2.6p5/lib/isc/taskpool.c0000644000175000017500000000501011307651604015134 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: taskpool.c,v 1.18 2007/06/18 23:47:44 tbox Exp $ */ /*! \file */ #include #include #include #include /*** *** Types. ***/ struct isc_taskpool { isc_mem_t * mctx; unsigned int ntasks; isc_task_t ** tasks; }; /*** *** Functions. ***/ isc_result_t isc_taskpool_create(isc_taskmgr_t *tmgr, isc_mem_t *mctx, unsigned int ntasks, unsigned int quantum, isc_taskpool_t **poolp) { unsigned int i; isc_taskpool_t *pool; isc_result_t result; INSIST(ntasks > 0); pool = isc_mem_get(mctx, sizeof(*pool)); if (pool == NULL) return (ISC_R_NOMEMORY); pool->mctx = mctx; pool->ntasks = ntasks; pool->tasks = isc_mem_get(mctx, ntasks * sizeof(isc_task_t *)); if (pool->tasks == NULL) { isc_mem_put(mctx, pool, sizeof(*pool)); return (ISC_R_NOMEMORY); } for (i = 0; i < ntasks; i++) pool->tasks[i] = NULL; for (i = 0; i < ntasks; i++) { result = isc_task_create(tmgr, quantum, &pool->tasks[i]); if (result != ISC_R_SUCCESS) { isc_taskpool_destroy(&pool); return (result); } isc_task_setname(pool->tasks[i], "taskpool", NULL); } *poolp = pool; return (ISC_R_SUCCESS); } void isc_taskpool_gettask(isc_taskpool_t *pool, unsigned int hash, isc_task_t **targetp) { isc_task_attach(pool->tasks[hash % pool->ntasks], targetp); } void isc_taskpool_destroy(isc_taskpool_t **poolp) { unsigned int i; isc_taskpool_t *pool = *poolp; for (i = 0; i < pool->ntasks; i++) { if (pool->tasks[i] != NULL) { isc_task_detach(&pool->tasks[i]); } } isc_mem_put(pool->mctx, pool->tasks, pool->ntasks * sizeof(isc_task_t *)); isc_mem_put(pool->mctx, pool, sizeof(*pool)); *poolp = NULL; } ntp-4.2.6p5/lib/isc/refcount.c0000644000175000017500000000232211307651604015130 0ustar peterpeter/* * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: refcount.c,v 1.5 2007/06/19 23:47:17 tbox Exp $ */ #include #include #include #include #include isc_result_t isc_refcount_init(isc_refcount_t *ref, unsigned int n) { REQUIRE(ref != NULL); ref->refs = n; #if defined(ISC_PLATFORM_USETHREADS) && !defined(ISC_PLATFORM_HAVEXADD) return (isc_mutex_init(&ref->lock)); #else return (ISC_R_SUCCESS); #endif } ntp-4.2.6p5/lib/isc/netaddr.c0000644000175000017500000002364411505336022014730 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: netaddr.c,v 1.38 2007/06/18 23:47:44 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include #include #include isc_boolean_t isc_netaddr_equal(const isc_netaddr_t *a, const isc_netaddr_t *b) { REQUIRE(a != NULL && b != NULL); if (a->family != b->family) return (ISC_FALSE); if (a->zone != b->zone) return (ISC_FALSE); switch (a->family) { case AF_INET: if (a->type.in.s_addr != b->type.in.s_addr) return (ISC_FALSE); break; case AF_INET6: if (memcmp(&a->type.in6, &b->type.in6, sizeof(a->type.in6)) != 0 || a->zone != b->zone) return (ISC_FALSE); break; #ifdef ISC_PLATFORM_HAVESYSUNH case AF_UNIX: if (strcmp(a->type.un, b->type.un) != 0) return (ISC_FALSE); break; #endif default: return (ISC_FALSE); } return (ISC_TRUE); } isc_boolean_t isc_netaddr_eqprefix(const isc_netaddr_t *a, const isc_netaddr_t *b, unsigned int prefixlen) { const unsigned char *pa, *pb; unsigned int ipabytes; /* Length of whole IP address in bytes */ unsigned int nbytes; /* Number of significant whole bytes */ unsigned int nbits; /* Number of significant leftover bits */ REQUIRE(a != NULL && b != NULL); if (a->family != b->family) return (ISC_FALSE); if (a->zone != b->zone && b->zone != 0) return (ISC_FALSE); switch (a->family) { case AF_INET: pa = (const unsigned char *) &a->type.in; pb = (const unsigned char *) &b->type.in; ipabytes = 4; break; case AF_INET6: pa = (const unsigned char *) &a->type.in6; pb = (const unsigned char *) &b->type.in6; ipabytes = 16; break; default: pa = pb = NULL; /* Avoid silly compiler warning. */ ipabytes = 0; /* Ditto. */ return (ISC_FALSE); } /* * Don't crash if we get a pattern like 10.0.0.1/9999999. */ if (prefixlen > ipabytes * 8) prefixlen = ipabytes * 8; nbytes = prefixlen / 8; nbits = prefixlen % 8; if (nbytes > 0) { if (memcmp(pa, pb, nbytes) != 0) return (ISC_FALSE); } if (nbits > 0) { unsigned int bytea, byteb, mask; INSIST(nbytes < ipabytes); INSIST(nbits < 8); bytea = pa[nbytes]; byteb = pb[nbytes]; mask = (0xFF << (8-nbits)) & 0xFF; if ((bytea & mask) != (byteb & mask)) return (ISC_FALSE); } return (ISC_TRUE); } isc_result_t isc_netaddr_totext(const isc_netaddr_t *netaddr, isc_buffer_t *target) { char abuf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255")]; char zbuf[sizeof("%4294967295")]; unsigned int alen; int zlen; const char *r; const void *type; REQUIRE(netaddr != NULL); switch (netaddr->family) { case AF_INET: type = &netaddr->type.in; break; case AF_INET6: type = &netaddr->type.in6; break; #ifdef ISC_PLATFORM_HAVESYSUNH case AF_UNIX: alen = strlen(netaddr->type.un); if (alen > isc_buffer_availablelength(target)) return (ISC_R_NOSPACE); isc_buffer_putmem(target, (const unsigned char *)(netaddr->type.un), alen); return (ISC_R_SUCCESS); #endif default: return (ISC_R_FAILURE); } r = inet_ntop(netaddr->family, type, abuf, sizeof(abuf)); if (r == NULL) return (ISC_R_FAILURE); alen = strlen(abuf); INSIST(alen < sizeof(abuf)); zlen = 0; if (netaddr->family == AF_INET6 && netaddr->zone != 0) { zlen = snprintf(zbuf, sizeof(zbuf), "%%%u", netaddr->zone); if (zlen < 0) return (ISC_R_FAILURE); INSIST((unsigned int)zlen < sizeof(zbuf)); } if (alen + zlen > isc_buffer_availablelength(target)) return (ISC_R_NOSPACE); isc_buffer_putmem(target, (unsigned char *)abuf, alen); isc_buffer_putmem(target, (unsigned char *)zbuf, zlen); return (ISC_R_SUCCESS); } void isc_netaddr_format(const isc_netaddr_t *na, char *array, unsigned int size) { isc_result_t result; isc_buffer_t buf; isc_buffer_init(&buf, array, size); result = isc_netaddr_totext(na, &buf); /* * Null terminate. */ if (result == ISC_R_SUCCESS) { if (isc_buffer_availablelength(&buf) >= 1) isc_buffer_putuint8(&buf, 0); else result = ISC_R_NOSPACE; } if (result != ISC_R_SUCCESS) { snprintf(array, size, isc_msgcat_get(isc_msgcat, ISC_MSGSET_NETADDR, ISC_MSG_UNKNOWNADDR, ""), na->family); array[size - 1] = '\0'; } } isc_result_t isc_netaddr_prefixok(const isc_netaddr_t *na, unsigned int prefixlen) { static const unsigned char zeros[16] = { 0 }; unsigned int nbits, nbytes, ipbytes; const unsigned char *p; switch (na->family) { case AF_INET: p = (const unsigned char *) &na->type.in; ipbytes = 4; if (prefixlen > 32) return (ISC_R_RANGE); break; case AF_INET6: p = (const unsigned char *) &na->type.in6; ipbytes = 16; if (prefixlen > 128) return (ISC_R_RANGE); break; default: ipbytes = 0; return (ISC_R_NOTIMPLEMENTED); } nbytes = prefixlen / 8; nbits = prefixlen % 8; if (nbits != 0) { if ((p[nbytes] & (0xff>>nbits)) != 0U) return (ISC_R_FAILURE); nbytes++; } if (memcmp(p + nbytes, zeros, ipbytes - nbytes) != 0) return (ISC_R_FAILURE); return (ISC_R_SUCCESS); } isc_result_t isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp) { unsigned int nbits, nbytes, ipbytes, i; const unsigned char *p; switch (s->family) { case AF_INET: p = (const unsigned char *) &s->type.in; ipbytes = 4; break; case AF_INET6: p = (const unsigned char *) &s->type.in6; ipbytes = 16; break; default: ipbytes = 0; return (ISC_R_NOTIMPLEMENTED); } nbytes = nbits = 0; for (i = 0; i < ipbytes; i++) { if (p[i] != 0xFF) break; } nbytes = i; if (i < ipbytes) { unsigned int c = p[nbytes]; while ((c & 0x80) != 0 && nbits < 8) { c <<= 1; nbits++; } if ((c & 0xFF) != 0) return (ISC_R_MASKNONCONTIG); i++; } for (; i < ipbytes; i++) { if (p[i] != 0) return (ISC_R_MASKNONCONTIG); i++; } *lenp = nbytes * 8 + nbits; return (ISC_R_SUCCESS); } void isc_netaddr_fromin(isc_netaddr_t *netaddr, const struct in_addr *ina) { memset(netaddr, 0, sizeof(*netaddr)); netaddr->family = AF_INET; netaddr->type.in = *ina; } void isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6) { memset(netaddr, 0, sizeof(*netaddr)); netaddr->family = AF_INET6; netaddr->type.in6 = *ina6; } isc_result_t isc_netaddr_frompath(isc_netaddr_t *netaddr, const char *path) { #ifdef ISC_PLATFORM_HAVESYSUNH if (strlen(path) > sizeof(netaddr->type.un) - 1) return (ISC_R_NOSPACE); memset(netaddr, 0, sizeof(*netaddr)); netaddr->family = AF_UNIX; strcpy(netaddr->type.un, path); netaddr->zone = 0; return (ISC_R_SUCCESS); #else UNUSED(netaddr); UNUSED(path); return (ISC_R_NOTIMPLEMENTED); #endif } void isc_netaddr_setzone(isc_netaddr_t *netaddr, isc_uint32_t zone) { /* we currently only support AF_INET6. */ REQUIRE(netaddr->family == AF_INET6); netaddr->zone = zone; } isc_uint32_t isc_netaddr_getzone(const isc_netaddr_t *netaddr) { return (netaddr->zone); } void isc_netaddr_fromsockaddr(isc_netaddr_t *t, const isc_sockaddr_t *s) { int family = s->type.sa.sa_family; t->family = family; switch (family) { case AF_INET: t->type.in = s->type.sin.sin_addr; t->zone = 0; break; case AF_INET6: memcpy(&t->type.in6, &s->type.sin6.sin6_addr, 16); #ifdef ISC_PLATFORM_HAVESCOPEID t->zone = s->type.sin6.sin6_scope_id; #else t->zone = 0; #endif break; #ifdef ISC_PLATFORM_HAVESYSUNH case AF_UNIX: memcpy(t->type.un, s->type.sunix.sun_path, sizeof(t->type.un)); t->zone = 0; break; #endif default: INSIST(0); } } void isc_netaddr_any(isc_netaddr_t *netaddr) { memset(netaddr, 0, sizeof(*netaddr)); netaddr->family = AF_INET; netaddr->type.in.s_addr = INADDR_ANY; } void isc_netaddr_any6(isc_netaddr_t *netaddr) { memset(netaddr, 0, sizeof(*netaddr)); netaddr->family = AF_INET6; netaddr->type.in6 = in6addr_any; } isc_boolean_t isc_netaddr_ismulticast(isc_netaddr_t *na) { switch (na->family) { case AF_INET: return (ISC_TF(ISC_IPADDR_ISMULTICAST(na->type.in.s_addr))); case AF_INET6: return (ISC_TF(IN6_IS_ADDR_MULTICAST(&na->type.in6))); default: return (ISC_FALSE); /* XXXMLG ? */ } } isc_boolean_t isc_netaddr_isexperimental(isc_netaddr_t *na) { switch (na->family) { case AF_INET: return (ISC_TF(ISC_IPADDR_ISEXPERIMENTAL(na->type.in.s_addr))); default: return (ISC_FALSE); /* XXXMLG ? */ } } isc_boolean_t isc_netaddr_islinklocal(isc_netaddr_t *na) { switch (na->family) { case AF_INET: return (ISC_FALSE); case AF_INET6: return (ISC_TF(IN6_IS_ADDR_LINKLOCAL(&na->type.in6))); default: return (ISC_FALSE); } } isc_boolean_t isc_netaddr_issitelocal(isc_netaddr_t *na) { switch (na->family) { case AF_INET: return (ISC_FALSE); case AF_INET6: return (ISC_TF(IN6_IS_ADDR_SITELOCAL(&na->type.in6))); default: return (ISC_FALSE); } } void isc_netaddr_fromv4mapped(isc_netaddr_t *t, const isc_netaddr_t *s) { isc_netaddr_t *src; DE_CONST(s, src); /* Must come before IN6_IS_ADDR_V4MAPPED. */ REQUIRE(s->family == AF_INET6); REQUIRE(IN6_IS_ADDR_V4MAPPED(&src->type.in6)); memset(t, 0, sizeof(*t)); t->family = AF_INET; memcpy(&t->type.in, (char *)&src->type.in6 + 12, 4); return; } ntp-4.2.6p5/lib/isc/print.c0000644000175000017500000003022611307651603014442 0ustar peterpeter/* * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: print.c,v 1.35 2008/02/18 23:46:59 tbox Exp $ */ /*! \file */ #include #include #include /* for sprintf() */ #include /* for strlen() */ #define ISC__PRINT_SOURCE /* Used to get the isc_print_* prototypes. */ #include #include #include #include #include #include int isc_print_sprintf(char *str, const char *format, ...) { va_list ap; va_start(ap, format); vsprintf(str, format, ap); va_end(ap); return (strlen(str)); } /*! * Return length of string that would have been written if not truncated. */ int isc_print_snprintf(char *str, size_t size, const char *format, ...) { va_list ap; int ret; va_start(ap, format); ret = vsnprintf(str, size, format, ap); va_end(ap); return (ret); } /*! * Return length of string that would have been written if not truncated. */ int isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) { int h; int l; int q; int alt; int zero; int left; int plus; int space; int neg; isc_int64_t tmpi; isc_uint64_t tmpui; unsigned long width; unsigned long precision; unsigned int length; char buf[1024]; char c; void *v; char *save = str; const char *cp; const char *head; int count = 0; int pad; int zeropad; int dot; double dbl; #ifdef HAVE_LONG_DOUBLE long double ldbl; #endif char fmt[32]; INSIST(str != NULL); INSIST(format != NULL); while (*format != '\0') { if (*format != '%') { if (size > 1) { *str++ = *format; size--; } count++; format++; continue; } format++; /* * Reset flags. */ dot = neg = space = plus = left = zero = alt = h = l = q = 0; width = precision = 0; head = ""; length = pad = zeropad = 0; do { if (*format == '#') { alt = 1; format++; } else if (*format == '-') { left = 1; zero = 0; format++; } else if (*format == ' ') { if (!plus) space = 1; format++; } else if (*format == '+') { plus = 1; space = 0; format++; } else if (*format == '0') { if (!left) zero = 1; format++; } else break; } while (1); /* * Width. */ if (*format == '*') { width = va_arg(ap, int); format++; } else if (isdigit((unsigned char)*format)) { char *e; width = strtoul(format, &e, 10); format = e; } /* * Precision. */ if (*format == '.') { format++; dot = 1; if (*format == '*') { precision = va_arg(ap, int); format++; } else if (isdigit((unsigned char)*format)) { char *e; precision = strtoul(format, &e, 10); format = e; } } switch (*format) { case '\0': continue; case '%': if (size > 1) { *str++ = *format; size--; } count++; break; case 'q': q = 1; format++; goto doint; case 'h': h = 1; format++; goto doint; case 'l': l = 1; format++; if (*format == 'l') { q = 1; format++; } goto doint; case 'n': case 'i': case 'd': case 'o': case 'u': case 'x': case 'X': doint: if (precision != 0) zero = 0; switch (*format) { case 'n': if (h) { short int *p; p = va_arg(ap, short *); REQUIRE(p != NULL); *p = str - save; } else if (l) { long int *p; p = va_arg(ap, long *); REQUIRE(p != NULL); *p = str - save; } else { int *p; p = va_arg(ap, int *); REQUIRE(p != NULL); *p = str - save; } break; case 'i': case 'd': if (q) tmpi = va_arg(ap, isc_int64_t); else if (l) tmpi = va_arg(ap, long int); else tmpi = va_arg(ap, int); if (tmpi < 0) { head = "-"; tmpui = -tmpi; } else { if (plus) head = "+"; else if (space) head = " "; else head = ""; tmpui = tmpi; } if (tmpui <= 0xffffffffU) sprintf(buf, "%lu", (unsigned long)tmpui); else { unsigned long mid; unsigned long lo; unsigned long hi; lo = tmpui % 1000000000; tmpui /= 1000000000; mid = tmpui % 1000000000; hi = tmpui / 1000000000; if (hi != 0) sprintf(buf, "%lu", hi); else buf[0] = '\n'; sprintf(buf + strlen(buf), "%lu", mid); sprintf(buf + strlen(buf), "%lu", lo); } goto printint; case 'o': if (q) tmpui = va_arg(ap, isc_uint64_t); else if (l) tmpui = va_arg(ap, long int); else tmpui = va_arg(ap, int); if (tmpui <= 0xffffffffU) sprintf(buf, alt ? "%#lo" : "%lo", (unsigned long)tmpui); else { unsigned long mid; unsigned long lo; unsigned long hi; lo = tmpui % 010000000000; tmpui /= 010000000000; mid = tmpui % 010000000000; hi = tmpui / 010000000000; if (hi != 0) { sprintf(buf, alt ? "%#lo" : "%lo", hi); sprintf(buf + strlen(buf), "%lo", mid); } else sprintf(buf, alt ? "%#lo" : "%lo", mid); sprintf(buf + strlen(buf), "%lo", lo); } goto printint; case 'u': if (q) tmpui = va_arg(ap, isc_uint64_t); else if (l) tmpui = va_arg(ap, unsigned long int); else tmpui = va_arg(ap, unsigned int); if (tmpui <= 0xffffffffU) sprintf(buf, "%lu", (unsigned long)tmpui); else { unsigned long mid; unsigned long lo; unsigned long hi; lo = tmpui % 1000000000; tmpui /= 1000000000; mid = tmpui % 1000000000; hi = tmpui / 1000000000; if (hi != 0) sprintf(buf, "%lu", hi); else buf[0] = '\n'; sprintf(buf + strlen(buf), "%lu", mid); sprintf(buf + strlen(buf), "%lu", lo); } goto printint; case 'x': if (q) tmpui = va_arg(ap, isc_uint64_t); else if (l) tmpui = va_arg(ap, unsigned long int); else tmpui = va_arg(ap, unsigned int); if (alt) { head = "0x"; if (precision > 2) precision -= 2; } if (tmpui <= 0xffffffffU) sprintf(buf, "%lx", (unsigned long)tmpui); else { unsigned long hi = tmpui>>32; unsigned long lo = tmpui & 0xffffffff; sprintf(buf, "%lx", hi); sprintf(buf + strlen(buf), "%lx", lo); } goto printint; case 'X': if (q) tmpui = va_arg(ap, isc_uint64_t); else if (l) tmpui = va_arg(ap, unsigned long int); else tmpui = va_arg(ap, unsigned int); if (alt) { head = "0X"; if (precision > 2) precision -= 2; } if (tmpui <= 0xffffffffU) sprintf(buf, "%lX", (unsigned long)tmpui); else { unsigned long hi = tmpui>>32; unsigned long lo = tmpui & 0xffffffff; sprintf(buf, "%lX", hi); sprintf(buf + strlen(buf), "%lX", lo); } goto printint; printint: if (precision != 0 || width != 0) { length = strlen(buf); if (length < precision) zeropad = precision - length; else if (length < width && zero) zeropad = width - length; if (width != 0) { pad = width - length - zeropad - strlen(head); if (pad < 0) pad = 0; } } count += strlen(head) + strlen(buf) + pad + zeropad; if (!left) { while (pad > 0 && size > 1) { *str++ = ' '; size--; pad--; } } cp = head; while (*cp != '\0' && size > 1) { *str++ = *cp++; size--; } while (zeropad > 0 && size > 1) { *str++ = '0'; size--; zeropad--; } cp = buf; while (*cp != '\0' && size > 1) { *str++ = *cp++; size--; } while (pad > 0 && size > 1) { *str++ = ' '; size--; pad--; } break; default: break; } break; case 's': cp = va_arg(ap, char *); REQUIRE(cp != NULL); if (precision != 0) { /* * cp need not be NULL terminated. */ const char *tp; unsigned long n; n = precision; tp = cp; while (n != 0 && *tp != '\0') n--, tp++; length = precision - n; } else { length = strlen(cp); } if (width != 0) { pad = width - length; if (pad < 0) pad = 0; } count += pad + length; if (!left) while (pad > 0 && size > 1) { *str++ = ' '; size--; pad--; } if (precision != 0) while (precision > 0 && *cp != '\0' && size > 1) { *str++ = *cp++; size--; precision--; } else while (*cp != '\0' && size > 1) { *str++ = *cp++; size--; } while (pad > 0 && size > 1) { *str++ = ' '; size--; pad--; } break; case 'c': c = va_arg(ap, int); if (width > 0) { count += width; width--; if (left) { *str++ = c; size--; } while (width-- > 0 && size > 1) { *str++ = ' '; size--; } if (!left && size > 1) { *str++ = c; size--; } } else { count++; if (size > 1) { *str++ = c; size--; } } break; case 'p': v = va_arg(ap, void *); sprintf(buf, "%p", v); length = strlen(buf); if (precision > length) zeropad = precision - length; if (width > 0) { pad = width - length - zeropad; if (pad < 0) pad = 0; } count += length + pad + zeropad; if (!left) while (pad > 0 && size > 1) { *str++ = ' '; size--; pad--; } cp = buf; if (zeropad > 0 && buf[0] == '0' && (buf[1] == 'x' || buf[1] == 'X')) { if (size > 1) { *str++ = *cp++; size--; } if (size > 1) { *str++ = *cp++; size--; } while (zeropad > 0 && size > 1) { *str++ = '0'; size--; zeropad--; } } while (*cp != '\0' && size > 1) { *str++ = *cp++; size--; } while (pad > 0 && size > 1) { *str++ = ' '; size--; pad--; } break; case 'D': /*deprecated*/ INSIST("use %ld instead of %D" == NULL); case 'O': /*deprecated*/ INSIST("use %lo instead of %O" == NULL); case 'U': /*deprecated*/ INSIST("use %lu instead of %U" == NULL); case 'L': #ifdef HAVE_LONG_DOUBLE l = 1; #else INSIST("long doubles are not supported" == NULL); #endif /*FALLTHROUGH*/ case 'e': case 'E': case 'f': case 'g': case 'G': if (!dot) precision = 6; /* * IEEE floating point. * MIN 2.2250738585072014E-308 * MAX 1.7976931348623157E+308 * VAX floating point has a smaller range than IEEE. * * precisions > 324 don't make much sense. * if we cap the precision at 512 we will not * overflow buf. */ if (precision > 512) precision = 512; sprintf(fmt, "%%%s%s.%lu%s%c", alt ? "#" : "", plus ? "+" : space ? " " : "", precision, l ? "L" : "", *format); switch (*format) { case 'e': case 'E': case 'f': case 'g': case 'G': #ifdef HAVE_LONG_DOUBLE if (l) { ldbl = va_arg(ap, long double); sprintf(buf, fmt, ldbl); } else #endif { dbl = va_arg(ap, double); sprintf(buf, fmt, dbl); } length = strlen(buf); if (width > 0) { pad = width - length; if (pad < 0) pad = 0; } count += length + pad; if (!left) while (pad > 0 && size > 1) { *str++ = ' '; size--; pad--; } cp = buf; while (*cp != ' ' && size > 1) { *str++ = *cp++; size--; } while (pad > 0 && size > 1) { *str++ = ' '; size--; pad--; } break; default: continue; } break; default: continue; } format++; } if (size > 0) *str = '\0'; return (count); } ntp-4.2.6p5/lib/isc/fsaccess.c0000644000175000017500000000532111307651604015077 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: fsaccess.c,v 1.10 2007/06/19 23:47:17 tbox Exp $ */ /*! \file * \brief * This file contains the OS-independent functionality of the API. */ #include #include #include /*! * Shorthand. Maybe ISC__FSACCESS_PERMISSIONBITS should not even be in * . Could check consistency with sizeof(isc_fsaccess_t) * and the number of bits in each function. */ #define STEP (ISC__FSACCESS_PERMISSIONBITS) #define GROUP (STEP) #define OTHER (STEP * 2) void isc_fsaccess_add(int trustee, int permission, isc_fsaccess_t *access) { REQUIRE(trustee <= 0x7); REQUIRE(permission <= 0xFF); if ((trustee & ISC_FSACCESS_OWNER) != 0) *access |= permission; if ((trustee & ISC_FSACCESS_GROUP) != 0) *access |= (permission << GROUP); if ((trustee & ISC_FSACCESS_OTHER) != 0) *access |= (permission << OTHER); } void isc_fsaccess_remove(int trustee, int permission, isc_fsaccess_t *access) { REQUIRE(trustee <= 0x7); REQUIRE(permission <= 0xFF); if ((trustee & ISC_FSACCESS_OWNER) != 0) *access &= ~permission; if ((trustee & ISC_FSACCESS_GROUP) != 0) *access &= ~(permission << GROUP); if ((trustee & ISC_FSACCESS_OTHER) != 0) *access &= ~(permission << OTHER); } static isc_result_t check_bad_bits(isc_fsaccess_t access, isc_boolean_t is_dir) { isc_fsaccess_t bits; /* * Check for disallowed user bits. */ if (is_dir) bits = ISC_FSACCESS_READ | ISC_FSACCESS_WRITE | ISC_FSACCESS_EXECUTE; else bits = ISC_FSACCESS_CREATECHILD | ISC_FSACCESS_ACCESSCHILD | ISC_FSACCESS_DELETECHILD | ISC_FSACCESS_LISTDIRECTORY; /* * Set group bad bits. */ bits |= bits << STEP; /* * Set other bad bits. */ bits |= bits << STEP; if ((access & bits) != 0) { if (is_dir) return (ISC_R_NOTFILE); else return (ISC_R_NOTDIRECTORY); } return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/hash.c0000644000175000017500000002474211307651603014237 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: hash.c,v 1.13.332.3 2009/05/07 23:47:12 tbox Exp $ */ /*! \file * Some portion of this code was derived from universal hash function * libraries of Rice University. \section license UH Universal Hashing Library Copyright ((c)) 2002, Rice University All rights reserved. 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. * Neither the name of Rice University (RICE) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. This software is provided by RICE and the contributors on an "as is" basis, without any representations or warranties of any kind, express or implied including, but not limited to, representations or warranties of non-infringement, merchantability or fitness for a particular purpose. In no event shall RICE 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 #include #include #include #include #include #include #include #include #include #include #define HASH_MAGIC ISC_MAGIC('H', 'a', 's', 'h') #define VALID_HASH(h) ISC_MAGIC_VALID((h), HASH_MAGIC) /*% * A large 32-bit prime number that specifies the range of the hash output. */ #define PRIME32 0xFFFFFFFB /* 2^32 - 5 */ /*@{*/ /*% * Types of random seed and hash accumulator. Perhaps they can be system * dependent. */ typedef isc_uint32_t hash_accum_t; typedef isc_uint16_t hash_random_t; /*@}*/ /*% isc hash structure */ struct isc_hash { unsigned int magic; isc_mem_t *mctx; isc_mutex_t lock; isc_boolean_t initialized; isc_refcount_t refcnt; isc_entropy_t *entropy; /*%< entropy source */ unsigned int limit; /*%< upper limit of key length */ size_t vectorlen; /*%< size of the vector below */ hash_random_t *rndvector; /*%< random vector for universal hashing */ }; static isc_mutex_t createlock; static isc_once_t once = ISC_ONCE_INIT; static isc_hash_t *hash = NULL; static unsigned char maptolower[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; isc_result_t isc_hash_ctxcreate(isc_mem_t *mctx, isc_entropy_t *entropy, unsigned int limit, isc_hash_t **hctxp) { isc_result_t result; isc_hash_t *hctx; size_t vlen; hash_random_t *rv; hash_accum_t overflow_limit; REQUIRE(mctx != NULL); REQUIRE(hctxp != NULL && *hctxp == NULL); /* * Overflow check. Since our implementation only does a modulo * operation at the last stage of hash calculation, the accumulator * must not overflow. */ overflow_limit = 1 << (((sizeof(hash_accum_t) - sizeof(hash_random_t))) * 8); if (overflow_limit < (limit + 1) * 0xff) return (ISC_R_RANGE); hctx = isc_mem_get(mctx, sizeof(isc_hash_t)); if (hctx == NULL) return (ISC_R_NOMEMORY); vlen = sizeof(hash_random_t) * (limit + 1); rv = isc_mem_get(mctx, vlen); if (rv == NULL) { result = ISC_R_NOMEMORY; goto errout; } /* * We need a lock. */ result = isc_mutex_init(&hctx->lock); if (result != ISC_R_SUCCESS) goto errout; /* * From here down, no failures will/can occur. */ hctx->magic = HASH_MAGIC; hctx->mctx = NULL; isc_mem_attach(mctx, &hctx->mctx); hctx->initialized = ISC_FALSE; result = isc_refcount_init(&hctx->refcnt, 1); if (result != ISC_R_SUCCESS) goto cleanup_lock; hctx->entropy = NULL; hctx->limit = limit; hctx->vectorlen = vlen; hctx->rndvector = rv; if (entropy != NULL) isc_entropy_attach(entropy, &hctx->entropy); *hctxp = hctx; return (ISC_R_SUCCESS); cleanup_lock: DESTROYLOCK(&hctx->lock); errout: isc_mem_put(mctx, hctx, sizeof(isc_hash_t)); if (rv != NULL) isc_mem_put(mctx, rv, vlen); return (result); } static void initialize_lock(void) { RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS); } isc_result_t isc_hash_create(isc_mem_t *mctx, isc_entropy_t *entropy, size_t limit) { isc_result_t result = ISC_R_SUCCESS; REQUIRE(mctx != NULL); INSIST(hash == NULL); RUNTIME_CHECK(isc_once_do(&once, initialize_lock) == ISC_R_SUCCESS); LOCK(&createlock); if (hash == NULL) result = isc_hash_ctxcreate(mctx, entropy, limit, &hash); UNLOCK(&createlock); return (result); } void isc_hash_ctxinit(isc_hash_t *hctx) { isc_result_t result; LOCK(&hctx->lock); if (hctx->initialized == ISC_TRUE) goto out; if (hctx->entropy) { result = isc_entropy_getdata(hctx->entropy, hctx->rndvector, hctx->vectorlen, NULL, 0); INSIST(result == ISC_R_SUCCESS); } else { isc_uint32_t pr; unsigned int i, copylen; unsigned char *p; p = (unsigned char *)hctx->rndvector; for (i = 0; i < hctx->vectorlen; i += copylen, p += copylen) { isc_random_get(&pr); if (i + sizeof(pr) <= hctx->vectorlen) copylen = sizeof(pr); else copylen = hctx->vectorlen - i; memcpy(p, &pr, copylen); } INSIST(p == (unsigned char *)hctx->rndvector + hctx->vectorlen); } hctx->initialized = ISC_TRUE; out: UNLOCK(&hctx->lock); } void isc_hash_init() { INSIST(hash != NULL && VALID_HASH(hash)); isc_hash_ctxinit(hash); } void isc_hash_ctxattach(isc_hash_t *hctx, isc_hash_t **hctxp) { REQUIRE(VALID_HASH(hctx)); REQUIRE(hctxp != NULL && *hctxp == NULL); isc_refcount_increment(&hctx->refcnt, NULL); *hctxp = hctx; } static void destroy(isc_hash_t **hctxp) { isc_hash_t *hctx; isc_mem_t *mctx; REQUIRE(hctxp != NULL && *hctxp != NULL); hctx = *hctxp; *hctxp = NULL; LOCK(&hctx->lock); isc_refcount_destroy(&hctx->refcnt); mctx = hctx->mctx; if (hctx->entropy != NULL) isc_entropy_detach(&hctx->entropy); if (hctx->rndvector != NULL) isc_mem_put(mctx, hctx->rndvector, hctx->vectorlen); UNLOCK(&hctx->lock); DESTROYLOCK(&hctx->lock); memset(hctx, 0, sizeof(isc_hash_t)); isc_mem_put(mctx, hctx, sizeof(isc_hash_t)); isc_mem_detach(&mctx); } void isc_hash_ctxdetach(isc_hash_t **hctxp) { isc_hash_t *hctx; unsigned int refs; REQUIRE(hctxp != NULL && VALID_HASH(*hctxp)); hctx = *hctxp; isc_refcount_decrement(&hctx->refcnt, &refs); if (refs == 0) destroy(&hctx); *hctxp = NULL; } void isc_hash_destroy() { unsigned int refs; INSIST(hash != NULL && VALID_HASH(hash)); isc_refcount_decrement(&hash->refcnt, &refs); INSIST(refs == 0); destroy(&hash); } static inline unsigned int hash_calc(isc_hash_t *hctx, const unsigned char *key, unsigned int keylen, isc_boolean_t case_sensitive) { hash_accum_t partial_sum = 0; hash_random_t *p = hctx->rndvector; unsigned int i = 0; /* Make it sure that the hash context is initialized. */ if (hctx->initialized == ISC_FALSE) isc_hash_ctxinit(hctx); if (case_sensitive) { for (i = 0; i < keylen; i++) partial_sum += key[i] * (hash_accum_t)p[i]; } else { for (i = 0; i < keylen; i++) partial_sum += maptolower[key[i]] * (hash_accum_t)p[i]; } partial_sum += p[i]; return ((unsigned int)(partial_sum % PRIME32)); } unsigned int isc_hash_ctxcalc(isc_hash_t *hctx, const unsigned char *key, unsigned int keylen, isc_boolean_t case_sensitive) { REQUIRE(hctx != NULL && VALID_HASH(hctx)); REQUIRE(keylen <= hctx->limit); return (hash_calc(hctx, key, keylen, case_sensitive)); } unsigned int isc_hash_calc(const unsigned char *key, unsigned int keylen, isc_boolean_t case_sensitive) { INSIST(hash != NULL && VALID_HASH(hash)); REQUIRE(keylen <= hash->limit); return (hash_calc(hash, key, keylen, case_sensitive)); } ntp-4.2.6p5/lib/isc/lib.c0000644000175000017500000000406711307651604014061 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: lib.c,v 1.14 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include /*** *** Globals ***/ LIBISC_EXTERNAL_DATA isc_msgcat_t * isc_msgcat = NULL; /*** *** Private ***/ static isc_once_t msgcat_once = ISC_ONCE_INIT; /*** *** Functions ***/ static void open_msgcat(void) { isc_msgcat_open("libisc.cat", &isc_msgcat); } void isc_lib_initmsgcat(void) { isc_result_t result; /*! * Initialize the ISC library's message catalog, isc_msgcat, if it * has not already been initialized. */ result = isc_once_do(&msgcat_once, open_msgcat); if (result != ISC_R_SUCCESS) { /* * Normally we'd use RUNTIME_CHECK() or FATAL_ERROR(), but * we can't do that here, since they might call us! * (Note that the catalog might be open anyway, so we might * as well try to provide an internationalized message.) */ fprintf(stderr, "%s:%d: %s: isc_once_do() %s.\n", __FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FATALERROR, "fatal error"), isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); abort(); } } ntp-4.2.6p5/lib/isc/commandline.c0000644000175000017500000001553611307651603015603 0ustar peterpeter/* * Portions Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Portions Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* * Copyright (c) 1987, 1993, 1994 * The Regents of the University of California. 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ /* $Id: commandline.c,v 1.22 2008/09/25 04:02:39 tbox Exp $ */ /*! \file * This file was adapted from the NetBSD project's source tree, RCS ID: * NetBSD: getopt.c,v 1.15 1999/09/20 04:39:37 lukem Exp * * The primary change has been to rename items to the ISC namespace * and format in the ISC coding style. */ /* * \author Principal Authors: Computer Systems Research Group at UC Berkeley * \author Principal ISC caretaker: DCL */ #include #include #include #include #include #include /*% Index into parent argv vector. */ LIBISC_EXTERNAL_DATA int isc_commandline_index = 1; /*% Character checked for validity. */ LIBISC_EXTERNAL_DATA int isc_commandline_option; /*% Argument associated with option. */ LIBISC_EXTERNAL_DATA char *isc_commandline_argument; /*% For printing error messages. */ LIBISC_EXTERNAL_DATA char *isc_commandline_progname; /*% Print error messages. */ LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_errprint = ISC_TRUE; /*% Reset processing. */ LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_reset = ISC_TRUE; static char endopt = '\0'; #define BADOPT '?' #define BADARG ':' #define ENDOPT &endopt /*! * getopt -- * Parse argc/argv argument vector. */ int isc_commandline_parse(int argc, char * const *argv, const char *options) { static char *place = ENDOPT; char *option; /* Index into *options of option. */ REQUIRE(argc >= 0 && argv != NULL && options != NULL); /* * Update scanning pointer, either because a reset was requested or * the previous argv was finished. */ if (isc_commandline_reset || *place == '\0') { if (isc_commandline_reset) { isc_commandline_index = 1; isc_commandline_reset = ISC_FALSE; } if (isc_commandline_progname == NULL) isc_commandline_progname = argv[0]; if (isc_commandline_index >= argc || *(place = argv[isc_commandline_index]) != '-') { /* * Index out of range or points to non-option. */ place = ENDOPT; return (-1); } if (place[1] != '\0' && *++place == '-' && place[1] == '\0') { /* * Found '--' to signal end of options. Advance * index to next argv, the first non-option. */ isc_commandline_index++; place = ENDOPT; return (-1); } } isc_commandline_option = *place++; option = strchr(options, isc_commandline_option); /* * Ensure valid option has been passed as specified by options string. * '-:' is never a valid command line option because it could not * distinguish ':' from the argument specifier in the options string. */ if (isc_commandline_option == ':' || option == NULL) { if (*place == '\0') isc_commandline_index++; if (isc_commandline_errprint && *options != ':') fprintf(stderr, "%s: %s -- %c\n", isc_commandline_progname, isc_msgcat_get(isc_msgcat, ISC_MSGSET_COMMANDLINE, ISC_MSG_ILLEGALOPT, "illegal option"), isc_commandline_option); return (BADOPT); } if (*++option != ':') { /* * Option does not take an argument. */ isc_commandline_argument = NULL; /* * Skip to next argv if at the end of the current argv. */ if (*place == '\0') ++isc_commandline_index; } else { /* * Option needs an argument. */ if (*place != '\0') /* * Option is in this argv, -D1 style. */ isc_commandline_argument = place; else if (argc > ++isc_commandline_index) /* * Option is next argv, -D 1 style. */ isc_commandline_argument = argv[isc_commandline_index]; else { /* * Argument needed, but no more argv. */ place = ENDOPT; /* * Silent failure with "missing argument" return * when ':' starts options string, per historical spec. */ if (*options == ':') return (BADARG); if (isc_commandline_errprint) fprintf(stderr, "%s: %s -- %c\n", isc_commandline_progname, isc_msgcat_get(isc_msgcat, ISC_MSGSET_COMMANDLINE, ISC_MSG_OPTNEEDARG, "option requires " "an argument"), isc_commandline_option); return (BADOPT); } place = ENDOPT; /* * Point to argv that follows argument. */ isc_commandline_index++; } return (isc_commandline_option); } ntp-4.2.6p5/lib/isc/include/0000755000175000017500000000000011307651602014561 5ustar peterpeterntp-4.2.6p5/lib/isc/include/isc/0000755000175000017500000000000011675461367015356 5ustar peterpeterntp-4.2.6p5/lib/isc/include/isc/lib.h0000644000175000017500000000241211307651604016257 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: lib.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_LIB_H #define ISC_LIB_H 1 /*! \file isc/lib.h */ #include #include ISC_LANG_BEGINDECLS LIBISC_EXTERNAL_DATA extern isc_msgcat_t *isc_msgcat; void isc_lib_initmsgcat(void); /*!< * \brief Initialize the ISC library's message catalog, isc_msgcat, if it * has not already been initialized. */ ISC_LANG_ENDDECLS #endif /* ISC_LIB_H */ ntp-4.2.6p5/lib/isc/include/isc/resultclass.h0000644000175000017500000000373611307651603020066 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: resultclass.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_RESULTCLASS_H #define ISC_RESULTCLASS_H 1 /*! \file isc/resultclass.h * \brief Registry of Predefined Result Type Classes * * A result class number is an unsigned 16 bit number. Each class may * contain up to 65536 results. A result code is formed by adding the * result number within the class to the class number multiplied by 65536. * * Classes < 1024 are reserved for ISC use. * Result classes >= 1024 and <= 65535 are reserved for application use. */ #define ISC_RESULTCLASS_FROMNUM(num) ((num) << 16) #define ISC_RESULTCLASS_TONUM(rclass) ((rclass) >> 16) #define ISC_RESULTCLASS_SIZE 65536 #define ISC_RESULTCLASS_INCLASS(rclass, result) \ ((rclass) == ((result) & 0xFFFF0000)) #define ISC_RESULTCLASS_ISC ISC_RESULTCLASS_FROMNUM(0) #define ISC_RESULTCLASS_DNS ISC_RESULTCLASS_FROMNUM(1) #define ISC_RESULTCLASS_DST ISC_RESULTCLASS_FROMNUM(2) #define ISC_RESULTCLASS_DNSRCODE ISC_RESULTCLASS_FROMNUM(3) #define ISC_RESULTCLASS_OMAPI ISC_RESULTCLASS_FROMNUM(4) #define ISC_RESULTCLASS_ISCCC ISC_RESULTCLASS_FROMNUM(5) #endif /* ISC_RESULTCLASS_H */ ntp-4.2.6p5/lib/isc/include/isc/socket.h0000644000175000017500000006623211307651605017014 0ustar peterpeter/* * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: socket.h,v 1.85.58.3 2009/01/29 22:40:35 jinmei Exp $ */ #ifndef ISC_SOCKET_H #define ISC_SOCKET_H 1 /***** ***** Module Info *****/ /*! \file isc/socket.h * \brief Provides TCP and UDP sockets for network I/O. The sockets are event * sources in the task system. * * When I/O completes, a completion event for the socket is posted to the * event queue of the task which requested the I/O. * * \li MP: * The module ensures appropriate synchronization of data structures it * creates and manipulates. * Clients of this module must not be holding a socket's task's lock when * making a call that affects that socket. Failure to follow this rule * can result in deadlock. * The caller must ensure that isc_socketmgr_destroy() is called only * once for a given manager. * * \li Reliability: * No anticipated impact. * * \li Resources: * TBS * * \li Security: * No anticipated impact. * * \li Standards: * None. */ /*** *** Imports ***/ #include #include #include #include #include #include #include #include ISC_LANG_BEGINDECLS /*** *** Constants ***/ /*% * Maximum number of buffers in a scatter/gather read/write. The operating * system in use must support at least this number (plus one on some.) */ #define ISC_SOCKET_MAXSCATTERGATHER 8 /*% * In isc_socket_bind() set socket option SO_REUSEADDR prior to calling * bind() if a non zero port is specified (AF_INET and AF_INET6). */ #define ISC_SOCKET_REUSEADDRESS 0x01U /*% * Statistics counters. Used as isc_statscounter_t values. */ enum { isc_sockstatscounter_udp4open = 0, isc_sockstatscounter_udp6open = 1, isc_sockstatscounter_tcp4open = 2, isc_sockstatscounter_tcp6open = 3, isc_sockstatscounter_unixopen = 4, isc_sockstatscounter_udp4openfail = 5, isc_sockstatscounter_udp6openfail = 6, isc_sockstatscounter_tcp4openfail = 7, isc_sockstatscounter_tcp6openfail = 8, isc_sockstatscounter_unixopenfail = 9, isc_sockstatscounter_udp4close = 10, isc_sockstatscounter_udp6close = 11, isc_sockstatscounter_tcp4close = 12, isc_sockstatscounter_tcp6close = 13, isc_sockstatscounter_unixclose = 14, isc_sockstatscounter_fdwatchclose = 15, isc_sockstatscounter_udp4bindfail = 16, isc_sockstatscounter_udp6bindfail = 17, isc_sockstatscounter_tcp4bindfail = 18, isc_sockstatscounter_tcp6bindfail = 19, isc_sockstatscounter_unixbindfail = 20, isc_sockstatscounter_fdwatchbindfail = 21, isc_sockstatscounter_udp4connect = 22, isc_sockstatscounter_udp6connect = 23, isc_sockstatscounter_tcp4connect = 24, isc_sockstatscounter_tcp6connect = 25, isc_sockstatscounter_unixconnect = 26, isc_sockstatscounter_fdwatchconnect = 27, isc_sockstatscounter_udp4connectfail = 28, isc_sockstatscounter_udp6connectfail = 29, isc_sockstatscounter_tcp4connectfail = 30, isc_sockstatscounter_tcp6connectfail = 31, isc_sockstatscounter_unixconnectfail = 32, isc_sockstatscounter_fdwatchconnectfail = 33, isc_sockstatscounter_tcp4accept = 34, isc_sockstatscounter_tcp6accept = 35, isc_sockstatscounter_unixaccept = 36, isc_sockstatscounter_tcp4acceptfail = 37, isc_sockstatscounter_tcp6acceptfail = 38, isc_sockstatscounter_unixacceptfail = 39, isc_sockstatscounter_udp4sendfail = 40, isc_sockstatscounter_udp6sendfail = 41, isc_sockstatscounter_tcp4sendfail = 42, isc_sockstatscounter_tcp6sendfail = 43, isc_sockstatscounter_unixsendfail = 44, isc_sockstatscounter_fdwatchsendfail = 45, isc_sockstatscounter_udp4recvfail = 46, isc_sockstatscounter_udp6recvfail = 47, isc_sockstatscounter_tcp4recvfail = 48, isc_sockstatscounter_tcp6recvfail = 49, isc_sockstatscounter_unixrecvfail = 50, isc_sockstatscounter_fdwatchrecvfail = 51, isc_sockstatscounter_max = 52 }; /*** *** Types ***/ struct isc_socketevent { ISC_EVENT_COMMON(isc_socketevent_t); isc_result_t result; /*%< OK, EOF, whatever else */ unsigned int minimum; /*%< minimum i/o for event */ unsigned int n; /*%< bytes read or written */ unsigned int offset; /*%< offset into buffer list */ isc_region_t region; /*%< for single-buffer i/o */ isc_bufferlist_t bufferlist; /*%< list of buffers */ isc_sockaddr_t address; /*%< source address */ isc_time_t timestamp; /*%< timestamp of packet recv */ struct in6_pktinfo pktinfo; /*%< ipv6 pktinfo */ isc_uint32_t attributes; /*%< see below */ isc_eventdestructor_t destroy; /*%< original destructor */ }; typedef struct isc_socket_newconnev isc_socket_newconnev_t; struct isc_socket_newconnev { ISC_EVENT_COMMON(isc_socket_newconnev_t); isc_socket_t * newsocket; isc_result_t result; /*%< OK, EOF, whatever else */ isc_sockaddr_t address; /*%< source address */ }; typedef struct isc_socket_connev isc_socket_connev_t; struct isc_socket_connev { ISC_EVENT_COMMON(isc_socket_connev_t); isc_result_t result; /*%< OK, EOF, whatever else */ }; /*@{*/ /*! * _ATTACHED: Internal use only. * _TRUNC: Packet was truncated on receive. * _CTRUNC: Packet control information was truncated. This can * indicate that the packet is not complete, even though * all the data is valid. * _TIMESTAMP: The timestamp member is valid. * _PKTINFO: The pktinfo member is valid. * _MULTICAST: The UDP packet was received via a multicast transmission. */ #define ISC_SOCKEVENTATTR_ATTACHED 0x80000000U /* internal */ #define ISC_SOCKEVENTATTR_TRUNC 0x00800000U /* public */ #define ISC_SOCKEVENTATTR_CTRUNC 0x00400000U /* public */ #define ISC_SOCKEVENTATTR_TIMESTAMP 0x00200000U /* public */ #define ISC_SOCKEVENTATTR_PKTINFO 0x00100000U /* public */ #define ISC_SOCKEVENTATTR_MULTICAST 0x00080000U /* public */ /*@}*/ #define ISC_SOCKEVENT_ANYEVENT (0) #define ISC_SOCKEVENT_RECVDONE (ISC_EVENTCLASS_SOCKET + 1) #define ISC_SOCKEVENT_SENDDONE (ISC_EVENTCLASS_SOCKET + 2) #define ISC_SOCKEVENT_NEWCONN (ISC_EVENTCLASS_SOCKET + 3) #define ISC_SOCKEVENT_CONNECT (ISC_EVENTCLASS_SOCKET + 4) /* * Internal events. */ #define ISC_SOCKEVENT_INTR (ISC_EVENTCLASS_SOCKET + 256) #define ISC_SOCKEVENT_INTW (ISC_EVENTCLASS_SOCKET + 257) typedef enum { isc_sockettype_udp = 1, isc_sockettype_tcp = 2, isc_sockettype_unix = 3, isc_sockettype_fdwatch = 4 } isc_sockettype_t; /*@{*/ /*! * How a socket should be shutdown in isc_socket_shutdown() calls. */ #define ISC_SOCKSHUT_RECV 0x00000001 /*%< close read side */ #define ISC_SOCKSHUT_SEND 0x00000002 /*%< close write side */ #define ISC_SOCKSHUT_ALL 0x00000003 /*%< close them all */ /*@}*/ /*@{*/ /*! * What I/O events to cancel in isc_socket_cancel() calls. */ #define ISC_SOCKCANCEL_RECV 0x00000001 /*%< cancel recv */ #define ISC_SOCKCANCEL_SEND 0x00000002 /*%< cancel send */ #define ISC_SOCKCANCEL_ACCEPT 0x00000004 /*%< cancel accept */ #define ISC_SOCKCANCEL_CONNECT 0x00000008 /*%< cancel connect */ #define ISC_SOCKCANCEL_ALL 0x0000000f /*%< cancel everything */ /*@}*/ /*@{*/ /*! * Flags for isc_socket_send() and isc_socket_recv() calls. */ #define ISC_SOCKFLAG_IMMEDIATE 0x00000001 /*%< send event only if needed */ #define ISC_SOCKFLAG_NORETRY 0x00000002 /*%< drop failed UDP sends */ /*@}*/ /*@{*/ /*! * Flags for fdwatchcreate. */ #define ISC_SOCKFDWATCH_READ 0x00000001 /*%< watch for readable */ #define ISC_SOCKFDWATCH_WRITE 0x00000002 /*%< watch for writable */ /*@}*/ /*** *** Socket and Socket Manager Functions *** *** Note: all Ensures conditions apply only if the result is success for *** those functions which return an isc_result. ***/ isc_result_t isc_socket_fdwatchcreate(isc_socketmgr_t *manager, int fd, int flags, isc_sockfdwatch_t callback, void *cbarg, isc_task_t *task, isc_socket_t **socketp); /*%< * Create a new file descriptor watch socket managed by 'manager'. * * Note: * *\li 'fd' is the already-opened file descriptor. *\li This function is not available on Windows. *\li The callback function is called "in-line" - this means the function * needs to return as fast as possible, as all other I/O will be suspended * until the callback completes. * * Requires: * *\li 'manager' is a valid manager * *\li 'socketp' is a valid pointer, and *socketp == NULL * *\li 'fd' be opened. * * Ensures: * * '*socketp' is attached to the newly created fdwatch socket * * Returns: * *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY *\li #ISC_R_NORESOURCES *\li #ISC_R_UNEXPECTED */ isc_result_t isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type, isc_socket_t **socketp); /*%< * Create a new 'type' socket managed by 'manager'. * * For isc_sockettype_fdwatch sockets you should use isc_socket_fdwatchcreate() * rather than isc_socket_create(). * * Note: * *\li 'pf' is the desired protocol family, e.g. PF_INET or PF_INET6. * * Requires: * *\li 'manager' is a valid manager * *\li 'socketp' is a valid pointer, and *socketp == NULL * *\li 'type' is not isc_sockettype_fdwatch * * Ensures: * * '*socketp' is attached to the newly created socket * * Returns: * *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY *\li #ISC_R_NORESOURCES *\li #ISC_R_UNEXPECTED */ void isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how); /*%< * Cancel pending I/O of the type specified by "how". * * Note: if "task" is NULL, then the cancel applies to all tasks using the * socket. * * Requires: * * \li "socket" is a valid socket * * \li "task" is NULL or a valid task * * "how" is a bitmask describing the type of cancelation to perform. * The type ISC_SOCKCANCEL_ALL will cancel all pending I/O on this * socket. * * \li ISC_SOCKCANCEL_RECV: * Cancel pending isc_socket_recv() calls. * * \li ISC_SOCKCANCEL_SEND: * Cancel pending isc_socket_send() and isc_socket_sendto() calls. * * \li ISC_SOCKCANCEL_ACCEPT: * Cancel pending isc_socket_accept() calls. * * \li ISC_SOCKCANCEL_CONNECT: * Cancel pending isc_socket_connect() call. */ void isc_socket_shutdown(isc_socket_t *sock, unsigned int how); /*%< * Shutdown 'socket' according to 'how'. * * Requires: * * \li 'socket' is a valid socket. * * \li 'task' is NULL or is a valid task. * * \li If 'how' is 'ISC_SOCKSHUT_RECV' or 'ISC_SOCKSHUT_ALL' then * * The read queue must be empty. * * No further read requests may be made. * * \li If 'how' is 'ISC_SOCKSHUT_SEND' or 'ISC_SOCKSHUT_ALL' then * * The write queue must be empty. * * No further write requests may be made. */ void isc_socket_attach(isc_socket_t *sock, isc_socket_t **socketp); /*%< * Attach *socketp to socket. * * Requires: * * \li 'socket' is a valid socket. * * \li 'socketp' points to a NULL socket. * * Ensures: * * \li *socketp is attached to socket. */ void isc_socket_detach(isc_socket_t **socketp); /*%< * Detach *socketp from its socket. * * Requires: * * \li 'socketp' points to a valid socket. * * \li If '*socketp' is the last reference to the socket, * then: * * There must be no pending I/O requests. * * Ensures: * * \li *socketp is NULL. * * \li If '*socketp' is the last reference to the socket, * then: * * The socket will be shutdown (both reading and writing) * for all tasks. * * All resources used by the socket have been freed */ isc_result_t isc_socket_open(isc_socket_t *sock); /*%< * Open a new socket file descriptor of the given socket structure. It simply * opens a new descriptor; all of the other parameters including the socket * type are inherited from the existing socket. This function is provided to * avoid overhead of destroying and creating sockets when many short-lived * sockets are frequently opened and closed. When the efficiency is not an * issue, it should be safer to detach the unused socket and re-create a new * one. This optimization may not be available for some systems, in which * case this function will return ISC_R_NOTIMPLEMENTED and must not be used. * * isc_socket_open() should not be called on sockets created by * isc_socket_fdwatchcreate(). * * Requires: * * \li there must be no other reference to this socket. * * \li 'socket' is a valid and previously closed by isc_socket_close() * * \li 'sock->type' is not isc_sockettype_fdwatch * * Returns: * Same as isc_socket_create(). * \li ISC_R_NOTIMPLEMENTED */ isc_result_t isc_socket_close(isc_socket_t *sock); /*%< * Close a socket file descriptor of the given socket structure. This function * is provided as an alternative to destroying an unused socket when overhead * destroying/re-creating sockets can be significant, and is expected to be * used with isc_socket_open(). This optimization may not be available for some * systems, in which case this function will return ISC_R_NOTIMPLEMENTED and * must not be used. * * isc_socket_close() should not be called on sockets created by * isc_socket_fdwatchcreate(). * * Requires: * * \li The socket must have a valid descriptor. * * \li There must be no other reference to this socket. * * \li There must be no pending I/O requests. * * \li 'sock->type' is not isc_sockettype_fdwatch * * Returns: * \li #ISC_R_NOTIMPLEMENTED */ isc_result_t isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *addressp, unsigned int options); /*%< * Bind 'socket' to '*addressp'. * * Requires: * * \li 'socket' is a valid socket * * \li 'addressp' points to a valid isc_sockaddr. * * Returns: * * \li ISC_R_SUCCESS * \li ISC_R_NOPERM * \li ISC_R_ADDRNOTAVAIL * \li ISC_R_ADDRINUSE * \li ISC_R_BOUND * \li ISC_R_UNEXPECTED */ isc_result_t isc_socket_filter(isc_socket_t *sock, const char *filter); /*%< * Inform the kernel that it should perform accept filtering. * If filter is NULL the current filter will be removed.:w */ isc_result_t isc_socket_listen(isc_socket_t *sock, unsigned int backlog); /*%< * Set listen mode on the socket. After this call, the only function that * can be used (other than attach and detach) is isc_socket_accept(). * * Notes: * * \li 'backlog' is as in the UNIX system call listen() and may be * ignored by non-UNIX implementations. * * \li If 'backlog' is zero, a reasonable system default is used, usually * SOMAXCONN. * * Requires: * * \li 'socket' is a valid, bound TCP socket or a valid, bound UNIX socket. * * Returns: * * \li ISC_R_SUCCESS * \li ISC_R_UNEXPECTED */ isc_result_t isc_socket_accept(isc_socket_t *sock, isc_task_t *task, isc_taskaction_t action, const void *arg); /*%< * Queue accept event. When a new connection is received, the task will * get an ISC_SOCKEVENT_NEWCONN event with the sender set to the listen * socket. The new socket structure is sent inside the isc_socket_newconnev_t * event type, and is attached to the task 'task'. * * REQUIRES: * \li 'socket' is a valid TCP socket that isc_socket_listen() was called * on. * * \li 'task' is a valid task * * \li 'action' is a valid action * * RETURNS: * \li ISC_R_SUCCESS * \li ISC_R_NOMEMORY * \li ISC_R_UNEXPECTED */ isc_result_t isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addressp, isc_task_t *task, isc_taskaction_t action, const void *arg); /*%< * Connect 'socket' to peer with address *saddr. When the connection * succeeds, or when an error occurs, a CONNECT event with action 'action' * and arg 'arg' will be posted to the event queue for 'task'. * * Requires: * * \li 'socket' is a valid TCP socket * * \li 'addressp' points to a valid isc_sockaddr * * \li 'task' is a valid task * * \li 'action' is a valid action * * Returns: * * \li ISC_R_SUCCESS * \li ISC_R_NOMEMORY * \li ISC_R_UNEXPECTED * * Posted event's result code: * * \li ISC_R_SUCCESS * \li ISC_R_TIMEDOUT * \li ISC_R_CONNREFUSED * \li ISC_R_NETUNREACH * \li ISC_R_UNEXPECTED */ isc_result_t isc_socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp); /*%< * Get the name of the peer connected to 'socket'. * * Requires: * * \li 'socket' is a valid TCP socket. * * Returns: * * \li ISC_R_SUCCESS * \li ISC_R_TOOSMALL * \li ISC_R_UNEXPECTED */ isc_result_t isc_socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp); /*%< * Get the name of 'socket'. * * Requires: * * \li 'socket' is a valid socket. * * Returns: * * \li ISC_R_SUCCESS * \li ISC_R_TOOSMALL * \li ISC_R_UNEXPECTED */ /*@{*/ isc_result_t isc_socket_recv(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, isc_task_t *task, isc_taskaction_t action, const void *arg); isc_result_t isc_socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist, unsigned int minimum, isc_task_t *task, isc_taskaction_t action, const void *arg); isc_result_t isc_socket_recv2(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, isc_task_t *task, isc_socketevent_t *event, unsigned int flags); /*! * Receive from 'socket', storing the results in region. * * Notes: * *\li Let 'length' refer to the length of 'region' or to the sum of all * available regions in the list of buffers '*buflist'. * *\li If 'minimum' is non-zero and at least that many bytes are read, * the completion event will be posted to the task 'task.' If minimum * is zero, the exact number of bytes requested in the region must * be read for an event to be posted. This only makes sense for TCP * connections, and is always set to 1 byte for UDP. * *\li The read will complete when the desired number of bytes have been * read, if end-of-input occurs, or if an error occurs. A read done * event with the given 'action' and 'arg' will be posted to the * event queue of 'task'. * *\li The caller may not modify 'region', the buffers which are passed * into this function, or any data they refer to until the completion * event is received. * *\li For isc_socket_recvv(): * On successful completion, '*buflist' will be empty, and the list of * all buffers will be returned in the done event's 'bufferlist' * member. On error return, '*buflist' will be unchanged. * *\li For isc_socket_recv2(): * 'event' is not NULL, and the non-socket specific fields are * expected to be initialized. * *\li For isc_socket_recv2(): * The only defined value for 'flags' is ISC_SOCKFLAG_IMMEDIATE. If * set and the operation completes, the return value will be * ISC_R_SUCCESS and the event will be filled in and not sent. If the * operation does not complete, the return value will be * ISC_R_INPROGRESS and the event will be sent when the operation * completes. * * Requires: * *\li 'socket' is a valid, bound socket. * *\li For isc_socket_recv(): * 'region' is a valid region * *\li For isc_socket_recvv(): * 'buflist' is non-NULL, and '*buflist' contain at least one buffer. * *\li 'task' is a valid task * *\li For isc_socket_recv() and isc_socket_recvv(): * action != NULL and is a valid action * *\li For isc_socket_recv2(): * event != NULL * * Returns: * *\li #ISC_R_SUCCESS *\li #ISC_R_INPROGRESS *\li #ISC_R_NOMEMORY *\li #ISC_R_UNEXPECTED * * Event results: * *\li #ISC_R_SUCCESS *\li #ISC_R_UNEXPECTED *\li XXX needs other net-type errors */ /*@}*/ /*@{*/ isc_result_t isc_socket_send(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, isc_taskaction_t action, const void *arg); isc_result_t isc_socket_sendto(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo); isc_result_t isc_socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, isc_task_t *task, isc_taskaction_t action, const void *arg); isc_result_t isc_socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo); isc_result_t isc_socket_sendto2(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, isc_socketevent_t *event, unsigned int flags); /*! * Send the contents of 'region' to the socket's peer. * * Notes: * *\li Shutting down the requestor's task *may* result in any * still pending writes being dropped or completed, depending on the * underlying OS implementation. * *\li If 'action' is NULL, then no completion event will be posted. * *\li The caller may not modify 'region', the buffers which are passed * into this function, or any data they refer to until the completion * event is received. * *\li For isc_socket_sendv() and isc_socket_sendtov(): * On successful completion, '*buflist' will be empty, and the list of * all buffers will be returned in the done event's 'bufferlist' * member. On error return, '*buflist' will be unchanged. * *\li For isc_socket_sendto2(): * 'event' is not NULL, and the non-socket specific fields are * expected to be initialized. * *\li For isc_socket_sendto2(): * The only defined values for 'flags' are ISC_SOCKFLAG_IMMEDIATE * and ISC_SOCKFLAG_NORETRY. * *\li If ISC_SOCKFLAG_IMMEDIATE is set and the operation completes, the * return value will be ISC_R_SUCCESS and the event will be filled * in and not sent. If the operation does not complete, the return * value will be ISC_R_INPROGRESS and the event will be sent when * the operation completes. * *\li ISC_SOCKFLAG_NORETRY can only be set for UDP sockets. If set * and the send operation fails due to a transient error, the send * will not be retried and the error will be indicated in the event. * Using this option along with ISC_SOCKFLAG_IMMEDIATE allows the caller * to specify a region that is allocated on the stack. * * Requires: * *\li 'socket' is a valid, bound socket. * *\li For isc_socket_send(): * 'region' is a valid region * *\li For isc_socket_sendv() and isc_socket_sendtov(): * 'buflist' is non-NULL, and '*buflist' contain at least one buffer. * *\li 'task' is a valid task * *\li For isc_socket_sendv(), isc_socket_sendtov(), isc_socket_send(), and * isc_socket_sendto(): * action == NULL or is a valid action * *\li For isc_socket_sendto2(): * event != NULL * * Returns: * *\li #ISC_R_SUCCESS *\li #ISC_R_INPROGRESS *\li #ISC_R_NOMEMORY *\li #ISC_R_UNEXPECTED * * Event results: * *\li #ISC_R_SUCCESS *\li #ISC_R_UNEXPECTED *\li XXX needs other net-type errors */ /*@}*/ isc_result_t isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp); isc_result_t isc_socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp, unsigned int maxsocks); /*%< * Create a socket manager. If "maxsocks" is non-zero, it specifies the * maximum number of sockets that the created manager should handle. * isc_socketmgr_create() is equivalent of isc_socketmgr_create2() with * "maxsocks" being zero. * * Notes: * *\li All memory will be allocated in memory context 'mctx'. * * Requires: * *\li 'mctx' is a valid memory context. * *\li 'managerp' points to a NULL isc_socketmgr_t. * * Ensures: * *\li '*managerp' is a valid isc_socketmgr_t. * * Returns: * *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY *\li #ISC_R_UNEXPECTED *\li #ISC_R_NOTIMPLEMENTED */ isc_result_t isc_socketmgr_getmaxsockets(isc_socketmgr_t *manager, unsigned int *nsockp); /*%< * Returns in "*nsockp" the maximum number of sockets this manager may open. * * Requires: * *\li '*manager' is a valid isc_socketmgr_t. *\li 'nsockp' is not NULL. * * Returns: * *\li #ISC_R_SUCCESS *\li #ISC_R_NOTIMPLEMENTED */ void isc_socketmgr_setstats(isc_socketmgr_t *manager, isc_stats_t *stats); /*%< * Set a general socket statistics counter set 'stats' for 'manager'. * * Requires: * \li 'manager' is valid, hasn't opened any socket, and doesn't have * stats already set. * *\li stats is a valid statistics supporting socket statistics counters * (see above). */ void isc_socketmgr_destroy(isc_socketmgr_t **managerp); /*%< * Destroy a socket manager. * * Notes: * *\li This routine blocks until there are no sockets left in the manager, * so if the caller holds any socket references using the manager, it * must detach them before calling isc_socketmgr_destroy() or it will * block forever. * * Requires: * *\li '*managerp' is a valid isc_socketmgr_t. * *\li All sockets managed by this manager are fully detached. * * Ensures: * *\li *managerp == NULL * *\li All resources used by the manager have been freed. */ isc_sockettype_t isc_socket_gettype(isc_socket_t *sock); /*%< * Returns the socket type for "sock." * * Requires: * *\li "sock" is a valid socket. */ /*@{*/ isc_boolean_t isc_socket_isbound(isc_socket_t *sock); void isc_socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes); /*%< * If the socket is an IPv6 socket set/clear the IPV6_IPV6ONLY socket * option if the host OS supports this option. * * Requires: *\li 'sock' is a valid socket. */ /*@}*/ void isc_socket_cleanunix(isc_sockaddr_t *addr, isc_boolean_t active); /*%< * Cleanup UNIX domain sockets in the file-system. If 'active' is true * then just unlink the socket. If 'active' is false try to determine * if there is a listener of the socket or not. If no listener is found * then unlink socket. * * Prior to unlinking the path is tested to see if it a socket. * * Note: there are a number of race conditions which cannot be avoided * both in the filesystem and any application using UNIX domain * sockets (e.g. socket is tested between bind() and listen(), * the socket is deleted and replaced in the file-system between * stat() and unlink()). */ isc_result_t isc_socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm, isc_uint32_t owner, isc_uint32_t group); /*%< * Set ownership and file permissions on the UNIX domain socket. * * Note: On Solaris and SunOS this secures the directory containing * the socket as Solaris and SunOS do not honour the filesystem * permissions on the socket. * * Requires: * \li 'sockaddr' to be a valid UNIX domain sockaddr. * * Returns: * \li #ISC_R_SUCCESS * \li #ISC_R_FAILURE */ void isc_socket_setname(isc_socket_t *socket, const char *name, void *tag); /*%< * Set the name and optional tag for a socket. This allows tracking of the * owner or purpose for this socket, and is useful for tracing and statistics * reporting. */ const char *isc_socket_getname(isc_socket_t *socket); /*%< * Get the name associated with a socket, if any. */ void *isc_socket_gettag(isc_socket_t *socket); /*%< * Get the tag associated with a socket, if any. */ void isc__socketmgr_setreserved(isc_socketmgr_t *mgr, isc_uint32_t); /*%< * Temporary. For use by named only. */ #ifdef HAVE_LIBXML2 void isc_socketmgr_renderxml(isc_socketmgr_t *mgr, xmlTextWriterPtr writer); /*%< * Render internal statistics and other state into the XML document. */ #endif /* HAVE_LIBXML2 */ ISC_LANG_ENDDECLS #endif /* ISC_SOCKET_H */ ntp-4.2.6p5/lib/isc/include/isc/assertions.h0000644000175000017500000000626111307651604017711 0ustar peterpeter/* * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1997-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* * $Id: assertions.h,v 1.26 2008/10/15 23:47:31 tbox Exp $ */ /*! \file isc/assertions.h */ #ifndef ISC_ASSERTIONS_H #define ISC_ASSERTIONS_H 1 #include #include ISC_LANG_BEGINDECLS /*% isc assertion type */ typedef enum { isc_assertiontype_require, isc_assertiontype_ensure, isc_assertiontype_insist, isc_assertiontype_invariant } isc_assertiontype_t; typedef void (*isc_assertioncallback_t)(const char *, int, isc_assertiontype_t, const char *); /* coverity[+kill] */ LIBISC_EXTERNAL_DATA extern isc_assertioncallback_t isc_assertion_failed; void isc_assertion_setcallback(isc_assertioncallback_t); const char * isc_assertion_typetotext(isc_assertiontype_t type); #if defined(ISC_CHECK_ALL) || defined(__COVERITY__) #define ISC_CHECK_REQUIRE 1 #define ISC_CHECK_ENSURE 1 #define ISC_CHECK_INSIST 1 #define ISC_CHECK_INVARIANT 1 #endif #if defined(ISC_CHECK_NONE) && !defined(__COVERITY__) #define ISC_CHECK_REQUIRE 0 #define ISC_CHECK_ENSURE 0 #define ISC_CHECK_INSIST 0 #define ISC_CHECK_INVARIANT 0 #endif #ifndef ISC_CHECK_REQUIRE #define ISC_CHECK_REQUIRE 1 #endif #ifndef ISC_CHECK_ENSURE #define ISC_CHECK_ENSURE 1 #endif #ifndef ISC_CHECK_INSIST #define ISC_CHECK_INSIST 1 #endif #ifndef ISC_CHECK_INVARIANT #define ISC_CHECK_INVARIANT 1 #endif #if ISC_CHECK_REQUIRE != 0 #define ISC_REQUIRE(cond) \ ((void) ((cond) || \ ((isc_assertion_failed)(__FILE__, __LINE__, \ isc_assertiontype_require, \ #cond), 0))) #else #define ISC_REQUIRE(cond) ((void) 0) #endif /* ISC_CHECK_REQUIRE */ #if ISC_CHECK_ENSURE != 0 #define ISC_ENSURE(cond) \ ((void) ((cond) || \ ((isc_assertion_failed)(__FILE__, __LINE__, \ isc_assertiontype_ensure, \ #cond), 0))) #else #define ISC_ENSURE(cond) ((void) 0) #endif /* ISC_CHECK_ENSURE */ #if ISC_CHECK_INSIST != 0 #define ISC_INSIST(cond) \ ((void) ((cond) || \ ((isc_assertion_failed)(__FILE__, __LINE__, \ isc_assertiontype_insist, \ #cond), 0))) #else #define ISC_INSIST(cond) ((void) 0) #endif /* ISC_CHECK_INSIST */ #if ISC_CHECK_INVARIANT != 0 #define ISC_INVARIANT(cond) \ ((void) ((cond) || \ ((isc_assertion_failed)(__FILE__, __LINE__, \ isc_assertiontype_invariant, \ #cond), 0))) #else #define ISC_INVARIANT(cond) ((void) 0) #endif /* ISC_CHECK_INVARIANT */ ISC_LANG_ENDDECLS #endif /* ISC_ASSERTIONS_H */ ntp-4.2.6p5/lib/isc/include/isc/rwlock.h0000644000175000017500000000740311307651603017016 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: rwlock.h,v 1.28 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_RWLOCK_H #define ISC_RWLOCK_H 1 /*! \file isc/rwlock.h */ #include #include #include #include ISC_LANG_BEGINDECLS typedef enum { isc_rwlocktype_none = 0, isc_rwlocktype_read, isc_rwlocktype_write } isc_rwlocktype_t; #ifdef ISC_PLATFORM_USETHREADS #if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG) #define ISC_RWLOCK_USEATOMIC 1 #endif struct isc_rwlock { /* Unlocked. */ unsigned int magic; isc_mutex_t lock; #if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG) /* * When some atomic instructions with hardware assistance are * available, rwlock will use those so that concurrent readers do not * interfere with each other through mutex as long as no writers * appear, massively reducing the lock overhead in the typical case. * * The basic algorithm of this approach is the "simple * writer-preference lock" shown in the following URL: * http://www.cs.rochester.edu/u/scott/synchronization/pseudocode/rw.html * but our implementation does not rely on the spin lock unlike the * original algorithm to be more portable as a user space application. */ /* Read or modified atomically. */ isc_int32_t write_requests; isc_int32_t write_completions; isc_int32_t cnt_and_flag; /* Locked by lock. */ isc_condition_t readable; isc_condition_t writeable; unsigned int readers_waiting; /* Locked by rwlock itself. */ unsigned int write_granted; /* Unlocked. */ unsigned int write_quota; #else /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */ /*%< Locked by lock. */ isc_condition_t readable; isc_condition_t writeable; isc_rwlocktype_t type; /*% The number of threads that have the lock. */ unsigned int active; /*% * The number of lock grants made since the lock was last switched * from reading to writing or vice versa; used in determining * when the quota is reached and it is time to switch. */ unsigned int granted; unsigned int readers_waiting; unsigned int writers_waiting; unsigned int read_quota; unsigned int write_quota; isc_rwlocktype_t original; #endif /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */ }; #else /* ISC_PLATFORM_USETHREADS */ struct isc_rwlock { unsigned int magic; isc_rwlocktype_t type; unsigned int active; }; #endif /* ISC_PLATFORM_USETHREADS */ isc_result_t isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota, unsigned int write_quota); isc_result_t isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type); isc_result_t isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type); isc_result_t isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type); isc_result_t isc_rwlock_tryupgrade(isc_rwlock_t *rwl); void isc_rwlock_downgrade(isc_rwlock_t *rwl); void isc_rwlock_destroy(isc_rwlock_t *rwl); ISC_LANG_ENDDECLS #endif /* ISC_RWLOCK_H */ ntp-4.2.6p5/lib/isc/include/isc/portset.h0000644000175000017500000000726111307651604017220 0ustar peterpeter/* * Copyright (C) 2008, 2009 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: portset.h,v 1.3.90.2 2009/01/18 23:47:41 tbox Exp $ */ /*! \file isc/portset.h * \brief Transport Protocol Port Manipulation Module * * This module provides simple utilities to handle a set of transport protocol * (UDP or TCP) port numbers, e.g., for creating an ACL list. An isc_portset_t * object is an opaque instance of a port set, for which the user can add or * remove a specific port or a range of consecutive ports. This object is * expected to be used as a temporary work space only, and does not protect * simultaneous access from multiple threads. Therefore it must not be stored * in a place that can be accessed from multiple threads. */ #ifndef ISC_PORTSET_H #define ISC_PORTSET_H 1 /*** *** Imports ***/ #include /*** *** Functions ***/ ISC_LANG_BEGINDECLS isc_result_t isc_portset_create(isc_mem_t *mctx, isc_portset_t **portsetp); /*%< * Create a port set and initialize it as an empty set. * * Requires: *\li 'mctx' to be valid. *\li 'portsetp' to be non NULL and '*portsetp' to be NULL; * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY */ void isc_portset_destroy(isc_mem_t *mctx, isc_portset_t **portsetp); /*%< * Destroy a port set. * * Requires: *\li 'mctx' to be valid and must be the same context given when the port set * was created. *\li '*portsetp' to be a valid set. */ isc_boolean_t isc_portset_isset(isc_portset_t *portset, in_port_t port); /*%< * Test whether the given port is stored in the portset. * * Requires: *\li 'portset' to be a valid set. * * Returns * \li #ISC_TRUE if the port is found, ISC_FALSE otherwise. */ unsigned int isc_portset_nports(isc_portset_t *portset); /*%< * Provides the number of ports stored in the given portset. * * Requires: *\li 'portset' to be a valid set. * * Returns * \li the number of ports stored in portset. */ void isc_portset_add(isc_portset_t *portset, in_port_t port); /*%< * Add the given port to the portset. The port may or may not be stored in * the portset. * * Requires: *\li 'portlist' to be valid. */ void isc_portset_remove(isc_portset_t *portset, in_port_t port); /*%< * Remove the given port to the portset. The port may or may not be stored in * the portset. * * Requires: *\li 'portlist' to be valid. */ void isc_portset_addrange(isc_portset_t *portset, in_port_t port_lo, in_port_t port_hi); /*%< * Add a subset of [port_lo, port_hi] (inclusive) to the portset. Ports in the * subset may or may not be stored in portset. * * Requires: *\li 'portlist' to be valid. *\li port_lo <= port_hi */ void isc_portset_removerange(isc_portset_t *portset, in_port_t port_lo, in_port_t port_hi); /*%< * Subtract a subset of [port_lo, port_hi] (inclusive) from the portset. Ports * in the subset may or may not be stored in portset. * * Requires: *\li 'portlist' to be valid. *\li port_lo <= port_hi */ ISC_LANG_ENDDECLS #endif /* ISC_NETADDR_H */ ntp-4.2.6p5/lib/isc/include/isc/stats.h0000644000175000017500000000610511307651603016651 0ustar peterpeter/* * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: stats.h,v 1.4.2.2 2009/01/29 23:47:44 tbox Exp $ */ #ifndef ISC_STATS_H #define ISC_STATS_H 1 /*! \file isc/stats.h */ #include ISC_LANG_BEGINDECLS /*%< * Flag(s) for isc_stats_dump(). */ #define ISC_STATSDUMP_VERBOSE 0x00000001 /*%< dump 0-value counters */ /*%< * Dump callback type. */ typedef void (*isc_stats_dumper_t)(isc_statscounter_t, isc_uint64_t, void *); isc_result_t isc_stats_create(isc_mem_t *mctx, isc_stats_t **statsp, int ncounters); /*%< * Create a statistics counter structure of general type. It counts a general * set of counters indexed by an ID between 0 and ncounters -1. * * Requires: *\li 'mctx' must be a valid memory context. * *\li 'statsp' != NULL && '*statsp' == NULL. * * Returns: *\li ISC_R_SUCCESS -- all ok * *\li anything else -- failure */ void isc_stats_attach(isc_stats_t *stats, isc_stats_t **statsp); /*%< * Attach to a statistics set. * * Requires: *\li 'stats' is a valid isc_stats_t. * *\li 'statsp' != NULL && '*statsp' == NULL */ void isc_stats_detach(isc_stats_t **statsp); /*%< * Detaches from the statistics set. * * Requires: *\li 'statsp' != NULL and '*statsp' is a valid isc_stats_t. */ int isc_stats_ncounters(isc_stats_t *stats); /*%< * Returns the number of counters contained in stats. * * Requires: *\li 'stats' is a valid isc_stats_t. * */ void isc_stats_increment(isc_stats_t *stats, isc_statscounter_t counter); /*%< * Increment the counter-th counter of stats. * * Requires: *\li 'stats' is a valid isc_stats_t. * *\li counter is less than the maximum available ID for the stats specified * on creation. */ void isc_stats_decrement(isc_stats_t *stats, isc_statscounter_t counter); /*%< * Decrement the counter-th counter of stats. * * Requires: *\li 'stats' is a valid isc_stats_t. */ void isc_stats_dump(isc_stats_t *stats, isc_stats_dumper_t dump_fn, void *arg, unsigned int options); /*%< * Dump the current statistics counters in a specified way. For each counter * in stats, dump_fn is called with its current value and the given argument * arg. By default counters that have a value of 0 is skipped; if options has * the ISC_STATSDUMP_VERBOSE flag, even such counters are dumped. * * Requires: *\li 'stats' is a valid isc_stats_t. */ ISC_LANG_ENDDECLS #endif /* ISC_STATS_H */ ntp-4.2.6p5/lib/isc/include/isc/xml.h0000644000175000017500000000302411307651604016311 0ustar peterpeter/* * Copyright (C) 2006, 2007 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: xml.h,v 1.4 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_XML_H #define ISC_XML_H 1 /* * This file is here mostly to make it easy to add additional libxml header * files as needed across all the users of this file. Rather than place * these libxml includes in each file, one include makes it easy to handle * the ifdef as well as adding the ability to add additional functions * which may be useful. */ #ifdef HAVE_LIBXML2 #include #include #endif #define ISC_XMLCHAR (const xmlChar *) #define ISC_XML_RENDERCONFIG 0x00000001 /* render config data */ #define ISC_XML_RENDERSTATS 0x00000002 /* render stats */ #define ISC_XML_RENDERALL 0x000000ff /* render everything */ #endif /* ISC_XML_H */ ntp-4.2.6p5/lib/isc/include/isc/symtab.h0000644000175000017500000001026311307651604017013 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1996-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: symtab.h,v 1.24.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_SYMTAB_H #define ISC_SYMTAB_H 1 /***** ***** Module Info *****/ /*! \file isc/symtab.h * \brief Provides a simple memory-based symbol table. * * Keys are C strings, and key comparisons are case-insensitive. A type may * be specified when looking up, defining, or undefining. A type value of * 0 means "match any type"; any other value will only match the given * type. * * It's possible that a client will attempt to define a * tuple when a tuple with the given key and type already exists in the table. * What to do in this case is specified by the client. Possible policies are: * *\li #isc_symexists_reject Disallow the define, returning #ISC_R_EXISTS *\li #isc_symexists_replace Replace the old value with the new. The * undefine action (if provided) will be called * with the old tuple. *\li #isc_symexists_add Add the new tuple, leaving the old tuple in * the table. Subsequent lookups will retrieve * the most-recently-defined tuple. * * A lookup of a key using type 0 will return the most-recently defined * symbol with that key. An undefine of a key using type 0 will undefine the * most-recently defined symbol with that key. Trying to define a key with * type 0 is illegal. * * The symbol table library does not make a copy the key field, so the * caller must ensure that any key it passes to isc_symtab_define() will not * change until it calls isc_symtab_undefine() or isc_symtab_destroy(). * * A user-specified action will be called (if provided) when a symbol is * undefined. It can be used to free memory associated with keys and/or * values. * * \li MP: * The callers of this module must ensure any required synchronization. * * \li Reliability: * No anticipated impact. * * \li Resources: * TBS * * \li Security: * No anticipated impact. * * \li Standards: * None. */ /*** *** Imports. ***/ #include #include /* *** Symbol Tables. ***/ /*% Symbol table value. */ typedef union isc_symvalue { void * as_pointer; const void * as_cpointer; int as_integer; unsigned int as_uinteger; } isc_symvalue_t; typedef void (*isc_symtabaction_t)(char *key, unsigned int type, isc_symvalue_t value, void *userarg); /*% Symbol table exists. */ typedef enum { isc_symexists_reject = 0, /*%< Disallow the define */ isc_symexists_replace = 1, /*%< Replace the old value with the new */ isc_symexists_add = 2 /*%< Add the new tuple */ } isc_symexists_t; ISC_LANG_BEGINDECLS /*% Create a symbol table. */ isc_result_t isc_symtab_create(isc_mem_t *mctx, unsigned int size, isc_symtabaction_t undefine_action, void *undefine_arg, isc_boolean_t case_sensitive, isc_symtab_t **symtabp); /*% Destroy a symbol table. */ void isc_symtab_destroy(isc_symtab_t **symtabp); /*% Lookup a symbol table. */ isc_result_t isc_symtab_lookup(isc_symtab_t *symtab, const char *key, unsigned int type, isc_symvalue_t *value); /*% Define a symbol table. */ isc_result_t isc_symtab_define(isc_symtab_t *symtab, const char *key, unsigned int type, isc_symvalue_t value, isc_symexists_t exists_policy); /*% Undefine a symbol table. */ isc_result_t isc_symtab_undefine(isc_symtab_t *symtab, const char *key, unsigned int type); ISC_LANG_ENDDECLS #endif /* ISC_SYMTAB_H */ ntp-4.2.6p5/lib/isc/include/isc/eventclass.h0000644000175000017500000000357311307651603017670 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: eventclass.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_EVENTCLASS_H #define ISC_EVENTCLASS_H 1 /*! \file isc/eventclass.h ***** Registry of Predefined Event Type Classes *****/ /*% * An event class is an unsigned 16 bit number. Each class may contain up * to 65536 events. An event type is formed by adding the event number * within the class to the class number. * */ #define ISC_EVENTCLASS(eclass) ((eclass) << 16) /*@{*/ /*! * Classes < 1024 are reserved for ISC use. * Event classes >= 1024 and <= 65535 are reserved for application use. */ #define ISC_EVENTCLASS_TASK ISC_EVENTCLASS(0) #define ISC_EVENTCLASS_TIMER ISC_EVENTCLASS(1) #define ISC_EVENTCLASS_SOCKET ISC_EVENTCLASS(2) #define ISC_EVENTCLASS_FILE ISC_EVENTCLASS(3) #define ISC_EVENTCLASS_DNS ISC_EVENTCLASS(4) #define ISC_EVENTCLASS_APP ISC_EVENTCLASS(5) #define ISC_EVENTCLASS_OMAPI ISC_EVENTCLASS(6) #define ISC_EVENTCLASS_RATELIMITER ISC_EVENTCLASS(7) #define ISC_EVENTCLASS_ISCCC ISC_EVENTCLASS(8) /*@}*/ #endif /* ISC_EVENTCLASS_H */ ntp-4.2.6p5/lib/isc/include/isc/ipv6.h0000644000175000017500000000714511307651603016404 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ipv6.h,v 1.24 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_IPV6_H #define ISC_IPV6_H 1 /*! * Also define LWRES_IPV6_H to keep it from being included if liblwres is * being used, or redefinition errors will occur. */ #define LWRES_IPV6_H 1 /***** ***** Module Info *****/ /*! \file isc/ipv6.h * \brief IPv6 definitions for systems which do not support IPv6. * * \li MP: * No impact. * * \li Reliability: * No anticipated impact. * * \li Resources: * N/A. * * \li Security: * No anticipated impact. * * \li Standards: * RFC2553. */ /*** *** Imports. ***/ #include #include /*** *** Types. ***/ struct in6_addr { union { isc_uint8_t _S6_u8[16]; isc_uint16_t _S6_u16[8]; isc_uint32_t _S6_u32[4]; } _S6_un; }; #define s6_addr _S6_un._S6_u8 #define s6_addr8 _S6_un._S6_u8 #define s6_addr16 _S6_un._S6_u16 #define s6_addr32 _S6_un._S6_u32 #define IN6ADDR_ANY_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}} #define IN6ADDR_LOOPBACK_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }}} LIBISC_EXTERNAL_DATA extern const struct in6_addr in6addr_any; LIBISC_EXTERNAL_DATA extern const struct in6_addr in6addr_loopback; struct sockaddr_in6 { #ifdef ISC_PLATFORM_HAVESALEN isc_uint8_t sin6_len; isc_uint8_t sin6_family; #else isc_uint16_t sin6_family; #endif isc_uint16_t sin6_port; isc_uint32_t sin6_flowinfo; struct in6_addr sin6_addr; isc_uint32_t sin6_scope_id; }; #ifdef ISC_PLATFORM_HAVESALEN #define SIN6_LEN 1 #endif /*% * Unspecified */ #define IN6_IS_ADDR_UNSPECIFIED(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] == 0)) /*% * Loopback */ #define IN6_IS_ADDR_LOOPBACK(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] == htonl(1))) /*% * IPv4 compatible */ #define IN6_IS_ADDR_V4COMPAT(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] != 0) && \ ((a)->s6_addr32[3] != htonl(1))) /*% * Mapped */ #define IN6_IS_ADDR_V4MAPPED(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == htonl(0x0000ffff))) /*% * Multicast */ #define IN6_IS_ADDR_MULTICAST(a) \ ((a)->s6_addr8[0] == 0xffU) /*% * Unicast link / site local. */ #define IN6_IS_ADDR_LINKLOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) #define IN6_IS_ADDR_SITELOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) #endif /* ISC_IPV6_H */ ntp-4.2.6p5/lib/isc/include/isc/sha1.h0000644000175000017500000000320611307651604016347 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #ifndef ISC_SHA1_H #define ISC_SHA1_H 1 /* $Id: sha1.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ /* $NetBSD: sha1.h,v 1.2 1998/05/29 22:55:44 thorpej Exp $ */ /*! \file isc/sha1.h * \brief SHA-1 in C * \author By Steve Reid * \note 100% Public Domain */ #include #include #define ISC_SHA1_DIGESTLENGTH 20U #define ISC_SHA1_BLOCK_LENGTH 64U typedef struct { isc_uint32_t state[5]; isc_uint32_t count[2]; unsigned char buffer[ISC_SHA1_BLOCK_LENGTH]; } isc_sha1_t; ISC_LANG_BEGINDECLS void isc_sha1_init(isc_sha1_t *ctx); void isc_sha1_invalidate(isc_sha1_t *ctx); void isc_sha1_update(isc_sha1_t *ctx, const unsigned char *data, unsigned int len); void isc_sha1_final(isc_sha1_t *ctx, unsigned char *digest); ISC_LANG_ENDDECLS #endif /* ISC_SHA1_H */ ntp-4.2.6p5/lib/isc/include/isc/ratelimiter.h0000644000175000017500000000676211307651603020045 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ratelimiter.h,v 1.21.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_RATELIMITER_H #define ISC_RATELIMITER_H 1 /***** ***** Module Info *****/ /*! \file isc/ratelimiter.h * \brief A rate limiter is a mechanism for dispatching events at a limited * rate. This is intended to be used when sending zone maintenance * SOA queries, NOTIFY messages, etc. */ /*** *** Imports. ***/ #include #include ISC_LANG_BEGINDECLS /***** ***** Functions. *****/ isc_result_t isc_ratelimiter_create(isc_mem_t *mctx, isc_timermgr_t *timermgr, isc_task_t *task, isc_ratelimiter_t **ratelimiterp); /*%< * Create a rate limiter. The execution interval is initially undefined. */ isc_result_t isc_ratelimiter_setinterval(isc_ratelimiter_t *rl, isc_interval_t *interval); /*!< * Set the minimum interval between event executions. * The interval value is copied, so the caller need not preserve it. * * Requires: * '*interval' is a nonzero interval. */ void isc_ratelimiter_setpertic(isc_ratelimiter_t *rl, isc_uint32_t perint); /*%< * Set the number of events processed per interval timer tick. * If 'perint' is zero it is treated as 1. */ isc_result_t isc_ratelimiter_enqueue(isc_ratelimiter_t *rl, isc_task_t *task, isc_event_t **eventp); /*%< * Queue an event for rate-limited execution. * * This is similar * to doing an isc_task_send() to the 'task', except that the * execution may be delayed to achieve the desired rate of * execution. * * '(*eventp)->ev_sender' is used to hold the task. The caller * must ensure that the task exists until the event is delivered. * * Requires: *\li An interval has been set by calling * isc_ratelimiter_setinterval(). * *\li 'task' to be non NULL. *\li '(*eventp)->ev_sender' to be NULL. */ void isc_ratelimiter_shutdown(isc_ratelimiter_t *ratelimiter); /*%< * Shut down a rate limiter. * * Ensures: *\li All events that have not yet been * dispatched to the task are dispatched immediately with * the #ISC_EVENTATTR_CANCELED bit set in ev_attributes. * *\li Further attempts to enqueue events will fail with * #ISC_R_SHUTTINGDOWN. * *\li The rate limiter is no longer attached to its task. */ void isc_ratelimiter_attach(isc_ratelimiter_t *source, isc_ratelimiter_t **target); /*%< * Attach to a rate limiter. */ void isc_ratelimiter_detach(isc_ratelimiter_t **ratelimiterp); /*%< * Detach from a rate limiter. */ isc_result_t isc_ratelimiter_stall(isc_ratelimiter_t *rl); /*%< * Stall event processing. */ isc_result_t isc_ratelimiter_release(isc_ratelimiter_t *rl); /*%< * Release a stalled rate limiter. */ ISC_LANG_ENDDECLS #endif /* ISC_RATELIMITER_H */ ntp-4.2.6p5/lib/isc/include/isc/formatcheck.h0000644000175000017500000000261711307651604020006 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: formatcheck.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_FORMATCHECK_H #define ISC_FORMATCHECK_H 1 /*! \file isc/formatcheck.h */ /*% * ISC_FORMAT_PRINTF(). * * \li fmt is the location of the format string parameter. * \li args is the location of the first argument (or 0 for no argument checking). * * Note: * \li The first parameter is 1, not 0. */ #ifdef __GNUC__ #define ISC_FORMAT_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args))) #else #define ISC_FORMAT_PRINTF(fmt, args) #endif #endif /* ISC_FORMATCHECK_H */ ntp-4.2.6p5/lib/isc/include/isc/random.h0000644000175000017500000000345011307651604016774 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: random.h,v 1.18.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_RANDOM_H #define ISC_RANDOM_H 1 #include #include /*! \file isc/random.h * \brief Implements a random state pool which will let the caller return a * series of possibly non-reproducible random values. * * Note that the * strength of these numbers is not all that high, and should not be * used in cryptography functions. It is useful for jittering values * a bit here and there, such as timeouts, etc. */ ISC_LANG_BEGINDECLS void isc_random_seed(isc_uint32_t seed); /*%< * Set the initial seed of the random state. */ void isc_random_get(isc_uint32_t *val); /*%< * Get a random value. * * Requires: * val != NULL. */ isc_uint32_t isc_random_jitter(isc_uint32_t max, isc_uint32_t jitter); /*%< * Get a random value between (max - jitter) and (max). * This is useful for jittering timer values. */ ISC_LANG_ENDDECLS #endif /* ISC_RANDOM_H */ ntp-4.2.6p5/lib/isc/include/isc/hmacsha.h0000644000175000017500000001021211307651604017112 0ustar peterpeter/* * Copyright (C) 2005-2007 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: hmacsha.h,v 1.7 2007/06/19 23:47:18 tbox Exp $ */ /*! \file isc/hmacsha.h * This is the header file for the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, * HMAC-SHA334 and HMAC-SHA512 hash algorithm described in RFC 2104. */ #ifndef ISC_HMACSHA_H #define ISC_HMACSHA_H 1 #include #include #include #include #define ISC_HMACSHA1_KEYLENGTH ISC_SHA1_BLOCK_LENGTH #define ISC_HMACSHA224_KEYLENGTH ISC_SHA224_BLOCK_LENGTH #define ISC_HMACSHA256_KEYLENGTH ISC_SHA256_BLOCK_LENGTH #define ISC_HMACSHA384_KEYLENGTH ISC_SHA384_BLOCK_LENGTH #define ISC_HMACSHA512_KEYLENGTH ISC_SHA512_BLOCK_LENGTH typedef struct { isc_sha1_t sha1ctx; unsigned char key[ISC_HMACSHA1_KEYLENGTH]; } isc_hmacsha1_t; typedef struct { isc_sha224_t sha224ctx; unsigned char key[ISC_HMACSHA224_KEYLENGTH]; } isc_hmacsha224_t; typedef struct { isc_sha256_t sha256ctx; unsigned char key[ISC_HMACSHA256_KEYLENGTH]; } isc_hmacsha256_t; typedef struct { isc_sha384_t sha384ctx; unsigned char key[ISC_HMACSHA384_KEYLENGTH]; } isc_hmacsha384_t; typedef struct { isc_sha512_t sha512ctx; unsigned char key[ISC_HMACSHA512_KEYLENGTH]; } isc_hmacsha512_t; ISC_LANG_BEGINDECLS void isc_hmacsha1_init(isc_hmacsha1_t *ctx, const unsigned char *key, unsigned int len); void isc_hmacsha1_invalidate(isc_hmacsha1_t *ctx); void isc_hmacsha1_update(isc_hmacsha1_t *ctx, const unsigned char *buf, unsigned int len); void isc_hmacsha1_sign(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len); isc_boolean_t isc_hmacsha1_verify(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len); void isc_hmacsha224_init(isc_hmacsha224_t *ctx, const unsigned char *key, unsigned int len); void isc_hmacsha224_invalidate(isc_hmacsha224_t *ctx); void isc_hmacsha224_update(isc_hmacsha224_t *ctx, const unsigned char *buf, unsigned int len); void isc_hmacsha224_sign(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len); isc_boolean_t isc_hmacsha224_verify(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len); void isc_hmacsha256_init(isc_hmacsha256_t *ctx, const unsigned char *key, unsigned int len); void isc_hmacsha256_invalidate(isc_hmacsha256_t *ctx); void isc_hmacsha256_update(isc_hmacsha256_t *ctx, const unsigned char *buf, unsigned int len); void isc_hmacsha256_sign(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len); isc_boolean_t isc_hmacsha256_verify(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len); void isc_hmacsha384_init(isc_hmacsha384_t *ctx, const unsigned char *key, unsigned int len); void isc_hmacsha384_invalidate(isc_hmacsha384_t *ctx); void isc_hmacsha384_update(isc_hmacsha384_t *ctx, const unsigned char *buf, unsigned int len); void isc_hmacsha384_sign(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len); isc_boolean_t isc_hmacsha384_verify(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len); void isc_hmacsha512_init(isc_hmacsha512_t *ctx, const unsigned char *key, unsigned int len); void isc_hmacsha512_invalidate(isc_hmacsha512_t *ctx); void isc_hmacsha512_update(isc_hmacsha512_t *ctx, const unsigned char *buf, unsigned int len); void isc_hmacsha512_sign(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len); isc_boolean_t isc_hmacsha512_verify(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len); ISC_LANG_ENDDECLS #endif /* ISC_HMACSHA_H */ ntp-4.2.6p5/lib/isc/include/isc/hash.h0000644000175000017500000001353311307651604016442 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: hash.h,v 1.10.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_HASH_H #define ISC_HASH_H 1 /***** ***** Module Info *****/ /*! \file isc/hash.h * * \brief The hash API * provides an unpredictable hash value for variable length data. * A hash object contains a random vector (which is hidden from clients * of this API) to make the actual hash value unpredictable. * * The algorithm used in the API guarantees the probability of hash * collision; in the current implementation, as long as the values stored * in the random vector are unpredictable, the probability of hash * collision between arbitrary two different values is at most 1/2^16. * * Although the API is generic about the hash keys, it mainly expects * DNS names (and sometimes IPv4/v6 addresses) as inputs. It has an * upper limit of the input length, and may run slow to calculate the * hash values for large inputs. * * This API is designed to be general so that it can provide multiple * different hash contexts that have different random vectors. However, * it should be typical to have a single context for an entire system. * To support such cases, the API also provides a single-context mode. * * \li MP: * The hash object is almost read-only. Once the internal random vector * is initialized, no write operation will occur, and there will be no * need to lock the object to calculate actual hash values. * * \li Reliability: * In some cases this module uses low-level data copy to initialize the * random vector. Errors in this part are likely to crash the server or * corrupt memory. * * \li Resources: * A buffer, used as a random vector for calculating hash values. * * \li Security: * This module intends to provide unpredictable hash values in * adversarial environments in order to avoid denial of service attacks * to hash buckets. * Its unpredictability relies on the quality of entropy to build the * random vector. * * \li Standards: * None. */ /*** *** Imports ***/ #include /*** *** Functions ***/ ISC_LANG_BEGINDECLS isc_result_t isc_hash_ctxcreate(isc_mem_t *mctx, isc_entropy_t *entropy, unsigned int limit, isc_hash_t **hctx); isc_result_t isc_hash_create(isc_mem_t *mctx, isc_entropy_t *entropy, size_t limit); /*!< * \brief Create a new hash object. * * isc_hash_ctxcreate() creates a different object. * * isc_hash_create() creates a module-internal object to support the * single-context mode. It should be called only once. * * 'entropy' must be NULL or a valid entropy object. If 'entropy' is NULL, * pseudo random values will be used to build the random vector, which may * weaken security. * * 'limit' specifies the maximum number of hash keys. If it is too large, * these functions may fail. */ void isc_hash_ctxattach(isc_hash_t *hctx, isc_hash_t **hctxp); /*!< * \brief Attach to a hash object. * * This function is only necessary for the multiple-context mode. */ void isc_hash_ctxdetach(isc_hash_t **hctxp); /*!< * \brief Detach from a hash object. * * This function is for the multiple-context mode, and takes a valid * hash object as an argument. */ void isc_hash_destroy(void); /*!< * \brief This function is for the single-context mode, and is expected to be used * as a counterpart of isc_hash_create(). * * A valid module-internal hash object must have been created, and this * function should be called only once. */ /*@{*/ void isc_hash_ctxinit(isc_hash_t *hctx); void isc_hash_init(void); /*!< * \brief Initialize a hash object. * * It fills in the random vector with a proper * source of entropy, which is typically from the entropy object specified * at the creation. Thus, it is desirable to call these functions after * initializing the entropy object with some good entropy sources. * * These functions should be called before the first hash calculation. * * isc_hash_ctxinit() is for the multiple-context mode, and takes a valid hash * object as an argument. * * isc_hash_init() is for the single-context mode. A valid module-internal * hash object must have been created, and this function should be called only * once. */ /*@}*/ /*@{*/ unsigned int isc_hash_ctxcalc(isc_hash_t *hctx, const unsigned char *key, unsigned int keylen, isc_boolean_t case_sensitive); unsigned int isc_hash_calc(const unsigned char *key, unsigned int keylen, isc_boolean_t case_sensitive); /*!< * \brief Calculate a hash value. * * isc_hash_ctxinit() is for the multiple-context mode, and takes a valid hash * object as an argument. * * isc_hash_init() is for the single-context mode. A valid module-internal * hash object must have been created. * * 'key' is the hash key, which is a variable length buffer. * * 'keylen' specifies the key length, which must not be larger than the limit * specified for the corresponding hash object. * * 'case_sensitive' specifies whether the hash key should be treated as * case_sensitive values. It should typically be ISC_FALSE if the hash key * is a DNS name. */ /*@}*/ ISC_LANG_ENDDECLS #endif /* ISC_HASH_H */ ntp-4.2.6p5/lib/isc/include/isc/msgcat.h0000644000175000017500000000627011307651604016775 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: msgcat.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_MSGCAT_H #define ISC_MSGCAT_H 1 /***** ***** Module Info *****/ /*! \file isc/msgcat.h * \brief The ISC Message Catalog * aids internationalization of applications by allowing * messages to be retrieved from locale-specific files instead of * hardwiring them into the application. This allows translations of * messages appropriate to the locale to be supplied without recompiling * the application. * * Notes: *\li It's very important that message catalogs work, even if only the * default_text can be used. * * MP: *\li The caller must ensure appropriate synchronization of * isc_msgcat_open() and isc_msgcat_close(). isc_msgcat_get() * ensures appropriate synchronization. * * Reliability: *\li No anticipated impact. * * Resources: *\li TBS * * \li Security: * No anticipated impact. * * \li Standards: * None. */ /***** ***** Imports *****/ #include #include ISC_LANG_BEGINDECLS /***** ***** Methods *****/ void isc_msgcat_open(const char *name, isc_msgcat_t **msgcatp); /*%< * Open a message catalog. * * Notes: * *\li If memory cannot be allocated or other failures occur, *msgcatp * will be set to NULL. If a NULL msgcat is given to isc_msgcat_get(), * the default_text will be returned, ensuring that some message text * will be available, no matter what's going wrong. * * Requires: * *\li 'name' is a valid string. * *\li msgcatp != NULL && *msgcatp == NULL */ void isc_msgcat_close(isc_msgcat_t **msgcatp); /*%< * Close a message catalog. * * Notes: * *\li Any string pointers returned by prior calls to isc_msgcat_get() are * invalid after isc_msgcat_close() has been called and must not be * used. * * Requires: * *\li *msgcatp is a valid message catalog or is NULL. * * Ensures: * *\li All resources associated with the message catalog are released. * *\li *msgcatp == NULL */ const char * isc_msgcat_get(isc_msgcat_t *msgcat, int set, int message, const char *default_text); /*%< * Get message 'message' from message set 'set' in 'msgcat'. If it * is not available, use 'default_text'. * * Requires: * *\li 'msgcat' is a valid message catalog or is NULL. * *\li set > 0 * *\li message > 0 * *\li 'default_text' is a valid string. */ ISC_LANG_ENDDECLS #endif /* ISC_MSGCAT_H */ ntp-4.2.6p5/lib/isc/include/isc/heap.h0000644000175000017500000001320011307651605016424 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1997-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: heap.h,v 1.24.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_HEAP_H #define ISC_HEAP_H 1 /*! \file isc/heap.h */ #include #include ISC_LANG_BEGINDECLS /*% * The comparison function returns ISC_TRUE if the first argument has * higher priority than the second argument, and ISC_FALSE otherwise. */ typedef isc_boolean_t (*isc_heapcompare_t)(void *, void *); /*% * The index function allows the client of the heap to receive a callback * when an item's index number changes. This allows it to maintain * sync with its external state, but still delete itself, since deletions * from the heap require the index be provided. */ typedef void (*isc_heapindex_t)(void *, unsigned int); /*% * The heapaction function is used when iterating over the heap. * * NOTE: The heap structure CANNOT BE MODIFIED during the call to * isc_heap_foreach(). */ typedef void (*isc_heapaction_t)(void *, void *); typedef struct isc_heap isc_heap_t; isc_result_t isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare, isc_heapindex_t index, unsigned int size_increment, isc_heap_t **heapp); /*!< * \brief Create a new heap. The heap is implemented using a space-efficient * storage method. When the heap elements are deleted space is not freed * but will be reused when new elements are inserted. * * Requires: *\li "mctx" is valid. *\li "compare" is a function which takes two void * arguments and * returns ISC_TRUE if the first argument has a higher priority than * the second, and ISC_FALSE otherwise. *\li "index" is a function which takes a void *, and an unsigned int * argument. This function will be called whenever an element's * index value changes, so it may continue to delete itself from the * heap. This option may be NULL if this functionality is unneeded. *\li "size_increment" is a hint about how large the heap should grow * when resizing is needed. If this is 0, a default size will be * used, which is currently 1024, allowing space for an additional 1024 * heap elements to be inserted before adding more space. *\li "heapp" is not NULL, and "*heap" is NULL. * * Returns: *\li ISC_R_SUCCESS - success *\li ISC_R_NOMEMORY - insufficient memory */ void isc_heap_destroy(isc_heap_t **heapp); /*!< * \brief Destroys a heap. * * Requires: *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. */ isc_result_t isc_heap_insert(isc_heap_t *heap, void *elt); /*!< * \brief Inserts a new element into a heap. * * Requires: *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. */ void isc_heap_delete(isc_heap_t *heap, unsigned int index); /*!< * \brief Deletes an element from a heap, by element index. * * Requires: *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. *\li "index" is a valid element index, as provided by the "index" callback * provided during heap creation. */ void isc_heap_increased(isc_heap_t *heap, unsigned int index); /*!< * \brief Indicates to the heap that an element's priority has increased. * This function MUST be called whenever an element has increased in priority. * * Requires: *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. *\li "index" is a valid element index, as provided by the "index" callback * provided during heap creation. */ void isc_heap_decreased(isc_heap_t *heap, unsigned int index); /*!< * \brief Indicates to the heap that an element's priority has decreased. * This function MUST be called whenever an element has decreased in priority. * * Requires: *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. *\li "index" is a valid element index, as provided by the "index" callback * provided during heap creation. */ void * isc_heap_element(isc_heap_t *heap, unsigned int index); /*!< * \brief Returns the element for a specific element index. * * Requires: *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. *\li "index" is a valid element index, as provided by the "index" callback * provided during heap creation. * * Returns: *\li A pointer to the element for the element index. */ void isc_heap_foreach(isc_heap_t *heap, isc_heapaction_t action, void *uap); /*!< * \brief Iterate over the heap, calling an action for each element. The * order of iteration is not sorted. * * Requires: *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t. *\li "action" is not NULL, and is a function which takes two arguments. * The first is a void *, representing the element, and the second is * "uap" as provided to isc_heap_foreach. *\li "uap" is a caller-provided argument, and may be NULL. * * Note: *\li The heap structure CANNOT be modified during this iteration. The only * safe function to call while iterating the heap is isc_heap_element(). */ ISC_LANG_ENDDECLS #endif /* ISC_HEAP_H */ ntp-4.2.6p5/lib/isc/include/isc/string.h0000644000175000017500000001440411307651605017024 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: string.h,v 1.23 2007/09/13 04:48:16 each Exp $ */ #ifndef ISC_STRING_H #define ISC_STRING_H 1 /*! \file isc/string.h */ #include #include #include #include #include #include #ifdef ISC_PLATFORM_HAVESTRINGSH #include #endif #define ISC_STRING_MAGIC 0x5e ISC_LANG_BEGINDECLS isc_uint64_t isc_string_touint64(char *source, char **endp, int base); /*%< * Convert the string pointed to by 'source' to isc_uint64_t. * * On successful conversion 'endp' points to the first character * after conversion is complete. * * 'base': 0 or 2..36 * * If base is 0 the base is computed from the string type. * * On error 'endp' points to 'source'. */ isc_result_t isc_string_copy(char *target, size_t size, const char *source); /* * Copy the string pointed to by 'source' to 'target' which is a * pointer to a string of at least 'size' bytes. * * Requires: * 'target' is a pointer to a char[] of at least 'size' bytes. * 'size' an integer > 0. * 'source' == NULL or points to a NUL terminated string. * * Ensures: * If result == ISC_R_SUCCESS * 'target' will be a NUL terminated string of no more * than 'size' bytes (including NUL). * * If result == ISC_R_NOSPACE * 'target' is undefined. * * Returns: * ISC_R_SUCCESS -- 'source' was successfully copied to 'target'. * ISC_R_NOSPACE -- 'source' could not be copied since 'target' * is too small. */ void isc_string_copy_truncate(char *target, size_t size, const char *source); /* * Copy the string pointed to by 'source' to 'target' which is a * pointer to a string of at least 'size' bytes. * * Requires: * 'target' is a pointer to a char[] of at least 'size' bytes. * 'size' an integer > 0. * 'source' == NULL or points to a NUL terminated string. * * Ensures: * 'target' will be a NUL terminated string of no more * than 'size' bytes (including NUL). */ isc_result_t isc_string_append(char *target, size_t size, const char *source); /* * Append the string pointed to by 'source' to 'target' which is a * pointer to a NUL terminated string of at least 'size' bytes. * * Requires: * 'target' is a pointer to a NUL terminated char[] of at * least 'size' bytes. * 'size' an integer > 0. * 'source' == NULL or points to a NUL terminated string. * * Ensures: * If result == ISC_R_SUCCESS * 'target' will be a NUL terminated string of no more * than 'size' bytes (including NUL). * * If result == ISC_R_NOSPACE * 'target' is undefined. * * Returns: * ISC_R_SUCCESS -- 'source' was successfully appended to 'target'. * ISC_R_NOSPACE -- 'source' could not be appended since 'target' * is too small. */ void isc_string_append_truncate(char *target, size_t size, const char *source); /* * Append the string pointed to by 'source' to 'target' which is a * pointer to a NUL terminated string of at least 'size' bytes. * * Requires: * 'target' is a pointer to a NUL terminated char[] of at * least 'size' bytes. * 'size' an integer > 0. * 'source' == NULL or points to a NUL terminated string. * * Ensures: * 'target' will be a NUL terminated string of no more * than 'size' bytes (including NUL). */ isc_result_t isc_string_printf(char *target, size_t size, const char *format, ...) ISC_FORMAT_PRINTF(3, 4); /* * Print 'format' to 'target' which is a pointer to a string of at least * 'size' bytes. * * Requires: * 'target' is a pointer to a char[] of at least 'size' bytes. * 'size' an integer > 0. * 'format' == NULL or points to a NUL terminated string. * * Ensures: * If result == ISC_R_SUCCESS * 'target' will be a NUL terminated string of no more * than 'size' bytes (including NUL). * * If result == ISC_R_NOSPACE * 'target' is undefined. * * Returns: * ISC_R_SUCCESS -- 'format' was successfully printed to 'target'. * ISC_R_NOSPACE -- 'format' could not be printed to 'target' since it * is too small. */ void isc_string_printf_truncate(char *target, size_t size, const char *format, ...) ISC_FORMAT_PRINTF(3, 4); /* * Print 'format' to 'target' which is a pointer to a string of at least * 'size' bytes. * * Requires: * 'target' is a pointer to a char[] of at least 'size' bytes. * 'size' an integer > 0. * 'format' == NULL or points to a NUL terminated string. * * Ensures: * 'target' will be a NUL terminated string of no more * than 'size' bytes (including NUL). */ char * isc_string_regiondup(isc_mem_t *mctx, const isc_region_t *source); /* * Copy the region pointed to by r to a NUL terminated string * allocated from the memory context pointed to by mctx. * * The result should be deallocated using isc_mem_free() * * Requires: * 'mctx' is a point to a valid memory context. * 'source' is a pointer to a valid region. * * Returns: * a pointer to a NUL terminated string or * NULL if memory for the copy could not be allocated * */ char * isc_string_separate(char **stringp, const char *delim); #ifdef ISC_PLATFORM_NEEDSTRSEP #define strsep isc_string_separate #endif #ifdef ISC_PLATFORM_NEEDMEMMOVE #define memmove(a,b,c) bcopy(b,a,c) #endif size_t isc_string_strlcpy(char *dst, const char *src, size_t size); #ifdef ISC_PLATFORM_NEEDSTRLCPY #define strlcpy isc_string_strlcpy #endif size_t isc_string_strlcat(char *dst, const char *src, size_t size); #ifdef ISC_PLATFORM_NEEDSTRLCAT #define strlcat isc_string_strlcat #endif ISC_LANG_ENDDECLS #endif /* ISC_STRING_H */ ntp-4.2.6p5/lib/isc/include/isc/result.h0000644000175000017500000001115111307651604017027 0ustar peterpeter/* * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: result.h,v 1.71 2008/09/25 04:02:39 tbox Exp $ */ #ifndef ISC_RESULT_H #define ISC_RESULT_H 1 /*! \file isc/result.h */ #include #include #define ISC_R_SUCCESS 0 /*%< success */ #define ISC_R_NOMEMORY 1 /*%< out of memory */ #define ISC_R_TIMEDOUT 2 /*%< timed out */ #define ISC_R_NOTHREADS 3 /*%< no available threads */ #define ISC_R_ADDRNOTAVAIL 4 /*%< address not available */ #define ISC_R_ADDRINUSE 5 /*%< address in use */ #define ISC_R_NOPERM 6 /*%< permission denied */ #define ISC_R_NOCONN 7 /*%< no pending connections */ #define ISC_R_NETUNREACH 8 /*%< network unreachable */ #define ISC_R_HOSTUNREACH 9 /*%< host unreachable */ #define ISC_R_NETDOWN 10 /*%< network down */ #define ISC_R_HOSTDOWN 11 /*%< host down */ #define ISC_R_CONNREFUSED 12 /*%< connection refused */ #define ISC_R_NORESOURCES 13 /*%< not enough free resources */ #define ISC_R_EOF 14 /*%< end of file */ #define ISC_R_BOUND 15 /*%< socket already bound */ #define ISC_R_RELOAD 16 /*%< reload */ #define ISC_R_LOCKBUSY 17 /*%< lock busy */ #define ISC_R_EXISTS 18 /*%< already exists */ #define ISC_R_NOSPACE 19 /*%< ran out of space */ #define ISC_R_CANCELED 20 /*%< operation canceled */ #define ISC_R_NOTBOUND 21 /*%< socket is not bound */ #define ISC_R_SHUTTINGDOWN 22 /*%< shutting down */ #define ISC_R_NOTFOUND 23 /*%< not found */ #define ISC_R_UNEXPECTEDEND 24 /*%< unexpected end of input */ #define ISC_R_FAILURE 25 /*%< generic failure */ #define ISC_R_IOERROR 26 /*%< I/O error */ #define ISC_R_NOTIMPLEMENTED 27 /*%< not implemented */ #define ISC_R_UNBALANCED 28 /*%< unbalanced parentheses */ #define ISC_R_NOMORE 29 /*%< no more */ #define ISC_R_INVALIDFILE 30 /*%< invalid file */ #define ISC_R_BADBASE64 31 /*%< bad base64 encoding */ #define ISC_R_UNEXPECTEDTOKEN 32 /*%< unexpected token */ #define ISC_R_QUOTA 33 /*%< quota reached */ #define ISC_R_UNEXPECTED 34 /*%< unexpected error */ #define ISC_R_ALREADYRUNNING 35 /*%< already running */ #define ISC_R_IGNORE 36 /*%< ignore */ #define ISC_R_MASKNONCONTIG 37 /*%< addr mask not contiguous */ #define ISC_R_FILENOTFOUND 38 /*%< file not found */ #define ISC_R_FILEEXISTS 39 /*%< file already exists */ #define ISC_R_NOTCONNECTED 40 /*%< socket is not connected */ #define ISC_R_RANGE 41 /*%< out of range */ #define ISC_R_NOENTROPY 42 /*%< out of entropy */ #define ISC_R_MULTICAST 43 /*%< invalid use of multicast */ #define ISC_R_NOTFILE 44 /*%< not a file */ #define ISC_R_NOTDIRECTORY 45 /*%< not a directory */ #define ISC_R_QUEUEFULL 46 /*%< queue is full */ #define ISC_R_FAMILYMISMATCH 47 /*%< address family mismatch */ #define ISC_R_FAMILYNOSUPPORT 48 /*%< AF not supported */ #define ISC_R_BADHEX 49 /*%< bad hex encoding */ #define ISC_R_TOOMANYOPENFILES 50 /*%< too many open files */ #define ISC_R_NOTBLOCKING 51 /*%< not blocking */ #define ISC_R_UNBALANCEDQUOTES 52 /*%< unbalanced quotes */ #define ISC_R_INPROGRESS 53 /*%< operation in progress */ #define ISC_R_CONNECTIONRESET 54 /*%< connection reset */ #define ISC_R_SOFTQUOTA 55 /*%< soft quota reached */ #define ISC_R_BADNUMBER 56 /*%< not a valid number */ #define ISC_R_DISABLED 57 /*%< disabled */ #define ISC_R_MAXSIZE 58 /*%< max size */ #define ISC_R_BADADDRESSFORM 59 /*%< invalid address format */ #define ISC_R_BADBASE32 60 /*%< bad base32 encoding */ /*% Not a result code: the number of results. */ #define ISC_R_NRESULTS 61 ISC_LANG_BEGINDECLS const char * isc_result_totext(isc_result_t); /*%< * Convert an isc_result_t into a string message describing the result. */ isc_result_t isc_result_register(unsigned int base, unsigned int nresults, const char **text, isc_msgcat_t *msgcat, int set); ISC_LANG_ENDDECLS #endif /* ISC_RESULT_H */ ntp-4.2.6p5/lib/isc/include/isc/lfsr.h0000644000175000017500000000663011307651604016465 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: lfsr.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_LFSR_H #define ISC_LFSR_H 1 /*! \file isc/lfsr.h */ #include #include typedef struct isc_lfsr isc_lfsr_t; /*% * This function is called when reseeding is needed. It is allowed to * modify any state in the LFSR in any way it sees fit OTHER THAN "bits". * * It MUST set "count" to a new value or the lfsr will never reseed again. * * Also, a reseed will never occur in the middle of an extraction. This * is purely an optimization, and is probably what one would want. */ typedef void (*isc_lfsrreseed_t)(isc_lfsr_t *, void *); /*% * The members of this structure can be used by the application, but care * needs to be taken to not change state once the lfsr is in operation. */ struct isc_lfsr { isc_uint32_t state; /*%< previous state */ unsigned int bits; /*%< length */ isc_uint32_t tap; /*%< bit taps */ unsigned int count; /*%< reseed count (in BITS!) */ isc_lfsrreseed_t reseed; /*%< reseed function */ void *arg; /*%< reseed function argument */ }; ISC_LANG_BEGINDECLS void isc_lfsr_init(isc_lfsr_t *lfsr, isc_uint32_t state, unsigned int bits, isc_uint32_t tap, unsigned int count, isc_lfsrreseed_t reseed, void *arg); /*%< * Initialize an LFSR. * * Note: * *\li Putting untrusted values into this function will cause the LFSR to * generate (perhaps) non-maximal length sequences. * * Requires: * *\li lfsr != NULL * *\li 8 <= bits <= 32 * *\li tap != 0 */ void isc_lfsr_generate(isc_lfsr_t *lfsr, void *data, unsigned int count); /*%< * Returns "count" bytes of data from the LFSR. * * Requires: * *\li lfsr be valid. * *\li data != NULL. * *\li count > 0. */ void isc_lfsr_skip(isc_lfsr_t *lfsr, unsigned int skip); /*%< * Skip "skip" states. * * Requires: * *\li lfsr be valid. */ isc_uint32_t isc_lfsr_generate32(isc_lfsr_t *lfsr1, isc_lfsr_t *lfsr2); /*%< * Given two LFSRs, use the current state from each to skip entries in the * other. The next states are then xor'd together and returned. * * WARNING: * *\li This function is used only for very, very low security data, such * as DNS message IDs where it is desired to have an unpredictable * stream of bytes that are harder to predict than a simple flooding * attack. * * Notes: * *\li Since the current state from each of the LFSRs is used to skip * state in the other, it is important that no state be leaked * from either LFSR. * * Requires: * *\li lfsr1 and lfsr2 be valid. * *\li 1 <= skipbits <= 31 */ ISC_LANG_ENDDECLS #endif /* ISC_LFSR_H */ ntp-4.2.6p5/lib/isc/include/isc/stdio.h0000644000175000017500000000422111307651614016634 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: stdio.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_STDIO_H #define ISC_STDIO_H 1 /*! \file isc/stdio.h */ /*% * These functions are wrappers around the corresponding stdio functions. * * They return a detailed error code in the form of an an isc_result_t. ANSI C * does not guarantee that stdio functions set errno, hence these functions * must use platform dependent methods (e.g., the POSIX errno) to construct the * error code. */ #include #include #include ISC_LANG_BEGINDECLS /*% Open */ isc_result_t isc_stdio_open(const char *filename, const char *mode, FILE **fp); /*% Close */ isc_result_t isc_stdio_close(FILE *f); /*% Seek */ isc_result_t isc_stdio_seek(FILE *f, long offset, int whence); /*% Read */ isc_result_t isc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f, size_t *nret); /*% Write */ isc_result_t isc_stdio_write(const void *ptr, size_t size, size_t nmemb, FILE *f, size_t *nret); /*% Flush */ isc_result_t isc_stdio_flush(FILE *f); isc_result_t isc_stdio_sync(FILE *f); /*%< * Invoke fsync() on the file descriptor underlying an stdio stream, or an * equivalent system-dependent operation. Note that this function has no * direct counterpart in the stdio library. */ ISC_LANG_ENDDECLS #endif /* ISC_STDIO_H */ ntp-4.2.6p5/lib/isc/include/isc/commandline.h0000644000175000017500000000343711307651603020006 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: commandline.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_COMMANDLINE_H #define ISC_COMMANDLINE_H 1 /*! \file isc/commandline.h */ #include #include #include /*% Index into parent argv vector. */ LIBISC_EXTERNAL_DATA extern int isc_commandline_index; /*% Character checked for validity. */ LIBISC_EXTERNAL_DATA extern int isc_commandline_option; /*% Argument associated with option. */ LIBISC_EXTERNAL_DATA extern char *isc_commandline_argument; /*% For printing error messages. */ LIBISC_EXTERNAL_DATA extern char *isc_commandline_progname; /*% Print error message. */ LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_errprint; /*% Reset getopt. */ LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_reset; ISC_LANG_BEGINDECLS /*% parse command line */ int isc_commandline_parse(int argc, char * const *argv, const char *options); ISC_LANG_ENDDECLS #endif /* ISC_COMMANDLINE_H */ ntp-4.2.6p5/lib/isc/include/isc/types.h0000644000175000017500000001303411307651604016657 0ustar peterpeter/* * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: types.h,v 1.46.84.2 2009/01/29 23:47:44 tbox Exp $ */ #ifndef ISC_TYPES_H #define ISC_TYPES_H 1 /*! \file isc/types.h * \brief * OS-specific types, from the OS-specific include directories. */ #include #include /* * XXXDCL should isc_boolean_t be moved here, requiring an explicit include * of when ISC_TRUE/ISC_FALSE/ISC_TF() are desired? */ #include /* * XXXDCL This is just for ISC_LIST and ISC_LINK, but gets all of the other * list macros too. */ #include /* Core Types. Alphabetized by defined type. */ typedef struct isc_bitstring isc_bitstring_t; /*%< Bitstring */ typedef struct isc_buffer isc_buffer_t; /*%< Buffer */ typedef ISC_LIST(isc_buffer_t) isc_bufferlist_t; /*%< Buffer List */ typedef struct isc_constregion isc_constregion_t; /*%< Const region */ typedef struct isc_consttextregion isc_consttextregion_t; /*%< Const Text Region */ typedef struct isc_entropy isc_entropy_t; /*%< Entropy */ typedef struct isc_entropysource isc_entropysource_t; /*%< Entropy Source */ typedef struct isc_event isc_event_t; /*%< Event */ typedef ISC_LIST(isc_event_t) isc_eventlist_t; /*%< Event List */ typedef unsigned int isc_eventtype_t; /*%< Event Type */ typedef isc_uint32_t isc_fsaccess_t; /*%< FS Access */ typedef struct isc_hash isc_hash_t; /*%< Hash */ typedef struct isc_httpd isc_httpd_t; /*%< HTTP client */ typedef void (isc_httpdfree_t)(isc_buffer_t *, void *); /*%< HTTP free function */ typedef struct isc_httpdmgr isc_httpdmgr_t; /*%< HTTP manager */ typedef struct isc_httpdurl isc_httpdurl_t; /*%< HTTP URL */ typedef void (isc_httpdondestroy_t)(void *); /*%< Callback on destroying httpd */ typedef struct isc_interface isc_interface_t; /*%< Interface */ typedef struct isc_interfaceiter isc_interfaceiter_t; /*%< Interface Iterator */ typedef struct isc_interval isc_interval_t; /*%< Interval */ typedef struct isc_lex isc_lex_t; /*%< Lex */ typedef struct isc_log isc_log_t; /*%< Log */ typedef struct isc_logcategory isc_logcategory_t; /*%< Log Category */ typedef struct isc_logconfig isc_logconfig_t; /*%< Log Configuration */ typedef struct isc_logmodule isc_logmodule_t; /*%< Log Module */ typedef struct isc_mem isc_mem_t; /*%< Memory */ typedef struct isc_mempool isc_mempool_t; /*%< Memory Pool */ typedef struct isc_msgcat isc_msgcat_t; /*%< Message Catalog */ typedef struct isc_ondestroy isc_ondestroy_t; /*%< On Destroy */ typedef struct isc_netaddr isc_netaddr_t; /*%< Net Address */ typedef struct isc_portset isc_portset_t; /*%< Port Set */ typedef struct isc_quota isc_quota_t; /*%< Quota */ typedef struct isc_random isc_random_t; /*%< Random */ typedef struct isc_ratelimiter isc_ratelimiter_t; /*%< Rate Limiter */ typedef struct isc_region isc_region_t; /*%< Region */ typedef isc_uint64_t isc_resourcevalue_t; /*%< Resource Value */ typedef unsigned int isc_result_t; /*%< Result */ typedef struct isc_rwlock isc_rwlock_t; /*%< Read Write Lock */ typedef struct isc_sockaddr isc_sockaddr_t; /*%< Socket Address */ typedef struct isc_socket isc_socket_t; /*%< Socket */ typedef struct isc_socketevent isc_socketevent_t; /*%< Socket Event */ typedef struct isc_socketmgr isc_socketmgr_t; /*%< Socket Manager */ typedef struct isc_stats isc_stats_t; /*%< Statistics */ typedef int isc_statscounter_t; /*%< Statistics Counter */ typedef struct isc_symtab isc_symtab_t; /*%< Symbol Table */ typedef struct isc_task isc_task_t; /*%< Task */ typedef ISC_LIST(isc_task_t) isc_tasklist_t; /*%< Task List */ typedef struct isc_taskmgr isc_taskmgr_t; /*%< Task Manager */ typedef struct isc_textregion isc_textregion_t; /*%< Text Region */ typedef struct isc_time isc_time_t; /*%< Time */ typedef struct isc_timer isc_timer_t; /*%< Timer */ typedef struct isc_timermgr isc_timermgr_t; /*%< Timer Manager */ typedef void (*isc_taskaction_t)(isc_task_t *, isc_event_t *); typedef int (*isc_sockfdwatch_t)(isc_task_t *, isc_socket_t *, void *); /* The following cannot be listed alphabetically due to forward reference */ typedef isc_result_t (isc_httpdaction_t)(const char *url, const char *querystring, void *arg, unsigned int *retcode, const char **retmsg, const char **mimetype, isc_buffer_t *body, isc_httpdfree_t **freecb, void **freecb_args); typedef isc_boolean_t (isc_httpdclientok_t)(const isc_sockaddr_t *, void *); /*% Resource */ typedef enum { isc_resource_coresize = 1, isc_resource_cputime, isc_resource_datasize, isc_resource_filesize, isc_resource_lockedmemory, isc_resource_openfiles, isc_resource_processes, isc_resource_residentsize, isc_resource_stacksize } isc_resource_t; #endif /* ISC_TYPES_H */ ntp-4.2.6p5/lib/isc/include/isc/parseint.h0000644000175000017500000000401211307651604017334 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001, 2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: parseint.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_PARSEINT_H #define ISC_PARSEINT_H 1 #include #include /*! \file isc/parseint.h * \brief Parse integers, in a saner way than atoi() or strtoul() do. */ /*** *** Functions ***/ ISC_LANG_BEGINDECLS isc_result_t isc_parse_uint32(isc_uint32_t *uip, const char *string, int base); isc_result_t isc_parse_uint16(isc_uint16_t *uip, const char *string, int base); isc_result_t isc_parse_uint8(isc_uint8_t *uip, const char *string, int base); /*%< * Parse the null-terminated string 'string' containing a base 'base' * integer, storing the result in '*uip'. * The base is interpreted * as in strtoul(). Unlike strtoul(), leading whitespace, minus or * plus signs are not accepted, and all errors (including overflow) * are reported uniformly through the return value. * * Requires: *\li 'string' points to a null-terminated string *\li 0 <= 'base' <= 36 * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_BADNUMBER The string is not numeric (in the given base) *\li #ISC_R_RANGE The number is not representable as the requested type. */ ISC_LANG_ENDDECLS #endif /* ISC_PARSEINT_H */ ntp-4.2.6p5/lib/isc/include/isc/base32.h0000644000175000017500000000747311307651604016604 0ustar peterpeter/* * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: base32.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */ #ifndef ISC_BASE32_H #define ISC_BASE32_H 1 /*! \file */ /* * Routines for manipulating base 32 and base 32 hex encoded data. * Based on RFC 4648. * * Base 32 hex preserves the sort order of data when it is encoded / * decoded. */ #include #include ISC_LANG_BEGINDECLS /*** *** Functions ***/ isc_result_t isc_base32_totext(isc_region_t *source, int wordlength, const char *wordbreak, isc_buffer_t *target); isc_result_t isc_base32hex_totext(isc_region_t *source, int wordlength, const char *wordbreak, isc_buffer_t *target); /*!< * \brief Convert data into base32 encoded text. * * Notes: *\li The base32 encoded text in 'target' will be divided into * words of at most 'wordlength' characters, separated by * the 'wordbreak' string. No parentheses will surround * the text. * * Requires: *\li 'source' is a region containing binary data *\li 'target' is a text buffer containing available space *\li 'wordbreak' points to a null-terminated string of * zero or more whitespace characters * * Ensures: *\li target will contain the base32 encoded version of the data * in source. The 'used' pointer in target will be advanced as * necessary. */ isc_result_t isc_base32_decodestring(const char *cstr, isc_buffer_t *target); isc_result_t isc_base32hex_decodestring(const char *cstr, isc_buffer_t *target); /*!< * \brief Decode a null-terminated base32 string. * * Requires: *\li 'cstr' is non-null. *\li 'target' is a valid buffer. * * Returns: *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring' * fit in 'target'. *\li #ISC_R_BADBASE32 -- 'cstr' is not a valid base32 encoding. * * Other error returns are any possible error code from: *\li isc_lex_create(), *\li isc_lex_openbuffer(), *\li isc_base32_tobuffer(). */ isc_result_t isc_base32_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); isc_result_t isc_base32hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); /*!< * \brief Convert base32 encoded text from a lexer context into data. * * Requires: *\li 'lex' is a valid lexer context *\li 'target' is a buffer containing binary data *\li 'length' is an integer * * Ensures: *\li target will contain the data represented by the base32 encoded * string parsed by the lexer. No more than length bytes will be read, * if length is positive. The 'used' pointer in target will be * advanced as necessary. */ isc_result_t isc_base32_decoderegion(isc_region_t *source, isc_buffer_t *target); isc_result_t isc_base32hex_decoderegion(isc_region_t *source, isc_buffer_t *target); /*!< * \brief Decode a packed (no white space permitted) base32 region. * * Requires: *\li 'source' is a valid region. *\li 'target' is a valid buffer. * * Returns: *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring' * fit in 'target'. *\li #ISC_R_BADBASE32 -- 'source' is not a valid base32 encoding. */ ISC_LANG_ENDDECLS #endif /* ISC_BASE32_H */ ntp-4.2.6p5/lib/isc/include/isc/sha2.h0000644000175000017500000001260711307651603016354 0ustar peterpeter/* * Copyright (C) 2005-2007 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: sha2.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */ /* $FreeBSD: src/sys/crypto/sha2/sha2.h,v 1.1.2.1 2001/07/03 11:01:36 ume Exp $ */ /* $KAME: sha2.h,v 1.3 2001/03/12 08:27:48 itojun Exp $ */ /* * sha2.h * * Version 1.0.0beta1 * * Written by Aaron D. Gifford * * Copyright 2000 Aaron D. Gifford. 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. * 3. Neither the name of the copyright holder nor the names of contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTOR(S) ``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(S) OR CONTRIBUTOR(S) 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 ISC_SHA2_H #define ISC_SHA2_H #include #include /*** SHA-224/256/384/512 Various Length Definitions ***********************/ #define ISC_SHA224_BLOCK_LENGTH 64U #define ISC_SHA224_DIGESTLENGTH 28U #define ISC_SHA224_DIGESTSTRINGLENGTH (ISC_SHA224_DIGESTLENGTH * 2 + 1) #define ISC_SHA256_BLOCK_LENGTH 64U #define ISC_SHA256_DIGESTLENGTH 32U #define ISC_SHA256_DIGESTSTRINGLENGTH (ISC_SHA256_DIGESTLENGTH * 2 + 1) #define ISC_SHA384_BLOCK_LENGTH 128 #define ISC_SHA384_DIGESTLENGTH 48U #define ISC_SHA384_DIGESTSTRINGLENGTH (ISC_SHA384_DIGESTLENGTH * 2 + 1) #define ISC_SHA512_BLOCK_LENGTH 128U #define ISC_SHA512_DIGESTLENGTH 64U #define ISC_SHA512_DIGESTSTRINGLENGTH (ISC_SHA512_DIGESTLENGTH * 2 + 1) ISC_LANG_BEGINDECLS /*** SHA-256/384/512 Context Structures *******************************/ /* * Keep buffer immediately after bitcount to preserve alignment. */ typedef struct { isc_uint32_t state[8]; isc_uint64_t bitcount; isc_uint8_t buffer[ISC_SHA256_BLOCK_LENGTH]; } isc_sha256_t; /* * Keep buffer immediately after bitcount to preserve alignment. */ typedef struct { isc_uint64_t state[8]; isc_uint64_t bitcount[2]; isc_uint8_t buffer[ISC_SHA512_BLOCK_LENGTH]; } isc_sha512_t; typedef isc_sha256_t isc_sha224_t; typedef isc_sha512_t isc_sha384_t; /*** SHA-224/256/384/512 Function Prototypes ******************************/ void isc_sha224_init (isc_sha224_t *); void isc_sha224_update (isc_sha224_t *, const isc_uint8_t *, size_t); void isc_sha224_final (isc_uint8_t[ISC_SHA224_DIGESTLENGTH], isc_sha224_t *); char *isc_sha224_end (isc_sha224_t *, char[ISC_SHA224_DIGESTSTRINGLENGTH]); char *isc_sha224_data (const isc_uint8_t *, size_t, char[ISC_SHA224_DIGESTSTRINGLENGTH]); void isc_sha256_init (isc_sha256_t *); void isc_sha256_update (isc_sha256_t *, const isc_uint8_t *, size_t); void isc_sha256_final (isc_uint8_t[ISC_SHA256_DIGESTLENGTH], isc_sha256_t *); char *isc_sha256_end (isc_sha256_t *, char[ISC_SHA256_DIGESTSTRINGLENGTH]); char *isc_sha256_data (const isc_uint8_t *, size_t, char[ISC_SHA256_DIGESTSTRINGLENGTH]); void isc_sha384_init (isc_sha384_t *); void isc_sha384_update (isc_sha384_t *, const isc_uint8_t *, size_t); void isc_sha384_final (isc_uint8_t[ISC_SHA384_DIGESTLENGTH], isc_sha384_t *); char *isc_sha384_end (isc_sha384_t *, char[ISC_SHA384_DIGESTSTRINGLENGTH]); char *isc_sha384_data (const isc_uint8_t *, size_t, char[ISC_SHA384_DIGESTSTRINGLENGTH]); void isc_sha512_init (isc_sha512_t *); void isc_sha512_update (isc_sha512_t *, const isc_uint8_t *, size_t); void isc_sha512_final (isc_uint8_t[ISC_SHA512_DIGESTLENGTH], isc_sha512_t *); char *isc_sha512_end (isc_sha512_t *, char[ISC_SHA512_DIGESTSTRINGLENGTH]); char *isc_sha512_data (const isc_uint8_t *, size_t, char[ISC_SHA512_DIGESTSTRINGLENGTH]); ISC_LANG_ENDDECLS #endif /* ISC_SHA2_H */ ntp-4.2.6p5/lib/isc/include/isc/fsaccess.h0000644000175000017500000001743011307651605017312 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: fsaccess.h,v 1.14.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_FSACCESS_H #define ISC_FSACCESS_H 1 /*! \file isc/fsaccess.h * \brief The ISC filesystem access module encapsulates the setting of file * and directory access permissions into one API that is meant to be * portable to multiple operating systems. * * The two primary operating system flavors that are initially accommodated * are POSIX and Windows NT 4.0 and later. The Windows NT access model is * considerable more flexible than POSIX's model (as much as I am loathe to * admit it), and so the ISC API has a higher degree of complexity than would * be needed to simply address POSIX's needs. * * The full breadth of NT's flexibility is not available either, for the * present time. Much of it is to provide compatibility with what Unix * programmers are expecting. This is also due to not yet really needing all * of the functionality of an NT system (or, for that matter, a POSIX system) * in BIND9, and so resolving how to handle the various incompatibilities has * been a purely theoretical exercise with no operational experience to * indicate how flawed the thinking may be. * * Some of the more notable dumbing down of NT for this API includes: * *\li Each of FILE_READ_DATA and FILE_READ_EA are set with #ISC_FSACCESS_READ. * * \li All of FILE_WRITE_DATA, FILE_WRITE_EA and FILE_APPEND_DATA are * set with #ISC_FSACCESS_WRITE. FILE_WRITE_ATTRIBUTES is not set * so as to be consistent with Unix, where only the owner of the file * or the superuser can change the attributes/mode of a file. * * \li Both of FILE_ADD_FILE and FILE_ADD_SUBDIRECTORY are set with * #ISC_FSACCESS_CREATECHILD. This is similar to setting the WRITE * permission on a Unix directory. * * \li SYNCHRONIZE is always set for files and directories, unless someone * can give me a reason why this is a bad idea. * * \li READ_CONTROL and FILE_READ_ATTRIBUTES are always set; this is * consistent with Unix, where any file or directory can be stat()'d * unless the directory path disallows complete access somewhere along * the way. * * \li WRITE_DAC is only set for the owner. This too is consistent with * Unix, and is tighter security than allowing anyone else to be * able to set permissions. * * \li DELETE is only set for the owner. On Unix the ability to delete * a file is controlled by the directory permissions, but it isn't * currently clear to me what happens on NT if the directory has * FILE_DELETE_CHILD set but a file within it does not have DELETE * set. Always setting DELETE on the file/directory for the owner * gives maximum flexibility to the owner without exposing the * file to deletion by others. * * \li WRITE_OWNER is never set. This too is consistent with Unix, * and is also tighter security than allowing anyone to change the * ownership of the file apart from the superu..ahem, Administrator. * * \li Inheritance is set to NO_INHERITANCE. * * Unix's dumbing down includes: * * \li The sticky bit cannot be set. * * \li setuid and setgid cannot be set. * * \li Only regular files and directories can be set. * * The rest of this comment discusses a few of the incompatibilities * between the two systems that need more thought if this API is to * be extended to accommodate them. * * The Windows standard access right "DELETE" doesn't have a direct * equivalent in the Unix world, so it isn't clear what should be done * with it. * * The Unix sticky bit is not supported. While NT does have a concept * of allowing users to create files in a directory but not delete or * rename them, it does not have a concept of allowing them to be deleted * if they are owned by the user trying to delete/rename. While it is * probable that something could be cobbled together in NT 5 with inheritance, * it can't really be done in NT 4 as a single property that you could * set on a directory. You'd need to coordinate something with file creation * so that every file created had DELETE set for the owner but noone else. * * On Unix systems, setting #ISC_FSACCESS_LISTDIRECTORY sets READ. * ... setting either #ISC_FSACCESS_CREATECHILD or #ISC_FSACCESS_DELETECHILD * sets WRITE. * ... setting #ISC_FSACCESS_ACCESSCHILD sets EXECUTE. * * On NT systems, setting #ISC_FSACCESS_LISTDIRECTORY sets FILE_LIST_DIRECTORY. * ... setting #ISC_FSACCESS_CREATECHILD sets FILE_CREATE_CHILD independently. * ... setting #ISC_FSACCESS_DELETECHILD sets FILE_DELETE_CHILD independently. * ... setting #ISC_FSACCESS_ACCESSCHILD sets FILE_TRAVERSE. * * Unresolved: XXXDCL * \li What NT access right controls the ability to rename a file? * \li How does DELETE work? If a directory has FILE_DELETE_CHILD but a * file or directory within it does not have DELETE, is that file * or directory deletable? * \li To implement isc_fsaccess_get(), mapping an existing Unix permission * mode_t back to an isc_fsaccess_t is pretty trivial; however, mapping * an NT DACL could be impossible to do in a responsible way. * \li Similarly, trying to implement the functionality of being able to * say "add group writability to whatever permissions already exist" * could be tricky on NT because of the order-of-entry issue combined * with possibly having one or more matching ACEs already explicitly * granting or denying access. Because this functionality is * not yet needed by the ISC, no code has been written to try to * solve this problem. */ #include #include /* * Trustees. */ #define ISC_FSACCESS_OWNER 0x1 /*%< User account. */ #define ISC_FSACCESS_GROUP 0x2 /*%< Primary group owner. */ #define ISC_FSACCESS_OTHER 0x4 /*%< Not the owner or the group owner. */ #define ISC_FSACCESS_WORLD 0x7 /*%< User, Group, Other. */ /* * Types of permission. */ #define ISC_FSACCESS_READ 0x00000001 /*%< File only. */ #define ISC_FSACCESS_WRITE 0x00000002 /*%< File only. */ #define ISC_FSACCESS_EXECUTE 0x00000004 /*%< File only. */ #define ISC_FSACCESS_CREATECHILD 0x00000008 /*%< Dir only. */ #define ISC_FSACCESS_DELETECHILD 0x00000010 /*%< Dir only. */ #define ISC_FSACCESS_LISTDIRECTORY 0x00000020 /*%< Dir only. */ #define ISC_FSACCESS_ACCESSCHILD 0x00000040 /*%< Dir only. */ /*% * Adding any permission bits beyond 0x200 would mean typedef'ing * isc_fsaccess_t as isc_uint64_t, and redefining this value to * reflect the new range of permission types, Probably to 21 for * maximum flexibility. The number of bits has to accommodate all of * the permission types, and three full sets of them have to fit * within an isc_fsaccess_t. */ #define ISC__FSACCESS_PERMISSIONBITS 10 ISC_LANG_BEGINDECLS void isc_fsaccess_add(int trustee, int permission, isc_fsaccess_t *access); void isc_fsaccess_remove(int trustee, int permission, isc_fsaccess_t *access); isc_result_t isc_fsaccess_set(const char *path, isc_fsaccess_t access); ISC_LANG_ENDDECLS #endif /* ISC_FSACCESS_H */ ntp-4.2.6p5/lib/isc/include/isc/netaddr.h0000644000175000017500000001147311307651604017141 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: netaddr.h,v 1.35.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_NETADDR_H #define ISC_NETADDR_H 1 /*! \file isc/netaddr.h */ #include #include #include #ifdef ISC_PLATFORM_HAVESYSUNH #include #include #endif ISC_LANG_BEGINDECLS struct isc_netaddr { unsigned int family; union { struct in_addr in; struct in6_addr in6; #ifdef ISC_PLATFORM_HAVESYSUNH char un[sizeof(((struct sockaddr_un *)0)->sun_path)]; #endif } type; isc_uint32_t zone; }; isc_boolean_t isc_netaddr_equal(const isc_netaddr_t *a, const isc_netaddr_t *b); /*%< * Compare network addresses 'a' and 'b'. Return #ISC_TRUE if * they are equal, #ISC_FALSE if not. */ isc_boolean_t isc_netaddr_eqprefix(const isc_netaddr_t *a, const isc_netaddr_t *b, unsigned int prefixlen); /*%< * Compare the 'prefixlen' most significant bits of the network * addresses 'a' and 'b'. If 'b''s scope is zero then 'a''s scope is * ignored. Return #ISC_TRUE if they are equal, #ISC_FALSE if not. */ isc_result_t isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp); /*%< * Convert a netmask in 's' into a prefix length in '*lenp'. * The mask should consist of zero or more '1' bits in the most * most significant part of the address, followed by '0' bits. * If this is not the case, #ISC_R_MASKNONCONTIG is returned. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_MASKNONCONTIG */ isc_result_t isc_netaddr_totext(const isc_netaddr_t *netaddr, isc_buffer_t *target); /*%< * Append a text representation of 'sockaddr' to the buffer 'target'. * The text is NOT null terminated. Handles IPv4 and IPv6 addresses. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOSPACE The text or the null termination did not fit. *\li #ISC_R_FAILURE Unspecified failure */ void isc_netaddr_format(const isc_netaddr_t *na, char *array, unsigned int size); /*%< * Format a human-readable representation of the network address '*na' * into the character array 'array', which is of size 'size'. * The resulting string is guaranteed to be null-terminated. */ #define ISC_NETADDR_FORMATSIZE \ sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX%SSSSSSSSSS") /*%< * Minimum size of array to pass to isc_netaddr_format(). */ void isc_netaddr_fromsockaddr(isc_netaddr_t *netaddr, const isc_sockaddr_t *source); void isc_netaddr_fromin(isc_netaddr_t *netaddr, const struct in_addr *ina); void isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6); isc_result_t isc_netaddr_frompath(isc_netaddr_t *netaddr, const char *path); void isc_netaddr_setzone(isc_netaddr_t *netaddr, isc_uint32_t zone); isc_uint32_t isc_netaddr_getzone(const isc_netaddr_t *netaddr); void isc_netaddr_any(isc_netaddr_t *netaddr); /*%< * Return the IPv4 wildcard address. */ void isc_netaddr_any6(isc_netaddr_t *netaddr); /*%< * Return the IPv6 wildcard address. */ isc_boolean_t isc_netaddr_ismulticast(isc_netaddr_t *na); /*%< * Returns ISC_TRUE if the address is a multicast address. */ isc_boolean_t isc_netaddr_isexperimental(isc_netaddr_t *na); /*%< * Returns ISC_TRUE if the address is a experimental (CLASS E) address. */ isc_boolean_t isc_netaddr_islinklocal(isc_netaddr_t *na); /*%< * Returns #ISC_TRUE if the address is a link local address. */ isc_boolean_t isc_netaddr_issitelocal(isc_netaddr_t *na); /*%< * Returns #ISC_TRUE if the address is a site local address. */ void isc_netaddr_fromv4mapped(isc_netaddr_t *t, const isc_netaddr_t *s); /*%< * Convert an IPv6 v4mapped address into an IPv4 address. */ isc_result_t isc_netaddr_prefixok(const isc_netaddr_t *na, unsigned int prefixlen); /* * Test whether the netaddr 'na' and 'prefixlen' are consistant. * e.g. prefixlen within range. * na does not have bits set which are not covered by the prefixlen. * * Returns: * ISC_R_SUCCESS * ISC_R_RANGE prefixlen out of range * ISC_R_NOTIMPLEMENTED unsupported family * ISC_R_FAILURE extra bits. */ ISC_LANG_ENDDECLS #endif /* ISC_NETADDR_H */ ntp-4.2.6p5/lib/isc/include/isc/print.h0000644000175000017500000000462111307651605016652 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: print.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_PRINT_H #define ISC_PRINT_H 1 /*! \file isc/print.h */ /*** *** Imports ***/ #include /* Required for ISC_FORMAT_PRINTF() macro. */ #include #include /*! * This block allows lib/isc/print.c to be cleanly compiled even if * the platform does not need it. The standard Makefile will still * not compile print.c or archive print.o, so this is just to make test * compilation ("make print.o") easier. */ #if !defined(ISC_PLATFORM_NEEDVSNPRINTF) && defined(ISC__PRINT_SOURCE) #define ISC_PLATFORM_NEEDVSNPRINTF #endif #if !defined(ISC_PLATFORM_NEEDSPRINTF) && defined(ISC__PRINT_SOURCE) #define ISC_PLATFORM_NEEDSPRINTF #endif /*** *** Macros ***/ #define ISC_PRINT_QUADFORMAT ISC_PLATFORM_QUADFORMAT /*** *** Functions ***/ #ifdef ISC_PLATFORM_NEEDVSNPRINTF #include #include #endif #ifdef ISC_PLATFORM_NEEDSPRINTF #include #endif ISC_LANG_BEGINDECLS #ifdef ISC_PLATFORM_NEEDVSNPRINTF int isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) ISC_FORMAT_PRINTF(3, 0); #define vsnprintf isc_print_vsnprintf int isc_print_snprintf(char *str, size_t size, const char *format, ...) ISC_FORMAT_PRINTF(3, 4); #define snprintf isc_print_snprintf #endif /* ISC_PLATFORM_NEEDVSNPRINTF */ #ifdef ISC_PLATFORM_NEEDSPRINTF int isc_print_sprintf(char *str, const char *format, ...) ISC_FORMAT_PRINTF(2, 3); #define sprintf isc_print_sprintf #endif ISC_LANG_ENDDECLS #endif /* ISC_PRINT_H */ ntp-4.2.6p5/lib/isc/include/isc/quota.h0000644000175000017500000000520311307651604016643 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: quota.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_QUOTA_H #define ISC_QUOTA_H 1 /***** ***** Module Info *****/ /*! \file isc/quota.h * * \brief The isc_quota_t object is a simple helper object for implementing * quotas on things like the number of simultaneous connections to * a server. It keeps track of the amount of quota in use, and * encapsulates the locking necessary to allow multiple tasks to * share a quota. */ /*** *** Imports. ***/ #include #include #include /***** ***** Types. *****/ ISC_LANG_BEGINDECLS /*% isc_quota structure */ struct isc_quota { isc_mutex_t lock; /*%< Locked by lock. */ int max; int used; int soft; }; isc_result_t isc_quota_init(isc_quota_t *quota, int max); /*%< * Initialize a quota object. * * Returns: * ISC_R_SUCCESS * Other error Lock creation failed. */ void isc_quota_destroy(isc_quota_t *quota); /*%< * Destroy a quota object. */ void isc_quota_soft(isc_quota_t *quota, int soft); /*%< * Set a soft quota. */ void isc_quota_max(isc_quota_t *quota, int max); /*%< * Re-set a maximum quota. */ isc_result_t isc_quota_reserve(isc_quota_t *quota); /*%< * Attempt to reserve one unit of 'quota'. * * Returns: * \li #ISC_R_SUCCESS Success * \li #ISC_R_SOFTQUOTA Success soft quota reached * \li #ISC_R_QUOTA Quota is full */ void isc_quota_release(isc_quota_t *quota); /*%< * Release one unit of quota. */ isc_result_t isc_quota_attach(isc_quota_t *quota, isc_quota_t **p); /*%< * Like isc_quota_reserve, and also attaches '*p' to the * quota if successful (ISC_R_SUCCESS or ISC_R_SOFTQUOTA). */ void isc_quota_detach(isc_quota_t **p); /*%< * Like isc_quota_release, and also detaches '*p' from the * quota. */ ISC_LANG_ENDDECLS #endif /* ISC_QUOTA_H */ ntp-4.2.6p5/lib/isc/include/isc/util.h0000644000175000017500000001716711307651603016502 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: util.h,v 1.30 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_UTIL_H #define ISC_UTIL_H 1 /*! \file isc/util.h * NOTE: * * This file is not to be included from any (or other) library * files. * * \brief * Including this file puts several macros in your name space that are * not protected (as all the other ISC functions/macros do) by prepending * ISC_ or isc_ to the name. */ /*** *** General Macros. ***/ /*% * Use this to hide unused function arguments. * \code * int * foo(char *bar) * { * UNUSED(bar); * } * \endcode */ #define UNUSED(x) (void)(x) #define ISC_MAX(a, b) ((a) > (b) ? (a) : (b)) #define ISC_MIN(a, b) ((a) < (b) ? (a) : (b)) /*% * Use this to remove the const qualifier of a variable to assign it to * a non-const variable or pass it as a non-const function argument ... * but only when you are sure it won't then be changed! * This is necessary to sometimes shut up some compilers * (as with gcc -Wcast-qual) when there is just no other good way to avoid the * situation. */ #define DE_CONST(konst, var) \ do { \ union { const void *k; void *v; } _u; \ _u.k = konst; \ var = _u.v; \ } while (0) /*% * Use this in translation units that would otherwise be empty, to * suppress compiler warnings. */ #define EMPTY_TRANSLATION_UNIT static void isc__empty(void) { isc__empty(); } /*% * We use macros instead of calling the routines directly because * the capital letters make the locking stand out. * We RUNTIME_CHECK for success since in general there's no way * for us to continue if they fail. */ #ifdef ISC_UTIL_TRACEON #define ISC_UTIL_TRACE(a) a #include /* Required for fprintf/stderr when tracing. */ #include /* Required for isc_msgcat when tracing. */ #else #define ISC_UTIL_TRACE(a) #endif #include /* Contractual promise. */ #define LOCK(lp) do { \ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \ ISC_MSG_LOCKING, "LOCKING"), \ (lp), __FILE__, __LINE__)); \ RUNTIME_CHECK(isc_mutex_lock((lp)) == ISC_R_SUCCESS); \ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \ ISC_MSG_LOCKED, "LOCKED"), \ (lp), __FILE__, __LINE__)); \ } while (0) #define UNLOCK(lp) do { \ RUNTIME_CHECK(isc_mutex_unlock((lp)) == ISC_R_SUCCESS); \ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \ ISC_MSG_UNLOCKED, "UNLOCKED"), \ (lp), __FILE__, __LINE__)); \ } while (0) #define ISLOCKED(lp) (1) #define DESTROYLOCK(lp) \ RUNTIME_CHECK(isc_mutex_destroy((lp)) == ISC_R_SUCCESS) #define BROADCAST(cvp) do { \ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \ ISC_MSG_BROADCAST, "BROADCAST"),\ (cvp), __FILE__, __LINE__)); \ RUNTIME_CHECK(isc_condition_broadcast((cvp)) == ISC_R_SUCCESS); \ } while (0) #define SIGNAL(cvp) do { \ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \ ISC_MSG_SIGNAL, "SIGNAL"), \ (cvp), __FILE__, __LINE__)); \ RUNTIME_CHECK(isc_condition_signal((cvp)) == ISC_R_SUCCESS); \ } while (0) #define WAIT(cvp, lp) do { \ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %p %s %d\n", \ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \ ISC_MSG_UTILWAIT, "WAIT"), \ (cvp), \ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \ ISC_MSG_LOCK, "LOCK"), \ (lp), __FILE__, __LINE__)); \ RUNTIME_CHECK(isc_condition_wait((cvp), (lp)) == ISC_R_SUCCESS); \ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %p %s %d\n", \ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \ ISC_MSG_WAITED, "WAITED"), \ (cvp), \ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \ ISC_MSG_LOCKED, "LOCKED"), \ (lp), __FILE__, __LINE__)); \ } while (0) /* * isc_condition_waituntil can return ISC_R_TIMEDOUT, so we * don't RUNTIME_CHECK the result. * * XXX Also, can't really debug this then... */ #define WAITUNTIL(cvp, lp, tp) \ isc_condition_waituntil((cvp), (lp), (tp)) #define RWLOCK(lp, t) do { \ ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \ ISC_MSG_RWLOCK, "RWLOCK"), \ (lp), (t), __FILE__, __LINE__)); \ RUNTIME_CHECK(isc_rwlock_lock((lp), (t)) == ISC_R_SUCCESS); \ ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \ ISC_MSG_RWLOCKED, "RWLOCKED"), \ (lp), (t), __FILE__, __LINE__)); \ } while (0) #define RWUNLOCK(lp, t) do { \ ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \ ISC_MSG_RWUNLOCK, "RWUNLOCK"), \ (lp), (t), __FILE__, __LINE__)); \ RUNTIME_CHECK(isc_rwlock_unlock((lp), (t)) == ISC_R_SUCCESS); \ } while (0) #define DESTROYMUTEXBLOCK(bp, n) \ RUNTIME_CHECK(isc_mutexblock_destroy((bp), (n)) == ISC_R_SUCCESS) /* * List Macros. */ #include /* Contractual promise. */ #define LIST(type) ISC_LIST(type) #define INIT_LIST(type) ISC_LIST_INIT(type) #define LINK(type) ISC_LINK(type) #define INIT_LINK(elt, link) ISC_LINK_INIT(elt, link) #define HEAD(list) ISC_LIST_HEAD(list) #define TAIL(list) ISC_LIST_TAIL(list) #define EMPTY(list) ISC_LIST_EMPTY(list) #define PREV(elt, link) ISC_LIST_PREV(elt, link) #define NEXT(elt, link) ISC_LIST_NEXT(elt, link) #define APPEND(list, elt, link) ISC_LIST_APPEND(list, elt, link) #define PREPEND(list, elt, link) ISC_LIST_PREPEND(list, elt, link) #define UNLINK(list, elt, link) ISC_LIST_UNLINK(list, elt, link) #define ENQUEUE(list, elt, link) ISC_LIST_APPEND(list, elt, link) #define DEQUEUE(list, elt, link) ISC_LIST_UNLINK(list, elt, link) #define INSERTBEFORE(li, b, e, ln) ISC_LIST_INSERTBEFORE(li, b, e, ln) #define INSERTAFTER(li, a, e, ln) ISC_LIST_INSERTAFTER(li, a, e, ln) #define APPENDLIST(list1, list2, link) ISC_LIST_APPENDLIST(list1, list2, link) /* * Assertions */ #include /* Contractual promise. */ /*% Require Assertion */ #define REQUIRE(e) ISC_REQUIRE(e) /*% Ensure Assertion */ #define ENSURE(e) ISC_ENSURE(e) /*% Insist Assertion */ #define INSIST(e) ISC_INSIST(e) /*% Invariant Assertion */ #define INVARIANT(e) ISC_INVARIANT(e) /* * Errors */ #include /* Contractual promise. */ /*% Unexpected Error */ #define UNEXPECTED_ERROR isc_error_unexpected /*% Fatal Error */ #define FATAL_ERROR isc_error_fatal /*% Runtime Check */ #define RUNTIME_CHECK(cond) ISC_ERROR_RUNTIMECHECK(cond) /*% * Time */ #define TIME_NOW(tp) RUNTIME_CHECK(isc_time_now((tp)) == ISC_R_SUCCESS) #endif /* ISC_UTIL_H */ ntp-4.2.6p5/lib/isc/include/isc/event.h0000644000175000017500000000644011307651604016637 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: event.h,v 1.34 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_EVENT_H #define ISC_EVENT_H 1 /*! \file isc/event.h */ #include #include /***** ***** Events. *****/ typedef void (*isc_eventdestructor_t)(isc_event_t *); #define ISC_EVENT_COMMON(ltype) \ size_t ev_size; \ unsigned int ev_attributes; \ void * ev_tag; \ isc_eventtype_t ev_type; \ isc_taskaction_t ev_action; \ void * ev_arg; \ void * ev_sender; \ isc_eventdestructor_t ev_destroy; \ void * ev_destroy_arg; \ ISC_LINK(ltype) ev_link /*% * Attributes matching a mask of 0x000000ff are reserved for the task library's * definition. Attributes of 0xffffff00 may be used by the application * or non-ISC libraries. */ #define ISC_EVENTATTR_NOPURGE 0x00000001 /*% * The ISC_EVENTATTR_CANCELED attribute is intended to indicate * that an event is delivered as a result of a canceled operation * rather than successful completion, by mutual agreement * between the sender and receiver. It is not set or used by * the task system. */ #define ISC_EVENTATTR_CANCELED 0x00000002 #define ISC_EVENT_INIT(event, sz, at, ta, ty, ac, ar, sn, df, da) \ do { \ (event)->ev_size = (sz); \ (event)->ev_attributes = (at); \ (event)->ev_tag = (ta); \ (event)->ev_type = (ty); \ (event)->ev_action = (ac); \ (event)->ev_arg = (ar); \ (event)->ev_sender = (sn); \ (event)->ev_destroy = (df); \ (event)->ev_destroy_arg = (da); \ ISC_LINK_INIT((event), ev_link); \ } while (0) /*% * This structure is public because "subclassing" it may be useful when * defining new event types. */ struct isc_event { ISC_EVENT_COMMON(struct isc_event); }; #define ISC_EVENTTYPE_FIRSTEVENT 0x00000000 #define ISC_EVENTTYPE_LASTEVENT 0xffffffff #define ISC_EVENT_PTR(p) ((isc_event_t **)(void *)(p)) ISC_LANG_BEGINDECLS isc_event_t * isc_event_allocate(isc_mem_t *mctx, void *sender, isc_eventtype_t type, isc_taskaction_t action, const void *arg, size_t size); /*%< * Allocate an event structure. * * Allocate and initialize in a structure with initial elements * defined by: * * \code * struct { * ISC_EVENT_COMMON(struct isc_event); * ... * }; * \endcode * * Requires: *\li 'size' >= sizeof(struct isc_event) *\li 'action' to be non NULL * * Returns: *\li a pointer to a initialized structure of the requested size. *\li NULL if unable to allocate memory. */ void isc_event_free(isc_event_t **); ISC_LANG_ENDDECLS #endif /* ISC_EVENT_H */ ntp-4.2.6p5/lib/isc/include/isc/md5.h0000644000175000017500000000446111307651614016205 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: md5.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */ /*! \file isc/md5.h * \brief This is the header file for the MD5 message-digest algorithm. * * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to MD5Init, call MD5Update as * needed on buffers full of bytes, and then call MD5Final, which * will fill a supplied 16-byte array with the digest. * * Changed so as no longer to depend on Colin Plumb's `usual.h' * header definitions; now uses stuff from dpkg's config.h * - Ian Jackson . * Still in the public domain. */ #ifndef ISC_MD5_H #define ISC_MD5_H 1 #include #include #define ISC_MD5_DIGESTLENGTH 16U typedef struct { isc_uint32_t buf[4]; isc_uint32_t bytes[2]; isc_uint32_t in[16]; } isc_md5_t; ISC_LANG_BEGINDECLS void isc_md5_init(isc_md5_t *ctx); void isc_md5_invalidate(isc_md5_t *ctx); void isc_md5_update(isc_md5_t *ctx, const unsigned char *buf, unsigned int len); void isc_md5_final(isc_md5_t *ctx, unsigned char *digest); ISC_LANG_ENDDECLS #endif /* ISC_MD5_H */ ntp-4.2.6p5/lib/isc/include/isc/lang.h0000644000175000017500000000220611307651603016432 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: lang.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_LANG_H #define ISC_LANG_H 1 /*! \file isc/lang.h */ #ifdef __cplusplus #define ISC_LANG_BEGINDECLS extern "C" { #define ISC_LANG_ENDDECLS } #else #define ISC_LANG_BEGINDECLS #define ISC_LANG_ENDDECLS #endif #endif /* ISC_LANG_H */ ntp-4.2.6p5/lib/isc/include/isc/list.h0000644000175000017500000001337711307651603016477 0ustar peterpeter/* * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1997-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: list.h,v 1.24 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_LIST_H #define ISC_LIST_H 1 #include #include #ifdef ISC_LIST_CHECKINIT #define ISC_LINK_INSIST(x) ISC_INSIST(x) #else #define ISC_LINK_INSIST(x) #endif #define ISC_LIST(type) struct { type *head, *tail; } #define ISC_LIST_INIT(list) \ do { (list).head = NULL; (list).tail = NULL; } while (0) #define ISC_LINK(type) struct { type *prev, *next; } #define ISC_LINK_INIT_TYPE(elt, link, type) \ do { \ (elt)->link.prev = (type *)(-1); \ (elt)->link.next = (type *)(-1); \ } while (0) #define ISC_LINK_INIT(elt, link) \ ISC_LINK_INIT_TYPE(elt, link, void) #define ISC_LINK_LINKED(elt, link) ((void *)((elt)->link.prev) != (void *)(-1)) #define ISC_LIST_HEAD(list) ((list).head) #define ISC_LIST_TAIL(list) ((list).tail) #define ISC_LIST_EMPTY(list) ISC_TF((list).head == NULL) #define __ISC_LIST_PREPENDUNSAFE(list, elt, link) \ do { \ if ((list).head != NULL) \ (list).head->link.prev = (elt); \ else \ (list).tail = (elt); \ (elt)->link.prev = NULL; \ (elt)->link.next = (list).head; \ (list).head = (elt); \ } while (0) #define ISC_LIST_PREPEND(list, elt, link) \ do { \ ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \ __ISC_LIST_PREPENDUNSAFE(list, elt, link); \ } while (0) #define ISC_LIST_INITANDPREPEND(list, elt, link) \ __ISC_LIST_PREPENDUNSAFE(list, elt, link) #define __ISC_LIST_APPENDUNSAFE(list, elt, link) \ do { \ if ((list).tail != NULL) \ (list).tail->link.next = (elt); \ else \ (list).head = (elt); \ (elt)->link.prev = (list).tail; \ (elt)->link.next = NULL; \ (list).tail = (elt); \ } while (0) #define ISC_LIST_APPEND(list, elt, link) \ do { \ ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \ __ISC_LIST_APPENDUNSAFE(list, elt, link); \ } while (0) #define ISC_LIST_INITANDAPPEND(list, elt, link) \ __ISC_LIST_APPENDUNSAFE(list, elt, link) #define __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, type) \ do { \ if ((elt)->link.next != NULL) \ (elt)->link.next->link.prev = (elt)->link.prev; \ else { \ ISC_INSIST((list).tail == (elt)); \ (list).tail = (elt)->link.prev; \ } \ if ((elt)->link.prev != NULL) \ (elt)->link.prev->link.next = (elt)->link.next; \ else { \ ISC_INSIST((list).head == (elt)); \ (list).head = (elt)->link.next; \ } \ (elt)->link.prev = (type *)(-1); \ (elt)->link.next = (type *)(-1); \ } while (0) #define __ISC_LIST_UNLINKUNSAFE(list, elt, link) \ __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, void) #define ISC_LIST_UNLINK_TYPE(list, elt, link, type) \ do { \ ISC_LINK_INSIST(ISC_LINK_LINKED(elt, link)); \ __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, type); \ } while (0) #define ISC_LIST_UNLINK(list, elt, link) \ ISC_LIST_UNLINK_TYPE(list, elt, link, void) #define ISC_LIST_PREV(elt, link) ((elt)->link.prev) #define ISC_LIST_NEXT(elt, link) ((elt)->link.next) #define __ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link) \ do { \ if ((before)->link.prev == NULL) \ ISC_LIST_PREPEND(list, elt, link); \ else { \ (elt)->link.prev = (before)->link.prev; \ (before)->link.prev = (elt); \ (elt)->link.prev->link.next = (elt); \ (elt)->link.next = (before); \ } \ } while (0) #define ISC_LIST_INSERTBEFORE(list, before, elt, link) \ do { \ ISC_LINK_INSIST(ISC_LINK_LINKED(before, link)); \ ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \ __ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link); \ } while (0) #define __ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link) \ do { \ if ((after)->link.next == NULL) \ ISC_LIST_APPEND(list, elt, link); \ else { \ (elt)->link.next = (after)->link.next; \ (after)->link.next = (elt); \ (elt)->link.next->link.prev = (elt); \ (elt)->link.prev = (after); \ } \ } while (0) #define ISC_LIST_INSERTAFTER(list, after, elt, link) \ do { \ ISC_LINK_INSIST(ISC_LINK_LINKED(after, link)); \ ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \ __ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link); \ } while (0) #define ISC_LIST_APPENDLIST(list1, list2, link) \ do { \ if (ISC_LIST_EMPTY(list1)) \ (list1) = (list2); \ else if (!ISC_LIST_EMPTY(list2)) { \ (list1).tail->link.next = (list2).head; \ (list2).head->link.prev = (list1).tail; \ (list1).tail = (list2).tail; \ } \ (list2).head = NULL; \ (list2).tail = NULL; \ } while (0) #define ISC_LIST_ENQUEUE(list, elt, link) ISC_LIST_APPEND(list, elt, link) #define __ISC_LIST_ENQUEUEUNSAFE(list, elt, link) \ __ISC_LIST_APPENDUNSAFE(list, elt, link) #define ISC_LIST_DEQUEUE(list, elt, link) \ ISC_LIST_UNLINK_TYPE(list, elt, link, void) #define ISC_LIST_DEQUEUE_TYPE(list, elt, link, type) \ ISC_LIST_UNLINK_TYPE(list, elt, link, type) #define __ISC_LIST_DEQUEUEUNSAFE(list, elt, link) \ __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, void) #define __ISC_LIST_DEQUEUEUNSAFE_TYPE(list, elt, link, type) \ __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, type) #endif /* ISC_LIST_H */ ntp-4.2.6p5/lib/isc/include/isc/buffer.h0000644000175000017500000005462711307651603017000 0ustar peterpeter/* * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: buffer.h,v 1.53 2008/09/25 04:02:39 tbox Exp $ */ #ifndef ISC_BUFFER_H #define ISC_BUFFER_H 1 /***** ***** Module Info *****/ /*! \file isc/buffer.h * * \brief A buffer is a region of memory, together with a set of related subregions. * Buffers are used for parsing and I/O operations. * * The 'used region' and the 'available' region are disjoint, and their * union is the buffer's region. The used region extends from the beginning * of the buffer region to the last used byte. The available region * extends from one byte greater than the last used byte to the end of the * buffer's region. The size of the used region can be changed using various * buffer commands. Initially, the used region is empty. * * The used region is further subdivided into two disjoint regions: the * 'consumed region' and the 'remaining region'. The union of these two * regions is the used region. The consumed region extends from the beginning * of the used region to the byte before the 'current' offset (if any). The * 'remaining' region the current pointer to the end of the used * region. The size of the consumed region can be changed using various * buffer commands. Initially, the consumed region is empty. * * The 'active region' is an (optional) subregion of the remaining region. * It extends from the current offset to an offset in the remaining region * that is selected with isc_buffer_setactive(). Initially, the active region * is empty. If the current offset advances beyond the chosen offset, the * active region will also be empty. * * \verbatim * /------------entire length---------------\ * /----- used region -----\/-- available --\ * +----------------------------------------+ * | consumed | remaining | | * +----------------------------------------+ * a b c d e * * a == base of buffer. * b == current pointer. Can be anywhere between a and d. * c == active pointer. Meaningful between b and d. * d == used pointer. * e == length of buffer. * * a-e == entire length of buffer. * a-d == used region. * a-b == consumed region. * b-d == remaining region. * b-c == optional active region. *\endverbatim * * The following invariants are maintained by all routines: * *\code * length > 0 * * base is a valid pointer to length bytes of memory * * 0 <= used <= length * * 0 <= current <= used * * 0 <= active <= used * (although active < current implies empty active region) *\endcode * * \li MP: * Buffers have no synchronization. Clients must ensure exclusive * access. * * \li Reliability: * No anticipated impact. * * \li Resources: * Memory: 1 pointer + 6 unsigned integers per buffer. * * \li Security: * No anticipated impact. * * \li Standards: * None. */ /*** *** Imports ***/ #include #include #include /*! * To make many functions be inline macros (via \#define) define this. * If it is undefined, a function will be used. */ /* #define ISC_BUFFER_USEINLINE */ ISC_LANG_BEGINDECLS /*@{*/ /*! *** Magic numbers ***/ #define ISC_BUFFER_MAGIC 0x42756621U /* Buf!. */ #define ISC_BUFFER_VALID(b) ISC_MAGIC_VALID(b, ISC_BUFFER_MAGIC) /*@}*/ /* * The following macros MUST be used only on valid buffers. It is the * caller's responsibility to ensure this by using the ISC_BUFFER_VALID * check above, or by calling another isc_buffer_*() function (rather than * another macro.) */ /*@{*/ /*! * Fundamental buffer elements. (A through E in the introductory comment.) */ #define isc_buffer_base(b) ((void *)(b)->base) /*a*/ #define isc_buffer_current(b) \ ((void *)((unsigned char *)(b)->base + (b)->current)) /*b*/ #define isc_buffer_active(b) \ ((void *)((unsigned char *)(b)->base + (b)->active)) /*c*/ #define isc_buffer_used(b) \ ((void *)((unsigned char *)(b)->base + (b)->used)) /*d*/ #define isc_buffer_length(b) ((b)->length) /*e*/ /*@}*/ /*@{*/ /*! * Derived lengths. (Described in the introductory comment.) */ #define isc_buffer_usedlength(b) ((b)->used) /* d-a */ #define isc_buffer_consumedlength(b) ((b)->current) /* b-a */ #define isc_buffer_remaininglength(b) ((b)->used - (b)->current) /* d-b */ #define isc_buffer_activelength(b) ((b)->active - (b)->current) /* c-b */ #define isc_buffer_availablelength(b) ((b)->length - (b)->used) /* e-d */ /*@}*/ /*! * Note that the buffer structure is public. This is principally so buffer * operations can be implemented using macros. Applications are strongly * discouraged from directly manipulating the structure. */ struct isc_buffer { unsigned int magic; void *base; /*@{*/ /*! The following integers are byte offsets from 'base'. */ unsigned int length; unsigned int used; unsigned int current; unsigned int active; /*@}*/ /*! linkable */ ISC_LINK(isc_buffer_t) link; /*! private internal elements */ isc_mem_t *mctx; }; /*** *** Functions ***/ isc_result_t isc_buffer_allocate(isc_mem_t *mctx, isc_buffer_t **dynbuffer, unsigned int length); /*!< * \brief Allocate a dynamic linkable buffer which has "length" bytes in the * data region. * * Requires: *\li "mctx" is valid. * *\li "dynbuffer" is non-NULL, and "*dynbuffer" is NULL. * * Returns: *\li ISC_R_SUCCESS - success *\li ISC_R_NOMEMORY - no memory available * * Note: *\li Changing the buffer's length field is not permitted. */ void isc_buffer_free(isc_buffer_t **dynbuffer); /*!< * \brief Release resources allocated for a dynamic buffer. * * Requires: *\li "dynbuffer" is not NULL. * *\li "*dynbuffer" is a valid dynamic buffer. * * Ensures: *\li "*dynbuffer" will be NULL on return, and all memory associated with * the dynamic buffer is returned to the memory context used in * isc_buffer_allocate(). */ void isc__buffer_init(isc_buffer_t *b, const void *base, unsigned int length); /*!< * \brief Make 'b' refer to the 'length'-byte region starting at base. * * Requires: * *\li 'length' > 0 * *\li 'base' is a pointer to a sequence of 'length' bytes. * */ void isc__buffer_initnull(isc_buffer_t *b); /*!< *\brief Initialize a buffer 'b' with a null data and zero length/ */ void isc_buffer_reinit(isc_buffer_t *b, void *base, unsigned int length); /*!< * \brief Make 'b' refer to the 'length'-byte region starting at base. * Any existing data will be copied. * * Requires: * *\li 'length' > 0 AND length >= previous length * *\li 'base' is a pointer to a sequence of 'length' bytes. * */ void isc__buffer_invalidate(isc_buffer_t *b); /*!< * \brief Make 'b' an invalid buffer. * * Requires: *\li 'b' is a valid buffer. * * Ensures: *\li If assertion checking is enabled, future attempts to use 'b' without * calling isc_buffer_init() on it will cause an assertion failure. */ void isc__buffer_region(isc_buffer_t *b, isc_region_t *r); /*!< * \brief Make 'r' refer to the region of 'b'. * * Requires: * *\li 'b' is a valid buffer. * *\li 'r' points to a region structure. */ void isc__buffer_usedregion(isc_buffer_t *b, isc_region_t *r); /*!< * \brief Make 'r' refer to the used region of 'b'. * * Requires: * *\li 'b' is a valid buffer. * *\li 'r' points to a region structure. */ void isc__buffer_availableregion(isc_buffer_t *b, isc_region_t *r); /*!< * \brief Make 'r' refer to the available region of 'b'. * * Requires: * *\li 'b' is a valid buffer. * *\li 'r' points to a region structure. */ void isc__buffer_add(isc_buffer_t *b, unsigned int n); /*!< * \brief Increase the 'used' region of 'b' by 'n' bytes. * * Requires: * *\li 'b' is a valid buffer * *\li used + n <= length * */ void isc__buffer_subtract(isc_buffer_t *b, unsigned int n); /*!< * \brief Decrease the 'used' region of 'b' by 'n' bytes. * * Requires: * *\li 'b' is a valid buffer * *\li used >= n * */ void isc__buffer_clear(isc_buffer_t *b); /*!< * \brief Make the used region empty. * * Requires: * *\li 'b' is a valid buffer * * Ensures: * *\li used = 0 * */ void isc__buffer_consumedregion(isc_buffer_t *b, isc_region_t *r); /*!< * \brief Make 'r' refer to the consumed region of 'b'. * * Requires: * *\li 'b' is a valid buffer. * *\li 'r' points to a region structure. */ void isc__buffer_remainingregion(isc_buffer_t *b, isc_region_t *r); /*!< * \brief Make 'r' refer to the remaining region of 'b'. * * Requires: * *\li 'b' is a valid buffer. * *\li 'r' points to a region structure. */ void isc__buffer_activeregion(isc_buffer_t *b, isc_region_t *r); /*!< * \brief Make 'r' refer to the active region of 'b'. * * Requires: * *\li 'b' is a valid buffer. * *\li 'r' points to a region structure. */ void isc__buffer_setactive(isc_buffer_t *b, unsigned int n); /*!< * \brief Sets the end of the active region 'n' bytes after current. * * Requires: * *\li 'b' is a valid buffer. * *\li current + n <= used */ void isc__buffer_first(isc_buffer_t *b); /*!< * \brief Make the consumed region empty. * * Requires: * *\li 'b' is a valid buffer * * Ensures: * *\li current == 0 * */ void isc__buffer_forward(isc_buffer_t *b, unsigned int n); /*!< * \brief Increase the 'consumed' region of 'b' by 'n' bytes. * * Requires: * *\li 'b' is a valid buffer * *\li current + n <= used * */ void isc__buffer_back(isc_buffer_t *b, unsigned int n); /*!< * \brief Decrease the 'consumed' region of 'b' by 'n' bytes. * * Requires: * *\li 'b' is a valid buffer * *\li n <= current * */ void isc_buffer_compact(isc_buffer_t *b); /*!< * \brief Compact the used region by moving the remaining region so it occurs * at the start of the buffer. The used region is shrunk by the size of * the consumed region, and the consumed region is then made empty. * * Requires: * *\li 'b' is a valid buffer * * Ensures: * *\li current == 0 * *\li The size of the used region is now equal to the size of the remaining * region (as it was before the call). The contents of the used region * are those of the remaining region (as it was before the call). */ isc_uint8_t isc_buffer_getuint8(isc_buffer_t *b); /*!< * \brief Read an unsigned 8-bit integer from 'b' and return it. * * Requires: * *\li 'b' is a valid buffer. * *\li The length of the available region of 'b' is at least 1. * * Ensures: * *\li The current pointer in 'b' is advanced by 1. * * Returns: * *\li A 8-bit unsigned integer. */ void isc__buffer_putuint8(isc_buffer_t *b, isc_uint8_t val); /*!< * \brief Store an unsigned 8-bit integer from 'val' into 'b'. * * Requires: *\li 'b' is a valid buffer. * *\li The length of the unused region of 'b' is at least 1. * * Ensures: *\li The used pointer in 'b' is advanced by 1. */ isc_uint16_t isc_buffer_getuint16(isc_buffer_t *b); /*!< * \brief Read an unsigned 16-bit integer in network byte order from 'b', convert * it to host byte order, and return it. * * Requires: * *\li 'b' is a valid buffer. * *\li The length of the available region of 'b' is at least 2. * * Ensures: * *\li The current pointer in 'b' is advanced by 2. * * Returns: * *\li A 16-bit unsigned integer. */ void isc__buffer_putuint16(isc_buffer_t *b, isc_uint16_t val); /*!< * \brief Store an unsigned 16-bit integer in host byte order from 'val' * into 'b' in network byte order. * * Requires: *\li 'b' is a valid buffer. * *\li The length of the unused region of 'b' is at least 2. * * Ensures: *\li The used pointer in 'b' is advanced by 2. */ isc_uint32_t isc_buffer_getuint32(isc_buffer_t *b); /*!< * \brief Read an unsigned 32-bit integer in network byte order from 'b', convert * it to host byte order, and return it. * * Requires: * *\li 'b' is a valid buffer. * *\li The length of the available region of 'b' is at least 4. * * Ensures: * *\li The current pointer in 'b' is advanced by 4. * * Returns: * *\li A 32-bit unsigned integer. */ void isc__buffer_putuint32(isc_buffer_t *b, isc_uint32_t val); /*!< * \brief Store an unsigned 32-bit integer in host byte order from 'val' * into 'b' in network byte order. * * Requires: *\li 'b' is a valid buffer. * *\li The length of the unused region of 'b' is at least 4. * * Ensures: *\li The used pointer in 'b' is advanced by 4. */ isc_uint64_t isc_buffer_getuint48(isc_buffer_t *b); /*!< * \brief Read an unsigned 48-bit integer in network byte order from 'b', * convert it to host byte order, and return it. * * Requires: * *\li 'b' is a valid buffer. * *\li The length of the available region of 'b' is at least 6. * * Ensures: * *\li The current pointer in 'b' is advanced by 6. * * Returns: * *\li A 48-bit unsigned integer (stored in a 64-bit integer). */ void isc__buffer_putuint48(isc_buffer_t *b, isc_uint64_t val); /*!< * \brief Store an unsigned 48-bit integer in host byte order from 'val' * into 'b' in network byte order. * * Requires: *\li 'b' is a valid buffer. * *\li The length of the unused region of 'b' is at least 6. * * Ensures: *\li The used pointer in 'b' is advanced by 6. */ void isc__buffer_putuint24(isc_buffer_t *b, isc_uint32_t val); /*!< * Store an unsigned 24-bit integer in host byte order from 'val' * into 'b' in network byte order. * * Requires: *\li 'b' is a valid buffer. * * The length of the unused region of 'b' is at least 3. * * Ensures: *\li The used pointer in 'b' is advanced by 3. */ void isc__buffer_putmem(isc_buffer_t *b, const unsigned char *base, unsigned int length); /*!< * \brief Copy 'length' bytes of memory at 'base' into 'b'. * * Requires: *\li 'b' is a valid buffer. * *\li 'base' points to 'length' bytes of valid memory. * */ void isc__buffer_putstr(isc_buffer_t *b, const char *source); /*!< * \brief Copy 'source' into 'b', not including terminating NUL. * * Requires: *\li 'b' is a valid buffer. * *\li 'source' to be a valid NULL terminated string. * *\li strlen(source) <= isc_buffer_available(b) */ isc_result_t isc_buffer_copyregion(isc_buffer_t *b, const isc_region_t *r); /*!< * \brief Copy the contents of 'r' into 'b'. * * Requires: *\li 'b' is a valid buffer. * *\li 'r' is a valid region. * * Returns: * *\li ISC_R_SUCCESS *\li ISC_R_NOSPACE The available region of 'b' is not * big enough. */ ISC_LANG_ENDDECLS /* * Inline macro versions of the functions. These should never be called * directly by an application, but will be used by the functions within * buffer.c. The callers should always use "isc_buffer_*()" names, never * ones beginning with "isc__" */ /*! \note * XXXDCL Something more could be done with initializing buffers that * point to const data. For example, a new function, isc_buffer_initconst, * could be used, and a new boolean flag in the buffer structure could * indicate whether the buffer was initialized with that function. * (isc_bufer_init itself would be reprototyped to *not* have its "base" * parameter be const.) Then if the boolean were true, the isc_buffer_put* * functions could assert a contractual requirement for a non-const buffer. * One drawback is that the isc_buffer_* functions (macros) that return * pointers would still need to return non-const pointers to avoid compiler * warnings, so it would be up to code that uses them to have to deal * with the possibility that the buffer was initialized as const -- * a problem that they *already* have to deal with but have absolutely * no ability to. With a new isc_buffer_isconst() function returning * true/false, they could at least assert a contractual requirement for * non-const buffers when needed. */ #define ISC__BUFFER_INIT(_b, _base, _length) \ do { \ union { \ const void * konst; \ void * var; \ } _u; \ _u.konst = (_base); \ (_b)->base = _u.var; \ (_b)->length = (_length); \ (_b)->used = 0; \ (_b)->current = 0; \ (_b)->active = 0; \ (_b)->mctx = NULL; \ ISC_LINK_INIT(_b, link); \ (_b)->magic = ISC_BUFFER_MAGIC; \ } while (0) #define ISC__BUFFER_INITNULL(_b) ISC__BUFFER_INIT(_b, NULL, 0) #define ISC__BUFFER_INVALIDATE(_b) \ do { \ (_b)->magic = 0; \ (_b)->base = NULL; \ (_b)->length = 0; \ (_b)->used = 0; \ (_b)->current = 0; \ (_b)->active = 0; \ } while (0) #define ISC__BUFFER_REGION(_b, _r) \ do { \ (_r)->base = (_b)->base; \ (_r)->length = (_b)->length; \ } while (0) #define ISC__BUFFER_USEDREGION(_b, _r) \ do { \ (_r)->base = (_b)->base; \ (_r)->length = (_b)->used; \ } while (0) #define ISC__BUFFER_AVAILABLEREGION(_b, _r) \ do { \ (_r)->base = isc_buffer_used(_b); \ (_r)->length = isc_buffer_availablelength(_b); \ } while (0) #define ISC__BUFFER_ADD(_b, _n) \ do { \ (_b)->used += (_n); \ } while (0) #define ISC__BUFFER_SUBTRACT(_b, _n) \ do { \ (_b)->used -= (_n); \ if ((_b)->current > (_b)->used) \ (_b)->current = (_b)->used; \ if ((_b)->active > (_b)->used) \ (_b)->active = (_b)->used; \ } while (0) #define ISC__BUFFER_CLEAR(_b) \ do { \ (_b)->used = 0; \ (_b)->current = 0; \ (_b)->active = 0; \ } while (0) #define ISC__BUFFER_CONSUMEDREGION(_b, _r) \ do { \ (_r)->base = (_b)->base; \ (_r)->length = (_b)->current; \ } while (0) #define ISC__BUFFER_REMAININGREGION(_b, _r) \ do { \ (_r)->base = isc_buffer_current(_b); \ (_r)->length = isc_buffer_remaininglength(_b); \ } while (0) #define ISC__BUFFER_ACTIVEREGION(_b, _r) \ do { \ if ((_b)->current < (_b)->active) { \ (_r)->base = isc_buffer_current(_b); \ (_r)->length = isc_buffer_activelength(_b); \ } else { \ (_r)->base = NULL; \ (_r)->length = 0; \ } \ } while (0) #define ISC__BUFFER_SETACTIVE(_b, _n) \ do { \ (_b)->active = (_b)->current + (_n); \ } while (0) #define ISC__BUFFER_FIRST(_b) \ do { \ (_b)->current = 0; \ } while (0) #define ISC__BUFFER_FORWARD(_b, _n) \ do { \ (_b)->current += (_n); \ } while (0) #define ISC__BUFFER_BACK(_b, _n) \ do { \ (_b)->current -= (_n); \ } while (0) #define ISC__BUFFER_PUTMEM(_b, _base, _length) \ do { \ memcpy(isc_buffer_used(_b), (_base), (_length)); \ (_b)->used += (_length); \ } while (0) #define ISC__BUFFER_PUTSTR(_b, _source) \ do { \ unsigned int _length; \ unsigned char *_cp; \ _length = strlen(_source); \ _cp = isc_buffer_used(_b); \ memcpy(_cp, (_source), _length); \ (_b)->used += (_length); \ } while (0) #define ISC__BUFFER_PUTUINT8(_b, _val) \ do { \ unsigned char *_cp; \ isc_uint8_t _val2 = (_val); \ _cp = isc_buffer_used(_b); \ (_b)->used++; \ _cp[0] = _val2 & 0x00ff; \ } while (0) #define ISC__BUFFER_PUTUINT16(_b, _val) \ do { \ unsigned char *_cp; \ isc_uint16_t _val2 = (_val); \ _cp = isc_buffer_used(_b); \ (_b)->used += 2; \ _cp[0] = (unsigned char)((_val2 & 0xff00U) >> 8); \ _cp[1] = (unsigned char)(_val2 & 0x00ffU); \ } while (0) #define ISC__BUFFER_PUTUINT24(_b, _val) \ do { \ unsigned char *_cp; \ isc_uint32_t _val2 = (_val); \ _cp = isc_buffer_used(_b); \ (_b)->used += 3; \ _cp[0] = (unsigned char)((_val2 & 0xff0000U) >> 16); \ _cp[1] = (unsigned char)((_val2 & 0xff00U) >> 8); \ _cp[2] = (unsigned char)(_val2 & 0x00ffU); \ } while (0) #define ISC__BUFFER_PUTUINT32(_b, _val) \ do { \ unsigned char *_cp; \ isc_uint32_t _val2 = (_val); \ _cp = isc_buffer_used(_b); \ (_b)->used += 4; \ _cp[0] = (unsigned char)((_val2 & 0xff000000) >> 24); \ _cp[1] = (unsigned char)((_val2 & 0x00ff0000) >> 16); \ _cp[2] = (unsigned char)((_val2 & 0x0000ff00) >> 8); \ _cp[3] = (unsigned char)((_val2 & 0x000000ff)); \ } while (0) #if defined(ISC_BUFFER_USEINLINE) #define isc_buffer_init ISC__BUFFER_INIT #define isc_buffer_initnull ISC__BUFFER_INITNULL #define isc_buffer_invalidate ISC__BUFFER_INVALIDATE #define isc_buffer_region ISC__BUFFER_REGION #define isc_buffer_usedregion ISC__BUFFER_USEDREGION #define isc_buffer_availableregion ISC__BUFFER_AVAILABLEREGION #define isc_buffer_add ISC__BUFFER_ADD #define isc_buffer_subtract ISC__BUFFER_SUBTRACT #define isc_buffer_clear ISC__BUFFER_CLEAR #define isc_buffer_consumedregion ISC__BUFFER_CONSUMEDREGION #define isc_buffer_remainingregion ISC__BUFFER_REMAININGREGION #define isc_buffer_activeregion ISC__BUFFER_ACTIVEREGION #define isc_buffer_setactive ISC__BUFFER_SETACTIVE #define isc_buffer_first ISC__BUFFER_FIRST #define isc_buffer_forward ISC__BUFFER_FORWARD #define isc_buffer_back ISC__BUFFER_BACK #define isc_buffer_putmem ISC__BUFFER_PUTMEM #define isc_buffer_putstr ISC__BUFFER_PUTSTR #define isc_buffer_putuint8 ISC__BUFFER_PUTUINT8 #define isc_buffer_putuint16 ISC__BUFFER_PUTUINT16 #define isc_buffer_putuint24 ISC__BUFFER_PUTUINT24 #define isc_buffer_putuint32 ISC__BUFFER_PUTUINT32 #else #define isc_buffer_init isc__buffer_init #define isc_buffer_initnull isc__buffer_initnull #define isc_buffer_invalidate isc__buffer_invalidate #define isc_buffer_region isc__buffer_region #define isc_buffer_usedregion isc__buffer_usedregion #define isc_buffer_availableregion isc__buffer_availableregion #define isc_buffer_add isc__buffer_add #define isc_buffer_subtract isc__buffer_subtract #define isc_buffer_clear isc__buffer_clear #define isc_buffer_consumedregion isc__buffer_consumedregion #define isc_buffer_remainingregion isc__buffer_remainingregion #define isc_buffer_activeregion isc__buffer_activeregion #define isc_buffer_setactive isc__buffer_setactive #define isc_buffer_first isc__buffer_first #define isc_buffer_forward isc__buffer_forward #define isc_buffer_back isc__buffer_back #define isc_buffer_putmem isc__buffer_putmem #define isc_buffer_putstr isc__buffer_putstr #define isc_buffer_putuint8 isc__buffer_putuint8 #define isc_buffer_putuint16 isc__buffer_putuint16 #define isc_buffer_putuint24 isc__buffer_putuint24 #define isc_buffer_putuint32 isc__buffer_putuint32 #endif /* * No inline method for this one (yet). */ #define isc_buffer_putuint48 isc__buffer_putuint48 #endif /* ISC_BUFFER_H */ ntp-4.2.6p5/lib/isc/include/isc/entropy.h0000644000175000017500000002234611307651603017220 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: entropy.h,v 1.32.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_ENTROPY_H #define ISC_ENTROPY_H 1 /***** ***** Module Info *****/ /*! \file isc/entropy.h * \brief The entropy API * * \li MP: * The entropy object is locked internally. All callbacks into * application-provided functions (for setup, gathering, and * shutdown of sources) are guaranteed to be called with the * entropy API lock held. This means these functions are * not permitted to call back into the entropy API. * * \li Reliability: * No anticipated impact. * * \li Resources: * A buffer, used as an entropy pool. * * \li Security: * While this code is believed to implement good entropy gathering * and distribution, it has not been reviewed by a cryptographic * expert. * Since the added entropy is only as good as the sources used, * this module could hand out bad data and never know it. * * \li Standards: * None. */ /*** *** Imports ***/ #include #include #include /*@{*/ /*% Entropy callback function. */ typedef isc_result_t (*isc_entropystart_t)(isc_entropysource_t *source, void *arg, isc_boolean_t blocking); typedef isc_result_t (*isc_entropyget_t)(isc_entropysource_t *source, void *arg, isc_boolean_t blocking); typedef void (*isc_entropystop_t)(isc_entropysource_t *source, void *arg); /*@}*/ /*** *** Flags. ***/ /*! * \brief * Extract only "good" data; return failure if there is not enough * data available and there are no sources which we can poll to get * data, or those sources are empty. * * */ #define ISC_ENTROPY_GOODONLY 0x00000001U /*! * \brief * Extract as much good data as possible, but if there isn't enough * at hand, return what is available. This flag only makes sense * when used with _GOODONLY. */ #define ISC_ENTROPY_PARTIAL 0x00000002U /*! * \brief * Block the task until data is available. This is contrary to the * ISC task system, where tasks should never block. However, if * this is a special purpose application where blocking a task is * acceptable (say, an offline zone signer) this flag may be set. * This flag only makes sense when used with _GOODONLY, and will * block regardless of the setting for _PARTIAL. */ #define ISC_ENTROPY_BLOCKING 0x00000004U /*! * \brief * Estimate the amount of entropy contained in the sample pool. * If this is not set, the source will be gathered and periodically * mixed into the entropy pool, but no increment in contained entropy * will be assumed. This flag only makes sense on sample sources. */ #define ISC_ENTROPYSOURCE_ESTIMATE 0x00000001U /* * For use with isc_entropy_usebestsource(). */ /*! * \brief * Use the keyboard as the only entropy source. */ #define ISC_ENTROPY_KEYBOARDYES 1 /*! * \brief * Never use the keyboard as an entropy source. */ #define ISC_ENTROPY_KEYBOARDNO 2 /*! * \brief * Use the keyboard as an entropy source only if opening the * random device fails. */ #define ISC_ENTROPY_KEYBOARDMAYBE 3 ISC_LANG_BEGINDECLS /*** *** Functions ***/ isc_result_t isc_entropy_create(isc_mem_t *mctx, isc_entropy_t **entp); /*!< * \brief Create a new entropy object. */ void isc_entropy_attach(isc_entropy_t *ent, isc_entropy_t **entp); /*!< * Attaches to an entropy object. */ void isc_entropy_detach(isc_entropy_t **entp); /*!< * \brief Detaches from an entropy object. */ isc_result_t isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname); /*!< * \brief Create a new entropy source from a file. * * The file is assumed to contain good randomness, and will be mixed directly * into the pool with every byte adding 8 bits of entropy. * * The file will be put into non-blocking mode, so it may be a device file, * such as /dev/random. /dev/urandom should not be used here if it can * be avoided, since it will always provide data even if it isn't good. * We will make as much pseudorandom data as we need internally if our * caller asks for it. * * If we hit end-of-file, we will stop reading from this source. Callers * who require strong random data will get failure when our pool drains. * The file will never be opened/read again once EOF is reached. */ void isc_entropy_destroysource(isc_entropysource_t **sourcep); /*!< * \brief Removes an entropy source from the entropy system. */ isc_result_t isc_entropy_createsamplesource(isc_entropy_t *ent, isc_entropysource_t **sourcep); /*!< * \brief Create an entropy source that consists of samples. Each sample is added * to the source via isc_entropy_addsamples(), below. */ isc_result_t isc_entropy_createcallbacksource(isc_entropy_t *ent, isc_entropystart_t start, isc_entropyget_t get, isc_entropystop_t stop, void *arg, isc_entropysource_t **sourcep); /*!< * \brief Create an entropy source that is polled via a callback. * * This would * be used when keyboard input is used, or a GUI input method. It can * also be used to hook in any external entropy source. * * Samples are added via isc_entropy_addcallbacksample(), below. * _addcallbacksample() is the only function which may be called from * within an entropy API callback function. */ void isc_entropy_stopcallbacksources(isc_entropy_t *ent); /*!< * \brief Call the stop functions for callback sources that have had their * start functions called. */ /*@{*/ isc_result_t isc_entropy_addcallbacksample(isc_entropysource_t *source, isc_uint32_t sample, isc_uint32_t extra); isc_result_t isc_entropy_addsample(isc_entropysource_t *source, isc_uint32_t sample, isc_uint32_t extra); /*!< * \brief Add a sample to the sample source. * * The sample MUST be a timestamp * that increases over time, with the exception of wrap-around for * extremely high resolution timers which will quickly wrap-around * a 32-bit integer. * * The "extra" parameter is used only to add a bit more unpredictable * data. It is not used other than included in the hash of samples. * * When in an entropy API callback function, _addcallbacksource() must be * used. At all other times, _addsample() must be used. */ /*@}*/ isc_result_t isc_entropy_getdata(isc_entropy_t *ent, void *data, unsigned int length, unsigned int *returned, unsigned int flags); /*!< * \brief Extract data from the entropy pool. This may load the pool from various * sources. * * Do this by stiring the pool and returning a part of hash as randomness. * Note that no secrets are given away here since parts of the hash are * xored together before returned. * * Honor the request from the caller to only return good data, any data, * etc. */ void isc_entropy_putdata(isc_entropy_t *ent, void *data, unsigned int length, isc_uint32_t entropy); /*!< * \brief Add "length" bytes in "data" to the entropy pool, incrementing the pool's * entropy count by "entropy." * * These bytes will prime the pseudorandom portion even no entropy is actually * added. */ void isc_entropy_stats(isc_entropy_t *ent, FILE *out); /*!< * \brief Dump some (trivial) stats to the stdio stream "out". */ unsigned int isc_entropy_status(isc_entropy_t *end); /* * Returns the number of bits the pool currently contains. This is just * an estimate. */ isc_result_t isc_entropy_usebestsource(isc_entropy_t *ectx, isc_entropysource_t **source, const char *randomfile, int use_keyboard); /*!< * \brief Use whatever source of entropy is best. * * Notes: *\li If "randomfile" is not NULL, open it with * isc_entropy_createfilesource(). * *\li If "randomfile" is NULL and the system's random device was detected * when the program was configured and built, open that device with * isc_entropy_createfilesource(). * *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDYES, then always open * the keyboard as an entropy source (possibly in addition to * "randomfile" or the random device). * *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDMAYBE, open the keyboard only * if opening the random file/device fails. A message will be * printed describing the need for keyboard input. * *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDNO, the keyboard will * never be opened. * * Returns: *\li #ISC_R_SUCCESS if at least one source of entropy could be started. * *\li #ISC_R_NOENTROPY if use_keyboard is #ISC_ENTROPY_KEYBOARDNO and * there is no random device pathname compiled into the program. * *\li A return code from isc_entropy_createfilesource() or * isc_entropy_createcallbacksource(). */ ISC_LANG_ENDDECLS #endif /* ISC_ENTROPY_H */ ntp-4.2.6p5/lib/isc/include/isc/sockaddr.h0000644000175000017500000001467011307651603017313 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: sockaddr.h,v 1.55.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_SOCKADDR_H #define ISC_SOCKADDR_H 1 /*! \file isc/sockaddr.h */ #include #include #include #ifdef ISC_PLATFORM_HAVESYSUNH #include #endif struct isc_sockaddr { union { struct sockaddr sa; struct sockaddr_in sin; struct sockaddr_in6 sin6; #ifdef ISC_PLATFORM_HAVESYSUNH struct sockaddr_un sunix; #endif } type; unsigned int length; /* XXXRTH beginning? */ ISC_LINK(struct isc_sockaddr) link; }; typedef ISC_LIST(struct isc_sockaddr) isc_sockaddrlist_t; #define ISC_SOCKADDR_CMPADDR 0x0001 /*%< compare the address * sin_addr/sin6_addr */ #define ISC_SOCKADDR_CMPPORT 0x0002 /*%< compare the port * sin_port/sin6_port */ #define ISC_SOCKADDR_CMPSCOPE 0x0004 /*%< compare the scope * sin6_scope */ #define ISC_SOCKADDR_CMPSCOPEZERO 0x0008 /*%< when comparing scopes * zero scopes always match */ ISC_LANG_BEGINDECLS isc_boolean_t isc_sockaddr_compare(const isc_sockaddr_t *a, const isc_sockaddr_t *b, unsigned int flags); /*%< * Compare the elements of the two address ('a' and 'b') as specified * by 'flags' and report if they are equal or not. * * 'flags' is set from ISC_SOCKADDR_CMP*. */ isc_boolean_t isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b); /*%< * Return ISC_TRUE iff the socket addresses 'a' and 'b' are equal. */ isc_boolean_t isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b); /*%< * Return ISC_TRUE iff the address parts of the socket addresses * 'a' and 'b' are equal, ignoring the ports. */ isc_boolean_t isc_sockaddr_eqaddrprefix(const isc_sockaddr_t *a, const isc_sockaddr_t *b, unsigned int prefixlen); /*%< * Return ISC_TRUE iff the most significant 'prefixlen' bits of the * socket addresses 'a' and 'b' are equal, ignoring the ports. * If 'b''s scope is zero then 'a''s scope will be ignored. */ unsigned int isc_sockaddr_hash(const isc_sockaddr_t *sockaddr, isc_boolean_t address_only); /*%< * Return a hash value for the socket address 'sockaddr'. If 'address_only' * is ISC_TRUE, the hash value will not depend on the port. * * IPv6 addresses containing mapped IPv4 addresses generate the same hash * value as the equivalent IPv4 address. */ void isc_sockaddr_any(isc_sockaddr_t *sockaddr); /*%< * Return the IPv4 wildcard address. */ void isc_sockaddr_any6(isc_sockaddr_t *sockaddr); /*%< * Return the IPv6 wildcard address. */ void isc_sockaddr_anyofpf(isc_sockaddr_t *sockaddr, int family); /*%< * Set '*sockaddr' to the wildcard address of protocol family * 'family'. * * Requires: * \li 'family' is AF_INET or AF_INET6. */ void isc_sockaddr_fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina, in_port_t port); /*%< * Construct an isc_sockaddr_t from an IPv4 address and port. */ void isc_sockaddr_fromin6(isc_sockaddr_t *sockaddr, const struct in6_addr *ina6, in_port_t port); /*%< * Construct an isc_sockaddr_t from an IPv6 address and port. */ void isc_sockaddr_v6fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina, in_port_t port); /*%< * Construct an IPv6 isc_sockaddr_t representing a mapped IPv4 address. */ void isc_sockaddr_fromnetaddr(isc_sockaddr_t *sockaddr, const isc_netaddr_t *na, in_port_t port); /*%< * Construct an isc_sockaddr_t from an isc_netaddr_t and port. */ int isc_sockaddr_pf(const isc_sockaddr_t *sockaddr); /*%< * Get the protocol family of 'sockaddr'. * * Requires: * *\li 'sockaddr' is a valid sockaddr with an address family of AF_INET * or AF_INET6. * * Returns: * *\li The protocol family of 'sockaddr', e.g. PF_INET or PF_INET6. */ void isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port); /*%< * Set the port of 'sockaddr' to 'port'. */ in_port_t isc_sockaddr_getport(const isc_sockaddr_t *sockaddr); /*%< * Get the port stored in 'sockaddr'. */ isc_result_t isc_sockaddr_totext(const isc_sockaddr_t *sockaddr, isc_buffer_t *target); /*%< * Append a text representation of 'sockaddr' to the buffer 'target'. * The text will include both the IP address (v4 or v6) and the port. * The text is null terminated, but the terminating null is not * part of the buffer's used region. * * Returns: * \li ISC_R_SUCCESS * \li ISC_R_NOSPACE The text or the null termination did not fit. */ void isc_sockaddr_format(const isc_sockaddr_t *sa, char *array, unsigned int size); /*%< * Format a human-readable representation of the socket address '*sa' * into the character array 'array', which is of size 'size'. * The resulting string is guaranteed to be null-terminated. */ isc_boolean_t isc_sockaddr_ismulticast(const isc_sockaddr_t *sa); /*%< * Returns #ISC_TRUE if the address is a multicast address. */ isc_boolean_t isc_sockaddr_isexperimental(const isc_sockaddr_t *sa); /* * Returns ISC_TRUE if the address is a experimental (CLASS E) address. */ isc_boolean_t isc_sockaddr_islinklocal(const isc_sockaddr_t *sa); /*%< * Returns ISC_TRUE if the address is a link local address. */ isc_boolean_t isc_sockaddr_issitelocal(const isc_sockaddr_t *sa); /*%< * Returns ISC_TRUE if the address is a sitelocal address. */ isc_result_t isc_sockaddr_frompath(isc_sockaddr_t *sockaddr, const char *path); /* * Create a UNIX domain sockaddr that refers to path. * * Returns: * \li ISC_R_NOSPACE * \li ISC_R_NOTIMPLEMENTED * \li ISC_R_SUCCESS */ #define ISC_SOCKADDR_FORMATSIZE \ sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX%SSSSSSSSSS#YYYYY") /*%< * Minimum size of array to pass to isc_sockaddr_format(). */ ISC_LANG_ENDDECLS #endif /* ISC_SOCKADDR_H */ ntp-4.2.6p5/lib/isc/include/isc/bitstring.h0000644000175000017500000001057611307651603017527 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: bitstring.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_BITSTRING_H #define ISC_BITSTRING_H 1 /***** ***** Module Info *****/ /*! \file isc/bitstring.h * * \brief Bitstring manipulation functions. * * A bitstring is a packed array of bits, stored in a contiguous * sequence of octets. The "most significant bit" (msb) of a bitstring * is the high bit of the first octet. The "least significant bit" of a * bitstring is the low bit of the last octet. * * Two bit numbering schemes are supported, "msb0" and "lsb0". * * In the "msb0" scheme, bit number 0 designates the most significant bit, * and any padding bits required to make the bitstring a multiple of 8 bits * long are added to the least significant end of the last octet. * * In the "lsb0" scheme, bit number 0 designates the least significant bit, * and any padding bits required to make the bitstring a multiple of 8 bits * long are added to the most significant end of the first octet. * * E.g., consider the bitstring "11010001111". This bitstring is 11 bits * long and will take two octets. Let "p" denote a pad bit. In the msb0 * encoding, it would be * * \verbatim * Octet 0 Octet 1 * | * 1 1 0 1 0 0 0 1 | 1 1 1 p p p p p * ^ | ^ * | | * bit 0 bit 15 * \endverbatim * * In the lsb0 encoding, it would be * * \verbatim * Octet 0 Octet 1 * | * p p p p p 1 1 0 | 1 0 0 0 1 1 1 1 * ^ | ^ * | | * bit 15 bit 0 * \endverbatim */ /*** *** Imports ***/ #include #include ISC_LANG_BEGINDECLS /*** *** Types ***/ struct isc_bitstring { unsigned int magic; unsigned char * data; unsigned int length; unsigned int size; isc_boolean_t lsb0; }; /*** *** Functions ***/ void isc_bitstring_init(isc_bitstring_t *bitstring, unsigned char *data, unsigned int length, unsigned int size, isc_boolean_t lsb0); /*!< * \brief Make 'bitstring' refer to the bitstring of 'size' bits starting * at 'data'. 'length' bits of the bitstring are valid. If 'lsb0' * is set then, bit 0 refers to the least significant bit of the * bitstring. Otherwise bit 0 is the most significant bit. * * Requires: * *\li 'bitstring' points to a isc_bitstring_t. * *\li 'data' points to an array of unsigned char large enough to hold * 'size' bits. * *\li 'length' <= 'size'. * * Ensures: * *\li 'bitstring' is a valid bitstring. */ void isc_bitstring_invalidate(isc_bitstring_t *bitstring); /*!< * \brief Invalidate 'bitstring'. * * Requires: * *\li 'bitstring' is a valid bitstring. * * Ensures: * *\li 'bitstring' is not a valid bitstring. */ void isc_bitstring_copy(isc_bitstring_t *source, unsigned int sbitpos, isc_bitstring_t *target, unsigned int tbitpos, unsigned int n); /*!< * \brief Starting at bit 'sbitpos', copy 'n' bits from 'source' to * the 'n' bits of 'target' starting at 'tbitpos'. * * Requires: * *\li 'source' and target are valid bitstrings with the same lsb0 setting. * *\li 'sbitpos' + 'n' is less than or equal to the length of 'source'. * *\li 'tbitpos' + 'n' is less than or equal to the size of 'target'. * * Ensures: * *\li The specified bits have been copied, and the length of 'target' * adjusted (if required). */ ISC_LANG_ENDDECLS #endif /* ISC_BITSTRING_H */ ntp-4.2.6p5/lib/isc/include/isc/file.h0000644000175000017500000001673011307651614016441 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: file.h,v 1.33.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_FILE_H #define ISC_FILE_H 1 /*! \file isc/file.h */ #include #include #include ISC_LANG_BEGINDECLS isc_result_t isc_file_settime(const char *file, isc_time_t *time); isc_result_t isc_file_getmodtime(const char *file, isc_time_t *time); /*!< * \brief Get the time of last modification of a file. * * Notes: *\li The time that is set is relative to the (OS-specific) epoch, as are * all isc_time_t structures. * * Requires: *\li file != NULL. *\li time != NULL. * * Ensures: *\li If the file could not be accessed, 'time' is unchanged. * * Returns: *\li #ISC_R_SUCCESS * Success. *\li #ISC_R_NOTFOUND * No such file exists. *\li #ISC_R_INVALIDFILE * The path specified was not usable by the operating system. *\li #ISC_R_NOPERM * The file's metainformation could not be retrieved because * permission was denied to some part of the file's path. *\li #ISC_R_EIO * Hardware error interacting with the filesystem. *\li #ISC_R_UNEXPECTED * Something totally unexpected happened. * */ isc_result_t isc_file_mktemplate(const char *path, char *buf, size_t buflen); /*!< * \brief Generate a template string suitable for use with isc_file_openunique(). * * Notes: *\li This function is intended to make creating temporary files * portable between different operating systems. * *\li The path is prepended to an implementation-defined string and * placed into buf. The string has no path characters in it, * and its maximum length is 14 characters plus a NUL. Thus * buflen should be at least strlen(path) + 15 characters or * an error will be returned. * * Requires: *\li buf != NULL. * * Ensures: *\li If result == #ISC_R_SUCCESS: * buf contains a string suitable for use as the template argument * to isc_file_openunique(). * *\li If result != #ISC_R_SUCCESS: * buf is unchanged. * * Returns: *\li #ISC_R_SUCCESS Success. *\li #ISC_R_NOSPACE buflen indicates buf is too small for the catenation * of the path with the internal template string. */ isc_result_t isc_file_openunique(char *templet, FILE **fp); /*!< * \brief Create and open a file with a unique name based on 'templet'. * * Notes: *\li 'template' is a reserved work in C++. If you want to complain * about the spelling of 'templet', first look it up in the * Merriam-Webster English dictionary. (http://www.m-w.com/) * *\li This function works by using the template to generate file names. * The template must be a writable string, as it is modified in place. * Trailing X characters in the file name (full file name on Unix, * basename on Win32 -- eg, tmp-XXXXXX vs XXXXXX.tmp, respectively) * are replaced with ASCII characters until a non-existent filename * is found. If the template does not include pathname information, * the files in the working directory of the program are searched. * *\li isc_file_mktemplate is a good, portable way to get a template. * * Requires: *\li 'fp' is non-NULL and '*fp' is NULL. * *\li 'template' is non-NULL, and of a form suitable for use by * the system as described above. * * Ensures: *\li If result is #ISC_R_SUCCESS: * *fp points to an stream opening in stdio's "w+" mode. * *\li If result is not #ISC_R_SUCCESS: * *fp is NULL. * * No file is open. Even if one was created (but unable * to be reopened as a stdio FILE pointer) then it has been * removed. * *\li This function does *not* ensure that the template string has not been * modified, even if the operation was unsuccessful. * * Returns: *\li #ISC_R_SUCCESS * Success. *\li #ISC_R_EXISTS * No file with a unique name could be created based on the * template. *\li #ISC_R_INVALIDFILE * The path specified was not usable by the operating system. *\li #ISC_R_NOPERM * The file could not be created because permission was denied * to some part of the file's path. *\li #ISC_R_IOERROR * Hardware error interacting with the filesystem. *\li #ISC_R_UNEXPECTED * Something totally unexpected happened. */ isc_result_t isc_file_remove(const char *filename); /*!< * \brief Remove the file named by 'filename'. */ isc_result_t isc_file_rename(const char *oldname, const char *newname); /*!< * \brief Rename the file 'oldname' to 'newname'. */ isc_boolean_t isc_file_exists(const char *pathname); /*!< * \brief Return #ISC_TRUE if the calling process can tell that the given file exists. * Will not return true if the calling process has insufficient privileges * to search the entire path. */ isc_boolean_t isc_file_isabsolute(const char *filename); /*!< * \brief Return #ISC_TRUE if the given file name is absolute. */ isc_boolean_t isc_file_iscurrentdir(const char *filename); /*!< * \brief Return #ISC_TRUE if the given file name is the current directory ("."). */ isc_boolean_t isc_file_ischdiridempotent(const char *filename); /*%< * Return #ISC_TRUE if calling chdir(filename) multiple times will give * the same result as calling it once. */ const char * isc_file_basename(const char *filename); /*%< * Return the final component of the path in the file name. */ isc_result_t isc_file_progname(const char *filename, char *buf, size_t buflen); /*!< * \brief Given an operating system specific file name "filename" * referring to a program, return the canonical program name. * * * Any directory prefix or executable file name extension (if * used on the OS in case) is stripped. On systems where program * names are case insensitive, the name is canonicalized to all * lower case. The name is written to 'buf', an array of 'buflen' * chars, and null terminated. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOSPACE The name did not fit in 'buf'. */ isc_result_t isc_file_template(const char *path, const char *templet, char *buf, size_t buflen); /*%< * Create an OS specific template using 'path' to define the directory * 'templet' to describe the filename and store the result in 'buf' * such that path can be renamed to buf atomically. */ isc_result_t isc_file_renameunique(const char *file, char *templet); /*%< * Rename 'file' using 'templet' as a template for the new file name. */ isc_result_t isc_file_absolutepath(const char *filename, char *path, size_t pathlen); /*%< * Given a file name, return the fully qualified path to the file. */ /* * XXX We should also have a isc_file_writeeopen() function * for safely open a file in a publicly writable directory * (see write_open() in BIND 8's ns_config.c). */ isc_result_t isc_file_truncate(const char *filename, isc_offset_t size); /*%< * Truncate/extend the file specified to 'size' bytes. */ ISC_LANG_ENDDECLS #endif /* ISC_FILE_H */ ntp-4.2.6p5/lib/isc/include/isc/interfaceiter.h0000644000175000017500000000747311505336022020343 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: interfaceiter.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_INTERFACEITER_H #define ISC_INTERFACEITER_H 1 /***** ***** Module Info *****/ /*! \file isc/interfaceiter.h * \brief Iterates over the list of network interfaces. * * Interfaces whose address family is not supported are ignored and never * returned by the iterator. Interfaces whose netmask, interface flags, * or similar cannot be obtained are also ignored, and the failure is logged. * * Standards: * The API for scanning varies greatly among operating systems. * This module attempts to hide the differences. */ /*** *** Imports ***/ #include #include #include /*! * \brief Public structure describing a network interface. */ struct isc_interface { char name[32]; /*%< Interface name, null-terminated. */ unsigned int af; /*%< Address family. */ isc_netaddr_t address; /*%< Local address. */ isc_netaddr_t netmask; /*%< Network mask. */ isc_netaddr_t broadcast; /*&< Broadcast address. */ isc_netaddr_t dstaddress; /*%< Destination address (point-to-point only). */ isc_uint32_t flags; /*%< Flags; see INTERFACE flags. */ unsigned int ifindex; /*%< Interface index for IP(V6)_MULTICAST_IF. */ }; /*@{*/ /*! Interface flags. */ #define INTERFACE_F_UP 0x00000001U #define INTERFACE_F_POINTTOPOINT 0x00000002U #define INTERFACE_F_LOOPBACK 0x00000004U #define INTERFACE_F_BROADCAST 0x00000008U #define INTERFACE_F_MULTICAST 0x00000010U #define INTERFACE_F_PRIVACY 0x00000020U /* RFC 4941 */ /*@}*/ /*** *** Functions ***/ ISC_LANG_BEGINDECLS isc_result_t isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp); /*!< * \brief Create an iterator for traversing the operating system's list * of network interfaces. * * Returns: *\li #ISC_R_SUCCESS * \li #ISC_R_NOMEMORY *\li Various network-related errors */ isc_result_t isc_interfaceiter_first(isc_interfaceiter_t *iter); /*!< * \brief Position the iterator on the first interface. * * Returns: *\li #ISC_R_SUCCESS Success. *\li #ISC_R_NOMORE There are no interfaces. */ isc_result_t isc_interfaceiter_current(isc_interfaceiter_t *iter, isc_interface_t *ifdata); /*!< * \brief Get information about the interface the iterator is currently * positioned at and store it at *ifdata. * * Requires: *\li The iterator has been successfully positioned using * isc_interface_iter_first() / isc_interface_iter_next(). * * Returns: *\li #ISC_R_SUCCESS Success. */ isc_result_t isc_interfaceiter_next(isc_interfaceiter_t *iter); /*!< * \brief Position the iterator on the next interface. * * Requires: * \li The iterator has been successfully positioned using * isc_interface_iter_first() / isc_interface_iter_next(). * * Returns: *\li #ISC_R_SUCCESS Success. *\li #ISC_R_NOMORE There are no more interfaces. */ void isc_interfaceiter_destroy(isc_interfaceiter_t **iterp); /*!< * \brief Destroy the iterator. */ ISC_LANG_ENDDECLS #endif /* ISC_INTERFACEITER_H */ ntp-4.2.6p5/lib/isc/include/isc/stdlib.h0000644000175000017500000000230511307651603016772 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: stdlib.h,v 1.8 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_STDLIB_H #define ISC_STDLIB_H 1 /*! \file isc/stdlib.h */ #include #include #include #ifdef ISC_PLATFORM_NEEDSTRTOUL #define strtoul isc_strtoul #endif ISC_LANG_BEGINDECLS unsigned long isc_strtoul(const char *, char **, int); ISC_LANG_ENDDECLS #endif ntp-4.2.6p5/lib/isc/include/isc/resource.h0000644000175000017500000000650411307651604017346 0ustar peterpeter/* * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: resource.h,v 1.13 2008/07/11 23:47:09 tbox Exp $ */ #ifndef ISC_RESOURCE_H #define ISC_RESOURCE_H 1 /*! \file isc/resource.h */ #include #include #define ISC_RESOURCE_UNLIMITED ((isc_resourcevalue_t)ISC_UINT64_MAX) ISC_LANG_BEGINDECLS isc_result_t isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value); /*%< * Set the maximum limit for a system resource. * * Notes: *\li If 'value' exceeds the maximum possible on the operating system, * it is silently limited to that maximum -- or to "infinity", if * the operating system has that concept. #ISC_RESOURCE_UNLIMITED * can be used to explicitly ask for the maximum. * * Requires: *\li 'resource' is a valid member of the isc_resource_t enumeration. * * Returns: *\li #ISC_R_SUCCESS Success. *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS. *\li #ISC_R_NOPERM The calling process did not have adequate permission * to change the resource limit. */ isc_result_t isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value); /*%< * Get the maximum limit for a system resource. * * Notes: *\li 'value' is set to the maximum limit. * *\li #ISC_RESOURCE_UNLIMITED is the maximum value of isc_resourcevalue_t. * *\li On many (all?) Unix systems, RLIM_INFINITY is a valid value that is * significantly less than #ISC_RESOURCE_UNLIMITED, but which in practice * behaves the same. * *\li The current ISC libdns configuration file parser assigns a value * of ISC_UINT32_MAX for a size_spec of "unlimited" and ISC_UNIT32_MAX - 1 * for "default", the latter of which is supposed to represent "the * limit that was in force when the server started". Since these are * valid values in the middle of the range of isc_resourcevalue_t, * there is the possibility for confusion over what exactly those * particular values are supposed to represent in a particular context -- * discrete integral values or generalized concepts. * * Requires: *\li 'resource' is a valid member of the isc_resource_t enumeration. * * Returns: *\li #ISC_R_SUCCESS Success. *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS. */ isc_result_t isc_resource_getcurlimit(isc_resource_t resource, isc_resourcevalue_t *value); /*%< * Same as isc_resource_getlimit(), but returns the current (soft) limit. * * Returns: *\li #ISC_R_SUCCESS Success. *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS. */ ISC_LANG_ENDDECLS #endif /* ISC_RESOURCE_H */ ntp-4.2.6p5/lib/isc/include/isc/serial.h0000644000175000017500000000365511307651604017002 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: serial.h,v 1.16.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_SERIAL_H #define ISC_SERIAL_H 1 #include #include /*! \file isc/serial.h * \brief Implement 32 bit serial space arithmetic comparison functions. * Note: Undefined results are returned as ISC_FALSE. */ /*** *** Functions ***/ ISC_LANG_BEGINDECLS isc_boolean_t isc_serial_lt(isc_uint32_t a, isc_uint32_t b); /*%< * Return true if 'a' < 'b' otherwise false. */ isc_boolean_t isc_serial_gt(isc_uint32_t a, isc_uint32_t b); /*%< * Return true if 'a' > 'b' otherwise false. */ isc_boolean_t isc_serial_le(isc_uint32_t a, isc_uint32_t b); /*%< * Return true if 'a' <= 'b' otherwise false. */ isc_boolean_t isc_serial_ge(isc_uint32_t a, isc_uint32_t b); /*%< * Return true if 'a' >= 'b' otherwise false. */ isc_boolean_t isc_serial_eq(isc_uint32_t a, isc_uint32_t b); /*%< * Return true if 'a' == 'b' otherwise false. */ isc_boolean_t isc_serial_ne(isc_uint32_t a, isc_uint32_t b); /*%< * Return true if 'a' != 'b' otherwise false. */ ISC_LANG_ENDDECLS #endif /* ISC_SERIAL_H */ ntp-4.2.6p5/lib/isc/include/isc/ondestroy.h0000644000175000017500000000637711307651603017554 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ondestroy.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_ONDESTROY_H #define ISC_ONDESTROY_H 1 #include #include ISC_LANG_BEGINDECLS /*! \file isc/ondestroy.h * ondestroy handling. * * Any class ``X'' of objects that wants to send out notifications * on its destruction should declare a field of type isc_ondestroy_t * (call it 'ondest'). * * \code * typedef struct { * ... * isc_ondestroy_t ondest; * ... * } X; * \endcode * * When an object ``A'' of type X is created * it must initialize the field ondest with a call to * * \code * isc_ondestroy_init(&A->ondest). * \endcode * * X should also provide a registration function for third-party * objects to call to register their interest in being told about * the destruction of a particular instance of X. * * \code * isc_result_t * X_ondestroy(X *instance, isc_task_t *task, * isc_event_t **eventp) { * return(isc_ondestroy_register(&instance->ondest, task,eventp)); * } * \endcode * * Note: locking of the ondestory structure embedded inside of X, is * X's responsibility. * * When an instance of X is destroyed, a call to isc_ondestroy_notify() * sends the notifications: * * \code * X *instance; * isc_ondestroy_t ondest = instance->ondest; * * ... completely cleanup 'instance' here... * * isc_ondestroy_notify(&ondest, instance); * \endcode * * * see lib/dns/zone.c for an ifdef'd-out example. */ struct isc_ondestroy { unsigned int magic; isc_eventlist_t events; }; void isc_ondestroy_init(isc_ondestroy_t *ondest); /*%< * Initialize the on ondest structure. *must* be called before first call * to isc_ondestroy_register(). */ isc_result_t isc_ondestroy_register(isc_ondestroy_t *ondest, isc_task_t *task, isc_event_t **eventp); /*%< * Stores task and *eventp away inside *ondest. Ownership of **event is * taken from the caller (and *eventp is set to NULL). The task is attached * to. */ void isc_ondestroy_notify(isc_ondestroy_t *ondest, void *sender); /*%< * Dispatches the event(s) to the task(s) that were given in * isc_ondestroy_register call(s) (done via calls to * isc_task_sendanddetach()). Before dispatch, the sender value of each * event structure is set to the value of the sender paramater. The * internal structures of the ondest parameter are cleaned out, so no other * cleanup is needed. */ ISC_LANG_ENDDECLS #endif /* ISC_ONDESTROY_H */ ntp-4.2.6p5/lib/isc/include/isc/msgs.h0000644000175000017500000002125511307651604016470 0ustar peterpeter/* * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: msgs.h,v 1.17 2008/08/08 06:28:59 tbox Exp $ */ #ifndef ISC_MSGS_H #define ISC_MSGS_H 1 /*! \file isc/msgs.h */ #include /* Provide isc_msgcat global variable. */ #include /* Provide isc_msgcat_*() functions. */ /*@{*/ /*! * \brief Message sets, named per source file, excepting "GENERAL". * * IMPORTANT: The original list is alphabetical, but any new sets must * be added to the end. */ #define ISC_MSGSET_GENERAL 1 /* ISC_RESULT_RESULTSET 2 */ /* XXX */ /* ISC_RESULT_UNAVAILABLESET 3 */ /* XXX */ #define ISC_MSGSET_APP 4 #define ISC_MSGSET_COMMANDLINE 5 #define ISC_MSGSET_ENTROPY 6 #define ISC_MSGSET_IFITERIOCTL 7 #define ISC_MSGSET_IFITERSYSCTL 8 #define ISC_MSGSET_LEX 9 #define ISC_MSGSET_LOG 10 #define ISC_MSGSET_MEM 11 #define ISC_MSGSET_NETADDR 12 #define ISC_MSGSET_PRINT 13 #define ISC_MSGSET_RESULT 14 #define ISC_MSGSET_RWLOCK 15 #define ISC_MSGSET_SOCKADDR 16 #define ISC_MSGSET_SOCKET 17 #define ISC_MSGSET_TASK 18 #define ISC_MSGSET_TIMER 19 #define ISC_MSGSET_UTIL 20 #define ISC_MSGSET_IFITERGETIFADDRS 21 /*@}*/ /*@{*/ /*! * Message numbers * are only required to be unique per message set, * but are unique throughout the entire catalog to not be as confusing when * debugging. * * The initial numbering was done by multiply by 100 the set number the * message appears in then adding the incremental message number. */ #define ISC_MSG_FAILED 101 /*%< "failed" */ #define ISC_MSG_SUCCEEDED 102 /*%< Compatible with "failed" */ #define ISC_MSG_SUCCESS 103 /*%< More usual way to say "success" */ #define ISC_MSG_STARTING 104 /*%< As in "daemon: starting" */ #define ISC_MSG_STOPING 105 /*%< As in "daemon: stopping" */ #define ISC_MSG_ENTERING 106 /*%< As in "some_subr: entering" */ #define ISC_MSG_EXITING 107 /*%< As in "some_subr: exiting" */ #define ISC_MSG_CALLING 108 /*%< As in "calling some_subr()" */ #define ISC_MSG_RETURNED 109 /*%< As in "some_subr: returned " */ #define ISC_MSG_FATALERROR 110 /*%< "fatal error" */ #define ISC_MSG_SHUTTINGDOWN 111 /*%< "shutting down" */ #define ISC_MSG_RUNNING 112 /*%< "running" */ #define ISC_MSG_WAIT 113 /*%< "wait" */ #define ISC_MSG_WAITUNTIL 114 /*%< "waituntil" */ #define ISC_MSG_SIGNALSETUP 201 /*%< "handle_signal() %d setup: %s" */ #define ISC_MSG_ILLEGALOPT 301 /*%< "illegal option" */ #define ISC_MSG_OPTNEEDARG 302 /*%< "option requires an argument" */ #define ISC_MSG_ENTROPYSTATS 401 /*%< "Entropy pool %p: refcnt %u ..." */ #define ISC_MSG_MAKESCANSOCKET 501 /*%< "making interface scan socket: %s" */ #define ISC_MSG_GETIFCONFIG 502 /*%< "get interface configuration: %s" */ #define ISC_MSG_BUFFERMAX 503 /*%< "... maximum buffer size exceeded" */ #define ISC_MSG_GETDESTADDR 504 /*%< "%s: getting destination address: %s" */ #define ISC_MSG_GETNETMASK 505 /*%< "%s: getting netmask: %s" */ #define ISC_MSG_GETBCSTADDR 506 /*%< "%s: getting broadcast address: %s" */ #define ISC_MSG_GETIFLISTSIZE 601 /*%< "getting interface list size: ..." */ #define ISC_MSG_GETIFLIST 602 /*%< "getting interface list: ..." */ #define ISC_MSG_UNEXPECTEDTYPE 603 /*%< "... unexpected ... message type" */ #define ISC_MSG_UNEXPECTEDSTATE 701 /*%< "Unexpected state %d" */ #define ISC_MSG_BADTIME 801 /*%< "Bad 00 99:99:99.999 " */ #define ISC_MSG_LEVEL 802 /*%< "level %d: " */ #define ISC_MSG_ADDTRACE 901 /*%< "add %p size %u " */ #define ISC_MSG_DELTRACE 902 /*%< "del %p size %u " */ #define ISC_MSG_POOLSTATS 903 /*%< "[Pool statistics]\n" */ #define ISC_MSG_POOLNAME 904 /*%< "name" */ #define ISC_MSG_POOLSIZE 905 /*%< "size" */ #define ISC_MSG_POOLMAXALLOC 906 /*%< "maxalloc" */ #define ISC_MSG_POOLALLOCATED 907 /*%< "allocated" */ #define ISC_MSG_POOLFREECOUNT 908 /*%< "freecount" */ #define ISC_MSG_POOLFREEMAX 909 /*%< "freemax" */ #define ISC_MSG_POOLFILLCOUNT 910 /*%< "fillcount" */ #define ISC_MSG_POOLGETS 911 /*%< "gets" */ #define ISC_MSG_DUMPALLOC 912 /*%< "DUMP OF ALL OUTSTANDING MEMORY ..." */ #define ISC_MSG_NONE 913 /*%< "\tNone.\n" */ #define ISC_MSG_PTRFILELINE 914 /*%< "\tptr %p file %s line %u\n" */ #define ISC_MSG_UNKNOWNADDR 1001 /*%< "" */ #define ISC_MSG_NOLONGDBL 1104 /*%< "long doubles are not supported" */ #define ISC_MSG_PRINTLOCK 1201 /*%< "rwlock %p thread %lu ..." */ #define ISC_MSG_READ 1202 /*%< "read" */ #define ISC_MSG_WRITE 1203 /*%< "write" */ #define ISC_MSG_READING 1204 /*%< "reading" */ #define ISC_MSG_WRITING 1205 /*%< "writing" */ #define ISC_MSG_PRELOCK 1206 /*%< "prelock" */ #define ISC_MSG_POSTLOCK 1207 /*%< "postlock" */ #define ISC_MSG_PREUNLOCK 1208 /*%< "preunlock" */ #define ISC_MSG_POSTUNLOCK 1209 /*%< "postunlock" */ #define ISC_MSG_UNKNOWNFAMILY 1301 /*%< "unknown address family: %d" */ #define ISC_MSG_WRITEFAILED 1401 /*%< "write() failed during watcher ..." */ #define ISC_MSG_READFAILED 1402 /*%< "read() failed during watcher ... " */ #define ISC_MSG_PROCESSCMSG 1403 /*%< "processing cmsg %p" */ #define ISC_MSG_IFRECEIVED 1404 /*%< "interface received on ifindex %u" */ #define ISC_MSG_SENDTODATA 1405 /*%< "sendto pktinfo data, ifindex %u" */ #define ISC_MSG_DOIORECV 1406 /*%< "doio_recv: recvmsg(%d) %d bytes ..." */ #define ISC_MSG_PKTRECV 1407 /*%< "packet received correctly" */ #define ISC_MSG_DESTROYING 1408 /*%< "destroying" */ #define ISC_MSG_CREATED 1409 /*%< "created" */ #define ISC_MSG_ACCEPTLOCK 1410 /*%< "internal_accept called, locked ..." */ #define ISC_MSG_ACCEPTEDCXN 1411 /*%< "accepted connection, new socket %p" */ #define ISC_MSG_INTERNALRECV 1412 /*%< "internal_recv: task %p got event %p" */ #define ISC_MSG_INTERNALSEND 1413 /*%< "internal_send: task %p got event %p" */ #define ISC_MSG_WATCHERMSG 1414 /*%< "watcher got message %d" */ #define ISC_MSG_SOCKETSREMAIN 1415 /*%< "sockets exist" */ #define ISC_MSG_PKTINFOPROVIDED 1416 /*%< "pktinfo structure provided, ..." */ #define ISC_MSG_BOUND 1417 /*%< "bound" */ #define ISC_MSG_ACCEPTRETURNED 1418 /*%< accept() returned %d/%s */ #define ISC_MSG_TOOMANYFDS 1419 /*%< %s: too many open file descriptors */ #define ISC_MSG_ZEROPORT 1420 /*%< dropping source port zero packet */ #define ISC_MSG_FILTER 1421 /*%< setsockopt(SO_ACCEPTFILTER): %s */ #define ISC_MSG_TOOMANYHANDLES 1422 /*%< %s: too many open WSA event handles: %s */ #define ISC_MSG_AWAKE 1502 /*%< "awake" */ #define ISC_MSG_WORKING 1503 /*%< "working" */ #define ISC_MSG_EXECUTE 1504 /*%< "execute action" */ #define ISC_MSG_EMPTY 1505 /*%< "empty" */ #define ISC_MSG_DONE 1506 /*%< "done" */ #define ISC_MSG_QUANTUM 1507 /*%< "quantum" */ #define ISC_MSG_SCHEDULE 1601 /*%< "schedule" */ #define ISC_MSG_SIGNALSCHED 1602 /*%< "signal (schedule)" */ #define ISC_MSG_SIGNALDESCHED 1603 /*%< "signal (deschedule)" */ #define ISC_MSG_SIGNALDESTROY 1604 /*%< "signal (destroy)" */ #define ISC_MSG_IDLERESCHED 1605 /*%< "idle reschedule" */ #define ISC_MSG_EVENTNOTALLOC 1606 /*%< "couldn't allocate event" */ #define ISC_MSG_SCHEDFAIL 1607 /*%< "couldn't schedule timer: %u" */ #define ISC_MSG_POSTING 1608 /*%< "posting" */ #define ISC_MSG_WAKEUP 1609 /*%< "wakeup" */ #define ISC_MSG_LOCK 1701 /*%< "LOCK" */ #define ISC_MSG_LOCKING 1702 /*%< "LOCKING" */ #define ISC_MSG_LOCKED 1703 /*%< "LOCKED" */ #define ISC_MSG_UNLOCKED 1704 /*%< "UNLOCKED" */ #define ISC_MSG_RWLOCK 1705 /*%< "RWLOCK" */ #define ISC_MSG_RWLOCKED 1706 /*%< "RWLOCKED" */ #define ISC_MSG_RWUNLOCK 1707 /*%< "RWUNLOCK" */ #define ISC_MSG_BROADCAST 1708 /*%< "BROADCAST" */ #define ISC_MSG_SIGNAL 1709 /*%< "SIGNAL" */ #define ISC_MSG_UTILWAIT 1710 /*%< "WAIT" */ #define ISC_MSG_WAITED 1711 /*%< "WAITED" */ #define ISC_MSG_GETIFADDRS 1801 /*%< "getting interface addresses: ..." */ /*@}*/ #endif /* ISC_MSGS_H */ ntp-4.2.6p5/lib/isc/include/isc/mutexblock.h0000644000175000017500000000355611307651603017677 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: mutexblock.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_MUTEXBLOCK_H #define ISC_MUTEXBLOCK_H 1 /*! \file isc/mutexblock.h */ #include #include #include ISC_LANG_BEGINDECLS isc_result_t isc_mutexblock_init(isc_mutex_t *block, unsigned int count); /*%< * Initialize a block of locks. If an error occurs all initialized locks * will be destroyed, if possible. * * Requires: * *\li block != NULL * *\li count > 0 * * Returns: * *\li Any code isc_mutex_init() can return is a valid return for this * function. */ isc_result_t isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count); /*%< * Destroy a block of locks. * * Requires: * *\li block != NULL * *\li count > 0 * *\li Each lock in the block be initialized via isc_mutex_init() or * the whole block was initialized via isc_mutex_initblock(). * * Returns: * *\li Any code isc_mutex_init() can return is a valid return for this * function. */ ISC_LANG_ENDDECLS #endif /* ISC_MUTEXBLOCK_H */ ntp-4.2.6p5/lib/isc/include/isc/magic.h0000644000175000017500000000267711307651603016605 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: magic.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_MAGIC_H #define ISC_MAGIC_H 1 /*! \file isc/magic.h */ typedef struct { unsigned int magic; } isc__magic_t; /*% * To use this macro the magic number MUST be the first thing in the * structure, and MUST be of type "unsigned int". * The intent of this is to allow magic numbers to be checked even though * the object is otherwise opaque. */ #define ISC_MAGIC_VALID(a,b) (((a) != NULL) && \ (((const isc__magic_t *)(a))->magic == (b))) #define ISC_MAGIC(a, b, c, d) ((a) << 24 | (b) << 16 | (c) << 8 | (d)) #endif /* ISC_MAGIC_H */ ntp-4.2.6p5/lib/isc/include/isc/base64.h0000644000175000017500000000562711307651603016607 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: base64.h,v 1.22 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_BASE64_H #define ISC_BASE64_H 1 /*! \file isc/base64.h */ #include #include ISC_LANG_BEGINDECLS /*** *** Functions ***/ isc_result_t isc_base64_totext(isc_region_t *source, int wordlength, const char *wordbreak, isc_buffer_t *target); /*!< * \brief Convert data into base64 encoded text. * * Notes: *\li The base64 encoded text in 'target' will be divided into * words of at most 'wordlength' characters, separated by * the 'wordbreak' string. No parentheses will surround * the text. * * Requires: *\li 'source' is a region containing binary data *\li 'target' is a text buffer containing available space *\li 'wordbreak' points to a null-terminated string of * zero or more whitespace characters * * Ensures: *\li target will contain the base64 encoded version of the data * in source. The 'used' pointer in target will be advanced as * necessary. */ isc_result_t isc_base64_decodestring(const char *cstr, isc_buffer_t *target); /*!< * \brief Decode a null-terminated base64 string. * * Requires: *\li 'cstr' is non-null. *\li 'target' is a valid buffer. * * Returns: *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring' * fit in 'target'. *\li #ISC_R_BADBASE64 -- 'cstr' is not a valid base64 encoding. * * Other error returns are any possible error code from: *\li isc_lex_create(), *\li isc_lex_openbuffer(), *\li isc_base64_tobuffer(). */ isc_result_t isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); /*!< * \brief Convert base64 encoded text from a lexer context into data. * * Requires: *\li 'lex' is a valid lexer context *\li 'target' is a buffer containing binary data *\li 'length' is an integer * * Ensures: *\li target will contain the data represented by the base64 encoded * string parsed by the lexer. No more than length bytes will be read, * if length is positive. The 'used' pointer in target will be * advanced as necessary. */ ISC_LANG_ENDDECLS #endif /* ISC_BASE64_H */ ntp-4.2.6p5/lib/isc/include/isc/platform.h0000644000175000017500000000241611307651605017342 0ustar peterpeter/* * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* $Id: platform.h.in,v 1.28 2001/11/19 03:08:26 mayer Exp $ */ #ifndef ISC_PLATFORM_H #define ISC_PLATFORM_H 1 #ifndef ISC_PLATFORM_USEDECLSPEC #define LIBISC_EXTERNAL_DATA #define LIBDNS_EXTERNAL_DATA #define LIBISCCC_EXTERNAL_DATA #define LIBISCCFG_EXTERNAL_DATA #define LIBBIND9_EXTERNAL_DATA #endif /* ISC_PLATFORM_USEDECLSPEC */ /* * Tell emacs to use C mode for this file. * * Local Variables: * mode: c * End: */ #endif /* ISC_PLATFORM_H */ ntp-4.2.6p5/lib/isc/include/isc/timer.h0000644000175000017500000002032711307651603016635 0ustar peterpeter/* * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: timer.h,v 1.40 2008/06/23 23:47:11 tbox Exp $ */ #ifndef ISC_TIMER_H #define ISC_TIMER_H 1 /***** ***** Module Info *****/ /*! \file isc/timer.h * \brief Provides timers which are event sources in the task system. * * Three types of timers are supported: * *\li 'ticker' timers generate a periodic tick event. * *\li 'once' timers generate an idle timeout event if they are idle for too * long, and generate a life timeout event if their lifetime expires. * They are used to implement both (possibly expiring) idle timers and * 'one-shot' timers. * *\li 'limited' timers generate a periodic tick event until they reach * their lifetime when they generate a life timeout event. * *\li 'inactive' timers generate no events. * * Timers can change type. It is typical to create a timer as * an 'inactive' timer and then change it into a 'ticker' or * 'once' timer. * *\li MP: * The module ensures appropriate synchronization of data structures it * creates and manipulates. * Clients of this module must not be holding a timer's task's lock when * making a call that affects that timer. Failure to follow this rule * can result in deadlock. * The caller must ensure that isc_timermgr_destroy() is called only * once for a given manager. * * \li Reliability: * No anticipated impact. * * \li Resources: * TBS * * \li Security: * No anticipated impact. * * \li Standards: * None. */ /*** *** Imports ***/ #include #include #include #include #include ISC_LANG_BEGINDECLS /*** *** Types ***/ /*% Timer Type */ typedef enum { isc_timertype_ticker = 0, /*%< Ticker */ isc_timertype_once = 1, /*%< Once */ isc_timertype_limited = 2, /*%< Limited */ isc_timertype_inactive = 3 /*%< Inactive */ } isc_timertype_t; typedef struct isc_timerevent { struct isc_event common; isc_time_t due; } isc_timerevent_t; #define ISC_TIMEREVENT_FIRSTEVENT (ISC_EVENTCLASS_TIMER + 0) #define ISC_TIMEREVENT_TICK (ISC_EVENTCLASS_TIMER + 1) #define ISC_TIMEREVENT_IDLE (ISC_EVENTCLASS_TIMER + 2) #define ISC_TIMEREVENT_LIFE (ISC_EVENTCLASS_TIMER + 3) #define ISC_TIMEREVENT_LASTEVENT (ISC_EVENTCLASS_TIMER + 65535) /*** *** Timer and Timer Manager Functions *** *** Note: all Ensures conditions apply only if the result is success for *** those functions which return an isc_result_t. ***/ isc_result_t isc_timer_create(isc_timermgr_t *manager, isc_timertype_t type, isc_time_t *expires, isc_interval_t *interval, isc_task_t *task, isc_taskaction_t action, const void *arg, isc_timer_t **timerp); /*%< * Create a new 'type' timer managed by 'manager'. The timers parameters * are specified by 'expires' and 'interval'. Events will be posted to * 'task' and when dispatched 'action' will be called with 'arg' as the * arg value. The new timer is returned in 'timerp'. * * Notes: * *\li For ticker timers, the timer will generate a 'tick' event every * 'interval' seconds. The value of 'expires' is ignored. * *\li For once timers, 'expires' specifies the time when a life timeout * event should be generated. If 'expires' is 0 (the epoch), then no life * timeout will be generated. 'interval' specifies how long the timer * can be idle before it generates an idle timeout. If 0, then no * idle timeout will be generated. * *\li If 'expires' is NULL, the epoch will be used. * * If 'interval' is NULL, the zero interval will be used. * * Requires: * *\li 'manager' is a valid manager * *\li 'task' is a valid task * *\li 'action' is a valid action * *\li 'expires' points to a valid time, or is NULL. * *\li 'interval' points to a valid interval, or is NULL. * *\li type == isc_timertype_inactive || * ('expires' and 'interval' are not both 0) * *\li 'timerp' is a valid pointer, and *timerp == NULL * * Ensures: * *\li '*timerp' is attached to the newly created timer * *\li The timer is attached to the task * *\li An idle timeout will not be generated until at least Now + the * timer's interval if 'timer' is a once timer with a non-zero * interval. * * Returns: * *\li Success *\li No memory *\li Unexpected error */ isc_result_t isc_timer_reset(isc_timer_t *timer, isc_timertype_t type, isc_time_t *expires, isc_interval_t *interval, isc_boolean_t purge); /*%< * Change the timer's type, expires, and interval values to the given * values. If 'purge' is TRUE, any pending events from this timer * are purged from its task's event queue. * * Notes: * *\li If 'expires' is NULL, the epoch will be used. * *\li If 'interval' is NULL, the zero interval will be used. * * Requires: * *\li 'timer' is a valid timer * *\li The same requirements that isc_timer_create() imposes on 'type', * 'expires' and 'interval' apply. * * Ensures: * *\li An idle timeout will not be generated until at least Now + the * timer's interval if 'timer' is a once timer with a non-zero * interval. * * Returns: * *\li Success *\li No memory *\li Unexpected error */ isc_result_t isc_timer_touch(isc_timer_t *timer); /*%< * Set the last-touched time of 'timer' to the current time. * * Requires: * *\li 'timer' is a valid once timer. * * Ensures: * *\li An idle timeout will not be generated until at least Now + the * timer's interval if 'timer' is a once timer with a non-zero * interval. * * Returns: * *\li Success *\li Unexpected error */ void isc_timer_attach(isc_timer_t *timer, isc_timer_t **timerp); /*%< * Attach *timerp to timer. * * Requires: * *\li 'timer' is a valid timer. * *\li 'timerp' points to a NULL timer. * * Ensures: * *\li *timerp is attached to timer. */ void isc_timer_detach(isc_timer_t **timerp); /*%< * Detach *timerp from its timer. * * Requires: * *\li 'timerp' points to a valid timer. * * Ensures: * *\li *timerp is NULL. * *\li If '*timerp' is the last reference to the timer, * then: * *\code * The timer will be shutdown * * The timer will detach from its task * * All resources used by the timer have been freed * * Any events already posted by the timer will be purged. * Therefore, if isc_timer_detach() is called in the context * of the timer's task, it is guaranteed that no more * timer event callbacks will run after the call. *\endcode */ isc_timertype_t isc_timer_gettype(isc_timer_t *timer); /*%< * Return the timer type. * * Requires: * *\li 'timer' to be a valid timer. */ isc_result_t isc_timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp); /*%< * Create a timer manager. * * Notes: * *\li All memory will be allocated in memory context 'mctx'. * * Requires: * *\li 'mctx' is a valid memory context. * *\li 'managerp' points to a NULL isc_timermgr_t. * * Ensures: * *\li '*managerp' is a valid isc_timermgr_t. * * Returns: * *\li Success *\li No memory *\li Unexpected error */ void isc_timermgr_destroy(isc_timermgr_t **managerp); /*%< * Destroy a timer manager. * * Notes: * *\li This routine blocks until there are no timers left in the manager, * so if the caller holds any timer references using the manager, it * must detach them before calling isc_timermgr_destroy() or it will * block forever. * * Requires: * *\li '*managerp' is a valid isc_timermgr_t. * * Ensures: * *\li *managerp == NULL * *\li All resources used by the manager have been freed. */ void isc_timermgr_poke(isc_timermgr_t *m); ISC_LANG_ENDDECLS #endif /* ISC_TIMER_H */ ntp-4.2.6p5/lib/isc/include/isc/lex.h0000644000175000017500000002266511307651604016315 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: lex.h,v 1.37 2008/05/30 23:47:01 tbox Exp $ */ #ifndef ISC_LEX_H #define ISC_LEX_H 1 /***** ***** Module Info *****/ /*! \file isc/lex.h * \brief The "lex" module provides a lightweight tokenizer. It can operate * on files or buffers, and can handle "include". It is designed for * parsing of DNS master files and the BIND configuration file, but * should be general enough to tokenize other things, e.g. HTTP. * * \li MP: * No synchronization is provided. Clients must ensure exclusive * access. * * \li Reliability: * No anticipated impact. * * \li Resources: * TBS * * \li Security: * No anticipated impact. * * \li Standards: * None. */ /*** *** Imports ***/ #include #include #include #include ISC_LANG_BEGINDECLS /*** *** Options ***/ /*@{*/ /*! * Various options for isc_lex_gettoken(). */ #define ISC_LEXOPT_EOL 0x01 /*%< Want end-of-line token. */ #define ISC_LEXOPT_EOF 0x02 /*%< Want end-of-file token. */ #define ISC_LEXOPT_INITIALWS 0x04 /*%< Want initial whitespace. */ #define ISC_LEXOPT_NUMBER 0x08 /*%< Recognize numbers. */ #define ISC_LEXOPT_QSTRING 0x10 /*%< Recognize qstrings. */ /*@}*/ /*@{*/ /*! * The ISC_LEXOPT_DNSMULTILINE option handles the processing of '(' and ')' in * the DNS master file format. If this option is set, then the * ISC_LEXOPT_INITIALWS and ISC_LEXOPT_EOL options will be ignored when * the paren count is > 0. To use this option, '(' and ')' must be special * characters. */ #define ISC_LEXOPT_DNSMULTILINE 0x20 /*%< Handle '(' and ')'. */ #define ISC_LEXOPT_NOMORE 0x40 /*%< Want "no more" token. */ #define ISC_LEXOPT_CNUMBER 0x80 /*%< Recognize octal and hex. */ #define ISC_LEXOPT_ESCAPE 0x100 /*%< Recognize escapes. */ #define ISC_LEXOPT_QSTRINGMULTILINE 0x200 /*%< Allow multiline "" strings */ #define ISC_LEXOPT_OCTAL 0x400 /*%< Expect a octal number. */ /*@}*/ /*@{*/ /*! * Various commenting styles, which may be changed at any time with * isc_lex_setcomments(). */ #define ISC_LEXCOMMENT_C 0x01 #define ISC_LEXCOMMENT_CPLUSPLUS 0x02 #define ISC_LEXCOMMENT_SHELL 0x04 #define ISC_LEXCOMMENT_DNSMASTERFILE 0x08 /*@}*/ /*** *** Types ***/ /*! Lex */ typedef char isc_lexspecials_t[256]; /* Tokens */ typedef enum { isc_tokentype_unknown = 0, isc_tokentype_string = 1, isc_tokentype_number = 2, isc_tokentype_qstring = 3, isc_tokentype_eol = 4, isc_tokentype_eof = 5, isc_tokentype_initialws = 6, isc_tokentype_special = 7, isc_tokentype_nomore = 8 } isc_tokentype_t; typedef union { char as_char; unsigned long as_ulong; isc_region_t as_region; isc_textregion_t as_textregion; void * as_pointer; } isc_tokenvalue_t; typedef struct isc_token { isc_tokentype_t type; isc_tokenvalue_t value; } isc_token_t; /*** *** Functions ***/ isc_result_t isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp); /*%< * Create a lexer. * * 'max_token' is a hint of the number of bytes in the largest token. * * Requires: *\li '*lexp' is a valid lexer. * *\li max_token > 0. * * Ensures: *\li On success, *lexp is attached to the newly created lexer. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY */ void isc_lex_destroy(isc_lex_t **lexp); /*%< * Destroy the lexer. * * Requires: *\li '*lexp' is a valid lexer. * * Ensures: *\li *lexp == NULL */ unsigned int isc_lex_getcomments(isc_lex_t *lex); /*%< * Return the current lexer commenting styles. * * Requires: *\li 'lex' is a valid lexer. * * Returns: *\li The commenting sytles which are currently allowed. */ void isc_lex_setcomments(isc_lex_t *lex, unsigned int comments); /*%< * Set allowed lexer commenting styles. * * Requires: *\li 'lex' is a valid lexer. * *\li 'comments' has meaningful values. */ void isc_lex_getspecials(isc_lex_t *lex, isc_lexspecials_t specials); /*%< * Put the current list of specials into 'specials'. * * Requires: *\li 'lex' is a valid lexer. */ void isc_lex_setspecials(isc_lex_t *lex, isc_lexspecials_t specials); /*!< * The characters in 'specials' are returned as tokens. Along with * whitespace, they delimit strings and numbers. * * Note: *\li Comment processing takes precedence over special character * recognition. * * Requires: *\li 'lex' is a valid lexer. */ isc_result_t isc_lex_openfile(isc_lex_t *lex, const char *filename); /*%< * Open 'filename' and make it the current input source for 'lex'. * * Requires: *\li 'lex' is a valid lexer. * *\li filename is a valid C string. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY Out of memory *\li #ISC_R_NOTFOUND File not found *\li #ISC_R_NOPERM No permission to open file *\li #ISC_R_FAILURE Couldn't open file, not sure why *\li #ISC_R_UNEXPECTED */ isc_result_t isc_lex_openstream(isc_lex_t *lex, FILE *stream); /*%< * Make 'stream' the current input source for 'lex'. * * Requires: *\li 'lex' is a valid lexer. * *\li 'stream' is a valid C stream. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY Out of memory */ isc_result_t isc_lex_openbuffer(isc_lex_t *lex, isc_buffer_t *buffer); /*%< * Make 'buffer' the current input source for 'lex'. * * Requires: *\li 'lex' is a valid lexer. * *\li 'buffer' is a valid buffer. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY Out of memory */ isc_result_t isc_lex_close(isc_lex_t *lex); /*%< * Close the most recently opened object (i.e. file or buffer). * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOMORE No more input sources */ isc_result_t isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp); /*%< * Get the next token. * * Requires: *\li 'lex' is a valid lexer. * *\li 'lex' has an input source. * *\li 'options' contains valid options. * *\li '*tokenp' is a valid pointer. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_UNEXPECTEDEND *\li #ISC_R_NOMEMORY * * These two results are returned only if their corresponding lexer * options are not set. * *\li #ISC_R_EOF End of input source *\li #ISC_R_NOMORE No more input sources */ isc_result_t isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token, isc_tokentype_t expect, isc_boolean_t eol); /*%< * Get the next token from a DNS master file type stream. This is a * convenience function that sets appropriate options and handles quoted * strings and end of line correctly for master files. It also ungets * unexpected tokens. * * Requires: *\li 'lex' is a valid lexer. * *\li 'token' is a valid pointer * * Returns: * * \li any return code from isc_lex_gettoken(). */ isc_result_t isc_lex_getoctaltoken(isc_lex_t *lex, isc_token_t *token, isc_boolean_t eol); /*%< * Get the next token from a DNS master file type stream. This is a * convenience function that sets appropriate options and handles end * of line correctly for master files. It also ungets unexpected tokens. * * Requires: *\li 'lex' is a valid lexer. * *\li 'token' is a valid pointer * * Returns: * * \li any return code from isc_lex_gettoken(). */ void isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp); /*%< * Unget the current token. * * Requires: *\li 'lex' is a valid lexer. * *\li 'lex' has an input source. * *\li 'tokenp' points to a valid token. * *\li There is no ungotten token already. */ void isc_lex_getlasttokentext(isc_lex_t *lex, isc_token_t *tokenp, isc_region_t *r); /*%< * Returns a region containing the text of the last token returned. * * Requires: *\li 'lex' is a valid lexer. * *\li 'lex' has an input source. * *\li 'tokenp' points to a valid token. * *\li A token has been gotten and not ungotten. */ char * isc_lex_getsourcename(isc_lex_t *lex); /*%< * Return the input source name. * * Requires: *\li 'lex' is a valid lexer. * * Returns: * \li source name or NULL if no current source. *\li result valid while current input source exists. */ unsigned long isc_lex_getsourceline(isc_lex_t *lex); /*%< * Return the input source line number. * * Requires: *\li 'lex' is a valid lexer. * * Returns: *\li Current line number or 0 if no current source. */ isc_result_t isc_lex_setsourcename(isc_lex_t *lex, const char *name); /*%< * Assigns a new name to the input source. * * Requires: * * \li 'lex' is a valid lexer. * * Returns: * \li #ISC_R_SUCCESS * \li #ISC_R_NOMEMORY * \li #ISC_R_NOTFOUND - there are no sources. */ isc_boolean_t isc_lex_isfile(isc_lex_t *lex); /*%< * Return whether the current input source is a file. * * Requires: *\li 'lex' is a valid lexer. * * Returns: * \li #ISC_TRUE if the current input is a file, *\li #ISC_FALSE otherwise. */ ISC_LANG_ENDDECLS #endif /* ISC_LEX_H */ ntp-4.2.6p5/lib/isc/include/isc/platform.h.in0000644000175000017500000001677611307651604017764 0ustar peterpeter/* * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: platform.h.in,v 1.48.84.2 2009/02/16 23:47:15 tbox Exp $ */ #ifndef ISC_PLATFORM_H #define ISC_PLATFORM_H 1 /*! \file */ /***** ***** Platform-dependent defines. *****/ /*** *** Network. ***/ /*! \brief * Define if this system needs the header file included * for full IPv6 support (pretty much only UnixWare). */ @ISC_PLATFORM_NEEDNETINETIN6H@ /*! \brief * Define if this system needs the header file included * to support in6_pkinfo (pretty much only BSD/OS). */ @ISC_PLATFORM_NEEDNETINET6IN6H@ /*! \brief * If sockaddrs on this system have an sa_len field, ISC_PLATFORM_HAVESALEN * will be defined. */ @ISC_PLATFORM_HAVESALEN@ /*! \brief * If this system has the IPv6 structure definitions, ISC_PLATFORM_HAVEIPV6 * will be defined. */ @ISC_PLATFORM_HAVEIPV6@ /*! \brief * If this system is missing in6addr_any, ISC_PLATFORM_NEEDIN6ADDRANY will * be defined. */ @ISC_PLATFORM_NEEDIN6ADDRANY@ /*! \brief * If this system is missing in6addr_loopback, ISC_PLATFORM_NEEDIN6ADDRLOOPBACK * will be defined. */ @ISC_PLATFORM_NEEDIN6ADDRLOOPBACK@ /*! \brief * If this system has in6_pktinfo, ISC_PLATFORM_HAVEIN6PKTINFO will be * defined. */ @ISC_PLATFORM_HAVEIN6PKTINFO@ /*! \brief * If this system has in_addr6, rather than in6_addr, ISC_PLATFORM_HAVEINADDR6 * will be defined. */ @ISC_PLATFORM_HAVEINADDR6@ /*! \brief * If this system has sin6_scope_id, ISC_PLATFORM_HAVESCOPEID will be defined. */ @ISC_PLATFORM_HAVESCOPEID@ /*! \brief * If this system needs inet_ntop(), ISC_PLATFORM_NEEDNTOP will be defined. */ @ISC_PLATFORM_NEEDNTOP@ /*! \brief * If this system needs inet_pton(), ISC_PLATFORM_NEEDPTON will be defined. */ @ISC_PLATFORM_NEEDPTON@ /*! \brief * If this system needs in_port_t, ISC_PLATFORM_NEEDPORTT will be defined. */ @ISC_PLATFORM_NEEDPORTT@ /*! \brief * Define if the system has struct lifconf which is a extended struct ifconf * for IPv6. */ @ISC_PLATFORM_HAVELIFCONF@ /*! \brief * Define if the system has struct if_laddrconf which is a extended struct * ifconf for IPv6. */ @ISC_PLATFORM_HAVEIF_LADDRCONF@ /*! \brief * Define if the system has struct if_laddrreq. */ @ISC_PLATFORM_HAVEIF_LADDRREQ@ /*! \brief * Define either ISC_PLATFORM_BSD44MSGHDR or ISC_PLATFORM_BSD43MSGHDR. */ @ISC_PLATFORM_MSGHDRFLAVOR@ /*! \brief * Define if the system supports if_nametoindex. */ @ISC_PLATFORM_HAVEIFNAMETOINDEX@ /*! \brief * Define on some UnixWare systems to fix erroneous definitions of various * IN6_IS_ADDR_* macros. */ @ISC_PLATFORM_FIXIN6ISADDR@ /*! \brief * Define if the system supports kqueue multiplexing */ @ISC_PLATFORM_HAVEKQUEUE@ /*! \brief * Define if the system supports epoll multiplexing */ @ISC_PLATFORM_HAVEEPOLL@ /*! \brief * Define if the system supports /dev/poll multiplexing */ @ISC_PLATFORM_HAVEDEVPOLL@ /* *** Printing. ***/ /*! \brief * If this system needs vsnprintf() and snprintf(), ISC_PLATFORM_NEEDVSNPRINTF * will be defined. */ @ISC_PLATFORM_NEEDVSNPRINTF@ /*! \brief * If this system need a modern sprintf() that returns (int) not (char*). */ @ISC_PLATFORM_NEEDSPRINTF@ /*! \brief * The printf format string modifier to use with isc_uint64_t values. */ @ISC_PLATFORM_QUADFORMAT@ /*** *** String functions. ***/ /* * If the system needs strsep(), ISC_PLATFORM_NEEDSTRSEP will be defined. */ @ISC_PLATFORM_NEEDSTRSEP@ /* * If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined. */ @ISC_PLATFORM_NEEDSTRLCPY@ /* * If the system needs strlcat(), ISC_PLATFORM_NEEDSTRLCAT will be defined. */ @ISC_PLATFORM_NEEDSTRLCAT@ /* * Define if this system needs strtoul. */ @ISC_PLATFORM_NEEDSTRTOUL@ /* * Define if this system needs memmove. */ @ISC_PLATFORM_NEEDMEMMOVE@ /*** *** Miscellaneous. ***/ /* * Defined if we are using threads. */ @ISC_PLATFORM_USETHREADS@ /* * Defined if unistd.h does not cause fd_set to be delared. */ @ISC_PLATFORM_NEEDSYSSELECTH@ /* * Defined to or for how to include * the GSSAPI header. */ @ISC_PLATFORM_GSSAPIHEADER@ /* * Type used for resource limits. */ @ISC_PLATFORM_RLIMITTYPE@ /* * Define if your compiler supports "long long int". */ @ISC_PLATFORM_HAVELONGLONG@ /* * Define if PTHREAD_ONCE_INIT should be surrounded by braces to * prevent compiler warnings (such as with gcc on Solaris 2.8). */ @ISC_PLATFORM_BRACEPTHREADONCEINIT@ /* * Used to control how extern data is linked; needed for Win32 platforms. */ @ISC_PLATFORM_USEDECLSPEC@ /* * Define if the platform has . */ @ISC_PLATFORM_HAVESYSUNH@ /* * If the "xadd" operation is available on this architecture, * ISC_PLATFORM_HAVEXADD will be defined. */ @ISC_PLATFORM_HAVEXADD@ /* * If the "xaddq" operation (64bit xadd) is available on this architecture, * ISC_PLATFORM_HAVEXADDQ will be defined. */ @ISC_PLATFORM_HAVEXADDQ@ /* * If the "atomic swap" operation is available on this architecture, * ISC_PLATFORM_HAVEATOMICSTORE" will be defined. */ @ISC_PLATFORM_HAVEATOMICSTORE@ /* * If the "compare-and-exchange" operation is available on this architecture, * ISC_PLATFORM_HAVECMPXCHG will be defined. */ @ISC_PLATFORM_HAVECMPXCHG@ /* * Define if gcc ASM extension is available */ @ISC_PLATFORM_USEGCCASM@ /* * Define if Tru64 style ASM syntax must be used. */ @ISC_PLATFORM_USEOSFASM@ /* * Define if the standard __asm function must be used. */ @ISC_PLATFORM_USESTDASM@ /* * Define if the platform has . */ @ISC_PLATFORM_HAVESTRINGSH@ /*** *** Windows dll support. ***/ /* * Define if MacOS style of PPC assembly must be used. * e.g. "r6", not "6", for register six. */ @ISC_PLATFORM_USEMACASM@ #ifndef ISC_PLATFORM_USEDECLSPEC #define LIBISC_EXTERNAL_DATA #define LIBDNS_EXTERNAL_DATA #define LIBISCCC_EXTERNAL_DATA #define LIBISCCFG_EXTERNAL_DATA #define LIBBIND9_EXTERNAL_DATA #else /*! \brief ISC_PLATFORM_USEDECLSPEC */ #ifdef LIBISC_EXPORTS #define LIBISC_EXTERNAL_DATA __declspec(dllexport) #else #define LIBISC_EXTERNAL_DATA __declspec(dllimport) #endif #ifdef LIBDNS_EXPORTS #define LIBDNS_EXTERNAL_DATA __declspec(dllexport) #else #define LIBDNS_EXTERNAL_DATA __declspec(dllimport) #endif #ifdef LIBISCCC_EXPORTS #define LIBISCCC_EXTERNAL_DATA __declspec(dllexport) #else #define LIBISCCC_EXTERNAL_DATA __declspec(dllimport) #endif #ifdef LIBISCCFG_EXPORTS #define LIBISCCFG_EXTERNAL_DATA __declspec(dllexport) #else #define LIBISCCFG_EXTERNAL_DATA __declspec(dllimport) #endif #ifdef LIBBIND9_EXPORTS #define LIBBIND9_EXTERNAL_DATA __declspec(dllexport) #else #define LIBBIND9_EXTERNAL_DATA __declspec(dllimport) #endif #endif /*! \brief ISC_PLATFORM_USEDECLSPEC */ /* * Tell emacs to use C mode for this file. * * Local Variables: * mode: c * End: */ #endif /* ISC_PLATFORM_H */ ntp-4.2.6p5/lib/isc/include/isc/iterated_hash.h0000644000175000017500000000275011307651604020322 0ustar peterpeter/* * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: iterated_hash.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */ #ifndef ISC_ITERATED_HASH_H #define ISC_ITERATED_HASH_H 1 #include #include /* * The maximal hash length that can be encoded it a name * using base32hex. floor(255/8)*5 */ #define NSEC3_MAX_HASH_LENGTH 155 /* * The maximum has that can be encoded in a single label using * base32hex. floor(63/8)*5 */ #define NSEC3_MAX_LABEL_HASH 35 ISC_LANG_BEGINDECLS int isc_iterated_hash(unsigned char out[NSEC3_MAX_HASH_LENGTH], unsigned int hashalg, int iterations, const unsigned char *salt, int saltlength, const unsigned char *in, int inlength); ISC_LANG_ENDDECLS #endif /* ISC_ITERATED_HASH_H */ ntp-4.2.6p5/lib/isc/include/isc/hmacmd5.h0000644000175000017500000000344211307651603017032 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: hmacmd5.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */ /*! \file isc/hmacmd5.h * \brief This is the header file for the HMAC-MD5 keyed hash algorithm * described in RFC2104. */ #ifndef ISC_HMACMD5_H #define ISC_HMACMD5_H 1 #include #include #include #define ISC_HMACMD5_KEYLENGTH 64 typedef struct { isc_md5_t md5ctx; unsigned char key[ISC_HMACMD5_KEYLENGTH]; } isc_hmacmd5_t; ISC_LANG_BEGINDECLS void isc_hmacmd5_init(isc_hmacmd5_t *ctx, const unsigned char *key, unsigned int len); void isc_hmacmd5_invalidate(isc_hmacmd5_t *ctx); void isc_hmacmd5_update(isc_hmacmd5_t *ctx, const unsigned char *buf, unsigned int len); void isc_hmacmd5_sign(isc_hmacmd5_t *ctx, unsigned char *digest); isc_boolean_t isc_hmacmd5_verify(isc_hmacmd5_t *ctx, unsigned char *digest); isc_boolean_t isc_hmacmd5_verify2(isc_hmacmd5_t *ctx, unsigned char *digest, size_t len); ISC_LANG_ENDDECLS #endif /* ISC_HMACMD5_H */ ntp-4.2.6p5/lib/isc/include/isc/hex.h0000644000175000017500000000553711307651603016307 0ustar peterpeter/* * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: hex.h,v 1.13 2008/09/25 04:02:39 tbox Exp $ */ #ifndef ISC_HEX_H #define ISC_HEX_H 1 /*! \file isc/hex.h */ #include #include ISC_LANG_BEGINDECLS /*** *** Functions ***/ isc_result_t isc_hex_totext(isc_region_t *source, int wordlength, const char *wordbreak, isc_buffer_t *target); /*!< * \brief Convert data into hex encoded text. * * Notes: *\li The hex encoded text in 'target' will be divided into * words of at most 'wordlength' characters, separated by * the 'wordbreak' string. No parentheses will surround * the text. * * Requires: *\li 'source' is a region containing binary data *\li 'target' is a text buffer containing available space *\li 'wordbreak' points to a null-terminated string of * zero or more whitespace characters * * Ensures: *\li target will contain the hex encoded version of the data * in source. The 'used' pointer in target will be advanced as * necessary. */ isc_result_t isc_hex_decodestring(const char *cstr, isc_buffer_t *target); /*!< * \brief Decode a null-terminated hex string. * * Requires: *\li 'cstr' is non-null. *\li 'target' is a valid buffer. * * Returns: *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring' * fit in 'target'. *\li #ISC_R_BADHEX -- 'cstr' is not a valid hex encoding. * * Other error returns are any possible error code from: * isc_lex_create(), * isc_lex_openbuffer(), * isc_hex_tobuffer(). */ isc_result_t isc_hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); /*!< * \brief Convert hex encoded text from a lexer context into data. * * Requires: *\li 'lex' is a valid lexer context *\li 'target' is a buffer containing binary data *\li 'length' is an integer * * Ensures: *\li target will contain the data represented by the hex encoded * string parsed by the lexer. No more than length bytes will be read, * if length is positive. The 'used' pointer in target will be * advanced as necessary. */ ISC_LANG_ENDDECLS #endif /* ISC_HEX_H */ ntp-4.2.6p5/lib/isc/include/isc/log.h0000644000175000017500000007045211307651614016304 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: log.h,v 1.54.332.5 2009/02/16 02:04:05 marka Exp $ */ #ifndef ISC_LOG_H #define ISC_LOG_H 1 /*! \file isc/log.h */ #include #include #include /* XXXDCL NT */ #include #include #include #include /*@{*/ /*! * \brief Severity levels, patterned after Unix's syslog levels. * */ #define ISC_LOG_DEBUG(level) (level) /*! * #ISC_LOG_DYNAMIC can only be used for defining channels with * isc_log_createchannel(), not to specify a level in isc_log_write(). */ #define ISC_LOG_DYNAMIC 0 #define ISC_LOG_INFO (-1) #define ISC_LOG_NOTICE (-2) #define ISC_LOG_WARNING (-3) #define ISC_LOG_ERROR (-4) #define ISC_LOG_CRITICAL (-5) /*@}*/ /*@{*/ /*! * \brief Destinations. */ #define ISC_LOG_TONULL 1 #define ISC_LOG_TOSYSLOG 2 #define ISC_LOG_TOFILE 3 #define ISC_LOG_TOFILEDESC 4 /*@}*/ /*@{*/ /*% * Channel flags. */ #define ISC_LOG_PRINTTIME 0x0001 #define ISC_LOG_PRINTLEVEL 0x0002 #define ISC_LOG_PRINTCATEGORY 0x0004 #define ISC_LOG_PRINTMODULE 0x0008 #define ISC_LOG_PRINTTAG 0x0010 #define ISC_LOG_PRINTALL 0x001F #define ISC_LOG_DEBUGONLY 0x1000 #define ISC_LOG_OPENERR 0x8000 /* internal */ /*@}*/ /*@{*/ /*! * \brief Other options. * * XXXDCL INFINITE doesn't yet work. Arguably it isn't needed, but * since I am intend to make large number of versions work efficiently, * INFINITE is going to be trivial to add to that. */ #define ISC_LOG_ROLLINFINITE (-1) #define ISC_LOG_ROLLNEVER (-2) /*@}*/ /*! * \brief Used to name the categories used by a library. * * An array of isc_logcategory * structures names each category, and the id value is initialized by calling * isc_log_registercategories. */ struct isc_logcategory { const char *name; unsigned int id; }; /*% * Similar to isc_logcategory, but for all the modules a library defines. */ struct isc_logmodule { const char *name; unsigned int id; }; /*% * The isc_logfile structure is initialized as part of an isc_logdestination * before calling isc_log_createchannel(). * * When defining an #ISC_LOG_TOFILE * channel the name, versions and maximum_size should be set before calling * isc_log_createchannel(). To define an #ISC_LOG_TOFILEDESC channel set only * the stream before the call. * * Setting maximum_size to zero implies no maximum. */ typedef struct isc_logfile { FILE *stream; /*%< Initialized to NULL for #ISC_LOG_TOFILE. */ const char *name; /*%< NULL for #ISC_LOG_TOFILEDESC. */ int versions; /* >= 0, #ISC_LOG_ROLLNEVER, #ISC_LOG_ROLLINFINITE. */ /*% * stdio's ftell is standardized to return a long, which may well not * be big enough for the largest file supportable by the operating * system (though it is _probably_ big enough for the largest log * anyone would want). st_size returned by fstat should be typedef'd * to a size large enough for the largest possible file on a system. */ isc_offset_t maximum_size; isc_boolean_t maximum_reached; /*%< Private. */ } isc_logfile_t; /*% * Passed to isc_log_createchannel to define the attributes of either * a stdio or a syslog log. */ typedef union isc_logdestination { isc_logfile_t file; int facility; /* XXXDCL NT */ } isc_logdestination_t; /*@{*/ /*% * The built-in categories of libisc. * * Each library registering categories should provide library_LOGCATEGORY_name * definitions with indexes into its isc_logcategory structure corresponding to * the order of the names. */ LIBISC_EXTERNAL_DATA extern isc_logcategory_t isc_categories[]; LIBISC_EXTERNAL_DATA extern isc_log_t *isc_lctx; LIBISC_EXTERNAL_DATA extern isc_logmodule_t isc_modules[]; /*@}*/ /*@{*/ /*% * Do not log directly to DEFAULT. Use another category. When in doubt, * use GENERAL. */ #define ISC_LOGCATEGORY_DEFAULT (&isc_categories[0]) #define ISC_LOGCATEGORY_GENERAL (&isc_categories[1]) /*@}*/ #define ISC_LOGMODULE_SOCKET (&isc_modules[0]) #define ISC_LOGMODULE_TIME (&isc_modules[1]) #define ISC_LOGMODULE_INTERFACE (&isc_modules[2]) #define ISC_LOGMODULE_TIMER (&isc_modules[3]) #define ISC_LOGMODULE_FILE (&isc_modules[4]) ISC_LANG_BEGINDECLS isc_result_t isc_log_create(isc_mem_t *mctx, isc_log_t **lctxp, isc_logconfig_t **lcfgp); /*%< * Establish a new logging context, with default channels. * * Notes: *\li isc_log_create() calls isc_logconfig_create(), so see its comment * below for more information. * * Requires: *\li mctx is a valid memory context. *\li lctxp is not null and *lctxp is null. *\li lcfgp is null or lcfgp is not null and *lcfgp is null. * * Ensures: *\li *lctxp will point to a valid logging context if all of the necessary * memory was allocated, or NULL otherwise. *\li *lcfgp will point to a valid logging configuration if all of the * necessary memory was allocated, or NULL otherwise. *\li On failure, no additional memory is allocated. * * Returns: *\li #ISC_R_SUCCESS Success *\li #ISC_R_NOMEMORY Resource limit: Out of memory */ isc_result_t isc_logconfig_create(isc_log_t *lctx, isc_logconfig_t **lcfgp); /*%< * Create the data structure that holds all of the configurable information * about where messages are actually supposed to be sent -- the information * that could changed based on some configuration file, as opposed to the * the category/module specification of isc_log_[v]write[1] that is compiled * into a program, or the debug_level which is dynamic state information. * * Notes: *\li It is necessary to specify the logging context the configuration * will be used with because the number of categories and modules * needs to be known in order to set the configuration. However, * the configuration is not used by the logging context until the * isc_logconfig_use function is called. * *\li The memory context used for operations that allocate memory for * the configuration is that of the logging context, as specified * in the isc_log_create call. * *\li Four default channels are established: *\verbatim * default_syslog * - log to syslog's daemon facility #ISC_LOG_INFO or higher * default_stderr * - log to stderr #ISC_LOG_INFO or higher * default_debug * - log to stderr #ISC_LOG_DEBUG dynamically * null * - log nothing *\endverbatim * * Requires: *\li lctx is a valid logging context. *\li lcftp is not null and *lcfgp is null. * * Ensures: *\li *lcfgp will point to a valid logging context if all of the necessary * memory was allocated, or NULL otherwise. *\li On failure, no additional memory is allocated. * * Returns: *\li #ISC_R_SUCCESS Success *\li #ISC_R_NOMEMORY Resource limit: Out of memory */ isc_logconfig_t * isc_logconfig_get(isc_log_t *lctx); /*%< * Returns a pointer to the configuration currently in use by the log context. * * Requires: *\li lctx is a valid context. * * Ensures: *\li The configuration pointer is non-null. * * Returns: *\li The configuration pointer. */ isc_result_t isc_logconfig_use(isc_log_t *lctx, isc_logconfig_t *lcfg); /*%< * Associate a new configuration with a logging context. * * Notes: *\li This is thread safe. The logging context will lock a mutex * before attempting to swap in the new configuration, and isc_log_doit * (the internal function used by all of isc_log_[v]write[1]) locks * the same lock for the duration of its use of the configuration. * * Requires: *\li lctx is a valid logging context. *\li lcfg is a valid logging configuration. *\li lctx is the same configuration given to isc_logconfig_create * when the configuration was created. * * Ensures: *\li Future calls to isc_log_write will use the new configuration. * * Returns: *\li #ISC_R_SUCCESS Success *\li #ISC_R_NOMEMORY Resource limit: Out of memory */ void isc_log_destroy(isc_log_t **lctxp); /*%< * Deallocate the memory associated with a logging context. * * Requires: *\li *lctx is a valid logging context. * * Ensures: *\li All of the memory associated with the logging context is returned * to the free memory pool. * *\li Any open files are closed. * *\li The logging context is marked as invalid. */ void isc_logconfig_destroy(isc_logconfig_t **lcfgp); /*%< * Destroy a logging configuration. * * Notes: *\li This function cannot be used directly with the return value of * isc_logconfig_get, because a logging context must always have * a valid configuration associated with it. * * Requires: *\li lcfgp is not null and *lcfgp is a valid logging configuration. *\li The logging configuration is not in use by an existing logging context. * * Ensures: *\li All memory allocated for the configuration is freed. * *\li The configuration is marked as invalid. */ void isc_log_registercategories(isc_log_t *lctx, isc_logcategory_t categories[]); /*%< * Identify logging categories a library will use. * * Notes: *\li A category should only be registered once, but no mechanism enforces * this rule. * *\li The end of the categories array is identified by a NULL name. * *\li Because the name is used by #ISC_LOG_PRINTCATEGORY, it should not * be altered or destroyed after isc_log_registercategories(). * *\li Because each element of the categories array is used by * isc_log_categorybyname, it should not be altered or destroyed * after registration. * *\li The value of the id integer in each structure is overwritten * by this function, and so id need not be initialized to any particular * value prior to the function call. * *\li A subsequent call to isc_log_registercategories with the same * logging context (but new categories) will cause the last * element of the categories array from the prior call to have * its "name" member changed from NULL to point to the new * categories array, and its "id" member set to UINT_MAX. * * Requires: *\li lctx is a valid logging context. *\li categories != NULL. *\li categories[0].name != NULL. * * Ensures: * \li There are references to each category in the logging context, * so they can be used with isc_log_usechannel() and isc_log_write(). */ void isc_log_registermodules(isc_log_t *lctx, isc_logmodule_t modules[]); /*%< * Identify logging categories a library will use. * * Notes: *\li A module should only be registered once, but no mechanism enforces * this rule. * *\li The end of the modules array is identified by a NULL name. * *\li Because the name is used by #ISC_LOG_PRINTMODULE, it should not * be altered or destroyed after isc_log_registermodules(). * *\li Because each element of the modules array is used by * isc_log_modulebyname, it should not be altered or destroyed * after registration. * *\li The value of the id integer in each structure is overwritten * by this function, and so id need not be initialized to any particular * value prior to the function call. * *\li A subsequent call to isc_log_registermodules with the same * logging context (but new modules) will cause the last * element of the modules array from the prior call to have * its "name" member changed from NULL to point to the new * modules array, and its "id" member set to UINT_MAX. * * Requires: *\li lctx is a valid logging context. *\li modules != NULL. *\li modules[0].name != NULL; * * Ensures: *\li Each module has a reference in the logging context, so they can be * used with isc_log_usechannel() and isc_log_write(). */ isc_result_t isc_log_createchannel(isc_logconfig_t *lcfg, const char *name, unsigned int type, int level, const isc_logdestination_t *destination, unsigned int flags); /*%< * Specify the parameters of a logging channel. * * Notes: *\li The name argument is copied to memory in the logging context, so * it can be altered or destroyed after isc_log_createchannel(). * *\li Defining a very large number of channels will have a performance * impact on isc_log_usechannel(), since the names are searched * linearly until a match is made. This same issue does not affect * isc_log_write, however. * *\li Channel names can be redefined; this is primarily useful for programs * that want their own definition of default_syslog, default_debug * and default_stderr. * *\li Any channel that is redefined will not affect logging that was * already directed to its original definition, _except_ for the * default_stderr channel. This case is handled specially so that * the default logging category can be changed by redefining * default_stderr. (XXXDCL Though now that I think of it, the default * logging category can be changed with only one additional function * call by defining a new channel and then calling isc_log_usechannel() * for #ISC_LOGCATEGORY_DEFAULT.) * *\li Specifying #ISC_LOG_PRINTTIME or #ISC_LOG_PRINTTAG for syslog is allowed, * but probably not what you wanted to do. * * #ISC_LOG_DEBUGONLY will mark the channel as usable only when the * debug level of the logging context (see isc_log_setdebuglevel) * is non-zero. * * Requires: *\li lcfg is a valid logging configuration. * *\li name is not NULL. * *\li type is #ISC_LOG_TOSYSLOG, #ISC_LOG_TOFILE, #ISC_LOG_TOFILEDESC or * #ISC_LOG_TONULL. * *\li destination is not NULL unless type is #ISC_LOG_TONULL. * *\li level is >= #ISC_LOG_CRITICAL (the most negative logging level). * *\li flags does not include any bits aside from the ISC_LOG_PRINT* bits * or #ISC_LOG_DEBUGONLY. * * Ensures: *\li #ISC_R_SUCCESS * A channel with the given name is usable with * isc_log_usechannel(). * *\li #ISC_R_NOMEMORY or #ISC_R_UNEXPECTED * No additional memory is being used by the logging context. * Any channel that previously existed with the given name * is not redefined. * * Returns: *\li #ISC_R_SUCCESS Success *\li #ISC_R_NOMEMORY Resource limit: Out of memory *\li #ISC_R_UNEXPECTED type was out of range and REQUIRE() * was disabled. */ isc_result_t isc_log_usechannel(isc_logconfig_t *lcfg, const char *name, const isc_logcategory_t *category, const isc_logmodule_t *module); /*%< * Associate a named logging channel with a category and module that * will use it. * * Notes: *\li The name is searched for linearly in the set of known channel names * until a match is found. (Note the performance impact of a very large * number of named channels.) When multiple channels of the same * name are defined, the most recent definition is found. * *\li Specifying a very large number of channels for a category will have * a moderate impact on performance in isc_log_write(), as each * call looks up the category for the start of a linked list, which * it follows all the way to the end to find matching modules. The * test for matching modules is integral, though. * *\li If category is NULL, then the channel is associated with the indicated * module for all known categories (including the "default" category). * *\li If module is NULL, then the channel is associated with every module * that uses that category. * *\li Passing both category and module as NULL would make every log message * use the indicated channel. * * \li Specifying a channel that is #ISC_LOG_TONULL for a category/module pair * has no effect on any other channels associated with that pair, * regardless of ordering. Thus you cannot use it to "mask out" one * category/module pair when you have specified some other channel that * is also used by that category/module pair. * * Requires: *\li lcfg is a valid logging configuration. * *\li category is NULL or has an id that is in the range of known ids. * * module is NULL or has an id that is in the range of known ids. * * Ensures: *\li #ISC_R_SUCCESS * The channel will be used by the indicated category/module * arguments. * *\li #ISC_R_NOMEMORY * If assignment for a specific category has been requested, * the channel has not been associated with the indicated * category/module arguments and no additional memory is * used by the logging context. * If assignment for all categories has been requested * then _some_ may have succeeded (starting with category * "default" and progressing through the order of categories * passed to isc_log_registercategories()) and additional memory * is being used by whatever assignments succeeded. * * Returns: *\li #ISC_R_SUCCESS Success *\li #ISC_R_NOMEMORY Resource limit: Out of memory */ /* Attention: next four comments PRECEED code */ /*! * \brief * Write a message to the log channels. * * Notes: *\li Log messages containing natural language text should be logged with * isc_log_iwrite() to allow for localization. * *\li lctx can be NULL; this is allowed so that programs which use * libraries that use the ISC logging system are not required to * also use it. * *\li The format argument is a printf(3) string, with additional arguments * as necessary. * * Requires: *\li lctx is a valid logging context. * *\li The category and module arguments must have ids that are in the * range of known ids, as established by isc_log_registercategories() * and isc_log_registermodules(). * *\li level != #ISC_LOG_DYNAMIC. ISC_LOG_DYNAMIC is used only to define * channels, and explicit debugging level must be identified for * isc_log_write() via ISC_LOG_DEBUG(level). * *\li format != NULL. * * Ensures: *\li The log message is written to every channel associated with the * indicated category/module pair. * * Returns: *\li Nothing. Failure to log a message is not construed as a * meaningful error. */ void isc_log_write(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *format, ...) ISC_FORMAT_PRINTF(5, 6); /*% * Write a message to the log channels. * * Notes: *\li lctx can be NULL; this is allowed so that programs which use * libraries that use the ISC logging system are not required to * also use it. * *\li The format argument is a printf(3) string, with additional arguments * as necessary. * * Requires: *\li lctx is a valid logging context. * *\li The category and module arguments must have ids that are in the * range of known ids, as established by isc_log_registercategories() * and isc_log_registermodules(). * *\li level != #ISC_LOG_DYNAMIC. ISC_LOG_DYNAMIC is used only to define * channels, and explicit debugging level must be identified for * isc_log_write() via ISC_LOG_DEBUG(level). * *\li format != NULL. * * Ensures: *\li The log message is written to every channel associated with the * indicated category/module pair. * * Returns: *\li Nothing. Failure to log a message is not construed as a * meaningful error. */ void isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *format, va_list args) ISC_FORMAT_PRINTF(5, 0); /*% * Write a message to the log channels, pruning duplicates that occur within * a configurable amount of seconds (see isc_log_[sg]etduplicateinterval). * This function is otherwise identical to isc_log_write(). */ void isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *format, ...) ISC_FORMAT_PRINTF(5, 6); /*% * Write a message to the log channels, pruning duplicates that occur within * a configurable amount of seconds (see isc_log_[sg]etduplicateinterval). * This function is otherwise identical to isc_log_vwrite(). */ void isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *format, va_list args) ISC_FORMAT_PRINTF(5, 0); /*% * These are four internationalized versions of the isc_log_[v]write[1] * functions. * * The only difference is that they take arguments for a message * catalog, message set, and message number, all immediately preceding the * format argument. The format argument becomes the default text, a la * isc_msgcat_get. If the message catalog is NULL, no lookup is attempted * for a message -- which makes the message set and message number irrelevant, * and the non-internationalized call should have probably been used instead. * * Yes, that means there are now *eight* interfaces to logging a message. * Sheesh. Make the madness stop! */ /*@{*/ void isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int message, const char *format, ...) ISC_FORMAT_PRINTF(8, 9); void isc_log_ivwrite(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int message, const char *format, va_list args) ISC_FORMAT_PRINTF(8, 0); void isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int message, const char *format, ...) ISC_FORMAT_PRINTF(8, 9); void isc_log_ivwrite1(isc_log_t *lctx, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int message, const char *format, va_list args) ISC_FORMAT_PRINTF(8, 0); /*@}*/ void isc_log_setdebuglevel(isc_log_t *lctx, unsigned int level); /*%< * Set the debugging level used for logging. * * Notes: *\li Setting the debugging level to 0 disables debugging log messages. * * Requires: *\li lctx is a valid logging context. * * Ensures: *\li The debugging level is set to the requested value. */ unsigned int isc_log_getdebuglevel(isc_log_t *lctx); /*%< * Get the current debugging level. * * Notes: *\li This is provided so that a program can have a notion of * "increment debugging level" or "decrement debugging level" * without needing to keep track of what the current level is. * *\li A return value of 0 indicates that debugging messages are disabled. * * Requires: *\li lctx is a valid logging context. * * Ensures: *\li The current logging debugging level is returned. */ isc_boolean_t isc_log_wouldlog(isc_log_t *lctx, int level); /*%< * Determine whether logging something to 'lctx' at 'level' would * actually cause something to be logged somewhere. * * If #ISC_FALSE is returned, it is guaranteed that nothing would * be logged, allowing the caller to omit unnecessary * isc_log_write() calls and possible message preformatting. */ void isc_log_setduplicateinterval(isc_logconfig_t *lcfg, unsigned int interval); /*%< * Set the interval over which duplicate log messages will be ignored * by isc_log_[v]write1(), in seconds. * * Notes: *\li Increasing the duplicate interval from X to Y will not necessarily * filter out duplicates of messages logged in Y - X seconds since the * increase. (Example: Message1 is logged at midnight. Message2 * is logged at 00:01:00, when the interval is only 30 seconds, causing * Message1 to be expired from the log message history. Then the interval * is increased to 3000 (five minutes) and at 00:04:00 Message1 is logged * again. It will appear the second time even though less than five * passed since the first occurrence. * * Requires: *\li lctx is a valid logging context. */ unsigned int isc_log_getduplicateinterval(isc_logconfig_t *lcfg); /*%< * Get the current duplicate filtering interval. * * Requires: *\li lctx is a valid logging context. * * Returns: *\li The current duplicate filtering interval. */ isc_result_t isc_log_settag(isc_logconfig_t *lcfg, const char *tag); /*%< * Set the program name or other identifier for #ISC_LOG_PRINTTAG. * * Requires: *\li lcfg is a valid logging configuration. * * Notes: *\li If this function has not set the tag to a non-NULL, non-empty value, * then the #ISC_LOG_PRINTTAG channel flag will not print anything. * Unlike some implementations of syslog on Unix systems, you *must* set * the tag in order to get it logged. It is not implicitly derived from * the program name (which is pretty impossible to infer portably). * *\li Setting the tag to NULL or the empty string will also cause the * #ISC_LOG_PRINTTAG channel flag to not print anything. If tag equals the * empty string, calls to isc_log_gettag will return NULL. * * Returns: *\li #ISC_R_SUCCESS Success *\li #ISC_R_NOMEMORY Resource Limit: Out of memory * * XXXDCL when creating a new isc_logconfig_t, it might be nice if the tag * of the currently active isc_logconfig_t was inherited. this does not * currently happen. */ char * isc_log_gettag(isc_logconfig_t *lcfg); /*%< * Get the current identifier printed with #ISC_LOG_PRINTTAG. * * Requires: *\li lcfg is a valid logging configuration. * * Notes: *\li Since isc_log_settag() will not associate a zero-length string * with the logging configuration, attempts to do so will cause * this function to return NULL. However, a determined programmer * will observe that (currently) a tag of length greater than zero * could be set, and then modified to be zero length. * * Returns: *\li A pointer to the current identifier, or NULL if none has been set. */ void isc_log_opensyslog(const char *tag, int options, int facility); /*%< * Initialize syslog logging. * * Notes: *\li XXXDCL NT * This is currently equivalent to openlog(), but is not going to remain * that way. In the meantime, the arguments are all identical to * those used by openlog(3), as follows: * * \code * tag: The string to use in the position of the program * name in syslog messages. Most (all?) syslogs * will use basename(argv[0]) if tag is NULL. * * options: LOG_CONS, LOG_PID, LOG_NDELAY ... whatever your * syslog supports. * * facility: The default syslog facility. This is irrelevant * since isc_log_write will ALWAYS use the channel's * declared facility. * \endcode * *\li Zero effort has been made (yet) to accommodate systems with openlog() * that only takes two arguments, or to identify valid syslog * facilities or options for any given architecture. * *\li It is necessary to call isc_log_opensyslog() to initialize * syslogging on machines which do not support network connections to * syslogd because they require a Unix domain socket to be used. Since * this is a chore to determine at run-time, it is suggested that it * always be called by programs using the ISC logging system. * * Requires: *\li Nothing. * * Ensures: *\li openlog() is called to initialize the syslog system. */ void isc_log_closefilelogs(isc_log_t *lctx); /*%< * Close all open files used by #ISC_LOG_TOFILE channels. * * Notes: *\li This function is provided for programs that want to use their own * log rolling mechanism rather than the one provided internally. * For example, a program that wanted to keep daily logs would define * a channel which used #ISC_LOG_ROLLNEVER, then once a day would * rename the log file and call isc_log_closefilelogs(). * *\li #ISC_LOG_TOFILEDESC channels are unaffected. * * Requires: *\li lctx is a valid context. * * Ensures: *\li The open files are closed and will be reopened when they are * next needed. */ isc_logcategory_t * isc_log_categorybyname(isc_log_t *lctx, const char *name); /*%< * Find a category by its name. * * Notes: *\li The string name of a category is not required to be unique. * * Requires: *\li lctx is a valid context. *\li name is not NULL. * * Returns: *\li A pointer to the _first_ isc_logcategory_t structure used by "name". * *\li NULL if no category exists by that name. */ isc_logmodule_t * isc_log_modulebyname(isc_log_t *lctx, const char *name); /*%< * Find a module by its name. * * Notes: *\li The string name of a module is not required to be unique. * * Requires: *\li lctx is a valid context. *\li name is not NULL. * * Returns: *\li A pointer to the _first_ isc_logmodule_t structure used by "name". * *\li NULL if no module exists by that name. */ void isc_log_setcontext(isc_log_t *lctx); /*%< * Sets the context used by the libisc for logging. * * Requires: *\li lctx be a valid context. */ ISC_LANG_ENDDECLS #endif /* ISC_LOG_H */ ntp-4.2.6p5/lib/isc/include/isc/mem.h0000644000175000017500000004140311307651605016273 0ustar peterpeter/* * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1997-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: mem.h,v 1.78.120.3 2009/02/11 03:07:01 jinmei Exp $ */ #ifndef ISC_MEM_H #define ISC_MEM_H 1 /*! \file isc/mem.h */ #include #include #include #include #include #include ISC_LANG_BEGINDECLS #define ISC_MEM_LOWATER 0 #define ISC_MEM_HIWATER 1 typedef void (*isc_mem_water_t)(void *, int); typedef void * (*isc_memalloc_t)(void *, size_t); typedef void (*isc_memfree_t)(void *, void *); /*% * Define ISC_MEM_DEBUG=1 to make all functions that free memory * set the pointer being freed to NULL after being freed. * This is the default; set ISC_MEM_DEBUG=0 to disable it. */ #ifndef ISC_MEM_DEBUG #define ISC_MEM_DEBUG 1 #endif /*% * Define ISC_MEM_TRACKLINES=1 to turn on detailed tracing of memory * allocation and freeing by file and line number. */ #ifndef ISC_MEM_TRACKLINES #define ISC_MEM_TRACKLINES 1 #endif /*% * Define ISC_MEM_CHECKOVERRUN=1 to turn on checks for using memory outside * the requested space. This will increase the size of each allocation. */ #ifndef ISC_MEM_CHECKOVERRUN #define ISC_MEM_CHECKOVERRUN 1 #endif /*% * Define ISC_MEM_FILL=1 to fill each block of memory returned to the system * with the byte string '0xbe'. This helps track down uninitialized pointers * and the like. On freeing memory, the space is filled with '0xde' for * the same reasons. */ #ifndef ISC_MEM_FILL #define ISC_MEM_FILL 1 #endif /*% * Define ISC_MEMPOOL_NAMES=1 to make memory pools store a symbolic * name so that the leaking pool can be more readily identified in * case of a memory leak. */ #ifndef ISC_MEMPOOL_NAMES #define ISC_MEMPOOL_NAMES 1 #endif LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging; /*@{*/ #define ISC_MEM_DEBUGTRACE 0x00000001U #define ISC_MEM_DEBUGRECORD 0x00000002U #define ISC_MEM_DEBUGUSAGE 0x00000004U #define ISC_MEM_DEBUGSIZE 0x00000008U #define ISC_MEM_DEBUGCTX 0x00000010U #define ISC_MEM_DEBUGALL 0x0000001FU /*!< * The variable isc_mem_debugging holds a set of flags for * turning certain memory debugging options on or off at * runtime. It is initialized to the value ISC_MEM_DEGBUGGING, * which is 0 by default but may be overridden at compile time. * The following flags can be specified: * * \li #ISC_MEM_DEBUGTRACE * Log each allocation and free to isc_lctx. * * \li #ISC_MEM_DEBUGRECORD * Remember each allocation, and match them up on free. * Crash if a free doesn't match an allocation. * * \li #ISC_MEM_DEBUGUSAGE * If a hi_water mark is set, print the maximum inuse memory * every time it is raised once it exceeds the hi_water mark. * * \li #ISC_MEM_DEBUGSIZE * Check the size argument being passed to isc_mem_put() matches * that passed to isc_mem_get(). * * \li #ISC_MEM_DEBUGCTX * Check the mctx argument being passed to isc_mem_put() matches * that passed to isc_mem_get(). */ /*@}*/ #if ISC_MEM_TRACKLINES #define _ISC_MEM_FILELINE , __FILE__, __LINE__ #define _ISC_MEM_FLARG , const char *, int #else #define _ISC_MEM_FILELINE #define _ISC_MEM_FLARG #endif /*! * Define ISC_MEM_USE_INTERNAL_MALLOC=1 to use the internal malloc() * implementation in preference to the system one. The internal malloc() * is very space-efficient, and quite fast on uniprocessor systems. It * performs poorly on multiprocessor machines. * JT: we can overcome the performance issue on multiprocessor machines * by carefully separating memory contexts. */ #ifndef ISC_MEM_USE_INTERNAL_MALLOC #define ISC_MEM_USE_INTERNAL_MALLOC 1 #endif /* * Flags for isc_mem_create2()calls. */ #define ISC_MEMFLAG_NOLOCK 0x00000001 /* no lock is necessary */ #define ISC_MEMFLAG_INTERNAL 0x00000002 /* use internal malloc */ #if ISC_MEM_USE_INTERNAL_MALLOC #define ISC_MEMFLAG_DEFAULT ISC_MEMFLAG_INTERNAL #else #define ISC_MEMFLAG_DEFAULT 0 #endif #define isc_mem_get(c, s) isc__mem_get((c), (s) _ISC_MEM_FILELINE) #define isc_mem_allocate(c, s) isc__mem_allocate((c), (s) _ISC_MEM_FILELINE) #define isc_mem_reallocate(c, p, s) isc__mem_reallocate((c), (p), (s) _ISC_MEM_FILELINE) #define isc_mem_strdup(c, p) isc__mem_strdup((c), (p) _ISC_MEM_FILELINE) #define isc_mempool_get(c) isc__mempool_get((c) _ISC_MEM_FILELINE) /*% * isc_mem_putanddetach() is a convenience function for use where you * have a structure with an attached memory context. * * Given: * * \code * struct { * ... * isc_mem_t *mctx; * ... * } *ptr; * * isc_mem_t *mctx; * * isc_mem_putanddetach(&ptr->mctx, ptr, sizeof(*ptr)); * \endcode * * is the equivalent of: * * \code * mctx = NULL; * isc_mem_attach(ptr->mctx, &mctx); * isc_mem_detach(&ptr->mctx); * isc_mem_put(mctx, ptr, sizeof(*ptr)); * isc_mem_detach(&mctx); * \endcode */ #if ISC_MEM_DEBUG #define isc_mem_put(c, p, s) \ do { \ isc__mem_put((c), (p), (s) _ISC_MEM_FILELINE); \ (p) = NULL; \ } while (0) #define isc_mem_putanddetach(c, p, s) \ do { \ isc__mem_putanddetach((c), (p), (s) _ISC_MEM_FILELINE); \ (p) = NULL; \ } while (0) #define isc_mem_free(c, p) \ do { \ isc__mem_free((c), (p) _ISC_MEM_FILELINE); \ (p) = NULL; \ } while (0) #define isc_mempool_put(c, p) \ do { \ isc__mempool_put((c), (p) _ISC_MEM_FILELINE); \ (p) = NULL; \ } while (0) #else #define isc_mem_put(c, p, s) isc__mem_put((c), (p), (s) _ISC_MEM_FILELINE) #define isc_mem_putanddetach(c, p, s) \ isc__mem_putanddetach((c), (p), (s) _ISC_MEM_FILELINE) #define isc_mem_free(c, p) isc__mem_free((c), (p) _ISC_MEM_FILELINE) #define isc_mempool_put(c, p) isc__mempool_put((c), (p) _ISC_MEM_FILELINE) #endif /*@{*/ isc_result_t isc_mem_create(size_t max_size, size_t target_size, isc_mem_t **mctxp); isc_result_t isc_mem_create2(size_t max_size, size_t target_size, isc_mem_t **mctxp, unsigned int flags); isc_result_t isc_mem_createx(size_t max_size, size_t target_size, isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg, isc_mem_t **mctxp); isc_result_t isc_mem_createx2(size_t max_size, size_t target_size, isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg, isc_mem_t **mctxp, unsigned int flags); /*!< * \brief Create a memory context. * * 'max_size' and 'target_size' are tuning parameters. When * ISC_MEMFLAG_INTERNAL is set, allocations smaller than 'max_size' * will be satisfied by getting blocks of size 'target_size' from the * system allocator and breaking them up into pieces; larger allocations * will use the system allocator directly. If 'max_size' and/or * 'target_size' are zero, default values will be * used. When * ISC_MEMFLAG_INTERNAL is not set, 'target_size' is ignored. * * 'max_size' is also used to size the statistics arrays and the array * used to record active memory when ISC_MEM_DEBUGRECORD is set. Settin * 'max_size' too low can have detrimental effects on performance. * * A memory context created using isc_mem_createx() will obtain * memory from the system by calling 'memalloc' and 'memfree', * passing them the argument 'arg'. A memory context created * using isc_mem_create() will use the standard library malloc() * and free(). * * If ISC_MEMFLAG_NOLOCK is set in 'flags', the corresponding memory context * will be accessed without locking. The user who creates the context must * ensure there be no race. Since this can be a source of bug, it is generally * inadvisable to use this flag unless the user is very sure about the race * condition and the access to the object is highly performance sensitive. * * Requires: * mctxp != NULL && *mctxp == NULL */ /*@}*/ /*@{*/ void isc_mem_attach(isc_mem_t *, isc_mem_t **); void isc_mem_detach(isc_mem_t **); /*!< * \brief Attach to / detach from a memory context. * * This is intended for applications that use multiple memory contexts * in such a way that it is not obvious when the last allocations from * a given context has been freed and destroying the context is safe. * * Most applications do not need to call these functions as they can * simply create a single memory context at the beginning of main() * and destroy it at the end of main(), thereby guaranteeing that it * is not destroyed while there are outstanding allocations. */ /*@}*/ void isc_mem_destroy(isc_mem_t **); /*%< * Destroy a memory context. */ isc_result_t isc_mem_ondestroy(isc_mem_t *ctx, isc_task_t *task, isc_event_t **event); /*%< * Request to be notified with an event when a memory context has * been successfully destroyed. */ void isc_mem_stats(isc_mem_t *mctx, FILE *out); /*%< * Print memory usage statistics for 'mctx' on the stream 'out'. */ void isc_mem_setdestroycheck(isc_mem_t *mctx, isc_boolean_t on); /*%< * If 'on' is ISC_TRUE, 'mctx' will check for memory leaks when * destroyed and abort the program if any are present. */ /*@{*/ void isc_mem_setquota(isc_mem_t *, size_t); size_t isc_mem_getquota(isc_mem_t *); /*%< * Set/get the memory quota of 'mctx'. This is a hard limit * on the amount of memory that may be allocated from mctx; * if it is exceeded, allocations will fail. */ /*@}*/ size_t isc_mem_inuse(isc_mem_t *mctx); /*%< * Get an estimate of the number of memory in use in 'mctx', in bytes. * This includes quantization overhead, but does not include memory * allocated from the system but not yet used. */ void isc_mem_setwater(isc_mem_t *mctx, isc_mem_water_t water, void *water_arg, size_t hiwater, size_t lowater); /*%< * Set high and low water marks for this memory context. * * When the memory usage of 'mctx' exceeds 'hiwater', * '(water)(water_arg, #ISC_MEM_HIWATER)' will be called. 'water' needs to * call isc_mem_waterack() with #ISC_MEM_HIWATER to acknowledge the state * change. 'water' may be called multiple times. * * When the usage drops below 'lowater', 'water' will again be called, this * time with #ISC_MEM_LOWATER. 'water' need to calls isc_mem_waterack() with * #ISC_MEM_LOWATER to acknowledge the change. * * static void * water(void *arg, int mark) { * struct foo *foo = arg; * * LOCK(&foo->marklock); * if (foo->mark != mark) { * foo->mark = mark; * .... * isc_mem_waterack(foo->mctx, mark); * } * UNLOCK(&foo->marklock); * } * * If 'water' is NULL then 'water_arg', 'hi_water' and 'lo_water' are * ignored and the state is reset. * * Requires: * * 'water' is not NULL. * hi_water >= lo_water */ void isc_mem_waterack(isc_mem_t *ctx, int mark); /*%< * Called to acknowledge changes in signaled by calls to 'water'. */ void isc_mem_printactive(isc_mem_t *mctx, FILE *file); /*%< * Print to 'file' all active memory in 'mctx'. * * Requires ISC_MEM_DEBUGRECORD to have been set. */ void isc_mem_printallactive(FILE *file); /*%< * Print to 'file' all active memory in all contexts. * * Requires ISC_MEM_DEBUGRECORD to have been set. */ void isc_mem_checkdestroyed(FILE *file); /*%< * Check that all memory contexts have been destroyed. * Prints out those that have not been. * Fatally fails if there are still active contexts. */ unsigned int isc_mem_references(isc_mem_t *ctx); /*%< * Return the current reference count. */ void isc_mem_setname(isc_mem_t *ctx, const char *name, void *tag); /*%< * Name 'ctx'. * * Notes: * *\li Only the first 15 characters of 'name' will be copied. * *\li 'tag' is for debugging purposes only. * * Requires: * *\li 'ctx' is a valid ctx. */ const char * isc_mem_getname(isc_mem_t *ctx); /*%< * Get the name of 'ctx', as previously set using isc_mem_setname(). * * Requires: *\li 'ctx' is a valid ctx. * * Returns: *\li A non-NULL pointer to a null-terminated string. * If the ctx has not been named, the string is * empty. */ void * isc_mem_gettag(isc_mem_t *ctx); /*%< * Get the tag value for 'task', as previously set using isc_mem_setname(). * * Requires: *\li 'ctx' is a valid ctx. * * Notes: *\li This function is for debugging purposes only. * * Requires: *\li 'ctx' is a valid task. */ #ifdef HAVE_LIBXML2 void isc_mem_renderxml(xmlTextWriterPtr writer); /*%< * Render all contexts' statistics and status in XML for writer. */ #endif /* HAVE_LIBXML2 */ /* * Memory pools */ isc_result_t isc_mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp); /*%< * Create a memory pool. * * Requires: *\li mctx is a valid memory context. *\li size > 0 *\li mpctxp != NULL and *mpctxp == NULL * * Defaults: *\li maxalloc = UINT_MAX *\li freemax = 1 *\li fillcount = 1 * * Returns: *\li #ISC_R_NOMEMORY -- not enough memory to create pool *\li #ISC_R_SUCCESS -- all is well. */ void isc_mempool_destroy(isc_mempool_t **mpctxp); /*%< * Destroy a memory pool. * * Requires: *\li mpctxp != NULL && *mpctxp is a valid pool. *\li The pool has no un"put" allocations outstanding */ void isc_mempool_setname(isc_mempool_t *mpctx, const char *name); /*%< * Associate a name with a memory pool. At most 15 characters may be used. * * Requires: *\li mpctx is a valid pool. *\li name != NULL; */ void isc_mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock); /*%< * Associate a lock with this memory pool. * * This lock is used when getting or putting items using this memory pool, * and it is also used to set or get internal state via the isc_mempool_get*() * and isc_mempool_set*() set of functions. * * Multiple pools can each share a single lock. For instance, if "manager" * type object contained pools for various sizes of events, and each of * these pools used a common lock. Note that this lock must NEVER be used * by other than mempool routines once it is given to a pool, since that can * easily cause double locking. * * Requires: * *\li mpctpx is a valid pool. * *\li lock != NULL. * *\li No previous lock is assigned to this pool. * *\li The lock is initialized before calling this function via the normal * means of doing that. */ /* * The following functions get/set various parameters. Note that due to * the unlocked nature of pools these are potentially random values unless * the imposed externally provided locking protocols are followed. * * Also note that the quota limits will not always take immediate effect. * For instance, setting "maxalloc" to a number smaller than the currently * allocated count is permitted. New allocations will be refused until * the count drops below this threshold. * * All functions require (in addition to other requirements): * mpctx is a valid memory pool */ unsigned int isc_mempool_getfreemax(isc_mempool_t *mpctx); /*%< * Returns the maximum allowed size of the free list. */ void isc_mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit); /*%< * Sets the maximum allowed size of the free list. */ unsigned int isc_mempool_getfreecount(isc_mempool_t *mpctx); /*%< * Returns current size of the free list. */ unsigned int isc_mempool_getmaxalloc(isc_mempool_t *mpctx); /*!< * Returns the maximum allowed number of allocations. */ void isc_mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit); /*%< * Sets the maximum allowed number of allocations. * * Additional requirements: *\li limit > 0 */ unsigned int isc_mempool_getallocated(isc_mempool_t *mpctx); /*%< * Returns the number of items allocated from this pool. */ unsigned int isc_mempool_getfillcount(isc_mempool_t *mpctx); /*%< * Returns the number of items allocated as a block from the parent memory * context when the free list is empty. */ void isc_mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit); /*%< * Sets the fillcount. * * Additional requirements: *\li limit > 0 */ /* * Pseudo-private functions for use via macros. Do not call directly. */ void * isc__mem_get(isc_mem_t *, size_t _ISC_MEM_FLARG); void isc__mem_putanddetach(isc_mem_t **, void *, size_t _ISC_MEM_FLARG); void isc__mem_put(isc_mem_t *, void *, size_t _ISC_MEM_FLARG); void * isc__mem_allocate(isc_mem_t *, size_t _ISC_MEM_FLARG); void * isc__mem_reallocate(isc_mem_t *, void *, size_t _ISC_MEM_FLARG); void isc__mem_free(isc_mem_t *, void * _ISC_MEM_FLARG); char * isc__mem_strdup(isc_mem_t *, const char *_ISC_MEM_FLARG); void * isc__mempool_get(isc_mempool_t * _ISC_MEM_FLARG); void isc__mempool_put(isc_mempool_t *, void * _ISC_MEM_FLARG); ISC_LANG_ENDDECLS #endif /* ISC_MEM_H */ ntp-4.2.6p5/lib/isc/include/isc/version.h0000644000175000017500000000226711307651604017206 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: version.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */ /*! \file isc/version.h */ #include LIBISC_EXTERNAL_DATA extern const char isc_version[]; LIBISC_EXTERNAL_DATA extern const unsigned int isc_libinterface; LIBISC_EXTERNAL_DATA extern const unsigned int isc_librevision; LIBISC_EXTERNAL_DATA extern const unsigned int isc_libage; ntp-4.2.6p5/lib/isc/include/isc/boolean.h0000644000175000017500000000227411307651603017135 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: boolean.h,v 1.19 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_BOOLEAN_H #define ISC_BOOLEAN_H 1 /*! \file isc/boolean.h */ typedef enum { isc_boolean_false = 0, isc_boolean_true = 1 } isc_boolean_t; #define ISC_FALSE isc_boolean_false #define ISC_TRUE isc_boolean_true #define ISC_TF(x) ((x) ? ISC_TRUE : ISC_FALSE) #endif /* ISC_BOOLEAN_H */ ntp-4.2.6p5/lib/isc/include/isc/radix.h0000644000175000017500000001562711307651603016633 0ustar peterpeter/* * Copyright (C) 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: radix.h,v 1.11.44.2 2008/12/24 23:47:02 tbox Exp $ */ /* * This source was adapted from MRT's RCS Ids: * Id: radix.h,v 1.6 1999/08/03 03:32:53 masaki Exp * Id: mrt.h,v 1.57.2.6 1999/12/28 23:41:27 labovit Exp * Id: defs.h,v 1.5.2.2 2000/01/15 14:19:16 masaki Exp */ #include #include #include #include #include #include #ifndef _RADIX_H #define _RADIX_H #define NETADDR_TO_PREFIX_T(na,pt,bits) \ do { \ memset(&(pt), 0, sizeof(pt)); \ if((na) != NULL) { \ (pt).family = (na)->family; \ (pt).bitlen = (bits); \ if ((pt).family == AF_INET6) { \ memcpy(&(pt).add.sin6, &(na)->type.in6, \ ((bits)+7)/8); \ } else \ memcpy(&(pt).add.sin, &(na)->type.in, \ ((bits)+7)/8); \ } else { \ (pt).family = AF_UNSPEC; \ (pt).bitlen = 0; \ } \ isc_refcount_init(&(pt).refcount, 0); \ } while(0) typedef struct isc_prefix { unsigned int family; /* AF_INET | AF_INET6, or AF_UNSPEC for "any" */ unsigned int bitlen; /* 0 for "any" */ isc_refcount_t refcount; union { struct in_addr sin; struct in6_addr sin6; } add; } isc_prefix_t; typedef void (*isc_radix_destroyfunc_t)(void *); typedef void (*isc_radix_processfunc_t)(isc_prefix_t *, void **); #define isc_prefix_tochar(prefix) ((char *)&(prefix)->add.sin) #define isc_prefix_touchar(prefix) ((u_char *)&(prefix)->add.sin) #define BIT_TEST(f, b) ((f) & (b)) /* * We need "first match" when we search the radix tree to preserve * compatibility with the existing ACL implementation. Radix trees * naturally lend themselves to "best match". In order to get "first match" * behavior, we keep track of the order in which entries are added to the * tree--and when a search is made, we find all matching entries, and * return the one that was added first. * * An IPv4 prefix and an IPv6 prefix may share a radix tree node if they * have the same length and bit pattern (e.g., 127/8 and 7f::/8). To * disambiguate between them, node_num and data are two-element arrays; * node_num[0] and data[0] are used for IPv4 addresses, node_num[1] * and data[1] for IPv6 addresses. The only exception is a prefix of * 0/0 (aka "any" or "none"), which is always stored as IPv4 but matches * IPv6 addresses too. */ #define ISC_IS6(family) ((family) == AF_INET6 ? 1 : 0) typedef struct isc_radix_node { isc_uint32_t bit; /* bit length of the prefix */ isc_prefix_t *prefix; /* who we are in radix tree */ struct isc_radix_node *l, *r; /* left and right children */ struct isc_radix_node *parent; /* may be used */ void *data[2]; /* pointers to IPv4 and IPV6 data */ int node_num[2]; /* which node this was in the tree, or -1 for glue nodes */ } isc_radix_node_t; #define RADIX_TREE_MAGIC ISC_MAGIC('R','d','x','T'); #define RADIX_TREE_VALID(a) ISC_MAGIC_VALID(a, RADIX_TREE_MAGIC); typedef struct isc_radix_tree { unsigned int magic; isc_mem_t *mctx; isc_radix_node_t *head; isc_uint32_t maxbits; /* for IP, 32 bit addresses */ int num_active_node; /* for debugging purposes */ int num_added_node; /* total number of nodes */ } isc_radix_tree_t; isc_result_t isc_radix_search(isc_radix_tree_t *radix, isc_radix_node_t **target, isc_prefix_t *prefix); /*%< * Search 'radix' for the best match to 'prefix'. * Return the node found in '*target'. * * Requires: * \li 'radix' to be valid. * \li 'target' is not NULL and "*target" is NULL. * \li 'prefix' to be valid. * * Returns: * \li ISC_R_NOTFOUND * \li ISC_R_SUCCESS */ isc_result_t isc_radix_insert(isc_radix_tree_t *radix, isc_radix_node_t **target, isc_radix_node_t *source, isc_prefix_t *prefix); /*%< * Insert 'source' or 'prefix' into the radix tree 'radix'. * Return the node added in 'target'. * * Requires: * \li 'radix' to be valid. * \li 'target' is not NULL and "*target" is NULL. * \li 'prefix' to be valid or 'source' to be non NULL and contain * a valid prefix. * * Returns: * \li ISC_R_NOMEMORY * \li ISC_R_SUCCESS */ void isc_radix_remove(isc_radix_tree_t *radix, isc_radix_node_t *node); /*%< * Remove the node 'node' from the radix tree 'radix'. * * Requires: * \li 'radix' to be valid. * \li 'node' to be valid. */ isc_result_t isc_radix_create(isc_mem_t *mctx, isc_radix_tree_t **target, int maxbits); /*%< * Create a radix tree with a maximum depth of 'maxbits'; * * Requires: * \li 'mctx' to be valid. * \li 'target' to be non NULL and '*target' to be NULL. * \li 'maxbits' to be less than or equal to RADIX_MAXBITS. * * Returns: * \li ISC_R_NOMEMORY * \li ISC_R_SUCCESS */ void isc_radix_destroy(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func); /*%< * Destroy a radix tree optionally calling 'func' to clean up node data. * * Requires: * \li 'radix' to be valid. */ void isc_radix_process(isc_radix_tree_t *radix, isc_radix_processfunc_t func); /*%< * Walk a radix tree calling 'func' to process node data. * * Requires: * \li 'radix' to be valid. * \li 'func' to point to a function. */ #define RADIX_MAXBITS 128 #define RADIX_NBIT(x) (0x80 >> ((x) & 0x7f)) #define RADIX_NBYTE(x) ((x) >> 3) #define RADIX_DATA_GET(node, type) (type *)((node)->data) #define RADIX_DATA_SET(node, value) ((node)->data = (void *)(value)) #define RADIX_WALK(Xhead, Xnode) \ do { \ isc_radix_node_t *Xstack[RADIX_MAXBITS+1]; \ isc_radix_node_t **Xsp = Xstack; \ isc_radix_node_t *Xrn = (Xhead); \ while ((Xnode = Xrn)) { \ if (Xnode->prefix) #define RADIX_WALK_ALL(Xhead, Xnode) \ do { \ isc_radix_node_t *Xstack[RADIX_MAXBITS+1]; \ isc_radix_node_t **Xsp = Xstack; \ isc_radix_node_t *Xrn = (Xhead); \ while ((Xnode = Xrn)) { \ if (1) #define RADIX_WALK_BREAK { \ if (Xsp != Xstack) { \ Xrn = *(--Xsp); \ } else { \ Xrn = (radix_node_t *) 0; \ } \ continue; } #define RADIX_WALK_END \ if (Xrn->l) { \ if (Xrn->r) { \ *Xsp++ = Xrn->r; \ } \ Xrn = Xrn->l; \ } else if (Xrn->r) { \ Xrn = Xrn->r; \ } else if (Xsp != Xstack) { \ Xrn = *(--Xsp); \ } else { \ Xrn = (isc_radix_node_t *) 0; \ } \ } \ } while (0) #endif /* _RADIX_H */ ntp-4.2.6p5/lib/isc/include/isc/taskpool.h0000644000175000017500000000512211307651603017345 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: taskpool.h,v 1.15 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_TASKPOOL_H #define ISC_TASKPOOL_H 1 /***** ***** Module Info *****/ /*! \file isc/taskpool.h * \brief A task pool is a mechanism for sharing a small number of tasks * among a large number of objects such that each object is * assigned a unique task, but each task may be shared by several * objects. * * Task pools are used to let objects that can exist in large * numbers (e.g., zones) use tasks for synchronization without * the memory overhead and unfair scheduling competition that * could result from creating a separate task for each object. */ /*** *** Imports. ***/ #include #include ISC_LANG_BEGINDECLS /***** ***** Types. *****/ typedef struct isc_taskpool isc_taskpool_t; /***** ***** Functions. *****/ isc_result_t isc_taskpool_create(isc_taskmgr_t *tmgr, isc_mem_t *mctx, unsigned int ntasks, unsigned int quantum, isc_taskpool_t **poolp); /*%< * Create a task pool of "ntasks" tasks, each with quantum * "quantum". * * Requires: * *\li 'tmgr' is a valid task manager. * *\li 'mctx' is a valid memory context. * *\li poolp != NULL && *poolp == NULL * * Ensures: * *\li On success, '*taskp' points to the new task pool. * * Returns: * *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY *\li #ISC_R_UNEXPECTED */ void isc_taskpool_gettask(isc_taskpool_t *pool, unsigned int hash, isc_task_t **targetp); /*%< * Attach to the task corresponding to the hash value "hash". */ void isc_taskpool_destroy(isc_taskpool_t **poolp); /*%< * Destroy a task pool. The tasks in the pool are detached but not * shut down. * * Requires: * \li '*poolp' is a valid task pool. */ ISC_LANG_ENDDECLS #endif /* ISC_TASKPOOL_H */ ntp-4.2.6p5/lib/isc/include/isc/region.h0000644000175000017500000000470111307651603016776 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: region.h,v 1.25 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_REGION_H #define ISC_REGION_H 1 /*! \file isc/region.h */ #include struct isc_region { unsigned char * base; unsigned int length; }; struct isc_textregion { char * base; unsigned int length; }; /* XXXDCL questionable ... bears discussion. we have been putting off * discussing the region api. */ struct isc_constregion { const void * base; unsigned int length; }; struct isc_consttextregion { const char * base; unsigned int length; }; /*@{*/ /*! * The region structure is not opaque, and is usually directly manipulated. * Some macros are defined below for convenience. */ #define isc_region_consume(r,l) \ do { \ isc_region_t *_r = (r); \ unsigned int _l = (l); \ INSIST(_r->length >= _l); \ _r->base += _l; \ _r->length -= _l; \ } while (0) #define isc_textregion_consume(r,l) \ do { \ isc_textregion_t *_r = (r); \ unsigned int _l = (l); \ INSIST(_r->length >= _l); \ _r->base += _l; \ _r->length -= _l; \ } while (0) #define isc_constregion_consume(r,l) \ do { \ isc_constregion_t *_r = (r); \ unsigned int _l = (l); \ INSIST(_r->length >= _l); \ _r->base += _l; \ _r->length -= _l; \ } while (0) /*@}*/ int isc_region_compare(isc_region_t *r1, isc_region_t *r2); /*%< * Compares the contents of two regions * * Requires: *\li 'r1' is a valid region *\li 'r2' is a valid region * * Returns: *\li < 0 if r1 is lexicographically less than r2 *\li = 0 if r1 is lexicographically identical to r2 *\li > 0 if r1 is lexicographically greater than r2 */ #endif /* ISC_REGION_H */ ntp-4.2.6p5/lib/isc/include/isc/bufferlist.h0000644000175000017500000000367311307651603017667 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: bufferlist.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_BUFFERLIST_H #define ISC_BUFFERLIST_H 1 /***** ***** Module Info *****/ /*! \file isc/bufferlist.h * * *\brief Buffer lists have no synchronization. Clients must ensure exclusive * access. * * \li Reliability: * No anticipated impact. * \li Security: * No anticipated impact. * * \li Standards: * None. */ /*** *** Imports ***/ #include #include ISC_LANG_BEGINDECLS /*** *** Functions ***/ unsigned int isc_bufferlist_usedcount(isc_bufferlist_t *bl); /*!< * \brief Return the length of the sum of all used regions of all buffers in * the buffer list 'bl' * * Requires: * *\li 'bl' is not NULL. * * Returns: *\li sum of all used regions' lengths. */ unsigned int isc_bufferlist_availablecount(isc_bufferlist_t *bl); /*!< * \brief Return the length of the sum of all available regions of all buffers in * the buffer list 'bl' * * Requires: * *\li 'bl' is not NULL. * * Returns: *\li sum of all available regions' lengths. */ ISC_LANG_ENDDECLS #endif /* ISC_BUFFERLIST_H */ ntp-4.2.6p5/lib/isc/include/isc/os.h0000644000175000017500000000224711307651603016137 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: os.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_OS_H #define ISC_OS_H 1 /*! \file isc/os.h */ #include ISC_LANG_BEGINDECLS unsigned int isc_os_ncpus(void); /*%< * Return the number of CPUs available on the system, or 1 if this cannot * be determined. */ ISC_LANG_ENDDECLS #endif /* ISC_OS_H */ ntp-4.2.6p5/lib/isc/include/isc/httpd.h0000644000175000017500000000375511307651603016646 0ustar peterpeter/* * Copyright (C) 2006-2008 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: httpd.h,v 1.9 2008/08/08 05:06:49 marka Exp $ */ #ifndef ISC_HTTPD_H #define ISC_HTTPD_H 1 /*! \file */ #include #include #include #include #include #define HTTPD_EVENTCLASS ISC_EVENTCLASS(4300) #define HTTPD_SHUTDOWN (HTTPD_EVENTCLASS + 0x0001) #define ISC_HTTPDMGR_FLAGSHUTTINGDOWN 0x00000001 /* * Create a new http daemon which will send, once every time period, * a http-like header followed by HTTP data. */ isc_result_t isc_httpdmgr_create(isc_mem_t *mctx, isc_socket_t *sock, isc_task_t *task, isc_httpdclientok_t *client_ok, isc_httpdondestroy_t *ondestory, void *cb_arg, isc_timermgr_t *tmgr, isc_httpdmgr_t **httpdp); void isc_httpdmgr_shutdown(isc_httpdmgr_t **httpdp); isc_result_t isc_httpdmgr_addurl(isc_httpdmgr_t *httpdmgr, const char *url, isc_httpdaction_t *func, void *arg); isc_result_t isc_httpd_response(isc_httpd_t *httpd); isc_result_t isc_httpd_addheader(isc_httpd_t *httpd, const char *name, const char *val); isc_result_t isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val); isc_result_t isc_httpd_endheaders(isc_httpd_t *httpd); #endif /* ISC_HTTPD_H */ ntp-4.2.6p5/lib/isc/include/isc/error.h0000644000175000017500000000337711307651604016655 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: error.h,v 1.20 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_ERROR_H #define ISC_ERROR_H 1 /*! \file isc/error.h */ #include #include #include ISC_LANG_BEGINDECLS typedef void (*isc_errorcallback_t)(const char *, int, const char *, va_list); /*% set unexpected error */ void isc_error_setunexpected(isc_errorcallback_t); /*% set fatal error */ void isc_error_setfatal(isc_errorcallback_t); /*% unexpected error */ void isc_error_unexpected(const char *, int, const char *, ...) ISC_FORMAT_PRINTF(3, 4); /*% fatal error */ void isc_error_fatal(const char *, int, const char *, ...) ISC_FORMAT_PRINTF(3, 4); /*% runtimecheck error */ void isc_error_runtimecheck(const char *, int, const char *); #define ISC_ERROR_RUNTIMECHECK(cond) \ ((void) ((cond) || \ ((isc_error_runtimecheck)(__FILE__, __LINE__, #cond), 0))) ISC_LANG_ENDDECLS #endif /* ISC_ERROR_H */ ntp-4.2.6p5/lib/isc/include/isc/app.h0000644000175000017500000001303711307651604016276 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: app.h,v 1.8 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_APP_H #define ISC_APP_H 1 /***** ***** Module Info *****/ /*! \file isc/app.h * \brief ISC Application Support * * Dealing with program termination can be difficult, especially in a * multithreaded program. The routines in this module help coordinate * the shutdown process. They are used as follows by the initial (main) * thread of the application: * *\li isc_app_start(); Call very early in main(), before * any other threads have been created. * *\li isc_app_run(); This will post any on-run events, * and then block until application * shutdown is requested. A shutdown * request is made by calling * isc_app_shutdown(), or by sending * SIGINT or SIGTERM to the process. * After isc_app_run() returns, the * application should shutdown itself. * *\li isc_app_finish(); Call very late in main(). * * Applications that want to use SIGHUP/isc_app_reload() to trigger reloading * should check the result of isc_app_run() and call the reload routine if * the result is ISC_R_RELOAD. They should then call isc_app_run() again * to resume waiting for reload or termination. * * Use of this module is not required. In particular, isc_app_start() is * NOT an ISC library initialization routine. * * \li MP: * Clients must ensure that isc_app_start(), isc_app_run(), and * isc_app_finish() are called at most once. isc_app_shutdown() * is safe to use by any thread (provided isc_app_start() has been * called previously). * * \li Reliability: * No anticipated impact. * * \li Resources: * None. * * \li Security: * No anticipated impact. * * \li Standards: * None. */ #include #include #include typedef isc_event_t isc_appevent_t; #define ISC_APPEVENT_FIRSTEVENT (ISC_EVENTCLASS_APP + 0) #define ISC_APPEVENT_SHUTDOWN (ISC_EVENTCLASS_APP + 1) #define ISC_APPEVENT_LASTEVENT (ISC_EVENTCLASS_APP + 65535) ISC_LANG_BEGINDECLS isc_result_t isc_app_start(void); /*!< * \brief Start an ISC library application. * * Notes: * This call should be made before any other ISC library call, and as * close to the beginning of the application as possible. */ isc_result_t isc_app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action, void *arg); /*!< * \brief Request delivery of an event when the application is run. * * Requires: * isc_app_start() has been called. * * Returns: * ISC_R_SUCCESS * ISC_R_NOMEMORY */ isc_result_t isc_app_run(void); /*!< * \brief Run an ISC library application. * * Notes: *\li The caller (typically the initial thread of an application) will * block until shutdown is requested. When the call returns, the * caller should start shutting down the application. * * Requires: *\li isc_app_start() has been called. * * Ensures: *\li Any events requested via isc_app_onrun() will have been posted (in * FIFO order) before isc_app_run() blocks. * * Returns: *\li ISC_R_SUCCESS Shutdown has been requested. *\li ISC_R_RELOAD Reload has been requested. */ isc_result_t isc_app_shutdown(void); /*!< * \brief Request application shutdown. * * Notes: *\li It is safe to call isc_app_shutdown() multiple times. Shutdown will * only be triggered once. * * Requires: *\li isc_app_run() has been called. * * Returns: *\li ISC_R_SUCCESS *\li ISC_R_UNEXPECTED */ isc_result_t isc_app_reload(void); /*!< * \brief Request application reload. * * Requires: *\li isc_app_run() has been called. * * Returns: *\li ISC_R_SUCCESS *\li ISC_R_UNEXPECTED */ void isc_app_finish(void); /*!< * \brief Finish an ISC library application. * * Notes: *\li This call should be made at or near the end of main(). * * Requires: *\li isc_app_start() has been called. * * Ensures: *\li Any resources allocated by isc_app_start() have been released. */ void isc_app_block(void); /*!< * \brief Indicate that a blocking operation will be performed. * * Notes: *\li If a blocking operation is in process, a call to isc_app_shutdown() * or an external signal will abort the program, rather than allowing * clean shutdown. This is primarily useful for reading user input. * * Requires: * \li isc_app_start() has been called. * \li No other blocking operations are in progress. */ void isc_app_unblock(void); /*!< * \brief Indicate that a blocking operation is complete. * * Notes: * \li When a blocking operation has completed, return the program to a * state where a call to isc_app_shutdown() or an external signal will * shutdown normally. * * Requires: * \li isc_app_start() has been called. * \li isc_app_block() has been called by the same thread. */ ISC_LANG_ENDDECLS #endif /* ISC_APP_H */ ntp-4.2.6p5/lib/isc/include/isc/netscope.h0000644000175000017500000000267311307651604017342 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: netscope.h,v 1.11 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_NETSCOPE_H #define ISC_NETSCOPE_H 1 /*! \file isc/netscope.h */ ISC_LANG_BEGINDECLS /*% * Convert a string of an IPv6 scope zone to zone index. If the conversion * succeeds, 'zoneid' will store the index value. * * XXXJT: when a standard interface for this purpose is defined, * we should use it. * * Returns: * \li ISC_R_SUCCESS: conversion succeeds * \li ISC_R_FAILURE: conversion fails */ isc_result_t isc_netscope_pton(int af, char *scopename, void *addr, isc_uint32_t *zoneid); ISC_LANG_ENDDECLS #endif /* ISC_NETADDR_H */ ntp-4.2.6p5/lib/isc/include/isc/task.h0000644000175000017500000003553711307651604016471 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: task.h,v 1.61.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_TASK_H #define ISC_TASK_H 1 /***** ***** Module Info *****/ /*! \file isc/task.h * \brief The task system provides a lightweight execution context, which is * basically an event queue. * When a task's event queue is non-empty, the * task is runnable. A small work crew of threads, typically one per CPU, * execute runnable tasks by dispatching the events on the tasks' event * queues. Context switching between tasks is fast. * * \li MP: * The module ensures appropriate synchronization of data structures it * creates and manipulates. * The caller must ensure that isc_taskmgr_destroy() is called only * once for a given manager. * * \li Reliability: * No anticipated impact. * * \li Resources: * TBS * * \li Security: * No anticipated impact. * * \li Standards: * None. * * \section purge Purging and Unsending * * Events which have been queued for a task but not delivered may be removed * from the task's event queue by purging or unsending. * * With both types, the caller specifies a matching pattern that selects * events based upon their sender, type, and tag. * * Purging calls isc_event_free() on the matching events. * * Unsending returns a list of events that matched the pattern. * The caller is then responsible for them. * * Consumers of events should purge, not unsend. * * Producers of events often want to remove events when the caller indicates * it is no longer interested in the object, e.g. by canceling a timer. * Sometimes this can be done by purging, but for some event types, the * calls to isc_event_free() cause deadlock because the event free routine * wants to acquire a lock the caller is already holding. Unsending instead * of purging solves this problem. As a general rule, producers should only * unsend events which they have sent. */ /*** *** Imports. ***/ #include #include #include #include #include #define ISC_TASKEVENT_FIRSTEVENT (ISC_EVENTCLASS_TASK + 0) #define ISC_TASKEVENT_SHUTDOWN (ISC_EVENTCLASS_TASK + 1) #define ISC_TASKEVENT_LASTEVENT (ISC_EVENTCLASS_TASK + 65535) /***** ***** Tasks. *****/ ISC_LANG_BEGINDECLS isc_result_t isc_task_create(isc_taskmgr_t *manager, unsigned int quantum, isc_task_t **taskp); /*%< * Create a task. * * Notes: * *\li If 'quantum' is non-zero, then only that many events can be dispatched * before the task must yield to other tasks waiting to execute. If * quantum is zero, then the default quantum of the task manager will * be used. * *\li The 'quantum' option may be removed from isc_task_create() in the * future. If this happens, isc_task_getquantum() and * isc_task_setquantum() will be provided. * * Requires: * *\li 'manager' is a valid task manager. * *\li taskp != NULL && *taskp == NULL * * Ensures: * *\li On success, '*taskp' is bound to the new task. * * Returns: * *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY *\li #ISC_R_UNEXPECTED *\li #ISC_R_SHUTTINGDOWN */ void isc_task_attach(isc_task_t *source, isc_task_t **targetp); /*%< * Attach *targetp to source. * * Requires: * *\li 'source' is a valid task. * *\li 'targetp' points to a NULL isc_task_t *. * * Ensures: * *\li *targetp is attached to source. */ void isc_task_detach(isc_task_t **taskp); /*%< * Detach *taskp from its task. * * Requires: * *\li '*taskp' is a valid task. * * Ensures: * *\li *taskp is NULL. * *\li If '*taskp' is the last reference to the task, the task is idle (has * an empty event queue), and has not been shutdown, the task will be * shutdown. * *\li If '*taskp' is the last reference to the task and * the task has been shutdown, * all resources used by the task will be freed. */ void isc_task_send(isc_task_t *task, isc_event_t **eventp); /*%< * Send '*event' to 'task'. * * Requires: * *\li 'task' is a valid task. *\li eventp != NULL && *eventp != NULL. * * Ensures: * *\li *eventp == NULL. */ void isc_task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp); /*%< * Send '*event' to '*taskp' and then detach '*taskp' from its * task. * * Requires: * *\li '*taskp' is a valid task. *\li eventp != NULL && *eventp != NULL. * * Ensures: * *\li *eventp == NULL. * *\li *taskp == NULL. * *\li If '*taskp' is the last reference to the task, the task is * idle (has an empty event queue), and has not been shutdown, * the task will be shutdown. * *\li If '*taskp' is the last reference to the task and * the task has been shutdown, * all resources used by the task will be freed. */ unsigned int isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first, isc_eventtype_t last, void *tag); /*%< * Purge events from a task's event queue. * * Requires: * *\li 'task' is a valid task. * *\li last >= first * * Ensures: * *\li Events in the event queue of 'task' whose sender is 'sender', whose * type is >= first and <= last, and whose tag is 'tag' will be purged, * unless they are marked as unpurgable. * *\li A sender of NULL will match any sender. A NULL tag matches any * tag. * * Returns: * *\li The number of events purged. */ unsigned int isc_task_purge(isc_task_t *task, void *sender, isc_eventtype_t type, void *tag); /*%< * Purge events from a task's event queue. * * Notes: * *\li This function is equivalent to * *\code * isc_task_purgerange(task, sender, type, type, tag); *\endcode * * Requires: * *\li 'task' is a valid task. * * Ensures: * *\li Events in the event queue of 'task' whose sender is 'sender', whose * type is 'type', and whose tag is 'tag' will be purged, unless they * are marked as unpurgable. * *\li A sender of NULL will match any sender. A NULL tag matches any * tag. * * Returns: * *\li The number of events purged. */ isc_boolean_t isc_task_purgeevent(isc_task_t *task, isc_event_t *event); /*%< * Purge 'event' from a task's event queue. * * XXXRTH: WARNING: This method may be removed before beta. * * Notes: * *\li If 'event' is on the task's event queue, it will be purged, * unless it is marked as unpurgeable. 'event' does not have to be * on the task's event queue; in fact, it can even be an invalid * pointer. Purging only occurs if the event is actually on the task's * event queue. * * \li Purging never changes the state of the task. * * Requires: * *\li 'task' is a valid task. * * Ensures: * *\li 'event' is not in the event queue for 'task'. * * Returns: * *\li #ISC_TRUE The event was purged. *\li #ISC_FALSE The event was not in the event queue, * or was marked unpurgeable. */ unsigned int isc_task_unsendrange(isc_task_t *task, void *sender, isc_eventtype_t first, isc_eventtype_t last, void *tag, isc_eventlist_t *events); /*%< * Remove events from a task's event queue. * * Requires: * *\li 'task' is a valid task. * *\li last >= first. * *\li *events is a valid list. * * Ensures: * *\li Events in the event queue of 'task' whose sender is 'sender', whose * type is >= first and <= last, and whose tag is 'tag' will be dequeued * and appended to *events. * *\li A sender of NULL will match any sender. A NULL tag matches any * tag. * * Returns: * *\li The number of events unsent. */ unsigned int isc_task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type, void *tag, isc_eventlist_t *events); /*%< * Remove events from a task's event queue. * * Notes: * *\li This function is equivalent to * *\code * isc_task_unsendrange(task, sender, type, type, tag, events); *\endcode * * Requires: * *\li 'task' is a valid task. * *\li *events is a valid list. * * Ensures: * *\li Events in the event queue of 'task' whose sender is 'sender', whose * type is 'type', and whose tag is 'tag' will be dequeued and appended * to *events. * * Returns: * *\li The number of events unsent. */ isc_result_t isc_task_onshutdown(isc_task_t *task, isc_taskaction_t action, const void *arg); /*%< * Send a shutdown event with action 'action' and argument 'arg' when * 'task' is shutdown. * * Notes: * *\li Shutdown events are posted in LIFO order. * * Requires: * *\li 'task' is a valid task. * *\li 'action' is a valid task action. * * Ensures: * *\li When the task is shutdown, shutdown events requested with * isc_task_onshutdown() will be appended to the task's event queue. * * Returns: * *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY *\li #ISC_R_TASKSHUTTINGDOWN Task is shutting down. */ void isc_task_shutdown(isc_task_t *task); /*%< * Shutdown 'task'. * * Notes: * *\li Shutting down a task causes any shutdown events requested with * isc_task_onshutdown() to be posted (in LIFO order). The task * moves into a "shutting down" mode which prevents further calls * to isc_task_onshutdown(). * *\li Trying to shutdown a task that has already been shutdown has no * effect. * * Requires: * *\li 'task' is a valid task. * * Ensures: * *\li Any shutdown events requested with isc_task_onshutdown() have been * posted (in LIFO order). */ void isc_task_destroy(isc_task_t **taskp); /*%< * Destroy '*taskp'. * * Notes: * *\li This call is equivalent to: * *\code * isc_task_shutdown(*taskp); * isc_task_detach(taskp); *\endcode * * Requires: * * '*taskp' is a valid task. * * Ensures: * *\li Any shutdown events requested with isc_task_onshutdown() have been * posted (in LIFO order). * *\li *taskp == NULL * *\li If '*taskp' is the last reference to the task, * all resources used by the task will be freed. */ void isc_task_setname(isc_task_t *task, const char *name, void *tag); /*%< * Name 'task'. * * Notes: * *\li Only the first 15 characters of 'name' will be copied. * *\li Naming a task is currently only useful for debugging purposes. * * Requires: * *\li 'task' is a valid task. */ const char * isc_task_getname(isc_task_t *task); /*%< * Get the name of 'task', as previously set using isc_task_setname(). * * Notes: *\li This function is for debugging purposes only. * * Requires: *\li 'task' is a valid task. * * Returns: *\li A non-NULL pointer to a null-terminated string. * If the task has not been named, the string is * empty. * */ void * isc_task_gettag(isc_task_t *task); /*%< * Get the tag value for 'task', as previously set using isc_task_settag(). * * Notes: *\li This function is for debugging purposes only. * * Requires: *\li 'task' is a valid task. */ isc_result_t isc_task_beginexclusive(isc_task_t *task); /*%< * Request exclusive access for 'task', which must be the calling * task. Waits for any other concurrently executing tasks to finish their * current event, and prevents any new events from executing in any of the * tasks sharing a task manager with 'task'. * * The exclusive access must be relinquished by calling * isc_task_endexclusive() before returning from the current event handler. * * Requires: *\li 'task' is the calling task. * * Returns: *\li #ISC_R_SUCCESS The current task now has exclusive access. *\li #ISC_R_LOCKBUSY Another task has already requested exclusive * access. */ void isc_task_endexclusive(isc_task_t *task); /*%< * Relinquish the exclusive access obtained by isc_task_beginexclusive(), * allowing other tasks to execute. * * Requires: *\li 'task' is the calling task, and has obtained * exclusive access by calling isc_task_spl(). */ void isc_task_getcurrenttime(isc_task_t *task, isc_stdtime_t *t); /*%< * Provide the most recent timestamp on the task. The timestamp is considered * as the "current time" in the second-order granularity. * * Requires: *\li 'task' is a valid task. *\li 't' is a valid non NULL pointer. * * Ensures: *\li '*t' has the "current time". */ /***** ***** Task Manager. *****/ isc_result_t isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers, unsigned int default_quantum, isc_taskmgr_t **managerp); /*%< * Create a new task manager. * * Notes: * *\li 'workers' in the number of worker threads to create. In general, * the value should be close to the number of processors in the system. * The 'workers' value is advisory only. An attempt will be made to * create 'workers' threads, but if at least one thread creation * succeeds, isc_taskmgr_create() may return ISC_R_SUCCESS. * *\li If 'default_quantum' is non-zero, then it will be used as the default * quantum value when tasks are created. If zero, then an implementation * defined default quantum will be used. * * Requires: * *\li 'mctx' is a valid memory context. * *\li workers > 0 * *\li managerp != NULL && *managerp == NULL * * Ensures: * *\li On success, '*managerp' will be attached to the newly created task * manager. * * Returns: * *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY *\li #ISC_R_NOTHREADS No threads could be created. *\li #ISC_R_UNEXPECTED An unexpected error occurred. */ void isc_taskmgr_destroy(isc_taskmgr_t **managerp); /*%< * Destroy '*managerp'. * * Notes: * *\li Calling isc_taskmgr_destroy() will shutdown all tasks managed by * *managerp that haven't already been shutdown. The call will block * until all tasks have entered the done state. * *\li isc_taskmgr_destroy() must not be called by a task event action, * because it would block forever waiting for the event action to * complete. An event action that wants to cause task manager shutdown * should request some non-event action thread of execution to do the * shutdown, e.g. by signaling a condition variable or using * isc_app_shutdown(). * *\li Task manager references are not reference counted, so the caller * must ensure that no attempt will be made to use the manager after * isc_taskmgr_destroy() returns. * * Requires: * *\li '*managerp' is a valid task manager. * *\li isc_taskmgr_destroy() has not be called previously on '*managerp'. * * Ensures: * *\li All resources used by the task manager, and any tasks it managed, * have been freed. */ #ifdef HAVE_LIBXML2 void isc_taskmgr_renderxml(isc_taskmgr_t *mgr, xmlTextWriterPtr writer); #endif ISC_LANG_ENDDECLS #endif /* ISC_TASK_H */ ntp-4.2.6p5/lib/isc/include/isc/refcount.h0000644000175000017500000001407411307651604017345 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: refcount.h,v 1.15 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_REFCOUNT_H #define ISC_REFCOUNT_H 1 #include #include #include #include #include #include /*! \file isc/refcount.h * \brief Implements a locked reference counter. * * These functions may actually be * implemented using macros, and implementations of these macros are below. * The isc_refcount_t type should not be accessed directly, as its contents * depend on the implementation. */ ISC_LANG_BEGINDECLS /* * Function prototypes */ /* * isc_result_t * isc_refcount_init(isc_refcount_t *ref, unsigned int n); * * Initialize the reference counter. There will be 'n' initial references. * * Requires: * ref != NULL */ /* * void * isc_refcount_destroy(isc_refcount_t *ref); * * Destroys a reference counter. * * Requires: * ref != NULL * The number of references is 0. */ /* * void * isc_refcount_increment(isc_refcount_t *ref, unsigned int *targetp); * isc_refcount_increment0(isc_refcount_t *ref, unsigned int *targetp); * * Increments the reference count, returning the new value in targetp if it's * not NULL. The reference counter typically begins with the initial counter * of 1, and will be destroyed once the counter reaches 0. Thus, * isc_refcount_increment() additionally requires the previous counter be * larger than 0 so that an error which violates the usage can be easily * caught. isc_refcount_increment0() does not have this restriction. * * Requires: * ref != NULL. */ /* * void * isc_refcount_decrement(isc_refcount_t *ref, unsigned int *targetp); * * Decrements the reference count, returning the new value in targetp if it's * not NULL. * * Requires: * ref != NULL. */ /* * Sample implementations */ #ifdef ISC_PLATFORM_USETHREADS #ifdef ISC_PLATFORM_HAVEXADD #define ISC_REFCOUNT_HAVEATOMIC 1 typedef struct isc_refcount { isc_int32_t refs; } isc_refcount_t; #define isc_refcount_destroy(rp) (REQUIRE((rp)->refs == 0)) #define isc_refcount_current(rp) ((unsigned int)((rp)->refs)) #define isc_refcount_increment0(rp, tp) \ do { \ unsigned int *_tmp = (unsigned int *)(tp); \ isc_int32_t prev; \ prev = isc_atomic_xadd(&(rp)->refs, 1); \ if (_tmp != NULL) \ *_tmp = prev + 1; \ } while (0) #define isc_refcount_increment(rp, tp) \ do { \ unsigned int *_tmp = (unsigned int *)(tp); \ isc_int32_t prev; \ prev = isc_atomic_xadd(&(rp)->refs, 1); \ REQUIRE(prev > 0); \ if (_tmp != NULL) \ *_tmp = prev + 1; \ } while (0) #define isc_refcount_decrement(rp, tp) \ do { \ unsigned int *_tmp = (unsigned int *)(tp); \ isc_int32_t prev; \ prev = isc_atomic_xadd(&(rp)->refs, -1); \ REQUIRE(prev > 0); \ if (_tmp != NULL) \ *_tmp = prev - 1; \ } while (0) #else /* ISC_PLATFORM_HAVEXADD */ typedef struct isc_refcount { int refs; isc_mutex_t lock; } isc_refcount_t; /*% Destroys a reference counter. */ #define isc_refcount_destroy(rp) \ do { \ REQUIRE((rp)->refs == 0); \ DESTROYLOCK(&(rp)->lock); \ } while (0) #define isc_refcount_current(rp) ((unsigned int)((rp)->refs)) /*% Increments the reference count, returning the new value in targetp if it's not NULL. */ #define isc_refcount_increment0(rp, tp) \ do { \ unsigned int *_tmp = (unsigned int *)(tp); \ LOCK(&(rp)->lock); \ ++((rp)->refs); \ if (_tmp != NULL) \ *_tmp = ((rp)->refs); \ UNLOCK(&(rp)->lock); \ } while (0) #define isc_refcount_increment(rp, tp) \ do { \ unsigned int *_tmp = (unsigned int *)(tp); \ LOCK(&(rp)->lock); \ REQUIRE((rp)->refs > 0); \ ++((rp)->refs); \ if (_tmp != NULL) \ *_tmp = ((rp)->refs); \ UNLOCK(&(rp)->lock); \ } while (0) /*% Decrements the reference count, returning the new value in targetp if it's not NULL. */ #define isc_refcount_decrement(rp, tp) \ do { \ unsigned int *_tmp = (unsigned int *)(tp); \ LOCK(&(rp)->lock); \ REQUIRE((rp)->refs > 0); \ --((rp)->refs); \ if (_tmp != NULL) \ *_tmp = ((rp)->refs); \ UNLOCK(&(rp)->lock); \ } while (0) #endif /* ISC_PLATFORM_HAVEXADD */ #else /* ISC_PLATFORM_USETHREADS */ typedef struct isc_refcount { int refs; } isc_refcount_t; #define isc_refcount_destroy(rp) (REQUIRE((rp)->refs == 0)) #define isc_refcount_current(rp) ((unsigned int)((rp)->refs)) #define isc_refcount_increment0(rp, tp) \ do { \ unsigned int *_tmp = (unsigned int *)(tp); \ int _n = ++(rp)->refs; \ if (_tmp != NULL) \ *_tmp = _n; \ } while (0) #define isc_refcount_increment(rp, tp) \ do { \ unsigned int *_tmp = (unsigned int *)(tp); \ int _n; \ REQUIRE((rp)->refs > 0); \ _n = ++(rp)->refs; \ if (_tmp != NULL) \ *_tmp = _n; \ } while (0) #define isc_refcount_decrement(rp, tp) \ do { \ unsigned int *_tmp = (unsigned int *)(tp); \ int _n; \ REQUIRE((rp)->refs > 0); \ _n = --(rp)->refs; \ if (_tmp != NULL) \ *_tmp = _n; \ } while (0) #endif /* ISC_PLATFORM_USETHREADS */ isc_result_t isc_refcount_init(isc_refcount_t *ref, unsigned int n); ISC_LANG_ENDDECLS #endif /* ISC_REFCOUNT_H */ ntp-4.2.6p5/lib/isc/httpd.c0000644000175000017500000006233111307651603014433 0ustar peterpeter/* * Copyright (C) 2006-2008 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: httpd.c,v 1.16 2008/08/08 05:06:49 marka Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include #include /*% * TODO: * * o Put in better checks to make certain things are passed in correctly. * This includes a magic number for externally-visible structures, * checking for NULL-ness before dereferencing, etc. * o Make the URL processing external functions which will fill-in a buffer * structure we provide, or return an error and we will render a generic * page and close the client. */ #define MSHUTTINGDOWN(cm) ((cm->flags & ISC_HTTPDMGR_FLAGSHUTTINGDOWN) != 0) #define MSETSHUTTINGDOWN(cm) (cm->flags |= ISC_HTTPDMGR_FLAGSHUTTINGDOWN) #ifdef DEBUG_HTTPD #define ENTER(x) do { fprintf(stderr, "ENTER %s\n", (x)); } while (0) #define EXIT(x) do { fprintf(stderr, "EXIT %s\n", (x)); } while (0) #define NOTICE(x) do { fprintf(stderr, "NOTICE %s\n", (x)); } while (0) #else #define ENTER(x) do { } while(0) #define EXIT(x) do { } while(0) #define NOTICE(x) do { } while(0) #endif #define HTTP_RECVLEN 1024 #define HTTP_SENDGROW 1024 #define HTTP_SEND_MAXLEN 10240 /*% * HTTP urls. These are the URLs we manage, and the function to call to * provide the data for it. We pass in the base url (so the same function * can handle multiple requests), and a structure to fill in to return a * result to the client. We also pass in a pointer to be filled in for * the data cleanup function. */ struct isc_httpdurl { char *url; isc_httpdaction_t *action; void *action_arg; ISC_LINK(isc_httpdurl_t) link; }; #define HTTPD_CLOSE 0x0001 /* Got a Connection: close header */ #define HTTPD_FOUNDHOST 0x0002 /* Got a Host: header */ /*% http client */ struct isc_httpd { isc_httpdmgr_t *mgr; /*%< our parent */ ISC_LINK(isc_httpd_t) link; unsigned int state; isc_socket_t *sock; /*% * Received data state. */ char recvbuf[HTTP_RECVLEN]; /*%< receive buffer */ isc_uint32_t recvlen; /*%< length recv'd */ unsigned int method; char *url; char *querystring; char *protocol; /* * Flags on the httpd client. */ int flags; /*% * Transmit data state. * * This is the data buffer we will transmit. * * This free function pointer is filled in by the rendering function * we call. The free function is called after the data is transmitted * to the client. * * The bufflist is the list of buffers we are currently transmitting. * The headerdata is where we render our headers to. If we run out of * space when rendering a header, we will change the size of our * buffer. We will not free it until we are finished, and will * allocate an additional HTTP_SENDGROW bytes per header space grow. * * We currently use two buffers total, one for the headers (which * we manage) and another for the client to fill in (which it manages, * it provides the space for it, etc) -- we will pass that buffer * structure back to the caller, who is responsible for managing the * space it may have allocated as backing store for it. This second * buffer is bodybuffer, and we only allocate the buffer itself, not * the backing store. */ isc_bufferlist_t bufflist; char *headerdata; /*%< send header buf */ unsigned int headerlen; /*%< current header buffer size */ isc_buffer_t headerbuffer; const char *mimetype; unsigned int retcode; const char *retmsg; isc_buffer_t bodybuffer; isc_httpdfree_t *freecb; void *freecb_arg; }; /*% lightweight socket manager for httpd output */ struct isc_httpdmgr { isc_mem_t *mctx; isc_socket_t *sock; /*%< listening socket */ isc_task_t *task; /*%< owning task */ isc_timermgr_t *timermgr; isc_httpdclientok_t *client_ok; /*%< client validator */ isc_httpdondestroy_t *ondestroy; /*%< cleanup callback */ void *cb_arg; /*%< argument for the above */ unsigned int flags; ISC_LIST(isc_httpd_t) running; /*%< running clients */ isc_mutex_t lock; ISC_LIST(isc_httpdurl_t) urls; /*%< urls we manage */ isc_httpdaction_t *render_404; }; /*% * HTTP methods. */ #define ISC_HTTPD_METHODUNKNOWN 0 #define ISC_HTTPD_METHODGET 1 #define ISC_HTTPD_METHODPOST 2 /*% * Client states. * * _IDLE The client is not doing anything at all. This state should * only occur just after creation, and just before being * destroyed. * * _RECV The client is waiting for data after issuing a socket recv(). * * _RECVDONE Data has been received, and is being processed. * * _SEND All data for a response has completed, and a reply was * sent via a socket send() call. * * _SENDDONE Send is completed. * * Badly formatted state table: * * IDLE -> RECV when client has a recv() queued. * * RECV -> RECVDONE when recvdone event received. * * RECVDONE -> SEND if the data for a reply is at hand. * * SEND -> RECV when a senddone event was received. * * At any time -> RECV on error. If RECV fails, the client will * self-destroy, closing the socket and freeing memory. */ #define ISC_HTTPD_STATEIDLE 0 #define ISC_HTTPD_STATERECV 1 #define ISC_HTTPD_STATERECVDONE 2 #define ISC_HTTPD_STATESEND 3 #define ISC_HTTPD_STATESENDDONE 4 #define ISC_HTTPD_ISRECV(c) ((c)->state == ISC_HTTPD_STATERECV) #define ISC_HTTPD_ISRECVDONE(c) ((c)->state == ISC_HTTPD_STATERECVDONE) #define ISC_HTTPD_ISSEND(c) ((c)->state == ISC_HTTPD_STATESEND) #define ISC_HTTPD_ISSENDDONE(c) ((c)->state == ISC_HTTPD_STATESENDDONE) /*% * Overall magic test that means we're not idle. */ #define ISC_HTTPD_SETRECV(c) ((c)->state = ISC_HTTPD_STATERECV) #define ISC_HTTPD_SETRECVDONE(c) ((c)->state = ISC_HTTPD_STATERECVDONE) #define ISC_HTTPD_SETSEND(c) ((c)->state = ISC_HTTPD_STATESEND) #define ISC_HTTPD_SETSENDDONE(c) ((c)->state = ISC_HTTPD_STATESENDDONE) static void isc_httpd_accept(isc_task_t *, isc_event_t *); static void isc_httpd_recvdone(isc_task_t *, isc_event_t *); static void isc_httpd_senddone(isc_task_t *, isc_event_t *); static void destroy_client(isc_httpd_t **); static isc_result_t process_request(isc_httpd_t *, int); static void httpdmgr_destroy(isc_httpdmgr_t *); static isc_result_t grow_headerspace(isc_httpd_t *); static void reset_client(isc_httpd_t *httpd); static isc_result_t render_404(const char *, const char *, void *, unsigned int *, const char **, const char **, isc_buffer_t *, isc_httpdfree_t **, void **); static void destroy_client(isc_httpd_t **httpdp) { isc_httpd_t *httpd = *httpdp; isc_httpdmgr_t *httpdmgr = httpd->mgr; *httpdp = NULL; LOCK(&httpdmgr->lock); isc_socket_detach(&httpd->sock); ISC_LIST_UNLINK(httpdmgr->running, httpd, link); if (httpd->headerlen > 0) isc_mem_put(httpdmgr->mctx, httpd->headerdata, httpd->headerlen); isc_mem_put(httpdmgr->mctx, httpd, sizeof(isc_httpd_t)); UNLOCK(&httpdmgr->lock); httpdmgr_destroy(httpdmgr); } isc_result_t isc_httpdmgr_create(isc_mem_t *mctx, isc_socket_t *sock, isc_task_t *task, isc_httpdclientok_t *client_ok, isc_httpdondestroy_t *ondestroy, void *cb_arg, isc_timermgr_t *tmgr, isc_httpdmgr_t **httpdp) { isc_result_t result; isc_httpdmgr_t *httpd; REQUIRE(mctx != NULL); REQUIRE(sock != NULL); REQUIRE(task != NULL); REQUIRE(tmgr != NULL); REQUIRE(httpdp != NULL && *httpdp == NULL); httpd = isc_mem_get(mctx, sizeof(isc_httpdmgr_t)); if (httpd == NULL) return (ISC_R_NOMEMORY); result = isc_mutex_init(&httpd->lock); if (result != ISC_R_SUCCESS) { isc_mem_put(mctx, httpd, sizeof(isc_httpdmgr_t)); return (result); } httpd->mctx = NULL; isc_mem_attach(mctx, &httpd->mctx); httpd->sock = NULL; isc_socket_attach(sock, &httpd->sock); httpd->task = NULL; isc_task_attach(task, &httpd->task); httpd->timermgr = tmgr; /* XXXMLG no attach function? */ httpd->client_ok = client_ok; httpd->ondestroy = ondestroy; httpd->cb_arg = cb_arg; ISC_LIST_INIT(httpd->running); ISC_LIST_INIT(httpd->urls); /* XXXMLG ignore errors on isc_socket_listen() */ result = isc_socket_listen(sock, SOMAXCONN); if (result != ISC_R_SUCCESS) { UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_socket_listen() failed: %s", isc_result_totext(result)); goto cleanup; } (void)isc_socket_filter(sock, "httpready"); result = isc_socket_accept(sock, task, isc_httpd_accept, httpd); if (result != ISC_R_SUCCESS) goto cleanup; httpd->render_404 = render_404; *httpdp = httpd; return (ISC_R_SUCCESS); cleanup: isc_task_detach(&httpd->task); isc_socket_detach(&httpd->sock); isc_mem_detach(&httpd->mctx); isc_mutex_destroy(&httpd->lock); isc_mem_put(mctx, httpd, sizeof(isc_httpdmgr_t)); return (result); } static void httpdmgr_destroy(isc_httpdmgr_t *httpdmgr) { isc_mem_t *mctx; isc_httpdurl_t *url; ENTER("httpdmgr_destroy"); LOCK(&httpdmgr->lock); if (!MSHUTTINGDOWN(httpdmgr)) { NOTICE("httpdmgr_destroy not shutting down yet"); UNLOCK(&httpdmgr->lock); return; } /* * If all clients are not shut down, don't do anything yet. */ if (!ISC_LIST_EMPTY(httpdmgr->running)) { NOTICE("httpdmgr_destroy clients still active"); UNLOCK(&httpdmgr->lock); return; } NOTICE("httpdmgr_destroy detaching socket, task, and timermgr"); isc_socket_detach(&httpdmgr->sock); isc_task_detach(&httpdmgr->task); httpdmgr->timermgr = NULL; /* * Clear out the list of all actions we know about. Just free the * memory. */ url = ISC_LIST_HEAD(httpdmgr->urls); while (url != NULL) { isc_mem_free(httpdmgr->mctx, url->url); ISC_LIST_UNLINK(httpdmgr->urls, url, link); isc_mem_put(httpdmgr->mctx, url, sizeof(isc_httpdurl_t)); url = ISC_LIST_HEAD(httpdmgr->urls); } UNLOCK(&httpdmgr->lock); isc_mutex_destroy(&httpdmgr->lock); if (httpdmgr->ondestroy != NULL) (httpdmgr->ondestroy)(httpdmgr->cb_arg); mctx = httpdmgr->mctx; isc_mem_putanddetach(&mctx, httpdmgr, sizeof(isc_httpdmgr_t)); EXIT("httpdmgr_destroy"); } #define LENGTHOK(s) (httpd->recvbuf - (s) < (int)httpd->recvlen) #define BUFLENOK(s) (httpd->recvbuf - (s) < HTTP_RECVLEN) static isc_result_t process_request(isc_httpd_t *httpd, int length) { char *s; char *p; int delim; ENTER("request"); httpd->recvlen += length; httpd->recvbuf[httpd->recvlen] = 0; /* * If we don't find a blank line in our buffer, return that we need * more data. */ s = strstr(httpd->recvbuf, "\r\n\r\n"); delim = 1; if (s == NULL) { s = strstr(httpd->recvbuf, "\n\n"); delim = 2; } if (s == NULL) return (ISC_R_NOTFOUND); /* * Determine if this is a POST or GET method. Any other values will * cause an error to be returned. */ if (strncmp(httpd->recvbuf, "GET ", 4) == 0) { httpd->method = ISC_HTTPD_METHODGET; p = httpd->recvbuf + 4; } else if (strncmp(httpd->recvbuf, "POST ", 5) == 0) { httpd->method = ISC_HTTPD_METHODPOST; p = httpd->recvbuf + 5; } else { return (ISC_R_RANGE); } /* * From now on, p is the start of our buffer. */ /* * Extract the URL. */ s = p; while (LENGTHOK(s) && BUFLENOK(s) && (*s != '\n' && *s != '\r' && *s != '\0' && *s != ' ')) s++; if (!LENGTHOK(s)) return (ISC_R_NOTFOUND); if (!BUFLENOK(s)) return (ISC_R_NOMEMORY); *s = 0; /* * Make the URL relative. */ if ((strncmp(p, "http:/", 6) == 0) || (strncmp(p, "https:/", 7) == 0)) { /* Skip first / */ while (*p != '/' && *p != 0) p++; if (*p == 0) return (ISC_R_RANGE); p++; /* Skip second / */ while (*p != '/' && *p != 0) p++; if (*p == 0) return (ISC_R_RANGE); p++; /* Find third / */ while (*p != '/' && *p != 0) p++; if (*p == 0) { p--; *p = '/'; } } httpd->url = p; p = s + delim; s = p; /* * Now, see if there is a ? mark in the URL. If so, this is * part of the query string, and we will split it from the URL. */ httpd->querystring = strchr(httpd->url, '?'); if (httpd->querystring != NULL) { *(httpd->querystring) = 0; httpd->querystring++; } /* * Extract the HTTP/1.X protocol. We will bounce on anything but * HTTP/1.1 for now. */ while (LENGTHOK(s) && BUFLENOK(s) && (*s != '\n' && *s != '\r' && *s != '\0')) s++; if (!LENGTHOK(s)) return (ISC_R_NOTFOUND); if (!BUFLENOK(s)) return (ISC_R_NOMEMORY); *s = 0; if ((strncmp(p, "HTTP/1.0", 8) != 0) && (strncmp(p, "HTTP/1.1", 8) != 0)) return (ISC_R_RANGE); httpd->protocol = p; p = s + 1; s = p; if (strstr(s, "Connection: close") != NULL) httpd->flags |= HTTPD_CLOSE; if (strstr(s, "Host: ") != NULL) httpd->flags |= HTTPD_FOUNDHOST; /* * Standards compliance hooks here. */ if (strcmp(httpd->protocol, "HTTP/1.1") == 0 && ((httpd->flags & HTTPD_FOUNDHOST) == 0)) return (ISC_R_RANGE); EXIT("request"); return (ISC_R_SUCCESS); } static void isc_httpd_accept(isc_task_t *task, isc_event_t *ev) { isc_result_t result; isc_httpdmgr_t *httpdmgr = ev->ev_arg; isc_httpd_t *httpd; isc_region_t r; isc_socket_newconnev_t *nev = (isc_socket_newconnev_t *)ev; isc_sockaddr_t peeraddr; ENTER("accept"); LOCK(&httpdmgr->lock); if (MSHUTTINGDOWN(httpdmgr)) { NOTICE("accept shutting down, goto out"); goto out; } if (nev->result == ISC_R_CANCELED) { NOTICE("accept canceled, goto out"); goto out; } if (nev->result != ISC_R_SUCCESS) { /* XXXMLG log failure */ NOTICE("accept returned failure, goto requeue"); goto requeue; } (void)isc_socket_getpeername(nev->newsocket, &peeraddr); if (httpdmgr->client_ok != NULL && !(httpdmgr->client_ok)(&peeraddr, httpdmgr->cb_arg)) { isc_socket_detach(&nev->newsocket); goto requeue; } httpd = isc_mem_get(httpdmgr->mctx, sizeof(isc_httpd_t)); if (httpd == NULL) { /* XXXMLG log failure */ NOTICE("accept failed to allocate memory, goto requeue"); isc_socket_detach(&nev->newsocket); goto requeue; } httpd->mgr = httpdmgr; ISC_LINK_INIT(httpd, link); ISC_LIST_APPEND(httpdmgr->running, httpd, link); ISC_HTTPD_SETRECV(httpd); httpd->sock = nev->newsocket; isc_socket_setname(httpd->sock, "httpd", NULL); httpd->flags = 0; /* * Initialize the buffer for our headers. */ httpd->headerdata = isc_mem_get(httpdmgr->mctx, HTTP_SENDGROW); if (httpd->headerdata == NULL) { isc_mem_put(httpdmgr->mctx, httpd, sizeof(isc_httpd_t)); isc_socket_detach(&nev->newsocket); goto requeue; } httpd->headerlen = HTTP_SENDGROW; isc_buffer_init(&httpd->headerbuffer, httpd->headerdata, httpd->headerlen); ISC_LIST_INIT(httpd->bufflist); isc_buffer_initnull(&httpd->bodybuffer); reset_client(httpd); r.base = (unsigned char *)httpd->recvbuf; r.length = HTTP_RECVLEN - 1; result = isc_socket_recv(httpd->sock, &r, 1, task, isc_httpd_recvdone, httpd); NOTICE("accept queued recv on socket"); requeue: result = isc_socket_accept(httpdmgr->sock, task, isc_httpd_accept, httpdmgr); if (result != ISC_R_SUCCESS) { /* XXXMLG what to do? Log failure... */ NOTICE("accept could not reaccept due to failure"); } out: UNLOCK(&httpdmgr->lock); httpdmgr_destroy(httpdmgr); isc_event_free(&ev); EXIT("accept"); } static isc_result_t render_404(const char *url, const char *querystring, void *arg, unsigned int *retcode, const char **retmsg, const char **mimetype, isc_buffer_t *b, isc_httpdfree_t **freecb, void **freecb_args) { static char msg[] = "No such URL."; UNUSED(url); UNUSED(querystring); UNUSED(arg); *retcode = 404; *retmsg = "No such URL"; *mimetype = "text/plain"; isc_buffer_reinit(b, msg, strlen(msg)); isc_buffer_add(b, strlen(msg)); *freecb = NULL; *freecb_args = NULL; return (ISC_R_SUCCESS); } static void isc_httpd_recvdone(isc_task_t *task, isc_event_t *ev) { isc_region_t r; isc_result_t result; isc_httpd_t *httpd = ev->ev_arg; isc_socketevent_t *sev = (isc_socketevent_t *)ev; isc_httpdurl_t *url; isc_time_t now; char datebuf[32]; /* Only need 30, but safety first */ ENTER("recv"); INSIST(ISC_HTTPD_ISRECV(httpd)); if (sev->result != ISC_R_SUCCESS) { NOTICE("recv destroying client"); destroy_client(&httpd); goto out; } result = process_request(httpd, sev->n); if (result == ISC_R_NOTFOUND) { if (httpd->recvlen >= HTTP_RECVLEN - 1) { destroy_client(&httpd); goto out; } r.base = (unsigned char *)httpd->recvbuf + httpd->recvlen; r.length = HTTP_RECVLEN - httpd->recvlen - 1; result = isc_socket_recv(httpd->sock, &r, 1, task, isc_httpd_recvdone, httpd); goto out; } else if (result != ISC_R_SUCCESS) { destroy_client(&httpd); goto out; } ISC_HTTPD_SETSEND(httpd); /* * XXXMLG Call function here. Provide an add-header function * which will append the common headers to a response we generate. */ isc_buffer_initnull(&httpd->bodybuffer); isc_time_now(&now); isc_time_formathttptimestamp(&now, datebuf, sizeof(datebuf)); url = ISC_LIST_HEAD(httpd->mgr->urls); while (url != NULL) { if (strcmp(httpd->url, url->url) == 0) break; url = ISC_LIST_NEXT(url, link); } if (url == NULL) result = httpd->mgr->render_404(httpd->url, httpd->querystring, NULL, &httpd->retcode, &httpd->retmsg, &httpd->mimetype, &httpd->bodybuffer, &httpd->freecb, &httpd->freecb_arg); else result = url->action(httpd->url, httpd->querystring, url->action_arg, &httpd->retcode, &httpd->retmsg, &httpd->mimetype, &httpd->bodybuffer, &httpd->freecb, &httpd->freecb_arg); if (result != ISC_R_SUCCESS) { destroy_client(&httpd); goto out; } isc_httpd_response(httpd); isc_httpd_addheader(httpd, "Content-Type", httpd->mimetype); isc_httpd_addheader(httpd, "Date", datebuf); isc_httpd_addheader(httpd, "Expires", datebuf); isc_httpd_addheader(httpd, "Last-Modified", datebuf); isc_httpd_addheader(httpd, "Pragma: no-cache", NULL); isc_httpd_addheader(httpd, "Cache-Control: no-cache", NULL); isc_httpd_addheader(httpd, "Server: libisc", NULL); isc_httpd_addheaderuint(httpd, "Content-Length", isc_buffer_usedlength(&httpd->bodybuffer)); isc_httpd_endheaders(httpd); /* done */ ISC_LIST_APPEND(httpd->bufflist, &httpd->headerbuffer, link); /* * Link the data buffer into our send queue, should we have any data * rendered into it. If no data is present, we won't do anything * with the buffer. */ if (isc_buffer_length(&httpd->bodybuffer) > 0) ISC_LIST_APPEND(httpd->bufflist, &httpd->bodybuffer, link); result = isc_socket_sendv(httpd->sock, &httpd->bufflist, task, isc_httpd_senddone, httpd); out: isc_event_free(&ev); EXIT("recv"); } void isc_httpdmgr_shutdown(isc_httpdmgr_t **httpdmgrp) { isc_httpdmgr_t *httpdmgr; isc_httpd_t *httpd; httpdmgr = *httpdmgrp; *httpdmgrp = NULL; ENTER("isc_httpdmgr_shutdown"); LOCK(&httpdmgr->lock); MSETSHUTTINGDOWN(httpdmgr); isc_socket_cancel(httpdmgr->sock, httpdmgr->task, ISC_SOCKCANCEL_ALL); httpd = ISC_LIST_HEAD(httpdmgr->running); while (httpd != NULL) { isc_socket_cancel(httpd->sock, httpdmgr->task, ISC_SOCKCANCEL_ALL); httpd = ISC_LIST_NEXT(httpd, link); } UNLOCK(&httpdmgr->lock); EXIT("isc_httpdmgr_shutdown"); } static isc_result_t grow_headerspace(isc_httpd_t *httpd) { char *newspace; unsigned int newlen; isc_region_t r; newlen = httpd->headerlen + HTTP_SENDGROW; if (newlen > HTTP_SEND_MAXLEN) return (ISC_R_NOSPACE); newspace = isc_mem_get(httpd->mgr->mctx, newlen); if (newspace == NULL) return (ISC_R_NOMEMORY); isc_buffer_region(&httpd->headerbuffer, &r); isc_buffer_reinit(&httpd->headerbuffer, newspace, newlen); isc_mem_put(httpd->mgr->mctx, r.base, r.length); return (ISC_R_SUCCESS); } isc_result_t isc_httpd_response(isc_httpd_t *httpd) { isc_result_t result; unsigned int needlen; needlen = strlen(httpd->protocol) + 1; /* protocol + space */ needlen += 3 + 1; /* room for response code, always 3 bytes */ needlen += strlen(httpd->retmsg) + 2; /* return msg + CRLF */ if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) { result = grow_headerspace(httpd); if (result != ISC_R_SUCCESS) return (result); } sprintf(isc_buffer_used(&httpd->headerbuffer), "%s %03d %s\r\n", httpd->protocol, httpd->retcode, httpd->retmsg); isc_buffer_add(&httpd->headerbuffer, needlen); return (ISC_R_SUCCESS); } isc_result_t isc_httpd_addheader(isc_httpd_t *httpd, const char *name, const char *val) { isc_result_t result; unsigned int needlen; needlen = strlen(name); /* name itself */ if (val != NULL) needlen += 2 + strlen(val); /* : and val */ needlen += 2; /* CRLF */ if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) { result = grow_headerspace(httpd); if (result != ISC_R_SUCCESS) return (result); } if (val != NULL) sprintf(isc_buffer_used(&httpd->headerbuffer), "%s: %s\r\n", name, val); else sprintf(isc_buffer_used(&httpd->headerbuffer), "%s\r\n", name); isc_buffer_add(&httpd->headerbuffer, needlen); return (ISC_R_SUCCESS); } isc_result_t isc_httpd_endheaders(isc_httpd_t *httpd) { isc_result_t result; if (isc_buffer_availablelength(&httpd->headerbuffer) < 2) { result = grow_headerspace(httpd); if (result != ISC_R_SUCCESS) return (result); } sprintf(isc_buffer_used(&httpd->headerbuffer), "\r\n"); isc_buffer_add(&httpd->headerbuffer, 2); return (ISC_R_SUCCESS); } isc_result_t isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val) { isc_result_t result; unsigned int needlen; char buf[sizeof "18446744073709551616"]; sprintf(buf, "%d", val); needlen = strlen(name); /* name itself */ needlen += 2 + strlen(buf); /* : and val */ needlen += 2; /* CRLF */ if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) { result = grow_headerspace(httpd); if (result != ISC_R_SUCCESS) return (result); } sprintf(isc_buffer_used(&httpd->headerbuffer), "%s: %s\r\n", name, buf); isc_buffer_add(&httpd->headerbuffer, needlen); return (ISC_R_SUCCESS); } static void isc_httpd_senddone(isc_task_t *task, isc_event_t *ev) { isc_httpd_t *httpd = ev->ev_arg; isc_region_t r; isc_result_t result; isc_socketevent_t *sev = (isc_socketevent_t *)ev; ENTER("senddone"); INSIST(ISC_HTTPD_ISSEND(httpd)); /* * First, unlink our header buffer from the socket's bufflist. This * is sort of an evil hack, since we know our buffer will be there, * and we know it's address, so we can just remove it directly. */ NOTICE("senddone unlinked header"); ISC_LIST_UNLINK(sev->bufferlist, &httpd->headerbuffer, link); /* * We will always want to clean up our receive buffer, even if we * got an error on send or we are shutting down. * * We will pass in the buffer only if there is data in it. If * there is no data, we will pass in a NULL. */ if (httpd->freecb != NULL) { isc_buffer_t *b = NULL; if (isc_buffer_length(&httpd->bodybuffer) > 0) b = &httpd->bodybuffer; httpd->freecb(b, httpd->freecb_arg); NOTICE("senddone free callback performed"); } if (ISC_LINK_LINKED(&httpd->bodybuffer, link)) { ISC_LIST_UNLINK(sev->bufferlist, &httpd->bodybuffer, link); NOTICE("senddone body buffer unlinked"); } if (sev->result != ISC_R_SUCCESS) { destroy_client(&httpd); goto out; } if ((httpd->flags & HTTPD_CLOSE) != 0) { destroy_client(&httpd); goto out; } ISC_HTTPD_SETRECV(httpd); NOTICE("senddone restarting recv on socket"); reset_client(httpd); r.base = (unsigned char *)httpd->recvbuf; r.length = HTTP_RECVLEN - 1; result = isc_socket_recv(httpd->sock, &r, 1, task, isc_httpd_recvdone, httpd); out: isc_event_free(&ev); EXIT("senddone"); } static void reset_client(isc_httpd_t *httpd) { /* * Catch errors here. We MUST be in RECV mode, and we MUST NOT have * any outstanding buffers. If we have buffers, we have a leak. */ INSIST(ISC_HTTPD_ISRECV(httpd)); INSIST(!ISC_LINK_LINKED(&httpd->headerbuffer, link)); INSIST(!ISC_LINK_LINKED(&httpd->bodybuffer, link)); httpd->recvbuf[0] = 0; httpd->recvlen = 0; httpd->method = ISC_HTTPD_METHODUNKNOWN; httpd->url = NULL; httpd->querystring = NULL; httpd->protocol = NULL; httpd->flags = 0; isc_buffer_clear(&httpd->headerbuffer); isc_buffer_invalidate(&httpd->bodybuffer); } isc_result_t isc_httpdmgr_addurl(isc_httpdmgr_t *httpdmgr, const char *url, isc_httpdaction_t *func, void *arg) { isc_httpdurl_t *item; if (url == NULL) { httpdmgr->render_404 = func; return (ISC_R_SUCCESS); } item = isc_mem_get(httpdmgr->mctx, sizeof(isc_httpdurl_t)); if (item == NULL) return (ISC_R_NOMEMORY); item->url = isc_mem_strdup(httpdmgr->mctx, url); if (item->url == NULL) { isc_mem_put(httpdmgr->mctx, item, sizeof(isc_httpdurl_t)); return (ISC_R_NOMEMORY); } item->action = func; item->action_arg = arg; ISC_LINK_INIT(item, link); ISC_LIST_APPEND(httpdmgr->urls, item, link); return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/api0000644000175000017500000000005511307651604013634 0ustar peterpeterLIBINTERFACE = 51 LIBREVISION = 1 LIBAGE = 1 ntp-4.2.6p5/lib/isc/symtab.c0000644000175000017500000001432211307651603014604 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1996-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: symtab.c,v 1.30 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include typedef struct elt { char * key; unsigned int type; isc_symvalue_t value; LINK(struct elt) link; } elt_t; typedef LIST(elt_t) eltlist_t; #define SYMTAB_MAGIC ISC_MAGIC('S', 'y', 'm', 'T') #define VALID_SYMTAB(st) ISC_MAGIC_VALID(st, SYMTAB_MAGIC) struct isc_symtab { /* Unlocked. */ unsigned int magic; isc_mem_t * mctx; unsigned int size; eltlist_t * table; isc_symtabaction_t undefine_action; void * undefine_arg; isc_boolean_t case_sensitive; }; isc_result_t isc_symtab_create(isc_mem_t *mctx, unsigned int size, isc_symtabaction_t undefine_action, void *undefine_arg, isc_boolean_t case_sensitive, isc_symtab_t **symtabp) { isc_symtab_t *symtab; unsigned int i; REQUIRE(mctx != NULL); REQUIRE(symtabp != NULL && *symtabp == NULL); REQUIRE(size > 0); /* Should be prime. */ symtab = (isc_symtab_t *)isc_mem_get(mctx, sizeof(*symtab)); if (symtab == NULL) return (ISC_R_NOMEMORY); symtab->table = (eltlist_t *)isc_mem_get(mctx, size * sizeof(eltlist_t)); if (symtab->table == NULL) { isc_mem_put(mctx, symtab, sizeof(*symtab)); return (ISC_R_NOMEMORY); } for (i = 0; i < size; i++) INIT_LIST(symtab->table[i]); symtab->mctx = mctx; symtab->size = size; symtab->undefine_action = undefine_action; symtab->undefine_arg = undefine_arg; symtab->case_sensitive = case_sensitive; symtab->magic = SYMTAB_MAGIC; *symtabp = symtab; return (ISC_R_SUCCESS); } void isc_symtab_destroy(isc_symtab_t **symtabp) { isc_symtab_t *symtab; unsigned int i; elt_t *elt, *nelt; REQUIRE(symtabp != NULL); symtab = *symtabp; REQUIRE(VALID_SYMTAB(symtab)); for (i = 0; i < symtab->size; i++) { for (elt = HEAD(symtab->table[i]); elt != NULL; elt = nelt) { nelt = NEXT(elt, link); if (symtab->undefine_action != NULL) (symtab->undefine_action)(elt->key, elt->type, elt->value, symtab->undefine_arg); isc_mem_put(symtab->mctx, elt, sizeof(*elt)); } } isc_mem_put(symtab->mctx, symtab->table, symtab->size * sizeof(eltlist_t)); symtab->magic = 0; isc_mem_put(symtab->mctx, symtab, sizeof(*symtab)); *symtabp = NULL; } static inline unsigned int hash(const char *key, isc_boolean_t case_sensitive) { const char *s; unsigned int h = 0; int c; /* * This hash function is similar to the one Ousterhout * uses in Tcl. */ if (case_sensitive) { for (s = key; *s != '\0'; s++) { h += (h << 3) + *s; } } else { for (s = key; *s != '\0'; s++) { c = *s; c = tolower((unsigned char)c); h += (h << 3) + c; } } return (h); } #define FIND(s, k, t, b, e) \ b = hash((k), (s)->case_sensitive) % (s)->size; \ if ((s)->case_sensitive) { \ for (e = HEAD((s)->table[b]); e != NULL; e = NEXT(e, link)) { \ if (((t) == 0 || e->type == (t)) && \ strcmp(e->key, (k)) == 0) \ break; \ } \ } else { \ for (e = HEAD((s)->table[b]); e != NULL; e = NEXT(e, link)) { \ if (((t) == 0 || e->type == (t)) && \ strcasecmp(e->key, (k)) == 0) \ break; \ } \ } isc_result_t isc_symtab_lookup(isc_symtab_t *symtab, const char *key, unsigned int type, isc_symvalue_t *value) { unsigned int bucket; elt_t *elt; REQUIRE(VALID_SYMTAB(symtab)); REQUIRE(key != NULL); FIND(symtab, key, type, bucket, elt); if (elt == NULL) return (ISC_R_NOTFOUND); if (value != NULL) *value = elt->value; return (ISC_R_SUCCESS); } isc_result_t isc_symtab_define(isc_symtab_t *symtab, const char *key, unsigned int type, isc_symvalue_t value, isc_symexists_t exists_policy) { unsigned int bucket; elt_t *elt; REQUIRE(VALID_SYMTAB(symtab)); REQUIRE(key != NULL); REQUIRE(type != 0); FIND(symtab, key, type, bucket, elt); if (exists_policy != isc_symexists_add && elt != NULL) { if (exists_policy == isc_symexists_reject) return (ISC_R_EXISTS); INSIST(exists_policy == isc_symexists_replace); UNLINK(symtab->table[bucket], elt, link); if (symtab->undefine_action != NULL) (symtab->undefine_action)(elt->key, elt->type, elt->value, symtab->undefine_arg); } else { elt = (elt_t *)isc_mem_get(symtab->mctx, sizeof(*elt)); if (elt == NULL) return (ISC_R_NOMEMORY); ISC_LINK_INIT(elt, link); } /* * Though the "key" can be const coming in, it is not stored as const * so that the calling program can easily have writable access to * it in its undefine_action function. In the event that it *was* * truly const coming in and then the caller modified it anyway ... * well, don't do that! */ DE_CONST(key, elt->key); elt->type = type; elt->value = value; /* * We prepend so that the most recent definition will be found. */ PREPEND(symtab->table[bucket], elt, link); return (ISC_R_SUCCESS); } isc_result_t isc_symtab_undefine(isc_symtab_t *symtab, const char *key, unsigned int type) { unsigned int bucket; elt_t *elt; REQUIRE(VALID_SYMTAB(symtab)); REQUIRE(key != NULL); FIND(symtab, key, type, bucket, elt); if (elt == NULL) return (ISC_R_NOTFOUND); if (symtab->undefine_action != NULL) (symtab->undefine_action)(elt->key, elt->type, elt->value, symtab->undefine_arg); UNLINK(symtab->table[bucket], elt, link); isc_mem_put(symtab->mctx, elt, sizeof(*elt)); return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/nothreads/0000755000175000017500000000000011675461367015144 5ustar peterpeterntp-4.2.6p5/lib/isc/nothreads/condition.c0000644000175000017500000000174011307651604017263 0ustar peterpeter/* * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: condition.c,v 1.10 2007/06/19 23:47:18 tbox Exp $ */ #include #include EMPTY_TRANSLATION_UNIT ntp-4.2.6p5/lib/isc/nothreads/include/0000755000175000017500000000000011307651602016550 5ustar peterpeterntp-4.2.6p5/lib/isc/nothreads/include/isc/0000755000175000017500000000000011675461367017345 5ustar peterpeterntp-4.2.6p5/lib/isc/nothreads/include/isc/mutex.h0000644000175000017500000000273011307651604020645 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: mutex.h,v 1.6 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_MUTEX_H #define ISC_MUTEX_H 1 #include /* for ISC_R_ codes */ typedef int isc_mutex_t; #define isc_mutex_init(mp) \ (*(mp) = 0, ISC_R_SUCCESS) #define isc_mutex_lock(mp) \ ((*(mp))++ == 0 ? ISC_R_SUCCESS : ISC_R_UNEXPECTED) #define isc_mutex_unlock(mp) \ (--(*(mp)) == 0 ? ISC_R_SUCCESS : ISC_R_UNEXPECTED) #define isc_mutex_trylock(mp) \ (*(mp) == 0 ? ((*(mp))++, ISC_R_SUCCESS) : ISC_R_LOCKBUSY) #define isc_mutex_destroy(mp) \ (*(mp) == 0 ? (*(mp) = -1, ISC_R_SUCCESS) : ISC_R_UNEXPECTED) #define isc_mutex_stats(fp) #endif /* ISC_MUTEX_H */ ntp-4.2.6p5/lib/isc/nothreads/include/isc/condition.h0000644000175000017500000000412611307651604021472 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: condition.h,v 1.6 2007/06/19 23:47:18 tbox Exp $ */ /* * This provides a limited subset of the isc_condition_t * functionality for use by single-threaded programs that * need to block waiting for events. Only a single * call to isc_condition_wait() may be blocked at any given * time, and the _waituntil and _broadcast functions are not * supported. This is intended primarily for use by the omapi * library, and may go away once omapi goes away. Use for * other purposes is strongly discouraged. */ #ifndef ISC_CONDITION_H #define ISC_CONDITION_H 1 #include typedef int isc_condition_t; isc_result_t isc__nothread_wait_hack(isc_condition_t *cp, isc_mutex_t *mp); isc_result_t isc__nothread_signal_hack(isc_condition_t *cp); #define isc_condition_init(cp) \ (*(cp) = 0, ISC_R_SUCCESS) #define isc_condition_wait(cp, mp) \ isc__nothread_wait_hack(cp, mp) #define isc_condition_waituntil(cp, mp, tp) \ ((void)(cp), (void)(mp), (void)(tp), ISC_R_NOTIMPLEMENTED) #define isc_condition_signal(cp) \ isc__nothread_signal_hack(cp) #define isc_condition_broadcast(cp) \ ((void)(cp), ISC_R_NOTIMPLEMENTED) #define isc_condition_destroy(cp) \ (*(cp) == 0 ? (*(cp) = -1, ISC_R_SUCCESS) : ISC_R_UNEXPECTED) #endif /* ISC_CONDITION_H */ ntp-4.2.6p5/lib/isc/nothreads/include/isc/thread.h0000644000175000017500000000222411307651605020751 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: thread.h,v 1.6 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_THREAD_H #define ISC_THREAD_H 1 #include #include ISC_LANG_BEGINDECLS void isc_thread_setconcurrency(unsigned int level); #define isc_thread_self() ((unsigned long)0) ISC_LANG_ENDDECLS #endif /* ISC_THREAD_H */ ntp-4.2.6p5/lib/isc/nothreads/include/isc/once.h0000644000175000017500000000222011307651603020420 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: once.h,v 1.6 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_ONCE_H #define ISC_ONCE_H 1 #include typedef isc_boolean_t isc_once_t; #define ISC_ONCE_INIT ISC_FALSE #define isc_once_do(op, f) \ (!*(op) ? (f(), *(op) = ISC_TRUE, ISC_R_SUCCESS) : ISC_R_SUCCESS) #endif /* ISC_ONCE_H */ ntp-4.2.6p5/lib/isc/nothreads/thread.c0000644000175000017500000000203611307651604016543 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: thread.c,v 1.5 2007/06/19 23:47:18 tbox Exp $ */ #include #include #include void isc_thread_setconcurrency(unsigned int level) { UNUSED(level); } ntp-4.2.6p5/lib/isc/nothreads/mutex.c0000644000175000017500000000173511307651604016443 0ustar peterpeter/* * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: mutex.c,v 1.10 2007/06/19 23:47:18 tbox Exp $ */ #include #include EMPTY_TRANSLATION_UNIT ntp-4.2.6p5/lib/isc/lex.c0000644000175000017500000005453211307651605014106 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: lex.c,v 1.86 2007/09/17 09:56:29 shane Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef struct inputsource { isc_result_t result; isc_boolean_t is_file; isc_boolean_t need_close; isc_boolean_t at_eof; isc_buffer_t * pushback; unsigned int ignored; void * input; char * name; unsigned long line; unsigned long saved_line; ISC_LINK(struct inputsource) link; } inputsource; #define LEX_MAGIC ISC_MAGIC('L', 'e', 'x', '!') #define VALID_LEX(l) ISC_MAGIC_VALID(l, LEX_MAGIC) struct isc_lex { /* Unlocked. */ unsigned int magic; isc_mem_t * mctx; size_t max_token; char * data; unsigned int comments; isc_boolean_t comment_ok; isc_boolean_t last_was_eol; unsigned int paren_count; unsigned int saved_paren_count; isc_lexspecials_t specials; LIST(struct inputsource) sources; }; static inline isc_result_t grow_data(isc_lex_t *lex, size_t *remainingp, char **currp, char **prevp) { char *new; new = isc_mem_get(lex->mctx, lex->max_token * 2 + 1); if (new == NULL) return (ISC_R_NOMEMORY); memcpy(new, lex->data, lex->max_token + 1); *currp = new + (*currp - lex->data); if (*prevp != NULL) *prevp = new + (*prevp - lex->data); isc_mem_put(lex->mctx, lex->data, lex->max_token + 1); lex->data = new; *remainingp += lex->max_token; lex->max_token *= 2; return (ISC_R_SUCCESS); } isc_result_t isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp) { isc_lex_t *lex; /* * Create a lexer. */ REQUIRE(lexp != NULL && *lexp == NULL); REQUIRE(max_token > 0U); lex = isc_mem_get(mctx, sizeof(*lex)); if (lex == NULL) return (ISC_R_NOMEMORY); lex->data = isc_mem_get(mctx, max_token + 1); if (lex->data == NULL) { isc_mem_put(mctx, lex, sizeof(*lex)); return (ISC_R_NOMEMORY); } lex->mctx = mctx; lex->max_token = max_token; lex->comments = 0; lex->comment_ok = ISC_TRUE; lex->last_was_eol = ISC_TRUE; lex->paren_count = 0; lex->saved_paren_count = 0; memset(lex->specials, 0, 256); INIT_LIST(lex->sources); lex->magic = LEX_MAGIC; *lexp = lex; return (ISC_R_SUCCESS); } void isc_lex_destroy(isc_lex_t **lexp) { isc_lex_t *lex; /* * Destroy the lexer. */ REQUIRE(lexp != NULL); lex = *lexp; REQUIRE(VALID_LEX(lex)); while (!EMPTY(lex->sources)) RUNTIME_CHECK(isc_lex_close(lex) == ISC_R_SUCCESS); if (lex->data != NULL) isc_mem_put(lex->mctx, lex->data, lex->max_token + 1); lex->magic = 0; isc_mem_put(lex->mctx, lex, sizeof(*lex)); *lexp = NULL; } unsigned int isc_lex_getcomments(isc_lex_t *lex) { /* * Return the current lexer commenting styles. */ REQUIRE(VALID_LEX(lex)); return (lex->comments); } void isc_lex_setcomments(isc_lex_t *lex, unsigned int comments) { /* * Set allowed lexer commenting styles. */ REQUIRE(VALID_LEX(lex)); lex->comments = comments; } void isc_lex_getspecials(isc_lex_t *lex, isc_lexspecials_t specials) { /* * Put the current list of specials into 'specials'. */ REQUIRE(VALID_LEX(lex)); memcpy(specials, lex->specials, 256); } void isc_lex_setspecials(isc_lex_t *lex, isc_lexspecials_t specials) { /* * The characters in 'specials' are returned as tokens. Along with * whitespace, they delimit strings and numbers. */ REQUIRE(VALID_LEX(lex)); memcpy(lex->specials, specials, 256); } static inline isc_result_t new_source(isc_lex_t *lex, isc_boolean_t is_file, isc_boolean_t need_close, void *input, const char *name) { inputsource *source; isc_result_t result; source = isc_mem_get(lex->mctx, sizeof(*source)); if (source == NULL) return (ISC_R_NOMEMORY); source->result = ISC_R_SUCCESS; source->is_file = is_file; source->need_close = need_close; source->at_eof = ISC_FALSE; source->input = input; source->name = isc_mem_strdup(lex->mctx, name); if (source->name == NULL) { isc_mem_put(lex->mctx, source, sizeof(*source)); return (ISC_R_NOMEMORY); } source->pushback = NULL; result = isc_buffer_allocate(lex->mctx, &source->pushback, lex->max_token); if (result != ISC_R_SUCCESS) { isc_mem_free(lex->mctx, source->name); isc_mem_put(lex->mctx, source, sizeof(*source)); return (result); } source->ignored = 0; source->line = 1; ISC_LIST_INITANDPREPEND(lex->sources, source, link); return (ISC_R_SUCCESS); } isc_result_t isc_lex_openfile(isc_lex_t *lex, const char *filename) { isc_result_t result; FILE *stream = NULL; /* * Open 'filename' and make it the current input source for 'lex'. */ REQUIRE(VALID_LEX(lex)); result = isc_stdio_open(filename, "r", &stream); if (result != ISC_R_SUCCESS) return (result); result = new_source(lex, ISC_TRUE, ISC_TRUE, stream, filename); if (result != ISC_R_SUCCESS) (void)fclose(stream); return (result); } isc_result_t isc_lex_openstream(isc_lex_t *lex, FILE *stream) { char name[128]; /* * Make 'stream' the current input source for 'lex'. */ REQUIRE(VALID_LEX(lex)); snprintf(name, sizeof(name), "stream-%p", stream); return (new_source(lex, ISC_TRUE, ISC_FALSE, stream, name)); } isc_result_t isc_lex_openbuffer(isc_lex_t *lex, isc_buffer_t *buffer) { char name[128]; /* * Make 'buffer' the current input source for 'lex'. */ REQUIRE(VALID_LEX(lex)); snprintf(name, sizeof(name), "buffer-%p", buffer); return (new_source(lex, ISC_FALSE, ISC_FALSE, buffer, name)); } isc_result_t isc_lex_close(isc_lex_t *lex) { inputsource *source; /* * Close the most recently opened object (i.e. file or buffer). */ REQUIRE(VALID_LEX(lex)); source = HEAD(lex->sources); if (source == NULL) return (ISC_R_NOMORE); ISC_LIST_UNLINK(lex->sources, source, link); if (source->is_file) { if (source->need_close) (void)fclose((FILE *)(source->input)); } isc_mem_free(lex->mctx, source->name); isc_buffer_free(&source->pushback); isc_mem_put(lex->mctx, source, sizeof(*source)); return (ISC_R_SUCCESS); } typedef enum { lexstate_start, lexstate_crlf, lexstate_string, lexstate_number, lexstate_maybecomment, lexstate_ccomment, lexstate_ccommentend, lexstate_eatline, lexstate_qstring } lexstate; #define IWSEOL (ISC_LEXOPT_INITIALWS | ISC_LEXOPT_EOL) static void pushback(inputsource *source, int c) { REQUIRE(source->pushback->current > 0); if (c == EOF) { source->at_eof = ISC_FALSE; return; } source->pushback->current--; if (c == '\n') source->line--; } static isc_result_t pushandgrow(isc_lex_t *lex, inputsource *source, int c) { if (isc_buffer_availablelength(source->pushback) == 0) { isc_buffer_t *tbuf = NULL; unsigned int oldlen; isc_region_t used; isc_result_t result; oldlen = isc_buffer_length(source->pushback); result = isc_buffer_allocate(lex->mctx, &tbuf, oldlen * 2); if (result != ISC_R_SUCCESS) return (result); isc_buffer_usedregion(source->pushback, &used); result = isc_buffer_copyregion(tbuf, &used); INSIST(result == ISC_R_SUCCESS); tbuf->current = source->pushback->current; isc_buffer_free(&source->pushback); source->pushback = tbuf; } isc_buffer_putuint8(source->pushback, (isc_uint8_t)c); return (ISC_R_SUCCESS); } isc_result_t isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { inputsource *source; int c; isc_boolean_t done = ISC_FALSE; isc_boolean_t no_comments = ISC_FALSE; isc_boolean_t escaped = ISC_FALSE; lexstate state = lexstate_start; lexstate saved_state = lexstate_start; isc_buffer_t *buffer; FILE *stream; char *curr, *prev; size_t remaining; isc_uint32_t as_ulong; unsigned int saved_options; isc_result_t result; /* * Get the next token. */ REQUIRE(VALID_LEX(lex)); source = HEAD(lex->sources); REQUIRE(tokenp != NULL); if (source == NULL) { if ((options & ISC_LEXOPT_NOMORE) != 0) { tokenp->type = isc_tokentype_nomore; return (ISC_R_SUCCESS); } return (ISC_R_NOMORE); } if (source->result != ISC_R_SUCCESS) return (source->result); lex->saved_paren_count = lex->paren_count; source->saved_line = source->line; if (isc_buffer_remaininglength(source->pushback) == 0 && source->at_eof) { if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 && lex->paren_count != 0) { lex->paren_count = 0; return (ISC_R_UNBALANCED); } if ((options & ISC_LEXOPT_EOF) != 0) { tokenp->type = isc_tokentype_eof; return (ISC_R_SUCCESS); } return (ISC_R_EOF); } isc_buffer_compact(source->pushback); saved_options = options; if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 && lex->paren_count > 0) options &= ~IWSEOL; curr = lex->data; *curr = '\0'; prev = NULL; remaining = lex->max_token; #ifdef HAVE_FLOCKFILE if (source->is_file) flockfile(source->input); #endif do { if (isc_buffer_remaininglength(source->pushback) == 0) { if (source->is_file) { stream = source->input; #if defined(HAVE_FLOCKFILE) && defined(HAVE_GETCUNLOCKED) c = getc_unlocked(stream); #else c = getc(stream); #endif if (c == EOF) { if (ferror(stream)) { source->result = ISC_R_IOERROR; result = source->result; goto done; } source->at_eof = ISC_TRUE; } } else { buffer = source->input; if (buffer->current == buffer->used) { c = EOF; source->at_eof = ISC_TRUE; } else { c = *((char *)buffer->base + buffer->current); buffer->current++; } } if (c != EOF) { source->result = pushandgrow(lex, source, c); if (source->result != ISC_R_SUCCESS) { result = source->result; goto done; } } } if (!source->at_eof) { if (state == lexstate_start) /* Token has not started yet. */ source->ignored = isc_buffer_consumedlength(source->pushback); c = isc_buffer_getuint8(source->pushback); } else { c = EOF; } if (c == '\n') source->line++; if (lex->comment_ok && !no_comments) { if (!escaped && c == ';' && ((lex->comments & ISC_LEXCOMMENT_DNSMASTERFILE) != 0)) { saved_state = state; state = lexstate_eatline; no_comments = ISC_TRUE; continue; } else if (c == '/' && (lex->comments & (ISC_LEXCOMMENT_C| ISC_LEXCOMMENT_CPLUSPLUS)) != 0) { saved_state = state; state = lexstate_maybecomment; no_comments = ISC_TRUE; continue; } else if (c == '#' && ((lex->comments & ISC_LEXCOMMENT_SHELL) != 0)) { saved_state = state; state = lexstate_eatline; no_comments = ISC_TRUE; continue; } } no_read: /* INSIST(c == EOF || (c >= 0 && c <= 255)); */ switch (state) { case lexstate_start: if (c == EOF) { lex->last_was_eol = ISC_FALSE; if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 && lex->paren_count != 0) { lex->paren_count = 0; result = ISC_R_UNBALANCED; goto done; } if ((options & ISC_LEXOPT_EOF) == 0) { result = ISC_R_EOF; goto done; } tokenp->type = isc_tokentype_eof; done = ISC_TRUE; } else if (c == ' ' || c == '\t') { if (lex->last_was_eol && (options & ISC_LEXOPT_INITIALWS) != 0) { lex->last_was_eol = ISC_FALSE; tokenp->type = isc_tokentype_initialws; tokenp->value.as_char = c; done = ISC_TRUE; } } else if (c == '\n') { if ((options & ISC_LEXOPT_EOL) != 0) { tokenp->type = isc_tokentype_eol; done = ISC_TRUE; } lex->last_was_eol = ISC_TRUE; } else if (c == '\r') { if ((options & ISC_LEXOPT_EOL) != 0) state = lexstate_crlf; } else if (c == '"' && (options & ISC_LEXOPT_QSTRING) != 0) { lex->last_was_eol = ISC_FALSE; no_comments = ISC_TRUE; state = lexstate_qstring; } else if (lex->specials[c]) { lex->last_was_eol = ISC_FALSE; if ((c == '(' || c == ')') && (options & ISC_LEXOPT_DNSMULTILINE) != 0) { if (c == '(') { if (lex->paren_count == 0) options &= ~IWSEOL; lex->paren_count++; } else { if (lex->paren_count == 0) { result = ISC_R_UNBALANCED; goto done; } lex->paren_count--; if (lex->paren_count == 0) options = saved_options; } continue; } tokenp->type = isc_tokentype_special; tokenp->value.as_char = c; done = ISC_TRUE; } else if (isdigit((unsigned char)c) && (options & ISC_LEXOPT_NUMBER) != 0) { lex->last_was_eol = ISC_FALSE; if ((options & ISC_LEXOPT_OCTAL) != 0 && (c == '8' || c == '9')) state = lexstate_string; else state = lexstate_number; goto no_read; } else { lex->last_was_eol = ISC_FALSE; state = lexstate_string; goto no_read; } break; case lexstate_crlf: if (c != '\n') pushback(source, c); tokenp->type = isc_tokentype_eol; done = ISC_TRUE; lex->last_was_eol = ISC_TRUE; break; case lexstate_number: if (c == EOF || !isdigit((unsigned char)c)) { if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == EOF || lex->specials[c]) { int base; if ((options & ISC_LEXOPT_OCTAL) != 0) base = 8; else if ((options & ISC_LEXOPT_CNUMBER) != 0) base = 0; else base = 10; pushback(source, c); result = isc_parse_uint32(&as_ulong, lex->data, base); if (result == ISC_R_SUCCESS) { tokenp->type = isc_tokentype_number; tokenp->value.as_ulong = as_ulong; } else if (result == ISC_R_BADNUMBER) { isc_tokenvalue_t *v; tokenp->type = isc_tokentype_string; v = &(tokenp->value); v->as_textregion.base = lex->data; v->as_textregion.length = lex->max_token - remaining; } else goto done; done = ISC_TRUE; continue; } else if (!(options & ISC_LEXOPT_CNUMBER) || ((c != 'x' && c != 'X') || (curr != &lex->data[1]) || (lex->data[0] != '0'))) { /* Above test supports hex numbers */ state = lexstate_string; } } else if ((options & ISC_LEXOPT_OCTAL) != 0 && (c == '8' || c == '9')) { state = lexstate_string; } if (remaining == 0U) { result = grow_data(lex, &remaining, &curr, &prev); if (result != ISC_R_SUCCESS) goto done; } INSIST(remaining > 0U); *curr++ = c; *curr = '\0'; remaining--; break; case lexstate_string: /* * EOF needs to be checked before lex->specials[c] * as lex->specials[EOF] is not a good idea. */ if (c == '\r' || c == '\n' || c == EOF || (!escaped && (c == ' ' || c == '\t' || lex->specials[c]))) { pushback(source, c); if (source->result != ISC_R_SUCCESS) { result = source->result; goto done; } tokenp->type = isc_tokentype_string; tokenp->value.as_textregion.base = lex->data; tokenp->value.as_textregion.length = lex->max_token - remaining; done = ISC_TRUE; continue; } if ((options & ISC_LEXOPT_ESCAPE) != 0) escaped = (!escaped && c == '\\') ? ISC_TRUE : ISC_FALSE; if (remaining == 0U) { result = grow_data(lex, &remaining, &curr, &prev); if (result != ISC_R_SUCCESS) goto done; } INSIST(remaining > 0U); *curr++ = c; *curr = '\0'; remaining--; break; case lexstate_maybecomment: if (c == '*' && (lex->comments & ISC_LEXCOMMENT_C) != 0) { state = lexstate_ccomment; continue; } else if (c == '/' && (lex->comments & ISC_LEXCOMMENT_CPLUSPLUS) != 0) { state = lexstate_eatline; continue; } pushback(source, c); c = '/'; no_comments = ISC_FALSE; state = saved_state; goto no_read; case lexstate_ccomment: if (c == EOF) { result = ISC_R_UNEXPECTEDEND; goto done; } if (c == '*') state = lexstate_ccommentend; break; case lexstate_ccommentend: if (c == EOF) { result = ISC_R_UNEXPECTEDEND; goto done; } if (c == '/') { /* * C-style comments become a single space. * We do this to ensure that a comment will * act as a delimiter for strings and * numbers. */ c = ' '; no_comments = ISC_FALSE; state = saved_state; goto no_read; } else if (c != '*') state = lexstate_ccomment; break; case lexstate_eatline: if ((c == '\n') || (c == EOF)) { no_comments = ISC_FALSE; state = saved_state; goto no_read; } break; case lexstate_qstring: if (c == EOF) { result = ISC_R_UNEXPECTEDEND; goto done; } if (c == '"') { if (escaped) { escaped = ISC_FALSE; /* * Overwrite the preceding backslash. */ INSIST(prev != NULL); *prev = '"'; } else { tokenp->type = isc_tokentype_qstring; tokenp->value.as_textregion.base = lex->data; tokenp->value.as_textregion.length = lex->max_token - remaining; no_comments = ISC_FALSE; done = ISC_TRUE; } } else { if (c == '\n' && !escaped && (options & ISC_LEXOPT_QSTRINGMULTILINE) == 0) { pushback(source, c); result = ISC_R_UNBALANCEDQUOTES; goto done; } if (c == '\\' && !escaped) escaped = ISC_TRUE; else escaped = ISC_FALSE; if (remaining == 0U) { result = grow_data(lex, &remaining, &curr, &prev); if (result != ISC_R_SUCCESS) goto done; } INSIST(remaining > 0U); prev = curr; *curr++ = c; *curr = '\0'; remaining--; } break; default: FATAL_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_LEX, ISC_MSG_UNEXPECTEDSTATE, "Unexpected state %d"), state); /* Does not return. */ } } while (!done); result = ISC_R_SUCCESS; done: #ifdef HAVE_FLOCKFILE if (source->is_file) funlockfile(source->input); #endif return (result); } isc_result_t isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token, isc_tokentype_t expect, isc_boolean_t eol) { unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF | ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE; isc_result_t result; if (expect == isc_tokentype_qstring) options |= ISC_LEXOPT_QSTRING; else if (expect == isc_tokentype_number) options |= ISC_LEXOPT_NUMBER; result = isc_lex_gettoken(lex, options, token); if (result == ISC_R_RANGE) isc_lex_ungettoken(lex, token); if (result != ISC_R_SUCCESS) return (result); if (eol && ((token->type == isc_tokentype_eol) || (token->type == isc_tokentype_eof))) return (ISC_R_SUCCESS); if (token->type == isc_tokentype_string && expect == isc_tokentype_qstring) return (ISC_R_SUCCESS); if (token->type != expect) { isc_lex_ungettoken(lex, token); if (token->type == isc_tokentype_eol || token->type == isc_tokentype_eof) return (ISC_R_UNEXPECTEDEND); if (expect == isc_tokentype_number) return (ISC_R_BADNUMBER); return (ISC_R_UNEXPECTEDTOKEN); } return (ISC_R_SUCCESS); } isc_result_t isc_lex_getoctaltoken(isc_lex_t *lex, isc_token_t *token, isc_boolean_t eol) { unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF | ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE| ISC_LEXOPT_NUMBER | ISC_LEXOPT_OCTAL; isc_result_t result; result = isc_lex_gettoken(lex, options, token); if (result == ISC_R_RANGE) isc_lex_ungettoken(lex, token); if (result != ISC_R_SUCCESS) return (result); if (eol && ((token->type == isc_tokentype_eol) || (token->type == isc_tokentype_eof))) return (ISC_R_SUCCESS); if (token->type != isc_tokentype_number) { isc_lex_ungettoken(lex, token); if (token->type == isc_tokentype_eol || token->type == isc_tokentype_eof) return (ISC_R_UNEXPECTEDEND); return (ISC_R_BADNUMBER); } return (ISC_R_SUCCESS); } void isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp) { inputsource *source; /* * Unget the current token. */ REQUIRE(VALID_LEX(lex)); source = HEAD(lex->sources); REQUIRE(source != NULL); REQUIRE(tokenp != NULL); REQUIRE(isc_buffer_consumedlength(source->pushback) != 0 || tokenp->type == isc_tokentype_eof); UNUSED(tokenp); isc_buffer_first(source->pushback); lex->paren_count = lex->saved_paren_count; source->line = source->saved_line; source->at_eof = ISC_FALSE; } void isc_lex_getlasttokentext(isc_lex_t *lex, isc_token_t *tokenp, isc_region_t *r) { inputsource *source; REQUIRE(VALID_LEX(lex)); source = HEAD(lex->sources); REQUIRE(source != NULL); REQUIRE(tokenp != NULL); REQUIRE(isc_buffer_consumedlength(source->pushback) != 0 || tokenp->type == isc_tokentype_eof); UNUSED(tokenp); INSIST(source->ignored <= isc_buffer_consumedlength(source->pushback)); r->base = (unsigned char *)isc_buffer_base(source->pushback) + source->ignored; r->length = isc_buffer_consumedlength(source->pushback) - source->ignored; } char * isc_lex_getsourcename(isc_lex_t *lex) { inputsource *source; REQUIRE(VALID_LEX(lex)); source = HEAD(lex->sources); if (source == NULL) return (NULL); return (source->name); } unsigned long isc_lex_getsourceline(isc_lex_t *lex) { inputsource *source; REQUIRE(VALID_LEX(lex)); source = HEAD(lex->sources); if (source == NULL) return (0); return (source->line); } isc_result_t isc_lex_setsourcename(isc_lex_t *lex, const char *name) { inputsource *source; char *newname; REQUIRE(VALID_LEX(lex)); source = HEAD(lex->sources); if (source == NULL) return(ISC_R_NOTFOUND); newname = isc_mem_strdup(lex->mctx, name); if (newname == NULL) return (ISC_R_NOMEMORY); isc_mem_free(lex->mctx, source->name); source->name = newname; return (ISC_R_SUCCESS); } isc_boolean_t isc_lex_isfile(isc_lex_t *lex) { inputsource *source; REQUIRE(VALID_LEX(lex)); source = HEAD(lex->sources); if (source == NULL) return (ISC_FALSE); return (source->is_file); } ntp-4.2.6p5/lib/isc/inet_aton.c0000644000175000017500000001465111307651605015274 0ustar peterpeter/* * Portions Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Portions Copyright (C) 1996-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* * Copyright (c) 1983, 1990, 1993 * The Regents of the University of California. 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ /* * Portions Copyright (c) 1993 by Digital Equipment Corporation. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /*! \file */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; static char rcsid[] = "$Id: inet_aton.c,v 1.21.332.2 2009/03/05 23:47:03 tbox Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include /* Required for NULL. */ #include #include /*% * Check whether "cp" is a valid ascii representation * of an Internet address and convert to a binary address. * Returns 1 if the address is valid, 0 if not. * This replaces inet_addr, the return value from which * cannot distinguish between failure and a local broadcast address. */ int isc_net_aton(const char *cp, struct in_addr *addr) { unsigned long val; int base, n; unsigned char c; isc_uint8_t parts[4]; isc_uint8_t *pp = parts; int digit; c = *cp; for (;;) { /* * Collect number up to ``.''. * Values are specified as for C: * 0x=hex, 0=octal, isdigit=decimal. */ if (!isdigit(c & 0xff)) return (0); val = 0; base = 10; digit = 0; if (c == '0') { c = *++cp; if (c == 'x' || c == 'X') base = 16, c = *++cp; else { base = 8; digit = 1; } } for (;;) { /* * isascii() is valid for all integer values, and * when it is true, c is known to be in scope * for isdigit(). No cast necessary. Similar * comment applies for later ctype uses. */ if (isascii(c) && isdigit(c)) { if (base == 8 && (c == '8' || c == '9')) return (0); val = (val * base) + (c - '0'); c = *++cp; digit = 1; } else if (base == 16 && isascii(c) && isxdigit(c)) { val = (val << 4) | (c + 10 - (islower(c) ? 'a' : 'A')); c = *++cp; digit = 1; } else break; } if (c == '.') { /* * Internet format: * a.b.c.d * a.b.c (with c treated as 16 bits) * a.b (with b treated as 24 bits) */ if (pp >= parts + 3 || val > 0xffU) return (0); *pp++ = (isc_uint8_t)val; c = *++cp; } else break; } /* * Check for trailing characters. */ if (c != '\0' && (!isascii(c) || !isspace(c))) return (0); /* * Did we get a valid digit? */ if (!digit) return (0); /* * Concoct the address according to * the number of parts specified. */ n = pp - parts + 1; switch (n) { case 1: /* a -- 32 bits */ break; case 2: /* a.b -- 8.24 bits */ if (val > 0xffffffU) return (0); val |= parts[0] << 24; break; case 3: /* a.b.c -- 8.8.16 bits */ if (val > 0xffffU) return (0); val |= (parts[0] << 24) | (parts[1] << 16); break; case 4: /* a.b.c.d -- 8.8.8.8 bits */ if (val > 0xffU) return (0); val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); break; } if (addr != NULL) addr->s_addr = htonl(val); return (1); } ntp-4.2.6p5/lib/isc/inet_pton.c0000644000175000017500000001245311505336024015304 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1996-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /*! \file */ #if defined(LIBC_SCCS) && !defined(lint) static char rcsid[] = "$Id: inet_pton.c,v 1.19 2007/06/19 23:47:17 tbox Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include #include /*% INT16 Size */ #define NS_INT16SZ 2 /*% IPv4 Address Size */ #define NS_INADDRSZ 4 /*% IPv6 Address Size */ #define NS_IN6ADDRSZ 16 /* * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. */ static int inet_pton4(const char *src, unsigned char *dst); static int inet_pton6(const char *src, unsigned char *dst); /*% * convert from presentation format (which usually means ASCII printable) * to network format (which is usually some kind of binary format). * \return * 1 if the address was valid for the specified address family * 0 if the address wasn't valid (`dst' is untouched in this case) * -1 if some other error occurred (`dst' is untouched in this case, too) * \author * Paul Vixie, 1996. */ int isc_net_pton(int af, const char *src, void *dst) { switch (af) { case AF_INET: return (inet_pton4(src, dst)); case AF_INET6: return (inet_pton6(src, dst)); default: errno = EAFNOSUPPORT; return (-1); } /* NOTREACHED */ } /*!\fn static int inet_pton4(const char *src, unsigned char *dst) * \brief * like inet_aton() but without all the hexadecimal and shorthand. * \return * 1 if `src' is a valid dotted quad, else 0. * \note * does not touch `dst' unless it's returning 1. * \author * Paul Vixie, 1996. */ static int inet_pton4(const char *src, unsigned char *dst) { static const char digits[] = "0123456789"; int saw_digit, octets, ch; unsigned char tmp[NS_INADDRSZ], *tp; saw_digit = 0; octets = 0; *(tp = tmp) = 0; while ((ch = *src++) != '\0') { const char *pch; if ((pch = strchr(digits, ch)) != NULL) { unsigned int newv = *tp * 10 + (pch - digits); if (saw_digit && *tp == 0) return (0); if (newv > 255) return (0); *tp = (unsigned char)newv; if (!saw_digit) { if (++octets > 4) return (0); saw_digit = 1; } } else if (ch == '.' && saw_digit) { if (octets == 4) return (0); *++tp = 0; saw_digit = 0; } else return (0); } if (octets < 4) return (0); memcpy(dst, tmp, NS_INADDRSZ); return (1); } /*% * convert presentation level address to network order binary form. * \return * 1 if `src' is a valid [RFC1884 2.2] address, else 0. * \note * (1) does not touch `dst' unless it's returning 1. * \note * (2) :: in a full address is silently ignored. * \author * inspired by Mark Andrews. * \author * Paul Vixie, 1996. */ static int inet_pton6(const char *src, unsigned char *dst) { static const char xdigits_l[] = "0123456789abcdef", xdigits_u[] = "0123456789ABCDEF"; unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; const char *xdigits, *curtok; int ch, seen_xdigits; unsigned int val; memset((tp = tmp), '\0', NS_IN6ADDRSZ); endp = tp + NS_IN6ADDRSZ; colonp = NULL; /* Leading :: requires some special handling. */ if (*src == ':') if (*++src != ':') return (0); curtok = src; seen_xdigits = 0; val = 0; while ((ch = *src++) != '\0') { const char *pch; if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) pch = strchr((xdigits = xdigits_u), ch); if (pch != NULL) { val <<= 4; val |= (pch - xdigits); if (++seen_xdigits > 4) return (0); continue; } if (ch == ':') { curtok = src; if (!seen_xdigits) { if (colonp) return (0); colonp = tp; continue; } if (tp + NS_INT16SZ > endp) return (0); *tp++ = (unsigned char) (val >> 8) & 0xff; *tp++ = (unsigned char) val & 0xff; seen_xdigits = 0; val = 0; continue; } if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && inet_pton4(curtok, tp) > 0) { tp += NS_INADDRSZ; seen_xdigits = 0; break; /* '\0' was seen by inet_pton4(). */ } return (0); } if (seen_xdigits) { if (tp + NS_INT16SZ > endp) return (0); *tp++ = (unsigned char) (val >> 8) & 0xff; *tp++ = (unsigned char) val & 0xff; } if (colonp != NULL) { /* * Since some memmove()'s erroneously fail to handle * overlapping regions, we'll do the shift by hand. */ const int n = tp - colonp; int i; if (tp == endp) return (0); for (i = 1; i <= n; i++) { endp[- i] = colonp[n - i]; colonp[n - i] = 0; } tp = endp; } if (tp != endp) return (0); memcpy(dst, tmp, NS_IN6ADDRSZ); return (1); } ntp-4.2.6p5/lib/isc/serial.c0000644000175000017500000000335311307651603014566 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: serial.c,v 1.12 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include isc_boolean_t isc_serial_lt(isc_uint32_t a, isc_uint32_t b) { /* * Undefined => ISC_FALSE */ if (a == (b ^ 0x80000000U)) return (ISC_FALSE); return (((isc_int32_t)(a - b) < 0) ? ISC_TRUE : ISC_FALSE); } isc_boolean_t isc_serial_gt(isc_uint32_t a, isc_uint32_t b) { return (((isc_int32_t)(a - b) > 0) ? ISC_TRUE : ISC_FALSE); } isc_boolean_t isc_serial_le(isc_uint32_t a, isc_uint32_t b) { return ((a == b) ? ISC_TRUE : isc_serial_lt(a, b)); } isc_boolean_t isc_serial_ge(isc_uint32_t a, isc_uint32_t b) { return ((a == b) ? ISC_TRUE : isc_serial_gt(a, b)); } isc_boolean_t isc_serial_eq(isc_uint32_t a, isc_uint32_t b) { return ((a == b) ? ISC_TRUE : ISC_FALSE); } isc_boolean_t isc_serial_ne(isc_uint32_t a, isc_uint32_t b) { return ((a != b) ? ISC_TRUE : ISC_FALSE); } ntp-4.2.6p5/lib/isc/timer_p.h0000644000175000017500000000211611307651604014750 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: timer_p.h,v 1.10 2007/06/19 23:47:17 tbox Exp $ */ #ifndef ISC_TIMER_P_H #define ISC_TIMER_P_H /*! \file */ isc_result_t isc__timermgr_nextevent(isc_time_t *when); void isc__timermgr_dispatch(void); #endif /* ISC_TIMER_P_H */ ntp-4.2.6p5/lib/isc/assertions.c0000644000175000017500000000460411307651603015501 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1997-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: assertions.c,v 1.23 2008/10/15 23:47:31 tbox Exp $ */ /*! \file */ #include #include #include #include #include /*% * Forward. */ /* coverity[+kill] */ static void default_callback(const char *, int, isc_assertiontype_t, const char *); /*% * Public. */ LIBISC_EXTERNAL_DATA isc_assertioncallback_t isc_assertion_failed = default_callback; /*% Set callback. */ void isc_assertion_setcallback(isc_assertioncallback_t cb) { if (cb == NULL) isc_assertion_failed = default_callback; else isc_assertion_failed = cb; } /*% Type to Text */ const char * isc_assertion_typetotext(isc_assertiontype_t type) { const char *result; /* * These strings have purposefully not been internationalized * because they are considered to essentially be keywords of * the ISC development environment. */ switch (type) { case isc_assertiontype_require: result = "REQUIRE"; break; case isc_assertiontype_ensure: result = "ENSURE"; break; case isc_assertiontype_insist: result = "INSIST"; break; case isc_assertiontype_invariant: result = "INVARIANT"; break; default: result = NULL; } return (result); } /* * Private. */ static void default_callback(const char *file, int line, isc_assertiontype_t type, const char *cond) { fprintf(stderr, "%s:%d: %s(%s) %s.\n", file, line, isc_assertion_typetotext(type), cond, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); fflush(stderr); abort(); /* NOTREACHED */ } ntp-4.2.6p5/lib/isc/random.c0000644000175000017500000000455011307651604014570 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: random.c,v 1.25 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include /* Required for time(). */ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include static isc_once_t once = ISC_ONCE_INIT; static void initialize_rand(void) { #ifndef HAVE_ARC4RANDOM unsigned int pid = getpid(); /* * The low bits of pid generally change faster. * Xor them with the high bits of time which change slowly. */ pid = ((pid << 16) & 0xffff0000) | ((pid >> 16) & 0xffff); srand(time(NULL) ^ pid); #endif } static void initialize(void) { RUNTIME_CHECK(isc_once_do(&once, initialize_rand) == ISC_R_SUCCESS); } void isc_random_seed(isc_uint32_t seed) { initialize(); #ifndef HAVE_ARC4RANDOM srand(seed); #else arc4random_addrandom((u_char *) &seed, sizeof(isc_uint32_t)); #endif } void isc_random_get(isc_uint32_t *val) { REQUIRE(val != NULL); initialize(); #ifndef HAVE_ARC4RANDOM /* * rand()'s lower bits are not random. * rand()'s upper bit is zero. */ *val = ((rand() >> 4) & 0xffff) | ((rand() << 12) & 0xffff0000); #else *val = arc4random(); #endif } isc_uint32_t isc_random_jitter(isc_uint32_t max, isc_uint32_t jitter) { REQUIRE(jitter < max); if (jitter == 0) return (max); else #ifndef HAVE_ARC4RANDOM return (max - rand() % jitter); #else return (max - arc4random() % jitter); #endif } ntp-4.2.6p5/lib/isc/base64.c0000644000175000017500000001474011307651604014376 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: base64.c,v 1.32 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #define RETERR(x) do { \ isc_result_t _r = (x); \ if (_r != ISC_R_SUCCESS) \ return (_r); \ } while (0) /*@{*/ /*! * These static functions are also present in lib/dns/rdata.c. I'm not * sure where they should go. -- bwelling */ static isc_result_t str_totext(const char *source, isc_buffer_t *target); static isc_result_t mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length); static const char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; /*@}*/ isc_result_t isc_base64_totext(isc_region_t *source, int wordlength, const char *wordbreak, isc_buffer_t *target) { char buf[5]; unsigned int loops = 0; if (wordlength < 4) wordlength = 4; memset(buf, 0, sizeof(buf)); while (source->length > 2) { buf[0] = base64[(source->base[0]>>2)&0x3f]; buf[1] = base64[((source->base[0]<<4)&0x30)| ((source->base[1]>>4)&0x0f)]; buf[2] = base64[((source->base[1]<<2)&0x3c)| ((source->base[2]>>6)&0x03)]; buf[3] = base64[source->base[2]&0x3f]; RETERR(str_totext(buf, target)); isc_region_consume(source, 3); loops++; if (source->length != 0 && (int)((loops + 1) * 4) >= wordlength) { loops = 0; RETERR(str_totext(wordbreak, target)); } } if (source->length == 2) { buf[0] = base64[(source->base[0]>>2)&0x3f]; buf[1] = base64[((source->base[0]<<4)&0x30)| ((source->base[1]>>4)&0x0f)]; buf[2] = base64[((source->base[1]<<2)&0x3c)]; buf[3] = '='; RETERR(str_totext(buf, target)); } else if (source->length == 1) { buf[0] = base64[(source->base[0]>>2)&0x3f]; buf[1] = base64[((source->base[0]<<4)&0x30)]; buf[2] = buf[3] = '='; RETERR(str_totext(buf, target)); } return (ISC_R_SUCCESS); } /*% * State of a base64 decoding process in progress. */ typedef struct { int length; /*%< Desired length of binary data or -1 */ isc_buffer_t *target; /*%< Buffer for resulting binary data */ int digits; /*%< Number of buffered base64 digits */ isc_boolean_t seen_end; /*%< True if "=" end marker seen */ int val[4]; } base64_decode_ctx_t; static inline void base64_decode_init(base64_decode_ctx_t *ctx, int length, isc_buffer_t *target) { ctx->digits = 0; ctx->seen_end = ISC_FALSE; ctx->length = length; ctx->target = target; } static inline isc_result_t base64_decode_char(base64_decode_ctx_t *ctx, int c) { char *s; if (ctx->seen_end) return (ISC_R_BADBASE64); if ((s = strchr(base64, c)) == NULL) return (ISC_R_BADBASE64); ctx->val[ctx->digits++] = s - base64; if (ctx->digits == 4) { int n; unsigned char buf[3]; if (ctx->val[0] == 64 || ctx->val[1] == 64) return (ISC_R_BADBASE64); if (ctx->val[2] == 64 && ctx->val[3] != 64) return (ISC_R_BADBASE64); /* * Check that bits that should be zero are. */ if (ctx->val[2] == 64 && (ctx->val[1] & 0xf) != 0) return (ISC_R_BADBASE64); /* * We don't need to test for ctx->val[2] != 64 as * the bottom two bits of 64 are zero. */ if (ctx->val[3] == 64 && (ctx->val[2] & 0x3) != 0) return (ISC_R_BADBASE64); n = (ctx->val[2] == 64) ? 1 : (ctx->val[3] == 64) ? 2 : 3; if (n != 3) { ctx->seen_end = ISC_TRUE; if (ctx->val[2] == 64) ctx->val[2] = 0; if (ctx->val[3] == 64) ctx->val[3] = 0; } buf[0] = (ctx->val[0]<<2)|(ctx->val[1]>>4); buf[1] = (ctx->val[1]<<4)|(ctx->val[2]>>2); buf[2] = (ctx->val[2]<<6)|(ctx->val[3]); RETERR(mem_tobuffer(ctx->target, buf, n)); if (ctx->length >= 0) { if (n > ctx->length) return (ISC_R_BADBASE64); else ctx->length -= n; } ctx->digits = 0; } return (ISC_R_SUCCESS); } static inline isc_result_t base64_decode_finish(base64_decode_ctx_t *ctx) { if (ctx->length > 0) return (ISC_R_UNEXPECTEDEND); if (ctx->digits != 0) return (ISC_R_BADBASE64); return (ISC_R_SUCCESS); } isc_result_t isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { base64_decode_ctx_t ctx; isc_textregion_t *tr; isc_token_t token; isc_boolean_t eol; base64_decode_init(&ctx, length, target); while (!ctx.seen_end && (ctx.length != 0)) { unsigned int i; if (length > 0) eol = ISC_FALSE; else eol = ISC_TRUE; RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, eol)); if (token.type != isc_tokentype_string) break; tr = &token.value.as_textregion; for (i = 0; i < tr->length; i++) RETERR(base64_decode_char(&ctx, tr->base[i])); } if (ctx.length < 0 && !ctx.seen_end) isc_lex_ungettoken(lexer, &token); RETERR(base64_decode_finish(&ctx)); return (ISC_R_SUCCESS); } isc_result_t isc_base64_decodestring(const char *cstr, isc_buffer_t *target) { base64_decode_ctx_t ctx; base64_decode_init(&ctx, -1, target); for (;;) { int c = *cstr++; if (c == '\0') break; if (c == ' ' || c == '\t' || c == '\n' || c== '\r') continue; RETERR(base64_decode_char(&ctx, c)); } RETERR(base64_decode_finish(&ctx)); return (ISC_R_SUCCESS); } static isc_result_t str_totext(const char *source, isc_buffer_t *target) { unsigned int l; isc_region_t region; isc_buffer_availableregion(target, ®ion); l = strlen(source); if (l > region.length) return (ISC_R_NOSPACE); memcpy(region.base, source, l); isc_buffer_add(target, l); return (ISC_R_SUCCESS); } static isc_result_t mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) { isc_region_t tr; isc_buffer_availableregion(target, &tr); if (length > tr.length) return (ISC_R_NOSPACE); memcpy(tr.base, base, length); isc_buffer_add(target, length); return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/rwlock.c0000644000175000017500000005432611307651604014617 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: rwlock.c,v 1.44.332.2 2009/01/18 23:47:41 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include #define RWLOCK_MAGIC ISC_MAGIC('R', 'W', 'L', 'k') #define VALID_RWLOCK(rwl) ISC_MAGIC_VALID(rwl, RWLOCK_MAGIC) #ifdef ISC_PLATFORM_USETHREADS #ifndef RWLOCK_DEFAULT_READ_QUOTA #define RWLOCK_DEFAULT_READ_QUOTA 4 #endif #ifndef RWLOCK_DEFAULT_WRITE_QUOTA #define RWLOCK_DEFAULT_WRITE_QUOTA 4 #endif #ifdef ISC_RWLOCK_TRACE #include /* Required for fprintf/stderr. */ #include /* Required for isc_thread_self(). */ static void print_lock(const char *operation, isc_rwlock_t *rwl, isc_rwlocktype_t type) { fprintf(stderr, isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_PRINTLOCK, "rwlock %p thread %lu %s(%s): %s, %u active, " "%u granted, %u rwaiting, %u wwaiting\n"), rwl, isc_thread_self(), operation, (type == isc_rwlocktype_read ? isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_READ, "read") : isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_WRITE, "write")), (rwl->type == isc_rwlocktype_read ? isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_READING, "reading") : isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_WRITING, "writing")), rwl->active, rwl->granted, rwl->readers_waiting, rwl->writers_waiting); } #endif isc_result_t isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota, unsigned int write_quota) { isc_result_t result; REQUIRE(rwl != NULL); /* * In case there's trouble initializing, we zero magic now. If all * goes well, we'll set it to RWLOCK_MAGIC. */ rwl->magic = 0; #if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG) rwl->write_requests = 0; rwl->write_completions = 0; rwl->cnt_and_flag = 0; rwl->readers_waiting = 0; rwl->write_granted = 0; if (read_quota != 0) { UNEXPECTED_ERROR(__FILE__, __LINE__, "read quota is not supported"); } if (write_quota == 0) write_quota = RWLOCK_DEFAULT_WRITE_QUOTA; rwl->write_quota = write_quota; #else rwl->type = isc_rwlocktype_read; rwl->original = isc_rwlocktype_none; rwl->active = 0; rwl->granted = 0; rwl->readers_waiting = 0; rwl->writers_waiting = 0; if (read_quota == 0) read_quota = RWLOCK_DEFAULT_READ_QUOTA; rwl->read_quota = read_quota; if (write_quota == 0) write_quota = RWLOCK_DEFAULT_WRITE_QUOTA; rwl->write_quota = write_quota; #endif result = isc_mutex_init(&rwl->lock); if (result != ISC_R_SUCCESS) return (result); result = isc_condition_init(&rwl->readable); if (result != ISC_R_SUCCESS) { UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_condition_init(readable) %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), isc_result_totext(result)); result = ISC_R_UNEXPECTED; goto destroy_lock; } result = isc_condition_init(&rwl->writeable); if (result != ISC_R_SUCCESS) { UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_condition_init(writeable) %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), isc_result_totext(result)); result = ISC_R_UNEXPECTED; goto destroy_rcond; } rwl->magic = RWLOCK_MAGIC; return (ISC_R_SUCCESS); destroy_rcond: (void)isc_condition_destroy(&rwl->readable); destroy_lock: DESTROYLOCK(&rwl->lock); return (result); } void isc_rwlock_destroy(isc_rwlock_t *rwl) { REQUIRE(VALID_RWLOCK(rwl)); #if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG) REQUIRE(rwl->write_requests == rwl->write_completions && rwl->cnt_and_flag == 0 && rwl->readers_waiting == 0); #else LOCK(&rwl->lock); REQUIRE(rwl->active == 0 && rwl->readers_waiting == 0 && rwl->writers_waiting == 0); UNLOCK(&rwl->lock); #endif rwl->magic = 0; (void)isc_condition_destroy(&rwl->readable); (void)isc_condition_destroy(&rwl->writeable); DESTROYLOCK(&rwl->lock); } #if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG) /* * When some architecture-dependent atomic operations are available, * rwlock can be more efficient than the generic algorithm defined below. * The basic algorithm is described in the following URL: * http://www.cs.rochester.edu/u/scott/synchronization/pseudocode/rw.html * * The key is to use the following integer variables modified atomically: * write_requests, write_completions, and cnt_and_flag. * * write_requests and write_completions act as a waiting queue for writers * in order to ensure the FIFO order. Both variables begin with the initial * value of 0. When a new writer tries to get a write lock, it increments * write_requests and gets the previous value of the variable as a "ticket". * When write_completions reaches the ticket number, the new writer can start * writing. When the writer completes its work, it increments * write_completions so that another new writer can start working. If the * write_requests is not equal to write_completions, it means a writer is now * working or waiting. In this case, a new readers cannot start reading, or * in other words, this algorithm basically prefers writers. * * cnt_and_flag is a "lock" shared by all readers and writers. This integer * variable is a kind of structure with two members: writer_flag (1 bit) and * reader_count (31 bits). The writer_flag shows whether a writer is working, * and the reader_count shows the number of readers currently working or almost * ready for working. A writer who has the current "ticket" tries to get the * lock by exclusively setting the writer_flag to 1, provided that the whole * 32-bit is 0 (meaning no readers or writers working). On the other hand, * a new reader tries to increment the "reader_count" field provided that * the writer_flag is 0 (meaning there is no writer working). * * If some of the above operations fail, the reader or the writer sleeps * until the related condition changes. When a working reader or writer * completes its work, some readers or writers are sleeping, and the condition * that suspended the reader or writer has changed, it wakes up the sleeping * readers or writers. * * As already noted, this algorithm basically prefers writers. In order to * prevent readers from starving, however, the algorithm also introduces the * "writer quota" (Q). When Q consecutive writers have completed their work, * suspending readers, the last writer will wake up the readers, even if a new * writer is waiting. * * Implementation specific note: due to the combination of atomic operations * and a mutex lock, ordering between the atomic operation and locks can be * very sensitive in some cases. In particular, it is generally very important * to check the atomic variable that requires a reader or writer to sleep after * locking the mutex and before actually sleeping; otherwise, it could be very * likely to cause a deadlock. For example, assume "var" is a variable * atomically modified, then the corresponding code would be: * if (var == need_sleep) { * LOCK(lock); * if (var == need_sleep) * WAIT(cond, lock); * UNLOCK(lock); * } * The second check is important, since "var" is protected by the atomic * operation, not by the mutex, and can be changed just before sleeping. * (The first "if" could be omitted, but this is also important in order to * make the code efficient by avoiding the use of the mutex unless it is * really necessary.) */ #define WRITER_ACTIVE 0x1 #define READER_INCR 0x2 isc_result_t isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { isc_int32_t cntflag; REQUIRE(VALID_RWLOCK(rwl)); #ifdef ISC_RWLOCK_TRACE print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_PRELOCK, "prelock"), rwl, type); #endif if (type == isc_rwlocktype_read) { if (rwl->write_requests != rwl->write_completions) { /* there is a waiting or active writer */ LOCK(&rwl->lock); if (rwl->write_requests != rwl->write_completions) { rwl->readers_waiting++; WAIT(&rwl->readable, &rwl->lock); rwl->readers_waiting--; } UNLOCK(&rwl->lock); } cntflag = isc_atomic_xadd(&rwl->cnt_and_flag, READER_INCR); while (1) { if ((rwl->cnt_and_flag & WRITER_ACTIVE) == 0) break; /* A writer is still working */ LOCK(&rwl->lock); rwl->readers_waiting++; if ((rwl->cnt_and_flag & WRITER_ACTIVE) != 0) WAIT(&rwl->readable, &rwl->lock); rwl->readers_waiting--; UNLOCK(&rwl->lock); /* * Typically, the reader should be able to get a lock * at this stage: * (1) there should have been no pending writer when * the reader was trying to increment the * counter; otherwise, the writer should be in * the waiting queue, preventing the reader from * proceeding to this point. * (2) once the reader increments the counter, no * more writer can get a lock. * Still, it is possible another writer can work at * this point, e.g. in the following scenario: * A previous writer unlocks the writer lock. * This reader proceeds to point (1). * A new writer appears, and gets a new lock before * the reader increments the counter. * The reader then increments the counter. * The previous writer notices there is a waiting * reader who is almost ready, and wakes it up. * So, the reader needs to confirm whether it can now * read explicitly (thus we loop). Note that this is * not an infinite process, since the reader has * incremented the counter at this point. */ } /* * If we are temporarily preferred to writers due to the writer * quota, reset the condition (race among readers doesn't * matter). */ rwl->write_granted = 0; } else { isc_int32_t prev_writer; /* enter the waiting queue, and wait for our turn */ prev_writer = isc_atomic_xadd(&rwl->write_requests, 1); while (rwl->write_completions != prev_writer) { LOCK(&rwl->lock); if (rwl->write_completions != prev_writer) { WAIT(&rwl->writeable, &rwl->lock); UNLOCK(&rwl->lock); continue; } UNLOCK(&rwl->lock); break; } while (1) { cntflag = isc_atomic_cmpxchg(&rwl->cnt_and_flag, 0, WRITER_ACTIVE); if (cntflag == 0) break; /* Another active reader or writer is working. */ LOCK(&rwl->lock); if (rwl->cnt_and_flag != 0) WAIT(&rwl->writeable, &rwl->lock); UNLOCK(&rwl->lock); } INSIST((rwl->cnt_and_flag & WRITER_ACTIVE) != 0); rwl->write_granted++; } #ifdef ISC_RWLOCK_TRACE print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_POSTLOCK, "postlock"), rwl, type); #endif return (ISC_R_SUCCESS); } isc_result_t isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { isc_int32_t cntflag; REQUIRE(VALID_RWLOCK(rwl)); #ifdef ISC_RWLOCK_TRACE print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_PRELOCK, "prelock"), rwl, type); #endif if (type == isc_rwlocktype_read) { /* If a writer is waiting or working, we fail. */ if (rwl->write_requests != rwl->write_completions) return (ISC_R_LOCKBUSY); /* Otherwise, be ready for reading. */ cntflag = isc_atomic_xadd(&rwl->cnt_and_flag, READER_INCR); if ((cntflag & WRITER_ACTIVE) != 0) { /* * A writer is working. We lose, and cancel the read * request. */ cntflag = isc_atomic_xadd(&rwl->cnt_and_flag, -READER_INCR); /* * If no other readers are waiting and we've suspended * new writers in this short period, wake them up. */ if (cntflag == READER_INCR && rwl->write_completions != rwl->write_requests) { LOCK(&rwl->lock); BROADCAST(&rwl->writeable); UNLOCK(&rwl->lock); } return (ISC_R_LOCKBUSY); } } else { /* Try locking without entering the waiting queue. */ cntflag = isc_atomic_cmpxchg(&rwl->cnt_and_flag, 0, WRITER_ACTIVE); if (cntflag != 0) return (ISC_R_LOCKBUSY); /* * XXXJT: jump into the queue, possibly breaking the writer * order. */ (void)isc_atomic_xadd(&rwl->write_completions, -1); rwl->write_granted++; } #ifdef ISC_RWLOCK_TRACE print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_POSTLOCK, "postlock"), rwl, type); #endif return (ISC_R_SUCCESS); } isc_result_t isc_rwlock_tryupgrade(isc_rwlock_t *rwl) { isc_int32_t prevcnt; REQUIRE(VALID_RWLOCK(rwl)); /* Try to acquire write access. */ prevcnt = isc_atomic_cmpxchg(&rwl->cnt_and_flag, READER_INCR, WRITER_ACTIVE); /* * There must have been no writer, and there must have been at least * one reader. */ INSIST((prevcnt & WRITER_ACTIVE) == 0 && (prevcnt & ~WRITER_ACTIVE) != 0); if (prevcnt == READER_INCR) { /* * We are the only reader and have been upgraded. * Now jump into the head of the writer waiting queue. */ (void)isc_atomic_xadd(&rwl->write_completions, -1); } else return (ISC_R_LOCKBUSY); return (ISC_R_SUCCESS); } void isc_rwlock_downgrade(isc_rwlock_t *rwl) { isc_int32_t prev_readers; REQUIRE(VALID_RWLOCK(rwl)); /* Become an active reader. */ prev_readers = isc_atomic_xadd(&rwl->cnt_and_flag, READER_INCR); /* We must have been a writer. */ INSIST((prev_readers & WRITER_ACTIVE) != 0); /* Complete write */ (void)isc_atomic_xadd(&rwl->cnt_and_flag, -WRITER_ACTIVE); (void)isc_atomic_xadd(&rwl->write_completions, 1); /* Resume other readers */ LOCK(&rwl->lock); if (rwl->readers_waiting > 0) BROADCAST(&rwl->readable); UNLOCK(&rwl->lock); } isc_result_t isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { isc_int32_t prev_cnt; REQUIRE(VALID_RWLOCK(rwl)); #ifdef ISC_RWLOCK_TRACE print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_PREUNLOCK, "preunlock"), rwl, type); #endif if (type == isc_rwlocktype_read) { prev_cnt = isc_atomic_xadd(&rwl->cnt_and_flag, -READER_INCR); /* * If we're the last reader and any writers are waiting, wake * them up. We need to wake up all of them to ensure the * FIFO order. */ if (prev_cnt == READER_INCR && rwl->write_completions != rwl->write_requests) { LOCK(&rwl->lock); BROADCAST(&rwl->writeable); UNLOCK(&rwl->lock); } } else { isc_boolean_t wakeup_writers = ISC_TRUE; /* * Reset the flag, and (implicitly) tell other writers * we are done. */ (void)isc_atomic_xadd(&rwl->cnt_and_flag, -WRITER_ACTIVE); (void)isc_atomic_xadd(&rwl->write_completions, 1); if (rwl->write_granted >= rwl->write_quota || rwl->write_requests == rwl->write_completions || (rwl->cnt_and_flag & ~WRITER_ACTIVE) != 0) { /* * We have passed the write quota, no writer is * waiting, or some readers are almost ready, pending * possible writers. Note that the last case can * happen even if write_requests != write_completions * (which means a new writer in the queue), so we need * to catch the case explicitly. */ LOCK(&rwl->lock); if (rwl->readers_waiting > 0) { wakeup_writers = ISC_FALSE; BROADCAST(&rwl->readable); } UNLOCK(&rwl->lock); } if (rwl->write_requests != rwl->write_completions && wakeup_writers) { LOCK(&rwl->lock); BROADCAST(&rwl->writeable); UNLOCK(&rwl->lock); } } #ifdef ISC_RWLOCK_TRACE print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_POSTUNLOCK, "postunlock"), rwl, type); #endif return (ISC_R_SUCCESS); } #else /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */ static isc_result_t doit(isc_rwlock_t *rwl, isc_rwlocktype_t type, isc_boolean_t nonblock) { isc_boolean_t skip = ISC_FALSE; isc_boolean_t done = ISC_FALSE; isc_result_t result = ISC_R_SUCCESS; REQUIRE(VALID_RWLOCK(rwl)); LOCK(&rwl->lock); #ifdef ISC_RWLOCK_TRACE print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_PRELOCK, "prelock"), rwl, type); #endif if (type == isc_rwlocktype_read) { if (rwl->readers_waiting != 0) skip = ISC_TRUE; while (!done) { if (!skip && ((rwl->active == 0 || (rwl->type == isc_rwlocktype_read && (rwl->writers_waiting == 0 || rwl->granted < rwl->read_quota))))) { rwl->type = isc_rwlocktype_read; rwl->active++; rwl->granted++; done = ISC_TRUE; } else if (nonblock) { result = ISC_R_LOCKBUSY; done = ISC_TRUE; } else { skip = ISC_FALSE; rwl->readers_waiting++; WAIT(&rwl->readable, &rwl->lock); rwl->readers_waiting--; } } } else { if (rwl->writers_waiting != 0) skip = ISC_TRUE; while (!done) { if (!skip && rwl->active == 0) { rwl->type = isc_rwlocktype_write; rwl->active = 1; rwl->granted++; done = ISC_TRUE; } else if (nonblock) { result = ISC_R_LOCKBUSY; done = ISC_TRUE; } else { skip = ISC_FALSE; rwl->writers_waiting++; WAIT(&rwl->writeable, &rwl->lock); rwl->writers_waiting--; } } } #ifdef ISC_RWLOCK_TRACE print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_POSTLOCK, "postlock"), rwl, type); #endif UNLOCK(&rwl->lock); return (result); } isc_result_t isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { return (doit(rwl, type, ISC_FALSE)); } isc_result_t isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { return (doit(rwl, type, ISC_TRUE)); } isc_result_t isc_rwlock_tryupgrade(isc_rwlock_t *rwl) { isc_result_t result = ISC_R_SUCCESS; REQUIRE(VALID_RWLOCK(rwl)); LOCK(&rwl->lock); REQUIRE(rwl->type == isc_rwlocktype_read); REQUIRE(rwl->active != 0); /* If we are the only reader then succeed. */ if (rwl->active == 1) { rwl->original = (rwl->original == isc_rwlocktype_none) ? isc_rwlocktype_read : isc_rwlocktype_none; rwl->type = isc_rwlocktype_write; } else result = ISC_R_LOCKBUSY; UNLOCK(&rwl->lock); return (result); } void isc_rwlock_downgrade(isc_rwlock_t *rwl) { REQUIRE(VALID_RWLOCK(rwl)); LOCK(&rwl->lock); REQUIRE(rwl->type == isc_rwlocktype_write); REQUIRE(rwl->active == 1); rwl->type = isc_rwlocktype_read; rwl->original = (rwl->original == isc_rwlocktype_none) ? isc_rwlocktype_write : isc_rwlocktype_none; /* * Resume processing any read request that were blocked when * we upgraded. */ if (rwl->original == isc_rwlocktype_none && (rwl->writers_waiting == 0 || rwl->granted < rwl->read_quota) && rwl->readers_waiting > 0) BROADCAST(&rwl->readable); UNLOCK(&rwl->lock); } isc_result_t isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { REQUIRE(VALID_RWLOCK(rwl)); LOCK(&rwl->lock); REQUIRE(rwl->type == type); UNUSED(type); #ifdef ISC_RWLOCK_TRACE print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_PREUNLOCK, "preunlock"), rwl, type); #endif INSIST(rwl->active > 0); rwl->active--; if (rwl->active == 0) { if (rwl->original != isc_rwlocktype_none) { rwl->type = rwl->original; rwl->original = isc_rwlocktype_none; } if (rwl->type == isc_rwlocktype_read) { rwl->granted = 0; if (rwl->writers_waiting > 0) { rwl->type = isc_rwlocktype_write; SIGNAL(&rwl->writeable); } else if (rwl->readers_waiting > 0) { /* Does this case ever happen? */ BROADCAST(&rwl->readable); } } else { if (rwl->readers_waiting > 0) { if (rwl->writers_waiting > 0 && rwl->granted < rwl->write_quota) { SIGNAL(&rwl->writeable); } else { rwl->granted = 0; rwl->type = isc_rwlocktype_read; BROADCAST(&rwl->readable); } } else if (rwl->writers_waiting > 0) { rwl->granted = 0; SIGNAL(&rwl->writeable); } else { rwl->granted = 0; } } } INSIST(rwl->original == isc_rwlocktype_none); #ifdef ISC_RWLOCK_TRACE print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK, ISC_MSG_POSTUNLOCK, "postunlock"), rwl, type); #endif UNLOCK(&rwl->lock); return (ISC_R_SUCCESS); } #endif /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */ #else /* ISC_PLATFORM_USETHREADS */ isc_result_t isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota, unsigned int write_quota) { REQUIRE(rwl != NULL); UNUSED(read_quota); UNUSED(write_quota); rwl->type = isc_rwlocktype_read; rwl->active = 0; rwl->magic = RWLOCK_MAGIC; return (ISC_R_SUCCESS); } isc_result_t isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { REQUIRE(VALID_RWLOCK(rwl)); if (type == isc_rwlocktype_read) { if (rwl->type != isc_rwlocktype_read && rwl->active != 0) return (ISC_R_LOCKBUSY); rwl->type = isc_rwlocktype_read; rwl->active++; } else { if (rwl->active != 0) return (ISC_R_LOCKBUSY); rwl->type = isc_rwlocktype_write; rwl->active = 1; } return (ISC_R_SUCCESS); } isc_result_t isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { return (isc_rwlock_lock(rwl, type)); } isc_result_t isc_rwlock_tryupgrade(isc_rwlock_t *rwl) { isc_result_t result = ISC_R_SUCCESS; REQUIRE(VALID_RWLOCK(rwl)); REQUIRE(rwl->type == isc_rwlocktype_read); REQUIRE(rwl->active != 0); /* If we are the only reader then succeed. */ if (rwl->active == 1) rwl->type = isc_rwlocktype_write; else result = ISC_R_LOCKBUSY; return (result); } void isc_rwlock_downgrade(isc_rwlock_t *rwl) { REQUIRE(VALID_RWLOCK(rwl)); REQUIRE(rwl->type == isc_rwlocktype_write); REQUIRE(rwl->active == 1); rwl->type = isc_rwlocktype_read; } isc_result_t isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { REQUIRE(VALID_RWLOCK(rwl)); REQUIRE(rwl->type == type); UNUSED(type); INSIST(rwl->active > 0); rwl->active--; return (ISC_R_SUCCESS); } void isc_rwlock_destroy(isc_rwlock_t *rwl) { REQUIRE(rwl != NULL); REQUIRE(rwl->active == 0); rwl->magic = 0; } #endif /* ISC_PLATFORM_USETHREADS */ ntp-4.2.6p5/lib/isc/mutexblock.c0000644000175000017500000000313111307651604015457 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: mutexblock.c,v 1.20 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include isc_result_t isc_mutexblock_init(isc_mutex_t *block, unsigned int count) { isc_result_t result; unsigned int i; for (i = 0; i < count; i++) { result = isc_mutex_init(&block[i]); if (result != ISC_R_SUCCESS) { i--; while (i > 0) { DESTROYLOCK(&block[i]); i--; } return (result); } } return (ISC_R_SUCCESS); } isc_result_t isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count) { isc_result_t result; unsigned int i; for (i = 0; i < count; i++) { result = isc_mutex_destroy(&block[i]); if (result != ISC_R_SUCCESS) return (result); } return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/ratelimiter.c0000644000175000017500000002023311307651603015624 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ratelimiter.c,v 1.25 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include typedef enum { isc_ratelimiter_stalled = 0, isc_ratelimiter_ratelimited = 1, isc_ratelimiter_idle = 2, isc_ratelimiter_shuttingdown = 3 } isc_ratelimiter_state_t; struct isc_ratelimiter { isc_mem_t * mctx; isc_mutex_t lock; int refs; isc_task_t * task; isc_timer_t * timer; isc_interval_t interval; isc_uint32_t pertic; isc_ratelimiter_state_t state; isc_event_t shutdownevent; ISC_LIST(isc_event_t) pending; }; #define ISC_RATELIMITEREVENT_SHUTDOWN (ISC_EVENTCLASS_RATELIMITER + 1) static void ratelimiter_tick(isc_task_t *task, isc_event_t *event); static void ratelimiter_shutdowncomplete(isc_task_t *task, isc_event_t *event); isc_result_t isc_ratelimiter_create(isc_mem_t *mctx, isc_timermgr_t *timermgr, isc_task_t *task, isc_ratelimiter_t **ratelimiterp) { isc_result_t result; isc_ratelimiter_t *rl; INSIST(ratelimiterp != NULL && *ratelimiterp == NULL); rl = isc_mem_get(mctx, sizeof(*rl)); if (rl == NULL) return ISC_R_NOMEMORY; rl->mctx = mctx; rl->refs = 1; rl->task = task; isc_interval_set(&rl->interval, 0, 0); rl->timer = NULL; rl->pertic = 1; rl->state = isc_ratelimiter_idle; ISC_LIST_INIT(rl->pending); result = isc_mutex_init(&rl->lock); if (result != ISC_R_SUCCESS) goto free_mem; result = isc_timer_create(timermgr, isc_timertype_inactive, NULL, NULL, rl->task, ratelimiter_tick, rl, &rl->timer); if (result != ISC_R_SUCCESS) goto free_mutex; /* * Increment the reference count to indicate that we may * (soon) have events outstanding. */ rl->refs++; ISC_EVENT_INIT(&rl->shutdownevent, sizeof(isc_event_t), 0, NULL, ISC_RATELIMITEREVENT_SHUTDOWN, ratelimiter_shutdowncomplete, rl, rl, NULL, NULL); *ratelimiterp = rl; return (ISC_R_SUCCESS); free_mutex: DESTROYLOCK(&rl->lock); free_mem: isc_mem_put(mctx, rl, sizeof(*rl)); return (result); } isc_result_t isc_ratelimiter_setinterval(isc_ratelimiter_t *rl, isc_interval_t *interval) { isc_result_t result = ISC_R_SUCCESS; LOCK(&rl->lock); rl->interval = *interval; /* * If the timer is currently running, change its rate. */ if (rl->state == isc_ratelimiter_ratelimited) { result = isc_timer_reset(rl->timer, isc_timertype_ticker, NULL, &rl->interval, ISC_FALSE); } UNLOCK(&rl->lock); return (result); } void isc_ratelimiter_setpertic(isc_ratelimiter_t *rl, isc_uint32_t pertic) { if (pertic == 0) pertic = 1; rl->pertic = pertic; } isc_result_t isc_ratelimiter_enqueue(isc_ratelimiter_t *rl, isc_task_t *task, isc_event_t **eventp) { isc_result_t result = ISC_R_SUCCESS; isc_event_t *ev; REQUIRE(eventp != NULL && *eventp != NULL); REQUIRE(task != NULL); ev = *eventp; REQUIRE(ev->ev_sender == NULL); LOCK(&rl->lock); if (rl->state == isc_ratelimiter_ratelimited || rl->state == isc_ratelimiter_stalled) { isc_event_t *ev = *eventp; ev->ev_sender = task; ISC_LIST_APPEND(rl->pending, ev, ev_link); *eventp = NULL; } else if (rl->state == isc_ratelimiter_idle) { result = isc_timer_reset(rl->timer, isc_timertype_ticker, NULL, &rl->interval, ISC_FALSE); if (result == ISC_R_SUCCESS) { ev->ev_sender = task; rl->state = isc_ratelimiter_ratelimited; } } else { INSIST(rl->state == isc_ratelimiter_shuttingdown); result = ISC_R_SHUTTINGDOWN; } UNLOCK(&rl->lock); if (*eventp != NULL && result == ISC_R_SUCCESS) isc_task_send(task, eventp); return (result); } static void ratelimiter_tick(isc_task_t *task, isc_event_t *event) { isc_result_t result = ISC_R_SUCCESS; isc_ratelimiter_t *rl = (isc_ratelimiter_t *)event->ev_arg; isc_event_t *p; isc_uint32_t pertic; UNUSED(task); isc_event_free(&event); pertic = rl->pertic; while (pertic != 0) { pertic--; LOCK(&rl->lock); p = ISC_LIST_HEAD(rl->pending); if (p != NULL) { /* * There is work to do. Let's do it after unlocking. */ ISC_LIST_UNLINK(rl->pending, p, ev_link); } else { /* * No work left to do. Stop the timer so that we don't * waste resources by having it fire periodically. */ result = isc_timer_reset(rl->timer, isc_timertype_inactive, NULL, NULL, ISC_FALSE); RUNTIME_CHECK(result == ISC_R_SUCCESS); rl->state = isc_ratelimiter_idle; pertic = 0; /* Force the loop to exit. */ } UNLOCK(&rl->lock); if (p != NULL) { isc_task_t *evtask = p->ev_sender; isc_task_send(evtask, &p); } INSIST(p == NULL); } } void isc_ratelimiter_shutdown(isc_ratelimiter_t *rl) { isc_event_t *ev; isc_task_t *task; LOCK(&rl->lock); rl->state = isc_ratelimiter_shuttingdown; (void)isc_timer_reset(rl->timer, isc_timertype_inactive, NULL, NULL, ISC_FALSE); while ((ev = ISC_LIST_HEAD(rl->pending)) != NULL) { ISC_LIST_UNLINK(rl->pending, ev, ev_link); ev->ev_attributes |= ISC_EVENTATTR_CANCELED; task = ev->ev_sender; isc_task_send(task, &ev); } isc_timer_detach(&rl->timer); /* * Send an event to our task. The delivery of this event * indicates that no more timer events will be delivered. */ ev = &rl->shutdownevent; isc_task_send(rl->task, &ev); UNLOCK(&rl->lock); } static void ratelimiter_shutdowncomplete(isc_task_t *task, isc_event_t *event) { isc_ratelimiter_t *rl = (isc_ratelimiter_t *)event->ev_arg; UNUSED(task); isc_ratelimiter_detach(&rl); } static void ratelimiter_free(isc_ratelimiter_t *rl) { DESTROYLOCK(&rl->lock); isc_mem_put(rl->mctx, rl, sizeof(*rl)); } void isc_ratelimiter_attach(isc_ratelimiter_t *source, isc_ratelimiter_t **target) { REQUIRE(source != NULL); REQUIRE(target != NULL && *target == NULL); LOCK(&source->lock); REQUIRE(source->refs > 0); source->refs++; INSIST(source->refs > 0); UNLOCK(&source->lock); *target = source; } void isc_ratelimiter_detach(isc_ratelimiter_t **rlp) { isc_ratelimiter_t *rl = *rlp; isc_boolean_t free_now = ISC_FALSE; LOCK(&rl->lock); REQUIRE(rl->refs > 0); rl->refs--; if (rl->refs == 0) free_now = ISC_TRUE; UNLOCK(&rl->lock); if (free_now) ratelimiter_free(rl); *rlp = NULL; } isc_result_t isc_ratelimiter_stall(isc_ratelimiter_t *rl) { isc_result_t result = ISC_R_SUCCESS; LOCK(&rl->lock); switch (rl->state) { case isc_ratelimiter_shuttingdown: result = ISC_R_SHUTTINGDOWN; break; case isc_ratelimiter_ratelimited: result = isc_timer_reset(rl->timer, isc_timertype_inactive, NULL, NULL, ISC_FALSE); RUNTIME_CHECK(result == ISC_R_SUCCESS); case isc_ratelimiter_idle: case isc_ratelimiter_stalled: rl->state = isc_ratelimiter_stalled; break; } UNLOCK(&rl->lock); return (result); } isc_result_t isc_ratelimiter_release(isc_ratelimiter_t *rl) { isc_result_t result = ISC_R_SUCCESS; LOCK(&rl->lock); switch (rl->state) { case isc_ratelimiter_shuttingdown: result = ISC_R_SHUTTINGDOWN; break; case isc_ratelimiter_stalled: if (!ISC_LIST_EMPTY(rl->pending)) { result = isc_timer_reset(rl->timer, isc_timertype_ticker, NULL, &rl->interval, ISC_FALSE); if (result == ISC_R_SUCCESS) rl->state = isc_ratelimiter_ratelimited; } else rl->state = isc_ratelimiter_idle; break; case isc_ratelimiter_ratelimited: case isc_ratelimiter_idle: break; } UNLOCK(&rl->lock); return (result); } ntp-4.2.6p5/lib/isc/portset.c0000644000175000017500000000667011307651605015016 0ustar peterpeter/* * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: portset.c,v 1.4 2008/06/24 23:24:35 marka Exp $ */ /*! \file */ #include #include #include #include #include #include #define ISC_PORTSET_BUFSIZE (65536 / (sizeof(isc_uint32_t) * 8)) /*% * Internal representation of portset. It's an array of 32-bit integers, each * bit corresponding to a single port in the ascending order. For example, * the second most significant bit of buf[0] corresponds to port 1. */ struct isc_portset { unsigned int nports; /*%< number of ports in the set */ isc_uint32_t buf[ISC_PORTSET_BUFSIZE]; }; static inline isc_boolean_t portset_isset(isc_portset_t *portset, in_port_t port) { return (ISC_TF((portset->buf[port >> 5] & (1 << (port & 31))) != 0)); } static inline void portset_add(isc_portset_t *portset, in_port_t port) { if (!portset_isset(portset, port)) { portset->nports++; portset->buf[port >> 5] |= (1 << (port & 31)); } } static inline void portset_remove(isc_portset_t *portset, in_port_t port) { if (portset_isset(portset, port)) { portset->nports--; portset->buf[port >> 5] &= ~(1 << (port & 31)); } } isc_result_t isc_portset_create(isc_mem_t *mctx, isc_portset_t **portsetp) { isc_portset_t *portset; REQUIRE(portsetp != NULL && *portsetp == NULL); portset = isc_mem_get(mctx, sizeof(*portset)); if (portset == NULL) return (ISC_R_NOMEMORY); /* Make the set 'empty' by default */ memset(portset, 0, sizeof(*portset)); *portsetp = portset; return (ISC_R_SUCCESS); } void isc_portset_destroy(isc_mem_t *mctx, isc_portset_t **portsetp) { isc_portset_t *portset; REQUIRE(portsetp != NULL); portset = *portsetp; isc_mem_put(mctx, portset, sizeof(*portset)); } isc_boolean_t isc_portset_isset(isc_portset_t *portset, in_port_t port) { REQUIRE(portset != NULL); return (portset_isset(portset, port)); } unsigned int isc_portset_nports(isc_portset_t *portset) { REQUIRE(portset != NULL); return (portset->nports); } void isc_portset_add(isc_portset_t *portset, in_port_t port) { REQUIRE(portset != NULL); portset_add(portset, port); } void isc_portset_remove(isc_portset_t *portset, in_port_t port) { portset_remove(portset, port); } void isc_portset_addrange(isc_portset_t *portset, in_port_t port_lo, in_port_t port_hi) { in_port_t p; REQUIRE(portset != NULL); REQUIRE(port_lo <= port_hi); p = port_lo; do { portset_add(portset, p); } while (p++ < port_hi); } void isc_portset_removerange(isc_portset_t *portset, in_port_t port_lo, in_port_t port_hi) { in_port_t p; REQUIRE(portset != NULL); REQUIRE(port_lo <= port_hi); p = port_lo; do { portset_remove(portset, p); } while (p++ < port_hi); } ntp-4.2.6p5/lib/isc/region.c0000644000175000017500000000261311307651604014571 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: region.c,v 1.7 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include int isc_region_compare(isc_region_t *r1, isc_region_t *r2) { unsigned int l; int result; REQUIRE(r1 != NULL); REQUIRE(r2 != NULL); l = (r1->length < r2->length) ? r1->length : r2->length; if ((result = memcmp(r1->base, r2->base, l)) != 0) return ((result < 0) ? -1 : 1); else return ((r1->length == r2->length) ? 0 : (r1->length < r2->length) ? -1 : 1); } ntp-4.2.6p5/lib/isc/mips/0000755000175000017500000000000011307651602014106 5ustar peterpeterntp-4.2.6p5/lib/isc/mips/include/0000755000175000017500000000000011307651602015531 5ustar peterpeterntp-4.2.6p5/lib/isc/mips/include/isc/0000755000175000017500000000000011675461367016326 5ustar peterpeterntp-4.2.6p5/lib/isc/mips/include/isc/atomic.h0000644000175000017500000000464511307651603017746 0ustar peterpeter/* * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: atomic.h,v 1.3 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_ATOMIC_H #define ISC_ATOMIC_H 1 #include #include #ifdef ISC_PLATFORM_USEGCCASM /* * This routine atomically increments the value stored in 'p' by 'val', and * returns the previous value. */ static inline isc_int32_t isc_atomic_xadd(isc_int32_t *p, int val) { isc_int32_t orig; /* add is a cheat, since MIPS has no mov instruction */ __asm__ volatile ( "1:" "ll $3, %1\n" "add %0, $0, $3\n" "add $3, $3, %2\n" "sc $3, %1\n" "beq $3, 0, 1b" : "=&r"(orig) : "m"(*p), "r"(val) : "memory", "$3" ); return (orig); } /* * This routine atomically stores the value 'val' in 'p'. */ static inline void isc_atomic_store(isc_int32_t *p, isc_int32_t val) { __asm__ volatile ( "1:" "ll $3, %0\n" "add $3, $0, %1\n" "sc $3, %0\n" "beq $3, 0, 1b" : : "m"(*p), "r"(val) : "memory", "$3" ); } /* * This routine atomically replaces the value in 'p' with 'val', if the * original value is equal to 'cmpval'. The original value is returned in any * case. */ static inline isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, int cmpval, int val) { isc_int32_t orig; __asm__ volatile( "1:" "ll $3, %1\n" "add %0, $0, $3\n" "bne $3, %2, 2f\n" "add $3, $0, %3\n" "sc $3, %1\n" "beq $3, 0, 1b\n" "2:" : "=&r"(orig) : "m"(*p), "r"(cmpval), "r"(val) : "memory", "$3" ); return (orig); } #else /* !ISC_PLATFORM_USEGCCASM */ #error "unsupported compiler. disable atomic ops by --disable-atomic" #endif #endif /* ISC_ATOMIC_H */ ntp-4.2.6p5/lib/isc/buffer.c0000644000175000017500000002410411307651603014555 0ustar peterpeter/* * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: buffer.c,v 1.49 2008/09/25 04:02:39 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include void isc__buffer_init(isc_buffer_t *b, const void *base, unsigned int length) { /* * Make 'b' refer to the 'length'-byte region starting at 'base'. * XXXDCL see the comment in buffer.h about base being const. */ REQUIRE(b != NULL); ISC__BUFFER_INIT(b, base, length); } void isc__buffer_initnull(isc_buffer_t *b) { /* * Initialize a new buffer which has no backing store. This can * later be grown as needed and swapped in place. */ ISC__BUFFER_INIT(b, NULL, 0); } void isc_buffer_reinit(isc_buffer_t *b, void *base, unsigned int length) { /* * Re-initialize the buffer enough to reconfigure the base of the * buffer. We will swap in the new buffer, after copying any * data we contain into the new buffer and adjusting all of our * internal pointers. * * The buffer must not be smaller than the length of the original * buffer. */ REQUIRE(b->length <= length); REQUIRE(base != NULL); (void)memmove(base, b->base, b->length); b->base = base; b->length = length; } void isc__buffer_invalidate(isc_buffer_t *b) { /* * Make 'b' an invalid buffer. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(!ISC_LINK_LINKED(b, link)); REQUIRE(b->mctx == NULL); ISC__BUFFER_INVALIDATE(b); } void isc__buffer_region(isc_buffer_t *b, isc_region_t *r) { /* * Make 'r' refer to the region of 'b'. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(r != NULL); ISC__BUFFER_REGION(b, r); } void isc__buffer_usedregion(isc_buffer_t *b, isc_region_t *r) { /* * Make 'r' refer to the used region of 'b'. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(r != NULL); ISC__BUFFER_USEDREGION(b, r); } void isc__buffer_availableregion(isc_buffer_t *b, isc_region_t *r) { /* * Make 'r' refer to the available region of 'b'. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(r != NULL); ISC__BUFFER_AVAILABLEREGION(b, r); } void isc__buffer_add(isc_buffer_t *b, unsigned int n) { /* * Increase the 'used' region of 'b' by 'n' bytes. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->used + n <= b->length); ISC__BUFFER_ADD(b, n); } void isc__buffer_subtract(isc_buffer_t *b, unsigned int n) { /* * Decrease the 'used' region of 'b' by 'n' bytes. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->used >= n); ISC__BUFFER_SUBTRACT(b, n); } void isc__buffer_clear(isc_buffer_t *b) { /* * Make the used region empty. */ REQUIRE(ISC_BUFFER_VALID(b)); ISC__BUFFER_CLEAR(b); } void isc__buffer_consumedregion(isc_buffer_t *b, isc_region_t *r) { /* * Make 'r' refer to the consumed region of 'b'. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(r != NULL); ISC__BUFFER_CONSUMEDREGION(b, r); } void isc__buffer_remainingregion(isc_buffer_t *b, isc_region_t *r) { /* * Make 'r' refer to the remaining region of 'b'. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(r != NULL); ISC__BUFFER_REMAININGREGION(b, r); } void isc__buffer_activeregion(isc_buffer_t *b, isc_region_t *r) { /* * Make 'r' refer to the active region of 'b'. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(r != NULL); ISC__BUFFER_ACTIVEREGION(b, r); } void isc__buffer_setactive(isc_buffer_t *b, unsigned int n) { /* * Sets the end of the active region 'n' bytes after current. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->current + n <= b->used); ISC__BUFFER_SETACTIVE(b, n); } void isc__buffer_first(isc_buffer_t *b) { /* * Make the consumed region empty. */ REQUIRE(ISC_BUFFER_VALID(b)); ISC__BUFFER_FIRST(b); } void isc__buffer_forward(isc_buffer_t *b, unsigned int n) { /* * Increase the 'consumed' region of 'b' by 'n' bytes. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->current + n <= b->used); ISC__BUFFER_FORWARD(b, n); } void isc__buffer_back(isc_buffer_t *b, unsigned int n) { /* * Decrease the 'consumed' region of 'b' by 'n' bytes. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(n <= b->current); ISC__BUFFER_BACK(b, n); } void isc_buffer_compact(isc_buffer_t *b) { unsigned int length; void *src; /* * Compact the used region by moving the remaining region so it occurs * at the start of the buffer. The used region is shrunk by the size * of the consumed region, and the consumed region is then made empty. */ REQUIRE(ISC_BUFFER_VALID(b)); src = isc_buffer_current(b); length = isc_buffer_remaininglength(b); (void)memmove(b->base, src, (size_t)length); if (b->active > b->current) b->active -= b->current; else b->active = 0; b->current = 0; b->used = length; } isc_uint8_t isc_buffer_getuint8(isc_buffer_t *b) { unsigned char *cp; isc_uint8_t result; /* * Read an unsigned 8-bit integer from 'b' and return it. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->used - b->current >= 1); cp = isc_buffer_current(b); b->current += 1; result = ((isc_uint8_t)(cp[0])); return (result); } void isc__buffer_putuint8(isc_buffer_t *b, isc_uint8_t val) { REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->used + 1 <= b->length); ISC__BUFFER_PUTUINT8(b, val); } isc_uint16_t isc_buffer_getuint16(isc_buffer_t *b) { unsigned char *cp; isc_uint16_t result; /* * Read an unsigned 16-bit integer in network byte order from 'b', * convert it to host byte order, and return it. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->used - b->current >= 2); cp = isc_buffer_current(b); b->current += 2; result = ((unsigned int)(cp[0])) << 8; result |= ((unsigned int)(cp[1])); return (result); } void isc__buffer_putuint16(isc_buffer_t *b, isc_uint16_t val) { REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->used + 2 <= b->length); ISC__BUFFER_PUTUINT16(b, val); } void isc__buffer_putuint24(isc_buffer_t *b, isc_uint32_t val) { REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->used + 3 <= b->length); ISC__BUFFER_PUTUINT24(b, val); } isc_uint32_t isc_buffer_getuint32(isc_buffer_t *b) { unsigned char *cp; isc_uint32_t result; /* * Read an unsigned 32-bit integer in network byte order from 'b', * convert it to host byte order, and return it. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->used - b->current >= 4); cp = isc_buffer_current(b); b->current += 4; result = ((unsigned int)(cp[0])) << 24; result |= ((unsigned int)(cp[1])) << 16; result |= ((unsigned int)(cp[2])) << 8; result |= ((unsigned int)(cp[3])); return (result); } void isc__buffer_putuint32(isc_buffer_t *b, isc_uint32_t val) { REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->used + 4 <= b->length); ISC__BUFFER_PUTUINT32(b, val); } isc_uint64_t isc_buffer_getuint48(isc_buffer_t *b) { unsigned char *cp; isc_uint64_t result; /* * Read an unsigned 48-bit integer in network byte order from 'b', * convert it to host byte order, and return it. */ REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->used - b->current >= 6); cp = isc_buffer_current(b); b->current += 6; result = ((isc_int64_t)(cp[0])) << 40; result |= ((isc_int64_t)(cp[1])) << 32; result |= ((isc_int64_t)(cp[2])) << 24; result |= ((isc_int64_t)(cp[3])) << 16; result |= ((isc_int64_t)(cp[4])) << 8; result |= ((isc_int64_t)(cp[5])); return (result); } void isc__buffer_putuint48(isc_buffer_t *b, isc_uint64_t val) { isc_uint16_t valhi; isc_uint32_t vallo; REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->used + 6 <= b->length); valhi = (isc_uint16_t)(val >> 32); vallo = (isc_uint32_t)(val & 0xFFFFFFFF); ISC__BUFFER_PUTUINT16(b, valhi); ISC__BUFFER_PUTUINT32(b, vallo); } void isc__buffer_putmem(isc_buffer_t *b, const unsigned char *base, unsigned int length) { REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(b->used + length <= b->length); ISC__BUFFER_PUTMEM(b, base, length); } void isc__buffer_putstr(isc_buffer_t *b, const char *source) { unsigned int l; unsigned char *cp; REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(source != NULL); /* * Do not use ISC__BUFFER_PUTSTR(), so strlen is only done once. */ l = strlen(source); REQUIRE(l <= isc_buffer_availablelength(b)); cp = isc_buffer_used(b); memcpy(cp, source, l); b->used += l; } isc_result_t isc_buffer_copyregion(isc_buffer_t *b, const isc_region_t *r) { unsigned char *base; unsigned int available; REQUIRE(ISC_BUFFER_VALID(b)); REQUIRE(r != NULL); /* * XXXDCL */ base = isc_buffer_used(b); available = isc_buffer_availablelength(b); if (r->length > available) return (ISC_R_NOSPACE); memcpy(base, r->base, r->length); b->used += r->length; return (ISC_R_SUCCESS); } isc_result_t isc_buffer_allocate(isc_mem_t *mctx, isc_buffer_t **dynbuffer, unsigned int length) { isc_buffer_t *dbuf; REQUIRE(dynbuffer != NULL); REQUIRE(*dynbuffer == NULL); dbuf = isc_mem_get(mctx, length + sizeof(isc_buffer_t)); if (dbuf == NULL) return (ISC_R_NOMEMORY); isc_buffer_init(dbuf, ((unsigned char *)dbuf) + sizeof(isc_buffer_t), length); dbuf->mctx = mctx; *dynbuffer = dbuf; return (ISC_R_SUCCESS); } void isc_buffer_free(isc_buffer_t **dynbuffer) { unsigned int real_length; isc_buffer_t *dbuf; isc_mem_t *mctx; REQUIRE(dynbuffer != NULL); REQUIRE(ISC_BUFFER_VALID(*dynbuffer)); REQUIRE((*dynbuffer)->mctx != NULL); dbuf = *dynbuffer; *dynbuffer = NULL; /* destroy external reference */ real_length = dbuf->length + sizeof(isc_buffer_t); mctx = dbuf->mctx; dbuf->mctx = NULL; isc_buffer_invalidate(dbuf); isc_mem_put(mctx, dbuf, real_length); } ntp-4.2.6p5/lib/isc/lfsr.c0000644000175000017500000000714411307651603014257 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: lfsr.c,v 1.20 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #define VALID_LFSR(x) (x != NULL) void isc_lfsr_init(isc_lfsr_t *lfsr, isc_uint32_t state, unsigned int bits, isc_uint32_t tap, unsigned int count, isc_lfsrreseed_t reseed, void *arg) { REQUIRE(VALID_LFSR(lfsr)); REQUIRE(8 <= bits && bits <= 32); REQUIRE(tap != 0); lfsr->state = state; lfsr->bits = bits; lfsr->tap = tap; lfsr->count = count; lfsr->reseed = reseed; lfsr->arg = arg; if (count == 0 && reseed != NULL) reseed(lfsr, arg); if (lfsr->state == 0) lfsr->state = 0xffffffffU >> (32 - lfsr->bits); } /*! * Return the next state of the lfsr. */ static inline isc_uint32_t lfsr_generate(isc_lfsr_t *lfsr) { /* * If the previous state is zero, we must fill it with something * here, or we will begin to generate an extremely predictable output. * * First, give the reseed function a crack at it. If the state is * still 0, set it to all ones. */ if (lfsr->state == 0) { if (lfsr->reseed != NULL) lfsr->reseed(lfsr, lfsr->arg); if (lfsr->state == 0) lfsr->state = 0xffffffffU >> (32 - lfsr->bits); } if (lfsr->state & 0x01) { lfsr->state = (lfsr->state >> 1) ^ lfsr->tap; return (1); } else { lfsr->state >>= 1; return (0); } } void isc_lfsr_generate(isc_lfsr_t *lfsr, void *data, unsigned int count) { unsigned char *p; unsigned int bit; unsigned int byte; REQUIRE(VALID_LFSR(lfsr)); REQUIRE(data != NULL); REQUIRE(count > 0); p = data; byte = count; while (byte--) { *p = 0; for (bit = 0; bit < 7; bit++) { *p |= lfsr_generate(lfsr); *p <<= 1; } *p |= lfsr_generate(lfsr); p++; } if (lfsr->count != 0 && lfsr->reseed != NULL) { if (lfsr->count <= count * 8) lfsr->reseed(lfsr, lfsr->arg); else lfsr->count -= (count * 8); } } static inline isc_uint32_t lfsr_skipgenerate(isc_lfsr_t *lfsr, unsigned int skip) { while (skip--) (void)lfsr_generate(lfsr); (void)lfsr_generate(lfsr); return (lfsr->state); } /* * Skip "skip" states in "lfsr". */ void isc_lfsr_skip(isc_lfsr_t *lfsr, unsigned int skip) { REQUIRE(VALID_LFSR(lfsr)); while (skip--) (void)lfsr_generate(lfsr); } /* * Skip states in lfsr1 and lfsr2 using the other's current state. * Return the final state of lfsr1 ^ lfsr2. */ isc_uint32_t isc_lfsr_generate32(isc_lfsr_t *lfsr1, isc_lfsr_t *lfsr2) { isc_uint32_t state1, state2; isc_uint32_t skip1, skip2; REQUIRE(VALID_LFSR(lfsr1)); REQUIRE(VALID_LFSR(lfsr2)); skip1 = lfsr1->state & 0x01; skip2 = lfsr2->state & 0x01; /* cross-skip. */ state1 = lfsr_skipgenerate(lfsr1, skip2); state2 = lfsr_skipgenerate(lfsr2, skip1); return (state1 ^ state2); } ntp-4.2.6p5/lib/isc/version.c0000644000175000017500000000216511307651603014774 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: version.c,v 1.15 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include const char isc_version[] = VERSION; const unsigned int isc_libinterface = LIBINTERFACE; const unsigned int isc_librevision = LIBREVISION; const unsigned int isc_libage = LIBAGE; ntp-4.2.6p5/lib/isc/event.c0000644000175000017500000000476711307651603014442 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: event.c,v 1.21 2007/06/19 23:47:17 tbox Exp $ */ /*! * \file * \author Principal Author: Bob Halley */ #include #include #include #include /*** *** Events. ***/ static void destroy(isc_event_t *event) { isc_mem_t *mctx = event->ev_destroy_arg; isc_mem_put(mctx, event, event->ev_size); } isc_event_t * isc_event_allocate(isc_mem_t *mctx, void *sender, isc_eventtype_t type, isc_taskaction_t action, const void *arg, size_t size) { isc_event_t *event; void *deconst_arg; REQUIRE(size >= sizeof(struct isc_event)); REQUIRE(action != NULL); event = isc_mem_get(mctx, size); if (event == NULL) return (NULL); /* * Removing the const attribute from "arg" is the best of two * evils here. If the event->ev_arg member is made const, then * it affects a great many users of the task/event subsystem * which are not passing in an "arg" which starts its life as * const. Changing isc_event_allocate() and isc_task_onshutdown() * to not have "arg" prototyped as const (which is quite legitimate, * because neither of those functions modify arg) can cause * compiler whining anytime someone does want to use a const * arg that they themselves never modify, such as with * gcc -Wwrite-strings and using a string "arg". */ DE_CONST(arg, deconst_arg); ISC_EVENT_INIT(event, size, 0, NULL, type, action, deconst_arg, sender, destroy, mctx); return (event); } void isc_event_free(isc_event_t **eventp) { isc_event_t *event; REQUIRE(eventp != NULL); event = *eventp; REQUIRE(event != NULL); if (event->ev_destroy != NULL) (event->ev_destroy)(event); *eventp = NULL; } ntp-4.2.6p5/lib/isc/bitstring.c0000644000175000017500000000665011307651603015317 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: bitstring.c,v 1.17 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include #define DIV8(x) ((x) >> 3) #define MOD8(x) ((x) & 0x00000007U) #define OCTETS(n) (((n) + 7) >> 3) #define PADDED(n) ((((n) + 7) >> 3) << 3) #define BITSET(bs, n) (((bs)->data[DIV8(n)] & \ (1 << (7 - MOD8(n)))) != 0) #define SETBIT(bs, n) (bs)->data[DIV8(n)] |= (1 << (7 - MOD8(n))) #define CLEARBIT(bs, n) (bs)->data[DIV8(n)] &= ~(1 << (7 - MOD8(n))) #define BITSTRING_MAGIC ISC_MAGIC('B', 'S', 't', 'r') #define VALID_BITSTRING(b) ISC_MAGIC_VALID(b, BITSTRING_MAGIC) void isc_bitstring_init(isc_bitstring_t *bitstring, unsigned char *data, unsigned int length, unsigned int size, isc_boolean_t lsb0) { /* * Make 'bitstring' refer to the bitstring of 'size' bits starting * at 'data'. 'length' bits of the bitstring are valid. If 'lsb0' * is set then, bit 0 refers to the least significant bit of the * bitstring. Otherwise bit 0 is the most significant bit. */ REQUIRE(bitstring != NULL); REQUIRE(data != NULL); REQUIRE(length <= size); bitstring->magic = BITSTRING_MAGIC; bitstring->data = data; bitstring->length = length; bitstring->size = size; bitstring->lsb0 = lsb0; } void isc_bitstring_invalidate(isc_bitstring_t *bitstring) { /* * Invalidate 'bitstring'. */ REQUIRE(VALID_BITSTRING(bitstring)); bitstring->magic = 0; bitstring->data = NULL; bitstring->length = 0; bitstring->size = 0; bitstring->lsb0 = ISC_FALSE; } void isc_bitstring_copy(isc_bitstring_t *source, unsigned int sbitpos, isc_bitstring_t *target, unsigned int tbitpos, unsigned int n) { unsigned int tlast; /* * Starting at bit 'sbitpos', copy 'n' bits from 'source' to * the 'n' bits of 'target' starting at 'tbitpos'. */ REQUIRE(VALID_BITSTRING(source)); REQUIRE(VALID_BITSTRING(target)); REQUIRE(source->lsb0 == target->lsb0); if (source->lsb0) { REQUIRE(sbitpos <= source->length); sbitpos = PADDED(source->size) - sbitpos; REQUIRE(sbitpos >= n); sbitpos -= n; } else REQUIRE(sbitpos + n <= source->length); tlast = tbitpos + n; if (target->lsb0) { REQUIRE(tbitpos <= target->length); tbitpos = PADDED(target->size) - tbitpos; REQUIRE(tbitpos >= n); tbitpos -= n; } else REQUIRE(tlast <= target->size); if (tlast > target->length) target->length = tlast; /* * This is far from optimal... */ while (n > 0) { if (BITSET(source, sbitpos)) SETBIT(target, tbitpos); else CLEARBIT(target, tbitpos); sbitpos++; tbitpos++; n--; } } ntp-4.2.6p5/lib/isc/x86_64/0000755000175000017500000000000011307651602014074 5ustar peterpeterntp-4.2.6p5/lib/isc/x86_64/include/0000755000175000017500000000000011307651602015517 5ustar peterpeterntp-4.2.6p5/lib/isc/x86_64/include/isc/0000755000175000017500000000000011675461367016314 5ustar peterpeterntp-4.2.6p5/lib/isc/x86_64/include/isc/atomic.h0000644000175000017500000000572511307651603017734 0ustar peterpeter/* * Copyright (C) 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: atomic.h,v 1.6 2008/01/24 23:47:00 tbox Exp $ */ #ifndef ISC_ATOMIC_H #define ISC_ATOMIC_H 1 #include #include #ifdef ISC_PLATFORM_USEGCCASM /* We share the gcc-version with x86_32 */ #error "impossible case. check build configuration" #elif defined(ISC_PLATFORM_USESTDASM) /* * The followings are "generic" assembly code which implements the same * functionality in case the gcc extension cannot be used. It should be * better to avoid inlining below, since we directly refer to specific * registers for arguments, which would not actually correspond to the * intended address or value in the embedded mnemonic. */ #include /* for 'UNUSED' macro */ static isc_int32_t isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { UNUSED(p); UNUSED(val); __asm ( "movq %rdi, %rdx\n" "movl %esi, %eax\n" #ifdef ISC_PLATFORM_USETHREADS "lock;" #endif "xadd %eax, (%rdx)\n" /* * XXX: assume %eax will be used as the return value. */ ); } #ifdef ISC_PLATFORM_HAVEXADDQ static isc_int64_t isc_atomic_xaddq(isc_int64_t *p, isc_int64_t val) { UNUSED(p); UNUSED(val); __asm ( "movq %rdi, %rdx\n" "movq %rsi, %rax\n" #ifdef ISC_PLATFORM_USETHREADS "lock;" #endif "xaddq %rax, (%rdx)\n" /* * XXX: assume %rax will be used as the return value. */ ); } #endif static void isc_atomic_store(isc_int32_t *p, isc_int32_t val) { UNUSED(p); UNUSED(val); __asm ( "movq %rdi, %rax\n" "movl %esi, %edx\n" #ifdef ISC_PLATFORM_USETHREADS "lock;" #endif "xchgl (%rax), %edx\n" /* * XXX: assume %rax will be used as the return value. */ ); } static isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { UNUSED(p); UNUSED(cmpval); UNUSED(val); __asm ( "movl %edx, %ecx\n" "movl %esi, %eax\n" "movq %rdi, %rdx\n" #ifdef ISC_PLATFORM_USETHREADS "lock;" #endif /* * If (%rdi) == %eax then (%rdi) := %edx. * %eax is set to old (%ecx), which will be the return value. */ "cmpxchgl %ecx, (%rdx)" ); } #else /* !ISC_PLATFORM_USEGCCASM && !ISC_PLATFORM_USESTDASM */ #error "unsupported compiler. disable atomic ops by --disable-atomic" #endif #endif /* ISC_ATOMIC_H */ ntp-4.2.6p5/lib/isc/entropy.c0000644000175000017500000007201611307651603015011 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: entropy.c,v 1.18.332.2 2009/01/18 23:47:41 tbox Exp $ */ /*! \file * \brief * This is the system independent part of the entropy module. It is * compiled via inclusion from the relevant OS source file, ie, * \link unix/entropy.c unix/entropy.c \endlink or win32/entropy.c. * * \author Much of this code is modeled after the NetBSD /dev/random implementation, * written by Michael Graff . */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define ENTROPY_MAGIC ISC_MAGIC('E', 'n', 't', 'e') #define SOURCE_MAGIC ISC_MAGIC('E', 'n', 't', 's') #define VALID_ENTROPY(e) ISC_MAGIC_VALID(e, ENTROPY_MAGIC) #define VALID_SOURCE(s) ISC_MAGIC_VALID(s, SOURCE_MAGIC) /*** *** "constants." Do not change these unless you _really_ know what *** you are doing. ***/ /*% * Size of entropy pool in 32-bit words. This _MUST_ be a power of 2. */ #define RND_POOLWORDS 128 /*% Pool in bytes. */ #define RND_POOLBYTES (RND_POOLWORDS * 4) /*% Pool in bits. */ #define RND_POOLBITS (RND_POOLWORDS * 32) /*% * Number of bytes returned per hash. This must be true: * threshold * 2 <= digest_size_in_bytes */ #define RND_ENTROPY_THRESHOLD 10 #define THRESHOLD_BITS (RND_ENTROPY_THRESHOLD * 8) /*% * Size of the input event queue in samples. */ #define RND_EVENTQSIZE 32 /*% * The number of times we'll "reseed" for pseudorandom seeds. This is an * extremely weak pseudorandom seed. If the caller is using lots of * pseudorandom data and they cannot provide a stronger random source, * there is little we can do other than hope they're smart enough to * call _adddata() with something better than we can come up with. */ #define RND_INITIALIZE 128 /*% Entropy Pool */ typedef struct { isc_uint32_t cursor; /*%< current add point in the pool */ isc_uint32_t entropy; /*%< current entropy estimate in bits */ isc_uint32_t pseudo; /*%< bits extracted in pseudorandom */ isc_uint32_t rotate; /*%< how many bits to rotate by */ isc_uint32_t pool[RND_POOLWORDS]; /*%< random pool data */ } isc_entropypool_t; struct isc_entropy { unsigned int magic; isc_mem_t *mctx; isc_mutex_t lock; unsigned int refcnt; isc_uint32_t initialized; isc_uint32_t initcount; isc_entropypool_t pool; unsigned int nsources; isc_entropysource_t *nextsource; ISC_LIST(isc_entropysource_t) sources; }; /*% Sample Queue */ typedef struct { isc_uint32_t last_time; /*%< last time recorded */ isc_uint32_t last_delta; /*%< last delta value */ isc_uint32_t last_delta2; /*%< last delta2 value */ isc_uint32_t nsamples; /*%< number of samples filled in */ isc_uint32_t *samples; /*%< the samples */ isc_uint32_t *extra; /*%< extra samples added in */ } sample_queue_t; typedef struct { sample_queue_t samplequeue; } isc_entropysamplesource_t; typedef struct { isc_boolean_t start_called; isc_entropystart_t startfunc; isc_entropyget_t getfunc; isc_entropystop_t stopfunc; void *arg; sample_queue_t samplequeue; } isc_cbsource_t; typedef struct { FILESOURCE_HANDLE_TYPE handle; } isc_entropyfilesource_t; struct isc_entropysource { unsigned int magic; unsigned int type; isc_entropy_t *ent; isc_uint32_t total; /*%< entropy from this source */ ISC_LINK(isc_entropysource_t) link; char name[32]; isc_boolean_t bad; isc_boolean_t warn_keyboard; isc_keyboard_t kbd; union { isc_entropysamplesource_t sample; isc_entropyfilesource_t file; isc_cbsource_t callback; isc_entropyusocketsource_t usocket; } sources; }; #define ENTROPY_SOURCETYPE_SAMPLE 1 /*%< Type is a sample source */ #define ENTROPY_SOURCETYPE_FILE 2 /*%< Type is a file source */ #define ENTROPY_SOURCETYPE_CALLBACK 3 /*%< Type is a callback source */ #define ENTROPY_SOURCETYPE_USOCKET 4 /*%< Type is a Unix socket source */ /*@{*/ /*% * The random pool "taps" */ #define TAP1 99 #define TAP2 59 #define TAP3 31 #define TAP4 9 #define TAP5 7 /*@}*/ /*@{*/ /*% * Declarations for function provided by the system dependent sources that * include this file. */ static void fillpool(isc_entropy_t *, unsigned int, isc_boolean_t); static int wait_for_sources(isc_entropy_t *); static void destroyfilesource(isc_entropyfilesource_t *source); static void destroyusocketsource(isc_entropyusocketsource_t *source); /*@}*/ static void samplequeue_release(isc_entropy_t *ent, sample_queue_t *sq) { REQUIRE(sq->samples != NULL); REQUIRE(sq->extra != NULL); isc_mem_put(ent->mctx, sq->samples, RND_EVENTQSIZE * 4); isc_mem_put(ent->mctx, sq->extra, RND_EVENTQSIZE * 4); sq->samples = NULL; sq->extra = NULL; } static isc_result_t samplesource_allocate(isc_entropy_t *ent, sample_queue_t *sq) { sq->samples = isc_mem_get(ent->mctx, RND_EVENTQSIZE * 4); if (sq->samples == NULL) return (ISC_R_NOMEMORY); sq->extra = isc_mem_get(ent->mctx, RND_EVENTQSIZE * 4); if (sq->extra == NULL) { isc_mem_put(ent->mctx, sq->samples, RND_EVENTQSIZE * 4); sq->samples = NULL; return (ISC_R_NOMEMORY); } sq->nsamples = 0; return (ISC_R_SUCCESS); } /*% * Add in entropy, even when the value we're adding in could be * very large. */ static inline void add_entropy(isc_entropy_t *ent, isc_uint32_t entropy) { /* clamp input. Yes, this must be done. */ entropy = ISC_MIN(entropy, RND_POOLBITS); /* Add in the entropy we already have. */ entropy += ent->pool.entropy; /* Clamp. */ ent->pool.entropy = ISC_MIN(entropy, RND_POOLBITS); } /*% * Decrement the amount of entropy the pool has. */ static inline void subtract_entropy(isc_entropy_t *ent, isc_uint32_t entropy) { entropy = ISC_MIN(entropy, ent->pool.entropy); ent->pool.entropy -= entropy; } /*! * Add in entropy, even when the value we're adding in could be * very large. */ static inline void add_pseudo(isc_entropy_t *ent, isc_uint32_t pseudo) { /* clamp input. Yes, this must be done. */ pseudo = ISC_MIN(pseudo, RND_POOLBITS * 8); /* Add in the pseudo we already have. */ pseudo += ent->pool.pseudo; /* Clamp. */ ent->pool.pseudo = ISC_MIN(pseudo, RND_POOLBITS * 8); } /*! * Decrement the amount of pseudo the pool has. */ static inline void subtract_pseudo(isc_entropy_t *ent, isc_uint32_t pseudo) { pseudo = ISC_MIN(pseudo, ent->pool.pseudo); ent->pool.pseudo -= pseudo; } /*! * Add one word to the pool, rotating the input as needed. */ static inline void entropypool_add_word(isc_entropypool_t *rp, isc_uint32_t val) { /* * Steal some values out of the pool, and xor them into the * word we were given. * * Mix the new value into the pool using xor. This will * prevent the actual values from being known to the caller * since the previous values are assumed to be unknown as well. */ val ^= rp->pool[(rp->cursor + TAP1) & (RND_POOLWORDS - 1)]; val ^= rp->pool[(rp->cursor + TAP2) & (RND_POOLWORDS - 1)]; val ^= rp->pool[(rp->cursor + TAP3) & (RND_POOLWORDS - 1)]; val ^= rp->pool[(rp->cursor + TAP4) & (RND_POOLWORDS - 1)]; val ^= rp->pool[(rp->cursor + TAP5) & (RND_POOLWORDS - 1)]; rp->pool[rp->cursor++] ^= ((val << rp->rotate) | (val >> (32 - rp->rotate))); /* * If we have looped around the pool, increment the rotate * variable so the next value will get xored in rotated to * a different position. * Increment by a value that is relatively prime to the word size * to try to spread the bits throughout the pool quickly when the * pool is empty. */ if (rp->cursor == RND_POOLWORDS) { rp->cursor = 0; rp->rotate = (rp->rotate + 7) & 31; } } /*! * Add a buffer's worth of data to the pool. * * Requires that the lock is held on the entropy pool. */ static void entropypool_adddata(isc_entropy_t *ent, void *p, unsigned int len, isc_uint32_t entropy) { isc_uint32_t val; unsigned long addr; isc_uint8_t *buf; addr = (unsigned long)p; buf = p; if ((addr & 0x03U) != 0U) { val = 0; switch (len) { case 3: val = *buf++; len--; case 2: val = val << 8 | *buf++; len--; case 1: val = val << 8 | *buf++; len--; } entropypool_add_word(&ent->pool, val); } for (; len > 3; len -= 4) { val = *((isc_uint32_t *)buf); entropypool_add_word(&ent->pool, val); buf += 4; } if (len != 0) { val = 0; switch (len) { case 3: val = *buf++; case 2: val = val << 8 | *buf++; case 1: val = val << 8 | *buf++; } entropypool_add_word(&ent->pool, val); } add_entropy(ent, entropy); subtract_pseudo(ent, entropy); } static inline void reseed(isc_entropy_t *ent) { isc_time_t t; pid_t pid; if (ent->initcount == 0) { pid = getpid(); entropypool_adddata(ent, &pid, sizeof(pid), 0); pid = getppid(); entropypool_adddata(ent, &pid, sizeof(pid), 0); } /*! * After we've reseeded 100 times, only add new timing info every * 50 requests. This will keep us from using lots and lots of * CPU just to return bad pseudorandom data anyway. */ if (ent->initcount > 100) if ((ent->initcount % 50) != 0) return; TIME_NOW(&t); entropypool_adddata(ent, &t, sizeof(t), 0); ent->initcount++; } static inline unsigned int estimate_entropy(sample_queue_t *sq, isc_uint32_t t) { isc_int32_t delta; isc_int32_t delta2; isc_int32_t delta3; /*! * If the time counter has overflowed, calculate the real difference. * If it has not, it is simpler. */ if (t < sq->last_time) delta = UINT_MAX - sq->last_time + t; else delta = sq->last_time - t; if (delta < 0) delta = -delta; /* * Calculate the second and third order differentials */ delta2 = sq->last_delta - delta; if (delta2 < 0) delta2 = -delta2; delta3 = sq->last_delta2 - delta2; if (delta3 < 0) delta3 = -delta3; sq->last_time = t; sq->last_delta = delta; sq->last_delta2 = delta2; /* * If any delta is 0, we got no entropy. If all are non-zero, we * might have something. */ if (delta == 0 || delta2 == 0 || delta3 == 0) return 0; /* * We could find the smallest delta and claim we got log2(delta) * bits, but for now return that we found 1 bit. */ return 1; } static unsigned int crunchsamples(isc_entropy_t *ent, sample_queue_t *sq) { unsigned int ns; unsigned int added; if (sq->nsamples < 6) return (0); added = 0; sq->last_time = sq->samples[0]; sq->last_delta = 0; sq->last_delta2 = 0; /* * Prime the values by adding in the first 4 samples in. This * should completely initialize the delta calculations. */ for (ns = 0; ns < 4; ns++) (void)estimate_entropy(sq, sq->samples[ns]); for (ns = 4; ns < sq->nsamples; ns++) added += estimate_entropy(sq, sq->samples[ns]); entropypool_adddata(ent, sq->samples, sq->nsamples * 4, added); entropypool_adddata(ent, sq->extra, sq->nsamples * 4, 0); /* * Move the last 4 samples into the first 4 positions, and start * adding new samples from that point. */ for (ns = 0; ns < 4; ns++) { sq->samples[ns] = sq->samples[sq->nsamples - 4 + ns]; sq->extra[ns] = sq->extra[sq->nsamples - 4 + ns]; } sq->nsamples = 4; return (added); } static unsigned int get_from_callback(isc_entropysource_t *source, unsigned int desired, isc_boolean_t blocking) { isc_entropy_t *ent = source->ent; isc_cbsource_t *cbs = &source->sources.callback; unsigned int added; unsigned int got; isc_result_t result; if (desired == 0) return (0); if (source->bad) return (0); if (!cbs->start_called && cbs->startfunc != NULL) { result = cbs->startfunc(source, cbs->arg, blocking); if (result != ISC_R_SUCCESS) return (0); cbs->start_called = ISC_TRUE; } added = 0; result = ISC_R_SUCCESS; while (desired > 0 && result == ISC_R_SUCCESS) { result = cbs->getfunc(source, cbs->arg, blocking); if (result == ISC_R_QUEUEFULL) { got = crunchsamples(ent, &cbs->samplequeue); added += got; desired -= ISC_MIN(got, desired); result = ISC_R_SUCCESS; } else if (result != ISC_R_SUCCESS && result != ISC_R_NOTBLOCKING) source->bad = ISC_TRUE; } return (added); } /* * Extract some number of bytes from the random pool, decreasing the * estimate of randomness as each byte is extracted. * * Do this by stiring the pool and returning a part of hash as randomness. * Note that no secrets are given away here since parts of the hash are * xored together before returned. * * Honor the request from the caller to only return good data, any data, * etc. */ isc_result_t isc_entropy_getdata(isc_entropy_t *ent, void *data, unsigned int length, unsigned int *returned, unsigned int flags) { unsigned int i; isc_sha1_t hash; unsigned char digest[ISC_SHA1_DIGESTLENGTH]; isc_uint32_t remain, deltae, count, total; isc_uint8_t *buf; isc_boolean_t goodonly, partial, blocking; REQUIRE(VALID_ENTROPY(ent)); REQUIRE(data != NULL); REQUIRE(length > 0); goodonly = ISC_TF((flags & ISC_ENTROPY_GOODONLY) != 0); partial = ISC_TF((flags & ISC_ENTROPY_PARTIAL) != 0); blocking = ISC_TF((flags & ISC_ENTROPY_BLOCKING) != 0); REQUIRE(!partial || returned != NULL); LOCK(&ent->lock); remain = length; buf = data; total = 0; while (remain != 0) { count = ISC_MIN(remain, RND_ENTROPY_THRESHOLD); /* * If we are extracting good data only, make certain we * have enough data in our pool for this pass. If we don't, * get some, and fail if we can't, and partial returns * are not ok. */ if (goodonly) { unsigned int fillcount; fillcount = ISC_MAX(remain * 8, count * 8); /* * If, however, we have at least THRESHOLD_BITS * of entropy in the pool, don't block here. It is * better to drain the pool once in a while and * then refill it than it is to constantly keep the * pool full. */ if (ent->pool.entropy >= THRESHOLD_BITS) fillpool(ent, fillcount, ISC_FALSE); else fillpool(ent, fillcount, blocking); /* * Verify that we got enough entropy to do one * extraction. If we didn't, bail. */ if (ent->pool.entropy < THRESHOLD_BITS) { if (!partial) goto zeroize; else goto partial_output; } } else { /* * If we've extracted half our pool size in bits * since the last refresh, try to refresh here. */ if (ent->initialized < THRESHOLD_BITS) fillpool(ent, THRESHOLD_BITS, blocking); else fillpool(ent, 0, ISC_FALSE); /* * If we've not initialized with enough good random * data, seed with our crappy code. */ if (ent->initialized < THRESHOLD_BITS) reseed(ent); } isc_sha1_init(&hash); isc_sha1_update(&hash, (void *)(ent->pool.pool), RND_POOLBYTES); isc_sha1_final(&hash, digest); /* * Stir the extracted data (all of it) back into the pool. */ entropypool_adddata(ent, digest, ISC_SHA1_DIGESTLENGTH, 0); for (i = 0; i < count; i++) buf[i] = digest[i] ^ digest[i + RND_ENTROPY_THRESHOLD]; buf += count; remain -= count; deltae = count * 8; deltae = ISC_MIN(deltae, ent->pool.entropy); total += deltae; subtract_entropy(ent, deltae); add_pseudo(ent, count * 8); } partial_output: memset(digest, 0, sizeof(digest)); if (returned != NULL) *returned = (length - remain); UNLOCK(&ent->lock); return (ISC_R_SUCCESS); zeroize: /* put the entropy we almost extracted back */ add_entropy(ent, total); memset(data, 0, length); memset(digest, 0, sizeof(digest)); if (returned != NULL) *returned = 0; UNLOCK(&ent->lock); return (ISC_R_NOENTROPY); } static void isc_entropypool_init(isc_entropypool_t *pool) { pool->cursor = RND_POOLWORDS - 1; pool->entropy = 0; pool->pseudo = 0; pool->rotate = 0; memset(pool->pool, 0, RND_POOLBYTES); } static void isc_entropypool_invalidate(isc_entropypool_t *pool) { pool->cursor = 0; pool->entropy = 0; pool->pseudo = 0; pool->rotate = 0; memset(pool->pool, 0, RND_POOLBYTES); } isc_result_t isc_entropy_create(isc_mem_t *mctx, isc_entropy_t **entp) { isc_result_t result; isc_entropy_t *ent; REQUIRE(mctx != NULL); REQUIRE(entp != NULL && *entp == NULL); ent = isc_mem_get(mctx, sizeof(isc_entropy_t)); if (ent == NULL) return (ISC_R_NOMEMORY); /* * We need a lock. */ result = isc_mutex_init(&ent->lock); if (result != ISC_R_SUCCESS) goto errout; /* * From here down, no failures will/can occur. */ ISC_LIST_INIT(ent->sources); ent->nextsource = NULL; ent->nsources = 0; ent->mctx = NULL; isc_mem_attach(mctx, &ent->mctx); ent->refcnt = 1; ent->initialized = 0; ent->initcount = 0; ent->magic = ENTROPY_MAGIC; isc_entropypool_init(&ent->pool); *entp = ent; return (ISC_R_SUCCESS); errout: isc_mem_put(mctx, ent, sizeof(isc_entropy_t)); return (result); } /*! * Requires "ent" be locked. */ static void destroysource(isc_entropysource_t **sourcep) { isc_entropysource_t *source; isc_entropy_t *ent; isc_cbsource_t *cbs; source = *sourcep; *sourcep = NULL; ent = source->ent; ISC_LIST_UNLINK(ent->sources, source, link); ent->nextsource = NULL; REQUIRE(ent->nsources > 0); ent->nsources--; switch (source->type) { case ENTROPY_SOURCETYPE_FILE: if (! source->bad) destroyfilesource(&source->sources.file); break; case ENTROPY_SOURCETYPE_USOCKET: if (! source->bad) destroyusocketsource(&source->sources.usocket); break; case ENTROPY_SOURCETYPE_SAMPLE: samplequeue_release(ent, &source->sources.sample.samplequeue); break; case ENTROPY_SOURCETYPE_CALLBACK: cbs = &source->sources.callback; if (cbs->start_called && cbs->stopfunc != NULL) { cbs->stopfunc(source, cbs->arg); cbs->start_called = ISC_FALSE; } samplequeue_release(ent, &cbs->samplequeue); break; } memset(source, 0, sizeof(isc_entropysource_t)); isc_mem_put(ent->mctx, source, sizeof(isc_entropysource_t)); } static inline isc_boolean_t destroy_check(isc_entropy_t *ent) { isc_entropysource_t *source; if (ent->refcnt > 0) return (ISC_FALSE); source = ISC_LIST_HEAD(ent->sources); while (source != NULL) { switch (source->type) { case ENTROPY_SOURCETYPE_FILE: case ENTROPY_SOURCETYPE_USOCKET: break; default: return (ISC_FALSE); } source = ISC_LIST_NEXT(source, link); } return (ISC_TRUE); } static void destroy(isc_entropy_t **entp) { isc_entropy_t *ent; isc_entropysource_t *source; isc_mem_t *mctx; REQUIRE(entp != NULL && *entp != NULL); ent = *entp; *entp = NULL; LOCK(&ent->lock); REQUIRE(ent->refcnt == 0); /* * Here, detach non-sample sources. */ source = ISC_LIST_HEAD(ent->sources); while (source != NULL) { switch(source->type) { case ENTROPY_SOURCETYPE_FILE: case ENTROPY_SOURCETYPE_USOCKET: destroysource(&source); break; } source = ISC_LIST_HEAD(ent->sources); } /* * If there are other types of sources, we've found a bug. */ REQUIRE(ISC_LIST_EMPTY(ent->sources)); mctx = ent->mctx; isc_entropypool_invalidate(&ent->pool); UNLOCK(&ent->lock); DESTROYLOCK(&ent->lock); memset(ent, 0, sizeof(isc_entropy_t)); isc_mem_put(mctx, ent, sizeof(isc_entropy_t)); isc_mem_detach(&mctx); } void isc_entropy_destroysource(isc_entropysource_t **sourcep) { isc_entropysource_t *source; isc_entropy_t *ent; isc_boolean_t killit; REQUIRE(sourcep != NULL); REQUIRE(VALID_SOURCE(*sourcep)); source = *sourcep; *sourcep = NULL; ent = source->ent; REQUIRE(VALID_ENTROPY(ent)); LOCK(&ent->lock); destroysource(&source); killit = destroy_check(ent); UNLOCK(&ent->lock); if (killit) destroy(&ent); } isc_result_t isc_entropy_createcallbacksource(isc_entropy_t *ent, isc_entropystart_t start, isc_entropyget_t get, isc_entropystop_t stop, void *arg, isc_entropysource_t **sourcep) { isc_result_t result; isc_entropysource_t *source; isc_cbsource_t *cbs; REQUIRE(VALID_ENTROPY(ent)); REQUIRE(get != NULL); REQUIRE(sourcep != NULL && *sourcep == NULL); LOCK(&ent->lock); source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t)); if (source == NULL) { result = ISC_R_NOMEMORY; goto errout; } source->bad = ISC_FALSE; cbs = &source->sources.callback; result = samplesource_allocate(ent, &cbs->samplequeue); if (result != ISC_R_SUCCESS) goto errout; cbs->start_called = ISC_FALSE; cbs->startfunc = start; cbs->getfunc = get; cbs->stopfunc = stop; cbs->arg = arg; /* * From here down, no failures can occur. */ source->magic = SOURCE_MAGIC; source->type = ENTROPY_SOURCETYPE_CALLBACK; source->ent = ent; source->total = 0; memset(source->name, 0, sizeof(source->name)); ISC_LINK_INIT(source, link); /* * Hook it into the entropy system. */ ISC_LIST_APPEND(ent->sources, source, link); ent->nsources++; *sourcep = source; UNLOCK(&ent->lock); return (ISC_R_SUCCESS); errout: if (source != NULL) isc_mem_put(ent->mctx, source, sizeof(isc_entropysource_t)); UNLOCK(&ent->lock); return (result); } void isc_entropy_stopcallbacksources(isc_entropy_t *ent) { isc_entropysource_t *source; isc_cbsource_t *cbs; REQUIRE(VALID_ENTROPY(ent)); LOCK(&ent->lock); source = ISC_LIST_HEAD(ent->sources); while (source != NULL) { if (source->type == ENTROPY_SOURCETYPE_CALLBACK) { cbs = &source->sources.callback; if (cbs->start_called && cbs->stopfunc != NULL) { cbs->stopfunc(source, cbs->arg); cbs->start_called = ISC_FALSE; } } source = ISC_LIST_NEXT(source, link); } UNLOCK(&ent->lock); } isc_result_t isc_entropy_createsamplesource(isc_entropy_t *ent, isc_entropysource_t **sourcep) { isc_result_t result; isc_entropysource_t *source; sample_queue_t *sq; REQUIRE(VALID_ENTROPY(ent)); REQUIRE(sourcep != NULL && *sourcep == NULL); LOCK(&ent->lock); source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t)); if (source == NULL) { result = ISC_R_NOMEMORY; goto errout; } sq = &source->sources.sample.samplequeue; result = samplesource_allocate(ent, sq); if (result != ISC_R_SUCCESS) goto errout; /* * From here down, no failures can occur. */ source->magic = SOURCE_MAGIC; source->type = ENTROPY_SOURCETYPE_SAMPLE; source->ent = ent; source->total = 0; memset(source->name, 0, sizeof(source->name)); ISC_LINK_INIT(source, link); /* * Hook it into the entropy system. */ ISC_LIST_APPEND(ent->sources, source, link); ent->nsources++; *sourcep = source; UNLOCK(&ent->lock); return (ISC_R_SUCCESS); errout: if (source != NULL) isc_mem_put(ent->mctx, source, sizeof(isc_entropysource_t)); UNLOCK(&ent->lock); return (result); } /*! * Add a sample, and return ISC_R_SUCCESS if the queue has become full, * ISC_R_NOENTROPY if it has space remaining, and ISC_R_NOMORE if the * queue was full when this function was called. */ static isc_result_t addsample(sample_queue_t *sq, isc_uint32_t sample, isc_uint32_t extra) { if (sq->nsamples >= RND_EVENTQSIZE) return (ISC_R_NOMORE); sq->samples[sq->nsamples] = sample; sq->extra[sq->nsamples] = extra; sq->nsamples++; if (sq->nsamples >= RND_EVENTQSIZE) return (ISC_R_QUEUEFULL); return (ISC_R_SUCCESS); } isc_result_t isc_entropy_addsample(isc_entropysource_t *source, isc_uint32_t sample, isc_uint32_t extra) { isc_entropy_t *ent; sample_queue_t *sq; unsigned int entropy; isc_result_t result; REQUIRE(VALID_SOURCE(source)); ent = source->ent; LOCK(&ent->lock); sq = &source->sources.sample.samplequeue; result = addsample(sq, sample, extra); if (result == ISC_R_QUEUEFULL) { entropy = crunchsamples(ent, sq); add_entropy(ent, entropy); } UNLOCK(&ent->lock); return (result); } isc_result_t isc_entropy_addcallbacksample(isc_entropysource_t *source, isc_uint32_t sample, isc_uint32_t extra) { sample_queue_t *sq; isc_result_t result; REQUIRE(VALID_SOURCE(source)); REQUIRE(source->type == ENTROPY_SOURCETYPE_CALLBACK); sq = &source->sources.callback.samplequeue; result = addsample(sq, sample, extra); return (result); } void isc_entropy_putdata(isc_entropy_t *ent, void *data, unsigned int length, isc_uint32_t entropy) { REQUIRE(VALID_ENTROPY(ent)); LOCK(&ent->lock); entropypool_adddata(ent, data, length, entropy); if (ent->initialized < THRESHOLD_BITS) ent->initialized = THRESHOLD_BITS; UNLOCK(&ent->lock); } static void dumpstats(isc_entropy_t *ent, FILE *out) { fprintf(out, isc_msgcat_get(isc_msgcat, ISC_MSGSET_ENTROPY, ISC_MSG_ENTROPYSTATS, "Entropy pool %p: refcnt %u cursor %u," " rotate %u entropy %u pseudo %u nsources %u" " nextsource %p initialized %u initcount %u\n"), ent, ent->refcnt, ent->pool.cursor, ent->pool.rotate, ent->pool.entropy, ent->pool.pseudo, ent->nsources, ent->nextsource, ent->initialized, ent->initcount); } /* * This function ignores locking. Use at your own risk. */ void isc_entropy_stats(isc_entropy_t *ent, FILE *out) { REQUIRE(VALID_ENTROPY(ent)); LOCK(&ent->lock); dumpstats(ent, out); UNLOCK(&ent->lock); } unsigned int isc_entropy_status(isc_entropy_t *ent) { unsigned int estimate; LOCK(&ent->lock); estimate = ent->pool.entropy; UNLOCK(&ent->lock); return estimate; } void isc_entropy_attach(isc_entropy_t *ent, isc_entropy_t **entp) { REQUIRE(VALID_ENTROPY(ent)); REQUIRE(entp != NULL && *entp == NULL); LOCK(&ent->lock); ent->refcnt++; *entp = ent; UNLOCK(&ent->lock); } void isc_entropy_detach(isc_entropy_t **entp) { isc_entropy_t *ent; isc_boolean_t killit; REQUIRE(entp != NULL && VALID_ENTROPY(*entp)); ent = *entp; *entp = NULL; LOCK(&ent->lock); REQUIRE(ent->refcnt > 0); ent->refcnt--; killit = destroy_check(ent); UNLOCK(&ent->lock); if (killit) destroy(&ent); } static isc_result_t kbdstart(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) { /* * The intent of "first" is to provide a warning message only once * during the run of a program that might try to gather keyboard * entropy multiple times. */ static isc_boolean_t first = ISC_TRUE; UNUSED(arg); if (! blocking) return (ISC_R_NOENTROPY); if (first) { if (source->warn_keyboard) fprintf(stderr, "You must use the keyboard to create " "entropy, since your system is lacking\n" "/dev/random (or equivalent)\n\n"); first = ISC_FALSE; } fprintf(stderr, "start typing:\n"); return (isc_keyboard_open(&source->kbd)); } static void kbdstop(isc_entropysource_t *source, void *arg) { UNUSED(arg); if (! isc_keyboard_canceled(&source->kbd)) fprintf(stderr, "stop typing.\r\n"); (void)isc_keyboard_close(&source->kbd, 3); } static isc_result_t kbdget(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) { isc_result_t result; isc_time_t t; isc_uint32_t sample; isc_uint32_t extra; unsigned char c; UNUSED(arg); if (!blocking) return (ISC_R_NOTBLOCKING); result = isc_keyboard_getchar(&source->kbd, &c); if (result != ISC_R_SUCCESS) return (result); TIME_NOW(&t); sample = isc_time_nanoseconds(&t); extra = c; result = isc_entropy_addcallbacksample(source, sample, extra); if (result != ISC_R_SUCCESS) { fprintf(stderr, "\r\n"); return (result); } fprintf(stderr, "."); fflush(stderr); return (result); } isc_result_t isc_entropy_usebestsource(isc_entropy_t *ectx, isc_entropysource_t **source, const char *randomfile, int use_keyboard) { isc_result_t result; isc_result_t final_result = ISC_R_NOENTROPY; isc_boolean_t userfile = ISC_TRUE; REQUIRE(VALID_ENTROPY(ectx)); REQUIRE(source != NULL && *source == NULL); REQUIRE(use_keyboard == ISC_ENTROPY_KEYBOARDYES || use_keyboard == ISC_ENTROPY_KEYBOARDNO || use_keyboard == ISC_ENTROPY_KEYBOARDMAYBE); #ifdef PATH_RANDOMDEV if (randomfile == NULL) { randomfile = PATH_RANDOMDEV; userfile = ISC_FALSE; } #endif if (randomfile != NULL && use_keyboard != ISC_ENTROPY_KEYBOARDYES) { result = isc_entropy_createfilesource(ectx, randomfile); if (result == ISC_R_SUCCESS && use_keyboard == ISC_ENTROPY_KEYBOARDMAYBE) use_keyboard = ISC_ENTROPY_KEYBOARDNO; if (result != ISC_R_SUCCESS && userfile) return (result); final_result = result; } if (use_keyboard != ISC_ENTROPY_KEYBOARDNO) { result = isc_entropy_createcallbacksource(ectx, kbdstart, kbdget, kbdstop, NULL, source); if (result == ISC_R_SUCCESS) (*source)->warn_keyboard = ISC_TF(use_keyboard == ISC_ENTROPY_KEYBOARDMAYBE); if (final_result != ISC_R_SUCCESS) final_result = result; } /* * final_result is ISC_R_SUCCESS if at least one source of entropy * could be started, otherwise it is the error from the most recently * failed operation (or ISC_R_NOENTROPY if PATH_RANDOMDEV is not * defined and use_keyboard is ISC_ENTROPY_KEYBOARDNO). */ return (final_result); } ntp-4.2.6p5/lib/isc/quota.c0000644000175000017500000000457711307651603014451 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: quota.c,v 1.18 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include isc_result_t isc_quota_init(isc_quota_t *quota, int max) { quota->max = max; quota->used = 0; quota->soft = 0; return (isc_mutex_init("a->lock)); } void isc_quota_destroy(isc_quota_t *quota) { INSIST(quota->used == 0); quota->max = 0; quota->used = 0; quota->soft = 0; DESTROYLOCK("a->lock); } void isc_quota_soft(isc_quota_t *quota, int soft) { LOCK("a->lock); quota->soft = soft; UNLOCK("a->lock); } void isc_quota_max(isc_quota_t *quota, int max) { LOCK("a->lock); quota->max = max; UNLOCK("a->lock); } isc_result_t isc_quota_reserve(isc_quota_t *quota) { isc_result_t result; LOCK("a->lock); if (quota->max == 0 || quota->used < quota->max) { if (quota->soft == 0 || quota->used < quota->soft) result = ISC_R_SUCCESS; else result = ISC_R_SOFTQUOTA; quota->used++; } else result = ISC_R_QUOTA; UNLOCK("a->lock); return (result); } void isc_quota_release(isc_quota_t *quota) { LOCK("a->lock); INSIST(quota->used > 0); quota->used--; UNLOCK("a->lock); } isc_result_t isc_quota_attach(isc_quota_t *quota, isc_quota_t **p) { isc_result_t result; INSIST(p != NULL && *p == NULL); result = isc_quota_reserve(quota); if (result == ISC_R_SUCCESS || result == ISC_R_SOFTQUOTA) *p = quota; return (result); } void isc_quota_detach(isc_quota_t **p) { INSIST(p != NULL && *p != NULL); isc_quota_release(*p); *p = NULL; } ntp-4.2.6p5/lib/isc/unix/0000755000175000017500000000000011675461367014140 5ustar peterpeterntp-4.2.6p5/lib/isc/unix/app.c0000644000175000017500000004011511307651604015050 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: app.c,v 1.60 2008/10/15 03:41:17 marka Exp $ */ /*! \file */ #include #include /* Openserver 5.0.6A and FD_SETSIZE */ #include #include #include #include #include #include #include #ifdef HAVE_EPOLL #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #ifdef ISC_PLATFORM_USETHREADS #include #else /* ISC_PLATFORM_USETHREADS */ #include "../timer_p.h" #include "../task_p.h" #include "socket_p.h" #endif /* ISC_PLATFORM_USETHREADS */ static isc_eventlist_t on_run; static isc_mutex_t lock; static isc_boolean_t shutdown_requested = ISC_FALSE; static isc_boolean_t running = ISC_FALSE; /*! * We assume that 'want_shutdown' can be read and written atomically. */ static volatile isc_boolean_t want_shutdown = ISC_FALSE; /* * We assume that 'want_reload' can be read and written atomically. */ static volatile isc_boolean_t want_reload = ISC_FALSE; static isc_boolean_t blocked = ISC_FALSE; #ifdef ISC_PLATFORM_USETHREADS static pthread_t blockedthread; #endif /* ISC_PLATFORM_USETHREADS */ #ifdef HAVE_LINUXTHREADS /*! * Linux has sigwait(), but it appears to prevent signal handlers from * running, even if they're not in the set being waited for. This makes * it impossible to get the default actions for SIGILL, SIGSEGV, etc. * Instead of messing with it, we just use sigsuspend() instead. */ #undef HAVE_SIGWAIT /*! * We need to remember which thread is the main thread... */ static pthread_t main_thread; #endif #ifndef HAVE_SIGWAIT static void exit_action(int arg) { UNUSED(arg); want_shutdown = ISC_TRUE; } static void reload_action(int arg) { UNUSED(arg); want_reload = ISC_TRUE; } #endif static isc_result_t handle_signal(int sig, void (*handler)(int)) { struct sigaction sa; char strbuf[ISC_STRERRORSIZE]; memset(&sa, 0, sizeof(sa)); sa.sa_handler = handler; if (sigfillset(&sa.sa_mask) != 0 || sigaction(sig, &sa, NULL) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_APP, ISC_MSG_SIGNALSETUP, "handle_signal() %d setup: %s"), sig, strbuf); return (ISC_R_UNEXPECTED); } return (ISC_R_SUCCESS); } isc_result_t isc_app_start(void) { isc_result_t result; int presult; sigset_t sset; char strbuf[ISC_STRERRORSIZE]; /* * Start an ISC library application. */ #ifdef NEED_PTHREAD_INIT /* * BSDI 3.1 seg faults in pthread_sigmask() if we don't do this. */ presult = pthread_init(); if (presult != 0) { isc__strerror(presult, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_app_start() pthread_init: %s", strbuf); return (ISC_R_UNEXPECTED); } #endif #ifdef HAVE_LINUXTHREADS main_thread = pthread_self(); #endif result = isc_mutex_init(&lock); if (result != ISC_R_SUCCESS) return (result); #ifndef HAVE_SIGWAIT /* * Install do-nothing handlers for SIGINT and SIGTERM. * * We install them now because BSDI 3.1 won't block * the default actions, regardless of what we do with * pthread_sigmask(). */ result = handle_signal(SIGINT, exit_action); if (result != ISC_R_SUCCESS) return (result); result = handle_signal(SIGTERM, exit_action); if (result != ISC_R_SUCCESS) return (result); #endif /* * Always ignore SIGPIPE. */ result = handle_signal(SIGPIPE, SIG_IGN); if (result != ISC_R_SUCCESS) return (result); /* * On Solaris 2, delivery of a signal whose action is SIG_IGN * will not cause sigwait() to return. We may have inherited * unexpected actions for SIGHUP, SIGINT, and SIGTERM from our parent * process (e.g, Solaris cron). Set an action of SIG_DFL to make * sure sigwait() works as expected. Only do this for SIGTERM and * SIGINT if we don't have sigwait(), since a different handler is * installed above. */ result = handle_signal(SIGHUP, SIG_DFL); if (result != ISC_R_SUCCESS) return (result); #ifdef HAVE_SIGWAIT result = handle_signal(SIGTERM, SIG_DFL); if (result != ISC_R_SUCCESS) return (result); result = handle_signal(SIGINT, SIG_DFL); if (result != ISC_R_SUCCESS) return (result); #endif #ifdef ISC_PLATFORM_USETHREADS /* * Block SIGHUP, SIGINT, SIGTERM. * * If isc_app_start() is called from the main thread before any other * threads have been created, then the pthread_sigmask() call below * will result in all threads having SIGHUP, SIGINT and SIGTERM * blocked by default, ensuring that only the thread that calls * sigwait() for them will get those signals. */ if (sigemptyset(&sset) != 0 || sigaddset(&sset, SIGHUP) != 0 || sigaddset(&sset, SIGINT) != 0 || sigaddset(&sset, SIGTERM) != 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_app_start() sigsetops: %s", strbuf); return (ISC_R_UNEXPECTED); } presult = pthread_sigmask(SIG_BLOCK, &sset, NULL); if (presult != 0) { isc__strerror(presult, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_app_start() pthread_sigmask: %s", strbuf); return (ISC_R_UNEXPECTED); } #else /* ISC_PLATFORM_USETHREADS */ /* * Unblock SIGHUP, SIGINT, SIGTERM. * * If we're not using threads, we need to make sure that SIGHUP, * SIGINT and SIGTERM are not inherited as blocked from the parent * process. */ if (sigemptyset(&sset) != 0 || sigaddset(&sset, SIGHUP) != 0 || sigaddset(&sset, SIGINT) != 0 || sigaddset(&sset, SIGTERM) != 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_app_start() sigsetops: %s", strbuf); return (ISC_R_UNEXPECTED); } presult = sigprocmask(SIG_UNBLOCK, &sset, NULL); if (presult != 0) { isc__strerror(presult, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_app_start() sigprocmask: %s", strbuf); return (ISC_R_UNEXPECTED); } #endif /* ISC_PLATFORM_USETHREADS */ ISC_LIST_INIT(on_run); return (ISC_R_SUCCESS); } isc_result_t isc_app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action, void *arg) { isc_event_t *event; isc_task_t *cloned_task = NULL; isc_result_t result; LOCK(&lock); if (running) { result = ISC_R_ALREADYRUNNING; goto unlock; } /* * Note that we store the task to which we're going to send the event * in the event's "sender" field. */ isc_task_attach(task, &cloned_task); event = isc_event_allocate(mctx, cloned_task, ISC_APPEVENT_SHUTDOWN, action, arg, sizeof(*event)); if (event == NULL) { result = ISC_R_NOMEMORY; goto unlock; } ISC_LIST_APPEND(on_run, event, ev_link); result = ISC_R_SUCCESS; unlock: UNLOCK(&lock); return (result); } #ifndef ISC_PLATFORM_USETHREADS /*! * Event loop for nonthreaded programs. */ static isc_result_t evloop(void) { isc_result_t result; while (!want_shutdown) { int n; isc_time_t when, now; struct timeval tv, *tvp; isc_socketwait_t *swait; isc_boolean_t readytasks; isc_boolean_t call_timer_dispatch = ISC_FALSE; readytasks = isc__taskmgr_ready(); if (readytasks) { tv.tv_sec = 0; tv.tv_usec = 0; tvp = &tv; call_timer_dispatch = ISC_TRUE; } else { result = isc__timermgr_nextevent(&when); if (result != ISC_R_SUCCESS) tvp = NULL; else { isc_uint64_t us; TIME_NOW(&now); us = isc_time_microdiff(&when, &now); if (us == 0) call_timer_dispatch = ISC_TRUE; tv.tv_sec = us / 1000000; tv.tv_usec = us % 1000000; tvp = &tv; } } swait = NULL; n = isc__socketmgr_waitevents(tvp, &swait); if (n == 0 || call_timer_dispatch) { /* * We call isc__timermgr_dispatch() only when * necessary, in order to reduce overhead. If the * select() call indicates a timeout, we need the * dispatch. Even if not, if we set the 0-timeout * for the select() call, we need to check the timer * events. In the 'readytasks' case, there may be no * timeout event actually, but there is no other way * to reduce the overhead. * Note that we do not have to worry about the case * where a new timer is inserted during the select() * call, since this loop only runs in the non-thread * mode. */ isc__timermgr_dispatch(); } if (n > 0) (void)isc__socketmgr_dispatch(swait); (void)isc__taskmgr_dispatch(); if (want_reload) { want_reload = ISC_FALSE; return (ISC_R_RELOAD); } } return (ISC_R_SUCCESS); } /* * This is a gross hack to support waiting for condition * variables in nonthreaded programs in a limited way; * see lib/isc/nothreads/include/isc/condition.h. * We implement isc_condition_wait() by entering the * event loop recursively until the want_shutdown flag * is set by isc_condition_signal(). */ /*! * \brief True if we are currently executing in the recursive * event loop. */ static isc_boolean_t in_recursive_evloop = ISC_FALSE; /*! * \brief True if we are exiting the event loop as the result of * a call to isc_condition_signal() rather than a shutdown * or reload. */ static isc_boolean_t signalled = ISC_FALSE; isc_result_t isc__nothread_wait_hack(isc_condition_t *cp, isc_mutex_t *mp) { isc_result_t result; UNUSED(cp); UNUSED(mp); INSIST(!in_recursive_evloop); in_recursive_evloop = ISC_TRUE; INSIST(*mp == 1); /* Mutex must be locked on entry. */ --*mp; result = evloop(); if (result == ISC_R_RELOAD) want_reload = ISC_TRUE; if (signalled) { want_shutdown = ISC_FALSE; signalled = ISC_FALSE; } ++*mp; in_recursive_evloop = ISC_FALSE; return (ISC_R_SUCCESS); } isc_result_t isc__nothread_signal_hack(isc_condition_t *cp) { UNUSED(cp); INSIST(in_recursive_evloop); want_shutdown = ISC_TRUE; signalled = ISC_TRUE; return (ISC_R_SUCCESS); } #endif /* ISC_PLATFORM_USETHREADS */ isc_result_t isc_app_run(void) { int result; isc_event_t *event, *next_event; isc_task_t *task; #ifdef ISC_PLATFORM_USETHREADS sigset_t sset; char strbuf[ISC_STRERRORSIZE]; #ifdef HAVE_SIGWAIT int sig; #endif #endif /* ISC_PLATFORM_USETHREADS */ #ifdef HAVE_LINUXTHREADS REQUIRE(main_thread == pthread_self()); #endif LOCK(&lock); if (!running) { running = ISC_TRUE; /* * Post any on-run events (in FIFO order). */ for (event = ISC_LIST_HEAD(on_run); event != NULL; event = next_event) { next_event = ISC_LIST_NEXT(event, ev_link); ISC_LIST_UNLINK(on_run, event, ev_link); task = event->ev_sender; event->ev_sender = NULL; isc_task_sendanddetach(&task, &event); } } UNLOCK(&lock); #ifndef HAVE_SIGWAIT /* * Catch SIGHUP. * * We do this here to ensure that the signal handler is installed * (i.e. that it wasn't a "one-shot" handler). */ result = handle_signal(SIGHUP, reload_action); if (result != ISC_R_SUCCESS) return (ISC_R_SUCCESS); #endif #ifdef ISC_PLATFORM_USETHREADS /* * There is no danger if isc_app_shutdown() is called before we wait * for signals. Signals are blocked, so any such signal will simply * be made pending and we will get it when we call sigwait(). */ while (!want_shutdown) { #ifdef HAVE_SIGWAIT /* * Wait for SIGHUP, SIGINT, or SIGTERM. */ if (sigemptyset(&sset) != 0 || sigaddset(&sset, SIGHUP) != 0 || sigaddset(&sset, SIGINT) != 0 || sigaddset(&sset, SIGTERM) != 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_app_run() sigsetops: %s", strbuf); return (ISC_R_UNEXPECTED); } #ifndef HAVE_UNIXWARE_SIGWAIT result = sigwait(&sset, &sig); if (result == 0) { if (sig == SIGINT || sig == SIGTERM) want_shutdown = ISC_TRUE; else if (sig == SIGHUP) want_reload = ISC_TRUE; } #else /* Using UnixWare sigwait semantics. */ sig = sigwait(&sset); if (sig >= 0) { if (sig == SIGINT || sig == SIGTERM) want_shutdown = ISC_TRUE; else if (sig == SIGHUP) want_reload = ISC_TRUE; } #endif /* HAVE_UNIXWARE_SIGWAIT */ #else /* Don't have sigwait(). */ /* * Listen for all signals. */ if (sigemptyset(&sset) != 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_app_run() sigsetops: %s", strbuf); return (ISC_R_UNEXPECTED); } result = sigsuspend(&sset); #endif /* HAVE_SIGWAIT */ if (want_reload) { want_reload = ISC_FALSE; return (ISC_R_RELOAD); } if (want_shutdown && blocked) exit(1); } #else /* ISC_PLATFORM_USETHREADS */ (void)isc__taskmgr_dispatch(); result = evloop(); if (result != ISC_R_SUCCESS) return (result); #endif /* ISC_PLATFORM_USETHREADS */ return (ISC_R_SUCCESS); } isc_result_t isc_app_shutdown(void) { isc_boolean_t want_kill = ISC_TRUE; char strbuf[ISC_STRERRORSIZE]; LOCK(&lock); REQUIRE(running); if (shutdown_requested) want_kill = ISC_FALSE; else shutdown_requested = ISC_TRUE; UNLOCK(&lock); if (want_kill) { #ifdef HAVE_LINUXTHREADS int result; result = pthread_kill(main_thread, SIGTERM); if (result != 0) { isc__strerror(result, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_app_shutdown() pthread_kill: %s", strbuf); return (ISC_R_UNEXPECTED); } #else if (kill(getpid(), SIGTERM) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_app_shutdown() kill: %s", strbuf); return (ISC_R_UNEXPECTED); } #endif } return (ISC_R_SUCCESS); } isc_result_t isc_app_reload(void) { isc_boolean_t want_kill = ISC_TRUE; char strbuf[ISC_STRERRORSIZE]; LOCK(&lock); REQUIRE(running); /* * Don't send the reload signal if we're shutting down. */ if (shutdown_requested) want_kill = ISC_FALSE; UNLOCK(&lock); if (want_kill) { #ifdef HAVE_LINUXTHREADS int result; result = pthread_kill(main_thread, SIGHUP); if (result != 0) { isc__strerror(result, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_app_reload() pthread_kill: %s", strbuf); return (ISC_R_UNEXPECTED); } #else if (kill(getpid(), SIGHUP) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_app_reload() kill: %s", strbuf); return (ISC_R_UNEXPECTED); } #endif } return (ISC_R_SUCCESS); } void isc_app_finish(void) { DESTROYLOCK(&lock); } void isc_app_block(void) { #ifdef ISC_PLATFORM_USETHREADS sigset_t sset; #endif /* ISC_PLATFORM_USETHREADS */ REQUIRE(running); REQUIRE(!blocked); blocked = ISC_TRUE; #ifdef ISC_PLATFORM_USETHREADS blockedthread = pthread_self(); RUNTIME_CHECK(sigemptyset(&sset) == 0 && sigaddset(&sset, SIGINT) == 0 && sigaddset(&sset, SIGTERM) == 0); RUNTIME_CHECK(pthread_sigmask(SIG_UNBLOCK, &sset, NULL) == 0); #endif /* ISC_PLATFORM_USETHREADS */ } void isc_app_unblock(void) { #ifdef ISC_PLATFORM_USETHREADS sigset_t sset; #endif /* ISC_PLATFORM_USETHREADS */ REQUIRE(running); REQUIRE(blocked); blocked = ISC_FALSE; #ifdef ISC_PLATFORM_USETHREADS REQUIRE(blockedthread == pthread_self()); RUNTIME_CHECK(sigemptyset(&sset) == 0 && sigaddset(&sset, SIGINT) == 0 && sigaddset(&sset, SIGTERM) == 0); RUNTIME_CHECK(pthread_sigmask(SIG_BLOCK, &sset, NULL) == 0); #endif /* ISC_PLATFORM_USETHREADS */ } ntp-4.2.6p5/lib/isc/unix/dir.c0000644000175000017500000001204611307651605015051 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: dir.c,v 1.25.332.3 2009/02/16 23:47:15 tbox Exp $ */ /*! \file * \author Principal Authors: DCL */ #include #include #include #include #include #include #include #include #include #include #include "errno2result.h" #define ISC_DIR_MAGIC ISC_MAGIC('D', 'I', 'R', '*') #define VALID_DIR(dir) ISC_MAGIC_VALID(dir, ISC_DIR_MAGIC) void isc_dir_init(isc_dir_t *dir) { REQUIRE(dir != NULL); dir->entry.name[0] = '\0'; dir->entry.length = 0; dir->handle = NULL; dir->magic = ISC_DIR_MAGIC; } /*! * \brief Allocate workspace and open directory stream. If either one fails, * NULL will be returned. */ isc_result_t isc_dir_open(isc_dir_t *dir, const char *dirname) { char *p; isc_result_t result = ISC_R_SUCCESS; REQUIRE(VALID_DIR(dir)); REQUIRE(dirname != NULL); /* * Copy directory name. Need to have enough space for the name, * a possible path separator, the wildcard, and the final NUL. */ if (strlen(dirname) + 3 > sizeof(dir->dirname)) /* XXXDCL ? */ return (ISC_R_NOSPACE); strcpy(dir->dirname, dirname); /* * Append path separator, if needed, and "*". */ p = dir->dirname + strlen(dir->dirname); if (dir->dirname < p && *(p - 1) != '/') *p++ = '/'; *p++ = '*'; *p++ = '\0'; /* * Open stream. */ dir->handle = opendir(dirname); if (dir->handle == NULL) return isc__errno2result(errno); return (result); } /*! * \brief Return previously retrieved file or get next one. * Unix's dirent has * separate open and read functions, but the Win32 and DOS interfaces open * the dir stream and reads the first file in one operation. */ isc_result_t isc_dir_read(isc_dir_t *dir) { struct dirent *entry; REQUIRE(VALID_DIR(dir) && dir->handle != NULL); /* * Fetch next file in directory. */ entry = readdir(dir->handle); if (entry == NULL) return (ISC_R_NOMORE); /* * Make sure that the space for the name is long enough. */ if (sizeof(dir->entry.name) <= strlen(entry->d_name)) return (ISC_R_UNEXPECTED); strcpy(dir->entry.name, entry->d_name); /* * Some dirents have d_namlen, but it is not portable. */ dir->entry.length = strlen(entry->d_name); return (ISC_R_SUCCESS); } /*! * \brief Close directory stream. */ void isc_dir_close(isc_dir_t *dir) { REQUIRE(VALID_DIR(dir) && dir->handle != NULL); (void)closedir(dir->handle); dir->handle = NULL; } /*! * \brief Reposition directory stream at start. */ isc_result_t isc_dir_reset(isc_dir_t *dir) { REQUIRE(VALID_DIR(dir) && dir->handle != NULL); rewinddir(dir->handle); return (ISC_R_SUCCESS); } isc_result_t isc_dir_chdir(const char *dirname) { /*! * \brief Change the current directory to 'dirname'. */ REQUIRE(dirname != NULL); if (chdir(dirname) < 0) return (isc__errno2result(errno)); return (ISC_R_SUCCESS); } isc_result_t isc_dir_chroot(const char *dirname) { REQUIRE(dirname != NULL); #ifdef HAVE_CHROOT if (chroot(dirname) < 0 || chdir("/") < 0) return (isc__errno2result(errno)); return (ISC_R_SUCCESS); #else return (ISC_R_NOTIMPLEMENTED); #endif } isc_result_t isc_dir_createunique(char *templet) { isc_result_t result; char *x; char *p; int i; int pid; REQUIRE(templet != NULL); /*! * \brief mkdtemp is not portable, so this emulates it. */ pid = getpid(); /* * Replace trailing Xs with the process-id, zero-filled. */ for (x = templet + strlen(templet) - 1; *x == 'X' && x >= templet; x--, pid /= 10) *x = pid % 10 + '0'; x++; /* Set x to start of ex-Xs. */ do { i = mkdir(templet, 0700); if (i == 0 || errno != EEXIST) break; /* * The BSD algorithm. */ p = x; while (*p != '\0') { if (isdigit(*p & 0xff)) *p = 'a'; else if (*p != 'z') ++*p; else { /* * Reset character and move to next. */ *p++ = 'a'; continue; } break; } if (*p == '\0') { /* * Tried all combinations. errno should already * be EEXIST, but ensure it is anyway for * isc__errno2result(). */ errno = EEXIST; break; } } while (1); if (i == -1) result = isc__errno2result(errno); else result = ISC_R_SUCCESS; return (result); } ntp-4.2.6p5/lib/isc/unix/ifiter_sysctl.c0000644000175000017500000002025111505336023017145 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ifiter_sysctl.c,v 1.25 2007/06/19 23:47:18 tbox Exp $ */ /*! \file * \brief * Obtain the list of network interfaces using sysctl. * See TCP/IP Illustrated Volume 2, sections 19.8, 19.14, * and 19.16. */ #include #include #include #include /* XXX what about Alpha? */ #ifdef sgi #define ROUNDUP(a) ((a) > 0 ? \ (1 + (((a) - 1) | (sizeof(__uint64_t) - 1))) : \ sizeof(__uint64_t)) #else #define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) \ : sizeof(long)) #endif #define IFITER_MAGIC ISC_MAGIC('I', 'F', 'I', 'S') #define VALID_IFITER(t) ISC_MAGIC_VALID(t, IFITER_MAGIC) struct isc_interfaceiter { unsigned int magic; /* Magic number. */ isc_mem_t *mctx; void *buf; /* Buffer for sysctl data. */ unsigned int bufsize; /* Bytes allocated. */ unsigned int bufused; /* Bytes used. */ unsigned int pos; /* Current offset in sysctl data. */ isc_interface_t current; /* Current interface data. */ isc_result_t result; /* Last result code. */ }; static int mib[6] = { CTL_NET, PF_ROUTE, 0, 0, /* Any address family. */ NET_RT_IFLIST, 0 /* Flags. */ }; isc_result_t isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) { isc_interfaceiter_t *iter; isc_result_t result; size_t bufsize; size_t bufused; char strbuf[ISC_STRERRORSIZE]; REQUIRE(mctx != NULL); REQUIRE(iterp != NULL); REQUIRE(*iterp == NULL); iter = isc_mem_get(mctx, sizeof(*iter)); if (iter == NULL) return (ISC_R_NOMEMORY); iter->mctx = mctx; iter->buf = 0; /* * Determine the amount of memory needed. */ bufsize = 0; if (sysctl(mib, 6, NULL, &bufsize, NULL, (size_t) 0) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERSYSCTL, ISC_MSG_GETIFLISTSIZE, "getting interface " "list size: sysctl: %s"), strbuf); result = ISC_R_UNEXPECTED; goto failure; } iter->bufsize = bufsize; iter->buf = isc_mem_get(iter->mctx, iter->bufsize); if (iter->buf == NULL) { result = ISC_R_NOMEMORY; goto failure; } bufused = bufsize; if (sysctl(mib, 6, iter->buf, &bufused, NULL, (size_t) 0) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERSYSCTL, ISC_MSG_GETIFLIST, "getting interface list: " "sysctl: %s"), strbuf); result = ISC_R_UNEXPECTED; goto failure; } iter->bufused = bufused; INSIST(iter->bufused <= iter->bufsize); /* * A newly created iterator has an undefined position * until isc_interfaceiter_first() is called. */ iter->pos = (unsigned int) -1; iter->result = ISC_R_FAILURE; iter->magic = IFITER_MAGIC; *iterp = iter; return (ISC_R_SUCCESS); failure: if (iter->buf != NULL) isc_mem_put(mctx, iter->buf, iter->bufsize); isc_mem_put(mctx, iter, sizeof(*iter)); return (result); } /* * Get information about the current interface to iter->current. * If successful, return ISC_R_SUCCESS. * If the interface has an unsupported address family, * return ISC_R_IGNORE. In case of other failure, * return ISC_R_UNEXPECTED. */ static isc_result_t internal_current(isc_interfaceiter_t *iter) { struct ifa_msghdr *ifam, *ifam_end; REQUIRE(VALID_IFITER(iter)); REQUIRE (iter->pos < (unsigned int) iter->bufused); ifam = (struct ifa_msghdr *) ((char *) iter->buf + iter->pos); ifam_end = (struct ifa_msghdr *) ((char *) iter->buf + iter->bufused); if (ifam->ifam_type == RTM_IFINFO) { struct if_msghdr *ifm = (struct if_msghdr *) ifam; struct sockaddr_dl *sdl = (struct sockaddr_dl *) (ifm + 1); unsigned int namelen; memset(&iter->current, 0, sizeof(iter->current)); iter->current.ifindex = sdl->sdl_index; namelen = sdl->sdl_nlen; if (namelen > sizeof(iter->current.name) - 1) namelen = sizeof(iter->current.name) - 1; memset(iter->current.name, 0, sizeof(iter->current.name)); memcpy(iter->current.name, sdl->sdl_data, namelen); iter->current.flags = 0; if ((ifam->ifam_flags & IFF_UP) != 0) iter->current.flags |= INTERFACE_F_UP; if ((ifam->ifam_flags & IFF_POINTOPOINT) != 0) iter->current.flags |= INTERFACE_F_POINTTOPOINT; if ((ifam->ifam_flags & IFF_LOOPBACK) != 0) iter->current.flags |= INTERFACE_F_LOOPBACK; if ((ifam->ifam_flags & IFF_BROADCAST) != 0) iter->current.flags |= INTERFACE_F_BROADCAST; #ifdef IFF_MULTICAST if ((ifam->ifam_flags & IFF_MULTICAST) != 0) iter->current.flags |= INTERFACE_F_MULTICAST; #endif /* * This is not an interface address. * Force another iteration. */ return (ISC_R_IGNORE); } else if (ifam->ifam_type == RTM_NEWADDR) { int i; int family; struct sockaddr *mask_sa = NULL; struct sockaddr *addr_sa = NULL; struct sockaddr *dst_sa = NULL; struct sockaddr *sa = (struct sockaddr *)(ifam + 1); family = sa->sa_family; for (i = 0; i < RTAX_MAX; i++) { if ((ifam->ifam_addrs & (1 << i)) == 0) continue; INSIST(sa < (struct sockaddr *) ifam_end); switch (i) { case RTAX_NETMASK: /* Netmask */ mask_sa = sa; break; case RTAX_IFA: /* Interface address */ addr_sa = sa; break; case RTAX_BRD: /* Broadcast or destination address */ dst_sa = sa; break; } #ifdef ISC_PLATFORM_HAVESALEN sa = (struct sockaddr *)((char*)(sa) + ROUNDUP(sa->sa_len)); #else #ifdef sgi /* * Do as the contributed SGI code does. */ sa = (struct sockaddr *)((char*)(sa) + ROUNDUP(_FAKE_SA_LEN_DST(sa))); #else /* XXX untested. */ sa = (struct sockaddr *)((char*)(sa) + ROUNDUP(sizeof(struct sockaddr))); #endif #endif } if (addr_sa == NULL) return (ISC_R_IGNORE); family = addr_sa->sa_family; if (family != AF_INET && family != AF_INET6) return (ISC_R_IGNORE); iter->current.af = family; get_addr(family, &iter->current.address, addr_sa, iter->current.name); if (mask_sa != NULL) get_addr(family, &iter->current.netmask, mask_sa, iter->current.name); if (dst_sa != NULL && (iter->current.flags & INTERFACE_F_POINTTOPOINT) != 0) get_addr(family, &iter->current.dstaddress, dst_sa, iter->current.name); if (dst_sa != NULL && (iter->current.flags & INTERFACE_F_BROADCAST) != 0) get_addr(family, &iter->current.broadcast, dst_sa, iter->current.name); return (ISC_R_SUCCESS); } else { printf(isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERSYSCTL, ISC_MSG_UNEXPECTEDTYPE, "warning: unexpected interface list " "message type\n")); return (ISC_R_IGNORE); } } /* * Step the iterator to the next interface. Unlike * isc_interfaceiter_next(), this may leave the iterator * positioned on an interface that will ultimately * be ignored. Return ISC_R_NOMORE if there are no more * interfaces, otherwise ISC_R_SUCCESS. */ static isc_result_t internal_next(isc_interfaceiter_t *iter) { struct ifa_msghdr *ifam; REQUIRE (iter->pos < (unsigned int) iter->bufused); ifam = (struct ifa_msghdr *) ((char *) iter->buf + iter->pos); iter->pos += ifam->ifam_msglen; if (iter->pos >= iter->bufused) return (ISC_R_NOMORE); return (ISC_R_SUCCESS); } static void internal_destroy(isc_interfaceiter_t *iter) { UNUSED(iter); /* Unused. */ /* * Do nothing. */ } static void internal_first(isc_interfaceiter_t *iter) { iter->pos = 0; } ntp-4.2.6p5/lib/isc/unix/socket_p.h0000644000175000017500000000235611307651603016110 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: socket_p.h,v 1.13 2008/06/23 23:47:11 tbox Exp $ */ #ifndef ISC_SOCKET_P_H #define ISC_SOCKET_P_H /*! \file */ #ifdef ISC_PLATFORM_NEEDSYSSELECTH #include #endif typedef struct isc_socketwait isc_socketwait_t; int isc__socketmgr_waitevents(struct timeval *, isc_socketwait_t **); isc_result_t isc__socketmgr_dispatch(isc_socketwait_t *); #endif /* ISC_SOCKET_P_H */ ntp-4.2.6p5/lib/isc/unix/errno2result.h0000644000175000017500000000240611307651604016744 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: errno2result.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */ #ifndef UNIX_ERRNO2RESULT_H #define UNIX_ERRNO2RESULT_H 1 /*! \file */ /* XXXDCL this should be moved to lib/isc/include/isc/errno2result.h. */ #include /* Provides errno. */ #include #include ISC_LANG_BEGINDECLS isc_result_t isc__errno2result(int posixerrno); ISC_LANG_ENDDECLS #endif /* UNIX_ERRNO2RESULT_H */ ntp-4.2.6p5/lib/isc/unix/os.c0000644000175000017500000000421011307651604014705 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: os.c,v 1.18 2007/06/19 23:47:18 tbox Exp $ */ #include #include #ifdef HAVE_SYSCONF #include #ifndef __hpux static inline long sysconf_ncpus(void) { #if defined(_SC_NPROCESSORS_ONLN) return sysconf((_SC_NPROCESSORS_ONLN)); #elif defined(_SC_NPROC_ONLN) return sysconf((_SC_NPROC_ONLN)); #else return (0); #endif } #endif #endif /* HAVE_SYSCONF */ #ifdef __hpux #include static inline int hpux_ncpus(void) { struct pst_dynamic psd; if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) != -1) return (psd.psd_proc_cnt); else return (0); } #endif /* __hpux */ #if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTLBYNAME) #include /* for FreeBSD */ #include /* for NetBSD */ #include static int sysctl_ncpus(void) { int ncpu, result; size_t len; len = sizeof(ncpu); result = sysctlbyname("hw.ncpu", &ncpu, &len , 0, 0); if (result != -1) return (ncpu); return (0); } #endif unsigned int isc_os_ncpus(void) { long ncpus = 0; #ifdef __hpux ncpus = hpux_ncpus(); #elif defined(HAVE_SYSCONF) ncpus = sysconf_ncpus(); #endif #if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTLBYNAME) if (ncpus <= 0) ncpus = sysctl_ncpus(); #endif if (ncpus <= 0) ncpus = 1; return ((unsigned int)ncpus); } ntp-4.2.6p5/lib/isc/unix/net.c0000644000175000017500000003015711505336022015055 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: net.c,v 1.40 2008/07/04 05:52:31 each Exp $ */ #include #include #if defined(HAVE_SYS_SYSCTL_H) #if defined(HAVE_SYS_PARAM_H) #include #endif #include #endif #include #include #include #include #include #include #include #include #include /*% * Definitions about UDP port range specification. This is a total mess of * portability variants: some use sysctl (but the sysctl names vary), some use * system-specific interfaces, some have the same interface for IPv4 and IPv6, * some separate them, etc... */ /*% * The last resort defaults: use all non well known port space */ #ifndef ISC_NET_PORTRANGELOW #define ISC_NET_PORTRANGELOW 1024 #endif /* ISC_NET_PORTRANGELOW */ #ifndef ISC_NET_PORTRANGEHIGH #define ISC_NET_PORTRANGEHIGH 65535 #endif /* ISC_NET_PORTRANGEHIGH */ #ifdef HAVE_SYSCTLBYNAME /*% * sysctl variants */ #if defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__) #define USE_SYSCTL_PORTRANGE #define SYSCTL_V4PORTRANGE_LOW "net.inet.ip.portrange.hifirst" #define SYSCTL_V4PORTRANGE_HIGH "net.inet.ip.portrange.hilast" #define SYSCTL_V6PORTRANGE_LOW "net.inet.ip.portrange.hifirst" #define SYSCTL_V6PORTRANGE_HIGH "net.inet.ip.portrange.hilast" #endif #ifdef __NetBSD__ #define USE_SYSCTL_PORTRANGE #define SYSCTL_V4PORTRANGE_LOW "net.inet.ip.anonportmin" #define SYSCTL_V4PORTRANGE_HIGH "net.inet.ip.anonportmax" #define SYSCTL_V6PORTRANGE_LOW "net.inet6.ip6.anonportmin" #define SYSCTL_V6PORTRANGE_HIGH "net.inet6.ip6.anonportmax" #endif #else /* !HAVE_SYSCTLBYNAME */ #ifdef __OpenBSD__ #define USE_SYSCTL_PORTRANGE #define SYSCTL_V4PORTRANGE_LOW { CTL_NET, PF_INET, IPPROTO_IP, \ IPCTL_IPPORT_HIFIRSTAUTO } #define SYSCTL_V4PORTRANGE_HIGH { CTL_NET, PF_INET, IPPROTO_IP, \ IPCTL_IPPORT_HILASTAUTO } /* Same for IPv6 */ #define SYSCTL_V6PORTRANGE_LOW SYSCTL_V4PORTRANGE_LOW #define SYSCTL_V6PORTRANGE_HIGH SYSCTL_V4PORTRANGE_HIGH #endif #endif /* HAVE_SYSCTLBYNAME */ #if defined(ISC_PLATFORM_NEEDIN6ADDRANY) const struct in6_addr isc_net_in6addrany = IN6ADDR_ANY_INIT; #endif #if defined(ISC_PLATFORM_HAVEIPV6) # if defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK) const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT; # endif # if defined(WANT_IPV6) static isc_once_t once_ipv6only = ISC_ONCE_INIT; # endif # if defined(ISC_PLATFORM_HAVEIN6PKTINFO) static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT; # endif #endif /* ISC_PLATFORM_HAVEIPV6 */ static isc_once_t once = ISC_ONCE_INIT; static isc_result_t ipv4_result = ISC_R_NOTFOUND; static isc_result_t ipv6_result = ISC_R_NOTFOUND; static isc_result_t unix_result = ISC_R_NOTFOUND; static isc_result_t ipv6only_result = ISC_R_NOTFOUND; static isc_result_t ipv6pktinfo_result = ISC_R_NOTFOUND; static isc_result_t try_proto(int domain) { int s; isc_result_t result = ISC_R_SUCCESS; char strbuf[ISC_STRERRORSIZE]; s = socket(domain, SOCK_STREAM, 0); if (s == -1) { switch (errno) { #ifdef EAFNOSUPPORT case EAFNOSUPPORT: #endif #ifdef EPROTONOSUPPORT case EPROTONOSUPPORT: #endif #ifdef EINVAL case EINVAL: #endif return (ISC_R_NOTFOUND); default: isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "socket() %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); return (ISC_R_UNEXPECTED); } } #ifdef ISC_PLATFORM_HAVEIPV6 #ifdef WANT_IPV6 #ifdef ISC_PLATFORM_HAVEIN6PKTINFO if (domain == PF_INET6) { struct sockaddr_in6 sin6; GETSOCKNAME_SOCKLEN_TYPE len; /* NTP local change */ /* * Check to see if IPv6 is broken, as is common on Linux. */ len = sizeof(sin6); if (getsockname(s, (struct sockaddr *)&sin6, &len) < 0) { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "retrieving the address of an IPv6 " "socket from the kernel failed."); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "IPv6 is not supported."); result = ISC_R_NOTFOUND; } else { if (len == sizeof(struct sockaddr_in6)) result = ISC_R_SUCCESS; else { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "IPv6 structures in kernel and " "user space do not match."); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "IPv6 is not supported."); result = ISC_R_NOTFOUND; } } } #endif #endif #endif (void)close(s); return (result); } static void initialize_action(void) { ipv4_result = try_proto(PF_INET); #ifdef ISC_PLATFORM_HAVEIPV6 #ifdef WANT_IPV6 #ifdef ISC_PLATFORM_HAVEIN6PKTINFO ipv6_result = try_proto(PF_INET6); #endif #endif #endif #ifdef ISC_PLATFORM_HAVESYSUNH unix_result = try_proto(PF_UNIX); #endif } static void initialize(void) { RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); } isc_result_t isc_net_probeipv4(void) { initialize(); return (ipv4_result); } isc_result_t isc_net_probeipv6(void) { initialize(); return (ipv6_result); } isc_result_t isc_net_probeunix(void) { initialize(); return (unix_result); } #ifdef ISC_PLATFORM_HAVEIPV6 #ifdef WANT_IPV6 static void try_ipv6only(void) { #ifdef IPV6_V6ONLY int s, on; char strbuf[ISC_STRERRORSIZE]; #endif isc_result_t result; result = isc_net_probeipv6(); if (result != ISC_R_SUCCESS) { ipv6only_result = result; return; } #ifndef IPV6_V6ONLY ipv6only_result = ISC_R_NOTFOUND; return; #else /* check for TCP sockets */ s = socket(PF_INET6, SOCK_STREAM, 0); if (s == -1) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "socket() %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); ipv6only_result = ISC_R_UNEXPECTED; return; } on = 1; if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) { ipv6only_result = ISC_R_NOTFOUND; goto close; } close(s); /* check for UDP sockets */ s = socket(PF_INET6, SOCK_DGRAM, 0); if (s == -1) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "socket() %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); ipv6only_result = ISC_R_UNEXPECTED; return; } on = 1; if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) { ipv6only_result = ISC_R_NOTFOUND; goto close; } close(s); ipv6only_result = ISC_R_SUCCESS; close: close(s); return; #endif /* IPV6_V6ONLY */ } static void initialize_ipv6only(void) { RUNTIME_CHECK(isc_once_do(&once_ipv6only, try_ipv6only) == ISC_R_SUCCESS); } #ifdef ISC_PLATFORM_HAVEIN6PKTINFO static void try_ipv6pktinfo(void) { int s, on; char strbuf[ISC_STRERRORSIZE]; isc_result_t result; int optname; result = isc_net_probeipv6(); if (result != ISC_R_SUCCESS) { ipv6pktinfo_result = result; return; } /* we only use this for UDP sockets */ s = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP); if (s == -1) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "socket() %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); ipv6pktinfo_result = ISC_R_UNEXPECTED; return; } #ifdef IPV6_RECVPKTINFO optname = IPV6_RECVPKTINFO; #else optname = IPV6_PKTINFO; #endif on = 1; if (setsockopt(s, IPPROTO_IPV6, optname, &on, sizeof(on)) < 0) { ipv6pktinfo_result = ISC_R_NOTFOUND; goto close; } close(s); ipv6pktinfo_result = ISC_R_SUCCESS; close: close(s); return; } static void initialize_ipv6pktinfo(void) { RUNTIME_CHECK(isc_once_do(&once_ipv6pktinfo, try_ipv6pktinfo) == ISC_R_SUCCESS); } #endif /* ISC_PLATFORM_HAVEIN6PKTINFO */ #endif /* WANT_IPV6 */ #endif /* ISC_PLATFORM_HAVEIPV6 */ isc_result_t isc_net_probe_ipv6only(void) { #ifdef ISC_PLATFORM_HAVEIPV6 #ifdef WANT_IPV6 initialize_ipv6only(); #else ipv6only_result = ISC_R_NOTFOUND; #endif #endif return (ipv6only_result); } isc_result_t isc_net_probe_ipv6pktinfo(void) { #ifdef ISC_PLATFORM_HAVEIPV6 #ifdef ISC_PLATFORM_HAVEIN6PKTINFO #ifdef WANT_IPV6 initialize_ipv6pktinfo(); #else ipv6pktinfo_result = ISC_R_NOTFOUND; #endif #endif #endif return (ipv6pktinfo_result); } #if defined(USE_SYSCTL_PORTRANGE) #if defined(HAVE_SYSCTLBYNAME) static isc_result_t getudpportrange_sysctl(int af, in_port_t *low, in_port_t *high) { int port_low, port_high; size_t portlen; const char *sysctlname_lowport, *sysctlname_hiport; if (af == AF_INET) { sysctlname_lowport = SYSCTL_V4PORTRANGE_LOW; sysctlname_hiport = SYSCTL_V4PORTRANGE_HIGH; } else { sysctlname_lowport = SYSCTL_V6PORTRANGE_LOW; sysctlname_hiport = SYSCTL_V6PORTRANGE_HIGH; } portlen = sizeof(portlen); if (sysctlbyname(sysctlname_lowport, &port_low, &portlen, NULL, 0) < 0) { return (ISC_R_FAILURE); } portlen = sizeof(portlen); if (sysctlbyname(sysctlname_hiport, &port_high, &portlen, NULL, 0) < 0) { return (ISC_R_FAILURE); } if ((port_low & ~0xffff) != 0 || (port_high & ~0xffff) != 0) return (ISC_R_RANGE); *low = (in_port_t)port_low; *high = (in_port_t)port_high; return (ISC_R_SUCCESS); } #else /* !HAVE_SYSCTLBYNAME */ static isc_result_t getudpportrange_sysctl(int af, in_port_t *low, in_port_t *high) { int mib_lo4[4] = SYSCTL_V4PORTRANGE_LOW; int mib_hi4[4] = SYSCTL_V4PORTRANGE_HIGH; int mib_lo6[4] = SYSCTL_V6PORTRANGE_LOW; int mib_hi6[4] = SYSCTL_V6PORTRANGE_HIGH; int *mib_lo, *mib_hi, miblen; int port_low, port_high; size_t portlen; if (af == AF_INET) { mib_lo = mib_lo4; mib_hi = mib_hi4; miblen = sizeof(mib_lo4) / sizeof(mib_lo4[0]); } else { mib_lo = mib_lo6; mib_hi = mib_hi6; miblen = sizeof(mib_lo6) / sizeof(mib_lo6[0]); } portlen = sizeof(portlen); if (sysctl(mib_lo, miblen, &port_low, &portlen, NULL, 0) < 0) { return (ISC_R_FAILURE); } portlen = sizeof(portlen); if (sysctl(mib_hi, miblen, &port_high, &portlen, NULL, 0) < 0) { return (ISC_R_FAILURE); } if ((port_low & ~0xffff) != 0 || (port_high & ~0xffff) != 0) return (ISC_R_RANGE); *low = (in_port_t) port_low; *high = (in_port_t) port_high; return (ISC_R_SUCCESS); } #endif /* HAVE_SYSCTLBYNAME */ #endif /* USE_SYSCTL_PORTRANGE */ isc_result_t isc_net_getudpportrange(int af, in_port_t *low, in_port_t *high) { int result = ISC_R_FAILURE; REQUIRE(low != NULL && high != NULL); #if defined(USE_SYSCTL_PORTRANGE) result = getudpportrange_sysctl(af, low, high); #else UNUSED(af); #endif if (result != ISC_R_SUCCESS) { *low = ISC_NET_PORTRANGELOW; *high = ISC_NET_PORTRANGEHIGH; } return (ISC_R_SUCCESS); /* we currently never fail in this function */ } void isc_net_disableipv4(void) { initialize(); if (ipv4_result == ISC_R_SUCCESS) ipv4_result = ISC_R_DISABLED; } void isc_net_disableipv6(void) { initialize(); if (ipv6_result == ISC_R_SUCCESS) ipv6_result = ISC_R_DISABLED; } void isc_net_enableipv4(void) { initialize(); if (ipv4_result == ISC_R_DISABLED) ipv4_result = ISC_R_SUCCESS; } void isc_net_enableipv6(void) { initialize(); if (ipv6_result == ISC_R_DISABLED) ipv6_result = ISC_R_SUCCESS; } ntp-4.2.6p5/lib/isc/unix/fsaccess.c0000644000175000017500000000455711307651603016073 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: fsaccess.c,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ #include #include #include #include #include "errno2result.h" /*! \file * \brief * The OS-independent part of the API is in lib/isc. */ #include "../fsaccess.c" isc_result_t isc_fsaccess_set(const char *path, isc_fsaccess_t access) { struct stat statb; mode_t mode; isc_boolean_t is_dir = ISC_FALSE; isc_fsaccess_t bits; isc_result_t result; if (stat(path, &statb) != 0) return (isc__errno2result(errno)); if ((statb.st_mode & S_IFDIR) != 0) is_dir = ISC_TRUE; else if ((statb.st_mode & S_IFREG) == 0) return (ISC_R_INVALIDFILE); result = check_bad_bits(access, is_dir); if (result != ISC_R_SUCCESS) return (result); /* * Done with checking bad bits. Set mode_t. */ mode = 0; #define SET_AND_CLEAR1(modebit) \ if ((access & bits) != 0) { \ mode |= modebit; \ access &= ~bits; \ } #define SET_AND_CLEAR(user, group, other) \ SET_AND_CLEAR1(user); \ bits <<= STEP; \ SET_AND_CLEAR1(group); \ bits <<= STEP; \ SET_AND_CLEAR1(other); bits = ISC_FSACCESS_READ | ISC_FSACCESS_LISTDIRECTORY; SET_AND_CLEAR(S_IRUSR, S_IRGRP, S_IROTH); bits = ISC_FSACCESS_WRITE | ISC_FSACCESS_CREATECHILD | ISC_FSACCESS_DELETECHILD; SET_AND_CLEAR(S_IWUSR, S_IWGRP, S_IWOTH); bits = ISC_FSACCESS_EXECUTE | ISC_FSACCESS_ACCESSCHILD; SET_AND_CLEAR(S_IXUSR, S_IXGRP, S_IXOTH); INSIST(access == 0); if (chmod(path, mode) < 0) return (isc__errno2result(errno)); return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/unix/include/0000755000175000017500000000000011307651602015544 5ustar peterpeterntp-4.2.6p5/lib/isc/unix/include/isc/0000755000175000017500000000000011675461367016341 5ustar peterpeterntp-4.2.6p5/lib/isc/unix/include/isc/stdtime.h0000644000175000017500000000342111307651603020145 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: stdtime.h,v 1.14 2007/06/19 23:47:19 tbox Exp $ */ #ifndef ISC_STDTIME_H #define ISC_STDTIME_H 1 /*! \file */ #include #include /*% * It's public information that 'isc_stdtime_t' is an unsigned integral type. * Applications that want maximum portability should not assume anything * about its size. */ typedef isc_uint32_t isc_stdtime_t; /* * isc_stdtime32_t is a 32-bit version of isc_stdtime_t. A variable of this * type should only be used as an opaque integer (e.g.,) to compare two * time values. */ typedef isc_uint32_t isc_stdtime32_t; ISC_LANG_BEGINDECLS /* */ void isc_stdtime_get(isc_stdtime_t *t); /*%< * Set 't' to the number of seconds since 00:00:00 UTC, January 1, 1970. * * Requires: * *\li 't' is a valid pointer. */ #define isc_stdtime_convert32(t, t32p) (*(t32p) = t) /* * Convert the standard time to its 32-bit version. */ ISC_LANG_ENDDECLS #endif /* ISC_STDTIME_H */ ntp-4.2.6p5/lib/isc/unix/include/isc/syslog.h0000644000175000017500000000253511307651603020021 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: syslog.h,v 1.7 2007/06/19 23:47:19 tbox Exp $ */ #ifndef ISC_SYSLOG_H #define ISC_SYSLOG_H 1 /*! \file */ #include #include ISC_LANG_BEGINDECLS isc_result_t isc_syslog_facilityfromstring(const char *str, int *facilityp); /*%< * Convert 'str' to the appropriate syslog facility constant. * * Requires: * *\li 'str' is not NULL *\li 'facilityp' is not NULL * * Returns: * \li #ISC_R_SUCCESS * \li #ISC_R_NOTFOUND */ ISC_LANG_ENDDECLS #endif /* ISC_SYSLOG_H */ ntp-4.2.6p5/lib/isc/unix/include/isc/offset.h0000644000175000017500000000356011307651603017766 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: offset.h,v 1.15.332.2 2009/02/16 23:47:15 tbox Exp $ */ #ifndef ISC_OFFSET_H #define ISC_OFFSET_H 1 /*! \file * \brief * File offsets are operating-system dependent. */ #include /* Required for CHAR_BIT. */ #include #include /* For Linux Standard Base. */ typedef off_t isc_offset_t; /*% * POSIX says "Additionally, blkcnt_t and off_t are extended signed integral * types", so the maximum value is all 1s except for the high bit. * This definition is more complex than it really needs to be because it was * crafted to keep both the SunOS 5.6 and the HP/UX 11 compilers quiet about * integer overflow. For example, though this is equivalent to just left * shifting 1 to the high bit and then inverting the bits, the SunOS compiler * is unhappy about shifting a positive "1" to negative in a signed integer. */ #define ISC_OFFSET_MAXIMUM \ (~(((off_t)-1 >> (sizeof(off_t) * CHAR_BIT - 1)) \ << (sizeof(off_t) * CHAR_BIT - 1))) #endif /* ISC_OFFSET_H */ ntp-4.2.6p5/lib/isc/unix/include/isc/dir.h0000644000175000017500000000501111307651614017251 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: dir.h,v 1.21 2007/06/19 23:47:19 tbox Exp $ */ /* Principal Authors: DCL */ #ifndef ISC_DIR_H #define ISC_DIR_H 1 /*! \file */ #include /* Required on some systems. */ #include #include #include #define ISC_DIR_NAMEMAX 256 #define ISC_DIR_PATHMAX 1024 /*% Directory Entry */ typedef struct isc_direntry { /*! * Ideally, this should be NAME_MAX, but AIX does not define it by * default and dynamically allocating the space based on pathconf() * complicates things undesirably, as does adding special conditionals * just for AIX. So a comfortably sized buffer is chosen instead. */ char name[ISC_DIR_NAMEMAX]; unsigned int length; } isc_direntry_t; /*% Directory */ typedef struct isc_dir { unsigned int magic; /*! * As with isc_direntry_t->name, making this "right" for all systems * is slightly problematic because AIX does not define PATH_MAX. */ char dirname[ISC_DIR_PATHMAX]; isc_direntry_t entry; DIR * handle; } isc_dir_t; ISC_LANG_BEGINDECLS void isc_dir_init(isc_dir_t *dir); isc_result_t isc_dir_open(isc_dir_t *dir, const char *dirname); isc_result_t isc_dir_read(isc_dir_t *dir); isc_result_t isc_dir_reset(isc_dir_t *dir); void isc_dir_close(isc_dir_t *dir); isc_result_t isc_dir_chdir(const char *dirname); isc_result_t isc_dir_chroot(const char *dirname); isc_result_t isc_dir_createunique(char *templet); /*!< * Use a templet (such as from isc_file_mktemplate()) to create a uniquely * named, empty directory. The templet string is modified in place. * If result == ISC_R_SUCCESS, it is the name of the directory that was * created. */ ISC_LANG_ENDDECLS #endif /* ISC_DIR_H */ ntp-4.2.6p5/lib/isc/unix/include/isc/keyboard.h0000644000175000017500000000274611307651603020305 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: keyboard.h,v 1.11 2007/06/19 23:47:19 tbox Exp $ */ #ifndef ISC_KEYBOARD_H #define ISC_KEYBOARD_H 1 /*! \file */ #include #include #include ISC_LANG_BEGINDECLS typedef struct { int fd; struct termios saved_mode; isc_result_t result; } isc_keyboard_t; isc_result_t isc_keyboard_open(isc_keyboard_t *keyboard); isc_result_t isc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleepseconds); isc_result_t isc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp); isc_boolean_t isc_keyboard_canceled(isc_keyboard_t *keyboard); ISC_LANG_ENDDECLS #endif /* ISC_KEYBOARD_H */ ntp-4.2.6p5/lib/isc/unix/include/isc/stat.h0000644000175000017500000000236011307651614017452 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: stat.h,v 1.5 2007/06/19 23:47:19 tbox Exp $ */ #ifndef ISC_STAT_H #define ISC_STAT_H 1 /***** ***** Module Info *****/ /* * Portable netdb.h support. * * This module is responsible for defining S_IS??? macros. * * MP: * No impact. * * Reliability: * No anticipated impact. * * Resources: * N/A. * * Security: * No anticipated impact. * */ /*** *** Imports. ***/ #include #include #endif /* ISC_STAT_H */ ntp-4.2.6p5/lib/isc/unix/include/isc/time.h0000644000175000017500000001756211307651614017447 0ustar peterpeter/* * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: time.h,v 1.38.56.2 2009/01/05 23:47:23 tbox Exp $ */ #ifndef ISC_TIME_H #define ISC_TIME_H 1 /*! \file */ #include #include /*** *** Intervals ***/ /*! * \brief * The contents of this structure are private, and MUST NOT be accessed * directly by callers. * * The contents are exposed only to allow callers to avoid dynamic allocation. */ struct isc_interval { unsigned int seconds; unsigned int nanoseconds; }; extern isc_interval_t *isc_interval_zero; ISC_LANG_BEGINDECLS void isc_interval_set(isc_interval_t *i, unsigned int seconds, unsigned int nanoseconds); /*%< * Set 'i' to a value representing an interval of 'seconds' seconds and * 'nanoseconds' nanoseconds, suitable for use in isc_time_add() and * isc_time_subtract(). * * Requires: * *\li 't' is a valid pointer. *\li nanoseconds < 1000000000. */ isc_boolean_t isc_interval_iszero(const isc_interval_t *i); /*%< * Returns ISC_TRUE iff. 'i' is the zero interval. * * Requires: * *\li 'i' is a valid pointer. */ /*** *** Absolute Times ***/ /*% * The contents of this structure are private, and MUST NOT be accessed * directly by callers. * * The contents are exposed only to allow callers to avoid dynamic allocation. */ struct isc_time { unsigned int seconds; unsigned int nanoseconds; }; extern isc_time_t *isc_time_epoch; void isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds); /*%< * Set 't' to a value which represents the given number of seconds and * nanoseconds since 00:00:00 January 1, 1970, UTC. * * Notes: *\li The Unix version of this call is equivalent to: *\code * isc_time_settoepoch(t); * isc_interval_set(i, seconds, nanoseconds); * isc_time_add(t, i, t); *\endcode * * Requires: *\li 't' is a valid pointer. *\li nanoseconds < 1000000000. */ void isc_time_settoepoch(isc_time_t *t); /*%< * Set 't' to the time of the epoch. * * Notes: *\li The date of the epoch is platform-dependent. * * Requires: * *\li 't' is a valid pointer. */ isc_boolean_t isc_time_isepoch(const isc_time_t *t); /*%< * Returns ISC_TRUE iff. 't' is the epoch ("time zero"). * * Requires: * *\li 't' is a valid pointer. */ isc_result_t isc_time_now(isc_time_t *t); /*%< * Set 't' to the current absolute time. * * Requires: * *\li 't' is a valid pointer. * * Returns: * *\li Success *\li Unexpected error * Getting the time from the system failed. *\li Out of range * The time from the system is too large to be represented * in the current definition of isc_time_t. */ isc_result_t isc_time_nowplusinterval(isc_time_t *t, const isc_interval_t *i); /*%< * Set *t to the current absolute time + i. * * Note: *\li This call is equivalent to: * *\code * isc_time_now(t); * isc_time_add(t, i, t); *\endcode * * Requires: * *\li 't' and 'i' are valid pointers. * * Returns: * *\li Success *\li Unexpected error * Getting the time from the system failed. *\li Out of range * The interval added to the time from the system is too large to * be represented in the current definition of isc_time_t. */ int isc_time_compare(const isc_time_t *t1, const isc_time_t *t2); /*%< * Compare the times referenced by 't1' and 't2' * * Requires: * *\li 't1' and 't2' are valid pointers. * * Returns: * *\li -1 t1 < t2 (comparing times, not pointers) *\li 0 t1 = t2 *\li 1 t1 > t2 */ isc_result_t isc_time_add(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result); /*%< * Add 'i' to 't', storing the result in 'result'. * * Requires: * *\li 't', 'i', and 'result' are valid pointers. * * Returns: *\li Success *\li Out of range * The interval added to the time is too large to * be represented in the current definition of isc_time_t. */ isc_result_t isc_time_subtract(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result); /*%< * Subtract 'i' from 't', storing the result in 'result'. * * Requires: * *\li 't', 'i', and 'result' are valid pointers. * * Returns: *\li Success *\li Out of range * The interval is larger than the time since the epoch. */ isc_uint64_t isc_time_microdiff(const isc_time_t *t1, const isc_time_t *t2); /*%< * Find the difference in microseconds between time t1 and time t2. * t2 is the subtrahend of t1; ie, difference = t1 - t2. * * Requires: * *\li 't1' and 't2' are valid pointers. * * Returns: *\li The difference of t1 - t2, or 0 if t1 <= t2. */ isc_uint32_t isc_time_seconds(const isc_time_t *t); /*%< * Return the number of seconds since the epoch stored in a time structure. * * Requires: * *\li 't' is a valid pointer. */ isc_result_t isc_time_secondsastimet(const isc_time_t *t, time_t *secondsp); /*%< * Ensure the number of seconds in an isc_time_t is representable by a time_t. * * Notes: *\li The number of seconds stored in an isc_time_t might be larger * than the number of seconds a time_t is able to handle. Since * time_t is mostly opaque according to the ANSI/ISO standard * (essentially, all you can be sure of is that it is an arithmetic type, * not even necessarily integral), it can be tricky to ensure that * the isc_time_t is in the range a time_t can handle. Use this * function in place of isc_time_seconds() any time you need to set a * time_t from an isc_time_t. * * Requires: *\li 't' is a valid pointer. * * Returns: *\li Success *\li Out of range */ isc_uint32_t isc_time_nanoseconds(const isc_time_t *t); /*%< * Return the number of nanoseconds stored in a time structure. * * Notes: *\li This is the number of nanoseconds in excess of the number * of seconds since the epoch; it will always be less than one * full second. * * Requires: *\li 't' is a valid pointer. * * Ensures: *\li The returned value is less than 1*10^9. */ void isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len); /*%< * Format the time 't' into the buffer 'buf' of length 'len', * using a format like "30-Aug-2000 04:06:47.997" and the local time zone. * If the text does not fit in the buffer, the result is indeterminate, * but is always guaranteed to be null terminated. * * Requires: *\li 'len' > 0 *\li 'buf' points to an array of at least len chars * */ void isc_time_formathttptimestamp(const isc_time_t *t, char *buf, unsigned int len); /*%< * Format the time 't' into the buffer 'buf' of length 'len', * using a format like "Mon, 30 Aug 2000 04:06:47 GMT" * If the text does not fit in the buffer, the result is indeterminate, * but is always guaranteed to be null terminated. * * Requires: *\li 'len' > 0 *\li 'buf' points to an array of at least len chars * */ void isc_time_formatISO8601(const isc_time_t *t, char *buf, unsigned int len); /*%< * Format the time 't' into the buffer 'buf' of length 'len', * using the ISO8601 format: "yyyy-mm-ddThh:mm:ssZ" * If the text does not fit in the buffer, the result is indeterminate, * but is always guaranteed to be null terminated. * * Requires: *\li 'len' > 0 *\li 'buf' points to an array of at least len chars * */ ISC_LANG_ENDDECLS #endif /* ISC_TIME_H */ ntp-4.2.6p5/lib/isc/unix/include/isc/net.h0000644000175000017500000002202611307651603017264 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: net.h,v 1.48.84.2 2009/02/16 23:47:15 tbox Exp $ */ #ifndef ISC_NET_H #define ISC_NET_H 1 /***** ***** Module Info *****/ /*! \file * \brief * Basic Networking Types * * This module is responsible for defining the following basic networking * types: * *\li struct in_addr *\li struct in6_addr *\li struct in6_pktinfo *\li struct sockaddr *\li struct sockaddr_in *\li struct sockaddr_in6 *\li in_port_t * * It ensures that the AF_ and PF_ macros are defined. * * It declares ntoh[sl]() and hton[sl](). * * It declares inet_aton(), inet_ntop(), and inet_pton(). * * It ensures that #INADDR_LOOPBACK, #INADDR_ANY, #IN6ADDR_ANY_INIT, * in6addr_any, and in6addr_loopback are available. * * It ensures that IN_MULTICAST() is available to check for multicast * addresses. * * MP: *\li No impact. * * Reliability: *\li No anticipated impact. * * Resources: *\li N/A. * * Security: *\li No anticipated impact. * * Standards: *\li BSD Socket API *\li RFC2553 */ /*** *** Imports. ***/ #include #include #include /* Contractual promise. */ #include #include /* Contractual promise. */ #include /* Contractual promise. */ #ifdef ISC_PLATFORM_NEEDNETINETIN6H #include /* Required on UnixWare. */ #endif #ifdef ISC_PLATFORM_NEEDNETINET6IN6H #include /* Required on BSD/OS for in6_pktinfo. */ #endif #ifndef ISC_PLATFORM_HAVEIPV6 #include /* Contractual promise. */ #endif #include #include #ifdef ISC_PLATFORM_HAVEINADDR6 #define in6_addr in_addr6 /*%< Required for pre RFC2133 implementations. */ #endif #ifdef ISC_PLATFORM_HAVEIPV6 #ifndef IN6ADDR_ANY_INIT #ifdef s6_addr /*% * Required for some pre RFC2133 implementations. * IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT were added in * draft-ietf-ipngwg-bsd-api-04.txt or draft-ietf-ipngwg-bsd-api-05.txt. * If 's6_addr' is defined then assume that there is a union and three * levels otherwise assume two levels required. */ #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } #else #define IN6ADDR_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } #endif #endif #ifndef IN6ADDR_LOOPBACK_INIT #ifdef s6_addr /*% IPv6 address loopback init */ #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } #else #define IN6ADDR_LOOPBACK_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } #endif #endif #ifndef IN6_IS_ADDR_V4MAPPED /*% Is IPv6 address V4 mapped? */ #define IN6_IS_ADDR_V4MAPPED(x) \ (memcmp((x)->s6_addr, in6addr_any.s6_addr, 10) == 0 && \ (x)->s6_addr[10] == 0xff && (x)->s6_addr[11] == 0xff) #endif #ifndef IN6_IS_ADDR_V4COMPAT /*% Is IPv6 address V4 compatible? */ #define IN6_IS_ADDR_V4COMPAT(x) \ (memcmp((x)->s6_addr, in6addr_any.s6_addr, 12) == 0 && \ ((x)->s6_addr[12] != 0 || (x)->s6_addr[13] != 0 || \ (x)->s6_addr[14] != 0 || \ ((x)->s6_addr[15] != 0 && (x)->s6_addr[15] != 1))) #endif #ifndef IN6_IS_ADDR_MULTICAST /*% Is IPv6 address multicast? */ #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) #endif #ifndef IN6_IS_ADDR_LINKLOCAL /*% Is IPv6 address linklocal? */ #define IN6_IS_ADDR_LINKLOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) #endif #ifndef IN6_IS_ADDR_SITELOCAL /*% is IPv6 address sitelocal? */ #define IN6_IS_ADDR_SITELOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) #endif #ifndef IN6_IS_ADDR_LOOPBACK /*% is IPv6 address loopback? */ #define IN6_IS_ADDR_LOOPBACK(x) \ (memcmp((x)->s6_addr, in6addr_loopback.s6_addr, 16) == 0) #endif #endif #ifndef AF_INET6 /*% IPv6 */ #define AF_INET6 99 #endif #ifndef PF_INET6 /*% IPv6 */ #define PF_INET6 AF_INET6 #endif #ifndef INADDR_LOOPBACK /*% inaddr loopback */ #define INADDR_LOOPBACK 0x7f000001UL #endif #ifndef ISC_PLATFORM_HAVEIN6PKTINFO /*% IPv6 packet info */ struct in6_pktinfo { struct in6_addr ipi6_addr; /*%< src/dst IPv6 address */ unsigned int ipi6_ifindex; /*%< send/recv interface index */ }; #endif #if defined(ISC_PLATFORM_NEEDIN6ADDRANY) extern const struct in6_addr isc_net_in6addrany; /*% * Cope with a missing in6addr_any and in6addr_loopback. */ #define in6addr_any isc_net_in6addrany #endif #if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK) extern const struct in6_addr isc_net_in6addrloop; #define in6addr_loopback isc_net_in6addrloop #endif #ifdef ISC_PLATFORM_FIXIN6ISADDR #undef IN6_IS_ADDR_GEOGRAPHIC /*! * \brief * Fix UnixWare 7.1.1's broken IN6_IS_ADDR_* definitions. */ #define IN6_IS_ADDR_GEOGRAPHIC(a) (((a)->S6_un.S6_l[0] & 0xE0) == 0x80) #undef IN6_IS_ADDR_IPX #define IN6_IS_ADDR_IPX(a) (((a)->S6_un.S6_l[0] & 0xFE) == 0x04) #undef IN6_IS_ADDR_LINKLOCAL #define IN6_IS_ADDR_LINKLOCAL(a) (((a)->S6_un.S6_l[0] & 0xC0FF) == 0x80FE) #undef IN6_IS_ADDR_MULTICAST #define IN6_IS_ADDR_MULTICAST(a) (((a)->S6_un.S6_l[0] & 0xFF) == 0xFF) #undef IN6_IS_ADDR_NSAP #define IN6_IS_ADDR_NSAP(a) (((a)->S6_un.S6_l[0] & 0xFE) == 0x02) #undef IN6_IS_ADDR_PROVIDER #define IN6_IS_ADDR_PROVIDER(a) (((a)->S6_un.S6_l[0] & 0xE0) == 0x40) #undef IN6_IS_ADDR_SITELOCAL #define IN6_IS_ADDR_SITELOCAL(a) (((a)->S6_un.S6_l[0] & 0xC0FF) == 0xC0FE) #endif /* ISC_PLATFORM_FIXIN6ISADDR */ #ifdef ISC_PLATFORM_NEEDPORTT /*% * Ensure type in_port_t is defined. */ typedef isc_uint16_t in_port_t; #endif #ifndef MSG_TRUNC /*% * If this system does not have MSG_TRUNC (as returned from recvmsg()) * ISC_PLATFORM_RECVOVERFLOW will be defined. This will enable the MSG_TRUNC * faking code in socket.c. */ #define ISC_PLATFORM_RECVOVERFLOW #endif /*% IP address. */ #define ISC__IPADDR(x) ((isc_uint32_t)htonl((isc_uint32_t)(x))) /*% Is IP address multicast? */ #define ISC_IPADDR_ISMULTICAST(i) \ (((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \ == ISC__IPADDR(0xe0000000)) #define ISC_IPADDR_ISEXPERIMENTAL(i) \ (((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \ == ISC__IPADDR(0xf0000000)) /*** *** Functions. ***/ ISC_LANG_BEGINDECLS isc_result_t isc_net_probeipv4(void); /*%< * Check if the system's kernel supports IPv4. * * Returns: * *\li #ISC_R_SUCCESS IPv4 is supported. *\li #ISC_R_NOTFOUND IPv4 is not supported. *\li #ISC_R_DISABLED IPv4 is disabled. *\li #ISC_R_UNEXPECTED */ isc_result_t isc_net_probeipv6(void); /*%< * Check if the system's kernel supports IPv6. * * Returns: * *\li #ISC_R_SUCCESS IPv6 is supported. *\li #ISC_R_NOTFOUND IPv6 is not supported. *\li #ISC_R_DISABLED IPv6 is disabled. *\li #ISC_R_UNEXPECTED */ isc_result_t isc_net_probe_ipv6only(void); /*%< * Check if the system's kernel supports the IPV6_V6ONLY socket option. * * Returns: * *\li #ISC_R_SUCCESS the option is supported for both TCP and UDP. *\li #ISC_R_NOTFOUND IPv6 itself or the option is not supported. *\li #ISC_R_UNEXPECTED */ isc_result_t isc_net_probe_ipv6pktinfo(void); /* * Check if the system's kernel supports the IPV6_(RECV)PKTINFO socket option * for UDP sockets. * * Returns: * * \li #ISC_R_SUCCESS the option is supported. * \li #ISC_R_NOTFOUND IPv6 itself or the option is not supported. * \li #ISC_R_UNEXPECTED */ void isc_net_disableipv4(void); void isc_net_disableipv6(void); void isc_net_enableipv4(void); void isc_net_enableipv6(void); isc_result_t isc_net_probeunix(void); /* * Returns whether UNIX domain sockets are supported. */ isc_result_t isc_net_getudpportrange(int af, in_port_t *low, in_port_t *high); /*%< * Returns system's default range of ephemeral UDP ports, if defined. * If the range is not available or unknown, ISC_NET_PORTRANGELOW and * ISC_NET_PORTRANGEHIGH will be returned. * * Requires: * *\li 'low' and 'high' must be non NULL. * * Returns: * *\li *low and *high will be the ports specifying the low and high ends of * the range. */ #ifdef ISC_PLATFORM_NEEDNTOP const char * isc_net_ntop(int af, const void *src, char *dst, size_t size); #define inet_ntop isc_net_ntop #endif #ifdef ISC_PLATFORM_NEEDPTON int isc_net_pton(int af, const char *src, void *dst); #undef inet_pton #define inet_pton isc_net_pton #endif int isc_net_aton(const char *cp, struct in_addr *addr); #undef inet_aton #define inet_aton isc_net_aton ISC_LANG_ENDDECLS #endif /* ISC_NET_H */ ntp-4.2.6p5/lib/isc/unix/include/isc/netdb.h0000644000175000017500000000256011307651603017573 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: netdb.h,v 1.11 2007/06/19 23:47:19 tbox Exp $ */ #ifndef ISC_NETDB_H #define ISC_NETDB_H 1 /***** ***** Module Info *****/ /*! \file * \brief * Portable netdb.h support. * * This module is responsible for defining the getby APIs. * * MP: *\li No impact. * * Reliability: *\li No anticipated impact. * * Resources: *\li N/A. * * Security: *\li No anticipated impact. * * Standards: *\li BSD API */ /*** *** Imports. ***/ #include #include #endif /* ISC_NETDB_H */ ntp-4.2.6p5/lib/isc/unix/include/isc/int.h0000644000175000017500000000352111307651605017271 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: int.h,v 1.16 2007/06/19 23:47:19 tbox Exp $ */ #ifndef ISC_INT_H #define ISC_INT_H 1 /*! \file */ typedef char isc_int8_t; typedef unsigned char isc_uint8_t; typedef short isc_int16_t; typedef unsigned short isc_uint16_t; typedef int isc_int32_t; typedef unsigned int isc_uint32_t; typedef long long isc_int64_t; typedef unsigned long long isc_uint64_t; #define ISC_INT8_MIN -128 #define ISC_INT8_MAX 127 #define ISC_UINT8_MAX 255 #define ISC_INT16_MIN -32768 #define ISC_INT16_MAX 32767 #define ISC_UINT16_MAX 65535 /*% * Note that "int" is 32 bits on all currently supported Unix-like operating * systems, but "long" can be either 32 bits or 64 bits, thus the 32 bit * constants are not qualified with "L". */ #define ISC_INT32_MIN -2147483648 #define ISC_INT32_MAX 2147483647 #define ISC_UINT32_MAX 4294967295U #define ISC_INT64_MIN -9223372036854775808LL #define ISC_INT64_MAX 9223372036854775807LL #define ISC_UINT64_MAX 18446744073709551615ULL #endif /* ISC_INT_H */ ntp-4.2.6p5/lib/isc/unix/include/isc/strerror.h0000644000175000017500000000244311307651605020363 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: strerror.h,v 1.8.332.2 2009/02/16 23:47:15 tbox Exp $ */ #ifndef ISC_STRERROR_H #define ISC_STRERROR_H /*! \file */ #include #include ISC_LANG_BEGINDECLS /*% String Error Size */ #define ISC_STRERRORSIZE 128 /*% * Provide a thread safe wrapper to strerror(). * * Requires: * 'buf' to be non NULL. */ void isc__strerror(int num, char *buf, size_t bufsize); ISC_LANG_ENDDECLS #endif /* ISC_STRERROR_H */ ntp-4.2.6p5/lib/isc/unix/ifiter_ioctl.c0000644000175000017500000006462111505336022016746 0ustar peterpeter/* * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ifiter_ioctl.c,v 1.60.120.2 2009/01/18 23:47:41 tbox Exp $ */ /*! \file * \brief * Obtain the list of network interfaces using the SIOCGLIFCONF ioctl. * See netintro(4). */ #if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) #ifdef ISC_PLATFORM_HAVEIF_LADDRCONF #define lifc_len iflc_len #define lifc_buf iflc_buf #define lifc_req iflc_req #define LIFCONF if_laddrconf #else #define ISC_HAVE_LIFC_FAMILY 1 #define ISC_HAVE_LIFC_FLAGS 1 #define LIFCONF lifconf #endif #ifdef ISC_PLATFORM_HAVEIF_LADDRREQ #define lifr_addr iflr_addr #define lifr_name iflr_name #define lifr_dstaddr iflr_dstaddr #define lifr_broadaddr iflr_broadaddr #define lifr_flags iflr_flags #define lifr_index iflr_index #define ss_family sa_family #define LIFREQ if_laddrreq #else #define LIFREQ lifreq #endif #endif #define IFITER_MAGIC ISC_MAGIC('I', 'F', 'I', 'T') #define VALID_IFITER(t) ISC_MAGIC_VALID(t, IFITER_MAGIC) struct isc_interfaceiter { unsigned int magic; /* Magic number. */ isc_mem_t *mctx; int mode; int socket; struct ifconf ifc; void *buf; /* Buffer for sysctl data. */ unsigned int bufsize; /* Bytes allocated. */ unsigned int pos; /* Current offset in SIOCGIFCONF data */ #if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) int socket6; struct LIFCONF lifc; void *buf6; /* Buffer for sysctl data. */ unsigned int bufsize6; /* Bytes allocated. */ unsigned int pos6; /* Current offset in SIOCGLIFCONF data */ isc_result_t result6; /* Last result code. */ isc_boolean_t first6; #endif #ifdef HAVE_TRUCLUSTER int clua_context; /* Cluster alias context */ isc_boolean_t clua_done; struct sockaddr clua_sa; #endif #ifdef __linux FILE * proc; char entry[ISC_IF_INET6_SZ]; isc_result_t valid; #endif isc_interface_t current; /* Current interface data. */ isc_result_t result; /* Last result code. */ }; #ifdef HAVE_TRUCLUSTER #include #include #endif /*% * Size of buffer for SIOCGLIFCONF, in bytes. We assume no sane system * will have more than a megabyte of interface configuration data. */ #define IFCONF_BUFSIZE_INITIAL 4096 #define IFCONF_BUFSIZE_MAX 1048576 #ifdef __linux #ifndef IF_NAMESIZE # ifdef IFNAMSIZ # define IF_NAMESIZE IFNAMSIZ # else # define IF_NAMESIZE 16 # endif #endif #endif static isc_result_t getbuf4(isc_interfaceiter_t *iter) { char strbuf[ISC_STRERRORSIZE]; iter->bufsize = IFCONF_BUFSIZE_INITIAL; for (;;) { iter->buf = isc_mem_get(iter->mctx, iter->bufsize); if (iter->buf == NULL) return (ISC_R_NOMEMORY); memset(&iter->ifc.ifc_len, 0, sizeof(iter->ifc.ifc_len)); iter->ifc.ifc_len = iter->bufsize; iter->ifc.ifc_buf = iter->buf; /* * Ignore the HP/UX warning about "integer overflow during * conversion". It comes from its own macro definition, * and is really hard to shut up. */ if (ioctl(iter->socket, SIOCGIFCONF, (char *)&iter->ifc) == -1) { if (errno != EINVAL) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_GETIFCONFIG, "get interface " "configuration: %s"), strbuf); goto unexpected; } /* * EINVAL. Retry with a bigger buffer. */ } else { /* * The ioctl succeeded. * Some OS's just return what will fit rather * than set EINVAL if the buffer is too small * to fit all the interfaces in. If * ifc.lifc_len is too near to the end of the * buffer we will grow it just in case and * retry. */ if (iter->ifc.ifc_len + 2 * sizeof(struct ifreq) < iter->bufsize) break; } if (iter->bufsize >= IFCONF_BUFSIZE_MAX) { UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_BUFFERMAX, "get interface " "configuration: " "maximum buffer " "size exceeded")); goto unexpected; } isc_mem_put(iter->mctx, iter->buf, iter->bufsize); iter->bufsize *= 2; } return (ISC_R_SUCCESS); unexpected: isc_mem_put(iter->mctx, iter->buf, iter->bufsize); iter->buf = NULL; return (ISC_R_UNEXPECTED); } #if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) static isc_result_t getbuf6(isc_interfaceiter_t *iter) { char strbuf[ISC_STRERRORSIZE]; isc_result_t result; iter->bufsize6 = IFCONF_BUFSIZE_INITIAL; for (;;) { iter->buf6 = isc_mem_get(iter->mctx, iter->bufsize6); if (iter->buf6 == NULL) return (ISC_R_NOMEMORY); memset(&iter->lifc, 0, sizeof(iter->lifc)); #ifdef ISC_HAVE_LIFC_FAMILY iter->lifc.lifc_family = AF_INET6; #endif #ifdef ISC_HAVE_LIFC_FLAGS iter->lifc.lifc_flags = 0; #endif iter->lifc.lifc_len = iter->bufsize6; iter->lifc.lifc_buf = iter->buf6; /* * Ignore the HP/UX warning about "integer overflow during * conversion". It comes from its own macro definition, * and is really hard to shut up. */ if (ioctl(iter->socket6, SIOCGLIFCONF, (char *)&iter->lifc) == -1) { #ifdef __hpux /* * IPv6 interface scanning is not available on all * kernels w/ IPv6 sockets. */ if (errno == ENOENT) { isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_INTERFACE, ISC_LOG_DEBUG(1), isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_GETIFCONFIG, "get interface " "configuration: %s"), strbuf); result = ISC_R_FAILURE; goto cleanup; } #endif if (errno != EINVAL) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_GETIFCONFIG, "get interface " "configuration: %s"), strbuf); result = ISC_R_UNEXPECTED; goto cleanup; } /* * EINVAL. Retry with a bigger buffer. */ } else { /* * The ioctl succeeded. * Some OS's just return what will fit rather * than set EINVAL if the buffer is too small * to fit all the interfaces in. If * ifc.ifc_len is too near to the end of the * buffer we will grow it just in case and * retry. */ if (iter->lifc.lifc_len + 2 * sizeof(struct LIFREQ) < iter->bufsize6) break; } if (iter->bufsize6 >= IFCONF_BUFSIZE_MAX) { UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_BUFFERMAX, "get interface " "configuration: " "maximum buffer " "size exceeded")); result = ISC_R_UNEXPECTED; goto cleanup; } isc_mem_put(iter->mctx, iter->buf6, iter->bufsize6); iter->bufsize6 *= 2; } if (iter->lifc.lifc_len != 0) iter->mode = 6; return (ISC_R_SUCCESS); cleanup: isc_mem_put(iter->mctx, iter->buf6, iter->bufsize6); iter->buf6 = NULL; return (result); } #endif isc_result_t isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) { isc_interfaceiter_t *iter; isc_result_t result; char strbuf[ISC_STRERRORSIZE]; REQUIRE(mctx != NULL); REQUIRE(iterp != NULL); REQUIRE(*iterp == NULL); iter = isc_mem_get(mctx, sizeof(*iter)); if (iter == NULL) return (ISC_R_NOMEMORY); iter->mctx = mctx; iter->mode = 4; iter->buf = NULL; iter->pos = (unsigned int) -1; #if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) iter->buf6 = NULL; iter->pos6 = (unsigned int) -1; iter->result6 = ISC_R_NOMORE; iter->socket6 = -1; iter->first6 = ISC_FALSE; #endif /* * Get the interface configuration, allocating more memory if * necessary. */ #if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) result = isc_net_probeipv6(); if (result == ISC_R_SUCCESS) { /* * Create an unbound datagram socket to do the SIOCGLIFCONF * ioctl on. HP/UX requires an AF_INET6 socket for * SIOCGLIFCONF to get IPv6 addresses. */ if ((iter->socket6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_MAKESCANSOCKET, "making interface " "scan socket: %s"), strbuf); result = ISC_R_UNEXPECTED; goto socket6_failure; } result = iter->result6 = getbuf6(iter); if (result != ISC_R_NOTIMPLEMENTED && result != ISC_R_SUCCESS) goto ioctl6_failure; } #endif if ((iter->socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_MAKESCANSOCKET, "making interface " "scan socket: %s"), strbuf); result = ISC_R_UNEXPECTED; goto socket_failure; } result = getbuf4(iter); if (result != ISC_R_SUCCESS) goto ioctl_failure; /* * A newly created iterator has an undefined position * until isc_interfaceiter_first() is called. */ #ifdef HAVE_TRUCLUSTER iter->clua_context = -1; iter->clua_done = ISC_TRUE; #endif #ifdef __linux iter->proc = fopen("/proc/net/if_inet6", "r"); iter->valid = ISC_R_FAILURE; #endif iter->result = ISC_R_FAILURE; iter->magic = IFITER_MAGIC; *iterp = iter; return (ISC_R_SUCCESS); ioctl_failure: if (iter->buf != NULL) isc_mem_put(mctx, iter->buf, iter->bufsize); (void) close(iter->socket); socket_failure: #if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) if (iter->buf6 != NULL) isc_mem_put(mctx, iter->buf6, iter->bufsize6); ioctl6_failure: if (iter->socket6 != -1) (void) close(iter->socket6); socket6_failure: #endif isc_mem_put(mctx, iter, sizeof(*iter)); return (result); } #ifdef HAVE_TRUCLUSTER static void get_inaddr(isc_netaddr_t *dst, struct in_addr *src) { dst->family = AF_INET; memcpy(&dst->type.in, src, sizeof(struct in_addr)); } static isc_result_t internal_current_clusteralias(isc_interfaceiter_t *iter) { struct clua_info ci; if (clua_getaliasinfo(&iter->clua_sa, &ci) != CLUA_SUCCESS) return (ISC_R_IGNORE); memset(&iter->current, 0, sizeof(iter->current)); iter->current.af = iter->clua_sa.sa_family; memset(iter->current.name, 0, sizeof(iter->current.name)); sprintf(iter->current.name, "clua%d", ci.aliasid); iter->current.flags = INTERFACE_F_UP; get_inaddr(&iter->current.address, &ci.addr); get_inaddr(&iter->current.netmask, &ci.netmask); return (ISC_R_SUCCESS); } #endif /* * Get information about the current interface to iter->current. * If successful, return ISC_R_SUCCESS. * If the interface has an unsupported address family, or if * some operation on it fails, return ISC_R_IGNORE to make * the higher-level iterator code ignore it. */ static isc_result_t internal_current4(isc_interfaceiter_t *iter) { struct ifreq *ifrp; struct ifreq ifreq; int family; char strbuf[ISC_STRERRORSIZE]; #if !defined(ISC_PLATFORM_HAVEIF_LADDRREQ) && defined(SIOCGLIFADDR) struct lifreq lifreq; #else char sabuf[256]; #endif int i, bits, prefixlen; REQUIRE(VALID_IFITER(iter)); if (iter->ifc.ifc_len == 0 || iter->pos == (unsigned int)iter->ifc.ifc_len) { #ifdef __linux return (linux_if_inet6_current(iter)); #else return (ISC_R_NOMORE); #endif } INSIST( iter->pos < (unsigned int) iter->ifc.ifc_len); ifrp = (struct ifreq *)((char *) iter->ifc.ifc_req + iter->pos); memset(&ifreq, 0, sizeof(ifreq)); memcpy(&ifreq, ifrp, sizeof(ifreq)); family = ifreq.ifr_addr.sa_family; #if defined(ISC_PLATFORM_HAVEIPV6) if (family != AF_INET && family != AF_INET6) #else if (family != AF_INET) #endif return (ISC_R_IGNORE); memset(&iter->current, 0, sizeof(iter->current)); iter->current.af = family; INSIST(sizeof(ifreq.ifr_name) <= sizeof(iter->current.name)); memset(iter->current.name, 0, sizeof(iter->current.name)); memcpy(iter->current.name, ifreq.ifr_name, sizeof(ifreq.ifr_name)); get_addr(family, &iter->current.address, (struct sockaddr *)&ifrp->ifr_addr, ifreq.ifr_name); /* * If the interface does not have a address ignore it. */ switch (family) { case AF_INET: if (iter->current.address.type.in.s_addr == htonl(INADDR_ANY)) return (ISC_R_IGNORE); break; case AF_INET6: if (memcmp(&iter->current.address.type.in6, &in6addr_any, sizeof(in6addr_any)) == 0) return (ISC_R_IGNORE); break; } /* * Get interface flags. */ iter->current.flags = 0; /* * Ignore the HP/UX warning about "integer overflow during * conversion. It comes from its own macro definition, * and is really hard to shut up. */ if (ioctl(iter->socket, SIOCGIFFLAGS, (char *) &ifreq) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "%s: getting interface flags: %s", ifreq.ifr_name, strbuf); return (ISC_R_IGNORE); } if ((ifreq.ifr_flags & IFF_UP) != 0) iter->current.flags |= INTERFACE_F_UP; #ifdef IFF_POINTOPOINT if ((ifreq.ifr_flags & IFF_POINTOPOINT) != 0) iter->current.flags |= INTERFACE_F_POINTTOPOINT; #endif if ((ifreq.ifr_flags & IFF_LOOPBACK) != 0) iter->current.flags |= INTERFACE_F_LOOPBACK; if ((ifreq.ifr_flags & IFF_BROADCAST) != 0) iter->current.flags |= INTERFACE_F_BROADCAST; #ifdef IFF_MULTICAST if ((ifreq.ifr_flags & IFF_MULTICAST) != 0) iter->current.flags |= INTERFACE_F_MULTICAST; #endif if (family == AF_INET) goto inet; #if !defined(ISC_PLATFORM_HAVEIF_LADDRREQ) && defined(SIOCGLIFADDR) memset(&lifreq, 0, sizeof(lifreq)); memcpy(lifreq.lifr_name, iter->current.name, sizeof(lifreq.lifr_name)); memcpy(&lifreq.lifr_addr, &iter->current.address.type.in6, sizeof(iter->current.address.type.in6)); if (ioctl(iter->socket, SIOCGLIFADDR, &lifreq) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "%s: getting interface address: %s", ifreq.ifr_name, strbuf); return (ISC_R_IGNORE); } prefixlen = lifreq.lifr_addrlen; #else isc_netaddr_format(&iter->current.address, sabuf, sizeof(sabuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_INTERFACE, ISC_LOG_INFO, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_GETIFCONFIG, "prefix length for %s is unknown " "(assume 128)"), sabuf); prefixlen = 128; #endif /* * Netmask already zeroed. */ iter->current.netmask.family = family; for (i = 0; i < 16; i++) { if (prefixlen > 8) { bits = 0; prefixlen -= 8; } else { bits = 8 - prefixlen; prefixlen = 0; } iter->current.netmask.type.in6.s6_addr[i] = (~0 << bits) & 0xff; } return (ISC_R_SUCCESS); inet: if (family != AF_INET) return (ISC_R_IGNORE); #ifdef IFF_POINTOPOINT /* * If the interface is point-to-point, get the destination address. */ if ((iter->current.flags & INTERFACE_F_POINTTOPOINT) != 0) { /* * Ignore the HP/UX warning about "integer overflow during * conversion. It comes from its own macro definition, * and is really hard to shut up. */ if (ioctl(iter->socket, SIOCGIFDSTADDR, (char *)&ifreq) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_GETDESTADDR, "%s: getting " "destination address: %s"), ifreq.ifr_name, strbuf); return (ISC_R_IGNORE); } get_addr(family, &iter->current.dstaddress, (struct sockaddr *)&ifreq.ifr_dstaddr, ifreq.ifr_name); } #endif if ((iter->current.flags & INTERFACE_F_BROADCAST) != 0) { /* * Ignore the HP/UX warning about "integer overflow during * conversion. It comes from its own macro definition, * and is really hard to shut up. */ if (ioctl(iter->socket, SIOCGIFBRDADDR, (char *)&ifreq) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_GETBCSTADDR, "%s: getting " "broadcast address: %s"), ifreq.ifr_name, strbuf); return (ISC_R_IGNORE); } get_addr(family, &iter->current.broadcast, (struct sockaddr *)&ifreq.ifr_broadaddr, ifreq.ifr_name); } /* * Get the network mask. */ memset(&ifreq, 0, sizeof(ifreq)); memcpy(&ifreq, ifrp, sizeof(ifreq)); /* * Ignore the HP/UX warning about "integer overflow during * conversion. It comes from its own macro definition, * and is really hard to shut up. */ if (ioctl(iter->socket, SIOCGIFNETMASK, (char *)&ifreq) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_GETNETMASK, "%s: getting netmask: %s"), ifreq.ifr_name, strbuf); return (ISC_R_IGNORE); } get_addr(family, &iter->current.netmask, (struct sockaddr *)&ifreq.ifr_addr, ifreq.ifr_name); return (ISC_R_SUCCESS); } #if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) static isc_result_t internal_current6(isc_interfaceiter_t *iter) { struct LIFREQ *ifrp; struct LIFREQ lifreq; int family; char strbuf[ISC_STRERRORSIZE]; int fd; REQUIRE(VALID_IFITER(iter)); if (iter->result6 != ISC_R_SUCCESS) return (iter->result6); REQUIRE(iter->pos6 < (unsigned int) iter->lifc.lifc_len); ifrp = (struct LIFREQ *)((char *) iter->lifc.lifc_req + iter->pos6); memset(&lifreq, 0, sizeof(lifreq)); memcpy(&lifreq, ifrp, sizeof(lifreq)); family = lifreq.lifr_addr.ss_family; #ifdef ISC_PLATFORM_HAVEIPV6 if (family != AF_INET && family != AF_INET6) #else if (family != AF_INET) #endif return (ISC_R_IGNORE); memset(&iter->current, 0, sizeof(iter->current)); iter->current.af = family; INSIST(sizeof(lifreq.lifr_name) <= sizeof(iter->current.name)); memset(iter->current.name, 0, sizeof(iter->current.name)); memcpy(iter->current.name, lifreq.lifr_name, sizeof(lifreq.lifr_name)); 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); /* * If the interface does not have a address ignore it. */ switch (family) { case AF_INET: if (iter->current.address.type.in.s_addr == htonl(INADDR_ANY)) return (ISC_R_IGNORE); break; case AF_INET6: if (memcmp(&iter->current.address.type.in6, &in6addr_any, sizeof(in6addr_any)) == 0) return (ISC_R_IGNORE); break; } /* * Get interface flags. */ iter->current.flags = 0; if (family == AF_INET6) fd = iter->socket6; else fd = iter->socket; /* * Ignore the HP/UX warning about "integer overflow during * conversion. It comes from its own macro definition, * and is really hard to shut up. */ if (ioctl(fd, SIOCGLIFFLAGS, (char *) &lifreq) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "%s: getting interface flags: %s", lifreq.lifr_name, strbuf); return (ISC_R_IGNORE); } if ((lifreq.lifr_flags & IFF_UP) != 0) iter->current.flags |= INTERFACE_F_UP; #ifdef IFF_POINTOPOINT if ((lifreq.lifr_flags & IFF_POINTOPOINT) != 0) iter->current.flags |= INTERFACE_F_POINTTOPOINT; #endif if ((lifreq.lifr_flags & IFF_LOOPBACK) != 0) iter->current.flags |= INTERFACE_F_LOOPBACK; if ((lifreq.lifr_flags & IFF_BROADCAST) != 0) { iter->current.flags |= INTERFACE_F_BROADCAST; } #ifdef IFF_MULTICAST if ((lifreq.lifr_flags & IFF_MULTICAST) != 0) { iter->current.flags |= INTERFACE_F_MULTICAST; } #endif #ifdef IFF_POINTOPOINT /* * If the interface is point-to-point, get the destination address. */ if ((iter->current.flags & INTERFACE_F_POINTTOPOINT) != 0) { /* * Ignore the HP/UX warning about "integer overflow during * conversion. It comes from its own macro definition, * and is really hard to shut up. */ if (ioctl(fd, SIOCGLIFDSTADDR, (char *)&lifreq) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_GETDESTADDR, "%s: getting " "destination address: %s"), lifreq.lifr_name, strbuf); return (ISC_R_IGNORE); } get_addr(family, &iter->current.dstaddress, (struct sockaddr *)&lifreq.lifr_dstaddr, lifreq.lifr_name); } #endif #ifdef SIOCGLIFBRDADDR if ((iter->current.flags & INTERFACE_F_BROADCAST) != 0) { /* * Ignore the HP/UX warning about "integer overflow during * conversion. It comes from its own macro definition, * and is really hard to shut up. */ if (ioctl(iter->socket, SIOCGLIFBRDADDR, (char *)&lifreq) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_GETBCSTADDR, "%s: getting " "broadcast address: %s"), lifreq.lifr_name, strbuf); return (ISC_R_IGNORE); } get_addr(family, &iter->current.broadcast, (struct sockaddr *)&lifreq.lifr_broadaddr, lifreq.lifr_name); } #endif /* SIOCGLIFBRDADDR */ /* * Get the network mask. Netmask already zeroed. */ memset(&lifreq, 0, sizeof(lifreq)); memcpy(&lifreq, ifrp, sizeof(lifreq)); #ifdef lifr_addrlen /* * Special case: if the system provides lifr_addrlen member, the * netmask of an IPv6 address can be derived from the length, since * an IPv6 address always has a contiguous mask. */ if (family == AF_INET6) { int i, bits; iter->current.netmask.family = family; for (i = 0; i < lifreq.lifr_addrlen; i += 8) { bits = lifreq.lifr_addrlen - i; bits = (bits < 8) ? (8 - bits) : 0; iter->current.netmask.type.in6.s6_addr[i / 8] = (~0 << bits) & 0xff; } return (ISC_R_SUCCESS); } #endif /* * Ignore the HP/UX warning about "integer overflow during * conversion. It comes from its own macro definition, * and is really hard to shut up. */ if (ioctl(fd, SIOCGLIFNETMASK, (char *)&lifreq) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERIOCTL, ISC_MSG_GETNETMASK, "%s: getting netmask: %s"), lifreq.lifr_name, strbuf); return (ISC_R_IGNORE); } get_addr(family, &iter->current.netmask, (struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name); return (ISC_R_SUCCESS); } #endif static isc_result_t internal_current(isc_interfaceiter_t *iter) { #if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) if (iter->mode == 6) { iter->result6 = internal_current6(iter); if (iter->result6 != ISC_R_NOMORE) return (iter->result6); } #endif #ifdef HAVE_TRUCLUSTER if (!iter->clua_done) return(internal_current_clusteralias(iter)); #endif return (internal_current4(iter)); } /* * Step the iterator to the next interface. Unlike * isc_interfaceiter_next(), this may leave the iterator * positioned on an interface that will ultimately * be ignored. Return ISC_R_NOMORE if there are no more * interfaces, otherwise ISC_R_SUCCESS. */ static isc_result_t internal_next4(isc_interfaceiter_t *iter) { #ifdef ISC_PLATFORM_HAVESALEN struct ifreq *ifrp; #endif if (iter->pos < (unsigned int) iter->ifc.ifc_len) { #ifdef ISC_PLATFORM_HAVESALEN ifrp = (struct ifreq *)((char *) iter->ifc.ifc_req + iter->pos); if (ifrp->ifr_addr.sa_len > sizeof(struct sockaddr)) iter->pos += sizeof(ifrp->ifr_name) + ifrp->ifr_addr.sa_len; else #endif iter->pos += sizeof(struct ifreq); } else { INSIST(iter->pos == (unsigned int) iter->ifc.ifc_len); #ifdef __linux return (linux_if_inet6_next(iter)); #else return (ISC_R_NOMORE); #endif } return (ISC_R_SUCCESS); } #if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) static isc_result_t internal_next6(isc_interfaceiter_t *iter) { #ifdef ISC_PLATFORM_HAVESALEN struct LIFREQ *ifrp; #endif if (iter->result6 != ISC_R_SUCCESS && iter->result6 != ISC_R_IGNORE) return (iter->result6); REQUIRE(iter->pos6 < (unsigned int) iter->lifc.lifc_len); #ifdef ISC_PLATFORM_HAVESALEN ifrp = (struct LIFREQ *)((char *) iter->lifc.lifc_req + iter->pos6); if (ifrp->lifr_addr.sa_len > sizeof(struct sockaddr)) iter->pos6 += sizeof(ifrp->lifr_name) + ifrp->lifr_addr.sa_len; else #endif iter->pos6 += sizeof(struct LIFREQ); if (iter->pos6 >= (unsigned int) iter->lifc.lifc_len) return (ISC_R_NOMORE); return (ISC_R_SUCCESS); } #endif static isc_result_t internal_next(isc_interfaceiter_t *iter) { #ifdef HAVE_TRUCLUSTER int clua_result; #endif #if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) if (iter->mode == 6) { iter->result6 = internal_next6(iter); if (iter->result6 != ISC_R_NOMORE) return (iter->result6); if (iter->first6) { iter->first6 = ISC_FALSE; return (ISC_R_SUCCESS); } } #endif #ifdef HAVE_TRUCLUSTER if (!iter->clua_done) { clua_result = clua_getaliasaddress(&iter->clua_sa, &iter->clua_context); if (clua_result != CLUA_SUCCESS) iter->clua_done = ISC_TRUE; return (ISC_R_SUCCESS); } #endif return (internal_next4(iter)); } static void internal_destroy(isc_interfaceiter_t *iter) { (void) close(iter->socket); #if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) if (iter->socket6 != -1) (void) close(iter->socket6); if (iter->buf6 != NULL) { isc_mem_put(iter->mctx, iter->buf6, iter->bufsize6); } #endif #ifdef __linux if (iter->proc != NULL) fclose(iter->proc); #endif } static void internal_first(isc_interfaceiter_t *iter) { #ifdef HAVE_TRUCLUSTER int clua_result; #endif iter->pos = 0; #if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) iter->pos6 = 0; if (iter->result6 == ISC_R_NOMORE) iter->result6 = ISC_R_SUCCESS; iter->first6 = ISC_TRUE; #endif #ifdef HAVE_TRUCLUSTER iter->clua_context = 0; clua_result = clua_getaliasaddress(&iter->clua_sa, &iter->clua_context); iter->clua_done = ISC_TF(clua_result != CLUA_SUCCESS); #endif #ifdef __linux linux_if_inet6_first(iter); #endif } ntp-4.2.6p5/lib/isc/unix/stdtime.c0000644000175000017500000000413511307651603015742 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: stdtime.c,v 1.19 2007/06/19 23:47:18 tbox Exp $ */ /*! \file */ #include #include /* NULL */ #include /* NULL */ #include #include #include #include #ifndef ISC_FIX_TV_USEC #define ISC_FIX_TV_USEC 1 #endif #define US_PER_S 1000000 #if ISC_FIX_TV_USEC static inline void fix_tv_usec(struct timeval *tv) { isc_boolean_t fixed = ISC_FALSE; if (tv->tv_usec < 0) { fixed = ISC_TRUE; do { tv->tv_sec -= 1; tv->tv_usec += US_PER_S; } while (tv->tv_usec < 0); } else if (tv->tv_usec >= US_PER_S) { fixed = ISC_TRUE; do { tv->tv_sec += 1; tv->tv_usec -= US_PER_S; } while (tv->tv_usec >=US_PER_S); } /* * Call syslog directly as we are called from the logging functions. */ if (fixed) (void)syslog(LOG_ERR, "gettimeofday returned bad tv_usec: corrected"); } #endif void isc_stdtime_get(isc_stdtime_t *t) { struct timeval tv; /* * Set 't' to the number of seconds since 00:00:00 UTC, January 1, * 1970. */ REQUIRE(t != NULL); RUNTIME_CHECK(gettimeofday(&tv, NULL) != -1); #if ISC_FIX_TV_USEC fix_tv_usec(&tv); INSIST(tv.tv_usec >= 0); #else INSIST(tv.tv_usec >= 0 && tv.tv_usec < US_PER_S); #endif *t = (unsigned int)tv.tv_sec; } ntp-4.2.6p5/lib/isc/unix/strerror.c0000644000175000017500000000412111307651603016146 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: strerror.c,v 1.8.332.2 2009/02/16 23:47:15 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include #include "l_stdlib.h" /* NTP local change */ #ifdef HAVE_STRERROR /*% * We need to do this this way for profiled locks. */ static isc_mutex_t isc_strerror_lock; static void init_lock(void) { RUNTIME_CHECK(isc_mutex_init(&isc_strerror_lock) == ISC_R_SUCCESS); } #else extern const char * const sys_errlist[]; extern const int sys_nerr; #endif void isc__strerror(int num, char *buf, size_t size) { #ifdef HAVE_STRERROR char *msg; unsigned int unum = (unsigned int)num; static isc_once_t once = ISC_ONCE_INIT; REQUIRE(buf != NULL); RUNTIME_CHECK(isc_once_do(&once, init_lock) == ISC_R_SUCCESS); LOCK(&isc_strerror_lock); msg = strerror(num); if (msg != NULL) snprintf(buf, size, "%s", msg); else snprintf(buf, size, "Unknown error: %u", unum); UNLOCK(&isc_strerror_lock); #else unsigned int unum = (unsigned int)num; REQUIRE(buf != NULL); if (num >= 0 && num < sys_nerr) snprintf(buf, size, "%s", sys_errlist[num]); else snprintf(buf, size, "Unknown error: %u", unum); #endif } ntp-4.2.6p5/lib/isc/unix/interfaceiter.c0000644000175000017500000002226411616416170017121 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: interfaceiter.c,v 1.44.120.2 2009/02/16 23:47:15 tbox Exp $ */ /*! \file */ #include #include #include #ifdef HAVE_SYS_SOCKIO_H #include /* Required for ifiter_ioctl.c. */ #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Must follow . */ #ifdef HAVE_NET_IF6_H #include #endif #include #ifdef HAVE_LINUX_IF_ADDR_H # include #endif /* Common utility functions */ /*% * Extract the network address part from a "struct sockaddr". * \brief * The address family is given explicitly * instead of using src->sa_family, because the latter does not work * for copying a network mask obtained by SIOCGIFNETMASK (it does * not have a valid address family). */ static void get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src, char *ifname) { struct sockaddr_in6 *sa6; #if !defined(ISC_PLATFORM_HAVEIFNAMETOINDEX) || \ !defined(ISC_PLATFORM_HAVESCOPEID) UNUSED(ifname); #endif /* clear any remaining value for safety */ memset(dst, 0, sizeof(*dst)); dst->family = family; switch (family) { case AF_INET: memcpy(&dst->type.in, &((struct sockaddr_in *)(void *)src)->sin_addr, sizeof(struct in_addr)); break; case AF_INET6: sa6 = (struct sockaddr_in6 *)(void *)src; memcpy(&dst->type.in6, &sa6->sin6_addr, sizeof(struct in6_addr)); #ifdef ISC_PLATFORM_HAVESCOPEID if (sa6->sin6_scope_id != 0) isc_netaddr_setzone(dst, sa6->sin6_scope_id); else { /* * BSD variants embed scope zone IDs in the 128bit * address as a kernel internal form. Unfortunately, * the embedded IDs are not hidden from applications * when getting access to them by sysctl or ioctl. * We convert the internal format to the pure address * part and the zone ID part. * Since multicast addresses should not appear here * and they cannot be distinguished from netmasks, * we only consider unicast link-local addresses. */ if (IN6_IS_ADDR_LINKLOCAL(&sa6->sin6_addr)) { isc_uint16_t zone16; memcpy(&zone16, &sa6->sin6_addr.s6_addr[2], sizeof(zone16)); zone16 = ntohs(zone16); if (zone16 != 0) { /* the zone ID is embedded */ isc_netaddr_setzone(dst, (isc_uint32_t)zone16); dst->type.in6.s6_addr[2] = 0; dst->type.in6.s6_addr[3] = 0; #ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX } else if (ifname != NULL) { unsigned int zone; /* * sin6_scope_id is still not provided, * but the corresponding interface name * is know. Use the interface ID as * the link ID. */ zone = if_nametoindex(ifname); if (zone != 0) { isc_netaddr_setzone(dst, (isc_uint32_t)zone); } #endif } } } #endif break; default: INSIST(0); break; } } /* * Include system-dependent code. */ #ifdef __linux #define ISC_IF_INET6_SZ \ sizeof("00000000000000000000000000000001 01 80 10 80 XXXXXXloXXXXXXXX\n") static isc_result_t linux_if_inet6_next(isc_interfaceiter_t *); static isc_result_t linux_if_inet6_current(isc_interfaceiter_t *); static void linux_if_inet6_first(isc_interfaceiter_t *iter); #endif #if HAVE_GETIFADDRS #include "ifiter_getifaddrs.c" #elif HAVE_IFLIST_SYSCTL #include "ifiter_sysctl.c" #else #include "ifiter_ioctl.c" #endif #ifdef __linux static void linux_if_inet6_first(isc_interfaceiter_t *iter) { if (iter->proc != NULL) { rewind(iter->proc); (void)linux_if_inet6_next(iter); } else iter->valid = ISC_R_NOMORE; } static isc_result_t linux_if_inet6_next(isc_interfaceiter_t *iter) { if (iter->proc != NULL && fgets(iter->entry, sizeof(iter->entry), iter->proc) != NULL) iter->valid = ISC_R_SUCCESS; else iter->valid = ISC_R_NOMORE; return (iter->valid); } static isc_result_t linux_if_inet6_current(isc_interfaceiter_t *iter) { char address[33]; char name[IF_NAMESIZE+1]; char strbuf[ISC_STRERRORSIZE]; struct in6_addr addr6; unsigned int ifindex; int prefix, scope, flags; struct ifreq ifreq; int res; unsigned int i; if (iter->valid != ISC_R_SUCCESS) return (iter->valid); if (iter->proc == NULL) { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_INTERFACE, ISC_LOG_ERROR, "/proc/net/if_inet6:iter->proc == NULL"); return (ISC_R_FAILURE); } res = sscanf(iter->entry, "%32[a-f0-9] %x %x %x %x %16s\n", address, &ifindex, &prefix, &scope, &flags, name); if (res != 6) { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_INTERFACE, ISC_LOG_ERROR, "/proc/net/if_inet6:sscanf() -> %d (expected 6)", res); return (ISC_R_FAILURE); } if (strlen(address) != 32) { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_INTERFACE, ISC_LOG_ERROR, "/proc/net/if_inet6:strlen(%s) != 32", address); return (ISC_R_FAILURE); } /* ** Ignore DAD addresses -- ** we can't bind to them until they are resolved */ #ifdef IFA_F_TENTATIVE if (flags & IFA_F_TENTATIVE) return (ISC_R_IGNORE); #endif for (i = 0; i < 16; i++) { unsigned char byte; static const char hex[] = "0123456789abcdef"; byte = ((strchr(hex, address[i * 2]) - hex) << 4) | (strchr(hex, address[i * 2 + 1]) - hex); addr6.s6_addr[i] = byte; } iter->current.af = AF_INET6; iter->current.flags = 0; memset(&ifreq, 0, sizeof(ifreq)); INSIST(sizeof(ifreq.ifr_name) <= sizeof(iter->current.name)); strncpy(ifreq.ifr_name, name, sizeof(ifreq.ifr_name)); if (ioctl(iter->socket, SIOCGIFFLAGS, (char *) &ifreq) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "%s: getting interface flags: %s", ifreq.ifr_name, strbuf); return (ISC_R_IGNORE); } if ((ifreq.ifr_flags & IFF_UP) != 0) iter->current.flags |= INTERFACE_F_UP; #ifdef IFF_POINTOPOINT if ((ifreq.ifr_flags & IFF_POINTOPOINT) != 0) iter->current.flags |= INTERFACE_F_POINTTOPOINT; #endif if ((ifreq.ifr_flags & IFF_LOOPBACK) != 0) iter->current.flags |= INTERFACE_F_LOOPBACK; if ((ifreq.ifr_flags & IFF_BROADCAST) != 0) iter->current.flags |= INTERFACE_F_BROADCAST; #ifdef IFF_MULTICAST if ((ifreq.ifr_flags & IFF_MULTICAST) != 0) iter->current.flags |= INTERFACE_F_MULTICAST; #endif isc_netaddr_fromin6(&iter->current.address, &addr6); iter->current.ifindex = ifindex; if (isc_netaddr_islinklocal(&iter->current.address)) { isc_netaddr_setzone(&iter->current.address, (isc_uint32_t)ifindex); } for (i = 0; i < 16; i++) { if (prefix > 8) { addr6.s6_addr[i] = 0xff; prefix -= 8; } else { addr6.s6_addr[i] = (0xff << (8 - prefix)) & 0xff; prefix = 0; } } isc_netaddr_fromin6(&iter->current.netmask, &addr6); strncpy(iter->current.name, name, sizeof(iter->current.name)); return (ISC_R_SUCCESS); } #endif /* * The remaining code is common to the sysctl and ioctl case. */ isc_result_t isc_interfaceiter_current(isc_interfaceiter_t *iter, isc_interface_t *ifdata) { REQUIRE(iter->result == ISC_R_SUCCESS); memcpy(ifdata, &iter->current, sizeof(*ifdata)); return (ISC_R_SUCCESS); } isc_result_t isc_interfaceiter_first(isc_interfaceiter_t *iter) { isc_result_t result; REQUIRE(VALID_IFITER(iter)); internal_first(iter); for (;;) { result = internal_current(iter); if (result != ISC_R_IGNORE) break; result = internal_next(iter); if (result != ISC_R_SUCCESS) break; } iter->result = result; return (result); } isc_result_t isc_interfaceiter_next(isc_interfaceiter_t *iter) { isc_result_t result; REQUIRE(VALID_IFITER(iter)); REQUIRE(iter->result == ISC_R_SUCCESS); for (;;) { result = internal_next(iter); if (result != ISC_R_SUCCESS) break; result = internal_current(iter); if (result != ISC_R_IGNORE) break; } iter->result = result; return (result); } void isc_interfaceiter_destroy(isc_interfaceiter_t **iterp) { isc_interfaceiter_t *iter; REQUIRE(iterp != NULL); iter = *iterp; REQUIRE(VALID_IFITER(iter)); internal_destroy(iter); if (iter->buf != NULL) isc_mem_put(iter->mctx, iter->buf, iter->bufsize); iter->magic = 0; isc_mem_put(iter->mctx, iter, sizeof(*iter)); *iterp = NULL; } ntp-4.2.6p5/lib/isc/unix/file.c0000644000175000017500000002635311307651605015220 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* * Portions Copyright (c) 1987, 1993 * The Regents of the University of California. 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ /* $Id: file.c,v 1.51.332.2 2009/02/16 23:47:15 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include /* Required for utimes on some platforms. */ #include /* Required for mkstemp on NetBSD. */ #include #include #include #include #include #include #include #include #include #include "errno2result.h" /* * XXXDCL As the API for accessing file statistics undoubtedly gets expanded, * it might be good to provide a mechanism that allows for the results * of a previous stat() to be used again without having to do another stat, * such as perl's mechanism of using "_" in place of a file name to indicate * that the results of the last stat should be used. But then you get into * annoying MP issues. BTW, Win32 has stat(). */ static isc_result_t file_stats(const char *file, struct stat *stats) { isc_result_t result = ISC_R_SUCCESS; REQUIRE(file != NULL); REQUIRE(stats != NULL); if (stat(file, stats) != 0) result = isc__errno2result(errno); return (result); } isc_result_t isc_file_getmodtime(const char *file, isc_time_t *time) { isc_result_t result; struct stat stats; REQUIRE(file != NULL); REQUIRE(time != NULL); result = file_stats(file, &stats); if (result == ISC_R_SUCCESS) /* * XXXDCL some operating systems provide nanoseconds, too, * such as BSD/OS via st_mtimespec. */ isc_time_set(time, stats.st_mtime, 0); return (result); } isc_result_t isc_file_settime(const char *file, isc_time_t *time) { struct timeval times[2]; REQUIRE(file != NULL && time != NULL); /* * tv_sec is at least a 32 bit quantity on all platforms we're * dealing with, but it is signed on most (all?) of them, * so we need to make sure the high bit isn't set. This unfortunately * loses when either: * * tv_sec becomes a signed 64 bit integer but long is 32 bits * and isc_time_seconds > LONG_MAX, or * * isc_time_seconds is changed to be > 32 bits but long is 32 bits * and isc_time_seconds has at least 33 significant bits. */ times[0].tv_sec = times[1].tv_sec = (long)isc_time_seconds(time); /* * Here is the real check for the high bit being set. */ if ((times[0].tv_sec & (1ULL << (sizeof(times[0].tv_sec) * CHAR_BIT - 1))) != 0) return (ISC_R_RANGE); /* * isc_time_nanoseconds guarantees a value that divided by 1000 will * fit into the minimum possible size tv_usec field. Unfortunately, * we don't know what that type is so can't cast directly ... but * we can at least cast to signed so the IRIX compiler shuts up. */ times[0].tv_usec = times[1].tv_usec = (isc_int32_t)(isc_time_nanoseconds(time) / 1000); if (utimes(file, times) < 0) return (isc__errno2result(errno)); return (ISC_R_SUCCESS); } #undef TEMPLATE #define TEMPLATE "tmp-XXXXXXXXXX" /*%< 14 characters. */ isc_result_t isc_file_mktemplate(const char *path, char *buf, size_t buflen) { return (isc_file_template(path, TEMPLATE, buf, buflen)); } isc_result_t isc_file_template(const char *path, const char *templet, char *buf, size_t buflen) { char *s; REQUIRE(path != NULL); REQUIRE(templet != NULL); REQUIRE(buf != NULL); s = strrchr(templet, '/'); if (s != NULL) templet = s + 1; s = strrchr(path, '/'); if (s != NULL) { if ((s - path + 1 + strlen(templet) + 1) > buflen) return (ISC_R_NOSPACE); strncpy(buf, path, s - path + 1); buf[s - path + 1] = '\0'; strcat(buf, templet); } else { if ((strlen(templet) + 1) > buflen) return (ISC_R_NOSPACE); strcpy(buf, templet); } return (ISC_R_SUCCESS); } static char alphnum[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; isc_result_t isc_file_renameunique(const char *file, char *templet) { char *x; char *cp; isc_uint32_t which; REQUIRE(file != NULL); REQUIRE(templet != NULL); cp = templet; while (*cp != '\0') cp++; if (cp == templet) return (ISC_R_FAILURE); x = cp--; while (cp >= templet && *cp == 'X') { isc_random_get(&which); *cp = alphnum[which % (sizeof(alphnum) - 1)]; x = cp--; } while (link(file, templet) == -1) { if (errno != EEXIST) return (isc__errno2result(errno)); for (cp = x;;) { char *t; if (*cp == '\0') return (ISC_R_FAILURE); t = strchr(alphnum, *cp); if (t == NULL || *++t == '\0') *cp++ = alphnum[0]; else { *cp = *t; break; } } } if (unlink(file) < 0) if (errno != ENOENT) return (isc__errno2result(errno)); return (ISC_R_SUCCESS); } isc_result_t isc_file_openunique(char *templet, FILE **fp) { int fd; FILE *f; isc_result_t result = ISC_R_SUCCESS; char *x; char *cp; isc_uint32_t which; int mode; REQUIRE(templet != NULL); REQUIRE(fp != NULL && *fp == NULL); cp = templet; while (*cp != '\0') cp++; if (cp == templet) return (ISC_R_FAILURE); x = cp--; while (cp >= templet && *cp == 'X') { isc_random_get(&which); *cp = alphnum[which % (sizeof(alphnum) - 1)]; x = cp--; } mode = S_IWUSR|S_IRUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH; while ((fd = open(templet, O_RDWR|O_CREAT|O_EXCL, mode)) == -1) { if (errno != EEXIST) return (isc__errno2result(errno)); for (cp = x;;) { char *t; if (*cp == '\0') return (ISC_R_FAILURE); t = strchr(alphnum, *cp); if (t == NULL || *++t == '\0') *cp++ = alphnum[0]; else { *cp = *t; break; } } } f = fdopen(fd, "w+"); if (f == NULL) { result = isc__errno2result(errno); if (remove(templet) < 0) { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_FILE, ISC_LOG_ERROR, "remove '%s': failed", templet); } (void)close(fd); } else *fp = f; return (result); } isc_result_t isc_file_remove(const char *filename) { int r; REQUIRE(filename != NULL); r = unlink(filename); if (r == 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } isc_result_t isc_file_rename(const char *oldname, const char *newname) { int r; REQUIRE(oldname != NULL); REQUIRE(newname != NULL); r = rename(oldname, newname); if (r == 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } isc_boolean_t isc_file_exists(const char *pathname) { struct stat stats; REQUIRE(pathname != NULL); return (ISC_TF(file_stats(pathname, &stats) == ISC_R_SUCCESS)); } isc_boolean_t isc_file_isabsolute(const char *filename) { REQUIRE(filename != NULL); return (ISC_TF(filename[0] == '/')); } isc_boolean_t isc_file_iscurrentdir(const char *filename) { REQUIRE(filename != NULL); return (ISC_TF(filename[0] == '.' && filename[1] == '\0')); } isc_boolean_t isc_file_ischdiridempotent(const char *filename) { REQUIRE(filename != NULL); if (isc_file_isabsolute(filename)) return (ISC_TRUE); if (isc_file_iscurrentdir(filename)) return (ISC_TRUE); return (ISC_FALSE); } const char * isc_file_basename(const char *filename) { char *s; REQUIRE(filename != NULL); s = strrchr(filename, '/'); if (s == NULL) return (filename); return (s + 1); } isc_result_t isc_file_progname(const char *filename, char *buf, size_t buflen) { const char *base; size_t len; REQUIRE(filename != NULL); REQUIRE(buf != NULL); base = isc_file_basename(filename); len = strlen(base) + 1; if (len > buflen) return (ISC_R_NOSPACE); memcpy(buf, base, len); return (ISC_R_SUCCESS); } /* * Put the absolute name of the current directory into 'dirname', which is * a buffer of at least 'length' characters. End the string with the * appropriate path separator, such that the final product could be * concatenated with a relative pathname to make a valid pathname string. */ static isc_result_t dir_current(char *dirname, size_t length) { char *cwd; isc_result_t result = ISC_R_SUCCESS; REQUIRE(dirname != NULL); REQUIRE(length > 0U); cwd = getcwd(dirname, length); if (cwd == NULL) { if (errno == ERANGE) result = ISC_R_NOSPACE; else result = isc__errno2result(errno); } else { if (strlen(dirname) + 1 == length) result = ISC_R_NOSPACE; else if (dirname[1] != '\0') strcat(dirname, "/"); } return (result); } isc_result_t isc_file_absolutepath(const char *filename, char *path, size_t pathlen) { isc_result_t result; result = dir_current(path, pathlen); if (result != ISC_R_SUCCESS) return (result); if (strlen(path) + strlen(filename) + 1 > pathlen) return (ISC_R_NOSPACE); strcat(path, filename); return (ISC_R_SUCCESS); } isc_result_t isc_file_truncate(const char *filename, isc_offset_t size) { isc_result_t result = ISC_R_SUCCESS; if (truncate(filename, size) < 0) result = isc__errno2result(errno); return (result); } ntp-4.2.6p5/lib/isc/unix/keyboard.c0000644000175000017500000000576111307651604016100 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: keyboard.c,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include isc_result_t isc_keyboard_open(isc_keyboard_t *keyboard) { int fd; isc_result_t ret; struct termios current_mode; REQUIRE(keyboard != NULL); fd = open("/dev/tty", O_RDONLY, 0); if (fd < 0) return (ISC_R_IOERROR); keyboard->fd = fd; if (tcgetattr(fd, &keyboard->saved_mode) < 0) { ret = ISC_R_IOERROR; goto errout; } current_mode = keyboard->saved_mode; current_mode.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); current_mode.c_oflag &= ~OPOST; current_mode.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); current_mode.c_cflag &= ~(CSIZE|PARENB); current_mode.c_cflag |= CS8; current_mode.c_cc[VMIN] = 1; current_mode.c_cc[VTIME] = 0; if (tcsetattr(fd, TCSAFLUSH, ¤t_mode) < 0) { ret = ISC_R_IOERROR; goto errout; } keyboard->result = ISC_R_SUCCESS; return (ISC_R_SUCCESS); errout: close (fd); return (ret); } isc_result_t isc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleeptime) { REQUIRE(keyboard != NULL); if (sleeptime > 0 && keyboard->result != ISC_R_CANCELED) (void)sleep(sleeptime); (void)tcsetattr(keyboard->fd, TCSAFLUSH, &keyboard->saved_mode); (void)close(keyboard->fd); keyboard->fd = -1; return (ISC_R_SUCCESS); } isc_result_t isc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp) { ssize_t cc; unsigned char c; cc_t *controlchars; REQUIRE(keyboard != NULL); REQUIRE(cp != NULL); cc = read(keyboard->fd, &c, 1); if (cc < 0) { keyboard->result = ISC_R_IOERROR; return (keyboard->result); } controlchars = keyboard->saved_mode.c_cc; if (c == controlchars[VINTR] || c == controlchars[VQUIT]) { keyboard->result = ISC_R_CANCELED; return (keyboard->result); } *cp = c; return (ISC_R_SUCCESS); } isc_boolean_t isc_keyboard_canceled(isc_keyboard_t *keyboard) { return (ISC_TF(keyboard->result == ISC_R_CANCELED)); } ntp-4.2.6p5/lib/isc/unix/entropy.c0000644000175000017500000003364711307651603016003 0ustar peterpeter/* * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: entropy.c,v 1.80.332.2 2009/02/16 23:47:15 tbox Exp $ */ /* \file unix/entropy.c * \brief * This is the system dependent part of the ISC entropy API. */ #include #include /* Openserver 5.0.6A and FD_SETSIZE */ #include #include #include #include #include #ifdef HAVE_NANOSLEEP #include #endif #include #include #include #ifdef ISC_PLATFORM_NEEDSYSSELECTH #include #endif #include "errno2result.h" /*% * There is only one variable in the entropy data structures that is not * system independent, but pulling the structure that uses it into this file * ultimately means pulling several other independent structures here also to * resolve their interdependencies. Thus only the problem variable's type * is defined here. */ #define FILESOURCE_HANDLE_TYPE int typedef struct { int handle; enum { isc_usocketsource_disconnected, isc_usocketsource_connecting, isc_usocketsource_connected, isc_usocketsource_ndesired, isc_usocketsource_wrote, isc_usocketsource_reading } status; size_t sz_to_recv; } isc_entropyusocketsource_t; #include "../entropy.c" static unsigned int get_from_filesource(isc_entropysource_t *source, isc_uint32_t desired) { isc_entropy_t *ent = source->ent; unsigned char buf[128]; int fd = source->sources.file.handle; ssize_t n, ndesired; unsigned int added; if (source->bad) return (0); desired = desired / 8 + (((desired & 0x07) > 0) ? 1 : 0); added = 0; while (desired > 0) { ndesired = ISC_MIN(desired, sizeof(buf)); n = read(fd, buf, ndesired); if (n < 0) { if (errno == EAGAIN || errno == EINTR) goto out; goto err; } if (n == 0) goto err; entropypool_adddata(ent, buf, n, n * 8); added += n * 8; desired -= n; } goto out; err: (void)close(fd); source->sources.file.handle = -1; source->bad = ISC_TRUE; out: return (added); } static unsigned int get_from_usocketsource(isc_entropysource_t *source, isc_uint32_t desired) { isc_entropy_t *ent = source->ent; unsigned char buf[128]; int fd = source->sources.usocket.handle; ssize_t n = 0, ndesired; unsigned int added; size_t sz_to_recv = source->sources.usocket.sz_to_recv; if (source->bad) return (0); desired = desired / 8 + (((desired & 0x07) > 0) ? 1 : 0); added = 0; while (desired > 0) { ndesired = ISC_MIN(desired, sizeof(buf)); eagain_loop: switch ( source->sources.usocket.status ) { case isc_usocketsource_ndesired: buf[0] = ndesired; if ((n = sendto(fd, buf, 1, 0, NULL, 0)) < 0) { if (errno == EWOULDBLOCK || errno == EINTR || errno == ECONNRESET) goto out; goto err; } INSIST(n == 1); source->sources.usocket.status = isc_usocketsource_wrote; goto eagain_loop; case isc_usocketsource_connecting: case isc_usocketsource_connected: buf[0] = 1; buf[1] = ndesired; if ((n = sendto(fd, buf, 2, 0, NULL, 0)) < 0) { if (errno == EWOULDBLOCK || errno == EINTR || errno == ECONNRESET) goto out; goto err; } if (n == 1) { source->sources.usocket.status = isc_usocketsource_ndesired; goto eagain_loop; } INSIST(n == 2); source->sources.usocket.status = isc_usocketsource_wrote; /*FALLTHROUGH*/ case isc_usocketsource_wrote: if (recvfrom(fd, buf, 1, 0, NULL, NULL) != 1) { if (errno == EAGAIN) { /* * The problem of EAGAIN (try again * later) is a major issue on HP-UX. * Solaris actually tries the recvfrom * call again, while HP-UX just dies. * This code is an attempt to let the * entropy pool fill back up (at least * that's what I think the problem is.) * We go to eagain_loop because if we * just "break", then the "desired" * amount gets borked. */ #ifdef HAVE_NANOSLEEP struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = 1000000; nanosleep(&ts, NULL); #else usleep(1000); #endif goto eagain_loop; } if (errno == EWOULDBLOCK || errno == EINTR) goto out; goto err; } source->sources.usocket.status = isc_usocketsource_reading; sz_to_recv = buf[0]; source->sources.usocket.sz_to_recv = sz_to_recv; if (sz_to_recv > sizeof(buf)) goto err; /*FALLTHROUGH*/ case isc_usocketsource_reading: if (sz_to_recv != 0U) { n = recv(fd, buf, sz_to_recv, 0); if (n < 0) { if (errno == EWOULDBLOCK || errno == EINTR) goto out; goto err; } } else n = 0; break; default: goto err; } if ((size_t)n != sz_to_recv) source->sources.usocket.sz_to_recv -= n; else source->sources.usocket.status = isc_usocketsource_connected; if (n == 0) goto out; entropypool_adddata(ent, buf, n, n * 8); added += n * 8; desired -= n; } goto out; err: close(fd); source->bad = ISC_TRUE; source->sources.usocket.status = isc_usocketsource_disconnected; source->sources.usocket.handle = -1; out: return (added); } /* * Poll each source, trying to get data from it to stuff into the entropy * pool. */ static void fillpool(isc_entropy_t *ent, unsigned int desired, isc_boolean_t blocking) { unsigned int added; unsigned int remaining; unsigned int needed; unsigned int nsource; isc_entropysource_t *source; REQUIRE(VALID_ENTROPY(ent)); needed = desired; /* * This logic is a little strange, so an explanation is in order. * * If needed is 0, it means we are being asked to "fill to whatever * we think is best." This means that if we have at least a * partially full pool (say, > 1/4th of the pool) we probably don't * need to add anything. * * Also, we will check to see if the "pseudo" count is too high. * If it is, try to mix in better data. Too high is currently * defined as 1/4th of the pool. * * Next, if we are asked to add a specific bit of entropy, make * certain that we will do so. Clamp how much we try to add to * (DIGEST_SIZE * 8 < needed < POOLBITS - entropy). * * Note that if we are in a blocking mode, we will only try to * get as much data as we need, not as much as we might want * to build up. */ if (needed == 0) { REQUIRE(!blocking); if ((ent->pool.entropy >= RND_POOLBITS / 4) && (ent->pool.pseudo <= RND_POOLBITS / 4)) return; needed = THRESHOLD_BITS * 4; } else { needed = ISC_MAX(needed, THRESHOLD_BITS); needed = ISC_MIN(needed, RND_POOLBITS); } /* * In any case, clamp how much we need to how much we can add. */ needed = ISC_MIN(needed, RND_POOLBITS - ent->pool.entropy); /* * But wait! If we're not yet initialized, we need at least * THRESHOLD_BITS * of randomness. */ if (ent->initialized < THRESHOLD_BITS) needed = ISC_MAX(needed, THRESHOLD_BITS - ent->initialized); /* * Poll each file source to see if we can read anything useful from * it. XXXMLG When where are multiple sources, we should keep a * record of which one we last used so we can start from it (or the * next one) to avoid letting some sources build up entropy while * others are always drained. */ added = 0; remaining = needed; if (ent->nextsource == NULL) { ent->nextsource = ISC_LIST_HEAD(ent->sources); if (ent->nextsource == NULL) return; } source = ent->nextsource; again_file: for (nsource = 0; nsource < ent->nsources; nsource++) { unsigned int got; if (remaining == 0) break; got = 0; switch ( source->type ) { case ENTROPY_SOURCETYPE_FILE: got = get_from_filesource(source, remaining); break; case ENTROPY_SOURCETYPE_USOCKET: got = get_from_usocketsource(source, remaining); break; } added += got; remaining -= ISC_MIN(remaining, got); source = ISC_LIST_NEXT(source, link); if (source == NULL) source = ISC_LIST_HEAD(ent->sources); } ent->nextsource = source; if (blocking && remaining != 0) { int fds; fds = wait_for_sources(ent); if (fds > 0) goto again_file; } /* * Here, if there are bits remaining to be had and we can block, * check to see if we have a callback source. If so, call them. */ source = ISC_LIST_HEAD(ent->sources); while ((remaining != 0) && (source != NULL)) { unsigned int got; got = 0; if (source->type == ENTROPY_SOURCETYPE_CALLBACK) got = get_from_callback(source, remaining, blocking); added += got; remaining -= ISC_MIN(remaining, got); if (added >= needed) break; source = ISC_LIST_NEXT(source, link); } /* * Mark as initialized if we've added enough data. */ if (ent->initialized < THRESHOLD_BITS) ent->initialized += added; } static int wait_for_sources(isc_entropy_t *ent) { isc_entropysource_t *source; int maxfd, fd; int cc; fd_set reads; fd_set writes; maxfd = -1; FD_ZERO(&reads); FD_ZERO(&writes); source = ISC_LIST_HEAD(ent->sources); while (source != NULL) { if (source->type == ENTROPY_SOURCETYPE_FILE) { fd = source->sources.file.handle; if (fd >= 0) { maxfd = ISC_MAX(maxfd, fd); FD_SET(fd, &reads); } } if (source->type == ENTROPY_SOURCETYPE_USOCKET) { fd = source->sources.usocket.handle; if (fd >= 0) { switch (source->sources.usocket.status) { case isc_usocketsource_disconnected: break; case isc_usocketsource_connecting: case isc_usocketsource_connected: case isc_usocketsource_ndesired: maxfd = ISC_MAX(maxfd, fd); FD_SET(fd, &writes); break; case isc_usocketsource_wrote: case isc_usocketsource_reading: maxfd = ISC_MAX(maxfd, fd); FD_SET(fd, &reads); break; } } } source = ISC_LIST_NEXT(source, link); } if (maxfd < 0) return (-1); cc = select(maxfd + 1, &reads, &writes, NULL, NULL); if (cc < 0) return (-1); return (cc); } static void destroyfilesource(isc_entropyfilesource_t *source) { (void)close(source->handle); } static void destroyusocketsource(isc_entropyusocketsource_t *source) { close(source->handle); } /* * Make a fd non-blocking */ static isc_result_t make_nonblock(int fd) { int ret; int flags; char strbuf[ISC_STRERRORSIZE]; #ifdef USE_FIONBIO_IOCTL int on = 1; ret = ioctl(fd, FIONBIO, (char *)&on); #else flags = fcntl(fd, F_GETFL, 0); flags |= PORT_NONBLOCK; ret = fcntl(fd, F_SETFL, flags); #endif if (ret == -1) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, #ifdef USE_FIONBIO_IOCTL "ioctl(%d, FIONBIO, &on): %s", fd, #else "fcntl(%d, F_SETFL, %d): %s", fd, flags, #endif strbuf); return (ISC_R_UNEXPECTED); } return (ISC_R_SUCCESS); } isc_result_t isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) { int fd; struct stat _stat; isc_boolean_t is_usocket = ISC_FALSE; isc_boolean_t is_connected = ISC_FALSE; isc_result_t ret; isc_entropysource_t *source; REQUIRE(VALID_ENTROPY(ent)); REQUIRE(fname != NULL); LOCK(&ent->lock); if (stat(fname, &_stat) < 0) { ret = isc__errno2result(errno); goto errout; } /* * Solaris 2.5.1 does not have support for sockets (S_IFSOCK), * but it does return type S_IFIFO (the OS believes that * the socket is a fifo). This may be an issue if we tell * the program to look at an actual FIFO as its source of * entropy. */ #if defined(S_ISSOCK) if (S_ISSOCK(_stat.st_mode)) is_usocket = ISC_TRUE; #endif #if defined(S_ISFIFO) && defined(sun) if (S_ISFIFO(_stat.st_mode)) is_usocket = ISC_TRUE; #endif if (is_usocket) fd = socket(PF_UNIX, SOCK_STREAM, 0); else fd = open(fname, O_RDONLY | PORT_NONBLOCK, 0); if (fd < 0) { ret = isc__errno2result(errno); goto errout; } ret = make_nonblock(fd); if (ret != ISC_R_SUCCESS) goto closefd; if (is_usocket) { struct sockaddr_un sname; memset(&sname, 0, sizeof(sname)); sname.sun_family = AF_UNIX; strncpy(sname.sun_path, fname, sizeof(sname.sun_path)); sname.sun_path[sizeof(sname.sun_path)-1] = '0'; #ifdef ISC_PLATFORM_HAVESALEN #if !defined(SUN_LEN) #define SUN_LEN(su) \ (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) #endif sname.sun_len = SUN_LEN(&sname); #endif if (connect(fd, (struct sockaddr *) &sname, sizeof(struct sockaddr_un)) < 0) { if (errno != EINPROGRESS) { ret = isc__errno2result(errno); goto closefd; } } else is_connected = ISC_TRUE; } source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t)); if (source == NULL) { ret = ISC_R_NOMEMORY; goto closefd; } /* * From here down, no failures can occur. */ source->magic = SOURCE_MAGIC; source->ent = ent; source->total = 0; source->bad = ISC_FALSE; memset(source->name, 0, sizeof(source->name)); ISC_LINK_INIT(source, link); if (is_usocket) { source->sources.usocket.handle = fd; if (is_connected) source->sources.usocket.status = isc_usocketsource_connected; else source->sources.usocket.status = isc_usocketsource_connecting; source->sources.usocket.sz_to_recv = 0; source->type = ENTROPY_SOURCETYPE_USOCKET; } else { source->sources.file.handle = fd; source->type = ENTROPY_SOURCETYPE_FILE; } /* * Hook it into the entropy system. */ ISC_LIST_APPEND(ent->sources, source, link); ent->nsources++; UNLOCK(&ent->lock); return (ISC_R_SUCCESS); closefd: (void)close(fd); errout: UNLOCK(&ent->lock); return (ret); } ntp-4.2.6p5/lib/isc/unix/ipv6.c0000644000175000017500000000210011307651605015145 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ipv6.c,v 1.14 2007/06/19 23:47:18 tbox Exp $ */ /*! \file */ #include #include const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; ntp-4.2.6p5/lib/isc/unix/stdio.c0000644000175000017500000000475311307651605015423 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: stdio.c,v 1.8 2007/06/19 23:47:18 tbox Exp $ */ #include #include #include #include #include "errno2result.h" isc_result_t isc_stdio_open(const char *filename, const char *mode, FILE **fp) { FILE *f; f = fopen(filename, mode); if (f == NULL) return (isc__errno2result(errno)); *fp = f; return (ISC_R_SUCCESS); } isc_result_t isc_stdio_close(FILE *f) { int r; r = fclose(f); if (r == 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } isc_result_t isc_stdio_seek(FILE *f, long offset, int whence) { int r; r = fseek(f, offset, whence); if (r == 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } isc_result_t isc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f, size_t *nret) { isc_result_t result = ISC_R_SUCCESS; size_t r; clearerr(f); r = fread(ptr, size, nmemb, f); if (r != nmemb) { if (feof(f)) result = ISC_R_EOF; else result = isc__errno2result(errno); } if (nret != NULL) *nret = r; return (result); } isc_result_t isc_stdio_write(const void *ptr, size_t size, size_t nmemb, FILE *f, size_t *nret) { isc_result_t result = ISC_R_SUCCESS; size_t r; clearerr(f); r = fwrite(ptr, size, nmemb, f); if (r != nmemb) result = isc__errno2result(errno); if (nret != NULL) *nret = r; return (result); } isc_result_t isc_stdio_flush(FILE *f) { int r; r = fflush(f); if (r == 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } isc_result_t isc_stdio_sync(FILE *f) { int r; r = fsync(fileno(f)); if (r == 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } ntp-4.2.6p5/lib/isc/unix/syslog.c0000644000175000017500000000420511307651603015607 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: syslog.c,v 1.8 2007/09/13 04:45:18 each Exp $ */ /*! \file */ #include #include #include #include #include #include #include static struct dsn_c_pvt_sfnt { int val; const char *strval; } facilities[] = { { LOG_KERN, "kern" }, { LOG_USER, "user" }, { LOG_MAIL, "mail" }, { LOG_DAEMON, "daemon" }, { LOG_AUTH, "auth" }, { LOG_SYSLOG, "syslog" }, { LOG_LPR, "lpr" }, #ifdef LOG_NEWS { LOG_NEWS, "news" }, #endif #ifdef LOG_UUCP { LOG_UUCP, "uucp" }, #endif #ifdef LOG_CRON { LOG_CRON, "cron" }, #endif #ifdef LOG_AUTHPRIV { LOG_AUTHPRIV, "authpriv" }, #endif #ifdef LOG_FTP { LOG_FTP, "ftp" }, #endif { LOG_LOCAL0, "local0"}, { LOG_LOCAL1, "local1"}, { LOG_LOCAL2, "local2"}, { LOG_LOCAL3, "local3"}, { LOG_LOCAL4, "local4"}, { LOG_LOCAL5, "local5"}, { LOG_LOCAL6, "local6"}, { LOG_LOCAL7, "local7"}, { 0, NULL } }; isc_result_t isc_syslog_facilityfromstring(const char *str, int *facilityp) { int i; REQUIRE(str != NULL); REQUIRE(facilityp != NULL); for (i = 0; facilities[i].strval != NULL; i++) { if (strcasecmp(facilities[i].strval, str) == 0) { *facilityp = facilities[i].val; return (ISC_R_SUCCESS); } } return (ISC_R_NOTFOUND); } ntp-4.2.6p5/lib/isc/unix/socket.c0000644000175000017500000043046711307651604015575 0ustar peterpeter/* * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: socket.c,v 1.308.12.8 2009/04/18 01:29:26 jinmei Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef ISC_PLATFORM_HAVESYSUNH #include #endif #ifdef ISC_PLATFORM_HAVEKQUEUE #include #endif #ifdef ISC_PLATFORM_HAVEEPOLL #include #endif #ifdef ISC_PLATFORM_HAVEDEVPOLL #include #endif #include "errno2result.h" #ifndef ISC_PLATFORM_USETHREADS #include "socket_p.h" #endif /* ISC_PLATFORM_USETHREADS */ #if defined(SO_BSDCOMPAT) && defined(__linux__) #include #endif /*% * Choose the most preferable multiplex method. */ #ifdef ISC_PLATFORM_HAVEKQUEUE #define USE_KQUEUE #elif defined (ISC_PLATFORM_HAVEEPOLL) #define USE_EPOLL #elif defined (ISC_PLATFORM_HAVEDEVPOLL) #define USE_DEVPOLL typedef struct { unsigned int want_read : 1, want_write : 1; } pollinfo_t; #else #define USE_SELECT #endif /* ISC_PLATFORM_HAVEKQUEUE */ #ifndef ISC_PLATFORM_USETHREADS #if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL) struct isc_socketwait { int nevents; }; #elif defined (USE_SELECT) struct isc_socketwait { fd_set *readset; fd_set *writeset; int nfds; int maxfd; }; #endif /* USE_KQUEUE */ #endif /* !ISC_PLATFORM_USETHREADS */ /*% * Maximum number of allowable open sockets. This is also the maximum * allowable socket file descriptor. * * Care should be taken before modifying this value for select(): * The API standard doesn't ensure select() accept more than (the system default * of) FD_SETSIZE descriptors, and the default size should in fact be fine in * the vast majority of cases. This constant should therefore be increased only * when absolutely necessary and possible, i.e., the server is exhausting all * available file descriptors (up to FD_SETSIZE) and the select() function * and FD_xxx macros support larger values than FD_SETSIZE (which may not * always by true, but we keep using some of them to ensure as much * portability as possible). Note also that overall server performance * may be rather worsened with a larger value of this constant due to * inherent scalability problems of select(). * * As a special note, this value shouldn't have to be touched if * this is a build for an authoritative only DNS server. */ #ifndef ISC_SOCKET_MAXSOCKETS #if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL) #define ISC_SOCKET_MAXSOCKETS 4096 #elif defined(USE_SELECT) #define ISC_SOCKET_MAXSOCKETS FD_SETSIZE #endif /* USE_KQUEUE... */ #endif /* ISC_SOCKET_MAXSOCKETS */ #ifdef USE_SELECT /*% * Mac OS X needs a special definition to support larger values in select(). * We always define this because a larger value can be specified run-time. */ #ifdef __APPLE__ #define _DARWIN_UNLIMITED_SELECT #endif /* __APPLE__ */ #endif /* USE_SELECT */ #ifdef ISC_SOCKET_USE_POLLWATCH /*% * If this macro is defined, enable workaround for a Solaris /dev/poll kernel * bug: DP_POLL ioctl could keep sleeping even if socket I/O is possible for * some of the specified FD. The idea is based on the observation that it's * likely for a busy server to keep receiving packets. It specifically works * as follows: the socket watcher is first initialized with the state of * "poll_idle". While it's in the idle state it keeps sleeping until a socket * event occurs. When it wakes up for a socket I/O event, it moves to the * poll_active state, and sets the poll timeout to a short period * (ISC_SOCKET_POLLWATCH_TIMEOUT msec). If timeout occurs in this state, the * watcher goes to the poll_checking state with the same timeout period. * In this state, the watcher tries to detect whether this is a break * during intermittent events or the kernel bug is triggered. If the next * polling reports an event within the short period, the previous timeout is * likely to be a kernel bug, and so the watcher goes back to the active state. * Otherwise, it moves to the idle state again. * * It's not clear whether this is a thread-related bug, but since we've only * seen this with threads, this workaround is used only when enabling threads. */ typedef enum { poll_idle, poll_active, poll_checking } pollstate_t; #ifndef ISC_SOCKET_POLLWATCH_TIMEOUT #define ISC_SOCKET_POLLWATCH_TIMEOUT 10 #endif /* ISC_SOCKET_POLLWATCH_TIMEOUT */ #endif /* ISC_SOCKET_USE_POLLWATCH */ /*% * Size of per-FD lock buckets. */ #ifdef ISC_PLATFORM_USETHREADS #define FDLOCK_COUNT 1024 #define FDLOCK_ID(fd) ((fd) % FDLOCK_COUNT) #else #define FDLOCK_COUNT 1 #define FDLOCK_ID(fd) 0 #endif /* ISC_PLATFORM_USETHREADS */ /*% * Maximum number of events communicated with the kernel. There should normally * be no need for having a large number. */ #if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL) #ifndef ISC_SOCKET_MAXEVENTS #define ISC_SOCKET_MAXEVENTS 64 #endif #endif /*% * Some systems define the socket length argument as an int, some as size_t, * some as socklen_t. This is here so it can be easily changed if needed. */ #ifndef ISC_SOCKADDR_LEN_T #define ISC_SOCKADDR_LEN_T unsigned int #endif /*% * Define what the possible "soft" errors can be. These are non-fatal returns * of various network related functions, like recv() and so on. * * For some reason, BSDI (and perhaps others) will sometimes return <0 * from recv() but will have errno==0. This is broken, but we have to * work around it here. */ #define SOFT_ERROR(e) ((e) == EAGAIN || \ (e) == EWOULDBLOCK || \ (e) == EINTR || \ (e) == 0) #define DLVL(x) ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(x) /*!< * DLVL(90) -- Function entry/exit and other tracing. * DLVL(70) -- Socket "correctness" -- including returning of events, etc. * DLVL(60) -- Socket data send/receive * DLVL(50) -- Event tracing, including receiving/sending completion events. * DLVL(20) -- Socket creation/destruction. */ #define TRACE_LEVEL 90 #define CORRECTNESS_LEVEL 70 #define IOEVENT_LEVEL 60 #define EVENT_LEVEL 50 #define CREATION_LEVEL 20 #define TRACE DLVL(TRACE_LEVEL) #define CORRECTNESS DLVL(CORRECTNESS_LEVEL) #define IOEVENT DLVL(IOEVENT_LEVEL) #define EVENT DLVL(EVENT_LEVEL) #define CREATION DLVL(CREATION_LEVEL) typedef isc_event_t intev_t; #define SOCKET_MAGIC ISC_MAGIC('I', 'O', 'i', 'o') #define VALID_SOCKET(t) ISC_MAGIC_VALID(t, SOCKET_MAGIC) /*! * IPv6 control information. If the socket is an IPv6 socket we want * to collect the destination address and interface so the client can * set them on outgoing packets. */ #ifdef ISC_PLATFORM_HAVEIN6PKTINFO #ifndef USE_CMSG #define USE_CMSG 1 #endif #endif /*% * NetBSD and FreeBSD can timestamp packets. XXXMLG Should we have * a setsockopt() like interface to request timestamps, and if the OS * doesn't do it for us, call gettimeofday() on every UDP receive? */ #ifdef SO_TIMESTAMP #ifndef USE_CMSG #define USE_CMSG 1 #endif #endif /*% * The size to raise the receive buffer to (from BIND 8). */ #define RCVBUFSIZE (32*1024) /*% * The number of times a send operation is repeated if the result is EINTR. */ #define NRETRIES 10 struct isc_socket { /* Not locked. */ unsigned int magic; isc_socketmgr_t *manager; isc_mutex_t lock; isc_sockettype_t type; const isc_statscounter_t *statsindex; /* Locked by socket lock. */ ISC_LINK(isc_socket_t) link; unsigned int references; int fd; int pf; char name[16]; void * tag; ISC_LIST(isc_socketevent_t) send_list; ISC_LIST(isc_socketevent_t) recv_list; ISC_LIST(isc_socket_newconnev_t) accept_list; isc_socket_connev_t *connect_ev; /* * Internal events. Posted when a descriptor is readable or * writable. These are statically allocated and never freed. * They will be set to non-purgable before use. */ intev_t readable_ev; intev_t writable_ev; isc_sockaddr_t peer_address; /* remote address */ unsigned int pending_recv : 1, pending_send : 1, pending_accept : 1, listener : 1, /* listener socket */ connected : 1, connecting : 1, /* connect pending */ bound : 1; /* bound to local addr */ #ifdef ISC_NET_RECVOVERFLOW unsigned char overflow; /* used for MSG_TRUNC fake */ #endif char *recvcmsgbuf; ISC_SOCKADDR_LEN_T recvcmsgbuflen; char *sendcmsgbuf; ISC_SOCKADDR_LEN_T sendcmsgbuflen; void *fdwatcharg; isc_sockfdwatch_t fdwatchcb; int fdwatchflags; isc_task_t *fdwatchtask; }; #define SOCKET_MANAGER_MAGIC ISC_MAGIC('I', 'O', 'm', 'g') #define VALID_MANAGER(m) ISC_MAGIC_VALID(m, SOCKET_MANAGER_MAGIC) struct isc_socketmgr { /* Not locked. */ unsigned int magic; isc_mem_t *mctx; isc_mutex_t lock; isc_mutex_t *fdlock; isc_stats_t *stats; #ifdef USE_KQUEUE int kqueue_fd; int nevents; struct kevent *events; #endif /* USE_KQUEUE */ #ifdef USE_EPOLL int epoll_fd; int nevents; struct epoll_event *events; #endif /* USE_EPOLL */ #ifdef USE_DEVPOLL int devpoll_fd; int nevents; struct pollfd *events; #endif /* USE_DEVPOLL */ #ifdef USE_SELECT int fd_bufsize; #endif /* USE_SELECT */ unsigned int maxsocks; #ifdef ISC_PLATFORM_USETHREADS int pipe_fds[2]; #endif /* Locked by fdlock. */ isc_socket_t **fds; int *fdstate; #ifdef USE_DEVPOLL pollinfo_t *fdpollinfo; #endif /* Locked by manager lock. */ ISC_LIST(isc_socket_t) socklist; #ifdef USE_SELECT fd_set *read_fds; fd_set *read_fds_copy; fd_set *write_fds; fd_set *write_fds_copy; int maxfd; #endif /* USE_SELECT */ int reserved; /* unlocked */ #ifdef ISC_PLATFORM_USETHREADS isc_thread_t watcher; isc_condition_t shutdown_ok; #else /* ISC_PLATFORM_USETHREADS */ unsigned int refs; #endif /* ISC_PLATFORM_USETHREADS */ }; #ifndef ISC_PLATFORM_USETHREADS static isc_socketmgr_t *socketmgr = NULL; #endif /* ISC_PLATFORM_USETHREADS */ #define CLOSED 0 /* this one must be zero */ #define MANAGED 1 #define CLOSE_PENDING 2 /* * send() and recv() iovec counts */ #define MAXSCATTERGATHER_SEND (ISC_SOCKET_MAXSCATTERGATHER) #ifdef ISC_NET_RECVOVERFLOW # define MAXSCATTERGATHER_RECV (ISC_SOCKET_MAXSCATTERGATHER + 1) #else # define MAXSCATTERGATHER_RECV (ISC_SOCKET_MAXSCATTERGATHER) #endif static void send_recvdone_event(isc_socket_t *, isc_socketevent_t **); static void send_senddone_event(isc_socket_t *, isc_socketevent_t **); static void free_socket(isc_socket_t **); static isc_result_t allocate_socket(isc_socketmgr_t *, isc_sockettype_t, isc_socket_t **); static void destroy(isc_socket_t **); static void internal_accept(isc_task_t *, isc_event_t *); static void internal_connect(isc_task_t *, isc_event_t *); static void internal_recv(isc_task_t *, isc_event_t *); static void internal_send(isc_task_t *, isc_event_t *); static void internal_fdwatch_write(isc_task_t *, isc_event_t *); static void internal_fdwatch_read(isc_task_t *, isc_event_t *); static void process_cmsg(isc_socket_t *, struct msghdr *, isc_socketevent_t *); static void build_msghdr_send(isc_socket_t *, isc_socketevent_t *, struct msghdr *, struct iovec *, size_t *); static void build_msghdr_recv(isc_socket_t *, isc_socketevent_t *, struct msghdr *, struct iovec *, size_t *); #ifdef ISC_PLATFORM_USETHREADS static isc_boolean_t process_ctlfd(isc_socketmgr_t *manager); #endif #define SELECT_POKE_SHUTDOWN (-1) #define SELECT_POKE_NOTHING (-2) #define SELECT_POKE_READ (-3) #define SELECT_POKE_ACCEPT (-3) /*%< Same as _READ */ #define SELECT_POKE_WRITE (-4) #define SELECT_POKE_CONNECT (-4) /*%< Same as _WRITE */ #define SELECT_POKE_CLOSE (-5) #define SOCK_DEAD(s) ((s)->references == 0) /*% * Shortcut index arrays to get access to statistics counters. */ enum { STATID_OPEN = 0, STATID_OPENFAIL = 1, STATID_CLOSE = 2, STATID_BINDFAIL = 3, STATID_CONNECTFAIL = 4, STATID_CONNECT = 5, STATID_ACCEPTFAIL = 6, STATID_ACCEPT = 7, STATID_SENDFAIL = 8, STATID_RECVFAIL = 9 }; static const isc_statscounter_t upd4statsindex[] = { isc_sockstatscounter_udp4open, isc_sockstatscounter_udp4openfail, isc_sockstatscounter_udp4close, isc_sockstatscounter_udp4bindfail, isc_sockstatscounter_udp4connectfail, isc_sockstatscounter_udp4connect, -1, -1, isc_sockstatscounter_udp4sendfail, isc_sockstatscounter_udp4recvfail }; static const isc_statscounter_t upd6statsindex[] = { isc_sockstatscounter_udp6open, isc_sockstatscounter_udp6openfail, isc_sockstatscounter_udp6close, isc_sockstatscounter_udp6bindfail, isc_sockstatscounter_udp6connectfail, isc_sockstatscounter_udp6connect, -1, -1, isc_sockstatscounter_udp6sendfail, isc_sockstatscounter_udp6recvfail }; static const isc_statscounter_t tcp4statsindex[] = { isc_sockstatscounter_tcp4open, isc_sockstatscounter_tcp4openfail, isc_sockstatscounter_tcp4close, isc_sockstatscounter_tcp4bindfail, isc_sockstatscounter_tcp4connectfail, isc_sockstatscounter_tcp4connect, isc_sockstatscounter_tcp4acceptfail, isc_sockstatscounter_tcp4accept, isc_sockstatscounter_tcp4sendfail, isc_sockstatscounter_tcp4recvfail }; static const isc_statscounter_t tcp6statsindex[] = { isc_sockstatscounter_tcp6open, isc_sockstatscounter_tcp6openfail, isc_sockstatscounter_tcp6close, isc_sockstatscounter_tcp6bindfail, isc_sockstatscounter_tcp6connectfail, isc_sockstatscounter_tcp6connect, isc_sockstatscounter_tcp6acceptfail, isc_sockstatscounter_tcp6accept, isc_sockstatscounter_tcp6sendfail, isc_sockstatscounter_tcp6recvfail }; static const isc_statscounter_t unixstatsindex[] = { isc_sockstatscounter_unixopen, isc_sockstatscounter_unixopenfail, isc_sockstatscounter_unixclose, isc_sockstatscounter_unixbindfail, isc_sockstatscounter_unixconnectfail, isc_sockstatscounter_unixconnect, isc_sockstatscounter_unixacceptfail, isc_sockstatscounter_unixaccept, isc_sockstatscounter_unixsendfail, isc_sockstatscounter_unixrecvfail }; static const isc_statscounter_t fdwatchstatsindex[] = { -1, -1, isc_sockstatscounter_fdwatchclose, isc_sockstatscounter_fdwatchbindfail, isc_sockstatscounter_fdwatchconnectfail, isc_sockstatscounter_fdwatchconnect, -1, -1, isc_sockstatscounter_fdwatchsendfail, isc_sockstatscounter_fdwatchrecvfail }; static void manager_log(isc_socketmgr_t *sockmgr, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *fmt, ...) ISC_FORMAT_PRINTF(5, 6); static void manager_log(isc_socketmgr_t *sockmgr, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *fmt, ...) { char msgbuf[2048]; va_list ap; if (! isc_log_wouldlog(isc_lctx, level)) return; va_start(ap, fmt); vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); va_end(ap); isc_log_write(isc_lctx, category, module, level, "sockmgr %p: %s", sockmgr, msgbuf); } static void socket_log(isc_socket_t *sock, isc_sockaddr_t *address, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int message, const char *fmt, ...) ISC_FORMAT_PRINTF(9, 10); static void socket_log(isc_socket_t *sock, isc_sockaddr_t *address, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int message, const char *fmt, ...) { char msgbuf[2048]; char peerbuf[ISC_SOCKADDR_FORMATSIZE]; va_list ap; if (! isc_log_wouldlog(isc_lctx, level)) return; va_start(ap, fmt); vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); va_end(ap); if (address == NULL) { isc_log_iwrite(isc_lctx, category, module, level, msgcat, msgset, message, "socket %p: %s", sock, msgbuf); } else { isc_sockaddr_format(address, peerbuf, sizeof(peerbuf)); isc_log_iwrite(isc_lctx, category, module, level, msgcat, msgset, message, "socket %p %s: %s", sock, peerbuf, msgbuf); } } #if defined(_AIX) && defined(ISC_NET_BSD44MSGHDR) && \ defined(USE_CMSG) && defined(IPV6_RECVPKTINFO) /* * AIX has a kernel bug where IPV6_RECVPKTINFO gets cleared by * setting IPV6_V6ONLY. */ static void FIX_IPV6_RECVPKTINFO(isc_socket_t *sock) { char strbuf[ISC_STRERRORSIZE]; int on = 1; if (sock->pf != AF_INET6 || sock->type != isc_sockettype_udp) return; if (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, (void *)&on, sizeof(on)) < 0) { UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d, IPV6_RECVPKTINFO) " "%s: %s", sock->fd, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); } } #else #define FIX_IPV6_RECVPKTINFO(sock) (void)0 #endif /*% * Increment socket-related statistics counters. */ static inline void inc_stats(isc_stats_t *stats, isc_statscounter_t counterid) { REQUIRE(counterid != -1); if (stats != NULL) isc_stats_increment(stats, counterid); } static inline isc_result_t watch_fd(isc_socketmgr_t *manager, int fd, int msg) { isc_result_t result = ISC_R_SUCCESS; #ifdef USE_KQUEUE struct kevent evchange; memset(&evchange, 0, sizeof(evchange)); if (msg == SELECT_POKE_READ) evchange.filter = EVFILT_READ; else evchange.filter = EVFILT_WRITE; evchange.flags = EV_ADD; evchange.ident = fd; if (kevent(manager->kqueue_fd, &evchange, 1, NULL, 0, NULL) != 0) result = isc__errno2result(errno); return (result); #elif defined(USE_EPOLL) struct epoll_event event; if (msg == SELECT_POKE_READ) event.events = EPOLLIN; else event.events = EPOLLOUT; event.data.fd = fd; if (epoll_ctl(manager->epoll_fd, EPOLL_CTL_ADD, fd, &event) == -1 && errno != EEXIST) { result = isc__errno2result(errno); } return (result); #elif defined(USE_DEVPOLL) struct pollfd pfd; int lockid = FDLOCK_ID(fd); memset(&pfd, 0, sizeof(pfd)); if (msg == SELECT_POKE_READ) pfd.events = POLLIN; else pfd.events = POLLOUT; pfd.fd = fd; pfd.revents = 0; LOCK(&manager->fdlock[lockid]); if (write(manager->devpoll_fd, &pfd, sizeof(pfd)) == -1) result = isc__errno2result(errno); else { if (msg == SELECT_POKE_READ) manager->fdpollinfo[fd].want_read = 1; else manager->fdpollinfo[fd].want_write = 1; } UNLOCK(&manager->fdlock[lockid]); return (result); #elif defined(USE_SELECT) LOCK(&manager->lock); if (msg == SELECT_POKE_READ) FD_SET(fd, manager->read_fds); if (msg == SELECT_POKE_WRITE) FD_SET(fd, manager->write_fds); UNLOCK(&manager->lock); return (result); #endif } static inline isc_result_t unwatch_fd(isc_socketmgr_t *manager, int fd, int msg) { isc_result_t result = ISC_R_SUCCESS; #ifdef USE_KQUEUE struct kevent evchange; memset(&evchange, 0, sizeof(evchange)); if (msg == SELECT_POKE_READ) evchange.filter = EVFILT_READ; else evchange.filter = EVFILT_WRITE; evchange.flags = EV_DELETE; evchange.ident = fd; if (kevent(manager->kqueue_fd, &evchange, 1, NULL, 0, NULL) != 0) result = isc__errno2result(errno); return (result); #elif defined(USE_EPOLL) struct epoll_event event; if (msg == SELECT_POKE_READ) event.events = EPOLLIN; else event.events = EPOLLOUT; event.data.fd = fd; if (epoll_ctl(manager->epoll_fd, EPOLL_CTL_DEL, fd, &event) == -1 && errno != ENOENT) { char strbuf[ISC_STRERRORSIZE]; isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "epoll_ctl(DEL), %d: %s", fd, strbuf); result = ISC_R_UNEXPECTED; } return (result); #elif defined(USE_DEVPOLL) struct pollfd pfds[2]; size_t writelen = sizeof(pfds[0]); int lockid = FDLOCK_ID(fd); memset(pfds, 0, sizeof(pfds)); pfds[0].events = POLLREMOVE; pfds[0].fd = fd; /* * Canceling read or write polling via /dev/poll is tricky. Since it * only provides a way of canceling per FD, we may need to re-poll the * socket for the other operation. */ LOCK(&manager->fdlock[lockid]); if (msg == SELECT_POKE_READ && manager->fdpollinfo[fd].want_write == 1) { pfds[1].events = POLLOUT; pfds[1].fd = fd; writelen += sizeof(pfds[1]); } if (msg == SELECT_POKE_WRITE && manager->fdpollinfo[fd].want_read == 1) { pfds[1].events = POLLIN; pfds[1].fd = fd; writelen += sizeof(pfds[1]); } if (write(manager->devpoll_fd, pfds, writelen) == -1) result = isc__errno2result(errno); else { if (msg == SELECT_POKE_READ) manager->fdpollinfo[fd].want_read = 0; else manager->fdpollinfo[fd].want_write = 0; } UNLOCK(&manager->fdlock[lockid]); return (result); #elif defined(USE_SELECT) LOCK(&manager->lock); if (msg == SELECT_POKE_READ) FD_CLR(fd, manager->read_fds); else if (msg == SELECT_POKE_WRITE) FD_CLR(fd, manager->write_fds); UNLOCK(&manager->lock); return (result); #endif } static void wakeup_socket(isc_socketmgr_t *manager, int fd, int msg) { isc_result_t result; int lockid = FDLOCK_ID(fd); /* * This is a wakeup on a socket. If the socket is not in the * process of being closed, start watching it for either reads * or writes. */ INSIST(fd >= 0 && fd < (int)manager->maxsocks); if (msg == SELECT_POKE_CLOSE) { /* No one should be updating fdstate, so no need to lock it */ INSIST(manager->fdstate[fd] == CLOSE_PENDING); manager->fdstate[fd] = CLOSED; (void)unwatch_fd(manager, fd, SELECT_POKE_READ); (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE); (void)close(fd); return; } LOCK(&manager->fdlock[lockid]); if (manager->fdstate[fd] == CLOSE_PENDING) { UNLOCK(&manager->fdlock[lockid]); /* * We accept (and ignore) any error from unwatch_fd() as we are * closing the socket, hoping it doesn't leave dangling state in * the kernel. * Note that unwatch_fd() must be called after releasing the * fdlock; otherwise it could cause deadlock due to a lock order * reversal. */ (void)unwatch_fd(manager, fd, SELECT_POKE_READ); (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE); return; } if (manager->fdstate[fd] != MANAGED) { UNLOCK(&manager->fdlock[lockid]); return; } UNLOCK(&manager->fdlock[lockid]); /* * Set requested bit. */ result = watch_fd(manager, fd, msg); if (result != ISC_R_SUCCESS) { /* * XXXJT: what should we do? Ignoring the failure of watching * a socket will make the application dysfunctional, but there * seems to be no reasonable recovery process. */ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "failed to start watching FD (%d): %s", fd, isc_result_totext(result)); } } #ifdef ISC_PLATFORM_USETHREADS /* * Poke the select loop when there is something for us to do. * The write is required (by POSIX) to complete. That is, we * will not get partial writes. */ static void select_poke(isc_socketmgr_t *mgr, int fd, int msg) { int cc; int buf[2]; char strbuf[ISC_STRERRORSIZE]; buf[0] = fd; buf[1] = msg; do { cc = write(mgr->pipe_fds[1], buf, sizeof(buf)); #ifdef ENOSR /* * Treat ENOSR as EAGAIN but loop slowly as it is * unlikely to clear fast. */ if (cc < 0 && errno == ENOSR) { sleep(1); errno = EAGAIN; } #endif } while (cc < 0 && SOFT_ERROR(errno)); if (cc < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); FATAL_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_WRITEFAILED, "write() failed " "during watcher poke: %s"), strbuf); } INSIST(cc == sizeof(buf)); } /* * Read a message on the internal fd. */ static void select_readmsg(isc_socketmgr_t *mgr, int *fd, int *msg) { int buf[2]; int cc; char strbuf[ISC_STRERRORSIZE]; cc = read(mgr->pipe_fds[0], buf, sizeof(buf)); if (cc < 0) { *msg = SELECT_POKE_NOTHING; *fd = -1; /* Silence compiler. */ if (SOFT_ERROR(errno)) return; isc__strerror(errno, strbuf, sizeof(strbuf)); FATAL_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_READFAILED, "read() failed " "during watcher poke: %s"), strbuf); return; } INSIST(cc == sizeof(buf)); *fd = buf[0]; *msg = buf[1]; } #else /* ISC_PLATFORM_USETHREADS */ /* * Update the state of the socketmgr when something changes. */ static void select_poke(isc_socketmgr_t *manager, int fd, int msg) { if (msg == SELECT_POKE_SHUTDOWN) return; else if (fd >= 0) wakeup_socket(manager, fd, msg); return; } #endif /* ISC_PLATFORM_USETHREADS */ /* * Make a fd non-blocking. */ static isc_result_t make_nonblock(int fd) { int ret; int flags; char strbuf[ISC_STRERRORSIZE]; #ifdef USE_FIONBIO_IOCTL int on = 1; ret = ioctl(fd, FIONBIO, (char *)&on); #else flags = fcntl(fd, F_GETFL, 0); flags |= PORT_NONBLOCK; ret = fcntl(fd, F_SETFL, flags); #endif if (ret == -1) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, #ifdef USE_FIONBIO_IOCTL "ioctl(%d, FIONBIO, &on): %s", fd, #else "fcntl(%d, F_SETFL, %d): %s", fd, flags, #endif strbuf); return (ISC_R_UNEXPECTED); } return (ISC_R_SUCCESS); } #ifdef USE_CMSG /* * Not all OSes support advanced CMSG macros: CMSG_LEN and CMSG_SPACE. * In order to ensure as much portability as possible, we provide wrapper * functions of these macros. * Note that cmsg_space() could run slow on OSes that do not have * CMSG_SPACE. */ static inline ISC_SOCKADDR_LEN_T cmsg_len(ISC_SOCKADDR_LEN_T len) { #ifdef CMSG_LEN return (CMSG_LEN(len)); #else ISC_SOCKADDR_LEN_T hdrlen; /* * Cast NULL so that any pointer arithmetic performed by CMSG_DATA * is correct. */ hdrlen = (ISC_SOCKADDR_LEN_T)CMSG_DATA(((struct cmsghdr *)NULL)); return (hdrlen + len); #endif } static inline ISC_SOCKADDR_LEN_T cmsg_space(ISC_SOCKADDR_LEN_T len) { #ifdef CMSG_SPACE return (CMSG_SPACE(len)); #else struct msghdr msg; struct cmsghdr *cmsgp; /* * XXX: The buffer length is an ad-hoc value, but should be enough * in a practical sense. */ char dummybuf[sizeof(struct cmsghdr) + 1024]; memset(&msg, 0, sizeof(msg)); msg.msg_control = dummybuf; msg.msg_controllen = sizeof(dummybuf); cmsgp = (struct cmsghdr *)dummybuf; cmsgp->cmsg_len = cmsg_len(len); cmsgp = CMSG_NXTHDR(&msg, cmsgp); if (cmsgp != NULL) return ((char *)cmsgp - (char *)msg.msg_control); else return (0); #endif } #endif /* USE_CMSG */ /* * Process control messages received on a socket. */ static void process_cmsg(isc_socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) { #ifdef USE_CMSG struct cmsghdr *cmsgp; #ifdef ISC_PLATFORM_HAVEIN6PKTINFO struct in6_pktinfo *pktinfop; #endif #ifdef SO_TIMESTAMP struct timeval *timevalp; #endif #endif /* * sock is used only when ISC_NET_BSD44MSGHDR and USE_CMSG are defined. * msg and dev are used only when ISC_NET_BSD44MSGHDR is defined. * They are all here, outside of the CPP tests, because it is * more consistent with the usual ISC coding style. */ UNUSED(sock); UNUSED(msg); UNUSED(dev); #ifdef ISC_NET_BSD44MSGHDR #ifdef MSG_TRUNC if ((msg->msg_flags & MSG_TRUNC) == MSG_TRUNC) dev->attributes |= ISC_SOCKEVENTATTR_TRUNC; #endif #ifdef MSG_CTRUNC if ((msg->msg_flags & MSG_CTRUNC) == MSG_CTRUNC) dev->attributes |= ISC_SOCKEVENTATTR_CTRUNC; #endif #ifndef USE_CMSG return; #else if (msg->msg_controllen == 0U || msg->msg_control == NULL) return; #ifdef SO_TIMESTAMP timevalp = NULL; #endif #ifdef ISC_PLATFORM_HAVEIN6PKTINFO pktinfop = NULL; #endif cmsgp = CMSG_FIRSTHDR(msg); while (cmsgp != NULL) { socket_log(sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_PROCESSCMSG, "processing cmsg %p", cmsgp); #ifdef ISC_PLATFORM_HAVEIN6PKTINFO if (cmsgp->cmsg_level == IPPROTO_IPV6 && cmsgp->cmsg_type == IPV6_PKTINFO) { pktinfop = (struct in6_pktinfo *)CMSG_DATA(cmsgp); memcpy(&dev->pktinfo, pktinfop, sizeof(struct in6_pktinfo)); dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO; socket_log(sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_IFRECEIVED, "interface received on ifindex %u", dev->pktinfo.ipi6_ifindex); if (IN6_IS_ADDR_MULTICAST(&pktinfop->ipi6_addr)) dev->attributes |= ISC_SOCKEVENTATTR_MULTICAST; goto next; } #endif #ifdef SO_TIMESTAMP if (cmsgp->cmsg_level == SOL_SOCKET && cmsgp->cmsg_type == SCM_TIMESTAMP) { timevalp = (struct timeval *)CMSG_DATA(cmsgp); dev->timestamp.seconds = timevalp->tv_sec; dev->timestamp.nanoseconds = timevalp->tv_usec * 1000; dev->attributes |= ISC_SOCKEVENTATTR_TIMESTAMP; goto next; } #endif next: cmsgp = CMSG_NXTHDR(msg, cmsgp); } #endif /* USE_CMSG */ #endif /* ISC_NET_BSD44MSGHDR */ } /* * Construct an iov array and attach it to the msghdr passed in. This is * the SEND constructor, which will use the used region of the buffer * (if using a buffer list) or will use the internal region (if a single * buffer I/O is requested). * * Nothing can be NULL, and the done event must list at least one buffer * on the buffer linked list for this function to be meaningful. * * If write_countp != NULL, *write_countp will hold the number of bytes * this transaction can send. */ static void build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *msg, struct iovec *iov, size_t *write_countp) { unsigned int iovcount; isc_buffer_t *buffer; isc_region_t used; size_t write_count; size_t skip_count; memset(msg, 0, sizeof(*msg)); if (!sock->connected) { msg->msg_name = (void *)&dev->address.type.sa; msg->msg_namelen = dev->address.length; } else { msg->msg_name = NULL; msg->msg_namelen = 0; } buffer = ISC_LIST_HEAD(dev->bufferlist); write_count = 0; iovcount = 0; /* * Single buffer I/O? Skip what we've done so far in this region. */ if (buffer == NULL) { write_count = dev->region.length - dev->n; iov[0].iov_base = (void *)(dev->region.base + dev->n); iov[0].iov_len = write_count; iovcount = 1; goto config; } /* * Multibuffer I/O. * Skip the data in the buffer list that we have already written. */ skip_count = dev->n; while (buffer != NULL) { REQUIRE(ISC_BUFFER_VALID(buffer)); if (skip_count < isc_buffer_usedlength(buffer)) break; skip_count -= isc_buffer_usedlength(buffer); buffer = ISC_LIST_NEXT(buffer, link); } while (buffer != NULL) { INSIST(iovcount < MAXSCATTERGATHER_SEND); isc_buffer_usedregion(buffer, &used); if (used.length > 0) { iov[iovcount].iov_base = (void *)(used.base + skip_count); iov[iovcount].iov_len = used.length - skip_count; write_count += (used.length - skip_count); skip_count = 0; iovcount++; } buffer = ISC_LIST_NEXT(buffer, link); } INSIST(skip_count == 0U); config: msg->msg_iov = iov; msg->msg_iovlen = iovcount; #ifdef ISC_NET_BSD44MSGHDR msg->msg_control = NULL; msg->msg_controllen = 0; msg->msg_flags = 0; #if defined(USE_CMSG) && defined(ISC_PLATFORM_HAVEIN6PKTINFO) if ((sock->type == isc_sockettype_udp) && ((dev->attributes & ISC_SOCKEVENTATTR_PKTINFO) != 0)) { struct cmsghdr *cmsgp; struct in6_pktinfo *pktinfop; socket_log(sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_SENDTODATA, "sendto pktinfo data, ifindex %u", dev->pktinfo.ipi6_ifindex); msg->msg_controllen = cmsg_space(sizeof(struct in6_pktinfo)); INSIST(msg->msg_controllen <= sock->sendcmsgbuflen); msg->msg_control = (void *)sock->sendcmsgbuf; cmsgp = (struct cmsghdr *)sock->sendcmsgbuf; cmsgp->cmsg_level = IPPROTO_IPV6; cmsgp->cmsg_type = IPV6_PKTINFO; cmsgp->cmsg_len = cmsg_len(sizeof(struct in6_pktinfo)); pktinfop = (struct in6_pktinfo *)CMSG_DATA(cmsgp); memcpy(pktinfop, &dev->pktinfo, sizeof(struct in6_pktinfo)); } #endif /* USE_CMSG && ISC_PLATFORM_HAVEIPV6 */ #else /* ISC_NET_BSD44MSGHDR */ msg->msg_accrights = NULL; msg->msg_accrightslen = 0; #endif /* ISC_NET_BSD44MSGHDR */ if (write_countp != NULL) *write_countp = write_count; } /* * Construct an iov array and attach it to the msghdr passed in. This is * the RECV constructor, which will use the available region of the buffer * (if using a buffer list) or will use the internal region (if a single * buffer I/O is requested). * * Nothing can be NULL, and the done event must list at least one buffer * on the buffer linked list for this function to be meaningful. * * If read_countp != NULL, *read_countp will hold the number of bytes * this transaction can receive. */ static void build_msghdr_recv(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *msg, struct iovec *iov, size_t *read_countp) { unsigned int iovcount; isc_buffer_t *buffer; isc_region_t available; size_t read_count; memset(msg, 0, sizeof(struct msghdr)); if (sock->type == isc_sockettype_udp) { memset(&dev->address, 0, sizeof(dev->address)); #ifdef BROKEN_RECVMSG if (sock->pf == AF_INET) { msg->msg_name = (void *)&dev->address.type.sin; msg->msg_namelen = sizeof(dev->address.type.sin6); } else if (sock->pf == AF_INET6) { msg->msg_name = (void *)&dev->address.type.sin6; msg->msg_namelen = sizeof(dev->address.type.sin6); #ifdef ISC_PLATFORM_HAVESYSUNH } else if (sock->pf == AF_UNIX) { msg->msg_name = (void *)&dev->address.type.sunix; msg->msg_namelen = sizeof(dev->address.type.sunix); #endif } else { msg->msg_name = (void *)&dev->address.type.sa; msg->msg_namelen = sizeof(dev->address.type); } #else msg->msg_name = (void *)&dev->address.type.sa; msg->msg_namelen = sizeof(dev->address.type); #endif #ifdef ISC_NET_RECVOVERFLOW /* If needed, steal one iovec for overflow detection. */ maxiov--; #endif } else { /* TCP */ msg->msg_name = NULL; msg->msg_namelen = 0; dev->address = sock->peer_address; } buffer = ISC_LIST_HEAD(dev->bufferlist); read_count = 0; /* * Single buffer I/O? Skip what we've done so far in this region. */ if (buffer == NULL) { read_count = dev->region.length - dev->n; iov[0].iov_base = (void *)(dev->region.base + dev->n); iov[0].iov_len = read_count; iovcount = 1; goto config; } /* * Multibuffer I/O. * Skip empty buffers. */ while (buffer != NULL) { REQUIRE(ISC_BUFFER_VALID(buffer)); if (isc_buffer_availablelength(buffer) != 0) break; buffer = ISC_LIST_NEXT(buffer, link); } iovcount = 0; while (buffer != NULL) { INSIST(iovcount < MAXSCATTERGATHER_RECV); isc_buffer_availableregion(buffer, &available); if (available.length > 0) { iov[iovcount].iov_base = (void *)(available.base); iov[iovcount].iov_len = available.length; read_count += available.length; iovcount++; } buffer = ISC_LIST_NEXT(buffer, link); } config: /* * If needed, set up to receive that one extra byte. Note that * we know there is at least one iov left, since we stole it * at the top of this function. */ #ifdef ISC_NET_RECVOVERFLOW if (sock->type == isc_sockettype_udp) { iov[iovcount].iov_base = (void *)(&sock->overflow); iov[iovcount].iov_len = 1; iovcount++; } #endif msg->msg_iov = iov; msg->msg_iovlen = iovcount; #ifdef ISC_NET_BSD44MSGHDR msg->msg_control = NULL; msg->msg_controllen = 0; msg->msg_flags = 0; #if defined(USE_CMSG) if (sock->type == isc_sockettype_udp) { msg->msg_control = sock->recvcmsgbuf; msg->msg_controllen = sock->recvcmsgbuflen; } #endif /* USE_CMSG */ #else /* ISC_NET_BSD44MSGHDR */ msg->msg_accrights = NULL; msg->msg_accrightslen = 0; #endif /* ISC_NET_BSD44MSGHDR */ if (read_countp != NULL) *read_countp = read_count; } static void set_dev_address(isc_sockaddr_t *address, isc_socket_t *sock, isc_socketevent_t *dev) { if (sock->type == isc_sockettype_udp) { if (address != NULL) dev->address = *address; else dev->address = sock->peer_address; } else if (sock->type == isc_sockettype_tcp) { INSIST(address == NULL); dev->address = sock->peer_address; } } static void destroy_socketevent(isc_event_t *event) { isc_socketevent_t *ev = (isc_socketevent_t *)event; INSIST(ISC_LIST_EMPTY(ev->bufferlist)); (ev->destroy)(event); } static isc_socketevent_t * allocate_socketevent(isc_socket_t *sock, isc_eventtype_t eventtype, isc_taskaction_t action, const void *arg) { isc_socketevent_t *ev; ev = (isc_socketevent_t *)isc_event_allocate(sock->manager->mctx, sock, eventtype, action, arg, sizeof(*ev)); if (ev == NULL) return (NULL); ev->result = ISC_R_UNEXPECTED; ISC_LINK_INIT(ev, ev_link); ISC_LIST_INIT(ev->bufferlist); ev->region.base = NULL; ev->n = 0; ev->offset = 0; ev->attributes = 0; ev->destroy = ev->ev_destroy; ev->ev_destroy = destroy_socketevent; return (ev); } #if defined(ISC_SOCKET_DEBUG) static void dump_msg(struct msghdr *msg) { unsigned int i; printf("MSGHDR %p\n", msg); printf("\tname %p, namelen %ld\n", msg->msg_name, (long) msg->msg_namelen); printf("\tiov %p, iovlen %ld\n", msg->msg_iov, (long) msg->msg_iovlen); for (i = 0; i < (unsigned int)msg->msg_iovlen; i++) printf("\t\t%d\tbase %p, len %ld\n", i, msg->msg_iov[i].iov_base, (long) msg->msg_iov[i].iov_len); #ifdef ISC_NET_BSD44MSGHDR printf("\tcontrol %p, controllen %ld\n", msg->msg_control, (long) msg->msg_controllen); #endif } #endif #define DOIO_SUCCESS 0 /* i/o ok, event sent */ #define DOIO_SOFT 1 /* i/o ok, soft error, no event sent */ #define DOIO_HARD 2 /* i/o error, event sent */ #define DOIO_EOF 3 /* EOF, no event sent */ static int doio_recv(isc_socket_t *sock, isc_socketevent_t *dev) { int cc; struct iovec iov[MAXSCATTERGATHER_RECV]; size_t read_count; size_t actual_count; struct msghdr msghdr; isc_buffer_t *buffer; int recv_errno; char strbuf[ISC_STRERRORSIZE]; build_msghdr_recv(sock, dev, &msghdr, iov, &read_count); #if defined(ISC_SOCKET_DEBUG) dump_msg(&msghdr); #endif cc = recvmsg(sock->fd, &msghdr, 0); recv_errno = errno; #if defined(ISC_SOCKET_DEBUG) dump_msg(&msghdr); #endif if (cc < 0) { if (SOFT_ERROR(recv_errno)) return (DOIO_SOFT); if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) { isc__strerror(recv_errno, strbuf, sizeof(strbuf)); socket_log(sock, NULL, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_DOIORECV, "doio_recv: recvmsg(%d) %d bytes, err %d/%s", sock->fd, cc, recv_errno, strbuf); } #define SOFT_OR_HARD(_system, _isc) \ if (recv_errno == _system) { \ if (sock->connected) { \ dev->result = _isc; \ inc_stats(sock->manager->stats, \ sock->statsindex[STATID_RECVFAIL]); \ return (DOIO_HARD); \ } \ return (DOIO_SOFT); \ } #define ALWAYS_HARD(_system, _isc) \ if (recv_errno == _system) { \ dev->result = _isc; \ inc_stats(sock->manager->stats, \ sock->statsindex[STATID_RECVFAIL]); \ return (DOIO_HARD); \ } SOFT_OR_HARD(ECONNREFUSED, ISC_R_CONNREFUSED); SOFT_OR_HARD(ENETUNREACH, ISC_R_NETUNREACH); SOFT_OR_HARD(EHOSTUNREACH, ISC_R_HOSTUNREACH); SOFT_OR_HARD(EHOSTDOWN, ISC_R_HOSTDOWN); /* HPUX 11.11 can return EADDRNOTAVAIL. */ SOFT_OR_HARD(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL); ALWAYS_HARD(ENOBUFS, ISC_R_NORESOURCES); /* * HPUX returns EPROTO and EINVAL on receiving some ICMP/ICMPv6 * errors. */ #ifdef EPROTO SOFT_OR_HARD(EPROTO, ISC_R_HOSTUNREACH); #endif SOFT_OR_HARD(EINVAL, ISC_R_HOSTUNREACH); #undef SOFT_OR_HARD #undef ALWAYS_HARD dev->result = isc__errno2result(recv_errno); inc_stats(sock->manager->stats, sock->statsindex[STATID_RECVFAIL]); return (DOIO_HARD); } /* * On TCP, zero length reads indicate EOF, while on * UDP, zero length reads are perfectly valid, although * strange. */ if ((sock->type == isc_sockettype_tcp) && (cc == 0)) return (DOIO_EOF); if (sock->type == isc_sockettype_udp) { dev->address.length = msghdr.msg_namelen; if (isc_sockaddr_getport(&dev->address) == 0) { if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) { socket_log(sock, &dev->address, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ZEROPORT, "dropping source port zero packet"); } return (DOIO_SOFT); } } socket_log(sock, &dev->address, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_PKTRECV, "packet received correctly"); /* * Overflow bit detection. If we received MORE bytes than we should, * this indicates an overflow situation. Set the flag in the * dev entry and adjust how much we read by one. */ #ifdef ISC_NET_RECVOVERFLOW if ((sock->type == isc_sockettype_udp) && ((size_t)cc > read_count)) { dev->attributes |= ISC_SOCKEVENTATTR_TRUNC; cc--; } #endif /* * If there are control messages attached, run through them and pull * out the interesting bits. */ if (sock->type == isc_sockettype_udp) process_cmsg(sock, &msghdr, dev); /* * update the buffers (if any) and the i/o count */ dev->n += cc; actual_count = cc; buffer = ISC_LIST_HEAD(dev->bufferlist); while (buffer != NULL && actual_count > 0U) { REQUIRE(ISC_BUFFER_VALID(buffer)); if (isc_buffer_availablelength(buffer) <= actual_count) { actual_count -= isc_buffer_availablelength(buffer); isc_buffer_add(buffer, isc_buffer_availablelength(buffer)); } else { isc_buffer_add(buffer, actual_count); actual_count = 0; break; } buffer = ISC_LIST_NEXT(buffer, link); if (buffer == NULL) { INSIST(actual_count == 0U); } } /* * If we read less than we expected, update counters, * and let the upper layer poke the descriptor. */ if (((size_t)cc != read_count) && (dev->n < dev->minimum)) return (DOIO_SOFT); /* * Full reads are posted, or partials if partials are ok. */ dev->result = ISC_R_SUCCESS; return (DOIO_SUCCESS); } /* * Returns: * DOIO_SUCCESS The operation succeeded. dev->result contains * ISC_R_SUCCESS. * * DOIO_HARD A hard or unexpected I/O error was encountered. * dev->result contains the appropriate error. * * DOIO_SOFT A soft I/O error was encountered. No senddone * event was sent. The operation should be retried. * * No other return values are possible. */ static int doio_send(isc_socket_t *sock, isc_socketevent_t *dev) { int cc; struct iovec iov[MAXSCATTERGATHER_SEND]; size_t write_count; struct msghdr msghdr; char addrbuf[ISC_SOCKADDR_FORMATSIZE]; int attempts = 0; int send_errno; char strbuf[ISC_STRERRORSIZE]; build_msghdr_send(sock, dev, &msghdr, iov, &write_count); resend: cc = sendmsg(sock->fd, &msghdr, 0); send_errno = errno; /* * Check for error or block condition. */ if (cc < 0) { if (send_errno == EINTR && ++attempts < NRETRIES) goto resend; if (SOFT_ERROR(send_errno)) return (DOIO_SOFT); #define SOFT_OR_HARD(_system, _isc) \ if (send_errno == _system) { \ if (sock->connected) { \ dev->result = _isc; \ inc_stats(sock->manager->stats, \ sock->statsindex[STATID_SENDFAIL]); \ return (DOIO_HARD); \ } \ return (DOIO_SOFT); \ } #define ALWAYS_HARD(_system, _isc) \ if (send_errno == _system) { \ dev->result = _isc; \ inc_stats(sock->manager->stats, \ sock->statsindex[STATID_SENDFAIL]); \ return (DOIO_HARD); \ } SOFT_OR_HARD(ECONNREFUSED, ISC_R_CONNREFUSED); ALWAYS_HARD(EACCES, ISC_R_NOPERM); ALWAYS_HARD(EAFNOSUPPORT, ISC_R_ADDRNOTAVAIL); ALWAYS_HARD(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL); ALWAYS_HARD(EHOSTUNREACH, ISC_R_HOSTUNREACH); #ifdef EHOSTDOWN ALWAYS_HARD(EHOSTDOWN, ISC_R_HOSTUNREACH); #endif ALWAYS_HARD(ENETUNREACH, ISC_R_NETUNREACH); ALWAYS_HARD(ENOBUFS, ISC_R_NORESOURCES); ALWAYS_HARD(EPERM, ISC_R_HOSTUNREACH); ALWAYS_HARD(EPIPE, ISC_R_NOTCONNECTED); ALWAYS_HARD(ECONNRESET, ISC_R_CONNECTIONRESET); #undef SOFT_OR_HARD #undef ALWAYS_HARD /* * The other error types depend on whether or not the * socket is UDP or TCP. If it is UDP, some errors * that we expect to be fatal under TCP are merely * annoying, and are really soft errors. * * However, these soft errors are still returned as * a status. */ isc_sockaddr_format(&dev->address, addrbuf, sizeof(addrbuf)); isc__strerror(send_errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "internal_send: %s: %s", addrbuf, strbuf); dev->result = isc__errno2result(send_errno); inc_stats(sock->manager->stats, sock->statsindex[STATID_SENDFAIL]); return (DOIO_HARD); } if (cc == 0) { inc_stats(sock->manager->stats, sock->statsindex[STATID_SENDFAIL]); UNEXPECTED_ERROR(__FILE__, __LINE__, "doio_send: send() %s 0", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_RETURNED, "returned")); } /* * If we write less than we expected, update counters, poke. */ dev->n += cc; if ((size_t)cc != write_count) return (DOIO_SOFT); /* * Exactly what we wanted to write. We're done with this * entry. Post its completion event. */ dev->result = ISC_R_SUCCESS; return (DOIO_SUCCESS); } /* * Kill. * * Caller must ensure that the socket is not locked and no external * references exist. */ static void closesocket(isc_socketmgr_t *manager, isc_socket_t *sock, int fd) { isc_sockettype_t type = sock->type; int lockid = FDLOCK_ID(fd); /* * No one has this socket open, so the watcher doesn't have to be * poked, and the socket doesn't have to be locked. */ LOCK(&manager->fdlock[lockid]); manager->fds[fd] = NULL; if (type == isc_sockettype_fdwatch) manager->fdstate[fd] = CLOSED; else manager->fdstate[fd] = CLOSE_PENDING; UNLOCK(&manager->fdlock[lockid]); if (type == isc_sockettype_fdwatch) { /* * The caller may close the socket once this function returns, * and `fd' may be reassigned for a new socket. So we do * unwatch_fd() here, rather than defer it via select_poke(). * Note: this may complicate data protection among threads and * may reduce performance due to additional locks. One way to * solve this would be to dup() the watched descriptor, but we * take a simpler approach at this moment. */ (void)unwatch_fd(manager, fd, SELECT_POKE_READ); (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE); } else select_poke(manager, fd, SELECT_POKE_CLOSE); inc_stats(manager->stats, sock->statsindex[STATID_CLOSE]); /* * update manager->maxfd here (XXX: this should be implemented more * efficiently) */ #ifdef USE_SELECT LOCK(&manager->lock); if (manager->maxfd == fd) { int i; manager->maxfd = 0; for (i = fd - 1; i >= 0; i--) { lockid = FDLOCK_ID(i); LOCK(&manager->fdlock[lockid]); if (manager->fdstate[i] == MANAGED) { manager->maxfd = i; UNLOCK(&manager->fdlock[lockid]); break; } UNLOCK(&manager->fdlock[lockid]); } #ifdef ISC_PLATFORM_USETHREADS if (manager->maxfd < manager->pipe_fds[0]) manager->maxfd = manager->pipe_fds[0]; #endif } UNLOCK(&manager->lock); #endif /* USE_SELECT */ } static void destroy(isc_socket_t **sockp) { int fd; isc_socket_t *sock = *sockp; isc_socketmgr_t *manager = sock->manager; socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_DESTROYING, "destroying"); INSIST(ISC_LIST_EMPTY(sock->accept_list)); INSIST(ISC_LIST_EMPTY(sock->recv_list)); INSIST(ISC_LIST_EMPTY(sock->send_list)); INSIST(sock->connect_ev == NULL); REQUIRE(sock->fd == -1 || sock->fd < (int)manager->maxsocks); if (sock->fd >= 0) { fd = sock->fd; sock->fd = -1; closesocket(manager, sock, fd); } LOCK(&manager->lock); ISC_LIST_UNLINK(manager->socklist, sock, link); #ifdef ISC_PLATFORM_USETHREADS if (ISC_LIST_EMPTY(manager->socklist)) SIGNAL(&manager->shutdown_ok); #endif /* ISC_PLATFORM_USETHREADS */ UNLOCK(&manager->lock); free_socket(sockp); } static isc_result_t allocate_socket(isc_socketmgr_t *manager, isc_sockettype_t type, isc_socket_t **socketp) { isc_socket_t *sock; isc_result_t result; ISC_SOCKADDR_LEN_T cmsgbuflen; sock = isc_mem_get(manager->mctx, sizeof(*sock)); if (sock == NULL) return (ISC_R_NOMEMORY); result = ISC_R_UNEXPECTED; sock->magic = 0; sock->references = 0; sock->manager = manager; sock->type = type; sock->fd = -1; sock->statsindex = NULL; ISC_LINK_INIT(sock, link); sock->recvcmsgbuf = NULL; sock->sendcmsgbuf = NULL; /* * set up cmsg buffers */ cmsgbuflen = 0; #if defined(USE_CMSG) && defined(ISC_PLATFORM_HAVEIN6PKTINFO) cmsgbuflen = cmsg_space(sizeof(struct in6_pktinfo)); #endif #if defined(USE_CMSG) && defined(SO_TIMESTAMP) cmsgbuflen += cmsg_space(sizeof(struct timeval)); #endif sock->recvcmsgbuflen = cmsgbuflen; if (sock->recvcmsgbuflen != 0U) { sock->recvcmsgbuf = isc_mem_get(manager->mctx, cmsgbuflen); if (sock->recvcmsgbuf == NULL) goto error; } cmsgbuflen = 0; #if defined(USE_CMSG) && defined(ISC_PLATFORM_HAVEIN6PKTINFO) cmsgbuflen = cmsg_space(sizeof(struct in6_pktinfo)); #endif sock->sendcmsgbuflen = cmsgbuflen; if (sock->sendcmsgbuflen != 0U) { sock->sendcmsgbuf = isc_mem_get(manager->mctx, cmsgbuflen); if (sock->sendcmsgbuf == NULL) goto error; } memset(sock->name, 0, sizeof(sock->name)); sock->tag = NULL; /* * set up list of readers and writers to be initially empty */ ISC_LIST_INIT(sock->recv_list); ISC_LIST_INIT(sock->send_list); ISC_LIST_INIT(sock->accept_list); sock->connect_ev = NULL; sock->pending_recv = 0; sock->pending_send = 0; sock->pending_accept = 0; sock->listener = 0; sock->connected = 0; sock->connecting = 0; sock->bound = 0; /* * initialize the lock */ result = isc_mutex_init(&sock->lock); if (result != ISC_R_SUCCESS) { sock->magic = 0; goto error; } /* * Initialize readable and writable events */ ISC_EVENT_INIT(&sock->readable_ev, sizeof(intev_t), ISC_EVENTATTR_NOPURGE, NULL, ISC_SOCKEVENT_INTR, NULL, sock, sock, NULL, NULL); ISC_EVENT_INIT(&sock->writable_ev, sizeof(intev_t), ISC_EVENTATTR_NOPURGE, NULL, ISC_SOCKEVENT_INTW, NULL, sock, sock, NULL, NULL); sock->magic = SOCKET_MAGIC; *socketp = sock; return (ISC_R_SUCCESS); error: if (sock->recvcmsgbuf != NULL) isc_mem_put(manager->mctx, sock->recvcmsgbuf, sock->recvcmsgbuflen); if (sock->sendcmsgbuf != NULL) isc_mem_put(manager->mctx, sock->sendcmsgbuf, sock->sendcmsgbuflen); isc_mem_put(manager->mctx, sock, sizeof(*sock)); return (result); } /* * This event requires that the various lists be empty, that the reference * count be 1, and that the magic number is valid. The other socket bits, * like the lock, must be initialized as well. The fd associated must be * marked as closed, by setting it to -1 on close, or this routine will * also close the socket. */ static void free_socket(isc_socket_t **socketp) { isc_socket_t *sock = *socketp; INSIST(sock->references == 0); INSIST(VALID_SOCKET(sock)); INSIST(!sock->connecting); INSIST(!sock->pending_recv); INSIST(!sock->pending_send); INSIST(!sock->pending_accept); INSIST(ISC_LIST_EMPTY(sock->recv_list)); INSIST(ISC_LIST_EMPTY(sock->send_list)); INSIST(ISC_LIST_EMPTY(sock->accept_list)); INSIST(!ISC_LINK_LINKED(sock, link)); if (sock->recvcmsgbuf != NULL) isc_mem_put(sock->manager->mctx, sock->recvcmsgbuf, sock->recvcmsgbuflen); if (sock->sendcmsgbuf != NULL) isc_mem_put(sock->manager->mctx, sock->sendcmsgbuf, sock->sendcmsgbuflen); sock->magic = 0; DESTROYLOCK(&sock->lock); isc_mem_put(sock->manager->mctx, sock, sizeof(*sock)); *socketp = NULL; } #ifdef SO_BSDCOMPAT /* * This really should not be necessary to do. Having to workout * which kernel version we are on at run time so that we don't cause * the kernel to issue a warning about us using a deprecated socket option. * Such warnings should *never* be on by default in production kernels. * * We can't do this a build time because executables are moved between * machines and hence kernels. * * We can't just not set SO_BSDCOMAT because some kernels require it. */ static isc_once_t bsdcompat_once = ISC_ONCE_INIT; isc_boolean_t bsdcompat = ISC_TRUE; static void clear_bsdcompat(void) { #ifdef __linux__ struct utsname buf; char *endp; long int major; long int minor; uname(&buf); /* Can only fail if buf is bad in Linux. */ /* Paranoia in parsing can be increased, but we trust uname(). */ major = strtol(buf.release, &endp, 10); if (*endp == '.') { minor = strtol(endp+1, &endp, 10); if ((major > 2) || ((major == 2) && (minor >= 4))) { bsdcompat = ISC_FALSE; } } #endif /* __linux __ */ } #endif static isc_result_t opensocket(isc_socketmgr_t *manager, isc_socket_t *sock) { char strbuf[ISC_STRERRORSIZE]; const char *err = "socket"; int tries = 0; #if defined(USE_CMSG) || defined(SO_BSDCOMPAT) int on = 1; #endif #if defined(SO_RCVBUF) ISC_SOCKADDR_LEN_T optlen; int size; #endif again: switch (sock->type) { case isc_sockettype_udp: sock->fd = socket(sock->pf, SOCK_DGRAM, IPPROTO_UDP); break; case isc_sockettype_tcp: sock->fd = socket(sock->pf, SOCK_STREAM, IPPROTO_TCP); break; case isc_sockettype_unix: sock->fd = socket(sock->pf, SOCK_STREAM, 0); break; case isc_sockettype_fdwatch: /* * We should not be called for isc_sockettype_fdwatch sockets. */ INSIST(0); break; } if (sock->fd == -1 && errno == EINTR && tries++ < 42) goto again; #ifdef F_DUPFD /* * Leave a space for stdio and TCP to work in. */ if (manager->reserved != 0 && sock->type == isc_sockettype_udp && sock->fd >= 0 && sock->fd < manager->reserved) { int new, tmp; new = fcntl(sock->fd, F_DUPFD, manager->reserved); tmp = errno; (void)close(sock->fd); errno = tmp; sock->fd = new; err = "isc_socket_create: fcntl/reserved"; } else if (sock->fd >= 0 && sock->fd < 20) { int new, tmp; new = fcntl(sock->fd, F_DUPFD, 20); tmp = errno; (void)close(sock->fd); errno = tmp; sock->fd = new; err = "isc_socket_create: fcntl"; } #endif if (sock->fd >= (int)manager->maxsocks) { (void)close(sock->fd); isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_TOOMANYFDS, "socket: file descriptor exceeds limit (%d/%u)", sock->fd, manager->maxsocks); return (ISC_R_NORESOURCES); } if (sock->fd < 0) { switch (errno) { case EMFILE: case ENFILE: isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_TOOMANYFDS, "%s: %s", err, strbuf); /* fallthrough */ case ENOBUFS: return (ISC_R_NORESOURCES); case EPROTONOSUPPORT: case EPFNOSUPPORT: case EAFNOSUPPORT: /* * Linux 2.2 (and maybe others) return EINVAL instead of * EAFNOSUPPORT. */ case EINVAL: return (ISC_R_FAMILYNOSUPPORT); default: isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "%s() %s: %s", err, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); return (ISC_R_UNEXPECTED); } } if (make_nonblock(sock->fd) != ISC_R_SUCCESS) { (void)close(sock->fd); return (ISC_R_UNEXPECTED); } #ifdef SO_BSDCOMPAT RUNTIME_CHECK(isc_once_do(&bsdcompat_once, clear_bsdcompat) == ISC_R_SUCCESS); if (sock->type != isc_sockettype_unix && bsdcompat && setsockopt(sock->fd, SOL_SOCKET, SO_BSDCOMPAT, (void *)&on, sizeof(on)) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d, SO_BSDCOMPAT) %s: %s", sock->fd, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); /* Press on... */ } #endif #ifdef SO_NOSIGPIPE if (setsockopt(sock->fd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&on, sizeof(on)) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d, SO_NOSIGPIPE) %s: %s", sock->fd, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); /* Press on... */ } #endif #if defined(USE_CMSG) || defined(SO_RCVBUF) if (sock->type == isc_sockettype_udp) { #if defined(USE_CMSG) #if defined(SO_TIMESTAMP) if (setsockopt(sock->fd, SOL_SOCKET, SO_TIMESTAMP, (void *)&on, sizeof(on)) < 0 && errno != ENOPROTOOPT) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d, SO_TIMESTAMP) %s: %s", sock->fd, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); /* Press on... */ } #endif /* SO_TIMESTAMP */ #if defined(ISC_PLATFORM_HAVEIPV6) if (sock->pf == AF_INET6 && sock->recvcmsgbuflen == 0U) { /* * Warn explicitly because this anomaly can be hidden * in usual operation (and unexpectedly appear later). */ UNEXPECTED_ERROR(__FILE__, __LINE__, "No buffer available to receive " "IPv6 destination"); } #ifdef ISC_PLATFORM_HAVEIN6PKTINFO #ifdef IPV6_RECVPKTINFO /* RFC 3542 */ if ((sock->pf == AF_INET6) && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, (void *)&on, sizeof(on)) < 0)) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d, IPV6_RECVPKTINFO) " "%s: %s", sock->fd, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); } #else /* RFC 2292 */ if ((sock->pf == AF_INET6) && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_PKTINFO, (void *)&on, sizeof(on)) < 0)) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d, IPV6_PKTINFO) %s: %s", sock->fd, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); } #endif /* IPV6_RECVPKTINFO */ #endif /* ISC_PLATFORM_HAVEIN6PKTINFO */ #ifdef IPV6_USE_MIN_MTU /* RFC 3542, not too common yet*/ /* use minimum MTU */ if (sock->pf == AF_INET6) { (void)setsockopt(sock->fd, IPPROTO_IPV6, IPV6_USE_MIN_MTU, (void *)&on, sizeof(on)); } #endif #endif /* ISC_PLATFORM_HAVEIPV6 */ #endif /* defined(USE_CMSG) */ #if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT) /* * Turn off Path MTU discovery on IPv4/UDP sockets. */ if (sock->pf == AF_INET) { int action = IP_PMTUDISC_DONT; (void)setsockopt(sock->fd, IPPROTO_IP, IP_MTU_DISCOVER, &action, sizeof(action)); } #endif #if defined(IP_DONTFRAG) /* * Turn off Path MTU discovery on IPv4/UDP sockets. */ if (sock->pf == AF_INET) { int off = 0; (void)setsockopt(sock->fd, IPPROTO_IP, IP_DONTFRAG, &off, sizeof(off)); } #endif #if defined(SO_RCVBUF) optlen = sizeof(size); if (getsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF, (void *)&size, &optlen) >= 0 && size < RCVBUFSIZE) { size = RCVBUFSIZE; if (setsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF, (void *)&size, sizeof(size)) == -1) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d, SO_RCVBUF, %d) %s: %s", sock->fd, size, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); } } #endif } #endif /* defined(USE_CMSG) || defined(SO_RCVBUF) */ inc_stats(manager->stats, sock->statsindex[STATID_OPEN]); return (ISC_R_SUCCESS); } /*% * Create a new 'type' socket managed by 'manager'. Events * will be posted to 'task' and when dispatched 'action' will be * called with 'arg' as the arg value. The new socket is returned * in 'socketp'. */ isc_result_t isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type, isc_socket_t **socketp) { isc_socket_t *sock = NULL; isc_result_t result; int lockid; REQUIRE(VALID_MANAGER(manager)); REQUIRE(socketp != NULL && *socketp == NULL); REQUIRE(type != isc_sockettype_fdwatch); result = allocate_socket(manager, type, &sock); if (result != ISC_R_SUCCESS) return (result); switch (sock->type) { case isc_sockettype_udp: sock->statsindex = (pf == AF_INET) ? upd4statsindex : upd6statsindex; break; case isc_sockettype_tcp: sock->statsindex = (pf == AF_INET) ? tcp4statsindex : tcp6statsindex; break; case isc_sockettype_unix: sock->statsindex = unixstatsindex; break; default: INSIST(0); } sock->pf = pf; result = opensocket(manager, sock); if (result != ISC_R_SUCCESS) { inc_stats(manager->stats, sock->statsindex[STATID_OPENFAIL]); free_socket(&sock); return (result); } sock->references = 1; *socketp = sock; /* * Note we don't have to lock the socket like we normally would because * there are no external references to it yet. */ lockid = FDLOCK_ID(sock->fd); LOCK(&manager->fdlock[lockid]); manager->fds[sock->fd] = sock; manager->fdstate[sock->fd] = MANAGED; #ifdef USE_DEVPOLL INSIST(sock->manager->fdpollinfo[sock->fd].want_read == 0 && sock->manager->fdpollinfo[sock->fd].want_write == 0); #endif UNLOCK(&manager->fdlock[lockid]); LOCK(&manager->lock); ISC_LIST_APPEND(manager->socklist, sock, link); #ifdef USE_SELECT if (manager->maxfd < sock->fd) manager->maxfd = sock->fd; #endif UNLOCK(&manager->lock); socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_CREATED, "created"); return (ISC_R_SUCCESS); } isc_result_t isc_socket_open(isc_socket_t *sock) { isc_result_t result; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); REQUIRE(sock->references == 1); REQUIRE(sock->type != isc_sockettype_fdwatch); UNLOCK(&sock->lock); /* * We don't need to retain the lock hereafter, since no one else has * this socket. */ REQUIRE(sock->fd == -1); result = opensocket(sock->manager, sock); if (result != ISC_R_SUCCESS) sock->fd = -1; if (result == ISC_R_SUCCESS) { int lockid = FDLOCK_ID(sock->fd); LOCK(&sock->manager->fdlock[lockid]); sock->manager->fds[sock->fd] = sock; sock->manager->fdstate[sock->fd] = MANAGED; #ifdef USE_DEVPOLL INSIST(sock->manager->fdpollinfo[sock->fd].want_read == 0 && sock->manager->fdpollinfo[sock->fd].want_write == 0); #endif UNLOCK(&sock->manager->fdlock[lockid]); #ifdef USE_SELECT LOCK(&sock->manager->lock); if (sock->manager->maxfd < sock->fd) sock->manager->maxfd = sock->fd; UNLOCK(&sock->manager->lock); #endif } return (result); } /* * Create a new 'type' socket managed by 'manager'. Events * will be posted to 'task' and when dispatched 'action' will be * called with 'arg' as the arg value. The new socket is returned * in 'socketp'. */ isc_result_t isc_socket_fdwatchcreate(isc_socketmgr_t *manager, int fd, int flags, isc_sockfdwatch_t callback, void *cbarg, isc_task_t *task, isc_socket_t **socketp) { isc_socket_t *sock = NULL; isc_result_t result; int lockid; REQUIRE(VALID_MANAGER(manager)); REQUIRE(socketp != NULL && *socketp == NULL); result = allocate_socket(manager, isc_sockettype_fdwatch, &sock); if (result != ISC_R_SUCCESS) return (result); sock->fd = fd; sock->fdwatcharg = cbarg; sock->fdwatchcb = callback; sock->fdwatchflags = flags; sock->fdwatchtask = task; sock->statsindex = fdwatchstatsindex; sock->references = 1; *socketp = sock; /* * Note we don't have to lock the socket like we normally would because * there are no external references to it yet. */ lockid = FDLOCK_ID(sock->fd); LOCK(&manager->fdlock[lockid]); manager->fds[sock->fd] = sock; manager->fdstate[sock->fd] = MANAGED; UNLOCK(&manager->fdlock[lockid]); LOCK(&manager->lock); ISC_LIST_APPEND(manager->socklist, sock, link); #ifdef USE_SELECT if (manager->maxfd < sock->fd) manager->maxfd = sock->fd; #endif UNLOCK(&manager->lock); if (flags & ISC_SOCKFDWATCH_READ) select_poke(sock->manager, sock->fd, SELECT_POKE_READ); if (flags & ISC_SOCKFDWATCH_WRITE) select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE); socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_CREATED, "fdwatch-created"); return (ISC_R_SUCCESS); } /* * Attach to a socket. Caller must explicitly detach when it is done. */ void isc_socket_attach(isc_socket_t *sock, isc_socket_t **socketp) { REQUIRE(VALID_SOCKET(sock)); REQUIRE(socketp != NULL && *socketp == NULL); LOCK(&sock->lock); sock->references++; UNLOCK(&sock->lock); *socketp = sock; } /* * Dereference a socket. If this is the last reference to it, clean things * up by destroying the socket. */ void isc_socket_detach(isc_socket_t **socketp) { isc_socket_t *sock; isc_boolean_t kill_socket = ISC_FALSE; REQUIRE(socketp != NULL); sock = *socketp; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); REQUIRE(sock->references > 0); sock->references--; if (sock->references == 0) kill_socket = ISC_TRUE; UNLOCK(&sock->lock); if (kill_socket) destroy(&sock); *socketp = NULL; } isc_result_t isc_socket_close(isc_socket_t *sock) { int fd; isc_socketmgr_t *manager; isc_sockettype_t type; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); REQUIRE(sock->references == 1); REQUIRE(sock->type != isc_sockettype_fdwatch); REQUIRE(sock->fd >= 0 && sock->fd < (int)sock->manager->maxsocks); INSIST(!sock->connecting); INSIST(!sock->pending_recv); INSIST(!sock->pending_send); INSIST(!sock->pending_accept); INSIST(ISC_LIST_EMPTY(sock->recv_list)); INSIST(ISC_LIST_EMPTY(sock->send_list)); INSIST(ISC_LIST_EMPTY(sock->accept_list)); INSIST(sock->connect_ev == NULL); manager = sock->manager; type = sock->type; fd = sock->fd; sock->fd = -1; memset(sock->name, 0, sizeof(sock->name)); sock->tag = NULL; sock->listener = 0; sock->connected = 0; sock->connecting = 0; sock->bound = 0; isc_sockaddr_any(&sock->peer_address); UNLOCK(&sock->lock); closesocket(manager, sock, fd); return (ISC_R_SUCCESS); } /* * I/O is possible on a given socket. Schedule an event to this task that * will call an internal function to do the I/O. This will charge the * task with the I/O operation and let our select loop handler get back * to doing something real as fast as possible. * * The socket and manager must be locked before calling this function. */ static void dispatch_recv(isc_socket_t *sock) { intev_t *iev; isc_socketevent_t *ev; isc_task_t *sender; INSIST(!sock->pending_recv); if (sock->type != isc_sockettype_fdwatch) { ev = ISC_LIST_HEAD(sock->recv_list); if (ev == NULL) return; socket_log(sock, NULL, EVENT, NULL, 0, 0, "dispatch_recv: event %p -> task %p", ev, ev->ev_sender); sender = ev->ev_sender; } else { sender = sock->fdwatchtask; } sock->pending_recv = 1; iev = &sock->readable_ev; sock->references++; iev->ev_sender = sock; if (sock->type == isc_sockettype_fdwatch) iev->ev_action = internal_fdwatch_read; else iev->ev_action = internal_recv; iev->ev_arg = sock; isc_task_send(sender, (isc_event_t **)&iev); } static void dispatch_send(isc_socket_t *sock) { intev_t *iev; isc_socketevent_t *ev; isc_task_t *sender; INSIST(!sock->pending_send); if (sock->type != isc_sockettype_fdwatch) { ev = ISC_LIST_HEAD(sock->send_list); if (ev == NULL) return; socket_log(sock, NULL, EVENT, NULL, 0, 0, "dispatch_send: event %p -> task %p", ev, ev->ev_sender); sender = ev->ev_sender; } else { sender = sock->fdwatchtask; } sock->pending_send = 1; iev = &sock->writable_ev; sock->references++; iev->ev_sender = sock; if (sock->type == isc_sockettype_fdwatch) iev->ev_action = internal_fdwatch_write; else iev->ev_action = internal_send; iev->ev_arg = sock; isc_task_send(sender, (isc_event_t **)&iev); } /* * Dispatch an internal accept event. */ static void dispatch_accept(isc_socket_t *sock) { intev_t *iev; isc_socket_newconnev_t *ev; INSIST(!sock->pending_accept); /* * Are there any done events left, or were they all canceled * before the manager got the socket lock? */ ev = ISC_LIST_HEAD(sock->accept_list); if (ev == NULL) return; sock->pending_accept = 1; iev = &sock->readable_ev; sock->references++; /* keep socket around for this internal event */ iev->ev_sender = sock; iev->ev_action = internal_accept; iev->ev_arg = sock; isc_task_send(ev->ev_sender, (isc_event_t **)&iev); } static void dispatch_connect(isc_socket_t *sock) { intev_t *iev; isc_socket_connev_t *ev; iev = &sock->writable_ev; ev = sock->connect_ev; INSIST(ev != NULL); /* XXX */ INSIST(sock->connecting); sock->references++; /* keep socket around for this internal event */ iev->ev_sender = sock; iev->ev_action = internal_connect; iev->ev_arg = sock; isc_task_send(ev->ev_sender, (isc_event_t **)&iev); } /* * Dequeue an item off the given socket's read queue, set the result code * in the done event to the one provided, and send it to the task it was * destined for. * * If the event to be sent is on a list, remove it before sending. If * asked to, send and detach from the socket as well. * * Caller must have the socket locked if the event is attached to the socket. */ static void send_recvdone_event(isc_socket_t *sock, isc_socketevent_t **dev) { isc_task_t *task; task = (*dev)->ev_sender; (*dev)->ev_sender = sock; if (ISC_LINK_LINKED(*dev, ev_link)) ISC_LIST_DEQUEUE(sock->recv_list, *dev, ev_link); if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED) == ISC_SOCKEVENTATTR_ATTACHED) isc_task_sendanddetach(&task, (isc_event_t **)dev); else isc_task_send(task, (isc_event_t **)dev); } /* * See comments for send_recvdone_event() above. * * Caller must have the socket locked if the event is attached to the socket. */ static void send_senddone_event(isc_socket_t *sock, isc_socketevent_t **dev) { isc_task_t *task; INSIST(dev != NULL && *dev != NULL); task = (*dev)->ev_sender; (*dev)->ev_sender = sock; if (ISC_LINK_LINKED(*dev, ev_link)) ISC_LIST_DEQUEUE(sock->send_list, *dev, ev_link); if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED) == ISC_SOCKEVENTATTR_ATTACHED) isc_task_sendanddetach(&task, (isc_event_t **)dev); else isc_task_send(task, (isc_event_t **)dev); } /* * Call accept() on a socket, to get the new file descriptor. The listen * socket is used as a prototype to create a new isc_socket_t. The new * socket has one outstanding reference. The task receiving the event * will be detached from just after the event is delivered. * * On entry to this function, the event delivered is the internal * readable event, and the first item on the accept_list should be * the done event we want to send. If the list is empty, this is a no-op, * so just unlock and return. */ static void internal_accept(isc_task_t *me, isc_event_t *ev) { isc_socket_t *sock; isc_socketmgr_t *manager; isc_socket_newconnev_t *dev; isc_task_t *task; ISC_SOCKADDR_LEN_T addrlen; int fd; isc_result_t result = ISC_R_SUCCESS; char strbuf[ISC_STRERRORSIZE]; const char *err = "accept"; UNUSED(me); sock = ev->ev_sender; INSIST(VALID_SOCKET(sock)); LOCK(&sock->lock); socket_log(sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK, "internal_accept called, locked socket"); manager = sock->manager; INSIST(VALID_MANAGER(manager)); INSIST(sock->listener); INSIST(sock->pending_accept == 1); sock->pending_accept = 0; INSIST(sock->references > 0); sock->references--; /* the internal event is done with this socket */ if (sock->references == 0) { UNLOCK(&sock->lock); destroy(&sock); return; } /* * Get the first item off the accept list. * If it is empty, unlock the socket and return. */ dev = ISC_LIST_HEAD(sock->accept_list); if (dev == NULL) { UNLOCK(&sock->lock); return; } /* * Try to accept the new connection. If the accept fails with * EAGAIN or EINTR, simply poke the watcher to watch this socket * again. Also ignore ECONNRESET, which has been reported to * be spuriously returned on Linux 2.2.19 although it is not * a documented error for accept(). ECONNABORTED has been * reported for Solaris 8. The rest are thrown in not because * we have seen them but because they are ignored by other * daemons such as BIND 8 and Apache. */ addrlen = sizeof(dev->newsocket->peer_address.type); memset(&dev->newsocket->peer_address.type, 0, addrlen); fd = accept(sock->fd, &dev->newsocket->peer_address.type.sa, (void *)&addrlen); #ifdef F_DUPFD /* * Leave a space for stdio to work in. */ if (fd >= 0 && fd < 20) { int new, tmp; new = fcntl(fd, F_DUPFD, 20); tmp = errno; (void)close(fd); errno = tmp; fd = new; err = "accept/fcntl"; } #endif if (fd < 0) { if (SOFT_ERROR(errno)) goto soft_error; switch (errno) { case ENFILE: case EMFILE: isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_TOOMANYFDS, "%s: too many open file descriptors", err); goto soft_error; case ENOBUFS: case ENOMEM: case ECONNRESET: case ECONNABORTED: case EHOSTUNREACH: case EHOSTDOWN: case ENETUNREACH: case ENETDOWN: case ECONNREFUSED: #ifdef EPROTO case EPROTO: #endif #ifdef ENONET case ENONET: #endif goto soft_error; default: break; } isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "internal_accept: %s() %s: %s", err, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); fd = -1; result = ISC_R_UNEXPECTED; } else { if (addrlen == 0U) { UNEXPECTED_ERROR(__FILE__, __LINE__, "internal_accept(): " "accept() failed to return " "remote address"); (void)close(fd); goto soft_error; } else if (dev->newsocket->peer_address.type.sa.sa_family != sock->pf) { UNEXPECTED_ERROR(__FILE__, __LINE__, "internal_accept(): " "accept() returned peer address " "family %u (expected %u)", dev->newsocket->peer_address. type.sa.sa_family, sock->pf); (void)close(fd); goto soft_error; } else if (fd >= (int)manager->maxsocks) { isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_TOOMANYFDS, "accept: " "file descriptor exceeds limit (%d/%u)", fd, manager->maxsocks); (void)close(fd); goto soft_error; } } if (fd != -1) { dev->newsocket->peer_address.length = addrlen; dev->newsocket->pf = sock->pf; } /* * Pull off the done event. */ ISC_LIST_UNLINK(sock->accept_list, dev, ev_link); /* * Poke watcher if there are more pending accepts. */ if (!ISC_LIST_EMPTY(sock->accept_list)) select_poke(sock->manager, sock->fd, SELECT_POKE_ACCEPT); UNLOCK(&sock->lock); if (fd != -1 && (make_nonblock(fd) != ISC_R_SUCCESS)) { (void)close(fd); fd = -1; result = ISC_R_UNEXPECTED; } /* * -1 means the new socket didn't happen. */ if (fd != -1) { int lockid = FDLOCK_ID(fd); LOCK(&manager->fdlock[lockid]); manager->fds[fd] = dev->newsocket; manager->fdstate[fd] = MANAGED; UNLOCK(&manager->fdlock[lockid]); LOCK(&manager->lock); ISC_LIST_APPEND(manager->socklist, dev->newsocket, link); dev->newsocket->fd = fd; dev->newsocket->bound = 1; dev->newsocket->connected = 1; /* * Save away the remote address */ dev->address = dev->newsocket->peer_address; #ifdef USE_SELECT if (manager->maxfd < fd) manager->maxfd = fd; #endif socket_log(sock, &dev->newsocket->peer_address, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTEDCXN, "accepted connection, new socket %p", dev->newsocket); UNLOCK(&manager->lock); inc_stats(manager->stats, sock->statsindex[STATID_ACCEPT]); } else { inc_stats(manager->stats, sock->statsindex[STATID_ACCEPTFAIL]); dev->newsocket->references--; free_socket(&dev->newsocket); } /* * Fill in the done event details and send it off. */ dev->result = result; task = dev->ev_sender; dev->ev_sender = sock; isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev)); return; soft_error: select_poke(sock->manager, sock->fd, SELECT_POKE_ACCEPT); UNLOCK(&sock->lock); inc_stats(manager->stats, sock->statsindex[STATID_ACCEPTFAIL]); return; } static void internal_recv(isc_task_t *me, isc_event_t *ev) { isc_socketevent_t *dev; isc_socket_t *sock; INSIST(ev->ev_type == ISC_SOCKEVENT_INTR); sock = ev->ev_sender; INSIST(VALID_SOCKET(sock)); LOCK(&sock->lock); socket_log(sock, NULL, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV, "internal_recv: task %p got event %p", me, ev); INSIST(sock->pending_recv == 1); sock->pending_recv = 0; INSIST(sock->references > 0); sock->references--; /* the internal event is done with this socket */ if (sock->references == 0) { UNLOCK(&sock->lock); destroy(&sock); return; } /* * Try to do as much I/O as possible on this socket. There are no * limits here, currently. */ dev = ISC_LIST_HEAD(sock->recv_list); while (dev != NULL) { switch (doio_recv(sock, dev)) { case DOIO_SOFT: goto poke; case DOIO_EOF: /* * read of 0 means the remote end was closed. * Run through the event queue and dispatch all * the events with an EOF result code. */ do { dev->result = ISC_R_EOF; send_recvdone_event(sock, &dev); dev = ISC_LIST_HEAD(sock->recv_list); } while (dev != NULL); goto poke; case DOIO_SUCCESS: case DOIO_HARD: send_recvdone_event(sock, &dev); break; } dev = ISC_LIST_HEAD(sock->recv_list); } poke: if (!ISC_LIST_EMPTY(sock->recv_list)) select_poke(sock->manager, sock->fd, SELECT_POKE_READ); UNLOCK(&sock->lock); } static void internal_send(isc_task_t *me, isc_event_t *ev) { isc_socketevent_t *dev; isc_socket_t *sock; INSIST(ev->ev_type == ISC_SOCKEVENT_INTW); /* * Find out what socket this is and lock it. */ sock = (isc_socket_t *)ev->ev_sender; INSIST(VALID_SOCKET(sock)); LOCK(&sock->lock); socket_log(sock, NULL, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALSEND, "internal_send: task %p got event %p", me, ev); INSIST(sock->pending_send == 1); sock->pending_send = 0; INSIST(sock->references > 0); sock->references--; /* the internal event is done with this socket */ if (sock->references == 0) { UNLOCK(&sock->lock); destroy(&sock); return; } /* * Try to do as much I/O as possible on this socket. There are no * limits here, currently. */ dev = ISC_LIST_HEAD(sock->send_list); while (dev != NULL) { switch (doio_send(sock, dev)) { case DOIO_SOFT: goto poke; case DOIO_HARD: case DOIO_SUCCESS: send_senddone_event(sock, &dev); break; } dev = ISC_LIST_HEAD(sock->send_list); } poke: if (!ISC_LIST_EMPTY(sock->send_list)) select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE); UNLOCK(&sock->lock); } static void internal_fdwatch_write(isc_task_t *me, isc_event_t *ev) { isc_socket_t *sock; int more_data; INSIST(ev->ev_type == ISC_SOCKEVENT_INTW); /* * Find out what socket this is and lock it. */ sock = (isc_socket_t *)ev->ev_sender; INSIST(VALID_SOCKET(sock)); LOCK(&sock->lock); socket_log(sock, NULL, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALSEND, "internal_fdwatch_write: task %p got event %p", me, ev); INSIST(sock->pending_send == 1); UNLOCK(&sock->lock); more_data = (sock->fdwatchcb)(me, sock, sock->fdwatcharg); LOCK(&sock->lock); sock->pending_send = 0; INSIST(sock->references > 0); sock->references--; /* the internal event is done with this socket */ if (sock->references == 0) { UNLOCK(&sock->lock); destroy(&sock); return; } if (more_data) select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE); UNLOCK(&sock->lock); } static void internal_fdwatch_read(isc_task_t *me, isc_event_t *ev) { isc_socket_t *sock; int more_data; INSIST(ev->ev_type == ISC_SOCKEVENT_INTR); /* * Find out what socket this is and lock it. */ sock = (isc_socket_t *)ev->ev_sender; INSIST(VALID_SOCKET(sock)); LOCK(&sock->lock); socket_log(sock, NULL, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV, "internal_fdwatch_read: task %p got event %p", me, ev); INSIST(sock->pending_recv == 1); UNLOCK(&sock->lock); more_data = (sock->fdwatchcb)(me, sock, sock->fdwatcharg); LOCK(&sock->lock); sock->pending_recv = 0; INSIST(sock->references > 0); sock->references--; /* the internal event is done with this socket */ if (sock->references == 0) { UNLOCK(&sock->lock); destroy(&sock); return; } if (more_data) select_poke(sock->manager, sock->fd, SELECT_POKE_READ); UNLOCK(&sock->lock); } /* * Process read/writes on each fd here. Avoid locking * and unlocking twice if both reads and writes are possible. */ static void process_fd(isc_socketmgr_t *manager, int fd, isc_boolean_t readable, isc_boolean_t writeable) { isc_socket_t *sock; isc_boolean_t unlock_sock; isc_boolean_t unwatch_read = ISC_FALSE, unwatch_write = ISC_FALSE; int lockid = FDLOCK_ID(fd); /* * If the socket is going to be closed, don't do more I/O. */ LOCK(&manager->fdlock[lockid]); if (manager->fdstate[fd] == CLOSE_PENDING) { UNLOCK(&manager->fdlock[lockid]); (void)unwatch_fd(manager, fd, SELECT_POKE_READ); (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE); return; } sock = manager->fds[fd]; unlock_sock = ISC_FALSE; if (readable) { if (sock == NULL) { unwatch_read = ISC_TRUE; goto check_write; } unlock_sock = ISC_TRUE; LOCK(&sock->lock); if (!SOCK_DEAD(sock)) { if (sock->listener) dispatch_accept(sock); else dispatch_recv(sock); } unwatch_read = ISC_TRUE; } check_write: if (writeable) { if (sock == NULL) { unwatch_write = ISC_TRUE; goto unlock_fd; } if (!unlock_sock) { unlock_sock = ISC_TRUE; LOCK(&sock->lock); } if (!SOCK_DEAD(sock)) { if (sock->connecting) dispatch_connect(sock); else dispatch_send(sock); } unwatch_write = ISC_TRUE; } if (unlock_sock) UNLOCK(&sock->lock); unlock_fd: UNLOCK(&manager->fdlock[lockid]); if (unwatch_read) (void)unwatch_fd(manager, fd, SELECT_POKE_READ); if (unwatch_write) (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE); } #ifdef USE_KQUEUE static isc_boolean_t process_fds(isc_socketmgr_t *manager, struct kevent *events, int nevents) { int i; isc_boolean_t readable, writable; isc_boolean_t done = ISC_FALSE; #ifdef ISC_PLATFORM_USETHREADS isc_boolean_t have_ctlevent = ISC_FALSE; #endif if (nevents == manager->nevents) { /* * This is not an error, but something unexpected. If this * happens, it may indicate the need for increasing * ISC_SOCKET_MAXEVENTS. */ manager_log(manager, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_INFO, "maximum number of FD events (%d) received", nevents); } for (i = 0; i < nevents; i++) { REQUIRE(events[i].ident < manager->maxsocks); #ifdef ISC_PLATFORM_USETHREADS if (events[i].ident == (uintptr_t)manager->pipe_fds[0]) { have_ctlevent = ISC_TRUE; continue; } #endif readable = ISC_TF(events[i].filter == EVFILT_READ); writable = ISC_TF(events[i].filter == EVFILT_WRITE); process_fd(manager, events[i].ident, readable, writable); } #ifdef ISC_PLATFORM_USETHREADS if (have_ctlevent) done = process_ctlfd(manager); #endif return (done); } #elif defined(USE_EPOLL) static isc_boolean_t process_fds(isc_socketmgr_t *manager, struct epoll_event *events, int nevents) { int i; isc_boolean_t done = ISC_FALSE; #ifdef ISC_PLATFORM_USETHREADS isc_boolean_t have_ctlevent = ISC_FALSE; #endif if (nevents == manager->nevents) { manager_log(manager, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_INFO, "maximum number of FD events (%d) received", nevents); } for (i = 0; i < nevents; i++) { REQUIRE(events[i].data.fd < (int)manager->maxsocks); #ifdef ISC_PLATFORM_USETHREADS if (events[i].data.fd == manager->pipe_fds[0]) { have_ctlevent = ISC_TRUE; continue; } #endif if ((events[i].events & EPOLLERR) != 0 || (events[i].events & EPOLLHUP) != 0) { /* * epoll does not set IN/OUT bits on an erroneous * condition, so we need to try both anyway. This is a * bit inefficient, but should be okay for such rare * events. Note also that the read or write attempt * won't block because we use non-blocking sockets. */ events[i].events |= (EPOLLIN | EPOLLOUT); } process_fd(manager, events[i].data.fd, (events[i].events & EPOLLIN) != 0, (events[i].events & EPOLLOUT) != 0); } #ifdef ISC_PLATFORM_USETHREADS if (have_ctlevent) done = process_ctlfd(manager); #endif return (done); } #elif defined(USE_DEVPOLL) static isc_boolean_t process_fds(isc_socketmgr_t *manager, struct pollfd *events, int nevents) { int i; isc_boolean_t done = ISC_FALSE; #ifdef ISC_PLATFORM_USETHREADS isc_boolean_t have_ctlevent = ISC_FALSE; #endif if (nevents == manager->nevents) { manager_log(manager, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_INFO, "maximum number of FD events (%d) received", nevents); } for (i = 0; i < nevents; i++) { REQUIRE(events[i].fd < (int)manager->maxsocks); #ifdef ISC_PLATFORM_USETHREADS if (events[i].fd == manager->pipe_fds[0]) { have_ctlevent = ISC_TRUE; continue; } #endif process_fd(manager, events[i].fd, (events[i].events & POLLIN) != 0, (events[i].events & POLLOUT) != 0); } #ifdef ISC_PLATFORM_USETHREADS if (have_ctlevent) done = process_ctlfd(manager); #endif return (done); } #elif defined(USE_SELECT) static void process_fds(isc_socketmgr_t *manager, int maxfd, fd_set *readfds, fd_set *writefds) { int i; REQUIRE(maxfd <= (int)manager->maxsocks); for (i = 0; i < maxfd; i++) { #ifdef ISC_PLATFORM_USETHREADS if (i == manager->pipe_fds[0] || i == manager->pipe_fds[1]) continue; #endif /* ISC_PLATFORM_USETHREADS */ process_fd(manager, i, FD_ISSET(i, readfds), FD_ISSET(i, writefds)); } } #endif #ifdef ISC_PLATFORM_USETHREADS static isc_boolean_t process_ctlfd(isc_socketmgr_t *manager) { int msg, fd; for (;;) { select_readmsg(manager, &fd, &msg); manager_log(manager, IOEVENT, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_WATCHERMSG, "watcher got message %d " "for socket %d"), msg, fd); /* * Nothing to read? */ if (msg == SELECT_POKE_NOTHING) break; /* * Handle shutdown message. We really should * jump out of this loop right away, but * it doesn't matter if we have to do a little * more work first. */ if (msg == SELECT_POKE_SHUTDOWN) return (ISC_TRUE); /* * This is a wakeup on a socket. Look * at the event queue for both read and write, * and decide if we need to watch on it now * or not. */ wakeup_socket(manager, fd, msg); } return (ISC_FALSE); } /* * This is the thread that will loop forever, always in a select or poll * call. * * When select returns something to do, track down what thread gets to do * this I/O and post the event to it. */ static isc_threadresult_t watcher(void *uap) { isc_socketmgr_t *manager = uap; isc_boolean_t done; int ctlfd; int cc; #ifdef USE_KQUEUE const char *fnname = "kevent()"; #elif defined (USE_EPOLL) const char *fnname = "epoll_wait()"; #elif defined(USE_DEVPOLL) const char *fnname = "ioctl(DP_POLL)"; struct dvpoll dvp; #elif defined (USE_SELECT) const char *fnname = "select()"; int maxfd; #endif char strbuf[ISC_STRERRORSIZE]; #ifdef ISC_SOCKET_USE_POLLWATCH pollstate_t pollstate = poll_idle; #endif /* * Get the control fd here. This will never change. */ ctlfd = manager->pipe_fds[0]; done = ISC_FALSE; while (!done) { do { #ifdef USE_KQUEUE cc = kevent(manager->kqueue_fd, NULL, 0, manager->events, manager->nevents, NULL); #elif defined(USE_EPOLL) cc = epoll_wait(manager->epoll_fd, manager->events, manager->nevents, -1); #elif defined(USE_DEVPOLL) dvp.dp_fds = manager->events; dvp.dp_nfds = manager->nevents; #ifndef ISC_SOCKET_USE_POLLWATCH dvp.dp_timeout = -1; #else if (pollstate == poll_idle) dvp.dp_timeout = -1; else dvp.dp_timeout = ISC_SOCKET_POLLWATCH_TIMEOUT; #endif /* ISC_SOCKET_USE_POLLWATCH */ cc = ioctl(manager->devpoll_fd, DP_POLL, &dvp); #elif defined(USE_SELECT) LOCK(&manager->lock); memcpy(manager->read_fds_copy, manager->read_fds, manager->fd_bufsize); memcpy(manager->write_fds_copy, manager->write_fds, manager->fd_bufsize); maxfd = manager->maxfd + 1; UNLOCK(&manager->lock); cc = select(maxfd, manager->read_fds_copy, manager->write_fds_copy, NULL, NULL); #endif /* USE_KQUEUE */ if (cc < 0 && !SOFT_ERROR(errno)) { isc__strerror(errno, strbuf, sizeof(strbuf)); FATAL_ERROR(__FILE__, __LINE__, "%s %s: %s", fnname, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); } #if defined(USE_DEVPOLL) && defined(ISC_SOCKET_USE_POLLWATCH) if (cc == 0) { if (pollstate == poll_active) pollstate = poll_checking; else if (pollstate == poll_checking) pollstate = poll_idle; } else if (cc > 0) { if (pollstate == poll_checking) { /* * XXX: We'd like to use a more * verbose log level as it's actually an * unexpected event, but the kernel bug * reportedly happens pretty frequently * (and it can also be a false positive) * so it would be just too noisy. */ manager_log(manager, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(1), "unexpected POLL timeout"); } pollstate = poll_active; } #endif } while (cc < 0); #if defined(USE_KQUEUE) || defined (USE_EPOLL) || defined (USE_DEVPOLL) done = process_fds(manager, manager->events, cc); #elif defined(USE_SELECT) process_fds(manager, maxfd, manager->read_fds_copy, manager->write_fds_copy); /* * Process reads on internal, control fd. */ if (FD_ISSET(ctlfd, manager->read_fds_copy)) done = process_ctlfd(manager); #endif } manager_log(manager, TRACE, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_EXITING, "watcher exiting")); return ((isc_threadresult_t)0); } #endif /* ISC_PLATFORM_USETHREADS */ void isc__socketmgr_setreserved(isc_socketmgr_t *manager, isc_uint32_t reserved) { REQUIRE(VALID_MANAGER(manager)); manager->reserved = reserved; } /* * Create a new socket manager. */ static isc_result_t setup_watcher(isc_mem_t *mctx, isc_socketmgr_t *manager) { isc_result_t result; #if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL) char strbuf[ISC_STRERRORSIZE]; #endif #ifdef USE_KQUEUE manager->nevents = ISC_SOCKET_MAXEVENTS; manager->events = isc_mem_get(mctx, sizeof(struct kevent) * manager->nevents); if (manager->events == NULL) return (ISC_R_NOMEMORY); manager->kqueue_fd = kqueue(); if (manager->kqueue_fd == -1) { result = isc__errno2result(errno); isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "kqueue %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); isc_mem_put(mctx, manager->events, sizeof(struct kevent) * manager->nevents); return (result); } #ifdef ISC_PLATFORM_USETHREADS result = watch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ); if (result != ISC_R_SUCCESS) { close(manager->kqueue_fd); isc_mem_put(mctx, manager->events, sizeof(struct kevent) * manager->nevents); return (result); } #endif /* ISC_PLATFORM_USETHREADS */ #elif defined(USE_EPOLL) manager->nevents = ISC_SOCKET_MAXEVENTS; manager->events = isc_mem_get(mctx, sizeof(struct epoll_event) * manager->nevents); if (manager->events == NULL) return (ISC_R_NOMEMORY); manager->epoll_fd = epoll_create(manager->nevents); if (manager->epoll_fd == -1) { result = isc__errno2result(errno); isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "epoll_create %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); isc_mem_put(mctx, manager->events, sizeof(struct epoll_event) * manager->nevents); return (result); } #ifdef ISC_PLATFORM_USETHREADS result = watch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ); if (result != ISC_R_SUCCESS) { close(manager->epoll_fd); isc_mem_put(mctx, manager->events, sizeof(struct epoll_event) * manager->nevents); return (result); } #endif /* ISC_PLATFORM_USETHREADS */ #elif defined(USE_DEVPOLL) /* * XXXJT: /dev/poll seems to reject large numbers of events, * so we should be careful about redefining ISC_SOCKET_MAXEVENTS. */ manager->nevents = ISC_SOCKET_MAXEVENTS; manager->events = isc_mem_get(mctx, sizeof(struct pollfd) * manager->nevents); if (manager->events == NULL) return (ISC_R_NOMEMORY); /* * Note: fdpollinfo should be able to support all possible FDs, so * it must have maxsocks entries (not nevents). */ manager->fdpollinfo = isc_mem_get(mctx, sizeof(pollinfo_t) * manager->maxsocks); if (manager->fdpollinfo == NULL) { isc_mem_put(mctx, manager->events, sizeof(pollinfo_t) * manager->maxsocks); return (ISC_R_NOMEMORY); } memset(manager->fdpollinfo, 0, sizeof(pollinfo_t) * manager->maxsocks); manager->devpoll_fd = open("/dev/poll", O_RDWR); if (manager->devpoll_fd == -1) { result = isc__errno2result(errno); isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "open(/dev/poll) %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); isc_mem_put(mctx, manager->events, sizeof(struct pollfd) * manager->nevents); isc_mem_put(mctx, manager->fdpollinfo, sizeof(pollinfo_t) * manager->maxsocks); return (result); } #ifdef ISC_PLATFORM_USETHREADS result = watch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ); if (result != ISC_R_SUCCESS) { close(manager->devpoll_fd); isc_mem_put(mctx, manager->events, sizeof(struct pollfd) * manager->nevents); isc_mem_put(mctx, manager->fdpollinfo, sizeof(pollinfo_t) * manager->maxsocks); return (result); } #endif /* ISC_PLATFORM_USETHREADS */ #elif defined(USE_SELECT) UNUSED(result); #if ISC_SOCKET_MAXSOCKETS > FD_SETSIZE /* * Note: this code should also cover the case of MAXSOCKETS <= * FD_SETSIZE, but we separate the cases to avoid possible portability * issues regarding howmany() and the actual representation of fd_set. */ manager->fd_bufsize = howmany(manager->maxsocks, NFDBITS) * sizeof(fd_mask); #else manager->fd_bufsize = sizeof(fd_set); #endif manager->read_fds = NULL; manager->read_fds_copy = NULL; manager->write_fds = NULL; manager->write_fds_copy = NULL; manager->read_fds = isc_mem_get(mctx, manager->fd_bufsize); if (manager->read_fds != NULL) manager->read_fds_copy = isc_mem_get(mctx, manager->fd_bufsize); if (manager->read_fds_copy != NULL) manager->write_fds = isc_mem_get(mctx, manager->fd_bufsize); if (manager->write_fds != NULL) { manager->write_fds_copy = isc_mem_get(mctx, manager->fd_bufsize); } if (manager->write_fds_copy == NULL) { if (manager->write_fds != NULL) { isc_mem_put(mctx, manager->write_fds, manager->fd_bufsize); } if (manager->read_fds_copy != NULL) { isc_mem_put(mctx, manager->read_fds_copy, manager->fd_bufsize); } if (manager->read_fds != NULL) { isc_mem_put(mctx, manager->read_fds, manager->fd_bufsize); } return (ISC_R_NOMEMORY); } memset(manager->read_fds, 0, manager->fd_bufsize); memset(manager->write_fds, 0, manager->fd_bufsize); #ifdef ISC_PLATFORM_USETHREADS (void)watch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ); manager->maxfd = manager->pipe_fds[0]; #else /* ISC_PLATFORM_USETHREADS */ manager->maxfd = 0; #endif /* ISC_PLATFORM_USETHREADS */ #endif /* USE_KQUEUE */ return (ISC_R_SUCCESS); } static void cleanup_watcher(isc_mem_t *mctx, isc_socketmgr_t *manager) { #ifdef ISC_PLATFORM_USETHREADS isc_result_t result; result = unwatch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ); if (result != ISC_R_SUCCESS) { UNEXPECTED_ERROR(__FILE__, __LINE__, "epoll_ctl(DEL) %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); } #endif /* ISC_PLATFORM_USETHREADS */ #ifdef USE_KQUEUE close(manager->kqueue_fd); isc_mem_put(mctx, manager->events, sizeof(struct kevent) * manager->nevents); #elif defined(USE_EPOLL) close(manager->epoll_fd); isc_mem_put(mctx, manager->events, sizeof(struct epoll_event) * manager->nevents); #elif defined(USE_DEVPOLL) close(manager->devpoll_fd); isc_mem_put(mctx, manager->events, sizeof(struct pollfd) * manager->nevents); isc_mem_put(mctx, manager->fdpollinfo, sizeof(pollinfo_t) * manager->maxsocks); #elif defined(USE_SELECT) if (manager->read_fds != NULL) isc_mem_put(mctx, manager->read_fds, manager->fd_bufsize); if (manager->read_fds_copy != NULL) isc_mem_put(mctx, manager->read_fds_copy, manager->fd_bufsize); if (manager->write_fds != NULL) isc_mem_put(mctx, manager->write_fds, manager->fd_bufsize); if (manager->write_fds_copy != NULL) isc_mem_put(mctx, manager->write_fds_copy, manager->fd_bufsize); #endif /* USE_KQUEUE */ } isc_result_t isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp) { return (isc_socketmgr_create2(mctx, managerp, 0)); } isc_result_t isc_socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp, unsigned int maxsocks) { int i; isc_socketmgr_t *manager; #ifdef ISC_PLATFORM_USETHREADS char strbuf[ISC_STRERRORSIZE]; #endif isc_result_t result; REQUIRE(managerp != NULL && *managerp == NULL); #ifndef ISC_PLATFORM_USETHREADS if (socketmgr != NULL) { /* Don't allow maxsocks to be updated */ if (maxsocks > 0 && socketmgr->maxsocks != maxsocks) return (ISC_R_EXISTS); socketmgr->refs++; *managerp = socketmgr; return (ISC_R_SUCCESS); } #endif /* ISC_PLATFORM_USETHREADS */ if (maxsocks == 0) maxsocks = ISC_SOCKET_MAXSOCKETS; manager = isc_mem_get(mctx, sizeof(*manager)); if (manager == NULL) return (ISC_R_NOMEMORY); /* zero-clear so that necessary cleanup on failure will be easy */ memset(manager, 0, sizeof(*manager)); manager->maxsocks = maxsocks; manager->reserved = 0; manager->fds = isc_mem_get(mctx, manager->maxsocks * sizeof(isc_socket_t *)); if (manager->fds == NULL) { result = ISC_R_NOMEMORY; goto free_manager; } manager->fdstate = isc_mem_get(mctx, manager->maxsocks * sizeof(int)); if (manager->fdstate == NULL) { result = ISC_R_NOMEMORY; goto free_manager; } manager->stats = NULL; manager->magic = SOCKET_MANAGER_MAGIC; manager->mctx = NULL; memset(manager->fds, 0, manager->maxsocks * sizeof(isc_socket_t *)); ISC_LIST_INIT(manager->socklist); result = isc_mutex_init(&manager->lock); if (result != ISC_R_SUCCESS) goto free_manager; manager->fdlock = isc_mem_get(mctx, FDLOCK_COUNT * sizeof(isc_mutex_t)); if (manager->fdlock == NULL) { result = ISC_R_NOMEMORY; goto cleanup_lock; } for (i = 0; i < FDLOCK_COUNT; i++) { result = isc_mutex_init(&manager->fdlock[i]); if (result != ISC_R_SUCCESS) { while (--i >= 0) DESTROYLOCK(&manager->fdlock[i]); isc_mem_put(mctx, manager->fdlock, FDLOCK_COUNT * sizeof(isc_mutex_t)); manager->fdlock = NULL; goto cleanup_lock; } } #ifdef ISC_PLATFORM_USETHREADS if (isc_condition_init(&manager->shutdown_ok) != ISC_R_SUCCESS) { UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_condition_init() %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); result = ISC_R_UNEXPECTED; goto cleanup_lock; } /* * Create the special fds that will be used to wake up the * select/poll loop when something internal needs to be done. */ if (pipe(manager->pipe_fds) != 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "pipe() %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); result = ISC_R_UNEXPECTED; goto cleanup_condition; } RUNTIME_CHECK(make_nonblock(manager->pipe_fds[0]) == ISC_R_SUCCESS); #if 0 RUNTIME_CHECK(make_nonblock(manager->pipe_fds[1]) == ISC_R_SUCCESS); #endif #else /* ISC_PLATFORM_USETHREADS */ manager->refs = 1; #endif /* ISC_PLATFORM_USETHREADS */ /* * Set up initial state for the select loop */ result = setup_watcher(mctx, manager); if (result != ISC_R_SUCCESS) goto cleanup; memset(manager->fdstate, 0, manager->maxsocks * sizeof(int)); #ifdef ISC_PLATFORM_USETHREADS /* * Start up the select/poll thread. */ if (isc_thread_create(watcher, manager, &manager->watcher) != ISC_R_SUCCESS) { UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_thread_create() %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); cleanup_watcher(mctx, manager); result = ISC_R_UNEXPECTED; goto cleanup; } #endif /* ISC_PLATFORM_USETHREADS */ isc_mem_attach(mctx, &manager->mctx); #ifndef ISC_PLATFORM_USETHREADS socketmgr = manager; #endif /* ISC_PLATFORM_USETHREADS */ *managerp = manager; return (ISC_R_SUCCESS); cleanup: #ifdef ISC_PLATFORM_USETHREADS (void)close(manager->pipe_fds[0]); (void)close(manager->pipe_fds[1]); #endif /* ISC_PLATFORM_USETHREADS */ #ifdef ISC_PLATFORM_USETHREADS cleanup_condition: (void)isc_condition_destroy(&manager->shutdown_ok); #endif /* ISC_PLATFORM_USETHREADS */ cleanup_lock: if (manager->fdlock != NULL) { for (i = 0; i < FDLOCK_COUNT; i++) DESTROYLOCK(&manager->fdlock[i]); } DESTROYLOCK(&manager->lock); free_manager: if (manager->fdlock != NULL) { isc_mem_put(mctx, manager->fdlock, FDLOCK_COUNT * sizeof(isc_mutex_t)); } if (manager->fdstate != NULL) { isc_mem_put(mctx, manager->fdstate, manager->maxsocks * sizeof(int)); } if (manager->fds != NULL) { isc_mem_put(mctx, manager->fds, manager->maxsocks * sizeof(isc_socket_t *)); } isc_mem_put(mctx, manager, sizeof(*manager)); return (result); } isc_result_t isc_socketmgr_getmaxsockets(isc_socketmgr_t *manager, unsigned int *nsockp) { REQUIRE(VALID_MANAGER(manager)); REQUIRE(nsockp != NULL); *nsockp = manager->maxsocks; return (ISC_R_SUCCESS); } void isc_socketmgr_setstats(isc_socketmgr_t *manager, isc_stats_t *stats) { REQUIRE(VALID_MANAGER(manager)); REQUIRE(ISC_LIST_EMPTY(manager->socklist)); REQUIRE(manager->stats == NULL); REQUIRE(isc_stats_ncounters(stats) == isc_sockstatscounter_max); isc_stats_attach(stats, &manager->stats); } void isc_socketmgr_destroy(isc_socketmgr_t **managerp) { isc_socketmgr_t *manager; int i; isc_mem_t *mctx; /* * Destroy a socket manager. */ REQUIRE(managerp != NULL); manager = *managerp; REQUIRE(VALID_MANAGER(manager)); #ifndef ISC_PLATFORM_USETHREADS if (manager->refs > 1) { manager->refs--; *managerp = NULL; return; } #endif /* ISC_PLATFORM_USETHREADS */ LOCK(&manager->lock); #ifdef ISC_PLATFORM_USETHREADS /* * Wait for all sockets to be destroyed. */ while (!ISC_LIST_EMPTY(manager->socklist)) { manager_log(manager, CREATION, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_SOCKETSREMAIN, "sockets exist")); WAIT(&manager->shutdown_ok, &manager->lock); } #else /* ISC_PLATFORM_USETHREADS */ /* * Hope all sockets have been destroyed. */ if (!ISC_LIST_EMPTY(manager->socklist)) { manager_log(manager, CREATION, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_SOCKETSREMAIN, "sockets exist")); INSIST(0); } #endif /* ISC_PLATFORM_USETHREADS */ UNLOCK(&manager->lock); /* * Here, poke our select/poll thread. Do this by closing the write * half of the pipe, which will send EOF to the read half. * This is currently a no-op in the non-threaded case. */ select_poke(manager, 0, SELECT_POKE_SHUTDOWN); #ifdef ISC_PLATFORM_USETHREADS /* * Wait for thread to exit. */ if (isc_thread_join(manager->watcher, NULL) != ISC_R_SUCCESS) UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_thread_join() %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); #endif /* ISC_PLATFORM_USETHREADS */ /* * Clean up. */ cleanup_watcher(manager->mctx, manager); #ifdef ISC_PLATFORM_USETHREADS (void)close(manager->pipe_fds[0]); (void)close(manager->pipe_fds[1]); (void)isc_condition_destroy(&manager->shutdown_ok); #endif /* ISC_PLATFORM_USETHREADS */ for (i = 0; i < (int)manager->maxsocks; i++) if (manager->fdstate[i] == CLOSE_PENDING) /* no need to lock */ (void)close(i); isc_mem_put(manager->mctx, manager->fds, manager->maxsocks * sizeof(isc_socket_t *)); isc_mem_put(manager->mctx, manager->fdstate, manager->maxsocks * sizeof(int)); if (manager->stats != NULL) isc_stats_detach(&manager->stats); if (manager->fdlock != NULL) { for (i = 0; i < FDLOCK_COUNT; i++) DESTROYLOCK(&manager->fdlock[i]); isc_mem_put(manager->mctx, manager->fdlock, FDLOCK_COUNT * sizeof(isc_mutex_t)); } DESTROYLOCK(&manager->lock); manager->magic = 0; mctx= manager->mctx; isc_mem_put(mctx, manager, sizeof(*manager)); isc_mem_detach(&mctx); *managerp = NULL; } static isc_result_t socket_recv(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, unsigned int flags) { int io_state; isc_boolean_t have_lock = ISC_FALSE; isc_task_t *ntask = NULL; isc_result_t result = ISC_R_SUCCESS; dev->ev_sender = task; if (sock->type == isc_sockettype_udp) { io_state = doio_recv(sock, dev); } else { LOCK(&sock->lock); have_lock = ISC_TRUE; if (ISC_LIST_EMPTY(sock->recv_list)) io_state = doio_recv(sock, dev); else io_state = DOIO_SOFT; } switch (io_state) { case DOIO_SOFT: /* * We couldn't read all or part of the request right now, so * queue it. * * Attach to socket and to task */ isc_task_attach(task, &ntask); dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED; if (!have_lock) { LOCK(&sock->lock); have_lock = ISC_TRUE; } /* * Enqueue the request. If the socket was previously not being * watched, poke the watcher to start paying attention to it. */ if (ISC_LIST_EMPTY(sock->recv_list) && !sock->pending_recv) select_poke(sock->manager, sock->fd, SELECT_POKE_READ); ISC_LIST_ENQUEUE(sock->recv_list, dev, ev_link); socket_log(sock, NULL, EVENT, NULL, 0, 0, "socket_recv: event %p -> task %p", dev, ntask); if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0) result = ISC_R_INPROGRESS; break; case DOIO_EOF: dev->result = ISC_R_EOF; /* fallthrough */ case DOIO_HARD: case DOIO_SUCCESS: if ((flags & ISC_SOCKFLAG_IMMEDIATE) == 0) send_recvdone_event(sock, &dev); break; } if (have_lock) UNLOCK(&sock->lock); return (result); } isc_result_t isc_socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist, unsigned int minimum, isc_task_t *task, isc_taskaction_t action, const void *arg) { isc_socketevent_t *dev; isc_socketmgr_t *manager; unsigned int iocount; isc_buffer_t *buffer; REQUIRE(VALID_SOCKET(sock)); REQUIRE(buflist != NULL); REQUIRE(!ISC_LIST_EMPTY(*buflist)); REQUIRE(task != NULL); REQUIRE(action != NULL); manager = sock->manager; REQUIRE(VALID_MANAGER(manager)); iocount = isc_bufferlist_availablecount(buflist); REQUIRE(iocount > 0); INSIST(sock->bound); dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg); if (dev == NULL) { return (ISC_R_NOMEMORY); } /* * UDP sockets are always partial read */ if (sock->type == isc_sockettype_udp) dev->minimum = 1; else { if (minimum == 0) dev->minimum = iocount; else dev->minimum = minimum; } /* * Move each buffer from the passed in list to our internal one. */ buffer = ISC_LIST_HEAD(*buflist); while (buffer != NULL) { ISC_LIST_DEQUEUE(*buflist, buffer, link); ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link); buffer = ISC_LIST_HEAD(*buflist); } return (socket_recv(sock, dev, task, 0)); } isc_result_t isc_socket_recv(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, isc_task_t *task, isc_taskaction_t action, const void *arg) { isc_socketevent_t *dev; isc_socketmgr_t *manager; REQUIRE(VALID_SOCKET(sock)); REQUIRE(action != NULL); manager = sock->manager; REQUIRE(VALID_MANAGER(manager)); INSIST(sock->bound); dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg); if (dev == NULL) return (ISC_R_NOMEMORY); return (isc_socket_recv2(sock, region, minimum, task, dev, 0)); } isc_result_t isc_socket_recv2(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, isc_task_t *task, isc_socketevent_t *event, unsigned int flags) { event->ev_sender = sock; event->result = ISC_R_UNEXPECTED; ISC_LIST_INIT(event->bufferlist); event->region = *region; event->n = 0; event->offset = 0; event->attributes = 0; /* * UDP sockets are always partial read. */ if (sock->type == isc_sockettype_udp) event->minimum = 1; else { if (minimum == 0) event->minimum = region->length; else event->minimum = minimum; } return (socket_recv(sock, event, task, flags)); } static isc_result_t socket_send(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, unsigned int flags) { int io_state; isc_boolean_t have_lock = ISC_FALSE; isc_task_t *ntask = NULL; isc_result_t result = ISC_R_SUCCESS; dev->ev_sender = task; set_dev_address(address, sock, dev); if (pktinfo != NULL) { dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO; dev->pktinfo = *pktinfo; if (!isc_sockaddr_issitelocal(&dev->address) && !isc_sockaddr_islinklocal(&dev->address)) { socket_log(sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_PKTINFOPROVIDED, "pktinfo structure provided, ifindex %u " "(set to 0)", pktinfo->ipi6_ifindex); /* * Set the pktinfo index to 0 here, to let the * kernel decide what interface it should send on. */ dev->pktinfo.ipi6_ifindex = 0; } } if (sock->type == isc_sockettype_udp) io_state = doio_send(sock, dev); else { LOCK(&sock->lock); have_lock = ISC_TRUE; if (ISC_LIST_EMPTY(sock->send_list)) io_state = doio_send(sock, dev); else io_state = DOIO_SOFT; } switch (io_state) { case DOIO_SOFT: /* * We couldn't send all or part of the request right now, so * queue it unless ISC_SOCKFLAG_NORETRY is set. */ if ((flags & ISC_SOCKFLAG_NORETRY) == 0) { isc_task_attach(task, &ntask); dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED; if (!have_lock) { LOCK(&sock->lock); have_lock = ISC_TRUE; } /* * Enqueue the request. If the socket was previously * not being watched, poke the watcher to start * paying attention to it. */ if (ISC_LIST_EMPTY(sock->send_list) && !sock->pending_send) select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE); ISC_LIST_ENQUEUE(sock->send_list, dev, ev_link); socket_log(sock, NULL, EVENT, NULL, 0, 0, "socket_send: event %p -> task %p", dev, ntask); if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0) result = ISC_R_INPROGRESS; break; } case DOIO_HARD: case DOIO_SUCCESS: if ((flags & ISC_SOCKFLAG_IMMEDIATE) == 0) send_senddone_event(sock, &dev); break; } if (have_lock) UNLOCK(&sock->lock); return (result); } isc_result_t isc_socket_send(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, isc_taskaction_t action, const void *arg) { /* * REQUIRE() checking is performed in isc_socket_sendto(). */ return (isc_socket_sendto(sock, region, task, action, arg, NULL, NULL)); } isc_result_t isc_socket_sendto(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) { isc_socketevent_t *dev; isc_socketmgr_t *manager; REQUIRE(VALID_SOCKET(sock)); REQUIRE(region != NULL); REQUIRE(task != NULL); REQUIRE(action != NULL); manager = sock->manager; REQUIRE(VALID_MANAGER(manager)); INSIST(sock->bound); dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg); if (dev == NULL) { return (ISC_R_NOMEMORY); } dev->region = *region; return (socket_send(sock, dev, task, address, pktinfo, 0)); } isc_result_t isc_socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, isc_task_t *task, isc_taskaction_t action, const void *arg) { return (isc_socket_sendtov(sock, buflist, task, action, arg, NULL, NULL)); } isc_result_t isc_socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) { isc_socketevent_t *dev; isc_socketmgr_t *manager; unsigned int iocount; isc_buffer_t *buffer; REQUIRE(VALID_SOCKET(sock)); REQUIRE(buflist != NULL); REQUIRE(!ISC_LIST_EMPTY(*buflist)); REQUIRE(task != NULL); REQUIRE(action != NULL); manager = sock->manager; REQUIRE(VALID_MANAGER(manager)); iocount = isc_bufferlist_usedcount(buflist); REQUIRE(iocount > 0); dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg); if (dev == NULL) { return (ISC_R_NOMEMORY); } /* * Move each buffer from the passed in list to our internal one. */ buffer = ISC_LIST_HEAD(*buflist); while (buffer != NULL) { ISC_LIST_DEQUEUE(*buflist, buffer, link); ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link); buffer = ISC_LIST_HEAD(*buflist); } return (socket_send(sock, dev, task, address, pktinfo, 0)); } isc_result_t isc_socket_sendto2(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, isc_socketevent_t *event, unsigned int flags) { REQUIRE((flags & ~(ISC_SOCKFLAG_IMMEDIATE|ISC_SOCKFLAG_NORETRY)) == 0); if ((flags & ISC_SOCKFLAG_NORETRY) != 0) REQUIRE(sock->type == isc_sockettype_udp); event->ev_sender = sock; event->result = ISC_R_UNEXPECTED; ISC_LIST_INIT(event->bufferlist); event->region = *region; event->n = 0; event->offset = 0; event->attributes = 0; return (socket_send(sock, event, task, address, pktinfo, flags)); } void isc_socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) { #ifdef ISC_PLATFORM_HAVESYSUNH int s; struct stat sb; char strbuf[ISC_STRERRORSIZE]; if (sockaddr->type.sa.sa_family != AF_UNIX) return; #ifndef S_ISSOCK #if defined(S_IFMT) && defined(S_IFSOCK) #define S_ISSOCK(mode) ((mode & S_IFMT)==S_IFSOCK) #elif defined(_S_IFMT) && defined(S_IFSOCK) #define S_ISSOCK(mode) ((mode & _S_IFMT)==S_IFSOCK) #endif #endif #ifndef S_ISFIFO #if defined(S_IFMT) && defined(S_IFIFO) #define S_ISFIFO(mode) ((mode & S_IFMT)==S_IFIFO) #elif defined(_S_IFMT) && defined(S_IFIFO) #define S_ISFIFO(mode) ((mode & _S_IFMT)==S_IFIFO) #endif #endif #if !defined(S_ISFIFO) && !defined(S_ISSOCK) #error You need to define S_ISFIFO and S_ISSOCK as appropriate for your platform. See . #endif #ifndef S_ISFIFO #define S_ISFIFO(mode) 0 #endif #ifndef S_ISSOCK #define S_ISSOCK(mode) 0 #endif if (active) { if (stat(sockaddr->type.sunix.sun_path, &sb) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "isc_socket_cleanunix: stat(%s): %s", sockaddr->type.sunix.sun_path, strbuf); return; } if (!(S_ISSOCK(sb.st_mode) || S_ISFIFO(sb.st_mode))) { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "isc_socket_cleanunix: %s: not a socket", sockaddr->type.sunix.sun_path); return; } if (unlink(sockaddr->type.sunix.sun_path) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "isc_socket_cleanunix: unlink(%s): %s", sockaddr->type.sunix.sun_path, strbuf); } return; } s = socket(AF_UNIX, SOCK_STREAM, 0); if (s < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, "isc_socket_cleanunix: socket(%s): %s", sockaddr->type.sunix.sun_path, strbuf); return; } if (stat(sockaddr->type.sunix.sun_path, &sb) < 0) { switch (errno) { case ENOENT: /* We exited cleanly last time */ break; default: isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, "isc_socket_cleanunix: stat(%s): %s", sockaddr->type.sunix.sun_path, strbuf); break; } goto cleanup; } if (!(S_ISSOCK(sb.st_mode) || S_ISFIFO(sb.st_mode))) { isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, "isc_socket_cleanunix: %s: not a socket", sockaddr->type.sunix.sun_path); goto cleanup; } if (connect(s, (struct sockaddr *)&sockaddr->type.sunix, sizeof(sockaddr->type.sunix)) < 0) { switch (errno) { case ECONNREFUSED: case ECONNRESET: if (unlink(sockaddr->type.sunix.sun_path) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, "isc_socket_cleanunix: " "unlink(%s): %s", sockaddr->type.sunix.sun_path, strbuf); } break; default: isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING, "isc_socket_cleanunix: connect(%s): %s", sockaddr->type.sunix.sun_path, strbuf); break; } } cleanup: close(s); #else UNUSED(sockaddr); UNUSED(active); #endif } isc_result_t isc_socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm, isc_uint32_t owner, isc_uint32_t group) { #ifdef ISC_PLATFORM_HAVESYSUNH isc_result_t result = ISC_R_SUCCESS; char strbuf[ISC_STRERRORSIZE]; char path[sizeof(sockaddr->type.sunix.sun_path)]; #ifdef NEED_SECURE_DIRECTORY char *slash; #endif REQUIRE(sockaddr->type.sa.sa_family == AF_UNIX); INSIST(strlen(sockaddr->type.sunix.sun_path) < sizeof(path)); strcpy(path, sockaddr->type.sunix.sun_path); #ifdef NEED_SECURE_DIRECTORY slash = strrchr(path, '/'); if (slash != NULL) { if (slash != path) *slash = '\0'; else strcpy(path, "/"); } else strcpy(path, "."); #endif if (chmod(path, perm) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "isc_socket_permunix: chmod(%s, %d): %s", path, perm, strbuf); result = ISC_R_FAILURE; } if (chown(path, owner, group) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, "isc_socket_permunix: chown(%s, %d, %d): %s", path, owner, group, strbuf); result = ISC_R_FAILURE; } return (result); #else UNUSED(sockaddr); UNUSED(perm); UNUSED(owner); UNUSED(group); return (ISC_R_NOTIMPLEMENTED); #endif } isc_result_t isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr, unsigned int options) { char strbuf[ISC_STRERRORSIZE]; int on = 1; LOCK(&sock->lock); INSIST(!sock->bound); if (sock->pf != sockaddr->type.sa.sa_family) { UNLOCK(&sock->lock); return (ISC_R_FAMILYMISMATCH); } /* * Only set SO_REUSEADDR when we want a specific port. */ #ifdef AF_UNIX if (sock->pf == AF_UNIX) goto bind_socket; #endif if ((options & ISC_SOCKET_REUSEADDRESS) != 0 && isc_sockaddr_getport(sockaddr) != (in_port_t)0 && setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)) < 0) { UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d) %s", sock->fd, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); /* Press on... */ } #ifdef AF_UNIX bind_socket: #endif if (bind(sock->fd, &sockaddr->type.sa, sockaddr->length) < 0) { inc_stats(sock->manager->stats, sock->statsindex[STATID_BINDFAIL]); UNLOCK(&sock->lock); switch (errno) { case EACCES: return (ISC_R_NOPERM); case EADDRNOTAVAIL: return (ISC_R_ADDRNOTAVAIL); case EADDRINUSE: return (ISC_R_ADDRINUSE); case EINVAL: return (ISC_R_BOUND); default: isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "bind: %s", strbuf); return (ISC_R_UNEXPECTED); } } socket_log(sock, sockaddr, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND, "bound"); sock->bound = 1; UNLOCK(&sock->lock); return (ISC_R_SUCCESS); } isc_result_t isc_socket_filter(isc_socket_t *sock, const char *filter) { #ifdef SO_ACCEPTFILTER char strbuf[ISC_STRERRORSIZE]; struct accept_filter_arg afa; #else UNUSED(sock); UNUSED(filter); #endif REQUIRE(VALID_SOCKET(sock)); #ifdef SO_ACCEPTFILTER bzero(&afa, sizeof(afa)); strncpy(afa.af_name, filter, sizeof(afa.af_name)); if (setsockopt(sock->fd, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa)) == -1) { isc__strerror(errno, strbuf, sizeof(strbuf)); socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_FILTER, "setsockopt(SO_ACCEPTFILTER): %s", strbuf); return (ISC_R_FAILURE); } return (ISC_R_SUCCESS); #else return (ISC_R_NOTIMPLEMENTED); #endif } /* * Set up to listen on a given socket. We do this by creating an internal * event that will be dispatched when the socket has read activity. The * watcher will send the internal event to the task when there is a new * connection. * * Unlike in read, we don't preallocate a done event here. Every time there * is a new connection we'll have to allocate a new one anyway, so we might * as well keep things simple rather than having to track them. */ isc_result_t isc_socket_listen(isc_socket_t *sock, unsigned int backlog) { char strbuf[ISC_STRERRORSIZE]; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); REQUIRE(!sock->listener); REQUIRE(sock->bound); REQUIRE(sock->type == isc_sockettype_tcp || sock->type == isc_sockettype_unix); if (backlog == 0) backlog = SOMAXCONN; if (listen(sock->fd, (int)backlog) < 0) { UNLOCK(&sock->lock); isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "listen: %s", strbuf); return (ISC_R_UNEXPECTED); } sock->listener = 1; UNLOCK(&sock->lock); return (ISC_R_SUCCESS); } /* * This should try to do aggressive accept() XXXMLG */ isc_result_t isc_socket_accept(isc_socket_t *sock, isc_task_t *task, isc_taskaction_t action, const void *arg) { isc_socket_newconnev_t *dev; isc_socketmgr_t *manager; isc_task_t *ntask = NULL; isc_socket_t *nsock; isc_result_t result; isc_boolean_t do_poke = ISC_FALSE; REQUIRE(VALID_SOCKET(sock)); manager = sock->manager; REQUIRE(VALID_MANAGER(manager)); LOCK(&sock->lock); REQUIRE(sock->listener); /* * Sender field is overloaded here with the task we will be sending * this event to. Just before the actual event is delivered the * actual ev_sender will be touched up to be the socket. */ dev = (isc_socket_newconnev_t *) isc_event_allocate(manager->mctx, task, ISC_SOCKEVENT_NEWCONN, action, arg, sizeof(*dev)); if (dev == NULL) { UNLOCK(&sock->lock); return (ISC_R_NOMEMORY); } ISC_LINK_INIT(dev, ev_link); result = allocate_socket(manager, sock->type, &nsock); if (result != ISC_R_SUCCESS) { isc_event_free(ISC_EVENT_PTR(&dev)); UNLOCK(&sock->lock); return (result); } /* * Attach to socket and to task. */ isc_task_attach(task, &ntask); nsock->references++; nsock->statsindex = sock->statsindex; dev->ev_sender = ntask; dev->newsocket = nsock; /* * Poke watcher here. We still have the socket locked, so there * is no race condition. We will keep the lock for such a short * bit of time waking it up now or later won't matter all that much. */ if (ISC_LIST_EMPTY(sock->accept_list)) do_poke = ISC_TRUE; ISC_LIST_ENQUEUE(sock->accept_list, dev, ev_link); if (do_poke) select_poke(manager, sock->fd, SELECT_POKE_ACCEPT); UNLOCK(&sock->lock); return (ISC_R_SUCCESS); } isc_result_t isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, isc_task_t *task, isc_taskaction_t action, const void *arg) { isc_socket_connev_t *dev; isc_task_t *ntask = NULL; isc_socketmgr_t *manager; int cc; char strbuf[ISC_STRERRORSIZE]; REQUIRE(VALID_SOCKET(sock)); REQUIRE(addr != NULL); REQUIRE(task != NULL); REQUIRE(action != NULL); manager = sock->manager; REQUIRE(VALID_MANAGER(manager)); REQUIRE(addr != NULL); if (isc_sockaddr_ismulticast(addr)) return (ISC_R_MULTICAST); LOCK(&sock->lock); REQUIRE(!sock->connecting); dev = (isc_socket_connev_t *)isc_event_allocate(manager->mctx, sock, ISC_SOCKEVENT_CONNECT, action, arg, sizeof(*dev)); if (dev == NULL) { UNLOCK(&sock->lock); return (ISC_R_NOMEMORY); } ISC_LINK_INIT(dev, ev_link); /* * Try to do the connect right away, as there can be only one * outstanding, and it might happen to complete. */ sock->peer_address = *addr; cc = connect(sock->fd, &addr->type.sa, addr->length); if (cc < 0) { /* * HP-UX "fails" to connect a UDP socket and sets errno to * EINPROGRESS if it's non-blocking. We'd rather regard this as * a success and let the user detect it if it's really an error * at the time of sending a packet on the socket. */ if (sock->type == isc_sockettype_udp && errno == EINPROGRESS) { cc = 0; goto success; } if (SOFT_ERROR(errno) || errno == EINPROGRESS) goto queue; switch (errno) { #define ERROR_MATCH(a, b) case a: dev->result = b; goto err_exit; ERROR_MATCH(EACCES, ISC_R_NOPERM); ERROR_MATCH(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL); ERROR_MATCH(EAFNOSUPPORT, ISC_R_ADDRNOTAVAIL); ERROR_MATCH(ECONNREFUSED, ISC_R_CONNREFUSED); ERROR_MATCH(EHOSTUNREACH, ISC_R_HOSTUNREACH); #ifdef EHOSTDOWN ERROR_MATCH(EHOSTDOWN, ISC_R_HOSTUNREACH); #endif ERROR_MATCH(ENETUNREACH, ISC_R_NETUNREACH); ERROR_MATCH(ENOBUFS, ISC_R_NORESOURCES); ERROR_MATCH(EPERM, ISC_R_HOSTUNREACH); ERROR_MATCH(EPIPE, ISC_R_NOTCONNECTED); ERROR_MATCH(ECONNRESET, ISC_R_CONNECTIONRESET); #undef ERROR_MATCH } sock->connected = 0; isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "%d/%s", errno, strbuf); UNLOCK(&sock->lock); inc_stats(sock->manager->stats, sock->statsindex[STATID_CONNECTFAIL]); isc_event_free(ISC_EVENT_PTR(&dev)); return (ISC_R_UNEXPECTED); err_exit: sock->connected = 0; isc_task_send(task, ISC_EVENT_PTR(&dev)); UNLOCK(&sock->lock); inc_stats(sock->manager->stats, sock->statsindex[STATID_CONNECTFAIL]); return (ISC_R_SUCCESS); } /* * If connect completed, fire off the done event. */ success: if (cc == 0) { sock->connected = 1; sock->bound = 1; dev->result = ISC_R_SUCCESS; isc_task_send(task, ISC_EVENT_PTR(&dev)); UNLOCK(&sock->lock); inc_stats(sock->manager->stats, sock->statsindex[STATID_CONNECT]); return (ISC_R_SUCCESS); } queue: /* * Attach to task. */ isc_task_attach(task, &ntask); sock->connecting = 1; dev->ev_sender = ntask; /* * Poke watcher here. We still have the socket locked, so there * is no race condition. We will keep the lock for such a short * bit of time waking it up now or later won't matter all that much. */ if (sock->connect_ev == NULL) select_poke(manager, sock->fd, SELECT_POKE_CONNECT); sock->connect_ev = dev; UNLOCK(&sock->lock); return (ISC_R_SUCCESS); } /* * Called when a socket with a pending connect() finishes. */ static void internal_connect(isc_task_t *me, isc_event_t *ev) { isc_socket_t *sock; isc_socket_connev_t *dev; isc_task_t *task; int cc; ISC_SOCKADDR_LEN_T optlen; char strbuf[ISC_STRERRORSIZE]; char peerbuf[ISC_SOCKADDR_FORMATSIZE]; UNUSED(me); INSIST(ev->ev_type == ISC_SOCKEVENT_INTW); sock = ev->ev_sender; INSIST(VALID_SOCKET(sock)); LOCK(&sock->lock); /* * When the internal event was sent the reference count was bumped * to keep the socket around for us. Decrement the count here. */ INSIST(sock->references > 0); sock->references--; if (sock->references == 0) { UNLOCK(&sock->lock); destroy(&sock); return; } /* * Has this event been canceled? */ dev = sock->connect_ev; if (dev == NULL) { INSIST(!sock->connecting); UNLOCK(&sock->lock); return; } INSIST(sock->connecting); sock->connecting = 0; /* * Get any possible error status here. */ optlen = sizeof(cc); if (getsockopt(sock->fd, SOL_SOCKET, SO_ERROR, (void *)&cc, (void *)&optlen) < 0) cc = errno; else errno = cc; if (errno != 0) { /* * If the error is EAGAIN, just re-select on this * fd and pretend nothing strange happened. */ if (SOFT_ERROR(errno) || errno == EINPROGRESS) { sock->connecting = 1; select_poke(sock->manager, sock->fd, SELECT_POKE_CONNECT); UNLOCK(&sock->lock); return; } inc_stats(sock->manager->stats, sock->statsindex[STATID_CONNECTFAIL]); /* * Translate other errors into ISC_R_* flavors. */ switch (errno) { #define ERROR_MATCH(a, b) case a: dev->result = b; break; ERROR_MATCH(EACCES, ISC_R_NOPERM); ERROR_MATCH(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL); ERROR_MATCH(EAFNOSUPPORT, ISC_R_ADDRNOTAVAIL); ERROR_MATCH(ECONNREFUSED, ISC_R_CONNREFUSED); ERROR_MATCH(EHOSTUNREACH, ISC_R_HOSTUNREACH); #ifdef EHOSTDOWN ERROR_MATCH(EHOSTDOWN, ISC_R_HOSTUNREACH); #endif ERROR_MATCH(ENETUNREACH, ISC_R_NETUNREACH); ERROR_MATCH(ENOBUFS, ISC_R_NORESOURCES); ERROR_MATCH(EPERM, ISC_R_HOSTUNREACH); ERROR_MATCH(EPIPE, ISC_R_NOTCONNECTED); ERROR_MATCH(ETIMEDOUT, ISC_R_TIMEDOUT); ERROR_MATCH(ECONNRESET, ISC_R_CONNECTIONRESET); #undef ERROR_MATCH default: dev->result = ISC_R_UNEXPECTED; isc_sockaddr_format(&sock->peer_address, peerbuf, sizeof(peerbuf)); isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "internal_connect: connect(%s) %s", peerbuf, strbuf); } } else { inc_stats(sock->manager->stats, sock->statsindex[STATID_CONNECT]); dev->result = ISC_R_SUCCESS; sock->connected = 1; sock->bound = 1; } sock->connect_ev = NULL; UNLOCK(&sock->lock); task = dev->ev_sender; dev->ev_sender = sock; isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev)); } isc_result_t isc_socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp) { isc_result_t result; REQUIRE(VALID_SOCKET(sock)); REQUIRE(addressp != NULL); LOCK(&sock->lock); if (sock->connected) { *addressp = sock->peer_address; result = ISC_R_SUCCESS; } else { result = ISC_R_NOTCONNECTED; } UNLOCK(&sock->lock); return (result); } isc_result_t isc_socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp) { ISC_SOCKADDR_LEN_T len; isc_result_t result; char strbuf[ISC_STRERRORSIZE]; REQUIRE(VALID_SOCKET(sock)); REQUIRE(addressp != NULL); LOCK(&sock->lock); if (!sock->bound) { result = ISC_R_NOTBOUND; goto out; } result = ISC_R_SUCCESS; len = sizeof(addressp->type); if (getsockname(sock->fd, &addressp->type.sa, (void *)&len) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "getsockname: %s", strbuf); result = ISC_R_UNEXPECTED; goto out; } addressp->length = (unsigned int)len; out: UNLOCK(&sock->lock); return (result); } /* * Run through the list of events on this socket, and cancel the ones * queued for task "task" of type "how". "how" is a bitmask. */ void isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) { REQUIRE(VALID_SOCKET(sock)); /* * Quick exit if there is nothing to do. Don't even bother locking * in this case. */ if (how == 0) return; LOCK(&sock->lock); /* * All of these do the same thing, more or less. * Each will: * o If the internal event is marked as "posted" try to * remove it from the task's queue. If this fails, mark it * as canceled instead, and let the task clean it up later. * o For each I/O request for that task of that type, post * its done event with status of "ISC_R_CANCELED". * o Reset any state needed. */ if (((how & ISC_SOCKCANCEL_RECV) == ISC_SOCKCANCEL_RECV) && !ISC_LIST_EMPTY(sock->recv_list)) { isc_socketevent_t *dev; isc_socketevent_t *next; isc_task_t *current_task; dev = ISC_LIST_HEAD(sock->recv_list); while (dev != NULL) { current_task = dev->ev_sender; next = ISC_LIST_NEXT(dev, ev_link); if ((task == NULL) || (task == current_task)) { dev->result = ISC_R_CANCELED; send_recvdone_event(sock, &dev); } dev = next; } } if (((how & ISC_SOCKCANCEL_SEND) == ISC_SOCKCANCEL_SEND) && !ISC_LIST_EMPTY(sock->send_list)) { isc_socketevent_t *dev; isc_socketevent_t *next; isc_task_t *current_task; dev = ISC_LIST_HEAD(sock->send_list); while (dev != NULL) { current_task = dev->ev_sender; next = ISC_LIST_NEXT(dev, ev_link); if ((task == NULL) || (task == current_task)) { dev->result = ISC_R_CANCELED; send_senddone_event(sock, &dev); } dev = next; } } if (((how & ISC_SOCKCANCEL_ACCEPT) == ISC_SOCKCANCEL_ACCEPT) && !ISC_LIST_EMPTY(sock->accept_list)) { isc_socket_newconnev_t *dev; isc_socket_newconnev_t *next; isc_task_t *current_task; dev = ISC_LIST_HEAD(sock->accept_list); while (dev != NULL) { current_task = dev->ev_sender; next = ISC_LIST_NEXT(dev, ev_link); if ((task == NULL) || (task == current_task)) { ISC_LIST_UNLINK(sock->accept_list, dev, ev_link); dev->newsocket->references--; free_socket(&dev->newsocket); dev->result = ISC_R_CANCELED; dev->ev_sender = sock; isc_task_sendanddetach(¤t_task, ISC_EVENT_PTR(&dev)); } dev = next; } } /* * Connecting is not a list. */ if (((how & ISC_SOCKCANCEL_CONNECT) == ISC_SOCKCANCEL_CONNECT) && sock->connect_ev != NULL) { isc_socket_connev_t *dev; isc_task_t *current_task; INSIST(sock->connecting); sock->connecting = 0; dev = sock->connect_ev; current_task = dev->ev_sender; if ((task == NULL) || (task == current_task)) { sock->connect_ev = NULL; dev->result = ISC_R_CANCELED; dev->ev_sender = sock; isc_task_sendanddetach(¤t_task, ISC_EVENT_PTR(&dev)); } } UNLOCK(&sock->lock); } isc_sockettype_t isc_socket_gettype(isc_socket_t *sock) { REQUIRE(VALID_SOCKET(sock)); return (sock->type); } isc_boolean_t isc_socket_isbound(isc_socket_t *sock) { isc_boolean_t val; LOCK(&sock->lock); val = ((sock->bound) ? ISC_TRUE : ISC_FALSE); UNLOCK(&sock->lock); return (val); } void isc_socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes) { #if defined(IPV6_V6ONLY) int onoff = yes ? 1 : 0; #else UNUSED(yes); UNUSED(sock); #endif REQUIRE(VALID_SOCKET(sock)); #ifdef IPV6_V6ONLY if (sock->pf == AF_INET6) { if (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&onoff, sizeof(int)) < 0) { char strbuf[ISC_STRERRORSIZE]; UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d, IPV6_V6ONLY) " "%s: %s", sock->fd, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); } } FIX_IPV6_RECVPKTINFO(sock); /* AIX */ #endif } #ifndef ISC_PLATFORM_USETHREADS /* In our assumed scenario, we can simply use a single static object. */ static isc_socketwait_t swait_private; int isc__socketmgr_waitevents(struct timeval *tvp, isc_socketwait_t **swaitp) { int n; #ifdef USE_KQUEUE struct timespec ts, *tsp; #endif #ifdef USE_EPOLL int timeout; #endif #ifdef USE_DEVPOLL struct dvpoll dvp; #endif REQUIRE(swaitp != NULL && *swaitp == NULL); if (socketmgr == NULL) return (0); #ifdef USE_KQUEUE if (tvp != NULL) { ts.tv_sec = tvp->tv_sec; ts.tv_nsec = tvp->tv_usec * 1000; tsp = &ts; } else tsp = NULL; swait_private.nevents = kevent(socketmgr->kqueue_fd, NULL, 0, socketmgr->events, socketmgr->nevents, tsp); n = swait_private.nevents; #elif defined(USE_EPOLL) if (tvp != NULL) timeout = tvp->tv_sec * 1000 + (tvp->tv_usec + 999) / 1000; else timeout = -1; swait_private.nevents = epoll_wait(socketmgr->epoll_fd, socketmgr->events, socketmgr->nevents, timeout); n = swait_private.nevents; #elif defined(USE_DEVPOLL) dvp.dp_fds = socketmgr->events; dvp.dp_nfds = socketmgr->nevents; if (tvp != NULL) { dvp.dp_timeout = tvp->tv_sec * 1000 + (tvp->tv_usec + 999) / 1000; } else dvp.dp_timeout = -1; swait_private.nevents = ioctl(socketmgr->devpoll_fd, DP_POLL, &dvp); n = swait_private.nevents; #elif defined(USE_SELECT) memcpy(socketmgr->read_fds_copy, socketmgr->read_fds, socketmgr->fd_bufsize); memcpy(socketmgr->write_fds_copy, socketmgr->write_fds, socketmgr->fd_bufsize); swait_private.readset = socketmgr->read_fds_copy; swait_private.writeset = socketmgr->write_fds_copy; swait_private.maxfd = socketmgr->maxfd + 1; n = select(swait_private.maxfd, swait_private.readset, swait_private.writeset, NULL, tvp); #endif *swaitp = &swait_private; return (n); } isc_result_t isc__socketmgr_dispatch(isc_socketwait_t *swait) { REQUIRE(swait == &swait_private); if (socketmgr == NULL) return (ISC_R_NOTFOUND); #if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL) (void)process_fds(socketmgr, socketmgr->events, swait->nevents); return (ISC_R_SUCCESS); #elif defined(USE_SELECT) process_fds(socketmgr, swait->maxfd, swait->readset, swait->writeset); return (ISC_R_SUCCESS); #endif } #endif /* ISC_PLATFORM_USETHREADS */ void isc_socket_setname(isc_socket_t *socket, const char *name, void *tag) { /* * Name 'socket'. */ REQUIRE(VALID_SOCKET(socket)); LOCK(&socket->lock); memset(socket->name, 0, sizeof(socket->name)); strncpy(socket->name, name, sizeof(socket->name) - 1); socket->tag = tag; UNLOCK(&socket->lock); } const char * isc_socket_getname(isc_socket_t *socket) { return (socket->name); } void * isc_socket_gettag(isc_socket_t *socket) { return (socket->tag); } #ifdef HAVE_LIBXML2 static const char * _socktype(isc_sockettype_t type) { if (type == isc_sockettype_udp) return ("udp"); else if (type == isc_sockettype_tcp) return ("tcp"); else if (type == isc_sockettype_unix) return ("unix"); else if (type == isc_sockettype_fdwatch) return ("fdwatch"); else return ("not-initialized"); } void isc_socketmgr_renderxml(isc_socketmgr_t *mgr, xmlTextWriterPtr writer) { isc_socket_t *sock; char peerbuf[ISC_SOCKADDR_FORMATSIZE]; isc_sockaddr_t addr; ISC_SOCKADDR_LEN_T len; LOCK(&mgr->lock); #ifndef ISC_PLATFORM_USETHREADS xmlTextWriterStartElement(writer, ISC_XMLCHAR "references"); xmlTextWriterWriteFormatString(writer, "%d", mgr->refs); xmlTextWriterEndElement(writer); #endif xmlTextWriterStartElement(writer, ISC_XMLCHAR "sockets"); sock = ISC_LIST_HEAD(mgr->socklist); while (sock != NULL) { LOCK(&sock->lock); xmlTextWriterStartElement(writer, ISC_XMLCHAR "socket"); xmlTextWriterStartElement(writer, ISC_XMLCHAR "id"); xmlTextWriterWriteFormatString(writer, "%p", sock); xmlTextWriterEndElement(writer); if (sock->name[0] != 0) { xmlTextWriterStartElement(writer, ISC_XMLCHAR "name"); xmlTextWriterWriteFormatString(writer, "%s", sock->name); xmlTextWriterEndElement(writer); /* name */ } xmlTextWriterStartElement(writer, ISC_XMLCHAR "references"); xmlTextWriterWriteFormatString(writer, "%d", sock->references); xmlTextWriterEndElement(writer); xmlTextWriterWriteElement(writer, ISC_XMLCHAR "type", ISC_XMLCHAR _socktype(sock->type)); if (sock->connected) { isc_sockaddr_format(&sock->peer_address, peerbuf, sizeof(peerbuf)); xmlTextWriterWriteElement(writer, ISC_XMLCHAR "peer-address", ISC_XMLCHAR peerbuf); } len = sizeof(addr); if (getsockname(sock->fd, &addr.type.sa, (void *)&len) == 0) { isc_sockaddr_format(&addr, peerbuf, sizeof(peerbuf)); xmlTextWriterWriteElement(writer, ISC_XMLCHAR "local-address", ISC_XMLCHAR peerbuf); } xmlTextWriterStartElement(writer, ISC_XMLCHAR "states"); if (sock->pending_recv) xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", ISC_XMLCHAR "pending-receive"); if (sock->pending_send) xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", ISC_XMLCHAR "pending-send"); if (sock->pending_accept) xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", ISC_XMLCHAR "pending_accept"); if (sock->listener) xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", ISC_XMLCHAR "listener"); if (sock->connected) xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", ISC_XMLCHAR "connected"); if (sock->connecting) xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", ISC_XMLCHAR "connecting"); if (sock->bound) xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state", ISC_XMLCHAR "bound"); xmlTextWriterEndElement(writer); /* states */ xmlTextWriterEndElement(writer); /* socket */ UNLOCK(&sock->lock); sock = ISC_LIST_NEXT(sock, link); } xmlTextWriterEndElement(writer); /* sockets */ UNLOCK(&mgr->lock); } #endif /* HAVE_LIBXML2 */ ntp-4.2.6p5/lib/isc/unix/resource.c0000644000175000017500000001402411307651604016117 0ustar peterpeter/* * Copyright (C) 2004, 2007-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: resource.c,v 1.21.66.2 2009/02/13 23:47:39 tbox Exp $ */ #include #include #include /* Required on some systems for . */ #include #include #include #include #include #ifdef __linux__ #include /* To get the large NR_OPEN. */ #endif #if defined(__hpux) && defined(HAVE_SYS_DYNTUNE_H) #include #endif #include "errno2result.h" static isc_result_t resource2rlim(isc_resource_t resource, int *rlim_resource) { isc_result_t result = ISC_R_SUCCESS; switch (resource) { case isc_resource_coresize: *rlim_resource = RLIMIT_CORE; break; case isc_resource_cputime: *rlim_resource = RLIMIT_CPU; break; case isc_resource_datasize: *rlim_resource = RLIMIT_DATA; break; case isc_resource_filesize: *rlim_resource = RLIMIT_FSIZE; break; case isc_resource_lockedmemory: #ifdef RLIMIT_MEMLOCK *rlim_resource = RLIMIT_MEMLOCK; #else result = ISC_R_NOTIMPLEMENTED; #endif break; case isc_resource_openfiles: #ifdef RLIMIT_NOFILE *rlim_resource = RLIMIT_NOFILE; #else result = ISC_R_NOTIMPLEMENTED; #endif break; case isc_resource_processes: #ifdef RLIMIT_NPROC *rlim_resource = RLIMIT_NPROC; #else result = ISC_R_NOTIMPLEMENTED; #endif break; case isc_resource_residentsize: #ifdef RLIMIT_RSS *rlim_resource = RLIMIT_RSS; #else result = ISC_R_NOTIMPLEMENTED; #endif break; case isc_resource_stacksize: *rlim_resource = RLIMIT_STACK; break; default: /* * This test is not very robust if isc_resource_t * changes, but generates a clear assertion message. */ REQUIRE(resource >= isc_resource_coresize && resource <= isc_resource_stacksize); result = ISC_R_RANGE; break; } return (result); } isc_result_t isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value) { struct rlimit rl; ISC_PLATFORM_RLIMITTYPE rlim_value; int unixresult; int unixresource; isc_result_t result; result = resource2rlim(resource, &unixresource); if (result != ISC_R_SUCCESS) return (result); if (value == ISC_RESOURCE_UNLIMITED) rlim_value = RLIM_INFINITY; else { /* * isc_resourcevalue_t was chosen as an unsigned 64 bit * integer so that it could contain the maximum range of * reasonable values. Unfortunately, this exceeds the typical * range on Unix systems. Ensure the range of * ISC_PLATFORM_RLIMITTYPE is not overflowed. */ isc_resourcevalue_t rlim_max; isc_boolean_t rlim_t_is_signed = ISC_TF(((double)(ISC_PLATFORM_RLIMITTYPE)-1) < 0); if (rlim_t_is_signed) rlim_max = ~((ISC_PLATFORM_RLIMITTYPE)1 << (sizeof(ISC_PLATFORM_RLIMITTYPE) * 8 - 1)); else rlim_max = (ISC_PLATFORM_RLIMITTYPE)-1; if (value > rlim_max) value = rlim_max; rlim_value = value; } rl.rlim_cur = rl.rlim_max = rlim_value; unixresult = setrlimit(unixresource, &rl); if (unixresult == 0) return (ISC_R_SUCCESS); #if defined(OPEN_MAX) && defined(__APPLE__) /* * The Darwin kernel doesn't accept RLIM_INFINITY for rlim_cur; the * maximum possible value is OPEN_MAX. BIND8 used to use * sysconf(_SC_OPEN_MAX) for such a case, but this value is much * smaller than OPEN_MAX and is not really effective. */ if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) { rl.rlim_cur = OPEN_MAX; unixresult = setrlimit(unixresource, &rl); if (unixresult == 0) return (ISC_R_SUCCESS); } #elif defined(__linux__) #ifndef NR_OPEN #define NR_OPEN (1024*1024) #endif /* * Some Linux kernels don't accept RLIM_INFINIT; the maximum * possible value is the NR_OPEN defined in linux/fs.h. */ if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) { rl.rlim_cur = rl.rlim_max = NR_OPEN; unixresult = setrlimit(unixresource, &rl); if (unixresult == 0) return (ISC_R_SUCCESS); } #elif defined(__hpux) && defined(HAVE_SYS_DYNTUNE_H) if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) { uint64_t maxfiles; if (gettune("maxfiles_lim", &maxfiles) == 0) { rl.rlim_cur = rl.rlim_max = maxfiles; unixresult = setrlimit(unixresource, &rl); if (unixresult == 0) return (ISC_R_SUCCESS); } } #endif if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) { if (getrlimit(unixresource, &rl) == 0) { rl.rlim_cur = rl.rlim_max; unixresult = setrlimit(unixresource, &rl); if (unixresult == 0) return (ISC_R_SUCCESS); } } return (isc__errno2result(errno)); } isc_result_t isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value) { int unixresult; int unixresource; struct rlimit rl; isc_result_t result; result = resource2rlim(resource, &unixresource); if (result == ISC_R_SUCCESS) { unixresult = getrlimit(unixresource, &rl); INSIST(unixresult == 0); *value = rl.rlim_max; } return (result); } isc_result_t isc_resource_getcurlimit(isc_resource_t resource, isc_resourcevalue_t *value) { int unixresult; int unixresource; struct rlimit rl; isc_result_t result; result = resource2rlim(resource, &unixresource); if (result == ISC_R_SUCCESS) { unixresult = getrlimit(unixresource, &rl); INSIST(unixresult == 0); *value = rl.rlim_cur; } return (result); } ntp-4.2.6p5/lib/isc/unix/time.c0000644000175000017500000002636511307651604015241 0ustar peterpeter/* * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: time.c,v 1.56 2008/02/15 23:46:51 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include /* Required for struct timeval on some platforms. */ #include #include #include #include #include #include #define NS_PER_S 1000000000 /*%< Nanoseconds per second. */ #define NS_PER_US 1000 /*%< Nanoseconds per microsecond. */ #define US_PER_S 1000000 /*%< Microseconds per second. */ /* * All of the INSIST()s checks of nanoseconds < NS_PER_S are for * consistency checking of the type. In lieu of magic numbers, it * is the best we've got. The check is only performed on functions which * need an initialized type. */ #ifndef ISC_FIX_TV_USEC #define ISC_FIX_TV_USEC 1 #endif /*% *** Intervals ***/ static isc_interval_t zero_interval = { 0, 0 }; isc_interval_t *isc_interval_zero = &zero_interval; #if ISC_FIX_TV_USEC static inline void fix_tv_usec(struct timeval *tv) { isc_boolean_t fixed = ISC_FALSE; if (tv->tv_usec < 0) { fixed = ISC_TRUE; do { tv->tv_sec -= 1; tv->tv_usec += US_PER_S; } while (tv->tv_usec < 0); } else if (tv->tv_usec >= US_PER_S) { fixed = ISC_TRUE; do { tv->tv_sec += 1; tv->tv_usec -= US_PER_S; } while (tv->tv_usec >=US_PER_S); } /* * Call syslog directly as was are called from the logging functions. */ if (fixed) (void)syslog(LOG_ERR, "gettimeofday returned bad tv_usec: corrected"); } #endif void isc_interval_set(isc_interval_t *i, unsigned int seconds, unsigned int nanoseconds) { REQUIRE(i != NULL); REQUIRE(nanoseconds < NS_PER_S); i->seconds = seconds; i->nanoseconds = nanoseconds; } isc_boolean_t isc_interval_iszero(const isc_interval_t *i) { REQUIRE(i != NULL); INSIST(i->nanoseconds < NS_PER_S); if (i->seconds == 0 && i->nanoseconds == 0) return (ISC_TRUE); return (ISC_FALSE); } /*** *** Absolute Times ***/ static isc_time_t epoch = { 0, 0 }; isc_time_t *isc_time_epoch = &epoch; void isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds) { REQUIRE(t != NULL); REQUIRE(nanoseconds < NS_PER_S); t->seconds = seconds; t->nanoseconds = nanoseconds; } void isc_time_settoepoch(isc_time_t *t) { REQUIRE(t != NULL); t->seconds = 0; t->nanoseconds = 0; } isc_boolean_t isc_time_isepoch(const isc_time_t *t) { REQUIRE(t != NULL); INSIST(t->nanoseconds < NS_PER_S); if (t->seconds == 0 && t->nanoseconds == 0) return (ISC_TRUE); return (ISC_FALSE); } isc_result_t isc_time_now(isc_time_t *t) { struct timeval tv; char strbuf[ISC_STRERRORSIZE]; REQUIRE(t != NULL); if (gettimeofday(&tv, NULL) == -1) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "%s", strbuf); return (ISC_R_UNEXPECTED); } /* * Does POSIX guarantee the signedness of tv_sec and tv_usec? If not, * then this test will generate warnings for platforms on which it is * unsigned. In any event, the chances of any of these problems * happening are pretty much zero, but since the libisc library ensures * certain things to be true ... */ #if ISC_FIX_TV_USEC fix_tv_usec(&tv); if (tv.tv_sec < 0) return (ISC_R_UNEXPECTED); #else if (tv.tv_sec < 0 || tv.tv_usec < 0 || tv.tv_usec >= US_PER_S) return (ISC_R_UNEXPECTED); #endif /* * Ensure the tv_sec value fits in t->seconds. */ if (sizeof(tv.tv_sec) > sizeof(t->seconds) && ((tv.tv_sec | (unsigned int)-1) ^ (unsigned int)-1) != 0U) return (ISC_R_RANGE); t->seconds = tv.tv_sec; t->nanoseconds = tv.tv_usec * NS_PER_US; return (ISC_R_SUCCESS); } isc_result_t isc_time_nowplusinterval(isc_time_t *t, const isc_interval_t *i) { struct timeval tv; char strbuf[ISC_STRERRORSIZE]; REQUIRE(t != NULL); REQUIRE(i != NULL); INSIST(i->nanoseconds < NS_PER_S); if (gettimeofday(&tv, NULL) == -1) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "%s", strbuf); return (ISC_R_UNEXPECTED); } /* * Does POSIX guarantee the signedness of tv_sec and tv_usec? If not, * then this test will generate warnings for platforms on which it is * unsigned. In any event, the chances of any of these problems * happening are pretty much zero, but since the libisc library ensures * certain things to be true ... */ #if ISC_FIX_TV_USEC fix_tv_usec(&tv); if (tv.tv_sec < 0) return (ISC_R_UNEXPECTED); #else if (tv.tv_sec < 0 || tv.tv_usec < 0 || tv.tv_usec >= US_PER_S) return (ISC_R_UNEXPECTED); #endif /* * Ensure the resulting seconds value fits in the size of an * unsigned int. (It is written this way as a slight optimization; * note that even if both values == INT_MAX, then when added * and getting another 1 added below the result is UINT_MAX.) */ if ((tv.tv_sec > INT_MAX || i->seconds > INT_MAX) && ((long long)tv.tv_sec + i->seconds > UINT_MAX)) return (ISC_R_RANGE); t->seconds = tv.tv_sec + i->seconds; t->nanoseconds = tv.tv_usec * NS_PER_US + i->nanoseconds; if (t->nanoseconds >= NS_PER_S) { t->seconds++; t->nanoseconds -= NS_PER_S; } return (ISC_R_SUCCESS); } int isc_time_compare(const isc_time_t *t1, const isc_time_t *t2) { REQUIRE(t1 != NULL && t2 != NULL); INSIST(t1->nanoseconds < NS_PER_S && t2->nanoseconds < NS_PER_S); if (t1->seconds < t2->seconds) return (-1); if (t1->seconds > t2->seconds) return (1); if (t1->nanoseconds < t2->nanoseconds) return (-1); if (t1->nanoseconds > t2->nanoseconds) return (1); return (0); } isc_result_t isc_time_add(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result) { REQUIRE(t != NULL && i != NULL && result != NULL); INSIST(t->nanoseconds < NS_PER_S && i->nanoseconds < NS_PER_S); /* * Ensure the resulting seconds value fits in the size of an * unsigned int. (It is written this way as a slight optimization; * note that even if both values == INT_MAX, then when added * and getting another 1 added below the result is UINT_MAX.) */ if ((t->seconds > INT_MAX || i->seconds > INT_MAX) && ((long long)t->seconds + i->seconds > UINT_MAX)) return (ISC_R_RANGE); result->seconds = t->seconds + i->seconds; result->nanoseconds = t->nanoseconds + i->nanoseconds; if (result->nanoseconds >= NS_PER_S) { result->seconds++; result->nanoseconds -= NS_PER_S; } return (ISC_R_SUCCESS); } isc_result_t isc_time_subtract(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result) { REQUIRE(t != NULL && i != NULL && result != NULL); INSIST(t->nanoseconds < NS_PER_S && i->nanoseconds < NS_PER_S); if ((unsigned int)t->seconds < i->seconds || ((unsigned int)t->seconds == i->seconds && t->nanoseconds < i->nanoseconds)) return (ISC_R_RANGE); result->seconds = t->seconds - i->seconds; if (t->nanoseconds >= i->nanoseconds) result->nanoseconds = t->nanoseconds - i->nanoseconds; else { result->nanoseconds = NS_PER_S - i->nanoseconds + t->nanoseconds; result->seconds--; } return (ISC_R_SUCCESS); } isc_uint64_t isc_time_microdiff(const isc_time_t *t1, const isc_time_t *t2) { isc_uint64_t i1, i2, i3; REQUIRE(t1 != NULL && t2 != NULL); INSIST(t1->nanoseconds < NS_PER_S && t2->nanoseconds < NS_PER_S); i1 = (isc_uint64_t)t1->seconds * NS_PER_S + t1->nanoseconds; i2 = (isc_uint64_t)t2->seconds * NS_PER_S + t2->nanoseconds; if (i1 <= i2) return (0); i3 = i1 - i2; /* * Convert to microseconds. */ i3 = (i1 - i2) / NS_PER_US; return (i3); } isc_uint32_t isc_time_seconds(const isc_time_t *t) { REQUIRE(t != NULL); INSIST(t->nanoseconds < NS_PER_S); return ((isc_uint32_t)t->seconds); } isc_result_t isc_time_secondsastimet(const isc_time_t *t, time_t *secondsp) { isc_uint64_t i; time_t seconds; REQUIRE(t != NULL); INSIST(t->nanoseconds < NS_PER_S); /* * Ensure that the number of seconds represented by t->seconds * can be represented by a time_t. Since t->seconds is an unsigned * int and since time_t is mostly opaque, this is trickier than * it seems. (This standardized opaqueness of time_t is *very* * frustrating; time_t is not even limited to being an integral * type.) * * The mission, then, is to avoid generating any kind of warning * about "signed versus unsigned" while trying to determine if the * the unsigned int t->seconds is out range for tv_sec, which is * pretty much only true if time_t is a signed integer of the same * size as the return value of isc_time_seconds. * * The use of the 64 bit integer ``i'' takes advantage of C's * conversion rules to either zero fill or sign extend the widened * type. * * Solaris 5.6 gives this warning about the left shift: * warning: integer overflow detected: op "<<" * if the U(nsigned) qualifier is not on the 1. */ seconds = (time_t)t->seconds; INSIST(sizeof(unsigned int) == sizeof(isc_uint32_t)); INSIST(sizeof(time_t) >= sizeof(isc_uint32_t)); if (sizeof(time_t) == sizeof(isc_uint32_t) && /* Same size. */ (time_t)0.5 != 0.5 && /* Not a floating point type. */ (i = (time_t)-1) != 4294967295u && /* Is signed. */ (seconds & (1U << (sizeof(time_t) * CHAR_BIT - 1))) != 0U) { /* Negative. */ /* * This UNUSED() is here to shut up the IRIX compiler: * variable "i" was set but never used * when the value of i *was* used in the third test. * (Let's hope the compiler got the actual test right.) */ UNUSED(i); return (ISC_R_RANGE); } *secondsp = seconds; return (ISC_R_SUCCESS); } isc_uint32_t isc_time_nanoseconds(const isc_time_t *t) { REQUIRE(t != NULL); ENSURE(t->nanoseconds < NS_PER_S); return ((isc_uint32_t)t->nanoseconds); } void isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len) { time_t now; unsigned int flen; REQUIRE(len > 0); now = (time_t) t->seconds; flen = strftime(buf, len, "%d-%b-%Y %X", localtime(&now)); INSIST(flen < len); if (flen != 0) snprintf(buf + flen, len - flen, ".%03u", t->nanoseconds / 1000000); else snprintf(buf, len, "99-Bad-9999 99:99:99.999"); } void isc_time_formathttptimestamp(const isc_time_t *t, char *buf, unsigned int len) { time_t now; unsigned int flen; REQUIRE(len > 0); now = (time_t)t->seconds; flen = strftime(buf, len, "%a, %d %b %Y %H:%M:%S GMT", gmtime(&now)); INSIST(flen < len); } void isc_time_formatISO8601(const isc_time_t *t, char *buf, unsigned int len) { time_t now; unsigned int flen; REQUIRE(len > 0); now = (time_t)t->seconds; flen = strftime(buf, len, "%Y-%m-%dT%H:%M:%SZ", gmtime(&now)); INSIST(flen < len); } ntp-4.2.6p5/lib/isc/unix/errno2result.c0000644000175000017500000000605411307651603016741 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: errno2result.c,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ /*! \file */ #include #include #include #include #include "errno2result.h" /*% * Convert a POSIX errno value into an isc_result_t. The * list of supported errno values is not complete; new users * of this function should add any expected errors that are * not already there. */ isc_result_t isc__errno2result(int posixerrno) { char strbuf[ISC_STRERRORSIZE]; switch (posixerrno) { case ENOTDIR: case ELOOP: case EINVAL: /* XXX sometimes this is not for files */ case ENAMETOOLONG: case EBADF: return (ISC_R_INVALIDFILE); case ENOENT: return (ISC_R_FILENOTFOUND); case EACCES: case EPERM: return (ISC_R_NOPERM); case EEXIST: return (ISC_R_FILEEXISTS); case EIO: return (ISC_R_IOERROR); case ENOMEM: return (ISC_R_NOMEMORY); case ENFILE: case EMFILE: return (ISC_R_TOOMANYOPENFILES); case EPIPE: #ifdef ECONNRESET case ECONNRESET: #endif #ifdef ECONNABORTED case ECONNABORTED: #endif return (ISC_R_CONNECTIONRESET); #ifdef ENOTCONN case ENOTCONN: return (ISC_R_NOTCONNECTED); #endif #ifdef ETIMEDOUT case ETIMEDOUT: return (ISC_R_TIMEDOUT); #endif #ifdef ENOBUFS case ENOBUFS: return (ISC_R_NORESOURCES); #endif #ifdef EAFNOSUPPORT case EAFNOSUPPORT: return (ISC_R_FAMILYNOSUPPORT); #endif #ifdef ENETDOWN case ENETDOWN: return (ISC_R_NETDOWN); #endif #ifdef EHOSTDOWN case EHOSTDOWN: return (ISC_R_HOSTDOWN); #endif #ifdef ENETUNREACH case ENETUNREACH: return (ISC_R_NETUNREACH); #endif #ifdef EHOSTUNREACH case EHOSTUNREACH: return (ISC_R_HOSTUNREACH); #endif #ifdef EADDRINUSE case EADDRINUSE: return (ISC_R_ADDRINUSE); #endif case EADDRNOTAVAIL: return (ISC_R_ADDRNOTAVAIL); case ECONNREFUSED: return (ISC_R_CONNREFUSED); default: isc__strerror(posixerrno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "unable to convert errno " "to isc_result: %d: %s", posixerrno, strbuf); /* * XXXDCL would be nice if perhaps this function could * return the system's error string, so the caller * might have something more descriptive than "unexpected * error" to log with. */ return (ISC_R_UNEXPECTED); } } ntp-4.2.6p5/lib/isc/unix/ifiter_getifaddrs.c0000644000175000017500000001427611307651605017760 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ifiter_getifaddrs.c,v 1.11 2008/03/20 23:47:00 tbox Exp $ */ /*! \file * \brief * Obtain the list of network interfaces using the getifaddrs(3) library. */ #include /*% Iterator Magic */ #define IFITER_MAGIC ISC_MAGIC('I', 'F', 'I', 'G') /*% Valid Iterator */ #define VALID_IFITER(t) ISC_MAGIC_VALID(t, IFITER_MAGIC) #ifdef __linux static isc_boolean_t seenv6 = ISC_FALSE; #endif /*% Iterator structure */ struct isc_interfaceiter { unsigned int magic; /*%< Magic number. */ isc_mem_t *mctx; void *buf; /*%< (unused) */ unsigned int bufsize; /*%< (always 0) */ struct ifaddrs *ifaddrs; /*%< List of ifaddrs */ struct ifaddrs *pos; /*%< Ptr to current ifaddr */ isc_interface_t current; /*%< Current interface data. */ isc_result_t result; /*%< Last result code. */ #ifdef __linux FILE * proc; char entry[ISC_IF_INET6_SZ]; isc_result_t valid; #endif }; isc_result_t isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) { isc_interfaceiter_t *iter; isc_result_t result; char strbuf[ISC_STRERRORSIZE]; REQUIRE(mctx != NULL); REQUIRE(iterp != NULL); REQUIRE(*iterp == NULL); iter = isc_mem_get(mctx, sizeof(*iter)); if (iter == NULL) return (ISC_R_NOMEMORY); iter->mctx = mctx; iter->buf = NULL; iter->bufsize = 0; iter->ifaddrs = NULL; #ifdef __linux /* * Only open "/proc/net/if_inet6" if we have never seen a IPv6 * address returned by getifaddrs(). */ if (!seenv6) iter->proc = fopen("/proc/net/if_inet6", "r"); else iter->proc = NULL; iter->valid = ISC_R_FAILURE; #endif if (getifaddrs(&iter->ifaddrs) < 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERGETIFADDRS, ISC_MSG_GETIFADDRS, "getting interface " "addresses: getifaddrs: %s"), strbuf); result = ISC_R_UNEXPECTED; goto failure; } /* * A newly created iterator has an undefined position * until isc_interfaceiter_first() is called. */ iter->pos = NULL; iter->result = ISC_R_FAILURE; iter->magic = IFITER_MAGIC; *iterp = iter; return (ISC_R_SUCCESS); failure: #ifdef __linux if (iter->proc != NULL) fclose(iter->proc); #endif if (iter->ifaddrs != NULL) /* just in case */ freeifaddrs(iter->ifaddrs); isc_mem_put(mctx, iter, sizeof(*iter)); return (result); } /* * Get information about the current interface to iter->current. * If successful, return ISC_R_SUCCESS. * If the interface has an unsupported address family, * return ISC_R_IGNORE. */ static isc_result_t internal_current(isc_interfaceiter_t *iter) { struct ifaddrs *ifa; int family; unsigned int namelen; REQUIRE(VALID_IFITER(iter)); ifa = iter->pos; #ifdef __linux if (iter->pos == NULL) return (linux_if_inet6_current(iter)); #endif INSIST(ifa != NULL); INSIST(ifa->ifa_name != NULL); if (ifa->ifa_addr == NULL) return (ISC_R_IGNORE); family = ifa->ifa_addr->sa_family; if (family != AF_INET && family != AF_INET6) return (ISC_R_IGNORE); #ifdef __linux if (family == AF_INET6) seenv6 = ISC_TRUE; #endif memset(&iter->current, 0, sizeof(iter->current)); namelen = strlen(ifa->ifa_name); if (namelen > sizeof(iter->current.name) - 1) namelen = sizeof(iter->current.name) - 1; memset(iter->current.name, 0, sizeof(iter->current.name)); memcpy(iter->current.name, ifa->ifa_name, namelen); iter->current.flags = 0; if ((ifa->ifa_flags & IFF_UP) != 0) iter->current.flags |= INTERFACE_F_UP; if ((ifa->ifa_flags & IFF_POINTOPOINT) != 0) iter->current.flags |= INTERFACE_F_POINTTOPOINT; if ((ifa->ifa_flags & IFF_LOOPBACK) != 0) iter->current.flags |= INTERFACE_F_LOOPBACK; if ((ifa->ifa_flags & IFF_BROADCAST) != 0) iter->current.flags |= INTERFACE_F_BROADCAST; #ifdef IFF_MULTICAST if ((ifa->ifa_flags & IFF_MULTICAST) != 0) iter->current.flags |= INTERFACE_F_MULTICAST; #endif iter->current.af = family; get_addr(family, &iter->current.address, ifa->ifa_addr, ifa->ifa_name); if (ifa->ifa_netmask != NULL) get_addr(family, &iter->current.netmask, ifa->ifa_netmask, ifa->ifa_name); if (ifa->ifa_dstaddr != NULL && (iter->current.flags & INTERFACE_F_POINTTOPOINT) != 0) get_addr(family, &iter->current.dstaddress, ifa->ifa_dstaddr, ifa->ifa_name); if (ifa->ifa_broadaddr != NULL && (iter->current.flags & INTERFACE_F_BROADCAST) != 0) get_addr(family, &iter->current.broadcast, ifa->ifa_broadaddr, ifa->ifa_name); return (ISC_R_SUCCESS); } /* * Step the iterator to the next interface. Unlike * isc_interfaceiter_next(), this may leave the iterator * positioned on an interface that will ultimately * be ignored. Return ISC_R_NOMORE if there are no more * interfaces, otherwise ISC_R_SUCCESS. */ static isc_result_t internal_next(isc_interfaceiter_t *iter) { if (iter->pos != NULL) iter->pos = iter->pos->ifa_next; if (iter->pos == NULL) { #ifdef __linux if (!seenv6) return (linux_if_inet6_next(iter)); #endif return (ISC_R_NOMORE); } return (ISC_R_SUCCESS); } static void internal_destroy(isc_interfaceiter_t *iter) { #ifdef __linux if (iter->proc != NULL) fclose(iter->proc); iter->proc = NULL; #endif if (iter->ifaddrs) freeifaddrs(iter->ifaddrs); iter->ifaddrs = NULL; } static void internal_first(isc_interfaceiter_t *iter) { #ifdef __linux linux_if_inet6_first(iter); #endif iter->pos = iter->ifaddrs; } ntp-4.2.6p5/lib/isc/sha2.c0000644000175000017500000010676111307651603014153 0ustar peterpeter/* * Copyright (C) 2005-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: sha2.c,v 1.13.332.2 2009/01/18 23:47:41 tbox Exp $ */ /* $FreeBSD: src/sys/crypto/sha2/sha2.c,v 1.2.2.2 2002/03/05 08:36:47 ume Exp $ */ /* $KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $ */ /* * sha2.c * * Version 1.0.0beta1 * * Written by Aaron D. Gifford * * Copyright 2000 Aaron D. Gifford. 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. * 3. Neither the name of the copyright holder nor the names of contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTOR(S) ``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(S) OR CONTRIBUTOR(S) 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 #include #include #include #include /* * UNROLLED TRANSFORM LOOP NOTE: * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform * loop version for the hash transform rounds (defined using macros * later in this file). Either define on the command line, for example: * * cc -DISC_SHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c * * or define below: * * \#define ISC_SHA2_UNROLL_TRANSFORM * */ /*** SHA-256/384/512 Machine Architecture Definitions *****************/ /* * BYTE_ORDER NOTE: * * Please make sure that your system defines BYTE_ORDER. If your * architecture is little-endian, make sure it also defines * LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are * equivalent. * * If your system does not define the above, then you can do so by * hand like this: * * \#define LITTLE_ENDIAN 1234 * \#define BIG_ENDIAN 4321 * * And for little-endian machines, add: * * \#define BYTE_ORDER LITTLE_ENDIAN * * Or for big-endian machines: * * \#define BYTE_ORDER BIG_ENDIAN * * The FreeBSD machine this was written on defines BYTE_ORDER * appropriately by including (which in turn includes * where the appropriate definitions are actually * made). */ #if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN) #ifndef BYTE_ORDER #ifndef BIG_ENDIAN #define BIG_ENDIAN 4321 #endif #ifndef LITTLE_ENDIAN #define LITTLE_ENDIAN 1234 #endif #ifdef WORDS_BIGENDIAN #define BYTE_ORDER BIG_ENDIAN #else #define BYTE_ORDER LITTLE_ENDIAN #endif #else #error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN #endif #endif /*** SHA-256/384/512 Various Length Definitions ***********************/ /* NOTE: Most of these are in sha2.h */ #define ISC_SHA256_SHORT_BLOCK_LENGTH (ISC_SHA256_BLOCK_LENGTH - 8) #define ISC_SHA384_SHORT_BLOCK_LENGTH (ISC_SHA384_BLOCK_LENGTH - 16) #define ISC_SHA512_SHORT_BLOCK_LENGTH (ISC_SHA512_BLOCK_LENGTH - 16) /*** ENDIAN REVERSAL MACROS *******************************************/ #if BYTE_ORDER == LITTLE_ENDIAN #define REVERSE32(w,x) { \ isc_uint32_t tmp = (w); \ tmp = (tmp >> 16) | (tmp << 16); \ (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \ } #ifdef WIN32 #define REVERSE64(w,x) { \ isc_uint64_t tmp = (w); \ tmp = (tmp >> 32) | (tmp << 32); \ tmp = ((tmp & 0xff00ff00ff00ff00UL) >> 8) | \ ((tmp & 0x00ff00ff00ff00ffUL) << 8); \ (x) = ((tmp & 0xffff0000ffff0000UL) >> 16) | \ ((tmp & 0x0000ffff0000ffffUL) << 16); \ } #else #define REVERSE64(w,x) { \ isc_uint64_t tmp = (w); \ tmp = (tmp >> 32) | (tmp << 32); \ tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \ ((tmp & 0x00ff00ff00ff00ffULL) << 8); \ (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \ ((tmp & 0x0000ffff0000ffffULL) << 16); \ } #endif #endif /* BYTE_ORDER == LITTLE_ENDIAN */ /* * Macro for incrementally adding the unsigned 64-bit integer n to the * unsigned 128-bit integer (represented using a two-element array of * 64-bit words): */ #define ADDINC128(w,n) { \ (w)[0] += (isc_uint64_t)(n); \ if ((w)[0] < (n)) { \ (w)[1]++; \ } \ } /*** THE SIX LOGICAL FUNCTIONS ****************************************/ /* * Bit shifting and rotation (used by the six SHA-XYZ logical functions: * * NOTE: The naming of R and S appears backwards here (R is a SHIFT and * S is a ROTATION) because the SHA-256/384/512 description document * (see http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf) uses this * same "backwards" definition. */ /* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ #define R(b,x) ((x) >> (b)) /* 32-bit Rotate-right (used in SHA-256): */ #define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) /* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ #define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) /* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */ #define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) #define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) /* Four of six logical functions used in SHA-256: */ #define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) #define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) #define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) #define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) /* Four of six logical functions used in SHA-384 and SHA-512: */ #define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) #define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) #define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x))) #define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x))) /*** INTERNAL FUNCTION PROTOTYPES *************************************/ /* NOTE: These should not be accessed directly from outside this * library -- they are intended for private internal visibility/use * only. */ void isc_sha512_last(isc_sha512_t *); void isc_sha256_transform(isc_sha256_t *, const isc_uint32_t*); void isc_sha512_transform(isc_sha512_t *, const isc_uint64_t*); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ /* Hash constant words K for SHA-224 and SHA-256: */ static const isc_uint32_t K256[64] = { 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL }; /* Initial hash value H for SHA-224: */ static const isc_uint32_t sha224_initial_hash_value[8] = { 0xc1059ed8UL, 0x367cd507UL, 0x3070dd17UL, 0xf70e5939UL, 0xffc00b31UL, 0x68581511UL, 0x64f98fa7UL, 0xbefa4fa4UL }; /* Initial hash value H for SHA-256: */ static const isc_uint32_t sha256_initial_hash_value[8] = { 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL, 0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL }; #ifdef WIN32 /* Hash constant words K for SHA-384 and SHA-512: */ static const isc_uint64_t K512[80] = { 0x428a2f98d728ae22UL, 0x7137449123ef65cdUL, 0xb5c0fbcfec4d3b2fUL, 0xe9b5dba58189dbbcUL, 0x3956c25bf348b538UL, 0x59f111f1b605d019UL, 0x923f82a4af194f9bUL, 0xab1c5ed5da6d8118UL, 0xd807aa98a3030242UL, 0x12835b0145706fbeUL, 0x243185be4ee4b28cUL, 0x550c7dc3d5ffb4e2UL, 0x72be5d74f27b896fUL, 0x80deb1fe3b1696b1UL, 0x9bdc06a725c71235UL, 0xc19bf174cf692694UL, 0xe49b69c19ef14ad2UL, 0xefbe4786384f25e3UL, 0x0fc19dc68b8cd5b5UL, 0x240ca1cc77ac9c65UL, 0x2de92c6f592b0275UL, 0x4a7484aa6ea6e483UL, 0x5cb0a9dcbd41fbd4UL, 0x76f988da831153b5UL, 0x983e5152ee66dfabUL, 0xa831c66d2db43210UL, 0xb00327c898fb213fUL, 0xbf597fc7beef0ee4UL, 0xc6e00bf33da88fc2UL, 0xd5a79147930aa725UL, 0x06ca6351e003826fUL, 0x142929670a0e6e70UL, 0x27b70a8546d22ffcUL, 0x2e1b21385c26c926UL, 0x4d2c6dfc5ac42aedUL, 0x53380d139d95b3dfUL, 0x650a73548baf63deUL, 0x766a0abb3c77b2a8UL, 0x81c2c92e47edaee6UL, 0x92722c851482353bUL, 0xa2bfe8a14cf10364UL, 0xa81a664bbc423001UL, 0xc24b8b70d0f89791UL, 0xc76c51a30654be30UL, 0xd192e819d6ef5218UL, 0xd69906245565a910UL, 0xf40e35855771202aUL, 0x106aa07032bbd1b8UL, 0x19a4c116b8d2d0c8UL, 0x1e376c085141ab53UL, 0x2748774cdf8eeb99UL, 0x34b0bcb5e19b48a8UL, 0x391c0cb3c5c95a63UL, 0x4ed8aa4ae3418acbUL, 0x5b9cca4f7763e373UL, 0x682e6ff3d6b2b8a3UL, 0x748f82ee5defb2fcUL, 0x78a5636f43172f60UL, 0x84c87814a1f0ab72UL, 0x8cc702081a6439ecUL, 0x90befffa23631e28UL, 0xa4506cebde82bde9UL, 0xbef9a3f7b2c67915UL, 0xc67178f2e372532bUL, 0xca273eceea26619cUL, 0xd186b8c721c0c207UL, 0xeada7dd6cde0eb1eUL, 0xf57d4f7fee6ed178UL, 0x06f067aa72176fbaUL, 0x0a637dc5a2c898a6UL, 0x113f9804bef90daeUL, 0x1b710b35131c471bUL, 0x28db77f523047d84UL, 0x32caab7b40c72493UL, 0x3c9ebe0a15c9bebcUL, 0x431d67c49c100d4cUL, 0x4cc5d4becb3e42b6UL, 0x597f299cfc657e2aUL, 0x5fcb6fab3ad6faecUL, 0x6c44198c4a475817UL }; /* Initial hash value H for SHA-384: */ static const isc_uint64_t sha384_initial_hash_value[8] = { 0xcbbb9d5dc1059ed8UL, 0x629a292a367cd507UL, 0x9159015a3070dd17UL, 0x152fecd8f70e5939UL, 0x67332667ffc00b31UL, 0x8eb44a8768581511UL, 0xdb0c2e0d64f98fa7UL, 0x47b5481dbefa4fa4UL }; /* Initial hash value H for SHA-512: */ static const isc_uint64_t sha512_initial_hash_value[8] = { 0x6a09e667f3bcc908U, 0xbb67ae8584caa73bUL, 0x3c6ef372fe94f82bUL, 0xa54ff53a5f1d36f1UL, 0x510e527fade682d1UL, 0x9b05688c2b3e6c1fUL, 0x1f83d9abfb41bd6bUL, 0x5be0cd19137e2179UL }; #else /* Hash constant words K for SHA-384 and SHA-512: */ static const isc_uint64_t K512[80] = { 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL }; /* Initial hash value H for SHA-384: */ static const isc_uint64_t sha384_initial_hash_value[8] = { 0xcbbb9d5dc1059ed8ULL, 0x629a292a367cd507ULL, 0x9159015a3070dd17ULL, 0x152fecd8f70e5939ULL, 0x67332667ffc00b31ULL, 0x8eb44a8768581511ULL, 0xdb0c2e0d64f98fa7ULL, 0x47b5481dbefa4fa4ULL }; /* Initial hash value H for SHA-512: */ static const isc_uint64_t sha512_initial_hash_value[8] = { 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL }; #endif /* * Constant used by SHA256/384/512_End() functions for converting the * digest to a readable hexadecimal character string: */ static const char *sha2_hex_digits = "0123456789abcdef"; /*** SHA-224: *********************************************************/ void isc_sha224_init(isc_sha224_t *context) { if (context == (isc_sha256_t *)0) { return; } memcpy(context->state, sha224_initial_hash_value, ISC_SHA256_DIGESTLENGTH); memset(context->buffer, 0, ISC_SHA256_BLOCK_LENGTH); context->bitcount = 0; } void isc_sha224_update(isc_sha224_t *context, const isc_uint8_t* data, size_t len) { isc_sha256_update((isc_sha256_t *)context, data, len); } void isc_sha224_final(isc_uint8_t digest[], isc_sha224_t *context) { isc_uint8_t sha256_digest[ISC_SHA256_DIGESTLENGTH]; isc_sha256_final(sha256_digest, (isc_sha256_t *)context); memcpy(digest, sha256_digest, ISC_SHA224_DIGESTLENGTH); memset(sha256_digest, 0, ISC_SHA256_DIGESTLENGTH); } char * isc_sha224_end(isc_sha224_t *context, char buffer[]) { isc_uint8_t digest[ISC_SHA224_DIGESTLENGTH], *d = digest; unsigned int i; /* Sanity check: */ REQUIRE(context != (isc_sha224_t *)0); if (buffer != (char*)0) { isc_sha224_final(digest, context); for (i = 0; i < ISC_SHA224_DIGESTLENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } *buffer = (char)0; } else { memset(context, 0, sizeof(context)); } memset(digest, 0, ISC_SHA224_DIGESTLENGTH); return buffer; } char* isc_sha224_data(const isc_uint8_t *data, size_t len, char digest[ISC_SHA224_DIGESTSTRINGLENGTH]) { isc_sha224_t context; isc_sha224_init(&context); isc_sha224_update(&context, data, len); return (isc_sha224_end(&context, digest)); } /*** SHA-256: *********************************************************/ void isc_sha256_init(isc_sha256_t *context) { if (context == (isc_sha256_t *)0) { return; } memcpy(context->state, sha256_initial_hash_value, ISC_SHA256_DIGESTLENGTH); memset(context->buffer, 0, ISC_SHA256_BLOCK_LENGTH); context->bitcount = 0; } #ifdef ISC_SHA2_UNROLL_TRANSFORM /* Unrolled SHA-256 round macros: */ #if BYTE_ORDER == LITTLE_ENDIAN #define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ REVERSE32(*data++, W256[j]); \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ K256[j] + W256[j]; \ (d) += T1; \ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ #else /* BYTE_ORDER == LITTLE_ENDIAN */ #define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ K256[j] + (W256[j] = *data++); \ (d) += T1; \ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ #endif /* BYTE_ORDER == LITTLE_ENDIAN */ #define ROUND256(a,b,c,d,e,f,g,h) \ s0 = W256[(j+1)&0x0f]; \ s0 = sigma0_256(s0); \ s1 = W256[(j+14)&0x0f]; \ s1 = sigma1_256(s1); \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ (d) += T1; \ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ void isc_sha256_transform(isc_sha256_t *context, const isc_uint32_t* data) { isc_uint32_t a, b, c, d, e, f, g, h, s0, s1; isc_uint32_t T1, *W256; int j; W256 = (isc_uint32_t*)context->buffer; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { /* Rounds 0 to 15 (unrolled): */ ROUND256_0_TO_15(a,b,c,d,e,f,g,h); ROUND256_0_TO_15(h,a,b,c,d,e,f,g); ROUND256_0_TO_15(g,h,a,b,c,d,e,f); ROUND256_0_TO_15(f,g,h,a,b,c,d,e); ROUND256_0_TO_15(e,f,g,h,a,b,c,d); ROUND256_0_TO_15(d,e,f,g,h,a,b,c); ROUND256_0_TO_15(c,d,e,f,g,h,a,b); ROUND256_0_TO_15(b,c,d,e,f,g,h,a); } while (j < 16); /* Now for the remaining rounds to 64: */ do { ROUND256(a,b,c,d,e,f,g,h); ROUND256(h,a,b,c,d,e,f,g); ROUND256(g,h,a,b,c,d,e,f); ROUND256(f,g,h,a,b,c,d,e); ROUND256(e,f,g,h,a,b,c,d); ROUND256(d,e,f,g,h,a,b,c); ROUND256(c,d,e,f,g,h,a,b); ROUND256(b,c,d,e,f,g,h,a); } while (j < 64); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = 0; } #else /* ISC_SHA2_UNROLL_TRANSFORM */ void isc_sha256_transform(isc_sha256_t *context, const isc_uint32_t* data) { isc_uint32_t a, b, c, d, e, f, g, h, s0, s1; isc_uint32_t T1, T2, *W256; int j; W256 = (isc_uint32_t*)context->buffer; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { #if BYTE_ORDER == LITTLE_ENDIAN /* Copy data while converting to host byte order */ REVERSE32(*data++,W256[j]); /* Apply the SHA-256 compression function to update a..h */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; #else /* BYTE_ORDER == LITTLE_ENDIAN */ /* Apply the SHA-256 compression function to update a..h with copy */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); #endif /* BYTE_ORDER == LITTLE_ENDIAN */ T2 = Sigma0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 16); do { /* Part of the message block expansion: */ s0 = W256[(j+1)&0x0f]; s0 = sigma0_256(s0); s1 = W256[(j+14)&0x0f]; s1 = sigma1_256(s1); /* Apply the SHA-256 compression function to update a..h */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); T2 = Sigma0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 64); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = T2 = 0; } #endif /* ISC_SHA2_UNROLL_TRANSFORM */ void isc_sha256_update(isc_sha256_t *context, const isc_uint8_t *data, size_t len) { unsigned int freespace, usedspace; if (len == 0U) { /* Calling with no data is valid - we do nothing */ return; } /* Sanity check: */ REQUIRE(context != (isc_sha256_t *)0 && data != (isc_uint8_t*)0); usedspace = (unsigned int)((context->bitcount >> 3) % ISC_SHA256_BLOCK_LENGTH); if (usedspace > 0) { /* Calculate how much free space is available in the buffer */ freespace = ISC_SHA256_BLOCK_LENGTH - usedspace; if (len >= freespace) { /* Fill the buffer completely and process it */ memcpy(&context->buffer[usedspace], data, freespace); context->bitcount += freespace << 3; len -= freespace; data += freespace; isc_sha256_transform(context, (isc_uint32_t*)context->buffer); } else { /* The buffer is not yet full */ memcpy(&context->buffer[usedspace], data, len); context->bitcount += len << 3; /* Clean up: */ usedspace = freespace = 0; return; } } while (len >= ISC_SHA256_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ memcpy(context->buffer, data, ISC_SHA256_BLOCK_LENGTH); isc_sha256_transform(context, (isc_uint32_t*)context->buffer); context->bitcount += ISC_SHA256_BLOCK_LENGTH << 3; len -= ISC_SHA256_BLOCK_LENGTH; data += ISC_SHA256_BLOCK_LENGTH; } if (len > 0U) { /* There's left-overs, so save 'em */ memcpy(context->buffer, data, len); context->bitcount += len << 3; } /* Clean up: */ usedspace = freespace = 0; } void isc_sha256_final(isc_uint8_t digest[], isc_sha256_t *context) { isc_uint32_t *d = (isc_uint32_t*)digest; unsigned int usedspace; /* Sanity check: */ REQUIRE(context != (isc_sha256_t *)0); /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (isc_uint8_t*)0) { usedspace = (unsigned int)((context->bitcount >> 3) % ISC_SHA256_BLOCK_LENGTH); #if BYTE_ORDER == LITTLE_ENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount,context->bitcount); #endif if (usedspace > 0) { /* Begin padding with a 1 bit: */ context->buffer[usedspace++] = 0x80; if (usedspace <= ISC_SHA256_SHORT_BLOCK_LENGTH) { /* Set-up for the last transform: */ memset(&context->buffer[usedspace], 0, ISC_SHA256_SHORT_BLOCK_LENGTH - usedspace); } else { if (usedspace < ISC_SHA256_BLOCK_LENGTH) { memset(&context->buffer[usedspace], 0, ISC_SHA256_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ isc_sha256_transform(context, (isc_uint32_t*)context->buffer); /* And set-up for the last transform: */ memset(context->buffer, 0, ISC_SHA256_SHORT_BLOCK_LENGTH); } } else { /* Set-up for the last transform: */ memset(context->buffer, 0, ISC_SHA256_SHORT_BLOCK_LENGTH); /* Begin padding with a 1 bit: */ *context->buffer = 0x80; } /* Set the bit count: */ *(isc_uint64_t*)&context->buffer[ISC_SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; /* Final transform: */ isc_sha256_transform(context, (isc_uint32_t*)context->buffer); #if BYTE_ORDER == LITTLE_ENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 8; j++) { REVERSE32(context->state[j],context->state[j]); *d++ = context->state[j]; } } #else memcpy(d, context->state, ISC_SHA256_DIGESTLENGTH); #endif } /* Clean up state data: */ memset(context, 0, sizeof(context)); usedspace = 0; } char * isc_sha256_end(isc_sha256_t *context, char buffer[]) { isc_uint8_t digest[ISC_SHA256_DIGESTLENGTH], *d = digest; unsigned int i; /* Sanity check: */ REQUIRE(context != (isc_sha256_t *)0); if (buffer != (char*)0) { isc_sha256_final(digest, context); for (i = 0; i < ISC_SHA256_DIGESTLENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } *buffer = (char)0; } else { memset(context, 0, sizeof(context)); } memset(digest, 0, ISC_SHA256_DIGESTLENGTH); return buffer; } char * isc_sha256_data(const isc_uint8_t* data, size_t len, char digest[ISC_SHA256_DIGESTSTRINGLENGTH]) { isc_sha256_t context; isc_sha256_init(&context); isc_sha256_update(&context, data, len); return (isc_sha256_end(&context, digest)); } /*** SHA-512: *********************************************************/ void isc_sha512_init(isc_sha512_t *context) { if (context == (isc_sha512_t *)0) { return; } memcpy(context->state, sha512_initial_hash_value, ISC_SHA512_DIGESTLENGTH); memset(context->buffer, 0, ISC_SHA512_BLOCK_LENGTH); context->bitcount[0] = context->bitcount[1] = 0; } #ifdef ISC_SHA2_UNROLL_TRANSFORM /* Unrolled SHA-512 round macros: */ #if BYTE_ORDER == LITTLE_ENDIAN #define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ REVERSE64(*data++, W512[j]); \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ K512[j] + W512[j]; \ (d) += T1, \ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \ j++ #else /* BYTE_ORDER == LITTLE_ENDIAN */ #define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ K512[j] + (W512[j] = *data++); \ (d) += T1; \ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ j++ #endif /* BYTE_ORDER == LITTLE_ENDIAN */ #define ROUND512(a,b,c,d,e,f,g,h) \ s0 = W512[(j+1)&0x0f]; \ s0 = sigma0_512(s0); \ s1 = W512[(j+14)&0x0f]; \ s1 = sigma1_512(s1); \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \ (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ (d) += T1; \ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ j++ void isc_sha512_transform(isc_sha512_t *context, const isc_uint64_t* data) { isc_uint64_t a, b, c, d, e, f, g, h, s0, s1; isc_uint64_t T1, *W512 = (isc_uint64_t*)context->buffer; int j; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { ROUND512_0_TO_15(a,b,c,d,e,f,g,h); ROUND512_0_TO_15(h,a,b,c,d,e,f,g); ROUND512_0_TO_15(g,h,a,b,c,d,e,f); ROUND512_0_TO_15(f,g,h,a,b,c,d,e); ROUND512_0_TO_15(e,f,g,h,a,b,c,d); ROUND512_0_TO_15(d,e,f,g,h,a,b,c); ROUND512_0_TO_15(c,d,e,f,g,h,a,b); ROUND512_0_TO_15(b,c,d,e,f,g,h,a); } while (j < 16); /* Now for the remaining rounds up to 79: */ do { ROUND512(a,b,c,d,e,f,g,h); ROUND512(h,a,b,c,d,e,f,g); ROUND512(g,h,a,b,c,d,e,f); ROUND512(f,g,h,a,b,c,d,e); ROUND512(e,f,g,h,a,b,c,d); ROUND512(d,e,f,g,h,a,b,c); ROUND512(c,d,e,f,g,h,a,b); ROUND512(b,c,d,e,f,g,h,a); } while (j < 80); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = 0; } #else /* ISC_SHA2_UNROLL_TRANSFORM */ void isc_sha512_transform(isc_sha512_t *context, const isc_uint64_t* data) { isc_uint64_t a, b, c, d, e, f, g, h, s0, s1; isc_uint64_t T1, T2, *W512 = (isc_uint64_t*)context->buffer; int j; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { #if BYTE_ORDER == LITTLE_ENDIAN /* Convert TO host byte order */ REVERSE64(*data++, W512[j]); /* Apply the SHA-512 compression function to update a..h */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; #else /* BYTE_ORDER == LITTLE_ENDIAN */ /* Apply the SHA-512 compression function to update a..h with copy */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); #endif /* BYTE_ORDER == LITTLE_ENDIAN */ T2 = Sigma0_512(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 16); do { /* Part of the message block expansion: */ s0 = W512[(j+1)&0x0f]; s0 = sigma0_512(s0); s1 = W512[(j+14)&0x0f]; s1 = sigma1_512(s1); /* Apply the SHA-512 compression function to update a..h */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); T2 = Sigma0_512(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 80); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = T2 = 0; } #endif /* ISC_SHA2_UNROLL_TRANSFORM */ void isc_sha512_update(isc_sha512_t *context, const isc_uint8_t *data, size_t len) { unsigned int freespace, usedspace; if (len == 0U) { /* Calling with no data is valid - we do nothing */ return; } /* Sanity check: */ REQUIRE(context != (isc_sha512_t *)0 && data != (isc_uint8_t*)0); usedspace = (unsigned int)((context->bitcount[0] >> 3) % ISC_SHA512_BLOCK_LENGTH); if (usedspace > 0) { /* Calculate how much free space is available in the buffer */ freespace = ISC_SHA512_BLOCK_LENGTH - usedspace; if (len >= freespace) { /* Fill the buffer completely and process it */ memcpy(&context->buffer[usedspace], data, freespace); ADDINC128(context->bitcount, freespace << 3); len -= freespace; data += freespace; isc_sha512_transform(context, (isc_uint64_t*)context->buffer); } else { /* The buffer is not yet full */ memcpy(&context->buffer[usedspace], data, len); ADDINC128(context->bitcount, len << 3); /* Clean up: */ usedspace = freespace = 0; return; } } while (len >= ISC_SHA512_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ memcpy(context->buffer, data, ISC_SHA512_BLOCK_LENGTH); isc_sha512_transform(context, (isc_uint64_t*)context->buffer); ADDINC128(context->bitcount, ISC_SHA512_BLOCK_LENGTH << 3); len -= ISC_SHA512_BLOCK_LENGTH; data += ISC_SHA512_BLOCK_LENGTH; } if (len > 0U) { /* There's left-overs, so save 'em */ memcpy(context->buffer, data, len); ADDINC128(context->bitcount, len << 3); } /* Clean up: */ usedspace = freespace = 0; } void isc_sha512_last(isc_sha512_t *context) { unsigned int usedspace; usedspace = (unsigned int)((context->bitcount[0] >> 3) % ISC_SHA512_BLOCK_LENGTH); #if BYTE_ORDER == LITTLE_ENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount[0],context->bitcount[0]); REVERSE64(context->bitcount[1],context->bitcount[1]); #endif if (usedspace > 0) { /* Begin padding with a 1 bit: */ context->buffer[usedspace++] = 0x80; if (usedspace <= ISC_SHA512_SHORT_BLOCK_LENGTH) { /* Set-up for the last transform: */ memset(&context->buffer[usedspace], 0, ISC_SHA512_SHORT_BLOCK_LENGTH - usedspace); } else { if (usedspace < ISC_SHA512_BLOCK_LENGTH) { memset(&context->buffer[usedspace], 0, ISC_SHA512_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ isc_sha512_transform(context, (isc_uint64_t*)context->buffer); /* And set-up for the last transform: */ memset(context->buffer, 0, ISC_SHA512_BLOCK_LENGTH - 2); } } else { /* Prepare for final transform: */ memset(context->buffer, 0, ISC_SHA512_SHORT_BLOCK_LENGTH); /* Begin padding with a 1 bit: */ *context->buffer = 0x80; } /* Store the length of input data (in bits): */ *(isc_uint64_t*)&context->buffer[ISC_SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; *(isc_uint64_t*)&context->buffer[ISC_SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; /* Final transform: */ isc_sha512_transform(context, (isc_uint64_t*)context->buffer); } void isc_sha512_final(isc_uint8_t digest[], isc_sha512_t *context) { isc_uint64_t *d = (isc_uint64_t*)digest; /* Sanity check: */ REQUIRE(context != (isc_sha512_t *)0); /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (isc_uint8_t*)0) { isc_sha512_last(context); /* Save the hash data for output: */ #if BYTE_ORDER == LITTLE_ENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 8; j++) { REVERSE64(context->state[j],context->state[j]); *d++ = context->state[j]; } } #else memcpy(d, context->state, ISC_SHA512_DIGESTLENGTH); #endif } /* Zero out state data */ memset(context, 0, sizeof(context)); } char * isc_sha512_end(isc_sha512_t *context, char buffer[]) { isc_uint8_t digest[ISC_SHA512_DIGESTLENGTH], *d = digest; unsigned int i; /* Sanity check: */ REQUIRE(context != (isc_sha512_t *)0); if (buffer != (char*)0) { isc_sha512_final(digest, context); for (i = 0; i < ISC_SHA512_DIGESTLENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } *buffer = (char)0; } else { memset(context, 0, sizeof(context)); } memset(digest, 0, ISC_SHA512_DIGESTLENGTH); return buffer; } char * isc_sha512_data(const isc_uint8_t *data, size_t len, char digest[ISC_SHA512_DIGESTSTRINGLENGTH]) { isc_sha512_t context; isc_sha512_init(&context); isc_sha512_update(&context, data, len); return (isc_sha512_end(&context, digest)); } /*** SHA-384: *********************************************************/ void isc_sha384_init(isc_sha384_t *context) { if (context == (isc_sha384_t *)0) { return; } memcpy(context->state, sha384_initial_hash_value, ISC_SHA512_DIGESTLENGTH); memset(context->buffer, 0, ISC_SHA384_BLOCK_LENGTH); context->bitcount[0] = context->bitcount[1] = 0; } void isc_sha384_update(isc_sha384_t *context, const isc_uint8_t* data, size_t len) { isc_sha512_update((isc_sha512_t *)context, data, len); } void isc_sha384_final(isc_uint8_t digest[], isc_sha384_t *context) { isc_uint64_t *d = (isc_uint64_t*)digest; /* Sanity check: */ REQUIRE(context != (isc_sha384_t *)0); /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (isc_uint8_t*)0) { isc_sha512_last((isc_sha512_t *)context); /* Save the hash data for output: */ #if BYTE_ORDER == LITTLE_ENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 6; j++) { REVERSE64(context->state[j],context->state[j]); *d++ = context->state[j]; } } #else memcpy(d, context->state, ISC_SHA384_DIGESTLENGTH); #endif } /* Zero out state data */ memset(context, 0, sizeof(context)); } char * isc_sha384_end(isc_sha384_t *context, char buffer[]) { isc_uint8_t digest[ISC_SHA384_DIGESTLENGTH], *d = digest; unsigned int i; /* Sanity check: */ REQUIRE(context != (isc_sha384_t *)0); if (buffer != (char*)0) { isc_sha384_final(digest, context); for (i = 0; i < ISC_SHA384_DIGESTLENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } *buffer = (char)0; } else { memset(context, 0, sizeof(context)); } memset(digest, 0, ISC_SHA384_DIGESTLENGTH); return buffer; } char* isc_sha384_data(const isc_uint8_t *data, size_t len, char digest[ISC_SHA384_DIGESTSTRINGLENGTH]) { isc_sha384_t context; isc_sha384_init(&context); isc_sha384_update(&context, data, len); return (isc_sha384_end(&context, digest)); } ntp-4.2.6p5/lib/isc/ia64/0000755000175000017500000000000011307651602013701 5ustar peterpeterntp-4.2.6p5/lib/isc/ia64/include/0000755000175000017500000000000011307651602015324 5ustar peterpeterntp-4.2.6p5/lib/isc/ia64/include/isc/0000755000175000017500000000000011675461367016121 5ustar peterpeterntp-4.2.6p5/lib/isc/ia64/include/isc/atomic.h0000644000175000017500000000502411307651605017533 0ustar peterpeter/* * Copyright (C) 2006, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: atomic.h,v 1.4.326.2 2009/02/06 23:47:11 tbox Exp $ */ #ifndef ISC_ATOMIC_H #define ISC_ATOMIC_H 1 #include #include #ifdef ISC_PLATFORM_USEGCCASM /* * This routine atomically increments the value stored in 'p' by 'val', and * returns the previous value. * * Open issue: can 'fetchadd' make the code faster for some particular values * (e.g., 1 and -1)? */ static inline isc_int32_t isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) #ifdef __GNUC__ __attribute__ ((unused)) #endif { isc_int32_t prev, swapped; for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) { swapped = prev + val; __asm__ volatile( "mov ar.ccv=%2;" "cmpxchg4.acq %0=%4,%3,ar.ccv" : "=r" (swapped), "=m" (*p) : "r" (prev), "r" (swapped), "m" (*p) : "memory"); if (swapped == prev) break; } return (prev); } /* * This routine atomically stores the value 'val' in 'p'. */ static inline void isc_atomic_store(isc_int32_t *p, isc_int32_t val) #ifdef __GNUC__ __attribute__ ((unused)) #endif { __asm__ volatile( "st4.rel %0=%1" : "=m" (*p) : "r" (val) : "memory" ); } /* * This routine atomically replaces the value in 'p' with 'val', if the * original value is equal to 'cmpval'. The original value is returned in any * case. */ static inline isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) #ifdef __GNUC__ __attribute__ ((unused)) #endif { isc_int32_t ret; __asm__ volatile( "mov ar.ccv=%2;" "cmpxchg4.acq %0=%4,%3,ar.ccv" : "=r" (ret), "=m" (*p) : "r" (cmpval), "r" (val), "m" (*p) : "memory"); return (ret); } #else /* !ISC_PLATFORM_USEGCCASM */ #error "unsupported compiler. disable atomic ops by --disable-atomic" #endif #endif /* ISC_ATOMIC_H */ ntp-4.2.6p5/lib/isc/parseint.c0000644000175000017500000000405611307651603015135 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: parseint.c,v 1.8 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include isc_result_t isc_parse_uint32(isc_uint32_t *uip, const char *string, int base) { unsigned long n; char *e; if (! isalnum((unsigned char)(string[0]))) return (ISC_R_BADNUMBER); errno = 0; n = strtoul(string, &e, base); if (*e != '\0') return (ISC_R_BADNUMBER); if (n == ULONG_MAX && errno == ERANGE) return (ISC_R_RANGE); *uip = n; return (ISC_R_SUCCESS); } isc_result_t isc_parse_uint16(isc_uint16_t *uip, const char *string, int base) { isc_uint32_t val; isc_result_t result; result = isc_parse_uint32(&val, string, base); if (result != ISC_R_SUCCESS) return (result); if (val > 0xFFFF) return (ISC_R_RANGE); *uip = (isc_uint16_t) val; return (ISC_R_SUCCESS); } isc_result_t isc_parse_uint8(isc_uint8_t *uip, const char *string, int base) { isc_uint32_t val; isc_result_t result; result = isc_parse_uint32(&val, string, base); if (result != ISC_R_SUCCESS) return (result); if (val > 0xFF) return (ISC_R_RANGE); *uip = (isc_uint8_t) val; return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/ondestroy.c0000644000175000017500000000423711307651603015337 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ondestroy.c,v 1.16 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include #define ONDESTROY_MAGIC ISC_MAGIC('D', 'e', 'S', 't') #define VALID_ONDESTROY(s) ISC_MAGIC_VALID(s, ONDESTROY_MAGIC) void isc_ondestroy_init(isc_ondestroy_t *ondest) { ondest->magic = ONDESTROY_MAGIC; ISC_LIST_INIT(ondest->events); } isc_result_t isc_ondestroy_register(isc_ondestroy_t *ondest, isc_task_t *task, isc_event_t **eventp) { isc_event_t *theevent; isc_task_t *thetask = NULL; REQUIRE(VALID_ONDESTROY(ondest)); REQUIRE(task != NULL); REQUIRE(eventp != NULL); theevent = *eventp; REQUIRE(theevent != NULL); isc_task_attach(task, &thetask); theevent->ev_sender = thetask; ISC_LIST_APPEND(ondest->events, theevent, ev_link); return (ISC_R_SUCCESS); } void isc_ondestroy_notify(isc_ondestroy_t *ondest, void *sender) { isc_event_t *eventp; isc_task_t *task; REQUIRE(VALID_ONDESTROY(ondest)); eventp = ISC_LIST_HEAD(ondest->events); while (eventp != NULL) { ISC_LIST_UNLINK(ondest->events, eventp, ev_link); task = eventp->ev_sender; eventp->ev_sender = sender; isc_task_sendanddetach(&task, &eventp); eventp = ISC_LIST_HEAD(ondest->events); } } ntp-4.2.6p5/lib/isc/sockaddr.c0000644000175000017500000003257711307651603015113 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: sockaddr.c,v 1.70 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include #include #include #include isc_boolean_t isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b) { return (isc_sockaddr_compare(a, b, ISC_SOCKADDR_CMPADDR| ISC_SOCKADDR_CMPPORT| ISC_SOCKADDR_CMPSCOPE)); } isc_boolean_t isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b) { return (isc_sockaddr_compare(a, b, ISC_SOCKADDR_CMPADDR| ISC_SOCKADDR_CMPSCOPE)); } isc_boolean_t isc_sockaddr_compare(const isc_sockaddr_t *a, const isc_sockaddr_t *b, unsigned int flags) { REQUIRE(a != NULL && b != NULL); if (a->length != b->length) return (ISC_FALSE); /* * We don't just memcmp because the sin_zero field isn't always * zero. */ if (a->type.sa.sa_family != b->type.sa.sa_family) return (ISC_FALSE); switch (a->type.sa.sa_family) { case AF_INET: if ((flags & ISC_SOCKADDR_CMPADDR) != 0 && memcmp(&a->type.sin.sin_addr, &b->type.sin.sin_addr, sizeof(a->type.sin.sin_addr)) != 0) return (ISC_FALSE); if ((flags & ISC_SOCKADDR_CMPPORT) != 0 && a->type.sin.sin_port != b->type.sin.sin_port) return (ISC_FALSE); break; case AF_INET6: if ((flags & ISC_SOCKADDR_CMPADDR) != 0 && memcmp(&a->type.sin6.sin6_addr, &b->type.sin6.sin6_addr, sizeof(a->type.sin6.sin6_addr)) != 0) return (ISC_FALSE); #ifdef ISC_PLATFORM_HAVESCOPEID /* * If ISC_SOCKADDR_CMPSCOPEZERO is set then don't return * ISC_FALSE if one of the scopes in zero. */ if ((flags & ISC_SOCKADDR_CMPSCOPE) != 0 && a->type.sin6.sin6_scope_id != b->type.sin6.sin6_scope_id && ((flags & ISC_SOCKADDR_CMPSCOPEZERO) == 0 || (a->type.sin6.sin6_scope_id != 0 && b->type.sin6.sin6_scope_id != 0))) return (ISC_FALSE); #endif if ((flags & ISC_SOCKADDR_CMPPORT) != 0 && a->type.sin6.sin6_port != b->type.sin6.sin6_port) return (ISC_FALSE); break; default: if (memcmp(&a->type, &b->type, a->length) != 0) return (ISC_FALSE); } return (ISC_TRUE); } isc_boolean_t isc_sockaddr_eqaddrprefix(const isc_sockaddr_t *a, const isc_sockaddr_t *b, unsigned int prefixlen) { isc_netaddr_t na, nb; isc_netaddr_fromsockaddr(&na, a); isc_netaddr_fromsockaddr(&nb, b); return (isc_netaddr_eqprefix(&na, &nb, prefixlen)); } isc_result_t isc_sockaddr_totext(const isc_sockaddr_t *sockaddr, isc_buffer_t *target) { isc_result_t result; isc_netaddr_t netaddr; char pbuf[sizeof("65000")]; unsigned int plen; isc_region_t avail; REQUIRE(sockaddr != NULL); /* * Do the port first, giving us the opportunity to check for * unsupported address families before calling * isc_netaddr_fromsockaddr(). */ switch (sockaddr->type.sa.sa_family) { case AF_INET: snprintf(pbuf, sizeof(pbuf), "%u", ntohs(sockaddr->type.sin.sin_port)); break; case AF_INET6: snprintf(pbuf, sizeof(pbuf), "%u", ntohs(sockaddr->type.sin6.sin6_port)); break; #ifdef ISC_PLAFORM_HAVESYSUNH case AF_UNIX: plen = strlen(sockaddr->type.sunix.sun_path); if (plen >= isc_buffer_availablelength(target)) return (ISC_R_NOSPACE); isc_buffer_putmem(target, sockaddr->type.sunix.sun_path, plen); /* * Null terminate after used region. */ isc_buffer_availableregion(target, &avail); INSIST(avail.length >= 1); avail.base[0] = '\0'; return (ISC_R_SUCCESS); #endif default: return (ISC_R_FAILURE); } plen = strlen(pbuf); INSIST(plen < sizeof(pbuf)); isc_netaddr_fromsockaddr(&netaddr, sockaddr); result = isc_netaddr_totext(&netaddr, target); if (result != ISC_R_SUCCESS) return (result); if (1 + plen + 1 > isc_buffer_availablelength(target)) return (ISC_R_NOSPACE); isc_buffer_putmem(target, (const unsigned char *)"#", 1); isc_buffer_putmem(target, (const unsigned char *)pbuf, plen); /* * Null terminate after used region. */ isc_buffer_availableregion(target, &avail); INSIST(avail.length >= 1); avail.base[0] = '\0'; return (ISC_R_SUCCESS); } void isc_sockaddr_format(const isc_sockaddr_t *sa, char *array, unsigned int size) { isc_result_t result; isc_buffer_t buf; isc_buffer_init(&buf, array, size); result = isc_sockaddr_totext(sa, &buf); if (result != ISC_R_SUCCESS) { /* * The message is the same as in netaddr.c. */ snprintf(array, size, isc_msgcat_get(isc_msgcat, ISC_MSGSET_NETADDR, ISC_MSG_UNKNOWNADDR, ""), sa->type.sa.sa_family); array[size - 1] = '\0'; } } unsigned int isc_sockaddr_hash(const isc_sockaddr_t *sockaddr, isc_boolean_t address_only) { unsigned int length = 0; const unsigned char *s = NULL; unsigned int h = 0; unsigned int g; unsigned int p = 0; const struct in6_addr *in6; REQUIRE(sockaddr != NULL); switch (sockaddr->type.sa.sa_family) { case AF_INET: s = (const unsigned char *)&sockaddr->type.sin.sin_addr; p = ntohs(sockaddr->type.sin.sin_port); length = sizeof(sockaddr->type.sin.sin_addr.s_addr); break; case AF_INET6: in6 = &sockaddr->type.sin6.sin6_addr; if (IN6_IS_ADDR_V4MAPPED(in6)) { s = (const unsigned char *)&in6[12]; length = sizeof(sockaddr->type.sin.sin_addr.s_addr); } else { s = (const unsigned char *)in6; length = sizeof(sockaddr->type.sin6.sin6_addr); } p = ntohs(sockaddr->type.sin6.sin6_port); break; default: UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKADDR, ISC_MSG_UNKNOWNFAMILY, "unknown address family: %d"), (int)sockaddr->type.sa.sa_family); s = (const unsigned char *)&sockaddr->type; length = sockaddr->length; p = 0; } h = isc_hash_calc(s, length, ISC_TRUE); if (!address_only) { g = isc_hash_calc((const unsigned char *)&p, sizeof(p), ISC_TRUE); h = h ^ g; /* XXX: we should concatenate h and p first */ } return (h); } void isc_sockaddr_any(isc_sockaddr_t *sockaddr) { memset(sockaddr, 0, sizeof(*sockaddr)); sockaddr->type.sin.sin_family = AF_INET; #ifdef ISC_PLATFORM_HAVESALEN sockaddr->type.sin.sin_len = sizeof(sockaddr->type.sin); #endif sockaddr->type.sin.sin_addr.s_addr = INADDR_ANY; sockaddr->type.sin.sin_port = 0; sockaddr->length = sizeof(sockaddr->type.sin); ISC_LINK_INIT(sockaddr, link); } void isc_sockaddr_any6(isc_sockaddr_t *sockaddr) { memset(sockaddr, 0, sizeof(*sockaddr)); sockaddr->type.sin6.sin6_family = AF_INET6; #ifdef ISC_PLATFORM_HAVESALEN sockaddr->type.sin6.sin6_len = sizeof(sockaddr->type.sin6); #endif sockaddr->type.sin6.sin6_addr = in6addr_any; sockaddr->type.sin6.sin6_port = 0; sockaddr->length = sizeof(sockaddr->type.sin6); ISC_LINK_INIT(sockaddr, link); } void isc_sockaddr_fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina, in_port_t port) { memset(sockaddr, 0, sizeof(*sockaddr)); sockaddr->type.sin.sin_family = AF_INET; #ifdef ISC_PLATFORM_HAVESALEN sockaddr->type.sin.sin_len = sizeof(sockaddr->type.sin); #endif sockaddr->type.sin.sin_addr = *ina; sockaddr->type.sin.sin_port = htons(port); sockaddr->length = sizeof(sockaddr->type.sin); ISC_LINK_INIT(sockaddr, link); } void isc_sockaddr_anyofpf(isc_sockaddr_t *sockaddr, int pf) { switch (pf) { case AF_INET: isc_sockaddr_any(sockaddr); break; case AF_INET6: isc_sockaddr_any6(sockaddr); break; default: INSIST(0); } } void isc_sockaddr_fromin6(isc_sockaddr_t *sockaddr, const struct in6_addr *ina6, in_port_t port) { memset(sockaddr, 0, sizeof(*sockaddr)); sockaddr->type.sin6.sin6_family = AF_INET6; #ifdef ISC_PLATFORM_HAVESALEN sockaddr->type.sin6.sin6_len = sizeof(sockaddr->type.sin6); #endif sockaddr->type.sin6.sin6_addr = *ina6; sockaddr->type.sin6.sin6_port = htons(port); sockaddr->length = sizeof(sockaddr->type.sin6); ISC_LINK_INIT(sockaddr, link); } void isc_sockaddr_v6fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina, in_port_t port) { memset(sockaddr, 0, sizeof(*sockaddr)); sockaddr->type.sin6.sin6_family = AF_INET6; #ifdef ISC_PLATFORM_HAVESALEN sockaddr->type.sin6.sin6_len = sizeof(sockaddr->type.sin6); #endif sockaddr->type.sin6.sin6_addr.s6_addr[10] = 0xff; sockaddr->type.sin6.sin6_addr.s6_addr[11] = 0xff; memcpy(&sockaddr->type.sin6.sin6_addr.s6_addr[12], ina, 4); sockaddr->type.sin6.sin6_port = htons(port); sockaddr->length = sizeof(sockaddr->type.sin6); ISC_LINK_INIT(sockaddr, link); } int isc_sockaddr_pf(const isc_sockaddr_t *sockaddr) { /* * Get the protocol family of 'sockaddr'. */ #if (AF_INET == PF_INET && AF_INET6 == PF_INET6) /* * Assume that PF_xxx == AF_xxx for all AF and PF. */ return (sockaddr->type.sa.sa_family); #else switch (sockaddr->type.sa.sa_family) { case AF_INET: return (PF_INET); case AF_INET6: return (PF_INET6); default: FATAL_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKADDR, ISC_MSG_UNKNOWNFAMILY, "unknown address family: %d"), (int)sockaddr->type.sa.sa_family); } #endif } void isc_sockaddr_fromnetaddr(isc_sockaddr_t *sockaddr, const isc_netaddr_t *na, in_port_t port) { memset(sockaddr, 0, sizeof(*sockaddr)); sockaddr->type.sin.sin_family = (short)na->family; switch (na->family) { case AF_INET: sockaddr->length = sizeof(sockaddr->type.sin); #ifdef ISC_PLATFORM_HAVESALEN sockaddr->type.sin.sin_len = sizeof(sockaddr->type.sin); #endif sockaddr->type.sin.sin_addr = na->type.in; sockaddr->type.sin.sin_port = htons(port); break; case AF_INET6: sockaddr->length = sizeof(sockaddr->type.sin6); #ifdef ISC_PLATFORM_HAVESALEN sockaddr->type.sin6.sin6_len = sizeof(sockaddr->type.sin6); #endif memcpy(&sockaddr->type.sin6.sin6_addr, &na->type.in6, 16); #ifdef ISC_PLATFORM_HAVESCOPEID sockaddr->type.sin6.sin6_scope_id = isc_netaddr_getzone(na); #endif sockaddr->type.sin6.sin6_port = htons(port); break; default: INSIST(0); } ISC_LINK_INIT(sockaddr, link); } void isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port) { switch (sockaddr->type.sa.sa_family) { case AF_INET: sockaddr->type.sin.sin_port = htons(port); break; case AF_INET6: sockaddr->type.sin6.sin6_port = htons(port); break; default: FATAL_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKADDR, ISC_MSG_UNKNOWNFAMILY, "unknown address family: %d"), (int)sockaddr->type.sa.sa_family); } } in_port_t isc_sockaddr_getport(const isc_sockaddr_t *sockaddr) { in_port_t port = 0; switch (sockaddr->type.sa.sa_family) { case AF_INET: port = ntohs(sockaddr->type.sin.sin_port); break; case AF_INET6: port = ntohs(sockaddr->type.sin6.sin6_port); break; default: FATAL_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKADDR, ISC_MSG_UNKNOWNFAMILY, "unknown address family: %d"), (int)sockaddr->type.sa.sa_family); } return (port); } isc_boolean_t isc_sockaddr_ismulticast(const isc_sockaddr_t *sockaddr) { isc_netaddr_t netaddr; if (sockaddr->type.sa.sa_family == AF_INET || sockaddr->type.sa.sa_family == AF_INET6) { isc_netaddr_fromsockaddr(&netaddr, sockaddr); return (isc_netaddr_ismulticast(&netaddr)); } return (ISC_FALSE); } isc_boolean_t isc_sockaddr_isexperimental(const isc_sockaddr_t *sockaddr) { isc_netaddr_t netaddr; if (sockaddr->type.sa.sa_family == AF_INET) { isc_netaddr_fromsockaddr(&netaddr, sockaddr); return (isc_netaddr_isexperimental(&netaddr)); } return (ISC_FALSE); } isc_boolean_t isc_sockaddr_issitelocal(const isc_sockaddr_t *sockaddr) { isc_netaddr_t netaddr; if (sockaddr->type.sa.sa_family == AF_INET6) { isc_netaddr_fromsockaddr(&netaddr, sockaddr); return (isc_netaddr_issitelocal(&netaddr)); } return (ISC_FALSE); } isc_boolean_t isc_sockaddr_islinklocal(const isc_sockaddr_t *sockaddr) { isc_netaddr_t netaddr; if (sockaddr->type.sa.sa_family == AF_INET6) { isc_netaddr_fromsockaddr(&netaddr, sockaddr); return (isc_netaddr_islinklocal(&netaddr)); } return (ISC_FALSE); } isc_result_t isc_sockaddr_frompath(isc_sockaddr_t *sockaddr, const char *path) { #ifdef ISC_PLATFORM_HAVESYSUNH if (strlen(path) >= sizeof(sockaddr->type.sunix.sun_path)) return (ISC_R_NOSPACE); memset(sockaddr, 0, sizeof(*sockaddr)); sockaddr->length = sizeof(sockaddr->type.sunix); sockaddr->type.sunix.sun_family = AF_UNIX; #ifdef ISC_PLATFORM_HAVESALEN sockaddr->type.sunix.sun_len = (unsigned char)sizeof(sockaddr->type.sunix); #endif strcpy(sockaddr->type.sunix.sun_path, path); return (ISC_R_SUCCESS); #else UNUSED(sockaddr); UNUSED(path); return (ISC_R_NOTIMPLEMENTED); #endif } ntp-4.2.6p5/lib/isc/strtoul.c0000644000175000017500000001035511307651604015024 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* * Copyright (c) 1990, 1993 * The Regents of the University of California. 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ /*! \file */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ /* $Id: strtoul.c,v 1.7 2007/06/19 23:47:17 tbox Exp $ */ #include #include #include #include #include #include /*! * Convert a string to an unsigned long integer. * * Ignores `locale' stuff. Assumes that the upper and lower case * alphabets and digits are each contiguous. */ unsigned long isc_strtoul(const char *nptr, char **endptr, int base) { const char *s = nptr; unsigned long acc; unsigned char c; unsigned long cutoff; int neg = 0, any, cutlim; /* * See strtol for comments as to the logic used. */ do { c = *s++; } while (isspace(c)); if (c == '-') { neg = 1; c = *s++; } else if (c == '+') c = *s++; if ((base == 0 || base == 16) && c == '0' && (*s == 'x' || *s == 'X')) { c = s[1]; s += 2; base = 16; } if (base == 0) base = c == '0' ? 8 : 10; cutoff = (unsigned long)ULONG_MAX / (unsigned long)base; cutlim = (unsigned long)ULONG_MAX % (unsigned long)base; for (acc = 0, any = 0;; c = *s++) { if (!isascii(c)) break; if (isdigit(c)) c -= '0'; else if (isalpha(c)) c -= isupper(c) ? 'A' - 10 : 'a' - 10; else break; if (c >= base) break; if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1; acc *= base; acc += c; } } if (any < 0) { acc = ULONG_MAX; errno = ERANGE; } else if (neg) acc = -acc; if (endptr != 0) DE_CONST(any ? s - 1 : nptr, *endptr); return (acc); } ntp-4.2.6p5/lib/isc/sparc64/0000755000175000017500000000000011307651602014420 5ustar peterpeterntp-4.2.6p5/lib/isc/sparc64/include/0000755000175000017500000000000011307651602016043 5ustar peterpeterntp-4.2.6p5/lib/isc/sparc64/include/isc/0000755000175000017500000000000011675461367016640 5ustar peterpeterntp-4.2.6p5/lib/isc/sparc64/include/isc/atomic.h0000644000175000017500000001003711307651604020251 0ustar peterpeter/* * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: atomic.h,v 1.5 2007/06/19 23:47:18 tbox Exp $ */ /* * This code was written based on FreeBSD's kernel source whose copyright * follows: */ /*- * Copyright (c) 1998 Doug Rabson. * Copyright (c) 2001 Jake Burkholder. * 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. * * from: FreeBSD: src/sys/i386/include/atomic.h,v 1.20 2001/02/11 * $FreeBSD: src/sys/sparc64/include/atomic.h,v 1.8 2004/05/22 00:52:16 marius Exp $ */ #ifndef ISC_ATOMIC_H #define ISC_ATOMIC_H 1 #include #include #define ASI_P 0x80 /* Primary Address Space Identifier */ #ifdef ISC_PLATFORM_USEGCCASM /* * This routine atomically increments the value stored in 'p' by 'val', and * returns the previous value. */ static inline isc_int32_t isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { isc_int32_t prev, swapped; for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) { swapped = prev + val; __asm__ volatile( "casa [%1] %2, %3, %0" : "+r"(swapped) : "r"(p), "n"(ASI_P), "r"(prev)); if (swapped == prev) break; } return (prev); } /* * This routine atomically stores the value 'val' in 'p'. */ static inline void isc_atomic_store(isc_int32_t *p, isc_int32_t val) { isc_int32_t prev, swapped; for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) { swapped = val; __asm__ volatile( "casa [%1] %2, %3, %0" : "+r"(swapped) : "r"(p), "n"(ASI_P), "r"(prev) : "memory"); if (swapped == prev) break; } } /* * This routine atomically replaces the value in 'p' with 'val', if the * original value is equal to 'cmpval'. The original value is returned in any * case. */ static inline isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { isc_int32_t temp = val; __asm__ volatile( "casa [%1] %2, %3, %0" : "+r"(temp) : "r"(p), "n"(ASI_P), "r"(cmpval)); return (temp); } #else /* ISC_PLATFORM_USEGCCASM */ #error "unsupported compiler. disable atomic ops by --disable-atomic" #endif /* ISC_PLATFORM_USEGCCASM */ #endif /* ISC_ATOMIC_H */ ntp-4.2.6p5/lib/isc/noatomic/0000755000175000017500000000000011307651602014747 5ustar peterpeterntp-4.2.6p5/lib/isc/noatomic/include/0000755000175000017500000000000011307651602016372 5ustar peterpeterntp-4.2.6p5/lib/isc/noatomic/include/isc/0000755000175000017500000000000011675461367017167 5ustar peterpeterntp-4.2.6p5/lib/isc/noatomic/include/isc/atomic.h0000644000175000017500000000170511307651603020601 0ustar peterpeter/* * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: atomic.h,v 1.4 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_ATOMIC_H #define ISC_ATOMIC_H 1 /* This file is inherently empty. */ #endif /* ISC_ATOMIC_H */ ntp-4.2.6p5/lib/isc/md5.c0000644000175000017500000002016211307651614013773 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: md5.c,v 1.14 2007/06/19 23:47:17 tbox Exp $ */ /*! \file * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to MD5Init, call MD5Update as * needed on buffers full of bytes, and then call MD5Final, which * will fill a supplied 16-byte array with the digest. */ #include "config.h" #include #include #include #include #include static void byteSwap(isc_uint32_t *buf, unsigned words) { unsigned char *p = (unsigned char *)buf; do { *buf++ = (isc_uint32_t)((unsigned)p[3] << 8 | p[2]) << 16 | ((unsigned)p[1] << 8 | p[0]); p += 4; } while (--words); } /*! * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious * initialization constants. */ void isc_md5_init(isc_md5_t *ctx) { ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; ctx->buf[2] = 0x98badcfe; ctx->buf[3] = 0x10325476; ctx->bytes[0] = 0; ctx->bytes[1] = 0; } void isc_md5_invalidate(isc_md5_t *ctx) { memset(ctx, 0, sizeof(isc_md5_t)); } /*@{*/ /*! The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) /*@}*/ /*! This is the central step in the MD5 algorithm. */ #define MD5STEP(f,w,x,y,z,in,s) \ (w += f(x,y,z) + in, w = (w<>(32-s)) + x) /*! * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ static void transform(isc_uint32_t buf[4], isc_uint32_t const in[16]) { register isc_uint32_t a, b, c, d; a = buf[0]; b = buf[1]; c = buf[2]; d = buf[3]; MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); buf[0] += a; buf[1] += b; buf[2] += c; buf[3] += d; } /*! * Update context to reflect the concatenation of another buffer full * of bytes. */ void isc_md5_update(isc_md5_t *ctx, const unsigned char *buf, unsigned int len) { isc_uint32_t t; /* Update byte count */ t = ctx->bytes[0]; if ((ctx->bytes[0] = t + len) < t) ctx->bytes[1]++; /* Carry from low to high */ t = 64 - (t & 0x3f); /* Space available in ctx->in (at least 1) */ if (t > len) { memcpy((unsigned char *)ctx->in + 64 - t, buf, len); return; } /* First chunk is an odd size */ memcpy((unsigned char *)ctx->in + 64 - t, buf, t); byteSwap(ctx->in, 16); transform(ctx->buf, ctx->in); buf += t; len -= t; /* Process data in 64-byte chunks */ while (len >= 64) { memcpy(ctx->in, buf, 64); byteSwap(ctx->in, 16); transform(ctx->buf, ctx->in); buf += 64; len -= 64; } /* Handle any remaining bytes of data. */ memcpy(ctx->in, buf, len); } /*! * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ void isc_md5_final(isc_md5_t *ctx, unsigned char *digest) { int count = ctx->bytes[0] & 0x3f; /* Number of bytes in ctx->in */ unsigned char *p = (unsigned char *)ctx->in + count; /* Set the first char of padding to 0x80. There is always room. */ *p++ = 0x80; /* Bytes of padding needed to make 56 bytes (-8..55) */ count = 56 - 1 - count; if (count < 0) { /* Padding forces an extra block */ memset(p, 0, count + 8); byteSwap(ctx->in, 16); transform(ctx->buf, ctx->in); p = (unsigned char *)ctx->in; count = 56; } memset(p, 0, count); byteSwap(ctx->in, 14); /* Append length in bits and transform */ ctx->in[14] = ctx->bytes[0] << 3; ctx->in[15] = ctx->bytes[1] << 3 | ctx->bytes[0] >> 29; transform(ctx->buf, ctx->in); byteSwap(ctx->buf, 4); memcpy(digest, ctx->buf, 16); memset(ctx, 0, sizeof(isc_md5_t)); /* In case it's sensitive */ } ntp-4.2.6p5/lib/isc/string.c0000644000175000017500000001254211307651603014615 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: string.c,v 1.20 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include static char digits[] = "0123456789abcdefghijklmnoprstuvwxyz"; isc_uint64_t isc_string_touint64(char *source, char **end, int base) { isc_uint64_t tmp; isc_uint64_t overflow; char *s = source; char *o; char c; if ((base < 0) || (base == 1) || (base > 36)) { *end = source; return (0); } while (*s != 0 && isascii(*s&0xff) && isspace(*s&0xff)) s++; if (*s == '+' /* || *s == '-' */) s++; if (base == 0) { if (*s == '0' && (*(s+1) == 'X' || *(s+1) == 'x')) { s += 2; base = 16; } else if (*s == '0') base = 8; else base = 10; } if (*s == 0) { *end = source; return (0); } overflow = ~0; overflow /= base; tmp = 0; while ((c = *s) != 0) { c = tolower(c&0xff); /* end ? */ if ((o = strchr(digits, c)) == NULL) { *end = s; return (tmp); } /* end ? */ if ((o - digits) >= base) { *end = s; return (tmp); } /* overflow ? */ if (tmp > overflow) { *end = source; return (0); } tmp *= base; /* overflow ? */ if ((tmp + (o - digits)) < tmp) { *end = source; return (0); } tmp += o - digits; s++; } *end = s; return (tmp); } isc_result_t isc_string_copy(char *target, size_t size, const char *source) { REQUIRE(size > 0U); if (strlcpy(target, source, size) >= size) { memset(target, ISC_STRING_MAGIC, size); return (ISC_R_NOSPACE); } ENSURE(strlen(target) < size); return (ISC_R_SUCCESS); } void isc_string_copy_truncate(char *target, size_t size, const char *source) { REQUIRE(size > 0U); strlcpy(target, source, size); ENSURE(strlen(target) < size); } isc_result_t isc_string_append(char *target, size_t size, const char *source) { REQUIRE(size > 0U); REQUIRE(strlen(target) < size); if (strlcat(target, source, size) >= size) { memset(target, ISC_STRING_MAGIC, size); return (ISC_R_NOSPACE); } ENSURE(strlen(target) < size); return (ISC_R_SUCCESS); } void isc_string_append_truncate(char *target, size_t size, const char *source) { REQUIRE(size > 0U); REQUIRE(strlen(target) < size); strlcat(target, source, size); ENSURE(strlen(target) < size); } isc_result_t isc_string_printf(char *target, size_t size, const char *format, ...) { va_list args; size_t n; REQUIRE(size > 0U); va_start(args, format); n = vsnprintf(target, size, format, args); va_end(args); if (n >= size) { memset(target, ISC_STRING_MAGIC, size); return (ISC_R_NOSPACE); } ENSURE(strlen(target) < size); return (ISC_R_SUCCESS); } void isc_string_printf_truncate(char *target, size_t size, const char *format, ...) { va_list args; size_t n; REQUIRE(size > 0U); va_start(args, format); n = vsnprintf(target, size, format, args); va_end(args); ENSURE(strlen(target) < size); } char * isc_string_regiondup(isc_mem_t *mctx, const isc_region_t *source) { char *target; REQUIRE(mctx != NULL); REQUIRE(source != NULL); target = (char *) isc_mem_allocate(mctx, source->length + 1); if (target != NULL) { memcpy(source->base, target, source->length); target[source->length] = '\0'; } return (target); } char * isc_string_separate(char **stringp, const char *delim) { char *string = *stringp; char *s; const char *d; char sc, dc; if (string == NULL) return (NULL); for (s = string; (sc = *s) != '\0'; s++) for (d = delim; (dc = *d) != '\0'; d++) if (sc == dc) { *s++ = '\0'; *stringp = s; return (string); } *stringp = NULL; return (string); } size_t isc_string_strlcpy(char *dst, const char *src, size_t size) { char *d = dst; const char *s = src; size_t n = size; /* Copy as many bytes as will fit */ if (n != 0U && --n != 0U) { do { if ((*d++ = *s++) == 0) break; } while (--n != 0U); } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0U) { if (size != 0U) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return(s - src - 1); /* count does not include NUL */ } size_t isc_string_strlcat(char *dst, const char *src, size_t size) { char *d = dst; const char *s = src; size_t n = size; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ while (n-- != 0U && *d != '\0') d++; dlen = d - dst; n = size - dlen; if (n == 0U) return(dlen + strlen(s)); while (*s != '\0') { if (n != 1U) { *d++ = *s; n--; } s++; } *d = '\0'; return(dlen + (s - src)); /* count does not include NUL */ } ntp-4.2.6p5/lib/isc/sha1.c0000644000175000017500000002340511307651604014144 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: sha1.c,v 1.18 2007/06/19 23:47:17 tbox Exp $ */ /* $NetBSD: sha1.c,v 1.5 2000/01/22 22:19:14 mycroft Exp $ */ /* $OpenBSD: sha1.c,v 1.9 1997/07/23 21:12:32 kstailey Exp $ */ /*! \file * SHA-1 in C * \author By Steve Reid * 100% Public Domain * \verbatim * Test Vectors (from FIPS PUB 180-1) * "abc" * A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D * "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" * 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 * A million repetitions of "a" * 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F * \endverbatim */ #include "config.h" #include #include #include #include #include #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) /*@{*/ /*! * blk0() and blk() perform the initial expand. * I got the idea of expanding during the round function from SSLeay */ #if !defined(WORDS_BIGENDIAN) # define blk0(i) \ (block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) \ | (rol(block->l[i], 8) & 0x00FF00FF)) #else # define blk0(i) block->l[i] #endif #define blk(i) \ (block->l[i & 15] = rol(block->l[(i + 13) & 15] \ ^ block->l[(i + 8) & 15] \ ^ block->l[(i + 2) & 15] \ ^ block->l[i & 15], 1)) /*@}*/ /*@{*/ /*! * (R0+R1), R2, R3, R4 are the different operations (rounds) used in SHA1 */ #define R0(v,w,x,y,z,i) \ z += ((w & (x ^ y)) ^ y) + blk0(i) + 0x5A827999 + rol(v, 5); \ w = rol(w, 30); #define R1(v,w,x,y,z,i) \ z += ((w & (x ^ y)) ^ y) + blk(i) + 0x5A827999 + rol(v, 5); \ w = rol(w, 30); #define R2(v,w,x,y,z,i) \ z += (w ^ x ^ y) + blk(i) + 0x6ED9EBA1 + rol(v, 5); \ w = rol(w, 30); #define R3(v,w,x,y,z,i) \ z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + rol(v, 5); \ w = rol(w, 30); #define R4(v,w,x,y,z,i) \ z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); \ w = rol(w, 30); /*@}*/ typedef union { unsigned char c[64]; unsigned int l[16]; } CHAR64LONG16; #ifdef __sparc_v9__ static void do_R01(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d, isc_uint32_t *e, CHAR64LONG16 *); static void do_R2(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d, isc_uint32_t *e, CHAR64LONG16 *); static void do_R3(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d, isc_uint32_t *e, CHAR64LONG16 *); static void do_R4(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d, isc_uint32_t *e, CHAR64LONG16 *); #define nR0(v,w,x,y,z,i) R0(*v,*w,*x,*y,*z,i) #define nR1(v,w,x,y,z,i) R1(*v,*w,*x,*y,*z,i) #define nR2(v,w,x,y,z,i) R2(*v,*w,*x,*y,*z,i) #define nR3(v,w,x,y,z,i) R3(*v,*w,*x,*y,*z,i) #define nR4(v,w,x,y,z,i) R4(*v,*w,*x,*y,*z,i) static void do_R01(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d, isc_uint32_t *e, CHAR64LONG16 *block) { nR0(a,b,c,d,e, 0); nR0(e,a,b,c,d, 1); nR0(d,e,a,b,c, 2); nR0(c,d,e,a,b, 3); nR0(b,c,d,e,a, 4); nR0(a,b,c,d,e, 5); nR0(e,a,b,c,d, 6); nR0(d,e,a,b,c, 7); nR0(c,d,e,a,b, 8); nR0(b,c,d,e,a, 9); nR0(a,b,c,d,e,10); nR0(e,a,b,c,d,11); nR0(d,e,a,b,c,12); nR0(c,d,e,a,b,13); nR0(b,c,d,e,a,14); nR0(a,b,c,d,e,15); nR1(e,a,b,c,d,16); nR1(d,e,a,b,c,17); nR1(c,d,e,a,b,18); nR1(b,c,d,e,a,19); } static void do_R2(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d, isc_uint32_t *e, CHAR64LONG16 *block) { nR2(a,b,c,d,e,20); nR2(e,a,b,c,d,21); nR2(d,e,a,b,c,22); nR2(c,d,e,a,b,23); nR2(b,c,d,e,a,24); nR2(a,b,c,d,e,25); nR2(e,a,b,c,d,26); nR2(d,e,a,b,c,27); nR2(c,d,e,a,b,28); nR2(b,c,d,e,a,29); nR2(a,b,c,d,e,30); nR2(e,a,b,c,d,31); nR2(d,e,a,b,c,32); nR2(c,d,e,a,b,33); nR2(b,c,d,e,a,34); nR2(a,b,c,d,e,35); nR2(e,a,b,c,d,36); nR2(d,e,a,b,c,37); nR2(c,d,e,a,b,38); nR2(b,c,d,e,a,39); } static void do_R3(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d, isc_uint32_t *e, CHAR64LONG16 *block) { nR3(a,b,c,d,e,40); nR3(e,a,b,c,d,41); nR3(d,e,a,b,c,42); nR3(c,d,e,a,b,43); nR3(b,c,d,e,a,44); nR3(a,b,c,d,e,45); nR3(e,a,b,c,d,46); nR3(d,e,a,b,c,47); nR3(c,d,e,a,b,48); nR3(b,c,d,e,a,49); nR3(a,b,c,d,e,50); nR3(e,a,b,c,d,51); nR3(d,e,a,b,c,52); nR3(c,d,e,a,b,53); nR3(b,c,d,e,a,54); nR3(a,b,c,d,e,55); nR3(e,a,b,c,d,56); nR3(d,e,a,b,c,57); nR3(c,d,e,a,b,58); nR3(b,c,d,e,a,59); } static void do_R4(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d, isc_uint32_t *e, CHAR64LONG16 *block) { nR4(a,b,c,d,e,60); nR4(e,a,b,c,d,61); nR4(d,e,a,b,c,62); nR4(c,d,e,a,b,63); nR4(b,c,d,e,a,64); nR4(a,b,c,d,e,65); nR4(e,a,b,c,d,66); nR4(d,e,a,b,c,67); nR4(c,d,e,a,b,68); nR4(b,c,d,e,a,69); nR4(a,b,c,d,e,70); nR4(e,a,b,c,d,71); nR4(d,e,a,b,c,72); nR4(c,d,e,a,b,73); nR4(b,c,d,e,a,74); nR4(a,b,c,d,e,75); nR4(e,a,b,c,d,76); nR4(d,e,a,b,c,77); nR4(c,d,e,a,b,78); nR4(b,c,d,e,a,79); } #endif /*! * Hash a single 512-bit block. This is the core of the algorithm. */ static void transform(isc_uint32_t state[5], const unsigned char buffer[64]) { isc_uint32_t a, b, c, d, e; CHAR64LONG16 *block; CHAR64LONG16 workspace; INSIST(buffer != NULL); INSIST(state != NULL); block = &workspace; (void)memcpy(block, buffer, 64); /* Copy context->state[] to working vars */ a = state[0]; b = state[1]; c = state[2]; d = state[3]; e = state[4]; #ifdef __sparc_v9__ do_R01(&a, &b, &c, &d, &e, block); do_R2(&a, &b, &c, &d, &e, block); do_R3(&a, &b, &c, &d, &e, block); do_R4(&a, &b, &c, &d, &e, block); #else /* 4 rounds of 20 operations each. Loop unrolled. */ R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); #endif /* Add the working vars back into context.state[] */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; state[4] += e; /* Wipe variables */ a = b = c = d = e = 0; } /*! * isc_sha1_init - Initialize new context */ void isc_sha1_init(isc_sha1_t *context) { INSIST(context != NULL); /* SHA1 initialization constants */ context->state[0] = 0x67452301; context->state[1] = 0xEFCDAB89; context->state[2] = 0x98BADCFE; context->state[3] = 0x10325476; context->state[4] = 0xC3D2E1F0; context->count[0] = 0; context->count[1] = 0; } void isc_sha1_invalidate(isc_sha1_t *context) { memset(context, 0, sizeof(isc_sha1_t)); } /*! * Run your data through this. */ void isc_sha1_update(isc_sha1_t *context, const unsigned char *data, unsigned int len) { unsigned int i, j; INSIST(context != 0); INSIST(data != 0); j = context->count[0]; if ((context->count[0] += len << 3) < j) context->count[1] += (len >> 29) + 1; j = (j >> 3) & 63; if ((j + len) > 63) { (void)memcpy(&context->buffer[j], data, (i = 64 - j)); transform(context->state, context->buffer); for (; i + 63 < len; i += 64) transform(context->state, &data[i]); j = 0; } else { i = 0; } (void)memcpy(&context->buffer[j], &data[i], len - i); } /*! * Add padding and return the message digest. */ static const unsigned char final_200 = 128; static const unsigned char final_0 = 0; void isc_sha1_final(isc_sha1_t *context, unsigned char *digest) { unsigned int i; unsigned char finalcount[8]; INSIST(digest != 0); INSIST(context != 0); for (i = 0; i < 8; i++) { /* Endian independent */ finalcount[i] = (unsigned char) ((context->count[(i >= 4 ? 0 : 1)] >> ((3 - (i & 3)) * 8)) & 255); } isc_sha1_update(context, &final_200, 1); while ((context->count[0] & 504) != 448) isc_sha1_update(context, &final_0, 1); /* The next Update should cause a transform() */ isc_sha1_update(context, finalcount, 8); if (digest) { for (i = 0; i < 20; i++) digest[i] = (unsigned char) ((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255); } memset(context, 0, sizeof(isc_sha1_t)); } ntp-4.2.6p5/lib/isc/bufferlist.c0000644000175000017500000000333311307651603015452 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: bufferlist.c,v 1.17 2007/06/19 23:47:17 tbox Exp $ */ /*! \file */ #include #include #include #include #include unsigned int isc_bufferlist_usedcount(isc_bufferlist_t *bl) { isc_buffer_t *buffer; unsigned int length; REQUIRE(bl != NULL); length = 0; buffer = ISC_LIST_HEAD(*bl); while (buffer != NULL) { REQUIRE(ISC_BUFFER_VALID(buffer)); length += isc_buffer_usedlength(buffer); buffer = ISC_LIST_NEXT(buffer, link); } return (length); } unsigned int isc_bufferlist_availablecount(isc_bufferlist_t *bl) { isc_buffer_t *buffer; unsigned int length; REQUIRE(bl != NULL); length = 0; buffer = ISC_LIST_HEAD(*bl); while (buffer != NULL) { REQUIRE(ISC_BUFFER_VALID(buffer)); length += isc_buffer_availablelength(buffer); buffer = ISC_LIST_NEXT(buffer, link); } return (length); } ntp-4.2.6p5/lib/isc/iterated_hash.c0000644000175000017500000000271411307651603016113 0ustar peterpeter/* * Copyright (C) 2006, 2008, 2009 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: iterated_hash.c,v 1.4.48.2 2009/02/18 23:47:12 tbox Exp $ */ #include "config.h" #include #include #include int isc_iterated_hash(unsigned char out[ISC_SHA1_DIGESTLENGTH], unsigned int hashalg, int iterations, const unsigned char *salt, int saltlength, const unsigned char *in, int inlength) { isc_sha1_t ctx; int n = 0; if (hashalg != 1) return (0); do { isc_sha1_init(&ctx); isc_sha1_update(&ctx, in, inlength); isc_sha1_update(&ctx, salt, saltlength); isc_sha1_final(&ctx, out); in = out; inlength = ISC_SHA1_DIGESTLENGTH; } while (n++ < iterations); return (ISC_SHA1_DIGESTLENGTH); } ntp-4.2.6p5/lib/isc/task.c0000644000175000017500000010205511307651604014251 0ustar peterpeter/* * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: task.c,v 1.107 2008/03/27 23:46:57 tbox Exp $ */ /*! \file * \author Principal Author: Bob Halley */ /* * XXXRTH Need to document the states a task can be in, and the rules * for changing states. */ #include #include #include #include #include #include #include #include #include #include #include #include #ifndef ISC_PLATFORM_USETHREADS #include "task_p.h" #endif /* ISC_PLATFORM_USETHREADS */ #ifdef ISC_TASK_TRACE #define XTRACE(m) fprintf(stderr, "task %p thread %lu: %s\n", \ task, isc_thread_self(), (m)) #define XTTRACE(t, m) fprintf(stderr, "task %p thread %lu: %s\n", \ (t), isc_thread_self(), (m)) #define XTHREADTRACE(m) fprintf(stderr, "thread %lu: %s\n", \ isc_thread_self(), (m)) #else #define XTRACE(m) #define XTTRACE(t, m) #define XTHREADTRACE(m) #endif /*** *** Types. ***/ typedef enum { task_state_idle, task_state_ready, task_state_running, task_state_done } task_state_t; #ifdef HAVE_LIBXML2 static const char *statenames[] = { "idle", "ready", "running", "done", }; #endif #define TASK_MAGIC ISC_MAGIC('T', 'A', 'S', 'K') #define VALID_TASK(t) ISC_MAGIC_VALID(t, TASK_MAGIC) struct isc_task { /* Not locked. */ unsigned int magic; isc_taskmgr_t * manager; isc_mutex_t lock; /* Locked by task lock. */ task_state_t state; unsigned int references; isc_eventlist_t events; isc_eventlist_t on_shutdown; unsigned int quantum; unsigned int flags; isc_stdtime_t now; char name[16]; void * tag; /* Locked by task manager lock. */ LINK(isc_task_t) link; LINK(isc_task_t) ready_link; }; #define TASK_F_SHUTTINGDOWN 0x01 #define TASK_SHUTTINGDOWN(t) (((t)->flags & TASK_F_SHUTTINGDOWN) \ != 0) #define TASK_MANAGER_MAGIC ISC_MAGIC('T', 'S', 'K', 'M') #define VALID_MANAGER(m) ISC_MAGIC_VALID(m, TASK_MANAGER_MAGIC) struct isc_taskmgr { /* Not locked. */ unsigned int magic; isc_mem_t * mctx; isc_mutex_t lock; #ifdef ISC_PLATFORM_USETHREADS unsigned int workers; isc_thread_t * threads; #endif /* ISC_PLATFORM_USETHREADS */ /* Locked by task manager lock. */ unsigned int default_quantum; LIST(isc_task_t) tasks; isc_tasklist_t ready_tasks; #ifdef ISC_PLATFORM_USETHREADS isc_condition_t work_available; isc_condition_t exclusive_granted; #endif /* ISC_PLATFORM_USETHREADS */ unsigned int tasks_running; isc_boolean_t exclusive_requested; isc_boolean_t exiting; #ifndef ISC_PLATFORM_USETHREADS unsigned int refs; #endif /* ISC_PLATFORM_USETHREADS */ }; #define DEFAULT_TASKMGR_QUANTUM 10 #define DEFAULT_DEFAULT_QUANTUM 5 #define FINISHED(m) ((m)->exiting && EMPTY((m)->tasks)) #ifndef ISC_PLATFORM_USETHREADS static isc_taskmgr_t *taskmgr = NULL; #endif /* ISC_PLATFORM_USETHREADS */ /*** *** Tasks. ***/ static void task_finished(isc_task_t *task) { isc_taskmgr_t *manager = task->manager; REQUIRE(EMPTY(task->events)); REQUIRE(EMPTY(task->on_shutdown)); REQUIRE(task->references == 0); REQUIRE(task->state == task_state_done); XTRACE("task_finished"); LOCK(&manager->lock); UNLINK(manager->tasks, task, link); #ifdef ISC_PLATFORM_USETHREADS if (FINISHED(manager)) { /* * All tasks have completed and the * task manager is exiting. Wake up * any idle worker threads so they * can exit. */ BROADCAST(&manager->work_available); } #endif /* ISC_PLATFORM_USETHREADS */ UNLOCK(&manager->lock); DESTROYLOCK(&task->lock); task->magic = 0; isc_mem_put(manager->mctx, task, sizeof(*task)); } isc_result_t isc_task_create(isc_taskmgr_t *manager, unsigned int quantum, isc_task_t **taskp) { isc_task_t *task; isc_boolean_t exiting; isc_result_t result; REQUIRE(VALID_MANAGER(manager)); REQUIRE(taskp != NULL && *taskp == NULL); task = isc_mem_get(manager->mctx, sizeof(*task)); if (task == NULL) return (ISC_R_NOMEMORY); XTRACE("isc_task_create"); task->manager = manager; result = isc_mutex_init(&task->lock); if (result != ISC_R_SUCCESS) { isc_mem_put(manager->mctx, task, sizeof(*task)); return (result); } task->state = task_state_idle; task->references = 1; INIT_LIST(task->events); INIT_LIST(task->on_shutdown); task->quantum = quantum; task->flags = 0; task->now = 0; memset(task->name, 0, sizeof(task->name)); task->tag = NULL; INIT_LINK(task, link); INIT_LINK(task, ready_link); exiting = ISC_FALSE; LOCK(&manager->lock); if (!manager->exiting) { if (task->quantum == 0) task->quantum = manager->default_quantum; APPEND(manager->tasks, task, link); } else exiting = ISC_TRUE; UNLOCK(&manager->lock); if (exiting) { DESTROYLOCK(&task->lock); isc_mem_put(manager->mctx, task, sizeof(*task)); return (ISC_R_SHUTTINGDOWN); } task->magic = TASK_MAGIC; *taskp = task; return (ISC_R_SUCCESS); } void isc_task_attach(isc_task_t *source, isc_task_t **targetp) { /* * Attach *targetp to source. */ REQUIRE(VALID_TASK(source)); REQUIRE(targetp != NULL && *targetp == NULL); XTTRACE(source, "isc_task_attach"); LOCK(&source->lock); source->references++; UNLOCK(&source->lock); *targetp = source; } static inline isc_boolean_t task_shutdown(isc_task_t *task) { isc_boolean_t was_idle = ISC_FALSE; isc_event_t *event, *prev; /* * Caller must be holding the task's lock. */ XTRACE("task_shutdown"); if (! TASK_SHUTTINGDOWN(task)) { XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_SHUTTINGDOWN, "shutting down")); task->flags |= TASK_F_SHUTTINGDOWN; if (task->state == task_state_idle) { INSIST(EMPTY(task->events)); task->state = task_state_ready; was_idle = ISC_TRUE; } INSIST(task->state == task_state_ready || task->state == task_state_running); /* * Note that we post shutdown events LIFO. */ for (event = TAIL(task->on_shutdown); event != NULL; event = prev) { prev = PREV(event, ev_link); DEQUEUE(task->on_shutdown, event, ev_link); ENQUEUE(task->events, event, ev_link); } } return (was_idle); } static inline void task_ready(isc_task_t *task) { isc_taskmgr_t *manager = task->manager; REQUIRE(VALID_MANAGER(manager)); REQUIRE(task->state == task_state_ready); XTRACE("task_ready"); LOCK(&manager->lock); ENQUEUE(manager->ready_tasks, task, ready_link); #ifdef ISC_PLATFORM_USETHREADS SIGNAL(&manager->work_available); #endif /* ISC_PLATFORM_USETHREADS */ UNLOCK(&manager->lock); } static inline isc_boolean_t task_detach(isc_task_t *task) { /* * Caller must be holding the task lock. */ REQUIRE(task->references > 0); XTRACE("detach"); task->references--; if (task->references == 0 && task->state == task_state_idle) { INSIST(EMPTY(task->events)); /* * There are no references to this task, and no * pending events. We could try to optimize and * either initiate shutdown or clean up the task, * depending on its state, but it's easier to just * make the task ready and allow run() or the event * loop to deal with shutting down and termination. */ task->state = task_state_ready; return (ISC_TRUE); } return (ISC_FALSE); } void isc_task_detach(isc_task_t **taskp) { isc_task_t *task; isc_boolean_t was_idle; /* * Detach *taskp from its task. */ REQUIRE(taskp != NULL); task = *taskp; REQUIRE(VALID_TASK(task)); XTRACE("isc_task_detach"); LOCK(&task->lock); was_idle = task_detach(task); UNLOCK(&task->lock); if (was_idle) task_ready(task); *taskp = NULL; } static inline isc_boolean_t task_send(isc_task_t *task, isc_event_t **eventp) { isc_boolean_t was_idle = ISC_FALSE; isc_event_t *event; /* * Caller must be holding the task lock. */ REQUIRE(eventp != NULL); event = *eventp; REQUIRE(event != NULL); REQUIRE(event->ev_type > 0); REQUIRE(task->state != task_state_done); XTRACE("task_send"); if (task->state == task_state_idle) { was_idle = ISC_TRUE; INSIST(EMPTY(task->events)); task->state = task_state_ready; } INSIST(task->state == task_state_ready || task->state == task_state_running); ENQUEUE(task->events, event, ev_link); *eventp = NULL; return (was_idle); } void isc_task_send(isc_task_t *task, isc_event_t **eventp) { isc_boolean_t was_idle; /* * Send '*event' to 'task'. */ REQUIRE(VALID_TASK(task)); XTRACE("isc_task_send"); /* * We're trying hard to hold locks for as short a time as possible. * We're also trying to hold as few locks as possible. This is why * some processing is deferred until after the lock is released. */ LOCK(&task->lock); was_idle = task_send(task, eventp); UNLOCK(&task->lock); if (was_idle) { /* * We need to add this task to the ready queue. * * We've waited until now to do it because making a task * ready requires locking the manager. If we tried to do * this while holding the task lock, we could deadlock. * * We've changed the state to ready, so no one else will * be trying to add this task to the ready queue. The * only way to leave the ready state is by executing the * task. It thus doesn't matter if events are added, * removed, or a shutdown is started in the interval * between the time we released the task lock, and the time * we add the task to the ready queue. */ task_ready(task); } } void isc_task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp) { isc_boolean_t idle1, idle2; isc_task_t *task; /* * Send '*event' to '*taskp' and then detach '*taskp' from its * task. */ REQUIRE(taskp != NULL); task = *taskp; REQUIRE(VALID_TASK(task)); XTRACE("isc_task_sendanddetach"); LOCK(&task->lock); idle1 = task_send(task, eventp); idle2 = task_detach(task); UNLOCK(&task->lock); /* * If idle1, then idle2 shouldn't be true as well since we're holding * the task lock, and thus the task cannot switch from ready back to * idle. */ INSIST(!(idle1 && idle2)); if (idle1 || idle2) task_ready(task); *taskp = NULL; } #define PURGE_OK(event) (((event)->ev_attributes & ISC_EVENTATTR_NOPURGE) == 0) static unsigned int dequeue_events(isc_task_t *task, void *sender, isc_eventtype_t first, isc_eventtype_t last, void *tag, isc_eventlist_t *events, isc_boolean_t purging) { isc_event_t *event, *next_event; unsigned int count = 0; REQUIRE(VALID_TASK(task)); REQUIRE(last >= first); XTRACE("dequeue_events"); /* * Events matching 'sender', whose type is >= first and <= last, and * whose tag is 'tag' will be dequeued. If 'purging', matching events * which are marked as unpurgable will not be dequeued. * * sender == NULL means "any sender", and tag == NULL means "any tag". */ LOCK(&task->lock); for (event = HEAD(task->events); event != NULL; event = next_event) { next_event = NEXT(event, ev_link); if (event->ev_type >= first && event->ev_type <= last && (sender == NULL || event->ev_sender == sender) && (tag == NULL || event->ev_tag == tag) && (!purging || PURGE_OK(event))) { DEQUEUE(task->events, event, ev_link); ENQUEUE(*events, event, ev_link); count++; } } UNLOCK(&task->lock); return (count); } unsigned int isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first, isc_eventtype_t last, void *tag) { unsigned int count; isc_eventlist_t events; isc_event_t *event, *next_event; /* * Purge events from a task's event queue. */ XTRACE("isc_task_purgerange"); ISC_LIST_INIT(events); count = dequeue_events(task, sender, first, last, tag, &events, ISC_TRUE); for (event = HEAD(events); event != NULL; event = next_event) { next_event = NEXT(event, ev_link); isc_event_free(&event); } /* * Note that purging never changes the state of the task. */ return (count); } unsigned int isc_task_purge(isc_task_t *task, void *sender, isc_eventtype_t type, void *tag) { /* * Purge events from a task's event queue. */ XTRACE("isc_task_purge"); return (isc_task_purgerange(task, sender, type, type, tag)); } isc_boolean_t isc_task_purgeevent(isc_task_t *task, isc_event_t *event) { isc_event_t *curr_event, *next_event; /* * Purge 'event' from a task's event queue. * * XXXRTH: WARNING: This method may be removed before beta. */ REQUIRE(VALID_TASK(task)); /* * If 'event' is on the task's event queue, it will be purged, * unless it is marked as unpurgeable. 'event' does not have to be * on the task's event queue; in fact, it can even be an invalid * pointer. Purging only occurs if the event is actually on the task's * event queue. * * Purging never changes the state of the task. */ LOCK(&task->lock); for (curr_event = HEAD(task->events); curr_event != NULL; curr_event = next_event) { next_event = NEXT(curr_event, ev_link); if (curr_event == event && PURGE_OK(event)) { DEQUEUE(task->events, curr_event, ev_link); break; } } UNLOCK(&task->lock); if (curr_event == NULL) return (ISC_FALSE); isc_event_free(&curr_event); return (ISC_TRUE); } unsigned int isc_task_unsendrange(isc_task_t *task, void *sender, isc_eventtype_t first, isc_eventtype_t last, void *tag, isc_eventlist_t *events) { /* * Remove events from a task's event queue. */ XTRACE("isc_task_unsendrange"); return (dequeue_events(task, sender, first, last, tag, events, ISC_FALSE)); } unsigned int isc_task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type, void *tag, isc_eventlist_t *events) { /* * Remove events from a task's event queue. */ XTRACE("isc_task_unsend"); return (dequeue_events(task, sender, type, type, tag, events, ISC_FALSE)); } isc_result_t isc_task_onshutdown(isc_task_t *task, isc_taskaction_t action, const void *arg) { isc_boolean_t disallowed = ISC_FALSE; isc_result_t result = ISC_R_SUCCESS; isc_event_t *event; /* * Send a shutdown event with action 'action' and argument 'arg' when * 'task' is shutdown. */ REQUIRE(VALID_TASK(task)); REQUIRE(action != NULL); event = isc_event_allocate(task->manager->mctx, NULL, ISC_TASKEVENT_SHUTDOWN, action, arg, sizeof(*event)); if (event == NULL) return (ISC_R_NOMEMORY); LOCK(&task->lock); if (TASK_SHUTTINGDOWN(task)) { disallowed = ISC_TRUE; result = ISC_R_SHUTTINGDOWN; } else ENQUEUE(task->on_shutdown, event, ev_link); UNLOCK(&task->lock); if (disallowed) isc_mem_put(task->manager->mctx, event, sizeof(*event)); return (result); } void isc_task_shutdown(isc_task_t *task) { isc_boolean_t was_idle; /* * Shutdown 'task'. */ REQUIRE(VALID_TASK(task)); LOCK(&task->lock); was_idle = task_shutdown(task); UNLOCK(&task->lock); if (was_idle) task_ready(task); } void isc_task_destroy(isc_task_t **taskp) { /* * Destroy '*taskp'. */ REQUIRE(taskp != NULL); isc_task_shutdown(*taskp); isc_task_detach(taskp); } void isc_task_setname(isc_task_t *task, const char *name, void *tag) { /* * Name 'task'. */ REQUIRE(VALID_TASK(task)); LOCK(&task->lock); memset(task->name, 0, sizeof(task->name)); strncpy(task->name, name, sizeof(task->name) - 1); task->tag = tag; UNLOCK(&task->lock); } const char * isc_task_getname(isc_task_t *task) { return (task->name); } void * isc_task_gettag(isc_task_t *task) { return (task->tag); } void isc_task_getcurrenttime(isc_task_t *task, isc_stdtime_t *t) { REQUIRE(VALID_TASK(task)); REQUIRE(t != NULL); LOCK(&task->lock); *t = task->now; UNLOCK(&task->lock); } /*** *** Task Manager. ***/ static void dispatch(isc_taskmgr_t *manager) { isc_task_t *task; #ifndef ISC_PLATFORM_USETHREADS unsigned int total_dispatch_count = 0; isc_tasklist_t ready_tasks; #endif /* ISC_PLATFORM_USETHREADS */ REQUIRE(VALID_MANAGER(manager)); /* * Again we're trying to hold the lock for as short a time as possible * and to do as little locking and unlocking as possible. * * In both while loops, the appropriate lock must be held before the * while body starts. Code which acquired the lock at the top of * the loop would be more readable, but would result in a lot of * extra locking. Compare: * * Straightforward: * * LOCK(); * ... * UNLOCK(); * while (expression) { * LOCK(); * ... * UNLOCK(); * * Unlocked part here... * * LOCK(); * ... * UNLOCK(); * } * * Note how if the loop continues we unlock and then immediately lock. * For N iterations of the loop, this code does 2N+1 locks and 2N+1 * unlocks. Also note that the lock is not held when the while * condition is tested, which may or may not be important, depending * on the expression. * * As written: * * LOCK(); * while (expression) { * ... * UNLOCK(); * * Unlocked part here... * * LOCK(); * ... * } * UNLOCK(); * * For N iterations of the loop, this code does N+1 locks and N+1 * unlocks. The while expression is always protected by the lock. */ #ifndef ISC_PLATFORM_USETHREADS ISC_LIST_INIT(ready_tasks); #endif LOCK(&manager->lock); while (!FINISHED(manager)) { #ifdef ISC_PLATFORM_USETHREADS /* * For reasons similar to those given in the comment in * isc_task_send() above, it is safe for us to dequeue * the task while only holding the manager lock, and then * change the task to running state while only holding the * task lock. */ while ((EMPTY(manager->ready_tasks) || manager->exclusive_requested) && !FINISHED(manager)) { XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_WAIT, "wait")); WAIT(&manager->work_available, &manager->lock); XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TASK, ISC_MSG_AWAKE, "awake")); } #else /* ISC_PLATFORM_USETHREADS */ if (total_dispatch_count >= DEFAULT_TASKMGR_QUANTUM || EMPTY(manager->ready_tasks)) break; #endif /* ISC_PLATFORM_USETHREADS */ XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TASK, ISC_MSG_WORKING, "working")); task = HEAD(manager->ready_tasks); if (task != NULL) { unsigned int dispatch_count = 0; isc_boolean_t done = ISC_FALSE; isc_boolean_t requeue = ISC_FALSE; isc_boolean_t finished = ISC_FALSE; isc_event_t *event; INSIST(VALID_TASK(task)); /* * Note we only unlock the manager lock if we actually * have a task to do. We must reacquire the manager * lock before exiting the 'if (task != NULL)' block. */ DEQUEUE(manager->ready_tasks, task, ready_link); manager->tasks_running++; UNLOCK(&manager->lock); LOCK(&task->lock); INSIST(task->state == task_state_ready); task->state = task_state_running; XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_RUNNING, "running")); isc_stdtime_get(&task->now); do { if (!EMPTY(task->events)) { event = HEAD(task->events); DEQUEUE(task->events, event, ev_link); /* * Execute the event action. */ XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TASK, ISC_MSG_EXECUTE, "execute action")); if (event->ev_action != NULL) { UNLOCK(&task->lock); (event->ev_action)(task,event); LOCK(&task->lock); } dispatch_count++; #ifndef ISC_PLATFORM_USETHREADS total_dispatch_count++; #endif /* ISC_PLATFORM_USETHREADS */ } if (task->references == 0 && EMPTY(task->events) && !TASK_SHUTTINGDOWN(task)) { isc_boolean_t was_idle; /* * There are no references and no * pending events for this task, * which means it will not become * runnable again via an external * action (such as sending an event * or detaching). * * We initiate shutdown to prevent * it from becoming a zombie. * * We do this here instead of in * the "if EMPTY(task->events)" block * below because: * * If we post no shutdown events, * we want the task to finish. * * If we did post shutdown events, * will still want the task's * quantum to be applied. */ was_idle = task_shutdown(task); INSIST(!was_idle); } if (EMPTY(task->events)) { /* * Nothing else to do for this task * right now. */ XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TASK, ISC_MSG_EMPTY, "empty")); if (task->references == 0 && TASK_SHUTTINGDOWN(task)) { /* * The task is done. */ XTRACE(isc_msgcat_get( isc_msgcat, ISC_MSGSET_TASK, ISC_MSG_DONE, "done")); finished = ISC_TRUE; task->state = task_state_done; } else task->state = task_state_idle; done = ISC_TRUE; } else if (dispatch_count >= task->quantum) { /* * Our quantum has expired, but * there is more work to be done. * We'll requeue it to the ready * queue later. * * We don't check quantum until * dispatching at least one event, * so the minimum quantum is one. */ XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TASK, ISC_MSG_QUANTUM, "quantum")); task->state = task_state_ready; requeue = ISC_TRUE; done = ISC_TRUE; } } while (!done); UNLOCK(&task->lock); if (finished) task_finished(task); LOCK(&manager->lock); manager->tasks_running--; #ifdef ISC_PLATFORM_USETHREADS if (manager->exclusive_requested && manager->tasks_running == 1) { SIGNAL(&manager->exclusive_granted); } #endif /* ISC_PLATFORM_USETHREADS */ if (requeue) { /* * We know we're awake, so we don't have * to wakeup any sleeping threads if the * ready queue is empty before we requeue. * * A possible optimization if the queue is * empty is to 'goto' the 'if (task != NULL)' * block, avoiding the ENQUEUE of the task * and the subsequent immediate DEQUEUE * (since it is the only executable task). * We don't do this because then we'd be * skipping the exit_requested check. The * cost of ENQUEUE is low anyway, especially * when you consider that we'd have to do * an extra EMPTY check to see if we could * do the optimization. If the ready queue * were usually nonempty, the 'optimization' * might even hurt rather than help. */ #ifdef ISC_PLATFORM_USETHREADS ENQUEUE(manager->ready_tasks, task, ready_link); #else ENQUEUE(ready_tasks, task, ready_link); #endif } } } #ifndef ISC_PLATFORM_USETHREADS ISC_LIST_APPENDLIST(manager->ready_tasks, ready_tasks, ready_link); #endif UNLOCK(&manager->lock); } #ifdef ISC_PLATFORM_USETHREADS static isc_threadresult_t #ifdef _WIN32 WINAPI #endif run(void *uap) { isc_taskmgr_t *manager = uap; XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_STARTING, "starting")); dispatch(manager); XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_EXITING, "exiting")); return ((isc_threadresult_t)0); } #endif /* ISC_PLATFORM_USETHREADS */ static void manager_free(isc_taskmgr_t *manager) { isc_mem_t *mctx; #ifdef ISC_PLATFORM_USETHREADS (void)isc_condition_destroy(&manager->exclusive_granted); (void)isc_condition_destroy(&manager->work_available); isc_mem_free(manager->mctx, manager->threads); #endif /* ISC_PLATFORM_USETHREADS */ DESTROYLOCK(&manager->lock); manager->magic = 0; mctx = manager->mctx; isc_mem_put(mctx, manager, sizeof(*manager)); isc_mem_detach(&mctx); } isc_result_t isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers, unsigned int default_quantum, isc_taskmgr_t **managerp) { isc_result_t result; unsigned int i, started = 0; isc_taskmgr_t *manager; /* * Create a new task manager. */ REQUIRE(workers > 0); REQUIRE(managerp != NULL && *managerp == NULL); #ifndef ISC_PLATFORM_USETHREADS UNUSED(i); UNUSED(started); UNUSED(workers); if (taskmgr != NULL) { taskmgr->refs++; *managerp = taskmgr; return (ISC_R_SUCCESS); } #endif /* ISC_PLATFORM_USETHREADS */ manager = isc_mem_get(mctx, sizeof(*manager)); if (manager == NULL) return (ISC_R_NOMEMORY); manager->magic = TASK_MANAGER_MAGIC; manager->mctx = NULL; result = isc_mutex_init(&manager->lock); if (result != ISC_R_SUCCESS) goto cleanup_mgr; #ifdef ISC_PLATFORM_USETHREADS manager->workers = 0; manager->threads = isc_mem_allocate(mctx, workers * sizeof(isc_thread_t)); if (manager->threads == NULL) { result = ISC_R_NOMEMORY; goto cleanup_lock; } if (isc_condition_init(&manager->work_available) != ISC_R_SUCCESS) { UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_condition_init() %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); result = ISC_R_UNEXPECTED; goto cleanup_threads; } if (isc_condition_init(&manager->exclusive_granted) != ISC_R_SUCCESS) { UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_condition_init() %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); result = ISC_R_UNEXPECTED; goto cleanup_workavailable; } #endif /* ISC_PLATFORM_USETHREADS */ if (default_quantum == 0) default_quantum = DEFAULT_DEFAULT_QUANTUM; manager->default_quantum = default_quantum; INIT_LIST(manager->tasks); INIT_LIST(manager->ready_tasks); manager->tasks_running = 0; manager->exclusive_requested = ISC_FALSE; manager->exiting = ISC_FALSE; isc_mem_attach(mctx, &manager->mctx); #ifdef ISC_PLATFORM_USETHREADS LOCK(&manager->lock); /* * Start workers. */ for (i = 0; i < workers; i++) { if (isc_thread_create(run, manager, &manager->threads[manager->workers]) == ISC_R_SUCCESS) { manager->workers++; started++; } } UNLOCK(&manager->lock); if (started == 0) { manager_free(manager); return (ISC_R_NOTHREADS); } isc_thread_setconcurrency(workers); #else /* ISC_PLATFORM_USETHREADS */ manager->refs = 1; taskmgr = manager; #endif /* ISC_PLATFORM_USETHREADS */ *managerp = manager; return (ISC_R_SUCCESS); #ifdef ISC_PLATFORM_USETHREADS cleanup_workavailable: (void)isc_condition_destroy(&manager->work_available); cleanup_threads: isc_mem_free(mctx, manager->threads); cleanup_lock: DESTROYLOCK(&manager->lock); #endif cleanup_mgr: isc_mem_put(mctx, manager, sizeof(*manager)); return (result); } void isc_taskmgr_destroy(isc_taskmgr_t **managerp) { isc_taskmgr_t *manager; isc_task_t *task; unsigned int i; /* * Destroy '*managerp'. */ REQUIRE(managerp != NULL); manager = *managerp; REQUIRE(VALID_MANAGER(manager)); #ifndef ISC_PLATFORM_USETHREADS UNUSED(i); if (manager->refs > 1) { manager->refs--; *managerp = NULL; return; } #endif /* ISC_PLATFORM_USETHREADS */ XTHREADTRACE("isc_taskmgr_destroy"); /* * Only one non-worker thread may ever call this routine. * If a worker thread wants to initiate shutdown of the * task manager, it should ask some non-worker thread to call * isc_taskmgr_destroy(), e.g. by signalling a condition variable * that the startup thread is sleeping on. */ /* * Unlike elsewhere, we're going to hold this lock a long time. * We need to do so, because otherwise the list of tasks could * change while we were traversing it. * * This is also the only function where we will hold both the * task manager lock and a task lock at the same time. */ LOCK(&manager->lock); /* * Make sure we only get called once. */ INSIST(!manager->exiting); manager->exiting = ISC_TRUE; /* * Post shutdown event(s) to every task (if they haven't already been * posted). */ for (task = HEAD(manager->tasks); task != NULL; task = NEXT(task, link)) { LOCK(&task->lock); if (task_shutdown(task)) ENQUEUE(manager->ready_tasks, task, ready_link); UNLOCK(&task->lock); } #ifdef ISC_PLATFORM_USETHREADS /* * Wake up any sleeping workers. This ensures we get work done if * there's work left to do, and if there are already no tasks left * it will cause the workers to see manager->exiting. */ BROADCAST(&manager->work_available); UNLOCK(&manager->lock); /* * Wait for all the worker threads to exit. */ for (i = 0; i < manager->workers; i++) (void)isc_thread_join(manager->threads[i], NULL); #else /* ISC_PLATFORM_USETHREADS */ /* * Dispatch the shutdown events. */ UNLOCK(&manager->lock); while (isc__taskmgr_ready()) (void)isc__taskmgr_dispatch(); if (!ISC_LIST_EMPTY(manager->tasks)) isc_mem_printallactive(stderr); INSIST(ISC_LIST_EMPTY(manager->tasks)); #endif /* ISC_PLATFORM_USETHREADS */ manager_free(manager); *managerp = NULL; } #ifndef ISC_PLATFORM_USETHREADS isc_boolean_t isc__taskmgr_ready(void) { if (taskmgr == NULL) return (ISC_FALSE); return (ISC_TF(!ISC_LIST_EMPTY(taskmgr->ready_tasks))); } isc_result_t isc__taskmgr_dispatch(void) { isc_taskmgr_t *manager = taskmgr; if (taskmgr == NULL) return (ISC_R_NOTFOUND); dispatch(manager); return (ISC_R_SUCCESS); } #endif /* ISC_PLATFORM_USETHREADS */ isc_result_t isc_task_beginexclusive(isc_task_t *task) { #ifdef ISC_PLATFORM_USETHREADS isc_taskmgr_t *manager = task->manager; REQUIRE(task->state == task_state_running); LOCK(&manager->lock); if (manager->exclusive_requested) { UNLOCK(&manager->lock); return (ISC_R_LOCKBUSY); } manager->exclusive_requested = ISC_TRUE; while (manager->tasks_running > 1) { WAIT(&manager->exclusive_granted, &manager->lock); } UNLOCK(&manager->lock); #else UNUSED(task); #endif return (ISC_R_SUCCESS); } void isc_task_endexclusive(isc_task_t *task) { #ifdef ISC_PLATFORM_USETHREADS isc_taskmgr_t *manager = task->manager; REQUIRE(task->state == task_state_running); LOCK(&manager->lock); REQUIRE(manager->exclusive_requested); manager->exclusive_requested = ISC_FALSE; BROADCAST(&manager->work_available); UNLOCK(&manager->lock); #else UNUSED(task); #endif } #ifdef HAVE_LIBXML2 void isc_taskmgr_renderxml(isc_taskmgr_t *mgr, xmlTextWriterPtr writer) { isc_task_t *task; LOCK(&mgr->lock); /* * Write out the thread-model, and some details about each depending * on which type is enabled. */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "thread-model"); #ifdef ISC_PLATFORM_USETHREADS xmlTextWriterStartElement(writer, ISC_XMLCHAR "type"); xmlTextWriterWriteString(writer, ISC_XMLCHAR "threaded"); xmlTextWriterEndElement(writer); /* type */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "worker-threads"); xmlTextWriterWriteFormatString(writer, "%d", mgr->workers); xmlTextWriterEndElement(writer); /* worker-threads */ #else /* ISC_PLATFORM_USETHREADS */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "type"); xmlTextWriterWriteString(writer, ISC_XMLCHAR "non-threaded"); xmlTextWriterEndElement(writer); /* type */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "references"); xmlTextWriterWriteFormatString(writer, "%d", mgr->refs); xmlTextWriterEndElement(writer); /* references */ #endif /* ISC_PLATFORM_USETHREADS */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "default-quantum"); xmlTextWriterWriteFormatString(writer, "%d", mgr->default_quantum); xmlTextWriterEndElement(writer); /* default-quantum */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "tasks-running"); xmlTextWriterWriteFormatString(writer, "%d", mgr->tasks_running); xmlTextWriterEndElement(writer); /* tasks-running */ xmlTextWriterEndElement(writer); /* thread-model */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "tasks"); task = ISC_LIST_HEAD(mgr->tasks); while (task != NULL) { LOCK(&task->lock); xmlTextWriterStartElement(writer, ISC_XMLCHAR "task"); if (task->name[0] != 0) { xmlTextWriterStartElement(writer, ISC_XMLCHAR "name"); xmlTextWriterWriteFormatString(writer, "%s", task->name); xmlTextWriterEndElement(writer); /* name */ } xmlTextWriterStartElement(writer, ISC_XMLCHAR "references"); xmlTextWriterWriteFormatString(writer, "%d", task->references); xmlTextWriterEndElement(writer); /* references */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "id"); xmlTextWriterWriteFormatString(writer, "%p", task); xmlTextWriterEndElement(writer); /* id */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "state"); xmlTextWriterWriteFormatString(writer, "%s", statenames[task->state]); xmlTextWriterEndElement(writer); /* state */ xmlTextWriterStartElement(writer, ISC_XMLCHAR "quantum"); xmlTextWriterWriteFormatString(writer, "%d", task->quantum); xmlTextWriterEndElement(writer); /* quantum */ xmlTextWriterEndElement(writer); UNLOCK(&task->lock); task = ISC_LIST_NEXT(task, link); } xmlTextWriterEndElement(writer); /* tasks */ UNLOCK(&mgr->lock); } #endif /* HAVE_LIBXML2 */ ntp-4.2.6p5/lib/isc/timer.c0000644000175000017500000005517411307651603014437 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: timer.c,v 1.84.58.4 2009/01/23 23:47:21 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef ISC_PLATFORM_USETHREADS #include "timer_p.h" #endif /* ISC_PLATFORM_USETHREADS */ #ifdef ISC_TIMER_TRACE #define XTRACE(s) fprintf(stderr, "%s\n", (s)) #define XTRACEID(s, t) fprintf(stderr, "%s %p\n", (s), (t)) #define XTRACETIME(s, d) fprintf(stderr, "%s %u.%09u\n", (s), \ (d).seconds, (d).nanoseconds) #define XTRACETIME2(s, d, n) fprintf(stderr, "%s %u.%09u %u.%09u\n", (s), \ (d).seconds, (d).nanoseconds, (n).seconds, (n).nanoseconds) #define XTRACETIMER(s, t, d) fprintf(stderr, "%s %p %u.%09u\n", (s), (t), \ (d).seconds, (d).nanoseconds) #else #define XTRACE(s) #define XTRACEID(s, t) #define XTRACETIME(s, d) #define XTRACETIME2(s, d, n) #define XTRACETIMER(s, t, d) #endif /* ISC_TIMER_TRACE */ #define TIMER_MAGIC ISC_MAGIC('T', 'I', 'M', 'R') #define VALID_TIMER(t) ISC_MAGIC_VALID(t, TIMER_MAGIC) struct isc_timer { /*! Not locked. */ unsigned int magic; isc_timermgr_t * manager; isc_mutex_t lock; /*! Locked by timer lock. */ unsigned int references; isc_time_t idle; /*! Locked by manager lock. */ isc_timertype_t type; isc_time_t expires; isc_interval_t interval; isc_task_t * task; isc_taskaction_t action; void * arg; unsigned int index; isc_time_t due; LINK(isc_timer_t) link; }; #define TIMER_MANAGER_MAGIC ISC_MAGIC('T', 'I', 'M', 'M') #define VALID_MANAGER(m) ISC_MAGIC_VALID(m, TIMER_MANAGER_MAGIC) struct isc_timermgr { /* Not locked. */ unsigned int magic; isc_mem_t * mctx; isc_mutex_t lock; /* Locked by manager lock. */ isc_boolean_t done; LIST(isc_timer_t) timers; unsigned int nscheduled; isc_time_t due; #ifdef ISC_PLATFORM_USETHREADS isc_condition_t wakeup; isc_thread_t thread; #else /* ISC_PLATFORM_USETHREADS */ unsigned int refs; #endif /* ISC_PLATFORM_USETHREADS */ isc_heap_t * heap; }; #ifndef ISC_PLATFORM_USETHREADS /*! * If threads are not in use, there can be only one. */ static isc_timermgr_t *timermgr = NULL; #endif /* ISC_PLATFORM_USETHREADS */ static inline isc_result_t schedule(isc_timer_t *timer, isc_time_t *now, isc_boolean_t signal_ok) { isc_result_t result; isc_timermgr_t *manager; isc_time_t due; int cmp; #ifdef ISC_PLATFORM_USETHREADS isc_boolean_t timedwait; #endif /*! * Note: the caller must ensure locking. */ REQUIRE(timer->type != isc_timertype_inactive); #ifndef ISC_PLATFORM_USETHREADS UNUSED(signal_ok); #endif /* ISC_PLATFORM_USETHREADS */ manager = timer->manager; #ifdef ISC_PLATFORM_USETHREADS /*! * If the manager was timed wait, we may need to signal the * manager to force a wakeup. */ timedwait = ISC_TF(manager->nscheduled > 0 && isc_time_seconds(&manager->due) != 0); #endif /* * Compute the new due time. */ if (timer->type != isc_timertype_once) { result = isc_time_add(now, &timer->interval, &due); if (result != ISC_R_SUCCESS) return (result); if (timer->type == isc_timertype_limited && isc_time_compare(&timer->expires, &due) < 0) due = timer->expires; } else { if (isc_time_isepoch(&timer->idle)) due = timer->expires; else if (isc_time_isepoch(&timer->expires)) due = timer->idle; else if (isc_time_compare(&timer->idle, &timer->expires) < 0) due = timer->idle; else due = timer->expires; } /* * Schedule the timer. */ if (timer->index > 0) { /* * Already scheduled. */ cmp = isc_time_compare(&due, &timer->due); timer->due = due; switch (cmp) { case -1: isc_heap_increased(manager->heap, timer->index); break; case 1: isc_heap_decreased(manager->heap, timer->index); break; case 0: /* Nothing to do. */ break; } } else { timer->due = due; result = isc_heap_insert(manager->heap, timer); if (result != ISC_R_SUCCESS) { INSIST(result == ISC_R_NOMEMORY); return (ISC_R_NOMEMORY); } manager->nscheduled++; } XTRACETIMER(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, ISC_MSG_SCHEDULE, "schedule"), timer, due); /* * If this timer is at the head of the queue, we need to ensure * that we won't miss it if it has a more recent due time than * the current "next" timer. We do this either by waking up the * run thread, or explicitly setting the value in the manager. */ #ifdef ISC_PLATFORM_USETHREADS /* * This is a temporary (probably) hack to fix a bug on tru64 5.1 * and 5.1a. Sometimes, pthread_cond_timedwait() doesn't actually * return when the time expires, so here, we check to see if * we're 15 seconds or more behind, and if we are, we signal * the dispatcher. This isn't such a bad idea as a general purpose * watchdog, so perhaps we should just leave it in here. */ if (signal_ok && timedwait) { isc_interval_t fifteen; isc_time_t then; isc_interval_set(&fifteen, 15, 0); result = isc_time_add(&manager->due, &fifteen, &then); if (result == ISC_R_SUCCESS && isc_time_compare(&then, now) < 0) { SIGNAL(&manager->wakeup); signal_ok = ISC_FALSE; isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_TIMER, ISC_LOG_WARNING, "*** POKED TIMER ***"); } } if (timer->index == 1 && signal_ok) { XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, ISC_MSG_SIGNALSCHED, "signal (schedule)")); SIGNAL(&manager->wakeup); } #else /* ISC_PLATFORM_USETHREADS */ if (timer->index == 1 && isc_time_compare(&timer->due, &manager->due) < 0) manager->due = timer->due; #endif /* ISC_PLATFORM_USETHREADS */ return (ISC_R_SUCCESS); } static inline void deschedule(isc_timer_t *timer) { isc_boolean_t need_wakeup = ISC_FALSE; isc_timermgr_t *manager; /* * The caller must ensure locking. */ manager = timer->manager; if (timer->index > 0) { if (timer->index == 1) need_wakeup = ISC_TRUE; isc_heap_delete(manager->heap, timer->index); timer->index = 0; INSIST(manager->nscheduled > 0); manager->nscheduled--; #ifdef ISC_PLATFORM_USETHREADS if (need_wakeup) { XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, ISC_MSG_SIGNALDESCHED, "signal (deschedule)")); SIGNAL(&manager->wakeup); } #endif /* ISC_PLATFORM_USETHREADS */ } } static void destroy(isc_timer_t *timer) { isc_timermgr_t *manager = timer->manager; /* * The caller must ensure it is safe to destroy the timer. */ LOCK(&manager->lock); (void)isc_task_purgerange(timer->task, timer, ISC_TIMEREVENT_FIRSTEVENT, ISC_TIMEREVENT_LASTEVENT, NULL); deschedule(timer); UNLINK(manager->timers, timer, link); UNLOCK(&manager->lock); isc_task_detach(&timer->task); DESTROYLOCK(&timer->lock); timer->magic = 0; isc_mem_put(manager->mctx, timer, sizeof(*timer)); } isc_result_t isc_timer_create(isc_timermgr_t *manager, isc_timertype_t type, isc_time_t *expires, isc_interval_t *interval, isc_task_t *task, isc_taskaction_t action, const void *arg, isc_timer_t **timerp) { isc_timer_t *timer; isc_result_t result; isc_time_t now; /* * Create a new 'type' timer managed by 'manager'. The timers * parameters are specified by 'expires' and 'interval'. Events * will be posted to 'task' and when dispatched 'action' will be * called with 'arg' as the arg value. The new timer is returned * in 'timerp'. */ REQUIRE(VALID_MANAGER(manager)); REQUIRE(task != NULL); REQUIRE(action != NULL); if (expires == NULL) expires = isc_time_epoch; if (interval == NULL) interval = isc_interval_zero; REQUIRE(type == isc_timertype_inactive || !(isc_time_isepoch(expires) && isc_interval_iszero(interval))); REQUIRE(timerp != NULL && *timerp == NULL); REQUIRE(type != isc_timertype_limited || !(isc_time_isepoch(expires) || isc_interval_iszero(interval))); /* * Get current time. */ if (type != isc_timertype_inactive) { TIME_NOW(&now); } else { /* * We don't have to do this, but it keeps the compiler from * complaining about "now" possibly being used without being * set, even though it will never actually happen. */ isc_time_settoepoch(&now); } timer = isc_mem_get(manager->mctx, sizeof(*timer)); if (timer == NULL) return (ISC_R_NOMEMORY); timer->manager = manager; timer->references = 1; if (type == isc_timertype_once && !isc_interval_iszero(interval)) { result = isc_time_add(&now, interval, &timer->idle); if (result != ISC_R_SUCCESS) { isc_mem_put(manager->mctx, timer, sizeof(*timer)); return (result); } } else isc_time_settoepoch(&timer->idle); timer->type = type; timer->expires = *expires; timer->interval = *interval; timer->task = NULL; isc_task_attach(task, &timer->task); timer->action = action; /* * Removing the const attribute from "arg" is the best of two * evils here. If the timer->arg member is made const, then * it affects a great many recipients of the timer event * which did not pass in an "arg" that was truly const. * Changing isc_timer_create() to not have "arg" prototyped as const, * though, can cause compilers warnings for calls that *do* * have a truly const arg. The caller will have to carefully * keep track of whether arg started as a true const. */ DE_CONST(arg, timer->arg); timer->index = 0; result = isc_mutex_init(&timer->lock); if (result != ISC_R_SUCCESS) { isc_task_detach(&timer->task); isc_mem_put(manager->mctx, timer, sizeof(*timer)); return (result); } ISC_LINK_INIT(timer, link); timer->magic = TIMER_MAGIC; LOCK(&manager->lock); /* * Note we don't have to lock the timer like we normally would because * there are no external references to it yet. */ if (type != isc_timertype_inactive) result = schedule(timer, &now, ISC_TRUE); else result = ISC_R_SUCCESS; if (result == ISC_R_SUCCESS) APPEND(manager->timers, timer, link); UNLOCK(&manager->lock); if (result != ISC_R_SUCCESS) { timer->magic = 0; DESTROYLOCK(&timer->lock); isc_task_detach(&timer->task); isc_mem_put(manager->mctx, timer, sizeof(*timer)); return (result); } *timerp = timer; return (ISC_R_SUCCESS); } isc_result_t isc_timer_reset(isc_timer_t *timer, isc_timertype_t type, isc_time_t *expires, isc_interval_t *interval, isc_boolean_t purge) { isc_time_t now; isc_timermgr_t *manager; isc_result_t result; /* * Change the timer's type, expires, and interval values to the given * values. If 'purge' is ISC_TRUE, any pending events from this timer * are purged from its task's event queue. */ REQUIRE(VALID_TIMER(timer)); manager = timer->manager; REQUIRE(VALID_MANAGER(manager)); if (expires == NULL) expires = isc_time_epoch; if (interval == NULL) interval = isc_interval_zero; REQUIRE(type == isc_timertype_inactive || !(isc_time_isepoch(expires) && isc_interval_iszero(interval))); REQUIRE(type != isc_timertype_limited || !(isc_time_isepoch(expires) || isc_interval_iszero(interval))); /* * Get current time. */ if (type != isc_timertype_inactive) { TIME_NOW(&now); } else { /* * We don't have to do this, but it keeps the compiler from * complaining about "now" possibly being used without being * set, even though it will never actually happen. */ isc_time_settoepoch(&now); } manager = timer->manager; LOCK(&manager->lock); LOCK(&timer->lock); if (purge) (void)isc_task_purgerange(timer->task, timer, ISC_TIMEREVENT_FIRSTEVENT, ISC_TIMEREVENT_LASTEVENT, NULL); timer->type = type; timer->expires = *expires; timer->interval = *interval; if (type == isc_timertype_once && !isc_interval_iszero(interval)) { result = isc_time_add(&now, interval, &timer->idle); } else { isc_time_settoepoch(&timer->idle); result = ISC_R_SUCCESS; } if (result == ISC_R_SUCCESS) { if (type == isc_timertype_inactive) { deschedule(timer); result = ISC_R_SUCCESS; } else result = schedule(timer, &now, ISC_TRUE); } UNLOCK(&timer->lock); UNLOCK(&manager->lock); return (result); } isc_timertype_t isc_timer_gettype(isc_timer_t *timer) { isc_timertype_t t; REQUIRE(VALID_TIMER(timer)); LOCK(&timer->lock); t = timer->type; UNLOCK(&timer->lock); return (t); } isc_result_t isc_timer_touch(isc_timer_t *timer) { isc_result_t result; isc_time_t now; /* * Set the last-touched time of 'timer' to the current time. */ REQUIRE(VALID_TIMER(timer)); LOCK(&timer->lock); /* * We'd like to * * REQUIRE(timer->type == isc_timertype_once); * * but we cannot without locking the manager lock too, which we * don't want to do. */ TIME_NOW(&now); result = isc_time_add(&now, &timer->interval, &timer->idle); UNLOCK(&timer->lock); return (result); } void isc_timer_attach(isc_timer_t *timer, isc_timer_t **timerp) { /* * Attach *timerp to timer. */ REQUIRE(VALID_TIMER(timer)); REQUIRE(timerp != NULL && *timerp == NULL); LOCK(&timer->lock); timer->references++; UNLOCK(&timer->lock); *timerp = timer; } void isc_timer_detach(isc_timer_t **timerp) { isc_timer_t *timer; isc_boolean_t free_timer = ISC_FALSE; /* * Detach *timerp from its timer. */ REQUIRE(timerp != NULL); timer = *timerp; REQUIRE(VALID_TIMER(timer)); LOCK(&timer->lock); REQUIRE(timer->references > 0); timer->references--; if (timer->references == 0) free_timer = ISC_TRUE; UNLOCK(&timer->lock); if (free_timer) destroy(timer); *timerp = NULL; } static void dispatch(isc_timermgr_t *manager, isc_time_t *now) { isc_boolean_t done = ISC_FALSE, post_event, need_schedule; isc_timerevent_t *event; isc_eventtype_t type = 0; isc_timer_t *timer; isc_result_t result; isc_boolean_t idle; /*! * The caller must be holding the manager lock. */ while (manager->nscheduled > 0 && !done) { timer = isc_heap_element(manager->heap, 1); INSIST(timer->type != isc_timertype_inactive); if (isc_time_compare(now, &timer->due) >= 0) { if (timer->type == isc_timertype_ticker) { type = ISC_TIMEREVENT_TICK; post_event = ISC_TRUE; need_schedule = ISC_TRUE; } else if (timer->type == isc_timertype_limited) { int cmp; cmp = isc_time_compare(now, &timer->expires); if (cmp >= 0) { type = ISC_TIMEREVENT_LIFE; post_event = ISC_TRUE; need_schedule = ISC_FALSE; } else { type = ISC_TIMEREVENT_TICK; post_event = ISC_TRUE; need_schedule = ISC_TRUE; } } else if (!isc_time_isepoch(&timer->expires) && isc_time_compare(now, &timer->expires) >= 0) { type = ISC_TIMEREVENT_LIFE; post_event = ISC_TRUE; need_schedule = ISC_FALSE; } else { idle = ISC_FALSE; LOCK(&timer->lock); if (!isc_time_isepoch(&timer->idle) && isc_time_compare(now, &timer->idle) >= 0) { idle = ISC_TRUE; } UNLOCK(&timer->lock); if (idle) { type = ISC_TIMEREVENT_IDLE; post_event = ISC_TRUE; need_schedule = ISC_FALSE; } else { /* * Idle timer has been touched; * reschedule. */ XTRACEID(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, ISC_MSG_IDLERESCHED, "idle reschedule"), timer); post_event = ISC_FALSE; need_schedule = ISC_TRUE; } } if (post_event) { XTRACEID(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, ISC_MSG_POSTING, "posting"), timer); /* * XXX We could preallocate this event. */ event = (isc_timerevent_t *)isc_event_allocate(manager->mctx, timer, type, timer->action, timer->arg, sizeof(*event)); if (event != NULL) { event->due = timer->due; isc_task_send(timer->task, ISC_EVENT_PTR(&event)); } else UNEXPECTED_ERROR(__FILE__, __LINE__, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, ISC_MSG_EVENTNOTALLOC, "couldn't " "allocate event")); } timer->index = 0; isc_heap_delete(manager->heap, 1); manager->nscheduled--; if (need_schedule) { result = schedule(timer, now, ISC_FALSE); if (result != ISC_R_SUCCESS) UNEXPECTED_ERROR(__FILE__, __LINE__, "%s: %u", isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, ISC_MSG_SCHEDFAIL, "couldn't schedule " "timer"), result); } } else { manager->due = timer->due; done = ISC_TRUE; } } } #ifdef ISC_PLATFORM_USETHREADS static isc_threadresult_t #ifdef _WIN32 /* XXXDCL */ WINAPI #endif run(void *uap) { isc_timermgr_t *manager = uap; isc_time_t now; isc_result_t result; LOCK(&manager->lock); while (!manager->done) { TIME_NOW(&now); XTRACETIME(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_RUNNING, "running"), now); dispatch(manager, &now); if (manager->nscheduled > 0) { XTRACETIME2(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_WAITUNTIL, "waituntil"), manager->due, now); result = WAITUNTIL(&manager->wakeup, &manager->lock, &manager->due); INSIST(result == ISC_R_SUCCESS || result == ISC_R_TIMEDOUT); } else { XTRACETIME(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_WAIT, "wait"), now); WAIT(&manager->wakeup, &manager->lock); } XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, ISC_MSG_WAKEUP, "wakeup")); } UNLOCK(&manager->lock); return ((isc_threadresult_t)0); } #endif /* ISC_PLATFORM_USETHREADS */ static isc_boolean_t sooner(void *v1, void *v2) { isc_timer_t *t1, *t2; t1 = v1; t2 = v2; REQUIRE(VALID_TIMER(t1)); REQUIRE(VALID_TIMER(t2)); if (isc_time_compare(&t1->due, &t2->due) < 0) return (ISC_TRUE); return (ISC_FALSE); } static void set_index(void *what, unsigned int index) { isc_timer_t *timer; timer = what; REQUIRE(VALID_TIMER(timer)); timer->index = index; } isc_result_t isc_timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp) { isc_timermgr_t *manager; isc_result_t result; /* * Create a timer manager. */ REQUIRE(managerp != NULL && *managerp == NULL); #ifndef ISC_PLATFORM_USETHREADS if (timermgr != NULL) { timermgr->refs++; *managerp = timermgr; return (ISC_R_SUCCESS); } #endif /* ISC_PLATFORM_USETHREADS */ manager = isc_mem_get(mctx, sizeof(*manager)); if (manager == NULL) return (ISC_R_NOMEMORY); manager->magic = TIMER_MANAGER_MAGIC; manager->mctx = NULL; manager->done = ISC_FALSE; INIT_LIST(manager->timers); manager->nscheduled = 0; isc_time_settoepoch(&manager->due); manager->heap = NULL; result = isc_heap_create(mctx, sooner, set_index, 0, &manager->heap); if (result != ISC_R_SUCCESS) { INSIST(result == ISC_R_NOMEMORY); isc_mem_put(mctx, manager, sizeof(*manager)); return (ISC_R_NOMEMORY); } result = isc_mutex_init(&manager->lock); if (result != ISC_R_SUCCESS) { isc_heap_destroy(&manager->heap); isc_mem_put(mctx, manager, sizeof(*manager)); return (result); } isc_mem_attach(mctx, &manager->mctx); #ifdef ISC_PLATFORM_USETHREADS if (isc_condition_init(&manager->wakeup) != ISC_R_SUCCESS) { isc_mem_detach(&manager->mctx); DESTROYLOCK(&manager->lock); isc_heap_destroy(&manager->heap); isc_mem_put(mctx, manager, sizeof(*manager)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_condition_init() %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); return (ISC_R_UNEXPECTED); } if (isc_thread_create(run, manager, &manager->thread) != ISC_R_SUCCESS) { isc_mem_detach(&manager->mctx); (void)isc_condition_destroy(&manager->wakeup); DESTROYLOCK(&manager->lock); isc_heap_destroy(&manager->heap); isc_mem_put(mctx, manager, sizeof(*manager)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_thread_create() %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); return (ISC_R_UNEXPECTED); } #else /* ISC_PLATFORM_USETHREADS */ manager->refs = 1; timermgr = manager; #endif /* ISC_PLATFORM_USETHREADS */ *managerp = manager; return (ISC_R_SUCCESS); } void isc_timermgr_poke(isc_timermgr_t *manager) { #ifdef ISC_PLATFORM_USETHREADS REQUIRE(VALID_MANAGER(manager)); SIGNAL(&manager->wakeup); #else UNUSED(manager); #endif } void isc_timermgr_destroy(isc_timermgr_t **managerp) { isc_timermgr_t *manager; isc_mem_t *mctx; /* * Destroy a timer manager. */ REQUIRE(managerp != NULL); manager = *managerp; REQUIRE(VALID_MANAGER(manager)); LOCK(&manager->lock); #ifndef ISC_PLATFORM_USETHREADS if (manager->refs > 1) { manager->refs--; UNLOCK(&manager->lock); *managerp = NULL; return; } isc__timermgr_dispatch(); #endif /* ISC_PLATFORM_USETHREADS */ REQUIRE(EMPTY(manager->timers)); manager->done = ISC_TRUE; #ifdef ISC_PLATFORM_USETHREADS XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER, ISC_MSG_SIGNALDESTROY, "signal (destroy)")); SIGNAL(&manager->wakeup); #endif /* ISC_PLATFORM_USETHREADS */ UNLOCK(&manager->lock); #ifdef ISC_PLATFORM_USETHREADS /* * Wait for thread to exit. */ if (isc_thread_join(manager->thread, NULL) != ISC_R_SUCCESS) UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_thread_join() %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); #endif /* ISC_PLATFORM_USETHREADS */ /* * Clean up. */ #ifdef ISC_PLATFORM_USETHREADS (void)isc_condition_destroy(&manager->wakeup); #endif /* ISC_PLATFORM_USETHREADS */ DESTROYLOCK(&manager->lock); isc_heap_destroy(&manager->heap); manager->magic = 0; mctx = manager->mctx; isc_mem_put(mctx, manager, sizeof(*manager)); isc_mem_detach(&mctx); *managerp = NULL; } #ifndef ISC_PLATFORM_USETHREADS isc_result_t isc__timermgr_nextevent(isc_time_t *when) { if (timermgr == NULL || timermgr->nscheduled == 0) return (ISC_R_NOTFOUND); *when = timermgr->due; return (ISC_R_SUCCESS); } void isc__timermgr_dispatch(void) { isc_time_t now; if (timermgr == NULL) return; TIME_NOW(&now); dispatch(timermgr, &now); } #endif /* ISC_PLATFORM_USETHREADS */ ntp-4.2.6p5/lib/isc/inet_ntop.c0000644000175000017500000001233011307651603015301 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1996-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /*! \file */ #if defined(LIBC_SCCS) && !defined(lint) static char rcsid[] = "$Id: inet_ntop.c,v 1.19 2007/06/19 23:47:17 tbox Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include #include #include #include #include "ntp_sprintf.h" /* NTP local change, helps SunOS 4 */ #define NS_INT16SZ 2 #define NS_IN6ADDRSZ 16 /* * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. */ static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size); #ifdef AF_INET6 static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size); #endif /*! char * * isc_net_ntop(af, src, dst, size) * convert a network format address to presentation format. * \return * pointer to presentation format address (`dst'), or NULL (see errno). * \author * Paul Vixie, 1996. */ const char * isc_net_ntop(int af, const void *src, char *dst, size_t size) { switch (af) { case AF_INET: return (inet_ntop4(src, dst, size)); #ifdef AF_INET6 case AF_INET6: return (inet_ntop6(src, dst, size)); #endif default: errno = EAFNOSUPPORT; return (NULL); } /* NOTREACHED */ } /*! const char * * inet_ntop4(src, dst, size) * format an IPv4 address * \return * `dst' (as a const) * \note * (1) uses no statics * \note * (2) takes a unsigned char* not an in_addr as input * \author * Paul Vixie, 1996. */ static const char * inet_ntop4(const unsigned char *src, char *dst, size_t size) { static const char *fmt = "%u.%u.%u.%u"; char tmp[sizeof("255.255.255.255")]; /* NTP local change to use SNPRINTF() macro for SunOS4 compat */ if (SNPRINTF((tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3])) >= size) { errno = ENOSPC; return (NULL); } strcpy(dst, tmp); return (dst); } /*! const char * * isc_inet_ntop6(src, dst, size) * convert IPv6 binary address into presentation (printable) format * \author * Paul Vixie, 1996. */ #ifdef AF_INET6 static const char * inet_ntop6(const unsigned char *src, char *dst, size_t size) { /* * Note that int32_t and int16_t need only be "at least" large enough * to contain a value of the specified size. On some systems, like * Crays, there is no such thing as an integer variable with 16 bits. * Keep this in mind if you think this function should have been coded * to use pointer overlays. All the world's not a VAX. */ char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")], *tp; struct { int base, len; } best, cur; unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ]; int i; /* * Preprocess: * Copy the input (bytewise) array into a wordwise array. * Find the longest run of 0x00's in src[] for :: shorthanding. */ memset(words, '\0', sizeof(words)); for (i = 0; i < NS_IN6ADDRSZ; i++) words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); best.base = -1; cur.base = -1; for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { if (words[i] == 0) { if (cur.base == -1) cur.base = i, cur.len = 1; else cur.len++; } else { if (cur.base != -1) { if (best.base == -1 || cur.len > best.len) best = cur; cur.base = -1; } } } if (cur.base != -1) { if (best.base == -1 || cur.len > best.len) best = cur; } if (best.base != -1 && best.len < 2) best.base = -1; /* * Format the result. */ tp = tmp; for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { /* Are we inside the best run of 0x00's? */ if (best.base != -1 && i >= best.base && i < (best.base + best.len)) { if (i == best.base) *tp++ = ':'; continue; } /* Are we following an initial run of 0x00s or any real hex? */ if (i != 0) *tp++ = ':'; /* Is this address an encapsulated IPv4? */ if (i == 6 && best.base == 0 && (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { if (!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp))) return (NULL); tp += strlen(tp); break; } tp += SPRINTF((tp, "%x", words[i])); /* NTP local change */ } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == (NS_IN6ADDRSZ / NS_INT16SZ)) *tp++ = ':'; *tp++ = '\0'; /* * Check for overflow, copy, and we're done. */ if ((size_t)(tp - tmp) > size) { errno = ENOSPC; return (NULL); } strcpy(dst, tmp); return (dst); } #endif /* AF_INET6 */ ntp-4.2.6p5/lib/isc/pthreads/0000755000175000017500000000000011675461367014767 5ustar peterpeterntp-4.2.6p5/lib/isc/pthreads/condition.c0000644000175000017500000000427511307651604017114 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: condition.c,v 1.36 2007/06/19 23:47:18 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include isc_result_t isc_condition_waituntil(isc_condition_t *c, isc_mutex_t *m, isc_time_t *t) { int presult; isc_result_t result; struct timespec ts; char strbuf[ISC_STRERRORSIZE]; REQUIRE(c != NULL && m != NULL && t != NULL); /* * POSIX defines a timespec's tv_sec as time_t. */ result = isc_time_secondsastimet(t, &ts.tv_sec); if (result != ISC_R_SUCCESS) return (result); /*! * POSIX defines a timespec's tv_nsec as long. isc_time_nanoseconds * ensures its return value is < 1 billion, which will fit in a long. */ ts.tv_nsec = (long)isc_time_nanoseconds(t); do { #if ISC_MUTEX_PROFILE presult = pthread_cond_timedwait(c, &m->mutex, &ts); #else presult = pthread_cond_timedwait(c, m, &ts); #endif if (presult == 0) return (ISC_R_SUCCESS); if (presult == ETIMEDOUT) return (ISC_R_TIMEDOUT); } while (presult == EINTR); isc__strerror(presult, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "pthread_cond_timedwait() %s %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_RETURNED, "returned"), strbuf); return (ISC_R_UNEXPECTED); } ntp-4.2.6p5/lib/isc/pthreads/include/0000755000175000017500000000000011307651602016373 5ustar peterpeterntp-4.2.6p5/lib/isc/pthreads/include/isc/0000755000175000017500000000000011675461367017170 5ustar peterpeterntp-4.2.6p5/lib/isc/pthreads/include/isc/mutex.h0000644000175000017500000000773511307651604020502 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: mutex.h,v 1.30 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_MUTEX_H #define ISC_MUTEX_H 1 /*! \file */ #include #include #include #include /* for ISC_R_ codes */ ISC_LANG_BEGINDECLS /*! * Supply mutex attributes that enable deadlock detection * (helpful when debugging). This is system dependent and * currently only supported on NetBSD. */ #if ISC_MUTEX_DEBUG && defined(__NetBSD__) && defined(PTHREAD_MUTEX_ERRORCHECK) extern pthread_mutexattr_t isc__mutex_attrs; #define ISC__MUTEX_ATTRS &isc__mutex_attrs #else #define ISC__MUTEX_ATTRS NULL #endif /* XXX We could do fancier error handling... */ /*! * Define ISC_MUTEX_PROFILE to turn on profiling of mutexes by line. When * enabled, isc_mutex_stats() can be used to print a table showing the * number of times each type of mutex was locked and the amount of time * waiting to obtain the lock. */ #ifndef ISC_MUTEX_PROFILE #define ISC_MUTEX_PROFILE 0 #endif #if ISC_MUTEX_PROFILE typedef struct isc_mutexstats isc_mutexstats_t; typedef struct { pthread_mutex_t mutex; /*%< The actual mutex. */ isc_mutexstats_t * stats; /*%< Mutex statistics. */ } isc_mutex_t; #else typedef pthread_mutex_t isc_mutex_t; #endif #if ISC_MUTEX_PROFILE #define isc_mutex_init(mp) \ isc_mutex_init_profile((mp), __FILE__, __LINE__) #else #if ISC_MUTEX_DEBUG && defined(PTHREAD_MUTEX_ERRORCHECK) #define isc_mutex_init(mp) \ isc_mutex_init_errcheck((mp)) #else #define isc_mutex_init(mp) \ isc__mutex_init((mp), __FILE__, __LINE__) isc_result_t isc__mutex_init(isc_mutex_t *mp, const char *file, unsigned int line); #endif #endif #if ISC_MUTEX_PROFILE #define isc_mutex_lock(mp) \ isc_mutex_lock_profile((mp), __FILE__, __LINE__) #else #define isc_mutex_lock(mp) \ ((pthread_mutex_lock((mp)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) #endif #if ISC_MUTEX_PROFILE #define isc_mutex_unlock(mp) \ isc_mutex_unlock_profile((mp), __FILE__, __LINE__) #else #define isc_mutex_unlock(mp) \ ((pthread_mutex_unlock((mp)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) #endif #if ISC_MUTEX_PROFILE #define isc_mutex_trylock(mp) \ ((pthread_mutex_trylock((&(mp)->mutex)) == 0) ? \ ISC_R_SUCCESS : ISC_R_LOCKBUSY) #else #define isc_mutex_trylock(mp) \ ((pthread_mutex_trylock((mp)) == 0) ? \ ISC_R_SUCCESS : ISC_R_LOCKBUSY) #endif #if ISC_MUTEX_PROFILE #define isc_mutex_destroy(mp) \ ((pthread_mutex_destroy((&(mp)->mutex)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) #else #define isc_mutex_destroy(mp) \ ((pthread_mutex_destroy((mp)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) #endif #if ISC_MUTEX_PROFILE #define isc_mutex_stats(fp) isc_mutex_statsprofile(fp); #else #define isc_mutex_stats(fp) #endif #if ISC_MUTEX_PROFILE isc_result_t isc_mutex_init_profile(isc_mutex_t *mp, const char * _file, int _line); isc_result_t isc_mutex_lock_profile(isc_mutex_t *mp, const char * _file, int _line); isc_result_t isc_mutex_unlock_profile(isc_mutex_t *mp, const char * _file, int _line); void isc_mutex_statsprofile(FILE *fp); isc_result_t isc_mutex_init_errcheck(isc_mutex_t *mp); #endif /* ISC_MUTEX_PROFILE */ ISC_LANG_ENDDECLS #endif /* ISC_MUTEX_H */ ntp-4.2.6p5/lib/isc/pthreads/include/isc/condition.h0000644000175000017500000000373311307651604021320 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: condition.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_CONDITION_H #define ISC_CONDITION_H 1 /*! \file */ #include #include #include #include typedef pthread_cond_t isc_condition_t; #define isc_condition_init(cp) \ ((pthread_cond_init((cp), NULL) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) #if ISC_MUTEX_PROFILE #define isc_condition_wait(cp, mp) \ ((pthread_cond_wait((cp), &((mp)->mutex)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) #else #define isc_condition_wait(cp, mp) \ ((pthread_cond_wait((cp), (mp)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) #endif #define isc_condition_signal(cp) \ ((pthread_cond_signal((cp)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) #define isc_condition_broadcast(cp) \ ((pthread_cond_broadcast((cp)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) #define isc_condition_destroy(cp) \ ((pthread_cond_destroy((cp)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) ISC_LANG_BEGINDECLS isc_result_t isc_condition_waituntil(isc_condition_t *, isc_mutex_t *, isc_time_t *); ISC_LANG_ENDDECLS #endif /* ISC_CONDITION_H */ ntp-4.2.6p5/lib/isc/pthreads/include/isc/thread.h0000644000175000017500000000352611307651603020600 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: thread.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_THREAD_H #define ISC_THREAD_H 1 /*! \file */ #include #include #include ISC_LANG_BEGINDECLS typedef pthread_t isc_thread_t; typedef void * isc_threadresult_t; typedef void * isc_threadarg_t; typedef isc_threadresult_t (*isc_threadfunc_t)(isc_threadarg_t); typedef pthread_key_t isc_thread_key_t; isc_result_t isc_thread_create(isc_threadfunc_t, isc_threadarg_t, isc_thread_t *); void isc_thread_setconcurrency(unsigned int level); /* XXX We could do fancier error handling... */ #define isc_thread_join(t, rp) \ ((pthread_join((t), (rp)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) #define isc_thread_self \ (unsigned long)pthread_self #define isc_thread_key_create pthread_key_create #define isc_thread_key_getspecific pthread_getspecific #define isc_thread_key_setspecific pthread_setspecific #define isc_thread_key_delete pthread_key_delete ISC_LANG_ENDDECLS #endif /* ISC_THREAD_H */ ntp-4.2.6p5/lib/isc/pthreads/include/isc/once.h0000644000175000017500000000274611307651604020261 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: once.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_ONCE_H #define ISC_ONCE_H 1 /*! \file */ #include #include #include typedef pthread_once_t isc_once_t; #ifdef ISC_PLATFORM_BRACEPTHREADONCEINIT /*! * This accomodates systems that define PTHRAD_ONCE_INIT improperly. */ #define ISC_ONCE_INIT { PTHREAD_ONCE_INIT } #else /*! * This is the usual case. */ #define ISC_ONCE_INIT PTHREAD_ONCE_INIT #endif /* XXX We could do fancier error handling... */ #define isc_once_do(op, f) \ ((pthread_once((op), (f)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) #endif /* ISC_ONCE_H */ ntp-4.2.6p5/lib/isc/pthreads/thread.c0000644000175000017500000000411111307651605016363 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: thread.c,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ /*! \file */ #include #include #include #ifndef THREAD_MINSTACKSIZE #define THREAD_MINSTACKSIZE (64U * 1024) #endif isc_result_t isc_thread_create(isc_threadfunc_t func, isc_threadarg_t arg, isc_thread_t *thread) { pthread_attr_t attr; size_t stacksize; int ret; pthread_attr_init(&attr); #if defined(HAVE_PTHREAD_ATTR_GETSTACKSIZE) && \ defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) ret = pthread_attr_getstacksize(&attr, &stacksize); if (ret != 0) return (ISC_R_UNEXPECTED); if (stacksize < THREAD_MINSTACKSIZE) { ret = pthread_attr_setstacksize(&attr, THREAD_MINSTACKSIZE); if (ret != 0) return (ISC_R_UNEXPECTED); } #endif #if defined(PTHREAD_SCOPE_SYSTEM) && defined(NEED_PTHREAD_SCOPE_SYSTEM) ret = pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); if (ret != 0) return (ISC_R_UNEXPECTED); #endif ret = pthread_create(thread, &attr, func, arg); if (ret != 0) return (ISC_R_UNEXPECTED); pthread_attr_destroy(&attr); return (ISC_R_SUCCESS); } void isc_thread_setconcurrency(unsigned int level) { #if defined(CALL_PTHREAD_SETCONCURRENCY) (void)pthread_setconcurrency(level); #else UNUSED(level); #endif } ntp-4.2.6p5/lib/isc/pthreads/mutex.c0000644000175000017500000001734511307651604016272 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: mutex.c,v 1.16 2008/04/04 23:47:01 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include #if ISC_MUTEX_PROFILE /*@{*/ /*% Operations on timevals; adapted from FreeBSD's sys/time.h */ #define timevalclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) #define timevaladd(vvp, uvp) \ do { \ (vvp)->tv_sec += (uvp)->tv_sec; \ (vvp)->tv_usec += (uvp)->tv_usec; \ if ((vvp)->tv_usec >= 1000000) { \ (vvp)->tv_sec++; \ (vvp)->tv_usec -= 1000000; \ } \ } while (0) #define timevalsub(vvp, uvp) \ do { \ (vvp)->tv_sec -= (uvp)->tv_sec; \ (vvp)->tv_usec -= (uvp)->tv_usec; \ if ((vvp)->tv_usec < 0) { \ (vvp)->tv_sec--; \ (vvp)->tv_usec += 1000000; \ } \ } while (0) /*@}*/ #define ISC_MUTEX_MAX_LOCKERS 32 typedef struct { const char * file; int line; unsigned count; struct timeval locked_total; struct timeval wait_total; } isc_mutexlocker_t; struct isc_mutexstats { const char * file; /*%< File mutex was created in. */ int line; /*%< Line mutex was created on. */ unsigned count; struct timeval lock_t; struct timeval locked_total; struct timeval wait_total; isc_mutexlocker_t * cur_locker; isc_mutexlocker_t lockers[ISC_MUTEX_MAX_LOCKERS]; }; #ifndef ISC_MUTEX_PROFTABLESIZE #define ISC_MUTEX_PROFTABLESIZE (16 * 1024) #endif static isc_mutexstats_t stats[ISC_MUTEX_PROFTABLESIZE]; static int stats_next = 0; static isc_boolean_t stats_init = ISC_FALSE; static pthread_mutex_t statslock = PTHREAD_MUTEX_INITIALIZER; isc_result_t isc_mutex_init_profile(isc_mutex_t *mp, const char *file, int line) { int i, err; err = pthread_mutex_init(&mp->mutex, NULL); if (err == ENOMEM) return (ISC_R_NOMEMORY); if (err != 0) return (ISC_R_UNEXPECTED); RUNTIME_CHECK(pthread_mutex_lock(&statslock) == 0); if (stats_init == ISC_FALSE) stats_init = ISC_TRUE; /* * If all statistics entries have been used, give up and trigger an * assertion failure. There would be no other way to deal with this * because we'd like to keep record of all locks for the purpose of * debugging and the number of necessary locks is unpredictable. * If this failure is triggered while debugging, named should be * rebuilt with an increased ISC_MUTEX_PROFTABLESIZE. */ RUNTIME_CHECK(stats_next < ISC_MUTEX_PROFTABLESIZE); mp->stats = &stats[stats_next++]; RUNTIME_CHECK(pthread_mutex_unlock(&statslock) == 0); mp->stats->file = file; mp->stats->line = line; mp->stats->count = 0; timevalclear(&mp->stats->locked_total); timevalclear(&mp->stats->wait_total); for (i = 0; i < ISC_MUTEX_MAX_LOCKERS; i++) { mp->stats->lockers[i].file = NULL; mp->stats->lockers[i].line = 0; mp->stats->lockers[i].count = 0; timevalclear(&mp->stats->lockers[i].locked_total); timevalclear(&mp->stats->lockers[i].wait_total); } return (ISC_R_SUCCESS); } isc_result_t isc_mutex_lock_profile(isc_mutex_t *mp, const char *file, int line) { struct timeval prelock_t; struct timeval postlock_t; isc_mutexlocker_t *locker = NULL; int i; gettimeofday(&prelock_t, NULL); if (pthread_mutex_lock(&mp->mutex) != 0) return (ISC_R_UNEXPECTED); gettimeofday(&postlock_t, NULL); mp->stats->lock_t = postlock_t; timevalsub(&postlock_t, &prelock_t); mp->stats->count++; timevaladd(&mp->stats->wait_total, &postlock_t); for (i = 0; i < ISC_MUTEX_MAX_LOCKERS; i++) { if (mp->stats->lockers[i].file == NULL) { locker = &mp->stats->lockers[i]; locker->file = file; locker->line = line; break; } else if (mp->stats->lockers[i].file == file && mp->stats->lockers[i].line == line) { locker = &mp->stats->lockers[i]; break; } } if (locker != NULL) { locker->count++; timevaladd(&locker->wait_total, &postlock_t); } mp->stats->cur_locker = locker; return (ISC_R_SUCCESS); } isc_result_t isc_mutex_unlock_profile(isc_mutex_t *mp, const char *file, int line) { struct timeval unlock_t; UNUSED(file); UNUSED(line); if (mp->stats->cur_locker != NULL) { gettimeofday(&unlock_t, NULL); timevalsub(&unlock_t, &mp->stats->lock_t); timevaladd(&mp->stats->locked_total, &unlock_t); timevaladd(&mp->stats->cur_locker->locked_total, &unlock_t); mp->stats->cur_locker = NULL; } return ((pthread_mutex_unlock((&mp->mutex)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED); } void isc_mutex_statsprofile(FILE *fp) { isc_mutexlocker_t *locker; int i, j; fprintf(fp, "Mutex stats (in us)\n"); for (i = 0; i < stats_next; i++) { fprintf(fp, "%-12s %4d: %10u %lu.%06lu %lu.%06lu\n", stats[i].file, stats[i].line, stats[i].count, stats[i].locked_total.tv_sec, stats[i].locked_total.tv_usec, stats[i].wait_total.tv_sec, stats[i].wait_total.tv_usec ); for (j = 0; j < ISC_MUTEX_MAX_LOCKERS; j++) { locker = &stats[i].lockers[j]; if (locker->file == NULL) continue; fprintf(fp, " %-11s %4d: %10u %lu.%06lu %lu.%06lu\n", locker->file, locker->line, locker->count, locker->locked_total.tv_sec, locker->locked_total.tv_usec, locker->wait_total.tv_sec, locker->wait_total.tv_usec ); } } } #endif /* ISC_MUTEX_PROFILE */ #if ISC_MUTEX_DEBUG && defined(PTHREAD_MUTEX_ERRORCHECK) isc_result_t isc_mutex_init_errcheck(isc_mutex_t *mp) { pthread_mutexattr_t attr; int err; if (pthread_mutexattr_init(&attr) != 0) return (ISC_R_UNEXPECTED); if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK) != 0) return (ISC_R_UNEXPECTED); err = pthread_mutex_init(mp, &attr) != 0) if (err == ENOMEM) return (ISC_R_NOMEMORY); return ((err == 0) ? ISC_R_SUCCESS : ISC_R_UNEXPECTED); } #endif #if ISC_MUTEX_DEBUG && defined(__NetBSD__) && defined(PTHREAD_MUTEX_ERRORCHECK) pthread_mutexattr_t isc__mutex_attrs = { PTHREAD_MUTEX_ERRORCHECK, /* m_type */ 0 /* m_flags, which appears to be unused. */ }; #endif #if !(ISC_MUTEX_DEBUG && defined(PTHREAD_MUTEX_ERRORCHECK)) && !ISC_MUTEX_PROFILE isc_result_t isc__mutex_init(isc_mutex_t *mp, const char *file, unsigned int line) { char strbuf[ISC_STRERRORSIZE]; isc_result_t result = ISC_R_SUCCESS; int err; err = pthread_mutex_init(mp, ISC__MUTEX_ATTRS); if (err == ENOMEM) return (ISC_R_NOMEMORY); if (err != 0) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(file, line, "isc_mutex_init() failed: %s", strbuf); result = ISC_R_UNEXPECTED; } return (result); } #endif ntp-4.2.6p5/lib/isc/stats.c0000644000175000017500000002046611307651604014452 0ustar peterpeter/* * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: stats.c,v 1.3.6.2 2009/01/29 23:47:44 tbox Exp $ */ /*! \file */ #include #include #include #include #include #include #include #include #include #include #include #define ISC_STATS_MAGIC ISC_MAGIC('S', 't', 'a', 't') #define ISC_STATS_VALID(x) ISC_MAGIC_VALID(x, ISC_STATS_MAGIC) #ifndef ISC_STATS_USEMULTIFIELDS #if defined(ISC_RWLOCK_USEATOMIC) && defined(ISC_PLATFORM_HAVEXADD) && !defined(ISC_PLATFORM_HAVEXADDQ) #define ISC_STATS_USEMULTIFIELDS 1 #else #define ISC_STATS_USEMULTIFIELDS 0 #endif #endif /* ISC_STATS_USEMULTIFIELDS */ #if ISC_STATS_USEMULTIFIELDS typedef struct { isc_uint32_t hi; isc_uint32_t lo; } isc_stat_t; #else typedef isc_uint64_t isc_stat_t; #endif struct isc_stats { /*% Unlocked */ unsigned int magic; isc_mem_t *mctx; int ncounters; isc_mutex_t lock; unsigned int references; /* locked by lock */ /*% * Locked by counterlock or unlocked if efficient rwlock is not * available. */ #ifdef ISC_RWLOCK_USEATOMIC isc_rwlock_t counterlock; #endif isc_stat_t *counters; /*% * We don't want to lock the counters while we are dumping, so we first * copy the current counter values into a local array. This buffer * will be used as the copy destination. It's allocated on creation * of the stats structure so that the dump operation won't fail due * to memory allocation failure. * XXX: this approach is weird for non-threaded build because the * additional memory and the copy overhead could be avoided. We prefer * simplicity here, however, under the assumption that this function * should be only rarely called. */ isc_uint64_t *copiedcounters; }; static isc_result_t create_stats(isc_mem_t *mctx, int ncounters, isc_stats_t **statsp) { isc_stats_t *stats; isc_result_t result = ISC_R_SUCCESS; REQUIRE(statsp != NULL && *statsp == NULL); stats = isc_mem_get(mctx, sizeof(*stats)); if (stats == NULL) return (ISC_R_NOMEMORY); result = isc_mutex_init(&stats->lock); if (result != ISC_R_SUCCESS) goto clean_stats; stats->counters = isc_mem_get(mctx, sizeof(isc_stat_t) * ncounters); if (stats->counters == NULL) { result = ISC_R_NOMEMORY; goto clean_mutex; } stats->copiedcounters = isc_mem_get(mctx, sizeof(isc_uint64_t) * ncounters); if (stats->copiedcounters == NULL) { result = ISC_R_NOMEMORY; goto clean_counters; } #ifdef ISC_RWLOCK_USEATOMIC result = isc_rwlock_init(&stats->counterlock, 0, 0); if (result != ISC_R_SUCCESS) goto clean_copiedcounters; #endif stats->references = 1; memset(stats->counters, 0, sizeof(isc_stat_t) * ncounters); stats->mctx = NULL; isc_mem_attach(mctx, &stats->mctx); stats->ncounters = ncounters; stats->magic = ISC_STATS_MAGIC; *statsp = stats; return (result); clean_counters: isc_mem_put(mctx, stats->counters, sizeof(isc_stat_t) * ncounters); #ifdef ISC_RWLOCK_USEATOMIC clean_copiedcounters: isc_mem_put(mctx, stats->copiedcounters, sizeof(isc_stat_t) * ncounters); #endif clean_mutex: DESTROYLOCK(&stats->lock); clean_stats: isc_mem_put(mctx, stats, sizeof(*stats)); return (result); } void isc_stats_attach(isc_stats_t *stats, isc_stats_t **statsp) { REQUIRE(ISC_STATS_VALID(stats)); REQUIRE(statsp != NULL && *statsp == NULL); LOCK(&stats->lock); stats->references++; UNLOCK(&stats->lock); *statsp = stats; } void isc_stats_detach(isc_stats_t **statsp) { isc_stats_t *stats; REQUIRE(statsp != NULL && ISC_STATS_VALID(*statsp)); stats = *statsp; *statsp = NULL; LOCK(&stats->lock); stats->references--; UNLOCK(&stats->lock); if (stats->references == 0) { isc_mem_put(stats->mctx, stats->copiedcounters, sizeof(isc_stat_t) * stats->ncounters); isc_mem_put(stats->mctx, stats->counters, sizeof(isc_stat_t) * stats->ncounters); DESTROYLOCK(&stats->lock); #ifdef ISC_RWLOCK_USEATOMIC isc_rwlock_destroy(&stats->counterlock); #endif isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats)); } } int isc_stats_ncounters(isc_stats_t *stats) { REQUIRE(ISC_STATS_VALID(stats)); return (stats->ncounters); } static inline void incrementcounter(isc_stats_t *stats, int counter) { isc_int32_t prev; #ifdef ISC_RWLOCK_USEATOMIC /* * We use a "read" lock to prevent other threads from reading the * counter while we "writing" a counter field. The write access itself * is protected by the atomic operation. */ isc_rwlock_lock(&stats->counterlock, isc_rwlocktype_read); #endif #if ISC_STATS_USEMULTIFIELDS prev = isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].lo, 1); /* * If the lower 32-bit field overflows, increment the higher field. * Note that it's *theoretically* possible that the lower field * overlaps again before the higher field is incremented. It doesn't * matter, however, because we don't read the value until * isc_stats_copy() is called where the whole process is protected * by the write (exclusive) lock. */ if (prev == (isc_int32_t)0xffffffff) isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].hi, 1); #elif defined(ISC_PLATFORM_HAVEXADDQ) UNUSED(prev); isc_atomic_xaddq((isc_int64_t *)&stats->counters[counter], 1); #else UNUSED(prev); stats->counters[counter]++; #endif #ifdef ISC_RWLOCK_USEATOMIC isc_rwlock_unlock(&stats->counterlock, isc_rwlocktype_read); #endif } static inline void decrementcounter(isc_stats_t *stats, int counter) { isc_int32_t prev; #ifdef ISC_RWLOCK_USEATOMIC isc_rwlock_lock(&stats->counterlock, isc_rwlocktype_read); #endif #if ISC_STATS_USEMULTIFIELDS prev = isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].lo, -1); if (prev == 0) isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].hi, -1); #elif defined(ISC_PLATFORM_HAVEXADDQ) UNUSED(prev); isc_atomic_xaddq((isc_int64_t *)&stats->counters[counter], -1); #else UNUSED(prev); stats->counters[counter]--; #endif #ifdef ISC_RWLOCK_USEATOMIC isc_rwlock_unlock(&stats->counterlock, isc_rwlocktype_read); #endif } static void copy_counters(isc_stats_t *stats) { int i; #ifdef ISC_RWLOCK_USEATOMIC /* * We use a "write" lock before "reading" the statistics counters as * an exclusive lock. */ isc_rwlock_lock(&stats->counterlock, isc_rwlocktype_write); #endif #if ISC_STATS_USEMULTIFIELDS for (i = 0; i < stats->ncounters; i++) { stats->copiedcounters[i] = (isc_uint64_t)(stats->counters[i].hi) << 32 | stats->counters[i].lo; } #else UNUSED(i); memcpy(stats->copiedcounters, stats->counters, stats->ncounters * sizeof(isc_stat_t)); #endif #ifdef ISC_RWLOCK_USEATOMIC isc_rwlock_unlock(&stats->counterlock, isc_rwlocktype_write); #endif } isc_result_t isc_stats_create(isc_mem_t *mctx, isc_stats_t **statsp, int ncounters) { REQUIRE(statsp != NULL && *statsp == NULL); return (create_stats(mctx, ncounters, statsp)); } void isc_stats_increment(isc_stats_t *stats, isc_statscounter_t counter) { REQUIRE(ISC_STATS_VALID(stats)); REQUIRE(counter < stats->ncounters); incrementcounter(stats, (int)counter); } void isc_stats_decrement(isc_stats_t *stats, isc_statscounter_t counter) { REQUIRE(ISC_STATS_VALID(stats)); REQUIRE(counter < stats->ncounters); decrementcounter(stats, (int)counter); } void isc_stats_dump(isc_stats_t *stats, isc_stats_dumper_t dump_fn, void *arg, unsigned int options) { int i; REQUIRE(ISC_STATS_VALID(stats)); copy_counters(stats); for (i = 0; i < stats->ncounters; i++) { if ((options & ISC_STATSDUMP_VERBOSE) == 0 && stats->copiedcounters[i] == 0) continue; dump_fn((isc_statscounter_t)i, stats->copiedcounters[i], arg); } } ntp-4.2.6p5/lib/isc/powerpc/0000755000175000017500000000000011307651602014615 5ustar peterpeterntp-4.2.6p5/lib/isc/powerpc/include/0000755000175000017500000000000011307651602016240 5ustar peterpeterntp-4.2.6p5/lib/isc/powerpc/include/isc/0000755000175000017500000000000011675461367017035 5ustar peterpeterntp-4.2.6p5/lib/isc/powerpc/include/isc/atomic.h0000644000175000017500000000666611307651603020462 0ustar peterpeter/* * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: atomic.h,v 1.6 2007/06/18 23:47:47 tbox Exp $ */ #ifndef ISC_ATOMIC_H #define ISC_ATOMIC_H 1 #include #include /*!\file * static inline isc_int32_t * isc_atomic_xadd(isc_int32_t *p, isc_int32_t val); * * This routine atomically increments the value stored in 'p' by 'val', and * returns the previous value. * * static inline void * isc_atomic_store(void *p, isc_int32_t val); * * This routine atomically stores the value 'val' in 'p'. * * static inline isc_int32_t * isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val); * * This routine atomically replaces the value in 'p' with 'val', if the * original value is equal to 'cmpval'. The original value is returned in any * case. */ #if defined(_AIX) #include #define isc_atomic_xadd(p, v) fetch_and_add(p, v) #define isc_atomic_store(p, v) _clear_lock(p, v) #ifdef __GNUC__ static inline int #else static int #endif isc_atomic_cmpxchg(atomic_p p, int old, int new) { int orig = old; #ifdef __GNUC__ asm("ics"); #else __isync(); #endif if (compare_and_swap(p, &orig, new)) return (old); return (orig); } #elif defined(ISC_PLATFORM_USEGCCASM) || defined(ISC_PLATFORM_USEMACASM) static inline isc_int32_t isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { isc_int32_t orig; __asm__ volatile ( #ifdef ISC_PLATFORM_USEMACASM "1:" "lwarx r6, 0, %1\n" "mr %0, r6\n" "add r6, r6, %2\n" "stwcx. r6, 0, %1\n" "bne- 1b" #else "1:" "lwarx 6, 0, %1\n" "mr %0, 6\n" "add 6, 6, %2\n" "stwcx. 6, 0, %1\n" "bne- 1b" #endif : "=&r"(orig) : "r"(p), "r"(val) : "r6", "memory" ); return (orig); } static inline void isc_atomic_store(void *p, isc_int32_t val) { __asm__ volatile ( #ifdef ISC_PLATFORM_USEMACASM "1:" "lwarx r6, 0, %0\n" "lwz r6, %1\n" "stwcx. r6, 0, %0\n" "bne- 1b" #else "1:" "lwarx 6, 0, %0\n" "lwz 6, %1\n" "stwcx. 6, 0, %0\n" "bne- 1b" #endif : : "r"(p), "m"(val) : "r6", "memory" ); } static inline isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { isc_int32_t orig; __asm__ volatile ( #ifdef ISC_PLATFORM_USEMACASM "1:" "lwarx r6, 0, %1\n" "mr %0,r6\n" "cmpw r6, %2\n" "bne 2f\n" "mr r6, %3\n" "stwcx. r6, 0, %1\n" "bne- 1b\n" "2:" #else "1:" "lwarx 6, 0, %1\n" "mr %0,6\n" "cmpw 6, %2\n" "bne 2f\n" "mr 6, %3\n" "stwcx. 6, 0, %1\n" "bne- 1b\n" "2:" #endif : "=&r" (orig) : "r"(p), "r"(cmpval), "r"(val) : "r6", "memory" ); return (orig); } #else #error "unsupported compiler. disable atomic ops by --disable-atomic" #endif #endif /* ISC_ATOMIC_H */ ntp-4.2.6p5/lib/isc/radix.c0000644000175000017500000004150111307651603014413 0ustar peterpeter/* * Copyright (C) 2007-2009 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: radix.c,v 1.20.36.3 2009/01/18 23:47:41 tbox Exp $ */ /* * This source was adapted from MRT's RCS Ids: * Id: radix.c,v 1.10.2.1 1999/11/29 05:16:24 masaki Exp * Id: prefix.c,v 1.37.2.9 2000/03/10 02:53:19 labovit Exp */ #include #include #include #include #include static isc_result_t _new_prefix(isc_mem_t *mctx, isc_prefix_t **target, int family, void *dest, int bitlen); static void _deref_prefix(isc_mem_t *mctx, isc_prefix_t *prefix); static isc_result_t _ref_prefix(isc_mem_t *mctx, isc_prefix_t **target, isc_prefix_t *prefix); static int _comp_with_mask(void *addr, void *dest, u_int mask); static void _clear_radix(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func); static isc_result_t _new_prefix(isc_mem_t *mctx, isc_prefix_t **target, int family, void *dest, int bitlen) { isc_prefix_t *prefix; REQUIRE(target != NULL); if (family != AF_INET6 && family != AF_INET && family != AF_UNSPEC) return (ISC_R_NOTIMPLEMENTED); prefix = isc_mem_get(mctx, sizeof(isc_prefix_t)); if (prefix == NULL) return (ISC_R_NOMEMORY); if (family == AF_INET6) { prefix->bitlen = (bitlen >= 0) ? bitlen : 128; memcpy(&prefix->add.sin6, dest, 16); } else { /* AF_UNSPEC is "any" or "none"--treat it as AF_INET */ prefix->bitlen = (bitlen >= 0) ? bitlen : 32; memcpy(&prefix->add.sin, dest, 4); } prefix->family = family; isc_refcount_init(&prefix->refcount, 1); *target = prefix; return (ISC_R_SUCCESS); } static void _deref_prefix(isc_mem_t *mctx, isc_prefix_t *prefix) { int refs; if (prefix == NULL) return; isc_refcount_decrement(&prefix->refcount, &refs); if (refs <= 0) { isc_refcount_destroy(&prefix->refcount); isc_mem_put(mctx, prefix, sizeof(isc_prefix_t)); } } static isc_result_t _ref_prefix(isc_mem_t *mctx, isc_prefix_t **target, isc_prefix_t *prefix) { INSIST(prefix != NULL); INSIST((prefix->family == AF_INET && prefix->bitlen <= 32) || (prefix->family == AF_INET6 && prefix->bitlen <= 128) || (prefix->family == AF_UNSPEC && prefix->bitlen == 0)); REQUIRE(target != NULL && *target == NULL); /* * If this prefix is a static allocation, copy it into new memory. * (Note, the refcount still has to be destroyed by the calling * routine.) */ if (isc_refcount_current(&prefix->refcount) == 0) { isc_result_t ret; ret = _new_prefix(mctx, target, prefix->family, &prefix->add, prefix->bitlen); return ret; } isc_refcount_increment(&prefix->refcount, NULL); *target = prefix; return (ISC_R_SUCCESS); } static int _comp_with_mask(void *addr, void *dest, u_int mask) { /* Mask length of zero matches everything */ if (mask == 0) return (1); if (memcmp(addr, dest, mask / 8) == 0) { int n = mask / 8; int m = ((~0) << (8 - (mask % 8))); if ((mask % 8) == 0 || (((u_char *)addr)[n] & m) == (((u_char *)dest)[n] & m)) return (1); } return (0); } isc_result_t isc_radix_create(isc_mem_t *mctx, isc_radix_tree_t **target, int maxbits) { isc_radix_tree_t *radix; REQUIRE(target != NULL && *target == NULL); radix = isc_mem_get(mctx, sizeof(isc_radix_tree_t)); if (radix == NULL) return (ISC_R_NOMEMORY); radix->mctx = mctx; radix->maxbits = maxbits; radix->head = NULL; radix->num_active_node = 0; radix->num_added_node = 0; RUNTIME_CHECK(maxbits <= RADIX_MAXBITS); /* XXX */ radix->magic = RADIX_TREE_MAGIC; *target = radix; return (ISC_R_SUCCESS); } /* * if func is supplied, it will be called as func(node->data) * before deleting the node */ static void _clear_radix(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func) { REQUIRE(radix != NULL); if (radix->head != NULL) { isc_radix_node_t *Xstack[RADIX_MAXBITS+1]; isc_radix_node_t **Xsp = Xstack; isc_radix_node_t *Xrn = radix->head; while (Xrn != NULL) { isc_radix_node_t *l = Xrn->l; isc_radix_node_t *r = Xrn->r; if (Xrn->prefix != NULL) { _deref_prefix(radix->mctx, Xrn->prefix); if (func != NULL && (Xrn->data[0] != NULL || Xrn->data[1] != NULL)) func(Xrn->data); } else { INSIST(Xrn->data[0] == NULL && Xrn->data[1] == NULL); } isc_mem_put(radix->mctx, Xrn, sizeof(*Xrn)); radix->num_active_node--; if (l != NULL) { if (r != NULL) { *Xsp++ = r; } Xrn = l; } else if (r != NULL) { Xrn = r; } else if (Xsp != Xstack) { Xrn = *(--Xsp); } else { Xrn = NULL; } } } RUNTIME_CHECK(radix->num_active_node == 0); } void isc_radix_destroy(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func) { REQUIRE(radix != NULL); _clear_radix(radix, func); isc_mem_put(radix->mctx, radix, sizeof(*radix)); } /* * func will be called as func(node->prefix, node->data) */ void isc_radix_process(isc_radix_tree_t *radix, isc_radix_processfunc_t func) { isc_radix_node_t *node; REQUIRE(func != NULL); RADIX_WALK(radix->head, node) { func(node->prefix, node->data); } RADIX_WALK_END; } isc_result_t isc_radix_search(isc_radix_tree_t *radix, isc_radix_node_t **target, isc_prefix_t *prefix) { isc_radix_node_t *node; isc_radix_node_t *stack[RADIX_MAXBITS + 1]; u_char *addr; isc_uint32_t bitlen; int tfamily = -1; int cnt = 0; REQUIRE(radix != NULL); REQUIRE(prefix != NULL); REQUIRE(target != NULL && *target == NULL); RUNTIME_CHECK(prefix->bitlen <= radix->maxbits); *target = NULL; if (radix->head == NULL) { return (ISC_R_NOTFOUND); } node = radix->head; addr = isc_prefix_touchar(prefix); bitlen = prefix->bitlen; while (node->bit < bitlen) { if (node->prefix) stack[cnt++] = node; if (BIT_TEST(addr[node->bit >> 3], 0x80 >> (node->bit & 0x07))) node = node->r; else node = node->l; if (node == NULL) break; } if (node && node->prefix) stack[cnt++] = node; while (--cnt >= 0) { node = stack[cnt]; if (_comp_with_mask(isc_prefix_tochar(node->prefix), isc_prefix_tochar(prefix), node->prefix->bitlen)) { if (node->node_num[ISC_IS6(prefix->family)] != -1 && ((*target == NULL) || (*target)->node_num[ISC_IS6(tfamily)] > node->node_num[ISC_IS6(prefix->family)])) { *target = node; tfamily = prefix->family; } } } if (*target == NULL) { return (ISC_R_NOTFOUND); } else { return (ISC_R_SUCCESS); } } isc_result_t isc_radix_insert(isc_radix_tree_t *radix, isc_radix_node_t **target, isc_radix_node_t *source, isc_prefix_t *prefix) { isc_radix_node_t *node, *new_node, *parent, *glue = NULL; u_char *addr, *test_addr; isc_uint32_t bitlen, fam, check_bit, differ_bit; isc_uint32_t i, j, r; isc_result_t result; REQUIRE(radix != NULL); REQUIRE(target != NULL && *target == NULL); REQUIRE(prefix != NULL || (source != NULL && source->prefix != NULL)); RUNTIME_CHECK(prefix == NULL || prefix->bitlen <= radix->maxbits); if (prefix == NULL) prefix = source->prefix; INSIST(prefix != NULL); bitlen = prefix->bitlen; fam = prefix->family; if (radix->head == NULL) { node = isc_mem_get(radix->mctx, sizeof(isc_radix_node_t)); if (node == NULL) return (ISC_R_NOMEMORY); node->bit = bitlen; node->node_num[0] = node->node_num[1] = -1; node->prefix = NULL; result = _ref_prefix(radix->mctx, &node->prefix, prefix); if (result != ISC_R_SUCCESS) { isc_mem_put(radix->mctx, node, sizeof(isc_radix_node_t)); return (result); } node->parent = NULL; node->l = node->r = NULL; if (source != NULL) { /* * If source is non-NULL, then we're merging in a * node from an existing radix tree. To keep * the node_num values consistent, the calling * function will add the total number of nodes * added to num_added_node at the end of * the merge operation--we don't do it here. */ if (source->node_num[0] != -1) node->node_num[0] = radix->num_added_node + source->node_num[0]; if (source->node_num[1] != -1) node->node_num[1] = radix->num_added_node + source->node_num[1]; node->data[0] = source->data[0]; node->data[1] = source->data[1]; } else { if (fam == AF_UNSPEC) { /* "any" or "none" */ node->node_num[0] = node->node_num[1] = ++radix->num_added_node; } else { node->node_num[ISC_IS6(fam)] = ++radix->num_added_node; } node->data[0] = NULL; node->data[1] = NULL; } radix->head = node; radix->num_active_node++; *target = node; return (ISC_R_SUCCESS); } addr = isc_prefix_touchar(prefix); node = radix->head; while (node->bit < bitlen || node->prefix == NULL) { if (node->bit < radix->maxbits && BIT_TEST(addr[node->bit >> 3], 0x80 >> (node->bit & 0x07))) { if (node->r == NULL) break; node = node->r; } else { if (node->l == NULL) break; node = node->l; } INSIST(node != NULL); } INSIST(node->prefix != NULL); test_addr = isc_prefix_touchar(node->prefix); /* Find the first bit different. */ check_bit = (node->bit < bitlen) ? node->bit : bitlen; differ_bit = 0; for (i = 0; i*8 < check_bit; i++) { if ((r = (addr[i] ^ test_addr[i])) == 0) { differ_bit = (i + 1) * 8; continue; } /* I know the better way, but for now. */ for (j = 0; j < 8; j++) { if (BIT_TEST (r, (0x80 >> j))) break; } /* Must be found. */ INSIST(j < 8); differ_bit = i * 8 + j; break; } if (differ_bit > check_bit) differ_bit = check_bit; parent = node->parent; while (parent != NULL && parent->bit >= differ_bit) { node = parent; parent = node->parent; } if (differ_bit == bitlen && node->bit == bitlen) { if (node->prefix != NULL) { /* Set node_num only if it hasn't been set before */ if (source != NULL) { /* Merging node */ if (node->node_num[0] == -1 && source->node_num[0] != -1) { node->node_num[0] = radix->num_added_node + source->node_num[0]; node->data[0] = source->data[0]; } if (node->node_num[1] == -1 && source->node_num[0] != -1) { node->node_num[1] = radix->num_added_node + source->node_num[1]; node->data[1] = source->data[1]; } } else { if (fam == AF_UNSPEC) { /* "any" or "none" */ int next = radix->num_added_node + 1; if (node->node_num[0] == -1) { node->node_num[0] = next; radix->num_added_node = next; } if (node->node_num[1] == -1) { node->node_num[1] = next; radix->num_added_node = next; } } else { if (node->node_num[ISC_IS6(fam)] == -1) node->node_num[ISC_IS6(fam)] = ++radix->num_added_node; } } *target = node; return (ISC_R_SUCCESS); } else { result = _ref_prefix(radix->mctx, &node->prefix, prefix); if (result != ISC_R_SUCCESS) return (result); } INSIST(node->data[0] == NULL && node->node_num[0] == -1 && node->data[1] == NULL && node->node_num[1] == -1); if (source != NULL) { /* Merging node */ if (source->node_num[0] != -1) { node->node_num[0] = radix->num_added_node + source->node_num[0]; node->data[0] = source->data[0]; } if (source->node_num[1] != -1) { node->node_num[1] = radix->num_added_node + source->node_num[1]; node->data[1] = source->data[1]; } } else { if (fam == AF_UNSPEC) { /* "any" or "none" */ node->node_num[0] = node->node_num[1] = ++radix->num_added_node; } else { node->node_num[ISC_IS6(fam)] = ++radix->num_added_node; } } *target = node; return (ISC_R_SUCCESS); } new_node = isc_mem_get(radix->mctx, sizeof(isc_radix_node_t)); if (new_node == NULL) return (ISC_R_NOMEMORY); if (node->bit != differ_bit && bitlen != differ_bit) { glue = isc_mem_get(radix->mctx, sizeof(isc_radix_node_t)); if (glue == NULL) { isc_mem_put(radix->mctx, new_node, sizeof(isc_radix_node_t)); return (ISC_R_NOMEMORY); } } new_node->bit = bitlen; new_node->prefix = NULL; result = _ref_prefix(radix->mctx, &new_node->prefix, prefix); if (result != ISC_R_SUCCESS) { isc_mem_put(radix->mctx, new_node, sizeof(isc_radix_node_t)); if (glue != NULL) isc_mem_put(radix->mctx, glue, sizeof(isc_radix_node_t)); return (result); } new_node->parent = NULL; new_node->l = new_node->r = NULL; new_node->node_num[0] = new_node->node_num[1] = -1; radix->num_active_node++; if (source != NULL) { /* Merging node */ if (source->node_num[0] != -1) new_node->node_num[0] = radix->num_added_node + source->node_num[0]; if (source->node_num[1] != -1) new_node->node_num[1] = radix->num_added_node + source->node_num[1]; new_node->data[0] = source->data[0]; new_node->data[1] = source->data[1]; } else { if (fam == AF_UNSPEC) { /* "any" or "none" */ new_node->node_num[0] = new_node->node_num[1] = ++radix->num_added_node; } else { new_node->node_num[ISC_IS6(fam)] = ++radix->num_added_node; } new_node->data[0] = NULL; new_node->data[1] = NULL; } if (node->bit == differ_bit) { INSIST(glue == NULL); new_node->parent = node; if (node->bit < radix->maxbits && BIT_TEST(addr[node->bit >> 3], 0x80 >> (node->bit & 0x07))) { INSIST(node->r == NULL); node->r = new_node; } else { INSIST(node->l == NULL); node->l = new_node; } *target = new_node; return (ISC_R_SUCCESS); } if (bitlen == differ_bit) { INSIST(glue == NULL); if (bitlen < radix->maxbits && BIT_TEST(test_addr[bitlen >> 3], 0x80 >> (bitlen & 0x07))) { new_node->r = node; } else { new_node->l = node; } new_node->parent = node->parent; if (node->parent == NULL) { INSIST(radix->head == node); radix->head = new_node; } else if (node->parent->r == node) { node->parent->r = new_node; } else { node->parent->l = new_node; } node->parent = new_node; } else { INSIST(glue != NULL); glue->bit = differ_bit; glue->prefix = NULL; glue->parent = node->parent; glue->data[0] = glue->data[1] = NULL; glue->node_num[0] = glue->node_num[1] = -1; radix->num_active_node++; if (differ_bit < radix->maxbits && BIT_TEST(addr[differ_bit>>3], 0x80 >> (differ_bit & 07))) { glue->r = new_node; glue->l = node; } else { glue->r = node; glue->l = new_node; } new_node->parent = glue; if (node->parent == NULL) { INSIST(radix->head == node); radix->head = glue; } else if (node->parent->r == node) { node->parent->r = glue; } else { node->parent->l = glue; } node->parent = glue; } *target = new_node; return (ISC_R_SUCCESS); } void isc_radix_remove(isc_radix_tree_t *radix, isc_radix_node_t *node) { isc_radix_node_t *parent, *child; REQUIRE(radix != NULL); REQUIRE(node != NULL); if (node->r && node->l) { /* * This might be a placeholder node -- have to check and * make sure there is a prefix associated with it! */ if (node->prefix != NULL) _deref_prefix(radix->mctx, node->prefix); node->prefix = NULL; node->data[0] = node->data[1] = NULL; return; } if (node->r == NULL && node->l == NULL) { parent = node->parent; _deref_prefix(radix->mctx, node->prefix); isc_mem_put(radix->mctx, node, sizeof(*node)); radix->num_active_node--; if (parent == NULL) { INSIST(radix->head == node); radix->head = NULL; return; } if (parent->r == node) { parent->r = NULL; child = parent->l; } else { INSIST(parent->l == node); parent->l = NULL; child = parent->r; } if (parent->prefix) return; /* We need to remove parent too. */ if (parent->parent == NULL) { INSIST(radix->head == parent); radix->head = child; } else if (parent->parent->r == parent) { parent->parent->r = child; } else { INSIST(parent->parent->l == parent); parent->parent->l = child; } child->parent = parent->parent; isc_mem_put(radix->mctx, parent, sizeof(*parent)); radix->num_active_node--; return; } if (node->r) { child = node->r; } else { INSIST(node->l != NULL); child = node->l; } parent = node->parent; child->parent = parent; _deref_prefix(radix->mctx, node->prefix); isc_mem_put(radix->mctx, node, sizeof(*node)); radix->num_active_node--; if (parent == NULL) { INSIST(radix->head == node); radix->head = child; return; } if (parent->r == node) { parent->r = child; } else { INSIST(parent->l == node); parent->l = child; } } /* Local Variables: c-basic-offset: 4 indent-tabs-mode: t End: */ ntp-4.2.6p5/lib/isc/win32/0000755000175000017500000000000011675461367014117 5ustar peterpeterntp-4.2.6p5/lib/isc/win32/app.c0000644000175000017500000001266311307651603015035 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: app.c,v 1.7 2007/06/19 23:47:19 tbox Exp $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static isc_eventlist_t on_run; static isc_mutex_t lock; static isc_boolean_t shutdown_requested = ISC_FALSE; static isc_boolean_t running = ISC_FALSE; /* * We assume that 'want_shutdown' can be read and written atomically. */ static isc_boolean_t want_shutdown = ISC_FALSE; /* * We assume that 'want_reload' can be read and written atomically. */ static isc_boolean_t want_reload = ISC_FALSE; static isc_boolean_t blocked = ISC_FALSE; static isc_thread_t blockedthread; /* Events to wait for */ #define NUM_EVENTS 2 enum { RELOAD_EVENT, SHUTDOWN_EVENT }; static HANDLE hEvents[NUM_EVENTS]; DWORD dwWaitResult; /* * We need to remember which thread is the main thread... */ static isc_thread_t main_thread; isc_result_t isc_app_start(void) { isc_result_t result; /* * Start an ISC library application. */ main_thread = GetCurrentThread(); result = isc_mutex_init(&lock); if (result != ISC_R_SUCCESS) return (result); /* Create the reload event in a non-signaled state */ hEvents[RELOAD_EVENT] = CreateEvent(NULL, FALSE, FALSE, NULL); /* Create the shutdown event in a non-signaled state */ hEvents[SHUTDOWN_EVENT] = CreateEvent(NULL, FALSE, FALSE, NULL); ISC_LIST_INIT(on_run); return (ISC_R_SUCCESS); } isc_result_t isc_app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action, void *arg) { isc_event_t *event; isc_task_t *cloned_task = NULL; isc_result_t result; LOCK(&lock); if (running) { result = ISC_R_ALREADYRUNNING; goto unlock; } /* * Note that we store the task to which we're going to send the event * in the event's "sender" field. */ isc_task_attach(task, &cloned_task); event = isc_event_allocate(mctx, cloned_task, ISC_APPEVENT_SHUTDOWN, action, arg, sizeof(*event)); if (event == NULL) { result = ISC_R_NOMEMORY; goto unlock; } ISC_LIST_APPEND(on_run, event, ev_link); result = ISC_R_SUCCESS; unlock: UNLOCK(&lock); return (result); } isc_result_t isc_app_run(void) { isc_event_t *event, *next_event; isc_task_t *task; HANDLE *pHandles = NULL; REQUIRE(main_thread == GetCurrentThread()); LOCK(&lock); if (!running) { running = ISC_TRUE; /* * Post any on-run events (in FIFO order). */ for (event = ISC_LIST_HEAD(on_run); event != NULL; event = next_event) { next_event = ISC_LIST_NEXT(event, ev_link); ISC_LIST_UNLINK(on_run, event, ev_link); task = event->ev_sender; event->ev_sender = NULL; isc_task_sendanddetach(&task, &event); } } UNLOCK(&lock); /* * There is no danger if isc_app_shutdown() is called before we wait * for events. */ while (!want_shutdown) { dwWaitResult = WaitForMultipleObjects(NUM_EVENTS, hEvents, FALSE, INFINITE); /* See why we returned */ if (WaitSucceeded(dwWaitResult, NUM_EVENTS)) { /* * The return was due to one of the events * being signaled */ switch (WaitSucceededIndex(dwWaitResult)) { case RELOAD_EVENT: want_reload = ISC_TRUE; break; case SHUTDOWN_EVENT: want_shutdown = ISC_TRUE; break; } } if (want_reload) { want_reload = ISC_FALSE; return (ISC_R_RELOAD); } if (want_shutdown && blocked) exit(-1); } return (ISC_R_SUCCESS); } isc_result_t isc_app_shutdown(void) { isc_boolean_t want_kill = ISC_TRUE; LOCK(&lock); REQUIRE(running); if (shutdown_requested) want_kill = ISC_FALSE; /* We're only signaling once */ else shutdown_requested = ISC_TRUE; UNLOCK(&lock); if (want_kill) SetEvent(hEvents[SHUTDOWN_EVENT]); return (ISC_R_SUCCESS); } isc_result_t isc_app_reload(void) { isc_boolean_t want_reload = ISC_TRUE; LOCK(&lock); REQUIRE(running); /* * Don't send the reload signal if we're shutting down. */ if (shutdown_requested) want_reload = ISC_FALSE; UNLOCK(&lock); if (want_reload) SetEvent(hEvents[RELOAD_EVENT]); return (ISC_R_SUCCESS); } void isc_app_finish(void) { DESTROYLOCK(&lock); } void isc_app_block(void) { REQUIRE(running); REQUIRE(!blocked); blocked = ISC_TRUE; blockedthread = GetCurrentThread(); } void isc_app_unblock(void) { REQUIRE(running); REQUIRE(blocked); blocked = ISC_FALSE; REQUIRE(blockedthread == GetCurrentThread()); } ntp-4.2.6p5/lib/isc/win32/dir.c0000644000175000017500000001566411307651604015040 0ustar peterpeter/* * Copyright (C) 2004, 2007-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: dir.c,v 1.16.22.2 2009/01/18 23:47:41 tbox Exp $ */ /* Principal Authors: DCL */ #include #include #include #include #include #include #include #include #include #include #include "errno2result.h" #define ISC_DIR_MAGIC ISC_MAGIC('D', 'I', 'R', '*') #define VALID_DIR(dir) ISC_MAGIC_VALID(dir, ISC_DIR_MAGIC) static isc_result_t start_directory(isc_dir_t *p); void isc_dir_init(isc_dir_t *dir) { REQUIRE(dir != NULL); dir->dirname[0] = '\0'; dir->entry.name[0] = '\0'; dir->entry.length = 0; memset(&(dir->entry.find_data), 0, sizeof(dir->entry.find_data)); dir->entry_filled = ISC_FALSE; dir->search_handle = INVALID_HANDLE_VALUE; dir->magic = ISC_DIR_MAGIC; } /* * Allocate workspace and open directory stream. If either one fails, * NULL will be returned. */ isc_result_t isc_dir_open(isc_dir_t *dir, const char *dirname) { char *p; isc_result_t result; REQUIRE(dirname != NULL); REQUIRE(VALID_DIR(dir) && dir->search_handle == INVALID_HANDLE_VALUE); /* * Copy directory name. Need to have enough space for the name, * a possible path separator, the wildcard, and the final NUL. */ if (strlen(dirname) + 3 > sizeof(dir->dirname)) /* XXXDCL ? */ return (ISC_R_NOSPACE); strcpy(dir->dirname, dirname); /* * Append path separator, if needed, and "*". */ p = dir->dirname + strlen(dir->dirname); if (dir->dirname < p && *(p - 1) != '\\' && *(p - 1) != ':') *p++ = '\\'; *p++ = '*'; *p++ = '\0'; /* * Open stream. */ result = start_directory(dir); return (result); } /* * Return previously retrieved file or get next one. Unix's dirent has * separate open and read functions, but the Win32 and DOS interfaces open * the dir stream and reads the first file in one operation. */ isc_result_t isc_dir_read(isc_dir_t *dir) { REQUIRE(VALID_DIR(dir) && dir->search_handle != INVALID_HANDLE_VALUE); if (dir->entry_filled) /* * start_directory() already filled in the first entry. */ dir->entry_filled = ISC_FALSE; else { /* * Fetch next file in directory. */ if (FindNextFile(dir->search_handle, &dir->entry.find_data) == FALSE) /* * Either the last file has been processed or * an error has occurred. The former is not * really an error, but the latter is. */ if (GetLastError() == ERROR_NO_MORE_FILES) return (ISC_R_NOMORE); else return (ISC_R_UNEXPECTED); } /* * Make sure that the space for the name is long enough. */ strcpy(dir->entry.name, dir->entry.find_data.cFileName); dir->entry.length = strlen(dir->entry.name); return (ISC_R_SUCCESS); } /* * Close directory stream. */ void isc_dir_close(isc_dir_t *dir) { REQUIRE(VALID_DIR(dir) && dir->search_handle != INVALID_HANDLE_VALUE); FindClose(dir->search_handle); dir->search_handle = INVALID_HANDLE_VALUE; } /* * Reposition directory stream at start. */ isc_result_t isc_dir_reset(isc_dir_t *dir) { isc_result_t result; REQUIRE(VALID_DIR(dir) && dir->search_handle != INVALID_HANDLE_VALUE); REQUIRE(dir->dirname != NULL); /* * NT cannot reposition the seek pointer to the beginning of the * the directory stream, but rather the directory needs to be * closed and reopened. The latter might fail. */ isc_dir_close(dir); result = start_directory(dir); return (result); } /* * Initialize isc_dir_t structure with new directory. The function * returns 0 on failure and nonzero on success. * * Note: * - Be sure to close previous stream before opening new one */ static isc_result_t start_directory(isc_dir_t *dir) { REQUIRE(VALID_DIR(dir)); REQUIRE(dir->search_handle == INVALID_HANDLE_VALUE); dir->entry_filled = ISC_FALSE; /* * Open stream and retrieve first file. */ dir->search_handle = FindFirstFile(dir->dirname, &dir->entry.find_data); if (dir->search_handle == INVALID_HANDLE_VALUE) { /* * Something went wrong but we don't know what. GetLastError() * could give us more information about the error, but the * MSDN documentation is frustratingly thin about what * possible errors could have resulted. (Score one for * the Unix manual pages.) So there is just this lame error * instead of being able to differentiate ISC_R_NOTFOUND * from ISC_R_UNEXPECTED. */ return (ISC_R_FAILURE); } /* * Make sure that the space for the name is long enough. */ INSIST(sizeof(dir->entry.name) > strlen(dir->entry.find_data.cFileName)); /* * Fill in the data for the first entry of the directory. */ strcpy(dir->entry.name, dir->entry.find_data.cFileName); dir->entry.length = strlen(dir->entry.name); dir->entry_filled = ISC_TRUE; return (ISC_R_SUCCESS); } isc_result_t isc_dir_chdir(const char *dirname) { /* * Change the current directory to 'dirname'. */ REQUIRE(dirname != NULL); if (chdir(dirname) < 0) return (isc__errno2result(errno)); return (ISC_R_SUCCESS); } isc_result_t isc_dir_chroot(const char *dirname) { return (ISC_R_NOTIMPLEMENTED); } isc_result_t isc_dir_createunique(char *templet) { isc_result_t result; char *x; char *p; int i; int pid; REQUIRE(templet != NULL); /* * mkdtemp is not portable, so this emulates it. */ pid = getpid(); /* * Replace trailing Xs with the process-id, zero-filled. */ for (x = templet + strlen(templet) - 1; *x == 'X' && x >= templet; x--, pid /= 10) *x = pid % 10 + '0'; x++; /* Set x to start of ex-Xs. */ do { i = mkdir(templet); i = chmod(templet, 0700); if (i == 0 || errno != EEXIST) break; /* * The BSD algorithm. */ p = x; while (*p != '\0') { if (isdigit(*p & 0xff)) *p = 'a'; else if (*p != 'z') ++*p; else { /* * Reset character and move to next. */ *p++ = 'a'; continue; } break; } if (*p == '\0') { /* * Tried all combinations. errno should already * be EEXIST, but ensure it is anyway for * isc__errno2result(). */ errno = EEXIST; break; } } while (1); if (i == -1) result = isc__errno2result(errno); else result = ISC_R_SUCCESS; return (result); } ntp-4.2.6p5/lib/isc/win32/once.c0000644000175000017500000000320611307651603015172 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: once.c,v 1.12 2007/06/18 23:47:49 tbox Exp $ */ /* Principal Authors: DCL */ #include #include #include #include #include isc_result_t isc_once_do(isc_once_t *controller, void(*function)(void)) { REQUIRE(controller != NULL && function != NULL); if (controller->status == ISC_ONCE_INIT_NEEDED) { if (InterlockedDecrement(&controller->counter) == 0) { if (controller->status == ISC_ONCE_INIT_NEEDED) { function(); controller->status = ISC_ONCE_INIT_DONE; } } else { while (controller->status == ISC_ONCE_INIT_NEEDED) { /* * Sleep(0) indicates that this thread * should be suspended to allow other * waiting threads to execute. */ Sleep(0); } } } return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/win32/syslog.h0000644000175000017500000000423311307651604015575 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001, 2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: syslog.h,v 1.7 2007/06/19 23:47:19 tbox Exp $ */ #ifndef _SYSLOG_H #define _SYSLOG_H #include /* Constant definitions for openlog() */ #define LOG_PID 1 #define LOG_CONS 2 /* NT event log does not support facility level */ #define LOG_KERN 0 #define LOG_USER 0 #define LOG_MAIL 0 #define LOG_DAEMON 0 #define LOG_AUTH 0 #define LOG_SYSLOG 0 #define LOG_LPR 0 #define LOG_LOCAL0 0 #define LOG_LOCAL1 0 #define LOG_LOCAL2 0 #define LOG_LOCAL3 0 #define LOG_LOCAL4 0 #define LOG_LOCAL5 0 #define LOG_LOCAL6 0 #define LOG_LOCAL7 0 #define LOG_EMERG 0 /* system is unusable */ #define LOG_ALERT 1 /* action must be taken immediately */ #define LOG_CRIT 2 /* critical conditions */ #define LOG_ERR 3 /* error conditions */ #define LOG_WARNING 4 /* warning conditions */ #define LOG_NOTICE 5 /* normal but signification condition */ #define LOG_INFO 6 /* informational */ #define LOG_DEBUG 7 /* debug-level messages */ void syslog(int level, const char *fmt, ...); void openlog(const char *, int, ...); void closelog(void); void ModifyLogLevel(int level); void InitNTLogging(FILE *, int); void NTReportError(const char *, const char *); /* * Include the event codes required for logging. */ #include #endif ntp-4.2.6p5/lib/isc/win32/condition.c0000644000175000017500000001421411307651605016237 0ustar peterpeter/* * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: condition.c,v 1.23 2007/06/18 23:47:49 tbox Exp $ */ #include #include #include #include #include #include #define LSIGNAL 0 #define LBROADCAST 1 isc_result_t isc_condition_init(isc_condition_t *cond) { HANDLE h; REQUIRE(cond != NULL); cond->waiters = 0; /* * This handle is shared across all threads */ h = CreateEvent(NULL, FALSE, FALSE, NULL); if (h == NULL) { /* XXX */ return (ISC_R_UNEXPECTED); } cond->events[LSIGNAL] = h; /* * The threadlist will hold the actual events needed * for the wait condition */ ISC_LIST_INIT(cond->threadlist); return (ISC_R_SUCCESS); } /* * Add the thread to the threadlist along with the required events */ static isc_result_t register_thread(unsigned long thrd, isc_condition_t *gblcond, isc_condition_thread_t **localcond) { HANDLE hc; isc_condition_thread_t *newthread; REQUIRE(localcond != NULL && *localcond == NULL); newthread = malloc(sizeof(isc_condition_thread_t)); if (newthread == NULL) return (ISC_R_NOMEMORY); /* * Create the thread-specific handle */ hc = CreateEvent(NULL, FALSE, FALSE, NULL); if (hc == NULL) { free(newthread); return (ISC_R_UNEXPECTED); } /* * Add the thread ID and handles to list of threads for broadcast */ newthread->handle[LSIGNAL] = gblcond->events[LSIGNAL]; newthread->handle[LBROADCAST] = hc; newthread->th = thrd; /* * The thread is holding the manager lock so this is safe */ ISC_LIST_APPEND(gblcond->threadlist, newthread, link); *localcond = newthread; return (ISC_R_SUCCESS); } static isc_result_t find_thread_condition(unsigned long thrd, isc_condition_t *cond, isc_condition_thread_t **threadcondp) { isc_condition_thread_t *threadcond; REQUIRE(threadcondp != NULL && *threadcondp == NULL); /* * Look for the thread ID. */ for (threadcond = ISC_LIST_HEAD(cond->threadlist); threadcond != NULL; threadcond = ISC_LIST_NEXT(threadcond, link)) { if (threadcond->th == thrd) { *threadcondp = threadcond; return (ISC_R_SUCCESS); } } /* * Not found, so add it. */ return (register_thread(thrd, cond, threadcondp)); } isc_result_t isc_condition_signal(isc_condition_t *cond) { /* * Unlike pthreads, the caller MUST hold the lock associated with * the condition variable when calling us. */ REQUIRE(cond != NULL); if (!SetEvent(cond->events[LSIGNAL])) { /* XXX */ return (ISC_R_UNEXPECTED); } return (ISC_R_SUCCESS); } isc_result_t isc_condition_broadcast(isc_condition_t *cond) { isc_condition_thread_t *threadcond; isc_boolean_t failed = ISC_FALSE; /* * Unlike pthreads, the caller MUST hold the lock associated with * the condition variable when calling us. */ REQUIRE(cond != NULL); /* * Notify every thread registered for this */ for (threadcond = ISC_LIST_HEAD(cond->threadlist); threadcond != NULL; threadcond = ISC_LIST_NEXT(threadcond, link)) { if (!SetEvent(threadcond->handle[LBROADCAST])) failed = ISC_TRUE; } if (failed) return (ISC_R_UNEXPECTED); return (ISC_R_SUCCESS); } isc_result_t isc_condition_destroy(isc_condition_t *cond) { isc_condition_thread_t *next, *threadcond; REQUIRE(cond != NULL); REQUIRE(cond->waiters == 0); (void)CloseHandle(cond->events[LSIGNAL]); /* * Delete the threadlist */ threadcond = ISC_LIST_HEAD(cond->threadlist); while (threadcond != NULL) { next = ISC_LIST_NEXT(threadcond, link); DEQUEUE(cond->threadlist, threadcond, link); (void) CloseHandle(threadcond->handle[LBROADCAST]); free(threadcond); threadcond = next; } return (ISC_R_SUCCESS); } /* * This is always called when the mutex (lock) is held, but because * we are waiting we need to release it and reacquire it as soon as the wait * is over. This allows other threads to make use of the object guarded * by the mutex but it should never try to delete it as long as the * number of waiters > 0. Always reacquire the mutex regardless of the * result of the wait. Note that EnterCriticalSection will wait to acquire * the mutex. */ static isc_result_t wait(isc_condition_t *cond, isc_mutex_t *mutex, DWORD milliseconds) { DWORD result; isc_result_t tresult; isc_condition_thread_t *threadcond = NULL; /* * Get the thread events needed for the wait */ tresult = find_thread_condition(isc_thread_self(), cond, &threadcond); if (tresult != ISC_R_SUCCESS) return (tresult); cond->waiters++; LeaveCriticalSection(mutex); result = WaitForMultipleObjects(2, threadcond->handle, FALSE, milliseconds); EnterCriticalSection(mutex); cond->waiters--; if (result == WAIT_FAILED) { /* XXX */ return (ISC_R_UNEXPECTED); } if (result == WAIT_TIMEOUT) return (ISC_R_TIMEDOUT); return (ISC_R_SUCCESS); } isc_result_t isc_condition_wait(isc_condition_t *cond, isc_mutex_t *mutex) { return (wait(cond, mutex, INFINITE)); } isc_result_t isc_condition_waituntil(isc_condition_t *cond, isc_mutex_t *mutex, isc_time_t *t) { DWORD milliseconds; isc_uint64_t microseconds; isc_time_t now; if (isc_time_now(&now) != ISC_R_SUCCESS) { /* XXX */ return (ISC_R_UNEXPECTED); } microseconds = isc_time_microdiff(t, &now); if (microseconds > 0xFFFFFFFFi64 * 1000) milliseconds = 0xFFFFFFFF; else milliseconds = (DWORD)(microseconds / 1000); return (wait(cond, mutex, milliseconds)); } ntp-4.2.6p5/lib/isc/win32/errno2result.h0000644000175000017500000000256211307651604016726 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: errno2result.h,v 1.10 2007/06/19 23:47:19 tbox Exp $ */ #ifndef UNIX_ERRNO2RESULT_H #define UNIX_ERRNO2RESULT_H 1 /* XXXDCL this should be moved to lib/isc/include/isc/errno2result.h. */ #include /* Provides errno. */ #include #include ISC_LANG_BEGINDECLS #define isc__errno2result(posixerrno) \ isc__errno2resultx(posixerrno, __FILE__, __LINE__) isc_result_t isc__errno2resultx(int posixerrno, const char *file, int line); ISC_LANG_ENDDECLS #endif /* UNIX_ERRNO2RESULT_H */ ntp-4.2.6p5/lib/isc/win32/os.c0000644000175000017500000000242411307651604014671 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: os.c,v 1.8 2007/06/19 23:47:19 tbox Exp $ */ #include #include static BOOL bInit = FALSE; static SYSTEM_INFO SystemInfo; static void initialize_action(void) { if (bInit) return; GetSystemInfo(&SystemInfo); bInit = TRUE; } unsigned int isc_os_ncpus(void) { long ncpus = 1; initialize_action(); ncpus = SystemInfo.dwNumberOfProcessors; if (ncpus <= 0) ncpus = 1; return ((unsigned int)ncpus); } ntp-4.2.6p5/lib/isc/win32/net.c0000644000175000017500000001646611505336022015043 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: net.c,v 1.18 2008/08/08 05:06:49 marka Exp $ */ #include #include #include #include #include #include #include #include #include #include /*% * Definitions about UDP port range specification. This is a total mess of * portability variants: some use sysctl (but the sysctl names vary), some use * system-specific interfaces, some have the same interface for IPv4 and IPv6, * some separate them, etc... */ /*% * The last resort defaults: use all non well known port space */ #ifndef ISC_NET_PORTRANGELOW #define ISC_NET_PORTRANGELOW 1024 #endif /* ISC_NET_PORTRANGELOW */ #ifndef ISC_NET_PORTRANGEHIGH #define ISC_NET_PORTRANGEHIGH 65535 #endif /* ISC_NET_PORTRANGEHIGH */ #if defined(ISC_PLATFORM_NEEDIN6ADDRANY) const struct in6_addr isc_net_in6addrany = IN6ADDR_ANY_INIT; #endif #if defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK) const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT; #endif static isc_once_t once = ISC_ONCE_INIT; static isc_once_t once_ipv6only = ISC_ONCE_INIT; static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT; static isc_result_t ipv4_result = ISC_R_NOTFOUND; static isc_result_t ipv6_result = ISC_R_NOTFOUND; static isc_result_t ipv6only_result = ISC_R_NOTFOUND; static isc_result_t ipv6pktinfo_result = ISC_R_NOTFOUND; void InitSockets(void); static isc_result_t try_proto(int domain) { SOCKET s; char strbuf[ISC_STRERRORSIZE]; int errval; s = socket(domain, SOCK_STREAM, IPPROTO_TCP); if (s == INVALID_SOCKET) { errval = WSAGetLastError(); switch (errval) { case WSAEAFNOSUPPORT: case WSAEPROTONOSUPPORT: case WSAEINVAL: return (ISC_R_NOTFOUND); default: isc__strerror(errval, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "socket() %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); return (ISC_R_UNEXPECTED); } } closesocket(s); return (ISC_R_SUCCESS); } static void initialize_action(void) { InitSockets(); ipv4_result = try_proto(PF_INET); #ifdef ISC_PLATFORM_HAVEIPV6 #ifdef WANT_IPV6 #ifdef ISC_PLATFORM_HAVEIN6PKTINFO ipv6_result = try_proto(PF_INET6); #endif #endif #endif } static void initialize(void) { RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); } isc_result_t isc_net_probeipv4(void) { initialize(); return (ipv4_result); } isc_result_t isc_net_probeipv6(void) { initialize(); return (ipv6_result); } isc_result_t isc_net_probeunix(void) { return (ISC_R_NOTFOUND); } #ifdef ISC_PLATFORM_HAVEIPV6 #ifdef WANT_IPV6 static void try_ipv6only(void) { #ifdef IPV6_V6ONLY SOCKET s; int on; char strbuf[ISC_STRERRORSIZE]; #endif isc_result_t result; result = isc_net_probeipv6(); if (result != ISC_R_SUCCESS) { ipv6only_result = result; return; } #ifndef IPV6_V6ONLY ipv6only_result = ISC_R_NOTFOUND; return; #else /* check for TCP sockets */ s = socket(PF_INET6, SOCK_STREAM, 0); if (s == INVALID_SOCKET) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "socket() %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); ipv6only_result = ISC_R_UNEXPECTED; return; } on = 1; if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&on, sizeof(on)) < 0) { ipv6only_result = ISC_R_NOTFOUND; goto close; } closesocket(s); /* check for UDP sockets */ s = socket(PF_INET6, SOCK_DGRAM, 0); if (s == INVALID_SOCKET) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "socket() %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); ipv6only_result = ISC_R_UNEXPECTED; return; } on = 1; if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&on, sizeof(on)) < 0) { ipv6only_result = ISC_R_NOTFOUND; goto close; } ipv6only_result = ISC_R_SUCCESS; close: closesocket(s); return; #endif /* IPV6_V6ONLY */ } static void initialize_ipv6only(void) { RUNTIME_CHECK(isc_once_do(&once_ipv6only, try_ipv6only) == ISC_R_SUCCESS); } static void try_ipv6pktinfo(void) { int s, on; char strbuf[ISC_STRERRORSIZE]; isc_result_t result; int optname; result = isc_net_probeipv6(); if (result != ISC_R_SUCCESS) { ipv6pktinfo_result = result; return; } /* we only use this for UDP sockets */ s = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP); if (s == INVALID_SOCKET) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "socket() %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); ipv6pktinfo_result = ISC_R_UNEXPECTED; return; } #ifdef IPV6_RECVPKTINFO optname = IPV6_RECVPKTINFO; #else optname = IPV6_PKTINFO; #endif on = 1; if (setsockopt(s, IPPROTO_IPV6, optname, (const char *) &on, sizeof(on)) < 0) { ipv6pktinfo_result = ISC_R_NOTFOUND; goto close; } ipv6pktinfo_result = ISC_R_SUCCESS; close: closesocket(s); return; } static void initialize_ipv6pktinfo(void) { RUNTIME_CHECK(isc_once_do(&once_ipv6pktinfo, try_ipv6pktinfo) == ISC_R_SUCCESS); } #endif /* WANT_IPV6 */ #endif /* ISC_PLATFORM_HAVEIPV6 */ isc_result_t isc_net_probe_ipv6only(void) { #ifdef ISC_PLATFORM_HAVEIPV6 #ifdef WANT_IPV6 initialize_ipv6only(); #else ipv6only_result = ISC_R_NOTFOUND; #endif #endif return (ipv6only_result); } isc_result_t isc_net_probe_ipv6pktinfo(void) { #ifdef ISC_PLATFORM_HAVEIPV6 #ifdef WANT_IPV6 initialize_ipv6pktinfo(); #else ipv6pktinfo_result = ISC_R_NOTFOUND; #endif #endif return (ipv6pktinfo_result); } isc_result_t isc_net_getudpportrange(int af, in_port_t *low, in_port_t *high) { int result = ISC_R_FAILURE; REQUIRE(low != NULL && high != NULL); UNUSED(af); if (result != ISC_R_SUCCESS) { *low = ISC_NET_PORTRANGELOW; *high = ISC_NET_PORTRANGEHIGH; } return (ISC_R_SUCCESS); /* we currently never fail in this function */ } void isc_net_disableipv4(void) { initialize(); if (ipv4_result == ISC_R_SUCCESS) ipv4_result = ISC_R_DISABLED; } void isc_net_disableipv6(void) { initialize(); if (ipv6_result == ISC_R_SUCCESS) ipv6_result = ISC_R_DISABLED; } void isc_net_enableipv4(void) { initialize(); if (ipv4_result == ISC_R_DISABLED) ipv4_result = ISC_R_SUCCESS; } void isc_net_enableipv6(void) { initialize(); if (ipv6_result == ISC_R_DISABLED) ipv6_result = ISC_R_SUCCESS; } ntp-4.2.6p5/lib/isc/win32/fsaccess.c0000644000175000017500000002366111307651604016050 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: fsaccess.c,v 1.15 2007/06/19 23:47:19 tbox Exp $ */ /* * Note that Win32 does not have the concept of files having access * and ownership bits. The FAT File system only has a readonly flag * for everyone and that's all. NTFS uses ACL's which is a totally * different concept of controlling access. * * This code needs to be revisited to set up proper access control for * NTFS file systems. Nothing can be done for FAT file systems. */ #include #include #include #include #include #include #include #include #include "errno2result.h" /* * The OS-independent part of the API is in lib/isc. */ #include "../fsaccess.c" /* Store the user account name locally */ static char username[255] = "\0"; static DWORD namelen = 0; /* * In order to set or retrieve access information, we need to obtain * the File System type. These could be UNC-type shares. */ BOOL is_ntfs(const char * file) { char drive[255]; char FSType[20]; char tmpbuf[256]; char *machinename; char *sharename; char filename[1024]; REQUIRE(filename != NULL); if (isc_file_absolutepath(file, filename, sizeof(filename)) != ISC_R_SUCCESS) { return (FALSE); } /* * Look for c:\path\... style, c:/path/... or \\computer\shar\path... * the UNC style file specs */ if (isalpha(filename[0]) && filename[1] == ':' && (filename[2] == '\\' || filename[2] == '/')) { strncpy(drive, filename, 3); drive[3] = '\0'; } else if ((filename[0] == '\\') && (filename[1] == '\\')) { /* Find the machine and share name and rebuild the UNC */ strcpy(tmpbuf, filename); machinename = strtok(tmpbuf, "\\"); sharename = strtok(NULL, "\\"); strcpy(drive, "\\\\"); strcat(drive, machinename); strcat(drive, "\\"); strcat(drive, sharename); strcat(drive, "\\"); } else /* Not determinable */ return (FALSE); GetVolumeInformation(drive, NULL, 0, NULL, 0, NULL, FSType, sizeof(FSType)); if(strcmp(FSType,"NTFS") == 0) return (TRUE); else return (FALSE); } /* * If it's not NTFS, we assume that it is FAT and proceed * with almost nothing to do. Only the write flag can be set or * cleared. */ isc_result_t FAT_fsaccess_set(const char *path, isc_fsaccess_t access) { int mode; isc_fsaccess_t bits; /* * Done with checking bad bits. Set mode_t. */ mode = 0; #define SET_AND_CLEAR1(modebit) \ if ((access & bits) != 0) { \ mode |= modebit; \ access &= ~bits; \ } #define SET_AND_CLEAR(user, group, other) \ SET_AND_CLEAR1(user); \ bits <<= STEP; \ SET_AND_CLEAR1(group); \ bits <<= STEP; \ SET_AND_CLEAR1(other); bits = ISC_FSACCESS_READ | ISC_FSACCESS_LISTDIRECTORY; SET_AND_CLEAR(S_IRUSR, S_IRGRP, S_IROTH); bits = ISC_FSACCESS_WRITE | ISC_FSACCESS_CREATECHILD | ISC_FSACCESS_DELETECHILD; SET_AND_CLEAR(S_IWUSR, S_IWGRP, S_IWOTH); INSIST(access == 0); if (_chmod(path, mode) < 0) return (isc__errno2result(errno)); return (ISC_R_SUCCESS); } isc_result_t NTFS_Access_Control(const char *filename, const char *user, int access, isc_boolean_t isdir) { SECURITY_DESCRIPTOR sd; BYTE aclBuffer[1024]; PACL pacl=(PACL)&aclBuffer; BYTE sidBuffer[100]; PSID psid=(PSID) &sidBuffer; DWORD sidBufferSize = sizeof(sidBuffer); BYTE adminSidBuffer[100]; PSID padminsid=(PSID) &adminSidBuffer; DWORD adminSidBufferSize = sizeof(adminSidBuffer); BYTE otherSidBuffer[100]; PSID pothersid=(PSID) &otherSidBuffer; DWORD otherSidBufferSize = sizeof(otherSidBuffer); char domainBuffer[100]; DWORD domainBufferSize = sizeof(domainBuffer); SID_NAME_USE snu; int errval; DWORD NTFSbits; int caccess; /* Initialize an ACL */ if (!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION)) return (ISC_R_NOPERM); if (!InitializeAcl(pacl, sizeof(aclBuffer), ACL_REVISION)) return (ISC_R_NOPERM); if (!LookupAccountName(0, user, psid, &sidBufferSize, domainBuffer, &domainBufferSize, &snu)) return (ISC_R_NOPERM); domainBufferSize = sizeof(domainBuffer); if (!LookupAccountName(0, "Administrators", padminsid, &adminSidBufferSize, domainBuffer, &domainBufferSize, &snu)) { errval = GetLastError(); return (ISC_R_NOPERM); } domainBufferSize = sizeof(domainBuffer); if (!LookupAccountName(0, "Everyone", pothersid, &otherSidBufferSize, domainBuffer, &domainBufferSize, &snu)) { errval = GetLastError(); return (ISC_R_NOPERM); } caccess = access; /* Owner check */ NTFSbits = 0; if (caccess & ISC_FSACCESS_READ) NTFSbits |= FILE_GENERIC_READ; if (caccess & ISC_FSACCESS_WRITE) NTFSbits |= FILE_GENERIC_WRITE; if (caccess & ISC_FSACCESS_EXECUTE) NTFSbits |= FILE_GENERIC_EXECUTE; /* For directories check the directory-specific bits */ if (isdir == ISC_TRUE) { if (caccess & ISC_FSACCESS_CREATECHILD) NTFSbits |= FILE_ADD_SUBDIRECTORY | FILE_ADD_FILE; if (caccess & ISC_FSACCESS_DELETECHILD) NTFSbits |= FILE_DELETE_CHILD; if (caccess & ISC_FSACCESS_LISTDIRECTORY) NTFSbits |= FILE_LIST_DIRECTORY; if (caccess & ISC_FSACCESS_ACCESSCHILD) NTFSbits |= FILE_TRAVERSE; } if (NTFSbits == (FILE_GENERIC_READ | FILE_GENERIC_WRITE | FILE_GENERIC_EXECUTE)) NTFSbits |= FILE_ALL_ACCESS; /* * Owner and Administrator also get STANDARD_RIGHTS_ALL * to ensure that they have full control */ NTFSbits |= STANDARD_RIGHTS_ALL; /* Add the ACE to the ACL */ if (!AddAccessAllowedAce(pacl, ACL_REVISION, NTFSbits, psid)) return (ISC_R_NOPERM); if (!AddAccessAllowedAce(pacl, ACL_REVISION, NTFSbits, padminsid)) return (ISC_R_NOPERM); /* * Group is ignored since we can be in multiple groups or no group * and its meaning is not clear on Win32 */ caccess = caccess >> STEP; /* * Other check. We translate this to be the same as Everyone */ caccess = caccess >> STEP; NTFSbits = 0; if (caccess & ISC_FSACCESS_READ) NTFSbits |= FILE_GENERIC_READ; if (caccess & ISC_FSACCESS_WRITE) NTFSbits |= FILE_GENERIC_WRITE; if (caccess & ISC_FSACCESS_EXECUTE) NTFSbits |= FILE_GENERIC_EXECUTE; /* For directories check the directory-specific bits */ if (isdir == TRUE) { if (caccess & ISC_FSACCESS_CREATECHILD) NTFSbits |= FILE_ADD_SUBDIRECTORY | FILE_ADD_FILE; if (caccess & ISC_FSACCESS_DELETECHILD) NTFSbits |= FILE_DELETE_CHILD; if (caccess & ISC_FSACCESS_LISTDIRECTORY) NTFSbits |= FILE_LIST_DIRECTORY; if (caccess & ISC_FSACCESS_ACCESSCHILD) NTFSbits |= FILE_TRAVERSE; } /* Add the ACE to the ACL */ if (!AddAccessAllowedAce(pacl, ACL_REVISION, NTFSbits, pothersid)) return (ISC_R_NOPERM); if (!SetSecurityDescriptorDacl(&sd, TRUE, pacl, FALSE)) return (ISC_R_NOPERM); if (!SetFileSecurity(filename, DACL_SECURITY_INFORMATION, &sd)) { return (ISC_R_NOPERM); } return(ISC_R_SUCCESS); } isc_result_t NTFS_fsaccess_set(const char *path, isc_fsaccess_t access, isc_boolean_t isdir){ /* * For NTFS we first need to get the name of the account under * which BIND is running */ if (namelen <= 0) { namelen = sizeof(username); if (GetUserName(username, &namelen) == 0) return (ISC_R_FAILURE); } return (NTFS_Access_Control(path, username, access, isdir)); } isc_result_t isc_fsaccess_set(const char *path, isc_fsaccess_t access) { struct stat statb; isc_boolean_t is_dir = ISC_FALSE; isc_result_t result; if (stat(path, &statb) != 0) return (isc__errno2result(errno)); if ((statb.st_mode & S_IFDIR) != 0) is_dir = ISC_TRUE; else if ((statb.st_mode & S_IFREG) == 0) return (ISC_R_INVALIDFILE); result = check_bad_bits(access, is_dir); if (result != ISC_R_SUCCESS) return (result); /* * Determine if this is a FAT or NTFS disk and * call the appropriate function to set the permissions */ if (is_ntfs(path)) return (NTFS_fsaccess_set(path, access, is_dir)); else return (FAT_fsaccess_set(path, access)); } isc_result_t isc_fsaccess_changeowner(const char *filename, const char *user) { SECURITY_DESCRIPTOR psd; BYTE sidBuffer[500]; BYTE groupBuffer[500]; PSID psid=(PSID) &sidBuffer; DWORD sidBufferSize = sizeof(sidBuffer); char domainBuffer[100]; DWORD domainBufferSize = sizeof(domainBuffer); SID_NAME_USE snu; PSID pSidGroup = (PSID) &groupBuffer; DWORD groupBufferSize = sizeof(groupBuffer); /* * Determine if this is a FAT or NTFS disk and * call the appropriate function to set the ownership * FAT disks do not have ownership attributes so it's * a noop. */ if (is_ntfs(filename) == FALSE) return (ISC_R_SUCCESS); if (!InitializeSecurityDescriptor(&psd, SECURITY_DESCRIPTOR_REVISION)) return (ISC_R_NOPERM); if (!LookupAccountName(0, user, psid, &sidBufferSize, domainBuffer, &domainBufferSize, &snu)) return (ISC_R_NOPERM); /* Make sure administrators can get to it */ domainBufferSize = sizeof(domainBuffer); if (!LookupAccountName(0, "Administrators", pSidGroup, &groupBufferSize, domainBuffer, &domainBufferSize, &snu)) return (ISC_R_NOPERM); if (!SetSecurityDescriptorOwner(&psd, psid, FALSE)) return (ISC_R_NOPERM); if (!SetSecurityDescriptorGroup(&psd, pSidGroup, FALSE)) return (ISC_R_NOPERM); if (!SetFileSecurity(filename, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION, &psd)) return (ISC_R_NOPERM); return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/win32/include/0000755000175000017500000000000011307651602015523 5ustar peterpeterntp-4.2.6p5/lib/isc/win32/include/isc/0000755000175000017500000000000011675461367016320 5ustar peterpeterntp-4.2.6p5/lib/isc/win32/include/isc/stdtime.h0000644000175000017500000000337011307651604020130 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: stdtime.h,v 1.12 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_STDTIME_H #define ISC_STDTIME_H 1 #include #include /* * It's public information that 'isc_stdtime_t' is an unsigned integral type. * Applications that want maximum portability should not assume anything * about its size. */ typedef isc_uint32_t isc_stdtime_t; /* * isc_stdtime32_t is a 32-bit version of isc_stdtime_t. A variable of this * type should only be used as an opaque integer (e.g.,) to compare two * time values. */ typedef isc_uint32_t isc_stdtime32_t; ISC_LANG_BEGINDECLS void isc_stdtime_get(isc_stdtime_t *t); /* * Set 't' to the number of seconds since 00:00:00 UTC, January 1, 1970. * * Requires: * * 't' is a valid pointer. */ #define isc_stdtime_convert32(t, t32p) (*(t32p) = t) /* * Convert the standard time to its 32-bit version. */ ISC_LANG_ENDDECLS #endif /* ISC_STDTIME_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/syslog.h0000644000175000017500000000247111307651605020001 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: syslog.h,v 1.5 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_SYSLOG_H #define ISC_SYSLOG_H 1 #include #include ISC_LANG_BEGINDECLS isc_result_t isc_syslog_facilityfromstring(const char *str, int *facilityp); /* * Convert 'str' to the appropriate syslog facility constant. * * Requires: * * 'str' is not NULL * 'facilityp' is not NULL * * Returns: * ISC_R_SUCCESS * ISC_R_NOTFOUND */ ISC_LANG_ENDDECLS #endif /* ISC_SYSLOG_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/offset.h0000644000175000017500000000343011307651604017742 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: offset.h,v 1.6 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_OFFSET_H #define ISC_OFFSET_H 1 /* * File offsets are operating-system dependent. */ #include /* Required for CHAR_BIT. */ #include typedef _off_t isc_offset_t; /* * POSIX says "Additionally, blkcnt_t and off_t are extended signed integral * types", so the maximum value is all 1s except for the high bit. * This definition is more complex than it really needs to be because it was * crafted to keep both the SunOS 5.6 and the HP/UX 11 compilers quiet about * integer overflow. For example, though this is equivalent to just left * shifting 1 to the high bit and then inverting the bits, the SunOS compiler * is unhappy about shifting a positive "1" to negative in a signed integer. */ #define ISC_OFFSET_MAXIMUM \ (~(((off_t)-1 >> (sizeof(off_t) * CHAR_BIT - 1)) \ << (sizeof(off_t) * CHAR_BIT - 1))) #endif /* ISC_OFFSET_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/ipv6.h0000644000175000017500000000576311505336022017345 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ipv6.h,v 1.19 2007/06/18 23:47:49 tbox Exp $ */ #ifndef ISC_IPV6_H #define ISC_IPV6_H 1 /***** ***** Module Info *****/ /* * IPv6 definitions for systems which do not support IPv6. * * MP: * No impact. * * Reliability: * No anticipated impact. * * Resources: * N/A. * * Security: * No anticipated impact. * * Standards: * RFC2553. */ #if _MSC_VER < 1300 #define in6_addr in_addr6 #endif #ifndef IN6ADDR_ANY_INIT #define IN6ADDR_ANY_INIT {{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }} #endif #ifndef IN6ADDR_LOOPBACK_INIT #define IN6ADDR_LOOPBACK_INIT {{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }} #endif LIBISC_EXTERNAL_DATA extern const struct in6_addr isc_net_in6addrany; LIBISC_EXTERNAL_DATA extern const struct in6_addr isc_net_in6addrloop; /* * Unspecified */ #ifndef IN6_IS_ADDR_UNSPECIFIED #define IN6_IS_ADDR_UNSPECIFIED(a) (\ *((u_long *)((a)->s6_addr) ) == 0 && \ *((u_long *)((a)->s6_addr) + 1) == 0 && \ *((u_long *)((a)->s6_addr) + 2) == 0 && \ *((u_long *)((a)->s6_addr) + 3) == 0 \ ) #endif /* * Loopback */ #ifndef IN6_IS_ADDR_LOOPBACK #define IN6_IS_ADDR_LOOPBACK(a) (\ *((u_long *)((a)->s6_addr) ) == 0 && \ *((u_long *)((a)->s6_addr) + 1) == 0 && \ *((u_long *)((a)->s6_addr) + 2) == 0 && \ *((u_long *)((a)->s6_addr) + 3) == htonl(1) \ ) #endif /* * IPv4 compatible */ #define IN6_IS_ADDR_V4COMPAT(a) (\ *((u_long *)((a)->s6_addr) ) == 0 && \ *((u_long *)((a)->s6_addr) + 1) == 0 && \ *((u_long *)((a)->s6_addr) + 2) == 0 && \ *((u_long *)((a)->s6_addr) + 3) != 0 && \ *((u_long *)((a)->s6_addr) + 3) != htonl(1) \ ) /* * Mapped */ #define IN6_IS_ADDR_V4MAPPED(a) (\ *((u_long *)((a)->s6_addr) ) == 0 && \ *((u_long *)((a)->s6_addr) + 1) == 0 && \ *((u_long *)((a)->s6_addr) + 2) == htonl(0x0000ffff)) /* * Multicast */ #define IN6_IS_ADDR_MULTICAST(a) \ ((a)->s6_addr[0] == 0xffU) /* * Unicast link / site local. */ #ifndef IN6_IS_ADDR_LINKLOCAL #define IN6_IS_ADDR_LINKLOCAL(a) (\ ((a)->s6_addr[0] == 0xfe) && \ (((a)->s6_addr[1] & 0xc0) == 0x80)) #endif #ifndef IN6_IS_ADDR_SITELOCAL #define IN6_IS_ADDR_SITELOCAL(a) (\ ((a)->s6_addr[0] == 0xfe) && \ (((a)->s6_addr[1] & 0xc0) == 0xc0)) #endif #endif /* ISC_IPV6_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/dir.h0000644000175000017500000000411711307651604017235 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: dir.h,v 1.15 2007/06/19 23:47:20 tbox Exp $ */ /* Principal Authors: DCL */ #ifndef ISC_DIR_H #define ISC_DIR_H 1 #include #include #include #include #include #define ISC_DIR_NAMEMAX _MAX_FNAME #define ISC_DIR_PATHMAX _MAX_PATH typedef struct { char name[ISC_DIR_NAMEMAX]; unsigned int length; WIN32_FIND_DATA find_data; } isc_direntry_t; typedef struct { unsigned int magic; char dirname[ISC_DIR_PATHMAX]; isc_direntry_t entry; isc_boolean_t entry_filled; HANDLE search_handle; } isc_dir_t; ISC_LANG_BEGINDECLS void isc_dir_init(isc_dir_t *dir); isc_result_t isc_dir_open(isc_dir_t *dir, const char *dirname); isc_result_t isc_dir_read(isc_dir_t *dir); isc_result_t isc_dir_reset(isc_dir_t *dir); void isc_dir_close(isc_dir_t *dir); isc_result_t isc_dir_chdir(const char *dirname); isc_result_t isc_dir_chroot(const char *dirname); isc_result_t isc_dir_createunique(char *templet); /* * Use a templet (such as from isc_file_mktemplate()) to create a uniquely * named, empty directory. The templet string is modified in place. * If result == ISC_R_SUCCESS, it is the name of the directory that was * created. */ ISC_LANG_ENDDECLS #endif /* ISC_DIR_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/mutex.h0000644000175000017500000000352511307651604017623 0ustar peterpeter/* * Copyright (C) 2004, 2007-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: mutex.h,v 1.20.56.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_MUTEX_H #define ISC_MUTEX_H 1 #include #include #include typedef CRITICAL_SECTION isc_mutex_t; /* * This definition is here since some versions of WINBASE.H * omits it for some reason. */ #if (_WIN32_WINNT < 0x0400) WINBASEAPI BOOL WINAPI TryEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection); #endif /* _WIN32_WINNT < 0x0400 */ #define isc_mutex_init(mp) \ (InitializeCriticalSection((mp)), ISC_R_SUCCESS) #define isc_mutex_lock(mp) \ (EnterCriticalSection((mp)), ISC_R_SUCCESS) #define isc_mutex_unlock(mp) \ (LeaveCriticalSection((mp)), ISC_R_SUCCESS) #define isc_mutex_trylock(mp) \ (TryEnterCriticalSection((mp)) ? ISC_R_SUCCESS : ISC_R_LOCKBUSY) #define isc_mutex_destroy(mp) \ (DeleteCriticalSection((mp)), ISC_R_SUCCESS) /* * This is a placeholder for now since we are not keeping any mutex stats */ #define isc_mutex_stats(fp) do {} while (0) #endif /* ISC_MUTEX_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/keyboard.h0000644000175000017500000000263711307651604020264 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: keyboard.h,v 1.6 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_KEYBOARD_H #define ISC_KEYBOARD_H 1 #include #include ISC_LANG_BEGINDECLS typedef struct { int fd; isc_result_t result; } isc_keyboard_t; isc_result_t isc_keyboard_open(isc_keyboard_t *keyboard); isc_result_t isc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleepseconds); isc_result_t isc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp); isc_boolean_t isc_keyboard_canceled(isc_keyboard_t *keyboard); ISC_LANG_ENDDECLS #endif /* ISC_KEYBOARD_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/stat.h0000644000175000017500000000425511307651603017434 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: stat.h,v 1.7 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_STAT_H #define ISC_STAT_H 1 #include /* open() under unix allows setting of read/write permissions * at the owner, group and other levels. These don't exist in NT * We'll just map them all to the NT equivalent */ #define S_IREAD _S_IREAD /* read permission, owner */ #define S_IWRITE _S_IWRITE /* write permission, owner */ #define S_IEXEC _S_IEXEC /* execute/search permission, owner */ #define S_IRUSR _S_IREAD /* Owner read permission */ #define S_IWUSR _S_IWRITE /* Owner write permission */ #define S_IRGRP _S_IREAD /* Group read permission */ #define S_IWGRP _S_IWRITE /* Group write permission */ #define S_IROTH _S_IREAD /* Other read permission */ #define S_IWOTH _S_IWRITE /* Other write permission */ #define S_IFMT _S_IFMT /* file type mask */ #define S_IFDIR _S_IFDIR /* directory */ #define S_IFCHR _S_IFCHR /* character special */ #define S_IFIFO _S_IFIFO /* pipe */ #define S_IFREG _S_IFREG /* regular */ #ifndef S_ISDIR # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif #ifndef S_ISREG # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif #define O_RDONLY _O_RDONLY #define O_WRONLY _O_WRONLY #define O_RDWR _O_RDWR #define O_APPEND _O_APPEND #define O_CREAT _O_CREAT #define O_TRUNC _O_TRUNC #define O_EXCL _O_EXCL #endif /* ISC_STAT_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/time.h0000644000175000017500000001522211307651604017414 0ustar peterpeter/* * Copyright (C) 2004, 2006-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: time.h,v 1.33.56.2 2009/01/05 23:47:23 tbox Exp $ */ #ifndef ISC_TIME_H #define ISC_TIME_H 1 #include #include #include /*** *** Intervals ***/ /* * The contents of this structure are private, and MUST NOT be accessed * directly by callers. * * The contents are exposed only to allow callers to avoid dynamic allocation. */ struct isc_interval { isc_int64_t interval; }; LIBISC_EXTERNAL_DATA extern isc_interval_t *isc_interval_zero; ISC_LANG_BEGINDECLS void isc_interval_set(isc_interval_t *i, unsigned int seconds, unsigned int nanoseconds); /* * Set 'i' to a value representing an interval of 'seconds' seconds and * 'nanoseconds' nanoseconds, suitable for use in isc_time_add() and * isc_time_subtract(). * * Requires: * * 't' is a valid pointer. * nanoseconds < 1000000000. */ isc_boolean_t isc_interval_iszero(const isc_interval_t *i); /* * Returns ISC_TRUE iff. 'i' is the zero interval. * * Requires: * * 'i' is a valid pointer. */ /*** *** Absolute Times ***/ /* * The contents of this structure are private, and MUST NOT be accessed * directly by callers. * * The contents are exposed only to allow callers to avoid dynamic allocation. */ struct isc_time { FILETIME absolute; }; LIBISC_EXTERNAL_DATA extern isc_time_t *isc_time_epoch; void isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds); /*%< * Set 't' to a value which represents the given number of seconds and * nanoseconds since 00:00:00 January 1, 1970, UTC. * * Requires: *\li 't' is a valid pointer. *\li nanoseconds < 1000000000. */ void isc_time_settoepoch(isc_time_t *t); /* * Set 't' to the time of the epoch. * * Notes: * The date of the epoch is platform-dependent. * * Requires: * * 't' is a valid pointer. */ isc_boolean_t isc_time_isepoch(const isc_time_t *t); /* * Returns ISC_TRUE iff. 't' is the epoch ("time zero"). * * Requires: * * 't' is a valid pointer. */ isc_result_t isc_time_now(isc_time_t *t); /* * Set 't' to the current absolute time. * * Requires: * * 't' is a valid pointer. * * Returns: * * Success * Unexpected error * Getting the time from the system failed. * Out of range * The time from the system is too large to be represented * in the current definition of isc_time_t. */ isc_result_t isc_time_nowplusinterval(isc_time_t *t, const isc_interval_t *i); /* * Set *t to the current absolute time + i. * * Note: * This call is equivalent to: * * isc_time_now(t); * isc_time_add(t, i, t); * * Requires: * * 't' and 'i' are valid pointers. * * Returns: * * Success * Unexpected error * Getting the time from the system failed. * Out of range * The interval added to the time from the system is too large to * be represented in the current definition of isc_time_t. */ int isc_time_compare(const isc_time_t *t1, const isc_time_t *t2); /* * Compare the times referenced by 't1' and 't2' * * Requires: * * 't1' and 't2' are valid pointers. * * Returns: * * -1 t1 < t2 (comparing times, not pointers) * 0 t1 = t2 * 1 t1 > t2 */ isc_result_t isc_time_add(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result); /* * Add 'i' to 't', storing the result in 'result'. * * Requires: * * 't', 'i', and 'result' are valid pointers. * * Returns: * Success * Out of range * The interval added to the time is too large to * be represented in the current definition of isc_time_t. */ isc_result_t isc_time_subtract(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result); /* * Subtract 'i' from 't', storing the result in 'result'. * * Requires: * * 't', 'i', and 'result' are valid pointers. * * Returns: * Success * Out of range * The interval is larger than the time since the epoch. */ isc_uint64_t isc_time_microdiff(const isc_time_t *t1, const isc_time_t *t2); /* * Find the difference in milliseconds between time t1 and time t2. * t2 is the subtrahend of t1; ie, difference = t1 - t2. * * Requires: * * 't1' and 't2' are valid pointers. * * Returns: * The difference of t1 - t2, or 0 if t1 <= t2. */ isc_uint32_t isc_time_nanoseconds(const isc_time_t *t); /* * Return the number of nanoseconds stored in a time structure. * * Notes: * This is the number of nanoseconds in excess of the number * of seconds since the epoch; it will always be less than one * full second. * * Requires: * 't' is a valid pointer. * * Ensures: * The returned value is less than 1*10^9. */ void isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len); /* * Format the time 't' into the buffer 'buf' of length 'len', * using a format like "30-Aug-2000 04:06:47.997" and the local time zone. * If the text does not fit in the buffer, the result is indeterminate, * but is always guaranteed to be null terminated. * * Requires: * 'len' > 0 * 'buf' points to an array of at least len chars * */ void isc_time_formathttptimestamp(const isc_time_t *t, char *buf, unsigned int len); /* * Format the time 't' into the buffer 'buf' of length 'len', * using a format like "Mon, 30 Aug 2000 04:06:47 GMT" * If the text does not fit in the buffer, the result is indeterminate, * but is always guaranteed to be null terminated. * * Requires: * 'len' > 0 * 'buf' points to an array of at least len chars * */ void isc_time_formatISO8601(const isc_time_t *t, char *buf, unsigned int len); /*%< * Format the time 't' into the buffer 'buf' of length 'len', * using the ISO8601 format: "yyyy-mm-ddThh:mm:ssZ" * If the text does not fit in the buffer, the result is indeterminate, * but is always guaranteed to be null terminated. * * Requires: *\li 'len' > 0 *\li 'buf' points to an array of at least len chars * */ isc_uint32_t isc_time_seconds(const isc_time_t *t); ISC_LANG_ENDDECLS #endif /* ISC_TIME_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/condition.h0000644000175000017500000000347411307651604020452 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: condition.h,v 1.17 2007/06/18 23:47:49 tbox Exp $ */ #ifndef ISC_CONDITION_H #define ISC_CONDITION_H 1 #include #include #include #include #include typedef struct isc_condition_thread isc_condition_thread_t; struct isc_condition_thread { unsigned long th; HANDLE handle[2]; ISC_LINK(isc_condition_thread_t) link; }; typedef struct isc_condition { HANDLE events[2]; unsigned int waiters; ISC_LIST(isc_condition_thread_t) threadlist; } isc_condition_t; ISC_LANG_BEGINDECLS isc_result_t isc_condition_init(isc_condition_t *); isc_result_t isc_condition_wait(isc_condition_t *, isc_mutex_t *); isc_result_t isc_condition_signal(isc_condition_t *); isc_result_t isc_condition_broadcast(isc_condition_t *); isc_result_t isc_condition_destroy(isc_condition_t *); isc_result_t isc_condition_waituntil(isc_condition_t *, isc_mutex_t *, isc_time_t *); ISC_LANG_ENDDECLS #endif /* ISC_CONDITION_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/net.h0000644000175000017500000002205411365504025017243 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: net.h,v 1.30.82.2 2009/02/16 23:47:15 tbox Exp $ */ #ifndef ISC_NET_H #define ISC_NET_H 1 #include /* * Also define LWRES_IPV6_H to keep it from being included if liblwres is * being used, or redefinition errors will occur. */ #define LWRES_IPV6_H 1 /***** ***** Module Info *****/ /* * Basic Networking Types * * This module is responsible for defining the following basic networking * types: * * struct in_addr * struct in6_addr * struct in6_pktinfo * struct sockaddr * struct sockaddr_in * struct sockaddr_in6 * in_port_t * * It ensures that the AF_ and PF_ macros are defined. * * It declares ntoh[sl]() and hton[sl](). * * It declares inet_aton(), inet_ntop(), and inet_pton(). * * It ensures that INADDR_ANY, IN6ADDR_ANY_INIT, in6addr_any, and * in6addr_loopback are available. * * It ensures that IN_MULTICAST() is available to check for multicast * addresses. * * MP: * No impact. * * Reliability: * No anticipated impact. * * Resources: * N/A. * * Security: * No anticipated impact. * * Standards: * BSD Socket API * RFC2553 */ /*** *** Imports. ***/ #include /* * Because of some sort of problem in the MS header files, this cannot * be simple "#include ", because winsock2.h tries to include * windows.h, which then generates an error out of mswsock.h. _You_ * figure it out. */ #ifndef _WINSOCKAPI_ #define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */ #endif #include #include #include #include #include #include /* * This is here because named client, interfacemgr.c, etc. use the name as * a variable */ #undef interface #ifndef INADDR_LOOPBACK #define INADDR_LOOPBACK 0x7f000001UL #endif #ifndef ISC_PLATFORM_HAVEIN6PKTINFO struct in6_pktinfo { struct in6_addr ipi6_addr; /* src/dst IPv6 address */ unsigned int ipi6_ifindex; /* send/recv interface index */ }; #endif #if _MSC_VER < 1300 #define in6addr_any isc_net_in6addrany #define in6addr_loopback isc_net_in6addrloop #endif /* * Ensure type in_port_t is defined. */ #ifdef ISC_PLATFORM_NEEDPORTT typedef isc_uint16_t in_port_t; #endif /* * If this system does not have MSG_TRUNC (as returned from recvmsg()) * ISC_PLATFORM_RECVOVERFLOW will be defined. This will enable the MSG_TRUNC * faking code in socket.c. */ #ifndef MSG_TRUNC #define ISC_PLATFORM_RECVOVERFLOW #endif #define ISC__IPADDR(x) ((isc_uint32_t)htonl((isc_uint32_t)(x))) #define ISC_IPADDR_ISMULTICAST(i) \ (((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \ == ISC__IPADDR(0xe0000000)) #define ISC_IPADDR_ISEXPERIMENTAL(i) \ (((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \ == ISC__IPADDR(0xf0000000)) /* * Fix the FD_SET and FD_CLR Macros to properly cast */ #undef FD_CLR #define FD_CLR(fd, set) do { \ u_int __i; \ for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \ if (((fd_set FAR *)(set))->fd_array[__i] == (SOCKET) fd) { \ while (__i < ((fd_set FAR *)(set))->fd_count-1) { \ ((fd_set FAR *)(set))->fd_array[__i] = \ ((fd_set FAR *)(set))->fd_array[__i+1]; \ __i++; \ } \ ((fd_set FAR *)(set))->fd_count--; \ break; \ } \ } \ } while (0) #undef FD_SET #define FD_SET(fd, set) do { \ u_int __i; \ for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \ if (((fd_set FAR *)(set))->fd_array[__i] == (SOCKET)(fd)) { \ break; \ } \ } \ if (__i == ((fd_set FAR *)(set))->fd_count) { \ if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) { \ ((fd_set FAR *)(set))->fd_array[__i] = (SOCKET)(fd); \ ((fd_set FAR *)(set))->fd_count++; \ } \ } \ } while (0) /* * Windows Sockets errors redefined as regular Berkeley error constants. * These are usually commented out in Windows NT to avoid conflicts with errno.h. * Use the WSA constants instead. * Starting with VC9 (VC++ 2010) many of these are defined incompatibly * by errno.h -- #undef the conflicting values, which are not relevant to * Win32. */ #undef EWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK #undef EINPROGRESS #define EINPROGRESS WSAEINPROGRESS #undef EALREADY #define EALREADY WSAEALREADY #undef ENOTSOCK #define ENOTSOCK WSAENOTSOCK #undef EDESTADDRREQ #define EDESTADDRREQ WSAEDESTADDRREQ #undef EMSGSIZE #define EMSGSIZE WSAEMSGSIZE #undef EPROTOTYPE #define EPROTOTYPE WSAEPROTOTYPE #undef ENOPROTOOPT #define ENOPROTOOPT WSAENOPROTOOPT #undef EPROTONOSUPPORT #define EPROTONOSUPPORT WSAEPROTONOSUPPORT #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT #undef EOPNOTSUPP #define EOPNOTSUPP WSAEOPNOTSUPP #define EPFNOSUPPORT WSAEPFNOSUPPORT #undef EAFNOSUPPORT #define EAFNOSUPPORT WSAEAFNOSUPPORT #undef EADDRINUSE #define EADDRINUSE WSAEADDRINUSE #undef EADDRNOTAVAIL #define EADDRNOTAVAIL WSAEADDRNOTAVAIL #undef ENETDOWN #define ENETDOWN WSAENETDOWN #undef ENETUNREACH #define ENETUNREACH WSAENETUNREACH #undef ENETRESET #define ENETRESET WSAENETRESET #undef ECONNABORTED #define ECONNABORTED WSAECONNABORTED #undef ECONNRESET #define ECONNRESET WSAECONNRESET #undef ENOBUFS #define ENOBUFS WSAENOBUFS #undef EISCONN #define EISCONN WSAEISCONN #undef ENOTCONN #define ENOTCONN WSAENOTCONN #define ESHUTDOWN WSAESHUTDOWN #define ETOOMANYREFS WSAETOOMANYREFS #undef ETIMEDOUT #define ETIMEDOUT WSAETIMEDOUT #undef ECONNREFUSED #define ECONNREFUSED WSAECONNREFUSED #undef ELOOP #define ELOOP WSAELOOP #define EHOSTDOWN WSAEHOSTDOWN #undef EHOSTUNREACH #define EHOSTUNREACH WSAEHOSTUNREACH #define EPROCLIM WSAEPROCLIM #define EUSERS WSAEUSERS #define EDQUOT WSAEDQUOT #define ESTALE WSAESTALE #define EREMOTE WSAEREMOTE /*** *** Functions. ***/ ISC_LANG_BEGINDECLS isc_result_t isc_net_probeipv4(void); /* * Check if the system's kernel supports IPv4. * * Returns: * * ISC_R_SUCCESS IPv4 is supported. * ISC_R_NOTFOUND IPv4 is not supported. * ISC_R_DISABLED IPv4 is disabled. * ISC_R_UNEXPECTED */ isc_result_t isc_net_probeipv6(void); /* * Check if the system's kernel supports IPv6. * * Returns: * * ISC_R_SUCCESS IPv6 is supported. * ISC_R_NOTFOUND IPv6 is not supported. * ISC_R_DISABLED IPv6 is disabled. * ISC_R_UNEXPECTED */ isc_result_t isc_net_probeunix(void); /* * Check if UNIX domain sockets are supported. * * Returns: * * ISC_R_SUCCESS * ISC_R_NOTFOUND */ isc_result_t isc_net_probe_ipv6only(void); /* * Check if the system's kernel supports the IPV6_V6ONLY socket option. * * Returns: * * ISC_R_SUCCESS the option is supported for both TCP and UDP. * ISC_R_NOTFOUND IPv6 itself or the option is not supported. * ISC_R_UNEXPECTED */ isc_result_t isc_net_probe_ipv6pktinfo(void); /* * Check if the system's kernel supports the IPV6_(RECV)PKTINFO socket option * for UDP sockets. * * Returns: * * ISC_R_SUCCESS the option is supported. * ISC_R_NOTFOUND IPv6 itself or the option is not supported. * ISC_R_UNEXPECTED */ void isc_net_disableipv4(void); void isc_net_disableipv6(void); void isc_net_enableipv4(void); void isc_net_enableipv6(void); isc_result_t isc_net_getudpportrange(int af, in_port_t *low, in_port_t *high); /*%< * Returns system's default range of ephemeral UDP ports, if defined. * If the range is not available or unknown, ISC_NET_PORTRANGELOW and * ISC_NET_PORTRANGEHIGH will be returned. * * Requires: * *\li 'low' and 'high' must be non NULL. * * Returns: * *\li *low and *high will be the ports specifying the low and high ends of * the range. */ #ifdef ISC_PLATFORM_NEEDNTOP const char * isc_net_ntop(int af, const void *src, char *dst, size_t size); #define inet_ntop isc_net_ntop #endif #ifdef ISC_PLATFORM_NEEDPTON int isc_net_pton(int af, const char *src, void *dst); #define inet_pton isc_net_pton #endif int isc_net_aton(const char *cp, struct in_addr *addr); #define inet_aton isc_net_aton ISC_LANG_ENDDECLS #endif /* ISC_NET_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/thread.h0000644000175000017500000000547211307651604017733 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: thread.h,v 1.22 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_THREAD_H #define ISC_THREAD_H 1 #include #include #include /* * Inlines to help with wait retrun checking */ /* check handle for NULL and INVALID_HANDLE */ inline BOOL IsValidHandle( HANDLE hHandle) { return ((hHandle != NULL) && (hHandle != INVALID_HANDLE_VALUE)); } /* validate wait return codes... */ inline BOOL WaitSucceeded( DWORD dwWaitResult, DWORD dwHandleCount) { return ((dwWaitResult >= WAIT_OBJECT_0) && (dwWaitResult < WAIT_OBJECT_0 + dwHandleCount)); } inline BOOL WaitAbandoned( DWORD dwWaitResult, DWORD dwHandleCount) { return ((dwWaitResult >= WAIT_ABANDONED_0) && (dwWaitResult < WAIT_ABANDONED_0 + dwHandleCount)); } inline BOOL WaitTimeout( DWORD dwWaitResult) { return (dwWaitResult == WAIT_TIMEOUT); } inline BOOL WaitFailed( DWORD dwWaitResult) { return (dwWaitResult == WAIT_FAILED); } /* compute object indices for waits... */ inline DWORD WaitSucceededIndex( DWORD dwWaitResult) { return (dwWaitResult - WAIT_OBJECT_0); } inline DWORD WaitAbandonedIndex( DWORD dwWaitResult) { return (dwWaitResult - WAIT_ABANDONED_0); } typedef HANDLE isc_thread_t; typedef unsigned int isc_threadresult_t; typedef void * isc_threadarg_t; typedef isc_threadresult_t (WINAPI *isc_threadfunc_t)(isc_threadarg_t); typedef DWORD isc_thread_key_t; #define isc_thread_self (unsigned long)GetCurrentThreadId ISC_LANG_BEGINDECLS isc_result_t isc_thread_create(isc_threadfunc_t, isc_threadarg_t, isc_thread_t *); isc_result_t isc_thread_join(isc_thread_t, isc_threadresult_t *); void isc_thread_setconcurrency(unsigned int level); int isc_thread_key_create(isc_thread_key_t *key, void (*func)(void *)); int isc_thread_key_delete(isc_thread_key_t key); void * isc_thread_key_getspecific(isc_thread_key_t); int isc_thread_key_setspecific(isc_thread_key_t key, void *value); ISC_LANG_ENDDECLS #endif /* ISC_THREAD_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/netdb.h0000644000175000017500000000246511307651604017557 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: netdb.h,v 1.9 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_NETDB_H #define ISC_NETDB_H 1 /***** ***** Module Info *****/ /* * Portable netdb.h support. * * This module is responsible for defining the getby APIs. * * MP: * No impact. * * Reliability: * No anticipated impact. * * Resources: * N/A. * * Security: * No anticipated impact. * * Standards: * BSD API */ /*** *** Imports. ***/ #include #endif /* ISC_NETDB_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/ntpaths.h0000644000175000017500000000354211307651604020141 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ntpaths.h,v 1.16 2007/06/19 23:47:20 tbox Exp $ */ /* * Windows-specific path definitions * These routines are used to set up and return system-specific path * information about the files enumerated in NtPaths */ #ifndef ISC_NTPATHS_H #define ISC_NTPATHS_H #include /* * Index of paths needed */ enum NtPaths { NAMED_CONF_PATH, LWRES_CONF_PATH, RESOLV_CONF_PATH, RNDC_CONF_PATH, NAMED_PID_PATH, LWRESD_PID_PATH, LOCAL_STATE_DIR, SYS_CONF_DIR, RNDC_KEY_PATH }; /* * Define macros to get the path of the config files */ #define NAMED_CONFFILE isc_ntpaths_get(NAMED_CONF_PATH) #define RNDC_CONFFILE isc_ntpaths_get(RNDC_CONF_PATH) #define RNDC_KEYFILE isc_ntpaths_get(RNDC_KEY_PATH) #define RESOLV_CONF isc_ntpaths_get(RESOLV_CONF_PATH) /* * Information about where the files are on disk */ #define NS_LOCALSTATEDIR "/dns/bin" #define NS_SYSCONFDIR "/dns/etc" ISC_LANG_BEGINDECLS void isc_ntpaths_init(void); char * isc_ntpaths_get(int); ISC_LANG_ENDDECLS #endif /* ISC_NTPATHS_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/once.h0000644000175000017500000000243611505336023017400 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: once.h,v 1.9 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_ONCE_H #define ISC_ONCE_H 1 #include #include ISC_LANG_BEGINDECLS typedef struct { int status; LONG counter; } isc_once_t; #define ISC_ONCE_INIT_NEEDED 0 #define ISC_ONCE_INIT_DONE 1 #define ISC_ONCE_INIT { ISC_ONCE_INIT_NEEDED, 1 } isc_result_t isc_once_do(isc_once_t *controller, void(*function)(void)); ISC_LANG_ENDDECLS #endif /* ISC_ONCE_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/int.h0000644000175000017500000000351211307651603017246 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: int.h,v 1.13 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_INT_H #define ISC_INT_H 1 #define _INTEGRAL_MAX_BITS 64 #include typedef __int8 isc_int8_t; typedef unsigned __int8 isc_uint8_t; typedef __int16 isc_int16_t; typedef unsigned __int16 isc_uint16_t; typedef __int32 isc_int32_t; typedef unsigned __int32 isc_uint32_t; typedef __int64 isc_int64_t; typedef unsigned __int64 isc_uint64_t; #define ISC_INT8_MIN -128 #define ISC_INT8_MAX 127 #define ISC_UINT8_MAX 255 #define ISC_INT16_MIN -32768 #define ISC_INT16_MAX 32767 #define ISC_UINT16_MAX 65535 /* * Note that "int" is 32 bits on all currently supported Unix-like operating * systems, but "long" can be either 32 bits or 64 bits, thus the 32 bit * constants are not qualified with "L". */ #define ISC_INT32_MIN _I32_MIN #define ISC_INT32_MAX _I32_MAX #define ISC_UINT32_MAX _UI32_MAX #define ISC_INT64_MIN _I64_MIN #define ISC_INT64_MAX _I64_MAX #define ISC_UINT64_MAX _UI64_MAX #endif /* ISC_INT_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/strerror.h0000644000175000017500000000235211307651605020341 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: strerror.h,v 1.5 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_STRERROR_H #define ISC_STRERROR_H #include #include ISC_LANG_BEGINDECLS #define ISC_STRERRORSIZE 128 /* * Provide a thread safe wrapper to strerrror(). * * Requires: * 'buf' to be non NULL. */ void isc__strerror(int num, char *buf, size_t bufsize); ISC_LANG_ENDDECLS #endif /* ISC_STRERROR_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/bindevt.h0000644000175000017500000000426711307651603020117 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: bindevt.h,v 1.6 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_BINDEVT_H #define ISC_BINDEVT_H 1 /* * This is used for the event log for both logging the messages and * later on by the event viewer when looking at the events */ /* * Values are 32 bit values layed out as follows: * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +---+-+-+-----------------------+-------------------------------+ * |Sev|C|R| Facility | Code | * +---+-+-+-----------------------+-------------------------------+ * * where * * Sev - is the severity code * * 00 - Success * 01 - Informational * 10 - Warning * 11 - Error * * C - is the Customer code flag * * R - is a reserved bit * * Facility - is the facility code * * Code - is the facility's status code * * * Define the facility codes */ /* * Define the severity codes */ /* * MessageId: BIND_ERR_MSG * * MessageText: * * %1 */ #define BIND_ERR_MSG ((DWORD)0xC0000001L) /* * MessageId: BIND_WARN_MSG * * MessageText: * * %1 */ #define BIND_WARN_MSG ((DWORD)0x80000002L) /* * MessageId: BIND_INFO_MSG * * MessageText: * * %1 */ #define BIND_INFO_MSG ((DWORD)0x40000003L) #endif /* ISC_BINDEVT_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/ntgroups.h0000644000175000017500000000226111307651603020335 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ntgroups.h,v 1.5 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_NTGROUPS_H #define ISC_NTGROUPS_H 1 #include #include ISC_LANG_BEGINDECLS isc_result_t isc_ntsecurity_getaccountgroups(char *name, char **Groups, unsigned int maxgroups, unsigned int *total); ISC_LANG_ENDDECLS #endif /* ISC_NTGROUPS_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/bind_registry.h0000644000175000017500000000341711307651604021325 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: bind_registry.h,v 1.8 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_BINDREGISTRY_H #define ISC_BINDREGISTRY_H /* * BIND makes use of the following Registry keys in various places, especially * during startup and installation */ #define BIND_SUBKEY "Software\\ISC\\BIND" #define BIND_SESSION "CurrentSession" #define BIND_SESSION_SUBKEY "Software\\ISC\\BIND\\CurrentSession" #define BIND_UNINSTALL_SUBKEY \ "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ISC BIND" #define EVENTLOG_APP_SUBKEY \ "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application" #define BIND_MESSAGE_SUBKEY \ "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\named" #define BIND_MESSAGE_NAME "named" #define BIND_SERVICE_SUBKEY \ "SYSTEM\\CurrentControlSet\\Services\\named" #define BIND_CONFIGFILE 0 #define BIND_DEBUGLEVEL 1 #define BIND_QUERYLOG 2 #define BIND_FOREGROUND 3 #define BIND_PORT 4 #endif /* ISC_BINDREGISTRY_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/platform.h0000644000175000017500000000530511327015210020270 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: platform.h,v 1.16.118.2 2009/02/16 23:47:15 tbox Exp $ */ #ifndef ISC_PLATFORM_H #define ISC_PLATFORM_H 1 /***** ***** Platform-dependent defines. *****/ #define ISC_PLATFORM_USETHREADS /*** *** Network. ***/ #if _MSC_VER > 1200 #define ISC_PLATFORM_HAVEIPV6 #define ISC_PLATFORM_HAVEIN6PKTINFO #define ISC_PLATFORM_HAVESCOPEID #endif #define ISC_PLATFORM_NEEDPORTT #undef MSG_TRUNC #define ISC_PLATFORM_NEEDNTOP #define ISC_PLATFORM_NEEDPTON #define ISC_PLATFORM_QUADFORMAT "I64" #define ISC_PLATFORM_NEEDSTRSEP #define ISC_PLATFORM_NEEDSTRLCPY #define ISC_PLATFORM_NEEDSTRLCAT #define ISC_PLATFORM_NEEDSTRLCPY /* * Used to control how extern data is linked; needed for Win32 platforms. */ #define ISC_PLATFORM_USEDECLSPEC 1 /* * Define this here for now as winsock2.h defines h_errno * and we don't want to redeclare it. */ #define ISC_PLATFORM_NONSTDHERRNO /* * Define if the platform has . */ #undef ISC_PLATFORM_HAVESYSUNH /* * Set up a macro for importing and exporting from the DLL * * To build static libraries on win32, #define ISC_STATIC_WIN */ #ifndef ISC_STATIC_WIN #define ISC_DLLEXP __declspec(dllexport) #define ISC_DLLIMP __declspec(dllimport) #else #define ISC_DLLEXP #define ISC_DLLIMP #endif #ifdef LIBISC_EXPORTS #define LIBISC_EXTERNAL_DATA ISC_DLLEXP #else #define LIBISC_EXTERNAL_DATA ISC_DLLIMP #endif #ifdef LIBISCCFG_EXPORTS #define LIBISCCFG_EXTERNAL_DATA ISC_DLLEXP #else #define LIBISCCFG_EXTERNAL_DATA ISC_DLLIMP #endif #ifdef LIBISCCC_EXPORTS #define LIBISCCC_EXTERNAL_DATA ISC_DLLEXP #else #define LIBISCCC_EXTERNAL_DATA ISC_DLLIMP #endif #ifdef LIBDNS_EXPORTS #define LIBDNS_EXTERNAL_DATA ISC_DLLEXP #else #define LIBDNS_EXTERNAL_DATA ISC_DLLIMP #endif #ifdef LIBBIND9_EXPORTS #define LIBBIND9_EXTERNAL_DATA ISC_DLLEXP #else #define LIBBIND9_EXTERNAL_DATA ISC_DLLIMP #endif #endif /* ISC_PLATFORM_H */ ntp-4.2.6p5/lib/isc/win32/include/isc/win32os.h0000644000175000017500000000360711307651603017765 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: win32os.h,v 1.5 2007/06/19 23:47:20 tbox Exp $ */ #ifndef ISC_WIN32OS_H #define ISC_WIN32OS_H 1 #include ISC_LANG_BEGINDECLS /* * Return the number of CPUs available on the system, or 1 if this cannot * be determined. */ unsigned int isc_win32os_majorversion(void); /* * Major Version of the O/S. */ unsigned int isc_win32os_minorversion(void); /* * Minor Version of the O/S. */ unsigned int isc_win32os_servicepackmajor(void); /* * Major Version of the Service Pack for O/S. */ unsigned int isc_win32os_servicepackminor(void); /* * Minor Version of the Service Pack for O/S. */ int isc_win32os_versioncheck(unsigned int major, unsigned int minor, unsigned int updatemajor, unsigned int updateminor); /* * Checks the current version of the operating system with the * supplied version information. * Returns: * -1 if less than the version information supplied * 0 if equal to all of the version information supplied * +1 if greater than the version information supplied */ ISC_LANG_ENDDECLS #endif /* ISC_OS_H */ ntp-4.2.6p5/lib/isc/win32/libisc.def0000644000175000017500000002455611307651605016044 0ustar peterpeterLIBRARY libisc ; Exported Functions EXPORTS NTReportError closelog isc__buffer_activeregion isc__buffer_add isc__buffer_availableregion isc__buffer_back isc__buffer_clear isc__buffer_consumedregion isc__buffer_first isc__buffer_forward isc__buffer_init isc__buffer_invalidate isc__buffer_putmem isc__buffer_putstr isc__buffer_putuint16 isc__buffer_putuint32 isc__buffer_putuint48 isc__buffer_putuint8 isc__buffer_region isc__buffer_remainingregion isc__buffer_setactive isc__buffer_subtract isc__buffer_usedregion isc__mem_allocate isc__mem_free isc__mem_get isc__mem_put isc__mem_putanddetach isc__mem_reallocate isc__mem_strdup isc__mempool_get isc__mempool_put isc__socketmgr_setreserved isc__strerror isc_app_block isc_app_finish isc_app_onrun isc_app_reload isc_app_run isc_app_shutdown isc_app_start isc_app_unblock isc_assertion_setcallback isc_assertion_typetotext isc_base32_decoderegion isc_base32_decodestring isc_base32_tobuffer isc_base32_totext isc_base32hex_decoderegion isc_base32hex_decodestring isc_base32hex_tobuffer isc_base32hex_totext isc_base64_decodestring isc_base64_tobuffer isc_base64_totext isc_bitstring_copy isc_bitstring_init isc_bitstring_invalidate isc_buffer_allocate isc_buffer_compact isc_buffer_copyregion isc_buffer_free isc_buffer_getuint16 isc_buffer_getuint32 isc_buffer_getuint8 isc_buffer_reinit isc_bufferlist_availablecount isc_bufferlist_usedcount isc_commandline_parse isc_condition_broadcast isc_condition_destroy isc_condition_init isc_condition_signal isc_condition_wait isc_condition_waituntil isc_dir_chdir isc_dir_chroot isc_dir_close isc_dir_init isc_dir_open isc_dir_read isc_dir_reset isc_entropy_addcallbacksample isc_entropy_addsample isc_entropy_attach isc_entropy_create isc_entropy_createcallbacksource isc_entropy_createfilesource isc_entropy_createsamplesource isc_entropy_destroysource isc_entropy_detach isc_entropy_getdata isc_entropy_putdata isc_entropy_stats isc_entropy_status isc_entropy_stopcallbacksources isc_entropy_usebestsource isc_error_fatal isc_error_runtimecheck isc_error_setfatal isc_error_setunexpected isc_error_unexpected isc_event_allocate isc_event_free isc_file_absolutepath isc_file_basename isc_file_exists isc_file_getmodtime isc_file_isabsolute isc_file_ischdiridempotent isc_file_iscurrentdir isc_file_mktemplate isc_file_openunique isc_file_progname isc_file_remove isc_file_rename isc_file_renameunique isc_file_safemovefile isc_file_settime isc_file_template isc_file_truncate isc_fsaccess_add isc_fsaccess_changeowner isc_fsaccess_remove isc_fsaccess_set isc_hash_calc isc_hash_create isc_hash_ctxattach isc_hash_ctxcalc isc_hash_ctxcreate isc_hash_ctxdetach isc_hash_ctxinit isc_hash_destroy isc_hash_init isc_heap_create isc_heap_decreased isc_heap_delete isc_heap_destroy isc_heap_element isc_heap_increased isc_heap_insert isc_hex_decodestring isc_hex_tobuffer isc_hex_totext isc_hmacmd5_init isc_hmacmd5_invalidate isc_hmacmd5_sign isc_hmacmd5_update isc_hmacmd5_verify isc_hmacmd5_verify2 isc_hmacsha1_init isc_hmacsha1_invalidate isc_hmacsha1_sign isc_hmacsha1_update isc_hmacsha1_verify isc_hmacsha224_init isc_hmacsha224_invalidate isc_hmacsha224_sign isc_hmacsha224_update isc_hmacsha224_verify isc_hmacsha256_init isc_hmacsha256_invalidate isc_hmacsha256_sign isc_hmacsha256_update isc_hmacsha256_verify isc_hmacsha384_init isc_hmacsha384_invalidate isc_hmacsha384_sign isc_hmacsha384_update isc_hmacsha384_verify isc_hmacsha512_init isc_hmacsha512_invalidate isc_hmacsha512_sign isc_hmacsha512_update isc_hmacsha512_verify isc_httpdmgr_addurl isc_httpdmgr_create isc_httpdmgr_shutdown isc_interfaceiter_create isc_interfaceiter_current isc_interfaceiter_destroy isc_interfaceiter_first isc_interfaceiter_next isc_interval_iszero isc_interval_set isc_iterated_hash isc_keyboard_canceled isc_keyboard_close isc_keyboard_getchar isc_keyboard_open isc_lex_close isc_lex_create isc_lex_destroy isc_lex_getcomments isc_lex_getlasttokentext isc_lex_getmastertoken isc_lex_getoctaltoken isc_lex_getsourceline isc_lex_getsourcename isc_lex_getspecials isc_lex_gettoken isc_lex_isfile isc_lex_openbuffer isc_lex_openfile isc_lex_openstream isc_lex_setcomments isc_lex_setspecials isc_lex_ungettoken isc_lfsr_generate isc_lfsr_generate32 isc_lfsr_init isc_lfsr_skip isc_lib_initmsgcat isc_log_categorybyname isc_log_closefilelogs isc_log_create isc_log_createchannel isc_log_destroy isc_log_getdebuglevel isc_log_getduplicateinterval isc_log_gettag isc_log_ivwrite isc_log_ivwrite1 isc_log_iwrite isc_log_iwrite1 isc_log_modulebyname isc_log_opensyslog isc_log_registercategories isc_log_registermodules isc_log_setcontext isc_log_setdebuglevel isc_log_setduplicateinterval isc_log_settag isc_log_usechannel isc_log_vwrite isc_log_vwrite1 isc_log_wouldlog isc_log_write isc_log_write1 isc_logconfig_create isc_logconfig_destroy isc_logconfig_get isc_logconfig_use isc_md5_final isc_md5_init isc_md5_invalidate isc_md5_update isc_mem_attach isc_mem_checkdestroyed isc_mem_create isc_mem_create2 isc_mem_createx isc_mem_createx2 isc_mem_destroy isc_mem_detach isc_mem_getname isc_mem_getquota isc_mem_gettag isc_mem_inuse isc_mem_ondestroy isc_mem_references isc_mem_setdestroycheck isc_mem_setname isc_mem_setquota isc_mem_setwater isc_mem_stats isc_mem_waterack isc_mempool_associatelock isc_mempool_create isc_mempool_destroy isc_mempool_getallocated isc_mempool_getfillcount isc_mempool_getfreecount isc_mempool_getfreemax isc_mempool_getmaxalloc isc_mempool_setfillcount isc_mempool_setfreemax isc_mempool_setmaxalloc isc_mempool_setname isc_msgcat_close isc_msgcat_get isc_msgcat_open isc_mutexblock_destroy isc_mutexblock_init isc_net_aton isc_net_disableipv4 isc_net_disableipv6 isc_net_getudpportrange isc_net_ntop isc_net_probe_ipv6only isc_net_probe_ipv6pktinfo isc_net_probeipv4 isc_net_probeipv6 isc_net_probeunix isc_net_pton isc_netaddr_any isc_netaddr_any6 isc_netaddr_eqprefix isc_netaddr_equal isc_netaddr_format isc_netaddr_fromin isc_netaddr_fromin6 isc_netaddr_frompath isc_netaddr_fromsockaddr isc_netaddr_fromv4mapped isc_netaddr_ismulticast isc_netaddr_masktoprefixlen isc_netaddr_prefixok isc_netaddr_setzone isc_netaddr_totext isc_netscope_pton isc_ntpaths_get isc_ntpaths_init isc_once_do isc_ondestroy_init isc_ondestroy_notify isc_ondestroy_register isc_os_ncpus isc_parse_uint16 isc_parse_uint32 isc_parse_uint8 isc_portset_add isc_portset_addrange isc_portset_create isc_portset_destroy isc_portset_isset isc_portset_nports isc_portset_remove isc_portset_removerange isc_quota_attach isc_quota_destroy isc_quota_detach isc_quota_init isc_quota_max isc_quota_release isc_quota_reserve isc_quota_soft isc_radix_create isc_radix_destroy isc_radix_insert isc_radix_process isc_radix_remove isc_radix_search isc_random_get isc_random_jitter isc_random_seed isc_ratelimiter_attach isc_ratelimiter_create isc_ratelimiter_detach isc_ratelimiter_enqueue isc_ratelimiter_setinterval isc_ratelimiter_setpertic isc_ratelimiter_shutdown isc_refcount_init isc_region_compare isc_resource_getcurlimit isc_resource_getlimit isc_resource_setlimit isc_result_register isc_result_totext isc_rwlock_destroy isc_rwlock_downgrade isc_rwlock_init isc_rwlock_lock isc_rwlock_trylock isc_rwlock_tryupgrade isc_rwlock_unlock isc_serial_eq isc_serial_ge isc_serial_gt isc_serial_le isc_serial_lt isc_serial_ne isc_sha1_final isc_sha1_init isc_sha1_invalidate isc_sha1_update isc_sha224_final isc_sha224_init isc_sha224_update isc_sha256_final isc_sha256_init isc_sha256_update isc_sha384_final isc_sha384_init isc_sha384_update isc_sha512_final isc_sha512_init isc_sha512_update isc_sockaddr_any isc_sockaddr_any6 isc_sockaddr_anyofpf isc_sockaddr_compare isc_sockaddr_eqaddr isc_sockaddr_eqaddrprefix isc_sockaddr_equal isc_sockaddr_format isc_sockaddr_fromin isc_sockaddr_fromin6 isc_sockaddr_fromnetaddr isc_sockaddr_frompath isc_sockaddr_getport isc_sockaddr_hash isc_sockaddr_isexperimental isc_sockaddr_ismulticast isc_sockaddr_pf isc_sockaddr_setport isc_sockaddr_totext isc_sockaddr_v6fromin isc_socket_accept isc_socket_attach isc_socket_bind isc_socket_cancel isc_socket_cleanunix isc_socket_close isc_socket_connect isc_socket_create isc_socket_detach isc_socket_filter isc_socket_getname isc_socket_getpeername isc_socket_getsockname isc_socket_gettag isc_socket_gettype isc_socket_ipv6only isc_socket_isbound isc_socket_listen isc_socket_open isc_socket_permunix isc_socket_recv isc_socket_recv2 isc_socket_recvv isc_socket_send isc_socket_sendto isc_socket_sendto2 isc_socket_sendtov isc_socket_sendv isc_socket_setname isc_socketmgr_create isc_socketmgr_create2 isc_socketmgr_destroy isc_socketmgr_getmaxsockets isc_socketmgr_setstats isc_stats_create isc_stats_attach isc_stats_detach isc_stats_ncounters isc_stats_increment isc_stats_decrement isc_stats_dump isc_stdio_close isc_stdio_flush isc_stdio_open isc_stdio_read isc_stdio_seek isc_stdio_sync isc_stdio_write isc_stdtime_get isc_string_append isc_string_append_truncate isc_string_copy isc_string_copy_truncate isc_string_printf isc_string_printf_truncate isc_string_regiondup isc_string_separate isc_string_strlcat isc_string_strlcpy isc_string_touint64 isc_symtab_create isc_symtab_define isc_symtab_destroy isc_symtab_lookup isc_symtab_undefine isc_syslog_facilityfromstring isc_task_attach isc_task_beginexclusive isc_task_create isc_task_destroy isc_task_detach isc_task_endexclusive isc_task_getcurrenttime isc_task_getname isc_task_gettag isc_task_onshutdown isc_task_purge isc_task_purgeevent isc_task_purgerange isc_task_send isc_task_sendanddetach isc_task_setname isc_task_shutdown isc_task_unsend isc_task_unsendrange isc_taskmgr_create isc_taskmgr_destroy isc_taskpool_create isc_taskpool_destroy isc_taskpool_gettask isc_thread_create isc_thread_join isc_thread_key_create isc_thread_key_delete isc_thread_key_getspecific isc_thread_key_setspecific isc_thread_setconcurrency isc_time_add isc_time_compare isc_time_isepoch isc_time_microdiff isc_time_nanoseconds isc_time_now isc_time_nowplusinterval isc_time_seconds isc_time_set isc_time_settoepoch isc_time_subtract isc_timer_attach isc_timer_create isc_timer_detach isc_timer_reset isc_timer_touch isc_timermgr_create isc_timermgr_destroy isc_timermgr_poke isc_win32os_majorversion isc_win32os_minorversion isc_win32os_servicepackmajor isc_win32os_servicepackminor isc_win32os_versioncheck openlog syslog ; Exported Data EXPORTS isc_assertion_failed DATA isc_commandline_argument DATA isc_commandline_errprint DATA isc_commandline_index DATA isc_commandline_option DATA isc_commandline_progname DATA isc_commandline_reset DATA isc_mem_debugging DATA ntp-4.2.6p5/lib/isc/win32/stdtime.c0000644000175000017500000000226611505336022015717 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: stdtime.c,v 1.12 2007/06/19 23:47:19 tbox Exp $ */ #include #include #include #include #include void isc_stdtime_get(isc_stdtime_t *t) { /* * Set 't' to the number of seconds past 00:00:00 UTC, January 1, 1970. */ REQUIRE(t != NULL); (void)time((time_t *)t); } ntp-4.2.6p5/lib/isc/win32/strerror.c0000644000175000017500000002360711307651603016137 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001, 2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: strerror.c,v 1.8 2007/06/19 23:47:19 tbox Exp $ */ #include #include #include #include #include #include #include #include #include /* * Forward declarations */ char * FormatError(int error); char * GetWSAErrorMessage(int errval); char * NTstrerror(int err, BOOL *bfreebuf); /* * We need to do this this way for profiled locks. */ static isc_mutex_t isc_strerror_lock; static void init_lock(void) { RUNTIME_CHECK(isc_mutex_init(&isc_strerror_lock) == ISC_R_SUCCESS); } /* * This routine needs to free up any buffer allocated by FormatMessage * if that routine gets used. */ void isc__strerror(int num, char *buf, size_t size) { char *msg; BOOL freebuf; unsigned int unum = num; static isc_once_t once = ISC_ONCE_INIT; REQUIRE(buf != NULL); RUNTIME_CHECK(isc_once_do(&once, init_lock) == ISC_R_SUCCESS); LOCK(&isc_strerror_lock); freebuf = FALSE; msg = NTstrerror(num, &freebuf); if (msg != NULL) snprintf(buf, size, "%s", msg); else snprintf(buf, size, "Unknown error: %u", unum); if(freebuf && msg != NULL) { LocalFree(msg); } UNLOCK(&isc_strerror_lock); } /* * Note this will cause a memory leak unless the memory allocated here * is freed by calling LocalFree. isc__strerror does this before unlocking. * This only gets called if there is a system type of error and will likely * be an unusual event. */ char * FormatError(int error) { LPVOID lpMsgBuf = NULL; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error, /* Default language */ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); return (lpMsgBuf); } /* * This routine checks the error value and calls the WSA Windows Sockets * Error message function GetWSAErrorMessage below if it's within that range * since those messages are not available in the system error messages. */ char * NTstrerror(int err, BOOL *bfreebuf) { char *retmsg = NULL; /* Copy the error value first in case of other errors */ DWORD errval = err; *bfreebuf = FALSE; /* Get the Winsock2 error messages */ if (errval >= WSABASEERR && errval <= (WSABASEERR + 1015)) { retmsg = GetWSAErrorMessage(errval); if (retmsg != NULL) return (retmsg); } /* * If it's not one of the standard Unix error codes, * try a system error message */ if (errval > (DWORD) _sys_nerr) { *bfreebuf = TRUE; return (FormatError(errval)); } else { return (strerror(errval)); } } /* * This is a replacement for perror */ void __cdecl NTperror(char *errmsg) { /* Copy the error value first in case of other errors */ int errval = errno; BOOL bfreebuf = FALSE; char *msg; msg = NTstrerror(errval, &bfreebuf); fprintf(stderr, "%s: %s\n", errmsg, msg); if(bfreebuf == TRUE) { LocalFree(msg); } } /* * Return the error string related to Winsock2 errors. * This function is necessary since FormatMessage knows nothing about them * and there is no function to get them. */ char * GetWSAErrorMessage(int errval) { char *msg; switch (errval) { case WSAEINTR: msg = "Interrupted system call"; break; case WSAEBADF: msg = "Bad file number"; break; case WSAEACCES: msg = "Permission denied"; break; case WSAEFAULT: msg = "Bad address"; break; case WSAEINVAL: msg = "Invalid argument"; break; case WSAEMFILE: msg = "Too many open sockets"; break; case WSAEWOULDBLOCK: msg = "Operation would block"; break; case WSAEINPROGRESS: msg = "Operation now in progress"; break; case WSAEALREADY: msg = "Operation already in progress"; break; case WSAENOTSOCK: msg = "Socket operation on non-socket"; break; case WSAEDESTADDRREQ: msg = "Destination address required"; break; case WSAEMSGSIZE: msg = "Message too long"; break; case WSAEPROTOTYPE: msg = "Protocol wrong type for socket"; break; case WSAENOPROTOOPT: msg = "Bad protocol option"; break; case WSAEPROTONOSUPPORT: msg = "Protocol not supported"; break; case WSAESOCKTNOSUPPORT: msg = "Socket type not supported"; break; case WSAEOPNOTSUPP: msg = "Operation not supported on socket"; break; case WSAEPFNOSUPPORT: msg = "Protocol family not supported"; break; case WSAEAFNOSUPPORT: msg = "Address family not supported"; break; case WSAEADDRINUSE: msg = "Address already in use"; break; case WSAEADDRNOTAVAIL: msg = "Can't assign requested address"; break; case WSAENETDOWN: msg = "Network is down"; break; case WSAENETUNREACH: msg = "Network is unreachable"; break; case WSAENETRESET: msg = "Net connection reset"; break; case WSAECONNABORTED: msg = "Software caused connection abort"; break; case WSAECONNRESET: msg = "Connection reset by peer"; break; case WSAENOBUFS: msg = "No buffer space available"; break; case WSAEISCONN: msg = "Socket is already connected"; break; case WSAENOTCONN: msg = "Socket is not connected"; break; case WSAESHUTDOWN: msg = "Can't send after socket shutdown"; break; case WSAETOOMANYREFS: msg = "Too many references: can't splice"; break; case WSAETIMEDOUT: msg = "Connection timed out"; break; case WSAECONNREFUSED: msg = "Connection refused"; break; case WSAELOOP: msg = "Too many levels of symbolic links"; break; case WSAENAMETOOLONG: msg = "File name too long"; break; case WSAEHOSTDOWN: msg = "Host is down"; break; case WSAEHOSTUNREACH: msg = "No route to host"; break; case WSAENOTEMPTY: msg = "Directory not empty"; break; case WSAEPROCLIM: msg = "Too many processes"; break; case WSAEUSERS: msg = "Too many users"; break; case WSAEDQUOT: msg = "Disc quota exceeded"; break; case WSAESTALE: msg = "Stale NFS file handle"; break; case WSAEREMOTE: msg = "Too many levels of remote in path"; break; case WSASYSNOTREADY: msg = "Network system is unavailable"; break; case WSAVERNOTSUPPORTED: msg = "Winsock version out of range"; break; case WSANOTINITIALISED: msg = "WSAStartup not yet called"; break; case WSAEDISCON: msg = "Graceful shutdown in progress"; break; /* case WSAHOST_NOT_FOUND: msg = "Host not found"; break; case WSANO_DATA: msg = "No host data of that type was found"; break; */ default: msg = NULL; break; } return (msg); } /* * These error messages are more informative about CryptAPI Errors than the * standard error messages */ char * GetCryptErrorMessage(int errval) { char *msg; switch (errval) { case NTE_BAD_FLAGS: msg = "The dwFlags parameter has an illegal value."; break; case NTE_BAD_KEYSET: msg = "The Registry entry for the key container " "could not be opened and may not exist."; break; case NTE_BAD_KEYSET_PARAM: msg = "The pszContainer or pszProvider parameter " "is set to an illegal value."; break; case NTE_BAD_PROV_TYPE: msg = "The value of the dwProvType parameter is out " "of range. All provider types must be from " "1 to 999, inclusive."; break; case NTE_BAD_SIGNATURE: msg = "The provider DLL signature did not verify " "correctly. Either the DLL or the digital " "signature has been tampered with."; break; case NTE_EXISTS: msg = "The dwFlags parameter is CRYPT_NEWKEYSET, but the key" " container already exists."; break; case NTE_KEYSET_ENTRY_BAD: msg = "The Registry entry for the pszContainer key container " "was found (in the HKEY_CURRENT_USER window), but is " "corrupt. See the section System Administration for " " etails about CryptoAPI's Registry usage."; break; case NTE_KEYSET_NOT_DEF: msg = "No Registry entry exists in the HKEY_CURRENT_USER " "window for the key container specified by " "pszContainer."; break; case NTE_NO_MEMORY: msg = "The CSP ran out of memory during the operation."; break; case NTE_PROV_DLL_NOT_FOUND: msg = "The provider DLL file does not exist or is not on the " "current path."; break; case NTE_PROV_TYPE_ENTRY_BAD: msg = "The Registry entry for the provider type specified by " "dwProvType is corrupt. This error may relate to " "either the user default CSP list or the machine " "default CSP list. See the section System " "Administration for details about CryptoAPI's " "Registry usage."; break; case NTE_PROV_TYPE_NO_MATCH: msg = "The provider type specified by dwProvType does not " "match the provider type found in the Registry. Note " "that this error can only occur when pszProvider " "specifies an actual CSP name."; break; case NTE_PROV_TYPE_NOT_DEF: msg = "No Registry entry exists for the provider type " "specified by dwProvType."; break; case NTE_PROVIDER_DLL_FAIL: msg = "The provider DLL file could not be loaded, and " "may not exist. If it exists, then the file is " "not a valid DLL."; break; case NTE_SIGNATURE_FILE_BAD: msg = "An error occurred while loading the DLL file image, " "prior to verifying its signature."; break; default: msg = NULL; break; } return msg; } ntp-4.2.6p5/lib/isc/win32/netdb.h0000644000175000017500000001151011307651603015344 0ustar peterpeter/* * Copyright (C) 2004, 2006, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: netdb.h,v 1.7.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef NETDB_H #define NETDB_H 1 #include #include /* * Define if does not declare struct addrinfo. */ struct addrinfo { int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ int ai_family; /* PF_xxx */ int ai_socktype; /* SOCK_xxx */ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ size_t ai_addrlen; /* Length of ai_addr */ char *ai_canonname; /* Canonical name for hostname */ struct sockaddr *ai_addr; /* Binary address */ struct addrinfo *ai_next; /* Next structure in linked list */ }; /* * Undefine all \#defines we are interested in as may or may not have * defined them. */ /* * Error return codes from gethostbyname() and gethostbyaddr() * (left in extern int h_errno). */ #undef NETDB_INTERNAL #undef NETDB_SUCCESS #undef HOST_NOT_FOUND #undef TRY_AGAIN #undef NO_RECOVERY #undef NO_DATA #undef NO_ADDRESS #define NETDB_INTERNAL -1 /* see errno */ #define NETDB_SUCCESS 0 /* no problem */ #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */ #define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */ #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ #define NO_DATA 4 /* Valid name, no data record of requested type */ #define NO_ADDRESS NO_DATA /* no address, look for MX record */ /* * Error return codes from getaddrinfo() */ #undef EAI_ADDRFAMILY #undef EAI_AGAIN #undef EAI_BADFLAGS #undef EAI_FAIL #undef EAI_FAMILY #undef EAI_MEMORY #undef EAI_NODATA #undef EAI_NONAME #undef EAI_SERVICE #undef EAI_SOCKTYPE #undef EAI_SYSTEM #undef EAI_BADHINTS #undef EAI_PROTOCOL #undef EAI_MAX #define EAI_ADDRFAMILY 1 /* address family for hostname not supported */ #define EAI_AGAIN 2 /* temporary failure in name resolution */ #define EAI_BADFLAGS 3 /* invalid value for ai_flags */ #define EAI_FAIL 4 /* non-recoverable failure in name resolution */ #define EAI_FAMILY 5 /* ai_family not supported */ #define EAI_MEMORY 6 /* memory allocation failure */ #define EAI_NODATA 7 /* no address associated with hostname */ #define EAI_NONAME 8 /* hostname nor servname provided, or not known */ #define EAI_SERVICE 9 /* servname not supported for ai_socktype */ #define EAI_SOCKTYPE 10 /* ai_socktype not supported */ #define EAI_SYSTEM 11 /* system error returned in errno */ #define EAI_BADHINTS 12 #define EAI_PROTOCOL 13 #define EAI_MAX 14 /* * Flag values for getaddrinfo() */ #undef AI_PASSIVE #undef AI_CANONNAME #undef AI_NUMERICHOST #define AI_PASSIVE 0x00000001 #define AI_CANONNAME 0x00000002 #define AI_NUMERICHOST 0x00000004 /* * Flag values for getipnodebyname() */ #undef AI_V4MAPPED #undef AI_ALL #undef AI_ADDRCONFIG #undef AI_DEFAULT #define AI_V4MAPPED 0x00000008 #define AI_ALL 0x00000010 #define AI_ADDRCONFIG 0x00000020 #define AI_DEFAULT (AI_V4MAPPED|AI_ADDRCONFIG) /* * Constants for getnameinfo() */ #undef NI_MAXHOST #undef NI_MAXSERV #define NI_MAXHOST 1025 #define NI_MAXSERV 32 /* * Flag values for getnameinfo() */ #undef NI_NOFQDN #undef NI_NUMERICHOST #undef NI_NAMEREQD #undef NI_NUMERICSERV #undef NI_DGRAM #undef NI_NUMERICSCOPE #define NI_NOFQDN 0x00000001 #define NI_NUMERICHOST 0x00000002 #define NI_NAMEREQD 0x00000004 #define NI_NUMERICSERV 0x00000008 #define NI_DGRAM 0x00000010 #define NI_NUMERICSCOPE 0x00000020 /*2553bis-00*/ /* * Structures for getrrsetbyname() */ struct rdatainfo { unsigned int rdi_length; unsigned char *rdi_data; }; struct rrsetinfo { unsigned int rri_flags; int rri_rdclass; int rri_rdtype; unsigned int rri_ttl; unsigned int rri_nrdatas; unsigned int rri_nsigs; char *rri_name; struct rdatainfo *rri_rdatas; struct rdatainfo *rri_sigs; }; /* * Flags for getrrsetbyname() */ #define RRSET_VALIDATED 0x00000001 /* Set was dnssec validated */ /* * Return codes for getrrsetbyname() */ #define ERRSET_SUCCESS 0 #define ERRSET_NOMEMORY 1 #define ERRSET_FAIL 2 #define ERRSET_INVAL 3 #endif /* NETDB_H */ ntp-4.2.6p5/lib/isc/win32/win32os.c0000644000175000017500000000530711307651603015556 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: win32os.c,v 1.5 2007/06/19 23:47:19 tbox Exp $ */ #include #include static BOOL bInit = FALSE; static OSVERSIONINFOEX osVer; static void initialize_action(void) { BOOL bSuccess; if (bInit) return; /* * NOTE: VC++ 6.0 gets this function declaration wrong * so we compensate by casting the argument */ osVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); bSuccess = GetVersionEx((OSVERSIONINFO *) &osVer); /* * Versions of NT before NT4.0 SP6 did not return the * extra info that the EX structure provides and returns * a failure so we need to retry with the old structure. */ if(!bSuccess) { osVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); bSuccess = GetVersionEx((OSVERSIONINFO *) &osVer); } bInit = TRUE; } unsigned int isc_win32os_majorversion(void) { initialize_action(); return ((unsigned int)osVer.dwMajorVersion); } unsigned int isc_win32os_minorversion(void) { initialize_action(); return ((unsigned int)osVer.dwMinorVersion); } unsigned int isc_win32os_servicepackmajor(void) { initialize_action(); return ((unsigned int)osVer.wServicePackMajor); } unsigned int isc_win32os_servicepackminor(void) { initialize_action(); return ((unsigned int)osVer.wServicePackMinor); } int isc_win32os_versioncheck(unsigned int major, unsigned int minor, unsigned int spmajor, unsigned int spminor) { initialize_action(); if (major < isc_win32os_majorversion()) return (1); if (major > isc_win32os_majorversion()) return (-1); if (minor < isc_win32os_minorversion()) return (1); if (minor > isc_win32os_minorversion()) return (-1); if (spmajor < isc_win32os_servicepackmajor()) return (1); if (spmajor > isc_win32os_servicepackmajor()) return (-1); if (spminor < isc_win32os_servicepackminor()) return (1); if (spminor > isc_win32os_servicepackminor()) return (-1); /* Exact */ return (0); }ntp-4.2.6p5/lib/isc/win32/libisc.dsw0000644000175000017500000000077411307651603016075 0ustar peterpeterMicrosoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "libisc"=".\libisc.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ntp-4.2.6p5/lib/isc/win32/thread.c0000644000175000017500000000445211307651603015521 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: thread.c,v 1.24 2007/06/19 23:47:19 tbox Exp $ */ #include #include #include isc_result_t isc_thread_create(isc_threadfunc_t start, isc_threadarg_t arg, isc_thread_t *threadp) { isc_thread_t thread; unsigned int id; thread = (isc_thread_t)_beginthreadex(NULL, 0, start, arg, 0, &id); if (thread == NULL) { /* XXX */ return (ISC_R_UNEXPECTED); } *threadp = thread; return (ISC_R_SUCCESS); } isc_result_t isc_thread_join(isc_thread_t thread, isc_threadresult_t *rp) { DWORD result; DWORD threadrc; result = WaitForSingleObject(thread, INFINITE); if (result != WAIT_OBJECT_0) { /* XXX */ return (ISC_R_UNEXPECTED); } if (rp != NULL) { if(!GetExitCodeThread(thread, &threadrc)) { /* XXX */ return (ISC_R_UNEXPECTED); } *rp = threadrc; } (void)CloseHandle(thread); return (ISC_R_SUCCESS); } void isc_thread_setconcurrency(unsigned int level) { /* * This is unnecessary on Win32 systems, but is here so that the * call exists */ } void * isc_thread_key_getspecific(isc_thread_key_t key) { return(TlsGetValue(key)); } int isc_thread_key_setspecific(isc_thread_key_t key, void *value) { return (TlsSetValue(key, value) ? 0 : GetLastError()); } int isc_thread_key_create(isc_thread_key_t *key, void (*func)(void *)) { *key = TlsAlloc(); return ((*key != -1) ? 0 : GetLastError()); } int isc_thread_key_delete(isc_thread_key_t key) { return (TlsFree(key) ? 0 : GetLastError()); } ntp-4.2.6p5/lib/isc/win32/interfaceiter.c0000644000175000017500000005332511505336022017074 0ustar peterpeter/* * Copyright (C) 2004, 2007-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: interfaceiter.c,v 1.13.110.2 2009/01/18 23:47:41 tbox Exp $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void InitSockets(void); #define IFITER_MAGIC 0x49464954U /* IFIT. */ #define VALID_IFITER(t) ((t) != NULL && (t)->magic == IFITER_MAGIC) struct isc_interfaceiter { unsigned int magic; /* Magic number. */ /* common fields */ isc_mem_t *mctx; isc_interface_t current; /* Current interface data. */ isc_result_t result; /* Last result code. */ /* fields used if GetAdaptersAddresses is available at runtime */ IP_ADAPTER_ADDRESSES * ipaa; /* GAA() result buffer */ ULONG ipaasize; /* Bytes allocated */ IP_ADAPTER_ADDRESSES * ipaaCur; /* enumeration position */ IP_ADAPTER_UNICAST_ADDRESS *ipuaCur; /* enumeration subposition */ /* fields used for the older address enumeration ioctls */ int socket; INTERFACE_INFO IFData; /* Current Interface Info */ int numIF; /* Current Interface count */ int v4IF; /* Number of IPv4 Interfaces */ INTERFACE_INFO *buf4; /* Buffer for WSAIoctl data. */ unsigned int buf4size; /* Bytes allocated. */ INTERFACE_INFO *pos4; /* Current offset in IF List */ SOCKET_ADDRESS_LIST *buf6; unsigned int buf6size; /* Bytes allocated. */ unsigned int pos6; /* buf6 index, counts down */ struct in6_addr loop__1; /* ::1 node-scope localhost */ struct in6_addr loopfe80__1; /* fe80::1 link-scope localhost */ }; typedef ULONG (WINAPI *PGETADAPTERSADDRESSES)( ULONG Family, ULONG Flags, PVOID Reserved, PIP_ADAPTER_ADDRESSES AdapterAddresses, PULONG SizePointer ); static isc_boolean_t use_GAA; static isc_boolean_t use_GAA_determined; static HMODULE hmod_iphlpapi; static PGETADAPTERSADDRESSES pGAA; /* * Size of buffer for SIO_GET_INTERFACE_LIST, in number of interfaces. * We assume no sane system will have more than than 1K of IP addresses on * all of its adapters. */ #define IFCONF_SIZE_INITIAL 16 #define IFCONF_SIZE_INCREMENT 64 #define IFCONF_SIZE_MAX 1040 /* Common utility functions */ /* * Windows always provides 255.255.255.255 as the the broadcast * address. ntpd needs to know the broadcast address which will target * only that network interface, not all. Reconstruct it from the * address and mask. */ static void get_broadcastaddr(isc_netaddr_t *bcastaddr, isc_netaddr_t *addr, isc_netaddr_t *netmask) { isc_uint32_t * b; isc_uint32_t a, n; b = (isc_uint32_t *)&bcastaddr->type.in; a = *(isc_uint32_t *)&addr->type.in; n = *(isc_uint32_t *)&netmask->type.in; *b = a | ~n; } isc_result_t isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) { char strbuf[ISC_STRERRORSIZE]; isc_interfaceiter_t *iter; isc_result_t result; unsigned int major; unsigned int minor; unsigned int spmajor; ULONG err; int tries; int error; unsigned long bytesReturned = 0; REQUIRE(mctx != NULL); REQUIRE(iterp != NULL); REQUIRE(*iterp == NULL); iter = isc_mem_get(mctx, sizeof(*iter)); if (iter == NULL) return (ISC_R_NOMEMORY); InitSockets(); iter->mctx = mctx; iter->ipaa = NULL; iter->buf4 = NULL; iter->buf6 = NULL; iter->pos4 = NULL; iter->ipaaCur = NULL; iter->ipuaCur = NULL; iter->ipaasize = 0; iter->pos6 = 0; iter->buf6size = 0; iter->buf4size = 0; iter->result = ISC_R_FAILURE; iter->numIF = 0; iter->v4IF = 0; /* * Use GetAdaptersAddresses in preference to ioctls when running * on Windows XP SP1 or later. Earlier GetAdaptersAddresses do * not appear to provide enough information to associate unicast * addresses with their prefixes. */ if (!use_GAA_determined) { major = isc_win32os_majorversion(); minor = isc_win32os_minorversion(); spmajor = isc_win32os_servicepackmajor(); if (major > 5 || (5 == major && (minor > 1 || (1 == minor && spmajor >= 1)))) { if (NULL == hmod_iphlpapi) hmod_iphlpapi = LoadLibrary("iphlpapi"); if (NULL != hmod_iphlpapi) pGAA = (PGETADAPTERSADDRESSES) GetProcAddress( hmod_iphlpapi, "GetAdaptersAddresses"); if (NULL != pGAA) use_GAA = ISC_TRUE; } use_GAA_determined = ISC_TRUE; } if (!use_GAA) goto use_ioctls; iter->ipaasize = 16 * 1024; for (tries = 0; tries < 5; tries++) { iter->ipaa = isc_mem_reallocate(mctx, iter->ipaa, iter->ipaasize); if (NULL == iter->ipaa) { result = ISC_R_NOMEMORY; goto put_iter; } err = (*pGAA)( AF_UNSPEC, GAA_FLAG_INCLUDE_PREFIX | GAA_FLAG_SKIP_ANYCAST, NULL, iter->ipaa, &iter->ipaasize); if (NO_ERROR == err || ERROR_BUFFER_OVERFLOW != err) break; } if (NO_ERROR != err) { isc__strerror(err, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "GetAdaptersAddresses: %s", strbuf); result = ISC_R_UNEXPECTED; goto gaa_failure; } iter->ipaaCur = iter->ipaa; goto success; use_ioctls: /* * Create an unbound datagram socket to do the * SIO_GET_INTERFACE_LIST WSAIoctl on. */ if ((iter->socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { error = WSAGetLastError(); if (error == WSAEAFNOSUPPORT) goto inet6_only; isc__strerror(error, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "making interface scan socket: %s", strbuf); result = ISC_R_UNEXPECTED; goto put_iter; } /* * Get the interface configuration, allocating more memory if * necessary. */ iter->buf4size = IFCONF_SIZE_INITIAL*sizeof(INTERFACE_INFO); for (;;) { iter->buf4 = isc_mem_get(mctx, iter->buf4size); if (iter->buf4 == NULL) { result = ISC_R_NOMEMORY; goto alloc_failure; } if (WSAIoctl(iter->socket, SIO_GET_INTERFACE_LIST, 0, 0, iter->buf4, iter->buf4size, &bytesReturned, 0, 0) == SOCKET_ERROR) { error = WSAGetLastError(); if (error != WSAEFAULT && error != WSAENOBUFS) { errno = error; isc__strerror(error, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "get interface configuration: %s", strbuf); result = ISC_R_UNEXPECTED; goto ioctl_failure; } /* * EINVAL. Retry with a bigger buffer. */ } else { /* * The WSAIoctl succeeded. * If the number of the returned bytes is the same * as the buffer size, we will grow it just in * case and retry. */ if (bytesReturned > 0 && (bytesReturned < iter->buf4size)) break; } if (iter->buf4size >= IFCONF_SIZE_MAX*sizeof(INTERFACE_INFO)) { UNEXPECTED_ERROR(__FILE__, __LINE__, "get interface configuration: " "maximum buffer size exceeded"); result = ISC_R_UNEXPECTED; goto ioctl_failure; } isc_mem_put(mctx, iter->buf4, iter->buf4size); iter->buf4size += IFCONF_SIZE_INCREMENT * sizeof(INTERFACE_INFO); } /* * A newly created iterator has an undefined position * until isc_interfaceiter_first() is called. */ iter->v4IF = bytesReturned/sizeof(INTERFACE_INFO); /* We don't need the socket any more, so close it */ closesocket(iter->socket); inet6_only: /* * Create an unbound datagram socket to do the * SIO_ADDRESS_LIST_QUERY WSAIoctl on. */ if ((iter->socket = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { error = WSAGetLastError(); if (error == WSAEAFNOSUPPORT) goto success; isc__strerror(error, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "making interface scan socket: %s", strbuf); result = ISC_R_UNEXPECTED; goto put_iter; } /* * Get the interface configuration, allocating more memory if * necessary. */ iter->buf6size = sizeof(SOCKET_ADDRESS_LIST) + IFCONF_SIZE_INITIAL*sizeof(SOCKET_ADDRESS); for (;;) { iter->buf6 = isc_mem_get(mctx, iter->buf6size); if (iter->buf6 == NULL) { result = ISC_R_NOMEMORY; goto ioctl_failure; } if (WSAIoctl(iter->socket, SIO_ADDRESS_LIST_QUERY, 0, 0, iter->buf6, iter->buf6size, &bytesReturned, 0, 0) == SOCKET_ERROR) { error = WSAGetLastError(); if (error != WSAEFAULT && error != WSAENOBUFS) { errno = error; isc__strerror(error, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "sio address list query: %s", strbuf); result = ISC_R_UNEXPECTED; goto ioctl6_failure; } /* * EINVAL. Retry with a bigger buffer. */ } else break; if (iter->buf6size >= IFCONF_SIZE_MAX*sizeof(SOCKET_ADDRESS)) { UNEXPECTED_ERROR(__FILE__, __LINE__, "get interface configuration: " "maximum buffer size exceeded"); result = ISC_R_UNEXPECTED; goto ioctl6_failure; } isc_mem_put(mctx, iter->buf6, iter->buf6size); iter->buf6size += IFCONF_SIZE_INCREMENT * sizeof(SOCKET_ADDRESS); } /* * initialize loop__1 to [::1] and loopfe80__1 to [fe80::1]. * used by internal_current6(). */ memset(&iter->loop__1, 0, sizeof(iter->loop__1)); memset(&iter->loopfe80__1, 0, sizeof(iter->loopfe80__1)); iter->loop__1.s6_addr[15] = 1; iter->loopfe80__1.s6_addr[15] = 1; iter->loopfe80__1.s6_addr[0] = 0xfe; iter->loopfe80__1.s6_addr[1] = 0x80; closesocket(iter->socket); success: iter->magic = IFITER_MAGIC; *iterp = iter; return (ISC_R_SUCCESS); gaa_failure: isc_mem_put(mctx, iter->ipaa, iter->ipaasize); goto put_iter; ioctl6_failure: isc_mem_put(mctx, iter->buf6, iter->buf6size); ioctl_failure: if (iter->buf4 != NULL) isc_mem_put(mctx, iter->buf4, iter->buf4size); alloc_failure: if (iter->socket >= 0) (void) closesocket(iter->socket); put_iter: isc_mem_put(mctx, iter, sizeof(*iter)); return (result); } static unsigned char GAA_find_prefix(isc_interfaceiter_t *iter) { IP_ADAPTER_PREFIX * ipap; IP_ADAPTER_PREFIX * ipap_match; int match_len; int max_len; isc_netaddr_t target; u_short af; isc_netaddr_t pfx; int pfx_len; size_t nbytes; unsigned char nbits; unsigned char * pbits; unsigned int octets; match_len = 0; ipap_match = NULL; isc_netaddr_fromsockaddr(&target, (isc_sockaddr_t *)iter->ipuaCur->Address.lpSockaddr); af = (u_short)target.family; INSIST(AF_INET == af || AF_INET6 == af); max_len = (AF_INET6 == af) ? 128 : 32; iter->current.netmask.family = af; for (ipap = iter->ipaaCur->FirstPrefix; ipap != NULL; ipap = ipap->Next) { if (ipap->Address.lpSockaddr->sa_family != af) continue; isc_netaddr_fromsockaddr(&pfx, (isc_sockaddr_t *)ipap->Address.lpSockaddr); pfx_len = ipap->PrefixLength; INSIST(0 <= pfx_len && pfx_len <= max_len); if (pfx_len > match_len && pfx_len < max_len && isc_netaddr_eqprefix(&target, &pfx, pfx_len)) { ipap_match = ipap; match_len = pfx_len; } } if (NULL == ipap_match) { /* presume all-ones mask */ if (AF_INET6 == af) octets = sizeof(iter->current.netmask.type.in6); else octets = sizeof(iter->current.netmask.type.in); memset(&iter->current.netmask.type, 0xFF, octets); return (8 * (unsigned char)octets); } nbytes = match_len / 8; nbits = match_len % 8; memset(&iter->current.netmask.type.in6, 0xFF, nbytes); pbits = (void *)&iter->current.netmask.type.in6; pbits += nbytes; *pbits |= 0xFF << (8 - nbits); return ((unsigned char)match_len); } static isc_result_t internal_current_GAA(isc_interfaceiter_t *iter) { IP_ADAPTER_ADDRESSES *adap; IP_ADAPTER_UNICAST_ADDRESS *addr; unsigned char prefix_len; REQUIRE(iter->ipaaCur != NULL); REQUIRE(iter->ipuaCur != NULL); adap = iter->ipaaCur; addr = iter->ipuaCur; if (IpDadStatePreferred != addr->DadState) return (ISC_R_IGNORE); memset(&iter->current, 0, sizeof(iter->current)); iter->current.af = addr->Address.lpSockaddr->sa_family; isc_netaddr_fromsockaddr(&iter->current.address, (isc_sockaddr_t *)addr->Address.lpSockaddr); if (AF_INET6 == iter->current.af) iter->current.ifindex = adap->Ipv6IfIndex; iter->current.name[0] = '\0'; WideCharToMultiByte( CP_ACP, 0, adap->FriendlyName, -1, iter->current.name, sizeof(iter->current.name), NULL, NULL); iter->current.name[sizeof(iter->current.name) - 1] = '\0'; if (IfOperStatusUp == adap->OperStatus) iter->current.flags |= INTERFACE_F_UP; if (IF_TYPE_PPP == adap->IfType) iter->current.flags |= INTERFACE_F_POINTTOPOINT; else if (IF_TYPE_SOFTWARE_LOOPBACK == adap->IfType) iter->current.flags |= INTERFACE_F_LOOPBACK; if ((IP_ADAPTER_NO_MULTICAST & adap->Flags) == 0) iter->current.flags |= INTERFACE_F_MULTICAST; if (IpSuffixOriginRandom == addr->SuffixOrigin) iter->current.flags |= INTERFACE_F_PRIVACY; prefix_len = GAA_find_prefix(iter); /* I'm failing to see a broadcast flag via GAA */ if (AF_INET == iter->current.af && prefix_len < 32 && (INTERFACE_F_LOOPBACK & iter->current.flags) == 0) { iter->current.flags |= INTERFACE_F_BROADCAST; get_broadcastaddr(&iter->current.broadcast, &iter->current.address, &iter->current.netmask); } return (ISC_R_SUCCESS); } /* * Get information about the current interface to iter->current. * If successful, return ISC_R_SUCCESS. * If the interface has an unsupported address family, or if * some operation on it fails, return ISC_R_IGNORE to make * the higher-level iterator code ignore it. */ static isc_result_t internal_current(isc_interfaceiter_t *iter) { BOOL ifNamed = FALSE; unsigned long flags; REQUIRE(VALID_IFITER(iter)); REQUIRE(iter->numIF >= 0); memset(&iter->current, 0, sizeof(iter->current)); iter->current.af = AF_INET; isc_netaddr_fromsockaddr(&iter->current.address, (isc_sockaddr_t *)&(iter->IFData.iiAddress)); /* * Get interface flags. */ iter->current.flags = 0; flags = iter->IFData.iiFlags; if ((flags & IFF_UP) != 0) iter->current.flags |= INTERFACE_F_UP; if ((flags & IFF_BROADCAST) != 0) iter->current.flags |= INTERFACE_F_BROADCAST; if ((flags & IFF_MULTICAST) != 0) iter->current.flags |= INTERFACE_F_MULTICAST; if ((flags & IFF_POINTTOPOINT) != 0) { iter->current.flags |= INTERFACE_F_POINTTOPOINT; snprintf(iter->current.name, sizeof(iter->current.name), "PPP %d", iter->numIF); ifNamed = TRUE; } if ((flags & IFF_LOOPBACK) != 0) { iter->current.flags |= INTERFACE_F_LOOPBACK; snprintf(iter->current.name, sizeof(iter->current.name), "v4loop %d", iter->numIF); ifNamed = TRUE; } /* * If the interface is point-to-point, get the destination address. */ if ((iter->current.flags & INTERFACE_F_POINTTOPOINT) != 0) isc_netaddr_fromsockaddr(&iter->current.dstaddress, (isc_sockaddr_t *)&(iter->IFData.iiBroadcastAddress)); /* * Get the network mask. */ isc_netaddr_fromsockaddr(&iter->current.netmask, (isc_sockaddr_t *)&(iter->IFData.iiNetmask)); /* * If the interface is broadcast, get the broadcast address, * based on the unicast address and network mask. */ if ((iter->current.flags & INTERFACE_F_BROADCAST) != 0) get_broadcastaddr(&iter->current.broadcast, &iter->current.address, &iter->current.netmask); if (ifNamed == FALSE) snprintf(iter->current.name, sizeof(iter->current.name), "IPv4 %d", iter->numIF); return (ISC_R_SUCCESS); } static isc_result_t internal_current6(isc_interfaceiter_t *iter) { BOOL ifNamed = FALSE; struct sockaddr_in6 *psa6; BOOL localhostSeen; int i; REQUIRE(VALID_IFITER(iter)); REQUIRE(iter->pos6 >= 0); REQUIRE(iter->buf6 != 0); memset(&iter->current, 0, sizeof(iter->current)); iter->current.af = AF_INET6; /* * synthesize localhost ::1 before returning the rest, if ::1 * is not on the list. */ if (iter->pos6 >= (unsigned)iter->buf6->iAddressCount) { localhostSeen = FALSE; for (i = 0; i < iter->buf6->iAddressCount; i++) { psa6 = (struct sockaddr_in6 *) iter->buf6->Address[i].lpSockaddr; if (!memcmp(&iter->loop__1, &psa6->sin6_addr, sizeof(iter->loop__1))) { localhostSeen = TRUE; break; } } if (localhostSeen) iter->pos6 = iter->buf6->iAddressCount - 1; } if (iter->pos6 < (unsigned)iter->buf6->iAddressCount) { isc_netaddr_fromsockaddr(&iter->current.address, (isc_sockaddr_t *)iter->buf6->Address[iter->pos6].lpSockaddr); } else { iter->current.address.family = AF_INET6; memcpy(&iter->current.address.type.in6, &iter->loop__1, sizeof(iter->current.address.type.in6)); } /* * Get interface flags. */ iter->current.flags = INTERFACE_F_UP | INTERFACE_F_MULTICAST; if (!memcmp(&iter->current.address.type.in6, &iter->loop__1, sizeof(iter->current.address.type.in6)) || !memcmp(&iter->current.address.type.in6, &iter->loopfe80__1, sizeof(iter->current.address.type.in6))) { iter->current.flags |= INTERFACE_F_LOOPBACK; snprintf(iter->current.name, sizeof(iter->current.name), "v6loop %d", iter->buf6->iAddressCount - iter->pos6); ifNamed = TRUE; } if (ifNamed == FALSE) snprintf(iter->current.name, sizeof(iter->current.name), "IPv6 %d", iter->buf6->iAddressCount - iter->pos6); memset(iter->current.netmask.type.in6.s6_addr, 0xff, sizeof(iter->current.netmask.type.in6.s6_addr)); iter->current.netmask.family = AF_INET6; return (ISC_R_SUCCESS); } static isc_result_t internal_next_GAA(isc_interfaceiter_t *iter) { REQUIRE(use_GAA); if (NULL == iter->ipaaCur) return (ISC_R_NOMORE); if (NULL == iter->ipuaCur) iter->ipuaCur = iter->ipaaCur->FirstUnicastAddress; else iter->ipuaCur = iter->ipuaCur->Next; while (NULL == iter->ipuaCur) { iter->ipaaCur = iter->ipaaCur->Next; if (NULL == iter->ipaaCur) return (ISC_R_NOMORE); iter->ipuaCur = iter->ipaaCur->FirstUnicastAddress; } return (ISC_R_SUCCESS); } /* * Step the iterator to the next interface. Unlike * isc_interfaceiter_next(), this may leave the iterator * positioned on an interface that will ultimately * be ignored. Return ISC_R_NOMORE if there are no more * interfaces, otherwise ISC_R_SUCCESS. */ static isc_result_t internal_next(isc_interfaceiter_t *iter) { if (iter->numIF >= iter->v4IF) return (ISC_R_NOMORE); /* * The first one needs to be set up to point to the last * Element of the array. Go to the end and back up * Microsoft's implementation is peculiar for returning * the list in reverse order */ if (iter->numIF == 0) iter->pos4 = (INTERFACE_INFO *)(iter->buf4 + (iter->v4IF)); iter->pos4--; if (&(iter->pos4) < &(iter->buf4)) return (ISC_R_NOMORE); memset(&(iter->IFData), 0, sizeof(INTERFACE_INFO)); memcpy(&(iter->IFData), iter->pos4, sizeof(INTERFACE_INFO)); iter->numIF++; return (ISC_R_SUCCESS); } static isc_result_t internal_next6(isc_interfaceiter_t *iter) { if (iter->pos6 == 0) return (ISC_R_NOMORE); iter->pos6--; return (ISC_R_SUCCESS); } isc_result_t isc_interfaceiter_current(isc_interfaceiter_t *iter, isc_interface_t *ifdata) { REQUIRE(iter->result == ISC_R_SUCCESS); memcpy(ifdata, &iter->current, sizeof(*ifdata)); return (ISC_R_SUCCESS); } isc_result_t isc_interfaceiter_first(isc_interfaceiter_t *iter) { REQUIRE(VALID_IFITER(iter)); REQUIRE(use_GAA_determined); /* * SIO_ADDRESS_LIST_QUERY (used to query IPv6 addresses) * intentionally omits localhost addresses [::1] and [::fe80] in * some cases. ntpd depends on enumerating [::1] to listen on * it, and ntpq and ntpdc default to "localhost" as the target, * so they will attempt to talk to [::1]:123 and fail. This * means we need to synthesize ::1, which we will do first, * hence iAddressCount + 1. internal_next6() will decrement * it before the first use as an index, and internal_current6() * will treat pos6 == iAddressCount as a sign to synthesize * [::1] if needed. */ if (!use_GAA && iter->buf6 != NULL) iter->pos6 = iter->buf6->iAddressCount + 1; iter->result = ISC_R_SUCCESS; return (isc_interfaceiter_next(iter)); } isc_result_t isc_interfaceiter_next(isc_interfaceiter_t *iter) { isc_result_t result; REQUIRE(VALID_IFITER(iter)); REQUIRE(iter->result == ISC_R_SUCCESS); REQUIRE(use_GAA_determined); if (use_GAA) { do { result = internal_next_GAA(iter); if (ISC_R_NOMORE == result) goto set_result; result = internal_current_GAA(iter); } while (ISC_R_IGNORE == result); goto set_result; } for (;;) { result = internal_next(iter); if (result == ISC_R_NOMORE) { result = internal_next6(iter); if (result != ISC_R_SUCCESS) break; result = internal_current6(iter); if (result != ISC_R_IGNORE) break; } else if (result != ISC_R_SUCCESS) break; result = internal_current(iter); if (result != ISC_R_IGNORE) break; } set_result: iter->result = result; return (result); } void isc_interfaceiter_destroy(isc_interfaceiter_t **iterp) { isc_interfaceiter_t *iter; REQUIRE(iterp != NULL); iter = *iterp; REQUIRE(VALID_IFITER(iter)); REQUIRE(use_GAA_determined); if (use_GAA) { REQUIRE(NULL == iter->buf4); REQUIRE(NULL == iter->buf4); if (iter->ipaa != NULL) isc_mem_put(iter->mctx, iter->ipaa, iter->ipaasize); } else { REQUIRE(NULL == iter->ipaa); if (iter->buf4 != NULL) isc_mem_put(iter->mctx, iter->buf4, iter->buf4size); if (iter->buf6 != NULL) isc_mem_put(iter->mctx, iter->buf6, iter->buf6size); } iter->magic = 0; isc_mem_put(iter->mctx, iter, sizeof(*iter)); *iterp = NULL; } ntp-4.2.6p5/lib/isc/win32/file.c0000644000175000017500000002504411307651603015171 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: file.c,v 1.31 2007/06/19 23:47:19 tbox Exp $ */ #include #undef rename #include #include #include #include #include #include #include #include #include #include #include #include #include #include "errno2result.h" /* * Emulate UNIX mkstemp, which returns an open FD to the new file * */ static int gettemp(char *path, int *doopen) { char *start, *trv; struct stat sbuf; int pid; trv = strrchr(path, 'X'); trv++; pid = getpid(); /* extra X's get set to 0's */ while (*--trv == 'X') { *trv = (pid % 10) + '0'; pid /= 10; } /* * check the target directory; if you have six X's and it * doesn't exist this runs for a *very* long time. */ for (start = trv + 1;; --trv) { if (trv <= path) break; if (*trv == '\\') { *trv = '\0'; if (stat(path, &sbuf)) return (0); if (!S_ISDIR(sbuf.st_mode)) { errno = ENOTDIR; return (0); } *trv = '\\'; break; } } for (;;) { if (doopen) { if ((*doopen = open(path, O_CREAT|O_EXCL|O_RDWR, _S_IREAD | _S_IWRITE)) >= 0) return (1); if (errno != EEXIST) return (0); } else if (stat(path, &sbuf)) return (errno == ENOENT ? 1 : 0); /* tricky little algorithm for backward compatibility */ for (trv = start;;) { if (!*trv) return (0); if (*trv == 'z') *trv++ = 'a'; else { if (isdigit(*trv)) *trv = 'a'; else ++*trv; break; } } } /*NOTREACHED*/ } static int mkstemp(char *path) { int fd; return (gettemp(path, &fd) ? fd : -1); } /* * XXXDCL As the API for accessing file statistics undoubtedly gets expanded, * it might be good to provide a mechanism that allows for the results * of a previous stat() to be used again without having to do another stat, * such as perl's mechanism of using "_" in place of a file name to indicate * that the results of the last stat should be used. But then you get into * annoying MP issues. BTW, Win32 has stat(). */ static isc_result_t file_stats(const char *file, struct stat *stats) { isc_result_t result = ISC_R_SUCCESS; REQUIRE(file != NULL); REQUIRE(stats != NULL); if (stat(file, stats) != 0) result = isc__errno2result(errno); return (result); } /* * isc_file_safemovefile is needed to be defined here to ensure that * any file with the new name is renamed to a backup name and then the * rename is done. If all goes well then the backup can be deleted, * otherwise it gets renamed back. */ int isc_file_safemovefile(const char *oldname, const char *newname) { BOOL filestatus; char buf[512]; struct stat sbuf; BOOL exists = FALSE; int tmpfd; /* * Make sure we have something to do */ if (stat(oldname, &sbuf) != 0) { errno = ENOENT; return (-1); } /* * Rename to a backup the new file if it still exists */ if (stat(newname, &sbuf) == 0) { exists = TRUE; strcpy(buf, newname); strcat(buf, ".XXXXX"); tmpfd = mkstemp(buf); if (tmpfd > 0) _close(tmpfd); DeleteFile(buf); _chmod(newname, _S_IREAD | _S_IWRITE); filestatus = MoveFile(newname, buf); } /* Now rename the file to the new name */ _chmod(oldname, _S_IREAD | _S_IWRITE); filestatus = MoveFile(oldname, newname); if (filestatus == 0) { /* * Try to rename the backup back to the original name * if the backup got created */ if (exists == TRUE) { filestatus = MoveFile(buf, newname); if (filestatus == 0) errno = EACCES; } return (-1); } /* * Delete the backup file if it got created */ if (exists == TRUE) filestatus = DeleteFile(buf); return (0); } isc_result_t isc_file_getmodtime(const char *file, isc_time_t *time) { int fh; REQUIRE(file != NULL); REQUIRE(time != NULL); if ((fh = open(file, _O_RDONLY | _O_BINARY)) < 0) return (isc__errno2result(errno)); if (!GetFileTime((HANDLE) _get_osfhandle(fh), NULL, NULL, &time->absolute)) { close(fh); errno = EINVAL; return (isc__errno2result(errno)); } close(fh); return (ISC_R_SUCCESS); } isc_result_t isc_file_settime(const char *file, isc_time_t *time) { int fh; REQUIRE(file != NULL && time != NULL); if ((fh = open(file, _O_RDWR | _O_BINARY)) < 0) return (isc__errno2result(errno)); /* * Set the date via the filedate system call and return. Failing * this call implies the new file times are not supported by the * underlying file system. */ if (!SetFileTime((HANDLE) _get_osfhandle(fh), NULL, &time->absolute, &time->absolute)) { close(fh); errno = EINVAL; return (isc__errno2result(errno)); } close(fh); return (ISC_R_SUCCESS); } #undef TEMPLATE #define TEMPLATE "XXXXXXXXXX.tmp" /* 14 characters. */ isc_result_t isc_file_mktemplate(const char *path, char *buf, size_t buflen) { return (isc_file_template(path, TEMPLATE, buf, buflen)); } isc_result_t isc_file_template(const char *path, const char *templet, char *buf, size_t buflen) { char *s; REQUIRE(path != NULL); REQUIRE(templet != NULL); REQUIRE(buf != NULL); s = strrchr(templet, '\\'); if (s != NULL) templet = s + 1; s = strrchr(path, '\\'); if (s != NULL) { if ((s - path + 1 + strlen(templet) + 1) > buflen) return (ISC_R_NOSPACE); strncpy(buf, path, s - path + 1); buf[s - path + 1] = '\0'; strcat(buf, templet); } else { if ((strlen(templet) + 1) > buflen) return (ISC_R_NOSPACE); strcpy(buf, templet); } return (ISC_R_SUCCESS); } isc_result_t isc_file_renameunique(const char *file, char *templet) { int fd = -1; int res = 0; isc_result_t result = ISC_R_SUCCESS; REQUIRE(file != NULL); REQUIRE(templet != NULL); fd = mkstemp(templet); if (fd == -1) result = isc__errno2result(errno); else close(fd); if (result == ISC_R_SUCCESS) { res = isc_file_safemovefile(file, templet); if (res != 0) { result = isc__errno2result(errno); (void)unlink(templet); } } return (result); } isc_result_t isc_file_openunique(char *templet, FILE **fp) { int fd; FILE *f; isc_result_t result = ISC_R_SUCCESS; REQUIRE(templet != NULL); REQUIRE(fp != NULL && *fp == NULL); /* * Win32 does not have mkstemp. Using emulation above. */ fd = mkstemp(templet); if (fd == -1) result = isc__errno2result(errno); if (result == ISC_R_SUCCESS) { f = fdopen(fd, "w+"); if (f == NULL) { result = isc__errno2result(errno); (void)remove(templet); (void)close(fd); } else *fp = f; } return (result); } isc_result_t isc_file_remove(const char *filename) { int r; REQUIRE(filename != NULL); r = unlink(filename); if (r == 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } isc_result_t isc_file_rename(const char *oldname, const char *newname) { int r; REQUIRE(oldname != NULL); REQUIRE(newname != NULL); r = isc_file_safemovefile(oldname, newname); if (r == 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } isc_boolean_t isc_file_exists(const char *pathname) { struct stat stats; REQUIRE(pathname != NULL); return (ISC_TF(file_stats(pathname, &stats) == ISC_R_SUCCESS)); } isc_boolean_t isc_file_isabsolute(const char *filename) { REQUIRE(filename != NULL); /* * Look for c:\path\... style, c:/path/... or \\computer\shar\path... * the UNC style file specs */ if ((filename[0] == '\\') && (filename[1] == '\\')) return (ISC_TRUE); if (isalpha(filename[0]) && filename[1] == ':' && filename[2] == '\\') return (ISC_TRUE); if (isalpha(filename[0]) && filename[1] == ':' && filename[2] == '/') return (ISC_TRUE); return (ISC_FALSE); } isc_boolean_t isc_file_iscurrentdir(const char *filename) { REQUIRE(filename != NULL); return (ISC_TF(filename[0] == '.' && filename[1] == '\0')); } isc_boolean_t isc_file_ischdiridempotent(const char *filename) { REQUIRE(filename != NULL); if (isc_file_isabsolute(filename)) return (ISC_TRUE); if (filename[0] == '\\') return (ISC_TRUE); if (filename[0] == '/') return (ISC_TRUE); if (isc_file_iscurrentdir(filename)) return (ISC_TRUE); return (ISC_FALSE); } const char * isc_file_basename(const char *filename) { char *s; REQUIRE(filename != NULL); s = strrchr(filename, '\\'); if (s == NULL) return (filename); return (s + 1); } isc_result_t isc_file_progname(const char *filename, char *progname, size_t namelen) { const char *s; char *p; size_t len; REQUIRE(filename != NULL); REQUIRE(progname != NULL); /* * Strip the path from the name */ s = isc_file_basename(filename); if (s == NULL) { return (ISC_R_NOSPACE); } /* * Strip any and all suffixes */ p = strchr(s, '.'); if (p == NULL) { if (namelen <= strlen(s)) return (ISC_R_NOSPACE); strcpy(progname, s); return (ISC_R_SUCCESS); } /* * Copy the result to the buffer */ len = p - s; if (len >= namelen) return (ISC_R_NOSPACE); strncpy(progname, s, len); progname[len] = '\0'; return (ISC_R_SUCCESS); } isc_result_t isc_file_absolutepath(const char *filename, char *path, size_t pathlen) { char *ptrname; DWORD retval; REQUIRE(filename != NULL); REQUIRE(path != NULL); retval = GetFullPathName(filename, pathlen, path, &ptrname); /* Something went wrong in getting the path */ if (retval == 0) return (ISC_R_NOTFOUND); /* Caller needs to provide a larger buffer to contain the string */ if (retval >= pathlen) return (ISC_R_NOSPACE); return (ISC_R_SUCCESS); } isc_result_t isc_file_truncate(const char *filename, isc_offset_t size) { int fh; REQUIRE(filename != NULL && size >= 0); if ((fh = open(filename, _O_RDWR | _O_BINARY)) < 0) return (isc__errno2result(errno)); if(_chsize(fh, size) != 0) { close(fh); return (isc__errno2result(errno)); } close(fh); return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/win32/version.c0000644000175000017500000000231311307651604015732 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: version.c,v 1.7 2007/06/19 23:47:19 tbox Exp $ */ #include #include LIBISC_EXTERNAL_DATA const char isc_version[] = VERSION; LIBISC_EXTERNAL_DATA const unsigned int isc_libinterface = LIBINTERFACE; LIBISC_EXTERNAL_DATA const unsigned int isc_librevision = LIBREVISION; LIBISC_EXTERNAL_DATA const unsigned int isc_libage = LIBAGE; ntp-4.2.6p5/lib/isc/win32/keyboard.c0000644000175000017500000000407111307651603016047 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: keyboard.c,v 1.7 2007/06/19 23:47:19 tbox Exp $ */ #include #include #include #include #include #include #include #include #include #include #include #include isc_result_t isc_keyboard_open(isc_keyboard_t *keyboard) { int fd; REQUIRE(keyboard != NULL); fd = _fileno(stdin); if (fd < 0) return (ISC_R_IOERROR); keyboard->fd = fd; keyboard->result = ISC_R_SUCCESS; return (ISC_R_SUCCESS); } isc_result_t isc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleeptime) { REQUIRE(keyboard != NULL); if (sleeptime > 0 && keyboard->result != ISC_R_CANCELED) (void)Sleep(sleeptime*1000); keyboard->fd = -1; return (ISC_R_SUCCESS); } isc_result_t isc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp) { ssize_t cc; unsigned char c; REQUIRE(keyboard != NULL); REQUIRE(cp != NULL); cc = read(keyboard->fd, &c, 1); if (cc < 0) { keyboard->result = ISC_R_IOERROR; return (keyboard->result); } *cp = c; return (ISC_R_SUCCESS); } isc_boolean_t isc_keyboard_canceled(isc_keyboard_t *keyboard) { return (ISC_TF(keyboard->result == ISC_R_CANCELED)); } ntp-4.2.6p5/lib/isc/win32/libisc.dsp0000644000175000017500000003531211307651603016062 0ustar peterpeter# Microsoft Developer Studio Project File - Name="libisc" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=libisc - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "libisc.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "libisc.mak" CFG="libisc - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "libisc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libisc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "libisc - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "./" /I "../../../" /I "include" /I "../include" /I "../noatomic/include" /I "win32" /I "../../isccfg/include" /D "WIN32" /D "NDEBUG" /D "__STDC__" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 user32.lib advapi32.lib ws2_32.lib /nologo /dll /machine:I386 /out:"../../../Build/Release/libisc.dll" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "libisc - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "./" /I "../../../" /I "include" /I "../include" /I "../noatomic/include" /I "win32" /I "../../isccfg/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__STDC__" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /FR /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 user32.lib advapi32.lib ws2_32.lib /nologo /dll /map /debug /machine:I386 /out:"../../../Build/Debug/libisc.dll" /pdbtype:sept !ENDIF # Begin Target # Name "libisc - Win32 Release" # Name "libisc - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\app.c # End Source File # Begin Source File SOURCE=.\condition.c # End Source File # Begin Source File SOURCE=.\dir.c # End Source File # Begin Source File SOURCE=.\DLLMain.c # End Source File # Begin Source File SOURCE=.\entropy.c # End Source File # Begin Source File SOURCE=.\errno2result.c # End Source File # Begin Source File SOURCE=.\file.c # End Source File # Begin Source File SOURCE=.\fsaccess.c # End Source File # Begin Source File SOURCE=.\interfaceiter.c # End Source File # Begin Source File SOURCE=.\ipv6.c # End Source File # Begin Source File SOURCE=..\iterated_hash.c # End Source File # Begin Source File SOURCE=.\keyboard.c # End Source File # Begin Source File SOURCE=.\net.c # End Source File # Begin Source File SOURCE=.\ntpaths.c # End Source File # Begin Source File SOURCE=.\once.c # End Source File # Begin Source File SOURCE=.\os.c # End Source File # Begin Source File SOURCE=.\resource.c # End Source File # Begin Source File SOURCE=.\socket.c # End Source File # Begin Source File SOURCE=.\strerror.c # End Source File # Begin Source File SOURCE=.\stdio.c # End Source File # Begin Source File SOURCE=.\stdtime.c # End Source File # Begin Source File SOURCE=.\syslog.c # End Source File # Begin Source File SOURCE=.\thread.c # End Source File # Begin Source File SOURCE=.\time.c # End Source File # Begin Source File SOURCE=.\version.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=.\include\isc\app.h # End Source File # Begin Source File SOURCE=..\include\isc\assertions.h # End Source File # Begin Source File SOURCE=..\include\isc\base32.h # End Source File # Begin Source File SOURCE=..\include\isc\base64.h # End Source File # Begin Source File SOURCE=.\include\isc\bind_registry.h # End Source File # Begin Source File SOURCE=.\include\isc\bindevt.h # End Source File # Begin Source File SOURCE=..\include\isc\bitstring.h # End Source File # Begin Source File SOURCE=..\include\isc\boolean.h # End Source File # Begin Source File SOURCE=..\include\isc\buffer.h # End Source File # Begin Source File SOURCE=..\include\isc\bufferlist.h # End Source File # Begin Source File SOURCE=..\include\isc\commandline.h # End Source File # Begin Source File SOURCE=.\include\isc\condition.h # End Source File # Begin Source File SOURCE=..\..\..\config.h # End Source File # Begin Source File SOURCE=.\include\isc\dir.h # End Source File # Begin Source File SOURCE=..\include\isc\entropy.h # End Source File # Begin Source File SOURCE=.\errno2result.h # End Source File # Begin Source File SOURCE=..\include\isc\error.h # End Source File # Begin Source File SOURCE=..\include\isc\event.h # End Source File # Begin Source File SOURCE=..\include\isc\eventclass.h # End Source File # Begin Source File SOURCE=..\include\isc\file.h # End Source File # Begin Source File SOURCE=..\include\isc\formatcheck.h # End Source File # Begin Source File SOURCE=..\include\isc\fsaccess.h # End Source File # Begin Source File SOURCE=..\include\isc\hash.h # End Source File # Begin Source File SOURCE=..\include\isc\heap.h # End Source File # Begin Source File SOURCE=..\include\isc\hex.h # End Source File # Begin Source File SOURCE=..\include\isc\hmacmd5.h # End Source File # Begin Source File SOURCE=..\include\isc\hmacsha.h # End Source File # Begin Source File SOURCE=..\include\isc\httpd.h # End Source File # Begin Source File SOURCE=.\include\isc\int.h # End Source File # Begin Source File SOURCE=..\include\isc\interfaceiter.h # End Source File # Begin Source File SOURCE=..\include\isc\ipv6.h # End Source File # Begin Source File SOURCE=..\include\isc\iterated_hash.h # End Source File # Begin Source File SOURCE=.\include\isc\keyboard.h # End Source File # Begin Source File SOURCE=..\include\isc\lang.h # End Source File # Begin Source File SOURCE=..\include\isc\lex.h # End Source File # Begin Source File SOURCE=..\include\isc\lfsr.h # End Source File # Begin Source File SOURCE=..\include\isc\lib.h # End Source File # Begin Source File SOURCE=..\include\isc\list.h # End Source File # Begin Source File SOURCE=..\include\isc\log.h # End Source File # Begin Source File SOURCE=..\include\isc\magic.h # End Source File # Begin Source File SOURCE=..\include\isc\md5.h # End Source File # Begin Source File SOURCE=..\include\isc\mem.h # End Source File # Begin Source File SOURCE=..\include\isc\msgcat.h # End Source File # Begin Source File SOURCE=.\include\isc\msioctl.h # End Source File # Begin Source File SOURCE=.\include\isc\mutex.h # End Source File # Begin Source File SOURCE=..\include\isc\mutexblock.h # End Source File # Begin Source File SOURCE=.\include\isc\net.h # End Source File # Begin Source File SOURCE=..\include\isc\netaddr.h # End Source File # Begin Source File SOURCE=..\include\isc\netscope.h # End Source File # Begin Source File SOURCE=.\include\isc\netdb.h # End Source File # Begin Source File SOURCE=.\include\isc\ntpaths.h # End Source File # Begin Source File SOURCE=.\include\isc\offset.h # End Source File # Begin Source File SOURCE=.\include\isc\once.h # End Source File # Begin Source File SOURCE=..\include\isc\ondestroy.h # End Source File # Begin Source File SOURCE=..\include\isc\parseint.h # End Source File # Begin Source File SOURCE=..\include\isc\portset.h # End Source File # Begin Source File SOURCE=..\include\isc\os.h # End Source File # Begin Source File SOURCE=.\include\isc\platform.h # End Source File # Begin Source File SOURCE=..\include\isc\print.h # End Source File # Begin Source File SOURCE=..\include\isc\quota.h # End Source File # Begin Source File SOURCE=..\include\isc\radix.h # End Source File # Begin Source File SOURCE=..\include\isc\random.h # End Source File # Begin Source File SOURCE=..\include\isc\ratelimiter.h # End Source File # Begin Source File SOURCE=..\include\isc\refcount.h # End Source File # Begin Source File SOURCE=..\include\isc\region.h # End Source File # Begin Source File SOURCE=..\include\isc\resource.h # End Source File # Begin Source File SOURCE=..\include\isc\result.h # End Source File # Begin Source File SOURCE=..\include\isc\resultclass.h # End Source File # Begin Source File SOURCE=..\include\isc\rwlock.h # End Source File # Begin Source File SOURCE=..\include\isc\serial.h # End Source File # Begin Source File SOURCE=..\include\isc\sha1.h # End Source File # Begin Source File SOURCE=..\include\isc\sha2.h # End Source File # Begin Source File SOURCE=..\include\isc\sockaddr.h # End Source File # Begin Source File SOURCE=..\include\isc\socket.h # End Source File # Begin Source File SOURCE=.\include\isc\stats.h # End Source File # Begin Source File SOURCE=..\include\isc\stdio.h # End Source File # Begin Source File SOURCE=..\include\isc\strerror.h # End Source File # Begin Source File SOURCE=.\include\isc\stdtime.h # End Source File # Begin Source File SOURCE=..\include\isc\string.h # End Source File # Begin Source File SOURCE=..\include\isc\symtab.h # End Source File # Begin Source File SOURCE=.\include\isc\syslog.h # End Source File # Begin Source File SOURCE=.\syslog.h # End Source File # Begin Source File SOURCE=..\include\isc\task.h # End Source File # Begin Source File SOURCE=..\include\isc\taskpool.h # End Source File # Begin Source File SOURCE=.\include\isc\thread.h # End Source File # Begin Source File SOURCE=.\include\isc\time.h # End Source File # Begin Source File SOURCE=..\include\isc\timer.h # End Source File # Begin Source File SOURCE=.\include\isc\win32os.h # End Source File # Begin Source File SOURCE=..\include\isc\types.h # End Source File # Begin Source File SOURCE=.\unistd.h # End Source File # Begin Source File SOURCE=..\include\isc\util.h # End Source File # Begin Source File SOURCE=..\..\..\versions.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # Begin Group "Main Isc Lib" # PROP Default_Filter "c" # Begin Source File SOURCE=..\assertions.c # End Source File # Begin Source File SOURCE=..\base32.c # End Source File # Begin Source File SOURCE=..\base64.c # End Source File # Begin Source File SOURCE=..\bitstring.c # End Source File # Begin Source File SOURCE=..\buffer.c # End Source File # Begin Source File SOURCE=..\bufferlist.c # End Source File # Begin Source File SOURCE=..\commandline.c # End Source File # Begin Source File SOURCE=..\error.c # End Source File # Begin Source File SOURCE=..\event.c # End Source File # Begin Source File SOURCE=..\hash.c # End Source File # Begin Source File SOURCE=..\heap.c # End Source File # Begin Source File SOURCE=..\hex.c # End Source File # Begin Source File SOURCE=..\hmacmd5.c # End Source File # Begin Source File SOURCE=..\hmacsha.c # End Source File # Begin Source File SOURCE=..\httpd.c # End Source File # Begin Source File SOURCE=..\inet_aton.c # End Source File # Begin Source File SOURCE=..\inet_ntop.c # End Source File # Begin Source File SOURCE=..\inet_pton.c # End Source File # Begin Source File SOURCE=..\lex.c # End Source File # Begin Source File SOURCE=..\lfsr.c # End Source File # Begin Source File SOURCE=..\lib.c # End Source File # Begin Source File SOURCE=..\log.c # End Source File # Begin Source File SOURCE=..\md5.c # End Source File # Begin Source File SOURCE=..\mem.c # End Source File # Begin Source File SOURCE=..\nls\msgcat.c # End Source File # Begin Source File SOURCE=..\mutexblock.c # End Source File # Begin Source File SOURCE=..\netaddr.c # End Source File # Begin Source File SOURCE=..\netscope.c # End Source File # Begin Source File SOURCE=..\ondestroy.c # End Source File # Begin Source File SOURCE=..\parseint.c # End Source File # Begin Source File SOURCE=..\portset.c # End Source File # Begin Source File SOURCE=..\quota.c # End Source File # Begin Source File SOURCE=..\radix.c # End Source File # Begin Source File SOURCE=..\random.c # End Source File # Begin Source File SOURCE=..\ratelimiter.c # End Source File # Begin Source File SOURCE=..\refcount.c # End Source File # Begin Source File SOURCE=..\region.c # End Source File # Begin Source File SOURCE=..\result.c # End Source File # Begin Source File SOURCE=..\rwlock.c # End Source File # Begin Source File SOURCE=..\serial.c # End Source File # Begin Source File SOURCE=..\sha1.c # End Source File # Begin Source File SOURCE=..\sha2.c # End Source File # Begin Source File SOURCE=..\sockaddr.c # End Source File # Begin Source File SOURCE=..\stats.c # End Source File # Begin Source File SOURCE=..\string.c # End Source File # Begin Source File SOURCE=..\symtab.c # End Source File # Begin Source File SOURCE=..\task.c # End Source File # Begin Source File SOURCE=..\taskpool.c # End Source File # Begin Source File SOURCE=..\timer.c # End Source File # Begin Source File SOURCE=.\win32os.c # End Source File # End Group # Begin Source File SOURCE=..\noatomic\include\atomic.h # End Source File # Begin Source File SOURCE=.\libisc.def # End Source File # End Target # End Project ntp-4.2.6p5/lib/isc/win32/entropy.c0000644000175000017500000001661411307651604015756 0ustar peterpeter/* * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: entropy.c,v 1.8.332.2 2009/01/18 23:47:41 tbox Exp $ */ /* * This is the system dependent part of the ISC entropy API. */ #include #include #include #include #include #include /* * There is only one variable in the entropy data structures that is not * system independent, but pulling the structure that uses it into this file * ultimately means pulling several other independent structures here also to * resolve their interdependencies. Thus only the problem variable's type * is defined here. */ #define FILESOURCE_HANDLE_TYPE HCRYPTPROV typedef struct { int dummy; } isc_entropyusocketsource_t; #include "../entropy.c" static unsigned int get_from_filesource(isc_entropysource_t *source, isc_uint32_t desired) { isc_entropy_t *ent = source->ent; unsigned char buf[128]; HCRYPTPROV hcryptprov = source->sources.file.handle; ssize_t ndesired; unsigned int added; if (source->bad) return (0); desired = desired / 8 + (((desired & 0x07) > 0) ? 1 : 0); added = 0; while (desired > 0) { ndesired = ISC_MIN(desired, sizeof(buf)); if (!CryptGenRandom(hcryptprov, ndesired, buf)) { CryptReleaseContext(hcryptprov, 0); source->bad = ISC_TRUE; goto out; } entropypool_adddata(ent, buf, ndesired, ndesired * 8); added += ndesired * 8; desired -= ndesired; } out: return (added); } /* * Poll each source, trying to get data from it to stuff into the entropy * pool. */ static void fillpool(isc_entropy_t *ent, unsigned int desired, isc_boolean_t blocking) { unsigned int added; unsigned int remaining; unsigned int needed; unsigned int nsource; isc_entropysource_t *source; isc_entropysource_t *firstsource; REQUIRE(VALID_ENTROPY(ent)); needed = desired; /* * This logic is a little strange, so an explanation is in order. * * If needed is 0, it means we are being asked to "fill to whatever * we think is best." This means that if we have at least a * partially full pool (say, > 1/4th of the pool) we probably don't * need to add anything. * * Also, we will check to see if the "pseudo" count is too high. * If it is, try to mix in better data. Too high is currently * defined as 1/4th of the pool. * * Next, if we are asked to add a specific bit of entropy, make * certain that we will do so. Clamp how much we try to add to * (DIGEST_SIZE * 8 < needed < POOLBITS - entropy). * * Note that if we are in a blocking mode, we will only try to * get as much data as we need, not as much as we might want * to build up. */ if (needed == 0) { REQUIRE(!blocking); if ((ent->pool.entropy >= RND_POOLBITS / 4) && (ent->pool.pseudo <= RND_POOLBITS / 4)) return; needed = THRESHOLD_BITS * 4; } else { needed = ISC_MAX(needed, THRESHOLD_BITS); needed = ISC_MIN(needed, RND_POOLBITS); } /* * In any case, clamp how much we need to how much we can add. */ needed = ISC_MIN(needed, RND_POOLBITS - ent->pool.entropy); /* * But wait! If we're not yet initialized, we need at least * THRESHOLD_BITS * of randomness. */ if (ent->initialized < THRESHOLD_BITS) needed = ISC_MAX(needed, THRESHOLD_BITS - ent->initialized); /* * Poll each file source to see if we can read anything useful from * it. XXXMLG When where are multiple sources, we should keep a * record of which one we last used so we can start from it (or the * next one) to avoid letting some sources build up entropy while * others are always drained. */ added = 0; remaining = needed; if (ent->nextsource == NULL) { ent->nextsource = ISC_LIST_HEAD(ent->sources); if (ent->nextsource == NULL) return; } source = ent->nextsource; /* * Remember the first source so we can break if we have looped back to * the beginning and still have nothing */ firstsource = source; again_file: for (nsource = 0; nsource < ent->nsources; nsource++) { unsigned int got; if (remaining == 0) break; got = 0; if (source->type == ENTROPY_SOURCETYPE_FILE) got = get_from_filesource(source, remaining); added += got; remaining -= ISC_MIN(remaining, got); source = ISC_LIST_NEXT(source, link); if (source == NULL) source = ISC_LIST_HEAD(ent->sources); } ent->nextsource = source; /* * Go again only if there's been progress and we've not * gone back to the beginning */ if (!(ent->nextsource == firstsource && added == 0)) { if (blocking && remaining != 0) { goto again_file; } } /* * Here, if there are bits remaining to be had and we can block, * check to see if we have a callback source. If so, call them. */ source = ISC_LIST_HEAD(ent->sources); while ((remaining != 0) && (source != NULL)) { unsigned int got; got = 0; if (source->type == ENTROPY_SOURCETYPE_CALLBACK) got = get_from_callback(source, remaining, blocking); added += got; remaining -= ISC_MIN(remaining, got); if (added >= needed) break; source = ISC_LIST_NEXT(source, link); } /* * Mark as initialized if we've added enough data. */ if (ent->initialized < THRESHOLD_BITS) ent->initialized += added; } /* * Requires "ent" be locked. */ static void destroyfilesource(isc_entropyfilesource_t *source) { CryptReleaseContext(source->handle, 0); } static void destroyusocketsource(isc_entropyusocketsource_t *source) { UNUSED(source); } isc_result_t isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) { isc_result_t ret; isc_entropysource_t *source; HCRYPTPROV hcryptprov; DWORD errval; BOOL err; REQUIRE(VALID_ENTROPY(ent)); REQUIRE(fname != NULL); LOCK(&ent->lock); source = NULL; /* * The first time we just try to acquire the context */ err = CryptAcquireContext(&hcryptprov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); if (!err){ errval = GetLastError(); ret = ISC_R_IOERROR; goto errout; } source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t)); if (source == NULL) { ret = ISC_R_NOMEMORY; goto closecontext; } /* * From here down, no failures can occur. */ source->magic = SOURCE_MAGIC; source->type = ENTROPY_SOURCETYPE_FILE; source->ent = ent; source->total = 0; source->bad = ISC_FALSE; memset(source->name, 0, sizeof(source->name)); ISC_LINK_INIT(source, link); source->sources.file.handle = hcryptprov; /* * Hook it into the entropy system. */ ISC_LIST_APPEND(ent->sources, source, link); ent->nsources++; UNLOCK(&ent->lock); return (ISC_R_SUCCESS); closecontext: CryptReleaseContext(hcryptprov, 0); errout: if (source != NULL) isc_mem_put(ent->mctx, source, sizeof(isc_entropysource_t)); UNLOCK(&ent->lock); return (ret); } ntp-4.2.6p5/lib/isc/win32/ntpaths.c0000644000175000017500000000737211307651603015737 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ntpaths.c,v 1.11 2007/06/18 23:47:49 tbox Exp $ */ /* * This module fetches the required path information that is specific * to NT systems which can have its configuration and system files * almost anywhere. It can be used to override whatever the application * had previously assigned to the pointer. Basic information about the * file locations are stored in the registry. */ #include #include #include /* * Module Variables */ static char systemDir[MAX_PATH]; static char namedBase[MAX_PATH]; static char ns_confFile[MAX_PATH]; static char lwresd_confFile[MAX_PATH]; static char lwresd_resolvconfFile[MAX_PATH]; static char rndc_confFile[MAX_PATH]; static char ns_defaultpidfile[MAX_PATH]; static char lwresd_defaultpidfile[MAX_PATH]; static char local_state_dir[MAX_PATH]; static char sys_conf_dir[MAX_PATH]; static char rndc_keyFile[MAX_PATH]; static DWORD baseLen = MAX_PATH; static BOOL Initialized = FALSE; void isc_ntpaths_init() { HKEY hKey; BOOL keyFound = TRUE; memset(namedBase, 0, MAX_PATH); if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, BIND_SUBKEY, 0, KEY_READ, &hKey) != ERROR_SUCCESS) keyFound = FALSE; if (keyFound == TRUE) { /* Get the named directory */ if (RegQueryValueEx(hKey, "InstallDir", NULL, NULL, (LPBYTE)namedBase, &baseLen) != ERROR_SUCCESS) keyFound = FALSE; RegCloseKey(hKey); } GetSystemDirectory(systemDir, MAX_PATH); if (keyFound == FALSE) /* Use the System Directory as a default */ strcpy(namedBase, systemDir); strcpy(ns_confFile, namedBase); strcat(ns_confFile, "\\etc\\named.conf"); strcpy(lwresd_confFile, namedBase); strcat(lwresd_confFile, "\\etc\\lwresd.conf"); strcpy(lwresd_resolvconfFile, systemDir); strcat(lwresd_resolvconfFile, "\\Drivers\\etc\\resolv.conf"); strcpy(rndc_keyFile, namedBase); strcat(rndc_keyFile, "\\etc\\rndc.key"); strcpy(rndc_confFile, namedBase); strcat(rndc_confFile, "\\etc\\rndc.conf"); strcpy(ns_defaultpidfile, namedBase); strcat(ns_defaultpidfile, "\\etc\\named.pid"); strcpy(lwresd_defaultpidfile, namedBase); strcat(lwresd_defaultpidfile, "\\etc\\lwresd.pid"); strcpy(local_state_dir, namedBase); strcat(local_state_dir, "\\bin"); strcpy(sys_conf_dir, namedBase); strcat(sys_conf_dir, "\\etc"); Initialized = TRUE; } char * isc_ntpaths_get(int ind) { if (!Initialized) isc_ntpaths_init(); switch (ind) { case NAMED_CONF_PATH: return (ns_confFile); break; case LWRES_CONF_PATH: return (lwresd_confFile); break; case RESOLV_CONF_PATH: return (lwresd_resolvconfFile); break; case RNDC_CONF_PATH: return (rndc_confFile); break; case NAMED_PID_PATH: return (ns_defaultpidfile); break; case LWRESD_PID_PATH: return (lwresd_defaultpidfile); break; case LOCAL_STATE_DIR: return (local_state_dir); break; case SYS_CONF_DIR: return (sys_conf_dir); break; case RNDC_KEY_PATH: return (rndc_keyFile); break; default: return (NULL); } } ntp-4.2.6p5/lib/isc/win32/unistd.h0000644000175000017500000000264611307651603015570 0ustar peterpeter/* * Copyright (C) 2004, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: unistd.h,v 1.8 2008/01/23 03:22:43 tbox Exp $ */ /* None of these are defined in NT, so define them for our use */ #define O_NONBLOCK 1 #define PORT_NONBLOCK O_NONBLOCK /* * fcntl() commands */ #define F_SETFL 0 #define F_GETFL 1 #define F_SETFD 2 #define F_GETFD 3 /* * Enough problems not having full fcntl() without worrying about this! */ #undef F_DUPFD int fcntl(int, int, ...); /* * access() related definitions for winXP */ #include #ifndef W_OK #define W_OK 2 #endif #ifndef R_OK #define R_OK 4 #endif #define access _access #include ntp-4.2.6p5/lib/isc/win32/DLLMain.c0000644000175000017500000000313311307651604015466 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: DLLMain.c,v 1.7 2007/06/18 23:47:49 tbox Exp $ */ #include #include /* * Called when we enter the DLL */ __declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { switch (fdwReason) { /* * The DLL is loading due to process * initialization or a call to LoadLibrary. */ case DLL_PROCESS_ATTACH: break; /* The attached process creates a new thread. */ case DLL_THREAD_ATTACH: break; /* The thread of the attached process terminates. */ case DLL_THREAD_DETACH: break; /* * The DLL is unloading from a process due to * process termination or a call to FreeLibrary. */ case DLL_PROCESS_DETACH: break; default: break; } return (TRUE); } ntp-4.2.6p5/lib/isc/win32/ipv6.c0000644000175000017500000000215311307651603015132 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ipv6.c,v 1.8 2007/06/19 23:47:19 tbox Exp $ */ #include #include LIBISC_EXTERNAL_DATA const struct in6_addr isc_in6addr_any = IN6ADDR_ANY_INIT; LIBISC_EXTERNAL_DATA const struct in6_addr isc_in6addr_loopback = IN6ADDR_LOOPBACK_INIT; ntp-4.2.6p5/lib/isc/win32/stdio.c0000644000175000017500000000475211307651605015401 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: stdio.c,v 1.6 2007/06/19 23:47:19 tbox Exp $ */ #include #include #include #include #include "errno2result.h" isc_result_t isc_stdio_open(const char *filename, const char *mode, FILE **fp) { FILE *f; f = fopen(filename, mode); if (f == NULL) return (isc__errno2result(errno)); *fp = f; return (ISC_R_SUCCESS); } isc_result_t isc_stdio_close(FILE *f) { int r; r = fclose(f); if (r == 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } isc_result_t isc_stdio_seek(FILE *f, long offset, int whence) { int r; r = fseek(f, offset, whence); if (r == 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } isc_result_t isc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f, size_t *nret) { isc_result_t result = ISC_R_SUCCESS; size_t r; clearerr(f); r = fread(ptr, size, nmemb, f); if (r != nmemb) { if (feof(f)) result = ISC_R_EOF; else result = isc__errno2result(errno); } if (nret != NULL) *nret = r; return (result); } isc_result_t isc_stdio_write(const void *ptr, size_t size, size_t nmemb, FILE *f, size_t *nret) { isc_result_t result = ISC_R_SUCCESS; size_t r; clearerr(f); r = fwrite(ptr, size, nmemb, f); if (r != nmemb) result = isc__errno2result(errno); if (nret != NULL) *nret = r; return (result); } isc_result_t isc_stdio_flush(FILE *f) { int r; r = fflush(f); if (r == 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } isc_result_t isc_stdio_sync(FILE *f) { int r; r = _commit(_fileno(f)); if (r == 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } ntp-4.2.6p5/lib/isc/win32/ntgroups.c0000644000175000017500000001252111307651603016127 0ustar peterpeter/* * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: ntgroups.c,v 1.10 2007/06/19 23:47:19 tbox Exp $ */ /* * The NT Groups have two groups that are not well documented and are * not normally seen: None and Everyone. A user account belongs to * any number of groups, but if it is not a member of any group then * it is a member of the None Group. The None group is not listed * anywhere. You cannot remove an account from the none group except * by making it a member of some other group, The second group is the * Everyone group. All accounts, no matter how many groups that they * belong to, also belong to the Everyone group. You cannot remove an * account from the Everyone group. */ #ifndef UNICODE #define UNICODE #endif /* UNICODE */ /* * Silence warnings. */ #define _CRT_SECURE_NO_DEPRECATE 1 #include #include #include #include #include #define MAX_NAME_LENGTH 256 isc_result_t isc_ntsecurity_getaccountgroups(char *username, char **GroupList, unsigned int maxgroups, unsigned int *totalGroups) { LPGROUP_USERS_INFO_0 pTmpBuf; LPLOCALGROUP_USERS_INFO_0 pTmpLBuf; DWORD i; LPLOCALGROUP_USERS_INFO_0 pBuf = NULL; LPGROUP_USERS_INFO_0 pgrpBuf = NULL; DWORD dwLevel = 0; DWORD dwFlags = LG_INCLUDE_INDIRECT; DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH; DWORD dwEntriesRead = 0; DWORD dwTotalEntries = 0; NET_API_STATUS nStatus; DWORD dwTotalCount = 0; int retlen; wchar_t user[MAX_NAME_LENGTH]; retlen = mbstowcs(user, username, MAX_NAME_LENGTH); *totalGroups = 0; /* * Call the NetUserGetLocalGroups function * specifying information level 0. * * The LG_INCLUDE_INDIRECT flag specifies that the * function should also return the names of the local * groups in which the user is indirectly a member. */ nStatus = NetUserGetLocalGroups(NULL, user, dwLevel, dwFlags, (LPBYTE *) &pBuf, dwPrefMaxLen, &dwEntriesRead, &dwTotalEntries); /* * See if the call succeeds, */ if (nStatus != NERR_Success) { if (nStatus == ERROR_ACCESS_DENIED) return (ISC_R_NOPERM); if (nStatus == ERROR_MORE_DATA) return (ISC_R_NOSPACE); if (nStatus == NERR_UserNotFound) dwEntriesRead = 0; } dwTotalCount = 0; if (pBuf != NULL) { pTmpLBuf = pBuf; /* * Loop through the entries */ for (i = 0; (i < dwEntriesRead && *totalGroups < maxgroups); i++) { assert(pTmpLBuf != NULL); if (pTmpLBuf == NULL) break; retlen = wcslen(pTmpLBuf->lgrui0_name); GroupList[*totalGroups] = (char *) malloc(retlen +1); if (GroupList[*totalGroups] == NULL) return (ISC_R_NOMEMORY); retlen = wcstombs(GroupList[*totalGroups], pTmpLBuf->lgrui0_name, retlen); GroupList[*totalGroups][retlen] = '\0'; if (strcmp(GroupList[*totalGroups], "None") == 0) free(GroupList[*totalGroups]); else (*totalGroups)++; pTmpLBuf++; } } /* Free the allocated memory. */ if (pBuf != NULL) NetApiBufferFree(pBuf); /* * Call the NetUserGetGroups function, specifying level 0. */ nStatus = NetUserGetGroups(NULL, user, dwLevel, (LPBYTE*)&pgrpBuf, dwPrefMaxLen, &dwEntriesRead, &dwTotalEntries); /* * See if the call succeeds, */ if (nStatus != NERR_Success) { if (nStatus == ERROR_ACCESS_DENIED) return (ISC_R_NOPERM); if (nStatus == ERROR_MORE_DATA) return (ISC_R_NOSPACE); if (nStatus == NERR_UserNotFound) dwEntriesRead = 0; } if (pgrpBuf != NULL) { pTmpBuf = pgrpBuf; /* * Loop through the entries */ for (i = 0; (i < dwEntriesRead && *totalGroups < maxgroups); i++) { assert(pTmpBuf != NULL); if (pTmpBuf == NULL) break; retlen = wcslen(pTmpBuf->grui0_name); GroupList[*totalGroups] = (char *) malloc(retlen +1); if (GroupList[*totalGroups] == NULL) return (ISC_R_NOMEMORY); retlen = wcstombs(GroupList[*totalGroups], pTmpBuf->grui0_name, retlen); GroupList[*totalGroups][retlen] = '\0'; if (strcmp(GroupList[*totalGroups], "None") == 0) free(GroupList[*totalGroups]); else (*totalGroups)++; pTmpBuf++; } } /* * Free the allocated memory. */ if (pgrpBuf != NULL) NetApiBufferFree(pgrpBuf); return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/win32/syslog.c0000644000175000017500000001023711307651603015570 0ustar peterpeter/* * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: syslog.c,v 1.10 2007/06/19 23:47:19 tbox Exp $ */ #include #include #include #include #include #include #include #include #include #include static HANDLE hAppLog = NULL; static FILE *log_stream; static int debug_level = 0; static struct dsn_c_pvt_sfnt { int val; const char *strval; } facilities[] = { { LOG_KERN, "kern" }, { LOG_USER, "user" }, { LOG_MAIL, "mail" }, { LOG_DAEMON, "daemon" }, { LOG_AUTH, "auth" }, { LOG_SYSLOG, "syslog" }, { LOG_LPR, "lpr" }, #ifdef LOG_NEWS { LOG_NEWS, "news" }, #endif #ifdef LOG_UUCP { LOG_UUCP, "uucp" }, #endif #ifdef LOG_CRON { LOG_CRON, "cron" }, #endif #ifdef LOG_AUTHPRIV { LOG_AUTHPRIV, "authpriv" }, #endif #ifdef LOG_FTP { LOG_FTP, "ftp" }, #endif { LOG_LOCAL0, "local0"}, { LOG_LOCAL1, "local1"}, { LOG_LOCAL2, "local2"}, { LOG_LOCAL3, "local3"}, { LOG_LOCAL4, "local4"}, { LOG_LOCAL5, "local5"}, { LOG_LOCAL6, "local6"}, { LOG_LOCAL7, "local7"}, { 0, NULL } }; isc_result_t isc_syslog_facilityfromstring(const char *str, int *facilityp) { int i; REQUIRE(str != NULL); REQUIRE(facilityp != NULL); for (i = 0; facilities[i].strval != NULL; i++) { if (strcasecmp(facilities[i].strval, str) == 0) { *facilityp = facilities[i].val; return (ISC_R_SUCCESS); } } return (ISC_R_NOTFOUND); } /* * Log to the NT Event Log */ void syslog(int level, const char *fmt, ...) { va_list ap; char buf[1024]; char *str[1]; str[0] = buf; va_start(ap, fmt); vsprintf(buf, fmt, ap); va_end(ap); /* Make sure that the channel is open to write the event */ if (hAppLog != NULL) { switch (level) { case LOG_INFO: case LOG_NOTICE: case LOG_DEBUG: ReportEvent(hAppLog, EVENTLOG_INFORMATION_TYPE, 0, BIND_INFO_MSG, NULL, 1, 0, str, NULL); break; case LOG_WARNING: ReportEvent(hAppLog, EVENTLOG_WARNING_TYPE, 0, BIND_WARN_MSG, NULL, 1, 0, str, NULL); break; default: ReportEvent(hAppLog, EVENTLOG_ERROR_TYPE, 0, BIND_ERR_MSG, NULL, 1, 0, str, NULL); break; } } } /* * Initialize event logging */ void openlog(const char *name, int flags, ...) { /* Get a handle to the Application event log */ hAppLog = RegisterEventSource(NULL, name); } /* * Close the Handle to the application Event Log * We don't care whether or not we succeeded so ignore return values * In fact if we failed then we would have nowhere to put the message */ void closelog() { DeregisterEventSource(hAppLog); } /* * Keep event logging synced with the current debug level */ void ModifyLogLevel(int level) { debug_level = level; } /* * Initialize logging for the port section of libbind. * Piggyback onto stream given. */ void InitNTLogging(FILE *stream, int debug) { log_stream = stream; ModifyLogLevel(debug); } /* * This function is for reporting errors to the application * event log in case the regular syslog is not available * mainly during startup. It should not be used under normal * circumstances. */ void NTReportError(const char *name, const char *str) { HANDLE hNTAppLog = NULL; const char *buf[1]; buf[0] = str; hNTAppLog = RegisterEventSource(NULL, name); ReportEvent(hNTAppLog, EVENTLOG_ERROR_TYPE, 0, BIND_ERR_MSG, NULL, 1, 0, buf, NULL); DeregisterEventSource(hNTAppLog); } ntp-4.2.6p5/lib/isc/win32/socket.c0000644000175000017500000026767511307651604015565 0ustar peterpeter/* * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: socket.c,v 1.70.54.4 2009/01/29 22:40:36 jinmei Exp $ */ /* This code uses functions which are only available on Server 2003 and * higher, and Windows XP and higher. * * This code is by nature multithreaded and takes advantage of various * features to pass on information through the completion port for * when I/O is completed. All sends, receives, accepts, and connects are * completed through the completion port. * * The number of Completion Port Worker threads used is the total number * of CPU's + 1. This increases the likelihood that a Worker Thread is * available for processing a completed request. * * XXXPDM 5 August, 2002 */ #define MAKE_EXTERNAL 1 #include #include #ifndef _WINSOCKAPI_ #define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */ #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "errno2result.h" /* * How in the world can Microsoft exist with APIs like this? * We can't actually call this directly, because it turns out * no library exports this function. Instead, we need to * issue a runtime call to get the address. */ LPFN_CONNECTEX ISCConnectEx; LPFN_ACCEPTEX ISCAcceptEx; LPFN_GETACCEPTEXSOCKADDRS ISCGetAcceptExSockaddrs; /* * Run expensive internal consistency checks. */ #ifdef ISC_SOCKET_CONSISTENCY_CHECKS #define CONSISTENT(sock) consistent(sock) #else #define CONSISTENT(sock) do {} while (0) #endif static void consistent(isc_socket_t *sock); /* * Define this macro to control the behavior of connection * resets on UDP sockets. See Microsoft KnowledgeBase Article Q263823 * for details. * NOTE: This requires that Windows 2000 systems install Service Pack 2 * or later. */ #ifndef SIO_UDP_CONNRESET #define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12) #endif /* * Some systems define the socket length argument as an int, some as size_t, * some as socklen_t. This is here so it can be easily changed if needed. */ #ifndef ISC_SOCKADDR_LEN_T #define ISC_SOCKADDR_LEN_T unsigned int #endif /* * Define what the possible "soft" errors can be. These are non-fatal returns * of various network related functions, like recv() and so on. */ #define SOFT_ERROR(e) ((e) == WSAEINTR || \ (e) == WSAEWOULDBLOCK || \ (e) == EWOULDBLOCK || \ (e) == EINTR || \ (e) == EAGAIN || \ (e) == 0) /* * Pending errors are not really errors and should be * kept separate */ #define PENDING_ERROR(e) ((e) == WSA_IO_PENDING || (e) == 0) #define DOIO_SUCCESS 0 /* i/o ok, event sent */ #define DOIO_SOFT 1 /* i/o ok, soft error, no event sent */ #define DOIO_HARD 2 /* i/o error, event sent */ #define DOIO_EOF 3 /* EOF, no event sent */ #define DOIO_PENDING 4 /* status when i/o is in process */ #define DOIO_NEEDMORE 5 /* IO was processed, but we need more due to minimum */ #define DLVL(x) ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(x) /* * DLVL(90) -- Function entry/exit and other tracing. * DLVL(70) -- Socket "correctness" -- including returning of events, etc. * DLVL(60) -- Socket data send/receive * DLVL(50) -- Event tracing, including receiving/sending completion events. * DLVL(20) -- Socket creation/destruction. */ #define TRACE_LEVEL 90 #define CORRECTNESS_LEVEL 70 #define IOEVENT_LEVEL 60 #define EVENT_LEVEL 50 #define CREATION_LEVEL 20 #define TRACE DLVL(TRACE_LEVEL) #define CORRECTNESS DLVL(CORRECTNESS_LEVEL) #define IOEVENT DLVL(IOEVENT_LEVEL) #define EVENT DLVL(EVENT_LEVEL) #define CREATION DLVL(CREATION_LEVEL) typedef isc_event_t intev_t; /* * Socket State */ enum { SOCK_INITIALIZED, /* Socket Initialized */ SOCK_OPEN, /* Socket opened but nothing yet to do */ SOCK_DATA, /* Socket sending or receiving data */ SOCK_LISTEN, /* TCP Socket listening for connects */ SOCK_ACCEPT, /* TCP socket is waiting to accept */ SOCK_CONNECT, /* TCP Socket connecting */ SOCK_CLOSED, /* Socket has been closed */ }; #define SOCKET_MAGIC ISC_MAGIC('I', 'O', 'i', 'o') #define VALID_SOCKET(t) ISC_MAGIC_VALID(t, SOCKET_MAGIC) /* * IPv6 control information. If the socket is an IPv6 socket we want * to collect the destination address and interface so the client can * set them on outgoing packets. */ #ifdef ISC_PLATFORM_HAVEIPV6 #ifndef USE_CMSG #define USE_CMSG 1 #endif #endif /* * We really don't want to try and use these control messages. Win32 * doesn't have this mechanism before XP. */ #undef USE_CMSG /* * Message header for recvmsg and sendmsg calls. * Used value-result for recvmsg, value only for sendmsg. */ struct msghdr { SOCKADDR_STORAGE to_addr; /* UDP send/recv address */ int to_addr_len; /* length of the address */ WSABUF *msg_iov; /* scatter/gather array */ u_int msg_iovlen; /* # elements in msg_iov */ void *msg_control; /* ancillary data, see below */ u_int msg_controllen; /* ancillary data buffer len */ int msg_totallen; /* total length of this message */ } msghdr; /* * The size to raise the receive buffer to. */ #define RCVBUFSIZE (32*1024) /* * The number of times a send operation is repeated if the result * is WSAEINTR. */ #define NRETRIES 10 struct isc_socket { /* Not locked. */ unsigned int magic; isc_socketmgr_t *manager; isc_mutex_t lock; isc_sockettype_t type; /* Pointers to scatter/gather buffers */ WSABUF iov[ISC_SOCKET_MAXSCATTERGATHER]; /* Locked by socket lock. */ ISC_LINK(isc_socket_t) link; unsigned int references; /* EXTERNAL references */ SOCKET fd; /* file handle */ int pf; /* protocol family */ char name[16]; void * tag; /* * Each recv() call uses this buffer. It is a per-socket receive * buffer that allows us to decouple the system recv() from the * recv_list done events. This means the items on the recv_list * can be removed without having to cancel pending system recv() * calls. It also allows us to read-ahead in some cases. */ struct { SOCKADDR_STORAGE from_addr; // UDP send/recv address int from_addr_len; // length of the address char *base; // the base of the buffer char *consume_position; // where to start copying data from next unsigned int len; // the actual size of this buffer unsigned int remaining; // the number of bytes remaining } recvbuf; ISC_LIST(isc_socketevent_t) send_list; ISC_LIST(isc_socketevent_t) recv_list; ISC_LIST(isc_socket_newconnev_t) accept_list; isc_socket_connev_t *connect_ev; isc_sockaddr_t address; /* remote address */ unsigned int listener : 1, /* listener socket */ connected : 1, pending_connect : 1, /* connect pending */ bound : 1; /* bound to local addr */ unsigned int pending_iocp; /* Should equal the counters below. Debug. */ unsigned int pending_recv; /* Number of outstanding recv() calls. */ unsigned int pending_send; /* Number of outstanding send() calls. */ unsigned int pending_accept; /* Number of outstanding accept() calls. */ unsigned int state; /* Socket state. Debugging and consistency checking. */ int state_lineno; /* line which last touched state */ }; #define _set_state(sock, _state) do { (sock)->state = (_state); (sock)->state_lineno = __LINE__; } while (0) /* * Buffer structure */ typedef struct buflist buflist_t; struct buflist { void *buf; unsigned int buflen; ISC_LINK(buflist_t) link; }; /* * I/O Completion ports Info structures */ static HANDLE hHeapHandle = NULL; typedef struct IoCompletionInfo { OVERLAPPED overlapped; isc_socketevent_t *dev; /* send()/recv() done event */ isc_socket_connev_t *cdev; /* connect() done event */ isc_socket_newconnev_t *adev; /* accept() done event */ void *acceptbuffer; DWORD received_bytes; int request_type; struct msghdr messagehdr; ISC_LIST(buflist_t) bufferlist; /*%< list of buffers */ } IoCompletionInfo; /* * Define a maximum number of I/O Completion Port worker threads * to handle the load on the Completion Port. The actual number * used is the number of CPU's + 1. */ #define MAX_IOCPTHREADS 20 #define SOCKET_MANAGER_MAGIC ISC_MAGIC('I', 'O', 'm', 'g') #define VALID_MANAGER(m) ISC_MAGIC_VALID(m, SOCKET_MANAGER_MAGIC) struct isc_socketmgr { /* Not locked. */ unsigned int magic; isc_mem_t *mctx; isc_mutex_t lock; isc_stats_t *stats; /* Locked by manager lock. */ ISC_LIST(isc_socket_t) socklist; isc_boolean_t bShutdown; isc_condition_t shutdown_ok; HANDLE hIoCompletionPort; int maxIOCPThreads; HANDLE hIOCPThreads[MAX_IOCPTHREADS]; DWORD dwIOCPThreadIds[MAX_IOCPTHREADS]; /* * Debugging. * Modified by InterlockedIncrement() and InterlockedDecrement() */ LONG totalSockets; LONG iocp_total; }; enum { SOCKET_RECV, SOCKET_SEND, SOCKET_ACCEPT, SOCKET_CONNECT }; /* * send() and recv() iovec counts */ #define MAXSCATTERGATHER_SEND (ISC_SOCKET_MAXSCATTERGATHER) #define MAXSCATTERGATHER_RECV (ISC_SOCKET_MAXSCATTERGATHER) static isc_threadresult_t WINAPI SocketIoThread(LPVOID ThreadContext); static void maybe_free_socket(isc_socket_t **, int); static void free_socket(isc_socket_t **, int); static isc_boolean_t senddone_is_active(isc_socket_t *sock, isc_socketevent_t *dev); static isc_boolean_t acceptdone_is_active(isc_socket_t *sock, isc_socket_newconnev_t *dev); static isc_boolean_t connectdone_is_active(isc_socket_t *sock, isc_socket_connev_t *dev); static void send_recvdone_event(isc_socket_t *sock, isc_socketevent_t **dev); static void send_senddone_event(isc_socket_t *sock, isc_socketevent_t **dev); static void send_acceptdone_event(isc_socket_t *sock, isc_socket_newconnev_t **adev); static void send_connectdone_event(isc_socket_t *sock, isc_socket_connev_t **cdev); static void send_recvdone_abort(isc_socket_t *sock, isc_result_t result); static void queue_receive_event(isc_socket_t *sock, isc_task_t *task, isc_socketevent_t *dev); static void queue_receive_request(isc_socket_t *sock); /* * This is used to dump the contents of the sock structure * You should make sure that the sock is locked before * dumping it. Since the code uses simple printf() statements * it should only be used interactively. */ void sock_dump(isc_socket_t *sock) { isc_socketevent_t *ldev; isc_socket_newconnev_t *ndev; #if 0 isc_sockaddr_t addr; char socktext[256]; isc_socket_getpeername(sock, &addr); isc_sockaddr_format(&addr, socktext, sizeof(socktext)); printf("Remote Socket: %s\n", socktext); isc_socket_getsockname(sock, &addr); isc_sockaddr_format(&addr, socktext, sizeof(socktext)); printf("This Socket: %s\n", socktext); #endif printf("\n\t\tSock Dump\n"); printf("\t\tfd: %u\n", sock->fd); printf("\t\treferences: %d\n", sock->references); printf("\t\tpending_accept: %d\n", sock->pending_accept); printf("\t\tconnecting: %d\n", sock->pending_connect); printf("\t\tconnected: %d\n", sock->connected); printf("\t\tbound: %d\n", sock->bound); printf("\t\tpending_iocp: %d\n", sock->pending_iocp); printf("\t\tsocket type: %d\n", sock->type); printf("\n\t\tSock Recv List\n"); ldev = ISC_LIST_HEAD(sock->recv_list); while (ldev != NULL) { printf("\t\tdev: %p\n", ldev); ldev = ISC_LIST_NEXT(ldev, ev_link); } printf("\n\t\tSock Send List\n"); ldev = ISC_LIST_HEAD(sock->send_list); while (ldev != NULL) { printf("\t\tdev: %p\n", ldev); ldev = ISC_LIST_NEXT(ldev, ev_link); } printf("\n\t\tSock Accept List\n"); ndev = ISC_LIST_HEAD(sock->accept_list); while (ndev != NULL) { printf("\t\tdev: %p\n", ldev); ndev = ISC_LIST_NEXT(ndev, ev_link); } } static void socket_log(int lineno, isc_socket_t *sock, isc_sockaddr_t *address, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int message, const char *fmt, ...) ISC_FORMAT_PRINTF(9, 10); /* This function will add an entry to the I/O completion port * that will signal the I/O thread to exit (gracefully) */ static void signal_iocompletionport_exit(isc_socketmgr_t *manager) { int i; int errval; char strbuf[ISC_STRERRORSIZE]; REQUIRE(VALID_MANAGER(manager)); for (i = 0; i < manager->maxIOCPThreads; i++) { if (!PostQueuedCompletionStatus(manager->hIoCompletionPort, 0, 0, 0)) { errval = GetLastError(); isc__strerror(errval, strbuf, sizeof(strbuf)); FATAL_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_FAILED, "Can't request service thread to exit: %s"), strbuf); } } } /* * Create the worker threads for the I/O Completion Port */ void iocompletionport_createthreads(int total_threads, isc_socketmgr_t *manager) { int errval; char strbuf[ISC_STRERRORSIZE]; int i; INSIST(total_threads > 0); REQUIRE(VALID_MANAGER(manager)); /* * We need at least one */ for (i = 0; i < total_threads; i++) { manager->hIOCPThreads[i] = CreateThread(NULL, 0, SocketIoThread, manager, 0, &manager->dwIOCPThreadIds[i]); if (manager->hIOCPThreads[i] == NULL) { errval = GetLastError(); isc__strerror(errval, strbuf, sizeof(strbuf)); FATAL_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_FAILED, "Can't create IOCP thread: %s"), strbuf); exit(1); } } } /* * Create/initialise the I/O completion port */ void iocompletionport_init(isc_socketmgr_t *manager) { int errval; char strbuf[ISC_STRERRORSIZE]; REQUIRE(VALID_MANAGER(manager)); /* * Create a private heap to handle the socket overlapped structure * The minimum number of structures is 10, there is no maximum */ hHeapHandle = HeapCreate(0, 10 * sizeof(IoCompletionInfo), 0); if (hHeapHandle == NULL) { errval = GetLastError(); isc__strerror(errval, strbuf, sizeof(strbuf)); FATAL_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_FAILED, "HeapCreate() failed during " "initialization: %s"), strbuf); exit(1); } manager->maxIOCPThreads = min(isc_os_ncpus() + 1, MAX_IOCPTHREADS); /* Now Create the Completion Port */ manager->hIoCompletionPort = CreateIoCompletionPort( INVALID_HANDLE_VALUE, NULL, 0, manager->maxIOCPThreads); if (manager->hIoCompletionPort == NULL) { errval = GetLastError(); isc__strerror(errval, strbuf, sizeof(strbuf)); FATAL_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_FAILED, "CreateIoCompletionPort() failed " "during initialization: %s"), strbuf); exit(1); } /* * Worker threads for servicing the I/O */ iocompletionport_createthreads(manager->maxIOCPThreads, manager); } /* * Associate a socket with an IO Completion Port. This allows us to queue events for it * and have our worker pool of threads process them. */ void iocompletionport_update(isc_socket_t *sock) { HANDLE hiocp; char strbuf[ISC_STRERRORSIZE]; REQUIRE(VALID_SOCKET(sock)); hiocp = CreateIoCompletionPort((HANDLE)sock->fd, sock->manager->hIoCompletionPort, (ULONG_PTR)sock, 0); if (hiocp == NULL) { DWORD errval = GetLastError(); isc__strerror(errval, strbuf, sizeof(strbuf)); isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_TOOMANYHANDLES, "iocompletionport_update: failed to open" " io completion port: %s", strbuf); /* XXXMLG temporary hack to make failures detected. * This function should return errors to the caller, not * exit here. */ FATAL_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_FAILED, "CreateIoCompletionPort() failed " "during initialization: %s"), strbuf); exit(1); } InterlockedIncrement(&sock->manager->iocp_total); } /* * Routine to cleanup and then close the socket. * Only close the socket here if it is NOT associated * with an event, otherwise the WSAWaitForMultipleEvents * may fail due to the fact that the Wait should not * be running while closing an event or a socket. * The socket is locked before calling this function */ void socket_close(isc_socket_t *sock) { REQUIRE(sock != NULL); if (sock->fd != INVALID_SOCKET) { closesocket(sock->fd); sock->fd = INVALID_SOCKET; _set_state(sock, SOCK_CLOSED); InterlockedDecrement(&sock->manager->totalSockets); } } static isc_once_t initialise_once = ISC_ONCE_INIT; static isc_boolean_t initialised = ISC_FALSE; static void initialise(void) { WORD wVersionRequested; WSADATA wsaData; int err; SOCKET sock; GUID GUIDConnectEx = WSAID_CONNECTEX; GUID GUIDAcceptEx = WSAID_ACCEPTEX; GUID GUIDGetAcceptExSockaddrs = WSAID_GETACCEPTEXSOCKADDRS; DWORD dwBytes; /* Need Winsock 2.2 or better */ wVersionRequested = MAKEWORD(2, 2); err = WSAStartup(wVersionRequested, &wsaData); if (err != 0) { char strbuf[ISC_STRERRORSIZE]; isc__strerror(err, strbuf, sizeof(strbuf)); FATAL_ERROR(__FILE__, __LINE__, "WSAStartup() %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); exit(1); } /* * The following APIs do not exist as functions in a library, but we must * ask winsock for them. They are "extensions" -- but why they cannot be * actual functions is beyond me. So, ask winsock for the pointers to the * functions we need. */ sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); INSIST(sock != INVALID_SOCKET); err = WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER, &GUIDConnectEx, sizeof(GUIDConnectEx), &ISCConnectEx, sizeof(ISCConnectEx), &dwBytes, NULL, NULL); INSIST(err == 0); err = WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER, &GUIDAcceptEx, sizeof(GUIDAcceptEx), &ISCAcceptEx, sizeof(ISCAcceptEx), &dwBytes, NULL, NULL); INSIST(err == 0); err = WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER, &GUIDGetAcceptExSockaddrs, sizeof(GUIDGetAcceptExSockaddrs), &ISCGetAcceptExSockaddrs, sizeof(ISCGetAcceptExSockaddrs), &dwBytes, NULL, NULL); INSIST(err == 0); closesocket(sock); initialised = ISC_TRUE; } /* * Initialize socket services */ void InitSockets(void) { RUNTIME_CHECK(isc_once_do(&initialise_once, initialise) == ISC_R_SUCCESS); if (!initialised) exit(1); } int internal_sendmsg(isc_socket_t *sock, IoCompletionInfo *lpo, struct msghdr *messagehdr, int flags, int *Error) { int Result; DWORD BytesSent; DWORD Flags = flags; int total_sent; *Error = 0; Result = WSASendTo(sock->fd, messagehdr->msg_iov, messagehdr->msg_iovlen, &BytesSent, Flags, (SOCKADDR *)&messagehdr->to_addr, messagehdr->to_addr_len, (LPWSAOVERLAPPED)lpo, NULL); total_sent = (int)BytesSent; /* Check for errors.*/ if (Result == SOCKET_ERROR) { *Error = WSAGetLastError(); switch (*Error) { case WSA_IO_INCOMPLETE: case WSA_WAIT_IO_COMPLETION: case WSA_IO_PENDING: case NO_ERROR: /* Strange, but okay */ sock->pending_iocp++; sock->pending_send++; break; default: return (-1); break; } } else { sock->pending_iocp++; sock->pending_send++; } if (lpo != NULL) return (0); else return (total_sent); } static void queue_receive_request(isc_socket_t *sock) { DWORD Flags = 0; DWORD NumBytes = 0; int total_bytes = 0; int Result; int Error; WSABUF iov[1]; IoCompletionInfo *lpo; isc_result_t isc_result; /* * If we already have a receive pending, do nothing. */ if (sock->pending_recv > 0) return; /* * If no one is waiting, do nothing. */ if (ISC_LIST_EMPTY(sock->recv_list)) return; INSIST(sock->recvbuf.remaining == 0); INSIST(sock->fd != INVALID_SOCKET); iov[0].len = sock->recvbuf.len; iov[0].buf = sock->recvbuf.base; lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, sizeof(IoCompletionInfo)); RUNTIME_CHECK(lpo != NULL); lpo->request_type = SOCKET_RECV; sock->recvbuf.from_addr_len = sizeof(sock->recvbuf.from_addr); Error = 0; Result = WSARecvFrom((SOCKET)sock->fd, iov, 1, &NumBytes, &Flags, (SOCKADDR *)&sock->recvbuf.from_addr, &sock->recvbuf.from_addr_len, (LPWSAOVERLAPPED)lpo, NULL); /* Check for errors. */ if (Result == SOCKET_ERROR) { Error = WSAGetLastError(); switch (Error) { case WSA_IO_PENDING: sock->pending_iocp++; sock->pending_recv++; break; default: isc_result = isc__errno2result(Error); if (isc_result == ISC_R_UNEXPECTED) UNEXPECTED_ERROR(__FILE__, __LINE__, "WSARecvFrom: Windows error code: %d, isc result %d", Error, isc_result); send_recvdone_abort(sock, isc_result); break; } } else { /* * The recv() finished immediately, but we will still get * a completion event. Rather than duplicate code, let * that thread handle sending the data along its way. */ sock->pending_iocp++; sock->pending_recv++; } socket_log(__LINE__, sock, NULL, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_DOIORECV, "queue_io_request: fd %d result %d error %d", sock->fd, Result, Error); CONSISTENT(sock); } static void manager_log(isc_socketmgr_t *sockmgr, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *fmt, ...) { char msgbuf[2048]; va_list ap; if (!isc_log_wouldlog(isc_lctx, level)) return; va_start(ap, fmt); vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); va_end(ap); isc_log_write(isc_lctx, category, module, level, "sockmgr %p: %s", sockmgr, msgbuf); } static void socket_log(int lineno, isc_socket_t *sock, isc_sockaddr_t *address, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int message, const char *fmt, ...) { char msgbuf[2048]; char peerbuf[256]; va_list ap; if (!isc_log_wouldlog(isc_lctx, level)) return; va_start(ap, fmt); vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); va_end(ap); if (address == NULL) { isc_log_iwrite(isc_lctx, category, module, level, msgcat, msgset, message, "socket %p line %d: %s", sock, lineno, msgbuf); } else { isc_sockaddr_format(address, peerbuf, sizeof(peerbuf)); isc_log_iwrite(isc_lctx, category, module, level, msgcat, msgset, message, "socket %p line %d peer %s: %s", sock, lineno, peerbuf, msgbuf); } } /* * Make an fd SOCKET non-blocking. */ static isc_result_t make_nonblock(SOCKET fd) { int ret; unsigned long flags = 1; char strbuf[ISC_STRERRORSIZE]; /* Set the socket to non-blocking */ ret = ioctlsocket(fd, FIONBIO, &flags); if (ret == -1) { isc__strerror(errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "ioctlsocket(%d, FIOBIO, %d): %s", fd, flags, strbuf); return (ISC_R_UNEXPECTED); } return (ISC_R_SUCCESS); } /* * Windows 2000 systems incorrectly cause UDP sockets using WASRecvFrom * to not work correctly, returning a WSACONNRESET error when a WSASendTo * fails with an "ICMP port unreachable" response and preventing the * socket from using the WSARecvFrom in subsequent operations. * The function below fixes this, but requires that Windows 2000 * Service Pack 2 or later be installed on the system. NT 4.0 * systems are not affected by this and work correctly. * See Microsoft Knowledge Base Article Q263823 for details of this. */ isc_result_t connection_reset_fix(SOCKET fd) { DWORD dwBytesReturned = 0; BOOL bNewBehavior = FALSE; DWORD status; if (isc_win32os_majorversion() < 5) return (ISC_R_SUCCESS); /* NT 4.0 has no problem */ /* disable bad behavior using IOCTL: SIO_UDP_CONNRESET */ status = WSAIoctl(fd, SIO_UDP_CONNRESET, &bNewBehavior, sizeof(bNewBehavior), NULL, 0, &dwBytesReturned, NULL, NULL); if (status != SOCKET_ERROR) return (ISC_R_SUCCESS); else { UNEXPECTED_ERROR(__FILE__, __LINE__, "WSAIoctl(SIO_UDP_CONNRESET, oldBehaviour) %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); return (ISC_R_UNEXPECTED); } } /* * Construct an iov array and attach it to the msghdr passed in. This is * the SEND constructor, which will use the used region of the buffer * (if using a buffer list) or will use the internal region (if a single * buffer I/O is requested). * * Nothing can be NULL, and the done event must list at least one buffer * on the buffer linked list for this function to be meaningful. */ static void build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *msg, char *cmsg, WSABUF *iov, IoCompletionInfo *lpo) { unsigned int iovcount; isc_buffer_t *buffer; buflist_t *cpbuffer; isc_region_t used; size_t write_count; size_t skip_count; memset(msg, 0, sizeof(*msg)); memcpy(&msg->to_addr, &dev->address.type, dev->address.length); msg->to_addr_len = dev->address.length; buffer = ISC_LIST_HEAD(dev->bufferlist); write_count = 0; iovcount = 0; /* * Single buffer I/O? Skip what we've done so far in this region. */ if (buffer == NULL) { write_count = dev->region.length - dev->n; cpbuffer = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, sizeof(buflist_t)); RUNTIME_CHECK(cpbuffer != NULL); cpbuffer->buf = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, write_count); RUNTIME_CHECK(cpbuffer->buf != NULL); socket_log(__LINE__, sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK, "alloc_buffer %p %d %p %d", cpbuffer, sizeof(buflist_t), cpbuffer->buf, write_count); memcpy(cpbuffer->buf,(dev->region.base + dev->n), write_count); cpbuffer->buflen = write_count; ISC_LIST_ENQUEUE(lpo->bufferlist, cpbuffer, link); iov[0].buf = cpbuffer->buf; iov[0].len = write_count; iovcount = 1; goto config; } /* * Multibuffer I/O. * Skip the data in the buffer list that we have already written. */ skip_count = dev->n; while (buffer != NULL) { REQUIRE(ISC_BUFFER_VALID(buffer)); if (skip_count < isc_buffer_usedlength(buffer)) break; skip_count -= isc_buffer_usedlength(buffer); buffer = ISC_LIST_NEXT(buffer, link); } while (buffer != NULL) { INSIST(iovcount < MAXSCATTERGATHER_SEND); isc_buffer_usedregion(buffer, &used); if (used.length > 0) { int uselen = used.length - skip_count; cpbuffer = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, sizeof(buflist_t)); RUNTIME_CHECK(cpbuffer != NULL); cpbuffer->buf = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, uselen); RUNTIME_CHECK(cpbuffer->buf != NULL); socket_log(__LINE__, sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK, "alloc_buffer %p %d %p %d", cpbuffer, sizeof(buflist_t), cpbuffer->buf, write_count); memcpy(cpbuffer->buf,(used.base + skip_count), uselen); cpbuffer->buflen = uselen; iov[iovcount].buf = cpbuffer->buf; iov[iovcount].len = used.length - skip_count; write_count += uselen; skip_count = 0; iovcount++; } buffer = ISC_LIST_NEXT(buffer, link); } INSIST(skip_count == 0); config: msg->msg_iov = iov; msg->msg_iovlen = iovcount; msg->msg_totallen = write_count; } static void set_dev_address(isc_sockaddr_t *address, isc_socket_t *sock, isc_socketevent_t *dev) { if (sock->type == isc_sockettype_udp) { if (address != NULL) dev->address = *address; else dev->address = sock->address; } else if (sock->type == isc_sockettype_tcp) { INSIST(address == NULL); dev->address = sock->address; } } static void destroy_socketevent(isc_event_t *event) { isc_socketevent_t *ev = (isc_socketevent_t *)event; INSIST(ISC_LIST_EMPTY(ev->bufferlist)); (ev->destroy)(event); } static isc_socketevent_t * allocate_socketevent(isc_socket_t *sock, isc_eventtype_t eventtype, isc_taskaction_t action, const void *arg) { isc_socketevent_t *ev; ev = (isc_socketevent_t *)isc_event_allocate(sock->manager->mctx, sock, eventtype, action, arg, sizeof(*ev)); if (ev == NULL) return (NULL); ev->result = ISC_R_IOERROR; // XXXMLG temporary change to detect failure to set ISC_LINK_INIT(ev, ev_link); ISC_LIST_INIT(ev->bufferlist); ev->region.base = NULL; ev->n = 0; ev->offset = 0; ev->attributes = 0; ev->destroy = ev->ev_destroy; ev->ev_destroy = destroy_socketevent; return (ev); } #if defined(ISC_SOCKET_DEBUG) static void dump_msg(struct msghdr *msg, isc_socket_t *sock) { unsigned int i; printf("MSGHDR %p, Socket #: %u\n", msg, sock->fd); printf("\tname %p, namelen %d\n", msg->msg_name, msg->msg_namelen); printf("\tiov %p, iovlen %d\n", msg->msg_iov, msg->msg_iovlen); for (i = 0; i < (unsigned int)msg->msg_iovlen; i++) printf("\t\t%d\tbase %p, len %d\n", i, msg->msg_iov[i].buf, msg->msg_iov[i].len); } #endif /* * map the error code */ int map_socket_error(isc_socket_t *sock, int windows_errno, int *isc_errno, char *errorstring, size_t bufsize) { int doreturn; switch (windows_errno) { case WSAECONNREFUSED: *isc_errno = ISC_R_CONNREFUSED; if (sock->connected) doreturn = DOIO_HARD; else doreturn = DOIO_SOFT; break; case WSAENETUNREACH: case ERROR_NETWORK_UNREACHABLE: *isc_errno = ISC_R_NETUNREACH; if (sock->connected) doreturn = DOIO_HARD; else doreturn = DOIO_SOFT; break; case ERROR_PORT_UNREACHABLE: case ERROR_HOST_UNREACHABLE: case WSAEHOSTUNREACH: *isc_errno = ISC_R_HOSTUNREACH; if (sock->connected) doreturn = DOIO_HARD; else doreturn = DOIO_SOFT; break; case WSAENETDOWN: *isc_errno = ISC_R_NETDOWN; if (sock->connected) doreturn = DOIO_HARD; else doreturn = DOIO_SOFT; break; case WSAEHOSTDOWN: *isc_errno = ISC_R_HOSTDOWN; if (sock->connected) doreturn = DOIO_HARD; else doreturn = DOIO_SOFT; break; case WSAEACCES: *isc_errno = ISC_R_NOPERM; if (sock->connected) doreturn = DOIO_HARD; else doreturn = DOIO_SOFT; break; case WSAECONNRESET: case WSAENETRESET: case WSAECONNABORTED: case WSAEDISCON: *isc_errno = ISC_R_CONNECTIONRESET; if (sock->connected) doreturn = DOIO_HARD; else doreturn = DOIO_SOFT; break; case WSAENOTCONN: *isc_errno = ISC_R_NOTCONNECTED; if (sock->connected) doreturn = DOIO_HARD; else doreturn = DOIO_SOFT; break; case ERROR_OPERATION_ABORTED: case ERROR_CONNECTION_ABORTED: case ERROR_REQUEST_ABORTED: *isc_errno = ISC_R_CONNECTIONRESET; doreturn = DOIO_HARD; break; case WSAENOBUFS: *isc_errno = ISC_R_NORESOURCES; doreturn = DOIO_HARD; break; case WSAEAFNOSUPPORT: *isc_errno = ISC_R_FAMILYNOSUPPORT; doreturn = DOIO_HARD; break; case WSAEADDRNOTAVAIL: *isc_errno = ISC_R_ADDRNOTAVAIL; doreturn = DOIO_HARD; break; case WSAEDESTADDRREQ: *isc_errno = ISC_R_BADADDRESSFORM; doreturn = DOIO_HARD; break; case ERROR_NETNAME_DELETED: *isc_errno = ISC_R_NETDOWN; doreturn = DOIO_HARD; break; default: *isc_errno = ISC_R_IOERROR; doreturn = DOIO_HARD; break; } if (doreturn == DOIO_HARD) { isc__strerror(windows_errno, errorstring, bufsize); } return (doreturn); } static void fill_recv(isc_socket_t *sock, isc_socketevent_t *dev) { isc_region_t r; int copylen; isc_buffer_t *buffer; INSIST(dev->n < dev->minimum); INSIST(sock->recvbuf.remaining > 0); INSIST(sock->pending_recv == 0); if (sock->type == isc_sockettype_udp) { dev->address.length = sock->recvbuf.from_addr_len; memcpy(&dev->address.type, &sock->recvbuf.from_addr, sock->recvbuf.from_addr_len); if (isc_sockaddr_getport(&dev->address) == 0) { if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) { socket_log(__LINE__, sock, &dev->address, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ZEROPORT, "dropping source port zero packet"); } sock->recvbuf.remaining = 0; return; } } else if (sock->type == isc_sockettype_tcp) { dev->address = sock->address; } /* * Run through the list of buffers we were given, and find the * first one with space. Once it is found, loop through, filling * the buffers as much as possible. */ buffer = ISC_LIST_HEAD(dev->bufferlist); if (buffer != NULL) { // Multi-buffer receive while (buffer != NULL && sock->recvbuf.remaining > 0) { REQUIRE(ISC_BUFFER_VALID(buffer)); if (isc_buffer_availablelength(buffer) > 0) { isc_buffer_availableregion(buffer, &r); copylen = min(r.length, sock->recvbuf.remaining); memcpy(r.base, sock->recvbuf.consume_position, copylen); sock->recvbuf.consume_position += copylen; sock->recvbuf.remaining -= copylen; isc_buffer_add(buffer, copylen); dev->n += copylen; } buffer = ISC_LIST_NEXT(buffer, link); } } else { // Single-buffer receive copylen = min(dev->region.length - dev->n, sock->recvbuf.remaining); memcpy(dev->region.base + dev->n, sock->recvbuf.consume_position, copylen); sock->recvbuf.consume_position += copylen; sock->recvbuf.remaining -= copylen; dev->n += copylen; } /* * UDP receives are all-consuming. That is, if we have 4k worth of * data in our receive buffer, and the caller only gave us * 1k of space, we will toss the remaining 3k of data. TCP * will keep the extra data around and use it for later requests. */ if (sock->type == isc_sockettype_udp) sock->recvbuf.remaining = 0; } /* * Copy out as much data from the internal buffer to done events. * As each done event is filled, send it along its way. */ static void completeio_recv(isc_socket_t *sock) { isc_socketevent_t *dev; /* * If we are in the process of filling our buffer, we cannot * touch it yet, so don't. */ if (sock->pending_recv > 0) return; while (sock->recvbuf.remaining > 0 && !ISC_LIST_EMPTY(sock->recv_list)) { dev = ISC_LIST_HEAD(sock->recv_list); /* * See if we have sufficient data in our receive buffer * to handle this. If we do, copy out the data. */ fill_recv(sock, dev); /* * Did we satisfy it? */ if (dev->n >= dev->minimum) { dev->result = ISC_R_SUCCESS; send_recvdone_event(sock, &dev); } } } /* * Returns: * DOIO_SUCCESS The operation succeeded. dev->result contains * ISC_R_SUCCESS. * * DOIO_HARD A hard or unexpected I/O error was encountered. * dev->result contains the appropriate error. * * DOIO_SOFT A soft I/O error was encountered. No senddone * event was sent. The operation should be retried. * * No other return values are possible. */ static int completeio_send(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *messagehdr, int cc, int send_errno) { char addrbuf[ISC_SOCKADDR_FORMATSIZE]; char strbuf[ISC_STRERRORSIZE]; if (send_errno != 0) { if (SOFT_ERROR(send_errno)) return (DOIO_SOFT); return (map_socket_error(sock, send_errno, &dev->result, strbuf, sizeof(strbuf))); /* * The other error types depend on whether or not the * socket is UDP or TCP. If it is UDP, some errors * that we expect to be fatal under TCP are merely * annoying, and are really soft errors. * * However, these soft errors are still returned as * a status. */ isc_sockaddr_format(&dev->address, addrbuf, sizeof(addrbuf)); isc__strerror(send_errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "completeio_send: %s: %s", addrbuf, strbuf); dev->result = isc__errno2result(send_errno); return (DOIO_HARD); } /* * If we write less than we expected, update counters, poke. */ dev->n += cc; if (cc != messagehdr->msg_totallen) return (DOIO_SOFT); /* * Exactly what we wanted to write. We're done with this * entry. Post its completion event. */ dev->result = ISC_R_SUCCESS; return (DOIO_SUCCESS); } static int startio_send(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes, int *send_errno) { char *cmsg = NULL; char strbuf[ISC_STRERRORSIZE]; IoCompletionInfo *lpo; int status; struct msghdr *msghdr; lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, sizeof(IoCompletionInfo)); RUNTIME_CHECK(lpo != NULL); lpo->request_type = SOCKET_SEND; lpo->dev = dev; msghdr = &lpo->messagehdr; memset(msghdr, 0, sizeof(struct msghdr)); ISC_LIST_INIT(lpo->bufferlist); build_msghdr_send(sock, dev, msghdr, cmsg, sock->iov, lpo); *nbytes = internal_sendmsg(sock, lpo, msghdr, 0, send_errno); if (*nbytes < 0) { /* * I/O has been initiated * completion will be through the completion port */ if (PENDING_ERROR(*send_errno)) { status = DOIO_PENDING; goto done; } if (SOFT_ERROR(*send_errno)) { status = DOIO_SOFT; goto done; } /* * If we got this far then something is wrong */ if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) { isc__strerror(*send_errno, strbuf, sizeof(strbuf)); socket_log(__LINE__, sock, NULL, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALSEND, "startio_send: internal_sendmsg(%d) %d " "bytes, err %d/%s", sock->fd, *nbytes, *send_errno, strbuf); } goto done; } dev->result = ISC_R_SUCCESS; status = DOIO_SOFT; done: _set_state(sock, SOCK_DATA); return (status); } static isc_result_t allocate_socket(isc_socketmgr_t *manager, isc_sockettype_t type, isc_socket_t **socketp) { isc_socket_t *sock; isc_result_t result; sock = isc_mem_get(manager->mctx, sizeof(*sock)); if (sock == NULL) return (ISC_R_NOMEMORY); sock->magic = 0; sock->references = 0; sock->manager = manager; sock->type = type; sock->fd = INVALID_SOCKET; ISC_LINK_INIT(sock, link); /* * set up list of readers and writers to be initially empty */ ISC_LIST_INIT(sock->recv_list); ISC_LIST_INIT(sock->send_list); ISC_LIST_INIT(sock->accept_list); sock->connect_ev = NULL; sock->pending_accept = 0; sock->pending_recv = 0; sock->pending_send = 0; sock->pending_iocp = 0; sock->listener = 0; sock->connected = 0; sock->pending_connect = 0; sock->bound = 0; memset(sock->name, 0, sizeof(sock->name)); // zero the name field _set_state(sock, SOCK_INITIALIZED); sock->recvbuf.len = 65536; sock->recvbuf.consume_position = sock->recvbuf.base; sock->recvbuf.remaining = 0; sock->recvbuf.base = isc_mem_get(manager->mctx, sock->recvbuf.len); // max buffer size if (sock->recvbuf.base == NULL) { sock->magic = 0; goto error; } /* * initialize the lock */ result = isc_mutex_init(&sock->lock); if (result != ISC_R_SUCCESS) { sock->magic = 0; isc_mem_put(manager->mctx, sock->recvbuf.base, sock->recvbuf.len); sock->recvbuf.base = NULL; goto error; } socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, "allocated"); sock->magic = SOCKET_MAGIC; *socketp = sock; return (ISC_R_SUCCESS); error: isc_mem_put(manager->mctx, sock, sizeof(*sock)); return (result); } /* * Verify that the socket state is consistent. */ static void consistent(isc_socket_t *sock) { isc_socketevent_t *dev; isc_socket_newconnev_t *nev; unsigned int count; char *crash_reason; isc_boolean_t crash = ISC_FALSE; REQUIRE(sock->pending_iocp == sock->pending_recv + sock->pending_send + sock->pending_accept + sock->pending_connect); dev = ISC_LIST_HEAD(sock->send_list); count = 0; while (dev != NULL) { count++; dev = ISC_LIST_NEXT(dev, ev_link); } if (count > sock->pending_send) { crash = ISC_TRUE; crash_reason = "send_list > sock->pending_send"; } nev = ISC_LIST_HEAD(sock->accept_list); count = 0; while (nev != NULL) { count++; nev = ISC_LIST_NEXT(nev, ev_link); } if (count > sock->pending_accept) { crash = ISC_TRUE; crash_reason = "send_list > sock->pending_send"; } if (crash) { socket_log(__LINE__, sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_DESTROYING, "SOCKET INCONSISTENT: %s", crash_reason); sock_dump(sock); INSIST(crash == ISC_FALSE); } } /* * Maybe free the socket. * * This function will verify tht the socket is no longer in use in any way, * either internally or externally. This is the only place where this * check is to be made; if some bit of code believes that IT is done with * the socket (e.g., some reference counter reaches zero), it should call * this function. * * When calling this function, the socket must be locked, and the manager * must be unlocked. * * When this function returns, *socketp will be NULL. No tricks to try * to hold on to this pointer are allowed. */ static void maybe_free_socket(isc_socket_t **socketp, int lineno) { isc_socket_t *sock = *socketp; *socketp = NULL; INSIST(VALID_SOCKET(sock)); CONSISTENT(sock); if (sock->pending_iocp > 0 || sock->pending_recv > 0 || sock->pending_send > 0 || sock->pending_accept > 0 || sock->references > 0 || sock->pending_connect == 1 || !ISC_LIST_EMPTY(sock->recv_list) || !ISC_LIST_EMPTY(sock->send_list) || !ISC_LIST_EMPTY(sock->accept_list) || sock->fd != INVALID_SOCKET) { UNLOCK(&sock->lock); return; } UNLOCK(&sock->lock); free_socket(&sock, lineno); } void free_socket(isc_socket_t **sockp, int lineno) { isc_socketmgr_t *manager; isc_socket_t *sock = *sockp; *sockp = NULL; manager = sock->manager; /* * Seems we can free the socket after all. */ manager = sock->manager; socket_log(__LINE__, sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_DESTROYING, "freeing socket line %d fd %d lock %p semaphore %p", lineno, sock->fd, &sock->lock, sock->lock.LockSemaphore); sock->magic = 0; DESTROYLOCK(&sock->lock); if (sock->recvbuf.base != NULL) isc_mem_put(manager->mctx, sock->recvbuf.base, sock->recvbuf.len); LOCK(&manager->lock); if (ISC_LINK_LINKED(sock, link)) ISC_LIST_UNLINK(manager->socklist, sock, link); isc_mem_put(manager->mctx, sock, sizeof(*sock)); if (ISC_LIST_EMPTY(manager->socklist)) SIGNAL(&manager->shutdown_ok); UNLOCK(&manager->lock); } /* * Create a new 'type' socket managed by 'manager'. Events * will be posted to 'task' and when dispatched 'action' will be * called with 'arg' as the arg value. The new socket is returned * in 'socketp'. */ isc_result_t isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type, isc_socket_t **socketp) { isc_socket_t *sock = NULL; isc_result_t result; #if defined(USE_CMSG) int on = 1; #endif #if defined(SO_RCVBUF) ISC_SOCKADDR_LEN_T optlen; int size; #endif int socket_errno; char strbuf[ISC_STRERRORSIZE]; REQUIRE(VALID_MANAGER(manager)); REQUIRE(socketp != NULL && *socketp == NULL); REQUIRE(type != isc_sockettype_fdwatch); result = allocate_socket(manager, type, &sock); if (result != ISC_R_SUCCESS) return (result); sock->pf = pf; switch (type) { case isc_sockettype_udp: sock->fd = socket(pf, SOCK_DGRAM, IPPROTO_UDP); if (sock->fd != INVALID_SOCKET) { result = connection_reset_fix(sock->fd); if (result != ISC_R_SUCCESS) { socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, "closed %d %d %d con_reset_fix_failed", sock->pending_recv, sock->pending_send, sock->references); closesocket(sock->fd); _set_state(sock, SOCK_CLOSED); sock->fd = INVALID_SOCKET; free_socket(&sock, __LINE__); return (result); } } break; case isc_sockettype_tcp: sock->fd = socket(pf, SOCK_STREAM, IPPROTO_TCP); break; } if (sock->fd == INVALID_SOCKET) { socket_errno = WSAGetLastError(); free_socket(&sock, __LINE__); switch (socket_errno) { case WSAEMFILE: case WSAENOBUFS: return (ISC_R_NORESOURCES); case WSAEPROTONOSUPPORT: case WSAEPFNOSUPPORT: case WSAEAFNOSUPPORT: return (ISC_R_FAMILYNOSUPPORT); default: isc__strerror(socket_errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "socket() %s: %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); return (ISC_R_UNEXPECTED); } } result = make_nonblock(sock->fd); if (result != ISC_R_SUCCESS) { socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, "closed %d %d %d make_nonblock_failed", sock->pending_recv, sock->pending_send, sock->references); closesocket(sock->fd); sock->fd = INVALID_SOCKET; free_socket(&sock, __LINE__); return (result); } #if defined(USE_CMSG) || defined(SO_RCVBUF) if (type == isc_sockettype_udp) { #if defined(USE_CMSG) #if defined(ISC_PLATFORM_HAVEIPV6) #ifdef IPV6_RECVPKTINFO /* 2292bis */ if ((pf == AF_INET6) && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, (void *)&on, sizeof(on)) < 0)) { isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d, IPV6_RECVPKTINFO) " "%s: %s", sock->fd, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); } #else /* 2292 */ if ((pf == AF_INET6) && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_PKTINFO, (void *)&on, sizeof(on)) < 0)) { isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d, IPV6_PKTINFO) %s: %s", sock->fd, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed"), strbuf); } #endif /* IPV6_RECVPKTINFO */ #ifdef IPV6_USE_MIN_MTU /*2292bis, not too common yet*/ /* use minimum MTU */ if (pf == AF_INET6) { (void)setsockopt(sock->fd, IPPROTO_IPV6, IPV6_USE_MIN_MTU, (void *)&on, sizeof(on)); } #endif #endif /* ISC_PLATFORM_HAVEIPV6 */ #endif /* defined(USE_CMSG) */ #if defined(SO_RCVBUF) optlen = sizeof(size); if (getsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF, (void *)&size, &optlen) >= 0 && size < RCVBUFSIZE) { size = RCVBUFSIZE; (void)setsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF, (void *)&size, sizeof(size)); } #endif } #endif /* defined(USE_CMSG) || defined(SO_RCVBUF) */ _set_state(sock, SOCK_OPEN); sock->references = 1; *socketp = sock; iocompletionport_update(sock); /* * Note we don't have to lock the socket like we normally would because * there are no external references to it yet. */ LOCK(&manager->lock); ISC_LIST_APPEND(manager->socklist, sock, link); InterlockedIncrement(&manager->totalSockets); UNLOCK(&manager->lock); socket_log(__LINE__, sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_CREATED, "created %u type %u", sock->fd, type); return (ISC_R_SUCCESS); } isc_result_t isc_socket_open(isc_socket_t *sock) { REQUIRE(VALID_SOCKET(sock)); REQUIRE(sock->type != isc_sockettype_fdwatch); return (ISC_R_NOTIMPLEMENTED); } /* * Attach to a socket. Caller must explicitly detach when it is done. */ void isc_socket_attach(isc_socket_t *sock, isc_socket_t **socketp) { REQUIRE(VALID_SOCKET(sock)); REQUIRE(socketp != NULL && *socketp == NULL); LOCK(&sock->lock); CONSISTENT(sock); sock->references++; UNLOCK(&sock->lock); *socketp = sock; } /* * Dereference a socket. If this is the last reference to it, clean things * up by destroying the socket. */ void isc_socket_detach(isc_socket_t **socketp) { isc_socket_t *sock; isc_boolean_t kill_socket = ISC_FALSE; REQUIRE(socketp != NULL); sock = *socketp; REQUIRE(VALID_SOCKET(sock)); REQUIRE(sock->type != isc_sockettype_fdwatch); LOCK(&sock->lock); CONSISTENT(sock); REQUIRE(sock->references > 0); sock->references--; socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, "detach_socket %d %d %d", sock->pending_recv, sock->pending_send, sock->references); if (sock->references == 0 && sock->fd != INVALID_SOCKET) { closesocket(sock->fd); sock->fd = INVALID_SOCKET; _set_state(sock, SOCK_CLOSED); } maybe_free_socket(&sock, __LINE__); *socketp = NULL; } isc_result_t isc_socket_close(isc_socket_t *sock) { REQUIRE(VALID_SOCKET(sock)); REQUIRE(sock->type != isc_sockettype_fdwatch); return (ISC_R_NOTIMPLEMENTED); } /* * Dequeue an item off the given socket's read queue, set the result code * in the done event to the one provided, and send it to the task it was * destined for. * * If the event to be sent is on a list, remove it before sending. If * asked to, send and detach from the task as well. * * Caller must have the socket locked if the event is attached to the socket. */ static void send_recvdone_event(isc_socket_t *sock, isc_socketevent_t **dev) { isc_task_t *task; task = (*dev)->ev_sender; (*dev)->ev_sender = sock; if (ISC_LINK_LINKED(*dev, ev_link)) ISC_LIST_DEQUEUE(sock->recv_list, *dev, ev_link); if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED) == ISC_SOCKEVENTATTR_ATTACHED) isc_task_sendanddetach(&task, (isc_event_t **)dev); else isc_task_send(task, (isc_event_t **)dev); CONSISTENT(sock); } /* * See comments for send_recvdone_event() above. */ static void send_senddone_event(isc_socket_t *sock, isc_socketevent_t **dev) { isc_task_t *task; INSIST(dev != NULL && *dev != NULL); task = (*dev)->ev_sender; (*dev)->ev_sender = sock; if (ISC_LINK_LINKED(*dev, ev_link)) ISC_LIST_DEQUEUE(sock->send_list, *dev, ev_link); if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED) == ISC_SOCKEVENTATTR_ATTACHED) isc_task_sendanddetach(&task, (isc_event_t **)dev); else isc_task_send(task, (isc_event_t **)dev); CONSISTENT(sock); } /* * See comments for send_recvdone_event() above. */ static void send_acceptdone_event(isc_socket_t *sock, isc_socket_newconnev_t **adev) { isc_task_t *task; INSIST(adev != NULL && *adev != NULL); task = (*adev)->ev_sender; (*adev)->ev_sender = sock; if (ISC_LINK_LINKED(*adev, ev_link)) ISC_LIST_DEQUEUE(sock->accept_list, *adev, ev_link); isc_task_sendanddetach(&task, (isc_event_t **)adev); CONSISTENT(sock); } /* * See comments for send_recvdone_event() above. */ static void send_connectdone_event(isc_socket_t *sock, isc_socket_connev_t **cdev) { isc_task_t *task; INSIST(cdev != NULL && *cdev != NULL); task = (*cdev)->ev_sender; (*cdev)->ev_sender = sock; sock->connect_ev = NULL; isc_task_sendanddetach(&task, (isc_event_t **)cdev); CONSISTENT(sock); } /* * On entry to this function, the event delivered is the internal * readable event, and the first item on the accept_list should be * the done event we want to send. If the list is empty, this is a no-op, * so just close the new connection, unlock, and return. * * Note the socket is locked before entering here */ static void internal_accept(isc_socket_t *sock, IoCompletionInfo *lpo, int accept_errno) { isc_socket_newconnev_t *adev; isc_result_t result = ISC_R_SUCCESS; isc_socket_t *nsock; struct sockaddr *localaddr; int localaddr_len = sizeof(*localaddr); struct sockaddr *remoteaddr; int remoteaddr_len = sizeof(*remoteaddr); INSIST(VALID_SOCKET(sock)); LOCK(&sock->lock); CONSISTENT(sock); socket_log(__LINE__, sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK, "internal_accept called"); INSIST(sock->listener); INSIST(sock->pending_iocp > 0); sock->pending_iocp--; INSIST(sock->pending_accept > 0); sock->pending_accept--; adev = lpo->adev; /* * If the event is no longer in the list we can just return. */ if (!acceptdone_is_active(sock, adev)) goto done; nsock = adev->newsocket; /* * Pull off the done event. */ ISC_LIST_UNLINK(sock->accept_list, adev, ev_link); /* * Extract the addresses from the socket, copy them into the structure, * and return the new socket. */ ISCGetAcceptExSockaddrs(lpo->acceptbuffer, 0, sizeof(SOCKADDR_STORAGE) + 16, sizeof(SOCKADDR_STORAGE) + 16, (LPSOCKADDR *)&localaddr, &localaddr_len, (LPSOCKADDR *)&remoteaddr, &remoteaddr_len); memcpy(&adev->address.type, remoteaddr, remoteaddr_len); adev->address.length = remoteaddr_len; nsock->address = adev->address; nsock->pf = adev->address.type.sa.sa_family; socket_log(__LINE__, nsock, &nsock->address, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK, "internal_accept parent %p", sock); result = make_nonblock(adev->newsocket->fd); INSIST(result == ISC_R_SUCCESS); INSIST(setsockopt(nsock->fd, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, (char *)&sock->fd, sizeof(sock->fd)) == 0); /* * Hook it up into the manager. */ nsock->bound = 1; nsock->connected = 1; _set_state(nsock, SOCK_OPEN); LOCK(&nsock->manager->lock); ISC_LIST_APPEND(nsock->manager->socklist, nsock, link); InterlockedIncrement(&nsock->manager->totalSockets); UNLOCK(&nsock->manager->lock); socket_log(__LINE__, sock, &nsock->address, CREATION, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTEDCXN, "accepted_connection new_socket %p fd %d", nsock, nsock->fd); adev->result = result; send_acceptdone_event(sock, &adev); done: CONSISTENT(sock); UNLOCK(&sock->lock); HeapFree(hHeapHandle, 0, lpo->acceptbuffer); lpo->acceptbuffer = NULL; } /* * Called when a socket with a pending connect() finishes. * Note that the socket is locked before entering. */ static void internal_connect(isc_socket_t *sock, IoCompletionInfo *lpo, int connect_errno) { isc_socket_connev_t *cdev; char strbuf[ISC_STRERRORSIZE]; INSIST(VALID_SOCKET(sock)); LOCK(&sock->lock); INSIST(sock->pending_iocp > 0); sock->pending_iocp--; INSIST(sock->pending_connect == 1); sock->pending_connect = 0; /* * Has this event been canceled? */ cdev = lpo->cdev; if (!connectdone_is_active(sock, cdev)) { sock->pending_connect = 0; if (sock->fd != INVALID_SOCKET) { closesocket(sock->fd); sock->fd = INVALID_SOCKET; _set_state(sock, SOCK_CLOSED); } CONSISTENT(sock); UNLOCK(&sock->lock); return; } /* * Check possible Windows network event error status here. */ if (connect_errno != 0) { /* * If the error is SOFT, just try again on this * fd and pretend nothing strange happened. */ if (SOFT_ERROR(connect_errno) || connect_errno == WSAEINPROGRESS) { sock->pending_connect = 1; CONSISTENT(sock); UNLOCK(&sock->lock); return; } /* * Translate other errors into ISC_R_* flavors. */ switch (connect_errno) { #define ERROR_MATCH(a, b) case a: cdev->result = b; break; ERROR_MATCH(WSAEACCES, ISC_R_NOPERM); ERROR_MATCH(WSAEADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL); ERROR_MATCH(WSAEAFNOSUPPORT, ISC_R_ADDRNOTAVAIL); ERROR_MATCH(WSAECONNREFUSED, ISC_R_CONNREFUSED); ERROR_MATCH(WSAEHOSTUNREACH, ISC_R_HOSTUNREACH); ERROR_MATCH(WSAEHOSTDOWN, ISC_R_HOSTDOWN); ERROR_MATCH(WSAENETUNREACH, ISC_R_NETUNREACH); ERROR_MATCH(WSAENETDOWN, ISC_R_NETDOWN); ERROR_MATCH(WSAENOBUFS, ISC_R_NORESOURCES); ERROR_MATCH(WSAECONNRESET, ISC_R_CONNECTIONRESET); ERROR_MATCH(WSAECONNABORTED, ISC_R_CONNECTIONRESET); ERROR_MATCH(WSAETIMEDOUT, ISC_R_TIMEDOUT); #undef ERROR_MATCH default: cdev->result = ISC_R_UNEXPECTED; isc__strerror(connect_errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "internal_connect: connect() %s", strbuf); } } else { INSIST(setsockopt(sock->fd, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0) == 0); cdev->result = ISC_R_SUCCESS; sock->connected = 1; socket_log(__LINE__, sock, &sock->address, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTEDCXN, "internal_connect: success"); } send_connectdone_event(sock, &cdev); UNLOCK(&sock->lock); } /* * Loop through the socket, returning ISC_R_EOF for each done event pending. */ static void send_recvdone_abort(isc_socket_t *sock, isc_result_t result) { isc_socketevent_t *dev; while (!ISC_LIST_EMPTY(sock->recv_list)) { dev = ISC_LIST_HEAD(sock->recv_list); dev->result = result; send_recvdone_event(sock, &dev); } } /* * Take the data we received in our private buffer, and if any recv() calls on * our list are satisfied, send the corresponding done event. * * If we need more data (there are still items on the recv_list after we consume all * our data) then arrange for another system recv() call to fill our buffers. */ static void internal_recv(isc_socket_t *sock, int nbytes) { INSIST(VALID_SOCKET(sock)); LOCK(&sock->lock); CONSISTENT(sock); socket_log(__LINE__, sock, NULL, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV, "internal_recv: %d bytes received", nbytes); /* * If we got here, the I/O operation succeeded. However, we might still have removed this * event from our notification list (or never placed it on it due to immediate completion.) * Handle the reference counting here, and handle the cancellation event just after. */ INSIST(sock->pending_iocp > 0); sock->pending_iocp--; INSIST(sock->pending_recv > 0); sock->pending_recv--; /* * The only way we could have gotten here is that our I/O has successfully completed. * Update our pointers, and move on. The only odd case here is that we might not * have received enough data on a TCP stream to satisfy the minimum requirements. If * this is the case, we will re-issue the recv() call for what we need. * * We do check for a recv() of 0 bytes on a TCP stream. This means the remote end * has closed. */ if (nbytes == 0 && sock->type == isc_sockettype_tcp) { send_recvdone_abort(sock, ISC_R_EOF); maybe_free_socket(&sock, __LINE__); return; } sock->recvbuf.remaining = nbytes; sock->recvbuf.consume_position = sock->recvbuf.base; completeio_recv(sock); /* * If there are more receivers waiting for data, queue another receive * here. */ queue_receive_request(sock); /* * Unlock and/or destroy if we are the last thing this socket has left to do. */ maybe_free_socket(&sock, __LINE__); } static void internal_send(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *messagehdr, int nbytes, int send_errno, IoCompletionInfo *lpo) { buflist_t *buffer; /* * Find out what socket this is and lock it. */ INSIST(VALID_SOCKET(sock)); LOCK(&sock->lock); CONSISTENT(sock); socket_log(__LINE__, sock, NULL, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALSEND, "internal_send: task got socket event %p", dev); buffer = ISC_LIST_HEAD(lpo->bufferlist); while (buffer != NULL) { ISC_LIST_DEQUEUE(lpo->bufferlist, buffer, link); socket_log(__LINE__, sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK, "free_buffer %p %p", buffer, buffer->buf); HeapFree(hHeapHandle, 0, buffer->buf); HeapFree(hHeapHandle, 0, buffer); buffer = ISC_LIST_HEAD(lpo->bufferlist); } INSIST(sock->pending_iocp > 0); sock->pending_iocp--; INSIST(sock->pending_send > 0); sock->pending_send--; /* If the event is no longer in the list we can just return */ if (!senddone_is_active(sock, dev)) goto done; /* * Set the error code and send things on its way. */ switch (completeio_send(sock, dev, messagehdr, nbytes, send_errno)) { case DOIO_SOFT: break; case DOIO_HARD: case DOIO_SUCCESS: send_senddone_event(sock, &dev); break; } done: maybe_free_socket(&sock, __LINE__); } /* * These return if the done event passed in is on the list (or for connect, is * the one we're waiting for. Using these ensures we will not double-send an * event. */ static isc_boolean_t senddone_is_active(isc_socket_t *sock, isc_socketevent_t *dev) { isc_socketevent_t *ldev; ldev = ISC_LIST_HEAD(sock->send_list); while (ldev != NULL && ldev != dev) ldev = ISC_LIST_NEXT(ldev, ev_link); return (ldev == NULL ? ISC_FALSE : ISC_TRUE); } static isc_boolean_t acceptdone_is_active(isc_socket_t *sock, isc_socket_newconnev_t *dev) { isc_socket_newconnev_t *ldev; ldev = ISC_LIST_HEAD(sock->accept_list); while (ldev != NULL && ldev != dev) ldev = ISC_LIST_NEXT(ldev, ev_link); return (ldev == NULL ? ISC_FALSE : ISC_TRUE); } static isc_boolean_t connectdone_is_active(isc_socket_t *sock, isc_socket_connev_t *dev) { return (sock->connect_ev == dev ? ISC_TRUE : ISC_FALSE); } /* * This is the I/O Completion Port Worker Function. It loops forever * waiting for I/O to complete and then forwards them for further * processing. There are a number of these in separate threads. */ static isc_threadresult_t WINAPI SocketIoThread(LPVOID ThreadContext) { isc_socketmgr_t *manager = ThreadContext; BOOL bSuccess = FALSE; DWORD nbytes; IoCompletionInfo *lpo = NULL; isc_socket_t *sock = NULL; int request; struct msghdr *messagehdr = NULL; int errval; char strbuf[ISC_STRERRORSIZE]; int errstatus; REQUIRE(VALID_MANAGER(manager)); /* * Set the thread priority high enough so I/O will * preempt normal recv packet processing, but not * higher than the timer sync thread. */ if (!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL)) { errval = GetLastError(); isc__strerror(errval, strbuf, sizeof(strbuf)); FATAL_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_FAILED, "Can't set thread priority: %s"), strbuf); } /* * Loop forever waiting on I/O Completions and then processing them */ while (TRUE) { bSuccess = GetQueuedCompletionStatus(manager->hIoCompletionPort, &nbytes, (LPDWORD)&sock, (LPWSAOVERLAPPED *)&lpo, INFINITE); if (lpo == NULL) /* Received request to exit */ break; REQUIRE(VALID_SOCKET(sock)); request = lpo->request_type; errstatus = 0; if (!bSuccess) { isc_result_t isc_result; /* * Did the I/O operation complete? */ errstatus = WSAGetLastError(); isc_result = isc__errno2resultx(errstatus, __FILE__, __LINE__); LOCK(&sock->lock); CONSISTENT(sock); switch (request) { case SOCKET_RECV: INSIST(sock->pending_iocp > 0); sock->pending_iocp--; INSIST(sock->pending_recv > 0); sock->pending_recv--; send_recvdone_abort(sock, isc_result); if (isc_result == ISC_R_UNEXPECTED) { UNEXPECTED_ERROR(__FILE__, __LINE__, "SOCKET_RECV: Windows error code: %d, returning ISC error %d", errstatus, isc_result); } break; case SOCKET_SEND: INSIST(sock->pending_iocp > 0); sock->pending_iocp--; INSIST(sock->pending_send > 0); sock->pending_send--; if (senddone_is_active(sock, lpo->dev)) { lpo->dev->result = isc_result; socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, "canceled_send"); send_senddone_event(sock, &lpo->dev); } break; case SOCKET_ACCEPT: INSIST(sock->pending_iocp > 0); sock->pending_iocp--; INSIST(sock->pending_accept > 0); sock->pending_accept--; if (acceptdone_is_active(sock, lpo->adev)) { closesocket(lpo->adev->newsocket->fd); lpo->adev->newsocket->fd = INVALID_SOCKET; lpo->adev->newsocket->references--; free_socket(&lpo->adev->newsocket, __LINE__); lpo->adev->result = isc_result; socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, "canceled_accept"); send_acceptdone_event(sock, &lpo->adev); } break; case SOCKET_CONNECT: INSIST(sock->pending_iocp > 0); sock->pending_iocp--; INSIST(sock->pending_connect == 1); sock->pending_connect = 0; if (connectdone_is_active(sock, lpo->cdev)) { lpo->cdev->result = isc_result; socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, "canceled_connect"); send_connectdone_event(sock, &lpo->cdev); } break; } maybe_free_socket(&sock, __LINE__); if (lpo != NULL) HeapFree(hHeapHandle, 0, lpo); continue; } messagehdr = &lpo->messagehdr; switch (request) { case SOCKET_RECV: internal_recv(sock, nbytes); break; case SOCKET_SEND: internal_send(sock, lpo->dev, messagehdr, nbytes, errstatus, lpo); break; case SOCKET_ACCEPT: internal_accept(sock, lpo, errstatus); break; case SOCKET_CONNECT: internal_connect(sock, lpo, errstatus); break; } if (lpo != NULL) HeapFree(hHeapHandle, 0, lpo); } /* * Exit Completion Port Thread */ manager_log(manager, TRACE, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_EXITING, "SocketIoThread exiting")); return ((isc_threadresult_t)0); } /* * Create a new socket manager. */ isc_result_t isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp) { return (isc_socketmgr_create2(mctx, managerp, 0)); } isc_result_t isc_socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp, unsigned int maxsocks) { isc_socketmgr_t *manager; isc_result_t result; REQUIRE(managerp != NULL && *managerp == NULL); if (maxsocks != 0) return (ISC_R_NOTIMPLEMENTED); manager = isc_mem_get(mctx, sizeof(*manager)); if (manager == NULL) return (ISC_R_NOMEMORY); InitSockets(); manager->magic = SOCKET_MANAGER_MAGIC; manager->mctx = NULL; manager->stats = NULL; ISC_LIST_INIT(manager->socklist); result = isc_mutex_init(&manager->lock); if (result != ISC_R_SUCCESS) { isc_mem_put(mctx, manager, sizeof(*manager)); return (result); } if (isc_condition_init(&manager->shutdown_ok) != ISC_R_SUCCESS) { DESTROYLOCK(&manager->lock); isc_mem_put(mctx, manager, sizeof(*manager)); UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_condition_init() %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); return (ISC_R_UNEXPECTED); } isc_mem_attach(mctx, &manager->mctx); iocompletionport_init(manager); /* Create the Completion Ports */ manager->bShutdown = ISC_FALSE; manager->totalSockets = 0; manager->iocp_total = 0; *managerp = manager; return (ISC_R_SUCCESS); } isc_result_t isc_socketmgr_getmaxsockets(isc_socketmgr_t *manager, unsigned int *nsockp) { REQUIRE(VALID_MANAGER(manager)); REQUIRE(nsockp != NULL); return (ISC_R_NOTIMPLEMENTED); } void isc_socketmgr_setstats(isc_socketmgr_t *manager, isc_stats_t *stats) { REQUIRE(VALID_MANAGER(manager)); REQUIRE(ISC_LIST_EMPTY(manager->socklist)); REQUIRE(manager->stats == NULL); REQUIRE(isc_stats_ncounters(stats) == isc_sockstatscounter_max); isc_stats_attach(stats, &manager->stats); } void isc_socketmgr_destroy(isc_socketmgr_t **managerp) { isc_socketmgr_t *manager; int i; isc_mem_t *mctx; /* * Destroy a socket manager. */ REQUIRE(managerp != NULL); manager = *managerp; REQUIRE(VALID_MANAGER(manager)); LOCK(&manager->lock); /* * Wait for all sockets to be destroyed. */ while (!ISC_LIST_EMPTY(manager->socklist)) { manager_log(manager, CREATION, isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_SOCKETSREMAIN, "sockets exist")); WAIT(&manager->shutdown_ok, &manager->lock); } UNLOCK(&manager->lock); /* * Here, we need to had some wait code for the completion port * thread. */ signal_iocompletionport_exit(manager); manager->bShutdown = ISC_TRUE; /* * Wait for threads to exit. */ for (i = 0; i < manager->maxIOCPThreads; i++) { if (isc_thread_join((isc_thread_t) manager->hIOCPThreads[i], NULL) != ISC_R_SUCCESS) UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_thread_join() for Completion Port %s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); } /* * Clean up. */ CloseHandle(manager->hIoCompletionPort); (void)isc_condition_destroy(&manager->shutdown_ok); DESTROYLOCK(&manager->lock); if (manager->stats != NULL) isc_stats_detach(&manager->stats); manager->magic = 0; mctx= manager->mctx; isc_mem_put(mctx, manager, sizeof(*manager)); isc_mem_detach(&mctx); *managerp = NULL; } static void queue_receive_event(isc_socket_t *sock, isc_task_t *task, isc_socketevent_t *dev) { isc_task_t *ntask = NULL; isc_task_attach(task, &ntask); dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED; /* * Enqueue the request. */ INSIST(!ISC_LINK_LINKED(dev, ev_link)); ISC_LIST_ENQUEUE(sock->recv_list, dev, ev_link); socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, "queue_receive_event: event %p -> task %p", dev, ntask); } /* * Check the pending receive queue, and if we have data pending, give it to this * caller. If we have none, queue an I/O request. If this caller is not the first * on the list, then we will just queue this event and return. * * Caller must have the socket locked. */ static isc_result_t socket_recv(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, unsigned int flags) { int cc = 0; isc_task_t *ntask = NULL; isc_result_t result = ISC_R_SUCCESS; int recv_errno = 0; dev->ev_sender = task; if (sock->fd == INVALID_SOCKET) return (ISC_R_EOF); /* * Queue our event on the list of things to do. Call our function to * attempt to fill buffers as much as possible, and return done events. * We are going to lie about our handling of the ISC_SOCKFLAG_IMMEDIATE * here and tell our caller that we could not satisfy it immediately. */ queue_receive_event(sock, task, dev); if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0) result = ISC_R_INPROGRESS; completeio_recv(sock); /* * If there are more receivers waiting for data, queue another receive * here. If the */ queue_receive_request(sock); return (result); } isc_result_t isc_socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist, unsigned int minimum, isc_task_t *task, isc_taskaction_t action, const void *arg) { isc_socketevent_t *dev; isc_socketmgr_t *manager; unsigned int iocount; isc_buffer_t *buffer; isc_result_t ret; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); CONSISTENT(sock); /* * Make sure that the socket is not closed. XXXMLG change error here? */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } REQUIRE(buflist != NULL); REQUIRE(!ISC_LIST_EMPTY(*buflist)); REQUIRE(task != NULL); REQUIRE(action != NULL); manager = sock->manager; REQUIRE(VALID_MANAGER(manager)); iocount = isc_bufferlist_availablecount(buflist); REQUIRE(iocount > 0); INSIST(sock->bound); dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg); if (dev == NULL) { UNLOCK(&sock->lock); return (ISC_R_NOMEMORY); } /* * UDP sockets are always partial read */ if (sock->type == isc_sockettype_udp) dev->minimum = 1; else { if (minimum == 0) dev->minimum = iocount; else dev->minimum = minimum; } /* * Move each buffer from the passed in list to our internal one. */ buffer = ISC_LIST_HEAD(*buflist); while (buffer != NULL) { ISC_LIST_DEQUEUE(*buflist, buffer, link); ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link); buffer = ISC_LIST_HEAD(*buflist); } ret = socket_recv(sock, dev, task, 0); UNLOCK(&sock->lock); return (ret); } isc_result_t isc_socket_recv(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, isc_task_t *task, isc_taskaction_t action, const void *arg) { isc_socketevent_t *dev; isc_socketmgr_t *manager; isc_result_t ret; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); CONSISTENT(sock); /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } REQUIRE(action != NULL); manager = sock->manager; REQUIRE(VALID_MANAGER(manager)); INSIST(sock->bound); dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg); if (dev == NULL) { UNLOCK(&sock->lock); return (ISC_R_NOMEMORY); } ret = isc_socket_recv2(sock, region, minimum, task, dev, 0); UNLOCK(&sock->lock); return (ret); } isc_result_t isc_socket_recv2(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, isc_task_t *task, isc_socketevent_t *event, unsigned int flags) { isc_result_t ret; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); CONSISTENT(sock); event->result = ISC_R_UNEXPECTED; event->ev_sender = sock; /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } ISC_LIST_INIT(event->bufferlist); event->region = *region; event->n = 0; event->offset = 0; event->attributes = 0; /* * UDP sockets are always partial read. */ if (sock->type == isc_sockettype_udp) event->minimum = 1; else { if (minimum == 0) event->minimum = region->length; else event->minimum = minimum; } ret = socket_recv(sock, event, task, flags); UNLOCK(&sock->lock); return (ret); } /* * Caller must have the socket locked. */ static isc_result_t socket_send(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, unsigned int flags) { int io_state; int send_errno = 0; int cc = 0; isc_task_t *ntask = NULL; isc_result_t result = ISC_R_SUCCESS; dev->ev_sender = task; set_dev_address(address, sock, dev); if (pktinfo != NULL) { socket_log(__LINE__, sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_PKTINFOPROVIDED, "pktinfo structure provided, ifindex %u (set to 0)", pktinfo->ipi6_ifindex); dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO; dev->pktinfo = *pktinfo; /* * Set the pktinfo index to 0 here, to let the kernel decide * what interface it should send on. */ dev->pktinfo.ipi6_ifindex = 0; } io_state = startio_send(sock, dev, &cc, &send_errno); switch (io_state) { case DOIO_PENDING: /* I/O started. Nothing more to do */ case DOIO_SOFT: /* * We couldn't send all or part of the request right now, so * queue it unless ISC_SOCKFLAG_NORETRY is set. */ if ((flags & ISC_SOCKFLAG_NORETRY) == 0) { isc_task_attach(task, &ntask); dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED; /* * Enqueue the request. */ INSIST(!ISC_LINK_LINKED(dev, ev_link)); ISC_LIST_ENQUEUE(sock->send_list, dev, ev_link); socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0, "socket_send: event %p -> task %p", dev, ntask); if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0) result = ISC_R_INPROGRESS; break; } case DOIO_SUCCESS: break; } return (result); } isc_result_t isc_socket_send(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, isc_taskaction_t action, const void *arg) { /* * REQUIRE() checking is performed in isc_socket_sendto(). */ return (isc_socket_sendto(sock, region, task, action, arg, NULL, NULL)); } isc_result_t isc_socket_sendto(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) { isc_socketevent_t *dev; isc_socketmgr_t *manager; isc_result_t ret; REQUIRE(VALID_SOCKET(sock)); REQUIRE(sock->type != isc_sockettype_fdwatch); LOCK(&sock->lock); CONSISTENT(sock); /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } REQUIRE(region != NULL); REQUIRE(task != NULL); REQUIRE(action != NULL); manager = sock->manager; REQUIRE(VALID_MANAGER(manager)); INSIST(sock->bound); dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg); if (dev == NULL) { UNLOCK(&sock->lock); return (ISC_R_NOMEMORY); } dev->region = *region; ret = socket_send(sock, dev, task, address, pktinfo, 0); UNLOCK(&sock->lock); return (ret); } isc_result_t isc_socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, isc_task_t *task, isc_taskaction_t action, const void *arg) { return (isc_socket_sendtov(sock, buflist, task, action, arg, NULL, NULL)); } isc_result_t isc_socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) { isc_socketevent_t *dev; isc_socketmgr_t *manager; unsigned int iocount; isc_buffer_t *buffer; isc_result_t ret; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); CONSISTENT(sock); /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } REQUIRE(buflist != NULL); REQUIRE(!ISC_LIST_EMPTY(*buflist)); REQUIRE(task != NULL); REQUIRE(action != NULL); manager = sock->manager; REQUIRE(VALID_MANAGER(manager)); iocount = isc_bufferlist_usedcount(buflist); REQUIRE(iocount > 0); dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg); if (dev == NULL) { UNLOCK(&sock->lock); return (ISC_R_NOMEMORY); } /* * Move each buffer from the passed in list to our internal one. */ buffer = ISC_LIST_HEAD(*buflist); while (buffer != NULL) { ISC_LIST_DEQUEUE(*buflist, buffer, link); ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link); buffer = ISC_LIST_HEAD(*buflist); } ret = socket_send(sock, dev, task, address, pktinfo, 0); UNLOCK(&sock->lock); return (ret); } isc_result_t isc_socket_sendto2(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, isc_socketevent_t *event, unsigned int flags) { isc_result_t ret; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); CONSISTENT(sock); REQUIRE((flags & ~(ISC_SOCKFLAG_IMMEDIATE|ISC_SOCKFLAG_NORETRY)) == 0); if ((flags & ISC_SOCKFLAG_NORETRY) != 0) REQUIRE(sock->type == isc_sockettype_udp); event->ev_sender = sock; event->result = ISC_R_UNEXPECTED; /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } ISC_LIST_INIT(event->bufferlist); event->region = *region; event->n = 0; event->offset = 0; event->attributes = 0; ret = socket_send(sock, event, task, address, pktinfo, flags); UNLOCK(&sock->lock); return (ret); } isc_result_t isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr, unsigned int options) { int bind_errno; char strbuf[ISC_STRERRORSIZE]; int on = 1; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); CONSISTENT(sock); /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } INSIST(!sock->bound); if (sock->pf != sockaddr->type.sa.sa_family) { UNLOCK(&sock->lock); return (ISC_R_FAMILYMISMATCH); } /* * Only set SO_REUSEADDR when we want a specific port. */ if ((options & ISC_SOCKET_REUSEADDRESS) != 0 && isc_sockaddr_getport(sockaddr) != (in_port_t)0 && setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)) < 0) { UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d) %s", sock->fd, isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL, ISC_MSG_FAILED, "failed")); /* Press on... */ } if (bind(sock->fd, &sockaddr->type.sa, sockaddr->length) < 0) { bind_errno = WSAGetLastError(); UNLOCK(&sock->lock); switch (bind_errno) { case WSAEACCES: return (ISC_R_NOPERM); case WSAEADDRNOTAVAIL: return (ISC_R_ADDRNOTAVAIL); case WSAEADDRINUSE: return (ISC_R_ADDRINUSE); case WSAEINVAL: return (ISC_R_BOUND); default: isc__strerror(bind_errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "bind: %s", strbuf); return (ISC_R_UNEXPECTED); } } socket_log(__LINE__, sock, sockaddr, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND, "bound"); sock->bound = 1; UNLOCK(&sock->lock); return (ISC_R_SUCCESS); } isc_result_t isc_socket_filter(isc_socket_t *sock, const char *filter) { UNUSED(sock); UNUSED(filter); REQUIRE(VALID_SOCKET(sock)); return (ISC_R_NOTIMPLEMENTED); } /* * Set up to listen on a given socket. We do this by creating an internal * event that will be dispatched when the socket has read activity. The * watcher will send the internal event to the task when there is a new * connection. * * Unlike in read, we don't preallocate a done event here. Every time there * is a new connection we'll have to allocate a new one anyway, so we might * as well keep things simple rather than having to track them. */ isc_result_t isc_socket_listen(isc_socket_t *sock, unsigned int backlog) { char strbuf[ISC_STRERRORSIZE]; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); CONSISTENT(sock); /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } REQUIRE(!sock->listener); REQUIRE(sock->bound); REQUIRE(sock->type == isc_sockettype_tcp); if (backlog == 0) backlog = SOMAXCONN; if (listen(sock->fd, (int)backlog) < 0) { UNLOCK(&sock->lock); isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "listen: %s", strbuf); return (ISC_R_UNEXPECTED); } socket_log(__LINE__, sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND, "listening"); sock->listener = 1; _set_state(sock, SOCK_LISTEN); UNLOCK(&sock->lock); return (ISC_R_SUCCESS); } /* * This should try to do aggressive accept() XXXMLG */ isc_result_t isc_socket_accept(isc_socket_t *sock, isc_task_t *task, isc_taskaction_t action, const void *arg) { isc_socket_newconnev_t *adev; isc_socketmgr_t *manager; isc_task_t *ntask = NULL; isc_socket_t *nsock; isc_result_t result; IoCompletionInfo *lpo; REQUIRE(VALID_SOCKET(sock)); manager = sock->manager; REQUIRE(VALID_MANAGER(manager)); LOCK(&sock->lock); CONSISTENT(sock); /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } REQUIRE(sock->listener); /* * Sender field is overloaded here with the task we will be sending * this event to. Just before the actual event is delivered the * actual ev_sender will be touched up to be the socket. */ adev = (isc_socket_newconnev_t *) isc_event_allocate(manager->mctx, task, ISC_SOCKEVENT_NEWCONN, action, arg, sizeof(*adev)); if (adev == NULL) { UNLOCK(&sock->lock); return (ISC_R_NOMEMORY); } ISC_LINK_INIT(adev, ev_link); result = allocate_socket(manager, sock->type, &nsock); if (result != ISC_R_SUCCESS) { isc_event_free((isc_event_t **)&adev); UNLOCK(&sock->lock); return (result); } /* * AcceptEx() requires we pass in a socket. */ nsock->fd = socket(sock->pf, SOCK_STREAM, IPPROTO_TCP); if (nsock->fd == INVALID_SOCKET) { free_socket(&nsock, __LINE__); isc_event_free((isc_event_t **)&adev); UNLOCK(&sock->lock); return (ISC_R_FAILURE); // XXXMLG need real error message } /* * Attach to socket and to task. */ isc_task_attach(task, &ntask); nsock->references++; adev->ev_sender = ntask; adev->newsocket = nsock; _set_state(nsock, SOCK_ACCEPT); /* * Queue io completion for an accept(). */ lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, sizeof(IoCompletionInfo)); RUNTIME_CHECK(lpo != NULL); lpo->acceptbuffer = (void *)HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, (sizeof(SOCKADDR_STORAGE) + 16) * 2); RUNTIME_CHECK(lpo->acceptbuffer != NULL); lpo->adev = adev; lpo->request_type = SOCKET_ACCEPT; ISCAcceptEx(sock->fd, nsock->fd, /* Accepted Socket */ lpo->acceptbuffer, /* Buffer for initial Recv */ 0, /* Length of Buffer */ sizeof(SOCKADDR_STORAGE) + 16, /* Local address length + 16 */ sizeof(SOCKADDR_STORAGE) + 16, /* Remote address lengh + 16 */ (LPDWORD)&lpo->received_bytes, /* Bytes Recved */ (LPOVERLAPPED)lpo /* Overlapped structure */ ); iocompletionport_update(nsock); socket_log(__LINE__, sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND, "accepting for nsock %p fd %d", nsock, nsock->fd); /* * Enqueue the event */ ISC_LIST_ENQUEUE(sock->accept_list, adev, ev_link); sock->pending_accept++; sock->pending_iocp++; UNLOCK(&sock->lock); return (ISC_R_SUCCESS); } isc_result_t isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, isc_task_t *task, isc_taskaction_t action, const void *arg) { char strbuf[ISC_STRERRORSIZE]; isc_socket_connev_t *cdev; isc_task_t *ntask = NULL; isc_socketmgr_t *manager; IoCompletionInfo *lpo; int bind_errno; REQUIRE(VALID_SOCKET(sock)); REQUIRE(addr != NULL); REQUIRE(task != NULL); REQUIRE(action != NULL); manager = sock->manager; REQUIRE(VALID_MANAGER(manager)); REQUIRE(addr != NULL); if (isc_sockaddr_ismulticast(addr)) return (ISC_R_MULTICAST); LOCK(&sock->lock); CONSISTENT(sock); /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } /* * Windows sockets won't connect unless the socket is bound. */ if (!sock->bound) { isc_sockaddr_t any; isc_sockaddr_anyofpf(&any, isc_sockaddr_pf(addr)); if (bind(sock->fd, &any.type.sa, any.length) < 0) { bind_errno = WSAGetLastError(); UNLOCK(&sock->lock); switch (bind_errno) { case WSAEACCES: return (ISC_R_NOPERM); case WSAEADDRNOTAVAIL: return (ISC_R_ADDRNOTAVAIL); case WSAEADDRINUSE: return (ISC_R_ADDRINUSE); case WSAEINVAL: return (ISC_R_BOUND); default: isc__strerror(bind_errno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "bind: %s", strbuf); return (ISC_R_UNEXPECTED); } } sock->bound = 1; } REQUIRE(!sock->pending_connect); cdev = (isc_socket_connev_t *)isc_event_allocate(manager->mctx, sock, ISC_SOCKEVENT_CONNECT, action, arg, sizeof(*cdev)); if (cdev == NULL) { UNLOCK(&sock->lock); return (ISC_R_NOMEMORY); } ISC_LINK_INIT(cdev, ev_link); if (sock->type == isc_sockettype_tcp) { /* * Queue io completion for an accept(). */ lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, sizeof(IoCompletionInfo)); lpo->cdev = cdev; lpo->request_type = SOCKET_CONNECT; sock->address = *addr; ISCConnectEx(sock->fd, &addr->type.sa, addr->length, NULL, 0, NULL, (LPOVERLAPPED)lpo); /* * Attach to task. */ isc_task_attach(task, &ntask); cdev->ev_sender = ntask; sock->pending_connect = 1; _set_state(sock, SOCK_CONNECT); /* * Enqueue the request. */ sock->connect_ev = cdev; sock->pending_iocp++; } else { WSAConnect(sock->fd, &addr->type.sa, addr->length, NULL, NULL, NULL, NULL); cdev->result = ISC_R_SUCCESS; isc_task_send(task, (isc_event_t **)&cdev); } CONSISTENT(sock); UNLOCK(&sock->lock); return (ISC_R_SUCCESS); } isc_result_t isc_socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp) { isc_result_t result; REQUIRE(VALID_SOCKET(sock)); REQUIRE(addressp != NULL); LOCK(&sock->lock); CONSISTENT(sock); /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } if (sock->connected) { *addressp = sock->address; result = ISC_R_SUCCESS; } else { result = ISC_R_NOTCONNECTED; } UNLOCK(&sock->lock); return (result); } isc_result_t isc_socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp) { ISC_SOCKADDR_LEN_T len; isc_result_t result; char strbuf[ISC_STRERRORSIZE]; REQUIRE(VALID_SOCKET(sock)); REQUIRE(addressp != NULL); LOCK(&sock->lock); CONSISTENT(sock); /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } if (!sock->bound) { result = ISC_R_NOTBOUND; goto out; } result = ISC_R_SUCCESS; len = sizeof(addressp->type); if (getsockname(sock->fd, &addressp->type.sa, (void *)&len) < 0) { isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "getsockname: %s", strbuf); result = ISC_R_UNEXPECTED; goto out; } addressp->length = (unsigned int)len; out: UNLOCK(&sock->lock); return (result); } /* * Run through the list of events on this socket, and cancel the ones * queued for task "task" of type "how". "how" is a bitmask. */ void isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) { REQUIRE(VALID_SOCKET(sock)); /* * Quick exit if there is nothing to do. Don't even bother locking * in this case. */ if (how == 0) return; LOCK(&sock->lock); CONSISTENT(sock); /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return; } /* * All of these do the same thing, more or less. * Each will: * o If the internal event is marked as "posted" try to * remove it from the task's queue. If this fails, mark it * as canceled instead, and let the task clean it up later. * o For each I/O request for that task of that type, post * its done event with status of "ISC_R_CANCELED". * o Reset any state needed. */ if ((how & ISC_SOCKCANCEL_RECV) == ISC_SOCKCANCEL_RECV) { isc_socketevent_t *dev; isc_socketevent_t *next; isc_task_t *current_task; dev = ISC_LIST_HEAD(sock->recv_list); while (dev != NULL) { current_task = dev->ev_sender; next = ISC_LIST_NEXT(dev, ev_link); if ((task == NULL) || (task == current_task)) { dev->result = ISC_R_CANCELED; send_recvdone_event(sock, &dev); } dev = next; } } how &= ~ISC_SOCKCANCEL_RECV; if ((how & ISC_SOCKCANCEL_SEND) == ISC_SOCKCANCEL_SEND) { isc_socketevent_t *dev; isc_socketevent_t *next; isc_task_t *current_task; dev = ISC_LIST_HEAD(sock->send_list); while (dev != NULL) { current_task = dev->ev_sender; next = ISC_LIST_NEXT(dev, ev_link); if ((task == NULL) || (task == current_task)) { dev->result = ISC_R_CANCELED; send_senddone_event(sock, &dev); } dev = next; } } how &= ~ISC_SOCKCANCEL_SEND; if (((how & ISC_SOCKCANCEL_ACCEPT) == ISC_SOCKCANCEL_ACCEPT) && !ISC_LIST_EMPTY(sock->accept_list)) { isc_socket_newconnev_t *dev; isc_socket_newconnev_t *next; isc_task_t *current_task; dev = ISC_LIST_HEAD(sock->accept_list); while (dev != NULL) { current_task = dev->ev_sender; next = ISC_LIST_NEXT(dev, ev_link); if ((task == NULL) || (task == current_task)) { dev->newsocket->references--; closesocket(dev->newsocket->fd); dev->newsocket->fd = INVALID_SOCKET; free_socket(&dev->newsocket, __LINE__); dev->result = ISC_R_CANCELED; send_acceptdone_event(sock, &dev); } dev = next; } } how &= ~ISC_SOCKCANCEL_ACCEPT; /* * Connecting is not a list. */ if (((how & ISC_SOCKCANCEL_CONNECT) == ISC_SOCKCANCEL_CONNECT) && sock->connect_ev != NULL) { isc_socket_connev_t *dev; isc_task_t *current_task; INSIST(sock->pending_connect); dev = sock->connect_ev; current_task = dev->ev_sender; if ((task == NULL) || (task == current_task)) { closesocket(sock->fd); sock->fd = INVALID_SOCKET; _set_state(sock, SOCK_CLOSED); sock->connect_ev = NULL; dev->result = ISC_R_CANCELED; send_connectdone_event(sock, &dev); } } how &= ~ISC_SOCKCANCEL_CONNECT; maybe_free_socket(&sock, __LINE__); } isc_sockettype_t isc_socket_gettype(isc_socket_t *sock) { isc_sockettype_t type; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_R_CONNREFUSED); } type = sock->type; UNLOCK(&sock->lock); return (type); } isc_boolean_t isc_socket_isbound(isc_socket_t *sock) { isc_boolean_t val; REQUIRE(VALID_SOCKET(sock)); LOCK(&sock->lock); CONSISTENT(sock); /* * make sure that the socket's not closed */ if (sock->fd == INVALID_SOCKET) { UNLOCK(&sock->lock); return (ISC_FALSE); } val = ((sock->bound) ? ISC_TRUE : ISC_FALSE); UNLOCK(&sock->lock); return (val); } void isc_socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes) { #if defined(IPV6_V6ONLY) int onoff = yes ? 1 : 0; #else UNUSED(yes); #endif REQUIRE(VALID_SOCKET(sock)); #ifdef IPV6_V6ONLY if (sock->pf == AF_INET6) { (void)setsockopt(sock->fd, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&onoff, sizeof(onoff)); } #endif } void isc_socket_cleanunix(isc_sockaddr_t *addr, isc_boolean_t active) { UNUSED(addr); UNUSED(active); } isc_result_t isc_socket_permunix(isc_sockaddr_t *addr, isc_uint32_t perm, isc_uint32_t owner, isc_uint32_t group) { UNUSED(addr); UNUSED(perm); UNUSED(owner); UNUSED(group); return (ISC_R_NOTIMPLEMENTED); } void isc_socket_setname(isc_socket_t *socket, const char *name, void *tag) { /* * Name 'socket'. */ REQUIRE(VALID_SOCKET(socket)); LOCK(&socket->lock); memset(socket->name, 0, sizeof(socket->name)); strncpy(socket->name, name, sizeof(socket->name) - 1); socket->tag = tag; UNLOCK(&socket->lock); } const char * isc_socket_getname(isc_socket_t *socket) { return (socket->name); } void * isc_socket_gettag(isc_socket_t *socket) { return (socket->tag); } void isc__socketmgr_setreserved(isc_socketmgr_t *manager, isc_uint32_t reserved) { UNUSED(manager); UNUSED(reserved); } ntp-4.2.6p5/lib/isc/win32/libisc.mak0000644000175000017500000012070111307651604016042 0ustar peterpeter# Microsoft Developer Studio Generated NMAKE File, Based on libisc.dsp !IF "$(CFG)" == "" CFG=libisc - Win32 Debug !MESSAGE No configuration specified. Defaulting to libisc - Win32 Debug. !ENDIF !IF "$(CFG)" != "libisc - Win32 Release" && "$(CFG)" != "libisc - Win32 Debug" !MESSAGE Invalid configuration "$(CFG)" specified. !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "libisc.mak" CFG="libisc - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "libisc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libisc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE !ERROR An invalid configuration is specified. !ENDIF !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "libisc - Win32 Release" _VC_MANIFEST_INC=0 _VC_MANIFEST_BASENAME=__VC80 !ELSE _VC_MANIFEST_INC=1 _VC_MANIFEST_BASENAME=__VC80.Debug !ENDIF #################################################### # Specifying name of temporary resource file used only in incremental builds: !if "$(_VC_MANIFEST_INC)" == "1" _VC_MANIFEST_AUTO_RES=$(_VC_MANIFEST_BASENAME).auto.res !else _VC_MANIFEST_AUTO_RES= !endif #################################################### # _VC_MANIFEST_EMBED_EXE - command to embed manifest in EXE: !if "$(_VC_MANIFEST_INC)" == "1" #MT_SPECIAL_RETURN=1090650113 #MT_SPECIAL_SWITCH=-notify_resource_update MT_SPECIAL_RETURN=0 MT_SPECIAL_SWITCH= _VC_MANIFEST_EMBED_EXE= \ if exist $@.manifest mt.exe -manifest $@.manifest -out:$(_VC_MANIFEST_BASENAME).auto.manifest $(MT_SPECIAL_SWITCH) & \ if "%ERRORLEVEL%" == "$(MT_SPECIAL_RETURN)" \ rc /r $(_VC_MANIFEST_BASENAME).auto.rc & \ link $** /out:$@ $(LFLAGS) !else _VC_MANIFEST_EMBED_EXE= \ if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;1 !endif #################################################### # _VC_MANIFEST_EMBED_DLL - command to embed manifest in DLL: !if "$(_VC_MANIFEST_INC)" == "1" #MT_SPECIAL_RETURN=1090650113 #MT_SPECIAL_SWITCH=-notify_resource_update MT_SPECIAL_RETURN=0 MT_SPECIAL_SWITCH= _VC_MANIFEST_EMBED_EXE= \ if exist $@.manifest mt.exe -manifest $@.manifest -out:$(_VC_MANIFEST_BASENAME).auto.manifest $(MT_SPECIAL_SWITCH) & \ if "%ERRORLEVEL%" == "$(MT_SPECIAL_RETURN)" \ rc /r $(_VC_MANIFEST_BASENAME).auto.rc & \ link $** /out:$@ $(LFLAGS) !else _VC_MANIFEST_EMBED_EXE= \ if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;2 !endif #################################################### # _VC_MANIFEST_CLEAN - command to clean resources files generated temporarily: !if "$(_VC_MANIFEST_INC)" == "1" _VC_MANIFEST_CLEAN=-del $(_VC_MANIFEST_BASENAME).auto.res \ $(_VC_MANIFEST_BASENAME).auto.rc \ $(_VC_MANIFEST_BASENAME).auto.manifest !else _VC_MANIFEST_CLEAN= !endif !IF "$(CFG)" == "libisc - Win32 Release" OUTDIR=.\Release INTDIR=.\Release ALL : "..\..\..\Build\Release\libisc.dll" CLEAN : -@erase "$(INTDIR)\app.obj" -@erase "$(INTDIR)\assertions.obj" -@erase "$(INTDIR)\base32.obj" -@erase "$(INTDIR)\base64.obj" -@erase "$(INTDIR)\bitstring.obj" -@erase "$(INTDIR)\buffer.obj" -@erase "$(INTDIR)\bufferlist.obj" -@erase "$(INTDIR)\commandline.obj" -@erase "$(INTDIR)\condition.obj" -@erase "$(INTDIR)\dir.obj" -@erase "$(INTDIR)\DLLMain.obj" -@erase "$(INTDIR)\entropy.obj" -@erase "$(INTDIR)\errno2result.obj" -@erase "$(INTDIR)\error.obj" -@erase "$(INTDIR)\event.obj" -@erase "$(INTDIR)\file.obj" -@erase "$(INTDIR)\fsaccess.obj" -@erase "$(INTDIR)\hash.obj" -@erase "$(INTDIR)\heap.obj" -@erase "$(INTDIR)\hex.obj" -@erase "$(INTDIR)\hmacmd5.obj" -@erase "$(INTDIR)\hmacsha.obj" -@erase "$(INTDIR)\httpd.obj" -@erase "$(INTDIR)\inet_aton.obj" -@erase "$(INTDIR)\inet_ntop.obj" -@erase "$(INTDIR)\inet_pton.obj" -@erase "$(INTDIR)\interfaceiter.obj" -@erase "$(INTDIR)\ipv6.obj" -@erase "$(INTDIR)\iterated_hash.obj" -@erase "$(INTDIR)\keyboard.obj" -@erase "$(INTDIR)\lex.obj" -@erase "$(INTDIR)\lfsr.obj" -@erase "$(INTDIR)\lib.obj" -@erase "$(INTDIR)\log.obj" -@erase "$(INTDIR)\md5.obj" -@erase "$(INTDIR)\mem.obj" -@erase "$(INTDIR)\msgcat.obj" -@erase "$(INTDIR)\mutexblock.obj" -@erase "$(INTDIR)\net.obj" -@erase "$(INTDIR)\netaddr.obj" -@erase "$(INTDIR)\netscope.obj" -@erase "$(INTDIR)\ntpaths.obj" -@erase "$(INTDIR)\once.obj" -@erase "$(INTDIR)\ondestroy.obj" -@erase "$(INTDIR)\os.obj" -@erase "$(INTDIR)\parseint.obj" -@erase "$(INTDIR)\portset.obj" -@erase "$(INTDIR)\quota.obj" -@erase "$(INTDIR)\radix.obj" -@erase "$(INTDIR)\random.obj" -@erase "$(INTDIR)\ratelimiter.obj" -@erase "$(INTDIR)\refcount.obj" -@erase "$(INTDIR)\region.obj" -@erase "$(INTDIR)\resource.obj" -@erase "$(INTDIR)\result.obj" -@erase "$(INTDIR)\rwlock.obj" -@erase "$(INTDIR)\serial.obj" -@erase "$(INTDIR)\sha1.obj" -@erase "$(INTDIR)\sha2.obj" -@erase "$(INTDIR)\sockaddr.obj" -@erase "$(INTDIR)\socket.obj" -@erase "$(INTDIR)\stats.obj" -@erase "$(INTDIR)\stdio.obj" -@erase "$(INTDIR)\stdtime.obj" -@erase "$(INTDIR)\strerror.obj" -@erase "$(INTDIR)\string.obj" -@erase "$(INTDIR)\symtab.obj" -@erase "$(INTDIR)\syslog.obj" -@erase "$(INTDIR)\task.obj" -@erase "$(INTDIR)\taskpool.obj" -@erase "$(INTDIR)\thread.obj" -@erase "$(INTDIR)\time.obj" -@erase "$(INTDIR)\timer.obj" -@erase "$(INTDIR)\vc60.idb" -@erase "$(INTDIR)\version.obj" -@erase "$(INTDIR)\win32os.obj" -@erase "$(OUTDIR)\libisc.exp" -@erase "$(OUTDIR)\libisc.lib" -@erase "..\..\..\Build\Release\libisc.dll" -@$(_VC_MANIFEST_CLEAN) "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "./" /I "../../../" /I "include" /I "../include" /I "../../../lib/isc/noatomic/include" /I "win32" /I "../../isccfg/include" /D "WIN32" /D "NDEBUG" /D "__STDC__" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /Fp"$(INTDIR)\libisc.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\libisc.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=user32.lib advapi32.lib ws2_32.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\libisc.pdb" /machine:I386 /def:".\libisc.def" /out:"../../../Build/Release/libisc.dll" /implib:"$(OUTDIR)\libisc.lib" DEF_FILE= \ ".\libisc.def" LINK32_OBJS= \ "$(INTDIR)\app.obj" \ "$(INTDIR)\condition.obj" \ "$(INTDIR)\dir.obj" \ "$(INTDIR)\DLLMain.obj" \ "$(INTDIR)\entropy.obj" \ "$(INTDIR)\errno2result.obj" \ "$(INTDIR)\file.obj" \ "$(INTDIR)\fsaccess.obj" \ "$(INTDIR)\interfaceiter.obj" \ "$(INTDIR)\ipv6.obj" \ "$(INTDIR)\iterated_hash.obj" \ "$(INTDIR)\keyboard.obj" \ "$(INTDIR)\net.obj" \ "$(INTDIR)\ntpaths.obj" \ "$(INTDIR)\once.obj" \ "$(INTDIR)\os.obj" \ "$(INTDIR)\resource.obj" \ "$(INTDIR)\socket.obj" \ "$(INTDIR)\stdio.obj" \ "$(INTDIR)\stdtime.obj" \ "$(INTDIR)\strerror.obj" \ "$(INTDIR)\syslog.obj" \ "$(INTDIR)\thread.obj" \ "$(INTDIR)\time.obj" \ "$(INTDIR)\version.obj" \ "$(INTDIR)\win32os.obj" \ "$(INTDIR)\assertions.obj" \ "$(INTDIR)\base32.obj" \ "$(INTDIR)\base64.obj" \ "$(INTDIR)\bitstring.obj" \ "$(INTDIR)\buffer.obj" \ "$(INTDIR)\bufferlist.obj" \ "$(INTDIR)\commandline.obj" \ "$(INTDIR)\error.obj" \ "$(INTDIR)\event.obj" \ "$(INTDIR)\hash.obj" \ "$(INTDIR)\heap.obj" \ "$(INTDIR)\hex.obj" \ "$(INTDIR)\hmacmd5.obj" \ "$(INTDIR)\hmacsha.obj" \ "$(INTDIR)\httpd.obj" \ "$(INTDIR)\inet_aton.obj" \ "$(INTDIR)\inet_ntop.obj" \ "$(INTDIR)\inet_pton.obj" \ "$(INTDIR)\lex.obj" \ "$(INTDIR)\lfsr.obj" \ "$(INTDIR)\lib.obj" \ "$(INTDIR)\log.obj" \ "$(INTDIR)\md5.obj" \ "$(INTDIR)\mem.obj" \ "$(INTDIR)\msgcat.obj" \ "$(INTDIR)\mutexblock.obj" \ "$(INTDIR)\netaddr.obj" \ "$(INTDIR)\netscope.obj" \ "$(INTDIR)\ondestroy.obj" \ "$(INTDIR)\quota.obj" \ "$(INTDIR)\radix.obj" \ "$(INTDIR)\random.obj" \ "$(INTDIR)\ratelimiter.obj" \ "$(INTDIR)\refcount.obj" \ "$(INTDIR)\result.obj" \ "$(INTDIR)\rwlock.obj" \ "$(INTDIR)\serial.obj" \ "$(INTDIR)\sha1.obj" \ "$(INTDIR)\sha2.obj" \ "$(INTDIR)\sockaddr.obj" \ "$(INTDIR)\stats.obj" \ "$(INTDIR)\string.obj" \ "$(INTDIR)\symtab.obj" \ "$(INTDIR)\task.obj" \ "$(INTDIR)\taskpool.obj" \ "$(INTDIR)\timer.obj" \ "$(INTDIR)\parseint.obj" \ "$(INTDIR)\portset.obj" \ "$(INTDIR)\region.obj" "..\..\..\Build\Release\libisc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << $(_VC_MANIFEST_EMBED_DLL) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" OUTDIR=.\Debug INTDIR=.\Debug # Begin Custom Macros OutDir=.\Debug # End Custom Macros ALL : "..\..\..\Build\Debug\libisc.dll" "$(OUTDIR)\libisc.bsc" CLEAN : -@erase "$(INTDIR)\app.obj" -@erase "$(INTDIR)\app.sbr" -@erase "$(INTDIR)\assertions.obj" -@erase "$(INTDIR)\assertions.sbr" -@erase "$(INTDIR)\base32.obj" -@erase "$(INTDIR)\base32.sbr" -@erase "$(INTDIR)\base64.obj" -@erase "$(INTDIR)\base64.sbr" -@erase "$(INTDIR)\bitstring.obj" -@erase "$(INTDIR)\bitstring.sbr" -@erase "$(INTDIR)\buffer.obj" -@erase "$(INTDIR)\buffer.sbr" -@erase "$(INTDIR)\bufferlist.obj" -@erase "$(INTDIR)\bufferlist.sbr" -@erase "$(INTDIR)\commandline.obj" -@erase "$(INTDIR)\commandline.sbr" -@erase "$(INTDIR)\condition.obj" -@erase "$(INTDIR)\condition.sbr" -@erase "$(INTDIR)\dir.obj" -@erase "$(INTDIR)\dir.sbr" -@erase "$(INTDIR)\DLLMain.obj" -@erase "$(INTDIR)\DLLMain.sbr" -@erase "$(INTDIR)\entropy.obj" -@erase "$(INTDIR)\entropy.sbr" -@erase "$(INTDIR)\errno2result.obj" -@erase "$(INTDIR)\errno2result.sbr" -@erase "$(INTDIR)\error.obj" -@erase "$(INTDIR)\error.sbr" -@erase "$(INTDIR)\event.obj" -@erase "$(INTDIR)\event.sbr" -@erase "$(INTDIR)\file.obj" -@erase "$(INTDIR)\file.sbr" -@erase "$(INTDIR)\fsaccess.obj" -@erase "$(INTDIR)\fsaccess.sbr" -@erase "$(INTDIR)\hash.obj" -@erase "$(INTDIR)\hash.sbr" -@erase "$(INTDIR)\heap.obj" -@erase "$(INTDIR)\heap.sbr" -@erase "$(INTDIR)\hex.obj" -@erase "$(INTDIR)\hex.sbr" -@erase "$(INTDIR)\hmacmd5.obj" -@erase "$(INTDIR)\hmacmd5.sbr" -@erase "$(INTDIR)\hmacsha.obj" -@erase "$(INTDIR)\hmacsha.sbr" -@erase "$(INTDIR)\httpd.obj" -@erase "$(INTDIR)\httpd.sbr" -@erase "$(INTDIR)\inet_aton.obj" -@erase "$(INTDIR)\inet_aton.sbr" -@erase "$(INTDIR)\inet_ntop.obj" -@erase "$(INTDIR)\inet_ntop.sbr" -@erase "$(INTDIR)\inet_pton.obj" -@erase "$(INTDIR)\inet_pton.sbr" -@erase "$(INTDIR)\interfaceiter.obj" -@erase "$(INTDIR)\interfaceiter.sbr" -@erase "$(INTDIR)\ipv6.obj" -@erase "$(INTDIR)\ipv6.sbr" -@erase "$(INTDIR)\iterated_hash.obj" -@erase "$(INTDIR)\iterated_hash.sbr" -@erase "$(INTDIR)\keyboard.obj" -@erase "$(INTDIR)\keyboard.sbr" -@erase "$(INTDIR)\lex.obj" -@erase "$(INTDIR)\lex.sbr" -@erase "$(INTDIR)\lfsr.obj" -@erase "$(INTDIR)\lfsr.sbr" -@erase "$(INTDIR)\lib.obj" -@erase "$(INTDIR)\lib.sbr" -@erase "$(INTDIR)\log.obj" -@erase "$(INTDIR)\log.sbr" -@erase "$(INTDIR)\md5.obj" -@erase "$(INTDIR)\md5.sbr" -@erase "$(INTDIR)\mem.obj" -@erase "$(INTDIR)\mem.sbr" -@erase "$(INTDIR)\msgcat.obj" -@erase "$(INTDIR)\msgcat.sbr" -@erase "$(INTDIR)\mutexblock.obj" -@erase "$(INTDIR)\mutexblock.sbr" -@erase "$(INTDIR)\net.obj" -@erase "$(INTDIR)\net.sbr" -@erase "$(INTDIR)\netaddr.obj" -@erase "$(INTDIR)\netaddr.sbr" -@erase "$(INTDIR)\netscope.obj" -@erase "$(INTDIR)\netscope.sbr" -@erase "$(INTDIR)\ntpaths.obj" -@erase "$(INTDIR)\ntpaths.sbr" -@erase "$(INTDIR)\once.obj" -@erase "$(INTDIR)\once.sbr" -@erase "$(INTDIR)\ondestroy.obj" -@erase "$(INTDIR)\ondestroy.sbr" -@erase "$(INTDIR)\os.obj" -@erase "$(INTDIR)\os.sbr" -@erase "$(INTDIR)\parseint.obj" -@erase "$(INTDIR)\parseint.sbr" -@erase "$(INTDIR)\portset.obj" -@erase "$(INTDIR)\portset.sbr" -@erase "$(INTDIR)\quota.obj" -@erase "$(INTDIR)\quota.sbr" -@erase "$(INTDIR)\radix.obj" -@erase "$(INTDIR)\radix.sbr" -@erase "$(INTDIR)\random.obj" -@erase "$(INTDIR)\random.sbr" -@erase "$(INTDIR)\ratelimiter.obj" -@erase "$(INTDIR)\ratelimiter.sbr" -@erase "$(INTDIR)\refcount.obj" -@erase "$(INTDIR)\refcount.sbr" -@erase "$(INTDIR)\region.obj" -@erase "$(INTDIR)\region.sbr" -@erase "$(INTDIR)\resource.obj" -@erase "$(INTDIR)\resource.sbr" -@erase "$(INTDIR)\result.obj" -@erase "$(INTDIR)\result.sbr" -@erase "$(INTDIR)\rwlock.obj" -@erase "$(INTDIR)\rwlock.sbr" -@erase "$(INTDIR)\serial.obj" -@erase "$(INTDIR)\serial.sbr" -@erase "$(INTDIR)\sha1.obj" -@erase "$(INTDIR)\sha1.sbr" -@erase "$(INTDIR)\sha2.obj" -@erase "$(INTDIR)\sha2.sbr" -@erase "$(INTDIR)\sockaddr.obj" -@erase "$(INTDIR)\sockaddr.sbr" -@erase "$(INTDIR)\socket.obj" -@erase "$(INTDIR)\socket.sbr" -@erase "$(INTDIR)\stats.obj" -@erase "$(INTDIR)\stats.sbr" -@erase "$(INTDIR)\stdio.obj" -@erase "$(INTDIR)\stdio.sbr" -@erase "$(INTDIR)\stdtime.obj" -@erase "$(INTDIR)\stdtime.sbr" -@erase "$(INTDIR)\strerror.obj" -@erase "$(INTDIR)\strerror.sbr" -@erase "$(INTDIR)\string.obj" -@erase "$(INTDIR)\string.sbr" -@erase "$(INTDIR)\symtab.obj" -@erase "$(INTDIR)\symtab.sbr" -@erase "$(INTDIR)\syslog.obj" -@erase "$(INTDIR)\syslog.sbr" -@erase "$(INTDIR)\task.obj" -@erase "$(INTDIR)\task.sbr" -@erase "$(INTDIR)\taskpool.obj" -@erase "$(INTDIR)\taskpool.sbr" -@erase "$(INTDIR)\thread.obj" -@erase "$(INTDIR)\thread.sbr" -@erase "$(INTDIR)\time.obj" -@erase "$(INTDIR)\time.sbr" -@erase "$(INTDIR)\timer.obj" -@erase "$(INTDIR)\timer.sbr" -@erase "$(INTDIR)\vc60.idb" -@erase "$(INTDIR)\vc60.pdb" -@erase "$(INTDIR)\version.obj" -@erase "$(INTDIR)\version.sbr" -@erase "$(INTDIR)\win32os.obj" -@erase "$(INTDIR)\win32os.sbr" -@erase "$(OUTDIR)\libisc.bsc" -@erase "$(OUTDIR)\libisc.exp" -@erase "$(OUTDIR)\libisc.lib" -@erase "$(OUTDIR)\libisc.map" -@erase "$(OUTDIR)\libisc.pdb" -@erase "..\..\..\Build\Debug\libisc.dll" -@erase "..\..\..\Build\Debug\libisc.ilk" -@$(_VC_MANIFEST_CLEAN) "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "./" /I "../../../" /I "include" /I "../include" /I "../../../lib/isc/noatomic/include" /I "win32" /I "../../isccfg/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__STDC__" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\libisc.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\libisc.bsc" BSC32_SBRS= \ "$(INTDIR)\app.sbr" \ "$(INTDIR)\condition.sbr" \ "$(INTDIR)\dir.sbr" \ "$(INTDIR)\DLLMain.sbr" \ "$(INTDIR)\entropy.sbr" \ "$(INTDIR)\errno2result.sbr" \ "$(INTDIR)\file.sbr" \ "$(INTDIR)\fsaccess.sbr" \ "$(INTDIR)\interfaceiter.sbr" \ "$(INTDIR)\ipv6.sbr" \ "$(INTDIR)\iterated_hash.sbr" \ "$(INTDIR)\keyboard.sbr" \ "$(INTDIR)\net.sbr" \ "$(INTDIR)\ntpaths.sbr" \ "$(INTDIR)\once.sbr" \ "$(INTDIR)\os.sbr" \ "$(INTDIR)\resource.sbr" \ "$(INTDIR)\socket.sbr" \ "$(INTDIR)\stdio.sbr" \ "$(INTDIR)\stdtime.sbr" \ "$(INTDIR)\strerror.sbr" \ "$(INTDIR)\syslog.sbr" \ "$(INTDIR)\thread.sbr" \ "$(INTDIR)\time.sbr" \ "$(INTDIR)\version.sbr" \ "$(INTDIR)\win32os.sbr" \ "$(INTDIR)\assertions.sbr" \ "$(INTDIR)\base32.sbr" \ "$(INTDIR)\base64.sbr" \ "$(INTDIR)\bitstring.sbr" \ "$(INTDIR)\buffer.sbr" \ "$(INTDIR)\bufferlist.sbr" \ "$(INTDIR)\commandline.sbr" \ "$(INTDIR)\error.sbr" \ "$(INTDIR)\event.sbr" \ "$(INTDIR)\hash.sbr" \ "$(INTDIR)\heap.sbr" \ "$(INTDIR)\hex.sbr" \ "$(INTDIR)\hmacmd5.sbr" \ "$(INTDIR)\hmacsha.sbr" \ "$(INTDIR)\httpd.sbr" \ "$(INTDIR)\inet_aton.sbr" \ "$(INTDIR)\inet_ntop.sbr" \ "$(INTDIR)\inet_pton.sbr" \ "$(INTDIR)\lex.sbr" \ "$(INTDIR)\lfsr.sbr" \ "$(INTDIR)\lib.sbr" \ "$(INTDIR)\log.sbr" \ "$(INTDIR)\md5.sbr" \ "$(INTDIR)\mem.sbr" \ "$(INTDIR)\msgcat.sbr" \ "$(INTDIR)\mutexblock.sbr" \ "$(INTDIR)\netaddr.sbr" \ "$(INTDIR)\netscope.sbr" \ "$(INTDIR)\ondestroy.sbr" \ "$(INTDIR)\quota.sbr" \ "$(INTDIR)\radix.sbr" \ "$(INTDIR)\random.sbr" \ "$(INTDIR)\ratelimiter.sbr" \ "$(INTDIR)\refcount.sbr" \ "$(INTDIR)\result.sbr" \ "$(INTDIR)\rwlock.sbr" \ "$(INTDIR)\serial.sbr" \ "$(INTDIR)\sha1.sbr" \ "$(INTDIR)\sha2.sbr" \ "$(INTDIR)\sockaddr.sbr" \ "$(INTDIR)\stats.sbr" \ "$(INTDIR)\string.sbr" \ "$(INTDIR)\symtab.sbr" \ "$(INTDIR)\task.sbr" \ "$(INTDIR)\taskpool.sbr" \ "$(INTDIR)\timer.sbr" \ "$(INTDIR)\parseint.sbr" \ "$(INTDIR)\portset.sbr" \ "$(INTDIR)\region.sbr" "$(OUTDIR)\libisc.bsc" : "$(OUTDIR)" $(BSC32_SBRS) $(BSC32) @<< $(BSC32_FLAGS) $(BSC32_SBRS) << LINK32=link.exe LINK32_FLAGS=user32.lib advapi32.lib ws2_32.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\libisc.pdb" /map:"$(INTDIR)\libisc.map" /debug /machine:I386 /def:".\libisc.def" /out:"../../../Build/Debug/libisc.dll" /implib:"$(OUTDIR)\libisc.lib" /pdbtype:sept DEF_FILE= \ ".\libisc.def" LINK32_OBJS= \ "$(INTDIR)\app.obj" \ "$(INTDIR)\condition.obj" \ "$(INTDIR)\dir.obj" \ "$(INTDIR)\DLLMain.obj" \ "$(INTDIR)\entropy.obj" \ "$(INTDIR)\errno2result.obj" \ "$(INTDIR)\file.obj" \ "$(INTDIR)\fsaccess.obj" \ "$(INTDIR)\interfaceiter.obj" \ "$(INTDIR)\ipv6.obj" \ "$(INTDIR)\iterated_hash.obj" \ "$(INTDIR)\keyboard.obj" \ "$(INTDIR)\net.obj" \ "$(INTDIR)\ntpaths.obj" \ "$(INTDIR)\once.obj" \ "$(INTDIR)\os.obj" \ "$(INTDIR)\resource.obj" \ "$(INTDIR)\socket.obj" \ "$(INTDIR)\stdio.obj" \ "$(INTDIR)\stdtime.obj" \ "$(INTDIR)\strerror.obj" \ "$(INTDIR)\syslog.obj" \ "$(INTDIR)\thread.obj" \ "$(INTDIR)\time.obj" \ "$(INTDIR)\version.obj" \ "$(INTDIR)\win32os.obj" \ "$(INTDIR)\assertions.obj" \ "$(INTDIR)\base32.obj" \ "$(INTDIR)\base64.obj" \ "$(INTDIR)\bitstring.obj" \ "$(INTDIR)\buffer.obj" \ "$(INTDIR)\bufferlist.obj" \ "$(INTDIR)\commandline.obj" \ "$(INTDIR)\error.obj" \ "$(INTDIR)\event.obj" \ "$(INTDIR)\hash.obj" \ "$(INTDIR)\heap.obj" \ "$(INTDIR)\hex.obj" \ "$(INTDIR)\hmacmd5.obj" \ "$(INTDIR)\hmacsha.obj" \ "$(INTDIR)\httpd.obj" \ "$(INTDIR)\inet_aton.obj" \ "$(INTDIR)\inet_ntop.obj" \ "$(INTDIR)\inet_pton.obj" \ "$(INTDIR)\lex.obj" \ "$(INTDIR)\lfsr.obj" \ "$(INTDIR)\lib.obj" \ "$(INTDIR)\log.obj" \ "$(INTDIR)\md5.obj" \ "$(INTDIR)\mem.obj" \ "$(INTDIR)\msgcat.obj" \ "$(INTDIR)\mutexblock.obj" \ "$(INTDIR)\netaddr.obj" \ "$(INTDIR)\netscope.obj" \ "$(INTDIR)\ondestroy.obj" \ "$(INTDIR)\quota.obj" \ "$(INTDIR)\radix.obj" \ "$(INTDIR)\random.obj" \ "$(INTDIR)\ratelimiter.obj" \ "$(INTDIR)\refcount.obj" \ "$(INTDIR)\result.obj" \ "$(INTDIR)\rwlock.obj" \ "$(INTDIR)\serial.obj" \ "$(INTDIR)\sha1.obj" \ "$(INTDIR)\sha2.obj" \ "$(INTDIR)\sockaddr.obj" \ "$(INTDIR)\stats.obj" \ "$(INTDIR)\string.obj" \ "$(INTDIR)\symtab.obj" \ "$(INTDIR)\task.obj" \ "$(INTDIR)\taskpool.obj" \ "$(INTDIR)\timer.obj" \ "$(INTDIR)\parseint.obj" \ "$(INTDIR)\portset.obj" \ "$(INTDIR)\region.obj" "..\..\..\Build\Debug\libisc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << $(_VC_MANIFEST_EMBED_DLL) !ENDIF .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << !IF "$(NO_EXTERNAL_DEPS)" != "1" !IF EXISTS("libisc.dep") !INCLUDE "libisc.dep" !ELSE !MESSAGE Warning: cannot find "libisc.dep" !ENDIF !ENDIF !IF "$(CFG)" == "libisc - Win32 Release" || "$(CFG)" == "libisc - Win32 Debug" SOURCE=.\app.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\app.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\app.obj" "$(INTDIR)\app.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\condition.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\condition.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\condition.obj" "$(INTDIR)\condition.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\dir.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\dir.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\dir.obj" "$(INTDIR)\dir.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\DLLMain.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\DLLMain.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\DLLMain.obj" "$(INTDIR)\DLLMain.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\entropy.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\entropy.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\entropy.obj" "$(INTDIR)\entropy.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\errno2result.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\errno2result.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\errno2result.obj" "$(INTDIR)\errno2result.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\file.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\file.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\file.obj" "$(INTDIR)\file.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\fsaccess.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\fsaccess.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\fsaccess.obj" "$(INTDIR)\fsaccess.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\interfaceiter.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\interfaceiter.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\interfaceiter.obj" "$(INTDIR)\interfaceiter.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\ipv6.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\ipv6.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\ipv6.obj" "$(INTDIR)\ipv6.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\keyboard.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\keyboard.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\keyboard.obj" "$(INTDIR)\keyboard.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\net.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\net.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\net.obj" "$(INTDIR)\net.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\ntpaths.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\ntpaths.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\ntpaths.obj" "$(INTDIR)\ntpaths.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\once.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\once.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\once.obj" "$(INTDIR)\once.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\os.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\os.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\os.obj" "$(INTDIR)\os.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\resource.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\resource.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\resource.obj" "$(INTDIR)\resource.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\socket.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\socket.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\socket.obj" "$(INTDIR)\socket.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\stdio.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\stdio.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\stdio.obj" "$(INTDIR)\stdio.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\stdtime.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\stdtime.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\stdtime.obj" "$(INTDIR)\stdtime.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\strerror.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\strerror.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\strerror.obj" "$(INTDIR)\strerror.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\syslog.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\syslog.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\syslog.obj" "$(INTDIR)\syslog.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\thread.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\thread.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\thread.obj" "$(INTDIR)\thread.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\time.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\time.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\time.obj" "$(INTDIR)\time.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\version.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\version.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\version.obj" "$(INTDIR)\version.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=.\win32os.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\win32os.obj" : $(SOURCE) "$(INTDIR)" !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\win32os.obj" "$(INTDIR)\win32os.sbr" : $(SOURCE) "$(INTDIR)" !ENDIF SOURCE=..\assertions.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\assertions.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\assertions.obj" "$(INTDIR)\assertions.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\base32.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\base32.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\base32.obj" "$(INTDIR)\base32.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\base64.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\base64.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\base64.obj" "$(INTDIR)\base64.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\bitstring.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\bitstring.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\bitstring.obj" "$(INTDIR)\bitstring.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\buffer.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\buffer.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\buffer.obj" "$(INTDIR)\buffer.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\bufferlist.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\bufferlist.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\bufferlist.obj" "$(INTDIR)\bufferlist.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\commandline.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\commandline.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\commandline.obj" "$(INTDIR)\commandline.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\error.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\error.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\error.obj" "$(INTDIR)\error.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\event.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\event.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\event.obj" "$(INTDIR)\event.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\hash.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\hash.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\hash.obj" "$(INTDIR)\hash.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\heap.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\heap.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\heap.obj" "$(INTDIR)\heap.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\hex.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\hex.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\hex.obj" "$(INTDIR)\hex.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\hmacmd5.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\hmacmd5.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\hmacmd5.obj" "$(INTDIR)\hmacmd5.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\hmacsha.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\hmacsha.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\hmacsha.obj" "$(INTDIR)\hmacsha.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\httpd.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\httpd.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\httpd.obj" "$(INTDIR)\httpd.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\inet_aton.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\inet_aton.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\inet_aton.obj" "$(INTDIR)\inet_aton.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\inet_ntop.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\inet_ntop.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\inet_ntop.obj" "$(INTDIR)\inet_ntop.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\inet_pton.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\inet_pton.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\inet_pton.obj" "$(INTDIR)\inet_pton.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\iterated_hash.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\iterated_hash.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\iterated_hash.obj" "$(INTDIR)\iterated_hash.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\lex.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\lex.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\lex.obj" "$(INTDIR)\lex.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\lfsr.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\lfsr.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\lfsr.obj" "$(INTDIR)\lfsr.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\lib.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\lib.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\lib.obj" "$(INTDIR)\lib.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\log.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\log.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\log.obj" "$(INTDIR)\log.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\md5.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\md5.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\md5.obj" "$(INTDIR)\md5.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\mem.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\mem.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\mem.obj" "$(INTDIR)\mem.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\nls\msgcat.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\msgcat.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\msgcat.obj" "$(INTDIR)\msgcat.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\mutexblock.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\mutexblock.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\mutexblock.obj" "$(INTDIR)\mutexblock.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\netaddr.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\netaddr.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\netaddr.obj" "$(INTDIR)\netaddr.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\netscope.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\netscope.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\netscope.obj" "$(INTDIR)\netscope.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\ondestroy.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\ondestroy.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\ondestroy.obj" "$(INTDIR)\ondestroy.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\parseint.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\parseint.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\parseint.obj" "$(INTDIR)\parseint.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\portset.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\portset.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\portset.obj" "$(INTDIR)\portset.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\quota.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\quota.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\quota.obj" "$(INTDIR)\quota.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\radix.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\radix.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\radix.obj" "$(INTDIR)\radix.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\random.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\random.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\random.obj" "$(INTDIR)\random.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\ratelimiter.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\ratelimiter.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\ratelimiter.obj" "$(INTDIR)\ratelimiter.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\refcount.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\refcount.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\refcount.obj" "$(INTDIR)\refcount.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\region.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\region.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\region.obj" "$(INTDIR)\region.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\result.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\result.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\result.obj" "$(INTDIR)\result.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\rwlock.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\rwlock.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\rwlock.obj" "$(INTDIR)\rwlock.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\serial.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\serial.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\serial.obj" "$(INTDIR)\serial.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\sha1.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\sha1.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\sha1.obj" "$(INTDIR)\sha1.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\sha2.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\sha2.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\sha2.obj" "$(INTDIR)\sha2.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\sockaddr.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\sockaddr.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\sockaddr.obj" "$(INTDIR)\sockaddr.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\stats.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\stats.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\stats.obj" "$(INTDIR)\stats.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\string.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\string.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\string.obj" "$(INTDIR)\string.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\symtab.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\symtab.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\symtab.obj" "$(INTDIR)\symtab.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\task.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\task.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\task.obj" "$(INTDIR)\task.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\taskpool.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\taskpool.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\taskpool.obj" "$(INTDIR)\taskpool.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF SOURCE=..\timer.c !IF "$(CFG)" == "libisc - Win32 Release" "$(INTDIR)\timer.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "libisc - Win32 Debug" "$(INTDIR)\timer.obj" "$(INTDIR)\timer.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF !ENDIF #################################################### # Commands to generate initial empty manifest file and the RC file # that references it, and for generating the .res file: $(_VC_MANIFEST_BASENAME).auto.res : $(_VC_MANIFEST_BASENAME).auto.rc $(_VC_MANIFEST_BASENAME).auto.rc : $(_VC_MANIFEST_BASENAME).auto.manifest type <<$@ #include 1RT_MANIFEST"$(_VC_MANIFEST_BASENAME).auto.manifest" << KEEP $(_VC_MANIFEST_BASENAME).auto.manifest : type <<$@ << KEEP ntp-4.2.6p5/lib/isc/win32/resource.c0000644000175000017500000000377211307651604016106 0ustar peterpeter/* * Copyright (C) 2004, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: resource.c,v 1.10 2008/07/11 23:47:09 tbox Exp $ */ #include #include #include #include #include #include #include "errno2result.h" /* * Windows limits the maximum number of open files to 2048 */ #define WIN32_MAX_OPEN_FILES 2048 isc_result_t isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value) { isc_resourcevalue_t rlim_value; int wresult; if (resource != isc_resource_openfiles) return (ISC_R_NOTIMPLEMENTED); if (value == ISC_RESOURCE_UNLIMITED) rlim_value = WIN32_MAX_OPEN_FILES; else rlim_value = min(value, WIN32_MAX_OPEN_FILES); wresult = _setmaxstdio((int) rlim_value); if (wresult > 0) return (ISC_R_SUCCESS); else return (isc__errno2result(errno)); } isc_result_t isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value) { if (resource != isc_resource_openfiles) return (ISC_R_NOTIMPLEMENTED); *value = WIN32_MAX_OPEN_FILES; return (ISC_R_SUCCESS); } isc_result_t isc_resource_getcurlimit(isc_resource_t resource, isc_resourcevalue_t *value) { return (isc_resource_getlimit(resource, value)); } ntp-4.2.6p5/lib/isc/win32/time.c0000644000175000017500000001564011307651604015212 0ustar peterpeter/* * Copyright (C) 2004, 2006-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: time.c,v 1.48 2008/09/08 23:47:10 tbox Exp $ */ #include #include #include #include #include #include #include #include #include #include #include /* * struct FILETIME uses "100-nanoseconds intervals". * NS / S = 1000000000 (10^9). * While it is reasonably obvious that this makes the needed * conversion factor 10^7, it is coded this way for additional clarity. */ #define NS_PER_S 1000000000 #define NS_INTERVAL 100 #define INTERVALS_PER_S (NS_PER_S / NS_INTERVAL) #define UINT64_MAX _UI64_MAX /*** *** Absolute Times ***/ static isc_time_t epoch = { { 0, 0 } }; LIBISC_EXTERNAL_DATA isc_time_t *isc_time_epoch = &epoch; /*** *** Intervals ***/ static isc_interval_t zero_interval = { 0 }; LIBISC_EXTERNAL_DATA isc_interval_t *isc_interval_zero = &zero_interval; void isc_interval_set(isc_interval_t *i, unsigned int seconds, unsigned int nanoseconds) { REQUIRE(i != NULL); REQUIRE(nanoseconds < NS_PER_S); /* * This rounds nanoseconds up not down. */ i->interval = (LONGLONG)seconds * INTERVALS_PER_S + (nanoseconds + NS_INTERVAL - 1) / NS_INTERVAL; } isc_boolean_t isc_interval_iszero(const isc_interval_t *i) { REQUIRE(i != NULL); if (i->interval == 0) return (ISC_TRUE); return (ISC_FALSE); } void isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds) { SYSTEMTIME epoch = { 1970, 1, 4, 1, 0, 0, 0, 0 }; FILETIME temp; ULARGE_INTEGER i1; REQUIRE(t != NULL); REQUIRE(nanoseconds < NS_PER_S); SystemTimeToFileTime(&epoch, &temp); i1.LowPart = t->absolute.dwLowDateTime; i1.HighPart = t->absolute.dwHighDateTime; i1.QuadPart += (unsigned __int64)nanoseconds/100; i1.QuadPart += (unsigned __int64)seconds*10000000; t->absolute.dwLowDateTime = i1.LowPart; t->absolute.dwHighDateTime = i1.HighPart; } void isc_time_settoepoch(isc_time_t *t) { REQUIRE(t != NULL); t->absolute.dwLowDateTime = 0; t->absolute.dwHighDateTime = 0; } isc_boolean_t isc_time_isepoch(const isc_time_t *t) { REQUIRE(t != NULL); if (t->absolute.dwLowDateTime == 0 && t->absolute.dwHighDateTime == 0) return (ISC_TRUE); return (ISC_FALSE); } isc_result_t isc_time_now(isc_time_t *t) { REQUIRE(t != NULL); GetSystemTimeAsFileTime(&t->absolute); return (ISC_R_SUCCESS); } isc_result_t isc_time_nowplusinterval(isc_time_t *t, const isc_interval_t *i) { ULARGE_INTEGER i1; REQUIRE(t != NULL); REQUIRE(i != NULL); GetSystemTimeAsFileTime(&t->absolute); i1.LowPart = t->absolute.dwLowDateTime; i1.HighPart = t->absolute.dwHighDateTime; if (UINT64_MAX - i1.QuadPart < (unsigned __int64)i->interval) return (ISC_R_RANGE); i1.QuadPart += i->interval; t->absolute.dwLowDateTime = i1.LowPart; t->absolute.dwHighDateTime = i1.HighPart; return (ISC_R_SUCCESS); } int isc_time_compare(const isc_time_t *t1, const isc_time_t *t2) { REQUIRE(t1 != NULL && t2 != NULL); return ((int)CompareFileTime(&t1->absolute, &t2->absolute)); } isc_result_t isc_time_add(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result) { ULARGE_INTEGER i1; REQUIRE(t != NULL && i != NULL && result != NULL); i1.LowPart = t->absolute.dwLowDateTime; i1.HighPart = t->absolute.dwHighDateTime; if (UINT64_MAX - i1.QuadPart < (unsigned __int64)i->interval) return (ISC_R_RANGE); i1.QuadPart += i->interval; result->absolute.dwLowDateTime = i1.LowPart; result->absolute.dwHighDateTime = i1.HighPart; return (ISC_R_SUCCESS); } isc_result_t isc_time_subtract(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result) { ULARGE_INTEGER i1; REQUIRE(t != NULL && i != NULL && result != NULL); i1.LowPart = t->absolute.dwLowDateTime; i1.HighPart = t->absolute.dwHighDateTime; if (i1.QuadPart < (unsigned __int64) i->interval) return (ISC_R_RANGE); i1.QuadPart -= i->interval; result->absolute.dwLowDateTime = i1.LowPart; result->absolute.dwHighDateTime = i1.HighPart; return (ISC_R_SUCCESS); } isc_uint64_t isc_time_microdiff(const isc_time_t *t1, const isc_time_t *t2) { ULARGE_INTEGER i1, i2; LONGLONG i3; REQUIRE(t1 != NULL && t2 != NULL); i1.LowPart = t1->absolute.dwLowDateTime; i1.HighPart = t1->absolute.dwHighDateTime; i2.LowPart = t2->absolute.dwLowDateTime; i2.HighPart = t2->absolute.dwHighDateTime; if (i1.QuadPart <= i2.QuadPart) return (0); /* * Convert to microseconds. */ i3 = (i1.QuadPart - i2.QuadPart) / 10; return (i3); } isc_uint32_t isc_time_seconds(const isc_time_t *t) { SYSTEMTIME st; /* * Convert the time to a SYSTEMTIME structure and the grab the * milliseconds */ FileTimeToSystemTime(&t->absolute, &st); return ((isc_uint32_t)(st.wMilliseconds / 1000)); } isc_uint32_t isc_time_nanoseconds(const isc_time_t *t) { SYSTEMTIME st; /* * Convert the time to a SYSTEMTIME structure and the grab the * milliseconds */ FileTimeToSystemTime(&t->absolute, &st); return ((isc_uint32_t)(st.wMilliseconds * 1000000)); } void isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len) { FILETIME localft; SYSTEMTIME st; char DateBuf[50]; char TimeBuf[50]; static const char badtime[] = "99-Bad-9999 99:99:99.999"; REQUIRE(len > 0); if (FileTimeToLocalFileTime(&t->absolute, &localft) && FileTimeToSystemTime(&localft, &st)) { GetDateFormat(LOCALE_USER_DEFAULT, 0, &st, "dd-MMM-yyyy", DateBuf, 50); GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOTIMEMARKER| TIME_FORCE24HOURFORMAT, &st, NULL, TimeBuf, 50); snprintf(buf, len, "%s %s.%03u", DateBuf, TimeBuf, st.wMilliseconds); } else snprintf(buf, len, badtime); } void isc_time_formathttptimestamp(const isc_time_t *t, char *buf, unsigned int len) { SYSTEMTIME st; char DateBuf[50]; char TimeBuf[50]; REQUIRE(len > 0); if (FileTimeToSystemTime(&t->absolute, &st)) { GetDateFormat(LOCALE_USER_DEFAULT, 0, &st, "ddd',', dd-MMM-yyyy", DateBuf, 50); GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOTIMEMARKER | TIME_FORCE24HOURFORMAT, &st, "hh':'mm':'ss", TimeBuf, 50); snprintf(buf, len, "%s %s GMT", DateBuf, TimeBuf); } else { buf[0] = 0; } } ntp-4.2.6p5/lib/isc/win32/errno2result.c0000644000175000017500000000641311307651604016720 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: errno2result.c,v 1.17 2008/09/12 04:46:25 marka Exp $ */ #include #include #include "errno2result.h" #include #include #include /* * Convert a POSIX errno value into an isc_result_t. The * list of supported errno values is not complete; new users * of this function should add any expected errors that are * not already there. */ isc_result_t isc__errno2resultx(int posixerrno, const char *file, int line) { char strbuf[ISC_STRERRORSIZE]; switch (posixerrno) { case ENOTDIR: case WSAELOOP: case WSAEINVAL: case EINVAL: /* XXX sometimes this is not for files */ case ENAMETOOLONG: case WSAENAMETOOLONG: case EBADF: case WSAEBADF: return (ISC_R_INVALIDFILE); case ENOENT: return (ISC_R_FILENOTFOUND); case EACCES: case WSAEACCES: case EPERM: return (ISC_R_NOPERM); case EEXIST: return (ISC_R_FILEEXISTS); case EIO: return (ISC_R_IOERROR); case ENOMEM: return (ISC_R_NOMEMORY); case ENFILE: case EMFILE: case WSAEMFILE: return (ISC_R_TOOMANYOPENFILES); case ERROR_CANCELLED: return (ISC_R_CANCELED); case ERROR_CONNECTION_REFUSED: case WSAECONNREFUSED: return (ISC_R_CONNREFUSED); case WSAENOTCONN: case ERROR_CONNECTION_INVALID: return (ISC_R_NOTCONNECTED); case ERROR_HOST_UNREACHABLE: case WSAEHOSTUNREACH: return (ISC_R_HOSTUNREACH); case ERROR_NETWORK_UNREACHABLE: case WSAENETUNREACH: return (ISC_R_NETUNREACH); case ERROR_NO_NETWORK: return (ISC_R_NETUNREACH); case ERROR_PORT_UNREACHABLE: return (ISC_R_HOSTUNREACH); case ERROR_SEM_TIMEOUT: return (ISC_R_TIMEDOUT); case WSAECONNRESET: case WSAENETRESET: case WSAECONNABORTED: case WSAEDISCON: case ERROR_OPERATION_ABORTED: case ERROR_CONNECTION_ABORTED: case ERROR_REQUEST_ABORTED: return (ISC_R_CONNECTIONRESET); case WSAEADDRNOTAVAIL: return (ISC_R_ADDRNOTAVAIL); case ERROR_NETNAME_DELETED: case WSAENETDOWN: return (ISC_R_NETUNREACH); case WSAEHOSTDOWN: return (ISC_R_HOSTUNREACH); case WSAENOBUFS: return (ISC_R_NORESOURCES); default: isc__strerror(posixerrno, strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(file, line, "unable to convert errno " "to isc_result: %d: %s", posixerrno, strbuf); /* * XXXDCL would be nice if perhaps this function could * return the system's error string, so the caller * might have something more descriptive than "unexpected * error" to log with. */ return (ISC_R_UNEXPECTED); } } ntp-4.2.6p5/lib/isc/netscope.c0000644000175000017500000000447711307651605015141 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /*! \file */ #if defined(LIBC_SCCS) && !defined(lint) static char rcsid[] = "$Id: netscope.c,v 1.13 2007/06/19 23:47:17 tbox Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include #include #include isc_result_t isc_netscope_pton(int af, char *scopename, void *addr, isc_uint32_t *zoneid) { char *ep; #ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX unsigned int ifid; #endif struct in6_addr *in6; isc_uint32_t zone; isc_uint64_t llz; /* at this moment, we only support AF_INET6 */ if (af != AF_INET6) return (ISC_R_FAILURE); in6 = (struct in6_addr *)addr; /* * Basically, "names" are more stable than numeric IDs in terms of * renumbering, and are more preferred. However, since there is no * standard naming convention and APIs to deal with the names. Thus, * we only handle the case of link-local addresses, for which we use * interface names as link names, assuming one to one mapping between * interfaces and links. */ #ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX if (IN6_IS_ADDR_LINKLOCAL(in6) && (ifid = if_nametoindex((const char *)scopename)) != 0) zone = (isc_uint32_t)ifid; else { #endif llz = isc_string_touint64(scopename, &ep, 10); if (ep == scopename) return (ISC_R_FAILURE); /* check overflow */ zone = (isc_uint32_t)(llz & 0xffffffffUL); if (zone != llz) return (ISC_R_FAILURE); #ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX } #endif *zoneid = zone; return (ISC_R_SUCCESS); } ntp-4.2.6p5/lib/isc/x86_32/0000755000175000017500000000000011307651602014067 5ustar peterpeterntp-4.2.6p5/lib/isc/x86_32/include/0000755000175000017500000000000011307651602015512 5ustar peterpeterntp-4.2.6p5/lib/isc/x86_32/include/isc/0000755000175000017500000000000011675461367016307 5ustar peterpeterntp-4.2.6p5/lib/isc/x86_32/include/isc/atomic.h0000644000175000017500000001024211307651603017715 0ustar peterpeter/* * Copyright (C) 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: atomic.h,v 1.10 2008/01/24 23:47:00 tbox Exp $ */ #ifndef ISC_ATOMIC_H #define ISC_ATOMIC_H 1 #include #include #ifdef ISC_PLATFORM_USEGCCASM /* * This routine atomically increments the value stored in 'p' by 'val', and * returns the previous value. */ static __inline__ isc_int32_t isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { isc_int32_t prev = val; __asm__ volatile( #ifdef ISC_PLATFORM_USETHREADS "lock;" #endif "xadd %0, %1" :"=q"(prev) :"m"(*p), "0"(prev) :"memory", "cc"); return (prev); } #ifdef ISC_PLATFORM_HAVEXADDQ static __inline__ isc_int64_t isc_atomic_xaddq(isc_int64_t *p, isc_int64_t val) { isc_int64_t prev = val; __asm__ volatile( #ifdef ISC_PLATFORM_USETHREADS "lock;" #endif "xaddq %0, %1" :"=q"(prev) :"m"(*p), "0"(prev) :"memory", "cc"); return (prev); } #endif /* ISC_PLATFORM_HAVEXADDQ */ /* * This routine atomically stores the value 'val' in 'p'. */ static __inline__ void isc_atomic_store(isc_int32_t *p, isc_int32_t val) { __asm__ volatile( #ifdef ISC_PLATFORM_USETHREADS /* * xchg should automatically lock memory, but we add it * explicitly just in case (it at least doesn't harm) */ "lock;" #endif "xchgl %1, %0" : : "r"(val), "m"(*p) : "memory"); } /* * This routine atomically replaces the value in 'p' with 'val', if the * original value is equal to 'cmpval'. The original value is returned in any * case. */ static __inline__ isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { __asm__ volatile( #ifdef ISC_PLATFORM_USETHREADS "lock;" #endif "cmpxchgl %1, %2" : "=a"(cmpval) : "r"(val), "m"(*p), "a"(cmpval) : "memory"); return (cmpval); } #elif defined(ISC_PLATFORM_USESTDASM) /* * The followings are "generic" assembly code which implements the same * functionality in case the gcc extension cannot be used. It should be * better to avoid inlining below, since we directly refer to specific * positions of the stack frame, which would not actually point to the * intended address in the embedded mnemonic. */ #include /* for 'UNUSED' macro */ static isc_int32_t isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) { UNUSED(p); UNUSED(val); __asm ( "movl 8(%ebp), %ecx\n" "movl 12(%ebp), %edx\n" #ifdef ISC_PLATFORM_USETHREADS "lock;" #endif "xadd %edx, (%ecx)\n" /* * set the return value directly in the register so that we * can avoid guessing the correct position in the stack for a * local variable. */ "movl %edx, %eax" ); } static void isc_atomic_store(isc_int32_t *p, isc_int32_t val) { UNUSED(p); UNUSED(val); __asm ( "movl 8(%ebp), %ecx\n" "movl 12(%ebp), %edx\n" #ifdef ISC_PLATFORM_USETHREADS "lock;" #endif "xchgl (%ecx), %edx\n" ); } static isc_int32_t isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) { UNUSED(p); UNUSED(cmpval); UNUSED(val); __asm ( "movl 8(%ebp), %ecx\n" "movl 12(%ebp), %eax\n" /* must be %eax for cmpxchgl */ "movl 16(%ebp), %edx\n" #ifdef ISC_PLATFORM_USETHREADS "lock;" #endif /* * If (%ecx) == %eax then (%ecx) := %edx. % %eax is set to old (%ecx), which will be the return value. */ "cmpxchgl %edx, (%ecx)" ); } #else /* !ISC_PLATFORM_USEGCCASM && !ISC_PLATFORM_USESTDASM */ #error "unsupported compiler. disable atomic ops by --disable-atomic" #endif #endif /* ISC_ATOMIC_H */ ntp-4.2.6p5/lib/isc/task_p.h0000644000175000017500000000210111307651603014563 0ustar peterpeter/* * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: task_p.h,v 1.11 2007/06/19 23:47:17 tbox Exp $ */ #ifndef ISC_TASK_P_H #define ISC_TASK_P_H /*! \file */ isc_boolean_t isc__taskmgr_ready(void); isc_result_t isc__taskmgr_dispatch(void); #endif /* ISC_TASK_P_H */ ntp-4.2.6p5/lib/isc/heap.c0000644000175000017500000001456711307651605014237 0ustar peterpeter/* * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1997-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: heap.c,v 1.37 2007/10/19 17:15:53 explorer Exp $ */ /*! \file * Heap implementation of priority queues adapted from the following: * * \li "Introduction to Algorithms," Cormen, Leiserson, and Rivest, * MIT Press / McGraw Hill, 1990, ISBN 0-262-03141-8, chapter 7. * * \li "Algorithms," Second Edition, Sedgewick, Addison-Wesley, 1988, * ISBN 0-201-06673-4, chapter 11. */ #include #include #include #include #include /* Required for memcpy. */ #include /*@{*/ /*% * Note: to make heap_parent and heap_left easy to compute, the first * element of the heap array is not used; i.e. heap subscripts are 1-based, * not 0-based. The parent is index/2, and the left-child is index*2. * The right child is index*2+1. */ #define heap_parent(i) ((i) >> 1) #define heap_left(i) ((i) << 1) /*@}*/ #define SIZE_INCREMENT 1024 #define HEAP_MAGIC ISC_MAGIC('H', 'E', 'A', 'P') #define VALID_HEAP(h) ISC_MAGIC_VALID(h, HEAP_MAGIC) /*% * When the heap is in a consistent state, the following invariant * holds true: for every element i > 1, heap_parent(i) has a priority * higher than or equal to that of i. */ #define HEAPCONDITION(i) ((i) == 1 || \ ! heap->compare(heap->array[(i)], \ heap->array[heap_parent(i)])) /*% ISC heap structure. */ struct isc_heap { unsigned int magic; isc_mem_t * mctx; unsigned int size; unsigned int size_increment; unsigned int last; void **array; isc_heapcompare_t compare; isc_heapindex_t index; }; isc_result_t isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare, isc_heapindex_t index, unsigned int size_increment, isc_heap_t **heapp) { isc_heap_t *heap; REQUIRE(heapp != NULL && *heapp == NULL); REQUIRE(compare != NULL); heap = isc_mem_get(mctx, sizeof(*heap)); if (heap == NULL) return (ISC_R_NOMEMORY); heap->magic = HEAP_MAGIC; heap->mctx = mctx; heap->size = 0; if (size_increment == 0) heap->size_increment = SIZE_INCREMENT; else heap->size_increment = size_increment; heap->last = 0; heap->array = NULL; heap->compare = compare; heap->index = index; *heapp = heap; return (ISC_R_SUCCESS); } void isc_heap_destroy(isc_heap_t **heapp) { isc_heap_t *heap; REQUIRE(heapp != NULL); heap = *heapp; REQUIRE(VALID_HEAP(heap)); if (heap->array != NULL) isc_mem_put(heap->mctx, heap->array, heap->size * sizeof(void *)); heap->magic = 0; isc_mem_put(heap->mctx, heap, sizeof(*heap)); *heapp = NULL; } static isc_boolean_t resize(isc_heap_t *heap) { void **new_array; size_t new_size; REQUIRE(VALID_HEAP(heap)); new_size = heap->size + heap->size_increment; new_array = isc_mem_get(heap->mctx, new_size * sizeof(void *)); if (new_array == NULL) return (ISC_FALSE); if (heap->array != NULL) { memcpy(new_array, heap->array, heap->size * sizeof(void *)); isc_mem_put(heap->mctx, heap->array, heap->size * sizeof(void *)); } heap->size = new_size; heap->array = new_array; return (ISC_TRUE); } static void float_up(isc_heap_t *heap, unsigned int i, void *elt) { unsigned int p; for (p = heap_parent(i) ; i > 1 && heap->compare(elt, heap->array[p]) ; i = p, p = heap_parent(i)) { heap->array[i] = heap->array[p]; if (heap->index != NULL) (heap->index)(heap->array[i], i); } heap->array[i] = elt; if (heap->index != NULL) (heap->index)(heap->array[i], i); INSIST(HEAPCONDITION(i)); } static void sink_down(isc_heap_t *heap, unsigned int i, void *elt) { unsigned int j, size, half_size; size = heap->last; half_size = size / 2; while (i <= half_size) { /* Find the smallest of the (at most) two children. */ j = heap_left(i); if (j < size && heap->compare(heap->array[j+1], heap->array[j])) j++; if (heap->compare(elt, heap->array[j])) break; heap->array[i] = heap->array[j]; if (heap->index != NULL) (heap->index)(heap->array[i], i); i = j; } heap->array[i] = elt; if (heap->index != NULL) (heap->index)(heap->array[i], i); INSIST(HEAPCONDITION(i)); } isc_result_t isc_heap_insert(isc_heap_t *heap, void *elt) { unsigned int i; REQUIRE(VALID_HEAP(heap)); i = ++heap->last; if (heap->last >= heap->size && !resize(heap)) return (ISC_R_NOMEMORY); float_up(heap, i, elt); return (ISC_R_SUCCESS); } void isc_heap_delete(isc_heap_t *heap, unsigned int index) { void *elt; isc_boolean_t less; REQUIRE(VALID_HEAP(heap)); REQUIRE(index >= 1 && index <= heap->last); if (index == heap->last) { heap->array[heap->last] = NULL; heap->last--; } else { elt = heap->array[heap->last]; heap->array[heap->last] = NULL; heap->last--; less = heap->compare(elt, heap->array[index]); heap->array[index] = elt; if (less) float_up(heap, index, heap->array[index]); else sink_down(heap, index, heap->array[index]); } } void isc_heap_increased(isc_heap_t *heap, unsigned int index) { REQUIRE(VALID_HEAP(heap)); REQUIRE(index >= 1 && index <= heap->last); float_up(heap, index, heap->array[index]); } void isc_heap_decreased(isc_heap_t *heap, unsigned int index) { REQUIRE(VALID_HEAP(heap)); REQUIRE(index >= 1 && index <= heap->last); sink_down(heap, index, heap->array[index]); } void * isc_heap_element(isc_heap_t *heap, unsigned int index) { REQUIRE(VALID_HEAP(heap)); REQUIRE(index >= 1); if (index <= heap->last) return (heap->array[index]); return (NULL); } void isc_heap_foreach(isc_heap_t *heap, isc_heapaction_t action, void *uap) { unsigned int i; REQUIRE(VALID_HEAP(heap)); REQUIRE(action != NULL); for (i = 1 ; i <= heap->last ; i++) (action)(heap->array[i], uap); } ntp-4.2.6p5/ntpsnmpd/0000755000175000017500000000000011675461364013471 5ustar peterpeterntp-4.2.6p5/ntpsnmpd/ntpsnmpd-opts.def0000644000175000017500000000155211367517350016775 0ustar peterpeter/* -*- Mode: Text -*- */ autogen definitions options; #include copyright.def #include homerc.def #include autogen-version.def prog-name = "ntpsnmpd"; prog-title = "NTP SNMP MIB agent"; test-main; flag = { name = nofork; value = n; descrip = "Do not fork"; doc = <<- _EndOfDoc_ _EndOfDoc_; }; flag = { name = syslog; value = p; descrip = "Log to syslog()"; doc = <<- _EndOfDoc_ _EndOfDoc_; }; flag = { name = agentXSocket; /* value = x; */ arg-type = string; arg-default = "unix:/var/agentx/master"; descrip = "The socket address ntpsnmpd uses to connect to net-snmpd"; doc = <<- _EndOfDoc_ [:] The default is the Unix Domain socket "unix:/var/agentx/master". Another common alternative is tcp:localhost:705. _EndOfDoc_; }; ntp-4.2.6p5/ntpsnmpd/ntpSnmpSubagentObject.c0000644000175000017500000003442511456223254020113 0ustar peterpeter/***************************************************************************** * * ntpSnmpSubAgentObject.c * * This file provides the callback functions for net-snmp and registers the * serviced MIB objects with the master agent. * * Each object has its own callback function that is called by the * master agent process whenever someone queries the corresponding MIB * object. * * At the moment this triggers a full send/receive procedure for each * queried MIB object, one of the things that are still on my todo list: * a caching mechanism that reduces the number of requests sent to the * ntpd process. * ****************************************************************************/ #include #include #include #include /* general purpose buffer length definition */ #define NTPQ_BUFLEN 2048 char ntpvalue[NTPQ_BUFLEN]; /***************************************************************************** * * ntpsnmpd_parse_string * * This function will parse a given NULL terminated string and cut it * into a fieldname and a value part (using the '=' as the delimiter. * The fieldname will be converted to uppercase and all whitespace * characters are removed from it. * The value part is stripped, e.g. all whitespace characters are removed * from the beginning and end of the string. * If the value is started and ended with quotes ("), they will be removed * and everything between the quotes is left untouched (including * whitespace) * Example: * server host name = hello world! * will result in a field string "SERVERHOSTNAME" and a value * of "hello world!". * My first Parameter = " is this! " * results in a field string "MYFIRSTPARAMETER" and a value " is this! " **************************************************************************** * Parameters: * string const char * The source string to parse. * NOTE: must be NULL terminated! * field char * The buffer for the field name. * fieldsize size_t The size of the field buffer. * value char * The buffer for the value. * valuesize size_t The size of the value buffer. * * Returns: * size_t length of value string ****************************************************************************/ size_t ntpsnmpd_parse_string( const char * string, char * field, size_t fieldsize, char * value, size_t valuesize ) { int i; int j; int loop; size_t str_cnt; size_t val_cnt; /* we need at least one byte to work with to simplify */ if (fieldsize < 1 || valuesize < 1) return 0; str_cnt = strlen(string); /* Parsing the field name */ j = 0; loop = TRUE; for (i = 0; loop && i <= str_cnt; i++) { switch (string[i]) { case '\t': /* Tab */ case '\n': /* LF */ case '\r': /* CR */ case ' ': /* Space */ break; case '=': loop = FALSE; break; default: if (j < fieldsize) field[j++] = toupper(string[i]); } } j = min(j, fieldsize - 1); field[j] = '\0'; /* Now parsing the value */ value[0] = '\0'; j = 0; for (val_cnt = 0; i < str_cnt; i++) { if (string[i] > 0x0D && string[i] != ' ') val_cnt = min(j + 1, valuesize - 1); if (value[0] != '\0' || (string[i] > 0x0D && string[i] != ' ')) { if (j < valuesize) value[j++] = string[i]; } } value[val_cnt] = '\0'; if (value[0] == '"') { val_cnt--; strncpy(value, &value[1], valuesize); if (val_cnt > 0 && value[val_cnt - 1] == '"') { val_cnt--; value[val_cnt] = '\0'; } } return val_cnt; } /***************************************************************************** * * ntpsnmpd_cut_string * * This function will parse a given NULL terminated string and cut it * into fields using the specified delimiter character. * It will then copy the requested field into a destination buffer * Example: * ntpsnmpd_cut_string(read:my:lips:fool, RESULT, ':', 2, sizeof(RESULT)) * will copy "lips" to RESULT. **************************************************************************** * Parameters: * src const char * The name of the source string variable * NOTE: must be NULL terminated! * dest char * The name of the string which takes the * requested field content * delim char The delimiter character * fieldnumber int The number of the required field * (start counting with 0) * maxsize size_t The maximum size of dest * * Returns: * size_t length of resulting dest string ****************************************************************************/ size_t ntpsnmpd_cut_string( const char * string, char * dest, char delim, int fieldnumber, size_t maxsize ) { size_t i; size_t j; int l; size_t str_cnt; if (maxsize < 1) return 0; str_cnt = strlen(string); j = 0; memset(dest, 0, maxsize); /* Parsing the field name */ for (i = 0, l = 0; i < str_cnt && l <= fieldnumber; i++) { if (string[i] == delim) l++; /* next field */ else if (l == fieldnumber && j < maxsize) dest[j++] = string[i]; } j = min(j, maxsize - 1); dest[j] = '\0'; return j; } /***************************************************************************** * * read_ntp_value * * This function retrieves the value for a given variable, currently * this only supports sysvars. It starts a full mode 6 send/receive/parse * iteration and needs to be optimized, e.g. by using a caching mechanism * **************************************************************************** * Parameters: * variable char* The name of the required variable * rbuffer char* The buffer where the value goes * maxlength int Max. number of bytes for resultbuf * * Returns: * u_int number of chars that have been copied to * rbuffer ****************************************************************************/ size_t read_ntp_value( const char * variable, char * value, size_t valuesize ) { size_t sv_len; char sv_data[NTPQ_BUFLEN]; memset(sv_data, 0, sizeof(sv_data)); sv_len = ntpq_read_sysvars(sv_data, sizeof(sv_data)); if (0 == sv_len) return 0; else return ntpq_getvar(sv_data, sv_len, variable, value, valuesize); } /***************************************************************************** * * The get_xxx functions * * The following function calls are callback functions that will be * used by the master agent process to retrieve a value for a requested * MIB object. * ****************************************************************************/ int get_ntpEntSoftwareName (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { char ntp_softwarename[NTPQ_BUFLEN]; memset (ntp_softwarename, 0, NTPQ_BUFLEN); switch (reqinfo->mode) { case MODE_GET: { if ( read_ntp_value("product", ntpvalue, NTPQ_BUFLEN) ) { snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *)ntpvalue, strlen(ntpvalue) ); } else if ( read_ntp_value("version", ntpvalue, NTPQ_BUFLEN) ) { ntpsnmpd_cut_string(ntpvalue, ntp_softwarename, ' ', 0, sizeof(ntp_softwarename)-1); snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *)ntp_softwarename, strlen(ntp_softwarename) ); } else { snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *)"N/A", 3 ); } break; } default: /* If we cannot get the information we need, we will return a generic error to the SNMP client */ return SNMP_ERR_GENERR; } return SNMP_ERR_NOERROR; } int get_ntpEntSoftwareVersion (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { switch (reqinfo->mode) { case MODE_GET: { if ( read_ntp_value("version", ntpvalue, NTPQ_BUFLEN) ) { snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *)ntpvalue, strlen(ntpvalue) ); } else { snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *)"N/A", 3 ); } break; } default: /* If we cannot get the information we need, we will return a generic error to the SNMP client */ return SNMP_ERR_GENERR; } return SNMP_ERR_NOERROR; } int get_ntpEntSoftwareVendor (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { switch (reqinfo->mode) { case MODE_GET: { if ( read_ntp_value("vendor", ntpvalue, NTPQ_BUFLEN) ) { snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *)ntpvalue, strlen(ntpvalue) ); } else { snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *)"N/A", 3 ); } break; default: /* If we cannot get the information we need, we will return a generic error to the SNMP client */ return SNMP_ERR_GENERR; } } return SNMP_ERR_NOERROR; } int get_ntpEntSystemType (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { switch (reqinfo->mode) { case MODE_GET: { if ( read_ntp_value("systemtype", ntpvalue, NTPQ_BUFLEN) ) { snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *)ntpvalue, strlen(ntpvalue) ); } if ( read_ntp_value("system", ntpvalue, NTPQ_BUFLEN) ) { snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *)ntpvalue, strlen(ntpvalue) ); } else { snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *)"N/A", 3 ); } break; } default: /* If we cannot get the information we need, we will return a generic error to the SNMP client */ return SNMP_ERR_GENERR; } return SNMP_ERR_NOERROR; } /* * ntpEntTimeResolution * "The time resolution in integer format, where the resolution * is represented as divisions of a second, e.g., a value of 1000 * translates to 1.0 ms." * * ntpEntTimeResolution is a challenge for ntpd, as the resolution is * not known nor exposed by ntpd, only the measured precision (time to * read the clock). * * Logically the resolution must be at least the precision, so report * it as our best approximation of resolution until/unless ntpd provides * better. */ int get_ntpEntTimeResolution( netsnmp_mib_handler * handler, netsnmp_handler_registration * reginfo, netsnmp_agent_request_info * reqinfo, netsnmp_request_info * requests ) { int precision; u_int32 resolution; switch (reqinfo->mode) { case MODE_GET: if (!read_ntp_value("precision", ntpvalue, sizeof(ntpvalue))) return SNMP_ERR_GENERR; if (1 != sscanf(ntpvalue, "%d", &precision)) return SNMP_ERR_GENERR; if (precision >= 0) return SNMP_ERR_GENERR; precision = max(precision, -31); resolution = 1 << -precision; snmp_set_var_typed_value( requests->requestvb, ASN_UNSIGNED, (void *)&resolution, sizeof(resolution)); break; default: return SNMP_ERR_GENERR; } return SNMP_ERR_NOERROR; } /* * ntpEntTimePrecision * "The entity's precision in integer format, shows the precision. * A value of -5 would mean 2^-5 = 31.25 ms." */ int get_ntpEntTimePrecision( netsnmp_mib_handler * handler, netsnmp_handler_registration * reginfo, netsnmp_agent_request_info * reqinfo, netsnmp_request_info * requests ) { int precision; int32 precision32; switch (reqinfo->mode) { case MODE_GET: if (!read_ntp_value("precision", ntpvalue, sizeof(ntpvalue))) return SNMP_ERR_GENERR; if (1 != sscanf(ntpvalue, "%d", &precision)) return SNMP_ERR_GENERR; precision32 = (int32)precision; snmp_set_var_typed_value( requests->requestvb, ASN_INTEGER, (void *)&precision32, sizeof(precision32)); break; default: return SNMP_ERR_GENERR; } return SNMP_ERR_NOERROR; } int get_ntpEntTimeDistance (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { switch (reqinfo->mode) { case MODE_GET: { if ( read_ntp_value("rootdelay", ntpvalue, NTPQ_BUFLEN) ) { snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *)ntpvalue, strlen(ntpvalue) ); } else { snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, (u_char *)"N/A", 3 ); } break; } default: /* If we cannot get the information we need, we will return a generic error to the SNMP client */ return SNMP_ERR_GENERR; } return SNMP_ERR_NOERROR; } /* * * Initialize sub agent */ void init_ntpSnmpSubagentObject(void) { /* Register all MIB objects with the agentx master */ NTP_OID_RO( ntpEntSoftwareName, 1, 1, 1, 0); NTP_OID_RO( ntpEntSoftwareVersion, 1, 1, 2, 0); NTP_OID_RO( ntpEntSoftwareVendor, 1, 1, 3, 0); NTP_OID_RO( ntpEntSystemType, 1, 1, 4, 0); NTP_OID_RO( ntpEntTimeResolution, 1, 1, 5, 0); NTP_OID_RO( ntpEntTimePrecision, 1, 1, 6, 0); NTP_OID_RO( ntpEntTimeDistance, 1, 1, 7, 0); } ntp-4.2.6p5/ntpsnmpd/ntpsnmpd-opts.h0000644000175000017500000001420011675460614016462 0ustar peterpeter/* * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h) * * It has been AutoGen-ed December 24, 2011 at 06:34:36 PM by AutoGen 5.12 * From the definitions ntpsnmpd-opts.def * and the template file options * * Generated from AutoOpts 35:0:10 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the ntpsnmpd author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * This source file is copyrighted and licensed under the following terms: * * see html/copyright.html * */ /* * This file contains the programmatic interface to the Automated * Options generated for the ntpsnmpd program. * These macros are documented in the AutoGen info file in the * "AutoOpts" chapter. Please refer to that doc for usage help. */ #ifndef AUTOOPTS_NTPSNMPD_OPTS_H_GUARD #define AUTOOPTS_NTPSNMPD_OPTS_H_GUARD 1 #include "config.h" #include /* * Ensure that the library used for compiling this generated header is at * least as new as the version current when the header template was released * (not counting patch version increments). Also ensure that the oldest * tolerable version is at least as old as what was current when the header * template was released. */ #define AO_TEMPLATE_VERSION 143360 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header Choke Me. #endif /* * Enumeration of each option: */ typedef enum { INDEX_OPT_NOFORK = 0, INDEX_OPT_SYSLOG = 1, INDEX_OPT_AGENTXSOCKET = 2, INDEX_OPT_VERSION = 3, INDEX_OPT_HELP = 4, INDEX_OPT_MORE_HELP = 5, INDEX_OPT_SAVE_OPTS = 6, INDEX_OPT_LOAD_OPTS = 7 } teOptIndex; #define OPTION_CT 8 #define NTPSNMPD_VERSION "4.2.6p5" #define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.6p5" /* * Interface defines for all options. Replace "n" with the UPPER_CASED * option name (as in the teOptIndex enumeration above). * e.g. HAVE_OPT(NOFORK) */ #define DESC(n) (ntpsnmpdOptions.pOptDesc[INDEX_OPT_## n]) #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) #define OPT_ARG(n) (DESC(n).optArg.argString) #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) #define COUNT_OPT(n) (DESC(n).optOccCt) #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) #define CLEAR_OPT(n) STMTS( \ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ DESC(n).fOptState |= OPTST_DISABLED; \ DESC(n).optCookie = NULL ) /* * * * * * * * Enumeration of ntpsnmpd exit codes */ typedef enum { NTPSNMPD_EXIT_SUCCESS = 0, NTPSNMPD_EXIT_FAILURE = 1 } ntpsnmpd_exit_code_t; /* * Make sure there are no #define name conflicts with the option names */ #ifndef NO_OPTION_NAME_WARNINGS # ifdef NOFORK # warning undefining NOFORK due to option name conflict # undef NOFORK # endif # ifdef SYSLOG # warning undefining SYSLOG due to option name conflict # undef SYSLOG # endif # ifdef AGENTXSOCKET # warning undefining AGENTXSOCKET due to option name conflict # undef AGENTXSOCKET # endif #else /* NO_OPTION_NAME_WARNINGS */ # undef NOFORK # undef SYSLOG # undef AGENTXSOCKET #endif /* NO_OPTION_NAME_WARNINGS */ /* * * * * * * * Interface defines for specific options. */ #define VALUE_OPT_NOFORK 'n' #define VALUE_OPT_SYSLOG 'p' #define VALUE_OPT_AGENTXSOCKET 2 #define VALUE_OPT_HELP '?' #define VALUE_OPT_MORE_HELP '!' #define VALUE_OPT_VERSION INDEX_OPT_VERSION #define VALUE_OPT_SAVE_OPTS '>' #define VALUE_OPT_LOAD_OPTS '<' #define SET_OPT_SAVE_OPTS(a) STMTS( \ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \ DESC(SAVE_OPTS).fOptState |= OPTST_SET; \ DESC(SAVE_OPTS).optArg.argString = (char const*)(a) ) /* * Interface defines not associated with particular options */ #define ERRSKIP_OPTERR STMTS(ntpsnmpdOptions.fOptSet &= ~OPTPROC_ERRSTOP) #define ERRSTOP_OPTERR STMTS(ntpsnmpdOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_OPT(n) STMTS( \ ntpsnmpdOptions.curOptIdx = (n); \ ntpsnmpdOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) #define USAGE(c) (*ntpsnmpdOptions.pUsageProc)(&ntpsnmpdOptions, c) /* extracted from opthead.tlib near line 451 */ #ifdef __cplusplus extern "C" { #endif /* * * * * * * * Declare the ntpsnmpd option descriptor. */ extern tOptions ntpsnmpdOptions; #if defined(ENABLE_NLS) # ifndef _ # include static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); } # define _(s) aoGetsText(s) # endif /* _() */ # define OPT_NO_XLAT_CFG_NAMES STMTS(ntpsnmpdOptions.fOptSet |= \ OPTPROC_NXLAT_OPT_CFG;) # define OPT_NO_XLAT_OPT_NAMES STMTS(ntpsnmpdOptions.fOptSet |= \ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) # define OPT_XLAT_CFG_NAMES STMTS(ntpsnmpdOptions.fOptSet &= \ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) # define OPT_XLAT_OPT_NAMES STMTS(ntpsnmpdOptions.fOptSet &= \ ~OPTPROC_NXLAT_OPT;) #else /* ENABLE_NLS */ # define OPT_NO_XLAT_CFG_NAMES # define OPT_NO_XLAT_OPT_NAMES # define OPT_XLAT_CFG_NAMES # define OPT_XLAT_OPT_NAMES # ifndef _ # define _(_s) _s # endif #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif #endif /* AUTOOPTS_NTPSNMPD_OPTS_H_GUARD */ /* ntpsnmpd-opts.h ends here */ ntp-4.2.6p5/ntpsnmpd/ntpsnmpd.10000644000175000017500000000515211675460617015421 0ustar peterpeter.TH NTPSNMPD 1 2011-12-24 "( 4.2.6p5)" "Programmer's Manual" .\" EDIT THIS FILE WITH CAUTION (ntpsnmpd.1) .\" .\" It has been AutoGen-ed December 24, 2011 at 06:34:39 PM by AutoGen 5.12 .\" From the definitions ntpsnmpd-opts.def .\" and the template file agman1.tpl .\" .SH NAME ntpsnmpd \- NTP SNMP MIB agent .SH SYNOPSIS .B ntpsnmpd .\" Mixture of short (flag) options and long options .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..." .PP All arguments must be options. .SH "DESCRIPTION" This manual page briefly documents the \fBntpsnmpd\fP command. Its description is not documented. .SH OPTIONS .TP .BR \-n ", " \--nofork Do not fork. .sp .TP .BR \-p ", " \--syslog Log to syslog(). .sp .TP .BR \--agentxsocket "=\fIstring\fP" The socket address ntpsnmpd uses to connect to net-snmpd. The default \fIstring\fP for this option is: .ti +4 unix:/var/agentx/master .sp [:] The default is the Unix Domain socket "unix:/var/agentx/master". Another common alternative is tcp:localhost:705. .TP .BR \-? , " \--help" Display extended usage information and exit. .TP .BR \-! , " \--more-help" Extended usage information passed thru pager. .TP .BR \-> " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]" Save the option state to \fIrcfile\fP. The default is the \fIlast\fP configuration file listed in the \fBOPTION PRESETS\fP section, below. .TP .BR \-< " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts" Load options from \fIrcfile\fP. The \fIno-load-opts\fP form will disable the loading of earlier RC/INI files. \fI--no-load-opts\fP is handled early, out of order. .TP .BR \- " [{\fIv|c|n\fP}]," " \--version" "[=\fI{v|c|n}\fP]" 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. .SH OPTION PRESETS Any option that is not marked as \fInot presettable\fP may be preset by loading values from configuration ("RC" or ".INI") file(s) and values from environment variables named: .nf \fBNTPSNMPD_\fP or \fBNTPSNMPD\fP .fi .ad The environmental presets take precedence (are processed later than) the configuration files. The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". If any of these are directories, then the file \fI.ntprc\fP is searched for within those directories. .SH AUTHOR David L. Mills and/or others .br Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org .PP .nf .na see html/copyright.html .fi .ad .PP This manual page was \fIAutoGen\fP-erated from the \fBntpsnmpd\fP option definitions. ntp-4.2.6p5/ntpsnmpd/netsnmp_daemonize.c0000644000175000017500000001467611315077754017367 0ustar peterpeter/* * system.c */ /* Portions of this file are subject to the following copyright(s). See * the Net-SNMP's COPYING file for more details and other copyrights * that may apply: */ /*********************************************************** Copyright 1992 by Carnegie Mellon University All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of CMU not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ /* * Portions of this file are copyrighted by: * Copyright © 2003 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms specified in the COPYING file * distributed with the Net-SNMP package. */ /* * System dependent routines go here */ #include #undef PACKAGE_BUGREPORT #undef PACKAGE_NAME #undef PACKAGE_STRING #undef PACKAGE_TARNAME #undef PACKAGE_VERSION #include #ifdef NEED_NETSNMP_DAEMONIZE #include #include #include #if HAVE_UNISTD_H #include #endif #if HAVE_STDLIB_H #include #endif #if TIME_WITH_SYS_TIME # ifdef WIN32 # include # else # include # endif # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #include #if HAVE_NETINET_IN_H #include #endif #if HAVE_WINSOCK_H #include #endif #if HAVE_SYS_SOCKET_H #include #endif #if HAVE_NET_IF_H #include #endif #if HAVE_SYS_SOCKIO_H #include #endif #if HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_NLIST_H #include #endif #if HAVE_SYS_FILE_H #include #endif #if HAVE_KSTAT_H #include #endif #if HAVE_SYS_PARAM_H #include #endif #if HAVE_SYS_SYSCTL_H #include #endif #if HAVE_STRING_H #include #else #include #endif #if HAVE_DMALLOC_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if defined(hpux10) || defined(hpux11) #include #endif #if HAVE_SYS_UTSNAME_H #include #endif #if HAVE_SYS_SYSTEMCFG_H #include #endif #if HAVE_SYS_SYSTEMINFO_H #include #endif #include #include #include #include /* for "internal" definitions */ #include #include /* for get_temp_file_pattern() */ #ifndef IFF_LOOPBACK # define IFF_LOOPBACK 0 #endif #ifdef INADDR_LOOPBACK # define LOOPBACK INADDR_LOOPBACK #else # define LOOPBACK 0x7f000001 #endif /** * fork current process into the background. * * This function forks a process into the background, in order to * become a daemon process. It does a few things along the way: * * - becoming a process/session group leader, and forking a second time so * that process/session group leader can exit. * * - changing the working directory to / * * - closing stdin, stdout and stderr (unless stderr_log is set) and * redirecting them to /dev/null * * @param quit_immediately : indicates if the parent process should * exit after a successful fork. * @param stderr_log : indicates if stderr is being used for * logging and shouldn't be closed * @returns -1 : fork error * 0 : child process returning * >0 : parent process returning. returned value is the child PID. */ int netsnmp_daemonize(int quit_immediately, int stderr_log) { int i = 0; DEBUGMSGT(("daemonize","deamonizing...\n")); #if HAVE_WORKING_FORK /* * Fork to return control to the invoking process and to * guarantee that we aren't a process group leader. */ i = fork(); if (i != 0) { /* Parent. */ DEBUGMSGT(("daemonize","first fork returned %d.\n", i)); if(i == -1) { snmp_log(LOG_ERR,"first fork failed (errno %d) in " "netsnmp_daemonize()\n", errno); return -1; } if (quit_immediately) { DEBUGMSGT(("daemonize","parent exiting\n")); exit(0); } } else { /* Child. */ #ifdef HAVE_SETSID /* Become a process/session group leader. */ setsid(); #endif /* * Fork to let the process/session group leader exit. */ if ((i = fork()) != 0) { DEBUGMSGT(("daemonize","second fork returned %d.\n", i)); if(i == -1) { snmp_log(LOG_ERR,"second fork failed (errno %d) in " "netsnmp_daemonize()\n", errno); } /* Parent. */ exit(0); } #ifndef WIN32 else { /* Child. */ DEBUGMSGT(("daemonize","child continuing\n")); /* Avoid keeping any directory in use. */ chdir("/"); if (!stderr_log) { /* * Close inherited file descriptors to avoid * keeping unnecessary references. */ close(0); close(1); close(2); /* * Redirect std{in,out,err} to /dev/null, just in * case. */ open("/dev/null", O_RDWR); dup(0); dup(0); } } #endif /* !WIN32 */ } #endif /* HAVE_WORKING_FORK */ return i; } #else /* !NEED_NETSNMP_DAEMONIZE */ int netsnp_daemonize_bs; #endif ntp-4.2.6p5/ntpsnmpd/ntpsnmpd-opts.menu0000644000175000017500000000006511675460617017206 0ustar peterpeter* ntpsnmpd Invocation:: Invoking ntpsnmpd ntp-4.2.6p5/ntpsnmpd/ntpv4-mib.mib0000644000175000017500000007271011455531713016001 0ustar peterpeter-- ********************************************************************* -- -- The Network Time Protocol Version 4 -- Management Information Base (MIB) -- -- Authors: Heiko Gerstung (heiko.gerstung@meinberg.de) -- Chris Elliott (chelliot@pobox.com) -- -- for the Internet Engineering Task Force (IETF) -- NTP Working Group (ntpwg) -- -- -- ********************************************************************* -- Rev 1.00 -- Published as RFC 5907 -- -- ********************************************************************* NTPv4-MIB DEFINITIONS ::= BEGIN IMPORTS MODULE-IDENTITY, OBJECT-TYPE , mib-2, Integer32, NOTIFICATION-TYPE, Unsigned32, Counter32, TimeTicks FROM SNMPv2-SMI -- RFC 2578 MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP FROM SNMPv2-CONF -- RFC 2580 DisplayString, TEXTUAL-CONVENTION FROM SNMPv2-TC -- RFC 2579 InetAddressType, InetAddress FROM INET-ADDRESS-MIB -- RFC 4001 Utf8String FROM SYSAPPL-MIB; -- RFC 2287 ntpSnmpMIB MODULE-IDENTITY LAST-UPDATED "201005170000Z" -- May 17, 2010 ORGANIZATION "The IETF NTP Working Group (ntpwg)" CONTACT-INFO " WG Email: ntpwg@lists.ntp.isc.org Subscribe: https://lists.ntp.isc.org/mailman/listinfo/ntpwg Heiko Gerstung Meinberg Funkuhren Gmbh & Co. KG Lange Wand 9 Bad Pyrmont 31812 Germany Phone: +49 5281 9309 25 Email: heiko.gerstung@meinberg.de Chris Elliott 1516 Kent St. Durham, NC 27707 USA Phone: +1-919-308-1216 Email: chelliot@pobox.com Brian Haberman 11100 Johns Hopkins Road Laurel, MD 20723 USA Phone: +1-443-778-1319 Email: brian@innovationslab.net" DESCRIPTION "The Management Information Base for NTP time entities. Copyright (c) 2010 IETF Trust and the persons identified as authors of the code. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info)." REVISION "201005170000Z" DESCRIPTION "This revision of the MIB module is published as RFC 5907." ::= { mib-2 197 } ntpSnmpMIBObjects OBJECT IDENTIFIER ::= { ntpSnmpMIB 1 } -- MIB contains 6 groups ntpEntInfo OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 1 } ntpEntStatus OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 2 } ntpAssociation OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 3 } ntpEntControl OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 4 } ntpEntNotifObjects OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 5 } -- -- Textual Conventions -- NtpStratum ::= TEXTUAL-CONVENTION DISPLAY-HINT "d" STATUS current DESCRIPTION "The NTP stratum, with 16 representing no stratum." SYNTAX Unsigned32 (1..16) NtpDateTime ::= TEXTUAL-CONVENTION DISPLAY-HINT "4d:4d:4d.4d" STATUS current DESCRIPTION "NTP date/time on the device, in 128-bit NTP date format. If time is not syncronized, this field shall be a zero-length string. This trusted certificate (TC) is not to be used for objects that are used to set the time of the node querying this object. NTP should be used for this -- or at least SNTP." REFERENCE "RFC 5905, section 6" SYNTAX OCTET STRING (SIZE (0 | 16)) -- -- Section 1: General NTP Entity information objects -- (relatively static information) -- ntpEntSoftwareName OBJECT-TYPE SYNTAX Utf8String MAX-ACCESS read-only STATUS current DESCRIPTION "The product name of the running NTP version, e.g., 'ntpd'." ::= { ntpEntInfo 1 } ntpEntSoftwareVersion OBJECT-TYPE SYNTAX Utf8String MAX-ACCESS read-only STATUS current DESCRIPTION "The software version of the installed NTP implementation as a full version string, e.g., 'ntpd-4.2.0b@1.1433 ...'" ::= { ntpEntInfo 2 } ntpEntSoftwareVendor OBJECT-TYPE SYNTAX Utf8String MAX-ACCESS read-only STATUS current DESCRIPTION "The vendor/author of the installed NTP version." ::= { ntpEntInfo 3 } ntpEntSystemType OBJECT-TYPE SYNTAX Utf8String MAX-ACCESS read-only STATUS current DESCRIPTION "General hardware/os platform information, e.g., 'Linux 2.6.12 / x86'." -- freely configurable, default is OS Version / Hardware platform ::= { ntpEntInfo 4 } ntpEntTimeResolution OBJECT-TYPE SYNTAX Unsigned32 MAX-ACCESS read-only STATUS current DESCRIPTION "The time resolution in integer format, where the resolution is represented as divisions of a second, e.g., a value of 1000 translates to 1.0 ms." ::= { ntpEntInfo 5 } ntpEntTimePrecision OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-only STATUS current DESCRIPTION "The entity's precision in integer format, shows the precision. A value of -5 would mean 2^-5 = 31.25 ms." ::= { ntpEntInfo 6 } ntpEntTimeDistance OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "The distance from this NTP entity to the root time reference (stratum 0) source including the unit, e.g., '13.243 ms'." ::= { ntpEntInfo 7 } -- -- Section 2: Current NTP status (dynamic information) -- ntpEntStatusCurrentMode OBJECT-TYPE SYNTAX INTEGER { notRunning(1), notSynchronized(2), noneConfigured(3), syncToLocal(4), syncToRefclock(5), syncToRemoteServer(6), unknown(99) } MAX-ACCESS read-only STATUS current DESCRIPTION "The current mode of the NTP. The definition of each possible value is: notRunning(1) - NTP is not running. notSynchronized(2) - NTP is not synchronized to any time source (stratum = 16). noneConfigured(3) - NTP is not synchronized and does not have a reference configured (stratum = 16). syncToLocal(4) - NTP is distributing time based on its local clock (degraded accuracy and/or reliability). syncToRefclock(5) - NTP is synchronized to a local hardware refclock (e.g., GPS). syncToRemoteServer(6) - NTP is synchronized to a remote NTP server ('upstream' server). unknown(99) - The state of NTP is unknown." ::= { ntpEntStatus 1 } ntpEntStatusStratum OBJECT-TYPE SYNTAX NtpStratum MAX-ACCESS read-only STATUS current DESCRIPTION "The NTP entity's own stratum value. Should be a stratum of syspeer + 1 (or 16 if no syspeer)." ::= { ntpEntStatus 2 } ntpEntStatusActiveRefSourceId OBJECT-TYPE SYNTAX Unsigned32 ( 0..99999 ) MAX-ACCESS read-only STATUS current DESCRIPTION "The association ID of the current syspeer." ::= { ntpEntStatus 3 } ntpEntStatusActiveRefSourceName OBJECT-TYPE SYNTAX Utf8String MAX-ACCESS read-only STATUS current DESCRIPTION "The hostname/descriptive name of the current reference source selected as syspeer, e.g., 'ntp1.ptb.de' or 'GPS' or 'DCFi', ..." ::= { ntpEntStatus 4 } ntpEntStatusActiveOffset OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "The time offset to the current selected reference time source as a string including unit, e.g., '0.032 ms' or '1.232 s'." ::= { ntpEntStatus 5 } ntpEntStatusNumberOfRefSources OBJECT-TYPE SYNTAX Unsigned32 (0..99) MAX-ACCESS read-only STATUS current DESCRIPTION "The number of reference sources configured for NTP." ::= { ntpEntStatus 6 } ntpEntStatusDispersion OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "The root dispersion of the running NTP entity, e.g., '6.927'." ::= { ntpEntStatus 7 } ntpEntStatusEntityUptime OBJECT-TYPE SYNTAX TimeTicks MAX-ACCESS read-only STATUS current DESCRIPTION "The uptime of the NTP entity, (i.e., the time since ntpd was (re-)initialized not sysUptime!). The time is represented in hundreds of seconds since Jan 1, 1970 (00:00:00.000) UTC." ::= { ntpEntStatus 8 } ntpEntStatusDateTime OBJECT-TYPE SYNTAX NtpDateTime MAX-ACCESS read-only STATUS current DESCRIPTION "The current NTP date/time on the device, in 128-bit NTP date format. If time is not syncronized, this field shall be a zero-length string. This object can be used to timestamp events on this node and allow a management station to correlate different time objects. For example, a management station could query this object and sysUpTime in the same operation to be able to relate sysUpTime to NTP time. This object is not to be used to set the time of the node querying this object. NTP should be used for this -- or at least SNTP." REFERENCE "RFC 5905, section 6" ::= { ntpEntStatus 9 } ntpEntStatusLeapSecond OBJECT-TYPE SYNTAX NtpDateTime MAX-ACCESS read-only STATUS current DESCRIPTION "Date the next known leap second will occur. If there is no leap second announced, then this object should be 0." ::= { ntpEntStatus 10 } ntpEntStatusLeapSecDirection OBJECT-TYPE SYNTAX Integer32 (-1..1) MAX-ACCESS read-only STATUS current DESCRIPTION "Direction of next known leap second. If there is no leap second announced, then this object should be 0." ::= { ntpEntStatus 11 } ntpEntStatusInPkts OBJECT-TYPE SYNTAX Counter32 UNITS "packets" MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of NTP messages delivered to the NTP entity from the transport service. Discountinuities in the value of this counter can occur upon cold start or reinitialization of the NTP entity, the management system and at other times as indicated by discontinuities in the value of sysUpTime." ::= { ntpEntStatus 12 } ntpEntStatusOutPkts OBJECT-TYPE SYNTAX Counter32 UNITS "packets" MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of NTP messages delivered to the transport service by this NTP entity. Discountinuities in the value of this counter can occur upon cold start or reinitialization of the NTP entity, the management system and at other times as indicated by discontinuities in the value of sysUpTime." ::= { ntpEntStatus 13 } ntpEntStatusBadVersion OBJECT-TYPE SYNTAX Counter32 UNITS "packets" MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of NTP messages that were delivered to this NTP entity and were for an unsupported NTP version. Discountinuities in the value of this counter can occur upon cold start or reinitialization of the NTP entity, the management system and at other times as indicated by discontinuities in the value of sysUpTime." ::= { ntpEntStatus 14 } ntpEntStatusProtocolError OBJECT-TYPE SYNTAX Counter32 UNITS "packets" MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of NTP messages that were delivered to this NTP entity and this entity was not able to process due to an NTP protocol error. Discountinuities in the value of this counter can occur upon cold start or reinitialization of the NTP entity, the management system and at other times as indicated by discontinuities in the value of sysUpTime." ::= { ntpEntStatus 15 } ntpEntStatusNotifications OBJECT-TYPE SYNTAX Counter32 UNITS "notifications" MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of SNMP notifications that this NTP entity has generated. Discountinuities in the value of this counter can occur upon cold start or reinitialization of the NTP entity, the management system and at other times as indicated by discontinuities in the value of sysUpTime." ::= { ntpEntStatus 16 } ntpEntStatPktModeTable OBJECT-TYPE SYNTAX SEQUENCE OF NtpEntStatPktModeEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The number of packets sent and received by packet mode. One entry per packet mode." ::= { ntpEntStatus 17 } ntpEntStatPktModeEntry OBJECT-TYPE SYNTAX NtpEntStatPktModeEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "A statistical record of the number of packets sent and received for each packet mode." INDEX { ntpEntStatPktMode } ::= { ntpEntStatPktModeTable 1 } NtpEntStatPktModeEntry ::= SEQUENCE { ntpEntStatPktMode INTEGER, ntpEntStatPktSent Counter32, ntpEntStatPktReceived Counter32 } ntpEntStatPktMode OBJECT-TYPE SYNTAX INTEGER { symetricactive(1), symetricpassive(2), client(3), server(4), broadcastserver(5), broadcastclient(6) } MAX-ACCESS not-accessible STATUS current DESCRIPTION "The NTP packet mode." ::= { ntpEntStatPktModeEntry 1 } ntpEntStatPktSent OBJECT-TYPE SYNTAX Counter32 UNITS "packets" MAX-ACCESS read-only STATUS current DESCRIPTION "The number of NTP packets sent with this packet mode. Discountinuities in the value of this counter can occur upon cold start or reinitialization of the NTP entity, the management system and at other times as indicated by discontinuities in the value of sysUpTime." ::= { ntpEntStatPktModeEntry 2 } ntpEntStatPktReceived OBJECT-TYPE SYNTAX Counter32 UNITS "packets" MAX-ACCESS read-only STATUS current DESCRIPTION "The number of NTP packets received with this packet mode. Discountinuities in the value of this counter can occur upon cold start or reinitialization of the NTP entity, the management system and at other times as indicated by discontinuities in the value of sysUpTime." ::= { ntpEntStatPktModeEntry 3 } -- -- Section 3: The status of all currently mobilized associations -- ntpAssociationTable OBJECT-TYPE SYNTAX SEQUENCE OF NtpAssociationEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The table of currently mobilized associations." ::= { ntpAssociation 1 } ntpAssociationEntry OBJECT-TYPE SYNTAX NtpAssociationEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The table entry of currently mobilized associations." INDEX { ntpAssocId } ::= { ntpAssociationTable 1 } NtpAssociationEntry ::= SEQUENCE { ntpAssocId Unsigned32, ntpAssocName Utf8String, ntpAssocRefId DisplayString, ntpAssocAddressType InetAddressType, ntpAssocAddress InetAddress, ntpAssocOffset DisplayString, ntpAssocStratum NtpStratum, ntpAssocStatusJitter DisplayString, ntpAssocStatusDelay DisplayString, ntpAssocStatusDispersion DisplayString } ntpAssocId OBJECT-TYPE SYNTAX Unsigned32 ( 1..99999 ) MAX-ACCESS not-accessible STATUS current DESCRIPTION "The association ID. This is an internal, unique ID." ::= { ntpAssociationEntry 1 } ntpAssocName OBJECT-TYPE SYNTAX Utf8String MAX-ACCESS read-only STATUS current DESCRIPTION "The hostname or other descriptive name for the association." ::= { ntpAssociationEntry 2 } ntpAssocRefId OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "The refclock driver ID, if available." -- a refclock driver ID like "127.127.1.0" for non -- uni/multi/broadcast associations ::= { ntpAssociationEntry 3 } ntpAssocAddressType OBJECT-TYPE SYNTAX InetAddressType { ipv4(1), ipv6(2), ipv4z(3), ipv6z(4) } MAX-ACCESS read-only STATUS current DESCRIPTION "The type of address of the association. Can be either IPv4 or IPv6 (both with or without zone index) and contains the type of address for unicast, multicast, and broadcast associations." ::= { ntpAssociationEntry 4 } ntpAssocAddress OBJECT-TYPE SYNTAX InetAddress (SIZE (4|8|16|20)) MAX-ACCESS read-only STATUS current DESCRIPTION "The IP address (IPv4 or IPv6, with or without zone index) of the association. The type and size depends on the ntpAssocAddressType object. Represents the IP address of a uni/multi/broadcast association." ::= { ntpAssociationEntry 5 } ntpAssocOffset OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "The time offset to the association as a string." -- including unit, e.g., "0.032 ms" or "1.232 s" ::= { ntpAssociationEntry 6 } ntpAssocStratum OBJECT-TYPE SYNTAX NtpStratum MAX-ACCESS read-only STATUS current DESCRIPTION "The association stratum value." ::= { ntpAssociationEntry 7 } ntpAssocStatusJitter OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "The jitter in milliseconds as a string." ::= { ntpAssociationEntry 8 } ntpAssocStatusDelay OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "The network delay in milliseconds as a string." ::= { ntpAssociationEntry 9 } ntpAssocStatusDispersion OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-only STATUS current DESCRIPTION "The root dispersion of the association." -- e.g., "6.927" ::= { ntpAssociationEntry 10 } ntpAssociationStatisticsTable OBJECT-TYPE SYNTAX SEQUENCE OF NtpAssociationStatisticsEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The table of statistics for current associations." ::= { ntpAssociation 2 } ntpAssociationStatisticsEntry OBJECT-TYPE SYNTAX NtpAssociationStatisticsEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The table entry of statistics for current associations." INDEX { ntpAssocId } ::= { ntpAssociationStatisticsTable 1 } NtpAssociationStatisticsEntry ::= SEQUENCE { ntpAssocStatInPkts Counter32, ntpAssocStatOutPkts Counter32, ntpAssocStatProtocolError Counter32 } ntpAssocStatInPkts OBJECT-TYPE SYNTAX Counter32 UNITS "packets" MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of NTP messages delivered to the NTP entity from this association. Discountinuities in the value of this counter can occur upon cold start or reinitialization of the NTP entity, the management system and at other times as indicated by discontinuities in the value of sysUpTime." ::= { ntpAssociationStatisticsEntry 1 } ntpAssocStatOutPkts OBJECT-TYPE SYNTAX Counter32 UNITS "packets" MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of NTP messages delivered to the transport service by this NTP entity for this association. Discountinuities in the value of this counter can occur upon cold start or reinitialization of the NTP entity, the management system and at other times as indicated by discontinuities in the value of sysUpTime." ::= { ntpAssociationStatisticsEntry 2 } ntpAssocStatProtocolError OBJECT-TYPE SYNTAX Counter32 UNITS "packets" MAX-ACCESS read-only STATUS current DESCRIPTION "The total number of NTP messages that were delivered to this NTP entity from this association and this entity was not able to process due to an NTP protocol error. Discountinuities in the value of this counter can occur upon cold start or reinitialization of the NTP entity, the management system and at other times as indicated by discontinuities in the value of sysUpTime." ::= { ntpAssociationStatisticsEntry 3 } -- -- Section 4: Control objects -- ntpEntHeartbeatInterval OBJECT-TYPE SYNTAX Unsigned32 UNITS "seconds" MAX-ACCESS read-write STATUS current DESCRIPTION "The interval at which the ntpEntNotifHeartbeat notification should be sent, in seconds. If set to 0 and the entNotifHeartbeat bit in ntpEntNotifBits is 1, then ntpEntNotifHeartbeat is sent once. This value is stored persistently and will be restored to its last set value upon cold start or restart." DEFVAL { 60 } ::= { ntpEntControl 1 } ntpEntNotifBits OBJECT-TYPE SYNTAX BITS { notUsed(0), -- Used to sync up bit and notification -- indices entNotifModeChange(1), entNotifStratumChange(2), entNotifSyspeerChanged(3), entNotifAddAssociation(4), entNotifRemoveAssociation(5), entNotifConfigChanged(6), entNotifLeapSecondAnnounced(7), entNotifHeartbeat(8) } MAX-ACCESS read-write STATUS current DESCRIPTION "A bit for each notification. A 1 for a particular bit enables that particular notification, a 0 disables it. This value is stored persistently and will be restored to its last set value upon cold start or restart." ::= { ntpEntControl 2 } -- -- Section 5: Notification objects -- ntpEntNotifMessage OBJECT-TYPE SYNTAX Utf8String MAX-ACCESS accessible-for-notify STATUS current DESCRIPTION "Used as a payload object for all notifications. Holds a cleartext event message." DEFVAL { "no event" } ::= { ntpEntNotifObjects 1 } -- -- SNMP notification definitions -- ntpEntNotifications OBJECT IDENTIFIER ::= { ntpSnmpMIB 0 } ntpEntNotifModeChange NOTIFICATION-TYPE OBJECTS { ntpEntStatusCurrentMode } STATUS current DESCRIPTION "The notification to be sent when the NTP entity changes mode, including starting and stopping (if possible)." ::= { ntpEntNotifications 1 } ntpEntNotifStratumChange NOTIFICATION-TYPE OBJECTS { ntpEntStatusDateTime, ntpEntStatusStratum, ntpEntNotifMessage } STATUS current DESCRIPTION "The notification to be sent when stratum level of NTP changes." ::= { ntpEntNotifications 2 } ntpEntNotifSyspeerChanged NOTIFICATION-TYPE OBJECTS { ntpEntStatusDateTime, ntpEntStatusActiveRefSourceId, ntpEntNotifMessage } STATUS current DESCRIPTION "The notification to be sent when a (new) syspeer has been selected." ::= { ntpEntNotifications 3 } ntpEntNotifAddAssociation NOTIFICATION-TYPE OBJECTS { ntpEntStatusDateTime, ntpAssocName, ntpEntNotifMessage } STATUS current DESCRIPTION "The notification to be sent when a new association is mobilized." ::= { ntpEntNotifications 4 } ntpEntNotifRemoveAssociation NOTIFICATION-TYPE OBJECTS { ntpEntStatusDateTime, ntpAssocName, ntpEntNotifMessage } STATUS current DESCRIPTION "The notification to be sent when an association is demobilized." ::= { ntpEntNotifications 5 } ntpEntNotifConfigChanged NOTIFICATION-TYPE OBJECTS { ntpEntStatusDateTime, ntpEntNotifMessage } STATUS current DESCRIPTION "The notification to be sent when the NTP configuration has changed, e.g., when the system connected to the Internet and was assigned a new IP address by the ISPs DHCP server." ::= { ntpEntNotifications 6 } ntpEntNotifLeapSecondAnnounced NOTIFICATION-TYPE OBJECTS { ntpEntStatusDateTime, ntpEntNotifMessage } STATUS current DESCRIPTION "The notification to be sent when a leap second has been announced." ::= { ntpEntNotifications 7 } ntpEntNotifHeartbeat NOTIFICATION-TYPE OBJECTS { ntpEntStatusDateTime, ntpEntStatusCurrentMode, ntpEntHeartbeatInterval, ntpEntNotifMessage } STATUS current DESCRIPTION "The notification to be sent periodically (as defined by ntpEntHeartbeatInterval) to indicate that the NTP entity is still alive." ::= { ntpEntNotifications 8 } -- -- Conformance/Compliance statements -- ntpEntConformance OBJECT IDENTIFIER ::= { ntpSnmpMIB 2 } ntpEntCompliances OBJECT IDENTIFIER ::= { ntpEntConformance 1 } ntpEntGroups OBJECT IDENTIFIER ::= { ntpEntConformance 2 } ntpEntNTPCompliance MODULE-COMPLIANCE STATUS current DESCRIPTION "The compliance statement for SNMP entities that use NTP and implement the NTP MIB." MODULE -- this module MANDATORY-GROUPS { ntpEntObjectsGroup1 } ::= { ntpEntCompliances 1 } ntpEntSNTPCompliance MODULE-COMPLIANCE STATUS current DESCRIPTION "The compliance statement for SNMP entities that use SNTP and implement the NTP MIB." MODULE -- this module MANDATORY-GROUPS { ntpEntObjectsGroup1 } GROUP ntpEntObjectsGroup2 DESCRIPTION "Optional object group." GROUP ntpEntNotifGroup DESCRIPTION "Optional notifications for this MIB." ::= { ntpEntCompliances 2 } ntpEntObjectsGroup1 OBJECT-GROUP OBJECTS { ntpEntSoftwareName, ntpEntSoftwareVersion, ntpEntSoftwareVendor, ntpEntSystemType, ntpEntStatusEntityUptime, ntpEntStatusDateTime, ntpAssocName, ntpAssocRefId, ntpAssocAddressType, ntpAssocAddress } STATUS current DESCRIPTION "A collection of objects for the NTP MIB." ::= { ntpEntGroups 1 } ntpEntObjectsGroup2 OBJECT-GROUP OBJECTS { ntpEntTimeResolution, ntpEntTimePrecision, ntpEntTimeDistance, ntpEntStatusCurrentMode, ntpEntStatusStratum, ntpEntStatusActiveRefSourceId, ntpEntStatusActiveRefSourceName, ntpEntStatusActiveOffset, ntpEntStatusNumberOfRefSources, ntpEntStatusDispersion, ntpEntStatusLeapSecond, ntpEntStatusLeapSecDirection, ntpEntStatusInPkts, ntpEntStatusOutPkts, ntpEntStatusBadVersion, ntpEntStatusProtocolError, ntpEntStatusNotifications, ntpEntStatPktSent, ntpEntStatPktReceived, ntpAssocOffset, ntpAssocStratum, ntpAssocStatusJitter, ntpAssocStatusDelay, ntpAssocStatusDispersion, ntpAssocStatInPkts, ntpAssocStatOutPkts, ntpAssocStatProtocolError, ntpEntHeartbeatInterval, ntpEntNotifBits, ntpEntNotifMessage } STATUS current DESCRIPTION "A collection of objects for the NTP MIB." ::= { ntpEntGroups 2 } ntpEntNotifGroup NOTIFICATION-GROUP NOTIFICATIONS { ntpEntNotifModeChange, ntpEntNotifStratumChange, ntpEntNotifSyspeerChanged, ntpEntNotifAddAssociation, ntpEntNotifRemoveAssociation, ntpEntNotifConfigChanged, ntpEntNotifLeapSecondAnnounced, ntpEntNotifHeartbeat } STATUS current DESCRIPTION "A collection of notifications for the NTP MIB" ::= { ntpEntGroups 3 } END ntp-4.2.6p5/ntpsnmpd/ntpsnmpd-opts.texi0000644000175000017500000000524011675460617017213 0ustar peterpeter@node ntpsnmpd Invocation @section Invoking ntpsnmpd @pindex ntpsnmpd @cindex NTP SNMP MIB agent @ignore # # EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.texi) # # It has been AutoGen-ed December 24, 2011 at 06:34:39 PM by AutoGen 5.12 # From the definitions ntpsnmpd-opts.def # and the template file aginfo.tpl @end ignore This program has no explanation. This section was generated by @strong{AutoGen}, the aginfo template and the option descriptions for the @command{ntpsnmpd} program. It documents the @command{ntpsnmpd} usage text and option meanings. This software is released under a specialized copyright license. @menu * ntpsnmpd usage:: ntpsnmpd usage help (-?) * ntpsnmpd agentxsocket:: agentxsocket option * ntpsnmpd nofork:: nofork option (-n) * ntpsnmpd syslog:: syslog option (-p) @end menu @node ntpsnmpd usage @subsection ntpsnmpd usage help (-?) @cindex ntpsnmpd usage This is the automatically generated usage text for ntpsnmpd: @exampleindent 0 @example ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.6p5 USAGE: ntpsnmpd [ - [] | --[@{=| @}] ]... Flg Arg Option-Name Description -n no nofork Do not fork -p no syslog Log to syslog() Str agentxsocket The socket address ntpsnmpd uses to connect to net-snmpd opt version Output version information and exit -? no help Display extended usage information and exit -! no more-help Extended usage information passed thru pager -> opt save-opts Save the option state to a config file -< Str load-opts Load options from a config file - disabled as --no-load-opts - may appear multiple times Options are specified by doubled hyphens and their name or by a single hyphen and the flag character. The following option preset mechanisms are supported: - reading file $HOME/.ntprc - reading file ./.ntprc - examining environment variables named NTPSNMPD_* please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org @end example @exampleindent 4 @node ntpsnmpd agentxsocket @subsection agentxsocket option @cindex ntpsnmpd-agentxsocket This is the ``the socket address ntpsnmpd uses to connect to net-snmpd'' option. [:] The default is the Unix Domain socket "unix:/var/agentx/master". Another common alternative is tcp:localhost:705. @node ntpsnmpd nofork @subsection nofork option (-n) @cindex ntpsnmpd-nofork This is the ``do not fork'' option. @node ntpsnmpd syslog @subsection syslog option (-p) @cindex ntpsnmpd-syslog This is the ``log to syslog()'' option. ntp-4.2.6p5/ntpsnmpd/Makefile.in0000644000175000017500000006751611675460301015543 0ustar peterpeter# 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@ # we traditionally installed software in bindir, while it should have gone # in sbindir. Now that we offer a choice, look in the "other" installation # subdir to warn folks if there is another version there. 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@ EXTRA_PROGRAMS = ntpsnmpd$(EXEEXT) DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf subdir = ntpsnmpd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/define_dir.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_cacheversion.m4 \ $(top_srcdir)/m4/ntp_dir_sep.m4 \ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \ $(top_srcdir)/m4/ntp_openssl.m4 \ $(top_srcdir)/m4/ntp_vpathhack.m4 \ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) am_ntpsnmpd_OBJECTS = netsnmp_daemonize.$(OBJEXT) ntpsnmpd.$(OBJEXT) \ ntpSnmpSubagentObject.$(OBJEXT) ntpsnmpd-opts.$(OBJEXT) ntpsnmpd_OBJECTS = $(am_ntpsnmpd_OBJECTS) ntpsnmpd_LDADD = $(LDADD) am__DEPENDENCIES_1 = ntpsnmpd_DEPENDENCIES = ../ntpq/libntpq.a ../libntp/libntp.a \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(ntpsnmpd_SOURCES) DIST_SOURCES = $(ntpsnmpd_SOURCES) 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' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DATA = $(noinst_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ 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@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SH = @PATH_SH@ PATH_TEST = @PATH_TEST@ POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CFLAGS = @SNMP_CFLAGS@ SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ SNMP_LIBS = @SNMP_LIBS@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ VERSION = @VERSION@ 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_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 = AUTOMAKE_OPTIONS = @NTP_BINSUBDIR_IS_BIN_TRUE@bin_PROGRAMS = @MAKE_NTPSNMPD@ @NTP_BINSUBDIR_IS_BIN_FALSE@sbin_PROGRAMS = @MAKE_NTPSNMPD@ ntpsnmpd_SOURCES = netsnmp_daemonize.c ntpsnmpd.c ntpSnmpSubagentObject.c \ ntpsnmpd-opts.c ntpsnmpd-opts.h ntpSnmpSubagentObject.h \ ntp_snmp.h # HMS: we probably want a version.o file here, too. LDADD = ../ntpq/libntpq.a ../libntp/libntp.a @LCRYPTO@ @SNMP_LIBS@ \ $(LIBOPTS_LDADD) AM_CPPFLAGS = -I$(top_srcdir)/ntpq -I$(top_srcdir)/include \ -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include \ $(LIBOPTS_CFLAGS) @SNMP_CPPFLAGS@ AM_CFLAGS = @SNMP_CFLAGS@ EXTRA_DIST = ntpsnmpd-opts.def ntpsnmpd.1 ntpsnmpd-opts.texi \ ntpsnmpd-opts.menu ntpv4-mib.mib BUILT_SOURCES = ntpsnmpd-opts.c ntpsnmpd-opts.h .deps-ver CLEANFILES = .deps-ver noinst_DATA = $(srcdir)/ntpsnmpd-opts.texi $(srcdir)/ntpsnmpd-opts.menu man_MANS = $(srcdir)/ntpsnmpd.1 run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \ autogen -L ../include --writable std_def_list = $(top_srcdir)/include/autogen-version.def \ $(top_srcdir)/include/copyright.def \ $(top_srcdir)/include/homerc.def \ $(top_srcdir)/include/version.def all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf $(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 ntpsnmpd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign ntpsnmpd/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-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ntpsnmpd$(EXEEXT): $(ntpsnmpd_OBJECTS) $(ntpsnmpd_DEPENDENCIES) @rm -f ntpsnmpd$(EXEEXT) $(LINK) $(ntpsnmpd_OBJECTS) $(ntpsnmpd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netsnmp_daemonize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpSnmpSubagentObject.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpsnmpd-opts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpsnmpd.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; 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=''; 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; } ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man \ uninstall-sbinPROGRAMS uninstall-man: uninstall-man1 .MAKE: all check install install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 uninstall-sbinPROGRAMS $(srcdir)/ntpsnmpd-opts.h: $(srcdir)/ntpsnmpd-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntpsnmpd-opts.c: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) $(run_ag) ntpsnmpd-opts.def $(srcdir)/ntpsnmpd.1: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) $(run_ag) -Tagman1.tpl -bntpsnmpd ntpsnmpd-opts.def $(srcdir)/ntpsnmpd-opts.menu: $(srcdir)/ntpsnmpd-opts.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/ntpsnmpd-opts.texi: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) $(run_ag) -Taginfo.tpl -DLEVEL=section ntpsnmpd-opts.def $(top_srcdir)/scripts/check--help $@ install-exec-hook: @case ${BINSUBDIR} in \ bin) ODIR=${sbindir} ;; \ sbin) ODIR=${bindir} ;; \ esac; \ test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \ test ! -f $$ODIR/$$i || echo "*** $$i is also in $$ODIR!"; \ done # $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ chmod ug+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ $(MAKE) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ mkdir $(DEPDIR) && \ case "$(top_builddir)" in \ .) \ ./config.status Makefile depfiles \ ;; \ ..) \ cd .. && \ ./config.status $(subdir)/Makefile depfiles && \ cd $(subdir) \ ;; \ *) \ echo 'Fatal: depsver.mf Automake fragment limited' \ 'to immediate subdirectories.' && \ echo "top_builddir: $(top_builddir)" && \ echo "subdir: $(subdir)" && \ exit 1 \ ;; \ esac && \ echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver @touch $@ # # depsver.mf included in Makefile.am for directories with .deps # # When building in the same directory with sources that change over # time, such as when tracking using bk, the .deps files can become # stale with respect to moved, deleted, or superceded headers. Most # commonly, this would exhibit as make reporting a failure to make a # header file which is no longer in the location given. To address # this issue, we use a deps-ver file which is updated with each change # that breaks old .deps files. A copy of deps-ver is made into # $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present # with different contents than deps-ver, we make clean to ensure all # .o files built before the incompatible change are rebuilt along with # their updated .deps files, then remove $(DEPDIR) and recreate it as # empty stubs. # # It is normal when configured with --disable-dependency-tracking for # the DEPDIR to not have been created. For this reason, we use the # intermediate target .deps-ver, which invokes make recursively if # DEPDIR exists. # # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # # This comment block follows rather than leads the related code so that # it stays with it in the generated Makefile.in and Makefile. # # 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: ntp-4.2.6p5/ntpsnmpd/ntp_snmp.h0000644000175000017500000000163511455531713015475 0ustar peterpeter/* * ntp_snmp.h -- common net-snmp header includes and workaround * for Autoconf-related PACKAGE_* redefinitions between * net-snmp and NTP. * * Currently ntpsnmpd *.c files are exceptions to the rule that every .c * file should include before any other headers. It would be * ideal to rearrange its includes so that our config.h is first, but * that is complicated by the redefinitions between our config.h and * net-snmp/net-snmp-config.h. */ #include #include #include #ifdef PACKAGE_BUGREPORT # undef PACKAGE_BUGREPORT #endif #ifdef PACKAGE_NAME # undef PACKAGE_NAME #endif #ifdef PACKAGE_STRING # undef PACKAGE_STRING #endif #ifdef PACKAGE_TARNAME # undef PACKAGE_TARNAME #endif #ifdef PACKAGE_VERSION # undef PACKAGE_VERSION #endif #include #include ntp-4.2.6p5/ntpsnmpd/ntpsnmpd-opts.c0000644000175000017500000003435511675460614016472 0ustar peterpeter/* * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.c) * * It has been AutoGen-ed December 24, 2011 at 06:34:36 PM by AutoGen 5.12 * From the definitions ntpsnmpd-opts.def * and the template file options * * Generated from AutoOpts 35:0:10 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the ntpsnmpd author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * This source file is copyrighted and licensed under the following terms: * * see html/copyright.html * */ #include #include #include #include #define OPTION_CODE_COMPILE 1 #include "ntpsnmpd-opts.h" #ifdef __cplusplus extern "C" { #endif extern FILE * option_usage_fp; /* TRANSLATORS: choose the translation for option names wisely because you cannot ever change your mind. */ static char const zCopyright[42] = "ntpsnmpd 4.2.6p5\n\ see html/copyright.html\n"; static char const zLicenseDescrip[25] = "see html/copyright.html\n"; extern tUsageProc optionUsage; #ifndef NULL # define NULL 0 #endif /* * Nofork option description: */ static char const zNoforkText[] = "Do not fork"; static char const zNofork_NAME[] = "NOFORK"; static char const zNofork_Name[] = "nofork"; #define NOFORK_FLAGS (OPTST_DISABLED) /* * Syslog option description: */ static char const zSyslogText[] = "Log to syslog()"; static char const zSyslog_NAME[] = "SYSLOG"; static char const zSyslog_Name[] = "syslog"; #define SYSLOG_FLAGS (OPTST_DISABLED) /* * Agentxsocket option description: */ static char const zAgentxsocketText[] = "The socket address ntpsnmpd uses to connect to net-snmpd"; static char const zAgentxsocket_NAME[] = "AGENTXSOCKET"; static char const zAgentxsocket_Name[] = "agentxsocket"; static char const zAgentxsocketDefaultArg[] = "unix:/var/agentx/master"; #define AGENTXSOCKET_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Help/More_Help/Version option descriptions: */ static char const zHelpText[] = "Display extended usage information and exit"; static char const zHelp_Name[] = "help"; #ifdef HAVE_WORKING_FORK #define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) static char const zMore_Help_Name[] = "more-help"; static char const zMore_HelpText[] = "Extended usage information passed thru pager"; #else #define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMore_Help_Name NULL #define zMore_HelpText NULL #endif #ifdef NO_OPTIONAL_OPT_ARGS # define OPTST_VERSION_FLAGS OPTST_IMM | OPTST_NO_INIT #else # define OPTST_VERSION_FLAGS OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif static char const zVersionText[] = "Output version information and exit"; static char const zVersion_Name[] = "version"; static char const zSave_OptsText[] = "Save the option state to a config file"; static char const zSave_Opts_Name[] = "save-opts"; static char const zLoad_OptsText[] = "Load options from a config file"; static char const zLoad_Opts_NAME[] = "LOAD_OPTS"; static char const zNotLoad_Opts_Name[] = "no-load-opts"; static char const zNotLoad_Opts_Pfx[] = "no"; #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3) /* * Declare option callback procedures */ #if defined(TEST_NTPSNMPD_OPTS) /* * Under test, omit argument processing, or call optionStackArg, * if multiple copies are allowed. */ static tOptProc doUsageOpt; #else /* NOT defined TEST_NTPSNMPD_OPTS */ /* * When not under test, there are different procs to use */ extern tOptProc optionBooleanVal, optionNestedVal, optionNumericVal, optionPagedUsage, optionPrintVersion, optionResetOpt, optionStackArg, optionTimeDate, optionTimeVal, optionUnstackArg, optionVersionStderr; static tOptProc doUsageOpt; #endif /* defined(TEST_NTPSNMPD_OPTS) */ #ifdef TEST_NTPSNMPD_OPTS # define DOVERPROC optionVersionStderr #else # define DOVERPROC optionPrintVersion #endif /* TEST_NTPSNMPD_OPTS */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the Ntpsnmpd Option Descriptions. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_NOFORK, /* equiv idx, value */ 0, VALUE_OPT_NOFORK, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ NOFORK_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zNoforkText, zNofork_NAME, zNofork_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 1, VALUE_OPT_SYSLOG, /* equiv idx, value */ 1, VALUE_OPT_SYSLOG, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SYSLOG_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zSyslogText, zSyslog_NAME, zSyslog_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 2, VALUE_OPT_AGENTXSOCKET, /* equiv idx, value */ 2, VALUE_OPT_AGENTXSOCKET, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ AGENTXSOCKET_FLAGS, 0, /* last opt argumnt */ { zAgentxsocketDefaultArg }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zAgentxsocketText, zAgentxsocket_NAME, zAgentxsocket_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_VERSION_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ DOVERPROC, /* desc, NAME, name */ zVersionText, NULL, zVersion_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doUsageOpt, /* desc, NAME, name */ zHelpText, NULL, zHelp_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_MORE_HELP_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionPagedUsage, /* desc, NAME, name */ zMore_HelpText, NULL, zMore_Help_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zSave_OptsText, NULL, zSave_Opts_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_DISABLE_IMM, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionLoadOpt, /* desc, NAME, name */ zLoad_OptsText, zLoad_Opts_NAME, zLoad_Opts_Name, /* disablement strs */ zNotLoad_Opts_Name, zNotLoad_Opts_Pfx } }; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the Ntpsnmpd Option Environment */ static char const zPROGNAME[9] = "NTPSNMPD"; static char const zUsageTitle[103] = "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.6p5\n\ USAGE: %s [ - [] | --[{=| }] ]...\n"; static char const zRcName[7] = ".ntprc"; static char const * const apzHomeList[3] = { "$HOME", ".", NULL }; static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org"; #define zExplain NULL #define zDetail NULL static char const zFullVersion[] = NTPSNMPD_FULL_VERSION; /* extracted from optcode.tlib near line 515 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE static tOptionXlateProc translate_option_strings; #else # define OPTPROC_BASE OPTPROC_NONE # define translate_option_strings NULL #endif /* ENABLE_NLS */ #define ntpsnmpd_full_usage NULL #define ntpsnmpd_short_usage NULL #ifndef PKGDATADIR # define PKGDATADIR "" #endif #ifndef WITH_PACKAGER # define ntpsnmpd_packager_info NULL #else static char const ntpsnmpd_packager_info[] = "Packaged by " WITH_PACKAGER # ifdef WITH_PACKAGER_VERSION " ("WITH_PACKAGER_VERSION")" # endif # ifdef WITH_PACKAGER_BUG_REPORTS "\nReport ntpsnmpd bugs to " WITH_PACKAGER_BUG_REPORTS # endif "\n"; #endif tOptions ntpsnmpdOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ ( OPTPROC_BASE + OPTPROC_ERRSTOP + OPTPROC_SHORTOPT + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT + OPTPROC_ENVIRON + OPTPROC_NO_ARGS + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zLicenseDescrip, zFullVersion, apzHomeList, zUsageTitle, zExplain, zDetail, optDesc, zBugsAddr, /* address to send bugs to */ NULL, NULL, /* extensions/saved state */ optionUsage, /* usage procedure */ translate_option_strings, /* translation procedure */ /* * Indexes to special options */ { INDEX_OPT_MORE_HELP, /* more-help option index */ INDEX_OPT_SAVE_OPTS, /* save option index */ NO_EQUIVALENT, /* '-#' option index */ NO_EQUIVALENT /* index of default opt */ }, 8 /* full option count */, 3 /* user option count */, ntpsnmpd_full_usage, ntpsnmpd_short_usage, NULL, NULL, PKGDATADIR, ntpsnmpd_packager_info }; /* * Create the static procedure(s) declared above. */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { (void)pOptions; USAGE(NTPSNMPD_EXIT_SUCCESS); } /* extracted from optmain.tlib near line 128 */ #if defined(TEST_NTPSNMPD_OPTS) /* TEST MAIN PROCEDURE: */ extern void optionPutShell(tOptions*); int main(int argc, char ** argv) { int res = NTPSNMPD_EXIT_SUCCESS; (void)optionProcess(&ntpsnmpdOptions, argc, argv); optionPutShell(&ntpsnmpdOptions); res = ferror(stdout); if (res != 0) fputs("output error writing to stdout\n", stderr); return res; } #endif /* defined TEST_NTPSNMPD_OPTS */ /* extracted from optcode.tlib near line 666 */ #if ENABLE_NLS #include #include #include #include #include static char* AO_gettext(char const* pz); static void coerce_it(void** s); static char* AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) return NULL; pzRes = _(pz); if (pzRes == pz) return pzRes; pzRes = strdup(pzRes); if (pzRes == NULL) { fputs(_("No memory for duping translated strings\n"), stderr); exit(NTPSNMPD_EXIT_FAILURE); } return pzRes; } static void coerce_it(void** s) { *s = AO_gettext(*s); } /* * This invokes the translation code (e.g. gettext(3)). */ static void translate_option_strings(void) { tOptions * const pOpt = &ntpsnmpdOptions; /* * Guard against re-translation. It won't work. The strings will have * been changed by the first pass through this code. One shot only. */ if (option_usage_text.field_ct != 0) { /* * Do the translations. The first pointer follows the field count * field. The field count field is the size of a pointer. */ tOptDesc * pOD = pOpt->pOptDesc; char ** ppz = (char**)(void*)&(option_usage_text); int ix = option_usage_text.field_ct; do { ppz++; *ppz = AO_gettext(*ppz); } while (--ix > 0); coerce_it((void*)&(pOpt->pzCopyright)); coerce_it((void*)&(pOpt->pzCopyNotice)); coerce_it((void*)&(pOpt->pzFullVersion)); coerce_it((void*)&(pOpt->pzUsageTitle)); coerce_it((void*)&(pOpt->pzExplain)); coerce_it((void*)&(pOpt->pzDetail)); coerce_it((void*)&(pOpt->pzPackager)); option_usage_text.field_ct = 0; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) coerce_it((void*)&(pOD->pzText)); } if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) { tOptDesc * pOD = pOpt->pOptDesc; int ix; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) { coerce_it((void*)&(pOD->pz_Name)); coerce_it((void*)&(pOD->pz_DisableName)); coerce_it((void*)&(pOD->pz_DisablePfx)); } /* prevent re-translation */ ntpsnmpdOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT; } } #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif /* ntpsnmpd-opts.c ends here */ ntp-4.2.6p5/ntpsnmpd/ntpsnmpd.c0000644000175000017500000000572011675457723015510 0ustar peterpeter/***************************************************************************** * * ntpsnmpd.c * * The NTP SNMP daemon is an Agent X subagent application that * registers itself with a running SNMP Agent X master process running * on the same machine on port TCP 705. It utilizes the libntqp library * which accesses status and general data of a running ntpd process on * the same machine and enables the user to monitor the status of a * ntp daemon process via SNMP. * * This started as a Google Summer of Code 2008 project, * including the ntpsnmpd sub agent and the libntpq library. * * For more information please visit * http://support.ntp.org/bin/view/Dev/GSoC2008snmp * Or contact: * Harlan Stenn (Mentor) at stenn@ntp.org * Heiko Gerstung (Student) at gerstung@ntp.org * ****************************************************************************/ #include #include #include #ifdef SOLARIS /* needed with at least Solaris 8 */ #include #endif #include #include static int keep_running; RETSIGTYPE stop_server(int); RETSIGTYPE stop_server(int a) { keep_running = 0; } /* The main function just sets up a few things and then enters a loop in which it will * wait for SNMP requests coming from the master agent */ int main (int argc, char **argv) { int background = 0; /* start as background process */ int use_syslog = 1; /* use syslog for logging */ { int optct = optionProcess(&ntpsnmpdOptions, argc, argv); argc -= optct; argv += optct; } if (!HAVE_OPT(NOFORK)) background = 1; if (!HAVE_OPT(SYSLOG)) use_syslog = 0; /* using the net-snmp syslog facility */ if (use_syslog) snmp_enable_calllog(); else snmp_enable_stderrlog(); /* Become Subagent */ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1); /* go into background mode, if requested */ if (background && netsnmp_daemonize(1, !use_syslog)) exit(1); /* Now register with the master Agent X process */ /* call Netsnmp socket startup macro, which will initialize the network stuff if required */ SOCK_STARTUP; /* Set AgentX socket interface */ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_X_SOCKET, OPT_ARG( AGENTXSOCKET )); init_agent("ntpsnmpd"); /* Try to connect to ntpd */ if ( ntpq_openhost("localhost") == 0 ) { fprintf(stderr, "Error: Could not connect to ntpd. Aborting.\n"); exit(1); } /* Register callback functions ... */ init_ntpSnmpSubagentObject(); init_snmp("ntpsnmpd"); /* Signal handler */ keep_running = 1; signal(SIGTERM, stop_server); signal(SIGINT, stop_server); snmp_log(LOG_INFO,"ntpsnmpd started.\n"); /* main loop here... */ while(keep_running) { agent_check_and_process(1); /* 0 == don't block */ } /* at shutdown time */ ntpq_closehost(); snmp_shutdown("ntpsnmpd"); SOCK_CLEANUP; return 0; } ntp-4.2.6p5/ntpsnmpd/ntpSnmpSubagentObject.h0000644000175000017500000000471111456223254020113 0ustar peterpeter/***************************************************************************** * * ntpSnmpSubAgentObject.h * * Definitions and macros for ntpSnmpSubAgentObject.c * ****************************************************************************/ #ifndef NTPSNMPSUBAGENTOBJECT_H #define NTPSNMPSUBAGENTOBJECT_H /* Function Prototypes */ size_t ntpsnmpd_parse_string(const char *string, char *field, size_t fieldsize, char *value, size_t valuesize); size_t ntpsnmpd_cut_string(const char *string, char *dest, char delim, int fieldnumber, size_t maxsize); size_t read_ntp_value(const char *variable, char *value, size_t valuesize); /* Initialization */ void init_ntpSnmpSubagentObject(void); /* MIB Section 1 Callback Functions*/ Netsnmp_Node_Handler get_ntpEntSoftwareName; Netsnmp_Node_Handler get_ntpEntSoftwareVersion; Netsnmp_Node_Handler get_ntpEntSoftwareVendor; Netsnmp_Node_Handler get_ntpEntSystemType; Netsnmp_Node_Handler get_ntpEntTimeResolution; Netsnmp_Node_Handler get_ntpEntTimePrecision; Netsnmp_Node_Handler get_ntpEntTimeDistance; /* MIB Section 2 Callback Functions (TODO) */ Netsnmp_Node_Handler get_ntpEntStatusCurrentMode; Netsnmp_Node_Handler get_ntpEntStatusCurrentModeVal; Netsnmp_Node_Handler get_ntpEntStatusStratum; Netsnmp_Node_Handler get_ntpEntStatusActiveRefSourceId; Netsnmp_Node_Handler get_ntpEntStatusActiveRefSourceName; Netsnmp_Node_Handler get_ntpEntStatusActiveOffset; #define NTPV4_OID 1,3,6,1,2,1,197 /* mib-2 197 */ /* * The following macros simplify the registration of the callback * functions and register the name and OID of either read-only (RO) or * read-write (RW) functions. */ #define SETUP_OID_RO(oidname, ...) \ static oid oidname##_oid [] = { __VA_ARGS__ }; \ { \ netsnmp_register_read_only_instance( \ netsnmp_create_handler_registration( \ "#oidname", \ get_##oidname, \ oidname##_oid, \ OID_LENGTH \ ( oidname##_oid ), \ HANDLER_CAN_RONLY)); \ } #define SETUP_OID_RW(oidname, ...) \ static oid oidname##_oid [] = { __VA_ARGS__ }; \ { \ netsnmp_register_instance( \ netsnmp_create_handler_registration( \ "#oidname", \ do_##oidname, \ oidname##_oid, \ OID_LENGTH \ ( oidname##_oid ), \ HANDLER_CAN_RWRITE)); \ } #define NTP_OID_RO(oidname, w, x, y, z) \ SETUP_OID_RO(oidname, NTPV4_OID, w, x, y, z) #define NTP_OID_RW(oidname, w, x, y, z) \ SETUP_OID_RW(oidname, NTPV4_OID, w, x, y, z) #endif ntp-4.2.6p5/ntpsnmpd/Makefile.am0000644000175000017500000000360211510477207015515 0ustar peterpeterNULL= AUTOMAKE_OPTIONS= if NTP_BINSUBDIR_IS_BIN bin_PROGRAMS= @MAKE_NTPSNMPD@ else sbin_PROGRAMS= @MAKE_NTPSNMPD@ endif EXTRA_PROGRAMS= ntpsnmpd ntpsnmpd_SOURCES= netsnmp_daemonize.c ntpsnmpd.c ntpSnmpSubagentObject.c \ ntpsnmpd-opts.c ntpsnmpd-opts.h ntpSnmpSubagentObject.h \ ntp_snmp.h # HMS: we probably want a version.o file here, too. LDADD= ../ntpq/libntpq.a ../libntp/libntp.a @LCRYPTO@ @SNMP_LIBS@ \ $(LIBOPTS_LDADD) AM_CPPFLAGS= -I$(top_srcdir)/ntpq -I$(top_srcdir)/include \ -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include \ $(LIBOPTS_CFLAGS) @SNMP_CPPFLAGS@ AM_CFLAGS= @SNMP_CFLAGS@ EXTRA_DIST= ntpsnmpd-opts.def ntpsnmpd.1 ntpsnmpd-opts.texi \ ntpsnmpd-opts.menu ntpv4-mib.mib BUILT_SOURCES= ntpsnmpd-opts.c ntpsnmpd-opts.h CLEANFILES= noinst_DATA= $(srcdir)/ntpsnmpd-opts.texi $(srcdir)/ntpsnmpd-opts.menu man_MANS= $(srcdir)/ntpsnmpd.1 run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \ autogen -L ../include --writable std_def_list= $(top_srcdir)/include/autogen-version.def \ $(top_srcdir)/include/copyright.def \ $(top_srcdir)/include/homerc.def \ $(top_srcdir)/include/version.def $(srcdir)/ntpsnmpd-opts.h: $(srcdir)/ntpsnmpd-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntpsnmpd-opts.c: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) $(run_ag) ntpsnmpd-opts.def $(srcdir)/ntpsnmpd.1: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) $(run_ag) -Tagman1.tpl -bntpsnmpd ntpsnmpd-opts.def $(srcdir)/ntpsnmpd-opts.menu: $(srcdir)/ntpsnmpd-opts.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/ntpsnmpd-opts.texi: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) $(run_ag) -Taginfo.tpl -DLEVEL=section ntpsnmpd-opts.def $(top_srcdir)/scripts/check--help $@ include $(top_srcdir)/bincheck.mf include $(top_srcdir)/depsver.mf ntp-4.2.6p5/ntpsnmpd/README0000644000175000017500000000323111307651603014335 0ustar peterpeterNTP SNMP subagent for Net-SNMP Installation Guides: - install net-snmp from source (configure, make;, make install) - edit the snmpd configuration file (/usr/local/share/snmp/snmpd.conf): add the lines master agentx agentXSocket tcp:localhost:705 and check which read-only community is configured (should be "rocommunity public") - start snmpd (sudo /usr/local/sbin/snmpd) and check that it is running correctly by running the command snmpwalk -v2c -c public localhost (which should output a lot of data values for the supported built-in MIBs of net-snmp) - build the libntpq and the libntp library - build the ntpsnmpd application (make) and run it (./ntpsnmpd) - now you can run snmpwalk -v2c -c public localhost enterprises.5597.99 which should give you a list of all currently supported NTP MIB objects and their current values Please note that currently I use a private MIB OID (enterprises.5597 is the Meinberg top level OEM OID and 99 is my temporary working space for this project). The final OID has to be registered with IANA and this is done by the RFC Editor when the NTPv4 MIB RFC is standardized. I will try to do this earlier in order to be able to have a working solution at the end of this project. In its current state the daemon supports these objects: ntpEntSoftwareName ntpEntSoftwareVersion ntpEntSoftwareVersionVal ntpEntSoftwareVendor ntpEntSystemType ntpEntTimeResolution ntpEntTimeResolutionVal ntpEntTimePrecision ntpEntTimePrecisionVal ntpEntTimeDistance They all use the libntpq library to access information from the ntpd instance with mode 6 packets. Next step is to implement the status section of the MIB (section 2). ntp-4.2.6p5/version.m40000644000175000017500000000004611675460255013553 0ustar peterpeterm4_define([VERSION_NUMBER],[4.2.6p5]) ntp-4.2.6p5/sntp/0000755000175000017500000000000011675461360012606 5ustar peterpeterntp-4.2.6p5/sntp/depcomp0000755000175000017500000003710010377564120014160 0ustar peterpeter#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # 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 2, 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ntp-4.2.6p5/sntp/sntp-opts.c0000644000175000017500000005472411675460541014735 0ustar peterpeter/* * EDIT THIS FILE WITH CAUTION (sntp-opts.c) * * It has been AutoGen-ed December 24, 2011 at 06:33:53 PM by AutoGen 5.12 * From the definitions sntp-opts.def * and the template file options * * Generated from AutoOpts 35:0:10 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the sntp author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * This source file is copyrighted and licensed under the following terms: * * see html/copyright.html * */ #include #include #include #include #define OPTION_CODE_COMPILE 1 #include "sntp-opts.h" #ifdef __cplusplus extern "C" { #endif extern FILE * option_usage_fp; /* TRANSLATORS: choose the translation for option names wisely because you cannot ever change your mind. */ static char const zCopyright[38] = "sntp 4.2.6p5\n\ see html/copyright.html\n"; static char const zLicenseDescrip[25] = "see html/copyright.html\n"; extern tUsageProc optionUsage; #ifndef NULL # define NULL 0 #endif /* * Ipv4 option description with * "Must also have options" and "Incompatible options": */ static char const zIpv4Text[] = "Force IPv4 DNS name resolution"; static char const zIpv4_NAME[] = "IPV4"; static char const zIpv4_Name[] = "ipv4"; static const int aIpv4CantList[] = { INDEX_OPT_IPV6, NO_EQUIVALENT }; #define IPV4_FLAGS (OPTST_DISABLED) /* * Ipv6 option description with * "Must also have options" and "Incompatible options": */ static char const zIpv6Text[] = "Force IPv6 DNS name resolution"; static char const zIpv6_NAME[] = "IPV6"; static char const zIpv6_Name[] = "ipv6"; static const int aIpv6CantList[] = { INDEX_OPT_IPV4, NO_EQUIVALENT }; #define IPV6_FLAGS (OPTST_DISABLED) /* * Normalverbose option description: */ static char const zNormalverboseText[] = "Normal verbose"; static char const zNormalverbose_NAME[] = "NORMALVERBOSE"; static char const zNormalverbose_Name[] = "normalverbose"; #define NORMALVERBOSE_FLAGS (OPTST_DISABLED) /* * Kod option description: */ static char const zKodText[] = "KoD history filename"; static char const zKod_NAME[] = "KOD"; static char const zKod_Name[] = "kod"; #define KOD_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Syslog option description with * "Must also have options" and "Incompatible options": */ static char const zSyslogText[] = "Logging with syslog"; static char const zSyslog_NAME[] = "SYSLOG"; static char const zSyslog_Name[] = "syslog"; static const int aSyslogCantList[] = { INDEX_OPT_LOGFILE, NO_EQUIVALENT }; #define SYSLOG_FLAGS (OPTST_DISABLED) /* * Logfile option description with * "Must also have options" and "Incompatible options": */ static char const zLogfileText[] = "Log to specified logfile"; static char const zLogfile_NAME[] = "LOGFILE"; static char const zLogfile_Name[] = "logfile"; static const int aLogfileCantList[] = { INDEX_OPT_SYSLOG, NO_EQUIVALENT }; #define LOGFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Settod option description with * "Must also have options" and "Incompatible options": */ static char const zSettodText[] = "Set (step) the time with settimeofday()"; static char const zSettod_NAME[] = "SETTOD"; static char const zSettod_Name[] = "settod"; static const int aSettodCantList[] = { INDEX_OPT_ADJTIME, NO_EQUIVALENT }; #define SETTOD_FLAGS (OPTST_DISABLED) /* * Adjtime option description with * "Must also have options" and "Incompatible options": */ static char const zAdjtimeText[] = "Set (slew) the time with adjtime()"; static char const zAdjtime_NAME[] = "ADJTIME"; static char const zAdjtime_Name[] = "adjtime"; static const int aAdjtimeCantList[] = { INDEX_OPT_SETTOD, NO_EQUIVALENT }; #define ADJTIME_FLAGS (OPTST_DISABLED) /* * Broadcast option description: */ static char const zBroadcastText[] = "Use broadcasts to the address specified for synchronisation"; static char const zBroadcast_NAME[] = "BROADCAST"; static char const zBroadcast_Name[] = "broadcast"; #define BROADCAST_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Timeout option description: */ static char const zTimeoutText[] = "Specify the number of seconds to wait for broadcasts"; static char const zTimeout_NAME[] = "TIMEOUT"; static char const zTimeout_Name[] = "timeout"; #define zTimeoutDefaultArg ((char const*)68) #define TIMEOUT_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) /* * Authentication option description: */ static char const zAuthenticationText[] = "Enable authentication with the key auth-keynumber"; static char const zAuthentication_NAME[] = "AUTHENTICATION"; static char const zAuthentication_Name[] = "authentication"; #define AUTHENTICATION_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) /* * Keyfile option description: */ static char const zKeyfileText[] = "Specify a keyfile. SNTP will look in this file for the key specified with -a"; static char const zKeyfile_NAME[] = "KEYFILE"; static char const zKeyfile_Name[] = "keyfile"; #define KEYFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Help/More_Help/Version option descriptions: */ static char const zHelpText[] = "Display extended usage information and exit"; static char const zHelp_Name[] = "help"; #ifdef HAVE_WORKING_FORK #define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) static char const zMore_Help_Name[] = "more-help"; static char const zMore_HelpText[] = "Extended usage information passed thru pager"; #else #define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMore_Help_Name NULL #define zMore_HelpText NULL #endif #ifdef NO_OPTIONAL_OPT_ARGS # define OPTST_VERSION_FLAGS OPTST_IMM | OPTST_NO_INIT #else # define OPTST_VERSION_FLAGS OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif static char const zVersionText[] = "Output version information and exit"; static char const zVersion_Name[] = "version"; static char const zSave_OptsText[] = "Save the option state to a config file"; static char const zSave_Opts_Name[] = "save-opts"; static char const zLoad_OptsText[] = "Load options from a config file"; static char const zLoad_Opts_NAME[] = "LOAD_OPTS"; static char const zNotLoad_Opts_Name[] = "no-load-opts"; static char const zNotLoad_Opts_Pfx[] = "no"; #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3) /* * Declare option callback procedures */ #if defined(TEST_SNTP_OPTS) /* * Under test, omit argument processing, or call optionStackArg, * if multiple copies are allowed. */ static tOptProc doUsageOpt; #else /* NOT defined TEST_SNTP_OPTS */ /* * When not under test, there are different procs to use */ extern tOptProc optionBooleanVal, optionNestedVal, optionNumericVal, optionPagedUsage, optionPrintVersion, optionResetOpt, optionStackArg, optionTimeDate, optionTimeVal, optionUnstackArg, optionVersionStderr; static tOptProc doUsageOpt; #endif /* defined(TEST_SNTP_OPTS) */ #ifdef TEST_SNTP_OPTS # define DOVERPROC optionVersionStderr #else # define DOVERPROC optionPrintVersion #endif /* TEST_SNTP_OPTS */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the Sntp Option Descriptions. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_IPV4, /* equiv idx, value */ 0, VALUE_OPT_IPV4, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ IPV4_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aIpv4CantList, /* option proc */ NULL, /* desc, NAME, name */ zIpv4Text, zIpv4_NAME, zIpv4_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 1, VALUE_OPT_IPV6, /* equiv idx, value */ 1, VALUE_OPT_IPV6, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ IPV6_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aIpv6CantList, /* option proc */ NULL, /* desc, NAME, name */ zIpv6Text, zIpv6_NAME, zIpv6_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 2, VALUE_OPT_NORMALVERBOSE, /* equiv idx, value */ 2, VALUE_OPT_NORMALVERBOSE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ NORMALVERBOSE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zNormalverboseText, zNormalverbose_NAME, zNormalverbose_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 3, VALUE_OPT_KOD, /* equiv idx, value */ 3, VALUE_OPT_KOD, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ KOD_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zKodText, zKod_NAME, zKod_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 4, VALUE_OPT_SYSLOG, /* equiv idx, value */ 4, VALUE_OPT_SYSLOG, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SYSLOG_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aSyslogCantList, /* option proc */ NULL, /* desc, NAME, name */ zSyslogText, zSyslog_NAME, zSyslog_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 5, VALUE_OPT_LOGFILE, /* equiv idx, value */ 5, VALUE_OPT_LOGFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ LOGFILE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aLogfileCantList, /* option proc */ NULL, /* desc, NAME, name */ zLogfileText, zLogfile_NAME, zLogfile_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 6, VALUE_OPT_SETTOD, /* equiv idx, value */ 6, VALUE_OPT_SETTOD, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SETTOD_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aSettodCantList, /* option proc */ NULL, /* desc, NAME, name */ zSettodText, zSettod_NAME, zSettod_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 7, VALUE_OPT_ADJTIME, /* equiv idx, value */ 7, VALUE_OPT_ADJTIME, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ ADJTIME_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, aAdjtimeCantList, /* option proc */ NULL, /* desc, NAME, name */ zAdjtimeText, zAdjtime_NAME, zAdjtime_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 8, VALUE_OPT_BROADCAST, /* equiv idx, value */ 8, VALUE_OPT_BROADCAST, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ BROADCAST_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zBroadcastText, zBroadcast_NAME, zBroadcast_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 9, VALUE_OPT_TIMEOUT, /* equiv idx, value */ 9, VALUE_OPT_TIMEOUT, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ TIMEOUT_FLAGS, 0, /* last opt argumnt */ { zTimeoutDefaultArg }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionNumericVal, /* desc, NAME, name */ zTimeoutText, zTimeout_NAME, zTimeout_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 10, VALUE_OPT_AUTHENTICATION, /* equiv idx, value */ 10, VALUE_OPT_AUTHENTICATION, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ AUTHENTICATION_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionNumericVal, /* desc, NAME, name */ zAuthenticationText, zAuthentication_NAME, zAuthentication_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 11, VALUE_OPT_KEYFILE, /* equiv idx, value */ 11, VALUE_OPT_KEYFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ KEYFILE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zKeyfileText, zKeyfile_NAME, zKeyfile_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_VERSION_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ DOVERPROC, /* desc, NAME, name */ zVersionText, NULL, zVersion_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doUsageOpt, /* desc, NAME, name */ zHelpText, NULL, zHelp_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_MORE_HELP_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionPagedUsage, /* desc, NAME, name */ zMore_HelpText, NULL, zMore_Help_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zSave_OptsText, NULL, zSave_Opts_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_DISABLE_IMM, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionLoadOpt, /* desc, NAME, name */ zLoad_OptsText, zLoad_Opts_NAME, zLoad_Opts_Name, /* disablement strs */ zNotLoad_Opts_Name, zNotLoad_Opts_Pfx } }; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the Sntp Option Environment */ static char const zPROGNAME[5] = "SNTP"; static char const zUsageTitle[152] = "sntp - standard Simple Network Time Protocol program - Ver. 4.2.6p5\n\ USAGE: %s [ - [] | --[{=| }] ]... \\\n\ \t\t[ hostname-or-IP ...]\n"; static char const zRcName[7] = ".ntprc"; static char const * const apzHomeList[3] = { "$HOME", ".", NULL }; static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org"; static char const zExplain[] = "\n\n"; static char const zDetail[352] = "\n\ sntp implements the Simple Network Time Protocol, and is used to query an\n\ NTP or SNTP server and either display the time or set the local system's\n\ time (given suitable privilege).\n\n\ It can be run interactively from the command line or as a cron job.\n\n\ NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC\n\ 1305.\n"; static char const zFullVersion[] = SNTP_FULL_VERSION; /* extracted from optcode.tlib near line 515 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE static tOptionXlateProc translate_option_strings; #else # define OPTPROC_BASE OPTPROC_NONE # define translate_option_strings NULL #endif /* ENABLE_NLS */ #define sntp_full_usage NULL #define sntp_short_usage NULL #ifndef PKGDATADIR # define PKGDATADIR "" #endif #ifndef WITH_PACKAGER # define sntp_packager_info NULL #else static char const sntp_packager_info[] = "Packaged by " WITH_PACKAGER # ifdef WITH_PACKAGER_VERSION " ("WITH_PACKAGER_VERSION")" # endif # ifdef WITH_PACKAGER_BUG_REPORTS "\nReport sntp bugs to " WITH_PACKAGER_BUG_REPORTS # endif "\n"; #endif tOptions sntpOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ ( OPTPROC_BASE + OPTPROC_ERRSTOP + OPTPROC_SHORTOPT + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT + OPTPROC_ENVIRON + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zLicenseDescrip, zFullVersion, apzHomeList, zUsageTitle, zExplain, zDetail, optDesc, zBugsAddr, /* address to send bugs to */ NULL, NULL, /* extensions/saved state */ optionUsage, /* usage procedure */ translate_option_strings, /* translation procedure */ /* * Indexes to special options */ { INDEX_OPT_MORE_HELP, /* more-help option index */ INDEX_OPT_SAVE_OPTS, /* save option index */ NO_EQUIVALENT, /* '-#' option index */ NO_EQUIVALENT /* index of default opt */ }, 17 /* full option count */, 12 /* user option count */, sntp_full_usage, sntp_short_usage, NULL, NULL, PKGDATADIR, sntp_packager_info }; /* * Create the static procedure(s) declared above. */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { (void)pOptions; USAGE(SNTP_EXIT_SUCCESS); } /* extracted from optmain.tlib near line 128 */ #if defined(TEST_SNTP_OPTS) /* TEST MAIN PROCEDURE: */ extern void optionPutShell(tOptions*); int main(int argc, char ** argv) { int res = SNTP_EXIT_SUCCESS; (void)optionProcess(&sntpOptions, argc, argv); optionPutShell(&sntpOptions); res = ferror(stdout); if (res != 0) fputs("output error writing to stdout\n", stderr); return res; } #endif /* defined TEST_SNTP_OPTS */ /* extracted from optcode.tlib near line 666 */ #if ENABLE_NLS #include #include #include #include #include static char* AO_gettext(char const* pz); static void coerce_it(void** s); static char* AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) return NULL; pzRes = _(pz); if (pzRes == pz) return pzRes; pzRes = strdup(pzRes); if (pzRes == NULL) { fputs(_("No memory for duping translated strings\n"), stderr); exit(SNTP_EXIT_FAILURE); } return pzRes; } static void coerce_it(void** s) { *s = AO_gettext(*s); } /* * This invokes the translation code (e.g. gettext(3)). */ static void translate_option_strings(void) { tOptions * const pOpt = &sntpOptions; /* * Guard against re-translation. It won't work. The strings will have * been changed by the first pass through this code. One shot only. */ if (option_usage_text.field_ct != 0) { /* * Do the translations. The first pointer follows the field count * field. The field count field is the size of a pointer. */ tOptDesc * pOD = pOpt->pOptDesc; char ** ppz = (char**)(void*)&(option_usage_text); int ix = option_usage_text.field_ct; do { ppz++; *ppz = AO_gettext(*ppz); } while (--ix > 0); coerce_it((void*)&(pOpt->pzCopyright)); coerce_it((void*)&(pOpt->pzCopyNotice)); coerce_it((void*)&(pOpt->pzFullVersion)); coerce_it((void*)&(pOpt->pzUsageTitle)); coerce_it((void*)&(pOpt->pzExplain)); coerce_it((void*)&(pOpt->pzDetail)); coerce_it((void*)&(pOpt->pzPackager)); option_usage_text.field_ct = 0; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) coerce_it((void*)&(pOD->pzText)); } if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) { tOptDesc * pOD = pOpt->pOptDesc; int ix; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) { coerce_it((void*)&(pOD->pz_Name)); coerce_it((void*)&(pOD->pz_DisableName)); coerce_it((void*)&(pOD->pz_DisablePfx)); } /* prevent re-translation */ sntpOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT; } } #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif /* sntp-opts.c ends here */ ntp-4.2.6p5/sntp/sntp.html0000644000175000017500000004200611675460550014462 0ustar peterpeter Sntp User's Manual

    Sntp User's Manual


    Next: , Previous: (dir), Up: (dir)

    Simple Network Time Protocol User Manual

    This document describes the use of the NTP Project's sntp program, 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 cron job.

    This document applies to version 4.2.6p5 of sntp.

    The program implements the SNTP protocol as defined by RFC 5905, the NTPv4 IETF specification.



    Description

    By default, sntp writes the local data and time (i.e., not UTC) to the standard output in the format:

         1996 Oct 15 20:17:25.123 +4.567 +/- 0.089 secs
    

    where the +4.567 +/- 0.089 secs indicates the time offset and error bound of the system clock relative to the server clock.



    Invoking sntp

    sntp can be used as a SNTP client to query a NTP or SNTP server and either display the time or set the local system's time (given suitable privilege). It can be run as an interactive command or in a cron job.

    NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol) are defined and described by RFC 5905.

    The default is to write the estimated correct local date and time (i.e. not UTC) to the standard output in a format like

         1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
    

    where the

         +4.567 +/- 0.089 secs
    

    indicates the local clock is 4.567 seconds behind the correct time (so 4.567 seconds must be added to the local clock to get it to be correct), and the (local) time of 1996-10-15 20:17:25.123 can be converted to UTC time by adding 8 hours and 0 minutes, and is believed to be correct to within +/- 0.089 seconds.

    This section was generated by AutoGen, the aginfo template and the option descriptions for the sntp program. It documents the sntp usage text and option meanings.

    This software is released under a specialized copyright license.

    sntp usage help (-?)

    This is the automatically generated usage text for sntp:

    sntp - standard Simple Network Time Protocol program - Ver. 4.2.6p5
    USAGE:  sntp [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \
                    [ hostname-or-IP ...]
      Flg Arg Option-Name    Description
       -4 no  ipv4           Force IPv4 DNS name resolution
                                    - prohibits these options:
                                    ipv6
       -6 no  ipv6           Force IPv6 DNS name resolution
                                    - prohibits these options:
                                    ipv4
       -d no  normalverbose  Normal verbose
       -K Str kod            KoD history filename
       -p no  syslog         Logging with syslog
                                    - prohibits these options:
                                    logfile
       -l Str logfile        Log to specified logfile
                                    - prohibits these options:
                                    syslog
       -s no  settod         Set (step) the time with settimeofday()
                                    - prohibits these options:
                                    adjtime
       -j no  adjtime        Set (slew) the time with adjtime()
                                    - prohibits these options:
                                    settod
       -b Str broadcast      Use broadcasts to the address specified for synchronisation
       -t Num timeout        Specify the number of seconds to wait for broadcasts
       -a Num authentication Enable authentication with the key auth-keynumber
       -k Str keyfile        Specify a keyfile. SNTP will look in this file for the key specified with -a
          opt version        Output version information and exit
       -? no  help           Display extended usage information and exit
       -! no  more-help      Extended usage information passed thru pager
       -> opt save-opts      Save the option state to a config file
       -< Str load-opts      Load options from a config file
                                    - disabled as --no-load-opts
                                    - may appear multiple times
    
    Options are specified by doubled hyphens and their name or by a single
    hyphen and the flag character.
    
    
    
    The following option preset mechanisms are supported:
     - reading file $HOME/.ntprc
     - reading file ./.ntprc
     - examining environment variables named SNTP_*
    
    sntp implements the Simple Network Time Protocol, and is used to query an
    NTP or SNTP server and either display the time or set the local system's
    time (given suitable privilege).
    
    It can be run interactively from the command line or as a cron job.
    
    NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC
    1305.
    
    please send bug reports to:  http://bugs.ntp.org, bugs@ntp.org
    

    adjtime option (-j)

    This is the “set (slew) the time with adjtime()” option.

    This option has some usage constraints. It:

    • must not appear in combination with any of the following options: settod.


    Next: , Previous: sntp adjtime, Up: sntp Invocation

    authentication option (-a)

    This is the “enable authentication with the key auth-keynumber” option. This option enables authentication using the key specified in this option's argument. The argument of this option is the keyid, a number specified in the keyfile as this key's identifier. See the keyfile option (-k) for more details.


    Next: , Previous: sntp authentication, Up: sntp Invocation

    broadcast option (-b)

    This is the “use broadcasts to the address specified for synchronisation” option. If specified SNTP will listen to the specified broadcast address for NTP broadcasts. The default maximum wait time, 68 seconds, can be modified with -t.


    Next: , Previous: sntp broadcast, Up: sntp Invocation

    ipv4 option (-4)

    This is the “force ipv4 dns name resolution” option.

    This option has some usage constraints. It:

    • must not appear in combination with any of the following options: ipv6.

    Force DNS resolution of the following host names on the command line to the IPv4 namespace.


    Next: , Previous: sntp ipv4, Up: sntp Invocation

    ipv6 option (-6)

    This is the “force ipv6 dns name resolution” option.

    This option has some usage constraints. It:

    • must not appear in combination with any of the following options: ipv4.

    Force DNS resolution of the following host names on the command line to the IPv6 namespace.


    Next: , Previous: sntp ipv6, Up: sntp Invocation

    keyfile option (-k)

    This is the “specify a keyfile. sntp will look in this file for the key specified with -a” option. This option specifies the keyfile. SNTP will search for the key specified with -a keyno in this file. Key files follow the following format:

    keyid keytype key

    Where keyid is a number identifying this key keytype is one of the follow: S Key in 64 Bit hexadecimal number as specified in in the DES specification. N Key in 64 Bit hexadecimal number as specified in the NTP standard. A Key in a 1-to-8 character ASCII string. M Key in a 1-to-8 character ASCII string using the MD5 authentication scheme.

    For more information see ntp.keys(5).


    Next: , Previous: sntp keyfile, Up: sntp Invocation

    kod option (-K)

    This is the “kod history filename” option. Specifies the filename to be used to persist the history of KoD responses received from servers. The default is /var/db/ntp-kod.


    Next: , Previous: sntp kod, Up: sntp Invocation

    logfile option (-l)

    This is the “log to specified logfile” option.

    This option has some usage constraints. It:

    • must not appear in combination with any of the following options: syslog.

    This option causes the client to write log messages to the specified logfile.


    Next: , Previous: sntp logfile, Up: sntp Invocation

    normalverbose option (-d)

    This is the “normal verbose” option. Diagnostic messages for non-fatal errors and a limited amount of tracing should be written to standard error. Fatal ones always produce a diagnostic. This option should be set when there is a suspected problem with the server, network or the source.

    settod option (-s)

    This is the “set (step) the time with settimeofday()” option.

    This option has some usage constraints. It:

    • must not appear in combination with any of the following options: adjtime.


    Next: , Previous: sntp settod, Up: sntp Invocation

    syslog option (-p)

    This is the “logging with syslog” option.

    This option has some usage constraints. It:

    • must not appear in combination with any of the following options: logfile.

    When this option is set all logging will be done using syslog.


    Previous: sntp syslog, Up: sntp Invocation

    timeout option (-t)

    This is the “specify the number of seconds to wait for broadcasts” option. When waiting for a broadcast packet SNTP will wait the number of seconds specified before giving up. Default 68 seconds.



    Usage

    The simplest use of this program is as an unprivileged command to check the current time, offset, and error in the local clock. For example:

        sntp ntpserver.somewhere
    

    With suitable privilege, it can be run as a command or in a crom job to reset the local clock from a reliable server, like the ntpdate and rdate commands. For example:

        sntp -a ntpserver.somewhere
    
    ntp-4.2.6p5/sntp/log.c0000644000175000017500000000110111474355435013526 0ustar peterpeter#include #include "log.h" char *progname = "sntp"; /* for msyslog use too */ static void cleanup_log(void); void init_logging(void) { openlog(progname, LOG_PID | LOG_CONS, OPENLOG_FAC); msyslog_term = TRUE; } void open_logfile( const char *logfile ) { syslog_file = fopen(logfile, "a"); if (syslog_file == NULL) { msyslog(LOG_ERR, "sntp: Cannot open logfile %s", logfile); return; } syslogit = FALSE; atexit(cleanup_log); } static void cleanup_log(void) { syslogit = TRUE; fflush(syslog_file); fclose(syslog_file); syslog_file = NULL; } ntp-4.2.6p5/sntp/networking.h0000644000175000017500000000732711466411656015160 0ustar peterpeter#ifndef NETWORKING_H #define NETWORKING_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "crypto.h" #include "log.h" #include "sntp-opts.h" #include "utilities.h" /* * for 4.2.6 only define AUTOKEY if OPENSSL, so that backported 4.2.7 * references to AUTOKEY work -- in 4.2.7 AUTOKEY is independent of OPENSSL */ #ifdef OPENSSL #define AUTOKEY #endif /* FIXME To be replaced by the constants in ntp.h */ #define SERVER_UNUSEABLE -1 /* Skip server */ #define PACKET_UNUSEABLE -2 /* Discard packet and try to get a useable packet again if not tried too often */ #define SERVER_AUTH_FAIL -3 /* Authentication failed, act upon settings */ #define KOD_DEMOBILIZE -4 /* KOD packet with code DENY or RSTR, stop all communication and save KOD information */ #define KOD_RATE -5 /* KOD packet with code RATE, reduce poll intervall */ #define BROADCAST_FAILED -6 /* From ntpdate.c */ int is_reachable (struct addrinfo *dst); int resolve_hosts (const char **hosts, int hostc, struct addrinfo ***res, int pref_family); void create_socket (SOCKET *rsock, sockaddr_u *dest); void sendpkt (SOCKET rsock, sockaddr_u *dest, struct pkt *pkt, int len); int recvdata (SOCKET rsock, sockaddr_u *sender, char *rdata, int rdata_len); int recvpkt (SOCKET rsock, struct pkt *rpkt, unsigned int rsize, struct pkt *spkt); int recv_bcst_data (SOCKET rsock, char *rdata, int rdata_len, sockaddr_u *sas, sockaddr_u *ras); int recv_bcst_pkt (SOCKET rsock, struct pkt *rpkt, unsigned int rsize, sockaddr_u *sas); int process_pkt (struct pkt *rpkt, sockaddr_u *sas, int pkt_len, int mode, struct pkt *spkt, char * func_name); /* Shortened peer structure. Not absolutely necessary yet */ struct speer { struct speer *next; sockaddr_u srcadr; u_char version; u_char hmode; u_char hpoll; u_char minpoll; u_char maxpoll; u_int flags; u_char num_events; u_char ttl; u_char leap; u_char pmode; u_char stratum; u_char ppoll; u_char precision; /* should be s_char */ u_int32 refid; l_fp reftime; keyid_t keyid; #ifdef AUTOKEY #define clear_to_zero opcode u_int32 opcode; /* last request opcode */ associd_t assoc; /* peer association ID */ u_int32 crypto; /* peer status word */ EVP_PKEY *pkey; /* public key */ const EVP_MD *digest; /* message digest algorithm */ char *subject; /* certificate subject name */ char *issuer; /* certificate issuer name */ struct cert_info *xinfo; /* issuer certificate */ keyid_t pkeyid; /* previous key ID */ keyid_t hcookie; /* host cookie */ keyid_t pcookie; /* peer cookie */ const struct pkey_info *ident_pkey; /* identity key */ BIGNUM *iffval; /* identity challenge (IFF, GQ, MV) */ const BIGNUM *grpkey; /* identity challenge key (GQ) */ struct value cookval; /* receive cookie values */ struct value recval; /* receive autokey values */ struct exten *cmmd; /* extension pointer */ u_long refresh; /* next refresh epoch */ /* * Variables used by authenticated server */ keyid_t *keylist; /* session key ID list */ int keynumber; /* current key number */ struct value encrypt; /* send encrypt values */ struct value sndval; /* send autokey values */ #else /* !AUTOKEY follows */ #define clear_to_zero status #endif /* !AUTOKEY */ l_fp rec; /* receive time stamp */ l_fp xmt; /* transmit time stamp */ l_fp dst; /* destination timestamp */ l_fp aorg; /* origin timestamp */ l_fp borg; /* alternate origin timestamp */ double offset; /* peer clock offset */ double delay; /* peer roundtrip delay */ }; #endif ntp-4.2.6p5/sntp/data_formats.h0000644000175000017500000000016511307651616015422 0ustar peterpeter#ifndef DATA_FORMATS_H #define DATA_FORMATS_H #include #include #include #endif ntp-4.2.6p5/sntp/sntp.c0000644000175000017500000000021011675457724013740 0ustar peterpeter#include #include "main.h" volatile int debug; int main ( int argc, char **argv ) { return sntp_main(argc, argv); } ntp-4.2.6p5/sntp/config.guess0000755000175000017500000012673111606457373015143 0ustar peterpeter#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-06-03' # This file 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 2 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, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ntp-4.2.6p5/sntp/utilities.h0000644000175000017500000000123711505336022014761 0ustar peterpeter#ifndef UTILITIES_H #define UTILITIES_H #include #include #include #include #include #include #define HLINE "--------------------------------------------------------------------------------\n" #define PHLINE fprintf(output, HLINE); #define STDLINE printf(HLINE); void pkt_output (struct pkt *dpkg, int pkt_length, FILE *output); void l_fp_output (l_fp *ts, FILE *output); void l_fp_output_bin (l_fp *ts, FILE *output); void l_fp_output_dec (l_fp *ts, FILE *output); char *addrinfo_to_str (struct addrinfo *addr); char *ss_to_str (sockaddr_u *saddr); char *tv_to_str (const struct timeval *tv); #endif ntp-4.2.6p5/sntp/missing0000755000175000017500000002540610377564117014216 0ustar peterpeter#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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 2, 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ntp-4.2.6p5/sntp/sntp-opts.texi0000644000175000017500000002225611675460550015457 0ustar peterpeter@node sntp Invocation @section Invoking sntp @pindex sntp @cindex standard Simple Network Time Protocol program @ignore # # EDIT THIS FILE WITH CAUTION (sntp-opts.texi) # # It has been AutoGen-ed December 24, 2011 at 06:34:00 PM by AutoGen 5.12 # From the definitions sntp-opts.def # and the template file aginfo.tpl @end ignore @code{sntp} can be used as a SNTP client to query a NTP or SNTP server and either display the time or set the local system's time (given suitable privilege). It can be run as an interactive command or in a @code{cron} job. NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol) are defined and described by RFC 5905. @indent The default is to write the estimated correct local date and time (i.e. not UTC) to the standard output in a format like @example 1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs @end example where the @example +4.567 +/- 0.089 secs @end example indicates the local clock is 4.567 seconds behind the correct time (so 4.567 seconds must be added to the local clock to get it to be correct), and the (local) time of @code{1996-10-15 20:17:25.123} can be converted to UTC time by adding 8 hours and 0 minutes, and is believed to be correct to within @code{+/- 0.089} seconds. This section was generated by @strong{AutoGen}, the aginfo template and the option descriptions for the @command{sntp} program. It documents the @command{sntp} usage text and option meanings. This software is released under a specialized copyright license. @menu * sntp usage:: sntp usage help (-?) * sntp adjtime:: adjtime option (-j) * sntp authentication:: authentication option (-a) * sntp broadcast:: broadcast option (-b) * sntp ipv4:: ipv4 option (-4) * sntp ipv6:: ipv6 option (-6) * sntp keyfile:: keyfile option (-k) * sntp kod:: kod option (-K) * sntp logfile:: logfile option (-l) * sntp normalverbose:: normalverbose option (-d) * sntp settod:: settod option (-s) * sntp syslog:: syslog option (-p) * sntp timeout:: timeout option (-t) @end menu @node sntp usage @subsection sntp usage help (-?) @cindex sntp usage This is the automatically generated usage text for sntp: @exampleindent 0 @example sntp - standard Simple Network Time Protocol program - Ver. 4.2.6p5 USAGE: sntp [ - [] | --[@{=| @}] ]... \ [ hostname-or-IP ...] Flg Arg Option-Name Description -4 no ipv4 Force IPv4 DNS name resolution - prohibits these options: ipv6 -6 no ipv6 Force IPv6 DNS name resolution - prohibits these options: ipv4 -d no normalverbose Normal verbose -K Str kod KoD history filename -p no syslog Logging with syslog - prohibits these options: logfile -l Str logfile Log to specified logfile - prohibits these options: syslog -s no settod Set (step) the time with settimeofday() - prohibits these options: adjtime -j no adjtime Set (slew) the time with adjtime() - prohibits these options: settod -b Str broadcast Use broadcasts to the address specified for synchronisation -t Num timeout Specify the number of seconds to wait for broadcasts -a Num authentication Enable authentication with the key auth-keynumber -k Str keyfile Specify a keyfile. SNTP will look in this file for the key specified with -a opt version Output version information and exit -? no help Display extended usage information and exit -! no more-help Extended usage information passed thru pager -> opt save-opts Save the option state to a config file -< Str load-opts Load options from a config file - disabled as --no-load-opts - may appear multiple times Options are specified by doubled hyphens and their name or by a single hyphen and the flag character. The following option preset mechanisms are supported: - reading file $HOME/.ntprc - reading file ./.ntprc - examining environment variables named SNTP_* sntp implements the Simple Network Time Protocol, and is used to query an NTP or SNTP server and either display the time or set the local system's time (given suitable privilege). It can be run interactively from the command line or as a cron job. NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC 1305. please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org @end example @exampleindent 4 @node sntp adjtime @subsection adjtime option (-j) @cindex sntp-adjtime This is the ``set (slew) the time with adjtime()'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: settod. @end itemize @node sntp authentication @subsection authentication option (-a) @cindex sntp-authentication This is the ``enable authentication with the key auth-keynumber'' option. This option enables authentication using the key specified in this option's argument. The argument of this option is the keyid, a number specified in the keyfile as this key's identifier. See the keyfile option (-k) for more details. @node sntp broadcast @subsection broadcast option (-b) @cindex sntp-broadcast This is the ``use broadcasts to the address specified for synchronisation'' option. If specified SNTP will listen to the specified broadcast address for NTP broadcasts. The default maximum wait time, 68 seconds, can be modified with -t. @node sntp ipv4 @subsection ipv4 option (-4) @cindex sntp-ipv4 This is the ``force ipv4 dns name resolution'' option. 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 the following host names on the command line to the IPv4 namespace. @node sntp ipv6 @subsection ipv6 option (-6) @cindex sntp-ipv6 This is the ``force ipv6 dns name resolution'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: ipv4. @end itemize Force DNS resolution of the following host names on the command line to the IPv6 namespace. @node sntp keyfile @subsection keyfile option (-k) @cindex sntp-keyfile This is the ``specify a keyfile. sntp will look in this file for the key specified with -a'' option. This option specifies the keyfile. SNTP will search for the key specified with -a keyno in this file. Key files follow the following format: keyid keytype key Where keyid is a number identifying this key keytype is one of the follow: S Key in 64 Bit hexadecimal number as specified in in the DES specification. N Key in 64 Bit hexadecimal number as specified in the NTP standard. A Key in a 1-to-8 character ASCII string. M Key in a 1-to-8 character ASCII string using the MD5 authentication scheme. For more information see ntp.keys(5). @node sntp kod @subsection kod option (-K) @cindex sntp-kod This is the ``kod history filename'' option. Specifies the filename to be used to persist the history of KoD responses received from servers. The default is /var/db/ntp-kod. @node sntp logfile @subsection logfile option (-l) @cindex sntp-logfile This is the ``log to specified logfile'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: syslog. @end itemize This option causes the client to write log messages to the specified logfile. @node sntp normalverbose @subsection normalverbose option (-d) @cindex sntp-normalverbose This is the ``normal verbose'' option. Diagnostic messages for non-fatal errors and a limited amount of tracing should be written to standard error. Fatal ones always produce a diagnostic. This option should be set when there is a suspected problem with the server, network or the source. @node sntp settod @subsection settod option (-s) @cindex sntp-settod This is the ``set (step) the time with settimeofday()'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: adjtime. @end itemize @node sntp syslog @subsection syslog option (-p) @cindex sntp-syslog This is the ``logging with syslog'' option. This option has some usage constraints. It: @itemize @bullet @item must not appear in combination with any of the following options: logfile. @end itemize When this option is set all logging will be done using syslog. @node sntp timeout @subsection timeout option (-t) @cindex sntp-timeout This is the ``specify the number of seconds to wait for broadcasts'' option. When waiting for a broadcast packet SNTP will wait the number of seconds specified before giving up. Default 68 seconds. ntp-4.2.6p5/sntp/header.h0000644000175000017500000000356111466411656014215 0ustar peterpeter/* Copyright (C) 1996 N.M. Maclaren Copyright (C) 1996 The University of Cambridge This includes all of the 'safe' headers and definitions used across modules. No changes should be needed for any system that is even remotely like Unix. */ #include #include #include #include #include #include #define MAX_SOCKETS 10 /* Maximum number of addresses */ #ifndef LOCKNAME # define LOCKNAME "/etc/sntp.pid" /* Stores the pid */ #endif #ifndef SAVENAME # define SAVENAME "/etc/sntp.state" /* Stores the recovery state */ #endif //#define DEBUG /* Defined in main.c */ #define op_client 1 /* Behave as a challenge client */ #define op_listen 2 /* Behave as a listening client */ /* extern const char *argv0; extern int verbose, operation; extern const char *lockname; extern void fatal (int syserr, const char *message, const char *insert); Defined in unix.c */ extern void do_nothing (int seconds); extern int ftty (FILE *file); extern void set_lock (int lock); extern void log_message (const char *message); /* Defined in internet.c */ /* extern void find_address (struct in_addr *address, int *port, char *hostname, int timespan); */ #define PREF_FAM_INET 1 #define PREF_FAM_INET6 2 extern void preferred_family(int); /* Defined in socket.c */ extern void open_socket (int which, char *hostnames, int timespan); extern void write_socket (int which, void *packet, int length); extern int read_socket (int which, void *packet, int length, int waiting); extern int flush_socket (int which); /* extern void close_socket (int which); */ /* Defined in timing.c */ extern double current_time (double offset); extern time_t convert_time (double value, int *millisecs); extern void adjust_time (double difference, int immediate, double ignore); ntp-4.2.6p5/sntp/sntp-opts.menu0000644000175000017500000000006111675460550015440 0ustar peterpeter* sntp Invocation:: Invoking sntp ntp-4.2.6p5/sntp/configure0000755000175000017500000200704611675460463014531 0ustar peterpeter#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for sntp 4.2.6p5. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sntp' PACKAGE_TARNAME='sntp' PACKAGE_VERSION='4.2.6p5' PACKAGE_STRING='sntp 4.2.6p5' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS NTP_BINSUBDIR_IS_BIN_FALSE NTP_BINSUBDIR_IS_BIN_TRUE BINSUBDIR LCRYPTO OPENSSL_LIB OPENSSL_INC OPENSSL HAVE_INLINE LIBM OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP LIBTOOL LIBOPTS_DIR LIBOPTS_CFLAGS LIBOPTS_LDADD NEED_LIBOPTS_FALSE NEED_LIBOPTS_TRUE INSTALL_LIBOPTS_FALSE INSTALL_LIBOPTS_TRUE POSIX_SHELL SED EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_shared enable_local_libopts enable_libopts_install with_autoopts_config with_regex_header with_libregex with_libregex_cflags with_libregex_libs enable_optional_args enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock with_openssl_libdir with_openssl_incdir with_crypto enable_ipv6 with_kame with_binsubdir ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # 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.6p5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/sntp] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of sntp 4.2.6p5:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=no] --enable-local-libopts Force using the supplied libopts tearoff code --disable-libopts-install Do not install libopts with client installation --disable-optional-args not wanting optional option args --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-ipv6 s use IPv6? Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-autoopts-config specify the config-info script --with-regex-header a reg expr header is specified --with-libregex libregex installation prefix --with-libregex-cflags libregex compile flags --with-libregex-libs libregex link command arguments --with-pic try to use only PIC/non-PIC objects [default=use both] --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-openssl-libdir + =/something/reasonable --with-openssl-incdir + =/something/reasonable --with-crypto + =openssl --with-kame - =/usr/local/v6 --with-binsubdir bin ={bin,sbin} Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF sntp configure 4.2.6p5 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* 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 $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func 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.6p5, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 ac_aux_dir= for ac_dir in . "$srcdir"/.; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. 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. # Increment sntp_configure_cache_version by one for each change to # configure.ac or .m4 files which invalidates cached values from # previous versions. # # If the change affects cache variables used only by the main NTP # configure.ac, then only its version number should be bumped, while # the subdir configure.ac version numbers should be unchanged. The # same is true for a test/variable that is used only by one subdir # being changed incompatibly; only that subdir's cache version needs # bumping. # # If a change affects variables shared by all NTP configure scripts, # please bump the version numbers of all three. If you are not sure, # the safe choice is to bump all three on any cache-invalidating change. # # In order to avoid the risk of version stamp collision between -stable # and -dev branches, do not simply increment the version, instead use # the date YYYYMMDD optionally with -HHMM if there is more than one # bump in a day. sntp_configure_cache_version=20091117 # When the version of config.cache and configure do not # match, NTP_CACHEVERSION will flush the cache. ntp_cache_flush=1 case "$ntp_cv_sntp_cache_version" in $sntp_configure_cache_version) # same version, good ntp_cache_flush=0 ;; '') # No cache, predates ntp_cv_sntp_cache_version, or is empty. case "$cache_file" in /dev/null) ntp_cache_flush=0 ;; *) case "$NTP_CACHEVERSION_PARENT" in '') # Do not clear the cache immediately after it is created # empty as it is noisy. Differentiate a newly-created # config.cache from one predating the cache version # mechanism by looking for the first cached variable set # by Autoconf case "$ac_cv_path_install" in '') # empty config.cache file ntp_cache_flush=0 esac ;; *) # Parent configure just created cache from empty, # flushing would be counterproductive. ntp_cache_flush=0; esac esac ;; *) # configure cache version mismatches config.cache version esac case "$ntp_cache_flush" in 1) c_version="${ntp_cv_sntp_cache_version:-(no version found)}" # Do we flush all variables or exclude others' version stamps? case "$NTP_CACHEVERSION_PARENT" in '') # Clear all *_cv_* variables including our child subdirs' # ntp_cv_*_cache_version variables. This prevents subdir # configure scripts from noticing a version mismatch just # after the top configure in the invocation cleared and # recreated the cache. c_varname_list=`set | sed -n -e 's/=.*$//' \ -e '/_cv_/p' ` ;; *) # This is not the top configure this particular invocation. # Clear all *_cv_* variables sparing the version stamps # of other configure scripts, so we don't trigger # useless repeated clearings. c_varname_list=`set | sed -n -e 's/=.*$//' \ -e '/ntp_cv_.*_cache_version/d' \ -e '/_cv_/p' ` esac for c_varname in $c_varname_list do { eval $c_varname=; unset $c_varname;} done { $as_echo "$as_me:${as_lineno-$LINENO}: $cache_file saved by another version, ignored." >&5 $as_echo "$as_me: $cache_file saved by another version, ignored." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: configure script cache version: $sntp_configure_cache_version" >&5 $as_echo "$as_me: configure script cache version: $sntp_configure_cache_version" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $cache_file version: $c_version" >&5 $as_echo "$as_me: $cache_file version: $c_version" >&6;} { c_varname=; unset c_varname;} { c_varname_list=; unset c_varname_list;} { c_version=; unset c_version;} esac { ntp_cache_flush=; unset ntp_cache_flush;} # save configure version in config.cache for next time ntp_cv_sntp_cache_version="$sntp_configure_cache_version" # let any subdir configure.ac NTP_CACHEVERSION invocations # know they are not the top level. NTP_CACHEVERSION_PARENT='sntp' ; export NTP_CACHEVERSION_PARENT am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; 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_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" $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 STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; 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_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_ac_ct_STRIP="strip" $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 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk 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_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # 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_AWK="$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 AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='sntp' VERSION='4.2.6p5' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac cat >>confdefs.h <<_ACEOF #define STR_SYSTEM "$host" _ACEOF ac_config_headers="$ac_config_headers config.h" # Checks for programs. DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; 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_tool_prefix}gcc" $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 fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; 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_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_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_ac_ct_CC="gcc" $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 ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; 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_tool_prefix}cc" $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 fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; 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 ac_prog_rejected=no 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 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $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_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi 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 fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$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_tool_prefix$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 fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe 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_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_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_ac_ct_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 ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; 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 NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 # AC_PROG_CC_STDC has two functions. It attempts to find a compiler # capable of C99, or failing that, for C89. CC is set afterward with # the selected invocation, such as "gcc --std=gnu99". Also, the # ac_cv_prog_cc_stdc variable is no if the compiler selected for CC # does not accept C89. case $ac_cv_prog_cc_stdc in #( no) : ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( *) : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 else ac_cv_prog_cc_stdc=no fi fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 $as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } if ${ac_cv_prog_cc_stdc+:} false; then : $as_echo_n "(cached) " >&6 fi case $ac_cv_prog_cc_stdc in #( no) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; #( '') : { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; #( *) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 $as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; esac case "$ac_cv_prog_cc_stdc" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ANSI C89/ISO C90 is the minimum to compile SNTP version 4.2.5 and higher." >&5 $as_echo "$as_me: WARNING: ANSI C89/ISO C90 is the minimum to compile SNTP version 4.2.5 and higher." >&2;} esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle #warning" >&5 $as_echo_n "checking if $CC can handle #warning... " >&6; } if ${ntp_cv_cpp_warning+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #warning foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ntp_cv_cpp_warning=yes else ntp_cv_cpp_warning=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cpp_warning" >&5 $as_echo "$ntp_cv_cpp_warning" >&6; } case "$ntp_cv_cpp_warning" in no) $as_echo "#define NO_OPTION_NAME_WARNINGS 1" >>confdefs.h esac case "$GCC" in yes) SAVED_CFLAGS_NTP="$CFLAGS" CFLAGS="$CFLAGS -Wstrict-overflow" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Wstrict-overflow" >&5 $as_echo_n "checking if $CC can handle -Wstrict-overflow... " >&6; } if ${ntp_cv_gcc_Wstrict_overflow+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ntp_cv_gcc_Wstrict_overflow=yes else ntp_cv_gcc_Wstrict_overflow=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Wstrict_overflow" >&5 $as_echo "$ntp_cv_gcc_Wstrict_overflow" >&6; } # # $ntp_cv_gcc_Wstrict_overflow is tested later to add the # flag to CFLAGS. # CFLAGS="$SAVED_CFLAGS_NTP -Winit-self" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Winit-self" >&5 $as_echo_n "checking if $CC can handle -Winit-self... " >&6; } if ${ntp_cv_gcc_Winit_self+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ntp_cv_gcc_Winit_self=yes else ntp_cv_gcc_Winit_self=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Winit_self" >&5 $as_echo "$ntp_cv_gcc_Winit_self" >&6; } CFLAGS="$SAVED_CFLAGS_NTP" { SAVED_CFLAGS_NTP=; unset SAVED_CFLAGS_NTP;} # # $ntp_cv_gcc_Winit_self is tested later to add the # flag to CFLAGS. # esac # HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS case "$host" in *-*-solaris*) # see "man standards". # -D_XOPEN_SOURCE=500 is probably OK for c89 and before # -D_XOPEN_SOURCE=600 seems OK for c99 #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__" CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" libxnet=-lxnet ;; esac # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=no fi # NTP has (so far) been relying on leading-edge autogen. # Therefore, by default: # - use the version we ship with # - do not install it # - build a static copy (AC_DISABLE_SHARED - done earlier) case "${enable_local_libopts+set}" in set) ;; *) enable_local_libopts=yes ;; esac case "${enable_libopts_install+set}" in set) ;; *) enable_libopts_install=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$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 ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi # ================= # AC_CHECK_HEADERS # ================= for ac_header in \ dlfcn.h errno.h fcntl.h libgen.h \ memory.h netinet/in.h setjmp.h sys/mman.h \ sys/param.h sys/poll.h sys/procset.h sys/select.h \ sys/socket.h sys/stropts.h sys/time.h sys/un.h \ sys/wait.h unistd.h utime.h sysexits.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 for ac_header in stdarg.h varargs.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 lo_have_arg_hdr=true;break else lo_have_arg_hdr=false fi done for ac_header in string.h strings.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 lo_have_str_hdr=true;break else lo_have_str_hdr=false fi done for ac_header in limits.h sys/limits.h values.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 lo_have_lim_hdr=true;break else lo_have_lim_hdr=false fi done for ac_header in inttypes.h stdint.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 lo_have_typ_hdr=true;break else lo_have_typ_hdr=false fi done # ---------------------------------------------------------------------- # check for various programs used during the build. # On OS/X, "wchar.h" needs "runetype.h" to work properly. # ---------------------------------------------------------------------- for ac_header in runetype.h wchar.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " $ac_includes_default #if HAVE_RUNETYPE_H # include #endif " 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 # -------------------------------------------- # Verify certain entries from AC_CHECK_HEADERS # -------------------------------------------- for f in sys_types sys_mman sys_param sys_stat sys_wait \ string errno stdlib memory setjmp do eval as_ac_var=\${ac_cv_header_${f}_h+set} test "${as_ac_var}" = set || { as_fn_error $? "You must have ${f}.h on your system" "$LINENO" 5 } done ${lo_have_arg_hdr} || \ as_fn_error $? "You must have stdarg.h or varargs.h on your system" "$LINENO" 5 ${lo_have_str_hdr} || \ as_fn_error $? "You must have string.h or strings.h on your system" "$LINENO" 5 ${lo_have_lim_hdr} || \ as_fn_error $? "You must have one of limits.h, sys/limits.h or values.h" "$LINENO" 5 ${lo_have_typ_hdr} || \ as_fn_error $? "You must have inttypes.h or stdint.h on your system" "$LINENO" 5 # ---------------------------------------------------------------------- # Checks for typedefs # ---------------------------------------------------------------------- ac_fn_c_check_type "$LINENO" "wchar_t" "ac_cv_type_wchar_t" "$ac_includes_default" if test "x$ac_cv_type_wchar_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WCHAR_T 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "wint_t" "ac_cv_type_wint_t" " $ac_includes_default #if HAVE_RUNETYPE_H # include #endif #if HAVE_WCHAR_H # include #endif " if test "x$ac_cv_type_wint_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WINT_T 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default" if test "x$ac_cv_type_int8_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INT8_T 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default" if test "x$ac_cv_type_uint8_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UINT8_T 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default" if test "x$ac_cv_type_int16_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INT16_T 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default" if test "x$ac_cv_type_uint16_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UINT16_T 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default" if test "x$ac_cv_type_int32_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INT32_T 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" if test "x$ac_cv_type_uint32_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UINT32_T 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default" if test "x$ac_cv_type_intptr_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INTPTR_T 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" if test "x$ac_cv_type_uintptr_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UINTPTR_T 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "uint_t" "ac_cv_type_uint_t" "$ac_includes_default" if test "x$ac_cv_type_uint_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UINT_T 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PID_T 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIZE_T 1 _ACEOF fi # ===== # sizes # ===== # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char*" >&5 $as_echo_n "checking size of char*... " >&6; } if ${ac_cv_sizeof_charp+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char*))" "ac_cv_sizeof_charp" "$ac_includes_default"; then : else if test "$ac_cv_type_charp" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (char*) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_charp=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_charp" >&5 $as_echo "$ac_cv_sizeof_charp" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_CHARP $ac_cv_sizeof_charp _ACEOF # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } if ${ac_cv_sizeof_short+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : else if test "$ac_cv_type_short" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 $as_echo "$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF # ---------------------------------------------------------------------- # AC_CHECK_LIB for SVR4 libgen, and use it if it defines pathfind. # ---------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pathfind in -lgen" >&5 $as_echo_n "checking for pathfind in -lgen... " >&6; } if ${ac_cv_lib_gen_pathfind+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgen $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 pathfind (); int main () { return pathfind (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gen_pathfind=yes else ac_cv_lib_gen_pathfind=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_gen_pathfind" >&5 $as_echo "$ac_cv_lib_gen_pathfind" >&6; } if test "x$ac_cv_lib_gen_pathfind" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGEN 1 _ACEOF LIBS="-lgen $LIBS" fi for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork 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 "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi for ac_func in mmap canonicalize_file_name snprintf strdup strchr \ strrchr strsignal 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed while : do POSIX_SHELL=`which bash` test -x "$POSIX_SHELL" && break POSIX_SHELL=`which dash` test -x "$POSIX_SHELL" && break POSIX_SHELL=/usr/xpg4/bin/sh test -x "$POSIX_SHELL" && break POSIX_SHELL=`/bin/sh -c ' exec 2>/dev/null if ! true ; then exit 1 ; fi echo /bin/sh'` test -x "$POSIX_SHELL" && break as_fn_error $? "Cannot locate a working POSIX shell" "$LINENO" 5 done cat >>confdefs.h <<_ACEOF #define POSIX_SHELL "${POSIX_SHELL}" _ACEOF LIBOPTS_BUILD_BLOCKED='' NEED_LIBOPTS_DIR='' # Check whether --enable-local-libopts was given. if test "${enable_local_libopts+set}" = set; then : enableval=$enable_local_libopts; if test x$enableval = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: Using supplied libopts tearoff" >&5 $as_echo "$as_me: Using supplied libopts tearoff" >&6;} LIBOPTS_LDADD='$(top_builddir)/libopts/libopts.la' LIBOPTS_CFLAGS='-I$(top_srcdir)/libopts' NEED_LIBOPTS_DIR=true fi fi # Check whether --enable-libopts-install was given. if test "${enable_libopts_install+set}" = set; then : enableval=$enable_libopts_install; fi if test "X${enable_libopts_install}" != Xno; then INSTALL_LIBOPTS_TRUE= INSTALL_LIBOPTS_FALSE='#' else INSTALL_LIBOPTS_TRUE='#' INSTALL_LIBOPTS_FALSE= fi if test -z "${NEED_LIBOPTS_DIR}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config can be found" >&5 $as_echo_n "checking whether autoopts-config can be found... " >&6; } # Check whether --with-autoopts-config was given. if test "${with_autoopts_config+set}" = set; then : withval=$with_autoopts_config; lo_cv_with_autoopts_config=${with_autoopts_config} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config is specified" >&5 $as_echo_n "checking whether autoopts-config is specified... " >&6; } if ${lo_cv_with_autoopts_config+:} false; then : $as_echo_n "(cached) " >&6 else if autoopts-config --help 2>/dev/null 1>&2 then lo_cv_with_autoopts_config=autoopts-config elif libopts-config --help 2>/dev/null 1>&2 then lo_cv_with_autoopts_config=libopts-config else lo_cv_with_autoopts_config=no ; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lo_cv_with_autoopts_config" >&5 $as_echo "$lo_cv_with_autoopts_config" >&6; } fi # end of AC_ARG_WITH if ${lo_cv_test_autoopts+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "${lo_cv_with_autoopts_config}" \ -o X"${lo_cv_with_autoopts_config}" = Xno then if autoopts-config --help 2>/dev/null 1>&2 then lo_cv_with_autoopts_config=autoopts-config elif libopts-config --help 2>/dev/null 1>&2 then lo_cv_with_autoopts_config=libopts-config else lo_cv_with_autoopts_config=false ; fi fi lo_cv_test_autoopts=` ${lo_cv_with_autoopts_config} --libs` 2> /dev/null if test $? -ne 0 -o -z "${lo_cv_test_autoopts}" then lo_cv_test_autoopts=no ; fi fi # end of CACHE_VAL { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lo_cv_test_autoopts}" >&5 $as_echo "${lo_cv_test_autoopts}" >&6; } if test "X${lo_cv_test_autoopts}" != Xno then LIBOPTS_LDADD="${lo_cv_test_autoopts}" LIBOPTS_CFLAGS="`${lo_cv_with_autoopts_config} --cflags`" else LIBOPTS_LDADD='$(top_builddir)/libopts/libopts.la' LIBOPTS_CFLAGS='-I$(top_srcdir)/libopts' NEED_LIBOPTS_DIR=true fi fi # end of if test -z "${NEED_LIBOPTS_DIR}" if test -n "${LIBOPTS_BUILD_BLOCKED}" ; then NEED_LIBOPTS_DIR='' fi if test -n "${NEED_LIBOPTS_DIR}"; then NEED_LIBOPTS_TRUE= NEED_LIBOPTS_FALSE='#' else NEED_LIBOPTS_TRUE='#' NEED_LIBOPTS_FALSE= fi LIBOPTS_DIR=libopts # end of AC_DEFUN of LIBOPTS_CHECK_COMMON if test -z "$NEED_LIBOPTS_TRUE"; then : # Check to see if a reg expr header is specified. # Check whether --with-regex-header was given. if test "${with_regex_header+set}" = set; then : withval=$with_regex_header; libopts_cv_with_regex_header=${with_regex_header} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a reg expr header is specified" >&5 $as_echo_n "checking whether a reg expr header is specified... " >&6; } if ${libopts_cv_with_regex_header+:} false; then : $as_echo_n "(cached) " >&6 else libopts_cv_with_regex_header=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libopts_cv_with_regex_header" >&5 $as_echo "$libopts_cv_with_regex_header" >&6; } fi # end of AC_ARG_WITH if test "X${libopts_cv_with_regex_header}" != Xno then cat >>confdefs.h <<_ACEOF #define REGEX_HEADER <${libopts_cv_with_regex_header}> _ACEOF else $as_echo "#define REGEX_HEADER " >>confdefs.h fi # Check to see if a working libregex can be found. # Check whether --with-libregex was given. if test "${with_libregex+set}" = set; then : withval=$with_libregex; libopts_cv_with_libregex_root=${with_libregex} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether with-libregex was specified" >&5 $as_echo_n "checking whether with-libregex was specified... " >&6; } if ${libopts_cv_with_libregex_root+:} false; then : $as_echo_n "(cached) " >&6 else libopts_cv_with_libregex_root=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libopts_cv_with_libregex_root" >&5 $as_echo "$libopts_cv_with_libregex_root" >&6; } fi # end of AC_ARG_WITH libregex if test "${with_libregex+set}" = set && \ test "${withval}" = no then ## disabled by request libopts_cv_with_libregex_root=no libopts_cv_with_libregex_cflags=no libopts_cv_with_libregex_libs=no else # Check whether --with-libregex-cflags was given. if test "${with_libregex_cflags+set}" = set; then : withval=$with_libregex_cflags; libopts_cv_with_libregex_cflags=${with_regex_cflags} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether with-libregex-cflags was specified" >&5 $as_echo_n "checking whether with-libregex-cflags was specified... " >&6; } if ${libopts_cv_with_libregex_cflags+:} false; then : $as_echo_n "(cached) " >&6 else libopts_cv_with_libregex_cflags=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libopts_cv_with_libregex_cflags" >&5 $as_echo "$libopts_cv_with_libregex_cflags" >&6; } fi # end of AC_ARG_WITH libregex-cflags # Check whether --with-libregex-libs was given. if test "${with_libregex_libs+set}" = set; then : withval=$with_libregex_libs; libopts_cv_with_libregex_libs=${with_regex_libs} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether with-libregex-libs was specified" >&5 $as_echo_n "checking whether with-libregex-libs was specified... " >&6; } if ${libopts_cv_with_libregex_libs+:} false; then : $as_echo_n "(cached) " >&6 else libopts_cv_with_libregex_libs=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libopts_cv_with_libregex_libs" >&5 $as_echo "$libopts_cv_with_libregex_libs" >&6; } fi # end of AC_ARG_WITH libregex-libs case "X${libopts_cv_with_libregex_cflags}" in Xyes|Xno|X ) case "X${libopts_cv_with_libregex_root}" in Xyes|Xno|X ) libopts_cv_with_libregex_cflags=no ;; * ) libopts_cv_with_libregex_cflags=-I${libopts_cv_with_libregex_root}/include ;; esac esac case "X${libopts_cv_with_libregex_libs}" in Xyes|Xno|X ) case "X${libopts_cv_with_libregex_root}" in Xyes|Xno|X ) libopts_cv_with_libregex_libs=no ;; * ) libopts_cv_with_libregex_libs="-L${libopts_cv_with_libregex_root}/lib -lregex";; esac esac libopts_save_CPPFLAGS="${CPPFLAGS}" libopts_save_LIBS="${LIBS}" fi ## disabled by request case "X${libopts_cv_with_libregex_cflags}" in Xyes|Xno|X ) libopts_cv_with_libregex_cflags="" ;; * ) CPPFLAGS="${CPPFLAGS} ${libopts_cv_with_libregex_cflags}" ;; esac case "X${libopts_cv_with_libregex_libs}" in Xyes|Xno|X ) libopts_cv_with_libregex_libs="" ;; * ) LIBS="${LIBS} ${libopts_cv_with_libregex_libs}" ;; esac LIBREGEX_CFLAGS="" LIBREGEX_LIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libregex functions properly" >&5 $as_echo_n "checking whether libregex functions properly... " >&6; } if ${libopts_cv_with_libregex+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libopts_cv_with_libregex=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include REGEX_HEADER static regex_t re; void comp_re( char const* pzPat ) { int res = regcomp( &re, pzPat, REG_EXTENDED|REG_ICASE|REG_NEWLINE ); if (res == 0) return; exit( res ); } int main() { regmatch_t m[2]; comp_re( "^.*\$" ); comp_re( "()|no.*" ); comp_re( "." ); if (regexec( &re, "X", 2, m, 0 ) != 0) return 1; if ((m[0].rm_so != 0) || (m[0].rm_eo != 1)) { fputs( "error: regex -->.<-- did not match\n", stderr ); return 1; } return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : libopts_cv_with_libregex=yes else libopts_cv_with_libregex=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi # end of AC_TRY_RUN fi # end of AC_CACHE_VAL for libopts_cv_with_libregex { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_with_libregex}" >&5 $as_echo "${libopts_cv_with_libregex}" >&6; } if test "X${libopts_cv_with_libregex}" != Xno then $as_echo "#define WITH_LIBREGEX 1" >>confdefs.h else CPPFLAGS="${libopts_save_CPPFLAGS}" LIBS="${libopts_save_LIBS}" fi # Check to see if pathfind(3) works. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pathfind(3) works" >&5 $as_echo_n "checking whether pathfind(3) works... " >&6; } if ${libopts_cv_run_pathfind+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libopts_cv_run_pathfind=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (int argc, char** argv) { char* pz = pathfind( getenv( "PATH" ), "sh", "x" ); return (pz == 0) ? 1 : 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : libopts_cv_run_pathfind=yes else libopts_cv_run_pathfind=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi # end of TRY_RUN fi # end of AC_CACHE_VAL for libopts_cv_run_pathfind { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_run_pathfind}" >&5 $as_echo "${libopts_cv_run_pathfind}" >&6; } if test "X${libopts_cv_run_pathfind}" != Xno then $as_echo "#define HAVE_PATHFIND 1" >>confdefs.h fi # Check to see if /dev/zero is readable device. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether /dev/zero is readable device" >&5 $as_echo_n "checking whether /dev/zero is readable device... " >&6; } if ${libopts_cv_test_dev_zero+:} false; then : $as_echo_n "(cached) " >&6 else libopts_cv_test_dev_zero=`exec 2> /dev/null dzero=\`ls -lL /dev/zero | egrep ^c......r\` test -z "${dzero}" && exit 1 echo ${dzero}` if test $? -ne 0 || test -z "$libopts_cv_test_dev_zero" then libopts_cv_test_dev_zero=no fi fi # end of CACHE_VAL of libopts_cv_test_dev_zero { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_test_dev_zero}" >&5 $as_echo "${libopts_cv_test_dev_zero}" >&6; } if test "X${libopts_cv_test_dev_zero}" != Xno then $as_echo "#define HAVE_DEV_ZERO 1" >>confdefs.h fi # Check to see if we have a functional realpath(3C). { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have a functional realpath(3C)" >&5 $as_echo_n "checking whether we have a functional realpath(3C)... " >&6; } if ${libopts_cv_run_realpath+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libopts_cv_run_realpath=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (int argc, char** argv) { #ifndef PATH_MAX choke me!! #else char zPath[PATH_MAX+1]; #endif char *pz = realpath(argv[0], zPath); return (pz == zPath) ? 0 : 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : libopts_cv_run_realpath=yes else libopts_cv_run_realpath=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi # end of TRY_RUN fi # end of AC_CACHE_VAL for libopts_cv_run_realpath { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_run_realpath}" >&5 $as_echo "${libopts_cv_run_realpath}" >&6; } if test "X${libopts_cv_run_realpath}" != Xno then $as_echo "#define HAVE_REALPATH 1" >>confdefs.h fi # Check to see if strftime() works. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strftime() works" >&5 $as_echo_n "checking whether strftime() works... " >&6; } if ${libopts_cv_run_strftime+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libopts_cv_run_strftime=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include char t_buf[ 64 ]; int main() { static char const z[] = "Thursday Aug 28 240"; struct tm tm; tm.tm_sec = 36; /* seconds after the minute [0, 61] */ tm.tm_min = 44; /* minutes after the hour [0, 59] */ tm.tm_hour = 12; /* hour since midnight [0, 23] */ tm.tm_mday = 28; /* day of the month [1, 31] */ tm.tm_mon = 7; /* months since January [0, 11] */ tm.tm_year = 86; /* years since 1900 */ tm.tm_wday = 4; /* days since Sunday [0, 6] */ 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); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : libopts_cv_run_strftime=yes else libopts_cv_run_strftime=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi # end of TRY_RUN fi # end of AC_CACHE_VAL for libopts_cv_run_strftime { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_run_strftime}" >&5 $as_echo "${libopts_cv_run_strftime}" >&6; } if test "X${libopts_cv_run_strftime}" != Xno then $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h fi # Check to see if fopen accepts "b" mode. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fopen accepts \"b\" mode" >&5 $as_echo_n "checking whether fopen accepts \"b\" mode... " >&6; } if ${libopts_cv_run_fopen_binary+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libopts_cv_run_fopen_binary=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (int argc, char** argv) { FILE* fp = fopen("conftest.$ac_ext", "rb"); return (fp == NULL) ? 1 : fclose(fp); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : libopts_cv_run_fopen_binary=yes else libopts_cv_run_fopen_binary=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi # end of TRY_RUN fi # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_run_fopen_binary}" >&5 $as_echo "${libopts_cv_run_fopen_binary}" >&6; } if test "X${libopts_cv_run_fopen_binary}" != Xno then $as_echo "#define FOPEN_BINARY_FLAG \"b\"" >>confdefs.h else $as_echo "#define FOPEN_BINARY_FLAG \"\"" >>confdefs.h fi # Check to see if fopen accepts "t" mode. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fopen accepts \"t\" mode" >&5 $as_echo_n "checking whether fopen accepts \"t\" mode... " >&6; } if ${libopts_cv_run_fopen_text+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libopts_cv_run_fopen_text=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (int argc, char** argv) { FILE* fp = fopen("conftest.$ac_ext", "rt"); return (fp == NULL) ? 1 : fclose(fp); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : libopts_cv_run_fopen_text=yes else libopts_cv_run_fopen_text=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi # end of TRY_RUN fi # end of AC_CACHE_VAL for libopts_cv_run_fopen_text { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_run_fopen_text}" >&5 $as_echo "${libopts_cv_run_fopen_text}" >&6; } if test "X${libopts_cv_run_fopen_text}" != Xno then $as_echo "#define FOPEN_TEXT_FLAG \"t\"" >>confdefs.h else $as_echo "#define FOPEN_TEXT_FLAG \"\"" >>confdefs.h fi # Check to see if not wanting optional option args. # Check whether --enable-optional-args was given. if test "${enable_optional_args+set}" = set; then : enableval=$enable_optional_args; libopts_cv_enable_optional_args=${enable_optional_args} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether not wanting optional option args" >&5 $as_echo_n "checking whether not wanting optional option args... " >&6; } if ${libopts_cv_enable_optional_args+:} false; then : $as_echo_n "(cached) " >&6 else libopts_cv_enable_optional_args=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libopts_cv_enable_optional_args" >&5 $as_echo "$libopts_cv_enable_optional_args" >&6; } fi # end of AC_ARG_ENABLE if test "X${libopts_cv_enable_optional_args}" = Xno then $as_echo "#define NO_OPTIONAL_OPT_ARGS 1" >>confdefs.h fi ac_config_files="$ac_config_files libopts/Makefile" fi # end of AC_DEFUN of LIBOPTS_CHECK case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4' macro_revision='1.3293' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_DUMPBIN="$ac_tool_prefix$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 DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_ac_ct_DUMPBIN="$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 ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; 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, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump" $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 OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_ac_ct_OBJDUMP="objdump" $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 ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool" $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 DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_ac_ct_DLLTOOL="dlltool" $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 ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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_AR="$ac_tool_prefix$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 AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_ac_ct_AR="$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 ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; 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_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" $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 STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; 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_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_ac_ct_STRIP="strip" $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 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib" $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 RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; 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_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_ac_ct_RANLIB="ranlib" $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 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_MANIFEST_TOOL="${ac_tool_prefix}mt" $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 MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_ac_ct_MANIFEST_TOOL="mt" $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 ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_DSYMUTIL="${ac_tool_prefix}dsymutil" $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 DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_ac_ct_DSYMUTIL="dsymutil" $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 ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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_NMEDIT="${ac_tool_prefix}nmedit" $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 NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_ac_ct_NMEDIT="nmedit" $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 ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ac_tool_prefix}lipo" $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 LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_ac_ct_LIPO="lipo" $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 ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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_OTOOL="${ac_tool_prefix}otool" $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 OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_ac_ct_OTOOL="otool" $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 ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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_OTOOL64="${ac_tool_prefix}otool64" $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 OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_ac_ct_OTOOL64="otool64" $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 ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' lt_prog_compiler_pic='-Xcompiler -fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; haiku*) version_type=linux need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=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_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=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_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=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_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $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; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } 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 CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory path separator" >&5 $as_echo_n "checking for directory path separator... " >&6; } if ${ntp_cv_dir_sep+:} false; then : $as_echo_n "(cached) " >&6 else case "$ntp_cv_dir_sep" in '') case "$target_os" in *djgpp | *mingw32* | *emx*) ntp_cv_dir_sep="'\\'" ;; *) ntp_cv_dir_sep="'/'" ;; esac esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_dir_sep" >&5 $as_echo "$ntp_cv_dir_sep" >&6; } cat >>confdefs.h <<_ACEOF #define DIR_SEP $ntp_cv_dir_sep _ACEOF # Checks for libraries. LIBM= case "$host" in *-*-darwin*) ;; *) _libs=$LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cos" >&5 $as_echo_n "checking for library containing cos... " >&6; } if ${ac_cv_search_cos+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 cos (); int main () { return cos (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_cos=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_cos+:} false; then : break fi done if ${ac_cv_search_cos+:} false; then : else ac_cv_search_cos=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cos" >&5 $as_echo "$ac_cv_search_cos" >&6; } ac_res=$ac_cv_search_cos if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" LIBM="-lm" fi LIBS=$_libs ;; esac { _libs=; unset _libs;} case "$GCC" in yes) CFLAGS="$CFLAGS -Wall" # CFLAGS="$CFLAGS -Wcast-align" CFLAGS="$CFLAGS -Wcast-qual" # CFLAGS="$CFLAGS -Wconversion" # CFLAGS="$CFLAGS -Werror" # CFLAGS="$CFLAGS -Wextra" # CFLAGS="$CFLAGS -Wfloat-equal" CFLAGS="$CFLAGS -Wmissing-prototypes" CFLAGS="$CFLAGS -Wpointer-arith" CFLAGS="$CFLAGS -Wshadow" # CFLAGS="$CFLAGS -Wtraditional" # CFLAGS="$CFLAGS -Wwrite-strings" case "$ntp_cv_gcc_Winit_self" in yes) CFLAGS="$CFLAGS -Winit-self" esac case "$ntp_cv_gcc_Wstrict_overflow" in yes) CFLAGS="$CFLAGS -Wstrict-overflow" esac # -W[no-]strict-prototypes is added later depending on OpenSSL esac ac_fn_c_check_func "$LINENO" "gethostent" "ac_cv_func_gethostent" if test "x$ac_cv_func_gethostent" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostent" >&5 $as_echo_n "checking for library containing gethostent... " >&6; } if ${ac_cv_search_gethostent+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 gethostent (); int main () { return gethostent (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $libxnet -lsocket $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_gethostent=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_gethostent+:} false; then : break fi done if ${ac_cv_search_gethostent+:} false; then : else ac_cv_search_gethostent=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostent" >&5 $as_echo "$ac_cv_search_gethostent" >&6; } ac_res=$ac_cv_search_gethostent if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi ac_fn_c_check_func "$LINENO" "openlog" "ac_cv_func_openlog" if test "x$ac_cv_func_openlog" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openlog" >&5 $as_echo_n "checking for library containing openlog... " >&6; } if ${ac_cv_search_openlog+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 openlog (); int main () { return openlog (); ; return 0; } _ACEOF for ac_lib in '' gen; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_openlog=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_openlog+:} false; then : break fi done if ${ac_cv_search_openlog+:} false; then : else ac_cv_search_openlog=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_openlog" >&5 $as_echo "$ac_cv_search_openlog" >&6; } ac_res=$ac_cv_search_openlog if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openlog" >&5 $as_echo_n "checking for library containing openlog... " >&6; } if ${ac_cv_search_openlog+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 openlog (); int main () { return openlog (); ; return 0; } _ACEOF for ac_lib in '' syslog; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $libxnet -lsocket $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_openlog=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_openlog+:} false; then : break fi done if ${ac_cv_search_openlog+:} false; then : else ac_cv_search_openlog=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_openlog" >&5 $as_echo "$ac_cv_search_openlog" >&6; } ac_res=$ac_cv_search_openlog if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 $as_echo_n "checking for library containing setsockopt... " >&6; } if ${ac_cv_search_setsockopt+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 setsockopt (); int main () { return setsockopt (); ; return 0; } _ACEOF for ac_lib in '' socket xnet; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_setsockopt=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_setsockopt+:} false; then : break fi done if ${ac_cv_search_setsockopt+:} false; then : else ac_cv_search_setsockopt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setsockopt" >&5 $as_echo "$ac_cv_search_setsockopt" >&6; } ac_res=$ac_cv_search_setsockopt if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # Checks for header files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # case "$host" in *-hp-hpux*) for ac_header in net/netmp.h do : ac_fn_c_check_header_mongrel "$LINENO" "net/netmp.h" "ac_cv_header_net_netmp_h" "$ac_includes_default" if test "x$ac_cv_header_net_netmp_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NET_NETMP_H 1 _ACEOF netmp_h_works=yes else netmp_h_works=no fi done case "$netmp_h_works" in no) cat >>confdefs.h <<_ACEOF #ifndef MPINFOU_PREDECLARED # define MPINFOU_PREDECLARED typedef union mpinfou { /* For lint */ struct pdk_mpinfo *pdkptr; struct mpinfo *pikptr; } mpinfou_t; #endif _ACEOF ;; esac ;; esac for ac_header in netdb.h netinet/in.h stdlib.h string.h strings.h syslog.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 for ac_header in sys/socket.h sys/time.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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 $as_echo_n "checking size of time_t... " >&6; } if ${ac_cv_sizeof_time_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then : else if test "$ac_cv_type_time_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (time_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_time_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 $as_echo "$ac_cv_sizeof_time_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_TIME_T $ac_cv_sizeof_time_t _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac case "$ac_cv_c_inline" in '') ;; *) $as_echo "#define HAVE_INLINE 1" >>confdefs.h esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 $as_echo_n "checking whether char is unsigned... " >&6; } if ${ac_cv_c_char_unsigned+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((char) -1) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_char_unsigned=no else ac_cv_c_char_unsigned=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 $as_echo "$ac_cv_c_char_unsigned" >&6; } if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h fi # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed char" >&5 $as_echo_n "checking size of signed char... " >&6; } if ${ac_cv_sizeof_signed_char+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed char))" "ac_cv_sizeof_signed_char" "$ac_includes_default"; then : else if test "$ac_cv_type_signed_char" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (signed char) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_signed_char=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_char" >&5 $as_echo "$ac_cv_sizeof_signed_char" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char _ACEOF # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF ac_fn_c_check_type "$LINENO" "s_char" "ac_cv_type_s_char" "$ac_includes_default" if test "x$ac_cv_type_s_char" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_S_CHAR 1 _ACEOF fi case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in *yes) # We have a typedef for s_char. Might as well believe it... ;; no0no) # We have signed chars, can't say 'signed char', no s_char typedef. $as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h ;; no1no) # We have signed chars, can say 'signed char', no s_char typedef. $as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h ;; yes0no) # We have unsigned chars, can't say 'signed char', no s_char typedef. as_fn_error $? "No way to specify a signed character!" "$LINENO" 5 ;; yes1no) # We have unsigned chars, can say 'signed char', no s_char typedef. $as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if ${ac_cv_type_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl library directory" >&5 $as_echo_n "checking for openssl library directory... " >&6; } # Check whether --with-openssl-libdir was given. if test "${with_openssl_libdir+set}" = set; then : withval=$with_openssl_libdir; ans=$withval else case "$build" in $host) ans=yes ;; *) ans=no ;; esac fi case "$ans" in no) ;; yes) # Look in: ans="/usr/lib /usr/lib/openssl /usr/sfw/lib /usr/local/lib /usr/local/ssl/lib /lib" ;; *) # Look where they said ;; esac case "$ans" in no) ;; *) # Look for libcrypto.a and libssl.a: for i in $ans no do case "$host" in *-*-darwin*) test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break ;; *) test -f $i/libcrypto.so -a -f $i/libssl.so && break test -f $i/libcrypto.a -a -f $i/libssl.a && break ;; esac done case "$i" in no) ans=no OPENSSL_LIB= ;; *) ans=$i OPENSSL_LIB=$ans ;; esac ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 $as_echo "$ans" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl include directory" >&5 $as_echo_n "checking for openssl include directory... " >&6; } # Check whether --with-openssl-incdir was given. if test "${with_openssl_incdir+set}" = set; then : withval=$with_openssl_incdir; ans=$withval else case "$build" in $host) ans=yes ;; *) ans=no ;; esac fi case "$ans" in no) ;; yes) # look in: ans="/usr/include /usr/sfw/include /usr/local/include /usr/local/ssl/include" ;; *) # Look where they said ;; esac case "$ans" in no) ;; *) # look for openssl/opensslconf.h: for i in $ans no do test -f $i/openssl/opensslconf.h && break done case "$i" in no) ans=no OPENSSL_INC= ;; *) ans=$i OPENSSL_INC=$ans ;; esac ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 $as_echo "$ans" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we will use crypto" >&5 $as_echo_n "checking if we will use crypto... " >&6; } # Check whether --with-crypto was given. if test "${with_crypto+set}" = set; then : withval=$with_crypto; ans=$withval else ans=yes fi case "$ans" in no) ;; yes|openssl) if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INC" then ans=no else ans=yes fi esac ntp_openssl=$ans { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5 $as_echo "$ans" >&6; } case "$ntp_openssl" in yes) # We have OpenSSL inc/lib - use them. case "$OPENSSL_INC" in /usr/include) ;; *) CPPFLAGS="$CPPFLAGS -I$OPENSSL_INC" ;; esac case "$OPENSSL_LIB" in /usr/lib) ;; *) LDFLAGS="$LDFLAGS -L$OPENSSL_LIB" case "$need_dash_r" in 1) LDFLAGS="$LDFLAGS -R$OPENSSL_LIB" esac ;; esac LCRYPTO=-lcrypto $as_echo "#define OPENSSL 1" >>confdefs.h esac # # check for linking with -lcrypto failure, and try -lz -lcrypto. # Helps m68k-atari-mint # case "$ntp_openssl" in yes) NTPO_SAVED_LIBS="$LIBS" LIBS="$NTPO_SAVED_LIBS $LCRYPTO" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with $LCRYPTO alone works" >&5 $as_echo_n "checking if linking with $LCRYPTO alone works... " >&6; } if ${ntp_cv_bare_lcrypto+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "openssl/err.h" #include "openssl/evp.h" int main () { ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ntp_cv_bare_lcrypto=yes else ntp_cv_bare_lcrypto=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: $ntp_cv_bare_lcrypto" >&5 $as_echo "$ntp_cv_bare_lcrypto" >&6; } case "$ntp_cv_bare_lcrypto" in no) LIBS="$NTPO_SAVED_LIBS $LCRYPTO -lz" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with $LCRYPTO -lz works" >&5 $as_echo_n "checking if linking with $LCRYPTO -lz works... " >&6; } if ${ntp_cv_lcrypto_lz+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "openssl/err.h" #include "openssl/evp.h" int main () { ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ntp_cv_lcrypto_lz=yes else ntp_cv_lcrypto_lz=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: $ntp_cv_lcrypto_lz" >&5 $as_echo "$ntp_cv_lcrypto_lz" >&6; } case "$ntp_cv_lcrypto_lz" in yes) LCRYPTO="$LCRYPTO -lz" esac esac LIBS="$NTPO_SAVED_LIBS" { NTPO_SAVED_LIBS=; unset NTPO_SAVED_LIBS;} esac # # Older OpenSSL headers have a number of callback prototypes inside # other function prototypes which trigger copious warnings with gcc's # -Wstrict-prototypes, which is included in -Wall. # # An example: # # int i2d_RSA_NET(const RSA *a, unsigned char **pp, # int (*cb)(), int sgckey); # ^^^^^^^^^^^ # # # openssl_triggers_warnings=unknown SAVED_CFLAGS="$CFLAGS" case "$GCC$ntp_openssl" in yesyes) CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* see if -Werror breaks gcc */ ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gcc_handles_Werror=yes else gcc_handles_Werror=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext case "$gcc_handles_Werror" in no) # if this gcc doesn't do -Werror go ahead and use # -Wstrict-prototypes. openssl_triggers_warnings=yes ;; yes) CFLAGS="$CFLAGS -Wstrict-prototypes" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "openssl/asn1_mac.h" #include "openssl/bn.h" #include "openssl/err.h" #include "openssl/evp.h" #include "openssl/pem.h" #include "openssl/rand.h" #include "openssl/x509v3.h" int main () { /* empty body */ ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : openssl_triggers_warnings=no else openssl_triggers_warnings=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext esac case "$openssl_triggers_warnings" in yes) CFLAGS="$SAVED_CFLAGS -Wno-strict-prototypes" ;; *) CFLAGS="$SAVED_CFLAGS -Wstrict-prototypes" esac ;; yesno) # gcc without OpenSSL CFLAGS="$SAVED_CFLAGS -Wstrict-prototypes" esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking type of socklen arg for getsockname()" >&5 $as_echo_n "checking type of socklen arg for getsockname()... " >&6; } if ${ntp_cv_getsockname_socklen_type+:} false; then : $as_echo_n "(cached) " >&6 else getsockname_socklen_type_found=no for getsockname_arg2 in 'struct sockaddr *' 'void *'; do for ntp_cv_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif int main () { extern getsockname(int, $getsockname_arg2, $ntp_cv_getsockname_socklen_type *); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : getsockname_socklen_type_found=yes ; break 2 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done case "$getsockname_socklen_type_found" in no) ntp_cv_getsockname_socklen_type='socklen_t' esac { getsockname_arg2=; unset getsockname_arg2;} { getsockname_socklen_type_found=; unset getsockname_socklen_type_found;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_getsockname_socklen_type" >&5 $as_echo "$ntp_cv_getsockname_socklen_type" >&6; } cat >>confdefs.h <<_ACEOF #define GETSOCKNAME_SOCKLEN_TYPE $ntp_cv_getsockname_socklen_type _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5 $as_echo_n "checking for struct sockaddr_storage... " >&6; } if ${ntp_cv_sockaddr_storage+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif int main () { struct sockaddr_storage n; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ntp_cv_sockaddr_storage=yes else ntp_cv_sockaddr_storage=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_sockaddr_storage" >&5 $as_echo "$ntp_cv_sockaddr_storage" >&6; } case "$ntp_cv_sockaddr_storage" in yes) $as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.ss_family" >&5 $as_echo_n "checking for sockaddr_storage.ss_family... " >&6; } if ${ntp_cv_have_ss_family+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif int main () { struct sockaddr_storage s; s.ss_family = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ntp_cv_have_ss_family=yes else ntp_cv_have_ss_family=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have_ss_family" >&5 $as_echo "$ntp_cv_have_ss_family" >&6; } case "$ntp_cv_have_ss_family" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.__ss_family" >&5 $as_echo_n "checking for sockaddr_storage.__ss_family... " >&6; } if ${ntp_cv_have___ss_family+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif int main () { struct sockaddr_storage s; s.__ss_family = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ntp_cv_have___ss_family=yes else ntp_cv_have___ss_family=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have___ss_family" >&5 $as_echo "$ntp_cv_have___ss_family" >&6; } case "$ntp_cv_have___ss_family" in yes) $as_echo "#define HAVE___SS_FAMILY_IN_SS 1" >>confdefs.h esac esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.ss_len" >&5 $as_echo_n "checking for sockaddr_storage.ss_len... " >&6; } if ${ntp_cv_have_ss_len+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif int main () { struct sockaddr_storage s; s.ss_len = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ntp_cv_have_ss_len=yes else ntp_cv_have_ss_len=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have_ss_len" >&5 $as_echo "$ntp_cv_have_ss_len" >&6; } case "$ntp_cv_have_ss_len" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.__ss_len" >&5 $as_echo_n "checking for sockaddr_storage.__ss_len... " >&6; } if ${ntp_cv_have___ss_len+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif int main () { struct sockaddr_storage s; s.__ss_len = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ntp_cv_have___ss_len=yes else ntp_cv_have___ss_len=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have___ss_len" >&5 $as_echo "$ntp_cv_have___ss_len" >&6; } case "$ntp_cv_have___ss_len" in yes) $as_echo "#define HAVE___SS_LEN_IN_SS 1" >>confdefs.h esac esac # # Look for in_port_t. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_port_t" >&5 $as_echo_n "checking for in_port_t... " >&6; } if ${isc_cv_have_in_port_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { in_port_t port = 25; return (0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : isc_cv_have_in_port_t=yes else isc_cv_have_in_port_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in_port_t" >&5 $as_echo "$isc_cv_have_in_port_t" >&6; } case "$isc_cv_have_in_port_t" in no) $as_echo "#define ISC_PLATFORM_NEEDPORTT 1" >>confdefs.h esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multicast IP support" >&5 $as_echo_n "checking for multicast IP support... " >&6; } if ${ntp_cv_multicast+:} false; then : $as_echo_n "(cached) " >&6 else ntp_cv_multicast=no case "$host" in i386-sequent-sysv4) ;; *) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_NETINET_IN_H #include #endif int main () { struct ip_mreq ipmr; ipmr.imr_interface.s_addr = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ntp_cv_multicast=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_multicast" >&5 $as_echo "$ntp_cv_multicast" >&6; } case "$ntp_cv_multicast" in yes) $as_echo "#define MCAST 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking arg type needed for setsockopt() IP*_MULTICAST_LOOP" >&5 $as_echo_n "checking arg type needed for setsockopt() IP*_MULTICAST_LOOP... " >&6; } if ${ntp_cv_typeof_ip_multicast_loop+:} false; then : $as_echo_n "(cached) " >&6 else case "$host" in *-*-netbsd*|*-*-*linux*) ntp_cv_typeof_ip_multicast_loop=u_int ;; *) ntp_cv_typeof_ip_multicast_loop=u_char esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_typeof_ip_multicast_loop" >&5 $as_echo "$ntp_cv_typeof_ip_multicast_loop" >&6; } cat >>confdefs.h <<_ACEOF #define TYPEOF_IP_MULTICAST_LOOP $ntp_cv_typeof_ip_multicast_loop _ACEOF esac # HMS: We don't need res_init, but since we may be using cached # values from ntpd we need to test the same way { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_init" >&5 $as_echo_n "checking for library containing res_init... " >&6; } if ${ac_cv_search_res_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 res_init (); int main () { return res_init (); ; return 0; } _ACEOF for ac_lib in '' resolv; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib -lsocket -lnsl $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_res_init=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_res_init+:} false; then : break fi done if ${ac_cv_search_res_init+:} false; then : else ac_cv_search_res_init=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_init" >&5 $as_echo "$ac_cv_search_res_init" >&6; } ac_res=$ac_cv_search_res_init if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 $as_echo_n "checking for library containing inet_ntop... " >&6; } if ${ac_cv_search_inet_ntop+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 inet_ntop (); int main () { return inet_ntop (); ; return 0; } _ACEOF for ac_lib in '' resolv; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib -lsocket -lnsl $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_inet_ntop=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_ntop+:} false; then : break fi done if ${ac_cv_search_inet_ntop+:} false; then : else ac_cv_search_inet_ntop=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 $as_echo "$ac_cv_search_inet_ntop" >&6; } ac_res=$ac_cv_search_inet_ntop if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" if test "x$ac_cv_func_inet_ntop" = xyes; then : else $as_echo "#define ISC_PLATFORM_NEEDNTOP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" if test "x$ac_cv_func_inet_pton" = xyes; then : else $as_echo "#define ISC_PLATFORM_NEEDPTON 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr for sa_len" >&5 $as_echo_n "checking struct sockaddr for sa_len... " >&6; } if ${isc_cv_platform_havesalen+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { extern struct sockaddr *ps; return ps->sa_len; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : isc_cv_platform_havesalen=yes else isc_cv_platform_havesalen=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_platform_havesalen" >&5 $as_echo "$isc_cv_platform_havesalen" >&6; } case "$isc_cv_platform_havesalen" in yes) $as_echo "#define ISC_PLATFORM_HAVESALEN 1" >>confdefs.h esac # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then : enableval=$enable_ipv6; fi case "$enable_ipv6" in yes|''|autodetect) case "$host" in powerpc-ibm-aix4*) ;; *) $as_echo "#define WANT_IPV6 1" >>confdefs.h ;; esac ;; no) ;; esac case "$host" in *-*-darwin*) $as_echo "#define __APPLE_USE_RFC_3542 1" >>confdefs.h esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 structures" >&5 $as_echo_n "checking for IPv6 structures... " >&6; } if ${isc_cv_found_ipv6+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { struct sockaddr_in6 sin6; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : isc_cv_found_ipv6=yes else isc_cv_found_ipv6=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_found_ipv6" >&5 $as_echo "$isc_cv_found_ipv6" >&6; } # # See whether IPv6 support is provided via a Kame add-on. # This is done before other IPv6 linking tests so LIBS is properly set. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kame IPv6 support" >&5 $as_echo_n "checking for Kame IPv6 support... " >&6; } # Check whether --with-kame was given. if test "${with_kame+set}" = set; then : withval=$with_kame; use_kame="$withval" else use_kame="no" fi case "$use_kame" in no) ;; yes) kame_path=/usr/local/v6 ;; *) kame_path="$use_kame" ;; esac case "$use_kame" in no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; *) if test -f $kame_path/lib/libinet6.a; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kame_path/lib/libinet6.a" >&5 $as_echo "$kame_path/lib/libinet6.a" >&6; } LIBS="-L$kame_path/lib -linet6 $LIBS" else as_fn_error $? "$kame_path/lib/libinet6.a not found. Please choose the proper path with the following command: configure --with-kame=PATH " "$LINENO" 5 fi ;; esac # # Whether netinet6/in6.h is needed has to be defined in isc/platform.h. # Including it on Kame-using platforms is very bad, though, because # Kame uses #error against direct inclusion. So include it on only # the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1. # This is done before the in6_pktinfo check because that's what # netinet6/in6.h is needed for. # case "$host" in *-bsdi4.[01]*) $as_echo "#define ISC_PLATFORM_NEEDNETINET6IN6H 1" >>confdefs.h isc_netinet6in6_hack="#include " ;; *) isc_netinet6in6_hack="" ;; esac # # This is similar to the netinet6/in6.h issue. # case "$host" in *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*) $as_echo "#define ISC_PLATFORM_FIXIN6ISADDR 1" >>confdefs.h isc_netinetin6_hack="#include " ;; *) isc_netinetin6_hack="" ;; esac case "$isc_cv_found_ipv6" in yes) $as_echo "#define ISC_PLATFORM_HAVEIPV6 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6_pktinfo" >&5 $as_echo_n "checking for in6_pktinfo... " >&6; } if ${isc_cv_have_in6_pktinfo+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include $isc_netinetin6_hack $isc_netinet6in6_hack int main () { struct in6_pktinfo xyzzy; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : isc_cv_have_in6_pktinfo=yes else isc_cv_have_in6_pktinfo=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in6_pktinfo" >&5 $as_echo "$isc_cv_have_in6_pktinfo" >&6; } case "$isc_cv_have_in6_pktinfo" in yes) $as_echo "#define ISC_PLATFORM_HAVEIN6PKTINFO 1" >>confdefs.h esac # HMS: Use HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead? { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_in6.sin6_scope_id" >&5 $as_echo_n "checking for sockaddr_in6.sin6_scope_id... " >&6; } if ${isc_cv_have_sin6_scope_id+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include $isc_netinetin6_hack $isc_netinet6in6_hack int main () { struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : isc_cv_have_sin6_scope_id=yes else isc_cv_have_sin6_scope_id=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_sin6_scope_id" >&5 $as_echo "$isc_cv_have_sin6_scope_id" >&6; } case "$isc_cv_have_sin6_scope_id" in yes) $as_echo "#define ISC_PLATFORM_HAVESCOPEID 1" >>confdefs.h esac esac # We need this check run even without isc_cv_found_ipv6=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6addr_any" >&5 $as_echo_n "checking for in6addr_any... " >&6; } if ${isc_cv_have_in6addr_any+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include $isc_netinetin6_hack $isc_netinet6in6_hack int main () { struct in6_addr in6; in6 = in6addr_any; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : isc_cv_have_in6addr_any=yes else isc_cv_have_in6addr_any=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: $isc_cv_have_in6addr_any" >&5 $as_echo "$isc_cv_have_in6addr_any" >&6; } case "$isc_cv_have_in6addr_any" in no) $as_echo "#define ISC_PLATFORM_NEEDIN6ADDRANY 1" >>confdefs.h esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrconf" >&5 $as_echo_n "checking for struct if_laddrconf... " >&6; } if ${isc_cv_struct_if_laddrconf+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct if_laddrconf a; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : isc_cv_struct_if_laddrconf=yes else isc_cv_struct_if_laddrconf=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_struct_if_laddrconf" >&5 $as_echo "$isc_cv_struct_if_laddrconf" >&6; } case "$isc_cv_struct_if_laddrconf" in yes) $as_echo "#define ISC_PLATFORM_HAVEIF_LADDRCONF 1" >>confdefs.h esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrreq" >&5 $as_echo_n "checking for struct if_laddrreq... " >&6; } if ${isc_cv_struct_if_laddrreq+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct if_laddrreq a; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : isc_cv_struct_if_laddrreq=yes else isc_cv_struct_if_laddrreq=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_struct_if_laddrreq" >&5 $as_echo "$isc_cv_struct_if_laddrreq" >&6; } case "$isc_cv_struct_if_laddrreq" in yes) $as_echo "#define ISC_PLATFORM_HAVEIF_LADDRREQ 1" >>confdefs.h esac ### # Hacks # these need work if we're to move libntp under sntp $as_echo "#define HAVE_NO_NICE 1" >>confdefs.h $as_echo "#define HAVE_TERMIOS 1" >>confdefs.h # Checks for library functions. for ac_func in socket vsnprintf vsprintf 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bin subdirectory" >&5 $as_echo_n "checking for bin subdirectory... " >&6; } # Check whether --with-binsubdir was given. if test "${with_binsubdir+set}" = set; then : withval=$with_binsubdir; use_binsubdir="$withval" else use_binsubdir="bin" fi case "$use_binsubdir" in bin) ;; sbin) ;; *) as_fn_error $? "<$use_binsubdir> is illegal - must be \"bin\" or \"sbin\"" "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_binsubdir" >&5 $as_echo "$use_binsubdir" >&6; } BINSUBDIR=$use_binsubdir if test "bin" = "$BINSUBDIR"; then NTP_BINSUBDIR_IS_BIN_TRUE= NTP_BINSUBDIR_IS_BIN_FALSE='#' else NTP_BINSUBDIR_IS_BIN_TRUE='#' NTP_BINSUBDIR_IS_BIN_FALSE= fi ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi 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 "${INSTALL_LIBOPTS_TRUE}" && test -z "${INSTALL_LIBOPTS_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LIBOPTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${NEED_LIBOPTS_TRUE}" && test -z "${NEED_LIBOPTS_FALSE}"; then as_fn_error $? "conditional \"NEED_LIBOPTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${NTP_BINSUBDIR_IS_BIN_TRUE}" && test -z "${NTP_BINSUBDIR_IS_BIN_FALSE}"; then as_fn_error $? "conditional \"NTP_BINSUBDIR_IS_BIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # 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.6p5, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _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.6p5 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libopts/Makefile") CONFIG_FILES="$CONFIG_FILES libopts/Makefile" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ntp-4.2.6p5/sntp/utilities.c0000644000175000017500000000630211505336022014752 0ustar peterpeter#include #include "utilities.h" #include /* Display a NTP packet in hex with leading address offset * e.g. offset: value, 0: ff 1: fe ... 255: 00 */ void pkt_output ( struct pkt *dpkg, int pkt_length, FILE *output ) { register int a; u_char *pkt; pkt = (u_char *)dpkg; fprintf(output, HLINE); for (a = 0; a < pkt_length; a++) { if (a > 0 && a % 8 == 0) fprintf(output, "\n"); fprintf(output, "%d: %x \t", a, pkt[a]); } fprintf(output, "\n"); fprintf(output, HLINE); } /* Output a long floating point value in hex in the style described above */ void l_fp_output ( l_fp *ts, FILE *output ) { register int a; fprintf(output, HLINE); for(a=0; a<8; a++) fprintf(output, "%i: %x \t", a, ((unsigned char *) ts)[a]); fprintf(output, "\n"); fprintf(output, HLINE); } /* Output a long floating point value in binary in the style described above */ void l_fp_output_bin ( l_fp *ts, FILE *output ) { register int a, b; fprintf(output, HLINE); for(a=0; a<8; a++) { short tmp = ((unsigned char *) ts)[a]; tmp++; fprintf(output, "%i: ", a); for(b=7; b>=0; b--) { int texp = (int) pow(2, b); if(tmp - texp > 0) { fprintf(output, "1"); tmp -= texp; } else { fprintf(output, "0"); } } fprintf(output, " "); } fprintf(output, "\n"); fprintf(output, HLINE); } /* Output a long floating point value in decimal in the style described above */ void l_fp_output_dec ( l_fp *ts, FILE *output ) { register int a; fprintf(output, HLINE); for(a=0; a<8; a++) fprintf(output, "%i: %i \t", a, ((unsigned char *) ts)[a]); fprintf(output, "\n"); fprintf(output, HLINE); } /* Convert a struct addrinfo to a string containing the address in style * of inet_ntoa */ char * addrinfo_to_str ( struct addrinfo *addr ) { sockaddr_u s; memset(&s, 0, sizeof(s)); memcpy(&s, addr->ai_addr, min(sizeof(s), addr->ai_addrlen)); return ss_to_str(&s); } /* Convert a sockaddr_u to a string containing the address in * style of inet_ntoa * Why not switch callers to use stoa from libntp? No free() needed * in that case. */ char * ss_to_str ( sockaddr_u *saddr ) { char * buf; buf = emalloc(INET6_ADDRSTRLEN); strncpy(buf, stoa(saddr), INET6_ADDRSTRLEN); return buf; } /* * Converts a struct tv to a date string */ char * tv_to_str( const struct timeval *tv ) { const size_t bufsize = 48; char *buf; time_t gmt_time, local_time; struct tm *p_tm_local; int hh, mm, lto; /* * convert to struct tm in UTC, then intentionally feed * that tm to mktime() which expects local time input, to * derive the offset from UTC to local time. */ gmt_time = tv->tv_sec; local_time = mktime(gmtime(&gmt_time)); p_tm_local = localtime(&gmt_time); /* Local timezone offsets should never cause an overflow. Yeah. */ lto = difftime(local_time, gmt_time); lto /= 60; hh = lto / 60; mm = abs(lto % 60); buf = emalloc(bufsize); snprintf(buf, bufsize, "%d-%.2d-%.2d %.2d:%.2d:%.2d.%.6d (%+03d%02d)", p_tm_local->tm_year + 1900, p_tm_local->tm_mon + 1, p_tm_local->tm_mday, p_tm_local->tm_hour, p_tm_local->tm_min, p_tm_local->tm_sec, (int)tv->tv_usec, hh, mm); return buf; } ntp-4.2.6p5/sntp/version.texi0000644000175000017500000000011011675460540015155 0ustar peterpeter@set UPDATED 24 December 2011 @set EDITION 4.2.6p5 @set VERSION 4.2.6p5 ntp-4.2.6p5/sntp/install-sh0000755000175000017500000002202110377564116014610 0ustar peterpeter#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ntp-4.2.6p5/sntp/configure.ac0000644000175000017500000005013311636775105015100 0ustar peterpeter# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. m4_include([../version.m4]) AC_PREREQ([2.61]) AC_INIT([sntp], [VERSION_NUMBER]) AC_CONFIG_MACRO_DIR([../m4]) AC_CONFIG_AUX_DIR([.]) # Increment sntp_configure_cache_version by one for each change to # configure.ac or .m4 files which invalidates cached values from # previous versions. # # If the change affects cache variables used only by the main NTP # configure.ac, then only its version number should be bumped, while # the subdir configure.ac version numbers should be unchanged. The # same is true for a test/variable that is used only by one subdir # being changed incompatibly; only that subdir's cache version needs # bumping. # # If a change affects variables shared by all NTP configure scripts, # please bump the version numbers of all three. If you are not sure, # the safe choice is to bump all three on any cache-invalidating change. # # In order to avoid the risk of version stamp collision between -stable # and -dev branches, do not simply increment the version, instead use # the date YYYYMMDD optionally with -HHMM if there is more than one # bump in a day. sntp_configure_cache_version=20091117 # When the version of config.cache and configure do not # match, NTP_CACHEVERSION will flush the cache. NTP_CACHEVERSION([sntp], [$sntp_configure_cache_version]) AM_INIT_AUTOMAKE AC_CANONICAL_BUILD AC_CANONICAL_HOST dnl the 'build' machine is where we run configure and compile dnl the 'host' machine is where the resulting stuff runs. AC_DEFINE_UNQUOTED([STR_SYSTEM], "$host", [canonical system (cpu-vendor-os) of where we should run]) AC_CONFIG_HEADER([config.h]) dnl AC_ARG_PROGRAM # Checks for programs. AM_PROG_CC_C_O AC_PROG_CPP # AC_PROG_CC_STDC has two functions. It attempts to find a compiler # capable of C99, or failing that, for C89. CC is set afterward with # the selected invocation, such as "gcc --std=gnu99". Also, the # ac_cv_prog_cc_stdc variable is no if the compiler selected for CC # does not accept C89. AC_PROG_CC_STDC case "$ac_cv_prog_cc_stdc" in no) AC_MSG_WARN([ANSI C89/ISO C90 is the minimum to compile SNTP ] [version 4.2.5 and higher.]) esac AC_CACHE_CHECK( [if $CC can handle @%:@warning], [ntp_cv_cpp_warning], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[]], [[#warning foo]])], [ntp_cv_cpp_warning=yes], [ntp_cv_cpp_warning=no] )] ) case "$ntp_cv_cpp_warning" in no) AC_DEFINE([NO_OPTION_NAME_WARNINGS], [1], [Should we avoid @%:@warning on option name collisions?]) esac case "$GCC" in yes) SAVED_CFLAGS_NTP="$CFLAGS" CFLAGS="$CFLAGS -Wstrict-overflow" AC_CACHE_CHECK( [if $CC can handle -Wstrict-overflow], [ntp_cv_gcc_Wstrict_overflow], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[]], [[]])], [ntp_cv_gcc_Wstrict_overflow=yes], [ntp_cv_gcc_Wstrict_overflow=no] ) ] ) # # $ntp_cv_gcc_Wstrict_overflow is tested later to add the # flag to CFLAGS. # CFLAGS="$SAVED_CFLAGS_NTP -Winit-self" AC_CACHE_CHECK( [if $CC can handle -Winit-self], [ntp_cv_gcc_Winit_self], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[]], [[]])], [ntp_cv_gcc_Winit_self=yes], [ntp_cv_gcc_Winit_self=no] ) ] ) CFLAGS="$SAVED_CFLAGS_NTP" AS_UNSET([SAVED_CFLAGS_NTP]) # # $ntp_cv_gcc_Winit_self is tested later to add the # flag to CFLAGS. # esac # HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS case "$host" in *-*-solaris*) # see "man standards". # -D_XOPEN_SOURCE=500 is probably OK for c89 and before # -D_XOPEN_SOURCE=600 seems OK for c99 #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__" CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" libxnet=-lxnet ;; esac AC_DISABLE_SHARED # NTP has (so far) been relying on leading-edge autogen. # Therefore, by default: # - use the version we ship with # - do not install it # - build a static copy (AC_DISABLE_SHARED - done earlier) case "${enable_local_libopts+set}" in set) ;; *) enable_local_libopts=yes ;; esac case "${enable_libopts_install+set}" in set) ;; *) enable_libopts_install=no ;; esac LIBOPTS_CHECK AC_PROG_LIBTOOL NTP_DIR_SEP # Checks for libraries. NTP_LIB_M case "$GCC" in yes) CFLAGS="$CFLAGS -Wall" # CFLAGS="$CFLAGS -Wcast-align" CFLAGS="$CFLAGS -Wcast-qual" # CFLAGS="$CFLAGS -Wconversion" # CFLAGS="$CFLAGS -Werror" # CFLAGS="$CFLAGS -Wextra" # CFLAGS="$CFLAGS -Wfloat-equal" CFLAGS="$CFLAGS -Wmissing-prototypes" CFLAGS="$CFLAGS -Wpointer-arith" CFLAGS="$CFLAGS -Wshadow" # CFLAGS="$CFLAGS -Wtraditional" # CFLAGS="$CFLAGS -Wwrite-strings" case "$ntp_cv_gcc_Winit_self" in yes) CFLAGS="$CFLAGS -Winit-self" esac case "$ntp_cv_gcc_Wstrict_overflow" in yes) CFLAGS="$CFLAGS -Wstrict-overflow" esac # -W[no-]strict-prototypes is added later depending on OpenSSL esac AC_CHECK_FUNC([gethostent], , [AC_SEARCH_LIBS([gethostent], [nsl], , , [$libxnet -lsocket])]) AC_CHECK_FUNC([openlog], , [AC_SEARCH_LIBS([openlog], [gen], , [AC_SEARCH_LIBS([openlog], [syslog], , , [$libxnet -lsocket])])]) AC_SEARCH_LIBS([setsockopt], [socket xnet]) # Checks for header files. AC_HEADER_STDC dnl HP-UX 11.31 on HPPA has a net/if.h that can't be compiled with gcc4 dnl due to an incomplete type (a union) mpinfou used in an array. gcc3 dnl compiles it without complaint. The mpinfou union is defined later dnl in the resulting preprocessed source than the spu_info array in dnl /usr/include/machine/sys/getppdp.h: dnl extern union mpinfou spu_info[]; dnl triggering the error. Our strategy is on HP-UX only, test for dnl net/netmp.h, which is the file included by net/if.h that leads to dnl getppdp.h. If it is present but can't be compiled, try adding dnl a duplicate definition of mpinfou, which should then allow the dnl following net/if.h and net/if6.h tests to proceed normally. dnl Using net/netmp.h allows us to avoid polluting test results for dnl net/if.h. # case "$host" in *-hp-hpux*) AC_CHECK_HEADERS( [net/netmp.h], [netmp_h_works=yes], [netmp_h_works=no] ) case "$netmp_h_works" in no) cat >>confdefs.h <<_ACEOF #ifndef MPINFOU_PREDECLARED # define MPINFOU_PREDECLARED typedef union mpinfou { /* For lint */ struct pdk_mpinfo *pdkptr; struct mpinfo *pikptr; } mpinfou_t; #endif _ACEOF AH_BOTTOM([ #ifndef MPINFOU_PREDECLARED # define MPINFOU_PREDECLARED typedef union mpinfou { /* For lint */ struct pdk_mpinfo *pdkptr; struct mpinfo *pikptr; } mpinfou_t; #endif ]) ;; esac ;; esac AC_CHECK_HEADERS([netdb.h netinet/in.h stdlib.h string.h strings.h syslog.h]) AC_CHECK_HEADERS([sys/socket.h sys/time.h]) AC_HEADER_TIME # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_TYPE_SIZE_T AC_CHECK_SIZEOF([time_t]) AC_C_INLINE case "$ac_cv_c_inline" in '') ;; *) AC_DEFINE(HAVE_INLINE,1,[inline keyword or macro available]) AC_SUBST(HAVE_INLINE) esac AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE? AC_CHECK_SIZEOF([signed char]) AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([long]) AC_CHECK_TYPES([s_char]) case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in *yes) # We have a typedef for s_char. Might as well believe it... ;; no0no) # We have signed chars, can't say 'signed char', no s_char typedef. AC_DEFINE([NEED_S_CHAR_TYPEDEF], 1, [Do we need an s_char typedef?]) ;; no1no) # We have signed chars, can say 'signed char', no s_char typedef. AC_DEFINE([NEED_S_CHAR_TYPEDEF]) ;; yes0no) # We have unsigned chars, can't say 'signed char', no s_char typedef. AC_MSG_ERROR([No way to specify a signed character!]) ;; yes1no) # We have unsigned chars, can say 'signed char', no s_char typedef. AC_DEFINE([NEED_S_CHAR_TYPEDEF]) ;; esac AC_TYPE_UID_T NTP_OPENSSL AC_CACHE_CHECK( [type of socklen arg for getsockname()], [ntp_cv_getsockname_socklen_type], [ getsockname_socklen_type_found=no for getsockname_arg2 in 'struct sockaddr *' 'void *'; do for ntp_cv_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif ]], [[ extern getsockname(int, $getsockname_arg2, $ntp_cv_getsockname_socklen_type *); ]] )], [getsockname_socklen_type_found=yes ; break 2], [] ) done done case "$getsockname_socklen_type_found" in no) ntp_cv_getsockname_socklen_type='socklen_t' esac AS_UNSET([getsockname_arg2]) AS_UNSET([getsockname_socklen_type_found]) ] ) AC_DEFINE_UNQUOTED([GETSOCKNAME_SOCKLEN_TYPE], $ntp_cv_getsockname_socklen_type, [What is getsockname()'s socklen type?]) AC_CACHE_CHECK( [for struct sockaddr_storage], [ntp_cv_sockaddr_storage], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif ]], [[ struct sockaddr_storage n; ]] )], [ntp_cv_sockaddr_storage=yes], [ntp_cv_sockaddr_storage=no] )] ) case "$ntp_cv_sockaddr_storage" in yes) AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], [1], [Does a system header define struct sockaddr_storage?]) esac AC_CACHE_CHECK( [for sockaddr_storage.ss_family], [ntp_cv_have_ss_family], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]] )], [ntp_cv_have_ss_family=yes], [ntp_cv_have_ss_family=no] )] ) case "$ntp_cv_have_ss_family" in no) AC_CACHE_CHECK( [for sockaddr_storage.__ss_family], [ntp_cv_have___ss_family], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif ]], [[ struct sockaddr_storage s; s.__ss_family = 1; ]] )], [ntp_cv_have___ss_family=yes], [ntp_cv_have___ss_family=no] )] ) case "$ntp_cv_have___ss_family" in yes) AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1], [Does struct sockaddr_storage have __ss_family?]) esac esac AH_VERBATIM( [HAVE___SS_FAMILY_IN_SS_VERBATIM], [ /* Handle sockaddr_storage.__ss_family */ #ifdef HAVE___SS_FAMILY_IN_SS # define ss_family __ss_family #endif /* HAVE___SS_FAMILY_IN_SS */ ] ) AC_CACHE_CHECK( [for sockaddr_storage.ss_len], [ntp_cv_have_ss_len], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif ]], [[ struct sockaddr_storage s; s.ss_len = 1; ]] )], [ntp_cv_have_ss_len=yes], [ntp_cv_have_ss_len=no] )] ) case "$ntp_cv_have_ss_len" in no) AC_CACHE_CHECK( [for sockaddr_storage.__ss_len], [ntp_cv_have___ss_len], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif ]], [[ struct sockaddr_storage s; s.__ss_len = 1; ]] )], [ntp_cv_have___ss_len=yes], [ntp_cv_have___ss_len=no] )] ) case "$ntp_cv_have___ss_len" in yes) AC_DEFINE([HAVE___SS_LEN_IN_SS], [1], [Does struct sockaddr_storage have __ss_len?]) esac esac AH_VERBATIM( [HAVE___SS_LEN_IN_SS_VERBATIM], [ /* Handle sockaddr_storage.__ss_len */ #ifdef HAVE___SS_LEN_IN_SS # define ss_len __ss_len #endif /* HAVE___SS_LEN_IN_SS */ ] ) # # Look for in_port_t. # AC_CACHE_CHECK( [for in_port_t], [isc_cv_have_in_port_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[ in_port_t port = 25; return (0); ]] )], [isc_cv_have_in_port_t=yes], [isc_cv_have_in_port_t=no] )] ) case "$isc_cv_have_in_port_t" in no) AC_DEFINE([ISC_PLATFORM_NEEDPORTT], [1], [Declare in_port_t?]) esac AC_CACHE_CHECK( [for multicast IP support], [ntp_cv_multicast], [ ntp_cv_multicast=no case "$host" in i386-sequent-sysv4) ;; *) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #ifdef HAVE_NETINET_IN_H #include #endif ]], [[ struct ip_mreq ipmr; ipmr.imr_interface.s_addr = 0; ]] )], [ntp_cv_multicast=yes], [] ) esac ] ) case "$ntp_cv_multicast" in yes) AC_DEFINE([MCAST], [1], [Does the target support multicast IP?]) AC_CACHE_CHECK( [arg type needed for setsockopt() IP*_MULTICAST_LOOP], [ntp_cv_typeof_ip_multicast_loop], [ case "$host" in *-*-netbsd*|*-*-*linux*) ntp_cv_typeof_ip_multicast_loop=u_int ;; *) ntp_cv_typeof_ip_multicast_loop=u_char esac ] ) AC_DEFINE_UNQUOTED([TYPEOF_IP_MULTICAST_LOOP], $ntp_cv_typeof_ip_multicast_loop, [What type to use for setsockopt]) esac # HMS: We don't need res_init, but since we may be using cached # values from ntpd we need to test the same way AC_SEARCH_LIBS([res_init], [resolv], , , [-lsocket -lnsl]) AC_SEARCH_LIBS([inet_ntop], [resolv], , , [-lsocket -lnsl]) AC_CHECK_FUNC([inet_ntop], [], [AC_DEFINE([ISC_PLATFORM_NEEDNTOP], [1], [ISC: provide inet_ntop()])]) AC_CHECK_FUNC([inet_pton], [], [AC_DEFINE([ISC_PLATFORM_NEEDPTON], [1], [ISC: provide inet_pton()])]) AC_CACHE_CHECK( [struct sockaddr for sa_len], [isc_cv_platform_havesalen], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[ extern struct sockaddr *ps; return ps->sa_len; ]] )], [isc_cv_platform_havesalen=yes], [isc_cv_platform_havesalen=no] )] ) case "$isc_cv_platform_havesalen" in yes) AC_DEFINE([ISC_PLATFORM_HAVESALEN], [1], [struct sockaddr has sa_len?]) esac AC_ARG_ENABLE( [ipv6], [AS_HELP_STRING( [--enable-ipv6], [s use IPv6?] )] ) case "$enable_ipv6" in yes|''|autodetect) case "$host" in powerpc-ibm-aix4*) ;; *) AC_DEFINE([WANT_IPV6], [1], [configure --enable-ipv6]) ;; esac ;; no) ;; esac dnl [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion) case "$host" in *-*-darwin*) AC_DEFINE([__APPLE_USE_RFC_3542], [1], [Are we _special_?]) esac AC_CACHE_CHECK( [for IPv6 structures], [isc_cv_found_ipv6], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #include ]], [[ struct sockaddr_in6 sin6; ]] )], [isc_cv_found_ipv6=yes], [isc_cv_found_ipv6=no] )] ) # # See whether IPv6 support is provided via a Kame add-on. # This is done before other IPv6 linking tests so LIBS is properly set. # AC_MSG_CHECKING([for Kame IPv6 support]) AC_ARG_WITH( [kame], [AS_HELP_STRING( [--with-kame], [- =/usr/local/v6] )], [use_kame="$withval"], [use_kame="no"] ) case "$use_kame" in no) ;; yes) kame_path=/usr/local/v6 ;; *) kame_path="$use_kame" ;; esac case "$use_kame" in no) AC_MSG_RESULT([no]) ;; *) if test -f $kame_path/lib/libinet6.a; then AC_MSG_RESULT([$kame_path/lib/libinet6.a]) LIBS="-L$kame_path/lib -linet6 $LIBS" else AC_MSG_ERROR([$kame_path/lib/libinet6.a not found. Please choose the proper path with the following command: configure --with-kame=PATH ]) fi ;; esac # # Whether netinet6/in6.h is needed has to be defined in isc/platform.h. # Including it on Kame-using platforms is very bad, though, because # Kame uses #error against direct inclusion. So include it on only # the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1. # This is done before the in6_pktinfo check because that's what # netinet6/in6.h is needed for. # case "$host" in *-bsdi4.[[01]]*) AC_DEFINE([ISC_PLATFORM_NEEDNETINET6IN6H], [1], [Do we need netinet6/in6.h?]) isc_netinet6in6_hack="#include " ;; *) isc_netinet6in6_hack="" ;; esac # # This is similar to the netinet6/in6.h issue. # case "$host" in *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*) AC_DEFINE([ISC_PLATFORM_FIXIN6ISADDR], [1], [Do we need to fix in6isaddr?]) isc_netinetin6_hack="#include " ;; *) isc_netinetin6_hack="" ;; esac case "$isc_cv_found_ipv6" in yes) AC_DEFINE([ISC_PLATFORM_HAVEIPV6], [1], [have IPv6?]) AC_CACHE_CHECK( [for in6_pktinfo], [isc_cv_have_in6_pktinfo], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #include $isc_netinetin6_hack $isc_netinet6in6_hack ]], [[ struct in6_pktinfo xyzzy; ]] )], [isc_cv_have_in6_pktinfo=yes], [isc_cv_have_in6_pktinfo=no] )] ) case "$isc_cv_have_in6_pktinfo" in yes) AC_DEFINE([ISC_PLATFORM_HAVEIN6PKTINFO], [1], [have struct in6_pktinfo?]) esac # HMS: Use HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead? AC_CACHE_CHECK( [for sockaddr_in6.sin6_scope_id], [isc_cv_have_sin6_scope_id], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #include $isc_netinetin6_hack $isc_netinet6in6_hack ]], [[ struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; ]] )], [isc_cv_have_sin6_scope_id=yes], [isc_cv_have_sin6_scope_id=no] )] ) case "$isc_cv_have_sin6_scope_id" in yes) AC_DEFINE([ISC_PLATFORM_HAVESCOPEID], [1], [sin6_scope_id?]) esac esac # We need this check run even without isc_cv_found_ipv6=yes AC_CACHE_CHECK( [for in6addr_any], [isc_cv_have_in6addr_any], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #include $isc_netinetin6_hack $isc_netinet6in6_hack ]], [[ struct in6_addr in6; in6 = in6addr_any; ]] )], [isc_cv_have_in6addr_any=yes], [isc_cv_have_in6addr_any=no] )] ) case "$isc_cv_have_in6addr_any" in no) AC_DEFINE([ISC_PLATFORM_NEEDIN6ADDRANY], [1], [missing in6addr_any?]) esac AC_CACHE_CHECK( [for struct if_laddrconf], [isc_cv_struct_if_laddrconf], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[ struct if_laddrconf a; ]] )], [isc_cv_struct_if_laddrconf=yes], [isc_cv_struct_if_laddrconf=no] )] ) case "$isc_cv_struct_if_laddrconf" in yes) AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRCONF], [1], [have struct if_laddrconf?]) esac AC_CACHE_CHECK( [for struct if_laddrreq], isc_cv_struct_if_laddrreq, [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[ struct if_laddrreq a; ]] )], [isc_cv_struct_if_laddrreq=yes], [isc_cv_struct_if_laddrreq=no] )] ) case "$isc_cv_struct_if_laddrreq" in yes) AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRREQ], [1], [have struct if_laddrreq?]) esac ### # Hacks # these need work if we're to move libntp under sntp AC_DEFINE([HAVE_NO_NICE], 1, [sntp does not care about 'nice']) AC_DEFINE([HAVE_TERMIOS], 1, [sntp does not care about TTY stuff]) # Checks for library functions. AC_CHECK_FUNCS([socket vsnprintf vsprintf]) AC_MSG_CHECKING([for bin subdirectory]) AC_ARG_WITH( [binsubdir], [AS_HELP_STRING( [--with-binsubdir], [bin ={bin,sbin}] )], [use_binsubdir="$withval"], [use_binsubdir="bin"] ) case "$use_binsubdir" in bin) ;; sbin) ;; *) AC_MSG_ERROR([<$use_binsubdir> is illegal - must be "bin" or "sbin"]) ;; esac AC_MSG_RESULT([$use_binsubdir]) BINSUBDIR=$use_binsubdir AC_SUBST([BINSUBDIR]) AM_CONDITIONAL([NTP_BINSUBDIR_IS_BIN], [test "bin" = "$BINSUBDIR"]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT ntp-4.2.6p5/sntp/depsver.mf0000644000175000017500000000460511675457724014620 0ustar peterpeter$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ chmod ug+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ $(MAKE) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ mkdir $(DEPDIR) && \ case "$(top_builddir)" in \ .) \ ./config.status Makefile depfiles \ ;; \ ..) \ cd .. && \ ./config.status $(subdir)/Makefile depfiles && \ cd $(subdir) \ ;; \ *) \ echo 'Fatal: depsver.mf Automake fragment limited' \ 'to immediate subdirectories.' && \ echo "top_builddir: $(top_builddir)" && \ echo "subdir: $(subdir)" && \ exit 1 \ ;; \ esac && \ echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver @touch $@ BUILT_SOURCES += .deps-ver CLEANFILES += .deps-ver # # depsver.mf included in Makefile.am for directories with .deps # # When building in the same directory with sources that change over # time, such as when tracking using bk, the .deps files can become # stale with respect to moved, deleted, or superceded headers. Most # commonly, this would exhibit as make reporting a failure to make a # header file which is no longer in the location given. To address # this issue, we use a deps-ver file which is updated with each change # that breaks old .deps files. A copy of deps-ver is made into # $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present # with different contents than deps-ver, we make clean to ensure all # .o files built before the incompatible change are rebuilt along with # their updated .deps files, then remove $(DEPDIR) and recreate it as # empty stubs. # # It is normal when configured with --disable-dependency-tracking for # the DEPDIR to not have been created. For this reason, we use the # intermediate target .deps-ver, which invokes make recursively if # DEPDIR exists. # # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # # This comment block follows rather than leads the related code so that # it stays with it in the generated Makefile.in and Makefile. # ntp-4.2.6p5/sntp/deps-ver0000644000175000017500000000003511307651603014245 0ustar peterpeterFri Nov 13 17:21:31 UTC 2009 ntp-4.2.6p5/sntp/crypto.h0000644000175000017500000000141611372205556014276 0ustar peterpeter#ifndef CRYPTO_H #define CRYPTO_H #include #include #include #include #include #include #ifdef OPENSSL # include "openssl/evp.h" #else # include /* provides clone of OpenSSL MD5 API */ #endif #include "utilities.h" #include "sntp-opts.h" #define LEN_PKT_MAC LEN_PKT_NOMAC + sizeof(u_int32) /* #include "sntp-opts.h" */ struct key { struct key *next; int key_id; int key_len; char type[10]; char key_seq[64]; }; int auth_init(const char *keyfile, struct key **keys); void get_key(int key_id, struct key **d_key); int make_mac(char *pkt_data, int pkt_size, int mac_size, struct key *cmp_key, char *digest); int auth_md5(char *pkt_data, int pkt_size, int mac_size, struct key *cmp_key); #endif ntp-4.2.6p5/sntp/networking.c0000644000175000017500000003542711474355436015157 0ustar peterpeter#include #include "networking.h" char adr_buf[INET6_ADDRSTRLEN]; /* resolve_hosts consumes an array of hostnames/addresses and its length, stores a pointer * to the array with the resolved hosts in res and returns the size of the array res. * pref_family enforces IPv4 or IPv6 depending on commandline options and system * capability. If pref_family is NULL or PF_UNSPEC any compatible family will be accepted. * Check here: Probably getaddrinfo() can do without ISC's IPv6 availability check? */ int resolve_hosts ( const char **hosts, int hostc, struct addrinfo ***res, int pref_family ) { register unsigned int a; unsigned int resc; struct addrinfo **tres; if (hostc < 1 || NULL == res) return 0; tres = emalloc(sizeof(struct addrinfo *) * hostc); for (a = 0, resc = 0; a < hostc; a++) { struct addrinfo hints; int error; tres[resc] = NULL; #ifdef DEBUG printf("sntp resolve_hosts: Starting host resolution for %s...\n", hosts[a]); #endif memset(&hints, 0, sizeof(hints)); if (AF_UNSPEC == pref_family) hints.ai_family = PF_UNSPEC; else hints.ai_family = pref_family; hints.ai_socktype = SOCK_DGRAM; error = getaddrinfo(hosts[a], "123", &hints, &tres[resc]); if (error) { msyslog(LOG_DEBUG, "Error looking up %s%s: %s", (AF_UNSPEC == hints.ai_family) ? "" : (AF_INET == hints.ai_family) ? "(A) " : "(AAAA) ", hosts[a], gai_strerror(error)); } else { #ifdef DEBUG for (dres = tres[resc]; dres; dres = dres->ai_next) { getnameinfo(dres->ai_addr, dres->ai_addrlen, adr_buf, sizeof(adr_buf), NULL, 0, NI_NUMERICHOST); STDLINE printf("Resolv No.: %i Result of getaddrinfo for %s:\n", resc, hosts[a]); printf("socktype: %i ", dres->ai_socktype); printf("protocol: %i ", dres->ai_protocol); printf("Prefered socktype: %i IP: %s\n", dres->ai_socktype, adr_buf); STDLINE } #endif resc++; } } if (resc) *res = realloc(tres, sizeof(struct addrinfo *) * resc); else { free(tres); *res = NULL; } return resc; } /* Creates a socket and returns. */ void create_socket ( SOCKET *rsock, sockaddr_u *dest ) { *rsock = socket(AF(dest), SOCK_DGRAM, 0); if (-1 == *rsock && ENABLED_OPT(NORMALVERBOSE)) printf("Failed to create UDP socket with family %d\n", AF(dest)); } /* Send a packet */ void sendpkt ( SOCKET rsock, sockaddr_u *dest, struct pkt *pkt, int len ) { int cc; #ifdef DEBUG printf("sntp sendpkt: Packet data:\n"); pkt_output(pkt, len, stdout); #endif if (ENABLED_OPT(NORMALVERBOSE)) { getnameinfo(&dest->sa, SOCKLEN(dest), adr_buf, sizeof(adr_buf), NULL, 0, NI_NUMERICHOST); printf("sntp sendpkt: Sending packet to %s... ", adr_buf); } cc = sendto(rsock, (void *)pkt, len, 0, &dest->sa, SOCKLEN(dest)); if (cc == SOCKET_ERROR) { #ifdef DEBUG printf("\n sntp sendpkt: Socket error: %i. Couldn't send packet!\n", cc); #endif if (errno != EWOULDBLOCK && errno != ENOBUFS) { /* oh well */ } } else if (ENABLED_OPT(NORMALVERBOSE)) { printf("Packet sent.\n"); } } /* Receive raw data */ int recvdata( SOCKET rsock, sockaddr_u *sender, char *rdata, int rdata_length ) { GETSOCKNAME_SOCKLEN_TYPE slen; int recvc; #ifdef DEBUG printf("sntp recvdata: Trying to receive data from...\n"); #endif slen = sizeof(*sender); recvc = recvfrom(rsock, rdata, rdata_length, 0, &sender->sa, &slen); #ifdef DEBUG if (recvc > 0) { printf("Received %d bytes from %s:\n", recvc, stoa(sender)); pkt_output((struct pkt *) rdata, recvc, stdout); } else { saved_errno = errno; printf("recvfrom error %d (%s)\n", errno, strerror(errno)); errno = saved_errno; } #endif return recvc; } /* Receive data from broadcast. Couldn't finish that. Need to do some digging * here, especially for protocol independence and IPv6 multicast */ int recv_bcst_data ( SOCKET rsock, char *rdata, int rdata_len, sockaddr_u *sas, sockaddr_u *ras ) { char *buf; int btrue = 1; int recv_bytes = 0; int rdy_socks; GETSOCKNAME_SOCKLEN_TYPE ss_len; struct timeval timeout_tv; fd_set bcst_fd; #ifdef MCAST struct ip_mreq mdevadr; TYPEOF_IP_MULTICAST_LOOP mtrue = 1; #endif #ifdef INCLUDE_IPV6_MULTICAST_SUPPORT struct ipv6_mreq mdevadr6; #endif setsockopt(rsock, SOL_SOCKET, SO_REUSEADDR, &btrue, sizeof(btrue)); if (IS_IPV4(sas)) { if (bind(rsock, &sas->sa, SOCKLEN(sas)) < 0) { if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp recv_bcst_data: Couldn't bind() address %s:%d.\n", stoa(sas), SRCPORT(sas)); } #ifdef MCAST if (setsockopt(rsock, IPPROTO_IP, IP_MULTICAST_LOOP, &mtrue, sizeof(mtrue)) < 0) { /* some error message regarding setting up multicast loop */ return BROADCAST_FAILED; } mdevadr.imr_multiaddr.s_addr = NSRCADR(sas); mdevadr.imr_interface.s_addr = htonl(INADDR_ANY); if (mdevadr.imr_multiaddr.s_addr == -1) { if (ENABLED_OPT(NORMALVERBOSE)) { printf("sntp recv_bcst_data: %s:%d is not a broad-/multicast address, aborting...\n", stoa(sas), SRCPORT(sas)); } return BROADCAST_FAILED; } if (setsockopt(rsock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mdevadr, sizeof(mdevadr)) < 0) { if (ENABLED_OPT(NORMALVERBOSE)) { buf = ss_to_str(sas); printf("sntp recv_bcst_data: Couldn't add IP membership for %s\n", buf); free(buf); } } #endif /* MCAST */ } #ifdef ISC_PLATFORM_HAVEIPV6 else if (IS_IPV6(sas)) { if (bind(rsock, &sas->sa, SOCKLEN(sas)) < 0) { if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp recv_bcst_data: Couldn't bind() address.\n"); } #ifdef INCLUDE_IPV6_MULTICAST_SUPPORT if (setsockopt(rsock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &btrue, sizeof (btrue)) < 0) { /* some error message regarding setting up multicast loop */ return BROADCAST_FAILED; } memset(&mdevadr6, 0, sizeof(mdevadr6)); mdevadr6.ipv6mr_multiaddr = SOCK_ADDR6(sas); if (!IN6_IS_ADDR_MULTICAST(&mdevadr6.ipv6mr_multiaddr)) { if (ENABLED_OPT(NORMALVERBOSE)) { buf = ss_to_str(sas); printf("sntp recv_bcst_data: %s is not a broad-/multicast address, aborting...\n", buf); free(buf); } return BROADCAST_FAILED; } if (setsockopt(rsock, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mdevadr6, sizeof(mdevadr6)) < 0) { if (ENABLED_OPT(NORMALVERBOSE)) { buf = ss_to_str(sas); printf("sntp recv_bcst_data: Couldn't join group for %s\n", buf); free(buf); } } #endif /* INCLUDE_IPV6_MULTICAST_SUPPORT */ } #endif /* ISC_PLATFORM_HAVEIPV6 */ FD_ZERO(&bcst_fd); FD_SET(rsock, &bcst_fd); if (ENABLED_OPT(TIMEOUT)) timeout_tv.tv_sec = (int) OPT_ARG(TIMEOUT); else timeout_tv.tv_sec = 68; /* ntpd broadcasts every 64s */ timeout_tv.tv_usec = 0; rdy_socks = select(rsock + 1, &bcst_fd, 0, 0, &timeout_tv); switch (rdy_socks) { case -1: if (ENABLED_OPT(NORMALVERBOSE)) perror("sntp recv_bcst_data: select()"); return BROADCAST_FAILED; break; case 0: if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp recv_bcst_data: select() reached timeout (%u sec), aborting.\n", (unsigned)timeout_tv.tv_sec); return BROADCAST_FAILED; break; default: ss_len = sizeof(*ras); recv_bytes = recvfrom(rsock, rdata, rdata_len, 0, &ras->sa, &ss_len); break; } if (recv_bytes == -1) { if (ENABLED_OPT(NORMALVERBOSE)) perror("sntp recv_bcst_data: recvfrom:"); recv_bytes = BROADCAST_FAILED; } #ifdef MCAST if (IS_IPV4(sas)) setsockopt(rsock, IPPROTO_IP, IP_DROP_MEMBERSHIP, &btrue, sizeof(btrue)); #endif #ifdef INCLUDE_IPV6_MULTICAST_SUPPORT if (IS_IPV6(sas)) setsockopt(rsock, IPPROTO_IPV6, IPV6_LEAVE_GROUP, &btrue, sizeof(btrue)); #endif return recv_bytes; } int process_pkt ( struct pkt *rpkt, sockaddr_u *sas, int pkt_len, int mode, struct pkt *spkt, char * func_name ) { unsigned int key_id = 0; struct key *pkt_key = NULL; int is_authentic = 0; unsigned int exten_words, exten_words_used = 0; int mac_size; /* * Parse the extension field if present. We figure out whether * an extension field is present by measuring the MAC size. If * the number of words following the packet header is 0, no MAC * is present and the packet is not authenticated. If 1, the * packet is a crypto-NAK; if 3, the packet is authenticated * with DES; if 5, the packet is authenticated with MD5; if 6, * the packet is authenticated with SHA. If 2 or 4, the packet * is a runt and discarded forthwith. If greater than 6, an * extension field is present, so we subtract the length of the * field and go around again. */ if (pkt_len < LEN_PKT_NOMAC || (pkt_len & 3) != 0) { unusable: if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp %s: Funny packet length: %i. Discarding package.\n", func_name, pkt_len); return PACKET_UNUSEABLE; } /* skip past the extensions, if any */ exten_words = ((unsigned)pkt_len - LEN_PKT_NOMAC) >> 2; while (exten_words > 6) { unsigned int exten_len; exten_len = ntohl(rpkt->exten[exten_words_used]) & 0xffff; exten_len = (exten_len + 7) >> 2; /* convert to words, add 1 */ if (exten_len > exten_words || exten_len < 5) goto unusable; exten_words -= exten_len; exten_words_used += exten_len; } switch (exten_words) { case 1: key_id = ntohl(rpkt->exten[exten_words_used]); printf("Crypto NAK = 0x%08x\n", key_id); break; case 5: case 6: /* Look for the key used by the server in the specified keyfile * and if existent, fetch it or else leave the pointer untouched */ key_id = ntohl(rpkt->exten[exten_words_used]); get_key(key_id, &pkt_key); if (!pkt_key) { printf("unrecognized key ID = 0x%08x\n", key_id); break; } /* Seems like we've got a key with matching keyid */ /* Generate a md5sum of the packet with the key from our keyfile * and compare those md5sums */ mac_size = exten_words << 2; if (!auth_md5((char *)rpkt, pkt_len - mac_size, mac_size - 4, pkt_key)) { break; } /* Yay! Things worked out! */ if (ENABLED_OPT(NORMALVERBOSE)) { char *hostname = ss_to_str(sas); printf("sntp %s: packet received from %s successfully authenticated using key id %i.\n", func_name, hostname, key_id); free(hostname); } is_authentic = 1; break; case 0: break; default: goto unusable; break; } if (!is_authentic) { if (ENABLED_OPT(AUTHENTICATION)) { /* We want a authenticated packet */ if (ENABLED_OPT(NORMALVERBOSE)) { char *hostname = ss_to_str(sas); printf("sntp %s: packet received from %s is not authentic. Will discard it.\n", func_name, hostname); free(hostname); } return SERVER_AUTH_FAIL; } /* We don't know if the user wanted authentication so let's * use it anyways */ if (ENABLED_OPT(NORMALVERBOSE)) { char *hostname = ss_to_str(sas); printf("sntp %s: packet received from %s is not authentic. Authentication not enforced.\n", func_name, hostname); free(hostname); } } /* Check for server's ntp version */ if (PKT_VERSION(rpkt->li_vn_mode) < NTP_OLDVERSION || PKT_VERSION(rpkt->li_vn_mode) > NTP_VERSION) { if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp %s: Packet shows wrong version (%i)\n", func_name, PKT_VERSION(rpkt->li_vn_mode)); return SERVER_UNUSEABLE; } /* We want a server to sync with */ if (PKT_MODE(rpkt->li_vn_mode) != mode && PKT_MODE(rpkt->li_vn_mode) != MODE_PASSIVE) { if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp %s: mode %d stratum %i\n", func_name, PKT_MODE(rpkt->li_vn_mode), rpkt->stratum); return SERVER_UNUSEABLE; } /* Stratum is unspecified (0) check what's going on */ if (STRATUM_PKT_UNSPEC == rpkt->stratum) { char *ref_char; if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp %s: Stratum unspecified, going to check for KOD (stratum: %i)\n", func_name, rpkt->stratum); ref_char = (char *) &rpkt->refid; if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp %s: Packet refid: %c%c%c%c\n", func_name, ref_char[0], ref_char[1], ref_char[2], ref_char[3]); /* If it's a KOD packet we'll just use the KOD information */ if (ref_char[0] != 'X') { if (strncmp(ref_char, "DENY", 4) == 0) return KOD_DEMOBILIZE; if (strncmp(ref_char, "RSTR", 4) == 0) return KOD_DEMOBILIZE; if (strncmp(ref_char, "RATE", 4) == 0) return KOD_RATE; /* There are other interesting kiss codes which might be interesting for authentication */ } } /* If the server is not synced it's not really useable for us */ if (LEAP_NOTINSYNC == PKT_LEAP(rpkt->li_vn_mode)) { if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp %s: Server not in sync, skipping this server\n", func_name); return SERVER_UNUSEABLE; } /* * Decode the org timestamp and make sure we're getting a response * to our last request, but only if we're not in broadcast mode. */ #ifdef DEBUG printf("rpkt->org:\n"); l_fp_output(&rpkt->org, stdout); printf("spkt->xmt:\n"); l_fp_output(&spkt->xmt, stdout); #endif if (mode != MODE_BROADCAST && !L_ISEQU(&rpkt->org, &spkt->xmt)) { if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp process_pkt: pkt.org and peer.xmt differ\n"); return PACKET_UNUSEABLE; } return pkt_len; } int recv_bcst_pkt ( SOCKET rsock, struct pkt *rpkt, unsigned int rsize, sockaddr_u *sas ) { sockaddr_u sender; int pkt_len = recv_bcst_data(rsock, (char *)rpkt, rsize, sas, &sender); if (pkt_len < 0) { return BROADCAST_FAILED; } pkt_len = process_pkt(rpkt, sas, pkt_len, MODE_BROADCAST, NULL, "recv_bcst_pkt"); return pkt_len; } /* Fetch data, check if it's data for us and whether it's useable or not. If not, return * a failure code so we can delete this server from our list and continue with another one. */ int recvpkt ( SOCKET rsock, struct pkt *rpkt, /* received packet (response) */ unsigned int rsize, /* size of rpkt buffer */ struct pkt *spkt /* sent packet (request) */ ) { int rdy_socks; int pkt_len; sockaddr_u sender; struct timeval timeout_tv; fd_set recv_fd; FD_ZERO(&recv_fd); FD_SET(rsock, &recv_fd); if (ENABLED_OPT(TIMEOUT)) timeout_tv.tv_sec = (int) OPT_ARG(TIMEOUT); else timeout_tv.tv_sec = 68; /* ntpd broadcasts every 64s */ timeout_tv.tv_usec = 0; rdy_socks = select(rsock + 1, &recv_fd, 0, 0, &timeout_tv); switch (rdy_socks) { case -1: if (ENABLED_OPT(NORMALVERBOSE)) perror("sntp recvpkt: select()"); return PACKET_UNUSEABLE; break; case 0: if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp recvpkt: select() reached timeout (%u sec), aborting.\n", (unsigned)timeout_tv.tv_sec); return PACKET_UNUSEABLE; break; default: break; } pkt_len = recvdata(rsock, &sender, (char *)rpkt, rsize); if (pkt_len > 0) pkt_len = process_pkt(rpkt, &sender, pkt_len, MODE_SERVER, spkt, "recvpkt"); return pkt_len; } /* * is_reachable - check to see if we have a route to given destination */ int is_reachable ( struct addrinfo *dst ) { SOCKET sockfd = socket(dst->ai_family, SOCK_DGRAM, 0); if (-1 == sockfd) { #ifdef DEBUG printf("is_reachable: Couldn't create socket\n"); #endif return 0; } if (connect(sockfd, dst->ai_addr, SOCKLEN((sockaddr_u *)dst->ai_addr))) { closesocket(sockfd); return 0; } closesocket(sockfd); return 1; } ntp-4.2.6p5/sntp/config.h.in0000644000175000017500000002573411675460543014646 0ustar peterpeter/* config.h.in. Generated from configure.ac by autoheader. */ /* Directory separator character, usually / or \\ */ #undef DIR_SEP /* fopen(3) accepts a 'b' in the mode flag */ #undef FOPEN_BINARY_FLAG /* fopen(3) accepts a 't' in the mode flag */ #undef FOPEN_TEXT_FLAG /* What is getsockname()'s socklen type? */ #undef GETSOCKNAME_SOCKLEN_TYPE /* Define to 1 if you have the `canonicalize_file_name' function. */ #undef HAVE_CANONICALIZE_FILE_NAME /* Define this if /dev/zero is readable device */ #undef HAVE_DEV_ZERO /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* inline keyword or macro available */ #undef HAVE_INLINE /* Define to 1 if the system has the type `int16_t'. */ #undef HAVE_INT16_T /* Define to 1 if the system has the type `int32_t'. */ #undef HAVE_INT32_T /* Define to 1 if the system has the type `int8_t'. */ #undef HAVE_INT8_T /* Define to 1 if the system has the type `intptr_t'. */ #undef HAVE_INTPTR_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `gen' library (-lgen). */ #undef HAVE_LIBGEN /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_NETMP_H /* sntp does not care about 'nice' */ #undef HAVE_NO_NICE /* Define this if pathfind(3) works */ #undef HAVE_PATHFIND /* Define to 1 if the system has the type `pid_t'. */ #undef HAVE_PID_T /* Define this if we have a functional realpath(3C) */ #undef HAVE_REALPATH /* Define to 1 if you have the header file. */ #undef HAVE_RUNETYPE_H /* Define to 1 if you have the header file. */ #undef HAVE_SETJMP_H /* Define to 1 if the system has the type `size_t'. */ #undef HAVE_SIZE_T /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define this if strftime() works */ #undef HAVE_STRFTIME /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strsignal' function. */ #undef HAVE_STRSIGNAL /* Does a system header define struct sockaddr_storage? */ #undef HAVE_STRUCT_SOCKADDR_STORAGE /* Define to 1 if you have the header file. */ #undef HAVE_SYSEXITS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_POLL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PROCSET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STROPTS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if the system has the type `s_char'. */ #undef HAVE_S_CHAR /* sntp does not care about TTY stuff */ #undef HAVE_TERMIOS /* Define to 1 if the system has the type `uint16_t'. */ #undef HAVE_UINT16_T /* Define to 1 if the system has the type `uint32_t'. */ #undef HAVE_UINT32_T /* Define to 1 if the system has the type `uint8_t'. */ #undef HAVE_UINT8_T /* Define to 1 if the system has the type `uintptr_t'. */ #undef HAVE_UINTPTR_T /* Define to 1 if the system has the type `uint_t'. */ #undef HAVE_UINT_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H /* Define to 1 if you have the header file. */ #undef HAVE_VALUES_H /* Define to 1 if you have the header file. */ #undef HAVE_VARARGS_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the `vsprintf' function. */ #undef HAVE_VSPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if the system has the type `wchar_t'. */ #undef HAVE_WCHAR_T /* Define to 1 if the system has the type `wint_t'. */ #undef HAVE_WINT_T /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Does struct sockaddr_storage have __ss_family? */ #undef HAVE___SS_FAMILY_IN_SS /* Handle sockaddr_storage.__ss_family */ #ifdef HAVE___SS_FAMILY_IN_SS # define ss_family __ss_family #endif /* HAVE___SS_FAMILY_IN_SS */ /* Does struct sockaddr_storage have __ss_len? */ #undef HAVE___SS_LEN_IN_SS /* Handle sockaddr_storage.__ss_len */ #ifdef HAVE___SS_LEN_IN_SS # define ss_len __ss_len #endif /* HAVE___SS_LEN_IN_SS */ /* Do we need to fix in6isaddr? */ #undef ISC_PLATFORM_FIXIN6ISADDR /* have struct if_laddrconf? */ #undef ISC_PLATFORM_HAVEIF_LADDRCONF /* have struct if_laddrreq? */ #undef ISC_PLATFORM_HAVEIF_LADDRREQ /* have struct in6_pktinfo? */ #undef ISC_PLATFORM_HAVEIN6PKTINFO /* have IPv6? */ #undef ISC_PLATFORM_HAVEIPV6 /* struct sockaddr has sa_len? */ #undef ISC_PLATFORM_HAVESALEN /* sin6_scope_id? */ #undef ISC_PLATFORM_HAVESCOPEID /* missing in6addr_any? */ #undef ISC_PLATFORM_NEEDIN6ADDRANY /* Do we need netinet6/in6.h? */ #undef ISC_PLATFORM_NEEDNETINET6IN6H /* ISC: provide inet_ntop() */ #undef ISC_PLATFORM_NEEDNTOP /* Declare in_port_t? */ #undef ISC_PLATFORM_NEEDPORTT /* ISC: provide inet_pton() */ #undef ISC_PLATFORM_NEEDPTON /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Does the target support multicast IP? */ #undef MCAST /* Do we need an s_char typedef? */ #undef NEED_S_CHAR_TYPEDEF /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Define this if optional arguments are disallowed */ #undef NO_OPTIONAL_OPT_ARGS /* Should we avoid #warning on option name collisions? */ #undef NO_OPTION_NAME_WARNINGS /* Use OpenSSL? */ #undef OPENSSL /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* define to a working POSIX compliant shell */ #undef POSIX_SHELL /* name of regex header file */ #undef REGEX_HEADER /* The size of `char*', as computed by sizeof. */ #undef SIZEOF_CHARP /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* The size of `signed char', as computed by sizeof. */ #undef SIZEOF_SIGNED_CHAR /* The size of `time_t', as computed by sizeof. */ #undef SIZEOF_TIME_T /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* canonical system (cpu-vendor-os) of where we should run */ #undef STR_SYSTEM /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* What type to use for setsockopt */ #undef TYPEOF_IP_MULTICAST_LOOP /* Version number of package */ #undef VERSION /* configure --enable-ipv6 */ #undef WANT_IPV6 /* Define this if a working libregex can be found */ #undef WITH_LIBREGEX /* Are we _special_? */ #undef __APPLE_USE_RFC_3542 /* Define to 1 if type `char' is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ # undef __CHAR_UNSIGNED__ #endif /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t /* Define as `fork' if `vfork' does not work. */ #undef vfork #ifndef MPINFOU_PREDECLARED # define MPINFOU_PREDECLARED typedef union mpinfou { /* For lint */ struct pdk_mpinfo *pdkptr; struct mpinfo *pikptr; } mpinfou_t; #endif ntp-4.2.6p5/sntp/config.sub0000755000175000017500000010457111606457373014604 0ustar peterpeter#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-06-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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 2 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, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ntp-4.2.6p5/sntp/Makefile.in0000644000175000017500000012175111675460461014663 0ustar peterpeter# 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@ # Makefile.am for JMK's SNTP, by Harlan Stenn # we traditionally installed software in bindir, while it should have gone # in sbindir. Now that we offer a choice, look in the "other" installation # subdir to warn folks if there is another version there. 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@ @NTP_BINSUBDIR_IS_BIN_TRUE@bin_PROGRAMS = sntp$(EXEEXT) @NTP_BINSUBDIR_IS_BIN_FALSE@sbin_PROGRAMS = sntp$(EXEEXT) @NEED_LIBOPTS_TRUE@am__append_1 = libopts DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/bincheck.mf $(top_srcdir)/configure \ $(top_srcdir)/depsver.mf compile config.guess config.sub \ depcomp install-sh ltmain.sh missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.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_cacheversion.m4 \ $(top_srcdir)/../m4/ntp_dir_sep.m4 \ $(top_srcdir)/../m4/ntp_lib_m.m4 \ $(top_srcdir)/../m4/ntp_openssl.m4 $(top_srcdir)/../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 \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) am__objects_1 = am_sntp_OBJECTS = crypto.$(OBJEXT) kod_management.$(OBJEXT) \ log.$(OBJEXT) main.$(OBJEXT) networking.$(OBJEXT) \ sntp.$(OBJEXT) sntp-opts.$(OBJEXT) utilities.$(OBJEXT) \ $(am__objects_1) sntp_OBJECTS = $(am_sntp_OBJECTS) sntp_LDADD = $(LDADD) am__DEPENDENCIES_1 = sntp_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ ../libntp/libntp.a DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(sntp_SOURCES) DIST_SOURCES = $(sntp_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DATA = $(noinst_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = libopts DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SEPARATOR = @PATH_SEPARATOR@ POSIX_SHELL = @POSIX_SHELL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_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@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ NULL = AUTOMAKE_OPTIONS = foreign 1.10 ACLOCAL_AMFLAGS = -I ../m4 -I libopts/m4 AM_CPPFLAGS = $(LIBOPTS_CFLAGS) -I$(top_srcdir)/../include \ -I$(top_srcdir)/../lib/isc/include \ -I$(top_srcdir)/../lib/isc/nothreads/include \ -I$(top_srcdir)/../lib/isc/unix/include LDADD = $(LIBOPTS_LDADD) $(LIBM) ../libntp/libntp.a @LCRYPTO@ run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \ autogen -L ../include --writable CLEANFILES = check-COPYRIGHT-submake .deps-ver SUBDIRS = $(am__append_1) sntp_SOURCES = \ crypto.c \ crypto.h \ data_formats.h \ header.h \ kod_management.c \ kod_management.h \ log.c \ log.h \ main.c \ main.h \ networking.c \ networking.h \ sntp.c \ sntp-opts.c \ sntp-opts.h \ utilities.c \ utilities.h \ $(NULL) EXTRA_DIST = \ $(srcdir)/autogen-version.def \ bincheck.mf \ $(srcdir)/COPYRIGHT \ deps-ver \ depsver.mf \ sntp-opts.def \ sntp-opts.menu \ sntp-opts.texi \ sntp.1 \ sntp.html \ sntp.texi \ $(srcdir)/version.def \ $(srcdir)/version.m4 \ $(srcdir)/version.texi \ $(NULL) OLD_EXTRA_DIST = \ autogen-version.def version.def version.m4 version.texi BUILT_SOURCES = check-autogen-version.def check-version.def \ check-version.m4 check-version.texi $(srcdir)/COPYRIGHT \ libtool $(srcdir)/sntp-opts.c $(srcdir)/sntp-opts.h $(NULL) \ .deps-ver man_MANS = $(srcdir)/sntp.1 # HMS: Real Soon Now... #info_TEXINFOS= sntp.texi #sntp_TEXINFOS= sntp-opts.texi noinst_DATA = \ $(srcdir)/sntp.html \ $(srcdir)/sntp-opts.texi \ $(srcdir)/sntp-opts.menu \ $(NULL) all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 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; \ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list sntp$(EXEEXT): $(sntp_OBJECTS) $(sntp_DEPENDENCIES) @rm -f sntp$(EXEEXT) $(LINK) $(sntp_OBJECTS) $(sntp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kod_management.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networking.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sntp-opts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sntp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utilities.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; 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=''; 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; } # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 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 $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man \ uninstall-sbinPROGRAMS uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ ctags-recursive install install-am install-exec-am \ install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-sbinPROGRAMS ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-lzma \ dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 \ uninstall-sbinPROGRAMS FRC: @: do-nothing action to prevent default SCCS get @: FRC "force" depends on nothing and is not a file, so is @: always out-of-date causing targets which depend on it to @: similarly always be outdated causing their rules to fire @: each time they or a dependent is built. check-autogen-version.def: FRC @cd $(srcdir) \ && test -r ../include/autogen-version.def \ && ( if cmp -s ../include/autogen-version.def autogen-version.def; \ then : ; \ else cp ../include/autogen-version.def autogen-version.def; \ echo "Installing new sntp/autogen-version.def file"; \ fi ) $(srcdir)/autogen-version.def: $(MAKE) check-autogen-version.def check-version.def: FRC @cd $(srcdir) \ && test -r ../include/version.def \ && ( if cmp -s ../include/version.def version.def; \ then : ; \ else cp ../include/version.def version.def; \ echo "Installing new sntp/version.def file"; \ fi ) $(srcdir)/version.def: $(MAKE) check-version.def check-version.m4: FRC @cd $(srcdir) \ && test -r ../version.m4 \ && ( if cmp -s ../version.m4 version.m4; \ then : ; \ else cp ../version.m4 version.m4; \ echo "Installing new sntp/version.m4 file"; \ fi ) $(srcdir)/version.m4: $(MAKE) check-version.m4 check-version.texi: FRC @cd $(srcdir) \ && test -r ../include/version.texi \ && ( if cmp -s ../include/version.texi version.texi; \ then : ; \ else cp ../include/version.texi version.texi; \ echo "Installing new sntp/version.texi file"; \ fi ) $(srcdir)/version.texi: $(MAKE) check-version.texi $(srcdir)/../COPYRIGHT: cd .. && $(MAKE) COPYRIGHT-please check-COPYRIGHT-submake: $(srcdir)/../COPYRIGHT @cmp -s $(srcdir)/../COPYRIGHT $(srcdir)/COPYRIGHT \ || { cp $(srcdir)/../COPYRIGHT $(srcdir) \ && echo 'updated sntp/COPYRIGHT installed' ;} @echo 'submake avoided if this file is newer than parent COPYRIGHT' > $@ check-COPYRIGHT: FRC [ ! -r $(srcdir)/../COPYRIGHT ] \ || [ check-COPYRIGHT-submake -nt $(srcdir)/../COPYRIGHT ] \ || $(MAKE) check-COPYRIGHT-submake $(srcdir)/COPYRIGHT: check-COPYRIGHT @: do-nothing action to prevent any default $(srcdir)/sntp-opts.h: $(srcdir)/sntp-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/sntp-opts.c: $(srcdir)/sntp-opts.def $(srcdir)/version.def $(srcdir)/../include/copyright.def $(run_ag) sntp-opts.def $(srcdir)/sntp.1: $(srcdir)/sntp-opts.def $(srcdir)/version.def $(srcdir)/../include/copyright.def $(run_ag) -Tagman1.tpl -bsntp sntp-opts.def $(srcdir)/sntp-opts.menu: $(srcdir)/sntp-opts.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/sntp-opts.texi: $(srcdir)/sntp-opts.def $(srcdir)/version.def $(srcdir)/../include/copyright.def $(run_ag) -Taginfo.tpl -DLEVEL=section sntp-opts.def $(top_srcdir)/../scripts/check--help $@ $(srcdir)/sntp.html: $(srcdir)/sntp-opts.menu $(srcdir)/sntp-opts.texi $(srcdir)/sntp.texi $(srcdir)/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o sntp.html sntp.texi || true ) ../libntp/libntp.a: cd ../libntp && $(MAKE) libntp.a libtool: $(LIBTOOL_DEPS) ./config.status --recheck install-exec-hook: @case ${BINSUBDIR} in \ bin) ODIR=${sbindir} ;; \ sbin) ODIR=${bindir} ;; \ esac; \ test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \ test ! -f $$ODIR/$$i || echo "*** $$i is also in $$ODIR!"; \ done # $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ chmod ug+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ $(MAKE) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ mkdir $(DEPDIR) && \ case "$(top_builddir)" in \ .) \ ./config.status Makefile depfiles \ ;; \ ..) \ cd .. && \ ./config.status $(subdir)/Makefile depfiles && \ cd $(subdir) \ ;; \ *) \ echo 'Fatal: depsver.mf Automake fragment limited' \ 'to immediate subdirectories.' && \ echo "top_builddir: $(top_builddir)" && \ echo "subdir: $(subdir)" && \ exit 1 \ ;; \ esac && \ echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver @touch $@ # # depsver.mf included in Makefile.am for directories with .deps # # When building in the same directory with sources that change over # time, such as when tracking using bk, the .deps files can become # stale with respect to moved, deleted, or superceded headers. Most # commonly, this would exhibit as make reporting a failure to make a # header file which is no longer in the location given. To address # this issue, we use a deps-ver file which is updated with each change # that breaks old .deps files. A copy of deps-ver is made into # $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present # with different contents than deps-ver, we make clean to ensure all # .o files built before the incompatible change are rebuilt along with # their updated .deps files, then remove $(DEPDIR) and recreate it as # empty stubs. # # It is normal when configured with --disable-dependency-tracking for # the DEPDIR to not have been created. For this reason, we use the # intermediate target .deps-ver, which invokes make recursively if # DEPDIR exists. # # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # # This comment block follows rather than leads the related code so that # it stays with it in the generated Makefile.in and Makefile. # # 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: ntp-4.2.6p5/sntp/COPYRIGHT0000644000175000017500000002241211510500352014061 0ustar peterpeterThis file is automatically generated from html/copyright.html Copyright Notice jpg "Clone me," says Dolly sheepishly. Last update: 1-Jan-2011 08:34 UTC _________________________________________________________________ The following copyright notice applies to all files collectively called the Network Time Protocol Version 4 Distribution. Unless specifically declared otherwise in an individual file, this notice applies as if the text was explicitly included in the file. *********************************************************************** * * * Copyright (c) University of Delaware 1992-2011 * * * * Permission to use, copy, modify, and distribute this software and * * its documentation for any purpose with or without fee is hereby * * granted, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission * * notice appear in supporting documentation, and that the name * * University of Delaware not be used in advertising or publicity * * pertaining to distribution of the software without specific, * * written prior permission. The University of Delaware makes no * * representations about the suitability this software for any * * purpose. It is provided "as is" without express or implied * * warranty. * * * *********************************************************************** The following individuals contributed in part to the Network Time Protocol Distribution Version 4 and are acknowledged as authors of this work. 1. [1]Takao Abe Clock driver for JJY receivers 2. [2]Mark Andrews Leitch atomic clock controller 3. [3]Bernd Altmeier hopf Elektronik serial line and PCI-bus devices 4. [4]Viraj Bais and [5]Clayton Kirkwood port to WindowsNT 3.5 5. [6]Michael Barone GPSVME fixes 6. [7]Karl Berry syslog to file option 7. [8]Greg Brackley Major rework of WINNT port. Clean up recvbuf and iosignal code into separate modules. 8. [9]Marc Brett Magnavox GPS clock driver 9. [10]Piete Brooks MSF clock driver, Trimble PARSE support 10. [11]Nelson B Bolyard update and complete broadcast and crypto features in sntp 11. [12]Jean-Francois Boudreault IPv6 support 12. [13]Reg Clemens Oncore driver (Current maintainer) 13. [14]Steve Clift OMEGA clock driver 14. [15]Casey Crellin vxWorks (Tornado) port and help with target configuration 15. [16]Sven Dietrich Palisade reference clock driver, NT adj. residuals, integrated Greg's Winnt port. 16. [17]John A. Dundas III Apple A/UX port 17. [18]Torsten Duwe Linux port 18. [19]Dennis Ferguson foundation code for NTP Version 2 as specified in RFC-1119 19. [20]John Hay IPv6 support and testing 20. [21]Dave Hart General maintenance, Windows port interpolation rewrite 21. [22]Claas Hilbrecht NeoClock4X clock driver 22. [23]Glenn Hollinger GOES clock driver 23. [24]Mike Iglesias DEC Alpha port 24. [25]Jim Jagielski A/UX port 25. [26]Jeff Johnson massive prototyping overhaul 26. [27]Hans Lambermont or [28] ntpsweep 27. [29]Poul-Henning Kamp Oncore driver (Original author) 28. [30]Frank Kardel [31] PARSE driver (>14 reference clocks), STREAMS modules for PARSE, support scripts, syslog cleanup, dynamic interface handling 29. [32]William L. Jones RS/6000 AIX modifications, HPUX modifications 30. [33]Dave Katz RS/6000 AIX port 31. [34]Craig Leres 4.4BSD port, ppsclock, Magnavox GPS clock driver 32. [35]George Lindholm SunOS 5.1 port 33. [36]Louis A. Mamakos MD5-based authentication 34. [37]Lars H. Mathiesen adaptation of foundation code for Version 3 as specified in RFC-1305 35. [38]Danny Mayer Network I/O, Windows Port, Code Maintenance 36. [39]David L. Mills Version 4 foundation: clock discipline, authentication, precision kernel; clock drivers: Spectracom, Austron, Arbiter, Heath, ATOM, ACTS, KSI/Odetics; audio clock drivers: CHU, WWV/H, IRIG 37. [40]Wolfgang Moeller VMS port 38. [41]Jeffrey Mogul ntptrace utility 39. [42]Tom Moore i386 svr4 port 40. [43]Kamal A Mostafa SCO OpenServer port 41. [44]Derek Mulcahy and [45]Damon Hart-Davis ARCRON MSF clock driver 42. [46]Rob Neal Bancomm refclock and config/parse code maintenance 43. [47]Rainer Pruy monitoring/trap scripts, statistics file handling 44. [48]Dirce Richards Digital UNIX V4.0 port 45. [49]Wilfredo Sánchez added support for NetInfo 46. [50]Nick Sayer SunOS streams modules 47. [51]Jack Sasportas Saved a Lot of space on the stuff in the html/pic/ subdirectory 48. [52]Ray Schnitzler Unixware1 port 49. [53]Michael Shields USNO clock driver 50. [54]Jeff Steinman Datum PTS clock driver 51. [55]Harlan Stenn GNU automake/autoconfigure makeover, various other bits (see the ChangeLog) 52. [56]Kenneth Stone HP-UX port 53. [57]Ajit Thyagarajan IP multicast/anycast support 54. [58]Tomoaki TSURUOKA TRAK clock driver 55. [59]Paul A Vixie TrueTime GPS driver, generic TrueTime clock driver 56. [60]Ulrich Windl corrected and validated HTML documents according to the HTML DTD _________________________________________________________________ References 1. mailto:%20takao_abe@xurb.jp 2. mailto:%20mark_andrews@isc.org 3. mailto:%20altmeier@atlsoft.de 4. mailto:%20vbais@mailman1.intel.co 5. mailto:%20kirkwood@striderfm.intel.com 6. mailto:%20michael.barone@lmco.com 7. mailto:%20karl@owl.HQ.ileaf.com 8. mailto:%20greg.brackley@bigfoot.com 9. mailto:%20Marc.Brett@westgeo.com 10. mailto:%20Piete.Brooks@cl.cam.ac.uk 11. mailto:%20nelson@bolyard.me 12. mailto:%20Jean-Francois.Boudreault@viagenie.qc.ca 13. mailto:%20reg@dwf.com 14. mailto:%20clift@ml.csiro.au 15. mailto:casey@csc.co.za 16. mailto:%20Sven_Dietrich@trimble.COM 17. mailto:%20dundas@salt.jpl.nasa.gov 18. mailto:%20duwe@immd4.informatik.uni-erlangen.de 19. mailto:%20dennis@mrbill.canet.ca 20. mailto:%20jhay@icomtek.csir.co.za 21. mailto:%20davehart@davehart.com 22. mailto:%20neoclock4x@linum.com 23. mailto:%20glenn@herald.usask.ca 24. mailto:%20iglesias@uci.edu 25. mailto:%20jagubox.gsfc.nasa.gov 26. mailto:%20jbj@chatham.usdesign.com 27. mailto:Hans.Lambermont@nl.origin-it.com 28. mailto:H.Lambermont@chello.nl 29. mailto:%20phk@FreeBSD.ORG 30. http://www4.informatik.uni-erlangen.de/%7ekardel 31. mailto:%20kardel(at)ntp(dot)org 32. mailto:%20jones@hermes.chpc.utexas.edu 33. mailto:%20dkatz@cisco.com 34. mailto:%20leres@ee.lbl.gov 35. mailto:%20lindholm@ucs.ubc.ca 36. mailto:%20louie@ni.umd.edu 37. mailto:%20thorinn@diku.dk 38. mailto:%20mayer@ntp.org 39. mailto:%20mills@udel.edu 40. mailto:%20moeller@gwdgv1.dnet.gwdg.de 41. mailto:%20mogul@pa.dec.com 42. mailto:%20tmoore@fievel.daytonoh.ncr.com 43. mailto:%20kamal@whence.com 44. mailto:%20derek@toybox.demon.co.uk 45. mailto:%20d@hd.org 46. mailto:%20neal@ntp.org 47. mailto:%20Rainer.Pruy@informatik.uni-erlangen.de 48. mailto:%20dirce@zk3.dec.com 49. mailto:%20wsanchez@apple.com 50. mailto:%20mrapple@quack.kfu.com 51. mailto:%20jack@innovativeinternet.com 52. mailto:%20schnitz@unipress.com 53. mailto:%20shields@tembel.org 54. mailto:%20pebbles.jpl.nasa.gov 55. mailto:%20harlan@pfcs.com 56. mailto:%20ken@sdd.hp.com 57. mailto:%20ajit@ee.udel.edu 58. mailto:%20tsuruoka@nc.fukuoka-u.ac.jp 59. mailto:%20vixie@vix.com 60. mailto:%20Ulrich.Windl@rz.uni-regensburg.de ntp-4.2.6p5/sntp/compile0000755000175000017500000000717310544732123014164 0ustar peterpeter#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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 2, 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ntp-4.2.6p5/sntp/version.def0000644000175000017500000000002511675460540014747 0ustar peterpeterversion = '4.2.6p5'; ntp-4.2.6p5/sntp/sntp.texi0000644000175000017500000000433011675457724014476 0ustar peterpeter\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename sntp.info @settitle Sntp User's Manual @include version.texi @paragraphindent 2 @c %**end of header @ifinfo This file documents the use of the NTP Project's SNTP, a program for querying and setting the time. @end ifinfo @direntry * sntp: (sntp). Simple Network Time Protocol @end direntry @titlepage @title Simple Network Time Protocol User's Manual @subtitle sntp, version @value{VERSION}, @value{UPDATED} @c @author Max @email{foo@ntp.org} @end titlepage @c @page @c @vskip 0pt plus 1filll @node Top, sntp Description, (dir), (dir) @top Simple Network Time Protocol User Manual This document describes the use of the NTP Project's @code{sntp} program, 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 cron job. This document applies to version @value{VERSION} of @code{sntp}. The program implements the SNTP protocol as defined by RFC 5905, the NTPv4 IETF specification. @shortcontents @menu * sntp Description:: Description * sntp Invocation:: Invoking sntp * Usage:: Usage @end menu @node sntp Description @comment node-name, next, previous, up @section Description By default, @code{sntp} writes the local data and time (i.e., not UTC) to the standard output in the format: @example 1996 Oct 15 20:17:25.123 +4.567 +/- 0.089 secs @end example where the +4.567 +/- 0.089 secs indicates the time offset and error bound of the system clock relative to the server clock. @include sntp-opts.texi @node Usage @comment node-name, next, previous, up @section Usage The simplest use of this program is as an unprivileged command to check the current time, offset, and error in the local clock. For example: @example sntp ntpserver.somewhere @end example With suitable privilege, it can be run as a command or in a @code{crom} job to reset the local clock from a reliable server, like the @code{ntpdate} and @code{rdate} commands. For example: @example sntp -a ntpserver.somewhere @end example ntp-4.2.6p5/sntp/kod_management.c0000644000175000017500000001244111467721004015716 0ustar peterpeter#include #include #include #include #include "kod_management.h" #include "log.h" #include "sntp-opts.h" #include "ntp_stdlib.h" //#define DEBUG int kod_init = 0, kod_db_cnt = 0; const char *kod_db_file; struct kod_entry **kod_db; /* array of pointers to kod_entry */ /* * Search for a KOD entry */ int search_entry ( char *hostname, struct kod_entry **dst ) { register int a, b, resc = 0; for (a = 0; a < kod_db_cnt; a++) if (!strcmp(kod_db[a]->hostname, hostname)) resc++; if (!resc) { *dst = NULL; return 0; } *dst = emalloc(resc * sizeof(**dst)); b = 0; for (a = 0; a < kod_db_cnt; a++) if (!strcmp(kod_db[a]->hostname, hostname)) { (*dst)[b] = *kod_db[a]; b++; } return resc; } void add_entry( char *hostname, char *type /* 4 bytes not \0 terminated */ ) { int n; struct kod_entry *pke; pke = emalloc(sizeof(*pke)); pke->timestamp = time(NULL); memcpy(pke->type, type, 4); pke->type[sizeof(pke->type) - 1] = '\0'; strncpy(pke->hostname, hostname, sizeof(pke->hostname)); pke->hostname[sizeof(pke->hostname) - 1] = '\0'; /* * insert in address ("hostname") order to find duplicates */ for (n = 0; n < kod_db_cnt; n++) if (strcmp(kod_db[n]->hostname, pke->hostname) >= 0) break; if (n < kod_db_cnt && 0 == strcmp(kod_db[n]->hostname, pke->hostname)) { kod_db[n]->timestamp = pke->timestamp; free(pke); return; } kod_db_cnt++; kod_db = erealloc(kod_db, kod_db_cnt * sizeof(kod_db[0])); if (n != kod_db_cnt - 1) memmove(&kod_db[n + 1], &kod_db[n], sizeof(kod_db[0]) * ((kod_db_cnt - 1) - n)); kod_db[n] = pke; } void delete_entry( char *hostname, char *type ) { register int a; for (a = 0; a < kod_db_cnt; a++) if (!strcmp(kod_db[a]->hostname, hostname) && !strcmp(kod_db[a]->type, type)) break; if (a == kod_db_cnt) return; free(kod_db[a]); kod_db_cnt--; if (a < kod_db_cnt) memmove(&kod_db[a], &kod_db[a + 1], (kod_db_cnt - a) * sizeof(kod_db[0])); } void write_kod_db(void) { FILE *db_s; char *pch; int dirmode; register int a; db_s = fopen(kod_db_file, "w"); /* * If opening fails, blindly attempt to create each directory * in the path first, then retry the open. */ if (NULL == db_s && strlen(kod_db_file)) { dirmode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; pch = strchr(kod_db_file + 1, DIR_SEP); while (NULL != pch) { *pch = '\0'; mkdir(kod_db_file, dirmode); *pch = DIR_SEP; pch = strchr(pch + 1, DIR_SEP); } db_s = fopen(kod_db_file, "w"); } if (NULL == db_s) { msyslog(LOG_WARNING, "Can't open KOD db file %s for writing!", kod_db_file); return; } for (a = 0; a < kod_db_cnt; a++) { fprintf(db_s, "%16.16llx %s %s\n", (unsigned long long) kod_db[a]->timestamp, kod_db[a]->type, kod_db[a]->hostname); } fflush(db_s); fclose(db_s); } void kod_init_kod_db( const char *db_file ) { /* * Max. of 254 characters for hostname, 10 for timestamp, 4 for * kisscode, 2 for spaces, 1 for \n, and 1 for \0 */ char fbuf[254+10+4+2+1+1]; FILE *db_s; int a, b, sepc, len; unsigned long long ull; char *str_ptr; char error = 0; atexit(write_kod_db); #ifdef DEBUG printf("Initializing KOD DB...\n"); #endif kod_db_file = estrdup(db_file); db_s = fopen(db_file, "r"); if (NULL == db_s) { msyslog(LOG_WARNING, "kod_init_kod_db(): Cannot open KoD db file %s", db_file); return; } if (ENABLED_OPT(NORMALVERBOSE)) printf("Starting to read KoD file %s...\n", db_file); /* First let's see how many entries there are and check for right syntax */ while (!feof(db_s) && NULL != fgets(fbuf, sizeof(fbuf), db_s)) { /* ignore blank lines */ if ('\n' == fbuf[0]) continue; sepc = 0; len = strlen(fbuf); for (a = 0; a < len; a++) { if (' ' == fbuf[a]) sepc++; if ('\n' == fbuf[a]) { if (sepc != 2) { if (strcmp(db_file, "/dev/null")) msyslog(LOG_DEBUG, "Syntax error in KoD db file %s in line %i (missing space)", db_file, kod_db_cnt + 1); fclose(db_s); return; } sepc = 0; kod_db_cnt++; } } } if (0 == kod_db_cnt) { #ifdef DEBUG printf("KoD DB %s empty.\n", db_file); #endif fclose(db_s); return; } #ifdef DEBUG printf("KoD DB %s contains %d entries, reading...\n", db_file, kod_db_cnt); #endif rewind(db_s); kod_db = emalloc(sizeof(kod_db[0]) * kod_db_cnt); /* Read contents of file */ for (b = 0; !feof(db_s) && !ferror(db_s) && b < kod_db_cnt; b++) { str_ptr = fgets(fbuf, sizeof(fbuf), db_s); if (NULL == str_ptr) { error = 1; break; } /* ignore blank lines */ if ('\n' == fbuf[0]) { b--; continue; } kod_db[b] = emalloc(sizeof(*kod_db[b])); if (3 != sscanf(fbuf, "%llx %4s %254s", &ull, kod_db[b]->type, kod_db[b]->hostname)) { free(kod_db[b]); kod_db[b] = NULL; error = 1; break; } kod_db[b]->timestamp = (time_t)ull; } if (ferror(db_s) || error) { kod_db_cnt = b; msyslog(LOG_WARNING, "An error occured while parsing the KoD db file %s", db_file); fclose(db_s); return; } fclose(db_s); #ifdef DEBUG for (a = 0; a < kod_db_cnt; a++) printf("KoD entry %d: %s at %llx type %s\n", a, kod_db[a]->hostname, (unsigned long long)kod_db[a]->timestamp, kod_db[a]->type); #endif } ntp-4.2.6p5/sntp/ltmain.sh0000755000175000017500000105017111564122423014425 0ustar peterpeter # libtool (GNU libtool) 2.4 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4 TIMESTAMP="" package_revision=1.3293 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${EGREP="grep -E"} : ${FGREP="grep -F"} : ${GREP="grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_apped perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 ntp-4.2.6p5/sntp/sntp-opts.h0000644000175000017500000001756111675460541014740 0ustar peterpeter/* * EDIT THIS FILE WITH CAUTION (sntp-opts.h) * * It has been AutoGen-ed December 24, 2011 at 06:33:53 PM by AutoGen 5.12 * From the definitions sntp-opts.def * and the template file options * * Generated from AutoOpts 35:0:10 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the sntp author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * This source file is copyrighted and licensed under the following terms: * * see html/copyright.html * */ /* * This file contains the programmatic interface to the Automated * Options generated for the sntp program. * These macros are documented in the AutoGen info file in the * "AutoOpts" chapter. Please refer to that doc for usage help. */ #ifndef AUTOOPTS_SNTP_OPTS_H_GUARD #define AUTOOPTS_SNTP_OPTS_H_GUARD 1 #include "config.h" #include /* * Ensure that the library used for compiling this generated header is at * least as new as the version current when the header template was released * (not counting patch version increments). Also ensure that the oldest * tolerable version is at least as old as what was current when the header * template was released. */ #define AO_TEMPLATE_VERSION 143360 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header Choke Me. #endif /* * Enumeration of each option: */ typedef enum { INDEX_OPT_IPV4 = 0, INDEX_OPT_IPV6 = 1, INDEX_OPT_NORMALVERBOSE = 2, INDEX_OPT_KOD = 3, INDEX_OPT_SYSLOG = 4, INDEX_OPT_LOGFILE = 5, INDEX_OPT_SETTOD = 6, INDEX_OPT_ADJTIME = 7, INDEX_OPT_BROADCAST = 8, INDEX_OPT_TIMEOUT = 9, INDEX_OPT_AUTHENTICATION = 10, INDEX_OPT_KEYFILE = 11, INDEX_OPT_VERSION = 12, INDEX_OPT_HELP = 13, INDEX_OPT_MORE_HELP = 14, INDEX_OPT_SAVE_OPTS = 15, INDEX_OPT_LOAD_OPTS = 16 } teOptIndex; #define OPTION_CT 17 #define SNTP_VERSION "4.2.6p5" #define SNTP_FULL_VERSION "sntp 4.2.6p5" /* * Interface defines for all options. Replace "n" with the UPPER_CASED * option name (as in the teOptIndex enumeration above). * e.g. HAVE_OPT(IPV4) */ #define DESC(n) (sntpOptions.pOptDesc[INDEX_OPT_## n]) #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) #define OPT_ARG(n) (DESC(n).optArg.argString) #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) #define COUNT_OPT(n) (DESC(n).optOccCt) #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) #define CLEAR_OPT(n) STMTS( \ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ DESC(n).fOptState |= OPTST_DISABLED; \ DESC(n).optCookie = NULL ) /* * * * * * * * Enumeration of sntp exit codes */ typedef enum { SNTP_EXIT_SUCCESS = 0, SNTP_EXIT_FAILURE = 1 } sntp_exit_code_t; /* * Make sure there are no #define name conflicts with the option names */ #ifndef NO_OPTION_NAME_WARNINGS # ifdef IPV4 # warning undefining IPV4 due to option name conflict # undef IPV4 # endif # ifdef IPV6 # warning undefining IPV6 due to option name conflict # undef IPV6 # endif # ifdef NORMALVERBOSE # warning undefining NORMALVERBOSE due to option name conflict # undef NORMALVERBOSE # endif # ifdef KOD # warning undefining KOD due to option name conflict # undef KOD # endif # ifdef SYSLOG # warning undefining SYSLOG due to option name conflict # undef SYSLOG # endif # ifdef LOGFILE # warning undefining LOGFILE due to option name conflict # undef LOGFILE # endif # ifdef SETTOD # warning undefining SETTOD due to option name conflict # undef SETTOD # endif # ifdef ADJTIME # warning undefining ADJTIME due to option name conflict # undef ADJTIME # endif # ifdef BROADCAST # warning undefining BROADCAST due to option name conflict # undef BROADCAST # endif # ifdef TIMEOUT # warning undefining TIMEOUT due to option name conflict # undef TIMEOUT # endif # ifdef AUTHENTICATION # warning undefining AUTHENTICATION due to option name conflict # undef AUTHENTICATION # endif # ifdef KEYFILE # warning undefining KEYFILE due to option name conflict # undef KEYFILE # endif #else /* NO_OPTION_NAME_WARNINGS */ # undef IPV4 # undef IPV6 # undef NORMALVERBOSE # undef KOD # undef SYSLOG # undef LOGFILE # undef SETTOD # undef ADJTIME # undef BROADCAST # undef TIMEOUT # undef AUTHENTICATION # undef KEYFILE #endif /* NO_OPTION_NAME_WARNINGS */ /* * * * * * * * Interface defines for specific options. */ #define VALUE_OPT_IPV4 '4' #define VALUE_OPT_IPV6 '6' #define VALUE_OPT_NORMALVERBOSE 'd' #define VALUE_OPT_KOD 'K' #define VALUE_OPT_SYSLOG 'p' #define VALUE_OPT_LOGFILE 'l' #define VALUE_OPT_SETTOD 's' #define VALUE_OPT_ADJTIME 'j' #define VALUE_OPT_BROADCAST 'b' #define VALUE_OPT_TIMEOUT 't' #define OPT_VALUE_TIMEOUT (DESC(TIMEOUT).optArg.argInt) #define VALUE_OPT_AUTHENTICATION 'a' #define OPT_VALUE_AUTHENTICATION (DESC(AUTHENTICATION).optArg.argInt) #define VALUE_OPT_KEYFILE 'k' #define VALUE_OPT_HELP '?' #define VALUE_OPT_MORE_HELP '!' #define VALUE_OPT_VERSION INDEX_OPT_VERSION #define VALUE_OPT_SAVE_OPTS '>' #define VALUE_OPT_LOAD_OPTS '<' #define SET_OPT_SAVE_OPTS(a) STMTS( \ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \ DESC(SAVE_OPTS).fOptState |= OPTST_SET; \ DESC(SAVE_OPTS).optArg.argString = (char const*)(a) ) /* * Interface defines not associated with particular options */ #define ERRSKIP_OPTERR STMTS(sntpOptions.fOptSet &= ~OPTPROC_ERRSTOP) #define ERRSTOP_OPTERR STMTS(sntpOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_OPT(n) STMTS( \ sntpOptions.curOptIdx = (n); \ sntpOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) #define USAGE(c) (*sntpOptions.pUsageProc)(&sntpOptions, c) /* extracted from opthead.tlib near line 451 */ #ifdef __cplusplus extern "C" { #endif /* * * * * * * * Declare the sntp option descriptor. */ extern tOptions sntpOptions; #if defined(ENABLE_NLS) # ifndef _ # include static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); } # define _(s) aoGetsText(s) # endif /* _() */ # define OPT_NO_XLAT_CFG_NAMES STMTS(sntpOptions.fOptSet |= \ OPTPROC_NXLAT_OPT_CFG;) # define OPT_NO_XLAT_OPT_NAMES STMTS(sntpOptions.fOptSet |= \ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) # define OPT_XLAT_CFG_NAMES STMTS(sntpOptions.fOptSet &= \ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) # define OPT_XLAT_OPT_NAMES STMTS(sntpOptions.fOptSet &= \ ~OPTPROC_NXLAT_OPT;) #else /* ENABLE_NLS */ # define OPT_NO_XLAT_CFG_NAMES # define OPT_NO_XLAT_OPT_NAMES # define OPT_XLAT_CFG_NAMES # define OPT_XLAT_OPT_NAMES # ifndef _ # define _(_s) _s # endif #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif #endif /* AUTOOPTS_SNTP_OPTS_H_GUARD */ /* sntp-opts.h ends here */ ntp-4.2.6p5/sntp/Makefile.am0000644000175000017500000001170511510477207014641 0ustar peterpeter# Makefile.am for JMK's SNTP, by Harlan Stenn NULL = ## LIBOPTS_CHECK_NOBUILD works with Automake 1.10 now AUTOMAKE_OPTIONS = foreign 1.10 ACLOCAL_AMFLAGS = -I ../m4 -I libopts/m4 AM_CPPFLAGS = $(LIBOPTS_CFLAGS) -I$(top_srcdir)/../include \ -I$(top_srcdir)/../lib/isc/include \ -I$(top_srcdir)/../lib/isc/nothreads/include \ -I$(top_srcdir)/../lib/isc/unix/include LDADD = $(LIBOPTS_LDADD) $(LIBM) ../libntp/libntp.a @LCRYPTO@ run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \ autogen -L ../include --writable if NTP_BINSUBDIR_IS_BIN bin_PROGRAMS = sntp else sbin_PROGRAMS = sntp endif CLEANFILES = check-COPYRIGHT-submake SUBDIRS = if NEED_LIBOPTS SUBDIRS += libopts endif sntp_SOURCES = \ crypto.c \ crypto.h \ data_formats.h \ header.h \ kod_management.c \ kod_management.h \ log.c \ log.h \ main.c \ main.h \ networking.c \ networking.h \ sntp.c \ sntp-opts.c \ sntp-opts.h \ utilities.c \ utilities.h \ $(NULL) EXTRA_DIST = \ $(srcdir)/autogen-version.def \ bincheck.mf \ $(srcdir)/COPYRIGHT \ deps-ver \ depsver.mf \ sntp-opts.def \ sntp-opts.menu \ sntp-opts.texi \ sntp.1 \ sntp.html \ sntp.texi \ $(srcdir)/version.def \ $(srcdir)/version.m4 \ $(srcdir)/version.texi \ $(NULL) OLD_EXTRA_DIST= \ autogen-version.def version.def version.m4 version.texi BUILT_SOURCES= \ check-autogen-version.def \ check-version.def \ check-version.m4 \ check-version.texi \ $(srcdir)/COPYRIGHT \ libtool \ $(srcdir)/sntp-opts.c \ $(srcdir)/sntp-opts.h \ $(NULL) man_MANS= $(srcdir)/sntp.1 # HMS: Real Soon Now... #info_TEXINFOS= sntp.texi #sntp_TEXINFOS= sntp-opts.texi noinst_DATA= \ $(srcdir)/sntp.html \ $(srcdir)/sntp-opts.texi \ $(srcdir)/sntp-opts.menu \ $(NULL) FRC: @: do-nothing action to prevent default SCCS get @: FRC "force" depends on nothing and is not a file, so is @: always out-of-date causing targets which depend on it to @: similarly always be outdated causing their rules to fire @: each time they or a dependent is built. check-autogen-version.def: FRC @cd $(srcdir) \ && test -r ../include/autogen-version.def \ && ( if cmp -s ../include/autogen-version.def autogen-version.def; \ then : ; \ else cp ../include/autogen-version.def autogen-version.def; \ echo "Installing new sntp/autogen-version.def file"; \ fi ) $(srcdir)/autogen-version.def: $(MAKE) check-autogen-version.def check-version.def: FRC @cd $(srcdir) \ && test -r ../include/version.def \ && ( if cmp -s ../include/version.def version.def; \ then : ; \ else cp ../include/version.def version.def; \ echo "Installing new sntp/version.def file"; \ fi ) $(srcdir)/version.def: $(MAKE) check-version.def check-version.m4: FRC @cd $(srcdir) \ && test -r ../version.m4 \ && ( if cmp -s ../version.m4 version.m4; \ then : ; \ else cp ../version.m4 version.m4; \ echo "Installing new sntp/version.m4 file"; \ fi ) $(srcdir)/version.m4: $(MAKE) check-version.m4 check-version.texi: FRC @cd $(srcdir) \ && test -r ../include/version.texi \ && ( if cmp -s ../include/version.texi version.texi; \ then : ; \ else cp ../include/version.texi version.texi; \ echo "Installing new sntp/version.texi file"; \ fi ) $(srcdir)/version.texi: $(MAKE) check-version.texi $(srcdir)/../COPYRIGHT: cd .. && $(MAKE) COPYRIGHT-please check-COPYRIGHT-submake: $(srcdir)/../COPYRIGHT @cmp -s $(srcdir)/../COPYRIGHT $(srcdir)/COPYRIGHT \ || { cp $(srcdir)/../COPYRIGHT $(srcdir) \ && echo 'updated sntp/COPYRIGHT installed' ;} @echo 'submake avoided if this file is newer than parent COPYRIGHT' > $@ check-COPYRIGHT: FRC [ ! -r $(srcdir)/../COPYRIGHT ] \ || [ check-COPYRIGHT-submake -nt $(srcdir)/../COPYRIGHT ] \ || $(MAKE) check-COPYRIGHT-submake $(srcdir)/COPYRIGHT: check-COPYRIGHT @: do-nothing action to prevent any default $(srcdir)/sntp-opts.h: $(srcdir)/sntp-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/sntp-opts.c: $(srcdir)/sntp-opts.def $(srcdir)/version.def $(srcdir)/../include/copyright.def $(run_ag) sntp-opts.def $(srcdir)/sntp.1: $(srcdir)/sntp-opts.def $(srcdir)/version.def $(srcdir)/../include/copyright.def $(run_ag) -Tagman1.tpl -bsntp sntp-opts.def $(srcdir)/sntp-opts.menu: $(srcdir)/sntp-opts.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/sntp-opts.texi: $(srcdir)/sntp-opts.def $(srcdir)/version.def $(srcdir)/../include/copyright.def $(run_ag) -Taginfo.tpl -DLEVEL=section sntp-opts.def $(top_srcdir)/../scripts/check--help $@ $(srcdir)/sntp.html: $(srcdir)/sntp-opts.menu $(srcdir)/sntp-opts.texi $(srcdir)/sntp.texi $(srcdir)/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o sntp.html sntp.texi || true ) ../libntp/libntp.a: cd ../libntp && $(MAKE) libntp.a libtool: $(LIBTOOL_DEPS) ./config.status --recheck include $(top_srcdir)/bincheck.mf include $(top_srcdir)/depsver.mf ntp-4.2.6p5/sntp/kod_management.h0000644000175000017500000000056711307651616015735 0ustar peterpeter#ifndef KOD_MANAGEMENT_H #define KOD_MANAGEMENT_H #include struct kod_entry { char hostname[255]; time_t timestamp; char type[5]; }; int search_entry(char *hostname, struct kod_entry **dst); void add_entry(char *hostname, char *type); void delete_entry(char *hostname, char *type); void kod_init_kod_db(const char *db_file); void write_kod_db(void); #endif ntp-4.2.6p5/sntp/bincheck.mf0000644000175000017500000000100211675457724014702 0ustar peterpeter# we traditionally installed software in bindir, while it should have gone # in sbindir. Now that we offer a choice, look in the "other" installation # subdir to warn folks if there is another version there. install-exec-hook: @case ${BINSUBDIR} in \ bin) ODIR=${sbindir} ;; \ sbin) ODIR=${bindir} ;; \ esac; \ test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \ test ! -f $$ODIR/$$i || echo "*** $$i is also in $$ODIR!"; \ done # ntp-4.2.6p5/sntp/autogen-version.def0000644000175000017500000000011211564122255016377 0ustar peterpeter#assert (version-compare >= autogen-version "5.11.9") guard-option-names; ntp-4.2.6p5/sntp/aclocal.m40000644000175000017500000010655511675460453014464 0ustar peterpeter# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file 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. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file 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. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file 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. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file 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. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file 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. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([libopts/m4/libopts.m4]) m4_include([../m4/libtool.m4]) m4_include([../m4/ltoptions.m4]) m4_include([../m4/ltsugar.m4]) m4_include([../m4/ltversion.m4]) m4_include([../m4/lt~obsolete.m4]) m4_include([../m4/ntp_cacheversion.m4]) m4_include([../m4/ntp_dir_sep.m4]) m4_include([../m4/ntp_lib_m.m4]) m4_include([../m4/ntp_openssl.m4]) ntp-4.2.6p5/sntp/sntp.10000644000175000017500000001603111675460547013663 0ustar peterpeter.TH SNTP 1 2011-12-24 "( 4.2.6p5)" "Programmer's Manual" .\" EDIT THIS FILE WITH CAUTION (sntp.1) .\" .\" It has been AutoGen-ed December 24, 2011 at 06:33:59 PM by AutoGen 5.12 .\" From the definitions sntp-opts.def .\" and the template file agman1.tpl .\" .SH NAME sntp \- standard Simple Network Time Protocol program .SH SYNOPSIS .B sntp .\" Mixture of short (flag) options and long options .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..." .br .in +8 [ hostname-or-IP ...] .PP .SH "DESCRIPTION" This manual page briefly documents the \fBsntp\fP command. .I sntp can be used as a SNTP client to query a NTP or SNTP server and either display the time or set the local system's time (given suitable privilege). It can be run as an interactive command or in a .I cron job. NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol) are defined and described by RFC 5905. .PP The default is to write the estimated correct local date and time (i.e. not UTC) to the standard output in a format like .BR "'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs'" , where the .B "'(+0800)'" means that to get to UTC from the reported local time one must add 8 hours and 0 minutes, and the .B "'+4.567 +/- 0.089 secs'" indicates the local clock is 4.567 seconds behind the correct time (so 4.567 seconds must be added to the local clock to get it to be correct), and the time of '1996-10-15 20:17:25.123' is believed to be correct to within +/- 0.089 seconds. .SH OPTIONS .TP .BR \-4 ", " \--ipv4 Force IPv4 DNS name resolution. This option must not appear in combination with any of the following options: ipv6. .sp Force DNS resolution of the following host names on the command line to the IPv4 namespace. .TP .BR \-6 ", " \--ipv6 Force IPv6 DNS name resolution. This option must not appear in combination with any of the following options: ipv4. .sp Force DNS resolution of the following host names on the command line to the IPv6 namespace. .TP .BR \-d ", " \--normalverbose Normal verbose. .sp Diagnostic messages for non-fatal errors and a limited amount of tracing should be written to standard error. Fatal ones always produce a diagnostic. This option should be set when there is a suspected problem with the server, network or the source. .TP .BR \-K " \fIfile-name\fP, " \--kod "=" \fIfile-name\fP KoD history filename. .sp Specifies the filename to be used to persist the history of KoD responses received from servers. The default is /var/db/ntp-kod. .TP .BR \-p ", " \--syslog Logging with syslog. This option must not appear in combination with any of the following options: logfile. .sp When this option is set all logging will be done using syslog. .TP .BR \-l " \fIfile-name\fP, " \--logfile "=" \fIfile-name\fP Log to specified logfile. This option must not appear in combination with any of the following options: syslog. .sp This option causes the client to write log messages to the specified logfile. .TP .BR \-s ", " \--settod Set (step) the time with settimeofday(). This option must not appear in combination with any of the following options: adjtime. .sp .TP .BR \-j ", " \--adjtime Set (slew) the time with adjtime(). This option must not appear in combination with any of the following options: settod. .sp .TP .BR \-b " \fIbroadcast-address\fP, " \--broadcast "=" \fIbroadcast-address\fP Use broadcasts to the address specified for synchronisation. .sp If specified SNTP will listen to the specified broadcast address for NTP broadcasts. The default maximum wait time, 68 seconds, can be modified with \-t. .TP .BR \-t " \fIseconds\fP, " \--timeout "=" \fIseconds\fP Specify the number of seconds to wait for broadcasts. This option takes an integer number as its argument. The default \fIseconds\fP for this option is: .ti +4 68 .sp When waiting for a broadcast packet SNTP will wait the number of seconds specified before giving up. Default 68 seconds. .TP .BR \-a " \fIauth-keynumber\fP, " \--authentication "=" \fIauth-keynumber\fP Enable authentication with the key auth-keynumber. This option takes an integer number as its argument. .sp This option enables authentication using the key specified in this option's argument. The argument of this option is the keyid, a number specified in the keyfile as this key's identifier. See the keyfile option (-k) for more details. .TP .BR \-k " \fIfile-name\fP, " \--keyfile "=" \fIfile-name\fP Specify a keyfile. SNTP will look in this file for the key specified with \-a. .sp This option specifies the keyfile. SNTP will search for the key specified with \-a keyno in this file. Key files follow the following format: keyid keytype key Where keyid is a number identifying this key keytype is one of the follow: S Key in 64 Bit hexadecimal number as specified in in the DES specification. N Key in 64 Bit hexadecimal number as specified in the NTP standard. A Key in a 1-to-8 character ASCII string. M Key in a 1-to-8 character ASCII string using the MD5 authentication scheme. For more information see ntp.keys(5). .TP .BR \-? , " \--help" Display extended usage information and exit. .TP .BR \-! , " \--more-help" Extended usage information passed thru pager. .TP .BR \-> " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]" Save the option state to \fIrcfile\fP. The default is the \fIlast\fP configuration file listed in the \fBOPTION PRESETS\fP section, below. .TP .BR \-< " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts" Load options from \fIrcfile\fP. The \fIno-load-opts\fP form will disable the loading of earlier RC/INI files. \fI--no-load-opts\fP is handled early, out of order. .TP .BR \- " [{\fIv|c|n\fP}]," " \--version" "[=\fI{v|c|n}\fP]" 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. .SH OPTION PRESETS Any option that is not marked as \fInot presettable\fP may be preset by loading values from configuration ("RC" or ".INI") file(s) and values from environment variables named: .nf \fBSNTP_\fP or \fBSNTP\fP .fi .ad The environmental presets take precedence (are processed later than) the configuration files. The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". If any of these are directories, then the file \fI.ntprc\fP is searched for within those directories. .SH USAGE The simplest use of this program is as an unprivileged command to check the current time and error in the local clock. For example: .IP .B sntp ntpserver.somewhere .PP With suitable privilege, it can be run as a command or in a .I cron job to reset the local clock from a reliable server, like the .I ntpdate and .I rdate commands. For example: .IP .B sntp \-a ntpserver.somewhere .SH RETURN VALUE The program returns a zero exit status for success, and a non-zero one otherwise. .SH BUGS Please report bugs to http://bugs.ntp.org . .SH AUTHOR David L. Mills and/or others .br Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org .PP .nf .na see html/copyright.html .fi .ad .PP This manual page was \fIAutoGen\fP-erated from the \fBsntp\fP option definitions. ntp-4.2.6p5/sntp/main.c0000644000175000017500000002555611636775106013716 0ustar peterpeter#include #include "main.h" #include "kod_management.h" #include "networking.h" #include "utilities.h" #include "log.h" int ai_fam_pref = AF_UNSPEC; struct key *keys = NULL; void set_li_vn_mode (struct pkt *spkt, char leap, char version, char mode); int sntp_main (int argc, char **argv); int on_wire (struct addrinfo *host, struct addrinfo *bcastaddr); int set_time (double offset); #define NORMALIZE_TIMEVAL(tv) \ do { \ while ((tv).tv_usec < 0) { \ (tv).tv_usec += 1000000; \ (tv).tv_sec--; \ } \ while ((tv).tv_usec > 999999) { \ (tv).tv_usec -= 1000000; \ (tv).tv_sec++; \ } \ } while (0) /* * The actual main function. */ int sntp_main ( int argc, char **argv ) { register int c; struct kod_entry *reason = NULL; int optct; /* boolean, u_int quiets gcc4 signed overflow warning */ u_int sync_data_suc; struct addrinfo **bcastaddr = NULL; struct addrinfo **resh = NULL; struct addrinfo *ai; int resc; int kodc; int ow_ret; int bcast = 0; char *hostname; optct = optionProcess(&sntpOptions, argc, argv); argc -= optct; argv += optct; /* Initialize logging system */ init_logging(); if (HAVE_OPT(LOGFILE)) open_logfile(OPT_ARG(LOGFILE)); msyslog(LOG_NOTICE, "Started sntp"); /* IPv6 available? */ if (isc_net_probeipv6() != ISC_R_SUCCESS) { ai_fam_pref = AF_INET; #ifdef DEBUG printf("No ipv6 support available, forcing ipv4\n"); #endif } else { /* Check for options -4 and -6 */ if (HAVE_OPT(IPV4)) ai_fam_pref = AF_INET; else if (HAVE_OPT(IPV6)) ai_fam_pref = AF_INET6; } /* Parse config file if declared TODO */ /* * If there's a specified KOD file init KOD system. If not use * default file. For embedded systems with no writable * filesystem, -K /dev/null can be used to disable KoD storage. */ if (HAVE_OPT(KOD)) kod_init_kod_db(OPT_ARG(KOD)); else kod_init_kod_db("/var/db/ntp-kod"); if (HAVE_OPT(KEYFILE)) auth_init(OPT_ARG(KEYFILE), &keys); #ifdef EXERCISE_KOD_DB add_entry("192.168.169.170", "DENY"); add_entry("192.168.169.171", "DENY"); add_entry("192.168.169.172", "DENY"); add_entry("192.168.169.173", "DENY"); add_entry("192.168.169.174", "DENY"); delete_entry("192.168.169.174", "DENY"); delete_entry("192.168.169.172", "DENY"); delete_entry("192.168.169.170", "DENY"); if ((kodc = search_entry("192.168.169.173", &reason)) == 0) printf("entry for 192.168.169.173 not found but should have been!\n"); else free(reason); #endif /* Considering employing a variable that prevents functions of doing anything until * everything is initialized properly */ resc = resolve_hosts((const char **)argv, argc, &resh, ai_fam_pref); if (resc < 1) { printf("Unable to resolve hostname(s)\n"); return -1; } bcast = ENABLED_OPT(BROADCAST); if (bcast) { const char * myargv[2]; myargv[0] = OPT_ARG(BROADCAST); myargv[1] = NULL; bcast = resolve_hosts(myargv, 1, &bcastaddr, ai_fam_pref); } /* Select a certain ntp server according to simple criteria? For now * let's just pay attention to previous KoDs. */ sync_data_suc = FALSE; for (c = 0; c < resc && !sync_data_suc; c++) { ai = resh[c]; do { hostname = addrinfo_to_str(ai); if ((kodc = search_entry(hostname, &reason)) == 0) { if (is_reachable(ai)) { ow_ret = on_wire(ai, bcast ? bcastaddr[0] : NULL); if (0 == ow_ret) sync_data_suc = TRUE; } } else { printf("%d prior KoD%s for %s, skipping.\n", kodc, (kodc > 1) ? "s" : "", hostname); free(reason); } free(hostname); ai = ai->ai_next; } while (NULL != ai); freeaddrinfo(resh[c]); } free(resh); if (!sync_data_suc) return 1; return 0; } static union { struct pkt pkt; char buf[1500]; } rbuf; #define r_pkt rbuf.pkt int generate_pkt ( struct pkt *x_pkt, const struct timeval *tv_xmt, int key_id, struct key *pkt_key ) { l_fp xmt; int pkt_len = LEN_PKT_NOMAC; memset(x_pkt, 0, sizeof(struct pkt)); TVTOTS(tv_xmt, &xmt); HTONL_FP(&xmt, &(x_pkt->xmt)); x_pkt->stratum = STRATUM_TO_PKT(STRATUM_UNSPEC); x_pkt->ppoll = 8; /* FIXME! Modus broadcast + adr. check -> bdr. pkt */ set_li_vn_mode(x_pkt, LEAP_NOTINSYNC, 4, 3); if (pkt_key != NULL) { int mac_size = 20; /* max room for MAC */ x_pkt->exten[0] = htonl(key_id); mac_size = make_mac((char *)x_pkt, pkt_len, mac_size, pkt_key, (char *)&x_pkt->exten[1]); if (mac_size) pkt_len += mac_size + 4; } return pkt_len; } int handle_pkt ( int rpktl, struct pkt *rpkt, struct addrinfo *host ) { struct timeval tv_dst; int sw_case, digits; char *hostname = NULL, *ref, *ts_str = NULL; double offset, precision, root_dispersion; char addr_buf[INET6_ADDRSTRLEN]; char *p_SNTP_PRETEND_TIME; time_t pretend_time; if(rpktl > 0) sw_case = 1; else sw_case = rpktl; switch(sw_case) { case SERVER_UNUSEABLE: return -1; break; case PACKET_UNUSEABLE: break; case SERVER_AUTH_FAIL: break; case KOD_DEMOBILIZE: /* Received a DENY or RESTR KOD packet */ hostname = addrinfo_to_str(host); ref = (char *)&rpkt->refid; add_entry(hostname, ref); if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp handle_pkt: Received KOD packet with code: %c%c%c%c from %s, demobilizing all connections\n", ref[0], ref[1], ref[2], ref[3], hostname); msyslog(LOG_WARNING, "Received a KOD packet with code %c%c%c%c from %s, demobilizing all connections", ref[0], ref[1], ref[2], ref[3], hostname); break; case KOD_RATE: /* Hmm... probably we should sleep a bit here */ break; case 1: if (ENABLED_OPT(NORMALVERBOSE)) { getnameinfo(host->ai_addr, host->ai_addrlen, addr_buf, sizeof(addr_buf), NULL, 0, NI_NUMERICHOST); printf("sntp handle_pkt: Received %i bytes from %s\n", rpktl, addr_buf); } GETTIMEOFDAY(&tv_dst, (struct timezone *)NULL); p_SNTP_PRETEND_TIME = getenv("SNTP_PRETEND_TIME"); if (p_SNTP_PRETEND_TIME) { #if SIZEOF_TIME_T == 4 sscanf(p_SNTP_PRETEND_TIME, "%ld", &pretend_time); #elif SIZEOF_TIME_T == 8 sscanf(p_SNTP_PRETEND_TIME, "%lld", &pretend_time); #else # include "GRONK: unexpected value for SIZEOF_TIME_T" #endif tv_dst.tv_sec = pretend_time; } offset_calculation(rpkt, rpktl, &tv_dst, &offset, &precision, &root_dispersion); for (digits = 0; (precision *= 10.) < 1.; ++digits) /* empty */ ; if (digits > 6) digits = 6; ts_str = tv_to_str(&tv_dst); printf("%s ", ts_str); if (offset > 0) printf("+"); printf("%.*f", digits, offset); if (root_dispersion > 0.) printf(" +/- %f secs", root_dispersion); printf("\n"); free(ts_str); if (p_SNTP_PRETEND_TIME) return 0; if (ENABLED_OPT(SETTOD) || ENABLED_OPT(ADJTIME)) return set_time(offset); return 0; } return 1; } void offset_calculation ( struct pkt *rpkt, int rpktl, struct timeval *tv_dst, double *offset, double *precision, double *root_dispersion ) { l_fp p_rec, p_xmt, p_ref, p_org, tmp, dst; u_fp p_rdly, p_rdsp; double t21, t34, delta; /* Convert timestamps from network to host byte order */ p_rdly = NTOHS_FP(rpkt->rootdelay); p_rdsp = NTOHS_FP(rpkt->rootdisp); NTOHL_FP(&rpkt->reftime, &p_ref); NTOHL_FP(&rpkt->org, &p_org); NTOHL_FP(&rpkt->rec, &p_rec); NTOHL_FP(&rpkt->xmt, &p_xmt); *precision = LOGTOD(rpkt->precision); #ifdef DEBUG printf("sntp precision: %f\n", *precision); #endif /* DEBUG */ *root_dispersion = FPTOD(p_rdsp); #ifdef DEBUG printf("sntp rootdelay: %f\n", FPTOD(p_rdly)); printf("sntp rootdisp: %f\n", *root_dispersion); pkt_output(rpkt, rpktl, stdout); printf("sntp offset_calculation: rpkt->reftime:\n"); l_fp_output(&(rpkt->reftime), stdout); printf("sntp offset_calculation: rpkt->org:\n"); l_fp_output(&(rpkt->org), stdout); printf("sntp offset_calculation: rpkt->rec:\n"); l_fp_output(&(rpkt->rec), stdout); printf("sntp offset_calculation: rpkt->rec:\n"); l_fp_output_bin(&(rpkt->rec), stdout); printf("sntp offset_calculation: rpkt->rec:\n"); l_fp_output_dec(&(rpkt->rec), stdout); printf("sntp offset_calculation: rpkt->xmt:\n"); l_fp_output(&(rpkt->xmt), stdout); #endif /* Compute offset etc. */ tmp = p_rec; L_SUB(&tmp, &p_org); LFPTOD(&tmp, t21); TVTOTS(tv_dst, &dst); dst.l_ui += JAN_1970; tmp = p_xmt; L_SUB(&tmp, &dst); LFPTOD(&tmp, t34); *offset = (t21 + t34) / 2.; delta = t21 - t34; if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp offset_calculation:\tt21: %.6f\t\t t34: %.6f\n\t\tdelta: %.6f\t offset: %.6f\n", t21, t34, delta, *offset); } /* The heart of (S)NTP, exchange NTP packets and compute values to correct the local clock */ int on_wire ( struct addrinfo *host, struct addrinfo *bcast ) { char addr_buf[INET6_ADDRSTRLEN]; register int try; SOCKET sock; struct key *pkt_key = NULL; int key_id = 0; struct timeval tv_xmt; struct pkt x_pkt; int error, rpktl, handle_pkt_res; if (ENABLED_OPT(AUTHENTICATION)) { key_id = (int) OPT_ARG(AUTHENTICATION); get_key(key_id, &pkt_key); } for (try=0; try<5; try++) { memset(&r_pkt, 0, sizeof rbuf); error = GETTIMEOFDAY(&tv_xmt, (struct timezone *)NULL); tv_xmt.tv_sec += JAN_1970; #ifdef DEBUG printf("sntp on_wire: Current time sec: %i msec: %i\n", (unsigned int) tv_xmt.tv_sec, (unsigned int) tv_xmt.tv_usec); #endif if (bcast) { create_socket(&sock, (sockaddr_u *)bcast->ai_addr); rpktl = recv_bcst_pkt(sock, &r_pkt, sizeof rbuf, (sockaddr_u *)bcast->ai_addr); closesocket(sock); } else { int pkt_len = generate_pkt(&x_pkt, &tv_xmt, key_id, pkt_key); create_socket(&sock, (sockaddr_u *)host->ai_addr); sendpkt(sock, (sockaddr_u *)host->ai_addr, &x_pkt, pkt_len); rpktl = recvpkt(sock, &r_pkt, sizeof rbuf, &x_pkt); closesocket(sock); } handle_pkt_res = handle_pkt(rpktl, &r_pkt, host); if (handle_pkt_res < 1) return handle_pkt_res; } getnameinfo(host->ai_addr, host->ai_addrlen, addr_buf, sizeof(addr_buf), NULL, 0, NI_NUMERICHOST); msyslog(LOG_DEBUG, "Received no useable packet from %s!", addr_buf); return -1; } /* Compute the 8 bits for li_vn_mode */ void set_li_vn_mode ( struct pkt *spkt, char leap, char version, char mode ) { if (leap > 3) { msyslog(LOG_DEBUG, "set_li_vn_mode: leap > 3 using max. 3"); leap = 3; } if (mode > 7) { msyslog(LOG_DEBUG, "set_li_vn_mode: mode > 7, using client mode 3"); mode = 3; } spkt->li_vn_mode = leap << 6; spkt->li_vn_mode |= version << 3; spkt->li_vn_mode |= mode; } /* set_time corrects the local clock by offset with either settimeofday() or by default * with adjtime()/adjusttimeofday(). */ int set_time( double offset ) { struct timeval tp; if (ENABLED_OPT(SETTOD)) { GETTIMEOFDAY(&tp, NULL); tp.tv_sec += (long)offset; tp.tv_usec += 1e6 * (offset - (long)offset); NORMALIZE_TIMEVAL(tp); if (SETTIMEOFDAY(&tp, NULL) < 0) { msyslog(LOG_ERR, "Time not set: settimeofday(): %m"); return -1; } return 0; } tp.tv_sec = (long)offset; tp.tv_usec = 1e6 * (offset - (long)offset); NORMALIZE_TIMEVAL(tp); if (ADJTIMEOFDAY(&tp, NULL) < 0) { msyslog(LOG_ERR, "Time not set: adjtime(): %m"); return -1; } return 0; } ntp-4.2.6p5/sntp/log.h0000644000175000017500000000067111474355436013547 0ustar peterpeter#ifndef LOG_H #define LOG_H #include "ntp.h" #include "ntp_stdlib.h" #include #include #include #include #include /* syslog as ntpd does, even though we are not a daemon */ #ifdef LOG_NTP # define OPENLOG_FAC LOG_NTP #else # ifndef LOG_DAEMON # define LOG_DAEMON 0 # endif # define OPENLOG_FAC LOG_DAEMON #endif void init_logging(void); void open_logfile(const char *logfile); #endif ntp-4.2.6p5/sntp/crypto.c0000644000175000017500000000747511467721004014300 0ustar peterpeter#include #include "crypto.h" #include struct key *key_ptr; int key_cnt = 0; int make_mac( char *pkt_data, int pkt_size, int mac_size, struct key *cmp_key, char * digest ) { u_int len = mac_size; int key_type; EVP_MD_CTX ctx; if (cmp_key->key_len > 64) return 0; if (pkt_size % 4 != 0) return 0; INIT_SSL(); key_type = keytype_from_text(cmp_key->type, NULL); EVP_DigestInit(&ctx, EVP_get_digestbynid(key_type)); EVP_DigestUpdate(&ctx, (u_char *)cmp_key->key_seq, (u_int)cmp_key->key_len); EVP_DigestUpdate(&ctx, (u_char *)pkt_data, (u_int)pkt_size); EVP_DigestFinal(&ctx, (u_char *)digest, &len); return (int)len; } /* Generates a md5 digest of the key specified in keyid concatinated with the * ntp packet (exluding the MAC) and compares this digest to the digest in * the packet's MAC. If they're equal this function returns 1 (packet is * authentic) or else 0 (not authentic). */ int auth_md5( char *pkt_data, int pkt_size, int mac_size, struct key *cmp_key ) { int hash_len; int authentic; char digest[20]; if (mac_size > sizeof(digest)) return 0; hash_len = make_mac(pkt_data, pkt_size, sizeof(digest), cmp_key, digest); if (!hash_len) authentic = FALSE; else authentic = !memcmp(digest, pkt_data + pkt_size + 4, hash_len); return authentic; } static int hex_val( unsigned char x ) { int val; if ('0' <= x && x <= '9') val = x - '0'; else if ('a' <= x && x <= 'f') val = x - 'a' + 0xa; else if ('A' <= x && x <= 'F') val = x - 'A' + 0xA; else val = -1; return val; } /* Load keys from the specified keyfile into the key structures. * Returns -1 if the reading failed, otherwise it returns the * number of keys it read */ int auth_init( const char *keyfile, struct key **keys ) { FILE *keyf = fopen(keyfile, "r"); struct key *prev = NULL; int scan_cnt, line_cnt = 0; char kbuf[200]; char keystring[129]; if (keyf == NULL) { if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp auth_init: Couldn't open key file %s for reading!\n", keyfile); return -1; } if (feof(keyf)) { if (ENABLED_OPT(NORMALVERBOSE)) printf("sntp auth_init: Key file %s is empty!\n", keyfile); fclose(keyf); return -1; } key_cnt = 0; while (!feof(keyf)) { char * octothorpe; struct key *act = emalloc(sizeof(struct key)); int goodline = 0; if (NULL == fgets(kbuf, sizeof(kbuf), keyf)) continue; kbuf[sizeof(kbuf) - 1] = '\0'; octothorpe = strchr(kbuf, '#'); if (octothorpe) *octothorpe = '\0'; scan_cnt = sscanf(kbuf, "%d %9s %128s", &act->key_id, act->type, keystring); if (scan_cnt == 3) { int len = strlen(keystring); if (len <= 20) { act->key_len = len; memcpy(act->key_seq, keystring, len + 1); goodline = 1; } else if ((len & 1) != 0) { goodline = 0; /* it's bad */ } else { int j; goodline = 1; act->key_len = len >> 1; for (j = 0; j < len; j+=2) { int val; val = (hex_val(keystring[j]) << 4) | hex_val(keystring[j+1]); if (val < 0) { goodline = 0; /* it's bad */ break; } act->key_seq[j>>1] = (char)val; } } } if (goodline) { act->next = NULL; if (NULL == prev) *keys = act; else prev->next = act; prev = act; key_cnt++; } else { msyslog(LOG_DEBUG, "auth_init: scanf %d items, skipping line %d.", scan_cnt, line_cnt); free(act); } line_cnt++; } fclose(keyf); key_ptr = *keys; return key_cnt; } /* Looks for the key with keyid key_id and sets the d_key pointer to the * address of the key. If no matching key is found the pointer is not touched. */ void get_key( int key_id, struct key **d_key ) { struct key *itr_key; if (key_cnt == 0) return; for (itr_key = key_ptr; itr_key; itr_key = itr_key->next) { if (itr_key->key_id == key_id) { *d_key = itr_key; break; } } return; } ntp-4.2.6p5/sntp/sntp-opts.def0000644000175000017500000001631311636775106015244 0ustar peterpeter/* -*- Mode: Text -*- */ autogen definitions options; #include autogen-version.def #include copyright.def prog-name = "sntp"; prog-title = "standard Simple Network Time Protocol program"; argument = '[ hostname-or-IP ...]'; #include homerc.def long-opts; config-header = "config.h"; environrc; #include version.def test-main; flag = { name = ipv4; value = 4; flags-cant = ipv6; descrip = "Force IPv4 DNS name resolution"; doc = <<- _EndOfDoc_ Force DNS resolution of the following host names on the command line to the IPv4 namespace. _EndOfDoc_; }; flag = { name = ipv6; value = 6; flags-cant = ipv4; descrip = "Force IPv6 DNS name resolution"; doc = <<- _EndOfDoc_ Force DNS resolution of the following host names on the command line to the IPv6 namespace. _EndOfDoc_; }; flag = { name = normalverbose; value = d; descrip = "Normal verbose"; doc = <<- _EndOfDoc_ Diagnostic messages for non-fatal errors and a limited amount of tracing should be written to standard error. Fatal ones always produce a diagnostic. This option should be set when there is a suspected problem with the server, network or the source. _EndOfDoc_; }; flag = { name = kod; value = K; arg-type = string; arg-name = "file-name"; descrip = "KoD history filename"; doc = <<- _EndOfDoc_ Specifies the filename to be used to persist the history of KoD responses received from servers. The default is /var/db/ntp-kod. _EndOfDoc_; }; flag = { name = syslog; value = p; flags-cant = logfile; descrip = "Logging with syslog"; doc = <<- _EndOfDoc_ When this option is set all logging will be done using syslog. _EndOfDoc_; }; flag = { name = logfile; value = l; arg-type = string; arg-name = "file-name"; flags-cant = syslog; descrip = "Log to specified logfile"; doc = <<- _EndOfDoc_ This option causes the client to write log messages to the specified logfile. _EndOfDoc_; }; flag = { name = settod; value = s; flags-cant = adjtime; descrip = "Set (step) the time with settimeofday()"; doc = <<- _EndOfDoc_ _EndOfDoc_; }; flag = { name = adjtime; value = j; flags-cant = settod; descrip = "Set (slew) the time with adjtime()"; doc = <<- _EndOfDoc_ _EndOfDoc_; }; flag = { name = broadcast; value = b; descrip = "Use broadcasts to the address specified for synchronisation"; arg-type = string; arg-name = "broadcast-address"; doc = <<- _EndOfDoc_ If specified SNTP will listen to the specified broadcast address for NTP broadcasts. The default maximum wait time, 68 seconds, can be modified with -t. _EndOfDoc_; }; flag = { name = timeout; value = t; descrip = "Specify the number of seconds to wait for broadcasts"; arg-type = number; arg-name = "seconds"; arg-default = 68; doc = <<- _EndOfDoc_ When waiting for a broadcast packet SNTP will wait the number of seconds specified before giving up. Default 68 seconds. _EndOfDoc_; }; flag = { name = authentication; value = a; descrip = "Enable authentication with the key auth-keynumber"; arg-type = number; arg-name = "auth-keynumber"; doc = <<- _EndOfDoc_ This option enables authentication using the key specified in this option's argument. The argument of this option is the keyid, a number specified in the keyfile as this key's identifier. See the keyfile option (-k) for more details. _EndOfDoc_; }; flag = { name = keyfile; value = k; descrip = "Specify a keyfile. SNTP will look in this file for the key specified with -a"; arg-type = string; arg-name = "file-name"; doc = <<- _EndOfDoc_ This option specifies the keyfile. SNTP will search for the key specified with -a keyno in this file. Key files follow the following format: keyid keytype key Where keyid is a number identifying this key keytype is one of the follow: S Key in 64 Bit hexadecimal number as specified in in the DES specification. N Key in 64 Bit hexadecimal number as specified in the NTP standard. A Key in a 1-to-8 character ASCII string. M Key in a 1-to-8 character ASCII string using the MD5 authentication scheme. For more information see ntp.keys(5). _EndOfDoc_; }; /* explain: Additional information whenever the usage routine is invoked */ explain = <<- _END_EXPLAIN _END_EXPLAIN; detail = <<- _END_DETAIL sntp implements the Simple Network Time Protocol, and is used to query an NTP or SNTP server and either display the time or set the local system's time (given suitable privilege). It can be run interactively from the command line or as a cron job. NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC 1305. _END_DETAIL; prog-man-descrip = <<- _END_PROG_MAN_DESCRIP .I sntp can be used as a SNTP client to query a NTP or SNTP server and either display the time or set the local system's time (given suitable privilege). It can be run as an interactive command or in a .I cron job. NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol) are defined and described by RFC 5905. .PP The default is to write the estimated correct local date and time (i.e. not UTC) to the standard output in a format like .BR "'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs'" , where the .B "'(+0800)'" means that to get to UTC from the reported local time one must add 8 hours and 0 minutes, and the .B "'+4.567 +/- 0.089 secs'" indicates the local clock is 4.567 seconds behind the correct time (so 4.567 seconds must be added to the local clock to get it to be correct), and the time of '1996-10-15 20:17:25.123' is believed to be correct to within +/- 0.089 seconds. _END_PROG_MAN_DESCRIP; prog-info-descrip = <<- _END_PROG_INFO_DESCRIP @code{sntp} can be used as a SNTP client to query a NTP or SNTP server and either display the time or set the local system's time (given suitable privilege). It can be run as an interactive command or in a @code{cron} job. NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol) are defined and described by RFC 5905. @indent The default is to write the estimated correct local date and time (i.e. not UTC) to the standard output in a format like @example 1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs @end example where the @example +4.567 +/- 0.089 secs @end example indicates the local clock is 4.567 seconds behind the correct time (so 4.567 seconds must be added to the local clock to get it to be correct), and the (local) time of @code{1996-10-15 20:17:25.123} can be converted to UTC time by adding 8 hours and 0 minutes, and is believed to be correct to within @code{+/- 0.089} seconds. _END_PROG_INFO_DESCRIP; man-doc = <<- _END_MAN_DOC .SH USAGE The simplest use of this program is as an unprivileged command to check the current time and error in the local clock. For example: .IP .B sntp ntpserver.somewhere .PP With suitable privilege, it can be run as a command or in a .I cron job to reset the local clock from a reliable server, like the .I ntpdate and .I rdate commands. For example: .IP .B sntp -a ntpserver.somewhere .SH RETURN VALUE The program returns a zero exit status for success, and a non-zero one otherwise. .SH BUGS Please report bugs to http://bugs.ntp.org . _END_MAN_DOC; ntp-4.2.6p5/sntp/main.h0000644000175000017500000000145311467721004013677 0ustar peterpeter#ifndef MAIN_H #define MAIN_H #include #include #include #include #include #include #include #include #include #include "crypto.h" void set_li_vn_mode (struct pkt *spkt, char leap, char version, char mode); int sntp_main (int argc, char **argv); int generate_pkt (struct pkt *x_pkt, const struct timeval *tv_xmt, int key_id, struct key *pkt_key); int handle_pkt (int rpktl, struct pkt *rpkt, struct addrinfo *host); void offset_calculation (struct pkt *rpkt, int rpktl, struct timeval *tv_dst, double *offset, double *precision, double *root_dispersion); int on_wire (struct addrinfo *host, struct addrinfo *bcastaddr); int set_time (double offset); #endif /* MAIN_H */ ntp-4.2.6p5/sntp/libopts/0000755000175000017500000000000011675461361014263 5ustar peterpeterntp-4.2.6p5/sntp/libopts/COPYING.mbsd0000644000175000017500000000254611307651616016245 0ustar peterpeterRedistribution 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. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. 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. ntp-4.2.6p5/sntp/libopts/autoopts.h0000644000175000017500000002143611564122255016311 0ustar peterpeter /* * \file autoopts.h * * Time-stamp: "2011-03-25 17:51:34 bkorb" * * This file defines all the global structures and special values * used in the automated option processing library. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ #ifndef AUTOGEN_AUTOOPTS_H #define AUTOGEN_AUTOOPTS_H #include "compat/compat.h" #include "ag-char-map.h" #define AO_NAME_LIMIT 127 #define AO_NAME_SIZE ((size_t)(AO_NAME_LIMIT + 1)) #ifndef AG_PATH_MAX # ifdef PATH_MAX # define AG_PATH_MAX ((size_t)PATH_MAX) # else # define AG_PATH_MAX ((size_t)4096) # endif #else # if defined(PATH_MAX) && (PATH_MAX > MAXPATHLEN) # undef AG_PATH_MAX # define AG_PATH_MAX ((size_t)PATH_MAX) # endif #endif #undef EXPORT #define EXPORT #if defined(_WIN32) && !defined(__CYGWIN__) # define DIRCH '\\' #else # define DIRCH '/' #endif #ifndef EX_NOINPUT # define EX_NOINPUT 66 #endif #ifndef EX_SOFTWARE # define EX_SOFTWARE 70 #endif #ifndef EX_CONFIG # define EX_CONFIG 78 #endif /* * Convert the number to a list usable in a printf call */ #define NUM_TO_VER(n) ((n) >> 12), ((n) >> 7) & 0x001F, (n) & 0x007F #define NAMED_OPTS(po) \ (((po)->fOptSet & (OPTPROC_SHORTOPT | OPTPROC_LONGOPT)) == 0) #define SKIP_OPT(p) (((p)->fOptState & (OPTST_DOCUMENT|OPTST_OMITTED)) != 0) typedef int tDirection; #define DIRECTION_PRESET -1 #define DIRECTION_PROCESS 1 #define DIRECTION_CALLED 0 #define PROCESSING(d) ((d)>0) #define PRESETTING(d) ((d)<0) /* * When loading a line (or block) of text as an option, the value can * be processed in any of several modes: * * @table @samp * @item keep * Every part of the value between the delimiters is saved. * * @item uncooked * Even if the value begins with quote characters, do not do quote processing. * * @item cooked * If the value looks like a quoted string, then process it. * Double quoted strings are processed the way strings are in "C" programs, * except they are treated as regular characters if the following character * is not a well-established escape sequence. * Single quoted strings (quoted with apostrophies) are handled the way * strings are handled in shell scripts, *except* that backslash escapes * are honored before backslash escapes and apostrophies. * @end table */ typedef enum { OPTION_LOAD_COOKED, OPTION_LOAD_UNCOOKED, OPTION_LOAD_KEEP } tOptionLoadMode; static tOptionLoadMode option_load_mode; /* * The pager state is used by optionPagedUsage() procedure. * When it runs, it sets itself up to be called again on exit. * If, however, a routine needs a child process to do some work * before it is done, then 'pagerState' must be set to * 'PAGER_STATE_CHILD' so that optionPagedUsage() will not try * to run the pager program before its time. */ typedef enum { PAGER_STATE_INITIAL, PAGER_STATE_READY, PAGER_STATE_CHILD } tePagerState; typedef enum { ENV_ALL, ENV_IMM, ENV_NON_IMM } teEnvPresetType; typedef enum { TOPT_UNDEFINED = 0, TOPT_SHORT, TOPT_LONG, TOPT_DEFAULT } teOptType; typedef struct { tOptDesc* pOD; tCC* pzOptArg; tAoUL flags; teOptType optType; } tOptState; #define OPTSTATE_INITIALIZER(st) \ { NULL, NULL, OPTST_ ## st, TOPT_UNDEFINED } #define TEXTTO_TABLE \ _TT_(LONGUSAGE) \ _TT_(USAGE) \ _TT_(VERSION) #define _TT_(n) \ TT_ ## n , typedef enum { TEXTTO_TABLE COUNT_TT } teTextTo; #undef _TT_ typedef struct { char const * pzStr; char const * pzReq; char const * pzNum; char const * pzFile; char const * pzKey; char const * pzKeyL; char const * pzBool; char const * pzNest; char const * pzOpt; char const * pzNo; char const * pzBrk; char const * pzNoF; char const * pzSpc; char const * pzOptFmt; char const * pzTime; } arg_types_t; #define AGALOC(c, w) ao_malloc((size_t)c) #define AGREALOC(p, c, w) ao_realloc((void*)p, (size_t)c) #define AGFREE(_p) free((void *)_p) #define AGDUPSTR(p, s, w) (p = ao_strdup(s)) static void * ao_malloc(size_t sz); static void * ao_realloc(void *p, size_t sz); #define ao_free(_p) free((void *)_p) static char * ao_strdup(char const *str); #define TAGMEM(m, t) /* * DO option handling? * * Options are examined at two times: at immediate handling time and at * normal handling time. If an option is disabled, the timing may be * different from the handling of the undisabled option. The OPTST_DIABLED * bit indicates the state of the currently discovered option. * So, here's how it works: * * A) handling at "immediate" time, either 1 or 2: * * 1. OPTST_DISABLED is not set: * IMM must be set * DISABLE_IMM don't care * TWICE don't care * DISABLE_TWICE don't care * 0 -and- 1 x x x * * 2. OPTST_DISABLED is set: * IMM don't care * DISABLE_IMM must be set * TWICE don't care * DISABLE_TWICE don't care * 1 -and- x 1 x x */ #define DO_IMMEDIATELY(_flg) \ ( (((_flg) & (OPTST_DISABLED|OPTST_IMM)) == OPTST_IMM) \ || ( ((_flg) & (OPTST_DISABLED|OPTST_DISABLE_IMM)) \ == (OPTST_DISABLED|OPTST_DISABLE_IMM) )) /* B) handling at "regular" time because it was not immediate * * 1. OPTST_DISABLED is not set: * IMM must *NOT* be set * DISABLE_IMM don't care * TWICE don't care * DISABLE_TWICE don't care * 0 -and- 0 x x x * * 2. OPTST_DISABLED is set: * IMM don't care * DISABLE_IMM don't care * TWICE must be set * DISABLE_TWICE don't care * 1 -and- x x 1 x */ #define DO_NORMALLY(_flg) ( \ (((_flg) & (OPTST_DISABLED|OPTST_IMM)) == 0) \ || (((_flg) & (OPTST_DISABLED|OPTST_DISABLE_IMM)) == \ OPTST_DISABLED) ) /* C) handling at "regular" time because it is to be handled twice. * The immediate bit was already tested and found to be set: * * 3. OPTST_DISABLED is not set: * IMM is set (but don't care) * DISABLE_IMM don't care * TWICE must be set * DISABLE_TWICE don't care * 0 -and- ? x 1 x * * 4. OPTST_DISABLED is set: * IMM don't care * DISABLE_IMM is set (but don't care) * TWICE don't care * DISABLE_TWICE must be set * 1 -and- x ? x 1 */ #define DO_SECOND_TIME(_flg) ( \ (((_flg) & (OPTST_DISABLED|OPTST_TWICE)) == \ OPTST_TWICE) \ || (((_flg) & (OPTST_DISABLED|OPTST_DISABLE_TWICE)) == \ (OPTST_DISABLED|OPTST_DISABLE_TWICE) )) /* * text_mmap structure. Only active on platforms with mmap(2). */ #ifdef HAVE_SYS_MMAN_H # include #else # ifndef PROT_READ # define PROT_READ 0x01 # endif # ifndef PROT_WRITE # define PROT_WRITE 0x02 # endif # ifndef MAP_SHARED # define MAP_SHARED 0x01 # endif # ifndef MAP_PRIVATE # define MAP_PRIVATE 0x02 # endif #endif #ifndef MAP_FAILED # define MAP_FAILED ((void*)-1) #endif #ifndef _SC_PAGESIZE # ifdef _SC_PAGE_SIZE # define _SC_PAGESIZE _SC_PAGE_SIZE # endif #endif #ifndef HAVE_STRCHR extern char* strchr(char const *s, int c); extern char* strrchr(char const *s, int c); #endif /* * Define and initialize all the user visible strings. * We do not do translations. If translations are to be done, then * the client will provide a callback for that purpose. */ #undef DO_TRANSLATIONS #include "autoopts/usage-txt.h" /* * File pointer for usage output */ FILE * option_usage_fp; static char const * program_pkgdatadir; extern tOptProc optionPrintVersion, optionPagedUsage, optionLoadOpt; #endif /* AUTOGEN_AUTOOPTS_H */ /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/autoopts.h */ ntp-4.2.6p5/sntp/libopts/genshell.h0000644000175000017500000001434211564122254016231 0ustar peterpeter/* -*- buffer-read-only: t -*- vi: set ro: * * DO NOT EDIT THIS FILE (genshell.h) * * It has been AutoGen-ed April 29, 2011 at 03:43:59 PM by AutoGen 5.11.9 * From the definitions genshell.def * and the template file options * * Generated from AutoOpts 35:0:10 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the genshellopt author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * This source file is copyrighted and licensed under the following terms: * * genshellopt copyright (c) 1999-2011 Bruce Korb - all rights reserved * * genshellopt 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. * * genshellopt 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 . */ /* * This file contains the programmatic interface to the Automated * Options generated for the genshellopt program. * These macros are documented in the AutoGen info file in the * "AutoOpts" chapter. Please refer to that doc for usage help. */ #ifndef AUTOOPTS_GENSHELL_H_GUARD #define AUTOOPTS_GENSHELL_H_GUARD 1 #include /* * Ensure that the library used for compiling this generated header is at * least as new as the version current when the header template was released * (not counting patch version increments). Also ensure that the oldest * tolerable version is at least as old as what was current when the header * template was released. */ #define AO_TEMPLATE_VERSION 143360 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header Choke Me. #endif /* * Enumeration of each option: */ typedef enum { INDEX_GENSHELL_OPT_SCRIPT = 0, INDEX_GENSHELL_OPT_SHELL = 1, INDEX_GENSHELL_OPT_VERSION = 2, INDEX_GENSHELL_OPT_HELP = 3, INDEX_GENSHELL_OPT_MORE_HELP = 4 } teGenshell_OptIndex; #define GENSHELL_OPTION_CT 5 #define GENSHELLOPT_VERSION "1" #define GENSHELLOPT_FULL_VERSION "genshellopt 1" /* * Interface defines for all options. Replace "n" with the UPPER_CASED * option name (as in the teGenshell_OptIndex enumeration above). * e.g. HAVE_GENSHELL_OPT(SCRIPT) */ #define GENSHELL_DESC(n) (genshelloptOptions.pOptDesc[INDEX_GENSHELL_OPT_## n]) #define HAVE_GENSHELL_OPT(n) (! UNUSED_OPT(& GENSHELL_DESC(n))) #define GENSHELL_OPT_ARG(n) (GENSHELL_DESC(n).optArg.argString) #define STATE_GENSHELL_OPT(n) (GENSHELL_DESC(n).fOptState & OPTST_SET_MASK) #define COUNT_GENSHELL_OPT(n) (GENSHELL_DESC(n).optOccCt) #define ISSEL_GENSHELL_OPT(n) (SELECTED_OPT(&GENSHELL_DESC(n))) #define ISUNUSED_GENSHELL_OPT(n) (UNUSED_OPT(& GENSHELL_DESC(n))) #define ENABLED_GENSHELL_OPT(n) (! DISABLED_OPT(& GENSHELL_DESC(n))) #define STACKCT_GENSHELL_OPT(n) (((tArgList*)(GENSHELL_DESC(n).optCookie))->useCt) #define STACKLST_GENSHELL_OPT(n) (((tArgList*)(GENSHELL_DESC(n).optCookie))->apzArgs) #define CLEAR_GENSHELL_OPT(n) STMTS( \ GENSHELL_DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ if ((GENSHELL_DESC(n).fOptState & OPTST_INITENABLED) == 0) \ GENSHELL_DESC(n).fOptState |= OPTST_DISABLED; \ GENSHELL_DESC(n).optCookie = NULL ) /* * * * * * * * Enumeration of genshellopt exit codes */ typedef enum { GENSHELLOPT_EXIT_SUCCESS = 0, GENSHELLOPT_EXIT_FAILURE = 1 } genshellopt_exit_code_t; /* * * * * * * * Interface defines for specific options. */ #define VALUE_GENSHELL_OPT_SCRIPT 'o' #define VALUE_GENSHELL_OPT_SHELL 's' #define VALUE_GENSHELL_OPT_HELP '?' #define VALUE_GENSHELL_OPT_MORE_HELP '!' #define VALUE_GENSHELL_OPT_VERSION 'v' /* * Interface defines not associated with particular options */ #define ERRSKIP_GENSHELL_OPTERR STMTS(genshelloptOptions.fOptSet &= ~OPTPROC_ERRSTOP) #define ERRSTOP_GENSHELL_OPTERR STMTS(genshelloptOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_GENSHELL_OPT(n) STMTS( \ genshelloptOptions.curOptIdx = (n); \ genshelloptOptions.pzCurOpt = NULL ) #define START_GENSHELL_OPT RESTART_GENSHELL_OPT(1) #define GENSHELL_USAGE(c) (*genshelloptOptions.pUsageProc)(&genshelloptOptions, c) /* extracted from opthead.tlib near line 451 */ #ifdef __cplusplus extern "C" { #endif /* * * * * * * * Declare the genshellopt option descriptor. */ extern tOptions genshelloptOptions; #if defined(ENABLE_NLS) # ifndef _ # include static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; return (char*)gettext(pz); } # define _(s) aoGetsText(s) # endif /* _() */ # define OPT_NO_XLAT_CFG_NAMES STMTS(genshelloptOptions.fOptSet |= \ OPTPROC_NXLAT_OPT_CFG;) # define OPT_NO_XLAT_OPT_NAMES STMTS(genshelloptOptions.fOptSet |= \ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) # define OPT_XLAT_CFG_NAMES STMTS(genshelloptOptions.fOptSet &= \ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) # define OPT_XLAT_OPT_NAMES STMTS(genshelloptOptions.fOptSet &= \ ~OPTPROC_NXLAT_OPT;) #else /* ENABLE_NLS */ # define OPT_NO_XLAT_CFG_NAMES # define OPT_NO_XLAT_OPT_NAMES # define OPT_XLAT_CFG_NAMES # define OPT_XLAT_OPT_NAMES # ifndef _ # define _(_s) _s # endif #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif #endif /* AUTOOPTS_GENSHELL_H_GUARD */ /* genshell.h ends here */ ntp-4.2.6p5/sntp/libopts/genshell.c0000644000175000017500000003213211564122254016221 0ustar peterpeter/* -*- buffer-read-only: t -*- vi: set ro: * * DO NOT EDIT THIS FILE (genshell.c) * * It has been AutoGen-ed April 29, 2011 at 03:43:59 PM by AutoGen 5.11.9 * From the definitions genshell.def * and the template file options * * Generated from AutoOpts 35:0:10 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the genshellopt author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * This source file is copyrighted and licensed under the following terms: * * genshellopt copyright (c) 1999-2011 Bruce Korb - all rights reserved * * genshellopt 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. * * genshellopt 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 . */ #include #include #include #include #define OPTION_CODE_COMPILE 1 #include "genshell.h" #ifdef __cplusplus extern "C" { #endif extern FILE * option_usage_fp; /* TRANSLATORS: choose the translation for option names wisely because you cannot ever change your mind. */ static char const zCopyright[260] = "genshellopt 1\n\ Copyright (C) 1999-2011 Bruce Korb, all rights reserved.\n\ This is free software. It is licensed for use, modification and\n\ redistribution under the terms of the\n\ GNU General Public License, version 3 or later\n\ \n"; static char const zCopyrightNotice[611] = "genshellopt is free software: you can redistribute it and/or modify it\n\ under the terms of the GNU General Public License as published by the\n\ Free Software Foundation, either version 3 of the License, or (at your\n\ option) any later version.\n\n\ genshellopt is distributed in the hope that it will be useful, but WITHOUT\n\ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n\ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n\ for more details.\n\n\ You should have received a copy of the GNU General Public License along\n\ with this program. If not, see .\n"; extern tUsageProc genshelloptUsage; #ifndef NULL # define NULL 0 #endif /* * Script option description: */ static char const zScriptText[] = "Output Script File"; static char const zScript_NAME[] = "SCRIPT"; static char const zScript_Name[] = "script"; #define SCRIPT_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Shell option description: */ static char const zShellText[] = "Shell name (follows \"#!\" magic)"; static char const zShell_NAME[] = "SHELL"; static char const zNotShell_Name[] = "no-shell"; static char const zNotShell_Pfx[] = "no"; #define zShell_Name (zNotShell_Name + 3) #define SHELL_FLAGS (OPTST_INITENABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Help/More_Help/Version option descriptions: */ static char const zHelpText[] = "Display extended usage information and exit"; static char const zHelp_Name[] = "help"; #ifdef HAVE_WORKING_FORK #define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) static char const zMore_Help_Name[] = "more-help"; static char const zMore_HelpText[] = "Extended usage information passed thru pager"; #else #define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMore_Help_Name NULL #define zMore_HelpText NULL #endif #ifdef NO_OPTIONAL_OPT_ARGS # define OPTST_VERSION_FLAGS OPTST_IMM | OPTST_NO_INIT #else # define OPTST_VERSION_FLAGS OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif static char const zVersionText[] = "Output version information and exit"; static char const zVersion_Name[] = "version"; /* * Declare option callback procedures */ extern tOptProc optionBooleanVal, optionNestedVal, optionNumericVal, optionPagedUsage, optionPrintVersion, optionResetOpt, optionStackArg, optionTimeDate, optionTimeVal, optionUnstackArg, optionVersionStderr; static tOptProc doUsageOpt; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the Genshellopt Option Descriptions. */ static tOptDesc optDesc[GENSHELL_OPTION_CT] = { { /* entry idx, value */ 0, VALUE_GENSHELL_OPT_SCRIPT, /* equiv idx, value */ 0, VALUE_GENSHELL_OPT_SCRIPT, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SCRIPT_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zScriptText, zScript_NAME, zScript_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 1, VALUE_GENSHELL_OPT_SHELL, /* equiv idx, value */ 1, VALUE_GENSHELL_OPT_SHELL, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SHELL_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ zShellText, zShell_NAME, zShell_Name, /* disablement strs */ zNotShell_Name, zNotShell_Pfx }, { /* entry idx, value */ INDEX_GENSHELL_OPT_VERSION, VALUE_GENSHELL_OPT_VERSION, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_VERSION_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionPrintVersion, /* desc, NAME, name */ zVersionText, NULL, zVersion_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_GENSHELL_OPT_HELP, VALUE_GENSHELL_OPT_HELP, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doUsageOpt, /* desc, NAME, name */ zHelpText, NULL, zHelp_Name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_GENSHELL_OPT_MORE_HELP, VALUE_GENSHELL_OPT_MORE_HELP, /* equiv idx value */ NO_EQUIVALENT, 0, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_MORE_HELP_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionPagedUsage, /* desc, NAME, name */ zMore_HelpText, NULL, zMore_Help_Name, /* disablement strs */ NULL, NULL } }; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the Genshellopt Option Environment */ static char const zPROGNAME[12] = "GENSHELLOPT"; static char const zUsageTitle[121] = "genshellopt - Generate Shell Option Processing Script - Ver. 1\n\ USAGE: %s [ - [] | --[{=| }] ]...\n"; #define zRcName NULL #define apzHomeList NULL static char const zBugsAddr[36] = "autogen-users@lists.sourceforge.net"; static char const zExplain[] = "\n\ Note that ``shell'' is only useful if the output file does not already\n\ exist. If it does, then the shell name and optional first argument will\n\ be extracted from the script file.\n"; static char const zDetail[237] = "\n\ If the script file already exists and contains Automated Option Processing\n\ text, the second line of the file through the ending tag will be replaced\n\ by the newly generated text. The first ``#!'' line will be regenerated.\n"; static char const zFullVersion[] = GENSHELLOPT_FULL_VERSION; /* extracted from optcode.tlib near line 515 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE static tOptionXlateProc translate_option_strings; #else # define OPTPROC_BASE OPTPROC_NONE # define translate_option_strings NULL #endif /* ENABLE_NLS */ #define genshellopt_full_usage NULL #define genshellopt_short_usage NULL #ifndef PKGDATADIR # define PKGDATADIR "" #endif #ifndef WITH_PACKAGER # define genshellopt_packager_info NULL #else static char const genshellopt_packager_info[] = "Packaged by " WITH_PACKAGER # ifdef WITH_PACKAGER_VERSION " ("WITH_PACKAGER_VERSION")" # endif # ifdef WITH_PACKAGER_BUG_REPORTS "\nReport genshellopt bugs to " WITH_PACKAGER_BUG_REPORTS # endif "\n"; #endif tOptions genshelloptOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ ( OPTPROC_BASE + OPTPROC_ERRSTOP + OPTPROC_SHORTOPT + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT + OPTPROC_NEGATIONS + OPTPROC_NO_ARGS ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zCopyrightNotice, zFullVersion, apzHomeList, zUsageTitle, zExplain, zDetail, optDesc, zBugsAddr, /* address to send bugs to */ NULL, NULL, /* extensions/saved state */ genshelloptUsage, /* usage procedure */ translate_option_strings, /* translation procedure */ /* * Indexes to special options */ { INDEX_GENSHELL_OPT_MORE_HELP, /* more-help option index */ NO_EQUIVALENT, /* save option index */ NO_EQUIVALENT, /* '-#' option index */ NO_EQUIVALENT /* index of default opt */ }, 5 /* full option count */, 2 /* user option count */, genshellopt_full_usage, genshellopt_short_usage, NULL, NULL, PKGDATADIR, genshellopt_packager_info }; /* * Create the static procedure(s) declared above. */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { (void)pOptions; GENSHELL_USAGE(GENSHELLOPT_EXIT_SUCCESS); } /* extracted from optcode.tlib near line 666 */ #if ENABLE_NLS #include #include #include #include #include static char* AO_gettext(char const* pz); static void coerce_it(void** s); static char* AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) return NULL; pzRes = _(pz); if (pzRes == pz) return pzRes; pzRes = strdup(pzRes); if (pzRes == NULL) { fputs(_("No memory for duping translated strings\n"), stderr); exit(GENSHELLOPT_EXIT_FAILURE); } return pzRes; } static void coerce_it(void** s) { *s = AO_gettext(*s); } /* * This invokes the translation code (e.g. gettext(3)). */ static void translate_option_strings(void) { tOptions * const pOpt = &genshelloptOptions; /* * Guard against re-translation. It won't work. The strings will have * been changed by the first pass through this code. One shot only. */ if (option_usage_text.field_ct != 0) { /* * Do the translations. The first pointer follows the field count * field. The field count field is the size of a pointer. */ tOptDesc * pOD = pOpt->pOptDesc; char ** ppz = (char**)(void*)&(option_usage_text); int ix = option_usage_text.field_ct; do { ppz++; *ppz = AO_gettext(*ppz); } while (--ix > 0); coerce_it((void*)&(pOpt->pzCopyright)); coerce_it((void*)&(pOpt->pzCopyNotice)); coerce_it((void*)&(pOpt->pzFullVersion)); coerce_it((void*)&(pOpt->pzUsageTitle)); coerce_it((void*)&(pOpt->pzExplain)); coerce_it((void*)&(pOpt->pzDetail)); coerce_it((void*)&(pOpt->pzPackager)); option_usage_text.field_ct = 0; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) coerce_it((void*)&(pOD->pzText)); } if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) { tOptDesc * pOD = pOpt->pOptDesc; int ix; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) { coerce_it((void*)&(pOD->pz_Name)); coerce_it((void*)&(pOD->pz_DisableName)); coerce_it((void*)&(pOD->pz_DisablePfx)); } /* prevent re-translation */ genshelloptOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT; } } #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif /* genshell.c ends here */ ntp-4.2.6p5/sntp/libopts/stack.c0000644000175000017500000001620511564122255015531 0ustar peterpeter /** * \file stack.c * * Time-stamp: "2010-07-17 10:42:27 bkorb" * * This is a special option processing routine that will save the * argument to an option in a FIFO queue. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ #ifdef WITH_LIBREGEX # include REGEX_HEADER #endif /*=export_func optionUnstackArg * private: * * what: Remove option args from a stack * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * Invoked for options that are equivalenced to stacked options. =*/ void optionUnstackArg( tOptions* pOpts, tOptDesc* pOptDesc ) { int res; tArgList* pAL; if ((pOptDesc->fOptState & OPTST_RESET) != 0) return; pAL = (tArgList*)pOptDesc->optCookie; /* * IF we don't have any stacked options, * THEN indicate that we don't have any of these options */ if (pAL == NULL) { pOptDesc->fOptState &= OPTST_PERSISTENT_MASK; if ((pOptDesc->fOptState & OPTST_INITENABLED) == 0) pOptDesc->fOptState |= OPTST_DISABLED; return; } #ifdef WITH_LIBREGEX { regex_t re; int i, ct, dIdx; if (regcomp(&re, pOptDesc->optArg.argString, REG_NOSUB) != 0) return; /* * search the list for the entry(s) to remove. Entries that * are removed are *not* copied into the result. The source * index is incremented every time. The destination only when * we are keeping a define. */ for (i = 0, dIdx = 0, ct = pAL->useCt; --ct >= 0; i++) { tCC* pzSrc = pAL->apzArgs[ i ]; char* pzEq = strchr(pzSrc, '='); if (pzEq != NULL) *pzEq = NUL; res = regexec(&re, pzSrc, (size_t)0, NULL, 0); switch (res) { case 0: /* * Remove this entry by reducing the in-use count * and *not* putting the string pointer back into * the list. */ AGFREE(pzSrc); pAL->useCt--; break; default: case REG_NOMATCH: if (pzEq != NULL) *pzEq = '='; /* * IF we have dropped an entry * THEN we have to move the current one. */ if (dIdx != i) pAL->apzArgs[ dIdx ] = pzSrc; dIdx++; } } regfree(&re); } #else /* not WITH_LIBREGEX */ { int i, ct, dIdx; /* * search the list for the entry(s) to remove. Entries that * are removed are *not* copied into the result. The source * index is incremented every time. The destination only when * we are keeping a define. */ for (i = 0, dIdx = 0, ct = pAL->useCt; --ct >= 0; i++) { tCC* pzSrc = pAL->apzArgs[ i ]; char* pzEq = strchr(pzSrc, '='); if (pzEq != NULL) *pzEq = NUL; if (strcmp(pzSrc, pOptDesc->optArg.argString) == 0) { /* * Remove this entry by reducing the in-use count * and *not* putting the string pointer back into * the list. */ AGFREE(pzSrc); pAL->useCt--; } else { if (pzEq != NULL) *pzEq = '='; /* * IF we have dropped an entry * THEN we have to move the current one. */ if (dIdx != i) pAL->apzArgs[ dIdx ] = pzSrc; dIdx++; } } } #endif /* WITH_LIBREGEX */ /* * IF we have unstacked everything, * THEN indicate that we don't have any of these options */ if (pAL->useCt == 0) { pOptDesc->fOptState &= OPTST_PERSISTENT_MASK; if ((pOptDesc->fOptState & OPTST_INITENABLED) == 0) pOptDesc->fOptState |= OPTST_DISABLED; AGFREE((void*)pAL); pOptDesc->optCookie = NULL; } } /* * Put an entry into an argument list. The first argument points to * a pointer to the argument list structure. It gets passed around * as an opaque address. */ LOCAL void addArgListEntry(void** ppAL, void* entry) { tArgList* pAL = *(void**)ppAL; /* * IF we have never allocated one of these, * THEN allocate one now */ if (pAL == NULL) { pAL = (tArgList*)AGALOC(sizeof(*pAL), "new option arg stack"); if (pAL == NULL) return; pAL->useCt = 0; pAL->allocCt = MIN_ARG_ALLOC_CT; *ppAL = (void*)pAL; } /* * ELSE if we are out of room * THEN make it bigger */ else if (pAL->useCt >= pAL->allocCt) { size_t sz = sizeof(*pAL); pAL->allocCt += INCR_ARG_ALLOC_CT; /* * The base structure contains space for MIN_ARG_ALLOC_CT * pointers. We subtract it off to find our augment size. */ sz += sizeof(char*) * (pAL->allocCt - MIN_ARG_ALLOC_CT); pAL = (tArgList*)AGREALOC((void*)pAL, sz, "expanded opt arg stack"); if (pAL == NULL) return; *ppAL = (void*)pAL; } /* * Insert the new argument into the list */ pAL->apzArgs[ (pAL->useCt)++ ] = entry; } /*=export_func optionStackArg * private: * * what: put option args on a stack * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * Keep an entry-ordered list of option arguments. =*/ void optionStackArg( tOptions* pOpts, tOptDesc* pOD ) { char * pz; if ((pOD->fOptState & OPTST_RESET) != 0) { tArgList* pAL = (void*)pOD->optCookie; int ix; if (pAL == NULL) return; ix = pAL->useCt; while (--ix >= 0) AGFREE(pAL->apzArgs[ix]); AGFREE(pAL); } else { if (pOD->optArg.argString == NULL) return; AGDUPSTR(pz, pOD->optArg.argString, "stack arg"); addArgListEntry(&(pOD->optCookie), (void*)pz); } } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/stack.c */ ntp-4.2.6p5/sntp/libopts/restore.c0000644000175000017500000001600711564122254016106 0ustar peterpeter /* * \file restore.c * * Time-stamp: "2010-08-22 11:04:00 bkorb" * * This module's routines will save the current option state to memory * and restore it. If saved prior to the initial optionProcess call, * then the initial state will be restored. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ /* * optionFixupSavedOpts Really, it just wipes out option state for * options that are troublesome to copy. viz., stacked strings and * hierarcicaly valued option args. We do duplicate string args that * have been marked as allocated though. */ static void fixupSavedOptionArgs(tOptions* pOpts) { tOptions* p = pOpts->pSavedState; tOptDesc* pOD = pOpts->pOptDesc; int ct = pOpts->optCt; /* * Make sure that allocated stuff is only referenced in the * archived copy of the data. */ for (; ct-- > 0; pOD++) { switch (OPTST_GET_ARGTYPE(pOD->fOptState)) { case OPARG_TYPE_STRING: if (pOD->fOptState & OPTST_STACKED) { tOptDesc* q = p->pOptDesc + (pOD - pOpts->pOptDesc); q->optCookie = NULL; } if (pOD->fOptState & OPTST_ALLOC_ARG) { tOptDesc* q = p->pOptDesc + (pOD - pOpts->pOptDesc); AGDUPSTR(q->optArg.argString, pOD->optArg.argString, "arg"); } break; case OPARG_TYPE_HIERARCHY: { tOptDesc* q = p->pOptDesc + (pOD - pOpts->pOptDesc); q->optCookie = NULL; } } } } /*=export_func optionSaveState * * what: saves the option state to memory * arg: tOptions*, pOpts, program options descriptor * * doc: * * This routine will allocate enough memory to save the current option * processing state. If this routine has been called before, that memory * will be reused. You may only save one copy of the option state. This * routine may be called before optionProcess(3AO). If you do call it * before the first call to optionProcess, then you may also change the * contents of argc/argv after you call optionRestore(3AO) * * In fact, more strongly put: it is safest to only use this function * before having processed any options. In particular, the saving and * restoring of stacked string arguments and hierarchical values is * disabled. The values are not saved. * * err: If it fails to allocate the memory, * it will print a message to stderr and exit. * Otherwise, it will always succeed. =*/ void optionSaveState(tOptions* pOpts) { tOptions* p = (tOptions*)pOpts->pSavedState; if (p == NULL) { size_t sz = sizeof(*pOpts) + (pOpts->optCt * sizeof(tOptDesc)); p = AGALOC(sz, "saved option state"); if (p == NULL) { tCC* pzName = pOpts->pzProgName; if (pzName == NULL) { pzName = pOpts->pzPROGNAME; if (pzName == NULL) pzName = zNil; } fprintf(stderr, zCantSave, pzName, sz); exit(EXIT_FAILURE); } pOpts->pSavedState = p; } memcpy(p, pOpts, sizeof(*p)); memcpy(p + 1, pOpts->pOptDesc, p->optCt * sizeof(tOptDesc)); fixupSavedOptionArgs(pOpts); } /*=export_func optionRestore * * what: restore option state from memory copy * arg: tOptions*, pOpts, program options descriptor * * doc: Copy back the option state from saved memory. * The allocated memory is left intact, so this routine can be * called repeatedly without having to call optionSaveState again. * If you are restoring a state that was saved before the first call * to optionProcess(3AO), then you may change the contents of the * argc/argv parameters to optionProcess. * * err: If you have not called @code{optionSaveState} before, a diagnostic is * printed to @code{stderr} and exit is called. =*/ void optionRestore(tOptions* pOpts) { tOptions* p = (tOptions*)pOpts->pSavedState; if (p == NULL) { tCC* pzName = pOpts->pzProgName; if (pzName == NULL) { pzName = pOpts->pzPROGNAME; if (pzName == NULL) pzName = zNil; } fprintf(stderr, zNoState, pzName); exit(EXIT_FAILURE); } pOpts->pSavedState = NULL; optionFree(pOpts); memcpy(pOpts, p, sizeof(*p)); memcpy(pOpts->pOptDesc, p+1, p->optCt * sizeof(tOptDesc)); pOpts->pSavedState = p; fixupSavedOptionArgs(pOpts); } /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ /*=export_func optionFree * * what: free allocated option processing memory * arg: tOptions*, pOpts, program options descriptor * * doc: AutoOpts sometimes allocates memory and puts pointers to it in the * option state structures. This routine deallocates all such memory. * * err: As long as memory has not been corrupted, * this routine is always successful. =*/ void optionFree(tOptions* pOpts) { free_saved_state: { tOptDesc* p = pOpts->pOptDesc; int ct = pOpts->optCt; do { if (p->fOptState & OPTST_ALLOC_ARG) { AGFREE(p->optArg.argString); p->optArg.argString = NULL; p->fOptState &= ~OPTST_ALLOC_ARG; } switch (OPTST_GET_ARGTYPE(p->fOptState)) { case OPARG_TYPE_STRING: #ifdef WITH_LIBREGEX if ( (p->fOptState & OPTST_STACKED) && (p->optCookie != NULL)) { p->optArg.argString = ".*"; optionUnstackArg(pOpts, p); } #else /* leak memory */; #endif break; case OPARG_TYPE_HIERARCHY: if (p->optCookie != NULL) unload_arg_list(p->optCookie); break; } p->optCookie = NULL; } while (p++, --ct > 0); } if (pOpts->pSavedState != NULL) { tOptions * p = (tOptions*)pOpts->pSavedState; memcpy(pOpts, p, sizeof(*p)); memcpy(pOpts->pOptDesc, p+1, p->optCt * sizeof(tOptDesc)); AGFREE(pOpts->pSavedState); pOpts->pSavedState = NULL; goto free_saved_state; } } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/restore.c */ ntp-4.2.6p5/sntp/libopts/load.c0000644000175000017500000003453211564122255015346 0ustar peterpeter /** * \file load.c * Time-stamp: "2010-12-18 11:46:07 bkorb" * * This file contains the routines that deal with processing text strings * for options, either from a NUL-terminated string passed in or from an * rc/ini file. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ /* = = = START-STATIC-FORWARD = = = */ static ag_bool insertProgramPath(char * pzBuf, int bufSize, char const * pzName, char const * pzProgPath); static ag_bool insertEnvVal(char * pzBuf, int bufSize, char const * pzName, char const * pzProgPath); static char* assembleArgValue(char* pzTxt, tOptionLoadMode mode); /* = = = END-STATIC-FORWARD = = = */ /*=export_func optionMakePath * private: * * what: translate and construct a path * arg: + char* + pzBuf + The result buffer + * arg: + int + bufSize + The size of this buffer + * arg: + char const* + pzName + The input name + * arg: + char const* + pzProgPath + The full path of the current program + * * ret-type: ag_bool * ret-desc: AG_TRUE if the name was handled, otherwise AG_FALSE. * If the name does not start with ``$'', then it is handled * simply by copying the input name to the output buffer and * resolving the name with either * @code{canonicalize_file_name(3GLIBC)} or @code{realpath(3C)}. * * doc: * * This routine will copy the @code{pzName} input name into the * @code{pzBuf} output buffer, not exceeding @code{bufSize} bytes. If the * first character of the input name is a @code{'$'} character, then there * is special handling: * @* * @code{$$} is replaced with the directory name of the @code{pzProgPath}, * searching @code{$PATH} if necessary. * @* * @code{$@} is replaced with the AutoGen package data installation directory * (aka @code{pkgdatadir}). * @* * @code{$NAME} is replaced by the contents of the @code{NAME} environment * variable. If not found, the search fails. * * Please note: both @code{$$} and @code{$NAME} must be at the start of the * @code{pzName} string and must either be the entire string or be followed * by the @code{'/'} (backslash on windows) character. * * err: @code{AG_FALSE} is returned if: * @* * @bullet{} The input name exceeds @code{bufSize} bytes. * @* * @bullet{} @code{$$}, @code{$@@} or @code{$NAME} is not the full string * and the next character is not '/'. * @* * @bullet{} libopts was built without PKGDATADIR defined and @code{$@@} * was specified. * @* * @bullet{} @code{NAME} is not a known environment variable * @* * @bullet{} @code{canonicalize_file_name} or @code{realpath} return * errors (cannot resolve the resulting path). =*/ ag_bool optionMakePath(char * pzBuf, int bufSize, char const * pzName, char const * pzProgPath) { size_t name_len = strlen(pzName); if ((bufSize <= name_len) || (name_len == 0)) return AG_FALSE; /* * IF not an environment variable, just copy the data */ if (*pzName != '$') { char const* pzS = pzName; char* pzD = pzBuf; int ct = bufSize; for (;;) { if ( (*(pzD++) = *(pzS++)) == NUL) break; if (--ct <= 0) return AG_FALSE; } } /* * IF the name starts with "$$", then it must be "$$" or * it must start with "$$/". In either event, replace the "$$" * with the path to the executable and append a "/" character. */ else switch (pzName[1]) { case NUL: return AG_FALSE; case '$': if (! insertProgramPath(pzBuf, bufSize, pzName, pzProgPath)) return AG_FALSE; break; case '@': if (program_pkgdatadir[0] == NUL) return AG_FALSE; if (snprintf(pzBuf, bufSize, "%s%s", program_pkgdatadir, pzName + 2) >= bufSize) return AG_FALSE; break; default: if (! insertEnvVal(pzBuf, bufSize, pzName, pzProgPath)) return AG_FALSE; } #if defined(HAVE_CANONICALIZE_FILE_NAME) { char * pz = canonicalize_file_name(pzBuf); if (pz == NULL) return AG_FALSE; name_len = strlen(pz); if (name_len >= bufSize) { free(pz); return AG_FALSE; } memcpy(pzBuf, pz, name_len + 1); free(pz); } #elif defined(HAVE_REALPATH) { char z[PATH_MAX+1]; if (realpath(pzBuf, z) == NULL) return AG_FALSE; name_len = strlen(z); if (name_len >= bufSize) return AG_FALSE; memcpy(pzBuf, z, name_len + 1); } #endif return AG_TRUE; } static ag_bool insertProgramPath(char * pzBuf, int bufSize, char const * pzName, char const * pzProgPath) { char const* pzPath; char const* pz; int skip = 2; switch (pzName[2]) { case DIRCH: skip = 3; case NUL: break; default: return AG_FALSE; } /* * See if the path is included in the program name. * If it is, we're done. Otherwise, we have to hunt * for the program using "pathfind". */ if (strchr(pzProgPath, DIRCH) != NULL) pzPath = pzProgPath; else { pzPath = pathfind(getenv("PATH"), (char*)pzProgPath, "rx"); if (pzPath == NULL) return AG_FALSE; } pz = strrchr(pzPath, DIRCH); /* * IF we cannot find a directory name separator, * THEN we do not have a path name to our executable file. */ if (pz == NULL) return AG_FALSE; pzName += skip; /* * Concatenate the file name to the end of the executable path. * The result may be either a file or a directory. */ if ((pz - pzPath)+1 + strlen(pzName) >= bufSize) return AG_FALSE; memcpy(pzBuf, pzPath, (size_t)((pz - pzPath)+1)); strcpy(pzBuf + (pz - pzPath) + 1, pzName); /* * If the "pzPath" path was gotten from "pathfind()", then it was * allocated and we need to deallocate it. */ if (pzPath != pzProgPath) AGFREE(pzPath); return AG_TRUE; } static ag_bool insertEnvVal(char * pzBuf, int bufSize, char const * pzName, char const * pzProgPath) { char* pzDir = pzBuf; for (;;) { int ch = (int)*++pzName; if (! IS_VALUE_NAME_CHAR(ch)) break; *(pzDir++) = (char)ch; } if (pzDir == pzBuf) return AG_FALSE; *pzDir = NUL; pzDir = getenv(pzBuf); /* * Environment value not found -- skip the home list entry */ if (pzDir == NULL) return AG_FALSE; if (strlen(pzDir) + 1 + strlen(pzName) >= bufSize) return AG_FALSE; sprintf(pzBuf, "%s%s", pzDir, pzName); return AG_TRUE; } LOCAL void mungeString(char* pzTxt, tOptionLoadMode mode) { char* pzE; if (mode == OPTION_LOAD_KEEP) return; if (IS_WHITESPACE_CHAR(*pzTxt)) { char* pzS = pzTxt; char* pzD = pzTxt; while (IS_WHITESPACE_CHAR(*++pzS)) ; while ((*(pzD++) = *(pzS++)) != NUL) ; pzE = pzD-1; } else pzE = pzTxt + strlen(pzTxt); while ((pzE > pzTxt) && IS_WHITESPACE_CHAR(pzE[-1])) pzE--; *pzE = NUL; if (mode == OPTION_LOAD_UNCOOKED) return; switch (*pzTxt) { default: return; case '"': case '\'': break; } switch (pzE[-1]) { default: return; case '"': case '\'': break; } (void)ao_string_cook(pzTxt, NULL); } static char* assembleArgValue(char* pzTxt, tOptionLoadMode mode) { static char const zBrk[] = " \t\n:="; char* pzEnd = strpbrk(pzTxt, zBrk); int space_break; /* * Not having an argument to a configurable name is okay. */ if (pzEnd == NULL) return pzTxt + strlen(pzTxt); /* * If we are keeping all whitespace, then the modevalue starts with the * character that follows the end of the configurable name, regardless * of which character caused it. */ if (mode == OPTION_LOAD_KEEP) { *(pzEnd++) = NUL; return pzEnd; } /* * If the name ended on a white space character, remember that * because we'll have to skip over an immediately following ':' or '=' * (and the white space following *that*). */ space_break = IS_WHITESPACE_CHAR(*pzEnd); *(pzEnd++) = NUL; while (IS_WHITESPACE_CHAR(*pzEnd)) pzEnd++; if (space_break && ((*pzEnd == ':') || (*pzEnd == '='))) while (IS_WHITESPACE_CHAR(*++pzEnd)) ; return pzEnd; } /* * Load an option from a block of text. The text must start with the * configurable/option name and be followed by its associated value. * That value may be processed in any of several ways. See "tOptionLoadMode" * in autoopts.h. */ LOCAL void loadOptionLine( tOptions* pOpts, tOptState* pOS, char* pzLine, tDirection direction, tOptionLoadMode load_mode ) { while (IS_WHITESPACE_CHAR(*pzLine)) pzLine++; { char* pzArg = assembleArgValue(pzLine, load_mode); if (! SUCCESSFUL(longOptionFind(pOpts, pzLine, pOS))) return; if (pOS->flags & OPTST_NO_INIT) return; pOS->pzOptArg = pzArg; } switch (pOS->flags & (OPTST_IMM|OPTST_DISABLE_IMM)) { case 0: /* * The selected option has no immediate action. * THEREFORE, if the direction is PRESETTING * THEN we skip this option. */ if (PRESETTING(direction)) return; break; case OPTST_IMM: if (PRESETTING(direction)) { /* * We are in the presetting direction with an option we handle * immediately for enablement, but normally for disablement. * Therefore, skip if disabled. */ if ((pOS->flags & OPTST_DISABLED) == 0) return; } else { /* * We are in the processing direction with an option we handle * immediately for enablement, but normally for disablement. * Therefore, skip if NOT disabled. */ if ((pOS->flags & OPTST_DISABLED) != 0) return; } break; case OPTST_DISABLE_IMM: if (PRESETTING(direction)) { /* * We are in the presetting direction with an option we handle * immediately for disablement, but normally for disablement. * Therefore, skip if NOT disabled. */ if ((pOS->flags & OPTST_DISABLED) != 0) return; } else { /* * We are in the processing direction with an option we handle * immediately for disablement, but normally for disablement. * Therefore, skip if disabled. */ if ((pOS->flags & OPTST_DISABLED) == 0) return; } break; case OPTST_IMM|OPTST_DISABLE_IMM: /* * The selected option is always for immediate action. * THEREFORE, if the direction is PROCESSING * THEN we skip this option. */ if (PROCESSING(direction)) return; break; } /* * Fix up the args. */ if (OPTST_GET_ARGTYPE(pOS->pOD->fOptState) == OPARG_TYPE_NONE) { if (*pOS->pzOptArg != NUL) return; pOS->pzOptArg = NULL; } else if (pOS->pOD->fOptState & OPTST_ARG_OPTIONAL) { if (*pOS->pzOptArg == NUL) pOS->pzOptArg = NULL; else { AGDUPSTR(pOS->pzOptArg, pOS->pzOptArg, "option argument"); pOS->flags |= OPTST_ALLOC_ARG; } } else { if (*pOS->pzOptArg == NUL) pOS->pzOptArg = zNil; else { AGDUPSTR(pOS->pzOptArg, pOS->pzOptArg, "option argument"); pOS->flags |= OPTST_ALLOC_ARG; } } { tOptionLoadMode sv = option_load_mode; option_load_mode = load_mode; handle_opt(pOpts, pOS); option_load_mode = sv; } } /*=export_func optionLoadLine * * what: process a string for an option name and value * * arg: tOptions*, pOpts, program options descriptor * arg: char const*, pzLine, NUL-terminated text * * doc: * * This is a client program callable routine for setting options from, for * example, the contents of a file that they read in. Only one option may * appear in the text. It will be treated as a normal (non-preset) option. * * When passed a pointer to the option struct and a string, it will find * the option named by the first token on the string and set the option * argument to the remainder of the string. The caller must NUL terminate * the string. Any embedded new lines will be included in the option * argument. If the input looks like one or more quoted strings, then the * input will be "cooked". The "cooking" is identical to the string * formation used in AutoGen definition files (@pxref{basic expression}), * except that you may not use backquotes. * * err: Invalid options are silently ignored. Invalid option arguments * will cause a warning to print, but the function should return. =*/ void optionLoadLine(tOptions * pOpts, char const * pzLine) { tOptState st = OPTSTATE_INITIALIZER(SET); char* pz; AGDUPSTR(pz, pzLine, "user option line"); loadOptionLine(pOpts, &st, pz, DIRECTION_PROCESS, OPTION_LOAD_COOKED); AGFREE(pz); } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/load.c */ ntp-4.2.6p5/sntp/libopts/nested.c0000644000175000017500000005045511564122254015712 0ustar peterpeter /** * \file nested.c * * Time-stamp: "2010-08-22 11:17:56 bkorb" * * Automated Options Nested Values module. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ typedef struct { int xml_ch; int xml_len; char xml_txt[8]; } xml_xlate_t; static xml_xlate_t const xml_xlate[] = { { '&', 4, "amp;" }, { '<', 3, "lt;" }, { '>', 3, "gt;" }, { '"', 5, "quot;" }, { '\'',5, "apos;" } }; /* = = = START-STATIC-FORWARD = = = */ static void remove_continuation(char* pzSrc); static char const* scan_q_str(char const* pzTxt); static tOptionValue* add_string(void** pp, char const* pzName, size_t nameLen, char const* pzValue, size_t dataLen); static tOptionValue* add_bool(void** pp, char const* pzName, size_t nameLen, char const* pzValue, size_t dataLen); static tOptionValue* add_number(void** pp, char const* pzName, size_t nameLen, char const* pzValue, size_t dataLen); static tOptionValue* add_nested(void** pp, char const* pzName, size_t nameLen, char* pzValue, size_t dataLen); static char const * scan_name(char const* pzName, tOptionValue* pRes); static char const* scan_xml(char const* pzName, tOptionValue* pRes); static void sort_list(tArgList* pAL); /* = = = END-STATIC-FORWARD = = = */ /** * Backslashes are used for line continuations. We keep the newline * characters, but trim out the backslash: */ static void remove_continuation(char* pzSrc) { char* pzD; do { while (*pzSrc == '\n') pzSrc++; pzD = strchr(pzSrc, '\n'); if (pzD == NULL) return; /* * pzD has skipped at least one non-newline character and now * points to a newline character. It now becomes the source and * pzD goes to the previous character. */ pzSrc = pzD--; if (*pzD != '\\') pzD++; } while (pzD == pzSrc); /* * Start shifting text. */ for (;;) { char ch = ((*pzD++) = *(pzSrc++)); switch (ch) { case NUL: return; case '\\': if (*pzSrc == '\n') --pzD; /* rewrite on next iteration */ } } } /** * Find the end of a quoted string, skipping escaped quote characters. */ static char const* scan_q_str(char const* pzTxt) { char q = *(pzTxt++); /* remember the type of quote */ for (;;) { char ch = *(pzTxt++); if (ch == NUL) return pzTxt-1; if (ch == q) return pzTxt; if (ch == '\\') { ch = *(pzTxt++); /* * IF the next character is NUL, drop the backslash, too. */ if (ch == NUL) return pzTxt - 2; /* * IF the quote character or the escape character were escaped, * then skip both, as long as the string does not end. */ if ((ch == q) || (ch == '\\')) { if (*(pzTxt++) == NUL) return pzTxt-1; } } } } /** * Associate a name with either a string or no value. */ static tOptionValue* add_string(void** pp, char const* pzName, size_t nameLen, char const* pzValue, size_t dataLen) { tOptionValue* pNV; size_t sz = nameLen + dataLen + sizeof(*pNV); pNV = AGALOC(sz, "option name/str value pair"); if (pNV == NULL) return NULL; if (pzValue == NULL) { pNV->valType = OPARG_TYPE_NONE; pNV->pzName = pNV->v.strVal; } else { pNV->valType = OPARG_TYPE_STRING; if (dataLen > 0) { char const * pzSrc = pzValue; char * pzDst = pNV->v.strVal; int ct = dataLen; do { int ch = *(pzSrc++) & 0xFF; if (ch == NUL) goto data_copy_done; if (ch == '&') ch = get_special_char(&pzSrc, &ct); *(pzDst++) = ch; } while (--ct > 0); data_copy_done: *pzDst = NUL; } else { pNV->v.strVal[0] = NUL; } pNV->pzName = pNV->v.strVal + dataLen + 1; } memcpy(pNV->pzName, pzName, nameLen); pNV->pzName[ nameLen ] = NUL; addArgListEntry(pp, pNV); return pNV; } /** * Associate a name with either a string or no value. */ static tOptionValue* add_bool(void** pp, char const* pzName, size_t nameLen, char const* pzValue, size_t dataLen) { tOptionValue* pNV; size_t sz = nameLen + sizeof(*pNV) + 1; pNV = AGALOC(sz, "option name/bool value pair"); if (pNV == NULL) return NULL; while (IS_WHITESPACE_CHAR(*pzValue) && (dataLen > 0)) { dataLen--; pzValue++; } if (dataLen == 0) pNV->v.boolVal = 0; else if (IS_DEC_DIGIT_CHAR(*pzValue)) pNV->v.boolVal = atoi(pzValue); else pNV->v.boolVal = ! IS_FALSE_TYPE_CHAR(*pzValue); pNV->valType = OPARG_TYPE_BOOLEAN; pNV->pzName = (char*)(pNV + 1); memcpy(pNV->pzName, pzName, nameLen); pNV->pzName[ nameLen ] = NUL; addArgListEntry(pp, pNV); return pNV; } /** * Associate a name with either a string or no value. */ static tOptionValue* add_number(void** pp, char const* pzName, size_t nameLen, char const* pzValue, size_t dataLen) { tOptionValue* pNV; size_t sz = nameLen + sizeof(*pNV) + 1; pNV = AGALOC(sz, "option name/bool value pair"); if (pNV == NULL) return NULL; while (IS_WHITESPACE_CHAR(*pzValue) && (dataLen > 0)) { dataLen--; pzValue++; } if (dataLen == 0) pNV->v.longVal = 0; else pNV->v.longVal = strtol(pzValue, 0, 0); pNV->valType = OPARG_TYPE_NUMERIC; pNV->pzName = (char*)(pNV + 1); memcpy(pNV->pzName, pzName, nameLen); pNV->pzName[ nameLen ] = NUL; addArgListEntry(pp, pNV); return pNV; } /** * Associate a name with either a string or no value. */ static tOptionValue* add_nested(void** pp, char const* pzName, size_t nameLen, char* pzValue, size_t dataLen) { tOptionValue* pNV; if (dataLen == 0) { size_t sz = nameLen + sizeof(*pNV) + 1; pNV = AGALOC(sz, "empty nested value pair"); if (pNV == NULL) return NULL; pNV->v.nestVal = NULL; pNV->valType = OPARG_TYPE_HIERARCHY; pNV->pzName = (char*)(pNV + 1); memcpy(pNV->pzName, pzName, nameLen); pNV->pzName[ nameLen ] = NUL; } else { pNV = optionLoadNested(pzValue, pzName, nameLen); } if (pNV != NULL) addArgListEntry(pp, pNV); return pNV; } /** * We have an entry that starts with a name. Find the end of it, cook it * (if called for) and create the name/value association. */ static char const * scan_name(char const* pzName, tOptionValue* pRes) { tOptionValue* pNV; char const * pzScan = pzName+1; /* we know first char is a name char */ char const * pzVal; size_t nameLen = 1; size_t dataLen = 0; /* * Scan over characters that name a value. These names may not end * with a colon, but they may contain colons. */ while (IS_VALUE_NAME_CHAR(*pzScan)) { pzScan++; nameLen++; } if (pzScan[-1] == ':') { pzScan--; nameLen--; } while (IS_HORIZ_WHITE_CHAR(*pzScan)) pzScan++; re_switch: switch (*pzScan) { case '=': case ':': while (IS_HORIZ_WHITE_CHAR((int)*++pzScan)) ; if ((*pzScan == '=') || (*pzScan == ':')) goto default_char; goto re_switch; case '\n': case ',': pzScan++; /* FALLTHROUGH */ case NUL: add_string(&(pRes->v.nestVal), pzName, nameLen, NULL, (size_t)0); break; case '"': case '\'': pzVal = pzScan; pzScan = scan_q_str(pzScan); dataLen = pzScan - pzVal; pNV = add_string(&(pRes->v.nestVal), pzName, nameLen, pzVal, dataLen); if ((pNV != NULL) && (option_load_mode == OPTION_LOAD_COOKED)) ao_string_cook(pNV->v.strVal, NULL); break; default: default_char: /* * We have found some strange text value. It ends with a newline * or a comma. */ pzVal = pzScan; for (;;) { char ch = *(pzScan++); switch (ch) { case NUL: pzScan--; dataLen = pzScan - pzVal; goto string_done; /* FALLTHROUGH */ case '\n': if ( (pzScan > pzVal + 2) && (pzScan[-2] == '\\') && (pzScan[ 0] != NUL)) continue; /* FALLTHROUGH */ case ',': dataLen = (pzScan - pzVal) - 1; string_done: pNV = add_string(&(pRes->v.nestVal), pzName, nameLen, pzVal, dataLen); if (pNV != NULL) remove_continuation(pNV->v.strVal); goto leave_scan_name; } } break; } leave_scan_name:; return pzScan; } /** * We've found a '<' character. We ignore this if it is a comment or a * directive. If it is something else, then whatever it is we are looking * at is bogus. Returning NULL stops processing. */ static char const* scan_xml(char const* pzName, tOptionValue* pRes) { size_t nameLen = 1, valLen = 0; char const* pzScan = ++pzName; char const* pzVal; tOptionValue valu; tOptionValue* pNewVal; tOptionLoadMode save_mode = option_load_mode; if (! IS_VAR_FIRST_CHAR(*pzName)) { switch (*pzName) { default: pzName = NULL; break; case '!': pzName = strstr(pzName, "-->"); if (pzName != NULL) pzName += 3; break; case '?': pzName = strchr(pzName, '>'); if (pzName != NULL) pzName++; break; } return pzName; } pzScan++; while (IS_VALUE_NAME_CHAR((int)*pzScan)) { pzScan++; nameLen++; } if (nameLen > 64) return NULL; valu.valType = OPARG_TYPE_STRING; switch (*pzScan) { case ' ': case '\t': pzScan = parseAttributes( NULL, (char*)pzScan, &option_load_mode, &valu ); if (*pzScan == '>') { pzScan++; break; } if (*pzScan != '/') { option_load_mode = save_mode; return NULL; } /* FALLTHROUGH */ case '/': if (*++pzScan != '>') { option_load_mode = save_mode; return NULL; } add_string(&(pRes->v.nestVal), pzName, nameLen, NULL, (size_t)0); option_load_mode = save_mode; return pzScan+1; default: option_load_mode = save_mode; return NULL; case '>': pzScan++; break; } pzVal = pzScan; { char z[68]; char* pzD = z; int ct = nameLen; char const* pzS = pzName; *(pzD++) = '<'; *(pzD++) = '/'; do { *(pzD++) = *(pzS++); } while (--ct > 0); *(pzD++) = '>'; *pzD = NUL; pzScan = strstr(pzScan, z); if (pzScan == NULL) { option_load_mode = save_mode; return NULL; } valLen = (pzScan - pzVal); pzScan += nameLen + 3; while (IS_WHITESPACE_CHAR(*pzScan)) pzScan++; } switch (valu.valType) { case OPARG_TYPE_NONE: add_string(&(pRes->v.nestVal), pzName, nameLen, NULL, (size_t)0); break; case OPARG_TYPE_STRING: pNewVal = add_string( &(pRes->v.nestVal), pzName, nameLen, pzVal, valLen); if (option_load_mode == OPTION_LOAD_KEEP) break; mungeString(pNewVal->v.strVal, option_load_mode); break; case OPARG_TYPE_BOOLEAN: add_bool(&(pRes->v.nestVal), pzName, nameLen, pzVal, valLen); break; case OPARG_TYPE_NUMERIC: add_number(&(pRes->v.nestVal), pzName, nameLen, pzVal, valLen); break; case OPARG_TYPE_HIERARCHY: { char* pz = AGALOC(valLen+1, "hierarchical scan"); if (pz == NULL) break; memcpy(pz, pzVal, valLen); pz[valLen] = NUL; add_nested(&(pRes->v.nestVal), pzName, nameLen, pz, valLen); AGFREE(pz); break; } case OPARG_TYPE_ENUMERATION: case OPARG_TYPE_MEMBERSHIP: default: break; } option_load_mode = save_mode; return pzScan; } /** * Deallocate a list of option arguments. This must have been gotten from * a hierarchical option argument, not a stacked list of strings. It is * an internal call, so it is not validated. The caller is responsible for * knowing what they are doing. */ LOCAL void unload_arg_list(tArgList* pAL) { int ct = pAL->useCt; tCC** ppNV = pAL->apzArgs; while (ct-- > 0) { tOptionValue* pNV = (tOptionValue*)(void*)*(ppNV++); if (pNV->valType == OPARG_TYPE_HIERARCHY) unload_arg_list(pNV->v.nestVal); AGFREE(pNV); } AGFREE((void*)pAL); } /*=export_func optionUnloadNested * * what: Deallocate the memory for a nested value * arg: + tOptionValue const * + pOptVal + the hierarchical value + * * doc: * A nested value needs to be deallocated. The pointer passed in should * have been gotten from a call to @code{configFileLoad()} (See * @pxref{libopts-configFileLoad}). =*/ void optionUnloadNested(tOptionValue const * pOV) { if (pOV == NULL) return; if (pOV->valType != OPARG_TYPE_HIERARCHY) { errno = EINVAL; return; } unload_arg_list(pOV->v.nestVal); AGFREE((void*)pOV); } /** * This is a _stable_ sort. The entries are sorted alphabetically, * but within entries of the same name the ordering is unchanged. * Typically, we also hope the input is sorted. */ static void sort_list(tArgList* pAL) { int ix; int lm = pAL->useCt; /* * This loop iterates "useCt" - 1 times. */ for (ix = 0; ++ix < lm;) { int iy = ix-1; tOptionValue* pNewNV = (tOptionValue*)(void*)(pAL->apzArgs[ix]); tOptionValue* pOldNV = (tOptionValue*)(void*)(pAL->apzArgs[iy]); /* * For as long as the new entry precedes the "old" entry, * move the old pointer. Stop before trying to extract the * "-1" entry. */ while (strcmp(pOldNV->pzName, pNewNV->pzName) > 0) { pAL->apzArgs[iy+1] = (void*)pOldNV; pOldNV = (tOptionValue*)(void*)(pAL->apzArgs[--iy]); if (iy < 0) break; } /* * Always store the pointer. Sometimes it is redundant, * but the redundancy is cheaper than a test and branch sequence. */ pAL->apzArgs[iy+1] = (void*)pNewNV; } } /* optionLoadNested * private: * * what: parse a hierarchical option argument * arg: + char const* + pzTxt + the text to scan + * arg: + char const* + pzName + the name for the text + * arg: + size_t + nameLen + the length of "name" + * * ret_type: tOptionValue* * ret_desc: An allocated, compound value structure * * doc: * A block of text represents a series of values. It may be an * entire configuration file, or it may be an argument to an * option that takes a hierarchical value. */ LOCAL tOptionValue* optionLoadNested(char const* pzTxt, char const* pzName, size_t nameLen) { tOptionValue* pRes; /* * Make sure we have some data and we have space to put what we find. */ if (pzTxt == NULL) { errno = EINVAL; return NULL; } while (IS_WHITESPACE_CHAR(*pzTxt)) pzTxt++; if (*pzTxt == NUL) { errno = ENOENT; return NULL; } pRes = AGALOC(sizeof(*pRes) + nameLen + 1, "nested args"); if (pRes == NULL) { errno = ENOMEM; return NULL; } pRes->valType = OPARG_TYPE_HIERARCHY; pRes->pzName = (char*)(pRes + 1); memcpy(pRes->pzName, pzName, nameLen); pRes->pzName[nameLen] = NUL; { tArgList * pAL = AGALOC(sizeof(*pAL), "nested arg list"); if (pAL == NULL) { AGFREE(pRes); return NULL; } pRes->v.nestVal = pAL; pAL->useCt = 0; pAL->allocCt = MIN_ARG_ALLOC_CT; } /* * Scan until we hit a NUL. */ do { while (IS_WHITESPACE_CHAR((int)*pzTxt)) pzTxt++; if (IS_VAR_FIRST_CHAR((int)*pzTxt)) { pzTxt = scan_name(pzTxt, pRes); } else switch (*pzTxt) { case NUL: goto scan_done; case '<': pzTxt = scan_xml(pzTxt, pRes); if (pzTxt == NULL) goto woops; if (*pzTxt == ',') pzTxt++; break; case '#': pzTxt = strchr(pzTxt, '\n'); break; default: goto woops; } } while (pzTxt != NULL); scan_done:; { tArgList * al = pRes->v.nestVal; if (al->useCt != 0) sort_list(al); } return pRes; woops: AGFREE(pRes->v.nestVal); AGFREE(pRes); return NULL; } /*=export_func optionNestedVal * private: * * what: parse a hierarchical option argument * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * Nested value was found on the command line =*/ void optionNestedVal(tOptions* pOpts, tOptDesc* pOD) { if (pOpts < OPTPROC_EMIT_LIMIT) return; if (pOD->fOptState & OPTST_RESET) { tArgList* pAL = pOD->optCookie; int ct; tCC ** av; if (pAL == NULL) return; ct = pAL->useCt; av = pAL->apzArgs; while (--ct >= 0) { void * p = (void *)*(av++); optionUnloadNested((tOptionValue const *)p); } AGFREE(pOD->optCookie); } else { tOptionValue* pOV = optionLoadNested( pOD->optArg.argString, pOD->pz_Name, strlen(pOD->pz_Name)); if (pOV != NULL) addArgListEntry(&(pOD->optCookie), (void*)pOV); } } /* * get_special_char */ LOCAL int get_special_char(char const ** ppz, int * ct) { char const * pz = *ppz; if (*ct < 3) return '&'; if (*pz == '#') { int base = 10; int retch; pz++; if (*pz == 'x') { base = 16; pz++; } retch = (int)strtoul(pz, (char **)&pz, base); if (*pz != ';') return '&'; base = ++pz - *ppz; if (base > *ct) return '&'; *ct -= base; *ppz = pz; return retch; } { int ctr = sizeof(xml_xlate) / sizeof(xml_xlate[0]); xml_xlate_t const * xlatp = xml_xlate; for (;;) { if ( (*ct >= xlatp->xml_len) && (strncmp(pz, xlatp->xml_txt, xlatp->xml_len) == 0)) { *ppz += xlatp->xml_len; *ct -= xlatp->xml_len; return xlatp->xml_ch; } if (--ctr <= 0) break; xlatp++; } } return '&'; } /* * emit_special_char */ LOCAL void emit_special_char(FILE * fp, int ch) { int ctr = sizeof(xml_xlate) / sizeof(xml_xlate[0]); xml_xlate_t const * xlatp = xml_xlate; putc('&', fp); for (;;) { if (ch == xlatp->xml_ch) { fputs(xlatp->xml_txt, fp); return; } if (--ctr <= 0) break; xlatp++; } fprintf(fp, "#x%02X;", (ch & 0xFF)); } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/nested.c */ ntp-4.2.6p5/sntp/libopts/configfile.c0000644000175000017500000011005711564122253016527 0ustar peterpeter/** * \file configfile.c * * Time-stamp: "2011-04-06 09:31:24 bkorb" * * configuration/rc/ini file handling. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ static void set_usage_flags(tOptions * opts, char const * flg_txt); /* = = = START-STATIC-FORWARD = = = */ static void file_preset(tOptions * opts, char const * fname, int dir); static char* handle_comment(char* pzText); static char * handle_cfg(tOptions * pOpts, tOptState * pOS, char * pzText, int dir); static char * handle_directive(tOptions * pOpts, char * pzText); static char * aoflags_directive(tOptions * pOpts, char * pzText); static char * program_directive(tOptions * pOpts, char * pzText); static char * handle_section(tOptions * pOpts, char * pzText); static int parse_xml_encoding(char ** ppz); static char * trim_xml_text(char * pztxt, char const * pznm, tOptionLoadMode mode); static void cook_xml_text(char * pzData); static char * handle_struct(tOptions * pOpts, tOptState * pOS, char * pzText, int dir); static char* parse_keyword(tOptions * pOpts, char * pzText, tOptionValue * pType); static char* parse_set_mem(tOptions * pOpts, char * pzText, tOptionValue * pType); static char * parse_value(char * pzText, tOptionValue * pType); static char * skip_unkn(char* pzText); /* = = = END-STATIC-FORWARD = = = */ /*=export_func configFileLoad * * what: parse a configuration file * arg: + char const* + pzFile + the file to load + * * ret_type: const tOptionValue* * ret_desc: An allocated, compound value structure * * doc: * This routine will load a named configuration file and parse the * text as a hierarchically valued option. The option descriptor * created from an option definition file is not used via this interface. * The returned value is "named" with the input file name and is of * type "@code{OPARG_TYPE_HIERARCHY}". It may be used in calls to * @code{optionGetValue()}, @code{optionNextValue()} and * @code{optionUnloadNested()}. * * err: * If the file cannot be loaded or processed, @code{NULL} is returned and * @var{errno} is set. It may be set by a call to either @code{open(2)} * @code{mmap(2)} or other file system calls, or it may be: * @itemize @bullet * @item * @code{ENOENT} - the file was empty. * @item * @code{EINVAL} - the file contents are invalid -- not properly formed. * @item * @code{ENOMEM} - not enough memory to allocate the needed structures. * @end itemize =*/ const tOptionValue* configFileLoad(char const* pzFile) { tmap_info_t cfgfile; tOptionValue* pRes = NULL; tOptionLoadMode save_mode = option_load_mode; char* pzText = text_mmap(pzFile, PROT_READ, MAP_PRIVATE, &cfgfile); if (TEXT_MMAP_FAILED_ADDR(pzText)) return NULL; /* errno is set */ option_load_mode = OPTION_LOAD_COOKED; pRes = optionLoadNested(pzText, pzFile, strlen(pzFile)); if (pRes == NULL) { int err = errno; text_munmap(&cfgfile); errno = err; } else text_munmap(&cfgfile); option_load_mode = save_mode; return pRes; } /*=export_func optionFindValue * * what: find a hierarcicaly valued option instance * arg: + const tOptDesc* + pOptDesc + an option with a nested arg type + * arg: + char const* + name + name of value to find + * arg: + char const* + value + the matching value + * * ret_type: const tOptionValue* * ret_desc: a compound value structure * * doc: * This routine will find an entry in a nested value option or configurable. * It will search through the list and return a matching entry. * * err: * The returned result is NULL and errno is set: * @itemize @bullet * @item * @code{EINVAL} - the @code{pOptValue} does not point to a valid * hierarchical option value. * @item * @code{ENOENT} - no entry matched the given name. * @end itemize =*/ const tOptionValue* optionFindValue(const tOptDesc* pOptDesc, char const* pzName, char const* pzVal) { const tOptionValue* pRes = NULL; if ( (pOptDesc == NULL) || (OPTST_GET_ARGTYPE(pOptDesc->fOptState) != OPARG_TYPE_HIERARCHY)) { errno = EINVAL; } else if (pOptDesc->optCookie == NULL) { errno = ENOENT; } else do { tArgList* pAL = pOptDesc->optCookie; int ct = pAL->useCt; void** ppOV = (void**)(pAL->apzArgs); if (ct == 0) { errno = ENOENT; break; } if (pzName == NULL) { pRes = (tOptionValue*)*ppOV; break; } while (--ct >= 0) { const tOptionValue* pOV = *(ppOV++); const tOptionValue* pRV = optionGetValue(pOV, pzName); if (pRV == NULL) continue; if (pzVal == NULL) { pRes = pOV; break; } } if (pRes == NULL) errno = ENOENT; } while (0); return pRes; } /*=export_func optionFindNextValue * * what: find a hierarcicaly valued option instance * arg: + const tOptDesc* + pOptDesc + an option with a nested arg type + * arg: + const tOptionValue* + pPrevVal + the last entry + * arg: + char const* + name + name of value to find + * arg: + char const* + value + the matching value + * * ret_type: const tOptionValue* * ret_desc: a compound value structure * * doc: * This routine will find the next entry in a nested value option or * configurable. It will search through the list and return the next entry * that matches the criteria. * * err: * The returned result is NULL and errno is set: * @itemize @bullet * @item * @code{EINVAL} - the @code{pOptValue} does not point to a valid * hierarchical option value. * @item * @code{ENOENT} - no entry matched the given name. * @end itemize =*/ tOptionValue const * optionFindNextValue(const tOptDesc * pOptDesc, const tOptionValue * pPrevVal, char const * pzName, char const * pzVal) { int foundOldVal = 0; tOptionValue* pRes = NULL; if ( (pOptDesc == NULL) || (OPTST_GET_ARGTYPE(pOptDesc->fOptState) != OPARG_TYPE_HIERARCHY)) { errno = EINVAL; } else if (pOptDesc->optCookie == NULL) { errno = ENOENT; } else do { tArgList* pAL = pOptDesc->optCookie; int ct = pAL->useCt; void** ppOV = (void**)pAL->apzArgs; if (ct == 0) { errno = ENOENT; break; } while (--ct >= 0) { tOptionValue* pOV = *(ppOV++); if (foundOldVal) { pRes = pOV; break; } if (pOV == pPrevVal) foundOldVal = 1; } if (pRes == NULL) errno = ENOENT; } while (0); return pRes; } /*=export_func optionGetValue * * what: get a specific value from a hierarcical list * arg: + const tOptionValue* + pOptValue + a hierarchcal value + * arg: + char const* + valueName + name of value to get + * * ret_type: const tOptionValue* * ret_desc: a compound value structure * * doc: * This routine will find an entry in a nested value option or configurable. * If "valueName" is NULL, then the first entry is returned. Otherwise, * the first entry with a name that exactly matches the argument will be * returned. * * err: * The returned result is NULL and errno is set: * @itemize @bullet * @item * @code{EINVAL} - the @code{pOptValue} does not point to a valid * hierarchical option value. * @item * @code{ENOENT} - no entry matched the given name. * @end itemize =*/ const tOptionValue* optionGetValue(const tOptionValue* pOld, char const* pzValName) { tArgList* pAL; tOptionValue* pRes = NULL; if ((pOld == NULL) || (pOld->valType != OPARG_TYPE_HIERARCHY)) { errno = EINVAL; return NULL; } pAL = pOld->v.nestVal; if (pAL->useCt > 0) { int ct = pAL->useCt; void** papOV = (void**)(pAL->apzArgs); if (pzValName == NULL) { pRes = (tOptionValue*)*papOV; } else do { tOptionValue* pOV = *(papOV++); if (strcmp(pOV->pzName, pzValName) == 0) { pRes = pOV; break; } } while (--ct > 0); } if (pRes == NULL) errno = ENOENT; return pRes; } /*=export_func optionNextValue * * what: get the next value from a hierarchical list * arg: + const tOptionValue* + pOptValue + a hierarchcal list value + * arg: + const tOptionValue* + pOldValue + a value from this list + * * ret_type: const tOptionValue* * ret_desc: a compound value structure * * doc: * This routine will return the next entry after the entry passed in. At the * end of the list, NULL will be returned. If the entry is not found on the * list, NULL will be returned and "@var{errno}" will be set to EINVAL. * The "@var{pOldValue}" must have been gotten from a prior call to this * routine or to "@code{opitonGetValue()}". * * err: * The returned result is NULL and errno is set: * @itemize @bullet * @item * @code{EINVAL} - the @code{pOptValue} does not point to a valid * hierarchical option value or @code{pOldValue} does not point to a * member of that option value. * @item * @code{ENOENT} - the supplied @code{pOldValue} pointed to the last entry. * @end itemize =*/ tOptionValue const * optionNextValue(tOptionValue const * pOVList,tOptionValue const * pOldOV ) { tArgList* pAL; tOptionValue* pRes = NULL; int err = EINVAL; if ((pOVList == NULL) || (pOVList->valType != OPARG_TYPE_HIERARCHY)) { errno = EINVAL; return NULL; } pAL = pOVList->v.nestVal; { int ct = pAL->useCt; void** papNV = (void**)(pAL->apzArgs); while (ct-- > 0) { tOptionValue* pNV = *(papNV++); if (pNV == pOldOV) { if (ct == 0) { err = ENOENT; } else { err = 0; pRes = (tOptionValue*)*papNV; } break; } } } if (err != 0) errno = err; return pRes; } /** * Load a file containing presetting information (a configuration file). */ static void file_preset(tOptions * opts, char const * fname, int dir) { tmap_info_t cfgfile; tOptState optst = OPTSTATE_INITIALIZER(PRESET); tAoUL st_flags = optst.flags; char * ftext = text_mmap(fname, PROT_READ|PROT_WRITE, MAP_PRIVATE, &cfgfile); if (TEXT_MMAP_FAILED_ADDR(ftext)) return; if (dir == DIRECTION_CALLED) { st_flags = OPTST_DEFINED; dir = DIRECTION_PROCESS; } /* * IF this is called via "optionProcess", then we are presetting. * This is the default and the PRESETTING bit will be set. * If this is called via "optionFileLoad", then the bit is not set * and we consider stuff set herein to be "set" by the client program. */ if ((opts->fOptSet & OPTPROC_PRESETTING) == 0) st_flags = OPTST_SET; do { optst.flags = st_flags; while (IS_WHITESPACE_CHAR(*ftext)) ftext++; if (IS_VAR_FIRST_CHAR(*ftext)) { ftext = handle_cfg(opts, &optst, ftext, dir); } else switch (*ftext) { case '<': if (IS_VAR_FIRST_CHAR(ftext[1])) ftext = handle_struct(opts, &optst, ftext, dir); else switch (ftext[1]) { case '?': ftext = handle_directive(opts, ftext); break; case '!': ftext = handle_comment(ftext); break; case '/': ftext = strchr(ftext + 2, '>'); if (ftext++ != NULL) break; default: goto all_done; } break; case '[': ftext = handle_section(opts, ftext); break; case '#': ftext = strchr(ftext + 1, '\n'); break; default: goto all_done; /* invalid format */ } } while (ftext != NULL); all_done: text_munmap(&cfgfile); } /** * "pzText" points to a "". */ static char* handle_comment(char* pzText) { char* pz = strstr(pzText, "-->"); if (pz != NULL) pz += 3; return pz; } /** * "pzText" points to the start of some value name. * The end of the entry is the end of the line that is not preceded by * a backslash escape character. The string value is always processed * in "cooked" mode. */ static char * handle_cfg(tOptions * pOpts, tOptState * pOS, char * pzText, int dir) { char* pzName = pzText++; char* pzEnd = strchr(pzText, '\n'); if (pzEnd == NULL) return pzText + strlen(pzText); while (IS_VALUE_NAME_CHAR(*pzText)) pzText++; while (IS_WHITESPACE_CHAR(*pzText)) pzText++; if (pzText > pzEnd) { name_only: *pzEnd++ = NUL; loadOptionLine(pOpts, pOS, pzName, dir, OPTION_LOAD_UNCOOKED); return pzEnd; } /* * Either the first character after the name is a ':' or '=', * or else we must have skipped over white space. Anything else * is an invalid format and we give up parsing the text. */ if ((*pzText == '=') || (*pzText == ':')) { while (IS_WHITESPACE_CHAR(*++pzText)) ; if (pzText > pzEnd) goto name_only; } else if (! IS_WHITESPACE_CHAR(pzText[-1])) return NULL; /* * IF the value is continued, remove the backslash escape and push "pzEnd" * on to a newline *not* preceded by a backslash. */ if (pzEnd[-1] == '\\') { char* pcD = pzEnd-1; char* pcS = pzEnd; for (;;) { char ch = *(pcS++); switch (ch) { case NUL: pcS = NULL; case '\n': *pcD = NUL; pzEnd = pcS; goto copy_done; case '\\': if (*pcS == '\n') { ch = *(pcS++); } /* FALLTHROUGH */ default: *(pcD++) = ch; } } copy_done:; } else { /* * The newline was not preceded by a backslash. NUL it out */ *(pzEnd++) = NUL; } /* * "pzName" points to what looks like text for one option/configurable. * It is NUL terminated. Process it. */ loadOptionLine(pOpts, pOS, pzName, dir, OPTION_LOAD_UNCOOKED); return pzEnd; } /** * "pzText" points to a "'); if (pzText != NULL) pzText++; return pzText; } /** * handle AutoOpts mode flags */ static char * aoflags_directive(tOptions * pOpts, char * pzText) { char * pz = pzText; while (IS_WHITESPACE_CHAR(*++pz)) ; pzText = strchr(pz, '>'); if (pzText != NULL) { size_t len = pzText - pz; char * ftxt = AGALOC(len + 1, "aoflags"); memcpy(ftxt, pz, len); ftxt[len] = NUL; set_usage_flags(pOpts, ftxt); AGFREE(ftxt); pzText++; } return pzText; } /** * handle program segmentation of config file. */ static char * program_directive(tOptions * pOpts, char * pzText) { static char const ttlfmt[] = "pzProgName); memcpy(ttl, ttlfmt, sizeof(ttlfmt) - 1); memcpy(ttl + sizeof(ttlfmt) - 1, zCfgProg, ttl_len - (sizeof(ttlfmt) - 1)); do { while (IS_WHITESPACE_CHAR(*++pzText)) ; if ( (strneqvcmp(pzText, pOpts->pzProgName, (int)name_len) == 0) && (IS_END_XML_TOKEN_CHAR(pzText[name_len])) ) { pzText += name_len; break; } pzText = strstr(pzText, ttl); } while (pzText != NULL); AGFREE(ttl); if (pzText != NULL) for (;;) { if (*pzText == NUL) { pzText = NULL; break; } if (*(pzText++) == '>') break; } return pzText; } /** * "pzText" points to a '[' character. * The "traditional" [PROG_NAME] segmentation of the config file. * Do not ever mix with the "" variation. */ static char * handle_section(tOptions * pOpts, char * pzText) { size_t len = strlen(pOpts->pzPROGNAME); if ( (strncmp(pzText+1, pOpts->pzPROGNAME, len) == 0) && (pzText[len+1] == ']')) return strchr(pzText + len + 2, '\n'); if (len > 16) return NULL; { char z[24]; sprintf(z, "[%s]", pOpts->pzPROGNAME); pzText = strstr(pzText, z); } if (pzText != NULL) pzText = strchr(pzText, '\n'); return pzText; } /** * parse XML encodings */ static int parse_xml_encoding(char ** ppz) { # define XMLTABLE \ _xmlNm_(amp, '&') \ _xmlNm_(lt, '<') \ _xmlNm_(gt, '>') \ _xmlNm_(ff, '\f') \ _xmlNm_(ht, '\t') \ _xmlNm_(cr, '\r') \ _xmlNm_(vt, '\v') \ _xmlNm_(bel, '\a') \ _xmlNm_(nl, '\n') \ _xmlNm_(space, ' ') \ _xmlNm_(quot, '"') \ _xmlNm_(apos, '\'') static struct { char const * const nm_str; unsigned short nm_len; short nm_val; } const xml_names[] = { # define _xmlNm_(_n, _v) { #_n ";", sizeof(#_n), _v }, XMLTABLE # undef _xmlNm_ # undef XMLTABLE }; static int const nm_ct = sizeof(xml_names) / sizeof(xml_names[0]); int base = 10; char * pz = *ppz; if (*pz == '#') { pz++; goto parse_number; } if (IS_DEC_DIGIT_CHAR(*pz)) { unsigned long v; parse_number: switch (*pz) { case 'x': case 'X': /* * Some forms specify hex with: &#xNN; */ base = 16; pz++; break; case '0': /* *  is hex and  is decimal. Cool. * Ya gotta love it. */ if (pz[1] == '0') base = 16; break; } v = strtoul(pz, &pz, base); if ((*pz != ';') || (v > 0x7F)) return NUL; *ppz = pz + 1; return (int)v; } { int ix = 0; do { if (strncmp(pz, xml_names[ix].nm_str, xml_names[ix].nm_len) == 0) { *ppz = pz + xml_names[ix].nm_len; return xml_names[ix].nm_val; } } while (++ix < nm_ct); } return NUL; } /** * Find the end marker for the named section of XML. * Trim that text there, trimming trailing white space for all modes * except for OPTION_LOAD_UNCOOKED. */ static char * trim_xml_text(char * pztxt, char const * pznm, tOptionLoadMode mode) { static char const fmt[] = ""; char z[64], *pz = z; size_t len = strlen(pznm) + sizeof(fmt) - 2 /* for %s */; if (len > sizeof(z)) pz = AGALOC(len, "scan name"); sprintf(pz, fmt, pznm); *pztxt = ' '; pztxt = strstr(pztxt, pz); if (pz != z) AGFREE(pz); if (pztxt == NULL) return pztxt; if (mode != OPTION_LOAD_UNCOOKED) while (IS_WHITESPACE_CHAR(pztxt[-1])) len++, pztxt--; *pztxt = NUL; return pztxt + len - 1 /* for NUL byte */; } /** */ static void cook_xml_text(char * pzData) { char * pzs = pzData; char * pzd = pzData; char bf[4]; bf[2] = NUL; for (;;) { int ch = ((int)*(pzs++)) & 0xFF; switch (ch) { case NUL: *pzd = NUL; return; case '&': *(pzd++) = \ ch = parse_xml_encoding(&pzs); if (ch == NUL) return; break; case '%': bf[0] = *(pzs++); bf[1] = *(pzs++); if ((bf[0] == NUL) || (bf[1] == NUL)) { *pzd = NUL; return; } ch = strtoul(bf, NULL, 16); /* FALLTHROUGH */ default: *(pzd++) = ch; } } } /** * "pzText" points to a '<' character, followed by an alpha. * The end of the entry is either the "/>" following the name, or else a * "" string. */ static char * handle_struct(tOptions * pOpts, tOptState * pOS, char * pzText, int dir) { tOptionLoadMode mode = option_load_mode; tOptionValue valu; char* pzName = ++pzText; char* pzData; char* pcNulPoint; while (IS_VALUE_NAME_CHAR(*pzText)) pzText++; pcNulPoint = pzText; valu.valType = OPARG_TYPE_STRING; switch (*pzText) { case ' ': case '\t': pzText = parseAttributes(pOpts, pzText, &mode, &valu); if (*pzText == '>') break; if (*pzText != '/') return NULL; /* FALLTHROUGH */ case '/': if (pzText[1] != '>') return NULL; *pzText = NUL; pzText += 2; loadOptionLine(pOpts, pOS, pzName, dir, mode); return pzText; case '>': break; default: pzText = strchr(pzText, '>'); if (pzText != NULL) pzText++; return pzText; } /* * If we are here, we have a value. "pzText" points to a closing angle * bracket. Separate the name from the value for a moment. */ *pcNulPoint = NUL; pzData = ++pzText; pzText = trim_xml_text(pzText, pzName, mode); if (pzText == NULL) return pzText; /* * Rejoin the name and value for parsing by "loadOptionLine()". * Erase any attributes parsed by "parseAttributes()". */ memset(pcNulPoint, ' ', pzData - pcNulPoint); /* * If we are getting a "string" value that is to be cooked, * then process the XML-ish &xx; XML-ish and %XX hex characters. */ if ( (valu.valType == OPARG_TYPE_STRING) && (mode == OPTION_LOAD_COOKED)) cook_xml_text(pzData); /* * "pzName" points to what looks like text for one option/configurable. * It is NUL terminated. Process it. */ loadOptionLine(pOpts, pOS, pzName, dir, mode); return pzText; } /** * Load a configuration file. This may be invoked either from * scanning the "homerc" list, or from a specific file request. * (see "optionFileLoad()", the implementation for --load-opts) */ LOCAL void internalFileLoad(tOptions* pOpts) { uint32_t svfl; int idx; int inc; char zFileName[ AG_PATH_MAX+1 ]; if (pOpts->papzHomeList == NULL) return; svfl = pOpts->fOptSet; inc = DIRECTION_PRESET; /* * Never stop on errors in config files. */ pOpts->fOptSet &= ~OPTPROC_ERRSTOP; /* * Find the last RC entry (highest priority entry) */ for (idx = 0; pOpts->papzHomeList[ idx+1 ] != NULL; ++idx) ; /* * For every path in the home list, ... *TWICE* We start at the last * (highest priority) entry, work our way down to the lowest priority, * handling the immediate options. * Then we go back up, doing the normal options. */ for (;;) { struct stat StatBuf; cch_t* pzPath; /* * IF we've reached the bottom end, change direction */ if (idx < 0) { inc = DIRECTION_PROCESS; idx = 0; } pzPath = pOpts->papzHomeList[ idx ]; /* * IF we've reached the top end, bail out */ if (pzPath == NULL) break; idx += inc; if (! optionMakePath(zFileName, (int)sizeof(zFileName), pzPath, pOpts->pzProgPath)) continue; /* * IF the file name we constructed is a directory, * THEN append the Resource Configuration file name * ELSE we must have the complete file name */ if (stat(zFileName, &StatBuf) != 0) continue; /* bogus name - skip the home list entry */ if (S_ISDIR(StatBuf.st_mode)) { size_t len = strlen(zFileName); size_t nln = strlen(pOpts->pzRcName) + 1; char * pz = zFileName + len; if (len + 1 + nln >= sizeof(zFileName)) continue; if (pz[-1] != DIRCH) *(pz++) = DIRCH; memcpy(pz, pOpts->pzRcName, nln); } file_preset(pOpts, zFileName, inc); /* * IF we are now to skip config files AND we are presetting, * THEN change direction. We must go the other way. */ { tOptDesc * pOD = pOpts->pOptDesc + pOpts->specOptIdx.save_opts+1; if (DISABLED_OPT(pOD) && PRESETTING(inc)) { idx -= inc; /* go back and reprocess current file */ inc = DIRECTION_PROCESS; } } } /* twice for every path in the home list, ... */ pOpts->fOptSet = svfl; } /*=export_func optionFileLoad * * what: Load the locatable config files, in order * * arg: + tOptions* + pOpts + program options descriptor + * arg: + char const* + pzProg + program name + * * ret_type: int * ret_desc: 0 -> SUCCESS, -1 -> FAILURE * * doc: * * This function looks in all the specified directories for a configuration * file ("rc" file or "ini" file) and processes any found twice. The first * time through, they are processed in reverse order (last file first). At * that time, only "immediate action" configurables are processed. For * example, if the last named file specifies not processing any more * configuration files, then no more configuration files will be processed. * Such an option in the @strong{first} named directory will have no effect. * * Once the immediate action configurables have been handled, then the * directories are handled in normal, forward order. In that way, later * config files can override the settings of earlier config files. * * See the AutoOpts documentation for a thorough discussion of the * config file format. * * Configuration files not found or not decipherable are simply ignored. * * err: Returns the value, "-1" if the program options descriptor * is out of date or indecipherable. Otherwise, the value "0" will * always be returned. =*/ int optionFileLoad(tOptions* pOpts, char const* pzProgram) { if (! SUCCESSFUL(validateOptionsStruct(pOpts, pzProgram))) return -1; { char const ** pp = (char const **)(void *)&(pOpts->pzProgName); *pp = pzProgram; } internalFileLoad(pOpts); return 0; } /*=export_func optionLoadOpt * private: * * what: Load an option rc/ini file * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * Processes the options found in the file named with * pOptDesc->optArg.argString. =*/ void optionLoadOpt(tOptions* pOpts, tOptDesc* pOptDesc) { struct stat sb; /* * IF the option is not being disabled, THEN load the file. There must * be a file. (If it is being disabled, then the disablement processing * already took place. It must be done to suppress preloading of ini/rc * files.) */ if ( DISABLED_OPT(pOptDesc) || ((pOptDesc->fOptState & OPTST_RESET) != 0)) return; if (stat(pOptDesc->optArg.argString, &sb) != 0) { if ((pOpts->fOptSet & OPTPROC_ERRSTOP) == 0) return; fprintf(stderr, zFSErrOptLoad, errno, strerror(errno), pOptDesc->optArg.argString); exit(EX_NOINPUT); /* NOT REACHED */ } if (! S_ISREG(sb.st_mode)) { if ((pOpts->fOptSet & OPTPROC_ERRSTOP) == 0) return; fprintf(stderr, zNotFile, pOptDesc->optArg.argString); exit(EX_NOINPUT); /* NOT REACHED */ } file_preset(pOpts, pOptDesc->optArg.argString, DIRECTION_CALLED); } /** * Parse the various attributes of an XML-styled config file entry */ LOCAL char* parseAttributes( tOptions* pOpts, char* pzText, tOptionLoadMode* pMode, tOptionValue* pType ) { size_t len; do { if (! IS_WHITESPACE_CHAR(*pzText)) switch (*pzText) { case '/': pType->valType = OPARG_TYPE_NONE; case '>': return pzText; default: case NUL: return NULL; } while (IS_WHITESPACE_CHAR(*++pzText)) ; len = 0; while (IS_LOWER_CASE_CHAR(pzText[len])) len++; switch (find_xat_attribute_id(pzText, len)) { case XAT_KWD_TYPE: pzText = parse_value(pzText+len, pType); break; case XAT_KWD_WORDS: pzText = parse_keyword(pOpts, pzText+len, pType); break; case XAT_KWD_MEMBERS: pzText = parse_set_mem(pOpts, pzText+len, pType); break; case XAT_KWD_COOKED: pzText += len; if (! IS_END_XML_TOKEN_CHAR(*pzText)) goto invalid_kwd; *pMode = OPTION_LOAD_COOKED; break; case XAT_KWD_UNCOOKED: pzText += len; if (! IS_END_XML_TOKEN_CHAR(*pzText)) goto invalid_kwd; *pMode = OPTION_LOAD_UNCOOKED; break; case XAT_KWD_KEEP: pzText += len; if (! IS_END_XML_TOKEN_CHAR(*pzText)) goto invalid_kwd; *pMode = OPTION_LOAD_KEEP; break; default: case XAT_KWD_INVALID: invalid_kwd: pType->valType = OPARG_TYPE_NONE; return skip_unkn(pzText); } } while (pzText != NULL); return pzText; } /** * "pzText" points to the character after "words=". * What should follow is a name of a keyword (enumeration) list. */ static char* parse_keyword(tOptions * pOpts, char * pzText, tOptionValue * pType) { return skip_unkn(pzText); } /** * "pzText" points to the character after "members=" * What should follow is a name of a "set membership". * A collection of bit flags. */ static char* parse_set_mem(tOptions * pOpts, char * pzText, tOptionValue * pType) { return skip_unkn(pzText); } /** * "pzText" points to the character after "type=" */ static char * parse_value(char * pzText, tOptionValue * pType) { size_t len = 0; if (*(pzText++) != '=') goto woops; while (IS_OPTION_NAME_CHAR(pzText[len])) len++; pzText += len; if ((len == 0) || (! IS_END_XML_TOKEN_CHAR(*pzText))) { woops: pType->valType = OPARG_TYPE_NONE; return skip_unkn(pzText); } switch (find_value_type_id(pzText - len, len)) { default: case VTP_KWD_INVALID: goto woops; case VTP_KWD_STRING: pType->valType = OPARG_TYPE_STRING; break; case VTP_KWD_INTEGER: pType->valType = OPARG_TYPE_NUMERIC; break; case VTP_KWD_BOOL: case VTP_KWD_BOOLEAN: pType->valType = OPARG_TYPE_BOOLEAN; break; case VTP_KWD_KEYWORD: pType->valType = OPARG_TYPE_ENUMERATION; break; case VTP_KWD_SET: case VTP_KWD_SET_MEMBERSHIP: pType->valType = OPARG_TYPE_MEMBERSHIP; break; case VTP_KWD_NESTED: case VTP_KWD_HIERARCHY: pType->valType = OPARG_TYPE_HIERARCHY; } return pzText; } /** * Skip over some unknown attribute */ static char * skip_unkn(char* pzText) { for (;; pzText++) { if (IS_END_XML_TOKEN_CHAR(*pzText)) return pzText; if (*pzText == NUL) return NULL; } } /** * Make sure the option descriptor is there and that we understand it. * This should be called from any user entry point where one needs to * worry about validity. (Some entry points are free to assume that * the call is not the first to the library and, thus, that this has * already been called.) */ LOCAL tSuccess validateOptionsStruct(tOptions* pOpts, char const* pzProgram) { if (pOpts == NULL) { fputs(zAO_Bad, stderr); exit(EX_CONFIG); } /* * IF the client has enabled translation and the translation procedure * is available, then go do it. */ if ( ((pOpts->fOptSet & OPTPROC_TRANSLATE) != 0) && (pOpts->pTransProc != NULL) ) { /* * If option names are not to be translated at all, then do not do * it for configuration parsing either. (That is the bit that really * gets tested anyway.) */ if ((pOpts->fOptSet & OPTPROC_NO_XLAT_MASK) == OPTPROC_NXLAT_OPT) pOpts->fOptSet |= OPTPROC_NXLAT_OPT_CFG; (*pOpts->pTransProc)(); pOpts->fOptSet &= ~OPTPROC_TRANSLATE; } /* * IF the struct version is not the current, and also * either too large (?!) or too small, * THEN emit error message and fail-exit */ if ( ( pOpts->structVersion != OPTIONS_STRUCT_VERSION ) && ( (pOpts->structVersion > OPTIONS_STRUCT_VERSION ) || (pOpts->structVersion < OPTIONS_MINIMUM_VERSION ) ) ) { static char const aover[] = __STR(AO_CURRENT)":"__STR(AO_REVISION)":"__STR(AO_AGE)"\n"; fprintf(stderr, zAO_Err, pzProgram, NUM_TO_VER(pOpts->structVersion)); if (pOpts->structVersion > OPTIONS_STRUCT_VERSION ) fputs(zAO_Big, stderr); else fputs(zAO_Sml, stderr); fwrite(aover, sizeof(aover) - 1, 1, stderr); return FAILURE; } /* * If the program name hasn't been set, then set the name and the path * and the set of equivalent characters. */ if (pOpts->pzProgName == NULL) { char const * pz = strrchr(pzProgram, DIRCH); char const ** pp = (char const **)(void **)&(pOpts->pzProgName); if (pz == NULL) *pp = pzProgram; else *pp = pz+1; pp = (char const **)(void **)&(pOpts->pzProgPath); *pp = pzProgram; /* * when comparing long names, these are equivalent */ strequate(zSepChars); } return SUCCESS; } /** * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/configfile.c */ ntp-4.2.6p5/sntp/libopts/COPYING.gplv30000644000175000017500000010453211564122254016345 0ustar peterpeter GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (c) 1992-2011 by Bruce Korb - all rights reserved Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. copyright (c) by Bruce Korb - all rights reserved 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 . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: copyright (c) by Bruce Korb - all rights reserved This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ntp-4.2.6p5/sntp/libopts/numeric.c0000644000175000017500000001144311564122255016065 0ustar peterpeter /** * \file numeric.c * * Time-stamp: "2011-03-25 16:26:10 bkorb" * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ /*=export_func optionShowRange * private: * * what: * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * arg: + void * + rng_table + the value range tables + * arg: + int + rng_count + the number of entries + * * doc: * Show information about a numeric option with range constraints. =*/ void optionShowRange(tOptions* pOpts, tOptDesc* pOD, void * rng_table, int rng_ct) { static char const bullet[] = "\t\t\t\t- "; static char const deepin[] = "\t\t\t\t "; static char const onetab[] = "\t"; const struct {long const rmin, rmax;} * rng = rng_table; char const * pz_indent = bullet; /* * The range is shown only for full usage requests and an error * in this particular option. */ if (pOpts != OPTPROC_EMIT_USAGE) { if (pOpts <= OPTPROC_EMIT_LIMIT) return; pz_indent = onetab; fprintf(option_usage_fp, zRangeErr, pOpts->pzProgName, pOD->pz_Name, pOD->optArg.argString); pz_indent = ""; } if (pOD->fOptState & OPTST_SCALED_NUM) fprintf(option_usage_fp, zRangeScaled, pz_indent); fprintf(option_usage_fp, (rng_ct > 1) ? zRangeLie : zRangeOnly, pz_indent); pz_indent = (pOpts != OPTPROC_EMIT_USAGE) ? onetab : deepin; for (;;) { if (rng->rmax == LONG_MIN) fprintf(option_usage_fp, zRangeExact, pz_indent, rng->rmin); else if (rng->rmin == LONG_MIN) fprintf(option_usage_fp, zRangeUpto, pz_indent, rng->rmax); else if (rng->rmax == LONG_MAX) fprintf(option_usage_fp, zRangeAbove, pz_indent, rng->rmin); else fprintf(option_usage_fp, zRange, pz_indent, rng->rmin, rng->rmax); if (--rng_ct <= 0) { fputc('\n', option_usage_fp); break; } fputs(zRangeOr, option_usage_fp); rng++; } if (pOpts > OPTPROC_EMIT_LIMIT) pOpts->pUsageProc(pOpts, EXIT_FAILURE); } /*=export_func optionNumericVal * private: * * what: process an option with a numeric value. * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * Decipher a numeric value. =*/ void optionNumericVal(tOptions* pOpts, tOptDesc* pOD ) { char* pz; long val; /* * Numeric options may have a range associated with it. * If it does, the usage procedure requests that it be * emitted by passing a NULL pOD pointer. Also bail out * if there is no option argument or if we are being reset. */ if ( (pOD == NULL) || (pOD->optArg.argString == NULL) || ((pOD->fOptState & OPTST_RESET) != 0)) return; errno = 0; val = strtol(pOD->optArg.argString, &pz, 0); if ((pz == pOD->optArg.argString) || (errno != 0)) goto bad_number; if ((pOD->fOptState & OPTST_SCALED_NUM) != 0) switch (*(pz++)) { case '\0': pz--; break; case 't': val *= 1000; case 'g': val *= 1000; case 'm': val *= 1000; case 'k': val *= 1000; break; case 'T': val *= 1024; case 'G': val *= 1024; case 'M': val *= 1024; case 'K': val *= 1024; break; default: goto bad_number; } if (*pz != NUL) goto bad_number; if (pOD->fOptState & OPTST_ALLOC_ARG) { AGFREE(pOD->optArg.argString); pOD->fOptState &= ~OPTST_ALLOC_ARG; } pOD->optArg.argInt = val; return; bad_number: fprintf( stderr, zNotNumber, pOpts->pzProgName, pOD->optArg.argString ); if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) (*(pOpts->pUsageProc))(pOpts, EXIT_FAILURE); errno = EINVAL; pOD->optArg.argInt = ~0; } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/numeric.c */ ntp-4.2.6p5/sntp/libopts/reset.c0000644000175000017500000000733711564122253015552 0ustar peterpeter /** * \file reset.c * * Time-stamp: "2010-07-10 10:56:34 bkorb" * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ static void optionReset( tOptions* pOpts, tOptDesc* pOD ) { pOD->fOptState &= OPTST_PERSISTENT_MASK; pOD->fOptState |= OPTST_RESET; if (pOD->pOptProc != NULL) pOD->pOptProc(pOpts, pOD); pOD->optArg.argString = pOpts->originalOptArgArray[ pOD->optIndex ].argString; pOD->optCookie = pOpts->originalOptArgCookie[ pOD->optIndex ]; pOD->fOptState &= OPTST_PERSISTENT_MASK; } static void optionResetEverything(tOptions * pOpts) { tOptDesc * pOD = pOpts->pOptDesc; int ct = pOpts->presetOptCt; for (;;) { optionReset(pOpts, pOD); if (--ct <= 0) break; pOD++; } } /*=export_func optionResetOpt * private: * * what: Reset the value of an option * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * This code will cause another option to be reset to its initial state. * For example, --reset=foo will cause the --foo option to be reset. =*/ void optionResetOpt( tOptions* pOpts, tOptDesc* pOD ) { static ag_bool reset_active = AG_FALSE; tOptState opt_state = OPTSTATE_INITIALIZER(DEFINED); char const * pzArg = pOD->optArg.argString; tSuccess succ; if (reset_active) return; if ( (! HAS_originalOptArgArray(pOpts)) || (pOpts->originalOptArgCookie == NULL)) { fputs(zResetNotConfig, stderr); _exit(EX_SOFTWARE); } if ((pzArg == NULL) || (*pzArg == NUL)) { fputs(zNoResetArg, stderr); pOpts->pUsageProc(pOpts, EXIT_FAILURE); /* NOTREACHED */ assert(0 == 1); } reset_active = AG_TRUE; if (pzArg[1] == NUL) { if (*pzArg == '*') { optionResetEverything(pOpts); reset_active = AG_FALSE; return; } succ = shortOptionFind(pOpts, (tAoUC)*pzArg, &opt_state); if (! SUCCESSFUL(succ)) { fprintf(stderr, zIllOptChr, pOpts->pzProgPath, *pzArg); pOpts->pUsageProc(pOpts, EXIT_FAILURE); /* NOTREACHED */ assert(0 == 1); } } else { succ = longOptionFind(pOpts, (char *)pzArg, &opt_state); if (! SUCCESSFUL(succ)) { fprintf(stderr, zIllOptStr, pOpts->pzProgPath, pzArg); pOpts->pUsageProc(pOpts, EXIT_FAILURE); /* NOTREACHED */ assert(0 == 1); } } /* * We've found the indicated option. Turn off all non-persistent * flags because we're forcing the option back to its initialized state. * Call any callout procedure to handle whatever it needs to. * Finally, clear the reset flag, too. */ optionReset(pOpts, opt_state.pOD); reset_active = AG_FALSE; } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/reset.c */ ntp-4.2.6p5/sntp/libopts/enumeration.c0000644000175000017500000003544111564122255016755 0ustar peterpeter /** * \file enumeration.c * * Time-stamp: "2011-04-06 10:48:22 bkorb" * * Automated Options Paged Usage module. * * This routine will run run-on options through a pager so the * user may examine, print or edit them at their leisure. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ static char const * pz_enum_err_fmt; /* = = = START-STATIC-FORWARD = = = */ static void enum_err(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, int name_ct); static uintptr_t find_name(char const * pzName, tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, unsigned int name_ct); static void set_memb_usage(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, unsigned int name_ct); static void set_memb_shell(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, unsigned int name_ct); static void set_memb_names(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, unsigned int name_ct); /* = = = END-STATIC-FORWARD = = = */ static void enum_err(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, int name_ct) { size_t max_len = 0; size_t ttl_len = 0; int ct_down = name_ct; int hidden = 0; /* * A real "pOpts" pointer means someone messed up. Give a real error. */ if (pOpts > OPTPROC_EMIT_LIMIT) fprintf(option_usage_fp, pz_enum_err_fmt, pOpts->pzProgName, pOD->optArg.argString, pOD->pz_Name); fprintf(option_usage_fp, zValidKeys, pOD->pz_Name); /* * If the first name starts with this funny character, then we have * a first value with an unspellable name. You cannot specify it. * So, we don't list it either. */ if (**paz_names == 0x7F) { paz_names++; hidden = 1; ct_down = --name_ct; } /* * Figure out the maximum length of any name, plus the total length * of all the names. */ { char const * const * paz = paz_names; do { size_t len = strlen(*(paz++)) + 1; if (len > max_len) max_len = len; ttl_len += len; } while (--ct_down > 0); ct_down = name_ct; } /* * IF any one entry is about 1/2 line or longer, print one per line */ if (max_len > 35) { do { fprintf(option_usage_fp, " %s\n", *(paz_names++)); } while (--ct_down > 0); } /* * ELSE IF they all fit on one line, then do so. */ else if (ttl_len < 76) { fputc(' ', option_usage_fp); do { fputc(' ', option_usage_fp); fputs(*(paz_names++), option_usage_fp); } while (--ct_down > 0); fputc('\n', option_usage_fp); } /* * Otherwise, columnize the output */ else { int ent_no = 0; char zFmt[16]; /* format for all-but-last entries on a line */ sprintf(zFmt, "%%-%ds", (int)max_len); max_len = 78 / max_len; /* max_len is now max entries on a line */ fputs(" ", option_usage_fp); /* * Loop through all but the last entry */ ct_down = name_ct; while (--ct_down > 0) { if (++ent_no == max_len) { /* * Last entry on a line. Start next line, too. */ fprintf(option_usage_fp, "%s\n ", *(paz_names++)); ent_no = 0; } else fprintf(option_usage_fp, zFmt, *(paz_names++) ); } fprintf(option_usage_fp, "%s\n", *paz_names); } if (pOpts > OPTPROC_EMIT_LIMIT) { fprintf(option_usage_fp, zIntRange, hidden, name_ct - 1 + hidden); (*(pOpts->pUsageProc))(pOpts, EXIT_FAILURE); /* NOTREACHED */ } if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_MEMBERSHIP) { fprintf(option_usage_fp, zLowerBits, name_ct); fputs(zSetMemberSettings, option_usage_fp); } else { fprintf(option_usage_fp, zIntRange, hidden, name_ct - 1 + hidden); } } static uintptr_t find_name(char const * pzName, tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, unsigned int name_ct) { /* * Return the matching index as a pointer sized integer. * The result gets stashed in a char* pointer. */ uintptr_t res = name_ct; size_t len = strlen((char*)pzName); uintptr_t idx; if (IS_DEC_DIGIT_CHAR(*pzName)) { char * pz = (char *)(void *)pzName; unsigned long val = strtoul(pz, &pz, 0); if ((*pz == NUL) && (val < name_ct)) return (uintptr_t)val; enum_err(pOpts, pOD, paz_names, (int)name_ct); return name_ct; } /* * Look for an exact match, but remember any partial matches. * Multiple partial matches means we have an ambiguous match. */ for (idx = 0; idx < name_ct; idx++) { if (strncmp((char*)paz_names[idx], (char*)pzName, len) == 0) { if (paz_names[idx][len] == NUL) return idx; /* full match */ res = (res != name_ct) ? ~0 : idx; /* save partial match */ } } if (res < name_ct) return res; /* partial match */ pz_enum_err_fmt = (res == name_ct) ? zNoKey : zAmbigKey; option_usage_fp = stderr; enum_err(pOpts, pOD, paz_names, (int)name_ct); return name_ct; } /*=export_func optionKeywordName * what: Convert between enumeration values and strings * private: * * arg: tOptDesc*, pOD, enumeration option description * arg: unsigned int, enum_val, the enumeration value to map * * ret_type: char const * * ret_desc: the enumeration name from const memory * * doc: This converts an enumeration value into the matching string. =*/ char const * optionKeywordName(tOptDesc * pOD, unsigned int enum_val) { tOptDesc od; od.optArg.argEnum = enum_val; (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, &od ); return od.optArg.argString; } /*=export_func optionEnumerationVal * what: Convert from a string to an enumeration value * private: * * arg: tOptions*, pOpts, the program options descriptor * arg: tOptDesc*, pOD, enumeration option description * arg: char const * const *, paz_names, list of enumeration names * arg: unsigned int, name_ct, number of names in list * * ret_type: uintptr_t * ret_desc: the enumeration value * * doc: This converts the optArg.argString string from the option description * into the index corresponding to an entry in the name list. * This will match the generated enumeration value. * Full matches are always accepted. Partial matches are accepted * if there is only one partial match. =*/ uintptr_t optionEnumerationVal(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, unsigned int name_ct) { uintptr_t res = 0UL; /* * IF the program option descriptor pointer is invalid, * then it is some sort of special request. */ switch ((uintptr_t)pOpts) { case (uintptr_t)OPTPROC_EMIT_USAGE: /* * print the list of enumeration names. */ enum_err(pOpts, pOD, paz_names, (int)name_ct); break; case (uintptr_t)OPTPROC_EMIT_SHELL: { unsigned int ix = pOD->optArg.argEnum; /* * print the name string. */ if (ix >= name_ct) printf("INVALID-%d", ix); else fputs(paz_names[ ix ], stdout); break; } case (uintptr_t)OPTPROC_RETURN_VALNAME: { tSCC zInval[] = "*INVALID*"; unsigned int ix = pOD->optArg.argEnum; /* * Replace the enumeration value with the name string. */ if (ix >= name_ct) return (uintptr_t)zInval; pOD->optArg.argString = paz_names[ix]; break; } default: res = find_name(pOD->optArg.argString, pOpts, pOD, paz_names, name_ct); if (pOD->fOptState & OPTST_ALLOC_ARG) { AGFREE(pOD->optArg.argString); pOD->fOptState &= ~OPTST_ALLOC_ARG; pOD->optArg.argString = NULL; } } return res; } static void set_memb_usage(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, unsigned int name_ct) { /* * print the list of enumeration names. */ enum_err(OPTPROC_EMIT_USAGE, pOD, paz_names, (int)name_ct ); } static void set_memb_shell(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, unsigned int name_ct) { /* * print the name string. */ int ix = 0; uintptr_t bits = (uintptr_t)pOD->optCookie; size_t len = 0; bits &= ((uintptr_t)1 << (uintptr_t)name_ct) - (uintptr_t)1; while (bits != 0) { if (bits & 1) { if (len++ > 0) fputs(" | ", stdout); fputs(paz_names[ix], stdout); } if (++ix >= name_ct) break; bits >>= 1; } } static void set_memb_names(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, unsigned int name_ct) { static char const none[] = "none"; static char const plus[3] = " + "; char * pz; uintptr_t bits = (uintptr_t)pOD->optCookie; int ix = 0; size_t len = sizeof(none); bits &= ((uintptr_t)1 << (uintptr_t)name_ct) - (uintptr_t)1; /* * Replace the enumeration value with the name string. * First, determine the needed length, then allocate and fill in. */ while (bits != 0) { if (bits & 1) len += strlen(paz_names[ix]) + sizeof(plus); if (++ix >= name_ct) break; bits >>= 1; } pOD->optArg.argString = pz = AGALOC(len, "enum name"); /* * Start by clearing all the bits. We want to turn off any defaults * because we will be restoring to current state, not adding to * the default set of bits. */ memcpy(pz, none, sizeof(none)-1); pz += sizeof(none)-1; bits = (uintptr_t)pOD->optCookie; bits &= ((uintptr_t)1 << (uintptr_t)name_ct) - (uintptr_t)1; ix = 0; while (bits != 0) { if (bits & 1) { size_t nln = strlen(paz_names[ix]); memcpy(pz, plus, sizeof(plus)); memcpy(pz+sizeof(plus), paz_names[ix], nln); pz += strlen(paz_names[ix]) + 3; } if (++ix >= name_ct) break; bits >>= 1; } *pz = NUL; } /*=export_func optionSetMembers * what: Convert between bit flag values and strings * private: * * arg: tOptions*, pOpts, the program options descriptor * arg: tOptDesc*, pOD, enumeration option description * arg: char const * const *, * paz_names, list of enumeration names * arg: unsigned int, name_ct, number of names in list * * doc: This converts the optArg.argString string from the option description * into the index corresponding to an entry in the name list. * This will match the generated enumeration value. * Full matches are always accepted. Partial matches are accepted * if there is only one partial match. =*/ void optionSetMembers(tOptions * pOpts, tOptDesc * pOD, char const* const * paz_names, unsigned int name_ct) { /* * IF the program option descriptor pointer is invalid, * then it is some sort of special request. */ switch ((uintptr_t)pOpts) { case (uintptr_t)OPTPROC_EMIT_USAGE: set_memb_usage(pOpts, pOD, paz_names, name_ct); return; case (uintptr_t)OPTPROC_EMIT_SHELL: set_memb_shell(pOpts, pOD, paz_names, name_ct); return; case (uintptr_t)OPTPROC_RETURN_VALNAME: set_memb_names(pOpts, pOD, paz_names, name_ct); return; default: break; } if ((pOD->fOptState & OPTST_RESET) != 0) return; { char const* pzArg = pOD->optArg.argString; uintptr_t res; if ((pzArg == NULL) || (*pzArg == NUL)) { pOD->optCookie = (void*)0; return; } res = (uintptr_t)pOD->optCookie; for (;;) { tSCC zSpn[] = " ,|+\t\r\f\n"; int iv, len; pzArg += strspn(pzArg, zSpn); iv = (*pzArg == '!'); if (iv) pzArg += strspn(pzArg+1, zSpn) + 1; len = strcspn(pzArg, zSpn); if (len == 0) break; if ((len == 3) && (strncmp(pzArg, zAll, 3) == 0)) { if (iv) res = 0; else res = ~0UL; } else if ((len == 4) && (strncmp(pzArg, zNone, 4) == 0)) { if (! iv) res = 0; } else do { char* pz; uintptr_t bit = strtoul(pzArg, &pz, 0); if (pz != pzArg + len) { char z[ AO_NAME_SIZE ]; char const* p; int shift_ct; if (*pz != NUL) { if (len >= AO_NAME_LIMIT) break; memcpy(z, pzArg, (size_t)len); z[len] = NUL; p = z; } else { p = pzArg; } shift_ct = find_name(p, pOpts, pOD, paz_names, name_ct); if (shift_ct >= name_ct) { pOD->optCookie = (void*)0; return; } bit = 1UL << shift_ct; } if (iv) res &= ~bit; else res |= bit; } while (0); if (pzArg[len] == NUL) break; pzArg += len + 1; } if (name_ct < (8 * sizeof(uintptr_t))) { res &= (1UL << name_ct) - 1UL; } pOD->optCookie = (void*)res; } } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/enumeration.c */ ntp-4.2.6p5/sntp/libopts/makeshell.c0000644000175000017500000007312311564122254016372 0ustar peterpeter /** * \file makeshell.c * * Time-stamp: "2011-04-20 11:06:57 bkorb" * * This module will interpret the options set in the tOptions * structure and create a Bourne shell script capable of parsing them. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ tOptions * optionParseShellOptions = NULL; /* * * * * * * * * * * * * * * * * * * * * * * Setup Format Strings */ static char const zStartMarker[] = "# # # # # # # # # # -- do not modify this marker --\n#\n" "# DO NOT EDIT THIS SECTION"; static char const zPreamble[] = "%s OF %s\n#\n" "# From here to the next `-- do not modify this marker --',\n" "# the text has been generated %s\n"; static char const zEndPreamble[] = "# From the %s option definitions\n#\n"; static char const zMultiDef[] = "\n" "if test -z \"${%1$s_%2$s}\"\n" "then\n" " %1$s_%2$s_CT=0\n" "else\n" " %1$s_%2$s_CT=1\n" " %1$s_%2$s_1=\"${%1$s_%2$s}\"\n" "fi\n" "export %1$s_%2$s_CT"; static char const zSingleDef[] = "\n" "%1$s_%2$s=\"${%1$s_%2$s-'%3$s'}\"\n" "%1$s_%2$s_set=false\n" "export %1$s_%2$s\n"; static char const zSingleNoDef[] = "\n" "%1$s_%2$s=\"${%1$s_%2$s}\"\n" "%1$s_%2$s_set=false\n" "export %1$s_%2$s\n"; /* * * * * * * * * * * * * * * * * * * * * * * LOOP START * * The loop may run in either of two modes: * all options are named options (loop only) * regular, marked option processing. */ static char const zLoopCase[] = "\n" "OPT_PROCESS=true\n" "OPT_ARG=\"$1\"\n\n" "while ${OPT_PROCESS} && [ $# -gt 0 ]\ndo\n" " OPT_ELEMENT=''\n" " OPT_ARG_VAL=''\n\n" /* * 'OPT_ARG' may or may not match the current $1 */ " case \"${OPT_ARG}\" in\n" " -- )\n" " OPT_PROCESS=false\n" " shift\n" " ;;\n\n"; static char const zLoopOnly[] = "\n" "OPT_ARG=\"$1\"\n\n" "while [ $# -gt 0 ]\ndo\n" " OPT_ELEMENT=''\n" " OPT_ARG_VAL=''\n\n" " OPT_ARG=\"${1}\"\n"; /* * * * * * * * * * * * * * * * * * CASE SELECTORS * * If the loop runs as a regular option loop, * then we must have selectors for each acceptable option * type (long option, flag character and non-option) */ static char const zLongSelection[] = " --* )\n"; static char const zFlagSelection[] = " -* )\n"; static char const zEndSelection[] = " ;;\n\n"; static char const zNoSelection[] = " * )\n" " OPT_PROCESS=false\n" " ;;\n" " esac\n\n"; /* * * * * * * * * * * * * * * * * * LOOP END */ static char const zLoopEnd[] = " if [ -n \"${OPT_ARG_VAL}\" ]\n" " then\n" " eval %1$s_${OPT_NAME}${OPT_ELEMENT}=\"'${OPT_ARG_VAL}'\"\n" " export %1$s_${OPT_NAME}${OPT_ELEMENT}\n" " fi\n" "done\n\n" "unset OPT_PROCESS || :\n" "unset OPT_ELEMENT || :\n" "unset OPT_ARG || :\n" "unset OPT_ARG_NEEDED || :\n" "unset OPT_NAME || :\n" "unset OPT_CODE || :\n" "unset OPT_ARG_VAL || :\n%2$s"; static char const zTrailerMarker[] = "\n" "# # # # # # # # # #\n#\n" "# END OF AUTOMATED OPTION PROCESSING\n" "#\n# # # # # # # # # # -- do not modify this marker --\n"; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * OPTION SELECTION */ static char const zOptionCase[] = " case \"${OPT_CODE}\" in\n"; static char const zOptionPartName[] = " '%s' | \\\n"; static char const zOptionFullName[] = " '%s' )\n"; static char const zOptionFlag[] = " '%c' )\n"; static char const zOptionEndSelect[] = " ;;\n\n"; static char const zOptionUnknown[] = " * )\n" " echo Unknown %s: \"${OPT_CODE}\" >&2\n" " echo \"$%s_USAGE_TEXT\"\n" " exit 1\n" " ;;\n" " esac\n\n"; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * OPTION PROCESSING * * Formats for emitting the text for handling particular options */ static char const zTextExit[] = " echo \"$%s_%s_TEXT\"\n" " exit 0\n"; static char const zPagedUsageExit[] = " echo \"$%s_LONGUSAGE_TEXT\" | ${PAGER-more}\n" " exit 0\n"; static char const zCmdFmt[] = " %s\n"; static char const zCountTest[] = " if [ $%1$s_%2$s_CT -ge %3$d ] ; then\n" " echo Error: more than %3$d %2$s options >&2\n" " echo \"$%1$s_USAGE_TEXT\"\n" " exit 1 ; fi\n"; static char const zMultiArg[] = " %1$s_%2$s_CT=`expr ${%1$s_%2$s_CT} + 1`\n" " OPT_ELEMENT=\"_${%1$s_%2$s_CT}\"\n" " OPT_NAME='%2$s'\n"; static char const zSingleArg[] = " if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n" " echo Error: duplicate %2$s option >&2\n" " echo \"$%1$s_USAGE_TEXT\"\n" " exit 1 ; fi\n" " %1$s_%2$s_set=true\n" " OPT_NAME='%2$s'\n"; static char const zNoMultiArg[] = " %1$s_%2$s_CT=0\n" " OPT_ELEMENT=''\n" " %1$s_%2$s='%3$s'\n" " export %1$s_%2$s\n" " OPT_NAME='%2$s'\n"; static char const zNoSingleArg[] = " if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n" " echo Error: duplicate %2$s option >&2\n" " echo \"$%1$s_USAGE_TEXT\"\n" " exit 1 ; fi\n" " %1$s_%2$s_set=true\n" " %1$s_%2$s='%3$s'\n" " export %1$s_%2$s\n" " OPT_NAME='%2$s'\n"; static char const zMayArg[] = " eval %1$s_%2$s${OPT_ELEMENT}=true\n" " export %1$s_%2$s${OPT_ELEMENT}\n" " OPT_ARG_NEEDED=OK\n"; static char const zMustArg[] = " OPT_ARG_NEEDED=YES\n"; static char const zCantArg[] = " eval %1$s_%2$s${OPT_ELEMENT}=true\n" " export %1$s_%2$s${OPT_ELEMENT}\n" " OPT_ARG_NEEDED=NO\n"; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * LONG OPTION PROCESSING * * Formats for emitting the text for handling long option types */ static char const zLongOptInit[] = " OPT_CODE=`echo \"X${OPT_ARG}\"|sed 's/^X-*//'`\n" " shift\n" " OPT_ARG=\"$1\"\n\n" " case \"${OPT_CODE}\" in *=* )\n" " OPT_ARG_VAL=`echo \"${OPT_CODE}\"|sed 's/^[^=]*=//'`\n" " OPT_CODE=`echo \"${OPT_CODE}\"|sed 's/=.*$//'` ;; esac\n\n"; static char const zLongOptArg[] = " case \"${OPT_ARG_NEEDED}\" in\n" " NO )\n" " OPT_ARG_VAL=''\n" " ;;\n\n" " YES )\n" " if [ -z \"${OPT_ARG_VAL}\" ]\n" " then\n" " if [ $# -eq 0 ]\n" " then\n" " echo No argument provided for ${OPT_NAME} option >&2\n" " echo \"$%s_USAGE_TEXT\"\n" " exit 1\n" " fi\n\n" " OPT_ARG_VAL=\"${OPT_ARG}\"\n" " shift\n" " OPT_ARG=\"$1\"\n" " fi\n" " ;;\n\n" " OK )\n" " if [ -z \"${OPT_ARG_VAL}\" ] && [ $# -gt 0 ]\n" " then\n" " case \"${OPT_ARG}\" in -* ) ;; * )\n" " OPT_ARG_VAL=\"${OPT_ARG}\"\n" " shift\n" " OPT_ARG=\"$1\" ;; esac\n" " fi\n" " ;;\n" " esac\n"; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * FLAG OPTION PROCESSING * * Formats for emitting the text for handling flag option types */ static char const zFlagOptInit[] = " OPT_CODE=`echo \"X${OPT_ARG}\" | sed 's/X-\\(.\\).*/\\1/'`\n" " OPT_ARG=` echo \"X${OPT_ARG}\" | sed 's/X-.//'`\n\n"; static char const zFlagOptArg[] = " case \"${OPT_ARG_NEEDED}\" in\n" " NO )\n" " if [ -n \"${OPT_ARG}\" ]\n" " then\n" " OPT_ARG=-\"${OPT_ARG}\"\n" " else\n" " shift\n" " OPT_ARG=\"$1\"\n" " fi\n" " ;;\n\n" " YES )\n" " if [ -n \"${OPT_ARG}\" ]\n" " then\n" " OPT_ARG_VAL=\"${OPT_ARG}\"\n\n" " else\n" " if [ $# -eq 0 ]\n" " then\n" " echo No argument provided for ${OPT_NAME} option >&2\n" " echo \"$%s_USAGE_TEXT\"\n" " exit 1\n" " fi\n" " shift\n" " OPT_ARG_VAL=\"$1\"\n" " fi\n\n" " shift\n" " OPT_ARG=\"$1\"\n" " ;;\n\n" " OK )\n" " if [ -n \"${OPT_ARG}\" ]\n" " then\n" " OPT_ARG_VAL=\"${OPT_ARG}\"\n" " shift\n" " OPT_ARG=\"$1\"\n\n" " else\n" " shift\n" " if [ $# -gt 0 ]\n" " then\n" " case \"$1\" in -* ) ;; * )\n" " OPT_ARG_VAL=\"$1\"\n" " shift ;; esac\n" " OPT_ARG=\"$1\"\n" " fi\n" " fi\n" " ;;\n" " esac\n"; tSCC* pzShell = NULL; static char* pzLeader = NULL; static char* pzTrailer = NULL; /* = = = START-STATIC-FORWARD = = = */ static void emit_var_text(char const * prog, char const * var, int fdin); static void textToVariable(tOptions * pOpts, teTextTo whichVar, tOptDesc * pOD); static void emitUsage(tOptions* pOpts); static void emitSetup(tOptions* pOpts); static void printOptionAction(tOptions* pOpts, tOptDesc* pOptDesc); static void printOptionInaction(tOptions* pOpts, tOptDesc* pOptDesc); static void emitFlag(tOptions* pOpts); static void emitMatchExpr(tCC* pzMatchName, tOptDesc* pCurOpt, tOptions* pOpts); static void emitLong(tOptions* pOpts); static void openOutput(char const* pzFile); /* = = = END-STATIC-FORWARD = = = */ /*=export_func optionParseShell * private: * * what: Decipher a boolean value * arg: + tOptions* + pOpts + program options descriptor + * * doc: * Emit a shell script that will parse the command line options. =*/ void optionParseShell(tOptions* pOpts) { /* * Check for our SHELL option now. * IF the output file contains the "#!" magic marker, * it will override anything we do here. */ if (HAVE_GENSHELL_OPT(SHELL)) pzShell = GENSHELL_OPT_ARG(SHELL); else if (! ENABLED_GENSHELL_OPT(SHELL)) pzShell = NULL; else if ((pzShell = getenv("SHELL")), pzShell == NULL) pzShell = POSIX_SHELL; /* * Check for a specified output file */ if (HAVE_GENSHELL_OPT(SCRIPT)) openOutput(GENSHELL_OPT_ARG(SCRIPT)); emitUsage(pOpts); emitSetup(pOpts); /* * There are four modes of option processing. */ switch (pOpts->fOptSet & (OPTPROC_LONGOPT|OPTPROC_SHORTOPT)) { case OPTPROC_LONGOPT: fputs(zLoopCase, stdout); fputs(zLongSelection, stdout); fputs(zLongOptInit, stdout); emitLong(pOpts); printf(zLongOptArg, pOpts->pzPROGNAME); fputs(zEndSelection, stdout); fputs(zNoSelection, stdout); break; case 0: fputs(zLoopOnly, stdout); fputs(zLongOptInit, stdout); emitLong(pOpts); printf(zLongOptArg, pOpts->pzPROGNAME); break; case OPTPROC_SHORTOPT: fputs(zLoopCase, stdout); fputs(zFlagSelection, stdout); fputs(zFlagOptInit, stdout); emitFlag(pOpts); printf(zFlagOptArg, pOpts->pzPROGNAME); fputs(zEndSelection, stdout); fputs(zNoSelection, stdout); break; case OPTPROC_LONGOPT|OPTPROC_SHORTOPT: fputs(zLoopCase, stdout); fputs(zLongSelection, stdout); fputs(zLongOptInit, stdout); emitLong(pOpts); printf(zLongOptArg, pOpts->pzPROGNAME); fputs(zEndSelection, stdout); fputs(zFlagSelection, stdout); fputs(zFlagOptInit, stdout); emitFlag(pOpts); printf(zFlagOptArg, pOpts->pzPROGNAME); fputs(zEndSelection, stdout); fputs(zNoSelection, stdout); break; } printf(zLoopEnd, pOpts->pzPROGNAME, zTrailerMarker); if ((pzTrailer != NULL) && (*pzTrailer != '\0')) fputs(pzTrailer, stdout); else if (ENABLED_GENSHELL_OPT(SHELL)) printf("\nenv | grep '^%s_'\n", pOpts->pzPROGNAME); fflush(stdout); fchmod(STDOUT_FILENO, 0755); fclose(stdout); if (ferror(stdout)) { fputs(zOutputFail, stderr); exit(EXIT_FAILURE); } } #ifdef HAVE_WORKING_FORK static void emit_var_text(char const * prog, char const * var, int fdin) { FILE * fp = fdopen(fdin, "r" FOPEN_BINARY_FLAG); int nlct = 0; /* defer newlines and skip trailing ones */ printf("%s_%s_TEXT='", prog, var); if (fp == NULL) goto skip_text; for (;;) { int ch = fgetc(fp); switch (ch) { case '\n': nlct++; break; case '\'': while (nlct > 0) { fputc('\n', stdout); nlct--; } fputs("'\\''", stdout); break; case EOF: goto endCharLoop; default: while (nlct > 0) { fputc('\n', stdout); nlct--; } fputc(ch, stdout); break; } } endCharLoop:; fclose(fp); skip_text: fputs("'\n\n", stdout); } #endif /* * The purpose of this function is to assign "long usage", short usage * and version information to a shell variable. Rather than wind our * way through all the logic necessary to emit the text directly, we * fork(), have our child process emit the text the normal way and * capture the output in the parent process. */ static void textToVariable(tOptions * pOpts, teTextTo whichVar, tOptDesc * pOD) { # define _TT_(n) static char const z ## n [] = #n; TEXTTO_TABLE # undef _TT_ # define _TT_(n) z ## n , static char const * apzTTNames[] = { TEXTTO_TABLE }; # undef _TT_ #if ! defined(HAVE_WORKING_FORK) printf("%1$s_%2$s_TEXT='no %2$s text'\n", pOpts->pzPROGNAME, apzTTNames[ whichVar ]); #else int pipeFd[2]; fflush(stdout); fflush(stderr); if (pipe(pipeFd) != 0) { fprintf(stderr, zBadPipe, errno, strerror(errno)); exit(EXIT_FAILURE); } switch (fork()) { case -1: fprintf(stderr, zForkFail, errno, strerror(errno), pOpts->pzProgName); exit(EXIT_FAILURE); break; case 0: /* * Send both stderr and stdout to the pipe. No matter which * descriptor is used, we capture the output on the read end. */ dup2(pipeFd[1], STDERR_FILENO); dup2(pipeFd[1], STDOUT_FILENO); close(pipeFd[0]); switch (whichVar) { case TT_LONGUSAGE: (*(pOpts->pUsageProc))(pOpts, EXIT_SUCCESS); /* NOTREACHED */ case TT_USAGE: (*(pOpts->pUsageProc))(pOpts, EXIT_FAILURE); /* NOTREACHED */ case TT_VERSION: if (pOD->fOptState & OPTST_ALLOC_ARG) { AGFREE(pOD->optArg.argString); pOD->fOptState &= ~OPTST_ALLOC_ARG; } pOD->optArg.argString = "c"; optionPrintVersion(pOpts, pOD); /* NOTREACHED */ default: exit(EXIT_FAILURE); } default: close(pipeFd[1]); } emit_var_text(pOpts->pzPROGNAME, apzTTNames[whichVar], pipeFd[0]); #endif } static void emitUsage(tOptions* pOpts) { char zTimeBuf[AO_NAME_SIZE]; /* * First, switch stdout to the output file name. * Then, change the program name to the one defined * by the definitions (rather than the current * executable name). Down case the upper cased name. */ if (pzLeader != NULL) fputs(pzLeader, stdout); { tSCC zStdout[] = "stdout"; tCC* pzOutName; { time_t curTime = time(NULL); struct tm* pTime = localtime(&curTime); strftime(zTimeBuf, AO_NAME_SIZE, "%A %B %e, %Y at %r %Z", pTime ); } if (HAVE_GENSHELL_OPT(SCRIPT)) pzOutName = GENSHELL_OPT_ARG(SCRIPT); else pzOutName = zStdout; if ((pzLeader == NULL) && (pzShell != NULL)) printf("#! %s\n", pzShell); printf(zPreamble, zStartMarker, pzOutName, zTimeBuf); } printf(zEndPreamble, pOpts->pzPROGNAME); /* * Get a copy of the original program name in lower case and * fill in an approximation of the program name from it. */ { char * pzPN = zTimeBuf; char const * pz = pOpts->pzPROGNAME; char ** pp; for (;;) { if ((*pzPN++ = tolower(*pz++)) == '\0') break; } pp = (char **)(void *)&(pOpts->pzProgPath); *pp = zTimeBuf; pp = (char **)(void *)&(pOpts->pzProgName); *pp = zTimeBuf; } textToVariable(pOpts, TT_LONGUSAGE, NULL); textToVariable(pOpts, TT_USAGE, NULL); { tOptDesc* pOptDesc = pOpts->pOptDesc; int optionCt = pOpts->optCt; for (;;) { if (pOptDesc->pOptProc == optionPrintVersion) { textToVariable(pOpts, TT_VERSION, pOptDesc); break; } if (--optionCt <= 0) break; pOptDesc++; } } } static void emitSetup(tOptions* pOpts) { tOptDesc* pOptDesc = pOpts->pOptDesc; int optionCt = pOpts->presetOptCt; char const* pzFmt; char const* pzDefault; for (;optionCt > 0; pOptDesc++, --optionCt) { char zVal[16]; /* * Options that are either usage documentation or are compiled out * are not to be processed. */ if (SKIP_OPT(pOptDesc) || (pOptDesc->pz_NAME == NULL)) continue; if (pOptDesc->optMaxCt > 1) pzFmt = zMultiDef; else pzFmt = zSingleDef; /* * IF this is an enumeration/bitmask option, then convert the value * to a string before printing the default value. */ switch (OPTST_GET_ARGTYPE(pOptDesc->fOptState)) { case OPARG_TYPE_ENUMERATION: (*(pOptDesc->pOptProc))(OPTPROC_EMIT_SHELL, pOptDesc ); pzDefault = pOptDesc->optArg.argString; break; /* * Numeric and membership bit options are just printed as a number. */ case OPARG_TYPE_NUMERIC: snprintf(zVal, sizeof(zVal), "%d", (int)pOptDesc->optArg.argInt); pzDefault = zVal; break; case OPARG_TYPE_MEMBERSHIP: snprintf(zVal, sizeof(zVal), "%lu", (unsigned long)pOptDesc->optArg.argIntptr); pzDefault = zVal; break; case OPARG_TYPE_BOOLEAN: pzDefault = (pOptDesc->optArg.argBool) ? "true" : "false"; break; default: if (pOptDesc->optArg.argString == NULL) { if (pzFmt == zSingleDef) pzFmt = zSingleNoDef; pzDefault = NULL; } else pzDefault = pOptDesc->optArg.argString; } printf(pzFmt, pOpts->pzPROGNAME, pOptDesc->pz_NAME, pzDefault); } } static void printOptionAction(tOptions* pOpts, tOptDesc* pOptDesc) { if (pOptDesc->pOptProc == optionPrintVersion) printf(zTextExit, pOpts->pzPROGNAME, "VERSION"); else if (pOptDesc->pOptProc == optionPagedUsage) printf(zPagedUsageExit, pOpts->pzPROGNAME); else if (pOptDesc->pOptProc == optionLoadOpt) { printf(zCmdFmt, "echo 'Warning: Cannot load options files' >&2"); printf(zCmdFmt, "OPT_ARG_NEEDED=YES"); } else if (pOptDesc->pz_NAME == NULL) { if (pOptDesc->pOptProc == NULL) { printf(zCmdFmt, "echo 'Warning: Cannot save options files' " ">&2"); printf(zCmdFmt, "OPT_ARG_NEEDED=OK"); } else printf(zTextExit, pOpts->pzPROGNAME, "LONGUSAGE"); } else { if (pOptDesc->optMaxCt == 1) printf(zSingleArg, pOpts->pzPROGNAME, pOptDesc->pz_NAME); else { if ((unsigned)pOptDesc->optMaxCt < NOLIMIT) printf(zCountTest, pOpts->pzPROGNAME, pOptDesc->pz_NAME, pOptDesc->optMaxCt); printf(zMultiArg, pOpts->pzPROGNAME, pOptDesc->pz_NAME); } /* * Fix up the args. */ if (OPTST_GET_ARGTYPE(pOptDesc->fOptState) == OPARG_TYPE_NONE) { printf(zCantArg, pOpts->pzPROGNAME, pOptDesc->pz_NAME); } else if (pOptDesc->fOptState & OPTST_ARG_OPTIONAL) { printf(zMayArg, pOpts->pzPROGNAME, pOptDesc->pz_NAME); } else { fputs(zMustArg, stdout); } } fputs(zOptionEndSelect, stdout); } static void printOptionInaction(tOptions* pOpts, tOptDesc* pOptDesc) { if (pOptDesc->pOptProc == optionLoadOpt) { printf(zCmdFmt, "echo 'Warning: Cannot suppress the loading of " "options files' >&2"); } else if (pOptDesc->optMaxCt == 1) printf(zNoSingleArg, pOpts->pzPROGNAME, pOptDesc->pz_NAME, pOptDesc->pz_DisablePfx); else printf(zNoMultiArg, pOpts->pzPROGNAME, pOptDesc->pz_NAME, pOptDesc->pz_DisablePfx); printf(zCmdFmt, "OPT_ARG_NEEDED=NO"); fputs(zOptionEndSelect, stdout); } static void emitFlag(tOptions* pOpts) { tOptDesc* pOptDesc = pOpts->pOptDesc; int optionCt = pOpts->optCt; fputs(zOptionCase, stdout); for (;optionCt > 0; pOptDesc++, --optionCt) { if (SKIP_OPT(pOptDesc)) continue; if (IS_GRAPHIC_CHAR(pOptDesc->optValue)) { printf(zOptionFlag, pOptDesc->optValue); printOptionAction(pOpts, pOptDesc); } } printf(zOptionUnknown, "flag", pOpts->pzPROGNAME); } /* * Emit the match text for a long option */ static void emitMatchExpr(tCC* pzMatchName, tOptDesc* pCurOpt, tOptions* pOpts) { tOptDesc* pOD = pOpts->pOptDesc; int oCt = pOpts->optCt; int min = 1; char zName[ 256 ]; char* pz = zName; for (;;) { int matchCt = 0; /* * Omit the current option, Documentation opts and compiled out opts. */ if ((pOD == pCurOpt) || SKIP_OPT(pOD)){ if (--oCt <= 0) break; pOD++; continue; } /* * Check each character of the name case insensitively. * They must not be the same. They cannot be, because it would * not compile correctly if they were. */ while ( toupper(pOD->pz_Name[matchCt]) == toupper(pzMatchName[matchCt])) matchCt++; if (matchCt > min) min = matchCt; /* * Check the disablement name, too. */ if (pOD->pz_DisableName != NULL) { matchCt = 0; while ( toupper(pOD->pz_DisableName[matchCt]) == toupper(pzMatchName[matchCt])) matchCt++; if (matchCt > min) min = matchCt; } if (--oCt <= 0) break; pOD++; } /* * IF the 'min' is all or one short of the name length, * THEN the entire string must be matched. */ if ( (pzMatchName[min ] == NUL) || (pzMatchName[min+1] == NUL) ) printf(zOptionFullName, pzMatchName); else { int matchCt = 0; for (; matchCt <= min; matchCt++) *pz++ = pzMatchName[matchCt]; for (;;) { *pz = NUL; printf(zOptionPartName, zName); *pz++ = pzMatchName[matchCt++]; if (pzMatchName[matchCt] == NUL) { *pz = NUL; printf(zOptionFullName, zName); break; } } } } /* * Emit GNU-standard long option handling code */ static void emitLong(tOptions* pOpts) { tOptDesc* pOD = pOpts->pOptDesc; int ct = pOpts->optCt; fputs(zOptionCase, stdout); /* * do each option, ... */ do { /* * Documentation & compiled-out options */ if (SKIP_OPT(pOD)) continue; emitMatchExpr(pOD->pz_Name, pOD, pOpts); printOptionAction(pOpts, pOD); /* * Now, do the same thing for the disablement version of the option. */ if (pOD->pz_DisableName != NULL) { emitMatchExpr(pOD->pz_DisableName, pOD, pOpts); printOptionInaction(pOpts, pOD); } } while (pOD++, --ct > 0); printf(zOptionUnknown, "option", pOpts->pzPROGNAME); } static void openOutput(char const* pzFile) { FILE* fp; char* pzData = NULL; struct stat stbf; do { char* pzScan; size_t sizeLeft; /* * IF we cannot stat the file, * THEN assume we are creating a new file. * Skip the loading of the old data. */ if (stat(pzFile, &stbf) != 0) break; /* * The file must be a regular file */ if (! S_ISREG(stbf.st_mode)) { fprintf(stderr, zNotFile, pzFile); exit(EXIT_FAILURE); } pzData = AGALOC(stbf.st_size + 1, "file data"); fp = fopen(pzFile, "r" FOPEN_BINARY_FLAG); sizeLeft = (unsigned)stbf.st_size; pzScan = pzData; /* * Read in all the data as fast as our OS will let us. */ for (;;) { int inct = fread((void*)pzScan, (size_t)1, sizeLeft, fp); if (inct == 0) break; pzScan += inct; sizeLeft -= inct; if (sizeLeft == 0) break; } /* * NUL-terminate the leader and look for the trailer */ *pzScan = '\0'; fclose(fp); pzScan = strstr(pzData, zStartMarker); if (pzScan == NULL) { pzTrailer = pzData; break; } *(pzScan++) = NUL; pzScan = strstr(pzScan, zTrailerMarker); if (pzScan == NULL) { pzTrailer = pzData; break; } /* * Check to see if the data contains our marker. * If it does, then we will skip over it */ pzTrailer = pzScan + sizeof(zTrailerMarker) - 1; pzLeader = pzData; } while (AG_FALSE); if (freopen(pzFile, "w" FOPEN_BINARY_FLAG, stdout) != stdout) { fprintf(stderr, zFreopenFail, errno, strerror(errno)); exit(EXIT_FAILURE); } } /*=export_func genshelloptUsage * private: * what: The usage function for the genshellopt generated program * * arg: + tOptions* + pOpts + program options descriptor + * arg: + int + exitCode + usage text type to produce + * * doc: * This function is used to create the usage strings for the option * processing shell script code. Two child processes are spawned * each emitting the usage text in either the short (error exit) * style or the long style. The generated program will capture this * and create shell script variables containing the two types of text. =*/ void genshelloptUsage(tOptions * pOpts, int exitCode) { #if ! defined(HAVE_WORKING_FORK) optionUsage(pOpts, exitCode); #else /* * IF not EXIT_SUCCESS, * THEN emit the short form of usage. */ if (exitCode != EXIT_SUCCESS) optionUsage(pOpts, exitCode); fflush(stderr); fflush(stdout); if (ferror(stdout) || ferror(stderr)) exit(EXIT_FAILURE); option_usage_fp = stdout; /* * First, print our usage */ switch (fork()) { case -1: optionUsage(pOpts, EXIT_FAILURE); /* NOTREACHED */ case 0: pagerState = PAGER_STATE_CHILD; optionUsage(pOpts, EXIT_SUCCESS); /* NOTREACHED */ _exit(EXIT_FAILURE); default: { int sts; wait(&sts); } } /* * Generate the pzProgName, since optionProcess() normally * gets it from the command line */ { char * pz; char ** pp = (char **)(void *)&(optionParseShellOptions->pzProgName); AGDUPSTR(pz, optionParseShellOptions->pzPROGNAME, "program name"); *pp = pz; while (*pz != NUL) { *pz = tolower(*pz); pz++; } } /* * Separate the makeshell usage from the client usage */ fprintf(option_usage_fp, zGenshell, optionParseShellOptions->pzProgName); fflush(option_usage_fp); /* * Now, print the client usage. */ switch (fork()) { case 0: pagerState = PAGER_STATE_CHILD; /*FALLTHROUGH*/ case -1: optionUsage(optionParseShellOptions, EXIT_FAILURE); default: { int sts; wait(&sts); } } fflush(stdout); if (ferror(stdout)) { fputs(zOutputFail, stderr); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); #endif } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/makeshell.c */ ntp-4.2.6p5/sntp/libopts/proto.h0000644000175000017500000000402011564122253015562 0ustar peterpeter/* -*- buffer-read-only: t -*- vi: set ro: * * Prototypes for autoopts * Generated Fri Apr 29 15:44:06 PDT 2011 */ #ifndef AUTOOPTS_PROTO_H_GUARD #define AUTOOPTS_PROTO_H_GUARD 1 #ifndef LOCAL # define LOCAL extern # define REDEF_LOCAL 1 #else # undef REDEF_LOCAL #endif /* * Extracted from autoopts.c */ LOCAL void * ao_malloc(size_t sz); LOCAL void * ao_realloc(void *p, size_t sz); LOCAL char * ao_strdup(char const *str); LOCAL tSuccess handle_opt(tOptions* pOpts, tOptState* pOptState); LOCAL tSuccess longOptionFind(tOptions* pOpts, char* pzOptName, tOptState* pOptState); LOCAL tSuccess shortOptionFind(tOptions* pOpts, uint_t optValue, tOptState* pOptState); LOCAL tSuccess doImmediateOpts(tOptions* pOpts); LOCAL tSuccess doRegularOpts(tOptions* pOpts); /* * Extracted from configfile.c */ LOCAL void internalFileLoad(tOptions* pOpts); LOCAL char* parseAttributes( tOptions* pOpts, char* pzText, tOptionLoadMode* pMode, tOptionValue* pType ); LOCAL tSuccess validateOptionsStruct(tOptions* pOpts, char const* pzProgram); /* * Extracted from environment.c */ LOCAL void doPrognameEnv(tOptions* pOpts, teEnvPresetType type); LOCAL void doEnvPresets(tOptions* pOpts, teEnvPresetType type); /* * Extracted from load.c */ LOCAL void mungeString(char* pzTxt, tOptionLoadMode mode); LOCAL void loadOptionLine( tOptions* pOpts, tOptState* pOS, char* pzLine, tDirection direction, tOptionLoadMode load_mode ); /* * Extracted from nested.c */ LOCAL void unload_arg_list(tArgList* pAL); LOCAL tOptionValue* optionLoadNested(char const* pzTxt, char const* pzName, size_t nameLen); LOCAL int get_special_char(char const ** ppz, int * ct); LOCAL void emit_special_char(FILE * fp, int ch); /* * Extracted from sort.c */ LOCAL void optionSort(tOptions* pOpts); /* * Extracted from stack.c */ LOCAL void addArgListEntry(void** ppAL, void* entry); #ifdef REDEF_LOCAL # undef LOCAL # define LOCAL #endif #endif /* AUTOOPTS_PROTO_H_GUARD */ ntp-4.2.6p5/sntp/libopts/boolean.c0000644000175000017500000000466511564122255016052 0ustar peterpeter /** * \file boolean.c * * Time-stamp: "2010-07-10 11:02:10 bkorb" * * Automated Options Paged Usage module. * * This routine will run run-on options through a pager so the * user may examine, print or edit them at their leisure. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ /*=export_func optionBooleanVal * private: * * what: Decipher a boolean value * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * Decipher a true or false value for a boolean valued option argument. * The value is true, unless it starts with 'n' or 'f' or "#f" or * it is an empty string or it is a number that evaluates to zero. =*/ void optionBooleanVal( tOptions* pOpts, tOptDesc* pOD ) { char* pz; ag_bool res = AG_TRUE; if ((pOD->fOptState & OPTST_RESET) != 0) return; if (pOD->optArg.argString == NULL) { pOD->optArg.argBool = AG_FALSE; return; } switch (*(pOD->optArg.argString)) { case '0': { long val = strtol( pOD->optArg.argString, &pz, 0 ); if ((val != 0) || (*pz != NUL)) break; /* FALLTHROUGH */ } case 'N': case 'n': case 'F': case 'f': case NUL: res = AG_FALSE; break; case '#': if (pOD->optArg.argString[1] != 'f') break; res = AG_FALSE; } if (pOD->fOptState & OPTST_ALLOC_ARG) { AGFREE(pOD->optArg.argString); pOD->fOptState &= ~OPTST_ALLOC_ARG; } pOD->optArg.argBool = res; } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/boolean.c */ ntp-4.2.6p5/sntp/libopts/text_mmap.c0000644000175000017500000002567011564122254016427 0ustar peterpeter/** * \file text_mmap.c * * Time-stamp: "2010-07-17 10:15:32 bkorb" * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ #ifndef MAP_ANONYMOUS # ifdef MAP_ANON # define MAP_ANONYMOUS MAP_ANON # endif #endif /* * Some weird systems require that a specifically invalid FD number * get passed in as an argument value. Which value is that? Well, * as everybody knows, if open(2) fails, it returns -1, so that must * be the value. :) */ #define AO_INVALID_FD -1 #define FILE_WRITABLE(_prt,_flg) \ ( (_prt & PROT_WRITE) \ && ((_flg & (MAP_SHARED|MAP_PRIVATE)) == MAP_SHARED)) #define MAP_FAILED_PTR ((void*)MAP_FAILED) /*=export_func text_mmap * private: * * what: map a text file with terminating NUL * * arg: char const*, pzFile, name of the file to map * arg: int, prot, mmap protections (see mmap(2)) * arg: int, flags, mmap flags (see mmap(2)) * arg: tmap_info_t*, mapinfo, returned info about the mapping * * ret-type: void* * ret-desc: The mmaped data address * * doc: * * This routine will mmap a file into memory ensuring that there is at least * one @file{NUL} character following the file data. It will return the * address where the file contents have been mapped into memory. If there is a * problem, then it will return @code{MAP_FAILED} and set @file{errno} * appropriately. * * The named file does not exist, @code{stat(2)} will set @file{errno} as it * will. If the file is not a regular file, @file{errno} will be * @code{EINVAL}. At that point, @code{open(2)} is attempted with the access * bits set appropriately for the requested @code{mmap(2)} protections and flag * bits. On failure, @file{errno} will be set according to the documentation * for @code{open(2)}. If @code{mmap(2)} fails, @file{errno} will be set as * that routine sets it. If @code{text_mmap} works to this point, a valid * address will be returned, but there may still be ``issues''. * * If the file size is not an even multiple of the system page size, then * @code{text_map} will return at this point and @file{errno} will be zero. * Otherwise, an anonymous map is attempted. If not available, then an attempt * is made to @code{mmap(2)} @file{/dev/zero}. If any of these fail, the * address of the file's data is returned, bug @code{no} @file{NUL} characters * are mapped after the end of the data. * * see: mmap(2), open(2), stat(2) * * err: Any error code issued by mmap(2), open(2), stat(2) is possible. * Additionally, if the specified file is not a regular file, then * errno will be set to @code{EINVAL}. * * example: * #include * tmap_info_t mi; * int no_nul; * void* data = text_mmap("file", PROT_WRITE, MAP_PRIVATE, &mi); * if (data == MAP_FAILED) return; * no_nul = (mi.txt_size == mi.txt_full_size); * << use the data >> * text_munmap(&mi); =*/ void* text_mmap(char const* pzFile, int prot, int flags, tmap_info_t* pMI) { memset(pMI, 0, sizeof(*pMI)); #ifdef HAVE_MMAP pMI->txt_zero_fd = -1; #endif pMI->txt_fd = -1; /* * Make sure we can stat the regular file. Save the file size. */ { struct stat sb; if (stat(pzFile, &sb) != 0) { pMI->txt_errno = errno; return MAP_FAILED_PTR; } if (! S_ISREG(sb.st_mode)) { pMI->txt_errno = errno = EINVAL; return MAP_FAILED_PTR; } pMI->txt_size = sb.st_size; } /* * Map mmap flags and protections into open flags and do the open. */ { int o_flag; /* * See if we will be updating the file. If we can alter the memory * and if we share the data and we are *not* copy-on-writing the data, * then our updates will show in the file, so we must open with * write access. */ if (FILE_WRITABLE(prot,flags)) o_flag = O_RDWR; else o_flag = O_RDONLY; /* * If you're not sharing the file and you are writing to it, * then don't let anyone else have access to the file. */ if (((flags & MAP_SHARED) == 0) && (prot & PROT_WRITE)) o_flag |= O_EXCL; pMI->txt_fd = open(pzFile, o_flag); } if (pMI->txt_fd == AO_INVALID_FD) { pMI->txt_errno = errno; return MAP_FAILED_PTR; } #ifdef HAVE_MMAP /* * * * * WITH MMAP * * * * * */ /* * do the mmap. If we fail, then preserve errno, close the file and * return the failure. */ pMI->txt_data = mmap(NULL, pMI->txt_size+1, prot, flags, pMI->txt_fd, (size_t)0); if (pMI->txt_data == MAP_FAILED_PTR) { pMI->txt_errno = errno; goto fail_return; } /* * Most likely, everything will turn out fine now. The only difficult * part at this point is coping with files with sizes that are a multiple * of the page size. Handling that is what this whole thing is about. */ pMI->txt_zero_fd = -1; pMI->txt_errno = 0; { void* pNuls; #ifdef _SC_PAGESIZE size_t pgsz = sysconf(_SC_PAGESIZE); #else size_t pgsz = getpagesize(); #endif /* * Compute the pagesize rounded mapped memory size. * IF this is not the same as the file size, then there are NUL's * at the end of the file mapping and all is okay. */ pMI->txt_full_size = (pMI->txt_size + (pgsz - 1)) & ~(pgsz - 1); if (pMI->txt_size != pMI->txt_full_size) return pMI->txt_data; /* * Still here? We have to remap the trailing inaccessible page * either anonymously or to /dev/zero. */ pMI->txt_full_size += pgsz; #if defined(MAP_ANONYMOUS) pNuls = mmap( (void*)(((char*)pMI->txt_data) + pMI->txt_size), pgsz, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_FIXED|MAP_PRIVATE, AO_INVALID_FD, (size_t)0); if (pNuls != MAP_FAILED_PTR) return pMI->txt_data; pMI->txt_errno = errno; #elif defined(HAVE_DEV_ZERO) pMI->txt_zero_fd = open("/dev/zero", O_RDONLY); if (pMI->txt_zero_fd == AO_INVALID_FD) { pMI->txt_errno = errno; } else { pNuls = mmap( (void*)(((char*)pMI->txt_data) + pMI->txt_size), pgsz, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, pMI->txt_zero_fd, 0 ); if (pNuls != MAP_FAILED_PTR) return pMI->txt_data; pMI->txt_errno = errno; close(pMI->txt_zero_fd); pMI->txt_zero_fd = -1; } #endif pMI->txt_full_size = pMI->txt_size; } { void* p = AGALOC(pMI->txt_size+1, "file text"); memcpy(p, pMI->txt_data, pMI->txt_size); ((char*)p)[pMI->txt_size] = NUL; munmap(pMI->txt_data, pMI->txt_size ); pMI->txt_data = p; } pMI->txt_alloc = 1; return pMI->txt_data; #else /* * * * * * no HAVE_MMAP * * * * * */ pMI->txt_data = AGALOC(pMI->txt_size+1, "file text"); if (pMI->txt_data == NULL) { pMI->txt_errno = ENOMEM; goto fail_return; } { size_t sz = pMI->txt_size; char* pz = pMI->txt_data; while (sz > 0) { ssize_t rdct = read(pMI->txt_fd, pz, sz); if (rdct <= 0) { pMI->txt_errno = errno; fprintf(stderr, zFSErrReadFile, errno, strerror(errno), pzFile); free(pMI->txt_data); goto fail_return; } pz += rdct; sz -= rdct; } *pz = NUL; } /* * We never need a dummy page mapped in */ pMI->txt_zero_fd = -1; pMI->txt_errno = 0; return pMI->txt_data; #endif /* * * * * * no HAVE_MMAP * * * * * */ fail_return: if (pMI->txt_fd >= 0) { close(pMI->txt_fd); pMI->txt_fd = -1; } errno = pMI->txt_errno; pMI->txt_data = MAP_FAILED_PTR; return pMI->txt_data; } /*=export_func text_munmap * private: * * what: unmap the data mapped in by text_mmap * * arg: tmap_info_t*, mapinfo, info about the mapping * * ret-type: int * ret-desc: -1 or 0. @file{errno} will have the error code. * * doc: * * This routine will unmap the data mapped in with @code{text_mmap} and close * the associated file descriptors opened by that function. * * see: munmap(2), close(2) * * err: Any error code issued by munmap(2) or close(2) is possible. =*/ int text_munmap(tmap_info_t* pMI) { #ifdef HAVE_MMAP int res = 0; if (pMI->txt_alloc) { /* * IF the user has write permission and the text is not mapped private, * then write back any changes. Hopefully, nobody else has modified * the file in the mean time. */ if ( ((pMI->txt_prot & PROT_WRITE) != 0) && ((pMI->txt_flags & MAP_PRIVATE) == 0)) { if (lseek(pMI->txt_fd, (size_t)0, SEEK_SET) != 0) goto error_return; res = (write(pMI->txt_fd, pMI->txt_data, pMI->txt_size) < 0) ? errno : 0; } AGFREE(pMI->txt_data); errno = res; } else { res = munmap(pMI->txt_data, pMI->txt_full_size); } if (res != 0) goto error_return; res = close(pMI->txt_fd); if (res != 0) goto error_return; pMI->txt_fd = -1; errno = 0; if (pMI->txt_zero_fd != -1) { res = close(pMI->txt_zero_fd); pMI->txt_zero_fd = -1; } error_return: pMI->txt_errno = errno; return res; #else /* HAVE_MMAP */ errno = 0; /* * IF the memory is writable *AND* it is not private (copy-on-write) * *AND* the memory is "sharable" (seen by other processes) * THEN rewrite the data. */ if ( FILE_WRITABLE(pMI->txt_prot, pMI->txt_flags) && (lseek(pMI->txt_fd, 0, SEEK_SET) >= 0) ) { write(pMI->txt_fd, pMI->txt_data, pMI->txt_size); } close(pMI->txt_fd); pMI->txt_fd = -1; pMI->txt_errno = errno; free(pMI->txt_data); return pMI->txt_errno; #endif /* HAVE_MMAP */ } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/text_mmap.c */ ntp-4.2.6p5/sntp/libopts/m4/0000755000175000017500000000000011675461361014603 5ustar peterpeterntp-4.2.6p5/sntp/libopts/m4/liboptschk.m40000644000175000017500000000150411564122255017200 0ustar peterpeter# liboptschk.m4 serial 2 (autogen - 5.11.4) dnl Copyright (c) 2005-2011 by Bruce Korb - all rights reserved dnl dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl Time-stamp: "2010-12-07 12:57:56 bkorb" dnl AC_DEFUN([ag_FIND_LIBOPTS], [if test "X${ac_cv_header_autoopts_options_h}" = Xno then : else f=`autoopts-config cflags` 2>/dev/null if test X"${f}" = X then : else AC_DEFINE([HAVE_LIBOPTS],[1],[define if we can find libopts]) CFLAGS="${CFLAGS} ${f}" ao_CFLAGS="${f}" AC_SUBST(ao_CFLAGS) f=`autoopts-config ldflags` 2>/dev/null LIBS="${LIBS} ${f}" ao_LIBS="${f}" AC_SUBST(ao_LIBS) fi fi]) ntp-4.2.6p5/sntp/libopts/m4/libopts.m40000644000175000017500000004731511564122255016524 0ustar peterpeterdnl -*- buffer-read-only: t -*- vi: set ro: dnl dnl DO NOT EDIT THIS FILE (libopts.m4) dnl dnl It has been AutoGen-ed April 29, 2011 at 03:43:56 PM by AutoGen 5.11.9 dnl From the definitions libopts.def dnl and the template file conftest.tpl dnl dnl do always before generated macros: dnl AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[ AC_REQUIRE([AC_HEADER_STDC]) AC_HEADER_DIRENT # ================= # AC_CHECK_HEADERS # ================= AC_CHECK_HEADERS([ \ dlfcn.h errno.h fcntl.h libgen.h \ memory.h netinet/in.h setjmp.h sys/mman.h \ sys/param.h sys/poll.h sys/procset.h sys/select.h \ sys/socket.h sys/stropts.h sys/time.h sys/un.h \ sys/wait.h unistd.h utime.h sysexits.h ]) AC_CHECK_HEADERS([stdarg.h varargs.h], [lo_have_arg_hdr=true;break], [lo_have_arg_hdr=false]) AC_CHECK_HEADERS([string.h strings.h], [lo_have_str_hdr=true;break], [lo_have_str_hdr=false]) AC_CHECK_HEADERS([limits.h sys/limits.h values.h], [lo_have_lim_hdr=true;break], [lo_have_lim_hdr=false]) AC_CHECK_HEADERS([inttypes.h stdint.h], [lo_have_typ_hdr=true;break], [lo_have_typ_hdr=false]) # ---------------------------------------------------------------------- # check for various programs used during the build. # On OS/X, "wchar.h" needs "runetype.h" to work properly. # ---------------------------------------------------------------------- AC_CHECK_HEADERS([runetype.h wchar.h], [], [],[ AC_INCLUDES_DEFAULT #if HAVE_RUNETYPE_H # include #endif ]) # -------------------------------------------- # Verify certain entries from AC_CHECK_HEADERS # -------------------------------------------- [for f in sys_types sys_mman sys_param sys_stat sys_wait \ string errno stdlib memory setjmp do eval as_ac_var=\${ac_cv_header_${f}_h+set} test "${as_ac_var}" = set || { ]AC_MSG_ERROR([You must have ${f}.h on your system])[ } done ${lo_have_arg_hdr} || \ ]AC_MSG_ERROR([You must have stdarg.h or varargs.h on your system])[ ${lo_have_str_hdr} || \ ]AC_MSG_ERROR([You must have string.h or strings.h on your system])[ ${lo_have_lim_hdr} || \ ]AC_MSG_ERROR( [You must have one of limits.h, sys/limits.h or values.h])[ ${lo_have_typ_hdr} || \ ]AC_MSG_ERROR([You must have inttypes.h or stdint.h on your system]) # ---------------------------------------------------------------------- # Checks for typedefs # ---------------------------------------------------------------------- AC_CHECK_TYPES(wchar_t) AC_CHECK_TYPES(wint_t, [], [], [ AC_INCLUDES_DEFAULT #if HAVE_RUNETYPE_H # include #endif #if HAVE_WCHAR_H # include #endif ]) AC_CHECK_TYPES([int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, intptr_t, uintptr_t, uint_t, pid_t, size_t]) # ===== # sizes # ===== AC_CHECK_SIZEOF(char*, 8) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 8) AC_CHECK_SIZEOF(short, 2) # ---------------------------------------------------------------------- # AC_CHECK_LIB for SVR4 libgen, and use it if it defines pathfind. # ---------------------------------------------------------------------- AC_CHECK_LIB(gen, pathfind) AC_FUNC_VPRINTF AC_FUNC_FORK AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup strchr \ strrchr strsignal]) AC_PROG_SED [while : do POSIX_SHELL=`which bash` test -x "$POSIX_SHELL" && break POSIX_SHELL=`which dash` test -x "$POSIX_SHELL" && break POSIX_SHELL=/usr/xpg4/bin/sh test -x "$POSIX_SHELL" && break POSIX_SHELL=`/bin/sh -c ' exec 2>/dev/null if ! true ; then exit 1 ; fi echo /bin/sh'` test -x "$POSIX_SHELL" && break ]AC_ERROR([Cannot locate a working POSIX shell])[ done] AC_DEFINE_UNQUOTED([POSIX_SHELL], ["${POSIX_SHELL}"], [define to a working POSIX compliant shell]) AC_SUBST([POSIX_SHELL]) ]) dnl dnl @synopsis INVOKE_LIBOPTS_MACROS dnl dnl This macro will invoke the AutoConf macros specified in libopts.def dnl that have not been disabled with "omit-invocation". dnl AC_DEFUN([LIBOPTS_WITH_REGEX_HEADER],[ AC_ARG_WITH([regex-header], AS_HELP_STRING([--with-regex-header], [a reg expr header is specified]), [libopts_cv_with_regex_header=${with_regex_header}], AC_CACHE_CHECK([whether a reg expr header is specified], libopts_cv_with_regex_header, libopts_cv_with_regex_header=no) ) # end of AC_ARG_WITH if test "X${libopts_cv_with_regex_header}" != Xno then AC_DEFINE_UNQUOTED([REGEX_HEADER],[<${libopts_cv_with_regex_header}>]) else AC_DEFINE([REGEX_HEADER],[],[name of regex header file]) fi ]) # end of AC_DEFUN of LIBOPTS_WITH_REGEX_HEADER AC_DEFUN([LIBOPTS_WITHLIB_REGEX],[ AC_ARG_WITH([libregex], AS_HELP_STRING([--with-libregex], [libregex installation prefix]), [libopts_cv_with_libregex_root=${with_libregex}], AC_CACHE_CHECK([whether with-libregex was specified], libopts_cv_with_libregex_root, libopts_cv_with_libregex_root=no) ) # end of AC_ARG_WITH libregex if test "${with_libregex+set}" = set && \ test "${withval}" = no then ## disabled by request libopts_cv_with_libregex_root=no libopts_cv_with_libregex_cflags=no libopts_cv_with_libregex_libs=no else AC_ARG_WITH([libregex-cflags], AS_HELP_STRING([--with-libregex-cflags], [libregex compile flags]), [libopts_cv_with_libregex_cflags=${with_regex_cflags}], AC_CACHE_CHECK([whether with-libregex-cflags was specified], libopts_cv_with_libregex_cflags, libopts_cv_with_libregex_cflags=no) ) # end of AC_ARG_WITH libregex-cflags AC_ARG_WITH([libregex-libs], AS_HELP_STRING([--with-libregex-libs], [libregex link command arguments]), [libopts_cv_with_libregex_libs=${with_regex_libs}], AC_CACHE_CHECK([whether with-libregex-libs was specified], libopts_cv_with_libregex_libs, libopts_cv_with_libregex_libs=no) ) # end of AC_ARG_WITH libregex-libs case "X${libopts_cv_with_libregex_cflags}" in Xyes|Xno|X ) case "X${libopts_cv_with_libregex_root}" in Xyes|Xno|X ) libopts_cv_with_libregex_cflags=no ;; * ) libopts_cv_with_libregex_cflags=-I${libopts_cv_with_libregex_root}/include ;; esac esac case "X${libopts_cv_with_libregex_libs}" in Xyes|Xno|X ) case "X${libopts_cv_with_libregex_root}" in Xyes|Xno|X ) libopts_cv_with_libregex_libs=no ;; * ) libopts_cv_with_libregex_libs="-L${libopts_cv_with_libregex_root}/lib -lregex";; esac esac libopts_save_CPPFLAGS="${CPPFLAGS}" libopts_save_LIBS="${LIBS}" fi ## disabled by request case "X${libopts_cv_with_libregex_cflags}" in Xyes|Xno|X ) libopts_cv_with_libregex_cflags="" ;; * ) CPPFLAGS="${CPPFLAGS} ${libopts_cv_with_libregex_cflags}" ;; esac case "X${libopts_cv_with_libregex_libs}" in Xyes|Xno|X ) libopts_cv_with_libregex_libs="" ;; * ) LIBS="${LIBS} ${libopts_cv_with_libregex_libs}" ;; esac LIBREGEX_CFLAGS="" LIBREGEX_LIBS="" AC_MSG_CHECKING([whether libregex functions properly]) AC_CACHE_VAL([libopts_cv_with_libregex],[ AC_TRY_RUN([@%:@include @%:@include @%:@include @%:@include REGEX_HEADER static regex_t re; void comp_re( char const* pzPat ) { int res = regcomp( &re, pzPat, REG_EXTENDED|REG_ICASE|REG_NEWLINE ); if (res == 0) return; exit( res ); } int main() { regmatch_t m@<:@2@:>@; comp_re( "^.*\@S|@" ); comp_re( "()|no.*" ); comp_re( "." ); if (regexec( &re, "X", 2, m, 0 ) != 0) return 1; if ((m@<:@0@:>@.rm_so != 0) || (m@<:@0@:>@.rm_eo != 1)) { fputs( "error: regex -->.<-- did not match\n", stderr ); return 1; } return 0; }], [libopts_cv_with_libregex=yes], [libopts_cv_with_libregex=no], [libopts_cv_with_libregex=no]) # end of AC_TRY_RUN ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex AC_MSG_RESULT([${libopts_cv_with_libregex}]) if test "X${libopts_cv_with_libregex}" != Xno then AC_DEFINE([WITH_LIBREGEX],[1], [Define this if a working libregex can be found]) else CPPFLAGS="${libopts_save_CPPFLAGS}" LIBS="${libopts_save_LIBS}" fi ]) # end of AC_DEFUN of LIBOPTS_WITHLIB_REGEX AC_DEFUN([LIBOPTS_RUN_PATHFIND],[ AC_MSG_CHECKING([whether pathfind(3) works]) AC_CACHE_VAL([libopts_cv_run_pathfind],[ AC_TRY_RUN([@%:@include @%:@include 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 TRY_RUN ]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind AC_MSG_RESULT([${libopts_cv_run_pathfind}]) if test "X${libopts_cv_run_pathfind}" != Xno then AC_DEFINE([HAVE_PATHFIND],[1], [Define this if pathfind(3) works]) fi ]) # end of AC_DEFUN of LIBOPTS_RUN_PATHFIND AC_DEFUN([LIBOPTS_TEST_DEV_ZERO],[ AC_MSG_CHECKING([whether /dev/zero is readable device]) AC_CACHE_VAL([libopts_cv_test_dev_zero],[ libopts_cv_test_dev_zero=`exec 2> /dev/null dzero=\`ls -lL /dev/zero | egrep ^c......r\` test -z "${dzero}" && exit 1 echo ${dzero}` if test $? -ne 0 || test -z "$libopts_cv_test_dev_zero" then libopts_cv_test_dev_zero=no fi ]) # end of CACHE_VAL of libopts_cv_test_dev_zero AC_MSG_RESULT([${libopts_cv_test_dev_zero}]) if test "X${libopts_cv_test_dev_zero}" != Xno then AC_DEFINE([HAVE_DEV_ZERO],[1], [Define this if /dev/zero is readable device]) fi ]) # end of AC_DEFUN of LIBOPTS_TEST_DEV_ZERO AC_DEFUN([LIBOPTS_RUN_REALPATH],[ AC_MSG_CHECKING([whether we have a functional realpath(3C)]) AC_CACHE_VAL([libopts_cv_run_realpath],[ AC_TRY_RUN([@%:@include @%:@include int main (int argc, char** argv) { @%:@ifndef PATH_MAX choke me!! @%:@else char zPath@<:@PATH_MAX+1@:>@; @%:@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 TRY_RUN ]) # end of AC_CACHE_VAL for libopts_cv_run_realpath AC_MSG_RESULT([${libopts_cv_run_realpath}]) if test "X${libopts_cv_run_realpath}" != Xno then AC_DEFINE([HAVE_REALPATH],[1], [Define this if we have a functional realpath(3C)]) fi ]) # end of AC_DEFUN of LIBOPTS_RUN_REALPATH AC_DEFUN([LIBOPTS_RUN_STRFTIME],[ AC_MSG_CHECKING([whether strftime() works]) AC_CACHE_VAL([libopts_cv_run_strftime],[ AC_TRY_RUN([@%:@include @%:@include char t_buf@<:@ 64 @:>@; int main() { static char const z@<:@@:>@ = "Thursday Aug 28 240"; struct tm tm; tm.tm_sec = 36; /* seconds after the minute @<:@0, 61@:>@ */ tm.tm_min = 44; /* minutes after the hour @<:@0, 59@:>@ */ tm.tm_hour = 12; /* hour since midnight @<:@0, 23@:>@ */ tm.tm_mday = 28; /* day of the month @<:@1, 31@:>@ */ tm.tm_mon = 7; /* months since January @<:@0, 11@:>@ */ tm.tm_year = 86; /* years since 1900 */ tm.tm_wday = 4; /* days since Sunday @<:@0, 6@:>@ */ 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); }], [libopts_cv_run_strftime=yes],[libopts_cv_run_strftime=no],[libopts_cv_run_strftime=no] ) # end of TRY_RUN ]) # end of AC_CACHE_VAL for libopts_cv_run_strftime AC_MSG_RESULT([${libopts_cv_run_strftime}]) if test "X${libopts_cv_run_strftime}" != Xno then AC_DEFINE([HAVE_STRFTIME],[1], [Define this if strftime() works]) fi ]) # end of AC_DEFUN of LIBOPTS_RUN_STRFTIME AC_DEFUN([LIBOPTS_RUN_FOPEN_BINARY],[ AC_MSG_CHECKING([whether fopen accepts "b" mode]) AC_CACHE_VAL([libopts_cv_run_fopen_binary],[ AC_TRY_RUN([@%:@include int main (int argc, char** argv) { FILE* fp = fopen("conftest.@S|@ac_ext", "rb"); 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 TRY_RUN ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary AC_MSG_RESULT([${libopts_cv_run_fopen_binary}]) if test "X${libopts_cv_run_fopen_binary}" != Xno then AC_DEFINE([FOPEN_BINARY_FLAG],"b", [fopen(3) accepts a 'b' in the mode flag]) else AC_DEFINE([FOPEN_BINARY_FLAG],"", [fopen(3) accepts a 'b' in the mode flag]) fi ]) # end of AC_DEFUN of LIBOPTS_RUN_FOPEN_BINARY AC_DEFUN([LIBOPTS_RUN_FOPEN_TEXT],[ AC_MSG_CHECKING([whether fopen accepts "t" mode]) AC_CACHE_VAL([libopts_cv_run_fopen_text],[ AC_TRY_RUN([@%:@include int main (int argc, char** argv) { FILE* fp = fopen("conftest.@S|@ac_ext", "rt"); 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 TRY_RUN ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text AC_MSG_RESULT([${libopts_cv_run_fopen_text}]) if test "X${libopts_cv_run_fopen_text}" != Xno then AC_DEFINE([FOPEN_TEXT_FLAG],"t", [fopen(3) accepts a 't' in the mode flag]) else AC_DEFINE([FOPEN_TEXT_FLAG],"", [fopen(3) accepts a 't' in the mode flag]) fi ]) # end of AC_DEFUN of LIBOPTS_RUN_FOPEN_TEXT AC_DEFUN([LIBOPTS_DISABLE_OPTIONAL_ARGS],[ AC_ARG_ENABLE([optional-args], AS_HELP_STRING([--disable-optional-args], [not wanting optional option args]), [libopts_cv_enable_optional_args=${enable_optional_args}], AC_CACHE_CHECK([whether not wanting optional option args], libopts_cv_enable_optional_args, libopts_cv_enable_optional_args=yes) ) # end of AC_ARG_ENABLE if test "X${libopts_cv_enable_optional_args}" = Xno then AC_DEFINE([NO_OPTIONAL_OPT_ARGS], [1], [Define this if optional arguments are disallowed]) fi ]) # end of AC_DEFUN of LIBOPTS_DISABLE_OPTIONAL_ARGS AC_DEFUN([INVOKE_LIBOPTS_MACROS],[ AC_REQUIRE([INVOKE_LIBOPTS_MACROS_FIRST]) # Check to see if a reg expr header is specified. LIBOPTS_WITH_REGEX_HEADER # Check to see if a working libregex can be found. LIBOPTS_WITHLIB_REGEX # Check to see if pathfind(3) works. LIBOPTS_RUN_PATHFIND # Check to see if /dev/zero is readable device. LIBOPTS_TEST_DEV_ZERO # Check to see if we have a functional realpath(3C). LIBOPTS_RUN_REALPATH # Check to see if strftime() works. LIBOPTS_RUN_STRFTIME # Check to see if fopen accepts "b" mode. LIBOPTS_RUN_FOPEN_BINARY # Check to see if fopen accepts "t" mode. LIBOPTS_RUN_FOPEN_TEXT # Check to see if not wanting optional option args. LIBOPTS_DISABLE_OPTIONAL_ARGS ]) # end AC_DEFUN of INVOKE_LIBOPTS_MACROS dnl @synopsis LIBOPTS_CHECK dnl dnl Time-stamp: "2010-11-29 15:45:54 bkorb" dnl dnl If autoopts-config works, add the linking information to LIBS. dnl Otherwise, add ``libopts-${ao_rev}'' to SUBDIRS and run all dnl the config tests that the library needs. Invoke the dnl "INVOKE_LIBOPTS_MACROS" macro iff we are building libopts. dnl dnl This file is part of AutoGen. dnl AutoGen Copyright (c) 1992-2011 by Bruce Korb - all rights reserved dnl dnl AutoGen is free software: you can redistribute it and/or modify it dnl under the terms of the GNU General Public License as published by the dnl Free Software Foundation, either version 3 of the License, or dnl (at your option) any later version. dnl dnl AutoGen is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. dnl See the GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License along dnl with this program. If not, see . dnl dnl Default to system libopts dnl AC_DEFUN([LIBOPTS_CHECK_COMMON],[ AC_REQUIRE([INVOKE_LIBOPTS_MACROS_FIRST]) [NEED_LIBOPTS_DIR=''] m4_pushdef([AO_Libopts_Dir], [ifelse($1, , [libopts], [$1])]) AC_ARG_ENABLE([local-libopts], AC_HELP_STRING([--enable-local-libopts], [Force using the supplied libopts tearoff code]),[ if test x$enableval = xyes ; then AC_MSG_NOTICE([Using supplied libopts tearoff]) LIBOPTS_LDADD='$(top_builddir)/AO_Libopts_Dir/libopts.la' LIBOPTS_CFLAGS='-I$(top_srcdir)/AO_Libopts_Dir' NEED_LIBOPTS_DIR=true fi]) AC_ARG_ENABLE([libopts-install], AC_HELP_STRING([--disable-libopts-install], [Do not install libopts with client installation])) AM_CONDITIONAL([INSTALL_LIBOPTS],[test "X${enable_libopts_install}" != Xno]) [if test -z "${NEED_LIBOPTS_DIR}" ; then] AC_MSG_CHECKING([whether autoopts-config can be found]) AC_ARG_WITH([autoopts-config], AC_HELP_STRING([--with-autoopts-config], [specify the config-info script]), [lo_cv_with_autoopts_config=${with_autoopts_config}], AC_CACHE_CHECK([whether autoopts-config is specified], [lo_cv_with_autoopts_config], [if autoopts-config --help 2>/dev/null 1>&2 then lo_cv_with_autoopts_config=autoopts-config elif libopts-config --help 2>/dev/null 1>&2 then lo_cv_with_autoopts_config=libopts-config else lo_cv_with_autoopts_config=no ; fi]) ) # end of AC_ARG_WITH AC_CACHE_VAL([lo_cv_test_autoopts],[ if test -z "${lo_cv_with_autoopts_config}" \ -o X"${lo_cv_with_autoopts_config}" = Xno then if autoopts-config --help 2>/dev/null 1>&2 then lo_cv_with_autoopts_config=autoopts-config elif libopts-config --help 2>/dev/null 1>&2 then lo_cv_with_autoopts_config=libopts-config else lo_cv_with_autoopts_config=false ; fi fi lo_cv_test_autoopts=` ${lo_cv_with_autoopts_config} --libs` 2> /dev/null if test $? -ne 0 -o -z "${lo_cv_test_autoopts}" then lo_cv_test_autoopts=no ; fi ]) # end of CACHE_VAL AC_MSG_RESULT([${lo_cv_test_autoopts}]) [if test "X${lo_cv_test_autoopts}" != Xno then LIBOPTS_LDADD="${lo_cv_test_autoopts}" LIBOPTS_CFLAGS="`${lo_cv_with_autoopts_config} --cflags`" else LIBOPTS_LDADD='$(top_builddir)/]AO_Libopts_Dir[/libopts.la' LIBOPTS_CFLAGS='-I$(top_srcdir)/]AO_Libopts_Dir[' NEED_LIBOPTS_DIR=true fi fi # end of if test -z "${NEED_LIBOPTS_DIR}" if test -n "${LIBOPTS_BUILD_BLOCKED}" ; then NEED_LIBOPTS_DIR='' fi] AM_CONDITIONAL([NEED_LIBOPTS], [test -n "${NEED_LIBOPTS_DIR}"]) AC_SUBST(LIBOPTS_LDADD) AC_SUBST(LIBOPTS_CFLAGS) AC_SUBST(LIBOPTS_DIR, AO_Libopts_Dir) m4_popdef([AO_Libopts_Dir]) [# end of AC_DEFUN of LIBOPTS_CHECK_COMMON] ]) dnl AC_CONFIG_FILES conditionalization requires using AM_COND_IF, however dnl AM_COND_IF is new to Automake 1.11. To use it on new Automake without dnl requiring same, a fallback implementation for older Automake is provided. dnl Note that disabling of AC_CONFIG_FILES requires Automake 1.11, this code dnl is correct only in terms of m4sh generated script. m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [ if test -z "$$1_TRUE"; then : m4_n([$2])[]dnl m4_ifval([$3], [else $3 ])dnl fi[]dnl ])]) dnl AC_DEFUN([LIBOPTS_CHECK_NOBUILD], [ m4_pushdef([AO_Libopts_Dir], [ifelse($1, , [libopts], [$1])]) LIBOPTS_BUILD_BLOCKED=true LIBOPTS_CHECK_COMMON(AO_Libopts_Dir) m4_popdef([AO_Libopts_Dir])dnl # end of AC_DEFUN of LIBOPTS_CHECK_NOBUILD ]) dnl AC_DEFUN([LIBOPTS_CHECK], [ m4_pushdef([AO_Libopts_Dir], [ifelse($1, , [libopts], [$1])]) LIBOPTS_BUILD_BLOCKED='' LIBOPTS_CHECK_COMMON(AO_Libopts_Dir) AM_COND_IF([NEED_LIBOPTS], [ INVOKE_LIBOPTS_MACROS AC_CONFIG_FILES(AO_Libopts_Dir/Makefile) ])dnl m4_popdef([AO_Libopts_Dir])dnl # end of AC_DEFUN of LIBOPTS_CHECK ]) ntp-4.2.6p5/sntp/libopts/file.c0000644000175000017500000001255511636775106015360 0ustar peterpeter /** * \file file.c * * Time-stamp: "2010-07-10 11:00:59 bkorb" * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ /*=export_func optionFileCheck * private: * * what: Decipher a boolean value * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * arg: + teOptFileType + ftype + File handling type + * arg: + tuFileMode + mode + file open mode (if needed) + * * doc: * Make sure the named file conforms with the file type mode. * The mode specifies if the file must exist, must not exist or may * (or may not) exist. The mode may also specify opening the * file: don't, open just the descriptor (fd), or open as a stream * (FILE* pointer). =*/ void optionFileCheck(tOptions* pOpts, tOptDesc* pOD, teOptFileType ftype, tuFileMode mode) { if (pOpts <= OPTPROC_EMIT_LIMIT) { if (pOpts != OPTPROC_EMIT_USAGE) return; switch (ftype & FTYPE_MODE_EXIST_MASK) { case FTYPE_MODE_MUST_NOT_EXIST: fputs(zFileCannotExist, option_usage_fp); break; case FTYPE_MODE_MUST_EXIST: fputs(zFileMustExist, option_usage_fp); break; } return; } if ((pOD->fOptState & OPTST_RESET) != 0) { if (pOD->optCookie != NULL) AGFREE(pOD->optCookie); return; } { struct stat sb; errno = 0; switch (ftype & FTYPE_MODE_EXIST_MASK) { case FTYPE_MODE_MUST_NOT_EXIST: if ( (stat(pOD->optArg.argString, &sb) == 0) || (errno != ENOENT) ){ if (errno == 0) errno = EINVAL; fprintf(stderr, zFSOptError, errno, strerror(errno), zFSOptErrNoExist, pOD->optArg.argString, pOD->pz_Name); pOpts->pUsageProc(pOpts, EXIT_FAILURE); /* NOTREACHED */ } /* FALLTHROUGH */ default: case FTYPE_MODE_MAY_EXIST: { char * p = strrchr(pOD->optArg.argString, DIRCH); if (p == NULL) break; /* assume "." always exists. */ *p = NUL; if ( (stat(pOD->optArg.argString, &sb) != 0) || (errno = EINVAL, ! S_ISDIR(sb.st_mode)) ){ fprintf(stderr, zFSOptError, errno, strerror(errno), zFSOptErrMayExist, pOD->optArg.argString, pOD->pz_Name); pOpts->pUsageProc(pOpts, EXIT_FAILURE); /* NOTREACHED */ } if (p != NULL) *p = DIRCH; break; } case FTYPE_MODE_MUST_EXIST: if ( (stat(pOD->optArg.argString, &sb) != 0) || (errno = EINVAL, ! S_ISREG(sb.st_mode)) ){ fprintf(stderr, zFSOptError, errno, strerror(errno), zFSOptErrMustExist, pOD->optArg.argString, pOD->pz_Name); pOpts->pUsageProc(pOpts, EXIT_FAILURE); /* NOTREACHED */ } break; } } switch (ftype & FTYPE_MODE_OPEN_MASK) { default: case FTYPE_MODE_NO_OPEN: break; case FTYPE_MODE_OPEN_FD: { int fd = open(pOD->optArg.argString, mode.file_flags); if (fd < 0) { fprintf(stderr, zFSOptError, errno, strerror(errno), zFSOptErrOpen, pOD->optArg.argString, pOD->pz_Name); pOpts->pUsageProc(pOpts, EXIT_FAILURE); /* NOTREACHED */ } if ((pOD->fOptState & OPTST_ALLOC_ARG) != 0) pOD->optCookie = (void *)pOD->optArg.argString; else AGDUPSTR(pOD->optCookie, pOD->optArg.argString, "file name"); pOD->optArg.argFd = fd; pOD->fOptState &= ~OPTST_ALLOC_ARG; break; } case FTYPE_MODE_FOPEN_FP: { FILE* fp = fopen(pOD->optArg.argString, mode.file_mode); if (fp == NULL) { fprintf(stderr, zFSOptError, errno, strerror(errno), zFSOptErrFopen, pOD->optArg.argString, pOD->pz_Name); pOpts->pUsageProc(pOpts, EXIT_FAILURE); /* NOTREACHED */ } if ((pOD->fOptState & OPTST_ALLOC_ARG) != 0) pOD->optCookie = (void *)pOD->optArg.argString; else AGDUPSTR(pOD->optCookie, pOD->optArg.argString, "file name"); pOD->optArg.argFp = fp; pOD->fOptState &= ~OPTST_ALLOC_ARG; break; } } } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/file.c */ ntp-4.2.6p5/sntp/libopts/version.c0000644000175000017500000001162311564122255016110 0ustar peterpeter /* * Time-stamp: "2011-04-22 12:54:28 bkorb" * * This module implements the default usage procedure for * Automated Options. It may be overridden, of course. */ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ /*=export_func optionVersion * * what: return the compiled AutoOpts version number * ret_type: char const* * ret_desc: the version string in constant memory * doc: * Returns the full version string compiled into the library. * The returned string cannot be modified. =*/ char const* optionVersion(void) { static char const zVersion[] = STR(AO_CURRENT.AO_REVISION); return zVersion; } static void emit_simple_ver(tOptions * pOpts, FILE * fp) { if (pOpts->pzFullVersion != NULL) fputs(pOpts->pzFullVersion, fp); else if (pOpts->pzCopyright != NULL) { char const * pe = strchr(pOpts->pzCopyright, '\n'); if (pe == NULL) pe = pOpts->pzCopyright + strlen(pOpts->pzCopyright); fwrite(pOpts->pzCopyright, 1, pe - pOpts->pzCopyright, fp); } else { char const * pe = strchr(pOpts->pzUsageTitle, '\n'); if (pe == NULL) pe = pOpts->pzUsageTitle + strlen(pOpts->pzUsageTitle); fwrite(pOpts->pzUsageTitle, 1, pe - pOpts->pzCopyright, fp); } fputc('\n', fp); } static void emit_copy_ver(tOptions * pOpts, FILE * fp) { if (pOpts->pzCopyright != NULL) fputs(pOpts->pzCopyright, fp); else if (pOpts->pzFullVersion != NULL) fputs(pOpts->pzFullVersion, fp); else { char const * pe = strchr(pOpts->pzUsageTitle, '\n'); if (pe == NULL) pe = pOpts->pzUsageTitle + strlen(pOpts->pzUsageTitle); fwrite(pOpts->pzUsageTitle, 1, pe - pOpts->pzCopyright, fp); } fputc('\n', fp); if (HAS_pzPkgDataDir(pOpts) && (pOpts->pzPackager != NULL)) fputs(pOpts->pzPackager, fp); else if (pOpts->pzBugAddr != NULL) fprintf(fp, zPlsSendBugs, pOpts->pzBugAddr); } static void emit_copy_note(tOptions * pOpts, FILE * fp) { if (pOpts->pzCopyright != NULL) { fputs(pOpts->pzCopyright, fp); fputc('\n', fp); } if (pOpts->pzCopyNotice != NULL) { fputs(pOpts->pzCopyNotice, fp); fputc('\n', fp); } fprintf(fp, zAO_Ver, optionVersion()); if (HAS_pzPkgDataDir(pOpts) && (pOpts->pzPackager != NULL)) fputs(pOpts->pzPackager, fp); else if (pOpts->pzBugAddr != NULL) fprintf(fp, zPlsSendBugs, pOpts->pzBugAddr); } static void print_ver(tOptions * pOpts, tOptDesc * pOD, FILE * fp) { char ch; /* * IF the optional argument flag is off, or the argument * is not provided, then just print the version. */ if ( ((pOD->fOptState & OPTST_ARG_OPTIONAL) == 0) || (pOD->optArg.argString == NULL)) ch = 'v'; else ch = pOD->optArg.argString[0]; switch (ch) { case NUL: /* arg provided, but empty */ case 'v': case 'V': emit_simple_ver(pOpts, fp); break; case 'c': case 'C': emit_copy_ver(pOpts, fp); break; case 'n': case 'N': emit_copy_note(pOpts, fp); break; default: fprintf(stderr, zBadVerArg, ch); exit(EXIT_FAILURE); } fflush(fp); if (ferror(fp) != 0) { fputs(zOutputFail, stderr); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); } /*=export_func optionPrintVersion * private: * * what: Print the program version * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * This routine will print the version to stdout. =*/ void optionPrintVersion(tOptions * pOpts, tOptDesc * pOD) { print_ver(pOpts, pOD, stdout); } /*=export_func optionVersionStderr * private: * * what: Print the program version to stderr * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * This routine will print the version to stderr. =*/ void optionVersionStderr(tOptions * pOpts, tOptDesc * pOD) { print_ver(pOpts, pOD, stderr); } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/version.c */ ntp-4.2.6p5/sntp/libopts/Makefile.in0000644000175000017500000004656311675460460016345 0ustar peterpeter# 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 = libopts 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)/../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_cacheversion.m4 \ $(top_srcdir)/../m4/ntp_dir_sep.m4 \ $(top_srcdir)/../m4/ntp_lib_m.m4 \ $(top_srcdir)/../m4/ntp_openssl.m4 $(top_srcdir)/../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)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libopts_la_LIBADD = am_libopts_la_OBJECTS = libopts_la-libopts.lo libopts_la_OBJECTS = $(am_libopts_la_OBJECTS) libopts_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libopts_la_LDFLAGS) $(LDFLAGS) -o $@ @INSTALL_LIBOPTS_FALSE@am_libopts_la_rpath = @INSTALL_LIBOPTS_TRUE@am_libopts_la_rpath = -rpath $(libdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libopts_la_SOURCES) DIST_SOURCES = $(libopts_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SEPARATOR = @PATH_SEPARATOR@ POSIX_SHELL = @POSIX_SHELL@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ 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_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@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in @INSTALL_LIBOPTS_TRUE@lib_LTLIBRARIES = libopts.la @INSTALL_LIBOPTS_FALSE@noinst_LTLIBRARIES = libopts.la libopts_la_SOURCES = libopts.c libopts_la_CPPFLAGS = -I$(top_srcdir) libopts_la_LDFLAGS = -version-info 35:0:10 EXTRA_DIST = \ COPYING.gplv3 COPYING.lgplv3 COPYING.mbsd \ MakeDefs.inc README ag-char-map.h \ autoopts/usage-txt.h autoopts/options.h autoopts/project.h \ autoopts.c autoopts.h boolean.c \ compat/strdup.c compat/compat.h compat/windows-config.h \ compat/snprintf.c compat/strchr.c compat/pathfind.c \ configfile.c cook.c enumeration.c \ environment.c file.c genshell.c \ genshell.h load.c m4/liboptschk.m4 \ m4/libopts.m4 makeshell.c nested.c \ numeric.c parse-duration.c parse-duration.h \ pgusage.c proto.h putshell.c \ reset.c restore.c save.c \ sort.c stack.c streqvcmp.c \ text_mmap.c time.c tokenize.c \ usage.c value-type.c value-type.h \ version.c xat-attribute.c xat-attribute.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(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 libopts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libopts/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-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libopts.la: $(libopts_la_OBJECTS) $(libopts_la_DEPENDENCIES) $(libopts_la_LINK) $(am_libopts_la_rpath) $(libopts_la_OBJECTS) $(libopts_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopts_la-libopts.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libopts_la-libopts.lo: libopts.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libopts_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libopts_la-libopts.lo -MD -MP -MF $(DEPDIR)/libopts_la-libopts.Tpo -c -o libopts_la-libopts.lo `test -f 'libopts.c' || echo '$(srcdir)/'`libopts.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopts_la-libopts.Tpo $(DEPDIR)/libopts_la-libopts.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libopts.c' object='libopts_la-libopts.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libopts_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libopts_la-libopts.lo `test -f 'libopts.c' || echo '$(srcdir)/'`libopts.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # 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: ntp-4.2.6p5/sntp/libopts/putshell.c0000644000175000017500000002642611564122255016272 0ustar peterpeter /** * \file putshell.c * * Time-stamp: "2010-09-05 06:10:56 bkorb" * * This module will interpret the options set in the tOptions * structure and print them to standard out in a fashion that * will allow them to be interpreted by the Bourne or Korn shells. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ static char const zOptValFmt[] = "%s_%s="; static char const zOptEnd[] = "\nexport %s_%s\n"; static char const zOptNumFmt[] = "%1$s_%2$s=%3$d # 0x%3$X\nexport %1$s_%2$s\n"; /* = = = START-STATIC-FORWARD = = = */ static void print_quot_str(tCC* pzStr); static void print_enumeration(tOptions * pOpts, tOptDesc * pOD); static void print_membership(tOptions * pOpts, tOptDesc * pOD); static void print_stacked_arg(tOptions * pOpts, tOptDesc * pOD); static void print_reordering(tOptions * pOpts); /* = = = END-STATIC-FORWARD = = = */ /* * Make sure embedded single quotes come out okay. The initial quote has * been emitted and the closing quote will be upon return. */ static void print_quot_str(tCC* pzStr) { /* * Handle empty strings to make the rest of the logic simpler. */ if ((pzStr == NULL) || (*pzStr == NUL)) { fputs("''", stdout); return; } /* * Emit any single quotes/apostrophes at the start of the string and * bail if that is all we need to do. */ while (*pzStr == '\'') { fputs("\\'", stdout); pzStr++; } if (*pzStr == NUL) return; /* * Start the single quote string */ fputc('\'', stdout); for (;;) { tCC* pz = strchr(pzStr, '\''); if (pz == NULL) break; /* * Emit the string up to the single quote (apostrophe) we just found. */ (void)fwrite(pzStr, (size_t)(pz - pzStr), (size_t)1, stdout); fputc('\'', stdout); pzStr = pz; /* * Emit an escaped apostrophe for every one we find. * If that ends the string, do not re-open the single quotes. */ while (*++pzStr == '\'') fputs("\\'", stdout); if (*pzStr == NUL) return; fputc('\'', stdout); } /* * If we broke out of the loop, we must still emit the remaining text * and then close the single quote string. */ fputs(pzStr, stdout); fputc('\'', stdout); } static void print_enumeration(tOptions * pOpts, tOptDesc * pOD) { uintptr_t e_val = pOD->optArg.argEnum; printf(zOptValFmt, pOpts->pzPROGNAME, pOD->pz_NAME); /* * Convert value to string, print that and restore numeric value. */ (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD); printf("'%s'", pOD->optArg.argString); if (pOD->fOptState & OPTST_ALLOC_ARG) AGFREE(pOD->optArg.argString); pOD->optArg.argEnum = e_val; printf(zOptEnd, pOpts->pzPROGNAME, pOD->pz_NAME); } static void print_membership(tOptions * pOpts, tOptDesc * pOD) { char const * pz; uintptr_t val = 1; printf(zOptNumFmt, pOpts->pzPROGNAME, pOD->pz_NAME, (int)(uintptr_t)(pOD->optCookie)); pOD->optCookie = (void*)(uintptr_t)~0UL; (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD); /* * We are building the typeset list. The list returned starts with * 'none + ' for use by option saving stuff. We must ignore that. */ pz = pOD->optArg.argString + 7; while (*pz != NUL) { printf("typeset -x -i %s_", pOD->pz_NAME); while (IS_PLUS_N_SPACE_CHAR(*pz)) pz++; for (;;) { int ch = *(pz++); if (IS_LOWER_CASE_CHAR(ch)) fputc(toupper(ch), stdout); else if (IS_UPPER_CASE_CHAR(ch)) fputc(ch, stdout); else if (IS_PLUS_N_SPACE_CHAR(ch)) goto name_done; else if (ch == NUL) { pz--; goto name_done; } else fputc('_', stdout); } name_done:; printf("=%1$lu # 0x%1$lX\n", (unsigned long)val); val <<= 1; } AGFREE(pOD->optArg.argString); pOD->optArg.argString = NULL; pOD->fOptState &= ~OPTST_ALLOC_ARG; } static void print_stacked_arg(tOptions * pOpts, tOptDesc * pOD) { tSCC zOptCookieCt[] = "%1$s_%2$s_CT=%3$d\nexport %1$s_%2$s_CT\n"; tArgList* pAL = (tArgList*)pOD->optCookie; tCC** ppz = pAL->apzArgs; int ct = pAL->useCt; printf(zOptCookieCt, pOpts->pzPROGNAME, pOD->pz_NAME, ct); while (--ct >= 0) { tSCC numarg_z[] = "%s_%s_%d="; tSCC end_z[] = "\nexport %s_%s_%d\n"; printf(numarg_z, pOpts->pzPROGNAME, pOD->pz_NAME, pAL->useCt - ct); print_quot_str(*(ppz++)); printf(end_z, pOpts->pzPROGNAME, pOD->pz_NAME, pAL->useCt - ct); } } static void print_reordering(tOptions * pOpts) { int optIx; fputs("set --", stdout); for (optIx = pOpts->curOptIdx; optIx < pOpts->origArgCt; optIx++) { char* pzArg = pOpts->origArgVect[ optIx ]; if (strchr(pzArg, '\'') == NULL) printf(" '%s'", pzArg); else { fputs(" '", stdout); for (;;) { char ch = *(pzArg++); switch (ch) { case '\'': fputs("'\\''", stdout); break; case NUL: goto arg_done; default: fputc(ch, stdout); break; } } arg_done:; fputc('\'', stdout); } } fputs("\nOPTION_CT=0\n", stdout); } /*=export_func optionPutShell * what: write a portable shell script to parse options * private: * arg: tOptions*, pOpts, the program options descriptor * doc: This routine will emit portable shell script text for parsing * the options described in the option definitions. =*/ void optionPutShell(tOptions* pOpts) { int optIx = 0; tSCC zOptCtFmt[] = "OPTION_CT=%d\nexport OPTION_CT\n"; tSCC zOptDisabl[] = "%1$s_%2$s=%3$s\nexport %1$s_%2$s\n"; tSCC zFullOptFmt[]= "%1$s_%2$s='%3$s'\nexport %1$s_%2$s\n"; tSCC zEquivMode[] = "%1$s_%2$s_MODE='%3$s'\nexport %1$s_%2$s_MODE\n"; printf(zOptCtFmt, pOpts->curOptIdx-1); do { tOptDesc* pOD = pOpts->pOptDesc + optIx; if (SKIP_OPT(pOD)) continue; /* * Equivalence classes are hard to deal with. Where the * option data wind up kind of squishes around. For the purposes * of emitting shell state, they are not recommended, but we'll * do something. I guess we'll emit the equivalenced-to option * at the point in time when the base option is found. */ if (pOD->optEquivIndex != NO_EQUIVALENT) continue; /* equivalence to a different option */ /* * Equivalenced to a different option. Process the current option * as the equivalenced-to option. Keep the persistent state bits, * but copy over the set-state bits. */ if (pOD->optActualIndex != optIx) { tOptDesc* p = pOpts->pOptDesc + pOD->optActualIndex; p->optArg = pOD->optArg; p->fOptState &= OPTST_PERSISTENT_MASK; p->fOptState |= pOD->fOptState & ~OPTST_PERSISTENT_MASK; printf(zEquivMode, pOpts->pzPROGNAME, pOD->pz_NAME, p->pz_NAME); pOD = p; } /* * If the argument type is a set membership bitmask, then we always * emit the thing. We do this because it will always have some sort * of bitmask value and we need to emit the bit values. */ if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_MEMBERSHIP) { print_membership(pOpts, pOD); continue; } /* * IF the option was either specified or it wakes up enabled, * then we will emit information. Otherwise, skip it. * The idea is that if someone defines an option to initialize * enabled, we should tell our shell script that it is enabled. */ if (UNUSED_OPT(pOD) && DISABLED_OPT(pOD)) { continue; } /* * Handle stacked arguments */ if ( (pOD->fOptState & OPTST_STACKED) && (pOD->optCookie != NULL) ) { print_stacked_arg(pOpts, pOD); continue; } /* * If the argument has been disabled, * Then set its value to the disablement string */ if ((pOD->fOptState & OPTST_DISABLED) != 0) { printf(zOptDisabl, pOpts->pzPROGNAME, pOD->pz_NAME, (pOD->pz_DisablePfx != NULL) ? pOD->pz_DisablePfx : "false"); continue; } /* * If the argument type is numeric, the last arg pointer * is really the VALUE of the string that was pointed to. */ if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_NUMERIC) { printf(zOptNumFmt, pOpts->pzPROGNAME, pOD->pz_NAME, (int)pOD->optArg.argInt); continue; } /* * If the argument type is an enumeration, then it is much * like a text value, except we call the callback function * to emit the value corresponding to the "optArg" number. */ if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_ENUMERATION) { print_enumeration(pOpts, pOD); continue; } /* * If the argument type is numeric, the last arg pointer * is really the VALUE of the string that was pointed to. */ if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_BOOLEAN) { printf(zFullOptFmt, pOpts->pzPROGNAME, pOD->pz_NAME, (pOD->optArg.argBool == 0) ? "false" : "true"); continue; } /* * IF the option has an empty value, * THEN we set the argument to the occurrence count. */ if ( (pOD->optArg.argString == NULL) || (pOD->optArg.argString[0] == NUL) ) { printf(zOptNumFmt, pOpts->pzPROGNAME, pOD->pz_NAME, pOD->optOccCt); continue; } /* * This option has a text value */ printf(zOptValFmt, pOpts->pzPROGNAME, pOD->pz_NAME); print_quot_str(pOD->optArg.argString); printf(zOptEnd, pOpts->pzPROGNAME, pOD->pz_NAME); } while (++optIx < pOpts->presetOptCt ); if ( ((pOpts->fOptSet & OPTPROC_REORDER) != 0) && (pOpts->curOptIdx < pOpts->origArgCt)) print_reordering(pOpts); fflush(stdout); } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/putshell.c */ ntp-4.2.6p5/sntp/libopts/value-type.h0000644000175000017500000000123011564122254016513 0ustar peterpeter/* * Generated header for gperf generated source Fri Apr 29 15:43:59 PDT 2011 * This file enumerates the list of names and declares the * procedure for mapping string names to the enum value. */ #ifndef AUTOOPTS_VALUE_TYPE_H_GUARD #define AUTOOPTS_VALUE_TYPE_H_GUARD 1 typedef enum { VTP_KWD_INVALID, VTP_KWD_STRING, VTP_KWD_INTEGER, VTP_KWD_BOOLEAN, VTP_KWD_BOOL, VTP_KWD_KEYWORD, VTP_KWD_SET, VTP_KWD_SET_MEMBERSHIP, VTP_KWD_NESTED, VTP_KWD_HIERARCHY, VTP_COUNT_KWD } value_type_enum_t; extern value_type_enum_t find_value_type_id(char const * str, unsigned int len); #endif /* AUTOOPTS_VALUE_TYPE_H_GUARD */ ntp-4.2.6p5/sntp/libopts/xat-attribute.c0000644000175000017500000000661711474355436017240 0ustar peterpeter/* ANSI-C code produced by gperf version 3.0.4 */ #if 0 /* gperf build options: */ // %struct-type // %language=ANSI-C // %includes // %global-table // %omit-struct-type // %readonly-tables // %compare-strncmp // // %define slot-name xat_name // %define hash-function-name xat_attribute_hash // %define lookup-function-name find_xat_attribute_name // %define word-array-name xat_attribute_table // %define initializer-suffix ,XAT_COUNT_KWD #endif /* gperf build options: */ #include "xat-attribute.h" typedef struct { char const * xat_name; xat_attribute_enum_t xat_id; } xat_attribute_map_t; #include /* maximum key range = 9, duplicates = 0 */ #ifdef __GNUC__ #else #ifdef __cplusplus #endif #endif inline static unsigned int xat_attribute_hash (register const char *str, register unsigned int len) { static const unsigned char asso_values[] = { 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0, 13, 13, 13, 13, 13, 5, 13, 5, 13, 0, 13, 13, 13, 13, 13, 13, 0, 0, 13, 0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13 }; return len + asso_values[(unsigned char)str[0]]; } static const xat_attribute_map_t xat_attribute_table[] = { {"",XAT_COUNT_KWD}, {"",XAT_COUNT_KWD}, {"",XAT_COUNT_KWD}, {"",XAT_COUNT_KWD}, {"type", XAT_KWD_TYPE}, {"words", XAT_KWD_WORDS}, {"cooked", XAT_KWD_COOKED}, {"members", XAT_KWD_MEMBERS}, {"uncooked", XAT_KWD_UNCOOKED}, {"keep", XAT_KWD_KEEP}, {"",XAT_COUNT_KWD}, {"",XAT_COUNT_KWD}, {"invalid", XAT_KWD_INVALID} }; #ifdef __GNUC__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ __attribute__ ((__gnu_inline__)) #endif #endif static inline const xat_attribute_map_t * find_xat_attribute_name (register const char *str, register unsigned int len) { if (len <= 8 && len >= 4) { register int key = xat_attribute_hash (str, len); if (key <= 12 && key >= 0) { register const char *s = xat_attribute_table[key].xat_name; if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0') return &xat_attribute_table[key]; } } return 0; } xat_attribute_enum_t find_xat_attribute_id(char const * str, unsigned int len) { const xat_attribute_map_t * p = find_xat_attribute_name(str, len); return (p == 0) ? XAT_KWD_INVALID : p->xat_id; } ntp-4.2.6p5/sntp/libopts/compat/0000755000175000017500000000000011675461360015545 5ustar peterpeterntp-4.2.6p5/sntp/libopts/compat/pathfind.c0000644000175000017500000002162511474355436017517 0ustar peterpeter/* -*- Mode: C -*- */ /* pathfind.c --- find a FILE MODE along PATH */ /* * Author: Gary V Vaughan * Time-stamp: "2010-07-17 09:50:32 bkorb" */ /* Code: */ #include "compat.h" #ifndef HAVE_PATHFIND #if defined(__windows__) && !defined(__CYGWIN__) char* pathfind( char const* path, char const* fileName, char const* mode ) { return NULL; } #else static char* make_absolute( char const *string, char const *dot_path ); static char* canonicalize_pathname( char *path ); static char* extract_colon_unit( char* dir, char const *string, int *p_index ); /*=export_func pathfind * * what: fild a file in a list of directories * * ifndef: HAVE_PATHFIND * * arg: + char const* + path + colon separated list of search directories + * arg: + char const* + file + the name of the file to look for + * arg: + char const* + mode + the mode bits that must be set to match + * * ret_type: char* * ret_desc: the path to the located file * * doc: * * pathfind looks for a a file with name "FILE" and "MODE" access * along colon delimited "PATH", and returns the full pathname as a * string, or NULL if not found. If "FILE" contains a slash, then * it is treated as a relative or absolute path and "PATH" is ignored. * * @strong{NOTE}: this function is compiled into @file{libopts} only if * it is not natively supplied. * * The "MODE" argument is a string of option letters chosen from the * list below: * @example * Letter Meaning * r readable * w writable * x executable * f normal file (NOT IMPLEMENTED) * b block special (NOT IMPLEMENTED) * c character special (NOT IMPLEMENTED) * d directory (NOT IMPLEMENTED) * p FIFO (pipe) (NOT IMPLEMENTED) * u set user ID bit (NOT IMPLEMENTED) * g set group ID bit (NOT IMPLEMENTED) * k sticky bit (NOT IMPLEMENTED) * s size nonzero (NOT IMPLEMENTED) * @end example * * example: * To find the "ls" command using the "PATH" environment variable: * @example * #include * char* pz_ls = pathfind( getenv("PATH"), "ls", "rx" ); * <> * free( pz_ls ); * @end example * The path is allocated with @code{malloc(3C)}, so you must @code{free(3C)} * the result. Also, do not use unimplemented file modes. :-) * * err: returns NULL if the file is not found. =*/ char* pathfind( char const* path, char const* fileName, char const* mode ) { int p_index = 0; int mode_bits = 0; char* pathName = NULL; char zPath[ AG_PATH_MAX + 1 ]; if (strchr( mode, 'r' )) mode_bits |= R_OK; if (strchr( mode, 'w' )) mode_bits |= W_OK; if (strchr( mode, 'x' )) mode_bits |= X_OK; /* * FOR each non-null entry in the colon-separated path, DO ... */ for (;;) { DIR* dirP; char* colon_unit = extract_colon_unit( zPath, path, &p_index ); /* * IF no more entries, THEN quit */ if (colon_unit == NULL) break; dirP = opendir( colon_unit ); /* * IF the directory is inaccessable, THEN next directory */ if (dirP == NULL) continue; /* * FOR every entry in the given directory, ... */ for (;;) { struct dirent *entP = readdir( dirP ); if (entP == (struct dirent*)NULL) break; /* * IF the file name matches the one we are looking for, ... */ if (strcmp( entP->d_name, fileName ) == 0) { char* pzFullName = make_absolute( fileName, colon_unit); /* * Make sure we can access it in the way we want */ if (access( pzFullName, mode_bits ) >= 0) { /* * We can, so normalize the name and return it below */ pathName = canonicalize_pathname( pzFullName ); } free( (void*)pzFullName ); break; } } closedir( dirP ); if (pathName != NULL) break; } return pathName; } /* * Turn STRING (a pathname) into an absolute pathname, assuming that * DOT_PATH contains the symbolic location of `.'. This always returns * a new string, even if STRING was an absolute pathname to begin with. */ static char* make_absolute( char const *string, char const *dot_path ) { char *result; int result_len; if (!dot_path || *string == '/') { result = strdup( string ); } else { if (dot_path && dot_path[0]) { result = malloc( 2 + strlen( dot_path ) + strlen( string ) ); strcpy( result, dot_path ); result_len = strlen( result ); if (result[result_len - 1] != '/') { result[result_len++] = '/'; result[result_len] = '\0'; } } else { result = malloc( 3 + strlen( string ) ); result[0] = '.'; result[1] = '/'; result[2] = '\0'; result_len = 2; } strcpy( result + result_len, string ); } return result; } /* * Canonicalize PATH, and return a new path. The new path differs from * PATH in that: * * Multiple `/'s are collapsed to a single `/'. * Leading `./'s are removed. * Trailing `/.'s are removed. * Trailing `/'s are removed. * Non-leading `../'s and trailing `..'s are handled by removing * portions of the path. */ static char* canonicalize_pathname( char *path ) { int i, start; char stub_char, *result; /* The result cannot be larger than the input PATH. */ result = strdup( path ); stub_char = (*path == '/') ? '/' : '.'; /* Walk along RESULT looking for things to compact. */ i = 0; while (result[i]) { while (result[i] != '\0' && result[i] != '/') i++; start = i++; /* If we didn't find any slashes, then there is nothing left to * do. */ if (!result[start]) break; /* Handle multiple `/'s in a row. */ while (result[i] == '/') i++; #if !defined (apollo) if ((start + 1) != i) #else if ((start + 1) != i && (start != 0 || i != 2)) #endif /* apollo */ { strcpy( result + start + 1, result + i ); i = start + 1; } /* Handle backquoted `/'. */ if (start > 0 && result[start - 1] == '\\') continue; /* Check for trailing `/', and `.' by itself. */ if ((start && !result[i]) || (result[i] == '.' && !result[i+1])) { result[--i] = '\0'; break; } /* Check for `../', `./' or trailing `.' by itself. */ if (result[i] == '.') { /* Handle `./'. */ if (result[i + 1] == '/') { strcpy( result + i, result + i + 1 ); i = (start < 0) ? 0 : start; continue; } /* Handle `../' or trailing `..' by itself. */ if (result[i + 1] == '.' && (result[i + 2] == '/' || !result[i + 2])) { while (--start > -1 && result[start] != '/') ; strcpy( result + start + 1, result + i + 2 ); i = (start < 0) ? 0 : start; continue; } } } if (!*result) { *result = stub_char; result[1] = '\0'; } return result; } /* * Given a string containing units of information separated by colons, * return the next one pointed to by (P_INDEX), or NULL if there are no * more. Advance (P_INDEX) to the character after the colon. */ static char* extract_colon_unit( char* pzDir, char const *string, int *p_index ) { char* pzDest = pzDir; int ix = *p_index; if (string == NULL) return NULL; if ((unsigned)ix >= strlen( string )) return NULL; { char const* pzSrc = string + ix; while (*pzSrc == ':') pzSrc++; for (;;) { char ch = (*(pzDest++) = *(pzSrc++)); switch (ch) { case ':': pzDest[-1] = NUL; case NUL: goto copy_done; } if ((pzDest - pzDir) >= AG_PATH_MAX) break; } copy_done:; ix = pzSrc - string; } if (*pzDir == NUL) return NULL; *p_index = ix; return pzDir; } #endif /* __windows__ / __CYGWIN__ */ #endif /* HAVE_PATHFIND */ /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of compat/pathfind.c */ ntp-4.2.6p5/sntp/libopts/compat/compat.h0000644000175000017500000002222411564122255017175 0ustar peterpeter/* -*- Mode: C -*- */ /** * \file compat.h --- fake the preprocessor into handlng portability * * Time-stamp: "2010-07-16 15:11:57 bkorb" * * compat.h is free software. * This file is part of AutoGen. * * AutoGen Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoGen 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. * * AutoGen 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 . * * As a special exception, Bruce Korb gives permission for additional * uses of the text contained in the release of compat.h. * * The exception is that, if you link the compat.h library with other * files to produce an executable, this does not by itself cause the * resulting executable to be covered by the GNU General Public License. * Your use of that executable is in no way restricted on account of * linking the compat.h library code into it. * * This exception does not however invalidate any other reasons why * the executable file might be covered by the GNU General Public License. * * This exception applies only to the code released by Bruce Korb under * the name compat.h. If you copy code from other sources under the * General Public License into a copy of compat.h, as the General Public * License permits, the exception does not apply to the code that you add * in this way. To avoid misleading anyone as to the status of such * modified files, you must delete this exception notice from them. * * If you write modifications of your own for compat.h, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */ #ifndef COMPAT_H_GUARD #define COMPAT_H_GUARD 1 #if defined(HAVE_CONFIG_H) # include #elif defined(_WIN32) && !defined(__CYGWIN__) # include "windows-config.h" #else # error "compat.h" requires "config.h" choke me. #endif #ifndef HAVE_STRSIGNAL char * strsignal( int signo ); #endif #define _GNU_SOURCE 1 /* for strsignal in GNU's libc */ #define __USE_GNU 1 /* exact same thing as above */ #define __EXTENSIONS__ 1 /* and another way to call for it */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * SYSTEM HEADERS: */ #include #ifdef HAVE_SYS_MMAN_H # include #endif #include #if HAVE_SYS_PROCSET_H # include #endif #include #include #if defined( HAVE_SOLARIS_SYSINFO ) # include #elif defined( HAVE_UNAME_SYSCALL ) # include #endif #ifdef DAEMON_ENABLED # if HAVE_SYS_STROPTS_H # include # endif # if HAVE_SYS_SOCKET_H # include # endif # if ! defined(HAVE_SYS_POLL_H) && ! defined(HAVE_SYS_SELECT_H) # error This system cannot support daemon processing Choke Me. # endif # if HAVE_SYS_POLL_H # include # endif # if HAVE_SYS_SELECT_H # include # endif # if HAVE_NETINET_IN_H # include # endif # if HAVE_SYS_UN_H # include # endif #endif /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * USER HEADERS: */ #include #include #include /* * Directory opening stuff: */ # if defined (_POSIX_SOURCE) /* Posix does not require that the d_ino field be present, and some systems do not provide it. */ # define REAL_DIR_ENTRY(dp) 1 # else /* !_POSIX_SOURCE */ # define REAL_DIR_ENTRY(dp) (dp->d_ino != 0) # endif /* !_POSIX_SOURCE */ # if defined (HAVE_DIRENT_H) # include # define D_NAMLEN(dirent) strlen((dirent)->d_name) # else /* !HAVE_DIRENT_H */ # define dirent direct # define D_NAMLEN(dirent) (dirent)->d_namlen # if defined (HAVE_SYS_NDIR_H) # include # endif /* HAVE_SYS_NDIR_H */ # if defined (HAVE_SYS_DIR_H) # include # endif /* HAVE_SYS_DIR_H */ # if defined (HAVE_NDIR_H) # include # endif /* HAVE_NDIR_H */ # endif /* !HAVE_DIRENT_H */ #include #ifdef HAVE_FCNTL_H # include #endif #ifndef O_NONBLOCK # define O_NONBLOCK FNDELAY #endif #if defined(HAVE_LIBGEN) && defined(HAVE_LIBGEN_H) # include #endif #if defined(HAVE_LIMITS_H) /* this is also in options.h */ # include #elif defined(HAVE_SYS_LIMITS_H) # include #endif /* HAVE_LIMITS/SYS_LIMITS_H */ #include #include #include #if defined( HAVE_STDINT_H ) # include #elif defined( HAVE_INTTYPES_H ) # include #endif #include #include #include #ifdef HAVE_UTIME_H # include #endif #ifdef HAVE_UNISTD_H # include #endif /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * FIXUPS and CONVIENCE STUFF: */ #ifdef __cplusplus # define EXTERN extern "C" #else # define EXTERN extern #endif /* some systems #def errno! and others do not declare it!! */ #ifndef errno extern int errno; #endif /* Some machines forget this! */ # ifndef EXIT_FAILURE # define EXIT_SUCCESS 0 # define EXIT_FAILURE 1 # endif #ifndef NUL # define NUL '\0' #endif #ifndef NULL # define NULL 0 #endif #if !defined (MAXPATHLEN) && defined (HAVE_SYS_PARAM_H) # include #endif /* !MAXPATHLEN && HAVE_SYS_PARAM_H */ #if !defined (MAXPATHLEN) && defined (PATH_MAX) # define MAXPATHLEN PATH_MAX #endif /* !MAXPATHLEN && PATH_MAX */ #if !defined (MAXPATHLEN) && defined(_MAX_PATH) # define PATH_MAX _MAX_PATH # define MAXPATHLEN _MAX_PATH #endif #if !defined (MAXPATHLEN) # define MAXPATHLEN ((size_t)4096) #endif /* MAXPATHLEN */ #define AG_PATH_MAX ((size_t)MAXPATHLEN) #ifndef LONG_MAX # define LONG_MAX ~(1L << (8*sizeof(long) -1)) # define INT_MAX ~(1 << (8*sizeof(int) -1)) #endif #ifndef ULONG_MAX # define ULONG_MAX ~(OUL) # define UINT_MAX ~(OU) #endif #ifndef SHORT_MAX # define SHORT_MAX ~(1 << (8*sizeof(short) - 1)) #else # define USHORT_MAX ~(OUS) #endif #ifndef HAVE_INT8_T typedef signed char int8_t; # define HAVE_INT8_T 1 #endif #ifndef HAVE_UINT8_T typedef unsigned char uint8_t; # define HAVE_UINT8_T 1 #endif #ifndef HAVE_INT16_T typedef signed short int16_t; # define HAVE_INT16_T 1 #endif #ifndef HAVE_UINT16_T typedef unsigned short uint16_t; # define HAVE_UINT16_T 1 #endif #ifndef HAVE_INT32_T # if SIZEOF_INT == 4 typedef signed int int32_t; # elif SIZEOF_LONG == 4 typedef signed long int32_t; # endif # define HAVE_INT32_T 1 #endif #ifndef HAVE_UINT32_T # if SIZEOF_INT == 4 typedef unsigned int uint32_t; # elif SIZEOF_LONG == 4 typedef unsigned long uint32_t; # else # error Cannot create a uint32_t type. Choke Me. # endif # define HAVE_UINT32_T 1 #endif #ifndef HAVE_INTPTR_T # if SIZEOF_CHARP == SIZEOF_LONG typedef signed long intptr_t; # else typedef signed int intptr_t; # endif # define HAVE_INTPTR_T 1 #endif #ifndef HAVE_UINTPTR_T # if SIZEOF_CHARP == SIZEOF_LONG typedef unsigned long intptr_t; # else typedef unsigned int intptr_t; # endif # define HAVE_INTPTR_T 1 #endif #ifndef HAVE_UINT_T typedef unsigned int uint_t; # define HAVE_UINT_T 1 #endif #ifndef HAVE_SIZE_T typedef unsigned int size_t; # define HAVE_SIZE_T 1 #endif #ifndef HAVE_WINT_T typedef unsigned int wint_t; # define HAVE_WINT_T 1 #endif #ifndef HAVE_PID_T typedef signed int pid_t; # define HAVE_PID_T 1 #endif /* redefine these for BSD style string libraries */ #ifndef HAVE_STRCHR # define strchr index # define strrchr rindex #endif #ifdef USE_FOPEN_BINARY # ifndef FOPEN_BINARY_FLAG # define FOPEN_BINARY_FLAG "b" # endif # ifndef FOPEN_TEXT_FLAG # define FOPEN_TEXT_FLAG "t" # endif #else # ifndef FOPEN_BINARY_FLAG # define FOPEN_BINARY_FLAG # endif # ifndef FOPEN_TEXT_FLAG # define FOPEN_TEXT_FLAG # endif #endif #ifndef STR # define _STR(s) #s # define STR(s) _STR(s) #endif /* ##### Pointer sized word ##### */ /* FIXME: the MAX stuff in here is broken! */ #if SIZEOF_CHARP > SIZEOF_INT typedef long t_word; #define WORD_MAX LONG_MAX #define WORD_MIN LONG_MIN #else /* SIZEOF_CHARP <= SIZEOF_INT */ typedef int t_word; #define WORD_MAX INT_MAX #define WORD_MIN INT_MIN #endif #endif /* COMPAT_H_GUARD */ /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of compat/compat.h */ ntp-4.2.6p5/sntp/libopts/compat/snprintf.c0000644000175000017500000000225311307651616017553 0ustar peterpeter #ifndef HAVE_VPRINTF #include "choke-me: no vprintf and no snprintf" #endif #if defined(HAVE_STDARG_H) # include # ifndef VA_START # define VA_START(a, f) va_start(a, f) # define VA_END(a) va_end(a) # endif /* VA_START */ # define SNV_USING_STDARG_H #elif defined(HAVE_VARARGS_H) # include # ifndef VA_START # define VA_START(a, f) va_start(a) # define VA_END(a) va_end(a) # endif /* VA_START */ # undef SNV_USING_STDARG_H #else # include "must-have-stdarg-or-varargs" #endif static int snprintf(char *str, size_t n, char const *fmt, ...) { va_list ap; int rval; #ifdef VSPRINTF_CHARSTAR char *rp; VA_START(ap, fmt); rp = vsprintf(str, fmt, ap); VA_END(ap); rval = strlen(rp); #else VA_START(ap, fmt); rval = vsprintf(str, fmt, ap); VA_END(ap); #endif if (rval > n) { fprintf(stderr, "snprintf buffer overrun %d > %d\n", rval, (int)n); abort(); } return rval; } static int vsnprintf( char *str, size_t n, char const *fmt, va_list ap ) { #ifdef VSPRINTF_CHARSTAR return (strlen(vsprintf(str, fmt, ap))); #else return (vsprintf(str, fmt, ap)); #endif } ntp-4.2.6p5/sntp/libopts/compat/strdup.c0000644000175000017500000000041611307651616017230 0ustar peterpeter/* * Platforms without strdup ?!?!?! */ static char * strdup( char const *s ) { char *cp; if (s == NULL) return NULL; cp = (char *) AGALOC((unsigned) (strlen(s)+1), "strdup"); if (cp != NULL) (void) strcpy(cp, s); return cp; } ntp-4.2.6p5/sntp/libopts/compat/strchr.c0000644000175000017500000000227711307651616017223 0ustar peterpeter/* SYNOPSIS #include char *strchr(char const *s, int c); char *strrchr(char const *s, int c); DESCRIPTION The strchr() function returns a pointer to the first occurrence of the character c in the string s. The strrchr() function returns a pointer to the last occurrence of the character c in the string s. Here "character" means "byte" - these functions do not work with wide or multi-byte characters. RETURN VALUE The strchr() and strrchr() functions return a pointer to the matched character or NULL if the character is not found. CONFORMING TO SVID 3, POSIX, BSD 4.3, ISO 9899 */ char* strchr( char const *s, int c) { do { if ((unsigned)*s == (unsigned)c) return s; } while (*(++s) != NUL); return NULL; } char* strrchr( char const *s, int c) { char const *e = s + strlen(s); for (;;) { if (--e < s) break; if ((unsigned)*e == (unsigned)c) return e; } return NULL; } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of compat/strsignal.c */ ntp-4.2.6p5/sntp/libopts/compat/windows-config.h0000644000175000017500000000712111564122253020644 0ustar peterpeter /* * Time-stamp: "2010-02-24 08:39:04 bkorb" * * This file is part of AutoGen. * * AutoGen Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoGen 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. * * AutoGen 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 . */ #ifndef WINDOWS_CONFIG_HACKERY #define WINDOWS_CONFIG_HACKERY 1 /* * The definitions below have been stolen from NTP's config.h for Windows. * However, they may be kept here in order to keep libopts independent from * the NTP project. */ #ifndef __windows__ # define __windows__ 4 #endif /* * Miscellaneous functions that Microsoft maps * to other names * * #define inline __inline * #define vsnprintf _vsnprintf */ #define snprintf _snprintf /* * #define stricmp _stricmp * #define strcasecmp _stricmp * #define isascii __isascii * #define finite _finite * #define random rand * #define srandom srand */ #define SIZEOF_INT 4 #define SIZEOF_CHARP 4 #define SIZEOF_LONG 4 #define SIZEOF_SHORT 2 typedef unsigned long uintptr_t; /* * # define HAVE_NET_IF_H * # define QSORT_USES_VOID_P * # define HAVE_SETVBUF * # define HAVE_VSPRINTF * # define HAVE_SNPRINTF * # define HAVE_VSNPRINTF * # define HAVE_PROTOTYPES /* from ntpq.mak * / * # define HAVE_MEMMOVE * # define HAVE_TERMIOS_H * # define HAVE_ERRNO_H * # define HAVE_STDARG_H * # define HAVE_NO_NICE * # define HAVE_MKTIME * # define TIME_WITH_SYS_TIME * # define HAVE_IO_COMPLETION_PORT * # define ISC_PLATFORM_NEEDNTOP * # define ISC_PLATFORM_NEEDPTON * # define NEED_S_CHAR_TYPEDEF * # define USE_PROTOTYPES /* for ntp_types.h * / * * #define ULONG_CONST(a) a ## UL */ #define HAVE_LIMITS_H 1 #define HAVE_STRDUP 1 #define HAVE_STRCHR 1 #define HAVE_FCNTL_H 1 /* * VS.NET's version of wspiapi.h has a bug in it * where it assigns a value to a variable inside * an if statement. It should be comparing them. * We prevent inclusion since we are not using this * code so we don't have to see the warning messages */ #ifndef _WSPIAPI_H_ #define _WSPIAPI_H_ #endif /* Prevent inclusion of winsock.h in windows.h */ #ifndef _WINSOCKAPI_ #define _WINSOCKAPI_ #endif #ifndef __RPCASYNC_H__ #define __RPCASYNC_H__ #endif /* Include Windows headers */ #include #include #include /* * Compatibility declarations for Windows, assuming SYS_WINNT * has been defined. */ #define strdup _strdup #define stat _stat /* struct stat from */ #define unlink _unlink #define fchmod( _x, _y ); #define ssize_t SSIZE_T #include #define open _open #define close _close #define read _read #define write _write #define lseek _lseek #define pipe _pipe #define dup2 _dup2 #define O_RDWR _O_RDWR #define O_RDONLY _O_RDONLY #define O_EXCL _O_EXCL #ifndef S_ISREG # define S_IFREG _S_IFREG # define S_ISREG(mode) (((mode) & S_IFREG) == S_IFREG) #endif #ifndef S_ISDIR # define S_IFDIR _S_IFDIR # define S_ISDIR(mode) (((mode) & S_IFDIR) == S_IFDIR) #endif #endif /* WINDOWS_CONFIG_HACKERY */ ntp-4.2.6p5/sntp/libopts/libopts.c0000644000175000017500000000165111564122254016076 0ustar peterpeter#include "autoopts/project.h" #define AUTOOPTS_INTERNAL 1 #include "compat/compat.h" #define LOCAL static #include "autoopts/options.h" #include "autoopts/usage-txt.h" #include "genshell.h" #include "xat-attribute.h" #include "value-type.h" #include "ag-char-map.h" #include "autoopts.h" #include "proto.h" #include "parse-duration.h" #include "parse-duration.c" #include "value-type.c" #include "xat-attribute.c" #include "autoopts.c" #include "boolean.c" #include "configfile.c" #include "cook.c" #include "enumeration.c" #include "environment.c" #include "file.c" #include "genshell.c" #include "load.c" #include "makeshell.c" #include "nested.c" #include "numeric.c" #include "pgusage.c" #include "putshell.c" #include "reset.c" #include "restore.c" #include "save.c" #include "sort.c" #include "stack.c" #include "streqvcmp.c" #include "text_mmap.c" #include "tokenize.c" #include "time.c" #include "usage.c" #include "version.c" ntp-4.2.6p5/sntp/libopts/parse-duration.h0000644000175000017500000000646011564122254017367 0ustar peterpeter/* Parse a time duration and return a seconds count Copyright (C) 2008-2011 Free Software Foundation, Inc. Written by Bruce Korb , 2008. 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 . */ /* Readers and users of this function are referred to the ISO-8601 specification, with particular attention to "Durations". At the time of writing, this worked: http://en.wikipedia.org/wiki/ISO_8601#Durations The string must start with a 'P', 'T' or a digit. ==== if it is a digit the string may contain: NNN Y NNN M NNN W NNN d NNN h NNN m NNN s This represents NNN years, NNN months, NNN weeks, NNN days, NNN hours, NNN minutes and NNN seconds. The embeded white space is optional. These terms must appear in this order. Case is significant: 'M' is months and 'm' is minutes. The final "s" is optional. All of the terms ("NNN" plus designator) are optional. Minutes and seconds may optionally be represented as NNN:NNN. Also, hours, minute and seconds may be represented as NNN:NNN:NNN. There is no limitation on the value of any of the terms, except that the final result must fit in a time_t value. ==== if it is a 'P' or 'T', please see ISO-8601 for a rigorous definition. The 'P' term may be followed by any of three formats: yyyymmdd yy-mm-dd yy Y mm M ww W dd D or it may be empty and followed by a 'T'. The "yyyymmdd" must be eight digits long. NOTE! Months are always 30 days and years are always 365 days long. 5 years is always 1825 days, not 1826 or 1827 depending on leap year considerations. 3 months is always 90 days. There is no consideration for how many days are in the current, next or previous months. For the final format: * Embedded white space is allowed, but it is optional. * All of the terms are optional. Any or all-but-one may be omitted. * The meanings are yy years, mm months, ww weeks and dd days. * The terms must appear in this order. ==== The 'T' term may be followed by any of these formats: hhmmss hh:mm:ss hh H mm M ss S For the final format: * Embedded white space is allowed, but it is optional. * All of the terms are optional. Any or all-but-one may be omitted. * The terms must appear in this order. */ #ifndef GNULIB_PARSE_DURATION_H #define GNULIB_PARSE_DURATION_H #include /* Return value when a valid duration cannot be parsed. */ #define BAD_TIME ((time_t)~0) /* Parses the given string. If it has the syntax of a valid duration, this duration is returned. Otherwise, the return value is BAD_TIME, and errno is set to either EINVAL (bad syntax) or ERANGE (out of range). */ extern time_t parse_duration (char const * in_pz); #endif /* GNULIB_PARSE_DURATION_H */ ntp-4.2.6p5/sntp/libopts/MakeDefs.inc0000644000175000017500000000000011307651616016417 0ustar peterpeterntp-4.2.6p5/sntp/libopts/xat-attribute.h0000644000175000017500000000114311564122255017221 0ustar peterpeter/* * Generated header for gperf generated source Fri Apr 29 15:43:59 PDT 2011 * This file enumerates the list of names and declares the * procedure for mapping string names to the enum value. */ #ifndef AUTOOPTS_XAT_ATTRIBUTE_H_GUARD #define AUTOOPTS_XAT_ATTRIBUTE_H_GUARD 1 typedef enum { XAT_KWD_INVALID, XAT_KWD_TYPE, XAT_KWD_WORDS, XAT_KWD_MEMBERS, XAT_KWD_COOKED, XAT_KWD_UNCOOKED, XAT_KWD_KEEP, XAT_COUNT_KWD } xat_attribute_enum_t; extern xat_attribute_enum_t find_xat_attribute_id(char const * str, unsigned int len); #endif /* AUTOOPTS_XAT_ATTRIBUTE_H_GUARD */ ntp-4.2.6p5/sntp/libopts/value-type.c0000644000175000017500000000720511474355436016530 0ustar peterpeter/* ANSI-C code produced by gperf version 3.0.4 */ #if 0 /* gperf build options: */ // %struct-type // %language=ANSI-C // %includes // %global-table // %omit-struct-type // %readonly-tables // %compare-strncmp // // %define slot-name vtp_name // %define hash-function-name value_type_hash // %define lookup-function-name find_value_type_name // %define word-array-name value_type_table // %define initializer-suffix ,VTP_COUNT_KWD #endif /* gperf build options: */ #include "value-type.h" typedef struct { char const * vtp_name; value_type_enum_t vtp_id; } value_type_map_t; #include /* maximum key range = 20, duplicates = 0 */ #ifdef __GNUC__ #else #ifdef __cplusplus #endif #endif inline static unsigned int value_type_hash (register const char *str, register unsigned int len) { static const unsigned char asso_values[] = { 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 10, 23, 23, 23, 23, 23, 23, 23, 23, 23, 5, 23, 23, 5, 0, 0, 23, 15, 23, 23, 10, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23 }; return len + asso_values[(unsigned char)str[2]]; } static const value_type_map_t value_type_table[] = { {"",VTP_COUNT_KWD}, {"",VTP_COUNT_KWD}, {"",VTP_COUNT_KWD}, {"set", VTP_KWD_SET}, {"",VTP_COUNT_KWD}, {"",VTP_COUNT_KWD}, {"nested", VTP_KWD_NESTED}, {"integer", VTP_KWD_INTEGER}, {"",VTP_COUNT_KWD}, {"bool", VTP_KWD_BOOL}, {"",VTP_COUNT_KWD}, {"string", VTP_KWD_STRING}, {"boolean", VTP_KWD_BOOLEAN}, {"",VTP_COUNT_KWD}, {"set-membership", VTP_KWD_SET_MEMBERSHIP}, {"",VTP_COUNT_KWD}, {"",VTP_COUNT_KWD}, {"keyword", VTP_KWD_KEYWORD}, {"",VTP_COUNT_KWD}, {"hierarchy", VTP_KWD_HIERARCHY}, {"",VTP_COUNT_KWD}, {"",VTP_COUNT_KWD}, {"invalid", VTP_KWD_INVALID} }; #ifdef __GNUC__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ __attribute__ ((__gnu_inline__)) #endif #endif static inline const value_type_map_t * find_value_type_name (register const char *str, register unsigned int len) { if (len <= 14 && len >= 3) { register int key = value_type_hash (str, len); if (key <= 22 && key >= 0) { register const char *s = value_type_table[key].vtp_name; if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0') return &value_type_table[key]; } } return 0; } value_type_enum_t find_value_type_id(char const * str, unsigned int len) { const value_type_map_t * p = find_value_type_name(str, len); return (p == 0) ? VTP_KWD_INVALID : p->vtp_id; } ntp-4.2.6p5/sntp/libopts/sort.c0000644000175000017500000002340211564122254015407 0ustar peterpeter /* * \file sort.c * * Time-stamp: "2010-07-17 10:34:15 bkorb" * * This module implements argument sorting. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ /* = = = START-STATIC-FORWARD = = = */ static tSuccess mustHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, char** ppzOpts, int* pOptsIdx); static tSuccess mayHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, char** ppzOpts, int* pOptsIdx); static tSuccess checkShortOpts(tOptions* pOpts, char* pzArg, tOptState* pOS, char** ppzOpts, int* pOptsIdx); /* = = = END-STATIC-FORWARD = = = */ /* * "mustHandleArg" and "mayHandleArg" are really similar. The biggest * difference is that "may" will consume the next argument only if it * does not start with a hyphen and "must" will consume it, hyphen or not. */ static tSuccess mustHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, char** ppzOpts, int* pOptsIdx) { /* * An option argument is required. Long options can either have * a separate command line argument, or an argument attached by * the '=' character. Figure out which. */ switch (pOS->optType) { case TOPT_SHORT: /* * See if an arg string follows the flag character. If not, * the next arg must be the option argument. */ if (*pzArg != NUL) return SUCCESS; break; case TOPT_LONG: /* * See if an arg string has already been assigned (glued on * with an `=' character). If not, the next is the opt arg. */ if (pOS->pzOptArg != NULL) return SUCCESS; break; default: return FAILURE; } if (pOpts->curOptIdx >= pOpts->origArgCt) return FAILURE; ppzOpts[ (*pOptsIdx)++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; return SUCCESS; } static tSuccess mayHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, char** ppzOpts, int* pOptsIdx) { /* * An option argument is optional. */ switch (pOS->optType) { case TOPT_SHORT: /* * IF nothing is glued on after the current flag character, * THEN see if there is another argument. If so and if it * does *NOT* start with a hyphen, then it is the option arg. */ if (*pzArg != NUL) return SUCCESS; break; case TOPT_LONG: /* * Look for an argument if we don't already have one (glued on * with a `=' character) */ if (pOS->pzOptArg != NULL) return SUCCESS; break; default: return FAILURE; } if (pOpts->curOptIdx >= pOpts->origArgCt) return PROBLEM; pzArg = pOpts->origArgVect[ pOpts->curOptIdx ]; if (*pzArg != '-') ppzOpts[ (*pOptsIdx)++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; return SUCCESS; } /* * Process a string of short options glued together. If the last one * does or may take an argument, the do the argument processing and leave. */ static tSuccess checkShortOpts(tOptions* pOpts, char* pzArg, tOptState* pOS, char** ppzOpts, int* pOptsIdx) { while (*pzArg != NUL) { if (FAILED(shortOptionFind(pOpts, (tAoUC)*pzArg, pOS))) return FAILURE; /* * See if we can have an arg. */ if (OPTST_GET_ARGTYPE(pOS->pOD->fOptState) == OPARG_TYPE_NONE) { pzArg++; } else if (pOS->pOD->fOptState & OPTST_ARG_OPTIONAL) { /* * Take an argument if it is not attached and it does not * start with a hyphen. */ if (pzArg[1] != NUL) return SUCCESS; pzArg = pOpts->origArgVect[ pOpts->curOptIdx ]; if (*pzArg != '-') ppzOpts[ (*pOptsIdx)++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; return SUCCESS; } else { /* * IF we need another argument, be sure it is there and * take it. */ if (pzArg[1] == NUL) { if (pOpts->curOptIdx >= pOpts->origArgCt) return FAILURE; ppzOpts[ (*pOptsIdx)++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; } return SUCCESS; } } return SUCCESS; } /* * If the program wants sorted options (separated operands and options), * then this routine will to the trick. */ LOCAL void optionSort(tOptions* pOpts) { char** ppzOpts; char** ppzOpds; int optsIdx = 0; int opdsIdx = 0; tOptState os = OPTSTATE_INITIALIZER(DEFINED); /* * Disable for POSIX conformance, or if there are no operands. */ if ( (getenv("POSIXLY_CORRECT") != NULL) || NAMED_OPTS(pOpts)) return; /* * Make sure we can allocate two full-sized arg vectors. */ ppzOpts = malloc(pOpts->origArgCt * sizeof(char*)); if (ppzOpts == NULL) goto exit_no_mem; ppzOpds = malloc(pOpts->origArgCt * sizeof(char*)); if (ppzOpds == NULL) { free(ppzOpts); goto exit_no_mem; } pOpts->curOptIdx = 1; pOpts->pzCurOpt = NULL; /* * Now, process all the options from our current position onward. * (This allows interspersed options and arguments for the few * non-standard programs that require it.) */ for (;;) { char* pzArg; tSuccess res; /* * If we're out of arguments, we're done. Join the option and * operand lists into the original argument vector. */ if (pOpts->curOptIdx >= pOpts->origArgCt) { errno = 0; goto joinLists; } pzArg = pOpts->origArgVect[ pOpts->curOptIdx ]; if (*pzArg != '-') { ppzOpds[ opdsIdx++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; continue; } switch (pzArg[1]) { case NUL: /* * A single hyphen is an operand. */ ppzOpds[ opdsIdx++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; continue; case '-': /* * Two consecutive hypens. Put them on the options list and then * _always_ force the remainder of the arguments to be operands. */ if (pzArg[2] == NUL) { ppzOpts[ optsIdx++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; goto restOperands; } res = longOptionFind(pOpts, pzArg+2, &os); break; default: /* * If short options are not allowed, then do long * option processing. Otherwise the character must be a * short (i.e. single character) option. */ if ((pOpts->fOptSet & OPTPROC_SHORTOPT) == 0) { res = longOptionFind(pOpts, pzArg+1, &os); } else { res = shortOptionFind(pOpts, (tAoUC)pzArg[1], &os); } break; } if (FAILED(res)) { errno = EINVAL; goto freeTemps; } /* * We've found an option. Add the argument to the option list. * Next, we have to see if we need to pull another argument to be * used as the option argument. */ ppzOpts[ optsIdx++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; if (OPTST_GET_ARGTYPE(os.pOD->fOptState) == OPARG_TYPE_NONE) { /* * No option argument. If we have a short option here, * then scan for short options until we get to the end * of the argument string. */ if ( (os.optType == TOPT_SHORT) && FAILED(checkShortOpts(pOpts, pzArg+2, &os, ppzOpts, &optsIdx)) ) { errno = EINVAL; goto freeTemps; } } else if (os.pOD->fOptState & OPTST_ARG_OPTIONAL) { switch (mayHandleArg(pOpts, pzArg+2, &os, ppzOpts, &optsIdx)) { case FAILURE: errno = EIO; goto freeTemps; case PROBLEM: errno = 0; goto joinLists; } } else { switch (mustHandleArg(pOpts, pzArg+2, &os, ppzOpts, &optsIdx)) { case PROBLEM: case FAILURE: errno = EIO; goto freeTemps; } } } /* for (;;) */ restOperands: while (pOpts->curOptIdx < pOpts->origArgCt) ppzOpds[ opdsIdx++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; joinLists: if (optsIdx > 0) memcpy(pOpts->origArgVect + 1, ppzOpts, optsIdx * sizeof(char*)); if (opdsIdx > 0) memcpy(pOpts->origArgVect + 1 + optsIdx, ppzOpds, opdsIdx * sizeof(char*)); freeTemps: free(ppzOpts); free(ppzOpds); return; exit_no_mem: errno = ENOMEM; return; } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/sort.c */ ntp-4.2.6p5/sntp/libopts/save.c0000644000175000017500000004775411564122254015376 0ustar peterpeter /* * \file save.c * * Time-stamp: "2011-04-06 09:21:44 bkorb" * * This module's routines will take the currently set options and * store them into an ".rc" file for re-interpretation the next * time the invoking program is run. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ static char const zWarn[] = "%s WARNING: cannot save options - "; static char const close_xml[] = "\n"; /* = = = START-STATIC-FORWARD = = = */ static tCC* findDirName(tOptions* pOpts, int* p_free); static char const * findFileName(tOptions * pOpts, int * p_free_name); static void printEntry( FILE * fp, tOptDesc * p, tCC* pzLA ); static void print_a_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp); static void print_a_string(FILE * fp, char const * name, char const * pz); static void printValueList(FILE * fp, char const * name, tArgList * al); static void printHierarchy(FILE * fp, tOptDesc * p); static FILE * openSaveFile(tOptions* pOpts); static void printNoArgOpt(FILE * fp, tOptDesc * p, tOptDesc * pOD); static void printStringArg(FILE * fp, tOptDesc * pOD); static void printEnumArg(FILE * fp, tOptDesc * pOD); static void printSetMemberArg(FILE * fp, tOptDesc * pOD); static void printFileArg(FILE * fp, tOptDesc * pOD, tOptions* pOpts); /* = = = END-STATIC-FORWARD = = = */ static tCC* findDirName(tOptions* pOpts, int* p_free) { tCC* pzDir; if ( (pOpts->specOptIdx.save_opts == NO_EQUIVALENT) || (pOpts->specOptIdx.save_opts == 0)) return NULL; pzDir = pOpts->pOptDesc[ pOpts->specOptIdx.save_opts ].optArg.argString; if ((pzDir != NULL) && (*pzDir != NUL)) return pzDir; /* * This function only works if there is a directory where * we can stash the RC (INI) file. */ { tCC* const* papz = pOpts->papzHomeList; if (papz == NULL) return NULL; while (papz[1] != NULL) papz++; pzDir = *papz; } /* * IF it does not require deciphering an env value, then just copy it */ if (*pzDir != '$') return pzDir; { tCC* pzEndDir = strchr(++pzDir, DIRCH); char* pzFileName; char* pzEnv; if (pzEndDir != NULL) { char z[ AO_NAME_SIZE ]; if ((pzEndDir - pzDir) > AO_NAME_LIMIT ) return NULL; memcpy(z, pzDir, (size_t)(pzEndDir - pzDir)); z[pzEndDir - pzDir] = NUL; pzEnv = getenv(z); } else { /* * Make sure we can get the env value (after stripping off * any trailing directory or file names) */ pzEnv = getenv(pzDir); } if (pzEnv == NULL) { fprintf(stderr, zWarn, pOpts->pzProgName); fprintf(stderr, zNotDef, pzDir); return NULL; } if (pzEndDir == NULL) return pzEnv; { size_t sz = strlen(pzEnv) + strlen(pzEndDir) + 2; pzFileName = (char*)AGALOC(sz, "dir name"); } if (pzFileName == NULL) return NULL; *p_free = 1; /* * Glue together the full name into the allocated memory. * FIXME: We lose track of this memory. */ sprintf(pzFileName, "%s/%s", pzEnv, pzEndDir); return pzFileName; } } static char const * findFileName(tOptions * pOpts, int * p_free_name) { struct stat stBuf; int free_dir_name = 0; char const * pzDir = findDirName(pOpts, &free_dir_name); if (pzDir == NULL) return NULL; /* * See if we can find the specified directory. We use a once-only loop * structure so we can bail out early. */ if (stat(pzDir, &stBuf) != 0) do { char z[AG_PATH_MAX]; char * dirchp; /* * IF we could not, check to see if we got a full * path to a file name that has not been created yet. */ if (errno != ENOENT) { bogus_name: fprintf(stderr, zWarn, pOpts->pzProgName); fprintf(stderr, zNoStat, errno, strerror(errno), pzDir); if (free_dir_name) AGFREE((void*)pzDir); return NULL; } /* * Strip off the last component, stat the remaining string and * that string must name a directory */ dirchp = strrchr(pzDir, DIRCH); if (dirchp == NULL) { stBuf.st_mode = S_IFREG; break; /* found directory -- viz., "." */ } if ((dirchp - pzDir) >= sizeof(z)) goto bogus_name; memcpy(z, pzDir, (size_t)(dirchp - pzDir)); z[dirchp - pzDir] = NUL; if ((stat(z, &stBuf) != 0) || ! S_ISDIR(stBuf.st_mode)) goto bogus_name; stBuf.st_mode = S_IFREG; /* file within this directory */ } while (0); /* * IF what we found was a directory, * THEN tack on the config file name */ if (S_ISDIR(stBuf.st_mode)) { size_t sz = strlen(pzDir) + strlen(pOpts->pzRcName) + 2; { char* pzPath = (char*)AGALOC(sz, "file name"); #ifdef HAVE_SNPRINTF snprintf(pzPath, sz, "%s/%s", pzDir, pOpts->pzRcName); #else sprintf(pzPath, "%s/%s", pzDir, pOpts->pzRcName); #endif if (free_dir_name) AGFREE((void*)pzDir); pzDir = pzPath; free_dir_name = 1; } /* * IF we cannot stat the object for any reason other than * it does not exist, then we bail out */ if (stat(pzDir, &stBuf) != 0) { if (errno != ENOENT) { fprintf(stderr, zWarn, pOpts->pzProgName); fprintf(stderr, zNoStat, errno, strerror(errno), pzDir); AGFREE((void*)pzDir); return NULL; } /* * It does not exist yet, but it will be a regular file */ stBuf.st_mode = S_IFREG; } } /* * Make sure that whatever we ultimately found, that it either is * or will soon be a file. */ if (! S_ISREG(stBuf.st_mode)) { fprintf(stderr, zWarn, pOpts->pzProgName); fprintf(stderr, zNotFile, pzDir); if (free_dir_name) AGFREE((void*)pzDir); return NULL; } /* * Get rid of the old file */ unlink(pzDir); *p_free_name = free_dir_name; return pzDir; } static void printEntry( FILE * fp, tOptDesc * p, tCC* pzLA ) { /* * There is an argument. Pad the name so values line up. * Not disabled *OR* this got equivalenced to another opt, * then use current option name. * Otherwise, there must be a disablement name. */ { char const * pz; if (! DISABLED_OPT(p) || (p->optEquivIndex != NO_EQUIVALENT)) pz = p->pz_Name; else pz = p->pz_DisableName; fprintf(fp, "%-18s", pz); } /* * IF the option is numeric only, * THEN the char pointer is really the number */ if (OPTST_GET_ARGTYPE(p->fOptState) == OPARG_TYPE_NUMERIC) fprintf(fp, " %d\n", (int)(t_word)pzLA); /* * OTHERWISE, FOR each line of the value text, ... */ else if (pzLA == NULL) fputc('\n', fp); else { fputc(' ', fp); fputc(' ', fp); for (;;) { tCC* pzNl = strchr(pzLA, '\n'); /* * IF this is the last line * THEN bail and print it */ if (pzNl == NULL) break; /* * Print the continuation and the text from the current line */ (void)fwrite(pzLA, (size_t)(pzNl - pzLA), (size_t)1, fp); pzLA = pzNl+1; /* advance the Last Arg pointer */ fputs("\\\n", fp); } /* * Terminate the entry */ fputs(pzLA, fp); fputc('\n', fp); } } static void print_a_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp) { static char const bool_atr[] = "<%1$s type=boolean>%2$s\n"; static char const numb_atr[] = "<%1$s type=integer>0x%2$lX\n"; static char const type_atr[] = "<%s type=%s>"; static char const null_atr[] = "<%s/>\n"; while (--depth >= 0) putc(' ', fp), putc(' ', fp); switch (ovp->valType) { default: case OPARG_TYPE_NONE: fprintf(fp, null_atr, ovp->pzName); break; case OPARG_TYPE_STRING: print_a_string(fp, ovp->pzName, ovp->v.strVal); break; case OPARG_TYPE_ENUMERATION: case OPARG_TYPE_MEMBERSHIP: if (pOD != NULL) { tAoUI opt_state = pOD->fOptState; uintptr_t val = pOD->optArg.argEnum; char const * typ = (ovp->valType == OPARG_TYPE_ENUMERATION) ? "keyword" : "set-membership"; fprintf(fp, type_atr, ovp->pzName, typ); /* * This is a magic incantation that will convert the * bit flag values back into a string suitable for printing. */ (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD ); if (pOD->optArg.argString != NULL) { fputs(pOD->optArg.argString, fp); if (ovp->valType != OPARG_TYPE_ENUMERATION) { /* * set membership strings get allocated */ AGFREE((void*)pOD->optArg.argString); } } pOD->optArg.argEnum = val; pOD->fOptState = opt_state; fprintf(fp, close_xml, ovp->pzName); break; } /* FALLTHROUGH */ case OPARG_TYPE_NUMERIC: fprintf(fp, numb_atr, ovp->pzName, ovp->v.longVal); break; case OPARG_TYPE_BOOLEAN: fprintf(fp, bool_atr, ovp->pzName, ovp->v.boolVal ? "true" : "false"); break; case OPARG_TYPE_HIERARCHY: printValueList(fp, ovp->pzName, ovp->v.nestVal); break; } } static void print_a_string(FILE * fp, char const * name, char const * pz) { static char const open_atr[] = "<%s>"; fprintf(fp, open_atr, name); for (;;) { int ch = ((int)*(pz++)) & 0xFF; switch (ch) { case NUL: goto string_done; case '&': case '<': case '>': #if __GNUC__ >= 4 case 1 ... (' ' - 1): case ('~' + 1) ... 0xFF: #endif emit_special_char(fp, ch); break; default: #if __GNUC__ < 4 if ( ((ch >= 1) && (ch <= (' ' - 1))) || ((ch >= ('~' + 1)) && (ch <= 0xFF)) ) { emit_special_char(fp, ch); break; } #endif putc(ch, fp); } } string_done:; fprintf(fp, close_xml, name); } static void printValueList(FILE * fp, char const * name, tArgList * al) { static int depth = 1; int sp_ct; int opt_ct; void ** opt_list; if (al == NULL) return; opt_ct = al->useCt; opt_list = (void **)al->apzArgs; if (opt_ct <= 0) { fprintf(fp, "<%s/>\n", name); return; } fprintf(fp, "<%s type=nested>\n", name); depth++; while (--opt_ct >= 0) { tOptionValue const * ovp = *(opt_list++); print_a_value(fp, depth, NULL, ovp); } depth--; for (sp_ct = depth; --sp_ct >= 0;) putc(' ', fp), putc(' ', fp); fprintf(fp, "\n", name); } static void printHierarchy(FILE * fp, tOptDesc * p) { int opt_ct; tArgList * al = p->optCookie; void ** opt_list; if (al == NULL) return; opt_ct = al->useCt; opt_list = (void **)al->apzArgs; if (opt_ct <= 0) return; do { tOptionValue const * base = *(opt_list++); tOptionValue const * ovp = optionGetValue(base, NULL); if (ovp == NULL) continue; fprintf(fp, "<%s type=nested>\n", p->pz_Name); do { print_a_value(fp, 1, p, ovp); } while (ovp = optionNextValue(base, ovp), ovp != NULL); fprintf(fp, "\n", p->pz_Name); } while (--opt_ct > 0); } static FILE * openSaveFile(tOptions* pOpts) { FILE* fp; { int free_name = 0; tCC* pzFName = findFileName(pOpts, &free_name); if (pzFName == NULL) return NULL; fp = fopen(pzFName, "w" FOPEN_BINARY_FLAG); if (fp == NULL) { fprintf(stderr, zWarn, pOpts->pzProgName); fprintf(stderr, zNoCreat, errno, strerror(errno), pzFName); if (free_name) AGFREE((void*) pzFName ); return fp; } if (free_name) AGFREE((void*)pzFName); } { char const* pz = pOpts->pzUsageTitle; fputs("# ", fp); do { fputc(*pz, fp); } while (*(pz++) != '\n'); } { time_t timeVal = time(NULL); char* pzTime = ctime(&timeVal); fprintf(fp, zPresetFile, pzTime); #ifdef HAVE_ALLOCATED_CTIME /* * The return values for ctime(), localtime(), and gmtime() * normally point to static data that is overwritten by each call. * The test to detect allocated ctime, so we leak the memory. */ AGFREE((void*)pzTime); #endif } return fp; } static void printNoArgOpt(FILE * fp, tOptDesc * p, tOptDesc * pOD) { /* * The aliased to argument indicates whether or not the option * is "disabled". However, the original option has the name * string, so we get that there, not with "p". */ char const * pznm = (DISABLED_OPT(p)) ? pOD->pz_DisableName : pOD->pz_Name; /* * If the option was disabled and the disablement name is NULL, * then the disablement was caused by aliasing. * Use the name as the string to emit. */ if (pznm == NULL) pznm = pOD->pz_Name; fprintf(fp, "%s\n", pznm); } static void printStringArg(FILE * fp, tOptDesc * pOD) { if (pOD->fOptState & OPTST_STACKED) { tArgList* pAL = (tArgList*)pOD->optCookie; int uct = pAL->useCt; tCC** ppz = pAL->apzArgs; /* * un-disable multiple copies of disabled options. */ if (uct > 1) pOD->fOptState &= ~OPTST_DISABLED; while (uct-- > 0) printEntry(fp, pOD, *(ppz++)); } else { printEntry(fp, pOD, pOD->optArg.argString); } } static void printEnumArg(FILE * fp, tOptDesc * pOD) { uintptr_t val = pOD->optArg.argEnum; /* * This is a magic incantation that will convert the * bit flag values back into a string suitable for printing. */ (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD); printEntry(fp, pOD, (void*)(pOD->optArg.argString)); pOD->optArg.argEnum = val; } static void printSetMemberArg(FILE * fp, tOptDesc * pOD) { uintptr_t val = pOD->optArg.argEnum; /* * This is a magic incantation that will convert the * bit flag values back into a string suitable for printing. */ (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD); printEntry(fp, pOD, (void*)(pOD->optArg.argString)); if (pOD->optArg.argString != NULL) { /* * set membership strings get allocated */ AGFREE((void*)pOD->optArg.argString); pOD->fOptState &= ~OPTST_ALLOC_ARG; } pOD->optArg.argEnum = val; } static void printFileArg(FILE * fp, tOptDesc * pOD, tOptions* pOpts) { /* * If the cookie is not NULL, then it has the file name, period. * Otherwise, if we have a non-NULL string argument, then.... */ if (pOD->optCookie != NULL) printEntry(fp, pOD, pOD->optCookie); else if (HAS_originalOptArgArray(pOpts)) { char const * orig = pOpts->originalOptArgArray[pOD->optIndex].argString; if (pOD->optArg.argString == orig) return; printEntry(fp, pOD, pOD->optArg.argString); } } /*=export_func optionSaveFile * * what: saves the option state to a file * * arg: tOptions*, pOpts, program options descriptor * * doc: * * This routine will save the state of option processing to a file. The name * of that file can be specified with the argument to the @code{--save-opts} * option, or by appending the @code{rcfile} attribute to the last * @code{homerc} attribute. If no @code{rcfile} attribute was specified, it * will default to @code{.@i{programname}rc}. If you wish to specify another * file, you should invoke the @code{SET_OPT_SAVE_OPTS(@i{filename})} macro. * * The recommend usage is as follows: * @example * optionProcess(&progOptions, argc, argv); * if (i_want_a_non_standard_place_for_this) * SET_OPT_SAVE_OPTS("myfilename"); * optionSaveFile(&progOptions); * @end example * * err: * * If no @code{homerc} file was specified, this routine will silently return * and do nothing. If the output file cannot be created or updated, a message * will be printed to @code{stderr} and the routine will return. =*/ void optionSaveFile(tOptions* pOpts) { tOptDesc* pOD; int ct; FILE* fp = openSaveFile(pOpts); if (fp == NULL) return; /* * FOR each of the defined options, ... */ ct = pOpts->presetOptCt; pOD = pOpts->pOptDesc; do { tOptDesc* p; /* * IF the option has not been defined * OR it does not take an initialization value * OR it is equivalenced to another option * THEN continue (ignore it) * * Equivalenced options get picked up when the equivalenced-to * option is processed. */ if (UNUSED_OPT(pOD)) continue; if ((pOD->fOptState & OPTST_DO_NOT_SAVE_MASK) != 0) continue; if ( (pOD->optEquivIndex != NO_EQUIVALENT) && (pOD->optEquivIndex != pOD->optIndex)) continue; /* * The option argument data are found at the equivalenced-to option, * but the actual option argument type comes from the original * option descriptor. Be careful! */ p = ((pOD->fOptState & OPTST_EQUIVALENCE) != 0) ? (pOpts->pOptDesc + pOD->optActualIndex) : pOD; switch (OPTST_GET_ARGTYPE(pOD->fOptState)) { case OPARG_TYPE_NONE: printNoArgOpt(fp, p, pOD); break; case OPARG_TYPE_NUMERIC: printEntry(fp, p, (void*)(p->optArg.argInt)); break; case OPARG_TYPE_STRING: printStringArg(fp, p); break; case OPARG_TYPE_ENUMERATION: printEnumArg(fp, p); break; case OPARG_TYPE_MEMBERSHIP: printSetMemberArg(fp, p); break; case OPARG_TYPE_BOOLEAN: printEntry(fp, p, p->optArg.argBool ? "true" : "false"); break; case OPARG_TYPE_HIERARCHY: printHierarchy(fp, p); break; case OPARG_TYPE_FILE: printFileArg(fp, p, pOpts); break; default: break; /* cannot handle - skip it */ } } while (pOD++, (--ct > 0)); fclose(fp); } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/save.c */ ntp-4.2.6p5/sntp/libopts/ag-char-map.h0000644000175000017500000002155011564122254016504 0ustar peterpeter/* * Character mapping generated 04/29/11 15:43:58 * * This file contains the character classifications * used by AutoGen and AutoOpts for identifying tokens. * This file is part of AutoGen. * AutoGen Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * AutoGen 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. * AutoGen 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 . */ #ifndef AG_CHAR_MAP_H_GUARD #define AG_CHAR_MAP_H_GUARD 1 #ifdef HAVE_CONFIG_H # if defined(HAVE_INTTYPES_H) # include # elif defined(HAVE_STDINT_H) # include # else # ifndef HAVE_INT8_T typedef signed char int8_t; # endif # ifndef HAVE_UINT8_T typedef unsigned char uint8_t; # endif # ifndef HAVE_INT16_T typedef signed short int16_t; # endif # ifndef HAVE_UINT16_T typedef unsigned short uint16_t; # endif # ifndef HAVE_UINT_T typedef unsigned int uint_t; # endif # ifndef HAVE_INT32_T # if SIZEOF_INT == 4 typedef signed int int32_t; # elif SIZEOF_LONG == 4 typedef signed long int32_t; # endif # endif # ifndef HAVE_UINT32_T # if SIZEOF_INT == 4 typedef unsigned int uint32_t; # elif SIZEOF_LONG == 4 typedef unsigned long uint32_t; # endif # endif # endif /* HAVE_*INT*_H header */ #else /* not HAVE_CONFIG_H -- */ # ifdef __sun # include # else # include # endif #endif /* HAVE_CONFIG_H */ #if 0 /* mapping specification source (from autogen.map) */ // // %guard autoopts_internal // %file ag-char-map.h // %static-table option-char-category // // %comment // This file contains the character classifications // used by AutoGen and AutoOpts for identifying tokens. // // This file is part of AutoGen. // AutoGen Copyright (c) 1992-2011 by Bruce Korb - all rights reserved // // AutoGen 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. // // AutoGen 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 . // % // // lower-case "a-z" // upper-case "A-Z" // alphabetic +lower-case +upper-case // oct-digit "0-7" // dec-digit "89" +oct-digit // hex-digit "a-fA-F" +dec-digit // alphanumeric +alphabetic +dec-digit // var-first "_" +alphabetic // variable-name +var-first +dec-digit // option-name "^-" +variable-name // value-name ":" +option-name // horiz-white "\t " // compound-name "[.]" +value-name +horiz-white // whitespace "\v\f\r\n\b" +horiz-white // unquotable "!-~" -"\"#(),;<=>[\\]`{}?*'" // end-xml-token "/>" +whitespace // graphic "!-~" // plus-n-space "+" +whitespace // punctuation "!-~" -alphanumeric -"_" // suffix "-._" +alphanumeric // suffix-fmt "%/" +suffix // false-type "nNfF0\x00" // file-name "/" +suffix // end-token "\x00" +whitespace // end-list-entry "," +end-token // #endif /* 0 -- mapping spec. source */ typedef uint32_t option_char_category_mask_t; static option_char_category_mask_t const option_char_category[128]; static inline int is_option_char_category_char(char ch, option_char_category_mask_t mask) { unsigned int ix = (unsigned char)ch; return ((ix < 128) && ((option_char_category[ix] & mask) != 0)); } #define IS_LOWER_CASE_CHAR(_c) is_option_char_category_char((_c), 0x000001) #define IS_UPPER_CASE_CHAR(_c) is_option_char_category_char((_c), 0x000002) #define IS_ALPHABETIC_CHAR(_c) is_option_char_category_char((_c), 0x000003) #define IS_OCT_DIGIT_CHAR(_c) is_option_char_category_char((_c), 0x000004) #define IS_DEC_DIGIT_CHAR(_c) is_option_char_category_char((_c), 0x00000C) #define IS_HEX_DIGIT_CHAR(_c) is_option_char_category_char((_c), 0x00001C) #define IS_ALPHANUMERIC_CHAR(_c) is_option_char_category_char((_c), 0x00000F) #define IS_VAR_FIRST_CHAR(_c) is_option_char_category_char((_c), 0x000023) #define IS_VARIABLE_NAME_CHAR(_c) is_option_char_category_char((_c), 0x00002F) #define IS_OPTION_NAME_CHAR(_c) is_option_char_category_char((_c), 0x00006F) #define IS_VALUE_NAME_CHAR(_c) is_option_char_category_char((_c), 0x0000EF) #define IS_HORIZ_WHITE_CHAR(_c) is_option_char_category_char((_c), 0x000100) #define IS_COMPOUND_NAME_CHAR(_c) is_option_char_category_char((_c), 0x0003EF) #define IS_WHITESPACE_CHAR(_c) is_option_char_category_char((_c), 0x000500) #define IS_UNQUOTABLE_CHAR(_c) is_option_char_category_char((_c), 0x000800) #define IS_END_XML_TOKEN_CHAR(_c) is_option_char_category_char((_c), 0x001500) #define IS_GRAPHIC_CHAR(_c) is_option_char_category_char((_c), 0x002000) #define IS_PLUS_N_SPACE_CHAR(_c) is_option_char_category_char((_c), 0x004500) #define IS_PUNCTUATION_CHAR(_c) is_option_char_category_char((_c), 0x008000) #define IS_SUFFIX_CHAR(_c) is_option_char_category_char((_c), 0x01000F) #define IS_SUFFIX_FMT_CHAR(_c) is_option_char_category_char((_c), 0x03000F) #define IS_FALSE_TYPE_CHAR(_c) is_option_char_category_char((_c), 0x040000) #define IS_FILE_NAME_CHAR(_c) is_option_char_category_char((_c), 0x09000F) #define IS_END_TOKEN_CHAR(_c) is_option_char_category_char((_c), 0x100500) #define IS_END_LIST_ENTRY_CHAR(_c) is_option_char_category_char((_c), 0x300500) #if 1 /* def AUTOOPTS_INTERNAL */ static option_char_category_mask_t const option_char_category[128] = { /*x00*/ 0x140000, /*x01*/ 0x000000, /*x02*/ 0x000000, /*x03*/ 0x000000, /*x04*/ 0x000000, /*x05*/ 0x000000, /*x06*/ 0x000000, /*\a */ 0x000000, /*\b */ 0x000400, /*\t */ 0x000100, /*\n */ 0x000400, /*\v */ 0x000400, /*\f */ 0x000400, /*\r */ 0x000400, /*x0E*/ 0x000000, /*x0F*/ 0x000000, /*x10*/ 0x000000, /*x11*/ 0x000000, /*x12*/ 0x000000, /*x13*/ 0x000000, /*x14*/ 0x000000, /*x15*/ 0x000000, /*x16*/ 0x000000, /*x17*/ 0x000000, /*x18*/ 0x000000, /*x19*/ 0x000000, /*x1A*/ 0x000000, /*x1B*/ 0x000000, /*x1C*/ 0x000000, /*x1D*/ 0x000000, /*x1E*/ 0x000000, /*x1F*/ 0x000000, /* */ 0x000100, /* ! */ 0x00A800, /* " */ 0x00A000, /* # */ 0x00A000, /* $ */ 0x00A800, /* % */ 0x02A800, /* & */ 0x00A800, /* ' */ 0x00A000, /* ( */ 0x00A000, /* ) */ 0x00A000, /* * */ 0x00A000, /* + */ 0x00E800, /* , */ 0x20A000, /* - */ 0x01A840, /* . */ 0x01AA00, /* / */ 0x0AB800, /* 0 */ 0x042804, /* 1 */ 0x002804, /* 2 */ 0x002804, /* 3 */ 0x002804, /* 4 */ 0x002804, /* 5 */ 0x002804, /* 6 */ 0x002804, /* 7 */ 0x002804, /* 8 */ 0x002808, /* 9 */ 0x002808, /* : */ 0x00A880, /* ; */ 0x00A000, /* < */ 0x00A000, /* = */ 0x00A000, /* > */ 0x00B000, /* ? */ 0x00A000, /* @ */ 0x00A800, /* A */ 0x002812, /* B */ 0x002812, /* C */ 0x002812, /* D */ 0x002812, /* E */ 0x002812, /* F */ 0x042812, /* G */ 0x002802, /* H */ 0x002802, /* I */ 0x002802, /* J */ 0x002802, /* K */ 0x002802, /* L */ 0x002802, /* M */ 0x002802, /* N */ 0x042802, /* O */ 0x002802, /* P */ 0x002802, /* Q */ 0x002802, /* R */ 0x002802, /* S */ 0x002802, /* T */ 0x002802, /* U */ 0x002802, /* V */ 0x002802, /* W */ 0x002802, /* X */ 0x002802, /* Y */ 0x002802, /* Z */ 0x002802, /* [ */ 0x00A200, /* \ */ 0x00A000, /* ] */ 0x00A200, /* ^ */ 0x00A840, /* _ */ 0x012820, /* ` */ 0x00A000, /* a */ 0x002811, /* b */ 0x002811, /* c */ 0x002811, /* d */ 0x002811, /* e */ 0x002811, /* f */ 0x042811, /* g */ 0x002801, /* h */ 0x002801, /* i */ 0x002801, /* j */ 0x002801, /* k */ 0x002801, /* l */ 0x002801, /* m */ 0x002801, /* n */ 0x042801, /* o */ 0x002801, /* p */ 0x002801, /* q */ 0x002801, /* r */ 0x002801, /* s */ 0x002801, /* t */ 0x002801, /* u */ 0x002801, /* v */ 0x002801, /* w */ 0x002801, /* x */ 0x002801, /* y */ 0x002801, /* z */ 0x002801, /* { */ 0x00A000, /* | */ 0x00A800, /* } */ 0x00A000, /* ~ */ 0x00A800, /*x7F*/ 0x000000 }; #endif /* AUTOOPTS_INTERNAL */ #endif /* AG_CHAR_MAP_H_GUARD */ ntp-4.2.6p5/sntp/libopts/cook.c0000644000175000017500000002163011564122254015354 0ustar peterpeter/** * \file cook.c * * Time-stamp: "2011-03-12 15:05:26 bkorb" * * This file contains the routines that deal with processing quoted strings * into an internal format. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ /* = = = START-STATIC-FORWARD = = = */ static ag_bool contiguous_quote(char ** pps, char * pq, int * lnct_p); /* = = = END-STATIC-FORWARD = = = */ /*=export_func ao_string_cook_escape_char * private: * * what: escape-process a string fragment * arg: + char const* + pzScan + points to character after the escape + * arg: + char* + pRes + Where to put the result byte + * arg: + unsigned int + nl_ch + replacement char if scanned char is \n + * * ret-type: unsigned int * ret-desc: The number of bytes consumed processing the escaped character. * * doc: * * This function converts "t" into "\t" and all your other favorite * escapes, including numeric ones: hex and ocatal, too. * The returned result tells the caller how far to advance the * scan pointer (passed in). The default is to just pass through the * escaped character and advance the scan by one. * * Some applications need to keep an escaped newline, others need to * suppress it. This is accomplished by supplying a '\n' replacement * character that is different from \n, if need be. For example, use * 0x7F and never emit a 0x7F. * * err: @code{NULL} is returned if the string is mal-formed. =*/ unsigned int ao_string_cook_escape_char( char const* pzIn, char* pRes, u_int nl ) { unsigned int res = 1; switch (*pRes = *pzIn++) { case NUL: /* NUL - end of input string */ return 0; case '\r': if (*pzIn != '\n') return 1; res++; /* FALLTHROUGH */ case '\n': /* NL - emit newline */ *pRes = (char)nl; return res; case 'a': *pRes = '\a'; break; case 'b': *pRes = '\b'; break; case 'f': *pRes = '\f'; break; case 'n': *pRes = '\n'; break; case 'r': *pRes = '\r'; break; case 't': *pRes = '\t'; break; case 'v': *pRes = '\v'; break; case 'x': case 'X': /* HEX Escape */ if (IS_HEX_DIGIT_CHAR(*pzIn)) { char z[4], *pz = z; do *(pz++) = *(pzIn++); while (IS_HEX_DIGIT_CHAR(*pzIn) && (pz < z + 2)); *pz = NUL; *pRes = (unsigned char)strtoul(z, NULL, 16); res += pz - z; } break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { /* * IF the character copied was an octal digit, * THEN set the output character to an octal value */ char z[4], *pz = z + 1; unsigned long val; z[0] = *pRes; while (IS_OCT_DIGIT_CHAR(*pzIn) && (pz < z + 3)) *(pz++) = *(pzIn++); *pz = NUL; val = strtoul(z, NULL, 8); if (val > 0xFF) val = 0xFF; *pRes = (unsigned char)val; res = pz - z; break; } default: ; } return res; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * A quoted string has been found. * Find the end of it and compress any escape sequences. */ static ag_bool contiguous_quote(char ** pps, char * pq, int * lnct_p) { char * ps = *pps + 1; for (;;) { while (IS_WHITESPACE_CHAR(*ps)) if (*(ps++) == '\n') (*lnct_p)++; /* * IF the next character is a quote character, * THEN we will concatenate the strings. */ switch (*ps) { case '"': case '\'': *pq = *(ps++); /* assign new quote character and return */ *pps = ps; return AG_TRUE; case '/': /* * Allow for a comment embedded in the concatenated string. */ switch (ps[1]) { default: *pps = NULL; return AG_FALSE; case '/': /* * Skip to end of line */ ps = strchr(ps, '\n'); if (ps == NULL) { *pps = NULL; return AG_FALSE; } break; case '*': { char* p = strstr( ps+2, "*/" ); /* * Skip to terminating star slash */ if (p == NULL) { *pps = NULL; return AG_FALSE; } while (ps < p) { if (*(ps++) == '\n') (*lnct_p)++; } ps = p + 2; } } continue; default: /* * The next non-whitespace character is not a quote. * The series of quoted strings has come to an end. */ *pps = ps; return AG_FALSE; } } } /*=export_func ao_string_cook * private: * * what: concatenate and escape-process strings * arg: + char* + pzScan + The *MODIFIABLE* input buffer + * arg: + int* + lnct_p + The (possibly NULL) pointer to a line count + * * ret-type: char* * ret-desc: The address of the text following the processed strings. * The return value is NULL if the strings are ill-formed. * * doc: * * A series of one or more quoted strings are concatenated together. * If they are quoted with double quotes (@code{"}), then backslash * escapes are processed per the C programming language. If they are * single quote strings, then the backslashes are honored only when they * precede another backslash or a single quote character. * * err: @code{NULL} is returned if the string(s) is/are mal-formed. =*/ char * ao_string_cook(char * pzScan, int * lnct_p) { int l = 0; char q = *pzScan; /* * It is a quoted string. Process the escape sequence characters * (in the set "abfnrtv") and make sure we find a closing quote. */ char* pzD = pzScan++; char* pzS = pzScan; if (lnct_p == NULL) lnct_p = &l; for (;;) { /* * IF the next character is the quote character, THEN we may end the * string. We end it unless the next non-blank character *after* the * string happens to also be a quote. If it is, then we will change * our quote character to the new quote character and continue * condensing text. */ while (*pzS == q) { *pzD = NUL; /* This is probably the end of the line */ if (! contiguous_quote(&pzS, &q, lnct_p)) return pzS; } /* * We are inside a quoted string. Copy text. */ switch (*(pzD++) = *(pzS++)) { case NUL: return NULL; case '\n': (*lnct_p)++; break; case '\\': /* * IF we are escaping a new line, * THEN drop both the escape and the newline from * the result string. */ if (*pzS == '\n') { pzS++; pzD--; (*lnct_p)++; } /* * ELSE IF the quote character is '"' or '`', * THEN we do the full escape character processing */ else if (q != '\'') { int ct = ao_string_cook_escape_char( pzS, pzD-1, (u_int)'\n' ); if (ct == 0) return NULL; pzS += ct; } /* if (q != '\'') */ /* * OTHERWISE, we only process "\\", "\'" and "\#" sequences. * The latter only to easily hide preprocessing directives. */ else switch (*pzS) { case '\\': case '\'': case '#': pzD[-1] = *pzS++; } } /* switch (*(pzD++) = *(pzS++)) */ } /* for (;;) */ } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/cook.c */ ntp-4.2.6p5/sntp/libopts/parse-duration.c0000644000175000017500000002776411564122254017374 0ustar peterpeter/* Parse a time duration and return a seconds count Copyright (C) 2008-2011 Free Software Foundation, Inc. Written by Bruce Korb , 2008. 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 . */ #include /* Specification. */ #include "parse-duration.h" #include #include #include #include #include #include #ifndef NUL #define NUL '\0' #endif #define cch_t char const typedef enum { NOTHING_IS_DONE, YEAR_IS_DONE, MONTH_IS_DONE, WEEK_IS_DONE, DAY_IS_DONE, HOUR_IS_DONE, MINUTE_IS_DONE, SECOND_IS_DONE } whats_done_t; #define SEC_PER_MIN 60 #define SEC_PER_HR (SEC_PER_MIN * 60) #define SEC_PER_DAY (SEC_PER_HR * 24) #define SEC_PER_WEEK (SEC_PER_DAY * 7) #define SEC_PER_MONTH (SEC_PER_DAY * 30) #define SEC_PER_YEAR (SEC_PER_DAY * 365) #define TIME_MAX 0x7FFFFFFF /* Wrapper around strtoul that does not require a cast. */ static unsigned long inline str_const_to_ul (cch_t * str, cch_t ** ppz, int base) { return strtoul (str, (char **)ppz, base); } /* Wrapper around strtol that does not require a cast. */ static long inline str_const_to_l (cch_t * str, cch_t ** ppz, int base) { return strtol (str, (char **)ppz, base); } /* Returns BASE + VAL * SCALE, interpreting BASE = BAD_TIME with errno set as an error situation, and returning BAD_TIME with errno set in an error situation. */ static time_t inline scale_n_add (time_t base, time_t val, int scale) { if (base == BAD_TIME) { if (errno == 0) errno = EINVAL; return BAD_TIME; } if (val > TIME_MAX / scale) { errno = ERANGE; return BAD_TIME; } val *= scale; if (base > TIME_MAX - val) { errno = ERANGE; return BAD_TIME; } return base + val; } /* After a number HH has been parsed, parse subsequent :MM or :MM:SS. */ static time_t parse_hr_min_sec (time_t start, cch_t * pz) { int lpct = 0; errno = 0; /* For as long as our scanner pointer points to a colon *AND* we've not looped before, then keep looping. (two iterations max) */ while ((*pz == ':') && (lpct++ <= 1)) { unsigned long v = str_const_to_ul (pz+1, &pz, 10); if (errno != 0) return BAD_TIME; start = scale_n_add (v, start, 60); if (errno != 0) return BAD_TIME; } /* allow for trailing spaces */ while (isspace ((unsigned char)*pz)) pz++; if (*pz != NUL) { errno = EINVAL; return BAD_TIME; } return start; } /* Parses a value and returns BASE + value * SCALE, interpreting BASE = BAD_TIME with errno set as an error situation, and returning BAD_TIME with errno set in an error situation. */ static time_t parse_scaled_value (time_t base, cch_t ** ppz, cch_t * endp, int scale) { cch_t * pz = *ppz; time_t val; if (base == BAD_TIME) return base; errno = 0; val = str_const_to_ul (pz, &pz, 10); if (errno != 0) return BAD_TIME; while (isspace ((unsigned char)*pz)) pz++; if (pz != endp) { errno = EINVAL; return BAD_TIME; } *ppz = pz; return scale_n_add (base, val, scale); } /* Parses the syntax YEAR-MONTH-DAY. PS points into the string, after "YEAR", before "-MONTH-DAY". */ static time_t parse_year_month_day (cch_t * pz, cch_t * ps) { time_t res = 0; res = parse_scaled_value (0, &pz, ps, SEC_PER_YEAR); pz++; /* over the first '-' */ ps = strchr (pz, '-'); if (ps == NULL) { errno = EINVAL; return BAD_TIME; } res = parse_scaled_value (res, &pz, ps, SEC_PER_MONTH); pz++; /* over the second '-' */ ps = pz + strlen (pz); return parse_scaled_value (res, &pz, ps, SEC_PER_DAY); } /* Parses the syntax YYYYMMDD. */ static time_t parse_yearmonthday (cch_t * in_pz) { time_t res = 0; char buf[8]; cch_t * pz; if (strlen (in_pz) != 8) { errno = EINVAL; return BAD_TIME; } memcpy (buf, in_pz, 4); buf[4] = NUL; pz = buf; res = parse_scaled_value (0, &pz, buf + 4, SEC_PER_YEAR); memcpy (buf, in_pz + 4, 2); buf[2] = NUL; pz = buf; res = parse_scaled_value (res, &pz, buf + 2, SEC_PER_MONTH); memcpy (buf, in_pz + 6, 2); buf[2] = NUL; pz = buf; return parse_scaled_value (res, &pz, buf + 2, SEC_PER_DAY); } /* Parses the syntax yy Y mm M ww W dd D. */ static time_t parse_YMWD (cch_t * pz) { time_t res = 0; cch_t * ps = strchr (pz, 'Y'); if (ps != NULL) { res = parse_scaled_value (0, &pz, ps, SEC_PER_YEAR); pz++; } ps = strchr (pz, 'M'); if (ps != NULL) { res = parse_scaled_value (res, &pz, ps, SEC_PER_MONTH); pz++; } ps = strchr (pz, 'W'); if (ps != NULL) { res = parse_scaled_value (res, &pz, ps, SEC_PER_WEEK); pz++; } ps = strchr (pz, 'D'); if (ps != NULL) { res = parse_scaled_value (res, &pz, ps, SEC_PER_DAY); pz++; } while (isspace ((unsigned char)*pz)) pz++; if (*pz != NUL) { errno = EINVAL; return BAD_TIME; } return res; } /* Parses the syntax HH:MM:SS. PS points into the string, after "HH", before ":MM:SS". */ static time_t parse_hour_minute_second (cch_t * pz, cch_t * ps) { time_t res = 0; res = parse_scaled_value (0, &pz, ps, SEC_PER_HR); pz++; ps = strchr (pz, ':'); if (ps == NULL) { errno = EINVAL; return BAD_TIME; } res = parse_scaled_value (res, &pz, ps, SEC_PER_MIN); pz++; ps = pz + strlen (pz); return parse_scaled_value (res, &pz, ps, 1); } /* Parses the syntax HHMMSS. */ static time_t parse_hourminutesecond (cch_t * in_pz) { time_t res = 0; char buf[4]; cch_t * pz; if (strlen (in_pz) != 6) { errno = EINVAL; return BAD_TIME; } memcpy (buf, in_pz, 2); buf[2] = NUL; pz = buf; res = parse_scaled_value (0, &pz, buf + 2, SEC_PER_HR); memcpy (buf, in_pz + 2, 2); buf[2] = NUL; pz = buf; res = parse_scaled_value (res, &pz, buf + 2, SEC_PER_MIN); memcpy (buf, in_pz + 4, 2); buf[2] = NUL; pz = buf; return parse_scaled_value (res, &pz, buf + 2, 1); } /* Parses the syntax hh H mm M ss S. */ static time_t parse_HMS (cch_t * pz) { time_t res = 0; cch_t * ps = strchr (pz, 'H'); if (ps != NULL) { res = parse_scaled_value (0, &pz, ps, SEC_PER_HR); pz++; } ps = strchr (pz, 'M'); if (ps != NULL) { res = parse_scaled_value (res, &pz, ps, SEC_PER_MIN); pz++; } ps = strchr (pz, 'S'); if (ps != NULL) { res = parse_scaled_value (res, &pz, ps, 1); pz++; } while (isspace ((unsigned char)*pz)) pz++; if (*pz != NUL) { errno = EINVAL; return BAD_TIME; } return res; } /* Parses a time (hours, minutes, seconds) specification in either syntax. */ static time_t parse_time (cch_t * pz) { cch_t * ps; time_t res = 0; /* * Scan for a hyphen */ ps = strchr (pz, ':'); if (ps != NULL) { res = parse_hour_minute_second (pz, ps); } /* * Try for a 'H', 'M' or 'S' suffix */ else if (ps = strpbrk (pz, "HMS"), ps == NULL) { /* Its a YYYYMMDD format: */ res = parse_hourminutesecond (pz); } else res = parse_HMS (pz); return res; } /* Returns a substring of the given string, with spaces at the beginning and at the end destructively removed, per SNOBOL. */ static char * trim (char * pz) { /* trim leading white space */ while (isspace ((unsigned char)*pz)) pz++; /* trim trailing white space */ { char * pe = pz + strlen (pz); while ((pe > pz) && isspace ((unsigned char)pe[-1])) pe--; *pe = NUL; } return pz; } /* * Parse the year/months/days of a time period */ static time_t parse_period (cch_t * in_pz) { char * pT; char * ps; char * pz = strdup (in_pz); void * fptr = pz; time_t res = 0; if (pz == NULL) { errno = ENOMEM; return BAD_TIME; } pT = strchr (pz, 'T'); if (pT != NULL) { *(pT++) = NUL; pz = trim (pz); pT = trim (pT); } /* * Scan for a hyphen */ ps = strchr (pz, '-'); if (ps != NULL) { res = parse_year_month_day (pz, ps); } /* * Try for a 'Y', 'M' or 'D' suffix */ else if (ps = strpbrk (pz, "YMWD"), ps == NULL) { /* Its a YYYYMMDD format: */ res = parse_yearmonthday (pz); } else res = parse_YMWD (pz); if ((errno == 0) && (pT != NULL)) { time_t val = parse_time (pT); res = scale_n_add (res, val, 1); } free (fptr); return res; } static time_t parse_non_iso8601 (cch_t * pz) { whats_done_t whatd_we_do = NOTHING_IS_DONE; time_t res = 0; do { time_t val; errno = 0; val = str_const_to_l (pz, &pz, 10); if (errno != 0) goto bad_time; /* IF we find a colon, then we're going to have a seconds value. We will not loop here any more. We cannot already have parsed a minute value and if we've parsed an hour value, then the result value has to be less than an hour. */ if (*pz == ':') { if (whatd_we_do >= MINUTE_IS_DONE) break; val = parse_hr_min_sec (val, pz); if ((whatd_we_do == HOUR_IS_DONE) && (val >= SEC_PER_HR)) break; return scale_n_add (res, val, 1); } { unsigned int mult; /* Skip over white space following the number we just parsed. */ while (isspace ((unsigned char)*pz)) pz++; switch (*pz) { default: goto bad_time; case NUL: return scale_n_add (res, val, 1); case 'y': case 'Y': if (whatd_we_do >= YEAR_IS_DONE) goto bad_time; mult = SEC_PER_YEAR; whatd_we_do = YEAR_IS_DONE; break; case 'M': if (whatd_we_do >= MONTH_IS_DONE) goto bad_time; mult = SEC_PER_MONTH; whatd_we_do = MONTH_IS_DONE; break; case 'W': if (whatd_we_do >= WEEK_IS_DONE) goto bad_time; mult = SEC_PER_WEEK; whatd_we_do = WEEK_IS_DONE; break; case 'd': case 'D': if (whatd_we_do >= DAY_IS_DONE) goto bad_time; mult = SEC_PER_DAY; whatd_we_do = DAY_IS_DONE; break; case 'h': if (whatd_we_do >= HOUR_IS_DONE) goto bad_time; mult = SEC_PER_HR; whatd_we_do = HOUR_IS_DONE; break; case 'm': if (whatd_we_do >= MINUTE_IS_DONE) goto bad_time; mult = SEC_PER_MIN; whatd_we_do = MINUTE_IS_DONE; break; case 's': mult = 1; whatd_we_do = SECOND_IS_DONE; break; } res = scale_n_add (res, val, mult); pz++; while (isspace ((unsigned char)*pz)) pz++; if (*pz == NUL) return res; if (! isdigit ((unsigned char)*pz)) break; } } while (whatd_we_do < SECOND_IS_DONE); bad_time: errno = EINVAL; return BAD_TIME; } time_t parse_duration (char const * pz) { while (isspace ((unsigned char)*pz)) pz++; switch (*pz) { case 'P': return parse_period (pz + 1); case 'T': return parse_time (pz + 1); default: if (isdigit ((unsigned char)*pz)) return parse_non_iso8601 (pz); errno = EINVAL; return BAD_TIME; } } /* * Local Variables: * mode: C * c-file-style: "gnu" * indent-tabs-mode: nil * End: * end of parse-duration.c */ ntp-4.2.6p5/sntp/libopts/Makefile.am0000644000175000017500000000271511564122253016313 0ustar peterpeter## LIBOPTS Makefile MAINTAINERCLEANFILES = Makefile.in if INSTALL_LIBOPTS lib_LTLIBRARIES = libopts.la else noinst_LTLIBRARIES = libopts.la endif libopts_la_SOURCES = libopts.c libopts_la_CPPFLAGS = -I$(top_srcdir) libopts_la_LDFLAGS = -version-info 35:0:10 EXTRA_DIST = \ COPYING.gplv3 COPYING.lgplv3 COPYING.mbsd \ MakeDefs.inc README ag-char-map.h \ autoopts/usage-txt.h autoopts/options.h autoopts/project.h \ autoopts.c autoopts.h boolean.c \ compat/strdup.c compat/compat.h compat/windows-config.h \ compat/snprintf.c compat/strchr.c compat/pathfind.c \ configfile.c cook.c enumeration.c \ environment.c file.c genshell.c \ genshell.h load.c m4/liboptschk.m4 \ m4/libopts.m4 makeshell.c nested.c \ numeric.c parse-duration.c parse-duration.h \ pgusage.c proto.h putshell.c \ reset.c restore.c save.c \ sort.c stack.c streqvcmp.c \ text_mmap.c time.c tokenize.c \ usage.c value-type.c value-type.h \ version.c xat-attribute.c xat-attribute.h ntp-4.2.6p5/sntp/libopts/autoopts.c0000644000175000017500000010505111564122255016300 0ustar peterpeter /** * \file autoopts.c * * Time-stamp: "2011-03-25 17:55:07 bkorb" * * This file contains all of the routines that must be linked into * an executable to use the generated option processing. The optional * routines are in separately compiled modules so that they will not * necessarily be linked in. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ #ifndef PKGDATADIR # define PKGDATADIR "" #endif static char const zNil[] = ""; static arg_types_t argTypes = { NULL }; static char zOptFmtLine[16] = { NUL }; static ag_bool displayEnum = AG_FALSE; static char const pkgdatadir_default[] = PKGDATADIR; static char const * program_pkgdatadir = pkgdatadir_default; static tOptionLoadMode option_load_mode = OPTION_LOAD_UNCOOKED; static tePagerState pagerState = PAGER_STATE_INITIAL; FILE * option_usage_fp = NULL; /* = = = START-STATIC-FORWARD = = = */ static tSuccess findOptDesc(tOptions* pOpts, tOptState* pOptState); static tSuccess next_opt_arg_must(tOptions* pOpts, tOptState* pOptState); static tSuccess next_opt_arg_may(tOptions* pOpts, tOptState* pOptState); static tSuccess next_opt_arg_none(tOptions* pOpts, tOptState* pOptState); static tSuccess nextOption(tOptions* pOpts, tOptState* pOptState); static tSuccess doPresets(tOptions* pOpts); static int checkConsistency(tOptions* pOpts); /* = = = END-STATIC-FORWARD = = = */ LOCAL void * ao_malloc(size_t sz) { void * res = malloc(sz); if (res == NULL) { fprintf(stderr, zAO_Alloc, (int)sz); exit(EXIT_FAILURE); } return res; } #undef malloc #define malloc(_s) ao_malloc(_s) LOCAL void * ao_realloc(void *p, size_t sz) { void * res = (p == NULL) ? malloc(sz) : realloc(p, sz); if (res == NULL) { fprintf(stderr, zAO_Realloc, (int)sz, p); exit(EXIT_FAILURE); } return res; } #undef realloc #define realloc(_p,_s) ao_realloc(_p,_s) LOCAL char * ao_strdup(char const *str) { char * res = strdup(str); if (res == NULL) { fprintf(stderr, zAO_Strdup, (int)strlen(str)); exit(EXIT_FAILURE); } return res; } #undef strdup #define strdup(_p) ao_strdup(_p) #ifndef HAVE_PATHFIND # include "compat/pathfind.c" #endif #ifndef HAVE_SNPRINTF # include "compat/snprintf.c" #endif #ifndef HAVE_STRDUP # include "compat/strdup.c" #endif #ifndef HAVE_STRCHR # include "compat/strchr.c" #endif /* * handle_opt * * This routine handles equivalencing, sets the option state flags and * invokes the handler procedure, if any. */ LOCAL tSuccess handle_opt(tOptions* pOpts, tOptState* pOptState) { /* * Save a copy of the option procedure pointer. * If this is an equivalence class option, we still want this proc. */ tOptDesc* pOD = pOptState->pOD; tOptProc* pOP = pOD->pOptProc; if (pOD->fOptState & OPTST_ALLOC_ARG) AGFREE(pOD->optArg.argString); pOD->optArg.argString = pOptState->pzOptArg; /* * IF we are presetting options, then we will ignore any un-presettable * options. They are the ones either marked as such. */ if ( ((pOpts->fOptSet & OPTPROC_PRESETTING) != 0) && ((pOD->fOptState & OPTST_NO_INIT) != 0) ) return PROBLEM; /* * IF this is an equivalence class option, * THEN * Save the option value that got us to this option * entry. (It may not be pOD->optChar[0], if this is an * equivalence entry.) * set the pointer to the equivalence class base */ if (pOD->optEquivIndex != NO_EQUIVALENT) { tOptDesc* p = pOpts->pOptDesc + pOD->optEquivIndex; /* * IF the current option state has not been defined (set on the * command line), THEN we will allow continued resetting of * the value. Once "defined", then it must not change. */ if ((pOD->fOptState & OPTST_DEFINED) != 0) { /* * The equivalenced-to option has been found on the command * line before. Make sure new occurrences are the same type. * * IF this option has been previously equivalenced and * it was not the same equivalenced-to option, * THEN we have a usage problem. */ if (p->optActualIndex != pOD->optIndex) { fprintf(stderr, (char*)zMultiEquiv, p->pz_Name, pOD->pz_Name, (pOpts->pOptDesc + p->optActualIndex)->pz_Name); return FAILURE; } } else { /* * Set the equivalenced-to actual option index to no-equivalent * so that we set all the entries below. This option may either * never have been selected before, or else it was selected by * some sort of "presetting" mechanism. */ p->optActualIndex = NO_EQUIVALENT; } if (p->optActualIndex != pOD->optIndex) { /* * First time through, copy over the state * and add in the equivalence flag */ p->optActualValue = pOD->optValue; p->optActualIndex = pOD->optIndex; pOptState->flags |= OPTST_EQUIVALENCE; } /* * Copy the most recent option argument. set membership state * is kept in ``p->optCookie''. Do not overwrite. */ p->optArg.argString = pOD->optArg.argString; pOD = p; } else { pOD->optActualValue = pOD->optValue; pOD->optActualIndex = pOD->optIndex; } pOD->fOptState &= OPTST_PERSISTENT_MASK; pOD->fOptState |= (pOptState->flags & ~OPTST_PERSISTENT_MASK); /* * Keep track of count only for DEFINED (command line) options. * IF we have too many, build up an error message and bail. */ if ( (pOD->fOptState & OPTST_DEFINED) && (++pOD->optOccCt > pOD->optMaxCt) ) { if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) { char const * pzEqv = (pOD->optEquivIndex != NO_EQUIVALENT) ? zEquiv : zNil; fputs(zErrOnly, stderr); if (pOD->optMaxCt > 1) fprintf(stderr, zAtMost, pOD->optMaxCt, pOD->pz_Name, pzEqv); else fprintf(stderr, zOnlyOne, pOD->pz_Name, pzEqv); } return FAILURE; } /* * If provided a procedure to call, call it */ if (pOP != NULL) (*pOP)(pOpts, pOD); return SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * HUNT FOR OPTIONS IN THE ARGUMENT LIST * * The next four procedures are "private" to nextOption(). * nextOption() uses findOptDesc() to find the next descriptor and it, in * turn, uses longOptionFind() and shortOptionFind() to actually do the hunt. * * longOptionFind * * Find the long option descriptor for the current option */ LOCAL tSuccess longOptionFind(tOptions* pOpts, char* pzOptName, tOptState* pOptState) { ag_bool disable = AG_FALSE; char* pzEq = strchr(pzOptName, '='); tOptDesc* pOD = pOpts->pOptDesc; int idx = 0; int idxLim = pOpts->optCt; int matchCt = 0; int matchIdx = 0; int nameLen; char opt_name_buf[128]; /* * IF the value is attached to the name, * copy it off so we can NUL terminate. */ if (pzEq != NULL) { nameLen = (int)(pzEq - pzOptName); if (nameLen >= sizeof(opt_name_buf)) return FAILURE; memcpy(opt_name_buf, pzOptName, nameLen); opt_name_buf[nameLen] = NUL; pzOptName = opt_name_buf; pzEq++; } else nameLen = strlen(pzOptName); do { /* * If option disabled or a doc option, skip to next */ if (pOD->pz_Name == NULL) continue; if ( SKIP_OPT(pOD) && (pOD->fOptState != (OPTST_OMITTED | OPTST_NO_INIT))) continue; if (strneqvcmp(pzOptName, pOD->pz_Name, nameLen) == 0) { /* * IF we have a complete match * THEN it takes priority over any already located partial */ if (pOD->pz_Name[ nameLen ] == NUL) { matchCt = 1; matchIdx = idx; break; } } /* * IF there is a disable name * *AND* no argument value has been supplied * (disabled options may have no argument) * *AND* the option name matches the disable name * THEN ... */ else if ( (pOD->pz_DisableName != NULL) && (strneqvcmp(pzOptName, pOD->pz_DisableName, nameLen) == 0) ) { disable = AG_TRUE; /* * IF we have a complete match * THEN it takes priority over any already located partial */ if (pOD->pz_DisableName[ nameLen ] == NUL) { matchCt = 1; matchIdx = idx; break; } } else continue; /* * We found a partial match, either regular or disabling. * Remember the index for later. */ matchIdx = idx; if (++matchCt > 1) break; } while (pOD++, (++idx < idxLim)); /* * Make sure we either found an exact match or found only one partial */ if (matchCt == 1) { pOD = pOpts->pOptDesc + matchIdx; if (SKIP_OPT(pOD)) { fprintf(stderr, zDisabledErr, pOpts->pzProgName, pOD->pz_Name); if (pOD->pzText != NULL) fprintf(stderr, " -- %s", pOD->pzText); fputc('\n', stderr); (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE); /* NOTREACHED */ } /* * IF we found a disablement name, * THEN set the bit in the callers' flag word */ if (disable) pOptState->flags |= OPTST_DISABLED; pOptState->pOD = pOD; pOptState->pzOptArg = pzEq; pOptState->optType = TOPT_LONG; return SUCCESS; } /* * IF there is no equal sign * *AND* we are using named arguments * *AND* there is a default named option, * THEN return that option. */ if ( (pzEq == NULL) && NAMED_OPTS(pOpts) && (pOpts->specOptIdx.default_opt != NO_EQUIVALENT)) { pOptState->pOD = pOpts->pOptDesc + pOpts->specOptIdx.default_opt; pOptState->pzOptArg = pzOptName; pOptState->optType = TOPT_DEFAULT; return SUCCESS; } /* * IF we are to stop on errors (the default, actually) * THEN call the usage procedure. */ if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) { fprintf(stderr, (matchCt == 0) ? zIllOptStr : zAmbigOptStr, pOpts->pzProgPath, pzOptName); (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE); } return FAILURE; } /* * shortOptionFind * * Find the short option descriptor for the current option */ LOCAL tSuccess shortOptionFind(tOptions* pOpts, uint_t optValue, tOptState* pOptState) { tOptDesc* pRes = pOpts->pOptDesc; int ct = pOpts->optCt; /* * Search the option list */ do { if (optValue != pRes->optValue) continue; if (SKIP_OPT(pRes)) { if ( (pRes->fOptState == (OPTST_OMITTED | OPTST_NO_INIT)) && (pRes->pz_Name != NULL)) { fprintf(stderr, zDisabledErr, pOpts->pzProgPath, pRes->pz_Name); if (pRes->pzText != NULL) fprintf(stderr, " -- %s", pRes->pzText); fputc('\n', stderr); (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE); /* NOTREACHED */ } goto short_opt_error; } pOptState->pOD = pRes; pOptState->optType = TOPT_SHORT; return SUCCESS; } while (pRes++, --ct > 0); /* * IF the character value is a digit * AND there is a special number option ("-n") * THEN the result is the "option" itself and the * option is the specially marked "number" option. */ if ( IS_DEC_DIGIT_CHAR(optValue) && (pOpts->specOptIdx.number_option != NO_EQUIVALENT) ) { pOptState->pOD = \ pRes = pOpts->pOptDesc + pOpts->specOptIdx.number_option; (pOpts->pzCurOpt)--; pOptState->optType = TOPT_SHORT; return SUCCESS; } short_opt_error: /* * IF we are to stop on errors (the default, actually) * THEN call the usage procedure. */ if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) { fprintf(stderr, zIllOptChr, pOpts->pzProgPath, optValue); (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE); } return FAILURE; } /* * findOptDesc * * Find the option descriptor for the current option */ static tSuccess findOptDesc(tOptions* pOpts, tOptState* pOptState) { /* * IF we are continuing a short option list (e.g. -xyz...) * THEN continue a single flag option. * OTHERWISE see if there is room to advance and then do so. */ if ((pOpts->pzCurOpt != NULL) && (*pOpts->pzCurOpt != NUL)) return shortOptionFind(pOpts, (tAoUC)*(pOpts->pzCurOpt), pOptState); if (pOpts->curOptIdx >= pOpts->origArgCt) return PROBLEM; /* NORMAL COMPLETION */ pOpts->pzCurOpt = pOpts->origArgVect[ pOpts->curOptIdx ]; /* * IF all arguments must be named options, ... */ if (NAMED_OPTS(pOpts)) { char * pz = pOpts->pzCurOpt; int def; tSuccess res; tAoUS * def_opt; pOpts->curOptIdx++; if (*pz != '-') return longOptionFind(pOpts, pz, pOptState); /* * The name is prefixed with one or more hyphens. Strip them off * and disable the "default_opt" setting. Use heavy recasting to * strip off the "const" quality of the "default_opt" field. */ while (*(++pz) == '-') ; def_opt = (void *)&(pOpts->specOptIdx.default_opt); def = *def_opt; *def_opt = NO_EQUIVALENT; res = longOptionFind(pOpts, pz, pOptState); *def_opt = def; return res; } /* * Note the kind of flag/option marker */ if (*((pOpts->pzCurOpt)++) != '-') return PROBLEM; /* NORMAL COMPLETION - this + rest are operands */ /* * Special hack for a hyphen by itself */ if (*(pOpts->pzCurOpt) == NUL) return PROBLEM; /* NORMAL COMPLETION - this + rest are operands */ /* * The current argument is to be processed as an option argument */ pOpts->curOptIdx++; /* * We have an option marker. * Test the next character for long option indication */ if (pOpts->pzCurOpt[0] == '-') { if (*++(pOpts->pzCurOpt) == NUL) /* * NORMAL COMPLETION - NOT this arg, but rest are operands */ return PROBLEM; /* * We do not allow the hyphen to be used as a flag value. * Therefore, if long options are not to be accepted, we punt. */ if ((pOpts->fOptSet & OPTPROC_LONGOPT) == 0) { fprintf(stderr, zIllOptStr, pOpts->pzProgPath, zIllegal, pOpts->pzCurOpt-2); return FAILURE; } return longOptionFind(pOpts, pOpts->pzCurOpt, pOptState); } /* * If short options are not allowed, then do long * option processing. Otherwise the character must be a * short (i.e. single character) option. */ if ((pOpts->fOptSet & OPTPROC_SHORTOPT) != 0) return shortOptionFind(pOpts, (tAoUC)*(pOpts->pzCurOpt), pOptState); return longOptionFind(pOpts, pOpts->pzCurOpt, pOptState); } static tSuccess next_opt_arg_must(tOptions* pOpts, tOptState* pOptState) { /* * An option argument is required. Long options can either have * a separate command line argument, or an argument attached by * the '=' character. Figure out which. */ switch (pOptState->optType) { case TOPT_SHORT: /* * See if an arg string follows the flag character */ if (*++(pOpts->pzCurOpt) == NUL) pOpts->pzCurOpt = pOpts->origArgVect[ pOpts->curOptIdx++ ]; pOptState->pzOptArg = pOpts->pzCurOpt; break; case TOPT_LONG: /* * See if an arg string has already been assigned (glued on * with an `=' character) */ if (pOptState->pzOptArg == NULL) pOptState->pzOptArg = pOpts->origArgVect[ pOpts->curOptIdx++ ]; break; default: #ifdef DEBUG fputs("AutoOpts lib error: option type not selected\n", stderr); exit(EXIT_FAILURE); #endif case TOPT_DEFAULT: /* * The option was selected by default. The current token is * the option argument. */ break; } /* * Make sure we did not overflow the argument list. */ if (pOpts->curOptIdx > pOpts->origArgCt) { fprintf(stderr, zMisArg, pOpts->pzProgPath, pOptState->pOD->pz_Name); return FAILURE; } pOpts->pzCurOpt = NULL; /* next time advance to next arg */ return SUCCESS; } static tSuccess next_opt_arg_may(tOptions* pOpts, tOptState* pOptState) { /* * An option argument is optional. */ switch (pOptState->optType) { case TOPT_SHORT: if (*++pOpts->pzCurOpt != NUL) pOptState->pzOptArg = pOpts->pzCurOpt; else { char* pzLA = pOpts->origArgVect[ pOpts->curOptIdx ]; /* * BECAUSE it is optional, we must make sure * we did not find another flag and that there * is such an argument. */ if ((pzLA == NULL) || (*pzLA == '-')) pOptState->pzOptArg = NULL; else { pOpts->curOptIdx++; /* argument found */ pOptState->pzOptArg = pzLA; } } break; case TOPT_LONG: /* * Look for an argument if we don't already have one (glued on * with a `=' character) *AND* we are not in named argument mode */ if ( (pOptState->pzOptArg == NULL) && (! NAMED_OPTS(pOpts))) { char* pzLA = pOpts->origArgVect[ pOpts->curOptIdx ]; /* * BECAUSE it is optional, we must make sure * we did not find another flag and that there * is such an argument. */ if ((pzLA == NULL) || (*pzLA == '-')) pOptState->pzOptArg = NULL; else { pOpts->curOptIdx++; /* argument found */ pOptState->pzOptArg = pzLA; } } break; default: case TOPT_DEFAULT: fputs(zAO_Woops, stderr ); exit(EX_SOFTWARE); } /* * After an option with an optional argument, we will * *always* start with the next option because if there * were any characters following the option name/flag, * they would be interpreted as the argument. */ pOpts->pzCurOpt = NULL; return SUCCESS; } static tSuccess next_opt_arg_none(tOptions* pOpts, tOptState* pOptState) { /* * No option argument. Make sure next time around we find * the correct option flag character for short options */ if (pOptState->optType == TOPT_SHORT) (pOpts->pzCurOpt)++; /* * It is a long option. Make sure there was no ``=xxx'' argument */ else if (pOptState->pzOptArg != NULL) { fprintf(stderr, zNoArg, pOpts->pzProgPath, pOptState->pOD->pz_Name); return FAILURE; } /* * It is a long option. Advance to next command line argument. */ else pOpts->pzCurOpt = NULL; return SUCCESS; } /* * nextOption * * Find the option descriptor and option argument (if any) for the * next command line argument. DO NOT modify the descriptor. Put * all the state in the state argument so that the option can be skipped * without consequence (side effect). */ static tSuccess nextOption(tOptions* pOpts, tOptState* pOptState) { { tSuccess res; res = findOptDesc(pOpts, pOptState); if (! SUCCESSFUL(res)) return res; } if ( ((pOptState->flags & OPTST_DEFINED) != 0) && ((pOptState->pOD->fOptState & OPTST_NO_COMMAND) != 0)) { fprintf(stderr, zNotCmdOpt, pOptState->pOD->pz_Name); return FAILURE; } pOptState->flags |= (pOptState->pOD->fOptState & OPTST_PERSISTENT_MASK); /* * Figure out what to do about option arguments. An argument may be * required, not associated with the option, or be optional. We detect the * latter by examining for an option marker on the next possible argument. * Disabled mode option selection also disables option arguments. */ { enum { ARG_NONE, ARG_MAY, ARG_MUST } arg_type = ARG_NONE; tSuccess res; if ((pOptState->flags & OPTST_DISABLED) != 0) arg_type = ARG_NONE; else if (OPTST_GET_ARGTYPE(pOptState->flags) == OPARG_TYPE_NONE) arg_type = ARG_NONE; else if (pOptState->flags & OPTST_ARG_OPTIONAL) arg_type = ARG_MAY; else arg_type = ARG_MUST; switch (arg_type) { case ARG_MUST: res = next_opt_arg_must(pOpts, pOptState); break; case ARG_MAY: res = next_opt_arg_may( pOpts, pOptState); break; case ARG_NONE: res = next_opt_arg_none(pOpts, pOptState); break; } return res; } } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DO PRESETS * * The next several routines do the immediate action pass on the command * line options, then the environment variables, then the config files in * reverse order. Once done with that, the order is reversed and all * the config files and environment variables are processed again, this * time only processing the non-immediate action options. doPresets() * will then return for optionProcess() to do the final pass on the command * line arguments. */ /** * scan the command line for immediate action options. * This is only called the first time through. */ LOCAL tSuccess doImmediateOpts(tOptions* pOpts) { pOpts->curOptIdx = 1; /* start by skipping program name */ pOpts->pzCurOpt = NULL; /* * Examine all the options from the start. We process any options that * are marked for immediate processing. */ for (;;) { tOptState optState = OPTSTATE_INITIALIZER(PRESET); switch (nextOption(pOpts, &optState)) { case FAILURE: goto failed_option; case PROBLEM: return SUCCESS; /* no more args */ case SUCCESS: break; } /* * IF this is an immediate-attribute option, then do it. */ if (! DO_IMMEDIATELY(optState.flags)) continue; if (! SUCCESSFUL(handle_opt(pOpts, &optState))) break; } failed_option:; if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE); return FAILURE; } /** * Process all the options from our current position onward. (This allows * interspersed options and arguments for the few non-standard programs that * require it.) Thus, do not rewind option indexes because some programs * choose to re-invoke after a non-option. */ LOCAL tSuccess doRegularOpts(tOptions* pOpts) { for (;;) { tOptState optState = OPTSTATE_INITIALIZER(DEFINED); switch (nextOption(pOpts, &optState)) { case FAILURE: goto failed_option; case PROBLEM: return SUCCESS; /* no more args */ case SUCCESS: break; } /* * IF this is an immediate action option, * THEN skip it (unless we are supposed to do it a second time). */ if (! DO_NORMALLY(optState.flags)) { if (! DO_SECOND_TIME(optState.flags)) continue; optState.pOD->optOccCt--; /* don't count this repetition */ } if (! SUCCESSFUL(handle_opt(pOpts, &optState))) break; } failed_option:; if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE); return FAILURE; } /** * check for preset values from a config files or envrionment variables */ static tSuccess doPresets(tOptions* pOpts) { tOptDesc * pOD = NULL; if (! SUCCESSFUL(doImmediateOpts(pOpts))) return FAILURE; /* * IF this option set has a --save-opts option, then it also * has a --load-opts option. See if a command line option has disabled * option presetting. */ if ( (pOpts->specOptIdx.save_opts != NO_EQUIVALENT) && (pOpts->specOptIdx.save_opts != 0)) { pOD = pOpts->pOptDesc + pOpts->specOptIdx.save_opts + 1; if (DISABLED_OPT(pOD)) return SUCCESS; } /* * Until we return from this procedure, disable non-presettable opts */ pOpts->fOptSet |= OPTPROC_PRESETTING; /* * IF there are no config files, * THEN do any environment presets and leave. */ if (pOpts->papzHomeList == NULL) { doEnvPresets(pOpts, ENV_ALL); } else { doEnvPresets(pOpts, ENV_IMM); /* * Check to see if environment variables have disabled presetting. */ if ((pOD != NULL) && ! DISABLED_OPT(pOD)) internalFileLoad(pOpts); /* * ${PROGRAM_LOAD_OPTS} value of "no" cannot disable other environment * variable options. Only the loading of .rc files. */ doEnvPresets(pOpts, ENV_NON_IMM); } pOpts->fOptSet &= ~OPTPROC_PRESETTING; return SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * VERIFY OPTION CONSISTENCY * * Make sure that the argument list passes our consistency tests. */ static int checkConsistency(tOptions* pOpts) { int errCt = 0; tOptDesc* pOD = pOpts->pOptDesc; int oCt = pOpts->presetOptCt; /* * FOR each of "oCt" options, ... */ for (;;) { const int* pMust = pOD->pOptMust; const int* pCant = pOD->pOptCant; /* * IF the current option was provided on the command line * THEN ensure that any "MUST" requirements are not * "DEFAULT" (unspecified) *AND* ensure that any * "CANT" options have not been SET or DEFINED. */ if (SELECTED_OPT(pOD)) { if (pMust != NULL) for (;;) { tOptDesc* p = pOpts->pOptDesc + *(pMust++); if (UNUSED_OPT(p)) { const tOptDesc* pN = pOpts->pOptDesc + pMust[-1]; errCt++; fprintf(stderr, zReqFmt, pOD->pz_Name, pN->pz_Name); } if (*pMust == NO_EQUIVALENT) break; } if (pCant != NULL) for (;;) { tOptDesc* p = pOpts->pOptDesc + *(pCant++); if (SELECTED_OPT(p)) { const tOptDesc* pN = pOpts->pOptDesc + pCant[-1]; errCt++; fprintf(stderr, zCantFmt, pOD->pz_Name, pN->pz_Name); } if (*pCant == NO_EQUIVALENT) break; } } /* * IF this option is not equivalenced to another, * OR it is equivalenced to itself (is the equiv. root) * THEN we need to make sure it occurs often enough. */ if ( (pOD->optEquivIndex == NO_EQUIVALENT) || (pOD->optEquivIndex == pOD->optIndex) ) do { /* * IF the occurrence counts have been satisfied, * THEN there is no problem. */ if (pOD->optOccCt >= pOD->optMinCt) break; /* * IF MUST_SET means SET and PRESET are okay, * so min occurrence count doesn't count */ if ( (pOD->fOptState & OPTST_MUST_SET) && (pOD->fOptState & (OPTST_PRESET | OPTST_SET)) ) break; errCt++; if (pOD->optMinCt > 1) fprintf(stderr, zNotEnough, pOD->pz_Name, pOD->optMinCt); else fprintf(stderr, zNeedOne, pOD->pz_Name); } while (0); if (--oCt <= 0) break; pOD++; } /* * IF we are stopping on errors, check to see if any remaining * arguments are required to be there or prohibited from being there. */ if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) { /* * Check for prohibition */ if ((pOpts->fOptSet & OPTPROC_NO_ARGS) != 0) { if (pOpts->origArgCt > pOpts->curOptIdx) { fprintf(stderr, zNoArgs, pOpts->pzProgName); ++errCt; } } /* * ELSE not prohibited, check for being required */ else if ((pOpts->fOptSet & OPTPROC_ARGS_REQ) != 0) { if (pOpts->origArgCt <= pOpts->curOptIdx) { fprintf(stderr, zArgsMust, pOpts->pzProgName); ++errCt; } } } return errCt; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * THESE ROUTINES ARE CALLABLE FROM THE GENERATED OPTION PROCESSING CODE */ /*=--subblock=arg=arg_type,arg_name,arg_desc =*/ /*=* * library: opts * header: your-opts.h * * lib_description: * * These are the routines that libopts users may call directly from their * code. There are several other routines that can be called by code * generated by the libopts option templates, but they are not to be * called from any other user code. The @file{options.h} header is * fairly clear about this, too. =*/ /*=export_func optionProcess * * what: this is the main option processing routine * * arg: + tOptions* + pOpts + program options descriptor + * arg: + int + argc + program arg count + * arg: + char** + argv + program arg vector + * * ret_type: int * ret_desc: the count of the arguments processed * * doc: * * This is the main entry point for processing options. It is intended * that this procedure be called once at the beginning of the execution of * a program. Depending on options selected earlier, it is sometimes * necessary to stop and restart option processing, or to select completely * different sets of options. This can be done easily, but you generally * do not want to do this. * * The number of arguments processed always includes the program name. * If one of the arguments is "--", then it is counted and the processing * stops. If an error was encountered and errors are to be tolerated, then * the returned value is the index of the argument causing the error. * A hyphen by itself ("-") will also cause processing to stop and will * @emph{not} be counted among the processed arguments. A hyphen by itself * is treated as an operand. Encountering an operand stops option * processing. * * err: Errors will cause diagnostics to be printed. @code{exit(3)} may * or may not be called. It depends upon whether or not the options * were generated with the "allow-errors" attribute, or if the * ERRSKIP_OPTERR or ERRSTOP_OPTERR macros were invoked. =*/ int optionProcess(tOptions * pOpts, int argCt, char ** argVect) { if (! SUCCESSFUL(validateOptionsStruct(pOpts, argVect[0]))) exit(EX_SOFTWARE); /* * Establish the real program name, the program full path, * and do all the presetting the first time thru only. */ if ((pOpts->fOptSet & OPTPROC_INITDONE) == 0) { pOpts->origArgCt = argCt; pOpts->origArgVect = argVect; pOpts->fOptSet |= OPTPROC_INITDONE; if (HAS_pzPkgDataDir(pOpts)) program_pkgdatadir = pOpts->pzPkgDataDir; if (! SUCCESSFUL(doPresets(pOpts))) return 0; /* * IF option name conversion was suppressed but it is not suppressed * for the command line, then it's time to translate option names. * Usage text will not get retranslated. */ if ( ((pOpts->fOptSet & OPTPROC_TRANSLATE) != 0) && (pOpts->pTransProc != NULL) && ((pOpts->fOptSet & OPTPROC_NO_XLAT_MASK) == OPTPROC_NXLAT_OPT_CFG) ) { pOpts->fOptSet &= ~OPTPROC_NXLAT_OPT_CFG; (*pOpts->pTransProc)(); } if ((pOpts->fOptSet & OPTPROC_REORDER) != 0) optionSort(pOpts); pOpts->curOptIdx = 1; pOpts->pzCurOpt = NULL; } /* * IF we are (re)starting, * THEN reset option location */ else if (pOpts->curOptIdx <= 0) { pOpts->curOptIdx = 1; pOpts->pzCurOpt = NULL; } if (! SUCCESSFUL(doRegularOpts(pOpts))) return pOpts->origArgCt; /* * IF there were no errors * AND we have RC/INI files * AND there is a request to save the files * THEN do that now before testing for conflicts. * (conflicts are ignored in preset options) */ if ( (pOpts->specOptIdx.save_opts != NO_EQUIVALENT) && (pOpts->specOptIdx.save_opts != 0)) { tOptDesc* pOD = pOpts->pOptDesc + pOpts->specOptIdx.save_opts; if (SELECTED_OPT(pOD)) { optionSaveFile(pOpts); exit(EXIT_SUCCESS); } } /* * IF we are checking for errors, * THEN look for too few occurrences of required options */ if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) { if (checkConsistency(pOpts) != 0) (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE); } return pOpts->curOptIdx; } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/autoopts.c */ ntp-4.2.6p5/sntp/libopts/README0000644000175000017500000001153011564122255015134 0ustar peterpeter THIS TARBALL IS NOT A FULL DISTRIBUTION. The contents of this tarball is designed to be incorporated into software packages that utilize the AutoOpts option automation package and are intended to be installed on systems that may not have libopts installed. It is redistributable under the terms of either the LGPL (see COPYING.lgpl) or under the terms of the advertising clause free BSD license (see COPYING.mbsd). Usage Instructions for autoconf/automake/libtoolized projects: 1. Install the unrolled tarball into your package source tree, copying ``libopts.m4'' to your autoconf macro directory. In your bootstrap (pre-configure) script, you can do this: rm -rf libopts libopts-* gunzip -c `autoopts-config libsrc` | tar -xvf - mv -f libopts-*.*.* libopts cp -fp libopts/m4/*.m4 m4/. I tend to put my configure auxiliary files in "m4". Whatever directory you choose, if it is not ".", then be sure to tell autoconf about it with: AC_CONFIG_AUX_DIR(m4) This is one macro where you *MUST* remember to *NOT* quote the argument. If you do, automake will get lost. 2. Add an invocation of either LIBOPTS_CHECK or LIBOPTS_CHECK_NOBUILD to your configure.ac file. See LIBOPTS_CHECK: below for details. 3. Add the following to your top level ``Makefile.am'' file: if NEED_LIBOPTS SUBDIRS += $(LIBOPTS_DIR) endif where ``<...>'' can be whatever other files or directories you may need. The SUBDIRS must be properly ordered. *PLEASE NOTE* it is crucial that the SUBDIRS be set under the control of an automake conditional. To work correctly, automake has to know the range of possible values of SUBDIRS. It's a magical name with magical properties. ``NEED_LIBOPTS'' will be correctly set by the ``LIBOPTS_CHECK'' macro, above. 4. Add ``$(LIBOPTS_CFLAGS)'' to relevant compiler flags and ``$(LIBOPTS_LDADD)'' to relevant link options whereever you need them in your build tree. 5. Make sure your object files explicitly depend upon the generated options header file. e.g.: $(prog_OBJECTS) : prog-opts.h prog-opts.h : prog-opts.c prog-opts.c : prog-opts.def autogen prog-opts.def 6. *OPTIONAL* -- If you are creating man pages and texi documentation from the program options, you will need these rules somewhere, too: man_MANS = prog.1 prog.1 : prog-opts.def autogen -Tagman-cmd.tpl -bprog prog-opts.def invoke-prog.texi : prog-opts.def autogen -Tagtexi-cmd.tpl prog-opts.def If your package does not utilize the auto* tools, then you will need to hand craft the rules for building the library. LIBOPTS_CHECK: The arguments to both macro are a relative path to the directory with the libopts source code. It is optional and defaults to "libopts". These macros work as follows: 1. LIBOPTS_CHECK([libopts/rel/path/optional]) Adds two command-line options to the generated configure script, --enable-local-libopts and --disable-libopts-install. AC_SUBST's LIBOPTS_CFLAGS, LIBOPTS_LDADD, and LIBOPTS_DIR for use in Makefile.am files. Adds Automake conditional NEED_LIBOPTS which will be true when the local copy of libopts should be built. Uses AC_CONFIG_FILES([$libopts-dir/Makefile]) to cause the local libopts into the package build. If the optional relative path to libopts is not provided, it defaults to simply "libopts". 2. LIBOPTS_CHECK_NOBUILD([libopts/rel/path/optional]) This variant of LIBOPTS_CHECK is useful when multiple configure.ac files in a package make use of a single libopts tearoff. In that case, only one of the configure.ac files should build libopts and others should simply use it. Consider this package arrangment: all-tools/ configure.ac common-tools/ configure.ac libopts/ The parent package all-tools contains a subpackage common-tools which can be torn off and used independently. Programs configured by both configure.ac files link against the common-tools/libopts tearoff, when not using the system's libopts. The top-level configure.ac uses LIBOPTS_CHECK_NOBUILD([common-tools/libopts]), while common-tools/configure.ac uses LIBOPTS_CHECK. The difference is LIBOPTS_CHECK_NOBUILD will never build the libopts tearoff, leaving that to the subpackage configure.ac's LIBOPTS_CHECK. Specifically, LIBOPTS_CHECK_NOBUILD always results in the NEED_LIBOPTS Automake conditional being false, and does not invoke AC_CONFIG_FILES(path-to-libopts/Makefile). LICENSING: This material is Copyright (c) 1992-2011 by Bruce Korb. You are licensed to use this under the terms of either the GNU Lesser General Public License (see: COPYING.lgpl), or, at your option, the modified Berkeley Software Distribution License (see: COPYING.mbsd). Both of these files should be included with this tarball. ntp-4.2.6p5/sntp/libopts/COPYING.lgplv30000644000175000017500000001671711564122253016527 0ustar peterpeter GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (c) 1992-2011 by Bruce Korb - all rights reserved Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. ntp-4.2.6p5/sntp/libopts/pgusage.c0000644000175000017500000000744211564122254016061 0ustar peterpeter /** * \file pgusage.c * * Time-stamp: "2011-03-25 17:54:41 bkorb" * * Automated Options Paged Usage module. * * This routine will run run-on options through a pager so the * user may examine, print or edit them at their leisure. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ /*=export_func optionPagedUsage * private: * * what: Decipher a boolean value * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * Run the usage output through a pager. * This is very handy if it is very long. * This is disabled on platforms without a working fork() function. =*/ void optionPagedUsage(tOptions* pOptions, tOptDesc* pOD) { #if ! defined(HAVE_WORKING_FORK) if ((pOD->fOptState & OPTST_RESET) != 0) return; (*pOptions->pUsageProc)(pOptions, EXIT_SUCCESS); #else static pid_t my_pid; char zPageUsage[ 1024 ]; /* * IF we are being called after the usage proc is done * (and thus has called "exit(2)") * THEN invoke the pager to page through the usage file we created. */ switch (pagerState) { case PAGER_STATE_INITIAL: { if ((pOD->fOptState & OPTST_RESET) != 0) return; my_pid = getpid(); #ifdef HAVE_SNPRINTF snprintf(zPageUsage, sizeof(zPageUsage), "/tmp/use.%lu", (tAoUL)my_pid); #else sprintf(zPageUsage, "/tmp/use.%lu", (tAoUL)my_pid); #endif unlink(zPageUsage); /* * Set usage output to this temporary file */ option_usage_fp = fopen(zPageUsage, "w" FOPEN_BINARY_FLAG); if (option_usage_fp == NULL) _exit(EXIT_FAILURE); pagerState = PAGER_STATE_READY; /* * Set up so this routine gets called during the exit logic */ atexit((void(*)(void))optionPagedUsage); /* * The usage procedure will now put the usage information into * the temporary file we created above. */ (*pOptions->pUsageProc)(pOptions, EXIT_SUCCESS); /* NOTREACHED */ _exit(EXIT_FAILURE); } case PAGER_STATE_READY: { tSCC zPage[] = "%1$s /tmp/use.%2$lu ; rm -f /tmp/use.%2$lu"; tCC* pzPager = (tCC*)getenv("PAGER"); /* * Use the "more(1)" program if "PAGER" has not been defined */ if (pzPager == NULL) pzPager = "more"; /* * Page the file and remove it when done. */ #ifdef HAVE_SNPRINTF snprintf(zPageUsage, sizeof(zPageUsage), zPage, pzPager, (tAoUL)my_pid); #else sprintf(zPageUsage, zPage, pzPager, (tAoUL)my_pid); #endif fclose(stderr); dup2(STDOUT_FILENO, STDERR_FILENO); (void)system(zPageUsage); } case PAGER_STATE_CHILD: /* * This is a child process used in creating shell script usage. */ break; } #endif } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/pgusage.c */ ntp-4.2.6p5/sntp/libopts/time.c0000644000175000017500000000734311564122255015365 0ustar peterpeter /** * \file time.c * * Time-stamp: "2011-03-06 11:52:23 bkorb" * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ /*=export_func optionTimeVal * private: * * what: process an option with a time duration. * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * Decipher a time duration value. =*/ void optionTimeVal(tOptions * pOpts, tOptDesc * pOD) { time_t val; if ((pOD->fOptState & OPTST_RESET) != 0) return; val = parse_duration(pOD->optArg.argString); if (val == BAD_TIME) { fprintf(stderr, zNotDuration, pOpts->pzProgName, pOD->optArg.argString); if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) (*(pOpts->pUsageProc))(pOpts, EXIT_FAILURE); } if (pOD->fOptState & OPTST_ALLOC_ARG) { AGFREE(pOD->optArg.argString); pOD->fOptState &= ~OPTST_ALLOC_ARG; } pOD->optArg.argInt = val; } /*=export_func optionTimeDate * private: * * what: process an option with a time and date. * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * Decipher a time and date value. =*/ void optionTimeDate(tOptions * pOpts, tOptDesc * pOD) { #if defined(HAVE_GETDATE_R) && defined(HAVE_PUTENV) if ((! HAS_pzPkgDataDir(pOpts)) || (pOpts->pzPkgDataDir == NULL)) goto default_action; /* * Export the DATEMSK environment variable. getdate_r() uses it to * find the file with the strptime formats. If we cannot find the file * we need ($PKGDATADIR/datemsk), then fall back to just a time duration. */ { static char * envptr = NULL; if (envptr == NULL) { static char const fmt[] = "DATEMSK=%s/datemsk"; envptr = AGALOC(sizeof(fmt) + strlen(pOpts->pzPkgDataDir), fmt); sprintf(envptr, fmt, pOpts->pzPkgDataDir); putenv(envptr); } if (access(envptr+8, R_OK) != 0) goto default_action; } /* * Convert the date to a time since the epoch and stash it in a long int. */ { struct tm stm; time_t tm; if (getdate_r(pOD->optArg.argString, &stm) != 0) { fprintf(stderr, zNotDate, pOpts->pzProgName, pOD->optArg.argString); if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) (*(pOpts->pUsageProc))(pOpts, EXIT_FAILURE); return; } tm = mktime(&stm); if (pOD->fOptState & OPTST_ALLOC_ARG) { AGFREE(pOD->optArg.argString); pOD->fOptState &= ~OPTST_ALLOC_ARG; } pOD->optArg.argInt = tm; } return; default_action: #endif optionTimeVal(pOpts, pOD); if (pOD->optArg.argInt != BAD_TIME) pOD->optArg.argInt += (unsigned long)time(NULL); } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/time.c */ ntp-4.2.6p5/sntp/libopts/tokenize.c0000644000175000017500000002162111564122255016252 0ustar peterpeter/* * This file defines the string_tokenize interface * Time-stamp: "2010-07-17 10:40:26 bkorb" * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ #include #include #define cc_t const unsigned char #define ch_t unsigned char /* = = = START-STATIC-FORWARD = = = */ static void copy_cooked(ch_t** ppDest, char const ** ppSrc); static void copy_raw(ch_t** ppDest, char const ** ppSrc); static token_list_t * alloc_token_list(char const * str); /* = = = END-STATIC-FORWARD = = = */ static void copy_cooked(ch_t** ppDest, char const ** ppSrc) { ch_t* pDest = (ch_t*)*ppDest; const ch_t* pSrc = (const ch_t*)(*ppSrc + 1); for (;;) { ch_t ch = *(pSrc++); switch (ch) { case NUL: *ppSrc = NULL; return; case '"': goto done; case '\\': pSrc += ao_string_cook_escape_char((char*)pSrc, (char*)&ch, 0x7F); if (ch == 0x7F) break; /* FALLTHROUGH */ default: *(pDest++) = ch; } } done: *ppDest = (ch_t*)pDest; /* next spot for storing character */ *ppSrc = (char const *)pSrc; /* char following closing quote */ } static void copy_raw(ch_t** ppDest, char const ** ppSrc) { ch_t* pDest = *ppDest; cc_t* pSrc = (cc_t*) (*ppSrc + 1); for (;;) { ch_t ch = *(pSrc++); switch (ch) { case NUL: *ppSrc = NULL; return; case '\'': goto done; case '\\': /* * *Four* escapes are handled: newline removal, escape char * quoting and apostrophe quoting */ switch (*pSrc) { case NUL: *ppSrc = NULL; return; case '\r': if (*(++pSrc) == '\n') ++pSrc; continue; case '\n': ++pSrc; continue; case '\'': ch = '\''; /* FALLTHROUGH */ case '\\': ++pSrc; break; } /* FALLTHROUGH */ default: *(pDest++) = ch; } } done: *ppDest = pDest; /* next spot for storing character */ *ppSrc = (char const *) pSrc; /* char following closing quote */ } static token_list_t * alloc_token_list(char const * str) { token_list_t * res; int max_token_ct = 2; /* allow for trailing NULL pointer & NUL on string */ if (str == NULL) goto enoent_res; /* * Trim leading white space. Use "ENOENT" and a NULL return to indicate * an empty string was passed. */ while (IS_WHITESPACE_CHAR(*str)) str++; if (*str == NUL) goto enoent_res; /* * Take an approximate count of tokens. If no quoted strings are used, * it will be accurate. If quoted strings are used, it will be a little * high and we'll squander the space for a few extra pointers. */ { cc_t* pz = (cc_t*)str; do { max_token_ct++; while (! IS_WHITESPACE_CHAR(*++pz)) if (*pz == NUL) goto found_nul; while (IS_WHITESPACE_CHAR(*pz)) pz++; } while (*pz != NUL); found_nul: res = malloc(sizeof(*res) + (pz - (cc_t*)str) + (max_token_ct * sizeof(ch_t*))); } if (res == NULL) errno = ENOMEM; else res->tkn_list[0] = (ch_t*)(res->tkn_list + (max_token_ct - 1)); return res; enoent_res: errno = ENOENT; return NULL; } /*=export_func ao_string_tokenize * * what: tokenize an input string * * arg: + char const* + string + string to be tokenized + * * ret_type: token_list_t* * ret_desc: pointer to a structure that lists each token * * doc: * * This function will convert one input string into a list of strings. * The list of strings is derived by separating the input based on * white space separation. However, if the input contains either single * or double quote characters, then the text after that character up to * a matching quote will become the string in the list. * * The returned pointer should be deallocated with @code{free(3C)} when * are done using the data. The data are placed in a single block of * allocated memory. Do not deallocate individual token/strings. * * The structure pointed to will contain at least these two fields: * @table @samp * @item tkn_ct * The number of tokens found in the input string. * @item tok_list * An array of @code{tkn_ct + 1} pointers to substring tokens, with * the last pointer set to NULL. * @end table * * There are two types of quoted strings: single quoted (@code{'}) and * double quoted (@code{"}). Singly quoted strings are fairly raw in that * escape characters (@code{\\}) are simply another character, except when * preceding the following characters: * @example * @code{\\} double backslashes reduce to one * @code{'} incorporates the single quote into the string * @code{\n} suppresses both the backslash and newline character * @end example * * Double quote strings are formed according to the rules of string * constants in ANSI-C programs. * * example: * @example * #include * int ix; * token_list_t* ptl = ao_string_tokenize(some_string) * for (ix = 0; ix < ptl->tkn_ct; ix++) * do_something_with_tkn(ptl->tkn_list[ix]); * free(ptl); * @end example * Note that everything is freed with the one call to @code{free(3C)}. * * err: * NULL is returned and @code{errno} will be set to indicate the problem: * @itemize @bullet * @item * @code{EINVAL} - There was an unterminated quoted string. * @item * @code{ENOENT} - The input string was empty. * @item * @code{ENOMEM} - There is not enough memory. * @end itemize =*/ token_list_t* ao_string_tokenize(char const* str) { token_list_t* res = alloc_token_list(str); ch_t* pzDest; /* * Now copy each token into the output buffer. */ if (res == NULL) return res; pzDest = (ch_t*)(res->tkn_list[0]); res->tkn_ct = 0; do { res->tkn_list[ res->tkn_ct++ ] = pzDest; for (;;) { int ch = (ch_t)*str; if (IS_WHITESPACE_CHAR(ch)) { found_white_space: while (IS_WHITESPACE_CHAR(*++str)) ; break; } switch (ch) { case '"': copy_cooked(&pzDest, &str); if (str == NULL) { free(res); errno = EINVAL; return NULL; } if (IS_WHITESPACE_CHAR(*str)) goto found_white_space; break; case '\'': copy_raw(&pzDest, &str); if (str == NULL) { free(res); errno = EINVAL; return NULL; } if (IS_WHITESPACE_CHAR(*str)) goto found_white_space; break; case NUL: goto copy_done; default: str++; *(pzDest++) = ch; } } copy_done:; /* * NUL terminate the last token and see if we have any more tokens. */ *(pzDest++) = NUL; } while (*str != NUL); res->tkn_list[ res->tkn_ct ] = NULL; return res; } #ifdef TEST #include #include int main(int argc, char** argv) { if (argc == 1) { printf("USAGE: %s arg [ ... ]\n", *argv); return 1; } while (--argc > 0) { char* arg = *(++argv); token_list_t* p = ao_string_tokenize(arg); if (p == NULL) { printf("Parsing string ``%s'' failed:\n\terrno %d (%s)\n", arg, errno, strerror(errno)); } else { int ix = 0; printf("Parsed string ``%s''\ninto %d tokens:\n", arg, p->tkn_ct); do { printf(" %3d: ``%s''\n", ix+1, p->tkn_list[ix]); } while (++ix < p->tkn_ct); free(p); } } return 0; } #endif /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/tokenize.c */ ntp-4.2.6p5/sntp/libopts/environment.c0000644000175000017500000001571411564122254016773 0ustar peterpeter /** * \file environment.c * * Time-stamp: "2011-04-06 09:35:55 bkorb" * * This file contains all of the routines that must be linked into * an executable to use the generated option processing. The optional * routines are in separately compiled modules so that they will not * necessarily be linked in. * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ /* = = = START-STATIC-FORWARD = = = */ static void do_env_opt(tOptState * os, char * env_name, tOptions* pOpts, teEnvPresetType type); /* = = = END-STATIC-FORWARD = = = */ /* * doPrognameEnv - check for preset values from the ${PROGNAME} * environment variable. This is accomplished by parsing the text into * tokens, temporarily replacing the arg vector and calling * doImmediateOpts and/or doRegularOpts. */ LOCAL void doPrognameEnv(tOptions* pOpts, teEnvPresetType type) { char const* pczOptStr = getenv(pOpts->pzPROGNAME); token_list_t* pTL; int sv_argc; tAoUI sv_flag; char** sv_argv; /* * No such beast? Then bail now. */ if (pczOptStr == NULL) return; /* * Tokenize the string. If there's nothing of interest, we'll bail * here immediately. */ pTL = ao_string_tokenize(pczOptStr); if (pTL == NULL) return; /* * Substitute our $PROGNAME argument list for the real one */ sv_argc = pOpts->origArgCt; sv_argv = pOpts->origArgVect; sv_flag = pOpts->fOptSet; /* * We add a bogus pointer to the start of the list. The program name * has already been pulled from "argv", so it won't get dereferenced. * The option scanning code will skip the "program name" at the start * of this list of tokens, so we accommodate this way .... */ pOpts->origArgVect = (char**)(pTL->tkn_list - 1); pOpts->origArgCt = pTL->tkn_ct + 1; pOpts->fOptSet &= ~OPTPROC_ERRSTOP; pOpts->curOptIdx = 1; pOpts->pzCurOpt = NULL; switch (type) { case ENV_IMM: (void)doImmediateOpts(pOpts); break; case ENV_ALL: (void)doImmediateOpts(pOpts); pOpts->curOptIdx = 1; pOpts->pzCurOpt = NULL; /* FALLTHROUGH */ case ENV_NON_IMM: (void)doRegularOpts(pOpts); } /* * Free up the temporary arg vector and restore the original program args. */ free(pTL); pOpts->origArgVect = sv_argv; pOpts->origArgCt = sv_argc; pOpts->fOptSet = sv_flag; } static void do_env_opt(tOptState * os, char * env_name, tOptions* pOpts, teEnvPresetType type) { os->pzOptArg = getenv(env_name); if (os->pzOptArg == NULL) return; os->flags = OPTST_PRESET | OPTST_ALLOC_ARG | os->pOD->fOptState; os->optType = TOPT_UNDEFINED; if ( (os->pOD->pz_DisablePfx != NULL) && (streqvcmp(os->pzOptArg, os->pOD->pz_DisablePfx) == 0)) { os->flags |= OPTST_DISABLED; os->pzOptArg = NULL; } switch (type) { case ENV_IMM: /* * Process only immediate actions */ if (DO_IMMEDIATELY(os->flags)) break; return; case ENV_NON_IMM: /* * Process only NON immediate actions */ if (DO_NORMALLY(os->flags) || DO_SECOND_TIME(os->flags)) break; return; default: /* process everything */ break; } /* * Make sure the option value string is persistent and consistent. * * The interpretation of the option value depends * on the type of value argument the option takes */ if (OPTST_GET_ARGTYPE(os->pOD->fOptState) == OPARG_TYPE_NONE) { /* * Ignore any value. */ os->pzOptArg = NULL; } else if (os->pzOptArg[0] == NUL) { /* * If the argument is the empty string and the argument is * optional, then treat it as if the option was not specified. */ if ((os->pOD->fOptState & OPTST_ARG_OPTIONAL) == 0) return; os->pzOptArg = NULL; } else { AGDUPSTR(os->pzOptArg, os->pzOptArg, "option argument"); os->flags |= OPTST_ALLOC_ARG; } handle_opt(pOpts, os); } /* * doEnvPresets - check for preset values from the envrionment * This routine should process in all, immediate or normal modes.... */ LOCAL void doEnvPresets(tOptions* pOpts, teEnvPresetType type) { int ct; tOptState st; char* pzFlagName; size_t spaceLeft; char zEnvName[ AO_NAME_SIZE ]; /* * Finally, see if we are to look at the environment * variables for initial values. */ if ((pOpts->fOptSet & OPTPROC_ENVIRON) == 0) return; doPrognameEnv(pOpts, type); ct = pOpts->presetOptCt; st.pOD = pOpts->pOptDesc; pzFlagName = zEnvName + snprintf(zEnvName, sizeof(zEnvName), "%s_", pOpts->pzPROGNAME); spaceLeft = AO_NAME_SIZE - (pzFlagName - zEnvName) - 1; for (;ct-- > 0; st.pOD++) { size_t nln; /* * If presetting is disallowed, then skip this entry */ if ( ((st.pOD->fOptState & OPTST_NO_INIT) != 0) || (st.pOD->optEquivIndex != NO_EQUIVALENT) ) continue; /* * IF there is no such environment variable, * THEN skip this entry, too. */ nln = strlen(st.pOD->pz_NAME) + 1; if (nln <= spaceLeft) { /* * Set up the option state */ memcpy(pzFlagName, st.pOD->pz_NAME, nln); do_env_opt(&st, zEnvName, pOpts, type); } } /* * Special handling for ${PROGNAME_LOAD_OPTS} */ if ( (pOpts->specOptIdx.save_opts != NO_EQUIVALENT) && (pOpts->specOptIdx.save_opts != 0)) { size_t nln; st.pOD = pOpts->pOptDesc + pOpts->specOptIdx.save_opts + 1; if (st.pOD->pz_NAME == NULL) return; nln = strlen(st.pOD->pz_NAME) + 1; if (nln > spaceLeft) return; memcpy(pzFlagName, st.pOD->pz_NAME, nln); do_env_opt(&st, zEnvName, pOpts, type); } } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/environment.c */ ntp-4.2.6p5/sntp/libopts/streqvcmp.c0000644000175000017500000001740511564122254016452 0ustar peterpeter /** * \file streqvcmp.c * * Time-stamp: "2010-07-17 10:16:24 bkorb" * * String Equivalence Comparison * * These routines allow any character to be mapped to any other * character before comparison. In processing long option names, * the characters "-", "_" and "^" all need to be equivalent * (because they are treated so by different development environments). * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd * * This array is designed for mapping upper and lower case letter * together for a case independent comparison. The mappings are * based upon ascii character sequences. */ static unsigned char charmap[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, '\a', '\b', '\t', '\n', '\v', '\f', '\r', 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, }; /*=export_func strneqvcmp * * what: compare two strings with an equivalence mapping * * arg: + char const* + str1 + first string + * arg: + char const* + str2 + second string + * arg: + int + ct + compare length + * * ret_type: int * ret_desc: the difference between two differing characters * * doc: * * Using a character mapping, two strings are compared for "equivalence". * Each input character is mapped to a comparison character and the * mapped-to characters are compared for the two NUL terminated input strings. * The comparison is limited to @code{ct} bytes. * This function name is mapped to option_strneqvcmp so as to not conflict * with the POSIX name space. * * err: none checked. Caller responsible for seg faults. =*/ int strneqvcmp(tCC* s1, tCC* s2, int ct) { for (; ct > 0; --ct) { unsigned char u1 = (unsigned char) *s1++; unsigned char u2 = (unsigned char) *s2++; int dif = charmap[ u1 ] - charmap[ u2 ]; if (dif != 0) return dif; if (u1 == NUL) return 0; } return 0; } /*=export_func streqvcmp * * what: compare two strings with an equivalence mapping * * arg: + char const* + str1 + first string + * arg: + char const* + str2 + second string + * * ret_type: int * ret_desc: the difference between two differing characters * * doc: * * Using a character mapping, two strings are compared for "equivalence". * Each input character is mapped to a comparison character and the * mapped-to characters are compared for the two NUL terminated input strings. * This function name is mapped to option_streqvcmp so as to not conflict * with the POSIX name space. * * err: none checked. Caller responsible for seg faults. =*/ int streqvcmp(tCC* s1, tCC* s2) { for (;;) { unsigned char u1 = (unsigned char) *s1++; unsigned char u2 = (unsigned char) *s2++; int dif = charmap[ u1 ] - charmap[ u2 ]; if (dif != 0) return dif; if (u1 == NUL) return 0; } } /*=export_func streqvmap * * what: Set the character mappings for the streqv functions * * arg: + char + From + Input character + * arg: + char + To + Mapped-to character + * arg: + int + ct + compare length + * * doc: * * Set the character mapping. If the count (@code{ct}) is set to zero, then * the map is cleared by setting all entries in the map to their index * value. Otherwise, the "@code{From}" character is mapped to the "@code{To}" * character. If @code{ct} is greater than 1, then @code{From} and @code{To} * are incremented and the process repeated until @code{ct} entries have been * set. For example, * @example * streqvmap('a', 'A', 26); * @end example * @noindent * will alter the mapping so that all English lower case letters * will map to upper case. * * This function name is mapped to option_streqvmap so as to not conflict * with the POSIX name space. * * err: none. =*/ void streqvmap(char From, char To, int ct) { if (ct == 0) { ct = sizeof(charmap) - 1; do { charmap[ ct ] = ct; } while (--ct >= 0); } else { int chTo = (int)To & 0xFF; int chFrom = (int)From & 0xFF; do { charmap[ chFrom ] = (unsigned)chTo; chFrom++; chTo++; if ((chFrom >= sizeof(charmap)) || (chTo >= sizeof(charmap))) break; } while (--ct > 0); } } /*=export_func strequate * * what: map a list of characters to the same value * * arg: + char const* + ch_list + characters to equivalence + * * doc: * * Each character in the input string get mapped to the first character * in the string. * This function name is mapped to option_strequate so as to not conflict * with the POSIX name space. * * err: none. =*/ void strequate(char const* s) { if ((s != NULL) && (*s != NUL)) { unsigned char equiv = (unsigned)*s; while (*s != NUL) charmap[ (unsigned)*(s++) ] = equiv; } } /*=export_func strtransform * * what: convert a string into its mapped-to value * * arg: + char* + dest + output string + * arg: + char const* + src + input string + * * doc: * * Each character in the input string is mapped and the mapped-to * character is put into the output. * This function name is mapped to option_strtransform so as to not conflict * with the POSIX name space. * * The source and destination may be the same. * * err: none. =*/ void strtransform(char* d, char const* s) { do { *(d++) = (char)charmap[ (unsigned)*s ]; } while (*(s++) != NUL); } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/streqvcmp.c */ ntp-4.2.6p5/sntp/libopts/usage.c0000644000175000017500000006240311564122254015530 0ustar peterpeter /* * \file usage.c * * Time-stamp: "2011-02-01 14:42:37 bkorb" * * This module implements the default usage procedure for * Automated Options. It may be overridden, of course. * * Sort options: --start=END-[S]TATIC-FORWARD --patt='^/\*($|[^:])' \ --out=xx.c key='^[a-zA-Z0-9_]+\(' --trail='^/\*:' \ --spac=2 --input=usage.c */ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. * AutoOpts is Copyright (c) 1992-2011 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control * of the user of the license. * * The GNU Lesser General Public License, version 3 or later * See the files "COPYING.lgplv3" and "COPYING.gplv3" * * The Modified Berkeley Software Distribution License * See the file "COPYING.mbsd" * * These files have the following md5sums: * * 43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3 * 06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3 * 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd */ #define OPTPROC_L_N_S (OPTPROC_LONGOPT | OPTPROC_SHORTOPT) /* = = = START-STATIC-FORWARD = = = */ static void set_usage_flags(tOptions * opts, char const * flg_txt); static inline ag_bool do_gnu_usage(tOptions * pOpts); static inline ag_bool skip_misuse_usage(tOptions * pOpts); static void print_usage_details(tOptions * opts, int exit_code); static void prt_extd_usage(tOptions * pOptions, tOptDesc * pOD, arg_types_t * pAT); static void prt_ini_list(char const * const * papz, ag_bool * pInitIntro, char const * pzRc, char const * pzPN); static void prt_preamble(tOptions * pOptions, tOptDesc * pOD, arg_types_t * pAT); static void prt_one_usage(tOptions * pOptions, tOptDesc * pOD, arg_types_t * pAT); static void prt_opt_usage(tOptions * pOpts, int ex_code, char const * pOptTitle); static void prt_prog_detail(tOptions* pOptions); static int setGnuOptFmts(tOptions* pOpts, tCC** ppT); static int setStdOptFmts(tOptions* pOpts, tCC** ppT); /* = = = END-STATIC-FORWARD = = = */ /* * NB: no entry may be a prefix of another entry */ #define AOFLAG_TABLE \ _aof_(gnu, OPTPROC_GNUUSAGE ) \ _aof_(autoopts, ~OPTPROC_GNUUSAGE) \ _aof_(no_misuse_usage, OPTPROC_MISUSE ) \ _aof_(misuse_usage, ~OPTPROC_MISUSE ) static void set_usage_flags(tOptions * opts, char const * flg_txt) { typedef struct { size_t fnm_len; uint32_t fnm_mask; char const * fnm_name; } ao_flag_names_t; # define _aof_(_n, _f) AOUF_ ## _n ## _ID, typedef enum { AOFLAG_TABLE AOUF_COUNT } ao_flag_id_t; # undef _aof_ # define _aof_(_n, _f) AOUF_ ## _n = (1 << AOUF_ ## _n ## _ID), typedef enum { AOFLAG_TABLE } ao_flags_t; # undef _aof_ # define _aof_(_n, _f) { sizeof(#_n)-1, _f, #_n }, static ao_flag_names_t const fn_table[AOUF_COUNT] = { AOFLAG_TABLE }; # undef _aof_ ao_flags_t flg = 0; if (flg_txt == NULL) { flg_txt = getenv("AUTOOPTS_USAGE"); if (flg_txt == NULL) return; } while (IS_WHITESPACE_CHAR(*flg_txt)) flg_txt++; if (*flg_txt == NUL) return; for (;;) { int ix = 0; ao_flag_names_t const * fnt = fn_table; for (;;) { if (strneqvcmp(flg_txt, fnt->fnm_name, fnt->fnm_len) == 0) break; if (++ix >= AOUF_COUNT) return; fnt++; } /* * Make sure we have a full match. Look for whitespace, * a comma, or a NUL byte. */ if (! IS_END_LIST_ENTRY_CHAR(flg_txt[fnt->fnm_len])) return; flg |= 1 << ix; flg_txt += fnt->fnm_len; while (IS_WHITESPACE_CHAR(*flg_txt)) flg_txt++; if (*flg_txt == NUL) break; if (*flg_txt == ',') { /* * skip the comma and following white space */ while (IS_WHITESPACE_CHAR(*++flg_txt)) ; if (*flg_txt == NUL) break; } } { ao_flag_names_t const * fnm = fn_table; while (flg != 0) { if ((flg & 1) != 0) { if ((fnm->fnm_mask & OPTPROC_LONGOPT) != 0) opts->fOptSet &= fnm->fnm_mask; else opts->fOptSet |= fnm->fnm_mask; } flg >>= 1; fnm++; } } } /* * Figure out if we should try to format usage text sort-of like * the way many GNU programs do. */ static inline ag_bool do_gnu_usage(tOptions * pOpts) { return (pOpts->fOptSet & OPTPROC_GNUUSAGE) ? AG_TRUE : AG_FALSE; } /* * Figure out if we should try to format usage text sort-of like * the way many GNU programs do. */ static inline ag_bool skip_misuse_usage(tOptions * pOpts) { return (pOpts->fOptSet & OPTPROC_MISUSE) ? AG_TRUE : AG_FALSE; } /*=export_func optionOnlyUsage * * what: Print usage text for just the options * arg: + tOptions* + pOpts + program options descriptor + * arg: + int + ex_code + exit code for calling exit(3) + * * doc: * This routine will print only the usage for each option. * This function may be used when the emitted usage must incorporate * information not available to AutoOpts. =*/ void optionOnlyUsage(tOptions * pOpts, int ex_code) { char const * pOptTitle = NULL; set_usage_flags(pOpts, NULL); if ((ex_code != EXIT_SUCCESS) && skip_misuse_usage(pOpts)) return; /* * Determine which header and which option formatting strings to use */ if (do_gnu_usage(pOpts)) { (void)setGnuOptFmts(pOpts, &pOptTitle); } else { (void)setStdOptFmts(pOpts, &pOptTitle); } prt_opt_usage(pOpts, ex_code, pOptTitle); fflush(option_usage_fp); if (ferror(option_usage_fp) != 0) { fputs(zOutputFail, stderr); exit(EXIT_FAILURE); } } static void print_usage_details(tOptions * opts, int exit_code) { { char const * pOptTitle = NULL; /* * Determine which header and which option formatting strings to use */ if (do_gnu_usage(opts)) { int flen = setGnuOptFmts(opts, &pOptTitle); sprintf(zOptFmtLine, zFmtFmt, flen); fputc('\n', option_usage_fp); } else { int flen = setStdOptFmts(opts, &pOptTitle); sprintf(zOptFmtLine, zFmtFmt, flen); /* * When we exit with EXIT_SUCCESS and the first option is a doc * option, we do *NOT* want to emit the column headers. * Otherwise, we do. */ if ( (exit_code != EXIT_SUCCESS) || ((opts->pOptDesc->fOptState & OPTST_DOCUMENT) == 0) ) fputs(pOptTitle, option_usage_fp); } prt_opt_usage(opts, exit_code, pOptTitle); } /* * Describe the mechanics of denoting the options */ switch (opts->fOptSet & OPTPROC_L_N_S) { case OPTPROC_L_N_S: fputs(zFlagOkay, option_usage_fp); break; case OPTPROC_SHORTOPT: break; case OPTPROC_LONGOPT: fputs(zNoFlags, option_usage_fp); break; case 0: fputs(zOptsOnly, option_usage_fp); break; } if ((opts->fOptSet & OPTPROC_NUM_OPT) != 0) fputs(zNumberOpt, option_usage_fp); if ((opts->fOptSet & OPTPROC_REORDER) != 0) fputs(zReorder, option_usage_fp); if (opts->pzExplain != NULL) fputs(opts->pzExplain, option_usage_fp); /* * IF the user is asking for help (thus exiting with SUCCESS), * THEN see what additional information we can provide. */ if (exit_code == EXIT_SUCCESS) prt_prog_detail(opts); /* * Give bug notification preference to the packager information */ if (HAS_pzPkgDataDir(opts) && (opts->pzPackager != NULL)) fputs(opts->pzPackager, option_usage_fp); else if (opts->pzBugAddr != NULL) fprintf(option_usage_fp, zPlsSendBugs, opts->pzBugAddr); fflush(option_usage_fp); if (ferror(option_usage_fp) != 0) { fputs(zOutputFail, stderr); exit(EXIT_FAILURE); } } /*=export_func optionUsage * private: * * what: Print usage text * arg: + tOptions* + pOptions + program options descriptor + * arg: + int + exitCode + exit code for calling exit(3) + * * doc: * This routine will print usage in both GNU-standard and AutoOpts-expanded * formats. The descriptor specifies the default, but AUTOOPTS_USAGE will * over-ride this, providing the value of it is set to either "gnu" or * "autoopts". This routine will @strong{not} return. * * If "exitCode" is "EX_USAGE" (normally 64), then output will to to stdout * and the actual exit code will be "EXIT_SUCCESS". =*/ void optionUsage(tOptions * pOptions, int usage_exit_code) { int exit_code = (usage_exit_code == EX_USAGE) ? EXIT_SUCCESS : usage_exit_code; displayEnum = AG_FALSE; /* * Paged usage will preset option_usage_fp to an output file. * If it hasn't already been set, then set it to standard output * on successful exit (help was requested), otherwise error out. * * Test the version before obtaining pzFullUsage or pzShortUsage. * These fields do not exist before revision 30. */ { char const * pz; if (exit_code == EXIT_SUCCESS) { pz = (pOptions->structVersion >= 30 * 4096) ? pOptions->pzFullUsage : NULL; if (option_usage_fp == NULL) option_usage_fp = stdout; } else { pz = (pOptions->structVersion >= 30 * 4096) ? pOptions->pzShortUsage : NULL; if (option_usage_fp == NULL) option_usage_fp = stderr; } if (pz != NULL) { fputs(pz, option_usage_fp); exit(exit_code); } } fprintf(option_usage_fp, pOptions->pzUsageTitle, pOptions->pzProgName); set_usage_flags(pOptions, NULL); if ((exit_code == EXIT_SUCCESS) || (! skip_misuse_usage(pOptions))) print_usage_details(pOptions, usage_exit_code); exit(exit_code); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * PER OPTION TYPE USAGE INFORMATION */ static void prt_extd_usage(tOptions * pOptions, tOptDesc * pOD, arg_types_t * pAT) { /* * IF there are option conflicts or dependencies, * THEN print them here. */ if ( (pOD->pOptMust != NULL) || (pOD->pOptCant != NULL) ) { fputs(zTabHyp, option_usage_fp); /* * DEPENDENCIES: */ if (pOD->pOptMust != NULL) { const int* pOptNo = pOD->pOptMust; fputs(zReqThese, option_usage_fp); for (;;) { fprintf(option_usage_fp, zTabout, pOptions->pOptDesc[*pOptNo].pz_Name); if (*++pOptNo == NO_EQUIVALENT) break; } if (pOD->pOptCant != NULL) fputs(zTabHypAnd, option_usage_fp); } /* * CONFLICTS: */ if (pOD->pOptCant != NULL) { const int* pOptNo = pOD->pOptCant; fputs(zProhib, option_usage_fp); for (;;) { fprintf(option_usage_fp, zTabout, pOptions->pOptDesc[*pOptNo].pz_Name); if (*++pOptNo == NO_EQUIVALENT) break; } } } /* * IF there is a disablement string * THEN print the disablement info */ if (pOD->pz_DisableName != NULL ) fprintf(option_usage_fp, zDis, pOD->pz_DisableName); /* * Check for argument types that have callbacks with magical properties */ switch (OPTST_GET_ARGTYPE(pOD->fOptState)) { case OPARG_TYPE_NUMERIC: /* * IF the numeric option has a special callback, * THEN call it, requesting the range or other special info */ if ( (pOD->pOptProc != NULL) && (pOD->pOptProc != optionNumericVal) ) { (*(pOD->pOptProc))(OPTPROC_EMIT_USAGE, pOD); } break; case OPARG_TYPE_FILE: (*(pOD->pOptProc))(OPTPROC_EMIT_USAGE, pOD); break; } /* * IF the option defaults to being enabled, * THEN print that out */ if (pOD->fOptState & OPTST_INITENABLED) fputs(zEnab, option_usage_fp); /* * IF the option is in an equivalence class * AND not the designated lead * THEN print equivalence and leave it at that. */ if ( (pOD->optEquivIndex != NO_EQUIVALENT) && (pOD->optEquivIndex != pOD->optActualIndex ) ) { fprintf(option_usage_fp, zAlt, pOptions->pOptDesc[ pOD->optEquivIndex ].pz_Name); return; } /* * IF this particular option can NOT be preset * AND some form of presetting IS allowed, * AND it is not an auto-managed option (e.g. --help, et al.) * THEN advise that this option may not be preset. */ if ( ((pOD->fOptState & OPTST_NO_INIT) != 0) && ( (pOptions->papzHomeList != NULL) || (pOptions->pzPROGNAME != NULL) ) && (pOD->optIndex < pOptions->presetOptCt) ) fputs(zNoPreset, option_usage_fp); /* * Print the appearance requirements. */ if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_MEMBERSHIP) fputs(zMembers, option_usage_fp); else switch (pOD->optMinCt) { case 1: case 0: switch (pOD->optMaxCt) { case 0: fputs(zPreset, option_usage_fp); break; case NOLIMIT: fputs(zNoLim, option_usage_fp); break; case 1: break; /* * IF the max is more than one but limited, print "UP TO" message */ default: fprintf(option_usage_fp, zUpTo, pOD->optMaxCt); break; } break; default: /* * More than one is required. Print the range. */ fprintf(option_usage_fp, zMust, pOD->optMinCt, pOD->optMaxCt); } if ( NAMED_OPTS(pOptions) && (pOptions->specOptIdx.default_opt == pOD->optIndex)) fputs(zDefaultOpt, option_usage_fp); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Figure out where all the initialization files might live. * This requires translating some environment variables and * testing to see if a name is a directory or a file. It's * squishy, but important to tell users how to find these files. */ static void prt_ini_list(char const * const * papz, ag_bool * pInitIntro, char const * pzRc, char const * pzPN) { char zPath[AG_PATH_MAX+1]; if (papz == NULL) return; fputs(zPresetIntro, option_usage_fp); *pInitIntro = AG_FALSE; for (;;) { char const * pzPath = *(papz++); char const * pzReal = zPath; if (pzPath == NULL) break; /* * Ignore any invalid paths */ if (! optionMakePath(zPath, (int)sizeof(zPath), pzPath, pzPN)) pzReal = pzPath; /* * Expand paths that are relative to the executable or installation * directories. Leave alone paths that use environment variables. */ else if ((*pzPath == '$') && ((pzPath[1] == '$') || (pzPath[1] == '@'))) pzPath = pzReal; /* * Print the name of the "homerc" file. If the "rcfile" name is * not empty, we may or may not print that, too... */ fprintf(option_usage_fp, zPathFmt, pzPath); if (*pzRc != NUL) { struct stat sb; /* * IF the "homerc" file is a directory, * then append the "rcfile" name. */ if ((stat(pzReal, &sb) == 0) && S_ISDIR(sb.st_mode)) { fputc(DIRCH, option_usage_fp); fputs(pzRc, option_usage_fp); } } fputc('\n', option_usage_fp); } } static void prt_preamble(tOptions * pOptions, tOptDesc * pOD, arg_types_t * pAT) { /* * Flag prefix: IF no flags at all, then omit it. If not printable * (not allowed for this option), then blank, else print it. * Follow it with a comma if we are doing GNU usage and long * opts are to be printed too. */ if ((pOptions->fOptSet & OPTPROC_SHORTOPT) == 0) fputs(pAT->pzSpc, option_usage_fp); else if (! IS_GRAPHIC_CHAR(pOD->optValue)) { if ( (pOptions->fOptSet & (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT)) == (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT)) fputc(' ', option_usage_fp); fputs(pAT->pzNoF, option_usage_fp); } else { fprintf(option_usage_fp, " -%c", pOD->optValue); if ( (pOptions->fOptSet & (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT)) == (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT)) fputs(", ", option_usage_fp); } } /* * Print the usage information for a single option. */ static void prt_one_usage(tOptions * pOptions, tOptDesc * pOD, arg_types_t * pAT) { prt_preamble(pOptions, pOD, pAT); { char z[ 80 ]; char const * pzArgType; /* * Determine the argument type string first on its usage, then, * when the option argument is required, base the type string on the * argument type. */ if (pOD->fOptState & OPTST_ARG_OPTIONAL) { pzArgType = pAT->pzOpt; } else switch (OPTST_GET_ARGTYPE(pOD->fOptState)) { case OPARG_TYPE_NONE: pzArgType = pAT->pzNo; break; case OPARG_TYPE_ENUMERATION: pzArgType = pAT->pzKey; break; case OPARG_TYPE_FILE: pzArgType = pAT->pzFile; break; case OPARG_TYPE_MEMBERSHIP: pzArgType = pAT->pzKeyL; break; case OPARG_TYPE_BOOLEAN: pzArgType = pAT->pzBool; break; case OPARG_TYPE_NUMERIC: pzArgType = pAT->pzNum; break; case OPARG_TYPE_HIERARCHY: pzArgType = pAT->pzNest; break; case OPARG_TYPE_STRING: pzArgType = pAT->pzStr; break; case OPARG_TYPE_TIME: pzArgType = pAT->pzTime; break; default: goto bogus_desc; } snprintf(z, sizeof(z), pAT->pzOptFmt, pzArgType, pOD->pz_Name, (pOD->optMinCt != 0) ? pAT->pzReq : pAT->pzOpt); fprintf(option_usage_fp, zOptFmtLine, z, pOD->pzText); switch (OPTST_GET_ARGTYPE(pOD->fOptState)) { case OPARG_TYPE_ENUMERATION: case OPARG_TYPE_MEMBERSHIP: displayEnum = (pOD->pOptProc != NULL) ? AG_TRUE : displayEnum; } } return; bogus_desc: fprintf(stderr, zInvalOptDesc, pOD->pz_Name); exit(EX_SOFTWARE); } /* * Print out the usage information for just the options. */ static void prt_opt_usage(tOptions * pOpts, int ex_code, char const * pOptTitle) { int ct = pOpts->optCt; int optNo = 0; tOptDesc * pOD = pOpts->pOptDesc; int docCt = 0; do { if ((pOD->fOptState & OPTST_NO_USAGE_MASK) != 0) { /* * IF this is a compiled-out option * *AND* usage was requested with "omitted-usage" * *AND* this is NOT abbreviated usage * THEN display this option. */ if ( (pOD->fOptState == (OPTST_OMITTED | OPTST_NO_INIT)) && (pOD->pz_Name != NULL) && (ex_code == EXIT_SUCCESS)) { char const * why_pz = (pOD->pzText == NULL) ? zDisabledWhy : pOD->pzText; prt_preamble(pOpts, pOD, &argTypes); fprintf(option_usage_fp, zDisabledOpt, pOD->pz_Name, why_pz); } continue; } if ((pOD->fOptState & OPTST_DOCUMENT) != 0) { if (ex_code == EXIT_SUCCESS) { fprintf(option_usage_fp, argTypes.pzBrk, pOD->pzText, pOptTitle); docCt++; } continue; } /* * IF this is the first auto-opt maintained option * *AND* we are doing a full help * *AND* there are documentation options * *AND* the last one was not a doc option, * THEN document that the remaining options are not user opts */ if ( (pOpts->presetOptCt == optNo) && (ex_code == EXIT_SUCCESS) && (docCt > 0) && ((pOD[-1].fOptState & OPTST_DOCUMENT) == 0) ) fprintf(option_usage_fp, argTypes.pzBrk, zAuto, pOptTitle); prt_one_usage(pOpts, pOD, &argTypes); /* * IF we were invoked because of the --help option, * THEN print all the extra info */ if (ex_code == EXIT_SUCCESS) prt_extd_usage(pOpts, pOD, &argTypes); } while (pOD++, optNo++, (--ct > 0)); fputc('\n', option_usage_fp); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * PROGRAM DETAILS */ static void prt_prog_detail(tOptions* pOptions) { ag_bool initIntro = AG_TRUE; /* * Display all the places we look for config files */ prt_ini_list(pOptions->papzHomeList, &initIntro, pOptions->pzRcName, pOptions->pzProgPath); /* * Let the user know about environment variable settings */ if ((pOptions->fOptSet & OPTPROC_ENVIRON) != 0) { if (initIntro) fputs(zPresetIntro, option_usage_fp); fprintf(option_usage_fp, zExamineFmt, pOptions->pzPROGNAME); } /* * IF we found an enumeration, * THEN hunt for it again. Call the handler proc with a NULL * option struct pointer. That tells it to display the keywords. */ if (displayEnum) { int ct = pOptions->optCt; int optNo = 0; tOptDesc* pOD = pOptions->pOptDesc; fputc('\n', option_usage_fp); fflush(option_usage_fp); do { switch (OPTST_GET_ARGTYPE(pOD->fOptState)) { case OPARG_TYPE_ENUMERATION: case OPARG_TYPE_MEMBERSHIP: (*(pOD->pOptProc))(OPTPROC_EMIT_USAGE, pOD); } } while (pOD++, optNo++, (--ct > 0)); } /* * If there is a detail string, now is the time for that. */ if (pOptions->pzDetail != NULL) fputs(pOptions->pzDetail, option_usage_fp); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * OPTION LINE FORMATTING SETUP * * The "OptFmt" formats receive three arguments: * 1. the type of the option's argument * 2. the long name of the option * 3. "YES" or "no ", depending on whether or not the option must appear * on the command line. * These formats are used immediately after the option flag (if used) has * been printed. * * Set up the formatting for GNU-style output */ static int setGnuOptFmts(tOptions* pOpts, tCC** ppT) { int flen = 22; *ppT = zNoRq_ShrtTtl; argTypes.pzStr = zGnuStrArg; argTypes.pzReq = zOneSpace; argTypes.pzNum = zGnuNumArg; argTypes.pzKey = zGnuKeyArg; argTypes.pzKeyL = zGnuKeyLArg; argTypes.pzTime = zGnuTimeArg; argTypes.pzFile = zGnuFileArg; argTypes.pzBool = zGnuBoolArg; argTypes.pzNest = zGnuNestArg; argTypes.pzOpt = zGnuOptArg; argTypes.pzNo = zOneSpace; argTypes.pzBrk = zGnuBreak; argTypes.pzNoF = zSixSpaces; argTypes.pzSpc = zThreeSpaces; switch (pOpts->fOptSet & OPTPROC_L_N_S) { case OPTPROC_L_N_S: argTypes.pzOptFmt = zGnuOptFmt; break; case OPTPROC_LONGOPT: argTypes.pzOptFmt = zGnuOptFmt; break; case 0: argTypes.pzOptFmt = zGnuOptFmt + 2; break; case OPTPROC_SHORTOPT: argTypes.pzOptFmt = zShrtGnuOptFmt; zGnuStrArg[0] = zGnuNumArg[0] = zGnuKeyArg[0] = zGnuBoolArg[0] = ' '; argTypes.pzOpt = " [arg]"; flen = 8; break; } return flen; } /* * Standard (AutoOpts normal) option line formatting */ static int setStdOptFmts(tOptions* pOpts, tCC** ppT) { int flen = 0; argTypes.pzStr = zStdStrArg; argTypes.pzReq = zStdReqArg; argTypes.pzNum = zStdNumArg; argTypes.pzKey = zStdKeyArg; argTypes.pzKeyL = zStdKeyLArg; argTypes.pzTime = zStdTimeArg; argTypes.pzFile = zStdFileArg; argTypes.pzBool = zStdBoolArg; argTypes.pzNest = zStdNestArg; argTypes.pzOpt = zStdOptArg; argTypes.pzNo = zStdNoArg; argTypes.pzBrk = zStdBreak; argTypes.pzNoF = zFiveSpaces; argTypes.pzSpc = zTwoSpaces; switch (pOpts->fOptSet & (OPTPROC_NO_REQ_OPT | OPTPROC_SHORTOPT)) { case (OPTPROC_NO_REQ_OPT | OPTPROC_SHORTOPT): *ppT = zNoRq_ShrtTtl; argTypes.pzOptFmt = zNrmOptFmt; flen = 19; break; case OPTPROC_NO_REQ_OPT: *ppT = zNoRq_NoShrtTtl; argTypes.pzOptFmt = zNrmOptFmt; flen = 19; break; case OPTPROC_SHORTOPT: *ppT = zReq_ShrtTtl; argTypes.pzOptFmt = zReqOptFmt; flen = 24; break; case 0: *ppT = zReq_NoShrtTtl; argTypes.pzOptFmt = zReqOptFmt; flen = 24; } return flen; } /*: * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/usage.c */ ntp-4.2.6p5/sntp/libopts/autoopts/0000755000175000017500000000000011675461360016140 5ustar peterpeterntp-4.2.6p5/sntp/libopts/autoopts/options.h0000644000175000017500000011361211564122254020001 0ustar peterpeter/* -*- buffer-read-only: t -*- vi: set ro: * * DO NOT EDIT THIS FILE (options.h) * * It has been AutoGen-ed April 29, 2011 at 03:44:02 PM by AutoGen 5.11.9 * From the definitions funcs.def * and the template file options_h * * This file defines all the global structures and special values * used in the automated option processing library. * * Automated Options Copyright (C) 1992-2011 by Bruce Korb * * AutoOpts is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * AutoOpts 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see ."; */ #ifndef AUTOOPTS_OPTIONS_H_GUARD #define AUTOOPTS_OPTIONS_H_GUARD 1 #include #include #if defined(HAVE_STDINT_H) # include #elif defined(HAVE_INTTYPES_H) # include #endif /* HAVE_STDINT/INTTYPES_H */ #if defined(HAVE_LIMITS_H) # include #elif defined(HAVE_SYS_LIMITS_H) # include #endif /* HAVE_LIMITS/SYS_LIMITS_H */ #if defined(HAVE_SYSEXITS_H) # include #endif /* HAVE_SYSEXITS_H */ #ifndef EX_USAGE # define EX_USAGE 64 #endif /* * PUBLIC DEFINES * * The following defines may be used in applications that need to test the * state of an option. To test against these masks and values, a pointer * to an option descriptor must be obtained. There are two ways: * * 1. inside an option processing procedure, it is the second argument, * conventionally "tOptDesc* pOD". * * 2. Outside of an option procedure (or to reference a different option * descriptor), use either "&DESC( opt_name )" or "&pfx_DESC( opt_name )". * * See the relevant generated header file to determine which and what * values for "opt_name" are available. */ #define OPTIONS_STRUCT_VERSION 143360 #define OPTIONS_VERSION_STRING "35:0:10" #define OPTIONS_MINIMUM_VERSION 102400 #define OPTIONS_MIN_VER_STRING "25:0:0" typedef enum { OPARG_TYPE_NONE = 0, OPARG_TYPE_STRING = 1, /* default type/ vanilla string */ OPARG_TYPE_ENUMERATION = 2, /* opt arg is an enum (keyword list) */ OPARG_TYPE_BOOLEAN = 3, /* opt arg is boolean-valued */ OPARG_TYPE_MEMBERSHIP = 4, /* opt arg sets set membership bits */ OPARG_TYPE_NUMERIC = 5, /* opt arg is a long int */ OPARG_TYPE_HIERARCHY = 6, /* option arg is hierarchical value */ OPARG_TYPE_FILE = 7, /* option arg names a file */ OPARG_TYPE_TIME = 8, /* opt arg is a time duration */ OPARG_TYPE_FLOAT = 9, /* opt arg is a floating point num */ OPARG_TYPE_DOUBLE = 10, /* opt arg is a double prec. float */ OPARG_TYPE_LONG_DOUBLE = 11, /* opt arg is a long double prec. */ OPARG_TYPE_LONG_LONG = 12 /* opt arg is a long long int */ } teOptArgType; typedef struct optionValue { teOptArgType valType; char* pzName; union { char strVal[1]; /* OPARG_TYPE_STRING */ unsigned int enumVal; /* OPARG_TYPE_ENUMERATION */ unsigned int boolVal; /* OPARG_TYPE_BOOLEAN */ unsigned long setVal; /* OPARG_TYPE_MEMBERSHIP */ long longVal; /* OPARG_TYPE_NUMERIC */ void* nestVal; /* OPARG_TYPE_HIERARCHY */ } v; } tOptionValue; typedef enum { FTYPE_MODE_MAY_EXIST = 0x00, FTYPE_MODE_MUST_EXIST = 0x01, FTYPE_MODE_MUST_NOT_EXIST = 0x02, FTYPE_MODE_EXIST_MASK = 0x03, FTYPE_MODE_NO_OPEN = 0x00, FTYPE_MODE_OPEN_FD = 0x10, FTYPE_MODE_FOPEN_FP = 0x20, FTYPE_MODE_OPEN_MASK = 0x30 } teOptFileType; typedef union { int file_flags; char const * file_mode; } tuFileMode; typedef struct argList tArgList; #define MIN_ARG_ALLOC_CT 6 #define INCR_ARG_ALLOC_CT 8 struct argList { int useCt; int allocCt; char const * apzArgs[MIN_ARG_ALLOC_CT]; }; /* * Bits in the fOptState option descriptor field. */ typedef enum { OPTST_SET_ID = 0, /* Set via the "SET_OPT()" macro */ OPTST_PRESET_ID = 1, /* Set via an RC/INI file */ OPTST_DEFINED_ID = 2, /* Set via a command line option */ OPTST_RESET_ID = 3, /* Reset via command line option */ OPTST_EQUIVALENCE_ID = 4, /* selected by equiv'ed option */ OPTST_DISABLED_ID = 5, /* option is in disabled state */ OPTST_ALLOC_ARG_ID = 6, /* pzOptArg was allocated */ OPTST_NO_INIT_ID = 8, /* option cannot be preset */ OPTST_NUMBER_OPT_ID = 9, /* opt value (flag) is any digit */ OPTST_STACKED_ID = 10, /* opt uses optionStackArg proc */ OPTST_INITENABLED_ID = 11, /* option defaults to enabled */ OPTST_ARG_TYPE_1_ID = 12, /* bit 1 of arg type enum */ OPTST_ARG_TYPE_2_ID = 13, /* bit 2 of arg type enum */ OPTST_ARG_TYPE_3_ID = 14, /* bit 3 of arg type enum */ OPTST_ARG_TYPE_4_ID = 15, /* bit 4 of arg type enum */ OPTST_ARG_OPTIONAL_ID = 16, /* the option arg not required */ OPTST_IMM_ID = 17, /* process opt on first pass */ OPTST_DISABLE_IMM_ID = 18, /* process disablement immed. */ OPTST_OMITTED_ID = 19, /* compiled out of program */ OPTST_MUST_SET_ID = 20, /* must be set or pre-set */ OPTST_DOCUMENT_ID = 21, /* opt is for doc only */ OPTST_TWICE_ID = 22, /* process opt twice - imm + reg */ OPTST_DISABLE_TWICE_ID = 23, /* process disabled option twice */ OPTST_SCALED_NUM_ID = 24, /* scaled integer value */ OPTST_NO_COMMAND_ID = 25, /* disable from cmd line */ OPTST_DEPRECATED_ID = 26 /* support is being removed */ } opt_state_enum_t; #define OPTST_INIT 0U #define OPTST_SET (1U << OPTST_SET_ID) #define OPTST_PRESET (1U << OPTST_PRESET_ID) #define OPTST_DEFINED (1U << OPTST_DEFINED_ID) #define OPTST_RESET (1U << OPTST_RESET_ID) #define OPTST_EQUIVALENCE (1U << OPTST_EQUIVALENCE_ID) #define OPTST_DISABLED (1U << OPTST_DISABLED_ID) #define OPTST_ALLOC_ARG (1U << OPTST_ALLOC_ARG_ID) #define OPTST_NO_INIT (1U << OPTST_NO_INIT_ID) #define OPTST_NUMBER_OPT (1U << OPTST_NUMBER_OPT_ID) #define OPTST_STACKED (1U << OPTST_STACKED_ID) #define OPTST_INITENABLED (1U << OPTST_INITENABLED_ID) #define OPTST_ARG_TYPE_1 (1U << OPTST_ARG_TYPE_1_ID) #define OPTST_ARG_TYPE_2 (1U << OPTST_ARG_TYPE_2_ID) #define OPTST_ARG_TYPE_3 (1U << OPTST_ARG_TYPE_3_ID) #define OPTST_ARG_TYPE_4 (1U << OPTST_ARG_TYPE_4_ID) #define OPTST_ARG_OPTIONAL (1U << OPTST_ARG_OPTIONAL_ID) #define OPTST_IMM (1U << OPTST_IMM_ID) #define OPTST_DISABLE_IMM (1U << OPTST_DISABLE_IMM_ID) #define OPTST_OMITTED (1U << OPTST_OMITTED_ID) #define OPTST_MUST_SET (1U << OPTST_MUST_SET_ID) #define OPTST_DOCUMENT (1U << OPTST_DOCUMENT_ID) #define OPTST_TWICE (1U << OPTST_TWICE_ID) #define OPTST_DISABLE_TWICE (1U << OPTST_DISABLE_TWICE_ID) #define OPTST_SCALED_NUM (1U << OPTST_SCALED_NUM_ID) #define OPTST_NO_COMMAND (1U << OPTST_NO_COMMAND_ID) #define OPTST_DEPRECATED (1U << OPTST_DEPRECATED_ID) #define OPT_STATE_MASK 0x07FFFF7FU #define OPTST_SET_MASK ( \ OPTST_DEFINED | OPTST_PRESET | OPTST_RESET | \ OPTST_SET \ /* 0x0000000FU */ ) #define OPTST_MUTABLE_MASK ( \ OPTST_ALLOC_ARG | OPTST_DEFINED | \ OPTST_DISABLED | OPTST_EQUIVALENCE | \ OPTST_PRESET | OPTST_RESET | \ OPTST_SET \ /* 0x0000007FU */ ) #define OPTST_SELECTED_MASK ( \ OPTST_DEFINED | OPTST_SET \ /* 0x00000005U */ ) #define OPTST_ARG_TYPE_MASK ( \ OPTST_ARG_TYPE_1 | OPTST_ARG_TYPE_2 | OPTST_ARG_TYPE_3 | \ OPTST_ARG_TYPE_4 \ /* 0x0000F000U */ ) #define OPTST_DO_NOT_SAVE_MASK ( \ OPTST_DOCUMENT | OPTST_NO_INIT | OPTST_OMITTED \ /* 0x00280100U */ ) #define OPTST_NO_USAGE_MASK ( \ OPTST_DEPRECATED | OPTST_NO_COMMAND | OPTST_OMITTED \ /* 0x06080000U */ ) #ifdef NO_OPTIONAL_OPT_ARGS # undef OPTST_ARG_OPTIONAL # define OPTST_ARG_OPTIONAL 0 #endif #define OPTST_PERSISTENT_MASK (~OPTST_MUTABLE_MASK) #define SELECTED_OPT(_od) ((_od)->fOptState & OPTST_SELECTED_MASK) #define UNUSED_OPT( _od) (((_od)->fOptState & OPTST_SET_MASK) == 0) #define DISABLED_OPT(_od) ((_od)->fOptState & OPTST_DISABLED) #define OPTION_STATE(_od) ((_od)->fOptState) #define OPTST_SET_ARGTYPE(_n) ((_n) << OPTST_ARG_TYPE_1_ID) #define OPTST_GET_ARGTYPE(_f) (((_f)&OPTST_ARG_TYPE_MASK)>>OPTST_ARG_TYPE_1_ID) /* * PRIVATE INTERFACES * * The following values are used in the generated code to communicate * with the option library procedures. They are not for public use * and may be subject to change. */ /* * Define the processing state flags */ typedef enum { OPTPROC_LONGOPT_ID = 0, /* Process long style options */ OPTPROC_SHORTOPT_ID = 1, /* Process short style "flags" */ OPTPROC_ERRSTOP_ID = 2, /* Stop on argument errors */ OPTPROC_DISABLEDOPT_ID = 3, /* Current option is disabled */ OPTPROC_NO_REQ_OPT_ID = 4, /* no options are required */ OPTPROC_NUM_OPT_ID = 5, /* there is a number option */ OPTPROC_INITDONE_ID = 6, /* have inits been done? */ OPTPROC_NEGATIONS_ID = 7, /* any negation options? */ OPTPROC_ENVIRON_ID = 8, /* check environment? */ OPTPROC_NO_ARGS_ID = 9, /* Disallow remaining arguments */ OPTPROC_ARGS_REQ_ID = 10, /* Require args after options */ OPTPROC_REORDER_ID = 11, /* reorder operands after opts */ OPTPROC_GNUUSAGE_ID = 12, /* emit usage in GNU style */ OPTPROC_TRANSLATE_ID = 13, /* Translate strings in tOptions */ OPTPROC_MISUSE_ID = 14, /* no usage on usage error */ OPTPROC_NXLAT_OPT_CFG_ID = 16, /* suppress for config only */ OPTPROC_NXLAT_OPT_ID = 17, /* suppress xlation always */ OPTPROC_PRESETTING_ID = 19 /* opt processing in preset state */ } optproc_state_enum_t; #define OPTPROC_NONE 0U #define OPTPROC_LONGOPT (1U << OPTPROC_LONGOPT_ID) #define OPTPROC_SHORTOPT (1U << OPTPROC_SHORTOPT_ID) #define OPTPROC_ERRSTOP (1U << OPTPROC_ERRSTOP_ID) #define OPTPROC_DISABLEDOPT (1U << OPTPROC_DISABLEDOPT_ID) #define OPTPROC_NO_REQ_OPT (1U << OPTPROC_NO_REQ_OPT_ID) #define OPTPROC_NUM_OPT (1U << OPTPROC_NUM_OPT_ID) #define OPTPROC_INITDONE (1U << OPTPROC_INITDONE_ID) #define OPTPROC_NEGATIONS (1U << OPTPROC_NEGATIONS_ID) #define OPTPROC_ENVIRON (1U << OPTPROC_ENVIRON_ID) #define OPTPROC_NO_ARGS (1U << OPTPROC_NO_ARGS_ID) #define OPTPROC_ARGS_REQ (1U << OPTPROC_ARGS_REQ_ID) #define OPTPROC_REORDER (1U << OPTPROC_REORDER_ID) #define OPTPROC_GNUUSAGE (1U << OPTPROC_GNUUSAGE_ID) #define OPTPROC_TRANSLATE (1U << OPTPROC_TRANSLATE_ID) #define OPTPROC_MISUSE (1U << OPTPROC_MISUSE_ID) #define OPTPROC_NXLAT_OPT_CFG (1U << OPTPROC_NXLAT_OPT_CFG_ID) #define OPTPROC_NXLAT_OPT (1U << OPTPROC_NXLAT_OPT_ID) #define OPTPROC_PRESETTING (1U << OPTPROC_PRESETTING_ID) #define OPTPROC_STATE_MASK 0x000B7FFFU #define OPTPROC_NO_XLAT_MASK ( \ OPTPROC_NXLAT_OPT | OPTPROC_NXLAT_OPT_CFG \ /* 0x00030000U */ ) #define STMTS(s) do { s; } while (0) /* * The following must be #defined instead of typedef-ed * because "static const" cannot both be applied to a type, * tho each individually can...so they all are */ #define tSCC static char const #define tCC char const #define tAoSC static char #define tAoUC unsigned char #define tAoUI unsigned int #define tAoUL unsigned long #define tAoUS unsigned short /* * It is so disgusting that there must be so many ways * of specifying TRUE and FALSE. */ typedef enum { AG_FALSE = 0, AG_TRUE } ag_bool; /* * Define a structure that describes each option and * a pointer to the procedure that handles it. * The argument is the count of this flag previously seen. */ typedef struct options tOptions; typedef struct optDesc tOptDesc; typedef struct optNames tOptNames; #define OPTPROC_EMIT_USAGE ((tOptions *)0x01UL) #define OPTPROC_EMIT_SHELL ((tOptions *)0x02UL) #define OPTPROC_RETURN_VALNAME ((tOptions *)0x03UL) #define OPTPROC_EMIT_LIMIT ((tOptions *)0x0FUL) /* * The option procedures do the special processing for each * option flag that needs it. */ typedef void (tOptProc)(tOptions* pOpts, tOptDesc* pOptDesc); typedef tOptProc* tpOptProc; /* * The usage procedure will never return. It calls "exit(2)" * with the "exitCode" argument passed to it. */ // coverity[+kill] typedef void (tUsageProc)(tOptions* pOpts, int exitCode); typedef tUsageProc* tpUsageProc; /* * Special definitions. "NOLIMIT" is the 'max' value to use when * a flag may appear multiple times without limit. "NO_EQUIVALENT" * is an illegal value for 'optIndex' (option description index). */ #define NOLIMIT USHRT_MAX #define OPTION_LIMIT SHRT_MAX #define NO_EQUIVALENT (OPTION_LIMIT+1) typedef union { char const * argString; uintptr_t argEnum; uintptr_t argIntptr; long argInt; unsigned long argUint; unsigned int argBool; FILE * argFp; int argFd; } optArgBucket_t; #define pzLastArg optArg.argString /* * Descriptor structure for each option. * Only the fields marked "PUBLIC" are for public use. */ struct optDesc { tAoUS const optIndex; /* PUBLIC */ tAoUS const optValue; /* PUBLIC */ tAoUS optActualIndex; /* PUBLIC */ tAoUS optActualValue; /* PUBLIC */ tAoUS const optEquivIndex; /* PUBLIC */ tAoUS const optMinCt; tAoUS const optMaxCt; tAoUS optOccCt; /* PUBLIC */ tAoUI fOptState; /* PUBLIC */ tAoUI reserved; optArgBucket_t optArg; /* PUBLIC */ void* optCookie; /* PUBLIC */ int const * const pOptMust; int const * const pOptCant; tpOptProc const pOptProc; char const* const pzText; char const* const pz_NAME; char const* const pz_Name; char const* const pz_DisableName; char const* const pz_DisablePfx; }; /* * Some options need special processing, so we store their * indexes in a known place: */ typedef struct optSpecIndex tOptSpecIndex; struct optSpecIndex { const tAoUS more_help; const tAoUS save_opts; const tAoUS number_option; const tAoUS default_opt; }; /* * The procedure generated for translating option text */ typedef void (tOptionXlateProc)(void); /* * Everything marked "PUBLIC" is also marked "const". * Public access is not a license to modify. Other fields * are used and modified by the library. They are also * subject to change without any notice. Do not even * look at these outside of libopts. */ struct options { int const structVersion; int origArgCt; char** origArgVect; unsigned int fOptSet; unsigned int curOptIdx; char* pzCurOpt; char const* const pzProgPath; /* PUBLIC */ char const* const pzProgName; /* PUBLIC */ char const* const pzPROGNAME; /* PUBLIC */ char const* const pzRcName; /* PUBLIC */ char const* const pzCopyright; /* PUBLIC */ char const* const pzCopyNotice; /* PUBLIC */ char const* const pzFullVersion; /* PUBLIC */ char const* const* const papzHomeList; char const* const pzUsageTitle; char const* const pzExplain; char const* const pzDetail; tOptDesc* const pOptDesc; /* PUBLIC */ char const* const pzBugAddr; /* PUBLIC */ void* pExtensions; void* pSavedState; // coverity[+kill] tpUsageProc pUsageProc; tOptionXlateProc* pTransProc; tOptSpecIndex specOptIdx; int const optCt; int const presetOptCt; char const * pzFullUsage; char const * pzShortUsage; /* PUBLIC: */ optArgBucket_t const * const originalOptArgArray; void * const * const originalOptArgCookie; char const * const pzPkgDataDir; char const * const pzPackager; }; /* * Versions where in various fields first appear: * ($AO_CURRENT * 4096 + $AO_REVISION, but $AO_REVISION must be zero) */ #define originalOptArgArray_STRUCT_VERSION 131072 /* AO_CURRENT = 32 */ #define HAS_originalOptArgArray(_opt) \ ((_opt)->structVersion >= originalOptArgArray_STRUCT_VERSION) #define pzPkgDataDir_STRUCT_VERSION 139264 /* AO_CURRENT = 34 */ #define HAS_pzPkgDataDir(_opt) \ ((_opt)->structVersion >= pzPkgDataDir_STRUCT_VERSION) /* * "token list" structure returned by "string_tokenize()" */ typedef struct { unsigned long tkn_ct; unsigned char* tkn_list[1]; } token_list_t; /* * Hide the interface - it pollutes a POSIX claim, but leave it for * anyone #include-ing this header */ #define strneqvcmp option_strneqvcmp #define streqvcmp option_streqvcmp #define streqvmap option_streqvmap #define strequate option_strequate #define strtransform option_strtransform /* * This is an output only structure used by text_mmap and text_munmap. * Clients must not alter the contents and must provide it to both * the text_mmap and text_munmap procedures. BE ADVISED: if you are * mapping the file with PROT_WRITE the NUL byte at the end MIGHT NOT * BE WRITABLE. In any event, that byte is not be written back * to the source file. ALSO: if "txt_data" is valid and "txt_errno" * is not zero, then there *may* not be a terminating NUL. */ typedef struct { void* txt_data; /* text file data */ size_t txt_size; /* actual file size */ size_t txt_full_size; /* mmaped mem size */ int txt_fd; /* file descriptor */ int txt_zero_fd; /* fd for /dev/zero */ int txt_errno; /* warning code */ int txt_prot; /* "prot" flags */ int txt_flags; /* mapping type */ int txt_alloc; /* if we malloced memory */ } tmap_info_t; #define TEXT_MMAP_FAILED_ADDR(a) ((void*)(a) == (void*)MAP_FAILED) #ifdef __cplusplus #define CPLUSPLUS_OPENER extern "C" { CPLUSPLUS_OPENER #define CPLUSPLUS_CLOSER } #else #define CPLUSPLUS_CLOSER #endif /* * The following routines may be coded into AutoOpts client code: */ /* From: tokenize.c line 166 * * ao_string_tokenize - tokenize an input string * * Arguments: * string string to be tokenized * * Returns: token_list_t* - pointer to a structure that lists each token * * This function will convert one input string into a list of strings. * The list of strings is derived by separating the input based on * white space separation. However, if the input contains either single * or double quote characters, then the text after that character up to * a matching quote will become the string in the list. * * The returned pointer should be deallocated with @code{free(3C)} when * are done using the data. The data are placed in a single block of * allocated memory. Do not deallocate individual token/strings. * * The structure pointed to will contain at least these two fields: * @table @samp * @item tkn_ct * The number of tokens found in the input string. * @item tok_list * An array of @code{tkn_ct + 1} pointers to substring tokens, with * the last pointer set to NULL. * @end table * * There are two types of quoted strings: single quoted (@code{'}) and * double quoted (@code{"}). Singly quoted strings are fairly raw in that * escape characters (@code{\\}) are simply another character, except when * preceding the following characters: * @example * @code{\\} double backslashes reduce to one * @code{'} incorporates the single quote into the string * @code{\n} suppresses both the backslash and newline character * @end example * * Double quote strings are formed according to the rules of string * constants in ANSI-C programs. */ extern token_list_t* ao_string_tokenize(char const*); /* From: configfile.c line 80 * * configFileLoad - parse a configuration file * * Arguments: * pzFile the file to load * * Returns: const tOptionValue* - An allocated, compound value structure * * This routine will load a named configuration file and parse the * text as a hierarchically valued option. The option descriptor * created from an option definition file is not used via this interface. * The returned value is "named" with the input file name and is of * type "@code{OPARG_TYPE_HIERARCHY}". It may be used in calls to * @code{optionGetValue()}, @code{optionNextValue()} and * @code{optionUnloadNested()}. */ extern const tOptionValue* configFileLoad(char const*); /* From: configfile.c line 1059 * * optionFileLoad - Load the locatable config files, in order * * Arguments: * pOpts program options descriptor * pzProg program name * * Returns: int - 0 -> SUCCESS, -1 -> FAILURE * * This function looks in all the specified directories for a configuration * file ("rc" file or "ini" file) and processes any found twice. The first * time through, they are processed in reverse order (last file first). At * that time, only "immediate action" configurables are processed. For * example, if the last named file specifies not processing any more * configuration files, then no more configuration files will be processed. * Such an option in the @strong{first} named directory will have no effect. * * Once the immediate action configurables have been handled, then the * directories are handled in normal, forward order. In that way, later * config files can override the settings of earlier config files. * * See the AutoOpts documentation for a thorough discussion of the * config file format. * * Configuration files not found or not decipherable are simply ignored. */ extern int optionFileLoad(tOptions*, char const*); /* From: configfile.c line 212 * * optionFindNextValue - find a hierarcicaly valued option instance * * Arguments: * pOptDesc an option with a nested arg type * pPrevVal the last entry * name name of value to find * value the matching value * * Returns: const tOptionValue* - a compound value structure * * This routine will find the next entry in a nested value option or * configurable. It will search through the list and return the next entry * that matches the criteria. */ extern const tOptionValue* optionFindNextValue(const tOptDesc*, const tOptionValue*, char const*, char const*); /* From: configfile.c line 138 * * optionFindValue - find a hierarcicaly valued option instance * * Arguments: * pOptDesc an option with a nested arg type * name name of value to find * value the matching value * * Returns: const tOptionValue* - a compound value structure * * This routine will find an entry in a nested value option or configurable. * It will search through the list and return a matching entry. */ extern const tOptionValue* optionFindValue(const tOptDesc*, char const*, char const*); /* From: restore.c line 166 * * optionFree - free allocated option processing memory * * Arguments: * pOpts program options descriptor * * AutoOpts sometimes allocates memory and puts pointers to it in the * option state structures. This routine deallocates all such memory. */ extern void optionFree(tOptions*); /* From: configfile.c line 281 * * optionGetValue - get a specific value from a hierarcical list * * Arguments: * pOptValue a hierarchcal value * valueName name of value to get * * Returns: const tOptionValue* - a compound value structure * * This routine will find an entry in a nested value option or configurable. * If "valueName" is NULL, then the first entry is returned. Otherwise, * the first entry with a name that exactly matches the argument will be * returned. */ extern const tOptionValue* optionGetValue(const tOptionValue*, char const*); /* From: load.c line 478 * * optionLoadLine - process a string for an option name and value * * Arguments: * pOpts program options descriptor * pzLine NUL-terminated text * * This is a client program callable routine for setting options from, for * example, the contents of a file that they read in. Only one option may * appear in the text. It will be treated as a normal (non-preset) option. * * When passed a pointer to the option struct and a string, it will find * the option named by the first token on the string and set the option * argument to the remainder of the string. The caller must NUL terminate * the string. Any embedded new lines will be included in the option * argument. If the input looks like one or more quoted strings, then the * input will be "cooked". The "cooking" is identical to the string * formation used in AutoGen definition files (@pxref{basic expression}), * except that you may not use backquotes. */ extern void optionLoadLine(tOptions*, char const*); /* From: configfile.c line 340 * * optionNextValue - get the next value from a hierarchical list * * Arguments: * pOptValue a hierarchcal list value * pOldValue a value from this list * * Returns: const tOptionValue* - a compound value structure * * This routine will return the next entry after the entry passed in. At the * end of the list, NULL will be returned. If the entry is not found on the * list, NULL will be returned and "@var{errno}" will be set to EINVAL. * The "@var{pOldValue}" must have been gotten from a prior call to this * routine or to "@code{opitonGetValue()}". */ extern const tOptionValue* optionNextValue(const tOptionValue*, const tOptionValue*); /* From: usage.c line 195 * * optionOnlyUsage - Print usage text for just the options * * Arguments: * pOpts program options descriptor * ex_code exit code for calling exit(3) * * This routine will print only the usage for each option. * This function may be used when the emitted usage must incorporate * information not available to AutoOpts. */ extern void optionOnlyUsage(tOptions*, int); /* From: autoopts.c line 1065 * * optionProcess - this is the main option processing routine * * Arguments: * pOpts program options descriptor * argc program arg count * argv program arg vector * * Returns: int - the count of the arguments processed * * This is the main entry point for processing options. It is intended * that this procedure be called once at the beginning of the execution of * a program. Depending on options selected earlier, it is sometimes * necessary to stop and restart option processing, or to select completely * different sets of options. This can be done easily, but you generally * do not want to do this. * * The number of arguments processed always includes the program name. * If one of the arguments is "--", then it is counted and the processing * stops. If an error was encountered and errors are to be tolerated, then * the returned value is the index of the argument causing the error. * A hyphen by itself ("-") will also cause processing to stop and will * @emph{not} be counted among the processed arguments. A hyphen by itself * is treated as an operand. Encountering an operand stops option * processing. */ extern int optionProcess(tOptions*, int, char**); /* From: restore.c line 123 * * optionRestore - restore option state from memory copy * * Arguments: * pOpts program options descriptor * * Copy back the option state from saved memory. * The allocated memory is left intact, so this routine can be * called repeatedly without having to call optionSaveState again. * If you are restoring a state that was saved before the first call * to optionProcess(3AO), then you may change the contents of the * argc/argv parameters to optionProcess. */ extern void optionRestore(tOptions*); /* From: save.c line 664 * * optionSaveFile - saves the option state to a file * * Arguments: * pOpts program options descriptor * * This routine will save the state of option processing to a file. The name * of that file can be specified with the argument to the @code{--save-opts} * option, or by appending the @code{rcfile} attribute to the last * @code{homerc} attribute. If no @code{rcfile} attribute was specified, it * will default to @code{.@i{programname}rc}. If you wish to specify another * file, you should invoke the @code{SET_OPT_SAVE_OPTS(@i{filename})} macro. * * The recommend usage is as follows: * @example * optionProcess(&progOptions, argc, argv); * if (i_want_a_non_standard_place_for_this) * SET_OPT_SAVE_OPTS("myfilename"); * optionSaveFile(&progOptions); * @end example */ extern void optionSaveFile(tOptions*); /* From: restore.c line 71 * * optionSaveState - saves the option state to memory * * Arguments: * pOpts program options descriptor * * This routine will allocate enough memory to save the current option * processing state. If this routine has been called before, that memory * will be reused. You may only save one copy of the option state. This * routine may be called before optionProcess(3AO). If you do call it * before the first call to optionProcess, then you may also change the * contents of argc/argv after you call optionRestore(3AO) * * In fact, more strongly put: it is safest to only use this function * before having processed any options. In particular, the saving and * restoring of stacked string arguments and hierarchical values is * disabled. The values are not saved. */ extern void optionSaveState(tOptions*); /* From: nested.c line 551 * * optionUnloadNested - Deallocate the memory for a nested value * * Arguments: * pOptVal the hierarchical value * * A nested value needs to be deallocated. The pointer passed in should * have been gotten from a call to @code{configFileLoad()} (See * @pxref{libopts-configFileLoad}). */ extern void optionUnloadNested(tOptionValue const *); /* From: version.c line 31 * * optionVersion - return the compiled AutoOpts version number * * Returns: char const* - the version string in constant memory * * Returns the full version string compiled into the library. * The returned string cannot be modified. */ extern char const* optionVersion(void); /* From: ../compat/pathfind.c line 29 * * pathfind - fild a file in a list of directories * * Arguments: * path colon separated list of search directories * file the name of the file to look for * mode the mode bits that must be set to match * * Returns: char* - the path to the located file * * the pathfind function is available only if HAVE_PATHFIND is not defined * * pathfind looks for a a file with name "FILE" and "MODE" access * along colon delimited "PATH", and returns the full pathname as a * string, or NULL if not found. If "FILE" contains a slash, then * it is treated as a relative or absolute path and "PATH" is ignored. * * @strong{NOTE}: this function is compiled into @file{libopts} only if * it is not natively supplied. * * The "MODE" argument is a string of option letters chosen from the * list below: * @example * Letter Meaning * r readable * w writable * x executable * f normal file (NOT IMPLEMENTED) * b block special (NOT IMPLEMENTED) * c character special (NOT IMPLEMENTED) * d directory (NOT IMPLEMENTED) * p FIFO (pipe) (NOT IMPLEMENTED) * u set user ID bit (NOT IMPLEMENTED) * g set group ID bit (NOT IMPLEMENTED) * k sticky bit (NOT IMPLEMENTED) * s size nonzero (NOT IMPLEMENTED) * @end example */ #ifndef HAVE_PATHFIND extern char* pathfind(char const*, char const*, char const*); #endif /* HAVE_PATHFIND */ /* From: streqvcmp.c line 209 * * strequate - map a list of characters to the same value * * Arguments: * ch_list characters to equivalence * * Each character in the input string get mapped to the first character * in the string. * This function name is mapped to option_strequate so as to not conflict * with the POSIX name space. */ extern void strequate(char const*); /* From: streqvcmp.c line 119 * * streqvcmp - compare two strings with an equivalence mapping * * Arguments: * str1 first string * str2 second string * * Returns: int - the difference between two differing characters * * Using a character mapping, two strings are compared for "equivalence". * Each input character is mapped to a comparison character and the * mapped-to characters are compared for the two NUL terminated input strings. * This function name is mapped to option_streqvcmp so as to not conflict * with the POSIX name space. */ extern int streqvcmp(char const*, char const*); /* From: streqvcmp.c line 156 * * streqvmap - Set the character mappings for the streqv functions * * Arguments: * From Input character * To Mapped-to character * ct compare length * * Set the character mapping. If the count (@code{ct}) is set to zero, then * the map is cleared by setting all entries in the map to their index * value. Otherwise, the "@code{From}" character is mapped to the "@code{To}" * character. If @code{ct} is greater than 1, then @code{From} and @code{To} * are incremented and the process repeated until @code{ct} entries have been * set. For example, * @example * streqvmap('a', 'A', 26); * @end example * @noindent * will alter the mapping so that all English lower case letters * will map to upper case. * * This function name is mapped to option_streqvmap so as to not conflict * with the POSIX name space. */ extern void streqvmap(char, char, int); /* From: streqvcmp.c line 78 * * strneqvcmp - compare two strings with an equivalence mapping * * Arguments: * str1 first string * str2 second string * ct compare length * * Returns: int - the difference between two differing characters * * Using a character mapping, two strings are compared for "equivalence". * Each input character is mapped to a comparison character and the * mapped-to characters are compared for the two NUL terminated input strings. * The comparison is limited to @code{ct} bytes. * This function name is mapped to option_strneqvcmp so as to not conflict * with the POSIX name space. */ extern int strneqvcmp(char const*, char const*, int); /* From: streqvcmp.c line 235 * * strtransform - convert a string into its mapped-to value * * Arguments: * dest output string * src input string * * Each character in the input string is mapped and the mapped-to * character is put into the output. * This function name is mapped to option_strtransform so as to not conflict * with the POSIX name space. * * The source and destination may be the same. */ extern void strtransform(char*, char const*); /* AutoOpts PRIVATE FUNCTIONS: */ tOptProc optionStackArg, optionUnstackArg, optionBooleanVal, optionNumericVal; extern char* ao_string_cook(char*, int*); extern unsigned int ao_string_cook_escape_char(char const*, char*, unsigned int); extern void genshelloptUsage(tOptions*, int); extern void optionBooleanVal(tOptions*, tOptDesc*); extern uintptr_t optionEnumerationVal(tOptions*, tOptDesc*, char const * const *, unsigned int); extern void optionFileCheck(tOptions*, tOptDesc*, teOptFileType, tuFileMode); extern char const * optionKeywordName(tOptDesc*, unsigned int); extern void optionLoadOpt(tOptions*, tOptDesc*); extern ag_bool optionMakePath(char*, int, char const*, char const*); extern void optionNestedVal(tOptions*, tOptDesc*); extern void optionNumericVal(tOptions*, tOptDesc*); extern void optionPagedUsage(tOptions*, tOptDesc*); extern void optionParseShell(tOptions*); extern void optionPrintVersion(tOptions*, tOptDesc*); extern void optionPutShell(tOptions*); extern void optionResetOpt(tOptions*, tOptDesc*); extern void optionSetMembers(tOptions*, tOptDesc*, char const * const *, unsigned int); extern void optionShowRange(tOptions*, tOptDesc*, void *, int); extern void optionStackArg(tOptions*, tOptDesc*); extern void optionTimeDate(tOptions*, tOptDesc*); extern void optionTimeVal(tOptions*, tOptDesc*); extern void optionUnstackArg(tOptions*, tOptDesc*); extern void optionUsage(tOptions*, int); extern void optionVersionStderr(tOptions*, tOptDesc*); extern void* text_mmap(char const*, int, int, tmap_info_t*); extern int text_munmap(tmap_info_t*); CPLUSPLUS_CLOSER #endif /* AUTOOPTS_OPTIONS_H_GUARD */ /* * Local Variables: * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * options.h ends here */ ntp-4.2.6p5/sntp/libopts/autoopts/usage-txt.h0000644000175000017500000004774211564122254020241 0ustar peterpeter/* -*- buffer-read-only: t -*- vi: set ro: * * DO NOT EDIT THIS FILE (usage-txt.h) * * It has been AutoGen-ed April 29, 2011 at 03:44:00 PM by AutoGen 5.11.9 * From the definitions usage-txt.def * and the template file usage-txt.tpl * * This file handles all the bookkeeping required for tracking all the little * tiny strings used by the AutoOpts library. There are 142 * of them. This is not versioned because it is entirely internal to the * library and accessed by client code only in a very well-controlled way: * they may substitute translated strings using a procedure that steps through * all the string pointers. * * AutoOpts is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * AutoOpts 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see ."; */ #ifndef AUTOOPTS_USAGE_TXT_H_GUARD #define AUTOOPTS_USAGE_TXT_H_GUARD 1 #undef cch_t #define cch_t char const /* * One structure to hold all the pointers to all the stringlets. */ typedef struct { int field_ct; char* utpz_GnuBoolArg; char* utpz_GnuKeyArg; char* utpz_GnuFileArg; char* utpz_GnuKeyLArg; char* utpz_GnuTimeArg; char* utpz_GnuNumArg; char* utpz_GnuStrArg; cch_t* apz_str[ 135 ]; } usage_text_t; /* * Declare the global structure with all the pointers to translated * strings. This is then used by the usage generation procedure. */ extern usage_text_t option_usage_text; #if defined(AUTOOPTS_INTERNAL) /* DEFINE ALL THE STRINGS = = = = = */ /* * Provide a mapping from a short name to fields in this structure. */ #define zAO_Alloc (option_usage_text.apz_str[ 0]) #define zAO_Bad (option_usage_text.apz_str[ 1]) #define zAO_Big (option_usage_text.apz_str[ 2]) #define zAO_Err (option_usage_text.apz_str[ 3]) #define zAO_Realloc (option_usage_text.apz_str[ 4]) #define zAO_Sml (option_usage_text.apz_str[ 5]) #define zAO_Strdup (option_usage_text.apz_str[ 6]) #define zAO_Ver (option_usage_text.apz_str[ 7]) #define zAO_Woops (option_usage_text.apz_str[ 8]) #define zAliasRange (option_usage_text.apz_str[ 9]) #define zAll (option_usage_text.apz_str[ 10]) #define zAlt (option_usage_text.apz_str[ 11]) #define zAmbigKey (option_usage_text.apz_str[ 12]) #define zAmbigOptStr (option_usage_text.apz_str[ 13]) #define zArgsMust (option_usage_text.apz_str[ 14]) #define zAtMost (option_usage_text.apz_str[ 15]) #define zAuto (option_usage_text.apz_str[ 16]) #define zBadPipe (option_usage_text.apz_str[ 17]) #define zBadVerArg (option_usage_text.apz_str[ 18]) #define zCantFmt (option_usage_text.apz_str[ 19]) #define zCantSave (option_usage_text.apz_str[ 20]) #define zCfgAO_Flags (option_usage_text.apz_str[ 21]) #define zCfgProg (option_usage_text.apz_str[ 22]) #define zDefaultOpt (option_usage_text.apz_str[ 23]) #define zDis (option_usage_text.apz_str[ 24]) #define zDisabledErr (option_usage_text.apz_str[ 25]) #define zDisabledOpt (option_usage_text.apz_str[ 26]) #define zDisabledWhy (option_usage_text.apz_str[ 27]) #define zEnab (option_usage_text.apz_str[ 28]) #define zEquiv (option_usage_text.apz_str[ 29]) #define zErrOnly (option_usage_text.apz_str[ 30]) #define zExamineFmt (option_usage_text.apz_str[ 31]) #define zFiveSpaces (option_usage_text.apz_str[ 32]) #define zFlagOkay (option_usage_text.apz_str[ 33]) #define zFmtFmt (option_usage_text.apz_str[ 34]) #define zForkFail (option_usage_text.apz_str[ 35]) #define zFreopenFail (option_usage_text.apz_str[ 36]) #define zFSErrOptLoad (option_usage_text.apz_str[ 37]) #define zFSErrReadFile (option_usage_text.apz_str[ 38]) #define zFSOptError (option_usage_text.apz_str[ 39]) #define zFSOptErrMayExist (option_usage_text.apz_str[ 40]) #define zFSOptErrMustExist (option_usage_text.apz_str[ 41]) #define zFSOptErrNoExist (option_usage_text.apz_str[ 42]) #define zFSOptErrOpen (option_usage_text.apz_str[ 43]) #define zFSOptErrFopen (option_usage_text.apz_str[ 44]) #define zFileCannotExist (option_usage_text.apz_str[ 45]) #define zFileMustExist (option_usage_text.apz_str[ 46]) #define zGenshell (option_usage_text.apz_str[ 47]) #define zGnuBoolArg (option_usage_text.utpz_GnuBoolArg) #define zGnuBreak (option_usage_text.apz_str[ 48]) #define zGnuKeyArg (option_usage_text.utpz_GnuKeyArg) #define zGnuFileArg (option_usage_text.utpz_GnuFileArg) #define zGnuKeyLArg (option_usage_text.utpz_GnuKeyLArg) #define zGnuTimeArg (option_usage_text.utpz_GnuTimeArg) #define zGnuNestArg (option_usage_text.apz_str[ 49]) #define zGnuNumArg (option_usage_text.utpz_GnuNumArg) #define zGnuOptArg (option_usage_text.apz_str[ 50]) #define zGnuOptFmt (option_usage_text.apz_str[ 51]) #define zGnuStrArg (option_usage_text.utpz_GnuStrArg) #define zIllOptChr (option_usage_text.apz_str[ 52]) #define zIllOptStr (option_usage_text.apz_str[ 53]) #define zIllegal (option_usage_text.apz_str[ 54]) #define zIntRange (option_usage_text.apz_str[ 55]) #define zInvalOptDesc (option_usage_text.apz_str[ 56]) #define zLowerBits (option_usage_text.apz_str[ 57]) #define zMembers (option_usage_text.apz_str[ 58]) #define zMisArg (option_usage_text.apz_str[ 59]) #define zMultiEquiv (option_usage_text.apz_str[ 60]) #define zMust (option_usage_text.apz_str[ 61]) #define zNeedOne (option_usage_text.apz_str[ 62]) #define zNoArg (option_usage_text.apz_str[ 63]) #define zNoArgv (option_usage_text.apz_str[ 64]) #define zNoArgs (option_usage_text.apz_str[ 65]) #define zNoCreat (option_usage_text.apz_str[ 66]) #define zNoFlags (option_usage_text.apz_str[ 67]) #define zNoKey (option_usage_text.apz_str[ 68]) #define zNoLim (option_usage_text.apz_str[ 69]) #define zNoPreset (option_usage_text.apz_str[ 70]) #define zNoResetArg (option_usage_text.apz_str[ 71]) #define zNoRq_NoShrtTtl (option_usage_text.apz_str[ 72]) #define zNoRq_ShrtTtl (option_usage_text.apz_str[ 73]) #define zNoStat (option_usage_text.apz_str[ 74]) #define zNoState (option_usage_text.apz_str[ 75]) #define zNone (option_usage_text.apz_str[ 76]) #define zNotDef (option_usage_text.apz_str[ 77]) #define zNotCmdOpt (option_usage_text.apz_str[ 78]) #define zNotEnough (option_usage_text.apz_str[ 79]) #define zNotFile (option_usage_text.apz_str[ 80]) #define zNotNumber (option_usage_text.apz_str[ 81]) #define zNotDate (option_usage_text.apz_str[ 82]) #define zNotDuration (option_usage_text.apz_str[ 83]) #define zNrmOptFmt (option_usage_text.apz_str[ 84]) #define zNumberOpt (option_usage_text.apz_str[ 85]) #define zOneSpace (option_usage_text.apz_str[ 86]) #define zOnlyOne (option_usage_text.apz_str[ 87]) #define zOptsOnly (option_usage_text.apz_str[ 88]) #define zOutputFail (option_usage_text.apz_str[ 89]) #define zPathFmt (option_usage_text.apz_str[ 90]) #define zPlsSendBugs (option_usage_text.apz_str[ 91]) #define zPreset (option_usage_text.apz_str[ 92]) #define zPresetFile (option_usage_text.apz_str[ 93]) #define zPresetIntro (option_usage_text.apz_str[ 94]) #define zProhib (option_usage_text.apz_str[ 95]) #define zReorder (option_usage_text.apz_str[ 96]) #define zRange (option_usage_text.apz_str[ 97]) #define zRangeAbove (option_usage_text.apz_str[ 98]) #define zRangeLie (option_usage_text.apz_str[ 99]) #define zRangeOnly (option_usage_text.apz_str[100]) #define zRangeOr (option_usage_text.apz_str[101]) #define zRangeErr (option_usage_text.apz_str[102]) #define zRangeExact (option_usage_text.apz_str[103]) #define zRangeScaled (option_usage_text.apz_str[104]) #define zRangeUpto (option_usage_text.apz_str[105]) #define zResetNotConfig (option_usage_text.apz_str[106]) #define zReqFmt (option_usage_text.apz_str[107]) #define zReqOptFmt (option_usage_text.apz_str[108]) #define zReqThese (option_usage_text.apz_str[109]) #define zReq_NoShrtTtl (option_usage_text.apz_str[110]) #define zReq_ShrtTtl (option_usage_text.apz_str[111]) #define zSepChars (option_usage_text.apz_str[112]) #define zSetMemberSettings (option_usage_text.apz_str[113]) #define zShrtGnuOptFmt (option_usage_text.apz_str[114]) #define zSixSpaces (option_usage_text.apz_str[115]) #define zStdBoolArg (option_usage_text.apz_str[116]) #define zStdBreak (option_usage_text.apz_str[117]) #define zStdFileArg (option_usage_text.apz_str[118]) #define zStdKeyArg (option_usage_text.apz_str[119]) #define zStdKeyLArg (option_usage_text.apz_str[120]) #define zStdTimeArg (option_usage_text.apz_str[121]) #define zStdNestArg (option_usage_text.apz_str[122]) #define zStdNoArg (option_usage_text.apz_str[123]) #define zStdNumArg (option_usage_text.apz_str[124]) #define zStdOptArg (option_usage_text.apz_str[125]) #define zStdReqArg (option_usage_text.apz_str[126]) #define zStdStrArg (option_usage_text.apz_str[127]) #define zTabHyp (option_usage_text.apz_str[128]) #define zTabHypAnd (option_usage_text.apz_str[129]) #define zTabout (option_usage_text.apz_str[130]) #define zThreeSpaces (option_usage_text.apz_str[131]) #define zTwoSpaces (option_usage_text.apz_str[132]) #define zUpTo (option_usage_text.apz_str[133]) #define zValidKeys (option_usage_text.apz_str[134]) /* * First, set up the strings. Some of these are writable. These are all in * English. This gets compiled into libopts and is distributed here so that * xgettext (or equivalents) can extract these strings for translation. */ static char eng_zGnuBoolArg[] = "=T/F"; static char eng_zGnuKeyArg[] = "=KWd"; static char eng_zGnuFileArg[] = "=file"; static char eng_zGnuKeyLArg[] = "=Mbr"; static char eng_zGnuTimeArg[] = "=Tim"; static char eng_zGnuNumArg[] = "=num"; static char eng_zGnuStrArg[] = "=str"; static char const usage_txt[4435] = "malloc of %d bytes failed\n\0" "AutoOpts function called without option descriptor\n\0" "\tThis exceeds the compiled library version: \0" "Automated Options Processing Error!\n" "\t%s called AutoOpts function with structure version %d:%d:%d.\n\0" "realloc of %d bytes at 0x%p failed\n\0" "\tThis is less than the minimum library version: \0" "strdup of %d byte string failed\n\0" "Automated Options version %s\n" "\tcopyright (c) 1999-2011 by Bruce Korb - all rights reserved\n\0" "AutoOpts lib error: defaulted to option with optional arg\n\0" "(AutoOpts bug): Aliasing option is out of range.\0" "all\0" "\t\t\t\t- an alternate for %s\n\0" "%s error: the keyword `%s' is ambiguous for %s\n\0" "%s: ambiguous option -- %s\n\0" "%s: Command line arguments required\n\0" "%d %s%s options allowed\n\0" "version and help options:\0" "Error %d (%s) from the pipe(2) syscall\n\0" "ERROR: version option argument '%c' invalid. Use:\n" "\t'v' - version only\n" "\t'c' - version and copyright\n" "\t'n' - version and copyright notice\n\0" "ERROR: %s option conflicts with the %s option\n\0" "%s(optionSaveState): error: cannot allocate %d bytes\n\0" "auto-options\0" "program\0" "\t\t\t\t- default option for unnamed options\n\0" "\t\t\t\t- disabled as --%s\n\0" "%s: The ``%s'' option has been disabled\0" " --- %-14s %s\n\0" "This option has been disabled\0" "\t\t\t\t- enabled by default\n\0" "-equivalence\0" "ERROR: only \0" " - examining environment variables named %s_*\n\0" " \0" "Options are specified by doubled hyphens and their name or by a single\n" "hyphen and the flag character.\n\0" "%%-%ds %%s\n\0" "fs error %d (%s) on fork - cannot obtain %s usage\n\0" "fs error %d (%s) on freopen\n\0" "File error %d (%s) opening %s for loading options\n\0" "fs error %d (%s) reading file %s\n\0" "fs error %d (%s) on %s %s for option %s\n\0" "stat-ing for directory\0" "stat-ing for regular file\0" "stat-ing for non-existant file\0" "open-ing file\0" "fopen-ing file\0" "\t\t\t\t- file must not pre-exist\n\0" "\t\t\t\t- file must pre-exist\n\0" "\n" "= = = = = = = =\n\n" "This incarnation of genshell will produce\n" "a shell script to parse the options for %s:\n\n\0" "\n" "%s\n\n\0" "=Cplx\0" "[=arg]\0" "--%2$s%1$s\0" "%s: illegal option -- %c\n\0" "%s: illegal option -- %s\n\0" "illegal\0" " or an integer from %d through %d\n\0" "AutoOpts ERROR: invalid option descriptor for %s\n\0" " or an integer mask with any of the lower %d bits set\n\0" "\t\t\t\t- is a set membership option\n\0" "%s: option `%s' requires an argument\n\0" "Equivalenced option '%s' was equivalenced to both\n" "\t'%s' and '%s'\0" "\t\t\t\t- must appear between %d and %d times\n\0" "ERROR: The %s option is required\n\0" "%s: option `%s' cannot have an argument\n\0" "%s: cannot allocate new argument vector\n\0" "%s: Command line arguments not allowed\n\0" "error %d (%s) creating %s\n\0" "Options are specified by single or double hyphens and their name.\n\0" "%s error: `%s' does not match any %s keywords\n\0" "\t\t\t\t- may appear multiple times\n\0" "\t\t\t\t- may not be preset\n\0" "The 'reset-option' option requires an argument\n\0" " Arg Option-Name Description\n\0" " Flg Arg Option-Name Description\n\0" "error %d (%s) stat-ing %s\n\0" "%s(optionRestore): error: no saved option state\n\0" "none\0" "'%s' not defined\n\0" "'%s' is not a command line option\n\0" "ERROR: The %s option must appear %d times\n\0" "error: cannot load options from non-regular file %s\n\0" "%s error: `%s' is not a recognizable number\n\0" "%s error: `%s' is not a recognizable date/time\n\0" "%s error: `%s' is not a recognizable time duration\n\0" " %3s %s\0" "The '-#' option may omit the hash char\n\0" " \0" "one %s%s option allowed\n\0" "All arguments are named options.\n\0" "Write failure to output file\0" " - reading file %s\0" "\n" "please send bug reports to: %s\n\0" "\t\t\t\t- may NOT appear - preset only\n\0" "# preset/initialization file\n" "# %s#\n\0" "\n" "The following option preset mechanisms are supported:\n\0" "prohibits these options:\n\0" "Operands and options may be intermixed. They will be reordered.\n\0" "%s%ld to %ld\0" "%sgreater than or equal to %ld\0" "%sIt must lie in one of the ranges:\n\0" "%sIt must be in the range:\n\0" ", or\n\0" "%s error: %s option value ``%s'' is out of range.\n\0" "%s%ld exactly\0" "%sis scalable with a suffix: k/K/m/M/g/G/t/T\n\0" "%sless than or equal to %ld\0" "The --reset-option has not been configured.\n\0" "ERROR: %s option requires the %s option\n\0" " %3s %-14s %s\0" "requires these options:\n\0" " Arg Option-Name Req? Description\n\0" " Flg Arg Option-Name Req? Description\n\0" "-_^\0" "or you may use a numeric representation. Preceding these with a '!' will\n" "clear the bits, specifying 'none' will clear all bits, and 'all' will set them\n" "all. Multiple entries may be passed as an option argument list.\n\0" "%s\0" " \0" "T/F\0" "\n" "%s\n\n" "%s\0" "Fil\0" "KWd\0" "Mbr\0" "Tim\0" "Cpx\0" "no \0" "Num\0" "opt\0" "YES\0" "Str\0" "\t\t\t\t- \0" "\t\t\t\t-- and \0" "\t\t\t\t%s\n\0" " \0" " \0" "\t\t\t\t- may appear up to %d times\n\0" "The valid \"%s\" option keywords are:\n\0"; /* * Now, define (and initialize) the structure that contains * the pointers to all these strings. * Aren't you glad you don't maintain this by hand? */ usage_text_t option_usage_text = { 142, eng_zGnuBoolArg, eng_zGnuKeyArg, eng_zGnuFileArg, eng_zGnuKeyLArg, eng_zGnuTimeArg, eng_zGnuNumArg, eng_zGnuStrArg, { usage_txt + 0, usage_txt + 27, usage_txt + 79, usage_txt + 125, usage_txt + 224, usage_txt + 260, usage_txt + 310, usage_txt + 343, usage_txt + 434, usage_txt + 493, usage_txt + 543, usage_txt + 547, usage_txt + 574, usage_txt + 623, usage_txt + 651, usage_txt + 688, usage_txt + 713, usage_txt + 739, usage_txt + 779, usage_txt + 916, usage_txt + 964, usage_txt +1018, usage_txt +1031, usage_txt +1039, usage_txt +1081, usage_txt +1105, usage_txt +1145, usage_txt +1160, usage_txt +1190, usage_txt +1216, usage_txt +1229, usage_txt +1243, usage_txt +1290, usage_txt +1296, usage_txt +1399, usage_txt +1411, usage_txt +1462, usage_txt +1491, usage_txt +1542, usage_txt +1576, usage_txt +1617, usage_txt +1640, usage_txt +1666, usage_txt +1697, usage_txt +1711, usage_txt +1726, usage_txt +1757, usage_txt +1784, usage_txt +1890, usage_txt +1896, usage_txt +1902, usage_txt +1909, usage_txt +1920, usage_txt +1946, usage_txt +1972, usage_txt +1980, usage_txt +2016, usage_txt +2067, usage_txt +2123, usage_txt +2157, usage_txt +2195, usage_txt +2260, usage_txt +2303, usage_txt +2338, usage_txt +2379, usage_txt +2420, usage_txt +2460, usage_txt +2487, usage_txt +2554, usage_txt +2602, usage_txt +2635, usage_txt +2660, usage_txt +2708, usage_txt +2743, usage_txt +2781, usage_txt +2808, usage_txt +2857, usage_txt +2862, usage_txt +2880, usage_txt +2915, usage_txt +2959, usage_txt +3013, usage_txt +3059, usage_txt +3108, usage_txt +3161, usage_txt +3169, usage_txt +3217, usage_txt +3219, usage_txt +3244, usage_txt +3278, usage_txt +3307, usage_txt +3326, usage_txt +3360, usage_txt +3396, usage_txt +3434, usage_txt +3490, usage_txt +3516, usage_txt +3582, usage_txt +3595, usage_txt +3626, usage_txt +3663, usage_txt +3691, usage_txt +3697, usage_txt +3749, usage_txt +3763, usage_txt +3809, usage_txt +3837, usage_txt +3882, usage_txt +3924, usage_txt +3938, usage_txt +3963, usage_txt +4003, usage_txt +4046, usage_txt +4050, usage_txt +4269, usage_txt +4272, usage_txt +4279, usage_txt +4283, usage_txt +4291, usage_txt +4295, usage_txt +4299, usage_txt +4303, usage_txt +4307, usage_txt +4311, usage_txt +4315, usage_txt +4319, usage_txt +4323, usage_txt +4327, usage_txt +4331, usage_txt +4338, usage_txt +4350, usage_txt +4358, usage_txt +4362, usage_txt +4365, usage_txt +4398 } }; #endif /* DO_TRANSLATIONS */ #endif /* AUTOOPTS_USAGE_TXT_H_GUARD */ ntp-4.2.6p5/sntp/libopts/autoopts/project.h0000644000175000017500000000200511564122255017746 0ustar peterpeter #ifndef AUTOGEN_PROJECT_H #define AUTOGEN_PROJECT_H #include "config.h" /* * Procedure success codes * * USAGE: define procedures to return "tSuccess". Test their results * with the SUCCEEDED, FAILED and HADGLITCH macros. * * Microsoft sticks its nose into user space here, so for Windows' sake, * make sure all of these are undefined. */ #undef SUCCESS #undef FAILURE #undef PROBLEM #undef SUCCEEDED #undef SUCCESSFUL #undef FAILED #undef HADGLITCH #define SUCCESS ((tSuccess) 0) #define FAILURE ((tSuccess)-1) #define PROBLEM ((tSuccess) 1) typedef int tSuccess; #define SUCCEEDED(p) ((p) == SUCCESS) #define SUCCESSFUL(p) SUCCEEDED(p) #define FAILED(p) ((p) < SUCCESS) #define HADGLITCH(p) ((p) > SUCCESS) #ifndef STR # define __STR(s) #s # define STR(s) __STR(s) #endif #define STRSIZE(s) (sizeof(s)-1) #ifdef DEFINING # define VALUE(s) = s # define MODE #else # define VALUE(s) # define MODE extern #endif #endif /* AUTOGEN_PROJECT_H */ ntp-4.2.6p5/sntp/version.m40000644000175000017500000000004611675460540014534 0ustar peterpeterm4_define([VERSION_NUMBER],[4.2.6p5]) ntp-4.2.6p5/parseutil/0000755000175000017500000000000011675461365013637 5ustar peterpeterntp-4.2.6p5/parseutil/Makefile.in0000644000175000017500000004510411675460301015675 0ustar peterpeter# 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@ EXTRA_PROGRAMS = testdcf$(EXEEXT) dcfd$(EXEEXT) DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depsver.mf subdir = parseutil ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ $(top_srcdir)/m4/define_dir.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_cacheversion.m4 \ $(top_srcdir)/m4/ntp_dir_sep.m4 \ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \ $(top_srcdir)/m4/ntp_openssl.m4 \ $(top_srcdir)/m4/ntp_vpathhack.m4 \ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/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 = PROGRAMS = $(noinst_PROGRAMS) dcfd_SOURCES = dcfd.c dcfd_OBJECTS = dcfd.$(OBJEXT) dcfd_LDADD = $(LDADD) testdcf_SOURCES = testdcf.c testdcf_OBJECTS = testdcf.$(OBJEXT) testdcf_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = dcfd.c testdcf.c DIST_SOURCES = dcfd.c testdcf.c ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ 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@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ LIBOPTS_DIR = @LIBOPTS_DIR@ LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ 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@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ OPENSSL_LIB = @OPENSSL_LIB@ 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_SH = @PATH_SH@ PATH_TEST = @PATH_TEST@ POSIX_SHELL = @POSIX_SHELL@ PROPDELAY = @PROPDELAY@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CFLAGS = @SNMP_CFLAGS@ SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ SNMP_LIBS = @SNMP_LIBS@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ VERSION = @VERSION@ 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_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 = #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies AUTOMAKE_OPTIONS = BUILT_SOURCES = .deps-ver CLEANFILES = .deps-ver noinst_PROGRAMS = @TESTDCF@ @DCFD@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include ETAGS_ARGS = Makefile.am DISTCLEANFILES = $(EXTRA_PROGRAMS) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(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 parseutil/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign parseutil/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): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list dcfd$(EXEEXT): $(dcfd_OBJECTS) $(dcfd_DEPENDENCIES) @rm -f dcfd$(EXEEXT) $(LINK) $(dcfd_OBJECTS) $(dcfd_LDADD) $(LIBS) testdcf$(EXEEXT): $(testdcf_OBJECTS) $(testdcf_DEPENDENCIES) @rm -f testdcf$(EXEEXT) $(LINK) $(testdcf_OBJECTS) $(testdcf_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dcfd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdcf.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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 $(MAKE) $(AM_MAKEFLAGS) check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check check-am install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ clean-generic clean-libtool clean-noinstPROGRAMS ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am #EXTRA_DIST= TAGS check-local: @DCFD@ case "$(noinst_PROGRAMS)" in \ *dcfd*) ./dcfd -Y ;; \ esac $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver @[ -f $@ ] || \ cp $(top_srcdir)/deps-ver $@ @[ -w $@ ] || \ chmod ug+w $@ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ $(MAKE) clean && \ echo -n "Prior $(subdir)/$(DEPDIR) version " && \ cat $@ && \ rm -rf $(DEPDIR) && \ mkdir $(DEPDIR) && \ case "$(top_builddir)" in \ .) \ ./config.status Makefile depfiles \ ;; \ ..) \ cd .. && \ ./config.status $(subdir)/Makefile depfiles && \ cd $(subdir) \ ;; \ *) \ echo 'Fatal: depsver.mf Automake fragment limited' \ 'to immediate subdirectories.' && \ echo "top_builddir: $(top_builddir)" && \ echo "subdir: $(subdir)" && \ exit 1 \ ;; \ esac && \ echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver @touch $@ # # depsver.mf included in Makefile.am for directories with .deps # # When building in the same directory with sources that change over # time, such as when tracking using bk, the .deps files can become # stale with respect to moved, deleted, or superceded headers. Most # commonly, this would exhibit as make reporting a failure to make a # header file which is no longer in the location given. To address # this issue, we use a deps-ver file which is updated with each change # that breaks old .deps files. A copy of deps-ver is made into # $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present # with different contents than deps-ver, we make clean to ensure all # .o files built before the incompatible change are rebuilt along with # their updated .deps files, then remove $(DEPDIR) and recreate it as # empty stubs. # # It is normal when configured with --disable-dependency-tracking for # the DEPDIR to not have been created. For this reason, we use the # intermediate target .deps-ver, which invokes make recursively if # DEPDIR exists. # # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # # This comment block follows rather than leads the related code so that # it stays with it in the generated Makefile.in and Makefile. # # 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: ntp-4.2.6p5/parseutil/testdcf.c0000644000175000017500000003100310441361301015407 0ustar peterpeter/* * /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 ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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 "ntp_stdlib.h" #include #include #include #include #include /* * 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 */ struct clocktime /* clock time broken up from time code */ { long wday; long day; long month; long year; long hour; long minute; long second; long usecond; long utcoffset; /* in minutes */ long flags; /* current clock status */ }; typedef struct clocktime clocktime_t; static char type(unsigned int); #define TIMES10(_X_) (((_X_) << 3) + ((_X_) << 1)) /* * parser related return/error codes */ #define CVT_MASK 0x0000000F /* conversion exit code */ #define CVT_NONE 0x00000001 /* format not applicable */ #define CVT_FAIL 0x00000002 /* conversion failed - error code returned */ #define CVT_OK 0x00000004 /* conversion succeeded */ #define CVT_BADFMT 0x00000010 /* general format error - (unparsable) */ /* * DCF77 raw time code * * From "Zur Zeit", Physikalisch-Technische Bundesanstalt (PTB), Braunschweig * und Berlin, Maerz 1989 * * Timecode transmission: * AM: * time marks are send every second except for the second before the * next minute mark * time marks consist of a reduction of transmitter power to 25% * of the nominal level * the falling edge is the time indication (on time) * time marks of a 100ms duration constitute a logical 0 * time marks of a 200ms duration constitute a logical 1 * FM: * see the spec. (basically a (non-)inverted psuedo random phase shift) * * Encoding: * Second Contents * 0 - 10 AM: free, FM: 0 * 11 - 14 free * 15 R - alternate antenna * 16 A1 - expect zone change (1 hour before) * 17 - 18 Z1,Z2 - time zone * 0 0 illegal * 0 1 MEZ (MET) * 1 0 MESZ (MED, MET DST) * 1 1 illegal * 19 A2 - expect leap insertion/deletion (1 hour before) * 20 S - start of time code (1) * 21 - 24 M1 - BCD (lsb first) Minutes * 25 - 27 M10 - BCD (lsb first) 10 Minutes * 28 P1 - Minute Parity (even) * 29 - 32 H1 - BCD (lsb first) Hours * 33 - 34 H10 - BCD (lsb first) 10 Hours * 35 P2 - Hour Parity (even) * 36 - 39 D1 - BCD (lsb first) Days * 40 - 41 D10 - BCD (lsb first) 10 Days * 42 - 44 DW - BCD (lsb first) day of week (1: Monday -> 7: Sunday) * 45 - 49 MO - BCD (lsb first) Month * 50 MO0 - 10 Months * 51 - 53 Y1 - BCD (lsb first) Years * 54 - 57 Y10 - BCD (lsb first) 10 Years * 58 P3 - Date Parity (even) * 59 - usually missing (minute indication), except for leap insertion */ static char revision[] = "4.10"; static struct rawdcfcode { char offset; /* start bit */ } rawdcfcode[] = { { 0 }, { 15 }, { 16 }, { 17 }, { 19 }, { 20 }, { 21 }, { 25 }, { 28 }, { 29 }, { 33 }, { 35 }, { 36 }, { 40 }, { 42 }, { 45 }, { 49 }, { 50 }, { 54 }, { 58 }, { 59 } }; #define DCF_M 0 #define DCF_R 1 #define DCF_A1 2 #define DCF_Z 3 #define DCF_A2 4 #define DCF_S 5 #define DCF_M1 6 #define DCF_M10 7 #define DCF_P1 8 #define DCF_H1 9 #define DCF_H10 10 #define DCF_P2 11 #define DCF_D1 12 #define DCF_D10 13 #define DCF_DW 14 #define DCF_MO 15 #define DCF_MO0 16 #define DCF_Y1 17 #define DCF_Y10 18 #define DCF_P3 19 static struct partab { char offset; /* start bit of parity field */ } partab[] = { { 21 }, { 29 }, { 36 }, { 59 } }; #define DCF_P_P1 0 #define DCF_P_P2 1 #define DCF_P_P3 2 #define DCF_Z_MET 0x2 #define DCF_Z_MED 0x1 static unsigned long ext_bf( register unsigned char *buf, register int idx ) { register unsigned long sum = 0; register int i, first; first = rawdcfcode[idx].offset; for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--) { sum <<= 1; sum |= (buf[i] != '-'); } return sum; } static unsigned pcheck( register unsigned char *buf, register int idx ) { register int i,last; register unsigned psum = 1; last = partab[idx+1].offset; for (i = partab[idx].offset; i < last; i++) psum ^= (buf[i] != '-'); return psum; } static unsigned long convert_rawdcf( register unsigned char *buffer, register int size, register clocktime_t *clock_time ) { if (size < 57) { printf("%-30s", "*** INCOMPLETE"); return CVT_NONE; } /* * check Start and Parity bits */ if ((ext_bf(buffer, DCF_S) == 1) && pcheck(buffer, DCF_P_P1) && pcheck(buffer, DCF_P_P2) && pcheck(buffer, DCF_P_P3)) { /* * buffer OK */ clock_time->flags = 0; clock_time->usecond= 0; clock_time->second = 0; clock_time->minute = ext_bf(buffer, DCF_M10); clock_time->minute = TIMES10(clock_time->minute) + ext_bf(buffer, DCF_M1); clock_time->hour = ext_bf(buffer, DCF_H10); clock_time->hour = TIMES10(clock_time->hour) + ext_bf(buffer, DCF_H1); clock_time->day = ext_bf(buffer, DCF_D10); clock_time->day = TIMES10(clock_time->day) + ext_bf(buffer, DCF_D1); clock_time->month = ext_bf(buffer, DCF_MO0); clock_time->month = TIMES10(clock_time->month) + ext_bf(buffer, DCF_MO); clock_time->year = ext_bf(buffer, DCF_Y10); clock_time->year = TIMES10(clock_time->year) + ext_bf(buffer, DCF_Y1); clock_time->wday = ext_bf(buffer, DCF_DW); switch (ext_bf(buffer, DCF_Z)) { case DCF_Z_MET: clock_time->utcoffset = -60; break; case DCF_Z_MED: clock_time->flags |= DCFB_DST; clock_time->utcoffset = -120; break; default: printf("%-30s", "*** BAD TIME ZONE"); return CVT_FAIL|CVT_BADFMT; } if (ext_bf(buffer, DCF_A1)) clock_time->flags |= DCFB_ANNOUNCE; if (ext_bf(buffer, DCF_A2)) clock_time->flags |= DCFB_LEAP; if (ext_bf(buffer, DCF_R)) clock_time->flags |= DCFB_ALTERNATE; return CVT_OK; } else { /* * bad format - not for us */ printf("%-30s", "*** BAD FORMAT (invalid/parity)"); return CVT_FAIL|CVT_BADFMT; } } static char type( unsigned int c ) { c ^= 0xFF; return (c >= 0xF); } static const char *wday[8] = { "??", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su" }; static char pat[] = "-\\|/"; #define LINES (24-2) /* error lines after which the two headlines are repeated */ int main( int argc, char *argv[] ) { if ((argc != 2) && (argc != 3)) { fprintf(stderr, "usage: %s [-f|-t|-ft|-tf] \n", argv[0]); exit(1); } else { unsigned char c; char *file; int fd; int offset = 15; int trace = 0; int errs = LINES+1; /* * SIMPLE(!) argument "parser" */ if (argc == 3) { if (strcmp(argv[1], "-f") == 0) offset = 0; if (strcmp(argv[1], "-t") == 0) trace = 1; if ((strcmp(argv[1], "-ft") == 0) || (strcmp(argv[1], "-tf") == 0)) { offset = 0; trace = 1; } file = argv[2]; } else { file = argv[1]; } fd = open(file, O_RDONLY); if (fd == -1) { perror(file); exit(1); } else { int i; #ifdef TIOCM_RTS int on = TIOCM_RTS; #endif struct timeval t, tt, tlast; char buf[61]; clocktime_t clock_time; struct termios term; int rtc = CVT_NONE; if (tcgetattr(fd, &term) == -1) { perror("tcgetattr"); exit(1); } memset(term.c_cc, 0, sizeof(term.c_cc)); term.c_cc[VMIN] = 1; #ifdef NO_PARENB_IGNPAR /* Was: defined(SYS_IRIX4) || defined (SYS_IRIX5) */ /* somehow doesn't grok PARENB & IGNPAR (mj) */ term.c_cflag = CS8|CREAD|CLOCAL; #else term.c_cflag = CS8|CREAD|CLOCAL|PARENB; #endif term.c_iflag = IGNPAR; term.c_oflag = 0; term.c_lflag = 0; cfsetispeed(&term, B50); cfsetospeed(&term, B50); if (tcsetattr(fd, TCSANOW, &term) == -1) { perror("tcsetattr"); exit(1); } #ifdef I_POP while (ioctl(fd, I_POP, 0) == 0) ; #endif #if defined(TIOCMBIC) && defined(TIOCM_RTS) if (ioctl(fd, TIOCMBIC, (caddr_t)&on) == -1) { perror("TIOCM_RTS"); } #endif printf(" DCF77 monitor %s - Copyright (C) 1993-2005, Frank Kardel\n\n", revision); clock_time.hour = 0; clock_time.minute = 0; clock_time.day = 0; clock_time.wday = 0; clock_time.month = 0; clock_time.year = 0; clock_time.flags = 0; buf[60] = '\0'; for ( i = 0; i < 60; i++) buf[i] = '.'; gettimeofday(&tlast, 0L); i = 0; while (read(fd, &c, 1) == 1) { gettimeofday(&t, 0L); tt = t; t.tv_sec -= tlast.tv_sec; t.tv_usec -= tlast.tv_usec; if (t.tv_usec < 0) { t.tv_usec += 1000000; t.tv_sec -= 1; } if (errs > LINES) { printf(" %s", &"PTB private....RADMLSMin....PHour..PMDay..DayMonthYear....P\n"[offset]); printf(" %s", &"---------------RADMLS1248124P124812P1248121241248112481248P\n"[offset]); errs = 0; } if (t.tv_sec > 1 || (t.tv_sec == 1 && t.tv_usec > 500000)) { printf("%c %.*s ", pat[i % (sizeof(pat)-1)], 59 - offset, &buf[offset]); if ((rtc = convert_rawdcf((unsigned char *)buf, i, &clock_time)) != CVT_OK) { printf("\n"); clock_time.hour = 0; clock_time.minute = 0; clock_time.day = 0; clock_time.wday = 0; clock_time.month = 0; clock_time.year = 0; clock_time.flags = 0; errs++; } if (((c^0xFF)+1) & (c^0xFF)) buf[0] = '?'; else buf[0] = type(c) ? '#' : '-'; for ( i = 1; i < 60; i++) buf[i] = '.'; i = 0; } else { if (((c^0xFF)+1) & (c^0xFF)) buf[i] = '?'; else buf[i] = type(c) ? '#' : '-'; printf("%c %.*s ", pat[i % (sizeof(pat)-1)], 59 - offset, &buf[offset]); } if (rtc == CVT_OK) { printf("%s, %2d:%02d:%02d, %d.%02d.%02d, <%s%s%s%s>", 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_ANNOUNCE) ? "A" : "_", (clock_time.flags & DCFB_DST) ? "D" : "_", (clock_time.flags & DCFB_LEAP) ? "L" : "_" ); if (trace && (i == 0)) { printf("\n"); errs++; } } printf("\r"); if (i < 60) { i++; } tlast = tt; fflush(stdout); } close(fd); } } return 0; } /* * History: * * testdcf.c,v * Revision 4.10 2005/08/06 14:18:43 kardel * cleanup warnings * * Revision 4.9 2005/08/06 14:14:38 kardel * document revision on startup * * Revision 4.8 2005/08/06 14:10:08 kardel * fix setting of baud rate * * Revision 4.7 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.6 2004/11/14 15:29:42 kardel * support PPSAPI, upgrade Copyright to Berkeley style * */ ntp-4.2.6p5/parseutil/Makefile.am0000644000175000017500000000101611307651603015655 0ustar peterpeterNULL= #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies AUTOMAKE_OPTIONS = BUILT_SOURCES = CLEANFILES = noinst_PROGRAMS = @TESTDCF@ @DCFD@ EXTRA_PROGRAMS = testdcf dcfd INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/nothreads/include \ -I$(top_srcdir)/lib/isc/unix/include ETAGS_ARGS = Makefile.am DISTCLEANFILES = $(EXTRA_PROGRAMS) #EXTRA_DIST= TAGS check-local: @DCFD@ case "$(noinst_PROGRAMS)" in \ *dcfd*) ./dcfd -Y ;; \ esac include $(top_srcdir)/depsver.mf ntp-4.2.6p5/parseutil/README0000644000175000017500000000111410017034573014476 0ustar peterpeterThis directory contains some DCF77 related programs. They have not yet fully been ported to architectures other than Sun with SunOS 4.x. So if you want to try them you are on your own - a little porting may be necessary. parsetest: simple parse streams module test Works only under SunOS with parse Streams Module loaded and Meinberg-Clocks testdcf: simple DCF77 raw impulse test program via 50Baud RS232 dcfd: simple DCF77 raw impulse receiver with NTP loopfilter mechanics for synchronisation (allows DCF77 synchronisation without network code in a nutshell) Frank Kardel ntp-4.2.6p5/parseutil/dcfd.c0000644000175000017500000013162111307651603014673 0ustar peterpeter/* * /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) * * Features: * DCF77 decoding * simple NTP loopfilter logic for local clock * interactive display for debugging * * Lacks: * Leap second handling (at that level you should switch to NTP Version 4 - really!) * * Copyright (c) 1995-2005 by Frank Kardel ntp.org> * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany * * 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. * 3. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include /* * NTP compilation environment */ #include "ntp_stdlib.h" #include "ntpd.h" /* indirectly include ntp.h to get YEAR_PIVOT Y2KFixes */ /* * select which terminal handling to use (currently only SysV variants) */ #if defined(HAVE_TERMIOS_H) || defined(STREAM) #include #define TTY_GETATTR(_FD_, _ARG_) tcgetattr((_FD_), (_ARG_)) #define TTY_SETATTR(_FD_, _ARG_) tcsetattr((_FD_), TCSANOW, (_ARG_)) #else /* not HAVE_TERMIOS_H || STREAM */ # if defined(HAVE_TERMIO_H) || defined(HAVE_SYSV_TTYS) # include # define TTY_GETATTR(_FD_, _ARG_) ioctl((_FD_), TCGETA, (_ARG_)) # define TTY_SETATTR(_FD_, _ARG_) ioctl((_FD_), TCSETAW, (_ARG_)) # endif/* HAVE_TERMIO_H || HAVE_SYSV_TTYS */ #endif /* not HAVE_TERMIOS_H || STREAM */ #ifndef TTY_GETATTR #include "Bletch: MUST DEFINE ONE OF 'HAVE_TERMIOS_H' or 'HAVE_TERMIO_H'" #endif #ifndef days_per_year #define days_per_year(_x_) (((_x_) % 4) ? 365 : (((_x_) % 400) ? 365 : 366)) #endif #define timernormalize(_a_) \ if ((_a_)->tv_usec >= 1000000) \ { \ (_a_)->tv_sec += (_a_)->tv_usec / 1000000; \ (_a_)->tv_usec = (_a_)->tv_usec % 1000000; \ } \ if ((_a_)->tv_usec < 0) \ { \ (_a_)->tv_sec -= 1 + (-(_a_)->tv_usec / 1000000); \ (_a_)->tv_usec = 999999 - (-(_a_)->tv_usec - 1); \ } #ifdef timeradd #undef timeradd #endif #define timeradd(_a_, _b_) \ (_a_)->tv_sec += (_b_)->tv_sec; \ (_a_)->tv_usec += (_b_)->tv_usec; \ timernormalize((_a_)) #ifdef timersub #undef timersub #endif #define timersub(_a_, _b_) \ (_a_)->tv_sec -= (_b_)->tv_sec; \ (_a_)->tv_usec -= (_b_)->tv_usec; \ timernormalize((_a_)) /* * debug macros */ #define PRINTF if (interactive) printf #define LPRINTF if (interactive && loop_filter_debug) printf #ifdef DEBUG #define dprintf(_x_) LPRINTF _x_ #else #define dprintf(_x_) #endif #ifdef DECL_ERRNO extern int errno; #endif static char *revision = "4.18"; /* * display received data (avoids also detaching from tty) */ static int interactive = 0; /* * display loopfilter (clock control) variables */ static int loop_filter_debug = 0; /* * do not set/adjust system time */ static int no_set = 0; /* * time that passes between start of DCF impulse and time stamping (fine * adjustment) in microseconds (receiver/OS dependent) */ #define DEFAULT_DELAY 230000 /* rough estimate */ /* * The two states we can be in - eithe we receive nothing * usable or we have the correct time */ #define NO_SYNC 0x01 #define SYNC 0x02 static int sync_state = NO_SYNC; static time_t last_sync; static unsigned long ticks = 0; static char pat[] = "-\\|/"; #define LINES (24-2) /* error lines after which the two headlines are repeated */ #define MAX_UNSYNC (10*60) /* allow synchronisation loss for 10 minutes */ #define NOTICE_INTERVAL (20*60) /* mention missing synchronisation every 20 minutes */ /* * clock adjustment PLL - see NTP protocol spec (RFC1305) for details */ #define USECSCALE 10 #define TIMECONSTANT 2 #define ADJINTERVAL 0 #define FREQ_WEIGHT 18 #define PHASE_WEIGHT 7 #define MAX_DRIFT 0x3FFFFFFF #define R_SHIFT(_X_, _Y_) (((_X_) < 0) ? -(-(_X_) >> (_Y_)) : ((_X_) >> (_Y_))) static long max_adj_offset_usec = 128000; static long clock_adjust = 0; /* current adjustment value (usec * 2^USECSCALE) */ static long accum_drift = 0; /* accumulated drift value (usec / ADJINTERVAL) */ static long adjustments = 0; static char skip_adjust = 1; /* discard first adjustment (bad samples) */ /* * DCF77 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 */ struct clocktime /* clock time broken up from time code */ { long wday; /* Day of week: 1: Monday - 7: Sunday */ long day; long month; long year; long hour; long minute; long second; long usecond; long utcoffset; /* in minutes */ long flags; /* current clock status (DCF77 state flags) */ }; typedef struct clocktime clocktime_t; /* * (usually) quick constant multiplications */ #define TIMES10(_X_) (((_X_) << 3) + ((_X_) << 1)) /* *8 + *2 */ #define TIMES24(_X_) (((_X_) << 4) + ((_X_) << 3)) /* *16 + *8 */ #define TIMES60(_X_) ((((_X_) << 4) - (_X_)) << 2) /* *(16 - 1) *4 */ /* * generic l_abs() function */ #define l_abs(_x_) (((_x_) < 0) ? -(_x_) : (_x_)) /* * conversion related return/error codes */ #define CVT_MASK 0x0000000F /* conversion exit code */ #define CVT_NONE 0x00000001 /* format not applicable */ #define CVT_FAIL 0x00000002 /* conversion failed - error code returned */ #define CVT_OK 0x00000004 /* conversion succeeded */ #define CVT_BADFMT 0x00000010 /* general format error - (unparsable) */ #define CVT_BADDATE 0x00000020 /* invalid date */ #define CVT_BADTIME 0x00000040 /* invalid time */ /* * DCF77 raw time code * * From "Zur Zeit", Physikalisch-Technische Bundesanstalt (PTB), Braunschweig * und Berlin, Maerz 1989 * * Timecode transmission: * AM: * time marks are send every second except for the second before the * next minute mark * time marks consist of a reduction of transmitter power to 25% * of the nominal level * the falling edge is the time indication (on time) * time marks of a 100ms duration constitute a logical 0 * time marks of a 200ms duration constitute a logical 1 * FM: * see the spec. (basically a (non-)inverted psuedo random phase shift) * * Encoding: * Second Contents * 0 - 10 AM: free, FM: 0 * 11 - 14 free * 15 R - alternate antenna * 16 A1 - expect zone change (1 hour before) * 17 - 18 Z1,Z2 - time zone * 0 0 illegal * 0 1 MEZ (MET) * 1 0 MESZ (MED, MET DST) * 1 1 illegal * 19 A2 - expect leap insertion/deletion (1 hour before) * 20 S - start of time code (1) * 21 - 24 M1 - BCD (lsb first) Minutes * 25 - 27 M10 - BCD (lsb first) 10 Minutes * 28 P1 - Minute Parity (even) * 29 - 32 H1 - BCD (lsb first) Hours * 33 - 34 H10 - BCD (lsb first) 10 Hours * 35 P2 - Hour Parity (even) * 36 - 39 D1 - BCD (lsb first) Days * 40 - 41 D10 - BCD (lsb first) 10 Days * 42 - 44 DW - BCD (lsb first) day of week (1: Monday -> 7: Sunday) * 45 - 49 MO - BCD (lsb first) Month * 50 MO0 - 10 Months * 51 - 53 Y1 - BCD (lsb first) Years * 54 - 57 Y10 - BCD (lsb first) 10 Years * 58 P3 - Date Parity (even) * 59 - usually missing (minute indication), except for leap insertion */ /*----------------------------------------------------------------------- * conversion table to map DCF77 bit stream into data fields. * Encoding: * Each field of the DCF77 code is described with two adjacent entries in * this table. The first entry specifies the offset into the DCF77 data stream * while the length is given as the difference between the start index and * the start index of the following field. */ static struct rawdcfcode { char offset; /* start bit */ } rawdcfcode[] = { { 0 }, { 15 }, { 16 }, { 17 }, { 19 }, { 20 }, { 21 }, { 25 }, { 28 }, { 29 }, { 33 }, { 35 }, { 36 }, { 40 }, { 42 }, { 45 }, { 49 }, { 50 }, { 54 }, { 58 }, { 59 } }; /*----------------------------------------------------------------------- * symbolic names for the fields of DCF77 describes in "rawdcfcode". * see comment above for the structure of the DCF77 data */ #define DCF_M 0 #define DCF_R 1 #define DCF_A1 2 #define DCF_Z 3 #define DCF_A2 4 #define DCF_S 5 #define DCF_M1 6 #define DCF_M10 7 #define DCF_P1 8 #define DCF_H1 9 #define DCF_H10 10 #define DCF_P2 11 #define DCF_D1 12 #define DCF_D10 13 #define DCF_DW 14 #define DCF_MO 15 #define DCF_MO0 16 #define DCF_Y1 17 #define DCF_Y10 18 #define DCF_P3 19 /*----------------------------------------------------------------------- * parity field table (same encoding as rawdcfcode) * This table describes the sections of the DCF77 code that are * parity protected */ static struct partab { char offset; /* start bit of parity field */ } partab[] = { { 21 }, { 29 }, { 36 }, { 59 } }; /*----------------------------------------------------------------------- * offsets for parity field descriptions */ #define DCF_P_P1 0 #define DCF_P_P2 1 #define DCF_P_P3 2 /*----------------------------------------------------------------------- * legal values for time zone information */ #define DCF_Z_MET 0x2 #define DCF_Z_MED 0x1 /*----------------------------------------------------------------------- * symbolic representation if the DCF77 data stream */ static struct dcfparam { unsigned char onebits[60]; unsigned char zerobits[60]; } dcfparam = { "###############RADMLS1248124P124812P1248121241248112481248P", /* 'ONE' representation */ "--------------------s-------p------p----------------------p" /* 'ZERO' representation */ }; /*----------------------------------------------------------------------- * extract a bitfield from DCF77 datastream * All numeric fields are LSB first. * buf holds a pointer to a DCF77 data buffer in symbolic * representation * idx holds the index to the field description in rawdcfcode */ static unsigned long ext_bf( register unsigned char *buf, register int idx ) { register unsigned long sum = 0; register int i, first; first = rawdcfcode[idx].offset; for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--) { sum <<= 1; sum |= (buf[i] != dcfparam.zerobits[i]); } return sum; } /*----------------------------------------------------------------------- * check even parity integrity for a bitfield * * buf holds a pointer to a DCF77 data buffer in symbolic * representation * idx holds the index to the field description in partab */ static unsigned pcheck( register unsigned char *buf, register int idx ) { register int i,last; register unsigned psum = 1; last = partab[idx+1].offset; for (i = partab[idx].offset; i < last; i++) psum ^= (buf[i] != dcfparam.zerobits[i]); return psum; } /*----------------------------------------------------------------------- * convert a DCF77 data buffer into wall clock time + flags * * buffer holds a pointer to a DCF77 data buffer in symbolic * representation * size describes the length of DCF77 information in bits (represented * as chars in symbolic notation * clock points to a wall clock time description of the DCF77 data (result) */ static unsigned long convert_rawdcf( unsigned char *buffer, int size, clocktime_t *clock_time ) { if (size < 57) { PRINTF("%-30s", "*** INCOMPLETE"); return CVT_NONE; } /* * check Start and Parity bits */ if ((ext_bf(buffer, DCF_S) == 1) && pcheck(buffer, DCF_P_P1) && pcheck(buffer, DCF_P_P2) && pcheck(buffer, DCF_P_P3)) { /* * buffer OK - extract all fields and build wall clock time from them */ clock_time->flags = 0; clock_time->usecond= 0; clock_time->second = 0; clock_time->minute = ext_bf(buffer, DCF_M10); clock_time->minute = TIMES10(clock_time->minute) + ext_bf(buffer, DCF_M1); clock_time->hour = ext_bf(buffer, DCF_H10); clock_time->hour = TIMES10(clock_time->hour) + ext_bf(buffer, DCF_H1); clock_time->day = ext_bf(buffer, DCF_D10); clock_time->day = TIMES10(clock_time->day) + ext_bf(buffer, DCF_D1); clock_time->month = ext_bf(buffer, DCF_MO0); clock_time->month = TIMES10(clock_time->month) + ext_bf(buffer, DCF_MO); clock_time->year = ext_bf(buffer, DCF_Y10); clock_time->year = TIMES10(clock_time->year) + ext_bf(buffer, DCF_Y1); clock_time->wday = ext_bf(buffer, DCF_DW); /* * determine offset to UTC by examining the time zone */ switch (ext_bf(buffer, DCF_Z)) { case DCF_Z_MET: clock_time->utcoffset = -60; break; case DCF_Z_MED: clock_time->flags |= DCFB_DST; clock_time->utcoffset = -120; break; default: PRINTF("%-30s", "*** BAD TIME ZONE"); return CVT_FAIL|CVT_BADFMT; } /* * extract various warnings from DCF77 */ if (ext_bf(buffer, DCF_A1)) clock_time->flags |= DCFB_ANNOUNCE; if (ext_bf(buffer, DCF_A2)) clock_time->flags |= DCFB_LEAP; if (ext_bf(buffer, DCF_R)) clock_time->flags |= DCFB_ALTERNATE; return CVT_OK; } else { /* * bad format - not for us */ PRINTF("%-30s", "*** BAD FORMAT (invalid/parity)"); return CVT_FAIL|CVT_BADFMT; } } /*----------------------------------------------------------------------- * raw dcf input routine - fix up 50 baud * characters for 1/0 decision */ static unsigned long cvt_rawdcf( unsigned char *buffer, int size, clocktime_t *clock_time ) { register unsigned char *s = buffer; register unsigned char *e = buffer + size; register unsigned char *b = dcfparam.onebits; register unsigned char *c = dcfparam.zerobits; register unsigned rtc = CVT_NONE; register unsigned int i, lowmax, highmax, cutoff, span; #define BITS 9 unsigned char histbuf[BITS]; /* * the input buffer contains characters with runs of consecutive * bits set. These set bits are an indication of the DCF77 pulse * length. We assume that we receive the pulse at 50 Baud. Thus * a 100ms pulse would generate a 4 bit train (20ms per bit and * start bit) * a 200ms pulse would create all zeroes (and probably a frame error) * * The basic idea is that on corret reception we must have two * maxima in the pulse length distribution histogram. (one for * the zero representing pulses and one for the one representing * pulses) * There will always be ones in the datastream, thus we have to see * two maxima. * The best point to cut for a 1/0 decision is the minimum between those * between the maxima. The following code tries to find this cutoff point. */ /* * clear histogram buffer */ for (i = 0; i < BITS; i++) { histbuf[i] = 0; } cutoff = 0; lowmax = 0; /* * convert sequences of set bits into bits counts updating * the histogram alongway */ while (s < e) { register unsigned int ch = *s ^ 0xFF; /* * check integrity and update histogramm */ if (!((ch+1) & ch) || !*s) { /* * character ok */ for (i = 0; ch; i++) { ch >>= 1; } *s = i; histbuf[i]++; cutoff += i; lowmax++; } else { /* * invalid character (no consecutive bit sequence) */ dprintf(("parse: cvt_rawdcf: character check for 0x%x@%d FAILED\n", *s, s - buffer)); *s = (unsigned char)~0; rtc = CVT_FAIL|CVT_BADFMT; } s++; } /* * first cutoff estimate (average bit count - must be between both * maxima) */ if (lowmax) { cutoff /= lowmax; } else { cutoff = 4; /* doesn't really matter - it'll fail anyway, but gives error output */ } dprintf(("parse: cvt_rawdcf: average bit count: %d\n", cutoff)); lowmax = 0; /* weighted sum */ highmax = 0; /* bitcount */ /* * collect weighted sum of lower bits (left of initial guess) */ dprintf(("parse: cvt_rawdcf: histogram:")); for (i = 0; i <= cutoff; i++) { lowmax += histbuf[i] * i; highmax += histbuf[i]; dprintf((" %d", histbuf[i])); } dprintf((" ")); /* * round up */ lowmax += highmax / 2; /* * calculate lower bit maximum (weighted sum / bit count) * * avoid divide by zero */ if (highmax) { lowmax /= highmax; } else { lowmax = 0; } highmax = 0; /* weighted sum of upper bits counts */ cutoff = 0; /* bitcount */ /* * collect weighted sum of lower bits (right of initial guess) */ for (; i < BITS; i++) { highmax+=histbuf[i] * i; cutoff +=histbuf[i]; dprintf((" %d", histbuf[i])); } dprintf(("\n")); /* * determine upper maximum (weighted sum / bit count) */ if (cutoff) { highmax /= cutoff; } else { highmax = BITS-1; } /* * following now holds: * lowmax <= cutoff(initial guess) <= highmax * best cutoff is the minimum nearest to higher bits */ /* * find the minimum between lowmax and highmax (detecting * possibly a minimum span) */ span = cutoff = lowmax; for (i = lowmax; i <= highmax; i++) { if (histbuf[cutoff] > histbuf[i]) { /* * got a new minimum move beginning of minimum (cutoff) and * end of minimum (span) there */ cutoff = span = i; } else if (histbuf[cutoff] == histbuf[i]) { /* * minimum not better yet - but it spans more than * one bit value - follow it */ span = i; } } /* * cutoff point for 1/0 decision is the middle of the minimum section * in the histogram */ cutoff = (cutoff + span) / 2; dprintf(("parse: cvt_rawdcf: lower maximum %d, higher maximum %d, cutoff %d\n", lowmax, highmax, cutoff)); /* * convert the bit counts to symbolic 1/0 information for data conversion */ s = buffer; while ((s < e) && *c && *b) { if (*s == (unsigned char)~0) { /* * invalid character */ *s = '?'; } else { /* * symbolic 1/0 representation */ *s = (*s >= cutoff) ? *b : *c; } s++; b++; c++; } /* * if everything went well so far return the result of the symbolic * conversion routine else just the accumulated errors */ if (rtc != CVT_NONE) { PRINTF("%-30s", "*** BAD DATA"); } return (rtc == CVT_NONE) ? convert_rawdcf(buffer, size, clock_time) : rtc; } /*----------------------------------------------------------------------- * convert a wall clock time description of DCF77 to a Unix time (seconds * since 1.1. 1970 UTC) */ static time_t dcf_to_unixtime( clocktime_t *clock_time, unsigned *cvtrtc ) { #define SETRTC(_X_) { if (cvtrtc) *cvtrtc = (_X_); } 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) */ if ( clock_time->year < YEAR_PIVOT ) /* in case of Y2KFixes [ */ clock_time->year += 100; /* *year%100, make tm_year */ /* *(do we need this?) */ if ( clock_time->year < YEAR_BREAK ) /* (failsafe if) */ clock_time->year += 1900; /* Y2KFixes ] */ /* * must have been a really bad year code - drop it */ if (clock_time->year < (YEAR_PIVOT + 1900) ) /* Y2KFixes */ { SETRTC(CVT_FAIL|CVT_BADDATE); return -1; } /* * sorry, slow section here - but it's not time critical anyway */ /* * calculate days since 1970 (watching leap years) */ t = julian0( clock_time->year ) - julian0( 1970 ); /* month */ if (clock_time->month <= 0 || clock_time->month > 12) { SETRTC(CVT_FAIL|CVT_BADDATE); return -1; /* bad month */ } /* adjust current leap year */ #if 0 if (clock_time->month < 3 && days_per_year(clock_time->year) == 366) t--; #endif /* * collect days from months excluding the current one */ for (i = 1; i < clock_time->month; i++) { t += days_of_month[i]; } /* day */ if (clock_time->day < 1 || ((clock_time->month == 2 && days_per_year(clock_time->year) == 366) ? clock_time->day > 29 : clock_time->day > days_of_month[clock_time->month])) { SETRTC(CVT_FAIL|CVT_BADDATE); return -1; /* bad day */ } /* * collect days from date excluding the current one */ t += clock_time->day - 1; /* hour */ if (clock_time->hour < 0 || clock_time->hour >= 24) { SETRTC(CVT_FAIL|CVT_BADTIME); return -1; /* bad hour */ } /* * calculate hours from 1. 1. 1970 */ t = TIMES24(t) + clock_time->hour; /* min */ if (clock_time->minute < 0 || clock_time->minute > 59) { SETRTC(CVT_FAIL|CVT_BADTIME); return -1; /* bad min */ } /* * calculate minutes from 1. 1. 1970 */ t = TIMES60(t) + clock_time->minute; /* sec */ /* * calculate UTC in minutes */ t += clock_time->utcoffset; if (clock_time->second < 0 || clock_time->second > 60) /* allow for LEAPs */ { SETRTC(CVT_FAIL|CVT_BADTIME); return -1; /* bad sec */ } /* * calculate UTC in seconds - phew ! */ t = TIMES60(t) + clock_time->second; /* done */ return t; } /*----------------------------------------------------------------------- * cheap half baked 1/0 decision - for interactive operation only */ static char type( unsigned int c ) { c ^= 0xFF; return (c > 0xF); } /*----------------------------------------------------------------------- * week day representation */ static const char *wday[8] = { "??", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su" }; /*----------------------------------------------------------------------- * generate a string representation for a timeval */ static char * pr_timeval( struct timeval *val ) { static char buf[20]; if (val->tv_sec == 0) sprintf(buf, "%c0.%06ld", (val->tv_usec < 0) ? '-' : '+', (long int)l_abs(val->tv_usec)); else sprintf(buf, "%ld.%06ld", (long int)val->tv_sec, (long int)l_abs(val->tv_usec)); return buf; } /*----------------------------------------------------------------------- * correct the current time by an offset by setting the time rigorously */ static void set_time( struct timeval *offset ) { struct timeval the_time; if (no_set) return; LPRINTF("set_time: %s ", pr_timeval(offset)); syslog(LOG_NOTICE, "setting time (offset %s)", pr_timeval(offset)); if (gettimeofday(&the_time, 0L) == -1) { perror("gettimeofday()"); } else { timeradd(&the_time, offset); if (settimeofday(&the_time, 0L) == -1) { perror("settimeofday()"); } } } /*----------------------------------------------------------------------- * slew the time by a given offset */ static void adj_time( long offset ) { struct timeval time_offset; if (no_set) return; time_offset.tv_sec = offset / 1000000; time_offset.tv_usec = offset % 1000000; LPRINTF("adj_time: %ld us ", (long int)offset); if (adjtime(&time_offset, 0L) == -1) perror("adjtime()"); } /*----------------------------------------------------------------------- * read in a possibly previously written drift value */ static void read_drift( const char *drift_file ) { FILE *df; df = fopen(drift_file, "r"); if (df != NULL) { int idrift = 0, fdrift = 0; fscanf(df, "%4d.%03d", &idrift, &fdrift); fclose(df); LPRINTF("read_drift: %d.%03d ppm ", idrift, fdrift); accum_drift = idrift << USECSCALE; fdrift = (fdrift << USECSCALE) / 1000; accum_drift += fdrift & (1< max_adj_offset_usec)) { /* * hopeless - set the clock - and clear the timing */ set_time(offset); clock_adjust = 0; skip_adjust = 1; return; } usecoffset = offset->tv_sec * 1000000 + offset->tv_usec; clock_adjust = R_SHIFT(usecoffset, TIMECONSTANT); /* adjustment to make for next period */ tmp = 0; while (adjustments > (1 << tmp)) tmp++; adjustments = 0; if (tmp > FREQ_WEIGHT) tmp = FREQ_WEIGHT; accum_drift += R_SHIFT(usecoffset << USECSCALE, TIMECONSTANT+TIMECONSTANT+FREQ_WEIGHT-tmp); if (accum_drift > MAX_DRIFT) /* clamp into interval */ accum_drift = MAX_DRIFT; else if (accum_drift < -MAX_DRIFT) accum_drift = -MAX_DRIFT; update_drift(drift_file, usecoffset, reftime); LPRINTF("clock_adjust: %s, clock_adjust %ld, drift_comp %ld(%ld) ", pr_timeval(offset),(long int) R_SHIFT(clock_adjust, USECSCALE), (long int)R_SHIFT(accum_drift, USECSCALE), (long int)accum_drift); } /*----------------------------------------------------------------------- * adjust the clock by a small mount to simulate frequency correction */ static void periodic_adjust( void ) { register long adjustment; adjustments++; adjustment = R_SHIFT(clock_adjust, PHASE_WEIGHT); clock_adjust -= adjustment; adjustment += R_SHIFT(accum_drift, USECSCALE+ADJINTERVAL); adj_time(adjustment); } /*----------------------------------------------------------------------- * control synchronisation status (warnings) and do periodic adjusts * (frequency control simulation) */ static void tick( int signum ) { static unsigned long last_notice = 0; #if !defined(HAVE_SIGACTION) && !defined(HAVE_SIGVEC) (void)signal(SIGALRM, tick); #endif periodic_adjust(); ticks += 1< MAX_UNSYNC) { /* * not getting time for a while */ if (sync_state == SYNC) { /* * completely lost information */ sync_state = NO_SYNC; syslog(LOG_INFO, "DCF77 reception lost (timeout)"); last_notice = ticks; } else /* * in NO_SYNC state - look whether its time to speak up again */ if ((ticks - last_notice) > NOTICE_INTERVAL) { syslog(LOG_NOTICE, "still not synchronized to DCF77 - check receiver/signal"); last_notice = ticks; } } #ifndef ITIMER_REAL (void) alarm(1< daemon operation) */ static void detach( void ) { # ifdef HAVE_DAEMON daemon(0, 0); # else /* not HAVE_DAEMON */ if (fork()) exit(0); { u_long s; int max_fd; #if defined(HAVE_SYSCONF) && defined(_SC_OPEN_MAX) max_fd = sysconf(_SC_OPEN_MAX); #else /* HAVE_SYSCONF && _SC_OPEN_MAX */ max_fd = getdtablesize(); #endif /* HAVE_SYSCONF && _SC_OPEN_MAX */ for (s = 0; s < max_fd; s++) (void) close((int)s); (void) open("/", 0); (void) dup2(0, 1); (void) dup2(0, 2); #ifdef SYS_DOMAINOS { uid_$t puid; status_$t st; proc2_$who_am_i(&puid); proc2_$make_server(&puid, &st); } #endif /* SYS_DOMAINOS */ #if defined(HAVE_SETPGID) || defined(HAVE_SETSID) # ifdef HAVE_SETSID if (setsid() == (pid_t)-1) syslog(LOG_ERR, "dcfd: setsid(): %m"); # else if (setpgid(0, 0) == -1) syslog(LOG_ERR, "dcfd: setpgid(): %m"); # endif #else /* HAVE_SETPGID || HAVE_SETSID */ { int fid; fid = open("/dev/tty", 2); if (fid >= 0) { (void) ioctl(fid, (u_long) TIOCNOTTY, (char *) 0); (void) close(fid); } # ifdef HAVE_SETPGRP_0 (void) setpgrp(); # else /* HAVE_SETPGRP_0 */ (void) setpgrp(0, getpid()); # endif /* HAVE_SETPGRP_0 */ } #endif /* HAVE_SETPGID || HAVE_SETSID */ } #endif /* not HAVE_DAEMON */ } /*----------------------------------------------------------------------- * list possible arguments and options */ static void usage( char *program ) { fprintf(stderr, "usage: %s [-n] [-f] [-l] [-t] [-i] [-o] [-d ] [-D ] \n", program); fprintf(stderr, "\t-n do not change time\n"); fprintf(stderr, "\t-i interactive\n"); fprintf(stderr, "\t-t trace (print all datagrams)\n"); fprintf(stderr, "\t-f print all databits (includes PTB private data)\n"); fprintf(stderr, "\t-l print loop filter debug information\n"); fprintf(stderr, "\t-o print offet average for current minute\n"); fprintf(stderr, "\t-Y make internal Y2K checks then exit\n"); /* Y2KFixes */ fprintf(stderr, "\t-d specify alternate drift file\n"); fprintf(stderr, "\t-D specify delay from input edge to processing in micro seconds\n"); } /*----------------------------------------------------------------------- * check_y2k() - internal check of Y2K logic * (a lot of this logic lifted from ../ntpd/check_y2k.c) */ 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. * 32-bit systems: through 2036, the **year in which NTP time overflows. * 64-bit systems: a reasonable upper **limit (well, maybe somewhat beyond **reasonable, but well before the **max time, by which time the earth **will be dead.) */ time_t Time; struct tm LocalTime; int Fatals, Warnings; #define Error(year) if ( (year)>=2036 && LocalTime.tm_year < 110 ) \ Warnings++; else Fatals++ Fatals = Warnings = 0; Time = time( (time_t *)NULL ); LocalTime = *localtime( &Time ); year = ( sizeof( u_long ) > 4 ) /* save max span using year as temp */ ? ( 400 * 3 ) /* three greater gregorian cycles */ : ((int)(0x7FFFFFFF / 365.242 / 24/60/60)* 2 ); /*32-bit limit*/ /* NOTE: will automacially expand test years on * 64 bit machines.... this may cause some of the * existing ntp logic to fail for years beyond * 2036 (the current 32-bit limit). If all checks * fail ONLY beyond year 2036 you may ignore such * errors, at least for a decade or so. */ yearend = year0 + year; year = 1900+YEAR_PIVOT; printf( " starting year %04d\n", (int) year ); printf( " ending year %04d\n", (int) yearend ); for ( ; year < yearend; year++ ) { clocktime_t ct; time_t Observed; time_t Expected; unsigned Flag; unsigned long t; ct.day = 1; ct.month = 1; ct.year = year; ct.hour = ct.minute = ct.second = ct.usecond = 0; ct.utcoffset = 0; ct.flags = 0; Flag = 0; Observed = dcf_to_unixtime( &ct, &Flag ); /* seems to be a clone of parse_to_unixtime() with * *a minor difference to arg2 type */ if ( ct.year != year ) { fprintf( stdout, "%04d: dcf_to_unixtime(,%d) CORRUPTED ct.year: was %d\n", (int)year, (int)Flag, (int)ct.year ); Error(year); break; } t = julian0(year) - julian0(1970); /* Julian day from 1970 */ Expected = t * 24 * 60 * 60; if ( Observed != Expected || Flag ) { /* time difference */ fprintf( stdout, "%04d: dcf_to_unixtime(,%d) FAILURE: was=%lu s/b=%lu (%ld)\n", year, (int)Flag, (unsigned long)Observed, (unsigned long)Expected, ((long)Observed - (long)Expected) ); Error(year); break; } if ( year >= YEAR_PIVOT+1900 ) { /* check year % 100 code we put into dcf_to_unixtime() */ ct.year = year % 100; Flag = 0; Observed = dcf_to_unixtime( &ct, &Flag ); if ( Observed != Expected || Flag ) { /* time difference */ fprintf( stdout, "%04d: dcf_to_unixtime(%d,%d) FAILURE: was=%lu s/b=%lu (%ld)\n", year, (int)ct.year, (int)Flag, (unsigned long)Observed, (unsigned long)Expected, ((long)Observed - (long)Expected) ); Error(year); break; } /* check year - 1900 code we put into dcf_to_unixtime() */ ct.year = year - 1900; Flag = 0; Observed = dcf_to_unixtime( &ct, &Flag ); if ( Observed != Expected || Flag ) { /* time difference */ fprintf( stdout, "%04d: dcf_to_unixtime(%d,%d) FAILURE: was=%lu s/b=%lu (%ld)\n", year, (int)ct.year, (int)Flag, (unsigned long)Observed, (unsigned long)Expected, ((long)Observed - (long)Expected) ); Error(year); break; } } } return ( Fatals ); } /*-------------------------------------------------- * rawdcf_init - set up modem lines for RAWDCF receivers */ #if defined(TIOCMSET) && (defined(TIOCM_DTR) || defined(CIOCM_DTR)) static void rawdcf_init( int fd ) { /* * You can use the RS232 to supply the power for a DCF77 receiver. * 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 int sl232 = CIOCM_DTR; /* turn on DTR for power supply */ #endif if (ioctl(fd, TIOCMSET, (caddr_t)&sl232) == -1) { syslog(LOG_NOTICE, "rawdcf_init: WARNING: ioctl(fd, TIOCMSET, [C|T]IOCM_DTR): %m"); } } #else static void rawdcf_init( int fd ) { syslog(LOG_NOTICE, "rawdcf_init: WARNING: OS interface incapable of setting DTR to power DCF modules"); } #endif /* DTR initialisation type */ /*----------------------------------------------------------------------- * main loop - argument interpreter / setup / main loop */ int main( int argc, char **argv ) { unsigned char c; char **a = argv; int ac = argc; char *file = NULL; const char *drift_file = "/etc/dcfd.drift"; int fd; int offset = 15; int offsets = 0; int delay = DEFAULT_DELAY; /* average delay from input edge to time stamping */ int trace = 0; int errs = 0; /* * process arguments */ while (--ac) { char *arg = *++a; if (*arg == '-') while ((c = *++arg)) switch (c) { case 't': trace = 1; interactive = 1; break; case 'f': offset = 0; interactive = 1; break; case 'l': loop_filter_debug = 1; offsets = 1; interactive = 1; break; case 'n': no_set = 1; break; case 'o': offsets = 1; interactive = 1; break; case 'i': interactive = 1; break; case 'D': if (ac > 1) { delay = atoi(*++a); ac--; } else { fprintf(stderr, "%s: -D requires integer argument\n", argv[0]); errs=1; } break; case 'd': if (ac > 1) { drift_file = *++a; ac--; } else { fprintf(stderr, "%s: -d requires file name argument\n", argv[0]); errs=1; } break; case 'Y': errs=check_y2k(); exit( errs ? 1 : 0 ); default: fprintf(stderr, "%s: unknown option -%c\n", argv[0], c); errs=1; break; } else if (file == NULL) file = arg; else { fprintf(stderr, "%s: device specified twice\n", argv[0]); errs=1; } } if (errs) { usage(argv[0]); exit(1); } else if (file == NULL) { fprintf(stderr, "%s: device not specified\n", argv[0]); usage(argv[0]); exit(1); } errs = LINES+1; /* * get access to DCF77 tty port */ fd = open(file, O_RDONLY); if (fd == -1) { perror(file); exit(1); } else { int i, rrc; struct timeval t, tt, tlast; struct timeval timeout; struct timeval phase; struct timeval time_offset; char pbuf[61]; /* printable version */ char buf[61]; /* raw data */ clocktime_t clock_time; /* wall clock time */ time_t utc_time = 0; time_t last_utc_time = 0; long usecerror = 0; long lasterror = 0; #if defined(HAVE_TERMIOS_H) || defined(STREAM) struct termios term; #else /* not HAVE_TERMIOS_H || STREAM */ # if defined(HAVE_TERMIO_H) || defined(HAVE_SYSV_TTYS) struct termio term; # endif/* HAVE_TERMIO_H || HAVE_SYSV_TTYS */ #endif /* not HAVE_TERMIOS_H || STREAM */ unsigned int rtc = CVT_NONE; rawdcf_init(fd); timeout.tv_sec = 1; timeout.tv_usec = 500000; phase.tv_sec = 0; phase.tv_usec = delay; /* * setup TTY (50 Baud, Read, 8Bit, No Hangup, 1 character IO) */ if (TTY_GETATTR(fd, &term) == -1) { perror("tcgetattr"); exit(1); } memset(term.c_cc, 0, sizeof(term.c_cc)); term.c_cc[VMIN] = 1; #ifdef NO_PARENB_IGNPAR term.c_cflag = CS8|CREAD|CLOCAL; #else term.c_cflag = CS8|CREAD|CLOCAL|PARENB; #endif term.c_iflag = IGNPAR; term.c_oflag = 0; term.c_lflag = 0; cfsetispeed(&term, B50); cfsetospeed(&term, B50); if (TTY_SETATTR(fd, &term) == -1) { perror("tcsetattr"); exit(1); } /* * lose terminal if in daemon operation */ if (!interactive) detach(); /* * get syslog() initialized */ #ifdef LOG_DAEMON openlog("dcfd", LOG_PID, LOG_DAEMON); #else openlog("dcfd", LOG_PID); #endif /* * setup periodic operations (state control / frequency control) */ #ifdef HAVE_SIGACTION { struct sigaction act; # ifdef HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION act.sa_sigaction = (void (*) (int, siginfo_t *, void *))0; # endif /* HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION */ act.sa_handler = tick; sigemptyset(&act.sa_mask); act.sa_flags = 0; if (sigaction(SIGALRM, &act, (struct sigaction *)0) == -1) { syslog(LOG_ERR, "sigaction(SIGALRM): %m"); exit(1); } } #else #ifdef HAVE_SIGVEC { struct sigvec vec; vec.sv_handler = tick; vec.sv_mask = 0; vec.sv_flags = 0; if (sigvec(SIGALRM, &vec, (struct sigvec *)0) == -1) { syslog(LOG_ERR, "sigvec(SIGALRM): %m"); exit(1); } } #else (void) signal(SIGALRM, tick); #endif #endif #ifdef ITIMER_REAL { struct itimerval it; it.it_interval.tv_sec = 1< LINES) { PRINTF(" %s", &"PTB private....RADMLSMin....PHour..PMDay..DayMonthYear....P\n"[offset]); PRINTF(" %s", &"---------------RADMLS1248124P124812P1248121241248112481248P\n"[offset]); errs = 0; } /* * timeout -> possible minute mark -> interpretation */ if (timercmp(&t, &timeout, >)) { PRINTF("%c %.*s ", pat[i % (sizeof(pat)-1)], 59 - offset, &pbuf[offset]); if ((rtc = cvt_rawdcf((unsigned char *)buf, i, &clock_time)) != CVT_OK) { /* * this data was bad - well - forget synchronisation for now */ PRINTF("\n"); if (sync_state == SYNC) { sync_state = NO_SYNC; syslog(LOG_INFO, "DCF77 reception lost (bad data)"); } errs++; } else if (trace) { PRINTF("\r %.*s ", 59 - offset, &buf[offset]); } buf[0] = c; /* * collect first character */ if (((c^0xFF)+1) & (c^0xFF)) pbuf[0] = '?'; else pbuf[0] = type(c) ? '#' : '-'; for ( i = 1; i < 60; i++) pbuf[i] = '.'; i = 0; } else { /* * collect character */ buf[i] = c; /* * initial guess (usually correct) */ if (((c^0xFF)+1) & (c^0xFF)) pbuf[i] = '?'; else pbuf[i] = type(c) ? '#' : '-'; PRINTF("%c %.*s ", pat[i % (sizeof(pat)-1)], 59 - offset, &pbuf[offset]); } if (i == 0 && rtc == CVT_OK) { /* * we got a good time code here - try to convert it to * UTC */ if ((utc_time = dcf_to_unixtime(&clock_time, &rtc)) == -1) { PRINTF("*** BAD CONVERSION\n"); } if (utc_time != (last_utc_time + 60)) { /* * well, two successive sucessful telegrams are not 60 seconds * apart */ PRINTF("*** NO MINUTE INC\n"); if (sync_state == SYNC) { sync_state = NO_SYNC; syslog(LOG_INFO, "DCF77 reception lost (data mismatch)"); } errs++; rtc = CVT_FAIL|CVT_BADTIME|CVT_BADDATE; } else usecerror = 0; last_utc_time = utc_time; } if (rtc == CVT_OK) { if (i == 0) { /* * valid time code - determine offset and * note regained reception */ last_sync = ticks; if (sync_state == NO_SYNC) { syslog(LOG_INFO, "receiving DCF77"); } else { /* * we had at least one minute SYNC - thus * last error is valid */ time_offset.tv_sec = lasterror / 1000000; time_offset.tv_usec = lasterror % 1000000; adjust_clock(&time_offset, drift_file, utc_time); } sync_state = SYNC; } time_offset.tv_sec = utc_time + i; time_offset.tv_usec = 0; timeradd(&time_offset, &phase); usecerror += (time_offset.tv_sec - tt.tv_sec) * 1000000 + time_offset.tv_usec -tt.tv_usec; /* * output interpreted DCF77 data */ PRINTF(offsets ? "%s, %2ld:%02ld:%02d, %ld.%02ld.%02ld, <%s%s%s%s> (%c%ld.%06lds)" : "%s, %2ld:%02ld:%02d, %ld.%02ld.%02ld, <%s%s%s%s>", 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_ANNOUNCE) ? "A" : "_", (clock_time.flags & DCFB_DST) ? "D" : "_", (clock_time.flags & DCFB_LEAP) ? "L" : "_", (lasterror < 0) ? '-' : '+', l_abs(lasterror) / 1000000, l_abs(lasterror) % 1000000 ); if (trace && (i == 0)) { PRINTF("\n"); errs++; } lasterror = usecerror / (i+1); } else { lasterror = 0; /* we cannot calculate phase errors on bad reception */ } PRINTF("\r"); if (i < 60) { i++; } tlast = tt; if (interactive) fflush(stdout); } } while ((rrc == -1) && (errno == EINTR)); /* * lost IO - sorry guys */ syslog(LOG_ERR, "TERMINATING - cannot read from device %s (%m)", file); (void)close(fd); } closelog(); return 0; } /* * History: * * dcfd.c,v * Revision 4.18 2005/10/07 22:08:18 kardel * make dcfd.c compile on NetBSD 3.99.9 again (configure/sigvec compatibility fix) * * Revision 4.17.2.1 2005/10/03 19:15:16 kardel * work around configure not detecting a missing sigvec compatibility * interface on NetBSD 3.99.9 and above * * Revision 4.17 2005/08/10 10:09:44 kardel * output revision information * * Revision 4.16 2005/08/10 06:33:25 kardel * cleanup warnings * * Revision 4.15 2005/08/10 06:28:45 kardel * fix setting of baud rate * * Revision 4.14 2005/04/16 17:32:10 kardel * update copyright * * Revision 4.13 2004/11/14 15:29:41 kardel * support PPSAPI, upgrade Copyright to Berkeley style * */ ntp-4.2.6p5/CommitLog0000644000175000017500000720713611675461336013462 0ustar peterpeterChangeSet@1.2349, 2011-12-24 18:34:58-05:00, stenn@deacon.udel.edu NTP_4_2_6P5 TAG: NTP_4_2_6P5 ChangeLog@1.753 +1 -0 NTP_4_2_6P5 ntpd/ntpd-opts.c@1.291 +5 -5 NTP_4_2_6P5 ntpd/ntpd-opts.h@1.291 +3 -3 NTP_4_2_6P5 ntpd/ntpd-opts.texi@1.288 +2 -2 NTP_4_2_6P5 ntpd/ntpd.1@1.288 +2 -2 NTP_4_2_6P5 ntpdc/ntpdc-opts.c@1.287 +5 -5 NTP_4_2_6P5 ntpdc/ntpdc-opts.h@1.287 +3 -3 NTP_4_2_6P5 ntpdc/ntpdc-opts.texi@1.285 +2 -2 NTP_4_2_6P5 ntpdc/ntpdc.1@1.285 +2 -2 NTP_4_2_6P5 ntpq/ntpq-opts.c@1.288 +5 -5 NTP_4_2_6P5 ntpq/ntpq-opts.h@1.288 +3 -3 NTP_4_2_6P5 ntpq/ntpq-opts.texi@1.286 +2 -2 NTP_4_2_6P5 ntpq/ntpq.1@1.286 +2 -2 NTP_4_2_6P5 ntpsnmpd/ntpsnmpd-opts.c@1.167 +5 -5 NTP_4_2_6P5 ntpsnmpd/ntpsnmpd-opts.h@1.167 +3 -3 NTP_4_2_6P5 ntpsnmpd/ntpsnmpd-opts.texi@1.166 +2 -2 NTP_4_2_6P5 ntpsnmpd/ntpsnmpd.1@1.165 +2 -2 NTP_4_2_6P5 packageinfo.sh@1.306 +2 -2 NTP_4_2_6P5 sntp/sntp-opts.c@1.159 +5 -5 NTP_4_2_6P5 sntp/sntp-opts.h@1.159 +3 -3 NTP_4_2_6P5 sntp/sntp-opts.texi@1.158 +2 -2 NTP_4_2_6P5 sntp/sntp.1@1.158 +2 -2 NTP_4_2_6P5 sntp/sntp.html@1.49 +2 -2 NTP_4_2_6P5 util/ntp-keygen-opts.c@1.290 +5 -5 NTP_4_2_6P5 util/ntp-keygen-opts.h@1.290 +3 -3 NTP_4_2_6P5 util/ntp-keygen-opts.texi@1.288 +2 -2 NTP_4_2_6P5 util/ntp-keygen.1@1.288 +2 -2 NTP_4_2_6P5 ChangeSet@1.2348, 2011-12-24 18:21:54-05:00, stenn@deacon.udel.edu ntp-4.2.6p5 packageinfo.sh@1.305 +3 -2 ntp-4.2.6p5 ChangeSet@1.2347, 2011-12-24 18:08:51-05:00, stenn@deacon.udel.edu fix typos NEWS@1.127 +8 -8 fix typos ChangeSet@1.2346, 2011-12-24 17:47:02-05:00, stenn@deacon.udel.edu NEWS cleanup NEWS@1.126 +25 -21 NEWS cleanup ChangeSet@1.2345, 2011-12-23 22:48:14-05:00, stenn@deacon.udel.edu NEWS file cleanup ChangeLog@1.752 +3 -0 NEWS file cleanup NEWS@1.125 +6 -8 NEWS file cleanup ChangeSet@1.2344, 2011-12-08 21:09:05-05:00, stenn@deacon.udel.edu NTP_4_2_6P5_RC3 TAG: NTP_4_2_6P5_RC3 ChangeLog@1.751 +1 -0 NTP_4_2_6P5_RC3 ntpd/ntpd-opts.c@1.290 +3 -3 NTP_4_2_6P5_RC3 ntpd/ntpd-opts.h@1.290 +3 -3 NTP_4_2_6P5_RC3 ntpd/ntpd-opts.texi@1.287 +2 -2 NTP_4_2_6P5_RC3 ntpd/ntpd.1@1.287 +2 -2 NTP_4_2_6P5_RC3 ntpdc/ntpdc-opts.c@1.286 +3 -3 NTP_4_2_6P5_RC3 ntpdc/ntpdc-opts.h@1.286 +3 -3 NTP_4_2_6P5_RC3 ntpdc/ntpdc-opts.texi@1.284 +2 -2 NTP_4_2_6P5_RC3 ntpdc/ntpdc.1@1.284 +2 -2 NTP_4_2_6P5_RC3 ntpq/ntpq-opts.c@1.287 +3 -3 NTP_4_2_6P5_RC3 ntpq/ntpq-opts.h@1.287 +3 -3 NTP_4_2_6P5_RC3 ntpq/ntpq-opts.texi@1.285 +2 -2 NTP_4_2_6P5_RC3 ntpq/ntpq.1@1.285 +2 -2 NTP_4_2_6P5_RC3 ntpsnmpd/ntpsnmpd-opts.c@1.166 +3 -3 NTP_4_2_6P5_RC3 ntpsnmpd/ntpsnmpd-opts.h@1.166 +3 -3 NTP_4_2_6P5_RC3 ntpsnmpd/ntpsnmpd-opts.texi@1.165 +2 -2 NTP_4_2_6P5_RC3 ntpsnmpd/ntpsnmpd.1@1.164 +2 -2 NTP_4_2_6P5_RC3 packageinfo.sh@1.304 +1 -1 NTP_4_2_6P5_RC3 sntp/sntp-opts.c@1.158 +3 -3 NTP_4_2_6P5_RC3 sntp/sntp-opts.h@1.158 +3 -3 NTP_4_2_6P5_RC3 sntp/sntp-opts.texi@1.157 +2 -2 NTP_4_2_6P5_RC3 sntp/sntp.1@1.157 +2 -2 NTP_4_2_6P5_RC3 sntp/sntp.html@1.48 +2 -2 NTP_4_2_6P5_RC3 util/ntp-keygen-opts.c@1.289 +3 -3 NTP_4_2_6P5_RC3 util/ntp-keygen-opts.h@1.289 +3 -3 NTP_4_2_6P5_RC3 util/ntp-keygen-opts.texi@1.287 +2 -2 NTP_4_2_6P5_RC3 util/ntp-keygen.1@1.287 +2 -2 NTP_4_2_6P5_RC3 ChangeSet@1.2343, 2011-12-08 00:21:36-05:00, stenn@deacon.udel.edu Update NEWS for RC3 NEWS@1.124 +6 -1 Update NEWS for RC3 ChangeSet@1.2342, 2011-12-07 22:28:13+00:00, davehart@shiny.ad.hartbrothers.com [Bug 2087] sys_jitter calculation overweights sys.peer jitter. ChangeLog@1.750 +1 -0 [Bug 2087] sys_jitter calculation overweights sys.peer jitter. ntpd/ntp_proto.c@1.307 +2 -2 [Bug 2087] sys_jitter calculation overweights sys.peer jitter. ChangeSet@1.2341, 2011-12-07 22:24:26+00:00, davehart@shiny.ad.hartbrothers.com [Bug 2086] get_systime() should not offset by sys_residual. ChangeLog@1.749 +1 -0 [Bug 2086] get_systime() should not offset by sys_residual. libntp/systime.c@1.49 +2 -2 [Bug 2086] get_systime() should not offset by sys_residual. ChangeSet@1.2340, 2011-12-07 22:21:41+00:00, davehart@shiny.ad.hartbrothers.com [Bug 2085] clock_update() sys_rootdisp calculation omits root delay. ChangeLog@1.748 +1 -0 [Bug 2085] clock_update() sys_rootdisp calculation omits root delay. ntpd/ntp_proto.c@1.306 +2 -1 [Bug 2085] clock_update() sys_rootdisp calculation omits root delay. ChangeSet@1.2339, 2011-12-05 17:07:40+00:00, davehart@shiny.ad.hartbrothers.com [Bug 2082] 3-char refid sent by ntpd 4.2.6p5-RC2 ends with extra dot. Ensure NULL peer->dstadr is not accessed in orphan parent selection. ChangeLog@1.747 +5 -0 [Bug 2082] 3-char refid sent by ntpd 4.2.6p5-RC2 ends with extra dot. Ensure NULL peer->dstadr is not accessed in orphan parent selection. ntpd/ntp_control.c@1.137 +2 -1 [Bug 2082] 3-char refid sent by ntpd 4.2.6p5-RC2 ends with extra dot. ntpd/ntp_proto.c@1.305 +4 -1 Ensure NULL peer->dstadr is not accessed in orphan parent selection. ChangeSet@1.2338, 2011-11-30 22:06:41-05:00, stenn@deacon.udel.edu NTP_4_2_6P5_RC2 TAG: NTP_4_2_6P5_RC2 ChangeLog@1.746 +1 -0 NTP_4_2_6P5_RC2 ntpd/ntpd-opts.c@1.289 +3 -3 NTP_4_2_6P5_RC2 ntpd/ntpd-opts.h@1.289 +3 -3 NTP_4_2_6P5_RC2 ntpd/ntpd-opts.texi@1.286 +2 -2 NTP_4_2_6P5_RC2 ntpd/ntpd.1@1.286 +2 -2 NTP_4_2_6P5_RC2 ntpdc/ntpdc-opts.c@1.285 +3 -3 NTP_4_2_6P5_RC2 ntpdc/ntpdc-opts.h@1.285 +3 -3 NTP_4_2_6P5_RC2 ntpdc/ntpdc-opts.texi@1.283 +2 -2 NTP_4_2_6P5_RC2 ntpdc/ntpdc.1@1.283 +2 -2 NTP_4_2_6P5_RC2 ntpq/ntpq-opts.c@1.286 +3 -3 NTP_4_2_6P5_RC2 ntpq/ntpq-opts.h@1.286 +3 -3 NTP_4_2_6P5_RC2 ntpq/ntpq-opts.texi@1.284 +2 -2 NTP_4_2_6P5_RC2 ntpq/ntpq.1@1.284 +2 -2 NTP_4_2_6P5_RC2 ntpsnmpd/ntpsnmpd-opts.c@1.165 +3 -3 NTP_4_2_6P5_RC2 ntpsnmpd/ntpsnmpd-opts.h@1.165 +3 -3 NTP_4_2_6P5_RC2 ntpsnmpd/ntpsnmpd-opts.texi@1.164 +2 -2 NTP_4_2_6P5_RC2 ntpsnmpd/ntpsnmpd.1@1.163 +2 -2 NTP_4_2_6P5_RC2 packageinfo.sh@1.303 +1 -1 NTP_4_2_6P5_RC2 sntp/sntp-opts.c@1.157 +3 -3 NTP_4_2_6P5_RC2 sntp/sntp-opts.h@1.157 +3 -3 NTP_4_2_6P5_RC2 sntp/sntp-opts.texi@1.156 +2 -2 NTP_4_2_6P5_RC2 sntp/sntp.1@1.156 +2 -2 NTP_4_2_6P5_RC2 sntp/sntp.html@1.47 +2 -2 NTP_4_2_6P5_RC2 util/ntp-keygen-opts.c@1.288 +3 -3 NTP_4_2_6P5_RC2 util/ntp-keygen-opts.h@1.288 +3 -3 NTP_4_2_6P5_RC2 util/ntp-keygen-opts.texi@1.286 +2 -2 NTP_4_2_6P5_RC2 util/ntp-keygen.1@1.286 +2 -2 NTP_4_2_6P5_RC2 ChangeSet@1.2337, 2011-11-30 21:49:45-05:00, stenn@pogo.udel.edu update NEWS@1.123 +20 -5 update ChangeSet@1.2336, 2011-11-29 13:35:16+00:00, davehart@shiny.ad.hartbrothers.com merge cleanup ChangeLog@1.745 +0 -1 merge cleanup ChangeSet@1.2330.1.2, 2011-11-29 13:33:26+00:00, davehart@shiny.ad.hartbrothers.com Never send KoD rate limiting response to MODE_SERVER response. ChangeLog@1.740.1.2 +3 -1 Never send KoD rate limiting response to MODE_SERVER response. ntpd/ntp_crypto.c@1.147 +1 -1 Use () to enforce intended precendence of & and && operators ntpd/ntp_proto.c@1.300.1.2 +3 -3 Never send KoD rate limiting response to MODE_SERVER response. ChangeSet@1.2331.1.2, 2011-11-27 00:39:11+00:00, davehart@shiny.ad.hartbrothers.com [Bug 2072] Orphan parent selection metric needs ntohl(). ChangeLog@1.741.1.1 +1 -0 [Bug 2072] Orphan parent selection metric needs ntohl(). libntp/a_md5encrypt.c@1.28 +1 -0 [Bug 2072] Orphan parent selection metric needs ntohl(). ntpd/ntp_proto.c@1.301.1.1 +3 -3 [Bug 2072] Orphan parent selection metric needs ntohl(). ChangeSet@1.2331.1.1, 2011-11-26 19:43:12+00:00, davehart@shiny.ad.hartbrothers.com Avoid redefinition warnings for INT32_MIN, INT32_MAX, U_INT32_MAX. include/ntp_types.h@1.17 +18 -6 Avoid redefinition warnings for INT32_MIN, INT32_MAX, U_INT32_MAX. ChangeSet@1.2330.1.1, 2011-11-25 10:23:58+00:00, davehart@shiny.ad.hartbrothers.com [Bug 2059] optional billboard column "server" does not honor -n. [Bug 2066] ntpq lopeers ipv6 "local" column overrun. [Bug 2068] ntpd sends nonprintable stratum 16 refid to ntpq. [Bug 2069] broadcastclient, multicastclient spin up duplicate ephemeral associations without broadcastdelay. Exclude not-yet-determined sys_refid from use in loopback TEST12 (from David Mills). ChangeLog@1.740.1.1 +9 -0 [Bug 2059] optional billboard column "server" does not honor -n. [Bug 2066] ntpq lopeers ipv6 "local" column overrun. [Bug 2068] ntpd sends nonprintable stratum 16 refid to ntpq. [Bug 2069] broadcastclient, multicastclient spin up duplicate ephemeral associations without broadcastdelay. Exclude not-yet-determined sys_refid from use in loopback TEST12 (from David Mills). include/ntp.h@1.175 +1 -0 Add peer flag FLAG_BC_VOL indicating the broadcastclient delay calibration is still in progress. include/ntp_refclock.h@1.26 +1 -1 [Bug 2068] ntpd sends nonprintable stratum 16 refid to ntpq. include/ntp_request.h@1.41 +2 -2 [Bug 2068] ntpd sends nonprintable stratum 16 refid to ntpq. include/ntpd.h@1.144 +3 -1 [Bug 2069] broadcastclient, multicastclient spin up duplicate ephemeral associations without broadcastdelay. backport latoa() -> localaddrtoa(endpt *) from 4.2.7 ntpd/ntp_config.c@1.251 +1 -1 [Bug 2069] broadcastclient, multicastclient spin up duplicate ephemeral associations without broadcastdelay. ntpd/ntp_control.c@1.136 +50 -37 [Bug 2068] ntpd sends nonprintable stratum 16 refid to ntpq. ntpd/ntp_io.c@1.323 +11 -0 backport latoa() -> localaddrtoa(endpt *) from 4.2.7 ntpd/ntp_peer.c@1.130 +40 -21 [Bug 2069] broadcastclient, multicastclient spin up duplicate ephemeral associations without broadcastdelay. ntpd/ntp_proto.c@1.300.1.1 +53 -14 [Bug 2069] broadcastclient, multicastclient spin up duplicate ephemeral associations without broadcastdelay. Exclude not-yet-determined sys_refid from use in loopback TEST12 (from David Mills). ntpd/ntp_refclock.c@1.95 +2 -2 [Bug 2069] broadcastclient, multicastclient spin up duplicate ephemeral associations without broadcastdelay. ntpd/ntp_request.c@1.88 +13 -11 [Bug 2069] broadcastclient, multicastclient spin up duplicate ephemeral associations without broadcastdelay. ntpq/ntpq-subs.c@1.47 +42 -22 [Bug 2059] optional billboard column "server" does not honor -n. [Bug 2066] ntpq lopeers ipv6 "local" column overrun. ntpq/ntpq.c@1.107 +94 -9 [Bug 2059] optional billboard column "server" does not honor -n. ntpq/ntpq.h@1.15 +4 -0 [Bug 2059] optional billboard column "server" does not honor -n. [Bug 2066] ntpq lopeers ipv6 "local" column overrun. ChangeSet@1.2331, 2011-11-21 09:35:28+00:00, davehart@shiny.ad.hartbrothers.com [Bug 2050] Orphan mode stratum counting to infinity. ChangeLog@1.741 +4 -0 [Bug 2050] Orphan mode stratum counting to infinity. include/ntp_types.h@1.16 +6 -0 [Bug 2050] Orphan mode stratum counting to infinity. ntpd/ntp_proto.c@1.301 +31 -8 [Bug 2050] Orphan mode stratum counting to infinity. ntpd/ntp_timer.c@1.57 +2 -2 [Bug 2050] Orphan mode stratum counting to infinity. ChangeSet@1.2330, 2011-10-18 23:14:54+00:00, stenn@deacon.udel.edu NTP_4_2_6P5_RC1 TAG: NTP_4_2_6P5_RC1 ChangeLog@1.740 +1 -0 NTP_4_2_6P5_RC1 ntpd/ntpd-opts.c@1.288 +5 -5 NTP_4_2_6P5_RC1 ntpd/ntpd-opts.h@1.288 +3 -3 NTP_4_2_6P5_RC1 ntpd/ntpd-opts.texi@1.285 +2 -2 NTP_4_2_6P5_RC1 ntpd/ntpd.1@1.285 +2 -2 NTP_4_2_6P5_RC1 ntpdc/ntpdc-opts.c@1.284 +5 -5 NTP_4_2_6P5_RC1 ntpdc/ntpdc-opts.h@1.284 +3 -3 NTP_4_2_6P5_RC1 ntpdc/ntpdc-opts.texi@1.282 +2 -2 NTP_4_2_6P5_RC1 ntpdc/ntpdc.1@1.282 +2 -2 NTP_4_2_6P5_RC1 ntpq/ntpq-opts.c@1.285 +5 -5 NTP_4_2_6P5_RC1 ntpq/ntpq-opts.h@1.285 +3 -3 NTP_4_2_6P5_RC1 ntpq/ntpq-opts.texi@1.283 +2 -2 NTP_4_2_6P5_RC1 ntpq/ntpq.1@1.283 +2 -2 NTP_4_2_6P5_RC1 ntpsnmpd/ntpsnmpd-opts.c@1.164 +5 -5 NTP_4_2_6P5_RC1 ntpsnmpd/ntpsnmpd-opts.h@1.164 +3 -3 NTP_4_2_6P5_RC1 ntpsnmpd/ntpsnmpd-opts.texi@1.163 +2 -2 NTP_4_2_6P5_RC1 ntpsnmpd/ntpsnmpd.1@1.162 +2 -2 NTP_4_2_6P5_RC1 packageinfo.sh@1.302 +2 -2 NTP_4_2_6P5_RC1 sntp/sntp-opts.c@1.156 +5 -5 NTP_4_2_6P5_RC1 sntp/sntp-opts.h@1.156 +3 -3 NTP_4_2_6P5_RC1 sntp/sntp-opts.texi@1.155 +2 -2 NTP_4_2_6P5_RC1 sntp/sntp.1@1.155 +2 -2 NTP_4_2_6P5_RC1 sntp/sntp.html@1.46 +2 -2 NTP_4_2_6P5_RC1 util/ntp-keygen-opts.c@1.287 +5 -5 NTP_4_2_6P5_RC1 util/ntp-keygen-opts.h@1.287 +3 -3 NTP_4_2_6P5_RC1 util/ntp-keygen-opts.texi@1.285 +2 -2 NTP_4_2_6P5_RC1 util/ntp-keygen.1@1.285 +2 -2 NTP_4_2_6P5_RC1 ChangeSet@1.2329, 2011-10-18 14:31:10-04:00, stenn@deacon.udel.edu ntp-4.2.6p5-RC1 packageinfo.sh@1.301 +1 -1 ntp-4.2.6p5-RC1 ChangeSet@1.2328, 2011-10-18 14:27:46-04:00, stenn@deacon.udel.edu update NEWS file NEWS@1.122 +5 -5 update ChangeSet@1.2327, 2011-10-18 02:35:21+00:00, davehart@shiny.ad.hartbrothers.com Generalize [Bug 2034] summary, correct NEWS description of same. ChangeLog@1.739 +1 -1 Generalize [Bug 2034] summary, correct NEWS description of same. NEWS@1.121 +7 -4 Generalize [Bug 2034] summary, correct NEWS description of same. ChangeSet@1.2326, 2011-10-17 20:43:13-04:00, stenn@deacon.udel.edu Update NEWS file for 4.2.6p5 NEWS@1.120 +15 -0 Update NEWS file for 4.2.6p5 ChangeSet@1.2325, 2011-10-17 20:14:44+00:00, davehart@shiny.ad.hartbrothers.com [Bug 2034] interface ignore fe80::/64 mismatches ::, ::1... ChangeLog@1.738 +4 -1 [Bug 2034] interface ignore fe80::/64 mismatches ::, ::1... ntpd/ntp_io.c@1.322 +7 -4 [Bug 2034] interface ignore fe80::/64 mismatches ::, ::1... ChangeSet@1.2324, 2011-09-23 03:38:30+00:00, stenn@deacon.udel.edu NTP_4_2_6P4 TAG: NTP_4_2_6P4 ChangeLog@1.737 +1 -0 NTP_4_2_6P4 ntpd/ntpd-opts.c@1.287 +5 -5 NTP_4_2_6P4 ntpd/ntpd-opts.h@1.287 +3 -3 NTP_4_2_6P4 ntpd/ntpd-opts.texi@1.284 +2 -2 NTP_4_2_6P4 ntpd/ntpd.1@1.284 +2 -2 NTP_4_2_6P4 ntpdc/ntpdc-opts.c@1.283 +5 -5 NTP_4_2_6P4 ntpdc/ntpdc-opts.h@1.283 +3 -3 NTP_4_2_6P4 ntpdc/ntpdc-opts.texi@1.281 +2 -2 NTP_4_2_6P4 ntpdc/ntpdc.1@1.281 +2 -2 NTP_4_2_6P4 ntpq/ntpq-opts.c@1.284 +5 -5 NTP_4_2_6P4 ntpq/ntpq-opts.h@1.284 +3 -3 NTP_4_2_6P4 ntpq/ntpq-opts.texi@1.282 +2 -2 NTP_4_2_6P4 ntpq/ntpq.1@1.282 +2 -2 NTP_4_2_6P4 ntpsnmpd/ntpsnmpd-opts.c@1.163 +5 -5 NTP_4_2_6P4 ntpsnmpd/ntpsnmpd-opts.h@1.163 +3 -3 NTP_4_2_6P4 ntpsnmpd/ntpsnmpd-opts.texi@1.162 +2 -2 NTP_4_2_6P4 ntpsnmpd/ntpsnmpd.1@1.161 +2 -2 NTP_4_2_6P4 packageinfo.sh@1.300 +3 -3 NTP_4_2_6P4 sntp/sntp-opts.c@1.155 +7 -7 NTP_4_2_6P4 sntp/sntp-opts.h@1.155 +3 -3 NTP_4_2_6P4 sntp/sntp-opts.texi@1.154 +4 -4 NTP_4_2_6P4 sntp/sntp.1@1.154 +2 -2 NTP_4_2_6P4 sntp/sntp.html@1.45 +42 -60 NTP_4_2_6P4 util/ntp-keygen-opts.c@1.286 +5 -5 NTP_4_2_6P4 util/ntp-keygen-opts.h@1.286 +3 -3 NTP_4_2_6P4 util/ntp-keygen-opts.texi@1.284 +2 -2 NTP_4_2_6P4 util/ntp-keygen.1@1.284 +2 -2 NTP_4_2_6P4 ChangeSet@1.2323, 2011-09-22 22:40:12-04:00, stenn@deacon.udel.edu ntp-4.2.6p4 ChangeLog@1.736 +1 -0 ntp-4.2.6p4 NEWS@1.119 +62 -37 ntp-4.2.6p4 packageinfo.sh@1.299 +1 -1 ntp-4.2.6p4 ChangeSet@1.2322, 2011-09-07 04:29:25+00:00, davehart@shiny.ad.hartbrothers.com [Bug 2003] libntpq ntpq_read_assoc_peervars() broken. ChangeLog@1.735 +1 -0 [Bug 2003] libntpq ntpq_read_assoc_peervars() broken. ntpq/libntpq.c@1.9 +56 -66 [Bug 2003] libntpq ntpq_read_assoc_peervars() broken. ntpq/libntpq.h@1.7 +1 -1 [Bug 2003] libntpq ntpq_read_assoc_peervars() broken. ChangeSet@1.2321, 2011-08-27 03:34:10+00:00, davehart@shiny.ad.hartbrothers.com [Bug 2001] ntpdc timerstats reports overruns as handled. ChangeLog@1.734 +1 -0 [Bug 2001] ntpdc timerstats reports overruns as handled. ntpd/ntp_request.c@1.87 +11 -16 [Bug 2001] ntpdc timerstats reports overruns as handled. ChangeSet@1.2320, 2011-08-09 04:27:25+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1985] "logconfig =allall" rejected. ChangeLog@1.733 +1 -0 [Bug 1985] "logconfig =allall" rejected. include/ntp_syslog.h@1.5 +7 -5 convert spaces to tabs, change ntp_syslogmask type from u_long to u_int32. include/ntpd.h@1.143 +1 -2 #include ntp.h before ntp_syslog.h libntp/machines.c@1.22 +1 -0 #include ntp.h before ntp_syslog.h libntp/msyslog.c@1.29 +1 -1 [Bug 1985] "logconfig =allall" rejected. ntpd/complete.conf@1.5 +1 -1 [Bug 1985] "logconfig =allall" rejected. ntpd/ntp_config.c@1.250 +53 -40 [Bug 1985] "logconfig =allall" rejected. ChangeSet@1.2319, 2011-08-08 18:13:07+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion). ChangeLog@1.732 +1 -0 [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion). configure.ac@1.495 +7 -0 [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion). sntp/configure.ac@1.41 +7 -0 [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion). ChangeSet@1.2318, 2011-08-04 15:45:08-04:00, stenn@psp-deb1.ntp.org [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd sntp/sntp-opts.c@1.154 +19 -19 [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd sntp/sntp-opts.h@1.154 +7 -7 [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd sntp/sntp-opts.texi@1.153 +30 -29 [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd sntp/sntp.1@1.153 +8 -8 [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd sntp/sntp.html@1.44 +96 -77 [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd ChangeSet@1.2317, 2011-08-04 15:39:31-04:00, stenn@psp-deb1.ntp.org [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd ChangeLog@1.731 +2 -0 [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd sntp/main.c@1.34 +2 -2 [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd sntp/sntp-opts.def@1.20 +9 -14 [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd ChangeSet@1.2316, 2011-08-04 15:17:36-04:00, stenn@psp-deb1.ntp.org libopts/file.c fix from Bruce Korb (arg-type=file) ChangeLog@1.730 +4 -0 libopts/file.c fix from Bruce Korb (arg-type=file) sntp/libopts/file.c@1.8 +4 -2 libopts/file.c fix from Bruce Korb (arg-type=file) ChangeSet@1.2315, 2011-08-04 04:50:12+00:00, stenn@deacon.udel.edu NTP_4_2_6P4_RC2 TAG: NTP_4_2_6P4_RC2 ChangeLog@1.729 +1 -0 NTP_4_2_6P4_RC2 ntpd/ntpd-opts.c@1.286 +3 -3 NTP_4_2_6P4_RC2 ntpd/ntpd-opts.h@1.286 +3 -3 NTP_4_2_6P4_RC2 ntpd/ntpd-opts.texi@1.283 +2 -2 NTP_4_2_6P4_RC2 ntpd/ntpd.1@1.283 +2 -2 NTP_4_2_6P4_RC2 ntpdc/ntpdc-opts.c@1.282 +3 -3 NTP_4_2_6P4_RC2 ntpdc/ntpdc-opts.h@1.282 +3 -3 NTP_4_2_6P4_RC2 ntpdc/ntpdc-opts.texi@1.280 +2 -2 NTP_4_2_6P4_RC2 ntpdc/ntpdc.1@1.280 +2 -2 NTP_4_2_6P4_RC2 ntpq/ntpq-opts.c@1.283 +3 -3 NTP_4_2_6P4_RC2 ntpq/ntpq-opts.h@1.283 +3 -3 NTP_4_2_6P4_RC2 ntpq/ntpq-opts.texi@1.281 +2 -2 NTP_4_2_6P4_RC2 ntpq/ntpq.1@1.281 +2 -2 NTP_4_2_6P4_RC2 ntpsnmpd/ntpsnmpd-opts.c@1.162 +3 -3 NTP_4_2_6P4_RC2 ntpsnmpd/ntpsnmpd-opts.h@1.162 +3 -3 NTP_4_2_6P4_RC2 ntpsnmpd/ntpsnmpd-opts.texi@1.161 +2 -2 NTP_4_2_6P4_RC2 ntpsnmpd/ntpsnmpd.1@1.160 +2 -2 NTP_4_2_6P4_RC2 packageinfo.sh@1.298 +1 -1 NTP_4_2_6P4_RC2 sntp/sntp-opts.c@1.153 +3 -3 NTP_4_2_6P4_RC2 sntp/sntp-opts.h@1.153 +3 -3 NTP_4_2_6P4_RC2 sntp/sntp-opts.texi@1.152 +2 -2 NTP_4_2_6P4_RC2 sntp/sntp.1@1.152 +2 -2 NTP_4_2_6P4_RC2 sntp/sntp.html@1.43 +2 -2 NTP_4_2_6P4_RC2 util/ntp-keygen-opts.c@1.285 +3 -3 NTP_4_2_6P4_RC2 util/ntp-keygen-opts.h@1.285 +3 -3 NTP_4_2_6P4_RC2 util/ntp-keygen-opts.texi@1.283 +2 -2 NTP_4_2_6P4_RC2 util/ntp-keygen.1@1.283 +2 -2 NTP_4_2_6P4_RC2 ChangeSet@1.2314, 2011-07-28 02:59:20-04:00, stenn@deacon.udel.edu Backport if_nametoindex() check for hpux ChangeLog@1.728 +1 -0 Backport if_nametoindex() check for hpux configure.ac@1.494 +4 -10 Backport if_nametoindex() check for hpux ChangeSet@1.2313, 2011-07-27 22:22:03+00:00, davehart@shiny.ad.hartbrothers.com Correct [Bug 1978] description in ChangeLog. ChangeLog@1.727 +1 -1 [Bug 1978] [Bug 1134] fix in 4.2.6p4-RC1 doesn't build on older Linux. ChangeSet@1.2312, 2011-07-27 21:41:02+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1978] Ignore tentative IP addresses on Linux. Backport several fixes for Coverity warnings from ntp-dev. ChangeLog@1.726 +2 -0 [Bug 1978] Ignore tentative IP addresses on Linux. Backport several fixes for Coverity warnings from ntp-dev. configure.ac@1.493 +9 -0 [Bug 1978] Ignore tentative IP addresses on Linux. include/ntp_rfc2553.h@1.34 +10 -2 Backport several fixes for Coverity warnings from ntp-dev. lib/isc/unix/interfaceiter.c@1.21 +5 -3 [Bug 1978] Ignore tentative IP addresses on Linux. libntp/audio.c@1.28 +29 -29 Backport several fixes for Coverity warnings from ntp-dev. libntp/decodenetnum.c@1.11 +43 -10 Backport several fixes for Coverity warnings from ntp-dev. libntp/icom.c@1.12 +34 -10 Backport several fixes for Coverity warnings from ntp-dev. ntpd/refclock_arc.c@1.23 +37 -34 Backport several fixes for Coverity warnings from ntp-dev. ntpdc/ntpdc.c@1.80 +25 -17 Backport several fixes for Coverity warnings from ntp-dev. ntpq/ntpq.c@1.106 +25 -17 Backport several fixes for Coverity warnings from ntp-dev. ChangeSet@1.2311, 2011-07-26 11:21:46+02:00, karlsson@beam.lund.zozs.se [Bug 1975] libntp/mktime.c won't work with 64-bit time_t ChangeLog@1.725 +1 -0 [Bug 1975] libntp/mktime.c won't work with 64-bit time_t libntp/mktime.c@1.10 +4 -0 [Bug 1975] libntp/mktime.c won't work with 64-bit time_t ChangeSet@1.2310, 2011-07-25 14:10:27+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1972] checking for struct rtattr fails. ChangeLog@1.724 +1 -0 [Bug 1972] checking for struct rtattr fails. configure.ac@1.492 +6 -5 [Bug 1972] checking for struct rtattr fails. ChangeSet@1.2309, 2011-07-25 00:09:06-04:00, stenn@deacon.udel.edu [Bug 1608] Parse Refclock driver should honor trusttime ChangeLog@1.723 +2 -1 [Bug 1608] Parse Refclock driver should honor trusttime html/drivers/driver8.html@1.26 +9 -0 [Bug 1608] Parse Refclock driver should honor trusttime ntpd/refclock_parse.c@1.54 +62 -13 [Bug 1608] Parse Refclock driver should honor trusttime ChangeSet@1.2308, 2011-07-20 19:37:50+00:00, davehart@shiny.ad.hartbrothers.com Backport latest ntp_lists.h from ntp-dev, remove redundant () in UNLINK_EXPR_SLIST(). include/ntp_lists.h@1.4 +213 -28 Backport latest ntp_lists.h from ntp-dev, remove redundant () in UNLINK_EXPR_SLIST(). ChangeSet@1.2307, 2011-07-20 13:06:51+02:00, karlsson@beam.lund.zozs.se [BUG 1970] UNLINK_EXPR_SLIST() causes crash if list is empty. ChangeLog@1.722 +1 -0 [BUG 1970] UNLINK_EXPR_SLIST() causes crash if list is empty. include/ntp_lists.h@1.3 +4 -3 [BUG 1970] UNLINK_EXPR_SLIST() causes crash if list is empty. ChangeSet@1.2306, 2011-07-12 21:46:20-04:00, stenn@psp-deb1.ntp.org [Bug 1961] html2man update: distribute ntp-wait.html ChangeLog@1.721 +4 -0 [Bug 1961] html2man update: distribute ntp-wait.html html/ntp-wait.html@1.1 +30 -0 BitKeeper file /home/stenn/ntp-stable/html/ntp-wait.html html/ntp-wait.html@1.0 +0 -0 ChangeSet@1.2305, 2011-07-10 23:03:48-04:00, stenn@deacon.udel.edu NTP_4_2_6P4_RC1 TAG: NTP_4_2_6P4_RC1 ChangeLog@1.720 +1 -0 NTP_4_2_6P4_RC1 ntpd/ntpd-opts.c@1.285 +7 -9 NTP_4_2_6P4_RC1 ntpd/ntpd-opts.h@1.285 +9 -11 NTP_4_2_6P4_RC1 ntpd/ntpd-opts.texi@1.282 +3 -3 NTP_4_2_6P4_RC1 ntpd/ntpd.1@1.282 +2 -2 NTP_4_2_6P4_RC1 ntpdc/ntpdc-opts.c@1.281 +7 -9 NTP_4_2_6P4_RC1 ntpdc/ntpdc-opts.h@1.281 +9 -11 NTP_4_2_6P4_RC1 ntpdc/ntpdc-opts.texi@1.279 +3 -3 NTP_4_2_6P4_RC1 ntpdc/ntpdc.1@1.279 +2 -2 NTP_4_2_6P4_RC1 ntpq/ntpq-opts.c@1.282 +7 -9 NTP_4_2_6P4_RC1 ntpq/ntpq-opts.h@1.282 +9 -11 NTP_4_2_6P4_RC1 ntpq/ntpq-opts.texi@1.280 +3 -3 NTP_4_2_6P4_RC1 ntpq/ntpq.1@1.280 +2 -2 NTP_4_2_6P4_RC1 ntpsnmpd/ntpsnmpd-opts.c@1.161 +7 -9 NTP_4_2_6P4_RC1 ntpsnmpd/ntpsnmpd-opts.h@1.161 +9 -11 NTP_4_2_6P4_RC1 ntpsnmpd/ntpsnmpd-opts.texi@1.160 +3 -3 NTP_4_2_6P4_RC1 ntpsnmpd/ntpsnmpd.1@1.159 +2 -2 NTP_4_2_6P4_RC1 packageinfo.sh@1.297 +1 -1 NTP_4_2_6P4_RC1 sntp/sntp-opts.c@1.152 +7 -9 NTP_4_2_6P4_RC1 sntp/sntp-opts.h@1.152 +9 -11 NTP_4_2_6P4_RC1 sntp/sntp-opts.texi@1.151 +3 -3 NTP_4_2_6P4_RC1 sntp/sntp.1@1.151 +2 -2 NTP_4_2_6P4_RC1 sntp/sntp.html@1.42 +3 -3 NTP_4_2_6P4_RC1 util/ntp-keygen-opts.c@1.284 +7 -9 NTP_4_2_6P4_RC1 util/ntp-keygen-opts.h@1.284 +9 -11 NTP_4_2_6P4_RC1 util/ntp-keygen-opts.texi@1.282 +3 -3 NTP_4_2_6P4_RC1 util/ntp-keygen.1@1.282 +2 -2 NTP_4_2_6P4_RC1 ChangeSet@1.2304, 2011-07-10 22:14:53-04:00, stenn@deacon.udel.edu 4.2.6p4-RC1 packageinfo.sh@1.296 +1 -1 4.2.6p4-RC1 ChangeSet@1.2303, 2011-07-10 17:51:34-04:00, stenn@deacon.udel.edu Update the NEWS file ChangeLog@1.719 +1 -0 Update the NEWS file NEWS@1.118 +39 -0 Update the NEWS file ChangeSet@1.2302, 2011-07-10 08:02:44-04:00, stenn@psp-deb1.ntp.org [Bug 1961] html2man needs an update ChangeLog@1.718 +1 -0 [Bug 1961] html2man needs an update html/authopt.html@1.61 +1 -5 [Bug 1961] html2man needs an update html/keygen.html@1.20 +1 -0 [Bug 1961] html2man needs an update html/ntpd.html@1.52 +12 -4 [Bug 1961] html2man needs an update html/ntpdate.html@1.19 +6 -6 [Bug 1961] html2man needs an update html/ntpdc.html@1.31 +10 -8 [Bug 1961] html2man needs an update html/ntpq.html@1.38 +2 -2 [Bug 1961] html2man needs an update html/ntptrace.html@1.15 +2 -10 [Bug 1961] html2man needs an update html/tickadj.html@1.16 +3 -1 [Bug 1961] html2man needs an update scripts/html2man.in@1.6 +99 -37 [Bug 1961] html2man needs an update ChangeSet@1.2301, 2011-07-10 07:34:24-04:00, stenn@deacon.udel.edu [Bug 1790] Update config.guess and config.sub to detect AIX6 ChangeLog@1.717 +1 -0 [Bug 1790] Update config.guess and config.sub to detect AIX6 ChangeSet@1.2300, 2011-07-05 03:39:02-04:00, stenn@psp-deb1.ntp.org [Bug 1134] ntpd fails binding to tentative IPv6 addresses ChangeLog@1.716 +4 -0 [Bug 1134] ntpd fails binding to tentative IPv6 addresses lib/isc/unix/interfaceiter.c@1.20 +11 -0 [Bug 1134] ntpd fails binding to tentative IPv6 addresses ChangeSet@1.2299, 2011-05-25 05:27:31+00:00, stenn@deacon.udel.edu NTP_4_2_6P4_BETA2 TAG: NTP_4_2_6P4_BETA2 ChangeLog@1.715 +1 -0 NTP_4_2_6P4_BETA2 ntpd/ntpd-opts.c@1.284 +3 -3 NTP_4_2_6P4_BETA2 ntpd/ntpd-opts.h@1.284 +3 -3 NTP_4_2_6P4_BETA2 ntpd/ntpd-opts.texi@1.281 +2 -2 NTP_4_2_6P4_BETA2 ntpd/ntpd.1@1.281 +2 -2 NTP_4_2_6P4_BETA2 ntpdc/ntpdc-opts.c@1.280 +3 -3 NTP_4_2_6P4_BETA2 ntpdc/ntpdc-opts.h@1.280 +3 -3 NTP_4_2_6P4_BETA2 ntpdc/ntpdc-opts.texi@1.278 +2 -2 NTP_4_2_6P4_BETA2 ntpdc/ntpdc.1@1.278 +2 -2 NTP_4_2_6P4_BETA2 ntpq/ntpq-opts.c@1.281 +3 -3 NTP_4_2_6P4_BETA2 ntpq/ntpq-opts.h@1.281 +3 -3 NTP_4_2_6P4_BETA2 ntpq/ntpq-opts.texi@1.279 +2 -2 NTP_4_2_6P4_BETA2 ntpq/ntpq.1@1.279 +2 -2 NTP_4_2_6P4_BETA2 ntpsnmpd/ntpsnmpd-opts.c@1.160 +3 -3 NTP_4_2_6P4_BETA2 ntpsnmpd/ntpsnmpd-opts.h@1.160 +3 -3 NTP_4_2_6P4_BETA2 ntpsnmpd/ntpsnmpd-opts.texi@1.159 +2 -2 NTP_4_2_6P4_BETA2 ntpsnmpd/ntpsnmpd.1@1.158 +2 -2 NTP_4_2_6P4_BETA2 packageinfo.sh@1.295 +1 -1 NTP_4_2_6P4_BETA2 sntp/sntp-opts.c@1.151 +3 -3 NTP_4_2_6P4_BETA2 sntp/sntp-opts.h@1.151 +3 -3 NTP_4_2_6P4_BETA2 sntp/sntp-opts.texi@1.150 +2 -2 NTP_4_2_6P4_BETA2 sntp/sntp.1@1.150 +2 -2 NTP_4_2_6P4_BETA2 sntp/sntp.html@1.41 +2 -2 NTP_4_2_6P4_BETA2 util/ntp-keygen-opts.c@1.283 +3 -3 NTP_4_2_6P4_BETA2 util/ntp-keygen-opts.h@1.283 +3 -3 NTP_4_2_6P4_BETA2 util/ntp-keygen-opts.texi@1.281 +2 -2 NTP_4_2_6P4_BETA2 util/ntp-keygen.1@1.281 +2 -2 NTP_4_2_6P4_BETA2 ChangeSet@1.2298, 2011-05-25 03:44:32+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1695] ntpdate takes longer than necessary. [Bug 1832] ntpdate doesn't allow timeout > 2s. [Bug 1933] WWVB/Spectracom driver timestamps LFs, not CRs. Backport utility routines from ntp-dev: mprintf(), emalloc_zero(). ChangeLog@1.714 +7 -0 [Bug 1695] ntpdate takes longer than necessary. [Bug 1832] ntpdate doesn't allow timeout > 2s. [Bug 1933] WWVB/Spectracom driver timestamps LFs, not CRs. Backport utility routines from ntp-dev: mprintf(), emalloc_zero(). include/ntp_assert.h@1.4 +54 -17 Backport utility routines from ntp-dev: mprintf(), emalloc_zero(). include/ntp_malloc.h@1.4 +46 -4 Backport utility routines from ntp-dev: mprintf(), emalloc_zero(). include/ntp_refclock.h@1.25 +1 -1 Use void * instead of char * for pp->unitptr to ease backports from 4.2.7. include/ntp_stdlib.h@1.45 +37 -14 Backport utility routines from ntp-dev: mprintf(), emalloc_zero(). include/ntp_types.h@1.15 +7 -0 provide TRUE, FALSE definitions. libntp/emalloc.c@1.11 +53 -79 Backport utility routines from ntp-dev: mprintf(), emalloc_zero(). libntp/msyslog.c@1.28 +80 -7 Backport utility routines from ntp-dev: mprintf(), emalloc_zero(). libntp/strdup.c@1.6 +16 -14 include first, include to resolve incompatible implicit declaration warnings. ntpd/refclock_wwvb.c@1.25 +61 -23 [Bug 1933] WWVB/Spectracom driver timestamps LFs, not CRs. ntpdate/ntpdate.c@1.73 +50 -92 [Bug 1695] ntpdate takes longer than necessary. [Bug 1832] ntpdate doesn't allow timeout > 2s. ports/winnt/include/config.h@1.85 +2 -0 Backport utility routines from ntp-dev: mprintf(), emalloc_zero(). ChangeSet@1.2297, 2011-05-16 04:25:03+00:00, stenn@deacon.udel.edu NTP_4_2_6P4_BETA1 TAG: NTP_4_2_6P4_BETA1 ChangeLog@1.713 +1 -0 NTP_4_2_6P4_BETA1 ntpd/ntpd-opts.c@1.283 +43 -48 NTP_4_2_6P4_BETA1 ntpd/ntpd-opts.h@1.283 +12 -12 NTP_4_2_6P4_BETA1 ntpd/ntpd-opts.texi@1.280 +4 -4 NTP_4_2_6P4_BETA1 ntpd/ntpd.1@1.280 +3 -2 NTP_4_2_6P4_BETA1 ntpdc/ntpdc-opts.c@1.279 +43 -48 NTP_4_2_6P4_BETA1 ntpdc/ntpdc-opts.h@1.279 +12 -12 NTP_4_2_6P4_BETA1 ntpdc/ntpdc-opts.texi@1.277 +12 -19 NTP_4_2_6P4_BETA1 ntpdc/ntpdc.1@1.277 +3 -2 NTP_4_2_6P4_BETA1 ntpq/ntpq-opts.c@1.280 +43 -48 NTP_4_2_6P4_BETA1 ntpq/ntpq-opts.h@1.280 +12 -12 NTP_4_2_6P4_BETA1 ntpq/ntpq-opts.texi@1.278 +10 -12 NTP_4_2_6P4_BETA1 ntpq/ntpq.1@1.278 +3 -2 NTP_4_2_6P4_BETA1 ntpsnmpd/ntpsnmpd-opts.c@1.159 +43 -48 NTP_4_2_6P4_BETA1 ntpsnmpd/ntpsnmpd-opts.h@1.159 +12 -12 NTP_4_2_6P4_BETA1 ntpsnmpd/ntpsnmpd-opts.texi@1.158 +4 -4 NTP_4_2_6P4_BETA1 ntpsnmpd/ntpsnmpd.1@1.157 +3 -2 NTP_4_2_6P4_BETA1 packageinfo.sh@1.294 +3 -3 NTP_4_2_6P4_BETA1 sntp/sntp-opts.c@1.150 +43 -48 NTP_4_2_6P4_BETA1 sntp/sntp-opts.h@1.150 +12 -12 NTP_4_2_6P4_BETA1 sntp/sntp-opts.texi@1.149 +7 -7 NTP_4_2_6P4_BETA1 sntp/sntp.1@1.149 +3 -2 NTP_4_2_6P4_BETA1 sntp/sntp.html@1.40 +7 -7 NTP_4_2_6P4_BETA1 util/ntp-keygen-opts.c@1.282 +52 -75 NTP_4_2_6P4_BETA1 util/ntp-keygen-opts.h@1.282 +12 -12 NTP_4_2_6P4_BETA1 util/ntp-keygen-opts.texi@1.280 +8 -7 NTP_4_2_6P4_BETA1 util/ntp-keygen.1@1.280 +3 -2 NTP_4_2_6P4_BETA1 ChangeSet@1.2296, 2011-05-15 19:19:24+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1554] peer may stay selected as system peer after becoming unreachable. [Bug 1921] LOCAL, ACTS drivers with "prefer" excluded from initial candidate list. [Bug 1923] orphan parent favored over LOCAL, ACTS drivers. [Bug 1924] Billboard tally codes sometimes do not match operation, variables. Enable tickadj-like taming of wildly off-spec Windows clock using NTPD_TICKADJ_PPM env. var. specifying baseline slew. ChangeLog@1.712 +9 -0 [Bug 1554] peer may stay selected as system peer after becoming unreachable. [Bug 1921] LOCAL, ACTS drivers with "prefer" excluded from initial candidate list. [Bug 1923] orphan parent favored over LOCAL, ACTS drivers. [Bug 1924] Billboard tally codes sometimes do not match operation, variables. Enable tickadj-like taming of wildly off-spec Windows clock using NTPD_TICKADJ_PPM env. var. specifying baseline slew. include/ntp.h@1.174 +9 -9 [Bug 1924] Billboard tally codes sometimes do not match operation, variables. libntp/mktime.c@1.9 +2 -2 leading spaces -> tabs ntpd/ntp_loopfilter.c@1.154 +1 -1 Comment typo ntpd/ntp_proto.c@1.300 +37 -29 [Bug 1554] peer may stay selected as system peer after becoming unreachable. [Bug 1921] LOCAL, ACTS drivers with "prefer" excluded from initial candidate list. [Bug 1923] orphan parent favored over LOCAL, ACTS drivers. [Bug 1924] Billboard tally codes sometimes do not match operation, variables. ports/winnt/include/config.h@1.84 +2 -0 Use _mkgmtime() for timegm() in Windows ports, resolves crash at startup loading Autokey host certificate. ports/winnt/ntpd/nt_clockstuff.c@1.43 +23 -0 Enable tickadj-like taming of wildly off-spec Windows clock using NTPD_TICKADJ_PPM env. var. specifying baseline slew. ChangeSet@1.2295, 2011-05-11 04:40:35-04:00, stenn@deacon.udel.edu Upgrade to AutoGen 5.11.9 (and require it) ChangeLog@1.711 +1 -0 Upgrade to AutoGen 5.11.9 (and require it) include/autogen-version.def@1.5 +1 -1 Upgrade to AutoGen 5.11.9 (and require it) ChangeSet@1.2294, 2011-05-01 10:37:55+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1904] New: 4.2.7p160 Windows build broken (POSIX_SHELL). ports/winnt/include/config.h@1.83 +1 -0 [Bug 1904] New: 4.2.7p160 Windows build broken (POSIX_SHELL). ChangeSet@1.2293, 2011-05-01 02:47:38-04:00, stenn@deacon.udel.edu hack around a possible regression in the new autogen include/copyright.def@1.14 +4 -1 hack around a possible regression in the new autogen ChangeSet@1.2292, 2011-05-01 02:41:53-04:00, stenn@deacon.udel.edu Upgrade to libopts 35.0.10 from AutoGen 5.11.9pre8 ChangeLog@1.710 +4 -0 Upgrade to libopts 35.0.10 from AutoGen 5.11.9pre8 sntp/libopts/Makefile.am@1.10 +16 -16 Updated to libopts-35.0.10 sntp/libopts/ag-char-map.h@1.13 +6 -6 Updated to libopts-35.0.10 sntp/libopts/autoopts.c@1.10 +2 -12 Updated to libopts-35.0.10 sntp/libopts/autoopts.h@1.9 +3 -37 Updated to libopts-35.0.10 sntp/libopts/autoopts/options.h@1.12 +21 -23 Updated to libopts-35.0.10 sntp/libopts/autoopts/project.h@1.1 +50 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/autoopts/project.h sntp/libopts/autoopts/project.h@1.0 +0 -0 sntp/libopts/autoopts/usage-txt.h@1.12 +100 -95 Updated to libopts-35.0.10 sntp/libopts/configfile.c@1.11 +9 -9 Updated to libopts-35.0.10 sntp/libopts/cook.c@1.8 +85 -67 Updated to libopts-35.0.10 sntp/libopts/enumeration.c@1.8 +15 -10 Updated to libopts-35.0.10 sntp/libopts/environment.c@1.10 +22 -13 Updated to libopts-35.0.10 sntp/libopts/genshell.c@1.13 +58 -56 Updated to libopts-35.0.10 sntp/libopts/genshell.h@1.13 +46 -46 Updated to libopts-35.0.10 sntp/libopts/libopts.c@1.3 +5 -2 Updated to libopts-35.0.10 sntp/libopts/m4/libopts.m4@1.16 +22 -3 Updated to libopts-35.0.10 sntp/libopts/makeshell.c@1.9 +84 -58 Updated to libopts-35.0.10 sntp/libopts/numeric.c@1.8 +39 -47 Updated to libopts-35.0.10 sntp/libopts/parse-duration.c@1.5 +73 -54 Updated to libopts-35.0.10 sntp/libopts/parse-duration.h@1.5 +14 -14 Updated to libopts-35.0.10 sntp/libopts/pgusage.c@1.8 +1 -3 Updated to libopts-35.0.10 sntp/libopts/proto.h@1.13 +1 -4 Updated to libopts-35.0.10 sntp/libopts/save.c@1.9 +34 -41 Updated to libopts-35.0.10 sntp/libopts/time.c@1.8 +77 -29 Updated to libopts-35.0.10 sntp/libopts/value-type.h@1.13 +1 -1 Updated to libopts-35.0.10 sntp/libopts/version.c@1.8 +82 -51 Updated to libopts-35.0.10 sntp/libopts/xat-attribute.h@1.13 +1 -1 Updated to libopts-35.0.10 ChangeSet@1.2291, 2011-02-22 00:38:53-05:00, stenn@deacon.udel.edu upgrade to libopts-34.0.9 clockstuff/clktest-opts.c@1.13 +100 -76 upgrade to libopts-34.0.9 clockstuff/clktest-opts.h@1.13 +32 -25 upgrade to libopts-34.0.9 ntpd/ntpd-opts.c@1.282 +24 -8 upgrade to libopts-34.0.9 ntpd/ntpd-opts.h@1.282 +2 -2 upgrade to libopts-34.0.9 ntpd/ntpdsim-opts.c@1.18 +202 -171 upgrade to libopts-34.0.9 ntpd/ntpdsim-opts.h@1.18 +32 -28 upgrade to libopts-34.0.9 ntpdc/ntpdc-opts.c@1.278 +34 -25 upgrade to libopts-34.0.9 ntpdc/ntpdc-opts.h@1.278 +2 -2 upgrade to libopts-34.0.9 ntpq/ntpq-opts.c@1.279 +32 -18 upgrade to libopts-34.0.9 ntpq/ntpq-opts.h@1.279 +2 -2 upgrade to libopts-34.0.9 ntpsnmpd/ntpsnmpd-opts.c@1.158 +24 -8 upgrade to libopts-34.0.9 ntpsnmpd/ntpsnmpd-opts.h@1.158 +2 -2 upgrade to libopts-34.0.9 sntp/libopts/COPYING.gplv3@1.4 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/COPYING.lgplv3@1.4 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/Makefile.am@1.9 +3 -3 upgrade to libopts-34.0.9 sntp/libopts/README@1.6 +63 -34 upgrade to libopts-34.0.9 sntp/libopts/ag-char-map.h@1.12 +3 -3 upgrade to libopts-34.0.9 sntp/libopts/autoopts.c@1.9 +23 -19 upgrade to libopts-34.0.9 sntp/libopts/autoopts.h@1.8 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/autoopts/options.h@1.11 +11 -10 upgrade to libopts-34.0.9 sntp/libopts/autoopts/usage-txt.h@1.11 +4 -4 upgrade to libopts-34.0.9 sntp/libopts/boolean.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/compat/compat.h@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/compat/windows-config.h@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/configfile.c@1.10 +174 -51 upgrade to libopts-34.0.9 sntp/libopts/cook.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/enumeration.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/environment.c@1.9 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/file.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/genshell.c@1.12 +29 -13 upgrade to libopts-34.0.9 sntp/libopts/genshell.h@1.12 +3 -3 upgrade to libopts-34.0.9 sntp/libopts/load.c@1.9 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/m4/libopts.m4@1.15 +10 -21 upgrade to libopts-34.0.9 sntp/libopts/m4/liboptschk.m4@1.8 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/makeshell.c@1.8 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/nested.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/numeric.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/parse-duration.c@1.4 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/parse-duration.h@1.4 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/pgusage.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/proto.h@1.12 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/putshell.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/reset.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/restore.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/save.c@1.8 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/sort.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/stack.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/streqvcmp.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/text_mmap.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/time.c@1.7 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/tokenize.c@1.5 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/usage.c@1.8 +11 -7 upgrade to libopts-34.0.9 sntp/libopts/value-type.h@1.12 +1 -1 upgrade to libopts-34.0.9 sntp/libopts/version.c@1.7 +9 -12 upgrade to libopts-34.0.9 sntp/libopts/xat-attribute.h@1.12 +1 -1 upgrade to libopts-34.0.9 sntp/sntp-opts.c@1.149 +27 -11 upgrade to libopts-34.0.9 sntp/sntp-opts.h@1.149 +2 -2 upgrade to libopts-34.0.9 util/ntp-keygen-opts.c@1.281 +28 -12 upgrade to libopts-34.0.9 util/ntp-keygen-opts.h@1.281 +2 -2 upgrade to libopts-34.0.9 ChangeSet@1.2290, 2011-01-03 21:20:42-05:00, stenn@deacon.udel.edu NTP_4_2_6P3 TAG: NTP_4_2_6P3 ChangeLog@1.709 +1 -0 NTP_4_2_6P3 ntpd/ntpd-opts.c@1.281 +5 -5 NTP_4_2_6P3 ntpd/ntpd-opts.h@1.281 +4 -4 NTP_4_2_6P3 ntpd/ntpd-opts.texi@1.279 +61 -2 NTP_4_2_6P3 ntpd/ntpd.1@1.279 +2 -2 NTP_4_2_6P3 ntpdc/ntpdc-opts.c@1.277 +5 -5 NTP_4_2_6P3 ntpdc/ntpdc-opts.h@1.277 +4 -4 NTP_4_2_6P3 ntpdc/ntpdc-opts.texi@1.276 +66 -2 NTP_4_2_6P3 ntpdc/ntpdc.1@1.276 +2 -2 NTP_4_2_6P3 ntpq/ntpq-opts.c@1.278 +5 -5 NTP_4_2_6P3 ntpq/ntpq-opts.h@1.278 +4 -4 NTP_4_2_6P3 ntpq/ntpq-opts.texi@1.277 +51 -2 NTP_4_2_6P3 ntpq/ntpq.1@1.277 +2 -2 NTP_4_2_6P3 ntpsnmpd/ntpsnmpd-opts.c@1.157 +5 -5 NTP_4_2_6P3 ntpsnmpd/ntpsnmpd-opts.h@1.157 +4 -4 NTP_4_2_6P3 ntpsnmpd/ntpsnmpd-opts.texi@1.157 +24 -2 NTP_4_2_6P3 ntpsnmpd/ntpsnmpd.1@1.156 +2 -2 NTP_4_2_6P3 packageinfo.sh@1.293 +3 -3 NTP_4_2_6P3 sntp/sntp-opts.c@1.148 +5 -5 NTP_4_2_6P3 sntp/sntp-opts.h@1.148 +4 -4 NTP_4_2_6P3 sntp/sntp-opts.texi@1.148 +56 -2 NTP_4_2_6P3 sntp/sntp.1@1.148 +2 -2 NTP_4_2_6P3 sntp/sntp.html@1.39 +56 -2 NTP_4_2_6P3 util/ntp-keygen-opts.c@1.280 +5 -5 NTP_4_2_6P3 util/ntp-keygen-opts.h@1.280 +4 -4 NTP_4_2_6P3 util/ntp-keygen-opts.texi@1.279 +45 -2 NTP_4_2_6P3 util/ntp-keygen.1@1.279 +2 -2 NTP_4_2_6P3 ChangeSet@1.2289, 2011-01-03 17:52:19-05:00, stenn@deacon.udel.edu 4.2.6p3 packageinfo.sh@1.292 +1 -1 4.2.6p3 ChangeSet@1.2288, 2011-01-03 17:50:01-05:00, stenn@deacon.udel.edu Fix release date NEWS@1.117 +1 -1 Fix release date ChangeSet@1.2287, 2011-01-03 17:04:32-05:00, stenn@deacon.udel.edu cleanup NEWS file for 4.2.6p3 NEWS@1.116 +4 -5 cleanup ChangeSet@1.2286, 2011-01-01 08:35:01+00:00, hart@psp-os1.ntp.org copyright.html: bump copyright.html to 2011 html/copyright.html@1.49 +2 -2 bump copyright.html to 2011 ChangeSet@1.2285, 2010-12-31 20:38:09-05:00, stenn@deacon.udel.edu Update the copyright year ChangeLog@1.708 +1 -0 Update the copyright year include/copyright.def@1.13 +1 -1 Update the copyright year ChangeSet@1.2284, 2010-12-31 23:12:25+00:00, davehart@shiny.ad.hartbrothers.com Test for modem control just once in configure.ac configure.ac@1.491 +39 -45 Test for modem control support just once include/ntpd.h@1.142 +2 -1 make refclock_conf[] pointers const ntpd/refclock_conf.c@1.30 +2 -2 make refclock_conf[] pointers const ChangeSet@1.2283, 2010-12-31 16:28:55-05:00, murray@malarky.udel.edu refclock_conf.c, configure.ac, refclock_palisade.c, ChangeLog: [Bug 1764] Palisade driver doesn't build on Linux. (cleanup) ChangeLog@1.707 +1 -0 [Bug 1764] Palisade driver doesn't build on Linux. (cleanup) configure.ac@1.490 +16 -9 [Bug 1764] Palisade driver doesn't build on Linux. (cleanup) ntpd/refclock_conf.c@1.29 +1 -1 [Bug 1764] Palisade driver doesn't build on Linux. (cleanup) ntpd/refclock_palisade.c@1.34 +0 -5 [Bug 1764] Palisade driver doesn't build on Linux. (cleanup) ChangeSet@1.2282, 2010-12-29 19:24:12-05:00, stenn@deacon.udel.edu Update genCommitLog for the bk-5 release ChangeLog@1.706 +1 -0 Update genCommitLog for the bk-5 release scripts/genCommitLog@1.7 +1 -1 Update genCommitLog for the bk-5 release ChangeSet@1.2281, 2010-12-29 02:06:21-05:00, stenn@deacon.udel.edu Distribute check--help from the correct variable scripts/Makefile.am@1.21 +1 -1 Distribute check--help from the correct variable ChangeSet@1.2280, 2010-12-28 04:20:11-05:00, stenn@deacon.udel.edu Fix location of check--help for sntp sntp/Makefile.am@1.37 +1 -1 Fix location of check--help for sntp ChangeSet@1.2279, 2010-12-28 03:30:18-05:00, stenn@deacon.udel.edu typo scripts/check--help@1.2 +1 -1 typo ChangeSet@1.2278, 2010-12-28 03:16:01-05:00, stenn@deacon.udel.edu Create and use scripts/check--help when generating .texi files ChangeLog@1.705 +2 -0 Create and use scripts/check--help when generating .texi files ntpd/Makefile.am@1.88 +1 -0 Create and use scripts/check--help when generating .texi files ntpdc/Makefile.am@1.53 +1 -0 Create and use scripts/check--help when generating .texi files ntpq/Makefile.am@1.48 +1 -0 Create and use scripts/check--help when generating .texi files ntpsnmpd/Makefile.am@1.21 +1 -0 Create and use scripts/check--help when generating .texi files scripts/Makefile.am@1.20 +1 -0 Create and use scripts/check--help when generating .texi files scripts/check--help@1.1 +22 -0 BitKeeper file /deacon/backroom/ntp-stable/scripts/check--help scripts/check--help@1.0 +0 -0 sntp/Makefile.am@1.36 +1 -0 Create and use scripts/check--help when generating .texi files util/Makefile.am@1.51 +1 -0 Create and use scripts/check--help when generating .texi files ChangeSet@1.2277, 2010-12-28 01:22:04-05:00, stenn@deacon.udel.edu Update bk triggers for the bk-5 release BitKeeper/triggers/post-incoming.license-warn@1.8 +3 -0 Update bk triggers for the bk-5 release BitKeeper/triggers/pre-resolve.license-chk@1.9 +3 -0 Update bk triggers for the bk-5 release BitKeeper/triggers/send@1.15 +2 -2 Update bk triggers for the bk-5 release ChangeLog@1.704 +3 -0 Update bk triggers for the bk-5 release ChangeSet@1.2276, 2010-12-25 16:24:06-05:00, stenn@deacon.udel.edu Fix typo in NEWS file NEWS@1.115 +1 -1 Fix typo in NEWS file ChangeSet@1.2275, 2010-12-25 10:23:24+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_RC12 TAG: NTP_4_2_6P3_RC12 ChangeLog@1.703 +1 -0 NTP_4_2_6P3_RC12 ntpd/ntpd-opts.c@1.280 +5 -5 NTP_4_2_6P3_RC12 ntpd/ntpd-opts.h@1.280 +4 -4 NTP_4_2_6P3_RC12 ntpd/ntpd-opts.texi@1.278 +2 -61 NTP_4_2_6P3_RC12 ntpd/ntpd.1@1.278 +2 -2 NTP_4_2_6P3_RC12 ntpdc/ntpdc-opts.c@1.276 +5 -5 NTP_4_2_6P3_RC12 ntpdc/ntpdc-opts.h@1.276 +4 -4 NTP_4_2_6P3_RC12 ntpdc/ntpdc-opts.texi@1.275 +2 -66 NTP_4_2_6P3_RC12 ntpdc/ntpdc.1@1.275 +2 -2 NTP_4_2_6P3_RC12 ntpq/ntpq-opts.c@1.277 +5 -5 NTP_4_2_6P3_RC12 ntpq/ntpq-opts.h@1.277 +4 -4 NTP_4_2_6P3_RC12 ntpq/ntpq-opts.texi@1.276 +2 -51 NTP_4_2_6P3_RC12 ntpq/ntpq.1@1.276 +2 -2 NTP_4_2_6P3_RC12 ntpsnmpd/ntpsnmpd-opts.c@1.156 +5 -5 NTP_4_2_6P3_RC12 ntpsnmpd/ntpsnmpd-opts.h@1.156 +4 -4 NTP_4_2_6P3_RC12 ntpsnmpd/ntpsnmpd-opts.texi@1.156 +1 -1 NTP_4_2_6P3_RC12 ntpsnmpd/ntpsnmpd.1@1.155 +2 -2 NTP_4_2_6P3_RC12 packageinfo.sh@1.291 +1 -1 NTP_4_2_6P3_RC12 sntp/sntp-opts.c@1.147 +5 -5 NTP_4_2_6P3_RC12 sntp/sntp-opts.h@1.147 +4 -4 NTP_4_2_6P3_RC12 sntp/sntp-opts.texi@1.147 +6 -59 NTP_4_2_6P3_RC12 sntp/sntp.1@1.147 +8 -4 NTP_4_2_6P3_RC12 sntp/sntp.html@1.38 +6 -59 NTP_4_2_6P3_RC12 util/ntp-keygen-opts.c@1.279 +5 -5 NTP_4_2_6P3_RC12 util/ntp-keygen-opts.h@1.279 +4 -4 NTP_4_2_6P3_RC12 util/ntp-keygen-opts.texi@1.278 +2 -45 NTP_4_2_6P3_RC12 util/ntp-keygen.1@1.278 +2 -2 NTP_4_2_6P3_RC12 ChangeSet@1.2274, 2010-12-25 04:14:17-05:00, stenn@deacon.udel.edu RC12 NEWS updates NEWS@1.114 +23 -4 RC12 NEWS updates ChangeSet@1.2273, 2010-12-22 08:57:41+00:00, davehart@shiny.ad.hartbrothers.com libopts 34.0.9 from AutoGen 5.11.6pre7 Relax minimum Automake version to 1.10 with updated libopts.m4. ChangeLog@1.702 +2 -1 libopts 34.0.9 from AutoGen 5.11.6pre7 Relax minimum Automake version to 1.10 with updated libopts.m4. Makefile.am@1.100 +2 -2 Relax minimum Automake version to 1.10 with updated libopts.m4. configure.ac@1.489 +1 -1 libopts 34.0.9 from AutoGen 5.11.6pre7 sntp/Makefile.am@1.35 +2 -2 Relax minimum Automake version to 1.10 with updated libopts.m4. sntp/libopts/m4/libopts.m4@1.14 +45 -17 libopts 34.0.9 from AutoGen 5.11.6pre7 ChangeSet@1.2270.1.1, 2010-12-21 07:15:24+00:00, davehart@shiny.ad.hartbrothers.com handle % at end of string correctly in format_errmsg(). do not force trailing newline in m[v]snprintf(). libntp/msyslog.c@1.27 +54 -29 handle % at end of string correctly in format_errmsg(). do not force trailing newline in m[v]snprintf(). ChangeSet@1.2271, 2010-12-20 18:41:39-08:00, stenn@stenn.ntp.org [Bug 1743] update SNTP time reporting documentation sntp/sntp-opts.def@1.19 +10 -5 [Bug 1743] update SNTP time reporting documentation ChangeSet@1.2267.1.8, 2010-12-20 07:54:12+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1458] Can not compile NTP on FreeBSD 4.7. -- applies to prior lineedit cset which overlooked ChangeLog [Bug 1762] manycastclient solicitation responses interfere. ChangeLog@1.699.1.3 +2 -0 [Bug 1458] Can not compile NTP on FreeBSD 4.7. -- applies to prior lineedit cset which overlooked ChangeLog [Bug 1762] manycastclient solicitation responses interfere. include/ntp.h@1.173 +1 -1 struct interface -> endpt include/ntpd.h@1.141 +1 -1 [Bug 1762] manycastclient solicitation responses interfere. include/recvbuff.h@1.20 +1 -1 struct interface -> endpt ntpd/ntp_peer.c@1.129 +33 -13 [Bug 1762] manycastclient solicitation responses interfere. ntpd/ntp_proto.c@1.299 +1 -2 [Bug 1762] manycastclient solicitation responses interfere. ChangeSet@1.2267.1.7, 2010-12-19 00:04:39-05:00, stenn@deacon.udel.edu Remove unused libntp/net.c.bak file BitKeeper/deleted/.del-net.c.bak~d1c71b19@1.3 +0 -0 Delete: libntp/net.c.bak ChangeSet@1.2267.1.6, 2010-12-19 03:42:39+00:00, hart@psp-os1.ntp.org sntp AutoGen 5.11.6pre5 output sntp/sntp-opts.c@1.146 +29 -30 sntp AutoGen 5.11.6pre5 output sntp/sntp-opts.h@1.146 +13 -4 sntp AutoGen 5.11.6pre5 output sntp/sntp-opts.texi@1.146 +85 -19 sntp AutoGen 5.11.6pre5 output sntp/sntp.1@1.146 +8 -6 sntp AutoGen 5.11.6pre5 output sntp/sntp.html@1.37 +79 -16 sntp AutoGen 5.11.6pre5 output ChangeSet@1.2267.1.5, 2010-12-19 01:10:44+00:00, hart@psp-os1.ntp.org AutoGen 5.11.6pre5 output ntpd/ntpd-opts.c@1.279 +15 -10 AutoGen 5.11.6pre5 output ntpd/ntpd-opts.h@1.279 +3 -3 AutoGen 5.11.6pre5 output ntpd/ntpd-opts.texi@1.277 +61 -2 AutoGen 5.11.6pre5 output ntpd/ntpd.1@1.277 +2 -2 AutoGen 5.11.6pre5 output ntpdc/ntpdc-opts.c@1.275 +20 -15 AutoGen 5.11.6pre5 output ntpdc/ntpdc-opts.h@1.275 +3 -3 AutoGen 5.11.6pre5 output ntpdc/ntpdc-opts.texi@1.274 +66 -2 AutoGen 5.11.6pre5 output ntpdc/ntpdc.1@1.274 +2 -2 AutoGen 5.11.6pre5 output ntpq/ntpq-opts.c@1.276 +20 -15 AutoGen 5.11.6pre5 output ntpq/ntpq-opts.h@1.276 +3 -3 AutoGen 5.11.6pre5 output ntpq/ntpq-opts.texi@1.275 +51 -2 AutoGen 5.11.6pre5 output ntpq/ntpq.1@1.275 +2 -2 AutoGen 5.11.6pre5 output ntpsnmpd/ntpsnmpd-opts.c@1.155 +19 -14 AutoGen 5.11.6pre5 output ntpsnmpd/ntpsnmpd-opts.h@1.155 +3 -3 AutoGen 5.11.6pre5 output ntpsnmpd/ntpsnmpd-opts.texi@1.155 +1 -1 AutoGen 5.11.6pre5 output ntpsnmpd/ntpsnmpd.1@1.154 +2 -2 AutoGen 5.11.6pre5 output util/ntp-keygen-opts.c@1.278 +20 -15 AutoGen 5.11.6pre5 output util/ntp-keygen-opts.h@1.278 +3 -3 AutoGen 5.11.6pre5 output util/ntp-keygen-opts.texi@1.277 +45 -2 AutoGen 5.11.6pre5 output util/ntp-keygen.1@1.277 +2 -2 AutoGen 5.11.6pre5 output ChangeSet@1.2267.1.4, 2010-12-19 00:59:46+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1760] ntpd Windows interpolation cannot be disabled. Upgrade to libopts 34.0.9 from AutoGen 5.11.6pre5. applies to prior cset merged from ntp-stable-libopts-upstream ChangeLog@1.699.1.2 +2 -1 [Bug 1760] ntpd Windows interpolation cannot be disabled. Upgrade to libopts 34.0.9 from AutoGen 5.11.6pre5. ports/winnt/ntpd/nt_clockstuff.c@1.42 +3 -1 [Bug 1760] ntpd Windows interpolation cannot be disabled. ChangeSet@1.2264.2.1, 2010-12-19 00:50:10+00:00, davehart@shiny.ad.hartbrothers.com libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/Makefile.am@1.8 +5 -5 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/ag-char-map.h@1.11 +32 -32 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/autoopts.c@1.8 +21 -10 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/autoopts.h@1.7 +19 -18 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/autoopts/options.h@1.10 +11 -6 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/autoopts/usage-txt.h@1.10 +175 -168 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/genshell.c@1.11 +16 -11 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/genshell.h@1.11 +3 -3 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/load.c@1.8 +27 -31 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/m4/libopts.m4@1.11.1.1 +1 -1 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/proto.h@1.11 +1 -1 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/usage.c@1.7 +23 -24 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/value-type.h@1.11 +1 -1 libopts 34.0.9 (AutoGen 5.11.6pre5) sntp/libopts/xat-attribute.h@1.11 +1 -1 libopts 34.0.9 (AutoGen 5.11.6pre5) ChangeSet@1.2267.1.2, 2010-12-18 06:57:45+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1458] Can not compile NTP on FreeBSD 4.7 libntp/ntp_lineedit.c@1.9 +17 -10 [Bug 1458] Can not compile NTP on FreeBSD 4.7 m4/ntp_lineeditlibs.m4@1.10 +26 -0 [Bug 1458] Can not compile NTP on FreeBSD 4.7 ChangeSet@1.2267.1.1, 2010-12-18 02:38:28+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1758] setsockopt IPV6_MULTICAST_IF with wrong ifindex. ChangeLog@1.699.1.1 +1 -0 [Bug 1758] setsockopt IPV6_MULTICAST_IF with wrong ifindex. ntpd/ntp_io.c@1.319.1.1 +48 -72 [Bug 1758] setsockopt IPV6_MULTICAST_IF with wrong ifindex. ChangeSet@1.2269, 2010-12-17 02:53:54+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1757] oncore snprintf("%m") doesn't expand %m. ChangeLog@1.700 +1 -0 [Bug 1757] oncore snprintf("%m") doesn't expand %m. include/ntp_stdlib.h@1.44 +4 -1 add mvsnprintf(), msnprintf() clones of vsnprintf() and snprintf() which expand %m to strerror(errno) like msyslog() libntp/msyslog.c@1.26 +43 -23 add mvsnprintf(), msnprintf() clones of vsnprintf() and snprintf() which expand %m to strerror(errno) like msyslog() ntpd/ntp_io.c@1.320 +1 -1 silence potentially uninit warning ntpd/refclock_oncore.c@1.83 +5 -5 [Bug 1757] oncore snprintf("%m") doesn't expand %m. ChangeSet@1.2264.1.3, 2010-12-17 01:59:53+00:00, hart@psp-os1.ntp.org Many files: Autogen 5.11.6pre3 output ntpd/ntpd-opts.c@1.276.1.1 +5 -5 Autogen 5.11.6pre3 output ntpd/ntpd-opts.h@1.276.1.1 +13 -4 Autogen 5.11.6pre3 output ntpd/ntpd-opts.texi@1.274.1.1 +1 -1 Autogen 5.11.6pre3 output ntpd/ntpd.1@1.274.1.1 +2 -2 Autogen 5.11.6pre3 output ntpdc/ntpdc-opts.c@1.272.1.1 +5 -5 Autogen 5.11.6pre3 output ntpdc/ntpdc-opts.h@1.272.1.1 +13 -4 Autogen 5.11.6pre3 output ntpdc/ntpdc-opts.texi@1.271.1.1 +1 -1 Autogen 5.11.6pre3 output ntpdc/ntpdc.1@1.271.1.1 +2 -2 Autogen 5.11.6pre3 output ntpq/ntpq-opts.c@1.273.1.1 +5 -5 Autogen 5.11.6pre3 output ntpq/ntpq-opts.h@1.273.1.1 +13 -4 Autogen 5.11.6pre3 output ntpq/ntpq-opts.texi@1.272.1.1 +1 -1 Autogen 5.11.6pre3 output ntpq/ntpq.1@1.272.1.1 +2 -2 Autogen 5.11.6pre3 output ntpsnmpd/ntpsnmpd-opts.c@1.152.1.1 +5 -5 Autogen 5.11.6pre3 output ntpsnmpd/ntpsnmpd-opts.h@1.152.1.1 +13 -4 Autogen 5.11.6pre3 output ntpsnmpd/ntpsnmpd-opts.texi@1.152.1.1 +1 -1 Autogen 5.11.6pre3 output ntpsnmpd/ntpsnmpd.1@1.151.1.1 +2 -2 Autogen 5.11.6pre3 output util/ntp-keygen-opts.c@1.275.1.1 +5 -5 Autogen 5.11.6pre3 output util/ntp-keygen-opts.h@1.275.1.1 +13 -4 Autogen 5.11.6pre3 output util/ntp-keygen-opts.texi@1.274.1.1 +1 -1 Autogen 5.11.6pre3 output util/ntp-keygen.1@1.274.1.1 +2 -2 Autogen 5.11.6pre3 output ChangeSet@1.2264.1.2, 2010-12-17 01:46:51+00:00, davehart@shiny.ad.hartbrothers.com restore NTP local patch to LIBOPTS_CHECK to not build libopts from the top-level configure.ac. sntp/libopts/m4/libopts.m4@1.12 +10 -7 restore NTP local patch to LIBOPTS_CHECK to not build libopts from the top-level configure.ac. ChangeSet@1.2264.1.1, 2010-12-17 01:43:41+00:00, davehart@shiny.ad.hartbrothers.com libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 ChangeLog@1.699 +1 -1 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/Makefile.am@1.7 +5 -5 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/README@1.5 +1 -1 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/ag-char-map.h@1.10 +1 -1 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/autoopts/options.h@1.9 +12 -5 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/autoopts/usage-txt.h@1.9 +1 -1 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/configfile.c@1.9 +14 -7 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/genshell.c@1.10 +2 -2 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/genshell.h@1.10 +3 -3 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/m4/libopts.m4@1.11 +8 -11 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/makeshell.c@1.7 +17 -9 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/proto.h@1.10 +1 -1 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/value-type.h@1.10 +1 -1 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 sntp/libopts/xat-attribute.h@1.10 +1 -1 libopts 33.5.8 unmodified from AutoGen 5.11.6pre3 ChangeSet@1.2266, 2010-12-16 20:22:36-05:00, stenn@deacon.udel.edu libopts upgrade ntpd/ntpd-opts.c@1.277 +5 -5 libopts upgrade ntpd/ntpd-opts.h@1.277 +13 -4 libopts upgrade ntpd/ntpd-opts.texi@1.275 +61 -2 libopts upgrade ntpd/ntpd.1@1.275 +2 -2 libopts upgrade ntpdc/ntpdc-opts.c@1.273 +5 -5 libopts upgrade ntpdc/ntpdc-opts.h@1.273 +13 -4 libopts upgrade ntpdc/ntpdc-opts.texi@1.272 +66 -2 libopts upgrade ntpdc/ntpdc.1@1.272 +2 -2 libopts upgrade ntpq/ntpq-opts.c@1.274 +5 -5 libopts upgrade ntpq/ntpq-opts.h@1.274 +13 -4 libopts upgrade ntpq/ntpq-opts.texi@1.273 +51 -2 libopts upgrade ntpq/ntpq.1@1.273 +2 -2 libopts upgrade ntpsnmpd/ntpsnmpd-opts.c@1.153 +5 -5 libopts upgrade ntpsnmpd/ntpsnmpd-opts.h@1.153 +13 -4 libopts upgrade ntpsnmpd/ntpsnmpd-opts.texi@1.153 +24 -2 libopts upgrade ntpsnmpd/ntpsnmpd.1@1.152 +2 -2 libopts upgrade util/ntp-keygen-opts.c@1.276 +5 -5 libopts upgrade util/ntp-keygen-opts.h@1.276 +13 -4 libopts upgrade util/ntp-keygen-opts.texi@1.275 +45 -2 libopts upgrade util/ntp-keygen.1@1.275 +2 -2 libopts upgrade ChangeSet@1.2265, 2010-12-16 23:57:51+00:00, davehart@shiny.ad.hartbrothers.com first verbose --version attempt caused --help to segfault. libntp/ntp_libopts.c@1.3 +7 -6 first verbose --version attempt caused --help to segfault. ChangeSet@1.2264, 2010-12-16 09:07:58+00:00, davehart@shiny.ad.hartbrothers.com Upgrade to libopts 33.4.8 from AutoGen 5.11.6pre1. ChangeLog@1.698 +1 -0 Upgrade to libopts 33.4.8 from AutoGen 5.11.6pre1. sntp/libopts/Makefile.am@1.6 +5 -5 libopts 33.4.8 sntp/libopts/ag-char-map.h@1.9 +1 -1 libopts 33.4.8 sntp/libopts/autoopts.c@1.7 +5 -5 libopts 33.4.8 sntp/libopts/autoopts/options.h@1.8 +4 -4 libopts 33.4.8 sntp/libopts/autoopts/usage-txt.h@1.8 +1 -1 libopts 33.4.8 sntp/libopts/configfile.c@1.8 +4 -1 libopts 33.4.8 sntp/libopts/environment.c@1.8 +26 -20 libopts 33.4.8 sntp/libopts/genshell.c@1.9 +2 -2 libopts 33.4.8 sntp/libopts/genshell.h@1.9 +13 -4 libopts 33.4.8 sntp/libopts/load.c@1.7 +2 -2 libopts 33.4.8 sntp/libopts/m4/libopts.m4@1.10 +6 -6 libopts 33.4.8 plus local patch to fix single shared libopts between sntp subproj and top-level sntp/libopts/m4/liboptschk.m4@1.7 +20 -33 libopts 33.4.8 sntp/libopts/proto.h@1.9 +2 -2 libopts 33.4.8 sntp/libopts/value-type.h@1.9 +1 -1 libopts 33.4.8 sntp/libopts/xat-attribute.h@1.9 +1 -1 libopts 33.4.8 ChangeSet@1.2263, 2010-12-16 06:16:02+00:00, davehart@shiny.ad.hartbrothers.com #include in new file libntp/ntp_libopts.c add libopts includes to libntp INCLUDES = now that ntp_libopts.c uses them. ChangeLog@1.697 +1 -1 typo libntp/Makefile.am@1.53 +3 -3 add libopts includes to libntp INCLUDES = now that ntp_libopts.c uses them. libntp/ntp_libopts.c@1.2 +4 -1 #include in new file libntp/ntp_libopts.c ChangeSet@1.2262, 2010-12-16 04:42:37+00:00, davehart@shiny.ad.hartbrothers.com * [Bug 1740] ntpdc treats many counters as signed. (backport) * [Bug 1754] --version output should be more verbose. * Suppress ntp-keygen OpenSSL version display for --help, --version, display both build and runtime OpenSLL versions when they differ. ChangeLog@1.696 +4 -0 * [Bug 1740] ntpdc treats many counters as signed. (backport) * [Bug 1754] --version output should be more verbose. * Suppress ntp-keygen OpenSSL version display for --help, --version, display both build and runtime OpenSLL versions when they differ. include/Makefile.am@1.39 +1 -0 add ntp_libopts.h include/ntp_libopts.h@1.1 +13 -0 new wrapper ntpOptionProcess() makes --version output more verbose. include/ntp_libopts.h@1.0 +0 -0 libntp/Makefile.am@1.52 +1 -0 add ntp_libopts.c libntp/ntp_libopts.c@1.1 +50 -0 new wrapper ntpOptionProcess() makes --version output more verbose. libntp/ntp_libopts.c@1.0 +0 -0 ntpd/ntp_scanner.c@1.34 +2 -2 suppress gcc4 warning about signed overflow by using unsigned counter and index ntpd/ntpd.c@1.113 +2 -1 [Bug 1754] --version output should be more verbose. ntpdc/ntpdc.c@1.79 +2 -1 [Bug 1754] --version output should be more verbose. ntpdc/ntpdc_ops.c@1.65 +191 -197 [Bug 1740] ntpdc treats many counters as signed. (backport) ntpq/ntpq.c@1.105 +2 -1 [Bug 1754] --version output should be more verbose. ports/winnt/vc6/libntp.dsp@1.54 +4 -0 add libntp/ntp_libopts.c reference ports/winnt/vc6/ntpkeygen.dsp@1.22 +2 -2 correct ntp-keygen Version string to mention ntp-keygen not ntpkeygen ports/winnt/vs2003/libntp.vcproj@1.9 +3 -0 add libntp/ntp_libopts.c reference ports/winnt/vs2003/ntpkeygen.vcproj@1.5 +2 -2 correct ntp-keygen Version string to mention ntp-keygen not ntpkeygen ports/winnt/vs2005/libntp.vcproj@1.9 +4 -0 add libntp/ntp_libopts.c reference ports/winnt/vs2005/ntpkeygen.vcproj@1.5 +2 -2 correct ntp-keygen Version string to mention ntp-keygen not ntpkeygen ports/winnt/vs2008/libntp/libntp.vcproj@1.27 +8 -0 add libntp/ntp_libopts.c reference ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.11 +2 -68 correct ntp-keygen Version string to mention ntp-keygen not ntpkeygen ports/winnt/vs2008/ntpd/ntpd.vcproj@1.25 +4 -0 add include/ntp_libopts.h reference util/Makefile.am@1.50 +9 -1 Generate, use version.c for verbose --version output util/ntp-keygen.c@1.66 +13 -2 [Bug 1754] --version output should be more verbose. ChangeSet@1.2261, 2010-12-15 20:23:17+00:00, davehart@shiny.ad.hartbrothers.com Use LIBS not LDFLAGS for configure tests of -lcrypto, -lcrypto -lz m4/ntp_openssl.m4@1.8 +6 -6 Use LIBS not LDFLAGS for configure tests of -lcrypto, -lcrypto -lz ChangeSet@1.2260, 2010-12-15 08:27:35+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1618] Unreachable code in jjy_start(). (backport from ntp-dev) (applies to -stable changes previously pulled to -dev only) [Bug 1719] ntp-keygen -V crash. (backport) ChangeLog@1.695 +2 -0 [Bug 1618] Unreachable code in jjy_start(). (backport from ntp-dev) [Bug 1719] ntp-keygen -V crash. (backport) util/ntp-keygen.c@1.65 +0 -1 [Bug 1719] ntp-keygen -V crash. (backport) ChangeSet@1.2257.1.22, 2010-12-15 01:23:25+00:00, davehart@shiny.ad.hartbrothers.com get along better with OpenSSL 1.0.0c headers by including evp.h instead of rand.h in ssl_init.c and configure.ac tests. libntp/ssl_init.c@1.7 +1 -1 get along better with OpenSSL 1.0.0c headers by including evp.h instead of rand.h in ssl_init.c and configure.ac tests. m4/ntp_openssl.m4@1.7 +2 -2 get along better with OpenSSL 1.0.0c headers by including evp.h instead of rand.h in ssl_init.c and configure.ac tests. ChangeSet@1.2257.1.21, 2010-12-14 20:49:32+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1751] correct -lcrypto -lz dependency test m4/ntp_openssl.m4@1.6 +4 -0 [Bug 1751] correct -lcrypto -lz dependency test ChangeSet@1.2257.1.20, 2010-12-14 19:40:18+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1751] Support for Atari FreeMiNT OS. ChangeLog@1.694 +1 -0 [Bug 1751] Support for Atari FreeMiNT OS. configure.ac@1.488 +4 -1 [Bug 1751] Support for Atari FreeMiNT OS. lib/isc/unix/net.c@1.15 +1 -1 [Bug 1751] Support for Atari FreeMiNT OS. m4/ntp_openssl.m4@1.5 +52 -0 [Bug 1751] Atari FreeMiNT needs -lcrypto -lz for LCRYPTO ntpd/ntp_config.c@1.249 +4 -5 attempt to silence gcc4 apparently bogus warning about simplifying conditional "if (i)" to a constant. ntpd/ntp_control.c@1.135 +3 -1 quiet gcc4 signed overflow warning ntpd/ntp_refclock.c@1.94 +6 -32 quiet gcc4 signed overflow warning ntpd/refclock_conf.c@1.28 +1 -1 [Bug 1751] Atari FreeMiNT termios.h doesn't have TIOCMSET ntpd/refclock_palisade.c@1.33 +12 -6 [Bug 1751] Atari FreeMiNT termios.h doesn't have TIOCMSET ntpdate/ntpdate.c@1.72 +32 -27 attempt to silence gcc4 signed wraparound/overflow warnings. ntpdc/ntpdc.c@1.78 +35 -55 4.2.6 requires ANSI C so qsort() signature is nailed down. ntpdc/ntpdc_ops.c@1.64 +65 -67 Attempt to silence apparently bogus "simplifying conditional to constant" warning from gcc4 re "if (res)" ntpq/libntpq.c@1.8 +62 -73 use associd_t instead of int ntpq/libntpq.h@1.6 +10 -12 use associd_t instead of int ntpq/libntpq_subs.c@1.4 +4 -10 use associd_t instead of int ntpq/ntpq-subs.c@1.46 +99 -88 use associd_t instead of int ntpq/ntpq.c@1.104 +119 -174 use associd_t instead of int ntpq/ntpq.h@1.14 +1 -1 use associd_t not int sntp/main.c@1.33 +5 -4 toy with gcc4 apparently spurious "simplifying conditional to constant" warning. util/tickadj.c@1.9 +3 -1 [Bug 1751] Support for Atari FreeMiNT OS. ChangeSet@1.2257.1.19, 2010-12-13 01:06:37-05:00, stenn@deacon.udel.edu SNTP documentation cleanup sntp/Makefile.am@1.34 +4 -0 SNTP documentation cleanup sntp/sntp.html@1.36 +297 -11 SNTP documentation cleanup sntp/sntp.texi@1.6 +2 -2 SNTP documentation cleanup ChangeSet@1.2257.1.17, 2010-12-12 07:11:37+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1741] Enable multicast reception on each address (Windows). Minimize local address flip-flopping by avoiding peer_refresh_allinterfaces() if nothing has changed in the interface list since the last scan. Separate handling of scope ID embedded in many in6_addr from ifindex used for IPv6 multicasting ioctls. Add INT_PRIVACY endpt bit flag for IPv6 RFC 4941 privacy addresses. Enable outbound multicast from only one address per interface in the same subnet, and in that case prefer embedded MAC address modified EUI-64 IPv6 addresses first, then static, and last RFC 4941 privacy addresses. Use setsockopt(IP[V6]_MULTICAST_IF) before each send to multicast to select the local source address, using the correct socket isn't enough. ChangeLog@1.691.1.1 +12 -0 * [Bug 1741] Enable multicast reception on each address (Windows). * Other manycastclient repairs: Separate handling of scope ID embedded in many in6_addr from ifindex used for IPv6 multicasting ioctls. Add INT_PRIVACY endpt bit flag for IPv6 RFC 4941 privacy addresses. Enable outbound multicast from only one address per interface in the same subnet, and in that case prefer embedded MAC address modified EUI-64 IPv6 addresses first, then static, and last RFC 4941 privacy addresses. Use setsockopt(IP[V6]_MULTICAST_IF) before each send to multicast to select the local source address, using the correct socket is not enough. include/isc/mem.h@1.4 +9 -8 use macro-arg-protecting () only where helpful. include/ntp.h@1.172 +3 -2 add INT_PRIVACY endpt.flags bit to indicate RFC 4941 privacy addresses include/ntp_control.h@1.39 +1 -1 use offsetof instead of hard_coding CTL_HEADER_LEN include/ntp_io.h@1.15 +4 -4 housekeeping (use #ifdef not #if for HAVE_*) include/ntp_net.h@1.6 +4 -0 add IS_IID_UNIV() to test for universal scope interface identifier to differentiate embedded-MAC modified EUI-64 from static and privacy addresses. include/ntp_stdlib.h@1.43 +2 -2 mark socktoa(), socktohost() args const include/ntpd.h@1.140 +1 -1 whitespace only lib/isc/include/isc/interfaceiter.h@1.8 +2 -0 add ifindex to struct isc_interface to manage need for index distinct from sin6_scope_id for setsockopt IPV6_MULTICAST_IF and IPV6_JOIN_GROUP. add INTERFACE_F_PRIVACY flag set when the source of the IID is RFC 4941 privacy addresses or another random scheme. lib/isc/unix/ifiter_ioctl.c@1.29 +2 -6 set ifindex in libisc interface enumerator, and for link-local addresses, use it as the scope ID (AKA zone). lib/isc/unix/ifiter_sysctl.c@1.16 +1 -0 set ifindex in libisc interface enumerator lib/isc/unix/interfaceiter.c@1.19 +3 -1 set ifindex in libisc interface enumerator lib/isc/win32/include/isc/ipv6.h@1.10 +4 -4 Fix bugs in Windows libisc IN6_IS_ADDR_{LINK|SITE}LOCAL() lib/isc/win32/interfaceiter.c@1.20 +29 -16 Add INTERFACE_F_PRIVACY detection, set new ifindex in isc_interface_t. Skip deprecated addresses. nonfunctional cleanup of [Bug 1738] changes. libntp/socktoa.c@1.12 +1 -1 socktoa() input now const libntp/socktohost.c@1.8 +1 -1 socktohost() input now const ntpd/ntp_control.c@1.134 +0 -2 eliminate gcc4 warning in rendundant code by removing it. authencrypt() jams the keyid into the packet structure. ntpd/ntp_io.c@1.319 +357 -308 [Bug 1741] Enable multicast reception on each address (Windows). Minimize local address flip-flopping by avoiding peer_refresh_allinterfaces() if nothing has changed in the interface list since the last scan. Separate handling of scope ID embedded in many in6_addr from ifindex used for IPv6 multicasting ioctls. Add INT_PRIVACY endpt bit flag for IPv6 RFC 4941 privacy addresses. Enable outbound multicast from only one address per interface in the same subnet, and in that case prefer embedded MAC address modified EUI-64 IPv6 addresses first, then static, and last RFC 4941 privacy addresses. Use setsockopt(IP[V6]_MULTICAST_IF) before each send to multicast to select the local source address, using the correct socket isn't enough. ntpd/ntp_peer.c@1.128 +49 -50 cleanup ntpd/ntp_request.c@1.86 +18 -16 scopeid member of endpt replaced with ifindex ntpd/ntpd.c@1.112 +1 -1 typo in msyslog text "Attemping" ChangeSet@1.2257.2.5, 2010-12-10 12:52:28+01:00, burnicki@pogo.udel.edu Updated changelog. ChangeLog@1.692 +1 -0 Updated changelog. ChangeSet@1.2257.2.4, 2010-12-10 12:47:54+01:00, burnicki@pogo.udel.edu [Bug 1510] Add modes 20/21 for driver 8 to support RAWDCF @ 75 baud. html/drivers/driver8.html@1.25 +12 -0 [Bug 1510] Add modes 20/21 for driver 8 to support RAWDCF @ 75 baud. ntpd/refclock_parse.c@1.53 +49 -0 [Bug 1510] Add modes 20/21 for driver 8 to support RAWDCF @ 75 baud. ChangeSet@1.2257.2.3, 2010-12-08 02:34:17-05:00, stenn@psp-deb1.ntp.org [Bug 1743] Display timezone offset when showing time for sntp in the local timezone. ChangeLog@1.691 +2 -0 [Bug 1743] Display timezone offset when showing time for sntp in the local timezone. sntp/configure.ac@1.40 +1 -0 [Bug 1743] Display timezone offset when showing time for sntp in the local timezone. sntp/main.c@1.32 +20 -2 [Bug 1743] Display timezone offset when showing time for sntp in the local timezone. sntp/utilities.c@1.13 +40 -26 [Bug 1743] Display timezone offset when showing time for sntp in the local timezone. sntp/utilities.h@1.9 +1 -1 [Bug 1743] Display timezone offset when showing time for sntp in the local timezone. ChangeSet@1.2257.2.2, 2010-12-08 02:28:13-05:00, stenn@deacon.udel.edu Clean up the SNTP documentation sntp/sntp-opts.def@1.18 +4 -0 Clean up the SNTP documentation sntp/sntp.texi@1.5 +3 -3 Clean up the SNTP documentation ChangeSet@1.2257.2.1, 2010-12-07 03:37:36-05:00, stenn@deacon.udel.edu [Bug 1742] Fix a typo in an error message in the "build" script ChangeLog@1.690 +1 -0 [Bug 1742] Fix a typo in an error message in the "build" script build@1.38 +1 -1 [Bug 1742] Fix a typo in an error message in the "build" script ChangeSet@1.2257.1.14, 2010-12-06 08:01:24+00:00, davehart@shiny.ad.hartbrothers.com correct relatively harmless retrying GetAdaptersAddresses() on errors other than ERROR_BUFFER_OVERFLOW. lib/isc/win32/interfaceiter.c@1.19 +2 -2 correct relatively harmless retrying GetAdaptersAddresses() on errors other than ERROR_BUFFER_OVERFLOW. ChangeSet@1.2257.1.13, 2010-12-06 02:14:03+00:00, davehart@shiny.ad.hartbrothers.com Add GetAdaptersAddress()-based interface enumeration to libisc Windows code, runtime linked on Windows XP SP1 and later only, which provides correct interface name with each address. include/isc/mem.h@1.3 +19 -7 Silence unreferenced warnings from Microsoft C compiler lib/isc/inet_pton.c@1.5 +3 -3 Avoid C++ keyword "new" for variable name, silence Microsoft C warning about truncation. lib/isc/netaddr.c@1.9 +1 -1 Silence Microsoft C warning that const var 'zeros' should be initialized. lib/isc/win32/include/isc/once.h@1.5 +1 -1 Use correct type for InterlockedExchange() target. lib/isc/win32/interfaceiter.c@1.18 +264 -70 Add GetAdaptersAddress()-based interface enumeration, runtime linked on Windows XP SP1 and later only, which provides correct interface name with each address. lib/isc/win32/net.c@1.15 +0 -1 Removed unused local, silencing warning. lib/isc/win32/stdtime.c@1.2 +1 -1 Silence type conversion warning. ChangeSet@1.2257.1.12, 2010-12-04 05:32:55-05:00, stenn@deacon.udel.edu Clean up the SNTP documentation ChangeLog@1.689 +1 -0 Clean up the SNTP documentation sntp/sntp-opts.def@1.17 +49 -27 Clean up the SNTP documentation sntp/sntp.texi@1.4 +2 -2 Clean up the SNTP documentation ChangeSet@1.2257.1.11, 2010-11-30 06:45:17+00:00, davehart@shiny.ad.hartbrothers.com cleanup last changeset configure.ac@1.487 +2 -1 AS_UNSET() works on only one variable, not a list m4/ntp_cacheversion.m4@1.10 +3 -1 AS_UNSET() works on only one variable, not a list m4/ntp_lineeditlibs.m4@1.9 +4 -1 AS_UNSET() works on only one variable, not a list sntp/configure.ac@1.39 +2 -1 AS_UNSET() works on only one variable, not a list ChangeSet@1.2257.1.10, 2010-11-30 05:12:51+00:00, davehart@shiny.ad.hartbrothers.com Clean up m4 quoting in configure.ac, *.m4 files, resolving intermittent AC_LANG_PROGRAM possibly undefined errors. ChangeLog@1.688 +5 -0 Clean up m4 quoting in configure.ac, *.m4 files, resolving intermittent AC_LANG_PROGRAM possibly undefined errors. configure.ac@1.486 +3076 -2291 M4 quoting cleanup m4/define_dir.m4@1.2 +4 -4 M4 quoting cleanup m4/ntp_cacheversion.m4@1.9 +4 -8 use AS_UNSET() equivalent consistently m4/ntp_dir_sep.m4@1.3 +19 -13 m4 quoting cleanup m4/ntp_lib_m.m4@1.2 +2 -1 m4 quoting cleannup use AS_UNSET, m4/os_cflags has for a while without complaint. m4/ntp_lineeditlibs.m4@1.8 +23 -16 m4 quoting cleannup use AS_UNSET, m4/os_cflags has for a while without complaint. m4/ntp_openssl.m4@1.4 +76 -39 m4 quoting cleannup m4/ntp_vpathhack.m4@1.3 +1 -1 m4 quoting cleannup sntp/configure.ac@1.38 +364 -298 M4 quoting cleanup, fix for 'possibly undefined AC_LANG_PROGRAM' seen with bootstrap --force, triggered by errant getsockname() socklen type check. ChangeSet@1.2257.1.9, 2010-11-28 01:03:45-05:00, stenn@deacon.udel.edu Use A.host build directory names at ntp.org build@1.37 +5 -1 Use A.host build directory names at ntp.org ChangeSet@1.2257.1.8, 2010-11-28 04:53:12+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_RC11 TAG: NTP_4_2_6P3_RC11 ChangeLog@1.687 +1 -0 NTP_4_2_6P3_RC11 ntpd/ntpd-opts.c@1.276 +2 -2 NTP_4_2_6P3_RC11 ntpd/ntpd-opts.h@1.276 +3 -3 NTP_4_2_6P3_RC11 ntpd/ntpd-opts.menu@1.4 +1 -122 NTP_4_2_6P3_RC11 ntpd/ntpd-opts.texi@1.274 +522 -0 NTP_4_2_6P3_RC11 ntpd/ntpd.1@1.274 +2 -2 NTP_4_2_6P3_RC11 ntpdc/ntpdc-opts.c@1.272 +2 -2 NTP_4_2_6P3_RC11 ntpdc/ntpdc-opts.h@1.272 +3 -3 NTP_4_2_6P3_RC11 ntpdc/ntpdc-opts.menu@1.4 +1 -122 NTP_4_2_6P3_RC11 ntpdc/ntpdc-opts.texi@1.271 +207 -0 NTP_4_2_6P3_RC11 ntpdc/ntpdc.1@1.271 +2 -2 NTP_4_2_6P3_RC11 ntpq/ntpq-opts.c@1.273 +2 -2 NTP_4_2_6P3_RC11 ntpq/ntpq-opts.h@1.273 +3 -3 NTP_4_2_6P3_RC11 ntpq/ntpq-opts.menu@1.4 +1 -96 NTP_4_2_6P3_RC11 ntpq/ntpq-opts.texi@1.272 +177 -0 NTP_4_2_6P3_RC11 ntpq/ntpq.1@1.272 +2 -2 NTP_4_2_6P3_RC11 ntpsnmpd/ntpsnmpd-opts.c@1.152 +2 -2 NTP_4_2_6P3_RC11 ntpsnmpd/ntpsnmpd-opts.h@1.152 +3 -3 NTP_4_2_6P3_RC11 ntpsnmpd/ntpsnmpd-opts.menu@1.4 +1 -56 NTP_4_2_6P3_RC11 ntpsnmpd/ntpsnmpd-opts.texi@1.152 +55 -0 NTP_4_2_6P3_RC11 ntpsnmpd/ntpsnmpd.1@1.151 +2 -2 NTP_4_2_6P3_RC11 packageinfo.sh@1.290 +1 -1 NTP_4_2_6P3_RC11 sntp/sntp-opts.c@1.145 +2 -2 NTP_4_2_6P3_RC11 sntp/sntp-opts.h@1.145 +3 -3 NTP_4_2_6P3_RC11 sntp/sntp-opts.menu@1.4 +1 -56 NTP_4_2_6P3_RC11 sntp/sntp-opts.texi@1.145 +213 -0 NTP_4_2_6P3_RC11 sntp/sntp.1@1.145 +2 -2 NTP_4_2_6P3_RC11 sntp/sntp.html@1.35 +6 -62 NTP_4_2_6P3_RC11 util/ntp-keygen-opts.c@1.275 +2 -2 NTP_4_2_6P3_RC11 util/ntp-keygen-opts.h@1.275 +3 -3 NTP_4_2_6P3_RC11 util/ntp-keygen-opts.menu@1.4 +1 -94 NTP_4_2_6P3_RC11 util/ntp-keygen-opts.texi@1.274 +314 -0 NTP_4_2_6P3_RC11 util/ntp-keygen.1@1.274 +2 -2 NTP_4_2_6P3_RC11 ChangeSet@1.2257.1.7, 2010-11-27 23:10:00-05:00, stenn@deacon.udel.edu Improvements to the 'build' script ChangeLog@1.686 +1 -0 Improvements to the 'build' script build@1.36 +60 -18 Improvements to the 'build' script ChangeSet@1.2257.1.6, 2010-11-24 04:13:50-05:00, stenn@deacon.udel.edu Update the NEWS file to include work done in RC11 NEWS@1.113 +6 -1 Update the NEWS file to include work done in RC11 ChangeSet@1.2257.1.5, 2010-11-24 04:00:30-05:00, stenn@deacon.udel.edu [Bug 1733] IRIX doesn't have 'head' (affects scripts/checkChangeLog) ChangeLog@1.685 +1 -0 [Bug 1733] IRIX doesn't have 'head' (affects scripts/checkChangeLog) scripts/checkChangeLog@1.3 +2 -1 [Bug 1733] IRIX doesn't have 'head' (affects scripts/checkChangeLog) ChangeSet@1.2257.1.4, 2010-11-23 14:58:05+00:00, davehart@shiny.ad.hartbrothers.com configure.ac m4 quoting cleanup attempt to quiet expanded before required warnings from libopts configure.ac@1.485 +8 -8 correct m4 quoting sntp/configure.ac@1.37 +6 -6 configure.ac m4 quoting cleanup sntp/libopts/m4/libopts.m4@1.9 +6 -9 attempt to quiet expanded before required warnings from libopts ChangeSet@1.2257.1.3, 2010-11-23 12:26:32+00:00, davehart@shiny.ad.hartbrothers.com workaround for HP-UX /usr/include/machine/sys/getppdp.h gcc4 break. configure.ac@1.484 +61 -26 workaround for HP-UX /usr/include/machine/sys/getppdp.h gcc4 break. sntp/configure.ac@1.36 +49 -1 workaround for HP-UX /usr/include/machine/sys/getppdp.h gcc4 break. ChangeSet@1.2257.1.2, 2010-11-23 09:49:49+00:00, davehart@shiny.ad.hartbrothers.com correct m4 quoting to quiet autoreconf warnings enable ./bootstrap --force bootstrap@1.35 +4 -2 enable ./bootstrap --force configure.ac@1.483 +17 -14 correct m4 quoting to quiet autoreconf warnings m4/ntp_openssl.m4@1.3 +7 -7 correct m4 quoting to quiet autoreconf warnings sntp/configure.ac@1.35 +11 -8 correct m4 quoting to quiet autoreconf warnings ChangeSet@1.2255.1.4, 2010-11-23 03:54:56+00:00, hart@psp-fb1.ntp.org build: Do not skip configure if it is newer than config.status build@1.35 +7 -3 Do not skip configure if it is newer than config.status ChangeSet@1.2255.1.3, 2010-11-22 22:54:53+00:00, davehart@shiny.ad.hartbrothers.com Reduce bootstrap redundancy with autoreconf --no-recursive in the top level, followed by recursive autoreconf in sntp. bootstrap@1.34 +2 -1 Reduce bootstrap redundancy with autoreconf --no-recursive in the top level, followed by recursive autoreconf in sntp. ChangeSet@1.2255.1.2, 2010-11-22 07:03:31+00:00, davehart@shiny.ad.hartbrothers.com BBF to the rescue finding typos in #ifdef'd code ntpd/ntp_io.c@1.318 +1 -1 BBF to the rescue finding typos in #ifdef'd code sntp/networking.c@1.40 +2 -1 BBF to the rescue finding typos in #ifdef'd code ChangeSet@1.2255.1.1, 2010-11-22 03:54:12+00:00, davehart@shiny.ad.hartbrothers.com Bump minimum Automake version to 1.11, required for AM_COND_IF use in LIBOPTS_CHECK. ChangeLog@1.684 +3 -1 Bump minimum Automake version to 1.11, required for AM_COND_IF use in LIBOPTS_CHECK. Makefile.am@1.99 +2 -1 bump minimum Automake version to 1.11 for AM_COND_IF support needed by local mod to libopts/m4/libopts.m4 sntp/Makefile.am@1.31.1.1 +2 -1 bump minimum Automake version to 1.11 for AM_COND_IF support needed by local mod to libopts/m4/libopts.m4 ChangeSet@1.2258, 2010-11-21 23:03:15+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1618] jjy_start() unreachable code. refclock_jjy.c Tristate JJY01/02 improvements. html/copyright.html@1.48 +1 -0 Credit refclock_jjy author Takao Abe ntpd/refclock_jjy.c@1.19 +586 -348 [Bug 1618] jjy_start() unreachable code. refclock_jjy.c Tristate JJY01/02 improvements. ChangeSet@1.2257, 2010-11-20 17:18:02-05:00, stenn@deacon.udel.edu hack around a problem building sntp/sntp.html sntp/Makefile.am@1.32 +1 -1 hack around a problem building sntp/sntp.html ChangeSet@1.2256, 2010-11-20 16:54:28-05:00, stenn@deacon.udel.edu Add support for "br-flock -1" br-flock@1.15 +14 -1 Add support for "br-flock -1" ChangeSet@1.2255, 2010-11-20 20:53:00+00:00, davehart@shiny.ad.hartbrothers.com repair make distcheck failure with sntp/libopts/Makefile Makefile.am@1.98 +2 -8 move sntp earlier than libopts users in SUBDIRS, remove sntp/libopts from SUBDIRS, to repair make distcheck with a shared libopts. bootstrap@1.33 +5 -1 once again use workaround of invoking autoreconf in sntp after the top level, to ensure a correct sntp/libopts/Makefile.in. configure.ac@1.482 +1 -1 do not AC_CONFIG_FILES(sntp/libopts/Makefile) sntp/Makefile.am@1.31 +10 -11 remove . from SUBDIRS sntp/libopts/m4/libopts.m4@1.8 +12 -7 add 2nd arg to LIBOPTS_CHECK controlling AC_CONFIG_FILES(libopts/Makefile]) ChangeSet@1.2254, 2010-11-20 02:50:43-05:00, stenn@deacon.udel.edu Remove top-level libopts/ BitKeeper/deleted/.del-COPYING.gplv3~f03d8366c675c284@1.2 +0 -0 Delete: libopts/COPYING.gplv3 BitKeeper/deleted/.del-COPYING.lgplv3~40be4cbf4ae10117@1.2 +0 -0 Delete: libopts/COPYING.lgplv3 BitKeeper/deleted/.del-COPYING.mbsd~a5472d893521969b@1.2 +0 -0 Delete: libopts/COPYING.mbsd BitKeeper/deleted/.del-MakeDefs.inc~c629403b9830e97a@1.2 +0 -0 Delete: libopts/MakeDefs.inc BitKeeper/deleted/.del-Makefile.am~b7467cbc80acbbcc@1.3 +0 -0 Delete: libopts/Makefile.am BitKeeper/deleted/.del-README~5bc90a91ec6411e6@1.3 +0 -0 Delete: libopts/README BitKeeper/deleted/.del-ag-char-map.h~bedbb0c05ab02a70@1.6 +0 -0 Delete: libopts/ag-char-map.h BitKeeper/deleted/.del-autoopts.c~54350751ea38f4a9@1.5 +0 -0 Delete: libopts/autoopts.c BitKeeper/deleted/.del-autoopts.h~56d3d4b1ff6e5a32@1.5 +0 -0 Delete: libopts/autoopts.h BitKeeper/deleted/.del-boolean.c~8e1af2515312893c@1.5 +0 -0 Delete: libopts/boolean.c BitKeeper/deleted/.del-compat.h~7caca4e98e77c39@1.5 +0 -0 Delete: libopts/compat/compat.h BitKeeper/deleted/.del-configfile.c~edfc1b173dd4ca72@1.5 +0 -0 Delete: libopts/configfile.c BitKeeper/deleted/.del-cook.c~a6052eddf9363b9@1.5 +0 -0 Delete: libopts/cook.c BitKeeper/deleted/.del-enumeration.c~95e4ac5ad1bbc51d@1.5 +0 -0 Delete: libopts/enumeration.c BitKeeper/deleted/.del-environment.c~3cd90226bb7b2b17@1.6 +0 -0 Delete: libopts/environment.c BitKeeper/deleted/.del-file.c~67e1b8b29a3953c9@1.5 +0 -0 Delete: libopts/file.c BitKeeper/deleted/.del-genshell.c~3290a02566a5dbb7@1.6 +0 -0 Delete: libopts/genshell.c BitKeeper/deleted/.del-genshell.h~c39a618c8d4061cd@1.6 +0 -0 Delete: libopts/genshell.h BitKeeper/deleted/.del-libopts.c~3ef92daf425d2b@1.2 +0 -0 Delete: libopts/libopts.c BitKeeper/deleted/.del-libopts.m4~93a05c922cf88420@1.6 +0 -0 Delete: libopts/m4/libopts.m4 BitKeeper/deleted/.del-liboptschk.m4~1413f38bcfcfd143@1.5 +0 -0 Delete: libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-load.c~1667134a8de0561c@1.5 +0 -0 Delete: libopts/load.c BitKeeper/deleted/.del-makeshell.c~20cbf9416110166e@1.5 +0 -0 Delete: libopts/makeshell.c BitKeeper/deleted/.del-nested.c~f07a7d9124c8d2aa@1.5 +0 -0 Delete: libopts/nested.c BitKeeper/deleted/.del-numeric.c~2cd8f01381095e42@1.5 +0 -0 Delete: libopts/numeric.c BitKeeper/deleted/.del-options.h~f2e0c23c8e5e59e8@1.6 +0 -0 Delete: libopts/autoopts/options.h BitKeeper/deleted/.del-parse-duration.c~43baef4a99281837@1.2 +0 -0 Delete: libopts/parse-duration.c BitKeeper/deleted/.del-parse-duration.h~17a3a3e1c22145d@1.2 +0 -0 Delete: libopts/parse-duration.h BitKeeper/deleted/.del-pathfind.c~91eee34e6931c147@1.5 +0 -0 Delete: libopts/compat/pathfind.c BitKeeper/deleted/.del-pgusage.c~a31853764946ed10@1.5 +0 -0 Delete: libopts/pgusage.c BitKeeper/deleted/.del-proto.h~f433f2d660b72a7d@1.6 +0 -0 Delete: libopts/proto.h BitKeeper/deleted/.del-putshell.c~1e2cc4a1ffb8fafd@1.5 +0 -0 Delete: libopts/putshell.c BitKeeper/deleted/.del-reset.c~676b344e8e06553d@1.5 +0 -0 Delete: libopts/reset.c BitKeeper/deleted/.del-restore.c~7503fbe1eb367c27@1.5 +0 -0 Delete: libopts/restore.c BitKeeper/deleted/.del-save.c~c7023eeab566cc5a@1.6 +0 -0 Delete: libopts/save.c BitKeeper/deleted/.del-snprintf.c~4020216a304b1fdf@1.2 +0 -0 Delete: libopts/compat/snprintf.c BitKeeper/deleted/.del-sort.c~a0f0aca832b2554c@1.5 +0 -0 Delete: libopts/sort.c BitKeeper/deleted/.del-stack.c~159a2b84f1ceafab@1.5 +0 -0 Delete: libopts/stack.c BitKeeper/deleted/.del-strchr.c~e00f88c19bec996f@1.2 +0 -0 Delete: libopts/compat/strchr.c BitKeeper/deleted/.del-strdup.c~d58e7b55af5b3f83@1.2 +0 -0 Delete: libopts/compat/strdup.c BitKeeper/deleted/.del-streqvcmp.c~59b1ce7223f3432@1.5 +0 -0 Delete: libopts/streqvcmp.c BitKeeper/deleted/.del-text_mmap.c~b601dfb63675456e@1.5 +0 -0 Delete: libopts/text_mmap.c BitKeeper/deleted/.del-time.c~41f39a05ffd762ac@1.5 +0 -0 Delete: libopts/time.c BitKeeper/deleted/.del-tokenize.c~c52b9718bf168782@1.3 +0 -0 Delete: libopts/tokenize.c BitKeeper/deleted/.del-usage-txt.h~ca24f451aac51f1f@1.6 +0 -0 Delete: libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage.c~5148c9dc95efdc1a@1.5 +0 -0 Delete: libopts/usage.c BitKeeper/deleted/.del-value-type.c~eab6702e458dce8d@1.3 +0 -0 Delete: libopts/value-type.c BitKeeper/deleted/.del-value-type.h~8c9e9714f716dd59@1.6 +0 -0 Delete: libopts/value-type.h BitKeeper/deleted/.del-version.c~c1c141f1786ce61c@1.5 +0 -0 Delete: libopts/version.c BitKeeper/deleted/.del-windows-config.h~461ddbe1169c297b@1.5 +0 -0 Delete: libopts/compat/windows-config.h BitKeeper/deleted/.del-xat-attribute.c~8a808fcad835c47f@1.3 +0 -0 Delete: libopts/xat-attribute.c BitKeeper/deleted/.del-xat-attribute.h~7d19c77e5ff1a904@1.6 +0 -0 Delete: libopts/xat-attribute.h ChangeSet@1.2253, 2010-11-20 02:18:46-05:00, stenn@deacon.udel.edu backport the html timestamp fixes for bootstrap bootstrap@1.32 +8 -4 backport the html timestamp fixes for bootstrap ChangeSet@1.2252, 2010-11-20 00:20:40-05:00, stenn@deacon.udel.edu Properly quote the configure.ac LIBOPTS_CHECK argument configure.ac@1.481 +1 -1 Properly quote the configure.ac LIBOPTS_CHECK argument ChangeSet@1.2251, 2010-11-20 00:18:39-05:00, stenn@deacon.udel.edu autogen-5.11.3 upgrade sntp/libopts/Makefile.am@1.5 +3 -3 autogen-5.11.3 upgrade sntp/libopts/ag-char-map.h@1.8 +1 -1 autogen-5.11.3 upgrade sntp/libopts/configfile.c@1.7 +7 -5 autogen-5.11.3 upgrade sntp/libopts/genshell.c@1.8 +1 -1 autogen-5.11.3 upgrade sntp/libopts/genshell.h@1.8 +1 -1 autogen-5.11.3 upgrade sntp/libopts/proto.h@1.8 +1 -1 autogen-5.11.3 upgrade sntp/libopts/value-type.h@1.8 +1 -1 autogen-5.11.3 upgrade sntp/libopts/xat-attribute.h@1.8 +1 -1 autogen-5.11.3 upgrade ChangeSet@1.2250, 2010-11-20 00:16:33-05:00, stenn@deacon.udel.edu autogen upgrade ntpd/ntpd-opts.menu@1.3 +1 -1 autogen upgrade ntpdc/ntpdc-opts.menu@1.3 +3 -3 autogen upgrade ntpq/ntpq-opts.menu@1.3 +3 -3 autogen upgrade ntpsnmpd/ntpsnmpd-opts.menu@1.3 +24 -2 autogen upgrade sntp/sntp-opts.menu@1.3 +56 -1 autogen upgrade util/ntp-keygen-opts.menu@1.3 +4 -4 autogen upgrade ChangeSet@1.2249, 2010-11-20 00:14:13-05:00, stenn@deacon.udel.edu autogen upgrade ntpd/ntpd-opts.c@1.275 +142 -140 autogen upgrade ntpd/ntpd-opts.h@1.275 +20 -22 autogen upgrade ntpd/ntpd-opts.texi@1.273 +0 -583 autogen upgrade ntpd/ntpd.1@1.273 +2 -2 autogen upgrade ntpdc/ntpdc-opts.c@1.271 +74 -71 autogen upgrade ntpdc/ntpdc-opts.h@1.271 +20 -22 autogen upgrade ntpdc/ntpdc-opts.texi@1.270 +0 -271 autogen upgrade ntpdc/ntpdc.1@1.270 +2 -2 autogen upgrade ntpq/ntpq-opts.c@1.272 +72 -67 autogen upgrade ntpq/ntpq-opts.h@1.272 +20 -22 autogen upgrade ntpq/ntpq-opts.texi@1.271 +0 -226 autogen upgrade ntpq/ntpq.1@1.271 +2 -2 autogen upgrade ntpsnmpd/ntpsnmpd-opts.c@1.151 +54 -51 autogen upgrade ntpsnmpd/ntpsnmpd-opts.h@1.151 +20 -22 autogen upgrade ntpsnmpd/ntpsnmpd-opts.texi@1.151 +0 -78 autogen upgrade ntpsnmpd/ntpsnmpd.1@1.150 +2 -2 autogen upgrade sntp/sntp-opts.c@1.144 +80 -77 autogen upgrade sntp/sntp-opts.h@1.144 +20 -22 autogen upgrade sntp/sntp-opts.texi@1.144 +0 -213 autogen upgrade sntp/sntp.1@1.144 +2 -2 autogen upgrade sntp/sntp.html@1.34 +61 -5 autogen upgrade util/ntp-keygen-opts.c@1.274 +98 -105 autogen upgrade util/ntp-keygen-opts.h@1.274 +20 -22 autogen upgrade util/ntp-keygen-opts.texi@1.273 +0 -358 autogen upgrade util/ntp-keygen.1@1.273 +2 -2 autogen upgrade ChangeSet@1.2248, 2010-11-19 23:29:22-05:00, stenn@psp-deb1.ntp.org Update generated .menu files ntpd/ntpd-opts.menu@1.2 +122 -1 Update generated .menu files ntpdc/ntpdc-opts.menu@1.2 +122 -1 Update generated .menu files ntpq/ntpq-opts.menu@1.2 +96 -1 Update generated .menu files ntpsnmpd/ntpsnmpd-opts.menu@1.2 +34 -1 Update generated .menu files util/ntp-keygen-opts.menu@1.2 +94 -1 Update generated .menu files ChangeSet@1.2247, 2010-11-19 23:27:51-05:00, stenn@psp-deb1.ntp.org Use the new autoopts no-misuse-usage keyword include/copyright.def@1.12 +1 -0 Use the new autoopts no-misuse-usage keyword ChangeSet@1.2246, 2010-11-19 23:26:17-05:00, stenn@psp-deb1.ntp.org Upgrade libopts to 33.3.8 and autogen to 5.11.3 ChangeLog@1.683 +2 -0 Use a single copy of libopts/, in sntp/ Makefile.am@1.97 +11 -15 Use a single copy of libopts/, in sntp/ configure.ac@1.480 +1 -1 Use a single copy of libopts/, in sntp/ deps-ver@1.2 +1 -1 Use a single copy of libopts/, in sntp/ sntp/libopts/COPYING.gplv3@1.3 +1 -1 libopts-33.3.8 sntp/libopts/COPYING.lgplv3@1.3 +1 -1 libopts-33.3.8 sntp/libopts/Makefile.am@1.4 +5 -5 libopts-33.3.8 sntp/libopts/README@1.4 +1 -1 libopts-33.3.8 sntp/libopts/ag-char-map.h@1.7 +89 -57 libopts-33.3.8 sntp/libopts/autoopts.c@1.6 +84 -83 libopts-33.3.8 sntp/libopts/autoopts.h@1.6 +24 -21 libopts-33.3.8 sntp/libopts/autoopts/options.h@1.7 +48 -44 libopts-33.3.8 sntp/libopts/autoopts/usage-txt.h@1.7 +151 -144 libopts-33.3.8 sntp/libopts/boolean.c@1.6 +5 -4 libopts-33.3.8 sntp/libopts/compat/compat.h@1.6 +4 -5 libopts-33.3.8 sntp/libopts/compat/pathfind.c@1.6 +1 -4 libopts-33.3.8 sntp/libopts/compat/windows-config.h@1.6 +2 -3 libopts-33.3.8 sntp/libopts/configfile.c@1.6 +242 -219 libopts-33.3.8 sntp/libopts/cook.c@1.6 +5 -5 libopts-33.3.8 sntp/libopts/enumeration.c@1.6 +145 -140 libopts-33.3.8 sntp/libopts/environment.c@1.7 +27 -24 libopts-33.3.8 sntp/libopts/file.c@1.6 +5 -4 libopts-33.3.8 sntp/libopts/genshell.c@1.7 +36 -35 libopts-33.3.8 sntp/libopts/genshell.h@1.7 +20 -22 libopts-33.3.8 sntp/libopts/load.c@1.6 +47 -65 libopts-33.3.8 sntp/libopts/m4/libopts.m4@1.7 +48 -46 libopts-33.3.8 sntp/libopts/m4/liboptschk.m4@1.6 +2 -2 libopts-33.3.8 sntp/libopts/makeshell.c@1.6 +203 -188 libopts-33.3.8 sntp/libopts/nested.c@1.6 +116 -136 libopts-33.3.8 sntp/libopts/numeric.c@1.6 +5 -4 libopts-33.3.8 sntp/libopts/parse-duration.c@1.3 +2 -2 libopts-33.3.8 sntp/libopts/parse-duration.h@1.3 +9 -1 libopts-33.3.8 sntp/libopts/pgusage.c@1.6 +19 -18 libopts-33.3.8 sntp/libopts/proto.h@1.7 +20 -17 libopts-33.3.8 sntp/libopts/putshell.c@1.6 +179 -127 libopts-33.3.8 sntp/libopts/reset.c@1.6 +5 -4 libopts-33.3.8 sntp/libopts/restore.c@1.6 +20 -19 libopts-33.3.8 sntp/libopts/save.c@1.7 +77 -77 libopts-33.3.8 sntp/libopts/sort.c@1.6 +35 -35 libopts-33.3.8 sntp/libopts/stack.c@1.6 +19 -19 libopts-33.3.8 sntp/libopts/streqvcmp.c@1.6 +13 -12 libopts-33.3.8 sntp/libopts/text_mmap.c@1.6 +31 -31 libopts-33.3.8 sntp/libopts/time.c@1.6 +7 -6 libopts-33.3.8 sntp/libopts/tokenize.c@1.4 +117 -105 libopts-33.3.8 sntp/libopts/usage.c@1.6 +299 -196 libopts-33.3.8 sntp/libopts/value-type.c@1.4 +4 -1 libopts-33.3.8 sntp/libopts/value-type.h@1.7 +1 -1 libopts-33.3.8 sntp/libopts/version.c@1.6 +32 -28 libopts-33.3.8 sntp/libopts/xat-attribute.c@1.4 +4 -1 libopts-33.3.8 sntp/libopts/xat-attribute.h@1.7 +1 -1 libopts-33.3.8 ChangeSet@1.2245, 2010-11-18 05:09:05+00:00, davehart@shiny.ad.hartbrothers.com convert Windows build to share single sntp/libopts ports/winnt/vc6/libntp.dsp@1.53 +3 -3 convert Windows build to share single sntp/libopts ports/winnt/vc6/ntpd.dsp@1.43 +4 -4 convert Windows build to share single sntp/libopts ports/winnt/vc6/ntpdc.dsp@1.29 +2 -2 convert Windows build to share single sntp/libopts ports/winnt/vc6/ntpkeygen.dsp@1.21 +2 -2 convert Windows build to share single sntp/libopts ports/winnt/vc6/ntpq.dsp@1.30 +2 -2 convert Windows build to share single sntp/libopts ports/winnt/vs2003/libntp.vcproj@1.8 +3 -3 convert Windows build to share single sntp/libopts ports/winnt/vs2003/ntpd.vcproj@1.6 +3 -3 convert Windows build to share single sntp/libopts ports/winnt/vs2003/ntpdc.vcproj@1.5 +2 -2 convert Windows build to share single sntp/libopts ports/winnt/vs2003/ntpkeygen.vcproj@1.4 +2 -2 convert Windows build to share single sntp/libopts ports/winnt/vs2003/ntpq.vcproj@1.5 +2 -2 convert Windows build to share single sntp/libopts ports/winnt/vs2005/libntp.vcproj@1.8 +3 -3 convert Windows build to share single sntp/libopts ports/winnt/vs2005/ntpd.vcproj@1.6 +3 -3 convert Windows build to share single sntp/libopts ports/winnt/vs2005/ntpdc.vcproj@1.5 +2 -2 convert Windows build to share single sntp/libopts ports/winnt/vs2005/ntpkeygen.vcproj@1.4 +2 -2 convert Windows build to share single sntp/libopts ports/winnt/vs2005/ntpq.vcproj@1.5 +2 -2 convert Windows build to share single sntp/libopts ports/winnt/vs2008/libntp/libntp.vcproj@1.26 +4 -4 convert Windows build to share single sntp/libopts ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.10 +2 -2 convert Windows build to share single sntp/libopts ports/winnt/vs2008/ntpd/ntpd.vcproj@1.24 +3 -3 convert Windows build to share single sntp/libopts ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.13 +2 -2 convert Windows build to share single sntp/libopts ports/winnt/vs2008/ntpq/ntpq.vcproj@1.12 +2 -2 convert Windows build to share single sntp/libopts ChangeSet@1.2239.1.1, 2010-11-15 23:53:16-05:00, stenn@deacon.udel.edu [Bug 1728] In ntp_openssl.m4, don't add -I/usr/include or -L/usr/lib to CPPFLAGS or LDFLAGS ChangeLog@1.679.1.1 +5 -0 [Bug 1728] In ntp_openssl.m4, don't add -I/usr/include or -L/usr/lib to CPPFLAGS or LDFLAGS m4/ntp_openssl.m4@1.2 +12 -4 [Bug 1728] In ntp_openssl.m4, don't add -I/usr/include or -L/usr/lib to CPPFLAGS or LDFLAGS ChangeSet@1.2243, 2010-11-16 00:53:57+00:00, davehart@shiny.ad.hartbrothers.com correct tests for link-local (fe80) and site-local (fec0) unicast IPv6 addresses in selecting default multicast source addresses. ntpd/ntp_io.c@1.317 +19 -18 correct tests for link-local (fe80) and site-local (fec0) unicast IPv6 addresses in selecting default multicast source addresses. ChangeSet@1.2242, 2010-11-15 22:39:31+00:00, davehart@shiny.ad.hartbrothers.com Remove log_msg() and debug_msg() from sntp in favor of msyslog(). ChangeLog@1.681 +1 -0 Remove log_msg() and debug_msg() from sntp in favor of msyslog(). sntp/log.c@1.15 +0 -19 Remove log_msg() and debug_msg() from sntp in favor of msyslog(). sntp/log.h@1.10 +0 -3 Remove log_msg() and debug_msg() from sntp in favor of msyslog(). sntp/main.c@1.31 +6 -11 Remove log_msg() and debug_msg() from sntp in favor of msyslog(). ChangeSet@1.2241, 2010-11-15 20:09:00+00:00, davehart@shiny.ad.hartbrothers.com Do not send multicast from both link-local and global addresses on the same underlying network interface. ntpd/ntp_io.c@1.316 +74 -32 Do not send multicast from both link-local and global addresses on the same underlying network interface. ChangeSet@1.2240, 2010-11-15 18:24:32+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1725] ntpd sends multicast from only one address. ChangeLog@1.680 +4 -0 [Bug 1725] ntpd sends multicast from only one address. include/ntp.h@1.171 +29 -23 [Bug 1725] ntpd sends multicast from only one address. begin changing internal references from "struct interface" to "endpt" include/ntpd.h@1.139 +9 -9 [Bug 1725] ntpd sends multicast from only one address. begin changing internal references from "struct interface" to "endpt" ntpd/ntp_config.c@1.248 +2 -3 use ZERO_SOCK() in two places ntpd/ntp_io.c@1.315 +320 -283 [Bug 1725] ntpd sends multicast from only one address. begin changing internal references from "struct interface" to "endpt" ntpd/ntp_peer.c@1.127 +62 -69 refactor select_peerinterface() to reduce duplication, indents reduce #ifdef WINNT clutter ntpd/ntp_request.c@1.85 +21 -21 [Bug 1725] ntpd sends multicast from only one address. begin changing internal references from "struct interface" to "endpt" ports/winnt/include/ntp_iocompletionport.h@1.18 +1 -2 reduce sendpkt() ifdefs around sendto() ports/winnt/ntpd/ntp_iocompletionport.c@1.50 +34 -32 reduce sendpkt() ifdefs around sendto() ports/winnt/ntpd/ntservice.c@1.23 +3 -3 reduce #ifdef WINNT clutter ChangeSet@1.2239, 2010-11-14 08:56:20+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_RC10 TAG: NTP_4_2_6P3_RC10 ChangeLog@1.679 +1 -0 NTP_4_2_6P3_RC10 ntpd/ntpd-opts.c@1.274 +2 -2 NTP_4_2_6P3_RC10 ntpd/ntpd-opts.h@1.274 +3 -3 NTP_4_2_6P3_RC10 ntpd/ntpd-opts.texi@1.272 +2 -2 NTP_4_2_6P3_RC10 ntpd/ntpd.1@1.272 +2 -2 NTP_4_2_6P3_RC10 ntpdc/ntpdc-opts.c@1.270 +2 -2 NTP_4_2_6P3_RC10 ntpdc/ntpdc-opts.h@1.270 +3 -3 NTP_4_2_6P3_RC10 ntpdc/ntpdc-opts.texi@1.269 +2 -2 NTP_4_2_6P3_RC10 ntpdc/ntpdc.1@1.269 +2 -2 NTP_4_2_6P3_RC10 ntpq/ntpq-opts.c@1.271 +2 -2 NTP_4_2_6P3_RC10 ntpq/ntpq-opts.h@1.271 +3 -3 NTP_4_2_6P3_RC10 ntpq/ntpq-opts.texi@1.270 +2 -2 NTP_4_2_6P3_RC10 ntpq/ntpq.1@1.270 +2 -2 NTP_4_2_6P3_RC10 ntpsnmpd/ntpsnmpd-opts.c@1.150 +2 -2 NTP_4_2_6P3_RC10 ntpsnmpd/ntpsnmpd-opts.h@1.150 +3 -3 NTP_4_2_6P3_RC10 ntpsnmpd/ntpsnmpd-opts.texi@1.150 +2 -2 NTP_4_2_6P3_RC10 ntpsnmpd/ntpsnmpd.1@1.149 +2 -2 NTP_4_2_6P3_RC10 packageinfo.sh@1.289 +1 -1 NTP_4_2_6P3_RC10 sntp/sntp-opts.c@1.143 +3 -3 NTP_4_2_6P3_RC10 sntp/sntp-opts.h@1.143 +3 -3 NTP_4_2_6P3_RC10 sntp/sntp-opts.texi@1.143 +2 -2 NTP_4_2_6P3_RC10 sntp/sntp.1@1.143 +3 -5 NTP_4_2_6P3_RC10 sntp/sntp.html@1.33 +1 -1 NTP_4_2_6P3_RC10 util/ntp-keygen-opts.c@1.273 +2 -2 NTP_4_2_6P3_RC10 util/ntp-keygen-opts.h@1.273 +3 -3 NTP_4_2_6P3_RC10 util/ntp-keygen-opts.texi@1.272 +2 -2 NTP_4_2_6P3_RC10 util/ntp-keygen.1@1.272 +2 -2 NTP_4_2_6P3_RC10 ChangeSet@1.2238, 2010-11-14 03:23:12-05:00, stenn@deacon.udel.edu Update NEWS file for changes thru RC10 NEWS@1.112 +24 -15 Update NEWS file for changes thru RC10 ChangeSet@1.2237, 2010-11-14 07:00:29+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1681] More sntp logging cleanup. ChangeLog@1.678 +1 -0 [Bug 1681] More sntp logging cleanup. include/ntp_syslog.h@1.4 +3 -1 expose msyslog_term flag to duplicate msyslog() output to stdout/stderr libntp/msyslog.c@1.25 +52 -38 expose msyslog_term flag to duplicate msyslog() output to stdout/stderr sntp/crypto.c@1.15 +2 -24 [Bug 1681] More sntp logging cleanup. sntp/kod_management.c@1.19 +11 -35 [Bug 1681] More sntp logging cleanup. sntp/log.c@1.14 +39 -44 [Bug 1681] More sntp logging cleanup. sntp/log.h@1.9 +15 -6 [Bug 1681] More sntp logging cleanup. sntp/main.c@1.30 +34 -39 [Bug 1681] More sntp logging cleanup. sntp/main.h@1.2 +0 -1 move config.h include to main.c for consistency and because it has no multiple-inclusion guard. sntp/networking.c@1.39 +14 -14 [Bug 1681] More sntp logging cleanup. sntp/sntp-opts.def@1.16 +2 -4 update RFC status sntp/sntp.c@1.2 +2 -1 #include first ChangeSet@1.2236, 2010-11-11 19:20:40+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1683] Non-localhost on loopback exempted from nic rules. ChangeLog@1.677 +4 -0 [Bug 1683] Non-localhost on loopback exempted from nic rules. include/ntp.h@1.170 +1 -1 nail down size of struct interface.flags to 32 bits. include/ntp_io.h@1.14 +1 -1 [Bug 1683] Non-localhost on loopback exempted from nic rules. ntpd/ntp_config.c@1.247 +13 -11 [Bug 1683] Non-localhost on loopback exempted from nic rules. ntpd/ntp_io.c@1.314 +72 -58 [Bug 1683] Non-localhost on loopback exempted from nic rules. ntpd/ntpd.c@1.111 +3 -3 [Bug 1683] Non-localhost on loopback exempted from nic rules. ChangeSet@1.2235, 2010-11-10 03:48:21+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_RC9 TAG: NTP_4_2_6P3_RC9 ChangeLog@1.676 +1 -0 NTP_4_2_6P3_RC9 ntpd/ntpd-opts.c@1.273 +2 -2 NTP_4_2_6P3_RC9 ntpd/ntpd-opts.h@1.273 +3 -3 NTP_4_2_6P3_RC9 ntpd/ntpd-opts.texi@1.271 +2 -2 NTP_4_2_6P3_RC9 ntpd/ntpd.1@1.271 +2 -2 NTP_4_2_6P3_RC9 ntpdc/ntpdc-opts.c@1.269 +2 -2 NTP_4_2_6P3_RC9 ntpdc/ntpdc-opts.h@1.269 +3 -3 NTP_4_2_6P3_RC9 ntpdc/ntpdc-opts.texi@1.268 +2 -2 NTP_4_2_6P3_RC9 ntpdc/ntpdc.1@1.268 +2 -2 NTP_4_2_6P3_RC9 ntpq/ntpq-opts.c@1.270 +2 -2 NTP_4_2_6P3_RC9 ntpq/ntpq-opts.h@1.270 +3 -3 NTP_4_2_6P3_RC9 ntpq/ntpq-opts.texi@1.269 +2 -2 NTP_4_2_6P3_RC9 ntpq/ntpq.1@1.269 +2 -2 NTP_4_2_6P3_RC9 ntpsnmpd/ntpsnmpd-opts.c@1.149 +2 -2 NTP_4_2_6P3_RC9 ntpsnmpd/ntpsnmpd-opts.h@1.149 +3 -3 NTP_4_2_6P3_RC9 ntpsnmpd/ntpsnmpd-opts.texi@1.149 +2 -2 NTP_4_2_6P3_RC9 ntpsnmpd/ntpsnmpd.1@1.148 +2 -2 NTP_4_2_6P3_RC9 packageinfo.sh@1.288 +1 -1 NTP_4_2_6P3_RC9 sntp/sntp-opts.c@1.142 +2 -2 NTP_4_2_6P3_RC9 sntp/sntp-opts.h@1.142 +3 -3 NTP_4_2_6P3_RC9 sntp/sntp-opts.texi@1.142 +1 -1 NTP_4_2_6P3_RC9 sntp/sntp.1@1.142 +2 -2 NTP_4_2_6P3_RC9 sntp/sntp.html@1.32 +1 -1 NTP_4_2_6P3_RC9 util/ntp-keygen-opts.c@1.272 +2 -2 NTP_4_2_6P3_RC9 util/ntp-keygen-opts.h@1.272 +3 -3 NTP_4_2_6P3_RC9 util/ntp-keygen-opts.texi@1.271 +2 -2 NTP_4_2_6P3_RC9 util/ntp-keygen.1@1.271 +2 -2 NTP_4_2_6P3_RC9 ChangeSet@1.2234, 2010-11-09 22:07:27-05:00, stenn@deacon.udel.edu Backport sntp from -dev ChangeLog@1.675 +1 -0 Backport sntp from -dev ChangeSet@1.2233, 2010-11-10 02:29:39+00:00, davehart@shiny.ad.hartbrothers.com Backport sntp changes from -dev m4/ntp_lib_m.m4@1.1 +16 -0 Backport sntp changes from -dev m4/ntp_lib_m.m4@1.0 +0 -0 sntp/Makefile.am@1.30 +3 -1 Backport sntp changes from -dev sntp/configure.ac@1.34 +1 -0 Backport sntp changes from -dev sntp/crypto.c@1.14 +1 -0 Backport sntp changes from -dev sntp/header.h@1.5 +1 -1 Backport sntp changes from -dev sntp/kod_management.c@1.18 +2 -1 Backport sntp changes from -dev sntp/log.c@1.13 +3 -2 Backport sntp changes from -dev sntp/main.c@1.29 +191 -166 Backport sntp changes from -dev sntp/main.h@1.1 +29 -0 Backport sntp changes from -dev sntp/main.h@1.0 +0 -0 sntp/networking.c@1.38 +22 -20 Backport sntp changes from -dev sntp/networking.h@1.19 +13 -3 Backport sntp changes from -dev sntp/sntp.c@1.1 +13 -0 Backport sntp changes from -dev sntp/sntp.c@1.0 +0 -0 sntp/utilities.c@1.12 +14 -14 Backport sntp changes from -dev ChangeSet@1.2225.4.1, 2010-11-09 16:50:10-05:00, stenn@deacon.udel.edu [Bug 1692] packageinfo.sh needs to be "sourced" using ./ ChangeLog@1.668.4.1 +4 -0 [Bug 1692] packageinfo.sh needs to be "sourced" using ./ scripts/checkChangeLog@1.2 +1 -1 [Bug 1692] packageinfo.sh needs to be "sourced" using ./ scripts/genCommitLog@1.6 +1 -1 [Bug 1692] packageinfo.sh needs to be "sourced" using ./ ChangeSet@1.2231, 2010-11-09 06:01:12+00:00, davehart@shiny.ad.hartbrothers.com Correct missing leading zeros in sntp tv_usec display from tv_to_str(). sntp/utilities.c@1.11 +1 -1 Correct missing leading zeros in sntp tv_usec display from tv_to_str(). ChangeSet@1.2230, 2010-11-09 05:52:27+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1681] sntp logging cleanup. ChangeLog@1.673 +1 -0 [Bug 1681] sntp logging cleanup. sntp/kod_management.c@1.17 +4 -4 [Bug 1681] sntp logging cleanup. sntp/log.c@1.12 +3 -18 [Bug 1681] sntp logging cleanup. sntp/log.h@1.8 +1 -1 [Bug 1681] sntp logging cleanup. sntp/main.c@1.28 +4 -4 [Bug 1681] sntp logging cleanup. sntp/networking.c@1.37 +1 -1 [Bug 1681] sntp logging cleanup. ChangeSet@1.2227, 2010-11-09 04:40:06+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1691] Use first NMEA sentence each second. -- applies to prior cset ChangeLog@1.668.3.1 +4 -0 [Bug 1691] Use first NMEA sentence each second. ChangeSet@1.2225.3.1, 2010-11-09 04:26:03+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1709] ntpdate ignores replies with equal receive and transmit timestamps. ChangeLog@1.668.2.1 +5 -0 [Bug 1709] ntpdate ignores replies with equal receive and transmit timestamps. ntpdate/ntpdate.c@1.71 +1 -2 [Bug 1709] ntpdate ignores replies with equal receive and transmit timestamps. ChangeSet@1.2225.2.1, 2010-11-09 03:52:20+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1574] sntp:set_time doesn't set tv_usec correctly. ChangeLog@1.668.1.1 +4 -0 [Bug 1574] sntp:set_time doesn't set tv_usec correctly. sntp/main.c@1.27 +23 -8 [Bug 1574] sntp:set_time doesn't set tv_usec correctly. ChangeSet@1.2225.1.1, 2010-11-09 03:14:33+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1683] Interface binding does not seem to work as intended. ChangeLog@1.669 +4 -0 [Bug 1683] Interface binding does not seem to work as intended. include/ntp_machine.h@1.27 +3 -0 add socket_errno() to reduce #ifdef clutter ntpd/ntp_io.c@1.313 +175 -125 [Bug 1683] Interface binding does not seem to work as intended. ChangeSet@1.2226, 2010-11-01 00:22:07+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1691] Use first NMEA sentence each second. ntpd/refclock_nmea.c@1.56 +26 -9 [Bug 1691] Use first NMEA sentence each second. ChangeSet@1.2225, 2010-10-29 04:44:28-04:00, stenn@deacon.udel.edu checkChangeLog fix for Makefile.am Makefile.am@1.96 +1 -1 checkChangeLog fix for Makefile.am ChangeSet@1.2224, 2010-10-29 08:25:39+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_RC8 TAG: NTP_4_2_6P3_RC8 ChangeLog@1.668 +1 -0 NTP_4_2_6P3_RC8 ntpd/ntpd-opts.c@1.272 +2 -2 NTP_4_2_6P3_RC8 ntpd/ntpd-opts.h@1.272 +3 -3 NTP_4_2_6P3_RC8 ntpd/ntpd-opts.texi@1.270 +2 -2 NTP_4_2_6P3_RC8 ntpd/ntpd.1@1.270 +2 -2 NTP_4_2_6P3_RC8 ntpdc/ntpdc-opts.c@1.268 +2 -2 NTP_4_2_6P3_RC8 ntpdc/ntpdc-opts.h@1.268 +3 -3 NTP_4_2_6P3_RC8 ntpdc/ntpdc-opts.texi@1.267 +2 -2 NTP_4_2_6P3_RC8 ntpdc/ntpdc.1@1.267 +2 -2 NTP_4_2_6P3_RC8 ntpq/ntpq-opts.c@1.269 +2 -2 NTP_4_2_6P3_RC8 ntpq/ntpq-opts.h@1.269 +3 -3 NTP_4_2_6P3_RC8 ntpq/ntpq-opts.texi@1.268 +2 -2 NTP_4_2_6P3_RC8 ntpq/ntpq.1@1.268 +2 -2 NTP_4_2_6P3_RC8 ntpsnmpd/ntpsnmpd-opts.c@1.148 +2 -2 NTP_4_2_6P3_RC8 ntpsnmpd/ntpsnmpd-opts.h@1.148 +3 -3 NTP_4_2_6P3_RC8 ntpsnmpd/ntpsnmpd-opts.texi@1.148 +2 -2 NTP_4_2_6P3_RC8 ntpsnmpd/ntpsnmpd.1@1.147 +2 -2 NTP_4_2_6P3_RC8 packageinfo.sh@1.287 +1 -1 NTP_4_2_6P3_RC8 sntp/sntp-opts.c@1.141 +2 -2 NTP_4_2_6P3_RC8 sntp/sntp-opts.h@1.141 +3 -3 NTP_4_2_6P3_RC8 sntp/sntp-opts.texi@1.141 +1 -1 NTP_4_2_6P3_RC8 sntp/sntp.1@1.141 +2 -2 NTP_4_2_6P3_RC8 sntp/sntp.html@1.31 +1 -1 NTP_4_2_6P3_RC8 util/ntp-keygen-opts.c@1.271 +2 -2 NTP_4_2_6P3_RC8 util/ntp-keygen-opts.h@1.271 +3 -3 NTP_4_2_6P3_RC8 util/ntp-keygen-opts.texi@1.270 +2 -2 NTP_4_2_6P3_RC8 util/ntp-keygen.1@1.270 +2 -2 NTP_4_2_6P3_RC8 ChangeSet@1.2223, 2010-10-29 04:13:47-04:00, stenn@deacon.udel.edu First cut at using scripts/checkChangeLog ChangeLog@1.667 +1 -0 First cut at using scripts/checkChangeLog Makefile.am@1.95 +5 -0 First cut at using scripts/checkChangeLog ChangeSet@1.2222, 2010-10-29 03:39:15-04:00, stenn@psp-deb1.ntp.org typo ChangeLog@1.666 +1 -1 typo ChangeSet@1.2221, 2010-10-28 18:07:23+00:00, hart@psp-os1.ntp.org for perlinger, [Bug 1685] ChangeLog@1.665 +4 -0 for perlinger, [Bug 1685] ntpd/refclock_nmea.c@1.55 +2 -1 for perlinger, [Bug 1685] ChangeSet@1.2220, 2010-10-25 07:49:22+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_RC7 TAG: NTP_4_2_6P3_RC7 ChangeLog@1.664 +1 -0 NTP_4_2_6P3_RC7 ntpd/ntpd-opts.c@1.271 +2 -2 NTP_4_2_6P3_RC7 ntpd/ntpd-opts.h@1.271 +3 -3 NTP_4_2_6P3_RC7 ntpd/ntpd-opts.texi@1.269 +2 -2 NTP_4_2_6P3_RC7 ntpd/ntpd.1@1.269 +2 -2 NTP_4_2_6P3_RC7 ntpdc/ntpdc-opts.c@1.267 +2 -2 NTP_4_2_6P3_RC7 ntpdc/ntpdc-opts.h@1.267 +3 -3 NTP_4_2_6P3_RC7 ntpdc/ntpdc-opts.texi@1.266 +2 -2 NTP_4_2_6P3_RC7 ntpdc/ntpdc.1@1.266 +2 -2 NTP_4_2_6P3_RC7 ntpq/ntpq-opts.c@1.268 +2 -2 NTP_4_2_6P3_RC7 ntpq/ntpq-opts.h@1.268 +3 -3 NTP_4_2_6P3_RC7 ntpq/ntpq-opts.texi@1.267 +2 -2 NTP_4_2_6P3_RC7 ntpq/ntpq.1@1.267 +2 -2 NTP_4_2_6P3_RC7 ntpsnmpd/ntpsnmpd-opts.c@1.147 +2 -2 NTP_4_2_6P3_RC7 ntpsnmpd/ntpsnmpd-opts.h@1.147 +3 -3 NTP_4_2_6P3_RC7 ntpsnmpd/ntpsnmpd-opts.texi@1.147 +2 -2 NTP_4_2_6P3_RC7 ntpsnmpd/ntpsnmpd.1@1.146 +2 -2 NTP_4_2_6P3_RC7 packageinfo.sh@1.286 +1 -1 NTP_4_2_6P3_RC7 sntp/sntp-opts.c@1.140 +2 -2 NTP_4_2_6P3_RC7 sntp/sntp-opts.h@1.140 +3 -3 NTP_4_2_6P3_RC7 sntp/sntp-opts.texi@1.140 +1 -1 NTP_4_2_6P3_RC7 sntp/sntp.1@1.140 +2 -2 NTP_4_2_6P3_RC7 sntp/sntp.html@1.30 +1 -1 NTP_4_2_6P3_RC7 util/ntp-keygen-opts.c@1.270 +2 -2 NTP_4_2_6P3_RC7 util/ntp-keygen-opts.h@1.270 +3 -3 NTP_4_2_6P3_RC7 util/ntp-keygen-opts.texi@1.269 +2 -2 NTP_4_2_6P3_RC7 util/ntp-keygen.1@1.269 +2 -2 NTP_4_2_6P3_RC7 ChangeSet@1.2219, 2010-10-25 03:26:31-04:00, stenn@deacon.udel.edu Added scripts/checkChangeLog ChangeLog@1.663 +4 -3 Added scripts/checkChangeLog scripts/Makefile.am@1.19 +1 -0 Added scripts/checkChangeLog scripts/checkChangeLog@1.1 +28 -0 BitKeeper file /deacon/backroom/ntp-stable/scripts/checkChangeLog scripts/checkChangeLog@1.0 +0 -0 ChangeSet@1.2218, 2010-10-24 06:17:47-04:00, perlinger@psp-deb1.ntp.org [Bug 1676] fixed in refclock_nmea (GPGLL did not work after fix 1571) ChangeLog@1.662 +4 -0 [Bug 1676] fixed in refclock_nmea (GPGLL did not work after fix 1571) ntpd/refclock_nmea.c@1.54 +1 -1 fixed cut&paste error that lead to bug 1676 ChangeSet@1.2217, 2010-10-24 06:40:26+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_RC6 TAG: NTP_4_2_6P3_RC6 ChangeLog@1.661 +1 -0 NTP_4_2_6P3_RC6 ntpd/ntpd-opts.c@1.270 +2 -2 NTP_4_2_6P3_RC6 ntpd/ntpd-opts.h@1.270 +3 -3 NTP_4_2_6P3_RC6 ntpd/ntpd-opts.texi@1.268 +2 -2 NTP_4_2_6P3_RC6 ntpd/ntpd.1@1.268 +2 -2 NTP_4_2_6P3_RC6 ntpdc/ntpdc-opts.c@1.266 +2 -2 NTP_4_2_6P3_RC6 ntpdc/ntpdc-opts.h@1.266 +3 -3 NTP_4_2_6P3_RC6 ntpdc/ntpdc-opts.texi@1.265 +2 -2 NTP_4_2_6P3_RC6 ntpdc/ntpdc.1@1.265 +2 -2 NTP_4_2_6P3_RC6 ntpq/ntpq-opts.c@1.267 +2 -2 NTP_4_2_6P3_RC6 ntpq/ntpq-opts.h@1.267 +3 -3 NTP_4_2_6P3_RC6 ntpq/ntpq-opts.texi@1.266 +2 -2 NTP_4_2_6P3_RC6 ntpq/ntpq.1@1.266 +2 -2 NTP_4_2_6P3_RC6 ntpsnmpd/ntpsnmpd-opts.c@1.146 +2 -2 NTP_4_2_6P3_RC6 ntpsnmpd/ntpsnmpd-opts.h@1.146 +3 -3 NTP_4_2_6P3_RC6 ntpsnmpd/ntpsnmpd-opts.texi@1.146 +2 -2 NTP_4_2_6P3_RC6 ntpsnmpd/ntpsnmpd.1@1.145 +2 -2 NTP_4_2_6P3_RC6 packageinfo.sh@1.285 +1 -1 NTP_4_2_6P3_RC6 sntp/sntp-opts.c@1.139 +2 -2 NTP_4_2_6P3_RC6 sntp/sntp-opts.h@1.139 +3 -3 NTP_4_2_6P3_RC6 sntp/sntp-opts.texi@1.139 +1 -1 NTP_4_2_6P3_RC6 sntp/sntp.1@1.139 +2 -2 NTP_4_2_6P3_RC6 sntp/sntp.html@1.29 +1 -1 NTP_4_2_6P3_RC6 util/ntp-keygen-opts.c@1.269 +2 -2 NTP_4_2_6P3_RC6 util/ntp-keygen-opts.h@1.269 +3 -3 NTP_4_2_6P3_RC6 util/ntp-keygen-opts.texi@1.268 +2 -2 NTP_4_2_6P3_RC6 util/ntp-keygen.1@1.268 +2 -2 NTP_4_2_6P3_RC6 ChangeSet@1.2215, 2010-10-24 02:22:00-04:00, stenn@deacon.udel.edu NEWS file update NEWS@1.111 +3 -1 NEWS file update ChangeSet@1.2207.1.5, 2010-10-24 06:21:08+00:00, davehart@shiny.ad.hartbrothers.com fix bad "tos cohort" backport from -dev ntpd/ntp_parser.c@1.58 +1 -1 fix bad "tos cohort" backport from -dev ntpd/ntp_parser.y@1.53 +1 -1 fix bad "tos cohort" backport from -dev ChangeSet@1.2207.1.4, 2010-10-24 03:23:09+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1675] Prohibit includefile remote config. ChangeLog@1.658.1.1 +4 -0 [Bug 1675] Prohibit includefile remote config. ntpd/ntp_parser.c@1.57 +939 -1247 ntp_parser.y Bison output ntpd/ntp_parser.y@1.52 +266 -177 [Bug 1675] Prohibit includefile remote config. Collapse duplicated C snippets into common actions. ntpd/ntp_scanner.c@1.33 +4 -1 [Bug 1675] Prohibit includefile remote config. ChangeSet@1.2213, 2010-10-23 18:59:27+02:00, jnperlin@hydra.localnet ntp_fp.h: HTONL_MFP() uses ntohl(), should use htonl() (benign error) include/ntp_fp.h@1.16 +16 -16 HTONL_MFP() uses ntohl(), should use htonl() (benign error) ChangeSet@1.2212, 2010-10-23 03:07:11+02:00, jnperlin@hydra.localnet polish to NMEA driver ntpd/refclock_nmea.c@1.53 +55 -53 formatting issues ChangeSet@1.2211, 2010-10-23 02:24:08+02:00, jnperlin@hydra.localnet final update for [Bug 1571] and [Bug 1572] ChangeLog@1.659 +5 -0 [Bug 1571] NMEA does not relate data to PPS edge [Bug 1572] NMEA time adjustment for GPZDG buggy ntpd/refclock_nmea.c@1.52 +0 -10 removed tag for temporary version ChangeSet@1.2194.3.2, 2010-10-23 01:48:37+02:00, jnperlin@hydra.localnet nmea calendar cleanup ntpd/refclock_nmea.c@1.49.1.1 +16 -40 calendar cleanup ChangeSet@1.2207.1.3, 2010-10-22 07:46:08+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_RC5 TAG: NTP_4_2_6P3_RC5 ChangeLog@1.658 +1 -0 NTP_4_2_6P3_RC5 ntpd/ntpd-opts.c@1.269 +2 -2 NTP_4_2_6P3_RC5 ntpd/ntpd-opts.h@1.269 +3 -3 NTP_4_2_6P3_RC5 ntpd/ntpd-opts.texi@1.267 +2 -2 NTP_4_2_6P3_RC5 ntpd/ntpd.1@1.267 +2 -2 NTP_4_2_6P3_RC5 ntpdc/ntpdc-opts.c@1.265 +2 -2 NTP_4_2_6P3_RC5 ntpdc/ntpdc-opts.h@1.265 +3 -3 NTP_4_2_6P3_RC5 ntpdc/ntpdc-opts.texi@1.264 +2 -2 NTP_4_2_6P3_RC5 ntpdc/ntpdc.1@1.264 +2 -2 NTP_4_2_6P3_RC5 ntpq/ntpq-opts.c@1.266 +2 -2 NTP_4_2_6P3_RC5 ntpq/ntpq-opts.h@1.266 +3 -3 NTP_4_2_6P3_RC5 ntpq/ntpq-opts.texi@1.265 +2 -2 NTP_4_2_6P3_RC5 ntpq/ntpq.1@1.265 +2 -2 NTP_4_2_6P3_RC5 ntpsnmpd/ntpsnmpd-opts.c@1.145 +2 -2 NTP_4_2_6P3_RC5 ntpsnmpd/ntpsnmpd-opts.h@1.145 +3 -3 NTP_4_2_6P3_RC5 ntpsnmpd/ntpsnmpd-opts.texi@1.145 +2 -2 NTP_4_2_6P3_RC5 ntpsnmpd/ntpsnmpd.1@1.144 +2 -2 NTP_4_2_6P3_RC5 packageinfo.sh@1.284 +1 -1 NTP_4_2_6P3_RC5 sntp/sntp-opts.c@1.138 +2 -2 NTP_4_2_6P3_RC5 sntp/sntp-opts.h@1.138 +3 -3 NTP_4_2_6P3_RC5 sntp/sntp-opts.texi@1.138 +1 -1 NTP_4_2_6P3_RC5 sntp/sntp.1@1.138 +2 -2 NTP_4_2_6P3_RC5 sntp/sntp.html@1.28 +1 -1 NTP_4_2_6P3_RC5 util/ntp-keygen-opts.c@1.268 +2 -2 NTP_4_2_6P3_RC5 util/ntp-keygen-opts.h@1.268 +3 -3 NTP_4_2_6P3_RC5 util/ntp-keygen-opts.texi@1.267 +2 -2 NTP_4_2_6P3_RC5 util/ntp-keygen.1@1.267 +2 -2 NTP_4_2_6P3_RC5 ChangeSet@1.2207.2.1, 2010-10-22 00:33:26+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1669] NTP 4.2.6p2 fails to compile on IBM AIX 5.3. ChangeLog@1.655.1.1 +4 -0 [Bug 1669] NTP 4.2.6p2 fails to compile on IBM AIX 5.3. ntpd/ntp_util.c@1.77 +9 -8 [Bug 1669] NTP 4.2.6p2 fails to compile on IBM AIX 5.3. ChangeSet@1.2207.1.1, 2010-10-19 21:10:14+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1649] Require NMEA checksum if $GPRMC or previously seen. ChangeLog@1.656 +4 -0 [Bug 1649] Require NMEA checksum if $GPRMC or previously seen. ntpd/refclock_nmea.c@1.47.1.1 +104 -56 [Bug 1649] Require NMEA checksum if $GPRMC or previously seen. ChangeSet@1.2207, 2010-10-16 04:24:10+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_RC4 TAG: NTP_4_2_6P3_RC4 ChangeLog@1.655 +1 -0 NTP_4_2_6P3_RC4 ntpd/ntpd-opts.c@1.268 +2 -2 NTP_4_2_6P3_RC4 ntpd/ntpd-opts.h@1.268 +3 -3 NTP_4_2_6P3_RC4 ntpd/ntpd-opts.texi@1.266 +2 -2 NTP_4_2_6P3_RC4 ntpd/ntpd.1@1.266 +2 -2 NTP_4_2_6P3_RC4 ntpdc/ntpdc-opts.c@1.264 +2 -2 NTP_4_2_6P3_RC4 ntpdc/ntpdc-opts.h@1.264 +3 -3 NTP_4_2_6P3_RC4 ntpdc/ntpdc-opts.texi@1.263 +2 -2 NTP_4_2_6P3_RC4 ntpdc/ntpdc.1@1.263 +2 -2 NTP_4_2_6P3_RC4 ntpq/ntpq-opts.c@1.265 +2 -2 NTP_4_2_6P3_RC4 ntpq/ntpq-opts.h@1.265 +3 -3 NTP_4_2_6P3_RC4 ntpq/ntpq-opts.texi@1.264 +2 -2 NTP_4_2_6P3_RC4 ntpq/ntpq.1@1.264 +2 -2 NTP_4_2_6P3_RC4 ntpsnmpd/ntpsnmpd-opts.c@1.144 +2 -2 NTP_4_2_6P3_RC4 ntpsnmpd/ntpsnmpd-opts.h@1.144 +3 -3 NTP_4_2_6P3_RC4 ntpsnmpd/ntpsnmpd-opts.texi@1.144 +2 -2 NTP_4_2_6P3_RC4 ntpsnmpd/ntpsnmpd.1@1.143 +2 -2 NTP_4_2_6P3_RC4 packageinfo.sh@1.283 +1 -1 NTP_4_2_6P3_RC4 sntp/sntp-opts.c@1.137 +2 -2 NTP_4_2_6P3_RC4 sntp/sntp-opts.h@1.137 +3 -3 NTP_4_2_6P3_RC4 sntp/sntp-opts.texi@1.137 +1 -1 NTP_4_2_6P3_RC4 sntp/sntp.1@1.137 +2 -2 NTP_4_2_6P3_RC4 sntp/sntp.html@1.27 +1 -1 NTP_4_2_6P3_RC4 util/ntp-keygen-opts.c@1.267 +2 -2 NTP_4_2_6P3_RC4 util/ntp-keygen-opts.h@1.267 +3 -3 NTP_4_2_6P3_RC4 util/ntp-keygen-opts.texi@1.266 +2 -2 NTP_4_2_6P3_RC4 util/ntp-keygen.1@1.266 +2 -2 NTP_4_2_6P3_RC4 ChangeSet@1.2204.1.1, 2010-10-16 04:02:17+00:00, davehart@shiny.ad.hartbrothers.com min/max confusion in ntpsnmpd change ntpsnmpd/ntpSnmpSubagentObject.c@1.6 +4 -1 min/max confusion ChangeSet@1.2205, 2010-10-15 23:52:31-04:00, stenn@deacon.udel.edu Update NEWS to 4.2.6p3-RC4 NEWS@1.110 +7 -0 Update to 4.2.6p3-RC4 ChangeSet@1.2204, 2010-10-16 00:40:13+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1584] wrong SNMP type for precision, resolution. ChangeLog@1.654 +1 -0 [Bug 1584] wrong SNMP type for precision, resolution. ntpsnmpd/ntpSnmpSubagentObject.c@1.5 +160 -130 Correct ASN type for ntp_EntTimeResolution and ntp_EntTimePrecision. Use precision as best guess for unavailable resolution. ntpsnmpd/ntpSnmpSubagentObject.h@1.4 +6 -6 const fun ChangeSet@1.2203, 2010-10-14 19:13:29+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1659] Need CLOCK_TRUETIME not CLOCK_TRUE. ChangeLog@1.653 +1 -0 [Bug 1659] Need CLOCK_TRUETIME not CLOCK_TRUE. ports/winnt/include/config.h@1.82 +1 -1 [Bug 1659] Need CLOCK_TRUETIME not CLOCK_TRUE. ChangeSet@1.2202, 2010-10-14 14:47:37+00:00, davehart@shiny.ad.hartbrothers.com constantly more fun ntpq/libntpq.c@1.7 +6 -6 constantly more fun ChangeSet@1.2201, 2010-10-14 14:07:21+00:00, davehart@shiny.ad.hartbrothers.com const additions needed for ntp-dev ChangeLog@1.652 +1 -0 [Bug 1665] is_anycast() u_int32_t should be u_int32. const additions needed for ntp-dev ntpd/ntp_io.c@1.312 +1 -1 [Bug 1665] is_anycast() u_int32_t should be u_int32. ntpq/libntpq.c@1.6 +66 -62 const additions needed for ntp-dev ntpq/libntpq.h@1.5 +2 -2 const additions needed for ntp-dev ntpq/libntpq_subs.c@1.3 +13 -3 const additions needed for ntp-dev ntpq/ntpq-subs.c@1.45 +42 -38 const additions needed for ntp-dev ntpq/ntpq.c@1.103 +144 -84 const additions needed for ntp-dev ntpq/ntpq.h@1.13 +7 -3 const additions needed for ntp-dev ChangeSet@1.2200, 2010-10-14 09:38:42+00:00, davehart@shiny.ad.hartbrothers.com ntpsnmpd, libntpq warning cleanup. ChangeLog@1.651 +5 -1 ntpsnmpd, libntpq warning cleanup. ntpq/libntpq.c@1.5 +1 -1 ntpsnmpd, libntpq warning cleanup. ntpsnmpd/ntpsnmpd.c@1.6 +1 -2 ntpsnmpd, libntpq warning cleanup. ChangeSet@1.2199, 2010-10-14 07:51:07+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_RC3 TAG: NTP_4_2_6P3_RC3 ChangeLog@1.650 +1 -0 NTP_4_2_6P3_RC3 ntpd/ntpd-opts.c@1.267 +2 -2 NTP_4_2_6P3_RC3 ntpd/ntpd-opts.h@1.267 +3 -3 NTP_4_2_6P3_RC3 ntpd/ntpd-opts.texi@1.265 +2 -2 NTP_4_2_6P3_RC3 ntpd/ntpd.1@1.265 +2 -2 NTP_4_2_6P3_RC3 ntpdc/ntpdc-opts.c@1.263 +2 -2 NTP_4_2_6P3_RC3 ntpdc/ntpdc-opts.h@1.263 +3 -3 NTP_4_2_6P3_RC3 ntpdc/ntpdc-opts.texi@1.262 +2 -2 NTP_4_2_6P3_RC3 ntpdc/ntpdc.1@1.262 +2 -2 NTP_4_2_6P3_RC3 ntpq/ntpq-opts.c@1.264 +2 -2 NTP_4_2_6P3_RC3 ntpq/ntpq-opts.h@1.264 +3 -3 NTP_4_2_6P3_RC3 ntpq/ntpq-opts.texi@1.263 +2 -2 NTP_4_2_6P3_RC3 ntpq/ntpq.1@1.263 +2 -2 NTP_4_2_6P3_RC3 ntpsnmpd/ntpsnmpd-opts.c@1.143 +2 -2 NTP_4_2_6P3_RC3 ntpsnmpd/ntpsnmpd-opts.h@1.143 +3 -3 NTP_4_2_6P3_RC3 ntpsnmpd/ntpsnmpd-opts.texi@1.143 +2 -2 NTP_4_2_6P3_RC3 ntpsnmpd/ntpsnmpd.1@1.142 +2 -2 NTP_4_2_6P3_RC3 packageinfo.sh@1.282 +1 -1 NTP_4_2_6P3_RC3 sntp/sntp-opts.c@1.136 +2 -2 NTP_4_2_6P3_RC3 sntp/sntp-opts.h@1.136 +3 -3 NTP_4_2_6P3_RC3 sntp/sntp-opts.texi@1.136 +1 -1 NTP_4_2_6P3_RC3 sntp/sntp.1@1.136 +2 -2 NTP_4_2_6P3_RC3 sntp/sntp.html@1.26 +1 -1 NTP_4_2_6P3_RC3 util/ntp-keygen-opts.c@1.266 +2 -2 NTP_4_2_6P3_RC3 util/ntp-keygen-opts.h@1.266 +3 -3 NTP_4_2_6P3_RC3 util/ntp-keygen-opts.texi@1.265 +2 -2 NTP_4_2_6P3_RC3 util/ntp-keygen.1@1.265 +2 -2 NTP_4_2_6P3_RC3 ChangeSet@1.2197, 2010-10-14 03:19:02-04:00, stenn@deacon.udel.edu Update the NEWS file NEWS@1.109 +5 -1 Update the NEWS file ChangeSet@1.2194.1.21, 2010-10-12 14:27:43+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1080] ntpd on ipv6 routers very chatty. ChangeLog@1.646.1.17 +1 -0 [Bug 1080] ntpd on ipv6 routers very chatty. configure.ac@1.479 +33 -11 [Bug 1080] ntpd on ipv6 routers very chatty. include/ntp_net.h@1.5 +9 -0 [Bug 1080] ntpd on ipv6 routers very chatty. ntpd/ntp_io.c@1.311 +39 -0 [Bug 1080] ntpd on ipv6 routers very chatty. patch originally supplied to freebsd's head/contrib/ntp/ntpd/ntp_io.c by ume@freebsd.org http://www.mail-archive.com/svn-src-all@freebsd.org/msg16141.html ChangeSet@1.2194.1.20, 2010-10-12 01:28:24-04:00, stenn@deacon.udel.edu [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver ChangeLog@1.646.1.16 +7 -7 [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver ntpd/refclock_ripencc.c@1.12 +1 -1 [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver ChangeSet@1.2194.1.19, 2010-10-12 01:06:48-04:00, stenn@deacon.udel.edu [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver ChangeLog@1.646.1.15 +3 -2 [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver ntpd/refclock_ripencc.c@1.11 +18 -9 [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver ChangeSet@1.2194.1.17, 2010-10-11 20:18:23-07:00, stenn@stenn.ntp.org [Bug 1661]: Re-indent refclock_ripencc.c ChangeLog@1.646.1.13 +1 -0 [Bug 1661]: Re-indent refclock_ripencc.c ntpd/refclock_ripencc.c@1.10 +1909 -1530 [Bug 1661]: Re-indent refclock_ripencc.c ChangeSet@1.2194.6.1, 2010-10-11 22:36:49-04:00, stenn@deacon.udel.edu [Bug 1660]: On some systems, test is in /usr/bin, not /bin ChangeLog@1.646.5.1 +1 -0 [Bug 1660]: On some systems, test is in /usr/bin, not /bin Makefile.am@1.94 +1 -1 [Bug 1660]: On some systems, test is in /usr/bin, not /bin configure.ac@1.478 +3 -1 [Bug 1660]: On some systems, test is in /usr/bin, not /bin ChangeSet@1.2194.5.1, 2010-10-12 01:16:13+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1584]: ntpsnmpd OID must be mib-2.197. ChangeLog@1.646.4.1 +1 -0 [Bug 1584]: ntpsnmpd OID must be mib-2.197. ntpq/libntpq.c@1.4 +58 -65 [Bug 1584]: ntpsnmpd OID must be mib-2.197. ntpq/libntpq.h@1.4 +5 -5 [Bug 1584]: ntpsnmpd OID must be mib-2.197. ntpsnmpd/Makefile.am@1.20 +2 -2 [Bug 1584]: ntpsnmpd OID must be mib-2.197. ntpsnmpd/ntpSnmpSubagentObject.c@1.4 +96 -285 [Bug 1584]: ntpsnmpd OID must be mib-2.197. ntpsnmpd/ntpSnmpSubagentObject.h@1.3 +41 -35 [Bug 1584]: ntpsnmpd OID must be mib-2.197. ntpsnmpd/ntp_snmp.h@1.1 +34 -0 work around PACKAGE_* redefinitions with net-snmp/net-snmp-config.h ntpsnmpd/ntp_snmp.h@1.0 +0 -0 ntpsnmpd/ntpsnmpd.c@1.5 +1 -11 [Bug 1584]: ntpsnmpd OID must be mib-2.197. ntpsnmpd/ntpv4-mib.mib@1.2 +244 -357 [Bug 1584]: ntpsnmpd OID must be mib-2.197. ChangeSet@1.2194.4.3, 2010-10-09 10:10:10+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows. [Bug 1659] Support Truetime Satellite Clocks on Windows. ChangeLog@1.646.3.2 +4 -2 [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows. [Bug 1659] Support Truetime Satellite Clocks on Windows. ntpd/refclock_arbiter.c@1.16 +34 -9 [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows. ntpd/refclock_true.c@1.13 +15 -0 [Bug 1659] Support Truetime Satellite Clocks on Windows. ports/winnt/include/config.h@1.81 +2 -0 [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows. [Bug 1659] Support Truetime Satellite Clocks on Windows. ports/winnt/vc6/ntpd.dsp@1.42 +0 -2 [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows. [Bug 1659] Support Truetime Satellite Clocks on Windows. ports/winnt/vs2003/ntpd.vcproj@1.5 +4 -8 [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows. [Bug 1659] Support Truetime Satellite Clocks on Windows. ports/winnt/vs2005/ntpd.vcproj@1.5 +0 -4 [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows. [Bug 1659] Support Truetime Satellite Clocks on Windows. ports/winnt/vs2008/ntpd/ntpd.vcproj@1.23 +0 -4 [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows. [Bug 1659] Support Truetime Satellite Clocks on Windows. ChangeSet@1.2194.4.2, 2010-10-02 00:31:32-04:00, stenn@deacon.udel.edu Update the NEWS file for 4.2.6p3 NEWS@1.108 +31 -0 Update the NEWS file for 4.2.6p3 ChangeSet@1.2194.4.1, 2010-09-30 00:14:03-04:00, stenn@deacon.udel.edu [Bug 1644]: cvo.sh should use lsb_release to identify linux distros. ChangeLog@1.646.3.1 +2 -0 [Bug 1644]: cvo.sh should use lsb_release to identify linux distros. scripts/cvo.sh@1.3.1.1 +4 -3 [Bug 1644]: cvo.sh should use lsb_release to identify linux distros. ChangeSet@1.2194.1.15, 2010-09-27 01:33:39-04:00, stenn@psp-deb1.ntp.org [Bug 1644]: cvo.sh doesn't handle some unstable/testing linux distros ChangeLog@1.646.1.11 +2 -0 [Bug 1644]: cvo.sh doesn't handle some unstable/testing linux distros scripts/cvo.sh@1.4 +4 -3 [Bug 1644]: cvo.sh doesn't handle some unstable/testing linux distros ChangeSet@1.2194.1.14, 2010-09-25 17:32:37-04:00, stenn@deacon.udel.edu typo fix ntpd/refclock_ripencc.c@1.9 +1 -1 typo fix ChangeSet@1.2194.1.13, 2010-09-25 21:14:57+00:00, stenn@psp-fb2.ntp.org [Bug 1643]: Range-check the decoding of the RIPE-NCC status codes ChangeLog@1.646.1.10 +3 -0 [Bug 1643]: Range-check the decoding of the RIPE-NCC status codes ntpd/refclock_ripencc.c@1.8 +11 -6 [Bug 1643]: Range-check the decoding of the RIPE-NCC status codes ChangeSet@1.2194.1.12, 2010-09-25 18:22:19+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_RC2 TAG: NTP_4_2_6P3_RC2 ChangeLog@1.646.1.9 +1 -0 NTP_4_2_6P3_RC2 ntpd/ntpd-opts.c@1.266 +2 -2 NTP_4_2_6P3_RC2 ntpd/ntpd-opts.h@1.266 +3 -3 NTP_4_2_6P3_RC2 ntpd/ntpd-opts.texi@1.264 +2 -2 NTP_4_2_6P3_RC2 ntpd/ntpd.1@1.264 +2 -2 NTP_4_2_6P3_RC2 ntpdc/ntpdc-opts.c@1.262 +2 -2 NTP_4_2_6P3_RC2 ntpdc/ntpdc-opts.h@1.262 +3 -3 NTP_4_2_6P3_RC2 ntpdc/ntpdc-opts.texi@1.261 +2 -2 NTP_4_2_6P3_RC2 ntpdc/ntpdc.1@1.261 +2 -2 NTP_4_2_6P3_RC2 ntpq/ntpq-opts.c@1.263 +2 -2 NTP_4_2_6P3_RC2 ntpq/ntpq-opts.h@1.263 +3 -3 NTP_4_2_6P3_RC2 ntpq/ntpq-opts.texi@1.262 +2 -2 NTP_4_2_6P3_RC2 ntpq/ntpq.1@1.262 +2 -2 NTP_4_2_6P3_RC2 ntpsnmpd/ntpsnmpd-opts.c@1.142 +2 -2 NTP_4_2_6P3_RC2 ntpsnmpd/ntpsnmpd-opts.h@1.142 +3 -3 NTP_4_2_6P3_RC2 ntpsnmpd/ntpsnmpd-opts.texi@1.142 +2 -2 NTP_4_2_6P3_RC2 ntpsnmpd/ntpsnmpd.1@1.141 +2 -2 NTP_4_2_6P3_RC2 packageinfo.sh@1.281 +1 -1 NTP_4_2_6P3_RC2 sntp/sntp-opts.c@1.135 +2 -2 NTP_4_2_6P3_RC2 sntp/sntp-opts.h@1.135 +3 -3 NTP_4_2_6P3_RC2 sntp/sntp-opts.texi@1.135 +1 -1 NTP_4_2_6P3_RC2 sntp/sntp.1@1.135 +2 -2 NTP_4_2_6P3_RC2 sntp/sntp.html@1.25 +1 -1 NTP_4_2_6P3_RC2 util/ntp-keygen-opts.c@1.265 +2 -2 NTP_4_2_6P3_RC2 util/ntp-keygen-opts.h@1.265 +3 -3 NTP_4_2_6P3_RC2 util/ntp-keygen-opts.texi@1.264 +2 -2 NTP_4_2_6P3_RC2 util/ntp-keygen.1@1.264 +2 -2 NTP_4_2_6P3_RC2 ChangeSet@1.2183.1.1, 2010-09-22 20:14:51+02:00, jnperlin@hydra.localnet [Bug 1571][Bug 1572] first clean-running version ntpd/refclock_nmea.c@1.49 +42 -27 some more cleanup ntpd/refclock_nmea.c@1.48 +310 -70 [Bug 1571][Bug 1572] first clean-running version ChangeSet@1.2194.1.11, 2010-09-21 16:29:51+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1636] yyparse() segfault after denied filegen remote config. ChangeLog@1.646.1.8 +1 -0 [Bug 1636] yyparse() segfault after denied filegen remote config. ntpd/ntp_parser.c@1.56 +149 -139 [Bug 1636] yyparse() segfault after denied filegen remote config. ntpd/ntp_parser.y@1.51 +13 -3 [Bug 1636] yyparse() segfault after denied filegen remote config. ChangeSet@1.2194.1.10, 2010-09-20 22:41:37+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1635] "filegen ... enable" is not default. ChangeLog@1.646.1.7 +4 -0 [Bug 1635] "filegen ... enable" is not default. ntpd/ntp_config.c@1.246 +5 -2 [Bug 1635] "filegen ... enable" is not default. ntpd/ntp_filegen.c@1.18 +5 -7 nonfunctional cleanup (whitespace, use estrdup()). ntpd/ntp_parser.c@1.55 +383 -386 Bison output for ntp_parser.y ntpd/ntp_parser.y@1.50 +4 -12 [Bug 1635] "filegen ... enable" is not default. ntpd/ntp_util.c@1.76 +2 -2 whitespace ChangeSet@1.2194.1.9, 2010-09-18 05:42:06+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_RC1 TAG: NTP_4_2_6P3_RC1 ChangeLog@1.646.1.6 +1 -0 NTP_4_2_6P3_RC1 ntpd/ntpd-opts.c@1.265 +2 -2 NTP_4_2_6P3_RC1 ntpd/ntpd-opts.h@1.265 +3 -3 NTP_4_2_6P3_RC1 ntpd/ntpd-opts.texi@1.263 +2 -2 NTP_4_2_6P3_RC1 ntpd/ntpd.1@1.263 +2 -2 NTP_4_2_6P3_RC1 ntpdc/ntpdc-opts.c@1.261 +2 -2 NTP_4_2_6P3_RC1 ntpdc/ntpdc-opts.h@1.261 +3 -3 NTP_4_2_6P3_RC1 ntpdc/ntpdc-opts.texi@1.260 +2 -2 NTP_4_2_6P3_RC1 ntpdc/ntpdc.1@1.260 +2 -2 NTP_4_2_6P3_RC1 ntpq/ntpq-opts.c@1.262 +2 -2 NTP_4_2_6P3_RC1 ntpq/ntpq-opts.h@1.262 +3 -3 NTP_4_2_6P3_RC1 ntpq/ntpq-opts.texi@1.261 +2 -2 NTP_4_2_6P3_RC1 ntpq/ntpq.1@1.261 +2 -2 NTP_4_2_6P3_RC1 ntpsnmpd/ntpsnmpd-opts.c@1.141 +2 -2 NTP_4_2_6P3_RC1 ntpsnmpd/ntpsnmpd-opts.h@1.141 +3 -3 NTP_4_2_6P3_RC1 ntpsnmpd/ntpsnmpd-opts.texi@1.141 +2 -2 NTP_4_2_6P3_RC1 ntpsnmpd/ntpsnmpd.1@1.140 +2 -2 NTP_4_2_6P3_RC1 packageinfo.sh@1.280 +1 -1 NTP_4_2_6P3_RC1 sntp/sntp-opts.c@1.134 +2 -2 NTP_4_2_6P3_RC1 sntp/sntp-opts.h@1.134 +3 -3 NTP_4_2_6P3_RC1 sntp/sntp-opts.texi@1.134 +1 -1 NTP_4_2_6P3_RC1 sntp/sntp.1@1.134 +2 -2 NTP_4_2_6P3_RC1 sntp/sntp.html@1.24 +1 -1 NTP_4_2_6P3_RC1 util/ntp-keygen-opts.c@1.264 +2 -2 NTP_4_2_6P3_RC1 util/ntp-keygen-opts.h@1.264 +3 -3 NTP_4_2_6P3_RC1 util/ntp-keygen-opts.texi@1.263 +2 -2 NTP_4_2_6P3_RC1 util/ntp-keygen.1@1.263 +2 -2 NTP_4_2_6P3_RC1 ChangeSet@1.2194.1.8, 2010-09-18 01:25:26-04:00, stenn@deacon.udel.edu 4.2.6p3-RC1 packageinfo.sh@1.279 +1 -1 4.2.6p3-RC1 ChangeSet@1.2194.1.7, 2010-09-17 04:20:03+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1344] ntpd on Windows exits without logging cause. ChangeLog@1.646.1.5 +4 -0 [Bug 1344] ntpd on Windows exits without logging cause. ports/winnt/ntpd/nt_clockstuff.c@1.41 +4 -2 [Bug 1344] ntpd on Windows exits without logging cause. ChangeSet@1.2194.1.6, 2010-09-11 06:50:03+00:00, stenn@deacon.udel.edu NTP_4_2_6P3_BETA1 TAG: NTP_4_2_6P3_BETA1 ChangeLog@1.646.1.4 +1 -0 NTP_4_2_6P3_BETA1 ntpd/ntpd-opts.c@1.264 +2 -2 NTP_4_2_6P3_BETA1 ntpd/ntpd-opts.h@1.264 +3 -3 NTP_4_2_6P3_BETA1 ntpd/ntpd-opts.texi@1.262 +2 -2 NTP_4_2_6P3_BETA1 ntpd/ntpd.1@1.262 +2 -2 NTP_4_2_6P3_BETA1 ntpdc/ntpdc-opts.c@1.260 +2 -2 NTP_4_2_6P3_BETA1 ntpdc/ntpdc-opts.h@1.260 +3 -3 NTP_4_2_6P3_BETA1 ntpdc/ntpdc-opts.texi@1.259 +2 -2 NTP_4_2_6P3_BETA1 ntpdc/ntpdc.1@1.259 +2 -2 NTP_4_2_6P3_BETA1 ntpq/ntpq-opts.c@1.261 +2 -2 NTP_4_2_6P3_BETA1 ntpq/ntpq-opts.h@1.261 +3 -3 NTP_4_2_6P3_BETA1 ntpq/ntpq-opts.texi@1.260 +2 -2 NTP_4_2_6P3_BETA1 ntpq/ntpq.1@1.260 +2 -2 NTP_4_2_6P3_BETA1 ntpsnmpd/ntpsnmpd-opts.c@1.140 +2 -2 NTP_4_2_6P3_BETA1 ntpsnmpd/ntpsnmpd-opts.h@1.140 +3 -3 NTP_4_2_6P3_BETA1 ntpsnmpd/ntpsnmpd-opts.texi@1.140 +2 -2 NTP_4_2_6P3_BETA1 ntpsnmpd/ntpsnmpd.1@1.139 +2 -2 NTP_4_2_6P3_BETA1 packageinfo.sh@1.278 +3 -3 NTP_4_2_6P3_BETA1 sntp/sntp-opts.c@1.133 +2 -2 NTP_4_2_6P3_BETA1 sntp/sntp-opts.h@1.133 +3 -3 NTP_4_2_6P3_BETA1 sntp/sntp-opts.texi@1.133 +1 -1 NTP_4_2_6P3_BETA1 sntp/sntp.1@1.133 +2 -2 NTP_4_2_6P3_BETA1 sntp/sntp.html@1.23 +1 -1 NTP_4_2_6P3_BETA1 util/ntp-keygen-opts.c@1.263 +2 -2 NTP_4_2_6P3_BETA1 util/ntp-keygen-opts.h@1.263 +3 -3 NTP_4_2_6P3_BETA1 util/ntp-keygen-opts.texi@1.262 +2 -2 NTP_4_2_6P3_BETA1 util/ntp-keygen.1@1.262 +2 -2 NTP_4_2_6P3_BETA1 ChangeSet@1.2194.1.5, 2010-09-11 02:14:22-04:00, stenn@deacon.udel.edu temporary mirror trigger update BitKeeper/triggers/2mirrors@1.7 +2 -1 temporary mirror trigger update ChangeSet@1.2194.1.4, 2010-08-18 11:26:41+02:00, linus@beam.lund.zozs.se [BUG 1573] Miscalculation of offset in sntp. ChangeLog@1.646.1.3 +1 -0 [BUG 1573] Miscalculation of offset in sntp. sntp/main.c@1.26 +2 -2 [BUG 1573] Miscalculation of offset in sntp. ChangeSet@1.2194.2.1, 2010-07-31 21:59:50+02:00, linus@beam.lund.zozs.se [BUG 1597] packet processing ignores RATE KoD packets because of a bug in string comparison. ChangeLog@1.646.2.1 +5 -0 [BUG 1597] packet processing ignores RATE KoD packets because of a bug in string comparison. sntp/networking.c@1.36 +3 -3 [BUG 1597] packet processing ignores RATE KoD packets because of a bug in string comparison. ChangeSet@1.2194.1.2, 2010-07-28 18:30:17+02:00, linus@beam.lund.zozs.se [Bug 1595] empty last line in key file causes duplicate key to be added ChangeLog@1.646.1.1 +4 -0 [Bug 1595] empty last line in key file causes duplicate key to be added ChangeSet@1.2194.1.1, 2010-07-28 18:18:55+02:00, linus@beam.lund.zozs.se [Bug 1595] empty last line in key file causes duplicate key to be added sntp/crypto.c@1.13 +3 -1 [Bug 1595] empty last line in key file causes duplicate key to be added ChangeSet@1.2195, 2010-07-10 18:11:54+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1581] missed one previously ChangeLog@1.647 +4 -0 [Bug 1581] missed one previously ntpd/ntp_intres.c@1.81 +1 -1 [Bug 1581] missed one previously ChangeSet@1.2194, 2010-07-09 02:25:58+00:00, stenn@deacon.udel.edu NTP_4_2_6P2 TAG: NTP_4_2_6P2 ChangeLog@1.646 +1 -0 NTP_4_2_6P2 ntpd/ntpd-opts.c@1.263 +2 -2 NTP_4_2_6P2 ntpd/ntpd-opts.h@1.263 +3 -3 NTP_4_2_6P2 ntpd/ntpd-opts.texi@1.261 +2 -2 NTP_4_2_6P2 ntpd/ntpd.1@1.261 +2 -2 NTP_4_2_6P2 ntpdc/ntpdc-opts.c@1.259 +2 -2 NTP_4_2_6P2 ntpdc/ntpdc-opts.h@1.259 +3 -3 NTP_4_2_6P2 ntpdc/ntpdc-opts.texi@1.258 +2 -2 NTP_4_2_6P2 ntpdc/ntpdc.1@1.258 +2 -2 NTP_4_2_6P2 ntpq/ntpq-opts.c@1.260 +2 -2 NTP_4_2_6P2 ntpq/ntpq-opts.h@1.260 +3 -3 NTP_4_2_6P2 ntpq/ntpq-opts.texi@1.259 +2 -2 NTP_4_2_6P2 ntpq/ntpq.1@1.259 +2 -2 NTP_4_2_6P2 ntpsnmpd/ntpsnmpd-opts.c@1.139 +2 -2 NTP_4_2_6P2 ntpsnmpd/ntpsnmpd-opts.h@1.139 +3 -3 NTP_4_2_6P2 ntpsnmpd/ntpsnmpd-opts.texi@1.139 +2 -2 NTP_4_2_6P2 ntpsnmpd/ntpsnmpd.1@1.138 +2 -2 NTP_4_2_6P2 packageinfo.sh@1.277 +2 -2 NTP_4_2_6P2 sntp/sntp-opts.c@1.132 +2 -2 NTP_4_2_6P2 sntp/sntp-opts.h@1.132 +3 -3 NTP_4_2_6P2 sntp/sntp-opts.texi@1.132 +1 -1 NTP_4_2_6P2 sntp/sntp.1@1.132 +2 -2 NTP_4_2_6P2 sntp/sntp.html@1.22 +1 -1 NTP_4_2_6P2 util/ntp-keygen-opts.c@1.262 +2 -2 NTP_4_2_6P2 util/ntp-keygen-opts.h@1.262 +3 -3 NTP_4_2_6P2 util/ntp-keygen-opts.texi@1.261 +2 -2 NTP_4_2_6P2 util/ntp-keygen.1@1.261 +2 -2 NTP_4_2_6P2 ChangeSet@1.2193, 2010-07-08 21:55:47-04:00, stenn@deacon.udel.edu release 4.2.6p2 NEWS@1.107 +39 -0 NEWS file for 4.2.6p2 packageinfo.sh@1.276 +1 -1 release 4.2.6p2 ChangeSet@1.2192, 2010-07-08 21:49:08-04:00, stenn@deacon.udel.edu Use the new mirror server names for the trigger mirror update script BitKeeper/triggers/2mirrors@1.6 +2 -2 Use the new mirror server names for the trigger mirror update script ChangeSet@1.2191, 2010-07-02 07:43:21+01:00, davehart@shiny.ad.hartbrothers.com [Bug 1581] size_t printf format string mismatches, IRIG string buffers undersized. Mostly backported from earlier ntp-dev fixes by Jürgen Perlinger, The exceptions are ntp_intres.c and refclock_irig.c. ChangeLog@1.645 +6 -0 [Bug 1581] size_t printf format string mismatches, IRIG string buffers undersized. Mostly backported from earlier ntp-dev fixes by Jürgen Perlinger, The exceptions are ntp_intres.c and refclock_irig.c. libntp/ssl_init.c@1.6 +5 -4 [Bug 1581] size_t printf format string mismatches (backported from ntp-dev). ntpd/ntp_config.c@1.245 +4 -4 [Bug 1581] size_t printf format string mismatches (backported from ntp-dev). ntpd/ntp_intres.c@1.80 +6 -4 [Bug 1581] size_t printf format string mismatches. ntpd/ntp_request.c@1.84 +8 -7 [Bug 1581] size_t printf format string mismatches (backported from ntp-dev). ntpd/ntp_scanner.c@1.32 +2 -2 [Bug 1581] size_t printf format string mismatches (backported from ntp-dev). ntpd/refclock_acts.c@1.37 +3 -3 [Bug 1581] size_t printf format string mismatches (backported from ntp-dev). ntpd/refclock_irig.c@1.33 +3 -3 [Bug 1581] sscanf() target buffers lack room for terminating null. ntpdc/ntpdc.c@1.77 +7 -7 [Bug 1581] size_t printf format string mismatches (backported from ntp-dev). ntpq/ntpq.c@1.102 +6 -6 [Bug 1581] size_t printf format string mismatches (backported from ntp-dev). ChangeSet@1.2190, 2010-06-19 02:49:04-04:00, stenn@deacon.udel.edu NTP_4_2_6P2_RC7 TAG: NTP_4_2_6P2_RC7 ChangeLog@1.644 +1 -0 NTP_4_2_6P2_RC7 ntpd/ntpd-opts.c@1.262 +2 -2 NTP_4_2_6P2_RC7 ntpd/ntpd-opts.h@1.262 +3 -3 NTP_4_2_6P2_RC7 ntpd/ntpd-opts.texi@1.260 +2 -2 NTP_4_2_6P2_RC7 ntpd/ntpd.1@1.260 +2 -2 NTP_4_2_6P2_RC7 ntpdc/ntpdc-opts.c@1.258 +2 -2 NTP_4_2_6P2_RC7 ntpdc/ntpdc-opts.h@1.258 +3 -3 NTP_4_2_6P2_RC7 ntpdc/ntpdc-opts.texi@1.257 +2 -2 NTP_4_2_6P2_RC7 ntpdc/ntpdc.1@1.257 +2 -2 NTP_4_2_6P2_RC7 ntpq/ntpq-opts.c@1.259 +2 -2 NTP_4_2_6P2_RC7 ntpq/ntpq-opts.h@1.259 +3 -3 NTP_4_2_6P2_RC7 ntpq/ntpq-opts.texi@1.258 +2 -2 NTP_4_2_6P2_RC7 ntpq/ntpq.1@1.258 +2 -2 NTP_4_2_6P2_RC7 ntpsnmpd/ntpsnmpd-opts.c@1.138 +2 -2 NTP_4_2_6P2_RC7 ntpsnmpd/ntpsnmpd-opts.h@1.138 +3 -3 NTP_4_2_6P2_RC7 ntpsnmpd/ntpsnmpd-opts.texi@1.138 +2 -2 NTP_4_2_6P2_RC7 ntpsnmpd/ntpsnmpd.1@1.137 +2 -2 NTP_4_2_6P2_RC7 packageinfo.sh@1.275 +1 -1 NTP_4_2_6P2_RC7 sntp/sntp-opts.c@1.131 +2 -2 NTP_4_2_6P2_RC7 sntp/sntp-opts.h@1.131 +3 -3 NTP_4_2_6P2_RC7 sntp/sntp-opts.texi@1.131 +1 -1 NTP_4_2_6P2_RC7 sntp/sntp.1@1.131 +2 -2 NTP_4_2_6P2_RC7 sntp/sntp.html@1.21 +1 -1 NTP_4_2_6P2_RC7 util/ntp-keygen-opts.c@1.261 +2 -2 NTP_4_2_6P2_RC7 util/ntp-keygen-opts.h@1.261 +3 -3 NTP_4_2_6P2_RC7 util/ntp-keygen-opts.texi@1.260 +2 -2 NTP_4_2_6P2_RC7 util/ntp-keygen.1@1.260 +2 -2 NTP_4_2_6P2_RC7 ChangeSet@1.2189, 2010-06-19 02:32:32-04:00, stenn@deacon.udel.edu [Bug 1570] serial clock drivers get outdated input from kernel tty line buffer after startup ChangeLog@1.643 +2 -0 [Bug 1570] serial clock drivers get outdated input from kernel tty line buffer after startup ntpd/ntp_refclock.c@1.93 +21 -0 [Bug 1570] serial clock drivers get outdated input from kernel tty line buffer after startup ChangeSet@1.2188, 2010-06-19 01:59:33-04:00, stenn@deacon.udel.edu merge cleanup ChangeLog@1.642 +2 -3 merge cleanup ChangeSet@1.2185.1.1, 2010-06-19 01:57:32-04:00, stenn@deacon.udel.edu [Bug 1576] sys/sysctl.h depends on sys/param.h on OpenBSD ChangeLog@1.639.1.1 +4 -0 [Bug 1576] sys/sysctl.h depends on sys/param.h on OpenBSD configure.ac@1.477 +7 -2 [Bug 1576] sys/sysctl.h depends on sys/param.h on OpenBSD ChangeSet@1.2186, 2010-06-15 08:25:18-04:00, perlinger@psp-deb1.ntp.org [Bug 1575] use snprintf with LIB_BUFLENGTH in inttoa.c, tvtoa.c, utvtoa.c ChangeLog@1.640 +3 -0 [Bug 1575] use snprintf with LIB_BUFLENGTH in inttoa.c, tvtoa.c, utvtoa.c libntp/inttoa.c@1.4 +1 -1 [Bug 1575] use snprintf with LIB_BUFLENGTH in inttoa.c, tvtoa.c, utvtoa.c libntp/tvtoa.c@1.4 +1 -1 [Bug 1575] use snprintf with LIB_BUFLENGTH in inttoa.c, tvtoa.c, utvtoa.c libntp/utvtoa.c@1.4 +1 -1 [Bug 1575] use snprintf with LIB_BUFLENGTH in inttoa.c, tvtoa.c, utvtoa.c ChangeSet@1.2185, 2010-06-12 02:21:49-04:00, stenn@deacon.udel.edu NTP_4_2_6P2_RC6 TAG: NTP_4_2_6P2_RC6 ChangeLog@1.639 +1 -0 NTP_4_2_6P2_RC6 ntpd/ntpd-opts.c@1.261 +2 -2 NTP_4_2_6P2_RC6 ntpd/ntpd-opts.h@1.261 +3 -3 NTP_4_2_6P2_RC6 ntpd/ntpd-opts.texi@1.259 +2 -2 NTP_4_2_6P2_RC6 ntpd/ntpd.1@1.259 +2 -2 NTP_4_2_6P2_RC6 ntpdc/ntpdc-opts.c@1.257 +2 -2 NTP_4_2_6P2_RC6 ntpdc/ntpdc-opts.h@1.257 +3 -3 NTP_4_2_6P2_RC6 ntpdc/ntpdc-opts.texi@1.256 +2 -2 NTP_4_2_6P2_RC6 ntpdc/ntpdc.1@1.256 +2 -2 NTP_4_2_6P2_RC6 ntpq/ntpq-opts.c@1.258 +2 -2 NTP_4_2_6P2_RC6 ntpq/ntpq-opts.h@1.258 +3 -3 NTP_4_2_6P2_RC6 ntpq/ntpq-opts.texi@1.257 +2 -2 NTP_4_2_6P2_RC6 ntpq/ntpq.1@1.257 +2 -2 NTP_4_2_6P2_RC6 ntpsnmpd/ntpsnmpd-opts.c@1.137 +2 -2 NTP_4_2_6P2_RC6 ntpsnmpd/ntpsnmpd-opts.h@1.137 +3 -3 NTP_4_2_6P2_RC6 ntpsnmpd/ntpsnmpd-opts.texi@1.137 +2 -2 NTP_4_2_6P2_RC6 ntpsnmpd/ntpsnmpd.1@1.136 +2 -2 NTP_4_2_6P2_RC6 packageinfo.sh@1.274 +1 -1 NTP_4_2_6P2_RC6 sntp/sntp-opts.c@1.130 +2 -2 NTP_4_2_6P2_RC6 sntp/sntp-opts.h@1.130 +3 -3 NTP_4_2_6P2_RC6 sntp/sntp-opts.texi@1.130 +1 -1 NTP_4_2_6P2_RC6 sntp/sntp.1@1.130 +2 -2 NTP_4_2_6P2_RC6 sntp/sntp.html@1.20 +1 -1 NTP_4_2_6P2_RC6 util/ntp-keygen-opts.c@1.260 +2 -2 NTP_4_2_6P2_RC6 util/ntp-keygen-opts.h@1.260 +3 -3 NTP_4_2_6P2_RC6 util/ntp-keygen-opts.texi@1.259 +2 -2 NTP_4_2_6P2_RC6 util/ntp-keygen.1@1.259 +2 -2 NTP_4_2_6P2_RC6 ChangeSet@1.2184, 2010-06-08 13:15:32+00:00, davehart@shiny.ad.hartbrothers.com [Bug 715] libisc Linux IPv6 interface iteration drops multicast flags. ChangeLog@1.638 +4 -0 [Bug 715] libisc Linux IPv6 interface iteration drops multicast flags. lib/isc/unix/interfaceiter.c@1.18 +32 -3 [Bug 715] libisc Linux IPv6 interface iteration drops multicast flags. patch from joerg@dorchain.net adapted from original by peter.pramberger@1012surf.net ChangeSet@1.2183, 2010-06-03 02:24:13-04:00, stenn@deacon.udel.edu NTP_4_2_6P2_RC5 TAG: NTP_4_2_6P2_RC5 ChangeLog@1.637 +1 -0 NTP_4_2_6P2_RC5 ntpd/ntpd-opts.c@1.260 +2 -2 NTP_4_2_6P2_RC5 ntpd/ntpd-opts.h@1.260 +3 -3 NTP_4_2_6P2_RC5 ntpd/ntpd-opts.texi@1.258 +2 -2 NTP_4_2_6P2_RC5 ntpd/ntpd.1@1.258 +2 -2 NTP_4_2_6P2_RC5 ntpdc/ntpdc-opts.c@1.256 +2 -2 NTP_4_2_6P2_RC5 ntpdc/ntpdc-opts.h@1.256 +3 -3 NTP_4_2_6P2_RC5 ntpdc/ntpdc-opts.texi@1.255 +2 -2 NTP_4_2_6P2_RC5 ntpdc/ntpdc.1@1.255 +2 -2 NTP_4_2_6P2_RC5 ntpq/ntpq-opts.c@1.257 +2 -2 NTP_4_2_6P2_RC5 ntpq/ntpq-opts.h@1.257 +3 -3 NTP_4_2_6P2_RC5 ntpq/ntpq-opts.texi@1.256 +2 -2 NTP_4_2_6P2_RC5 ntpq/ntpq.1@1.256 +2 -2 NTP_4_2_6P2_RC5 ntpsnmpd/ntpsnmpd-opts.c@1.136 +2 -2 NTP_4_2_6P2_RC5 ntpsnmpd/ntpsnmpd-opts.h@1.136 +3 -3 NTP_4_2_6P2_RC5 ntpsnmpd/ntpsnmpd-opts.texi@1.136 +24 -2 NTP_4_2_6P2_RC5 ntpsnmpd/ntpsnmpd.1@1.135 +2 -2 NTP_4_2_6P2_RC5 packageinfo.sh@1.273 +1 -1 NTP_4_2_6P2_RC5 sntp/sntp-opts.c@1.129 +2 -2 NTP_4_2_6P2_RC5 sntp/sntp-opts.h@1.129 +3 -3 NTP_4_2_6P2_RC5 sntp/sntp-opts.texi@1.129 +1 -1 NTP_4_2_6P2_RC5 sntp/sntp.1@1.129 +2 -2 NTP_4_2_6P2_RC5 sntp/sntp.html@1.19 +1 -1 NTP_4_2_6P2_RC5 util/ntp-keygen-opts.c@1.259 +2 -2 NTP_4_2_6P2_RC5 util/ntp-keygen-opts.h@1.259 +3 -3 NTP_4_2_6P2_RC5 util/ntp-keygen-opts.texi@1.258 +2 -2 NTP_4_2_6P2_RC5 util/ntp-keygen.1@1.258 +2 -2 NTP_4_2_6P2_RC5 ChangeSet@1.2182, 2010-05-31 18:59:05+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1565] sntp/crypto.c compile fails on MacOS over vsnprintf(). ChangeLog@1.636 +1 -0 [Bug 1565] sntp/crypto.c compile fails on MacOS over vsnprintf(). sntp/configure.ac@1.33 +1 -1 [Bug 1565] sntp/crypto.c compile fails on MacOS over vsnprintf(). ChangeSet@1.2181, 2010-05-24 15:46:36+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1. Windows port: do not exit in ntp_timestamp_from_counter() without first logging the reason. Support "passwd blah" syntax in ntpq. ChangeLog@1.635 +7 -0 [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1. Windows port: do not exit in ntp_timestamp_from_counter() without first logging the reason. Support "passwd blah" syntax in ntpq. include/ntp_stdlib.h@1.42 +1 -0 [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1. libntp/ssl_init.c@1.5 +25 -0 [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1. ntpdc/ntpdc.c@1.76 +2 -14 [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1. ntpq/ntpq.c@1.101 +16 -21 [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1. Support "passwd blah" syntax in ntpq. ports/winnt/ntpd/nt_clockstuff.c@1.40 +6 -3 Windows port: do not exit in ntp_timestamp_from_counter() without first logging the reason. ChangeSet@1.2180, 2010-05-19 00:02:06-04:00, stenn@deacon.udel.edu NTP_4_2_6P2_RC4 TAG: NTP_4_2_6P2_RC4 ChangeLog@1.634 +1 -0 NTP_4_2_6P2_RC4 ntpd/ntpd-opts.c@1.259 +2 -2 NTP_4_2_6P2_RC4 ntpd/ntpd-opts.h@1.259 +3 -3 NTP_4_2_6P2_RC4 ntpd/ntpd-opts.texi@1.257 +2 -2 NTP_4_2_6P2_RC4 ntpd/ntpd.1@1.257 +2 -2 NTP_4_2_6P2_RC4 ntpdc/ntpdc-opts.c@1.255 +2 -2 NTP_4_2_6P2_RC4 ntpdc/ntpdc-opts.h@1.255 +3 -3 NTP_4_2_6P2_RC4 ntpdc/ntpdc-opts.texi@1.254 +2 -2 NTP_4_2_6P2_RC4 ntpdc/ntpdc.1@1.254 +2 -2 NTP_4_2_6P2_RC4 ntpq/ntpq-opts.c@1.256 +2 -2 NTP_4_2_6P2_RC4 ntpq/ntpq-opts.h@1.256 +3 -3 NTP_4_2_6P2_RC4 ntpq/ntpq-opts.texi@1.255 +2 -2 NTP_4_2_6P2_RC4 ntpq/ntpq.1@1.255 +2 -2 NTP_4_2_6P2_RC4 ntpsnmpd/ntpsnmpd-opts.c@1.135 +2 -2 NTP_4_2_6P2_RC4 ntpsnmpd/ntpsnmpd-opts.h@1.135 +3 -3 NTP_4_2_6P2_RC4 ntpsnmpd/ntpsnmpd-opts.texi@1.135 +1 -1 NTP_4_2_6P2_RC4 ntpsnmpd/ntpsnmpd.1@1.134 +2 -2 NTP_4_2_6P2_RC4 packageinfo.sh@1.272 +1 -1 NTP_4_2_6P2_RC4 sntp/sntp-opts.c@1.128 +2 -2 NTP_4_2_6P2_RC4 sntp/sntp-opts.h@1.128 +3 -3 NTP_4_2_6P2_RC4 sntp/sntp-opts.texi@1.128 +1 -1 NTP_4_2_6P2_RC4 sntp/sntp.1@1.128 +2 -2 NTP_4_2_6P2_RC4 sntp/sntp.html@1.18 +1 -1 NTP_4_2_6P2_RC4 util/ntp-keygen-opts.c@1.258 +2 -2 NTP_4_2_6P2_RC4 util/ntp-keygen-opts.h@1.258 +3 -3 NTP_4_2_6P2_RC4 util/ntp-keygen-opts.texi@1.257 +2 -2 NTP_4_2_6P2_RC4 util/ntp-keygen.1@1.257 +2 -2 NTP_4_2_6P2_RC4 ChangeSet@1.2179, 2010-05-13 15:39:47+00:00, davehart@shiny.ad.hartbrothers.com * [Bug 1555] 4.2.6p2-RC3 sntp illegal C (mixed code and declarations). ChangeLog@1.633 +4 -0 * [Bug 1555] 4.2.6p2-RC3 sntp illegal C (mixed code and declarations). sntp/networking.c@1.35 +5 -3 * [Bug 1555] 4.2.6p2-RC3 sntp illegal C (mixed code and declarations). ChangeSet@1.2178, 2010-05-11 03:56:04-04:00, stenn@deacon.udel.edu NTP_4_2_6P2_RC3 TAG: NTP_4_2_6P2_RC3 ChangeLog@1.632 +1 -0 NTP_4_2_6P2_RC3 ntpd/ntpd-opts.c@1.258 +2 -2 NTP_4_2_6P2_RC3 ntpd/ntpd-opts.h@1.258 +3 -3 NTP_4_2_6P2_RC3 ntpd/ntpd-opts.texi@1.256 +2 -2 NTP_4_2_6P2_RC3 ntpd/ntpd.1@1.256 +2 -2 NTP_4_2_6P2_RC3 ntpdc/ntpdc-opts.c@1.254 +2 -2 NTP_4_2_6P2_RC3 ntpdc/ntpdc-opts.h@1.254 +3 -3 NTP_4_2_6P2_RC3 ntpdc/ntpdc-opts.texi@1.253 +2 -2 NTP_4_2_6P2_RC3 ntpdc/ntpdc.1@1.253 +2 -2 NTP_4_2_6P2_RC3 ntpq/ntpq-opts.c@1.255 +2 -2 NTP_4_2_6P2_RC3 ntpq/ntpq-opts.h@1.255 +3 -3 NTP_4_2_6P2_RC3 ntpq/ntpq-opts.texi@1.254 +2 -2 NTP_4_2_6P2_RC3 ntpq/ntpq.1@1.254 +2 -2 NTP_4_2_6P2_RC3 ntpsnmpd/ntpsnmpd-opts.c@1.134 +5 -5 NTP_4_2_6P2_RC3 ntpsnmpd/ntpsnmpd-opts.h@1.134 +4 -4 NTP_4_2_6P2_RC3 ntpsnmpd/ntpsnmpd-opts.texi@1.134 +2 -24 NTP_4_2_6P2_RC3 ntpsnmpd/ntpsnmpd.1@1.133 +2 -2 NTP_4_2_6P2_RC3 packageinfo.sh@1.271 +1 -1 NTP_4_2_6P2_RC3 sntp/sntp-opts.c@1.127 +2 -2 NTP_4_2_6P2_RC3 sntp/sntp-opts.h@1.127 +3 -3 NTP_4_2_6P2_RC3 sntp/sntp-opts.texi@1.127 +2 -60 NTP_4_2_6P2_RC3 sntp/sntp.1@1.127 +2 -2 NTP_4_2_6P2_RC3 sntp/sntp.html@1.17 +1 -1 NTP_4_2_6P2_RC3 util/ntp-keygen-opts.c@1.257 +2 -2 NTP_4_2_6P2_RC3 util/ntp-keygen-opts.h@1.257 +3 -3 NTP_4_2_6P2_RC3 util/ntp-keygen-opts.texi@1.256 +2 -2 NTP_4_2_6P2_RC3 util/ntp-keygen.1@1.256 +2 -2 NTP_4_2_6P2_RC3 ChangeSet@1.2171.1.1, 2010-05-11 02:31:19-04:00, stenn@deacon.udel.edu Windows compiling hints/winnt.html update from G. Sunil Tej ChangeLog@1.626.1.1 +1 -0 Windows compiling hints/winnt.html update from G. Sunil Tej html/hints/winnt.html@1.20 +13 -11 Windows compiling hints/winnt.html update from G. Sunil Tej ChangeSet@1.2176, 2010-05-11 04:44:37+00:00, davehart@shiny.ad.hartbrothers.com Add Nelson B Bolyard to html/copyright.html. Update ChangeLog entries to reflect filing of [Bug 1552], [Bug 1553]. ChangeLog@1.630 +2 -29 Update ChangeLog entries to reflect filing of [Bug 1552], [Bug 1553]. html/copyright.html@1.47 +4 -3 Add Nelson B Bolyard to html/copyright.html. ChangeSet@1.2175, 2010-05-10 13:16:18+00:00, davehart@shiny.ad.hartbrothers.com Simplify hash client code by providing OpenSSL EVP_*() API when built without OpenSSL. (from ntp-dev) Do not depend on ASCII values for ('A' - '0'), ('a' - '0') in sntp. ChangeLog@1.629 +3 -0 Simplify hash client code by providing OpenSSL EVP_*() API when built without OpenSSL. (from ntp-dev) Do not depend on ASCII values for ('A' - '0'), ('a' - '0') in sntp. include/ntp_md5.h@1.4 +21 -5 expose OpenSSL hash API even when building without OpenSSL, to simplify client code. Backport from ntp-dev. libntp/a_md5encrypt.c@1.27 +3 -38 expose OpenSSL hash API even when building without OpenSSL, to simplify client code. Backport from ntp-dev. sntp/crypto.c@1.12 +34 -64 remove s_keytype_from_text(), use similar keytype_from_text() from libntp. sntp/crypto.h@1.9 +4 -7 bring in line with other ntp_md5.h client code sntp/networking.c@1.34 +15 -16 Simplify hash client code by providing OpenSSL EVP_*() API when built without OpenSSL. (from ntp-dev) Do not depend on ASCII values for ('A' - '0'), ('a' - '0') in sntp. ChangeSet@1.2174, 2010-05-09 10:38:44+00:00, davehart@shiny.ad.hartbrothers.com Correct ChangeLog spelling of Nelson Bolyard's name, add email address. ChangeLog@1.628 +1 -1 Correct ChangeLog spelling of Nelson Bolyard's name, add email address. ChangeSet@1.2173, 2010-05-09 08:12:20+00:00, davehart@shiny.ad.hartbrothers.com cleanup prior changeset, ease -dev merge. ntpq/ntpq-subs.c@1.44 +7 -7 remove leftover of earlier approach, match AF_UNSPEC use to ntp-dev. align with ntp-dev regarding empty refid= value from ntpd. ntpq/ntpq.c@1.100 +1 -1 use const qualifier for makeascii char *. ntpq/ntpq.h@1.12 +1 -1 use const qualifier for makeascii char *. ChangeSet@1.2172, 2010-05-09 06:33:09+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1325] unreachable code in sntp recv_bcst_data(). [Bug 1459] sntp MD5 authentication does not work with ntpd. Many sntp fixes from Nelson Boyard: 1. sntp properly handles hex key strings in the keyfile, instead of just treating the text as binary strings. 2. sntp handles SHA1 as well as MD5. 3. If the key file contains more than one key, sntp can use keys other than the first one in the file. 4. sntp computes the MAC using the key, then the data (was other way). 5. sntp handles responses with extensions now. 6. sntp implements the -b (broadcast/multicast) option. Tested. The -b option takes an argument which is the broadcast/multicast address on which to listen for packets. The command still requires a host address at the end of the command line. This is the address expected to do the broadcasting/multicasting. 7. sntp correctly handles network-order key IDs on little-endian. 8. Eliminated a huge amount of code duplication between the sntp unicast and multicast code paths, creating a single process_pkt() function that is used for both paths after the packet is received. 9. The -t timeout option now works with both unicast and multicast. Previously it worked with neither. It wasn't coded for unicast, and was incorrectly coded for multicast. 10. In unicast mode, the requests are sent MACed using the key specified with the -a command line option. 11. Cleaned up indentation consistent with the predominant style in the files changed, namely, using tab stop characters and not spaces for indentation. This way, you can set your tab stop spacing as you like it and the indentation looks correct. This was not a big change. The files were mostly consistent before. 12. Eliminated LOTS of blank lines. sntp/configure.ac OpenSSL support now that sntp optionally uses it. Escape unprintable characters in a refid in ntpq -p billboard. ChangeLog@1.627 +32 -0 [Bug 1325] unreachable code in sntp recv_bcst_data(). [Bug 1459] sntp MD5 authentication does not work with ntpd. Many sntp fixes from Nelson Boyard: 1. sntp properly handles hex key strings in the keyfile, instead of just treating the text as binary strings. 2. sntp handles SHA1 as well as MD5. 3. If the key file contains more than one key, sntp can use keys other than the first one in the file. 4. sntp computes the MAC using the key, then the data (was other way). 5. sntp handles responses with extensions now. 6. sntp implements the -b (broadcast/multicast) option. Tested. The -b option takes an argument which is the broadcast/multicast address on which to listen for packets. The command still requires a host address at the end of the command line. This is the address expected to do the broadcasting/multicasting. 7. sntp correctly handles network-order key IDs on little-endian. 8. Eliminated a huge amount of code duplication between the sntp unicast and multicast code paths, creating a single process_pkt() function that is used for both paths after the packet is received. 9. The -t timeout option now works with both unicast and multicast. Previously it worked with neither. It wasn't coded for unicast, and was incorrectly coded for multicast. 10. In unicast mode, the requests are sent MACed using the key specified with the -a command line option. 11. Cleaned up indentation consistent with the predominant style in the files changed, namely, using tab stop characters and not spaces for indentation. This way, you can set your tab stop spacing as you like it and the indentation looks correct. This was not a big change. The files were mostly consistent before. 12. Eliminated LOTS of blank lines. sntp/configure.ac OpenSSL support now that sntp optionally uses it. Escape unprintable characters in a refid in ntpq -p billboard. configure.ac@1.476 +1 -175 sntp/configure.ac OpenSSL support now that sntp optionally uses it. m4/ntp_openssl.m4@1.1 +182 -0 moved from configure.ac to include to share with sntp/configure.ac m4/ntp_openssl.m4@1.0 +0 -0 ntpq/ntpq-subs.c@1.43 +9 -3 Escape unprintable characters in a refid in ntpq -p billboard. ntpq/ntpq.c@1.99 +1 -2 Escape unprintable characters in a refid in ntpq -p billboard. ntpq/ntpq.h@1.11 +1 -0 Escape unprintable characters in a refid in ntpq -p billboard. sntp/Makefile.am@1.29 +1 -1 add conditional -lcrypto to LDADD to link against OpenSSL. sntp/configure.ac@1.32 +3 -0 sntp/configure.ac OpenSSL support now that sntp optionally uses it. sntp/crypto.c@1.11 +134 -69 [Bug 1459] sntp MD5 authentication does not work with ntpd. Many sntp fixes from Nelson Boyard: 1. sntp properly handles hex key strings in the keyfile, instead of just treating the text as binary strings. 2. sntp handles SHA1 as well as MD5. 3. If the key file contains more than one key, sntp can use keys other than the first one in the file. 4. sntp computes the MAC using the key, then the data (was other way). 5. sntp handles responses with extensions now. 6. sntp implements the -b (broadcast/multicast) option. Tested. The -b option takes an argument which is the broadcast/multicast address on which to listen for packets. The command still requires a host address at the end of the command line. This is the address expected to do the broadcasting/multicasting. 7. sntp correctly handles network-order key IDs on little-endian. 8. Eliminated a huge amount of code duplication between the sntp unicast and multicast code paths, creating a single process_pkt() function that is used for both paths after the packet is received. 9. The -t timeout option now works with both unicast and multicast. Previously it worked with neither. It wasn't coded for unicast, and was incorrectly coded for multicast. 10. In unicast mode, the requests are sent MACed using the key specified with the -a command line option. 11. Cleaned up indentation consistent with the predominant style in the files changed, namely, using tab stop characters and not spaces for indentation. This way, you can set your tab stop spacing as you like it and the indentation looks correct. This was not a big change. The files were mostly consistent before. 12. Eliminated LOTS of blank lines. sntp/crypto.h@1.8 +12 -6 [Bug 1459] sntp MD5 authentication does not work with ntpd. Many sntp fixes from Nelson Boyard: 1. sntp properly handles hex key strings in the keyfile, instead of just treating the text as binary strings. 2. sntp handles SHA1 as well as MD5. 3. If the key file contains more than one key, sntp can use keys other than the first one in the file. 4. sntp computes the MAC using the key, then the data (was other way). 5. sntp handles responses with extensions now. 6. sntp implements the -b (broadcast/multicast) option. Tested. The -b option takes an argument which is the broadcast/multicast address on which to listen for packets. The command still requires a host address at the end of the command line. This is the address expected to do the broadcasting/multicasting. 7. sntp correctly handles network-order key IDs on little-endian. 8. Eliminated a huge amount of code duplication between the sntp unicast and multicast code paths, creating a single process_pkt() function that is used for both paths after the packet is received. 9. The -t timeout option now works with both unicast and multicast. Previously it worked with neither. It wasn't coded for unicast, and was incorrectly coded for multicast. 10. In unicast mode, the requests are sent MACed using the key specified with the -a command line option. 11. Cleaned up indentation consistent with the predominant style in the files changed, namely, using tab stop characters and not spaces for indentation. This way, you can set your tab stop spacing as you like it and the indentation looks correct. This was not a big change. The files were mostly consistent before. 12. Eliminated LOTS of blank lines. sntp/main.c@1.25 +110 -103 [Bug 1459] sntp MD5 authentication does not work with ntpd. Many sntp fixes from Nelson Boyard: 1. sntp properly handles hex key strings in the keyfile, instead of just treating the text as binary strings. 2. sntp handles SHA1 as well as MD5. 3. If the key file contains more than one key, sntp can use keys other than the first one in the file. 4. sntp computes the MAC using the key, then the data (was other way). 5. sntp handles responses with extensions now. 6. sntp implements the -b (broadcast/multicast) option. Tested. The -b option takes an argument which is the broadcast/multicast address on which to listen for packets. The command still requires a host address at the end of the command line. This is the address expected to do the broadcasting/multicasting. 7. sntp correctly handles network-order key IDs on little-endian. 8. Eliminated a huge amount of code duplication between the sntp unicast and multicast code paths, creating a single process_pkt() function that is used for both paths after the packet is received. 9. The -t timeout option now works with both unicast and multicast. Previously it worked with neither. It wasn't coded for unicast, and was incorrectly coded for multicast. 10. In unicast mode, the requests are sent MACed using the key specified with the -a command line option. 11. Cleaned up indentation consistent with the predominant style in the files changed, namely, using tab stop characters and not spaces for indentation. This way, you can set your tab stop spacing as you like it and the indentation looks correct. This was not a big change. The files were mostly consistent before. 12. Eliminated LOTS of blank lines. sntp/networking.c@1.33 +216 -432 [Bug 1325] unreachable code in sntp recv_bcst_data(). [Bug 1459] sntp MD5 authentication does not work with ntpd. Many sntp fixes from Nelson Boyard: 1. sntp properly handles hex key strings in the keyfile, instead of just treating the text as binary strings. 2. sntp handles SHA1 as well as MD5. 3. If the key file contains more than one key, sntp can use keys other than the first one in the file. 4. sntp computes the MAC using the key, then the data (was other way). 5. sntp handles responses with extensions now. 6. sntp implements the -b (broadcast/multicast) option. Tested. The -b option takes an argument which is the broadcast/multicast address on which to listen for packets. The command still requires a host address at the end of the command line. This is the address expected to do the broadcasting/multicasting. 7. sntp correctly handles network-order key IDs on little-endian. 8. Eliminated a huge amount of code duplication between the sntp unicast and multicast code paths, creating a single process_pkt() function that is used for both paths after the packet is received. 9. The -t timeout option now works with both unicast and multicast. Previously it worked with neither. It wasn't coded for unicast, and was incorrectly coded for multicast. 10. In unicast mode, the requests are sent MACed using the key specified with the -a command line option. 11. Cleaned up indentation consistent with the predominant style in the files changed, namely, using tab stop characters and not spaces for indentation. This way, you can set your tab stop spacing as you like it and the indentation looks correct. This was not a big change. The files were mostly consistent before. 12. Eliminated LOTS of blank lines. sntp/networking.h@1.18 +3 -3 [Bug 1459] sntp MD5 authentication does not work with ntpd. Many sntp fixes from Nelson Boyard: 1. sntp properly handles hex key strings in the keyfile, instead of just treating the text as binary strings. 2. sntp handles SHA1 as well as MD5. 3. If the key file contains more than one key, sntp can use keys other than the first one in the file. 4. sntp computes the MAC using the key, then the data (was other way). 5. sntp handles responses with extensions now. 6. sntp implements the -b (broadcast/multicast) option. Tested. The -b option takes an argument which is the broadcast/multicast address on which to listen for packets. The command still requires a host address at the end of the command line. This is the address expected to do the broadcasting/multicasting. 7. sntp correctly handles network-order key IDs on little-endian. 8. Eliminated a huge amount of code duplication between the sntp unicast and multicast code paths, creating a single process_pkt() function that is used for both paths after the packet is received. 9. The -t timeout option now works with both unicast and multicast. Previously it worked with neither. It wasn't coded for unicast, and was incorrectly coded for multicast. 10. In unicast mode, the requests are sent MACed using the key specified with the -a command line option. 11. Cleaned up indentation consistent with the predominant style in the files changed, namely, using tab stop characters and not spaces for indentation. This way, you can set your tab stop spacing as you like it and the indentation looks correct. This was not a big change. The files were mostly consistent before. 12. Eliminated LOTS of blank lines. ChangeSet@1.2171, 2010-05-03 04:35:06-04:00, stenn@deacon.udel.edu [Bug 1541] Fix wrong keyword for "maxclock". ChangeLog@1.626 +1 -0 [Bug 1541] Fix wrong keyword for "maxclock". html/decode.html@1.13 +2 -2 [Bug 1541] Fix wrong keyword for "maxclock". ChangeSet@1.2170, 2010-04-30 09:03:12+00:00, stenn@psp-fb1.ntp.org [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option. ChangeLog@1.625 +2 -0 [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option. ntpsnmpd/ntpsnmpd-opts.c@1.133 +29 -6 [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option. ntpsnmpd/ntpsnmpd-opts.def@1.2 +12 -0 [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option. ntpsnmpd/ntpsnmpd-opts.h@1.133 +17 -10 [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option. ntpsnmpd/ntpsnmpd-opts.texi@1.133 +33 -2 [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option. ntpsnmpd/ntpsnmpd.1@1.132 +11 -2 [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option. ntpsnmpd/ntpsnmpd.c@1.4 +1 -1 [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option. ChangeSet@1.2169, 2010-04-30 08:54:29+00:00, stenn@psp-fb1.ntp.org [Bug 1538] update refclock_nmea.c's call to getprotobyname() ChangeLog@1.624 +6 -0 [Bug 1538] update refclock_nmea.c's call to getprotobyname() ntpd/refclock_nmea.c@1.47 +1 -1 [Bug 1538] update refclock_nmea.c's call to getprotobyname() ChangeSet@1.2168, 2010-04-27 02:53:34-04:00, stenn@deacon.udel.edu NTP_4_2_6P2_RC2 TAG: NTP_4_2_6P2_RC2 ChangeLog@1.623 +1 -0 NTP_4_2_6P2_RC2 ntpd/ntpd-opts.c@1.257 +2 -2 NTP_4_2_6P2_RC2 ntpd/ntpd-opts.h@1.257 +3 -3 NTP_4_2_6P2_RC2 ntpd/ntpd-opts.texi@1.255 +2 -2 NTP_4_2_6P2_RC2 ntpd/ntpd.1@1.255 +2 -2 NTP_4_2_6P2_RC2 ntpdc/ntpdc-opts.c@1.253 +2 -2 NTP_4_2_6P2_RC2 ntpdc/ntpdc-opts.h@1.253 +3 -3 NTP_4_2_6P2_RC2 ntpdc/ntpdc-opts.texi@1.252 +2 -2 NTP_4_2_6P2_RC2 ntpdc/ntpdc.1@1.252 +2 -2 NTP_4_2_6P2_RC2 ntpq/ntpq-opts.c@1.254 +2 -2 NTP_4_2_6P2_RC2 ntpq/ntpq-opts.h@1.254 +3 -3 NTP_4_2_6P2_RC2 ntpq/ntpq-opts.texi@1.253 +2 -2 NTP_4_2_6P2_RC2 ntpq/ntpq.1@1.253 +2 -2 NTP_4_2_6P2_RC2 ntpsnmpd/ntpsnmpd-opts.c@1.132 +2 -2 NTP_4_2_6P2_RC2 ntpsnmpd/ntpsnmpd-opts.h@1.132 +3 -3 NTP_4_2_6P2_RC2 ntpsnmpd/ntpsnmpd-opts.texi@1.132 +1 -1 NTP_4_2_6P2_RC2 ntpsnmpd/ntpsnmpd.1@1.131 +2 -2 NTP_4_2_6P2_RC2 packageinfo.sh@1.270 +1 -1 NTP_4_2_6P2_RC2 sntp/sntp-opts.c@1.126 +2 -2 NTP_4_2_6P2_RC2 sntp/sntp-opts.h@1.126 +3 -3 NTP_4_2_6P2_RC2 sntp/sntp-opts.texi@1.126 +2 -2 NTP_4_2_6P2_RC2 sntp/sntp.1@1.126 +2 -2 NTP_4_2_6P2_RC2 sntp/sntp.html@1.16 +1 -1 NTP_4_2_6P2_RC2 util/ntp-keygen-opts.c@1.256 +2 -2 NTP_4_2_6P2_RC2 util/ntp-keygen-opts.h@1.256 +3 -3 NTP_4_2_6P2_RC2 util/ntp-keygen-opts.texi@1.255 +2 -2 NTP_4_2_6P2_RC2 util/ntp-keygen.1@1.255 +2 -2 NTP_4_2_6P2_RC2 ChangeSet@1.2167, 2010-04-24 05:57:35+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1534] win32/include/isc/net.h conflicts with VC++ 2010 errno.h. [Bug 1535] "restrict -4 default" and "restrict -6 default" ignored. ChangeLog@1.622 +4 -1 [Bug 1534] win32/include/isc/net.h conflicts with VC++ 2010 errno.h. [Bug 1535] "restrict -4 default" and "restrict -6 default" ignored. lib/isc/win32/include/isc/net.h@1.10 +30 -0 [Bug 1534] win32/include/isc/net.h conflicts with VC++ 2010 errno.h. ntpd/ntp_parser.c@1.54 +2 -2 Bison output from ntp_parser.y ntpd/ntp_parser.y@1.49 +2 -2 [Bug 1535] "restrict -4 default" and "restrict -6 default" ignored. ChangeSet@1.2166, 2010-04-20 01:55:16-04:00, stenn@deacon.udel.edu [Bug 1465] Make sure time from TS2100 is not invalid (backport from -dev) ChangeLog@1.621 +1 -0 [Bug 1465] Make sure time from TS2100 is not invalid (backport from -dev) ntpd/refclock_true.c@1.12 +2 -1 [Bug 1465] Make sure time from TS2100 is not invalid (backport from -dev) ChangeSet@1.2165, 2010-04-20 01:45:17-04:00, stenn@deacon.udel.edu [Bug 1528] Fix EDITLINE_LIBS link order for ntpq and ntpdc ChangeLog@1.620 +1 -0 [Bug 1528] Fix EDITLINE_LIBS link order for ntpq and ntpdc ntpdc/Makefile.am@1.52 +2 -2 [Bug 1528] Fix EDITLINE_LIBS link order for ntpq and ntpdc ntpq/Makefile.am@1.47 +2 -2 [Bug 1528] Fix EDITLINE_LIBS link order for ntpq and ntpdc ChangeSet@1.2164, 2010-04-20 01:30:11-04:00, stenn@deacon.udel.edu Remove --with-arlib from br-flock ChangeLog@1.619 +2 -0 Remove --with-arlib from br-flock br-flock@1.14 +1 -1 Remove --with-arlib from br-flock ChangeSet@1.2163, 2010-04-18 04:14:33-04:00, stenn@deacon.udel.edu NTP_4_2_6P2_RC1 TAG: NTP_4_2_6P2_RC1 ChangeLog@1.618 +1 -0 NTP_4_2_6P2_RC1 ntpd/ntpd-opts.c@1.256 +2 -2 NTP_4_2_6P2_RC1 ntpd/ntpd-opts.h@1.256 +3 -3 NTP_4_2_6P2_RC1 ntpd/ntpd-opts.texi@1.254 +2 -2 NTP_4_2_6P2_RC1 ntpd/ntpd.1@1.254 +2 -2 NTP_4_2_6P2_RC1 ntpdc/ntpdc-opts.c@1.252 +2 -2 NTP_4_2_6P2_RC1 ntpdc/ntpdc-opts.h@1.252 +3 -3 NTP_4_2_6P2_RC1 ntpdc/ntpdc-opts.texi@1.251 +2 -2 NTP_4_2_6P2_RC1 ntpdc/ntpdc.1@1.251 +2 -2 NTP_4_2_6P2_RC1 ntpq/ntpq-opts.c@1.253 +2 -2 NTP_4_2_6P2_RC1 ntpq/ntpq-opts.h@1.253 +3 -3 NTP_4_2_6P2_RC1 ntpq/ntpq-opts.texi@1.252 +2 -2 NTP_4_2_6P2_RC1 ntpq/ntpq.1@1.252 +2 -2 NTP_4_2_6P2_RC1 ntpsnmpd/ntpsnmpd-opts.c@1.131 +2 -2 NTP_4_2_6P2_RC1 ntpsnmpd/ntpsnmpd-opts.h@1.131 +3 -3 NTP_4_2_6P2_RC1 ntpsnmpd/ntpsnmpd-opts.texi@1.131 +1 -1 NTP_4_2_6P2_RC1 ntpsnmpd/ntpsnmpd.1@1.130 +2 -2 NTP_4_2_6P2_RC1 packageinfo.sh@1.269 +2 -2 NTP_4_2_6P2_RC1 sntp/sntp-opts.c@1.125 +2 -2 NTP_4_2_6P2_RC1 sntp/sntp-opts.h@1.125 +3 -3 NTP_4_2_6P2_RC1 sntp/sntp-opts.texi@1.125 +2 -2 NTP_4_2_6P2_RC1 sntp/sntp.1@1.125 +2 -2 NTP_4_2_6P2_RC1 sntp/sntp.html@1.15 +1 -1 NTP_4_2_6P2_RC1 util/ntp-keygen-opts.c@1.255 +2 -2 NTP_4_2_6P2_RC1 util/ntp-keygen-opts.h@1.255 +3 -3 NTP_4_2_6P2_RC1 util/ntp-keygen-opts.texi@1.254 +2 -2 NTP_4_2_6P2_RC1 util/ntp-keygen.1@1.254 +2 -2 NTP_4_2_6P2_RC1 ChangeSet@1.2162, 2010-04-18 03:57:37-04:00, stenn@deacon.udel.edu 4.2.6p2-RC1 packageinfo.sh@1.268 +1 -1 4.2.6p2-RC1 ChangeSet@1.2161, 2010-04-16 13:59:44+00:00, davehart@shiny.ad.hartbrothers.com fix backport (should have copied and pasted from -dev). sntp/networking.c@1.32 +2 -2 fix backport (should have copied and pasted from -dev). ChangeSet@1.2158, 2010-04-14 21:16:25+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1518] Windows ntpd should lock to one processor more conservatively. ChangeLog@1.613.2.1 +5 -0 [Bug 1518] Windows ntpd should lock to one processor more conservatively. applies to previous changeset, deferred to ease pulling the prior changeset into -dev ahead of -stable. ChangeSet@1.2156.2.2, 2010-04-14 20:55:27+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1522] Enable range syntax "trustedkey (301 ... 399)". Update html/authopt.html controlkey, requestkey, and trustedkey docs. ChangeLog@1.613.1.1 +5 -0 [Bug 1522] Enable range syntax "trustedkey (301 ... 399)". Update html/authopt.html controlkey, requestkey, and trustedkey docs. The first entry applies to the prior changeset, which intentionally lacked a ChangeLog entry to smooth pulling into -dev before -stable. html/authopt.html@1.60 +29 -7 Update html/authopt.html controlkey, requestkey, and trustedkey docs, add range syntax to trustedkey docs. ChangeSet@1.2156.1.3, 2010-04-14 04:44:52+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong. [Bug 1504] ntpdate tickles ntpd "discard minimum 1" rate limit if "restrict ... limited" is used. ChangeLog@1.615 +6 -0 [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong. [Bug 1504] ntpdate tickles ntpd "discard minimum 1" rate limit if "restrict ... limited" is used. include/ntp.h@1.169 +25 -16 [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong. include/ntp_lists.h@1.2 +163 -10 [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong. include/ntp_net.h@1.4 +34 -13 [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong. include/ntpd.h@1.138 +4 -4 [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong. ntpd/ntp_io.c@1.310 +2 -2 [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong. ntpd/ntp_monitor.c@1.26 +4 -4 [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong. ntpd/ntp_request.c@1.83 +72 -37 [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong. ntpd/ntp_restrict.c@1.28 +448 -429 [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong. ntpdate/ntpdate.c@1.70 +63 -55 [Bug 1504] ntpdate tickles ntpd "discard minimum 1" rate limit if "restrict ... limited" is used. ntpdate/ntpdate.h@1.11 +2 -1 [Bug 1504] ntpdate tickles ntpd "discard minimum 1" rate limit if "restrict ... limited" is used. ntpdc/ntpdc_ops.c@1.63 +3 -3 [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong. sntp/networking.c@1.31 +2 -2 [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong. ChangeSet@1.2156.2.1, 2010-04-10 02:26:43+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1522] Enable range syntax "trustedkey (301 ... 399)". include/ntp_config.h@1.68 +7 -5 add u_int u to attr_val.value union. include/ntp_stdlib.h@1.41 +2 -0 add extern ref to int cache_key from authkeys.c ntpd/complete.conf@1.4 +1 -1 add key ranges to trustedkey ntpd/keyword-gen-utd@1.2 +1 -1 to indicate ntp_keyword.h is current with keyword-gen.c ntpd/keyword-gen.c@1.6 +1 -0 add T_Ellipsis "..." for trustedkey (1...65533) 65534 syntax support. ntpd/ntp_config.c@1.244 +45 -14 support key ranges for trustedkey ntpd/ntp_keyword.h@1.4 +848 -844 add "..." T_Ellipsis ntpd/ntp_parser.c@1.53 +918 -894 Bison output ntpd/ntp_parser.h@1.33 +265 -263 Bison output ntpd/ntp_parser.y@1.48 +23 -1 support key ranges for trustedkey ChangeSet@1.2156.1.2, 2010-04-09 08:15:04+00:00, stenn@deacon.udel.edu NTP_4_2_6P1 TAG: NTP_4_2_6P1 ChangeLog@1.614 +1 -0 NTP_4_2_6P1 ntpd/ntpd-opts.c@1.255 +2 -2 NTP_4_2_6P1 ntpd/ntpd-opts.h@1.255 +3 -3 NTP_4_2_6P1 ntpd/ntpd-opts.texi@1.253 +2 -2 NTP_4_2_6P1 ntpd/ntpd.1@1.253 +2 -2 NTP_4_2_6P1 ntpdc/ntpdc-opts.c@1.251 +2 -2 NTP_4_2_6P1 ntpdc/ntpdc-opts.h@1.251 +3 -3 NTP_4_2_6P1 ntpdc/ntpdc-opts.texi@1.250 +2 -2 NTP_4_2_6P1 ntpdc/ntpdc.1@1.250 +2 -2 NTP_4_2_6P1 ntpq/ntpq-opts.c@1.252 +2 -2 NTP_4_2_6P1 ntpq/ntpq-opts.h@1.252 +3 -3 NTP_4_2_6P1 ntpq/ntpq-opts.texi@1.251 +2 -2 NTP_4_2_6P1 ntpq/ntpq.1@1.251 +2 -2 NTP_4_2_6P1 ntpsnmpd/ntpsnmpd-opts.c@1.130 +2 -2 NTP_4_2_6P1 ntpsnmpd/ntpsnmpd-opts.h@1.130 +3 -3 NTP_4_2_6P1 ntpsnmpd/ntpsnmpd-opts.texi@1.130 +1 -1 NTP_4_2_6P1 ntpsnmpd/ntpsnmpd.1@1.129 +2 -2 NTP_4_2_6P1 packageinfo.sh@1.267 +2 -2 NTP_4_2_6P1 sntp/sntp-opts.c@1.124 +2 -2 NTP_4_2_6P1 sntp/sntp-opts.h@1.124 +3 -3 NTP_4_2_6P1 sntp/sntp-opts.texi@1.124 +2 -2 NTP_4_2_6P1 sntp/sntp.1@1.124 +2 -2 NTP_4_2_6P1 sntp/sntp.html@1.14 +1 -1 NTP_4_2_6P1 util/ntp-keygen-opts.c@1.254 +2 -2 NTP_4_2_6P1 util/ntp-keygen-opts.h@1.254 +3 -3 NTP_4_2_6P1 util/ntp-keygen-opts.texi@1.253 +2 -2 NTP_4_2_6P1 util/ntp-keygen.1@1.253 +2 -2 NTP_4_2_6P1 ChangeSet@1.2156.1.1, 2010-04-09 03:43:19-04:00, stenn@deacon.udel.edu Release ntp-4.2.6p1 NEWS@1.106 +14 -0 Release ntp-4.2.6p1 packageinfo.sh@1.266 +1 -1 Release ntp-4.2.6p1 ChangeSet@1.2157, 2010-04-06 05:37:52+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1518] Windows ntpd should lock to one processor more conservatively. ports/winnt/ntpd/nt_clockstuff.c@1.39 +144 -108 [Bug 1518] Windows ntpd should lock to one processor more conservatively. ChangeSet@1.2156, 2010-04-01 03:33:20-04:00, stenn@deacon.udel.edu lose whimsy from br-flock br-flock@1.13 +1 -1 lose whimsy from br-flock ChangeSet@1.2155, 2010-03-31 08:45:31+00:00, stenn@deacon.udel.edu NTP_4_2_6P1_RC6 TAG: NTP_4_2_6P1_RC6 ChangeLog@1.613 +1 -0 NTP_4_2_6P1_RC6 ntpd/ntpd-opts.c@1.254 +2 -2 NTP_4_2_6P1_RC6 ntpd/ntpd-opts.h@1.254 +3 -3 NTP_4_2_6P1_RC6 ntpd/ntpd-opts.texi@1.252 +2 -2 NTP_4_2_6P1_RC6 ntpd/ntpd.1@1.252 +2 -2 NTP_4_2_6P1_RC6 ntpdc/ntpdc-opts.c@1.250 +2 -2 NTP_4_2_6P1_RC6 ntpdc/ntpdc-opts.h@1.250 +3 -3 NTP_4_2_6P1_RC6 ntpdc/ntpdc-opts.texi@1.249 +2 -2 NTP_4_2_6P1_RC6 ntpdc/ntpdc.1@1.249 +2 -2 NTP_4_2_6P1_RC6 ntpq/ntpq-opts.c@1.251 +2 -2 NTP_4_2_6P1_RC6 ntpq/ntpq-opts.h@1.251 +3 -3 NTP_4_2_6P1_RC6 ntpq/ntpq-opts.texi@1.250 +2 -2 NTP_4_2_6P1_RC6 ntpq/ntpq.1@1.250 +2 -2 NTP_4_2_6P1_RC6 ntpsnmpd/ntpsnmpd-opts.c@1.129 +2 -2 NTP_4_2_6P1_RC6 ntpsnmpd/ntpsnmpd-opts.h@1.129 +3 -3 NTP_4_2_6P1_RC6 ntpsnmpd/ntpsnmpd-opts.texi@1.129 +2 -23 NTP_4_2_6P1_RC6 ntpsnmpd/ntpsnmpd.1@1.128 +2 -2 NTP_4_2_6P1_RC6 packageinfo.sh@1.265 +1 -1 NTP_4_2_6P1_RC6 sntp/sntp-opts.c@1.123 +2 -2 NTP_4_2_6P1_RC6 sntp/sntp-opts.h@1.123 +3 -3 NTP_4_2_6P1_RC6 sntp/sntp-opts.texi@1.123 +2 -2 NTP_4_2_6P1_RC6 sntp/sntp.1@1.123 +2 -2 NTP_4_2_6P1_RC6 sntp/sntp.html@1.13 +10 -14 NTP_4_2_6P1_RC6 util/ntp-keygen-opts.c@1.253 +2 -2 NTP_4_2_6P1_RC6 util/ntp-keygen-opts.h@1.253 +3 -3 NTP_4_2_6P1_RC6 util/ntp-keygen-opts.texi@1.252 +2 -2 NTP_4_2_6P1_RC6 util/ntp-keygen.1@1.252 +2 -2 NTP_4_2_6P1_RC6 ChangeSet@1.2154, 2010-03-31 04:14:28-04:00, stenn@deacon.udel.edu Quiet some trigger debugging BitKeeper/triggers/triggert@1.8 +1 -1 Quiet some trigger debugging ChangeSet@1.2153, 2010-03-31 04:11:55-04:00, stenn@deacon.udel.edu [Bug 1514] Typo in ntp_proto.c: fabs(foo < .4) should be fabs(foo) < .4 ChangeLog@1.612 +1 -0 [Bug 1514] Typo in ntp_proto.c: fabs(foo < .4) should be fabs(foo) < .4 ntpd/ntp_proto.c@1.298 +1 -1 [Bug 1514] Typo in ntp_proto.c: fabs(foo < .4) should be fabs(foo) < .4 ChangeSet@1.2152, 2010-03-31 03:17:27-04:00, stenn@deacon.udel.edu trigger cleanup BitKeeper/triggers/trigger.README@1.5 +5 -3 trigger cleanup BitKeeper/triggers/trigger.cfg@1.13 +6 -0 trigger cleanup BitKeeper/triggers/trigger.mk@1.10 +3 -1 trigger cleanup BitKeeper/triggers/triggert@1.7 +17 -6 trigger cleanup ChangeSet@1.2151, 2010-03-29 05:16:32-04:00, stenn@deacon.udel.edu With the new bk, the trigger push needs the -q (quiet) flag BitKeeper/triggers/2mirrors@1.5 +3 -3 With the new bk, the trigger push needs the -q (quiet) flag ChangeSet@1.2150, 2010-02-15 23:19:19+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1464] synchronization source wrong for refclocks ARCRON_MSF (27) and SHM (28). Correct Windows port's refclock_open() to return 0 on failure not -1. Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from refclock_open() on failure. Correct "SIMUL=4 ./flock-build -1" to prioritize -1/--one. ChangeLog@1.611 +9 -0 [Bug 1464] synchronization source wrong for refclocks ARCRON_MSF (27) and SHM (28). Correct Windows port's refclock_open() to return 0 on failure not -1. Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from refclock_open() on failure. Correct "SIMUL=4 ./flock-build -1" to prioritize -1/--one. flock-build@1.45 +26 -21 Correct "SIMUL=4 ./flock-build -1" to prioritize -1/--one. ntpd/ntp_control.c@1.133 +2 -2 [Bug 1464] synchronization source wrong for refclocks ARCRON_MSF (27) and SHM (28). ntpd/ntp_refclock.c@1.92 +4 -1 Correct Windows port's refclock_open() to return 0 on failure not -1. Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from refclock_open() on failure. ntpd/refclock_chu.c@1.47 +1 -1 Correct Windows port's refclock_open() to return 0 on failure not -1. Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from refclock_open() on failure. ntpd/refclock_dumbclock.c@1.15 +1 -1 Correct Windows port's refclock_open() to return 0 on failure not -1. Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from refclock_open() on failure. ntpd/refclock_wwvb.c@1.24 +1 -1 Correct Windows port's refclock_open() to return 0 on failure not -1. Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from refclock_open() on failure. ports/winnt/ntpd/win32_io.c@1.20 +15 -9 Correct Windows port's refclock_open() to return 0 on failure not -1. Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from refclock_open() on failure. ChangeSet@1.2149, 2010-02-09 10:34:59+00:00, stenn@whimsy.udel.edu NTP_4_2_6P1_RC5 TAG: NTP_4_2_6P1_RC5 ChangeLog@1.610 +1 -0 NTP_4_2_6P1_RC5 ntpd/ntpd-opts.c@1.253 +2 -2 NTP_4_2_6P1_RC5 ntpd/ntpd-opts.h@1.253 +3 -3 NTP_4_2_6P1_RC5 ntpd/ntpd-opts.texi@1.251 +2 -2 NTP_4_2_6P1_RC5 ntpd/ntpd.1@1.251 +2 -2 NTP_4_2_6P1_RC5 ntpdc/ntpdc-opts.c@1.249 +2 -2 NTP_4_2_6P1_RC5 ntpdc/ntpdc-opts.h@1.249 +3 -3 NTP_4_2_6P1_RC5 ntpdc/ntpdc-opts.texi@1.248 +2 -2 NTP_4_2_6P1_RC5 ntpdc/ntpdc.1@1.248 +2 -2 NTP_4_2_6P1_RC5 ntpq/ntpq-opts.c@1.250 +2 -2 NTP_4_2_6P1_RC5 ntpq/ntpq-opts.h@1.250 +3 -3 NTP_4_2_6P1_RC5 ntpq/ntpq-opts.texi@1.249 +2 -2 NTP_4_2_6P1_RC5 ntpq/ntpq.1@1.249 +2 -2 NTP_4_2_6P1_RC5 ntpsnmpd/ntpsnmpd-opts.c@1.128 +2 -2 NTP_4_2_6P1_RC5 ntpsnmpd/ntpsnmpd-opts.h@1.128 +3 -3 NTP_4_2_6P1_RC5 ntpsnmpd/ntpsnmpd-opts.texi@1.128 +2 -2 NTP_4_2_6P1_RC5 ntpsnmpd/ntpsnmpd.1@1.127 +2 -2 NTP_4_2_6P1_RC5 packageinfo.sh@1.264 +1 -1 NTP_4_2_6P1_RC5 sntp/sntp-opts.c@1.122 +2 -2 NTP_4_2_6P1_RC5 sntp/sntp-opts.h@1.122 +3 -3 NTP_4_2_6P1_RC5 sntp/sntp-opts.texi@1.122 +2 -2 NTP_4_2_6P1_RC5 sntp/sntp.1@1.122 +2 -2 NTP_4_2_6P1_RC5 sntp/sntp.html@1.12 +1 -1 NTP_4_2_6P1_RC5 util/ntp-keygen-opts.c@1.252 +2 -2 NTP_4_2_6P1_RC5 util/ntp-keygen-opts.h@1.252 +3 -3 NTP_4_2_6P1_RC5 util/ntp-keygen-opts.texi@1.251 +2 -2 NTP_4_2_6P1_RC5 util/ntp-keygen.1@1.251 +2 -2 NTP_4_2_6P1_RC5 ChangeSet@1.2148, 2010-02-09 04:02:59-05:00, stenn@whimsy.udel.edu [Bug 1438] Remove dead code from sntp/networking.c ChangeLog@1.609 +1 -0 [Bug 1438] Remove dead code from sntp/networking.c sntp/networking.c@1.30 +0 -1 [Bug 1438] Remove dead code from sntp/networking.c ChangeSet@1.2145.1.1, 2010-02-09 02:49:34-05:00, stenn@whimsy.udel.edu [Bug 1140] Clean up debug.html, decode.html, and ntpq.html ChangeLog@1.606.1.1 +1 -0 [Bug 1140] Clean up debug.html, decode.html, and ntpq.html html/debug.html@1.28 +3 -3 [Bug 1140] Clean up debug.html, decode.html, and ntpq.html html/decode.html@1.12 +11 -7 [Bug 1140] Clean up debug.html, decode.html, and ntpq.html html/ntpq.html@1.37 +11 -7 [Bug 1140] Clean up debug.html, decode.html, and ntpq.html ChangeSet@1.2146, 2010-02-08 14:11:12+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1478] linking fails with undefined reference EVP_MD_pkey_type. [Bug 1479] Compilation fails because of not finding readline headers. [Bug 1484] ushort is not defined in QNX6. ChangeLog@1.607 +3 -0 [Bug 1478] linking fails with undefined reference EVP_MD_pkey_type. [Bug 1479] Compilation fails because of not finding readline headers. [Bug 1484] ushort is not defined in QNX6. include/mbg_gps166.h@1.10 +1 -1 [Bug 1484] ushort is not defined in QNX6. libntp/ntp_lineedit.c@1.8 +29 -32 [Bug 1479] Compilation fails because of not finding readline headers. m4/ntp_lineeditlibs.m4@1.7 +0 -2 [Bug 1479] Compilation fails because of not finding readline headers. ntpd/ntp_control.c@1.132 +1 -0 [Bug 1478] linking fails with undefined reference EVP_MD_pkey_type. ChangeSet@1.2145, 2010-02-05 22:26:34+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1480] snprintf() cleanup caused unterminated refclock IDs. ChangeLog@1.606 +1 -0 [Bug 1480] snprintf() cleanup caused unterminated refclock IDs. ntpd/ntp_control.c@1.131 +1 -1 [Bug 1480] snprintf() cleanup caused unterminated refclock IDs. ChangeSet@1.2144, 2010-02-04 23:13:52+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1477] 1st non-gmake make in clone w/VPATH can't make COPYRIGHT. ChangeLog@1.605 +4 -0 [Bug 1477] 1st non-gmake make in clone w/VPATH can't make COPYRIGHT. Makefile.am@1.93 +3 -3 [Bug 1477] 1st non-gmake make in clone w/VPATH can't make COPYRIGHT. sntp/Makefile.am@1.28 +3 -3 [Bug 1477] 1st non-gmake make in clone w/VPATH can't make COPYRIGHT. ChangeSet@1.2143, 2010-02-04 02:57:49-05:00, stenn@whimsy.udel.edu NTP_4_2_6P1_RC4 TAG: NTP_4_2_6P1_RC4 ChangeLog@1.604 +1 -0 NTP_4_2_6P1_RC4 ntpd/ntpd-opts.c@1.252 +2 -2 NTP_4_2_6P1_RC4 ntpd/ntpd-opts.h@1.252 +3 -3 NTP_4_2_6P1_RC4 ntpd/ntpd-opts.texi@1.250 +2 -2 NTP_4_2_6P1_RC4 ntpd/ntpd.1@1.250 +2 -2 NTP_4_2_6P1_RC4 ntpdc/ntpdc-opts.c@1.248 +2 -2 NTP_4_2_6P1_RC4 ntpdc/ntpdc-opts.h@1.248 +3 -3 NTP_4_2_6P1_RC4 ntpdc/ntpdc-opts.texi@1.247 +2 -2 NTP_4_2_6P1_RC4 ntpdc/ntpdc.1@1.247 +2 -2 NTP_4_2_6P1_RC4 ntpq/ntpq-opts.c@1.249 +2 -2 NTP_4_2_6P1_RC4 ntpq/ntpq-opts.h@1.249 +3 -3 NTP_4_2_6P1_RC4 ntpq/ntpq-opts.texi@1.248 +2 -2 NTP_4_2_6P1_RC4 ntpq/ntpq.1@1.248 +2 -2 NTP_4_2_6P1_RC4 ntpsnmpd/ntpsnmpd-opts.c@1.127 +2 -2 NTP_4_2_6P1_RC4 ntpsnmpd/ntpsnmpd-opts.h@1.127 +3 -3 NTP_4_2_6P1_RC4 ntpsnmpd/ntpsnmpd-opts.texi@1.127 +2 -2 NTP_4_2_6P1_RC4 ntpsnmpd/ntpsnmpd.1@1.126 +2 -2 NTP_4_2_6P1_RC4 packageinfo.sh@1.263 +1 -1 NTP_4_2_6P1_RC4 sntp/sntp-opts.c@1.121 +2 -2 NTP_4_2_6P1_RC4 sntp/sntp-opts.h@1.121 +3 -3 NTP_4_2_6P1_RC4 sntp/sntp-opts.texi@1.121 +2 -2 NTP_4_2_6P1_RC4 sntp/sntp.1@1.121 +2 -2 NTP_4_2_6P1_RC4 sntp/sntp.html@1.11 +1 -1 NTP_4_2_6P1_RC4 util/ntp-keygen-opts.c@1.251 +2 -2 NTP_4_2_6P1_RC4 util/ntp-keygen-opts.h@1.251 +3 -3 NTP_4_2_6P1_RC4 util/ntp-keygen-opts.texi@1.250 +2 -2 NTP_4_2_6P1_RC4 util/ntp-keygen.1@1.250 +2 -2 NTP_4_2_6P1_RC4 ChangeSet@1.2142, 2010-02-04 03:01:42+00:00, hart@psp-fb1.ntp.org Makefile.am: fix make distdir before make all on FreeBSD make Makefile.am@1.92 +5 -5 fix make distdir before make all on FreeBSD make sntp/Makefile.am@1.27 +26 -25 fix make distdir before make all on FreeBSD make ChangeSet@1.2141, 2010-02-03 23:51:52+00:00, davehart@shiny.ad.hartbrothers.com Remove arlib. BitKeeper/deleted/.del-COPYING~1e5c94deb8b25a03@1.3 +0 -0 Rename: arlib/COPYING -> BitKeeper/deleted/.del-COPYING~1e5c94deb8b25a03 BitKeeper/deleted/.del-INSTALL~4c77da0d9f1f3464@1.2 +0 -0 Rename: arlib/INSTALL -> BitKeeper/deleted/.del-INSTALL~4c77da0d9f1f3464 BitKeeper/deleted/.del-Makefile.am~501d14b0d06d3031@1.4 +0 -0 Rename: arlib/Makefile.am -> BitKeeper/deleted/.del-Makefile.am~501d14b0d06d3031 BitKeeper/deleted/.del-README~4de4615d76ebba47@1.2 +0 -0 Rename: arlib/README -> BitKeeper/deleted/.del-README~4de4615d76ebba47 BitKeeper/deleted/.del-UNSHAR.HDR~6aa2f933ef5d86df@1.2 +0 -0 Rename: arlib/UNSHAR.HDR -> BitKeeper/deleted/.del-UNSHAR.HDR~6aa2f933ef5d86df BitKeeper/deleted/.del-arlib.3~11ae3dd9cdb6a32@1.2 +0 -0 Rename: arlib/arlib.3 -> BitKeeper/deleted/.del-arlib.3~11ae3dd9cdb6a32 BitKeeper/deleted/.del-arlib.c~fdde50d6ab7b6f64@1.2 +0 -0 Rename: arlib/arlib.c -> BitKeeper/deleted/.del-arlib.c~fdde50d6ab7b6f64 BitKeeper/deleted/.del-arlib.h~22218072d10baf8e@1.2 +0 -0 Rename: arlib/arlib.h -> BitKeeper/deleted/.del-arlib.h~22218072d10baf8e BitKeeper/deleted/.del-arplib.h~8ccbd9af28d9aa3b@1.2 +0 -0 Rename: arlib/arplib.h -> BitKeeper/deleted/.del-arplib.h~8ccbd9af28d9aa3b BitKeeper/deleted/.del-configure.in~282cad3ea077c564@1.4 +0 -0 Rename: arlib/configure.in -> BitKeeper/deleted/.del-configure.in~282cad3ea077c564 BitKeeper/deleted/.del-sample.c~4c74b15f3881e611@1.2 +0 -0 Rename: arlib/sample.c -> BitKeeper/deleted/.del-sample.c~4c74b15f3881e611 ChangeLog@1.603 +1 -0 Remove arlib. Makefile.am@1.91 +1 -4 Remove arlib. configure.ac@1.475 +7 -13 Remove arlib, replace --with-arlib handling with deprecation warning. ChangeSet@1.2140, 2010-02-03 05:28:18-05:00, stenn@whimsy.udel.edu [Bug 1474] ntp_keygen needs LCRYPTO after libntp.a ChangeLog@1.602 +1 -0 [Bug 1474] ntp_keygen needs LCRYPTO after libntp.a util/Makefile.am@1.49 +1 -1 [Bug 1474] ntp_keygen needs LCRYPTO after libntp.a ChangeSet@1.2139, 2010-02-03 04:58:33+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1455] ntpd does not try /etc/ntp.audio as documented. Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ChangeLog@1.601 +4 -0 [Bug 1455] ntpd does not try /etc/ntp.audio as documented. Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. lib/isc/win32/interfaceiter.c@1.17 +11 -8 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). libntp/audio.c@1.27 +8 -5 [Bug 1455] ntpd does not try /etc/ntp.audio as documented. Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). libntp/findconfig.c@1.3 +3 -3 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). libntp/humandate.c@1.8 +7 -6 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). libntp/modetoa.c@1.3 +2 -2 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). libntp/prettydate.c@1.13 +11 -10 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). libntp/uglydate.c@1.4 +5 -3 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). libntp/uinttoa.c@1.3 +1 -1 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). ntpd/ntp_control.c@1.130 +35 -32 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). ntpd/refclock_arbiter.c@1.15 +9 -9 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. ntpd/refclock_arc.c@1.22 +13 -7 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_as2201.c@1.11 +9 -10 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_atom.c@1.61 +4 -3 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). ntpd/refclock_bancomm.c@1.12 +28 -21 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. ntpd/refclock_chronolog.c@1.9 +10 -10 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_chu.c@1.46 +44 -20 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_dumbclock.c@1.14 +10 -6 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_gpsvme.c@1.8 +10 -11 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_heath.c@1.15 +6 -4 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. ntpd/refclock_hopfpci.c@1.11 +18 -26 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_hopfser.c@1.14 +13 -18 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_hpgps.c@1.10 +9 -10 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_irig.c@1.32 +11 -11 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_jjy.c@1.18 +22 -22 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_jupiter.c@1.22 +6 -10 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_leitch.c@1.11 +12 -3 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). call io_closeclock() on shutdown if io_addclock() succeeded. ntpd/refclock_msfees.c@1.13 +20 -13 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). ntpd/refclock_mx4200.c@1.25 +11 -12 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_palisade.c@1.32 +11 -6 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. ntpd/refclock_parse.c@1.52 +3 -3 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). ntpd/refclock_pcf.c@1.10 +2 -2 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). ntpd/refclock_pst.c@1.10 +9 -9 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_shm.c@1.21 +8 -6 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_tpro.c@1.11 +12 -14 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_trak.c@1.9 +8 -9 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. Remove some dead code checking for emalloc() returning NULL. ntpd/refclock_wwvb.c@1.23 +10 -6 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). Fix widely cut-n-pasted bug in refclock shutdown after failed start. ntpq/ntpq-subs.c@1.42 +28 -22 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). ntpq/ntpq.c@1.98 +23 -12 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). ports/winnt/ntpd/hopf_PCI_io.c@1.7 +173 -136 Convert many sprintf() calls to snprintf(), also strcpy(), strcat(). clean up indent mess. ports/winnt/vs2008/libntp/libntp.vcproj@1.25 +6 -2 add reference to libntp/audio.c ChangeSet@1.2138, 2010-02-02 08:09:04+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1473] "make distcheck" before build can't make sntp/version.m4. ChangeLog@1.600 +1 -0 [Bug 1473] "make distcheck" before build can't make sntp/version.m4. Makefile.am@1.90 +12 -1 add COPYRIGHT-please target for use by sntp/Makefile.am minor tweak to COPYRIGHT action to create intermediate file in build dir not $(srcdir) to minimize parallel VPATH makes interfering with each other. add do-nothing action for rule lacking one to avoid any use of SCCS get default. sntp/Makefile.am@1.26 +34 -5 [Bug 1473] "make distcheck" before build can't make sntp/version.m4. add targets for autogen-version.def, version.def, version.m4, and version.texi which invoke a submake on the corresponding check-* targets, avoiding an explicit dependency which would cause Autogen to be invoked to make sntp-opts.h, which would be considered out- of-date because version.def is, and version,def because it depends on non-existent check-version.def. The submake ensures the check action is taken without introducing the troublesome dependency. use "cd .. && $(MAKE) COPYRIGHT-please" to work around quirk with FreeBSD 6.x make which fails with "make COPYRIGHT" when "make ./COPYRIGHT" would work. ChangeSet@1.2137, 2010-02-02 01:29:56+00:00, davehart@shiny.ad.hartbrothers.com Makefile.am: keyword-gen-utd is intended to have one line of content. ntpd/Makefile.am@1.87 +1 -1 keyword-gen-utd is intended to have one line of content. ChangeSet@1.2136, 2010-02-01 01:56:41+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1470] "make distdir" in $srcdir builds keyword-gen, libntp.a. ChangeLog@1.599 +1 -0 [Bug 1470] "make distdir" in $srcdir builds keyword-gen, libntp.a. bootstrap@1.31 +5 -6 add ntpd/keyword-gen.out to touch targets, at same time as ntp_parser.h. ntpd/Makefile.am@1.86 +41 -26 [Bug 1470] "make distdir" in $srcdir builds keyword-gen, libntp.a. Avoid building keyword-gen if its output is up-to-date in general. ntpd/keyword-gen-utd@1.1 +1 -0 intermediate Makefile target used in avoiding building keyword-gen after bootstrap or from tarball unless sources change, necessary to ensure "make distdir" can succeed before compiling without compiling. See [Bug 1470]. ntpd/keyword-gen-utd@1.0 +0 -0 ChangeSet@1.2135, 2010-01-30 18:06:35-05:00, stenn@whimsy.udel.edu [Bug 1467] Fix bogus rebuild of sntp/sntp.html ChangeLog@1.598 +4 -0 [Bug 1467] Fix bogus rebuild of sntp/sntp.html bootstrap@1.30 +1 -1 [Bug 1467] Fix bogus rebuild of sntp/sntp.html ChangeSet@1.2134, 2010-01-24 10:31:32+00:00, stenn@whimsy.udel.edu NTP_4_2_6P1_RC3 TAG: NTP_4_2_6P1_RC3 ChangeLog@1.597 +1 -0 NTP_4_2_6P1_RC3 ntpd/ntpd-opts.c@1.251 +4 -4 NTP_4_2_6P1_RC3 ntpd/ntpd-opts.h@1.251 +4 -4 NTP_4_2_6P1_RC3 ntpd/ntpd-opts.texi@1.249 +2 -2 NTP_4_2_6P1_RC3 ntpd/ntpd.1@1.249 +2 -2 NTP_4_2_6P1_RC3 ntpdc/ntpdc-opts.c@1.247 +4 -4 NTP_4_2_6P1_RC3 ntpdc/ntpdc-opts.h@1.247 +4 -4 NTP_4_2_6P1_RC3 ntpdc/ntpdc-opts.texi@1.246 +3 -3 NTP_4_2_6P1_RC3 ntpdc/ntpdc.1@1.246 +2 -2 NTP_4_2_6P1_RC3 ntpq/ntpq-opts.c@1.248 +4 -4 NTP_4_2_6P1_RC3 ntpq/ntpq-opts.h@1.248 +4 -4 NTP_4_2_6P1_RC3 ntpq/ntpq-opts.texi@1.247 +3 -3 NTP_4_2_6P1_RC3 ntpq/ntpq.1@1.247 +2 -2 NTP_4_2_6P1_RC3 ntpsnmpd/ntpsnmpd-opts.c@1.126 +4 -4 NTP_4_2_6P1_RC3 ntpsnmpd/ntpsnmpd-opts.h@1.126 +4 -4 NTP_4_2_6P1_RC3 ntpsnmpd/ntpsnmpd-opts.texi@1.126 +3 -3 NTP_4_2_6P1_RC3 ntpsnmpd/ntpsnmpd.1@1.125 +2 -2 NTP_4_2_6P1_RC3 packageinfo.sh@1.262 +1 -1 NTP_4_2_6P1_RC3 sntp/sntp-opts.c@1.120 +4 -4 NTP_4_2_6P1_RC3 sntp/sntp-opts.h@1.120 +4 -4 NTP_4_2_6P1_RC3 sntp/sntp-opts.texi@1.120 +3 -3 NTP_4_2_6P1_RC3 sntp/sntp.1@1.120 +2 -2 NTP_4_2_6P1_RC3 sntp/sntp.html@1.10 +1 -1 NTP_4_2_6P1_RC3 util/ntp-keygen-opts.c@1.250 +4 -4 NTP_4_2_6P1_RC3 util/ntp-keygen-opts.h@1.250 +4 -4 NTP_4_2_6P1_RC3 util/ntp-keygen-opts.texi@1.249 +3 -3 NTP_4_2_6P1_RC3 util/ntp-keygen.1@1.249 +2 -2 NTP_4_2_6P1_RC3 ChangeSet@1.2133, 2010-01-24 03:49:59-05:00, stenn@whimsy.udel.edu Use TZ=UTC instead of TZ= when calling date in scripts/mkver.in ChangeLog@1.596 +4 -3 Use TZ=UTC instead of TZ= when calling date in scripts/mkver.in scripts/mkver.in@1.12 +1 -1 Use TZ=UTC instead of TZ= when calling date in scripts/mkver.in ChangeSet@1.2132, 2010-01-24 03:44:05-05:00, stenn@whimsy.udel.edu cleanup ChangeLog@1.595 +2 -2 cleanup ChangeSet@1.2131, 2010-01-24 03:39:27-05:00, stenn@whimsy.udel.edu [Bug 1449] SLEW is no longer needed by the simulator include/ntpsim.h@1.13 +0 -1 [Bug 1449] SLEW is no longer needed by the simulator ChangeSet@1.2130, 2010-01-23 23:09:00-05:00, mayer@pogo.udel.edu Bad inputdir reference ports/winnt/vc6/libntp.dsp@1.52 +1 -1 Bad inputdir reference ChangeSet@1.2129, 2010-01-22 11:49:48+01:00, burnicki@pogo.udel.edu Create the instserv binaries in the correct directories. ports/winnt/vc6/Instsrv.dsp@1.12 +2 -2 Create the instserv binaries in the correct directories. ChangeSet@1.2128, 2010-01-21 23:37:23-05:00, mayer@pogo.udel.edu Remove ipv6.c as unnecessary ports/winnt/vc6/libntp.dsp@1.51 +0 -4 Remove ipv6.c as unnecessary ChangeSet@1.2127, 2010-01-17 22:28:21-05:00, mayer@pogo.udel.edu Temporarily include ntpsim.h unconditionally ntpd/ntp_config.c@1.243 +5 -2 Temporarily include ntpsim.h unconditionally ChangeSet@1.2125, 2010-01-16 23:20:10-05:00, mayer@pogo.udel.edu [Bug 1448] Additional fixes for Windows VC6 lib/isc/win32/net.c@1.14 +2 -2 [Bug 1448] Additional fixes for Windows VC6 ports/winnt/vc6/libntp.dsp@1.50 +23 -15 [Bug 1448] Additional fixes for Windows VC6 ChangeSet@1.2122.2.3, 2010-01-08 19:11:53+00:00, davehart@shiny.ad.hartbrothers.com Makefile.am: add dependencies on copyright.def correct dependencies to refer to $(srcdir)/version.def not $(srcdir)/../include/version.def add COPYRIGHT to BUILT_SOURCES, correct EXTRA_DIST reference to remove unneeded $(srcdir)/ prefix sntp/Makefile.am@1.25 +5 -4 add dependencies on copyright.def correct dependencies to refer to $(srcdir)/version.def not $(srcdir)/../include/version.def add COPYRIGHT to BUILT_SOURCES, correct EXTRA_DIST reference to remove unneeded $(srcdir)/ prefix ChangeSet@1.2122.2.2, 2010-01-08 17:21:14+00:00, davehart@shiny.ad.hartbrothers.com bump copyright year to 2010 html/copyright.html@1.46 +2 -2 bump copyright year to 2010 include/copyright.def@1.11 +1 -1 bump copyright year to 2010 ChangeSet@1.2122.2.1, 2010-01-06 18:52:49+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1453] Use $CC in config.cache filename in ./build script. ChangeLog@1.592.2.1 +4 -3 [Bug 1453] Use $CC in config.cache filename in ./build script. build@1.34 +26 -27 [Bug 1453] Use $CC in config.cache filename in ./build script. ChangeSet@1.2124, 2010-01-03 23:03:48-05:00, mayer@pogo.udel.edu Undo unneeded change lib/isc/netaddr.c@1.8 +1 -1 Undo unneeded change ChangeSet@1.2122.1.1, 2010-01-03 21:52:33+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1451] CID 115: sntp leaks KoD entry when updating existing entry. ChangeLog@1.592.1.1 +4 -3 [Bug 1451] CID 115: sntp leaks KoD entry when updating existing entry. sntp/kod_management.c@1.16 +1 -0 [Bug 1451] CID 115: sntp leaks KoD entry when updating existing entry. ChangeSet@1.2123, 2010-01-01 23:49:35-05:00, mayer@pogo.udel.edu Fixes for bugs 1448-1450 ChangeLog@1.593 +4 -0 Fixes for bug 1448-1450 lib/isc/netaddr.c@1.7 +1 -1 [Bug 1448] scope_id and ipv6 any address not defined on vc6 compiler lib/isc/win32/include/isc/platform.h@1.7 +2 -2 [Bug 1448] Macros not correctly conditionally defined lib/isc/win32/interfaceiter.c@1.16 +2 -0 [Bug 1448] scope_id and ipv6 any address not defined on vc6 compiler ntpd/ntp_config.c@1.242 +3 -1 [Bug 1449] ntpsim.h should only be conditionally included and after ntpd-opts.h ports/winnt/include/config.h@1.80 +2 -2 [Bug 1448] Macros not correctly conditionally defined ports/winnt/vc6/libntp.dsp@1.49 +0 -4 [Bug 1448] stdtime.c misspelled but not needed at all ChangeSet@1.2122, 2009-12-30 05:48:36+00:00, davehart@shiny.ad.hartbrothers.com With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in *.1, *.texi, and *.html Makefile rules are not needed. ntpd/Makefile.am@1.85 +2 -9 With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in *.1, *.texi, and *.html rules are not needed. ntpdc/Makefile.am@1.51 +2 -9 With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in *.1, *.texi, and *.html rules are not needed. ntpq/Makefile.am@1.46 +2 -9 With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in *.1, *.texi, and *.html rules are not needed. ntpsnmpd/Makefile.am@1.19 +2 -9 With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in *.1, *.texi, and *.html rules are not needed. sntp/Makefile.am@1.24 +3 -12 With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in *.1, *.texi, and *.html rules are not needed. util/Makefile.am@1.48 +2 -9 With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in *.1, *.texi, and *.html rules are not needed. ChangeSet@1.2121, 2009-12-30 00:23:25+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1446] 4.2.7p6 requires autogen to build missing ntpd.1, *.texi, *.menu. ntpd/Makefile.am@1.84 +4 -1 [Bug 1446] 4.2.7p6 requires autogen to build missing ntpd.1, *.texi, *.menu. ChangeSet@1.2120, 2009-12-28 04:17:49-05:00, stenn@whimsy.udel.edu [Bug 1445] IRIX does not have -lcap or support linux capabilities ChangeLog@1.592 +2 -1 [Bug 1445] IRIX does not have -lcap or support linux capabilities configure.ac@1.474 +7 -1 [Bug 1445] IRIX does not have -lcap or support linux capabilities ChangeSet@1.2115.1.1, 2009-12-27 09:16:20+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1439] .texi generation must wait until after binary is linked. Quiet RES_TIMEOUT redefinition warning compiling ntp_intres.c ChangeLog@1.587.1.1 +4 -0 [Bug 1439] .texi generation must wait until after binary is linked. ntpd/Makefile.am@1.83 +16 -10 remove *.texi *.menu *.html *.1 from BUILT_SOURCES, add all except .1 to noinst_DATA, and remove sub-make hack to build binary [Bug 1439]. change man_MANS= reference to .1 to have $(srcdir)/ prefix, work around make distcheck R/O srcdir in .1 and ,texi rules. separate .menu rule from .texi to avoid redundant Autogen invocation. ntpd/ntp_intres.c@1.79 +7 -3 follow AC_HEADER_RESOLV suggestion to include sys/types.h ahead of netinet/in.h quiet RES_TIMEOUT redefinition warning (resolv.h vs. ntp.h) ntpdc/Makefile.am@1.50 +17 -10 remove *.texi *.menu *.html *.1 from BUILT_SOURCES, add all except .1 to noinst_DATA, and remove sub-make hack to build binary [Bug 1439]. change man_MANS= reference to .1 to have $(srcdir)/ prefix, work around make distcheck R/O srcdir in .1 and ,texi rules. separate .menu rule from .texi to avoid redundant Autogen invocation. ntpq/Makefile.am@1.45 +17 -10 remove *.texi *.menu *.html *.1 from BUILT_SOURCES, add all except .1 to noinst_DATA, and remove sub-make hack to build binary [Bug 1439]. change man_MANS= reference to .1 to have $(srcdir)/ prefix, work around make distcheck R/O srcdir in .1 and ,texi rules. separate .menu rule from .texi to avoid redundant Autogen invocation. ntpsnmpd/Makefile.am@1.18 +17 -12 remove *.texi *.menu *.html *.1 from BUILT_SOURCES, add all except .1 to noinst_DATA, and remove sub-make hack to build binary [Bug 1439]. change man_MANS= reference to .1 to have $(srcdir)/ prefix, work around make distcheck R/O srcdir in .1 and ,texi rules. separate .menu rule from .texi to avoid redundant Autogen invocation. sntp/Makefile.am@1.23 +26 -23 remove *.texi *.menu *.html *.1 from BUILT_SOURCES, add all except .1 to noinst_DATA, and remove sub-make hack to build binary [Bug 1439]. change man_MANS= reference to .1 to have $(srcdir)/ prefix, work around make distcheck R/O srcdir in .1, .texi, and .html rules. separate .menu rule from .texi to avoid redundant Autogen invocation. util/Makefile.am@1.47 +17 -9 remove *.texi *.menu *.html *.1 from BUILT_SOURCES, add all except .1 to noinst_DATA, and remove sub-make hack to build binary [Bug 1439]. change man_MANS= reference to .1 to have $(srcdir)/ prefix, work around make distcheck R/O srcdir in .1 and ,texi rules. separate .menu rule from .texi to avoid redundant Autogen invocation. ChangeSet@1.2118, 2009-12-27 01:54:07-05:00, stenn@whimsy.udel.edu cleanup ChangeLog@1.590 +5 -2 cleanup ChangeSet@1.2117, 2009-12-27 01:47:48-05:00, stenn@whimsy.udel.edu [Bug 1440] Update configure.ac to support kfreebsd ChangeLog@1.589 +1 -0 [Bug 1440] Update configure.ac to support kfreebsd configure.ac@1.473 +12 -0 [Bug 1440] Update configure.ac to support kfreebsd ChangeSet@1.2116, 2009-12-27 00:40:27-05:00, stenn@whimsy.udel.edu [Bug 1127] Properly check the return of X590_verify() - missed one ChangeLog@1.588 +1 -0 [Bug 1127] Properly check the return of X590_verify() - missed one util/ntp-keygen.c@1.64 +1 -1 [Bug 1127] Properly check the return of X590_verify() - missed one ChangeSet@1.2115, 2009-12-25 09:31:42+00:00, stenn@whimsy.udel.edu NTP_4_2_6P1_RC2 TAG: NTP_4_2_6P1_RC2 ChangeLog@1.587 +1 -0 NTP_4_2_6P1_RC2 ntpd/ntpd-opts.c@1.250 +2 -2 NTP_4_2_6P1_RC2 ntpd/ntpd-opts.h@1.250 +3 -3 NTP_4_2_6P1_RC2 ntpd/ntpd-opts.texi@1.248 +2 -2 NTP_4_2_6P1_RC2 ntpd/ntpd.1@1.248 +2 -2 NTP_4_2_6P1_RC2 ntpdc/ntpdc-opts.c@1.246 +2 -2 NTP_4_2_6P1_RC2 ntpdc/ntpdc-opts.h@1.246 +3 -3 NTP_4_2_6P1_RC2 ntpdc/ntpdc-opts.texi@1.245 +2 -2 NTP_4_2_6P1_RC2 ntpdc/ntpdc.1@1.245 +2 -2 NTP_4_2_6P1_RC2 ntpq/ntpq-opts.c@1.247 +2 -2 NTP_4_2_6P1_RC2 ntpq/ntpq-opts.h@1.247 +3 -3 NTP_4_2_6P1_RC2 ntpq/ntpq-opts.texi@1.246 +2 -2 NTP_4_2_6P1_RC2 ntpq/ntpq.1@1.246 +2 -2 NTP_4_2_6P1_RC2 ntpsnmpd/ntpsnmpd-opts.c@1.125 +2 -2 NTP_4_2_6P1_RC2 ntpsnmpd/ntpsnmpd-opts.h@1.125 +3 -3 NTP_4_2_6P1_RC2 ntpsnmpd/ntpsnmpd-opts.texi@1.125 +2 -2 NTP_4_2_6P1_RC2 ntpsnmpd/ntpsnmpd.1@1.124 +2 -2 NTP_4_2_6P1_RC2 packageinfo.sh@1.261 +1 -1 NTP_4_2_6P1_RC2 sntp/sntp-opts.c@1.119 +2 -2 NTP_4_2_6P1_RC2 sntp/sntp-opts.h@1.119 +3 -3 NTP_4_2_6P1_RC2 sntp/sntp-opts.texi@1.119 +2 -2 NTP_4_2_6P1_RC2 sntp/sntp.1@1.119 +2 -2 NTP_4_2_6P1_RC2 sntp/sntp.html@1.9 +1 -1 NTP_4_2_6P1_RC2 util/ntp-keygen-opts.c@1.249 +2 -2 NTP_4_2_6P1_RC2 util/ntp-keygen-opts.h@1.249 +3 -3 NTP_4_2_6P1_RC2 util/ntp-keygen-opts.texi@1.248 +2 -2 NTP_4_2_6P1_RC2 util/ntp-keygen.1@1.248 +2 -2 NTP_4_2_6P1_RC2 ChangeSet@1.2112.1.1, 2009-12-25 00:19:40-05:00, stenn@whimsy.udel.edu [Bug 1435] sntp: Test for -lresolv using the same tests as in ntp ChangeLog@1.584.1.1 +1 -0 [Bug 1435] sntp: Test for -lresolv using the same tests as in ntp sntp/configure.ac@1.29.1.1 +3 -0 [Bug 1435] sntp: Test for -lresolv using the same tests as in ntp ChangeSet@1.2113, 2009-12-24 22:04:26+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1425] unpeer by association ID sets up for duplicate free(). [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some. Use HAVE_WORKING_FORK instead of HAVE_FORK to avoid broken fork(). ChangeLog@1.585 +2 -0 [Bug 1425] unpeer by association ID sets up for duplicate free(). [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some. configure.ac@1.472 +50 -29 [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some. include/ntp_intres.h@1.2 +1 -1 Use HAVE_WORKING_FORK instead of HAVE_FORK preemptively, some rare systems have a broken fork() m4/os_cflags.m4@1.6 +2 -0 [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some. ntpd/ntp_config.c@1.241 +0 -2 [Bug 1425] unpeer by association ID sets up for duplicate free(). ntpsnmpd/netsnmp_daemonize.c@1.2 +2 -2 Use HAVE_WORKING_FORK instead of HAVE_FORK preemptively, some rare systems have a broken fork() sntp/configure.ac@1.30 +53 -0 [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some. sntp/networking.c@1.29 +7 -1 [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some. ChangeSet@1.2110.1.1, 2009-12-24 02:27:39-05:00, stenn@deacon.udel.edu System headers must come before ntp headers in ntp_intres.c ChangeLog@1.582.1.1 +1 -0 System headers must come before ntp headers in ntp_intres.c include/Makefile.am@1.38 +1 -0 System headers must come before ntp headers in ntp_intres.c include/ntp_config.h@1.67 +0 -10 System headers must come before ntp headers in ntp_intres.c include/ntp_intres.h@1.1 +14 -0 BitKeeper file /deacon/backroom/ntp-stable/include/ntp_intres.h include/ntp_intres.h@1.0 +0 -0 ntpd/ntp_config.c@1.238.1.1 +1 -0 System headers must come before ntp headers in ntp_intres.c ntpd/ntp_intres.c@1.78 +10 -8 System headers must come before ntp headers in ntp_intres.c ChangeSet@1.2111, 2009-12-23 11:01:44+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1429] -4 command line option to ntpd does not reliably force IPv4 resolution ChangeLog@1.583 +1 -0 [Bug 1429] -4 command line option to ntpd does not reliably force IPv4 resolution ntpd/cmd_args.c@1.57 +12 -5 [Bug 1429] -4 command line option to ntpd does not reliably force IPv4 resolution ntpd/ntp_config.c@1.239 +2 -8 [Bug 1429] -4 command line option to ntpd does not reliably force IPv4 resolution ntpd/ntp_scanner.h@1.15 +0 -1 [Bug 1429] -4 command line option to ntpd does not reliably force IPv4 resolution ChangeSet@1.2110, 2009-12-22 08:36:49+00:00, hart@psp-deb1.ntp.org UpdatePoint: correct handling of beta-free stable RC bumps scripts/UpdatePoint@1.4 +15 -7 correct handling of beta-free stable RC bumps ChangeSet@1.2109, 2009-12-22 03:00:22-05:00, stenn@whimsy.udel.edu [Bug 1424] Fix check for rtattr (rtnetlink.h) ChangeLog@1.582 +1 -0 [Bug 1424] Fix check for rtattr (rtnetlink.h) configure.ac@1.471 +1 -0 [Bug 1424] Fix check for rtattr (rtnetlink.h) ChangeSet@1.2108, 2009-12-22 02:52:08-05:00, stenn@whimsy.udel.edu [Bug 1416] MAXDNAME undefined on Solaris 2.6 ChangeLog@1.581 +1 -0 [Bug 1416] MAXDNAME undefined on Solaris 2.6 ChangeSet@1.2107, 2009-12-22 02:29:35-05:00, stenn@whimsy.udel.edu Bootstrap script should also touch .html files bootstrap@1.29 +1 -1 Bootstrap script should also touch .html files ChangeSet@1.2106, 2009-12-22 02:26:26-05:00, stenn@whimsy.udel.edu [Bug 1411] Fix status messages in refclock_oncore.c ChangeLog@1.580 +1 -0 [Bug 1411] Fix status messages in refclock_oncore.c ntpd/refclock_oncore.c@1.82 +31 -8 [Bug 1411] Fix status messages in refclock_oncore.c ChangeSet@1.2105, 2009-12-22 04:15:31+00:00, davehart@shiny.ad.hartbrothers.com bring Windows mkver.bat in line with packaginfo.sh and scripts/VersionName changes ports/winnt/scripts/mkver.bat@1.12 +14 -11 bring Windows mkver.bat in line with packaginfo.sh and scripts/VersionName changes ChangeSet@1.2100.1.1, 2009-12-22 00:55:19+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1428] Use AC_HEADER_RESOLV to fix breaks from resolv.h ChangeLog@1.575.1.1 +4 -0 [Bug 1428] Use AC_HEADER_RESOLV to fix breaks from resolv.h configure.ac@1.469 +1 -0 [Bug 1428] Use AC_HEADER_RESOLV to fix breaks from resolv.h ntpd/ntp_intres.c@1.77 +16 -3 [Bug 1428] Use AC_HEADER_RESOLV to fix breaks from resolv.h changes include of resolv.h to match Autoconf doc suggestion ChangeSet@1.2102, 2009-12-21 06:26:25+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1427] quote missing in ./build - shows up on NetBSD. ChangeLog@1.577 +1 -0 [Bug 1427] quote missing in ./build - shows up on NetBSD. build@1.33 +1 -1 [Bug 1427] quote missing in ./build - shows up on NetBSD. ChangeSet@1.2101, 2009-12-21 05:19:15+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1426] scripts/VersionName needs . on the search path. correct permissions to 0775 for scripts/UpdatePoint. ChangeLog@1.576 +4 -0 [Bug 1426] scripts/VersionName needs . on the search path. scripts/UpdatePoint@1.3 +2 -2 work correctly without . on $PATH scripts/UpdatePoint@1.2 +0 -0 Change mode to -rwxrwxr-x scripts/VersionName@1.6 +3 -3 [Bug 1426] scripts/VersionName needs . on the search path. ChangeSet@1.2100, 2009-12-20 00:52:48-05:00, stenn@whimsy.udel.edu NTP_4_2_6P1_RC1 TAG: NTP_4_2_6P1_RC1 ChangeLog@1.575 +1 -0 NTP_4_2_6P1_RC1 ntpd/ntpd-opts.c@1.249 +2 -2 NTP_4_2_6P1_RC1 ntpd/ntpd-opts.h@1.249 +3 -3 NTP_4_2_6P1_RC1 ntpd/ntpd-opts.texi@1.247 +2 -2 NTP_4_2_6P1_RC1 ntpd/ntpd.1@1.247 +2 -2 NTP_4_2_6P1_RC1 ntpdc/ntpdc-opts.c@1.245 +2 -2 NTP_4_2_6P1_RC1 ntpdc/ntpdc-opts.h@1.245 +3 -3 NTP_4_2_6P1_RC1 ntpdc/ntpdc-opts.texi@1.244 +2 -2 NTP_4_2_6P1_RC1 ntpdc/ntpdc.1@1.244 +2 -2 NTP_4_2_6P1_RC1 ntpq/ntpq-opts.c@1.246 +2 -2 NTP_4_2_6P1_RC1 ntpq/ntpq-opts.h@1.246 +3 -3 NTP_4_2_6P1_RC1 ntpq/ntpq-opts.texi@1.245 +2 -2 NTP_4_2_6P1_RC1 ntpq/ntpq.1@1.245 +2 -2 NTP_4_2_6P1_RC1 ntpsnmpd/ntpsnmpd-opts.c@1.124 +2 -2 NTP_4_2_6P1_RC1 ntpsnmpd/ntpsnmpd-opts.h@1.124 +3 -3 NTP_4_2_6P1_RC1 ntpsnmpd/ntpsnmpd-opts.texi@1.124 +2 -2 NTP_4_2_6P1_RC1 ntpsnmpd/ntpsnmpd.1@1.123 +2 -2 NTP_4_2_6P1_RC1 packageinfo.sh@1.260 +2 -2 NTP_4_2_6P1_RC1 sntp/sntp-opts.c@1.118 +2 -2 NTP_4_2_6P1_RC1 sntp/sntp-opts.h@1.118 +3 -3 NTP_4_2_6P1_RC1 sntp/sntp-opts.texi@1.118 +2 -2 NTP_4_2_6P1_RC1 sntp/sntp.1@1.118 +2 -2 NTP_4_2_6P1_RC1 sntp/sntp.html@1.8 +1 -1 NTP_4_2_6P1_RC1 util/ntp-keygen-opts.c@1.248 +2 -2 NTP_4_2_6P1_RC1 util/ntp-keygen-opts.h@1.248 +3 -3 NTP_4_2_6P1_RC1 util/ntp-keygen-opts.texi@1.247 +2 -2 NTP_4_2_6P1_RC1 util/ntp-keygen.1@1.247 +2 -2 NTP_4_2_6P1_RC1 ChangeSet@1.2099, 2009-12-19 23:55:09-05:00, stenn@pogo.udel.edu Put refclock_neoclock4x.c under the NTP COPYRIGHT ChangeLog@1.574 +4 -0 Put refclock_neoclock4x.c under the NTP COPYRIGHT html/copyright.html@1.45 +1 -0 Put refclock_neoclock4x.c under the NTP COPYRIGHT ntpd/refclock_neoclock4x.c@1.17 +20 -9 Put refclock_neoclock4x.c under the NTP COPYRIGHT ChangeSet@1.2098, 2009-12-19 22:05:09-05:00, stenn@whimsy.udel.edu Start the 4.2.6p1-RC cycle packageinfo.sh@1.259 +14 -1 Start the 4.2.6p1-RC cycle ChangeSet@1.2097, 2009-12-19 21:47:40-05:00, stenn@whimsy.udel.edu [Bug 1415] Fix Mac OS X link problem ChangeLog@1.573 +1 -0 [Bug 1415] Fix Mac OS X link problem configure.ac@1.468 +5 -0 [Bug 1415] Fix Mac OS X link problem ntpsnmpd/Makefile.am@1.15.1.1 +1 -1 [Bug 1415] Fix Mac OS X link problem ChangeSet@1.2091.1.1, 2009-12-18 05:18:12+00:00, davehart@shiny.ad.hartbrothers.com correct NTP_OS_CFLAGS [Bug 1412] allow $CC to contain slash and space in build build@1.32 +3 -3 allow space and slash in $CC without breaking build/flock-build m4/os_cflags.m4@1.5 +90 -93 the name of the macro to define must be on the same line as AC_DEFUN( ChangeSet@1.2090.5.1, 2009-12-16 21:26:45+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. ChangeLog@1.567.5.1 +4 -0 [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. adjtimed/Makefile.am@1.7 +5 -1 [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. bincheck.mf@1.3 +5 -5 respect $bindir, $sbindir instead of assuming $exec_prefix/$BINSUBDIR configure.ac@1.465.2.1 +2 -0 [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. ntpd/Makefile.am@1.79.2.1 +4 -2 [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. ntpdate/Makefile.am@1.23 +6 -2 [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. ntpdc/Makefile.am@1.47.1.1 +5 -1 [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. ntpq/Makefile.am@1.42.1.1 +4 -0 [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. ntpsnmpd/Makefile.am@1.16 +5 -0 [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. scripts/Makefile.am@1.16.1.1 +4 -0 [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. sntp/Makefile.am@1.20.1.1 +5 -1 [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. sntp/configure.ac@1.29 +2 -0 [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. util/Makefile.am@1.46 +6 -0 [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir. ChangeSet@1.2090.4.1, 2009-12-16 20:21:10+00:00, davehart@shiny.ad.hartbrothers.com updated packageinfo.sh, VersionName, and UpdatePoint to use prerelease= from packageinfo.sh instead of releasecandidate= and added support for beta releases. ChangeLog@1.567.4.1 +4 -0 Build infrastructure updates to enable beta releases of ntp-stable. packageinfo.sh@1.258 +69 -16 updated to use prerelease= instead of releasecandidate=, with support for prerelease=beta for ntp-stable pre-RC1 test releases scripts/Makefile.am@1.17 +36 -5 reformat, add UpdatePoint to EXTRA_DIST scripts/UpdatePoint@1.1 +323 -0 updated to use prerelease= from packageinfo.sh instead of releasecandidate= added support for beta releases scripts/UpdatePoint@1.0 +0 -0 scripts/VersionName@1.5 +32 -18 updated to use prerelease= from packageinfo.sh instead of releasecandidate= added support for beta releases ChangeSet@1.2090.3.1, 2009-12-14 21:18:10+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1418] building ntpd/ntpdc/ntpq statically with ssl fails. ChangeLog@1.567.3.1 +4 -0 [Bug 1418] building ntpd/ntpdc/ntpq statically with ssl fails. ntpd/Makefile.am@1.79.1.1 +2 -2 move libntp.a ahead of @LCRYPTO@ to fix static openssl link ntpdc/Makefile.am@1.48 +2 -2 move libntp.a ahead of @LCRYPTO@ to fix static openssl link ntpq/Makefile.am@1.43 +2 -2 move libntp.a ahead of @LCRYPTO@ to fix static openssl link ChangeSet@1.2090.2.1, 2009-12-13 19:45:56+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1413] test OpenSSL headers regarding -Wno-strict-prototypes. ChangeLog@1.567.2.1 +4 -0 [Bug 1413] test OpenSSL headers regarding -Wno-strict-prototypes. configure.ac@1.465.1.1 +52 -10 [Bug 1413] test OpenSSL headers to see if they trigger warnings before enablng -Wno-strict-prototypes for gcc. -Wall does not include -Wstrict-prototypes, so add it expclitly. ChangeSet@1.2090.1.1, 2009-12-12 19:55:30+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1414] Enable "make distcheck" success with BSD make. ChangeLog@1.567.1.1 +4 -0 [Bug 1414] Enable "make distcheck" success with BSD make. libparse/Makefile.am@1.17 +23 -22 add info_trimble.c to CLEANFILES [Bug 1414]. remove references to $U leftover from ansi2knr use. ntpd/Makefile.am@1.80 +18 -4 remove $VPHACK and $VPHACK_AFTER from EXTRA_DIST [Bug 1414] sntp/Makefile.am@1.21 +1 -1 reference $(srcdir)/COPYRIGHT in EXTRA_DIST not COPYRIGHT [Bug 1414] ChangeSet@1.2091, 2009-12-12 08:31:39+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1412] m4/os_cflags.m4 caches results that depend on $CC. ChangeLog@1.568 +4 -0 [Bug 1412] m4/os_cflags.m4 caches results that depend on $CC. configure.ac@1.466 +1 -47 [Bug 1412] m4/os_cflags.m4 caches results that depend on $CC. m4/os_cflags.m4@1.4 +82 -72 [Bug 1412] m4/os_cflags.m4 caches results that depend on $CC. ChangeSet@1.2090, 2009-12-10 05:49:19-05:00, stenn@whimsy.udel.edu 4.2.6 TAG: NTP_4_2_6 ntpd/ntpd-opts.c@1.248 +1 -1 4.2.6 ntpd/ntpd-opts.h@1.248 +1 -1 4.2.6 ntpd/ntpd-opts.texi@1.246 +1 -1 4.2.6 ntpd/ntpd.1@1.246 +2 -2 4.2.6 ntpdc/ntpdc-opts.c@1.244 +1 -1 4.2.6 ntpdc/ntpdc-opts.h@1.244 +1 -1 4.2.6 ntpdc/ntpdc-opts.texi@1.243 +2 -2 4.2.6 ntpdc/ntpdc.1@1.243 +2 -2 4.2.6 ntpq/ntpq-opts.c@1.245 +1 -1 4.2.6 ntpq/ntpq-opts.h@1.245 +1 -1 4.2.6 ntpq/ntpq-opts.texi@1.244 +2 -2 4.2.6 ntpq/ntpq.1@1.244 +2 -2 4.2.6 ntpsnmpd/ntpsnmpd-opts.c@1.123 +1 -1 4.2.6 ntpsnmpd/ntpsnmpd-opts.h@1.123 +1 -1 4.2.6 ntpsnmpd/ntpsnmpd-opts.texi@1.123 +23 -2 4.2.6 ntpsnmpd/ntpsnmpd.1@1.122 +2 -2 4.2.6 sntp/sntp-opts.c@1.117 +1 -1 4.2.6 sntp/sntp-opts.h@1.117 +1 -1 4.2.6 sntp/sntp-opts.texi@1.117 +2 -2 4.2.6 sntp/sntp.1@1.117 +2 -2 4.2.6 sntp/sntp.html@1.7 +13 -9 4.2.6 util/ntp-keygen-opts.c@1.247 +1 -1 4.2.6 util/ntp-keygen-opts.h@1.247 +1 -1 4.2.6 util/ntp-keygen-opts.texi@1.246 +2 -2 4.2.6 util/ntp-keygen.1@1.246 +2 -2 4.2.6 ChangeSet@1.2089, 2009-12-09 03:46:30-05:00, stenn@deacon.udel.edu cleanup ChangeLog@1.567 +1 -1 cleanup ntpd/ntpd-opts.c@1.247 +2 -2 cleanup ntpd/ntpd-opts.h@1.247 +3 -3 cleanup ntpd/ntpd-opts.texi@1.245 +2 -2 cleanup ntpd/ntpd.1@1.245 +2 -2 cleanup ntpdc/ntpdc-opts.c@1.243 +2 -2 cleanup ntpdc/ntpdc-opts.h@1.243 +3 -3 cleanup ntpdc/ntpdc-opts.texi@1.242 +3 -3 cleanup ntpdc/ntpdc.1@1.242 +2 -2 cleanup ntpq/ntpq-opts.c@1.244 +2 -2 cleanup ntpq/ntpq-opts.h@1.244 +3 -3 cleanup ntpq/ntpq-opts.texi@1.243 +3 -3 cleanup ntpq/ntpq.1@1.243 +2 -2 cleanup ntpsnmpd/ntpsnmpd-opts.c@1.122 +2 -2 cleanup ntpsnmpd/ntpsnmpd-opts.h@1.122 +3 -3 cleanup ntpsnmpd/ntpsnmpd-opts.texi@1.122 +1 -1 cleanup ntpsnmpd/ntpsnmpd.1@1.121 +2 -2 cleanup packageinfo.sh@1.257 +1 -1 cleanup sntp/sntp-opts.c@1.116 +2 -2 cleanup sntp/sntp-opts.h@1.116 +3 -3 cleanup sntp/sntp-opts.texi@1.116 +3 -3 cleanup sntp/sntp.1@1.116 +2 -2 cleanup sntp/sntp.html@1.6 +1 -1 cleanup util/ntp-keygen-opts.c@1.246 +2 -2 cleanup util/ntp-keygen-opts.h@1.246 +3 -3 cleanup util/ntp-keygen-opts.texi@1.245 +3 -3 cleanup util/ntp-keygen.1@1.245 +2 -2 cleanup ChangeSet@1.2088, 2009-12-09 02:58:13-05:00, stenn@deacon.udel.edu NTP_4_2_6_RC TAG: NTP_4_2_6_RC ChangeLog@1.566 +1 -0 NTP_4_2_6_RC ntpd/ntpd-opts.c@1.246 +2 -2 NTP_4_2_6_RC ntpd/ntpd-opts.h@1.246 +3 -3 NTP_4_2_6_RC ntpd/ntpd-opts.texi@1.244 +61 -2 NTP_4_2_6_RC ntpd/ntpd.1@1.244 +2 -2 NTP_4_2_6_RC ntpdc/ntpdc-opts.c@1.242 +2 -2 NTP_4_2_6_RC ntpdc/ntpdc-opts.h@1.242 +3 -3 NTP_4_2_6_RC ntpdc/ntpdc-opts.texi@1.241 +66 -2 NTP_4_2_6_RC ntpdc/ntpdc.1@1.241 +2 -2 NTP_4_2_6_RC ntpq/ntpq-opts.c@1.243 +2 -2 NTP_4_2_6_RC ntpq/ntpq-opts.h@1.243 +3 -3 NTP_4_2_6_RC ntpq/ntpq-opts.texi@1.242 +51 -2 NTP_4_2_6_RC ntpq/ntpq.1@1.242 +2 -2 NTP_4_2_6_RC ntpsnmpd/ntpsnmpd-opts.c@1.121 +2 -2 NTP_4_2_6_RC ntpsnmpd/ntpsnmpd-opts.h@1.121 +3 -3 NTP_4_2_6_RC ntpsnmpd/ntpsnmpd-opts.texi@1.121 +1 -1 NTP_4_2_6_RC ntpsnmpd/ntpsnmpd.1@1.120 +2 -2 NTP_4_2_6_RC packageinfo.sh@1.256 +3 -3 NTP_4_2_6_RC sntp/sntp-opts.c@1.115 +2 -2 NTP_4_2_6_RC sntp/sntp-opts.h@1.115 +3 -3 NTP_4_2_6_RC sntp/sntp-opts.texi@1.115 +60 -2 NTP_4_2_6_RC sntp/sntp.1@1.115 +2 -2 NTP_4_2_6_RC sntp/sntp.html@1.5 +10 -14 NTP_4_2_6_RC util/ntp-keygen-opts.c@1.245 +2 -2 NTP_4_2_6_RC util/ntp-keygen-opts.h@1.245 +3 -3 NTP_4_2_6_RC util/ntp-keygen-opts.texi@1.244 +46 -2 NTP_4_2_6_RC util/ntp-keygen.1@1.244 +2 -2 NTP_4_2_6_RC ChangeSet@1.2087, 2009-12-09 00:06:06-05:00, stenn@deacon.udel.edu 4.2.6 ChangeLog@1.565 +1 -0 4.2.6 packageinfo.sh@1.255 +5 -5 4.2.6 ChangeSet@1.2086, 2009-12-08 10:09:30-05:00, stenn@deacon.udel.edu Include 4.2.4p8 ChangeLog@1.564 +1 -0 ChangeSet@1.1436.15.75, 2009-12-08 08:30:54-05:00, stenn@whimsy.udel.edu ChangeLog: typo ChangeLog@1.1.1.94 +0 -1 typo ChangeSet@1.1436.15.74, 2009-12-08 08:23:12-05:00, stenn@whimsy.udel.edu NTP_4_2_4P8 TAG: NTP_4_2_4P8 ChangeLog@1.1.1.93 +1 -0 NTP_4_2_4P8 ntpd/ntpd-opts.c@1.50.26.2 +2 -2 NTP_4_2_4P8 ntpd/ntpd-opts.h@1.50.26.2 +3 -3 NTP_4_2_4P8 ntpd/ntpd-opts.texi@1.49.26.2 +1 -1 NTP_4_2_4P8 ntpd/ntpd.1@1.48.26.2 +2 -2 NTP_4_2_4P8 ntpd/ntpdsim-opts.c@1.50.26.2 +2 -2 NTP_4_2_4P8 ntpd/ntpdsim-opts.h@1.50.26.2 +3 -3 NTP_4_2_4P8 ntpd/ntpdsim-opts.texi@1.48.26.2 +1 -1 NTP_4_2_4P8 ntpd/ntpdsim.1@1.48.26.2 +2 -2 NTP_4_2_4P8 ntpdc/ntpdc-opts.c@1.50.26.2 +2 -2 NTP_4_2_4P8 ntpdc/ntpdc-opts.h@1.50.26.2 +3 -3 NTP_4_2_4P8 ntpdc/ntpdc-opts.texi@1.48.26.2 +1 -1 NTP_4_2_4P8 ntpdc/ntpdc.1@1.48.26.2 +2 -2 NTP_4_2_4P8 ntpq/ntpq-opts.c@1.52.26.2 +2 -2 NTP_4_2_4P8 ntpq/ntpq-opts.h@1.52.26.2 +3 -3 NTP_4_2_4P8 ntpq/ntpq-opts.texi@1.49.26.2 +1 -1 NTP_4_2_4P8 ntpq/ntpq.1@1.48.26.2 +2 -2 NTP_4_2_4P8 packageinfo.sh@1.65.34.3 +4 -4 NTP_4_2_4P8 sntp/sntp-opts.c@1.49.26.2 +2 -2 NTP_4_2_4P8 sntp/sntp-opts.h@1.49.26.2 +3 -3 NTP_4_2_4P8 sntp/sntp-opts.texi@1.46.26.2 +1 -1 NTP_4_2_4P8 sntp/sntp.1@1.49.26.2 +2 -2 NTP_4_2_4P8 util/ntp-keygen-opts.c@1.49.26.2 +2 -2 NTP_4_2_4P8 util/ntp-keygen-opts.h@1.49.26.2 +3 -3 NTP_4_2_4P8 util/ntp-keygen-opts.texi@1.47.26.2 +1 -1 NTP_4_2_4P8 util/ntp-keygen.1@1.47.26.2 +2 -2 NTP_4_2_4P8 ChangeSet@1.1436.15.73, 2009-12-08 07:45:28-05:00, stenn@whimsy.udel.edu NTP_4_2_4P9_RC1 TAG: NTP_4_2_4P9_RC1 ChangeLog@1.1.1.92 +1 -0 NTP_4_2_4P9_RC1 ntpd/ntpd-opts.c@1.50.26.1 +5 -5 NTP_4_2_4P9_RC1 ntpd/ntpd-opts.h@1.50.26.1 +4 -4 NTP_4_2_4P9_RC1 ntpd/ntpd-opts.texi@1.49.26.1 +13 -6 NTP_4_2_4P9_RC1 ntpd/ntpd.1@1.48.26.1 +2 -2 NTP_4_2_4P9_RC1 ntpd/ntpdsim-opts.c@1.50.26.1 +5 -5 NTP_4_2_4P9_RC1 ntpd/ntpdsim-opts.h@1.50.26.1 +4 -4 NTP_4_2_4P9_RC1 ntpd/ntpdsim-opts.texi@1.48.26.1 +61 -2 NTP_4_2_4P9_RC1 ntpd/ntpdsim.1@1.48.26.1 +2 -2 NTP_4_2_4P9_RC1 ntpdc/ntpdc-opts.c@1.50.26.1 +5 -5 NTP_4_2_4P9_RC1 ntpdc/ntpdc-opts.h@1.50.26.1 +4 -4 NTP_4_2_4P9_RC1 ntpdc/ntpdc-opts.texi@1.48.26.1 +7 -4 NTP_4_2_4P9_RC1 ntpdc/ntpdc.1@1.48.26.1 +2 -2 NTP_4_2_4P9_RC1 ntpq/ntpq-opts.c@1.52.26.1 +5 -5 NTP_4_2_4P9_RC1 ntpq/ntpq-opts.h@1.52.26.1 +4 -4 NTP_4_2_4P9_RC1 ntpq/ntpq-opts.texi@1.49.26.1 +8 -4 NTP_4_2_4P9_RC1 ntpq/ntpq.1@1.48.26.1 +2 -2 NTP_4_2_4P9_RC1 packageinfo.sh@1.65.34.2 +3 -3 NTP_4_2_4P9_RC1 sntp/sntp-opts.c@1.49.26.1 +5 -5 NTP_4_2_4P9_RC1 sntp/sntp-opts.h@1.49.26.1 +4 -4 NTP_4_2_4P9_RC1 sntp/sntp-opts.texi@1.46.26.1 +54 -2 NTP_4_2_4P9_RC1 sntp/sntp.1@1.49.26.1 +2 -2 NTP_4_2_4P9_RC1 util/ntp-keygen-opts.c@1.49.26.1 +5 -5 NTP_4_2_4P9_RC1 util/ntp-keygen-opts.h@1.49.26.1 +4 -4 NTP_4_2_4P9_RC1 util/ntp-keygen-opts.texi@1.47.26.1 +4 -4 NTP_4_2_4P9_RC1 util/ntp-keygen.1@1.47.26.1 +2 -2 NTP_4_2_4P9_RC1 ChangeSet@1.1436.15.72, 2009-12-08 05:36:47-05:00, stenn@whimsy.udel.edu [Sec 1331] DoS with mode 7 packets - CVE-2009-3563 NEWS@1.86.1.16 +34 -0 [Sec 1331] DoS with mode 7 packets - CVE-2009-3563 packageinfo.sh@1.65.34.1 +2 -2 [Sec 1331] DoS with mode 7 packets - CVE-2009-3563 ChangeSet@1.2083, 2009-12-07 11:58:19+01:00, burnicki@pogo.udel.edu [Bug 508] Fixed leap second handling for Windows. ChangeLog@1.561 +1 -0 [Bug 508] Fixed leap second handling for Windows. ntpd/ntp_timer.c@1.56 +2 -0 [Bug 508] Fixed leap second handling for Windows. ports/winnt/ntpd/nt_clockstuff.c@1.38 +17 -2 [Bug 508] Fixed leap second handling for Windows. ChangeSet@1.2082, 2009-11-30 05:29:50-05:00, stenn@whimsy.udel.edu NTP_4_2_5P250_RC TAG: NTP_4_2_5P250_RC ChangeLog@1.560 +1 -0 NTP_4_2_5P250_RC ntpd/ntpd-opts.c@1.245 +2 -2 NTP_4_2_5P250_RC ntpd/ntpd-opts.h@1.245 +3 -3 NTP_4_2_5P250_RC ntpd/ntpd-opts.texi@1.243 +1 -1 NTP_4_2_5P250_RC ntpd/ntpd.1@1.243 +2 -2 NTP_4_2_5P250_RC ntpdc/ntpdc-opts.c@1.241 +2 -2 NTP_4_2_5P250_RC ntpdc/ntpdc-opts.h@1.241 +3 -3 NTP_4_2_5P250_RC ntpdc/ntpdc-opts.texi@1.240 +1 -1 NTP_4_2_5P250_RC ntpdc/ntpdc.1@1.240 +2 -2 NTP_4_2_5P250_RC ntpq/ntpq-opts.c@1.242 +2 -2 NTP_4_2_5P250_RC ntpq/ntpq-opts.h@1.242 +3 -3 NTP_4_2_5P250_RC ntpq/ntpq-opts.texi@1.241 +1 -1 NTP_4_2_5P250_RC ntpq/ntpq.1@1.241 +2 -2 NTP_4_2_5P250_RC ntpsnmpd/ntpsnmpd-opts.c@1.120 +2 -2 NTP_4_2_5P250_RC ntpsnmpd/ntpsnmpd-opts.h@1.120 +3 -3 NTP_4_2_5P250_RC ntpsnmpd/ntpsnmpd-opts.texi@1.120 +1 -1 NTP_4_2_5P250_RC ntpsnmpd/ntpsnmpd.1@1.119 +2 -2 NTP_4_2_5P250_RC packageinfo.sh@1.254 +1 -1 NTP_4_2_5P250_RC sntp/sntp-opts.c@1.114 +4 -4 NTP_4_2_5P250_RC sntp/sntp-opts.h@1.114 +3 -3 NTP_4_2_5P250_RC sntp/sntp-opts.texi@1.114 +7 -7 NTP_4_2_5P250_RC sntp/sntp.1@1.114 +37 -37 NTP_4_2_5P250_RC sntp/sntp.html@1.4 +5 -5 NTP_4_2_5P250_RC util/ntp-keygen-opts.c@1.244 +2 -2 NTP_4_2_5P250_RC util/ntp-keygen-opts.h@1.244 +3 -3 NTP_4_2_5P250_RC util/ntp-keygen-opts.texi@1.243 +1 -1 NTP_4_2_5P250_RC util/ntp-keygen.1@1.243 +2 -2 NTP_4_2_5P250_RC ChangeSet@1.2081, 2009-11-30 04:19:28-05:00, stenn@whimsy.udel.edu sntp documentation updates sntp/sntp.texi@1.3 +2 -2 sntp documentation updates ChangeSet@1.2080, 2009-11-30 04:15:15-05:00, stenn@whimsy.udel.edu sntp documentation updates sntp/sntp.texi@1.2 +4 -4 sntp documentation updates ChangeSet@1.2079, 2009-11-30 04:06:48-05:00, stenn@whimsy.udel.edu sntp documentation updates ChangeLog@1.559 +1 -0 sntp documentation updates sntp/sntp-opts.def@1.15 +21 -12 sntp documentation updates ChangeSet@1.2075.1.2, 2009-11-29 23:36:52-05:00, murray@malarky.udel.edu ntp_intres.c, ChangeLog: Fix for bug 1386: Deferred DNS doesn't work on NetBSD ChangeLog@1.553.1.10 +1 -0 Fix for bug 1386: Deferred DNS doesn't work on NetBSD ntpd/ntp_intres.c@1.76 +28 -12 Fix for bug 1386: Deferred DNS doesn't work on NetBSD ChangeSet@1.2075.1.1, 2009-11-28 21:30:09-05:00, murray@malarky.udel.edu configure.ac: Add --enable-force-defer-DNS Helps debugging deferred DNS lookups. ChangeLog: Bug 761: internal resolver does not seem to honor -4/-6 qualifiers ntp_config.c: Bug 761: internal resolver does not seem to honor -4/-6 qualifiers FORCE_DEFER_DNS helps debugging. Pass no_needed to ntp_intres, first step on Bug 975. ntp_intres.c: Bug 761: internal resolver does not seem to honor -4/-6 qualifiers Take no_needed from ntp_config, first step on Bug 975. ChangeLog@1.553.1.9 +3 -0 Bug 761: internal resolver does not seem to honor -4/-6 qualifiers configure.ac@1.465 +16 -0 Add --enable-force-defer-DNS Helps debugging deferred DNS lookups. ntpd/ntp_config.c@1.238 +20 -10 Bug 761: internal resolver does not seem to honor -4/-6 qualifiers FORCE_DEFER_DNS helps debugging. Pass no_needed to ntp_intres, first step on Bug 975. ntpd/ntp_intres.c@1.75 +31 -17 Bug 761: internal resolver does not seem to honor -4/-6 qualifiers Take no_needed from ntp_config, first step on Bug 975. ChangeSet@1.2077, 2009-11-28 23:42:10+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1391] avoid invoking autogen twice for .c and .h files. ChangeLog@1.557 +1 -0 [Bug 1391] avoid invoking autogen twice for .c and .h files. ntpd/Makefile.am@1.79 +6 -2 [Bug 1391] avoid invoking autogen twice for .c and .h files. ntpdc/Makefile.am@1.47 +4 -1 [Bug 1391] avoid invoking autogen twice for .c and .h files. ntpq/Makefile.am@1.42 +4 -1 [Bug 1391] avoid invoking autogen twice for .c and .h files. ntpsnmpd/Makefile.am@1.15 +4 -1 [Bug 1391] avoid invoking autogen twice for .c and .h files. sntp/Makefile.am@1.20 +12 -3 [Bug 1391] avoid invoking autogen twice for .c and .h files. when recursively building sntp binary for .texi rule, make libopts.la first util/Makefile.am@1.45 +4 -1 [Bug 1391] avoid invoking autogen twice for .c and .h files. ChangeSet@1.2075, 2009-11-28 05:29:18-05:00, stenn@whimsy.udel.edu NTP_4_2_5P249_RC TAG: NTP_4_2_5P249_RC ChangeLog@1.553.1.8 +1 -0 NTP_4_2_5P249_RC ntpd/ntpd-opts.c@1.244 +2 -2 NTP_4_2_5P249_RC ntpd/ntpd-opts.h@1.244 +3 -3 NTP_4_2_5P249_RC ntpd/ntpd-opts.texi@1.242 +2 -61 NTP_4_2_5P249_RC ntpd/ntpd.1@1.242 +2 -2 NTP_4_2_5P249_RC ntpdc/ntpdc-opts.c@1.240 +2 -2 NTP_4_2_5P249_RC ntpdc/ntpdc-opts.h@1.240 +3 -3 NTP_4_2_5P249_RC ntpdc/ntpdc-opts.texi@1.239 +2 -66 NTP_4_2_5P249_RC ntpdc/ntpdc.1@1.239 +2 -2 NTP_4_2_5P249_RC ntpq/ntpq-opts.c@1.241 +2 -2 NTP_4_2_5P249_RC ntpq/ntpq-opts.h@1.241 +3 -3 NTP_4_2_5P249_RC ntpq/ntpq-opts.texi@1.240 +2 -51 NTP_4_2_5P249_RC ntpq/ntpq.1@1.240 +2 -2 NTP_4_2_5P249_RC ntpsnmpd/ntpsnmpd-opts.c@1.119 +2 -2 NTP_4_2_5P249_RC ntpsnmpd/ntpsnmpd-opts.h@1.119 +3 -3 NTP_4_2_5P249_RC ntpsnmpd/ntpsnmpd-opts.texi@1.119 +2 -23 NTP_4_2_5P249_RC ntpsnmpd/ntpsnmpd.1@1.118 +2 -2 NTP_4_2_5P249_RC packageinfo.sh@1.253 +1 -1 NTP_4_2_5P249_RC sntp/sntp-opts.c@1.113 +6 -5 NTP_4_2_5P249_RC sntp/sntp-opts.h@1.113 +3 -3 NTP_4_2_5P249_RC sntp/sntp-opts.texi@1.113 +4 -55 NTP_4_2_5P249_RC sntp/sntp.1@1.113 +18 -75 NTP_4_2_5P249_RC sntp/sntp.html@1.3 +26 -22 NTP_4_2_5P249_RC util/ntp-keygen-opts.c@1.243 +2 -2 NTP_4_2_5P249_RC util/ntp-keygen-opts.h@1.243 +3 -3 NTP_4_2_5P249_RC util/ntp-keygen-opts.texi@1.242 +2 -46 NTP_4_2_5P249_RC util/ntp-keygen.1@1.242 +2 -2 NTP_4_2_5P249_RC ChangeSet@1.2074, 2009-11-28 04:25:13-05:00, stenn@whimsy.udel.edu cleanup sntp/main.c@1.24 +2 -1 cleanup ChangeSet@1.2072, 2009-11-28 01:43:01-05:00, stenn@whimsy.udel.edu sntp cleanup ChangeLog@1.553.1.6 +1 -0 sntp documentation cleanup ChangeLog@1.553.1.5 +3 -0 sntp: Show dispersion. Clean up error messages and offset sntp/main.c@1.23 +33 -18 sntp: Show dispersion. Clean up error messages and offset sntp/networking.h@1.17 +1 -1 cleanup sntp/sntp-opts.def@1.14 +16 -74 sntp documentation cleanup ChangeSet@1.2070.1.1, 2009-11-28 06:31:50+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1400] An empty KOD DB file causes sntp to coredump. ChangeLog@1.553.2.1 +1 -0 [Bug 1400] An empty KOD DB file causes sntp to coredump. sntp/kod_management.c@1.15 +45 -26 [Bug 1400] An empty KOD DB file causes sntp to coredump. ChangeSet@1.2071, 2009-11-28 01:27:47-05:00, stenn@whimsy.udel.edu Cleanup from the autoconf/automake upgrades ChangeLog@1.553.1.4 +1 -0 Cleanup from the autoconf/automake upgrades Makefile.am@1.89 +1 -1 Cleanup from the autoconf/automake upgrades configure.ac@1.464 +1 -1 Cleanup from the autoconf/automake upgrades sntp/Makefile.am@1.19 +18 -12 Cleanup from the autoconf/automake upgrades sntp/configure.ac@1.28 +1 -0 Cleanup from the autoconf/automake upgrades ChangeSet@1.2070, 2009-11-26 05:39:41-05:00, stenn@whimsy.udel.edu NTP_4_2_5P248_RC TAG: NTP_4_2_5P248_RC ChangeLog@1.553.1.3 +1 -0 NTP_4_2_5P248_RC ntpd/ntpd-opts.c@1.243 +2 -2 NTP_4_2_5P248_RC ntpd/ntpd-opts.h@1.243 +3 -3 NTP_4_2_5P248_RC ntpd/ntpd-opts.texi@1.241 +9 -4 NTP_4_2_5P248_RC ntpd/ntpd.1@1.241 +2 -2 NTP_4_2_5P248_RC ntpdc/ntpdc-opts.c@1.239 +2 -2 NTP_4_2_5P248_RC ntpdc/ntpdc-opts.h@1.239 +3 -3 NTP_4_2_5P248_RC ntpdc/ntpdc-opts.texi@1.238 +7 -4 NTP_4_2_5P248_RC ntpdc/ntpdc.1@1.238 +2 -2 NTP_4_2_5P248_RC ntpq/ntpq-opts.c@1.240 +2 -2 NTP_4_2_5P248_RC ntpq/ntpq-opts.h@1.240 +3 -3 NTP_4_2_5P248_RC ntpq/ntpq-opts.texi@1.239 +3 -3 NTP_4_2_5P248_RC ntpq/ntpq.1@1.239 +2 -2 NTP_4_2_5P248_RC ntpsnmpd/ntpsnmpd-opts.c@1.118 +2 -2 NTP_4_2_5P248_RC ntpsnmpd/ntpsnmpd-opts.h@1.118 +3 -3 NTP_4_2_5P248_RC ntpsnmpd/ntpsnmpd-opts.texi@1.118 +23 -2 NTP_4_2_5P248_RC ntpsnmpd/ntpsnmpd.1@1.117 +2 -2 NTP_4_2_5P248_RC packageinfo.sh@1.252 +1 -1 NTP_4_2_5P248_RC sntp/sntp-opts.c@1.112 +13 -9 NTP_4_2_5P248_RC sntp/sntp-opts.h@1.112 +3 -3 NTP_4_2_5P248_RC sntp/sntp-opts.texi@1.112 +18 -10 NTP_4_2_5P248_RC sntp/sntp.1@1.112 +7 -38 NTP_4_2_5P248_RC sntp/sntp.html@1.2 +22 -26 NTP_4_2_5P248_RC util/ntp-keygen-opts.c@1.242 +2 -2 NTP_4_2_5P248_RC util/ntp-keygen-opts.h@1.242 +3 -3 NTP_4_2_5P248_RC util/ntp-keygen-opts.texi@1.241 +3 -3 NTP_4_2_5P248_RC util/ntp-keygen.1@1.241 +2 -2 NTP_4_2_5P248_RC ChangeSet@1.2069, 2009-11-26 03:45:44-05:00, stenn@whimsy.udel.edu updates for sntp/sntp.html .point-changed-filelist@1.7 +1 -0 updates for sntp/sntp.html BitKeeper/deleted/.del-version.texi~39e8aa5321c3de71@1.2 +0 -0 Delete: include/version.texi BitKeeper/deleted/.del-version.texi~dc1d08ee311794@1.2 +0 -0 Delete: sntp/version.texi BitKeeper/etc/ignore@1.74 +4 -3 updates for sntp/sntp.html BitKeeper/etc/ignore@1.73 +1 -0 added version.texi ChangeSet@1.2068, 2009-11-26 07:04:26+00:00, hart@pogo.udel.edu .del-depsver.mf~797b9b4e1db319be: Delete: sntp/depsver.mf ignore: added sntp/depsver.mf sntp/depsver.mf is 'generated' (copied) from top-level depsver.mf by bootstrap script BitKeeper/deleted/.del-depsver.mf~797b9b4e1db319be@1.2 +0 -0 Delete: sntp/depsver.mf BitKeeper/etc/ignore@1.72 +1 -0 added sntp/depsver.mf ChangeSet@1.2067, 2009-11-26 01:42:32-05:00, stenn@psp-deb1.ntp.org bk: ignore ltmain.sh BitKeeper/etc/ignore@1.71 +1 -0 added ltmain.sh ChangeSet@1.2065, 2009-11-26 01:33:57-05:00, stenn@psp-deb1.ntp.org Prepare for the generation of sntp.html BitKeeper/etc/ignore@1.70 +1 -9 Update the bk ignore list BitKeeper/etc/ignore@1.69 +1 -0 added config.cache-* ChangeLog@1.551.2.1 +1 -0 Prepare for the generation of sntp.html include/version.texi@1.1 +3 -0 BitKeeper file /home/stenn/ntp-dev-sntp/include/version.texi include/version.texi@1.0 +0 -0 sntp/Makefile.am@1.17 +1 -5 Prepare for the generation of sntp.html sntp/depsver.mf@1.1 +67 -0 BitKeeper file /home/stenn/ntp-dev-sntp/sntp/depsver.mf sntp/depsver.mf@1.0 +0 -0 sntp/sntp.html@1.1 +105 -0 BitKeeper file /home/stenn/ntp-dev-sntp/sntp/sntp.html sntp/sntp.html@1.0 +0 -0 sntp/version.texi@1.1 +3 -0 BitKeeper file /home/stenn/ntp-dev-sntp/sntp/version.texi sntp/version.texi@1.0 +0 -0 ChangeSet@1.2060.23.1, 2009-11-26 01:16:35-05:00, stenn@whimsy.udel.edu Documentation changes from Dave Mills ChangeLog@1.553.1.1 +1 -0 Documentation changes from Dave Mills html/confopt.html@1.48 +53 -60 Documentation changes from Dave Mills html/manyopt.html@1.20 +5 -3 Documentation changes from Dave Mills html/quick.html@1.20 +17 -4 Documentation changes from Dave Mills ChangeSet@1.2060.1.56, 2009-11-26 01:06:36-05:00, stenn@pogo.udel.edu typo nit ChangeLog@1.555 +1 -1 ChangeSet@1.2060.22.1, 2009-11-25 14:19:20-05:00, murray@malarky.udel.edu refclock_shm.c, ChangeLog: Bug-1397: shmget() failing because of file mode ChangeLog@1.551.1.1 +1 -0 Bug-1397: shmget() failing because of file mode ntpd/refclock_shm.c@1.20 +1 -1 Bug-1397: shmget() failing because of file mode ChangeSet@1.2060.1.54, 2009-11-24 22:05:54+00:00, davehart@shiny.ad.hartbrothers.com One more missing free(), thanks to Hal Murray's sharp eyes ntpd/ntp_intres.c@1.74 +2 -0 One more missing free(), thanks to Hal Murray's sharp eyes ChangeSet@1.2060.1.53, 2009-11-24 14:51:38+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1387] free() conf_entry in ntp_intres removeentry(). [Bug 1392] intres retries duplicate assocations endlessly. ChangeLog@1.553 +1 -0 [Bug 1387] free() conf_entry in ntp_intres removeentry(). [Bug 1392] intres retries duplicate assocations endlessly. ntpd/ntp_intres.c@1.73 +31 -26 [Bug 1387] free() conf_entry in ntp_intres removeentry(). [Bug 1392] intres retries duplicate assocations endlessly. ntpd/ntp_peer.c@1.126 +6 -11 use DPRINTF ChangeSet@1.2060.1.52, 2009-11-23 17:43:13+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1387] Storage leak in ntp_intres (minor). [Bug 1389] buffer overflow in refclock_oncore.c [Bug 1391] .texi usage text from installed, not built binaries. Correct *-opts.h dependency so default 'get' action isn't used. ChangeLog@1.552 +4 -0 [Bug 1387] Storage leak in ntp_intres (minor). [Bug 1389] buffer overflow in refclock_oncore.c [Bug 1391] .texi usage text from installed, not built binaries. Correct *-opts.h dependency so default 'get' action isn't used. configure.ac@1.459.1.14 +3 -4 [Bug 1391] .texi usage text from installed, not built binaries. no functional change to configure.ac, eliminate duplicate "checking for net-snmp-config" messages and clarify help text for --with-ntpsnmpd. ntpd/Makefile.am@1.78 +5 -3 [Bug 1391] .texi usage text from installed, not built binaries. Correct *-opts.h dependency so default 'get' action isn't used. ntpd/ntp_intres.c@1.72 +1 -0 [Bug 1387] Storage leak in ntp_intres (minor). ntpd/refclock_oncore.c@1.81 +306 -191 * [Bug 1389] buffer overflow in refclock_oncore.c ntpdc/Makefile.am@1.46 +5 -3 [Bug 1391] .texi usage text from installed, not built binaries. Correct *-opts.h dependency so default 'get' action isn't used. ntpq/Makefile.am@1.41 +5 -3 [Bug 1391] .texi usage text from installed, not built binaries. Correct *-opts.h dependency so default 'get' action isn't used. ntpsnmpd/Makefile.am@1.14 +8 -3 [Bug 1391] .texi usage text from installed, not built binaries. Correct *-opts.h dependency so default 'get' action isn't used. sntp/Makefile.am@1.13.1.6 +5 -3 [Bug 1391] .texi usage text from installed, not built binaries. Correct *-opts.h dependency so default 'get' action isn't used. util/Makefile.am@1.44 +5 -3 [Bug 1391] .texi usage text from installed, not built binaries. Correct *-opts.h dependency so default 'get' action isn't used. ChangeSet@1.2060.1.51, 2009-11-20 05:36:49-05:00, stenn@whimsy.udel.edu NTP_4_2_5P247_RC TAG: NTP_4_2_5P247_RC ChangeLog@1.551 +1 -0 NTP_4_2_5P247_RC ntpd/ntpd-opts.c@1.242 +5 -5 NTP_4_2_5P247_RC ntpd/ntpd-opts.h@1.242 +4 -4 NTP_4_2_5P247_RC ntpd/ntpd-opts.texi@1.240 +2 -2 NTP_4_2_5P247_RC ntpd/ntpd.1@1.240 +2 -2 NTP_4_2_5P247_RC ntpdc/ntpdc-opts.c@1.238 +5 -5 NTP_4_2_5P247_RC ntpdc/ntpdc-opts.h@1.238 +4 -4 NTP_4_2_5P247_RC ntpdc/ntpdc-opts.texi@1.237 +4 -4 NTP_4_2_5P247_RC ntpdc/ntpdc.1@1.237 +2 -2 NTP_4_2_5P247_RC ntpq/ntpq-opts.c@1.239 +5 -5 NTP_4_2_5P247_RC ntpq/ntpq-opts.h@1.239 +4 -4 NTP_4_2_5P247_RC ntpq/ntpq-opts.texi@1.238 +4 -4 NTP_4_2_5P247_RC ntpq/ntpq.1@1.238 +2 -2 NTP_4_2_5P247_RC ntpsnmpd/ntpsnmpd-opts.c@1.117 +5 -5 NTP_4_2_5P247_RC ntpsnmpd/ntpsnmpd-opts.h@1.117 +4 -4 NTP_4_2_5P247_RC ntpsnmpd/ntpsnmpd-opts.texi@1.117 +2 -23 NTP_4_2_5P247_RC ntpsnmpd/ntpsnmpd.1@1.116 +2 -2 NTP_4_2_5P247_RC packageinfo.sh@1.251 +1 -1 NTP_4_2_5P247_RC sntp/sntp-opts.c@1.111 +5 -5 NTP_4_2_5P247_RC sntp/sntp-opts.h@1.111 +4 -4 NTP_4_2_5P247_RC sntp/sntp-opts.texi@1.111 +4 -4 NTP_4_2_5P247_RC sntp/sntp.1@1.111 +2 -2 NTP_4_2_5P247_RC util/ntp-keygen-opts.c@1.241 +5 -5 NTP_4_2_5P247_RC util/ntp-keygen-opts.h@1.241 +4 -4 NTP_4_2_5P247_RC util/ntp-keygen-opts.texi@1.240 +5 -5 NTP_4_2_5P247_RC util/ntp-keygen.1@1.240 +2 -2 NTP_4_2_5P247_RC ChangeSet@1.2060.1.50, 2009-11-18 04:29:17+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1308] support systems that lack fork(). ChangeLog@1.550 +1 -0 [Bug 1308] support systems that lack fork(). configure.ac@1.459.1.13 +2 -0 [Bug 1308] support systems that lack fork(). include/ntp_config.h@1.66 +12 -1 setup NO_INTRES macro on systems which do not support fork or threads include/ntp_machine.h@1.26 +3 -3 stay out of compiler/system underscore namespace ntpd/ntp_config.c@1.237 +12 -23 [Bug 1308] support systems that lack fork(). ntpd/ntp_intres.c@1.71 +7 -0 [Bug 1308] support systems that lack fork(). ChangeSet@1.2060.1.49, 2009-11-17 19:43:44+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1142] nodebug builds shed no light on -d, -D option failure. [Bug 1179] point out the problem with -i/--jaildir and -u/--user when they are disabled by configure. -4/-6 are not equivalent in the libopts sense ChangeLog@1.549 +3 -0 * [Bug 1142] nodebug builds shed no light on -d, -D option failure. * [Bug 1179] point out the problem with -i/--jaildir and -u/--user when they are disabled by configure. ntpd/cmd_args.c@1.56 +9 -41 [Bug 1142] nodebug builds shed no light on -d, -D option failure. [Bug 1179] point out the problem with -i/--jaildir and -u/--user when they are disabled by configure. -4/-6 are not equivalent in the libopts sense --authreq and --authnoreq are mutually exclusive ntpd/ntpd-opts.c@1.241 +28 -20 updated Autogen output ntpd/ntpd-opts.h@1.241 +2 -5 updated Autogen output ntpd/ntpd-opts.texi@1.239 +17 -7 updated Autogen output ntpd/ntpd.1@1.239 +16 -6 updated Autogen output ntpd/ntpdbase-opts.def@1.20 +18 -6 [Bug 1142] nodebug builds shed no light on -d, -D option failure. [Bug 1179] point out the problem with -i/--jaildir and -u/--user when they are disabled by configure. -4/-6 are not equivalent in the libopts sense ntpdc/ntpdc-opts.c@1.237 +19 -11 updated Autogen output ntpdc/ntpdc-opts.def@1.14 +2 -2 -4/-6 are not equivalent in the libopts sense ntpdc/ntpdc-opts.h@1.237 +2 -5 updated Autogen output ntpdc/ntpdc-opts.texi@1.236 +8 -6 updated Autogen output ntpdc/ntpdc.1@1.236 +5 -3 updated Autogen output ntpdc/ntpdc.c@1.75 +3 -8 -4/-6 are not equivalent in the libopts sense ntpq/ntpq-opts.c@1.238 +4 -4 updated Autogen output ntpq/ntpq-opts.h@1.238 +2 -2 updated Autogen output ntpq/ntpq-opts.texi@1.237 +4 -4 updated Autogen output ntpq/ntpq.1@1.237 +1 -1 updated Autogen output ntpq/ntpq.c@1.97 +2 -1 Don't use DPRINTF because #ifdef DEBUG isn't valid in utils ntpsnmpd/ntpsnmpd-opts.c@1.116 +4 -4 updated Autogen output ntpsnmpd/ntpsnmpd-opts.h@1.116 +2 -2 updated Autogen output ntpsnmpd/ntpsnmpd-opts.texi@1.116 +23 -2 updated Autogen output sntp/main.c@1.22 +3 -5 -4/-6 are not equivalent in the libopts sense sntp/sntp-opts.c@1.110 +19 -11 updated Autogen output sntp/sntp-opts.def@1.11.1.1 +3 -2 -4/-6 are not equivalent in the libopts sense sntp/sntp-opts.h@1.110 +2 -5 updated Autogen output sntp/sntp-opts.texi@1.110 +8 -6 updated Autogen output sntp/sntp.1@1.110 +5 -3 updated Autogen output util/ntp-keygen-opts.c@1.240 +4 -4 updated Autogen output util/ntp-keygen-opts.h@1.240 +2 -2 updated Autogen output util/ntp-keygen-opts.texi@1.239 +5 -5 updated Autogen output util/ntp-keygen.1@1.239 +1 -1 updated Autogen output ChangeSet@1.2060.1.48, 2009-11-17 16:15:53+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1343] sntp doesn't link on Solaris 7, needs -lresolv. ChangeLog@1.548 +1 -0 [Bug 1343] sntp doesn't link on Solaris 7, needs -lresolv. configure.ac@1.459.1.12 +2 -1 Search for inet_ntop in -lresolv if not in default libs, needed for sntp on Solaris 7 sntp/configure.ac@1.27 +2 -1 Search for inet_ntop in -lresolv if not in default libs, needed for sntp on Solaris 7 ChangeSet@1.2060.1.47, 2009-11-17 07:34:00-05:00, stenn@whimsy.udel.edu NTP_4_2_5P246_RC TAG: NTP_4_2_5P246_RC ChangeLog@1.547 +1 -0 NTP_4_2_5P246_RC ntpd/ntpd-opts.c@1.240 +32 -33 NTP_4_2_5P246_RC ntpd/ntpd-opts.h@1.240 +8 -21 NTP_4_2_5P246_RC ntpd/ntpd-opts.texi@1.238 +1 -1 NTP_4_2_5P246_RC ntpd/ntpd.1@1.238 +3 -3 NTP_4_2_5P246_RC ntpdc/ntpdc-opts.c@1.236 +24 -17 NTP_4_2_5P246_RC ntpdc/ntpdc-opts.h@1.236 +6 -5 NTP_4_2_5P246_RC ntpdc/ntpdc-opts.texi@1.235 +1 -1 NTP_4_2_5P246_RC ntpdc/ntpdc.1@1.235 +3 -3 NTP_4_2_5P246_RC ntpq/ntpq-opts.c@1.237 +24 -17 NTP_4_2_5P246_RC ntpq/ntpq-opts.h@1.237 +5 -5 NTP_4_2_5P246_RC ntpq/ntpq-opts.texi@1.236 +1 -1 NTP_4_2_5P246_RC ntpq/ntpq.1@1.236 +3 -3 NTP_4_2_5P246_RC ntpsnmpd/ntpsnmpd-opts.c@1.115 +24 -17 NTP_4_2_5P246_RC ntpsnmpd/ntpsnmpd-opts.h@1.115 +5 -5 NTP_4_2_5P246_RC ntpsnmpd/ntpsnmpd-opts.texi@1.115 +1 -1 NTP_4_2_5P246_RC ntpsnmpd/ntpsnmpd.1@1.115 +3 -3 NTP_4_2_5P246_RC packageinfo.sh@1.250 +1 -1 NTP_4_2_5P246_RC sntp/sntp-opts.c@1.109 +24 -17 NTP_4_2_5P246_RC sntp/sntp-opts.h@1.109 +8 -5 NTP_4_2_5P246_RC sntp/sntp-opts.texi@1.109 +1 -1 NTP_4_2_5P246_RC sntp/sntp.1@1.109 +3 -3 NTP_4_2_5P246_RC util/ntp-keygen-opts.c@1.239 +39 -47 NTP_4_2_5P246_RC util/ntp-keygen-opts.h@1.239 +11 -32 NTP_4_2_5P246_RC util/ntp-keygen-opts.texi@1.238 +1 -1 NTP_4_2_5P246_RC util/ntp-keygen.1@1.238 +3 -3 NTP_4_2_5P246_RC ChangeSet@1.2060.1.46, 2009-11-17 06:53:35-05:00, stenn@whimsy.udel.edu autogen upgrade cleanup clockstuff/clktest-opts.c@1.12 +130 -361 autogen upgrade cleanup clockstuff/clktest-opts.h@1.12 +90 -100 autogen upgrade cleanup libopts/autoopts/options.h@1.5 +7 -5 autogen upgrade cleanup libopts/autoopts/usage-txt.h@1.5 +161 -152 autogen upgrade cleanup libopts/genshell.c@1.5 +22 -15 autogen upgrade cleanup libopts/genshell.h@1.5 +2 -2 autogen upgrade cleanup ntpd/ntpdsim-opts.c@1.17 +237 -319 autogen upgrade cleanup ntpd/ntpdsim-opts.h@1.17 +112 -139 autogen upgrade cleanup sntp/libopts/autoopts/options.h@1.6 +7 -5 autogen upgrade cleanup sntp/libopts/autoopts/usage-txt.h@1.6 +161 -152 autogen upgrade cleanup sntp/libopts/genshell.c@1.6 +22 -15 autogen upgrade cleanup sntp/libopts/genshell.h@1.6 +2 -2 autogen upgrade cleanup ChangeSet@1.2060.1.45, 2009-11-17 06:44:44-05:00, stenn@whimsy.udel.edu Upgrade to autogen 5.10 ChangeLog@1.546 +1 -0 Upgrade to autogen 5.10 libopts/Makefile.am@1.2 +1 -1 Upgrade to autogen 5.10 libopts/ag-char-map.h@1.5 +1 -1 Upgrade to autogen 5.10 libopts/autoopts.c@1.4 +43 -26 Upgrade to autogen 5.10 libopts/autoopts.h@1.4 +1 -1 Upgrade to autogen 5.10 libopts/boolean.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/compat/compat.h@1.4 +48 -25 Upgrade to autogen 5.10 libopts/compat/pathfind.c@1.4 +1 -2 Upgrade to autogen 5.10 libopts/compat/windows-config.h@1.4 +0 -1 Upgrade to autogen 5.10 libopts/configfile.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/cook.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/enumeration.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/environment.c@1.5 +1 -1 Upgrade to autogen 5.10 libopts/file.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/load.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/m4/libopts.m4@1.5 +2 -8 Upgrade to autogen 5.10 libopts/m4/liboptschk.m4@1.4 +0 -1 Upgrade to autogen 5.10 libopts/makeshell.c@1.4 +41 -41 Upgrade to autogen 5.10 libopts/nested.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/numeric.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/pgusage.c@1.4 +5 -4 Upgrade to autogen 5.10 libopts/proto.h@1.5 +1 -1 Upgrade to autogen 5.10 libopts/putshell.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/reset.c@1.4 +8 -2 Upgrade to autogen 5.10 libopts/restore.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/save.c@1.5 +1 -1 Upgrade to autogen 5.10 libopts/sort.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/stack.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/streqvcmp.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/text_mmap.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/time.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/usage.c@1.4 +53 -18 Upgrade to autogen 5.10 libopts/value-type.h@1.5 +1 -1 Upgrade to autogen 5.10 libopts/version.c@1.4 +1 -1 Upgrade to autogen 5.10 libopts/xat-attribute.h@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/Makefile.am@1.3 +1 -1 Upgrade to autogen 5.10 sntp/libopts/ag-char-map.h@1.6 +1 -1 Upgrade to autogen 5.10 sntp/libopts/autoopts.c@1.5 +43 -26 Upgrade to autogen 5.10 sntp/libopts/autoopts.h@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/boolean.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/compat/compat.h@1.5 +48 -25 Upgrade to autogen 5.10 sntp/libopts/compat/pathfind.c@1.5 +1 -2 Upgrade to autogen 5.10 sntp/libopts/compat/windows-config.h@1.5 +0 -1 Upgrade to autogen 5.10 sntp/libopts/configfile.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/cook.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/enumeration.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/environment.c@1.6 +1 -1 Upgrade to autogen 5.10 sntp/libopts/file.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/load.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/m4/libopts.m4@1.6 +2 -8 Upgrade to autogen 5.10 sntp/libopts/m4/liboptschk.m4@1.5 +0 -1 Upgrade to autogen 5.10 sntp/libopts/makeshell.c@1.5 +41 -41 Upgrade to autogen 5.10 sntp/libopts/nested.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/numeric.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/pgusage.c@1.5 +5 -4 Upgrade to autogen 5.10 sntp/libopts/proto.h@1.6 +1 -1 Upgrade to autogen 5.10 sntp/libopts/putshell.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/reset.c@1.5 +8 -2 Upgrade to autogen 5.10 sntp/libopts/restore.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/save.c@1.6 +1 -1 Upgrade to autogen 5.10 sntp/libopts/sort.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/stack.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/streqvcmp.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/text_mmap.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/time.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/usage.c@1.5 +53 -18 Upgrade to autogen 5.10 sntp/libopts/value-type.h@1.6 +1 -1 Upgrade to autogen 5.10 sntp/libopts/version.c@1.5 +1 -1 Upgrade to autogen 5.10 sntp/libopts/xat-attribute.h@1.6 +1 -1 Upgrade to autogen 5.10 ChangeSet@1.2060.1.44, 2009-11-17 07:27:53+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1384] ntpq :config core dumped with a blank password. ChangeLog@1.545 +1 -0 [Bug 1384] ntpq :config core dumped with a blank password. ntpq/ntpq-subs.c@1.41 +60 -41 [Bug 1384] ntpq :config core dumped with a blank password. ChangeSet@1.2060.21.1, 2009-11-17 04:25:42+00:00, davehart@shiny.ad.hartbrothers.com use (peer->pmode == MODE_BROADCAST) rather than (peer->castflags & MDF_BCLNT) to detect ephemeral broadcastclient associations to exempt from peer_clear("XFAC") ChangeLog@1.542.1.1 +1 -0 [Bug 1378] Unnecessary resetting of peers during interface update. ntpd/ntp_peer.c@1.125 +1 -1 use (peer->pmode == MODE_BROADCAST) rather than (peer->castflags & MDF_BCLNT) to detect broadcastclient associations to exempt from peer_clear("XFAC"), suggested by Frank Kardel. ChangeSet@1.2060.1.42, 2009-11-16 05:41:46+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1382] p245 configure --disable-dependency-tracking won't build ChangeLog@1.543 +1 -0 [Bug 1382] p245 configure --disable-dependency-tracking won't build Makefile.am@1.86.1.3 +1 -0 depsver.mf requires CLEANFILES be set even if empty adjtimed/Makefile.am@1.6 +1 -0 depsver.mf requires CLEANFILES be set even if empty clockstuff/Makefile.am@1.9 +1 -0 depsver.mf requires CLEANFILES be set even if empty depsver.mf@1.2 +31 -7 tolerate --disable-dependency-tracking use a more targeted ./config.status run include/ntpd.h@1.137 +1 -1 silence "assignment discards qualifier" warning by using const char * libntp/Makefile.am@1.51 +1 -0 depsver.mf requires CLEANFILES be set even if empty ntpd/cmd_args.c@1.55 +1 -4 silence assignment discards qualifiers warning by eliminating assignment ntpd/ntpd.c@1.110 +1 -1 silence "assignment discards qualifier" warning by using const char * ntpdate/Makefile.am@1.22 +1 -0 depsver.mf requires CLEANFILES be set even if empty ntpq/Makefile.am@1.40 +1 -0 depsver.mf requires CLEANFILES be set even if empty ntpsnmpd/Makefile.am@1.13 +1 -0 depsver.mf requires CLEANFILES be set even if empty parseutil/Makefile.am@1.12 +1 -0 depsver.mf requires CLEANFILES be set even if empty sntp/Makefile.am@1.13.1.5 +1 -0 depsver.mf requires CLEANFILES be set even if empty util/Makefile.am@1.43 +1 -0 depsver.mf requires CLEANFILES be set even if empty ChangeSet@1.2060.1.41, 2009-11-14 08:29:21-05:00, stenn@whimsy.udel.edu NTP_4_2_5P245_RC TAG: NTP_4_2_5P245_RC ChangeLog@1.542 +1 -0 NTP_4_2_5P245_RC ntpd/ntpd-opts.c@1.239 +2 -2 NTP_4_2_5P245_RC ntpd/ntpd-opts.h@1.239 +3 -3 NTP_4_2_5P245_RC ntpd/ntpd-opts.texi@1.237 +1 -1 NTP_4_2_5P245_RC ntpd/ntpd.1@1.237 +2 -2 NTP_4_2_5P245_RC ntpdc/ntpdc-opts.c@1.235 +2 -2 NTP_4_2_5P245_RC ntpdc/ntpdc-opts.h@1.235 +3 -3 NTP_4_2_5P245_RC ntpdc/ntpdc-opts.texi@1.234 +1 -1 NTP_4_2_5P245_RC ntpdc/ntpdc.1@1.234 +2 -2 NTP_4_2_5P245_RC ntpq/ntpq-opts.c@1.236 +2 -2 NTP_4_2_5P245_RC ntpq/ntpq-opts.h@1.236 +3 -3 NTP_4_2_5P245_RC ntpq/ntpq-opts.texi@1.235 +1 -1 NTP_4_2_5P245_RC ntpq/ntpq.1@1.235 +2 -2 NTP_4_2_5P245_RC ntpsnmpd/ntpsnmpd-opts.c@1.114 +2 -2 NTP_4_2_5P245_RC ntpsnmpd/ntpsnmpd-opts.h@1.114 +3 -3 NTP_4_2_5P245_RC ntpsnmpd/ntpsnmpd-opts.texi@1.114 +1 -1 NTP_4_2_5P245_RC ntpsnmpd/ntpsnmpd.1@1.114 +2 -2 NTP_4_2_5P245_RC packageinfo.sh@1.249 +1 -1 NTP_4_2_5P245_RC sntp/sntp-opts.c@1.108 +2 -2 NTP_4_2_5P245_RC sntp/sntp-opts.h@1.108 +3 -3 NTP_4_2_5P245_RC sntp/sntp-opts.texi@1.108 +1 -1 NTP_4_2_5P245_RC sntp/sntp.1@1.108 +2 -2 NTP_4_2_5P245_RC util/ntp-keygen-opts.c@1.238 +2 -2 NTP_4_2_5P245_RC util/ntp-keygen-opts.h@1.238 +3 -3 NTP_4_2_5P245_RC util/ntp-keygen-opts.texi@1.237 +1 -1 NTP_4_2_5P245_RC util/ntp-keygen.1@1.237 +2 -2 NTP_4_2_5P245_RC ChangeSet@1.2060.1.40, 2009-11-14 07:23:50-05:00, stenn@whimsy.udel.edu Changes from Dave Mills ChangeLog@1.541 +1 -0 Changes from Dave Mills html/authopt.html@1.59 +6 -5 Cleanup from Dave Mills html/keygen.html@1.19 +6 -6 Cleanup from Dave Mills html/miscopt.html@1.53 +9 -3 Cleanup from Dave Mills libntp/authreadkeys.c@1.16 +1 -1 Cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.153 +1 -1 Cleanup from Dave Mills ntpd/refclock_local.c@1.20 +0 -9 Cleanup from Dave Mills ChangeSet@1.2060.20.1, 2009-11-14 02:20:06+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1381] Version .deps generated include file dependencies to allow known dependecy-breaking changes to force .deps to be cleaned, triggered by changing the contents of deps-ver and/or sntp/deps-ver. ChangeLog@1.538.1.1 +3 -0 [Bug 1381] Version .deps generated include file dependencies to allow known dependecy-breaking changes to force .deps to be cleaned, triggered by changing the contents of deps-ver and/or sntp/deps-ver. Makefile.am@1.86.1.2 +39 -39 whitespace cleanup no longer hunt down and remove CVS directories in distclean, as we don't have them. adjtimed/Makefile.am@1.5 +3 -1 include depsver.mf arlib/configure.in@1.3 +6 -3 bring res_init check in line with main configure.ac to fix arlib build break bootstrap@1.28 +1 -17 remove disabled first whack at this issue clockstuff/Makefile.am@1.8 +3 -0 include depsver.mf configure.ac@1.459.3.1 +0 -3 remove duplicate AC_SEARCH_LIBS for setsockopt deps-ver@1.1 +1 -0 a change to the contents of this file cleans any existing .deps deps-ver@1.0 +0 -0 depsver.mf@1.1 +43 -0 .am include to implement .deps include file dependency versioning depsver.mf@1.0 +0 -0 libntp/Makefile.am@1.50 +2 -3 include depsver.mf remove ../include/des.h rule, no longer used libparse/Makefile.am@1.16 +3 -0 include depsver.mf ntpd/Makefile.am@1.77 +2 -1 include depsver.mf ntpd/ntp_peer.c@1.124 +0 -1 remove stale comment, stoa() uses LIB_GETBUF() and is safe to call repeatedly in the same printf(). ntpdate/Makefile.am@1.21 +4 -2 include depsver.mf ntpdc/Makefile.am@1.45 +2 -1 include depsver.mf ntpq/Makefile.am@1.39 +3 -0 include depsver.mf ntpsnmpd/Makefile.am@1.12 +2 -0 include depsver.mf parseutil/Makefile.am@1.11 +3 -0 include depsver.mf sntp/Makefile.am@1.13.1.4 +4 -1 include depsver.mf sntp/configure.ac@1.24.1.1 +1 -2 AC_SEARCH_LIBS already tries without any libs, so wrapping with AC_CHECK_FUNC just bloats sntp/deps-ver@1.1 +1 -0 a change to the contents of this file cleans any existing .deps sntp/deps-ver@1.0 +0 -0 util/Makefile.am@1.42 +3 -0 include depsver.mf ChangeSet@1.2060.1.38, 2009-11-13 13:31:39+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: mirror inet_ntop(), inet_pton() tests from top configure.ac remomve ISC_PLATFORM_NEEDATON test, no longer used by libisc configure.ac@1.459.1.10 +0 -1 remomve ISC_PLATFORM_NEEDATON test, no longer used by libisc sntp/configure.ac@1.25 +3 -0 mirror inet_ntop(), inet_pton() tests from top configure.ac ChangeSet@1.2060.1.37, 2009-11-12 13:37:43+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1343] sntp illegal C does not compile on Solaris 7. Windows VC9/VS2008: use generic library name libeay32.lib instead of variants encoding build type to match what you get building OpenSSL from source. ChangeLog@1.539 +1 -0 [Bug 1343] sntp illegal C does not compile on Solaris 7. ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.9 +2 -2 use generic library name libeay32.lib instead of variants encoding build type to match what you get building OpenSSL from source. ports/winnt/vs2008/ntpd/ntpd.vcproj@1.22 +2 -2 use generic library name libeay32.lib instead of variants encoding build type to match what you get building OpenSSL from source. ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.12 +2 -2 use generic library name libeay32.lib instead of variants encoding build type to match what you get building OpenSSL from source. ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.12 +2 -2 use generic library name libeay32.lib instead of variants encoding build type to match what you get building OpenSSL from source. ports/winnt/vs2008/ntpq/ntpq.vcproj@1.11 +2 -2 use generic library name libeay32.lib instead of variants encoding build type to match what you get building OpenSSL from source. sntp/log.c@1.11 +9 -9 [Bug 1343] sntp illegal C does not compile on Solaris 7. sntp/main.c@1.21 +5 -8 [Bug 1343] sntp illegal C does not compile on Solaris 7. sntp/networking.c@1.28 +14 -11 [Bug 1343] sntp illegal C does not compile on Solaris 7. ChangeSet@1.2060.1.36, 2009-11-12 06:10:27-05:00, stenn@whimsy.udel.edu NTP_4_2_5P244_RC TAG: NTP_4_2_5P244_RC ChangeLog@1.538 +1 -0 NTP_4_2_5P244_RC ntpd/ntpd-opts.c@1.238 +2 -2 NTP_4_2_5P244_RC ntpd/ntpd-opts.h@1.238 +3 -3 NTP_4_2_5P244_RC ntpd/ntpd-opts.texi@1.236 +1 -1 NTP_4_2_5P244_RC ntpd/ntpd.1@1.236 +2 -2 NTP_4_2_5P244_RC ntpdc/ntpdc-opts.c@1.234 +2 -2 NTP_4_2_5P244_RC ntpdc/ntpdc-opts.h@1.234 +3 -3 NTP_4_2_5P244_RC ntpdc/ntpdc-opts.texi@1.233 +1 -1 NTP_4_2_5P244_RC ntpdc/ntpdc.1@1.233 +2 -2 NTP_4_2_5P244_RC ntpq/ntpq-opts.c@1.235 +2 -2 NTP_4_2_5P244_RC ntpq/ntpq-opts.h@1.235 +3 -3 NTP_4_2_5P244_RC ntpq/ntpq-opts.texi@1.234 +1 -1 NTP_4_2_5P244_RC ntpq/ntpq.1@1.234 +2 -2 NTP_4_2_5P244_RC ntpsnmpd/ntpsnmpd-opts.c@1.113 +2 -2 NTP_4_2_5P244_RC ntpsnmpd/ntpsnmpd-opts.h@1.113 +3 -3 NTP_4_2_5P244_RC ntpsnmpd/ntpsnmpd-opts.texi@1.113 +1 -1 NTP_4_2_5P244_RC ntpsnmpd/ntpsnmpd.1@1.113 +2 -2 NTP_4_2_5P244_RC packageinfo.sh@1.248 +1 -1 NTP_4_2_5P244_RC sntp/sntp-opts.c@1.107 +2 -2 NTP_4_2_5P244_RC sntp/sntp-opts.h@1.107 +3 -3 NTP_4_2_5P244_RC sntp/sntp-opts.texi@1.107 +1 -1 NTP_4_2_5P244_RC sntp/sntp.1@1.107 +2 -2 NTP_4_2_5P244_RC util/ntp-keygen-opts.c@1.237 +2 -2 NTP_4_2_5P244_RC util/ntp-keygen-opts.h@1.237 +3 -3 NTP_4_2_5P244_RC util/ntp-keygen-opts.texi@1.236 +1 -1 NTP_4_2_5P244_RC util/ntp-keygen.1@1.236 +2 -2 NTP_4_2_5P244_RC ChangeSet@1.2060.1.35, 2009-11-12 04:26:17-05:00, stenn@whimsy.udel.edu keygen.html updates from Dave Mills ChangeLog@1.537 +1 -0 keygen.html updates from Dave Mills html/keygen.html@1.18 +46 -26 keygen.html updates from Dave Mills ChangeSet@1.2060.1.34, 2009-11-12 02:29:11+00:00, davehart@shiny.ad.hartbrothers.com ntp-keygen.c: 21 bytes don't fit well in a 17 byte buffer util/ntp-keygen.c@1.63 +1 -1 21 bytes don't fit well in a 17 byte buffer ChangeSet@1.2060.1.33, 2009-11-12 00:51:35+00:00, davehart@shiny.ad.hartbrothers.com Cleanup, fix ntp_intres when requestkey type means digests larger than 16 octets. Add /lib to OpenSSL library search path, OpenSolaris has it there. configure.ac@1.459.1.9 +1 -2 Add /lib to OpenSSL library search path, OpenSolaris has it there. include/ntp_request.h@1.40 +5 -2 accomodate larger digests in mode 7 struct req_pkt. introduce REQ_TAIL_MIN to represent struct req_pkt_tail size with a 16-octet digest. include/ntpd.h@1.136 +2 -0 expose req_keytype, req_hashlen for ntp_config.c use libntp/authreadkeys.c@1.15 +6 -4 bounds check keystr[] access, eliminate truncation warning libntp/hextoint.c@1.3 +14 -12 fix indents, more error checks libntp/ssl_init.c@1.4 +17 -5 #include for toupper() ntpd/ntp_config.c@1.236 +21 -6 change #if 0 to #ifdef FORCE_DEFER_DNS ntpd/ntp_intres.c@1.70 +67 -27 support new authentication layout with larger digests remove dead debugging code, style ntpd/ntp_request.c@1.80.1.6 +3 -3 account for growth of struct req_pkt_tail beyond 16-octet digest by using REQ_TAIL_MIN instead of sizeof(req_pkt_tail). fix format string warnings. ntpdc/layout.std@1.9 +2 -2 req_pkt and req_pkt_tail both grew by 4 octets, but interop is preserved ntpdc/ntpdc.c@1.74 +4 -4 quiet shadows global warning ChangeSet@1.2060.19.1, 2009-11-11 12:36:24+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1003] ntpdc unconfig command doesn't prompt for keyid. [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available digest types. ntp-keygen, Autokey OpenSSL build vs. run version mismatch is now a non-fatal warning. ChangeLog@1.532.1.1 +5 -0 [Bug 1003] ntpdc unconfig command doesn't prompt for keyid. [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available digest types. ntp-keygen, Autokey OpenSSL build vs. run version mismatch is now a non-fatal warning. include/ntp_request.h@1.39 +10 -11 [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available digest types. include/ntp_stdlib.h@1.40 +7 -2 [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available digest types. libntp/a_md5encrypt.c@1.26 +2 -2 [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available digest types. libntp/authreadkeys.c@1.12.1.1 +5 -10 [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available digest types. libntp/ssl_init.c@1.3 +88 -5 ntp-keygen, Autokey OpenSSL build vs. run version mismatch is now a non-fatal warning. [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available digest types. ntpd/keyword-gen.c@1.5 +5 -5 use do a; while (b); rather than equivalent a; while(b) a; ntpd/ntp_intres.c@1.67.1.1 +1 -1 use sizeof buffer not (formerly) equivalent macro ntpd/ntp_request.c@1.80.1.5 +80 -88 [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available digest types. ntpdc/ntpdc.c@1.73 +143 -94 [Bug 1003] ntpdc unconfig command doesn't prompt for keyid. [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available digest types. ntpdc/ntpdc_ops.c@1.62 +2 -2 whitespace only ntpq/ntpq-subs.c@1.40 +1 -1 typo pointed out by Michael Tatarinov ntpq/ntpq.c@1.96 +93 -69 [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available digest types. ChangeSet@1.2060.1.31, 2009-11-11 05:46:08-05:00, stenn@whimsy.udel.edu NTP_4_2_5P243_RC TAG: NTP_4_2_5P243_RC ChangeLog@1.535 +1 -0 NTP_4_2_5P243_RC ntpd/ntpd-opts.c@1.237 +2 -2 NTP_4_2_5P243_RC ntpd/ntpd-opts.h@1.237 +3 -3 NTP_4_2_5P243_RC ntpd/ntpd-opts.texi@1.235 +2 -2 NTP_4_2_5P243_RC ntpd/ntpd.1@1.235 +2 -2 NTP_4_2_5P243_RC ntpdc/ntpdc-opts.c@1.233 +2 -2 NTP_4_2_5P243_RC ntpdc/ntpdc-opts.h@1.233 +3 -3 NTP_4_2_5P243_RC ntpdc/ntpdc-opts.texi@1.232 +2 -2 NTP_4_2_5P243_RC ntpdc/ntpdc.1@1.232 +2 -2 NTP_4_2_5P243_RC ntpq/ntpq-opts.c@1.234 +2 -2 NTP_4_2_5P243_RC ntpq/ntpq-opts.h@1.234 +3 -3 NTP_4_2_5P243_RC ntpq/ntpq-opts.texi@1.233 +2 -2 NTP_4_2_5P243_RC ntpq/ntpq.1@1.233 +2 -2 NTP_4_2_5P243_RC ntpsnmpd/ntpsnmpd-opts.c@1.112 +2 -2 NTP_4_2_5P243_RC ntpsnmpd/ntpsnmpd-opts.h@1.112 +3 -3 NTP_4_2_5P243_RC ntpsnmpd/ntpsnmpd-opts.texi@1.112 +1 -1 NTP_4_2_5P243_RC ntpsnmpd/ntpsnmpd.1@1.112 +2 -2 NTP_4_2_5P243_RC packageinfo.sh@1.247 +1 -1 NTP_4_2_5P243_RC sntp/sntp-opts.c@1.106 +2 -2 NTP_4_2_5P243_RC sntp/sntp-opts.h@1.106 +3 -3 NTP_4_2_5P243_RC sntp/sntp-opts.texi@1.106 +2 -2 NTP_4_2_5P243_RC sntp/sntp.1@1.106 +2 -2 NTP_4_2_5P243_RC util/ntp-keygen-opts.c@1.236 +2 -2 NTP_4_2_5P243_RC util/ntp-keygen-opts.h@1.236 +3 -3 NTP_4_2_5P243_RC util/ntp-keygen-opts.texi@1.235 +2 -2 NTP_4_2_5P243_RC util/ntp-keygen.1@1.235 +2 -2 NTP_4_2_5P243_RC ChangeSet@1.2060.1.30, 2009-11-11 04:04:33-05:00, stenn@pogo.udel.edu [Bug 1226] Fix deferred DNS lookups ChangeLog@1.534 +1 -0 [Bug 1226] Fix deferred DNS lookups ChangeSet@1.2060.18.2, 2009-11-11 03:08:32-05:00, stenn@whimsy.udel.edu new crypto signature cleanup ChangeLog@1.533 +1 -0 new crypto signature cleanup html/authopt.html@1.58 +14 -5 new crypto signature cleanup html/keygen.html@1.17 +12 -3 new crypto signature cleanup libntp/authkeys.c@1.20 +11 -2 new crypto signature cleanup libntp/authreadkeys.c@1.13 +38 -12 new crypto signature cleanup util/ntp-keygen.c@1.62 +24 -4 new crypto signature cleanup ChangeSet@1.2060.18.1, 2009-11-10 05:02:56-05:00, stenn@whimsy.udel.edu NTP_4_2_5P242_RC TAG: NTP_4_2_5P242_RC ChangeLog@1.532 +1 -0 NTP_4_2_5P242_RC ntpd/ntpd-opts.c@1.236 +2 -2 NTP_4_2_5P242_RC ntpd/ntpd-opts.h@1.236 +3 -3 NTP_4_2_5P242_RC ntpd/ntpd-opts.texi@1.234 +2 -2 NTP_4_2_5P242_RC ntpd/ntpd.1@1.234 +2 -2 NTP_4_2_5P242_RC ntpdc/ntpdc-opts.c@1.232 +2 -2 NTP_4_2_5P242_RC ntpdc/ntpdc-opts.h@1.232 +3 -3 NTP_4_2_5P242_RC ntpdc/ntpdc-opts.texi@1.231 +2 -2 NTP_4_2_5P242_RC ntpdc/ntpdc.1@1.231 +2 -2 NTP_4_2_5P242_RC ntpq/ntpq-opts.c@1.233 +2 -2 NTP_4_2_5P242_RC ntpq/ntpq-opts.h@1.233 +3 -3 NTP_4_2_5P242_RC ntpq/ntpq-opts.texi@1.232 +2 -2 NTP_4_2_5P242_RC ntpq/ntpq.1@1.232 +2 -2 NTP_4_2_5P242_RC ntpsnmpd/ntpsnmpd-opts.c@1.111 +2 -2 NTP_4_2_5P242_RC ntpsnmpd/ntpsnmpd-opts.h@1.111 +3 -3 NTP_4_2_5P242_RC ntpsnmpd/ntpsnmpd-opts.texi@1.111 +1 -1 NTP_4_2_5P242_RC ntpsnmpd/ntpsnmpd.1@1.111 +2 -2 NTP_4_2_5P242_RC packageinfo.sh@1.246 +1 -1 NTP_4_2_5P242_RC sntp/sntp-opts.c@1.105 +2 -2 NTP_4_2_5P242_RC sntp/sntp-opts.h@1.105 +3 -3 NTP_4_2_5P242_RC sntp/sntp-opts.texi@1.105 +2 -2 NTP_4_2_5P242_RC sntp/sntp.1@1.105 +2 -2 NTP_4_2_5P242_RC util/ntp-keygen-opts.c@1.235 +2 -2 NTP_4_2_5P242_RC util/ntp-keygen-opts.h@1.235 +3 -3 NTP_4_2_5P242_RC util/ntp-keygen-opts.texi@1.234 +2 -2 NTP_4_2_5P242_RC util/ntp-keygen.1@1.234 +2 -2 NTP_4_2_5P242_RC ChangeSet@1.2060.1.28, 2009-11-09 18:15:07-05:00, murray@malarky.udel.edu configure.ac, ntp_intres.c: Fix for bug-1266: reload /etc/resolv.conf on deferred DNS ntp_config.c: Hacks to help debug deferred DNS (default off) configure.ac@1.459.1.8 +4 -0 Fix for bug-1266: reload /etc/resolv.conf on deferred DNS ntpd/ntp_config.c@1.235 +16 -0 Hacks to help debug deferred DNS (default off) ntpd/ntp_intres.c@1.68 +15 -7 Fix for bug-1266: reload /etc/resolv.conf on deferred DNS ChangeSet@1.2060.17.2, 2009-11-09 04:14:13-05:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.525.3.2 +1 -0 Documentation updates from Dave Mills html/authopt.html@1.57 +5 -3 Documentation updates from Dave Mills html/index.html@1.41 +25 -4 Documentation updates from Dave Mills ChangeSet@1.2060.17.1, 2009-11-09 04:08:41-05:00, stenn@whimsy.udel.edu authkeys.c cleanup from Dave Mills ChangeLog@1.525.3.1 +1 -0 authkeys.c cleanup from Dave Mills libntp/authkeys.c@1.17.1.1 +3 -4 authkeys.c cleanup from Dave Mills ChangeSet@1.2060.1.26, 2009-11-09 08:03:02+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1371] deferred DNS lookup failing with INFO_ERR_AUTH. fixed in prior changeset with ntp_request.h modification to REQ_LEN_NOMAC. ChangeLog@1.530 +1 -0 [Bug 1371] deferred DNS lookup failing with INFO_ERR_AUTH. ChangeSet@1.2060.4.2, 2009-11-09 07:19:52+00:00, davehart@shiny.ad.hartbrothers.com Shrink keyword scanner FSM entries from 64 to 32 bits apiece. applies to prior changeset and this ChangeLog update ChangeLog@1.498.2.1 +1 -0 Shrink keyword scanner FSM entries from 64 to 32 bits apiece. ChangeSet@1.2060.1.23, 2009-11-09 07:17:29+00:00, davehart@shiny.ad.hartbrothers.com Stub out isc/mem.h, shaving 47k from a MIPS ntpd binary. (applies to prior changeset along with this one) ChangeLog@1.511.3.1 +1 -0 Stub out isc/mem.h, shaving 47k from a MIPS ntpd binary. include/isc/mem.h@1.2 +1 -0 also stub out isc_mem_printallactive() to silence warning and avoid trouble down the road, it's referenced by tasks.c ChangeSet@1.2060.16.1, 2009-11-08 12:32:55+00:00, kardel@pogo.udel.edu clk_trimtsip.c: [Bug 1363] CID 92 clarify fallthrough case ChangeLog: [Bug 1363] CID 92 clarify fallthrough case in clk_trimtsip.c ChangeLog@1.525.2.1 +1 -0 [Bug 1363] CID 92 clarify fallthrough case in clk_trimtsip.c libparse/clk_trimtsip.c@1.10 +10 -3 [Bug 1363] CID 92 clarify fallthrough case ChangeSet@1.2060.8.22, 2009-11-07 23:44:10+00:00, davehart@shiny.ad.hartbrothers.com Use Frank Kardel's suggestion to collapse 3 cases to 1 for NetBSD USE_FSETOWNCTTY test. configure.ac@1.459.2.4 +4 -9 Use Frank Kardel's suggestion to collapse 3 cases to 1 for NetBSD USE_FSETOWNCTTY test. ChangeSet@1.2060.15.2, 2009-11-07 22:46:41+00:00, davehart@shiny.ad.hartbrothers.com Fix authenticated ntpdc, broken in p240. ChangeLog@1.525.1.2 +1 -0 Fix authenticated ntpdc, broken in p240. include/ntp.h@1.168 +4 -4 parenthesize macro expansions such as: 12 * sizeof(u_int32) include/ntp_request.h@1.38 +4 -4 comments only include/ntp_stdlib.h@1.39 +3 -2 separate OpenSSL version check from INIT_SSL() libntp/a_md5encrypt.c@1.23.1.2 +2 -2 [Bug 1368] libntp does not compile --without-crypto merge cleanup libntp/authkeys.c@1.18 +3 -4 move break; in authhavekey() back where it belongs after recent flub libntp/authreadkeys.c@1.10.1.2 +1 -1 [Bug 1368] libntp doesn't compile --without-crypto libntp/ssl_init.c@1.2 +11 -3 separate OpenSSL version check from INIT_SSL() ntpd/ntp_control.c@1.129 +1 -1 correct harmless htons()/ntohs() mixup ntpd/ntp_crypto.c@1.146 +3 -2 separate OpenSSL version check from INIT_SSL() ntpd/ntp_intres.c@1.67 +2 -2 use sizeof rather than REQ_MAC_LEN for recv buffer size to prepare for enabling authenticated mode 7 with non-MD5 keys ntpd/ntp_request.c@1.80.1.4 +8 -7 eliminate extra parentheses, return after req_ack() ntpdc/ntpdc.c@1.72 +11 -11 Fix authenticated ntpdc, broken in p240. util/ntp-keygen.c@1.61 +1 -1 separate OpenSSL version check from INIT_SSL() ChangeSet@1.2060.8.20, 2009-11-07 12:16:01-05:00, murray@pogo.udel.edu a_md5encrypt.c, authreadkeys.c, ChangeLog: Fix for bug 1368 - typos in --without-crypto case ChangeLog@1.526 +1 -0 Fix for bug 1368 libntp/a_md5encrypt.c@1.24 +1 -0 Fix for bug 1368 libntp/authreadkeys.c@1.11 +1 -1 Fix for bug 1368 ChangeSet@1.2060.8.19, 2009-11-07 05:42:36-05:00, stenn@whimsy.udel.edu NTP_4_2_5P241_RC TAG: NTP_4_2_5P241_RC ChangeLog@1.525 +1 -0 NTP_4_2_5P241_RC ntpd/ntpd-opts.c@1.235 +2 -2 NTP_4_2_5P241_RC ntpd/ntpd-opts.h@1.235 +3 -3 NTP_4_2_5P241_RC ntpd/ntpd-opts.texi@1.233 +2 -2 NTP_4_2_5P241_RC ntpd/ntpd.1@1.233 +2 -2 NTP_4_2_5P241_RC ntpdc/ntpdc-opts.c@1.231 +2 -2 NTP_4_2_5P241_RC ntpdc/ntpdc-opts.h@1.231 +3 -3 NTP_4_2_5P241_RC ntpdc/ntpdc-opts.texi@1.230 +2 -2 NTP_4_2_5P241_RC ntpdc/ntpdc.1@1.230 +2 -2 NTP_4_2_5P241_RC ntpq/ntpq-opts.c@1.232 +2 -2 NTP_4_2_5P241_RC ntpq/ntpq-opts.h@1.232 +3 -3 NTP_4_2_5P241_RC ntpq/ntpq-opts.texi@1.231 +2 -2 NTP_4_2_5P241_RC ntpq/ntpq.1@1.231 +2 -2 NTP_4_2_5P241_RC ntpsnmpd/ntpsnmpd-opts.c@1.110 +2 -2 NTP_4_2_5P241_RC ntpsnmpd/ntpsnmpd-opts.h@1.110 +3 -3 NTP_4_2_5P241_RC ntpsnmpd/ntpsnmpd-opts.texi@1.110 +1 -1 NTP_4_2_5P241_RC ntpsnmpd/ntpsnmpd.1@1.110 +2 -2 NTP_4_2_5P241_RC packageinfo.sh@1.245 +1 -1 NTP_4_2_5P241_RC sntp/sntp-opts.c@1.104 +2 -2 NTP_4_2_5P241_RC sntp/sntp-opts.h@1.104 +3 -3 NTP_4_2_5P241_RC sntp/sntp-opts.texi@1.104 +2 -2 NTP_4_2_5P241_RC sntp/sntp.1@1.104 +2 -2 NTP_4_2_5P241_RC util/ntp-keygen-opts.c@1.234 +2 -2 NTP_4_2_5P241_RC util/ntp-keygen-opts.h@1.234 +3 -3 NTP_4_2_5P241_RC util/ntp-keygen-opts.texi@1.233 +2 -2 NTP_4_2_5P241_RC util/ntp-keygen.1@1.233 +2 -2 NTP_4_2_5P241_RC ChangeSet@1.2060.14.1, 2009-11-07 07:57:11+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1366] ioctl(TIOCSCTTY, 0) fails on NetBSD *[0-2].* > 3.99.7. initialize OpenSSL before first use in libntp ntpq, ntpdc, ntpdate use OpenSSL and need applink on Windows add crypto digest and setvar default tests to ntpd/complete.conf ChangeLog@1.521.1.1 +2 -0 [Bug 1366] ioctl(TIOCSCTTY, 0) fails on NetBSD *[0-2].* > 3.99.7. CID 87 dead code in ntpq.c atoascii(). configure.ac@1.459.2.3 +44 -26 [Bug 1366] ioctl(TIOCSCTTY, 0) fails on NetBSD *[0-2].* > 3.99.7. include/Makefile.am@1.35.2.2 +1 -0 new file include/ssl_applink.c include/ntp.h@1.167 +2 -1 make KEY_TYPE_MD5 equivalence to NID_md5 explicit include/ntp_request.h@1.37 +1 -1 req_pkt uses MAX_MD5_LEN not MAX_MAC_LEN now include/ntp_stdlib.h@1.38 +13 -0 add ssl_init.c references include/ssl_applink.c@1.1 +74 -0 common code for Windows OpenSSL applink (ntpd, ntpdate, ntpdc, ntpq, ntp-keygen) include/ssl_applink.c@1.0 +0 -0 libntp/Makefile.am@1.47.1.1 +65 -13 add ssl_init.c libntp/a_md5encrypt.c@1.22.1.1 +15 -6 ensure OpenSSL has been initialized before use use u_int instead of unsigned consistently libntp/authreadkeys.c@1.9.1.1 +3 -7 warning libntp/ssl_init.c@1.1 +42 -0 Shared OpenSSL initialization code for libntp, ntpd, ntp-keygen libntp/ssl_init.c@1.0 +0 -0 ntpd/complete.conf@1.3 +3 -2 add crypto digest test, setvar default test ntpd/ntp_config.c@1.234 +1 -1 KEY_TYPE_MD5 -> NID_md5 ntpd/ntp_crypto.c@1.145 +13 -23 use common libntp OpenSSL initialization code ntpd/ntp_request.c@1.80.1.3 +3 -5 don't compare floats for equality, use DPRINTF ntpdate/ntpdate.c@1.69 +10 -16 ntpq, ntpdc, ntpdate use OpenSSL and need applink on Windows ntpdc/ntpdc.c@1.71 +6 -11 ntpq, ntpdc, ntpdate use OpenSSL and need applink on Windows ntpq/Makefile.am@1.38 +3 -0 add rule to build libntp.a ntpq/ntpq.c@1.95 +77 -78 ntpq, ntpdc, ntpdate use OpenSSL and need applink on Windows ports/winnt/ntpd/ntservice.c@1.22 +3 -39 ntpq, ntpdc, ntpdate use OpenSSL and need applink on Windows ports/winnt/vc6/libntp.dsp@1.46.1.1 +4 -0 add ssl_init.c ports/winnt/vs2003/libntp.vcproj@1.5.1.1 +4 -0 add ssl_init.c ports/winnt/vs2005/libntp.vcproj@1.5.1.1 +4 -0 add ssl_init.c ports/winnt/vs2008/libntp/libntp.vcproj@1.22.1.1 +6 -2 add ssl_init.c sntp/Makefile.am@1.13.2.1 +9 -1 remove reference to bk rm'd netutils.h add rule to build libntp.a add rule to build COPYRIGHT with zero-byte version bk rm'd util/ntp-keygen.c@1.60 +7 -23 Use common OpenSSL initialization from libntp ntpq, ntpdc, ntpdate use OpenSSL and need applink on Windows ChangeSet@1.2060.8.18, 2009-11-07 01:15:29-05:00, stenn@whimsy.udel.edu authopt.html update from Dave Mills ChangeLog@1.524 +1 -0 authopt.html update from Dave Mills html/authopt.html@1.56 +59 -29 authopt.html update from Dave Mills ChangeSet@1.2060.8.17, 2009-11-07 01:09:12-05:00, stenn@whimsy.udel.edu Remove unused file from the sntp/Makefile.am ChangeLog@1.523 +1 -0 Remove unused file from the sntp/Makefile.am ChangeLog@1.522 +1 -0 new crypto signature cleanup libntp/a_md5encrypt.c@1.23 +23 -23 new crypto signature cleanup libntp/authkeys.c@1.17 +54 -13 new crypto signature cleanup libntp/authreadkeys.c@1.10 +31 -22 new crypto signature cleanup sntp/Makefile.am@1.13.1.2 +0 -1 Remove unused file from the sntp/Makefile.am ChangeSet@1.2060.8.16, 2009-11-05 04:05:18-05:00, stenn@whimsy.udel.edu NTP_4_2_5P240_RC TAG: NTP_4_2_5P240_RC ChangeLog@1.521 +1 -0 NTP_4_2_5P240_RC ntpd/ntpd-opts.c@1.234 +2 -2 NTP_4_2_5P240_RC ntpd/ntpd-opts.h@1.234 +3 -3 NTP_4_2_5P240_RC ntpd/ntpd-opts.texi@1.232 +4 -4 NTP_4_2_5P240_RC ntpd/ntpd.1@1.232 +2 -2 NTP_4_2_5P240_RC ntpdc/ntpdc-opts.c@1.230 +2 -2 NTP_4_2_5P240_RC ntpdc/ntpdc-opts.h@1.230 +3 -3 NTP_4_2_5P240_RC ntpdc/ntpdc-opts.texi@1.229 +2 -2 NTP_4_2_5P240_RC ntpdc/ntpdc.1@1.229 +2 -2 NTP_4_2_5P240_RC ntpq/ntpq-opts.c@1.231 +2 -2 NTP_4_2_5P240_RC ntpq/ntpq-opts.h@1.231 +3 -3 NTP_4_2_5P240_RC ntpq/ntpq-opts.texi@1.230 +2 -2 NTP_4_2_5P240_RC ntpq/ntpq.1@1.230 +2 -2 NTP_4_2_5P240_RC ntpsnmpd/ntpsnmpd-opts.c@1.109 +2 -2 NTP_4_2_5P240_RC ntpsnmpd/ntpsnmpd-opts.h@1.109 +3 -3 NTP_4_2_5P240_RC ntpsnmpd/ntpsnmpd-opts.texi@1.109 +1 -1 NTP_4_2_5P240_RC ntpsnmpd/ntpsnmpd.1@1.109 +2 -2 NTP_4_2_5P240_RC packageinfo.sh@1.244 +1 -1 NTP_4_2_5P240_RC sntp/sntp-opts.c@1.103 +2 -2 NTP_4_2_5P240_RC sntp/sntp-opts.h@1.103 +3 -3 NTP_4_2_5P240_RC sntp/sntp-opts.texi@1.103 +2 -2 NTP_4_2_5P240_RC sntp/sntp.1@1.103 +2 -2 NTP_4_2_5P240_RC util/ntp-keygen-opts.c@1.233 +2 -2 NTP_4_2_5P240_RC util/ntp-keygen-opts.h@1.233 +3 -3 NTP_4_2_5P240_RC util/ntp-keygen-opts.texi@1.232 +2 -2 NTP_4_2_5P240_RC util/ntp-keygen.1@1.232 +2 -2 NTP_4_2_5P240_RC ChangeSet@1.2060.13.2, 2009-11-05 02:04:25-05:00, stenn@whimsy.udel.edu Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2) ChangeLog@1.517.1.2 +1 -1 Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2) html/authopt.html@1.55 +20 -17 Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2) html/keygen.html@1.16 +33 -9 Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2) libntp/a_md5encrypt.c@1.20.1.1 +2 -2 Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2) libntp/authkeys.c@1.16 +1 -2 Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2) ChangeSet@1.2060.8.14, 2009-11-05 01:33:53+00:00, davehart@shiny.ad.hartbrothers.com remove leftover RSAREF tidbit global.h no longer used BitKeeper/deleted/.del-global.h~3aed0663@1.5 +0 -0 Delete: include/global.h include/Makefile.am@1.35.2.1 +0 -1 remove leftover RSAREF tidbit global.h no longer used ChangeSet@1.2060.8.13, 2009-11-05 00:24:26+00:00, davehart@shiny.ad.hartbrothers.com remove testing leftover #undef OPENSSL warning cleanup linking with libntp now requires -lcrypto / libeay32.lib include/ntp_stdlib.h@1.37 +8 -0 #define NID_md5 when not building with OpenSSL libntp/a_md5encrypt.c@1.21 +22 -28 remove testing leftover #undef OPENSSL warning cleanup assert rather than crash if openssl isn't working libntp/authreadkeys.c@1.9 +6 -6 remove testing leftover #undef OPENSSL warning cleanup ntpdate/Makefile.am@1.20 +1 -0 add -lcrypto to ntpdate_LDADD now that libntp references openssl ntpdc/Makefile.am@1.44 +2 -1 linking with libntp now requires -lcrypto ntpq/Makefile.am@1.37 +2 -1 linking with libntp now requires -lcrypto ports/winnt/vc6/ntpdate.dsp@1.25 +2 -2 add reference to libeay32.lib needed by symmetric key crypto now ports/winnt/vc6/ntpdc.dsp@1.28 +2 -2 add reference to libeay32.lib needed by symmetric key crypto now ports/winnt/vc6/ntpq.dsp@1.29 +2 -2 add reference to libeay32.lib needed by symmetric key crypto now ports/winnt/vs2003/ntpdate.vcproj@1.4 +2 -2 add reference to libeay32.lib needed by symmetric key crypto now ports/winnt/vs2003/ntpdc.vcproj@1.4 +2 -2 add reference to libeay32.lib needed by symmetric key crypto now ports/winnt/vs2003/ntpq.vcproj@1.4 +2 -2 add reference to libeay32.lib needed by symmetric key crypto now ports/winnt/vs2005/ntpdate.vcproj@1.4 +2 -2 add reference to libeay32.lib needed by symmetric key crypto now ports/winnt/vs2005/ntpdc.vcproj@1.4 +2 -2 add reference to libeay32.lib needed by symmetric key crypto now ports/winnt/vs2005/ntpq.vcproj@1.4 +2 -2 add reference to libeay32.lib needed by symmetric key crypto now ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.11 +2 -2 add reference to libeay32.lib needed by symmetric key crypto now ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.11 +2 -2 add reference to libeay32.lib needed by symmetric key crypto now ports/winnt/vs2008/ntpq/ntpq.vcproj@1.10 +2 -2 add reference to libeay32.lib needed by symmetric key crypto now ChangeSet@1.2060.13.1, 2009-11-04 14:53:24-05:00, stenn@whimsy.udel.edu Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) ChangeLog@1.517.1.1 +1 -0 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) html/authopt.html@1.54 +32 -3 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) html/ntpq.html@1.36 +12 -4 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) include/ntp.h@1.166 +4 -4 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) include/ntp_control.h@1.38 +5 -4 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) include/ntp_crypto.h@1.46 +2 -0 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) include/ntp_request.h@1.36 +2 -2 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) include/ntp_stdlib.h@1.36 +3 -3 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) libntp/a_md5encrypt.c@1.20 +63 -21 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) libntp/authkeys.c@1.15 +13 -17 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) libntp/authreadkeys.c@1.8 +50 -38 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) libntp/authusekey.c@1.7 +1 -13 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) ntpd/keyword-gen.c@1.1.1.2 +1 -0 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) ntpd/ntp_config.c@1.233 +8 -18 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) ntpd/ntp_control.c@1.128 +17 -7 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) ntpd/ntp_crypto.c@1.144 +17 -3 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) ntpd/ntp_keyword.h@1.1.1.1 +737 -732 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) ntpd/ntp_parser.c@1.52 +1031 -1013 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) ntpd/ntp_parser.h@1.32 +277 -275 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) ntpd/ntp_parser.y@1.47 +3 -0 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) ntpd/ntp_proto.c@1.297 +13 -18 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) sntp/crypto.h@1.5.1.1 +1 -0 Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx) ChangeSet@1.2060.8.11, 2009-11-02 19:31:57+00:00, davehart@shiny.ad.hartbrothers.com correct linuxcaps AC_MSG_RESULT() to occur after considering --enable-linuxcaps configure.ac@1.459.2.2 +1 -4 correct linuxcaps AC_MSG_RESULT() to occur after considering --enable-linuxcaps ChangeSet@1.2060.12.1, 2009-11-02 06:08:22+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1364] clock_gettime() not detected, need -lrt on Debian 5.0.3. ChangeLog@1.518 +1 -0 [Bug 1364] clock_gettime() not detected, need -lrt on Debian 5.0.3. configure.ac@1.459.2.1 +4 -2 [Bug 1364] clock_gettime() not detected, need -lrt on Debian 5.0.3. bump cache version so previous results not finding clock_gettime() will be tossed. ChangeSet@1.2060.8.9, 2009-10-31 06:38:39+09:00, Amidamaru@yumi.mxiesoft.com .del-netutils.c~1f7e234e73bebdf5: Delete: sntp/netutils.c .del-COPYRIGHT~cdd0795ee52aa7b5: Delete: sntp/COPYRIGHT .del-netutils.h~b347f6069a2cfce1: Delete: sntp/netutils.h Many files: Removed copyright statement BitKeeper/deleted/.del-COPYRIGHT~cdd0795ee52aa7b5@1.3 +0 -0 Delete: sntp/COPYRIGHT BitKeeper/deleted/.del-netutils.c~1f7e234e73bebdf5@1.4 +0 -0 Delete: sntp/netutils.c BitKeeper/deleted/.del-netutils.h~b347f6069a2cfce1@1.3 +0 -0 Delete: sntp/netutils.h sntp/crypto.c@1.10 +0 -17 Removed copyright statement sntp/crypto.h@1.6 +0 -17 Removed copyright statement sntp/kod_management.c@1.14 +0 -18 Removed copyright statement sntp/kod_management.h@1.8 +0 -17 Removed copyright statement sntp/log.c@1.10 +0 -17 Removed copyright statement sntp/log.h@1.7 +0 -17 Removed copyright statement sntp/networking.c@1.27 +0 -17 Removed copyright statement sntp/networking.h@1.16 +0 -17 Removed copyright statement sntp/utilities.c@1.10 +0 -17 Removed copyright statement sntp/utilities.h@1.8 +0 -34 Removed copyright statement ChangeSet@1.2060.8.8, 2009-10-30 01:30:30-05:00, stenn@whimsy.udel.edu NTP_4_2_5P239_RC TAG: NTP_4_2_5P239_RC ChangeLog@1.517 +1 -0 NTP_4_2_5P239_RC ntpd/ntpd-opts.c@1.233 +2 -2 NTP_4_2_5P239_RC ntpd/ntpd-opts.h@1.233 +3 -3 NTP_4_2_5P239_RC ntpd/ntpd-opts.texi@1.231 +1 -1 NTP_4_2_5P239_RC ntpd/ntpd.1@1.231 +2 -2 NTP_4_2_5P239_RC ntpdc/ntpdc-opts.c@1.229 +2 -2 NTP_4_2_5P239_RC ntpdc/ntpdc-opts.h@1.229 +3 -3 NTP_4_2_5P239_RC ntpdc/ntpdc-opts.texi@1.228 +1 -1 NTP_4_2_5P239_RC ntpdc/ntpdc.1@1.228 +2 -2 NTP_4_2_5P239_RC ntpq/ntpq-opts.c@1.230 +2 -2 NTP_4_2_5P239_RC ntpq/ntpq-opts.h@1.230 +3 -3 NTP_4_2_5P239_RC ntpq/ntpq-opts.texi@1.229 +1 -1 NTP_4_2_5P239_RC ntpq/ntpq.1@1.229 +2 -2 NTP_4_2_5P239_RC ntpsnmpd/ntpsnmpd-opts.c@1.108 +2 -2 NTP_4_2_5P239_RC ntpsnmpd/ntpsnmpd-opts.h@1.108 +3 -3 NTP_4_2_5P239_RC ntpsnmpd/ntpsnmpd-opts.texi@1.108 +1 -1 NTP_4_2_5P239_RC ntpsnmpd/ntpsnmpd.1@1.108 +2 -2 NTP_4_2_5P239_RC packageinfo.sh@1.243 +1 -1 NTP_4_2_5P239_RC sntp/sntp-opts.c@1.102 +2 -2 NTP_4_2_5P239_RC sntp/sntp-opts.h@1.102 +3 -3 NTP_4_2_5P239_RC sntp/sntp-opts.texi@1.102 +1 -1 NTP_4_2_5P239_RC sntp/sntp.1@1.102 +2 -2 NTP_4_2_5P239_RC util/ntp-keygen-opts.c@1.232 +2 -2 NTP_4_2_5P239_RC util/ntp-keygen-opts.h@1.232 +3 -3 NTP_4_2_5P239_RC util/ntp-keygen-opts.texi@1.231 +1 -1 NTP_4_2_5P239_RC util/ntp-keygen.1@1.231 +2 -2 NTP_4_2_5P239_RC ChangeSet@1.2060.11.1, 2009-10-29 02:55:07-05:00, stenn@whimsy.udel.edu CID 101 and Bug 1359 ChangeLog@1.514.1.2 +1 -0 CID 101: more pointer/array cleanup ChangeLog@1.514.1.1 +1 -0 CID 101: more pointer/array cleanup ntpd/ntp_crypto.c@1.143 +2 -1 CID 101: more pointer/array cleanup ntpd/ntp_loopfilter.c@1.152 +2 -1 CID 101: more pointer/array cleanup ChangeSet@1.2060.8.6, 2009-10-28 15:49:51-04:00, murray@pogo.udel.edu ChangeLog: Bug-1357: bogus assert in refclock_shm ChangeLog@1.515 +1 -0 Bug-1357: bogus assert in refclock_shm ChangeSet@1.2060.8.5, 2009-10-28 13:32:36-04:00, murray@pogo.udel.edu refclock_shm.c: Fix for bug-1357: bogus assert in refclock_shm ntpd/refclock_shm.c@1.19 +4 -1 Fix for bug-1357: bogus assert in refclock_shm ChangeSet@1.2060.9.2, 2009-10-28 09:19:39+00:00, davehart@shiny.ad.hartbrothers.com networking.c: 2nd half of [Bug 1158] in recv_bcast_data() sntp/networking.c@1.26 +1 -1 2nd half of [Bug 1158] in recv_bcast_data() ChangeSet@1.2060.10.1, 2009-10-28 03:47:47-05:00, stenn@whimsy.udel.edu CID 101: pointer/array cleanup ChangeLog@1.511.2.1 +1 -0 CID 101: pointer/array cleanup ntpd/ntp_crypto.c@1.142 +10 -10 CID 101: pointer/array cleanup ChangeSet@1.2060.9.1, 2009-10-28 07:35:54+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1358] AIX 4.3 sntp/networking.c IPV6_JOIN_GROUP undeclared. ChangeLog@1.511.1.1 +1 -0 [Bug 1358] AIX 4.3 sntp/networking.c IPV6_JOIN_GROUP undeclared. include/ntp_rfc2553.h@1.33 +17 -2 conditionalize definition of AI_ flags on AI_PASSIVE instead of AI_NUMERICHOST, as the latter isn't defined on AIX 4.3 while AI_PASSIVE is. provide a 0 definition for AI_NUMERICHOST for those platforms that don't have that flag. ntpd/ntp_io.c@1.307.1.1 +0 -14 move INCLUDE_IPV6_SUPPORT and INCLUDE_IPV6_MULTICAST_SUPPORT definitions to ntp_rfc2553.h to share with sntp sntp/networking.c@1.25 +8 -3 Compile on systems such as AIX 4.3 with IPv6 but without IPv6 multicast support via setsockopt(), [Bug 1358] AIX 4.3 sntp/networking.c IPV6_JOIN_GROUP undeclared. sntp/networking.h@1.15 +1 -0 pick up INCLUDE_IPV6_MULTICAST_SUPPORT from ntp_rfc2553.h ChangeSet@1.2060.8.1, 2009-10-28 03:42:47+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1356] core dump from refclock_nmea when can't open /dev/gpsU. ChangeLog@1.512 +1 -0 [Bug 1356] core dump from refclock_nmea when can't open /dev/gpsU. ntpd/refclock_nmea.c@1.46 +17 -8 [Bug 1356] core dump from refclock_nmea when can't open /dev/gpsU. ChangeSet@1.2060.1.22, 2009-10-27 21:53:59+00:00, davehart@shiny.ad.hartbrothers.com stub out isc/mem.c using NTP-local /include/isc/mem.h (leaving /lib/isc/include/isc/mem.h untouched). configure.ac@1.459.1.6 +1 -0 add reference to include/isc/Makefile include/Makefile.am@1.35.1.2 +3 -2 add reference to include/isc/Makefile.am include/isc/Makefile.am@1.1 +7 -0 Override isc/mem.h for NTP to stub it out and save ~50KB include/isc/Makefile.am@1.0 +0 -0 include/isc/mem.h@1.1 +54 -0 Override isc/mem.h for NTP to stub it out and save ~50KB include/isc/mem.h@1.0 +0 -0 libntp/Makefile.am@1.48 +0 -1 mem.c is stubbed out libntp/emalloc.c@1.10 +3 -2 implement GNU malloc behavior in emalloc() and erealloc(), libisc mem.h stubs depend on it (could be implemented in mem.h, but other code may grow a dependency being tested only on GNU malloc, so play it safe.) ntpd/ntp_io.c@1.308 +1 -37 remove ntp_memalloc(), ntp_memfree(), pass dummy non-null mctx to to libisc interface iterator. ports/winnt/vc6/libntp.dsp@1.47 +0 -4 lib/isc/mem.c is no longer compiled ports/winnt/vs2003/libntp.vcproj@1.6 +1 -4 remove change mem.h reference to NTP override copy in include/isc lib/isc/mem.c is no longer compiled. ports/winnt/vs2005/libntp.vcproj@1.6 +1 -5 remove change mem.h reference to NTP override copy in include/isc lib/isc/mem.c is no longer compiled. ports/winnt/vs2008/libntp/libntp.vcproj@1.23 +1 -5 remove change mem.h reference to NTP override copy in include/isc lib/isc/mem.c is no longer compiled. util/ntptime.c@1.21 +1 -0 add "int debug;" global for libntp consumption ChangeSet@1.2060.1.21, 2009-10-27 05:47:37-05:00, stenn@whimsy.udel.edu NTP_4_2_5P238_RC TAG: NTP_4_2_5P238_RC ChangeLog@1.511 +1 -0 NTP_4_2_5P238_RC ntpd/ntpd-opts.c@1.232 +2 -2 NTP_4_2_5P238_RC ntpd/ntpd-opts.h@1.232 +3 -3 NTP_4_2_5P238_RC ntpd/ntpd-opts.texi@1.230 +1 -1 NTP_4_2_5P238_RC ntpd/ntpd.1@1.230 +2 -2 NTP_4_2_5P238_RC ntpdc/ntpdc-opts.c@1.228 +2 -2 NTP_4_2_5P238_RC ntpdc/ntpdc-opts.h@1.228 +3 -3 NTP_4_2_5P238_RC ntpdc/ntpdc-opts.texi@1.227 +1 -1 NTP_4_2_5P238_RC ntpdc/ntpdc.1@1.227 +2 -2 NTP_4_2_5P238_RC ntpq/ntpq-opts.c@1.229 +2 -2 NTP_4_2_5P238_RC ntpq/ntpq-opts.h@1.229 +3 -3 NTP_4_2_5P238_RC ntpq/ntpq-opts.texi@1.228 +1 -1 NTP_4_2_5P238_RC ntpq/ntpq.1@1.228 +2 -2 NTP_4_2_5P238_RC ntpsnmpd/ntpsnmpd-opts.c@1.107 +2 -2 NTP_4_2_5P238_RC ntpsnmpd/ntpsnmpd-opts.h@1.107 +3 -3 NTP_4_2_5P238_RC ntpsnmpd/ntpsnmpd-opts.texi@1.107 +1 -1 NTP_4_2_5P238_RC ntpsnmpd/ntpsnmpd.1@1.107 +2 -2 NTP_4_2_5P238_RC packageinfo.sh@1.242 +1 -1 NTP_4_2_5P238_RC sntp/sntp-opts.c@1.101 +2 -2 NTP_4_2_5P238_RC sntp/sntp-opts.h@1.101 +3 -3 NTP_4_2_5P238_RC sntp/sntp-opts.texi@1.101 +1 -1 NTP_4_2_5P238_RC sntp/sntp.1@1.101 +2 -2 NTP_4_2_5P238_RC util/ntp-keygen-opts.c@1.231 +2 -2 NTP_4_2_5P238_RC util/ntp-keygen-opts.h@1.231 +3 -3 NTP_4_2_5P238_RC util/ntp-keygen-opts.texi@1.230 +1 -1 NTP_4_2_5P238_RC util/ntp-keygen.1@1.230 +2 -2 NTP_4_2_5P238_RC ChangeSet@1.2060.7.3, 2009-10-26 22:25:38-05:00, stenn@whimsy.udel.edu Changes from Dave Mills ChangeLog@1.506.1.3 +1 -0 Changes from Dave Mills ntpd/ntp_refclock.c@1.91 +1 -1 Changes from Dave Mills ntpd/refclock_wwv.c@1.73 +0 -1 Changes from Dave Mills ChangeSet@1.2060.7.2, 2009-10-26 22:20:49-05:00, stenn@whimsy.udel.edu driver4.html updates from Dave Mills ChangeLog@1.506.1.2 +1 -0 driver4.html updates from Dave Mills html/drivers/driver4.html@1.15 +2 -2 driver4.html updates from Dave Mills ChangeSet@1.2060.7.1, 2009-10-26 22:16:02-05:00, stenn@whimsy.udel.edu PPSAPI Cleanup of ntpd/refclock_wwvb.c ChangeLog@1.506.1.1 +1 -0 PPSAPI Cleanup of ntpd/refclock_wwvb.c ntpd/refclock_wwvb.c@1.22 +73 -23 PPSAPI Cleanup of ntpd/refclock_wwvb.c ChangeSet@1.2060.1.19, 2009-10-27 00:16:02+00:00, davehart@shiny.ad.hartbrothers.com Get rid of configure tests for __ss_family and __ss_len when the more common ss_family and ss_len are present. ChangeLog@1.509 +2 -0 Get rid of configure tests for __ss_family and __ss_len when the more common ss_family and ss_len are present. configure.ac@1.459.1.5 +175 -107 Get rid of configure tests for __ss_family and __ss_len when the more common ss_family and ss_len are present. sntp/configure.ac@1.24 +141 -46 Get rid of configure tests for __ss_family and __ss_len when the more common ss_family and ss_len are present. ChangeSet@1.2060.1.18, 2009-10-26 20:49:30+00:00, davehart@shiny.ad.hartbrothers.com CIDs 94-99 make it more clearly impossible for sock_hash() to return a negative number. CID 105, 106 ensure ntpdc arrays are not overrun even if callers misbehave. CID 113 use va_end() in refclock_true.c true_debug(). ChangeLog@1.508 +5 -0 CIDs 94-99 make it more clearly impossible for sock_hash() to return a negative number. CID 105, 106 ensure ntpdc arrays are not overrun even if callers misbehave. CID 113 use va_end() in refclock_true.c true_debug(). include/ntpd.h@1.135 +1 -1 CIDs 94-99 -- make it more clearly impossible for sock_hash to return a negative number libntp/ntp_rfc2553.c@1.41 +2 -0 protect sys/socket.h inclusion with #ifdef HAVE_SYS_SOCKET_H ntpd/ntp_monitor.c@1.25 +6 -6 CIDs 94-99 -- make it more clearly impossible for sock_hash to return a negative number ntpd/ntp_peer.c@1.123 +9 -9 CIDs 94-99 -- make it more clearly impossible for sock_hash to return a negative number ntpd/ntp_util.c@1.75 +15 -18 CIDs 94-99 -- make it more clearly impossible for sock_hash to return a negative number ntpd/refclock_true.c@1.11 +1 -0 CID 113 use va_end() ntpdc/ntpdc_ops.c@1.61 +23 -14 CID 105, 106 -- ensure array are not overrun even if callers misbehave ChangeSet@1.2060.1.16, 2009-10-26 05:45:09-05:00, stenn@whimsy.udel.edu NTP_4_2_5P237_RC TAG: NTP_4_2_5P237_RC ChangeLog@1.506 +1 -0 NTP_4_2_5P237_RC ntpd/ntpd-opts.c@1.231 +2 -2 NTP_4_2_5P237_RC ntpd/ntpd-opts.h@1.231 +3 -3 NTP_4_2_5P237_RC ntpd/ntpd-opts.texi@1.229 +1 -1 NTP_4_2_5P237_RC ntpd/ntpd.1@1.229 +2 -2 NTP_4_2_5P237_RC ntpdc/ntpdc-opts.c@1.227 +2 -2 NTP_4_2_5P237_RC ntpdc/ntpdc-opts.h@1.227 +3 -3 NTP_4_2_5P237_RC ntpdc/ntpdc-opts.texi@1.226 +1 -1 NTP_4_2_5P237_RC ntpdc/ntpdc.1@1.226 +2 -2 NTP_4_2_5P237_RC ntpq/ntpq-opts.c@1.228 +2 -2 NTP_4_2_5P237_RC ntpq/ntpq-opts.h@1.228 +3 -3 NTP_4_2_5P237_RC ntpq/ntpq-opts.texi@1.227 +1 -1 NTP_4_2_5P237_RC ntpq/ntpq.1@1.227 +2 -2 NTP_4_2_5P237_RC ntpsnmpd/ntpsnmpd-opts.c@1.106 +2 -2 NTP_4_2_5P237_RC ntpsnmpd/ntpsnmpd-opts.h@1.106 +3 -3 NTP_4_2_5P237_RC ntpsnmpd/ntpsnmpd-opts.texi@1.106 +1 -1 NTP_4_2_5P237_RC ntpsnmpd/ntpsnmpd.1@1.106 +2 -2 NTP_4_2_5P237_RC packageinfo.sh@1.241 +1 -1 NTP_4_2_5P237_RC sntp/sntp-opts.c@1.100 +2 -2 NTP_4_2_5P237_RC sntp/sntp-opts.h@1.100 +3 -3 NTP_4_2_5P237_RC sntp/sntp-opts.texi@1.100 +1 -1 NTP_4_2_5P237_RC sntp/sntp.1@1.100 +2 -2 NTP_4_2_5P237_RC util/ntp-keygen-opts.c@1.230 +2 -2 NTP_4_2_5P237_RC util/ntp-keygen-opts.h@1.230 +3 -3 NTP_4_2_5P237_RC util/ntp-keygen-opts.texi@1.229 +1 -1 NTP_4_2_5P237_RC util/ntp-keygen.1@1.229 +2 -2 NTP_4_2_5P237_RC ChangeSet@1.2060.6.1, 2009-10-25 11:25:16+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1355] ntp-dev won't compile on OpenBSD 4.6. BitKeeper/deleted/.del-in.h~29080509@1.4 +0 -0 Rename: ports/winnt/include/netinet/in.h -> BitKeeper/deleted/.del-in.h~29080509 BitKeeper/deleted/.del-in_system.h~c86910dc@1.3 +0 -0 Rename: ports/winnt/include/netinet/in_system.h -> BitKeeper/deleted/.del-in_system.h~c86910dc BitKeeper/deleted/.del-ip.h~eb192092@1.3 +0 -0 Rename: ports/winnt/include/netinet/ip.h -> BitKeeper/deleted/.del-ip.h~eb192092 BitKeeper/deleted/.del-socket.h~29080509@1.4 +0 -0 Rename: ports/winnt/include/sys/socket.h -> BitKeeper/deleted/.del-socket.h~29080509 ChangeLog@1.503.2.1 +1 -0 [Bug 1355] ntp-dev won't compile on OpenBSD 4.6. include/Makefile.am@1.35.1.1 +1 -0 move lib_strbuf.h from libntp to include include/l_stdlib.h@1.17 +1 -4 require sys/types.h include/lib_strbuf.h@1.6 +0 -0 Rename: libntp/lib_strbuf.h -> include/lib_strbuf.h include/ntp_io.h@1.13 +1 -3 require sys/types.h include/ntp_net.h@1.3 +4 -0 protect sys/socket.h, netinet/in.h inclusion with config.h macros include/ntp_stdlib.h@1.35 +2 -0 protect sys/socket.h inclusion with #ifdef HAVE_SYS_SOCKET_H include/ntp_types.h@1.14 +4 -5 stay out of system/compiler underscore namespace include/ntpsim.h@1.12 +8 -7 protect sys/socket.h inclusion with #ifdef HAVE_SYS_SOCKET_H libntp/Makefile.am@1.47 +0 -2 move lib_strbuf.h from libntp to include libntp/decodenetnum.c@1.10 +5 -0 include config.h protect sys/socket.h, netinet/in.h inclusion with config.h macros libntp/inttoa.c@1.3 +3 -2 include config.h use snprintf() in favor of sprintf() libntp/msyslog.c@1.24 +1 -3 require sys/types.h libntp/ntp_random.c@1.7 +1 -3 require sys/types.h libntp/numtoa.c@1.5 +2 -3 [Bug 1355] ntp-dev won't compile on OpenBSD 4.6. protect netinet/in.h inclusion with HAVE_NETINET_IN_H libntp/numtohost.c@1.5 +2 -4 [Bug 1355] ntp-dev won't compile on OpenBSD 4.6. protect netinet/in.h inclusion with HAVE_NETINET_IN_H libntp/socktoa.c@1.11 +4 -0 protect sys/socket.h, netinet/in.h inclusion with config.h macros libntp/socktohost.c@1.7 +4 -0 protect sys/socket.h, netinet/in.h inclusion with config.h macros ntpd/keyword-gen.c@1.1.1.1 +1 -1 [Bug 1355] ntp-dev won't compile on OpenBSD 4.6. ntpd/ntp_control.c@1.127 +2 -0 protect netinet/in.h inclusion with HAVE_NETINET_IN_H ntpd/ntp_intres.c@1.66 +2 -0 protect netinet/in.h inclusion with HAVE_NETINET_IN_H ntpd/ntp_request.c@1.80.1.2 +2 -0 protect netinet/in.h inclusion with HAVE_NETINET_IN_H ntpdc/ntpdc_ops.c@1.60 +9 -4 protect netinet/in.h inclusion with #ifdef HAVE_NETINET_IN_H. stay within array bounds in clockstat() even if calling code misbehaves. ports/winnt/vc6/libntp.dsp@1.43.1.1 +1 -1 move lib_strbuf.h from libntp to include ports/winnt/vs2003/libntp.vcproj@1.5 +1 -1 move lib_strbuf.h from libntp to include ports/winnt/vs2005/libntp.vcproj@1.5 +1 -1 move lib_strbuf.h from libntp to include ports/winnt/vs2008/libntp/libntp.vcproj@1.22 +1 -1 move lib_strbuf.h from libntp to include util/ntp-keygen.c@1.59 +1 -9 require sys/types.h remove old #ifdef SYS_WINNT related to ntp_getopt, ntp-keygen uses libopts ChangeSet@1.2060.5.1, 2009-10-25 03:06:29+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1354] libtool error building after bootstrap with Autoconf 2.64. Allow NTP_VPATH_HACK configure test to handle newer gmake versions. BitKeeper/deleted/.del-ltmain.sh~1dcd783dfc596fc7@1.3 +0 -0 Rename: sntp/ltmain.sh -> BitKeeper/deleted/.del-ltmain.sh~1dcd783dfc596fc7 BitKeeper/deleted/.del-ltmain.sh~2b9d9fc0af8c0735@1.2 +0 -0 Rename: ltmain.sh -> BitKeeper/deleted/.del-ltmain.sh~2b9d9fc0af8c0735 ChangeLog@1.503.1.1 +2 -0 [Bug 1354] libtool error building after bootstrap with Autoconf 2.64. Allow NTP_VPATH_HACK configure test to handle newer gmake versions. Makefile.am@1.86.1.1 +11 -3 add rule to rebuild libtool if needed. no need to use unix2dos on *.ds* after bk admin -fEOLN_WINDOWS configure.ac@1.459.1.4 +3 -1 use AC_CONFIG_MACRO_DIR() to keep m4 files in m4 m4/ntp_vpathhack.m4@1.2 +23 -17 NTP_VPATH_HACK was misfiring on FreeBSD with recent GNU Make due to a change from "GNU Make version" to "GNU Make" as the gmake -v output. Also do not cache the result, running make -v and grep is worth it to allow changing make without flushing the cache. ports/winnt/vc6/Instsrv.dsp@1.11 +0 -0 Turn on EOLN_WINDOWS flag ports/winnt/vc6/Instsrv.dsp@1.10 +0 -0 Turn off EOLN_NATIVE flag ports/winnt/vc6/libntp.dsp@1.45 +0 -0 Turn on EOLN_WINDOWS flag ports/winnt/vc6/libntp.dsp@1.44 +0 -0 Turn off EOLN_NATIVE flag ports/winnt/vc6/ntp.dsw@1.11 +0 -0 Turn on EOLN_WINDOWS flag ports/winnt/vc6/ntp.dsw@1.10 +0 -0 Turn off EOLN_NATIVE flag ports/winnt/vc6/ntpd.dsp@1.41 +0 -0 Turn on EOLN_WINDOWS flag ports/winnt/vc6/ntpd.dsp@1.40 +0 -0 Turn off EOLN_NATIVE flag ports/winnt/vc6/ntpdate.dsp@1.24 +0 -0 Turn on EOLN_WINDOWS flag ports/winnt/vc6/ntpdate.dsp@1.23 +0 -0 Turn off EOLN_NATIVE flag ports/winnt/vc6/ntpdc.dsp@1.27 +0 -0 Turn on EOLN_WINDOWS flag ports/winnt/vc6/ntpdc.dsp@1.26 +0 -0 Turn off EOLN_NATIVE flag ports/winnt/vc6/ntpkeygen.dsp@1.20 +0 -0 Turn on EOLN_WINDOWS flag ports/winnt/vc6/ntpkeygen.dsp@1.19 +0 -0 Turn off EOLN_NATIVE flag ports/winnt/vc6/ntpq.dsp@1.28 +0 -0 Turn on EOLN_WINDOWS flag ports/winnt/vc6/ntpq.dsp@1.27 +0 -0 Turn off EOLN_NATIVE flag scripts/genCommitLog@1.5 +9 -0 crude workaround for read-only srcdir seen in make distcheck sntp/Makefile.am@1.13.1.1 +13 -2 add rule to rebuild libtool if needed sntp/configure.ac@1.23 +2 -0 use AC_CONFIG_MACRO_DIR() to keep m4 files in m4 ChangeSet@1.2060.1.14, 2009-10-24 05:55:49+00:00, davehart@shiny.ad.hartbrothers.com [Bug 610] NMEA support for using PPSAPI on a different device. [Bug 1238] use only fudge time2 to offset NMEA serial timestamp. ChangeLog@1.504 +2 -0 [Bug 610] NMEA support for using PPSAPI on a different device. [Bug 1238] use only fudge time2 to offset NMEA serial timestamp. include/ntp_refclock.h@1.24 +2 -1 [Bug 1238] use only fudge time2 to offset NMEA serial timestamp. ntpd/ntp_refclock.c@1.90 +15 -5 [Bug 1238] use only fudge time2 to offset NMEA serial timestamp. ntpd/refclock_nmea.c@1.45 +45 -13 [Bug 610] NMEA support for using PPSAPI on a different device. [Bug 1238] use only fudge time2 to offset NMEA serial timestamp. ChangeSet@1.2060.4.1, 2009-10-23 16:57:07+00:00, davehart@shiny.ad.hartbrothers.com shrink 750 keyword scanner states from 64 to 32 bits apiece ntpd/keyword-gen.c@1.2 +133 -18 shrink 750 keyword scanner states from 64 to 32 bits apiece ntpd/ntp_keyword.h@1.2 +741 -741 shrink 750 keyword scanner states from 64 to 32 bits apiece ntpd/ntp_scanner.c@1.31 +20 -16 shrink 750 keyword scanner states from 64 to 32 bits apiece ntpd/ntp_scanner.h@1.14 +37 -10 shrink 750 keyword scanner states from 64 to 32 bits apiece ChangeSet@1.2060.1.13, 2009-10-22 06:47:25-04:00, stenn@whimsy.udel.edu NTP_4_2_5P236_RC TAG: NTP_4_2_5P236_RC ChangeLog@1.503 +1 -0 NTP_4_2_5P236_RC ntpd/ntpd-opts.c@1.230 +2 -2 NTP_4_2_5P236_RC ntpd/ntpd-opts.h@1.230 +3 -3 NTP_4_2_5P236_RC ntpd/ntpd-opts.texi@1.228 +1 -1 NTP_4_2_5P236_RC ntpd/ntpd.1@1.228 +2 -2 NTP_4_2_5P236_RC ntpdc/ntpdc-opts.c@1.226 +2 -2 NTP_4_2_5P236_RC ntpdc/ntpdc-opts.h@1.226 +3 -3 NTP_4_2_5P236_RC ntpdc/ntpdc-opts.texi@1.225 +1 -1 NTP_4_2_5P236_RC ntpdc/ntpdc.1@1.225 +2 -2 NTP_4_2_5P236_RC ntpq/ntpq-opts.c@1.227 +2 -2 NTP_4_2_5P236_RC ntpq/ntpq-opts.h@1.227 +3 -3 NTP_4_2_5P236_RC ntpq/ntpq-opts.texi@1.226 +1 -1 NTP_4_2_5P236_RC ntpq/ntpq.1@1.226 +2 -2 NTP_4_2_5P236_RC ntpsnmpd/ntpsnmpd-opts.c@1.105 +2 -2 NTP_4_2_5P236_RC ntpsnmpd/ntpsnmpd-opts.h@1.105 +3 -3 NTP_4_2_5P236_RC ntpsnmpd/ntpsnmpd-opts.texi@1.105 +1 -1 NTP_4_2_5P236_RC ntpsnmpd/ntpsnmpd.1@1.105 +2 -2 NTP_4_2_5P236_RC packageinfo.sh@1.240 +1 -1 NTP_4_2_5P236_RC sntp/sntp-opts.c@1.99 +2 -2 NTP_4_2_5P236_RC sntp/sntp-opts.h@1.99 +3 -3 NTP_4_2_5P236_RC sntp/sntp-opts.texi@1.99 +1 -1 NTP_4_2_5P236_RC sntp/sntp.1@1.99 +2 -2 NTP_4_2_5P236_RC util/ntp-keygen-opts.c@1.229 +2 -2 NTP_4_2_5P236_RC util/ntp-keygen-opts.h@1.229 +3 -3 NTP_4_2_5P236_RC util/ntp-keygen-opts.texi@1.228 +1 -1 NTP_4_2_5P236_RC util/ntp-keygen.1@1.228 +2 -2 NTP_4_2_5P236_RC ChangeSet@1.2060.1.12, 2009-10-22 05:02:37-04:00, stenn@whimsy.udel.edu Cleanup from Dave Mills ChangeLog@1.502 +1 -0 Cleanup from Dave Mills html/authopt.html@1.53 +42 -9 Cleanup from Dave Mills html/ntpq.html@1.35 +10 -9 Cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.151 +4 -5 Cleanup from Dave Mills ChangeSet@1.2060.3.1, 2009-10-21 21:59:17+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix. ChangeLog@1.498.1.1 +1 -0 [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix. include/ntp_stdlib.h@1.34 +7 -1 [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix. libntp/machines.c@1.21 +49 -16 [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix. ntpd/ntp_config.c@1.232 +25 -4 [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix. ports/winnt/libntp/SetSystemTime.c@1.7 +1 -1 [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix. ports/winnt/ntpd/nt_clockstuff.c@1.37 +6 -0 [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix. ChangeSet@1.2060.1.10, 2009-10-21 15:38:30+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: AC_FUNC_MALLOC is unneeded, breaks cross-compile with uClibc with undefined references to rpl_malloc sntp/configure.ac@1.22 +0 -1 AC_FUNC_MALLOC is unneeded, breaks cross-compile with uClibc with undefined references to rpl_malloc ChangeSet@1.2060.1.9, 2009-10-21 04:27:03+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: correct sa_len test butchered recently configure.ac@1.459.1.3 +20 -2 correct sa_len test butchered recently ChangeSet@1.2060.1.8, 2009-10-20 17:47:04+00:00, davehart@shiny.ad.hartbrothers.com Do not attempt to execute built binaries from ntpd/Makefile when cross-compiling (keyword-gen and ntpd --saveconfigquit). sntp/main.c: Remove duplicate global adr_buf[] (also defined in networking.c) which Piotr Grudzinski identified breaking his build. Correct in6addr_any test in configure.ac to attempt link too. ChangeLog@1.500 +5 -0 Do not attempt to execute built binaries from ntpd/Makefile when cross-compiling (keyword-gen and ntpd --saveconfigquit). sntp/main.c: Remove duplicate global adr_buf[] (also defined in networking.c) which Piotr Grudzinski identified breaking his build. Correct in6addr_any test in configure.ac to attempt link too. configure.ac@1.459.1.2 +8 -6 Correct in6addr_any test in configure.ac to attempt link too. Introduce NTP_CROSSCOMPILE automake conditional ntpd/Makefile.am@1.76 +17 -3 Use NTP_CROSSCOMPILE automake conditional to avoid attempting to execute built binaries when cross-compiling (keyword-gen and ntpd --saveconfigquit) sntp/configure.ac@1.21 +6 -5 Correct in6addr_any test in configure.ac to attempt link too. sntp/main.c@1.20 +9 -9 sntp/main.c: Remove duplicate global adr_buf[] (also defined in networking.c) which Piotr Grudzinski identified breaking his build. ChangeSet@1.2060.1.7, 2009-10-19 17:23:04+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1343] ntpd/ntp_io.c close_fd() does not compile on Solaris 7. Also includes similar fix to sntp/crypto.c identified on same machine. ChangeLog@1.499 +1 -0 [Bug 1343] ntpd/ntp_io.c close_fd() does not compile on Solaris 7. Also includes similar fix to sntp/crypto.c identified on same machine. ntpd/ntp_io.c@1.307 +4 -2 move code after local variable declaration in move_fd() to cure compiling with compilers that know the difference between C and C++ sntp/crypto.c@1.9 +44 -43 move digest_data variable declaration ahead of code in auth_md5() for compatibility with ANSI C. ChangeSet@1.2060.1.6, 2009-10-18 06:46:43-04:00, stenn@whimsy.udel.edu NTP_4_2_5P235_RC TAG: NTP_4_2_5P235_RC ChangeLog@1.498 +1 -0 NTP_4_2_5P235_RC ntpd/ntpd-opts.c@1.229 +2 -2 NTP_4_2_5P235_RC ntpd/ntpd-opts.h@1.229 +3 -3 NTP_4_2_5P235_RC ntpd/ntpd-opts.texi@1.227 +1 -1 NTP_4_2_5P235_RC ntpd/ntpd.1@1.227 +2 -2 NTP_4_2_5P235_RC ntpdc/ntpdc-opts.c@1.225 +2 -2 NTP_4_2_5P235_RC ntpdc/ntpdc-opts.h@1.225 +3 -3 NTP_4_2_5P235_RC ntpdc/ntpdc-opts.texi@1.224 +1 -1 NTP_4_2_5P235_RC ntpdc/ntpdc.1@1.224 +2 -2 NTP_4_2_5P235_RC ntpq/ntpq-opts.c@1.226 +2 -2 NTP_4_2_5P235_RC ntpq/ntpq-opts.h@1.226 +3 -3 NTP_4_2_5P235_RC ntpq/ntpq-opts.texi@1.225 +1 -1 NTP_4_2_5P235_RC ntpq/ntpq.1@1.225 +2 -2 NTP_4_2_5P235_RC ntpsnmpd/ntpsnmpd-opts.c@1.104 +2 -2 NTP_4_2_5P235_RC ntpsnmpd/ntpsnmpd-opts.h@1.104 +3 -3 NTP_4_2_5P235_RC ntpsnmpd/ntpsnmpd-opts.texi@1.104 +1 -1 NTP_4_2_5P235_RC ntpsnmpd/ntpsnmpd.1@1.104 +2 -2 NTP_4_2_5P235_RC packageinfo.sh@1.239 +1 -1 NTP_4_2_5P235_RC sntp/sntp-opts.c@1.98 +2 -2 NTP_4_2_5P235_RC sntp/sntp-opts.h@1.98 +3 -3 NTP_4_2_5P235_RC sntp/sntp-opts.texi@1.98 +1 -1 NTP_4_2_5P235_RC sntp/sntp.1@1.98 +2 -2 NTP_4_2_5P235_RC util/ntp-keygen-opts.c@1.228 +2 -2 NTP_4_2_5P235_RC util/ntp-keygen-opts.h@1.228 +3 -3 NTP_4_2_5P235_RC util/ntp-keygen-opts.texi@1.227 +1 -1 NTP_4_2_5P235_RC util/ntp-keygen.1@1.227 +2 -2 NTP_4_2_5P235_RC ChangeSet@1.2060.1.5, 2009-10-18 01:54:01+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1343] lib/isc build breaks on systems without IPv6 headers. ChangeLog@1.497 +1 -0 [Bug 1343] lib/isc build breaks on systems without IPv6 headers. configure.ac@1.459.1.1 +22 -23 remove one of two sockaddr sa_len tests. convert in_port_t tested to cached. include/ntp_rfc2553.h@1.32 +4 -87 [Bug 1343] lib/isc build breaks on systems without IPv6 headers. lib/isc/unix/include/isc/net.h@1.11 +1 -1 [Bug 1343] lib/isc build breaks on systems without IPv6 headers. lib/isc/unix/net.c@1.14 +4 -3 [Bug 1343] lib/isc build breaks on systems without IPv6 headers. lib/isc/win32/include/isc/ipv6.h@1.9 +2 -2 [Bug 1343] lib/isc build breaks on systems without IPv6 headers. lib/isc/win32/include/isc/net.h@1.9 +2 -2 [Bug 1343] lib/isc build breaks on systems without IPv6 headers. lib/isc/win32/net.c@1.13 +5 -0 [Bug 1343] lib/isc build breaks on systems without IPv6 headers. libntp/ntp_rfc2553.c@1.40 +2 -2 [Bug 1343] lib/isc build breaks on systems without IPv6 headers. ntpd/ntp_request.c@1.80.1.1 +10 -10 [Bug 1343] lib/isc build breaks on systems without IPv6 headers. ntpdc/ntpdc_ops.c@1.59 +2 -2 [Bug 1343] lib/isc build breaks on systems without IPv6 headers. ports/winnt/vs2008/libntp/libntp.vcproj@1.21 +3 -3 correct isc/net.h path sntp/configure.ac@1.20 +56 -21 libisc on systems without in_port_t wasn't compiling. cache in_port_t test. ChangeSet@1.2060.1.4, 2009-10-16 06:48:28-04:00, stenn@whimsy.udel.edu NTP_4_2_5P234_RC TAG: NTP_4_2_5P234_RC ChangeLog@1.496 +1 -0 NTP_4_2_5P234_RC ntpd/ntpd-opts.c@1.228 +2 -2 NTP_4_2_5P234_RC ntpd/ntpd-opts.h@1.228 +3 -3 NTP_4_2_5P234_RC ntpd/ntpd-opts.texi@1.226 +1 -1 NTP_4_2_5P234_RC ntpd/ntpd.1@1.226 +2 -2 NTP_4_2_5P234_RC ntpdc/ntpdc-opts.c@1.224 +2 -2 NTP_4_2_5P234_RC ntpdc/ntpdc-opts.h@1.224 +3 -3 NTP_4_2_5P234_RC ntpdc/ntpdc-opts.texi@1.223 +1 -1 NTP_4_2_5P234_RC ntpdc/ntpdc.1@1.223 +2 -2 NTP_4_2_5P234_RC ntpq/ntpq-opts.c@1.225 +2 -2 NTP_4_2_5P234_RC ntpq/ntpq-opts.h@1.225 +3 -3 NTP_4_2_5P234_RC ntpq/ntpq-opts.texi@1.224 +1 -1 NTP_4_2_5P234_RC ntpq/ntpq.1@1.224 +2 -2 NTP_4_2_5P234_RC ntpsnmpd/ntpsnmpd-opts.c@1.103 +2 -2 NTP_4_2_5P234_RC ntpsnmpd/ntpsnmpd-opts.h@1.103 +3 -3 NTP_4_2_5P234_RC ntpsnmpd/ntpsnmpd-opts.texi@1.103 +1 -1 NTP_4_2_5P234_RC ntpsnmpd/ntpsnmpd.1@1.103 +2 -2 NTP_4_2_5P234_RC packageinfo.sh@1.238 +1 -1 NTP_4_2_5P234_RC sntp/sntp-opts.c@1.97 +2 -2 NTP_4_2_5P234_RC sntp/sntp-opts.h@1.97 +3 -3 NTP_4_2_5P234_RC sntp/sntp-opts.texi@1.97 +1 -1 NTP_4_2_5P234_RC sntp/sntp.1@1.97 +2 -2 NTP_4_2_5P234_RC util/ntp-keygen-opts.c@1.227 +2 -2 NTP_4_2_5P234_RC util/ntp-keygen-opts.h@1.227 +3 -3 NTP_4_2_5P234_RC util/ntp-keygen-opts.texi@1.226 +1 -1 NTP_4_2_5P234_RC util/ntp-keygen.1@1.226 +2 -2 NTP_4_2_5P234_RC ChangeSet@1.2060.2.1, 2009-10-16 07:32:59+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and move #define strerror... to a header not used by lib/isc code. ChangeLog@1.493.1.1 +2 -0 [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and move #define strerror... to a header not used by lib/isc code. include/ntp_stdlib.h@1.33 +12 -3 [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and move #define strerror... to a header not used by lib/isc code. lib/isc/win32/strerror.c@1.13 +10 -18 [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and move #define strerror... to a header not used by lib/isc code. ports/winnt/include/config.h@1.79 +12 -8 [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and move #define strerror... to a header not used by lib/isc code. ports/winnt/include/syslog.h@1.6 +0 -3 [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and move #define strerror... to a header not used by lib/isc code. ChangeSet@1.2060.1.2, 2009-10-15 22:09:06+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1345] illegal 'grep' option prevents compilation. [Bug 1346] keyword scanner broken where char defaults to unsigned. [Bug 1347] ntpd/complete.conf missing multicastclient test case. ChangeLog@1.494 +3 -0 [Bug 1345] illegal 'grep' option prevents compilation. [Bug 1346] keyword scanner broken where char defaults to unsigned. [Bug 1347] ntpd/complete.conf missing multicastclient test case. ntpd/Makefile.am@1.75 +2 -2 [Bug 1345] illegal 'grep' option prevents compilation. ntpd/complete.conf@1.2 +1 -0 [Bug 1347] ntpd/complete.conf missing multicastclient test case. ntpd/ntp_config.c@1.231 +9 -15 [Bug 1347] ntpd/complete.conf missing multicastclient test case. ntpd/ntp_scanner.c@1.30 +20 -18 [Bug 1346] keyword scanner broken where char defaults to unsigned. ntpd/ntp_scanner.h@1.13 +0 -1 [Bug 1346] keyword scanner broken where char defaults to unsigned. ChangeSet@1.2062, 2009-10-15 04:15:55-07:00, hstenn@lgmac-hstenn.local sntp doc updates sntp/Makefile.am@1.15 +1 -0 distribute sntp.texi sntp/sntp.texi@1.1 +84 -0 BitKeeper file /Users/hstenn/src/ntp-dev-snmp/sntp/sntp.texi sntp/sntp.texi@1.0 +0 -0 ChangeSet@1.2060.1.1, 2009-10-15 06:43:07-04:00, stenn@whimsy.udel.edu NTP_4_2_5P233_RC TAG: NTP_4_2_5P233_RC ChangeLog@1.493 +1 -0 NTP_4_2_5P233_RC ntpd/ntpd-opts.c@1.227 +2 -2 NTP_4_2_5P233_RC ntpd/ntpd-opts.h@1.227 +3 -3 NTP_4_2_5P233_RC ntpd/ntpd-opts.texi@1.225 +1 -1 NTP_4_2_5P233_RC ntpd/ntpd.1@1.225 +2 -2 NTP_4_2_5P233_RC ntpdc/ntpdc-opts.c@1.223 +2 -2 NTP_4_2_5P233_RC ntpdc/ntpdc-opts.h@1.223 +3 -3 NTP_4_2_5P233_RC ntpdc/ntpdc-opts.texi@1.222 +1 -1 NTP_4_2_5P233_RC ntpdc/ntpdc.1@1.222 +2 -2 NTP_4_2_5P233_RC ntpq/ntpq-opts.c@1.224 +2 -2 NTP_4_2_5P233_RC ntpq/ntpq-opts.h@1.224 +3 -3 NTP_4_2_5P233_RC ntpq/ntpq-opts.texi@1.223 +1 -1 NTP_4_2_5P233_RC ntpq/ntpq.1@1.223 +2 -2 NTP_4_2_5P233_RC ntpsnmpd/ntpsnmpd-opts.c@1.102 +2 -2 NTP_4_2_5P233_RC ntpsnmpd/ntpsnmpd-opts.h@1.102 +3 -3 NTP_4_2_5P233_RC ntpsnmpd/ntpsnmpd-opts.texi@1.102 +1 -1 NTP_4_2_5P233_RC ntpsnmpd/ntpsnmpd.1@1.102 +2 -2 NTP_4_2_5P233_RC packageinfo.sh@1.237 +1 -1 NTP_4_2_5P233_RC sntp/sntp-opts.c@1.96 +2 -2 NTP_4_2_5P233_RC sntp/sntp-opts.h@1.96 +3 -3 NTP_4_2_5P233_RC sntp/sntp-opts.texi@1.96 +1 -1 NTP_4_2_5P233_RC sntp/sntp.1@1.96 +2 -2 NTP_4_2_5P233_RC util/ntp-keygen-opts.c@1.226 +2 -2 NTP_4_2_5P233_RC util/ntp-keygen-opts.h@1.226 +3 -3 NTP_4_2_5P233_RC util/ntp-keygen-opts.texi@1.225 +1 -1 NTP_4_2_5P233_RC util/ntp-keygen.1@1.225 +2 -2 NTP_4_2_5P233_RC ChangeSet@1.2061, 2009-10-15 03:43:07-07:00, hstenn@lgmac-hstenn.local Prep for sntp docs Makefile.am@1.87 +5 -1 Create include/version.texi configure.ac@1.460 +7 -2 K_open() is not used anymore. kvm_open() needs kvm.h include/Makefile.am@1.36 +1 -1 include version.texi scripts/genver@1.5 +22 -1 Handle version.texi sntp/Makefile.am@1.14 +17 -2 Prep for building sntp.html sntp/sntp-opts.def@1.12 +15 -41 updates ChangeSet@1.2057.1.1, 2009-10-15 00:53:23-04:00, stenn@whimsy.udel.edu Documentation cleanup and updates ChangeLog@1.489.1.1 +1 -0 Documentation cleanup and updates html/miscopt.html@1.52 +1 -1 Documentation cleanup and updates html/ntpd.html@1.51 +72 -54 Documentation cleanup and updates html/ntpq.html@1.34 +99 -73 Documentation cleanup and updates ChangeSet@1.2058, 2009-10-15 03:30:56+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1342] ignore|drop one IPv6 address on an interface blocks all addresses on that interface. ChangeLog@1.490 +2 -0 [Bug 1342] ignore|drop one IPv6 address on an interface blocks all addresses on that interface. lib/isc/win32/interfaceiter.c@1.15 +10 -25 Cleanup incomplete merge of NTP local changes from recent libisc update ntpd/ntp_config.c@1.230 +1 -1 Use NULL for peer_config() interface arg instead of wildcard to ensure the correct interface is used from the start. ntpd/ntp_io.c@1.304.1.1 +17 -14 [Bug 1342] ignore|drop one IPv6 address on an interface blocks all addresses on that interface. ntpd/ntp_peer.c@1.122 +1 -1 Do not peer_clear("XFAC") manycast server associations or they will never regain their ACST refid. ports/winnt/ntpd/ntservice.c@1.21 +20 -8 Make windows-only command-line hack a little less broken ChangeSet@1.2057, 2009-10-14 04:22:12-04:00, stenn@whimsy.udel.edu NTP_4_2_5P232_RC TAG: NTP_4_2_5P232_RC ChangeLog@1.489 +1 -0 NTP_4_2_5P232_RC ntpd/ntpd-opts.c@1.226 +4 -4 NTP_4_2_5P232_RC ntpd/ntpd-opts.h@1.226 +3 -3 NTP_4_2_5P232_RC ntpd/ntpd-opts.texi@1.224 +15 -6 NTP_4_2_5P232_RC ntpd/ntpd.1@1.224 +16 -7 NTP_4_2_5P232_RC ntpdc/ntpdc-opts.c@1.222 +2 -2 NTP_4_2_5P232_RC ntpdc/ntpdc-opts.h@1.222 +3 -3 NTP_4_2_5P232_RC ntpdc/ntpdc-opts.texi@1.221 +1 -1 NTP_4_2_5P232_RC ntpdc/ntpdc.1@1.221 +2 -2 NTP_4_2_5P232_RC ntpq/ntpq-opts.c@1.223 +2 -2 NTP_4_2_5P232_RC ntpq/ntpq-opts.h@1.223 +3 -3 NTP_4_2_5P232_RC ntpq/ntpq-opts.texi@1.222 +1 -1 NTP_4_2_5P232_RC ntpq/ntpq.1@1.222 +2 -2 NTP_4_2_5P232_RC ntpsnmpd/ntpsnmpd-opts.c@1.101 +2 -2 NTP_4_2_5P232_RC ntpsnmpd/ntpsnmpd-opts.h@1.101 +3 -3 NTP_4_2_5P232_RC ntpsnmpd/ntpsnmpd-opts.texi@1.101 +1 -1 NTP_4_2_5P232_RC ntpsnmpd/ntpsnmpd.1@1.101 +2 -2 NTP_4_2_5P232_RC packageinfo.sh@1.236 +1 -1 NTP_4_2_5P232_RC sntp/sntp-opts.c@1.95 +2 -2 NTP_4_2_5P232_RC sntp/sntp-opts.h@1.95 +3 -3 NTP_4_2_5P232_RC sntp/sntp-opts.texi@1.95 +1 -1 NTP_4_2_5P232_RC sntp/sntp.1@1.95 +2 -2 NTP_4_2_5P232_RC util/ntp-keygen-opts.c@1.225 +2 -2 NTP_4_2_5P232_RC util/ntp-keygen-opts.h@1.225 +3 -3 NTP_4_2_5P232_RC util/ntp-keygen-opts.texi@1.224 +1 -1 NTP_4_2_5P232_RC util/ntp-keygen.1@1.224 +2 -2 NTP_4_2_5P232_RC ChangeSet@1.2050.5.1, 2009-10-13 23:48:18+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1341] NMEA driver requires working PPSAPI #ifdef HAVE_PPSAPI. ChangeLog@1.482.5.1 +1 -0 [Bug 1341] NMEA driver requires working PPSAPI #ifdef HAVE_PPSAPI. libntp/refnumtoa.c@1.7 +2 -5 do not require refnumtoa() callers to have called ISREFCLOCKADR() first ntpd/ntp_control.c@1.126 +1 -2 remove unneeded #ifdef REFCLOCK, ISREFCLOCKADR() is now always present and refnumtoa() has long been always present, even without REFCLOCK. ntpd/refclock_nmea.c@1.44 +73 -22 [Bug 1341] NMEA driver requires working PPSAPI #ifdef HAVE_PPSAPI. ChangeSet@1.2050.4.1, 2009-10-13 02:24:57+00:00, davehart@shiny.ad.hartbrothers.com Documentation updates for ntpq --oldrv, saveconfig, saveconfigdir, ntpd -I -L and -M switches and interface/nic directive ChangeLog@1.482.4.1 +2 -0 Update documentation for ntpq --old-rv, saveconfig, saveconfigdir, ntpd -I -L and -M, and interface/nic rules. (From Dave Hart) html/miscopt.html@1.51 +4 -2 Add saveconfigdir docs. Add wildcard match class to interface/nic docs. html/ntpd.html@1.50 +7 -3 Update -L docs, add -I html/ntpq.html@1.33 +5 -3 Add ntpq --old-rv docs. Update saveconfig docs to mention saveconfigdir. html/scripts/miscopt.txt@1.3 +1 -0 Add saveconfigdir ntpd/ntpdbase-opts.def@1.19 +14 -4 Update -L and -I docs to match HTML updates. Expand -M docs. ChangeSet@1.2050.3.1, 2009-10-12 15:24:02+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion. ChangeLog@1.482.3.1 +1 -0 [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion. lib/isc/win32/strerror.c@1.12 +7 -4 [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion. ports/winnt/include/config.h@1.78 +0 -3 [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion. ports/winnt/include/syslog.h@1.5 +3 -0 [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion. ports/winnt/libntp/syslog.c@1.7 +4 -10 [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion. ChangeSet@1.2050.1.2, 2009-10-12 03:40:08+00:00, kardel@pogo.udel.edu ntp_io.c, ChangeLog: cast address pointer to void * for bug 1337 ChangeLog@1.482.1.2 +1 -0 cast address pointer to void * for bug 1337 ntpd/ntp_io.c@1.305 +1 -1 cast address pointer to void * for bug 1337 ChangeSet@1.2050.2.2, 2009-10-11 22:09:53+00:00, davehart@shiny.ad.hartbrothers.com Fix build break --with-arlib and config.cache arlib/configure.in@1.2 +6 -7 Fix build break --with-arlib and config.cache ChangeSet@1.2050.2.1, 2009-10-11 19:27:05+00:00, davehart@shiny.ad.hartbrothers.com Construct ntpd keyword scanner finite state machine at compile time rather than at runtime, shrink entries from 40+ to 8 bytes. ChangeLog@1.482.2.1 +2 -0 Construct ntpd keyword scanner finite state machine at compile time rather than at runtime, shrink entries from 40+ to 8 bytes. bootstrap@1.27 +4 -0 touch new generated file ntp_keyword.h after ntp_parser.[ch] include/ntp_filegen.h@1.7 +11 -11 const is a virus ntpd/Makefile.am@1.74 +17 -4 add keyword-gen program which produces ntp_keyword.h ntpd/keyword-gen.c@1.1 +546 -0 new build-time tool to generate ntp_keyword.h with keyword scanner finite state machine and token text array. remove duplicate token table entries for "disable", "enable", "monitor", and "version". ntpd/keyword-gen.c@1.0 +0 -0 ntpd/ntp_config.c@1.229 +2 -10 remove references to create/delete_keyword_scanner() ntpd/ntp_filegen.c@1.17 +12 -14 const is a virus ntpd/ntp_keyword.h@1.1 +920 -0 generated by keyword-gen.c, contains keyword_text array and keyword scanner finite state machine. ntpd/ntp_keyword.h@1.0 +0 -0 ntpd/ntp_scanner.c@1.29 +26 -343 remove pieces to keyword-gen.c, new generated ntp_keyword.h ntpd/ntp_scanner.h@1.12 +19 -16 move struct key_tok to keyword-gen.c, add scan_state struct replacing previous struct state. add multiple-inclusion protection ports/winnt/vs2008/ntpd/ntpd.vcproj@1.21 +4 -0 add reference to ntp_keyword.h ChangeSet@1.2050.1.1, 2009-10-11 11:50:51+00:00, kardel@pogo.udel.edu ntp_io.c, ChangeLog: [Bug 1337] fix incorrect args to setsockopt(fd, IP_MULTICAST_IF,...) ChangeLog@1.482.1.1 +1 -0 [Bug 1337] fix incorrect args to setsockopt(fd, IP_MULTICAST_IF,...) ntpd/ntp_io.c@1.304 +1 -1 [Bug 1337] fix incorrect args to setsockopt(fd, IP_MULTICAST_IF,...) ChangeSet@1.2051, 2009-10-11 02:36:55+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1302] OpenSSL under Windows needs applink support. ChangeLog@1.483 +1 -0 [Bug 1302] OpenSSL under Windows needs applink support. ports/winnt/ntpd/ntservice.c@1.20 +54 -12 [Bug 1302] OpenSSL under Windows needs applink support. util/ntp-keygen.c@1.58 +7 -1 [Bug 1302] OpenSSL under Windows needs applink support. ChangeSet@1.2050, 2009-10-10 06:41:51-04:00, stenn@whimsy.udel.edu NTP_4_2_5P231_RC TAG: NTP_4_2_5P231_RC ChangeLog@1.482 +1 -0 NTP_4_2_5P231_RC ntpd/ntpd-opts.c@1.225 +2 -2 NTP_4_2_5P231_RC ntpd/ntpd-opts.h@1.225 +3 -3 NTP_4_2_5P231_RC ntpd/ntpd-opts.texi@1.223 +1 -1 NTP_4_2_5P231_RC ntpd/ntpd.1@1.223 +2 -2 NTP_4_2_5P231_RC ntpdc/ntpdc-opts.c@1.221 +2 -2 NTP_4_2_5P231_RC ntpdc/ntpdc-opts.h@1.221 +3 -3 NTP_4_2_5P231_RC ntpdc/ntpdc-opts.texi@1.220 +1 -1 NTP_4_2_5P231_RC ntpdc/ntpdc.1@1.220 +2 -2 NTP_4_2_5P231_RC ntpq/ntpq-opts.c@1.222 +2 -2 NTP_4_2_5P231_RC ntpq/ntpq-opts.h@1.222 +3 -3 NTP_4_2_5P231_RC ntpq/ntpq-opts.texi@1.221 +1 -1 NTP_4_2_5P231_RC ntpq/ntpq.1@1.221 +2 -2 NTP_4_2_5P231_RC ntpsnmpd/ntpsnmpd-opts.c@1.100 +2 -2 NTP_4_2_5P231_RC ntpsnmpd/ntpsnmpd-opts.h@1.100 +3 -3 NTP_4_2_5P231_RC ntpsnmpd/ntpsnmpd-opts.texi@1.100 +1 -1 NTP_4_2_5P231_RC ntpsnmpd/ntpsnmpd.1@1.100 +2 -2 NTP_4_2_5P231_RC packageinfo.sh@1.235 +1 -1 NTP_4_2_5P231_RC sntp/sntp-opts.c@1.94 +2 -2 NTP_4_2_5P231_RC sntp/sntp-opts.h@1.94 +3 -3 NTP_4_2_5P231_RC sntp/sntp-opts.texi@1.94 +1 -1 NTP_4_2_5P231_RC sntp/sntp.1@1.94 +2 -2 NTP_4_2_5P231_RC util/ntp-keygen-opts.c@1.224 +2 -2 NTP_4_2_5P231_RC util/ntp-keygen-opts.h@1.224 +3 -3 NTP_4_2_5P231_RC util/ntp-keygen-opts.texi@1.223 +1 -1 NTP_4_2_5P231_RC util/ntp-keygen.1@1.223 +2 -2 NTP_4_2_5P231_RC ChangeSet@1.2049, 2009-10-09 17:15:23+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1335] Broadcast client degraded by wildcard default change. ChangeLog@1.481 +1 -0 [Bug 1335] Broadcast client degraded by wildcard default change. ntpd/ntp_io.c@1.303 +16 -3 default wildcard addresses to drop, exclude from "all" match class ChangeSet@1.2048, 2009-10-09 02:25:40-04:00, stenn@whimsy.udel.edu NTP_4_2_5P230_RC TAG: NTP_4_2_5P230_RC ChangeLog@1.480 +1 -0 NTP_4_2_5P230_RC ntpd/ntpd-opts.c@1.224 +2 -2 NTP_4_2_5P230_RC ntpd/ntpd-opts.h@1.224 +3 -3 NTP_4_2_5P230_RC ntpd/ntpd-opts.texi@1.222 +1 -1 NTP_4_2_5P230_RC ntpd/ntpd.1@1.222 +2 -2 NTP_4_2_5P230_RC ntpdc/ntpdc-opts.c@1.220 +2 -2 NTP_4_2_5P230_RC ntpdc/ntpdc-opts.h@1.220 +3 -3 NTP_4_2_5P230_RC ntpdc/ntpdc-opts.texi@1.219 +1 -1 NTP_4_2_5P230_RC ntpdc/ntpdc.1@1.219 +2 -2 NTP_4_2_5P230_RC ntpq/ntpq-opts.c@1.221 +2 -2 NTP_4_2_5P230_RC ntpq/ntpq-opts.h@1.221 +3 -3 NTP_4_2_5P230_RC ntpq/ntpq-opts.texi@1.220 +1 -1 NTP_4_2_5P230_RC ntpq/ntpq.1@1.220 +2 -2 NTP_4_2_5P230_RC ntpsnmpd/ntpsnmpd-opts.c@1.99 +2 -2 NTP_4_2_5P230_RC ntpsnmpd/ntpsnmpd-opts.h@1.99 +3 -3 NTP_4_2_5P230_RC ntpsnmpd/ntpsnmpd-opts.texi@1.99 +1 -1 NTP_4_2_5P230_RC ntpsnmpd/ntpsnmpd.1@1.99 +2 -2 NTP_4_2_5P230_RC packageinfo.sh@1.234 +1 -1 NTP_4_2_5P230_RC sntp/sntp-opts.c@1.93 +2 -2 NTP_4_2_5P230_RC sntp/sntp-opts.h@1.93 +3 -3 NTP_4_2_5P230_RC sntp/sntp-opts.texi@1.93 +1 -1 NTP_4_2_5P230_RC sntp/sntp.1@1.93 +2 -2 NTP_4_2_5P230_RC util/ntp-keygen-opts.c@1.223 +2 -2 NTP_4_2_5P230_RC util/ntp-keygen-opts.h@1.223 +3 -3 NTP_4_2_5P230_RC util/ntp-keygen-opts.texi@1.222 +1 -1 NTP_4_2_5P230_RC util/ntp-keygen.1@1.222 +2 -2 NTP_4_2_5P230_RC ChangeSet@1.2047, 2009-10-08 23:54:02-04:00, stenn@whimsy.udel.edu Start the 4.2.6 Release Candidate cycle ChangeLog@1.479 +1 -0 Start the 4.2.6 Release Candidate cycle packageinfo.sh@1.233 +2 -2 Start the 4.2.6 Release Candidate cycle ChangeSet@1.2046, 2009-10-08 19:48:15-04:00, stenn@whimsy.udel.edu Broadcast and transit phase cleanup from Dave Mills ChangeLog@1.478 +1 -0 Broadcast and transit phase cleanup from Dave Mills ntpd/ntp_crypto.c@1.141 +2 -2 Broadcast and transit phase cleanup from Dave Mills ntpd/ntp_proto.c@1.296 +7 -1 Broadcast and transit phase cleanup from Dave Mills ChangeSet@1.2045, 2009-10-07 06:41:31-04:00, stenn@whimsy.udel.edu NTP_4_2_5P229 TAG: NTP_4_2_5P229 ChangeLog@1.477 +1 -0 NTP_4_2_5P229 ntpd/ntpd-opts.c@1.223 +2 -2 NTP_4_2_5P229 ntpd/ntpd-opts.h@1.223 +3 -3 NTP_4_2_5P229 ntpd/ntpd-opts.texi@1.221 +4 -2 NTP_4_2_5P229 ntpd/ntpd.1@1.221 +2 -2 NTP_4_2_5P229 ntpdc/ntpdc-opts.c@1.219 +2 -2 NTP_4_2_5P229 ntpdc/ntpdc-opts.h@1.219 +3 -3 NTP_4_2_5P229 ntpdc/ntpdc-opts.texi@1.218 +2 -2 NTP_4_2_5P229 ntpdc/ntpdc.1@1.218 +2 -2 NTP_4_2_5P229 ntpq/ntpq-opts.c@1.220 +2 -2 NTP_4_2_5P229 ntpq/ntpq-opts.h@1.220 +3 -3 NTP_4_2_5P229 ntpq/ntpq-opts.texi@1.219 +7 -3 NTP_4_2_5P229 ntpq/ntpq.1@1.219 +2 -2 NTP_4_2_5P229 ntpsnmpd/ntpsnmpd-opts.c@1.98 +2 -2 NTP_4_2_5P229 ntpsnmpd/ntpsnmpd-opts.h@1.98 +3 -3 NTP_4_2_5P229 ntpsnmpd/ntpsnmpd-opts.texi@1.98 +1 -1 NTP_4_2_5P229 ntpsnmpd/ntpsnmpd.1@1.98 +2 -2 NTP_4_2_5P229 packageinfo.sh@1.232 +1 -1 NTP_4_2_5P229 sntp/sntp-opts.c@1.92 +2 -2 NTP_4_2_5P229 sntp/sntp-opts.h@1.92 +3 -3 NTP_4_2_5P229 sntp/sntp-opts.texi@1.92 +2 -2 NTP_4_2_5P229 sntp/sntp.1@1.92 +2 -2 NTP_4_2_5P229 util/ntp-keygen-opts.c@1.222 +2 -2 NTP_4_2_5P229 util/ntp-keygen-opts.h@1.222 +3 -3 NTP_4_2_5P229 util/ntp-keygen-opts.texi@1.221 +2 -2 NTP_4_2_5P229 util/ntp-keygen.1@1.221 +2 -2 NTP_4_2_5P229 ChangeSet@1.1436.15.71, 2009-10-07 01:33:22+00:00, davehart@shiny.ad.hartbrothers.com [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. ChangeLog@1.1.1.91 +4 -0 [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. ntpd/ntp_request.c@1.65.1.3 +9 -2 [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. ChangeSet@1.2044, 2009-10-06 15:37:07+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'. Change ntpsnmpd/Makefile.am include file order to fix FreeBSD build. ChangeLog@1.476 +2 -0 [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'. Change ntpsnmpd/Makefile.am include file order to fix FreeBSD build. ntpq/ntpq-subs.c@1.39 +1 -1 [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'. ntpq/ntpq.c@1.94 +11 -0 [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'. ntpq/ntpq.h@1.10 +1 -0 [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'. ntpsnmpd/Makefile.am@1.11 +1 -1 list $(LIBOPTS_CFLAGS) ahead of @SNMP_CPPFLAGS@ to pick up our copy of autoopts/options.h ahead of any on the generous include search path in @SNMP_CPPFLAGS@ ChangeSet@1.2043, 2009-10-06 04:55:16-04:00, stenn@whimsy.udel.edu NTP_4_2_5P228 TAG: NTP_4_2_5P228 ChangeLog@1.475 +1 -0 NTP_4_2_5P228 ntpd/ntpd-opts.c@1.222 +2 -2 NTP_4_2_5P228 ntpd/ntpd-opts.h@1.222 +3 -3 NTP_4_2_5P228 ntpd/ntpd-opts.texi@1.220 +1 -1 NTP_4_2_5P228 ntpd/ntpd.1@1.220 +2 -2 NTP_4_2_5P228 ntpdc/ntpdc-opts.c@1.218 +2 -2 NTP_4_2_5P228 ntpdc/ntpdc-opts.h@1.218 +3 -3 NTP_4_2_5P228 ntpdc/ntpdc-opts.texi@1.217 +1 -1 NTP_4_2_5P228 ntpdc/ntpdc.1@1.217 +2 -2 NTP_4_2_5P228 ntpq/ntpq-opts.c@1.219 +2 -2 NTP_4_2_5P228 ntpq/ntpq-opts.h@1.219 +3 -3 NTP_4_2_5P228 ntpq/ntpq-opts.texi@1.218 +1 -1 NTP_4_2_5P228 ntpq/ntpq.1@1.218 +2 -2 NTP_4_2_5P228 ntpsnmpd/ntpsnmpd-opts.c@1.97 +2 -2 NTP_4_2_5P228 ntpsnmpd/ntpsnmpd-opts.h@1.97 +3 -3 NTP_4_2_5P228 ntpsnmpd/ntpsnmpd-opts.texi@1.97 +1 -1 NTP_4_2_5P228 ntpsnmpd/ntpsnmpd.1@1.97 +2 -2 NTP_4_2_5P228 packageinfo.sh@1.231 +1 -1 NTP_4_2_5P228 sntp/sntp-opts.c@1.91 +2 -2 NTP_4_2_5P228 sntp/sntp-opts.h@1.91 +3 -3 NTP_4_2_5P228 sntp/sntp-opts.texi@1.91 +1 -1 NTP_4_2_5P228 sntp/sntp.1@1.91 +2 -2 NTP_4_2_5P228 util/ntp-keygen-opts.c@1.221 +2 -2 NTP_4_2_5P228 util/ntp-keygen-opts.h@1.221 +3 -3 NTP_4_2_5P228 util/ntp-keygen-opts.texi@1.220 +1 -1 NTP_4_2_5P228 util/ntp-keygen.1@1.220 +2 -2 NTP_4_2_5P228 ChangeSet@1.2042, 2009-10-06 06:48:31+00:00, davehart@shiny.ad.hartbrothers.com Reclaim syntax tree memory after application in ntpd built with configure --disable-saveconfig. ChangeLog@1.474 +2 -0 Reclaim syntax tree memory after application in ntpd built with configure --disable-saveconfig. include/ntp_config.h@1.65 +10 -0 Reclaim syntax tree memory after application in ntpd built with configure --disable-saveconfig. ntpd/ntp_config.c@1.228 +57 -43 Reclaim syntax tree memory after application in ntpd built with configure --disable-saveconfig. ChangeSet@1.2039.1.1, 2009-10-06 03:49:05+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1135] ntpq uses sizeof(u_long) where sizeof(u_int32) is meant. add new file ntpd/complete.conf to ntpd/Makefile.am EXTRA_DIST ChangeLog@1.471.1.1 +2 -1 [Bug 1135] ntpq uses sizeof(u_long) where sizeof(u_int32) is meant. wrap [Bug 1327] line at 72 chars Makefile.am@1.86 +1 -1 run distcheck configure with -C so arlib, sntp configure runs benefit from top-level configure.cache ntpd/Makefile.am@1.73 +6 -2 add new file ntpd/complete.conf to ntpd/Makefile.am EXTRA_DIST ntpq/ntpq.c@1.93 +16 -17 [Bug 1135] ntpq uses sizeof(u_long) where sizeof(u_int32) is meant. ChangeSet@1.2040, 2009-10-05 16:34:09+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1333] ntpd --interface precedence over --novirtualips lost. ChangeLog@1.472 +1 -0 [Bug 1333] ntpd --interface precedence over --novirtualips lost. ntpd/ntp_io.c@1.302 +39 -26 [Bug 1333] ntpd --interface precedence over --novirtualips lost. ChangeSet@1.2039, 2009-10-05 07:45:16-04:00, stenn@whimsy.udel.edu NTP_4_2_5P227 TAG: NTP_4_2_5P227 ChangeLog@1.471 +1 -0 NTP_4_2_5P227 ntpd/ntpd-opts.c@1.221 +2 -2 NTP_4_2_5P227 ntpd/ntpd-opts.h@1.221 +3 -3 NTP_4_2_5P227 ntpd/ntpd-opts.texi@1.219 +1 -1 NTP_4_2_5P227 ntpd/ntpd.1@1.219 +2 -2 NTP_4_2_5P227 ntpdc/ntpdc-opts.c@1.217 +2 -2 NTP_4_2_5P227 ntpdc/ntpdc-opts.h@1.217 +3 -3 NTP_4_2_5P227 ntpdc/ntpdc-opts.texi@1.216 +1 -1 NTP_4_2_5P227 ntpdc/ntpdc.1@1.216 +2 -2 NTP_4_2_5P227 ntpq/ntpq-opts.c@1.218 +3 -3 NTP_4_2_5P227 ntpq/ntpq-opts.h@1.218 +4 -4 NTP_4_2_5P227 ntpq/ntpq-opts.texi@1.217 +3 -3 NTP_4_2_5P227 ntpq/ntpq.1@1.217 +2 -2 NTP_4_2_5P227 ntpsnmpd/ntpsnmpd-opts.c@1.96 +2 -2 NTP_4_2_5P227 ntpsnmpd/ntpsnmpd-opts.h@1.96 +3 -3 NTP_4_2_5P227 ntpsnmpd/ntpsnmpd-opts.texi@1.96 +1 -1 NTP_4_2_5P227 ntpsnmpd/ntpsnmpd.1@1.96 +2 -2 NTP_4_2_5P227 packageinfo.sh@1.230 +1 -1 NTP_4_2_5P227 sntp/sntp-opts.c@1.90 +2 -2 NTP_4_2_5P227 sntp/sntp-opts.h@1.90 +3 -3 NTP_4_2_5P227 sntp/sntp-opts.texi@1.90 +1 -1 NTP_4_2_5P227 sntp/sntp.1@1.90 +2 -2 NTP_4_2_5P227 util/ntp-keygen-opts.c@1.220 +2 -2 NTP_4_2_5P227 util/ntp-keygen-opts.h@1.220 +3 -3 NTP_4_2_5P227 util/ntp-keygen-opts.texi@1.219 +1 -1 NTP_4_2_5P227 util/ntp-keygen.1@1.219 +2 -2 NTP_4_2_5P227 ChangeSet@1.2038, 2009-10-05 07:29:55+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1135] :config fails with "Server disallowed request" ChangeLog@1.470 +1 -0 [Bug 1135] :config fails with "Server disallowed request" ntpd/ntp_control.c@1.125 +1 -1 [Bug 1135] :config fails with "Server disallowed request" ChangeSet@1.2037, 2009-10-05 06:35:21+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1332] ntpq -c 'rv 0 variablename' returns extra stuff. add ntpq --old-rv fix ipv4/ipv6 which are not equivalent in the libopts sense ChangeLog@1.469 +1 -0 [Bug 1332] ntpq -c 'rv 0 variablename' returns extra stuff. ntpq/ntpq-opts.c@1.217 +39 -10 autogen output ntpq/ntpq-opts.def@1.14 +16 -2 add ntpq --old-rv fix ipv4/ipv6 which are not equivalent in the libopts sense ntpq/ntpq-opts.h@1.217 +15 -10 autogen output ntpq/ntpq-opts.texi@1.216 +21 -5 autogen output ntpq/ntpq-subs.c@1.38 +38 -21 [Bug 1332] ntpq -c 'rv 0 variablename' returns extra stuff. add ntpq --old-rv ntpq/ntpq.1@1.216 +17 -4 autogen output ntpq/ntpq.c@1.92 +22 -25 [Bug 1332] ntpq -c 'rv 0 variablename' returns extra stuff. ntpq/ntpq.h@1.9 +1 -1 [Bug 1332] ntpq -c 'rv 0 variablename' returns extra stuff. ChangeSet@1.2032.1.1, 2009-10-04 18:35:23-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Hart/Dave Mills ChangeLog@1.465.1.1 +1 -0 Documentation updates from Dave Hart/Dave Mills html/clockopt.html@1.22 +7 -5 Documentation updates from Dave Hart/Dave Mills html/miscopt.html@1.50 +32 -35 Documentation updates from Dave Hart/Dave Mills ChangeSet@1.2035, 2009-10-04 22:17:11+00:00, davehart@shiny.ad.hartbrothers.com actually ignore nic/interface via :config with -I or -L, saying so isn't enough. ntpd/ntp_config.c@1.227 +2 -0 actually ignore nic/interface via :config with -I or -L, saying so isn't enough. ChangeSet@1.2034, 2009-10-04 20:28:52+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1330] disallow interface/nic rules when --novirtualips or --interface are used. ChangeLog@1.467 +4 -2 [Bug 1330] disallow interface/nic rules when --novirtualips or --interface are used. add missing "* " prefix to 1318, 1327 entries ntpd/ntp_config.c@1.226 +12 -1 [Bug 1330] disallow interface/nic rules when --novirtualips or --interface are used. ChangeSet@1.2033, 2009-10-04 18:14:14+00:00, davehart@shiny.ad.hartbrothers.com Add test of ntpd --saveconfigquit fidelity using new complete.conf. ChangeLog@1.466 +1 -0 Add test of ntpd --saveconfigquit fidelity using new complete.conf. configure.ac@1.459 +3 -0 make "if SAVECONFIG_ENABLED" work in ntpd/Makefile.am ntpd/Makefile.am@1.72 +14 -1 add check_saveconfig target and list in check-local: to validate --saveconfigquit produces the same configuration it is given. ntpd/complete.conf@1.1 +54 -0 This file represents an attempt to hit every keyword and syntax nook ntpd/complete.conf@1.0 +0 -0 ntpd/ntp_config.c@1.225 +39 -19 move --saveconfigquit handling to before application of initial syntax tree ntpdc/Makefile.am@1.43 +1 -1 correct reference to $(srcdir)/layout.std ChangeSet@1.2032, 2009-10-04 07:49:28-04:00, stenn@whimsy.udel.edu NTP_4_2_5P226 TAG: NTP_4_2_5P226 ChangeLog@1.465 +1 -0 NTP_4_2_5P226 ntpd/ntpd-opts.c@1.220 +3 -3 NTP_4_2_5P226 ntpd/ntpd-opts.h@1.220 +4 -4 NTP_4_2_5P226 ntpd/ntpd-opts.texi@1.218 +1 -1 NTP_4_2_5P226 ntpd/ntpd.1@1.218 +2 -2 NTP_4_2_5P226 ntpdc/ntpdc-opts.c@1.216 +3 -3 NTP_4_2_5P226 ntpdc/ntpdc-opts.h@1.216 +4 -4 NTP_4_2_5P226 ntpdc/ntpdc-opts.texi@1.215 +3 -3 NTP_4_2_5P226 ntpdc/ntpdc.1@1.215 +2 -2 NTP_4_2_5P226 ntpq/ntpq-opts.c@1.216 +3 -3 NTP_4_2_5P226 ntpq/ntpq-opts.h@1.216 +4 -4 NTP_4_2_5P226 ntpq/ntpq-opts.texi@1.215 +3 -3 NTP_4_2_5P226 ntpq/ntpq.1@1.215 +2 -2 NTP_4_2_5P226 ntpsnmpd/ntpsnmpd-opts.c@1.95 +2 -2 NTP_4_2_5P226 ntpsnmpd/ntpsnmpd-opts.h@1.95 +3 -3 NTP_4_2_5P226 ntpsnmpd/ntpsnmpd-opts.texi@1.95 +1 -1 NTP_4_2_5P226 ntpsnmpd/ntpsnmpd.1@1.95 +2 -2 NTP_4_2_5P226 packageinfo.sh@1.229 +1 -1 NTP_4_2_5P226 sntp/sntp-opts.c@1.89 +2 -2 NTP_4_2_5P226 sntp/sntp-opts.h@1.89 +3 -3 NTP_4_2_5P226 sntp/sntp-opts.texi@1.89 +2 -2 NTP_4_2_5P226 sntp/sntp.1@1.89 +2 -2 NTP_4_2_5P226 util/ntp-keygen-opts.c@1.219 +3 -3 NTP_4_2_5P226 util/ntp-keygen-opts.h@1.219 +4 -4 NTP_4_2_5P226 util/ntp-keygen-opts.texi@1.218 +3 -3 NTP_4_2_5P226 util/ntp-keygen.1@1.218 +2 -2 NTP_4_2_5P226 ChangeSet@1.2029.1.2, 2009-10-03 01:26:37-04:00, stenn@whimsy.udel.edu Clockhop and autokey cleanup from Dave Mills ChangeLog@1.462.1.2 +1 -0 Clockhop and autokey cleanup from Dave Mills include/ntp.h@1.165 +1 -1 Clockhop and autokey cleanup from Dave Mills libntp/statestr.c@1.19 +3 -3 Clockhop and autokey cleanup from Dave Mills ntpd/ntp_crypto.c@1.140 +8 -10 Clockhop and autokey cleanup from Dave Mills ntpd/ntp_proto.c@1.295 +10 -9 Clockhop and autokey cleanup from Dave Mills ChangeSet@1.2029.1.1, 2009-10-03 01:19:40-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.462.1.1 +1 -0 Documentation updates from Dave Mills html/accopt.html@1.33 +6 -6 Documentation updates from Dave Mills html/assoc.html@1.29 +8 -2 Documentation updates from Dave Mills ChangeSet@1.2030, 2009-10-03 05:13:07+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1318] Allow multiple -g options on ntpd command line. [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure --disable-debugging. Add ntpd --saveconfigquit option for future build-time testing of saveconfig fidelity. ChangeLog@1.463 +5 -0 [Bug 1318] Allow multiple -g options on ntpd command line. [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure --disable-debugging. Add ntpd --saveconfigquit option for future build-time testing of saveconfig fidelity. configure.ac@1.458 +3 -3 [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure --disable-debugging. include/debug-opt.def@1.5 +0 -2 [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure --disable-debugging. include/ntp_config.h@1.64 +2 -2 add comment parameter to dump_config_tree() and dump_all_config_trees() libntp/Makefile.am@1.46 +3 -9 remove as much whitespace as possible from -I include dir sequence to keep the signal-to-noise ratio higher on BSD make, which leaves tabs in the constructed gcc command lines. libparse/Makefile.am@1.15 +13 -15 convert leading spaces to tabs. remove as much whitespace as possible from -I include dir sequence to keep the signal-to-noise ratio higher on BSD make, which leaves tabs in the constructed gcc command lines. ntpd/Makefile.am@1.71 +87 -39 remove as much whitespace as possible from -I include dir sequence to keep the signal-to-noise ratio higher on BSD make, which leaves tabs in the constructed gcc command lines. [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure --disable-debugging. ntpd/ntp_config.c@1.224 +41 -17 Add ntpd --saveconfigquit option for future build-time testing of saveconfig fidelity. ntpd/ntp_control.c@1.124 +1 -1 Add ntpd --saveconfigquit option for future build-time testing of saveconfig fidelity. ntpd/ntp_io.c@1.301 +2 -1 Add ntpd --saveconfigquit option for future build-time testing of saveconfig fidelity. ntpd/ntpd-opts.c@1.219 +55 -24 autogen output ntpd/ntpd-opts.h@1.219 +28 -19 autogen output ntpd/ntpd-opts.texi@1.217 +26 -2 autogen output ntpd/ntpd.1@1.217 +10 -2 autogen output ntpd/ntpd.c@1.109 +36 -28 ntpdsim --help was crashing due to failure to init autoopts. Add ntpd --saveconfigquit option for future build-time testing of saveconfig fidelity. ntpd/ntpdbase-opts.def@1.18 +46 -1 [Bug 1318] Allow multiple -g options on ntpd command line. [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure --disable-debugging. Add ntpd --saveconfigquit option for future build-time testing of saveconfig fidelity. ntpdate/Makefile.am@1.19 +5 -5 remove as much whitespace as possible from -I include dir sequence to keep the signal-to-noise ratio higher on BSD make, which leaves tabs in the constructed gcc command lines. ntpdc/Makefile.am@1.42 +3 -6 remove as much whitespace as possible from -I include dir sequence to keep the signal-to-noise ratio higher on BSD make, which leaves tabs in the constructed gcc command lines. ntpdc/ntpdc-opts.c@1.215 +5 -30 autogen output ntpdc/ntpdc-opts.h@1.215 +2 -6 autogen output ntpdc/ntpdc-opts.texi@1.214 +4 -8 autogen output ntpdc/ntpdc.1@1.214 +2 -2 autogen output ntpq/Makefile.am@1.36 +5 -6 remove as much whitespace as possible from -I include dir sequence to keep the signal-to-noise ratio higher on BSD make, which leaves tabs in the constructed gcc command lines. ntpq/ntpq-opts.c@1.215 +5 -30 autogen output ntpq/ntpq-opts.h@1.215 +2 -6 autogen output ntpq/ntpq-opts.texi@1.214 +4 -8 autogen output ntpq/ntpq.1@1.214 +2 -2 autogen output ntpsnmpd/Makefile.am@1.10 +7 -10 ntpsnmpd-opts.def doesn't include debug-opt.def. remove as much whitespace as possible from -I include dir sequence to keep the signal-to-noise ratio higher on BSD make, which leaves tabs in the constructed gcc command lines. parseutil/Makefile.am@1.10 +5 -5 remove as much whitespace as possible from -I include dir sequence to keep the signal-to-noise ratio higher on BSD make, which leaves tabs in the constructed gcc command lines. ports/winnt/ntpd/ntservice.c@1.19 +7 -1 recognize alternate spellings of option names in win32 service startup hack ports/winnt/vs2008/libntp/libntp.vcproj@1.20 +6 -2 add reference to ntp_md5.h sntp/Makefile.am@1.13 +5 -6 remove as much whitespace as possible from -I include dir sequence to keep the signal-to-noise ratio higher on BSD make, which leaves tabs in the constructed gcc command lines. util/Makefile.am@1.41 +4 -6 remove as much whitespace as possible from -I include dir sequence to keep the signal-to-noise ratio higher on BSD make, which leaves tabs in the constructed gcc command lines. util/ntp-keygen-opts.c@1.218 +5 -30 autogen output util/ntp-keygen-opts.h@1.218 +2 -6 autogen output util/ntp-keygen-opts.texi@1.217 +4 -8 autogen output util/ntp-keygen.1@1.217 +2 -2 autogen output ChangeSet@1.2029, 2009-09-30 07:43:31-04:00, stenn@whimsy.udel.edu NTP_4_2_5P225 TAG: NTP_4_2_5P225 ChangeLog@1.462 +1 -0 NTP_4_2_5P225 ntpd/ntpd-opts.c@1.218 +2 -2 NTP_4_2_5P225 ntpd/ntpd-opts.h@1.218 +3 -3 NTP_4_2_5P225 ntpd/ntpd-opts.texi@1.216 +1 -1 NTP_4_2_5P225 ntpd/ntpd.1@1.216 +2 -2 NTP_4_2_5P225 ntpdc/ntpdc-opts.c@1.214 +2 -2 NTP_4_2_5P225 ntpdc/ntpdc-opts.h@1.214 +3 -3 NTP_4_2_5P225 ntpdc/ntpdc-opts.texi@1.213 +1 -1 NTP_4_2_5P225 ntpdc/ntpdc.1@1.213 +2 -2 NTP_4_2_5P225 ntpq/ntpq-opts.c@1.214 +2 -2 NTP_4_2_5P225 ntpq/ntpq-opts.h@1.214 +3 -3 NTP_4_2_5P225 ntpq/ntpq-opts.texi@1.213 +1 -1 NTP_4_2_5P225 ntpq/ntpq.1@1.213 +2 -2 NTP_4_2_5P225 ntpsnmpd/ntpsnmpd-opts.c@1.94 +2 -2 NTP_4_2_5P225 ntpsnmpd/ntpsnmpd-opts.h@1.94 +3 -3 NTP_4_2_5P225 ntpsnmpd/ntpsnmpd-opts.texi@1.94 +1 -1 NTP_4_2_5P225 ntpsnmpd/ntpsnmpd.1@1.94 +2 -2 NTP_4_2_5P225 packageinfo.sh@1.228 +1 -1 NTP_4_2_5P225 sntp/sntp-opts.c@1.88 +2 -2 NTP_4_2_5P225 sntp/sntp-opts.h@1.88 +3 -3 NTP_4_2_5P225 sntp/sntp-opts.texi@1.88 +1 -1 NTP_4_2_5P225 sntp/sntp.1@1.88 +2 -2 NTP_4_2_5P225 util/ntp-keygen-opts.c@1.217 +2 -2 NTP_4_2_5P225 util/ntp-keygen-opts.h@1.217 +3 -3 NTP_4_2_5P225 util/ntp-keygen-opts.texi@1.216 +1 -1 NTP_4_2_5P225 util/ntp-keygen.1@1.216 +2 -2 NTP_4_2_5P225 ChangeSet@1.2026.1.1, 2009-09-30 06:32:09+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1324] support bracketed IPv6 numeric addresses for restrict. ChangeLog@1.459.1.1 +1 -0 [Bug 1324] support bracketed IPv6 numeric addresses for restrict. ntpd/ntp_config.c@1.223 +73 -43 [Bug 1324] support bracketed IPv6 numeric addresses for restrict. ntpd/ntp_io.c@1.300 +13 -7 [Bug 1324] support bracketed IPv6 numeric addresses for restrict. ChangeSet@1.2027, 2009-09-30 02:10:49-04:00, stenn@whimsy.udel.edu authopt documentation changes from Dave Mills/Dave Hart ChangeLog@1.460 +1 -0 authopt documentation changes from Dave Mills/Dave Hart html/authopt.html@1.52 +2 -2 authopt documentation changes from Dave Mills/Dave Hart html/scripts/authopt.txt@1.2 +3 -4 authopt documentation changes from Dave Mills/Dave Hart ChangeSet@1.2026, 2009-09-29 07:44:52-04:00, stenn@whimsy.udel.edu NTP_4_2_5P224 TAG: NTP_4_2_5P224 ChangeLog@1.459 +1 -0 NTP_4_2_5P224 ntpd/ntpd-opts.c@1.217 +2 -2 NTP_4_2_5P224 ntpd/ntpd-opts.h@1.217 +3 -3 NTP_4_2_5P224 ntpd/ntpd-opts.texi@1.215 +1 -1 NTP_4_2_5P224 ntpd/ntpd.1@1.215 +2 -2 NTP_4_2_5P224 ntpdc/ntpdc-opts.c@1.213 +2 -2 NTP_4_2_5P224 ntpdc/ntpdc-opts.h@1.213 +3 -3 NTP_4_2_5P224 ntpdc/ntpdc-opts.texi@1.212 +1 -1 NTP_4_2_5P224 ntpdc/ntpdc.1@1.212 +2 -2 NTP_4_2_5P224 ntpq/ntpq-opts.c@1.213 +2 -2 NTP_4_2_5P224 ntpq/ntpq-opts.h@1.213 +3 -3 NTP_4_2_5P224 ntpq/ntpq-opts.texi@1.212 +1 -1 NTP_4_2_5P224 ntpq/ntpq.1@1.212 +2 -2 NTP_4_2_5P224 ntpsnmpd/ntpsnmpd-opts.c@1.93 +2 -2 NTP_4_2_5P224 ntpsnmpd/ntpsnmpd-opts.h@1.93 +3 -3 NTP_4_2_5P224 ntpsnmpd/ntpsnmpd-opts.texi@1.93 +1 -1 NTP_4_2_5P224 ntpsnmpd/ntpsnmpd.1@1.93 +2 -2 NTP_4_2_5P224 packageinfo.sh@1.227 +1 -1 NTP_4_2_5P224 sntp/sntp-opts.c@1.87 +2 -2 NTP_4_2_5P224 sntp/sntp-opts.h@1.87 +3 -3 NTP_4_2_5P224 sntp/sntp-opts.texi@1.87 +1 -1 NTP_4_2_5P224 sntp/sntp.1@1.87 +2 -2 NTP_4_2_5P224 util/ntp-keygen-opts.c@1.216 +2 -2 NTP_4_2_5P224 util/ntp-keygen-opts.h@1.216 +3 -3 NTP_4_2_5P224 util/ntp-keygen-opts.texi@1.215 +1 -1 NTP_4_2_5P224 util/ntp-keygen.1@1.215 +2 -2 NTP_4_2_5P224 ChangeSet@1.2025, 2009-09-29 06:38:31+00:00, davehart@shiny.ad.hartbrothers.com Remove "tos maxhop" ntp.conf knob. ChangeLog@1.458 +1 -0 Remove "tos maxhop" ntp.conf knob. ntpd/ntp_parser.c@1.51 +888 -902 Bison output from ntp_parser.y ntpd/ntp_parser.h@1.31 +175 -177 Bison output from ntp_parser.y ntpd/ntp_parser.y@1.46 +0 -3 Remove "tos maxhop" ntp.conf knob. ntpd/ntp_scanner.c@1.28 +0 -1 Remove "tos maxhop" ntp.conf knob. ChangeSet@1.2024, 2009-09-28 22:36:59-04:00, stenn@whimsy.udel.edu Clockhop and documentation fixes from Dave Mills ChangeLog@1.457 +1 -0 Clockhop and documentation fixes from Dave Mills html/confopt.html@1.47 +1 -3 Clockhop and documentation fixes from Dave Mills html/copyright.html@1.44 +7 -4 Clockhop and documentation fixes from Dave Mills html/decode.html@1.11 +6 -1 Clockhop and documentation fixes from Dave Mills html/miscopt.html@1.49 +7 -2 Clockhop and documentation fixes from Dave Mills include/ntp.h@1.164 +1 -0 Clockhop and documentation fixes from Dave Mills libntp/statestr.c@1.18 +1 -0 Clockhop and documentation fixes from Dave Mills ntpd/ntp_config.c@1.222 +0 -5 Clockhop and documentation fixes from Dave Mills ntpd/ntp_proto.c@1.294 +49 -31 Clockhop and documentation fixes from Dave Mills ChangeSet@1.2023, 2009-09-28 07:43:25-04:00, stenn@whimsy.udel.edu NTP_4_2_5P223 TAG: NTP_4_2_5P223 ChangeLog@1.456 +1 -0 NTP_4_2_5P223 ntpd/ntpd-opts.c@1.216 +2 -2 NTP_4_2_5P223 ntpd/ntpd-opts.h@1.216 +3 -3 NTP_4_2_5P223 ntpd/ntpd-opts.texi@1.214 +1 -1 NTP_4_2_5P223 ntpd/ntpd.1@1.214 +2 -2 NTP_4_2_5P223 ntpdc/ntpdc-opts.c@1.212 +2 -2 NTP_4_2_5P223 ntpdc/ntpdc-opts.h@1.212 +3 -3 NTP_4_2_5P223 ntpdc/ntpdc-opts.texi@1.211 +1 -1 NTP_4_2_5P223 ntpdc/ntpdc.1@1.211 +2 -2 NTP_4_2_5P223 ntpq/ntpq-opts.c@1.212 +2 -2 NTP_4_2_5P223 ntpq/ntpq-opts.h@1.212 +3 -3 NTP_4_2_5P223 ntpq/ntpq-opts.texi@1.211 +1 -1 NTP_4_2_5P223 ntpq/ntpq.1@1.211 +2 -2 NTP_4_2_5P223 ntpsnmpd/ntpsnmpd-opts.c@1.92 +2 -2 NTP_4_2_5P223 ntpsnmpd/ntpsnmpd-opts.h@1.92 +3 -3 NTP_4_2_5P223 ntpsnmpd/ntpsnmpd-opts.texi@1.92 +1 -1 NTP_4_2_5P223 ntpsnmpd/ntpsnmpd.1@1.92 +2 -2 NTP_4_2_5P223 packageinfo.sh@1.226 +1 -1 NTP_4_2_5P223 sntp/sntp-opts.c@1.86 +2 -2 NTP_4_2_5P223 sntp/sntp-opts.h@1.86 +3 -3 NTP_4_2_5P223 sntp/sntp-opts.texi@1.86 +1 -1 NTP_4_2_5P223 sntp/sntp.1@1.86 +2 -2 NTP_4_2_5P223 util/ntp-keygen-opts.c@1.215 +2 -2 NTP_4_2_5P223 util/ntp-keygen-opts.h@1.215 +3 -3 NTP_4_2_5P223 util/ntp-keygen-opts.texi@1.214 +1 -1 NTP_4_2_5P223 util/ntp-keygen.1@1.214 +2 -2 NTP_4_2_5P223 ChangeSet@1.2020.1.1, 2009-09-28 00:58:51+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1323] Implement "revoke #" to match documentation, deprecate "crypto revoke #". ChangeLog@1.453.1.1 +2 -0 [Bug 1323] Implement "revoke #" to match documentation, deprecate "crypto revoke #". ntpd/ntp_config.c@1.221 +4 -4 [Bug 1323] Implement "revoke #" to match documentation, deprecate "crypto revoke #". ntpd/ntp_parser.c@1.50 +675 -661 Bison output from ntp_parser.y ntpd/ntp_parser.y@1.45 +6 -0 [Bug 1323] Implement "revoke #" to match documentation, deprecate "crypto revoke #". ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.8 +2 -2 fix lingering references to $(OPENSSL)\lib to $(OPENSSL_LIB) ports/winnt/vs2008/ntpd/ntpd.vcproj@1.20 +2 -2 fix lingering references to $(OPENSSL)\lib to $(OPENSSL_LIB) ChangeSet@1.2021, 2009-09-27 20:24:13+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1321] build doesn't work if . isn't on $PATH. ChangeLog@1.454 +1 -0 [Bug 1321] build doesn't work if . isn't on $PATH. build@1.31 +6 -1 [Bug 1321] build doesn't work if . isn't on $PATH. ChangeSet@1.2020, 2009-09-27 15:31:58-04:00, stenn@whimsy.udel.edu Hold off on the .deps cleanup for now bootstrap@1.26 +13 -3 Hold off on the .deps cleanup for now ChangeSet@1.2019, 2009-09-27 07:50:18-04:00, stenn@whimsy.udel.edu NTP_4_2_5P222 TAG: NTP_4_2_5P222 ChangeLog@1.453 +1 -0 NTP_4_2_5P222 ntpd/ntpd-opts.c@1.215 +2 -2 NTP_4_2_5P222 ntpd/ntpd-opts.h@1.215 +3 -3 NTP_4_2_5P222 ntpd/ntpd-opts.texi@1.213 +1 -1 NTP_4_2_5P222 ntpd/ntpd.1@1.213 +2 -2 NTP_4_2_5P222 ntpdc/ntpdc-opts.c@1.211 +2 -2 NTP_4_2_5P222 ntpdc/ntpdc-opts.h@1.211 +3 -3 NTP_4_2_5P222 ntpdc/ntpdc-opts.texi@1.210 +1 -1 NTP_4_2_5P222 ntpdc/ntpdc.1@1.210 +2 -2 NTP_4_2_5P222 ntpq/ntpq-opts.c@1.211 +2 -2 NTP_4_2_5P222 ntpq/ntpq-opts.h@1.211 +3 -3 NTP_4_2_5P222 ntpq/ntpq-opts.texi@1.210 +1 -1 NTP_4_2_5P222 ntpq/ntpq.1@1.210 +2 -2 NTP_4_2_5P222 ntpsnmpd/ntpsnmpd-opts.c@1.91 +2 -2 NTP_4_2_5P222 ntpsnmpd/ntpsnmpd-opts.h@1.91 +3 -3 NTP_4_2_5P222 ntpsnmpd/ntpsnmpd-opts.texi@1.91 +1 -1 NTP_4_2_5P222 ntpsnmpd/ntpsnmpd.1@1.91 +2 -2 NTP_4_2_5P222 packageinfo.sh@1.225 +1 -1 NTP_4_2_5P222 sntp/sntp-opts.c@1.85 +2 -2 NTP_4_2_5P222 sntp/sntp-opts.h@1.85 +3 -3 NTP_4_2_5P222 sntp/sntp-opts.texi@1.85 +1 -1 NTP_4_2_5P222 sntp/sntp.1@1.85 +2 -2 NTP_4_2_5P222 util/ntp-keygen-opts.c@1.214 +2 -2 NTP_4_2_5P222 util/ntp-keygen-opts.h@1.214 +3 -3 NTP_4_2_5P222 util/ntp-keygen-opts.texi@1.213 +1 -1 NTP_4_2_5P222 util/ntp-keygen.1@1.213 +2 -2 NTP_4_2_5P222 ChangeSet@1.2018, 2009-09-27 06:07:50-04:00, stenn@whimsy.udel.edu Use find/xargs to remove .deps files bootstrap@1.25 +1 -2 Use find/xargs to remove .deps files ChangeSet@1.2017, 2009-09-27 09:34:20+00:00, davehart@shiny.ad.hartbrothers.com .del-Makefile.am~f0c497c686043766: Delete: lib/isc/nothreads/include/isc/Makefile.am BitKeeper/deleted/.del-Makefile.am~f0c497c686043766@1.2 +0 -0 Delete: lib/isc/nothreads/include/isc/Makefile.am ChangeSet@1.2011.1.3, 2009-09-27 05:22:57-04:00, stenn@whimsy.udel.edu Remove unneeded Makefile.am files from lib/isc/include BitKeeper/deleted/.del-Makefile.am~3d21d1b06f4d0a5e@1.1.1.1 +0 -0 Delete: lib/isc/unix/include/isc/Makefile.am BitKeeper/deleted/.del-Makefile.am~5be91011328ee7b@1.9.1.1 +0 -0 Delete: lib/isc/include/isc/Makefile.am ChangeLog@1.450.1.1 +1 -0 Remove unneeded Makefile.am files from lib/isc/include Makefile.am@1.83.1.1 +0 -2 Remove unneeded Makefile.am files from lib/isc/include configure.ac@1.455.1.1 +0 -2 Remove unneeded Makefile.am files from lib/isc/include ChangeSet@1.2014, 2009-09-27 06:53:59+00:00, davehart@shiny.ad.hartbrothers.com Updated build and flock-build scripts. flock-build --one is a way to perform a flock-build compatible solitary build, handy for a repo clone's first build on a machine with autoconf, automake, etc. Compiling ntp_parser.y using BSD make correctly places ntp_parser.h in the top-level ntpd directory instead of A.*/ntpd. bootstrap script updated to remove potentially stale .deps dirs. ChangeLog@1.449.1.2 +6 -0 Updated build and flock-build scripts. flock-build --one is a way to perform a flock-build compatible solitary build, handy for a repo clone's first build on a machine with autoconf, automake, etc. Compiling ntp_parser.y using BSD make correctly places ntp_parser.h in the top-level ntpd directory instead of A.*/ntpd. bootstrap script updated to remove potentially stale .deps dirs. bootstrap@1.24 +8 -0 remove .deps directories to handle source code shuffles build@1.30 +26 -19 store configure cache in top srcdir config.cache-{hostname} so flock-build runs configure uncached once flock-build@1.44 +54 -37 add --one option to invoke a single build on the invoking host using flock-build's options to configure, useful to bring a repo clone tree to a state like a tarball, ready for flock-building on hosts without all dev tools (such as autoconf, automake, bison). update udel flock default LIST ntpd/Makefile.am@1.70 +27 -1 introduce vphack_after rule to fix ntp_parser.h placement when using build and BSD make. Thanks for Harlan's help on this. ChangeSet@1.2011.1.2, 2009-09-26 07:42:06-04:00, stenn@whimsy.udel.edu NTP_4_2_5P221 TAG: NTP_4_2_5P221 ChangeLog@1.450 +1 -0 NTP_4_2_5P221 ntpd/ntpd-opts.c@1.214 +2 -2 NTP_4_2_5P221 ntpd/ntpd-opts.h@1.214 +3 -3 NTP_4_2_5P221 ntpd/ntpd-opts.texi@1.212 +2 -2 NTP_4_2_5P221 ntpd/ntpd.1@1.212 +2 -2 NTP_4_2_5P221 ntpdc/ntpdc-opts.c@1.210 +2 -2 NTP_4_2_5P221 ntpdc/ntpdc-opts.h@1.210 +3 -3 NTP_4_2_5P221 ntpdc/ntpdc-opts.texi@1.209 +2 -2 NTP_4_2_5P221 ntpdc/ntpdc.1@1.209 +2 -2 NTP_4_2_5P221 ntpq/ntpq-opts.c@1.210 +2 -2 NTP_4_2_5P221 ntpq/ntpq-opts.h@1.210 +3 -3 NTP_4_2_5P221 ntpq/ntpq-opts.texi@1.209 +2 -2 NTP_4_2_5P221 ntpq/ntpq.1@1.209 +2 -2 NTP_4_2_5P221 ntpsnmpd/ntpsnmpd-opts.c@1.90 +2 -2 NTP_4_2_5P221 ntpsnmpd/ntpsnmpd-opts.h@1.90 +3 -3 NTP_4_2_5P221 ntpsnmpd/ntpsnmpd-opts.texi@1.90 +1 -1 NTP_4_2_5P221 ntpsnmpd/ntpsnmpd.1@1.90 +2 -2 NTP_4_2_5P221 packageinfo.sh@1.224 +1 -1 NTP_4_2_5P221 sntp/sntp-opts.c@1.84 +2 -2 NTP_4_2_5P221 sntp/sntp-opts.h@1.84 +3 -3 NTP_4_2_5P221 sntp/sntp-opts.texi@1.84 +2 -2 NTP_4_2_5P221 sntp/sntp.1@1.84 +2 -2 NTP_4_2_5P221 util/ntp-keygen-opts.c@1.213 +2 -2 NTP_4_2_5P221 util/ntp-keygen-opts.h@1.213 +3 -3 NTP_4_2_5P221 util/ntp-keygen-opts.texi@1.212 +2 -2 NTP_4_2_5P221 util/ntp-keygen.1@1.212 +2 -2 NTP_4_2_5P221 ChangeSet@1.2010.1.1, 2009-09-26 03:55:56-04:00, murray@pogo.udel.edu ChangeLog, refclock_nmea.c: Fix for Bug 1316: segfault from refclock_nmea ChangeLog@1.448 +1 -0 Fix for Bug 1316 ntpd/refclock_nmea.c@1.43 +4 -2 Fix for Bug 1316 ChangeSet@1.2011, 2009-09-25 19:32:13-04:00, stenn@whimsy.udel.edu [Bug 1317] Distribute cvo.sh ChangeLog@1.447.1.1 +1 -0 [Bug 1317] Distribute cvo.sh scripts/Makefile.am@1.16 +2 -2 [Bug 1317] Distribute cvo.sh ChangeSet@1.2004.2.1, 2009-09-25 19:30:24+00:00, davehart@shiny.ad.hartbrothers.com correct a few overlooked bk mv's in upstream libisc repo related to lib/isc/nothreads/include/isc BitKeeper/deleted/.del-mutex.h~d46b831ccac8e078@1.2 +0 -0 Delete: lib/isc/nothreads/include/isc/mutex.h BitKeeper/deleted/.del-once.h~79619f1c64fdf49b@1.2 +0 -0 Delete: lib/isc/nothreads/include/isc/once.h BitKeeper/deleted/.del-strerror.c~5704d44@1.2.1.1 +0 -0 Delete: ports/winnt/libntp/strerror.c lib/isc/nothreads/include/isc/mutex.h@1.3.1.2 +10 -10 correct a few overlooked bk mv's in upstream libisc repo related to lib/isc/nothreads/include/isc lib/isc/nothreads/include/isc/mutex.h@1.3.1.1 +0 -0 Rename: lib/isc/include/isc/mutex.h -> lib/isc/nothreads/include/isc/mutex.h lib/isc/nothreads/include/isc/once.h@1.3.1.2 +10 -10 correct a few overlooked bk mv's in upstream libisc repo related to lib/isc/nothreads/include/isc lib/isc/nothreads/include/isc/once.h@1.3.1.1 +0 -0 Rename: lib/isc/include/isc/once.h -> lib/isc/nothreads/include/isc/once.h ChangeSet@1.2004.1.3, 2009-09-25 19:17:24+00:00, davehart@shiny.ad.hartbrothers.com Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. BitKeeper/deleted/.del-mutex.h~cf2fbab1@1.4 +0 -0 Rename: lib/isc/include/isc/mutex.h -> BitKeeper/deleted/.del-mutex.h~cf2fbab1 BitKeeper/deleted/.del-once.h~cfad354a@1.4 +0 -0 Rename: lib/isc/include/isc/once.h -> BitKeeper/deleted/.del-once.h~cfad354a BitKeeper/deleted/.del-strerror.c~5704d44@1.3 +0 -0 Rename: ports/winnt/libntp/strerror.c -> BitKeeper/deleted/.del-strerror.c~5704d44 ChangeLog@1.443.1.1 +6 -0 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. Makefile.am@1.82.1.1 +2 -1 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream configure.ac@1.456 +1 -0 add reference to lib/isc/nothreads/include/isc/Makefile.am lib/isc/include/isc/Makefile.am@1.10 +71 -30 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream lib/isc/include/isc/interfaceiter.h@1.7 +3 -0 add NTP-local broadcast address, broadcast & multicast bitflags to libisc network interface iterator lib/isc/include/isc/msgs.h@1.6 +1 -0 add ISC_MSG_GETBCSTADDR used by NTP-local interface iterator changes lib/isc/inet_ntop.c@1.8 +6 -2 use ntp_snprintf.h's SNPRINTF for SunOS 4 compat lib/isc/nothreads/include/isc/Makefile.am@1.1 +12 -0 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream lib/isc/nothreads/include/isc/Makefile.am@1.0 +0 -0 lib/isc/sockaddr.c@1.9 +1 -1 cast to silence warning lib/isc/unix/ifiter_getifaddrs.c@1.8 +14 -1 add NTP-local broadcast address, broadcast & multicast bitflags to libisc network interface iterator lib/isc/unix/ifiter_ioctl.c@1.28 +76 -0 add NTP-local broadcast address, broadcast & multicast bitflags to libisc network interface iterator lib/isc/unix/ifiter_sysctl.c@1.15 +13 -0 add NTP-local broadcast address, broadcast & multicast bitflags to libisc network interface iterator lib/isc/unix/include/isc/Makefile.am@1.2 +12 -8 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream lib/isc/unix/net.c@1.13 +2 -2 NTP-local change, use GETSOCKNAME_SOCKLEN_TYPE lib/isc/unix/strerror.c@1.6 +2 -0 NTP local change, #include "l_stdlib.h" lib/isc/win32/include/isc/platform.h@1.6 +20 -11 NTP-local change, disable __declspec(dllimport) for libisc public interfaces with #define ISC_STATIC_WIN lib/isc/win32/include/isc/stat.h@1.4 +15 -0 NTP-local changes: alias more identifiers from POSIX names to Microsoft's, with leading underscores, so libopts builds on Windows lib/isc/win32/include/isc/thread.h@1.2 +1 -1 NTP-local fix type, silence warning lib/isc/win32/interfaceiter.c@1.10.1.3 +36 -1 add NTP-local broadcast address, broadcast & multicast bitflags to libisc network interface iterator lib/isc/win32/net.c@1.12 +3 -3 NTP-local changes fix closeocket(s) typo, silence two warnings with casts lib/isc/win32/strerror.c@1.11 +15 -10 NTP-local changes: use CRT_strerror() not strerror() to avoid our #define strerror, do not reference _sys_nerr when calling strerror() will do and avoids a deprecation warning for _sys_nerr lib/isc/win32/thread.c@1.2 +7 -3 NTP-local change, handle 64-bit isc_threadresult_t correctly libntp/Makefile.am@1.45 +44 -19 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream libparse/Makefile.am@1.14 +9 -6 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream ntpd/Makefile.am@1.69 +9 -7 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream ntpd/ntp_io.c@1.297.1.1 +54 -11 libisc network interface iterator now requires a mctx, build one on top of emalloc() ntpdate/Makefile.am@1.18 +4 -3 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream ntpdc/Makefile.am@1.41 +5 -4 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream ntpq/Makefile.am@1.35 +5 -4 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream ntpsnmpd/Makefile.am@1.9 +7 -6 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream parseutil/Makefile.am@1.9 +4 -3 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream ports/winnt/include/config.h@1.77 +9 -2 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. ports/winnt/libntp/syslog.c@1.6 +28 -1 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. ports/winnt/ntpd/ntservice.c@1.18 +4 -14 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. ports/winnt/ntpd/win32_io.c@1.19 +1 -0 #include to quiet warning about _open_osfhandle ports/winnt/vc6/libntp.dsp@1.43 +38 -2 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. ports/winnt/vc6/ntpd.dsp@1.39 +5 -5 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. ports/winnt/vs2003/libntp.vcproj@1.4 +98 -47 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. ports/winnt/vs2003/ntpd.vcproj@1.4 +5 -5 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. ports/winnt/vs2005/libntp.vcproj@1.4 +102 -46 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. ports/winnt/vs2005/ntpd.vcproj@1.4 +5 -5 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. ports/winnt/vs2008/libntp/libntp.vcproj@1.19 +102 -1358 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. ports/winnt/vs2008/ntpd/ntpd.vcproj@1.19 +6 -6 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream, reapply NTP-local changes. sntp/Makefile.am@1.12 +5 -4 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream sntp/main.c@1.19 +2 -2 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream util/Makefile.am@1.40 +5 -4 Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout to match upstream ChangeSet@1.2008.1.1, 2009-09-25 15:48:47+00:00, davehart@shiny.ad.hartbrothers.com Makefile.am: correct EXTRA_DIST reference from libisc to lib/isc Makefile.am@1.83 +1 -1 correct EXTRA_DIST reference from libisc to lib/isc ChangeSet@1.2009, 2009-09-25 07:47:32-04:00, stenn@whimsy.udel.edu NTP_4_2_5P220 TAG: NTP_4_2_5P220 ChangeLog@1.447 +1 -0 NTP_4_2_5P220 ntpd/ntpd-opts.c@1.213 +2 -2 NTP_4_2_5P220 ntpd/ntpd-opts.h@1.213 +3 -3 NTP_4_2_5P220 ntpd/ntpd-opts.texi@1.211 +1 -1 NTP_4_2_5P220 ntpd/ntpd.1@1.211 +2 -2 NTP_4_2_5P220 ntpdc/ntpdc-opts.c@1.209 +2 -2 NTP_4_2_5P220 ntpdc/ntpdc-opts.h@1.209 +3 -3 NTP_4_2_5P220 ntpdc/ntpdc-opts.texi@1.208 +1 -1 NTP_4_2_5P220 ntpdc/ntpdc.1@1.208 +2 -2 NTP_4_2_5P220 ntpq/ntpq-opts.c@1.209 +2 -2 NTP_4_2_5P220 ntpq/ntpq-opts.h@1.209 +3 -3 NTP_4_2_5P220 ntpq/ntpq-opts.texi@1.208 +1 -1 NTP_4_2_5P220 ntpq/ntpq.1@1.208 +2 -2 NTP_4_2_5P220 ntpsnmpd/ntpsnmpd-opts.c@1.89 +2 -2 NTP_4_2_5P220 ntpsnmpd/ntpsnmpd-opts.h@1.89 +3 -3 NTP_4_2_5P220 ntpsnmpd/ntpsnmpd-opts.texi@1.89 +1 -1 NTP_4_2_5P220 ntpsnmpd/ntpsnmpd.1@1.89 +2 -2 NTP_4_2_5P220 packageinfo.sh@1.223 +1 -1 NTP_4_2_5P220 sntp/sntp-opts.c@1.83 +2 -2 NTP_4_2_5P220 sntp/sntp-opts.h@1.83 +3 -3 NTP_4_2_5P220 sntp/sntp-opts.texi@1.83 +1 -1 NTP_4_2_5P220 sntp/sntp.1@1.83 +2 -2 NTP_4_2_5P220 util/ntp-keygen-opts.c@1.212 +2 -2 NTP_4_2_5P220 util/ntp-keygen-opts.h@1.212 +3 -3 NTP_4_2_5P220 util/ntp-keygen-opts.texi@1.211 +1 -1 NTP_4_2_5P220 util/ntp-keygen.1@1.211 +2 -2 NTP_4_2_5P220 ChangeSet@1.2008, 2009-09-25 07:09:49+00:00, davehart@shiny.ad.hartbrothers.com Rearrange libisc code to match the upstream layout in BIND. This is step one of two, changing the layout but keeping our existing libisc. ChangeLog@1.446 +2 -0 Rearrange libisc code to match the upstream layout in BIND. This is step one of two, changing the layout but keeping our existing libisc. ChangeSet@1.2004.1.2, 2009-09-24 15:52:46+00:00, davehart@shiny.ad.hartbrothers.com import unmodified lib/isc from ISC bind-9.6.1-P1.tar.gz lib/isc/alpha/include/isc/atomic.h@1.1 +184 -0 bind-9.6.1-P1.tar.gz lib/isc/alpha/include/isc/atomic.h@1.0 +0 -0 lib/isc/api@1.1 +3 -0 bind-9.6.1-P1.tar.gz lib/isc/api@1.0 +0 -0 lib/isc/assertions.c@1.4 +17 -13 bind-9.6.1-P1.tar.gz lib/isc/base32.c@1.1 +371 -0 bind-9.6.1-P1.tar.gz lib/isc/base32.c@1.0 +0 -0 lib/isc/base64.c@1.1 +250 -0 bind-9.6.1-P1.tar.gz lib/isc/base64.c@1.0 +0 -0 lib/isc/bitstring.c@1.1 +127 -0 bind-9.6.1-P1.tar.gz lib/isc/bitstring.c@1.0 +0 -0 lib/isc/buffer.c@1.1 +489 -0 bind-9.6.1-P1.tar.gz lib/isc/buffer.c@1.0 +0 -0 lib/isc/bufferlist.c@1.1 +64 -0 bind-9.6.1-P1.tar.gz lib/isc/bufferlist.c@1.0 +0 -0 lib/isc/commandline.c@1.1 +225 -0 bind-9.6.1-P1.tar.gz lib/isc/commandline.c@1.0 +0 -0 lib/isc/entropy.c@1.1 +1274 -0 bind-9.6.1-P1.tar.gz lib/isc/entropy.c@1.0 +0 -0 lib/isc/error.c@1.4 +15 -10 bind-9.6.1-P1.tar.gz lib/isc/event.c@1.1 +88 -0 bind-9.6.1-P1.tar.gz lib/isc/event.c@1.0 +0 -0 lib/isc/fsaccess.c@1.1 +102 -0 bind-9.6.1-P1.tar.gz lib/isc/fsaccess.c@1.0 +0 -0 lib/isc/hash.c@1.1 +390 -0 bind-9.6.1-P1.tar.gz lib/isc/hash.c@1.0 +0 -0 lib/isc/heap.c@1.1 +262 -0 bind-9.6.1-P1.tar.gz lib/isc/heap.c@1.0 +0 -0 lib/isc/hex.c@1.1 +201 -0 bind-9.6.1-P1.tar.gz lib/isc/hex.c@1.0 +0 -0 lib/isc/hmacmd5.c@1.1 +118 -0 bind-9.6.1-P1.tar.gz lib/isc/hmacmd5.c@1.0 +0 -0 lib/isc/hmacsha.c@1.1 +438 -0 bind-9.6.1-P1.tar.gz lib/isc/hmacsha.c@1.0 +0 -0 lib/isc/httpd.c@1.1 +987 -0 bind-9.6.1-P1.tar.gz lib/isc/httpd.c@1.0 +0 -0 lib/isc/ia64/include/isc/atomic.h@1.1 +100 -0 bind-9.6.1-P1.tar.gz lib/isc/ia64/include/isc/atomic.h@1.0 +0 -0 lib/isc/include/isc/app.h@1.4 +57 -57 bind-9.6.1-P1.tar.gz lib/isc/include/isc/assertions.h@1.4 +16 -12 bind-9.6.1-P1.tar.gz lib/isc/include/isc/base32.h@1.1 +128 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/base32.h@1.0 +0 -0 lib/isc/include/isc/base64.h@1.1 +99 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/base64.h@1.0 +0 -0 lib/isc/include/isc/bitstring.h@1.1 +157 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/bitstring.h@1.0 +0 -0 lib/isc/include/isc/boolean.h@1.4 +12 -10 bind-9.6.1-P1.tar.gz lib/isc/include/isc/buffer.h@1.4 +251 -147 bind-9.6.1-P1.tar.gz lib/isc/include/isc/bufferlist.h@1.1 +86 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/bufferlist.h@1.0 +0 -0 lib/isc/include/isc/commandline.h@1.1 +50 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/commandline.h@1.0 +0 -0 lib/isc/include/isc/entropy.h@1.1 +314 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/entropy.h@1.0 +0 -0 lib/isc/include/isc/error.h@1.4 +17 -10 bind-9.6.1-P1.tar.gz lib/isc/include/isc/event.h@1.1 +121 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/event.h@1.0 +0 -0 lib/isc/include/isc/eventclass.h@1.1 +53 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/eventclass.h@1.0 +0 -0 lib/isc/include/isc/file.h@1.4 +8 -8 bind-9.6.1-P1.tar.gz lib/isc/include/isc/formatcheck.h@1.4 +20 -14 bind-9.6.1-P1.tar.gz lib/isc/include/isc/fsaccess.h@1.1 +178 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/fsaccess.h@1.0 +0 -0 lib/isc/include/isc/hash.h@1.1 +185 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/hash.h@1.0 +0 -0 lib/isc/include/isc/heap.h@1.1 +170 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/heap.h@1.0 +0 -0 lib/isc/include/isc/hex.h@1.1 +98 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/hex.h@1.0 +0 -0 lib/isc/include/isc/hmacmd5.h@1.1 +63 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/hmacmd5.h@1.0 +0 -0 lib/isc/include/isc/hmacsha.h@1.1 +156 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/hmacsha.h@1.0 +0 -0 lib/isc/include/isc/httpd.h@1.1 +64 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/httpd.h@1.0 +0 -0 lib/isc/include/isc/interfaceiter.h@1.6 +46 -50 bind-9.6.1-P1.tar.gz lib/isc/include/isc/ipv6.h@1.9 +22 -29 bind-9.6.1-P1.tar.gz lib/isc/include/isc/iterated_hash.h@1.1 +47 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/iterated_hash.h@1.0 +0 -0 lib/isc/include/isc/lang.h@1.4 +12 -10 bind-9.6.1-P1.tar.gz lib/isc/include/isc/lex.h@1.1 +431 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/lex.h@1.0 +0 -0 lib/isc/include/isc/lfsr.h@1.1 +130 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/lfsr.h@1.0 +0 -0 lib/isc/include/isc/lib.h@1.4 +14 -12 bind-9.6.1-P1.tar.gz lib/isc/include/isc/list.h@1.4 +17 -13 bind-9.6.1-P1.tar.gz lib/isc/include/isc/log.h@1.3 +15 -14 bind-9.6.1-P1.tar.gz lib/isc/include/isc/magic.h@1.4 +13 -12 bind-9.6.1-P1.tar.gz lib/isc/include/isc/mem.h@1.5 +612 -19 bind-9.6.1-P1.tar.gz lib/isc/include/isc/msgcat.h@1.4 +33 -34 bind-9.6.1-P1.tar.gz lib/isc/include/isc/msgs.h@1.5 +137 -126 bind-9.6.1-P1.tar.gz lib/isc/include/isc/mutexblock.h@1.1 +71 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/mutexblock.h@1.0 +0 -0 lib/isc/include/isc/netaddr.h@1.6 +58 -27 bind-9.6.1-P1.tar.gz lib/isc/include/isc/netscope.h@1.3 +9 -6 bind-9.6.1-P1.tar.gz lib/isc/include/isc/ondestroy.h@1.1 +116 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/ondestroy.h@1.0 +0 -0 lib/isc/include/isc/os.h@1.1 +38 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/os.h@1.0 +0 -0 lib/isc/include/isc/parseint.h@1.1 +64 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/parseint.h@1.0 +0 -0 lib/isc/include/isc/platform.h.in@1.1 +339 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/platform.h.in@1.0 +0 -0 lib/isc/include/isc/portset.h@1.1 +141 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/portset.h@1.0 +0 -0 lib/isc/include/isc/print.h@1.4 +31 -13 bind-9.6.1-P1.tar.gz lib/isc/include/isc/quota.h@1.1 +119 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/quota.h@1.0 +0 -0 lib/isc/include/isc/radix.h@1.1 +240 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/radix.h@1.0 +0 -0 lib/isc/include/isc/random.h@1.1 +62 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/random.h@1.0 +0 -0 lib/isc/include/isc/ratelimiter.h@1.1 +134 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/ratelimiter.h@1.0 +0 -0 lib/isc/include/isc/refcount.h@1.1 +233 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/refcount.h@1.0 +0 -0 lib/isc/include/isc/region.h@1.3 +14 -10 bind-9.6.1-P1.tar.gz lib/isc/include/isc/resource.h@1.1 +97 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/resource.h@1.0 +0 -0 lib/isc/include/isc/result.h@1.5 +69 -68 bind-9.6.1-P1.tar.gz lib/isc/include/isc/resultclass.h@1.1 +50 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/resultclass.h@1.0 +0 -0 lib/isc/include/isc/rwlock.h@1.1 +135 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/rwlock.h@1.0 +0 -0 lib/isc/include/isc/serial.h@1.1 +75 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/serial.h@1.0 +0 -0 lib/isc/include/isc/sha1.h@1.1 +59 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/sha1.h@1.0 +0 -0 lib/isc/include/isc/sha2.h@1.1 +132 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/sha2.h@1.0 +0 -0 lib/isc/include/isc/sockaddr.h@1.5 +83 -44 bind-9.6.1-P1.tar.gz lib/isc/include/isc/socket.h@1.1 +1007 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/socket.h@1.0 +0 -0 lib/isc/include/isc/stats.h@1.1 +121 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/stats.h@1.0 +0 -0 lib/isc/include/isc/stdio.h@1.3 +4 -4 bind-9.6.1-P1.tar.gz lib/isc/include/isc/stdlib.h@1.1 +40 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/stdlib.h@1.0 +0 -0 lib/isc/include/isc/string.h@1.4 +188 -13 bind-9.6.1-P1.tar.gz lib/isc/include/isc/symtab.h@1.1 +131 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/symtab.h@1.0 +0 -0 lib/isc/include/isc/task.h@1.1 +624 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/task.h@1.0 +0 -0 lib/isc/include/isc/taskpool.h@1.1 +105 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/taskpool.h@1.0 +0 -0 lib/isc/include/isc/timer.h@1.1 +344 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/timer.h@1.0 +0 -0 lib/isc/include/isc/types.h@1.4 +81 -59 bind-9.6.1-P1.tar.gz lib/isc/include/isc/util.h@1.4 +26 -18 bind-9.6.1-P1.tar.gz lib/isc/include/isc/version.h@1.1 +28 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/version.h@1.0 +0 -0 lib/isc/include/isc/xml.h@1.1 +41 -0 bind-9.6.1-P1.tar.gz lib/isc/include/isc/xml.h@1.0 +0 -0 lib/isc/inet_aton.c@1.4 +9 -8 bind-9.6.1-P1.tar.gz lib/isc/inet_ntop.c@1.7 +25 -31 bind-9.6.1-P1.tar.gz lib/isc/inet_pton.c@1.4 +34 -37 bind-9.6.1-P1.tar.gz lib/isc/iterated_hash.c@1.1 +48 -0 bind-9.6.1-P1.tar.gz lib/isc/iterated_hash.c@1.0 +0 -0 lib/isc/lex.c@1.1 +959 -0 bind-9.6.1-P1.tar.gz lib/isc/lex.c@1.0 +0 -0 lib/isc/lfsr.c@1.1 +161 -0 bind-9.6.1-P1.tar.gz lib/isc/lfsr.c@1.0 +0 -0 lib/isc/lib.c@1.4 +13 -11 bind-9.6.1-P1.tar.gz lib/isc/log.c@1.3 +15 -15 bind-9.6.1-P1.tar.gz lib/isc/mem.c@1.5 +2181 -23 bind-9.6.1-P1.tar.gz lib/isc/mips/include/isc/atomic.h@1.1 +98 -0 bind-9.6.1-P1.tar.gz lib/isc/mips/include/isc/atomic.h@1.0 +0 -0 lib/isc/mutexblock.c@1.1 +59 -0 bind-9.6.1-P1.tar.gz lib/isc/mutexblock.c@1.0 +0 -0 lib/isc/netaddr.c@1.6 +83 -10 bind-9.6.1-P1.tar.gz lib/isc/netscope.c@1.3 +5 -3 bind-9.6.1-P1.tar.gz lib/isc/nls/msgcat.c@1.6 +14 -13 bind-9.6.1-P1.tar.gz lib/isc/noatomic/include/isc/atomic.h@1.1 +24 -0 bind-9.6.1-P1.tar.gz lib/isc/noatomic/include/isc/atomic.h@1.0 +0 -0 lib/isc/nothreads/condition.c@1.1 +24 -0 bind-9.6.1-P1.tar.gz lib/isc/nothreads/condition.c@1.0 +0 -0 lib/isc/nothreads/include/isc/condition.h@1.1 +59 -0 bind-9.6.1-P1.tar.gz lib/isc/nothreads/include/isc/condition.h@1.0 +0 -0 lib/isc/nothreads/include/isc/mutex.h@1.1 +39 -0 bind-9.6.1-P1.tar.gz lib/isc/nothreads/include/isc/mutex.h@1.0 +0 -0 lib/isc/nothreads/include/isc/once.h@1.1 +32 -0 bind-9.6.1-P1.tar.gz lib/isc/nothreads/include/isc/once.h@1.0 +0 -0 lib/isc/nothreads/include/isc/thread.h@1.1 +35 -0 bind-9.6.1-P1.tar.gz lib/isc/nothreads/include/isc/thread.h@1.0 +0 -0 lib/isc/nothreads/mutex.c@1.1 +25 -0 bind-9.6.1-P1.tar.gz lib/isc/nothreads/mutex.c@1.0 +0 -0 lib/isc/nothreads/thread.c@1.1 +28 -0 bind-9.6.1-P1.tar.gz lib/isc/nothreads/thread.c@1.0 +0 -0 lib/isc/ondestroy.c@1.1 +85 -0 bind-9.6.1-P1.tar.gz lib/isc/ondestroy.c@1.0 +0 -0 lib/isc/parseint.c@1.1 +72 -0 bind-9.6.1-P1.tar.gz lib/isc/parseint.c@1.0 +0 -0 lib/isc/portset.c@1.1 +143 -0 bind-9.6.1-P1.tar.gz lib/isc/portset.c@1.0 +0 -0 lib/isc/powerpc/include/isc/atomic.h@1.1 +160 -0 bind-9.6.1-P1.tar.gz lib/isc/powerpc/include/isc/atomic.h@1.0 +0 -0 lib/isc/print.c@1.1 +624 -0 bind-9.6.1-P1.tar.gz lib/isc/print.c@1.0 +0 -0 lib/isc/pthreads/condition.c@1.1 +74 -0 bind-9.6.1-P1.tar.gz lib/isc/pthreads/condition.c@1.0 +0 -0 lib/isc/pthreads/include/isc/condition.h@1.1 +65 -0 bind-9.6.1-P1.tar.gz lib/isc/pthreads/include/isc/condition.h@1.0 +0 -0 lib/isc/pthreads/include/isc/mutex.h@1.1 +145 -0 bind-9.6.1-P1.tar.gz lib/isc/pthreads/include/isc/mutex.h@1.0 +0 -0 lib/isc/pthreads/include/isc/once.h@1.1 +50 -0 bind-9.6.1-P1.tar.gz lib/isc/pthreads/include/isc/once.h@1.0 +0 -0 lib/isc/pthreads/include/isc/thread.h@1.1 +60 -0 bind-9.6.1-P1.tar.gz lib/isc/pthreads/include/isc/thread.h@1.0 +0 -0 lib/isc/pthreads/mutex.c@1.1 +272 -0 bind-9.6.1-P1.tar.gz lib/isc/pthreads/mutex.c@1.0 +0 -0 lib/isc/pthreads/thread.c@1.1 +76 -0 bind-9.6.1-P1.tar.gz lib/isc/pthreads/thread.c@1.0 +0 -0 lib/isc/quota.c@1.1 +101 -0 bind-9.6.1-P1.tar.gz lib/isc/quota.c@1.0 +0 -0 lib/isc/radix.c@1.1 +706 -0 bind-9.6.1-P1.tar.gz lib/isc/radix.c@1.0 +0 -0 lib/isc/random.c@1.1 +104 -0 bind-9.6.1-P1.tar.gz lib/isc/random.c@1.0 +0 -0 lib/isc/ratelimiter.c@1.1 +328 -0 bind-9.6.1-P1.tar.gz lib/isc/ratelimiter.c@1.0 +0 -0 lib/isc/refcount.c@1.1 +37 -0 bind-9.6.1-P1.tar.gz lib/isc/refcount.c@1.0 +0 -0 lib/isc/region.c@1.1 +45 -0 bind-9.6.1-P1.tar.gz lib/isc/region.c@1.0 +0 -0 lib/isc/result.c@1.1 +213 -0 bind-9.6.1-P1.tar.gz lib/isc/result.c@1.0 +0 -0 lib/isc/rwlock.c@1.1 +808 -0 bind-9.6.1-P1.tar.gz lib/isc/rwlock.c@1.0 +0 -0 lib/isc/serial.c@1.1 +59 -0 bind-9.6.1-P1.tar.gz lib/isc/serial.c@1.0 +0 -0 lib/isc/sha1.c@1.1 +315 -0 bind-9.6.1-P1.tar.gz lib/isc/sha1.c@1.0 +0 -0 lib/isc/sha2.c@1.1 +1234 -0 bind-9.6.1-P1.tar.gz lib/isc/sha2.c@1.0 +0 -0 lib/isc/sockaddr.c@1.8 +87 -64 bind-9.6.1-P1.tar.gz lib/isc/sparc64/include/isc/atomic.h@1.1 +127 -0 bind-9.6.1-P1.tar.gz lib/isc/sparc64/include/isc/atomic.h@1.0 +0 -0 lib/isc/stats.c@1.1 +326 -0 bind-9.6.1-P1.tar.gz lib/isc/stats.c@1.0 +0 -0 lib/isc/string.c@1.1 +270 -0 bind-9.6.1-P1.tar.gz lib/isc/string.c@1.0 +0 -0 lib/isc/strtoul.c@1.1 +129 -0 bind-9.6.1-P1.tar.gz lib/isc/strtoul.c@1.0 +0 -0 lib/isc/symtab.c@1.1 +252 -0 bind-9.6.1-P1.tar.gz lib/isc/symtab.c@1.0 +0 -0 lib/isc/task.c@1.1 +1376 -0 bind-9.6.1-P1.tar.gz lib/isc/task.c@1.0 +0 -0 lib/isc/task_p.h@1.1 +31 -0 bind-9.6.1-P1.tar.gz lib/isc/task_p.h@1.0 +0 -0 lib/isc/taskpool.c@1.1 +96 -0 bind-9.6.1-P1.tar.gz lib/isc/taskpool.c@1.0 +0 -0 lib/isc/timer.c@1.1 +933 -0 bind-9.6.1-P1.tar.gz lib/isc/timer.c@1.0 +0 -0 lib/isc/timer_p.h@1.1 +31 -0 bind-9.6.1-P1.tar.gz lib/isc/timer_p.h@1.0 +0 -0 lib/isc/unix/app.c@1.1 +684 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/app.c@1.0 +0 -0 lib/isc/unix/dir.c@1.1 +251 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/dir.c@1.0 +0 -0 lib/isc/unix/entropy.c@1.1 +605 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/entropy.c@1.0 +0 -0 lib/isc/unix/errno2result.c@1.1 +123 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/errno2result.c@1.0 +0 -0 lib/isc/unix/errno2result.h@1.1 +39 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/errno2result.h@1.0 +0 -0 lib/isc/unix/file.c@1.1 +444 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/file.c@1.0 +0 -0 lib/isc/unix/fsaccess.c@1.1 +93 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/fsaccess.c@1.0 +0 -0 lib/isc/unix/ifiter_getifaddrs.c@1.7 +72 -29 bind-9.6.1-P1.tar.gz lib/isc/unix/ifiter_ioctl.c@1.27 +49 -236 bind-9.6.1-P1.tar.gz lib/isc/unix/ifiter_sysctl.c@1.14 +6 -19 bind-9.6.1-P1.tar.gz lib/isc/unix/include/isc/dir.h@1.3 +3 -3 bind-9.6.1-P1.tar.gz lib/isc/unix/include/isc/int.h@1.4 +13 -11 bind-9.6.1-P1.tar.gz lib/isc/unix/include/isc/keyboard.h@1.1 +52 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/include/isc/keyboard.h@1.0 +0 -0 lib/isc/unix/include/isc/net.h@1.10 +91 -56 bind-9.6.1-P1.tar.gz lib/isc/unix/include/isc/netdb.h@1.1 +57 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/include/isc/netdb.h@1.0 +0 -0 lib/isc/unix/include/isc/offset.h@1.4 +14 -12 bind-9.6.1-P1.tar.gz lib/isc/unix/include/isc/stat.h@1.3 +3 -3 bind-9.6.1-P1.tar.gz lib/isc/unix/include/isc/stdtime.h@1.1 +60 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/include/isc/stdtime.h@1.0 +0 -0 lib/isc/unix/include/isc/strerror.h@1.4 +15 -12 bind-9.6.1-P1.tar.gz lib/isc/unix/include/isc/syslog.h@1.1 +47 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/include/isc/syslog.h@1.0 +0 -0 lib/isc/unix/include/isc/time.h@1.3 +40 -10 bind-9.6.1-P1.tar.gz lib/isc/unix/interfaceiter.c@1.17 +99 -7 bind-9.6.1-P1.tar.gz lib/isc/unix/ipv6.c@1.1 +27 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/ipv6.c@1.0 +0 -0 lib/isc/unix/keyboard.c@1.1 +126 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/keyboard.c@1.0 +0 -0 lib/isc/unix/net.c@1.12 +232 -19 bind-9.6.1-P1.tar.gz lib/isc/unix/os.c@1.1 +94 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/os.c@1.0 +0 -0 lib/isc/unix/resource.c@1.1 +231 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/resource.c@1.0 +0 -0 lib/isc/unix/socket.c@1.1 +5550 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/socket.c@1.0 +0 -0 lib/isc/unix/socket_p.h@1.1 +32 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/socket_p.h@1.0 +0 -0 lib/isc/unix/stdio.c@1.1 +117 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/stdio.c@1.0 +0 -0 lib/isc/unix/stdtime.c@1.1 +86 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/stdtime.c@1.0 +0 -0 lib/isc/unix/strerror.c@1.5 +15 -15 bind-9.6.1-P1.tar.gz lib/isc/unix/syslog.c@1.1 +84 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/syslog.c@1.0 +0 -0 lib/isc/unix/time.c@1.1 +438 -0 bind-9.6.1-P1.tar.gz lib/isc/unix/time.c@1.0 +0 -0 lib/isc/version.c@1.1 +28 -0 bind-9.6.1-P1.tar.gz lib/isc/version.c@1.0 +0 -0 lib/isc/win32/DLLMain.c@1.1 +58 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/DLLMain.c@1.0 +0 -0 lib/isc/win32/app.c@1.1 +260 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/app.c@1.0 +0 -0 lib/isc/win32/condition.c@1.1 +258 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/condition.c@1.0 +0 -0 lib/isc/win32/dir.c@1.1 +312 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/dir.c@1.0 +0 -0 lib/isc/win32/entropy.c@1.1 +307 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/entropy.c@1.0 +0 -0 lib/isc/win32/errno2result.c@1.1 +113 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/errno2result.c@1.0 +0 -0 lib/isc/win32/errno2result.h@1.1 +40 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/errno2result.h@1.0 +0 -0 lib/isc/win32/file.c@1.1 +507 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/file.c@1.0 +0 -0 lib/isc/win32/fsaccess.c@1.1 +375 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/fsaccess.c@1.0 +0 -0 lib/isc/win32/include/isc/bind_registry.h@1.1 +50 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/bind_registry.h@1.0 +0 -0 lib/isc/win32/include/isc/bindevt.h@1.1 +91 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/bindevt.h@1.0 +0 -0 lib/isc/win32/include/isc/condition.h@1.1 +67 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/condition.h@1.0 +0 -0 lib/isc/win32/include/isc/dir.h@1.1 +83 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/dir.h@1.0 +0 -0 lib/isc/win32/include/isc/int.h@1.4 +10 -10 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/ipv6.h@1.8 +10 -15 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/keyboard.h@1.1 +47 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/keyboard.h@1.0 +0 -0 lib/isc/win32/include/isc/mutex.h@1.4 +17 -13 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/netdb.h@1.1 +54 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/netdb.h@1.0 +0 -0 lib/isc/win32/include/isc/ntgroups.h@1.1 +35 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/ntgroups.h@1.0 +0 -0 lib/isc/win32/include/isc/ntpaths.h@1.1 +71 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/ntpaths.h@1.0 +0 -0 lib/isc/win32/include/isc/offset.h@1.4 +11 -12 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/once.h@1.4 +10 -10 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/platform.h@1.5 +26 -23 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/stat.h@1.3 +3 -23 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/stdtime.h@1.1 +58 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/stdtime.h@1.0 +0 -0 lib/isc/win32/include/isc/strerror.h@1.4 +10 -10 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/syslog.h@1.1 +45 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/syslog.h@1.0 +0 -0 lib/isc/win32/include/isc/thread.h@1.1 +100 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/thread.h@1.0 +0 -0 lib/isc/win32/include/isc/time.h@1.1 +291 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/include/isc/time.h@1.0 +0 -0 lib/isc/win32/include/isc/win32os.h@1.4 +11 -11 bind-9.6.1-P1.tar.gz lib/isc/win32/interfaceiter.c@1.10.1.2 +11 -45 bind-9.6.1-P1.tar.gz lib/isc/win32/ipv6.c@1.1 +27 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/ipv6.c@1.0 +0 -0 lib/isc/win32/keyboard.c@1.1 +89 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/keyboard.c@1.0 +0 -0 lib/isc/win32/libisc.def@1.1 +551 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/libisc.def@1.0 +0 -0 lib/isc/win32/libisc.dsp@1.1 +784 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/libisc.dsp@1.0 +0 -0 lib/isc/win32/libisc.dsw@1.1 +29 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/libisc.dsw@1.0 +0 -0 lib/isc/win32/libisc.mak@1.1 +2006 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/libisc.mak@1.0 +0 -0 lib/isc/win32/net.c@1.11 +4 -4 bind-9.6.1-P1.tar.gz lib/isc/win32/netdb.h@1.1 +187 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/netdb.h@1.0 +0 -0 lib/isc/win32/ntgroups.c@1.1 +186 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/ntgroups.c@1.0 +0 -0 lib/isc/win32/ntpaths.c@1.1 +140 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/ntpaths.c@1.0 +0 -0 lib/isc/win32/once.c@1.4 +15 -12 bind-9.6.1-P1.tar.gz lib/isc/win32/os.c@1.1 +45 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/os.c@1.0 +0 -0 lib/isc/win32/resource.c@1.1 +72 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/resource.c@1.0 +0 -0 lib/isc/win32/socket.c@1.1 +3674 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/socket.c@1.0 +0 -0 lib/isc/win32/stdio.c@1.1 +117 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/stdio.c@1.0 +0 -0 lib/isc/win32/stdtime.c@1.1 +37 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/stdtime.c@1.0 +0 -0 lib/isc/win32/strerror.c@1.10 +71 -221 bind-9.6.1-P1.tar.gz lib/isc/win32/syslog.c@1.1 +181 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/syslog.c@1.0 +0 -0 lib/isc/win32/syslog.h@1.1 +76 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/syslog.h@1.0 +0 -0 lib/isc/win32/thread.c@1.1 +90 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/thread.c@1.0 +0 -0 lib/isc/win32/time.c@1.1 +295 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/time.c@1.0 +0 -0 lib/isc/win32/unistd.h@1.1 +53 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/unistd.h@1.0 +0 -0 lib/isc/win32/version.c@1.1 +28 -0 bind-9.6.1-P1.tar.gz lib/isc/win32/version.c@1.0 +0 -0 lib/isc/win32/win32os.c@1.4 +11 -11 bind-9.6.1-P1.tar.gz lib/isc/x86_32/include/isc/atomic.h@1.1 +176 -0 bind-9.6.1-P1.tar.gz lib/isc/x86_32/include/isc/atomic.h@1.0 +0 -0 lib/isc/x86_64/include/isc/atomic.h@1.1 +123 -0 bind-9.6.1-P1.tar.gz lib/isc/x86_64/include/isc/atomic.h@1.0 +0 -0 ChangeSet@1.2006, 2009-09-24 07:52:55-04:00, stenn@whimsy.udel.edu NTP_4_2_5P219 TAG: NTP_4_2_5P219 ChangeLog@1.445 +1 -0 NTP_4_2_5P219 ntpd/ntpd-opts.c@1.212 +2 -2 NTP_4_2_5P219 ntpd/ntpd-opts.h@1.212 +3 -3 NTP_4_2_5P219 ntpd/ntpd-opts.texi@1.210 +1 -1 NTP_4_2_5P219 ntpd/ntpd.1@1.210 +2 -2 NTP_4_2_5P219 ntpdc/ntpdc-opts.c@1.208 +2 -2 NTP_4_2_5P219 ntpdc/ntpdc-opts.h@1.208 +3 -3 NTP_4_2_5P219 ntpdc/ntpdc-opts.texi@1.207 +1 -1 NTP_4_2_5P219 ntpdc/ntpdc.1@1.207 +2 -2 NTP_4_2_5P219 ntpq/ntpq-opts.c@1.208 +2 -2 NTP_4_2_5P219 ntpq/ntpq-opts.h@1.208 +3 -3 NTP_4_2_5P219 ntpq/ntpq-opts.texi@1.207 +1 -1 NTP_4_2_5P219 ntpq/ntpq.1@1.207 +2 -2 NTP_4_2_5P219 ntpsnmpd/ntpsnmpd-opts.c@1.88 +2 -2 NTP_4_2_5P219 ntpsnmpd/ntpsnmpd-opts.h@1.88 +3 -3 NTP_4_2_5P219 ntpsnmpd/ntpsnmpd-opts.texi@1.88 +1 -1 NTP_4_2_5P219 ntpsnmpd/ntpsnmpd.1@1.88 +2 -2 NTP_4_2_5P219 packageinfo.sh@1.222 +1 -1 NTP_4_2_5P219 sntp/sntp-opts.c@1.82 +2 -2 NTP_4_2_5P219 sntp/sntp-opts.h@1.82 +3 -3 NTP_4_2_5P219 sntp/sntp-opts.texi@1.82 +1 -1 NTP_4_2_5P219 sntp/sntp.1@1.82 +2 -2 NTP_4_2_5P219 util/ntp-keygen-opts.c@1.211 +2 -2 NTP_4_2_5P219 util/ntp-keygen-opts.h@1.211 +3 -3 NTP_4_2_5P219 util/ntp-keygen-opts.texi@1.210 +1 -1 NTP_4_2_5P219 util/ntp-keygen.1@1.210 +2 -2 NTP_4_2_5P219 ChangeSet@1.2004.1.1, 2009-09-24 07:27:15+00:00, davehart@shiny.ad.hartbrothers.com Reorganize our copy of libisc code to match BIND 9 tarball layout, preparing for easier drop-in of newer libisc code in the future via a "ntp-dev-libisc-upstream" repo which gets only unmodified ISC source, and is pulled into ntp-dev allowing BK to assist with the merge of local changes in the future. BitKeeper/deleted/.del-interfaceiter.c~554505c@1.4 +0 -0 Rename: ports/winnt/libntp/interfaceiter.c -> BitKeeper/deleted/.del-interfaceiter.c~554505c BitKeeper/deleted/.del-strerror.c~7b58fc6b@1.3 +0 -0 Rename: libisc/strerror.c -> BitKeeper/deleted/.del-strerror.c~7b58fc6b Makefile.am@1.82 +7 -4 out with include/isc, in with lib/isc/include/isc and lib/isc/unix/include/isc configure.ac@1.455 +2 -1 out with include/isc, in with lib/isc/include/isc and lib/isc/unix/include/isc include/Makefile.am@1.35 +0 -2 out with include/isc, in with lib/isc/include/isc and lib/isc/unix/include/isc lib/isc/assertions.c@1.3 +0 -0 Rename: libisc/assertions.c -> lib/isc/assertions.c lib/isc/error.c@1.3 +0 -0 Rename: libisc/error.c -> lib/isc/error.c lib/isc/include/isc/Makefile.am@1.9 +3 -8 out with include/isc, in with lib/isc/include/isc and lib/isc/unix/include/isc lib/isc/include/isc/Makefile.am@1.8 +0 -0 Rename: include/isc/Makefile.am -> lib/isc/include/isc/Makefile.am lib/isc/include/isc/app.h@1.3 +0 -0 Rename: include/isc/app.h -> lib/isc/include/isc/app.h lib/isc/include/isc/assertions.h@1.3 +0 -0 Rename: include/isc/assertions.h -> lib/isc/include/isc/assertions.h lib/isc/include/isc/boolean.h@1.3 +0 -0 Rename: include/isc/boolean.h -> lib/isc/include/isc/boolean.h lib/isc/include/isc/buffer.h@1.3 +0 -0 Rename: include/isc/buffer.h -> lib/isc/include/isc/buffer.h lib/isc/include/isc/error.h@1.3 +0 -0 Rename: include/isc/error.h -> lib/isc/include/isc/error.h lib/isc/include/isc/file.h@1.3 +0 -0 Rename: include/isc/file.h -> lib/isc/include/isc/file.h lib/isc/include/isc/formatcheck.h@1.3 +0 -0 Rename: include/isc/formatcheck.h -> lib/isc/include/isc/formatcheck.h lib/isc/include/isc/interfaceiter.h@1.5 +0 -0 Rename: include/isc/interfaceiter.h -> lib/isc/include/isc/interfaceiter.h lib/isc/include/isc/ipv6.h@1.8 +0 -0 Rename: include/isc/ipv6.h -> lib/isc/include/isc/ipv6.h lib/isc/include/isc/lang.h@1.3 +0 -0 Rename: include/isc/lang.h -> lib/isc/include/isc/lang.h lib/isc/include/isc/lib.h@1.3 +0 -0 Rename: include/isc/lib.h -> lib/isc/include/isc/lib.h lib/isc/include/isc/list.h@1.3 +0 -0 Rename: include/isc/list.h -> lib/isc/include/isc/list.h lib/isc/include/isc/log.h@1.2 +0 -0 Rename: include/isc/log.h -> lib/isc/include/isc/log.h lib/isc/include/isc/magic.h@1.3 +0 -0 Rename: include/isc/magic.h -> lib/isc/include/isc/magic.h lib/isc/include/isc/md5.h@1.2 +0 -0 Rename: include/isc/md5.h -> lib/isc/include/isc/md5.h lib/isc/include/isc/mem.h@1.4 +0 -0 Rename: include/isc/mem.h -> lib/isc/include/isc/mem.h lib/isc/include/isc/msgcat.h@1.3 +0 -0 Rename: include/isc/msgcat.h -> lib/isc/include/isc/msgcat.h lib/isc/include/isc/msgs.h@1.4 +0 -0 Rename: include/isc/msgs.h -> lib/isc/include/isc/msgs.h lib/isc/include/isc/mutex.h@1.3 +0 -0 Rename: include/isc/mutex.h -> lib/isc/include/isc/mutex.h lib/isc/include/isc/netaddr.h@1.5 +0 -0 Rename: include/isc/netaddr.h -> lib/isc/include/isc/netaddr.h lib/isc/include/isc/netscope.h@1.2 +0 -0 Rename: include/isc/netscope.h -> lib/isc/include/isc/netscope.h lib/isc/include/isc/once.h@1.3 +0 -0 Rename: include/isc/once.h -> lib/isc/include/isc/once.h lib/isc/include/isc/platform.h@1.3 +0 -0 Rename: include/isc/platform.h -> lib/isc/include/isc/platform.h lib/isc/include/isc/print.h@1.3 +0 -0 Rename: include/isc/print.h -> lib/isc/include/isc/print.h lib/isc/include/isc/region.h@1.2 +0 -0 Rename: include/isc/region.h -> lib/isc/include/isc/region.h lib/isc/include/isc/result.h@1.4 +0 -0 Rename: include/isc/result.h -> lib/isc/include/isc/result.h lib/isc/include/isc/sockaddr.h@1.4 +0 -0 Rename: include/isc/sockaddr.h -> lib/isc/include/isc/sockaddr.h lib/isc/include/isc/stdio.h@1.2 +0 -0 Rename: include/isc/stdio.h -> lib/isc/include/isc/stdio.h lib/isc/include/isc/string.h@1.3 +0 -0 Rename: include/isc/string.h -> lib/isc/include/isc/string.h lib/isc/include/isc/types.h@1.3 +0 -0 Rename: include/isc/types.h -> lib/isc/include/isc/types.h lib/isc/include/isc/util.h@1.3 +0 -0 Rename: include/isc/util.h -> lib/isc/include/isc/util.h lib/isc/inet_aton.c@1.3 +0 -0 Rename: libisc/inet_aton.c -> lib/isc/inet_aton.c lib/isc/inet_ntop.c@1.6 +0 -0 Rename: libisc/inet_ntop.c -> lib/isc/inet_ntop.c lib/isc/inet_pton.c@1.3 +0 -0 Rename: libisc/inet_pton.c -> lib/isc/inet_pton.c lib/isc/lib.c@1.3 +0 -0 Rename: libisc/lib.c -> lib/isc/lib.c lib/isc/log.c@1.2 +0 -0 Rename: libisc/log.c -> lib/isc/log.c lib/isc/md5.c@1.2 +0 -0 Rename: libisc/md5.c -> lib/isc/md5.c lib/isc/mem.c@1.4 +0 -0 Rename: libisc/mem.c -> lib/isc/mem.c lib/isc/netaddr.c@1.5 +0 -0 Rename: libisc/netaddr.c -> lib/isc/netaddr.c lib/isc/netscope.c@1.2 +0 -0 Rename: libisc/netscope.c -> lib/isc/netscope.c lib/isc/nls/msgcat.c@1.5 +0 -0 Rename: lib/isc/msgcat.c -> lib/isc/nls/msgcat.c lib/isc/msgcat.c@1.4 +0 -0 Rename: libisc/msgcat.c -> lib/isc/msgcat.c lib/isc/sockaddr.c@1.7 +0 -0 Rename: libisc/sockaddr.c -> lib/isc/sockaddr.c lib/isc/unix/ifiter_getifaddrs.c@1.6 +0 -0 Rename: libisc/ifiter_getifaddrs.c -> lib/isc/unix/ifiter_getifaddrs.c lib/isc/unix/ifiter_ioctl.c@1.26 +0 -0 Rename: libisc/ifiter_ioctl.c -> lib/isc/unix/ifiter_ioctl.c lib/isc/unix/ifiter_sysctl.c@1.13 +0 -0 Rename: libisc/ifiter_sysctl.c -> lib/isc/unix/ifiter_sysctl.c lib/isc/unix/include/isc/Makefile.am@1.1 +15 -0 overlooked lib/isc/unix/include/isc lib/isc/unix/include/isc/Makefile.am@1.0 +0 -0 lib/isc/unix/include/isc/dir.h@1.2 +0 -0 Rename: include/isc/dir.h -> lib/isc/unix/include/isc/dir.h lib/isc/unix/include/isc/int.h@1.3 +0 -0 Rename: include/isc/int.h -> lib/isc/unix/include/isc/int.h lib/isc/unix/include/isc/net.h@1.9 +0 -0 Rename: include/isc/net.h -> lib/isc/unix/include/isc/net.h lib/isc/unix/include/isc/offset.h@1.3 +0 -0 Rename: include/isc/offset.h -> lib/isc/unix/include/isc/offset.h lib/isc/unix/include/isc/stat.h@1.2 +0 -0 Rename: include/isc/stat.h -> lib/isc/unix/include/isc/stat.h lib/isc/unix/include/isc/strerror.h@1.3 +0 -0 Rename: include/isc/strerror.h -> lib/isc/unix/include/isc/strerror.h lib/isc/unix/include/isc/time.h@1.2 +0 -0 Rename: include/isc/time.h -> lib/isc/unix/include/isc/time.h lib/isc/unix/interfaceiter.c@1.16 +0 -0 Rename: libisc/interfaceiter.c -> lib/isc/unix/interfaceiter.c lib/isc/unix/net.c@1.11 +0 -0 Rename: libisc/net.c -> lib/isc/unix/net.c lib/isc/unix/strerror.c@1.4 +0 -0 Rename: libisc/isc_strerror.c -> lib/isc/unix/strerror.c lib/isc/win32/include/isc/int.h@1.3 +0 -0 Rename: ports/winnt/include/isc/int.h -> lib/isc/win32/include/isc/int.h lib/isc/win32/include/isc/ipv6.h@1.7 +0 -0 Rename: ports/winnt/include/isc/ipv6.h -> lib/isc/win32/include/isc/ipv6.h lib/isc/win32/include/isc/mutex.h@1.3 +0 -0 Rename: ports/winnt/include/isc/mutex.h -> lib/isc/win32/include/isc/mutex.h lib/isc/win32/include/isc/net.h@1.8 +0 -0 Rename: ports/winnt/include/isc/net.h -> lib/isc/win32/include/isc/net.h lib/isc/win32/include/isc/offset.h@1.3 +0 -0 Rename: ports/winnt/include/isc/offset.h -> lib/isc/win32/include/isc/offset.h lib/isc/win32/include/isc/once.h@1.3 +0 -0 Rename: ports/winnt/include/isc/once.h -> lib/isc/win32/include/isc/once.h lib/isc/win32/include/isc/platform.h@1.4 +0 -0 Rename: ports/winnt/include/isc/platform.h -> lib/isc/win32/include/isc/platform.h lib/isc/win32/include/isc/stat.h@1.2 +0 -0 Rename: ports/winnt/include/isc/stat.h -> lib/isc/win32/include/isc/stat.h lib/isc/win32/include/isc/strerror.h@1.3 +0 -0 Rename: ports/winnt/include/isc/strerror.h -> lib/isc/win32/include/isc/strerror.h lib/isc/win32/include/isc/win32os.h@1.3 +0 -0 Rename: ports/winnt/include/isc/win32os.h -> lib/isc/win32/include/isc/win32os.h lib/isc/win32/interfaceiter.c@1.10.1.1 +0 -0 Rename: ports/winnt/libisc/interfaceiter.c -> lib/isc/win32/interfaceiter.c lib/isc/win32/net.c@1.10 +0 -0 Rename: ports/winnt/libisc/net.c -> lib/isc/win32/net.c lib/isc/win32/once.c@1.3 +0 -0 Rename: ports/winnt/libisc/once.c -> lib/isc/win32/once.c lib/isc/win32/strerror.c@1.9 +0 -0 Rename: ports/winnt/libisc/isc_strerror.c -> lib/isc/win32/strerror.c lib/isc/win32/win32os.c@1.3 +0 -0 Rename: ports/winnt/libisc/win32os.c -> lib/isc/win32/win32os.c libntp/Makefile.am@1.44 +16 -9 Reorganize our copy of libisc code to match BIND 9 tarball layout libntp/bsd_strerror.c@1.5 +0 -0 Rename: libntp/strerror.c -> libntp/bsd_strerror.c libparse/Makefile.am@1.13 +6 -1 Reorganize our copy of libisc code to match BIND 9 tarball layout ntpd/Makefile.am@1.68 +9 -1 Reorganize our copy of libisc code to match BIND 9 tarball layout ntpdate/Makefile.am@1.17 +5 -1 Reorganize our copy of libisc code to match BIND 9 tarball layout ntpdc/Makefile.am@1.40 +6 -1 Reorganize our copy of libisc code to match BIND 9 tarball layout ntpq/Makefile.am@1.34 +6 -1 Reorganize our copy of libisc code to match BIND 9 tarball layout ntpsnmpd/Makefile.am@1.8 +8 -2 Reorganize our copy of libisc code to match BIND 9 tarball layout parseutil/Makefile.am@1.8 +5 -1 Reorganize our copy of libisc code to match BIND 9 tarball layout ports/winnt/vc6/libntp.dsp@1.42 +18 -18 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vc6/ntpd.dsp@1.38 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vc6/ntpdate.dsp@1.22 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vc6/ntpdc.dsp@1.25 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vc6/ntpkeygen.dsp@1.18 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vc6/ntpq.dsp@1.26 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2003/libntp.vcproj@1.3 +18 -18 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2003/ntpd.vcproj@1.3 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2003/ntpdate.vcproj@1.3 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2003/ntpdc.vcproj@1.3 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2003/ntpkeygen.vcproj@1.3 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2003/ntpq.vcproj@1.3 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2005/libntp.vcproj@1.3 +18 -18 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2005/ntpd.vcproj@1.3 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2005/ntpdate.vcproj@1.3 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2005/ntpdc.vcproj@1.3 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2005/ntpkeygen.vcproj@1.3 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2005/ntpq.vcproj@1.3 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2008/libntp/libntp.vcproj@1.18 +18 -36 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.7 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2008/ntpd/ntpd.vcproj@1.18 +12 -12 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.10 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.10 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc ports/winnt/vs2008/ntpq/ntpq.vcproj@1.9 +2 -2 out with ports/winnt/include/isc and include/isc, in with lib/isc/include/win32/isc and lib/isc/include/isc sntp/Makefile.am@1.11 +7 -3 out with include/isc, in with lib/isc/include/isc and lib/isc/unix/include/isc util/Makefile.am@1.39 +6 -1 out with include/isc, in with lib/isc/include/isc and lib/isc/unix/include/isc ChangeSet@1.2005, 2009-09-22 19:22:09+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1315] "interface ignore 0.0.0.0" is ignored. add implicit "nic ignore all" rule before any rules from ntp.conf, so "nic listen eth0" alone means the same as "-I eth0". add wildcard match class for interface/nic rules. fix mistaken carryover of prefixlen from one rule to the next. Ensure IPv6 localhost address ::1 is included in libisc's Windows IPv6 address enumeration, allowing ntpq and ntpdc's hardcoding to 127.0.0.1 on Windows to end. ChangeLog@1.444 +8 -0 [Bug 1315] "interface ignore 0.0.0.0" is ignored. add implicit "nic ignore all" rule before any rules from ntp.conf, so "nic listen eth0" alone means the same as "-I eth0". add wildcard match class for interface/nic rules. fix mistaken carryover of prefixlen from one rule to the next. Ensure IPv6 localhost address ::1 is included in libisc's Windows IPv6 address enumeration, allowing ntpq and ntpdc's hardcoding to 127.0.0.1 on Windows to end. include/ntp_io.h@1.12 +4 -2 add wildcard match class for interface/nic rules. add sau_from_netaddr() prototype ntpd/ntp_config.c@1.220 +26 -9 fix mistaken carryover of prefixlen from one rule to the next. add wildcard match class for interface/nic rules. ntpd/ntp_io.c@1.298 +193 -76 [Bug 1315] "interface ignore 0.0.0.0" is ignored. add implicit "nic ignore all" rule before any rules from ntp.conf, so "nic listen eth0" alone means the same as "-I eth0". add wildcard match class for interface/nic rules. ntpd/ntp_parser.c@1.49 +595 -595 Bison product ntpd/ntp_parser.h@1.30 +33 -31 Bison product ntpd/ntp_parser.y@1.44 +2 -0 add wildcard match class for interface/nic rules. ntpd/ntp_scanner.c@1.27 +18 -9 add wildcard match class for interface/nic rules. better fix for Sunday's change to close-double-quote handling. ntpd/ntp_scanner.h@1.11 +4 -0 FOLLBY_TOKEN/FOLLBY_STRING use clarification comment ntpd/ntpd.c@1.108 +0 -6 add implicit "nic ignore all" rule before any rules from ntp.conf, so "nic listen eth0" alone means the same as "-I eth0". ntpdc/ntpdc.c@1.70 +0 -8 Ensure IPv6 localhost address ::1 is included in libisc's Windows IPv6 address enumeration, allowing ntpq and ntpdc's hardcoding to 127.0.0.1 on Windows to end. ntpq/ntpq.c@1.91 +0 -8 Ensure IPv6 localhost address ::1 is included in libisc's Windows IPv6 address enumeration, allowing ntpq and ntpdc's hardcoding to 127.0.0.1 on Windows to end. ports/winnt/libisc/interfaceiter.c@1.11 +72 -11 Ensure IPv6 localhost address ::1 is included in libisc's Windows IPv6 address enumeration, allowing ntpq and ntpdc's hardcoding to 127.0.0.1 on Windows to end. ChangeSet@1.2004, 2009-09-21 07:51:38-04:00, stenn@whimsy.udel.edu NTP_4_2_5P218 TAG: NTP_4_2_5P218 ChangeLog@1.443 +1 -0 NTP_4_2_5P218 ntpd/ntpd-opts.c@1.211 +2 -2 NTP_4_2_5P218 ntpd/ntpd-opts.h@1.211 +3 -3 NTP_4_2_5P218 ntpd/ntpd-opts.texi@1.209 +1 -1 NTP_4_2_5P218 ntpd/ntpd.1@1.209 +2 -2 NTP_4_2_5P218 ntpdc/ntpdc-opts.c@1.207 +2 -2 NTP_4_2_5P218 ntpdc/ntpdc-opts.h@1.207 +3 -3 NTP_4_2_5P218 ntpdc/ntpdc-opts.texi@1.206 +1 -1 NTP_4_2_5P218 ntpdc/ntpdc.1@1.206 +2 -2 NTP_4_2_5P218 ntpq/ntpq-opts.c@1.207 +2 -2 NTP_4_2_5P218 ntpq/ntpq-opts.h@1.207 +3 -3 NTP_4_2_5P218 ntpq/ntpq-opts.texi@1.206 +1 -1 NTP_4_2_5P218 ntpq/ntpq.1@1.206 +2 -2 NTP_4_2_5P218 ntpsnmpd/ntpsnmpd-opts.c@1.87 +2 -2 NTP_4_2_5P218 ntpsnmpd/ntpsnmpd-opts.h@1.87 +3 -3 NTP_4_2_5P218 ntpsnmpd/ntpsnmpd-opts.texi@1.87 +1 -1 NTP_4_2_5P218 ntpsnmpd/ntpsnmpd.1@1.87 +2 -2 NTP_4_2_5P218 packageinfo.sh@1.221 +1 -1 NTP_4_2_5P218 sntp/sntp-opts.c@1.81 +2 -2 NTP_4_2_5P218 sntp/sntp-opts.h@1.81 +3 -3 NTP_4_2_5P218 sntp/sntp-opts.texi@1.81 +1 -1 NTP_4_2_5P218 sntp/sntp.1@1.81 +2 -2 NTP_4_2_5P218 util/ntp-keygen-opts.c@1.210 +2 -2 NTP_4_2_5P218 util/ntp-keygen-opts.h@1.210 +3 -3 NTP_4_2_5P218 util/ntp-keygen-opts.texi@1.209 +1 -1 NTP_4_2_5P218 util/ntp-keygen.1@1.209 +2 -2 NTP_4_2_5P218 ChangeSet@1.2003, 2009-09-21 04:57:32+00:00, davehart@shiny.ad.hartbrothers.com correct parsing and processing of setvar directive. highlight location of ntpq :config syntax errors with ^. ChangeLog@1.442 +2 -0 correct parsing and processing of setvar directive. highlight location of ntpq :config syntax errors with ^. include/ntp_config.h@1.63 +2 -1 correct parsing and processing of setvar directive. ntpd/ntp_config.c@1.219 +62 -55 correct parsing and processing of setvar directive. ntpd/ntp_scanner.c@1.26 +35 -5 correct parsing and processing of setvar directive. ntpd/ntp_scanner.h@1.10 +7 -6 correct parsing and processing of setvar directive. ntpq/ntpq-subs.c@1.37 +25 -9 highlight location of ntpq :config syntax errors with ^. ntpq/ntpq.h@1.8 +2 -0 expose interactive variable to ntpq-subs.c ChangeSet@1.2000.1.1, 2009-09-21 00:10:58+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1314] saveconfig emits -4 and -6 on when not given. clarify (former) NO_ARG, SINGLE_ARG, MULTIPLE_ARG renaming to FOLLBY_TOKEN, FOLLBY_STRING, FOLLBY_STRINGS_TO_EOC. parser, saveconfig cleanup to store T_ identifiers in syntax tree. ChangeLog@1.439.1.1 +4 -0 [Bug 1314] saveconfig emits -4 and -6 on when not given. clarify (former) NO_ARG, SINGLE_ARG, MULTIPLE_ARG renaming to FOLLBY_TOKEN, FOLLBY_STRING, FOLLBY_STRINGS_TO_EOC. parser, saveconfig cleanup to store T_ identifiers in syntax tree. include/ntp_config.h@1.62 +8 -9 parser, saveconfig cleanup to store T_ identifiers in syntax tree. ntpd/ntp_config.c@1.218 +612 -947 parser, saveconfig cleanup to store T_ identifiers in syntax tree. move scanner's keyword table from ntp_config.c to ntp_scanner.c ntpd/ntp_parser.c@1.48 +275 -466 Bison product ntpd/ntp_parser.h@1.29 +3 -3 Bison output ntpd/ntp_parser.y@1.43 +100 -96 parser, saveconfig cleanup to store T_ identifiers in syntax tree. ntpd/ntp_scanner.c@1.25 +269 -64 clarify (former) NO_ARG, SINGLE_ARG, MULTIPLE_ARG renaming to FOLLBY_TOKEN, FOLLBY_STRING, FOLLBY_STRINGS_TO_EOC. move scanner's keyword table from ntp_config.c to ntp_scanner.c ntpd/ntp_scanner.h@1.9 +25 -9 clarify (former) NO_ARG, SINGLE_ARG, MULTIPLE_ARG renaming to FOLLBY_TOKEN, FOLLBY_STRING, FOLLBY_STRINGS_TO_EOC. ChangeSet@1.2001, 2009-09-20 07:51:55-04:00, stenn@whimsy.udel.edu NTP_4_2_5P217 TAG: NTP_4_2_5P217 ChangeLog@1.440 +1 -0 NTP_4_2_5P217 ntpd/ntpd-opts.c@1.210 +2 -2 NTP_4_2_5P217 ntpd/ntpd-opts.h@1.210 +3 -3 NTP_4_2_5P217 ntpd/ntpd-opts.texi@1.208 +1 -1 NTP_4_2_5P217 ntpd/ntpd.1@1.208 +2 -2 NTP_4_2_5P217 ntpdc/ntpdc-opts.c@1.206 +2 -2 NTP_4_2_5P217 ntpdc/ntpdc-opts.h@1.206 +3 -3 NTP_4_2_5P217 ntpdc/ntpdc-opts.texi@1.205 +1 -1 NTP_4_2_5P217 ntpdc/ntpdc.1@1.205 +2 -2 NTP_4_2_5P217 ntpq/ntpq-opts.c@1.206 +2 -2 NTP_4_2_5P217 ntpq/ntpq-opts.h@1.206 +3 -3 NTP_4_2_5P217 ntpq/ntpq-opts.texi@1.205 +1 -1 NTP_4_2_5P217 ntpq/ntpq.1@1.205 +2 -2 NTP_4_2_5P217 ntpsnmpd/ntpsnmpd-opts.c@1.86 +2 -2 NTP_4_2_5P217 ntpsnmpd/ntpsnmpd-opts.h@1.86 +3 -3 NTP_4_2_5P217 ntpsnmpd/ntpsnmpd-opts.texi@1.86 +1 -1 NTP_4_2_5P217 ntpsnmpd/ntpsnmpd.1@1.86 +2 -2 NTP_4_2_5P217 packageinfo.sh@1.220 +1 -1 NTP_4_2_5P217 sntp/sntp-opts.c@1.80 +2 -2 NTP_4_2_5P217 sntp/sntp-opts.h@1.80 +3 -3 NTP_4_2_5P217 sntp/sntp-opts.texi@1.80 +1 -1 NTP_4_2_5P217 sntp/sntp.1@1.80 +2 -2 NTP_4_2_5P217 util/ntp-keygen-opts.c@1.209 +2 -2 NTP_4_2_5P217 util/ntp-keygen-opts.h@1.209 +3 -3 NTP_4_2_5P217 util/ntp-keygen-opts.texi@1.208 +1 -1 NTP_4_2_5P217 util/ntp-keygen.1@1.208 +2 -2 NTP_4_2_5P217 ChangeSet@1.2000, 2009-09-19 16:52:44+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1300] reject remote configuration of dangerous items. ChangeLog@1.439 +1 -0 [Bug 1300] reject remote configuration of dangerous items. include/ntpd.h@1.134 +1 -0 [Bug 1300] reject remote configuration of dangerous items. ntpd/ntp_config.c@1.217 +43 -10 [Bug 1300] reject remote configuration of dangerous items. ntpd/ntp_control.c@1.123 +61 -74 [Bug 1300] reject remote configuration of dangerous items. ntpd/ntp_parser.c@1.47 +838 -743 Bison output ntpd/ntp_parser.h@1.28 +87 -85 Bison output ntpd/ntp_parser.y@1.42 +106 -17 [Bug 1300] reject remote configuration of dangerous items. ntpd/refclock_palisade.c@1.31 +2 -5 un-revert another earlier fix (no need for Windows-specific COM%d:) ntpq/ntpq-subs.c@1.36 +19 -15 trim one trailing newline from :config response ChangeSet@1.1999, 2009-09-19 07:53:27-04:00, stenn@whimsy.udel.edu NTP_4_2_5P216 TAG: NTP_4_2_5P216 ChangeLog@1.438 +1 -0 NTP_4_2_5P216 ntpd/ntpd-opts.c@1.209 +2 -2 NTP_4_2_5P216 ntpd/ntpd-opts.h@1.209 +3 -3 NTP_4_2_5P216 ntpd/ntpd-opts.texi@1.207 +1 -1 NTP_4_2_5P216 ntpd/ntpd.1@1.207 +2 -2 NTP_4_2_5P216 ntpdc/ntpdc-opts.c@1.205 +2 -2 NTP_4_2_5P216 ntpdc/ntpdc-opts.h@1.205 +3 -3 NTP_4_2_5P216 ntpdc/ntpdc-opts.texi@1.204 +1 -1 NTP_4_2_5P216 ntpdc/ntpdc.1@1.204 +2 -2 NTP_4_2_5P216 ntpq/ntpq-opts.c@1.205 +2 -2 NTP_4_2_5P216 ntpq/ntpq-opts.h@1.205 +3 -3 NTP_4_2_5P216 ntpq/ntpq-opts.texi@1.204 +1 -1 NTP_4_2_5P216 ntpq/ntpq.1@1.204 +2 -2 NTP_4_2_5P216 ntpsnmpd/ntpsnmpd-opts.c@1.85 +2 -2 NTP_4_2_5P216 ntpsnmpd/ntpsnmpd-opts.h@1.85 +3 -3 NTP_4_2_5P216 ntpsnmpd/ntpsnmpd-opts.texi@1.85 +1 -1 NTP_4_2_5P216 ntpsnmpd/ntpsnmpd.1@1.85 +2 -2 NTP_4_2_5P216 packageinfo.sh@1.219 +1 -1 NTP_4_2_5P216 sntp/sntp-opts.c@1.79 +2 -2 NTP_4_2_5P216 sntp/sntp-opts.h@1.79 +3 -3 NTP_4_2_5P216 sntp/sntp-opts.texi@1.79 +1 -1 NTP_4_2_5P216 sntp/sntp.1@1.79 +2 -2 NTP_4_2_5P216 util/ntp-keygen-opts.c@1.208 +2 -2 NTP_4_2_5P216 util/ntp-keygen-opts.h@1.208 +3 -3 NTP_4_2_5P216 util/ntp-keygen-opts.texi@1.207 +1 -1 NTP_4_2_5P216 util/ntp-keygen.1@1.207 +2 -2 NTP_4_2_5P216 ChangeSet@1.1998, 2009-09-19 06:21:08+00:00, davehart@shiny.ad.hartbrothers.com CID 10 missing free(up); in refclock_palisade.c error return, again. CID 83 added assertion to demonstrate config_nic_rules() does not call strchr(NULL, '/'). ChangeLog@1.437 +3 -0 CID 10 missing free(up); in refclock_palisade.c error return, again. CID 83 added assertion to demonstrate config_nic_rules() does not call strchr(NULL, '/'). ntpd/ntp_config.c@1.216 +1 -0 CID 83 added assertion to demonstrate config_nic_rules() does not call strchr(NULL, '/'). ntpd/refclock_palisade.c@1.30 +3 -9 CID 10 missing free(up); in refclock_palisade.c error return, again. ChangeSet@1.1997, 2009-09-19 02:18:44+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1312] ntpq/ntpdc MD5 passwords truncated to 8 chars on Suns. ChangeLog@1.436 +1 -0 [Bug 1312] ntpq/ntpdc MD5 passwords truncated to 8 chars on Suns. configure.ac@1.454 +16 -0 [Bug 1312] ntpq/ntpdc MD5 passwords truncated to 8 chars on Suns. include/ntp_stdlib.h@1.32 +4 -3 make #include "ntp_stdlib.h" all that's needed to use msyslog() by including ntp_syslog.h from ntp_stdlib.h ntpdc/ntpdc.c@1.69 +12 -4 [Bug 1312] ntpq/ntpdc MD5 passwords truncated to 8 chars on Suns. Clean up authenticated request codepath. ntpq/ntpq.c@1.90 +13 -17 [Bug 1312] ntpq/ntpdc MD5 passwords truncated to 8 chars on Suns. Clean up authenticated request codepath. Remove unneeded SYS_WINNT libntp workarounds from last century. ChangeSet@1.1996, 2009-09-18 07:51:03-04:00, stenn@whimsy.udel.edu NTP_4_2_5P215 TAG: NTP_4_2_5P215 ChangeLog@1.435 +1 -0 NTP_4_2_5P215 ntpd/ntpd-opts.c@1.208 +2 -2 NTP_4_2_5P215 ntpd/ntpd-opts.h@1.208 +3 -3 NTP_4_2_5P215 ntpd/ntpd-opts.texi@1.206 +1 -1 NTP_4_2_5P215 ntpd/ntpd.1@1.206 +2 -2 NTP_4_2_5P215 ntpdc/ntpdc-opts.c@1.204 +2 -2 NTP_4_2_5P215 ntpdc/ntpdc-opts.h@1.204 +3 -3 NTP_4_2_5P215 ntpdc/ntpdc-opts.texi@1.203 +1 -1 NTP_4_2_5P215 ntpdc/ntpdc.1@1.203 +2 -2 NTP_4_2_5P215 ntpq/ntpq-opts.c@1.204 +2 -2 NTP_4_2_5P215 ntpq/ntpq-opts.h@1.204 +3 -3 NTP_4_2_5P215 ntpq/ntpq-opts.texi@1.203 +1 -1 NTP_4_2_5P215 ntpq/ntpq.1@1.203 +2 -2 NTP_4_2_5P215 ntpsnmpd/ntpsnmpd-opts.c@1.84 +2 -2 NTP_4_2_5P215 ntpsnmpd/ntpsnmpd-opts.h@1.84 +3 -3 NTP_4_2_5P215 ntpsnmpd/ntpsnmpd-opts.texi@1.84 +1 -1 NTP_4_2_5P215 ntpsnmpd/ntpsnmpd.1@1.84 +2 -2 NTP_4_2_5P215 packageinfo.sh@1.218 +1 -1 NTP_4_2_5P215 sntp/sntp-opts.c@1.78 +2 -2 NTP_4_2_5P215 sntp/sntp-opts.h@1.78 +3 -3 NTP_4_2_5P215 sntp/sntp-opts.texi@1.78 +1 -1 NTP_4_2_5P215 sntp/sntp.1@1.78 +2 -2 NTP_4_2_5P215 util/ntp-keygen-opts.c@1.207 +2 -2 NTP_4_2_5P215 util/ntp-keygen-opts.h@1.207 +3 -3 NTP_4_2_5P215 util/ntp-keygen-opts.texi@1.206 +1 -1 NTP_4_2_5P215 util/ntp-keygen.1@1.206 +2 -2 NTP_4_2_5P215 ChangeSet@1.1995, 2009-09-17 23:25:59-04:00, stenn@pogo.udel.edu [Bug 1292] Workaround last VC6 unsigned __int64 kink ChangeLog@1.434 +1 -0 [Bug 1292] Workaround last VC6 unsigned __int64 kink ChangeSet@1.1994, 2009-09-17 15:28:57+02:00, burnicki@pogo.udel.edu [Bug 1292] Workaround last VC6 unsigned __int64 kink. ports/winnt/ntpd/nt_clockstuff.c@1.36 +1 -1 [Bug 1292] Workaround last VC6 unsigned __int64 kink. ChangeSet@1.1993, 2009-09-17 07:55:35-04:00, stenn@whimsy.udel.edu NTP_4_2_5P214 TAG: NTP_4_2_5P214 ChangeLog@1.433 +1 -0 NTP_4_2_5P214 ntpd/ntpd-opts.c@1.207 +2 -2 NTP_4_2_5P214 ntpd/ntpd-opts.h@1.207 +3 -3 NTP_4_2_5P214 ntpd/ntpd-opts.texi@1.205 +1 -1 NTP_4_2_5P214 ntpd/ntpd.1@1.205 +2 -2 NTP_4_2_5P214 ntpdc/ntpdc-opts.c@1.203 +2 -2 NTP_4_2_5P214 ntpdc/ntpdc-opts.h@1.203 +3 -3 NTP_4_2_5P214 ntpdc/ntpdc-opts.texi@1.202 +1 -1 NTP_4_2_5P214 ntpdc/ntpdc.1@1.202 +2 -2 NTP_4_2_5P214 ntpq/ntpq-opts.c@1.203 +2 -2 NTP_4_2_5P214 ntpq/ntpq-opts.h@1.203 +3 -3 NTP_4_2_5P214 ntpq/ntpq-opts.texi@1.202 +1 -1 NTP_4_2_5P214 ntpq/ntpq.1@1.202 +2 -2 NTP_4_2_5P214 ntpsnmpd/ntpsnmpd-opts.c@1.83 +2 -2 NTP_4_2_5P214 ntpsnmpd/ntpsnmpd-opts.h@1.83 +3 -3 NTP_4_2_5P214 ntpsnmpd/ntpsnmpd-opts.texi@1.83 +1 -1 NTP_4_2_5P214 ntpsnmpd/ntpsnmpd.1@1.83 +2 -2 NTP_4_2_5P214 packageinfo.sh@1.217 +1 -1 NTP_4_2_5P214 sntp/sntp-opts.c@1.77 +2 -2 NTP_4_2_5P214 sntp/sntp-opts.h@1.77 +3 -3 NTP_4_2_5P214 sntp/sntp-opts.texi@1.77 +1 -1 NTP_4_2_5P214 sntp/sntp.1@1.77 +2 -2 NTP_4_2_5P214 util/ntp-keygen-opts.c@1.206 +2 -2 NTP_4_2_5P214 util/ntp-keygen-opts.h@1.206 +3 -3 NTP_4_2_5P214 util/ntp-keygen-opts.texi@1.205 +1 -1 NTP_4_2_5P214 util/ntp-keygen.1@1.205 +2 -2 NTP_4_2_5P214 ChangeSet@1.1992, 2009-09-17 01:31:14+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1303] remove top-level "autokey" directive. correct "checking" message for --disable-bug1243-fix. use "nic listen 192.168.0.0/16" instead of "nic listen 192.168.0.0 prefixlen 16" ChangeLog@1.432 +3 -0 [Bug 1303] remove top-level "autokey" directive. use "nic listen 192.168.0.0/16" instead of "nic listen 192.168.0.0 prefixlen 16". configure.ac@1.453 +1 -1 correct "checking" message for --disable-bug1243-fix. html/miscopt.html@1.48 +2 -2 use "nic listen 192.168.0.0/16" instead of "nic listen 192.168.0.0 prefixlen 16". include/ntp_config.h@1.61 +1 -3 [Bug 1303] remove top-level "autokey" directive. ntpd/ntp_config.c@1.215 +28 -10 use "nic listen 192.168.0.0/16" instead of "nic listen 192.168.0.0 prefixlen 16". ntpd/ntp_parser.c@1.46 +758 -789 Bison output ntpd/ntp_parser.h@1.27 +103 -105 use "nic listen 192.168.0.0/16" instead of "nic listen 192.168.0.0 prefixlen 16". ntpd/ntp_parser.y@1.41 +4 -12 [Bug 1303] remove top-level "autokey" directive. use "nic listen 192.168.0.0/16" instead of "nic listen 192.168.0.0 prefixlen 16". ChangeSet@1.1991, 2009-09-16 07:51:15-04:00, stenn@whimsy.udel.edu NTP_4_2_5P213 TAG: NTP_4_2_5P213 ChangeLog@1.431 +1 -0 NTP_4_2_5P213 ntpd/ntpd-opts.c@1.206 +2 -2 NTP_4_2_5P213 ntpd/ntpd-opts.h@1.206 +3 -3 NTP_4_2_5P213 ntpd/ntpd-opts.texi@1.204 +1 -1 NTP_4_2_5P213 ntpd/ntpd.1@1.204 +2 -2 NTP_4_2_5P213 ntpdc/ntpdc-opts.c@1.202 +2 -2 NTP_4_2_5P213 ntpdc/ntpdc-opts.h@1.202 +3 -3 NTP_4_2_5P213 ntpdc/ntpdc-opts.texi@1.201 +1 -1 NTP_4_2_5P213 ntpdc/ntpdc.1@1.201 +2 -2 NTP_4_2_5P213 ntpq/ntpq-opts.c@1.202 +2 -2 NTP_4_2_5P213 ntpq/ntpq-opts.h@1.202 +3 -3 NTP_4_2_5P213 ntpq/ntpq-opts.texi@1.201 +1 -1 NTP_4_2_5P213 ntpq/ntpq.1@1.201 +2 -2 NTP_4_2_5P213 ntpsnmpd/ntpsnmpd-opts.c@1.82 +2 -2 NTP_4_2_5P213 ntpsnmpd/ntpsnmpd-opts.h@1.82 +3 -3 NTP_4_2_5P213 ntpsnmpd/ntpsnmpd-opts.texi@1.82 +1 -1 NTP_4_2_5P213 ntpsnmpd/ntpsnmpd.1@1.82 +2 -2 NTP_4_2_5P213 packageinfo.sh@1.216 +1 -1 NTP_4_2_5P213 sntp/sntp-opts.c@1.76 +2 -2 NTP_4_2_5P213 sntp/sntp-opts.h@1.76 +3 -3 NTP_4_2_5P213 sntp/sntp-opts.texi@1.76 +1 -1 NTP_4_2_5P213 sntp/sntp.1@1.76 +2 -2 NTP_4_2_5P213 util/ntp-keygen-opts.c@1.205 +2 -2 NTP_4_2_5P213 util/ntp-keygen-opts.h@1.205 +3 -3 NTP_4_2_5P213 util/ntp-keygen-opts.texi@1.204 +1 -1 NTP_4_2_5P213 util/ntp-keygen.1@1.204 +2 -2 NTP_4_2_5P213 ChangeSet@1.1988.1.1, 2009-09-15 13:08:48-04:00, murray@pogo.udel.edu refclock_palisade.c, ChangeLog: Fix for bug 1310 ChangeLog@1.428.1.1 +1 -0 Fix for bug 1310 ntpd/refclock_palisade.c@1.29 +12 -9 Fix for bug 1310 ChangeSet@1.1989, 2009-09-15 07:57:12-04:00, stenn@whimsy.udel.edu NTP_4_2_5P212 TAG: NTP_4_2_5P212 ChangeLog@1.429 +1 -0 NTP_4_2_5P212 ntpd/ntpd-opts.c@1.205 +2 -2 NTP_4_2_5P212 ntpd/ntpd-opts.h@1.205 +3 -3 NTP_4_2_5P212 ntpd/ntpd-opts.texi@1.203 +1 -1 NTP_4_2_5P212 ntpd/ntpd.1@1.203 +2 -2 NTP_4_2_5P212 ntpdc/ntpdc-opts.c@1.201 +2 -2 NTP_4_2_5P212 ntpdc/ntpdc-opts.h@1.201 +3 -3 NTP_4_2_5P212 ntpdc/ntpdc-opts.texi@1.200 +1 -1 NTP_4_2_5P212 ntpdc/ntpdc.1@1.200 +2 -2 NTP_4_2_5P212 ntpq/ntpq-opts.c@1.201 +2 -2 NTP_4_2_5P212 ntpq/ntpq-opts.h@1.201 +3 -3 NTP_4_2_5P212 ntpq/ntpq-opts.texi@1.200 +1 -1 NTP_4_2_5P212 ntpq/ntpq.1@1.200 +2 -2 NTP_4_2_5P212 ntpsnmpd/ntpsnmpd-opts.c@1.81 +2 -2 NTP_4_2_5P212 ntpsnmpd/ntpsnmpd-opts.h@1.81 +3 -3 NTP_4_2_5P212 ntpsnmpd/ntpsnmpd-opts.texi@1.81 +1 -1 NTP_4_2_5P212 ntpsnmpd/ntpsnmpd.1@1.81 +2 -2 NTP_4_2_5P212 packageinfo.sh@1.215 +1 -1 NTP_4_2_5P212 sntp/sntp-opts.c@1.75 +2 -2 NTP_4_2_5P212 sntp/sntp-opts.h@1.75 +3 -3 NTP_4_2_5P212 sntp/sntp-opts.texi@1.75 +1 -1 NTP_4_2_5P212 sntp/sntp.1@1.75 +2 -2 NTP_4_2_5P212 util/ntp-keygen-opts.c@1.204 +2 -2 NTP_4_2_5P212 util/ntp-keygen-opts.h@1.204 +3 -3 NTP_4_2_5P212 util/ntp-keygen-opts.texi@1.203 +1 -1 NTP_4_2_5P212 util/ntp-keygen.1@1.203 +2 -2 NTP_4_2_5P212 ChangeSet@1.1988, 2009-09-15 03:49:51-04:00, stenn@whimsy.udel.edu Typo cleanup ChangeLog@1.428 +1 -2 Typo cleanup ChangeSet@1.1987, 2009-09-15 07:25:11+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1311] 4.2.5p211 doesn't build in no-debug mode. ChangeLog@1.427 +3 -1 [Bug 1311] 4.2.5p211 doesn't build in no-debug mode. ntpd/refclock_palisade.c@1.28 +73 -68 [Bug 1311] 4.2.5p211 doesn't build in no-debug mode. convert leading whitespace to tabs ntpd/refclock_palisade.h@1.13 +12 -10 convert leading whitespace to tabs ChangeSet@1.1984.1.3, 2009-09-15 02:21:46-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.421.2.6 +1 -0 Documentation updates from Dave Mills html/authopt.html@1.51 +2 -2 Documentation updates from Dave Mills html/miscopt.html@1.43.1.1 +2 -2 Documentation updates from Dave Mills ChangeSet@1.1984.1.2, 2009-09-15 01:28:52-04:00, stenn@whimsy.udel.edu Make the code agree with the spec and the book (Dave Mills) ChangeLog@1.421.2.5 +1 -0 Make the code agree with the spec and the book (Dave Mills) include/ntp.h@1.163 +1 -1 Make the code agree with the spec and the book (Dave Mills) libntp/systime.c@1.48 +24 -19 Make the code agree with the spec and the book (Dave Mills) ntpd/ntp_proto.c@1.293 +22 -29 Make the code agree with the spec and the book (Dave Mills) ntpd/ntp_timer.c@1.55 +1 -1 Make the code agree with the spec and the book (Dave Mills) ChangeSet@1.1984.1.1, 2009-09-14 07:52:01-04:00, stenn@whimsy.udel.edu NTP_4_2_5P211 TAG: NTP_4_2_5P211 ChangeLog@1.421.2.4 +1 -0 NTP_4_2_5P211 ntpd/ntpd-opts.c@1.204 +2 -2 NTP_4_2_5P211 ntpd/ntpd-opts.h@1.204 +3 -3 NTP_4_2_5P211 ntpd/ntpd-opts.texi@1.202 +2 -2 NTP_4_2_5P211 ntpd/ntpd.1@1.202 +2 -2 NTP_4_2_5P211 ntpdc/ntpdc-opts.c@1.200 +2 -2 NTP_4_2_5P211 ntpdc/ntpdc-opts.h@1.200 +3 -3 NTP_4_2_5P211 ntpdc/ntpdc-opts.texi@1.199 +2 -2 NTP_4_2_5P211 ntpdc/ntpdc.1@1.199 +2 -2 NTP_4_2_5P211 ntpq/ntpq-opts.c@1.200 +12 -6 NTP_4_2_5P211 ntpq/ntpq-opts.h@1.200 +3 -3 NTP_4_2_5P211 ntpq/ntpq-opts.texi@1.199 +2 -2 NTP_4_2_5P211 ntpq/ntpq.1@1.199 +2 -2 NTP_4_2_5P211 ntpsnmpd/ntpsnmpd-opts.c@1.80 +2 -2 NTP_4_2_5P211 ntpsnmpd/ntpsnmpd-opts.h@1.80 +3 -3 NTP_4_2_5P211 ntpsnmpd/ntpsnmpd-opts.texi@1.80 +1 -1 NTP_4_2_5P211 ntpsnmpd/ntpsnmpd.1@1.80 +2 -2 NTP_4_2_5P211 packageinfo.sh@1.214 +1 -1 NTP_4_2_5P211 sntp/sntp-opts.c@1.74 +2 -2 NTP_4_2_5P211 sntp/sntp-opts.h@1.74 +3 -3 NTP_4_2_5P211 sntp/sntp-opts.texi@1.74 +51 -2 NTP_4_2_5P211 sntp/sntp.1@1.74 +2 -2 NTP_4_2_5P211 util/ntp-keygen-opts.c@1.203 +2 -2 NTP_4_2_5P211 util/ntp-keygen-opts.h@1.203 +3 -3 NTP_4_2_5P211 util/ntp-keygen-opts.texi@1.202 +3 -3 NTP_4_2_5P211 util/ntp-keygen.1@1.202 +2 -2 NTP_4_2_5P211 ChangeSet@1.1983, 2009-09-14 03:30:37-04:00, stenn@pogo.udel.edu [Bug 1296] Added Support for Trimble Acutime Gold ChangeLog@1.421.4.1 +1 -0 [Bug 1296] Added Support for Trimble Acutime Gold ChangeSet@1.1981.4.1, 2009-09-12 11:54:54+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1292] more VC6 unsigned __int64 workarounds. ChangeLog@1.421.3.1 +1 -0 [Bug 1292] more VC6 unsigned __int64 workarounds. ports/winnt/ntpd/nt_clockstuff.c@1.35 +11 -4 [Bug 1292] more VC6 unsigned __int64 workarounds. ChangeSet@1.1981.3.1, 2009-09-12 07:25:45+00:00, davehart@shiny.ad.hartbrothers.com [Bug 663] respect ntpq -c and -p order on command line. ChangeLog@1.421.2.1 +1 -0 [Bug 663] respect ntpq -c and -p order on command line. ntpq/ntpq-opts.def@1.13 +2 -1 [Bug 663] respect ntpq -c and -p order on command line. ntpq/ntpq.c@1.89 +37 -13 [Bug 663] respect ntpq -c and -p order on command line. ChangeSet@1.1981.2.1, 2009-09-11 06:55:37+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1243] MD5auth_setkey zero-fills key from first zero octet. [Bug 1295] leftover fix, do not crash on exit in free_config_trap() when "trap 1.2.3.4" is used without any further options. CID 79: kod_init_kod_db() fails to fclose(db_s) in two error paths. CID 80: attempt to quiet Coverity false positive re: leaking "reason" in main(). CID 81: savedconfig leaked in save_config(). ChangeLog@1.421.1.1 +7 -0 [Bug 1243] MD5auth_setkey zero-fills key from first zero octet. [Bug 1295] leftover fix, do not crash on exit in free_config_trap() when "trap 1.2.3.4" is used without any further options. CID 79: kod_init_kod_db() fails to fclose(db_s) in two error paths. CID 80: attempt to quiet Coverity false positive re: leaking "reason" in main(). CID 81: savedconfig leaked in save_config(). configure.ac@1.450.1.1 +20 -0 add support for --disable-bug1243-fix include/ntpd.h@1.131.1.1 +12 -0 add framework from "enable bc_bug1243" under #ifdef for future use libntp/authkeys.c@1.14 +18 -16 [Bug 1243] MD5auth_setkey zero-fills key from first zero octet. ntpd/ntp_config.c@1.211.1.1 +122 -84 add framework from "enable bc_bug1243" under #ifdef for future use. [Bug 1295] leftover fix, do not crash on exit in free_config_trap() when "trap 1.2.3.4" is used without any further options. ntpd/ntp_control.c@1.120.1.1 +2 -2 CID 81: savedconfig leaked in save_config() ntpd/ntp_parser.c@1.42.1.1 +207 -210 Bison product ntpd/ntp_parser.y@1.37.1.1 +11 -15 do not crash applying "crypto" command with no options. add framework from "enable bc_bug1243" under #ifdef for future use. sntp/kod_management.c@1.13 +6 -2 CID 79: kod_init_kod_db() fails to fclose(db_s) in two error paths CID 80: attempt to quiet Coverity false positive re: leaking "reason" in main() ChangeSet@1.1981.1.3, 2009-09-10 20:12:31+00:00, davehart@shiny.ad.hartbrothers.com pick up Dr. Mills' miscopt.html leapfile indent correction from 8-Sep html/miscopt.html@1.46 +2 -2 pick up Dr. Mills' leapfile indent correction from 8-Sep ChangeSet@1.1981.1.2, 2009-09-10 04:31:45+00:00, davehart@shiny.ad.hartbrothers.com switch to verb then object order, "nic listen all", "interface drop eth0" Correct syntax error line & column numbers. ChangeLog@1.423 +2 -1 switch to verb then object order, "nic listen all", "interface drop eth0" Correct syntax error line & column numbers. html/miscopt.html@1.45 +2 -2 switch to verb then object order, "nic listen all", "interface drop eth0" ntpd/ntp_config.c@1.213 +27 -21 switch to verb then object order, "nic listen all", "interface drop eth0" ntpd/ntp_control.c@1.121 +4 -8 pass parser error message on to ntpq :config/config-from-file ntpd/ntp_parser.c@1.44 +338 -346 Bison product ntpd/ntp_parser.y@1.39 +22 -30 switch to verb then object order, "nic listen all", "interface drop eth0" ntpd/ntp_scanner.c@1.24 +23 -4 get syntax error position right in more cases ntpd/ntp_scanner.h@1.8 +4 -0 get syntax error position right in more cases ChangeSet@1.1981.1.1, 2009-09-09 16:58:54+00:00, davehart@shiny.ad.hartbrothers.com [Bug 983] add interface ... [listen | ignore | drop] directive. document interface (alias nic) and unpeer make sure accessing ip_file->line_no is safe for :config ChangeLog@1.422 +2 -0 [Bug 983] add interface ... [listen | ignore | drop] directive. document interface (alias nic) and unpeer configure.ac@1.451 +0 -17 remove --disable-listen-read-drop html/confopt.html@1.46 +10 -4 document unpeer ntp.conf/ntpq :config directive html/copyright.html@1.43 +2 -1 add Dave Hart, fix @@ typo for John Hay html/miscopt.html@1.44 +2 -0 document interface ... [listen | ignore | drop] html/scripts/confopt.txt@1.2 +1 -0 add unpeer html/scripts/miscopt.txt@1.2 +2 -0 add interface and alias nic include/ntp_config.h@1.60 +25 -7 [Bug 983] add interface ... [listen | ignore | drop] directive. include/ntp_io.h@1.11 +26 -3 [Bug 983] add interface ... [listen | ignore | drop] directive. include/ntpd.h@1.132 +1 -0 [Bug 983] add interface ... [listen | ignore | drop] directive. ntpd/ntp_config.c@1.212 +224 -31 [Bug 983] add interface ... [listen | ignore | drop] directive. make sure accessing ipfile->line_no and similar is safe during runtime configuration ntpd/ntp_io.c@1.297 +193 -132 [Bug 983] add interface ... [listen | ignore | drop] directive. ntpd/ntp_parser.c@1.43 +1055 -984 Bison output ntpd/ntp_parser.h@1.26 +321 -307 Bison output ntpd/ntp_parser.y@1.38 +53 -4 [Bug 983] add interface ... [listen | ignore | drop] directive. ntpd/ntpd.c@1.107 +16 -3 [Bug 983] add interface ... [listen | ignore | drop] directive. ChangeSet@1.1982, 2009-09-06 12:00:45-04:00, fernandoph@pogo.udel.edu refclock_palisade.c, refclock_palisade.h: [BUG 1296] Added Support for Trimble Acutime Gold. ntpd/refclock_palisade.c@1.27 +131 -23 [BUG 1296] Added Support for Trimble Acutime Gold. ntpd/refclock_palisade.h@1.12 +6 -4 [BUG 1296] Added Support for Trimble Acutime Gold. ChangeSet@1.1981, 2009-09-06 07:51:31-04:00, stenn@whimsy.udel.edu NTP_4_2_5P210 TAG: NTP_4_2_5P210 ChangeLog@1.421 +1 -0 NTP_4_2_5P210 ntpd/ntpd-opts.c@1.203 +2 -2 NTP_4_2_5P210 ntpd/ntpd-opts.h@1.203 +3 -3 NTP_4_2_5P210 ntpd/ntpd-opts.texi@1.201 +1 -1 NTP_4_2_5P210 ntpd/ntpd.1@1.201 +2 -2 NTP_4_2_5P210 ntpdc/ntpdc-opts.c@1.199 +2 -2 NTP_4_2_5P210 ntpdc/ntpdc-opts.h@1.199 +3 -3 NTP_4_2_5P210 ntpdc/ntpdc-opts.texi@1.198 +1 -1 NTP_4_2_5P210 ntpdc/ntpdc.1@1.198 +2 -2 NTP_4_2_5P210 ntpq/ntpq-opts.c@1.199 +2 -2 NTP_4_2_5P210 ntpq/ntpq-opts.h@1.199 +3 -3 NTP_4_2_5P210 ntpq/ntpq-opts.texi@1.198 +1 -1 NTP_4_2_5P210 ntpq/ntpq.1@1.198 +2 -2 NTP_4_2_5P210 ntpsnmpd/ntpsnmpd-opts.c@1.79 +2 -2 NTP_4_2_5P210 ntpsnmpd/ntpsnmpd-opts.h@1.79 +3 -3 NTP_4_2_5P210 ntpsnmpd/ntpsnmpd-opts.texi@1.79 +1 -1 NTP_4_2_5P210 ntpsnmpd/ntpsnmpd.1@1.79 +2 -2 NTP_4_2_5P210 packageinfo.sh@1.213 +1 -1 NTP_4_2_5P210 sntp/sntp-opts.c@1.73 +2 -2 NTP_4_2_5P210 sntp/sntp-opts.h@1.73 +3 -3 NTP_4_2_5P210 sntp/sntp-opts.texi@1.73 +1 -1 NTP_4_2_5P210 sntp/sntp.1@1.73 +2 -2 NTP_4_2_5P210 util/ntp-keygen-opts.c@1.202 +2 -2 NTP_4_2_5P210 util/ntp-keygen-opts.h@1.202 +3 -3 NTP_4_2_5P210 util/ntp-keygen-opts.texi@1.201 +1 -1 NTP_4_2_5P210 util/ntp-keygen.1@1.201 +2 -2 NTP_4_2_5P210 ChangeSet@1.1979, 2009-09-06 08:38:28+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1294] change vs2008 include search path for OpenSSL from $(OPENSSL)\inc32,$(OPENSSL)\include to $(OPENSSL_INC) to match vc6, vs2003, and vs2005 changes from Danny ports/winnt/vs2008/libntp/libntp.vcproj@1.17 +2 -2 [Bug 1294] change vs2008 include search path for OpenSSL from $(OPENSSL)\inc32,$(OPENSSL)\include to $(OPENSSL_INC) to match vc6, vs2003, and vs2005 changes from Danny ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.6 +2 -2 [Bug 1294] change vs2008 include search path for OpenSSL from $(OPENSSL)\inc32,$(OPENSSL)\include to $(OPENSSL_INC) to match vc6, vs2003, and vs2005 changes from Danny ports/winnt/vs2008/ntpd/ntpd.vcproj@1.17 +2 -2 [Bug 1294] change vs2008 include search path for OpenSSL from $(OPENSSL)\inc32,$(OPENSSL)\include to $(OPENSSL_INC) to match vc6, vs2003, and vs2005 changes from Danny ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.9 +2 -2 [Bug 1294] change vs2008 include search path for OpenSSL from $(OPENSSL)\inc32,$(OPENSSL)\include to $(OPENSSL_INC) to match vc6, vs2003, and vs2005 changes from Danny ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.9 +2 -2 [Bug 1294] change vs2008 include search path for OpenSSL from $(OPENSSL)\inc32,$(OPENSSL)\include to $(OPENSSL_INC) to match vc6, vs2003, and vs2005 changes from Danny ports/winnt/vs2008/ntpq/ntpq.vcproj@1.8 +2 -2 [Bug 1294] change vs2008 include search path for OpenSSL from $(OPENSSL)\inc32,$(OPENSSL)\include to $(OPENSSL_INC) to match vc6, vs2003, and vs2005 changes from Danny ChangeSet@1.1976.1.1, 2009-09-06 04:00:32+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1295] trap directive options are not optional. [Bug 1297] yylex() must always set yylval before returning. ChangeLog@1.418.1.1 +2 -0 [Bug 1295] trap directive options are not optional. [Bug 1297] yylex() must always set yylval before returning. include/ntp.h@1.162 +1 -1 comment typo include/ntp_config.h@1.59 +3 -0 add token_name() declaration ntpd/Makefile.am@1.67 +1 -1 enable yacc/Bison report file (ntp_parser.output) generation when making ntp_parser.[ch]. There is no need to commit or distribute ntp_parser.output, it is only useful when testing ntp_parser.y changes. ntpd/ntp_config.c@1.211 +11 -10 enable yydebug verbose parser output with -D5 and higher [Bug 1295] config_trap() bug introduced with dumper in 4.2.5p203 ntpd/ntp_control.c@1.120 +2 -1 truncate saveconfig output file at open so remnants of longer file do not remain at the end after overwriting. ntpd/ntp_parser.c@1.42 +876 -924 Bison product ntpd/ntp_parser.h@1.25 +200 -204 Bison product ntpd/ntp_parser.y@1.37 +230 -208 [Bug 1295] trap directive options are not optional. [Bug 1297] yylex() debug output improvement needs %token-table and new function to access it, token_name() make all terminal T_ tokens type Integer so they can be used in actions as $1, $2, etc: { imaginary_func($2) } instead of { imaginary_func(T_Sometoken) } ntpd/ntp_scanner.c@1.23 +56 -27 fix $1 style references to T_ values by setting yylval.Integer to the T_ token for simple tokens with no other semantic value improve debug output: yylex: lexeme 'trap' -> T_Trap ChangeSet@1.1978, 2009-09-02 14:15:16-04:00, mayer@pogo.udel.edu [Bug 1294] ChangeLog@1.419 +2 -0 [Bug 1294] ChangeSet@1.1977, 2009-09-02 14:13:00-04:00, mayer@pogo.udel.edu [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros for windows and Remove unnecessary OPENSSL applink.c include ntpdc/ntpdc.c@1.68 +0 -6 [Bug1294] Remove unnecessary OPENSSL applink.c include ntpq/ntpq.c@1.88 +0 -6 [Bug1294] Remove unnecessary OPENSSL applink.c include ports/winnt/vc6/libntp.dsp@1.41 +2 -2 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vc6/ntpd.dsp@1.37 +4 -4 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vc6/ntpdate.dsp@1.21 +2 -2 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vc6/ntpdc.dsp@1.24 +2 -2 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vc6/ntpkeygen.dsp@1.17 +4 -4 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vc6/ntpq.dsp@1.25 +2 -2 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vs2003/libntp.vcproj@1.2 +2 -2 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vs2003/ntpd.vcproj@1.2 +6 -6 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vs2003/ntpdate.vcproj@1.2 +2 -2 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vs2003/ntpdc.vcproj@1.2 +2 -2 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vs2003/ntpkeygen.vcproj@1.2 +4 -4 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vs2003/ntpq.vcproj@1.2 +2 -2 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vs2005/libntp.vcproj@1.2 +3 -3 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vs2005/ntpd.vcproj@1.2 +7 -7 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vs2005/ntpdate.vcproj@1.2 +3 -3 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vs2005/ntpdc.vcproj@1.2 +3 -3 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vs2005/ntpkeygen.vcproj@1.2 +5 -5 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ports/winnt/vs2005/ntpq.vcproj@1.2 +3 -3 [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros ChangeSet@1.1976, 2009-09-01 07:51:38-04:00, stenn@whimsy.udel.edu NTP_4_2_5P209 TAG: NTP_4_2_5P209 ChangeLog@1.418 +1 -0 NTP_4_2_5P209 ntpd/ntpd-opts.c@1.202 +2 -2 NTP_4_2_5P209 ntpd/ntpd-opts.h@1.202 +3 -3 NTP_4_2_5P209 ntpd/ntpd-opts.texi@1.200 +1 -1 NTP_4_2_5P209 ntpd/ntpd.1@1.200 +2 -2 NTP_4_2_5P209 ntpdc/ntpdc-opts.c@1.198 +2 -2 NTP_4_2_5P209 ntpdc/ntpdc-opts.h@1.198 +3 -3 NTP_4_2_5P209 ntpdc/ntpdc-opts.texi@1.197 +1 -1 NTP_4_2_5P209 ntpdc/ntpdc.1@1.197 +2 -2 NTP_4_2_5P209 ntpq/ntpq-opts.c@1.198 +2 -2 NTP_4_2_5P209 ntpq/ntpq-opts.h@1.198 +3 -3 NTP_4_2_5P209 ntpq/ntpq-opts.texi@1.197 +1 -1 NTP_4_2_5P209 ntpq/ntpq.1@1.197 +2 -2 NTP_4_2_5P209 ntpsnmpd/ntpsnmpd-opts.c@1.78 +2 -2 NTP_4_2_5P209 ntpsnmpd/ntpsnmpd-opts.h@1.78 +3 -3 NTP_4_2_5P209 ntpsnmpd/ntpsnmpd-opts.texi@1.78 +1 -1 NTP_4_2_5P209 ntpsnmpd/ntpsnmpd.1@1.78 +2 -2 NTP_4_2_5P209 packageinfo.sh@1.212 +1 -1 NTP_4_2_5P209 sntp/sntp-opts.c@1.72 +2 -2 NTP_4_2_5P209 sntp/sntp-opts.h@1.72 +3 -3 NTP_4_2_5P209 sntp/sntp-opts.texi@1.72 +1 -1 NTP_4_2_5P209 sntp/sntp.1@1.72 +2 -2 NTP_4_2_5P209 util/ntp-keygen-opts.c@1.201 +2 -2 NTP_4_2_5P209 util/ntp-keygen-opts.h@1.201 +3 -3 NTP_4_2_5P209 util/ntp-keygen-opts.texi@1.200 +1 -1 NTP_4_2_5P209 util/ntp-keygen.1@1.200 +2 -2 NTP_4_2_5P209 ChangeSet@1.1974, 2009-09-01 08:20:19+00:00, davehart@shiny.ad.hartbrothers.com revert accidental pull of wrong repo (windowscompiler) BitKeeper/deleted/.del-instsrv-VS2008.vcproj~af3a7a4284dd8b4f@1.2 +0 -0 Delete: ports/winnt/instsrv/instsrv-VS2008.vcproj BitKeeper/deleted/.del-libntp-VS2008.vcproj~e944822ae4545d06@1.2 +0 -0 Delete: ports/winnt/libntp/libntp-VS2008.vcproj BitKeeper/deleted/.del-ntp-VS2008.sln~b08951bb97303271@1.2 +0 -0 Delete: ports/winnt/ntp-VS2008.sln BitKeeper/deleted/.del-ntp-keygen-VS2008.vcproj~f2e7f85d5942b392@1.2 +0 -0 Delete: ports/winnt/ntp-keygen/ntp-keygen-VS2008.vcproj BitKeeper/deleted/.del-ntpd-VS2008.vcproj~63a1a8b5a4f17de8@1.2 +0 -0 Delete: ports/winnt/ntpd/ntpd-VS2008.vcproj BitKeeper/deleted/.del-ntpdate-VS2008.vcproj~dcb57743d0d7d96d@1.2 +0 -0 Delete: ports/winnt/ntpdate/ntpdate-VS2008.vcproj BitKeeper/deleted/.del-ntpdc-VS2008.vcproj~6b071c10ef40334b@1.2 +0 -0 Delete: ports/winnt/ntpdc/ntpdc-VS2008.vcproj BitKeeper/deleted/.del-ntpkeygen.vcproj~9130c0edbfb4b39b@1.2 +0 -0 Delete: ports/winnt/ntp-keygen/ntpkeygen.vcproj BitKeeper/deleted/.del-ntpq-VS2008.vcproj~3d9c726f33ecd5f@1.2 +0 -0 Delete: ports/winnt/ntpq/ntpq-VS2008.vcproj ChangeLog@1.416 +0 -2 revert accidental pull of wrong repo (windowscompiler) ports/winnt/libntp/libntp.dsp@1.38 +0 -4 revert accidental pull of wrong repo (windowscompiler) ports/winnt/libntp/libntp.vcproj@1.14 +47 -148 revert accidental pull of wrong repo (windowscompiler) ports/winnt/ntp-keygen/ntpkeygen.dsp@1.14 +4 -0 revert accidental pull of wrong repo (windowscompiler) ports/winnt/ntp.sln@1.5 +46 -43 revert accidental pull of wrong repo (windowscompiler) ports/winnt/ntpd/ntpd.dsp@1.34 +4 -0 revert accidental pull of wrong repo (windowscompiler) ports/winnt/ntpd/ntpd.vcproj@1.14 +117 -119 revert accidental pull of wrong repo (windowscompiler) ports/winnt/ntpdate/ntpdate.dsp@1.18 +4 -0 revert accidental pull of wrong repo (windowscompiler) ports/winnt/ntpdate/ntpdate.vcproj@1.6 +85 -20 revert accidental pull of wrong repo (windowscompiler) ports/winnt/ntpdc/ntpdc.dsp@1.21 +4 -0 revert accidental pull of wrong repo (windowscompiler) ports/winnt/ntpdc/ntpdc.vcproj@1.6 +46 -20 revert accidental pull of wrong repo (windowscompiler) ports/winnt/ntpq/ntpq.dsp@1.22 +4 -0 revert accidental pull of wrong repo (windowscompiler) ports/winnt/ntpq/ntpq.vcproj@1.5 +36 -20 revert accidental pull of wrong repo (windowscompiler) ChangeSet@1.1968.1.18, 2009-08-31 21:57:23-04:00, mayer@pogo.udel.edu [Bug 1289] update to add VS2003 ChangeLog@1.413.1.11 +1 -1 [Bug 1289] update to add VS2003 ChangeSet@1.1968.1.17, 2009-08-31 16:58:47-04:00, mayer@pogo.udel.edu [Bug 1289] Add vs2003 compiler files ports/winnt/vs2003/Instsrv.vcproj@1.1 +174 -0 [Bug 1289] Add vs2003 compiler files ports/winnt/vs2003/Instsrv.vcproj@1.0 +0 -0 ports/winnt/vs2003/libntp.vcproj@1.1 +2058 -0 [Bug 1289] Add vs2003 compiler files ports/winnt/vs2003/libntp.vcproj@1.0 +0 -0 ports/winnt/vs2003/ntp.sln@1.1 +73 -0 [Bug 1289] Add vs2003 compiler files ports/winnt/vs2003/ntp.sln@1.0 +0 -0 ports/winnt/vs2003/ntpd.vcproj@1.1 +2113 -0 [Bug 1289] Add vs2003 compiler files ports/winnt/vs2003/ntpd.vcproj@1.0 +0 -0 ports/winnt/vs2003/ntpdate.vcproj@1.1 +221 -0 [Bug 1289] Add vs2003 compiler files ports/winnt/vs2003/ntpdate.vcproj@1.0 +0 -0 ports/winnt/vs2003/ntpdc.vcproj@1.1 +265 -0 [Bug 1289] Add vs2003 compiler files ports/winnt/vs2003/ntpdc.vcproj@1.0 +0 -0 ports/winnt/vs2003/ntpkeygen.vcproj@1.1 +302 -0 [Bug 1289] Add vs2003 compiler files ports/winnt/vs2003/ntpkeygen.vcproj@1.0 +0 -0 ports/winnt/vs2003/ntpq.vcproj@1.1 +263 -0 [Bug 1289] Add vs2003 compiler files ports/winnt/vs2003/ntpq.vcproj@1.0 +0 -0 ChangeSet@1.1968.1.16, 2009-08-31 09:56:29-04:00, mayer@pogo.udel.edu [Bug 1290] ChangeLog@1.413.1.10 +2 -1 [Bug 1290] ChangeSet@1.1968.1.15, 2009-08-31 09:54:57-04:00, mayer@pogo.udel.edu [Bug 1290] Fix to use GETTIMEOFDAY macro ntpd/refclock_oncore.c@1.78.1.1 +1 -1 [Bug 1290] Fix to use GETTIMEOFDAY macro ChangeSet@1.1968.1.14, 2009-08-31 09:50:13-04:00, mayer@pogo.udel.edu [Bug 1289] Use quotes instead of angle brackets for include of messages.h ports/winnt/libntp/syslog.c@1.5 +1 -1 [Bug 1289] Use quotes instead of angle brackets for include of messages.h ChangeSet@1.1968.1.13, 2009-08-30 23:47:19-04:00, mayer@pogo.udel.edu [Bug 1289] ChangeLog@1.413.1.9 +1 -0 [Bug 1289] ChangeSet@1.1968.1.12, 2009-08-30 23:36:44-04:00, mayer@pogo.udel.edu [Bug #1289] Update project files for VS2005 ports/winnt/vs2005/Instsrv.vcproj@1.1 +242 -0 [Bug #1289] Update project files for VS2005 ports/winnt/vs2005/Instsrv.vcproj@1.0 +0 -0 ports/winnt/vs2005/libntp.vcproj@1.1 +2250 -0 [Bug #1289] Update project files for VS2005 ports/winnt/vs2005/libntp.vcproj@1.0 +0 -0 ports/winnt/vs2005/ntp.sln@1.1 +68 -0 [Bug #1289] Update project files for VS6 ports/winnt/vs2005/ntp.sln@1.0 +0 -0 ports/winnt/vs2005/ntpd.vcproj@1.1 +2237 -0 [Bug #1289] Update project files for VS2005 ports/winnt/vs2005/ntpd.vcproj@1.0 +0 -0 ports/winnt/vs2005/ntpdate.vcproj@1.1 +292 -0 [Bug #1289] Update project files for VS2005 ports/winnt/vs2005/ntpdate.vcproj@1.0 +0 -0 ports/winnt/vs2005/ntpdc.vcproj@1.1 +336 -0 [Bug #1289] Update project files for VS2005 ports/winnt/vs2005/ntpdc.vcproj@1.0 +0 -0 ports/winnt/vs2005/ntpkeygen.vcproj@1.1 +376 -0 [Bug #1289] Update project files for VS2005 ports/winnt/vs2005/ntpkeygen.vcproj@1.0 +0 -0 ports/winnt/vs2005/ntpq.vcproj@1.1 +336 -0 [Bug #1289] Update project files for VS2005 ports/winnt/vs2005/ntpq.vcproj@1.0 +0 -0 ChangeSet@1.1968.1.11, 2009-08-30 23:30:53-04:00, mayer@pogo.udel.edu [Bug #1289] Update project files for VS6 ports/winnt/vc6/Instsrv.dsp@1.9 +9 -9 [Bug #1289] Update project files for VS6 ports/winnt/vc6/libntp.dsp@1.36.1.2 +23 -19 [Bug #1289] Update project files for VS6 ports/winnt/vc6/ntp.dsw@1.9 +7 -7 [Bug #1289] Update project files for VS6 ports/winnt/vc6/ntpd.dsp@1.32.1.2 +17 -21 [Bug #1289] Update project files for VS6 ports/winnt/vc6/ntpdate.dsp@1.16.1.2 +12 -16 [Bug #1289] Update project files for VS6 ports/winnt/vc6/ntpdc.dsp@1.19.1.2 +13 -17 [Bug #1289] Update project files for VS6 ports/winnt/vc6/ntpkeygen.dsp@1.12.1.2 +10 -14 [Bug #1289] Update project files for VS6 ports/winnt/vc6/ntpq.dsp@1.20.1.2 +12 -16 [Bug #1289] Update project files for VS6 ChangeSet@1.1968.1.10, 2009-08-30 23:28:42-04:00, mayer@pogo.udel.edu [Bug #1289] Move compiler project for VS6 ports/winnt/vc6/Instsrv.dsp@1.8 +0 -0 Rename: ports/winnt/instsrv/Instsrv.dsp -> ports/winnt/vc6/Instsrv.dsp ports/winnt/vc6/libntp.dsp@1.36.1.1 +0 -0 Rename: ports/winnt/libntp/libntp.dsp -> ports/winnt/vc6/libntp.dsp ports/winnt/vc6/ntp.dsw@1.8 +0 -0 Rename: ports/winnt/ntp.dsw -> ports/winnt/vc6/ntp.dsw ports/winnt/vc6/ntpd.dsp@1.32.1.1 +0 -0 Rename: ports/winnt/ntpd/ntpd.dsp -> ports/winnt/vc6/ntpd.dsp ports/winnt/vc6/ntpdate.dsp@1.16.1.1 +0 -0 Rename: ports/winnt/ntpdate/ntpdate.dsp -> ports/winnt/vc6/ntpdate.dsp ports/winnt/vc6/ntpdc.dsp@1.19.1.1 +0 -0 Rename: ports/winnt/ntpdc/ntpdc.dsp -> ports/winnt/vc6/ntpdc.dsp ports/winnt/vc6/ntpkeygen.dsp@1.12.1.1 +0 -0 Rename: ports/winnt/ntp-keygen/ntpkeygen.dsp -> ports/winnt/vc6/ntpkeygen.dsp ports/winnt/vc6/ntpq.dsp@1.20.1.1 +0 -0 Rename: ports/winnt/ntpq/ntpq.dsp -> ports/winnt/vc6/ntpq.dsp ChangeSet@1.1968.1.8, 2009-08-30 03:02:04-04:00, stenn@whimsy.udel.edu NTP_4_2_5P208 TAG: NTP_4_2_5P208 ChangeLog@1.413.1.7 +1 -0 NTP_4_2_5P208 ntpd/ntpd-opts.c@1.201 +2 -2 NTP_4_2_5P208 ntpd/ntpd-opts.h@1.201 +3 -3 NTP_4_2_5P208 ntpd/ntpd-opts.texi@1.199 +1 -1 NTP_4_2_5P208 ntpd/ntpd.1@1.199 +2 -2 NTP_4_2_5P208 ntpdc/ntpdc-opts.c@1.197 +2 -2 NTP_4_2_5P208 ntpdc/ntpdc-opts.h@1.197 +3 -3 NTP_4_2_5P208 ntpdc/ntpdc-opts.texi@1.196 +1 -1 NTP_4_2_5P208 ntpdc/ntpdc.1@1.196 +2 -2 NTP_4_2_5P208 ntpq/ntpq-opts.c@1.197 +2 -2 NTP_4_2_5P208 ntpq/ntpq-opts.h@1.197 +3 -3 NTP_4_2_5P208 ntpq/ntpq-opts.texi@1.196 +1 -1 NTP_4_2_5P208 ntpq/ntpq.1@1.196 +2 -2 NTP_4_2_5P208 ntpsnmpd/ntpsnmpd-opts.c@1.77 +2 -2 NTP_4_2_5P208 ntpsnmpd/ntpsnmpd-opts.h@1.77 +3 -3 NTP_4_2_5P208 ntpsnmpd/ntpsnmpd-opts.texi@1.77 +1 -1 NTP_4_2_5P208 ntpsnmpd/ntpsnmpd.1@1.77 +2 -2 NTP_4_2_5P208 packageinfo.sh@1.211 +1 -1 NTP_4_2_5P208 sntp/sntp-opts.c@1.71 +2 -2 NTP_4_2_5P208 sntp/sntp-opts.h@1.71 +3 -3 NTP_4_2_5P208 sntp/sntp-opts.texi@1.71 +1 -1 NTP_4_2_5P208 sntp/sntp.1@1.71 +2 -2 NTP_4_2_5P208 util/ntp-keygen-opts.c@1.200 +2 -2 NTP_4_2_5P208 util/ntp-keygen-opts.h@1.200 +3 -3 NTP_4_2_5P208 util/ntp-keygen-opts.texi@1.199 +1 -1 NTP_4_2_5P208 util/ntp-keygen.1@1.199 +2 -2 NTP_4_2_5P208 ChangeSet@1.1968.3.2, 2009-08-29 21:22:45+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1293] make configuration dumper ready for release, specifically: rename ntpq dumpcfg command to "saveconfig". require authentication for saveconfig. "restrict ... nomodify" prevents saveconfig and :config. "saveconfig ." shorthand to save to startup configuration file. support strftime() substitution in saveconfig arg to timestamp the output filename, for example "saveconfig %Y%m%d-%H%M%S.conf". display saveconfig response message from ntpd in ntpq. save output filename in "savedconfig" variable, fetched with ntpq -c "rv 0 savedconfig". document saveconfig in html/ntpq.html. add ./configure --disable-saveconfig to build a smaller ntpd. log saveconfig failures and successes to syslog. ChangeLog@1.413.3.1 +13 -0 [Bug 1293] make configuration dumper ready for release, specifically: rename ntpq dumpcfg command to "saveconfig". require authentication for saveconfig. "restrict ... nomodify" prevents saveconfig and :config. "saveconfig ." shorthand to save to startup configuration file. support strftime() substitution in saveconfig arg to timestamp the output filename, for example "saveconfig %Y%m%d-%H%M%S.conf". display saveconfig response message from ntpd in ntpq. save output filename in "savedconfig" variable, fetched with ntpq -c "rv 0 savedconfig". document saveconfig in html/ntpq.html. add ./configure --disable-saveconfig to build a smaller ntpd. log saveconfig failures and successes to syslog. html/ntpq.html@1.32 +13 -8 document "config-from-file" and "saveconfig" use
    and no

    by Sven Dietrich (sven_dietrich@trimble.com)

    0dÀÛD`Mp[À½ K<¨ Ë“ ªð %6ÁÒPÁÀ5þ `K€Ê˜¸eŽgCÐdú­P ’³  ¤ö‡K·t3µd K0'Ö^ ¨¼«ÌÛÓ?VÐuê?B.Àär€sÞE ñ^½aw— ´À »@ ï¼zPÝß9‚Õ ‡¡ZÀ’þ`Š@ÆRÆhÌ,(ë±Bðâ/þµз>·~ë™-ã7^¾´ #<€æãg>¡ k»PbRZWŽp(@vpO0ɧÀìÁS 8­Ó ð áî· ¥pÅK J{@XƒÞµ€µª¹‹àœ»&ç<'ç¿V—pX¯_±°©m Ì¨$þ©›ð µÀ ž@š… L  µà Æ€ ·@ À  z<°$@K@ ¡P M! ÅÀ ¦®à ©PLÐLÈ ä™ yòi0c^ª“ 80TR1ìàâµþâ{Ó!‚ãa5&IÑ”QJ¡e\*‰íÎÜîôÍÎ¥5ÝrЂ‘C‘$]Š˜ƒæÇˆöáç¡pFÑ…#„‘"¸˜ÄŽ(ªÃÉx +Ä5ÑÄ2RQFUzÐZ¸ùk ò ,•a˜©ž%¥’þ6i¼ZNÃÌ62ž YÎÓBéæ’PH©ZPŒbÛØE=ª¡lB`¢¨…À„P5Œ&8üÁsƒ,"‘h…4Z±†" l:¸Ä%2Á‰m¼§s0BvÐ ]¼â­z‚žð„(ÈAoå©E&V‹¿©p*Ø¡‰$Î@@TÒ I ⛘C;Á S0A(A‚–s­5p¡F Â²`„"\¡ kP9.Á Œ*e‚è@Œ1E;ØÁ Q(cØ ŠcÄ¢+Ð0Q $è`þÊ£Œ*˜± è€JPRyŠÚ¥Á.waYÀ™8â E˜™gf&„LlC£¨…-vQ0íBŽÅ· Ox¸èÄ)ØËkò€Z„#1‰aÌK=[b€‰L`¤` b` ø ­†$ZE„(ØMfÛaDfʼnX #pŸÐ*ø ¨Àò d ãËQÇ‹% 9°BRbÁ<+\¡…rhB:  E#$È@ ª0,a S¨]ó–Ð:x€¡E)ôD \" ¨¿0ŽmCýÄLQ„RJ9hA 0$ ¡=þðÏaL٠̀|‚rÝ) <ØE ˜ƒ]àІ55ÂAA~€‚\ž0‡-nQ¤Õ¢ÚðE-ÞÁ mh×°'l±‘±T B‚T…&T¡ Z„7#‘ˆatC AîS¨åS˜i+€ dá’F+䦿S œê'DV1O,gªÜ‡ T âLˆ@P Hý’ÀVSÚËQ+²`^äJ ;X¡Ev8,È¡‰ Œ@Ž‚ÈBæð‰Ú•ANÀÄ¿2qßœ²v•+pYúËOdB ÎÉA†À„XÌ! fàÏ8@µ„B5˜þTaŒ+ CRÐÁ j0…KÔ@$øDS‘Y~·LÔ¤™@œ e(ô ‰`ä.¶Ó5Âf|ãõH2‚1‹WȰ³pÄ#œÜäÎ:ÊTô° !Àe‹‰CÞ X©œÖFMhÅ!d1 9ÈÁ Z¨[¤ŽÞBdVŸX A¡U85öP‡=ìÁ $ ¨À Âæ€û @Z”K€À9Èn$Ųpƒ©"žXÁžÓïÖ!EºB-rá„& E,ñKTâ4jÁ dpRôÀE?¢‚¸ ¼6ä!R0 ¬OPØ9è#þ,ê€e¬Àx²™ H` ðÁâ.³l1\_<¿FtöžD$1‰IÄ"é(3”>i˜Ã°ˆÄ!"ÁˆÎæ[ƒÞt ­Á@4B†€ä ¸ð  X¸ \ÐIV†ÐÀÀ&&qˆW ã E¸ƒ¸O(„#Îü¨Å@QçSpB©˜Ã(رnuÔc2¨Œà'ø ;àyÏ}À„˜¶‹^Pó¼@F¡ vȃDgM{Â8…ÔÃмìP;Xùy¢*2`:¬_íƒf"4˜(¤¡¨A]a$Ð`+Èb )„‚À@Zþx@aäÉB%²PfÄ †¶ª)3cø6^6?FÈ//“DDe V¤¢°˜Å0&‡8kšßüXßúFÄA~«‡ƒ†„«r w*ÌJÜgá8A™Ñ+È!wÈg>»1òZСËáH*šjŠ!Ÿãêà„~•ƒOøGôˉÅ)r‹ó;Á (Á>7Œkqá›è¯íp‚%4A¦ô Fp‚—Ú‚X‚;ÒƒÛA’Ý=dàˆN`‚K8‚` hú˜ƒ02ºŽZ#*è„àB[«šX¸‚N˜!ð„ð=Ë äéaØXx+[Z+1þÊãƒ8ƒ8PC@½Ô#BII…T ÂEXFÐC0F”'ÂÔ3ù‘ŸØk„ùy+x‚ºò0pGk ÀòQ‚Ø¢-*9;˜„W@†: ‚C¸ƒ+À¡(†‘›•U¸…:3âÒºtøf †sà„ Õÿø¡UXZP ƒ0ø= ºa0ƒŽ*‚06 #8<È‚.èM ø¿—:„Mà„[P†éÃÀ?`À`øQ(†QЄR@$K`‚ZXGú¦3(@0« ´¨%xÔb‚)è„$XÁ$˜e©Fþ¨F&È…a@Xp1Ì <üÁ\=xŒVhHÑII8=ÐXˆ”SÈGI€¢CP dX˜'å(3p›Ÿ€›Ÿ4€‚!È|‹8-ךJ‚0›¸#ðpš…¢ .€‚%È'>Œ³’S…U8?‚Q…+Âo ÄO‚ú@€è ÙªÔr€e–ú yy?—*¸+h+—2X£T RÀ€ÀAx„G…T#(ð:èê`x&O ¾à)Zð„R0†b]˜ÁO@‚%à¨q­P&@œ‚ZØ…Z K²¼„Q¨‡_8C4 ¸œÀÀ€ €’ˆ€  !.ðUˆOÌ‹4£‚5c!+УT`RàW„=p3PÐ…¹&°û °h¢»¨³@‹´XL…)!ØŠ¨%È ØØþZ$øFðc¨)È âͰ2þÁjóø8‡X`wtLÇÔ Ö“L@ˆ„Ò ¨e`†aHÒe„íJ®y·‚4焨$•…d@†éyÚô·\ÚB+¸ ÈLà˜úp€Ôj %ð¾ °€6=B˜„`˜WÈ"xœæ‹‚\èCOh‡wp‡vÀkè^Ø…wð†#˜€Óâ =˜§SØ„M0IåK5…9h€ ŽRø»¢ %XJ##°ÅOˆ†R ©‚?èƒ!‚L€=Xƒ*^`‚‚"@%ð„ø  ð„)ð‘"ÈVË%`€xÆ$è„5 ¸´ƒN gH·øK%þ@MP‚7 †uHЋƒulLëAËãÁØ‹VVx…Y˜…–8Gy…V`…zWå $“„‰z…yeV·~ë·FØ *À« òKÖÊ@€0+AA1-6Œ­Iè d˜<0‚;È‚,ÐÃ=3[À…Oá‡}x}hY~h‡#À‘ 0€!8…z­Wþ †:#ŽÙ0€ ¸/`bðÄ. ] ¯Rœ—2ø= ‡RX6—Ú? ‚$¸#UH;P…,x»ð7À³³ÞÄÞ¤P¨Sh:*º Ñ« ;º¯RXŽ¥Pè:Ѱ¬pÀˆa˜†e@2þVˆ„Ƥ¼4ÊœÍ5yÙ„Â{«ÜHBF¸7(B†Œ„8`ÚŒ„!¥M- ¸Òm„?ƒÎȇeÙLD#Ãjd8`€ ¨‚DHÍg†WÀ"¿º±ÎU€>Z؆z¨‡x¸†j¸kØ|xÆš- ) éâ—êš)€é°öãD3HÑyœ2 K«ŠÏ‡Z˜]«‚@ #š‚…ƒ‘¥6X3q6ȃ9%Îx#˜A¤M¨39Èøg|Æ!e †!JXƒ™¹ «É%Ppˆ…T„zÍ<ÔS5ƒŒÜ-l=@˜=>X½¬Éþ¥!4ÙdH+ FÐÂp{B€Ó !5„z;„Ø«‡½ «ÉQàà“°€àhÓÈ‚D†iPj(ÈnÙâ(èà>®Qc1.Tx‡wh' k€p€ D¨‹Ð(ïsN-Úʃµ42**˜9 .€%s¸È" ?¸ˆ” K¼ 3¸’{Ñ…Up‚b,K¸„¦IbXN(4k`h–(4R…:ä+Ð"°6 ˆ(pƒý8`„WpùƒÈÔÁ1ÐAExÜH„rËÇIC¸8Û È€„¢yÚ<)•…|d!þ„IP¼Hx…H89lz•ѵ"ðÛ ú¹ Qúßì&¦º,„˜p†}•¨I²G H˜$U9O0.\ø†|Ї|p‡C6˜}XãXc0€ hhac3l- à9ÀÏN$ƒÉS½‚¯ë(ȃaXfÀ…Df‘&ð‘9Ø„4 -X9è„OP…RˆD\(…€K[Œm8f0c†Ý…M`Ö%‚*H7`(B94ƒ^k9^@…% zƒ"}…@ ÌÆ 1p\É”Lz5Xd g}M²I8z=G$]†‚Ô Ò›…Î]GȸМ…Ø<·þY@Y8ÇIhÂ+‡}ÆÈZ¬ê%H‚óõ‰ d˜-9doÚ·I`ƒ(…‘slm¼&`¼<xÐMp –5>€@!€F{-Ó:LœjÚ²[”ƒÈ;¸4ð,°ƒW †–Žúk‚)xê+¨ƒþð38…9°/J¤D ë/Ø€ßäÁ„½åÍ‚–Óƒnñ‰6€ƒÏM\|spn6€pÈ~0`Åni c `l¨1Aƒ PAãgT“>ÛóôrgXªV±bͺƒGUÙ;:Û”„Òm|a…VxÑÖeXA…| ÈÓ&ñ”Šþ2Ÿl²ÄsTa‡)eÁ¢Gj²˜5ËiÀõEm!FPÊ^s5Šðá—fˆ)Bdƒ)v˜`UFYgŒ6™#ˆ )X €@iÈHòÊ0¬¥bHnÄæFnÒD #”PÄ‚âÊ+WÐaœ›Äôಋ¤Ðb&æðN8ÉprÄ;!ƒ¡ :Á0´C /È 2Ìa†$Ê蛺ft *KªèË)©è†}°¤‚…ö”Ƶ UÄÅÓNFÕ†$ÆX2Å™h²'§£ +¯°–±°²Æ(~¡ÆP*Ö%—‹ ÒE×|ìÕþHŽc|¦È:ꘟ¥[ KÖ™f|öÙ“t–/”‘´2Ì,¯DÉ!ÀáÅ¿ñÈ[dÑÇ#“L2Ë'r÷¦›ÀLaÉ6ß´#Ï7ÖìÂÍ(õðã .§ rK.¹ô‚ *œhbJ)¨ÈŒJ)·¸<ó}§HRÖ)?·KÐöÅB´,ʤ’Ê0ÉÈÂÈ!a #KI>¥Æ{Z"J|0HJ< U5Ou £J'€ ºÌÂl°±iÀMÔ´(ªÕ–ÞA­ \€üý׺íe#á–«cáøúxXø:rî`éâËÈb— H ŒL²¬k¬L‰”i„”Fš?¢%k\þ!EX|1¢˜<·»Ã;¼ÈóÎ%>ÌA 3á”Î1ƬbÖ2Æ(Ó<3$‡Ó|7Ô´¢‡,²ÌË+±ÈËö¯ÍŠö°ÜÑ32MßÑJÐ’¼Qc|àü.Ú†ümÜúPBÅ…WUp!€x0CÖ‡E,i˜Ñ€ô…>P$?öZ´+Á!qˆ ]ÈE#ÀhðtÉѺüòÍBZL ó<¼!ç:Wa4÷ŠSØÁ ¸ P(´3 ¿‹MÄJo8J]È×]Á±30tŠxp#ZÄâ×&èéMuj]ÜÔ6‚ rŠþÝœ‚à»àý® Lð\Nö”xñBƒD£¾‘[@!†àE•^˜`qŽt´"xÙ`IÄX0ã­€ÒºâÀV@LBåXÆ$#Í¿ø%vÐÅ22 9#¬)Äd&/GLⳘÅ$îÐ sàbX'=/sˆVL‚³”ð,gsìë¥u“t0%0a ˜P&’Ð`¨¡L˜ƒ-ŠA r|è€vPŒnÔ/ÀÀ dà á.ƒAwm‚œ¾¼lÁ›ã,Þ5ƒÀᕳœmàçá &hBSäB«U¡ e`/SW#rÅ! S ÃˆˆþSî—$Š0ƒ*bÁˆKǨ‚q¸ƒˆ ‘ÌÁæqå“Ä!â%˜ÔiÎ0H„$ð•¯@(‡˜Ä!‚dkËi0†¨01ÏÁ}t" Œ0ÄFM:6 áfX6îPm7€¤Úf8DH6dâìÃ.À@(€sŸ»º°‡&œÀ%Ða«(Æ%T0pÂé¸6,& ¢¾x#'z „Øà<Èz0!Ô7 KXÂ(>…)Ì™ØøÙÔ N€‚ ¨E)Vq [äÌÆ6À‘ HÞa]2CÄÙ…*ȯƒÝÚK ŒÀ y,Hƒ,EÂ?n @x‹å<å†Dþ¢h \JdlÌ€†5” d Ã%µîLÐ Y RÈ@…,P¡ h×ÂÙÏ^…*h¡„PûhØN9¨cüX…Øž…&œ½hÿ{ؾ…¾7¡ðM Äâ±Ïo'œp÷4á‰[¸|ð(E).¡KdBÀÆ(4Šn”©Æ(z¡zøé¥˜B=j_{ìÃ÷ȇ=г}'Àþp€_!ÇøÈ_EòÀ…iy ëT(ƒ9©€ILj’“œ$ƒ*òÁ[ôàíTˆ{Š`À—? ‚O{ùÏP„Ѽ]ðòßÂÛ·`&*l!ñôghB ðdÂ-ð8˜ƒ<€Ã6C80#8Cp14ÃjxÂc7ºÉ)X"$øa!ø¡ RB!$B"‚+%$‚!žÂ†ƒ%Üã,–%"b#Vb!ô:: êá'â:"b;"â#&¢$Â=J"Öa"4¢@B)&B (fä$:â!¼£¸‚)&B òƒ.4Á#”"!hÁžà R`ÿõAÿÉ$&‚.xã›c=hB@$Á*8%4Ãñ.ØÂRî‚-ÐÂ*¬(ôÀ`aNj!òÂ!þ" öÁ;¢b:BB"ø%¢„¥!~ðÕƒÂbMB#Îä!øã+‚äWJà#Âbdµd\¢]Ê $zd#¡G"¢ $Bu!>""bÁ'Îç$:¦d¤bÂâ%>à#l¢&zä:þNNòƒ1h¦|çÿ-Lÿú_ÿ1ÌÂl+˜ÂqÇ-èÂ=Ô&Ðx(&è¦nfÂÒ€ A(TC6d)(øUbhß'â Â@b@: ÃL$&¾c!¼c;ÚÁ; Ǽ#$$ ÖaGBà™Äc" i$Z§{²ãAni!¢+Hb€¶c˜"ä$Žd™&%PÂ+Ãptƒ-~âHRB+¤‰Bâ˜&b+˜¾B+Ô(?¨ÌkÖÀ ä€LÚÙ j'ÔÁ'˜Â't‚*D%†œB+HÂÄý©&§Â(Œž sžÉ ¢tž¥`"8Ù&¼ãXÂbubbþLÂ#¢£]2¤’å=îé=Z"C6¢%NB!¼">ªã˜rÅCF¦„â$dA ¸"ÞjÁ B)¨…ƒ€f¼ÞA-Ƥ|fáex«¸"¬&k®Ì:ŒÂ |@´Á±‚$Äëç´+Ø+èHÄ€Î!Áüâ¥ò>pÂâ#©sÂ4©¤#ôA ‚!,g¶0ð>l‚80ÇjA A$hÁ”gºAàÁÈfg¢hÁ4Lœ,Œ4dÍ‚«älô,ÎjÏrÏ-ÑmÐꬦ,.b`,Û9 Âl+"dËŠþ«`­Ë¢ÖæÖÒ¢l¹Ze.Ü>Üä E$0B¼Á²i#´íÅÁQ”ÈØ¬Åè(dÁÔÒÂÜ­nÐö¬ØA.èÃ>œð,Ín]”Aà’Ð,Ïšä2nÐòli-”fçæ¬äJ.x«çšAÖvmib-ãÆ.×Ò.Öfn¹¬˜Ü"8-?¨C¦ ‚è ïðòÒðJ­ÜA¯äAÿyHïah.Ä‚=à A|”HAÁ<Á÷’JÁùÁ¨ðmß¾ >œ‚ÏÖ\ˆ]Ï’Öip.éfînãÞ?þœïÞ¯·2EýÞoë¶níÖ®óÖnnÎŽ.Ööï&0plôrm /W0ØæAd0oB1mUž‚)œ/éÁ'ØÁ'0ª*0*Ø"‚)l ŸÂ& ð-ˆÃúvã-ÄB:øÂ$AœÉÙ¸™ÛÔ01(°ïéC-X_1næP3.é&pƒm)™*p0ׂ0sA[° çÁ'¬ñ ÂÏ|‚ˆ|‚©œ‚*üŒÃB,œÂ}¬ÂÊ 0è ÃC7(C20C7 Ï8„C:˜C=ÜÃ:Ø>èÞ$_¬Y!ðíÃÿÖCîåà$S2>ÜÃ$òþ?üïþ¿Zå> Â)°Ã-LÁ AüÀ Ôò„ÿY.ë2- ÁXll=‚¡ÈÈA$32#s,ê&|¤Æ‚. O:àð…C7(²–C9¤C8×>s9 õ*Ÿ÷[òÇjzîò_UâàrÒ³Åxþ¢òÝóq¶²:”Ä¡TAûòÐr31ÐrÌò€³qÔƒ1ÃÊàÂ-àB.ü‚1|C8dóŲóNtI›ôIG+§Ã-ÁHP\H\ MÓ´HÜ(ÁH\'ü‚I4J‡:?®qü¯ñýïH õR3uN¶ò9xƒýþ^R_¡<¯3õ?Po>7µ*7õWƒ5ûö 3œ‚:GîùžHŸµÅ`uXß`=»u\ËõÝ‚|‚ìó\ëõ^óuIßBBù’öõ`vaçä_7„C[vc;öcb;A7@ve[6a#vxÃesvg»u/ø€il¶g“vi›t.080˜vk»ö¥æ‚ÀÌ8õkÛömÇN.˜Â8ü¶rK·i3w3°ötc÷mëö9ˆCv{·kóÂmIwys6 «ƒ`›÷zW6 ã{Ã÷c{C,ˆUÇ÷}÷µ9ØÂ/¨5~û÷\×'¸Ãøq;ntp-4.2.6p5/html/pic/freq1211.gif0000644000175000017500000002624411307651603015273 0ustar peterpeterGIF89aàh÷ÿÿÿþþþýýýüüüûûûúúúùùùøøø÷÷÷öööõõõôôôóóóòòòñññðððïïïîîîíííìììëëëêêêéééèèèçççæææåååäääãããâââáááàààßßßÞÞÞÝÝÝÜÜÜÛÛÛÚÚÚÙÙÙØØØ×××ÖÖÖÕÕÕÔÔÔÓÓÓÒÒÒÑÑÑÐÐÐÏÏÏÎÎÎÍÍÍÌÌÌËËËÊÊÊÉÉÉÈÈÈÇÇÇÆÆÆÅÅÅÄÄÄÃÃÃÂÂÂÁÁÁÀÀÀ¿¿¿¾¾¾½½½¼¼¼»»»ººº¹¹¹¸¸¸···¶¶¶µµµ´´´³³³²²²±±±°°°¯¯¯®®®­­­¬¬¬«««ªªª©©©¨¨¨§§§¦¦¦¥¥¥¤¤¤£££¢¢¢¡¡¡   ŸŸŸžžžœœœ›››ššš™™™˜˜˜———–––•••”””“““’’’‘‘‘ŽŽŽŒŒŒ‹‹‹ŠŠŠ‰‰‰ˆˆˆ‡‡‡†††………„„„ƒƒƒ‚‚‚€€€~~~}}}|||{{{zzzyyyxxxwwwvvvuuutttsssrrrqqqpppooonnnmmmlllkkkjjjiiihhhgggfffeeedddcccbbbaaa```___^^^]]]\\\[[[ZZZYYYXXXWWWVVVUUUTTTSSSQQQPPPOOONNNMMMLLLKKKJJJIIIHHHGGGFFFEEEDDDCCCBBBAAA@@@???>>>===<<<;;;:::999888777666555444333222111000///...---,,,+++***)))((('''&&&%%%$$$###"""!!!  ÿÿÿ!ùý,àhÿH° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“*]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯`ÊK¶¬Ù³hÓª]˶­Û·D d`0P ÀÝË·¯C³ÊiÓ"0õ£Aö4¤LÄÃÍ.Ç4¾L#. ð¨â•.b c‘150„Oä¶$ˆ éCD@‘ŒtäD )IJæRO—ô騄 gDã6@°‘> ÄlñBåÓxL…´Òp”#O8K=òÑ ¸ ä 1ÂÃ^&r‘|d$'ÉM€l8öùÿÂ|J-™¦Ô¦*»™o¾Rœ²Ä£9»™Nƒì’…<È!ßLy³ž–¼@Å(PŒ²Ò•áŒ%9ZKt®R—ë¼H; éK`Æs˜ó4¦=7ª0Sj¤£']ˆAC:N;’ôœ~Ì©@ªÒˆd¢¿„§0%BLz U#v³iEpJP„ì–=-gIƒJP¢Zd¥m©R-êÔªb$ªRUÙN¬&”–@½åS½Z°U¬…éEŸ 0š¦›ðZ«C®ŠÐ‘•¡sMéWZ¤ºt©iªL3*/¿ÖN°mka}zX“vU±ue,A;V½–u¦MëE0ËŠ”³ õ¬:yÉRŠÿ¾”©1õ(½,{.ÞR޵:©[ [®Î¢îLj^q»W³,µªj·É׃¸6«?EìgiVÛB"’Õ-2¡]µN ÀžCd…1 ! :ì n0Ò À p€A0 „Ü5†_ÞA˜x„<ŒˆW_¾- `ÙÕQVÄÑ!,øˆ`„ €˜A}m°CHŽ `B˜À„$y8¢-ì€MxBžFߪûÜÊ–÷”ç €…’á wøÃ!q‰O<¯¸ÅÈEŒeLcãXdžj„!¶eºUøÂ )2‡= bûô$6±Aœ|»˜ÿ Sþe•o ÓïØ¹ë²H&¼®/YÃcF²™ïˆæ%¯YÅm†rQçטθµs–ûJÞCÄÏô‘ˬd5„Íqs”Òè9_ùΨõ±¥#‚é0kšÌI>sš™,PDÔ‹–rŒåüèSOú¬znתYä!gÚȰt( íi#:ÔŠ^,£wíh+×Ë<Îs¥‡ÍV3DÌ›Ž5¡g}è'¿y ¥îõµQMY¢ðÙ\Þ^¸“ÝiZÀÖÁµ´uMeuGÛx~Y°SÍí†Ä[!ót½Ëès $ÝÖþ7»=‚Ö‚#äà I8§emèO?ûÖÑí´ûñÈAÒÙÿø¶-~ñbƒùÛ¯V8Ç›Ýäç;ä±ë‹©mêuÿºÇîøÙ0Ž‹{Ùäö¸¹GmˆCÚä(øÅ„Nqª{m´ È€J„à!Cøºà@pOj È q˜€ABP „ |ÉC4b@è!È Ã ðàŠá ˆ] Q¥våÝå¢+R°Rê\!jÂ) Á…$VÀCÜ`;Ѐ6hB‘Fà„Ѐ”QÄòFpBå€C ‚0©;t”Qð þx«gMò”·¼h’ùÍwþó¡}éOŸúÕ·þ ¯Ïˆìio{Üëž÷¾/Èÿ.‡?|Ç+ËøXC~åG¿|„4Ÿóž½èIozÔ«Þ ¬w=ì/²}„Ôþö¹·{½7ã'|ö¦e+Çr¡~Ê÷ï÷|ò'}õW}øw} ¸ÑñÞ'€á‡Rèa€Äw~ ¸ È~¨yð}ó7}ög}ú§}³çÝ€àG€À'‚æ.'xy̧‚}ôG}÷Wù‡}X¸f5ø}(‚#ȃèG5?Ø~ñ€ñG„.HHh‘}±7ƒø„ˆƒTX~U—€%8Y˜‚Î×…-8GHIx2È}…8SȆ»å†oqè\È‚h„0¨„{ÿHƒ}˜†R˜ƒT¸ƒvRˆØ7yë„î'„t¸ˆ/X1X†|Ø78‰kx€”¦j˜8†šØ€ˆè‰ŠX„¡†£Èfè„‘xŠˆªl„ø†‡Ø‰´†x(†A†¸XŠ6…½H‰‚8^¬ØŠpøŠ(‹s8‹_x‡‘‡c¸„Ñ„Ÿ††¼¾X…$‘_P ° ®ðï3=ø-'ø%ðhà¤@Ã-Pw 3Ð7ðT%DØgB¤ˆ€}xBPZ©¨Ž"ѵ0 ‡Jà¥0 –Z QÚr‚{ qðx¤TG°Bÿb Z:€F±¢÷S ¸×; ‡ @¨H~¿t%ñ @_qz@s…Os‚|°aÀw`¤¤F 7I@0¢µ|€nùˆqO`”åÐ=°‰ð” ‘Ž–kd;°Á”ÅS3ÖèŠÉ—F^i2a9–ey–i¹–mù–?‰™Íˆti—x©—|‰~Ù†)1ó@ d O0u‹¹ŒØØ•_™df‰–ôjÉ–—™)—Ñ™G™—{©†N©‘"aØ@ Ñ` š¬ÙšÁ•y’²9™¶Yz¸i™»©™Á››9—uœ ÿIœ:Hš(Ù`v°/ NðœÐ)±)–³Y›•©›ÝÉᘋœw)œ¡9[Åù—"ôá ÎCZ©4ò ™ôi÷y™p©Ÿã蟠Ÿ9œMYžƒ˜ °t9ð ó˜•Я9R´I™·™›Ú›Bù›á ãù¡•hž%A0 P xMZ4J£×yÙ‰Ÿû‰¡ÁŸL¨¡Á¡Jž=¢&‘ñpôðò@õÀæ +jˆ-:Ÿ’ ¥ºê›ÿ™£: ¿—‘ú pH Ö?€K w0pÿ MB¥TˆMú¢OjŸ3ªùY§7z§žÙ¥<:ÆΩOÁ0Ëp<ð+‚’Ù2©£–Š4J§6ú8Ú©;Š‘ê£(1ªÂP ÀPkØð<>‘*Œo*¡q:«RZ«™z«ý™\º«è(zª¢+¬!о5¾  ÌPEÀ7$Љiq@#P¯#02€}€`¯þú¯#Ðg@†3p°B°ð€Nà?`CðþÊX`M‘€û± K_wlû7ª0!²k à©ÿÑ«q#@˜àô ³öJ‚c#  ÐÀ óÐ Ìð Õ°wÁ@p"°@ghl \ðB7²ðnàl0”€“€5PyÐc·r+·q [ÄpÀÀqààypw0·mkú›u0·Žû¸r«‘~0l¹qŠ ¸§t¹sË…°%Ðm0 Ø£URêŠ`  ‘@APk º‘«Ê ¬&ŠàŒ0ˆÐŒ ùxR«}$µ®Ú+¶ö¤0xûˆsH±‡p!À•`¨1gÿPƒdlËšyœ V1ÐÀ»7!µm A °¬–ö¼Ñ‹ÓëÖKs褽Üë½¾â+d/G(拾êëìë¾$º ÆÐLÎà´P[R{Ò` ¦ð ‚Ó¼¼‚¿ÒëÔ{ýû”Ù»½Ý»ß¾ã{ÀÓ’À黾í‹+ ûÀ À‚°Æ‹(ÀuQ†`/·"ÂúKÂü{½‘ÂÌÂìÂüO˜ç;à \Ã'^Ð Á0 qP?Úö†J¼¿Mq Å+ÜÂL¾“„Y¼À ÑÀ+Ñ[à Â` àaljƽ#\ÂF¡Æ ÁÆìÿüÂV,Ç LÃŒðËòÇ%xÆLœÆNü¿*œÈ ±ÈU¬¤W<ǬŸà Å =p‘þ²¤(£É„\†Œ½ÜÆSüÆ0\ʼő, ÜP †pÀÈ(–¿hÌ·üĹ Ê !ÊpŒÀXüËuÌÅ&±ûÂà ÅÐLO Ÿ HËMì¿~ÍR¬ÈT\Í1|ÍZœÍÁ…@¼ŒÏ?ŒÉåÈ̼ÉÎÜÉéüÉëÊíÜËŽÏ aÇ'±\Ì>ÀÜšÉþ<ÈçŒÂêìÆŒLÊ MÇ ­Í%a†À yp@10z|ÉŠ©ÌMöϵLÏìÉQÿ¬Ñ£\¾ðìÑ ÁÐ(Qž` ÙÐ Ó° j¤qLÑ ±Ä1=3=Ð5ý"`7Ð7}Ô[ž [ÐÑÍÐx*1 %JÎ,gkP.ÀÔ½Æý j WmͣРi€w ±XViýqkÝÖͼO}Kqís]×wýÎy½×á×ìt…¨ÖlíÖœŒÎˆMбØvíÎWüØ|Í’Œ÷+Ø—]ØJqØÈÍžÝØ¡­×£½¥`Bàµ*çÒ1ؘКÝډݱ ÚA(Ú‘ý×(‘žÇ0-PÆHÝÚ© І-ЛÕŠMןÿШÜqÛ*±*Û ¼&y’²<2–MØØ½ÚÚMÜœ-×Þ-ÛÉMÛË=Ù*axà Òð áÝÏ·tÝM-¬ýÛÅ Û÷Üá­ßãÍÜ'Ah0 ßÀ ži@ Øß  ®ÝÙÞY-Þ}Má&›à2 ó¯û•íí1ïÜÙ=Ü ^ßÝÍØ¾âÞâü}I@ „© ª¯±\Ù¨-âo}È ¾Ç­â‘y,NÚ.^0×7×ðhmq;®ÚIQâ'nßBŽå¡åEÎåG^3 b= ôáfå<.ß>nâU®WÞÈÙ>ç$ÿAÝPâ0âĶræñæóýãÜmÜ)NèDnèF¾L Ó çP½]ÝAMð_ÀßÁ& |  q=@ “Óý ^àam ^¶‘‰Ð w@‡ÎA€¨e^pø–WÀ\PÀMá®àB ÁGp “ ZøÄtdò#œ(“0`ÐÀLùé*áˆp„°–Àœü âaíØ®íLÁíÞ®à.îäpîéÞ#ëížïïr®¸à ”ïÓÎmÕ~íÙ¾ÞG!ð¼}?îåŽN Õ ÿð¿ß*!Ö@˜ÉÿŒê…áñ¿"ÿíánòŸòê^î,ï.Ÿ Ð ?°Š4þþñN‘ó¿óÿ î*ôî.ôÍž @ õp Åð¨?lÿï oNŸ%õ1õ O+õoÛ]N@;ÐG°GP´OîÛ5OöMßí#oiò~äó oõõòž†P Ó-ôKóJqöQø=Oõ?¯A÷ AÞ(AÁP |Pîðr•oàýnóe_šOòPoø·„øn¯ø-Ÿõ=ý °®a¿jcÏôÛ.ø:oð¶ßÚ¸?o¿ø¢Ÿ¤o2P €ñÐ ÿ¶ï{^—ûD1û„_ûßöЯûŒ?ñ)qÄ™ O0/Pü§ þ°øöæ$X,X±@Ð͈‚'AH„ˆn¦@ãG! ŠÕMÝ4."?2TÙÒåK˜1eΤYÓæÍXLt… —p%êÁž!¹4I D—.l8ð!ȉ/ºäè‘(Ì ÔdùÕìY´iÕ®u¢RÁ8Y~e[7£Q¤J™:…ÚR ;€Ùà°oÆI*][DÁe„X ì|€K™0`ɌŘYvògСE£á¦à.s…Ž^‹7)È¥MŸÂœDêAÿ€«VGœÄÕ¸R^RŠ ú@(O’èaÖ¡sUÖÑ¥O§ ôéÔ@WW/zôõÇØ|iÛÆ}8·ÆÞ¿ƒ/>ýœçÜåϧOô:AÔªëßt­Wön‘j»í¼ò°ò 8á\"N´,À D Æ4™<ÛïB 3$è¾òÓNC™úƒm¯Ù^°@Ý T/Á– -‚e¾Ùf›rhi/& AÔqGé8ÈCºxlIDðH0¤ $·×SðFÐòÈ‚NH,³dËÇ€ÜNKˆÔ(¼]JÒ¼#JAöDc@AiÄA Á„ ¯sO>kâÒË>ïòÎ?ñL$OÉ4ZÿÓÉ¡œ¬€YðE‘gÚaä.naê«§¾.´8#”ºEë€D°¾0ЍbëÓW}ö­ÿàW‹  °aŠhØ|†éÛ§^„B áR@P |`€¸À ˆ`( L$ $à;X€ÿHàÿP  ‰J0‚Á1¡™A4àˆ²‘Myg3šÐˆF f{Ý N2¢Y±Å‡3ðAh`ƒ&L@V`»4B>ŒåS¼âa®¶–Pc Š`ÄÆñƒ äë ÀѤ}D‡Ü«âd| ÖeˆEzTG „€$! õ¦AUZ.“ñôå5ë)’{¢4Ÿ7ÕKq2hÀT†6á(Qm’ÓwR³¡$Ŧ=%ŠO§òȨ7AªR›g¥Ö²£Y TÊS‡–Ôª'HJÉZŸ­Ú¤«X*XÕ(Ö·ÊĬ;•ç/« Ô« 5¯EõæYZgè8Æ2¢Q‚FÄÿ¦ƒUÉ^áÙWŸB” AmëP)˸Ö$b`ÛÎà†6ÄÁ9ª)±‹e~V%"0DF¶†!ÔÅÆÓ$Â@€‘Ðì@8[·Êv:¡•O$Çà‰e`@¹"IéÜp„º@­;؃!à€IL¢¸9î†<;Ýè0´5}ntѻ͈X»lÑ®&¹ë]ðŠ×¤ð}ouÔë_öBWºýl|¯›]>l·»ß ïxPÞ$—À ù/uœ+à w6#òE°‚ñÛàýN4Ãé-,asØÞX Õ=0}lßç×Á^ñyU\— /7Àî½ñ®6ÜâµÔ·ˆ÷e°~×ÊßS¸Äÿº0oÌâùùÅCŽ1ˆ,â$&ÇÒirŠU åÃøÃF,[‘kã,£eË$>1†{ f{¸È3¬†Ó¬å%c¨ËI†³”å,ãcõΓY3köüæ¡r8Îbžs  ñŠ³Û›WùPXŽg—Ó[ádå¹@B^ó‘›ç'IÊ{N”ŸÚ›/ïø‹€£³ÅæJÿ·Åw.ó§Ó”ÚSzÌ3’õµl½ä9ø×Ãõ¡¯7è0÷8ØNs­'}íL‰ÓßÎÔ¸xîUWñÕÑ.n½/Ýë ¹úßó4öÁž¨†Ç{Úßu3ÞîŽüž8.ù›RþáhQ»â3ÿ‘Æsþô%;Ý­¾ùÃCüò&_<ê7¯úÕkéófÇ÷èÏÿRzÌ·]ó¸§IÔíÈ<â» [mà„Œì ¾7‹Àïp@š+™ûˆ¤žø}=—½ID„#2H2 Š à‚ú_±Â°¯d B ±ØEí5"þñ[‰òc³@?õc¿s¿Œˆ¿ùƒ:û üÓ¿à?ÿ‹¾Û @0¾H \¿ö{¿‚`Àã{ÀˆÀýë?ð+ÄÀˆÐÀi+ÀôóÀA‚A#Aœ@>ÛcÁ ܧó‹A¼1„?ùÁûË¿üA¼@lÁ4´ <À\À#¼Á$”@ LA‚XÁ'L#Öã@!¬B#l@ŸÃA%ÔA&ìB'üBÿHŠBQ›B$B54ÔÂD9·sCòƒ<¤Â´B3d¦<\B./üB$ *…Vˆ…ÃŒèÀ!T±" Á+ÄÃ,DDü¿6ôÃFŠ`ð„2˜ Äˆ°D2ÔÄBܨCTÃDˆE|ÂQ¼ À8)@bÅA,C$„À4ÜÂO´@?üCws0…,è€@€ȈX„pÎx @oüFp GqGr,GsáT £ñ„‰2ÙÀZ‡ÅX¤­ (X!o™Û°ÚµÛ€ÑÛ³¥Z—@rˆ!h‡÷›W”¼€AÛ]Ø<ÅÕˆÇ/È îÓÌš=\ óÛ/ݱEFo‰\(Ü‘¥zž-€ àÕ]]Öå x4¨€ÖÝÕ•?Ø  ]ÝÝ]ÞíÝÕ­ÿ4xÔõ]â-^ã=^Þ^áE^æm^Õ­%˜ àè•ÞãUÞáu^íÝÞë Þìå^ð-^ P!Òmžçùˆõ]_ö]_¸h_ù]_Ș_üÍ_ýÝ_ö…þ ``æ_ÿàN`V_¨ˆß~`>à®` V` ¾` .`x Ê@øƒï#Wö– ˜Ò…68aÖ†n mp°¾ái$h 2€ ˆ-] À€  ÛQ)¯€À€ò$ˆ b øà=Q€ Hâ%nâ,ûg‡rJ]ñ€pq¸…gÄTÿ`Z ‡sP„QIã|A†rø†e°á )‚oðqƒ`c7†ã4“P8€.¸†Е h)‘¯å È‚e˜øà”Hžd(kÀˆ*Î’ 0‡+`/X‡˜‚KÎäMN2€ŽœåÂÄ6@†:¸ƒ3ö”5PƒKKV€fNùå`ˆnBàÜ›x€/¨Æ X‡ b6æ$Àm0c0œ\!…rPi ÜQ©Æ¥êfæásn2ÀJØmHHNù!o®«Ófnöf\9¡h€m`ÏQ9ç{þª@Y* ˜Ä°?ð”;\Cgº2hÿ³å°h\A8ãcàgOY*lÆfNY*xʉæ dx &æ$»„U€(І$•bH°ØgþŠ¥Ú‚g ‡¸‘¥Š„W€ °†_ ”U¨É€)Ÿj¡N3¸lP3è®]qGˆØ…n(‡°ì°(†lø†¶ ”hX†i`†0²6ëA{€¡€¨ \Éž™•8TO!ìh N¹¾˜DF€ÃÆaÌÎlÍÞlÎîlÏÎ*¨ËO¦h(`‚"x‚)Xj ˜ƒK0‚‚¨)€$Hm*Pè™Pÿ„,€Ð–ÏÆag`¨9 †b¸{8†g „ xxHp‡“£f†r˜b˜,4 æƒ;nÌ.n¨q†ñmévè€z05`÷*€@€"¨–hXbS)HN°•b€‚±à€cÐbõ6aöÎïýîø-è†3ì#— §“`[PveØh`6K0‡e‡¨bfðˆ^¸†` ]xÆI ä wá ý~om r¥¸ðH`„ ‡’tȨÐiX¦$@†^–‚ïK†NÀ:x ›&†÷qã¶p!Dxÿ‚xd"§+F8€n(Œç1†xƒxð…b@†s ÛF@g @ˆ§g¸Ú0ÖdøªHH†2)pHâHHa1ò6ßfç9cð@¸ x% ^&èøó@Ÿ«BÖ>è†DŽ€r¸%Èð€sÐ1ª,ˆô8ò ô8"ˆ†±HEø?ô@E/u`u€c‡a ‡`HdPmî@‡i0†vàó‚PeGH„¸\k| aÈÏNb8‡·x†g4ªrx°\e'W*ðšnШ H‚)¨–ŒÀ€¾È €xFˆeX&ð*¸ÄZИø;Pa@}/y´X‚~Œˆ2@“où¡,€Ø‚Âvy›¿yœÏyßyžïyŸÿy z¡z¢/z£?z¤Oz¥_z¦oz§z¨z©Ÿzª¯z«¿z¬Ïz­ßz®ïz¯ÿz°{±{²/û$ ;ntp-4.2.6p5/html/pic/boom3.gif0000644000175000017500000002544210017034536015044 0ustar peterpeterGIF89aÅ´÷ÿÿÿÿÿÌÿÿ™ÿÿfÿÿ3ÿÿÿÌÿÿÌÌÿÌ™ÿÌfÿÌ3ÿÌÿ™ÿÿ™Ìÿ™™ÿ™fÿ™3ÿ™ÿfÿÿfÌÿf™ÿffÿf3ÿfÿ3ÿÿ3Ìÿ3™ÿ3fÿ33ÿ3ÿÿÿÌÿ™ÿfÿ3ÿÌÿÿÌÿÌÌÿ™ÌÿfÌÿ3ÌÿÌÌÿÌÌÌÌÌ™ÌÌfÌÌ3ÌÌÌ™ÿÌ™ÌÌ™™Ì™fÌ™3Ì™ÌfÿÌfÌÌf™ÌffÌf3ÌfÌ3ÿÌ3ÌÌ3™Ì3fÌ33Ì3ÌÿÌÌÌ™ÌfÌ3Ì™ÿÿ™ÿÌ™ÿ™™ÿf™ÿ3™ÿ™Ìÿ™Ì̙̙™Ìf™Ì3™Ì™™ÿ™™Ì™™™™™f™™3™™™fÿ™fÌ™f™™ff™f3™f™3ÿ™3Ì™3™™3f™33™3™ÿ™Ì™™™f™3™fÿÿfÿÌfÿ™fÿffÿ3fÿfÌÿfÌÌfÌ™fÌffÌ3fÌf™ÿf™Ìf™™f™ff™3f™ffÿffÌff™fffff3fff3ÿf3Ìf3™f3ff33f3fÿfÌf™fff3f3ÿÿ3ÿÌ3ÿ™3ÿf3ÿ33ÿ3Ìÿ3ÌÌ3Ì™3Ìf3Ì33Ì3™ÿ3™Ì3™™3™f3™33™3fÿ3fÌ3f™3ff3f33f33ÿ33Ì33™33f333333ÿ3Ì3™3f333ÿÿÿÌÿ™ÿfÿ3ÿÌÿÌÌÌ™ÌfÌ3Ì™ÿ™Ì™™™f™3™fÿfÌf™fff3f3ÿ3Ì3™3f333ÿÌ™f3ÿÿÿ!ùØ,Å´ÿ± H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœQš8sŠ<Àªg @ƒZ”a%™£¬ ]Ê”!+h@FH%ƒèfÓ«X±õŒ*•ŸYà eeŠ«Ô¯bÓâœQŠU©#8ŒV­]–2rè@M Ü#Œ ª{·pÉh=“"’·ƒ¹d÷4¥ç€áË­ôìr„1Ü€ã"’œ¸ æÓ5w⮩¯G™=› VV Þ 1PÏÖŸƒ ï ïã ¯%å|xܸ̣÷DNýàâr=;v,µcÏÑ9àÿ®N~ ÜÞaowν+sV{Ê—_ÁêÇrg1B»¹Ô pÍ!ò‘GŸdÐ$XÜS=-ÈJ@ás˜bUÈØ +­pˆX‡¤5¨Æ[@tÁ Y¡†Kù&+/šbJ V%¶`+ÅEÓŠŽ‰áÈ b!ˆ)>©’Ê+©L“Š*€øF‹/uq… «¨âŒ•°¨RŠ €¬¢=E˜`.¸Lˆ‚¨¢f*¨¸ÂŒ4m¢‚ 5ª%L¬¬‹*rº"§œK®"¨ D¶bèŽÅ}É!Y~¹J)«üÑ'*ÒTZ©›•¢òÇ“w¦)}Zz©¨R*+pþAdˆ«$6Š4ÌÈÿ™i¬–¢*ê©prÚéI]¤bë­¤– ç›§¢«œ~”ŠÊ4™š**3¿Vª¤o¢¢ë®%±Â¬¥ÎÂI©Ÿ²†jl±Â*j´©¤r+¥Ûf*M*«\íJ¨ÒL´™"Égº€öIì¥ÐBÛ¬·¦ÒŠ‘¨¤k3Í$œ 5^;ïHV<çÃé¦+¨Æ¥hœ1¿Ã¾Ò ’—ü ¸•¼æ+ªà†âÄ+ýâÌ=µ‚‚`ñ (¸à³ |€bG|ØÁÇÑE#mt(VìAä…0ÃT…oŒ&øT‡8"H;»Às €Â ¡ÜaôÐv¤ÍÇI÷‘¶Ñ2šuPN'ˆ ‚ø¬@a+ÿ À  ð‚D¯4n-´&ˆÎ+,ÌÍÔ”xMÀØ^[þÂß§¨Í¶áj¯}(}|ntä’ eÊ š­5R°ž‚G‡‚ôèA»Í8§°‚8Ü+¦®S+. @ë…M4(¦ðnÇîIÝÞ¡Ûa P@-X €…¢i"t”žÑ6a½@¨Àƒ¦ ” $fB˜° o)Ø› ÿ¦´MÍsŒKÞã<€ȈÖ€F ¡‡&õp&=ñZ С½ïh øœÙŽv‡1щ/ºÙÍ….hïŠô‚Qå@ñmaü_ “ˆ3&¦*€ ÀŠkðŽ!±‚5ð8½™Ïhlóbî¤w4£±Â À €‚xò“ŸÊŒƒÈ“X¡‚` À†¼}®’kóœÑ’6 VTA¥.C9Rš„¬`'Wé,4}v0ÜLÁ<Óña{h wIM,Ò—$D¼¶€ÀuíEd‘Qbr–…Þan³C·³,èrš™sÁ!±™‘@La˜(\þ €ÿ7p&†©äbˆö¶( Ö(¤;ñ§Â¸€ í%=?‚7Ÿõ =[ú­]AgÄ,˜6(<.—ŸtA \ .ÊâšI*_6üOˆËŸ0S¶Êeá}p[ ì#›yR…h fS“¸ rªä™à|Áâu“ª>i(6ñÂSDaK9û¤ q…¦z„j=AÄtʳ¶².£L°ML4¬á#VôÙAÐ@Äà²jÅWyfyÛè–¿;bV$~\ˆ6öÎSMÊUÉÝ:üfûÎwÙgö§¥çOËY¥uGò”ê}Ã*êðˆùú唨§@þ-!r„ä_¾ó’± ‡ë½ù¸ó„¹öߨÍ\¡œ¦/ÿœg0ƒ¼ÙgÑ­= \Àif›¿Óà÷Y?ýéZ AdÐô­\œ®'6ê^Qepq]uD²*Duã8]Æ:Öä D¢\‡%QxÂ\@~Ggеl Ðlèç3ÐF_®—~F~,¥-€ùÖ\hUþåOW'’¡(cB| "ƒ¦m[§m¢ÐÐx“‘3ß—oäG~8à †FU·ö"wtM=A@xóQ¦E9£ü&{øÆz x{®—…Èa°]&B|@ “Q“§q23¦`( H@Ð|0€ö%2‚aÒ¥7ËÖaô5àd #c{3¤DBX$ýkxÓ šÿ†…í~ëÇaöõsìwdIt³w'w±5ydЬPK2Ã!?(b2hI![lXhX0_(Yp•8QhWa6—õv8AzD2…,ð‡ÌælÒtžt p?7~H¦gÀä ¥0¤q–X7r5©&’ñÅÁû—3sFá×l³tú–»·JESÅ}¢Å ä·oH&g~øi*Ål¡¶~>jë({ŸV‚€_>Âg!|²1@¢ˆ¨ˆ#ò="ƒþåŠ ‚9ÃlѶRõmö……m/b[YU9­  }<jê8pþxŒÌf_œæiëÇlüÿÖaçÈ~ø¦Tr8ø#@¥ (ŠuÑ #×PKˆ±¢±mã¤iœÈa·—Ùið×^°M]VLôÈz#&{3À‰AçÏöw+•œÆi$h‹ü! gg#¬q>²€f#ßu;RHÂ!dÐr ¦àñw{†Xè7É–ÌÆH»uY©wb‰‚tça9YsW9–ÍÈ~ì(’+u‰møå À9#¬°†x’Xaòƒ Ø!NIrÑyˆ€Ëf“{ˆ~üœü†‰þ¸‘eLjáD<‡“q†{v7–X_˜(‚ ˜“*Õ>ó™ pŠ[á¾ÁŠ0ŠÿB‘6Ø Ø¦xБAe‚7(Øzó•{·mó5‰–o—%åYÀ@ia´'’ϵ–hI{ÂÉŒùfi‚Ò¸i-Pƒ@¢š+–08Ò $ç™mÌá|02wüÖ~}˜ë—i_€‚pÖÅ:,äŸYqX‚@_ÐU9_û†…ËšYX_¶˜Œ—ˆdÙÙŒÒù#w—P¶±F´©€§x ‘סmÈ›—ˆ~H&_H&] ™ïšˆ7X`$‡e žF~»',Л1éF–¥p‚~÷z=Š‚ºhƒA‹áƒ Rƒýg(cÒ!×€ƒ‘':¢‘žVwì×£%ÿ š?÷¢óN_¹,€Vx…š6pZ–Éoò¢Ò‰…T‰…õ™x1h"ˆ¢¤¬Ù†I‘×V¨#€g Bê¨p¥Í؛෫mÉa(ˆ~‚à—”œ¾q€=ácéÐm°r)]TyŽW“  s’â "}Ƨ òÆ÷#<[­à`¡@2‹þ‰YŠd鈥X–‰…-0m•šç„,¡!d¡‚ôUd YŠ™5g–&˜{"hw `M ¨­`BÀ}ê!3XŠWÖeP¡‚¨¨ Ú‘¡æ¨]È‘*%œˆ2 À$÷*B‚_ˆ~í'g*’&ÿ™>·¢Ɖ¦º°!‚¤’Ñg{™Š_Òª§"Úæƒ b? úo,esÍ†Ž²—«rÖ–õ…‚~ãi €0Êš[Oó—¹~µ‡µG†~õ‰{vZ–¤I¶˜(gwuˆxÝjy‹#‡ª²§¤ˆo;KœÈH¤Íæ–W*¯ÀZ~̆‡D«€€ÐW™%±H×)]+•oõõzñ9Y²>£dI£u–qáIŠËA¬ ¥E{ P"Ðð#„—+¤—»‡twWŸvǹ´g»V¹­Õ« $ó'¼õF'_ys‹â7œ·ˆ{¶«RÁªŒµ·Œpfº>Ò @à^€d"â93_ÿ2±Ä7 CYe#™«ÌF…3€˜ Øa]XŸJ¦¢ ˜¢€¨ÃE‘]¥å8·úö"‚вAsÑÈ~WpZѨµËè?ê™6ù´%˜¦K·gýW°—Üfu=[Ñ´‰áœ&’ìxZTZµø¯rvµeI“¦rg¿—•*Øaú6²·l7Ó Ì.B ËæoÙ™“D §î»ÀžË‰k‰­©(ÌÊñ—嫀݈ŠNб³:Wp–vŠ“*µÂȹËh‚v·Âô j ð"wãÍÅs& ~ [_œ¶~¹šÆ]K.»œwwo +¤F“cI¹¶{§WÓ@0hØÿáƒ4ƒƒ²ie­à£?Ÿ[‹+EÂЦaiëwP;š9‰3ýÔi«d¼Ê¹T«Äbˆòc.²wÖTQ€…ô;~ ì˜ZÛ¶Y‚× y=1˜·u¯&"†R3Ü»º@y˜àµ˜ˆ¤Š ¶mTË¥> g.ÜŸÖ’.éf(jÔœ¥FV‰èhZ(ñµÑ‡˜·‡¾·WsèØ›4 t–¨…i܆Ž7· Â{iвIžX“ƒ™î¹¢ w¬ç©3 ‚=G¿'«“ºZ¢ŠŽ º¨pV{ÉÐ4Ëi?Š…^€!Òlß¼RîlsóY‚O‹wÏ6–˃Oá™kˆx­z&°ÿi|ù¶±%9_r]'3 :š ìi mmz~¦šÉ5·lççǼÀüÖÊ%A5ÅaFËGÖ–íG‰”‹°ùlÑÆauf€s›QQä › ÅŠx Qg0¢¬Wà.ÐLj8{T©•L}Í jd‘ø3::~iû×vZ‹˜g8Œ¡ö™Ï%Á•û×UÛ8«‰Ï6‰× N‹¬`€‘‘Òy*3×¶gPÖlög­7{°wµØ§\ÉÔ¸¨;ZŸYkËœ¨Ã^€dTÓ}¦À›%Ê¢s-_Ô™õu‹ßüÍfìi0(&ïqŠQ!‰…5©®G& ˆ×ÿ*p˜Éœ9Z²þJÎýèʼn™W j)LšXùžÇHÉ)X”=¼Ž}ZÜO™¼ßégôj–еJ¦R6‚#Ó ÐRnF9|E+3k „=¡Ð¦Z™3û¦¬>}dÐÜ£³g{ œÛg»Ð†w#i“^0_O¡W0¡«/"ù™6‰¥•¢}Õöu€:{ dÐâq±¬Ð;Rƒ¨j ØyÐ,Ñ*:‰)xÀëŸrç¼ï—~µ8ào¶£ÁI¿sÇÂ¡Æ ˆ9qD¦ð}ÓlsìøÅ€ÜܶG‚ŸÆÒ}ÖÁn!çšx ò{×=|3Û#ÚŽ—oVèÌÜ®tLÔ´gæ-{fÿ›©…˜Á‰d{WÏ,q¬7ñIq3;´á§|Û»‡gK¯D­!<«ìxÞ;ƒ:’(â¤©Š¨˜\…#ÌS9×l¬®=Z‚Í«£õ™ÉäƒñRZ™½o40+±n4NâFÚ‡o4Y•5y‰¤zà NÅa ˆð_ÉW¨Ö}q§¾#ŒWHEÛ;D›¨êoý”æñ ˆ‡ãíx¥B*»Aä—©„¥"݆'K32úŠ ë«aÔÛ~:ëz˜}o ‹ÖþÚVê’rÌ:‚(ª.ÊÁŠßº!_ú·t(ÈÆk©ÜíÔò9•ãgº¤F§•µH¦ÆAá\_ t5羜ÿ>ÂËëN ‰e 9Ŧݧ€Zàií#½"Ñ …{.´p7c¢i”oò{¶¯RœÆto4m³ø‡Lñå¨ïŽdùÆæ Ûle öufb­ÚC™#§Ì ¾‚hÑ@$©¨‚Qx¹bM~Áz¥u;'mLK¿L^µ‡;Üw©”Lµ/ÒØ«b±š!áÇÛÿŒþl®ogéå^á|9!Ç]v.kd#H‰ Bï¾o Ý©Ñ7éÓ ÖF³ˆ3“ª ºØ‹ q÷ÍrWß aç0²û ¡¢Ð"Y°÷öÅá-„‚9Ão‚P ƒiݯ¸ÅǽWæËÿÊ—°ÅÒQÈÆÃZ¹9üÀÑÅa»g׈Kðö…7Ä Vo,ŸÆLêãöèW“T \ИÑÂŒ^X± ´U3™âÀ4‡Ö,ŒÖ Z4‡¬Z9ĸÐTÈ…#Y!ä¥ÅI‘%"Âò€F‚›.f(˜Àœ> ÒhÑÂ…NZ(´‚ÍéS¨O º²bET¬Y¡ZAÉcI­aŠL #A vF<ªVAQ¢4²ŠF¦¢¬µ˜Aƒ‚ âÚÈU²ÂíðâV aúÅ‚SFArMõÅâEé[Dlá×EO¿FÓôâEP °XÁŽ]Û)ÿ×®!U6µ};¤)•#u™Qy NFg¤&4»9˜äâmQË0ä- 2ÚÉ‘‘–„)2à@j%¬·(U,Sg(%Ú÷ÁN-”Vë'Q×9‰·Þ¬ê-¶±HB)±‘h«Í!Sie¤h@2k¡êø:­´·üš!7ŒÙŽƒ+Òêé´–±«Á@JéŠɃ 1A°X(+¹)·Áä#È ØÒ-®h!¢¾X°"t2¶çx$k!Ã"Á$ØQãVf™òÆ ghk§ÒÚï9S€!ˆÌ :(¿ü¦Jà¾0ZL19Ò늆*ûðŠ+\,iª×0$´ºþŽ£ÿ!>¢„ž”ôA“Æ[¬ÂIJm……Vé"8 CA Ó"³4¤®037DDà`*,à ÊãZ˜ª«ò*òVúú‹ºb=B6°[óØ9ä«¥Ö›tÚ°x¯«’d²«ÃȨà•,œÅ»ˆR@§ ¹–#•€¨`ºÐë-ËTK`N°ø0Y Ç[Ï‹“jdL¯Ëzd‹€ïuéH,âÕP†ÆR—j+Ž*WÅ"›¥«bãt!/~qàÊp*ê\Ÿfü*S € c Ȥ/[» ',ºw†Íö`XÕ2Å ö/ä š@î"gý$ÊtÁUX¸ÿ¢Ò+,ÖÚ©(òòNŽX°MÊ<"о›ŽL@J^›­"/f ä ‚ ú>@YYT¯n%*¾‰X1…¯®¶=•ö;È›\+{¡&·–ü)Üt»ìȵ ÉÅ‘ž3‹Ì´|¢‹‰¯ÅLî@º@Ýpd}Eh½´° ['>ßr=ÃW2<3ë r` ƒMͧö »¡R2Ÿ|ò®»<x=z˱… "ˆ#€x žŠ{À TÅS¤hP7?\£ÛY£êS¯?õ¦¡ Bq„f†:à ‚¬m¸ÍýDp¬Áò ÜȤ,_" 6d`…=tL6Œ) ޝ–©.B‚@"Jÿ‘Ñ´€~™M€p>¹•è?øK˜òçD´@].¸ÚRôr°{ V~QÊD؃…)E']Àˆ)xD¬p2d cQÈ Ñ fBxý ¥(ÅùVŸüGq£ Í×Í,?¡ÎÞãDZ":!J¼`$pP"@2ˆNгä!QO!J*2ž)ï) ÙCE€€ˆóEep¹ òs53žVW« Þb¸ýä}‚é )覷µ±â >éŒIøXØ 1"XèÂI¸0H\b#!CËtð¼l fu ‰"·âÙ½fE±•óÒkƪ؉’L’é?»Ø‰VÓ±>IMi ‹(Á°ð8ÎÂÂXJR¥°ìa,n ­m »®˜Â z€Í<ûÚŸ ¢Ò½Êh}zÍ›žf?Ç)Ù »FÚ&¤!Rhmp#ˆ/´¸Å jc+ÓÄæÔ½ï]mu_KÖ=hwªø+ÍAâ²(~ý´PaKQè€P3ð{eSX‰Ê÷=cK!QçR˜¬ÿyËZ$‡-h<ë­§’,ìÁ%ÅB+HZÅr!¢>ßtëK“U…û Ò ‹¼AcÀZÙƒ^¾@ƒ#{¡‚ÿRRLØG™µ²•òM»º½ ®F1B¶½JŠ«Ø’•Œ,¿ âɧ­²†åÛæLî4W›ÊZ‡ÆY:dÈQáJ j@?× 5`‰_Z±æçÂYÑ‹NÝÙâ¢1E |RŠk!æ¡¡7Å4@°2x²—Ñ£®ò3 Ò–¶àÄ& ðÉèõ“ô©òI¬XVfv³LJq‚uqIýk¯Iɱd•ƒ”äìçj³–ˬƒAsº%Äžùf`gû¦õé‹ï ¾€¯>p:Rµ´‰ZÅ4ȵϜˆ^‹ZÛŠha»@Ù­Dúi«OæÄV/ÆŠÿ)s`vŸYÉ-1ô? *Ï[ÊV‰øM›2%…$E9éOiðÃßÐHË6¥hE`ZSšÓ¬p6 ñp>GòµÂöÌ¡¢‡.p °'oœ;)=‚oûÙ ÍøcªâªZYÁ 8 $dAJ¦öÐäB1˜ó¹ç‰&k“j^Ø&Íé‚Oc{kce‡ ÊOøCšˆÐ¶ ê‚Æ!Ä’ä#s:g5h÷¯PЬ#0baÍ\NqÎ\rÝš ÉlÁ #Œ`ø©SVæIYÑ:F©¤R6ƒ@T! j_H \Ón·Û/YP•_±ŠÀg7‡Èdb„ºO±VnÀ†®ÿ!Ú ¾ AÐ4¢Ë{®X,§fކ b£ .r‚h…’i™à¨O½(oM‘X‘öÐ.)7³IhD{=Pæ>Â+0€tó:MÓ ½TC)Žq¬S‹?aÜo’?Y¸Ü 9Z3½†´AË™/Ȱº†ˆ7y[’p†?ưÕ² VÀ<ˆ» <y±±Ÿú>Êa S8V°‹8¾‰Š¨Ša !ª(¶×xhû³?\:¦èÓ FÔ%t,&!ÄLª°?‘´ªk1#Æ‚à‘#è ‡˜–ä‹)š"Øl\Tä´n”‹íKÅÎŒœÉšØ{«é)­2GtŒ)½ +Aƒ-8„i˜†É»‚Õ‚=„Z…TH…XCAÈò‚P#¸ÊG$h„©£>„“ÃC Y7N£‘èŒ-ŒH+¨'ÈaÄ…¨‚ŸZ'ø¾°RUHTPi†i°†UàrÌ$V MTøÿá…?…U …?à‚ ø}R3AÊDkÖ¨ÆA9¾cKü‚R¸‚ôJ–‘(Ä+¿¨ ³â”›’MU@…ip…W°ÍÛTÁ¤’%9A/jOi@…üôT@@Î-(„BP—kš¶,V`À\”ëA×è‚æðÎxâ”%)…i"?®¨‚<³ñ{¨Û”jX…?hi„Íφˆ„/¿þT…UU„h…±0(VxT0¨\BÆñ hÈ»$C9$c²/ˈì=V(…">òTH…U„õ¼*4#ø”†TÈÒ•Ñä£B܈QWPSøÐâÔÏT˜†(eÿTÐ3A˜A«ZˆAËNô‚8ô‹@,ÓìÂzd’U€RB àÜÑ@x¼¶1#jøÐÄìÒÅ %E‰VX…iHÜÌÒFÕÒÛDW@SH…‘Xºê ¹ Ã¸!%CÅíÓôÚµ$-ASr»lˆUXS¨ÕU 9VÍ=DOó¡R.uTø|qŠÿÇ“ÏMÛõ×BðÙ¤†j\UØU?(„¸L>ÅŒA ¬u½Û¾ÌΙá4ýЉ$ R )ÁPó³‚òCý ³ˆQ „ÄlTù]$VxGUÓ|u†ød<Ø«„e«‚=Ž”ÕRƒÊU&ÎThV †à\…œ‰Óz ve…ž¨ÿb©]iaS8‰7žSMqÇÅ«¨ÕR0QƒZOƒú?y5ài¨‚†­³)§…€bGu…Û4¨º™›d@ÀäeWÛŒÒü´¨8„IÝW@X’hc”DКàcŒâ ¿ïÜ:™‚ø¢cù)'‘ †Ni^SAÀQV …‚(mˆ@Ȳ>`">QU  ¸BºQ•©pŠ?X^ùL`ƒÒRÌû[ݕҹ¡›AÓÆÔuU•DµWÕ‘"æŽx†å‰× >3i^†˜QŒè‹A0ÊJ¥jPä™mšE½/Þ ÕV Mà(•ZW|<9ô ¿ðD<‹Y(XÑÿᘠV,ç¬0AcgT…fp…g`?þÉÈæ- O+@µÍ†µ[iØ †ÖÆ0½9>‡xÛþdäMváH„AßY¿ ’åáCŒ†ŠCFdÄ|…ix† N‘h,á å=ÒS+ øÄQK¥èÁÌ@À n ¬ÕQhSÒ†¦ ¿k0.ê½jÆ)ƒ Ý ­k0ÙNÓÓRU@í’¦³í\\”N,,`n‹›†X ±Éœði†–«‚k«¦~œ‹Ç°† I”.†èG„’»:U›ïk µBùAŸTí^± †¶š:»£« g§¨+`(§ò‚ÿ"“PËÞšÙ`h… úÜÔƒch‡p 2ÄŠY+Â5TdC‡xš§Jë†ñÐG”X’Æ@Òà.®ðQÀáHdä3( ¨yÒ‹Aë ¸T/Pl¸ªpl¿ŒÆ8ÕuYˆ_\ ÙiaÊñf)½X–⊴¶•XˆC€‰a®‘@؃‰‘ŒÔÁv\ÄêÑo°úŒÅë%Ħ¨&´«¨@.,ð#*2Jd†8‰¥žBš,ßœe*¤ýv ëÓiÝÀVq¸æ”5ŒáÝž;,Õ Ã* 0«8Ô( òë=–¿[&Q•r-ßr.ïr/ÿr0s1s2/s¬;ntp-4.2.6p5/html/pic/pzf511.jpg0000644000175000017500000004762210544731166015102 0ustar peterpeterÿØÿàJFIFddÿìDucky<ÿîAdobedÀÿÛ„       ÿÀ,ÿļ!1A"Qaq2±#‘¡ÁBb‚3Rr²ÂC³ÑÒs$%56ƒ&’¢Ã4D´áñSct„U!1AQa‘"q¡2±ÑBRrðÁá#3b‚¢$4S5ÿÚ ?úf¹€                                                                                                    9ò Ç…¦È‘!…8¼’0U—6”NOzön,1Í“¿mÐÃ)+²eÀªÌ8½‰«FÜžH‡$‡1÷oÉ’-ÏT"êÑÍÜ{´“M°nBgºvmõWøG!û–ž›#z“»ö•6A4¿ÕŽßÛ+VôÙЄåoÁÄ•í”O¸½="=Aï<’<˜*§ö¥¿æ*}47}Ãß»®&¹ž¼;ñc2°ERÎB¾ M‡ØÜÊ^íÝÞ¢fìŽÝ¼É‹’³0y…Ÿ¾F1:ÕÃÀUíJ*µI‹‹ ^ÕîþòÏeþežîc&쨑ê*mb@¨t¨«¡®mò<˜8òHu;F¥‰çrùV2̼rT@@@@@@@@@@#Õ×+ÚñU8ÒæAIo•c•,ß³ÇÍî«Û)36Çì¨ûƒei¢šuhÞ\I.‘ÀØÄºoã"ñ"ÿÕMÄͪ“¯Ù™›\r $GPÏm àO *… …x{*åN…P“Û_æ¨$Þ¶¶ÏÆc*“ÀýHZEÖ†êU•—‡V#…CD§BCj“è0<ˆeÓdŠ&⊠»°¨ÚšÄW°Sc:UUË–6P¿1,yTmIà+|Úïü»üúkÉYK3Xä:¨$(€(€(€(€(€(€(€(€(€(€(õ†)öa ª$†YUd¸«)V¸#ÙW·™K™Ì-¿nÇ\m¸}&:[L1X' Û‡Û[, ^9 ÍÈDÓpx[ý M›Q½©PyjÛP“Ê‚O ² ƒË2^Ö½@fƒ·¦Œú(æ¬e™¬rT@@@@@@@@@@'wmiþÙ>ãW·™K™ŒÝÓoÃxãɘFò› ž|.mÈVÆ#›[ŸÛRˆ=$÷Æ„…T›ØÔ@ܨ3'ÆÖ¨$Ð6ÐF ó ÇÆ±–f‘ÈsPHPPPPPPPPPPP}ßÿ+OöÉ÷½¼Ê\ÈÇû¯··,þéÛ²âi>Ž5euŒpmjKŸászÕ™D¹ÚÖì-mªÄÞ€öô$ã#" h$ÈÈ‘b†%-,ÁUG‰¥'uvê(cœ¬.º˜ÕßT`uÒ¦üM­Î”$æ^éÙcêõ$‘DÇ,¥¡‘B‰ˆ©¸c¨yyÔP”=ÃÏÅωæÆbѤ $óFÚ[÷Ô2G0‚g@9ê5{•ê¯lì¹rmY«”ÙÇKÉjèoÄXë¿#쬦±8®õ;V¥¶U¨´>±v‚í™,^çÇ›ûªÕ\;H]_Žõø1Âú¯Ø ?æÀ|`È|t.º¯ó}¢Ðz›ØS&÷Œ?®LÛ Bë©qßãCÔï^Îquß6þ>ܨGÞÔ¡¢æÙŽ>(];£¶d6wÂsû9¹©Bë“må(ø¡ì9¸S‹Ã‘ òÐêßq©£4W"òhZ¢…ª@@@@@@@'wÊ—ý²~š½¼Ê\Ȩ“á[žÇÝR¾êÚ3Þp¦ÎÚ2ðáa¹èI%7þ<¨ ‘Ú9nÍ‹ÈÛgÓ¬ò´‡$1œO;ê]+ªVO ‘ÆGiG&f\±È‘E‘Œ1ÒÈZn䑘™ùoí5¦Ja`®"Ρˉ¦’sqk¢>ÊÞ=ºéî<¨ ÇÔb‰Þ[‚‹(ºX~à¬nè|—U_ÏeqH5™ç4Kö¶&>_sí™%‚|ÈRXÛ“)ap}Ôg_OŠwàžU4ÞâíØ%•Sn‰Ú?æ’(а-*ô Ç•ôÕÒGÙ8§¢ð!¢í8Îá¹õörb׆ð69ßE‡ô4òð¥"døöÞq‚#Óµ6ó'_m*ÍÑêÝyãä»_÷‘i¶&o…eþø ²{_bLy_éŠ:ãI 7agU‚ǾF¦ÄQôî?äDÄÞvô»Ëàc±ÿÜò'ÖRÖ’(ÕЛó[“qM¦W:]Š:&Ÿµ™Þ6á¸Å´sÂH¿áË"óø0ªÕŸ+³Y7â]÷?íÈ‘¿´MEYuοùåâ?Ãõ'¿ÔÆ#ŒºõR5É|èyÕ•N‹|ûî¿Ì¦qú½ê0þ/Ž67莢¤®«È_‹à‡0úÍêdË‚`9‰1Óûš)Rˬr;W€ö?]ûÙš ¾CíhfóL**jºÕîÈþÞó£ëÿx/< ¹¾ 8ÿâš“UÖ®öGö÷Iÿ¨žäƆ9§Ù1%‰Ø­ÒiÝ~!êñUN«]Rä•\U Ÿ¦>°/{î9'mL1âiI\ž±:YÚ:qÛøœïVv鞇’îÊ‚N… G´¶áPIážãõ=¦”~þ“<îížHƒ.4 "Ø)qÅ9 ÆJ²Hù.]§>t£Ý,ÀîM³ 0Öa*¥¿ÂàsäMVVä‹r:mÈ*üÞÂÓ çl[ÆMâú¬cn=]XN*yÀÔ:œ».qî¦×™b]ªûsä6Lݵ]Ÿ¨ÍK9:‰±OÄÔÔõ^zÃâ+•ê¾Á™,åì9AñÅ‹.À![N•ñ¥M]ް~''ÔNÍ–Q3âoP:é·K)…Àäµ;‹®·oXÈ—ÛýYì¼d’9r˜LúØäÇ̾U] †<·øÕ[4]nÏd¼3}dìyq3'|õ†XâVÆK:é·Rü˜^…îuk*ÇãD)©7 C䨋$$^ ”„Ýàj*]#¥4© è?’¡~~î’hÆóHfço %Shªº ·)—éÁ7U M¼xSŽëfóÙ’cE&ÖØñªÁ[ ÒúH‹"´K飒d÷.ýºçK½f¾4’dH˜X3*&8sÓ,â̼I¨}ƈÐvŒØ>%wbÒ#1Ô׺{ñöTL’ê§K«ÃÓ¯WìÚ÷ü•ªu@/wðÙÉÿ÷cûêöó)s"•ª¶2:Tv I'bÜêíèo@yz‚NIöð¨% Anº|h '¨±I6gyâã êË‹¬w‰Ðmsʲ­&š¹õíéå2îÇí=ÿ¼vy3£‡nÆYK¾^t°ÇŽ1¨Ý˜µÍían5¬Ó’¢ÌúzumPµÅÛ›æý¸ægŵÁ¸ms¾cãçZ2<,…ˆ4rYb>À XsáQéLÎ{Œ¢å†-çØ0–>¦Aþ]4% ƒ*G3¬JB}4u¾«5kV{Èòÿ¶[¼÷Áí‹8È1E,«¿U I¢,˜‘ÂËËŠ¡» £XÑUÞ2õv[{‘â0‘©áÆ÷àE¹êˆûj¦·(JbGM¼á.KB[&Ú ÏžÖ6«+mözmÉÃv]ï£ÎÅÎq™ŽøÏ<]h’@hœ¨Wðkp£À§.Ì­EFYµ­Î ànf…ÃrÈ’Eb·+^‹3«)$Éí³´rw(:ØÙÚ©¤$ãQ+kÜèÍù« ¼˜EÒŒúyt(Î>Wµ•œ-Õ²œô ’HÕŠQK-Ç…À®ŸN˜žΛq,1ää}<%¤¼m§S_Uöññ>©ËgŠÜ©$Õ`ÜŸ#—<.˜åë*;Æ¢ËtkxÜêñ«Ë°ïäÒqÙLV´b„ݲñ±ŒTXÙXš'c¡YÒΠ’xsªêˆãñÔç-e æç•µ€.å#ÈÊ:МbMrKd[˜©Q=(ñ – šcæm³Þ-Ã>r¬d2K™l,„8:}—jP²ö2I—·¶FlI)2•ÆÊ}åŒ($°ˆ±6ãU6EÂ7ˆ‹i°·)·Ýjš Ž¬>žÞ-oݪê_AJ‚B€ƒï/ù#Ÿd‘ÿj¯o2—22é{Ƕ"b¯»b)â¡û‰­ˆôgù_€‹zÙ‘üÛÆ7ØÄý•E¾žçåbMê‡c'=ÕõRCýÚÈ}5ÎÁ&õw±ÿ¯vþ¬OþŠÈŸ¥¹ÙñB/ëGc­í<ïýXé"•Dý,û¼FÒzãÚ òÇ”ÿ¸£ûÔ©?Lûcâ"þºöç4ÃÉaïÐ?I¨©?Oþ¨¥õ×mÿl”ÿZ@>áQR~~d]» »bî|÷±Ûu Ëj7þLÊì6ºV¤{ý,Áßb` &Ç/| £Kz>•qÇ’»6¯´Í7 ˜bãa`ÇŠO©9Rq˜ÆQ#HdU½¬ÈXXžuZª\¼šxP‘M×1v©¶Á}4ÑÍg‡\gh‹ib¾·ÏjFãŠÀå"‘Ú¶ÐWjÞûwoÅr»}7ècž?®99°’/Ä6$qnW…ZIbuÛä¸ÇjJ„†Ý•¸‰±vøòT쉸bI•»cÇ#”–Hïnšj~Z”€ ûª«¸ËÆpšQu†êå­³OlŒÔÊÛªã¤+‰6ÙÁ#D®e\øçRòÈˤ«+-5i4tß¿mKZ÷Po'jaïRçï] Ìî;ºk‡%ÅHñ2$þge`uËåEÇ/u”Ž‹W·ª¥˜ã'& Ó¸qñF<û\X±.Û,™Æ6`ð½ŒÓò­ý—ûk)B‡™Õ ç(·HÆ©TŽÜ¤8iT¬½é«•¼ú|:ªJ´êÌ] _dõ— P‘€ÆJ¯AŒðñ<Í{z`§t&<Ó,Sâ±0ÈžuqªU eÇ Ïæãz«kÞy|ë©NŸ‹´a)eÉ›"8ß%#Y²ÙÐóYôéJã—è¼Fi&s;1)7–1Ô@~Qáj¥15лa÷FÛŸ¹fìÐúý½æÄÊ@ˆ^Ñ’OÔe·…tèc\GŸà~çè®}Nê  ½íù¿¬¿}^Þe.d|‘ÂGøÖ±Hß™9zUž)6©¡Î¦ûNŨEOoËßR*„ßÝBEŠ€/µ †k Tݽÿ·þÃXUb/¼EûÖ4ÿ|£(±ƒZücŽõI?2ö3ÎÿÑþÕö” ›nÜw<Õ‡$wHÁy%b±¥ÈUge o>5*±-#½XÖ…Š<(°&M›x8ëºeHÈ ‘}*˜@ýs¤”.×uñ pöÌiChq-Y^”©-Ì­n’†G\Ldƒ~¬Ò¦fyô¥”ò)qªÕhBª†V8󕽕^Wž5ØFBKƒ.iŸ§ÇÍ/•á%‡YbŒ’ä<øøxÔµOaoNV$¥'ä®9’rì=xäÍÇ—y…"‰q¤ÆˆíY_ª™HUúîêAWÀp½Kœjkw—a¿Ì:Ú1ð— |¼LFÀè˳Ì]“”ë0 9uÔ‡…¾6 KC \ÛunÂ9ã§pÆ ,)çÃ-“•ãºäFð›Ë‘ RO ,§S™$‘$û ûê[N†÷¥ ê•‹–DlPâG¹ån’eÉ…·Mu‡L[CqïQð«K#ѽ ÐkPÞ²2 Xƒë0ÐDV8âE]Mä‚ñ^ÎOº©[Á%U‚4.ÆÏ’M]»ƒrŠTñmÓ±¶‚zM}<¯ªŒëƒï5oMâ ŒÍÒš6w™™¤¿JC¦1ª¥lž Êþ<ŸZÃ#^gõâð,Â'KË :<…Ö y-®jB^ o‚E#ù”T2ðÌÝ}¸í÷÷d0ªD›ùû‡ž¥ÁÓÜ;Þ]W3àDÅ}šQù*µó£åïܯ9.È¢£³õ“²ö§°Ð›ž<±30q˜«p †òÜñ÷ž5ºÈöÛó»ñeŸjs—I›d,¨¬2d\‡ößóÔ²±vî&å¹ãŒ\QFÙ(OÀ—@ŒÄ¼žn\+žt÷œü®<ç lÂUδOÑ\ °!â'6Ü#} SÆyƒsãjËsG€¹Œ\.¹×àFì¡›¶@£xÛrÿ²)IÃc ÑV2 [ÊÍ…tÆê>‚<›n‘®/î&öü|àÀ…éòrzƒ%ócÇ|dĈà¿Qî)v!|Ü:ÉKDq[æn¤ ö´ñz ácí˜8pîX’>í—Žqà…W„eó©e 0p-÷U”›y”âse)m”ê÷R”Ó´‰îLhsWfÈŽ9²7gË;Æ\¶ž|†|·hN¤šðéæªÊi:’äæ«¸u‘“oîP¦$ø’¶^4ÚZº&÷úoËÛWrM:DÇ^¡—¼ÎA WPKØrIÁTHà±Çr£Ð_“u͆fLæq€ Pé%‹_‰5j£ÒV3Û}µ‘ÜYgj†yr˜¨Xâ[ê<£ej*‡Ó¦_£ô_ÔX¡é>Ë#-ŠÝ2± ³|^¡Û9¥Ó`庬ïnô«Ô Áòfí—Ê€³ ÈÆ»)ÀÙÏ«¶e.›-Ë(­TÍÚ0q'Ÿ rÏL}ã6Ù“†C{…¤Ü›pãTqÄ×û}¸GÔˆ ËsÐàm±#b¡GiƹC #\ÚÅmR²6¶›Š­24>Ç){u Ø¡K›R"_ÒòÕ™Ù [Ói¢þ[4}Gy„²^"J?$'ÐóøÕĹuŒƒ¿ä‚Ü~‘UV÷6½ïoƺ µßð¯ã¦ÿš¹õ:4:¨$(nïÿ·ò~1ÿ˜µ{y”¹‘ðfXÿx“úƵŽF¼ßê¿ÛC…ä*Ç:=·*uÏß@ ´ Cˆ‘ÍšÞPyû*­£{väüÔÀÜýÿIÿòZ©ÈÌ’õ=?Þ;»Wÿç/ܵGó£å/úè”]± ÿ¢°˜Êˆ±îɘl¤‡1\K(>]!W“<=õв=×óý@Ï•²Whæ€î™,±I]=I´iEbÁYaa¦­" ˆ˜·œl†L0£†áR͹dätcèC Äh§Ë¬H/¨óÖ½`ãí2¿ºjVÖ YwFí—‰Ù$SÁ·¹h#,œä®³f_›EþÃí«($RÏbНË_‰3¾`îxÒâG°áíÓ…ê>Lz‹.—ùT!ƲŸ•v”êwvÃ%‹em§xm¾g†y"N¬ ìxÖDvcåÕ{{k7Txü´áFLÃÁÞâÊÛr:‘a²fA‘)é–|e˜Åŵ»¡D¸çWŠUT+·¨[%劮:÷Œíç'+xÂÌ“?6|Ž©I`iY2sø ±ÈFìá[5Sé!ÑêÌÁ&>^›ËfâÇЖh]ŒfB…ÀfŠ3bÊoæacT¥2+È‹”][È î3Ë$å2Ú(/]GK)ÓÃå'ŸZAÕâʰöèœ7§ý¿âš²,mkùïUy"ÿÿ§Â¿õœ·æ }®Â£T#©ôvå±m!äÊ|xT12K#¼‘ž§¨”>>5«!£ÍŸhÁéD#l|)°,‰¥#_™µë<ý×<=ÔA#æ¯U1òßÕ¬ÁƒýoZñ3i ’½¹Vrɉ֘fPwS´D½lDf™¥:çf-øÖ¿—Wô}µDa–Ò; h»u5lÛv=ã6éϬ8'æ,ÜþµÔqöQ0F«é̽L3É3t^uúr8cùc=5mO¨xÕ54н&c¶ó‘‹ÖCXªL yƒ7½½‡ÛöWI–¢ßá~ïè®}Mô:¨$(ŽìØrG¾?ó¯o2—2> ÉŽFÉ—JÜj?}^2HëåñîJãi`r°dxFÇì5mèÁq.ö ..IÿÏÁOú*7¢ßKs³âŽÆiå)ýÆÿE7¡ô—;>(ívÍÀþVcÿ†ÿè©Þ‰úY÷xŠ£unXSŸ„R«MÈ.,û¼E#Ø·¶>]¿$ÿáIþ­FáôÓ]ž#¨»¸oÃlÊ÷þ ŸêÔ7SHÛ’ìñ6¯D6ìü-Ó3Lgl‚U%R†ßÆ¢&<Ÿ›ÜJz†“nÝÉŽÇDSaD³HOF ÉãòŽ5I|èùC§PÿlJOdzyŒ¬cï~¦¦•pdãæµÍŸí­}D}ø¶-é×fK‹PîöHdFufÛ¦Lvê$|º…ÍNâ\‘ •‹›‹›>-"íÑI‰\&PŒDNtë‚XV•-`ü¼+4¼Õ9ãŒêUGÜÖ,ÌÁ"%˜¹7è§Œ’Nß•ÏÙʵgR=Ÿp›oFšX2 Té°ý`xqµE¥L/Â2¢’©mØpöóµaî‰.FvxF›h‘V"±:È"—S; à8UnÅlÀàê0P°â’H“‡èß!q§ÎLJ:Èñ™Aa"Tðò]™¿T ×<^'—ÓlEË|)‘ÜÎwœÜº<‘[Å‹¹´™Gœ0¬HYc"Ì<Ý!î5´îmMæ}E§½àÕ Xý?îXcÉ“m¹ ÐGŽøú¢XZúã^ž5ÆùñxQ787%“X” ß¶NLr—¥ U&hÝ£“"$Ö¸Ë zÂÂü9› éµsWóü;Ž.³TŠª®…ãgôë»·K»#oyÂË8üÒ-ÜØéÁöÕ÷W{QjQMb‹Ï¢¾žwvÓ¿dn9ø-ˆ¬%cœÚ[9,‘¦ê8ó©,Þ.>:Ç$™2•fc4­¢Mv:J-—å>_Óq #Þ±•,YÎ2L€ —' “rƒÄ0ü‚£qœîÂ?4’>hõ@cî¾ fäÁ—ÃÉp£:2"ð½ÁQæÓ{{+74a.U©§*”lí·N6;¶Ï:É,Lí/ ØêTà­nUTÉŠI, 3°6ibíàGlEd&ï’ÒG'››ÍÎÜ-RΨ,25?MçwÃhÛ!f™ÑqÀ!àáé³êöÞ©©¦…Ñ1rÿê<Œ¦f¿B‘¢t€Rú‰,%äÛ†’+¥™j<°¶Ÿ Z¹õ7Ð* »oüƒ'ãù«W·™YäP:ìnbKût¯ú+Shñá¿”~è©¡ p°ÅýÿÙ QQG ? ¥Â`© ¡íª ¡í½Õ‡…hJGxàýDcöª )ž¢HwîÍ…Lj[W=ÌÑòœÇÿ}þ˜”Ÿ8öæß•¸F±äï†Ç–tÅÒd“R†rš//‹Š^Ó×2ÜRq’ÜÄ2{‹3¸ó’Q¹¶ û|A H]ãK0Ib*nC:ù‹e¹^´Q¦Tã''WðädmÓ¶v&$)‘‘$‘)e‡5ŽŒ/Jh2òÔ/Ú*#*I¦gG‘SƒkÏlŒ™b“¦¨Ú£Pm†ÓäÇäGÿ¦>ÞgMË´éŒ×h»vÆñ¹ Á‰aÇ›)–y²¥H¡2jFe¹PO…FåTerqrJ¥»·v ×mÂúøvõ›þåG‘3eIt¨]VPŒnàéðç—¾S—Ÿ8ÊÔ¢šr•ñ=›êqwÉöÉcKÈÚrxu8¢9? ü.VÄøŠæuI£Í†ë\y'šÁø’jð>$nÇhlåÜ1ãhÇÔF뉂ÈXù]@ºûxÖs—•Åd_‹ÕíÙtQnv–¬ìé¢Å|™ðVÊŽ¨s#i Mbލ±Ùƒ+\q®wÃkSë'Ô-»”ÉV•)¼WnnX•aŽA)}MçÑÕéÞh•ÇÔ8ija`yW[»å¡ñwº“¹oe)N“7tŠ$†,̘àŒZ8’Y^öUÃg¹œ‘äM*)5ï=þa¼@Ü2Àö äÿZ£s-õ7?4¼YÎqîì#ŒdäDÑØäºdÌÍ+²¤j£hõ¬+å^ÌÞ5»¹TzO›;‘_†ù‘A7ªß6-½ïkîLïp†i1ß@Í•fV•dw!ºR#8O! ÍcTÙºL­§ê\”£/.µâω…,™™Y˜e“=¢1JÝI0YŠAæE¨K÷U©´è“¢Å ÇÊeØ^HV4WÇx´ ZU7Œ~«)A¤Ö To¼ñ£7o“(g¿ö¢ñ£ò,ªÞ^$ª£Æ¸©&»È­Ç2,Lþ¼°}KÆÝ¶ü‰‘bÈ&'’(¥Ë\y8d‘5\øÕ•¬U2#ûTe5Gä×Ú§ÕËŠ#¬)ШD.J ÈÆCÅ#—ƳÚÛ¡•ž<”œÅö‹)Þ aÆW ç­îMŠóù€»•NÇÝàl¸Ž•¬iìÊÂÜ1…æÅɳu,W6ü#Mz¸x0Oçµ6>âW ÷x ÐÊX«A’–±wÌ ª–[ðö4qiW÷ ñ\c\<b“n ²eÉ“§Q寲¥F‘M¸Ý´­ÏêÒ ¬¯Ô¨Õc¨ûcÜûrUÛv}Çz™Û.XâŠ>œ‚$²é¸Ç•oÓCØ…‹pt‚hi3mxøhv©w,|)UâÉ2tÌù|À•g5ê6v™Ýâ[sÜ“E/uXxZWq‘Ìh²渆ÄþôyTĽ;™¤ú}‹‹ü‹B`ï>ebcÉaf7çhåìóU™Ñ^ôÑ"|Î%pÒ¤EE§ÐV2ßQe@^ã‡>Jªš4}]Ã4}6]JZ_.‡,ÞËêºÛ« ËQſ߱ýÚçÔèÐê  !û»þÞÊøÅþjU¡™Yäd=ûÝÒö§m¶í*æKÖHV7%Pk¹ÔÄqð­âª`Ùžö¿ªõÞ}Ô6|LLhc–'Ÿ(˜ŽŸDy‹É¨þ>4“H”WdÈÝ›&Ü –M&ãRð6¢a¡Nçßrv²9±ã<ÒÕßäO[ôU´99œ‡jJ¬wõÿ“vxZNŒ 1…>gÐ/eøÕa*££'qGMÅ[Ó¿P÷^æÎÌÇÍÄŽŒ `hMô£üOÆœ¤Õw¨ô¸X·FUo1‡qz§¼íýãü›oŒaÃ:c¹’ýi‹Û̃Àq¸µ.Ýqi$_…ҭݲîJXÓö©¤ÄåãV"ċڵLñZ¦øÀýDvàu43Ôÿß›¾“ŸÅ+ ™£å9Ëþóý¥JÇ0^,UÀò¹.Ì«Ús QAÔŠ ºð#‘@R‚A¥N §ˆó\}•yE&uõwÊ÷`:ÂÉÃÅ’YgÛ`ܺ,ŸQ$Ñè4ŒÁzEoÔYJÜü¼êö®(éS^=Y‹‹U«ÊÜv\½“ùV×Ù§/ê–9g˜Æ“¡y‰¾˜Íî9ž~ʵé©R‡£Ï¼žÈÕWq‹cÛ  É>?Ĭžg5ïýˆ¨¸ñƒ"£ôQ£FRLª$é©i6µÏ²‘IæÎ;v!9\rt¥h3Þ%Ûp¦ÄÏˇë´O(—mk¢´b$Xß©b>rx{ªÐHôz|¢­*:ºâ‰lŒ¼©;wnܺS4ørôW5ÇP˜Í²K#$ŽÌÃî´nE#ÐúÛQt”²BîÌEõ…“‹6‰ë°k²³ñ³ æMn©æNô÷Ë×A–gÓcã»Je7ŠeŸ©ªÚÀ¶ž­û ñ­:!~0Šy &Nߟ;Çs±i2¥,ò=€t§9²í÷µ¦e®8En’tÄw.Xš!¡ÿC/nŠØ›30ó5/ÉÊ«+‰£ u tò§» 7܇ÌÁÝ22zrM41»;ôu €±UvAÊü½§NÞÆMêÇ=µ6Òø;n$‘æãä.4 ’Ø&8'šIªcëv_$¨­v½•´™ß˜÷rÆØ#†wéçǸEqË™=”F0Þ]^Auk|j©‹"õÈÅV…r—×I™¹H#‰¢§’2 ]"%¸¨ýSU‹2ª¯â4¯Oòñ[`1Þ¤Pœ\…Ñc~q·Qn…YP÷šÏ¦‹l9$AXÎD±e,|gQò¿è¬õ4кãäbM¿f¦<ÉÖÆÆH³`Õç F¸ÛM¹i'ë ËQÕ¿ ߣôV›huPX(nñ6íÌ£ï‹üä«C2³È ‚hŠOÍâc‘C)·M¶1 ñgì¸w 71£ÀÜgŠ3.D1évM¶€x(½þê– FæXqd}3”” ðnDq÷Š’*s¹nT]\MűÄBIDšYH$ØhIž##~…P¡™—™nÊ蛪¡æòU|Rºû f㸃¶Q)¯Ó¬D$Vfü5n­~:”MqX³Jô÷xvðÇøä¬jÀâIGŽÇ’~(º¯õjYÓ†f±é’ÿºK'EÊg#%dÔÓYcóHºßCVáTÔÓBýé²Ë—&$3Âw©! J)+{$µÒf…3ï9Y¸§o‘21f±Æ89U…ÿ‰©¢5ið©y°x²ÉÙ[›ÆÛ\ ø%÷,IÆl1 òce,hUõpnV5Œ3<¸]k¡L=úŒvýàc(Ê%³—§<¹¤h¡™¼¥URò Z‰ãÀ¯½ÇF‡R½±ÅÑ<ó+½>;3GrytÚtê˜5ôÜXÝyÑ3-ïOJŒ7êŸ"$Ç’ X¯"èA ±€V!¾S¨Þ®NÿYÍb°X“swã”­4xg¬îyÔõlÿ”pç5Éî}ýŽV=§˜ÈtÞ<¦[ć?eq~4{¿…˜æñ.KâíÉ‘¼¬Ó$8‡KFu5ãfjeöñ¯e5¡áF{±OOô÷{Ê›¶¾œwËŽã ¸å&„ƒòÜ0Z4tÁᙪzeX%ÀPÎgoªÖ]g²F5ÔÚ-ÊÕJbi¡!Û{„¹½ãºâÁ—ÔÄÚçÈúŒpËÑšQå#RÇ‘e%Šù—ˆ±®“ñ-ßáþç÷kŸS§CÚ‚B€ƒïoûc3ãùÉV†eg‘ŽwÆÿºì]±.ãµ@¹‰,h©pªÄÝŠŽ~ÊÞ(Á™×i÷Ǩ}×Ý˵åeÁ‰@Ó2˜Ì1ÃÒùXêüBtñçI:Š5½…÷‰ÕJ³ÈnD7V±µÇÆ‘uÅíÇX¨¨¡'Bõ÷ôГÎF ‘LsøñÿXT@÷¼OºïÐEYåÛ¡c)bmúǗƱžhùnSÜ’_–?i”¯oï;TÙ°n±Ã†Ù›YÇ"ªS2–ê”®ƒuà‡°^®¤žGÑÎÛ«®¤NÏÜ‘mÍÜÛ¾ƒ?SæÇ,c eµ6– ZÞÛU'othÕQ0»(4ÑrÞû—k™fÈ;¾ç¸cgÃ×¼Œ®«øi ¬šìMýר±iEQ*"×®ú½ƒ <ݶ-Æ|lø2r#U™!q èñ0N× ¥XËááUôÚö-{‚­JR”[µNÜ{†òFf€ÄglvrŠÙ†.ƒZêu T’æÀñª¬ñ<þÅ ±”²L7Î÷î˸sö͵·i6œYbLyáKE–»(úÝšÌ×øWKŠyb}•«ÞªÝ yYçyw"aN¸{\ù0íÙÙÐE6TF,™fкž@²2ôÒO[ˆnf®Ñx¶Ëòì»?fŸ8º»|˜X™ŸÊz'ÖÈ—]HŠI<Ës«ÝzçQ’•YÃÈ‚Ÿ"‡Ê•;J2M›&Ùƒõ­1ÌH3VP¡ã"CxôÿJýõ7´8z¢‡¼¬å_KeJ9í®­&v"rÕ2ßÙÀú+HžŒh£/Ò^0*¼/ì«£åošgmá&\›¾iÅè€1 Ô!YŸ¦Í£ê2)ò€™ðåZ$cÅãZ¸›¹*S-+ž¹ì­vm@Xù¬.@8îÌÔËågLirí½†Ü=¹³ì“àà ÍÊñ0‹:b0ãi%R-Ð!ßÊ8üÜkÅ—n­OÔßY‹{ ·TÎw,Ôúl4—3 côÀ*¢$N]¸Édó:ü}•Ö²9¢ÔRU4oN³rgíÅ-»mÙQD¬àƶL~n 'à›ÛÇ]xfjž˜áôáÉÉéÊžAÔ?ÁŸTiç‰HR¡tØUKJ’{cÇ/|OÕL|¹¡¦>kÄÐåcÃÇT*]OYÏÌo/Ëã]Z–ŸðÿsûµÏ©¾‡µ‚€‚ïƒnÖÍ?ìÏJ´3+<Œî"Äs­ŒE&ÇÛ²åÑ2£d(/¥yE¾4 ¨ö"EPŠå•ªÔ¥T*(Ií¨y5…A"˜ßÇÃÌ* )^¯wß¶gnÛte6Vå‡ ñÄÂ2X‚ó¥O\ê®5§´ðïtÉO—ëUm¢Tö38ím«pNáÈí¿¯8Òç`¶'^EL1È&.­Ê_W”‹XòozQÝJžå‹*r¥hE÷–.æÏ_˜rµRäS£®=‡Rä%bv’¬ä«îCÅöò¬h|mp:ÊÌÜe٥٠ɓ*f›<$²Zq¦5¨]>wãu]Nˆôìu%nÊ‚N©ºã™›̓$"i_9 ²§ã´I,ÃN¶üM!šÖ¹§¨Í£Õ§J¨º,ÅñS?* ˜·’LwDcgF [©ÖÚM‰µê7ëµÖ1ÚûD·L¼¼ Ï!‘q£h¡.ÅšÏ+ÊKãw·ÙIM¼Êò9~ªŠyÇâT2‡•¿h‘Õlˆ¿üOý°þÉ­bz1ù%úY ìxY3bI“ÄrÊ-ðRA?eiÙòœˆ·SMì8³äÙ÷a|x©*Ë:É9?N6Q3[ƒ`B“ãtkÀÞíI)Æ1×ÞO´CkÛ·\\œù!8ÿK6Zõ¼¬Uá‘#eSbu0áz—“<þú¹“[uDZáS;ÖN~>„Ç~£5‘Pš×( o —¼Õð/·íÙ8̲àÇ›¼E­#ÅE†±ºb`®A¾­bÜHéöá+s{wI'îÁèðøÔ’=7Ø·ÐãÉ}œÂDŒ¥™Û©Ô%Ç>/ì©eø^¬iG„V½½õÄËñ¶ŽÙÂÇØò5I4óMÂ2,O~-hø°txW-Ô¶ŸgËkcÝ]½Ä6ãŽ8^\\^ŒÐËôï–œž«|¯Ÿ0·jÆ%,É(GÙûTÑ=/ÃuíÖž\‰YîXR.§¿Ç_Ì|kFw[÷?¦½ ÙH­6µyKFàtEâ^0úÞú¦¨×AîÂû3z‹¹¬Jé¹FeY“c.;ÝnòäD ¤2üŠ8!n?5nd³.©ïÓÍXjth{PHPÏQ%vvàçÀÁùò#hfVy†4÷µoCSNCÀÔ¢±½H£ *€ê÷¨´$ò ‘L~3ÇáæjYõjíl¾ìšnåÜ÷ ,¡Çd\XZLn¢ÆN©XC2†P›ÛE00»D›m” —;lîM­!Þ'ÀÃÈ– w ¹¢Y›WFwº7üFÖŠž6>!ædäã5‹ÚÓ!aËþyÅ·çKõø£é±¡ÆÈ|†”*"hT×™fà µ g%´²vî×ê&ë&,¸’œí©³ß{Í.&ž)NV)~¬ª¬zgSŸuAX[j„lɺ nà¶áÑŠòÉ!–BŒ—X«{•­Æ¹äšt>_«ú‘»IËuP†\ÑãÀÙ. B "[Q.Á÷š.ÃͳkÔ’ŠÀmüÚæë„çÌ~,|Xòå´îþÝþ¯ÐÜåàF±`Šzâůbü§Ÿæ¨Ã´•Ó“ü_¾Fñ1Ž@¨ÈÅs⌠?0o]ËRÇqÓ¿†î×>¦úÔ ¥ê»hì ѽ‡ÿºŠ´µó¹‘‘홚•nkvŒS,³j€HÃ%ê@ê7`¡"Áü(ò¡’uª  Õ„Šâ›äF‹€T½Z—·fÜáÁÜ÷¹ö쉡›ý×&22ÇU5:ygU[~ʉdsÞ”)I.ÙÝ17v-Û{ÎËŸb›#Æhuǃ®í  ŠókÜžG¢H£Û¹K°½m~¢öækɳýâ%2éš…Š»=ÛS¸Ò 5[Ÿ mQ¹-JËŸf &ûŠÑÅíÞ÷Bûdrìó6lX9“džŠs›~ŠÜOk…]½èŽÏÖpœ Mq r.%R/n<ê‡/ ú¨†‚\˜¾•CÂdaüKU¾aÃP°òý•-#ß”*6›3&%‹„dÊdˆ]>r5q¸±%¿…JEãoˆä>S#Á!M# ™WQR±ñQæªtßY"ê b[2ñd–V"À~'ÃÝYëRpÛdhÊ‘cà|EJtf¶¯mu)‰ƒ‘>ý$Kªx$V“À-¹Üòñ®˜½O¤õ°ç£F­²öpÈ©ÑųX¨I“~Zxñ®˜[o³ÄøÛ÷fÿÙ/¸³ål]Ù™™ÖΉ.B±2D²š…@#£¶û¼Q…ØÝºêã'/Òëà4Þw#Ã>.Fé„’mðN¸Ø«“ ]®J„S¨¶¯ ‰A¤òñ7àqù½i8KleÙ–8”.Û—:9;¿VLÊ',E~©Vˆñ ßU¯\SUGé<˜©E¦›]Ç»ÎÄÝ…—Ìñ®N¶9æoÇ´ì ÀX7'—…dŽ0òGË÷šW¥{t˜›C4[>VÝ4½G91JdÄM¿Gêêö[…\õ-®ãFì;åeÆsZQŽì_U*ÑuaáÓbͬ5¸òµV†…èdÆ" Æámöڵ܊íýOÜþíbk¡íA` )ž±¾M÷†ö}7ÿuikæ)så0¯8 ×C9ËVp qøT%àËSn4¸òǶ„‹®Rûh×${j ;@øÔuõ<9ÜÔÆß.¬¸—ĸ·å¨$§wÄ7Ö,-¶w¤ÊÄrŒR4R¥”:Y€~àC"I#d;O<² ¼Ú؆ÑÄrçí¢ÈÚŠ¢Ý¡‡—¼¤sgî0ãácÆ—.cø¡›ñTèT‚~cqûÌMó¸Õhy]W„®Å7%Eæ+üÇ>M¾½å¾4±D°v-{^²gÉJôœ+äN¨EqæHñÆÎ®¹A!›]ˆä.mÆ¡Œ[­GSDÑL‚HŸæCÈØÜT¬ „Ü]bèИÛvÁ¤ 8LiK‚t`¹áJ¾Óo­½ù™Úàíã€Â€Û•ãS÷ŠcÚGÕÝüÏÄèbáŽì´h?EC3wîk'â*8“z–gP]@j` UçrÀüµ-m­ëwË\F}µ•¼äm‘¾äò+Fù2A†ÁDhf+ª] |Ï s? Òr‹#Ò꜔šµmÿ-vùÓb´ý< ™`1Þ "–XæIŽ¸ÙŽµ<‰ð½ôùmQTPår# Š|vö¥Žt©Ö6×¶glû†tm“ «fÁ¨•›K¢õ^E{]Û™ûjÌkÃåËq]¹Žø×ߨ!‘éÿr÷#Źcm„adådK†Ç>RÓH4ÂÊ©dEó!¨•kQ.óé¸÷®^†õ®'Púu™±n»~Vï<{bE”†VI›-ã1ƒ#Š(Á<‚ð¿‡*á¿Èô6Êå6¶!ÝZs³3rÿG4:T£”êÔÊomW½d°>_“Èß~RMíoNìOKv,]‡x²³’mƲr”N $A} WÊ=Õª>«[^Âõ²¾ dáY'—g¤×©ô€@]-¥µ¹QàtЙ‚H¦N¢ˆx½ù{ê-+akxZßšÕJ—¦+[¿~m›^å.ß>&\’´‘$l‡Z†&E>>ʺ¶Ú*î$è%©ºÆÒ.L?×ö5ÔúlUÏT;Ÿgß{sÚv©šmÇ$CÐ…¢š;ôò#‘¼ÎŠ¢Ê§Æ­4ñ+9¦ŒJ ›¸à 6pö2ŸÓ[U¸Ï»Â-&,ƒò¸ÔRBÓ-lÄQÚol9«°Ð‘e߀ãr>ÊUß—ú_e@;]õ?§QBj,›ìg…ê(MIMƒtIw|XÃqiß–„‰÷®ê6^ÿšàâgΘŠýj³0miba¦ÕW*;¨.5çU»tQ¹î[ÞCä.ß¶nÛösÍqÑ@qáIXcYK(y"–óy¿¥HΧ•ëAIfô®Dêw,AŸ´âàË“¹d<“㳕ÓÅ*lWÌtÜðñ0*LÁ…ÔÔÇ›†N.Nd“ââŒHP, nT Ç÷ˆ&†¼‹‘œëí]ƒ[T޲2áš(£ÅH#³/Í3-­¾…N†·.)F)E'‹íïeºŠ„`ÑìBÄß™©b([ùœßÊѤt>¤e5q,¨òÛŸšü¸Z­» ëÿ[Ѧ¹K"Úî{Ï ©Æ‘ÃKZì¬Wåã{߇³TÙ^’TRtöž‹9vUÔïó0RXßÚyšmµ‹l—’=ówpóâO“ ‰aBH|ˆºTyWÙF±7¹+×Zm94©–ˆÔ;qî;F^Äø¸xâ!›*Mü%>qbZ´yGÒy|›’P½°KæÅ–ÃÄid”ÁVRY(feAfäÃV¬ú-¨î(£‰tÆ4¯;qý5%#º™¿ù·œ€x¢ßûº-äa<Æ‹j¿UÊœLsÎ$?º(H“íØMÎ?º(( ûVÜo|uû/PM$ض¶ÿßjòvÖÖߨGÛJ“A´­·žE‡ä¨©4IÚx|tÈÃì¨ÚqÜÝ“…°`ÍŠìss…˜ÚÀ¥´úh™W›}Nj9FG֦̓b*⥋±òòŸºvä‘CL¼J媲Qyõ²û—wîÊÚööÈÆ0¢™‘'˜â:šÆáó_võÔá%Nâ'yô˺gÏhöݪDÚ£±Ä‹+'™ (2ÜÞõVÎ[ý&þÿåA¨iY/¼NH;ÎK$—žn?ûˆÕ\JeåË?Œ‡‰è¿vp¾VŸö“þ(h¿Ç¯öÇÅý±ú#¿1ümË1âQ$¿EIuþ9{YGâמAý‚•&±è4 SkoüŶVmR¶âÿòéð¬%™¼r¨$(€(€(€(€(€(€(€(€(€( vï$'~ËC"^Ÿ”°øjy^º!‘„ó£½öFϵíY[‚î„+Œ†BÅŇìÛQø^¯Ô¬ Rñ³7Y6ÙóVV;ãÙ›GÚ Ó}\µ)ù‡ç«Ô£G{V~û¸JÑcgjmi‘öø K¿½Óå|iG¼[ý4eïXþl$²ÖþõE Ü$ÙΟÄÙÉž‡ÿó¥áß3ã#«´d-¸›quC‹-¹9r ßh^Œ‘t8”ZÚÕE*Æùr`ÀtË*©<"¬@®ÔøÏŸÕ¬àðãFÉF™Ž-|+šY›G!J‚B€(€(€(€(€(€(€(€(€(€(€î]¶}ÏaÎÁÇ`™ÄD.y  ·ýáV‹£!¢Û=§º´YqnÛZãÃ>¶‘ ±´ŒíkxÝ—EÅùyŸeY²»Im«³âÛòä’,5Dm6³ƒÈ[ÄÔ¦»J¸²F\9Õ¡{V¾ëÖ›‘]¬nñL¤ë‰ÕyÜ«ÑSR("eˆp,÷ð fCâ ܹ2ãl¹’CEùK"£0öp5VZ(¥m˜y›÷lnpÃ&¨&Õˆovº1W*O›IÚ…*Ðó²{wxÛ÷Hþ©X,r Üø C•BFÏŠoŸÞk9æ^9 ÕKPPPPPPPPPPPPPº•O‰Šæï niAûÅNæEÏpíý£?\IñÐE2é}!·¸ŠìmD~ÇØû>Ëɉ&C¶AYeug r 8 ‡"XìvÎÞ³•åW$fHøŠýÄm$á‰bŒF¤/Ÿž&õVêJT;                                                                                                                       ?ÿÙntp-4.2.6p5/html/pic/alice23.gif0000644000175000017500000001711110017034535015240 0ustar peterpeterGIF89ax´Õ±±±xvtþþþøþþ——ïïGFFX[Ç m¨Œ\™™™›œ÷fU4õbbËËË000bI<œ®ŒŒ‰ÎÎÊ»¦dad04”sJ6 §äHàvyÒw99©C”/Ö˰÷÷s±ò1J9¡[[\¬’ÿÿïïÄÄya@1½½½Æµ¥å㔽”kÎkŸŸn­Ó$ssÖÎÎÿÿÿÿ!ù?,x´ÿÀŸpH,ȤòÈ98Ÿ“Fãy˜–جvËíjåP¹œ„´1©yßðx<ନ3gÚ|îŸÇr‚ƒ„?N7fŠNx~$…”•ZMN 7$ˆ S –¤¥DUˆT ¬|±W¦·…5T4ª$ $ g } ’.¸Ë‚O.Og7ÒyÀÀgNÌÝ]5˜t«fc4Òzj¾g’¶ÞóJMm.¬SìÀøL!“¡Â˜ô"OŸÃ})pp%‰‰x‘Ià7… ‡Ô˜Àá¡I(¤`Z%eÌDÄI²F 'sJx ,ÿ_NFÑù @Μ(dI|¬‰Ð¡ +=šÓZ/‘@•¸|TOº¡•„†d]½r6¬Ã†èÈ1C#ei½1xé‚C[·úðrB‚ÆÜIy»z¦/̧̘‹Ê ‰™T•A˜'0€e€A“{Ô,ÆËŒk1œœub+YL9ÄêX/ëRå^ ØéDÂW“ÐÈLH𩣤§¿+íåìP•‹¿žhXD€Mò¢ ~À‚‡ÓÁçd:aÓ¡ÅW >îüdªL…ùºÑñ@ ù…|Æ€=Íð´ÓW"àVHVC n1ÐÉrZU”o ÊAÿÞLX t“°r‚ 0Ø!Ó=Sv9ÅxÀŠÂ ã @÷bÓ±ñ’3HU'I“‰ŽPü‡‰ˆ… € ‚eã„\E…“GããM¸ô4ê#Å6#Æk ‚* A€ ÄÿlD;š°Î§…‘¬n-ŽÃÎ:¦±øÌ}ÜHcÂÊ "ZýYÙɲ‡Äµ¹$JüYÅ4$aŒ>¸Ë#oˆ ëÆñ5!Ćt« !36 éù9B¸ ð蔉pmÚ£Ý ô‡¯@ìC#Ò€ @xÁ xà(ÂsÀÀo:ÔÚÆXôì)6LGËÒVÉ]µã èÖD2%ŒMÞË¡éˆ ·›Ò¨OhDØÌ8æ³Òñlc?øLÀ< “0H‘ZØ»I(2¼DŽ’U*ŒÁ%_ £ üx “ÐÎèõèNá™ K·¼.úF–5„I’9„<=ÁÓåµ:¡¨Y’E;ÿp\Õj ¿Rba$døH° `È[çLùñŸô™tBhÞõ¶™Ëÿ1í ’Ò,Ÿ€8ƒ‚fªÀÞ(:1Úð¦XA±P’‡@é ÓZ¨v½ÿqÓÍ+’8°€i=Ah³ùÆ8ÂÕ£@@"Â!t€®,4ä!°XÂRš¶”J­þã°ã5ÁEOHÚ„DYÃ"!„Ë4t¦S‹,àê$5Têõ ¯¦ZKm’EDNì!›œâe:šýë^I‚@¸ opi†Ðµ™d¶'¡fÿXæÚjé*mÊÚ”CÀ`šÓ@ªRäÝ“éÙ<Ræ ³ ™d«Zÿ2£‡Dn®MaªY!³eº`Okš¨FÂÖ¹2Þe@ 0°§þÆáUrqf)(ø ƒ>0ÁÿÀÔwåÄöéʳ§Àj z9b£7¿êm«XÈð_œ +4áyiª{]¶ªï>DOŸá 4Æ[<Òèí¿¬£!h?[š¼ÅaÇç­ñ­` =¦±ñ¹$ÜFdj€¿´AR Bô¦dnÑ<’²‡-tßðÆ¡±ëV¦˜àÍp~s|à`8}r}Q¬ÅûF¯:~+˜|9‰³4„`FÚ„æ­*<‰I,µž¸)r{÷«pvbˆª ëq kŠ0°u©=ÎêXm2ŸñÂ!øºa½µE"û„Oè9ªZ¤‘˜ 7‘§y thÈ®èZ¥K™«Ú'³*Ѐµ0k¤„`k¨ÿ×ѱÔJ{•ŸÙÚ]…?bôáµ` P™Èe÷§ 2ú§Æ*?y³„ FôbëT è?Nù¦)Iàý¹*6·O‹ÂùŒ}× FG¸¦8rW*³z;œg7„៱G;×2Ÿu*˜u7öü  Ÿ!+W¥ :áruu›u晘7™sÙ Kt­˜–㙵¬(‡ Uð)c×r—c 6¥µaal ‚’XÛš©ë3·ß8uzû“.ê}¦Û}e”!'º€š¬@¨Áʹ¤—ýìG”œjh-±t½VàY1rn:)2wF8¾™«Ç Š¥Þ'|ÿùq£‹vh—¾„ІÐZÅVMå)w™„п~åj˜5Ih“»½ˆ`‰‘!¾¿K®Þ÷“Ëž ÷““¹}<|A„‰È›Fg’dúXiƒ¿¸¤V»2`J÷3Mê HÂsy¢HX—ts[,  H³2+r wà šµ!—ˆåI„ÊŠàF¥0Ò‹¿ óC€TDsŽð+¡!ÅEáNðpu ãÉ²É ¨>hž$'ÁXÚŠ7zº 7IÕ’‚µäZŒ¼6óÆ\$ éÄæ¶7XR1d`©‰9)€4«‘7L¡¢;ºX‹†%9Áø®5~Oɬµ2oùưÿ¯òŸ­ùÄôåT—ˇ@ ) ªª8h¹›ûÅ£k®%‰†È¬wü€»²ªDl—‹³nIÉrkQ곯".³#T‡Þúp¡L€•I¥ rËtŒÃ_,üÌÔœT ¸×c”€ËÓT]Ër%ú ä¼ÄÉ”˜ ë€äZñê"þ.÷ö@²BŽ‹ ÀŒTM«pu+Êß—µÇ{¬¥Ñ¥j€÷|¡ùÌ\Œ0  ܬS ”Œ“«kSSKœ>²Y· 0F§Î4Ìž2ýÒ‚ÕKyˆF<‹'u2,Ã4ù8?gáÏ÷c*5‰^Öñÿ3‡F}p‰i§.JvÃ:t€ ÓR¸?¼4¬KcËÅ0P”° ÀÍ$+b 隈à´`Ös«HM®8+ˆ…¼›%g€{;×ëάèw×üXT`B€™UЀýjD2¢vÅÂ3Õ»Špeùw×jtÁêÒtr—%ù‘lÕOÐÆny  0FSCŠ®¹û†0h­ÚÓbªE®e‡yq9ˆ]ìƒÜçÚDhÛ2°µ|äÂÏ!雾m”,}à=Âämj¶,æ’ÜÌvÛéܪÀ!Ù×è˜ÈÆzë¨T,Þ/œ[ýùh S Üÿ¸«‹TÐ{A,^w_txi=-øýSTÀÿIníŠÙ®rÄ·*E™žG¹OÂ2 ² >¸:Þõ9/ Ñ-¢Á!Ø™Ð0gÒ*’÷m?ÅáÝYI À<À–L¡F<+1°"p¾×àxúw7))û'F` <®álIžß@þû´–ú­–å<°ä*.’,0"ÉÏ"©g±D„A4~@#àðÆÊÀWnWÐP,Œé¸bžáª%@ä?ÞäxÎ䊞*^£Ð ]€ÈÐ-q£ è¦î{Ê`Qèˆ^»Ç˜—Š¢©ÝãÙ„"Ž™t>éÿwÞÛ˜žél,P² K„ »q‚Q#肾€å×§ ¤Xä`¹˜–x ÒÎí ¤@/£% ù›:-äN®žj9çBã3 Ã^@ÛÑìÐ `ꦾ `\Ý̦›üw‰Kv¢èìÜ.ÁÍyLÎækéÙç®éç ì Ž á¤ÁN75°&4@ï@ç³>–\˜vw_{ÁǪ=Ðð (à Þ0_îæîn)ä,°îâ“/R,¤^@ÁÞ-¦DóÎì'0&?aŽ.)`i§G3Ð0'0U ÇàD3ñ9Nˆ²ÿñrÄ;Ó ¼Ã€îìw‚ïa õQÑ>-3gæZúë0 è …| > Pñ}`±DûAøÝ±„ É.è#‡¾Ç—5„És¯,œ¬~}QO_· Œ4@}ï_#€ aÛ!`°PøÚ®; › 1ú/ù×p±µ òÎsuX ¦ñ±þÒÊßX?ï¦>" À¢çzþú…´oý®/$pÊ®ñÀ±X@éÓ•ÿå<ªu!ñ·d{˜]ƒ''ðTOõôù¨_öZ„ÃðÀ!‘Ç›¦AJÐH›‘ƒZ¥v:ÿ›ÜÛõ~¹Imâ:bq=äg³Gål^( ÅP«1\~&h:¬6ª­Ú2n2š*76°NNÀ±Á\08ÀÕXW_A8øÐ@l÷ú|I'°h‹-Û³0¢QÓ 8$$̶Р€3ó¸çF3Pa˜õ`>ïñªçË…`üÄaß+þ9Ò4$@óü@€› ?µ‹[©‰ifµºun ‡xnññÿØî4€7% üƒ>«¶ €¡+['²¨'cÜq(NÕš¾C,.(Ãë@…¶øñ‡äÉz¼¸šÒéM#Y‡G1{æKLµð‰•1ìÜFvОcD‹ÇOh粩Xð@eˆ;&¸e6¬j˜î?@Ü"#.¼"„ ª„ûkš¶Já»N+N¼ŸêzŽpÖb qÊxC‹ÿð ð Ù¾ï³éFš`>ÓÑ-ž¼2ýUôòf+掛%ÿòm?²èÙ†È7 ÉÁ5îðnåŒÂà´šŠ0倕èÙÍú¤ÔpˆoÒðKÅÛÜ:ã>[¬I'múE£ª´SÓ Ö C•,Tl;1tœ³3Ää¶3Éšs"ß@ò¶X´"D%ÅîÃÄ0̸G•ûcÛÃ&$÷jŠƒš¤…—](%žq,b1`Yo @‚Níú7{¨rÛØ å!Õ t<tA"5 ¹N ¦Bªµž¤X‰®•„@Èe7?ˆõô£¯~ˆO/‡8MGãháè:4ÿZLWC1ƒÊd×<å›W©ºÉÛµü<@·yÎøÜø¾âÞvÂÏ'ã\TE¢¾@Ðw 9´|uN5(â:‰Æ,c;¶ÖõŒ_"T±é:$>7:v1.–Ä]\Ö¯E&¢‚ T *zÔà%œ3ü£ŽP"»Ê3¡4Äo–^sFƒÓžÝ%1NÕÀéJú[ivÀ-5_ÐK”.æyç¬FR®Å§9°‰Œ¾sžåk°3þy›ªxòëÒ¦¹=P.Åy²Z‹>Î42…CÅ~¹•)"8 ƒœk“ð°»ø£¨ø¤g† 4ä@ËJ¡ wRrgSÜâyÄx_£÷4jXÓÿO/ü¦“H©}§R´Sc‚£/¢Ã/=výežº]˪'ë£t•Åùzœ%¾-yåS²xÊ€QI7ZÌ)ð Ø‹Hz-^¼Ð+Íú0ˆ‹}B¾x‰PV¼ˆ•a}x¢›<|ч†Ä+m𘖄”†•­èX‹IÉ÷°Q@~] ¢)x;-Fw¸S 0~¯ ´;2 S¨.-òÅšèV/‰©(…úá¡OÈ77øBz¸ƒE "°c £)ÄÂ2 BªGn&ˆ5¨ˆÏñÂvu5\GKP¼ÅÔèD\èP‰{Ê œ#ò‹º+‰¤€ôE%ù1ÿã'j ¯!(p…Ðæ¸!*ƒã‚ºNaÅzEP«aÏpB Ô`XΡÓBR‚-…ì´{Š×Tv…GA’^ F"|ñ&kb¹!šÒ½Òz¨"%eÉlüáiã¹r8Ô½ÆS&á¢3À…|ãhqˆÃÑ`i¥SŠf‚ðÊrÆÅ5ÀKJ“X“G†\s! ±g2x‹Ýô,ƒ¯R`œÚ@¡ ÀK¡g»T„<°åSûl×Ìü¢ÉóIì. ]ßNNÇP‡v \~QÍQ±ãÕ1…B‘ Â"ø‡“fC}©Q§.£–è¼%!RÒe²Ò©$^®ÏKœ*Žfÿ¼¢˜#~Až‹œ#±rèŸ`¤ÂW ùC;ESskï4<áB¥ˆp×RP =PBY? ‹)î(Ä,\´–Ò|th‹„bYÛ@~i³%nF¡˜8 Å@Z±I‡,H³b¦"»ë )º¾»Mq!YŒÚJ!fÆfôŬFªÚ@?8¾Øø–(hr^5ÍhOT+,Z` S9Á€n’";p<à"$SG!¼;a7É`£x^jgÀš‹Ìá)(ñˆalHZ%î›x@àâïøNPQy<á ;ntp-4.2.6p5/html/pic/offset1211.gif0000644000175000017500000006162511307651605015630 0ustar peterpeterGIF89aàh÷ÿÿÿþþþüüüúúúøøøöööõõõòòòðððïïïìììêêêèèèæææäääãããáááÞÞÞÝÝÝÚÚÚØØØ×××ÔÔÔÓÓÓÐÐÐÏÏÏÌÌÌÊÊÊÉÉÉÆÆÆÅÅÅÂÂÂÀÀÀ¿¿¿½½½»»»¹¹¹¶¶¶´´´³³³±±±®®®­­­ªªª¨¨¨§§§¥¥¥¢¢¢   ŸŸŸššš™™™–––”””’’’ŒŒŒ‹‹‹‰‰‰‡‡‡„„„‚‚‚€€€|||zzzxxxvvvtttrrrpppooolllkkkhhhfffeeebbb```___\\\[[[YYYWWWTTTRRRQQQNNNMMMKKKIIIFFFDDDBBBAAA>>><<<:::999777444222111///,,,***((('''$$$"""!!! ÿÿÿ!ù‚,àhÿH° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“*]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯`ÊK¶¬Ù³hÓª]˶­Û·A 4 €p¸xóêe8aŒ2öð²·°a½^˜ ¸ÒÅ bKžœ‚›Œ¹;PÁ,_(‹ vƒš Œq@ð “d:sØ@»¶íÛ¸sëÞÍ»·oÚ~ N¼øm Æ“+_^;8óçÐyk@½ºujšF­šµÀfœÿ(3ð…Š Ò«_Ͼ½û÷ðãË—ï¡’ óóëßÏÿ½çõ'à€®B!¨à‚óu0ƒ 0(á„êy°ƒ4]°Æ 0)Ça¸ñ‡±¢Sà•<5À<…T*ÒD@+ÀBd‚ % ñÆ)®ØT‹/ÆèÔŒ5:uãS9ÒôBgìáB $.ANØJÓ¹`”:”[ïCôÚTðÀ Ý;Ðêî‹ï®ûC.4Œ°CÓ”ñÅ),Ã6)°D;ègÇkŠªË,Gäq ×´€¶hPPW@fÌ m,“Ð@0sÍ41ÀBܰsÏøÐ‹L4LWÇ|´ÅV½’Ò|01A< ăÉ 'A&˜ÀqÖ.ÁÍñÖ¡ðÂK`‹ý´@+TÿPY¤‚ÔËÍ’á—@Xk\›ÞKëMvÏa»Me˜¼‚oì«çE3´A!-MÐÕRÞ«@ÙT DA t!Û”#Œ¸J»×;zé\S„w,å­Ã; ;W¸€V8=êÎÃÛ;J׃û;AXHPP-ØY|ä:xм@T1ÞÁÉDÁNZ :³÷‡žÐöaù@ ’KŒÇ!´Êgñ À 8@ 耮›¥t—?•0€š*€.%UPáŸ@ʰ2‚\ \Ij6p Kó™‹ñùŒ/¨jp) ÖDuhÃÿn7\u Ý@Ø Pâ@HX PÀT “:€ƒÔ€p?«aiðì„4Aá>x3°Ðc È ÖP¼ˆÙã2€<Ž TüR`ÀÆŒÀuLšÀ B@BÊp bÈj`XÕ 1´M(À†`cÐW&0©3ðуLtˆZüqŠ%°3šÄ¬H"9d'Œ6œd2iƒÌP“3ÙNjVSø  ‚c@¥!F8B+W „ ((È,;p” @ ’t‘"C0 Àà‘ùÀ5( ¹õÀÕÿ€ lh{‰2»S, ¤R`B-\²0€há“^ ¢,i ”d }Ú%H@ÎIà˜BÒ€! j–E̶0`u '= J}u „+SoÅ‚‘Ù  ÐÌà…ˆ³¦V@‰Zà¤DÖ€p2‚"pÌÐ` Öd Ô…Р>¤É€P!€!m˜aA$°0a‰×L l@€£&• X@Sp»I4È]I, ‚-=r’ˆQ "àÀtà=8 “40ÁYzÀ†àêD@9ÈAM# Üê0‡,¨N´¥JA à×ÿLa ¸‚ ÕÃ&%ØÀÈ|fŸ]5FÆEó؉Iè! !“&Ií“A"€0Àš¨Ì«BP ‚ Щ °‚ $qà­¾U,I4°€xH‚lŒ(P„ 0W]T.]„•ö ø@Z‰ÛN¡)xÁ à€'à í ªp—@à·€×Bß ,í:›À "Û¡%ˆ€p)ëf€fEhn‹{ÝG)`¯AT°¤À ˆ@z _`Þk ߈8@ Sˆ™|À€è,R¸€“6À|žñ ‚'§äï±`ÿHxCëК° °›J2©”;ãÀU0€l‚ @I‚¿X0å*Czkkˆ™XP|™ pRˆ0¬3 ”š’ V–£’aås~IƒCr‚| ·S@R} `¯Tè¦ L ‚' 5`!£©lPAÀ1“jÐdEÓN¢@:€ápÚ”<€Ï¥ ÎF1‚'‡øB–âÀ2… ÁRçl M@R\PÜa;ú!sb¦X`~‹À:i.Ð8!ðð«)`b9ФU¨@<¬•[&çþ@ž8•¸áã7ÿ±µ  ƒdëG`’:0‚n7Ú"õÔq²ë7·Ù2 @~%ˆ·ê È@¬lÀ€è弊éTr˜”` 0ðÉ¥Ò€7°Ï pÀbàòàN@’ H ƒ¬`(­b^¨QÒõ{A8ôÄÊèÕ.c¬|ùmñDÝ*aШÇR'uëQaÀ‚ž”7  4pùÄžPŸ@&ˆ€ 0ƒ&ŠLrÚ»üÔÈw„ž7¨äô@€‚§¾*ŒÉªAÒø˜!§MYÀ“‚ƒ»¸3D°<01"„Ái'h§P@ú,F„I?X·A Ð¥õÙ€ÿ؃ôHr6À Ô±R†pÞ…ÖOÉî?Òx„¡ê=a@v‹ŽÀ5’5 y`e}$0$~PzAÃBíCbõ£¡‚q pRB0bAQ,*ÐÜ(ßO#F¦Aæ’3¤…¸LJñ¸(bð?5v¨1ŒcN!Aà0ÉÿøŽ'!A‰=¡áCÀ8P+8À=%%Žc&¨Õ’cóÈF’šR,'y)9LЕÀ_ Œ·'9O!@à° `hÌÈ'ÀbÐlÈBéÀpH"FÀ"0;%$ÐlRf‚–ò—€86p^ù/& |c))0‰â¦‡ @rl9“@`Æ|¹ŒF¡5 fЗ;a™×`… `‹#ÑdE†ŽÉ²€Ogw¡@›L86y–%–±Ê90‰¨& Ð=tšL¡ÙÿBsô,x—+aB`k`A™” ‘tк)ŸácÀ!"‘>§QÂ[ tqò.à$ü©+0Ñ4èóoðÙ1ÀçaÀŸÝ—•q0 6Ç 6à ,ÐŽu8ê™+pJ‘&€‘¦I°nŸiCðw¶9Ÿt:@ø©&×¢VPR?`M`°„ -Z i^S‘s*0P:—'> ðCP-Ô–ž5AyP}@dàh€ÖÕO oÀ£$@Dÿ@!AªU9;`¤!Ñu_‡?º7BÀ9A¢,`.™†¥"BÑ¥ZYP+à2@Zúy¦q!Š¢PÑi1ðSða ™a«Á“Qj &(-Qq@p`ð‰Z7.€ >41O0nɦ1P©Gš˜ºù²¤=ƒ¯Ä%J Q*bfªV0« 2psâ¥1.ðµw‹‘Ïc¦ «/àžKÁr€àPP_®Q,Q2ɪ¤¡!â!Jâ2¥‹ƒ­?àX CÐ À±2ÿáb€¬û0€®—êu1u¯Ó3,`­qM Q‹j‘& i=®¡lÀ!ªš7°B@qgQ« ‹!(PNA±Wð2ÐFÀ[ P$©#²1PÌT ÞEðJà,„>Q€3[³5¶jÓ€=k© A±¶„X £ÊÓ3"À¦a¡•4R¨´’–¬qµ1K)p!¶ Qv±°9P!yX`/€D É*h@· QX,°B@®1·NHu0¸`fpR+Ò+&M3¡6 °¦ÿ ?P¤R{ šZÀ’”=33@ÿã4P¡‹!`ƒ¸†ºrüÚ®». »´û Ð^@/J » M O°Uд q À ê˜Ð­¢ŸUóp€žG àˆîs)ð^p(3Cp9²v„ÑF?»*è»V0pŠ^’M0g¹'¹X4€Ðé ¾E,™ ¡:°0Ú§ ¬ÈcL˜ñÀNQl°õ„_0…WàU€Ç:y‹v[] •~S| Àÿ_0Ãâã]P´9¼Ã2ÁðÃëºD>pÄÑMŸ”ÄÑ6kx6C›*U`–70\“#ŠÈ‹ÐƘ‘C›K@5W °f̰L¸ L*à©N‘f° °À»Vgw|@{Lˆ}L$¢'!€NKg o°¥;À @ÃÉE»7à›2Q0r™´ qÐ>€8àÉ!k ¢Œ4Y®sÇ\…@`–%Ð Ëå6;Àà7(°¡4Pg |ÈóDÀFƒÌM‘gÀ ÐÑ,WÀ+ÿI#)ÊšPÖä}=Z@­:ç,6É` >¿2a @Ï™Œõ†;p(ÁùY}KÉ€àÇT7·çÆ…ÑM \À@"uí´RB¬@¾L#-wP)€ÒL‘e° p;° Ü^ a@^N!k;0Áö&@d UÐW¡%¡!4 uõœ©Ž1p? V¤o°°ÕÑLð‘¦$ÐcM€ž °ªÖ+(k©¦7: –3×{Í£Ì |À( ØK±\¼aÿp@Ð1 ‹ ±z^`V0 ¡Øl9 ˜ lÙU€¡í1Ibp]ðDO} ÙÖ°=Ñ¡PÛ[l ÷â3@àÛ¯ " •ÖaQ^Óïd<ô Ñ”LÛIÝ@PÚ­Üí4e?,0¡50l'S©üÞEáF°SÐQT$FV0S Ú$qšf [ðD`ÏQà0#p± pP¶]`6¹KÀ>¿­*à„Æ}9W€…Ø©&ðD4×ÎÝ}í-þâQ|AÁÝ.â›fÿP Áp `0U°ãM×-c,  @ ÷& O Nþä.qšd@U®au"…uÀ&!àŒ ú·à3 WdÜÕö&=•½á+øR`Š7²_pwzå1ÒCPÒDt !¼8¡V0,e @t Ð)ÐÀ>q.I:°å2%íGâ±çÑÖ$`$Þ $ á@‘0ð8]0%ÿÀ’ ar6`âŽ>à+ 0N¸™Eáµ0p+ðT@6pT Ô+qšHÐ'—¯ýEap.þœ`4PºÞ3?À!Ï–(zÑÑ+h^+€ã_Bs=Ò>bÓC0m+­ !´:1F ¶X%0?|†ÀgÀ8?î?Q Ç•ôª1`ôq ®$V°8,Á–³Âp áUߤ/ÂYI°HÀ_`F`eïðQ6îø:TP3àö,Â>FKÆ9'4×=XbãE >Óº]@ç=±WÿPøä&åópöT°EðO0çUàí‘Óܲù¿q€R0a`F $XÐàA„?ü(ÀÇ’8 d°#±ƒ—‚Ttø±cD€K$$Yr ¡ùPÒeƒ®À1!@*´äpIÒDЉ’Œ8Á†‚"7€ÈÄ„À32ìY•äBE~ä˜1¦çVÅŽ»Á‹'Fdàñ@ÇX^¨(9ÒÊ^JL‘`•…D²»üà€WVÌa’fÆ+_O¸pà€;ð@ˆ@Qb(jyðáÈER>8¡Æ +[Nf‚Âÿš6#X †ªà>‚%È6¢– ¬ UªAˬ{b-Âc…1=»‘Þ½g†;Ò®í±àˆXPˆ@ARåˆ$yKxyZµ°wüö%>Â…EŸ#Ä 2Éò+:¸A>4€â‚Š [‚ʃ! Aµä¼›`Løƒ%Ê®€r»i¦.Œ˜Ì² 8‚‚!*c¨ƒZ.p!n0!êxA¯\ª¢‰!›œñ | À ±@Æ$¨Àb‰&¼€¡ ,ô 0'Ó  °ÃšØ‚:œƒ/¼ CÍ„ à`ªp  †"üÀ@‹ êØ¯¶ Gàÿè ¦X-?× aÄÙó"…Rl.ª’PâE†b4Â3( À2 \ˆ„ âô >ÂóÔ|¨5‚3’,ɉ,fõ.(ê … úa«X£*¶`b "¶àa‹ØK?_›, ƒ<”(¢9 c.´8#Û‚HœL (Hñ†0l턃Ñ#(Àc¶è8È ­]}® g y! øãd’øáS¥&ë0R"«lÆá,Š@â‡1zh‚‰)hîé>ÍYÛÖŽ3® á &²X¡!¢–zƒ2D.€!tXb=.H°¡‰ÔÊÞáÖ¨íî\‹àˆ2Ô¨T°$š EÒX ‚;ØbQ)°(‹'ê»q‚:f¡kFÔ@ E0 Ê$DA,°;à`fWÿ» A+(°Ò ¹ ˜Ax˜Ð;X`3BØŒà‚ЈA G aÀk`A¦¤ó7# êˆ_d°tñGA_f5€!ìàŒ¸ÿˆñ=¡@ZUæTe~è ¾`‚ à Fh!Ï´MÁ$R g`‚¤ H2ç’ZÞ‚dR`'/ <'øjÐ ¡ 8d ËTá ´ †0^(*Àe` =H9€‚dâÏ‹‹#H8gõ"¬ ):°æu:Â!(‚¬ÀI¶ž0` ;ÁH 5(0áYU(¤P)PA \ØW „pÉ”…TˆAßvp(,€ h‚žð‚|3hHt04®•”± Ú†ï‘%Rx¢* á$'X¤ð;¾tÿ ‹)Çh:›âÉx*ØiOIÂFtΪ !ªQkŠÔ—ˆA ƒM& A¨êhß )Œa b †ˆUj( ú†„-ôÊ"¨À,Ì5 `t0ƒ  ‰Û+ÄlÀÀN&SÈ€R´%Ü`Br%JàØ sG¥tQ ‚º"„¸-[-Р’ÿ•„;àÀúl{Ò$³%i€ì×"¡ vÚÐài4ÁS,^¹ÂàV·ã 6…àj3ÀÁqÅ€‘åö`«4¨^@ƒ˜t9p v×o ù€8˜T¡aÿXßÐ\2VTŽÅ€ ”Ó(ˆ€eÒÀl€ þ ÀŽU ØÀ—6ˆTp£¶$È tâÚ!ô M¨ðë G#´áuPUC’°® «¹BdðçàÂ%Úh@& c‚.I ,ˆá1ø@.0è $ˆs#9„·' pfýf!8 `ÁCÛÛX*8€Ió¥É.ðFÅ!ÄÕø¡ÀP3»!Fa@ŠØ\bŸÖ*°B , … ààC‚ªð? Ul €aÆ@L` eC¢ (T c@L࣠lAs–ÿB„+$ÅŸµ ÊÐR n€âvСe“Å2 XÛœ'ÙYxX ¾À%°—¯îÍotP `9%È€mkewHMøA  }f’L@H?›hV!dÁ$á¶ & ØBø@ÛwÂSjÍÆà#(@ xCÅÖä£ <ÁN¸‚ ¶Lt1 ¨º€A [¸ ¬ ¸AÈåÄ)  Ü ÑÄÓ¹tV}ð7|!!ˆ  “8,)ƒ¸À“_O™7'H@Ì "!ØÜËÉ8~Tð–h›$E3c3ý”‰Y93Ý 7PؤÿÀ‚!¤à`I)‰@Lüù€àz ðõ‚4 ì¡AZ°ƒ+ á4$x;~U&“ ÌÀ Y¨‚`-Ü< C ¼ÂÀf,xòÅÁî숑¯ åâ„x€™îH¯0t²x/Þð À™  ³›©ƒ€!€·lù˜Ø º‚‘8ºÑRᩬ8³Š ‚à¶@àK.(‚$p‰ ˜x!­k>¯»>³»7(x ‚ù¢Yq€/–3È @‘!Os hØ€\b7h(h€4¸@ü ¢FÙ?É;ÿˆ+pÿ˜ ËH±jƪ   ˜À ¨ÅˆP£‚P€% 𯉯+ˆÅй=8ZBsD©Š`ˆW©;˜‡ÉºmZ71º€w‹¾éˆ{“û*‚$¼,ÊÐ?þë‰5 €.Ðà €)9ì”Où5;l9<\‹è ¸‚?,3 Ã9•i¨êj M±‰È%«RNC„h¦ ¨r à â³°mb‚7¨8(D ` ÆR<ÅT$š06à‚hº`€Ѐ0ØEÿ~153(‚'XaT41Æ44ˆd䂨6‚ˆF꣮ ¸Ã…™$¨µËøF ÇÄa à‚¢SÄ;‚ÄÑŠFw< ¸¹’°™€"# ˆ|L7¡*€ è‚   B@€"1‰,ƒGtq(¨Öò"X`—™s`xÈ. 0ƒ&Р.¸£(CÖˆÈÉ‚Hƃ¡¬ˆÆàÊ•Ë;,ƒ` 0ˆ<=&0ÄÄI:¼#ˆÅ" ¾¢¤4ILJqÒî ˆ#  Ð XM}¼6„( 0˜!Ëli,0 P‚ÿ/1À`ˆ `€ê@4ˆ¿ð‚-à+貿$ÆÉh4ì?Œº±›”ÌŽ,‚˜jä‘âÓŠ7Ñ(ˆË °6tiˆ¼Ìœ¢HHpƒŸ„'£DÁ6SJ’X@è›hM Ø HÀ’LÚ$ˆÂ°ØBïCß|/!Ô៴XÎæ|N!€*.€# I ZLî$ˆ&¨ô!ˆx˜ è>òlIkü3X‚ é‰öýÑL cÂn\¬ Hƒõœ•u‰ÿ #„@Íž PUP%‰}PTÑH@-%Ä“ ¨ÿ,HÐ+ˆ*‚Ÿd®·è€è!‚$p*¸‚™È¬0  «ØÎžØ€1˜ "°• ¢ôË(ÏS1F©Š!-¦l)1@ÌL¼¤¿$) È%ˆ‚nt’ñDˆÿÄÒ§-ˆ.]ÐÚÓƒ¸H€Ï¼ÐlÙ€+€°P‚8 1¨Ó¶„‚¢|*ìÅÎÁÀÒ!؃ L `-(ºšxÔHíŽIåQÞ+PƒôLˆL]ÕYI¤B ¡³S‚O‘îxªDl(Ä’è€-`‹ÊW-‰øøäÒ2hI·äD[-Ø‘¢ÕC—ÿ  .è€ @‚¸M©?X¨ p‚-¨€'à‘“Xj ,X×+]ƒ2 6bPG×:4W)Y‚)€²É©©RâSR{ €@œÈ='IF„h¹ ˜ Õ‚8X¦ûƒoˆ$x‚È %Œ—¥Í@MS5A¹/3Kˆ PްSæJY(H©¼N‰Ù™­ Hƒ7° 6ú#´ÑB«C ðk&pûBˆLÌÒ¾˜€)àY§ý( €À!_±Úƒh¹ ƒ°ë|ÕžÀ:ÈF  PÅMÛk[[ÜM“(ÿ6h‰@è‚è6È‘Øô`®/ÀÛRÀÍÁ¥Y¤Lƒ8H 6ŠÊ>ã,ü˜T@ àp¨L!5ZÕxì€%ȵ‚U‚ €°2_á€0€èU‚а pÝ+-Ø«-ƒ <‚·@ßZØi- ¶M“W‚‚;Þ®è[å‚+((–[Õݱ¨^ÂU6ˆ¢x+è3øR4Nñ%_)€3LU_IÌ@¦¶È_‹ è35Ù€sñ„@˜ (ƒ¸šTŠ×-‰ Pà‚0‹ Œ@UÛ—`Uí ÿ Ö•ø©þˆ0ÀZL î Xƒ1`Ë .MM¥Æð_)Éa«ÈÔÁë `Š…ˆ8c€ÃSL¡˜‚l¹, >„˜‚O»€6H1@ZƒL¬KuÊ0¾*¶c î]UÝ è‹H0¸ø˜ß•&¸pº`êE6™µÞ6[ƒ/è´?Æ䯴aCDÞa"¯%šù´8h)¬» h ˜€"à@5±+0€!X傘(m](Èâ\ŽI„  ´ ˆ å±ãÝ-cX’ 0›à0ãçH°¨+0‚@ÿLvåaˆb&\6˜#†`‚iw%ÏBÆaNßjN-–š  B‹“ÖHÑ1 X–Ž ¸0ø5,ÐÂP@‚}ía‚!°‚»%£Ó;¶-ÞU3°‰H L°‚èÁ-¨‚±ÏéÅÁ [’Ѐ6€`€àÌ æ‘®á’>ä“.Új^:•i ²8è2èÎ! Ša¡ˆ•Î Šœ6€÷@ˆ/Ø‚P8È€#(jz>ˆ¼0dbê̦ÊV.k„0ãîÀÌ© ˜vû%°Æã ‹Ø‚èÉ‚,¸‚…uÙÀ%f á6[kÿ°™¹-ëW£‰º–æ»^#õ½ªUÿñUÛ Hbz‹û°R' ' P‚ ‚.ˆÈ6ƒ‚äfh—01Èû‰§§­¨V“€"Pâ§À4 à º…8* -`‚5hÊÎmÀ:D)è€ð¥ñ$îÀß¶ëDV߈ï!ù°À È x ±îØ®4‚V!* ‚^90885¨æ£,‰ø‚IölømaNÒ–Ž(0;û®È‘˜Pç†èKЂ%h·h³F6gð’ -°K@I9 ×8†€fÿ“Îðj>I8*Ѐ°€\Úº‘x (h€h4c *!2ÞØI‚ð‚;(ÐñõM8ƒWoVòa|e<©Î‚%@ b‚, k‚ÀôØ# ƒÄrïÀÒ-¯ /ׂp‚à†Þ®ð3?îiFiƒ Žúæ ð“Ò/¨ÌG,p«I“#PÇ (aL$˜¢š¹‚:Ø€ pb„hj0>àùl´¥ôJ'‰"g Qoc.øqè‚ôˆ'°N.àˆNˆ›Æc-_pV×.(& €Gµ‘ï­uñ¥ §fƒh½48÷_Ú-ØGY€ÿ$ÀÀ€+7§5Œè•âr¢v ˆ‚}ÉF×ö¨–lEù÷ùN“s×tÇ,vOˆpê‚ oܾèXunÒã×éY' (îž@n5/0‚vWPm¦•Zù¨ €‰O$Ø_Ã`xA‚d‚ƒà30‚èÏ‚0å’ :¸/–GõÐ~y'9w"XƒÎ0ƒ(5ˆpÚ‚òT¿w.' /7Þψ1M ßp-x\'ˆL%è Ô¢x™N ê² çü N¸€×#¨A+ðK^9€%8+€%ÿ„häž ;°{pÏ]qS"hé8÷%ƒB3 §»t–Å{éPu|ÿyãÀ15½|È|¦7x‚@€`Žꦈ‚Àh‚Àœ#¸£&àÚü°)(:×.” 0R%À•,™r@Ê*=,¬Xq‹-Ò°cbã‰GŽdÁ€$Ê”*W²4† ŒŠ&UF¸Âò&I`T<ÒFäBcR‚¸°0ËFPÎÄySÏA¹9¡Ì’~ÌpêÕâp8@ÑáF€Ràðc€Æš_ç²t1âC 0€0²ÀÜ…ªœä‘®JTÿ(IC#2ˆ42ôŠ„… dQB% JŒ,g¨j1$ݦˆW{•`§‡Œ;ª&)—µÊo(  H;xI™av€,B az·F¨ §Ve9M‘”t…®2ìØ²gÓ®mû6îAï¬YœÀûCÃ…;®¨–í Åê+BA`ÂÆd6ä·ŒQÂ@$1V1Å¡e´ W§jsÕ¶ˆÀP\C8AÛs(ÝbEºñFCA8¡BE$ÈRhðƒs!J'UVa·9°¸xd™…Ö}æVÑ;ù•<ˆ "|¸A} °…i]ÿâ ”Ѓ:@Ä5x€`e M4FHQ!I¢a¨!H¦yõᔸ)¡ÄB)”±Ð H0m´â‘.BÜðÑB”¦”żÐ#ˆ?R'dv<áC¡PŠ¥äxMÞäÖ“ ×êMLqå\À£=<¹`A,ra 3@ `@<±B9tƬA ¡'Ÿ#ù©R V¤¨S Pi â Ý¡‰.@ šêð‚¤qÙT¨¥D¤Ä œà)JY\™¡¸™¤uC`Äï&)“åÍzžEôð.K ˜qe"üŠ;€ˆe”ÿ‚ i°À RŒ‚ IÐÅÈa AÄaX¸Ò,±ái‚®Ô8Üp¸&;ÌpØ\A@±P $&lÁ ZZÄ ?\‘Yáx0©û-\Ò˰®/I[×À¸ pE~5¶wä`FWXáWðÕkÀµ(Ò´ï” ä—3ìÀíHT½’%¨„;bs£ê¥à­ê«Å,ѪQ1 ®Rç*P„ #P „ù2¤@ °Àÿâ4€Ãþfö+d5h‚˜ ÈáFB Κ ŒÀi¨‡.¥(D  Â(`À bq Ò†*Èá9ÜóX””e†’„:‘Œ6]ˆØ¨MJ¸@ØÀf>ÅDÀ|Àì€ Þ$é0®Ï„ J€A@oV ¼Á쇲H @€p©—B#˜fDò'™jãB išVÞš†Z›ž×RFiHÀ„ °@ ô©‹¢&‹P„LÁFKm„´þ,ÀlÔãô¤H£†¬@|n@z@â—.%g¦NÒ˜Rè‹Àâ§‚*ˆ°i•¢D©Z„„˜È Á:Šg™ªç‘€¬AœÁ/’ÁÀÿiŸKÀ”E0ÀnTÄ Ä€  @ìÓ=B‡@¡\1#hüf³¦ÅCbª˜ÒÖPk^ídktÐ(VŠj·’D hS8€D€Á ,Á pp€Ÿ"¨€Oþ@‡®È°@a¥€0Ž ¨€‹±èki-„¥,DÀlÁšiÍ:}P H$$¤§$>쳦hDJ À ÀÀƼlnZ„£Æ>Ç>§Çâ¬ëH„žX„ „‘8€x*nÄìÌ6-b€XÀ T@ˆ’ŒA@Á¬AÕ(ÀäÑ~ìØ~ÅŒŠmPÁœ€Ô&d ðÿ­ó™(bà§·ª(ˆDÀAtí׆í«VnE8§€Â.'ÊEíu!È­¨àáL`Áiæd«¼@ИÀØdE@È@Ì€ƒµÈ¿*ÏÅâDà D½iˆ²&仨çè^j~Öíz-ØZ¬ë.„ì>æúÞDÒ®Z.+:@|€LUAtð€Ûþà”@@H@Ä—ÄèH¬À¤àà¨ÑN/å¢ÄÁ¦ÖšëôJtoð>lQ:kÄŽï•ïꢯoZ èèÙÎVÚ:ÅùÈÅ (ï}À 4€ < @P€x•ú_«DÌØe¡¬Àë4À˜xÿž‹ «S\/I„+hÀ nî‰bí—.ù¶©ù²nÿZ„Ò@ï¥ð¨Èù@ÀAL0aÒ°˜ë0³Híâ„°Á @LÄ;Âj …D¤ 4ÀŒ&3«¥zpRjqsñ‹mËDü‚aûÆÖy€ß'›h§€@+)‹€ÀÐÁÄAsòFl2IüñF<ÀÈ€€Îò3v0Ä.2I|ë~ˆðùB2ÓÝ$‹`%«ÄùÐ ±È³ÜÀ”€¤A 3Uå£@ÏþiúZo·ˆï4€õ¤PÑæ²zn/›î/;r0·n$S/¿î 3ÿÑôÀ„Õ²Æ D„Àf5ÇÍ”l@Ø!´+£¥WÀ²V\OT4€ÀEäUª.gm˜®0{1§–ˆWå1§D2÷ˆè‚ ôÖ!v@8A@“Äß„O•PUBƒñGΚ1Ú4APé °9_í.Ck#Kë#»ó0/„ S<«°ŸG=—ôI! @€ ŒÀXŒ27IdMVe ±ðvóM0ôàE@€«ì‰î9Ãõ\ óH˜@ƾËF“ðRS,=uH£ÄHSu UÀØÀ À@TWó1‹xx‰yÝtE¸òH|@‘)h AP)øÆÿ5ó²¸5^³3G7&_˦Œþ5IŒ´L7B‡0Á°dÁb—uˆ @Õ¨ÀÜÉ\Á ’•zEXÙô@PÀÁP) „ŸÃ&rQ7ç<«G^ óH07¾všªöHŒte¶Š$°ÀÀÁK—Dz“D¤¼ç!µ]µÞqh„d‡ @ Lo…À*E÷Eg±šµ t±^g÷FI<5TïxŸPŽYÁô@¬ÁzkDL«ØÔÁÜÀêñždßâWÔ·EôŽæ€ Ì€è(8~¯\]k«FÛ@R7‰Û „3¸woăãÊ`\¹m¶_ÿøHÈ@ðÁààˆßO‰ÛBì@5 À@‹×Ò“­õ‡¯"è3ŽŸ/´ŽK93¸ã%‹`ä@L ül Êp;…¢h $ˆ0AN+ O¬¤zÄ[˜S7¥—ùÆ\úlVDô›—±ƒcŒ °€œO‰|AÌAA¯¯D†§Dê©A¼þ"0n³ ï5NÔzÑYT„ðz-9zÿ¤¤sd§C‡\Túùr€ÑøáEZ³ÿ¸FÈ œoy2Á—ý€¶¹.·ÂWïM »LXÜìú¶¯†tœeýé¼b±°‰'{§bk<|'bÌÀOû”,„ÁlQÃO‰ð@lÁÒW›ûÃÇ{ üø€l€\|÷ðÄPAUãeÇx“9ÈS9K¨†§’±É$ƨ@¨X«tž̧e¡pÀüÔ»òúä<‚Äç”4QAd ¹˜·ç© ÷°‹ãÇŸoÈÛýÈ7»³«‡lí³· A ˆ6cïÈÁ­v£³«Y³Ä_À Œ€ãMhÿ@Ü¿;O=1ßý¤5¾oÌÞG}Št€vqº›;+Ͻ H`Œo×”ˆ€ì_r¨üj01N¬[EL¸ ²¸¨ÀmáçA¬‹üÒ£mÞ£>Ôs{ŠT}maÿiwjø{«ÔÀûÜ€ˆ>L˽E¬ýBÄKJñ€˜€BÿMlÀ,D`™eÀ´AÄŒ 4xaB…5< ‰‡…²`@p! 6äødÁW,!0F¼„$h±£C—3iÖ àñ£‰ü@PC 6g‚(G˜I'bÐsÁ ‚7(&®¸“FÏ ƒ¸ÄYó†ÿÂË‹—( ¹¡IA_l” dLkz1Ä]±5‚Ä©7äÈ’V¼PÉræÒ›27žù—¢“<}¤Pe¨ã‰'Nh6¨Øs(sT,@⌘‰Ò䡺à 5JbÙKÖìL´j¿àè€â/$„¦èñí ÀK3nüÙ8BÁK P`q¸¥KÅ D÷~úÂ+(ÿ ð@ʆï9Gíy@=~úô™2y¡6(ƒÿ&²ŒÛ&*무€²¢‡~è ¤X¡ Š+Á"–«9¿£ éª»n¥ìBR¬…±@4.<…¼è <‚(FÛ3î½Ð Áÿ„î(Ú@ Ä(ˆã‚jâ^˜0!uS0€ š"ƒ|ˆÁ„¢@†DPa(™b®¯ç>QDë°KLެE@8¨ b À€2î´±3Ç:à‡ŽàoN„@¢ 8HCH"Úà  z¡ &€À̃¤ti7‚¬¢%pH¡ËD à†@νÐtŽ£¿k“DÄ´‹SEUé\“ †8ˆ ö € =Aô@Í `Óô5€E›Ø6ÌZ`ŒÜJ>ëU¡OC 5€²@B x(¡_)ÀÁ‡J˜aZ¢fõ0Q\ßܵ 9©µ©Eª8èÿ •8êɼÊ@jYÜ#w`‚Âh(º€€ÉDÈÈM`ƒÌ ݘ@" zè@yéý@È£ M%øÓßá,‡*Ö«ÅÊðt‰c»€˜BšÅ‘âŠ/ Ã3 ¤(øPã :¦0p¡“? uް"ˆÀygx jgcg/{Öõı,@{hºZDÁ ƒÚ¢S….È­¯ûqƒD¦-€&S`4'9jO½ I+v*"…&¾À©µ …"nh …§Ï´o5û%‰:7}x%-"OªEΠ<~àa'Š'ȇ˜×·óç*¹ÿ ±9Ê ¡™pˆ-PWÝW N`¢Dˆò2ª½V`×ÛÛD–rPúº>d õ¥Ú…°vp!_ Y^nT¿Ÿð#Ô#ˆõ&Bƒ\AhRÁlc( Ì#¸°¶¥o}y[Q›TÐ%¾Éo,ôC è>‰`0‚¸vð‚èd€\ao¸Ã(°$ŸûÈBÁHa8 B<ð„Q @8B( YÑN„lÂ]uR ‘ò *ôáq>ä€1@Ò @ŽÄàfÉa ÆH ®ˆ \­`D4ÇðD ሀ±@x·,R,ÿË]w×·0þ Žd À „fFPà €˜€Œ@"!@̤ÃLV¤‡;Ì£9Ò„DÁ  B°Ä’ZB ¬°€E^‘/ì;Hÿ b+ïôD“ôbüÀ˜.L¾R!‰‚( LÀh™ït`ôM€#ˆ+±9®vº73™ ž€dÁ0B8@Í9 \0&#g—L…ÁŠ1I4¥YI^ò qÈxÎ…o¶àN:€‚vàpD0Y@#zGÎRžôTB Â`ƒ¨$\xbV€…"S}ŽLˆÀ·U!Jàâ4(ƈe¢ÅqÀÿ(ÔÀåA–@J’£NĤD©Kæé„%ôà .íNHå%áÝ´‘Ê4|§ÐD™áDªC«iÔ£z$ wr@z”‚ JЀ @Ð…õª°¼êVCÒÕ&Lá  ‘Uå5„´­Í©Z ¢Ñfºo=gx‚\)@É/*%…×L¬G´3 d¡ø@0ƒ#ˆ PØD›Øƒdµ~Œ nÀ„&P! P@Toÿ9°!³IAg4¡!UUeXƒ PZ¢òήõH0¹)È`ا p¨V†·”õíoc‰ÇXêQ!`øÁšP.x?Ìõ„ÿ@00à˜i5ÈH BxË™Þ ƒ @ïÒµõ­Gž€¶,a'€Jf`Ì EˆU|ç«Ø£ ÷#VÐq¯°…6Œ¥À `<@É“. ’‰ÀÁíwÀ€*XØ´þ´cjç« @ ûôf ƒ ˜(€ €’DÀó®ô`Ì‘+XÁLˆƒØP_ Y€ÇTp€Üà¸!´ *pBƒ\ä8z) AðÂ'£\TÕ^U p€€P€ø€?h€ Pü€Ì58tBÒìÛ5?¯ÍÉ‚lÀ„2\ E ž  ÃÒl‹|4ÿ$š 8 ÛœÂ„B^ø´SÖðj%= À:8ÁÐÔ`=€j F-ù¶líLõDVmƒ#xáQèvøtP€0°ê øCªðŽ×AÁí-a«J 6àÂ-e¬RyÃ’¦Âа@ jP) Ib1¸áYÒûÒ’"Uƒ¹¿Pu?ϹY€`†$y LL¥²7kha'IÚ°½Œ@h4x}Pe…c€ÐÁ¨ €`#)ïŸûmpŸúwãVH¶Ð’Ï@Å™µTÞ‡3`b—®\)!Ìn^x€óF¡Ñÿ 7HÞ¿õ"‚°î»– € ˜éf{À¸Á¼€€t`ÐVräªs¼ãïÔzBP†< 7@/ÊÉNäA h@Œ¥+=â @v w¾pÙ!Ì‚÷) Šïsò{aš³óˆ@¦°T à‚ÒXé&´q”ß8æhg­~<$€Â´°"(a1àùŽUž( àè@¤@›ì^ø sy€ŸŒpÁ‚D}† ;h€¸@”Êlý@døŠ/Ùnèèª6À€ * *€&` `‘h t¦Ô&‹ûÂ-pè)U â’@ÿdóÂР † ÎÀ]Z@ì†&ªQNÏ €€¶.` øÃÚ¨ÒÀ,òï'.ࣂèö*à øCñ¨"ÓÂ@&‚ÏKpè@Çy¯(¬ˆ`:ÀÌ` àŽ`b Fpö¬®Å°Î;xà˜`þJ$à` ¼À Vì ¢ZÊ@ŒF6"q¨H’çôzà"@¬È¢`2vƒÞ€›Æ V`nrãÿ,À €øHDŽÀ dM W„ $ HŠ€ò~À:À? À€ €†å àí¼­»ïw` `dÊÀLbÀ6@ Reÿ àL`G ˜ æçM/|ÀmÀÀˆà"2  :ÆÄÉ”pw¤$À .à .â@`Ÿn V1ØB^Ñø(¢ ±‰ÀXn :àº@h”` àÓBqû0ÏãÖ@h` T„`~àÀL!ð« hàNP ޶"Ð y `€L0€„‚`€ô ÌBW>Å ÄÀ°`(2€†…|à X‘ ×à p": Iò•ÒXd`$A–` À®) €fî äðżBÆqHd-`Øà?,^ P ÿ5òGi°à”Ä€{~ÇŒV,€Vj ”àNH@Ó`òb©* 6àŒ  šÒ´@\2x`ªò*RU¶Òà&â$iq¾Äò‡l@@¤´àÀydP èH*Pâ†À+&¶ (!…O$!†`YÀ $Ãä B~Q>`D€Äà4$r³ Â`fv † fh@,@Øà¯–*I¬Dh˜R 0àJæoV`†À*±ò5kÄcs!  ”L #Ê6AàÔAp€" ¢ ö‰89;iÃèÒ8x "€ ÿ:Q<ô|íÙ³ Às4  X@ׇ¢ EÅ€^6 @@>€ ŠbÀÀ ¾æµ$Ƙ`2üÓT 2@^„ ò?Z‘´ ]¢ BkÓ20`áÀÈC¸àº€"N`c bE.=îy¨` L I«åN>pÀä@ö6Ï,/]v2À H`8#çSÈ vàt :2 ÉXÀ  –HúŒÅ„ 7½¥)/Àfà0@DàÓ˜à¾4+¿6kbCK BßÉ6À B°ŠcÚ€x€6€|­ r ,öTóHt=€ ÿÔ€ .œ(R@ Ê@l/ž¢xàXé'ÿ$õyt¢ fH[`N``^à ”€6@ tnK4à Èà8`@ R‚Vm5AÿnLC¢X@z5 ÓÔX¤"^ `BƱ <€–õ Hg“±#ˆhàÌjË3 âòó ж€`v€f L  H ÿ¬  `œà‚DàÚæSŽ  . *@h"| a]³ïT`10ž Rðª0@†@9¦ð4:?6B€ ¢qJ¶Ovh€!!$€òÀ > /ÿè à\` H@ƒ€`Ȥ€ˆ“F€r `M@ 0€1€$  p 6k ¢=Õƒ+)bdlênà øÐ œ‡ À ÂpâàX‘ è Uܤ5ëb L«%F$¬Š%‡&paàâEPàf€'A@ ` >@a{€`|ÀX>%¦ 6@¦w ”  X`À3‹W+kdÊï 98”%±.ÀúàšŽÂ Ð³ & roNGI‹ÓÔ„7r€¨ºMl€ ài–·bW*ôˆR@F`ææ0 <à6`LàJÀÿ(O|É×|Eo z€ V 4€$nàV½cø` ’$u'œ¯êf` ÌS‡z´E  1@¹ ‚§à–ûä¶b€(%ºÄ¤À,ÿ Gµ€Ô@F/©ã¨|ë·©BcÀÏ>"üV@ ÂJI«£˜«§8–Tˆ —ã® ;¦Zd`@ŽÀXœ+Mk€ üñsL€uõGh€ ^@ *À hà— ûn4±ZÔC;F d'TÀ $ ›ë²·9³¯I¼y¬@—«…÷àjàbÊX~• .€(àŠàs /^:À ®«^` 0À p@n8:”º ˜Ú¡/`¸gBXVlyö–Ê£›#èGž°³É ´B¾@”j !à ¬U’„6Áp½ ŠâeŒQÎÀÿz‚ ½¿ B¿“‘¿‰;$. Z öL€ƒ°Àç’#¶¬¶œÙ¤Éc´â.oÀ 0‰.Z»E`\z§ b€`¤ æ´Ò\ÀJÃù;” e âÅK0Æg"´`n<2 °vœO)B¤àà2È·µ3 @ ¢¾@hº€ò¸8~`2?×\ÌK=@ Z4Ë·<(¦ÙK$€–ÆœûÊÜ%Î<Í bpÑа8N›©ˆÒÐÁŠãF°€<@ÀX` hK´Ã]J»¥ ‰1€9& œyÑ_`²@£+FÒ1ÒAç D ” â½G 6ýêžÛÓc©ºÈÿ9îßL`ZŸ¸‚5J@p Ö ¢Ä`,„/` ¬Ú×;¸«¤¿]® ÆØ] ’ÝÍ£•# “9Ž7y &À vâ‰àOW¢&ý ²ÀGj Íý81r~ã‚$2 6€Þ  ß·ÚÀÛÝ%þí¨€?Ž ´À {:¹ n†c bÑcÀà{}`,Ü0ÀÌf‚Ú@:>t²BÞ²GžäA‚ï¤ bÅÿ°þqx¾ÅÀ~&ºéŠàÍB &,é§„  †6!.\ÝÞ%ÔU´¯y¢³Hì¾Át !L è;ò´ë)?!ß%NÞÈ .B @?ßg ÒÀâ i‚ò˜”ÑôiB…nD ºCàù<À l€Çïç õ]b `À ºƒ€æeö+æ>ÃâÆàXÀ ælò?$à“ ˜9( € ½ 2 n`ùKßü âùC"úY` „?Ép#€Â… :|1¢Ä‰²`P1£F‰Ôp`Œ†>Ĭ³°„l| 3¦Ì™ ÿ‰H€à zì  4b/A‹‰Ç˜< Ø€€åÁ3:$<ŠU&Ë.–f¥¹Ác"rxƒÀD™…2V€±AÀ×¹te☠p‰|ü¬+s(àÁG“zÝ8cÁ_L  „+/Œ0Ä{-G”0& ” i>† €7B¶à©a£çÙ•;t6’€¯_Úóþ-Ñ0L@l°b¢—.FP>ø"ô…P¨±€…Ƹù£È×°HŸŽþè¹ûþMϰ‚øè…Ç4Aâ D5˜(OVçxÄGÔaDèÀP kÅ`„ƒ¹'aÿ °P!oöÁ„Ÿ~ü‚ 3dXÔ€ô`C6  ƒ U0"„$ÎÔ<¬@cŽƒa€Äa/™P‚>P`†‚2Р£L&&ÙÐ’L> Ñ:le•@e`‡l0‘@‚ShP…‘HZY‘“PšI&”HAešnf„¥–/mðUpðC㛡É$ ~ÒÈ@ ŠèCqÊD'StgJô™èB‚êxi¥F šjªA 0B?€'LPªi¦4ºú)|b¤k¢@áãFä€&ø@e<+¬$[+tF¨ì äØ.”°TñÞ§ÈV¸m³´¥p‚ÿ·o>;ÓX¼ Bµ uD²ÝFø®¸•€¡¼d’+lÀ°‚ =(ÔdµÆKÁöÖ•^W‰oL Ѓþ*4D‚Ëi¥Á oÌñC ÄÁ7T€Ã_6á.ÆUjÜqËü’~ì°.®`q±*Ÿ¹³Ë>ÿì1´29ACà  E¤ü&Ë@?+Ì/ A„M ªL»é4Ô^#*õF+ဠ(6¢]·ö×nß+tL+ Q€! w«=º÷Û~7›vF"ü`€Ý eÀÃÖi¶ýwã4zp•Lô À#(AГɏãžK¸ÁÙ3‘[­©i°yÆ}Îzÿš¡Ó„x¥ËÛyPÀCPî2¶ü ¯Ï4Ò³‹[;M„ñF1ôƒj´ÑÁïÁ_Oæð2)P=¦{›üL\DAË1t† h°“y«c†ÚÓ´ŽÈ¿?mŒêÀí7h ,²^üH£ùÍÄöþ<–5Ø@ÈÀ6 æpˆÀÒF2a`²0 1é@p€Ž¥, q€ vò„0$ÈÀ,; =$ŒÉ P¬l@PJz(Ð:d!j8NÆ ¥ @!2à¿8&('×ýZøB@ ŽAÿ21(ä (sï82EgŒ øP†> OÀ Ö 1´/|xldDøªÊÀ 2 ˆ.&0AgìèÈPV’¬c$aL)JQ’òs¨L+SÙÈUzî•t¡%,Á(KÇÙò+»¼¥sÙ¸^ „¾,æD$¢„,ÀløÀ“Hí†; ;Q< CÆÐf?¡@Ž«ƒ¸0q+‰Á×Ãæ7 ` z(ƒà@™äá jH»•65œa b8ÀÈà†8äMGà@b% h Ã‰BÀM"€ d ¤o’Àÿ°˜’‰Àt9€ l€÷dBŒÛÝ-"` c°÷¿þð‹üä/9PV…P`ú( R°¿ï}WkÈT‚¼¨ÀÌeb  ‡1@|懀’uÿG *b@màeK# Yy w ±h0tÀc°- D 0áöÿ’€1H ¸G aqð€™ÐžÒ6¸%öa@+7(ð?  †l.Þs"°EP'ƒ[h4¨D¨9ø.,%@UCxƒ AB0gÐg€Jp¤gELPg ò§€,m tà[´Ã…‰8^Ø€kbø…Ž`ÈnG }@3` l×¶&`@¥ùfP Û±xŠèŠ]È€”‰P’8ÿ^”¨G@p0ëV €{d`upG°ióÆv€I¤q€¯XaîÆnE†:†rRJ°4jˆdºèmïö ¿])`TN7;ËØŒ5ñh?¡t 4³¨u`-@(vÞ¨¹Háè‹#0j°E`¹ùÖŽÌ%`òH‘Ae !(töˆ¢¶`kPxŒ aF‡E@m€­bàP0v5w Ñi°E“ @˜4NP‘A nAl@A4Z+ð ÑÝ÷B¹§}¿g|@ °¨£;\p(U9@r  ”eY)&ðA:d–mù&Ð 6/`zni—w‰—y©—{É—}é— ˜)˜ƒI˜…i˜‡‰˜‰©˜‹É˜é˜ ™‘)™“I™•i™—‰™™©™›É™é™Ÿ š¡)š£Iš¥iš§‰š©‰—;ntp-4.2.6p5/html/pic/pogo6.gif0000644000175000017500000001341610017034540015050 0ustar peterpeterGIF89an´÷ÿÿÿÿ!!!)))111BBBRRRZZZccckkksss{{{ŒŒŒ”””¥¥¥µµµ½½½ÎÎÎÖÖÖçççïïï„ss1))B))k991„ckÞ!!­½Öï÷1Jk{”¥ÆÎÖçïÿÖç„”k­½s1)ïJ9„Z1)R!”c!s{Î)Jÿ91c„!Ö9ïBRŒ)!Jœ1ÿR{){1ÿc9”B!!B!µZ÷{œRÖsŒRÆ{Z9J1kJΜsZ”sµŒçµRB„kÖ­1)ZJÿÖB9¥ŒÖµŒ{ZRÞÆïÖÿçÆµïÞµ­11)))!cc1kk1JJ!ÞÞcss1RR!ÆÆJ””1„„)ÆÆ9ïïBZZÆÆ1ÎÎ1RR99BB„„µµ½½ïï!!))1199JJRRZZcckkss„„ŒŒ””œœ¥¥­­µµ½½ÆÆÎÎÞÞ÷÷ÿÿksk9B91R1!s!1BJRZcks{Œœ­µ½ÆÖÞï÷!J9„kk{{)11Rcck””9ZZ)BB1RR9kk!JJ)cc)kk!ZZBµµ){{1µµ!””ss))ZZ!ÞÞ{{BBJJ­­kkÖÖ„„””¥¥çç!!1199BBJJRRZZcckkss„„œœ¥¥­­½½ÎÎÞÞçç÷÷ÿÿÀÀÀ!ùÿ,n´@ÿÿ H° Áƒ*\Ȱ¡Ã‡#2là/ݾ~ûÅó×@¢Ç #Bðç¿~ëdÓׯeFxþV…œIS¢„«ü1Ë(î¤>{»¥S§ÎÞ¹iãü¨É4á­jøÃ‡¤»~RP"鯀V²^Áö‹¤.\þàµ\»?z\X@× L˜ ÀÂ?ü)hB`V"Ñ[ë-€7–ýòùkb…d¾2kÎ|ó@®$ `~ ÀA ˜&\8Àª *8x!Â?Ø›spºwo¹ôn‚„ ô–Éb„<ÿ­ÛÂaߨIÏL!° ½lÿž°`‚å$47‚CÞþPÐydvÐ 4O€Ð ÿ¥þpXÿlAÇÑô_oÔvÀ2)à Ø•f6ÁgÄ 0_uOÝ—nôeößRë•èÛ*˜¥¸™ \šmA €tŸºU`WvD@~}! €$0› 6•Ü}Tú3@y2r7ä8„GºýÓ‘>‚™›}$±ØEU¶I’ô¡Ùv!ÛnZ¶Àg$ñ Ú`M¹Ø'^ùé&q2ædÀqlÆ”™yyúÀ4 ššLiv—Ñ•!…"È üqH%þø1p›Þ…bfúÿÃÀzE è¦ô xæÏ(©BÊ)©pÒ…š|I*SáÏ+¯`'ôuçÏ"¤ˆ’ʶÜBJ'„B,·…ø“LMäTeh&¡%ÛŠ‚ª?°@‚ *Ün»ì)ZÀðÂãž"I 9¼ï)E°ÐE*¨¸± T˜’J%œœòI*\¢!­9ÚxßRšQP`f ×f{$’Ƚ¦t²Wüs@ÌKÁ­æL¥H ëg¬VóG  €¡:'Í•ÐCs|+Ò*íMs\á¥5Iq(0ó}¸WõØd—]³ 0@Gf· Q…Ì@†Ñ3#ø@N7þ¨çöÞ±ÿêÏè¼#Ž5$À`=ôœÎZýPÃß QdOKüˆS2 Àô@ Ð!/Ãà Wéh“O?ð°‚6÷t³Ž<ýàÍ• ìEÁ ,ÐÀÌQBþÉTO?å”ðçœÔ’6”¨€IÐúÃK-Øá5b–º½À8)å;ç$±žIêœãÏ;î˜Úõ›YŠ]ô™œæ÷Q$€z¤ 02ö@}_˜©|,€³ìª7 È t¼Ç·/1"°UŒ¬c€£¹©Sš‘€b”%@l!q‘º45ˆ aÇüÑ®øƒg⊀ü‡¨¾¨«7ç‘¡?À¶¦Üð.h‚@‰ÿà— ði58ÀþAÐ @]DÌÍ­î³Ìð†9ƒO•À>ìiM«èÝ@E­ù4QÄÓÐ&e’Zº¨æ­ ÈP»`|†jš¡Tn’ãFÖHà½s@¬’Ý\m0¶‘?0—I-;X¤‰û”VÅÜTSÿ!βCÉ8€ @t>#€=f†"†*@!›"ÄK [ÁB$8q‡/©ÈD«$#ûáHÈZ¹ÉûÀºD*Fá&$•@EÊ -SÈá 5 &ˆ… (¤À …%¢U%7ëthâ°¬T˜‚X#t¢ÿ7Â,òcdÊ™$Ɖ+ØàT€(üADÜ"Å&$ŸU0€{ èáØ”§3&-ªá  `ˆñ{?¼ä%ÃF?Â4S¥ªMK%òÏV Ÿ€GãB™$ ð ÌfY³ìIZDõ©R—êdˆ-iÆ ™ê6Š €01åØáPulÒð¾|CˆFK`²Ä¯rlJþÈ@ ¶±–|ˆ£ï ŒÀ{Ä'©nýÈtÖÑ}°¤qÝ3ÌÁ¸~0vç0àW#pÃà @äIÒD’ăìAÒÁ–Ø¡CðÇEÖ ­íŽP™M&ý(2ÆÿÅÃ003H2€Õ„Õ·øE1l‘‹]°ªkiGd-Ò¸„’HWt×€ ³è)ßžr+´£%æ0Æ:öÁÚ{øzº †/hAŒ`ÐB³H‹Kîó%ÕšñKŠ$ À¢ðÜfÉ&­Ã¼èˆGcû{ôù½aèXĽ¤èq¼‹v÷¦S® ¯÷ØC xPtÀÃ\éäfàŠÍ!@<$Cf>cÒ¯†µJ(cn\Ø&gæV,ÝÐò·‘diQ”šÚ´€ÍŒòM}ÁŠÄĸ\gVfKŽzFYC‘Q€ƒš¹Z¤ªX!8¹/WQN@Ó¦$ºmÿ:Âr…Tœ™«eø>hÞÌH¹Ã=0ëHBڜ۹¨ðH€Vc•ÀS’,à à€ä93ÿ€Fg!…<AyŽ ÿ!!D95FO®R À!¤ô¹+#f’täP"µ?FÉ¢FáT ¢@:äãè’DUñSÔ,³fŠñià_Ї"ÈŒmJÞ~FÁàf8zÐÿ̦ý‰8Åès]HòÁXa9³¹U+uÓá6åÛ†ô€C"Éì$Ù‹ùµ@‰V±aÑ›ƒÃ®R'1$€€Û4±c›J30§Èo³> zö§™0šÐÿ†q~)0ô°6ÛižN$#Þô À ;¤C ¿èféÖB˜ZéU$ó¨s•+:;îAÑl&ï|hðXÎ XìBëòÀÓ[5€8éO6wÖÐ#€u‹IëÙA6H^g[ÿN9«x_^zÉLÆèo_|H¨Êùðý>`Àõ.»I·ƒäð‘º4É”cd(&ßT¶gd†7­àI{@¤iO/(! š@E%$ Š&m\ÔºÏáÈÜM“à„Ķ…‰¼àþàD*J1‰V­"ElR ÑFjy(€ g$]›jd~+$ QÄ ôäDÿ$¢°MØÓT„¶e דd  cÉ@³‰m•"1‚R†Da\Á" 0§©)ìòJþÐÜr ¤€ §ð A0T ¦à'`)àÁ—  P •à õtOÛâ€ø4‚¥p/‘€ap˜1RyAtEW%hf-¯•A”àh “@ ™À   1¡à– ©à ’pþàNöô Ài@,¦-¸-ž ŽàÑF6µ†gümØq1÷‚/ÁÒ Ÿ` ¡0/E?ZgDŠT›rSp×1oIçU-ucF§4ú]üF3õ†ƒ¨37ÿE^%ƒ{#†˜'9XÿT–åq4¿ÓwV‰…†‰6¯¦R€BŠAn:“îqè—ÈŠ1‹}2`WRrwY74€{c$wFeC™Ç°a¶X3:b €LˆôŒÖxØ˜ÚøS‚ Ð +ÛH+_R[-!nŽL‘!ã` P 'Q£ˆŽ!qcÒÀ`ïû`ôàWT# á@jµ×° ä 00Ü`ŽŠè¡.§£ ,Àò ßP-!SÅ‘j°cð  0ú £‘ !Œ60¤ÕÕ ê ëàP -Qçÿˆ’¡.ìpçõ@0; ÑXûÐ’(l²l¡ r:‘ûà  âŒ8i´ñ~c”âí;Œsê çTó ‚KY6ÒÖ 8SQ @t À Ñ’/PÚ€íàóæ³ópÇ–Ö!y÷=p¤ bèЗ¢Bió ³ Á ²Ð Ñ‚ì •êà/ø°ä0;Äa.Wq@dߣ)ð  Põ K@bô€MÀKij  ·P · µ ñEŽ-aþpÃ#\e%Àa‡8ã_\± £V6ð-àïÿbÝp:Çç€}:há Å0 ³`œòÅ8û0ê‰ `a@Ø#´W5rûÐ/ ï°¡ç°3-² ÓS ²Àê Ó àq2By  'Y|ód ÆèÐç k1æ£ ‰ 6/Æ¡^t3™Ã=Ö·7 ×ʃ©Éç F°tW-¾R]$ ý‘‡ÑVßcg{0ž /À)ïÐGÖÔF%Udu¿Ã7êS%r@i’$qìPBkôyCú%5$KÇT˨>ÃñqmBg>ÓNÊT¤qÉ žp¸6J@n¢bKö&ÿa)ð–Í¡$P;¢‹ t)RST´ÿp)e¤ñ…éÑ6r !7…pËP%GÇ7kó`DN‚Õ‡5fãBƒQ`a‡p‹z2aÖUÒÑvRið Ô¶ «ð%˜B6b£Gèæ"@a”uš±"ûa+—;{â#š««]¡‡’=9£c:?•–&¤p `©ÍQ`–q†‘mÀAÕŠ*‡pz†&Íê6ß¹CÇs$€t‘fn¢rð_sÁz—_ `·7QbGM'n’g“]·œ¹± *“¦éÒÑö›ÿמt(šÁ»Cw5DkC¼±6´‰GÊQc%4B"g&¼x&}DCš±®÷¡TKµÈËëÆê6F_[ Ò.Otà# „’7c–¥D~¨#9°k×KáTÐs¦nÂá+ë¶ `r±šáT”6˜š"  vÍz\¡¤Pi… ±|Oñ÷"€°A«J%Pl$€´2EÐÑ!ýÁµÜ”GÇ‘G ¡?C‚©}º§¹!»V3ІL—Uð"¢’ÄRÂRS–ÚÇ©·®ôÛu)CC*#ó@äº)E˜J«ÊµO¡}®ÿ0¦œVµþš_@%C’µL .…˜®È  °«pºÝùxUFç«gJ×p‡Ñ¹à7Ù¼’“ow’Âpý›­7rOv|¹Á&÷+-×c+~rÄøŒ˜'m'£›á"ä» ¬9úq+;I„‹­r‡;¸ÌX+´Ãoòá®4CÒ¯}±‹‰{’MÁ¸¯Ö¤”Q!®d)P)*7t'mò*)p¸<¶1!ŒF2Ñ+C€tœÚ4šSÏäd)&y95˜1v¾Ñ!0°QSÐŒ´2c*%y$Ã'Nr]|ÁÆyr·Ü³‹ô­´”Š›#ºÿQ"f²*S¼8ÃèbYndŠò)|5l£S\‡€•ø#4!ŒÒ‡Èi[³¯Ç¶` MY)&³3"Ý{IrëSœ'<œ_%‚eÐ+/ÔªŒ“·1E!WˆÜ*½Êoçøøzgkã+¾aRRt«}Å ÁbR󱺑!™$!åA%–!Ú øU»°  •!‘Ì‘§ð_Ç'–¦|RÁ:ÃÃ4Ú²5qËUB`›`†³-œp Å€ Àm'¹+€¨Lšš3À’ k`0 þ@ £° À¤1­b~ø¦v×4ÔŠ‘‚ ø2 A ¦À#æi ›ÿ‰É[Dvq%½brê|QîAüá°ÁqyÕò3 Ú Ïâ™/ùÔ –¨)2JWÈ-¨@ ™@Ó\ñ ŒÐ` Š05qHÒ)ÄD2Ê„ÜÒ Y4@S/°KÅÂN*‹|Ѓµ- PSLwu/©0,<iœ'®„»”@ •`*p“p ›0 —ð ø‚ ¥ ¨ÏS|]¬öp z•½-Ôä”P ©°iÀ- us aAê«É˜æ©]…MíR? §€60”.€ÂçB Ñæ— § šP ‘-¯€Œ š ~+À»ÿÇ-EÈN«@Ô _3sšñ·€¢pž€¯P c[ñ nÀWpbPO©À[ u0sÀ~`P` “ÚÜ‚ »ØüüU%e‡$ð©0Õ$áMÐì DீÎ- þ°„O],?@o0|WðK ö ¡0 œP µŠŸ×&7ëÏ a Ú¢ÚWÀ0ÀþP q áä ùR žÐ žÀp\6cL% ÏüáðÖ&‘àÙ” W ¦ÀÚk@ Ä¢Nïw—¾£Í÷‘åôQ™,Ì €lž/¤ áÑBÛß3¿QãíRp­‘2wöY†ëòÁ‰3åãñdý¹¼ØÁ+lÇÜç’Ê\1wíSÊñ¼mCÀœÞ°s‰v±=UÞRB\êTÒ¡¤¾ ³-G®Þ*¬FÞeCê·Þ&¢™C¯½^%†¬Tu¾C]Ì[(݈AæVÉ´+ à58eëœN_B¾ØØêªˆŽRæ>rI~nS„òu÷í¬(ªšWÔÎÏKÕo[·n¤L%ÀÎ>Eí\aæ¾® á²…O‘¶öŽïsHªä©´rHiS=¿Nª-¦ë!q¼¾!™•况O+Õ'a«“ ò"_;ntp-4.2.6p5/html/pic/pogo1a.gif0000644000175000017500000004452110017034540015205 0ustar peterpeterGIF89a}´÷ÿÿÿÿÿÌÿÿ™ÿÿfÿÿ3ÿÿÿÌÿÿÌÌÿÌ™ÿÌfÿÌ3ÿÌÿ™ÿÿ™Ìÿ™™ÿ™fÿ™3ÿ™ÿfÿÿfÌÿf™ÿffÿf3ÿfÿ3ÿÿ3Ìÿ3™ÿ3fÿ33ÿ3ÿÿÿÌÿ™ÿfÿ3ÿÌÿÿÌÿÌÌÿ™ÌÿfÌÿ3ÌÿÌÌÿÌÌÌÌÌ™ÌÌfÌÌ3ÌÌÌ™ÿÌ™ÌÌ™™Ì™fÌ™3Ì™ÌfÿÌfÌÌf™ÌffÌf3ÌfÌ3ÿÌ3ÌÌ3™Ì3fÌ33Ì3ÌÿÌÌÌ™ÌfÌ3Ì™ÿÿ™ÿÌ™ÿ™™ÿf™ÿ3™ÿ™Ìÿ™Ì̙̙™Ìf™Ì3™Ì™™ÿ™™Ì™™™™™f™™3™™™fÿ™fÌ™f™™ff™f3™f™3ÿ™3Ì™3™™3f™33™3™ÿ™Ì™™™f™3™fÿÿfÿÌfÿ™fÿffÿ3fÿfÌÿfÌÌfÌ™fÌffÌ3fÌf™ÿf™Ìf™™f™ff™3f™ffÿffÌff™fffff3fff3ÿf3Ìf3™f3ff33f3fÿfÌf™fff3f3ÿÿ3ÿÌ3ÿ™3ÿf3ÿ33ÿ3Ìÿ3ÌÌ3Ì™3Ìf3Ì33Ì3™ÿ3™Ì3™™3™f3™33™3fÿ3fÌ3f™3ff3f33f33ÿ33Ì33™33f333333ÿ3Ì3™3f333ÿÿÿÌÿ™ÿfÿ3ÿÌÿÌÌÌ™ÌfÌ3Ì™ÿ™Ì™™™f™3™fÿfÌf™fff3f3ÿ3Ì3™3f333ÿÌ™f3ÿÿÿ!ùØ,}´ÿ± ˆÁƒ" Ī¡CV×JœH‘ Ê3"4XðšG CŠIÕ ’('^Lɲ¥K…_ $3c ˆ5%Ò<h§@œ9ƒÖ4)%ТH“b;ZÔ§Òƒ1…úŒªéS¥Ng^Õ˜ÕeWV öô:ÒêÖ§_Ï4«¶mÁ°n%R%K’áMœi“6Œ[1Ð,¯¤Ìû’ðOÃ|‘®L|Ð â'^›«vòU»¬ _ÉR À‹ d̘§ÆkpK†¬ºõÄÌŒ-›nÙ3Ð +·W蛋ç>­¬Á‚uˆs,®±E^º<¹óçÐI~œ=8nÝØ¯§&(Ht¨;§)ÿï*hÒÐy#¼Ö<:ÊöîsÂ*»¦uí¹_wº'Ô )ƒÄG(¯Œg`wY¸¶Ü^ñ5èàƒ¯Õ~×a§›cÝ!`w„²¡)ŽÇÊóIuZ‰ª”b[ê%ÆVJ¬à¦uùÙ¶M{l(à)‰”QÆk4òŠGIÆŠÕ‡ä’Löˆ (ª˜Ó5ÞF¡XîdÊ*|ð±É#„泈æƒYµÈ$eM²ˆ’ ƒdÚ ­H(a~êg2 dˆ²˜)æGŒä­"'zt5ÕfA&Æ&Fƒ„fi‚5½ø^ž»í‰%–º ˆxŠÄRè¡_ì…œ/LñBƒ0ÿ鬴"5iE YZXDI¦$™”[n=p[f· ´G,мbH Ì’ÂgžñÚkri¥Yë¶EmWMµ…¤ë¸ž â+°#Ù†Ÿ•0´Â„VPˆ5W°ÐÓ5ƒ²+ÐôÛY_Å+ê@¾rë^”&ÐÐd¢D.¹/ÜZº"Åx2ò‰ï~z1CUXñ/E›ÈelðM;Y÷¯š=ܵ3—¬ÐMR]œ§ÇÙ ‹]O76—2H] ­ZdÚ¦×TVQ•X鸯ÆùtuŠ4™Í"}ß°ë"û„ +èaÒÏÇtfà¬òÚÝäÐÀ?á„uB§ëg­ÈÙÙ Y{ÿ47dYrú³G6>‘ SÔ2ÝX¬¸QÜ{ʱ½U-Â_ÝYdÖÊ qÒ\­q|‡´ðßÕ–uwɸB“½;©z„¡žµãÝ%*íF·mÐXj[n²ãt·wEg1†üí“•ÒìS²EŽz{ßf9™m|ÆÈž±x%Ä ÜpÇ|aÄ‹ÊQCê‰Ï¸|X’Ïdï6•ßög™!›ç*‚Pû‚@+à?Ÿ„¹šäd²=cAdBÛÉvfnD,NŸDf—_ÉFM)žð@b»¾@…`AIµüܰàBâÌ üÒ¿ÿùï$0!œZ&2ö8&ÊWÆ/àY&mБaAÿF&“pA„!W{IL$A÷±|RÂFâÄu,ydU¸˜X £A€& 8t¡±Òâ‘*ñ] »á½šfšñ-Dqö¹™@bâ7à \a± å:ø8‚¤f%MŠr8Â”Ü \•£ˆæPÂ,\È/có tˆJ B.¼ß23ºä€7*ã ¦S’õe7Š‘ŸE ‰>2‘¿£É\€¸Á9öñ.²œ#"¿·8[™ ‹º  Á° m& ­pa¼ÊH¹µ@D'Ý ¥mbDÄŸømD K -Â7ÂÄ•‹›®ö»ªÄÅF Ü |S.Læ™V)£\Šr#ǰTZàa¢ÿOUöqiŽ[Î6Ý2P–øÊ›A±QO²tí‚„ÿ– Ïx*éƒB™ì†%”±ä][)(À„„‘›X‰–²Ç1+´â3/hE +ZF¦]ôWýô•cvÏÌì)eH¹EÒZRçf(Â¥=+´d&jO £©<×’¶ l§ á(HZ…%E¤ësW´w™´$„ó˜¡Æëâ¥é\šé=9v5­¦bFµeƒ$˜àá¦6ß{ß^hOfÆHŒø”êTK2)6!f‡Ž¡>{оV¤}0:)ÜÄZÒBh'WãÍcÊUe:¶…ÿ»‹d‹¿ÿôó³ËÜÓ(÷„,«¢œ¯ÔÈ‹¦s6&z‹…¬lýÛ¨²6³“¥pû¢É=Ý„·ÓŒâ‰¸ÚÊU“¸ÏAŒ B±‰MDÃ*¬8ïw•(Jåʵ…£¬©5EKj÷qªßõlh˜Û"µ%žÈtKš"â¼®(È[ÞS(鬊õHk]9xb§eŒeGJV´¡¡ÆJj´ôTòK†%+· ò†"™a0‚7±Œ›&Ãõßrkú©ÂST)–‰ÅÒY%úŽ® r)3`ç4`9E%Šq¢Áј±–ÕK@ç¸ÂÞêR¤7GÏ:Р7ìÔ°¬´ž[a³ÿ(‰ Öʸµ‡M„"ŒV(†µ¬åPòÆòœ0\%Ëž‘-SÀQ"LOÒa-:Äÿ%qQllµm±²M4ÑyÀ:ï9 „žgìgºŠÄD†Ò\š™IŠI-kÛ`§„2bºê‚”?§DÉGë%’¢bSlÊ$o1LQó¹Æ<¬`-`ÈÆ÷Õ›”Ë•HÖUTÄ=†H(W÷ÕÊùÄ0ë-‹,MK›'uæ´±È+Qž‚ϾÎÈ ÌÕŠk´"ÕSiudá …”À û’m]îÈ2ݤÑuLÝÍDm$æËøÐ>ìÆ8¤"ø¨¬„¢1p¡– ˆ±øÿöìþDõïÈJÞÜc¦möP%¬ ež^¢OÛüT¨X:&–¤Œ&ƒøŠ,I磌SAû.i§# dªÜelXW€“OÑŠ•tç8T#˜£Qpƒ\séF {ú—•î4¶û)­`Qr€HŒe‰ÌZ4N!ã›Z´"Ë»ÓÕ"ì¶$Pc`î?.dyÆç¥ˆ¥R‚™Áj4Øè r”(L&“eEçW`öŒ«m·¶ŽÓ©Ó±îˆh[‰!c-;k[LI}eì=œ\àÆz<‚#/‘ã¥Ú :Ð@·*Ï´\z°‚ÁP(<Ö…71E né—Àõ$¾ÿcØ[t~Ì9Í)ì“Ò>#¸/.1!ôw‘{ÂVèBŽýwoÈߊY 0€?à^$•FfW4wvbô. hpP°¦~qC¡ç7²×&ˆp!TÆæ~¤F_¬a2qoÍ¥z9fÂW^­p+vó?0€6¨©fIO°€hp{Ð\Žav{Pph î–P ÃL(T##ÑÖ` ±P Õae#n¤~ugwRA‚| ³s_*³ Å0a÷´ÐçhS€?Pj@dj‘ÞÛ4õäƒÝ·€{€‚ÝÄë2E± Õ0®pˆˆ Qh ¾¢ÿ€…Ut`…Bñ‚\X^Ëà‡Ðu=Çxÿ³–XqySðYÐ/Py¡ñR@zvX}µ¡(}Pp·a Mr5‡•o± ¯€ˆ‡ø ¯…°Pˆ‡X àY‰ÑuH—è~º8xPPgp%h./ègá×`72ãBX}W}‹?X}{ }ØD[£{B!=i'Àè Ä(ŒÂø °@ °pˆ±NVPw2 k]`2€8’ˆ82|v à¥4–IÀç?]ð‚0FÒv ¹5»R‡g7zÛWp=±€V°‡ÕhÒ)%D þH ÃØÁ¸Ãÿh 0R”Yø“uwt(Q{Y^šè›` Ú8Q «`u VWðEyÃ*¯"'È”€zÀƒ×yuXv}˜*µ5GèAY‡k‰ˆÄÓpŒ× l )YÈ ’”Öatòa‰E u‰¡™d† ƒ†VSz#:^ôW` `™’7’ŽaùŽ h À–Lå’Œq“ÁX ÄxŒ¥éÇhkðGЮ@ )Q@YtVðÙE×d‚°`Ég+9˜Q ‰‡˜.t þ'•åRŽ æbv—ŽØŽ˜’Xò}R‘kxšþø–Ãñ Ô°ßé Õÿ$±à pþ˜³±G2‡cp{ù“]àDÙ›åU  œQ˜Äù‰Âw :‰åã+ð¥@}îÈŽ‹xp_åmg ªàâ ÞYšŒÇø# 4ù kð±x»ÑJYˆ›Ì”YXq#!eå Ëp ËpŸ—¸ ü9Ë0œãg†€€†Ñ°_÷*2Ó Ð ’fws ¶{€÷Q¡1¦Ù: ÄHŒÖðà–% qõ){F'x ” ©…)uåÕwPY”ûi9°`-Öb1¨¡À@ ‰C+%v,&!15­˜•„ú¬°¤ÿ–·™¥O!bŒ9Öð Õðÿ؇8 ÔP Ñâ–G…'ªeŠ ù“ ¹ èpª$a^ӨŸ‘Ö&¦€£v6¤a£4¦Ð°=  ÃׄXÐ+½²C c}“чv‘Y2"”öA.r Px©Ç7 Žð²ªkžÕб`ñ©]07³Ù?²y!F—u‰4F”/Ö›¿9\À p”ö‘ñ72u‘å2æloZPHTQ-äyÑuPRP¬Ð ¥ÀI×P Ö ž…È`²„" X Áة糈ðè @ÙB¸ ‚™r" ¶e€I‚§ð‡ÿ ¯‡Ð$´:™¨3¶ ¬;T@q —SQÄLH«.òÁw¡p d’Öz ¯……øÔà#ÀÓ` ³ÐBl)¢r#1 ˆp, ‘¦¸ñBÐØ?œ“u•¯qo¡§S««¾) üj|;«é¥e5v Ñ@^ö?¹Š‰³°ß–„ {. ”ö§ÀwÑ¢†ÂqŒR¸©Çxj ÖÐBPžÃÈ8„¶ØÐ³à°Ú+ªL ȼÂVp<›'\oÚ7˜¡ 7¸„‰ŸX‘G+ /$£f^bf;Qa¦‡C‚ЙÖb§ð[(#0 GÿÁ Z tI¾¤9ži ÖpBlw ˆH a, Å?2³`V@+ÐP°x¼â)Æò*"ñx‰‹¼M«1pK2¸\Èw9Z "§ F¥ !_FÁ¶•Sír¹!ÁwT{^ꥫ ¾çö„Ö0…°ÀšÖ #&Ç 4yˆÖ@%*°'ad árÒ»¬Pw1?¯S¯¢ì¢Y`·Q£È‹‰ˆq€;1ì»K\^ÏK‚G‚¼Êk§AJdöUíB7þóLu Û;(#\FÖ@lÖ:Ã—ŠŒÔ &U£T¶ôÂ''äG8Œ_„Ÿ!-Š €qOÂ2í¢[˜ÇA{fÅ]ÿ˜·’s\àž|9S<ÉZÆWð ÎÉ€Ð6ÕÅ¥I Qoñò7¾±B@v œ&G€¸q©åZÂa­¦‰ˆÖÀ'ý£´°€g_<]Çá4a|À´û¶˜Ô\Y³»+ƒ¼¤F^5›¬ À:aº”ÜÍvö7«` Ï9Ïp Sžl¸,q.ð?¾˜SSŸ!¦p ³@(E-­l±×?¬W+¢[šµ­;hZ ºÕ?Q‘’áƒP­èHaÌ ¥pA{4 ûV1—ø‚Òl^D“™ájn'ˆ¶t/aœÞLÉY=ΰ 1ÃÏÿ h0‰V‘<‡¥RQƒö ±ot’˰E±ˆ+ Ô ­€}`Ikñ„… qY € [ó²¥§ë”cD¿ÌÐ7 á{1w€ÐÃm«¬À…5úÖ|°!͜ԺYõ‰AS=<&­ q ÜÒ\øÒ¯a K0ñ ’ÏIq#nçYÐs9ýu3s^×°±@ÆÐPˆ^t ^ôo˜B0ØJŒ…H% [þsÕ°–ÑÀ=~åG³ÛJ|,Çìƒ0Yøo¦£î7µ\ÈÖ\ðÈCª§3Ÿh,-DÈÆ’) Øî·‘$“oá ›\¢¨è“%í³õ[èRŠ©ÿv ÔеѾÑp^/µ7 óRŸ=ÓÙz©«ÀvìÆÂñšú·S ý:Y#$âB1°,— ‰#Ø›U#‡ RT5ÜØaÜä·R7_ö1³Ì=‚M0ˆÀ±kPÙ—í¬€Éi9•Š,"+­6JNQ›£è‘¢ Ä&†¾û9»’Љsš$âY¾d­Åy±® % 0d © ‚°'D¬(1…2`›‹—.;{‰7ÆÍáxhÜ/TÜõ4Fl7%<áÓŽÜ{(×p*ОØ` ÇÐ r¡Ø•‘%û'ÆavûR  «0 ..&«| _ÐvãT§0âÿ{ÂŒW™d­å Ô. ýäù½ý r2|‰Ö ØA~]”w,ÙÃ[ ߀ßðe,Œ*Cñéb‘õwá¨|Ùe”Ï#ÐL× Î$ÓGôvxO"*X™ˆÛµ‚¢Êˆ›‰03h< áÏe˜=.$ÂAšµÜ[Á×Ñéú3€² ‚²Ð¢+Àæ¸ËPÀ4û"&·wþB-E~Bdí2b2! ׿Þì«XÜ]pÙ³ð-¿ž¡ÆÅJ46@×è1a^€ SódìÜûçcÒþv S€L¬üÊ 3ÜZYÕ¾1\ ‡ 0fuI4óYwr´ýÿ›,ŠËhó®ÎgË(¿‡¥(²ÞiRu²ÒÔiZ D£ºÔ°¢.l„HNA˜¼h%íëQáD²¸‰CwYPc2ÎÐË Ð˜…šFБ“é#4Í(*ayÈ‚U”ßì”´ ß]$TâˆGH7ˆ‚PÑ+úÕ¢ü`e…ƒŠ â˜ZÏxÖ;ÑÉøT–+\d‰¹y™BŠñ…‰ ®Š¡zí\ã¥f3wYÃް t[²ÂHéa2Öê€Ãª`)× UNäÛ„)RÅDY¨#G:³¤ÿìQ›"´ÉUVa2 ‚„ì×nr¿‹l«†Â^ÕÐBì$ìš“N d ƒ QÐäÑÚµLíaÊtŒ)x£/P¦‰™EH~fÅ—Ì«3f; H0˜àzýRé^ ;¥M…˜$‘MA–“̉¼bÑ@D+¼€Ì`X»)TIlz ‘•d ÚÜ£ÃrÜdœ„lXÛV¢ËuÊ,Í ž0¨ùKˆˆÈ’=É·Oæ#7j"¨’C,É"ÏD’{L§Ò%EcZm„#\rš«d‘?ž™gf:(L2ÆÉ]ùQ¨­AX¬í»Ž®á,ÀT]ª)SÖáÿ<…aÛZA¶ b¨ƒœ|4¢‡¶¬–öü’Ró„ýôK:HÄ*]¬#;Ф\ÀŠJXQÒ¦¬ž£Ò¥€C,c†+±×OW=å¤Q«Y +‚Ù.M¬Z×XF%ÊL‘.47(uÝ5h ®‰³ ðÂp5r9“Xs T¥ìï´2MÏjDL›WR(Ó•D-#¥X'Š>¶ñË Ú ÉúöBÇž¬m­ÜE’P#ªÜF€´‰bíŽ"ìûÑ’ZIöU ‰ÙYâӬ䮢rÏ^ðá‹©XÓÄ 1ÒŒ]P»UL…/†¼"z%w#¡½{ÿ¼BZ‚5úvÇ ‚`Å·fp¿ùQ‘ha·ît³(ª?]Ãg–òÖàÌBˆ°õÈ혣’öb¢L]o*†VÕU1­¦ bŠVs€;i¹Äh j_<%èõ.u"Éë’…VKõ†Y? âMFzÄš÷"Ùq¼@­a§Ka“Y2ß(wG³+®l–¼Uz6y‘;ˆYäDƒÑtKÔZ½Øí±ãT¾‚`á¶–ªÌ¦Û\…}̪0÷¾¦³ňFœ8•,ì¸ÜÕ6U¬ÌB+XTa¡Ì»Jç,¬d èf6¦Ð¤S\\A4:1aê…— |ÛFGáãKr„¥ÿ®é¢”iÔ»ãÃë¬v—€ÜOŒD(¿ÔÁD«giuO¯Ê0sÑŠHôªSN1‰ÆÚ—ÿJ—›Nîó÷JôÔ6ÿÀh5MD0“ð×Ì."[hl:DÕÈjEÑÇÛ+Ðà O  Z€C–"èÛ_ë3¿%è[«ð|PðõóWަ‘U‡«ihÒï!4la­¿É—ŠóºLÂãp—†1–#ÑŠÞ+†eèƒvi ŽÐ®b`¬-IlS˜4 Òˆk—išÁë‘ ¾Mhùñƒx©Dðˆ—"/Ä2:˜Ú–˜/³‚V¨“@È·À‚lz?lÙàû "qŒPh£›ÁB„)c…Äò¾»/ØÁª„—jDäš~£Ä,Ù¼øb/€2úê‚Љ¬P0P žW!ò¨œZû“ú÷:À‰“ ýšŽY$œ 4´2Âè( ²§ÿ"‰1‘6“° I+L«Æ›˜¶ÿ‘ÝZV¨F2îx<Œ(ž¦ªš+/DH€ÄRIX4G˜hºÒèr*¸€© ŽPÇT4>E°Ó˜ô€ÂžPýh=rÅ¢-‰Àµ‹™9H·› )AH×ð#› X²‰R¸º+²†Ôö‰q*DDhPC„ë Ÿ–úH¶4:‹èP8é „ /hjì5—ÌèëÊ@ð‚Û,/p¸Y@1‘7Û¨žòŒ­ÛµÁŒ¬Ð$ ²B§»œ‹˜Ô¥d;2œ¤QÚEQÂy䢧Éï*:¤ïÉYà0ð¨"jlK¯u¬‚k³(:AÀË•²ÿ½1 È.P¼@x€Të‚èŒY¸/Ê%þ³žžˆ¾À'Òº“®™…Ú ÊVHðŒÎóêÂÔÀzZ†\†—Ó«r9™A&PÑKŒà‚-«J”[ °ÀŸ†´—•`«Ž´K}»2zCD,¸?\ˆßp|³Mœ0¤ÅâIP+PÉõ³ÁÎB)NËx 䉲𠍋$¨I*‡«²šT¸Â(Ì•xk2ŸÎœ’œ´°Ë¤‹–„‹C@ÏY\†=£,8ÇÈ@»"à‚븲(üD¹m„Ñ°Ž ê£ŒP·M ęˑ…ú°Ù‰†ÚtPt,j§ò{¼L€”,DÿŽ‹øÂ‹ð è¾(S<`UO/i8š”…L¤êx8ãD„D°¦/8 A„ðÊ—dJLý™i+ÅÛ.ì ¢· Ú"€mÒš˜mò…‰†Èo~=ê:†æ£¶UÁÉoÿ’ˆã…0Cl8'ŸæìB/µM!6:P¶,a®Y\R³p©iÇEÍ O!­Ø%1 h"‹'°ÛËë(jjî ¤¦è¦ñÃäšë/A &º¸'FáA ¨Î)Lo1r1¹N//=ï4êšÅ¶;£O I;,Å‹(Š›ˆá(‡@Æ">Õ›€ó.o‰Ûè®k8RúðC0gHm/]ˆ‡`Ÿ’ë»ä°ï^•©B¼QV°hõòý Ë‚L¤¯©&ŽH¡0¥­,™a±Å˜@à‚ƒôψ–/XTQI„#èƒ+›/ûâšÿåC‰^ÃÔs€¼;àÿçš®±ÏÎòÁ8<ƒ”í^·²Vc…H Ô80ÕC‹YÊ—5 âµÄ(Y˜áGŽ1¸gg€-ˆhN‹5 …Ú!EuìÞ°´Añt ÷ŽÅ"µM wŒ¨?ï€ÑYðð0aÅDX½ L…ë>ðáü@ Ò)TzD0èžq&uŠ÷–‘yV¬²|Ç'…‘A…;P–ȸtõPé;(–õ§Ý4ôNvUNVƒæ#ŸÞÏh›·Ñãã:'â`Ë´Õ—*“7Ah£gh&íÐf€ÿFçÂÇ0O%b¿Mîes˜øA­áNR{O…úîH„*cµÁMqêÆÿ¬_n¹·F1šâ ð$ ˜…4Fp†SˆƒPðð­a{Ã<ø*“½A¡ ]²îO:]^¹ôÿ~ð¿R¥¼Æ$¬Aàôa¡lzk…ƒ)ÏøŠ°ézá4¶ôšQ ˆMn:µåƒ„ p‰±P¡©S¡R uMP l7rÜh–"G’‰EPÉ-ul‰-—2gÒœÑåšËœ:wb³†“§FV5‡-:ÑŠˆfÉš…ˆÌ,/9Àòâj¬Z·rÍú"KY¿d»uЬ5#F¬a5­ÙªV‰dzAd QŸP§®]Ctàï@2,#P—@cÿ„Šãø1dÇ­¢«¼¬UÖVË(rî­ñ8w6µb%æÔS²¸pák€Ñø^;dê+V´/¦ÙêZÌ+tY-›È9Ð ‡ÉÆhø°¹r1›7'x­‹Ì.]®½6£w,!½§ôbjçìFi–ê^'ß÷B×Óê%lV–ΚeåclYt5 Z½ðÅ\-0H+q¨ÖÊ&q ²Š*ÔÄ‚zűI(vð1 +„Ép…™¸Âa‡ Cc‘¹hÑ2•sJYDÓŽYÔ`d›°b{˜ÂC§DcÅ +Ä@+H® Ûnà!rÝÃ݈c(‡ÉC !´Ð ‡$tÿk¬ðÁ+¡T¢£ D ‚‘KðV m&pÅ,½Á§zõÉ$ÈOï ºÑoŸ‰vÑUä·ˆNÍrˆ f X`Y$RCW/´Z¦¬ªc©93K‹wð!C•Xbˆ f…v¯šÈJD.êÇd2 xMŽ…²Ì)ÄFÍ)¾È aÞf%w°H ¬LFb’V@ÉJ)aqÍ)âuáEuÁF# ™[zÙ%08Ô\rË1Dl(¡ ‰¨Q‚L¹p$Íðf &u[+-YÑf¢58(Ã|ÌÓ] ×—H_0ål+|Ô_œbZ` ˜Å µ‹‹¦LCMÉqðÑÿª‰… &C’]øU˜<îêâ&×ĸLYì^>_Fª®§ˆà |9nˈvM ÿñK^I3[ê2WKÝ5Ñ,sBê>¦B10Û4r”Ò…pMûîFÃH^ ,"wÔÊFKìf  »wMn@±÷ßCÍ2HV‰Ì‹,ˆ<ºTS‹/ðñV XV§ƒôY)²DÖÇ[‚´lGÌ…­ða„³‚X @¸ó®Ãƒ¬×…r,¸Ñî˜Òd‚ûâ2„[‘l›ÜM+½µÊzõþ5gz™òåÙc²ËÙar_8‚Å 'áK4Æ<Ã"ˆŒôæûˆ c½±Ò… Â=0ÿîLÛŤhàÇ“Ø îFáßzlÆ”« ÂqLAJ~äÂ1DpSW ²Ð¤9Æ¥€Œ´˜!ˆ "4¡Ì`R÷—Ä”ˆ ¨)²Zô;âÝnX9ÚËgR¯Æ¡kÃLø`7/èF†wÀI±Œ;LæXÔ»!»ÎÖœ´--7²¸Æ,¶À€ŒDkêI"œqŒõ¡$`"ñ®ˆg8ÃêÓ[´v…*ýI8ˆð¼ áÔ‡pücN¼S/Ì¢O5qàœ!‹D¼Àq°F"a¨@@hA+œ’ ‘µâRòÔ)vE P<泘†*²Ò²>0I1* LØx8ÃåUæÿ3C#È^¦C‘%Ê’gv" šSä‰N׸e½žX=@<{LûRÓ°¤Ý°‚7¸› Zñ'V<ÃǸF+áºý«n<ç3êW@P}ºÂÿgÀõL öäˆ ë³”DܱŸKÉÛÁ”HèŽè¤ä¬ –d¡ý ¼p)¬ÔÈ,°húP†5áºê5>'š“M ¨Á,á¢N01cE({I»MXXÕ;–š:S™:fêìÝ,GŸ­©"Ë8j¹¨ÇŠïÁ€9Ê![—rƒ+îF‹1èBI€“͆6ÛÍp‘qŒcœ³¬ý*‰®ÁG›Ð¤.úÿ²⌒Ö{ÞSN ãÇø9ƒdh¸"§¨Y|…VbË: AX ºOY\à‹¾ Y(Ã#Ö2Y(z¥ E+ñ)&Ê‚#,@bu•šÙŽf°B OwEËb3ų©gd(Ó;À1%€J r'²‚Ÿ¬@ÖõÒ@„@5^ á¶E¦1àt{_ô²–µ»Ý]+|ë”ଇˆó4 Õè HÝü-oCÁ 1™2ˆ}á±°Ê,ôÀ¸‹Š-ýaŸPD"IUHÐ Ìjv×€5¶†Y°àýqÆ4ö[€Vˆtg»sØÒ[]ée6µîÿl„;Jì%4œá)À³Îæ¡õ–¬u0ÃöD±LáY¬aÍ!¢ÊÚx¡^m)E°Vˆå æì.3Œå²úä)ñÎk¢ž;âoJç%ÊáÔûÇhœ/q4Ä)ú×Ypêh‹ãS– ]°?²X"z…ÕuáS’Œ_ ½Sı`ì m1ƒe^yÄNg9š¿èjaÓK1J|i,¥wº¥](z{城ꙿӛ÷–i…\¸÷Ìf=·!»ù)ÅÀ€@ЉÉÍÝØŒg¬‚A›ÂMA›’´ yßJ°°ADÃÁ|1$Qa 1 Pq5ó ÿÙ‡øÎâRõ]d"|¥,žR Shµ”HßÁšÙÌcÁŠj$ú5`AVaÒ‹&öÅ”–éî$â½ÄÔH¼KVŽŽñJXÄà.:Åd<’`ªº‹È*2®ñüÆÕ:ˆ¥µ¤$ïÆŒ"y5±NO~eƒ 3hãò8ª“äí2!åÆ<æÑÇ Ñà¶à|n-ÃÚ¯k F"²‚RH:6] ˜XjÎ1¦llŽHM±+,ÀIè ¡•Dèìà”Å×e«KÝ©˜X³ ÉÈï„ÄÔÉ xÏûH¦T=ã¤\LÒ\ ¿JÒ… G÷ï Ôå ´†bœ+m®+ÿ#‹DB!¢ ¬½†b>èÍIFî’h`{é^ÞbÁ ¯¬ÁåÆ6—záu?ýi;¯bÑ2 ¢ìV"®Âv‹»½ù‘‘HŽv×»ÿ.Ô€§ŸwÝè°Iù–~œx’\áM½ŽÏ6¹üFô|IËÀùÚ8Œft¨t/ýâS´þÌãHÕ¤žêqÄý,”ʛYà $˜AÍ‚Å@Æ´‚,¬ +0ˆØ &ͨQÈB5ÄÝÂù›“¼†|Á Dšó¥ ‰EßÜáÒ5À˜¨mÜ ä‘IhŸÆÍÀd‹°ðK+è›á5‹tù\B$Ä5¸\èÑǜ ÿ”ƒ=Â#ð…CN_ÐÉHl ²H„Å‘FÐê„é Lh cøUS€EŒP"@~B^¸EcôAJƒ0ÑkÈS¤ 5TÃÄ+ä^¢õó©` &–äÈÑÎ)Ä` àçÙ Æ9‡K4xÎ|eEð…4UñF6 ‚x,U—xÛHìF+¤€V m5á •  bd¤Úé}¡áˆ!M hØY¹eÁ,8B Ô~䋈†5TCc´BûÌBžÀ† ´ÂÁ€Ý)°‚ìaÁ D£ÙÑ ¸!†ãÅyŸ2Y‡²("©ÑIÇñç}G œÄ ìœ ¶Àq „D,ÿ‚Èo0ÉntË¿8ŒºÎ)î£üÕH+ TåõÇ\ØÄœW"ÎR+ôŸLüŸGà—-ôà)œÂÈÂ"YŒ,ÄE4NŽ‹=+8H Æ B ˜ò)šÊ‚*lÒ tA~ÀÆ ß§‰#!vd9Úã ÎP(¬#IC‚SÞ¤£$Æ‘ÏÔËD\âV$˜¥ÑFöuÙ(„,ü8ÝÜ#Ä+^Û)ÖÖéÀLðE‘õÆ5xÛó@óAM¾\$.¶LèâL„Þœ`^¥À#¨A5ÌB¢åä ˆ”)XÃ#ôH™R¢­NlÌBc.àV$B ädl€×ù$f õ@Ü@ -âªÕÿßH`ÁU6¥CÆÈ‡]Ê„eUZ¥ª €B—ÀÀU~‡ÐH¡EýFnŽLÀÓ¶0åEÈD¼ÉqSOîÅzPä\vÄ,¬•.B…Dô@É‚€@a5He"Ÿc”ÁZ²ðlTÍÙá¤ÌBW ÂvÂb¦8QMŸÉE-öSn_öa݈¦öÇ&@ÍÀA¶¦f\}O2€À‘U$Bv¥§µÍBÜX¥ Ð löMÐѸBOÂeQðMsÒå· !1¡Cy`‚øU+ðR¦,°BpÔA˜‚SäÇ5$‰v^ÝT†Œ lç |Š{údÑTK±p†ÂÉÿ#‚‡ÖøÜÕ°j\"‹„²F©I‘Ê!S"B ì…†M%1ñ˜¡¢¾ gQ<"œãÂGQ0gˆbƒD 36F"ø¥€¨hø[N†Q5ÄBTƒ…\À븨'5Tû¦ÔúdÏì†Ø˜ÊÕçc”&ßåÝ·ÐdìNxÙ ”ð‘ÜðË|¤U_S¨&@¨ Dƒ·`†ƒ&ÂÍéEýWQä‘ |âˆÖðQ¶•\6g Ø¥â€J6#Ílõ!e^Á xAèˆX]làdNžge¡EÀdn'8F*f.ÏÇDÜ/õÒ)Z<ª^Òœ‚æZ†ÿÛŸô£Ñ„n´B -Uø5…8¹+0Zðàxõ*¸uA4D†Ed$«ÅÉ«±* ¨$Â#°ŒÅ æ \ÞVÈÀzÂ^õG`®çyŠëBôA¥.-éïŒT®jxØ`§Þˆh¤FSþÔ„ñQ6i)ùæ*0M&&aW½Ÿ_½ãl¢o^ì ðbdü†½Nèœ"F¾Rí 0ëµÂZ$Ù bÞÁLR~LWdAÊR¦\ ­çR°ì¸nƹzßÐìÐÎÜßö8Åülœ$¢êd$‹Íæ]6¥U™ÑDXKÜÜüa( \A_€®™HÓ¥lbDÿ¡è‘L½zm›~êuxÁ—ñŰrÛøt6xíBÏ$Â4CØ¢tÁ^ ƆCÍ×8NÉÆ­¥ÒvÊLÙ-fâ-‹mÅMõ‘X8©„Ƶ€Qæ]0ÑÆºJ"û…n8£'©¿ôÇû ½À›\ƒÈúÕÓ¶â5€®Äš™!Ÿr~›¿Ê©zBqjìŠ[ò`g!U-]hÇžå¤Ð B’¬'¤Œo+öGû Ƽ)/fîŽ-‰ k¡`)ÕÅõÕ”Þà¶Èã ©–a’J!dz²‰®8±&u’A°VHmû9û:X&ê΄ðÑÄ1íþÚS cÃ.ÿ]žud+üÕ"ýf¸‘ª—,HB¶Š¹9£S° ¦k“ÌFo•¿Ä£W¨innÞ® Б®ÂšÍ1m ä5¤°8¨µ1ÙWÀZäy+F ‘oåõEUmÏ`}@ç èÖ&´ €Õ‡nÈ^¬®à‚;mì~­6á_ÎS›Q¸åÚRqNBš>†^`ª+¯{ÑM…ê"ÂÎáÑ¿Ü}ÊØ›àÏn`TX[ÒFÔµ-môqørå‰Å>’¯S°QÌÓ¸ä«DÚÍ.ºi4ÄDã~í9vdzýQˆ!ÂFtíÅ.Š3*VSÔ©î2QûhÇÛ æÊ¾²<7ÿß&ð“õ¦£<šñ­k\+\Á#úÝ”ô FyŠ’¯¯mÅ&.`qE3ðA“¯ÏaHŸÐZÙ þì0]üzœ—رòç5nŸ¹ÈhôÁyD' <E]üÞÖEÅzH5*–¿¥l 8#©ø­+ϳOÇ_ÜìÈE¢i®öý ßYîAß1Fѱ3;#0ƒS°¢ƒEC‚‰¯ kS8!Jz´^KçvÀu´ps¸éV(`‡5·UO²ò)œôàÎZ+ê ØuLLjñ&ɬ^>F|Á)öO6íüê^1™¦65¥:µ $íûZ¥C?ð›]CSKuWèÿ±ƒ-à5hþÆ?#Â!Û«6‹“¾ŒhˆÕ„ˆeêÛhY[C†{ÎF`Ò6÷/^I,ðg 3nÐôAø-iÌ6b¶E4¤Œ]ÃËX]@¶ÞdoL'´&¾¯r¶ÂÞ1W°Òû…¶ÍiÅ>ZU:˜n`’nèQ+è/=×óˆFš‘*¶]Gò-mPG`òb zäðÛ´Oœ\šý^G~E^|Á§ötrSð‡ù ¸\ùÌ |KâÞôJ"RfM„î1Fywèn…µ™E‚Ù°ƒ H®],ÅÁEKe)· .#‡ÛyÑw}ÃikÙ¸ðóÔË0AÒáö&›YJòм@ô$ÿr/¸’OMU&KTi7¥”šf?'À÷²/w+ôwk7æñÅ),Èn„ø ð…VìE‹ð8‡X„D@å€VenœWëM‰ô¨©‡*Ï5^ÃÈ è‰aŒƒ[oïJ$Â[_)¸é’'ú‰—ó8d°Ô/å]ccø}fïkvæl9zŠö sŒnä5\Ê,èIôAüéß*\A@¥ìÖ‹7ãO­ÿãûí|ƒÖª‡6ìzĶÈÂ>¼Ä»jñAÃ[ {hð‚Kü’GA ‚<Ö‰Jd<÷Vy0}.¹oÅ|üggB‚aÇ£âo€ ªû­‘„Òjiaò º^@|)1\ÑYQÈŸD »ÇÁ¿3InÄŽœèŸ=´!ýÅBÓ¿ä ìhàÊh wÔK=bÃ_Ì+É}ÿG“ÊØ…÷^!äY¼oˆ_mØêuo9_¤ÊD,:kš©—ºgmˆß¾;%/bn|¨™ú "$ ¨ü¼‹WeÁ#þš¦U ?Æ)XA4ý,šc€ÓœÍŽåO?ÏÆŒMv.kÍ”ÒÇó…EÍFv+l&3 $‰?líˆ+«ÿgÑ™+ Ý×K> EzßU~ðo›¬4â„ Dע݉saÂhVÜ’Ë ¹ e©¢4ª¿À2ÊŠ)§˜ ʊŘ|ÎÇdäà f°)³štÌñ3ÒŽš(œZÙ#4srÊ©5 låÀ8RÐ2á ³¬ÝÒ°ËL¹ä¯•S¢ië¶Æ ºƒ¶h¸Ë蜼fGŠ ÄŠS¤r”Ö/Ú«;*!•¶S©1>A¢Ù3GÖtµ” Øâ±À šµV„î8¥•*÷šA £ìê=¶´Ô”\eíÏÜ8>f£SP ´­VXYÁ VX¬_ÊJ­Ë ¹¼ðÂ9çîÌq+bã»bÿÀ„_x»‚Úe+á œÍW£MZ!k[píêꊶ0-dPÁ4÷‹E–*”ž–Åé‹)ði¸`¥QŠmÉW€Àà˜écàžeB$ÐA²XŠQ'›t‹QjÓ»שNɸ¬+þ$‡³º7ä®iÛPTöàŠí¢V øbáAú8Š5Óá®M§ožûL¼œó‹®zžVØ= `…N ‹§vên$Ú”v‘ÔOsb¥±š9"쮽ºk/êþ}.Ë®=÷²1O½4Õ]ԲȂmŸê‚Y0SaeªMä¦ÁSh¢¼ö¤!àâØrLÆY~%vã½í^Ú'šP`­;=ED§ÅnEÿÒ®,Ï8¹.¸þüóÈqãòhÿLC u˜ 2 ŠÙšXTå™Ì‹+ß àâd9>×¾NŽÆ½qçZäêÃé^0¾¡ …Hq0E ¬P3èňlf2 Œ®æؤX°TQ´c›üQEtoÑN¨œ¤>÷e¤Úó2ëel{ÌT©°2´µm5DéÉÑhÃ@ÌJ…}©®A6RMl…è1™ðVFçø®(­ða_t‡OQH/9"óò€ú‰J,—“вVTätIAh² @X¡ VÙn£Â8`DFdÿº £Ø¨žÆÇÍZ\%µ íÌQ,hÔó2%æøOˆYB£=˜>~nFcÍê”Å +(2~ÃlâДõLXÁ 'mÕ+ÅEŽ˜ÕZÐ(­×,g"•©¤šƒŠâ?D\ÈBoÁcYÉ¡‹8N*+’ÀJ"$[ŒCc &­1™ñŒ§¼ŠX—F…bŽÿ"b·Úr=¼ltœZVÙMã`œ¬T˜ZyBŽÈœìZgÉäYQ‹ÆAFÒìB§’‡ÑVT(.r¬Ô5Ý‚“ g.œ»0Cu µ”Cfz%L¹$+`*í"ô£<Ř^¨l¼+˜’Ý”TãÊÿaM†ÂeɉËX 3Fèj¢‰)´WPšŠéOýê'r¬(è\8 êZÃHÔ®t ÛáÏþ Ø…Yx¡eéW5›×€G,Ê¡NZ °´Pp¬oùfb˵KþÌJ˜‚!UGáÉV˶HF\¹fSª;ØæzðÂÅfðRrn•#l+dq½.\!Óc‹"ª„vÑP´ý¬<‚«œ:)—.œH…„}tˆ]mƒ­.˜öL½F”ä iN0r„’ äe7kZˆ ‰mÅŪÆíèvKríbäzXÙ9 ˜U‘ï|é[_ûÞ¿ùÕï~ùÛ_ÿþÀúíƒ\Ò.b!´ÂIÃÖ)ú`’×¾6Û±ËF·#¼+<øÂÆp”ºœߥ×l*yä;ntp-4.2.6p5/html/pic/alice47.gif0000644000175000017500000002502310017034535015247 0ustar peterpeterGIF89a‡´Õùø®…RlP3ºººùžwØÔwsw÷ñ•uFFFGê骪ªwP!‰‰‰Y¹¶¥d ° þþþ [ ;2( q ¢ € Œ ðl—l‹[ )!°tSJ4Šqm 2+„'¥‚lc=I?ïïó¡ÆÆÆÎœœœÎÎÎ: FG¥œ¥ÞÞÞGT!B1ÿ³cgcUVU!Æ!Ö‰gJJ{´Yv/qÿÿÿ!ù?,‡´ÿÀŸpH,ÈckÙJ:ŸÐ¨tJ­J-lS˜m¼° Hc€XÏè´:Ú‚ `ËÁáЀٳvx~ñš[k‚ƒh8LypˆLˆsl f„–—N-‡ŠŒ‹0 ‡Oš  ’ iYžK˜¯?-/œœv-p •H-¹±9£Z­ž°˜m8yˆzy8 ŠXI9Ç¿ª£Êá®ÌÍ^³n?³xºY39H' ÇC¢GÉ⌠ öäV‘!ã…Ý1qÔ)‚C,‹›@úÖ‹ˆ'=ü@| ˆf j’BŠiàÄ@,pй S)˜/|GÐaä§+GEŽ~^¸ éÄ…ÿèÂ4J†Îvbp¼X"GDmrEDB̘‘ ´h.1N*Y^„<À!-ÂXÔê 8êjì@±7àx£•É…¯PZœD§¶!†ž2ŒŠÅ@^Ä“ŒxQ+®€2paÆÙ)Qƒ6i1#ׯ{‰áÈQö¬¶¿EÂT¶eÇP¾Ì!HúG¨ËŸ! XÙ"Ød:Íœ5?·¥Ï€yj„¾ê“X[p¾MD›Ý"-¸Ífâô0—Çä~£¾&ËèÚðåÕ6?ÇøwòŒ4pŒ³ aBÌÒÖ‘:Î Ë6i]C0gy1 /…D…¡b ƒ@ÿƒ„èÀ*Ç[PôÃ`jWϲY6ÆD¤/½¥0ÁŽ¥Ñ€ =féwúÌQÕ7ë@pÁ‹¾<'ãM`¼"‹$Ä‘iE"d9>Šà>QFÒ`™ L6iO 8ZbäTˆaÁ/Ä)çŽØÃnìµp”bI²À:&)ÁÎüÀ   ¸àg{’T)Ä .,ŠÝ@*+¤8C !Aù}Ú•"GxüÅ–•Vº ¦b¦†nªÆ¢‹å1Ì™B "¤íC ƒ…dìŸÅ\CI,º)›ÿK ý¨…˜ˆ®¡Í¸\`€€*À(›M–ÚŠðÀ$IÛ«iÚ °EÀn?£’Úi{<ÔÐê¶á´#³T~Y£\{5ô=M«¦²À¹ØØu1 ¥µ@¶±l>(@4ðwÅ‚'·ÑÍ|ê ž,€]%O Vˆ2/£™TAŠ{QÌ “Rk5×#ºÑ‘*–†Tí„9nð‘F€€ 4 ƒüÇ"9˜ÿ vX¶|îÀ±Áu Bpƒ¼œ¥ãÑò IP`­hå'Å ŠV³N‚ Škq@`B°¡‘ˆ)آƗ—ŒW2X7N ^¤ 8¦ˆwpM€@}øµ>‰^3 †ŽlÝ€()@¬eÍ[.iƒ†Æ¢ËBN R×"‰=âcŒ0d'%A Rq°ý ê'š¹§ˆñi¯I¿üD@μI5â¦x³Å­1hÓ†==$Z g­vDÎCÖ< Ì:r†—qI7ˆ%Bº6ÐwÊÁ Á ƒƒâ—ÆhV„à­>æÔÑ3ƒjК€+`ŽyÁ­NØf6§€–©}sÿüv¸øâ²­ÜrpÄDWèà°ƒø†àÖ˜5j€_ <`ÀtTRµ“Ö†€ŸœÝ@¡ô±§˜–„]Ç3\EÂ}àaåWW£`ø«Ä‰­‡õÌŸT ÄlìI)NðÛ¢‚šø5\šC„<à­Ü¥)%ÁÖÎ^Sµîœ<0©Àí«J8 BW 8É"&b4 S !—zaO°B2´[ Pvj¯Y7t¶³¦úogáUMSa~ÑŽUƒ¯EN9ª[HpCþsƒ§2 N |Pq­2… áYFc–ó;€HPÌÛ¹á­Ç6UHfVÿÁ:>àgÑæÙ£.‰j{`N¢uvÞð…c@gœ†ÎyFð@'ð #Hõ,@ʸu̯î,à(j=6Ì%qÐgÀŽ1?í:&ó‰à1:g{B‡ÌöE‚™š>ṙšø€c{¸¡añL?ÚÍÅ4¿Ú©±ÅéìZOx5o)}¼%¸Æ ÀšÏìÇ 8ãÆîN!€ þúø­†+ ã½…Ùs1nÏЭ+7Þ»Hľ{²ù¨ò†Œ#f0€éEíx+žÿ ;A7M ‡P ¨x€!g#a:±!U£ JÑ}ÿoe*_÷÷jVêg>Ö#‚)`"l&'ÌvF£‘f)`nÁÁd[@÷mã50i¡2/2X²`€z’`€P#¡HТ3.V Ó¤Vèç-Y£ØÀgBm¶f¨³#ð·#V4 1€9à(wb$ƒ ð³e%PPý³ »C ÿC3ðƒ€€!¡Z C˜)Ç&nÄG5¦~÷¶u$ñ=‚-bd«Ó35uv?B'd.HB=²E^&®2#@DˆŽq/à±Àƒ’P‡v!ÀCMi7DG1låð¶ßòV©¥~<#8 Â#ÿ©%=0Nx->Ò3_·1"j´t,’ [ÎxEsÀ >wЇ ÿ |ÓׇzPAðòq!`M`1²³g‡o õu"o³´~<"8Ɉ-hwŽâ/è±N=Ò-A–-=Ñ£3d茳.©¡ …¢ \€UÀ Á@=?}—€r8²e1H ökæ·xgr’-d³::8?B8’ :úh…"Ù-ÁØ-¾#;àŒ—a'Ð9‰í36Á  1 ©Òê˜~1Pc FBs4‹F*ÝbH¹„©’!!phoµ¢-t²?á¢#Ú"'ÒæÝw:)ÐÿûE5D^@èb›Bd;ä*Úa ñ–P2mÑVv’G+‡3uè‹"1q2)ƒ!ƒA7/-@qƒ¡%@f0Ä#ap‰_Ä j£ÀU`=8ðC’ ÿ}PAÝ¢V9•ž’°˜§U+#qì÷i+ |Ý’aö™ 1ÅŸg'}À!kb òtFÓ¹;B¿%it1#çAÃg*b €GøåDt„ÿ„Ût˜*m (6‹I6nVS6GNr¢©=q‰³U^æuE¼¡ ¬1 òä$5p)ò«7eÀ&àFJGë{ÿEKVI#Ú}“²:‘â›óu³’%ÌjãujHqdè¢ß–$r>‡Â[°0&3àÀ®¤CG·” sè‰iWøcƺ:øuê7=UyZ늯­6^@'[„†úY ]0¡WË­  >±< \ßÚ 0)Y–hè*c“‚#»’YR¬¨#—‡öx+1P"o$‘a5i^³u‰¯"±h‘3›  ­'@[ÿÆ &œAk¯‰¦pêh 7m`JK yƒˆ"²•E•‡0oþbWXÚž«Š¯²å¢æE†f^B†@š§«­{°èÔ³%qQg×d{]7PõÖbuPE{§ë ÷˜‡¦K8BÕ˜c! ™t7y²ˆ+8šÇsÃ%³ –XÍEK  u„oŒVCfnb¥YKm-9vÚR´›±læ-‡“W’d$[ûןKV5]Á¸µëp’0³%Á è ]zr³¤—ÏNDcU†c˜¦›Bõi¡[SUä‡S—_µ‡ Hixª6A3ðUн°p XB'惇›äÿ0¢¤aUA=Ŭˆ)Ú²¼#›Œ‘y´?¢#s);u=±d­Æ–ü7g '29 y'`5°8¥ FJ3£8 l¢¥usÚ`$©§ÁŒ“%"¹?@Â$¬Ö;[¹ª@7 0~ð©0À›W $`5 µÊzÜ×}Ùá¹7År—VSìê¡7yÁ* I¥±0àÄ$ÛwƯü‰¯T‹i §!CÁ¸DÆ%ñgÇ”Fù´¾¶J0ƒ˜”¢u•‡(8~{vžšžµB™qr8 ¢ŒÇ#,Ê @{¡P—Ò+0HøU;G"ñŪ_k¤¶@ÿ–ö®›E´1­Ü}>r’#Ã\·ÆÊ#§Çà©{ÊN¬xRwÔzüCûK°s’$ d{5P«¸öA©°ot£¨³/}t?j¿é#¶2‚`“XÇÄ,=tœù+Ê?4kÙŒÇR7_Õ,ʃá#Q w(0Ë@(e;OøòUWó¿J VxM¥lvyoqÀ'8fù®ËÏÞ2'?Ö-XØ-b¨82-†Ò<Ê÷Ä¡\ÐÔ,h¹ÜXl2ËÛº”k4&Ad ¦ù7háÎkf*§HrÚ»Úªâ`%©´ÆªÒèè#ñ*»”1]ÐÿLÁx<ÊN,4—’žck¶6œF;0Kƒ4CšµžVje?xÐìÄŒvÕˆÇm,mÄVDŠ´ÐM$Ì}MlÊM¬Í`Ê—RÆ!A ³<ñ[7€žÁ‘áB¤eJ+¶bhÌл-‚¿ÚB–E;=_C8¹má"Í•mf‘k PÍ•})y{¨8 @$€Í( ªædê°]Ô@Ð\5f¾4-ʈÍÓœÄR¨Ï‘âu;v"˜&½wìÄR—+yœk=Í&Æ—" °Ç5@"a¬šrí g4&Wl"B²Ó Ù ~ýĘÊ~Æ "Jû›ÿ‡¨ÒŠ=Ù«lô½ÞgMá ½}-AùCÇÝ᜔,Ì‘Š Ü•k”­(ÕP–Q¯ýB¢RKómNÂ2kbÍ¡lbï]Â?DÍ&VjAÉªŠ³ÐÜ¢,4‡' <!é­ÞAÃÛOÜâM<\¨K+°¼6pã7N]ÙcÜëMä—2ÍgÊU~)bÈn8kÜSŽÖ۬Ѫ¦¸ï ÍÑ,á:Þwìf©ŒÉh¾ÝáÁ:kŽ]Ù‰kná× m(NÍDÎæ1=k)¾Ê­ÁèÖ|ÖÑsÇœ®!°‡ŽÍ‰Îâ}G͘mº(mèéÜxl³Aþâ=QÐÿœ^Ù•=ÊM¾‡™®Þ;Å/ÐÈåâÂÖÉ~}ç× `Y¦ ëºÍ#<Í‘ÐÄ¥Ì}ôá•]ß»uÞ®ìOüë£ìzwK ÉçO Í:MÙ$ é×;,í£áË>;äã=1æÎîô­I’.î(>ð ¦>ÕC ANêÙ Íw¬ÓL!‘–ßô¾iîëyLŠ#ïáâµÎîÖ\ß®ëãžÐÕœèMœÊÞò_Å´ à9ð€³ÖnÑw4Mx*Íïg}Ö~^ßc¡äÉ®ç@?Ù’îÄ£>𩾇¥àŠ‚¢Ã牮ÇÓ,ày¬éØwô­Ö—}äO>¡\íÿÏðw¾¥ʹŽñÀ>ʾ^ë0éÛ÷– Ę1ÉÐAéöŽëµ^êGŽ€?(‘Ñ,Ê æ¦,ô;üƒoÁÛb¯Þ½«ôƒ/Ü©®æë>k9U… ‡Y÷‡ÁJ7kVžìo¯Í­8ò ø0‘€¿ú‰ú•ëíc¯ÐJÍAó×îþö¢¼Ö¥0qqQhaGU³ `M >1ænOò”ŸáÀÝ™«¯úÂübhé%LùDð^ß{¼üã.Ð×,»f£.kG¾ìð` áÓ:{˜ð£ûz¬ÍAƒ³h/Ü5­IÖ @!‘ E p>—ÅÉ` V/ÿÖÄ@‚ýZƒCxðĪ'Hë×CÖ æñjp«Ñå²\Œ œ–¢Ÿw‹ššˆ” --òN®ò2Z @ ÀZZrÖ̪ ÊÜ~r66, Ъ,bVóòŸš š†™•›™‰¡†Š‚ƒ/@j 2Z»Ø\C_~ðÂ!Âa· (,,\r1ªy äùžï1 õ—“‡‹ØÛ¡©«$ø 1 6k\X£Â  `ýÀ1 Ô¯€ÍËc¡Êyy€¨„å¾~Ìþåc´d' æ9E…Ä(6ØjÑ`À8Útxåæb‹ì `0ÿZ…NN«T­Ä¤$ #fQÀ¶d«“E @X5€Ê‰lÚ´X€1®+x[\€ëæ…D V¹ËS5^5Nó€T¯ÈS 0$6ZÌK–Š\ètõ…«æÜ˜ Ýâ•2\2ÆZ÷ÀèÓð˜,løD@h¶ÂI”ÚÚ¸^ž©dHMŦ-Ö­–y«½¤—þØr‚MÑcÍùe’†.>ž4ð€d5Å'@(V© 8ޢЃh«xH}®NêûÑ?-Ù?מšƒBbN­@1ƒ#X.r¨…‹RÀ;^Lòv6,yBÊb< ¤BÃ!4ó0>ôt{lJ ¡$¸€ÿ´( f¤@<­Z`¯Ðphᆠ –t0p!ò.4` 1œ¬¨"†×6P|jK+NÒÛ¬“+7°¥ø(I[xlÓ€·2ê½ jåHÊ£Š+Õ¡×pƒ´Ëâ vvär3-pFpÙÀ-Ô…=Ýt3•6\ ÎUCCБš4@É“½r*þKM@Hô·*ó°Í[0°…\ °…F3m³†­â¹>ÒH­©Ô¬BR^F &C4è ®8!%/ RlÛ2ðRÆÛÕÌ`3-AÝÈž;€•Ôv™çJ_z!É;`G€¤+ÿ•[+0@¶¾DÌMÂõÅ5xb¨x‚]«†-a,–₺ÔPÉá]­rxvÍÉ$°½† ÇN¸å÷ MO³Ey¤6¶§ÆËUÖõÀ‰'®f]b‹}ź Rg€´Àó®Ò+A˜ã4 ‹aç±Èš>¸-8h46ˆŠ@ÀeØJp $ð Í…¾¸ pB;N£ªôÞv¼ã.Ðò4ÏËk^í7 %¯2h+e &.¾ÀLDî’6Ï©b´‡]@ Pùú¼¨ír-@óN›H@p[äW…ÞÉ­ xÁp@ŠÔ`j G¢ò°‡-ipãÍø ñ• „‹«†üâ7\ xh!þ,g¼Øì!y"ð ó0ªÑbÁAજ ¦Xà ô•+)© àÉI!€¨„&òÿ–cŒèÅO~ùß ów9tûÅxˆŒ”°wUÈ6’ 7¤£ ?è ²‡¦©Ô(' 8D˜ÈXQJ€ü6™€|’k£ @<ŠA.jäaº©‡-X•\©ý‰jyI&–lý+h± I.ÁéÅËM€….œ@%iÍ1±$Å‚\ ¡g€–TÖ¹CB‘“¼æQU`eAb’BJCq3KC°¦Ã[.´„"øâ z¹6GÚÐh”Ø*ˆ'±b1ró-@…ƒBÇž½Ø“4›$£Í©i™ $z“¢ Èe š6žÑ…\ÛÿÖ&ý¥MÉ#–ÖÈÉ‹•` èÌrP$SÎQZSG™v‚2ä5FHFÀ.´tmcËTwˆµP5ªµ—…dÛ<àK¶±M<ðR϶֥†.#lAŠòY’æ#”ÊE©òð” \'OøÃnh…N«M {ÊMyËr~¨‘”«#%«õ›k%ZdúªN•T^¦z’T.¤£Kf&PÀ?Nkäa@þì\N@Ÿ[®u¸>Í_\'úY_:@s›;㺈»Ñòtk»ôy¥IÊFîpX<^£¯C ]ƒÔSøXY£d€ ˜[{i\¹ÎÕ‘(J ÿ¿`ü¬bÃmã°„È©ê‚!"ÕÔ¤r`IIªUyÍ%Âú*UáB•2JmÞv‚°÷7r#â·Zn•\sÞ[¬d$+æÆ†l¡-Å5,WO’–´€ã„k B–ú Ÿ(œÐ [e×øZ¹.YÄeÛE+À^Q~ȆT„e8KKxlbstãXUÊ5¸‰J³¡u”Ä•B@˜oNY%ËõŒK–ï\ûF`¸S‡C[E 4³PÍàÉŒj0ÀsÛF|¹4’‡GÐ" Ô@ ±›†´¦‚…'¸) ÁM9É\ÏÎunÛ’™ûÛ*Äï$¨M.°@¡ÿôKÛ^Š›!c0J`뎣„!³.*;òAÕòöÖÀÕ ­˜;‚s†‘m¢æ™"`Ì¡UÐ0`@6.À†ˆ24 l/bp %L¸™‰•j´!ÜFÁX³’¼*,¤G-Pþi5Za“Ædã}3½g—x ¶B ^ƒ Ô -pdÈ‚”•Oy¼Tܲ³ f¥{逊õ¡B¥Ðj#Ž ²ñø³ð>Ѓ LÏ@]BqìÍ€§Óp›×@=ˆ€ÞØŠdŽ!iHl\nñUÜtb«ó(™>3’¨Àö:]/pˆ ›*ÁððêWö ÿ?w;Ûápµg æ=02>ð€àóD…2h†¨è(2.‚,ÿV’°eú ZÇSldØÄ0›ÈHËf &›°M:ï¨BÝw€³€2ïA>@‚Ÿ¾~õû€è0‚‘‚"ð¡Pݵ4¸h@äáÇXk>‚¦8xWdw/ò  ÎÈØ…yÌC ó¼·Þõz?Úñ®w£ï½Ð‘Å|š¾þJ ˆB1¾Ò}$±„G´¥ {ÒÁ`à«Ï¥ž.iaD.È‘SˆúžOƒç°Å‡”iਠ&Dá£6®‹:eFf, Áˆl<¬Êì¨f@Ò«$öÿD¾j3Nf¤äl!^ /€f ä†â¶à( €h%f´¥z®'À@h¤eá2pc P® e(¼ ⡚ˆZÊäæ"`ï àÐxd.fàâ$âàpàº&pBüÊ-Âà5ˆpЬ¥^üiªag¢"I bÚLìaªøè’jlf€4Þ4‚…”)HpB 5ˆ²%)iĈTàU  v  é/œå˜Ð¤'Q3pÃîoŒ¢R.¥aº£Ð.nS@À #'@JÃÿfïMè %"Æ ÿkÆã/ F ¬ÑB®ŒÀCø8hŽ÷Tå)fÄt  ûÊ€(ÚàòAþÈ”–溲 7rPcÜh7j!¸®A΂ „M>L%Pºƒ0àÁÝÆããàæ)N Äñä%Á¬æFpä©’‰ ìfÃÞ¤V A0’}äã*„Ð#À$ð+ª^åËø1äãÜíiB½Ò|áj rÑcW¾GÏܬgV¨¤O!-ÐP~™NA¤¼P1bðK¶à¯âÄ©¯ ~¨$l’ÕÌêèe~Ì++ Â(¦&Â6ã;æAop$M†„ ìÿ¨¥ƒ*€êñ!à ƒè:¦ê/­#q°+J=~(²0øn0$…{²¦Æ2*êJ«ÐrIàáR–@ê`†°¬G®„éÚàˆd*`5­€# `5+`¢*ð©D ac ~ Òâêäå¤7ârG,h$¬SòÅF¢p¼êTÊ䦯ÑbNÄm Öàô’5•n`³p#¸ ™¸ qrâ äÓ!K¬"ÒH'xaÍLF^dD<¢ó  Ã%·k.Áã;.d h¯ÖNA5WÓ]á;à¯@* p@ó Ð^À0Ñ €5ÊNyHB€ŠÔÁJjÿ2-CÂ6 WÂüZrÆ;Pb@ (K-Î’$*e2³35 Û'WXMžâpàJ0âÂÔ@õ^s5É4 °k· cid †4#Š(däOlìpv ð9>FRVáÞÐ2¬f !„lMXô(‚‚4 Rc$ª`Nâ‚9RB ¾Áî&4ÿ&IF%Iä’È£6ÀPŽ3±àF¦Ø>¬ ®aÈÕV+P0b4X¬*®MŸr5iÀÌ`Kìæ0¹’(è†{³Òd.¦d  ºtV¯ +„j„$˜D9}ü%„°JQq$ ¬7ÃÿC4¤Ã]‹\/‚J¼¤ÖƑܮ§ÜMFeR{…Ê'±2 ò¤"IVá'á&¬°)v  æ2Ì,ð’Õ ÜT/­+_`5Õ¸Òj'q H­"{óºÃV—­²NP~ØFb*ôEPS¬F<Â*% Ay¨Ö(fdc–¦7s6_àƒÜ Ðà`6ÿ °+- ™6Ñ™ØË&CfšXiøvÅoÁ¹QôæaViGúÅ6CFÄue‹¤ä£76Ej)ŽâÐú.t1Þ‚#4àÈ øÉV/…dÀãN p]À¶èH0>Fr÷DF æa®dRX'lVôFxAr-‚m<¾1¦“  Ža™pZ¶à^ƒÞn‡ÂCö‚µhS¢åÜtˆ|DÔ™ÔÀSÙ¬åjD0‚óao @`gu$wi䃒) ÀC­ '6£LL€<ÈYÞö]„ªŠñ9Ú@tm%HÀ 5J#î@™ú 3Lóz àÇX#fa1²kAâæÿ­Â67ù p`¶†¯3œjiJ8_Ùâø÷GðõAò€–Í`ˆlЙ ”@a™Ö,Iâ­ñPCv¥oÔD‚<¶j#,·ÓbŸÓ@ˆ°b9Èc(ðéØJ)ªzSŸ){ãÌ ™Æà3L ”&U=€|k•j ·FåQ|²°t«¨c(>È:DÇ`@ Ò`3ÂaÆ @OJX¯ç~6#àè)•:äBN`Añé…¤V×áRŒ:CE*´sÄ\6€ÄÀMÝeÅ^'ÐU/Ê1!¹õJþi@lPó~¹ËºÒ„Šfò‚ð¦«Ñ§Ú÷8†Ý8T³ËÃnÉ –;wLjz.¦¢6¬Ñœ‹ºs±™%GÊ“¡ƒ•Œ¼@  í’õD¹}Hb&B›Ê²Yòíh*R—…)A±Éï ¸b¦¡ÖÛp¶Á@:¥àh_ùÑ€œûCƒl#æÀxçCÊ€O´8;T ¢æ;‘îÀ/Ïþ`1õ 1 ä¶ÃvWöŽÿd®ô~çÊ¥ùÃÜ¿òJþiD‹Ç+9§¨9]â™N½5_ü­ŽTÖ…OdVèíݬ¨¾„…n„ç‰b½ÞíÕK1& l˜ÁÆÆ~ Ò ½²†ßýwESdkh‰xm\Á±ÈÆO½‚âbš™Ý¼0÷‡“²/41|¨F ühøa¸7{"ÛÝ€Hx{QÀp þ”}(c(¸!64‹V¶ Í+¿<ݨc á€\“y¹xÂP¿8ßd®ôýòùT¢CrýÎÉ]Þ©@]9gÌÝI u¯é} ¢¥¢5:I”¨»Hâ£ÙŸ¾°eŽÜÐúãOkJzÍ Îsun*‘]YlÆŠÉÙmÃúÙvV,a€×ÜöÒŽuG*«ôÖaaÔxÎÉf,Ɔ+ÈŸ]ANK;èÁ@síÞûðAÒ!¹¸X"Ú˜ ˰q‚‘cØ€b°@N~Ô|0€\’8‘|ÑÀ/•ïÖò ¢~Ôp0€aº^ˆðì¤9å/Jz3ãTCåR€\“ü¹íÎG*£è•Þ€ã!•où`'r@˜ü×d¯Á—Z$\9iÌA µTéÂ+â T)¤r¦íÃlÝÙƒŽÞÑ:Þ‡¬´ëZí|ÆËô ©¤Aaôˆª;&?— 1c€@ 8[Ú –.ôN¸tå³ACKW%éF… ¦¤¶ÈH6y¹á“Ô§HÖ]÷‡ßEµ·µ¢ë=:Ú½G2á—´€ÒRÉTIPî(’ƒÝ¼0yêÀ¥sg—ìõÖˆAX@^KŸK\®å=LmÉ>ž‚»Ópú¶ÛÀ/¾`íËrAë2$´Te$É.ჸïm†>°ÁÒ!„à”Ì&¼8à>@0ÞŽ†éz#Àp ^h±ìù|¨ÁDý¨ãÛ a¼7’,a©”så¢;à{°:¦ ,Az⣀âÕ¯¨72Va3Û“j¾ÁN1 dzノÃYV:Z¬êL¦Š˜o‚F#㜡 5í=,‹[Õ­Zõ pT¼TîùQNlƒ0‹©=YLªU¦íPj®W`œZ¡Ë­_L£«U}¦•A’2¢j¤£‘ëP#ˆ®–²ü‹Ö¿vµÝ?…T}C©ID/”ª”ÂÙQ½póˆ@æÙŽuÎÇcÅ9Yö¸å¢‰9K˜´ÔÇ*T™×SîÍÓ"Kðû¢‰xJŽoïonw¿‚± ‘Àx ”Ñ8Ý9¶„åØ8‘x¡!EŒvã×$ȧ•X)ènÅÂî š·5OpFh ‚:yöp$©¤Ü˲2™_£NsÙ•i *ʆi¢ßö…äf–)üˆžãÓÚAˆ}²ºÔ\\n‚J»ViðÞáÓÃßE§V*6‹}QH=S¥k•d§RR˜ùY¤«'”šÐC4\PôÏQŽ ¾ ¥:<¨¬5˜iÉM)æpeÔš§ÌV×Ni•UÝó4«t¾Êáh¦ŸçE%röŸm¨‹.ܤ]EÃB„mÐs†1κHýûÂÃî·Þ9¿‡ð^±šnÇ+;ÝïbžfZã¨SYT˜¸§¾@\²t‘ ẶL*& ÊB_Ž Ï¾ch ž‚Ö.ôëÛ&óô·_ ÔÊÑENçs¦ì§Ö‚Ⳋî,RŠZÈãGÔ/`õ±£TÞy¤½àáð 2 iµDÀ]*Ý)v&Ï/)ãqZÈ%§©é^W5ÇÊ6Ï8a¯CDhÄà³nl7`ÔÞ/7~s{ȬF¯î]sã1¥I-ƒ®:ßíçOôpÃVŠ7%5<àU=JÖŒ¥ Õ{Þ òGßE%eeÉþ]6<×Wœ~ÑVtjýRY)y0Še&ƒE˜è´v³,fÕªI)ô– ð[ЫµU3"3#ëè”ç'±iSD »~]¸çiyãz›O ÆÕ*€=tM£Uòþ#aV_ 9M7#ڊƺY¹F”ý’£*£5›lhi“©“ú<4¹ =’r®Ñw¡ZÀUÞhЈéê0¢¥xZ%a ­U’5N+5ÚÊ:–ÀàÅœÉK˜S])6£cª8Ëô”„ßu¸Œ¬¡áº}]<¹>æ_WðA … ÈÔÞÑœ±=o¡Éjr9•úîiÂÕNÑóíÇ£§ÒÝëÁQÄ@y¡6Á]>©oE:ü1º¬ª™8¸0Þ½/zoIëM\®U1¢¯R‘Wj–C{õ.‡‚7£Ȥò$õî£?Ý)(eÓ¯7èã®'Vjw'ùjÁ\Ò¥+TWÿ”\×Oèƒ-?&jÞÇ&œ Ln•5¿Á2HKêåŠÄk쩚HšëžSt‚uUV舎ёC¬zZ§N9|æ5†¯ªF Ý©g—šK<æ$æóq-{\* %žèÁÿ ©IxÇ=MC. á–`’¯ˆ¿Ó‚[Ïëjò¿àèù_¬U—?Û¶âUñ¤€ú·o^WüULSÀ ‚B>‚tEk8y¬=9¾›¬…Wnê²É˜*¨Tê‹›´ †<µm“dˆÏ6_š½)Kízýþ ÇÞJ H+Ń:x4¥!ÍK8C‡N˧—~XOlg¥Ë^¶›¼bÝâ3wI †ó],¢‘Ž“Û=Þ¾\*¿Ì}9IÔÚMë:†47MÜm&I…¥RæJ5EÛê! Fyª˜µ3¼Sta¼X£ ¡§ýßõWðÞÉ茜¼©z:%Ã2I€@q‡µ-ÓZÌõS4jEHÖ{ˆ¿´:U ~_£4zÓnÁ±¦ƒÞŒ;0\d鈟d8ä¹ ë½0tƺNŽ…ÀéÔxCK j¡|a)4ýhéY ¼rÏßœU­k†\à{Xnªô 5>BS‡¾ZK.›«U¸«Ð ÙüîiV9Ú?•k©ó¨OéÕoMAª Ö 9Sã—;~Ʋgn^Ц#Äu¦( qµ¦µ®µ§ãjT°@ ›ç(®Ù×¹¹³íH{É(x¿ª;¤(îLJ©é>õª Ýv­jªª•79Õ•n1cQB󡳆ïLÓÌR—©²jê«9¸2Uô£?›Yñ*x1Þö;Ä+$³œ›³çŸÏnOå¬ÖÍŠId2uRpë4I˜˜ÊRm)ÙÇ\µêúü6ùªcM^I§«’¼)0féªYk:XNeæÎ5 ³š<ü½\«íòÿGÕgÏÇée•¾YPt’Ê›Špe;âd±2Q5±¨Ì{ìñÓÖ‘ó}Ÿ?‡‚«Ìþ\iFâĪ|R©] e/íÊÝÞRl ñãÑnjϕæÕ\Áç=gSÑ\Ré4û(´….½Ueó]¹Oàû’ÿGöÄ5RR¨E©ô+rx.–{QMÓ† &9dŒë‘á¸hØパ€@ +ºëH°ÕúN§§_X9U T‚Å2•ì–»ÝHï@Ž®Ðkz²÷OÕ‘áêtÃ4—›×§ÜP/„#9¢4åN¾²­X›vâͪtF“fí› Ê*©& Ÿ‘ Ù|¢«Té:²¡¢ª*‚©qMIPrØUʱÈ*‚p’tØó:G:ÛkqbÑÞFQ:áÕáón¥›%²f[»4M«iÚ.‰[¬ÓtõOUq›¥8ÓÚµ432 ÖYº/(çk—™(ÝŽv±±RÒ:YΚð\kGŽ…âíÞý¤sK!<[)%tfš: “tš5nh3hÝ«sšt’I!H¦ÇtlÚ€šÎ ¯À|x޼sO™Îxo@xªÕº=sëU´ë¿­*^ ^¼X “îyh6À\3‡•EwY IÒ8ÊŒíÅÓ²|)5^êç"IQiíhûB¿msõ– ?WýŽ|=£†\DÞÞÞwcBË¥n$!hW;&VWV{„„1N7b‰l;cH 3~¯ˆ‚–ˆÆÆÆÎÎÎÖÖÖ ÆB^ç½{ƽÆÖÎÖÎÆÆµ­­œœœ¥œœÎÎÖÆœcèè猌ŒÎÖÖ"q<­¥œÿÿÿ!ù?,ù´ÿÀŸpH,ȤrÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿à°xœR©ȬJmËða¹Á¨†f÷xÏïû‹)>,…!h)zV)+ ‹?e!g>)>mz‹› £¤¥N…ª…„mX …+v²;-…+z+*>ÀBŒ¦ÊËÈ+6+_i±6e+;°! Ó*Ñm…… Ž;,Bf+ÓÌüOežÿ"½b’Aˆ ¤È0‰¤ElôIœ˜lÒ$Ò9Ô(›™HŽ6IX¡Ð uB¤k¡Rl‹Vø€Ô¯&6 h !„ ÿ-8Ñ7ì€%„X ¡Áq' ë …ÊUêµ0ªéÈ¢HrIŒõ,QÃ*šj9@ÕÁ# O¹1³ÊG­;6óÙ¹‚jÆ„ ÇF…ƒq‘v°k@‡cyÎ ¡U@"#$Ä À`  ¼ÀÐov@`IEåUA³¸ù·‰˜ ·Ap wˆ:JѬ×KT%*Xظ³¢²7+lˆ¨!`d-o’BCä-IA¸Œ5(„aBèÎ.\D`Ñàv¬õRõWž.ŽðJèÊÉA t°N)@ P ,lRœ5‘¥B7x1Xœ`¾¥Âÿ F‡L ‚B@Õƒ|À( =öu‡Ï3À”ãÀ Ь0˜Šù°À&*´ÀŽ'?´¡ÁšØ¸à!‘ß}D¸v€>"–‘S TbL7*ÐÓB1,"p†R ´^l a;D£S¿a¥ J®EK/÷ ƒ€îaŸ #KH…`C!…6Ù€S³ç”E¨àÃ3nüXP€³qÊ ´Ò¦ ÓB$>ì N¸9‚蟃1 –‚ þ€@…"Ê1Ì%-@R=1 @ˆ*+Ú°`*LèC“¤ÆnÀ4§-?°Š‡…0ÙdeP]FhI®SjšÿÂŽèc,—F ;Ȉv ÐÞKi„¢Má$nÁAƒN ‡„#¥•øö:"Dþµ AèÍbÅ®D•8ÁÇl€è Ìf DCÆ¢••…SÉlÇ”e„ƒ€5´P@(¶ƒ¦ „@|É]I`´¹õ,Á •4¡ž…´–G–ggDú°³gO:ÌðV‚© ‹ï\XHA ì ”p|‚€4ÿHÆ“rÅ;£ ¥:ÜÏNá[§>6Øñƒv„jLuŸ¸²ˆöñàCnÔ²s»`Eð¹Ë%³O“€tuÛF¢Ãj°2 ¤ÒB•[R‰eoã¶ yÿ†«Gs±^³ܷYZåLܸæÓ ¦kn„{ƒäjLÊ ©Îo=h@àÌ»érPëQ÷×V*u‡}ÇX X8ðŒ L  X ¿-d\²†F« (ÜœÇ.ü ¡; œ+pPd Ec—Þò‚>#œáH‚ñ€J¦¦Î¦g+èÙ…f²'K°ªÐÀŽŠ’IeÝ+t#¸dDõ³"@óTe8+ƃð}Œ„B…®+ £²°Ì«v˜SF@žQ5ûl1m :¾vA`]X¡R,#ŸŒÜáGàr†p1(ÿF<8 ^@˜@¤üd$P€Ç¢l–â¾—g]háF´€·EàS ‹`‚E'Øg2^|Dv¹44¬'ÏøZ!äQ•´jªx†w=jzDI1åÍ´ž`BGo>è•ÀOªX4°³ÀÅ-)`¥ {3ÐV 8ªc•D äq" €b.T±\:N¨T.u; ‚wÄM%»(•z• E‚D²† ¦Ã>»ÐG¶äe½ÂWœR$`"ÈÁ?èè”tFû|EO;£¸"W³° µE™ÿ!è q¸…H¯ùi'2 d\€–~9@ vÏì‚qTÍI‰!€<îˆCàÄиQ¹­ÈeÙåÁwr 9 Ó˜SŽîúòÓ(Ùÿd”û(ЉìÀz{¢3OµÁ?÷̧Cñ9ϤUOµk0#ð²1À ,+0VŒDÿÑ€ *q€ìÌgÈXI+.¯†vºKçü [.gÑ%ùÀõƒnH…p¬IÍ0raüUÓÆF¨8ÛÃâļF [§rOU q4_UÜò‰A@¾˜ÑWqÓ›4âÓ—Ô@ÿ±šÊPN8³%ÉQðâLo¾¹ 3æ•7Wæ+Y#NÞ!„S‚< ëbQK–"™Ú„7,úY³•+™¢ ìdˆjPR•KLz ±¨]/øÔP>UŽ*È£VW! Ô õÈV|2eÐnTù/X‡Ï¬ðæ/h`H6.q¡Týõ 'Ã`ÏÇ^ØxÆÚ+i –¯Ü¤`3;,dK䥥É'@1Ûpóa§Å#X×ЗP…q q 4Âr•U¦À2À P4@2¬tÕž¦Y§ ƒm€©èMpʸI Ê%q(CR$å°c!g(—ŠÖAªG°ž<ÐL0pÿÈ‚)÷Š óà–°À×^UÍþ‰q=#Ñ;›ØTjUÜB¦9_•(ëæI=dhN‰F¢|Y{®â¼yÒ䱃}®{•ˆ\… æ.±B‹Pl1D÷81¾M3/xÁpž(ÄàÆmzéwä ø@O‰Ó[‹ÀƒA fÅÌ(H¯~³À… f²›/θ v¸ïž†)„4-÷¡>‰i"Ĩÿ»'BlãF,êʪ²›R…ÓW5$r(Ý“å+AB.Aë¿rD9×xd-üÜv)àÞÿ/&™â.„òƒBMvñ©24é€s‡`cÿ–G/ïÀJ½!5O²EIõUo’Å þÔPõ¶ €T:Ç‚§å‚€ Pð=p¥Â ¶Šà2 !«ÀHuWM2 ÷^4"yFè#8þµ°ìÔx½ÑGdÒ6(«¢ ÝÀ U´h• 1;@0æâ4-&bCt«`p, jY±'†Kv¸ .² §•OyøG PL Lî3!j`µp5€À 04Cñ‚qš²:‰ˆÂÞ„ Ñ)°B[”´Xøç de„àNä¼QBÿ%iû‘GÕÖœK•sCÜPð`òÀ»yÿ)ù4#¬5öEH…`@Të1?,ÐdŸÖ‡Çˆ6U5S€ÁÕƒDÀnÁ%þÇ%w .ä¸òpŠ#Ôý¢) |¤ô±6Öq÷“€`6°^à3¬Ã´‹P3jùt|e40•1,0pðjPo$w‡… 1² &~¬`_ÁÈ&ÐŒ&À‚ð2r馘¡ƒí°vWý×9ŒÐ@=´D7*1?v!yãöÑ1´$ òÁp¦„ «@ ùi´?®r‚A¥t@ÐPeÕ‡0’EÈ Ëd‘ª ÿÆHõEH-€£æ><‚/eBy8GØT3<è+Ù‘;Y’?£7?a-T{a T†ƒÁŸPµ´*@U“7FR ƒ%à"TçU9ÓÄ”zâKç•‚YµZí“ ¸¸`‘'¸?Ôg‘øšÄˆ–ÇBs·ò˜—° >A+C"¹a%äóiÀ9ä›4“kÖfž]yæ0ž·28ˆ/ °6^Ñ!µ ñ1!t5Éw^óô0ŒÃmf™O` ‡'XøC_ë©'BÄ'ãKJA‹k ƒi)´3óteC:åqH,á>À°ŒC˜®Ñ áP\ÿ^ñKØM$j])ŽÈ ÑŒ´‰Ut„VR ®ž2àˆdd6¼¸ •°S»õ)~tÀ)r,n¨•©ðiZó WǸ†- n7jC‰p@l!}ÔŸ.R: 3Á#ã!oVVÐ%'&.&B*(&vìP¡MÐbøP¡n ‰pŽ ˆ²@H´9PMÑ+¬‚-þ’<ð(P©B©8% ôVvSŸh"÷ç¿×¶ø†è ,r^Ÿ6#(CIº :&X”“:ˆÔ™ÇHA¤-P:õödkù_° ÚWZ÷Wµ .É€q"W{å¢Ð  ÿUÑe߈1ºÓÌh—62ÈaJîóyµuÛ@/@†ÄZ:s1Åð}°Ôi©,ŽR,P9–èñ©©ei‘:6j'ô©uÀƒÂ¥txÑz‘8‡HиT"@oðÔM !ø˜OÙ™S*¤IMV_ÁˆrG"”k`f%.ûPõÕ P­Ð=4I%¯©©ro¨áO~zðs¤i‡#6õ©"B×=;§‡êH pHĘF8·'=tZªáMñv o,9“‹€[©D7?=»¯ŸV´WÚƒ¡e@.oC/RN†ž%#0r£I¥â‡ÿªp )D10ŒX,#· El¾$jÔUBA¶\‹U#ÙŸÔW¬„€‘ªŠÂd械fꉈ2‰gú¡pXfðùEHÅø©Z* KÐLγp¥cpL¬À#`¸/àGÂÄskñ@[ÓD©0»P°?Ö–©7*t­›¤æñ†û_@ZÂdHEi©;4\¢%J™~6-úÀ€ŒsZ¤QQXÌŠÈÒÊ‘gɇ{È10§2hz«'í£$û“Z:#@·ºË“r îSoçµJ+t)K~d¸]Û³1(#¥ÃKØ{ZÆh¹.0ÿÊ!sä l P´v4ðj‘À p,~ä"!‰H2’Á"“« t ±C± œ±‘›±_ø ý« ßV£©0õÖI ‰¤÷[~ 3*¡ˆ …6°5ã!eç¥hùPvÙ³6|‘™æÁX‘ilY¯£;zV¦=n£ú`Å4àÀ -z"pi¤~„±YúU?¢¡ã44•Ç8,Lòv ½´}lˆ?t0PzR@L9j‹ÃCŒTæÄÓ´¨…¸Ÿ©hŸ9{Œ§å"ÍÈéÇuøZ_P+­üš,D‚ƒ7òà¯IGõ ÿÇ’XÈ+ÀuWÅŒTÌ ‘÷$­!ÿÖ°¡€ qìÁ@T­»ð–æ‘–µ£¹²9p†¬@®÷[ÐmrX)ò–ec :’æ"O’·ƒH„Ëq|‡£¼¯V&#´iyð°~4!Ò€@è½Và Å€bú£/28 )0¢ÉíGm©žàfÆ?0Bxpa pBXa¹‡Hеij–Ý£3ÿq0Ъ pÒ Ä‹,¿Ø,1°¸‡¥¿Kaét2•!…3¦&øˆ\—¯Å5õÊ 0’"¬ N&/à/0CM4ý|'á 2Þ -ðŸhùG1ÒŒNVͨ|BÑ- lÿe* "À àP,бÔZ­%PÐÌ +‚Bªuk tR à'^i‡ e.kÒ 0 ð@_ÑÔ!@o#ˆUlª±¿§‚§cËöûÕVV©B4Ô„ô:„? QÁ±n·j/³÷ˆé‡øFÝÐ)D$y½hi›˜œŒ`”i`Ç‹ó¤1@Z Ã= &@3P 5FáKÚ¼Z U,ppàn °ØÒae1µ;Þã e ‰Í ‰Ýð8ÓKKéd‚YVFBš¬8ÐkÉ‚öI}O{Ú! ·¡§Ð€ ž„ÿ Ð §áy 3[d• ƒ‘gHC}Àǘi~ G1™NÙ ¢ÒÊ(?"àø¸•ãPß=PΗ"ÍÝ0pý] Þ‡­¶pÒØ<ÞéÈãíÚ!ä9ž„­¢F0#`"P8ô¬øb$LO–~|LÚlYðÂ;lá¸JÀ ;²b]$ B²|š Hþ_2RùlÞÅŽq'°'p5 Ö PÁî[¦áP Ò‰¤*"è½ãµ‹ã'Þ1ÀÞ@Þšê)ýãJžä'½I±m ¾¨)Ò:)2!O> ÷·–ÿ ¬'N6¯^]_†DÔˆ”ëxî‹y¨³û¡u´`1|. ^TÇvà2˜Ìôc¹v K wª“e€x$¡éHGÂÀ: a.{X2cn Ý9°éÐxy;§Vœ‘z2’|8º;d?sÆ@ ‚«“é<žp8K¼ §CH†»–s|‡ pçŠÿ°Ä̆šQÞ–˜[ñ`˜Ïq‡V/¿« e<®ØŸ>Þ<®¶ã䈄Þ!ð1ÒëU¡3eôg>0M(8õ çËåψHÍ¥s¯‡/H0b¨SX%Ðü­=f§P-îË 1óm†Ÿ©×[|¤1Œâ”ãÐw1@®Î ©Ué@¿kÙ>¯Ù‚}ØÍslúT‘&mÒà„mÍUƒÊ !)@ e§plØBIH €ìvÿ׆#t`I¿Ãá•JX”‰Ôô‘|LïÈ<ò•~_æûùP0Î uTR~W%'S"«~*SRT$>XìÎLOM(öXLM!*R4 VV@Q¥ø¤(â$Z XXrO+*$˜™ˆbb@*Xb˜cô˜M«ÁL |¶¶24¤ZZtOvJQ~ÑÎ>0öMÔLL&L@öMÂ/1„H‘FN“$©X¡â"N—*.R!Ù?{Ú¢ïŒ*)kð ÷0…ƒ‘§òìh. QPÒ Il €>k†o$D@Ä ¥B€„€ÿàÀT‡2§X¬#¹U/0ÿôèˆÅ Þa}òÅ t£˜‘Q"Œ“ø˜{·®E;_0(È£«MIT"_JQQeE†´ÌÔ3fBÛ`^Úõ× ¤ ú,Z…´%uf:³ÓDz¤CíʸžÑ &ªƒB|@ “ V¢¾0ˆÀ`ç)?ªP`ðâÀ ¬à Q@í˜,qZ‘q¢¢ –"¥+pIiÏÄI,A{§ëRbtеÞX( 2f³cNY…žÛè¡„ˆÍƒ>@­ƒÖ ¡PŠ< ‚©¸(€¤÷‚ ·X  ˆ¡§z(xC0 ÿ$vÒc§}Œy¡Åž`‚Åèb8èR‘ô@"Š:Qä€&7ÚCŠeœï RVDò„*<ÜÊ=0ˆ…Ì03àÃL¡l‚{’JÑša- ª‰-¶"€"¢ÐðÀƒÍHÂMƒ:È 1Lqc¤@Ò` ^yc‚²z©±Æ²0XãdH”C2È`® QÕ(MRÈNÉ 8)‘ZÀƒ 4¾o$õû` +ë"·”vù@4m ³ž‚Løbšbx!<­Z× )§ªMPSXû° h ýÀ8tÐíTR Z” E¦Œ7” ŘQÿ*ke‚æÀ€OV˜AKR¥«NÈ¥º¨B@ô$ð`CÁBIŸ+[ÉìŽÎïBÍ€*+ùXï#l²)3+GÂÆ4§hvªÏ>a«¹ælwJ Ò* r¹AY ´aGƒ¥ÑeØ2EÙt” ìÝøÖÚ#øú+0 Àûƒt†ˆa 0…Ü\¨’ƒ@!e€QÖkA°S\Yo FAņ[JN¹L©‚½7˜–éVçšK{†çÇ`¡o*¸ó £ßhÂ:Aø z³.¸ˆì @ ÂõÊSêƒÒ;X·g§å•‚ (£L²Ë–Ä´ÓÄ ÿ4 ÇYÖÙ@ZGºzZø·KxCºTWç¾ZCæÿ|¥œ ø\C'^$ ‚CÞ¦1‘ÀlÐðÀØÀ¡îÉ ´À¨À`죓[I¦ ¶¢‘¸Y˜Š)öõ…ÊäRxªF¶0¹´`[§Ù™SÞê ÑDˆAˆ ð°}¸Å+¦hT?ׄ¡‘aCh8€ ÐÌ’k™TéÀ ˆ8l‰qà—:`€\E>ØÐv𣠯bkò€DبƒÚ¼ª:pPƒE¾ò& ¯ =Ô *0‘´z  ÃÆ0𱫫õ£LR œþ€ŒöZöËÆj¸Šð!0€èÔ)Þñ˜K*SiÀŒ†ÿ_Iò"*¯…@4– 0ìã¬@^ Q@+ @…¸Èl%‘‚Ôæb"2è„ €ˆíù ‘¨‰ àó=Àª×ˆÆƒÐ-6øAÛàÑœNe)3ŠÜ€$_—J©"›c²ÙäpÞùY¢c’Ÿw<׬”¸º•4¡V­xÆQô`‰uˆ½’|‡´J€$¨!a¡ÅÂŒùNTŽñ°Êœ?@x@‘Š,@pce¦4Ä`AmÐ -TtBˆX¹šƒ¦ 8w?zXE{d 9¼ÊRꄯµH:y¸ã°Ý®N™8j@TB ÊÿL'_Ä …A¤p„œÑ9~I„£¶¹ƒ)XATc È–™…6 ±š.p5&;8ò!€¶h:ÉÆÌ˜§´ÀUæn¡q SÜÇéð& Z6Û“ª‘¹é…9(N£ ò_%$A$ˆ‚*äjGuù/%­£™£5I8 Hñ ¬Å#6:S Iƒã#N(€8ðŒ|4Ôç°`R¯…Kh™0¾²ÀWøâJ¥Í¶µ³m™ÓV|"x {Ǭ aêe®‘¼|]èh\}'’®H`€^PƒqÈ —µÅÅg«ƒ(pü$&ñù>®kH[ÿM»Aù”V˜÷ðáή¤îØ•ZDMÙôºYà-s«ÛA>#'õ†²4G#š/è?WŒr?x8uÔþ€~ÀèÙs`U’{ WvÎ vˆXxŠMï€û6€Ï/wÇ ƒb¼y®È±=J;í4qÀRÍÈKA©QÄïï:“Ms äÇ ˆQÊ䪓;ÜwLƒ`n§Ö‚†jý¨7ð#h @¬eÐÀI†@B]à Ða½UŸ°Npë ‰Òº›ÜòúÈÀ†\ UT@@ )ÁT~€Ð` ‘¦’(é6 ?@¡ÑàaZ V@lÊW*&@pB+àRþeì%G i:ÀùEÕ Éh†¦ f£6M6BÁW²ÿ©»z":ºBRàªý#10à,r°Bñ À¬ïéР´Œ ¥Ò!¦6Aa”DA"|`% ˆÌ§ã0ÚFj+Zà",¦$wjpÌWþ)0úÃ!j¼væ©Ü v`1T ‹%°aÝÚ!4`L(à°d Ú vr€t!]OÒÇŽâžC:,ƒ `~LåT*bØf ÿ" ÀxŒ@×ÀJ‘Àª £a)`ô†+baÿT€ˆ`2×Ð„ÅÆÏuòCVcÓ ÃØ!+Z€£ùŠ4¦lÊ’€\b@•”GÀÒ0+yÏQøFá†ÿkq¬O *#:0À²¨t 0 ¡ ‰+AžR¶Al ™*¡bˆrÀC*Iø„¬<$–.ˆóPd©yZ‰®ªHW :£‹Âk)F↦HÈra¾v Þq™$ Ö úÀ'%PR!£'P¡^‰yˆé[ Eìá`*1kF þÅÙQTÀˆ¤™D,pŒ$/¤Ç£âIôÀª6TQl f "@\‚o¤ $Óe¾mJFb0ìh-8ñ£°€Áßê ªjÒ~£þàÎóg àˆDϸj¨†åˆÜ/…<€BCî À5ACýò ^"ÿå_Úb•ÚS^–ÃL‰.îÁê¢>XÀØT ¶4ìR`h°à#?†38°ð¹¶"<Ža|–Ó$¥|¬+д9òAÜÌð8xa›@Àçþ36b``ÅàñDþ+ <¤i¦C6`ä”G‡þjŒìMÙ@N‘ `) 4‰(îh¦ä± l(íȉw’iEo¡05Á:H|€F5Vj€`¥°Å„¡ìBéOÀÀJ@"G 'ªIkFAFÓPãJî¨ì%w¤d‰^â¢zŽÝš¨6È¥ B ¾DÀ ÞA ¼êm„÷pï|H3ä0D œQ'… ´–biÿƒñÞ h0:À¦Y'à,Äé,¨“Ø<Á'ݬŒ$='ÂØhLD(îdqølÒRHY< s2Ë ÚÂ^øÌý„Ï&T'Kšcñ‡ƒUu&£FÕ…Îà7:Ä và†jcC‘”Wï±Æ¦í2ELÖAÑÎH+¿,j„,` *0l®OˆgE¿3Âð¯`eV~ÄTfJ<hL=L <Ï|I­àScÿ@: @ÌÇe^ nHÈNËî ÃÃtíDnäÞ¦ì\#Š@_áAÕ¾@PuRK‘Êî2‰AMH÷”‹÷"¨0R!‚ì´+¾¯š°iœl ¶dœæ€Tàªÿs@ ³FIÄLÅQA²@/š ˆs0#‰ŒÀYæÐžÄ>ÀÖÀöE|Б¥^ ÐL3wsÓ„ã¦ðºV×-7H7”â6¤ ê’ ™Òd¡îîñÃV £ÜGØ@"‚v@;Æòf õÚ¬âJåfƒ ÀÀh Á,Ik=@?š†$&‚2!&$€‘¬ TÑŽso‚|ÓäºÊîmxô&ÚÊs7å4Ñtc+DL@tã{„sûTIwl„phúSÖƒzKl2͉P•°{” êâ":áŒD©Ží©(ª1”`iCiX xRÿà ÌpOí­EbvW×—sÛjÙ¬ ¬&ÍÚ<àlÂXË—aD+š’÷8fêðúpÃVrVñ¦‘sðÊ‚"ÀN5?òWÉ€1 3Ö‰aS=A²U;þ¸õ|€©C(5Ø®?‰$PÄ.ä…^ ´¸ä6Єg1wÙÔs3ƒRÇôÏ*àB/t€ )Ik' ¬H¬%qxû&ŃŒ$lñczøš£ W8¥LøéR{¥^ ›L 2 T8ÿ&{i#”j„fxé<  D€|.“’kQk+¢+ 0À²¯ŠÈÙÒ4ŽÅðó8ÿNTHä() šÖ¹’A)«W3çrL§VÉcb`‘! 4 ™¤îRíóÜ@ fd^ÐYebZ' tàM×€xÛL"âQ¶Ú6à`¥& `šiV[ ÜÈWÝÔ;ÔíÐ`7:€[À €´w—møx4'2I E7DzŠh‘E*iL¯W€€aE¨Ù¤!%¯Ä8Ô*‚Z‰\ÓF‡ŒŠã-{"‚ʈJKJB & *ôÒâªólA”W DmŽä"ævÄm- îë\ "¬£!â\R˜gûŒ4åÊcP2J¯ê.––(Ãííl7\ÿ0wà¡ÈÓüÒ¸ÖÎhWÄ‘ Òcu"&ipFÀ:J™ŠÕÈÀ*l ©šxŒÄ:w  îË–9÷&“$x„«ÆÞq‚ie˜©>Co3|…ˆs‰rÀJ*#’ޤ®†+˜CoLàšƒnLÁt°Õƒ§n&øÓåRôA:Œï,``ê/R@hjRjà[‚1_ê"&BVj0kÂD¡wCÞÑJ«u@@ I¯ËeFN¡ .­’aÚ'­Ý K0®t»$¬‡Yáª&q§Î¼iz€¡ù#òÅ£ƒ2Ö¸=;`º ¹íB„/Œ$º,=üÿ͚əôê–Ùªä—$ô;@Ï á‡ù]f3å˜T2¹ÜRBÞ£b·2´r®Ne³ìT¤štìëÛN‹›tÊœn ú¡'¸‹{§C4±I4! 5º€\ÎF©úVÀUbhÀHlP¾%1HÇ* P äFó&*v+¯$$‡A?^“n‚ûàJJKÞã˜P!‚æ ê`ŽÓ¢…N(nJ"÷[n¿ { 3öa”ÀÃÓ¡à…zàGtàÊ=¸oí Kµc~Ày! ,᥼€ ”dʈ¤4€¸.éÏ^‚F #%ÀðyCIAÿu¬KºNhˆð»oŠˆ)o oê» ”çQôpRfÛã/Öš§r0$`¨Ö–j<Æô€¾´€ö¢`ª`t2ÿ€ƒ‚c‡á r ä´ÿ‚¸åwH^KN c*O‡]äÉD!±>Æ . C×" VÁˆ‚)`²È@'1d¬´xš{15àTV`´û<æëßàE­³>8AX€Á8¡¦¡“†!.ËÖÊQ êé{+3À HSàŠ ð\œË⊈ÒÔК‰b}JªDëÓ*FÂjÚ󘪎ψoQ9Ú³Ò~ÚèV\K?0‹›“ž‰ ‚ë" ¶` 6Ä4`Ø·^6ÅÒ’Ý%á@ +Èš‚žÄ‚R ÄU0CPÉÑt CÙ&ÁWl`À…’D"°ÀTS»5³…:¥pC d°Ã0¶Ó†`lÃ<àÿ+MD&lC†L|` 0À…[õ°p¶ ÅŽc}%qAPÀÅxkP—{Pð’H˜à‚-€ÃŽû1°¨ I&³´G(¢' ‚2™,àá²d9ÎxpÁ¾H“PùT4S<½ÀÀ¢S©QcÀ‘M-XyÄ!r) F[0<ðœL?²y¤ ”)Бٹ! ˜÷‚˜ˆ4·„p€d2*4¹iRÆ‘ÜäÃB=bu+ß eáÅ€ët+A$.Ag>„u"Ç*¡£èÐ@ðâT`§¨1üÿÔP5S¡9£jðp›VpŦ6£jw ànµ+d0 !$ßÈ&dÄ™Ï õ…„,/ ç•ê®+>ø@Cw†Ü'°ò° B Âd¶Lbºê©Ã]6oÓgrMàB=8`”²$º@K h Ÿý06¾¢àB ÿvÒ™-Ô1bL]ÐBÈLqÌ0§Í|¨ TxÇæx€‹P)žÄư:¨‚áàƒ Ô…­Y€E9dDLù™‰êDðlbÄHp.!è0wÝ+ø°Ãd+ìNê:—nláÖ‘6Ë‘N#É1ÿÁ:Ø ‚&HÂpC- U¡Y& ÿhƒ!\CÅÎ0 ÔoÇOéF@DÌø¯LœáVt*@ ;B¢B<d àP>º³&}ë`àÑ(,äç’(Ÿ`ƒòŒ l`ƒ¸O úÛ~04¤$É û‰€ ôðˆáWÌb@»$À€äƒDÖ`‹Ûé€ZP¡X`¦ 3T‰ äE7A©€ÃVã~‚Ä "ÒÙ…©š•A 1åàØ¦œ²0,°`(àPfЀŠdÈ ›ìÐA«mg _P@íð×%pÄ`C’À¯Hèÿ2pYÀXÀú: O /ž±Aæ4=7¼ÅexKcj7‡U2ÝbA%,Á¦$ÄY&€<‰ ±­@X€UBI·•xA—¹‰‚? `(“3„ Ö?ÄT“uÌ8÷w*¨&CFÀR Œ<Ù <ˆit40ë-y!ƒ'µ±à °€ ,ІV‚n0´{ôµ S)HÞ&°'èpM I%¢ ;n¨® NݬÂàåØ  (ľd§¶Õð˜œ$¨õ3 à§{‰8*XÓVx€áž1^ÌÑTutƨjÕ™ %²È“,t‚ÿ‚nF{‡òŽº<åÂrèš”%Jñ -€Ë¹~E%n %ºŒ\p„+€RÒ°—ÁUu}ÑVøä)ðÀIö©Ð£ÔJhµˆªÁê×175bÉ ·?g0¥T“‚¤o ›˜å @uNöxåM÷\µ@♂ -JVgEš@Nø˜}‘f}ŸÈÓFаò°‡&`Vï"€®2x‡Y^H2ݲ4À!;N6èIņjådʘFðàhMe”ƒS Û,r¸6úÏëޤ5óÀ¡ÿ ­´š2$àas:â8’°ƒuJ<ò´ƒê &‡v€_¢ã @¯p|÷#ÙÎFš…7yg„»ýœWŽäÚ=äÂâ½€fnðÊ@K²Ø‚-rQ>ˆoL!û®(:Ü쩪iåZˆjÈP¤"Á%v9Ïç¢D… t@K†B VÛLC,]øBYXð$~^b…Æ”D,@‚ÐAvx2òÖN m`BšV¹h‚H ]ƒ>¶ ƒ+ v+>öŒ{?€¶M ˆ‚RÀƒ”¦Ä#¨‚L¤³)Dl:ýo5 ¸ p¾5Û2¯;$»‘1Ò;ÿ¹CÂ@D£Te¢U8jp€Dàû±q`­!9Šx¢Á ”Û>Ó j&üÀö<2 c„ùh•ÈÝéN ;p—ŽÄ%C ä€l‚)ðA”ë›ušcs@Å8Ðɺ"ú5Ç6æ¿X³€ùQmzíñuk µ‚Q›ÐÜhÄ1 S&ìwî‚€Ô@\ &d×-y¹·™È"Îp ¶‘@L ó`â‘odÔ.J\Â:æÀbZšÖ˜î½+J¨}"ë]P¿#?ÁuŒfÚÀ2Â?ýÙzS›•ÕÇën›øLvòeÿ àÛŒÁ¿Àå"dš&ptÀx³•ݼ쀡0TgÒì =R¯ÄÔÞ:üÊ?=Œ³thB´àÀ B ~fÛë @@Þ@=àSŽâWER êÄß~es8¥Dv_>Pa- lÄZÝ!íÖå”A×(!v…$.Û5Š&Þ  À±¶X@• öÓ`xC ÀcãeL°e8ä“[1t¬À:ä‡ ¬ÀØHÀy©” á€iÈ„¤€“uÊÐL•ìFSøÏÂ\–­YÁØËl”\1_.hGtÂ|ŽCUÂuxEÿ{8“ÄF Â$!€Ü %­”@ð{ ˆÎtA^tëLÁ[ØC*ÙÌW…D 1€ ¼@ ˜GÏ@€ ) Hy K,,H,ìK,àÀd•ê劸‚‡ôB @DXÜ­Q‘Èà<+XO—½›x¼wyܳ edÀNH„îèÀ´€{|x,!DR|‡ ÔCW|€‰R´ÈJ „Ô œ‰ ÐŽ ÈÃçHÅ8@@æáÙÖ€-ñ”ØÁ¼±À½˜ß^Ø€·Bƒ’!A4@ ˆ—¤<€MÜF, À ‚ÄåÔÅ1Ãÿä¸ ^ÍzT’¶0‰@Й[ðÚ”JŒ0Gj‚IÀ[`ÏTÈA|ˆ³¨I è#w½ ¿©@¿‰Ò…*S ¹> ‰tÁ¸`ÀXɃ@ÀýÙŒve˜ø íÈôSoÝÞˆùبUŽ0†ÝÓp† Œ\¢˜ˆÎWDHFpÈo° ¬†¸Qnè!á@Ám`@ATØP‰ ô‰hYÀ½œ$Ü€ë}@ Ì@'¬(Ë ÄÁ  DBÒ¨IâK h€Ù'D @»”ÅëA Ëh²°Bº‰ºå ðÐ%R”˜ð”7€žèØ™;exDSÝ8Ö è”À:0]8€ 4@V¢€ Ô€$4€ \F-ˆåŽ×d|i´@¼@ ì‡ ˜9Š‹ZÆG­À•$O?A×p}Á>ɇ]\¡<ÄÀd*\ ,„ù5zÝBƒHä8,…R”ÃÄ|p„ˆþèÔ †JJ–,éLOüJ*µƒ?0GD‰ê„ÄFòš8@HeÀ;YTþ€ÚÀ¬Œ%©I•8ÀŸ´„$ ‡-(– 8€( O#õ“ÿ-ဲ€³Ð‚L'âŬ’Ê5 µ)Ñ8Æ(@ JiœìÕ ª \’ÊÝ äÀ ÅP‡LI5ƒ5¾Â4FòiVPG—pÉ[$C½¸tÉÒŠU*@ªè@ØÔ6Š =›D U@3v@ ¬æÐ¹ ÂV‡€ peÍ™Øâ1•AÞÉÙŸ°Ü q@ÛÃph•º äôCmA¨K=ä-xEèÀˆIŠÂÏ Ä4@dEXËh9XA„ÌÄÁ"pé7Q„ºÜ_å*fÐü51„AÔ•Í”ÀNÄ‚dÝmÙM4(¤Rº¹ix@.‘ÿ³º²Ej! æB Ø\R!€"š<ÉEJJÀ8•^Ÿ_¦Ëv¢ zðL”ð³Ð€(ÔHIfÝÊBùM4€q¨äªhÀS,Å€@Å5cñá¡~é×\ÇòAOOr¬¸„< ¨ÈM'€óAÊI·ØThMèĈ-Œ¡g8ÀÍ ƒ*è,4D‚@ƒNp°¸ ´Ä~a Lg›X'‚ÞŒ×F\(Q_ö¼;¸@G.À¿N† hTgìbt-M¤Æ4B+|€BÄFê†á™)Ýe„Cl°Ä Ì©ð̈«ÿ¯q- |HgRÁ+Ú€È"ih¤ÀLV…û€ròS”$MÝÐÂ@ ŠG_^%ˆa ÁÔjgœTÂÔÀí(T-$ܾä ÉyÓ –È2`SÁt€®FÈô‚QœÆÞgÛMÃàúE¬É‹±’HÁć˜ ¹íY0儾0Üou´1¢µÝ¬6ELçö’'ýË-LÒìÀ뽃ê¨Ï܇tF…nº¬˜˜Ì{(Ѻȇ|(ØÀž%)¬–'žX… ¼iÚ Û9Ã+à Ô ØDNìÂàüTÌ×Ý6ÄXÂ,Vœ”AÛ~(Ÿ Yæ$ÿÏ/@!(â‹…IZ´À¡ÈD`ˆÈ (½MÝøpÝ,™rDZ´ÔË¡Œ*gŒMNÈ 'XqÙ™ºä… õ”D›¨:@*¤¦yþ°(EBÝÔM" |‰N ô‚ÿ4…\ÀoÀäTÉ“q § Y ¼l‡ÄhÍèpPVØv ’@À”ô]ÑðÀ©»¢I%.$A™à q¡¨/6@T@„IRø@¿éK[}o€ß(/@:!Á‡v³¦…ñ€‘"@j™oɹÁ>Q›ó€ÈP '|ûŠ$pµk0¦)ƒ,BŠti4ɪ4 Âm]\~žFt´-ÿË4]y#èOX:´lÔƒ1„=n,0‰|t•ˆ,gð)æ`DSwœ&R(¹ ˆrγ .àæ +Þò¡ùèv®žø@Il1ý ì)YºËzÑ/+(.€€ÀoÄÑä †‡ÐÁ4N}V„ã\A¨‡6Gòv lQÞEDI~Ì´ @à‚1p’,4ÈRrl¤Ý°&Ôž 8¢&@@ äŠvøo}ïSè(HµìÚ·E@£Äq€@l½(ÖÔàíàÂ͆4P†©¦Z!¬y¨€ ìÀL¯$Áï‰}VÓ†tÀYXœ–úµJƒEÿ,eÁ`XBc¨ÛZäлÁ“RÒØ€ ¬® šZÞ%AX›a…”,lÄ@Và ìÀkmØá l@(@h›„’BnÝœšx1ñÏñl‡uþÊí!ÈŸ¾«ÜXýe¼HÆØ( U8+!(39(ÿ<™å8=O9Ü_¼C©EׄG[.¬“P@ ¬[8€Î\AÊ=0"À Ô@ àö -´E€Ušó®¹P hÈ´‹‚QÁ†Í‚Bá‚$–Üì\°ôÀˆ‰ßxA$TáÞ€ É(HÈvLÙB0‚¯RÇÅ,wÆŽ7‘H3ìBCøÿÕ€°XM™ ÉÕíiÒR>ˆt Îä‡@ Ñø;bÀƒ¸tHÐi)…N,$e deϦò"›‚ˆ€o ¥¡æ‰$`9–[ cºW,@Áz'Ôšjäw<†ýD?Ì €ñ„ <‰ L€¨*ÈÉ®:mÎînÁ40,RpÈL#Å SL8©|7A\ð%‡PPÛE—ýSÀS ­¬D)K© >½C8@pÀØyŸµM Ìæ 8€öRåaN‰+tŸ÷}k×Ò‚H¦…ÒÜðƒuý]ÔUG?X±ê´€( =èe´é hœW€ø2òÀÜ4¸,d2)ÄN,Åÿ…èTÆQ„3(N€“zÜbcÈA@ÔñÂAY Õmd+É_×D›ìô;¼Ö:tÀ ü’(¥¯b¾´ x Š(+ûtØ©Ð+·Ä0–1X×çðÓ‹ÙÙ¾³D@XÉhKµ4²ÍÉCAûPd„4=ß"ÌÆ}íχhé9Ø7LâÀØœP‰7(‡G=zHØŒ,™ô%Œ¶øÍü%/j…±'”Ç9ê4) ,èK`6ˆä)”-ÐBÒñÏd1‘^ôS^4¡ÙFc, M×4ÆCng Çtœà éHEÁPT€5ýOÂÃÌ Ý’7ŒgG7\Çÿ_ØÃØ{ÇCé¥-!ÒF:†¼€uÆûˆ‘‘h¡¬À¨u }ã tÇ…(…q¼ R '+ô…Ž«%^7{Œ®¨•1‰¿Š Àw¾Ã+ÔÌPÀ'1…¼Ñ,ƒ\{7AäA±œ):ˆ#Jï£èPR’à…UšA™«ŽÌF.Ä, fÁŸ¤9éìÈ9@m8ÑÀŠ'ÅpˆÆ*#§Ù€ªú˜oÞk=,K$® ½ÑòmƒÇ=h™ÔOÕ¸lX¦¤²ÔHÑ T`i*ƒÃƒÀs¾Ã%Ì1tšk&KÁ–˜(’–£²Áá,wAXIYh€9hiÑÿ`Áˆú0yûXœû Ä°d°xQñX@Pø%-M™I9hPI-…•%MYXSl9pØi8(.Ð88è„PŰ``‘ûÀ``ˆp‰ À˜ `À0 Q™ýI(@(úYHÉèTéØ(zxиXzj‘ˆ©`égA¬L/gÈC`€&&˜ˆÆ@Ÿn8#ƒGÐØ`@Á‹!2„K‘2¥;|¸ŠÒ†#†‰þÞ˜ˆáa±†R´÷c ª$h°"èÒXä1`A§2ЍÀ‡©î2P!#D‹%MLH³'B7‡'¤‘R\  Ð*ÿ@B8<Ø0eO+xˆÑ¡Â ÑpñFU = | `ÁÐv¤˜ n´|<ò‘ð&NáJ è¹@€ jr|„ÁÍÆìdÝAħPLe¢aÁ ×LgÕ½—U¨Ÿ°ä -¢b…ƒ :¼xÁ l ¼˜À`†l©M˜( 4hÊæIC¬'€…â4 ˆ &ô9*@ :¸‹@a€àã7ãšh­Ί† JP!ƒQj ¤6Ž ÀóDâÁ”t2Ø.ÊR£„£5€è½ èÀ?ÀblPǹd0‚ c8aÅ:t®SÁÿ%Hê*#SŠq…j[ %‚(ö^ `‘–@tæºN¨nÀíô“à‚{4¨Ç¨&*ÀB‚.Àƒ€د;2€C à 4‡:@@>p88dÄjá®6p£kB`g¡ìZ³)@…’ØŒà„U’"!ÀXªšf‰ Êq6è@žŸ’ã§Ä`e8–B < 1x@%÷Ã… pÿA€ÁšPœ5.C¤ #X`¡‚¦µ² #ÙØH ‡a’tLÈÉTCÓ@Þ¥ ‹uH€;w¡Ö^ˆ! &˜#)sŒRà^È.¾8‰<2âÈQ£ SÊÒ~ÈÀê Ròh€Èã}iW¼)è‘ %›@4ÚRLtÐ2E(l €dÎ ‘k€]"JDr•ŽÓÚã8éæi1ÏN7M–’"à˜1€5Љ 7#ÆÄò(û4rÑ+ "À ¬Aƒgöq”ÿüâ>Q´ È£´ ô$À@(/„’1ÿˆņHP ¡9ÉþLH¿ÖÀq|—P«½&H)‰‚­ ±;Ðd${e3†F6ü¨-f(Œ%5tÍ‹ãPÁ ˆ‚€ðÊÀˆqŽ–iç/P€ïÚÙRØÜ‚ ’@.,È¢Ã;RHÜ•Ê)ˆõLû=| ÍA$ËX˜nìPYÐñ}qª+-xÙ§…nŒŠ5àH[‚ÆÛ„d"ˆ"bµ Y5!¹#‚§[Ó‘À¢©« Ì«ZwòR 0Bd°€ÂÖ¢‘ÅŒq zÐcôÜ£èÆzÄ~g‘•:‘§-&,xãRBA.qØ` 7eÿslà€*®A7¢"ɇ_°V o·¥D31b[g.ÀIÑZVYtGptÅ tðUt€lß"(âAX,â.ð‡Hü–€â•f9*«Š€ püšzàgnã@ŸIq˜Å,Gj5çPGJ2` 22PsXQ$S„†0@4`à¯e98[bt ¡’ñ29‚áÀeG²Â©d)Ú¤  ¼zsî\8fNwÚ:hÎÏ°Ó 0a isŠÓHÈ®CÈ‚Óò©€Áò˜p@b’2†ù¨Äˆ= y=È7@ÀaP@IZÿ €È€œôt¶µí P¯X‚h©”@#kάøÃöø£/¨@u˜U² s­x¢ Ô°öȪÙM±ŽE4T ˆÒÊxˆÑjÛáaþJ®<-"gHÎqã 4ií» àîn`fMhA¬ ¼`³ÑÎäô؇×Üæ7'ñ$°ƒeÑbãÐÀ Ì{‹¤lš)ê¥5»6p'HH»ATuðKL{æÕ¶ø]œwÝëcÞ ¨cWØ1°ñT£´ç}7# `œÕ¬•Ú4yHoµ¡®ÝïŸf'$ð$ð“*ùQ Ñ—BÿÐíÛX Ю‰íƒ2@‡ „þµ'V¸X ÒxÒ—^š`Á ¦rR¯I.CQ5£Ÿ³æ¯–áh*e.  ¶c{Dú ÏCÈ§àŽ™`ô¦G~òƒ’:+N|…7sÖMõ½&E¸xÆ`rœ¤­t€“  že¤– ÙÀ•¿þõ§@ëhWo»ˆ‚P—g°g5 !õ(˜~7ë¨ñ+“̘•pa¿T¾V˜Ž' N8—Ïp VúX¯–иµ/H”éa3PƒÊ“ø6íÐp¹8XФALuŠqò@c‘ZØ«ÖX—À¡Cv»= Aƒª¤Uø6Q¨‰z¤(¬Á+T>u€™ß ‘žú½”S¬Ú€€Ø…Vðà Áø/k:€{á¤øÃÂ;¼Âù±8¸: â"‡d€B@3È* ‡•9 ‰QY" $•CŒÈ˜w°-£#àÕ2eüÓHÊ,¢"AÕ!V@D  Œ<°Œ>É@}e ‘$PTEþuWÌœÀÀ ÐÀ.@@LEA¡„G¨ZY`(p‚2ÑД”ÿ(ÃÒQ¹ý“ß{­µœ2¤u€zb&3Û ÿ@]£¥ ×ku`[ (SÀ2º$×™DÀ>MA4’IÄ ”&WxApQn8ÀµWXàOU%‹ÓPD¢LeX°@#Ê,óÞAù³ÀÔP€H€lùcÀ € ,SÀ „HÁ™”Rj“m\©¹@ƒÎ@ÝlÕ µ€ ø¤@‘½>À+‰|}ÈÖ Ï`i#Ì,P€ž•±%€ ¢­õ€«4;SÙ ¥)T°p®@É@yr]ªÀÌþX03î € (³t>»ÅV¸G¤ œÿ4 '2`é¹õ€;IP˜3P˜ <ÐðÞÿªÿ'k€ù9 V`¶YÐÀpê–H;°Ì?U¥+CÿÌæ“H8q™&‰â óM;è°#úè¢Ãk•ÑQ22RØëþDòLž4ûóš¸<UKPÝUI…‘Á5“b4Au pµëN8‰¯GAäk " ª0âTDr¬z|o§÷Þúc‡ðÇïÆÖQwX3 €Ì¯B‚‹ZFäÔsäþ¡5eo âòG7DçŽÐä8G:°± t\ãàÈÆ6ÌQ ttëAB%`ÁRÈ:Ro°Ö¨uä"¨eH'šKGØä6Hû¬ÿR0ƒÔ±z€ä› D 8ÀÖü!ç‘ÈÌ8 @,`§tk@`"@ -M, ¦ ¸‘oˆKâ¿<´!!@ƒ†e¤ÂD±‹¸MÒƒ°ü 8@ŠÔF,BD#“éFnø£ $‡;ØQŽtˆãßG76ønøƒIÀB€„*! W8‚Züƒ*d¡¶ÀBz€l#.”ae°ê$à®[F£@­lGSÑCti ‰þh°Œîü a𕪅:ÀÀ5¨AuN`ÄÀV§ä€\`œÀUh¨ ?FÀÿO~Š üЇ><Ò‘{쳟#èG?öa+9 ¢hÃŒö5À0ÚOf2…µç8ÑB °¤LRtþÇ:ÖÑp\CàÀ&w¦…Žp')À¿(Ð"¹,^€Ú5¢ŽtÄC˜@&—‡Š@Œ–“ä… àÉlè&¿Ü£ŸýXM>ø€~ð³!0ëö±—$ꋌó\d%„Ä5˜ d „Ô`2ðG TPêp eþHA>ô “f´ÛáÔÄ!q8KÖ`MÆEÀ†o $œ—ÿ(cψÀ$ÓaIb€â°†:ÊŽvÿ˜#Øq0D3*渼$‰T)ê°®Yõ¤¢KG7¾ayøc¿øtyÑ‹_à"v·F/rÁ‹_øƒ¹ÓõÅs¡ ]T'»`Í¢”€ãò­@$0 ì ÿbÀRÝ„W þPF"A€B:sÀ‡:Þauè‡M€иƒÄ šD#vs ~¶¹pÀÃþØ€ H ƒ,2ä°‡9ÄasÈCþÀ‰P âÖ§0E*TÑAìkÐ! AˆAì|ØÃ… 8§ˆê ¡¼I@hæKGÌkUˆÀÈ¢»Fe°7ÔU'¼¨rp¡å\ôâ‘à…/|Ñ ^ä"ÀØ…-Ò-LÈǰ8Èfc¢‡œ¡ŽÑ•˜@o–a>»;Á¬=â4Ðaƒ ´ŒÐнAÀ ‹ÿHw&! U䚟…(2አԾöïð »H¨¢öÕœÝWìH@AŠ[ãšxD&aûÛñްíäâ R„"ž…ø´ãu8rFMùY€2Ò”¹ ü$š?Èÿòõ¤ tæhFüõõ ¢p…4o|P Œ˜¥žê‘ö×ÿÌR!¨cUþ·7™a&ÒòX H3Óр؀  5ùq5 ‚~`ˆrh´|ÜÂTƒ•Æ2'Uz#:ÑÊ -Éer Eh3%x'@€ ‰b{@ΰ(lvàu'P„òG5h #c{¶G° #^ s 5Dˆ ‰² ·GRtÏÖˆ5ê¡ðxì#“Òi2 Ñiz²M0ðlpv+Á&ò¢O„=°b€(!q Ë B/ÂÿñÓhÀœuëB(€2 ÀS ‚ñRi<‚}TÎ †bnàXµ&TÓa0Q%ÕƒàC-ñ3ìÃ$ÂqVÇT@)dÀX!Œ€`Pà0s"Ÿ’,Ñ_Ø#;BE @'â MX ÂèD?Å‚°„rqG+ÈSAâ_W}LØ»h~ 0b„·WÎ0ˆò°CQålç}ŽC÷6c³C8ÿ1Ëðsõ-ýU‹B"RE"`c×h)º‡ ³pr*T´m¶7‹ÂLO¤6K“]°ƒ‘Db(oóàÇ”7"¢EéLRA$Õ’'@ P p¦pTb ø’M ㆀâ3Pcf}P˜`W~õç¶G!fˆZ+±fÓc7÷–I(Laù0Z° Lå>ó™h#‘àp6‰T"RØu»±s ¸2,C‘üâ•S]Ç2¥'ëÄYœÆyœÈÉ€s–œÌI3p…6°./ñÐdcj²€ (<£ÕÓœnœàÿ9žàIÀÚåPÓØØÎ`Œ'.;‡p³áTr¾b‘)‘´CÙ#¤L\1h3áñ Â%qL6 Œ#Q±.bÀæö:ñ1ò¨ Å"@$à T± à p:ò6,¹%6‡Pq);X¢•£Ì02Ï01óŠiryb•Q^ËÀ‚Ióû(·ñ˜ƒ¥R:¥™ÀF;òY9"?Ñ@!8\2$TÙ( šEUÑ 0ü¢ Qd9S§r:§tZ§QŠ9Ɇh“"‡S”Ñ -h éALOTQ>Yµž‘0¿ÿãºâÝòd0>@@+k¨D|¡©v:$Â_'0Uøá <Ã!ŸÏ@!­ñBÁî2y&e^t¤§Å“§¡g…ùá*ËQ‘QgËà76õ%>1°Qpõ¡¹#.@ãaUhà `…ÁlYsrÁ ± P”11§`n×Á‚$²7fPæ3£c)rUŸêL§^pF6!EØ£ @ „¡5~Tï¸Ëá ðžÌÖ°û: á€C*¦{î…¯YYZ. ;Z gÖƒ4ܱ“FÑu‘2š·q6°?Y%µÿ£HÑ<ΰFp\ D°{³}è¡à6አ— ‚Ì“!ë‚66gY“g{±³ÍÐÖIŒ`Âgõ£¤EUô>ÆáaDcó¡ÝQk#%‘Ÿ—#ž%Q%€!çb,2×3Œ)#Cð&ØY«HqÐ"@'+éª'ÂÓF$ŽÚuö7Fèl C’^4£Õ³Û‡6“Ò¸9œJ=ܪ5ÆÒ w{êI+{¡Z‘•H;{˜' Ç0âj­Hƒ6y3ïÁ6$ƒä|A.¡þ@åÁ áÎÚT¨,á—¡EvQAÿR@`t0Å‹0@“q„‘{C'5Р}bp'­X:)kJ=&0Fê±/Z¤Uñ¡/‹ Ð ¯h§2>¡+Ðú ÿ€%AäÅL†ˆC³žZ"çù!ã¶ÁÂäjþà5¡KÀ"»áS‘0m#dð ¼ay“S-õaýjZ9'`‰¥5Âqþç3Kìˆ ÝD-Œ¡¹FlÀƒoƒ& pͰ&Zã8¨Šå‘Ïà@à&Aœäß0í0çßd逿`é@:¥ä êÙoØtƒ£ñrÑ.\˜&\% ÿ‘隢'Ô18”{à2š'W @ Ñ+l‰ © ë)  p‘ |ØJe°bˆ™R™Dx@GñÓÆÊÎà¬64RàóŠ8AZÓ),ž²F;)=2À^p íÀ@{ŒÔ çà£$îîà ¢TÐÌìpØ4JHJ [ÎèœÎì¼=À¦ô:'±zb>¶Cô¥%ZÔHNÁž 0÷tÐ̶q)ØtLÍ¢D°*À% U `ãƒ6" æFð•‹Y™'på%tà 0ú T`%P±ùÿTfb@þÀGA£ Ä‚C’Ìd´‘ŽqRéP Ú€àP¢´IÈ@3)ðh@Ôñ[þ€JÀ¼b|Ô0AÄ~\3«‘Ên"0iݸÀ|6fÄ-ô’bYÀŒ²ìH‹Àfys8~X Üq$À}¥+À* -* 20D þ„ P °°O µ÷µ°#ÀÀýOÕ”M|kƒ@¢pö$…­“1œÕØ‘ž¶Cy±Ç£J 0%íðà 1T?•A«!K:àL`+|ƒ˜^à ¢S þ@ Éÿð¤ÏÜqMÖ±LEó겕üÂ1ÿbñ¶ÖAÚþ”÷øP €ù€!P!€,bÀNÕ6žF-@ø\djM204@Î'h`z°Óq¬í}@Ó.Ža2hql hñ“lðÅnñÌá 0eU`>7cnì°ÝAÛ  ·  v· ¼°eÏå ÑUD0ÝQ@N&LëÖ Àd·° «±@ð\Í3n\GE¹\›` rQ ‡ç{–ð ÙŽ:9#Y£yph<Ë@ËÐfŒ0ÐØ'44~Ùž@'À%ÿÀöP{Pâ4}a€@þ@Ó/€t`ðP°}°æk~ lÀ¦GÙp0Ò±3þ^à“©AÓ(=â.àBì°I¤CþàP@/(¶p ¿` ¶oWönWf¹°eS¶ a¦ ûfìY®“]×P ä@â@ Ðv›Ç;è: {„•->~zo°&kk°¬r0u ŒÆ|‡Ò°‘0 ±àÀ Pg ¨pZà‰%ÂÞG£Wc¤îv0oÐÚÁv ™  ¶–k™0 ŸP ©€ §  ª0 Ÿ°w§Pæ$ ž –€ «ÿÐyÔ ³a?ж£šg‡s•¡Q0ä 7Iü…¾ äÓ¥'¶Ð\¹  «1 é&åS.eõ ¸ ¡À …a Žàˆàk š€ð¨P ² ¢såÀ Í€F^àÏTù~q“žDƒ,¬½êq0Y×±fx™‚?øçF‡IoDøgv¨ àð ØÌëþÀlGܰIí°æî`Ý~ݾãæPæ€0 žpò¡ð “0 p·7Ð$LS—€ò¥°ò¢@òŸ` Ši|G±°à…ñÂgö¨` œ€uœà À/)´­ ® ‘  ¶f ž !? yÿ7 ã85/F{Z>ã<‚ßY˜ ŸÀû‘Àžb¬¡cÓQ03ѵÚ÷¹Ù¡‹þlÁÁË@X&€Á2F'ˆQ ìÂü9{À„ L@AYƒ (L˜@Âgˆ9 … &X Ð@€zq–@B…‘İprY… p6!B…¥ &$ˆà ƒ ˜Ààç n–aÐàƒhÊ6 `à]¼ü P†€bo:`ð@LΊN$€à^1 ð <1Y 0 ÆŸ þiŽ¡Œf ¬ðSŒƒ©Ë LýWÛöÿ¿ì 4° ÷× N0 ÀlÁ„L80öè€ÄXFÆ#lH0!ë2 *HP áeÊÊs—€ÀVK%ð´9…©*§JZAhƒ›(X >æ0hª›ÔzJ½@p $p€¯œQà °"èI/ËÒí.ðg¤ h@ÂÈk€ HÀ’D0ýqé1üÑ«…,ÀÀ,x`€ˆ ²(C;É`ã‚ÎXÈÛn‹À±¢«¶Ç ‘ D,€ðBŒŸœñO‚  NXÆÙ”¯>$`à–ÁÁ *¨àO\`)e^ÿЬBE/1À3À¼Ø ®Õ´/"PÆExÀæD,1"h@€ŠrÙ ‰h@Ce¥Ñ–íxG<æQ{äcû(`Lƒæ' \LLöT€(cèZ€À•B 8ã` x¿Œv€ëén5f šÚ²š¯E€ ðc+Íå™ à'PV CéJ\rÉm³À3†#}„Êpít¸Eš\‘ È& ð´H ÑßþQkÿþcea‘L-u|ð‡2x¨=cælàЗá“fP¤nhʕԩC:ž³}²§6+òfh‹Qå ÐÌS+nÝ“âeF÷31©Fƒù\ à…†D!ÔYˆ&åwNÔ¡nOŒøÐo ¶\h÷´ ç<„¸Ã­d%ÁŠ€ètô>DBÚÈ8§*\Ë0§îÎuCĪ4Ñ8ê0U™fX2 IÀÅ€€T-`ç›óú×@d°[±@Xà!þ`†íp³ŒFhÍ0ùSdm¦h °‰Ê\'î,PdFŸ3ªET@‹˜ KÒ ÿ¼'ÿhe8AbºyÒVN•.l®üé›°@ÀbÐÖ\ƒ ¤Zx`Ó@††™Bµ@ÚÚ€pµœIšGöⵈEÝTP%´9À™üJ_ ;“B œUˆopWšº©,(­ o‡Óר…Š¿ÚLÜã(%Y¥o{˜”1(ÀCT@°Ý<~³¬Âí -2J×% Mª@Øé¡2 'XÀÊPCƒàÆ@©"3ÂE€º uzA•­F÷\#IØS«Q€Ù“ű²h»y±îmóÕ(w†:tF¤ðÎZp2l%šB ´‡:SéÛM³¢%ÿ°I|  DBÍï´D›Š¥¤!ƒ£!&ŽšÂžêùgx°ú«ÂÛ Ъ j ¸‘xèÕq€gèAò6¹¹s"~a†Œ¸ˆ=œÄx©j@røs¨Åv0r(vØE^ìÅ^¼†o@t(‡u0Qƒ±Â‹ð¦ÉÈ6#¢Á¶X.X L‘ ¨hÀ pq!pÝ «¥» ˜–=AÛ¡Ü‹¡A`Ù Ù "X³¸«Añ0:ÐüG=ȃ5ˆ`žNz†¥¹ž(û@m1€Ú‚Hk±¦×‹ÛQ%ÿ@†m(‡tðÅ]ltHsøwv8‡nø†o8‡`Lr¨‹kÐEv ‡n‡âɘó㊥û P¸)g {šÀzy@—ëŸß!Gð‰€ P ø þ1,­9®zÁ¬¢ØFÒ!5*!X:8»à‘eX ‘QŸ:È”Þ  ¦ð-‚–‹Hº¦Â¡šˆ©Š (3'1°’l0‡ŽÜÅt(n`‡•d‡qø†n‡mèŸsè¿s0Ì»€#X‚(€‚-ÈLÍÔ̈q ‡i¹þñ?¼€¡ã-j„eø+ÑÈž0›—ã »ˆSÉ"q!ˆ‹-Î8 èðŒØò‡n³ÿ ‚øˆ(¼FÑ(ƒ9¡‹Ï  ŸðYOsVÒ±°Zº€lƒØ}H{è~˜ŒŒp€àB–³8;ßPð „(€ÈÀ`RÁ!qJ‡ÀäÅm˜¸¨‡Ï¬Åm sp‡p‡ÝEeã$°ÌÜ‚+à'¸, $¨-¸‚%€*ð‡vèHrБø;¼H€Ãi™ºþy9(Û’;Ê`§ÚÀ8p2ñ°À ÞZ„ÈšŠpéS:˜ P«â  0¨à0˜áð4xH(1vÂÈ.~¸‡.½ÿ˜Ÿ}{@9„7h†øAlú ÜâÑJŒRñf(ƒz•ɘ#9»ÚðHv(r0LtØÅo ‡m‡u‡Bði *è[ð‡+Ð%h‚¸Ã€É(‚ à‚!0ètÀ†ohLà™²Z"¾h¥©ˆ([è§ÎªQ²–j#㬒ü€‚» ‚Xñ!°ÿ»hؼ4ð‡~БȇèЇ{|}}àF×{¸ ?@ƒ5„>̰Π¥aY†2`!a‹Ž&/Ð ÙÀ­-QTt¸nØmè†tpoÀÔ‰‚ÿ»˜‚8Ð ð·š©€v(Pwpt Xi&¢c ÿ›•®®6-¯(*Ù˜p9ˆì·âq-/À¥cV"˜X$]!0¨(€0(¼àRñ܇¨¼~~Ы 9•ƒ8ȃ€C(¾Í8‰¬Ëœ©"J¤æÉ´ØÏ]|Iq`Ô€‡txLÒ$P𑪈И ¡˜0ÿ Ÿnp‡] I^ü†®í·B :€eT«½, †\†¨À"¹tҰ…ðìð‡r­‘¸~èØ !©øc R°V00ÿi%‚¨ !Ú¡åˆYƒ7 ƒ;ÐÒ@ƒA° 6˜\èËŸÉÖ7ÈÖ5˜ƒ¼ƒ¢h‹áÀ ¯É´‡p€“ð:»ÀØOtÜð†rPt8†r8m€I‚(¨‹È‚+ÐØ°XÊ\™A/ƒRVo@k¸Œpx‡dx^4ÙÞá’{>á$|šq±mªëkÆXBü­²©x²s€Hð‡Fpeq€Ê€0@Zp@`øY  ½àð‡7Ð Bxƒ7(ºÉœ×5¸ƒ<¸4„lg¿pÑ‘5¨‹8À̃7 ’Íè`e`ÿºùRq1 I²¹åż5p@‡qkðO¸…\Ø^Ð…\Ð…^]ð˜+ è/íŸ5ä]^øã>ä_Ð`À…xØÅn Hp晚)³ ŽA„T8…S@…RHpD…T@LSG0›²!‰@é@I¸÷Øg  Ë¸6°òä=½€xæ˜ðhxƒ9ÀVé]6ˆ6„xƒ:è-„AH>àƒ%&?àƒ=hBhƒ?ÈVhØ8Ø8°1öG;¸9¢eP½Ù®™“ªTE…Ôs(ÌqЋ[Ð…ÿJ¾…@æ…_`è…^Ð^Ø‹Àõư…[ˆ“Ö…]\ˆ\8iP–pØEo°Z€Ñ»X€ÄF ˆð„LKT@S¸Ðh€ è.Pg<¨ƒ:à;@ƒñ‰€ ˆjü ‰3˜F%Hì`ˆ"Ø#fæPV»X>¸B„9 bB@9}b9 :ˆ!BXƒ@„=XƒBèƒ9øƒx€5èÞ?9%hÓß0r›TÈh0m±††f‡pðœÌ…_è\È…\àhÈ…¶…(ä[ø…>nià†ÿŒîd0é[ð«M# !‰ý˜D± 9èƒ5zxƒ8B؃;€6Àƒ*îƒ<àƒA¸ƒ8¸ƒ€ Èéê3X“ b€*BEFxúfp$%»àpf!¨VÚPb>ƒÈƒI¸UR0…£F…S(„7p„7ÿ«‹H¨ ÚžL“C˜íx« Tb!ÿpo¹@e{LÌñ‡Òfn¸ øQ [ðí>öcðß¾…èd\èm"¿\\øèÞ™r¨†rèDÇåExm rÀT8ûl€G®ìjCp:È;øâ8xbÿ=¸ S¼Ø‰fx¹É ˆ…HˆUÈ„ ?êJ8K±È(h•Ä‘ä¹ñ»€JX…UÈ„O0…VFU0êÞ…^dÿ[ „Jà„QÐO°DàLˆô<ÏscÏ„Jƒ8Š{‡dœL;˜ƒWgmÇïUp·@À&ÿ²~œñÈ â)3ÙØ÷Æ!€LP…H ïIˆ{¿÷’i;Y´)úý|ÜlöŠu`p¸wiaKîïm\ ‡aP„LÀôKˆp¤îsˆ…úÆÉ¨ §ôP Ox„TX®°œ ˆ@ø‰M!‰+:P`…QheVþ„LPPPRXËáw‡€Qð„THP°Rù9Ù÷ sšô@_Xú2°ŒHЄ<÷„ …Ž; 3¶H¬ÿê?;õ÷è sY9ˆUsL {gX‡g/yj(šqO¯ò¡†}¤&…G¨QàÁ@dyfˆLÈOXK¸ó…§¯5â­»ˆ…ˆKHt weHpœ‰&"Ïø+hÁ£S§F `v €Áˆ'FŒ%ª“%Q–,E2Á¡™`‘bdþEx l™ƒe þѬbA @˜à'П|VJAè ÊÊ4X°€Aƒ&x™AŒX€ „œ`ð`™S1  –e &Á  ``` `°€€³‚&€D`€Äÿ xö01ÜÎLîzÀÄÃÃNâ”( ˜,,3à …À(—‰ðЙ2ƒ# HÀ¹sD dP@3 @ˆà,Á²<ˆ ¬B…AÔ¬®“@D ÿ@3ÑÔ &, O!€Cð~¸˜ (HAô3<£~Bœ@  L{ 02ìõ€Ê@  ŠÈ¡WÊ8À" §PPpQÐÎPPÁP ÖWAl‰á€¸ù#RDÜ1`ÁtäMàÀ L>ú(ùCÀ10OÎD`’Ëüã@?-ÐÿLË@ƒahTgSØ€3ÿ7äfC* Õ‘-&ðÈÉZœ^Q˜¦ÊÀ2p)¨€HP{ ŠÁÀ‰>@ãœrz.ó@©˜ ÁQÊpÊLú”ÌHpBbpɧŠ"تÓýd›^%ÀA©ù•¨°à(†DVÔ}@J¤S @vpj œT,¸žX_D@Y02ckÒ p€2,E°ŒÎt(AÎLpÂÎH`àË€+ úÚY×w TàÅ2°c†V5êð\‹`8 {éIà°ÂÎ8ÿëta-HêÊ8³YPè=ÐÓ|½J0wÞ&·L`WWAp[DL2›.cÁ$pÀùMr Û€2 8³¯«S€] ”î^Î0 ,£L‘q©T"hwß.x‚KöÚÔãÍB0@héå€2'ø£¥ŒÞM@34x@†@@2¤G9{ZVÁ%Æ©NAf @¨œVÞk³?‰áˆÊvTÖè‡ Ð¬¥€í(³t`–´~T,1?"°›69ƒˆb˜’¸–±gp'Æ^@d9)´UrŸírì¤ì«Bþpœ ìM‰i¡¯› â¦HÏGNÓ±¸²…_!SojCpÇ€ðQk )Èý¤´ËuW'x_ŽPeÈÅ—°@sê÷t²¤u´2¨á-AÀxWqWÔ òˆ$ÉšVÛª©µˆ¨ùmâJs…Äð€¼Ôz«ð€hèz/¸«+v àì`ÎNÈ‚GÜæ$DÜÌGÄe€,IÞ3 ÿÒ£‰xMÂÆ\"…®uUBȺð”Ä=¹-ã N8ê}ó»ßöúú#!`ÚN Ë•A€e ps—fAÇk$®¥J¥af° €¨±Žô l¦¿å*…ÊCWú‘O ¼¸©&ƒÉ ™ÑXïJÚÁ—YÚXú…µÖ«ß§ý-ô¡½èÿ¶ÐéVN!µñBZâÏ?‚p!†»5[Ú"—°®™ryÿ¾–‘ïà¥%TÆÄÀ’4Þ«ŽºÑã.÷¹Óè[Ò7MšøÇ&P†RSyºÿ*ÐŒ÷º3¾ñŽ<ä#ßÙú€¶žœÜùÿmâäÛ(Ó)’Ä ×qp=Õ>³&çôˆÓ‰G°š‡,y¡C;ù=óìŸx×ϱŒÛ Üÿf€þ'ÀfCšCÞ'€@%o‰%Luuêö4;Ukzèj `îC}q³Îxò”–~~[`Êy\ ôÏ@€Žw)HðíÕ ÷©Ùt†tEØA8V‰øƒGíÝËpÜ®ID• ÑÅÍÅâåç @#œ\ĀѸÅœÄúñ[<ƒ4Ÿý°Ép¹ŠR!€ûÅØN,CA$ %n- @„^pGŽAjIE ­Týá—\€^äß¾µ‰®ÿ PUäy‹AøYÀEÉ£…à›<À‚ššRp¸4Ã}ÌÎ}8…¿ô^S$n¹†@—mF“T“?È`µÈN¨ e0nMi±¡apË 9Å⚂ūYàKäŸ?0‚ lÑ™1 yä·qYA¨ßã\ 5¡uˆTDÕ‘$Àý @qˆ(Ãh[ý$aMFl†GØÞGäj ÀŸ D:¹Ê ¤“ À×U“ŒýÆ ôÈjÔ˜Axâ}F8^íÄ 4w<ÎQŒ’!e ¼á‘Ä™3’`üáŸ/ýC/£œ4a´©!@38VD)òÆ¿üËãüÿˆTüƒ[´cÍZA €EòÕ~AÏÓÐÄ„ É8@$B:ƒ3à9™KáúƒÚA˜Õ#Ö›ÔØÄÆŠ˜EsxŒÚØh<„»ÌsTÑ1ýŽ]ȦµäÁ­IòÍÍ}€–Ì1Bi9ƒíðÓ…­Ùì4™¾à…ŠDØ[NüFS|Ú¿(@(ÕjÀIMDD!þCÁÀ]Nteu¬E¬Ý ͤŒ‹OäPïDŠÀ“P<Ð8C0ß¼[8’ HhÝ3ÜEŠ.ߨL2˜iÄ„?(C  …·SpÅÆð(—,KÜ‘lèKŠqˆº šüTÿ9Éch±D“4À B€ß¦I„à@À ®É?ŠåÉ :ã8ÊÖà­‰œD‡òÀ_-ÈÐȱÔÎhLH@3”E¨èF"ê, Íõ¤WF@#p0ƒ*@>v܉À €¡ÍÆšÎ3ºh›¨‰ÜO„V÷ÑcpL£8!AÄÆcýÖ§]¤AâM¼QMœ‘pDd/i¢½ÐDÀ‰v\äo’Áæøƒ<Ë[`kñÍL PXe4­ÌBÀñ OãÝÄÑ\3ÔJ<Þòü‹‰3|Ä“@`j‘l ]Xå ÏÿTÐ8«ÙE$°Äûà‘…þÿ‹cÑÄLlÉL¬^iå ô¦&J;U‡ðœÀš¨ juÔhNJ„£køˆ\l#øÌš-ÃQLÍOÉG8ÖW`È)ͯ0CýÔÐÉ`”ÿ L\ÉÆ‰ö¢Øýúµ^ÕaLLPœ0Î „F¡Ò˜ @¸Ë4EQÉÓ8¢ûØÑ"Ø… F©×¹PºøƒT‡DËñÇ_l[Ö8ê™'ZMÉedŒ¡ n|F¤\Z}DÀbÌ ‡œR1ˆšm›åL aštÇ“•Љ]p@ôa^¾,@/VH• ò—]Æ^`Í_¼Ð jÕÄü3üÃUƆ)Å£/DÁ´Qs$ÀlÿÊþ!P|£k˜èÿ˜£>ŠD”Ò„Að]øý««¬^“ #iÈBšå¾=Nl(#€MPx[x ’(Ê)½iJxšË5ƒ2˜À í¥‚Æ¥E@ Qô™¢x´DC´ØÏ ñÍ EÄu)CŽ-ÉGˆý<#ãÄØ(°FDÀQžlà+H]ŸD àeþˆ¾AM+YO½ÔDŽ)ÍûÏšäKƒ:ƒÖÄPÍSøRK"A¨1QD/¶AT ]ºÍOXÀ"è•°A€¼DY¨„<ÀðÈ]Š‚8‹™¼r^îÌ<±W½EgŒÝÉ?¥ÆÍ?D$‰Á“9À30À}„ÄOñx Aƒ³y„Ùð#,¦ RÍ‚ÁÀ{ìïÜȾÒM½±„˜IDЭ™õ]å.ôNUÚBXü¡NõHüu#@:…TlPðVPÜÅÝÅ/ZÌSÍS–K¸¨½>ÖÞv–K<ß}0›o²dÒPÙþ:ÿTÉa)é#FóE“ÜÏ ”óA¯q|ZoƸ֙é[ïE$´Æ,ôˆej©ÔŒy¢ÁK`„ßr@x?lÚòÕ߬pހĸ„‹’T¯ÇØÁµÁ=@³r‰a]—2š’l¯M i‰e6ÌÎ!.@›@„½Y•H)®±œÔ™¡˜ÀžÃýÃæ2À©h #q àŽ ô#K9 Ã7ÀCµ»ƒ6Ôhƒ8|C:X{7øƒ 4 ¹ŸD—8P‹„?(P‚ÿüsèPÃb 4p F`F `°1D*à`€€Dƒð_ˇ38øWÀ‹Ζ!@@ €Àþ€*ƒÑ¥K™V ÐŽ©SóÄѨ1€³L,‹ àÿACŠ˜åŒðàŸ Ë(–y°ìA±3Êõ— ;½{õ†c÷­·sÜ£ g®Ûà¿ÅIò8%‡ŒyõZ»zÙ߀  ,p°ñ­À œý{  -e3-@¨{b—epB  X(``‚ÒuÆ@µ3ebX ëPLé@Pà[´Ù4 ØLÉ+ýè/êT©s2õçl¨?“4Ðé9e¼UC ÈYh*ÒMLøÇ¹™ àqÖÑËœpÜÑ«œqþòÆm°qÇ–öâag›ŒŽ8B‰,ŽÀb‹SÌb Rð‡vTÀ€ÀíªTòÇÿ 1Hj@ "pÆÕV{ ³à„…þÁŠ#‘vlÄ„d`àN0À€ÊI‡Z ³ ˜þ1àXf¨LxS£P(‚(Y€ ÎK¯@èè#ø¹L714c€Qec5PMŒ  O *…€1šl'#0aB¾Ü tЧ›pÀÙ&vçæ1‡2o°b≤øAÅ`S´b Ò©Ç(š§0[f€"É(àm™†ž³`'X¤×žlO ÔlÎÒ$R€Ș€xF  ÐöŸ XA…bH!× pÁÿ„æ†98`gë„ñKÓ9ô€ƒƒ~úa„~øé瞌Þ@CßþsFÈe ã,pI 8î䬰p \q«YÇ/vÚ‡u¸æTqÊA§tþê†]ëÆd2bŠ—èA «P « ±Šºa‡œÍ àÎË”‘l7ji6XFܺît(– ðr$ €gp†£bŠ (@‚; €Û‡@…ÎmHAóeœµQ b !d¸MŽÞHŸ"EhH¢þ‰!ã/BΓ€~Fا€CúÙçAÞ Ä—xàgNHó€9W ÿ‚†F¡ –yþg ¢1ó¾ö‚Ç=À‘êjºi5õ×w§±'€Èá -€@ &HÂ)ªBJˆ‚t0…øcßpG:2b¸ÕËññÇ" %b`€¨ ÷À!hCð´€$`%q–@,…@"¸˜@,P 4bL3y €np"ÁH¡?F²¤€÷(@>v~àCühâ@6~ ËGÐ0ˆ>ô!°€Ä Œ‚9ce‹œá¶ 8‹Ãc&e€ÔPjâkÕ6¸AŽp ÃÝHÇÓÀÑk£Þÿ‡6üƒ)\a þ˜‚–à¤À6`„4€, à <‚?$éw3W92r†'X f–z@\T0›8„b\`Ïh¤@ p bFYa‚ˆ?Z@Áp ‚@Lp8ì7"8 4¬ hð‡÷¡vÞ#ü€>ð1<}lÄVÜ¢Üó9‚||¸4ÝRÈ–2Ô´à&P€Šã@ÀôYH ù2p £Õ aÎñªòá):HAp°‘(øƒüSÀäÊSžf¬ÃíàF:®¡ \E™;O,`eÔD‹hÿ’þj9Õ 8RXhÔœtôUEÃÔ\Å%à LÈ@4@ T°m‚¤WA> À›}ŒúèGì}èõÊX§ò!‚}¼¨=)Їº(’af !„ÿ!ø6#èIq Ä €K p†O|"/h¯J;Âñ mpÃæ «ºqR¤ X¥?ŽƒU ˜œS-¯ò@ îm2Ê7Tp@šÁSF–§Jø hNT€,``ÑÍ'õQ2ÖúãüЇõ>21$ÍÆ1LW C~Õ`$¨A dà"Ö@a’ш@‚|Üóʭͳâ°<äA=xH@Ä@åZÀR[Àš‡3g°dŸøÐq ƒÃé0‡6ÑÓˤôDP‰p?¹'^þJ@‚efØðË;ÞŽntW#Îè®`ÿ5 6Έ™àX‚„é(1B °jß91 ëG|×|ò®# ”#3,Ë¢í1ÁNpƒ¸@$p f`:袂ýñ:9b&ÃŒX;8på³ ïðæ4€–å[*Á*0¢™*¡c¸6lXæX‡9Ä1uÀR#DðÁŠ+éžUF 8ŽR&0Q (%fþHF:Ò1dHh/ßÀ5HR ý0%PvÀ $,@Ò€KzwN þz,óÀ®¬TÊŒFÀÞ#°@ä 0nrfÆ$è½ÛCˆ8¨S hpÝU ü‡4ÿâ26‰@Z×ub€– ðè„#¥ðÈÔÈГøœ`ˆ_rld€óî0Ç1ÚañÆ@!“Gøý€®òE¨é€3 -ÈF6À‘ Êè%Ïù©fhhÙF\GM¸´õêñƒø¨Wt®r„*eЊ†îŒG@$«kÁ päp %D º´”ÀÍ&HÁPüÞ€ûcüÎ!ð‡5ľ{€»?˜ì¾Ö€OòÍ<ã40ÆL lGüafÖdf&/Â!#T‚ÌaÆÀa6bœlãÜC3:$ DMVŽ<(`sÿü!\!ráˆá’!ÞéöŒ^~è Ðd†¢Š0.Ò"_|èÊ€>@öF”ì@È@‚Ñ KºÄÆÊ6l$ÊÉÖª”)<`l@È@„` GïÀã ŠÇÄ*îðdÚÏ="¡% @#Ò` æp¬b:&ËŽà3B  œ#”#hAK/²ÁœÖ@ óê!“laz€¡nÁ–À Nd¥^D)ÇY``F~A:D„ÁBô"DdI "òÜ(g,+B"á[,aÐB%pH#€PZQ¬äÑ¢ÿvb#øH^ðãŠCÕ”ÁpÖꇎH|È„àNÀnÀlÎ8@¸„`GáŸì Ö€ ß‚bÞÐê àÀþ`aðŽÿ"Oè€õР‚¼À  fƱ&è„~¨&‚jà ¤pEVÅt¡~%iñxAP²C˜&ýAÐIÈÀ=n!`na%Wx!¸B‚dGJZ)3ÂbÁbÁDaLáNA¸À€" f«€) RÔâ–â˜C†(à«‚'$ÈÄV‚ìf~‘<€:bÊêòðä@ÐéÿþÀ6¡ê` @ èÀ6ÖÀ!Á Pa§³úqû 0ç øÏ*Rz£gpÄ*h—Î"À(‘ÒØöðvÁváh±[²&“@ R@¥xXK7"%}¡|°âKÞƒ#ð„;¨ëN,ÁÁ0ÁPÁ:Q!$ L@Ö$Ò€†‚è€Ö@Цôc”a æD°4âZ2„,–Â`€À@¸/(ˆ H`#î Þ Ö€î€R`ÝnèÀ0ɨ Ö@±ö` æ á ’ Aö!Ó‰Œ^'Y"ÝÈzƒ>ÿü#\øf!‚-€5K뺡bxÁ6}!L2}!zzÁL±Hk³s:$#x!4‚h ¬‹ $k7N‚(ଫz0H &!>*Áà@ ªƒÊgå è`ö€<åÏf$&à ð@@–ÁTM%ì/Ãf `½ðK#Tbö ì€æàñ  6Á8!8!ÜôHô¤Ð N÷€ û@2ÿ@ð4O)`Hmf `-¥VH"Tâ>’Îá´AWjóp6cQGkÑ'ý¡$cql“ÿ~Á:Äná~³^¬ZZ·š¢"œ6 `2ÂЀXÎ2Õ6Ò€áþú Rãø€ìU_ †‚˜¡Žbf#;~ÈYÄ ˜Aƒ†¨¾ pcHàÀZ`d€KaàÂ‚â ø`/ó€>!T¡.A!LAwC!LwS8€¦`ƒÃ?œA( 3 l+`†TSL€9&kÑ´X È4 x¿ªY§E‚BGuáH¡Ö6iÑoÁ$sÏàà¡„/Î! ÁLÀ€  €82b5î2ÕŒ'ä`òàôyâÎ*ðT 5Ä2ü¡S1Áu±Ó"¡;‚£þ”(š ÿ)`Ê(@ ¬â*.áS+TÁRÁN¡uC¡>ø:y¸\Hð4«ì'&òj„)X°Q$k`Ëà%U/´¦^`U)â3l¡$EñikóàZ§6}—5¶5Ï®¡vëÆàáiÊ!È€†ÒA€1.΃öO#§ñ ‚ý æX†â "@ "ñèÀ2Âug÷¤ó~@³øOØn–ŽVýð*Tძ’"•]W:–a:áH!N*!(¼Ølƒ¹¦ àa/ÊNKWºX¹î2޵%{ÿÀNtnQšu´&#ÁÚƒFv2A^!Ê¡\éÊA²áÌárNJE/Üp='€¹°Ò @Qæþâ€UM—þ!ì€ ÀV¸|`—Q¡*OÁ:MÁ"ÁX*`À'œá…ð×ø„¼ …ùl-@vä #¯º1`yQš¦Íp¡ö"ÊAÄ2¢,Kx¥óLtza®–qáXOÒs!Y§å, .a¦%4A(x&D´Ö&iàÓ¬Á-`õO€Sÿb‰cxÒßÖ å.à@P¸ œÁß6šÿ$ì–|M;kÚ°±·fB ˆÁ•8ê‚–¡x`[es˜4G†:j9˜tajÁ8!N¡2¢£S:™FÛRÁuI…!@£™bvÎð‘TßrDß× þæ@þü!¤Û¸›)–ALà‰'e£¡¶‘{)fBñü!hN/Ü㥙â” %³yƒrš! Ö6 ¡T!$.a4á‡Ø>a¡˜ ¥+€.@h›åv„7ðoÁîàÁù€èq ú±,ÏV¡a`Á›^¹Yï&¡*aF¡PÊ{8ÿ4ù0·6!@Áª3£[…q‰OZ)èb;(,9—"B raH¡&Ók#>ØTárKv#"á ¡.`…išàb'8á´|?˜â#à `r* &s b,ÆM]Áˆ½ü:SA\,ûârºÔËA nK) Óö‚£¤fÔa¨ÀÔAÕ9¡Ë_w—¦»<&@ ºäX¨ô>xÁÉGA ;Í GªPO*^¨l¦5`,€¿)€p ÓÝHR´ý¯# Õüfã¿ýõpV²ˆï£AúŸÀˆpàÁƒþH1¢D„(ôW¡€ƒ8Ðà*ð/¥Ê$.€æÿ<° l€ ,` €gˆ)ãL  $@ Æ_4h ìL`Ñ™Àbš%ð·À@”%˜€À”5PPóÀ ,[†ÀŸ N<¨ ÌB – =°Ì€þ”1XVA,°ÀȰ0œ˜0@œÕmÀÀ¬?¥#$Øi ÀA'"h :ᚉq6 À]ÂÂŒà¥A„eË”d xñÉ•*É&TöO¹˜ &ôm0!C„Eœ8°øe L0Ñ < ‹@H ~Ùƒ(H0O ¬W{(cžIPÖ€ @|x§TÿóÕAe<èÌ 0áIó PÁ„ |¸ TÀ"t0³ž ÄAŸå6€BÑ$âI#§Œ€T@n !p#A ÅB0ðOpAðü£×Ibœô@ﴀ D%3ÿ$ DÀ@#,€œ…}0ÁœÞYT Á^(PËœà&P`@L  Æ–x1 xa^±Þƒ XÁà[00¨#-êŠ'T-ã…™P †ˆˆ8kÅÚ#°m- `k€Eøc¶P Aà@÷ÕI×WÊDÐÛÍXà.Ðàæð¯žÒà-À¦dr¡·Å`è‰ aîã¨\‰¡Dë!•B·"Œ-£ ЩÌXå(¨‡ØdØ¥¥Ð%kê›ÊêÔ7ôˆh@ À uZqdRb–a‚1iED …¡WLtç <+p‹: ôŽ~ŠÍ™àe€.%`NØ–` —s}¥$Ü›ÏK„éÏ]Ë–? ˜”X g&ÿøà 8CA¢¶džEX` ã2ަ€e½€@;œ´G[šSjJu® @qFÝ ¿”¬ €j@•“À†L#ýå@ ÃdÀd Ø/ðBÐ òš(xA#^Ä»ïQy#ºT˜F<qД´B›(c8ˆý p‚˜D0bPÎ lñ€eˆ!À|¶y¸+J ¨ ÄÄùh<ÀÎ €P³ œ%Ë“À«èÓ€&bÓ–E·,ôë)Å@:Io.‹Y\4ø‘M ¢+šˆ¶ÙÁ´bxÀ© ú¨uGsÊX†óÿF˜3b h@‘°Œ¹EäLaùˆ@‚c£ ÀÀKÞøð­ äU £Ìø†ÐÒ/‰€š¢»Ç< þ •8@€ ) &ÚqÀ8£ ! äJÙ±3"€D.l R†LÉ.tŽúâ§èD³,Ãÿd¢Hµ<]yÈ/:ѪiÑ“LìU XB“‹"®N{̦cRƒF”!Œñ‡ƒP¤„üÆÎXFœ±úÒQ™baz$+5 8¶'›ˆÈ•{PÆ1I³™Š(Ì?ܦ—('oxÛ8cФ†47JÀ‹˜Zòª8L[ê¼ð¯ÿ“4di)zÀ?éD*."EÉ ¬Îð*¼H ?DK¬ÊB§½Üì («³DM€s (ƒ<ßd? n¸1@¢Ñ6‹ÔfÏâ^Z@†>®ÆeYÐö b‘ÇèNþ¨¦2äzÄð7HhVböyåÜ–Љ85‡¿éŽ3<åètÿe-›ðsnnFeÚ‘d_jŤsÍkAh²¢3¨‚ÊJ2wšoe™X @J'1ÁƒP€œ`E'Á‰[iÑåŇ9/Á]¥ø‹g€,XÂ]À'aË‘1€ÐàY˜˜®ü³Îu§&^p‹”áÜEÿJžh“œ;JœqE)| ƒWljÅðPÇr€3îXÙ„1"‰ ¥(ð±€ñËøù¡ÔÀI X„{‹&˜¢QfBˆ°¬;¨“8`tÈ:ÉrÌælQþ1t]‰IÛ>“‘Äž øêá$+pi^Mgœ€›I@¸ËàË FC‰xjñGLœêW‰Á<¶1L¬§ûèØ]Êð sT5ÑÜ:/c{ÐHQ›Lh{U>UB¿éU`Š’%Ô±E$ª5Û'`oZ%¯QMÖ¨šÊ¶ˆ,PÌÑýkTMÎ"F•"L*#þH@º¢`rEãŽÜÝÈCñNñPÿ wvꌈ-Àµ©b¤üaì x);€€ ¸Î¾28UdÐùê? Wg°º#Å·?ø–„Eèt$0£LLda4I3"@§@ 8/ZßãfÑ~QÆæÈ€–|ë…FÇGDGsŒÍ{´Fš·w`W½Ð"i“͉MTIo ±œÉèÛÓ‘, ïhÅ{F7gæï¸šª‘¢‹ö3Õg½ ~_m.Ü‹£ã9twíW_QŠaw;ˆ °Õ9@ hgÛØT4¿)À»˜DYu2já®ÿyÁvËq¶Œ?SŸÇ¤5‰båp:A£ÿL1!‘À'!F±6ÃdS7ÿÀ§6&Χ룽ΰ<ÛAPFÓWœ'Ñð*Ûs“3Ò& yQYçx‹P~˜dQ:èlÈ:àIÅ1¿/“I¨}:Ek1  d !m”]AÀ«1PÅÂ8Tñò b*ëSc)a/nG%S.4‘Óc-îµx 3@u‘37r7Y\ £e™doJèlGkäYx«ƒˆI8h´>Õ–V¢9£rb¢±=ATnEg=z¡ e á[@ccÊ1èvÎå9±>ÓÕ;]$ÿ"Ëà ˜È^ÉÂ'±=Ó& ‡0ªÄN‰‘¨‡ARbx)YãpvŒE£D A(<˜m|çPEqY‡ 0E¸è ¼q|QQv’C%Ç}1±F±HV¨Ö:Í‚¬Ô6#+s³Såg[þ•$1n#DÁÁ÷á_9¢á_p[Vñ ±¡¥C :â_ÜõÃ1'Ba "(Ì3pIe‘Y~ÁQÎ`frÐÐhYƒ0GxÔ‚nÇMë³F`’¹e$ôs’A)”CI”Ei”GÁÜõ,Ó6Š•Nµp;†;)SB 5H©•[É•]©•´tÿS±AÞhý•.qX³j¯•}ÄCB”‘^I—ui—Aé“[: Šr|T3*N¥s¦òplùU÷Õs@Kd’w)™“™”EyAÔLâÀ2‘ss_±4e¸R±JÇacSåŽàÒˆ?ƒq’Ð Á 7”{FÖ"-A=ŒI™B Ž ±CQ?_Á²±Ð! Гms=²AaŒW[ÀaQ~?!:k%ô> ·Ž®É–TElOÕà÷J¡;Y@.p[¤¥Ts3DñañömK¡{ÊTƒ$&IõV‘fp=gÿœy9”q-Ñ:Àa-zÐáö²AbÙGFg-åFŽ©r³ž7Tüõ³8•æé¢/JNRB éÿ4ÎSUÍõ£b^1›= bA pàŽSpdJZÁQ`@ƒZg¡ ±1EÀÓNÎÐRâ”üS´–©AŒ À'ÿ>Y4Qñ·:Œ'wÐ0VpÇ·-ñ‘À¨R²>oHWbªX$žížå™¨Õj­æéÌPBÈ Æ"2t4§ï“7b`[ )ÛWNb.Kap àv: pxŠ‚Uܤô úQRãã ?÷ r CM« òãyÓ[‘vG1:g2~±8“kת±˱;Öã23넬"k3C¥ÊANØ©` $6r»ñþÐ[ºç‹H¥Õ¦_‘dk=#x_Ó¦9ÐAp¤áPÀá%™‹!ü’™5ë(•äôj1ñNÛ±Y«µ[ }jȵ\p2‚±^ÐQàoÓ ï´ªd²ÚÔ —A1Â1' ˰ÇU† ³¨ð ¥é8oèW2‹[k¸‡‹¸‡ÊcÌðáfÜÈOPµöCVb•pBŽ¡Ì!9Ó–"sx'0*0¬pTtp|ᙸ«Ëº­Ë±ü„à%½å @u΀ª-õNõ%ùTYZ1ÀÌ0ž¸sp®«¼Ë˼‡Këó¼Í+½ÓK½;ntp-4.2.6p5/html/pic/oz2.gif0000644000175000017500000002004110017034537014526 0ustar peterpeterGIF89a®´÷ÿÿÿÿÿÌÿÿ™ÿÿfÿÿ3ÿÿÿÌÿÿÌÌÿÌ™ÿÌfÿÌ3ÿÌÿ™ÿÿ™Ìÿ™™ÿ™fÿ™3ÿ™ÿfÿÿfÌÿf™ÿffÿf3ÿfÿ3ÿÿ3Ìÿ3™ÿ3fÿ33ÿ3ÿÿÿÌÿ™ÿfÿ3ÿÌÿÿÌÿÌÌÿ™ÌÿfÌÿ3ÌÿÌÌÿÌÌÌÌÌ™ÌÌfÌÌ3ÌÌÌ™ÿÌ™ÌÌ™™Ì™fÌ™3Ì™ÌfÿÌfÌÌf™ÌffÌf3ÌfÌ3ÿÌ3ÌÌ3™Ì3fÌ33Ì3ÌÿÌÌÌ™ÌfÌ3Ì™ÿÿ™ÿÌ™ÿ™™ÿf™ÿ3™ÿ™Ìÿ™Ì̙̙™Ìf™Ì3™Ì™™ÿ™™Ì™™™™™f™™3™™™fÿ™fÌ™f™™ff™f3™f™3ÿ™3Ì™3™™3f™33™3™ÿ™Ì™™™f™3™fÿÿfÿÌfÿ™fÿffÿ3fÿfÌÿfÌÌfÌ™fÌffÌ3fÌf™ÿf™Ìf™™f™ff™3f™ffÿffÌff™fffff3fff3ÿf3Ìf3™f3ff33f3fÿfÌf™fff3f3ÿÿ3ÿÌ3ÿ™3ÿf3ÿ33ÿ3Ìÿ3ÌÌ3Ì™3Ìf3Ì33Ì3™ÿ3™Ì3™™3™f3™33™3fÿ3fÌ3f™3ff3f33f33ÿ33Ì33™33f333333ÿ3Ì3™3f333ÿÿÿÌÿ™ÿfÿ3ÿÌÿÌÌÌ™ÌfÌ3Ì™ÿ™Ì™™™f™3™fÿfÌf™fff3f3ÿ3Ì3™3f333ÿÌ™f3ÿÿÿ!ùØ,®´ÿ± H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹)Êȱ£Ç nÄÆJ «’!/¢Lɲ%É‘ØFŽ\¹¦Ë…×ڼɓãʘ@ þ Úó ÊœE"-x æRlO}ê$ŠrçF˜;“N…ªp(É“Y+F5y¡W‹a7Ò:s LVcS*ûr Ü‚CYµ• ólL›5=V%Yp®ÛÃ;ã~,IW¨c¼‡b…LÙàÞÃ~f4md‚a3Þ%l•±À¨jíʼn´)䟡MnmVójÚ§?ãŽx2èQÂŽË:Y²øWÕ W^#~ÙîÎÀ2 ºNVïmÚײOO»TmoŒ–Öÿ´¹¼³ê²u*޼¡á˜qQ®Õ‰Û¯^›sµÿÌ>™~s‹ÊYgCÙÅ$ uЧàÄÖw²}v–WòéÅ_]ùè\åÒd4™ÆÙ€§!ešBÞ¨œvŽeW[.å¡eB­¥Ý^áÁõ[x2Ö!Y õÅ¢tPÁæ¢A# H£‚ñ¢~Îi7ÝA¡YÇct`µG%I®m$%Q ¢ØdaQ–G(YÁc^ ÍõÞVš÷âj\FÇå9î¶¡™pÚI”šp.ã‡Z˜ÓHV ´Ü{ŽÆå_"ædŸ”&œ†M6¥gIGÒ‰bB3 )š¢2ÂyâmüÉ”š¤ 5©–ýÍÿ†Ù«îégµ‡ qaºÕ§)ÙYoy‘wa{o~ÅÞ§%ê\°ƒ±§'™’™•™– ½øÞ‘~.4Y_¿êuŸAëá 'hFhg²Á§fì:èéEÝE8U´qº¨°·ÎëçS3RG麻%µó^»ÐOŒ) [d;¥Ûqýî÷X¬¹R•^µlzyp®ÿAÔ[lø!‰œ—ϘàfD=ÇTN {„¥¢î*×ѲW¤©ËL û`µdÎgîG?äW¯}ÇJ¢Ýn•™ŸÓNôð¼ÑÕôj°E-Qhck³]ŬTɈEz¢wümÒ|§–™Ö‹ èrUšJdß`^¥è)ÜöBÿŠ7¶·ä渫:V’³J’QtBçGjÈ&%˜¸vÌ–Œ€P‹qCÁ’•8£` 6;IjÏ”|嘠ÚÙQ9§‰{ŒÇdÓA•¹ˆ|Ïôƒà‹MÉ C%`°c(ª犖LE¹v—¦u{Œ—%:A„)išÓÇ!Šx~ 9»ô¦Fq1SŠØxéä‹á·‰\×KƒÜHq«&%jçW`€ÿ5¼©Š$a£é§¦E™‹‰Ö ˆ ’Y˜šz¦°™s©¸Wx 7z×$>§ï–jYP1•sâÒ D:L©™Éo‡š«®ztÚy \y²9ª¨§y-×yí6 ÚalŠvj…PQ˜uµ—„‰²4ñ¨â¢ ij€éªtªUE0Å8€Ja£‹ÇzçGpÙa§Ëz ³ l*%º‰Ýww—Š鎈jl_pðÚ ‰plšªgª‡*8|(¬îw‚ Ÿ‰Ð ³‰ àn»¤§Ó§x7Özw€ª®o·®ÙÁ/ð_Õõ³à‰ÉôQúç—•38‘'ÿØ}ýºv%6 %v¨V°Rªé±ïq¬â'ˆM©R’Að_÷50@›L¯i¯â"Â:Åh²íZÝõ´­»³ÚáxzçŠ~êxýWŒòÈ#¬:Nû´AøLu}{¸y&¢)x§êŠ ˜L%ö´kУ7žSùˆ£Çû‚ÉuqšLƒb{ÌúL0»x„9°x½y¤öÚ·É4·Þõ†«ŠºYúdqvÙrÜJ¹÷e¹§{{Ó'‘<™wñ¦®(¡Mٶ϶÷U¸†S4ȹ¨°`bvYš` ·¬šƒë]—{º+¤2YðNë¥àµíÿºMë]G° ®=*}K“‚§ ™ ‘™Mqy\d¡Ròöu_e€¾e˱3JŠY' ç]…›Aû˜!RRÿê]‰„S›LqY)¢pr¿ÃõôÛ® i_ÇÖÀÙq\zG®àç„ÁxÂ5 Œá&ÏT§p¿k0‡¹1 nJ£°É4Ó; ó¸x*%³Ãðk𥶫Ϥµ\ ¹÷ë]d½Éç¯0¦ñö²±*.™g—°éž ¡œ»T¨r[ÆfĈS¤w S(”˜‡÷5 –‘LÆ–,jóš¾Eè§YÚÛ; @P"¬ÚntÚ²½z#ÀT\@ªvÿwÑÄPûú¢…Jq³ vË–L1À®(†%±³À¬2pSÙÑ­øµí´%¹”ªí¨ÛdÉL:Ê©†¾ØÀC0¥¤šªÈK0 ÕuGPg®bʦFÌ—¬0«¼Õ—Åít²Ê¦|ÊÒ¡ÞÁ’Ƀ¶á”jÐÌ­ª¦©WqË#ÁxPÚƒÑøTÎÃLÊúkɹ[5¡ÒG˜Ý‰­j \ÏŠv‰UXˆ\l“ìÁ:XÅ:Ѹ¬É"û†,x ê,¦ÊV Éu¼I“Ùì¶ÍK;˧¡ÊYóšîè-e,ÐbìT•Ƚ¶à)3Ʀ¿¬ÍA`ÃX¤ÿx¾S¨)Ú¤E¬(šª·Ç á—fÆñæŠÒÒ8’È%WPj.MÔ¨T…$$ê§Ñb:hŠy%’:Ï q|1l¸É¦k1ÁT6‘(ÈŠ‚ËdhW 2MÓ Í q|-Ç}@=­¥[úxH¯Q’üy:SHMJÿX»'«|$ñP)ýÓZƒQõ\CðPªL^•ØûìJýÏÎdеTLuÙh€Ô Å*Ú±KýQ„­p•›I—s"cÚ)EUT…RBe,(±—…è¾qW\uÜ\5…R0ñvÆa8ÅURÅøa¤K,ºmܺÿ}ÐÁÚÃ-¾ÝÛ:•ÙÔ]‰Î’ºÝ)QÞè-T¦Í_°Â’X‡Û‹£ÛhRäuÜà­ ìyÃQÞLEÚS5Õ’2mˆÎ,AànEU9ÅUôÝe1Á’œ«9•ÙÏÕUnuÙØÊKÎÄ­åá×pDÑàPo•2Í2› Þàݲ0 2N…laá#Α•Xˆ%Y0w[lÑf·4±KÕð 7dERÂ0öʇ9ÞÑ  æY?þ2Y|}ê¦GµPÒðãKñˆ4»yON%ÙÑX& ÎÀI¹P O¥}ñ~Mž×ðMPåi5•p‘»°‰>À¶NÊ@ >PÕð%\}¬””.ÿ§\Ô æP4Pü1‚IHäIe– ®T ÐU× Ç$Ï`­Ö0WÓ gô Ä`YƒN{!hv).'ê×°GgEϰ\¨ qË8é>…䳞éšNpš'é±\Pµ Ê0ë¹@ G5èÖà„œËDUTwH³þ Å`ë"˘<ê»ÎèOäë´%Ž (ˆhQdÓp ¤ž ¿ jž ³Õå÷Ú}aTGö ä$ëV´ Œ^ ëttH•K­ïNQ¼ŽìNîÒ îtxÑ[#eÖ°GÄpCÐðçÞåHuÍòN?æîJÓpìa¤ï³~íæ˜îa6Vðð´¥ ©‹ãðO Éÿ^ ÄpHÏ€O÷d ˜°/_Z`¤ Òî)ÿD§@ѹÞ¬0ðÒ€òCŸ ™ÎNáÇËd?? Ô~FüžæÊP["+Ž1ðV¯îbåíÕ®ï¦`á.¡ôø¤ï›ÔôƒÖyæç¹°õÍà )ï Ó y¿N7ï>OIÔà Mÿ Îð ên ÐÀ {ð ¦àÚ¡ôÕ`FÅðöpHe, xô(«PZ² Òpõ³¾õÅ ÐOÒg__ìODZBoð¿@Z¡ä ÓpóÏH!AR6–î7´ùÖîôÒ0V¬Õða"³å²ž µ.óCôìŽHËEZ|¶0PEíÒÿDö©/ ŸEh> ÎЄôOòp¿ ÔF¾^cÌïÊO[‡ä Íæ‰¯ûœ´õ–Ø$Xpà*i ­åb˜KÙ4j¿NœXlš³b —%LhÊàG!"ä( ZÃ_×2Rd¹lÚÉ\ÐJN[%òc i #6L&-K–Ϩ­,Fc5›Yé\ÉÚ4b@)þʹò×3ŽÎô$åj'ÇiË>›Ö¥Ä†.aÆ,Y³ëÀkÒ†6ô•s­Ô\X«¡µ˜é[lKËR|j¯Ee(±J›¶ð[’ŒÅ6´6˜b±_hs¹Œ6ñ)ã@Î¥;-,Þ±ÒªU4Jí1½U³Œz3ÿã¦Ê6PNƉ=×NkvãΆº¥¹}l™´g¶3-œ¡5ÕYYÓÌ0šÏîxkþe”wo‘WržžxÜp®Ì„Ù3´HS´©©9I‡ïLÚB”¨q 0SÂÛl>é2NšfCO$ó ûŽ4Ûžš,9küx,Ã|iÆ'þ~ñï®\й(™.”n#g4sé¼A*…´DÍB–X­3Šük1ħ í­@ ´¨™÷ð’é™î¢1ÆxdMo„.< 4Ð?jøƒï)âà’«"YBÌK†D”ƺ“R$VZ2­J¼&|Ï£·èÌÅG¥*æC7{+I‹­Ð$Šð|ÿÓ+¢ÒK™Â„ï-){œÆ4©’¦Ò†täªO—ØäO¦5espQ‚𻬵$²ˆÆ4ÇÉ==œ¦O©4ÕsECÒ³¼èÐdH¹*AA• =Œ4ŠSÛ*K²×â «K3Í 9Ù<éWj‚öªR+:v . ,Q4±bÒL®ZíéVk%sÕ&Us‰¦©%…M“Zò<ö½Ù‚»ØÒ¤/©2ê)*a7²1M›*E+`o3]¬JQ¸šÿô•©à_.\†Þ>ÕdÍbpê›&û¥˜¦ªÁö[£ cyÜ÷­˜?ì¦.³•F©©øz÷d/‰¡¦=¡5¨³”ˆ®f]}áËÿ‰N¡5F)š_°ëXXRÄ ­¬AÊh™”4Ægæ/Ë÷xm¾ðXIXß®­‰{Ü ã[l5°ýj¯Ä¤’ ¾ƒrÛ!ep%F *—Ñ6$fsÁWÛn¦3ã7ï…¯®+{©½¢see•µ2›\¤@ ,Q£Œƒ&šk ¦ôaczu8Ya¥èh°IÖOÔ²tùe§ß”%䌊Ùê÷Š®Á\ÌÀ`.FÖ®Z‡¹ìOrþŠk¿Fáúd+QÿA‹±+°´Þú•Úí=Nòı¹»Äé9dù1Š¡ V¨`ê[V°ŒbÃXÈ`&›Ìd<Ö+Ÿÿà Ä lUEBèÁ°Â%h ¬ÄP*à—qCæ°8Äá5PÈ>V˜¢@ÛÝ j8À@´0†/ŒaHA6QŠRÄÞc+8P}03…ú²¸@+¦°‰XŒ¢Ã82Nq‰¨âɤD+°B‰xâYáD,ÆpY¬ãþÊh…J‘XDaøtÇ&1‘/tc`ðÅ4°ã‚$ 9Æ>Ìž"cøÇõ1c¬$™F:Nñ}(lcWøJ5&±•vÔb 9F#6e¼¤8K„50’jÌ"0Çe7:Þqq”£8Fß"ŽX¼†a·IÿÆÈ˜hôÊWPM:‚3‰Ï´¢Ø@gR˜Ù\”9Ï™ÊHFr›P Ä5&ÊzE˜Â¼†:?éÆ$:sqÔc$Ùù¦Aú‹ý& ú ðiËwáúÐO6¢Óœó\”ùèBs²žnÄh*éÅ,®ÒŠšˆ§{ رu#T_ñ]#Ê0µ,Ä—IlG¹ÔIs#Ì]íÕ†;Ê9ĸ‘*l¸ˆïˆÒÅw9· Vœ{€;ntp-4.2.6p5/html/pic/description.jpg0000644000175000017500000010257211307651604016367 0ustar peterpeterÿØÿàJFIFÿíPhotoshop 3.08BIMÿâ (ICC_PROFILE applmntrRGB XYZ ÕacspAPPLöÖÓ-applù [ÆHÖØ“OG§ŽîcyrXYZ,gXYZ@bXYZTwtpthchad|,rTRC¨gTRC¸bTRCÈvcgtØndinì>desc ,ddscm .mmod À(cprt è-XYZ q0D¼eXYZ a¹¡˜)(XYZ #íÇš˜XYZ óRÏsf32 BÞÿÿó&’ý‘ÿÿû¢ÿÿý£ÜÀlcurvÍcurvÍcurvÍvcgt !"$%'(*+,./1235689:<=>@ABDEGHIJLMNPQRTUVXYZ[\^_`abcefghijkmnopqrstuwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦¦§¨©ª«¬¬­®¯°±±²³´µ¶¶·¸¹ºº»¼½½¾¿ÀÀÁÂÃÃÄÅÆÆÇÈÉÉÊËËÌÍÎÎÏÐÐÑÒÒÓÔÔÕÖÖ×רÙÙÚÛÛÜÝÝÞÞßààáââãääåææçèééêëëìíîîïðññòóôõöö÷øùúúûüýþþÿ  !#$&')*+-.01345789;<=?@ACDEFHIJKMNOPRSTUVXYZ[\^_`abcdefhijklmnopqstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–——˜™š›œžŸ  ¡¢£¤¥¦¦§¨©ª«¬­­®¯°±²²³´µ¶··¸¹º»¼¼½¾¿ÀÁÁÂÃÄÅÅÆÇÈÉÉÊËÌÍÍÎÏÐÑÑÒÓÓÔÕÖÖרØÙÚÚÛÜÝÝÞßßàáââãääåæççèééêëììíîîïðññòóôôõöö÷øùùúûüüýþþÿ  !"#$%&'()*+,-./01234556789:;<=>?@ABCDEFGHIJJKLMNOPQRSTTUVWXYZ[\]]^_`abcddefghijjklmnoppqrstuuvwxyz{{|}~€‚‚ƒ„…†‡ˆˆ‰Š‹ŒŽŽ‘’“””•–—˜™™š›œžžŸ ¡¢£¤¤¥¦§¨©©ª«¬­®®¯°±²³´µµ¶·¸¹ºº»¼½¾¿¿ÀÁÂÃÄÅÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕרÙÛÝÞàâãåçéëìîñóõ÷ùüþÿndin6žWeM(†Â(!GP T9ó3£×¡G*6DSdu‡›³Ìäþ6RoޝÐó>e‘»å?l›Ëü/a•Ë@»ø6s³õ7y¾L•å 9 … Õ % v É  s É x Ñ , œ ý]¾ ƒèO³‡ò^Ð?¯#š"ª2»HØjü'½Ué…!½[ý ¡!I!ô"˜#A#ñ$¡%R&&µ'g((Ü)’*R++Õ,™-a.).ñ/¾01`2333Ü4¾5•6w7Z8>9"::ì;Ù<Ê=»>¬?ž@”A‹BƒCD…E‰FŒGŽHšIºJëLMUN‹OÀPùR9SƒTÌVW^X¯Z[X\·^_…`êbTcÓeGf¾h@iÊkQlänvpq´sXuv¶xiz{ç}®}Lƒ„í†Òˆ¹ŠœŒ‹Ž„{’o”h–t˜–šÜ9Ÿ¡í¤F¦©©«]­Å°$²Š´ò·X¹¶¼¾xÀÝÃ<ŘÇöÊNÌ«ÎüÑUÓªÕûØGÚ•ÜßÞ»á ãQå8çié¯ë´íËðò9ô2öyøÁú¡ýÿÿ $/;HWgw‰œ°ÅÜô)D`}œ¼Ý$Jp–¾èAnÍÿ2ešÑ C}ºù8w»E‰Òhµ  S ¥ û O ¦ ÿ Z ¶  p Ï / ” ûcË4ž yèYÌ@·/§"¡%ª3½IÕeù$½Xò*Êi ± [!!¶"d##Ç$%7%ð&ª'd(&(ë)ª*v+E, ,Þ-³.ƒ/Z0611ó2Ô3·4£5Š6y7l8_9Q:D;8<:=;>ÂĸÆþÉ:ˆÍÈÐÒeÔ³ÖüÙGÛŸÝðàIâäñçQé ëûîWð¿ó"õ‰÷íú\üÛÿÿ  /BWo‰©ÑôBk–Äõ(^ªä"a¢å+pºsÆnÇ"}Û<Ÿ , •  o ß S Ç = ´ 3 àaähïx ´Ià|Àk¿o$Ú“O ƆFÏ ›!k";# #á$»%•&q'G(-))÷*ã+Ð,Á-¶.¥/¡0Ÿ1ž2Ÿ3£4°5¶6É7Ü8ð:;<:=]>€?¤@ÐAòC%D\E•FÏGþI7JmK¢LÚNOOPQÁSTOU—VÚX+YtZÂ\]s^Ó`)aƒbédSeµghŒiýkllãnXoÔqSrÌtNuÔw[xàzk{û}$€º‚Lƒß…y‡ˆ½ŠZ‹ÿ­[‘’«”V– —º™Ršòœ‹žBŸð¡¥£b¥)¦ö¨½ª‘¬l®E°±ï³Ãµž·p¹M»¼ç¾µÀuÂ'ÃÖňÇ3ÈËÊfËüÍÎùÐqÑäÓQÔ½Ö×eضÚÛEÜ}ÝނߟàÅáåã ääóåâæ÷èéêëëÌìží™î’ï‡ðsñXò(òéó³ô—õzöX÷5øøæù úZû"ûòüÊý«þ·ÿÿdesc Color LCDmluc enUSColor LCDmmodœ*¸MrtextCopyright Apple Computer, Inc., 2005ÿÛC     ÿÛC  ÿÀÚ¾"ÿÄ ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?ýü¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢¹©¼iàë[x^ãÅžƒÄ×éo¤IªB·’²F%p°–ÞÅceráH'ƒšå´Ï? uGâ{_ˆÞ @’î{H¯®µh`ŠI ˜C S# ì˜aà #e$:“„±TS³šû×K_ó_yêRÈó*S†m;Y¨Éßšü½:òÊÝù]¶g§Q@ €AÈ®zxRçâç„-üOáëZ@..´XõšöˆR$xoUçÌF>aê+YN1µÞç ,=Z¼Îo•]Ù^Ë»ì¼Î†Šä´ïøXðÍÞ·¤x×ÂZ®kt-.¯ìõˆ&·‚rTžEbªäº¤ç,8äW)«|jð…ÇÃÈô­kNñwü&ºËiºš©g4r˜ÒFš}ï2+E–UŠm숙‚œg‹£w%ý;~zÌ«TtáBWW¾ZÑrw¾ŠÑNNý{±Eq<6—á‰5Fðö¥¯é±ê~“©ê–ÑݼnªÜ*ÈÊûK…-:ç£A=cêë¶ú\—¶‘êwIq›L¢ib‘d‘S9*¦XÃ0Eï é°’ºg%|¿F\µ)µ¿Mí»OªVwkBÝRÃP°Õt{}GK½´Ô´ùÓ|6³,±J¾ªÊH#Ü·Všjèåœ%8ÉY ¢Š)’QEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQE|±®|$ÕoüOãÝq<'¦\kWÿ<9®é·íö´6d4ušQ!;”F±j!!ˆi©ó>o,´ÐõŸ üm𶃩|¸ñ­ÔV=km)ô¯.k[ÝjÎhnÍp±¬/ ÊÛº¶%ÜŠýᄅ†8ÍÂÊQ ª¥UöüÀ3èp?!^5l–”¥Í4þ_ÍÍÕw?J˼MÇP¢¨Ö¥JÉ74ÿ‚è-c4죫J×w³]jìþÝÝ\þÐ?µ477ÃkñBÒT’BË xrBˆÝ]îíÆYRkÝêVMBêM»¦ŸN¾‹Ì韉Y£§:Q„T% BÞû²œ!fæÛv‚³mîúY/Ë;­>ãÀ_ 5/‡¾$ð~‰¯xÒö/Û ˆµÍ>[­hm4ëQg$ (¸gY ¸–³$ÑÉö‡;—WÒ´=¼%â/ ŧøGâµ§‰®´ [jwñ4Úµ½ú5ƒKÛ1«Ëk|Q*¶cz®8ú¦m#J¹ñž­q¦ióê¶ŠËky%²4Ð`ŽFåœjÌ–¶Ó^[ÜËo·åŒ¼`´E†i<ŒŽ:Šæ¥’8S5SGkh´³nþ©½<ü´=œoŠÅc0¸ª˜TåMÉÍsJÓæ§n6m¥ F JÊü­¥f¹žG…¼9¦ø?ះ¼'£$‘é.›Ÿd²6æCÆ›s…=ÍoQE{°ŠŒTRÑ”ׯR½YU©+ÊM¶Þí½[~¡EUQ@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@WñNÛÇŸ³_­¾j‘èŸdðýØðÍôG2Áä·ÙؤªÈG™·;•‡¨=(Ï> ÿÉÅ~Ö?öUlÿõðÕ{ý~Á*þ3þÓ_?kŸŽ~ ø‘ãEÕ|q^ø’Ù´;W»×%†ÒÆÙóɲÏL(Ȥ.QK&ç-_¹ôQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQEQESÄqn§Öˆn¦ƒ,€à…&€<£âÆoøF| x Â>¾ñïÄÝvÞ{­3Ãös­º%¬ Ïyupÿ%µº4Ñ&öË;ȪˆìH§[ý¬#á?ìü£ßâö©ŸýGk„ø#©mÁIþ;\Ì|Ö²ð…a€ž|±%ÿˆÌ€znòãÏûƒÒ¾Ê ›ÿ¶¿k?ú%?³ïþíSÿ™Ú?¶¿k?ú%?³ïþíSÿ™ÚúBŠù¿ûkö³ÿ¢Sû>ÿáÞÕ?ù£ûkö³ÿ¢Sû>ÿáÞÕ?ù¯¤( ›ÿ¶¿k?ú%?³ïþíSÿ™Ú?¶¿k?ú%?³ïþíSÿ™ÚúBŠøOá7ÂÏ¿á`ÿÂð{àE·ü&^/»ñ>¯öŒZ“íº¹Û¾8±áµÙíù#çnæçšõÏí¯ÚÏþ‰Oìûÿ‡{Tÿæv¾¢€>oþÚý¬ÿè”þÏ¿øwµOþghþÚý¬ÿè”þÏ¿øwµOþgké (æÿí¯ÚÏþ‰Oìûÿ‡{Tÿæví¯ÚÏþ‰Oìûÿ‡{Tÿæv¾¢€>oþÚý¬ÿè”þÏ¿øwµOþgk+[øµñ§á¶ƒ'Š>-|#𭯀­~}cYð/Œî5étˆ2Ý\[O§YÈmÐÎÐù¬ˆ®Å0¤×ԵʹšuÅ¥ÔI=´ñ´sDã*êÃb Ÿ¥kz¾›Ý•Ä76ÓF$ŠXœ2:‘ÀŽ äZõð÷ì[âKOö ø&·3¼óiGs’ÍörO¾kîr ÐÑETm,i÷œ Iß˵wôòÆ?xŸXøéðGáφÿå'ü3·‹èê?hoüð§ÿ(èé/¶ÚÿÏTüèûm¯üõOξmÿ†vñoýGí ÿ€^ÿåðÎÞ-ÿ£¨ý¡¿ð Ÿü£ ¤¾Ûkÿ=Só£í¶¿óÕ?:ù·þÛÅ¿ôu´7þxSÿ”tÃ;x·þŽ£ö†ÿÀ/ òŽ€>’ûm¯üõOζÚÿÏTüëæßøgoÿÑÔ~ÐßøáOþQÑÿ íâßú:Úÿ¼)ÿÊ:úKí¶¿óÕ?:>Ûkÿ=Só¯›á¼[ÿGQûCà…?ùGGü3·‹èê?hoüð§ÿ(èé/¶ÚÿÏTüèûm¯üõOξmÿ†vñoýGí ÿ€^ÿåðÎÞ-ÿ£¨ý¡¿ð Ÿü£ ¤¾Ûkÿ=Só£í¶¿óÕ?:ù·þÛÅ¿ôu´7þxSÿ”tÃ;x·þŽ£ö†ÿÀ/ òŽ€>’ûm¯üõOζÚÿÏTüëæßøgoÿÑÔ~ÐßøáOþQÑÿ íâßú:Úÿ¼)ÿÊ:úKí¶¿óÕ?:>ÛlOúäüëæßøgoÿÑÔ~ÐßøáOþQÒÙãÅ ä~Õ?´/þøSÿ”tô²Íý×SRׯÔü[ðûöîñÇà {⌾%hqx'@Öôé¼Ki¥Åqk=Õî·«XYÛ+FVÆØ€êÄØ88¯±,¦óìOQ@袊(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š+Žñ£c“¸k±®3Æßò*Oþé ‘¿f†-ÿ ý¢É9ÿŠ7Âú[âZû²¾ý™å!_´_ý‰ÞÿÒß×ÝÔQEQEóßÅOÚCÀ¿~Ó¬ÞkFþÞ[ˆ„v<’f(^Eò|ÝÑ«¹¨Ma|[ðoƇý«<ñ7á“ðÃÄ#Mðv³áýKOñv½w¦0kÛ>xg‰à³¸Ü¬Žô;7À ò>?²Ž|1ðCÃþÑ‚¼x4Kżñ&©á›×};M»´–æÓP°W›O›Ì¸VB¢`ñy±8÷PßîbþÕõÿÀåÓÊ<ºè½]جý¯—ÿjºÿŠþô¶©ûUþϺG‡¼5«]|JÒçÓ5Ý3ûVÎêÂÎæò8,|üºhbqel²+FÓ\ùQ«£«0e`4n¿iO‚6mþÏã»Sã9uHt³kŸu$]Ï Mo×+‚™LBIÍ9X÷0 |³§~Ï´Ÿ‡< â›+]cáŸõ¯ü?_ ø›Qñ&¹wæx}c¼Õe·–'[2Ú¨ŽßU17›öW™íUÙ•¶z ~Ì>%Ó~x¯ÂÚV±áéVûâç…|Ucqs$ˆÇNÒ#Ð#–9vÄqpÃIœªŒ¦d.¹m½¡NU¤¤ík>÷šOÓ–/šûK¥­bj9%îïgÿ¤Ý}òº¶[]ÑöÅQ\å…Q@Q@œŸ°»Ÿøb/ƒ£?ó&i_úG ~Œ¯úµúWçì-ÿ&Mð{þÄÍ+ÿHá¯ÑÔÿR¿JuQ@u#cþÍ|â‹™$ÿ‚Ÿ~ÌP±;Gµ&ÇýÊúí}÷ªÈo÷M~}ø“þR“û1ÿØé©ÿê/®Ðè¥Q@ ‘™-äu¥eRB.2ÇÐgŒ×ç—ÁÚ§ÇŸ>*ønßZñ_Á)Ô|Wð²; ½Æ Xà’UÞ·—Dê2‰»-¡ æ c%è=íª_h÷vRÉqw´NðJÑÈ¡«® ·<r5ñæ›û4|HÔõÏ…ÚÅŒÚGü#ðòüÞx~å|müKzém5´ÿS’îe”¬s#EM;¨,@,­™6×Ëñ¿éëÑÇr›\–ëý[ñù.ª[·ˆ¿jï…žø9áêIâ§Ñ5ÿéëk¥ù³¶œfÓáÆ­Ÿ;~§kû±œå°I97ŸµÏ‚´Ó&—ªxâæã¿øHmt8|.ƒjóÍymsse* 6ó¥À‚FѸ˜Ååɳæßˆ?²?Æ]+öQ¸Òôï‰öŸu? ü=³ð/€ô½+Á‘XÏelš®—8¾šIo]n.;Œ‹û¸ÜB»Qàý׌ÿg¯Ž2üuð'Äh¾#ø{]ø­yãË o|Ccà£o£èzNŸ¢k‘AØ=ûË*Kq¨J’²Ü‡&ívl†®ªžÅÊðºO£µÿˆíågfú^û½´NúÙ?›POîrºï§E©ëCö·ðUæ£ø â׋|Wt5Õ<¤h¾¯ ®2Á|׉$éùRº X¥‘¦, 0æ¹oˆß¶¿ƒ<9ðÇ^Ö>x'âÅ›ëO†©ã»y4+ÊÓbÓg·º–Úk»™™>ή֮¦=8ä¬Nö¦û1üLð§‰Ç^øÕ¢X|XÖaÔ¡ñ†±¬ø-¯´íAonVåÚÍoc{fµeÙiå]„‰’ji²6 ü!ø‹àÆZ„:/‰¾ éŸ-ä¸ÓÖ[‹(ì¡Ô¢ûs°uYžOí Æ0±€c88l.Ö•åñ[T»ûß ú|6¾»ßÊ¡Ëílþéþ­_¹¶ÓE×~‡öƒøÙâ/†_°]ÅM/ø'V¼Ôô+iÛÇ–-®‡¡km<—‘Û\&LÎìÁ&ÆSïY¿þ:ÍãJÂÏ\ø±ðoâúkºœö¥ðÃE¸¶³´šÖØÜÜÅvó_ÝeÌm.Ý¸Ï îz_Ž>êß¿gÏxGÄ)±‹[Ò5ýYÔ5[-£‚öm.þÖõÖ;vŒ)3[–C|þón ~-|9ñŸŒ¼Cà/|=ñÆ‹àoø^þæhgÖ<8ÚÅÌ76²[É—6îoWWŒÁV E[²çk¬¼—»müïçÜçŒfãÞ©+úë}¼­äp~!ý¬¼¢iZUÆàŠÞ3šûD¿ÖþÉáí;‰m¬lnþËu<»æEPŽ2ò#Wc¶¬Ý~Õ~—Dм-ñ+ÆLWZuŽ¥âmBézeæ£ SYZÎï"KæH—Ęãxâóãóž-Õ[áçìÛ?¾èÚ×§ñÕ—ÃËÏ Ï¨M¤žéînšá¯YD¤ËcIÎáÒ²ü'û9øûÀ~8ø?ãÞ×ö;Õíþèþ?mÿ´ü9k~ÔâðÆÏ²Ik®C¬ØÉsºaq²H9ULBU$¯”q]׆?gM~Åo|BÓüEãèeR\»tÿÀWNÜÞõ]J‹ûcü>»Ò<56‡àŸ‹>&Ôu.ãTÕ´m+BŠ]Gֶׯav÷–æpÎÐÜÅ4M¯Ú%&&(ޏcõ¢°xÕ×;Xddb¿>¹°’û\ºK½{áÒ^ê:Úž¯w©}³G»Žî)¬¯"+˜^XÜÛÃ'”„oÐK²iVÖ¾t÷>LK›3n’M  Ì{±ÆIõ©ºqó»üݾåný]õ²¹i;-¿á¿=z.ÖÒîÅQR3à/ˆü_Ä „€ÿ |5ŸÃTñø×Ü>mÞ„ž»E|-ñþS7®Ù)ðßþ"ðÂ}?â.·|º´ÜYYß[ÞImh–à3ÍrÒZm;HPÈìࢤ™7·>“¦üÑËN’õ줷–#Û#ý¬t›Ëû…øá½?ãÞŸ¦xVoëÚž‰â‹h--ìRYàD·”‡[›©%µ¸QQTBå¤RQ_Öü ðgBð»£êÐx‡Æ^&Ö,´)ô™¯üA¨­Ô×Â{¿¶M<Çbþñ¥' ›"E;5UP>~ý¦¾ üLñÇïu?…pjºEÆ»à‰¼5«êzŒ Ò$¸S3¼0^Ç=ÎmÏüëSÒ‘T‘&W–¼¦©®Eï>oKûÜ¿öïÃ}žú·diAEÎ\Û^6ô÷o·_‹º½´Jç;®Á@|¢üc²ðëé~]> ´[]t^øÖÎ×ZŠ}V+Ybû–ãο‚¼…¦”öþZÊQÂô¶ß¶,ö^$‡WñŸÂÛ¯ |$¹Ö|I£Yøµ¼CÍÄ·zßËpÆÅbmž-6줦]þd{LAJÈÝ–û+é:V½a}gñ#â>ƒ§Î4‹ŸøwA»¶µÓ5ûí:ÞÞ®dc]Â-mÒH ¸$H•][/¿¤¿ý™>jÞð¿…µf×õMDñ.»®­ÅÌe/eÖcÔ㼂|F ‡n­t!F,ØmÝ•ÔgìÝÞ¶íäþOo-Î|+o•Õ¾Êö·guëµúv²>jÑ࡚¯àÏÞÚxDñ»m¦éº¦‹¢ø?â›­Ëuö§k§%½Ü‘mKô’òÐ9xÈo’wÚå;ÿþ×÷ÞøýàÿxëÀ~ðÞ±ª^èºuþšßì¥ÕÍÖ©,P«iúxͽµ‚IBË;›|‘‘$ Ïeeû(hMá™4¯|WøËã»X“HƒK]gU³ ¦[éz„:…¼QǬqÈÍ-¼K$ó,“º.ß5zÓüaû)è,ø¥ãÛüMø¥á+kúoˆuME—M¯ªéÂÐZ]îžÎYŽÁeoû†ÀJdÇ“š›ÃÚCOvúú_ó¶ûûËMÊ\Ü’O~ŸrûÕïkÛÝwzÙuàoÚcã6½§ÚøbOƒ~×þ)ê>$ñ`±Ó­ü\,´Ø4U/4÷Mnì'ó&†D‰„¬¦V0+MM'ö‘ñwÆÍNOüðV¯á«Ë¿‡öþ#¹ñ~±{j†æºþІÞÝì˜9º”]X4lˆDf?1¼Õ"1'esû,iPkí®xSâÇÅx–=o[¿²Õ´¹tÉe³·Ön#»Ô4ôK‹)#kg¹gS"<Ѹùe òÖ–™ðÏá7Ãßß|YG®¾ØøcB¶ñ¢ZÂ6°7Ïk<Ò*‹´·ò¼ÎY‹àm rN2ÖŽ‹Þ·ãgoÒ÷ûWû:ò¯mdýÛé~ÜË•öén§©ü&ñä_eÿ‡Ÿ!³þÍOørÏV6~h“ìÍ< #DXu(X®}«ÐkŠømà‹†³Ï~iwwwúw†4 ="Úêèƒ4ém B$|70Lœ2MvµÑˆäö²äÚîÞŸ=Liß‘\üàý…¿äɾØ™¥é5ú:ŸêWé_œ_°·ü™7Áïû4¯ý#†¿GSýJý+ÇQEŸªÈo÷M~}ø“þR“û1ÿØé©ÿê/®×è&©ÿ i¿Ý5ù÷âOùJOìÇÿc¦§ÿ¨¾»@¢•ÁüQñeï?g?xÏN´¶¿¿Ñ4iï­í®ˆæxаV#1‘]ådxƒAÒ|SàWÚõšê.¥lö×¶Ìì‚XÜa”•!†G¡³«(4›[ùUl5,m˜˜óSR‹’ïÕÖëuuºõ>QñOÄ_V~(¹ðÎ¥ðÿG×ôÿøbYo4ý>æH&ÓõK×·6…^B|Å’V”`x'Ŧ«¬éWßê?Ùÿj¹·Ô®m¥&Âw¸´(ÑH¦6ŽIƒ&Òs†$ீ¾ðŒòë‹swsãA¨ê—¶Z„××wv2^ÜÍ#I”³4KåÈ#gDRÀ7@씰ظMZW÷›ßìÞ6V¶®É­Ö®ú½OÔ?Ö.Äes…L:…]•©­åFÍó)Ý%YsÞͨÙF-JQ]·Åê¾ ø[£ Øiú–½}¬XidWó4vË=åÜV©$¥AmˆeÞUy`¸g#çøYß<+¯|BÒõ½wÂRø²O[i–Í•©ê¶ñ@4KK–6ze³5˳]¢Yc2;³¸\¿Ñº—.ÔÖÂÚIZóí>vå²ïÚW¨ïYãp¸Ê³S¦ínîß‚OÏ[õÛKœ\/›ðÎ_„• tIÉ¿zRë j8Û•ÆW#RæÕµîžM§|fñþ­©xÆMqáMÃRü<ñ««èú”sZ£Ýé×VÐyŸ/n›H hѦ®Û6z7ÁŠ~$ñߌü[ x’ÚÐÏ¥iÚ~¡ìÔtU•.Úé|±o~<×mŽ'\$›ŽJ‘[ñ|øO„ô½ ? L4]:ËQ±³²þ×¼òcµÔûU¾ß7 ¤Fr¨Ê¬J‚,i?t? kw:Ï‚µsGñ ݼvº†¥©êך¼—F]£IÔí¸¡sµÏ̪J‚‘O ‡ÇR¬œÚqë«m¶ôi+^ß%¥¶}Y¾yÁØÌ zz§QÝS“„RŠöÒœyœe)7ìß#jîú>eµñ¯âŒ| aáãám6ßì·­ru jçÃ÷ÚÌw•hÖK[&Û!%|ï¹ÞA, øôÿ>(Ûx³ÄšÎ™wðÿÄZn¡§x@x{JŠYþÉo6¯u-»HnÔn’=ÁŽñʬxHmþÿ¬ü,°ñt¶76Õõ]SRÓ̃LÔtkËêÕ%MšÒdvŽM‘îBÛIE8È9> ü5‡R°¹ƒÃmö+M6ÖÚ5˜íÒ=6qqb<•FZ)9 T±”’¬A¹aq“­)sZ-«kªÒÏ¥½<õ¹–MŸð®/§C‡öµV’j ÆKÚÆz9J3»„y.¹mªŠW”§ÅÅñ[ÅVÖ³c ^k:GÄ=+·rXÅ,pN·)§çDgfR¦òRªXà"äžMy‡ˆþ*ümÕcýkâ>7Ãß èÚׄ.5ßH#šMCI oÌM·2<Xº"¬2¥eR öO|>ø%ÇkOx’}?Nñ|—±ë¶ö·>'žÚ.m–8øYùë HªcˆË哆 I ƒz€_ ­ìüAlž»’ÏWÓî´éífÖ¯$†ÚÖåüˈ-Q¥+i¸ VÜF2«Œm\L©bêû­¥k­$ûE&ýÝÛRvé}éÛ€ÏxS5ç„““p“楢’œ"K[))[]`â¢Úx§â¯ˆ­tÝq.ôíãPÒþ$é~À²,sGtºq–p¥‰ ¿l’0ƒ9ä×™_üyø•m øF´Ÿ Øk,¹ÔgÒe²ðö«®-•…‹¤o$ÖÖ`Ë$²¼±`)D\–f +{kü øg'Ä[M£j³ëwÖÚ„-/ˆ/žyoÃÛÂfò丢¡™Ô».C“m[á?µŸ hZ4úv¥eo¢Ë$šMÆ™¬ÝØÝÙ™ \Á*LÃË¿ ÆG#©MrÉE¯7ª÷ÞŠÍÚnÚÛ›}šâÁçüBTùð²švr|‘M?fÕ¢œå½¯,ý䮯­£ùòûö„ø…—ƒõ›Ï i Ðnt˜.µY|A¤jfÞ[ƒw,}®8ÀÓBG™îÞ ‘Hkí¿|]ãO‰þð€cðÜ#×,oµÔµøežÒÖÚÌÛ«&'ä‘亅GΡW{Äj׳÷ÂyìôËHü7u§iÖZdgØ4íbòÒÖòÒgŠ ¨b•Ré¤â`ùÞùÎã½{á|Ig z•޲“C©\ê^Xë÷Ö—pÍrœ$ð̲,N A„x òü«†°øõNqrM·tîÓµöøtºì´Û[¹Îø>xª0øyB1ö—NkÞ_ºvu/.I{ÍJO›kòÚ+­ð¶£©êß4=OY´°°Õîl£’öÞÆð\Á¥FõŽQàlỌVõfèÚ>—áï iš‰co¦hú}ªZÙZ@»c‚$P¨Š=V•{ME_sóLdéO9RV‹n˲¾‹wÓÍú½Ïϯˆßò™½sþÉO†ÿôéâ:ûŸÃŸò-Áþ识>#ÊfõÏû%>ÿÓ§ˆëîÈ·û¢¨æ7¨¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š+Žñ¢ç“qŸ×cX>!µ7Z ±“´ÐÅß³S,_ðQ?Ú )I.<áv…OWÞø„9îù±çýñë_w׿Å¿xÇFø¿§|BøyâcÁ^9Ó"šÞÛVÓ’9<ÛyH2ÛO ªñO FØêvº+©VPÕåw_¿m{¦~ xmÀ=O‚àÿâ¨öNŠücÿ…ûûiÐûá¯ü"àÿâ¨ÿ…ûûiÐûá¯ü"àÿâ¨örŠücÿ…ûûiÐûá¯ü"àÿâ¨ÿ…ûûiÐûá¯ü"àÿâ¨örŠücÿ…ûûiÐûá¯ü"àÿâ¨ÿ…ûûiÐûá¯ü"àÿâ¨örŠü@ð¯í;ûgø›ÂÓêqøãÃ,z­ýŽÑàè?e¼šÔ¶wwòsŽÙÅtð¿m/ú|5ÿ„\üU~ÎQ_Œð¿m/ú|5ÿ„\üUð¿m/ú|5ÿ„\üU~ÎQ_Œð¿m/ú|5ÿ„\üUð¿m/ú|5ÿ„\üU~ÎT70Yé×wR¤ÐFÒM+œ**Œ’}€×ãPøûûiÿ#ð‹ƒÿŠ©ïµ¿Ú[ã7ƒï<ñ'â4óx#TˆÛkZV‰¡ÛéÇS·nÞi”DN>VXÙ7©ebUˆ ýû[Ëoûü"†xÚ9£ðv–®Œ0T‹8¿ESˆ—é_9|ðŸö‡ìíÒÝ Š(Õ4P@a_GjZ(¢€3õOùMþé¯Ï¿ÊRf?û5?ýEõÚýÔÆti¿Ý¯ÏÿBéÿCý˜¤ í>5ÔÇþZúí~‡ÑEQEÄ‹IH$„‚;q_™ú…§‰nÿaÍ.ÿWøƒñÄrøÓàVµ¬kßëH’][Ãc4$(Äê€yÈq&ó’M(¯'2ÊÖ/í[F¶º×}.¯uuèϸàÞ3yÜ•;Î2Ý'îFi+ò¶½éFz}¨GKÙ¯Ï[¯iãâ—‹—@øÑâ»ÿiž(ðý¯€|;¾×Qj–7:[ÊþFïôä™f¤•÷ù@yªP’_îï]jÖ_ |C{ Z ývßLž]:ØôšuŒiø°QøÓ4¯ i.¹â=FÆK­sQúƒ<…ƒL- µAû£Ê·ˆ`qORk:ÏÀ^°Ôíï-4Ùb¸ÃÄÆöv áÁrâ)PÁb!NqsÖWÕ][}Uïw¯’Ñhuqe™”°ü´åeî£.f¡$íìíh¹}¦Üç'fÙñ ¿4˜ü §ÿ`üqø…­éš„Aø•©Ë¨K*ø|\LâyDç'L™Üd·M‚Þ3戠fë|%6§ãÛøSKø›ã½Káü%šœ·c¯IöRÆ-6ÑÚ¿_ÞMWr\*ΜùE|ÆÁ5öþÄØË±v¶w ps×4ªª‘ª"…P0VQÉåzzvI®©Ûâ~î›wo[{§¯Šñ.„¡SÙaœ¹¬å(>Vãe=)GߎÑjÉCÝ·7¾~wØÿlŸ\ø¶÷Å(ÔõØ>é–æâêø˜æ?ÛsBÒ<`22Ĥ¶:–<5Òè~:¿io[]üPñ4Þ?Ô¾$êú‰|=þØ,ôØaÔÚÑ~Æ!@‘Z:KÃN»06}Ù^geð£Ã6­¼Vמ(Ônlﮯôëýn{‹+ ›Ë4ÐÂìB±Y$U+Èá"¹¡“W¤éòT½Ûw_o½í^=oèÙßrì],BÅá¹[„Ô9y^ôÜ# c¤­;+j“M8¥/>"ü@Ð5‹šþ¡ñÅ ðäž Óu/‡'Ã÷MöÕäóÜù²CÇö”€-š}™·(YAØ ïk íëŠ ©e%A#¡#¥-{8\4©99J÷wëݾ­÷·¢Kd­ùö}žáñô0ôhÑtÕ$Öñkh­-´ß+”®äœ¥&”nÓ(¢Šì>`(¢Šüúøÿ)›×?ì”øoÿNž#¯¹ü9ÿ"ÜîŠøsâO'üc_* ð§ÃyÿÁ§ˆëîO)_ ÁŸîŠÝ¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¦º #*Ý :ŠâõYjj|Èѳê+…›á•$¥¾Í>«^ÝExWü)í'þ}¡ÿ¾hÿ…=¤ÿÏ´?÷Í{­á_ð§´Ÿùö‡þù£þö“ÿ>Ðÿß5î´P…žÒçÚûæøSÚOüûCÿ|׺Ñ@ ~ο ´ÍCöh–ñíâ-'ŒüNrW°ñ¢è{—ü)í'þ}¡ÿ¾j§ìÁÏìs¥Iÿ=|E¯Ëÿ}ëwíýkè ð¯øSÚOüûCÿ|Ñÿ {IÿŸhïš÷Z(¿áOi?óíýóGü)í'þ}¡ÿ¾kÝh  ô x¶‹þù­Í7áž›c2²ÛÆ1þÍzÍ›a¦ÃcXÔ ´¨¢€ (¯.¸øµá›Yèþ‡Rø‰¨Í©Üé×-ᘖîÓLžÝ"y’öè0‚Õ”Mîäq#!ʶÐJ¹Í³tõðOí!á_…Þ'k øÇJÑø|#àÝ}u_ X^LønMè–Ú9<í…2›÷nÚyÅ~çbéÿóÁ?*ò€¶¶·ì5ðcU:ºx¤ÞxH¸þÚûÙ?´wØÂßhòp<¯3;ü¼|»±Ú€?0á…þÿÑ;ðgþ­ÿøŠ?á…þÿÑ;ðgþ­ÿøŠý–þÅÓÿç‚~TbéÿóÁ?*üiÿ†ø{ÿDïÁŸø"·ÿâ(ÿ†ø{ÿDïÁŸø"·ÿâ+ö[ûOÿž ùQý‹§ÿÏü¨ñ§þ_áïý¿àŠßÿˆ£þ_áïý¿àŠßÿˆ¯Ùoì]?þx'åGö.Ÿÿ<ò ÆŸøa‡¿ôNüÿ‚+þ"¬ÚþÃ…â—øqà§\òA·#ÿ@¯Øßì]?þx'åJ4ksä'å@|ý¼!ðÊúæo øCÃ~’ìGö×Ò´¸mMÆÍÛ<ÃÛw¾3ÓqÇS_oið}ŸMHñŒ |VVðýÈÀü*ØQEQEQEQEQEQEG$‚8‹Ô%óŸ¾*|@²ý¢|!ðÏáƒ|â½wYðþ«­ÜÏâOO£[ÚAa>›U0X]´’;jH@*€Û’H\êÿµ±9ÿ…Yû>û«š§ÿ3Ôô¥óWö·ímÿD·ö}ÿùªó=Gö·ímÿD·ö}ÿùªó=@JÑ_5k~ÖßôKgßü;š§ÿ3ÕÄ|IøµûPü(øâOˆºÿÀï„þ"ð_PÖ-ü9ñZê[èí"çš8îtkxßËŒ;•2©!H8öeãÿ ~0hŸìu8ÏSð‹‘i¯øsXb¿Ò® † *«2²²é,lñH„2;)Ízò²º‚§"€EPE ó,b5ólj>/xª÷ã÷Ã µñçŠtËX®uÛOY:V“¤$Û¼ˆçºX'vž@¬â¡‘–1½ö‹Ì¤uÚØž>~Ï£þêæ©ÿÌõ})E|Õý­û[Ñ-ýŸ?ðîjŸüÏQý­û[Ñ-ýŸ?ðîjŸüÏPÒ´WÍ_Úßµ·ýßÙóÿæ©ÿÌõÚßµ·ýßÙóÿæ©ÿÌõ}+E|Õý­û[Ñ-ýŸ?ðîjŸüÏQý­û[Ñ-ýŸ?ðîjŸüÏPÒ´WÍ_Úßµ·ýßÙóÿæ©ÿÌõÚßµ·ýßÙóÿæ©ÿÌõ}+E|Õý­û[Ñ-ýŸ?ðîjŸüÏQý­û[Ñ-ýŸ?ðîjŸüÏPÒ´WÍCWý­ÿ’Yû>ÿáÜÕ?ùž¢ÓâçÄ? üDðþñ£áî‹àëMzçìZ?ˆ<9âgÖ´§¼ ²ZO$¶¶³A,€7–Z²”Þ£Y>•¢ªÚÝ%ÔЃV¨¢Š(¢Š(¢Š­sr–ÖåÜ@h¯šïþ1øÛÄÿ¼Eá‚ÞÓüqqáé–ÛÄ潯>¢ÙÝ2,‚Í.ÚæYî7GuŠH÷¨wv„:¿ílOü’ÏÙ÷ÿæ©ÿÌõ}+E|Õý­û[Ñ-ýŸ?ðîjŸüÏQý­û[Ñ-ýŸ?ðîjŸüÏPÒ´WÍ_Úßµ·ýßÙóÿæ©ÿÌõÚßµ·ýßÙóÿæ©ÿÌõ}+_5þ×ëñ6?ø&ßÅOà÷‰µ üBÒ4cªé·Ö1«ÌËjëq<*[-$1ʃhÎX{‚ŸÚßµ·ýßÙóÿæ©ÿÌõ1õ?ÚÎX^9>~ÏRFêUѾ-ê„0=Aðr(áŸø$Gˆ~7øëöeñÿŒþ$øÓVÖ¼ º¸Ó<+¥ÝCªL¬÷7·¶!žá!¶–óQ×êø¯á~?üø¢ü8øsðKözð÷ƒôŸ7ì6#ã±1ŒË+Í!/'‡ÙØ—‘ÎXž¸èwÿÚßµ·ýßÙóÿæ©ÿÌõ}+E|Õý­û[Ñ-ýŸ?ðîjŸüÏQý­û[Ñ-ýŸ?ðîjŸüÏPÒ´WÍ_Úßµ·ýßÙóÿæ©ÿÌõÚßµ·ýßÙóÿæ©ÿÌõ}+E|Ô5ÚØù%Ÿ³ïþÍSÿ™êæ|Cñg㟄u Bñ÷ÃÿøßÄ“¾—¥ø×Gñ$Þ#Ò´ÍFDŤwpIkc0Èv!Fp±™¤pÕš®«¥è~¼Ö5½JÃGÒm"2ÝÞß\,0@ƒ«»± ª=IÅyU÷Äíg^‹V±øKàûjV¿ejÚÌ’éZ «pž`–+Û¥D*Íöhä\²¡emÛ¡ü0еÅÖüm©jŸuÙt¨,nÛ[—všÞT±OæE§ôXœÏ rù‚3 (ƒy +Øz òi¾ßx‹_¹»ø…ã-cÄöø„jz.§Òll£ˆ·Ùá™`“}æÜ†=Ú'uV G¥éš^™¢èvúf§Xé:l ¶ K;u††s…E’O½^¢€ (¢€ ( œ š(¯+ø—ñOIøqà¤Ôï-5=bþêò #GÒáÞê—“6Èm B@.Ç«3*"«;²"3?ÿíau Ïoð‡àŒN2°j?oÒá=aÐ¥Œ÷daï@JQ_5k~ÖßôKgÏü;š§ÿ3Ôk~ÖßôKgÏü;š§ÿ3Ôô­óWö·ímÿD·ö|ÿùªó=Gö·ímÿD·ö|ÿùªó=@Jד|¾þÔý…¾ jÛßð”ý¯ÀšDÿÛ_bû'öŽû[íN•æg——v;Wý­û[Ñ-ýŸ?ðîjŸüÏW)à[_ÛÂ|á][Àÿ³ï‰uMC´Óï5øZ•¯ö„°À‘½Ç’¾+öRû!w`ŠûŠù«û[ö¶ÿ¢[û>áÜÕ?ùž£û[ö¶ÿ¢[û>áÜÕ?ùž ¥h¯š¿µ¿koú%¿³çþÍSÿ™ê?µ¿koú%¿³çþÍSÿ™êúVŠù±u¯ÚÎ1¾O…%Eä¤?õ"ì=7‡Ôé–Üu®³á·Å‘ãIuÍ\Ð5xç@º[_xzþT’KGe߱ʄ¤öÒ§ÏËà «‘$=žŠE`Èt4´QEQEQEQEQEQEVV±!E‘‡`kV±5ÿùMþéþTñ·…5'¾ÿ‚ÅxJ'bD? |OÇTð×øWÜ•ð€?å3ÿ²QâOý:xr¾ý Š( ¼/ö¡• ÿ‚gþÑ3É‘ü1׳è4Û‚kÝ( Ï_‰ÿ?fj^ø‡ðóö ýŸü-ñ·ÃÖ)ma¨·ôå¶×­T1:V¢Reµgvdp ÛÈ|Èó™#“èÏ€ß4Œ4ÿèÒÄ¥¦–ÒþÑn£¸6wpHÑO’2QöH¬¡*ëµ”•`O¾:$‘4r"ÈŒ0Êà ¥|ðšÓKðü'ö§Ð|;§iº†ÿl®“NÓíRÞžoh³\J¥’Fv8Ë1f9$šýê2(ªÖæXFÞ¢¬Ð\_Œï͇%u$¦»Jó‰M Ï×îñ_ÙV÷ûOÅÿ´æ¢øy[â´Q=v'†t .}g8õcêkëŠøÇö79?´©ÿª¹ÿºÞ_gPEPE|•ã¯Ú3Æ:gí/ão†ÿ ~ø[Ǻ§ƒ´«MCZÓõ¦•«ê qJ±é–f—í,qºY C!«Eºý£>é¿tOk>(}ƺ‰²‰´»:à>æñÚÚ^\"5½­Ì â8f‘^C²2©µ5x÷·ÎöüÐKG¯¯åþh÷ +À4ÏÚ“à6¯kâ{›ˆ­a iZÅõüÚmÜ“XÚ°K›»Yä‰c½‚&eW’Ù¥U, HË,jŸ€Z‡Ãx¾?ˆ–Vžðíõ¥ž±y¨i×vb»e[IÍ´NXyW)9*ì"”]¯ýjì¾÷§®€Ý›O§é¿Ü}E|þ¿µÀæø9oã¤ñãèóëRè°Ù/‡5«½üJ^[Q¦}Ÿí¾rF ¬žFD¼?'ÍZÚoíðSZø“àhŸ4sÄ^/ÒcÕ¼;i¦E5×ÛlŸÍÛsº4eH³Š]Ê…`ªHgPK;ÛúÕ]}ë_MCÏ×ðvsÑùžÕER¯—ÿlþÉû­úàKkñÁÒFýÐÿÂQ¥) öʳ)ö$w¯¨+å?ÛOØ Q?õ ºðÍþ¿НÕ5­JÚäG†ì¤¹·±†öpTîG¼¼µ€.W†‘óˆÈ<ߎ¿hÏ韴¿¾ü5øoáoêžÒ­5 kOÔÐ~ø/X°ñ½äÖþ»Õ¾%˦Ý&Áïdûe°Ò¦ì)jÉ/ÌH‘Ù|{ø·ñGàïìçñ'AøWá/éz‡®uÛ^xæM2[K#Gm‹ ÅÉ J77“÷›å¶šWbŽ­%Ôú6Šù§Hý£ô= ÄÖ~øç'‚þüL»±“V·ðþ—¯Üëp¦”‘Èæþk£en°D¦ €í"„B‰—ÌŠAá¯Ú_àŸ‹ZÙ42Íq©ÙiÖðêZ5îŸ,²Þ‰~ÄÊ—0ÆÍ Ç“(Šp<© ŽÇŠ|®ö^KæÝ’õ¾–ï¦ânÉ7¢ßå½ý-¯¦§»Q^âÚOàŸƒ~Öº÷Ž ŽkmZëKžÞËM»½'´Hžì˜ ‰ßÉfˆÍ><¨·î§"›«þÒÿt?M¥j?t$»‹ÃñøÌ+,ñ :U ×›2äÈoÞ1 »˜QÌ­Í}?Í_ò×ÓQ½¾_;ÛóÓ×CÝ(¯oÚ‡àz|)O·‹ï—OmiôQ¦Ÿj?Û?oHü×µ:_ÙþÜ&X±1CDDI÷jÕÓh¿‚š×ÄŸxCDø¤ëž"ñ~“­áÛM2)®¾ÛdþnÛÑ£*E˜$RîT+RC:ƒVw·ËæÕí÷kè/êþIÙýÏGæ{U|O¯ê§Jÿ‚¿øâÞ#å¥×ÂÏ Jê¼q©x‘w}¡F}ÕöÅ|ãöÇüSÄ|ÿÍ'ðßþÂ;ßÛ‹K‰?³£—ìÂÝ–2¦iÍÜ *L³³2ÄŽÈá@=ÒŠùñÿj€©ðËNñgü'ÑËa{­\h°ØC¤^É«-ý²–¹µ“MXMäRƒ̕$…LQïµHcÝ| øeñwöoð¯Ä6Ñ,´ÝzÙîlãKƒ2´>k¤n¢T8Ê‚7cµzMQ@bkÿò›ýÓü«n±5ÿùMþéþTðï€?å3ÿ²QâOý:xr½ËÇ´Ç„<ñVð~£á‰:Çö0Ó¤ñµ£è«q§h°_ÈÑÛÏ<†Ub›Ô†$Ž£ç+°àùLLJÿì”x“ÿNž¯¡¼aðSþ±ñþ*o°Âsg¦ÛÿÈ;ÌûØ÷|ß뙿wO—n;ÑÕ>k;nxï‡?lÈuëš±ðgâšx x÷\ðdžt}"ÒÞæmmtµW’ui'Ž8r“æ: <9÷8þ=|:Øøüp7š´~ ¶è_L”jån ¡±û.<ϵý¤$ Æ_”WËÞ&ýŸ¾6øöÔð>½ð¿Æú ¾•?‹¼QâIu=[ÁæúßH­¸k+¤[ø^ád•KE$>QËÂKz‚þÌzÉý‘døM/Å’ÙáþÕmTxr19ñ1Ö²Ú±_7i€Ý~ÆxØ6ù§­(ÝÒ\ߣ÷òûßù5Òó·ÙÔÕòûWü¼Ò·øyŸ/Ý?KßÞÐÑÿ†«Ð~Ç—ÿ £ãHø™6§-ŒŽh5¶AÌ—!Íר¾Ì±O ¾Õ·t‹|Ò#¬-_öÚøY§é)¥xWâÇ‹,¡ðñ^³6‘á®4=5nn-n%¼ÉŠH%´¸Y ¦ýÓìI6°^|ø×uñ@ø'ÇO ]|^Òn¯£µšëÀ’?‡aÓo-íb–Æ+~'CæYÁqç¶c'˜ØÁ ~ÉQx_Á_tÁñ óU¾ñÃi<+©ê::+µì÷ºµõÖ¦U$ |ÉõiX@…˜ÙÈšŽJ Ç~ßöëÓç+'êí¦£¢ ä”Ý—åï$ßÊ7iu믺w ~-ø·âGíYñ×Ã÷>}#À Ô,4Íö];dºŒ²ØÁy4Æo´6T­Ì%#òQ‹³;$#KñWáÃïø*gí/mãψþðEÄþ1Ó&†-ÄÖ"Â1¡®õ:’¹dqkï?†ß ?á^ëÿo¿¶¿µÿá'Öm5Ÿcò~Ëäi6vÌïmû¾ÃægåÇ™·næùÂßò“ÿÚ{þÇm3ÿQ} ·¨ ¬¢î¬¾ûkø˜C™«ËwøyýaûWþËi¦F¯ûJ|V£|BÓÿÑõwþÇöXÿ£–ýŸÿðáéü~½ÇNÿTJ½Y–|á«~×ß²î™á]OR‡ö‰ø©Kii$éimñLin )a?,ØÀ¦¾ð‡üWöuø½á(ô¯®±ð{Ån$¶ÖGÚ´æõXï"_º1÷æŽ_®ú¶™k­xWSѯƒµ•ý¤–×k‘J6c‚y¯Ïß ~Áÿ³'ÀÇsá/‡¶š÷‰aŒâ?0ÔoÝפ‹¹DP¿'˜cŽ€=ö3t’ÚFHÙ^6ø´YNAÃZ¯´kãØÛîþÒŸöVÿ÷[Ð+ìú(¯Ÿ¾#üjÖüñ Äú6ðîãÅv~ðœ^&×oƳ¨†Í¥¹FH£(Í,ûmduO•[C·w8Ÿü{oñÅ1ø{a®K/¢ðß…aµÖÄ;•ôeÔ¼Û§hÎÄTc2†`%*¨ídóµ°ÞÑÁ7u§ÂûÛ¶º¦´¾¨ûL'‡ùÖ'«ÂåqçW©M>_wVœ¯)ÆOšÞî»wñ÷à/ÄŠ>6ñÅ…ÿïÙßãOƒõ»DO ^xñ¤Óõ?9¶XfX Þæ&‘MÊ‘,+Èé»hB²ø/à_ÇO‡>"Ô|/£k? ü_àï뺵âx™®%ÖbšÃNÓ¬®, /òLtØ¥Žáî‘¡i¶;F¥þ«ø}ãükà9uíçÃzÍž¡q§jºd³ …½Ìä IÀd}«¹YIU9Î5ÏŽ‘é?µ„_ "ÐtÉdIí#¸{ÏÁe2Ü¡a=•œª>×X"VY—k…G*AßëÔiSŒ¹¬ªZÛëö—¦×oFíï6y˜~Í1xÊØjtï:”¤¹£h¥e)]»>–³ißÝZŸÇû~Ðz¯…õ‹Oêž ¿Öµ?…ž ðV§­j?uÍT^Üj k"jÙÏköm>-¨V²µETY3¾O-#¯¦þ!þÏ~*ñ‡í7â/XêƒC¿ŸÀOµÄ²‰U|?¯]jWa”DToŠdX°Ç.6ÀÇLøé¯êïwk;&å³ÒM;žñ öPø‰«þÓ"ø©¡ßiZµÔ¾:½Õl4(> ë>iìo4=#OrúŽ›šˆçÓ ÂÉÅ! C·Ô?goÙãÄŸ¾$&¹¬ÝxNHeø{a¢ÜC¤Ý_NSP]WUÔnÙ^ñ¤šH‹j²JÒHÈÌÊœ êázxÆëYðÿ†t„æûÇwçXKÍ:_E“i²[¤öŸ(³Ç'ÚcØÂ Ùe Š7ä5ßÛÂ>›¤êI²†Éü3câ VßWñ®j̱YÛIÍíÂ*3:+ ¨Vg`•Íý½‚§yÙ.[]4­ÉeÒÏÝwo§[T<1â\[P£‡Sr¿Ã:oþ^=t›²s‹Qz)ÛÝæÑŸbÑ^eá/ˆ7Þ(ñ_£ M¥xcÃ÷²YÅ­K|¯ý¡$aYÌpªî‡ÌOÞÈã5‘ðÏâg‰|~Ú^£ðãQðÇ…u½kÕ›SŽçÍš=‘ÝFª>Ípé*H±†•JîùÃ)Zë§¥QÅE¿{U£Û»ÓDí¥í~—<¼1˜Ò…YÎ)*j.^ü>ÒrI.kÊVM¸ÆòŸ2G²WÉ?·õŽ—ÿæ×u=Nò×NÓm”Îîì@UP $œ 5õµ|§ûjÉ€ê?ö;øCÿR&ºŸ-~Íÿþx÷EÔ´ÿüCð'5 #’òÛC×­¯¥¶F$u‰Ø $ $W1ñsÆ´×…j‡¾ð—‹>ZxWÆÚÅõ¦œú炵+‹­.+]:kÒóI©LXÀWåHÀ 8çØ> º¯ƒ™Y€,‹ëÖµ¼uðÆ|cø[â¹õw±‹Á×÷÷-d¶ÛþÜ.ôùìŠoÜ<½¢rùÃgn03š™^Í­ìÊ‹[3æ½wöÏÓ"ý–|OâÃ^!²ñü>Ô ð,v^k[‹;[ËxíÆ æíÅäñÛÄ‘)m娮Yv3Äß°Þ‹y£Ã:Ïcð.‘â÷ñ'ƒ< âϦ· hÒ\ÚÍ¡höÆæ!-¤)¹†40›y·gF½]6Ÿ/»î·è½Û»+«ö؈+/êÛ}ïÞ²ÖÚ_^§¡ê¶/ÃÈ|/¤ê:ƒ>-xÎ{½PÕnôÝá¯4¨t뿱ê u²ÇåKo0dhòYÊ‘à§Oý¦<­|t‡Áš†>"x†Ãí6—ž)ÓtU›KÓîo­#¼µ†à >Óx&…ŒÞG†EW•[*0>~ÌvŸ¼—iâ- x+QÐ.cÑü'm¤Ù ¯¯îIáµ·eH¢Fb‰ÌÛBï™Ûs· 'ì}ªKûBx ŲøçÁiá›k}R?­¿ŠcN†ÚÂZ¤Å…ÃBÍ$3Ã;m¸™ᔦtlä”ôÕ_ÓšIýÑQk­ß[X‰9'+.Žßt-÷·4úY-·>ŒøåñsÃßÿe/üPñÖŒèZ-ÕÝŽ£«G`5k¸ ’Xlc•ÁýôÌ‚4]‰nó;Dÿ‚œ~Íß|š~§¨jŸ üS,aZÃıjÎW'Ë»1ì7Kåé_«_¼¥|Jøã‡Zìú…®‡â¯ÞhšŒÖ2*\GÔ2²‡ !*YXŒ‚8¯…l¿cÙÇö}ð@“áïÃ+ûvÁ:þ±›ýEœ.7¬²çÊ$u„SéRh{oìWÿ&§ØïâÿýJujú²¾SýŠÿäÀtïûü_ÿ©N­_VPEyÿÄÿ?ß„^)‡A¼ñ=Ê_ÙY[é–· ·2Ý]ÃjŠ®øPwL§æ qÉkÈãGÄþ(xCÃ_ð€i> ,éuŸxšÛÁÖz>¥â êâÚçâ>·â»ës¤MtÒ#ÝêVþdÌâu‘1"0Ø#2¿ÑS|jñ£]É£iÿon|_¥iOªxŸI¸×£líÅÄðGöYLd]¼ÆÚgˆ‰J(.ñ s ý£n5?]^è_ï5?‡öz¾ayâ6ÕãŽCý« œ–ï¶ÂÎßAæt ­¹KT/í¼:šŸ3Þ?eÛIs.›)G^‰¦µ;!áÆyR”©F”ZIß÷”¯irÁ}½çuìúÔNðæZžâÙc⯊?hO‹Oß<â«ÝiõÍ_þ0Õ$½®¡§\ZÆ’ø~xÚÊ äyaw¾†ui<‚v9Ôrú'ìuñFëAÛâðV•¨éöÓ,%ŸâO‰[¥t›G¬Q_#ÅûCx¯Cø=k®xÏÃ>Òµ ¯ëštsê^6ƒLÓ£ŠÂòXU ÒÆ]îc""FÂO%¤c`¡’þÐ~)Šû_ñ®™à«Ï|4´ðâ«Ä“Q‚ÖëK¶¹KÉgòÓaûDÞ\HÆ3"®#8`X…œaœov¶oG¥Ójúi¢×·Sµx_ĞТÜSö´¤¦©ò§Íkó=­{iwdþ»¢¼ÏÇ>ÔøgãoŽþ·ÄÓÔtµ¹µÕo¤ƒìöÓÌY¶í$¹"2¹åFÊù`7”i¿²Ïˆ~ê÷×_¾([ü2Ò­üU6µáï ¿‡ä¸ðõ¤7VP[ÞXÜYÅuž&šµDÈÑ4HøÜ˜ßU/_¹­>w“o]V¾õ'¢åóüSûíhÚöÖúØàüCñËö…Oø'¾6x7Æ_³‰­|i«ÞMªi:}Þ±¦xªÚÖ$– mŒ’ 8–)`•® ºä6Þ¿dü9‹â<|QÖü¯xŠYÌ‘\x[D¹Ó-‰µ WW\6ü·˜~Q‚O‚Ú~ÌWÓ~ÇŸ´ÃÝwÇT¾,ø»-ýÆ»­é:uŒ÷6Ø©¶°ûC‰³žI7±q» õ…¼^E„nß審»Î3[6’ói}ö×ñíeÙ%¡“Z¯Y}×Óð¾÷}õ<_Xý¦?fÿx³RÐ|Aû@üÐõÍ:éíu ;PñÖosi4lUâ–7˜2:° «A_üYÿ‚§þÏŸ ¿jæøqrÃÆÞ —J·¸Ç> Ömu‹D¸•œI ‘ÆØ „%’Gr\,`ýD¯þ.~Ä?³çÅÿÚ²OŸ|5©xÇÄ‘é6öi—š‹¦™¤e—Ék;ûX;´d*ü€äœË>uð¯Å¯‡_¿nïÙwÆ ¼Saâ¿·Žõ8ZâÝ^6ŠAámqŒrG"«Æøe;YAÁ½~©W漞ðç„à¡ß²¶ƒáMEð·mãMMmôý*Ê;[x‡ü"úïÝŽ0~¿J(â?‰?² ?>&|kñ7ÄŸx‹Nºñ…àøü/âÍBÊ -6ÞßÌ„ÞÁGÄ¢þk©öH² _,¸¯ˆ¿³ÿÇO‰¼Ñþ%ü?ý—þ8ϪøvÒ ]KÄÓÏg?ƒ5°ÇïØ¥N’k«gê2^ÞUi] mWô=Ûd.øÎÕ'µñ­ÿí/ã{¯ÙÚÿźÂø¼?q©ü>¾ñW„æ¿×Rá%ŽÐCç„HÇ—…¸ŽXÐ;Tc tó±˜ì><µ/ªÙ&ö¿U³mîšmÚÇÓðï æ™ÕKàâ›RQ»”cg=V’iÉ%ôRQŠm«„ß¼Lž&ý—nfñ5¿ˆÃ45íOQyެϣM§ùÊ0ù‘åHÛß¡?3½‡Ç¿k¿bŠÿ ¼?s¦Ùëž'ð¥ö“a>¡#¥´sOÆ#"³†J«t¸¹þ8øžÇÅZÜ7¿ çðæ­§é~(Õ­õÔ”ÛOyoi(6Ј¸Žv‚Vc ¡Îå_}Ö5[ Âz¦·©Ì-ôÝ>ÒK«¹OðGvü&ºç˜Ó¬çRRÚíénîý4ßm,g ãòÏa^ú\–”g}"Ò÷\¬í(»;;I;j|áã/ƒ~?Õ~.|`ño„¼Iáÿj¾$ø=iáßÍM.Ÿ©A6§/Ú$£*aÍärÄ”l§wÏ^ý“þ+˦üZmhx[BÔ¼Ká<=yuñ+\ñmÖ•¯h··–2\j0+µ»M2HÑÅå¬b"‹ùŒõôª|oñœ³»Õþê:mî¼-?á·ärG¨ÉtÌ ©<±öI’1çJ L0ÅB¥iñ|pñEÞ°¾°ø`ÓüC‡[¹Òu)üCY[I œ7‹8»ò‰{y"¸‹ å 6 cšãþÔÃÂï™®›Jé¹7m¯Íy^ÛìíesÙ|;¯g–ÿ½¥kEFí¾{r¥Oe+Áµ+£æÝöDø‡c£ü-×¼;u£xŸÆúo†5{D¿uÏÅy©ê·±jWwñÞéjÓËÚÄßè’¨VGŒ†Fk»³ý–u¿þË?¼¤Ø|3שàÏhZu†¤ú„6KŒ¬±Hë#Ý[#o"Tši fY>fL6ÍÇÆ¿ëŸa½´°Ô|)àȼk«Mn—Vs\ ËCì¥ZÝ嘤PQÕpKĨ_MÓ¾6ê:‡Ä¿Y_Úø;^ñMç‡t}~]R/2k‹D»id{m»’&6sÛq,,±ü¡•,ãUrÆé7¦š|rZo§3z½5Kee¾7ÃŒë £Zj2qM¿~7V3M¶“Ÿ,y¹`Û²n×¹ò;þÊ.O†¼Y¨êÿÚš¦…âJ]#Á“|kñe§^ÙYÂÑÿÂKºjJ“ÚU%…ÐG3Eœ"0÷ÙÛöxñ'Áï‰ ®k7^’~Øh·é7WÓ”ÔUÕu¶W¼i&’"Ú‚,’´’232§½_ƼC£|SÕ|1á‡ZŽ¥Ðô‹mW_x5$¶’(.$™"ŠÖ6V77[ÌþY1® å˜-{GQšï£‰ŒÛQ{?>‰Çw¾îï]O—Çå¬% s®’U×½íxÍ7Ü£{Å®eh»«îù£ñ»â€<ÿ‹Õ¦ñߎ<à¨nþx{쯯k0X¬û5OoØeuÝ·rç7 õú]_üAÿ”Êx‹þÉ?†ÿôéâ:ÐóOdÐjÏÙv“~Ò?âp£*ÿtÀGç=mÿÃXþËôrß³ÿþ=/ÿ×°øsþE¸?ݽ@”ÿ ¿à®ÿ³_Š~"êÞøo¯|.¹¶Ôî-m5iGöž•wLÑÅ žÝw¡‘B¹-‹»ýcº¿Qt]kHñ'ƒtŸh•–³¡j–Q^麅œÂX.íå@ñËŽYX0à‚ |wðßþ ëû)ü7ø‰ªø¾†Öž5ñMþ¥=ój>/j~CK)—lp¸(F8FòüÀË“Í}©qÃoQF‘DŠ  p  ‡|%ðkö”ðÁ8>ø3Å_´/…ÖËÇ¢üC‡Qœø£OÐÚsqö?ìö³kW¼PÍj·fä)M³L€©uìùñJOxG»ü>_…Þø«­xÿL×­õK‡Öoä¾›T¹ŠÊK&µÁåͪº´éråã€b42ŸqÑ@뿲ŸÄOöBð'ÃÛmoÁÑêÚ/ìì|/º¸’êà@ú¥å¾‹s¡–6 éÓ–b€4xŒå¶ó_´üý³o¾=[Üx6üë~'ÖÚÊËYƒV]=,o4/ Û±¸¾²±º6wks ~î6…Òâ9YD”ª×oûB|}ø‹ðwþ ðøXÉk¨|Óü â‰zbéÍ=彊_ÙÙNÜÅHM¡ºI¥Lí6ËpB³„+æþ$|r¼ÿ‚~þÑÎIM¸Û=¸w‹|R.X|Gñá¯íð“áÆ­ûDüx]#Uð¿ˆumC\ð×ÃM7^Ö/n-®ôˆí¢’ÞÏEb·Hîîs"Û¦X w$¨?K~ÎÚïÄ?~È>Õþ)C©'Œ$šö)'Ô´Oì‹ËÛHïgŠÊîâËþ]gžÕ-æ’<Œ6¦6(ÌÞý>3|:øáß‹>Òþj9®¸5¿ k¿}ý¾ïí)ÿeoÿu½¾Ï¯‹?c©¡Mgö–ÓšD£â„wfüÂ<=¢ÆBðL£Ý }§@s¯ü1Ð Úööòy^Yæs*|ÌÜUQÐ( ÅÕþ ÿÂ[ãmoÅ>-ñ)µmNÏT½ðÕ¤ðË¥½Õ£ÆÐIM \@¹†"é ±«•$ƒ¹÷{urÀÑ”T¼U¬ºi²ôòØŠ|U˜S¯,E9%VW¼ì¹Ýï­ìïfšI¦“MXùÛþ¿Ãmàéü;?Œþ ]xz O²øM–òØÁ F.b¹An¢æùo*Ÿió¶¢lèÍ»£Ð¾ éšGŠ/õ«ïxÓÄš¥î¯e«]Í©Ih<Ë«Hž`°Ûƨ­"”P÷jT).[Ù¨¨†Y†Œ£% U­¿MWÝÐè¯ÆùÝZs§:í©^úG«Mëk®g)[â’æ•Þ§œiß ô 3ã· »ÖU‡ûOdRK„ÿhIk$Ù|¦Ò=Ÿ7Ÿ;²1ÃGû<ø~ËO°±ÐügñÚzèÖZF­›{okÖ›„"i HŸkº-š*ØÈ‘ôO.Ã4—&Û}Öü•½z]œQø+½’èÕ“rZ4Ö’“’í/yj“\E¿lläqi«ëÖÖók×½íºM—xÓDñ½¼£fL8p †ÜˆK<÷€~XxWµš×ž5×ìtí'û'BÓ5kÈZ×H³ÞŒ!‰b‰Bq(’v’@±¨ ËnõŠ+Há(ÆQ’ZÇoºß‘Íþ°æÆ¥/iîÎ×ÑkkõµÓ³jë[7‚¾Sýµ?äÀuûü!ÿ©N“_VWÉß¶¬ð¯ì*ÖM*-Õï<'¤dàÊÉâ-:wÔˆ¡•þˆk¤ñNûáü‹Pÿ»^ç^#ð1á¸r1ò×·PEPEP^ñ‡þEKŸúækÝkÃþ/F[·8ù p±_ü˜ÿc¿‹ÿõ)Õ«êÊù+ö(½µ—ö!¸Ò¢PÒ|â¨5ù­ä—_¿»[Ý ¹‚AþÌ‹_ZÐ-ãé¾7ðtZ&«5õ½¤z¥Ž¢ÑÕ\Égw ÜC,¬6—…C d© pG'«|&Ñõ/ŸÁ¬ø‹MÖŠañµ´°ì3ǧgHx›÷2[–V.JºœcÕh®Zø*5~8ÿKcÖÀç¸ü?gF«Q÷´ÒÖ—/2iî¥Ë÷±óG¿‚߀~x îÿŧ‰|eáß E¥iöÅÔO¦i-"Áöµ€ÃHêLAQ¥.UT(Ú ®ÿÄ>ñެ4øT­vÛI|<­¹6š|ÜÒr»“¿Ï×_³Þ—$%ì>"|LÒ5;Ý2m7Ä:µý³\ë°K<³°¤„L¯<ûÜBcYYW(^¢ßàÏ„,ü=â-*ÆMZËNÕõ­/T’fM¶Ï§%ŒvñE”8‹m„!ƒnc—à ¾³E8åØh¦”4ÿ‡ÿ7ómîÌëqžuVÜØ‡£¿Eª’’½–¶q-ïÊ’JËCÀüUð;F¼øm©ZéBÿTÕRß\m>ÚûSû,O>©|—òîš(‹ÄRxÓÊu !ÈÍ`ü.øQã]?â<]ãxÆßR×.4ºÖ-n¯|­=¥s´vé¦VCqä¨g.S·éª*[AWö©Yé馉ýÚzpã¼Ù`*àå%%Qݶ¯%yÆ£Jú%)ÅJZjÒ¾‰ÿ4¨üK­¥øïÇú%ô:†­q –²Ù1Š Râ;«»D2[1HÌÑïWÎMì˜À©û2x~==/ˆ£Ð%ðÕŸ†õ}-.l–[M´i¼˜&aj$_’g‰ž'Ù É,~•¢ˆåXU´ÚÝûinºßvM>>Ï¡,GþKüNIß–÷RnIî¥ï-u<³Ä_ mõíBßRƒÆ>2ÐuË-Mït}JÂkc&–’[¥¼¶°¤°QëÒXøÏU´—KñŸ‚î´;ÈÚßQ†). I ‚® ŽT‘É®òŠÆž]Fq[=ï­üúylzy‡ãñ®¿+äQQ´RååŒcuk{ÍF7{û±[$—ÏðþÏzBèëßĉší”V‘xvþëR€Í ­¤…áû8X;sµÞu•å@Ù‡ÕxWá&á[믭øÄ$þѺÔ/õ]NXLº…ÅÄ1[³H±Äˆª‘A"F¨ªpNIõj*¡€ÃÁÝG_Ÿ{ß×E®î˰b¸Ç9ÄS•:•Ý¥{è–Y­÷^î+G/y®mOà‡„âµ¸‰oüBDÚ,K/kiaiðÏÖw;N|©…þ½1Cè|¹âo£ŠØòϸü9ÿ"ÜîŠÞ¬? xn÷EnPEPEP_ü0ðÖ§ûJÙüR¾7×:å¿„nü/ö)6±šÎêæÞâ]ñ”,ϺÙÛv³§ ðçì‡ð£Â°?Œ?fïÏ∞!¹¾–Xÿ´K«$»›Íh`•ã88Dó¾Ñó3¶XýIEqWžÒ/h¿üM–çR]{Fðæ£¡ZÛ¤ˆ-žÞúâÂâVuÛ¸ÈO„) &U‰R½­PEPEPYš´FmDÁ­:k xÊž”ùµñ‹Á>;Óþ8i¿þxãÄÞñfŸ¤ÞéKw¥Yi÷"{[¹m&–9öÖtûöPʆΠà7~=ý³á¼d‹ö…ñ¹@x-á?gÿMuúëªøNÏR'Ì>¢¹)>iO!coÝ ÊïøX_¶Ÿý'ð“ðçÿ*èÿ……ûiÿÑÂx×ÿ ?ò®¿S¿áTé?óïýóGü*'þ}âÿ¾hòÇþí§ÿG ã_ü$ü9ÿʺ?áa~Úôpž5ÿÂOßü«¯ÔïøU:OüûÅÿ|Ñÿ §IÿŸx¿ïšüÀÓ¼sûf]_¬sþÐÞ9XÉä§…<8ë¥×Óß<âM;Æ^)ñW‹|M¯xÏÅž&ÕcÔµWU·´†IeŽÎÚÉc´‚•VHFdI$šúš…ÚTR†ñd³]¦•á»]5@qè(vÉ iÑ©ì*Õ TK@r^-ÓÍÿ‡åŒ.I\W[QÉËF€?,~$ü<ñdžþ2O㯆¾*ñ7€|ZÖßeŸQÑš".à ]"ž ã’ ÕX³'™,ûHá¼¢o~ÚQÎÊ¿´/JƒÁ>ðçÿ*ëõãTð…Ž¢I’$lõÈ®NO…šS9?g‹Ÿöhò»þí§ÿG ã_ü$ü9ÿʺ?áa~Úôpž5ÿÂOßü«¯ÔïøU:OüûÅÿ|Ñÿ §IÿŸx¿ïšü±ÿ……ûiÿÑÂx×ÿ ?ò®øX_¶Ÿý'ð“ðçÿ*ëõ;þN“ÿ>ñß4©ÒçÞ/ûæ€?,áa~Úôpž5ÿÂOßü«£þí§ÿG ã_ü$ü9ÿʺýNÿ…S¤ÿϼ_÷ÍðªtŸù÷‹þù ËøX_¶Ÿý'ð“ðçÿ*èÿ……ûiÿÑÂx×ÿ ?ò®¿S¿áTé?óïýóGü*'þ}âÿ¾hòÇþí§ÿG ã_ü$ü9ÿʺ?áa~Úôpž5ÿÂOßü«¯ÔïøU:OüûÅÿ|Ñÿ §IÿŸx¿ïšü³Oˆ¶›Hý¡ñß4ùcÿ öÓÿ£„ñ¯þ~ÿå]ð°¿m?ú8Oÿá'áÏþU×êwü*'þ}âÿ¾hÿ…S¤ÿϼ_÷Í~XÿÂÂý´ÿèáñß4ùfŸm6ûBx×ö)øsÿ•uÛøsÁ¿¾$|BðÖ³ñƒÇþ-ø.‰tnt‹}R ;[K9Ù fu·³‚š`Œè$ufUw FöÏèºü+ÒCôx¿ïšè´Ïéú{†H‘HôOÀCiº(Ë‚W¤TöñÛÂTôQEQET)æXȘÎEOGjøoãÿÂè¼eá;›ˆ't.²Ç$<3C"8xåŽD!ã‘UÕÔ†VPA_$ßø£öÁÑ Xi?´'ÄeÙÝh Ô˜Þ–m9äsîÌO½~Àj:-µüEdElúŠá®¾éw—h"$û ü¤ÿ……ûiÿÑÂx×ÿ ?ò®øX_¶Ÿý'ð“ðçÿ*ëõ;þV“Ÿø÷‹þù£þN“ÿ>ñß4ùcÿ öÓÿ£„ñ¯þ~ÿå]ð°¿m?ú8Oÿá'áÏþU×êwü*'þ}âÿ¾hÿ…S¤ÿϼ_÷Í~XÿÂÂý´ÿèáñß4ùaã_Û.úäAuûBxçÈ•Ä~ðôlAë†]0õØŠúKà7Â˽ûQÕuKV×u[³{«êÚ”í=Þ¡pʪešFå›jªÂª¢ª…UU[[ü0Ò¡”8·‹ úWm¦xzÓNŒÑW‚€4´Ø|&(ñŒ ¿H è)h¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(ÿÙntp-4.2.6p5/html/pic/sheepb.jpg0000644000175000017500000004750710017034540015307 0ustar peterpeterÿØÿàJFIFHHÿí¢Photoshop 3.08BIMí ResolutionHH8BIM FX Global Lighting Angle8BIMFX Global Altitude8BIMó Print Flags 8BIM Copyright Flag8BIM'Japanese Print Flags 8BIMõColor Halftone SettingsH/fflff/ff¡™š2Z5-8BIMøColor Transfer Settingspÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿè8BIMGuides@@8BIM URL overrides8BIMSlicesm´sheepb´8BIMICC Untagged Flag8BIMLayer ID Generator Base8BIM New Windows ThumbnailXps€åÿØÿàJFIFHHÿîAdobed€ÿÛ„            ÿÀpX"ÿÝÿÄ?   3!1AQa"q2‘¡±B#$RÁb34r‚ÑC%’Sðáñcs5¢²ƒ&D“TdE£t6ÒUâeò³„ÃÓuãóF'”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷5!1AQaq"2‘¡±B#ÁRÑð3$bár‚’CScs4ñ%¢²ƒ&5ÂÒD“T£dEU6teâò³„ÃÓuãóF”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·ÇÿÚ ?ã¾Ù—m¥ïÊȵ ¹Û_e¼¹änvÖëô”mºÖ¼±Î©_µÁò.‚Ö–¸ýoê®}¸}dßS+sM2Êò7zf§¶æ=Ìý#7G¶í¶(õ\\ܬ×䛫ʺÇW[ݸ´ŸN¦0K²ïÑTÚ½k®þôIN{r-`¸¹¤ˆÊö»þ¹¹«®µáâë!¬IÛ¦víqÜç;èìBºœš×Y²dFÛãàØc¿ÓÓùÍ»q]q¿PƾæÚÃ[&7¼}ãoé\÷~÷èÿàÒS¥ö,À.Øúe›+{vý&qúK*wèÿFûWÐV±ë»`‘:ÛI“ßó7¤U1­ª×2Æï-{KÜßNÀÀ]¾Úæ›ëd~´×ûîgüZЦڪ´bœp}ƒÓöî´Û»p}Î?¥ÜæWúJÿš®¿ð))WcäÐãYöØ5–ÌK¿7ÜwmnßÜõ?ëj“î°´n Æ® П£ïüÅ­¶·>ø1 -s˜Ý#Ô±Îýßó?Â+ǥ͵¯¢¿mâÁ¡…Æ.m·3kwTë=6·ôv~Žïð›S„ÏVÇ8{šâ @&?÷5±üâµÚZàà\$w‘>ÖÿÔ.„²Šëc+.h¬m¦Ú‹C}G8~‘ï© *´<µ•ÖØs›êV×6ïs»wóþýžÿÑ×þ%<íuÙ[Þ,s¦È- ™çémÍå%¡’Ð^lØ+3éÍk½ÌÛǵŸ˜’JÿÐãñk³%¹•Š÷Öó·ÕnæÇéZ}¯ÝûŽF¿í¹W3Öö¸n†ÔÖÕ!Ǽձ®Û»e[¿›£ô5~hbc `Á§P'ñþoó½l~Çu…yì·$nÇ­ðl?BŸçÜïÜö{ÒSÅ_~Ãm¡Îloq—ØÑ®?Gù,Vqúu”†XÖ¶A—æ˜÷´mtnú?Û]•ý%Íʯ¦½ûe¬õ‹¹¯°µ»žç9¿˜ÿnïóHvt›Fxéà5ù̩׿·êŸkœELÙíßïþsôi)çö佯hc+õAZÊÚÛ÷î{Ó{}f7e¶„W¨ûcaâºßh``{«nâ×p=O£c¶û7¿ßéÿ„ZÕt›*Êks™ê}™¯´0~s€;[·÷›b²zifsz^æ;:ÚÍ£"°NãešTßJ=ߤúi)¤0.kç ·=F;ÀâÂïUÍ-ú.›*gøOúÒ5¸YVc9¯¨ ÎÖÖÆc¹²æ·{+¦Ý­mn÷Ûú?øÅ<Ü*ðFrmmnÏ3ŽdúZ ÓnS‡Ù™ìý'Òö'¿ ¼Vâúײ:ƒÅxeÞÛNÖ–ÛTÓ±û¿:Ï¡ü禒šžsCÝm5È+ÜÝÍ­s·†Ñž§þš¹¹Î®û(¨»a&ÜWtþvÑìmxìcýMžŠÐ·§z-̾ëZÆtæ‹2áæÒÀæîoèñ½gû«ñ£Uéf=µQ“ê³fXýY¾£7»óÿ™Ýê1ÎgúOÒ$§:Úíºûè/{œà@Ðë·wõ}©-šñ[Ï˺I)ÿÑ«ƒH–°;ÚñÓÒNã»ù2­}wêí?Z:EumÃÅÀÈÇa¼³EƆÙúVíuuU[='oýNÝL4NÖö#·}û“u¾—…Ô=œÚí²ÆÖÆt®«ªõ¨Þ¤Ë-ÅËönoó©)Ö¬üÿñ‹ƒÔkm8˜9Œ¡¡Ñ¶ÊÝgª×Ù-ÇÚÚÙþ‡Ø©õî§Xúû‡Ö©exø¹µb¹Žú¤\ç1öo÷l½¯÷ïöQX»ê÷LÏÍÁ®ÖY•eßg¥ÖµÅÓMFÜ~Ë+{­×ÿ¥ýä_¬êö'Ö/²õ’ì`ú=cÔo;Ûhm?dfÊ1w?ÔûEjØÿôðžšJjýfëoê__1qú•mÇÄÁÍ«ÝÆimîsì±ÞßÐZ×þú/ð¤U?Æ7XÍËúÑ›Pc0œê©dIu[Íž¯æý&—˜·~´ý^ém§ «u ßqê0dæKª¬o WO©»õšë¯oÚŸúð>‡£úT{þ®ôN­•Öju}R¼@ÑiƬUk7Xæ~Žª¾Ë~Ö>Û+²øD”áÿŒî³‘•žÌZì­Ý'ÐfGNu|=–2°çsù–UµžßßþZŸøÆê×:¬“ŒÖÜzoÂ{±ÓX«k3emüßå­Œ^™õ‘¸mõ±ŽEía³µ‹n­˜ÖW“[_S£CO¯c]o¥WÚê«ôŠŸUÆèÖäåtŽ¢ê°léõ¶ŒGfû‹™ê·&ŠéöU]UºŸøOµ¤§?¤uŒŒño”zig©nsèêD}6S}bª­í³÷)wúOúëˆ.³.ªèqmµ›^Ñ8½»íý×/Bà¿Šë­Ø¸Íµ¸ly`cý;¾ÛMžÆØËkû?ë?¦ý'ü*ª*J£/VÝäZk]FM™8–9¾­ÿ¡vÏJ¿ô5¤§¯}@=ð4“¯Í%_2ܺ=[j}/.>ˉýÔ’Sÿ҆ݭÜíÄît©ÿÉ-<\\p^âÜ}òd?{þ©s¸Y¢X; ‡}ë^ŒÖ±œ‚G=àsÛ褧g¢ãáãõj²ô·4¸~ó˜êë.Ÿ¥ûŒõ–ýaÌË»­[ûUþ¥ÔÝéÜù´µÛ«e~ï¢ÚŸùÎõüÚï™–ßL .>›ƒ¼#ée ¾‹Óz·W§"€Zû¬±÷42Ïé¿¥ÞíÌs>ÎüGdz·ï²»ò1ÿF’œoñÔòò:».tËkfF Úà7 ÑcÁýÇûõoª¦Î­“þ,ðhÛëäcõXÌõls˜ ¥¿›m.ú_ú1i}h§¦°þ™ÕØ0i¾†µBÑö‡×W•S*®šý_SÔmõ]²Ú±*¦Ë³p:uŸW~1ê=;ç_‡Šö¶ªý&\lßM6 s=÷²´3ùSþÔJy/ñwŸégõZ›hnnNƒ‡½§Õ{ý}»ÿGþþ)r™}C3#.Üœ›'"Ç9׸l.÷ýoÒ]ÏHËú±ÒºW©¥“xŒœ:«{¬Ò×Ý[>ÚïM·;–}žï³~Žæ)U‹‡öÊrpñ+u¬¬×ƒk[X6:Œ¿Rœ¬v4ì{2±.m>ê}Gÿ„ýéR¾¡`µÝ쌆’÷ä¸08Ahk[à ÷»ùÅÒŠXÑíl4Ñft¾ªÛ3²1¶Y7Üü‰q-õ^æ\ö½íõ}Mÿ£gÐ[Œn𤦷¦uððIZs$O’I)ÿÓå±rhy6¸M­¶¶ÖA2Ö7Ýôto¤èôÝüµbΡ]fÓìp°9š¢ñôdþoÒY8ìÙU•¹¤ú¶4µàC·Öæý/{¶ÓZtÓëÕuA­sžk°>^ ú^“?u›NíŸù”ÜÅÍqh‡£¯.Ÿú[?quSò[óQmOn%¬;è˜p/Ý'ù-ß¿üõÏôn—Ô/f-VWYÿ a-–6·Ù¹¯»{†Êÿ3zÕÇè™X¹L8yµeeã;_CÛ¶KëcÝEÎc^Ë=;«ÿFý‰)óιÔúP˶üýÍÊ2ƼÃÒg¢ÊìÝþ•Oø_çqõ³ªåc}Tú¿‰‡`·+ª¯sAúLm.¨k^ë(ÓþoÑ»þˆ]Gü_×wS¨ä2Ú†^^G«iÈ`&«,À°¿!Ïý'Úêvlõlû=ËK©}_ÅÆÀé]/«Šq1k¶Ø•ÞZïÐæ]-sl»ô¶Õ»þý#ÒSæ/É{ ˆt;qèuÕ¼{½ÞåëßSºKhú¯Ó›|›‹ó»óEsØÎÿàÜÅËt™Ñ:^ÛrÛSîµ¹X·ŒÝû=ÕZSk¥ÛZÜ‹qmþg~÷¾¯Ñ®Ïê÷PªÎ›‡Ž Am,i2ѳè7÷œßbJnŒ6´{xû’û+ãOŠºÒÞð¤^Ð'·ŠJi:˜Ž;$sÁvÁ$”ÿÿÔâq+k‹ío¹µ9Ÿ7z›?ªÿjéz}Xn nt·Ópú-“ô½¿OØíõ?ëk¦ÖãFP:’k ¶noõ~žÕÑá5à^ã©Þ×8éú>›’S«Ñþ•œÜƃsÓ[ÀvÒC÷S»ü%ok_îþwè.këµÖàu+ëÀ}¦Œ¶º÷2wKúÃÃ}mÞžçûV³õJ¿Dº\PøA ÇTÁoXèù· ²E”=VQµÙÿ’Öúoÿ„ôlIO’[——æ ®}»±‚Â] Ôí÷|UœlëÁâ\Ç0Ô ¸ú?c·7Úõo+ê§UÅétõ{oÄÈk OÜæzžêë¹±í{›ÿþqXéŸU:¦ê²rZÜvWÔ)À¶‹7 Ûm®n×vû[±ß½ïIO¥~Ëõ ß|¸Û6»ß²Ë\o½ôîXïUîüß¡±¥t pÜë(sÞfÇ=åî$ÿ_ó?u«a­üÝ¥AŽƒÔõ=BÔ­kJw늿ÿÐù6—®ƒŸ##ÜÆêXŸH»¢ªúöº1Û~…]ÿÎëZ%·åõƧù™¦[iŸ™^S½×tßô yGªéÚlzºésþø…–[c#Fဪ…±WçDïq`¦á“ÔGD˜2‚ÿåpjônÛb¨™bvž;‘ê[°OF{RÙ‡Úå£Os¹Û@®™k{;‹»‚íVD25"¹|$¤zS­1TÅtÉ"Ó!Ô§²ôƒ…{¹Éç/ÕÏ}3Ç£LUõ?•ã·Ó<¤Ÿ)ù~;ï=y‚Þ[gÕ·K«‹->I§‹êÖ°ÎÌŽdkf2²Æ -تxšî¯y;]´×ü½c¥êè,Æ›wŒ0Ýj–¶÷JÎcX’‘µºFQÙxòZÈŒUäÍ>]mY´ï.jäú$©=ÍÅ„RL¼åaïh\ÈHUì×âÅ^µå<ÚÝk/'—uƒsÇÔ…å½€»žÞU1»E/4hé" ŒÓì‚M*Ư|¯ªÝG}w‘µ}5Mâ46ËmpZÙ¥qèEÕã¶Á—á4ÅXÞ­ùUæ{›Á$~RÖ-F¨`›)Ùdn_jà”Tve”5=(*—ÉäËÚ-&÷Êw°¦¡+[h‰yi$S=ÌœZhm Ú…d  mLUå_˜´vŽÊçËú¥ý䋆ŸwlâCÊeñ_ß/J-:Ô U›_þ\jQ-Œz—®¬$¿ e§Lö¤I4ü©Ä )ZžE{Sbù5ç ê®þWÕ%Š%ýZ=:u‡œ¦†(èµv^ôREqV7æ+} »]bÕb[´¿ÖKz*’’:ü\‚ºž;Ð*qT¯ê3o­/§ÌS‹Ó‡¿·Æ›xâ¯ÿÑøñz/§žSNÉÎÖæÓ“gšn»„Ê|»â¯Ôó/æ×œ¿)¼‹ä«ÿÍ»];ÊšZØë~\Ô¯<—¨Mªi‹cg$WëögÐxÒÌ4d ™¢v],UðƵùSæK 'I¼Ò-în-µÓô]”‘Ec-íƒÈ!ŠáËFI%AF£®ü«ñU$oË?Ì}6òi/|§wou·é/« à.¶±À÷Hê² ϽŠ1V©YëZ&­s¥k6riº…¬‹õÛI„n#·!jµöÅYžñ½m%ˆ‚iBË,¢CÀ"ü,Ḡ,7@>cz-Œì4.é~nƒQ³·Òá|­¯Áhî,=vW o+ÄnÒ9‘ˆ‘Z¨õmñWªéÍsæ(¯m£ó%‡›,F\Íkyt®³é:„(g…#G boŒÆkÜÓdaÕn,4-/GÓUm|·o«Ì4m3×£Ih¶ðúަ6»³’Bwr¬)@1W±Zy·LóMþ©z•ˆ¤Z\wË}"<±JuHÊ#ʈYÖû¤«4 LUä½8Ü~˜*ÚÆ“woû¾NÅZôóXA>š²‘PǵqTÎîÈygEÒ<µ¦É§ê–žlÓlî®H–ÞÛP”Ç=ƒ? ÐD9óZÔ½()гo8ÚÛ7˜04¹#²³Ó໸Šü3qš«_3UŠ*5#~FÛ‚L.$]*ã^\­ëÝÙê+qª@Ä*+L‰(å1øÉ4úâ¯>M[NÓôí ÖÝå¸Õ¡–;«bSЭ×RÍSÏ”t<1RXÔPUNïtˆu[-VömU­[HÞŸ L©src’'Lf‰¨ÓA±¨UåZë_y†öóTÔ#H§Ô),óÁT€#;!‡UÚ˜«Ï¹]z¤R—¢ä Ÿˆ¡¯Êµ­C b¯ÿÒù!}¥I4·Vp̑ȼùA `V.v؆$ö¥w¦Ç¦*úçHógåݧ‘ÖÿÌ:µþ¯ù…§Ák™¦6…Ö—Ù?¯noš[¯Ý—ä9¼h¤p ð­Cªòo7y“G³óZåÊcËP$1i·ždÑ•o½iÌÓÝ,ª³8t¦)¨´h9KÏ`𦻝\YêúKèÚVœ·oq.£kdÐÜúˆßX1%ÄNLq„€„†€íмÕìõ YOi<$Н<î—Ò^#’Rµ4ßÛfš6‘<1H/§—ô|÷\.!YP†™žž£9 f¥ âiнâÑ|Ÿæo)ù[ËÚÆ¹«Xj~]²½zŒv *[K5ÔÒ›5„J$7Aã“Õ¯ øœU3žãÊ~_òö±¦yZ]G̺—™íb‡YÔ¥W²¶±¶Fg¤Qó‘ä3Ȉ9‚£÷d‚IU釖ü×§X^ßj÷ºN½§Þs¾_Ñž¦uê Id`šÙÕ€Tª±*>/Ù4Å^Š—¾EÓ4[= KÕî–×G[t·3X ¾³2ÞEys'#,Dqúi,À(Ýš¡ULt+o)é-ªÆÞk½¾´{û)EÄ:k¬)*•ÍÊð§#*8ï»в}&ßÊZf‰«ù³RÔ:%ìºB„±¶–åníàiYÞE–55;îqT?œõKy¼ËæO,ß^ËT¸–êîÆö/I±"KW Ï÷|kñ)ëCØb¨[mgD³Õ5î'º:.¤Ò®—¨¬ÝZ¤öS”zR:¬Š£íAbÅPr§–¬—Q±ƒU»¼¼Ö"k­Eôâ"ÓmÝã‘îR˜.$QÅx‘ÅkÔâ­j¿‘¦&ó®¹§\Å5Ô6›¦Dçê÷±…™nQî¤Õˆ&Ÿv*Ä|áq¥Ýj‹ƒ$ï¤Úév)£Ã‹yã…"©Vä_^U”>8« ú®•¸e_[™§3ÉzýqWÿÓùé§iÒ]ßNëÄ÷,Ž&$ôÖb9'ƒøî1TÊÃʉp'Ó¢´{;Èje½ü.døc‰¤%šŽXV•ÅU!ò…äw6è²Iojâu†ä'¨UÒN@@ÒJšŸˆoRF*IùT—úšÏ<²µ…¢O:Ë:²¡2•™þjì}¶ÅXF¥ù}>™ªéº_Õî†W“P0AœVµ…Da{S¦*õFü¾ŽÒÄó¶) ˆ‘Ǧ(ô`3C'3Ñzš øîqUÿán-õ[Y®íãëÃ*þês`ü} >è*ÜË1TöËÈóÖòêá–TRÛ‰ le]¡/Zñ¢ñ¯~˜«:°òuÜmc,,I$¢ê;–f~lÔ²Æ)PÕ튽ÉþO·±ÖnëZE˜›”ÛÌ!ÞÒ(îãh^hT2†tçÉjÊ;üÕzŸÔô >->}ÉÒçÒ¸×e½s>§Y™#‰W˜‰\)©dUÝqUš&‹§êGN”ßù6ÊöKÈ$ÝÍ$*!¡u$Šêñ2»)³'Ú"Œª¿šüºšÂɦ{ʺbiWr¯XN±Ùß4Š¥$‹díÆ”¥_cEj*ó8¿.’ûëiÑ좷œÚÜ,·±ú—2¦#–û3ˆùŸ‚ ý‘RI¯4+´šQ£ço·¶‘>$B˜˜u$èiß¾*Èü£ægÒl4})ü¡¤]Á¡*Íqõ¸Òg¿s)g’R#­a5ÛŽû’8ªÁu=-¯ï5mFXÃÝ\ýa (Í*j·!UR›WŠü±TÃü7(QuèYü@°¶§î~¬¤UyÒ•Þ¸«ÿÔò‹k5­æu(I½WtšîSTàŸ^KðÐò),Ué¶¾Z“W•m&)q¨"Èì”ÇnJÊ­ÍÔ³"5A£zÅ•í§iþ©»5̲"¨”ñJµO&]Cgkq¨é²i×â#çÊÆ9¤ŸÒÉoH¯dV˜Þœ* Å(Ÿ>‹m®ùzÞÞ]W\7FDŠT°N]¤¢P¬6ÜŒU!ÿœÕóçå?攵k~Ñü³6m©j~]Ò,í ¸6XešÞe2}Z9ó16Û 5 ªúßÍzf…üã6¥¬µÍ¯ä½®©äËÏ3]ië4Wrˆæ„4šâhä’C4`ŠV I5%WÅóï¿Ì­oó+ÍZ×ïü«¤ù¦ÛÊvâ¯6yïUyí¸ –Ÿcj@…©SÄ*ЂìKìbŸóžžp´ü»üçò¯¦yÊóÏ–çFÑõ½kòëW¸”X_D&s¬`§Õ¤4i)(Î FÜqWÝŸó¾·ù³ù:2<Ù ùkò¶oÌiõ5Ð/|·gG¤ØÅ$Uw¹ #$&EUS²TŠâ¯Í?ÉùÈ0é›Ö?–ñh–œ—ÿ™º•¦‡ä½[T¹ô¬lÑ®¾³ŠÑR6 y;¹ŒÈi@ÜE1WÝßóð)tÿ/þQÄÚOæ¡åŸ1è¾c³Ó´Ý'M•­b‰E¡bˆ¶ª>JDªf5&¥kJb¯3ÿœ"üùóç'™<«ùaƒåï+ùGò»EÍÍö”²þ‘š .6¶ÑÜOq#±iæ’²ò®Ý÷*òOùø/ž¼‹¦ù—ò÷ÌþF‘Ìú~˜5 ÝAÜ\ÛÍ}k¨˜þ«så•Þy³z©N44+Ç}‰ÿ8Qùù‹ùµùO­~m~qyâ;'Í^b˾]»‚+k9à†Öu‚GiጠÏ= m@}±W寘ÿç$õùÇŸùÈ/>kBšËÍvv÷š§—ô„ó@º¾H-­ïY¥H!yPFÁë3ŽTU#ö‹*ý ÿœ&üÊóOç'–8>25ø<¿äYo-´Ñìc[kx6Iµ Õ˜«Jœc‘Š~Ízb¯ÍÏÎùP_ó—˜~jü¦¾7zf±g§Gæ q©Ç] kߪ%Ô’ ‚Í_³P›U†§üç7æ¹çý _óŒöw=üñXyƒM´¶Û,È9M?$Ѥ?þZ€qWꆣÉN ]Õ‘dBhX«…øŽäv8ªqõ÷W¦zÔ§jõ ·ÿÖæ=½£E£dÈÐ +8jÄfJÖ4äØøÔ€;×~‡ÿÎ)zvo竉58l5Oðä’i“L=CÇ!’RbäT¨ $Õ¦*ü*üúüÆóŸ›<êÛyÖf“Tòä÷D±³<é4®¶ˆÒ–oMg’5;§jb¯Ñoùø?ž|¿–?’ï凛®¦òF¥å?ô”¶ª¿Õ/­c‚LÅUX§ôÚ9‘‰4 8«Ê¿çÖ¾lЭ<Õÿ9å{ýq´íÌÞHùjY O2ØK3ÎÖÏPÌÊfV|DN˜«óëó~çÎÒùŸWÒ¼é©Iqy¤JÊÑOŠC35Â$I'ÇFi}DZCÐÕWë'Ÿ¿3µ­/þ}Ëÿ8ׯþSù†[cCÓ­ìu[kÔÉgw¥#¥üÊ ;‹f¨5$4nO\UùÃÿ8™ç½#Éÿó”ÿ‘þnóv¦šw–l<ΫurM"´[¥kxŒÅGÞUåÐ ×®*ú[þ~7yçK_Îß0ýgTÔ®ü‹©ªE Ló/RÎŠêæ š39Tf H¤  Š¥óìïÍÿ'yóÏÍ^_ó»ýRËó[Ëw:'—ÛÓ†MDÜCp¶Ìÿh}dÅéÆÕ—Ï|¹ùû¤ëžXüÐó¶æ-EµènWQ[ùn’á„€BŒK–Yª F¤Šß~„þTkKæOùöŽ¡ä¿ËmRêÌO%ùU‚úÂØ*—óµú¬‘n„ÍnÀÄMBÈ„F*üó5ýýåÓ\ê}f¯,¯#–¸”½ É#kÌîÞõ;•_­¿ó‡¾q³ówüà§çäÿ•õKˆ4ôÏ1K­évVÒ*MõmJÞÒ8§…\ŽkÊŽBEœ6ý ¯È_4Oq%ÃÃ}'=BÓœr^S$nQ’Fm›Tli\U0ü·òÔþfó§”4Õ‚Iíµ-jÆÚN*x¡3!*OÙ-Jü5­8«úXŠÅ’1ÀˆQxÕ¥J·¾Øªï«|^Ÿ¨œzV»ññùâ¯ÿ׿>Tšâ8çÓ¬D×—0…î#UKºG]ù¹lUôg•õ­CF–ÇU³¼[K‹0 Ë4j9£#zmº¹øM)ðœUñ‡üäüãæ³®þk~bþœ¼›S´_/êpi$ÃiÚ©K+h£1GÒÞJ‚¡I~'rª}wù#æ{oÉ?;~Vj^j—\Ó¼¿«ØkÞQ¸·õb´Hn^Å臈-•½ Ûeµ·óê:ú]³j"æ@u9¢µ¼JÜ4 ‰KXÆ8ÀRjqWºyþqËVÐüù™ÿ8ùå»]nO<[&©å£8’+ÙžçO—)¦_J*ÈßWœQO @ä|Ëù‰ÿ8Mgåÿ>ëX—^›E·Ó¼­k«,2O ò Y€Y4é%eJò1“T«ÆqWÓŸ˜¿šOæ•çåd:Þ‹©Ãg&{äõúãÞýbÙM‚¾‘3ÂÔË,f>g¨à¬AÅXGå¯ü㎕ù ®yG_ó¿”}/Ì[‹ øµ=WžÖñtÛèÌFÚæÙ¡’HáVŒ²ƒ#WÔ ¸ûETßó—òkʾjµüÅ{(Eªy¿Î~ZÓ¼ãå›Û+ R’öÖóê׎¨ 3°‰ÄŒ±) iQܪõ7òz?É+^òF§¥ØyÊß™ú5”úÞ™ñ{¸îžÌZÝ$’3#DËpRj–ôÅ_TÎþ[Ùéù«ó*ó]½šËËžS°òÈŠ;û¹—PžBoî®™HYå8 ™HøH=U|ÿ9áçO!ùþrË^jüŸŽÖ WDÓ4½b+£mÕŒ÷Ʋ[_ÁÈȦUöäZÖ§wÅ_qÿÎ þvþj~}ysó[óWó[ó /|¥åˆ@°²°µM>XùÄ.®î&¸ˆTú1„Šš—5S|oÿ9¹ç¯#~[ÎFZy›òæâÞç^òd~®ÐjVïui%üÐG5ý°™Þ¢UYƒ0)V&•Å_bÎÿÎBþsÎMù‡Î¾tó¶¿`<¯ùYaõIâÓíE‘¼¼¼…Ê«°,…FÒÕTn"§|Uó'üüRò7—?5¼½ªySVo1ÞXZhúßš4[ùn.l¯Z0òXK?®^˜Û’3F «ÔV¼~_EÎ%ÎCþlÎT~fi¶ºÎ¡¤yIü»±ý5­Ýèvog4Ò3ú0Øêî’ò«’ VTš…^cÿ?Õÿ+£±ò,šSµç›5‹mJ}QO©-´ðYÎŵíÁpAIh†3¿Õ 1WÊ·óŸ_œ~eò…—”5m{J]ÚÚ$´´Óôû{y![0R(­ãO=>"œù )LUù;æx¼ç¥júÖ‹¢ÚÜyÇLÕL^fDŒfkû‰.ø-De¡_ܨ¡£- qW¾]þ^Üùš×ÌO©ùoL±Öõß4Øy–ò«¶©c9Ӵٴ袒;©G R±,‚K9b¬{^ÿœ{¹Ö´û‰må°ÑüÃr‚æ3=”3ß5çÚæx ŒÕ€$…ãM늽_òÇò¢ßòôÜ4Z¥Æ£,å^Iî‰XðUb"EUJ°?¯¶*÷>c•8üu¥)µkú±WÿÑ‚ù.ÚÆÚ;¶UãpÍ,ÖÒ¹xÇÄ RÍPý‘JøœUï¦xÜõe¨Œá½0y…£áZñ's^ƒz¦ZÁá¡ XDAHÇ:©eR¦´8ªc©i¶õ{¨ÔF¬®ñ ªJ† 銽ZÀZÛÎ7þjhšòéžkÒåšïD»…J›;Ù l'â*̪à+¬?˜QŠ¿™/6>¹oÕŽ»,ϯØÝ]Ç«ió”V‰•‰øYH‡v¨§þ„_²_ó‚ÞhÒîÿçÿ7´?,kMoçÏ+y“P¹†2}#ky¨ZÂ4é\¡$Ã'¤G`A¨Å_~l»×n¯¯ ó ¹¼Ô,šæÖCx¦ÚOÜÕi$A¸Æcf$(éøb¯Øùö§§Cÿ8áÿ9U—¯[éxµšÖh¡-m ŧ´VS0§,åÕòÎÍ$¤×öroŒ*)ñF'´jöÅ_Ÿ_ŸºÇ$üÅó­š.dº¹ƒP»žÖ[–)G4¬Ò%—œjª4ø‡í^“R$Ži9ÅI]ã *VV!O ò uß¶*ývÿŸzyBÔy3ÏÞi¹•æ¿©YZAv7^QxÖµ#Œ€ïÒ˜«ô"[RT¤)P€lH¨¦Ý·8ª‘¶‡§ÄŽ<è7<«°ð8ª ­$yJ”^,Êhi¿cÇoÐZqô·­8òÞ¾«ÿÒäÚôcN•㹉e2¢1ȈH‰9('‘?·{%†¯·õ£’Hë»ÐÔ™x)f#us@6$â¯\Òµ­cæX­Ò‚6ß’© “öª<1U驞A T…µžFZt­wéÓzb©ëë·šlêe½S¼µ˜‘Ô2)Yâf²ì9BkJtÅ_˜_œ?óŒ63hÿ˜^xƒSÔOœ4¿ÌØtmFëW¸CÖzÂú¶7,Ä*òDË3HÍ@»Ð⯰ÿç?çîÿ$l¿1õÍÎ}nËU’Ò<ç{,Z}­î{oÌm©HžH¤“’´AÈ*ÁȆUñ¿çüã+^ùÝ|ѪÞù•1¥òæ½.´‰ ˆµ)MÅÛ$h‰ ê9ÝB²Z×}…ÿ8­ù¦~Mê^|Ò4{;ß:þeßO…¶¥nòÛÚêš§kõ‘H™‚%jX³üJËÈ)оlÿœŒÿœBó5®ù‡ùú~ïWóu·œÔjk²Ã=ž Ê¶Ò«r@ÍLj¨n{â¯[ÿœ}ÿœyòçå?™|Á­j÷ÃÍ™^_]?RòV«§K-­„ÐÞÀÍdøV­"˜äJŽ˜«üîÿœuµüºüÞüÁÕu-NËÍ~[ò•‡™´ë7hÆhï­DígKycôc+½>×€Ugäwüâ¯åï—5-ß~cÁæDzÿ–%Õ<¿£}TÞÁr°ÝÚL‘ · ”qð$í°Å_^ÿÎ=éúG“4/9yRÞÎ×B}Î:Ì?¡mœÈñ[™yÀiZСڿEF*ú5•LŒ£â”Q½ßñ­qTrZ¤¦… $žý©\Ul–qª‰9;|*½þ.àt¯†*—ýW÷ÇcÈàq_)Ó­qWÿÓñæ“æY ›»iŪ\€mYb‹.ÑÆ¢”nmB~œUíZ/™"KoBòR¶ÿ¸š1Æj0uá!A·JPmôâ¯FÓ|ë¡´V’ ¡r}$pFTAQÒ•5ÜŽ˜ª>?5Mżëy Œ“óoA`%%Õ‹1­ÒµÅY˜´øåÕu‹«™ZÒi9ÛÙÆâÑöuDa;AèàÌßdV b«´è¼Áç/3ùÈ~Ykš¦¹qskåK} O‚;Kx‡˜´Û«i/ÄwS'må!Ñx% ÈH\Uú_ùËäˆõoʯ9Ùën»Ó¦ò¯•X­n"Ò­MâB%«"„T,êë½zS~þUÿÎQÉÿ8ïçÏ6_O¡i™Ú¾· hÞbó ÷7"ÊÂÝEo§ì‹„‘$¨ø˜b¯×¯ùÄß?ù÷ó×ÉÞeüÙ×mWÈþXóïèŸ(i6œ“EõWk{½J9&‰v5@XêhU~}ÎkÃaùWùͨ^[ù®ÿÌžY¶Ô4ý[\ò;kÍ̦>kc}s$¦'• •,¼kMÅ1U/;ÿÏÂ<Éç'ˤGä_.èvÖѬ:–Œ¢hmC©^ªjZ0ÀèÊF*Ç.üÿwùá¬ÚÁúR-»õ,XÝÚEµí©¶ŽI"V‹³$’¹v‚¯ ()FjywÎw’OúNîi]e‘ŠÚ0UJ"¿o‰È;ü\M1W§YêÖ—jšf©k¦³9‘f0ª¤DM?Œ0h+òÅ_bÎ+›[ÿÍ!YŸîìî'¼†Ù‚FQýå%kðÕWqÔûÕW“ÿÏÿç"|ñä>y«òÖÞ®-¼ÇåÖÒ<Ùñw5ù2Û’-Ä%ú‘ü , VŠ¿õRêçP·º‰}Xb·haN€· PW>#íü]úb¯èÛɺ¿˜¿+¿çÚ_–ZÖ›h·qÙùI_UµV rSP¿’hžÚQð‡C pkOf®*üFüÞüÜÕÿ6<ͬyÇÌâ µ¿9}]uso Ç%ÚÚÛˆ`‘Ô|0T£3Ò…‰$¯@x!Õ®-tûXYRêÞ5-9£ïD™xÓ‘jŽ*ý ÿŸmyGTó濞<Çs7§§[ùj8îmÏÂïuq8D'ˆ…X™À`Ûb¯Ùáä‹VQlŠ­1§¢PÔpi×—sLU<²°Ö‘<ÑÔ³®äT('üšƒ\UUôf2q“z›»S]÷ûûâ­6Ÿ$J# ä«Jµk°úiЦߣÙÐôŒ…xÛr 6§]ñUªAËÒ©å^­xô®*ÿÿÕùaù{­ê~wi´¹’Úùíõ^ªœ`ky–HË7óGÈm¹í¾*Ì´ãêy‡TfiRÖÑfKØ¡,x9€•ܬ„)~,ÁК¦ŽÀª©Í¯–uÇò4ÞmXë¢G«-ªj ¸BÊÄG!rBßâ Vªaå[[Ë«zRýZíGŒ\8 ʉÁ•XÕO*щÜb¯VÓîZ$õ®'Yf¼g¶˜]±4ʪvÛ‘(bM­1W·ùÏ·ÿ—^jò¯›tø¤›WÒÝØ… ÂXx0’3ÅMEä­;žØªQÿ?—ÊŸ™z•0´í7SÕüÍæ êh/kC|Cù‘¦èZßäwæ?–4‹ø<Û“<÷mx5X™;-XÔ¢åyjÊ…JÝ2¥ rHÞ˜«Óåó†¢ùÿDóNæ=/Ëú›ÿ/͘5(ÞÞ+A¨ùrè£Z4Šå ¬€8%hÞ"˜«#ü óy›ó& ?ÓÒt}KSµ×#šòxš`÷öª¾œE]ùŽPHƽjqWÝUó¾µiÿ^úÓæ TâýÔT_ U›Ç$aPTó¨1 êÄ ýتaô Aä ²ñU;w5ÜЍ½ò å"ªT»ïR+Ê·±T³P»‡Ç„jÀÙ¨@«WÃÛH}Túù‘åÈ/*Ÿm±Wÿ×ù;e âê6q%ËÃv·³Fära#†m•EXûu§\UìþBÓ!m>éR7‘ÒÒ[«x$RòÆ7`„¨¯êߦ*ú3É>MIô­SRšà驦Égs”Ÿ¤ ²ñj»ÔÆc_‰ @»’¨×Ñõ·’ù…¡>¹qÄ¥œ@ ‚ªñ,h¦ªw­6Å_£ßz£j“7¾YòÕ€ó]Ž™w¦ÝØêÁ ­ï®Eo%ªÕRº’ -i½1Wå—æ¿˜µ/É;ùûRú Ö5-cP·Ó­<×X¼Á­¬örÃj9HÑÛ‹äY®Ò«ÊDÜ‚ÔÅ_-Gÿ9wùÅ¡k/ªèÚóéÑ'×8Ù¿ïË;QÙÌœ™Hfv ]ˆ55Å^=qù³çM^üj:®±{q,¯47&p&ŠI&Iæ’júo+¦åißÇzͯüäæEí½‡—îÿ0üÅy¥†JÆöúâîHŠ«)'e;z{zŒUõüâö¸¾c‡ó[òå,¬—UüÉòÌ1Ûjúg·ŽM;T·¾¸…¸NEöFÍMêX•_sËK6ÇueæÏ.é·šn˜†/,ZYiðZÙ[¨Ë'5 $¥ªƒŸ±= ¬./ùÇÏ8]k°ÍkªéÞXòå›´ÓyJ±‚Ѧ¸wæ+"*´, NÝò6‰emnò¬ŸWS® oFÝwè{â¯X‚á_ÓVpŠеâO}ñUIæõ­ G(Ú›3PPûâ¨YîHICoÈ| ûx«8Ñ]'S¶Öü½vm/lœJäqôÝH^PÌâèãáeu ŽÇ|óÿ99ÿ8ËçÏÎk¯3~gi~d‚÷L¶–)¤Ðn„šSßLÏqèúް-¥H_ˆjÕwê~/ë6RY]ÜÄ®ÅIÇjV*·5'z‘×JíY <„Z3Fh R[mŽ*Œ³ýfYD!“0 I¢žKÄlIÅ_¨_óîÏ/¯˜0<Á«ÏDÖzS½ŒMV $Å,‰N‚ªF*ý¡o+Êž²Üj €8úЧ6>\x»¢³Eý–*,kµ(zb¯@]C£‘qõVã^Í"ÕíAñSCEa¤1D2FQ7'¹P9ÉcUãZÒ´â¨7ƒNiBAFe ,eW&¤tøŽÝ~㊪K¢é¢${yd– x‰åBpôÊ)ÈS¥qVp²Ä}E«VƒcC°Ûµ1U>KÀõåÈ|}«Jâ¯ÿÑùsùUb‹çß+´ñÉ0\ªBÞ“Fîþ¢(/qðŠòVPOCнÿËuÒßK ÊÜŽÚX¯.O3£GV@ÿñy4"”ÛlUïÞEIáò¤0Éwúmàagn%XÌ|fyLAª‘þñgâjÐ튽IWø5’Ùé·‹—ï §c@ÁkúñW«é«ÜG$ÈçÓ?¼Y£;PP³¿]']Ó([Õ´¸V]麼D‡R(AN*üNüÞÿœ3ü×Ó;<ÁùYä»üá%­§éÝTä-Ñô™Èô¤šy‚D¤×`O㊾yó¯äŸæåÜ:oŸ<µs£êM8P³0ýünÞšMn6o…\$÷ ÅW~T~Dþeþqù‚O.ùEKë›5K›Û«É㶆Ön1¼²1â*h@PM7¥*ýkÿŸsù Pò½×æuöªÐG©èZ¼^X¹Š 9†¹¶/$Ï)&¤±â‘¸Å_­K$á}2$º´Üšñ¡ðñÅSÈ´¶™TÅNT1òSCºñä{íßn//œË%¸’`ä¤l8Ô¨¨$Ò†§j}õ¡ÅRßðæ«c òðãráesÀ õ«Ëˆ¯D&½ºSJÚÞ)nŒ²Ù[0¯¨‘±NEÁ5FU#¢¶é8ª6é!m1; x%º‘Ëú R€3ô$(5­:تXtøÌolå!áıj°ëCǵzb©g艽S%çÔŸ¢Ÿ«ÿÒù¡ù{%¹ó·–ï.'7·T¶Ô!‘T¯§Y–Ee+Fõ!`X¨#•(»‘оªÓtèl|ÕªZ}j9§¹kwŠ#h¾1ŽÇÓRvÅGFPF*öŸ$ÙH¾XÔcHÕ^ãКh]VWõa`PPÈH,xž€b¯AòÞ,7ÁU˜ÌÒ"o@”¥ $îqW¥[Ég¡s§\O¿¦i¹¢“ýã*U•T¡$ÓGé:F-槬ß\G6Ÿª[%Æ‹u þ[]y—LÓ#¶Õ?/æƒX† x½C>™‘™­§äÕPè¥ØBÀíÔb­k—ú?“7ÿç9<«¤iòiŸ™¾W¸ò·˜´ûRÞÔà0ÝhÇÑ&œ¾®Ë NÔZ ©E^Áù) j¿—ÞbüÊK+O.é~oóUϘ¡œýn°Bк´®ÌG2Ý>Ï(«îï-O5䨰\D£kÈœ7¶àRŒHùb¯N´Š8ã Ä2¨,z³¹÷ÅRë}^êHlåtµ>¡m ªÈÌÑÃp9üBµWQâiß@ÞëgÔí…¬-Kˆ$™Ú‡Ó’8žj$Ø U޵ÒHg›ôeœ/­íË=]ú³ª*±Õ'ÄmŠ¥wi¦Ãw„LgwÒ%€h¢ŒJjËÓ‘mÉéÜb©ýÆš%^P«FqžUjSá"´ÛÛK¿Bßs¯/†•åCJÒ´ëü1WÿÓð'‘´94}{MÕ`³w0ê±MfáUdYVrð¬A¡^_Å_[ùU®çÖµ RöÄÞ®§‰;_­]¤4IÍ(ÔÔ(è}±W®ù_Ok=&{5/r'$I "yüâT¨âG@N*õÅ#´P¨IJ‰“p¥‡B{’+ÛNõ%“Q²ŽØIqmgxâ´sm0ôD³¨oHKöG‰4=qU; ô9â…‚èï$=Æ¡’=ä‘8 ^¯%vƒUåJÔÓy§æ?åfùåç0ùÛ_°Ô¯4(`¶³òFk¨¶ŸvK¶ŽÒÚæúE‰ƒM?<ãzÆ»*Ê<‰ùCåmÍúV«{åI4ûi.üÈš˜.µWÕ#²8c6rDÈVHù%UÇÚf­vÅTì,¼»¡FšW–¡®…¤jS·‘SÌ6÷o–n¤&cŽCƬ̞¡û+J®Õ*²ý7òïó+T×Pkúì°­VÚßLƒÒ‹Ñ”ÆŽ’¼¯UUãPÀVîF*ûsÉ^[“L·G¹fi_‰u,H(µ¨ëJøb¯WŠ”-¡¦Àí¸ï·\USôfšÊakH ;‰e_MJ»@Ì; †*ªÖ:|¾«HœÜK¥(>$å]qT4š>›!—•œTH’QUe5‘v©ñeòRÄ ðñ8«Bü«Dp+^Uýxªô‚zõ伩֢¸«ÿÕìzý£êVßVý;õ¯Ýýkê_¥©êQëéóøýuáÛìÓzf•ÿBGõ;o¨Šþ«ê~â¿^û}ëý¸«,ÓÿèRøÇõ/ñM}=ù}c—«Ë–Ý1VMmÿBÏVú·øE?¼ãJþÏ-úâ©í§ý ×ô_ñ9š{ö·­+Š§Ö¿ò£ùCôÿ?Úþò´ÅS«_ùSœ[êÿ¥ý>õåJÿ\U“ÚÿʵõÑý'Ïý×ýåz þÅYàŽ'ÓúÿS—ñüU§ÖiCZr­hzÓ¾*®?­t>ÕØâ©‘ÿ ú1Wë~M+εï튡$ÿ s^_[ÿ.œ©Oò±UTÿ ñÿ¾¢•劮ÿkâ§Öúü]zâ­§øsˆãõªoö¿×Zßáš/ûÓÇö:þ=ñTü꜇ûÛêTÿ7óŒUÿÙntp-4.2.6p5/html/pic/pogo4.gif0000644000175000017500000000621510017034540015045 0ustar peterpeterGIF89aH´÷ÿÿÿÿÿÌÿÿ™ÿÿfÿÿ3ÿÿÿÌÿÿÌÌÿÌ™ÿÌfÿÌ3ÿÌÿ™ÿÿ™Ìÿ™™ÿ™fÿ™3ÿ™ÿfÿÿfÌÿf™ÿffÿf3ÿfÿ3ÿÿ3Ìÿ3™ÿ3fÿ33ÿ3ÿÿÿÌÿ™ÿfÿ3ÿÌÿÿÌÿÌÌÿ™ÌÿfÌÿ3ÌÿÌÌÿÌÌÌÌÌ™ÌÌfÌÌ3ÌÌÌ™ÿÌ™ÌÌ™™Ì™fÌ™3Ì™ÌfÿÌfÌÌf™ÌffÌf3ÌfÌ3ÿÌ3ÌÌ3™Ì3fÌ33Ì3ÌÿÌÌÌ™ÌfÌ3Ì™ÿÿ™ÿÌ™ÿ™™ÿf™ÿ3™ÿ™Ìÿ™Ì̙̙™Ìf™Ì3™Ì™™ÿ™™Ì™™™™™f™™3™™™fÿ™fÌ™f™™ff™f3™f™3ÿ™3Ì™3™™3f™33™3™ÿ™Ì™™™f™3™fÿÿfÿÌfÿ™fÿffÿ3fÿfÌÿfÌÌfÌ™fÌffÌ3fÌf™ÿf™Ìf™™f™ff™3f™ffÿffÌff™fffff3fff3ÿf3Ìf3™f3ff33f3fÿfÌf™fff3f3ÿÿ3ÿÌ3ÿ™3ÿf3ÿ33ÿ3Ìÿ3ÌÌ3Ì™3Ìf3Ì33Ì3™ÿ3™Ì3™™3™f3™33™3fÿ3fÌ3f™3ff3f33f33ÿ33Ì33™33f333333ÿ3Ì3™3f333ÿÿÿÌÿ™ÿfÿ3ÿÌÿÌÌÌ™ÌfÌ3Ì™ÿ™Ì™™™f™3™fÿfÌf™fff3f3ÿ3Ì3™3f333ÿÌ™f3ÿÿÿ!ùØ,H´ÿ± H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Çkkȸ¼øh™aŽÀ™sÖ,ž¯J´¨Ñ£H“ªtáµ§O›"|ºkS©©Ò«À§Âhí‚ÖÕ«V®e¥>…F‹Ù´J¡†E 7©\ZÉ ^{÷m]£z¯…õ‹5pU½M?Mf*_Y éÍûwèS4<R\™§¬k˜= á¼p£Ì£9Ç•5$s#Õv¯µÎ,zÈ×¥‹>M5îÕ½E£ùÜ™$+†—{ãvÌ’ÕŒ@Ne+Ì2 3>=-:3ê+¯yÿÁ®ýš¬Ì²Î§.>òÚõW¦Bµý”5ñÜ'ÝcPo£ïõÝ×Ò5ˆ`'C¤ÇÒ5­ì‡`‚Ì-xÍä-!bÍyA v¥]ˆáJ  ‡EsM4&^ØÒ{‚PxÜ@O-SŒ^Ñ“Ë2ªävؽã2¿œ(c.Dâ˜#J³PÈ#tYE“Ë/ÅD¹L‘ ¦¤üÁxbŠOý’‹b¾7à YqædU¢+f‰ iSΘf~l¾÷“–ŠÙhä‘ù5ˆ]e‘¦'˜ *)H œyùË2Ëp™Ð5¬øøÒŽW0Gš—DfšK4ý!Bá!Mˆ]+©)‘ ,åé~’bô»xÿ"”˜ˆxŠ2þâ#¤JΠáFžì"VU´”²!|¶’† +¢²ŠEa±Q +dA³‹±ïš¬b;bw(GÉÐBBAd )‡n •˜érÄ -HD–±]´Ð£ºâÁ'+­°‚GÂ\‚±Éô‹]­¶’š¯¾JB±+×> ¿•–ð0¥ø)"‚tÁãÇ3©4Â(dì%<Ë0ë5È3Ø»ŸÈASŠÉÖ&S ³@ºïZd]!³Ìú¶º‘0z(Ôs2—°²J \1Ë~d%cJ’Ë_!%C³Aï¢G ”½+Ï C^ÂÌR ÌXÝQ2rø $+”­w+bÎÿpÍÝÂGÒ #[sä­7úÉ|è.-~LR2žÄBL ÉØ¬Xaö,iï'˜:Ø^É R@kÌì5ž`E³<^3Ì\²‡‘`7 4H ò7ÓP‘ ";} 2mí"ÌóÉ$MôÉôΑµÇ±’ð/ ¬Oy¾B+½b7;/[=/LUê3ÖVÒ]óۿz4t‘-Cߨõ¬Ë%³ˆTËÖ"¬¯a„1­øý 0=ž•<"š2  A¼¬B[hác)Ð~Ô"Ëp˜ÁÇZz\v "ZÌÁ#­hÅW·&+DG{` &®Ä£ƒënYÁ¡ÿêÇ=…=…/»B J!¬KKfnÊJ¸4ØKC­ " 93=aíAüà ëVÌBLR{Ê ^ð‚¼@/ê[-šv Mf"‰†®P¾+¼nM]ÐÐßXQŠiQh7Ä D©…}ìg<¼‚ f•–Ï@’ ÕaÆ,6ì ]¸$Ìð*A ;§œ¤¨ÐfÂÙë” íì¥5Tb R3 Ÿ-cÆËSbÉq$|(äËýxì 4a-?Ö2ZäÌô$È|Ù4òh™C å œ™ 5S˜VüǼ€/°"ò})ˆEQ#¡/û÷”qza_Îá۟Ĥÿ<çp3'O¡PÇfÐLIòÍ ½'B[ÑLJuk™=«¦HøÆ¯ªȳ ÊÑC)I—‰$×yÄhس£Õ¨¥KV¼ç”€D{®1 Œ&t£åhBk•¤Z‰ÒoÏŠŸJuŠS…*Ô‚F¤©’^¹MF¶‚¨FÕiTÊ/Ždÿ ŽÕ¢ætª)5ç1PYT§Hü*TÃU„½ R²DÄMýå…¢´¨líªÔŒ0§‚HÇj%Wµ¢4¯_­UHˆP䔯î9ìPzR¶~ †aED"#JVªåW;šÕˆ0v¡zéähïÊQ›ÞÔ¨2僦úÇÙÿ~öµ¬Õd;*ÛÓÚórÕk^oJɯN6¶»{ªFO«0ã¾Ö²)¥énŠ<¿·®œåìS¦ûÜ©Öê©ÃkrÉŠˆÎvV9U©s-KªÓ–£»«'gˋѧ„·»Ï}ÝPÓ‹ÐE>ó)Oåß 2U¼†5§ß½îaï9ÒŠüq¾ô•îp ÜQH±·ñUv½€0þ‚Ö«®kN ‘¿¦4·rEXe½šWä…Á¥ÕNz;Ùty´™ï‚ÛÙׇpæ¬*†.‹oZã®"¬Ç©$FqjÄÊâ7ª4%jº"táÔŒ0tתÐö¶ÀåE®EHEÉJºôu³ø0b‰œf¶&ÿ‰íˆ^bXæí®ö½lõ2n&Ë#~e« Æ1‡í{ešÊµOÆ«zëja²R’oûê—)œÒ¤ê.˜i>®š;:_üˆ$‘U³¦¥*f-O²=Ê=ð¦÷‹P¨Ø”Ç BDƒå|Æ ß´Ì ®]+S„ʽÂUôhûuOœY“”¾í¦wºd/Ô¹­õZ§k\P… ¼j%ë\ »cƒÚÂw¦®ªW›ÛHÛ¼氠E|Ïû*Áõðwl¥Ô&”®Ú&õhßùíú>Åm»å.ÇáîøÅ:†f+t[á’56ž÷Œ·e‘LRa´°}4¿ +kK£ýRëë$žS‡‡AüÿzµQë©oÿ6œ¾¢}­M¦™¸çÍo¶§vC-U—¨¼g2OU­Q“‡§¾í,öwÁqŽZ' "Ð8ilêºJœÄ'‡4‡¸QDÔºœµÌV ï{‚», ©ÖÞ½íB6´Ïz--žËåmtã^hú:»Øïé•Õþ÷­‘ß<áWá "à 'Š·ŸcÛø,´$Rj<ðÖ<,0ˆ{AÊ¥!âêAdaƒˆa …§ù²Nó/ÈÂéQ/ûÚ³‘X€góîÆÙg÷3´Ÿð´üØ£>õ¦oãã“Ìù°~í«þ IEü¿Ó}ÎbžˆÛÎùà{?x­÷þjékOþÔ~*y'•ô¿o|êÿý3ìÞ3·Çº¾¿íLQãñi¿þ÷?Ý"¿#<ýg}Ïòc»ðnxÇ~Âw`¦÷}ñS}§w~ò‘@¿g?>We­p{è€Iæj/Á'^Q‚&x‚(È;ntp-4.2.6p5/html/pic/peer.gif0000644000175000017500000001151011307651604014753 0ustar peterpeterGIF89a)/w1!þSoftware: Microsoft Office!ù, %ÿÿÿ„©Ëí£œT†‹³Þ¼û†¢VM㉦*Z¶î ÇòL×öíÂÎ÷þ ‡Ä¢±ÀtǦó =&•ÔªõŠÍjg̨÷ &Noݰùìo×ì¶û O”ÑôúP]›Û÷||ü(8¨ ÇwˆæÇ…ÈX§H)9¹ØhöcxÉi”I *ºÙiôùRzÊÊ“: +˶ÚÊúÚRkkŠ;ëû ¬¹;Œ¤¤KlÙ¼ÌÜ\ˆL¬Lq (íŒ-Kí™´ÃÍkL§ñ-Þy­½ÎN•±4èÓ…þSï¤q4Gɘ؆vó ¸ÏŒ!&û\§¸Ö .PТ ÿð"”3…ã’"Gú!ù±ÁÉ„`j1œwáp3ÏÕT±¥˜‰Hb:¬éͦOœ¹8â)yeH¥IS65€”ÁQî<LZÈ)Ô«[»zì•jÄ;<ËÒówΡZL9¿¸,›Ö,Z´pÝæ²ŠÕkÓ•y;úÝkBUc*s½èuêa}Â( yY2OºäÚ¦Ù7óds”Ý•j¸o¡Ä¡õ2^<8Ï»½«Eá4„°KÆ>6;®ä†-Gy›¹ŸnÜv’`5SHäZ¯)N]öå¤H£Í»®=¹å4KšÝ•o(ÀÏv/ó=(QM®Gƒö›Ê¹lèìcœWôs øUÚÿFEÜvjmÞ9ã=QÞZ¹ àzÓ”vj AØ_aíÑÃ@ 5×Z~¬m¨•uêsÆB›E6œfæ°…C&ÆÕYzÚÍH^Q#štÔ#eÅaTR‡a6¨â\+R¶ÛŠ-HÞ‚0©`’ Ú%d•VVR¢zOö„g>i¹d‹ähùPJ2ôåM,^Éf›&T³ mRÁi‹œnÞ©‘t"Èäžá h µù)Ž˜„¦#h¢nêyhv>Óè%*Jé/ŒFÚ›¡˜>Ti§ô]º©=}†ê §¦*©âiªjq§¾Šj«}Œ*ëo°ÞºNª­NzP­®â ¬3+ Kl±#¸cl²Êÿl³Î> m´ÒNKmµÖ Ëë!^Ëm·e»(¸ÞŽK©ŽÍšKnºÒ¢ ,»ê¾Û.Ïjo½ÎÒ;¯¼öîûjÐúËoÀ°n›¯À,.›Ì0  Ÿ›pÃ7óp°OŒ1†ãºqÆç±•L2;#÷rÉ*Grò©-¯ ³¥) ùrÌ6ÃRs§9ßÌó$;—;sÏBcñ³¢E4G ºtÒNoÑ´ÃA?Mµ&SzuÕZW5ž]o ¶ _‡vÙ€ŒÝ&Úf¯­OÖ©©ÍvÜ?Z ·Üv?UmÝwÛ­7Ínï vßA x·ËŽø È&Îxãî^©®ªŠ+9©ÿC.¢úZà«#´vÞÄåo¾yt–jÞè¥ÒPy¨ÆžÅå¢×GtꪇIÆí«óçËÔnǶ!I€"S;"5|ñÈ'–íºÛÊêó5r/TÊ#DüIK-eÒU>vˆ}Dz[øF¸Hü„‰¡¯—ù ŸOë›R.=•%P×¾‡äk¯}_)EØ>ö‰ÈG¦CÌaÔ±Ÿ¿ f9ï+Ÿ„fs¿ú¥ásÕgÜã¿ûɿРÈ5ÔP?S`]ÃÀ‚ïÓ‰`ù½:*ï!!?hÂvŃøò ïj7BÓ°pýéà)Ô@ò½I†¡£  tÁ *Q‡9 bG¸ÿžˆùëb3XDöaÑCZÄ!³4| ƒ~ QSèÖHCýÈqˆG #«c=û@Ždø^nø-þ5§{ÖÛÞ‡ŒHääâ?õßœx›)yŽ9ðcŽJXHø ¦$"á¤Q IÈN³cc$‰™:AR"N’%s•±Rbé7 ÒALl™F\öCMºÜØtÂJ\¦…—fâR—Ü=XN,‘¤¦€†MWÐ¥K4A%>VÙJ/Is-ÑL‘M¬ÙÄ\òn¼!7O„Ωhz¹sK-•´¥tžìÄÜÀœ¹ j2H’7Ñçc¨Æ`ÂSF0AÒšìÙ/|rf ÞJ”š…îÿEÞ‘¦”hN„&ÔA…sÎdI¢é)5AZQÜiÔTÙуA:Qu¶›Ùœ§GS„RŠt¥:c䙦 Ój†´ž=¥?»™Rô¼Ô~<íiÓXQbrs&Kýg;1áÆcæòHT}¨J›êfž-„b£¤Êª±q²T–³!«ŸÌš ´¦µï¸dV2IHOö/”Ö"!‰ÑWŽ”€…áýŒ’>¼tÒx|ÍccßÃV2±=ß«£Û×Ëþõ‰R ©ã7Y!VöŽü{f—?ZH€U4mdýÃÙ4¶óˆ¢‡˜Â"ЯÌð˜Ûê9§t‚(ì¡àJ[~TryúÿÂl„K=L ä‹Î¥n¿ãÊõªÉU®Ø¬ Yð»Û@¢i>1HÕŽ—JCãV´NŒv¢¦|ê{d΂‚‰©ëõbk¿e^ÞRñ´2»ÑˆJw½K^Œ¹’ONSYSŠ~µ¾ í |kêÒÙÈ’ VD‚Aô ƒu:§Œ)+/ŒÊ™ÎöÏ„0=_4᪜;ég”n‰âʬx’d±±npáø^SÆå"iO&:Í ÏjÇŽƒ‘U!«˜È‰¢1Y,apÒw–Mº2:ˤä–Ê36²WŸÌÏC A–J­9e2;ÌÌ85q˜ÅÝ.GòËY¦Qœå¬-:'ÕÎbÖ0ÿ“]|a7c¸AütÚJ\Râ¼9Å[þ%I?Jè;ØÑs.ñK*ToúÐM†–å’cqÚkî=ªLÌýî”Â-!SP•jK{lÀ3«Žq‹ÛÝLå9Ø«LõVF`Û‚Ã^ökE(` ö+wÍ+cýˆ×ÌFûÚ}«gëgœiF}‹åc«Ägs!´—-KûCuÙµ%5gA‹7<Ž[úÎö·=‹Ôžwµê%ïWÔÊ5z×»ÙÄÆ·O˜ÖB\”êfø ÞBøºo¯Â‹=ØCñ°ÌÝxÆq”ŽË›bâukqøï•gWäàø¶ôìôò å¶…¦íx,²ÿHD•½†D·÷´fgÛ–‡Ú¿ >GlûÀ:úðÁÏ÷ë@]R`vÈ9ßÏnØêЬöÁAÜ6éŽØqloÜâÚ÷dõúV·šÚß^÷ U|îØÊ»*în Às[¬|G˜ß—+x.›„/üZ¯´çfÍ“Ϻã]fù'Ö×Åâ/²ÏW>ag¼èAy“u­ô?ß;êeFÖÿÈõŠý¿hoñpã¾ö¶¿×îs?Ãkî÷½güÛ,|¨¿ø”Hþn(ûÞ.Ÿù žþœ}ŠYŸúÝþõ!/}îsÌûß'¿jÄOwó‹ ÝÐq>ú[ŸVx·_ýï+ýI>Àÿù×?õTi|ö{wû§| ƒ@îçkè)Ø"?ó£ €X}tÕ4 èyWð€ë.h4¸o‚ŽåL‚¸'8‚%ØGÒ÷7(8x,h‚ÁƒG(ƒ1€¯Uƒ´°‚9È{­·w=8|@Øq‡„Å‚wIÈ„Çb„½ÃDÔtŒ&vèG:àG"47…ÁöƒÓá;Xh~¾547r_§p¯Ó;Ðö]i;c¨…6÷—¡ˆr˶‹™÷_§ŒªÈŒÎØŒE¤s1wê5F´¸[Ñ3ÅhFSdŒÀø–å_åG^äC”(Zs£o˜8ŒÚÆ.„UQÆcª¤qØá^´'óB Ùq/ÇAbØÇ^g–bÊÀaS¡WÙVW $VÖŠF¥g­ð‰ªàSlvˆÇ#™‚›ˆJ‰W‰…¤Ð~†º(ˆÉQô„h…¢LäÒ…Öad/cÄ”UF cVT—!PEÿ¹UGù”I9d?é-DèyCjH¥•\¥ež`sùMIÆM\X^)NAi0VÖb75h¦V–²Åp®ÔQuRøÅ“Sù„?‡•)S.…TB–Qfh’kI—/ö—–—Í´“ùÄP|éPC¥”´’AU$ õ%^Õh‰y•‹I™&E™6õ–bð•ïÄ–ué–€ÙYš‰36‰™‘V™‰—KÉ”§é™™Æ—V¥š¤P’?6–}YU³ÆeyN[é›­ œ¹É2y&Åd™°¦SD%™iU2q_ÁÑU°˜dvzyâVH‡å4ˆƒÚlý×t²…{ ‹Â&m¨Â‡›‚Џ`DGWçé‰ßÿÉbáI=èa–øˆï{˜Xp¦ˆŒ¾h2é(˜JWQ÷Êsh9p­¥[Ñ5ž±ƒ ²y†yE¡1¡×¡Uô[¿ÕåÉoh‹Q¨¡ÛÓ"j  ¡ÙØt-ªŸr¡Ñ© ê¸Cì£ô¢šŠDJb¿!k¼c–FEÚ]ù£´Ø¢|K‡"¬è…3IƒÂšj†š¢y¢li¤Aæ¥D¥gwu³}ª ÓH'v ¹†›wi nšš8Z•l:™±¦U9•ÒéI…¨•~ªUšÖ¤[T•jZ“{ê–—ykÛÄhû ¨ƒj—BU›Öi§]Š 6‚œš#wÿO6•©'F©ž…L¥ŠfòdQJ:¦Ÿê3ÿXš¦Vªðuª_ªk1ÒP…¹©÷ ¤âG$hr¹aAQ pœƒÈ”ÈZ™Åú˜bÖH°º™c‘_?g{¶¥ ·¦r RF¬×º©œêuÒjtŽ f(¢«€9iwjƒ½2˜Ÿy®éZ­tÊžäºY“©Oö`~®¯Šx!¡¥Ž™fj©¾j¯ ªQ&U†ùœ3ÒHŽ“°~ùœ{—Ìš¨;sZ±&бƒ°žÈ 'Çñ±Ñ 2uŸNWnéŸÌ”²Wšˆ)ùŸ1)>5ŠIA³i7<'‹H×¶²Ó²ù³ÖLá>wŸ É#C¢PÿªCöèŒ#+X:(E)ZÅcYšnñæ´ˆ!Ž—ŒåxOk¶Qz³ÊÚpÔ8¶¡Ý˜B§a‘gk>%—r'Ç¢ñS€û| DZ º¶cwuée@¸x·|Û·‰»Ún»rdëZã5·hû·rz£­ø¸ŽÛ¸¹¼3¹¥è5tÍX9@Aª>L [T‹«äpñØt„¶ü˜#¨›o¡+¥WdˆÉQu‚d¥@ëˆéCy›¦Ä i«“§·vøGýÙ‡gЦæætÔö’ð¼ãf•ÑÒ„Û«8"È½ß 0«-¿jâË0Xê5Ùk¾éǨ£G¾ëÛ|™€ò ¿Ôÿ²¡§¾õ9,/÷«¿tó¾>ø¿üÒ¾8ÀûRÀ•wÀö’ÀÛÀ ì±<€ü. ¬.Œ3ŒÁÙÅÁ±óÁ\¾yÂ",À$lÂã¢ÁXÂ)\„(ìÂܲ¤ÔÂ1Œ5Œ,6|-3l|: Ãö‹Ã>¼€,Ä@LÄE¼.A<ÄH¬½JÜ‚L|{G ž'ÅSl1N|}VLÅ?¬Å]ìÅ_ Æa,ÆcLÆelÆgŒÆi¬ÆgÌ.X<‘ãÆ_¼2ª0䏯í7Šô¹(yÜw ;£±ï‚É38 Èň<œÆtºïv»ŸrrÓë$èÇ?É_  4sÉ\£•쀛ÿ,¶œ,2 œ£¢ìÉåU¸ü<-ÌÈ ©¢tʨìrª<`xœÊsÔʱŒ3|ÜE ÉJ˦¬Ë»ü¤¤ÕÇäiÇÆÜÃu‚ƒ„G z#!-! …—˜g/#y‰ y2-4- –™®¯Y"6C ‹!&&§1-8&«°ÆÇM ¢–/ !) 8§8Â&ÈäÈ8~#:B/6 !x1 ¾10˜XЪœABÜ #Äu\xAñÅ $ˆ€!€9îˆé_ªUªÔdb!.ÀÈ b¢EŠHȉ₠ÿ D8°A!…#p†a˜†/VJã·\ ˆi`Å›+¸[ ÁÅ œÃ> Ä ãj*•¢NÝ‹…U@`kAÄ ‹9 ØÈqaŠZmÐÁ€0`Ì¡ó 0ˆ¦AƒÞ”|S71`õ› a€X´!Ï Û#nG^ s‚…lëâ€1ᇠ# ø¦ÛR¤ªX©žŽä ØÀÀ@j‚%Ÿ6.h@1Þ€Ú ð–Ðy€BNÓ(Âê€ %,äÏ:Ã¥5ÀÀ¨Q·× `÷€v1À+Ø áW㤛E¼µA>:$ÿ•MòÈ2Àˆm!PBn@ üWCœ¦—RyÀ.È%ƒ Œ@QF Ø Á4бb‘zfP$`ÑWÀØ‘ÀЊnEA%¬Ø` Ü#J4äv ð .Èv ©¥—áNA_ù‡b_Yt_>ùL0\œXB  ð€f•i k ¶ðwtÑVÑ æMt˜M9ð–€N @àB}^°A‘áõIOs&.êB\¾=`hgô"ƒL8ЂiÎhé -Ô„ò+„EFÞù¹F `t~5O”ÊÚG`T`®¹ÍfuÿÙ½šg—PC 3Ìp 8°±ÇªáÁÔ€ÀÀ°8Âa]DÞNF¦wmN Œ`Á RZ´ÁbŒõiÀ €”{n (ÉŽŠ0 pé·m9g¯i•ô›0â ÕV[ "EÓȃ £™ž¹uj”¶:B÷!`œ[A #ø†Ÿþ¹@ÛÆëÛ¶–µôÞ `Í6‹áèÌ, ¸C Ñ^0tHͶž9H~†º!‚Dƪr`Ç ¦ ° ¹¡%P0Џ`‚&R Õ-zâ¶¢‰Vï ¬ÂoÛX$ÔÁ 3ÀH€ÿpÞ“aÙœsæ¤Àû4ÓˆðF¶ ùÀ^ÿ D¿hÝ8tW!t<€Gúå#òô0—”®Îz/4ÐÁ4<à 8X€€uÖiäí Þû'²ÐÞQ" Yˆ÷´˜`bsÁ†­P Óctd/"-;Ñ FÀ"°À\ùÁhšó†x`@盂àÖ¾Ò-¶ˆÖt€ÈLÄn’þ€ƒœmÉÁb&3ž`8Ag˜ƒ­ lùÑOXp(˜a¯cÜÖ¢´æµ×À€K‹ÒÙZ„™–/ãHáЀÜ`„8x‰š‚¢ðÿ$g‘yÚ`8Dý†D äÀÒ˜DQÁ©€#b@¹)– û9”縷(œ " ÀÀPÁ‚¸d-Ê‘V^³"ÑÔ@lSc ÐÆ¸O4þi`0‚7H ,·k YN5@°%’ –Ù^æ†ÛºO8À‚T¯1˜“É€DÑí§n\ú[2ðBEÛÁ@®“.Ã}8I¥dyZÒ@všBÀL0L#CpˆNæ¤õhÀè! €¦\…›€À[_`€è—\ ‚d€Ym’梮¶¨¨ ^ÒJs¡b;ÿéTgsÀ,`%&Î SêÒØ6À«l§vBð›. JŠYŒ„"vª!ý;sY÷…Ô\%üZcL` l+)¸•è Q#푞ðRH‘kê”i\Ñ¾š¾†¥¨Á L@žNG@ðuƒUÊ‘xB @¤†g9p€X8‘‘Ô01hÖtÒ‚“åˆKÕDÀÓZCÚmp~È €€C(èòó–ËÀ'ª@LçŠëœB¦ÍigLƘÓWžF%IÉ<ÂÜ °³‹-"€G 8 J9 PbÈr¸ÖLJ§Z N0Õ¨¨ˆÿ‹*)´¦)MÑÅÓdPÀ&}¢ˆl<G™*âz%d¥9q­v¬t%÷Ñ´,ÚÊh`Y L\àù9|‚˜q/.ê}À ËÔ¾ü¥d¢$ÙÃÍ) ÂNZƒØmeTdî}î ¤âF`*ðä‘'°€úU+PÐHo`Úi®Íµªõˆ¦ 4)fêL"'9 ÷RÝ+„„ï`b„â¡`6Ö’á`:ð LF1@VJ€Ö@ÜP€í(06¶@(Z@ôЬAŽ2:HÛT4kq € P0üV+*áVÿÆ[0ð@¦èHÈnΕZ@‰-y8£&*óÉ$<>ùµ¢òÊ!;ÌCÁ q!`@Ä„Dª”.¶.—‰À\v ƒAE„`k7ƒ2ÄÒƒÁ\Jxä7¿Ž<Ñɶ¥|˜Z¦æAs†c€#PAäPq™`/`7Ì®Æ\š’Yr‘«ª û*„É#Z çB±k9ÈÀ mH §äØ'ŽY1‘Rlؼ'µÀ”¹ƒ‚À Ð@Ò á, 9 ¿:( ˆl’‘˜ëƒRáx@à;FðÿÀi‡ˆ§HfÉû黪q3»R8Á.R† p ( ŒãƒŽÃŒÞ;A`¼’Cª£`@RÏÍ)©;¡‡Ã¥¦•? 8RSÑÀ¢8]´Ü޶Ò@yˆû ’.R ¬f\xœS >àÁ¢¶â\Ðd°oŽÖcà (>[ÙŸ.k­L¾ÌSŒ¹ÝN Š $ uwÁôtüÉ MýîÈt‹¡ªÇ–a˜`(‰Q¨6P@þTÒxÙ”"fÍblÒ§NDi7þô[µìÖsÌr Ç*°§÷ý•4”#µ$Ì ”oÿ<à&²Žb" k$¤y#ƒu#e5*#jÇ,™Õýöp(ÅcÃÅqâ0/py==@4ˆ•ñ20Cc;?! 1%!µx·U+Ì‚LšBs¬…m3^SeS8òJ Ôt}óþv'°wwaˆzq—úÑ%³Æ%€J'’nHR,0` 6;PÍ¡yRd5WSM'¢! J—ÁN³v%Y<3K3* 8p\_0@"€‡gz0=ð2'itA V!Ëô’Å àbëGí´"Z*°A8¢/A2‘uȉ!ð?'ð1 {¨%gÿ®Vt IUf\S)@R^Ç, F`Û iÂO˧‡çb(ˆÕ`KÑ"8SW¢ÞX;Egc1×ð7OZ°‘h<# ”d(‚§Ÿ´-9bh²Líex8àOŠQ¯b=S†8 HŠTUcÄP+£@4õ¡A’£pÈ$ŽEw àtKRJq(Z‘@<`"–´"êv+Òv8S0óAO7÷«¶"ò¥3ˆ;Ft‹b€\}Ai.@ ¡/°@Á „èRc­¦Ì"#°~øè^FÖA Cè€dðÒ>°y[ÿ³£¿2;lå ¹U;©h@|Þ¸!xÇcp€'àt0k‹B|‘C6àÀ‹bf¥€¦*¦à¯2y.ä_°jX!kYK1^Ú¦"‹RÞ(9#Å$Ÿa[àÁ "òa*•¢ãã1€6Ä%72"Ãá˶'Uðõ5Pp``IÆVýÜ”[«Ö<1Pr&ŽCš ­Ævù0V\b"0 /‹žÍ‘1…±¦‘kY{梜P.>,bU ÈÔ"<Æ$0³‚ÕÄcw÷èuÒ:vMI6w'Ž¢ÿ91ôDp[‘ÐB4 ¬5F DzBd1_ÿàl·‚MÞ )Z‘[&,ò54•Y“t2â8^¡Æ‡â§H°·$@ŠÈ‡|¢³„&ñ¤p 4`%Á0J 6SjâÑ×%úvSæÞ¨išv‹*p[]4ŸõÆ ÉA Và 0#šŠf“'•ˆ#Q8 `U4Ð1í 0[ùØ)½ÐdÏÀË‘!P:l…>B>6F ò IAc@|Ͳ!y"9Z´‘“(C˜š„Þ|h1v§ )à5é)kVBf5u2V…ÀŸq¡)  iW‚k ðÿWD39—äUaOÀp3ðšdCt'u†ù‘Y@Cò(:!ËvgÒÄdr–:94gQ—4ðG‡- #B2ð‡IâvHõ°32*§r‹ÌÒ¦+20/‘‡²d êM(‚7ù[š²8‰ë¤YfŸ…¦{wü9«3 ÷ô»:Ÿ¶3wP:@¦SàÀB*cl‹›Ó#p‹ØXcð‡.@¹/ˆ @!HÛS.€J¼dûR*â‘u,%}¢á5{²P3ê(¼„²—õ0§–ASVª#õ™Ü°`¿Å ©ªeÿϸ ÔØƒ ËŸ%ÀŸ4'#Fv P·Zn#0P'ÄÚõ¤>cDv²]Fü9©hA¡áé2ñ‚! Gc…[ ä2¯ðsxOñƒú2-bUí s 5m"% p[Öƒ&@TJšª¼]Ûo0™õƒrk-&«z‡’©‡¦Jú><¶ŸVU·Ðv$u.¢ÕTð >óö Y< ¡PE ›`f[÷„€±‚ç5ÀQÀg5.ê››£¡ð’x5@Sûø?a·, íè4 8B!·ååoÿ ‡0‰·ŠkŠ©˜ö»Ðh‡§ .Pzb5, pLR;€†.0qýfu+™e9(>R8³>?ç^V¢'§§@ 5IWR71Ð<ã5€¾9 „#â° EÓãèÐ^÷¤Š¡™A¨9rJÁp%_Ô+YA¡v5Þ4ÁÔˆs~ÖŒ¨ô[ æ¥óžÜ4Á·$Ø%û440/¬Ç'*T`²0R0"!€ÛYÉ•œŸDczÀ ùWUk˜œ#pd(‹GÓ£ú‘ù¡Êò³-k8;æxLÂ0  –&ÿ:¹ ð3p‹tƒ¢>æµ1ÉÆ“¡"¿uÁ¨`ª¨`‡ð”¸RM{Ìv’›Y¡DqÑ>† …Í¡eF P`½3IÜ€–üΉ sw¹%\c”#Ò5ƒFU¿Â<.S) {d3Åø@ZóÒºÀ„”Ê€¥ã¾8B—;€m4æ(Îêµò{d<[2`¦ÐŒÌ h2fÈÄŸ1ÇŒtN ·ˆ3À™…Ò à q1g:ðkO°&7gÓ¢à=¼ÏÛ©-TTÁ^30†’Xþas!J´r†RŒu™šy¨"Ô¸‘Ål>–ctœÿÜq5€w4¥Ñ= ‡»‡Œ"˜ [ ¶µ;Po¡UJøáo!ÛšÓ²@“’3e¦ƒål~Á§‰%Bs1Ô–\Ôï,†5»P# 4E6–£R_D|+º¬Z45Tƒ¢£E¬,ÁRÆé^ÐKð¨Üs¡ÃpN%1{«Ö¡z5#ã‘ͱ˜¨>Hzª`;6(Bšn!o4Y±Z1cß@·Îâìo¦Óæó0"À+uƒiÔð|bh;b"×@ ê ÑZô~Aë'Ð.³¬!@˜Ç·-ª,ۇÕgƒ•šÁ°lÒN% b7=ªÖÏÅŠ"jµº´ÿÆwÈ € SöAH‘W£H.õp¹!íS·7м˷k6õÓË.pBýfãÞ ‘-Þà‡u`žÑƒ=`´™õ”R|†8>$ðÚ^i=ªì†VEPÅx lÒm>†X±@}˜¢SMOwàÔ{'ˆÄq îç„sVfã4‘[7ŒB·73®¸«ÃkIc:3`×½ç\dîcº{Nq!Ù–ìÎ1^ɰbÈ Ú¢ÙêVÐÉ?îMªÜÚ‹å•„ùÚØÓoI~ß |nA&0«ô+Ó:Vk¬åÊ¨Û»ÝÆ”i‚ y&f¸‡ÿOÇÄ20Ì")qàL·ßæZñÃ"½QPO¯SÉ¥ÌUt ÞÛ¹F-Þ‹Ð_#0Ådƒ|0”Õ”BÎÊ^/[rß" PäPbSÌå ¼í%B¡ÑN0Çaþ¼êÆ<‚ Nþžˆ(ãà_ä°ÈØ ±uû4Ý"Îv2÷öâT`½7`ޏ¶ ްŠ.íÛ)ãÖ^Ô(r!×LN6ÉÈv¯Ñoð]J« 5 x[r¢aX}ߊò2x›þà(¨ 6yÊK¢Ñ Îå¶ëï1ùå]‚l‡0ó­°Ç=7@· põ à0p@ÓO·kÿK"ñ  ÓLÀp¦B¥°Üñ‰Nãb(Ù#?]Rh³A%0[V-j-âµ!` Ñc9Ñ“Þ8ŸåIŽUœ£K·‰ÇÉ",Ô%T…Û[®(‘.ÁL?™]»kjF1À žöà5i_’#~Óõò‰Ž,­Hzº"ßÚñŠîñ‰îñ/ÞI–^ƒA ~% %ÀâU†˜Bnþº`(‡Òé"iEÑãI~†(â_ u ÄW%slpáµÖ¼Æ#£ÛKßô_¾ùSrAšç;Ó ÿ:`ñ‘#ñjó·I€1 (-ÀÕ  šÓ©p8ìvÿVk–S²0Ä@Ð ƒÒàTaY\K¥”*•ŽÍdâS,î¼\&(BîXî**FÐXZZ0pNT*ZF˜b&82XIIéJèXWÝXUU]e]lCY0||@|}^sJf@>V˜›Ÿ54D 2& ((`\0 {t$z®O®°²v8T N\d\(4DìG&ˆ$ßRL á‡D6>†2È©ãE/øX›`R #¼ð‰áâ±9¥JÑy% Õ,“²b‘du‹E 7)`tèèF Æh̘áZOh $¨Æ.…\À! G  œ˜ÿàÄ€ '"pX×B Ȱõà8`« †;‚Y°Ð'DÁS &QQ¨Jh  7F 80<Àc€†›I[„9êï¢FŠJâ™ äÉU)=72F6T¨ d¤€U,€ :AØà“öŠ‚1šT rÁ P"„$JX€â],œ€vÁ&²ee€ƒ“5&ÒI‘B®\;sKP`0ÀÏ!.¬`!„ öÆ ƒ?¥ZpAÀx8+a‘¿@êì”ù(˜à(@Pṳ́X@û,ž”xÀµ\D©—±tú€Ú|ÊA‚ °¡™ ™ž;ÿlc à4ÈÀ… œ+ †¦Á` €£$≬ áºì­;ì /€0*›øš´@ƒ‰ˆƒJÀ¡ª| &è(Aük• NAÈ@ÂÐNŠ 4lŽZ°¥–\ày ™f#šÀí‚flØj)†È¨ŒÇAT`B°è,+Žæ{̵M4  ƒÏI(qè *Uƒ • ô@/q €€h€a#²8B³5Aº¬ ° ‚qh™¥B•*ˆ`„Hˆ@¶¡#IrqÍhø€E{z!(4X` FÈFŒP, iÿʸ¥5˜  Ø€mˆÖ(Ððq`½°@‘NyÒ!ÕL)a À°0;óÌ7²ˆ†šeV$FDšë®9òÄÓ•:È%².ÃÐ…bàÐdhðàQv J‚iÀ/b(ƒa„¹` £¤ø`‚H48˜ûåÀ … ¶‘Á"0Pð0(ëD×Fx/Ávåm.”q³Í¹Qc›Y©´ [„‰Ì–!P8¸)f¸á† @º'Qj舘b€a €€x!§Aq PhX@„²X ÀNÑÈà˧ÿLÏ?!‚Z%.]ïÈ@Ÿ© VÌî´–!Œ/ ügî—ɘÍÅoOl䪠‰I&‘!†FP!’›ŽIwDÑÛµÁÜØs¤Î\¶¨‡6Â0 "ñ\@€<‚qBAŽ÷Ñ`@G@‹Ç¾ çi(!ÌÞ2Ÿ-Ýe8°„õ|‹,€%úÂ,6u¦|‰Kž*t<|!2ð+L•,À‚¨s @ÿHä?È® oQ !Á3ÒT<€ ð!Xn˜Ž„QCr àè(ÊKØÀ LMV—9 6Z€+wa ÿKi°¬Ä-2™Q`Tõ5Š0€"JÂl†ÁÁàñ_ˆŠìzÁÀ4`Xð…†JSˆè…R)°…¥.Œl-«‚Ì—ÊX q‰"@€ä0œ@VÉÝ8#—à"ð€°pð0 ÉO)„ëáøÄ÷²Yñ0³Ö9ËiŸl1@ðž»44Ü G+%Ò.`¬’•¸4´ªÕ t,FÉË<’’M¶£5@L h¦ðe0 B>ˆ`‚˜^ð‚œÒ øÒ.•°Ëî¬)æk¤³Zz™Hb 4×:‰>¾0Ÿ±@ïÿZs.t`÷,å ô©JVZ1uñ¾Š!œ ÀÀæ‚(4傆žLw3¨ *ÔÀÛ, ƒáD®$Á l`ƒ là"@«ƒˆÖ`u¥° 8%Y’¿V’’Õ¢ƒ5* ‡Â°ÌÑŠD DÁQÒàF3êe_°T®RÄÊ ø¼gÙÐf*yd“,!HLêtwî n—@B8*×`™«êzC1_Â@ø´è¦ù°‘Š#¬gT€‰D ±“x ÜI¨Ò”€sÈ @è.Þ‘Jq­¼Á `y!p! kî k! à@ ¨™f+ÿ4~‰ƒ£ hÄÞzÊ 8¤6ȧdÀîÌq@ž£” 1tçL†Ã˜IKôáz `¤(ñ÷ZjÊ ìY²m ã,†dà @,ÀKÀs°%2û4‹äÖí?Àì„ÅÍÈc;Æh – =(¬aàâEK†#‰°D.úÊ|PÁ22­Eà‚ràç[ȆJ "¾$Xà³4„ Ž yæ‹)™2.a@,¬‚ø„ª ZÐÿ À@VHðì æ”¼å†T.RtÍF'(ëÜ´F‰lŠrÍÚ,<·ÆEÊñG1~Ó­¾€*JàªJ€ÒÀT`Ãd’M,à=@¼À¸&1…Kg”úê©FÅôÌ"÷©Š>½´¦—’)»ŠeO€¸=–  Æ^ 9JnAP`*ÀE~$æèa,‚ÅäACN‘¨TsL!u´Ï"]ퟭ?dÑîÀÎÂ$2âˆ~°k`Ôà(dÍ„¨|\$‰²[8``¼¤N„î’áä0Rq•"ÍÔÕ\éRùCLÜ N`‚\(€2´Ž°ÿR,À(,` UP¤"@N€„3Í…#’¡Š*WÅUìp”ä6ëÕÐ¥õø#d §fŒí$„™J * !Ó` µ3²ž&ÀNàÛ8àn¡ëD$;Çua3ËIe•†Åö?á[† †îne–€aæô(ó^•à7Á  ™2AD€h‚s¾uó6f´Õú Åf ‚fè×(LV,ŒÌ&üέ4ƒÒ†î_š åZÎÀ \Öì¶Qf¡öÒŒÖÍ^ ½È¢¬Æ†ã[”¢,„nFà&! 懴ãB5ajDá!“aõ¢vn¡ÿaR½óİöl〴fd¾Är²# @QÍÅÎVùp4g\`žÌ.\éöqÉu³ öÄØ ŒŽà˜B N L¬óEnA¾D·ùÖ¢¨ÏVrU÷ï6M+7«d8 a†é–nÁúfè ãì4Ou·]P Mn•zÕTn×cÑTãv«Ð ŒNnZ€<îVƒ÷z=/³À‘x«ÈfM Ø")žfÜ“" Â&Ié f±·}½±"‰·¬(Å—b`”óU¿­zêê‹ uÝw€µÏ_ÑŸrb@º5i9`TÀA¬"¢b Po€-Ø'V/¹ï;‘…,sP#@¢7°­·.ø„…·"ðjÑ‹3î¤+h…iø}“ŠûZ ÈãD DÊ$Àz$€}k¸ˆ³×©¶kŽ îc7  ÂA؈©8Í@^4àDvEˆ©ø‹ñò·äe^` Q¦ŒÕ®r@^‚âÈr@å¸6ØøQçøŽñ8õxc6;ntp-4.2.6p5/html/pic/fg6039.jpg0000644000175000017500000001632710017034536014760 0ustar peterpeterÿØÿàJFIF,,ÿÛC    ÿÛC   ÿÀŒ"ÿÄ ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?ûúŠ¡©Ik1S¦ÞÌ€ğ0ÃòwéX ãû(n^ Ý+QµulbXÀ$v8'¡¢àuÔW!}ñ J†xí.¥ò˜Æñúó_~ÔÞÑÙ#¸ŒÂò¾ÈÖâR¹oO•[š‡8§f̪օ6”žç¼äQ‘ë^à/ŽóøíîÂÚnšÂÛï½ÅËàÃEO­øûâ,6÷iˆ‰¥ÂÓ\ˆ‘ä`ª»ŽÜžxÍK­gTg¬bþçúžÓ‘ëFG­|ñÄ]XÙÞßøÛBÑRê2ÚÞ¡œ£}ÖÙóä{ÎW×uKÈ-.>5;K<É­¼€wØ •Œˆ&‡WÈ_Yíø™ôÆG­G=Ħ馎0;»_øŸâ§o¨ ;ý_Yºs#B»¯ådg\dpÀ¼:ÓY¥}.ËT-u/âÒ6®ãŒý3XÏ´šÜ‡Š©Èæ©»#ìû¿ør×&ã_Ó"Çg¼Aýk*ëâO­äØþ%±f'Fåóÿ|ƒ_ } Ú-äDŒ¸Ò5Œì8êØgükOÀ~2ŽY_]ê^éÅYeØþbdd ÀgžÆ:âœk¹ÇRRK–×ê}CwñwÁH#MJYÜç »öϨ±¬¹>8xUƒ}šÏQÀR¨#E/¸à`nÉíùן´оÙñcUŸÃÚ¼±ÛÉ*¦Ûj%%ŒŒ‡Þ¹zäƒÒ¼öÛÆþ Ó5›,uÁiçÊYÀ™å’FùpwŒ€ÜzÿJº²œgÊ™ÕR¤oÌ—ÈýñŸí9áo É*ßiÍŠ1in•r¥‚猰õ®fOÚïAž)¥ÓáÓ™"Prn·îÎxÇLwÅ|›ñ[MÕuÿê\ýªâ(´eŠêVoF2£!ÛÔ.S÷¸é^oð?Z¾Ðu BK ›»´H»•ÒMÊÀ\Öp¨ç'-P¡’“R“_/øÝZ?íáã­Àš¿—‘?¾6¶îíôõ¯¡þxßIñ÷†·th/á¶2lQ{lavUƒz©Võù9ã ImtYo!"h@0³ÏBsüëô þ ¥¨Þj_³Ô†òåæû6¦ðC¼çËa‹jašèÍiStÕœ›õ>†¬èzUÕÖ§unÏ5µ³°)!]ÛT+~°>!ë:~• Éü’F·Ñ¼R=Ø%O'Ú¬Ôò¨%ýØõ¯‹iï j_Äv·µ¶»¸²RŠpɇ\“— »?‡zûÊub0'Çzð¾%ÐÄÍCJŠêQª[¢‰ah܉Â2¨Ã8'§Ö±«m%Øç®­Ë>Ìðȼs­ø3V‘ôBöÅfŒ4‹jªÌ~RTàñŽ÷?Ùcâ‹õo_ëÞ0š;Ý/È\-üŒÄG Ç~Cž>âžçŸ—>!Ý<ž!•mm02‰RŠªF+ß?g{™¿g˜´ÈíîØÞê1D¦4$n+8Û»».¼dW"’mÍnc)Ú-­ØÝw_»×|G¨ß]_Úù·wI4¦df‘™HU´.6‚^¸Åi|ÕuøÃkw=ÑšÖíUP¢ù+4Í…@"'ƒ¸Œuëœ×ŸjZˆ´Ö¹“PÑSK¼ƒQX ¾XL€ìÉ™Gq…ô®á¿ˆe‹Çþ¼¹µº¾‘õËHÐYÆ\H§-Èä\‘UZµ‡,“6¥'FJªÔè~"iZ|×sܦ£WREr†6 –(pÊ_<©Ë£8ñÔUø?á­GÆ>3±ð“ÍÜQØ=è¿yÕmâ‰$3` @ éïŽ[»»›â¦±f„-³IÈÞÏ»t##èHï^ÕûÌßð¸/%žHã#Â7…ß(ÿI‹œt­!JÖOTEm|Lí4ÙÿJ¼Ö—O“XˆÍ"îiO£`u.v‚x¯ øƒðûSÒ¾+I£FØÉ£´Ö€2.ufH`cƒÜ÷¯¯´‰%²øˆ÷A€–b•JžˆÎ\À_8~ÒPDßPýH®‡àλi©|:‡[Õu»Èã¹Ö ž/!¤!.ÆáX6ª)Ç$á æ¾pðþŽÖ7³ÆÒI2ÜÙKœ&0G<œz⾊ý’´Ÿíï„W¹¶žtKZßía½ÀÆVƺJËž¡ˆ©… tõ‹ÜÆ­NxF,­â ]?Pº¹žÖ+«ø’w™Û$ª¢±+#©# ÿi‡§7ÁmsA<ÐtËqoepÚÜ^TRŸÞÎÀ¡FÜ.Ñžrwwè<ëÄ.«kâ%Ónnu+Ó. Çnîå$’5ˆ:Jªg$ôÙü,ÒmŸâ‡‡.ÓCƒí–z¥’›¨€s4oÁI-ÔjÛ‘= œW-žÇ,*ß|Eûá#,jÊAÈS½†Ó5뿱武éÿßPÕ,ì$»ðÍÝ´Rܰù¦xØnÏ=q^Câ=7UâN¯}.±\Ì`Ü”ü…‰$¯N•ÖizEõ°D·[XãØ$3\8I%c†8‡fQÉþUN¢I#WV1i\úâëÄ>Ó¼K.¡{ñI{f·x¶Â¦Y2ÀŒ–RsŒôö¯žÚÆáín#eDgFËg#nzu®sãψ´û]:Z+™-¼/ikc;¤@¼¹nÜp6å—’zžæ¹Z’¥·V ’\ÍÞ×ùž7àoK¢üI´³–oíÒ´õ–ä¢y~X.p9烷ó¯¢-uˆô_ êúDzj3_<Ö¾ie&q6ô=~•ãß µ{ [âŠüG qÆ‘C¬q€¼ ¹yaת5æŸ=µàMEmÖK‰ŒAUcIÁ‘_’z‚xèkG¢»ÝR¨õ‹7>ëwš¾³§ÚÞØè÷Ä}u)t¨ç»!íf‘ ã§­XÕX·þ"¹¯ Ît½@êPO$r%•˹Œt=séPx¡®M½Üð\0…X8› ìÌKço$óÔíškîœSE kÿÌ™5K‹É’+(&‘Hi.õ 6°ù€ÁÎz.?3éL¾Ñ5÷Š'¸Õ¬­VPªÙ·e@*:rî¿\ñÂZxƒG³Òdµ—ÄQ˜å]“ÆáA0$r§·½fÞøûÃ6¿*ÝÏrD›Â‡;sœôU# K¡µ%7M{¿3—ñež­/‹e·Ž;¦°‰ƒnê¹”±È,N:WAá$¹[HínUG8f˜'9êFsÆ:UM?źN§-¾§ºÊèv´ƒå^$Äç$kâGˆ‰¢Þ\xwK×§ÔlîmgK’YàpÊîbzîöé]ÿÃcü"aKý‘Cc®3ÅLaÐ'÷>zøãû;øsÁ_|[ãO jÚµ¾©" ƒ[<–%ö•PTì8~©2 $‹.à¡ÀCœ`”þ•ôíq¤ü:·¿ŽãÉŠ+‚'}¥ÝU¦T ³É:×ÎÞÖm¼g¦5‚,–ŒZ(Ûk†Ü „ÝÈdŽ3Ò¹!N|‰­Ò×»ØUùõm6’¿ÉuùEá}=uoÝBo-¬`/“O;ª¢ß’Iéÿ×#§¼Ñ|e Œx j†æp<¸ÙÈïÿëªW¾Mâ¹áù.b¸û#À«;ÂruÈ\Ÿ_zuíΡcä˦4B8bØÎ°ù— ä7SÁÉæ½'gxÉjŒéÍN*Pz=‹ß`ÔbñŠ=¼‚ÎF·Ç$ñnLq¸x9RGãš>=ÛÏo§ÅìÜHÏL™béíÔÔ_îïõ~öigv·qŒdãŒÔÿÕ~Å ¾©.¥"mwçŸ2,.@ì®)/ß&g+:Úô8ÓŒÓ çßéNlgÒšN1ž™®¶ut9Á¿^ƒÌLjÇ$Ž¡›úŠë´¬­â’Äac?ì¯9®ã!’ÛÆ«æOÇì fª¼ç ÇÒº 8•¸Þß)§'ŸáZÆŸÂŒh«FÉܵ¨)W@+‘Ÿ¥~…Á9H?³=™ƒ¨ÝüxW玫=¿•“9 #äÈÀsÔãÚ¿C?à›òÅ?ì¿a4y‘¾¡rQÿ¼7õ­#¹¹ìž4ðý‡‰ü1y¡jh^Öö›NÏp{Ö¾uñÁë„þµ°Ò|Aª^%õÔ†_;jóŒä8¯køññÇá‡ÃéüQcs~#‘bŠÖߥv÷<$Ÿjò½CÄ~8øÇáý7UÐ<-mk¥¯‚k›Ÿ™‰ÚÃÓ¯Qjfá2—5´9M Æ+:+?Ý›•Å˳³É ôÜOè+SÂZ§Å8í¿…tKIbذÚÝ\†‘#P2>@Tu>µ¹áÏ jb½Ò¼O¥ÚYê„oпɔ,ÊxÎAÎAÇ\u®ûá&›„, šÝ<Ò‰—*[ñ¡$öÐîq¿ l>6M{ñVÒ¥Ò%½œkÞJà‘‚xçøZí]€ä. ßÔø°“ßΰn–p?°â|éÿ"ñ h´øÞ"j:€úŒ!pF¨õ¯–~êzµ¡‹RÓ´ÇxmeId_´…FØC…c°{f¾Œÿ‚£ÄÚÂßÚiá®§W.ðÂ7º¯”ã8ã5óÏÃ+mü/ea¦j“ÏwHD6`¢¸Üd$ì+8¨F|ï{ßçЊ‰Í5wkkèT›ÅRêÞ5×µëíö·Ë ,VÉòòâù[' m ÈÉÎ*GV·žÀÚAbb,ÅŒ3199ý¶kKÆÞ¼ñ[C§´,áå–HË€ \z¨¯S°ð¦¯©_YÍqgu# ýép;@R3œä~±€ÍÔŒ!{[XâU,ÝØ«²ó’û¸¯2®2œeÍÌ´"t1U§zp~G•é¿ t”./.õ¸Ý‚‡$‚@þ&畯oðãD¹¶k{c(EhÊn¸’BÀ=NxGãõÿÀ¯‡^›Âßjºe¶§x²²ùÓÆ6€8'Ýûgšõ];LÓ¬!XØÛÛ Û Jƒò»à¥Z \Ú2ªaë8¸NVg榷û)üNñž¡ ÞáÛ‹m«´ý¦1n¤dÙŒþÑøöø¿©]‘«k>—îK^¼ŒG¨Xמ=H¯Ñ t¥­áMEXÒ…cïcã~À^·‘fñ7¯oXrÑÙY¬9öÞåÉü«éÿƒ~ðÿÃ/ZøGÃLš}£»§žá™ŽX’}u4UÙžyûNxóÇß /´m0FÚ‚©–Ñ$m«#í#i=³žµâ~ ð÷Å/‡ ôÍ3X³³±’I°å/7å‚mPÁ  zp=3_W‘Yž.±³½Ð.…å¤7žDYSpV pEC¦›¹JM+¡j:Žž.o./d¾¿º@¡¶mŽxr)žK™ïnCJÒym UË1cÀ¤×¡Q]”ðzjщ”ñdîÙGÃúE†§-Ž›n I!ÉêrjõWZI+#Ü(¢Š`QEÍüQ×âðÿ†üù­^á.ŸìåRM…C+dçÒºJâþ;éwZŸ€åkE.öR ’€dº¨!€÷ÁÏá@+lÙ=>•îÿ`†?YK)M¹¤* ;ˆÉõ8~ó͵öÜûä×ÐÿY›áΚ̬¤£cíŠé¨¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š*+æÙe3íݶ68Ç^*ZC@1xV$¼ñœ©¹gºŽ7BÈ,ôÕ¼i H¨ˆª¨ÀP:T$ÐtgÔù´Ë_´ÆÛÖQ ×5¤:P€(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢ŠÿÙntp-4.2.6p5/html/pic/c51.jpg0000644000175000017500000004005510544731165014434 0ustar peterpeterÿØÿàJFIFddÿìDucky<ÿîAdobedÀÿÛ„       ÿÀïJÿÄ£ !1AQa"q2BRb#‘¡±rÁ‚Cc$’3Ssƒ%ðÑá“Ã4DTdñ²£³5ÕV!1AQaq2ðñ"ÿÚ ?úf¼A@ P( @ P( @ P(ZЄ¬„¡ •(›M;=êf& -cQú“àÙKB¶°Ÿö¶Vãü ûksJÅÞ9ÿTúÉÕ£¥ä¥¸íÅJa°BR‘sæ8Ë?UÑ^»H{*ˆÒäƒ&ëBKnXn‡P7€/±\{ªÝoc¹cò0²1— ä¿Át­?ÀŽ Ž`ê+•v•“@ P( @ P( @ P( @ P( @ P \ð ŠfýDÄBÜÎ?ýå,if™IúÝÔ“·4µ‹¼Ž-×þµ@l©œ”ï¿5oFA<Å\Ž?2‰®ºêå¶ö¹Ö#Ö¼—ë7ËÇiG¬‚à %Lö.üWßû«XcÔ-!2#)¹˜éIºU¢Ð¤«‘*XÔÙ‰ÃⱨSxømDB”V¤´£qçjÍk-ÿNu.G0¿ùŒ8GÜÄQ²¿áPä¯ÛqRÌ’áÙ0yìfj—ÝéàãjÑÆÕouiäwer³Ò屨¥@ P( @ P( @ P( @ P( Ök¯°˜å)ˆää&§O!ƒt¤ýn{©ïµÏujik7y¿¨:ÿ)™’ä¥Ïy>þ'£Mö}ˤ„ë«Ø+¬Ó;ok\ÏNΚ/œ|»Š„¥!€;wÂã§´ ©î5¼3…®¬ôÿ§ºœzØnñF6[ ,®Ý©¶æÉ÷“ý5ZËçn¢éÜÇNå‹Ë3åI@ÜÚÒnÛ­ž4¯‰'÷s¡cyÑaŸéFÑ-qÞ‘ÓS.¤¦í‡t*òTtÜ9ŽÛQ›¯·m;–ǵ’Æ<†è¸Rx¤ó E¹Þ¥†»eì‹q¬´ÊÄeò8‰É›wËth´Pâ~E§˜ýã•K\;Luf7?{Ê–Øq gƃÚ>dö(~ã¥rºáÛ]²ÝÔR@ P( @ P( @ P( @ P(#ÙÞ¸Ââ–¸áFdôéö¬jB»¿uüû«SKY»Hæ]Mê6F|¥cÔã‹yÁta1Þ' ;^ré²{JÊSÝ]f‘Ëmíi™Áe§õW„6Ód,ÿ¯’,£ü­Ûùo 7páÃ1¡°Ühé÷Zi!"ç™·Þuª¬‹PSøPj:§¥0ÝO‹V;(ÕíuE–<æù›WñOE•Â¥FÎú}—wcõ,ä/|`ÃËE¬h¨+Êq*±U¼B‰g¸÷&çDOg1Ó¹ò=;‘Q ‚·EÔ‡E*Eìt±›‹ãË®à󘎢Ƨ#Šs{|dèãKµÊTžU›lÉ Ž5–—"L• [s!º¦%4nÛ©åÚ:yƒ¡¡—\鸅Bc?hùT¦ëcárÜVÑy 4Jû¸]•Ïm]uÝ7¬6P( @ P( @ P( A§Îõf 6ÊwÌ’}ØŒÙnŸêÜŽõVkj]¤s^«õ:r€mÇÎ5—tb ]ÎLxé Ø7Ÿêß]f’8íÙj4Î;=‘HóèPTn¦Räç䥸›fýە쮘fÆçˆÆcZ ÇK>a»®\­×kŽ(©k>ÓTeû(¹íî òµÐ¥í+ [R.£ml‘ÌÐkQ7#9 ÁdÅl(ÞCãÞ‘áA²´¢.ÅÃÄaÓ!w‘*ÆòÖÂäøA$$ +Ãù¦¼ÒÌ6—:G ­{‰Vº8¿ƒ‡e-ˆ¹‘µD\¦÷·uè¡ãA’ÆãòpÇ䣢TkÌ,\¨r#QC.Õ])Ô¾›e›Êb¤­ì3Î&F»N¦ÌKHÒö$%\ùXг<­;.Dw®ú)§.9\ZŠRZ*:)±¸ïi)ü.hž|ºODõÞ3«¢Y1s,ñÉÑcçnüGðçR¤¸o–‚’A¶–ì¬XÚÚ’±¨:FzŠRZÆç]¸6D|ŠàñÿŸþWmgm]5ßõÒ+›¡@ P( @ P( @ P(5y¾¦Ãá‘y¯8‹·'—ì@þ&þ¬ÖÔ»HæýUꄵ7³Îý&+§kM¶Jæ¼~T]W=ˆ﮳Hå·b&Ì^ É¤ƒƒˆåÊrÎäžÓ¹¶oõnWp®’0Ûb°˜¼XR¡³i‹?1Ò\çúÇUugê£<Þj"¶¢µG 37¨øiã4­ û‚ ºï"ãTß´Q,daãd™ÆGg#$MœÒ6È”‘´-W6Ð÷i~tÎå…µÚ¤êž6¦ lsÞ»ôã!Ñò™ê>yR°ah‘Jl銫îoÌ÷’ãZøûj5Åœ1„ÕÔý:ÆuF=W›ŽŽ ’ò€¿ÜÇM÷¡ï&Ö<=¤Îx©÷BzˆÇPÒ3 z‰‹ ¥cb^(Ѐ“ªV-âO*–&lò•:Ò¢µ¹VpÞ^[‘¨&×ïb|¼~QJ{p–Ÿ7RØ,y©±ûS˲³¶¹o]ðë :Ó­¡Ö–—p!Ĥ©'PAk“«Õ@ P( @ P( »1ÔŒ;Asä%¥(]¶‡‰Åÿ*Ô}¼*É”»Hç]Oꌯ¶Zâ0¸óáû‡T …ßK'’IìMÏa®šõ¹m؆2sÙE-Èm+Ãuäç$®[·â¦˜UˆþgHþS]daµÅ`q¸Å˜Jžœàüì„“æI]ùo#Ÿ¥ 'º¨Ø!b(+mh¬YÙX0œŠÌ‡ÜMsʉ´©Ç\PÕD! ¨©GDŽ4JË:\#J)nt.¬é&:’4v›"Û-KB£·âN«Wò ]Jü$Ê[#Ÿuª2‹.!F&}ù²J|Ëw$øûë¬ërÛ±n^k.òÆ0¦šwÄæo"JïÍ–TRëŸÌ¢”÷šé#ÖÇÓxøR>õÕ/!“á÷ò¬¥§¹¤ÐþAí&´6¤“ru4F.O+‹ÄÅû¼œ¦âG&ÉS‡Ä³ò¶u­]É…h“ê?MùƒîQ6U>Tr†Î…d)±Þ´ÛU2”ð‚Iàƒ¨ öŠÒg²RØÉáq¬ÉLro:—§©)Q»( DfÊýÍŠ¹$ÛZ u>#2TYxÙÿ¦åmèûI /ÄyHSÍ%{V¶•vÓgP’SA—‹9´© ʉ$&@\—%jM‚J–¤ ZÜIº‰¡†ÊÔ·e¦ÎtoNg¤1+-Ïz"v¡Íê@ …oÚ» o­0e«Ëz‡ .*>”æ%Rä ­Y#æx ºGÊÕý¢®Ê+532’Q+7$älÝ–J|¸îã‚S©{•ßW³/$ÓK-%*zHÐ2x‘}M¸Zª.°§ÔÝÞl6»›$øo¥ºƒÃ¯4Ã*y÷Ó([‹!)¼š¢î3ÔôŸÓÙ8üjÓc—˜…$¨+BcG;Vá·*ÉöÔ»~5%tL\8Ld \Uùq⶘Ñ|Õ ëOá¹GRmYiË}Mô„;ççº]“ç’\‡lh«ê§#Ï™oövQ|¸Á‚8\( ê<-Dv?Iú¯©òN:|Gfc#¦ÑòÊðì¶µ-_ç;­¯mFqg‡Av r(}¤-•qC© ú¦õœ7•X3!¶ZKm Y(@HÀRjeܺ] ×MâÛÖŠÍÇyl\6ò﯆΢” @ P( &K-Æ1çÏ’ˆíëb³ª­É)%à)&Kp€u©òTÛŸ¦%a ]yV Ú8©(W…#½Wö é:ÿ\¶ìsïÕrÙ©üK&Ytþnv~àņ—h8÷vË'ꮳW>k:LBnCsr/+‘lÝ$€i]¬°?-¿nªú«X#rTN§SÌš"ÌÉ Å\ÉÒ‰½\}å w\óî¢Ô?%×Óe(µÓ±ÃQÈ×/9 ý„SµJþg,;\3j>˜»æòrvMCj§H;ÜÛò Ú~”*ᕉ¹h¬Æ”´$Ï\}¨‘8ó\üÃk‹ò¹"ƒgÒ\Ɔ#¿'î:J@´º©PN8}ï·¾—:¶t> Ë£L…dW"Ma¹Q{¶Ô8ƒÌw‚+-e‡ŽéÜ5õHƒ ÉZv)òVã›8í p­A=ÃJ$l¯§}T‚¢<€¢#™®¹Ããœv$«-–oEBŠ Ú¿óŸËoÙª»¨eÊÉËçFÜ丄…'sqµüÍ|ÇÈúÎߦµ„Ê©P€”¥"ͤ $Xh,9Q2Öa‡Q]ßÕËVòü«{×ÖÛ~vëCúlõüN—ª)n$›$jIÐßz‡ pQ”̨·Óñ>ñ ís"é-BnÜ6×t•°}¢–ÂD«ÐØLao'’œœÖT’܉A-DadØy,°ðRÊ•Y­I†Ðç&äKŸ¢¶Ü†Ñ½ ˜ùRQ椛xÒEõ¿cEU8¨1²2:eìÓï€BO­4‘aýAg/›K.8àš@WÚÆ rQIí¹`Â8öÕW½:ÂåóŠÎæa6$:”ï‚ÒÔYRÇö¯Ãç:~-¡)=‡fÕÊZÛm2Úi!-¶[B@JR”0ŠêMεUáÐJ,?(;ëhKm¥´‹%%#¸ W•èz P( @ Pcd2P1Ñ̙ґñ¸@¹µì9“§­$ÉnLç©Ï9¹¬#!¶À;§IÐ_VÛ?¶ëÿ&ºM?\¶ìqN®õ‹RŠd«7•$%r.VËBúîPÒɽö6?eu‘Ë6¥8¼3"Äl´Ù£¨ðEp°‡bšŽ MÇk›”ekTˆ®ö¾¼¨.­–™[ï8–Xhnuç„ÍJU€¢¡ù/P’è-tÌq4“ee%· #µ¤èãçÙdýUpÎQ§Ùzl¤MÊÉs'5³v\|ÛDÿ e6m¿h»êá2·;&Ä@½ÁÉ2ûVæ;¨$]#ÝiÕVF¾{™ Ññ“ñæB±¯'Ì”ÄE¡©$8[RT­Ãï&õUã€_Ü1’u&„¼¹Eh•THKÜ@Þ’ ‰HÕUá§ÃŠêÞ Æ†J”ùXJ%~þáÀ•sí«„Ê[逞zM x¨ã\ê°>aܱÐ4=»·lP›VkZĪÚÛ•Ejs½U„Â,G”êžÈ­;šÆFd•À” 'êY†PÌžw¨³AH–éÅã• ÇBYóVŸüÄ¡eóKv浄µ‡ˆñ˜LxÍ¥–î¶ØÚ‘ø 3ír¨¥@'A©¡…†¤».b bc/'FŽ2Ńm_ý;çòÚÓ~ê–µ"Kôõ…6%uK蜤 êÆ´J1í¯Žö[öí_‡é©•ÄHåOÀ ÏmH¥·´Gi]"É  ˆ9ÔU”b7¹—&­aHSj3å«RÚtPîá~Ú‚™<ä|qe¥¥-6°7©ÁòFe°Vâ­Ø,9š [HÍKRϘî::í¹eIT÷ùÖ›µw7u}B¦L3!Àƒ¢Ôf‚¥®×%K-¡å2<*µýõî5¬2®B{CÒwÙÅ¥–[BJ–·î¡ ͨ^ Ž ‰Èå˜RÀLp¤„¸¥JƒÅdyJ@ÅTÃ>>ˆyTM²:ÛLd$’öå¡EDßrU~<´¤V\X‘aEòXBXŠÖåZöB‰RµQÐ\еÍú‡Ž‹¹œZDÙ#O8Ü0“íâ¿ÃJ™Á&PLž_'”{ÍÈHSÄ¡Gò h+9jD»ÒÿR&tÄäã%%Ù˜‹ñElaÅjÂyßâG>oQ?öqO»ˆ„çæ(vI”›êµoæ53VDŒÍÁàYkˆ†ÅœT'u•ñ¯ªQ¿:ž–ž^iIj3£Á‹jÊ- T·“©Zmð›P\•’‡ˆØm¨ …¬7´Ü‚úÝwà.h5*›–È”ˆ)S,\Ôf´¤vÆ‹¦Ûüï“S#".7÷‰én =)å_XìS‡‚~”Ù=Õ’THìO`áAJ U*Û‰ìÚUïpùGôš ×G0—z§‚<)qK·ú¶Ô¡ûÅgo kåÙkÎìP( @ ˆz’ÉCÇÅj#Ša©.)A²ìÒ€F£v·#]+§\•ϲ×Í=IÖy89Y,4]rLwT•c J›a íp¯i~‡nlçó˜—ô“™÷à.^]m‘'c›l•) )7²ÔBwûWLåœ6Ï2—I÷¬XÓ‹úéò±n9˜Å5þíWŠTtboªÒ>CÌ|>Êšíêˆö ¦áfñ2SQI©äc]ږߌ”ÞÌ+ŠâH?ò×LHý+õ9}3 a³+Qé÷T  R¡º£â;N¾Y>ú9qí«9DÛ©:}¾š*ÈÁVþ’—e(4oúzà¶È½ã8Up~ôÓ>©fPÖ::Z¦¡©ŠÃiÅ8äï9Âì¦Ô74‹ø\mZù€û+Q%I1ø¸°üï$-Ç_Xq÷ÞYuÅ©)Ú ”®ÄéQ–›5×8liS,¿˜<¶å¤ýnpüé’D3ÔyŒÂÏÞ"…ÉÊ”¥•¥›‹›ìi $ž®æµ5Ã9H ‰ü8UdƒÕ$’x 0;/!Qp1¾ýh;^š¥l‚ÉìqûÊ#`ŸeK…“)4^ÁáÇê½Q1)l„¸Ÿ9;!±u„3ê½” <Ç/nê–µ&ÿõRõÔGé¸Dj4„}ÜŒ›Km*mµ”¼Þä©RoËZSsµ[‡ T\WHãñòÿP–ïÜɳicÎ!IcËqn4”¸BVê›.© ¸¿G†ŠËËf¾Ô6„ªt~PJ ¯*Ö·’À¶á¯¼«$s ×}¶BiqO(ãã:w=;‡ÎwK~|m£èjßÌjZa’Ê"Da,Di ´uHJ<ÂGñ©ƒ/ Z”«¨ÜÐy½½Ô2¦ëÿÃJaUïçA[ÐzJ²Eîl/¦½”ËÍ…)A+QÏöPP:ÈôAѽ(bÐòR~wÐ×ý7ÖW.Ç^´î¹¶P( @ ³22eD~2ýÇÛSjö-%'øÒ\8ÃE@Ü÷Àµûm¡ükÛ—‰íh NÓÃøTkl¡D²ҔP€E¨¬ –6,È®D”Ú]ŒòJ…‹‚#Y°pÌö-Ð]FÆF ”¸{ÿÃ< RªŽõÁI¸áq¯"®›þ–Y†Åä°‘úä4‰î©¬ž)N¡N7&À¨´‘e(yB××u€­Y„L½/õVè®­"C2›1 KxèëjžWÍþ‡V¼žóñsúk$Ö#"âä‘táò® ÿ»H<èÆ5ãIsçÊX÷ýYTÍh‹ ™ºWØÁaÌ–Kÿ)æyfÈiRȦp­ÃÚ™]U-µÇ¸ÛŽaKD=ÚŽ,YÙj°>„£ÛY·-a)Âå¢<€ÌÔ–˜ ÃØ–ѱ—<¥ùHE’‚•[ÃÌ)'€ÏDce"J²’žÉ!é/?òµ6êbÈ@K‘]q6S¨]*IФ'@EA·“–ŠÃëe-´ •-d¢:MìRw/éN´È×yÓ¦-E­èmGÂü”¥K°&Å–ÚßyÍ~š–«Û¢DÞSwsW]RŠÜYíqÃâUEuKãÀp…lžÚ$ÐWøÕ öþÊ ÜvQ^üjÈõƒ |ÁÃ0r³Ç…^Y´v÷Ž‹‹ý)¹©v‘dÊ57- 9ˆHËä\ž[èLH0¿ÌGqDî@;l/­ÉQ©.×ø‹q<¤ð`fÂÒ™¶áJÊœ~ÊÜP„÷º”iÊ7iº––Ð’·v¶ÚR”£À%#RkH›t禓¥„ÉÍ-PØ6)ˆ‚<å­Z„{ϰ×=»?&ŽŽÆÀÆÅLX,&; Ô!‰áuªyÖ¹[—I0É P( @ PrÌpÞZ{$mÛ!›q¬©$~½zó#É·–I¹J´Xýã´V™m+MF¦ XjII±ÖpÑEP€A…¯5……”‚ì ­c<6q‘Pk4á“ñùïOz¹QˆZHZc>âû*ÑÆ– +n‡öŠÞ»%‹½[Ò±ŸÅ±Õ˜å8ié • yˆ÷ö€J¶þÎ<8[0‘<ôï®ñý]ŠWEõqJu¸rTv™)F¨ñ|2µÐ¯‹ÛÇ^±›#§ú·ú¢/#5ÑrQ<¢·ð‡ÚRÐPàà¢<'&߬ÝWàtžk!ueÜ8˜€ÙXø®!Rˆ?ø‰Z´À?*7/¾¦Wå¶j~+Ò0½=€WÉQBR|‡”•eÇÝ)JÕwÃÃQQ^¢b²Ù u©>sQÜC¸Cí,<†î¦Àm^¥ yq¡†á¦qÐ’ópØi¥*î»…‚/cç>xö_€µ1ËÉ“và%·›P±AÑȆDžr? 'êåRÕÀÆ5–\Cò_’„ímklOÊÓcÀÒ”_´šŠ¾· sŸ´ÕÂ,›TÔª£É$ÐRô¾”ÝEk2ÝIÆ(2â•"rÇåA`oy]—;Õj–˜Eº‡0ê£oêYƒ bíáb(—žŽ(Yjýɬ}[ᯙ<¡²z³7™PÃtä5Bбµ£ ¼¡ÏÌp;mjÔÒNiwõΈôÔâ%3—Ë>“5›­¨mêÛk"Û–¿‰Bü´­]˜Ã¯ôçEf³¥.¥&=Bÿxê}áýÚ. ýº'¾±¶Ò75˨ôïHá°(&#erV6»-Ó¹Õ Þ×Ð$w$ ã¶ÖºÍdnª)@ P( @ Ps.²dµÔ’‰¥·ìØüPkÕÕþ//gù4«FëÙCT«²¶Â‰7‹(q]h8Ÿ¨p©bÊÄ) EˆåYiJ )!BÆ Òu'N@Íã\ÇÎFæ×ª4RT=Õ¤òP¬ØÓ‰½'ªzT¬8)LYkóêPïµµM’Ó«JüµlZ“Àí&·®Òı‰Ô¸LD6 åúzbÄLð°—‘*<–@+Ajü:û@¹Ò¯×½2õ$u<›é.HuGš«›÷ªæ¬Óõ.øð¹ôã1–tÎÏ:äFœ;ÔwJrúëºû?Ù[Ïã×[èîŽR“úoMcü=áî‚~'žW>î=‚³nÖ:÷LúeŒÇådÔ2Óe‘þµ}(>õ¾e{l+–ÛåÖhšV( @ P( ‚êrœ”9ÑæTÝ»ÚUÿë+ÑÓxÃÏÝ9E볋ÊÐIÜ8Äj ‹ð¶„ ÕW‡™Þ.Ÿx~úÍ‹.„vñ¬´PQH ?… £]Òpz‡¸r“µÔÝQßHñ6»h¤ÿHæ+s–Ÿ>eðÓðÙ OkË’Þ»†©ZOº´i5¹rŒfy‡Û‘Å3!…‡y³µhZMÒ¤‘ÀƒTw¾ƒõDõ±,¥¬ô$m˜¦˜.¹!$€‡ÈNí|À¢:8[úD™ O”æ-Qc+E4Û„¼´Úß#Ù¡Kvï&±i†K-GŒÒYa ChBR6¡>ÄŠ`UJ$Ü›šªòMW[R …!Z¥c¨«ÚöÔ~áL Uˆ¹¹ýÔ”àè-­ô§Ü“Ú.º»!>%Û’{M-\9Øê¬tL.k#:æuC3ü¨SVåㆢÚÚ>êP”Ý%ÄNµ.™%ÅGbâú¯¬%¦\‡¦¢e¼62„Ÿ…–Çêþ5©$ð—k]¥º/‹}¶ññÜ•sDºR\yGŸ”„ƒ·ð¥L;7KúG%â™]F²Ëw8öWux:êx{­\¶ìüuš~º| En$&3BÈi°‘û9žf¹[—Iè @ P( @ õÆ"Dì{R##Ìv”µ6=å6¡emȰ6®½[b¹öë˜çÉ €A¸:ŠôáåVŠò¤w'Þæ;E@) Ž"ÓìîÒ<\ÇmKV-e¥u¡^VÝÓ¨·a¦ ¢=uÑqz‹Q`ÞE€UEµJ¸Øö¥\ÇãX²Îb Ý/è¶FS‰¨ûVÿ°ÇPSËæsT¡'ñ>ÊÖr:Æ †ÂÃñ±[ŒÀâÛcU™ÅŸÏ´Ó ÍRŠ­~€Ty ¥è<)@iÄöQ^Pâ‚ÜX'T¤ð¿: IóâÁާž]›N‰<Ôy+9ÂÉ”b~"ˆÈ–òÄ(Ï•†Få+e¯ÛÛʹýÛáÓç X¬Ë’uó‹È7 QÐÜq+s,Ü3ܒ⪲ÖÊnkÌÈi·|¿8•RÔ{E.¤£˜ÜkŒ­2£´êWµOR4*¿eªáΓôǨs¨içúV(±÷Sg‹i䳦…VÅë7yik²tßGà:u’Œlp—–6½-ý÷8{Ë<´¾Ñd÷W¶µÚk#uQJ 7Qu‡Môë!̼æã©Bí1ªÞ_/Hܵ óµªÍmð—io«½xÎLuQú}¯Òápû§R‡%/Ø“½¶ÇùG¼W}:§·-·¾›K=bvT”ázšPqÇ”$´„’²l{m“sð*Úð:ÚùìëÇ1tßõÙk‹©@ P( @ P( =aÓ?fµäá'ü"Íä²?³QøÓô“ǰ÷pôuož+ÏÛ×î# ×Wh<(’¡ÃãOôûh+¡ƒqÄ£ö~4ÿXVlkZ‡u¾~V1-!§Ñ€Ê¤:úȵ,·~}µÏm°é¬ËWÑýSÔY¬‚iÿw´¯.Z$-%ࢷ$% „ÛÆµ7féí=q´[rÍ»âj`[$Ûj|)æ?媯6AB°8éAáJ'é¾ ¶V *Ëï„ ¨ðÔ0;.nf%wûXò˜Žû§vù R‚–R “¨Ov¼ëLÜF§®dúrfXGP0¥fX Ö;m í»gÝP$ã\lÚW½n­sýòä¼ò–Ó‡ÂHa:m6NÍ+¶»8ØØ)Ð×F.žé\ïPÉ,bcù‰A³Ò–v0ß}v:ëî¦êî¥ÚBK]‡¤=)Áa<¹S€ÉåSâ:ŸÊm_Ý4n¾e]]–á\vìµ×]$N+ ”9¬æ# y ´¶áÃoE:éµÏ”Ž*Q¶‰H¹¤™-Êõ‡¯YËT>–mPbj’} 2þ©³t¶;ÕsÜ“]õêÇ—ÙøæädH”¹–ãò] ºûëSŽ®Újµ\ŸÛ]¯¶$ ßº­׃¬¨©:Ž'•2aÜ}"õ™©kÔr]*KP2.êI:%—Õó|«>÷=u<·ÓÜuÓUÚë‹¡@ P( @ PQIJÒR • )'PAäh9·TtéÃɱ®9õY¯îÔuòÉìùOáíõuï™ü¼½šcúi…ts=”ØIøãÛAêÖ¨5ù,ás©He^ciu!EµðÜ›ðü+k–¥±á¨° ¥A†mÅØ¨! ^Ú Ç‰µI0ß—‚T¢JÉçTWÛöPZ+'Dpù¹~ì¾îÚƒÙ$íRÀW1}h¬uMO*f 9Ï—[`‘¹$_²âÕÇDXCeÔÄt¦Ü4 xǰÖgòצÊ÷BÄ<Ó®/½ê‰S…’¢Utn×j”}Ú^J¸ó.(ÙGü>°®JE‹^VÏk-§¢ït×WuœÜæå¼Ô(¿y(ym-)Z[R\XW™oJµõ¿aévã1™¯8¯¦bD‹:#Deã´,Û-$! l›\]Whž¼õ"?O/ôè-¦^aI RO–ÂT<*rÚ¨žH†¤/Û«§ëŸN]¿?ۉ瓟˜&椽6Jo啬„6Ûi²?”kνS¯Yáæ»Ûí¤—ŽTd• ïhsæ=µ´ÃSl°ÂÖáÚ„Ü$ð¬ðÚò‚ÐSÀq©Ç¡fD`êJ’<\ÓÈû(5.G[NooK褞 †ƒ´zOë)ŽÂu+êTK„DÉ:w)’t ¾£©oåY÷~/©ç¿_¸é¦ÿ®ì n Šàê­@ P( AjTXòã¹BŒ:6­—™s æü4ß·Y.0à*ŒùÜ‘Å'–äóýµì×®^=ôù¬Ó%ªá·ÂxwÊ*âF¦ˆÖLxÖ"Ç:(V°Õ]ƒúM·"ê7îÀ’«$ ŸâM\&^iM¬¥Ñe€I¨e©Í98á wåH¹öžÊÆÑek™y'r¸vÕk/e*U …´#Ä«Bõp‰—OzK˜Î4—òjV&Â%|®XÚÞ±§sßh鮵ÎzàýDÆu;"Æ2vW°_bl6ÔYXq{v­Ã¢vÝHR´&ú‹6²Ï+­ÅwOH½4=!vNI¸ëê †ÏHd(–ãøJ#•elP*¸O:ç/—Ë¡Q ɽcŸê ܼÎK9’,ã\ŽS C(JW²á(m(ìÝkUÛ^Îtâ<ßårÀÆeÌX»¦þ¡kQr§möՙ;tJ‰÷ñp>.=4ß<_.{iŽci##+{澈퓳s¤%$žZÖðÄYšÛ„eI@¢Ö ¤ó¸åßYÛ^×f©°êÔáÓ’\}Æö¥¶÷-Wñ™Õ¸ÆÞg;s¨0Ë%µÞÖ<ý•a];ÒÿTeôûŒâ²ªTŒ ªJY7\B£`RO~düV:käÌF©XÑ+Aà´ß‘þ5ì›K=µ²ábªpuAD+j‚ÏÝ=½ÞÚ£!dº çÀs5κF'‰^÷„|£âhªè‘aòƒÉ4ؤ¼§N©d^ßQÐV£žÏ9dÉò[;|´…<àâ7{©ç,%ÃNôùó¹OG·¾°Ü2£“pq"ɶ€Ëþû%j2zs¥rùù biJZ IéÚÛwÔ_â$Û@¶Ôû’,™u¾–ô÷€)Þä‡ýñà.žß)†Çïï®[ok®ºH”V( ‹‹zÇ: ™;Ðä¼k–„Ù!Ä%›Ii<Ô‚›×¿~d¯· GLô³Ã—‚ı&e¶ü§£”&×>j· $¨tk^{³´öWÎ;¹3~P,¡~%(pÐqüMkïm™ø’=ô˜’ˆ’™u¥3©DJż®Àü;ïj劉±ž“"%³æ Y 6R{üU6× ëX«BV‚žÞÚ­5¹:~™QÖÒ½-¯* %€†Ö…Ÿ …­í¦GÕ==Éý…–êüdžÉyÂnK,žýÀÞ¼›N^|7u P( @ P(5}A‚c/ ÊU‘!»ª3ÜÒ®Ãô«˜þ›V´ßæ³¾ŸQÌÞaøï®4†ËR;\lñúAâ zç>K1p¥T, ±Žýh5Ù%   öV+¦¬2ªŠò¥PZRͨ1òEÌO‰'E£’“ÙZ•›˜§uÉO/T­Ýà÷‘ÃðKRb‰ °ÿ8=Óý,jVˆê¶*°VZfô~VF#ªá<§ŠcÌpF–€<*Kžü®oÈ^¹ÙÃzÜWq®NÅ@ P(8Gª] ó_2S+mœtØß~¿1Ô°êÚ£â6)p¤jwï;6ùÄôãzç×(tŒ•x˜fPëxþ–ùxGÅjºuå7Û ³i·–ó«[òÔ|r\Ôªü‡Ê=•é×Y}¶µ–Ö€V¢.V‹ßpiVVj)%*â ð®.Ë*zÔÀõ©ÇBFª'J`g½añëØjÝYúmú3Ô,ßFÍ ÈÃ<±÷pÔ|:ãG‚ðW>DrßLºk¾N4ëO4‡ZZ\iÄ…¶âRT• ‚Ђ+Ìîõ@ P( @ P(4UÓƒ)ώȰŸÊ<‰ãå¨ÿîžGñ®{ãχ>Í3ý¹ç‰%HZJ‚R´(X¥@Ø‚9^—•èrª5Ù] McfµkT¾U””º¢Ð S‰m +qjÚ†Ò ”¥)’j¥O:SÓlÓ®VIß°mÄþ\K¸£o œÖÈ·gÛW=»dðÜ굂¸2âÊTyM–d ÙHW?©=£°×Yü9\Æ£ª2ÍãZCpÐ2A(ŒÊÏ4‹©júR54šäúÄD:rT–ºË'=—qœgÜ%S Hò´ïG„ ¤¤$ªúsMç.›æòú¡*J’’• ¥CPA¯Ö­@ P(!¾¬ãzvoFÊ^ns8ÄDüøsß^ĶúRvÕoÕ;$ßA{Vúî+;ÌÇÉÓ'IÉ6Û{U&‹ºSn•vÝXW®ö~<óT‡¦g?:ÍÈsÎzÅ…>x¸¡iR­ñ«Þ·1Ïi†Ùg`Ó[eé*ž¢×”àÃK8ÿŒy#’¿ŽµÆùv×Á…Äç:‚z `1îää5c%MmKLƒ{yެ¥´“mUsRí'•Åô•d}5êî™Ç7–ÊFiQÜÑãÂê£^Öó¬<7$©7âx^éÙ­¸Œöi´å ê Œæq{á2^|†ÈÚUÌŠëlÞ¬X°dÇÇ%3WµE;ŸÜTI¬Û•Ö%Þ–uJºS¨Y%z gn RBZpî¨.É&ÖÚuäGÝ3º÷}‹Ëc2°Ñ7)©‘HK̨-$ƒb.9ŠòÙ‡¢V]@ P( @ ŠuL*Nì”KHpÊx¸-¹#çHý£¾ÕÛ«³ÕqíëÏ1B޽;/îYÙ­Ze(ÔmáJ¶¤Úƒ{Ó½œÏ8Ú>Ó­~õàl¡ýÒ4+öèžúÎÛÈÔÖ×SéÎÁàº#EÉjN×&;âuC° ɾ¸m½®ºé#{Yiƒ”Âã²m„Kh)H¿–ê|+EþUáµ®Öxgmeòƒå}Ääò±'HȾ"¥GJCƒzv¬o÷HPâ +¤ï³–?Õ<9ß\ôdŒ&Iq r+·T)$hâ9¤‘¦ôðPüxõi¼Þ/>úüßá¼ô›Ôgqrélã£ôõY¼LÇ ‹J½“j?þÌŸwÝákyûzýÇn¾ÏNÝ^wr@ PD=Bëôô¬V› sò’Ðâã0.–’–ʧXjBœHÓN4ãÚZùë) ®½AÏ´¬·™’ž’U̓1’¢5Û}'€+Y¿jw–Håeµ3›ÿó¶iŒ;cËnn\,}ÆÒËÈ’·*Ú5yÌ„ìlfßçø…¬›ß…†·W#\f¶\»}K0›tw£þ¨|äz€=‚Áºw¢ ²g¾ ×ÈG´n=ƒsìîž›ÓKŽ]ãÓØNŸÆ·ÃBj õK- ]DT¢n¥¨ÛU(’y×–Û|»É†zЇ¤-!hX)RT.:A ãþ¤zks5€fE¼ð©pÐBØe‚ƒ½hE·¥!`© ¹à‘§¯§ºÛŠóvõc˜ä=A #•XŒò[ˆWºI禣Ú+½qÏá”ÛŠºÞ!-¤Ÿ3ì,µeÄJ½7ë¶ú7-)r<ùXiþlxá¥ô‘±Ð•” íºM”/ßa\;zºûBôÿPbsø¶²x·Ãñ]ÒãE!cÞBÒuJ“ÌóY‡¢\¶5@ P( @ ƒõMê^R?!DªcIø Ô¸‘Ø~.Î=µèêßjNÅYMº›omÁî­óÃJÖ›Ýnc;ë6˜¯ú¯¥¥ã濞՟l\(­â;•ûŽœkÝ,Úf.J5äíëÇ/W^ùtúäèP(~¥éxA Q¤ºüe) kî"¹å;å¸RVÝì R­‰¸#«®ØK:¦p? í1Q’ ‹®{κ¡ñ8áñ,ëÏð©já´ Óõ'I`:Ž2XËEKÅ»ù/¤”<Ù˜tÖ Be¤9:j,[~QJ¼²9¶„¥)Iï±#¶¹ïݶÍëÕ"]\ ƒ•zé{a•é˜m´XIû¼\fÒ€âw—B»‚ú§â5Ðúz{½WÞ¯qÅÂÄŸ•k$ëËRPØ dÜyhl@<Åzn^l¯I‹³—‡‘åY±¹[KºŸ7ŠëltR÷ÆÊIm‰ñ”.…´o¹À8…6›¨(vk¥qìÖaÛ[Šúм®å@ P( AE$(¨]'B("Ò}9ÁÈrœ}1Š·**Tm{í ¶ðŸÆýõÓýµÏýS) ||dÅ„Â#ÇGºÛ`${tâO3\íˤ˜dP( AëN’ÔxÏ&éf{\)$_j¹¥V×bø+öò®}Ÿ7øc³O¨ùç1Œjˆ ‡’‚î¥ËeæÍÒ¤¨wêã^Û%™$Ì®íé§^µÕx‚¬Ì–ò, $x^oèrÇNFã¼øwÓìÓlİÑ@ P( @ P(ëÕNåfœFg „“HòåF6Aî£aæ#‡‹ˆÒú ïÓÛóÅðãÛמc„ef¥·ŒO”úUå¼Ë—JÒ»íØ¤Aˆ¯ey¦b¸ySús39ŠR2*Š›S‰Ü…¥I)Z;•é¨å\÷Ó3½6åô¿CõÞ«ñ†T"Y–Í“:†î2³ÛÃro Ƈ¸Üú]^½vÊIYR@ P( @ P( @ Pbå%».[-yïGeÇ[bÎêB ‚,Ëo»â"Þ֮ĨéAóç¨jöFH’æˆYV!‹g<Çš>àRÂÇH)â•pÓ]-ëé¶O7l–ÿ(gMugVÁêV'ôæ-Ù3ã‚·¢Fo"év>àmÄ ìV‚öÑVg–v_ûMÞ_»ô÷UçÂq—ÎÞ¦æñç².â£CŽìWßfS œ²þåm¸RœXŽÛ†×QKÊAù¼}}{m&+ͼ–ð†`z‹«XÎ3+¦aZöb‰©&îºZ¶oÚ@}–kÙ+ñ¸¥Yþ"(gà:}{‘küì\¯¹i”Nd\*禡Ãÿôý·ßóÅWû= ¾â]±O³´Þâ®G3žj–¿ÕÂåµUŽÑf÷§Þ{•é _¤†Þk±…g`I€WÖmq×Ú~ga!Ûtz%Ÿ…†DÕR6xZ¢á×l{ 8Œ~-•âI–¶u¡½ÇW~Ieß5Búul³í8ÒyƒL‡X‰ç¹˜ä”uq6Èzçy&U ¥Eöœ“Ù_–Yw%ÒPaaQ}Ø— ·Ñå5^$b™¥dk¹eǦƒSúå›bš×•­pG•ÍɧCî)Ê_wK"Š~øÑ A„œÕà×uBy^nJBØ\"ÎMŠ\])ÿ6WbŸQw™ úõæ5XPg^e ®&šZ±^›«Ͳ˜ufš¤§DzY¤låiºf¢Å;jŽÈtÍ…fëëj4ˆÚå~Å¢g_"Ðz˜æS8çqÚu§˜~Úʾû^3Ë 5$¦Þn{eß–^ªY(¢*Ù! ‰Ø»ˆ çè›lQ‰Zì‡ùw "øž+'zTE°X BÒ-žén¬Ýž5ú£Bpç–œî6¬¬TÕ0H¿­(·TÈ^Sh â·+Ì"fêqˆp™î‘ä‰ìÄúÁX$ULû–duhEÃY/&Ê`‡]Ö±“–…-v=c}±Ÿœ‚z§}ÍÿJ6b5„­—Á“^+°kÂG`+]\Þ°…Þ騚ŽÊaÛa[1Ÿß–ˆ#­Ò Ã ¦\ºJÚFªyØ¡í) ¥Ã0“œså÷™ˆ’*š}•:¸©Í¢}œ—ï(8‰kqŽ:¹¾âÖº«OøÙ–á®kÕ•+xçï…夿Õw7/ƒÅ/H-ëž®Û_¶ìkš›ˆ‚Çùò÷Ü-øšqø£KWj¥Jý¹Vc]Œ  ƒíõ®U;º†rèv½ßi+V‰ÙU+LVûé:”³Ñ’B,\¬ H¢ Sd8þ´Ìk]ò[õT˜­@ oBØ ©Ä›m½çMéœ àv¡¦‰UðÍ„ÿÎã±Ô”NY¦rY~lȽ%¤,J ¯°Gõ¼æ3\ÚÅz•·/¨ÇR ’U… ©Œ±‡×`¬’–+SáÈnZb`–ö¯í BMJˆT@EB: ëkýC õ–/ˆ?`2eÚW%ãÀo!\Á 7D2 ¢WžltÀ¥÷ÀImÃֳ>…"°¢mhœNÁ¶:Ô¹Ë+yÚ×Ô2 ÒÁ¥?ÄeÞVJI/òÑ4fý ‘ RIfCÞÜæv¯S@löØKlp<ÁtËò§(ë™ð›ýb‰\‰Ì‡-<\ˆ›ò8Å&@Ö¢’§ˆU™Ýtås¬cÌÎTÿLiJe‰ ;i#L$‰«jÅ#ç7g©)]KFŒàC £#èœm_ü'´Ú”LiÍIçtå*WcO¿ "ýªfV8#Pù m£‰g—°G'¯ýežú“QóÎÙЦÿáJ 92‡î‹EÊ”9H±r.²5 ˆJ7£ƒ!ñ[—CÇÆ©¤¾òoÄá ê®G{D¤AëZ¸c=†Žr4«Œ§^cÅÜ‘ïGÂ2ë@&朅0| óL>¹*¨š…ïS'‡²À ½Ff8‚˜XZ…w¥gþ >j²Z_`èœY†k¤©s,V[CØl‰rb V<ï9V¡lzjáƒÚ„–³ÿTÔ^Xe¦'+Ê+er4ÚÒV>c›å ìV{!Ħ*ðÑí‹KŽþ@²Ö+‰,¤TúZCˆ:Ѭ…éñf(¢-±±»ãÃb>ÃGº8š°¯âëçwÁ[­±¥«3ÖÍ%î¦t;ñvJK™(»r'Ñr‡|›ªçTöUÃ;’ ´Òo¥7ºÁ½²2c¯AukÂå^/Œ¬ç°ô¶¡W20}a˜ô*âYÊLÞú¸ÔÍSÏ„´Í¯êSãlx3£J„ˆ "µµÌa~ñØ{Žˆ@°¢0D6ΊY|àÕ}QXÓ\-\Öj@i•M“ÿW(ø1—>!¤7OV¤Ñ0ÿm/žã:݆K¯ðQ´§=ffuA5㵎~r޲ÂÌ´+%“9ŽÅÆ„iK²£6—9¬~´ó^¬Êc…X|H#ûÓ˜‚üZ‰JZ9¿ÂìtDÊU+ôê­rˆ®„&¿0Kì>M¸ÛÙdÆûÍÕ¨hÈ“4®kµX=ègAju?½”4æ|AJšR0‡Ú{æÇ-_”±–zkë+°Àe³Ù‘#¾E¢ìÜ‹<̯¿‡³yá’\²æjSÅ«F…ùµåzâÜš/`_-! Ó\*ê>ú”!p„¾€ì y!BóÛ«¸ÕÀ‘Fnâ\•™‰p2tx_øãfa<ÞO¤ÿ+×"ëH¯lÏ_þ&“d˜§^Oï›û‹ÚRWž³±ÊføÓ¨ ¥ùò¢Q\hÓ7ñܼå—éÅ_,*î_×Gì+½prsžƒ•êLuÅŽi‰À¾—¹;}°p\Dñ7®B:ÉPa”à<[²™u·4Ê’Tᦞ馂XéM­´Ó/6è†Öù6^§¬ñ˚ꋚe½¸©+€7Mò5Ï‹%pÎɰJøØŒÕHÆ|>þФ`C\]}Ïoe¶3ÓqØê•óll ç敃2˜ìK¹Â.¸–‹Ûhö›l“•ÛYOu}T1W¡¿ø•ˆAÐz˜r-x ä¯!ƒ]¿£ÿŸûEƒ½Ç¸¥#r›7!™l^¢+ÒBCßèöVn>þÝ^NÍnþ ‘²õvöË!””yGVAÕÖ-n²9ÞÒ¢äqG…^ßäj–p1%$Kјt´N¸kA–bð"ð5CÁÇ ‹± xq2wf_S0]æq$Sµ–/ôdcÚÁëƒG±RÕ%yvÅ:VQýW{ãôÎá3ƒÁ[ä<S+EBzãr“O8(i¹R×€Á„0]2G–£Fj¤^ P’•XÊ@<˜<hN5SÂòn—eNu¡,“Dƒ²cVáó1PaX`ÿ3a‰:ܤvQ³a.‚IIè{aˆ'64@—èh]¨LBD`Îe-tgƒ#I¢5‡4dˆI˜U€f'>rIãõ"ו%¹–hž¨33VI©åP ö;¬Clw!$"9$s’exñ"{87]âàáiâ”.Àà’Vgn·ÕC±·e¼&oðÒ…aÅt’ ›×5·§9¦#d-$Ï&xˆ0pFÆfF6qæ¤Swe0§¨e–’+s‘%·T!þH÷Lõsak15ã„ë£vžR3«¡‰_ÒOˆ]'BŸ¤Ñ]&ÔCbç†öF{ÛÔJŠ%HÆÃ5F³1¸t+ì)‘š§5Íÿ5hA¢^z‘x†2m„Tj§Z˜Q)u±,H–„ÉáÎÑ+ F;¥~!ó2)§CIO™b~1=nÍ3Šýaq…æq”mÈÓ\QQ'¤Ç8‘Õ##“¾X¸'¤„±Q@B(5ÈX‹£SiC9ÆEÕ¸D™YªggZrXï8rÇ$X‚5V$5˜€Úb?E„i DkˆM q Ë`6f“a4¡¨¥Ö(%—¦œa«—äV_!‡³F34x6cžD"Ëù×ð × Õj­3ÁRù1ôø„¶@IH<J-”X˜3Ÿ4Ã5g#ñ®ËÕÊ«õ§Ÿ–9gþr4ÝT‡F#þ$† z>¾b1\±®ºêñʰÜs©‚U7Sÿ iGÒZ–Sƒ•6+Vû±aðmÿf€!y$Ròƒý—O}q$à’Yøâ1½££ñH'3Ëð {­P\Š#"©©%Ï9nŠAH¶Yneg—«4ˆKfªá¿ Å ¯ã†ÂHM•X:é@;3b3°%b݈àÁ{Âïš ¹à®eê ôŸÜT˜ØZ3ëG,@Ëk8hœiab-”x0ÃÑÀ·~{,¥¯<ë&°s6Hc±RD½ÃkyyËZ¡b%¹Š×P ”û·z 3­à¬ÄÄÒ ÉyB.KC{5$–-†_GMz1¡€yªËÀ·¹° ®«ºzáž-0NƒÇu¢tE›[§ì+w2|QRƒÍûufÿË®ÇÛº`‹p"Rx~±+=¿›³µpÒ¥ ã^‰z~Ëk¾ãË·MÛþ"vþ¾ÛY®·õ+°ðÒ F\Ú [zÀ÷k«‹¼ÉÁ§Új»r.: w©‘R,ÙöT™ÉYVg §—·,œ<Œ¼e[¾lP›7Ü?vÂ;äáƒárXÂZ§HÇ@¬V[‹Y­¬+Ã/\ªÜ±sï*ÐDZ¤V¶bŽ er¨ÊF枉€\ÛÄ‘¿L+ÆÑ:Ó*‰óE’³–ãÕ[dKƒ¾ÍÒ×Á(|`‰‘ãù[Á4ŒÊ¢‰mS·@¤,²H¡ÿª3+Ô@I…N£$‰;Õâ‘.ücË·3,'‡VK1½Y.!¹H^y)aô4€ä3øV*7‹˜Ì¢1kÆ l6óª@…qgºr±’È7ò˜›&õµUëù%±s`ŠÅ•a7˳Ð+_à1!±ÉdKËÑn’%ziz˜¡Jx$7þžø„¯%”`£z>»¢LsªÖ¬¼l¾O§ƒ`¢(É+jáp[ŨØs½Ü~7V'\¤:“Û·¿ Ï „~(±¶¨*SÒ‚æWâõ,…â£YC”çáÁ:)ŸØL -ϳ¡°ËP Å0­#]ÃÒW}ƒÓ°U­:ÿ¹s5ISŠU]±3ÅÝ<bÑá;c;Ã…¯KKÁœŒË+a¿>¢RÜAµˆŠ^/––Ѹ mj*Á Kü *MÁ^­Ò›\ÆóÜSEwCP¶\-’©+Æ©¡1úyX¥áE¨´ÔG¼^ÎÑÐÕ!˰åQ½Â"ãeO}zµK½gY²Ї¯ ¯ð6ãë·AÍ¿†ƒ ušt._1Œ·}ög Z0X‚3Öèì´³€µõç}ýç¨ò3[˜Ö'$ƒ2ãÜÒ)¡°xMÔ¸ÍT}àRX°¯}bÕBüòuCQÔHíÕ¿ÐÐe­LÍÑ=Òjͬ¼=Q³¸%­)"­Ò,½Ü8ÙVXÞæ}ÞèÞê½ÞìÝÞîýÞðßòí;ntp-4.2.6p5/html/pic/flatheads.gif0000644000175000017500000003143511307651603015762 0ustar peterpeterGIF89aß´÷ÿÿÿÿ!!!)))111999BBBJJJRRRZZZccckkksss{{{„„„ŒŒŒ”””œœœ¥¥¥­­­µµµ½½½ÆÆÆÎÎÎÞÞÞçççïïï÷÷÷½µµ{ssskk½­­RJJ­œœŒ{{scc1))½””!!1BJZksŒµ)9BRck{„”­µÆÖç÷ÿÆ¥œµœ”J1)ŒZJB)!kZRcRJB1)sRBZJBRB91!Ö½­„kZ¥”„Œ{k„scB91B1!ZRJRJB”„sscR1)!ŒkJ„cB)!Æœk¥„Zœ{R½”c”sJ­œ„Œ{c„kJ{cBÖ­sÎ¥ksZ9J9!cR9­ŒZ½­”µ¥Œ”{RZJ1ç½{ŒsJRB)„kB„{kÆ¥kçÖµÞÎ­ÖÆ¥Î½œÆµ”½­ŒZRB91!kZ9cR1skZ1))!{kB¥œ„œ”{”ŒsskRRJ­­¥ÆÆ½ŒŒ„kkc991))!!!1199BBJJRRZZcckk{{„„ŒŒ””œœµµ½½ÖÖçç÷÷ÿÿck{„)19J!!!1BÆÎÆÞçÞ”œ”)9BJZksŒœ¥µÆÎÞç÷ÿk{sBRJ¥­­ckk9BB)11Bss!RR11!!RR))99BBRRcckk{{„„ŒŒ””¥¥­­½½ÎÎÞÞ÷÷ÿÿRZkkscckBBJ99B!!)!¥œ¥çÖçZRZŒ{ŒB9B­”­Æ¥ÆRBRsRkR1J{JkB)9µŒ”œs{ÀÀÀ!ùÿ,ß´@ÿÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jLø @€ 8pÉ“  ÀÒ£ËþbÊôGˆ””\ÎÜɳ§O™ DØH´¨Ñ£/ `0nÙ'’2Xˆ3_ùô‰#¢V¬TôY»ÖŠŸ; p€´®Ý»-L ?§UĶeÛ‡ûø!üJ¶‹ –ÂDfðj¶®g˜Q=ÓÓâ¹§K¹((’ÀË VhB ÇþYyëOëÙßg94óeO"K]óÖmÛ´kÖüp´¹úF # ”Ž …ŸD’Ô]ÿ`F fœD„ùø¹’àƒYÒsÙõ#,¼``:tæ¸ÙbA&ÅÖ˜ó߃Þ ŸuuA 0°S%Ùþh!€øÃ„“l!XdŠ Æ‡"2E"AôÀ Eä¨ãŽ>ÐàϰæÏ A aC7áSÎ9ç˜SN9äˆó6 4Afy4íÁ– (,áO"Þm!‰ M4a ¡Õ‰?UL’…VøsKLì³@fAàO;æà 31C/à°‚?àã 1è C <ð5ÄÄ‚E !ƒ ,Ä œšã0È„€FDà@ÿ #²à qDB‰LK¶˜àÅ„BcbAAßL&”€?Ç$cŒ?‘ô†ˆkÅáX`ÁUÐ$ØKTL2è&3Œ?84€ < | ÄÀ7þ7 }”óŸ9ÝxsÎ8„Óï ŸCMXjtvD @OŠx‡X=Óø³ØP,Æg50ÀR`øÖZ6ñÀ0pAP€B`ÃO‘ G{æÝ^š‘.ÀÄr?ôpƒ?4ÑÃ*$ÐîF„cÎ9 ‡Í°9á|CØb§ýt;×Õ³?·È–ph!«¸Rð!E¤ÿÅ”0GÞƒ 8Ö¶DoBøãƒ<í°\SóDƒþðıþäpõ ?UÑO‰“öÂéø#ðé§—šYà%¥ ’Š'ôÔÉ„qWðñGh=â%ÌV@ˆ?¥¤¢¼ò¢øC—B`CŽ<”ÆKºÉäòüVÁ´üF .ÑbË0ǃ öìcÿ‹?3„€7as?Ý M¬³®?¢ÓҞŠS”"D ZÌwa_Á þ0ÅòJ‘ ¨ 6E‰Þ-€Ñ _¬«í !ºŽ‘ à"á ѵ‹4$pë°þX\–àäè>ÌÑÿ|°9!ABÂP„¡>0Uµ# ì Sþ¨)0ἋXÀVÄXaáŠQ…¸0€’¸<`!óÇÆp‡7ØÁü²áÂÆ±­¶mFþ˜^hÀ@á ;¡¦†‰Ô ?ˆ$æ°Ø¹!ô€˜“ zPôà“9 2a»å™‚ˆ_Cø³ ö þÈ…1°wŒX®ïŒ"<.RÙ 8ÐÆ †bs yÈê0‰˜@rPÃñ†b&3j@ܱF»Hà)=ÀÖ’K|"—0(¶Õ‘DÀ  €€$@HE'êPÿÌ&¤³”Ë ¨@—GŠ¿0Äc¾À%2nq‹òá²}Á@7YeIhVš€F¿9‰.4*8@•&0Q-íÇ›ðÄ&F1Жºô¥0U**á 4¤q¼ð0€!ŒbøT;Ý)/üq®‡¦kZÏ3©R3€M°Â¡ˆ©ò.ñŠSHµ¥Ÿ¸DL À Àà@à‰&ÜA ÈÌCZÕ ˆ¡˜sHÀ ‰4¨!(D5ïº5¼\ª`/ò,LHõ¨X§%zUjÂ"ØÒLf À®kȬ1•©x<`%˜¬F(`Ó 9#‚R5LXÚØ>ƒ¢-C*ðÆ ÿ%$ øˆTY! HÀˆ),€Á dT$xXSŒÂD€meK]„X x@S(JÙùcyÀüˆ¿@è2Эz`ÓDAhV 2Ó¯bƒ5¯©7ôc@uŒ€· î!Hð€ ¼8'Lá [øÂΰ†Mz!,àYœûX"ª°@4!&Y˯ª“.¢ V°BÌàÒ„YŠÛ°Ž/BP@Xðü£õƒì€|þ0 2õÁ ‘ÑBÈ@ö”šxˆÇë  @ LwÇ`6 p…ɘ!*b ˜ ÿ‚Y"P"ïÀ¨WÄûn˜‘rOgÞX&Yˆƒž…+S71‰„ÖsãÈJ'°ýǨ!ÃtPb,’"NÜ“BKAKàƒàˆt0l(鞉bpÉàÜ û‡I…ˆI^ûA=(Rƒט =[( * j‚`àYÛ¸ßú°7¹­(Ó~è‚©TŽÿÍ^õ]àL"_"PB˜À™W Z"R€çµˆ2δ@ÄáwV †¼2ýÁVðRZ™.d¤±â@ (ìAÛ 7ú%là€>ˆ¤^€Åk˜®_昆5¾<:( ×2‹uL±@póðÐúÀóa ÝY‚36€• 0  ,êƒ$~B€<% `À*°…ø Ɇ?âH¦sžD˜°¢Å’–¸ˆ4Q(0 qp¬îGÆá‚ ŒÃÒÀ¤AkðOâðǪˆr X ‘‰$“þÚ;G» ŠÆ/I¢Ìqf ð·À…“ €@R6úÖ ÁvpȘààû9¨\ÿih@þçjQïA |Dµ H\‰ÞëõøpLƒþ Gñ‚ÀiDÉF ‹AŠcLW`W PÀL@V€\`5!&„à„€°Ïp¶b\gþ·WC¸` ½ÀÀñ À ÀÀþPßÇ~žÑ ” ¾0#¡ôƒå«“þ°tø·0c3òE@ Êà "ð2r£6æ`7†ãp UPÐÀ€/ q]Â0 r²0T@å ½° ¼  ¹À v¸rÉÀ » H€V€ ¸pKU ðÃ7“G3h“„‚ ÿ;VÓ“#D¯ ¤Yplz³’°{PP5 Wæ×ó £‚?è;hT´¸BÓ"` ¡¦Ç:Ü€GBxuô— PZÖáD’#WCE9"?Ó96PEpDRt5@ÄDBD§#D @ñ6±äP*Ä ¹P‹ì3-³ç`rM°ðVÉ´Vj ÃxÀ' +ÃB’ð ,QqEAu¦B<ÐÝçP¨<Ÿà<p^=fr@Щñ ©€ ¨` "9 þ° Ÿ  —À ÌõRÐEå¿€KÇð>½€Žé².þÿÀUqüÈ“%å`PeV÷xùhWt°¸TSØäÄ VS$É ž •¤0 UÕZË“ ð”q!Fbt ·ˆ6©Kð'nKe–_ –úÄ tP$ 1a@I vÅV) Ö¤X€ êÓsÇ@ ÂT½K3Xp©TÏ¢ U Z嘰’©ðXÉ–¦@UÍ#î’k Ð ª)†Ð¡1 rup` ütMH¹dÐb™ÖÁC¬…•þ0—w™ ¦@(`;ùFª¡ìÀ `/f(œ À[±ó¢S¦ 4ÿE™ÉÉE¸ˆÕQ€[qãô°2ÑaX_ä ð @3X`_w¥›j¥”~52b@làŸ‚à’èin4¦(ç“ÑI%ZñÝLAçŸ}ULÉ%… ` PŸªT¡^%`º¢4Z£6z£8š£*0:4Ç9~EóxÞ‘¨ÉÁ?zc—¡£v3þPbW&ðX¶°`z°]Ñf€‰P4V`(`e0“eǼä¤:æÐŽÒÑ @ŠÀ-à´2%#FJ&|° €QÚ D }°b"3Qÿú¨éœpJaªÉCve60³hTÑiÆ[@c{“p–|yç3á¨9©4ê à1— |°Å(àÕöi)ðp`g)@ÕÆ%Ð+ $Šç©ªNJg(°kêA€(@ »" Ç' `Ð Ø@êáY0¤lw4%¢¢ÆjäFr=aVðÀ3G#fb®°&¶oÿ Ô€6â°“pl`Áiõáw#V°‘(`-ÀøçPzð0®ñ¶"+ÐªÍÆÖ 0à+"7pÁ"‘ ‹áP8»“Y=‹É'f°Uàe4f5A·V€ Ø+0 36&ð,LñŠa+ð3àŸ492¿ºRà`Kà#p ` ÙÐ E˜ .”¶±[ ¶‚© x<+¹¢(Z“ Fà@UØ]@Z ©ÿ`”pŠ2,@t3PC0JIN„DC >À3Aï)º³¥V°7‘ñMÊÇWÿ€Zð{Þ!Š“VP»ß«w`Å ‘“¸#,ÀIE½3T¤9@t;P¼E09ÐHÚ(EBðÈâ¾Û[Þ2=¹ü8îA¨“€)PDs .P4Û/ÿ²{¼0ÿ#Ö?§£ ÇqBÿ¦¬±¤ÖPðÀã#4Ðfð ù^µ¤YS%'̸ÂqþðC Ùc T7~! ( xÞãØÃ*¶ˆ#&(>ø°‚(ác8.×ãö>vgÞñ èóøÄ+¨`/X>öüØãŒ8H.JÌÀû8øO{ЀŒ20€-ðÁ¶ÛÎ×$ D@kìkŸ¸ò&AØSÄ@ÿ±­ {x´À>bÉa],à8/wŒsÜð:3€Hà0¤`EF¤`~Œböl' ̯H„L ÀDØn À@f##-|˜›Dé”$€òPŒ y€ À8ØùC¶Ó"ø¡˜` |`Ânç? °\%…*°ñ޶‹Cãt?Q‘ ¹0€á-‘ RÀœ ³×B à‰‚äÃ@QZÔb À(Àa\d+ÿA¹ `/UÀ^)m—…*äóƒà ÀƒXÊ6Z¡Q8+]ùÌ‹¸Ã‹ d%ùIÿÀÁvP„6·„íÄÁˆ|PD )äq þ@×¹¯gÆó! ˜Ä1û@…I€²R%€E\’¡ì8Í=-ÐsR „?Š'ÏŽ\à@@êf·¼ n,É‚ÀØ:ED‚S@@Ñ€  ÜHYªÑdÙ è(´$¤ŠTä"`‹Ö?. #ðþ˜ä$á‹’Ll!%ÞÈâbµ )D¦P¹D€¡NíHBó@æ  VPÄ|WÖ-ˆ.` ^\Æ€kl#áÀ ¸‡n²3(àjÄ: •k¨œt$ç8‡60ÅÕŽD`ÿ [y·²nw~° ´`΢À²ZREÐ¥€#±ç°† €GÛ¢\¥kB › I,a Ö8‡b;œ²¹€Þ€H:æMB{@¡Là ’O¶PÞ¶ïiï$&%LP»-îÁ þ(‡oÑaŽ”l¸©€ÆÖäš”{ˆP†ÚñA&¸]çö€I\!ÖDD€O·¨4€xü1ŽÄ‚# š-åÿxyGC„þç¸]öû•÷ ণöP‡ „ €8E¹M ðG |»ço6ÿ°ˆD(q$Vgø±íRH‰ÌÑ’Ùsb}kŽk¤îŹ@P€G–î Íå½+T!Úôƒ* n$tÎ^Ng$)€ë“¡0sø# šµ]"ÄyâÜIþ=G6R5f¦±I¬š±?š@¾é]Gþ˜Ü8@€VÀVÚ3hs‹¢5¤Ž€¶Z"p“l( -D‚”ä“‚"!_X£åÇ7´a mCÖÂ4S0ð€àZ°qq ¤-³‡Â†Z…P D"º ˆñ}»’ëΞ2gÒ„-²,(B½í-„¸MBÄ1ý€‡£ÚÀÝ Çÿ²ëk_tpƒZÕVJ™{æ8DX² ­±•×Ù>ˆÖ{[6¥#µ: l`o”£|@ðA|!ØÛþ¸A eà|$6ŸÐS†;Ù=ñö¯¹„,P‚ { p$çIâÈÞ¶2 :#<@Þ¹  ¬#?Hy½‡°Ø€e¯wVÀö²A†tYÐL¦‘Äp‹RHD³g†S2j GæÃ) ÁOFóÁêMR Ö{0„µ×›>H9"ô€ÞpoŠ0ƒEÍîõž W€ºÛ"e9¼•!eêwq8¦ÎP…ŠvR7ÂäÿØ>ÐK±€bPöì ÞD˜Aó‡ „HÃópŸ?`°ö!ÄÀ/ˆ"Ïv ° qúU=Cö¤…óaKÐ%´èô4ƒnœßöð¢ Pèƒ$€qŒb†^àj 8¹²‚ `ð Øm@‡ò žðÈ+‚!˜çË@¶‚ m8Ž RŠ«±ˆ ›ÊŒŠ ¸›¼q¼™›"3€€8iA¸!œ¹‰€‹Éj©±XBèÁÇé‘(‰]ê»D}ò8ÓY.#mr c ˆ_`h‚ÑC9  †ICo`ÿÕBrAÊ‹; p‘ðß⇪ ` -¸‚%P„Xƒ­ìy°ÌÙ-Ð@t0)P¬óØù E¨¥µ*ïñƒ|ÚEð` „ ¸€¨3½ Ì(ó­l`nX1o°kè†5´/rðxj ùAz „+€‚%Ø8HóBx®ˆ®$c«hœ(™ €RL_ ß …ꤒ„wð‡.¸&<0Ø‚@\X¸ŽØ“Øp˜,J€€¥7\-l`ÞB¸6ô‡i‡]D8ÅêÅá«‹  ¡á0ÙY³Z"„ÿ£2¯S¦`º$3ˆ"Ûqº"Pø¹Ãaˆ'£ÄdŠ8X‚µ>¨À¿Ê€à¿Û‚Hð‡[@‚è…(A®#J†XÕ2‡p±Yd3‡hx„}ˆ¶HH…´¯tð[¸ 29€?„œIØ'.@ „.7QD‚ƒ+H)X¯Š:ÆGëƒ=h¨Òi‘@[(€ï‚ \øÂ]@>ˆ(¨¦KŠ+¨‚¹¼,‰a0ŠºÖp€m€ ˜p8j@‡n(äo°†ñºJ…®‡º BÁ"[€åi›b„‚=°‚˜åÈÚ!0ï9¨-ÿ IŽ 8Ìž¾+°€”¥>£üð‡c@†[ <ð‡ƒ¢$ˆ¢8HB˜„%5:òa a@* Y‡tX‡ò‡r‡o‡oðnH‡ýr8‡p€eën àÂCÕD8àjȼ€€Êd8Çì¡„k‡a§Br²ÛA䲯©±qŠƒFQ–ƒñˆ=yœÙØ%V;/ò }2‚d†\ À¸¸p¦»ˆ€á¡lІƒKPÅ:=l” cRûš6ˆÎ¥˜– ‰‘H#Oëƒ_ª‚È€ÀvÂ|ˆ„Nâÿ*P&À€) X‡u €I8(>0ÑI€ÈQ³–°ñˆ ð‡¸Òù£%°*ø¥DØ+èÉFÁÔÕˆÔ‘èh”Kà øG*ýTP•2_„'ãËGlœƒjT?Š.ØEhL3+DOPSQ²'ƵECNFáË&yå ¨"h¹F4Ó  A¼à rUûú« Uü²Ël XG„ôÓ#¢‚ŠÃ*ÄŬK¤øˆéÄ™ƒHýQÅ…\8€ P†eèµg8g ;µšû`ÙØÁ•†ôDE¦ €›E‡lÐÅ%ÅÛÏdP/©ÿ`0#¨KO#Ǽ”€  … "Èi"8T¾ðéí„L€‰ÖŒÙð‡HÛà™L^¸‡RŽTN¨ €…^¸F ØÈÙb(_Hˆ¥˜eS¬r°l [ÅʆÚÅÛÄÒ[Ù…’å KØ„W°‚ȼ+Ø%óñAyðÒ‘ Ðÿ¹MP¦¾` TÈ„­âˆ²x<æy Ȱ°lQ \J(`ðɑȅ^8Ï¢Æ3ÀZ´¯ph‡õÙªôßÄú õcy…Þ(€JX3k'm”O´²%ˆ„ ’•@Vx,ŽØ“9‚ˆ¡]`€¶­\Ž ð‡ÿ÷=`8O]èF¸xÇ\(•TL­«$‡kðm€C¸[ÿe­®@”=©T(&’„ƒ"£:ýá€u „G+1p‚•°ßåºù I`˜™š€›Z c(†_àf`z8€¤ÙÈ…[(e$ ƒ0€dá8aH¤BkÏ…5ÝbtÈÊM½l{…Ú …ðŸa³²*X‚e×u“eJ‘•8K€l­ÙÐJ:@Xá\Na¸^˜„5ƒà…Ÿ,ç8†[ ¿ˆH€NPÕ_iíÅ_ÄžðL8T¨@WDذ§uK5MøJ(wÅ . ÿ/PXãrî…\cHÏ÷…çÈ…~†ˆè_Õd±lfnh‘a€¸T…ç­²o«¥-âhèBΠØ}ó\ؘN^†aàwéd@aÀQ¥&]¸dì=4*͆ÄÛòJ’–ùéÀXRx(ðƒsK'ÌQh(°‚˜K øµA-˜a,æºÀ€È…Q~jÀþ xiˆ@l R=ŒVsÐ}NФg<Á:åó˜# T†Ý1ÿùƒñ”/™©}…¹ç ‚ YÓ«˜P0žöK¼ð0– lcøhÀ&†àúŠØãýLÿ}ØsÈÔÓ”½ »!P] @¹!ð˜ûâÆÁÛ–«Ôp¹ˆÔ—‰KXNàiÂ^Šé„c¥þrl_Ðf¥ €LÆ_j¸kˆoC n¨Ï‡-Ùf4‰ä.»Ø´ðé9´·å6Û”kÖ·7"8í€O˜v )á¥FŸìd0†QuŠÄ0˜A˜ƒëȹnXÊr0/r‡pèÝm˜†ix¶¬C” жµ9²³· Ø´+‚z¹×^€%ò"€ÔȶëðØ"]ŠcÉŒ† §a Ï… ‰ Ø–t „:ð–ò„ÿ.²#€gH)‰¤°IÈqGÐà­°Mn•‚‚mE!ø˜ûhE4T¾f%; °¹ ô3,‚Õ…ÂoÀ6` @+‡‹ÖòÀ¶a:þˆ€AX: Œ7¸˜ É5°y`ˆ(‹Bƒ<¸;ƒ/@«UѰŸnV&W]šÓÖeE” ‚B ´¥9¯T'×À˜E9A¿`•À ½˜ÌJ _Àåˆ_m×ðô¼^ŽØ‹FP xŽñÈŒ¡ƒ4€Vß9 4è‚4À 1Üïº.‚ï#‚A­Ÿþ 8îO°!ÈA+²9°ÿ‚ås{ãpÝ"øñL`“–0…W8€«M”l7Æ·ãô¼ò§6]èpÀ: ÐlÉ1@4Hƒ9h‚.@0@ƒ;,„9Žv¯ 7h$Èö‡¤Èct´½  î}ë„ÚøiHŽHÚ!k€u¨M¨„[P_TîQ3bª8…J°³ ]ˆcc À‘˜{ ÇíVŠ P€øùp‡x†ŠZˆOö ö6;€õw ÁŒCxˆ^‘½[³etº¶9(€J` ™î¨’pO€ h€ghP ‰SðBöI€ØòÆtÿ ˆ_ ýƋ鬀åˆ|èŽS· 5pâ˜y¼À€ Rô'ÏÓ”…X+N™¾³7-’½¢@ã„T0F„@`×6¹¦7™ž€ç–ÿB G1S È`'Lž0c5Ci@"ü«hñ"ÆŒ7f¤Ð Á $pPã’ä8Á¤Éß»vþÔE8`Ý‚gîÜIó·)U%9jÔŒñ‡)Tª¤J—2Mz*€ŽøÛ•ì*Ö¬X‘ùówL+ذXy!¸ õ,ÚöÖp7`@€¸þâHÀ 3³i÷òí{q?7CÑtõ‡â¦I-ÿyêdÍÉ”.Ÿ Ul9i&z9Zpë«Ø­·p….}õ× ~W³níÚ5…þÀ4Ù4Ê_§ËL=ùË4ªÔ¨J¢t_æäoÂÙ )…™¾šË²æa…ù{ðú:öìØ1¤|µ©R§SÄ™¢*EJüx˘üI@{Á@.é½ü“v×íú÷ó—Ú@Sz ¨”)s„¶ ƒ…ùb_VÀ ZZ¨ŸþŒ2 •˜Â¡R¨Tâ«YÐ `ÈA !Ô*èÒ2Å  /¹°Ù…=ú¸ü4`¥€¨T&þ$À× ÐU hÈ,Båq¥„ù“‹.]â ô°Cÿ€;qQð#šiî•’†–âÏp žò’?ð¸Q“þÆc¨A‡y¨±Æ•„ªQ B!q€j ÐÄt`áa¬1T!Q©¹)§VŠ)IbBŠn¤øãÉ‘¤\2¢$—@Ìh¡WJr y2@vÁ"·âzek _§Íþ?• ’*“ù£ ©L™€ž’I&—èy§F@Ì  ‘h4!À$…U‚Äy AIƒ"K¨ ‚PAjÎÜß V¶Ôœ]Y’m¬L+à)¬XbÊmþ€À$À%[Wqk€Hàˆ"( bÿ+À„^:Ç:ÀÀÁ9kGÕ+è)fÊ&¯dò¦?F™ +þ¸Cnv±Q 4Æ!ÇÆ03ìfÎ]·öné¡".(G'Å6ÀëÒÚDj„¯st²; 0íurøMK`À{[xAþdK\ÆÊ+þšrþ€Bh^À“pÀ]LÎwZLAXpë Dðr›f8$q¡øCƒÏ h'齟UÁèÍE¡š¤ íxDox´qšúþ|F Ä~Ö|î¬pŽ·­aGsOôáÿåÄoä€ÔÁíqJ¾?Žë¶ªGvââë¯ÿÜ `tAˆ—¡3QeÍ‚V:1 S0¤ð„%æ’‚Þé)þH›þÂw D XÀÅ£”qí`x€ T¬:ÈÁ b¨C´&6 ã0ƒÏÛà !À€÷8€$à F(P€39‹M]©ƒÜì@‰9ÄmPsð+BQŠS Âg§0Å/²¹(À6„Þcÿ@t €6‚¸OM0¢?±†:¤á CA²Ô@'Ø¡*`P ìP‡1¤áei „ÿ¾>À€?ð€ D¥%Êw¦ç# $¹À3üÄ\ýk(apCaà'5 @‚°Ä úŠ$.i‘ T ‘‘À’~´FXÀm€î/A  +…CJ€QæÂp€=·ì]jx‘ˆ³"XÀ p Mp€‚´EyÊf€Å"¡‚4$ëXÿJÈCÔ•´ê›|[Î0â]þÃ’ÿ¨€ èЃ]ÀU®ª`°®   É"å¥èÐul`)a¨AŸç_þÃíKÀ( €SˆóÇ2°ÌJ•ƒÒˆ&P¢+PÀ$SjC—þožø(À€  y Þa,°EM•*Ö±’µ¬f=+ZÏ;ntp-4.2.6p5/html/pic/alice13.gif0000644000175000017500000002637410017034535015252 0ustar peterpeterGIF89a’´Õÿÿÿ ™šýýˆwhwiXfXM¦”{A92™5.)VOC eiaûžžÖÖÖ¬¬¬þÖÖÆsogMD9ëìëll ÛÚ ”„kž0MM*%) :;”{k¸¸³¥‡Sc”” ÿÿ™œŒsœŒ{ÿÿ”„s㥌sçç÷÷¤•‡…ƒ¹·€ÂÂÂ:ooÿÿ9ÿÿÆkZ{µ{sÿÿkÿÿÿ!ù?,’´ÿ@ëc)ƒ%9 )#§´©DºX† ë2°V›s$}Ë]¯wÔŲ®n·W΢ÛÕõºa/ÇóÕ~r )+X^B"i^00+‡”‰‘+‘_+u“’ž“¤‡¡¤žœ¡_¬¢«­©®¬°{|..—¯º³º‡{“­Ãu »«§©£Ìy³¼Ä§Ë½¼ÔœÄÙ¡."áááX0°ë²j  4ÊÒ‰Ú°¢’y¢y’„⳩V ƒx"á9ƒ,"‡âC† x°±ÑŠsÒ$¢„ð… ) €²÷oN‚cTUŠ” 6·È hB@Lÿ'e˜ŒÙ€ëÑ[+Š&¤”ŒÓLzÞTàÁ X³jÈPÃâ.ˆ(0bCOG@«À‚¹—^^ísE ŒGð®U€¶€¾|÷æ]k¡°#û²-p€È"@DNð!Aä+SþÀ¹se¼R÷[1+V ¦µ:ðNÞ•f, `AŠ…ÈX†Mƒ•ˆ……¢7à “$(›0+ØLÂ; &m·NØ)L ³–psÉp@wnˆá5®j`£êÔl¤¸€ÙCJ* D‘÷ˆÉÌÕ‰ @ƒL2M¢E+41 5á´Á„#@& ”—NO `ÿŽZ`‰u€m:±Ä] p—€zXyå@%°Ú{3š#¢8(4š^`%p€“H‡Ênuøèb‹vX_F°ÇÜtÃßZ‡A@mU©ÀVX—e‰–—€ùUD[€–¥ÀgZb¥€V2ŠB›a}ðÅsó@Ÿ“Iq#]?r “€è@µi6\཈¼h—³ |a‘™8êÑ> Å…vsFé>ç¾ÐùCxš›_1‡ŸûIo:Ѐ«Lã·zý€y"à\pæŒÁkXè0ˆ<¸/ƒ5^{1CÀƒ÷ûÅFØó¢6±5Væ!/YÑ®ŠS!ð†q¾¸lÌÅÔ›/ôB@šÅ#ê°Ž‡©Ë÷ ˆ}ˆÒÃߣ²Ø¡ÿf^¸Ààox…vqa8eAÒ¯`,ŨJQ ¦$…\CJJY„C¡p%'(Â)K$'\äá€# ¸¬€ÅV/CÁ¾4޼ÊU³äâ°1*:ð .€Á’„!Ĩ©Œ©Œð2-´h+77f“Ôr$°Ð/]bŒh™„=p‡TPiÅp ÊÔ Wq•ÿÚ¤«ŠxÍðÊEÎKY^ W@…Ða9’PÌ Pª‡*Õ,´A8<‚I<=Ï<‰BZ¶ñ†ØŽhÓGìä?tœñˆ*€ À58ç]è{ÔS4 ¤%EjKÿRРDREÁ,ˆa ¢‡/@È™|@Bƒ8Y–‰%Båyú5° ^ýŠU½ÒÖ À#Е,?`ˆËÍómè†^X€®rIm)BÛ_…LÆUjBRðF1s{ÂZ„ I8Éþ$L0F€$Õƒ7ð_ÿfE¯ULp«‰" 擸y¸XXt=G±‡H¬cGzê%w’­ì@¥8ÈŠ‚&DIå ã&ÑQž'…SœQ±N€#ªrÙ] kõjS®²§8ì 0“m箸Ê=8pƒC2À© 5ŠyQ«ÀârC(2ª‘”Æ* =QB{íéÿm{, @¯€#â8\çŠ=*¬ Ð}Û7$¤™®óÓà\ä`â]Ãb§ P=8> f6(œT™/Œ¤¬¾þ‹¢;-p äe‡úhßÐ6?ÿÆ­t¼©+ ”;n1±ã¤+;"¸}àœ´³ ‡)ç²àBò\ÓRlvyú/ŠŸæ42ŸxÉʳá€hðfQÀFÇU1#/ê¹ËhÁïWûL݈I¼œD-¹ÿ̆ã,2“71ƒOîr—E†¢´PaÄ ;=Îã0GËè£ÕÅaæÒ¯)Bþ‘9´õ,Øbu``¦e LŠN¢¢à$*Y»¥3ý.h—.a¡Y.6ï½²ÇÊ«pEÀ¦±‚ºö © Ã-|j!Ãç“hÀo~?©þ–î“âÒy|fµÅ0ðUƒ.7Ÿ8âY‡|æÑ*`ÓøÑø>-Ð=@(µÌ…‚Ê@=PÏ:œðÿÉxÝëâLØ1óÈ 2]·8>€¶™Ïõ ˜Ï¡(£Ÿäìir vð<úû•‹ë¨žE@*JH°@~gê§yd@2 (BbP€<„ŒÏXˆóâ²!H€‰$hÀ—7Ôý~ú!œÍ¹+r/,”s'Z€ß"½a ,^Î!¶`ij@úuP“â¿[ýݤY¾ŒéÈP úéÈ @8ú¼®) ¶B@×È^-0Icn§ŸI¦^̶œ'€…(lìð?rü}×’é°}„­‹»§³ßù0Ü„\ÜN Ä=¦BµÛu[DP ôK¯!ÿ"€0`+@|Æ×âÕ_mSÜp¦Ðh³PTeaJ@Äh±5`xF÷52÷6†RfÑ8úQ)Q6†}œ4 Ð +P„F3룄FvA›Á‡¢‚>c0YrX÷tÔG‘C|‡¯wiè°nØu(#’"h‘ƒ…TäCœp®U:ýà 9‘j7qK JqtL²((1ÀÀÿQ@À1%PäàQp¢È%e1ƒ±¤\*T Âö XŠÏX3#i !#àŒq%„%JRÄM„Q%K"Ðwdÿáç‡Hð ðPŒ/À?„á/ð‡xˆ{G çÐD†\ö‰isä±Ò%lW%°;³3-kA. Äâ ñO:—FAÈI%±¸` š°ó³)ÐPŒpŒð…ñhà0‡hˆaZV;ËþR‰0‘à?zV ‡ò~·EÀuutŽáç@ ð “Ž¢$ ÁS¢$”wXÀ „5Œ‰ n 6òŒ€1ÐwaanÐ/à/I0YÙxtic0’в10s&Ków_çuœQuc©Š‘qÿ]Â=P8~bဴ§  (YŒà‚7@ÀP;ÿ†_UE°1P”vé” Ð^Yuµ‘ƒg•"Xba(¼3ˆ(=ÅeyÛEEÿC}çƒI N ðšD) zá“ÒãžÆÉ;íAœ P”á ”°¡¿ÉŸNYƒ+Du€~\““€t!4pQFjYÆ' ®ö8Í À‚P!ØY‘" =`#‡…›ñI”*Ú2»Y‘ê”ФIIŒ/à¥À¦PY –™ žH@rRv:ÕK)'‹a´%Àt’69*[çtaAž-z—¼ùPÊèsÒcÄø›Ä9‘ýø¤ ¢Mù1pˆÅ(£ì—jókty *´ŠS·%Àrs…á0°(GB~}™Ö‘‡0)°¡ •’Ú˜ pkÿ9óÑ-Š i¦p—Æ:´ zf0úq[óðv–)£µ3L-Õ(>2L+àkáÝ À³6³;É!:ù¤„ê¥"Ð`)àb“fZˆñyŒ æz— ¥¯i¦$UiÊr²;²d#(0>çP !2™6üÁdá$`…ép_p©a £Ci·Ö`7P¬àŒÇ™”JÙš™ ¯ÇêšÆéšÈ*©öÅÎê¯XçN‡Ò‰ {@,KG17#ñ@9ûAƒKÄP‘ñYœ-:¯¢TÌhŸ À;ÄÙšæ:¨ÆZ¦ùš*;²$EAcU{[3$ÿiµ3àAZ¢FK’P &´3L4•¦a©:yXx?~’›¼é²þè”)@Œcj¬†èŒÆZ«.»8Xç Óxb+­p÷Pˆ Å(~a"G*l÷–xs3vçO þˆ¬Àà‚¤ÅŸÜcˆ µÉŒîú¤p©†˜¸Pù‰:'¹´3³b;°M•q“P%0qW{^4L’p´êš¨ëA1`®Ðè¡S‹¬‡;¬ý©›+ÛŸ \û5['½ë»_3Luw1­èN¢q>Ô;Íà-R· IŒOGðǸ8«kž»ÉŸ:¸Åx¯õ •Л·´s›@*ÿèÛÀ´Ø%ÊuÌ;¡gE¸H©PKKj @И…@©ô”¹9‘IŒ¤kµ/²*›¸µ:¾f›i^p¾<J{QFxqI‡‚`õ1Û°é)Go$JG[¦´s©ÍèšaJ”‹Š¢Æé¥›¸"»› 3œ´, Ã;ü¬ÁUm!¶Æ‹¢w%a\ÄÀ×UY0yG²ÙšT¬†˜´:¬²ø¹Ÿ»¦ƒxjQ_ ƬŠèzgòèçC·C l×u-Íw@{+J й»8Éš¯ÐkœIy¯EYœ*<”õ*˜´SdˆÈè+;Syá¦â h1“!ÿ)ÅIg'=}«¯aq¯†»¡&K©xìŒô:ÃiŒ¨,Ìd <ÆËuçeY=FV@æÀÖ ÁéùËÒs/ü5¤›Êöº¡©¬“`Z”†Hº¯iÌ^ú¢¾Ö|aLÍ»‚‘hƒ !ÜðKzà!süs*dž3\ÃwIŒP™¢I ©NjœóÊOÚ¡6ȼ_¹Ô,3êFU‡6*H >ê!uh™ìh8𜪲Lj“9ÙÐñù5¿‰ÊO‰ ÍàÐ%Ï’ ÁvBDð E#§>;°Š×FDÎ÷££“j¬‡²ZlŒÂ ¯Çh¬‚4"`’šù¬ÏÿË ®˜[ç'u¥~Q|ër?)ÕçÑVKÃÙÐÇ<¯aÑÌñù›Ö Íag7KÖâP X”PèXŽC~(¢Rý:úÉx}®´©_ÃÂ1:ÊþÈ׋3L'‰œ0•c<­8-63;iA|bPÛPt]}èlÓ› •&ëÄ”˜€p›‚4-x!•2Ôè›lXl'`¡4Ðû•i¯%¬É´ƒÑX½ÙÝ *ښЬz/æBtµ®ð°ˆ#JPR„pû…6‘À€gàIΰ+/ÌšêLÃ(û·ÿhÃò-Jp XRu?“. Üÿ¾‹RN ³mºBpäJǃݿŒÏI¦»©Û4¼º¯+Ê_cÙpt ¢•¼.¹Ñ‰0 @ì’°Áàoc„"p‡:LÌÞmÕþÛ˜âÛ=n×ïôÖu( ¾Þ1c Uw’†hH<ãXpá àãüû—p‡ŸCŽ×–*ÊÅJœ;:½Tj×6{‚(OIñâ’k³,Ë(ÀÊ­˜6cã0†€`îA€l×»x\æó|![‘ÅŽlÌ‹“âb. ÚÔ€7 %- -¦4ÜŒZ¬“8饦+‹3“ÿ0MW 6¡“@ç’ \õ­„P;39òðƒãÓ`ˆq‡™Å®Àm²QÊÉÔNºö,Ú´“ÐÐìä«0¤ÞP~”2+òthal„Ÿ€P´pv"áÞÀÌÈêYë”dÅ¢ŒÂ­ÊMÚ»âí@°ûd¼žéå.°ìƒS‘®¢-Fx3N;ø0ÀÉY\æ©±ËØŒµûïp ¹ D¹¡^x5 I¡éÔì=«8+g5#ð@«0ÓaÈ^ä+øã´Q€m¯Cyô!¥ápœì<²ìÛé{?7ðPb¾+Îä8 “ä¾ðÀÐ 9ï$ÿ„(¯Eid°µ«Ùy­ô¼¨_šµþI¾Òó``cV?Tòôi2¿ð6+C´Ý쇚XÔ¡Ä’öÊÅW­ŸNJ”ZêÂd~—¿J–öSè_“/]¾ŽØt7pcï£-Aâ+WÙ¿­9íJIºÊ,B^ùPè)`ù¾¦4#ñä\O@'ŒÑÚ²t9^)哜¢9¥;”ùÉšPêŽNœ!@9µÏ¸‰úmnƒ¤óiŸ¯Ïlj'“ã³Ö0ÔJÒ;T 0-ðþ2@!@20îßöÿþ3 $$áçR,v¯WÇØLaÀtzkSÿ#ÃjÅbu½.Ôµø‘Ñ×1N¤P‰Ïa5*FŠ‘ÅBXF´ V>RBfZeB%gfdB@šbŒО¨Dή¶¼¸X ¶VRÐp(ÚÚ*dÉÌ bS(,ð,þ| 7¸ 4/–HeZ$$&+-¥I:<9˜.8ÉRDËÙšNÁÀX6\¯žplÉ*¬ä›>@.R D ¸ °ç—Ø  `‰!,¸‚„„"Ȱ(Aˆ„ L<ü#ƒPNèÐaBmD”•¬É—/©V­C&Á”{EDT¸Qïç•RzØ `À¡lQÿ)€Å&yDÍ¡4h¼ˆƒ —(Q¾(’Ü8 2`H@æÔÍ.[vªðÀž­{ßÎ-Ú„… æø!°"‰FŽe€Öb†ãÓC¬§pb½¡0ÁUµ àNyàKÔu0¼°ÁÚHŠSÈÃá-Á0A$‘…/,,b4¹¢r Ð&g–Ä%Ëo-—ˆŽð©C„4"ÞÂÅp®Hóur m„†ñ² ñ–üï&}€AgÏÌÊ)“@jÁ,³TRÂ,”.X¥—ºkë )R« › (è‹ÒJ `º-¾ZìCƒ- °€ œiD@ÿaŒ¦‘ÄÚÆ%Á Â>Ac(ñh*ØVP@„ `C4,Øk :€†¸‚,ÑP¸c Bˆ®/c”dÀFkp4ti¥ç R`I#I²ŽHrÎ[â’ÒDpH /+¯8à€ ¼ÀËJÂlT^ K,íºÓî%ÀAäÊ8}»B˜/\`CY ô(؇P&Wà“Ë(p’Ê8""Ç$‘¨,Ñ&­TÇJ?ñe€sâŒç ýlZ=eIà6rkb> ª\ÕˆV8Ã1W’•’ØkoЬÀ˜ð5‚ZŠ@Ý´Ú}é€U0"ÎÈÐò cÿFµ% @lÎA­Å瀈øÈˆH$ñ³”`ЬÌ•è%êDk í2¾-6`#<™0  îȘŸðMÁž ¶àïH¸ä‚R>€L¹WKB‹Ý ¶é@3ÐÀL^ÓJ3-±–¸ €@–Ä!5c›(d…UÚbO[Ê)ef' @aÆ3P¨ØÀn–L†ŠŽh†¨[Éç¥9^×Ò @A‹.>y7dS@¼ØZ–r¾&ãÈ se!:Rààñe> Ë > „M«»îIÑz)…B5`ƒ ¦„ €®NRë¢OüÇf@[™åº¢ä°œW8þ£ÿå]yÑ>!ïa/€“d,¼&•$•¤]”ú7×q¼aX’€oÀüóƒççÑv=YÞýu_º@ð2ü¦ UoÞÛ‹Ù*'QÛ/°€E8N°Š&¨€ò¡/}lÁÑBó¾”h‡M‘’Ÿ`.@¡Ú¥€c_:rb¸6@€…׾楆Hâ¸ZÛc@À@ó¡K!¨›((Áµá/21Âær:-]­pƒ^ñøIàÊEL|ÎŒ°@ó o"á̃tÈ.íÄ/(,‚ÔÊáäÆúYÿî!Eš«Ñ™Á—#+ Äð|41šºídq Ù¡¼ø#QáœÿÁ–EÄìý„T,—3 >†@$(‚hˆc{_€±øám==$?¤u(Ü¥U²(žeˆDB‰F©†ddµˆ(b²B`DR`ÓNy HB Ô´éϲßA¥),g ê!CñÐËXÁ‘¶èR˜*3™fȈ…ÊŒ&Wظî¥]¢[ÓŽ¶á¡AzT8Pv5Pà¡"€fÓmbS†S<â€WsÂH9$À#$«1 \f¢,´áX®(:•¤`‡íìÑzÊPŽ€À<71@T È x¡ç;bú jÐXv“ šlÔcp$ZV’"-0à—ÿH`‚“äHykZWòv˜%^ 7@Á P†Š«¥â&¬q©#µy¾"ÀR–ßS˜L°€D|•…þaÄN}!=rL b™€ÑÄ£›€¥M˜¤æ×P 9qU] ؘrS†møéM':²jd9/z#5.j’4‘Ž²ß°Ûºi†4Ly½ìÔÁVþU15_2 @>lÒT±74ÖÌ|õЬ']2)vé [×[I5…}âë±IUY—6¤À´ ¬À{,WW#µ–šBÁB&Ž£6JéúXδs nBƒn”,O¬@ÅþX±Ô+duŠ@ÀÿРÿD×öÒ ®€h5ZDOB¨lòÚ©"„-F³œ\§Xc,Èç:Ú!ú6PÛïÚ›‚Y-¢*’ŒÐ6®Œ†—‚§ñ¤\Œxh/7è`PaÙéD¾mî=R°Ý0q)ò$žsbj¬Í[™¹pãÅV€cA¡ì‘,¤Ƹ„ÇÈ|(Ö¾€Á64—µWø/Ö&  wB¦Utƹ_Êõ1ة۸€¦£Q.A 3$ ôã 0sšËa4ÈFžÁ™¿$/ ÙQÁKK”†i&x’-0/â$—¼`¨^¤{ÍDÛ¢Éh^ ,¦^ÿ:Ò1"ZX9K•)ž PÉ”e“¸@ ¸ pð–—ñ¦ÁMªå„—Æ4ÚFØo "‚ÝhÔŒm”‰óµ±–žóFlð6îÑ“$j È 0À‰àHâ÷æÛ„^2}]U\vÔN0U¤Û¹ @«mê€Å·K3fв+Ë‚$*O\à< §«xž®vè+ ïSA}Ý„HXáhfÎؘNp/bÎjÁíºØ¿*퀈 `è @aöñý‰œ°Za.™Ðwˆ`fwsÈXlƒÛ½ ¦ÑnΣ‡‡n1 Ë=bR›Ì«ÿHZˆV,¢·`¥ÄËfúp §w³o¤t£d` Ÿj„Ä\ŸÚ¼ATæ}ƒ¨›8L~Þ„C!Ç_èÅ_?¶t#œÌuiú⃃¨ë[~šøU¨ £Z¢¢4×öµ-v±Œ«GØùÍ ð%­¬h•ªHÒSTrwTéî–c>o¹ØÃ1oô·=‡«l~Žóuž}Æì?^7Ê(Ü3ªâsPO»¸o$¦ÏÒ :Ÿ‚(@ øZ9 mm å¼í#’–9õ-a <ãÀxBÐbfàì`•ˆ¤¤l"ÊHü–©Œ€ÁJEz @8hà6ÆÃpÿ¥ÈÊ"„¬ÿHìõ屎à0&çÀp¤`¸`ŠA ‚oîújô¡ŒŽãGLˆ  j¡Âã,ÂKæ „QJL:¨ÛpñT‚&Ø2Ê; æ`bþ Ÿˆ{æü¶€ `àjèO&Òk&2ˆ³ræ&aàÌÉ+œ,¢ yÛRl,¬MŽÀgfÆ@!X )V`1ˆ¡ÂX`.î`F`ð`• ~àxÃ'æc ܼ"βAoÊ,AΠ%/”Œb€í  [>`\€åŽUç¸TŽp/òä*`$ú† Pÿ€Ñ® "±)ÛŠ ] ¨-´/q pDåj6V‰4´JŠ À™äF÷ˆ€¨à›ÚÈ+\+wTñ¦t)Ò$h&åÉÖ¥GrMB°€¸q²N¼ ±GöG¤§ÞœNFpÀK’LÉ– 3Á嬞Ca|¥AÊ+ €äG é ?Rue_`ˆn"&aÀ¤_>€¤ ØOrÉ„ fä²¢q9N2Ø $=h¤ÇåP€È¢ò$õ%À½’¥ ö¢h€@$>¨` ( - d¢þ+õm-b-B²  ¿ÿ&Â0T¦2O¨²¸&Q_r_V`ÞÚðp –ñN`@$ízŠ¡Hà¿hÅð^HsÖû¼ðh˜™d1qöà\`^…pB®¸Î#&ס&€þ¬à,#É4'¬…#°+ðZ.([ÐõÑ;*%~0f ‘ çPG¸QKŒQ~&·Ò.\ÀY:98ÎM¡*$à‘_#¯íÄ$@#n˜8A<ÏLòf6@è`@*a€ 6^RvP&ŸlbhD`KŒî0 ¦l%‚adEÒf¥6{ó-=m| ->AWÌ:ä¯=?à=ËpD@*©{îÿSIF`ô“ ¤ @é´Æ`@âj\: 2%jm‡F³¶¨ |e· ±=ÁѸ‘ Ò„° îsè àèÜ „S.€ `6àæ|æR@|BSŽ$Ö$ͺT@d¥"B"4󊀂=Û³ ‘*ë3!UÓÐôæ5ñé n£ˆ (`@ir4€ ¡2`NL§pBâ@?"sBàô*Âÿ‚ÊÖª36á×lÀo6€*iÀÀPvŽ´ Ä0‹¡Iä¢P„ @Pµ# e4V¨á9žL¿dB"ÖÀ€NJùrТ“C\‘Zÿ5Ç‚ÂÝ&J•g <Ø$Θì­Æ…\¦Œh]ˆi·ÀÁ˜|íá(•i¸ï˜  î~°’/péÞð‰ Eä`Z%ð)`YRJe3F·X ©–Ç­ÚõB Á“ ä·¿²„ƒj•Çž´F (¢ ( ‘ÂôÀ a'F€Á¶ b–\ dÏ}Ì¢l]ÿ•‚ìRÎŽ%¤L‰ V£à®hà=Çà5K Ð0î S—NÝk69žÂÄaÞH ;X!DY36¤b6±dj?ÿKî”5è6¹ÅàÇ×6m [Ö¬¬~•À8[6=©Á’ØÀ´G<@ã w#š- gí õ=åÇ*U€ùj2Y 4R)h`YÂÒ¶u ˜B-@Ô]êÒ[y…ŶÐ)x ”†wå—¶ùB¸ (0¢-ýøáP'mà‘UAp¬ ÜÁeµ’T yÁFãúš€Á.l_@þÀ4Šõ].ksËhÜ68’V•J ñfYƒƒ¢Ê¤Nj #ž @p¢¥(†£KuˆXH¸„‰¡Ù…›1˜R¹áL“²2xsåAL–¹ ÇNØP8ŒÿÜm¯Þ+v¬5zö'CDÈP *Œk_r¢SAÀöÒ¬ÏÖì*hr„ÏÖ$XÆ@AÚP ¢òìÄ.ŠkJv1ÂWª4[I:OîúÚ_àÂÊ‘•’t]‚gÙ¥•§ø~É€)k`#Äï®Ïã_A›¯Þ+I`gez.ˆè_û¸ÝZîbǸݬ£-ŒLds ˆn螢ŸBYåez åÀÝú øÊ16¶Ò¥Š!ùj5÷sI¸å dGjMöžëY» €–Y y1¹)ã6 çí †£MA :[J{PkWAÁ÷9'¸`YPFv`w`c_t¹„1&×{5Eÿk䙪Ýí d¡‹\ñ \†®ø®-JóÀËæît)øà)b\ ñ@9Ûôëò@ ïâ 8õý A! œˆÔû<„‘½“üz"Ü h ´ %KšºR üµ]`)Ä.y î" Td ãEK´,qV©q¾§rÞ¶ÛPpl:×!Yìâ½XãNÊÞŒ¤Ü>ÂPY­iGócoÅ™.@3vr È¯Æ 3xœè’%€b4y¡ ó ºyqÍɻç3Ïñ< ÀÏHd‡V Õ¥CÉP0”âYñ!ž&?Bþ{•ˆÁòÂ;Ÿè9³;ܪÃiP*‡{<Å¢ÓäS9E Z<ÄèD=ô…Àw®%[x9II*D¼_"ó… ¹/W¾{¿Œ–ìÙ‡ÿ!@¤!……HeÃ$¢5BHmLJµS*Ú²ò¨jݧÜ”Œ2Á«Â»€Ñ 6Þ»€¹Úí2ûó§2î¬UªÊ÷éEK#BÜñÚ·0£-º*fs2JD2zÄ” «‡¬nZ¸3ˆÄçR„ÎböÒÆ3È Wµ ”Úë´ÕßNO¡^cTc¢Â°uugÄ=`û#ò}Ùóçc–MäMV_c‘oký„ ú—ˆ’p𣯠@ ÅhРR œ'¿ ]¥å$ü†NíA[¾­#¼ ÷'Ö-vJ Æ„fŒ&HQKYšõ¢KL4™eÜ];±Å“0ÊÅ‹\A !ÿ/ Àƒ ß ‰w4Q‘!Òj©‘‡ZUáˆgN6‚ÁÖ•x¯ æŸ#QD5Sm¨ÐòËK’E’M#)—ÏK1EÙ þ0¨‡ñÄSW &DE Ø!^S´GÈwáѱ4à¢DÐÎyDf_áA"Kµ3?âW&j¦Qí¼Ñ”„#½Õ(g攌eiMWL[•÷Ï9CýB¤ˆ×|×Dœ)6…G™¤ê& @°xí-`€ÖqŸ!¶Zë`=æá•[¤„Žn„@u“fXËVI W.€°ØfhýÌe¤DÞ‹•øb;dµj,ãÁÃðgÿ›Ay}Ü +‡±è$KMåš%½&õ‚m âµø0 V<‘UZ?ßNáam!(P› ¶@õŒR¢Ÿ0@@ÑÝ•9c·„ùzfÂéª £ij­ x3Ž®¡ìJï®ÕáT\€LHS«‚Ìrˆ€ÔiÁ[Ü9G¬++F™ƒ™æÍ1¯ay J•·?*&?s„€JŽü¦FGÇ œ G˜åضM¼Û6º%£Ëœµt#š'/ÌJ•³â*Q`­8_,{ÛêˆÀ ࢛@7NG§™ßªz'6 g%Þ€NNÍ…/¤Ô${ô»øì”8ÿ¢éÓ-+á`ºæ HÅæœ™¿Û*š‡ˆnèB]ùðŠÑá*íÖÌ,{FÔóÕãyUg î²yæM¯iº‹È‡I¹éŸS’Z h<¢"³ uGNëì4c}}öUÙ2·.ß1ÀUíBÓÖJ8¯míâ\ÞnÁ*;±‡<à±ÀÒˆ—ñﯠ å&Ô@ xG«Sç.óM/m»Þ<'ôX=©ŠìÖ€¨îRáÃDfÃ\ír•Pé±õ5“wwrÛ®ÖUtvP¢,Öú-8æá‰Ã†>qÓ)4Öƒ¢Há‡Ü0­®Êdn*—jö§½W˜J²üzb² Žà(M JiJA1ì „9‰k‰Fî®ó„@œRÓ.tÉvÂÿcmcxW6•Ì•ãåNËæö*Ä>LðÉk‹8ÉŠ£ŽŸ¦›³8‘!Q¦Làì,§øbfÍ6DVŒˆM…Ÿç¸OAV°rÛ@%úØ<õJñ»¨úÎJáÎ:¤P¼`TQ *É@õïÀØÀ(²"ÀawP@ LpVû0 Ñ L'`M­‰#"æBi¹›òˆwU$¬ŽbéE5ĉ@Þâ-–¬¼ìi“Œ(Ù¶mF©:;‚ÛXLôW!\ Cź–NmtCaf£‚-ÌVV|dž8.d1‘¨°k’ÕóZåM¸>Oªv^+Éã9Œr.UÀoþÿÎîÁMoV3*èÇl| $nš•ÔS6¢‘““-±s1"°<½æµ‘ãk˜øh+ƨNʃÏ#0‚oU½D-£œà>îïÞ;ç¹Vµ-@¨®¸Ö r#f¡¯tjB² Å8üäµ'˜­)Æ_#·v=Rsó|Þ¶(ÔXÎN'†6 å'9)ÒMè=©ÜJŸ†Û¶=h<Ïà[L@ÝÙG:¾bÄ­ B*Yh&eíà´`«“U¤€¹i¹^¬ eÝ:!ÓZ™C{®Œ3Z@Fé R‘Ó¾“ºN*#å0„°¸_3c—æ©øq2‹Ý Ù­fÕè|7ÿÏõ'½µ¬"Ú•ªú =<'êÎH'Ê‹nåË_ÞÂÓlM¯=rúÖÉ0ž¼SÅâ‰>z#ÊÂqr÷‡”qS‚~.tÉaÊÜã ¨Hü©œïÏSg›æÄ;xmMvCz‚–À£`zm“'þX%+9óÎr”vÂ*Q÷*ºÙ)é@ÒÏÏþ§ ©cÜRNb„ã}d†öªK—¸Ó[_»ùôZn€ñClE$À‚•*;Lí‚»`AõzŠïU¸«@{ X9e‡¬MSe³Ó¾#Èw7éu^„-YLB*;ÎZý¨ëFš¶¢ ]¥ cáSup"”°snÂK|ÄD•ÀEC lt°ÿFÃwß".'~ ƒ^2§H*÷. È9*§ùggñÇgê npN dÐÐÑx@EÈ-p°30@.ЉŸè¡¸€ð.‚ ‚]Lv@w5q¬Th"mÒyßÄs¦³-âÓƒÿxFwR_gä~OvŠ'BšdVJ!dQ‡ÐxÓØC ÕxG2P °3ÐP.€Dæ­R.+Xc­ÂŠt@4  °“4Ð)¶Ø@•°1­RaÒp,´1°G[%wâr‚.âw:/èXÕÃ?L1`NqÐð%ÀY‘-  @×uðÿ Ð-€‰Gщ`‰ha ’G5—³v…å& “zI3 —@´1‹/s2ó¨fñ³^ð£Op²6 .!âf‘CÏW:Æ+Ž@h“pŒ²k'1dÙPÚØ_Iš ‰-pšÖeés°–Cpn9 1¤A™Ãy"2+¢2@T‚yé—Âé— °wó *¦9m2E“v'¦R~‘Ä4ÜQt>C~'}bb‘¥{ igi¥8¡&°%°ÒH‘&9’-pu@›Pߨ‰ ކèàÈ€6y ^Y5™‚$# 0œª—6 ˜ ÈY&¥& d@ÿ”&¬QEMQ2.‚.ª1.£9Àt”ÀF½Ñ ø2r®k® µ!% ¤ù¢í©Ý('PwàpcI€–tÐ €d¸)bçC"MI40Ú¤€60¸6‡åUã´Þ‘GÁ/vÂEa8@Ree_DœI=—iË@0 `]À€x„˜8`£´„’È÷î)&ª±zß>JÅðऎš“ 0  Ї!òY‹ŒT…×9"$(';7@´&«¥ 3‡gtü’¦z8†{a n*-p `§.Žw@›ÿŸp'§„`’€ »³bš³˜@€ù¨Nê¬ ºÄÈãVPCc{tr$èGL•¬c†7‚€ª·ff¤n¿GD{°g»²IØ0Ê0«_)'`]@„»Q0§.à« -ýªˆt@“!ÑȺoÈ¥­ `£kç©cÇ&l‡³í2¹™"Bu{ª@±0ie"): ü™¬Ú:¥¡% ¥÷„ü0  §I'@ÀÐoIPúP;Drt£P ë¤+ +ÀNªÝç‘&²¬qW'F±mrs€‰Å_¤¡ÿ߆‡“€¢Ó°²J„’c,"0‘Ò(–0–vJ„v`‰õÙpu[´–X%`ûz )ЗM­’*µ¯æ€¡Ý‡9É#†5Ö^ð€wc7t rïQ‚éT'³ôQh„¶U‘±6ÃfQ#@«Ð(–Ô˜š@èžP’‰“H×5§ j+Šs [‚ʴ먪˜¯ŒÐ6¹5Nu4$+ÙKm¥s–bØW‚T9Éú ##u¶Ùq­|Ë _I‘@·1`’ ‰v „xsÐ~[·s0¸Æ`¢uêó£’z¼:È© E’«&˜f?ÝR'ÿ¡†pKC+9j +¨2¼ß#"sXP”S25Fʘcýòª†v Pq 0–a„=«ÄZ¾[8àוŸt:Žt` ã*ÀTKÀ{uÖ%±ÖŒ:E¤4jRp¾S'aâ.>p"/ì²s”óÄ¢’w³„4貄¡º­ Æ6ã/û¯°Û³ `§.*–v€÷ Ž„‰ƒ[›/KÄIDp#Ð!@Bì¤J‘fce‘w¹¼ã"âõ.}Õ&oU> V©±1÷"3I»“z±àHúbÂûâUv° ‘ËÂ}:§–q*ÃzJ-¤´¹´!~Àÿ+`l ÎJÄ.À„Œ€i)r½Rì±×ê½7÷E[v@Ñwl|$"íÔ8Ó¼?tI3#ì_…!ü`, ðŒI²©§AˆŸ@Ú’{–by–kˆÖ…:@Êá`P:€( `<#€“½ì—мÖH¼œ“6° Ý¹Ó be”>'’@á‘}²â=;àµvV4‡pãÝ®¶ ž†ÑtòÀ³*2@‰Ûº:`‘;ã$`’.ð ûLPÔ`à`A-`£À¸ÍÐR› “z¹¤Vͤ3@WMpZ`™ÿãdcFT#B>…z.aXBy#¾sHG4oCg3Ø5Û «4ˆ „¨ p$0Ø$ЈŸ$ –¯Œ6šÊ§iÃèMíJýEí3UÔH}Ô7TÏ:Õ:©«ìšÇÚùza(+%ƒãÁB³5"r"­wKµä3‚¯è cšxþ±²dRë©iˆ{*Ÿ§ ǹÊvp]4¬š¹Ú@]Ô—½ÏFÍ@ÝEÍJm:0E°Ð¢-œ4p©´ ÕOúzª"b:.}g±¨g:o“™KÊ”÷!+ãaÒÍuqå°oÄR1c1 ´© »6 Ó  ÿ¼ëž! „¸Ú³´iNÝšíE½Ï Ý—mL==0Þ:©ŠÀ€ÚÈY§'cwSoiR9ì7® øQäã.áT•c:íð.s+ܹ6©ði ÜU©g®ëà·{» ‘¾«£ PwÌ£<}5ͯ.ÔnÔ–Ù °åNÝõ\Áy¼4P“šÙ/Ðæ  Þz¹ŠtS'ãrâ5æE-¹B<˜°ÀÀâ‰=~2kw<–ƒ øStÿØ«^ø# '&£#'«²oÂKà)[+¤牟zéð–´)£;ƒˆ°¸š§œ#èq¥vÐDw@®’íÔÿÒ\6¿žÑd./cè–º¶+KÆË8«Ø·+›õg)‰'°àÖ5ñ’(£Ö%¨¦`öN­ÏÜ­Ô×}ö/ ^ê ‚€L)ž“<µÚ¼™ý¨6pâjb*„qÖîp€®ûz5£‚a: `èLŸ‘Ÿ"D`“`؊؈àšž‰@(ú' ÀCœ|p°ÙÝÍ—ýßöœÍ²?RBÃ.Efc1³À’IáÇÎJÁ´^—ÿ4P”ûà /ÃhœÑè‹#fc ˜ñØÓ°èJÿþÿF cV:6&'NN]Ab@4 @:2(h®0:Ð8 ±ñ€–WïãÂG\P†¾Qò8%¡ sTï d \‹f(&JÌ¢e5årE%¶TR‘°¹#^k5G'ÿ ÐÁ @ ~Å` 2€qÁ÷꯴`óшð]%Ø^ˆ 'r¸Ét§P¿ 9#*ÓêW+mf°’VX!’Ø"•Ùbrv¢ý|ôºü 0«9ÌZN-®€ÑWf@x •‚b¶¿øòBUæ„­G™ׯo°],§:ÀÙì?‰‚Èb@Iƒºx™‚hhy àXO‚B+âˆviƒÎ€W'²¿Xid+¶Z^3Z­“ ƒ¯€Åü`Ò „ 2À€ ¢Kid\¹ze£- Y¹wI2¢1â±³ÍF'mµàÅF(ƒ0¨€ªÞ– Oÿ `@â)pšËoÏw'ÊuÞöÃÔOZ—ü ¬¨!‚‰Û…òƒ#5fÓC±Õž|mÞÔ¿ÈúQ1g§Ý»¤æ Ä…d¦0@€t°„ø½4'~J.æä Y˜A?ø*ÌÏ.”`'³‚ b”Áé /1ÈҞĚi=gVÖ@Nó…<'V\xLÎá-ýíPd’+ˬÖP“Ø”ÅG³)"¤ô#§8å'î‰Ùf°›#¸è#Ípbà.Ð1`fÀ,Ü5±V eyÁl,5¸3vÁDÉáh6ˆ©{³*jóIE+r4zÅ h!!, ˆÿAÞø‚޼Ç™Ålf… ½ÊqNr $¹pƲԤRÂYsȇp•-Ž£J`ù W@2g…y röXÖéÎY ,b`Hà!ˆÀšwÍ ‡s¾‘Y±²T¬ ³«æhño,åwt˜¤BÈC‡3|E`Ö@#ìýP9"”d!??M–ÉeÒ•Oì&PK’èó‡˜.W­0„5ðD[¤â§hΩùk^3dÙÌaQ¬ Yj6бåòè.X÷‘Ó¬^xŒà ,{ „B´]„Ì(@2A‹>; M¢UHz:ÚUBÿÊP³Uà0 ŠúMý½{@ï"ÃB=Ê B*æjîõ(uÞ*†ŠH)Å) ÁÂHèLÒFmjÅZC)‰x5<……ŽVCˆ… 53¬És WPN^3&(DM† ¥5°®q“â*&W 3@R 0`…€ f [ñ d²÷ã‚»Ú¥èh’5® tÀY˜{}|]ôjñMÕÚU‚ÐÉçÙž3öÖ"hˆ …žã£ÇñG‹i€Î @"E¬ -CSô²F¶ëVe‹-нNJÌ{Íú!ýègC‡êïjE#¡i K¹–JQŠ•¿ÈZÿ¢2à‹>³m!úK‹=ÿiErCŠÌ ø†¡˜߆J(c †Ãl ) +‚‰5éÊ‹þʈÞÝÃz¿%›@ÆF"°I¥ö3KØ„´¾Íº†ItŠšñ°3üï"Zà[Ñi G³Fò––¦aØs8ÿüSÅ`a'¶ˆ—5Î@ßJ[B¸6}¡lœµOgÒ‡O ì1ötDP ‚¾VžI¬XcâÈ “ÌlmG Œ ›úÓqîZÓ¡ ”„2)Ì«\±†²TÄÍIE€úh  ŽjÛ2£`|³Â~xJBœ±U!i?7S)®56¨jq|¢Õ±¿Ú%Ä£´7GÿöÀù-`Åsñ2ª¹%,$¢8Kí¹¾çeá ך<цšµ…hêÆéÛ}rC#`éœOÍXÍ‚&tn›@/ÌsBJ¯ޱ&ßÁd 3ˆÑΈÀ¾E›{ lA.]ÂÖÓ50¶*bh&]}½Lú˜â…:mMMø àö:ÔVÅÜ“ú»œÅ›˜U5\4‡f€à@Áß:•’[EÐÀ 4ÐÎ܃&Ã2ió.‹¸†ªî^Ǽ7üª5ðô^Ø‹ xyH¨ à”ÉzœêœÄÓ©R´†¥~×™jsë9u}N³ÚÀôwpÛµ#jHÌldÏFÿ=.G@ j Ä]îu¯ÍI€L ÁfHp€ XÀƒS}{ûTKK«RÊUMŽ.b¶‚ 7 D¿ †0CHÀ2C•ëK´›†5~4Žƒ+µm­f¯j[­¾xÚN -Aíkƒ`"y@Ë  ¢ Qô “êè¯î¨˜g¢áß®±öDB‹qðÖ¡û€y„po#9R6`yüátÇ‹åŒR°ÖXL®¯€æk0ýŠEֆȼ Ç¢Åã R¹ëXE¸î£a(•*„ |M†˜$@´ë©%3|£ à!q yh/* €p`=üÏ7@ y¨<ÌAà2À7(¡Ü¢+l/k pï `‘+þÿæ5€—"1 š†ÐÐW['ZÃ'i 5ˆmu¢Ä5`‚hàªhñÞ®2Å«Ô@Ä£Lö\­XfE ïåM’Ð!]Àÿ $0*³Pb öŽq¶Àˆ„tô§âß$* .9R ât÷ æZ , ` à;A$ªp¬Ž`x©ïgúf!(_ÊIÏ”mzfÒ®Ô0°¤…ÇnÊ(ßQrNãÀhòÍŒòYÌQZäŒ2 à¢B+"üO–°.'@Z`(Od À$‡Of.8ƒSðHR$@À<òr.›ñM pŠ%åx­Uøÿk|ën kZquåéRgêH°†¦ÇYd Œ–©ÒîMÖþP…Äs®â-ò ;3’üCj‘ðhO] ‘ö–ê’Zx³)°âöºâ SN~Smïö .kO’3ö!LssBP=˜›:àZ€N༠®Xá MýjÌ]z†EgQäŒþ)4ÿàn›ö_¡ó ß®i7!õ*’óGwR6;å†ÐTÝõˆ3ï”ð8^kuMOkõBµ –r]<ò/R÷4%’@ žªÓZe–=£,~ß1NaŒhÔ «¢Ì NZxQ‹fk­zq&kgð8ô’ï ±Z y4áöö4@@!¸4ÖcÿN{íµöp3 /0-@Þ÷ú\1”Özw—G=h6nõ–ç0 ’*Î}I†~d½OÑö/Xcƒ¢OHÌÄ€j“\° xÇÖÎ3ËO“fJ¼•R–—$`÷6 ʲ7V5 ®A”Z4``á•T17@iÊ’o!_G5|ãoÏmµ4„TU“*4 Ú5‚/¡:`v v€òpÆñq,-Ì,³îp9$è39¹âP/ÙÖ^^(®è‹ád‹aé¥Xò˶â[qàªÐÿRXAkoyDB=&ÀªH“Ð5Bgxpe’ÿpíuô˜ù¶€öFU^3á!Ó•5=Kà@˜ ¼yÈ&V{Ô0P ¬&öôŒH(ûÚ,°ãúlŽŒ¸…Prö1â>±ÖJøU$‰t d3ؘR¢9'€MA§‘Ëín7šCøy›Ù¡9’–%  w@ßD†‚_K68‘ø6à¦"ø ¼9"OÀ®AxÊÑøez5"“°ykW¶«O 'h¦©çÃ"Xwu'ËÖöHE"{Sé7ÕT…epZ€ø:ࣹƒ–s¬W†7„BÝ5+ @@ðþa9 ¢àöޱ°—)Á<’¿C…q“ ¾YWëja‚œ+¬{ê|ºÑà…Q€±€­'ÝZÿ£~½vJœ©ñŒ;–“úV¡`=\;9ý!Å ±@¾@$òRÔx…1w´ÿáf SmÓTµQ²q6¼-»âjà÷ò•¼Rà‘ ŽÒîhPbè%·Tƒ~ݬv“äì së‚„lJ$hÑÜamIà™I€ÀßdJ¼ 6+Dm¶¨þF!Xý¶fq ôïȸÔtJ—g+àÛ.¡+Œ0hµ59‘¹Â,^»Bµ{{g> ‡Ï- \5VÇ®µ¼»q¦0,†Ö¹ Þ,°4¡Œ·âM ÅÁ3‚ÉðMh™£`sAðíÎÿX·:šO3: ø”*R=¹Øò-w*ô ×8ÙXðšs‘]n#q@¾a™™Ó/°ŒLO˜Æbh´Ü¹dÃìY7I¶³;^ + `yÚ|¼õÓøj˜ šS - ±ÍÃ"¥+Î5[nïDµãxw¯’©S•+"˜ïšp—Ü!çR޳0ù˜G…ãÕH‡ö68Ëò½²‡Àêê‡FHôðD¸ùEGMqí·²6¾ EP‚äi¥R†¯u€@¥Z˜e å˜¹žp¼²ŸÉ`ðúy/A£åeA¶‘ýîr3á†á»¬¿õ_ù5/Ë;ƒÿ*&Xyh‡¶.KXy&{ÄýŒ…Ù!•Ь½¿—!{› ïãÓ OæwuŠèôZY´Ê–(*“ŠîÞMh@< aѸ¢Ë͹µp@ÍQ„ÙÔ_§È)~Ýà0*`3ï†Ñ¾fI å’ÇBSÎdÙ˜ £¾éÅ<Ú8ÓTäo»-IÀA øDÕ÷¬âïΛ9½ hÄ&-Øåu‡õ“ÉyÝÀÉ2¬Gù¯ã*Müí.ò½édˆí05¡¿Í´)HV ¤€oQXBFLbH:„ÂUh‘$­CkZE :.§‹á,œba‚:!c-$È zwìUÁ ‰D=Ö³ r%W:b+--“l± øa*£¦MÕ:²ý‹T$-t£åÍÞ1DUCÁLDк¥ÿg€\ôG1ׯ¥ ÔFzÚšßB?àÐA\ hÆóB×knG\ÕßÞWm8Ç}GMjþÚ‰¢è% IxCB0à$RÒS¸b%¬À õÒÖ‹âù"US9.˜Ç†÷T*Ï‘‡wÂ!¿-ÈzyAÜsN0+iµaLò™: Ž YágœC@  bÙð|S(€cœ×É€;B¸Ò@¨¤%ÞJRûˆ¢^’Šq¨+ÉDOpÇ5!̲¨`¨± ú‚+Ø`tx÷±áÚQ 2Ò"ˆéÀX×àb ¦-$¦2à9K â„#ð#pÔ!Cåèp¹Ìî0÷‰ßÆ@ÿ‚$à l’vœ(ˆOLBxÀÑ@a±Qޏâ(Ž2“,A)#§Ž¡ àhôÅ BÀ€8I)¼{b œÔ=‰Òq@ÇUÄ‚žÁeRW{A Ò@ÃZ 1›€r™8С…Í \ch ùS˜TA,.ÈÖó0•DÄ+ (…ˆR9‰€™è8Ź”n °EPà²8ÊC[ h°K ÌÀc¶ŒÅ ¬‘Q PªŒwvåÇ#Ìã0r Ï“€E+V¹€MB|Ï&`ˆÀ (NXYgd ü m$à!"¶°éáÐäH)À™l-•8IÔí¶(Ô”0laÈhù‡]ÿ¦Š*ðETAC´ƒÍµ>A Á\¶Õ›6¡Eœ@8;ÂH±¼€u‰g¡N1 ¤ØÓ%bì]aáÏF¢‚D¡JI†T6ìrkD†¤h¡…V+/œN2˲˘a/¦ “õìˆ8²gsèéÖtL/lΤ-€Æú±˜¾ÎAÛË{°:2¼/“Êà¡ µµD%(E¡«r£ËæBSûôç'8Ðc@•KEÑ-&À—bÀn"ä(訖îyÃW6;‚BÏ@ÇpT.c}8'D‡(„T°bŸ£_K¼îQ×›«Î«@‰Ÿ2ƒ¥ŠñáïÖÝ1†ëÜ£…?†Þ{6JkRC^$€€ÞÝñ? Êu‡Ì¹¼2$%BV™cõ%ØÖç!¾:Vºæâ[üÂ0K¡ˆœziYÛÑhƒ“ã¬`øóˆ@Žé,QE,R!I›ÄCzõø%œZEZ6TžcP稃:3ˆÔØEH%„Þ¨ PG$ Ê"@ÜÖ)L—Õ“=eÛÿ=Ì%|—ß`€Û™Ê.1Ç È]ÅCÂ…C1$’€XSÊÐÊðÙŒÀ[™i!aƒ…ìÙ?0˜šX±u_¿É‰›\’x œ È ×3† “$Ü5ü_€€À[PA ð •E ب±‚LüÄQ¥^qè€Ü@LÀ^a@ €Aé 0DÛ1¨+tA{ÄWˆExŽEÄ‘2 áœýÊñN ¬žñÅl bAº¤Ã àØd(bFæ¬PÂa_ 0H^ä•!Ä@*±ü<;à>TÝêŒÀÜNeBÙ„Ž „`€,c`À ö43V@3v@HÀÿ5®@(ÀÔ^!âØ’q@1lÀûÀÚ3\A¼\äƒ%ʼýMÚ  i‡ @áu¡ m!öá„”‘à€äÁ=LF\dŽ Ib­@™Œð?VAºLç è@+¬ ¬NHÁ Ü èÀŠ\ÀêQ(BÍ@ŠcL ØIXŠB¹NýLóäÍW¤ŒV İã‹USÈ\O¬ÅÑÍÄE€Ô$ÜA:IÎQˆÐJŒÓa¤#Ib {l@pºÆ%ÅQ÷q†“¼Â$HÑ# ¬ÜÉä\Ò¥0ø’-EMÌÑž1ÈݘÀœõN!¨‰ÿ4cŒÑ ­1ÀŽ&‚ÀÍ`œ=²°ƒAp„p„ G0ƒ$ƒPÈ‹piºú¸ÏàTAè Ã(xÂê„LÖåmÞf &È„19ƒ;µAtåÕ`æC¨IYGE€–ÿq !†›‚æL&zðc^W0\Ѥ#²T%¯aÁfÔICPA!Q6…¥¬GÔ:‚ŸT…Z*(IO=ÌØ&nâ§r¬¼´q€ÆÄÖÝp¯¹Á1†»©ØÁO:‰Xì…\¼YˆðA¨gHQ’yA¤±ÃA&„ÐíVõå„=Á>ÌÞÐó=D ÀŠÿ2ÀfÄ2B%€À¬€Ã< !æg>Åñ€Ê¡´?ÖB­€ õ™‘WèÅÍA GÑ‘‰†QÊBà óµ[YF\ VÁ (›…XŽ¡ÃRD}`… ÐI÷]¥2€OÜ‚aU è¨âi!ºÝaÖÂI #&ÝOÝà;ð¥ðEÕ°ÜVÈ\†b[8Ñ!ôLpQ<‘¾µhý¨Ïgº \©å0ˆW„Æl•ƒ;È@lD¬8‚cÀ\æ©®€T@@ÉIÊÅ8 “JÁhµÁ`0ÒÁhMÔ}‰PA~Ò2¤ÏÈ@p=Þ¶H!Ì€IñeÁÿºìÙ`lC„KÏØÅ[ðÁ¦uQ ¸@/ØÀ Èêì€ h–AQ¬Í¬ê   €šaQ ‹²©Ëe !ßH( ΄†LÝ%¬bâ… K“CÑñAoÆ´ œ:øÃœ‡„€Ç^háãu*òÌF`‘¤à TPÀÔ+ÍgœQŒ@Ø«†Ç P@ò¨_'üçB¢ã8‰¡TðÔ‡ËÄÞsfD#:ûTÒÔd¬u´Ndø²Y±ùåÕúÀ ÊR{õB­Òk0 Y8:E­ A/à+ " ÐÀ PÞlÛä+Ë’cŸÊÒ5üÏ:ê&Ö[€Iÿ£N5©§ ®IMÃN¢¡IÚÑœÈZAGœ• |­ÖÔl°Á ÀËþ £ç:EÛ ÀÚúBéÁ¸€4&GÝBŒ@Ü Ë²Êõ¦)ƒø-œê]ìÉÜT†bÃ\|â4œ ÔÑÐÁ:hu8„[ü‡¶¤ƒy8ÃYiˢ݀çR ír0À¼« Œ@ F›Ä €}r¯½R@xîämtÈ’<¼’üeÕØ7„¥Éh•IÇ"€É˜èíCC<åš`Aø …¤AàG±ì…y1Yý°(ÄÛ¨§­$A>õºB&XV,ˆn÷Æ€Ž€  © à œUùŽ0<€£ º- ÌíK²ÝܺÄ TÀÂìjÿüLIH¥'}CZÔœ<"“T† ã\îßÐWÿ1Ø'‚Æg$QsEÎÒ-Q™èÜõ…S@J‡‘”+ D®kÒÀ€pÀm 3ì¢võ`@ìg4®½*c5j–4b@HÅ5fÀ}‰ˆø«Â™—E!°TËvl¢Z(”›iϺù  ·â }ùÁzÃ&‚F< K;$|"ÀÅL­ h€7샸Œ!`.ïlî/°¹ámSØÀ̬/^î"uÃç9Ág¹Mõƒ¾]„NÁ'ÚåÁF*u³”Ð><!±[ïµA“!ª3¸EÃý×:ȰXˆC´µ@T”„‰t„Àº¢îøòè8Œ è0$uÿ`×¼B"š‚03ž1'6 lËq)W Æ:,¡1<ÔQN"7I€ÿVöÝÌЄ:…‹³Y¤Fòæ'ã–Ý -À ìBQ£n–n6Ú€ TŠ?¥¬H¦„ZpŸ`ûaIÄge) ‡åĶbÆÈ\âåUÔ™PEXf ˜±5B^qP²€9DäJ,@0ݳª­ úI¦ !Ò”pÚŒMacZÜìöÀÀBüÕ[pxÅ B$ĪÔÊ8¸›CXڌбÇt8 7}– 1ó2\ tA:üŒH!›SütNSÕ„£˜H~ÃÿœAë@ÿB­5þ!ƒ? O÷)(üvN6Jf ‹|X¢ø}“~g®b9Š£Âÿ¸8Œ§…°Á¿Ètó¡áQw7V2W¬£þ±š‰AáÕÇw3Ò%yÃóšqX‡Ú´‚ŽÖ‚/ØÀ˜„L¨S, ¦©J&Цü¸Ÿÿy¸eZN¹ ÿø‰£ø‘§‚À’I",ƒ9dÁ ¶ß ‰kÁ—£z}YôžiB ΰd !.J=enð€€ L©áëdž&÷€WÖˆÔÄcEWµ)úmD—¢÷ú¯ÈÇýç4€@º@'W¨âNnvÿ\º ìÿÓš¼éŠtv”5å -!P" {¾P×§ÔZ ÁÌÒxoXØétý,¬‚ŠðŠTŠMÌB¥$LNtÁÜ‚-t.íÂT…Ç#ƒ÷1¯íCFc9W<<ÚàAFÔPƒ@¸!ßEœ"‡cYÍìÔX¨œîSÍl…Úci‚‡ K˜B½ø¹eíF¾̽ûŠÈËûNð:oФc!y¦Æïž8‡ÖQ2õ|Vÿ!¥ßŽŸÉXä:ðQ™Ü«à8ªº%Ô›Ž¨m |#2ìŽmÌu& 8PÐé¥è8ú• :ÿ6¡sÜŸÚÎßDÌ,ކr;—®ÿQveç S z­m½± `@íÄ·¬¹-UͦéN‰ø7©Lx°<‡Ì( ¤-¤^íˆÂ) ¸R,1ŒªþzcUä¡Qð É‚Ž_9 mÈTD») †Wü¦‹¡^ºŒåE \ «xQ)|˜é{B½··L8ÀÜÀ9o8×YVmŒÝòƒœ!ºÙy&œxû¹{£Í,ÜΨ EQÌÂ=àÁpè¯èã2—•ækû#<(ÉüÏÿ5˜ €\†+ftG$s™|6¡È&ècd ›âÄx…/ƒÀ,¸pÆŒõ‹í»åY¹Ã~wpôåG¹øÓIã¸8¼0-Hóð0PdPËr`HLTtt´T s3T³sËC½˜tÀ¤¼ #3Ó3°3€4{m ;ntp-4.2.6p5/html/pic/pogo7.gif0000644000175000017500000003277111307651605015070 0ustar peterpeterGIF89aË´÷ÿÿÿÿ!!!)))111999BBBJJJRRRZZZccckkksss{{{„„„ŒŒŒ”””œœœ¥¥¥­­­µµµ½½½ÆÆÆÞÞÞçççïïï÷÷÷ÿ÷÷½µµ­¥¥µ­­Æ½½œ””¥œœµ¥¥­œœ¥””µœœ­””µ””½””Æ””½ŒŒÆŒŒÖ””ÎŒŒÖŒŒÎ„„Ö„„Î{{Ö{{Þ{{ÞssçccçZZçRRïRRïJJïBB÷BB÷99ï11÷11÷))÷!!ÿ!!÷ÿÿÿÿï91÷91÷!çRJïB9ï9)çcRçJ9çkZçJ1½”ŒçZBÞsZÞkJÞsRÎ¥”Öœ„Ö„cïÞÖÆµ­Îœ„ÖŒk½­¥Ö„Z÷çÞΔsÖŒcΔkέ”ΜsƽµïÞÎÆµ¥÷ïçÿ÷ï½µ­µ­¥Þν½­œçεƭ”Î¥{ΜkïçÞÆœkÖµŒÎ­„Æ¥{Î¥sïÞÆÎ½¥çÎ­ÞÆ¥Îµ”Æ­ŒÎ¥kçֽƵœÖµ„έ{Æ¥sÞεֽ”εŒÆ­„ƽ­ÞƜέsÆ¥k½µ¥çֵνœÎµ„Æ­{÷ïÞÆµŒçÞÆÆ½¥ïçνµœ÷÷ïÿÿ÷½½µ­­¥µµ­ÆÆ½œœ”¥¥œµµ¥¥¥”µµ”ççZïïR÷÷)÷÷!ÿÿ!ÿÿÿÿÿÿÿÿµ½­cÿ)ÿ{Ös!ÿJïB1÷)ÿ½Æ½œ¥œœ­œ”¥”ŒÆŒ1÷1)÷)!ÿ!ÿÿÿÿÿÿZçk{ÖŒ­Æµ„ÆœœÆ­”¥œ”Æ­ŒÎµ¥Æ½kçÞ”œœ„ÎÎ{ÞÞkÞÞRççBïï9÷÷1÷÷)÷÷!÷÷!ÿÿÿÿÿÿÿÿÿÿ÷ÿZçïïÿsÖç­ÆÎcÎï9ÎÿŒ½ÞZ¥ÿ¥­Î„„ÿœ„ÿ¥œµ¥œ­œ”œ­”­µ”µ½Œ½çcççZçïRï÷9÷÷1÷÷!÷ÿ!ÿÿÿÿÿÿÿÿÿÿ÷÷1ïÆ¥½ÞcµÞkµÖ{œÀÀÀ!ùÿ,Ë´@ÿÿ H° Á*\ȰaÁ B4˜Ð¡Å‹3jÜȱ!Ĉ N,ÑBŃ&/\X@ å0 ¼ð¦?ÄÄ Ó“ÿ*žìH´¨ÑŒ?R4ɨ@•N%¦,)4)Ó‘-(вkN:gú0V€L˜daÒTK`‚AáK·®D "`µ‹Re®gÏÎ\K3'ÚÃj&6€v@¬Lî½8™¯e‡(@¬”Ä&ìùÐ$º&Öɵ€ D°Ð)Ð B‹º­»·ïAƒ¡áôõWµf¹æ40ñdÒ§WåJ†@‚Þ·4€z¹»Tè“ÎÿÎN @ð /@0LÖ_²p–ÿ&M4P`ž&`³‰½'SXÜ„SM:˜Øq6¡uÓaú3 ~Ve¥xag$¨ä]‘E'vD0àO"f¥È4€¼WÓ4#~ô†!¸V0B#H"ùã"¼1‚“p€¶\ º!IÈNFrH'(ªä¥‰.Zð! @ðP€[4@€ChTœO%çS €H§d€`$0ˆ‘xàá†r/p Pvüq¤“†,Pl™°`f]òã DJj¥‘‡ØÁdž‰6W‰%ÿ Ò4 fV`ëc&1€™#½ø×ÉyÙ¼%hz}ÈœPQ@“‡I$„àA(! ðÈ‘K^ Ü0B & VKhJN’b ?:9é¤xÄñc¡‘Ùê«¢YàÙ1ú¤Rzq‡DÀ;WJàA$g,p›¯>ð–TIí"‹Ü¡Û¾W2òÇ “X7Ȩvܦm½% GƒÝ¸Vr"èÖHy2–§vx­Çs‚Æô¬tuZ ñžÓñ¬I)pAɾe€Å˜·HÒ™( 42©ÉÙâ±Þ¬°C€ÂF*™ä‘W–lª•‹@`À ÿ²@«-UÀ”Þ°Á~°!¢UFÑàÅtÓv]àSK[0™cgJꮦ—dSàG$Ú–ür ,à€Ä®-ª 8°ò¾üAËÐGª6 h# ¼Ô–h G D€ˆnl<:T°éñ9=åuMe•öb&»ÒdW9àÚ?â›í‘Xšì¤½¾ÅMH úÚñÉ c#‰¥¤xxð!vÈï!p`€ B°á+BJà4¤!=VÙi°÷°¡å* hÖ’âX„`€tlB& °Co$…?ºÉG#“€è7Ö  Ø`«©XÄKzûJKÿ ЇÅ=àƒà0ˆFw’–³¨årÏ¡ ±L’š˜,à^‰‰M"´ ÌÐ7hYoâö²B âƒH$´…¥*eë…x¨–á<Èð!¼.¡  7SËÊ“¦W±'' #— †žDp€ÀpX @q7@"b{™½¡™t2p@ ÀŠlQ%ŠrÀXÒ€A\+‡`À£ìp­H " ØÂø±~pÁ$°BÐԚݨA_ɉ²P*@€ x€ƒ"qD°ÁMÕÜÛ4S¡ÉQ&%_Rʉ´8½„DG$¤ \¼ÿOÓà©P…)p€\øâ¿F1 m8Ô¡Ý8ÇìqŠÞcq.ÀŒ ƒ#lÔ£E(Š`„#˜t£(-‚ µ,>Å W¹Àöc€ãøç@à¨/ |Âh¥yпӼ&‹HÝìÐÅPx‚ ºP ˆC 03>&)@Œ‘   ô¡üñKÖRD ¹1þT´š°ä„J~,Ô"âN¡ndOP¡À( 8ŸNÀQtÄ'Ü3®ñ|—ÀìV}"ƒH&`ö c9Á ì@Íÿ•QQÕìúððšµ5QmCÀnc¯E¸ B‰Qêv†œ™¬KzQq¬DÅÜSWÁÝ©àéÓw­KpÀ"¼à®¯lºI¢¶Øð¾„Ìv¤’ðˆ^jG¹Ñ "ž·/'}â>¯Ы µ[F ¢¦f!Ú´ç%Én 8À×Òd4.ºÒ%ÊÔ«€0€³jIkn[€Üm ƒ€C-∟®à§ xÍó›ÆÁ&ØD"Ì`Mø)‡h1O@@œÙž3ÌäŽ\@æ)Àî ЀC¬ `Æ:T£`g€Z`µÆÔ’ää‰m²š×<"•ÐbÿÉlŽ3“]º¤T ŽŽÚŠ‹y¶˜Ì]O΀&êÆ‚èS*ŒÍ †K„að8`B-AK‚Ô˜±ÌGÒþá œíXç0å¼24„â@Ÿ6¥BK1Ó*Ä´:'Æ+Z ¡¤r:ÎÝMÊÖZD¢|Z@Šœ´«¬Vÿv,ñIÀ´é‡ôå¿’€™êÔå[#„EW霊^…A¢’ÐÅ3ªâƒhD#ÂÐÇU 2žMºb,@¶A/c\M,Õ–2¬‹TŸ"ËLGÞž­­MhRG0CØŠy|š• ”ç%òŠñ .ép ¸YKl7²HÇpáeÔvŠSlÂÈÿ€€n4<Ö‰‰×‚Ìb œìZ:pU‘¬SÄ„¨Ùj†³~‡àN aì©!gž|Â[YYnjª5¾Ì xäž½J6FØÁ5¨º‘>Ñ•ÀF„Yl…Wž‡'3ŸáŠÅš£žj:; ¢† æ©“õ‚ìà¨)fKRÙR•!¼@ˆ=h*µ @>9”`Áu*Χ.[“H@² C¦`'É?±@0w¹X%µ$øtO­¹”0PVn’ò=˜pN¢¡€ä™“.Q€Çï!v'60¢iÀD§6¥)êÿ 1&AC+¢ø›ˆ1ÿ¬e²µq©È ªJ&à€6]Nö‘‹I4Ó¹.;Uz’•ftƒ?ë¡ k àBŸw*nÔ€†±›P#`Ð[ À% ‰ðh[‘BAkÅ×"“WiFpÜñk¼Â~)’zêñVëÑ6Dw´à¦Böb €¨ãÚr~`>çÓBö7D¸$,áHŠâS ð Q²îV8;tðçd)¡fb*(Ó+Ñ!„q  t¤[ês?îC7÷¢*”x à—ªb$lvcêÂI ÀFÉÑ;t@ŒˆƒÈ~ànv7…¡=·{Yÿ¡!IÁ;ˆx•$ûS7dƒ%©ã>›¯õ „p×Â_ªs²t$à|K.1$ò4O!‘ ‘ r3|Bô*}ˆj%hmù$*2 pl F–CÈFËAõ’$läyëSC7$§AÖ5j1ìW0d) d <€¥u  pªò!6“‰1’*…µÙÈeðtOüÔ¦¶fvRSBÄRŽEÓà¤FhD2x°ƒƒ…;*$2‹plðr!ð l |iD›8ò¢&‰e À+öS†fu÷ñ/4“&ð*›p ÿPM_k ‡^~€}°„û…~ðàp0 ¨‰°cø‹( ¥P£pt­0 å µØ Ò Ö Õà uõ&PR'eE¹¤'bæÑnðGP.€ À=pqA±èÑRY PáFgø°q¨` ©¡»à ¾À ­´Õ e«Åð°Væ±2Gð6pDàQ`DÀÙ(,`C 71èkãç-çóB½‘Z4#i«f*éΡˆG‘"P>'’V¶h}ð!NvÀ^ÐÿPS ð#yiæjg¦Žp0;#s2f±Ž6óÓYƒ—hñø (¦Ÿ-ÑR’)gXÑ``´p+íÇOC—SËRYf¦jž8„0\jè‰îÉ}Ð-ɹW°†ƒ‚C¹á2Vò#6”XÎ5u-q€ttGx0 ŒÑ 1ÑA.ã/¼ÈId3!˜ˆÒ•W9.y8¾r_„dýôW1& 6l#°ƒà)ô }p ð#Ȩv˜‡p@ê¢-q}€Ðn}s>¯%WÈl¯Ò a±ñ3…r¢¤¡ pàDì%ˆàK‡P¿KÚá+ w5ÿd÷´G©e}À:p Bö  þW+‹©§s¦T™AY£Jö´p©`á Cª²Ú4ä_Òh³j‚˜±T)-™"QEò)uª1Â"‘«ô”h‰Æ1‰«ŽÉ5‡ &$‘"i²—|en¨ÙG“Èk/¥¬ŠÙ0uT½JTKµB3q6 ri­&?—T©*®¼ª!I&&Gõ¤1޹®."<ÖDq•6s2naÑ*2Œ©…"‘…Ç2pBÑ[{µj7qÃfîÁm•úJ9@9º®±'‹fÖäãÖS‡ ¶j3ÿ·n1Ȳ£Ö. 'Ъ§*¡išf9m*[g1ÅDfà( à auŠ\£$Ùj"[Ò«£aJm[‘…)ÑÅ2«sO²¢e*‚CBÙôHþA‘æb€ámW§ŠBP°S…s‘@c×bYŒ‘f&²ª)Q0§0´}ñV&2u¶z ‰F« ð0 ¾f9±&ietiì12k1û/4k[ƒaöMÜW(‡P!–¢°Ù7ÓV®ºT©Àzã1…³=㡤Àåajp•&3új¶l3A‰ y›Àœ* Læ‘­ºg4ÿÛŒt¸¿Õæ‹lî4Ñ!ò75¿«7Žò*3ÚªG+‹!=Q‘E²A2Á½Š ‡{ºñ˜ `Ûvtâ¹ ‡øeGç‰Ë—±ætÔ‰âTæ»Ŧ’©kG75°¥o࿲—®ñ§=l±†Öw¢O#ä+\¦lΛ`;x »ÓyI”“B„Œ…7ÆUΓ$ÚbkÀbrft¹‚&S¡Ê+Ø¡1êJ’¢1…æš"p•™>ꘗE.(f¸¬v ¥Dh/¼…²Q€&370ЍR+Ïs/€YŠÑ°8a#~&>%Ì8¦1t¢‘Yœ9ÿeù*]bbŒ+zRgDÕ XÆ;¸-‘à9±}(¶†àP-x s€ 5Ù ž¢)¹—P7w„¡› P1‡;³œÔaãñŒË¸.‰ P"¢ÄÆr¦zÛõ=I(Û¡T  &v¨7Ø6‡p^€xy¤-€€.4ÓEЙ²5%àŸ©s7X2£˜-›Äº dzêX¿¿Ú¾š4Ïž1BüÛ9¤“pý ’ØrGü#\»1¢’"Ÿ€nÀs°) C›ûÊ`f2¯’͈W„žN‹€|–—3-Õ&Ä,9…Ì4øTx´QlÞÿcaÐ*¿+#$-"s>ûrl€` ŠðŽpZ@ |Pu ¬B¯l1$Ä•-ÂSÆS77+18ù°”„¼³I‘rÊtí;´=µ¶ÂFKÓˆ*!>fáUŸe7ÊA3×¥€§²2lI¯¨¾ʨMÖQ~ž#Wœ´_;†c=k hÝ9 ´9ÈÒÌf]-jY!jyõ&DºÃWµÂ½´6)ì¼yœh$ ¬p»|IÞŒr p°_p@B”’ÜáNÚ¹:^hå·k"*QS`è@Øq­å¹y 9CÙ6åa¡E87º|šx*ìÿ³àH-¡„ yl-lÍ-Œ«¯^‰Q>ëAkM 49oÑ fP-w$)@̰$§  t>ªÃ>öâ‰,äu5Õˆ fð÷úç«JU²O¡‚¢Æ)P×9*a…q5hb1—Ì©u„†u$ÁHl-q° U{áÕª¯ñƒtCBÈ6›@e€½GBˆ„#ƒ¦]c &‘’&aã£0'bÌ–òD­e¢Cx†dƒFDH‡°6³“$XB*ãªXEŸPÇ@ À„’¨³L‚H„pL¾Í5Îv¿Ã½I‰Q W$«Óÿ0¶„k$˜z³¤‰.îY¾£_ õUÚÒˆ?uH“° v`à"©«ŒŽú˜Íöv·‚z¦C¯± ÝÆäto“ `DWˆð$?#ºV·ÎâÕ’ˆ·"Š0T†yä( àÅcÝ­10ˆiKáã1%›ð7ºD3ãˆ1‚ðÕl&Õê"/üÛ&ñh.¦” àqfVlø¡ép;Ш€ró¢jCøcîmÑe'{jœèYð¥À©²K*ÄR¹¡7¨4 °;c<Ûëbf¡šö³. h±.W2AÀ‘“Ã6³È6¼aujD2¦½àŒ^P €š0dý©ÿSŒ °zð‘`hðæ½Ã[?H‹Ð[˜ÆþQX¯Ö\`Ó[Øú™öÆ\½éT©®quŠYåaâ`Lpàò àqb9tŶ!ÕÒ?½Ý!‰±]|è2là»_aÚa¥ÆÔ2»‘^ºo½± ]”nՔ씧A‹9I¦ªÖª ŒXp´®,i²Õÿ–n-‘°b´@PÀ T-²1îÇ>J& ñ +œê¶. °>-têd- .(d˜ðÂ?ˆÿ=”XÑâʼn-@¤ˆÑãG >T˜Q"Ã…)-’lxáQªT¥J°€×/œ¿„%°¦Í§ÏlâÔ»Wôž<8ŒaÚÔÈÓ"Q£¢"OÑÁÀAB5¦D9ÁÁ…I. ÙÖíÛÄždû¯¤Øºí.t8Q¥VüÊN` 4û©mÛ¸âÙ+ú®@ ŠDÈ cé#CVùc’>ÃA ăîÂË0„. Àˆ3Qï°#Ä" Áƒ Ì*´íÀÝ P5ëdÄŽÈŒï¸DMˆ#¹°“ñPDÝRÿ‹!–Ä<àÀD+ ‘F@Ä#Ðã !$ Y„ByÀáDÄ>0“Ï»ð‡ÏãNÌ0‚8‚ÄAˆ•Bï@ !A$$PYýA.ä0]Ñ(HK.*°1QDr `.¾ìË!(d@쀀AAÓR5{<S4`“¤Ú 8äà äÌûq“øÔÓ; 8s×: 9ä;ä&`IŒ42Ð ËW?!!Îe‘ÎB7â–ÛkÍR@ Ò² ¸á hM.{¾ ‚†)|HèðÌ1Ít^4ñ8$¾¬€à€ÿà’Û=‚Hš’;<„€Ìáî&X„à?–~„ekmØÖ0³6kM9‘-Œ˜ç—¿ˆç d[ Z (ˆ ¯]Hq x`ö$΀¶þdƒ<¡sE˜@$¸cKâ``’Eì`À+ùT½c?àèZS#? Úò¸WdR<"YØ ×å­Ë‘ºm·¾"”xÖ>ûŸ%@ûÛß" °Ý44CH ¸¤6‘ €¨!™ Ðp@¼+À‚‰ª¢Ÿpò•±Œ­ì‡ÓÖhQ½ëEP‚Ø»À$ 9 hb%z: ÿ›8€A"À†FâLhŠ„10µIIxÀ`÷@gùÄ!:d©Ax—É™(°DÐ'øD(ê¥-´0C£zC$§-Àvˆ^r€0A ÷–„¤Å,Ý!¢à²á< …Šbí¨¨Á]€Dx£__w½´Üðs@åö$mÝQ‘‹|Î5ÂHŽ\`6€i@ çDHf²-ÕŽ&…IOJ1”£TTKt´‘ë8’”«de¢®eÅ!À=²£oÈÉVæR—çIZp>‘}o"#SxÈòÈ]&SF¥^tôG‡\ Þ‘…Nħ1ÿ©Le9;À•ù͈¨e“ ÂÈ‚È5•x 0ùJ…ju"2ÉŠY|‹[|P.p’Òœá\‹(™ù‘gf'%ä´‘\À¼=m9(+N²zM²QíE¢Ì§ùBÇpF3 c±‘3jNUNäðqgBÛ Ñø ¬šñá›­æƒÑŠf2G¯!hvN‚Ës¡Ó.9ÚèZ Hµ³Øߎƒ2•f ‘ÁQ3cj=ÀeD!¸¨#u4—éq$UÅ¥B ÀF2žD}§² ,e}çð”&@ÎèÅõ©,‹C"° ‹à6|1eKòz|åMVzJVKã©2–&4¡,Ûè\5©GtÁÿQå éB&P![¶°Lé5zÔ¸Ùªeuì"/0®‰Š\tMÉ/³y¢Y–VJekÜRÖP2QU«#)í e·zË©ŸTÈA&ÚÂ6Fýl­ˆJO¢ f*±Î'£ÚÛ•ŒD qÀEÑÁBOpKì`iÕ76÷¨eU‘µä#²$¸L®.Á’¸Ön´†Š+YHbÓìPÀByë,K3Ô&xž,©ƒ5/fšÑá2Ó ÐakPœú¶òg Ñ–B\¤G´ì·F6‹€pb€ë®á½–Ø;,¢C‘Ä£ì`‡><"hXÜøY›_Ñ 0Õë8ͶžžU Gÿ éS+¸_àžz¤Z"ÃbÂu§6zbÞ˜â(Þôæ`Ã&Pˆ>Àák¶éÀ¶EìîðάÚ(( ¦Ü^X¼DÕ´ ÙK’­(3Ÿ§=,$À²äˆ+øË|Õ*Ž µ•;mõe}6Eõì…Âÿ H:DbX€é]ôg`ºsy‚û×çy¸5t†WI–àFùÃNª'BA1O©Š­;c5V`QZ­’Ö,KP BM¼ú„ô0S òØ ¦ÐŠ$;ÓH _(ÏŠœL²€Ô%r‰ …z†XsÓAŽÕP×*ÖØf,e'¥PZMd!ˆ"VZ#ÿzÔcï ©ˆ%ÎÄN 8À{>ë®—êÖ²B¯Åf)yÞ0c=³%!jåÛPUô+¸©hðÑ´CòI¯PêÜMšu¨¾U*-‡‹E! ®eµ¬€0 DÐ-Fl-A¦ ´eQ¦°|Ž9–_\¶—άÈ:‡;¼¤< ØË# ôLû¯¹Üd\ Ù'Koh¥tÏùfa¡·dˆZâÓm bV Ý¿–\ˆ«þ>”а-Mê¬Ú¹9dXøÛ~„‡EÄAÆuZ„SLÊ{èÏSŠ^«Ôç"'ÑDN‰l0ÈsVAÏg]®nî À‡ædë1ÿÆÙ`Mº$`…($TÆlàÅœO0$9(íru½De*Ég‡éƒ€oŠ®Ê”4` €²KøvCú—кô¯¹>ªZ•°A‰6sk’-}p€  >ø!<„Ù(€°ƒ¥Ñ” z@@ø!5YÈ 5zñ4 €îS€¸·z7 Â2b² 2<!€ ‘j²Qª=Z‹E” Á™ú™iØ7è{“P¨“ä‘zÀ«ˆB€ZЕ!¹ ð˜#yW),c£è0ƒ€IJ&K‹í²ÚHA‘»Œs¬Ÿñ¦„¸Œ8·½â) ¸!ÿ„$ æŒB;±˜Ÿ*X¾á»y„Lñ˜A œ=™•w2¶ Auºœ#´‘€»‘¯†ˆ€F|ºLÒÝ*.¸§RºÊ9€‘I€Ä6ªuú¿¡B¨„`€6˜ƒ Ø€0*P!‘i>#±ƒlÎ*/2‘/—˜ ` ë C+¤Dã«©´¦s²çi—ÈõÞN0ƒ—h€>¨±|šM¨H°8 œX#!CÐÝ` ÅYœE@) 8HÀ^l!‰9AÑ9k€™Y’ ê®/± ÇYØÂzm™bœ«© ¿”60(ÿ¹¨‰FØ<áÇAèŸ@ÑGH—?8„4Ø€@ Û Ø 2€”TÔÇ@¤BèƒH½mr…˜€·úÀ @òc c·Ä® j 9J !”“p&X²  Qƒ–h!¤FXAÀ@€ 0€©œqÉ XžR€µéH›l›¶Á”"„M˜4ºi 'K‹¢è.½’‹q9'‰\7—تir8TÒ©jx@!B;БÍÓI@@JÀ  •y²Ô€£,@EÂÓìÁƒO¨Gˆ :ª)j)ºo«ìªÈ*´Kª8Ø»™ ¸,Ø®ÿÕJ£œÙ„n¼ƒ°B<Ø„ø„Y›8H€`ƒ?؃4€ÜkДűq¨}[€µYÍñ;Ø„ùàø7 Ì X=Ê’@¼ó&JÀ¬(-ªª€Dà tJ_AAD˜±;\„öð—ãù„HÀƒGx„«„L˜ÇyŒE²dƒ. ò<BX7ð^Ãcˆ¯‚ǹ( °ÏrºxF‹)uSˆ‘21ÄÁt“*t!“Ø-#a†èƒÈ—EðfX„Aм= X¬PÀ„4˜ƒ3Xž£:¾A€8¾!ü‹’ê¶Ì91¤ÌàžÉ±=ì™ÿm¡5ÀË¥’p™K%WyJé‰&´|OoTšù—t8уrבּµù‘À˜µº´f9x²ÉÔÝø=y“p‘ÆÚ‹÷<42¯ªr‘ ¸§¿¸Ú[é“嫾#Qͧ¹h€P€÷š„Ë?˜L Y)ˆŽX„IPHu¤”&Oü¸·;A‘.<-+dÊ5ŒÍhjÆÃ‘¤U¥ž´¸ÁØEè³”}§=„^ôMY#í@j26h€T °x¬™ˆDèÉ¡òSÁaA';#Xº«›±QÂë&/ìTêºÂ‰ B9´¼9ÿi€ÉÉ]T#XÉ×<á0ÀƒHˆNX¨9y6©8‹ JìZÁL @ Jd· SLÞÊžáA¦ûƒ>¼B°Ú@€(!I.ËT,Ϲ´#yZZ(L à¬Hø„ éšcYŸt«†pÈž™Y•PˆfÄÑ÷L‰ºiú¿†•žžÌð@删PǶá'\G4‰Z¨…€>ØÅ¬–‹rùXà ¬ªûlD€Y‘R ‡ôªš¡ÆÕ»Ù A‹+óË !œ„ƒˆ„8h„ȉŸ¥‰Õu ›°!OÃ]A¡Ú‹ZÈ A„°ñƒÿðT¼øÛÄ\Ž‹¯”H´ ? HC=”flPm€ÎÔQ4@;@„CðΜü!¥Yššl>£ãò²(¤ìs'rQéÅÜûÌÈ‹úW:”X…°¸ÜÝ’ 4~ÔÇÖ¼›Ë°úìÃK@ƒ·,\O<0ßÊ»KòÉ™#Ò8@^ #Ý–³m$Kd¥›m´ *ºD[€-ôOE['H´pÒ€x„‚¡Ú<tµ>Bh„š˜P`Mf胙yçä488`»µñ#H?Ø`ƒ;`: F¸ƒºÆû”ßœ"?ŽÞ¬ P¯"7¥+Ã0üÿ »ÇòÔáIÀ 1ÒÙЪ‘˜9ž@`‘|yÃjÖð+¾âA¦Bx€)«.§“^G a(<Þ¢dˆf½duˆ(K (la®”®d¶IÀ: Ü6Öåv9„O@°ƒƒØ„ÿãWé",¾e,&„B4óâ^'_*=RÑ÷LÂÁ)Uû¥øa;¹ÝÕ¤—›å5q€K ý>‚6ø“©< ˆFøfÚ9Ú!€ˆqQ`ƒå ޫ⯽ڭ}Õ±}¦­®›y+G‹CµQ“6³˜8Ñ+Ü‘ÑQ³‰ÂÔœ—F8€ƒKPY—Û„ÿiJX R­ù»2Ç©¦¡ÔKú¦¾à©>¦–0ƒjá>è"@¡X:ü!œ,‚®Bø„PxIºÄ”MhÂ;x€H@›H€éuz€N¨*Þ L5:8 ¼Y™Þ5ßÌS㤴€g¼Ñƒ Yy™ÃÅl®”ÁÑŠÁ’Îy³°ùépÖ?8jÑ„ÛÄ&^›i"Ê,µBA¹9¬ø¨WÜ¥ž2i‚Ó”˜¤ÇăI ÷‰€HÌØ„gž—uÌX9†—ƒÕKùéÉ™Wñ^‰h’ øØ söh96€@¸¦›Ÿ’ó¿Á|YE^éɨ÷Ó¸ÿù9 €C°c£ÊÆ>Ï4ÑìÓÂêCÛ_F€–Ç­Ä­¢(cር¶v‰Sk„£$ÌSÈx1@ÏÑÔÃ"È»‹ÁÁí·p¢¼x&ïÚ‹!:`ƒøf/ÀK ²• ’Ìå‘Äló…n<ˆp/½Î ¾M€ZõƒCè@sìZ$A€mÔŒ7‘Q!_1B³üÀêØUCë‘Ó¼A ÞMð€xgÛ¦m[9PÐ;$ÜÈ|n¥‰`<ð227s+1¨1K¸‹8_<„ˆ‹óàœ¸ ù„0‰Hd+ÚŠÞ8 `:ÞP1¡$AþhÿØ› tëR 0ƒDˆs30G~o…H3Ú(*ÒL*ù`Í.˜¯©—™ŽZ<€ÄF¸ƒHPtSôÝ9 H‰@˜U‘ñ 7W%îp{{˜Ë—1¡„@9•X(? yÓ&2¡O€å%z„Fh„Oж•!â †3è„ö†ª Sd<½ár2Ù úZ°Û]š®ÚÁU6Šš¶ÝòDk¹yAƒá`B˜Ÿ—ðöZà¹u²è#‚ÈIr¶H1À`]I»Œ²ëä›ÎbZ€@YjrÌØ 7ÀãÀCx‰h‹ëá‹hY6‡)˱}à~ôÿÁõ%…>@„>(±¨€O`ƒCÐ<ÚM“£ín§vó¿W±×».ˆ  `€€\9ãº9€;”Fmá¾¹Sð–@ [ t²A#»I€»ò­´PŸ1€Kèƒ@`ƒ$!“Þ v;1ß©½]žëçôg5&u!fà¾È€M„;ˆ³ ù—ü³qÀhÅÛ~S_—‹ "¹K©ã’Ž€l43ÐÁïu|38üÂ'ü2M7O£÷>x…04øT~E·ƒFû®¼HØÅ>h„85òf$ÿ8`€à@  èqø†‚«nžºð³R…T † »õ4êÔÉ®þü”©@ÑTdžŽ:S”*U¦$à%÷×°ÒðÞÝFnJ¿íìü²ðË"Ò]:72¤%̘ H½jA¬ÙÐ$ àsAìÚÝU³o¿õ;Ö¦cew•­°Â@³ $H¥ •ÄâK\ÀH`À3ÄiÎ ÔãW=  @Bà@Ýa/­P˜aÍEÇDc±5UT$PS€à¤ÓN5í4@,l¦¹w#j"†µPR²µfcRfM@€£¨RJMøK/  ]waSÎLë T4ð@"QD ÏÿGÈ0˜ \‚ŒJ‰•ÐhùM™‹ñô`@‡à±$}°±¬l¨ÃLĀà =4Á5 5ñRl 9 €cy8ÙËlN"Ót€Õ2BHµ ”lÿò@` q禹9³ÖÔ¤}ÆXrR@ÁT{ ƒxÁ'ƒ¬ŒmØÁ2,rI€4`rŒA#ƒ|‚Gƒ r@¡Ð fYð@Ö,êôÀŸ„,rˆŸ¸¼lÌ,€ÛAíÊ+/‚†ð³ÔB’5zcå<ù¢“#Ôɉ¨l-!Wýùµ¡W[1‘—ˆàï'v²e‹ú¤20‰=żâ²È"UÿAÈ+orâ².6p€MTÍóU{‚@Éþø£“ò„ôÁ,‘’“k¹{•3jã(È￯:è ³ìÉOÀÁÕ){`öÖð46!ûÙÔÿ1³:u+ýŠXµ€HP+x³[–J62ŸPÄwÌk³Ø­ ‚è[@Ú€Æ{Üûà±Ì’”À@Ä $`5j±x¢#[O¶ÔPÀ!u}˜Ä" À†MØÉs„°ŸÉ ðeû{ ¼F`z7±Éìá/à5/v/€%‡F [P\³bt Ml{Ä‘zÖu¬ŸE¥5Ùì0‰ÏmŽå{Ú"Re¯0 4#øC¤ê….OlX@C0 »m·½6Á¹ó1ò1{$Ù@¸•qª[W$®zFDBÏ8"¨¯!m !m”"KYJÿyjC€6!<°!eD߫Ɔ.Òädˆÿ§bp¬Öµü€§§mÂv·Ë¿ªÖ9æ±,]œÞôšeÄÁp `•È×*Ö}Êu¯+ì  “y@I9[¬ °ÍfèÄÿÛðª,óøÊ“ù„úàMa·xx@(rˆØ^†ßtÊjM`_ Ø„Ù.x;Ú\<‘Ñ*Æ g¸Ê\鬱0;^ë+†>€ÑˆF|‚t¢ÉßÊs€( fq¤*ÐÂEHÓny‚[¸^{D Â} Ç”…^Ÿ à²k\—•m®üP ©E3±2Ë’Ý‹HXhðìx­¤í¸xçAš½pˆC ®wÁ¼8†¢:– H„q‡HÀ¡m‰úJV5OEg8„$ÞE‰õµƒ`N-zL—À,oPè Tà˜R 6¡ÞI ‡ˆ0­Ö·-P/û Ѐ¦•]óºÝXÁB@Ð:D€k¼…ÃÙ`6T,F1úÛ‰EäG)…f>€+€ÁBÀ®l@HéµAwS\Ñ‚[ŒúÐL°!vˆ€ÂÌåÇ\Q¹Æ3xR;TU'Y+~*.óïµçý.ô!Phs÷z ;ÀìЋ2K"<‰•gNqv³'?N²¨º{­”Ì€h 4Œœ«ô­[.é®YOYÎxZ\€„Z"¢Îõµ³]•9ìµÛ.w Ͻîv§ÔÝó®÷­;ntp-4.2.6p5/html/pic/wingdorothy.gif0000644000175000017500000002514111307651605016403 0ustar peterpeterGIF89a§´÷ÿÿÿ½½½ÆÆÆïççÿ÷÷çÞÞçÖÖµ¥¥cZZZJJcBBÎÖÿÎÞï½!{91œ1!¥1!œ9!çÎÆµœ”ŒB)ŒJ1„sk{ZJsRBŒkZ{J1”kRkJ1{R1„R)çÞÖ„{sÖ½¥cRB÷ïçÞÖÎÖÎÆœ”Œ”Œ„ïÖ½çε{kZscR­”{ŒsZ{cJkR9„cBÎÆ½Œ„{œc!ν¥­œ„­”skZBŒsR{cBcJ)¥”{÷çν­”µ¥ŒœŒs”„kscJ¥œŒcZJïÞ½ÖÆ¥Î½œÆµ”¥”sœŒk”„c„sR{kJscBcR1ZJ)Œk)skZœŒc„sJ{kBkZ1{c)skRkcJcZ9{k)Œ{)”„)œŒ!¥”!­œ!„{1¥œ!­¥½µƽÎÆÖÎƽçÞÞÖ÷÷ï­­¥µµ­œœ”¥¥œŒŒ{ccB„„RZZ1cc1ZZ!ŒŒ)ÎÎïï÷÷ÿÿZc9„ŒkRc!cs9Zk1ŒœkRc1ZcJRk)kŒRJs)R„1J{)csZZkRJŒ)BŒ!{¥kJ„99œ!1¥)­!œ!Æ1­!B”9!½ÖÎÎÞïRkR9¥9!½!ÿ)µ1Î1­JBŒRs”{RsZ1œJBsR1œZ!µZ1­c9„Z„¥”{œŒJ{cBŒkRŒsJ„kR{kBœ{R„s9œ{J{kc¥”J”„BŒ{B”„!Æ¥Zµ¥R­œ9”„έ9œŒ1¥”ïÎ1­œ)½­1¥œ!ÖÆÖÆïÞBµ­1­¥)µ­)½µ!½µÎÆÖÎÞÖçÞïç÷ïÖÖççïï÷÷ÿÿÞç1B”BJ{BJ„ÆÖ÷ÿ!½½ÆÞï1)”)!œ)!¥91„B9¥1)„skœZR„B9s9){B1„cZ{sc”J9kcZsJ9c”Œ”RJRZJZkZcsckRBJÀÀÀ!ùÿ,§´@ÿÿ H° Áƒ*\Ȱ¡Ã‡#JœH±â@88`¬°È±#Ĥˆøf( Iâ$É–”0;¾éÒd—m<Â$F(/bþƒ³#È&EN2|㢉)1¤¼JUa?šä˜"e‹ÒŠp¢l#HŒ.]b¸€ùfœ¦Jr0™ÑejÁK–ØÙñÄITUÿ“£IO'=ë¢|1CÊR~K‘Aĉ“-r¨ÊI›ÃÅ'Sr(‰¹Eo”qº€èÂ!m“R:sÀáDÊŽžS”tÙèZ¢ "-ÎæÿhrÖ %.¾ž1ºC¦ì 2å‰è·íZ¼*¤~TÎ[ÌðÄ3DÑ…|1°Ð„ Ý5dƒA°ðDQCS¨ÕZƒ…$D ;4ÆAc;!ZcéÇQ›Y‡˜€DáÄOÈ%DƘ— s4¸ 8ô´DD4æ[[lÈ!BrÀÐ×NpЄ_¢ K(ñ‚zÍÄATÅÐ HD†1ÄÀ<=¡CÁÖ]@Õ…_[Ô·ƒŠK&tÕlBlÑ™_NÀ ]µÀ1LĞɑA”Vjé B!Z;tÁÞo-ìàPWmaƒ /Tª@oÌÿÃL—CµÞ–[ŸÅê [Ä@Îà]õ)±C±]؃ Vi`Ž8çT[m8ç˜Î7ߌ3;úäЂ ¢¢%Ã'"ÚEDA8Ðh˜D - D5 1f ÀÞ20ÁhUpÉ«Cp¼!Ç*ØPZN1Bü@׉Q@—–_€$‡láÄ?4:ÃøA’¡@OÈP§º šq`„@Å ^ÆhôÑÇ|ô¡”Ä&ÁB D(ñ4¾Hàðƒ„L¬µ0E¨¢¨EØö‚h$AaA@ÑYO(ZD­rD³É0ÅJN1u¾C ÿ«ElœEãˆcø9UP6P3äÖkÇSÔ¹là$ó¹5Aqx¼¡ÎÀBÀ!G+hP®rR÷!ZDÈ^½QñÄB€ÇÂ98ViÁ•dúº!ðB6Ñ@ƒË8ánýá ˆð)¢0‘ÚM Q¯ÚI¡Ÿ#$À«‘Й°ºðÄDh ÅONÁÁOˆ Ýîå2VbÐðÉ OøI¢…® ¨^ `Ä.´AÁ "£‚ÚÀ0¨‘ m0Ì,–C— ,pBêä%¥/"*HRD@™°µ° RxB´ƒå ïvÌ™Asÿrˆ/XPÐÑÀ 6d¡g †3´q k`Âà/aˆNt¢’bZJˆ–-Uä ppáÂä`Äauz¡v0„4¨@ `›, Y¤ 2žWAj#ÃPF5<‹ZÈ` 0†sq‚@Ž^A QêÕ…]½° ,Ú'ér)À Qœi‚Ý¢6ý°N/xA"‡-ÌâE˜ ª¸ …Yô¢Ô F2n!(¡Ç,B ¹ì€+’E(0!F'°àÄÔ¸¦ÀAÿ˜CÈ>)8‡&BèB’à g¯S× @МÀ‰êS ÑI¸@ÿ—É h‘#`0ƒq¢N+ÃJ÷Óœ)qA d`»ØE¡dëçF³Pyò *Xá‰D“` 4É %2)0¡VZ â`Fˆzä Op ”¼&Ø ñ\*,.ÀoEŸ‚BéŒjÓ¦:õ©P]‘ç¢“ŽŽ„ªR”¦ŠÕˆ¸@@O0èC4š£rDA˜ Ð÷ Úp î©“   ƒÎ@S3ß4Ë«AM­Sø2É¡?åÃûgÎ’C'œn?&ÛBŒ~P$³k †i œ¦Ô„"°·A6A š …4 ,BrùBf 7s;`.Z0Œ#"˜U" ãG4÷¡Ø·M@‚vê3ƒñô„ ]¸±Eäð„Âf ?°[‹XˆÆÁ$PÂ:“ƒË¶ö°BD ³ °³ç³EýÓÀ¢r3I@]–W\ïd€Semxg2`!‚bP€5IkPÐCÿ ¡L@ ™5™£ŠA“NOp/_V‰*à$C&Ò±X]wY00P<=B¹"¤X?kÒXÅYM0‚;Ð%0£]Ñ@íEðh¡¸"[°Ï´Zçq\Q(1‘Sàw<Æ‚ Õg±]INM!'9aãT±3Ð]V2°>*¹"!"a7³= E^ôѵTuR“2CðLB€Là1Ä?¢ñБâ(0°ñ©¹1™7+à¢]€LÇØToÀ-€`i!(¨•S u‚Ze"¥tJp ‰ÉoÑQ"k r21ÀÔÿ9åf:(Q}~ÅCPlKÒŽD0"­$dôÄUf(1D1°s–±E@bSp5PP1PŽKrŽ-¡õ…ŽP š[Cs–zG<%¤isè‘ ±Y×eYO0g~ƒ1R@I°‹ RKuHz÷^2°…:™Ð.°z¨‹Ç2S?ò‘d)3‡&‰¢‰bÒ“Áâ=]`Luø–Pp,<–!©Žé£Päá&YžhÑF T‡w f³QMÖ(ÛÕÕIЀ‘9.ÖD#ú³,?PRMUZ`©&)GjLH°J‰–&¿ÑpHðL[ %C„8'ÿÖMÚn•%îU—5BjŸ¤tDP!.A_%Бêp=†£Y@ˆ>@ƒ58#nPv€o…Áœ${1Ù™ ¨S£PÈyrØ%Q9’h3îU pø^9ä®Ö”¸T5‚/ç›!DðcÍñjô;ãp ÀÜ`8å€nPƒ0ö¹W~‘¾h’/"yÝgS»a*°2„Á”‘y Ö]¤˜¶QGQªÊ bÿ‚J¶²2‘_â{Ù…dªD2;À 4 P$ ´Ð ð§Ð ÞP 4 >DP±6cå2ò6Uv£*ê±\0Œm‘~ÌÁ_—{g; ±1pDðI _%Ž2¢2_d+D3Pô|Ìð Í`D4 ÆpÊÔ IDA=`Ãdúb;PY‰3¡– ôyˆPrpghA{\ 84±Ë*jB6DÀ}!7ˆò« ¶ÊhA” Pä  DØ` tàÒ€AÅÔ·`]‡qàžÁ8:˜®.°8"‡’=‚QÿQŠ®8áz'Jð!´ Êÿ0 Ú€ ߌA»` ˜ ¨  GàÊQÈw ËA2?ðõ¡<™Œ4C;P*€Ê ÌK-Wˆ²òÇNà¡ð ’° £@ ÍPAÙ@ ò7y«° xÅà‚ “ð)€` ¢yR¡„¹)hâ´®Zç¼BŠW¶ÃqÐ-p&§”_ó…Ö&wÿQ$ ð Ô° ˜ŒAÛ ÃÐÙ3€0?àÎ ÈpÚ×@ Wp7ÑÁÄšpÐ*w¶"½n‡Áƒ(%_#rpz±+†p°ȧ !t œ€ 7 ³ÑÚ0 LPQW1 ÈdB°³58h¶ÿõ†€ ¤E’Oõuì: ÆuÔ9@Ðb2̱ò4+ Û x4 oxÑàÜ‹— ãÕhoò49à¡À ]`I3˜À høÚho}ˆUq@³v÷¹½]'´—TPñÖ&€Ñ0‘%Qiem}(6£p°£Óv 5À³$ƒ ¡  V/ô'ØVÁoäMN¥b5A˜nwOæµ=Y-ÜËÃˇ¯O?Ðw¢QÑÑCj$= ‰ ..ÂÇÕXi6…>w¾?Ð?94@œXŠtáC r“hñ5C?umxü¡£s„AG¥æbXT:'!ËÍÿBQ´§wêjv¡„¯â:.ޝ¯£·%6 ­~‚¯iûJ¯}k®©ªÎ"ãÎÉaÛK˜ɱ=EÐÙŠ  M¤( NæaÞ… ?*5—!L?ÀY44< d¥‚h/à£.Ÿž‡¼<Ùì/½¢ì_eÛØþíàîâ>î½Ê‹W1í¼(*>^[o 6Fî+0ÛíÙHîÐû;äTRž¾ò•ˆEAø$©æ Ú¨ C‚&»Öž"È€€ù<Ó ¬"Ì>hqO’¤`£4aNÅtøÐ¤&µmCʲKntÛ‚Ff@›”XÅrÀVð‚™ìEØg& Ê„En1 z‚iš -lDZQ«Å”ôSrÚÍ:(R‚ÓZ‡6(U°&èÇç¢@„ f ®9©ŠÀ èiGÿ-QØé,„<tq°`°…Çæ¦Dø{BåÞú9 A‚"BLƒ.’Æ å(õݸJ§¨Câ8Ç9ÈAŽx·è@Ç8ÊxÈÉAŸ;×w膴’Å¡˜€: Ð1¦_ü¢4“€ÙÀïyµ”ÅÓ>D QˆìC·&tÁ7M‚ lå "$†[àÂmí±Ûw €6°Á>0I#À'8A˜ I<©e@û“²ÉÍl.€ªÜå^ðƒI%8"âÛ¢žV‰éÊ ‹€ÎMŠ?PÂøŽ¶$+Dv!pp¶…,hÀǃ8D !ˆ@B‘ÿÄ$*a˜@>IKÙ ü€nf? w‘ð8¼á K`A ü3åN1ÊOŸX…e àGA–ý$Ø$ˆøÿÐÊì¯|T&ÃQ—êð>”Á HÅ6ö`I…º¨crûÏþ:¤\µÊ@Q±Ò£–æ€Ã…c ‚ÀLº­nð0Çnõÿá”.Ô(€Œ˜2¥ ] ¨ö9R·`Rx;çØ´1Sáž@e?؇u¾ ßgPbƒiÈ*‡Q™ƒ^ê&l!ÝAäQŽÝî¶=`ïŒp|t" €HF¡–¤ `¹s³¾‡ð*h%Ò› º¡ß)›h ÓR°§àΑ/*µP;;€»[žȯ¨}È¿pÈð(( ` ö %.Æð‹.øê{«tº­€ñ)Òû9!½V‹ 8é‚à‚±Û!äð4dÃÂIñ"Ï"½p –$ð¸¢H€ÿsuЂ{r‚À Ñ «À0,”î ‚‘K/8X8`¥*”Ð,” x.a{ŸòŠƒˆ–-Xú‚œC`>˜°kh—³Š,Ї{(„i@†7‡r ‡@h pȇHT‹ýzƒ ë("¿°§8kÀ%2 )X7H'8 µ°¢ŠÀ ©-àSÅy9‘2Šå‚' ‰€óDÏA ûA¡yiŸÅ°ÄðƒiÐmȆa0\ðpØ-sqoˆ…]("¬Àˆ±‰yAÚ©/&¼œ8KÕèÂkjBµêØšÅp£ÿpܘªÐÕp "X û´3‚œˆîûŸ±Š'"P9€G™Ô†h€Çb@ðd°iIaûIŒ‹ø—çZ?P+eQÂVzÆPMÙ•fŒ€ƒ® ³¹ê•ÁZaæ²–8ë‚$˜ PËF)Ø'€¼X. 8™Ì†iˆ^˜Imxm†aÐ`°x܆T¬Àç*>›2)Ø@ÛÁ- #íHÅD‰¬ð)à🠞y9ýÂ¥”¡ @;3OÜîÓ²<@àKf@™D†l˜IgÐ…#8…l8i€Kg8*K€ƒ^17¼>µHÂÿ(!?y,ЂÐ=2Qü‘&è+pŒË[&(¾È@¤Ãغ¼Kºl@†bfIFˆÄ©JH‚-èѱßlB›J(âQ'…ЀÆ€¢‰øh¬sÉßa)lŠð´uL ¾œ†fàËlØ…š|Ëa˜†b K[ð(TA(0ˆ|Êù\ßT ’¼*ô³Š¥J­Ð y‘0ÙÙ!`s Ã[rú¨.…Sà…ÖœÉ]8k°l¸ËôœO…fxÇh0õ„ 'ȋę8Hµ°;)7c<â‘Мˆƒ¦x;Xω iiŒÿöQ’"(†ïŒGh€Gdà…šœ†Ø¼Að„ôœAx†gˆ…V8R™Ùȳ.¢}¦PF7Û³.¨‚ýˆ6ú ¤I¶î€ &@ø„X`P€„$•I\8…]Òº<Za°K™„?¨„P`²PP„龦x HB¥À®ˆ››Û¼•xFÜR€‚.ô‹B³‹±’HX….à^P…Pˆ…ÕfˆGVè„M˜…S˜U…Çl … @‘[ú‘²À¾9 °xMù,Ä>HE‰¦´!x`€¥7” ùìQ”Yà…w¬KfHUÀUÍYðBèÿ&@°ž4×kð…X<¥Æ&œ)P«z›ˆè±|U¯"5€ir’Ù 2»©ª\åVF†m€Çn¥K`èm †j¸ðbÈf¸P\x–€yJHˆƒ¨®¢©ÕA–µ ›Ìj Ê£éŠÆz®™ƒȾ¼œÉb°EHe¸™ìX €Å`„Exç€;TF¨‘ÓqÚƒ•U˜@?¿ÒW)(±”‰åñWŒjF1Û!ä¥оœSdX†i  Õeðƒ €4€þ)‘‚;$€!pÂ0„N脸ؼy+ÿ2-”PE½Íñ-‚»hŠñˆB¹ØPmØah†]ðNl†bˆÅb ™LŠ‚Ú5& ³‡‰@ÜS I„Eã„“ùÝ·zžÑªX⣷E*ËÏ(ۉةŠÂúR8`cˆj0†*Hˆ˜:ð^º”@L’õ=>03L„÷=c[‚P4N8©m’ ÀU{ƒ9hŠ5-83;ybŒÜFL8àR‰vzìš«ð:ðƒ(°F ªy9;@ x9LX´G¾¨ƒP Ი«©üðÕ6 €N?¡8§¦àÿÊàœ¤è*Xt!š‰h,RÑê 3§L’¶x‚X4CxB§xÅÍ 8ðÒ..°,ycðè)ÜÄÊÑK¹ñ‚(HÊÑUKNbé‚`=“H™.pßLpV ÐF &(?HÜÂMÏYÏå˜H䘒Šé‚ÀÐéHKv ñ‚Åíú5eMõÜVΉÈhŠ&`!΂3&ˆ«nä\§XŒñˆâlŒøTâ%¯ŠÜ¿)‚šs3Ì`áàåfnˆ Xs ((5$¿Q½÷¢ÙƬf³ó’‰$3ù‘9‰ € ‹©D¡yÊ“ãÿxÖú) ›’ˆÉ”v^¦À.ùÁøp Q!Ö#½§äÚGŒÌ¾ µê¨6FÜŠöù«”>ûí½ÊèEÑ9XX’|ú‡`êÐR‡€9ð Í*Û Öœnˆ˜9.7Ø\Ö*,¦¦¤7]¶Ò㡠ѱ Ý$…n™»hä‚’Ùá•Éa‡è*üEéB&àü"$›S’îcT-Ñé‚vŽkܠʬº¡¡'àÆÎëvÍ“&¹Zí Jô¡˜ÄX¾næýÉšyô“ÎŒCé…!(”ʽb«¾jÎv­Øº)ðAVÎŽ>ÌÄ Ê½jšâ1ʱ›í±ÐÈ–°t&î6c¨ìœHѦ Yè!1NÛƒ-ÐÈìoñoò‹€;ntp-4.2.6p5/html/pic/alice38.gif0000644000175000017500000002407010017034535015250 0ustar peterpeterGIF89až´ÕÇÇÇ VWªªª1/- _ RQ ýý˜˜˜ý wIE@ûˆˆˆ` ’ þþwwwggg§§ ÌÌ ±±VVV-´ ’‘ª Í ×× scR:9!/èè€mU““w{Unnÿÿÿµµµ½½½ÞÞÞç÷÷÷^VGscïïï­œ„ wwçƽƔŒŒcZcµµ½µ­­­µµ{z ZkZ.XRccs9|%„œœÿÿÿ!ù?,ž´ÿÀŸpH,ȤrÉlΨtJ­Z¯LâèJº‘K®Æå4À€ †' < ê‹oDÐj‚ƒVw&))\po()t &)„œžD˜ a)£ ‹(®®) xŸ¶·d}££« ’¯Ä‹ ¸ËÌK¿À˜ )£¯uį)( ›Íâ̪Р(5o ÃØÛó)v˜ãøŸç˜± pÞ`“‡BÛ6‚ÝTÊǰ ~'ÕÀA‚ 4k@¸† ¯˜ƒVjÏ7i­²Í[ÉMº…!c2¨à€¥;Xj̨Òÿ—d 5rFÌ¢Sç@H…I+Œu³b¨P6_ܸÛzŽÕ¾,ȃú´`ϲÅx@a¤¡ßÔˆt€ a%|ñ “f¥¢ \V^Š60ÛâbƒÉ:v¸pׂå\’ª!mÞFÁ,OõRÜ €ËdŠ2×P§Îº˜%ïúVóìXÂQ£º‚û‘ô§p;§…'À¦MK "óÅBÂDŠˆ‘%·F7zªzû&®ÇГ(àºJÁj »îŒ0˜0,j‡÷¼Ñ<ñv‡A°„š3f‹x `\~EÇu:íãÁ /X`{)L¤Ý}iL4ÀÞ¶ÍQ8ÿ)`0Jp€s8 †M=Áp‚ r­$€µPÈC`èžtvˆÀaà*Ô`âQÑaÔÆ7/¸øâw1Ò€j˜& ÔÓ1˜Ùd”4g4@ÅøÅ‚“N²Ò\öQ9ÄKì#Ö}Æ“+`æœevØ0©¼… 5 ¨À¦“s!ˆÂ> ÄéD( éC´uTÏ$ÜÔÍQg„zŒðø¢¡r ÿ4€Â¢,œˆsÀ¢Š?r†Ëh€£Ä%o¼â$²Ô“™‰aVƒƒsIRÏx5a Í#t§ pEàä.šcæw“ÀœÑÝ4c ÿÝaR—ê  ŠÈ00ôÖÃŽ ̽(Œ‡‰¢'<ä¢f,¼Ì"#™ éP@aæ)AkE’ñ]gÞy¯‘’A3Þ…·¦0RSO%æ 쀀.Þ50’6Ú4p€Ål1ÃrM(šÇdÎ&Á#Xt@E‚ô7¦0¢É)ª°‹0Î< ÷Å€ËBTœ“© Ô(ÈôÉÙ.ïP¶O}Åè¢/L :ŠÖ˜Ô€á /êâ  àâŒäÁà ¥ ßáBÔR¼ŠˆÄÉßðÛ@ÆM9©T“~³‰¹¿ÀÐ8Ç ÌæŠ ~Â( ‰xCŠ+>F¹z0âÿ 3/0îäxBAw~Àr`Ý«6¥8Y‡“ÀIàâ(«ºô:CÔ€Ø?”‹¦iw!AÓr´šŽ5 Ÿä" §~,{#ƒÀ‚âŠJ`úCo@:½-¾!Ì:û úeÊuˆ¤‡slbAîxç.4€`/XàÓx—§0)êN/`øXÐ:½`â~`L¤ˆ0€ðzÿ à½÷1L¨ŽM/(ß\Ô`MdT„ÔÊŽE© PüÒ ¹“-Ìô*(6a\ö²W1ó쬀-ü†7¿$âo£a7ó²Ö@|/,@ qpYWÖõýB ˜øz)ÿÃ[\¬È›p6<Á3¢‡z¸oQز€ ^öˆQœ1Ý B¬C¶Éë"óEÅ0$9U¤ycyqAæ4I5XËຉ„,HnèBT ‚Ìíg³C´s!\èòB“¤qŒôkC8LPêÖBn± RIÇ 4ã¼ómkZ‚‡ p¬Ðà/œvŠÔ,ØûÁÅäe½Ø *ÅÄPÅx%„×à,¥cÓɰ¦œSAú¾ÑšE¼ 2Éc /Ô1˜ãœø0M¯6q§œè›D¯øÇ5Ì#ŽtR»FN.,¨s,ðèºÐ…¼DbUÿÎy‘4×x‚¯<²“4’Á+½¨Ëõàš4pe½ñcPÁ(œéOh„óè蜩ô\hŠN¨‹NÁƆ²`¹:tQÓ3(7˜Æ&ŠòKiñ#,À-¡-FÀt üÆlðà.„ :ÀA™þ6€‚©€ É>za¦ID¢\׋€ÃñÆ^Hb4l¥¯ø »`Âov8¡0³Ã!jU¬†Là (/°H§’SèòGÓ×P iᇣFÙúDÊñãU>$í9L¤Èk…³[p¡5Âè6« =tR‘;Ljg |aKL‘ _Õ34ÿÙZ_6N! "ðbu¶¦–꜈ôÇÔåQpNë€ÃT¬½[1YÄ\Å+åhL™9ƒfé@3Iìe¿üÁÏîeÚEÅ—ƒÌ¹‹H]Ö¹¸ä³I…`‹b+ «»GH$6žaÎ¥ÎVaa 8 †€‚`¶t(µF2 ”&®5E÷//PQú ¾ ¿þªI7 Ρï\P‰Êt‹rÚ€W U#•£:SggØßFÕú‡òƒÄâÌ buv‚¥¤"a(£“´ÀÐõð·n pØapPƒE™‡´qÂÑm1«I›¦bAñ1…¡S=`nr¦“)ÿ& ‘p¾ÏIªÀsM›ƒÀÎ}-R¨€Æ\°d8ì¡`b ãP=3¹ñî^ P‡k(Ó/U °1S@ƒ ãÌ©]Œý¦¾òo,ègð¼ñÀò‘¢¥}eÏa¢ÌÏÈ%N)’¹ãÈkñ”áªhîÙ/Pç~½äZèX¶2èô_CitR¬ì›íi$x%ÆÖgÝ0wà‹iˆéTp3$H¦Ï‰=‚Âi›†KŒáÓ0æ”~a‰´˜º0pØF“ÄjçPÁ3½mG"¥¯„2‘F°¬X¹[P‚7l(û)B¹©¹.Ao6À:êRÕ¾p½mÒ4;ckÏxEÿ8h0`Mëx:&XÛE¡sÞ'Æ¿1ÁE€ÉþàÖ:"Õ‡$S.{ï­Pål_MÍ·øÒ øâkO Šº€iïR/Êc.èN¢<§€ÎQC[ÓœKëD¶@u-¢Ù†¿;— ¤9¥C§â‹. Ú„xʨKÁ,Îà’;psL£Ãøƒ(")OSõÜÐe<`^‹×v5T§–‹PîE²NŠöÐIv}áE[VÞñ õežVòË¡wÐû&Pö$Ë‹¼,}¨á°P¾t¸`¤@.£À¹½‹wép ½ð {w¿ (*`èð&ó“Äõ°F»·ÿÆW²§ErT[pI²#"£8~mç|†5r@S.23°2?(À/UÓ‚¡KH°âÃ[‹b"r8mpÝå&Jñj©ôôa 8Ãéðkûãqž…C¨ ÀÀã$¥3"Pç‚9¡ƒs-ØbÝq|'À±(p±1O¤3@ Ñ¢ ûã"(r¡*fòD®²EaA'à¶ä7‘¢P.ÂmÉ+Ô`Ky5(¬‘#™Ð ìfð“@SeR7ð ¡t¼V °,_dŽ! /Ó­ š%@l`).Üõ STXÓ>Äöxî¢Eÿ«@R491†5h‹2õ¤æ1cBÜÑ ˜€¬q ‹‚’ÑQ¾1åðFš€&""(/÷fè9  mZTˆóP1ƒÉàauÔ€U|¡g¨mð°H•È Ï€!L‘l®r—`xÇà2"Xèàh–ZÜRyÁÃ*Ã&ÕÖj¼˜¯f$9NN³dö!)ˆp/‚¬WHá2ÞaPõ2©)-7EyÓå¥=*žD#‡áŒoFZ¬ÒÀ¡vêž §Í€‡Ã «0G¡:¦‹»2<@Ñ$§ @âù|ÁaŒa9¦âI¡¤`2 –yOÁ9`§vZ6’!äh" dÞP‡¼…¢ìašè€Š" ¿`›—j‘ü`Œÿ¦<ÕÖŒj©p iY$ãe™9ÀÀ¬v:ùø ”’L–Â/|Ål1"6`"ú1Qy9OgðNé6¬ žÚvÌÁ<Û©“À*¬°¦î⬠{l4˜PPÊ:ýʬB†¢ª‰&p8¼5Gâ—¡°nD/Õ• pÐ<ºsRÓ®lUš¦+Ðúa!tNæÀʺ¬Ê:„Ÿ1ãÁF+'Ü#0 5ÑF®"î“Ö:w{¬Ãj$|$©‹è$¢P©ÂŠ©«PNîw4sB ¡º¬90üÚ¡°¤oÈ )ª @ÿão'Eˆ! mTax Þ Ëá± ð˜ê£QM¸æj˜pðJ¬—U9ñzBÀm˜Ð²IZÀvà 2#Œó(¼Å+´’uØ ´ø‹àp/F˨²v» RŽiM~óˆ!Û£#; ïà.„˜LùZ¹ã¸¢Ê¬ÐBôÚê k±Q_ƒfÝ0ŠF¥I ƒü°°°€û¥èðû³&'‘l"-ðz±ÐC ô‚ˆë¯[[ µ¢jÐ ÿ¼.Ð#@-sR 8Æb°?½PHå«®Àð{`ÀjZ 6‘Jˆ)<£¸ÿ»Zqo¦¤ º;_Š›?8¿Ð Ð:–ãÑï;ó$ Eá ŸrbPgQd´` ܨ$›#öÀ–zºÕ@4h.ÝQ§Œ«»Ïª¸p@ Ð ÐÐ’¡œD0õdk8x‘sg»€›Œ±wžÔ»T'2&P”¹ƒ´=*¸‘+:V§îiÁ훤?<À"0ÐÃËÇ.€L5y´E¤‹3l›h*¯g¼(/Px ƒ×k©¼# w<ïÕµ«¸ZqywO$³@Âd›ã4³ wƒ¬•ÐðŒÔ{ ×;ÆßÀ‚6K2 ¯Û£ÿxÃi¼6‚ýªÉ. §‚0R}Ñã‘®ÇĽ©Œ/p €µ¹ðŹšÊj »PI“@ÃÆtÚ¬-Ëa;#e«àõÛìÜÌ-´¦Ö°ÁŠ·Œ±çžàü1  Óº`Ð`±¶É9êÛUæŒ(ÀÛWÃ;ÖàÎÆWE¸l´,aL£ú\º ¯ñúSGq"zS¯ÁE+¯´é¥ ¬Ï0.0-€Ì³(Ñw6 ]z!°  Àª±‹<¬Ó¸9º]j©àÓ3 ¬±FËÒkÀ<½µyÏÐÁž€)Åã$œG‡ÓÿÀJ¡=íÓK¡œ´À`´ð¦0>]×!°ÑáùÅÒ+¾£P›Jhš×€,­uC¿šsÑ$Àƒ\› pÖ@ ¶)ÐQ-¯ËÊÀÊ·)¡Ü K]× à™žkJÖ] 0À´€ÐžÀm àÊùQò'»À29}+p g=Ú:m›)= ŒŠÙkÊ£âYw ¿]×@l±¬|“Ù¬,ÆWf~!c­´¿2 ìmaò4€; P×@È™}Õä ?}¡-Ú?MÚxË×· ¬3¼ý4òÒN@ÌI¦.ÑWO ” ="½ƒ} ßÿ?ß‘¤íËpŸ-ßüààn±À€ÜP#©Ê|5 îP< àsѺZ.0LÌà˜ÐÜþÞ¡jÐ\k§9ߢޣÍ-äpá£ý¡ƒÜ>ŠÐ v ˆ >ÀàÄ-Âp¼ó ‹Å @Š-µçÍÔFîÜ Àö‡ Ž;6þãAŽÞÞwýÛM}›ì-¡°uîUÎpA"‚$¬c&œpáÄÐÅ´¡” ™ÁâÌíÓ@îÙF:(ªKšÞaþÓ!ßéíp阰ṡÈFçúH]üÐ#ðL<¨LLÀ@è)®¾`ºæÿ‘íËíé@ݸ)$uª®7^×—î/_þÞ«m©~ûó(·àŸª.ÐÄO ÐÓ®0 è˜`½3\žkjÀ}ç½Üæ½ uŠ þ:ÇÎÔ£í㢭ÐÔæÍè—MÍÂ]ß<šE •uæßG Z²K óÅ@ ?ÀÛ×å î·9º _ÙÐðÙaÕÐÚîñ>ìó½ëLý·[ò¤p›<úÂõÔ †”ÃÌÌ…£±ÊðÄ Åä}ÈH^±ðŒÔAÚæ^ã  ïþê¸Êíé ¿˜ïmßËÝÒ— ž+ Í»g gÐ ˜Ä ¼•¢ƒщMÊÿ5ÏÎ  ™ ÝßÀ¯è«¤ ` BÏéÀÚfþ ŠôýØðnï˜àññ.Ù¯ÓÖ ÅPði•¤ö¢¼©œÀâ€N¶"¬Î OÃz@Ç£º¤¯ëñþÙpŸf>?ç äoñŽ~ã‘Ú^§òº ‹Ð ¬Áõ`:ÖYìÀ;åöã´­`ÏóÐ`ТjÁîyëEŽÞŸîùºî/<éÉò Ú¨? ¾\ýá!m=B"L´ÂÝ6Á+ü>Ì$»Ò~Ê! Å¯ØŠŽ Ü;D¬ñ<úžýã ½ÜMŽÆH -š¤ç˜,‘Q ñ²Ú`ÿÙDžʽH~?T¤†û h‘Tª!ÿR–ÚÑH½ñù|½¨hxF\@FZ<¨ˆ& r * &( 8690 ”¢4HBžŠ<¤4V‘„Šš¢†.dV°‡ ‡ÆjîR"Þâ‚„õ¦Ã@в³;@ ]Z:Qÿ8 8, r&.ÖÛs@BOÑÑe“D÷5ð§!`­?ü¼\ðBÀ0œ9ÅÞŒÁÂjÓøôÒöă½C- ðછک«Ä®;,Nà0"DÀ^~¡Ë' `ˆP£ˆ<À¢tà §D%ÿð ªÂeÃ`ðà S€ 317Í>¾ÐD "…Þº%¢`Ĉ”0B—cž¥ðÔå ™C·'f!ÀѪTw-2”è’"¶²DÕRõP 6(ü!AØd£Í*C‚ C<øq ˆŠÔRðAH®‡–:,â¡…‹{áµ{y)¹¦‰¡G¯íôT¨µDÆ*e*  N1„Wš¹ZCÂÈm 5Ö(¬Õ@!…‚hpDHëµH‡!Û°AÇÿ°IÀÀlž€‰v:¡©¢‹1ü¸@—<ˆ*4~8l€€¥¦Úl :ëì—‰†‰à*ˆ’fµ¬ÿ@ î¸è6j.j ‘ì²'@Q î Là7"4©é$ðÀƒ 8@Â)SHBôЖ]:Då®/3…‰6õ¸&,ÓÔËj n@!Í7îû€l\/Éœ†´—F(²H ‰èDÉL$h €Pè<ªd ³p6ì²ñĤªÄS !j`ެÔH!ÞT†¶7"Ú¯GȦ…¶È’áBI@."rx‡ƒ'ëiÀ¶ BÊJc¡O 8á¢dè̃O3ÌŽÃñ”Â`¨H,ñ‰˜AVk. >× 5…ÿÄ&­0hÐзâœá8Dâ ô„ž¡ÙžH‰ˆ¸Â*_Pá°;‰8€$ø¥3Ç,̸Cд€ìÔÎÊËX%˜™UjN¡˜ækH7,ºG@õl@XBˆû#¢ýìÀsÊÁ¦e³[§ÚˆU ¨-`Êl ³´±©(o H ·ËZDl×Ý'ˆà¢Áx•é™}¨A6‹ÿH€!–]D¥^²ëž¼ê†‚£œ! ˜‘¸x*l0ð€¥³àÃŒ=ø|*Ø& ;tòm©#dƒ×1ÐÛh‹ã‡hÅ0(|šµÿ Nxd7·–€3%"wzGà™ÄÚ"䆤SÁc à0ÆåìC, pÊB©ŠP¹»W¨fZ6ýT©©¾JE þ€Ž”/x)PÀàT¤+A”ÄX(ÇÂR°·(ÀàDJÖˆ„¢|ÂFüƒ ŒeÌs²«¥Ô `Ê*< ܲ°”-„‡2°Å¨•M…DXÀ€¤ *™±ÅMÉ >Í àPІ0ÍNäóþà¤o©€2Ç\`9Ù§`‘“À"( a *Cø`¶1D 5˜#ÿBã˜ë` 5ü$œ§6ª´ŽA$ÿSÚØ¨¡ `~P⽂熆p4ÿ‚C[|Óu ŽX˜ ¸,baŒ¼IDQ9¿ ¶±|8A ˜6¦“ÀݰÀ2¥°L3¸ßyþ ‹-¤­<«ÜBgdH¢A`V¶šMá0‡ßY€]¡I{í?ÐdJÆa4#u¤ÏA# a£üֱ̧q…'8Ü ^¡»Ì†l´!$F„Ž!B†•HüL§Ø˜Q) ‘ÍZôЀ­Ló_t¤Ë84Yb5¯ƒØ(¡¤‡,êuÐH”%¼A4ü=áC\+‚ølÁº]0€(ArȺM±n 2ð…»ÿ€r™~È0Õ"IT¡*¹aMGò`‡)Z’ $į0^ü§r“‹ÕÖ Æ^„ Ôä¯Hòª°t¨ëxj¡¦´®ˆ‹d†~ؾ í°sp[èpP¿-àºðP. °-y0Þ¿Ø09eeQOd‹7SâÁʹÅ.æHJ59„q8,B•Ÿ¸0 ­®­åÔëç:Ö]!fXadV§À>f~šYÁaÀÇ –Ü‚ãÙm°8…Èdvò2¹@áe`Üt`/ÀñT¢YÛZc†† o-"3µf!¶»¥Šð·/!1CÈ™qñËÿãX6«ƒ°˜}ô2§¡.ŽŽPrnr¨*©àÃ^¸jA†ÖéZB¶+]â…QIÞý‘x¬cñ‹6À0¥9úÔ(ËK°#¾ñ0”æ¥Àâuä—]tîCp]c §RÔØb)fAßzXHªöSÕI¨ëz -k¹'þ×E&',(—.ˆ@D^ÀHA²r8×iŸ6foð)…D ?€ì9ϵ֠ädºW©€ê· €Êg6PÔ\25€¸œT’Ä ¨@&]i#Å„}Lú°„) ¥•¥‹&±èÙý ôF#±ã“ÿls’9°/T)Þú 2[H$nW¿„Ê`¡5L›TîVÔ,¨-È‚>@ˆÕ¶6> é `Ã˸a€“Fay£P…xšJQ?msW” Ng…ÕY ä¬^2- /´¯µXbËœª\ƒwuSù–°Ph×i nÀ,mm‰C@¨€ÊzÑmý¡W»:Ú¼¥g9 º¥XÍj`òE|Œ)¯ËÍuçò¬ÔD†.ì„«ðø!Ѩ†–i`?´‚†&°ÉöQO—ï Ôž8Å€(-1ˆM§v @]ŽH†r YQjˆ¯hÞK‰=6¨°”´Àÿ.£åPPKtì…fá i ²Ÿ¾®‡>8=§ìýAü ¨t >ð©K]ñR¯t(Pm t­ÓÂà–lèÆC=lGª ˆKûé=¦&¬Ïª¤ÎñëB;5#Þ Ò¢Ð¹Öõ<ÇóÛOáͬ½@€ø d£Ñ•–ø´EPÄëIãÔ8œz75^‘}ÆŠ@°møÒS¼âðþRlpÞ¢RoBîٽؗì[Û”O}g©´p]ý<€éd£Ò–ÆtÏñb@ùH-¤!-x' "@4Ï.òBY ÇDàø¤ø2€Ò/ñOñ°é  ``aØÿHô-È<Äฤ<”I¶ZËTŽ Ààoeê~VképÛ2­é¤mÚ&®| R¢ù ¹Š„¢«ŠC>(°š®¤°ê*Íé¶O û Q†à34ŒDÖ%½há1X®rA™2#ah9Åõ–ΦΠoû @¢x>¸Ì¸îªïy¥.4)ù! à /ޝâ”/D@ •‹yðbsBc—ö­}b™VG ­ãv°`]8q38C\@Ê6ž ñb`¼Ï KϤð}`5ˆÐ"Ô‚z¼ní@¨P Ú&ï? ø¯ê,-òŽì&Ç«Ê!çX+*ž¢òÿJA€`fF$ ,L£!äExÖ¿RË ·m˜Ž Q«é,.âœ-WއÓà`,àÝŠãW¦Ž,®Ù,ôä0¨ƒìíT‚3,  0? âL„a¶lË:͸øDOE À! 2 {‘ò¨!?òà@ÐëÌ®hÈAP,ãpû> M b$+ŠgÞäò&-ɆÃñ(`ê°¡Úøùðò.M$8P =oD"€ó¼Î8@ˆÎ6ŠÒòO ÍQ@€HÀ| 5b'q$ÅÔãM$ |2ܯ$ôD$4Ê ò$.îÀNJ@ÿ`l¤&aR"F Mæ‰ÀÒ Òà²ô¼Oò¤PùàVÀRRµl.Åò- øÐ-û/Ñû‚IOâ2`„f”á+€>ShƒïËqâÌ2#³'—¦Û„AÒ€4PÏâ<3/Ò,’ñ_h xd±t£žM£&3½O -®ôz²+Gà5­­#ƒò<³ôœí ±ï$3#&Bµ€Q1²=o<>Î3µÒJ!@ = %‡ Ù¬°'w ®ÓNj ÿðÑé’/Üò+½Ï }©$øón@-æ#zS÷Ñÿ8S85:‰²@·ÿ¯"@B-@4§z1c¸Óð4ðÐà+;M^c`&RÒ8Ð0ñdG  ÏéàFÀ&=Å3ê¨P8ï/íÒúïI sâz²±œú&¢ r-ÓIi Î$@‡,²õê°7as.U¥Ñ¬Mù²&í3N1pñÌ´@­í¨)2#“5R`ÄÔ¸¬a7–.0Niš‡­ ä%>€«mÛ°Ï=1•û~“*”⦎ 5TÓb ÐéÂ1Û°«ðv“;%Ç+ø”3ÕƒÓñ6Ý4ñ‚5DµWÿef¾C8´V¥.PÜcpP@ÿ…RòGgõé±/Pê,M´L@F}µW…,à$€ôd\Æf¥p–á 2ÀZ…“ £óCò¼ïN5s?³ÚñÑz¡D·µ_qò1mÒ±èªÕZ]óN«Ž7)ÍÒœÕ@3tGoêŽÁ_)¶bñ€ Ìo8œŽU7¶qªòÒ-Nÿ@”ÁbQeë#cÍ/ñÞ"2ÌZÌ‚!òâ$iï 4½ìjW£g”µÉ ,b¤oy¦WƒbkÈvËp3F^DYwG6`5èc>ºQ-®Fh ÊÂlÀ,æ#pÇ’!N´a".—j}5µZd6Ä–Æ$À Wú2+FS`tÓ$&#÷j!sMòCx³â¸1s¯q"Øk—7þu"’¶ikåmCµM€!/VMcf×MT_^d.Ó$MÊÂpç#yÉBšvt±6_b$&Éàh›v"3@g›ü€{ûu Ì5\À,ô…k×`t÷6\¹etéC= o5¢ik@KA"27¬ö~™ÿ×M”¡¸.öE_kocbí–px‡w¶–4iå«!o‡tKõŠàz7?tí"mt÷c2NÖfñKŠèèwW¿úVåÄÀö2ðrÊ7Êbt³B€Ë´ÑÇ6+¨éd !àƒM,"¾t%·4ù7?¡ pVx’ËÔ£BGW‹±s$ó" êkq¦$úÖ"úöiõVo,"P|¦#SV®xoÓd>dÀÞEAWЇw>n@q䀀 þØkUÅ‚r£&bN4"tÆ,`ÄI”wÂÕŽƒÆÒ"h yyÇ4 ˜5†ÁUýEh'„¥Uv-j õö¥} ¦ÔÃhZ„ffrƒ[y‰ÉP܃ F×d çX¹‘eCF"€Pñ€u¡V›Õ¨œ,Ճ鹞íùžñ9ŸõyŸù¹ŸýÙ’‚;ntp-4.2.6p5/html/audio.html0000644000175000017500000003111111307651603014543 0ustar peterpeter Reference Clock Audio Drivers

    between "cv" and "clockvar" as with other synonyms. typo "helpl" -> "help". typo "apear" -> "appear" include/ntp_config.h@1.58 +2 -1 support ./configure --disable-saveconfig include/ntp_control.h@1.37 +2 -2 CTL_OP_DUMPCONFIG renamed CTL_OP_SAVECONFIG include/ntpd.h@1.131 +1 -1 expose cfg_tree_history as extern for ntp_control.c save_config() ntpd/ntp_config.c@1.210 +5 -1 support ./configure --disable-saveconfig ntpd/ntp_control.c@1.119 +101 -35 dump_config() renamed save_config() CTL_OP_DUMPCONFIG renamed CTL_OP_SAVECONFIG add "savedconfig" system variable containing last saveconfig filename support ./configure --disable-saveconfig log saveconfig failures and successes to syslog enforce "restrict ... nomodify" preventing ntpq :config, config-from-file, and saveconfig require authentication for saveconfig remove restrictions on saveconfig output directory, allow overwriting exiting files support "saveconfig ." to replace the startup configuration file allow strftime() format specifiers in saveconfig filename, such as "saveconfig ntp-%Y%m%d-%H%M%S.conf" ntpd/ntp_intres.c@1.65 +2 -2 clean up unreferenced local warnings ntpd/ntp_io.c@1.296 +1 -2 clean up unreferenced local warning ntpq/ntpq-subs.c@1.35 +21 -13 rename ntpq dumpcfg to saveconfig, require authentication ports/winnt/include/config.h@1.74.1.1 +1 -1 default to equivalent of --enable-saveconfig as with Unix warn on unreferenced local variables ports/winnt/ntpd/ntp_iocompletionport.c@1.49 +0 -2 remove unreferenced locals ChangeSet@1.1968.1.6, 2009-08-29 07:50:13-04:00, stenn@whimsy.udel.edu NTP_4_2_5P207 TAG: NTP_4_2_5P207 ChangeLog@1.413.1.5 +1 -0 NTP_4_2_5P207 ntpd/ntpd-opts.c@1.200 +2 -2 NTP_4_2_5P207 ntpd/ntpd-opts.h@1.200 +3 -3 NTP_4_2_5P207 ntpd/ntpd-opts.texi@1.198 +1 -1 NTP_4_2_5P207 ntpd/ntpd.1@1.198 +2 -2 NTP_4_2_5P207 ntpdc/ntpdc-opts.c@1.196 +2 -2 NTP_4_2_5P207 ntpdc/ntpdc-opts.h@1.196 +3 -3 NTP_4_2_5P207 ntpdc/ntpdc-opts.texi@1.195 +1 -1 NTP_4_2_5P207 ntpdc/ntpdc.1@1.195 +2 -2 NTP_4_2_5P207 ntpq/ntpq-opts.c@1.196 +2 -2 NTP_4_2_5P207 ntpq/ntpq-opts.h@1.196 +3 -3 NTP_4_2_5P207 ntpq/ntpq-opts.texi@1.195 +1 -1 NTP_4_2_5P207 ntpq/ntpq.1@1.195 +2 -2 NTP_4_2_5P207 ntpsnmpd/ntpsnmpd-opts.c@1.76 +2 -2 NTP_4_2_5P207 ntpsnmpd/ntpsnmpd-opts.h@1.76 +3 -3 NTP_4_2_5P207 ntpsnmpd/ntpsnmpd-opts.texi@1.76 +1 -1 NTP_4_2_5P207 ntpsnmpd/ntpsnmpd.1@1.76 +2 -2 NTP_4_2_5P207 packageinfo.sh@1.210 +1 -1 NTP_4_2_5P207 sntp/sntp-opts.c@1.70 +2 -2 NTP_4_2_5P207 sntp/sntp-opts.h@1.70 +3 -3 NTP_4_2_5P207 sntp/sntp-opts.texi@1.70 +1 -1 NTP_4_2_5P207 sntp/sntp.1@1.70 +2 -2 NTP_4_2_5P207 util/ntp-keygen-opts.c@1.199 +2 -2 NTP_4_2_5P207 util/ntp-keygen-opts.h@1.199 +3 -3 NTP_4_2_5P207 util/ntp-keygen-opts.texi@1.198 +1 -1 NTP_4_2_5P207 util/ntp-keygen.1@1.198 +2 -2 NTP_4_2_5P207 ChangeSet@1.1968.3.1, 2009-08-29 05:08:56-04:00, stenn@pogo.udel.edu [Bug 1293] add support for --disable-saveconfig to configure.ac configure.ac@1.450 +10 -0 [Bug 1293] add support for --disable-saveconfig to configure.ac ChangeSet@1.1968.2.1, 2009-08-28 07:40:42+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008. ChangeLog@1.413.2.1 +1 -0 [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008. ports/winnt/scripts/mkver.bat@1.11 +19 -24 support per-compiler build subdirs under winnt remove no-longer-needed support for getting version from version.m4 (packageinfo.sh has been used for some time) ports/winnt/vs2008/instsrv/instsrv.vcproj@1.4 +15 -15 [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008. ports/winnt/vs2008/instsrv/instsrv.vcproj@1.3 +0 -0 Rename: ports/winnt/vs2008/instsrv.vcproj -> ports/winnt/vs2008/instsrv/instsrv.vcproj ports/winnt/vs2008/instsrv.vcproj@1.2 +0 -0 Rename: ports/winnt/instsrv/instsrv.vcproj -> ports/winnt/vs2008/instsrv.vcproj ports/winnt/vs2008/libntp/libntp.vcproj@1.12.1.3 +150 -150 [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008. ports/winnt/vs2008/libntp/libntp.vcproj@1.12.1.2 +0 -0 Rename: ports/winnt/vs2008/libntp.vcproj -> ports/winnt/vs2008/libntp/libntp.vcproj ports/winnt/vs2008/libntp.vcproj@1.12.1.1 +0 -0 Rename: ports/winnt/libntp/libntp.vcproj -> ports/winnt/vs2008/libntp.vcproj ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.5 +27 -27 [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008. ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.4 +0 -0 Rename: ports/winnt/vs2008/ntp-keygen.vcproj -> ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj ports/winnt/vs2008/ntp-keygen.vcproj@1.3 +0 -0 Rename: ports/winnt/ntp-keygen/ntp-keygen.vcproj -> ports/winnt/vs2008/ntp-keygen.vcproj ports/winnt/vs2008/ntp.sln@1.3.1.1 +0 -0 Rename: ports/winnt/ntp.sln -> ports/winnt/vs2008/ntp.sln ports/winnt/vs2008/ntpd/ntpd.vcproj@1.12.1.3 +169 -169 [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008. ports/winnt/vs2008/ntpd/ntpd.vcproj@1.12.1.2 +0 -0 Rename: ports/winnt/vs2008/ntpd.vcproj -> ports/winnt/vs2008/ntpd/ntpd.vcproj ports/winnt/vs2008/ntpd.vcproj@1.12.1.1 +0 -0 Rename: ports/winnt/ntpd/ntpd.vcproj -> ports/winnt/vs2008/ntpd.vcproj ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.4.1.3 +35 -35 [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008. ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.4.1.2 +0 -0 Rename: ports/winnt/vs2008/ntpdate.vcproj -> ports/winnt/vs2008/ntpdate/ntpdate.vcproj ports/winnt/vs2008/ntpdate.vcproj@1.4.1.1 +0 -0 Rename: ports/winnt/ntpdate/ntpdate.vcproj -> ports/winnt/vs2008/ntpdate.vcproj ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.4.1.3 +26 -26 [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008. ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.4.1.2 +0 -0 Rename: ports/winnt/vs2008/ntpdc.vcproj -> ports/winnt/vs2008/ntpdc/ntpdc.vcproj ports/winnt/vs2008/ntpdc.vcproj@1.4.1.1 +0 -0 Rename: ports/winnt/ntpdc/ntpdc.vcproj -> ports/winnt/vs2008/ntpdc.vcproj ports/winnt/vs2008/ntpq/ntpq.vcproj@1.3.1.3 +25 -25 [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008. ports/winnt/vs2008/ntpq/ntpq.vcproj@1.3.1.2 +0 -0 Rename: ports/winnt/vs2008/ntpq.vcproj -> ports/winnt/vs2008/ntpq/ntpq.vcproj ports/winnt/vs2008/ntpq.vcproj@1.3.1.1 +0 -0 Rename: ports/winnt/ntpq/ntpq.vcproj -> ports/winnt/vs2008/ntpq.vcproj ChangeSet@1.1968.1.5, 2009-08-27 20:02:26+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1292] Minor Windows source tweaks for VC6-era SDK headers. From Martin Burnicki ChangeLog@1.413.1.4 +1 -0 [Bug 1292] Minor Windows source tweaks for VC6-era SDK headers. From Martin Burnicki ports/winnt/include/config.h@1.75 +3 -1 #include before for VC6 header compatibility unconditionally #define ISC_PLATFORM_HAVEIN6PKTINFO Thanks Martin Burnicki ports/winnt/libisc/interfaceiter.c@1.10 +2 -0 protect reference to sin6_scope_id with ISC_PLATFORM_HAVESCOPEID for VC6 SDK headers compatibility ChangeSet@1.1972, 2009-08-26 23:42:30-04:00, mayer@pogo.udel.edu Bug #1289 - separate compiler files for VS 2008 ports/winnt/instsrv/instsrv-VS2008.vcproj@1.1 +253 -0 Bug #1289 - separate compiler files for VS 2008 ports/winnt/instsrv/instsrv-VS2008.vcproj@1.0 +0 -0 ports/winnt/libntp/libntp-VS2008.vcproj@1.1 +2149 -0 Bug #1289 - separate compiler files for VS 2008 ports/winnt/libntp/libntp-VS2008.vcproj@1.0 +0 -0 ports/winnt/ntp-VS2008.sln@1.1 +71 -0 Bug #1289 - separate compiler files for VS 2008 ports/winnt/ntp-VS2008.sln@1.0 +0 -0 ports/winnt/ntp-keygen/ntp-keygen-VS2008.vcproj@1.1 +397 -0 Bug #1289 - separate compiler files for VS 2008 ports/winnt/ntp-keygen/ntp-keygen-VS2008.vcproj@1.0 +0 -0 ports/winnt/ntpd/ntpd-VS2008.vcproj@1.1 +2235 -0 Bug #1289 - separate compiler files for VS 2008 ports/winnt/ntpd/ntpd-VS2008.vcproj@1.0 +0 -0 ports/winnt/ntpdate/ntpdate-VS2008.vcproj@1.1 +357 -0 Bug #1289 - separate compiler files for VS 2008 ports/winnt/ntpdate/ntpdate-VS2008.vcproj@1.0 +0 -0 ports/winnt/ntpdc/ntpdc-VS2008.vcproj@1.1 +362 -0 Bug #1289 - separate compiler files for VS 2008 ports/winnt/ntpdc/ntpdc-VS2008.vcproj@1.0 +0 -0 ports/winnt/ntpq/ntpq-VS2008.vcproj@1.1 +352 -0 Bug #1289 - separate compiler files for VS 2008 ports/winnt/ntpq/ntpq-VS2008.vcproj@1.0 +0 -0 ChangeSet@1.1968.1.4, 2009-08-26 07:54:28-04:00, stenn@whimsy.udel.edu NTP_4_2_5P206 TAG: NTP_4_2_5P206 ChangeLog@1.413.1.3 +1 -0 NTP_4_2_5P206 ntpd/ntpd-opts.c@1.199 +2 -2 NTP_4_2_5P206 ntpd/ntpd-opts.h@1.199 +3 -3 NTP_4_2_5P206 ntpd/ntpd-opts.texi@1.197 +1 -1 NTP_4_2_5P206 ntpd/ntpd.1@1.197 +2 -2 NTP_4_2_5P206 ntpdc/ntpdc-opts.c@1.195 +2 -2 NTP_4_2_5P206 ntpdc/ntpdc-opts.h@1.195 +3 -3 NTP_4_2_5P206 ntpdc/ntpdc-opts.texi@1.194 +1 -1 NTP_4_2_5P206 ntpdc/ntpdc.1@1.194 +2 -2 NTP_4_2_5P206 ntpq/ntpq-opts.c@1.195 +2 -2 NTP_4_2_5P206 ntpq/ntpq-opts.h@1.195 +3 -3 NTP_4_2_5P206 ntpq/ntpq-opts.texi@1.194 +1 -1 NTP_4_2_5P206 ntpq/ntpq.1@1.194 +2 -2 NTP_4_2_5P206 ntpsnmpd/ntpsnmpd-opts.c@1.75 +2 -2 NTP_4_2_5P206 ntpsnmpd/ntpsnmpd-opts.h@1.75 +3 -3 NTP_4_2_5P206 ntpsnmpd/ntpsnmpd-opts.texi@1.75 +1 -1 NTP_4_2_5P206 ntpsnmpd/ntpsnmpd.1@1.75 +2 -2 NTP_4_2_5P206 packageinfo.sh@1.209 +1 -1 NTP_4_2_5P206 sntp/sntp-opts.c@1.69 +11 -11 NTP_4_2_5P206 sntp/sntp-opts.h@1.69 +6 -6 NTP_4_2_5P206 sntp/sntp-opts.texi@1.69 +11 -9 NTP_4_2_5P206 sntp/sntp.1@1.69 +15 -13 NTP_4_2_5P206 util/ntp-keygen-opts.c@1.198 +2 -2 NTP_4_2_5P206 util/ntp-keygen-opts.h@1.198 +3 -3 NTP_4_2_5P206 util/ntp-keygen-opts.texi@1.197 +1 -1 NTP_4_2_5P206 util/ntp-keygen.1@1.197 +2 -2 NTP_4_2_5P206 ChangeSet@1.1968.1.3, 2009-08-26 04:48:50-04:00, stenn@whimsy.udel.edu accopt.html typo fixes from Dave Mills ChangeLog@1.413.1.2 +1 -0 accopt.html typo fixes from Dave Mills html/accopt.html@1.32 +3 -3 accopt.html typo fixes from Dave Mills ChangeSet@1.1968.1.2, 2009-08-26 04:14:45-04:00, stenn@whimsy.udel.edu The 2nd fopen in write_kod_db() must be inside the block. From Dave Hart. sntp/kod_management.c@1.12 +16 -17 The 2nd fopen in write_kod_db() must be inside the block. From Dave Hart. ChangeSet@1.1968.1.1, 2009-08-26 00:48:46+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1283] default to remembering KoD in sntp clean up numerous sntp/kod_management.c bugs use all addresses resolved from each DNS name ChangeLog@1.413.1.1 +3 -0 [Bug 1283] default to remembering KoD in sntp. clean up numerous sntp/kod_management.c bugs. use all addresses resolved from each DNS name. configure.ac@1.449 +1 -1 change "permanent DNS errors" to "permanent DNS failures" to make it simpler to grep for errors in make.log libntp/emalloc.c@1.9 +22 -9 send emalloc() and friends fatal error messages to stderr as well as syslog ntpd/ntp_config.c@1.209 +6 -11 clean up unreferenced locals warnings in free_config_*() sntp/configure.ac@1.19 +1 -0 add NTP_DIR_SEP to define DIR_SEP (/ or \) sntp/crypto.c@1.8 +2 -2 malloc() -> emalloc() sntp/kod_management.c@1.11 +148 -142 KOD -> KoD Do not complain about KoD file format if it's named /dev/null change KoD field separator from colon to space to support IPv6 addresses save KoD file even if one wasn't loaded create directories if needed while writing KoD file clean up confusion over kod_db being an array of pointers or structs sntp/kod_management.h@1.7 +8 -9 use time_t for KoD timestamp instead of uint remove unused items sntp/main.c@1.18 +83 -68 [Bug 1283] default to remembering KoD in sntp use all addresses resolved from each DNS name add test code for KoD DB (disabled by #ifdef) resolve alloca() implicit decl warnings by eliminating its use don't treat pkt.refid as zero terminated, it's not sntp/netutils.c@1.3 +5 -5 malloc() -> emalloc() sntp/networking.c@1.24 +5 -5 malloc() -> emalloc() change default broadcast timeout from 60 to 68 since ntpd broadcasts every 64 seconds sntp/sntp-opts.def@1.11 +11 -17 Update --kod/-K descrip and doc use common copyright.def instead of explicit copyright block Update -b & -t descrip/doc to reflect change to 68 second timeout sntp/utilities.c@1.9 +8 -19 malloc() -> emalloc() use pointer cast instead of copy in pkt_output() sntp/utilities.h@1.7 +1 -0 include ntp_stdlib.h for emalloc() ChangeSet@1.1971, 2009-08-24 15:25:59-04:00, mayer@pogo.udel.edu Bug fixes 1289 and 1290 ChangeLog@1.414 +2 -0 Bug fixes 1289 and 1290 ntpd/refclock_oncore.c@1.79 +1 -1 [Bug 1290] use macro GETTIMEOFDAY instead of gettimeofday() ChangeSet@1.1970, 2009-08-24 15:19:05-04:00, mayer@pogo.udel.edu [Bug 1289] Fix compiler files for Windows ports/winnt/ntp-keygen/ntpkeygen.vcproj@1.1 +376 -0 keygen file ports/winnt/ntp-keygen/ntpkeygen.vcproj@1.0 +0 -0 ChangeSet@1.1969, 2009-08-24 15:14:02-04:00, mayer@pogo.udel.edu [Bug 1289] Fix compiler files for Windows ports/winnt/libntp/libntp.dsp@1.37 +4 -0 [Bug 1289] Fix compiler files for Windows ports/winnt/libntp/libntp.vcproj@1.13 +148 -47 [Bug 1289] Fix compiler files for Windows ports/winnt/ntp-keygen/ntpkeygen.dsp@1.13 +0 -4 [Bug 1289] Fix compiler files for Windows ports/winnt/ntp.sln@1.4 +43 -46 [Bug 1289] Fix compiler files for Windows ports/winnt/ntpd/ntpd.dsp@1.33 +0 -4 [Bug 1289] Fix compiler files for Windows ports/winnt/ntpd/ntpd.vcproj@1.13 +119 -117 [Bug 1289] Fix compiler files for Windows ports/winnt/ntpdate/ntpdate.dsp@1.17 +0 -4 [Bug 1289] Fix compiler files for Windows ports/winnt/ntpdate/ntpdate.vcproj@1.5 +20 -85 [Bug 1289] Fix compiler files for Windows ports/winnt/ntpdc/ntpdc.dsp@1.20 +0 -4 [Bug 1289] Fix compiler files for Windows ports/winnt/ntpdc/ntpdc.vcproj@1.5 +20 -46 [Bug 1289] Fix compiler files for Windows ports/winnt/ntpq/ntpq.dsp@1.21 +0 -4 [Bug 1289] Fix compiler files for Windows ports/winnt/ntpq/ntpq.vcproj@1.4 +20 -36 [Bug 1289] Fix compiler files for Windows ChangeSet@1.1968, 2009-08-18 07:50:08-04:00, stenn@whimsy.udel.edu NTP_4_2_5P205 TAG: NTP_4_2_5P205 ChangeLog@1.413 +1 -0 NTP_4_2_5P205 ntpd/ntpd-opts.c@1.198 +2 -2 NTP_4_2_5P205 ntpd/ntpd-opts.h@1.198 +3 -3 NTP_4_2_5P205 ntpd/ntpd-opts.texi@1.196 +1 -1 NTP_4_2_5P205 ntpd/ntpd.1@1.196 +2 -2 NTP_4_2_5P205 ntpdc/ntpdc-opts.c@1.194 +2 -2 NTP_4_2_5P205 ntpdc/ntpdc-opts.h@1.194 +3 -3 NTP_4_2_5P205 ntpdc/ntpdc-opts.texi@1.193 +1 -1 NTP_4_2_5P205 ntpdc/ntpdc.1@1.193 +2 -2 NTP_4_2_5P205 ntpq/ntpq-opts.c@1.194 +2 -2 NTP_4_2_5P205 ntpq/ntpq-opts.h@1.194 +3 -3 NTP_4_2_5P205 ntpq/ntpq-opts.texi@1.193 +1 -1 NTP_4_2_5P205 ntpq/ntpq.1@1.193 +2 -2 NTP_4_2_5P205 ntpsnmpd/ntpsnmpd-opts.c@1.74 +2 -2 NTP_4_2_5P205 ntpsnmpd/ntpsnmpd-opts.h@1.74 +3 -3 NTP_4_2_5P205 ntpsnmpd/ntpsnmpd-opts.texi@1.74 +1 -1 NTP_4_2_5P205 ntpsnmpd/ntpsnmpd.1@1.74 +2 -2 NTP_4_2_5P205 packageinfo.sh@1.208 +1 -1 NTP_4_2_5P205 sntp/sntp-opts.c@1.68 +2 -2 NTP_4_2_5P205 sntp/sntp-opts.h@1.68 +3 -3 NTP_4_2_5P205 sntp/sntp-opts.texi@1.68 +1 -1 NTP_4_2_5P205 sntp/sntp.1@1.68 +2 -2 NTP_4_2_5P205 util/ntp-keygen-opts.c@1.197 +2 -2 NTP_4_2_5P205 util/ntp-keygen-opts.h@1.197 +3 -3 NTP_4_2_5P205 util/ntp-keygen-opts.texi@1.196 +1 -1 NTP_4_2_5P205 util/ntp-keygen.1@1.196 +2 -2 NTP_4_2_5P205 ChangeSet@1.1967, 2009-08-18 02:18:21-04:00, stenn@whimsy.udel.edu accopt.html typo fixes from Dave Mills ChangeLog@1.412 +1 -0 accopt.html typo fixes from Dave Mills html/accopt.html@1.31 +7 -11 accopt.html typo fixes from Dave Mills ChangeSet@1.1966, 2009-08-18 05:05:46+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1285] Log ntpq :config/config-from-file events. ChangeLog@1.411 +1 -0 [Bug 1285] Log ntpq :config/config-from-file events. include/ntp_config.h@1.57 +1 -1 provide source address to config_remotely ntpd/ntp_config.c@1.208 +17 -1 Log source of each dumpcfg section (startup config or ntpq) ntpd/ntp_control.c@1.118 +52 -30 [Bug 1285] Log ntpq :config/config-from-file events. ntpq/ntpq-subs.c@1.34 +11 -2 display each line while sending in ntpq config-from-file ChangeSet@1.1965, 2009-08-17 16:32:18+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1286] dumpcfg omits statsdir, mangles filegen ChangeLog@1.410 +1 -0 [Bug 1286] dumpcfg omits statsdir, mangles filegen ntpd/ntp_config.c@1.207 +425 -432 [Bug 1286] dumpcfg omits statsdir, mangles filegen rearrange dump output to group related items, come closer to examples ChangeSet@1.1964, 2009-08-17 07:50:54-04:00, stenn@whimsy.udel.edu NTP_4_2_5P204 TAG: NTP_4_2_5P204 ChangeLog@1.409 +1 -0 NTP_4_2_5P204 ntpd/ntpd-opts.c@1.197 +2 -2 NTP_4_2_5P204 ntpd/ntpd-opts.h@1.197 +3 -3 NTP_4_2_5P204 ntpd/ntpd-opts.texi@1.195 +1 -1 NTP_4_2_5P204 ntpd/ntpd.1@1.195 +2 -2 NTP_4_2_5P204 ntpdc/ntpdc-opts.c@1.193 +2 -2 NTP_4_2_5P204 ntpdc/ntpdc-opts.h@1.193 +3 -3 NTP_4_2_5P204 ntpdc/ntpdc-opts.texi@1.192 +1 -1 NTP_4_2_5P204 ntpdc/ntpdc.1@1.192 +2 -2 NTP_4_2_5P204 ntpq/ntpq-opts.c@1.193 +2 -2 NTP_4_2_5P204 ntpq/ntpq-opts.h@1.193 +3 -3 NTP_4_2_5P204 ntpq/ntpq-opts.texi@1.192 +1 -1 NTP_4_2_5P204 ntpq/ntpq.1@1.192 +2 -2 NTP_4_2_5P204 ntpsnmpd/ntpsnmpd-opts.c@1.73 +2 -2 NTP_4_2_5P204 ntpsnmpd/ntpsnmpd-opts.h@1.73 +3 -3 NTP_4_2_5P204 ntpsnmpd/ntpsnmpd-opts.texi@1.73 +1 -1 NTP_4_2_5P204 ntpsnmpd/ntpsnmpd.1@1.73 +2 -2 NTP_4_2_5P204 packageinfo.sh@1.207 +1 -1 NTP_4_2_5P204 sntp/sntp-opts.c@1.67 +2 -2 NTP_4_2_5P204 sntp/sntp-opts.h@1.67 +3 -3 NTP_4_2_5P204 sntp/sntp-opts.texi@1.67 +1 -1 NTP_4_2_5P204 sntp/sntp.1@1.67 +2 -2 NTP_4_2_5P204 util/ntp-keygen-opts.c@1.196 +2 -2 NTP_4_2_5P204 util/ntp-keygen-opts.h@1.196 +3 -3 NTP_4_2_5P204 util/ntp-keygen-opts.texi@1.195 +1 -1 NTP_4_2_5P204 util/ntp-keygen.1@1.195 +2 -2 NTP_4_2_5P204 ChangeSet@1.1963, 2009-08-17 03:07:26+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1284] infinite loop in ntpd dumping more than one trustedkey use free_config_*() routines at exit on DEBUG builds to free config tree and expose remaining leaks ChangeLog@1.408 +1 -0 [Bug 1284] infinite loop in ntpd dumping more than one trustedkey ntpd/ntp_config.c@1.206 +55 -10 [Bug 1284] infinite loop in ntpd dumping more than one trustedkey use free_config_*() routines at exit on DEBUG builds to free config tree and expose remaining leaks ChangeSet@1.1962, 2009-08-16 20:53:29-04:00, stenn@whimsy.udel.edu NTP_4_2_5P203 TAG: NTP_4_2_5P203 ChangeLog@1.407 +1 -0 NTP_4_2_5P203 ntpd/ntpd-opts.c@1.196 +2 -2 NTP_4_2_5P203 ntpd/ntpd-opts.h@1.196 +3 -3 NTP_4_2_5P203 ntpd/ntpd-opts.texi@1.194 +1 -1 NTP_4_2_5P203 ntpd/ntpd.1@1.194 +2 -2 NTP_4_2_5P203 ntpdc/ntpdc-opts.c@1.192 +2 -2 NTP_4_2_5P203 ntpdc/ntpdc-opts.h@1.192 +3 -3 NTP_4_2_5P203 ntpdc/ntpdc-opts.texi@1.191 +1 -1 NTP_4_2_5P203 ntpdc/ntpdc.1@1.191 +2 -2 NTP_4_2_5P203 ntpq/ntpq-opts.c@1.192 +2 -2 NTP_4_2_5P203 ntpq/ntpq-opts.h@1.192 +3 -3 NTP_4_2_5P203 ntpq/ntpq-opts.texi@1.191 +1 -1 NTP_4_2_5P203 ntpq/ntpq.1@1.191 +2 -2 NTP_4_2_5P203 ntpsnmpd/ntpsnmpd-opts.c@1.72 +2 -2 NTP_4_2_5P203 ntpsnmpd/ntpsnmpd-opts.h@1.72 +3 -3 NTP_4_2_5P203 ntpsnmpd/ntpsnmpd-opts.texi@1.72 +1 -1 NTP_4_2_5P203 ntpsnmpd/ntpsnmpd.1@1.72 +2 -2 NTP_4_2_5P203 packageinfo.sh@1.206 +1 -1 NTP_4_2_5P203 sntp/sntp-opts.c@1.66 +2 -2 NTP_4_2_5P203 sntp/sntp-opts.h@1.66 +3 -3 NTP_4_2_5P203 sntp/sntp-opts.texi@1.66 +1 -1 NTP_4_2_5P203 sntp/sntp.1@1.66 +2 -2 NTP_4_2_5P203 util/ntp-keygen-opts.c@1.195 +2 -2 NTP_4_2_5P203 util/ntp-keygen-opts.h@1.195 +3 -3 NTP_4_2_5P203 util/ntp-keygen-opts.texi@1.194 +1 -1 NTP_4_2_5P203 util/ntp-keygen.1@1.194 +2 -2 NTP_4_2_5P203 ChangeSet@1.1961, 2009-08-16 17:41:19+00:00, davehart@shiny.ad.hartbrothers.com Add extra heap-checking calls to atexit-invoked routines dump -4 and -6 switches to server/peer use %g printf format instead of %f to trim uninformative zeros switch enable/disable dumper to correct oddball identifiers Do not free in-use receive buffers at exit to avoid race for now ntpd/ntp_config.c@1.205 +77 -114 Add extra heap-checking calls to atexit-invoked routines dump -4 and -6 switches to server/peer use %g printf format instead of %f to trim uninformative zeros switch enable/disable dumper to correct oddball identifiers ntpd/ntp_util.c@1.74 +7 -0 Add extra heap-checking calls to atexit-invoked routines ports/winnt/ntpd/ntp_iocompletionport.c@1.48 +15 -1 Do not free in-use receive buffers at exit to avoid race for now Add extra heap-checking calls to atexit-invoked routines ChangeSet@1.1960, 2009-08-16 14:08:44+00:00, hart@pogo.udel.edu ntp_control.c: include for S_IRUSR, S_IWUSR ntpd/ntp_control.c@1.117 +1 -0 include for S_IRUSR, S_IWUSR ChangeSet@1.1959, 2009-08-16 13:59:26+00:00, davehart@shiny.ad.hartbrothers.com ntpq -c "dumpcfg ntp.conf.out" works ok for me now include/ntp_config.h@1.56 +4 -4 rename config_tree.prior to link to reflect use ntpd/ntp_config.c@1.204 +139 -118 correct merge with ntp-dev regarding default_ntp_signd_socket rename config_tree.prior to link to reflect use dump keysdir, keys, trustedkey, requestkey, controlkey collapse multiple manycastserver, multicastclient lines to one each correct tinker, tos, restrict dump code to use oddball identifiers fix ntpq :config (process correct config tree) ntpd/ntp_control.c@1.116 +6 -3 use macros for open() perm bits, different values on Windows ChangeSet@1.1958, 2009-08-16 09:38:50+00:00, davehart@shiny.ad.hartbrothers.com add dumpcfg ChangeLog entry fix unix build ChangeLog@1.406 +1 -0 Add ntpq -c dumpcfg, Google Summer of Code project of Max Kuehn ntpd/ntp_control.c@1.115 +1 -1 no MAX_PATH on unix apparently ChangeSet@1.1957, 2009-08-16 09:31:04+00:00, hart@pogo.udel.edu ntp_parser.h, ntp_parser.c: Bison products ntpd/ntp_parser.c@1.41 +950 -960 Bison products ntpd/ntp_parser.h@1.24 +133 -135 Bison products ChangeSet@1.1956, 2009-08-16 09:14:30+00:00, davehart@shiny.ad.hartbrothers.com ntp_config.c: use correct union member not union itself ntpd/ntp_config.c@1.203 +2 -2 use correct union member not union itself ChangeSet@1.1955, 2009-08-16 09:10:06+00:00, davehart@shiny.ad.hartbrothers.com preserve peer options queue for dumper remove remnants of "broadcastclient novolley" dump correct peer keywords (server, pool, etc) dump peer options (minpoll, iburst, etc) quote dumped filenames (better to do so only if needed) dump only to /var/tmp (unix) or %TEMP% (windows) directories create dump file with 0600 (owner-only) permission include/ntp_config.h@1.55 +1 -5 preserve peer options queue for dumper remove remnants of "broadcastclient novolley" ntpd/ntp_config.c@1.202 +152 -28 preserve peer options queue for dumper remove remnants of "broadcastclient novolley" dump correct peer keywords (server, pool, etc) dump peer options (minpoll, iburst, etc) quote dumped filenames (better to do so only if needed) ntpd/ntp_control.c@1.114 +27 -10 dump only to /var/tmp (unix) or %TEMP% (windows) directories create dump file with 0600 (owner-only) permission ntpd/ntp_parser.y@1.36 +1 -4 remove remnants of "broadcastclient novolley" ports/winnt/include/config.h@1.74 +1 -1 comment only ChangeSet@1.1954, 2009-08-16 04:45:36+00:00, davehart@shiny.ad.hartbrothers.com more ntp_config.c merge cleanup ntpd/ntp_config.c@1.201 +4 -4 more merge cleanup ChangeSet@1.1877.3.11, 2009-08-16 02:58:43+00:00, davehart@shiny.ad.hartbrothers.com add default: cases to config dumper switch statements move variable declarations ahead of code for C compliance use sizeof(buf) not hardcoded constants ntpd/ntp_config.c@1.193.1.8 +164 -82 move variable declarations before code for C compliance add default: cases to config dumper switch statements ntpd/ntp_control.c@1.110.1.3 +9 -10 use sizeof(buf) not hardcoded constants ntpq/ntpq-subs.c@1.30.1.3 +1 -3 remove unused local a ChangeSet@1.1877.3.10, 2009-08-16 02:47:29+09:00, Amidamaru@yumi.mxiesoft.com ntp_config.h: Added source and timestamp to the config_tree structure include/ntp_config.h@1.52.1.4 +9 -0 Added source and timestamp to the config_tree structure ChangeSet@1.1877.3.9, 2009-08-15 02:15:30+09:00, Amidamaru@yumi.mxiesoft.com ntp_control.c: Handling the dumpfile argument of the dumpcfg command ntp_config.c: Config dumper: Combined the server and fudge output ntpq-subs.c: Added the dumpfile argument to the dumpcfg command ntpd/ntp_config.c@1.193.1.7 +38 -5 Config dumper: Combined the server and fudge output ntpd/ntp_control.c@1.110.1.2 +13 -2 Handling the dumpfile argument of the dumpcfg command ntpq/ntpq-subs.c@1.30.1.2 +12 -13 Added the dumpfile argument to the dumpcfg command ChangeSet@1.1952, 2009-08-14 07:51:00-04:00, stenn@whimsy.udel.edu NTP_4_2_5P202 TAG: NTP_4_2_5P202 ChangeLog@1.405 +1 -0 NTP_4_2_5P202 ntpd/ntpd-opts.c@1.195 +2 -2 NTP_4_2_5P202 ntpd/ntpd-opts.h@1.195 +3 -3 NTP_4_2_5P202 ntpd/ntpd-opts.texi@1.193 +1 -1 NTP_4_2_5P202 ntpd/ntpd.1@1.193 +2 -2 NTP_4_2_5P202 ntpdc/ntpdc-opts.c@1.191 +2 -2 NTP_4_2_5P202 ntpdc/ntpdc-opts.h@1.191 +3 -3 NTP_4_2_5P202 ntpdc/ntpdc-opts.texi@1.190 +1 -1 NTP_4_2_5P202 ntpdc/ntpdc.1@1.190 +2 -2 NTP_4_2_5P202 ntpq/ntpq-opts.c@1.191 +2 -2 NTP_4_2_5P202 ntpq/ntpq-opts.h@1.191 +3 -3 NTP_4_2_5P202 ntpq/ntpq-opts.texi@1.190 +1 -1 NTP_4_2_5P202 ntpq/ntpq.1@1.190 +2 -2 NTP_4_2_5P202 ntpsnmpd/ntpsnmpd-opts.c@1.71 +2 -2 NTP_4_2_5P202 ntpsnmpd/ntpsnmpd-opts.h@1.71 +3 -3 NTP_4_2_5P202 ntpsnmpd/ntpsnmpd-opts.texi@1.71 +1 -1 NTP_4_2_5P202 ntpsnmpd/ntpsnmpd.1@1.71 +2 -2 NTP_4_2_5P202 packageinfo.sh@1.205 +1 -1 NTP_4_2_5P202 sntp/sntp-opts.c@1.65 +2 -2 NTP_4_2_5P202 sntp/sntp-opts.h@1.65 +3 -3 NTP_4_2_5P202 sntp/sntp-opts.texi@1.65 +1 -1 NTP_4_2_5P202 sntp/sntp.1@1.65 +2 -2 NTP_4_2_5P202 util/ntp-keygen-opts.c@1.194 +2 -2 NTP_4_2_5P202 util/ntp-keygen-opts.h@1.194 +3 -3 NTP_4_2_5P202 util/ntp-keygen-opts.texi@1.193 +1 -1 NTP_4_2_5P202 util/ntp-keygen.1@1.193 +2 -2 NTP_4_2_5P202 ChangeSet@1.1951, 2009-08-13 16:27:44-04:00, stenn@whimsy.udel.edu install the binary and man page for sntp ChangeLog@1.404 +1 -0 install the binary and man page for sntp sntp/Makefile.am@1.10 +7 -11 install the binary and man page for sntp ChangeSet@1.1950, 2009-08-13 07:57:57-04:00, stenn@whimsy.udel.edu NTP_4_2_5P201 TAG: NTP_4_2_5P201 ChangeLog@1.403 +1 -0 NTP_4_2_5P201 ntpd/ntpd-opts.c@1.194 +2 -2 NTP_4_2_5P201 ntpd/ntpd-opts.h@1.194 +3 -3 NTP_4_2_5P201 ntpd/ntpd-opts.texi@1.192 +1 -1 NTP_4_2_5P201 ntpd/ntpd.1@1.192 +2 -2 NTP_4_2_5P201 ntpdc/ntpdc-opts.c@1.190 +2 -2 NTP_4_2_5P201 ntpdc/ntpdc-opts.h@1.190 +3 -3 NTP_4_2_5P201 ntpdc/ntpdc-opts.texi@1.189 +1 -1 NTP_4_2_5P201 ntpdc/ntpdc.1@1.189 +2 -2 NTP_4_2_5P201 ntpq/ntpq-opts.c@1.190 +2 -2 NTP_4_2_5P201 ntpq/ntpq-opts.h@1.190 +3 -3 NTP_4_2_5P201 ntpq/ntpq-opts.texi@1.189 +1 -1 NTP_4_2_5P201 ntpq/ntpq.1@1.189 +2 -2 NTP_4_2_5P201 ntpsnmpd/ntpsnmpd-opts.c@1.70 +2 -2 NTP_4_2_5P201 ntpsnmpd/ntpsnmpd-opts.h@1.70 +3 -3 NTP_4_2_5P201 ntpsnmpd/ntpsnmpd-opts.texi@1.70 +1 -1 NTP_4_2_5P201 ntpsnmpd/ntpsnmpd.1@1.70 +2 -2 NTP_4_2_5P201 packageinfo.sh@1.204 +1 -1 NTP_4_2_5P201 sntp/sntp-opts.c@1.64 +1 -1 NTP_4_2_5P201 sntp/sntp-opts.h@1.64 +1 -1 NTP_4_2_5P201 sntp/sntp-opts.texi@1.64 +1 -1 NTP_4_2_5P201 sntp/sntp.1@1.64 +2 -2 NTP_4_2_5P201 util/ntp-keygen-opts.c@1.193 +2 -2 NTP_4_2_5P201 util/ntp-keygen-opts.h@1.193 +3 -3 NTP_4_2_5P201 util/ntp-keygen-opts.texi@1.192 +1 -1 NTP_4_2_5P201 util/ntp-keygen.1@1.192 +2 -2 NTP_4_2_5P201 ChangeSet@1.1947.1.1, 2009-08-12 07:57:54-04:00, stenn@whimsy.udel.edu NTP_4_2_5P200 TAG: NTP_4_2_5P200 ChangeLog@1.400.1.1 +1 -0 NTP_4_2_5P200 gsoc_sntp/sntp-opts.c@1.61.1.1 +2 -2 NTP_4_2_5P200 gsoc_sntp/sntp-opts.h@1.61.1.1 +3 -3 NTP_4_2_5P200 gsoc_sntp/sntp-opts.texi@1.61.1.1 +1 -1 NTP_4_2_5P200 gsoc_sntp/sntp.1@1.61.1.1 +2 -2 NTP_4_2_5P200 ntpd/ntpd-opts.c@1.193 +2 -2 NTP_4_2_5P200 ntpd/ntpd-opts.h@1.193 +3 -3 NTP_4_2_5P200 ntpd/ntpd-opts.texi@1.191 +1 -1 NTP_4_2_5P200 ntpd/ntpd.1@1.191 +2 -2 NTP_4_2_5P200 ntpdc/ntpdc-opts.c@1.189 +2 -2 NTP_4_2_5P200 ntpdc/ntpdc-opts.h@1.189 +3 -3 NTP_4_2_5P200 ntpdc/ntpdc-opts.texi@1.188 +1 -1 NTP_4_2_5P200 ntpdc/ntpdc.1@1.188 +2 -2 NTP_4_2_5P200 ntpq/ntpq-opts.c@1.189 +2 -2 NTP_4_2_5P200 ntpq/ntpq-opts.h@1.189 +3 -3 NTP_4_2_5P200 ntpq/ntpq-opts.texi@1.188 +1 -1 NTP_4_2_5P200 ntpq/ntpq.1@1.188 +2 -2 NTP_4_2_5P200 ntpsnmpd/ntpsnmpd-opts.c@1.69 +2 -2 NTP_4_2_5P200 ntpsnmpd/ntpsnmpd-opts.h@1.69 +3 -3 NTP_4_2_5P200 ntpsnmpd/ntpsnmpd-opts.texi@1.69 +1 -1 NTP_4_2_5P200 ntpsnmpd/ntpsnmpd.1@1.69 +2 -2 NTP_4_2_5P200 packageinfo.sh@1.203 +1 -1 NTP_4_2_5P200 sntp/sntp-opts.c@1.188.1.1 +2 -2 NTP_4_2_5P200 sntp/sntp-opts.h@1.188.1.1 +3 -3 NTP_4_2_5P200 sntp/sntp-opts.texi@1.187.1.1 +1 -1 NTP_4_2_5P200 sntp/sntp.1@1.187.1.1 +2 -2 NTP_4_2_5P200 util/ntp-keygen-opts.c@1.192 +2 -2 NTP_4_2_5P200 util/ntp-keygen-opts.h@1.192 +3 -3 NTP_4_2_5P200 util/ntp-keygen-opts.texi@1.191 +1 -1 NTP_4_2_5P200 util/ntp-keygen.1@1.191 +2 -2 NTP_4_2_5P200 ChangeSet@1.1948, 2009-08-12 07:09:37-04:00, stenn@whimsy.udel.edu sntp: out with the old, in with the new .point-changed-filelist@1.6 +0 -4 sntp: out with the old, in with the new BitKeeper/deleted/.del-COPYING.gplv3@1.2 +0 -0 Delete: sntp/libopts/COPYING.gplv3 BitKeeper/deleted/.del-COPYING.lgplv3@1.2 +0 -0 Delete: sntp/libopts/COPYING.lgplv3 BitKeeper/deleted/.del-COPYING.mbsd~dfd1a50aaa7f1a01@1.2 +0 -0 Delete: sntp/libopts/COPYING.mbsd BitKeeper/deleted/.del-COPYRIGHT@1.3 +0 -0 Delete: sntp/COPYRIGHT BitKeeper/deleted/.del-MakeDefs.inc~f7b11e92a11b82c@1.2 +0 -0 Delete: sntp/libopts/MakeDefs.inc BitKeeper/deleted/.del-Makefile.am~7eb131bb540e19f2@1.26 +0 -0 Delete: sntp/Makefile.am BitKeeper/deleted/.del-Makefile.am~84a984572db47579@1.2 +0 -0 Delete: sntp/libopts/Makefile.am BitKeeper/deleted/.del-Mf@1.2 +0 -0 Delete: sntp/Mf BitKeeper/deleted/.del-README~9ce987ed19d4905a@1.3 +0 -0 Delete: sntp/README BitKeeper/deleted/.del-README~cb95e57599607dd8@1.3 +0 -0 Delete: sntp/libopts/README BitKeeper/deleted/.del-RFC2030.TXT@1.2 +0 -0 Delete: sntp/RFC2030.TXT BitKeeper/deleted/.del-RFC4330.TXT@1.2 +0 -0 Delete: sntp/RFC4330.TXT BitKeeper/deleted/.del-ag-char-map.h@1.5 +0 -0 Delete: sntp/libopts/ag-char-map.h BitKeeper/deleted/.del-autoopts.c~524f4366bd5298d@1.4 +0 -0 Delete: sntp/libopts/autoopts.c BitKeeper/deleted/.del-autoopts.h~8da4370be20d3b14@1.4 +0 -0 Delete: sntp/libopts/autoopts.h BitKeeper/deleted/.del-boolean.c~b7c57a2b81d3da1d@1.4 +0 -0 Delete: sntp/libopts/boolean.c BitKeeper/deleted/.del-compat.h~e2f82823ab217382@1.4 +0 -0 Delete: sntp/libopts/compat/compat.h BitKeeper/deleted/.del-configfile.c~107d2e38a77fa938@1.4 +0 -0 Delete: sntp/libopts/configfile.c BitKeeper/deleted/.del-configure.ac@1.24 +0 -0 Delete: sntp/configure.ac BitKeeper/deleted/.del-cook.c~dabc0ea67f8d04b@1.4 +0 -0 Delete: sntp/libopts/cook.c BitKeeper/deleted/.del-draft-mills-sntp-v4-00.txt@1.2 +0 -0 Delete: sntp/draft-mills-sntp-v4-00.txt BitKeeper/deleted/.del-enumeration.c~bb2f678a6e7847e4@1.4 +0 -0 Delete: sntp/libopts/enumeration.c BitKeeper/deleted/.del-environment.c~a4572011a478e1f8@1.5 +0 -0 Delete: sntp/libopts/environment.c BitKeeper/deleted/.del-file.c@1.4 +0 -0 Delete: sntp/libopts/file.c BitKeeper/deleted/.del-genshell.c~b902390cefc557fe@1.5 +0 -0 Delete: sntp/libopts/genshell.c BitKeeper/deleted/.del-genshell.h~3aefffa4f2e6155e@1.5 +0 -0 Delete: sntp/libopts/genshell.h BitKeeper/deleted/.del-header.h@1.7 +0 -0 Delete: sntp/header.h BitKeeper/deleted/.del-internet.c@1.5 +0 -0 Delete: sntp/internet.c BitKeeper/deleted/.del-internet.h@1.4 +0 -0 Delete: sntp/internet.h BitKeeper/deleted/.del-kludges.h@1.2 +0 -0 Delete: sntp/kludges.h BitKeeper/deleted/.del-libopts.c~fa546a962604b990@1.2 +0 -0 Delete: sntp/libopts/libopts.c BitKeeper/deleted/.del-libopts.m4~cea4d9dfe3c6ddbf@1.5 +0 -0 Delete: sntp/libopts/m4/libopts.m4 BitKeeper/deleted/.del-liboptschk.m4~3a61aba4c71ee48a@1.4 +0 -0 Delete: sntp/libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-load.c~d526b4ded3e5d941@1.4 +0 -0 Delete: sntp/libopts/load.c BitKeeper/deleted/.del-ltmain.sh@1.2 +0 -0 Delete: sntp/ltmain.sh BitKeeper/deleted/.del-main.c@1.11 +0 -0 Delete: sntp/main.c BitKeeper/deleted/.del-makeshell.c~dcec62d7527150f2@1.4 +0 -0 Delete: sntp/libopts/makeshell.c BitKeeper/deleted/.del-nested.c~9a65b1b3c71987c2@1.4 +0 -0 Delete: sntp/libopts/nested.c BitKeeper/deleted/.del-numeric.c~6843f965b3b4e5d4@1.4 +0 -0 Delete: sntp/libopts/numeric.c BitKeeper/deleted/.del-options.h~756b87b5d8493503@1.5 +0 -0 Delete: sntp/libopts/autoopts/options.h BitKeeper/deleted/.del-parse-duration.c@1.2 +0 -0 Delete: sntp/libopts/parse-duration.c BitKeeper/deleted/.del-parse-duration.h@1.2 +0 -0 Delete: sntp/libopts/parse-duration.h BitKeeper/deleted/.del-pathfind.c~d124c4b9c98df625@1.4 +0 -0 Delete: sntp/libopts/compat/pathfind.c BitKeeper/deleted/.del-pgusage.c~7f2f61c96b4f690@1.4 +0 -0 Delete: sntp/libopts/pgusage.c BitKeeper/deleted/.del-proto.h~3f55e562dfc99640@1.5 +0 -0 Delete: sntp/libopts/proto.h BitKeeper/deleted/.del-putshell.c~6ddb7f83260a15cb@1.4 +0 -0 Delete: sntp/libopts/putshell.c BitKeeper/deleted/.del-reset.c@1.4 +0 -0 Delete: sntp/libopts/reset.c BitKeeper/deleted/.del-restore.c~36055bf073cf20d2@1.4 +0 -0 Delete: sntp/libopts/restore.c BitKeeper/deleted/.del-save.c~818d9fbdc6efce79@1.5 +0 -0 Delete: sntp/libopts/save.c BitKeeper/deleted/.del-snprintf.c~e2a566791af51ab1@1.2 +0 -0 Delete: sntp/libopts/compat/snprintf.c BitKeeper/deleted/.del-sntp-opts.c~4bdc915913c58b8d@1.189 +0 -0 Delete: sntp/sntp-opts.c BitKeeper/deleted/.del-sntp-opts.def@1.13 +0 -0 Delete: sntp/sntp-opts.def BitKeeper/deleted/.del-sntp-opts.h~6c9afb942ebc8da5@1.189 +0 -0 Delete: sntp/sntp-opts.h BitKeeper/deleted/.del-sntp-opts.menu@1.5 +0 -0 Delete: sntp/sntp-opts.menu BitKeeper/deleted/.del-sntp-opts.texi~a472a50d2839eadc@1.188 +0 -0 Delete: sntp/sntp-opts.texi BitKeeper/deleted/.del-sntp.1~852b6b2cb9eef68@1.188 +0 -0 Delete: sntp/sntp.1 BitKeeper/deleted/.del-socket.c@1.9 +0 -0 Delete: sntp/socket.c BitKeeper/deleted/.del-sort.c~2b3c290f2056ef51@1.4 +0 -0 Delete: sntp/libopts/sort.c BitKeeper/deleted/.del-stack.c~275738ac7e7d319d@1.4 +0 -0 Delete: sntp/libopts/stack.c BitKeeper/deleted/.del-strchr.c~1aac99425a598121@1.2 +0 -0 Delete: sntp/libopts/compat/strchr.c BitKeeper/deleted/.del-strdup.c~5fa61194752a37e3@1.2 +0 -0 Delete: sntp/libopts/compat/strdup.c BitKeeper/deleted/.del-streqvcmp.c~e58f9bd033a84719@1.4 +0 -0 Delete: sntp/libopts/streqvcmp.c BitKeeper/deleted/.del-text_mmap.c~7c49bd8e3f86066f@1.4 +0 -0 Delete: sntp/libopts/text_mmap.c BitKeeper/deleted/.del-time.c@1.4 +0 -0 Delete: sntp/libopts/time.c BitKeeper/deleted/.del-timing.c@1.4 +0 -0 Delete: sntp/timing.c BitKeeper/deleted/.del-tokenize.c~be5669e7aebf805@1.3 +0 -0 Delete: sntp/libopts/tokenize.c BitKeeper/deleted/.del-unix.c@1.4 +0 -0 Delete: sntp/unix.c BitKeeper/deleted/.del-usage-txt.h~e9f5b7f89caa54c2@1.5 +0 -0 Delete: sntp/libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage.c~84e8c04ecb3c0839@1.4 +0 -0 Delete: sntp/libopts/usage.c BitKeeper/deleted/.del-value-type.c@1.3 +0 -0 Delete: sntp/libopts/value-type.c BitKeeper/deleted/.del-value-type.h@1.5 +0 -0 Delete: sntp/libopts/value-type.h BitKeeper/deleted/.del-version.c~f331be699b32ed05@1.4 +0 -0 Delete: sntp/libopts/version.c BitKeeper/deleted/.del-windows-config.h~c97f2a667a4b84f5@1.4 +0 -0 Delete: sntp/libopts/compat/windows-config.h BitKeeper/deleted/.del-xat-attribute.c@1.3 +0 -0 Delete: sntp/libopts/xat-attribute.c BitKeeper/deleted/.del-xat-attribute.h@1.5 +0 -0 Delete: sntp/libopts/xat-attribute.h ChangeLog@1.401 +1 -0 sntp: out with the old, in with the new Makefile.am@1.81 +0 -2 sntp: out with the old, in with the new bootstrap@1.23 +0 -1 sntp: out with the old, in with the new configure.ac@1.448 +0 -1 sntp: out with the old, in with the new sntp/COPYRIGHT@1.2 +0 -0 Rename: gsoc_sntp/COPYRIGHT -> sntp/COPYRIGHT sntp/Makefile.am@1.9 +0 -0 Rename: gsoc_sntp/Makefile.am -> sntp/Makefile.am sntp/configure.ac@1.18 +0 -0 Rename: gsoc_sntp/configure.ac -> sntp/configure.ac sntp/crypto.c@1.7 +0 -0 Rename: gsoc_sntp/crypto.c -> sntp/crypto.c sntp/crypto.h@1.5 +0 -0 Rename: gsoc_sntp/crypto.h -> sntp/crypto.h sntp/data_formats.h@1.5 +0 -0 Rename: gsoc_sntp/data_formats.h -> sntp/data_formats.h sntp/fetch-stubs@1.6 +0 -0 Rename: gsoc_sntp/fetch-stubs -> sntp/fetch-stubs sntp/header.h@1.4 +0 -0 Rename: gsoc_sntp/header.h -> sntp/header.h sntp/kod_management.c@1.10 +0 -0 Rename: gsoc_sntp/kod_management.c -> sntp/kod_management.c sntp/kod_management.h@1.6 +0 -0 Rename: gsoc_sntp/kod_management.h -> sntp/kod_management.h sntp/libopts/COPYING.gplv3@1.2 +0 -0 Rename: gsoc_sntp/libopts/COPYING.gplv3 -> sntp/libopts/COPYING.gplv3 sntp/libopts/COPYING.lgplv3@1.2 +0 -0 Rename: gsoc_sntp/libopts/COPYING.lgplv3 -> sntp/libopts/COPYING.lgplv3 sntp/libopts/COPYING.mbsd@1.2 +0 -0 Rename: gsoc_sntp/libopts/COPYING.mbsd -> sntp/libopts/COPYING.mbsd sntp/libopts/MakeDefs.inc@1.2 +0 -0 Rename: gsoc_sntp/libopts/MakeDefs.inc -> sntp/libopts/MakeDefs.inc sntp/libopts/Makefile.am@1.2 +0 -0 Rename: gsoc_sntp/libopts/Makefile.am -> sntp/libopts/Makefile.am sntp/libopts/README@1.3 +0 -0 Rename: gsoc_sntp/libopts/README -> sntp/libopts/README sntp/libopts/ag-char-map.h@1.5 +0 -0 Rename: gsoc_sntp/libopts/ag-char-map.h -> sntp/libopts/ag-char-map.h sntp/libopts/autoopts.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/autoopts.c -> sntp/libopts/autoopts.c sntp/libopts/autoopts.h@1.4 +0 -0 Rename: gsoc_sntp/libopts/autoopts.h -> sntp/libopts/autoopts.h sntp/libopts/autoopts/options.h@1.5 +0 -0 Rename: gsoc_sntp/libopts/autoopts/options.h -> sntp/libopts/autoopts/options.h sntp/libopts/autoopts/usage-txt.h@1.5 +0 -0 Rename: gsoc_sntp/libopts/autoopts/usage-txt.h -> sntp/libopts/autoopts/usage-txt.h sntp/libopts/boolean.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/boolean.c -> sntp/libopts/boolean.c sntp/libopts/compat/compat.h@1.4 +0 -0 Rename: gsoc_sntp/libopts/compat/compat.h -> sntp/libopts/compat/compat.h sntp/libopts/compat/pathfind.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/compat/pathfind.c -> sntp/libopts/compat/pathfind.c sntp/libopts/compat/snprintf.c@1.2 +0 -0 Rename: gsoc_sntp/libopts/compat/snprintf.c -> sntp/libopts/compat/snprintf.c sntp/libopts/compat/strchr.c@1.2 +0 -0 Rename: gsoc_sntp/libopts/compat/strchr.c -> sntp/libopts/compat/strchr.c sntp/libopts/compat/strdup.c@1.2 +0 -0 Rename: gsoc_sntp/libopts/compat/strdup.c -> sntp/libopts/compat/strdup.c sntp/libopts/compat/windows-config.h@1.4 +0 -0 Rename: gsoc_sntp/libopts/compat/windows-config.h -> sntp/libopts/compat/windows-config.h sntp/libopts/configfile.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/configfile.c -> sntp/libopts/configfile.c sntp/libopts/cook.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/cook.c -> sntp/libopts/cook.c sntp/libopts/enumeration.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/enumeration.c -> sntp/libopts/enumeration.c sntp/libopts/environment.c@1.5 +0 -0 Rename: gsoc_sntp/libopts/environment.c -> sntp/libopts/environment.c sntp/libopts/file.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/file.c -> sntp/libopts/file.c sntp/libopts/genshell.c@1.5 +0 -0 Rename: gsoc_sntp/libopts/genshell.c -> sntp/libopts/genshell.c sntp/libopts/genshell.h@1.5 +0 -0 Rename: gsoc_sntp/libopts/genshell.h -> sntp/libopts/genshell.h sntp/libopts/libopts.c@1.2 +0 -0 Rename: gsoc_sntp/libopts/libopts.c -> sntp/libopts/libopts.c sntp/libopts/load.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/load.c -> sntp/libopts/load.c sntp/libopts/m4/libopts.m4@1.5 +0 -0 Rename: gsoc_sntp/libopts/m4/libopts.m4 -> sntp/libopts/m4/libopts.m4 sntp/libopts/m4/liboptschk.m4@1.4 +0 -0 Rename: gsoc_sntp/libopts/m4/liboptschk.m4 -> sntp/libopts/m4/liboptschk.m4 sntp/libopts/makeshell.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/makeshell.c -> sntp/libopts/makeshell.c sntp/libopts/nested.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/nested.c -> sntp/libopts/nested.c sntp/libopts/numeric.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/numeric.c -> sntp/libopts/numeric.c sntp/libopts/parse-duration.c@1.2 +0 -0 Rename: gsoc_sntp/libopts/parse-duration.c -> sntp/libopts/parse-duration.c sntp/libopts/parse-duration.h@1.2 +0 -0 Rename: gsoc_sntp/libopts/parse-duration.h -> sntp/libopts/parse-duration.h sntp/libopts/pgusage.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/pgusage.c -> sntp/libopts/pgusage.c sntp/libopts/proto.h@1.5 +0 -0 Rename: gsoc_sntp/libopts/proto.h -> sntp/libopts/proto.h sntp/libopts/putshell.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/putshell.c -> sntp/libopts/putshell.c sntp/libopts/reset.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/reset.c -> sntp/libopts/reset.c sntp/libopts/restore.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/restore.c -> sntp/libopts/restore.c sntp/libopts/save.c@1.5 +0 -0 Rename: gsoc_sntp/libopts/save.c -> sntp/libopts/save.c sntp/libopts/sort.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/sort.c -> sntp/libopts/sort.c sntp/libopts/stack.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/stack.c -> sntp/libopts/stack.c sntp/libopts/streqvcmp.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/streqvcmp.c -> sntp/libopts/streqvcmp.c sntp/libopts/text_mmap.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/text_mmap.c -> sntp/libopts/text_mmap.c sntp/libopts/time.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/time.c -> sntp/libopts/time.c sntp/libopts/tokenize.c@1.3 +0 -0 Rename: gsoc_sntp/libopts/tokenize.c -> sntp/libopts/tokenize.c sntp/libopts/usage.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/usage.c -> sntp/libopts/usage.c sntp/libopts/value-type.c@1.3 +0 -0 Rename: gsoc_sntp/libopts/value-type.c -> sntp/libopts/value-type.c sntp/libopts/value-type.h@1.5 +0 -0 Rename: gsoc_sntp/libopts/value-type.h -> sntp/libopts/value-type.h sntp/libopts/version.c@1.4 +0 -0 Rename: gsoc_sntp/libopts/version.c -> sntp/libopts/version.c sntp/libopts/xat-attribute.c@1.3 +0 -0 Rename: gsoc_sntp/libopts/xat-attribute.c -> sntp/libopts/xat-attribute.c sntp/libopts/xat-attribute.h@1.5 +0 -0 Rename: gsoc_sntp/libopts/xat-attribute.h -> sntp/libopts/xat-attribute.h sntp/log.c@1.9 +0 -0 Rename: gsoc_sntp/log.c -> sntp/log.c sntp/log.h@1.6 +0 -0 Rename: gsoc_sntp/log.h -> sntp/log.h sntp/ltmain.sh@1.2 +0 -0 Rename: gsoc_sntp/ltmain.sh -> sntp/ltmain.sh sntp/main.c@1.17 +0 -0 Rename: gsoc_sntp/main.c -> sntp/main.c sntp/netutils.c@1.2 +0 -0 Rename: gsoc_sntp/netutils.c -> sntp/netutils.c sntp/netutils.h@1.2 +0 -0 Rename: gsoc_sntp/netutils.h -> sntp/netutils.h sntp/networking.c@1.23 +0 -0 Rename: gsoc_sntp/networking.c -> sntp/networking.c sntp/networking.h@1.14 +0 -0 Rename: gsoc_sntp/networking.h -> sntp/networking.h sntp/sntp-opts.c@1.62 +0 -0 Rename: gsoc_sntp/sntp-opts.c -> sntp/sntp-opts.c sntp/sntp-opts.def@1.10 +0 -0 Rename: gsoc_sntp/sntp-opts.def -> sntp/sntp-opts.def sntp/sntp-opts.h@1.62 +0 -0 Rename: gsoc_sntp/sntp-opts.h -> sntp/sntp-opts.h sntp/sntp-opts.menu@1.2 +0 -0 Rename: gsoc_sntp/sntp-opts.menu -> sntp/sntp-opts.menu sntp/sntp-opts.texi@1.62 +0 -0 Rename: gsoc_sntp/sntp-opts.texi -> sntp/sntp-opts.texi sntp/sntp.1@1.62 +0 -0 Rename: gsoc_sntp/sntp.1 -> sntp/sntp.1 sntp/utilities.c@1.8 +0 -0 Rename: gsoc_sntp/utilities.c -> sntp/utilities.c sntp/utilities.h@1.6 +0 -0 Rename: gsoc_sntp/utilities.h -> sntp/utilities.h ChangeSet@1.1877.3.7, 2009-08-12 17:25:58+09:00, Amidamaru@yumi.mxiesoft.com ntp_config.c: Config dumper: Added fudge output to server/peer output ntpd/ntp_config.c@1.193.1.6 +96 -78 Config dumper: Added fudge output to server/peer output ChangeSet@1.1877.4.1, 2009-08-12 17:09:40+09:00, Amidamaru@yumi.mxiesoft.com ntp_control.c: Added handler for dump opcode ntpd/ntp_control.c@1.110.1.1 +25 -0 Added handler for dump opcode ChangeSet@1.1947, 2009-08-10 23:09:52+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1281] Build ntpd on Windows without big SDK download, burn, and install by checking in essentially unchanging messages.mc build products to avoid requiring mc.exe, which is not included with VC++ 2008 EE. ChangeLog@1.400 +4 -0 [Bug 1281] Build ntpd on Windows without big SDK download, burn, and install by checking in essentially unchanging messages.mc build products to avoid requiring mc.exe, which is not included with VC++ 2008 EE. ports/winnt/libntp/MSG00001.bin@1.1 +4 -0 BitKeeper file C:/ntp/ntp-dev-1281/ports/winnt/libntp/MSG00001.bin ports/winnt/libntp/MSG00001.bin@1.0 +0 -0 ports/winnt/libntp/messages.h@1.1 +199 -0 BitKeeper file C:/ntp/ntp-dev-1281/ports/winnt/libntp/messages.h ports/winnt/libntp/messages.h@1.0 +0 -0 ports/winnt/libntp/messages.rc@1.1 +2 -0 BitKeeper file C:/ntp/ntp-dev-1281/ports/winnt/libntp/messages.rc ports/winnt/libntp/messages.rc@1.0 +0 -0 ChangeSet@1.1946, 2009-08-09 07:55:30-04:00, stenn@whimsy.udel.edu NTP_4_2_5P199 TAG: NTP_4_2_5P199 ChangeLog@1.399 +1 -0 NTP_4_2_5P199 gsoc_sntp/sntp-opts.c@1.61 +2 -2 NTP_4_2_5P199 gsoc_sntp/sntp-opts.h@1.61 +3 -3 NTP_4_2_5P199 gsoc_sntp/sntp-opts.texi@1.61 +1 -1 NTP_4_2_5P199 gsoc_sntp/sntp.1@1.61 +2 -2 NTP_4_2_5P199 ntpd/ntpd-opts.c@1.192 +2 -2 NTP_4_2_5P199 ntpd/ntpd-opts.h@1.192 +3 -3 NTP_4_2_5P199 ntpd/ntpd-opts.texi@1.190 +1 -1 NTP_4_2_5P199 ntpd/ntpd.1@1.190 +2 -2 NTP_4_2_5P199 ntpdc/ntpdc-opts.c@1.188 +2 -2 NTP_4_2_5P199 ntpdc/ntpdc-opts.h@1.188 +3 -3 NTP_4_2_5P199 ntpdc/ntpdc-opts.texi@1.187 +1 -1 NTP_4_2_5P199 ntpdc/ntpdc.1@1.187 +2 -2 NTP_4_2_5P199 ntpq/ntpq-opts.c@1.188 +2 -2 NTP_4_2_5P199 ntpq/ntpq-opts.h@1.188 +3 -3 NTP_4_2_5P199 ntpq/ntpq-opts.texi@1.187 +1 -1 NTP_4_2_5P199 ntpq/ntpq.1@1.187 +2 -2 NTP_4_2_5P199 ntpsnmpd/ntpsnmpd-opts.c@1.68 +2 -2 NTP_4_2_5P199 ntpsnmpd/ntpsnmpd-opts.h@1.68 +3 -3 NTP_4_2_5P199 ntpsnmpd/ntpsnmpd-opts.texi@1.68 +1 -1 NTP_4_2_5P199 ntpsnmpd/ntpsnmpd.1@1.68 +2 -2 NTP_4_2_5P199 packageinfo.sh@1.202 +1 -1 NTP_4_2_5P199 sntp/sntp-opts.c@1.188 +2 -2 NTP_4_2_5P199 sntp/sntp-opts.h@1.188 +3 -3 NTP_4_2_5P199 sntp/sntp-opts.texi@1.187 +1 -1 NTP_4_2_5P199 sntp/sntp.1@1.187 +2 -2 NTP_4_2_5P199 util/ntp-keygen-opts.c@1.191 +2 -2 NTP_4_2_5P199 util/ntp-keygen-opts.h@1.191 +3 -3 NTP_4_2_5P199 util/ntp-keygen-opts.texi@1.190 +1 -1 NTP_4_2_5P199 util/ntp-keygen.1@1.190 +2 -2 NTP_4_2_5P199 ChangeSet@1.1945, 2009-08-08 16:39:12-04:00, stenn@whimsy.udel.edu [Bug 1279] Cleanup for warnings from Veracode static analysis ChangeLog@1.398 +1 -0 [Bug 1279] Cleanup for warnings from Veracode static analysis ChangeSet@1.1944, 2009-08-08 17:30:14+00:00, davehart@shiny.ad.hartbrothers.com First pass at quieting Veracode static analysis warnings, mostly buffer manipulation that is already safe but used unsafe interface functions such as strcpy() and sprintf(). use emalloc(), estrdup() where appropriate. libntp/msyslog.c@1.23 +7 -6 use memcpy instead of strcpy to quiet Veracode analysis warning libntp/ntp_rfc2553.c@1.39 +2 -6 use estrdup() instead of malloc() then strcpy() libntp/statestr.c@1.17 +5 -4 sprintf() -> snprintf() Veracode libparse/parse.c@1.13 +1 -1 See if cast is enough to quiet Veracode int truncation warning ntpd/ntp_config.c@1.199 +7 -3 sprintf()->snprintf() check for unlink() failure ntpd/ntp_control.c@1.112 +28 -27 strcpy() + strcat() -> snprintf() strcpy() -> memcpy() correct 'be" buffer end calculations ntpd/ntp_intres.c@1.64 +7 -3 check for unlink() failure ensure zero termination with strncpy() ntpd/ntp_io.c@1.295 +1 -0 ensure null termination with strncpy ntpd/ntp_scanner.c@1.22 +30 -5 bounds-check access to yytext[] ntpd/ntp_signd.c@1.2 +1 -4 use emalloc() ntpd/ntp_util.c@1.73 +8 -3 check for rename(), _unlink() failures ntpd/ntpd.c@1.106 +7 -3 add chdir("/") after chroot(), can't hurt and Veracode wants it ntpd/refclock_acts.c@1.36 +0 -3 emalloc() never returns NULL ntpd/refclock_bancomm.c@1.11 +2 -3 use emalloc() ntpd/refclock_datum.c@1.13 +1 -1 use emalloc() ntpd/refclock_oncore.c@1.78 +7 -24 use emalloc() ntpdate/ntpdate.c@1.68 +1 -1 use emalloc() ntpdc/ntpdc.c@1.67 +1 -5 use emalloc() ntpq/ntpq-subs.c@1.32 +2 -26 remove strsave from ntpq, same as libntp's estrdup() ports/winnt/libisc/isc_strerror.c@1.8 +9 -6 use emalloc() #undef our strerror() before calling the CRT version, infinite recursion is no fun ports/winnt/ntpd/ntp_iocompletionport.c@1.47 +8 -5 calloc() -> emalloc() then memset zero ChangeSet@1.1877.3.6, 2009-08-06 12:04:59+00:00, davehart@shiny.ad.hartbrothers.com maintain history of config trees include/ntp_config.h@1.52.1.3 +2 -40 remove unused leftovers, add list link field to struct config_tree include/ntp_data_structures.h@1.5 +0 -8 remove unused s_list libntp/ntp_lineedit.c@1.7 +4 -5 use estrdup() instead of strdup() ntpd/ntp_config.c@1.193.1.5 +112 -79 maintain history of config trees ntpd/ntp_data_structures.c@1.11 +5 -2 make next_node() actually work ntpd/ntp_parser.c@1.38.1.1 +50 -50 parse to struct config_tree cfgt rather than my_config ntpd/ntp_parser.y@1.33.1.1 +50 -50 parse to struct config_tree cfgt rather than my_config ntpd/ntp_scanner.h@1.7 +4 -4 parse to struct config_tree cfgt rather than my_config ChangeSet@1.1877.3.5, 2009-08-05 21:13:22+00:00, davehart@shiny.ad.hartbrothers.com separate consumption (freeing) of syntax tree from application by introducing free_config_*() routines for each config_*() which allocates memory pointed to by a node. include/ntpd.h@1.127.1.1 +1 -1 make sizeof(sys_ttl) work ntpd/ntp_config.c@1.193.1.4 +526 -194 separate consumption (freeing) of syntax tree from application by introducing free_config_*() routines for each config_*() which allocates memory pointed to by a node. ntpd/ntp_filegen.c@1.16 +4 -2 use bounded copy function (memcpy instead of strcpy) ChangeSet@1.1877.3.4, 2009-08-05 14:26:32+00:00, davehart@shiny.ad.hartbrothers.com Dump from config tree not s_list clone include/ntp_config.h@1.52.1.2 +1 -1 Dump from config tree not clone include/ntp_data_structures.h@1.4 +2 -2 add routines to walk queue without destroying ntpd/ntp_config.c@1.193.1.3 +389 -402 lay groundwork for keeping list of config trees, one from file then one from each ntpq :config ntpd/ntp_data_structures.c@1.10 +27 -48 add routines to walk queue without destroying ChangeSet@1.1877.3.3, 2009-08-05 00:45:45+00:00, davehart@shiny.ad.hartbrothers.com fix problems compiling as C with Visual C++ ntpd/ntp_config.c@1.193.1.2 +20 -15 fix problems compiling as C with Visual C++ ntpd/ntp_data_structures.c@1.9 +10 -6 fix problems compiling as C with Visual C++ ChangeSet@1.1877.3.2, 2009-08-04 19:40:02+02:00, amidamaru@melchior.mxiesoft.com ntp_control.h: Added dumpcfg bindings include/ntp_control.h@1.34.1.1 +1 -0 Added dumpcfg bindings ChangeSet@1.1877.3.1, 2009-08-04 17:31:42+02:00, amidamaru@melchior.mxiesoft.com ntp_data_structures.h: Added singly-linked list datatype s_list ntp_data_structures.c: Added functions for dealing with singly linked lists ntp_config.c: Added config dumper and functions dealing with the linked-list copy of the configuration tree ntpq-subs.c: Added config dumper bindings ntp_config.h: Added config dumper prototypes include/ntp_config.h@1.52.1.1 +43 -0 Added config dumper prototypes include/ntp_data_structures.h@1.3 +10 -0 Added singly-linked list datatype s_list ntpd/ntp_config.c@1.193.1.1 +891 -31 Added config dumper and functions dealing with the linked-list copy of the configuration tree ntpd/ntp_data_structures.c@1.8 +44 -0 Added functions for dealing with singly linked lists ntpq/ntpq-subs.c@1.30.1.1 +33 -1 Added config dumper bindings ChangeSet@1.1943, 2009-08-03 08:00:33-04:00, stenn@whimsy.udel.edu NTP_4_2_5P198 TAG: NTP_4_2_5P198 ChangeLog@1.397 +1 -0 NTP_4_2_5P198 gsoc_sntp/sntp-opts.c@1.60 +3 -3 NTP_4_2_5P198 gsoc_sntp/sntp-opts.h@1.60 +4 -4 NTP_4_2_5P198 gsoc_sntp/sntp-opts.texi@1.60 +1 -1 NTP_4_2_5P198 gsoc_sntp/sntp.1@1.60 +2 -2 NTP_4_2_5P198 ntpd/ntpd-opts.c@1.191 +3 -3 NTP_4_2_5P198 ntpd/ntpd-opts.h@1.191 +4 -4 NTP_4_2_5P198 ntpd/ntpd-opts.texi@1.189 +1 -1 NTP_4_2_5P198 ntpd/ntpd.1@1.189 +2 -2 NTP_4_2_5P198 ntpdc/ntpdc-opts.c@1.187 +3 -3 NTP_4_2_5P198 ntpdc/ntpdc-opts.h@1.187 +4 -4 NTP_4_2_5P198 ntpdc/ntpdc-opts.texi@1.186 +1 -1 NTP_4_2_5P198 ntpdc/ntpdc.1@1.186 +2 -2 NTP_4_2_5P198 ntpq/ntpq-opts.c@1.187 +3 -3 NTP_4_2_5P198 ntpq/ntpq-opts.h@1.187 +4 -4 NTP_4_2_5P198 ntpq/ntpq-opts.texi@1.186 +1 -1 NTP_4_2_5P198 ntpq/ntpq.1@1.186 +2 -2 NTP_4_2_5P198 ntpsnmpd/ntpsnmpd-opts.c@1.67 +3 -3 NTP_4_2_5P198 ntpsnmpd/ntpsnmpd-opts.h@1.67 +4 -4 NTP_4_2_5P198 ntpsnmpd/ntpsnmpd-opts.texi@1.67 +1 -1 NTP_4_2_5P198 ntpsnmpd/ntpsnmpd.1@1.67 +2 -2 NTP_4_2_5P198 packageinfo.sh@1.201 +1 -1 NTP_4_2_5P198 sntp/sntp-opts.c@1.187 +3 -3 NTP_4_2_5P198 sntp/sntp-opts.h@1.187 +4 -4 NTP_4_2_5P198 sntp/sntp-opts.texi@1.186 +1 -1 NTP_4_2_5P198 sntp/sntp.1@1.186 +2 -2 NTP_4_2_5P198 util/ntp-keygen-opts.c@1.190 +3 -3 NTP_4_2_5P198 util/ntp-keygen-opts.h@1.190 +4 -4 NTP_4_2_5P198 util/ntp-keygen-opts.texi@1.189 +1 -1 NTP_4_2_5P198 util/ntp-keygen.1@1.189 +2 -2 NTP_4_2_5P198 ChangeSet@1.1940.1.1, 2009-08-03 01:32:51-04:00, stenn@whimsy.udel.edu Upgraded to autogen-5.9.9-pre5 ChangeLog@1.396 +1 -0 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/ag-char-map.h@1.4 +37 -6 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/autoopts.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/autoopts.h@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/autoopts/options.h@1.4 +34 -40 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/autoopts/usage-txt.h@1.4 +1 -1 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/boolean.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/compat/compat.h@1.3 +1 -1 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/compat/pathfind.c@1.3 +2 -2 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/compat/windows-config.h@1.3 +1 -1 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/configfile.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/cook.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/enumeration.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/environment.c@1.4 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/file.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/genshell.c@1.4 +2 -2 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/genshell.h@1.4 +2 -2 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/load.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/m4/libopts.m4@1.4 +2 -2 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/m4/liboptschk.m4@1.3 +1 -1 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/makeshell.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/nested.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/numeric.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/pgusage.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/proto.h@1.4 +1 -1 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/putshell.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/reset.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/restore.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/save.c@1.4 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/sort.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/stack.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/streqvcmp.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/text_mmap.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/time.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/tokenize.c@1.2 +2 -2 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/usage.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/value-type.h@1.4 +1 -1 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/version.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 gsoc_sntp/libopts/xat-attribute.h@1.4 +1 -1 Upgraded to autogen-5.9.9-pre5 libopts/ag-char-map.h@1.4 +37 -6 Upgraded to autogen-5.9.9-pre5 libopts/autoopts.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/autoopts.h@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/autoopts/options.h@1.4 +34 -40 Upgraded to autogen-5.9.9-pre5 libopts/autoopts/usage-txt.h@1.4 +1 -1 Upgraded to autogen-5.9.9-pre5 libopts/boolean.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/compat/compat.h@1.3 +1 -1 Upgraded to autogen-5.9.9-pre5 libopts/compat/pathfind.c@1.3 +2 -2 Upgraded to autogen-5.9.9-pre5 libopts/compat/windows-config.h@1.3 +1 -1 Upgraded to autogen-5.9.9-pre5 libopts/configfile.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/cook.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/enumeration.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/environment.c@1.4 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/file.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/genshell.c@1.4 +2 -2 Upgraded to autogen-5.9.9-pre5 libopts/genshell.h@1.4 +2 -2 Upgraded to autogen-5.9.9-pre5 libopts/load.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/m4/libopts.m4@1.4 +2 -2 Upgraded to autogen-5.9.9-pre5 libopts/m4/liboptschk.m4@1.3 +1 -1 Upgraded to autogen-5.9.9-pre5 libopts/makeshell.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/nested.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/numeric.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/pgusage.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/proto.h@1.4 +1 -1 Upgraded to autogen-5.9.9-pre5 libopts/putshell.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/reset.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/restore.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/save.c@1.4 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/sort.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/stack.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/streqvcmp.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/text_mmap.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/time.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/tokenize.c@1.2 +2 -2 Upgraded to autogen-5.9.9-pre5 libopts/usage.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/value-type.h@1.4 +1 -1 Upgraded to autogen-5.9.9-pre5 libopts/version.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 libopts/xat-attribute.h@1.4 +1 -1 Upgraded to autogen-5.9.9-pre5 sntp/libopts/ag-char-map.h@1.4 +37 -6 Upgraded to autogen-5.9.9-pre5 sntp/libopts/autoopts.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/autoopts.h@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/autoopts/options.h@1.4 +34 -40 Upgraded to autogen-5.9.9-pre5 sntp/libopts/autoopts/usage-txt.h@1.4 +1 -1 Upgraded to autogen-5.9.9-pre5 sntp/libopts/boolean.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/compat/compat.h@1.3 +1 -1 Upgraded to autogen-5.9.9-pre5 sntp/libopts/compat/pathfind.c@1.3 +2 -2 Upgraded to autogen-5.9.9-pre5 sntp/libopts/compat/windows-config.h@1.3 +1 -1 Upgraded to autogen-5.9.9-pre5 sntp/libopts/configfile.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/cook.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/enumeration.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/environment.c@1.4 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/file.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/genshell.c@1.4 +2 -2 Upgraded to autogen-5.9.9-pre5 sntp/libopts/genshell.h@1.4 +2 -2 Upgraded to autogen-5.9.9-pre5 sntp/libopts/load.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/m4/libopts.m4@1.4 +2 -2 Upgraded to autogen-5.9.9-pre5 sntp/libopts/m4/liboptschk.m4@1.3 +1 -1 Upgraded to autogen-5.9.9-pre5 sntp/libopts/makeshell.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/nested.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/numeric.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/pgusage.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/proto.h@1.4 +1 -1 Upgraded to autogen-5.9.9-pre5 sntp/libopts/putshell.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/reset.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/restore.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/save.c@1.4 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/sort.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/stack.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/streqvcmp.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/text_mmap.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/time.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/tokenize.c@1.2 +2 -2 Upgraded to autogen-5.9.9-pre5 sntp/libopts/usage.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/value-type.h@1.4 +1 -1 Upgraded to autogen-5.9.9-pre5 sntp/libopts/version.c@1.3 +3 -3 Upgraded to autogen-5.9.9-pre5 sntp/libopts/xat-attribute.h@1.4 +1 -1 Upgraded to autogen-5.9.9-pre5 ChangeSet@1.1941, 2009-08-03 05:01:24+00:00, davehart@shiny.ad.hartbrothers.com remove workaround ports/winnt/include/inttypes.h for Autogen 5.98 problem fixed in 5.99 BitKeeper/deleted/.del-inttypes.h~d8eb65583f310a51@1.2 +0 -0 Delete: ports/winnt/include/inttypes.h ports/winnt/include/config.h@1.73 +0 -1 remove empty inttypes.h workaround for Autogen 5.98 problem fixed in 5.99 ports/winnt/libntp/libntp.vcproj@1.12 +4 -4 add libopts\ag-char-map.h reference, remove workaround inttypes.h ChangeSet@1.1940, 2009-07-30 07:53:13-04:00, stenn@whimsy.udel.edu NTP_4_2_5P197 TAG: NTP_4_2_5P197 ChangeLog@1.395 +1 -0 NTP_4_2_5P197 gsoc_sntp/sntp-opts.c@1.59 +2 -2 NTP_4_2_5P197 gsoc_sntp/sntp-opts.h@1.59 +3 -3 NTP_4_2_5P197 gsoc_sntp/sntp-opts.texi@1.59 +1 -1 NTP_4_2_5P197 gsoc_sntp/sntp.1@1.59 +2 -2 NTP_4_2_5P197 ntpd/ntpd-opts.c@1.190 +2 -2 NTP_4_2_5P197 ntpd/ntpd-opts.h@1.190 +3 -3 NTP_4_2_5P197 ntpd/ntpd-opts.texi@1.188 +1 -1 NTP_4_2_5P197 ntpd/ntpd.1@1.188 +2 -2 NTP_4_2_5P197 ntpdc/ntpdc-opts.c@1.186 +2 -2 NTP_4_2_5P197 ntpdc/ntpdc-opts.h@1.186 +3 -3 NTP_4_2_5P197 ntpdc/ntpdc-opts.texi@1.185 +1 -1 NTP_4_2_5P197 ntpdc/ntpdc.1@1.185 +2 -2 NTP_4_2_5P197 ntpq/ntpq-opts.c@1.186 +2 -2 NTP_4_2_5P197 ntpq/ntpq-opts.h@1.186 +3 -3 NTP_4_2_5P197 ntpq/ntpq-opts.texi@1.185 +1 -1 NTP_4_2_5P197 ntpq/ntpq.1@1.185 +2 -2 NTP_4_2_5P197 ntpsnmpd/ntpsnmpd-opts.c@1.66 +2 -2 NTP_4_2_5P197 ntpsnmpd/ntpsnmpd-opts.h@1.66 +3 -3 NTP_4_2_5P197 ntpsnmpd/ntpsnmpd-opts.texi@1.66 +1 -1 NTP_4_2_5P197 ntpsnmpd/ntpsnmpd.1@1.66 +2 -2 NTP_4_2_5P197 packageinfo.sh@1.200 +1 -1 NTP_4_2_5P197 sntp/sntp-opts.c@1.186 +2 -2 NTP_4_2_5P197 sntp/sntp-opts.h@1.186 +3 -3 NTP_4_2_5P197 sntp/sntp-opts.texi@1.185 +1 -1 NTP_4_2_5P197 sntp/sntp.1@1.185 +2 -2 NTP_4_2_5P197 util/ntp-keygen-opts.c@1.189 +2 -2 NTP_4_2_5P197 util/ntp-keygen-opts.h@1.189 +3 -3 NTP_4_2_5P197 util/ntp-keygen-opts.texi@1.188 +1 -1 NTP_4_2_5P197 util/ntp-keygen.1@1.188 +2 -2 NTP_4_2_5P197 ChangeSet@1.1939, 2009-07-30 02:38:38-04:00, stenn@whimsy.udel.edu The build script now has . at the end of PATH for config.guess ChangeLog@1.394 +1 -0 The build script now has . at the end of PATH for config.guess build@1.29 +3 -0 The build script now has . at the end of PATH for config.guess ChangeSet@1.1938, 2009-07-29 07:54:11-04:00, stenn@whimsy.udel.edu NTP_4_2_5P196 TAG: NTP_4_2_5P196 ChangeLog@1.393 +1 -0 NTP_4_2_5P196 gsoc_sntp/sntp-opts.c@1.58 +2 -2 NTP_4_2_5P196 gsoc_sntp/sntp-opts.h@1.58 +3 -3 NTP_4_2_5P196 gsoc_sntp/sntp-opts.texi@1.58 +1 -1 NTP_4_2_5P196 gsoc_sntp/sntp.1@1.58 +2 -2 NTP_4_2_5P196 ntpd/ntpd-opts.c@1.189 +2 -2 NTP_4_2_5P196 ntpd/ntpd-opts.h@1.189 +3 -3 NTP_4_2_5P196 ntpd/ntpd-opts.texi@1.187 +1 -1 NTP_4_2_5P196 ntpd/ntpd.1@1.187 +2 -2 NTP_4_2_5P196 ntpdc/ntpdc-opts.c@1.185 +2 -2 NTP_4_2_5P196 ntpdc/ntpdc-opts.h@1.185 +3 -3 NTP_4_2_5P196 ntpdc/ntpdc-opts.texi@1.184 +1 -1 NTP_4_2_5P196 ntpdc/ntpdc.1@1.184 +2 -2 NTP_4_2_5P196 ntpq/ntpq-opts.c@1.185 +2 -2 NTP_4_2_5P196 ntpq/ntpq-opts.h@1.185 +3 -3 NTP_4_2_5P196 ntpq/ntpq-opts.texi@1.184 +1 -1 NTP_4_2_5P196 ntpq/ntpq.1@1.184 +2 -2 NTP_4_2_5P196 ntpsnmpd/ntpsnmpd-opts.c@1.65 +2 -2 NTP_4_2_5P196 ntpsnmpd/ntpsnmpd-opts.h@1.65 +3 -3 NTP_4_2_5P196 ntpsnmpd/ntpsnmpd-opts.texi@1.65 +1 -1 NTP_4_2_5P196 ntpsnmpd/ntpsnmpd.1@1.65 +2 -2 NTP_4_2_5P196 packageinfo.sh@1.199 +1 -1 NTP_4_2_5P196 sntp/sntp-opts.c@1.185 +2 -2 NTP_4_2_5P196 sntp/sntp-opts.h@1.185 +3 -3 NTP_4_2_5P196 sntp/sntp-opts.texi@1.184 +1 -1 NTP_4_2_5P196 sntp/sntp.1@1.184 +2 -2 NTP_4_2_5P196 util/ntp-keygen-opts.c@1.188 +2 -2 NTP_4_2_5P196 util/ntp-keygen-opts.h@1.188 +3 -3 NTP_4_2_5P196 util/ntp-keygen-opts.texi@1.187 +1 -1 NTP_4_2_5P196 util/ntp-keygen.1@1.187 +2 -2 NTP_4_2_5P196 ChangeSet@1.1937, 2009-07-29 02:25:28-04:00, stenn@whimsy.udel.edu Typo fix, and note cvo.sh supports QNX now, too ChangeLog@1.392 +1 -1 cvo.sh now supports QNX ChangeLog@1.391 +1 -1 typo ChangeSet@1.1934.1.1, 2009-07-29 02:03:51-04:00, stenn@whimsy.udel.edu [Bug 1276 normal] CID 52: crypto_xmit() may call crypto_alice[23]() with NULL peer ChangeLog@1.388.1.1 +2 -0 [Bug 1276 normal] CID 52: crypto_xmit() may call crypto_alice[23]() with NULL peer ntpd/ntp_crypto.c@1.139 +9 -0 [Bug 1276 normal] CID 52: crypto_xmit() may call crypto_alice[23]() with NULL peer ChangeSet@1.1935, 2009-07-29 04:13:53+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1272] gsoc_sntp IPv6 build problems under HP-UX 10. [Bug 1273] CID 10: Palisade leaks unit struct in error path. [Bug 1274] CID 67: ensure resolve_hosts() output count and pointers are consistent. [Bug 1275] CID 45: CID 46: old sntp uses uninitialized guesses[0], precs[0]. ChangeLog@1.389 +6 -0 [Bug 1272] gsoc_sntp IPv6 build problems under HP-UX 10. [Bug 1273] CID 10: Palisade leaks unit struct in error path. [Bug 1274] CID 67: ensure resolve_hosts() output count and pointers are consistent. [Bug 1275] CID 45: CID 46: old sntp uses uninitialized guesses[0], precs[0]. gsoc_sntp/networking.c@1.22 +11 -3 [Bug 1272] gsoc_sntp IPv6 build problems under HP-UX 10. [Bug 1274] CID 67: ensure resolve_hosts() output count and pointers are consistent. ntpd/ntp_io.c@1.294 +1 -1 cleanup from sockaddr_u introduction, stoa needs pointer to sockaddr_u not interface ntpd/refclock_palisade.c@1.26 +3 -9 [Bug 1273] CID 10: Palisade leaks unit struct in error path. sntp/main.c@1.10 +3 -0 [Bug 1275] CID 45: CID 46: old sntp uses uninitialized guesses[0], precs[0]. ChangeSet@1.1934, 2009-07-27 07:54:24-04:00, stenn@whimsy.udel.edu NTP_4_2_5P195 TAG: NTP_4_2_5P195 ChangeLog@1.388 +1 -0 NTP_4_2_5P195 gsoc_sntp/sntp-opts.c@1.57 +2 -2 NTP_4_2_5P195 gsoc_sntp/sntp-opts.h@1.57 +3 -3 NTP_4_2_5P195 gsoc_sntp/sntp-opts.texi@1.57 +1 -1 NTP_4_2_5P195 gsoc_sntp/sntp.1@1.57 +2 -2 NTP_4_2_5P195 ntpd/ntpd-opts.c@1.188 +2 -2 NTP_4_2_5P195 ntpd/ntpd-opts.h@1.188 +3 -3 NTP_4_2_5P195 ntpd/ntpd-opts.texi@1.186 +1 -1 NTP_4_2_5P195 ntpd/ntpd.1@1.186 +2 -2 NTP_4_2_5P195 ntpdc/ntpdc-opts.c@1.184 +2 -2 NTP_4_2_5P195 ntpdc/ntpdc-opts.h@1.184 +3 -3 NTP_4_2_5P195 ntpdc/ntpdc-opts.texi@1.183 +1 -1 NTP_4_2_5P195 ntpdc/ntpdc.1@1.183 +2 -2 NTP_4_2_5P195 ntpq/ntpq-opts.c@1.184 +2 -2 NTP_4_2_5P195 ntpq/ntpq-opts.h@1.184 +3 -3 NTP_4_2_5P195 ntpq/ntpq-opts.texi@1.183 +1 -1 NTP_4_2_5P195 ntpq/ntpq.1@1.183 +2 -2 NTP_4_2_5P195 ntpsnmpd/ntpsnmpd-opts.c@1.64 +2 -2 NTP_4_2_5P195 ntpsnmpd/ntpsnmpd-opts.h@1.64 +3 -3 NTP_4_2_5P195 ntpsnmpd/ntpsnmpd-opts.texi@1.64 +1 -1 NTP_4_2_5P195 ntpsnmpd/ntpsnmpd.1@1.64 +2 -2 NTP_4_2_5P195 packageinfo.sh@1.198 +1 -1 NTP_4_2_5P195 sntp/sntp-opts.c@1.184 +2 -2 NTP_4_2_5P195 sntp/sntp-opts.h@1.184 +3 -3 NTP_4_2_5P195 sntp/sntp-opts.texi@1.183 +1 -1 NTP_4_2_5P195 sntp/sntp.1@1.183 +2 -2 NTP_4_2_5P195 util/ntp-keygen-opts.c@1.187 +2 -2 NTP_4_2_5P195 util/ntp-keygen-opts.h@1.187 +3 -3 NTP_4_2_5P195 util/ntp-keygen-opts.texi@1.186 +1 -1 NTP_4_2_5P195 util/ntp-keygen.1@1.186 +2 -2 NTP_4_2_5P195 ChangeSet@1.1933, 2009-07-27 06:57:03+00:00, stenn@psp-fb1.ntp.org cvo.sh: Add support for CentOS, Fedora, Slackware, SuSE ChangeLog@1.387 +1 -0 cvo.sh: Add support for CentOS, Fedora, Slackware, SuSE scripts/cvo.sh@1.3 +30 -6 cvo.sh: Add support for CentOS, Fedora, Slackware, SuSE ChangeSet@1.1932, 2009-07-26 07:54:22-04:00, stenn@whimsy.udel.edu NTP_4_2_5P194 TAG: NTP_4_2_5P194 ChangeLog@1.386 +1 -0 NTP_4_2_5P194 gsoc_sntp/sntp-opts.c@1.56 +2 -2 NTP_4_2_5P194 gsoc_sntp/sntp-opts.h@1.56 +3 -3 NTP_4_2_5P194 gsoc_sntp/sntp-opts.texi@1.56 +1 -1 NTP_4_2_5P194 gsoc_sntp/sntp.1@1.56 +2 -2 NTP_4_2_5P194 ntpd/ntpd-opts.c@1.187 +2 -2 NTP_4_2_5P194 ntpd/ntpd-opts.h@1.187 +3 -3 NTP_4_2_5P194 ntpd/ntpd-opts.texi@1.185 +1 -1 NTP_4_2_5P194 ntpd/ntpd.1@1.185 +2 -2 NTP_4_2_5P194 ntpdc/ntpdc-opts.c@1.183 +2 -2 NTP_4_2_5P194 ntpdc/ntpdc-opts.h@1.183 +3 -3 NTP_4_2_5P194 ntpdc/ntpdc-opts.texi@1.182 +1 -1 NTP_4_2_5P194 ntpdc/ntpdc.1@1.182 +2 -2 NTP_4_2_5P194 ntpq/ntpq-opts.c@1.183 +2 -2 NTP_4_2_5P194 ntpq/ntpq-opts.h@1.183 +3 -3 NTP_4_2_5P194 ntpq/ntpq-opts.texi@1.182 +1 -1 NTP_4_2_5P194 ntpq/ntpq.1@1.182 +2 -2 NTP_4_2_5P194 ntpsnmpd/ntpsnmpd-opts.c@1.63 +2 -2 NTP_4_2_5P194 ntpsnmpd/ntpsnmpd-opts.h@1.63 +3 -3 NTP_4_2_5P194 ntpsnmpd/ntpsnmpd-opts.texi@1.63 +1 -1 NTP_4_2_5P194 ntpsnmpd/ntpsnmpd.1@1.63 +2 -2 NTP_4_2_5P194 packageinfo.sh@1.197 +1 -1 NTP_4_2_5P194 sntp/sntp-opts.c@1.183 +2 -2 NTP_4_2_5P194 sntp/sntp-opts.h@1.183 +3 -3 NTP_4_2_5P194 sntp/sntp-opts.texi@1.182 +1 -1 NTP_4_2_5P194 sntp/sntp.1@1.182 +2 -2 NTP_4_2_5P194 util/ntp-keygen-opts.c@1.186 +2 -2 NTP_4_2_5P194 util/ntp-keygen-opts.h@1.186 +3 -3 NTP_4_2_5P194 util/ntp-keygen-opts.texi@1.185 +1 -1 NTP_4_2_5P194 util/ntp-keygen.1@1.185 +2 -2 NTP_4_2_5P194 ChangeSet@1.1931, 2009-07-25 22:36:56-04:00, stenn@psp-deb1.ntp.org Handle debian scripts/cvo.sh@1.2 +5 -0 Handle debian ChangeSet@1.1930, 2009-07-25 22:36:32-04:00, stenn@psp-deb1.ntp.org better sanity checking in "build" build@1.28 +3 -0 better sanity checking in "build" ChangeSet@1.1929, 2009-07-25 21:47:07-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.385 +1 -0 Documentation updates from Dave Mills html/debug.html@1.27 +6 -5 Documentation updates from Dave Mills ChangeSet@1.1928, 2009-07-25 21:41:08-04:00, stenn@whimsy.udel.edu Use scripts/cvo.sh in the build script to get better subdir names ChangeLog@1.384 +1 -0 Use scripts/cvo.sh in the build script to get better subdir names build@1.27 +1 -1 Use scripts/cvo.sh in the build script to get better subdir names scripts/cvo.sh@1.1 +120 -0 BitKeeper file /deacon/backroom/ntp-dev/scripts/cvo.sh scripts/cvo.sh@1.0 +0 -0 ChangeSet@1.1927, 2009-07-25 07:54:56-04:00, stenn@whimsy.udel.edu NTP_4_2_5P193 TAG: NTP_4_2_5P193 ChangeLog@1.383 +1 -0 NTP_4_2_5P193 gsoc_sntp/sntp-opts.c@1.55 +2 -2 NTP_4_2_5P193 gsoc_sntp/sntp-opts.h@1.55 +3 -3 NTP_4_2_5P193 gsoc_sntp/sntp-opts.texi@1.55 +1 -1 NTP_4_2_5P193 gsoc_sntp/sntp.1@1.55 +2 -2 NTP_4_2_5P193 ntpd/ntpd-opts.c@1.186 +2 -2 NTP_4_2_5P193 ntpd/ntpd-opts.h@1.186 +3 -3 NTP_4_2_5P193 ntpd/ntpd-opts.texi@1.184 +1 -1 NTP_4_2_5P193 ntpd/ntpd.1@1.184 +2 -2 NTP_4_2_5P193 ntpdc/ntpdc-opts.c@1.182 +2 -2 NTP_4_2_5P193 ntpdc/ntpdc-opts.h@1.182 +3 -3 NTP_4_2_5P193 ntpdc/ntpdc-opts.texi@1.181 +1 -1 NTP_4_2_5P193 ntpdc/ntpdc.1@1.181 +2 -2 NTP_4_2_5P193 ntpq/ntpq-opts.c@1.182 +2 -2 NTP_4_2_5P193 ntpq/ntpq-opts.h@1.182 +3 -3 NTP_4_2_5P193 ntpq/ntpq-opts.texi@1.181 +1 -1 NTP_4_2_5P193 ntpq/ntpq.1@1.181 +2 -2 NTP_4_2_5P193 ntpsnmpd/ntpsnmpd-opts.c@1.62 +2 -2 NTP_4_2_5P193 ntpsnmpd/ntpsnmpd-opts.h@1.62 +3 -3 NTP_4_2_5P193 ntpsnmpd/ntpsnmpd-opts.texi@1.62 +1 -1 NTP_4_2_5P193 ntpsnmpd/ntpsnmpd.1@1.62 +2 -2 NTP_4_2_5P193 packageinfo.sh@1.196 +1 -1 NTP_4_2_5P193 sntp/sntp-opts.c@1.182 +2 -2 NTP_4_2_5P193 sntp/sntp-opts.h@1.182 +3 -3 NTP_4_2_5P193 sntp/sntp-opts.texi@1.181 +1 -1 NTP_4_2_5P193 sntp/sntp.1@1.181 +2 -2 NTP_4_2_5P193 util/ntp-keygen-opts.c@1.185 +2 -2 NTP_4_2_5P193 util/ntp-keygen-opts.h@1.185 +3 -3 NTP_4_2_5P193 util/ntp-keygen-opts.texi@1.184 +1 -1 NTP_4_2_5P193 util/ntp-keygen.1@1.184 +2 -2 NTP_4_2_5P193 ChangeSet@1.1926, 2009-07-25 01:12:25+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1261] CID 34: simulate_server() rbuf.msg_flags uninitialized. [Bug 1262] CID 35: xpkt.mac uninitialized in simulate_server(). [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks uninitialized tm_zone (arc, chronolog, dumbclock, pcf). [Bug 1264] CID 64: gsoc_sntp on_wire() frees wrong ptr receiving KoD. [Bug 1265] CID 65: CID 66: gsoc_sntp on_wire() leaks x_pkt, r_pkt. [Bug 1266] CID 39: datum_pts_start() uninitialized arg.c_ospeed. [Bug 1267] CID 44: old sntp handle_saving() writes stack garbage to file when clearing. [Bug 1268] CID 63: resolve_hosts() leaks error message buffer. [Bug 1269] CID 74: use assertion to ensure move_fd() does not return negative descriptors. [Bug 1270] CID 70: gsoc_sntp recv_bcst_data mdevadr.ipv6mr_interface uninitialized. ChangeLog@1.382 +14 -0 [Bug 1261] CID 34: simulate_server() rbuf.msg_flags uninitialized. [Bug 1262] CID 35: xpkt.mac uninitialized in simulate_server(). [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks uninitialized tm_zone (arc, chronolog, dumbclock, pcf). [Bug 1264] CID 64: gsoc_sntp on_wire() frees wrong ptr receiving KoD. [Bug 1265] CID 65: CID 66: gsoc_sntp on_wire() leaks x_pkt, r_pkt. [Bug 1266] CID 39: datum_pts_start() uninitialized arg.c_ospeed. [Bug 1267] CID 44: old sntp handle_saving() writes stack garbage to file when clearing. [Bug 1268] CID 63: resolve_hosts() leaks error message buffer. [Bug 1269] CID 74: use assertion to ensure move_fd() does not return negative descriptors. [Bug 1270] CID 70: gsoc_sntp recv_bcst_data mdevadr.ipv6mr_interface uninitialized. gsoc_sntp/main.c@1.16 +7 -10 [Bug 1264] CID 64: gsoc_sntp on_wire() frees wrong ptr receiving KoD. [Bug 1265] CID 65: CID 66: gsoc_sntp on_wire() leaks x_pkt, r_pkt. gsoc_sntp/networking.c@1.21 +3 -3 [Bug 1268] CID 63: resolve_hosts() leaks error message buffer. [Bug 1270] CID 70: gsoc_sntp recv_bcst_data mdevadr.ipv6mr_interface uninitialized. ntpd/ntp_io.c@1.293 +2 -0 [Bug 1269] CID 74: use assertion to ensure move_fd() does not return negative descriptors. ntpd/ntpsim.c@1.22 +3 -0 [Bug 1261] CID 34: simulate_server() rbuf.msg_flags uninitialized. [Bug 1262] CID 35: xpkt.mac uninitialized in simulate_server(). ntpd/refclock_arc.c@1.21 +129 -127 [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks uninitialized tm_zone (arc, chronolog, dumbclock, pcf). ntpd/refclock_chronolog.c@1.8 +2 -0 [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks uninitialized tm_zone (arc, chronolog, dumbclock, pcf). ntpd/refclock_datum.c@1.12 +2 -0 [Bug 1266] CID 39: datum_pts_start() uninitialized arg.c_ospeed. ntpd/refclock_dumbclock.c@1.13 +20 -26 [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks uninitialized tm_zone (arc, chronolog, dumbclock, pcf). ntpd/refclock_pcf.c@1.9 +2 -0 [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks uninitialized tm_zone (arc, chronolog, dumbclock, pcf). ports/winnt/include/config.h@1.72 +2 -1 Enable dumbclock, Chronolog refclock drivers in Windows ntpd ports/winnt/ntpd/ntpd.dsp@1.32 +4 -0 add refclock_chronolog.c ports/winnt/ntpd/ntpd.vcproj@1.12 +4 -0 add refclock_chronolog.c sntp/main.c@1.9 +2 -0 zero stack buffer before writing to file in save_clear operation ChangeSet@1.1925, 2009-07-24 08:00:56-04:00, stenn@whimsy.udel.edu NTP_4_2_5P192 TAG: NTP_4_2_5P192 ChangeLog@1.381 +1 -0 NTP_4_2_5P192 gsoc_sntp/sntp-opts.c@1.54 +2 -2 NTP_4_2_5P192 gsoc_sntp/sntp-opts.h@1.54 +3 -3 NTP_4_2_5P192 gsoc_sntp/sntp-opts.texi@1.54 +1 -1 NTP_4_2_5P192 gsoc_sntp/sntp.1@1.54 +2 -2 NTP_4_2_5P192 ntpd/ntpd-opts.c@1.185 +2 -2 NTP_4_2_5P192 ntpd/ntpd-opts.h@1.185 +3 -3 NTP_4_2_5P192 ntpd/ntpd-opts.texi@1.183 +1 -1 NTP_4_2_5P192 ntpd/ntpd.1@1.183 +2 -2 NTP_4_2_5P192 ntpdc/ntpdc-opts.c@1.181 +2 -2 NTP_4_2_5P192 ntpdc/ntpdc-opts.h@1.181 +3 -3 NTP_4_2_5P192 ntpdc/ntpdc-opts.texi@1.180 +1 -1 NTP_4_2_5P192 ntpdc/ntpdc.1@1.180 +2 -2 NTP_4_2_5P192 ntpq/ntpq-opts.c@1.181 +2 -2 NTP_4_2_5P192 ntpq/ntpq-opts.h@1.181 +3 -3 NTP_4_2_5P192 ntpq/ntpq-opts.texi@1.180 +1 -1 NTP_4_2_5P192 ntpq/ntpq.1@1.180 +2 -2 NTP_4_2_5P192 ntpsnmpd/ntpsnmpd-opts.c@1.61 +2 -2 NTP_4_2_5P192 ntpsnmpd/ntpsnmpd-opts.h@1.61 +3 -3 NTP_4_2_5P192 ntpsnmpd/ntpsnmpd-opts.texi@1.61 +1 -1 NTP_4_2_5P192 ntpsnmpd/ntpsnmpd.1@1.61 +2 -2 NTP_4_2_5P192 packageinfo.sh@1.195 +1 -1 NTP_4_2_5P192 sntp/sntp-opts.c@1.181 +2 -2 NTP_4_2_5P192 sntp/sntp-opts.h@1.181 +3 -3 NTP_4_2_5P192 sntp/sntp-opts.texi@1.180 +1 -1 NTP_4_2_5P192 sntp/sntp.1@1.180 +2 -2 NTP_4_2_5P192 util/ntp-keygen-opts.c@1.184 +2 -2 NTP_4_2_5P192 util/ntp-keygen-opts.h@1.184 +3 -3 NTP_4_2_5P192 util/ntp-keygen-opts.texi@1.183 +1 -1 NTP_4_2_5P192 util/ntp-keygen.1@1.183 +2 -2 NTP_4_2_5P192 ChangeSet@1.1922.1.1, 2009-07-24 06:41:17+00:00, davehart@shiny.ad.hartbrothers.com [Bug 965] CID 42: ss_family uninitialized. [Bug 1250] CID 53: kod_init_kod_db() overruns kod_db malloc'd buffer. [Bug 1251] CID 68: search_entry() mishandles dst argument. [Bug 1252] CID 32: Quiet Coverity warning with assertion. [Bug 1253] CID 50: gsoc_sntp/crypto.c auth_init() always returns a list with one entry. [Bug 1254] CID 56: tv_to_str() leaks a struct tm each call. [Bug 1255] CID 55: pkt_output() leaks a copy of each packet. [Bug 1256] CID 51: Coverity doesn't recognize our assertion macros as terminal. [Bug 1257] CID 57: gsoc_sntp auth_init() fails to fclose(keyfile). [Bug 1258] CID 54: gsoc_sntp resolve_hosts() needs simplification. [Bug 1259] CID 59: gsoc_sntp recv_bcast_data() fails to free(rdata) on error paths. [Bug 1260] CID 60: gsoc_sntp recvpkt() fails to free(rdata). ChangeLog@1.378.1.1 +15 -0 [Bug 965] CID 42: ss_family uninitialized. [Bug 1250] CID 53: kod_init_kod_db() overruns kod_db malloc'd buffer. [Bug 1251] CID 68: search_entry() mishandles dst argument. [Bug 1252] CID 32: Quiet Coverity warning with assertion. [Bug 1253] CID 50: gsoc_sntp/crypto.c auth_init() always returns a list with one entry. [Bug 1254] CID 56: tv_to_str() leaks a struct tm each call. [Bug 1255] CID 55: pkt_output() leaks a copy of each packet. [Bug 1256] CID 51: Coverity doesn't recognize our assertion macros as terminal. [Bug 1257] CID 57: gsoc_sntp auth_init() fails to fclose(keyfile). [Bug 1258] CID 54: gsoc_sntp resolve_hosts() needs simplification. [Bug 1259] CID 59: gsoc_sntp recv_bcast_data() fails to free(rdata) on error paths. [Bug 1260] CID 60: gsoc_sntp recvpkt() fails to free(rdata). gsoc_sntp/crypto.c@1.6 +8 -10 use sizeof(buf) rather than hardcode [Bug 1253] CID 50: gsoc_sntp/crypto.c auth_init() always returns a list with one entry. [Bug 1257] CID 57: gsoc_sntp auth_init() fails to fclose(keyfile). gsoc_sntp/kod_management.c@1.9 +55 -40 [Bug 1250] CID 53: kod_init_kod_db() overruns kod_db malloc'd buffer. [Bug 1251] CID 68: search_entry() mishandles dst argument. gsoc_sntp/main.c@1.15 +25 -26 [Bug 1251] CID 68: search_entry() mishandles dst argument. [Bug 1258] CID 54: gsoc_sntp resolve_hosts() needs simplification. gsoc_sntp/networking.c@1.20 +35 -58 [Bug 1258] CID 54: gsoc_sntp resolve_hosts() needs simplification. [Bug 1259] CID 59: gsoc_sntp recv_bcast_data() fails to free(rdata) on error paths. [Bug 1260] CID 60: gsoc_sntp recvpkt() fails to free(rdata). gsoc_sntp/networking.h@1.13 +1 -1 [Bug 1258] CID 54: gsoc_sntp resolve_hosts() needs simplification. gsoc_sntp/utilities.c@1.7 +9 -2 [Bug 1254] CID 56: tv_to_str() leaks a struct tm each call. [Bug 1255] CID 55: pkt_output() leaks a copy of each packet. include/ntp_assert.h@1.3 +46 -13 [Bug 1256] CID 51: Coverity doesn't recognize our assertion macros as terminal. ntpd/refclock_nmea.c@1.42 +1 -0 [Bug 965] CID 42: ss_family uninitialized. ntpdc/ntpdc.c@1.66 +9 -2 [Bug 1252] CID 32: Quiet Coverity warning with assertion. ports/winnt/libntp/libntp.vcproj@1.11 +4 -0 add ntp_assert.h reference ports/winnt/ntpd/ntpd.vcproj@1.11 +4 -0 add ntp_assert.h reference ports/winnt/ntpdc/ntpdc.vcproj@1.4 +4 -0 add ntp_assert.h reference ChangeSet@1.1923, 2009-07-24 01:21:05-04:00, stenn@whimsy.udel.edu Upgrade to autogen-5.9.9pre2 ChangeLog@1.379 +1 -0 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/README@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/ag-char-map.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/autoopts.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/autoopts.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/autoopts/options.h@1.3 +2 -2 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/autoopts/usage-txt.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/boolean.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/compat/compat.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/compat/pathfind.c@1.2 +2 -2 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/compat/windows-config.h@1.2 +3 -3 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/configfile.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/cook.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/enumeration.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/environment.c@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/file.c@1.2 +4 -3 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/genshell.c@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/genshell.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/load.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/m4/libopts.m4@1.3 +4 -4 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/m4/liboptschk.m4@1.2 +4 -3 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/makeshell.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/nested.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/numeric.c@1.2 +9 -8 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/pgusage.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/proto.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/putshell.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/reset.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/restore.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/save.c@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/sort.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/stack.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/streqvcmp.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/text_mmap.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/time.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/usage.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/value-type.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/version.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 gsoc_sntp/libopts/xat-attribute.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/README@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/ag-char-map.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/autoopts.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/autoopts.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/autoopts/options.h@1.3 +2 -2 Upgrade to autogen-5.9.9pre2 libopts/autoopts/usage-txt.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/boolean.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/compat/compat.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/compat/pathfind.c@1.2 +2 -2 Upgrade to autogen-5.9.9pre2 libopts/compat/windows-config.h@1.2 +3 -3 Upgrade to autogen-5.9.9pre2 libopts/configfile.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/cook.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/enumeration.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/environment.c@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/file.c@1.2 +4 -3 Upgrade to autogen-5.9.9pre2 libopts/genshell.c@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/genshell.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/load.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/m4/libopts.m4@1.3 +4 -4 Upgrade to autogen-5.9.9pre2 libopts/m4/liboptschk.m4@1.2 +4 -3 Upgrade to autogen-5.9.9pre2 libopts/makeshell.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/nested.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/numeric.c@1.2 +9 -8 Upgrade to autogen-5.9.9pre2 libopts/pgusage.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/proto.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/putshell.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/reset.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/restore.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/save.c@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/sort.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/stack.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/streqvcmp.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/text_mmap.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/time.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/usage.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/value-type.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/version.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 libopts/xat-attribute.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/README@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/ag-char-map.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/autoopts.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/autoopts.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/autoopts/options.h@1.3 +2 -2 Upgrade to autogen-5.9.9pre2 sntp/libopts/autoopts/usage-txt.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/boolean.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/compat/compat.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/compat/pathfind.c@1.2 +2 -2 Upgrade to autogen-5.9.9pre2 sntp/libopts/compat/windows-config.h@1.2 +3 -3 Upgrade to autogen-5.9.9pre2 sntp/libopts/configfile.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/cook.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/enumeration.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/environment.c@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/file.c@1.2 +4 -3 Upgrade to autogen-5.9.9pre2 sntp/libopts/genshell.c@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/genshell.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/load.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/m4/libopts.m4@1.3 +4 -4 Upgrade to autogen-5.9.9pre2 sntp/libopts/m4/liboptschk.m4@1.2 +4 -3 Upgrade to autogen-5.9.9pre2 sntp/libopts/makeshell.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/nested.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/numeric.c@1.2 +9 -8 Upgrade to autogen-5.9.9pre2 sntp/libopts/pgusage.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/proto.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/putshell.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/reset.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/restore.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/save.c@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/sort.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/stack.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/streqvcmp.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/text_mmap.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/time.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/usage.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/value-type.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/version.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre2 sntp/libopts/xat-attribute.h@1.3 +1 -1 Upgrade to autogen-5.9.9pre2 ChangeSet@1.1922, 2009-07-21 07:59:39-04:00, stenn@whimsy.udel.edu NTP_4_2_5P191 TAG: NTP_4_2_5P191 ChangeLog@1.378 +1 -0 NTP_4_2_5P191 gsoc_sntp/sntp-opts.c@1.53 +2 -2 NTP_4_2_5P191 gsoc_sntp/sntp-opts.h@1.53 +3 -3 NTP_4_2_5P191 gsoc_sntp/sntp-opts.texi@1.53 +1 -1 NTP_4_2_5P191 gsoc_sntp/sntp.1@1.53 +2 -2 NTP_4_2_5P191 ntpd/ntpd-opts.c@1.184 +2 -2 NTP_4_2_5P191 ntpd/ntpd-opts.h@1.184 +3 -3 NTP_4_2_5P191 ntpd/ntpd-opts.texi@1.182 +1 -1 NTP_4_2_5P191 ntpd/ntpd.1@1.182 +2 -2 NTP_4_2_5P191 ntpdc/ntpdc-opts.c@1.180 +2 -2 NTP_4_2_5P191 ntpdc/ntpdc-opts.h@1.180 +3 -3 NTP_4_2_5P191 ntpdc/ntpdc-opts.texi@1.179 +1 -1 NTP_4_2_5P191 ntpdc/ntpdc.1@1.179 +2 -2 NTP_4_2_5P191 ntpq/ntpq-opts.c@1.180 +2 -2 NTP_4_2_5P191 ntpq/ntpq-opts.h@1.180 +3 -3 NTP_4_2_5P191 ntpq/ntpq-opts.texi@1.179 +1 -1 NTP_4_2_5P191 ntpq/ntpq.1@1.179 +2 -2 NTP_4_2_5P191 ntpsnmpd/ntpsnmpd-opts.c@1.60 +2 -2 NTP_4_2_5P191 ntpsnmpd/ntpsnmpd-opts.h@1.60 +3 -3 NTP_4_2_5P191 ntpsnmpd/ntpsnmpd-opts.texi@1.60 +1 -1 NTP_4_2_5P191 ntpsnmpd/ntpsnmpd.1@1.60 +2 -2 NTP_4_2_5P191 packageinfo.sh@1.194 +1 -1 NTP_4_2_5P191 sntp/sntp-opts.c@1.180 +2 -2 NTP_4_2_5P191 sntp/sntp-opts.h@1.180 +3 -3 NTP_4_2_5P191 sntp/sntp-opts.texi@1.179 +1 -1 NTP_4_2_5P191 sntp/sntp.1@1.179 +2 -2 NTP_4_2_5P191 util/ntp-keygen-opts.c@1.183 +2 -2 NTP_4_2_5P191 util/ntp-keygen-opts.h@1.183 +3 -3 NTP_4_2_5P191 util/ntp-keygen-opts.texi@1.182 +1 -1 NTP_4_2_5P191 util/ntp-keygen.1@1.182 +2 -2 NTP_4_2_5P191 ChangeSet@1.1921, 2009-07-21 04:22:31-04:00, stenn@whimsy.udel.edu Upgrade to autogen-5.9.9pre1 ChangeLog@1.377 +1 -0 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/ag-char-map.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/autoopts/options.h@1.2 +2 -2 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/autoopts/usage-txt.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/environment.c@1.2 +4 -3 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/genshell.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/genshell.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/m4/libopts.m4@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/proto.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/save.c@1.2 +4 -3 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/value-type.c@1.2 +1 -4 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/value-type.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/xat-attribute.c@1.2 +1 -4 Upgrade to autogen-5.9.9pre1 gsoc_sntp/libopts/xat-attribute.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 libopts/ag-char-map.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 libopts/autoopts/options.h@1.2 +2 -2 Upgrade to autogen-5.9.9pre1 libopts/autoopts/usage-txt.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 libopts/environment.c@1.2 +4 -3 Upgrade to autogen-5.9.9pre1 libopts/genshell.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 libopts/genshell.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 libopts/m4/libopts.m4@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 libopts/proto.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 libopts/save.c@1.2 +4 -3 Upgrade to autogen-5.9.9pre1 libopts/value-type.c@1.2 +1 -4 Upgrade to autogen-5.9.9pre1 libopts/value-type.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 libopts/xat-attribute.c@1.2 +1 -4 Upgrade to autogen-5.9.9pre1 libopts/xat-attribute.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 sntp/libopts/ag-char-map.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 sntp/libopts/autoopts/options.h@1.2 +2 -2 Upgrade to autogen-5.9.9pre1 sntp/libopts/autoopts/usage-txt.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 sntp/libopts/environment.c@1.2 +4 -3 Upgrade to autogen-5.9.9pre1 sntp/libopts/genshell.c@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 sntp/libopts/genshell.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 sntp/libopts/m4/libopts.m4@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 sntp/libopts/proto.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 sntp/libopts/save.c@1.2 +4 -3 Upgrade to autogen-5.9.9pre1 sntp/libopts/value-type.c@1.2 +1 -4 Upgrade to autogen-5.9.9pre1 sntp/libopts/value-type.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 sntp/libopts/xat-attribute.c@1.2 +1 -4 Upgrade to autogen-5.9.9pre1 sntp/libopts/xat-attribute.h@1.2 +1 -1 Upgrade to autogen-5.9.9pre1 ChangeSet@1.1920, 2009-07-20 08:08:06-04:00, stenn@whimsy.udel.edu NTP_4_2_5P190 TAG: NTP_4_2_5P190 ChangeLog@1.376 +1 -0 NTP_4_2_5P190 gsoc_sntp/sntp-opts.c@1.52 +2 -2 NTP_4_2_5P190 gsoc_sntp/sntp-opts.h@1.52 +3 -3 NTP_4_2_5P190 gsoc_sntp/sntp-opts.texi@1.52 +1 -1 NTP_4_2_5P190 gsoc_sntp/sntp.1@1.52 +2 -2 NTP_4_2_5P190 ntpd/ntpd-opts.c@1.183 +66 -60 NTP_4_2_5P190 ntpd/ntpd-opts.h@1.183 +75 -56 NTP_4_2_5P190 ntpd/ntpd-opts.texi@1.181 +1 -1 NTP_4_2_5P190 ntpd/ntpd.1@1.181 +4 -4 NTP_4_2_5P190 ntpdc/ntpdc-opts.c@1.179 +2 -2 NTP_4_2_5P190 ntpdc/ntpdc-opts.h@1.179 +3 -3 NTP_4_2_5P190 ntpdc/ntpdc-opts.texi@1.178 +2 -2 NTP_4_2_5P190 ntpdc/ntpdc.1@1.178 +2 -2 NTP_4_2_5P190 ntpq/ntpq-opts.c@1.179 +2 -2 NTP_4_2_5P190 ntpq/ntpq-opts.h@1.179 +3 -3 NTP_4_2_5P190 ntpq/ntpq-opts.texi@1.178 +2 -2 NTP_4_2_5P190 ntpq/ntpq.1@1.178 +2 -2 NTP_4_2_5P190 ntpsnmpd/ntpsnmpd-opts.c@1.59 +66 -63 NTP_4_2_5P190 ntpsnmpd/ntpsnmpd-opts.h@1.59 +48 -29 NTP_4_2_5P190 ntpsnmpd/ntpsnmpd-opts.texi@1.59 +1 -1 NTP_4_2_5P190 ntpsnmpd/ntpsnmpd.1@1.59 +4 -4 NTP_4_2_5P190 packageinfo.sh@1.193 +1 -1 NTP_4_2_5P190 sntp/sntp-opts.c@1.179 +2 -2 NTP_4_2_5P190 sntp/sntp-opts.h@1.179 +3 -3 NTP_4_2_5P190 sntp/sntp-opts.texi@1.178 +1 -1 NTP_4_2_5P190 sntp/sntp.1@1.178 +2 -2 NTP_4_2_5P190 util/ntp-keygen-opts.c@1.182 +2 -2 NTP_4_2_5P190 util/ntp-keygen-opts.h@1.182 +3 -3 NTP_4_2_5P190 util/ntp-keygen-opts.texi@1.181 +2 -2 NTP_4_2_5P190 util/ntp-keygen.1@1.181 +2 -2 NTP_4_2_5P190 ChangeSet@1.1919, 2009-07-20 09:39:06+00:00, davehart@shiny.ad.hartbrothers.com Windows port fixes for new Autogen and libopts ports/winnt/include/config.h@1.71 +5 -0 Windows port fixes for new Autogen and libopts ports/winnt/include/inttypes.h@1.1 +1 -0 add dummy (empty) inttypes.h to work around problem with new libopts ports/winnt/include/inttypes.h@1.0 +0 -0 ports/winnt/libntp/libntp.dsp@1.36 +4 -0 add dummy (empty) inttypes.h to work around problem with new libopts ports/winnt/libntp/libntp.vcproj@1.10 +4 -0 add dummy (empty) inttypes.h to work around problem with new libopts ChangeSet@1.1918, 2009-07-20 05:20:37-04:00, stenn@whimsy.udel.edu Updated to AutoGen-5.9.8 gsoc_sntp/sntp-opts.c@1.51 +65 -62 Updated to AutoGen-5.9.8 gsoc_sntp/sntp-opts.h@1.51 +56 -37 Updated to AutoGen-5.9.8 gsoc_sntp/sntp-opts.texi@1.51 +1 -1 Updated to AutoGen-5.9.8 gsoc_sntp/sntp.1@1.51 +4 -4 Updated to AutoGen-5.9.8 ntpdc/ntpdc-opts.c@1.178 +67 -68 Updated to AutoGen-5.9.8 ntpdc/ntpdc-opts.h@1.178 +54 -35 Updated to AutoGen-5.9.8 ntpdc/ntpdc-opts.texi@1.177 +2 -2 Updated to AutoGen-5.9.8 ntpdc/ntpdc.1@1.177 +4 -4 Updated to AutoGen-5.9.8 ntpq/ntpq-opts.c@1.178 +67 -68 Updated to AutoGen-5.9.8 ntpq/ntpq-opts.h@1.178 +52 -33 Updated to AutoGen-5.9.8 ntpq/ntpq-opts.texi@1.177 +2 -2 Updated to AutoGen-5.9.8 ntpq/ntpq.1@1.177 +4 -4 Updated to AutoGen-5.9.8 sntp/sntp-opts.c@1.178 +81 -81 Updated to AutoGen-5.9.8 sntp/sntp-opts.h@1.178 +52 -33 Updated to AutoGen-5.9.8 sntp/sntp-opts.texi@1.177 +1 -1 Updated to AutoGen-5.9.8 sntp/sntp.1@1.177 +4 -4 Updated to AutoGen-5.9.8 util/ntp-keygen-opts.c@1.181 +90 -91 Updated to AutoGen-5.9.8 util/ntp-keygen-opts.h@1.181 +62 -43 Updated to AutoGen-5.9.8 util/ntp-keygen-opts.texi@1.180 +2 -2 Updated to AutoGen-5.9.8 util/ntp-keygen.1@1.180 +4 -4 Updated to AutoGen-5.9.8 ChangeSet@1.1917, 2009-07-20 04:59:15-04:00, stenn@whimsy.udel.edu Updated to AutoGen-5.9.8 gsoc_sntp/Makefile.am@1.8 +1 -1 Updated to AutoGen-5.9.8 ChangeSet@1.1916, 2009-07-20 04:52:47-04:00, stenn@whimsy.udel.edu Updated to AutoGen-5.9.8 ChangeLog@1.375 +1 -0 Updated to AutoGen-5.9.8 ChangeSet@1.1915, 2009-07-20 04:45:24-04:00, stenn@whimsy.udel.edu Updated to AutoGen-5.9.8 BitKeeper/deleted/.del-COPYING.lgpl~1ddc43fbfc0a8d91@1.2 +0 -0 Delete: libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.lgpl~356acd7e9a658616@1.3 +0 -0 Delete: gsoc_sntp/libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.lgpl~91629dd76e5e4436@1.2 +0 -0 Delete: sntp/libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.mbsd~506f41bf4379b14b@1.2 +0 -0 Delete: libopts/COPYING.mbsd BitKeeper/deleted/.del-COPYING.mbsd~c869a8655e2d3668@1.3 +0 -0 Delete: gsoc_sntp/libopts/COPYING.mbsd BitKeeper/deleted/.del-COPYING.mbsd~dc651c8bedf8ab57@1.2 +0 -0 Delete: sntp/libopts/COPYING.mbsd BitKeeper/deleted/.del-MakeDefs.inc~31cdb1dbe002e14a@1.2 +0 -0 Delete: libopts/MakeDefs.inc BitKeeper/deleted/.del-MakeDefs.inc~3c0055ac72058207@1.2 +0 -0 Delete: sntp/libopts/MakeDefs.inc BitKeeper/deleted/.del-MakeDefs.inc~eeacd10582f902ab@1.3 +0 -0 Delete: gsoc_sntp/libopts/MakeDefs.inc BitKeeper/deleted/.del-Makefile.am~2469a6a54aac94a1@1.3 +0 -0 Delete: gsoc_sntp/libopts/Makefile.am BitKeeper/deleted/.del-Makefile.am~83bfe0c1134a9dfb@1.2 +0 -0 Delete: sntp/libopts/Makefile.am BitKeeper/deleted/.del-Makefile.am~92f4a0c4f9cd9ea9@1.2 +0 -0 Delete: libopts/Makefile.am BitKeeper/deleted/.del-README~6c0e8c52bc2917b1@1.2 +0 -0 Delete: libopts/README BitKeeper/deleted/.del-README~b02c8a60f4cf32fe@1.2 +0 -0 Delete: sntp/libopts/README BitKeeper/deleted/.del-README~f742f7fd37644d2@1.3 +0 -0 Delete: gsoc_sntp/libopts/README BitKeeper/deleted/.del-autoopts.c~3e84323623aff6e7@1.2 +0 -0 Delete: libopts/autoopts.c BitKeeper/deleted/.del-autoopts.c~9fb35908790bfaa9@1.3 +0 -0 Delete: gsoc_sntp/libopts/autoopts.c BitKeeper/deleted/.del-autoopts.c~b42b972a53764910@1.2 +0 -0 Delete: sntp/libopts/autoopts.c BitKeeper/deleted/.del-autoopts.h~5bc4082052258182@1.2 +0 -0 Delete: libopts/autoopts.h BitKeeper/deleted/.del-autoopts.h~63e256b712b3cc83@1.3 +0 -0 Delete: gsoc_sntp/libopts/autoopts.h BitKeeper/deleted/.del-autoopts.h~7ed5c5ad6dbc0297@1.2 +0 -0 Delete: sntp/libopts/autoopts.h BitKeeper/deleted/.del-boolean.c~131707465ccb681@1.2 +0 -0 Delete: sntp/libopts/boolean.c BitKeeper/deleted/.del-boolean.c~3fc4c58774ba3ff@1.2 +0 -0 Delete: libopts/boolean.c BitKeeper/deleted/.del-boolean.c~7e6a10bd3f3866cf@1.3 +0 -0 Delete: gsoc_sntp/libopts/boolean.c BitKeeper/deleted/.del-compat.h~d62907f830867563@1.2 +0 -0 Delete: libopts/compat/compat.h BitKeeper/deleted/.del-compat.h~d716e3994afa17ee@1.3 +0 -0 Delete: gsoc_sntp/libopts/compat/compat.h BitKeeper/deleted/.del-compat.h~ff97c2854c9b9586@1.2 +0 -0 Delete: sntp/libopts/compat/compat.h BitKeeper/deleted/.del-configfile.c~b6f779d27e6c4608@1.2 +0 -0 Delete: libopts/configfile.c BitKeeper/deleted/.del-configfile.c~b9949d5548dc9e7d@1.2 +0 -0 Delete: sntp/libopts/configfile.c BitKeeper/deleted/.del-configfile.c~bc87cafa8bb69d84@1.3 +0 -0 Delete: gsoc_sntp/libopts/configfile.c BitKeeper/deleted/.del-cook.c~23f6c5524e2fd0b9@1.2 +0 -0 Delete: sntp/libopts/cook.c BitKeeper/deleted/.del-cook.c~d29aaca7ee3c2e03@1.3 +0 -0 Delete: gsoc_sntp/libopts/cook.c BitKeeper/deleted/.del-cook.c~e72da2a3e260c2ae@1.2 +0 -0 Delete: libopts/cook.c BitKeeper/deleted/.del-enumeration.c~1a1ac98e84630322@1.2 +0 -0 Delete: libopts/enumeration.c BitKeeper/deleted/.del-enumeration.c~56f8f00f64229802@1.2 +0 -0 Delete: sntp/libopts/enumeration.c BitKeeper/deleted/.del-enumeration.c~73f8914b25fdf1cb@1.3 +0 -0 Delete: gsoc_sntp/libopts/enumeration.c BitKeeper/deleted/.del-environment.c~3fc0f27d83271522@1.3 +0 -0 Delete: gsoc_sntp/libopts/environment.c BitKeeper/deleted/.del-environment.c~43f215aff8170b0d@1.2 +0 -0 Delete: sntp/libopts/environment.c BitKeeper/deleted/.del-environment.c~654c5635a28f680a@1.2 +0 -0 Delete: libopts/environment.c BitKeeper/deleted/.del-genshell.c~19c1b0098a7d195e@1.2 +0 -0 Delete: sntp/libopts/genshell.c BitKeeper/deleted/.del-genshell.c~8cec4f90c9677dad@1.3 +0 -0 Delete: gsoc_sntp/libopts/genshell.c BitKeeper/deleted/.del-genshell.c~d151b9234159786e@1.2 +0 -0 Delete: libopts/genshell.c BitKeeper/deleted/.del-genshell.h~39a68cd82b716d3d@1.2 +0 -0 Delete: sntp/libopts/genshell.h BitKeeper/deleted/.del-genshell.h~4684aecaf31474bd@1.3 +0 -0 Delete: gsoc_sntp/libopts/genshell.h BitKeeper/deleted/.del-genshell.h~fba29f6d134cf39@1.2 +0 -0 Delete: libopts/genshell.h BitKeeper/deleted/.del-libopts.c~3fdfbf411c197e0b@1.2 +0 -0 Delete: libopts/libopts.c BitKeeper/deleted/.del-libopts.c~d2eaf9d4d9c22da8@1.2 +0 -0 Delete: sntp/libopts/libopts.c BitKeeper/deleted/.del-libopts.c~e6b4ffdc895fd9c7@1.3 +0 -0 Delete: gsoc_sntp/libopts/libopts.c BitKeeper/deleted/.del-libopts.m4~1e6c2484e7bcaa8e@1.2 +0 -0 Delete: sntp/libopts/m4/libopts.m4 BitKeeper/deleted/.del-libopts.m4~22764fd769234d87@1.3 +0 -0 Delete: gsoc_sntp/libopts/m4/libopts.m4 BitKeeper/deleted/.del-libopts.m4~babfee32f8439fb7@1.2 +0 -0 Delete: libopts/m4/libopts.m4 BitKeeper/deleted/.del-liboptschk.m4~5684906422d310d5@1.3 +0 -0 Delete: gsoc_sntp/libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-liboptschk.m4~7f8c6092b16525fa@1.2 +0 -0 Delete: libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-liboptschk.m4~f7c5b75baf234b93@1.2 +0 -0 Delete: sntp/libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-load.c~49f0fde1bda6dab1@1.2 +0 -0 Delete: sntp/libopts/load.c BitKeeper/deleted/.del-load.c~7fe0c22d7c968b7@1.2 +0 -0 Delete: libopts/load.c BitKeeper/deleted/.del-load.c~e9afe1c55b052708@1.3 +0 -0 Delete: gsoc_sntp/libopts/load.c BitKeeper/deleted/.del-makeshell.c~271eaff05907e0a2@1.2 +0 -0 Delete: sntp/libopts/makeshell.c BitKeeper/deleted/.del-makeshell.c~67d09f76ea0a6ed5@1.3 +0 -0 Delete: gsoc_sntp/libopts/makeshell.c BitKeeper/deleted/.del-makeshell.c~ba6349435fd3fc83@1.2 +0 -0 Delete: libopts/makeshell.c BitKeeper/deleted/.del-nested.c~5752e76eefab7f9f@1.2 +0 -0 Delete: libopts/nested.c BitKeeper/deleted/.del-nested.c~7f5db28ad8a858b9@1.3 +0 -0 Delete: gsoc_sntp/libopts/nested.c BitKeeper/deleted/.del-nested.c~a7ab0b07538b5e49@1.2 +0 -0 Delete: sntp/libopts/nested.c BitKeeper/deleted/.del-numeric.c~a21fe674dc3847e2@1.3 +0 -0 Delete: gsoc_sntp/libopts/numeric.c BitKeeper/deleted/.del-numeric.c~ab97d8c3d6609e2a@1.2 +0 -0 Delete: libopts/numeric.c BitKeeper/deleted/.del-numeric.c~e1d7cbb7cecbff8c@1.2 +0 -0 Delete: sntp/libopts/numeric.c BitKeeper/deleted/.del-options.h~56723cc66b175bd8@1.3 +0 -0 Delete: gsoc_sntp/libopts/autoopts/options.h BitKeeper/deleted/.del-options.h~ce496734ff365a8f@1.2 +0 -0 Delete: libopts/autoopts/options.h BitKeeper/deleted/.del-options.h~eaf98d11dd68785b@1.2 +0 -0 Delete: sntp/libopts/autoopts/options.h BitKeeper/deleted/.del-pathfind.c~5eb7c4a7238a3334@1.2 +0 -0 Delete: sntp/libopts/compat/pathfind.c BitKeeper/deleted/.del-pathfind.c~660d016d9d4bfaf0@1.2 +0 -0 Delete: libopts/compat/pathfind.c BitKeeper/deleted/.del-pathfind.c~ad86b5a5886760c0@1.3 +0 -0 Delete: gsoc_sntp/libopts/compat/pathfind.c BitKeeper/deleted/.del-pgusage.c~7a129c2a1b3dc002@1.2 +0 -0 Delete: libopts/pgusage.c BitKeeper/deleted/.del-pgusage.c~8894b938253faf7a@1.3 +0 -0 Delete: gsoc_sntp/libopts/pgusage.c BitKeeper/deleted/.del-pgusage.c~f3a06f0e78822dea@1.2 +0 -0 Delete: sntp/libopts/pgusage.c BitKeeper/deleted/.del-proto.h~322bc5cfd3f14a53@1.2 +0 -0 Delete: libopts/proto.h BitKeeper/deleted/.del-proto.h~600f5c521621fb7@1.2 +0 -0 Delete: sntp/libopts/proto.h BitKeeper/deleted/.del-proto.h~77f289b58b0425ed@1.3 +0 -0 Delete: gsoc_sntp/libopts/proto.h BitKeeper/deleted/.del-putshell.c~454ab3a4821e880@1.3 +0 -0 Delete: gsoc_sntp/libopts/putshell.c BitKeeper/deleted/.del-putshell.c~afc504b27eed29b0@1.2 +0 -0 Delete: sntp/libopts/putshell.c BitKeeper/deleted/.del-putshell.c~b671799440bdb0e6@1.2 +0 -0 Delete: libopts/putshell.c BitKeeper/deleted/.del-restore.c~11e16df450dfc6be@1.3 +0 -0 Delete: gsoc_sntp/libopts/restore.c BitKeeper/deleted/.del-restore.c~4e87dc67454a7987@1.2 +0 -0 Delete: sntp/libopts/restore.c BitKeeper/deleted/.del-restore.c~a699a151ee8b8476@1.2 +0 -0 Delete: libopts/restore.c BitKeeper/deleted/.del-save.c~4b1d83a0b1611d7c@1.3 +0 -0 Delete: sntp/libopts/save.c BitKeeper/deleted/.del-save.c~efa5c354e672893a@1.4 +0 -0 Delete: gsoc_sntp/libopts/save.c BitKeeper/deleted/.del-save.c~f88133d32eccbf4b@1.3 +0 -0 Delete: libopts/save.c BitKeeper/deleted/.del-snprintf.c~147cb0d37c1e7307@1.2 +0 -0 Delete: sntp/libopts/compat/snprintf.c BitKeeper/deleted/.del-snprintf.c~8f0c3b04d748ef30@1.2 +0 -0 Delete: libopts/compat/snprintf.c BitKeeper/deleted/.del-snprintf.c~d3120f77949ff1f1@1.3 +0 -0 Delete: gsoc_sntp/libopts/compat/snprintf.c BitKeeper/deleted/.del-sort.c~2a84210ffa0f5197@1.2 +0 -0 Delete: sntp/libopts/sort.c BitKeeper/deleted/.del-sort.c~3d68b8c2f01ade31@1.3 +0 -0 Delete: gsoc_sntp/libopts/sort.c BitKeeper/deleted/.del-sort.c~91f412b45a139031@1.2 +0 -0 Delete: libopts/sort.c BitKeeper/deleted/.del-stack.c~3275408d176af9c1@1.3 +0 -0 Delete: gsoc_sntp/libopts/stack.c BitKeeper/deleted/.del-stack.c~591385237e0f3ce2@1.2 +0 -0 Delete: libopts/stack.c BitKeeper/deleted/.del-stack.c~ade9ed5bb7b8fb6c@1.2 +0 -0 Delete: sntp/libopts/stack.c BitKeeper/deleted/.del-strchr.c~45ec0a98e0025509@1.2 +0 -0 Delete: libopts/compat/strchr.c BitKeeper/deleted/.del-strchr.c~62e63feb4f1bb259@1.3 +0 -0 Delete: gsoc_sntp/libopts/compat/strchr.c BitKeeper/deleted/.del-strchr.c~ee5d954d3d137acf@1.2 +0 -0 Delete: sntp/libopts/compat/strchr.c BitKeeper/deleted/.del-strdup.c~516aa8c43634df59@1.2 +0 -0 Delete: sntp/libopts/compat/strdup.c BitKeeper/deleted/.del-strdup.c~bf4073cb7820ac7e@1.2 +0 -0 Delete: libopts/compat/strdup.c BitKeeper/deleted/.del-strdup.c~f6c99142400aadb0@1.3 +0 -0 Delete: gsoc_sntp/libopts/compat/strdup.c BitKeeper/deleted/.del-streqvcmp.c~2b8aaed8d8cbdfa@1.3 +0 -0 Delete: gsoc_sntp/libopts/streqvcmp.c BitKeeper/deleted/.del-streqvcmp.c~3a8c4c9ed2c0bb96@1.2 +0 -0 Delete: libopts/streqvcmp.c BitKeeper/deleted/.del-streqvcmp.c~7c57f427df22897@1.2 +0 -0 Delete: sntp/libopts/streqvcmp.c BitKeeper/deleted/.del-text_mmap.c~24b4f1774aa17978@1.2 +0 -0 Delete: sntp/libopts/text_mmap.c BitKeeper/deleted/.del-text_mmap.c~73112689c5763d@1.3 +0 -0 Delete: gsoc_sntp/libopts/text_mmap.c BitKeeper/deleted/.del-text_mmap.c~d9d668bcff3485b5@1.2 +0 -0 Delete: libopts/text_mmap.c BitKeeper/deleted/.del-tokenize.c~4fd8a727c28d24c@1.3 +0 -0 Delete: gsoc_sntp/libopts/tokenize.c BitKeeper/deleted/.del-tokenize.c~a50a40638aa720cf@1.2 +0 -0 Delete: sntp/libopts/tokenize.c BitKeeper/deleted/.del-tokenize.c~fffe49aa64a78644@1.2 +0 -0 Delete: libopts/tokenize.c BitKeeper/deleted/.del-usage-txt.h~36c2f46a3cd8cbd@1.2 +0 -0 Delete: sntp/libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage-txt.h~6abe748ce418395@1.3 +0 -0 Delete: gsoc_sntp/libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage-txt.h~6fa28bed13f28bc9@1.2 +0 -0 Delete: libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage.c~79a0f715733bdccf@1.2 +0 -0 Delete: libopts/usage.c BitKeeper/deleted/.del-usage.c~e8da7f6b2f71a374@1.3 +0 -0 Delete: gsoc_sntp/libopts/usage.c BitKeeper/deleted/.del-usage.c~eb257c90352f0b1a@1.2 +0 -0 Delete: sntp/libopts/usage.c BitKeeper/deleted/.del-version.c~45de4739ab05f47b@1.3 +0 -0 Delete: gsoc_sntp/libopts/version.c BitKeeper/deleted/.del-version.c~96adea57d42d29f6@1.2 +0 -0 Delete: sntp/libopts/version.c BitKeeper/deleted/.del-version.c~f18bf6a7860ad7f7@1.2 +0 -0 Delete: libopts/version.c BitKeeper/deleted/.del-windows-config.h~1665be9c16e9725d@1.2 +0 -0 Delete: sntp/libopts/compat/windows-config.h BitKeeper/deleted/.del-windows-config.h~c8c7442a9420d50@1.2 +0 -0 Delete: libopts/compat/windows-config.h BitKeeper/deleted/.del-windows-config.h~e3ddaca75ec0f439@1.3 +0 -0 Delete: gsoc_sntp/libopts/compat/windows-config.h gsoc_sntp/libopts/COPYING.gplv3@1.1 +674 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/COPYING.gplv3 gsoc_sntp/libopts/COPYING.gplv3@1.0 +0 -0 gsoc_sntp/libopts/COPYING.lgplv3@1.1 +165 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/COPYING.lgplv3 gsoc_sntp/libopts/COPYING.lgplv3@1.0 +0 -0 gsoc_sntp/libopts/COPYING.mbsd@1.1 +26 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/COPYING.mbsd gsoc_sntp/libopts/COPYING.mbsd@1.0 +0 -0 gsoc_sntp/libopts/MakeDefs.inc@1.1 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/MakeDefs.inc gsoc_sntp/libopts/MakeDefs.inc@1.0 +0 -0 gsoc_sntp/libopts/Makefile.am@1.1 +28 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/Makefile.am gsoc_sntp/libopts/Makefile.am@1.0 +0 -0 gsoc_sntp/libopts/README@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/README gsoc_sntp/libopts/README@1.0 +0 -0 gsoc_sntp/libopts/ag-char-map.h@1.1 +129 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/ag-char-map.h gsoc_sntp/libopts/ag-char-map.h@1.0 +0 -0 gsoc_sntp/libopts/autoopts.c@1.1 +1164 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/autoopts.c gsoc_sntp/libopts/autoopts.c@1.0 +0 -0 gsoc_sntp/libopts/autoopts.h@1.1 +364 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/autoopts.h gsoc_sntp/libopts/autoopts.h@1.0 +0 -0 gsoc_sntp/libopts/autoopts/options.h@1.1 +1055 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/autoopts/options.h gsoc_sntp/libopts/autoopts/options.h@1.0 +0 -0 gsoc_sntp/libopts/autoopts/usage-txt.h@1.1 +393 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/autoopts/usage-txt.h gsoc_sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0 gsoc_sntp/libopts/boolean.c@1.1 +91 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/boolean.c gsoc_sntp/libopts/boolean.c@1.0 +0 -0 gsoc_sntp/libopts/compat/compat.h@1.1 +366 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/compat/compat.h gsoc_sntp/libopts/compat/compat.h@1.0 +0 -0 gsoc_sntp/libopts/compat/pathfind.c@1.1 +338 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/compat/pathfind.c gsoc_sntp/libopts/compat/pathfind.c@1.0 +0 -0 gsoc_sntp/libopts/compat/snprintf.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/compat/snprintf.c gsoc_sntp/libopts/compat/snprintf.c@1.0 +0 -0 gsoc_sntp/libopts/compat/strchr.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/compat/strchr.c gsoc_sntp/libopts/compat/strchr.c@1.0 +0 -0 gsoc_sntp/libopts/compat/strdup.c@1.1 +19 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/compat/strdup.c gsoc_sntp/libopts/compat/strdup.c@1.0 +0 -0 gsoc_sntp/libopts/compat/windows-config.h@1.1 +147 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/compat/windows-config.h gsoc_sntp/libopts/compat/windows-config.h@1.0 +0 -0 gsoc_sntp/libopts/configfile.c@1.1 +1251 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/configfile.c gsoc_sntp/libopts/configfile.c@1.0 +0 -0 gsoc_sntp/libopts/cook.c@1.1 +293 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/cook.c gsoc_sntp/libopts/cook.c@1.0 +0 -0 gsoc_sntp/libopts/enumeration.c@1.1 +512 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/enumeration.c gsoc_sntp/libopts/enumeration.c@1.0 +0 -0 gsoc_sntp/libopts/environment.c@1.1 +240 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/environment.c gsoc_sntp/libopts/environment.c@1.0 +0 -0 gsoc_sntp/libopts/file.c@1.1 +169 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/file.c gsoc_sntp/libopts/file.c@1.0 +0 -0 gsoc_sntp/libopts/genshell.c@1.1 +358 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/genshell.c gsoc_sntp/libopts/genshell.c@1.0 +0 -0 gsoc_sntp/libopts/genshell.h@1.1 +165 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/genshell.h gsoc_sntp/libopts/genshell.h@1.0 +0 -0 gsoc_sntp/libopts/libopts.c@1.1 +38 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/libopts.c gsoc_sntp/libopts/libopts.c@1.0 +0 -0 gsoc_sntp/libopts/load.c@1.1 +540 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/load.c gsoc_sntp/libopts/load.c@1.0 +0 -0 gsoc_sntp/libopts/m4/libopts.m4@1.1 +548 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/m4/libopts.m4 gsoc_sntp/libopts/m4/libopts.m4@1.0 +0 -0 gsoc_sntp/libopts/m4/liboptschk.m4@1.1 +42 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/m4/liboptschk.m4 gsoc_sntp/libopts/m4/liboptschk.m4@1.0 +0 -0 gsoc_sntp/libopts/makeshell.c@1.1 +1099 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/makeshell.c gsoc_sntp/libopts/makeshell.c@1.0 +0 -0 gsoc_sntp/libopts/nested.c@1.1 +843 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/nested.c gsoc_sntp/libopts/nested.c@1.0 +0 -0 gsoc_sntp/libopts/numeric.c@1.1 +175 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/numeric.c gsoc_sntp/libopts/numeric.c@1.0 +0 -0 gsoc_sntp/libopts/parse-duration.c@1.1 +582 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/parse-duration.c gsoc_sntp/libopts/parse-duration.c@1.0 +0 -0 gsoc_sntp/libopts/parse-duration.h@1.1 +82 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/parse-duration.h gsoc_sntp/libopts/parse-duration.h@1.0 +0 -0 gsoc_sntp/libopts/pgusage.c@1.1 +140 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/pgusage.c gsoc_sntp/libopts/pgusage.c@1.0 +0 -0 gsoc_sntp/libopts/proto.h@1.1 +112 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/proto.h gsoc_sntp/libopts/proto.h@1.0 +0 -0 gsoc_sntp/libopts/putshell.c@1.1 +320 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/putshell.c gsoc_sntp/libopts/putshell.c@1.0 +0 -0 gsoc_sntp/libopts/reset.c@1.1 +128 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/reset.c gsoc_sntp/libopts/reset.c@1.0 +0 -0 gsoc_sntp/libopts/restore.c@1.1 +227 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/restore.c gsoc_sntp/libopts/restore.c@1.0 +0 -0 gsoc_sntp/libopts/save.c@1.1 +790 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/save.c gsoc_sntp/libopts/save.c@1.0 +0 -0 gsoc_sntp/libopts/sort.c@1.1 +336 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/sort.c gsoc_sntp/libopts/sort.c@1.0 +0 -0 gsoc_sntp/libopts/stack.c@1.1 +264 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/stack.c gsoc_sntp/libopts/stack.c@1.0 +0 -0 gsoc_sntp/libopts/streqvcmp.c@1.1 +266 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/streqvcmp.c gsoc_sntp/libopts/streqvcmp.c@1.0 +0 -0 gsoc_sntp/libopts/text_mmap.c@1.1 +383 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/text_mmap.c gsoc_sntp/libopts/text_mmap.c@1.0 +0 -0 gsoc_sntp/libopts/time.c@1.1 +88 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/time.c gsoc_sntp/libopts/time.c@1.0 +0 -0 gsoc_sntp/libopts/tokenize.c@1.1 +323 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/tokenize.c gsoc_sntp/libopts/tokenize.c@1.0 +0 -0 gsoc_sntp/libopts/usage.c@1.1 +756 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/usage.c gsoc_sntp/libopts/usage.c@1.0 +0 -0 gsoc_sntp/libopts/value-type.c@1.1 +123 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/value-type.c gsoc_sntp/libopts/value-type.c@1.0 +0 -0 gsoc_sntp/libopts/value-type.h@1.1 +25 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/value-type.h gsoc_sntp/libopts/value-type.h@1.0 +0 -0 gsoc_sntp/libopts/version.c@1.1 +157 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/version.c gsoc_sntp/libopts/version.c@1.0 +0 -0 gsoc_sntp/libopts/xat-attribute.c@1.1 +114 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/xat-attribute.c gsoc_sntp/libopts/xat-attribute.c@1.0 +0 -0 gsoc_sntp/libopts/xat-attribute.h@1.1 +22 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/xat-attribute.h gsoc_sntp/libopts/xat-attribute.h@1.0 +0 -0 libopts/COPYING.gplv3@1.1 +674 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.gplv3 libopts/COPYING.gplv3@1.0 +0 -0 libopts/COPYING.lgplv3@1.1 +165 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.lgplv3 libopts/COPYING.lgplv3@1.0 +0 -0 libopts/COPYING.mbsd@1.1 +26 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.mbsd libopts/COPYING.mbsd@1.0 +0 -0 libopts/MakeDefs.inc@1.1 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/MakeDefs.inc libopts/MakeDefs.inc@1.0 +0 -0 libopts/Makefile.am@1.1 +28 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/Makefile.am libopts/Makefile.am@1.0 +0 -0 libopts/README@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/README libopts/README@1.0 +0 -0 libopts/ag-char-map.h@1.1 +129 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/ag-char-map.h libopts/ag-char-map.h@1.0 +0 -0 libopts/autoopts.c@1.1 +1164 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts.c libopts/autoopts.c@1.0 +0 -0 libopts/autoopts.h@1.1 +364 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts.h libopts/autoopts.h@1.0 +0 -0 libopts/autoopts/options.h@1.1 +1055 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts/options.h libopts/autoopts/options.h@1.0 +0 -0 libopts/autoopts/usage-txt.h@1.1 +393 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts/usage-txt.h libopts/autoopts/usage-txt.h@1.0 +0 -0 libopts/boolean.c@1.1 +91 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/boolean.c libopts/boolean.c@1.0 +0 -0 libopts/compat/compat.h@1.1 +366 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/compat.h libopts/compat/compat.h@1.0 +0 -0 libopts/compat/pathfind.c@1.1 +338 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/pathfind.c libopts/compat/pathfind.c@1.0 +0 -0 libopts/compat/snprintf.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/snprintf.c libopts/compat/snprintf.c@1.0 +0 -0 libopts/compat/strchr.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strchr.c libopts/compat/strchr.c@1.0 +0 -0 libopts/compat/strdup.c@1.1 +19 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strdup.c libopts/compat/strdup.c@1.0 +0 -0 libopts/compat/windows-config.h@1.1 +147 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/windows-config.h libopts/compat/windows-config.h@1.0 +0 -0 libopts/configfile.c@1.1 +1251 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/configfile.c libopts/configfile.c@1.0 +0 -0 libopts/cook.c@1.1 +293 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/cook.c libopts/cook.c@1.0 +0 -0 libopts/enumeration.c@1.1 +512 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/enumeration.c libopts/enumeration.c@1.0 +0 -0 libopts/environment.c@1.1 +240 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/environment.c libopts/environment.c@1.0 +0 -0 libopts/file.c@1.1 +169 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/file.c libopts/file.c@1.0 +0 -0 libopts/genshell.c@1.1 +358 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/genshell.c libopts/genshell.c@1.0 +0 -0 libopts/genshell.h@1.1 +165 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/genshell.h libopts/genshell.h@1.0 +0 -0 libopts/libopts.c@1.1 +38 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/libopts.c libopts/libopts.c@1.0 +0 -0 libopts/load.c@1.1 +540 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/load.c libopts/load.c@1.0 +0 -0 libopts/m4/libopts.m4@1.1 +548 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/libopts.m4 libopts/m4/libopts.m4@1.0 +0 -0 libopts/m4/liboptschk.m4@1.1 +42 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/liboptschk.m4 libopts/m4/liboptschk.m4@1.0 +0 -0 libopts/makeshell.c@1.1 +1099 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/makeshell.c libopts/makeshell.c@1.0 +0 -0 libopts/nested.c@1.1 +843 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/nested.c libopts/nested.c@1.0 +0 -0 libopts/numeric.c@1.1 +175 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/numeric.c libopts/numeric.c@1.0 +0 -0 libopts/parse-duration.c@1.1 +582 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/parse-duration.c libopts/parse-duration.c@1.0 +0 -0 libopts/parse-duration.h@1.1 +82 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/parse-duration.h libopts/parse-duration.h@1.0 +0 -0 libopts/pgusage.c@1.1 +140 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/pgusage.c libopts/pgusage.c@1.0 +0 -0 libopts/proto.h@1.1 +112 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/proto.h libopts/proto.h@1.0 +0 -0 libopts/putshell.c@1.1 +320 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/putshell.c libopts/putshell.c@1.0 +0 -0 libopts/reset.c@1.1 +128 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/reset.c libopts/reset.c@1.0 +0 -0 libopts/restore.c@1.1 +227 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/restore.c libopts/restore.c@1.0 +0 -0 libopts/save.c@1.1 +790 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/save.c libopts/save.c@1.0 +0 -0 libopts/sort.c@1.1 +336 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/sort.c libopts/sort.c@1.0 +0 -0 libopts/stack.c@1.1 +264 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/stack.c libopts/stack.c@1.0 +0 -0 libopts/streqvcmp.c@1.1 +266 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/streqvcmp.c libopts/streqvcmp.c@1.0 +0 -0 libopts/text_mmap.c@1.1 +383 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/text_mmap.c libopts/text_mmap.c@1.0 +0 -0 libopts/time.c@1.1 +88 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/time.c libopts/time.c@1.0 +0 -0 libopts/tokenize.c@1.1 +323 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/tokenize.c libopts/tokenize.c@1.0 +0 -0 libopts/usage.c@1.1 +756 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/usage.c libopts/usage.c@1.0 +0 -0 libopts/value-type.c@1.1 +123 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/value-type.c libopts/value-type.c@1.0 +0 -0 libopts/value-type.h@1.1 +25 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/value-type.h libopts/value-type.h@1.0 +0 -0 libopts/version.c@1.1 +157 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/version.c libopts/version.c@1.0 +0 -0 libopts/xat-attribute.c@1.1 +114 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/xat-attribute.c libopts/xat-attribute.c@1.0 +0 -0 libopts/xat-attribute.h@1.1 +22 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/xat-attribute.h libopts/xat-attribute.h@1.0 +0 -0 sntp/libopts/COPYING.gplv3@1.1 +674 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.gplv3 sntp/libopts/COPYING.gplv3@1.0 +0 -0 sntp/libopts/COPYING.lgplv3@1.1 +165 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.lgplv3 sntp/libopts/COPYING.lgplv3@1.0 +0 -0 sntp/libopts/COPYING.mbsd@1.1 +26 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.mbsd sntp/libopts/COPYING.mbsd@1.0 +0 -0 sntp/libopts/MakeDefs.inc@1.1 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/MakeDefs.inc sntp/libopts/MakeDefs.inc@1.0 +0 -0 sntp/libopts/Makefile.am@1.1 +28 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/Makefile.am sntp/libopts/Makefile.am@1.0 +0 -0 sntp/libopts/README@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/README sntp/libopts/README@1.0 +0 -0 sntp/libopts/ag-char-map.h@1.1 +129 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/ag-char-map.h sntp/libopts/ag-char-map.h@1.0 +0 -0 sntp/libopts/autoopts.c@1.1 +1164 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts.c sntp/libopts/autoopts.c@1.0 +0 -0 sntp/libopts/autoopts.h@1.1 +364 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts.h sntp/libopts/autoopts.h@1.0 +0 -0 sntp/libopts/autoopts/options.h@1.1 +1055 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts/options.h sntp/libopts/autoopts/options.h@1.0 +0 -0 sntp/libopts/autoopts/usage-txt.h@1.1 +393 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts/usage-txt.h sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0 sntp/libopts/boolean.c@1.1 +91 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/boolean.c sntp/libopts/boolean.c@1.0 +0 -0 sntp/libopts/compat/compat.h@1.1 +366 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/compat.h sntp/libopts/compat/compat.h@1.0 +0 -0 sntp/libopts/compat/pathfind.c@1.1 +338 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/pathfind.c sntp/libopts/compat/pathfind.c@1.0 +0 -0 sntp/libopts/compat/snprintf.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/snprintf.c sntp/libopts/compat/snprintf.c@1.0 +0 -0 sntp/libopts/compat/strchr.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strchr.c sntp/libopts/compat/strchr.c@1.0 +0 -0 sntp/libopts/compat/strdup.c@1.1 +19 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strdup.c sntp/libopts/compat/strdup.c@1.0 +0 -0 sntp/libopts/compat/windows-config.h@1.1 +147 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/windows-config.h sntp/libopts/compat/windows-config.h@1.0 +0 -0 sntp/libopts/configfile.c@1.1 +1251 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/configfile.c sntp/libopts/configfile.c@1.0 +0 -0 sntp/libopts/cook.c@1.1 +293 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/cook.c sntp/libopts/cook.c@1.0 +0 -0 sntp/libopts/enumeration.c@1.1 +512 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/enumeration.c sntp/libopts/enumeration.c@1.0 +0 -0 sntp/libopts/environment.c@1.1 +240 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/environment.c sntp/libopts/environment.c@1.0 +0 -0 sntp/libopts/file.c@1.1 +169 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/file.c sntp/libopts/file.c@1.0 +0 -0 sntp/libopts/genshell.c@1.1 +358 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/genshell.c sntp/libopts/genshell.c@1.0 +0 -0 sntp/libopts/genshell.h@1.1 +165 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/genshell.h sntp/libopts/genshell.h@1.0 +0 -0 sntp/libopts/libopts.c@1.1 +38 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/libopts.c sntp/libopts/libopts.c@1.0 +0 -0 sntp/libopts/load.c@1.1 +540 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/load.c sntp/libopts/load.c@1.0 +0 -0 sntp/libopts/m4/libopts.m4@1.1 +548 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/libopts.m4 sntp/libopts/m4/libopts.m4@1.0 +0 -0 sntp/libopts/m4/liboptschk.m4@1.1 +42 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/liboptschk.m4 sntp/libopts/m4/liboptschk.m4@1.0 +0 -0 sntp/libopts/makeshell.c@1.1 +1099 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/makeshell.c sntp/libopts/makeshell.c@1.0 +0 -0 sntp/libopts/nested.c@1.1 +843 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/nested.c sntp/libopts/nested.c@1.0 +0 -0 sntp/libopts/numeric.c@1.1 +175 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/numeric.c sntp/libopts/numeric.c@1.0 +0 -0 sntp/libopts/parse-duration.c@1.1 +582 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/parse-duration.c sntp/libopts/parse-duration.c@1.0 +0 -0 sntp/libopts/parse-duration.h@1.1 +82 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/parse-duration.h sntp/libopts/parse-duration.h@1.0 +0 -0 sntp/libopts/pgusage.c@1.1 +140 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/pgusage.c sntp/libopts/pgusage.c@1.0 +0 -0 sntp/libopts/proto.h@1.1 +112 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/proto.h sntp/libopts/proto.h@1.0 +0 -0 sntp/libopts/putshell.c@1.1 +320 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/putshell.c sntp/libopts/putshell.c@1.0 +0 -0 sntp/libopts/reset.c@1.1 +128 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/reset.c sntp/libopts/reset.c@1.0 +0 -0 sntp/libopts/restore.c@1.1 +227 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/restore.c sntp/libopts/restore.c@1.0 +0 -0 sntp/libopts/save.c@1.1 +790 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/save.c sntp/libopts/save.c@1.0 +0 -0 sntp/libopts/sort.c@1.1 +336 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/sort.c sntp/libopts/sort.c@1.0 +0 -0 sntp/libopts/stack.c@1.1 +264 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/stack.c sntp/libopts/stack.c@1.0 +0 -0 sntp/libopts/streqvcmp.c@1.1 +266 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/streqvcmp.c sntp/libopts/streqvcmp.c@1.0 +0 -0 sntp/libopts/text_mmap.c@1.1 +383 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/text_mmap.c sntp/libopts/text_mmap.c@1.0 +0 -0 sntp/libopts/time.c@1.1 +88 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/time.c sntp/libopts/time.c@1.0 +0 -0 sntp/libopts/tokenize.c@1.1 +323 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/tokenize.c sntp/libopts/tokenize.c@1.0 +0 -0 sntp/libopts/usage.c@1.1 +756 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/usage.c sntp/libopts/usage.c@1.0 +0 -0 sntp/libopts/value-type.c@1.1 +123 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/value-type.c sntp/libopts/value-type.c@1.0 +0 -0 sntp/libopts/value-type.h@1.1 +25 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/value-type.h sntp/libopts/value-type.h@1.0 +0 -0 sntp/libopts/version.c@1.1 +157 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/version.c sntp/libopts/version.c@1.0 +0 -0 sntp/libopts/xat-attribute.c@1.1 +114 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/xat-attribute.c sntp/libopts/xat-attribute.c@1.0 +0 -0 sntp/libopts/xat-attribute.h@1.1 +22 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/xat-attribute.h sntp/libopts/xat-attribute.h@1.0 +0 -0 ChangeSet@1.1914, 2009-07-20 00:18:45-04:00, stenn@whimsy.udel.edu [Bug 1248] RES_MSSNTP typo in ntp_proto.c ChangeLog@1.374 +1 -0 [Bug 1248] RES_MSSNTP typo in ntp_proto.c ntpd/ntp_proto.c@1.292 +1 -1 [Bug 1248] RES_MSSNTP typo in ntp_proto.c ChangeSet@1.1913, 2009-07-19 22:02:21-04:00, stenn@pogo.udel.edu distribute ntp_lists.h include/Makefile.am@1.34 +1 -0 distribute ntp_lists.h ChangeSet@1.1910.1.1, 2009-07-20 00:11:58+00:00, davehart@shiny.ad.hartbrothers.com Log warning about signd operations blocking ntpd when mssntp restrict keyword seen ChangeLog@1.371.1.1 +1 -0 Log warning about signd operations blocking ntpd when mssntp restrict keyword seen ntpd/ntp_config.c@1.198 +13 -0 Log warning about signd operations blocking ntpd when mssntp restrict keyword seen ChangeSet@1.1901.4.1, 2009-07-16 16:23:37+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1246] use a common template for singly-linked lists, convert most doubly-linked lists to singly-linked. ChangeLog@1.362.4.1 +2 -0 [Bug 1246] use a common template for singly-linked lists, convert most doubly-linked lists to singly-linked. include/ntp.h@1.159.1.1 +24 -25 use singly-linked lists instead of ISC's doubly-linked include/ntp_io.h@1.10 +3 -5 remove no-longer-needed doubly-linked list initialization routines include/ntp_lists.h@1.1 +104 -0 singly-linked list template macros include/ntp_lists.h@1.0 +0 -0 include/recvbuff.h@1.19 +5 -6 use singly-linked list for free_recv_buff libntp/recvbuff.c@1.33 +29 -42 use singly-linked list for free_recv_buff ntpd/ntp_io.c@1.289.2.1 +128 -203 use singly-linked lists instead of ISC's doubly-linked ntpd/ntp_peer.c@1.121 +51 -72 use new common singly-linked list template macros for peer_hash and assoc_hash ntpd/ntpd.c@1.105 +1 -5 remove no-longer-needed doubly-linked list initialization routines ports/winnt/libntp/libntp.dsp@1.35 +4 -0 add include/ntp_lists.h reference ports/winnt/libntp/libntp.vcproj@1.9 +4 -0 add include/ntp_lists.h reference ports/winnt/ntpd/ntp_iocompletionport.c@1.44.1.1 +20 -13 use singly-linked list for compl_info_list ports/winnt/ntpd/ntpd.vcproj@1.10 +5 -0 add include/ntp_lists.h reference ChangeSet@1.1910, 2009-07-16 07:54:10-04:00, stenn@whimsy.udel.edu NTP_4_2_5P189 TAG: NTP_4_2_5P189 ChangeLog@1.371 +1 -0 NTP_4_2_5P189 gsoc_sntp/sntp-opts.c@1.50 +2 -2 NTP_4_2_5P189 gsoc_sntp/sntp-opts.h@1.50 +3 -3 NTP_4_2_5P189 gsoc_sntp/sntp-opts.texi@1.50 +1 -1 NTP_4_2_5P189 gsoc_sntp/sntp.1@1.50 +2 -2 NTP_4_2_5P189 ntpd/ntpd-opts.c@1.182 +2 -2 NTP_4_2_5P189 ntpd/ntpd-opts.h@1.182 +3 -3 NTP_4_2_5P189 ntpd/ntpd-opts.texi@1.180 +1 -1 NTP_4_2_5P189 ntpd/ntpd.1@1.180 +2 -2 NTP_4_2_5P189 ntpdc/ntpdc-opts.c@1.177 +2 -2 NTP_4_2_5P189 ntpdc/ntpdc-opts.h@1.177 +3 -3 NTP_4_2_5P189 ntpdc/ntpdc-opts.texi@1.176 +1 -1 NTP_4_2_5P189 ntpdc/ntpdc.1@1.176 +2 -2 NTP_4_2_5P189 ntpq/ntpq-opts.c@1.177 +2 -2 NTP_4_2_5P189 ntpq/ntpq-opts.h@1.177 +3 -3 NTP_4_2_5P189 ntpq/ntpq-opts.texi@1.176 +1 -1 NTP_4_2_5P189 ntpq/ntpq.1@1.176 +2 -2 NTP_4_2_5P189 ntpsnmpd/ntpsnmpd-opts.c@1.58 +2 -2 NTP_4_2_5P189 ntpsnmpd/ntpsnmpd-opts.h@1.58 +3 -3 NTP_4_2_5P189 ntpsnmpd/ntpsnmpd-opts.texi@1.58 +1 -1 NTP_4_2_5P189 ntpsnmpd/ntpsnmpd.1@1.58 +2 -2 NTP_4_2_5P189 packageinfo.sh@1.192 +1 -1 NTP_4_2_5P189 sntp/sntp-opts.c@1.177 +2 -2 NTP_4_2_5P189 sntp/sntp-opts.h@1.177 +3 -3 NTP_4_2_5P189 sntp/sntp-opts.texi@1.176 +1 -1 NTP_4_2_5P189 sntp/sntp.1@1.176 +2 -2 NTP_4_2_5P189 util/ntp-keygen-opts.c@1.180 +2 -2 NTP_4_2_5P189 util/ntp-keygen-opts.h@1.180 +3 -3 NTP_4_2_5P189 util/ntp-keygen-opts.texi@1.179 +1 -1 NTP_4_2_5P189 util/ntp-keygen.1@1.179 +2 -2 NTP_4_2_5P189 ChangeSet@1.1909, 2009-07-15 16:51:50-04:00, stenn@whimsy.udel.edu Documentation cleanup from Dave Mills ChangeLog@1.370 +1 -0 Documentation cleanup from Dave Mills html/accopt.html@1.30 +99 -28 Documentation cleanup from Dave Mills html/assoc.html@1.28 +10 -1 Documentation cleanup from Dave Mills html/audio.html@1.21 +29 -4 Documentation cleanup from Dave Mills html/authopt.html@1.50 +18 -2 Documentation cleanup from Dave Mills html/bugs.html@1.5 +4 -1 Documentation cleanup from Dave Mills html/config.html@1.23 +1 -1 Documentation cleanup from Dave Mills html/confopt.html@1.45 +15 -13 Documentation cleanup from Dave Mills html/debug.html@1.26 +29 -5 Documentation cleanup from Dave Mills html/decode.html@1.10 +9 -5 Documentation cleanup from Dave Mills html/extern.html@1.15 +21 -4 Documentation cleanup from Dave Mills html/gadget.html@1.4 +9 -1 Documentation cleanup from Dave Mills html/howto.html@1.22 +19 -4 Documentation cleanup from Dave Mills html/index.html@1.40 +7 -2 Documentation cleanup from Dave Mills html/manyopt.html@1.19 +5 -1 Documentation cleanup from Dave Mills ChangeSet@1.1908, 2009-07-15 07:52:57-04:00, stenn@whimsy.udel.edu NTP_4_2_5P188 TAG: NTP_4_2_5P188 ChangeLog@1.369 +1 -0 NTP_4_2_5P188 gsoc_sntp/sntp-opts.c@1.49 +2 -2 NTP_4_2_5P188 gsoc_sntp/sntp-opts.h@1.49 +3 -3 NTP_4_2_5P188 gsoc_sntp/sntp-opts.texi@1.49 +1 -1 NTP_4_2_5P188 gsoc_sntp/sntp.1@1.49 +2 -2 NTP_4_2_5P188 ntpd/ntpd-opts.c@1.181 +2 -2 NTP_4_2_5P188 ntpd/ntpd-opts.h@1.181 +3 -3 NTP_4_2_5P188 ntpd/ntpd-opts.texi@1.179 +2 -2 NTP_4_2_5P188 ntpd/ntpd.1@1.179 +2 -2 NTP_4_2_5P188 ntpdc/ntpdc-opts.c@1.176 +2 -2 NTP_4_2_5P188 ntpdc/ntpdc-opts.h@1.176 +3 -3 NTP_4_2_5P188 ntpdc/ntpdc-opts.texi@1.175 +2 -2 NTP_4_2_5P188 ntpdc/ntpdc.1@1.175 +2 -2 NTP_4_2_5P188 ntpq/ntpq-opts.c@1.176 +2 -2 NTP_4_2_5P188 ntpq/ntpq-opts.h@1.176 +3 -3 NTP_4_2_5P188 ntpq/ntpq-opts.texi@1.175 +2 -2 NTP_4_2_5P188 ntpq/ntpq.1@1.175 +2 -2 NTP_4_2_5P188 ntpsnmpd/ntpsnmpd-opts.c@1.57 +2 -2 NTP_4_2_5P188 ntpsnmpd/ntpsnmpd-opts.h@1.57 +3 -3 NTP_4_2_5P188 ntpsnmpd/ntpsnmpd-opts.texi@1.57 +1 -1 NTP_4_2_5P188 ntpsnmpd/ntpsnmpd.1@1.57 +2 -2 NTP_4_2_5P188 packageinfo.sh@1.191 +1 -1 NTP_4_2_5P188 sntp/sntp-opts.c@1.176 +2 -2 NTP_4_2_5P188 sntp/sntp-opts.h@1.176 +3 -3 NTP_4_2_5P188 sntp/sntp-opts.texi@1.175 +1 -1 NTP_4_2_5P188 sntp/sntp.1@1.175 +2 -2 NTP_4_2_5P188 util/ntp-keygen-opts.c@1.179 +2 -2 NTP_4_2_5P188 util/ntp-keygen-opts.h@1.179 +3 -3 NTP_4_2_5P188 util/ntp-keygen-opts.texi@1.178 +2 -2 NTP_4_2_5P188 util/ntp-keygen.1@1.178 +2 -2 NTP_4_2_5P188 ChangeSet@1.1907, 2009-07-15 00:35:46-04:00, stenn@whimsy.udel.edu [Bug 1245] Broken xmt time sent in fast_xmit() of 4.2.5p187 ChangeLog@1.368 +1 -0 [Bug 1245] Broken xmt time sent in fast_xmit() of 4.2.5p187 ntpd/ntp_proto.c@1.291 +1 -2 [Bug 1245] Broken xmt time sent in fast_xmit() of 4.2.5p187 ChangeSet@1.1906, 2009-07-11 07:57:23-04:00, stenn@whimsy.udel.edu NTP_4_2_5P187 TAG: NTP_4_2_5P187 ChangeLog@1.367 +1 -0 NTP_4_2_5P187 gsoc_sntp/sntp-opts.c@1.48 +2 -2 NTP_4_2_5P187 gsoc_sntp/sntp-opts.h@1.48 +3 -3 NTP_4_2_5P187 gsoc_sntp/sntp-opts.texi@1.48 +1 -1 NTP_4_2_5P187 gsoc_sntp/sntp.1@1.48 +2 -2 NTP_4_2_5P187 ntpd/ntpd-opts.c@1.180 +2 -2 NTP_4_2_5P187 ntpd/ntpd-opts.h@1.180 +3 -3 NTP_4_2_5P187 ntpd/ntpd-opts.texi@1.178 +1 -1 NTP_4_2_5P187 ntpd/ntpd.1@1.178 +2 -2 NTP_4_2_5P187 ntpdc/ntpdc-opts.c@1.175 +2 -2 NTP_4_2_5P187 ntpdc/ntpdc-opts.h@1.175 +3 -3 NTP_4_2_5P187 ntpdc/ntpdc-opts.texi@1.174 +1 -1 NTP_4_2_5P187 ntpdc/ntpdc.1@1.174 +2 -2 NTP_4_2_5P187 ntpq/ntpq-opts.c@1.175 +2 -2 NTP_4_2_5P187 ntpq/ntpq-opts.h@1.175 +3 -3 NTP_4_2_5P187 ntpq/ntpq-opts.texi@1.174 +1 -1 NTP_4_2_5P187 ntpq/ntpq.1@1.174 +2 -2 NTP_4_2_5P187 ntpsnmpd/ntpsnmpd-opts.c@1.56 +2 -2 NTP_4_2_5P187 ntpsnmpd/ntpsnmpd-opts.h@1.56 +3 -3 NTP_4_2_5P187 ntpsnmpd/ntpsnmpd-opts.texi@1.56 +1 -1 NTP_4_2_5P187 ntpsnmpd/ntpsnmpd.1@1.56 +2 -2 NTP_4_2_5P187 packageinfo.sh@1.190 +1 -1 NTP_4_2_5P187 sntp/sntp-opts.c@1.175 +2 -2 NTP_4_2_5P187 sntp/sntp-opts.h@1.175 +3 -3 NTP_4_2_5P187 sntp/sntp-opts.texi@1.174 +1 -1 NTP_4_2_5P187 sntp/sntp.1@1.174 +2 -2 NTP_4_2_5P187 util/ntp-keygen-opts.c@1.178 +2 -2 NTP_4_2_5P187 util/ntp-keygen-opts.h@1.178 +3 -3 NTP_4_2_5P187 util/ntp-keygen-opts.texi@1.177 +1 -1 NTP_4_2_5P187 util/ntp-keygen.1@1.177 +2 -2 NTP_4_2_5P187 ChangeSet@1.1901.2.2, 2009-07-11 01:48:52-04:00, stenn@whimsy.udel.edu [Bug 1242] Remove --enable-wintime configure.ac@1.447 +0 -25 [Bug 1242] Remove --enable-wintime ChangeSet@1.1901.3.1, 2009-07-11 05:47:56+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1237] Windows serial code treat CR and LF both as line terminators. [Bug 1238] use fudge time2 for serial timecode offset in NMEA driver. document fudge time1 as PPS offset, fudge time2 as serial timecode offset for driver20.html (NMEA) ChangeLog@1.362.3.1 +5 -1 [Bug 1237] Windows serial code treat CR and LF both as line terminators. [Bug 1238] use fudge time2 for serial timecode offset in NMEA driver. html/drivers/driver20.html@1.20 +2 -2 Document fudge time2 as serial-only offset, time1 as PPS-only ntpd/refclock_nmea.c@1.41 +14 -2 [Bug 1238] use fudge time2 for serial timecode offset in NMEA driver. ports/winnt/ntpd/ntp_iocompletionport.c@1.45 +22 -2 [Bug 1237] Windows serial code treat CR and LF both as line terminators. ChangeSet@1.1901.2.1, 2009-07-11 01:37:42-04:00, stenn@whimsy.udel.edu Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills ChangeLog@1.362.2.1 +3 -0 Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills html/accopt.html@1.29 +13 -12 Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills include/ntp.h@1.160 +15 -16 Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills ntpd/ntp_config.c@1.197 +1 -0 Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills ntpd/ntp_parser.c@1.39 +897 -887 Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills ntpd/ntp_parser.h@1.23 +203 -201 Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills ntpd/ntp_parser.y@1.34 +2 -0 Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills ntpd/ntp_proto.c@1.290 +35 -39 Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills ChangeSet@1.1901.1.3, 2009-07-11 04:41:58+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1244] NTP_INSIST(fd != maxactivefd) failure in intres child ChangeLog@1.362.1.3 +1 -0 [Bug 1244] NTP_INSIST(fd != maxactivefd) failure in intres child include/ntpd.h@1.129 +3 -1 conditionalize kill_asyncio(), not used on Windows ntpd/ntp_io.c@1.289.1.1 +13 -0 [Bug 1244] NTP_INSIST(fd != maxactivefd) failure in intres child ChangeSet@1.1901.1.2, 2009-07-08 07:53:10-04:00, stenn@whimsy.udel.edu NTP_4_2_5P186 TAG: NTP_4_2_5P186 ChangeLog@1.362.1.2 +1 -0 NTP_4_2_5P186 gsoc_sntp/sntp-opts.c@1.47 +2 -2 NTP_4_2_5P186 gsoc_sntp/sntp-opts.h@1.47 +3 -3 NTP_4_2_5P186 gsoc_sntp/sntp-opts.texi@1.47 +1 -1 NTP_4_2_5P186 gsoc_sntp/sntp.1@1.47 +2 -2 NTP_4_2_5P186 ntpd/ntpd-opts.c@1.179 +2 -2 NTP_4_2_5P186 ntpd/ntpd-opts.h@1.179 +3 -3 NTP_4_2_5P186 ntpd/ntpd-opts.texi@1.177 +1 -1 NTP_4_2_5P186 ntpd/ntpd.1@1.177 +2 -2 NTP_4_2_5P186 ntpdc/ntpdc-opts.c@1.174 +2 -2 NTP_4_2_5P186 ntpdc/ntpdc-opts.h@1.174 +3 -3 NTP_4_2_5P186 ntpdc/ntpdc-opts.texi@1.173 +1 -1 NTP_4_2_5P186 ntpdc/ntpdc.1@1.173 +2 -2 NTP_4_2_5P186 ntpq/ntpq-opts.c@1.174 +2 -2 NTP_4_2_5P186 ntpq/ntpq-opts.h@1.174 +3 -3 NTP_4_2_5P186 ntpq/ntpq-opts.texi@1.173 +1 -1 NTP_4_2_5P186 ntpq/ntpq.1@1.173 +2 -2 NTP_4_2_5P186 ntpsnmpd/ntpsnmpd-opts.c@1.55 +2 -2 NTP_4_2_5P186 ntpsnmpd/ntpsnmpd-opts.h@1.55 +3 -3 NTP_4_2_5P186 ntpsnmpd/ntpsnmpd-opts.texi@1.55 +1 -1 NTP_4_2_5P186 ntpsnmpd/ntpsnmpd.1@1.55 +2 -2 NTP_4_2_5P186 packageinfo.sh@1.189 +1 -1 NTP_4_2_5P186 sntp/sntp-opts.c@1.174 +2 -2 NTP_4_2_5P186 sntp/sntp-opts.h@1.174 +3 -3 NTP_4_2_5P186 sntp/sntp-opts.texi@1.173 +1 -1 NTP_4_2_5P186 sntp/sntp.1@1.173 +2 -2 NTP_4_2_5P186 util/ntp-keygen-opts.c@1.177 +2 -2 NTP_4_2_5P186 util/ntp-keygen-opts.h@1.177 +3 -3 NTP_4_2_5P186 util/ntp-keygen-opts.texi@1.176 +1 -1 NTP_4_2_5P186 util/ntp-keygen.1@1.176 +2 -2 NTP_4_2_5P186 ChangeSet@1.1901.1.1, 2009-07-08 02:47:48-04:00, stenn@whimsy.udel.edu ntp_proto.c cleanup from Dave Mills ChangeLog@1.362.1.1 +1 -0 ntp_proto.c cleanup from Dave Mills ntpd/ntp_proto.c@1.289 +19 -30 cleanup from Dave Mills ChangeSet@1.1889.2.1, 2009-07-03 03:26:28+00:00, davehart@shiny.ad.hartbrothers.com ChangeLog: [Bug 1042] multicast listeners IPv4+6 ignore new interfaces ntp_io.c: [Bug 1042] multicast listeners IPv4+6 ignore new interfaces more detailed DPRINTFs ChangeLog@1.351.2.1 +1 -0 [Bug 1042] multicast listeners IPv4+6 ignore new interfaces ntpd/ntp_io.c@1.288.1.1 +10 -3 [Bug 1042] multicast listeners IPv4+6 ignore new interfaces more detailed DPRINTFs ChangeSet@1.1901, 2009-07-01 07:53:52-04:00, stenn@whimsy.udel.edu NTP_4_2_5P185 TAG: NTP_4_2_5P185 ChangeLog@1.362 +1 -0 NTP_4_2_5P185 gsoc_sntp/sntp-opts.c@1.46 +2 -2 NTP_4_2_5P185 gsoc_sntp/sntp-opts.h@1.46 +3 -3 NTP_4_2_5P185 gsoc_sntp/sntp-opts.texi@1.46 +1 -1 NTP_4_2_5P185 gsoc_sntp/sntp.1@1.46 +2 -2 NTP_4_2_5P185 ntpd/ntpd-opts.c@1.178 +2 -2 NTP_4_2_5P185 ntpd/ntpd-opts.h@1.178 +3 -3 NTP_4_2_5P185 ntpd/ntpd-opts.texi@1.176 +1 -1 NTP_4_2_5P185 ntpd/ntpd.1@1.176 +2 -2 NTP_4_2_5P185 ntpdc/ntpdc-opts.c@1.173 +2 -2 NTP_4_2_5P185 ntpdc/ntpdc-opts.h@1.173 +3 -3 NTP_4_2_5P185 ntpdc/ntpdc-opts.texi@1.172 +1 -1 NTP_4_2_5P185 ntpdc/ntpdc.1@1.172 +2 -2 NTP_4_2_5P185 ntpq/ntpq-opts.c@1.173 +2 -2 NTP_4_2_5P185 ntpq/ntpq-opts.h@1.173 +3 -3 NTP_4_2_5P185 ntpq/ntpq-opts.texi@1.172 +1 -1 NTP_4_2_5P185 ntpq/ntpq.1@1.172 +2 -2 NTP_4_2_5P185 ntpsnmpd/ntpsnmpd-opts.c@1.54 +2 -2 NTP_4_2_5P185 ntpsnmpd/ntpsnmpd-opts.h@1.54 +3 -3 NTP_4_2_5P185 ntpsnmpd/ntpsnmpd-opts.texi@1.54 +1 -1 NTP_4_2_5P185 ntpsnmpd/ntpsnmpd.1@1.54 +2 -2 NTP_4_2_5P185 packageinfo.sh@1.188 +1 -1 NTP_4_2_5P185 sntp/sntp-opts.c@1.173 +2 -2 NTP_4_2_5P185 sntp/sntp-opts.h@1.173 +3 -3 NTP_4_2_5P185 sntp/sntp-opts.texi@1.172 +1 -1 NTP_4_2_5P185 sntp/sntp.1@1.172 +2 -2 NTP_4_2_5P185 util/ntp-keygen-opts.c@1.176 +2 -2 NTP_4_2_5P185 util/ntp-keygen-opts.h@1.176 +3 -3 NTP_4_2_5P185 util/ntp-keygen-opts.texi@1.175 +1 -1 NTP_4_2_5P185 util/ntp-keygen.1@1.175 +2 -2 NTP_4_2_5P185 ChangeSet@1.1900, 2009-07-01 03:06:34-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.361 +2 -1 Documentation updates from Dave Mills html/miscopt.html@1.43 +2 -2 Documentation updates from Dave Mills html/ntpd.html@1.49 +2 -2 Documentation updates from Dave Mills html/prefer.html@1.22 +134 -31 Documentation updates from Dave Mills ChangeSet@1.1898, 2009-06-30 14:46:05-04:00, clemens@pogo.udel.edu Fix order of declarations. ntpd/refclock_oncore.c@1.77 +1 -2 ChangeSet@1.1895.1.2, 2009-06-30 07:59:26+00:00, davehart@shiny.ad.hartbrothers.com driver20.html: note fudge flag1 now enables/disables (default) PPSAPI support make bitrate setting values more obvious to those not fluent in binary shifting ChangeLog: punctuation ChangeLog@1.359 +1 -1 punctuation html/drivers/driver20.html@1.19 +6 -6 note fudge flag1 now enables/disables (default) PPSAPI support make bitrate setting values more obvious to those not fluent in binary shifting ChangeSet@1.1897, 2009-06-30 03:41:23-04:00, stenn@pogo.udel.edu typos ChangeLog@1.357.1.2 +2 -2 typos ChangeLog@1.357.1.1, clemens@pogo.udel.edu +3 -0 Declaration order fixed. ChangeSet@1.1896, 2009-06-25 02:13:57-04:00, clemens@pogo.udel.edu ChangeLog additon, ONCORE use of #if 0 where it used #ifdef DEBUG ntpd/refclock_oncore.c@1.76 +14 -22 No BUG[]. NTP now uses the DEBUG preprocessor variable. I have now bracketed private debug statements with #if 0 rather than #ifdef DEBUG ChangeSet@1.1895, 2009-06-24 07:52:37-04:00, stenn@whimsy.udel.edu NTP_4_2_5P184 TAG: NTP_4_2_5P184 ChangeLog@1.357 +1 -0 NTP_4_2_5P184 gsoc_sntp/sntp-opts.c@1.45 +2 -2 NTP_4_2_5P184 gsoc_sntp/sntp-opts.h@1.45 +3 -3 NTP_4_2_5P184 gsoc_sntp/sntp-opts.texi@1.45 +1 -1 NTP_4_2_5P184 gsoc_sntp/sntp.1@1.45 +2 -2 NTP_4_2_5P184 ntpd/ntpd-opts.c@1.177 +2 -2 NTP_4_2_5P184 ntpd/ntpd-opts.h@1.177 +3 -3 NTP_4_2_5P184 ntpd/ntpd-opts.texi@1.175 +1 -1 NTP_4_2_5P184 ntpd/ntpd.1@1.175 +2 -2 NTP_4_2_5P184 ntpdc/ntpdc-opts.c@1.172 +2 -2 NTP_4_2_5P184 ntpdc/ntpdc-opts.h@1.172 +3 -3 NTP_4_2_5P184 ntpdc/ntpdc-opts.texi@1.171 +1 -1 NTP_4_2_5P184 ntpdc/ntpdc.1@1.171 +2 -2 NTP_4_2_5P184 ntpq/ntpq-opts.c@1.172 +2 -2 NTP_4_2_5P184 ntpq/ntpq-opts.h@1.172 +3 -3 NTP_4_2_5P184 ntpq/ntpq-opts.texi@1.171 +1 -1 NTP_4_2_5P184 ntpq/ntpq.1@1.171 +2 -2 NTP_4_2_5P184 ntpsnmpd/ntpsnmpd-opts.c@1.53 +2 -2 NTP_4_2_5P184 ntpsnmpd/ntpsnmpd-opts.h@1.53 +3 -3 NTP_4_2_5P184 ntpsnmpd/ntpsnmpd-opts.texi@1.53 +1 -1 NTP_4_2_5P184 ntpsnmpd/ntpsnmpd.1@1.53 +2 -2 NTP_4_2_5P184 packageinfo.sh@1.187 +1 -1 NTP_4_2_5P184 sntp/sntp-opts.c@1.172 +2 -2 NTP_4_2_5P184 sntp/sntp-opts.h@1.172 +3 -3 NTP_4_2_5P184 sntp/sntp-opts.texi@1.171 +1 -1 NTP_4_2_5P184 sntp/sntp.1@1.171 +2 -2 NTP_4_2_5P184 util/ntp-keygen-opts.c@1.175 +2 -2 NTP_4_2_5P184 util/ntp-keygen-opts.h@1.175 +3 -3 NTP_4_2_5P184 util/ntp-keygen-opts.texi@1.174 +1 -1 NTP_4_2_5P184 util/ntp-keygen.1@1.174 +2 -2 NTP_4_2_5P184 ChangeSet@1.1894, 2009-06-24 01:25:37-04:00, stenn@whimsy.udel.edu [Bg 1233] atom refclock fudge time1 sign flipped in 4.2.4p164 ChangeLog@1.356 +1 -0 [Bg 1233] atom refclock fudge time1 sign flipped in 4.2.4p164 ntpd/ntp_refclock.c@1.89 +1 -1 [Bg 1233] atom refclock fudge time1 sign flipped in 4.2.4p164 ChangeSet@1.1893, 2009-06-23 07:55:19-04:00, stenn@whimsy.udel.edu NTP_4_2_5P183 TAG: NTP_4_2_5P183 ChangeLog@1.355 +1 -0 NTP_4_2_5P183 gsoc_sntp/sntp-opts.c@1.44 +2 -2 NTP_4_2_5P183 gsoc_sntp/sntp-opts.h@1.44 +3 -3 NTP_4_2_5P183 gsoc_sntp/sntp-opts.texi@1.44 +1 -1 NTP_4_2_5P183 gsoc_sntp/sntp.1@1.44 +2 -2 NTP_4_2_5P183 ntpd/ntpd-opts.c@1.176 +2 -2 NTP_4_2_5P183 ntpd/ntpd-opts.h@1.176 +3 -3 NTP_4_2_5P183 ntpd/ntpd-opts.texi@1.174 +2 -2 NTP_4_2_5P183 ntpd/ntpd.1@1.174 +2 -2 NTP_4_2_5P183 ntpdc/ntpdc-opts.c@1.171 +2 -2 NTP_4_2_5P183 ntpdc/ntpdc-opts.h@1.171 +3 -3 NTP_4_2_5P183 ntpdc/ntpdc-opts.texi@1.170 +2 -2 NTP_4_2_5P183 ntpdc/ntpdc.1@1.170 +2 -2 NTP_4_2_5P183 ntpq/ntpq-opts.c@1.171 +2 -2 NTP_4_2_5P183 ntpq/ntpq-opts.h@1.171 +3 -3 NTP_4_2_5P183 ntpq/ntpq-opts.texi@1.170 +2 -2 NTP_4_2_5P183 ntpq/ntpq.1@1.170 +2 -2 NTP_4_2_5P183 ntpsnmpd/ntpsnmpd-opts.c@1.52 +2 -2 NTP_4_2_5P183 ntpsnmpd/ntpsnmpd-opts.h@1.52 +3 -3 NTP_4_2_5P183 ntpsnmpd/ntpsnmpd-opts.texi@1.52 +1 -1 NTP_4_2_5P183 ntpsnmpd/ntpsnmpd.1@1.52 +2 -2 NTP_4_2_5P183 packageinfo.sh@1.186 +1 -1 NTP_4_2_5P183 sntp/sntp-opts.c@1.171 +2 -2 NTP_4_2_5P183 sntp/sntp-opts.h@1.171 +3 -3 NTP_4_2_5P183 sntp/sntp-opts.texi@1.170 +1 -1 NTP_4_2_5P183 sntp/sntp.1@1.170 +2 -2 NTP_4_2_5P183 util/ntp-keygen-opts.c@1.174 +2 -2 NTP_4_2_5P183 util/ntp-keygen-opts.h@1.174 +3 -3 NTP_4_2_5P183 util/ntp-keygen-opts.texi@1.173 +2 -2 NTP_4_2_5P183 util/ntp-keygen.1@1.173 +2 -2 NTP_4_2_5P183 ChangeSet@1.1881.3.2, 2009-06-19 02:45:57+00:00, hart@pogo.udel.edu ChangeLog: [Bug 1210], [Bug 1218], ONCORE logs to msyslog as well as clockstats ChangeLog@1.343.3.2 +5 -2 [Bug 1210], [Bug 1218], ONCORE logs to msyslog as well as clockstats ChangeSet@1.1889.1.1, 2009-06-18 21:28:09+00:00, davehart@shiny.ad.hartbrothers.com libntpq.h, ChangeLog: [Bug 1231] ntpsnmpd build fails after sockaddr union changes ChangeLog@1.351.1.1 +1 -0 [Bug 1231] ntpsnmpd build fails after sockaddr union changes ntpq/libntpq.h@1.3 +2 -0 [Bug 1231] ntpsnmpd build fails after sockaddr union changes ChangeSet@1.1890, 2009-06-18 12:35:02+00:00, davehart@shiny.ad.hartbrothers.com ntp_io.c, ChangeLog: [Bug 1196] setsockopt(SO_EXCLUSIVEADDRUSE) can fail on Windows 2000 and earlier with WSAINVAL, do not log a complaint in that case. nt_clockstuff.c: fix EOPNOTSUPP macro redefinition warning introduced with support for PPSAPI on Windows. ChangeLog@1.352 +2 -0 [Bug 1196] setsockopt(SO_EXCLUSIVEADDRUSE) can fail on Windows 2000 and earlier with WSAINVAL, do not log a complaint in that case. ntpd/ntp_io.c@1.289 +24 -4 [Bug 1196] setsockopt(SO_EXCLUSIVEADDRUSE) can fail on Windows 2000 and earlier with WSAINVAL, do not log a complaint in that case. ports/winnt/ntpd/nt_clockstuff.c@1.34 +8 -1 fix EOPNOTSUPP macro redefinition warning introduced with support for PPSAPI on Windows. ChangeSet@1.1889, 2009-06-18 08:00:58-04:00, stenn@whimsy.udel.edu NTP_4_2_5P182 TAG: NTP_4_2_5P182 ChangeLog@1.351 +1 -0 NTP_4_2_5P182 gsoc_sntp/sntp-opts.c@1.43 +2 -2 NTP_4_2_5P182 gsoc_sntp/sntp-opts.h@1.43 +3 -3 NTP_4_2_5P182 gsoc_sntp/sntp-opts.texi@1.43 +1 -1 NTP_4_2_5P182 gsoc_sntp/sntp.1@1.43 +2 -2 NTP_4_2_5P182 ntpd/ntpd-opts.c@1.175 +2 -2 NTP_4_2_5P182 ntpd/ntpd-opts.h@1.175 +3 -3 NTP_4_2_5P182 ntpd/ntpd-opts.texi@1.173 +37 -2 NTP_4_2_5P182 ntpd/ntpd.1@1.173 +17 -2 NTP_4_2_5P182 ntpdc/ntpdc-opts.c@1.170 +2 -2 NTP_4_2_5P182 ntpdc/ntpdc-opts.h@1.170 +3 -3 NTP_4_2_5P182 ntpdc/ntpdc-opts.texi@1.169 +2 -2 NTP_4_2_5P182 ntpdc/ntpdc.1@1.169 +2 -2 NTP_4_2_5P182 ntpq/ntpq-opts.c@1.170 +2 -2 NTP_4_2_5P182 ntpq/ntpq-opts.h@1.170 +3 -3 NTP_4_2_5P182 ntpq/ntpq-opts.texi@1.169 +2 -2 NTP_4_2_5P182 ntpq/ntpq.1@1.169 +2 -2 NTP_4_2_5P182 ntpsnmpd/ntpsnmpd-opts.c@1.51 +2 -2 NTP_4_2_5P182 ntpsnmpd/ntpsnmpd-opts.h@1.51 +3 -3 NTP_4_2_5P182 ntpsnmpd/ntpsnmpd-opts.texi@1.51 +1 -1 NTP_4_2_5P182 ntpsnmpd/ntpsnmpd.1@1.51 +2 -2 NTP_4_2_5P182 packageinfo.sh@1.185 +1 -1 NTP_4_2_5P182 sntp/sntp-opts.c@1.170 +2 -2 NTP_4_2_5P182 sntp/sntp-opts.h@1.170 +3 -3 NTP_4_2_5P182 sntp/sntp-opts.texi@1.169 +1 -1 NTP_4_2_5P182 sntp/sntp.1@1.169 +2 -2 NTP_4_2_5P182 util/ntp-keygen-opts.c@1.173 +2 -2 NTP_4_2_5P182 util/ntp-keygen-opts.h@1.173 +3 -3 NTP_4_2_5P182 util/ntp-keygen-opts.texi@1.172 +2 -2 NTP_4_2_5P182 util/ntp-keygen.1@1.172 +2 -2 NTP_4_2_5P182 ChangeSet@1.1888, 2009-06-18 05:09:12-04:00, stenn@whimsy.udel.edu Add missing header dependencies to the ntpdc layout verification ChangeLog@1.350 +1 -0 Add missing header dependencies to the ntpdc layout verification ntpdc/Makefile.am@1.39 +1 -1 Add missing header dependencies to the ntpdc layout verification ChangeSet@1.1887, 2009-06-18 05:04:55-04:00, stenn@whimsy.udel.edu prefer.html updates from Dave Mills ChangeLog@1.349 +1 -0 prefer.html updates from Dave Mills html/prefer.html@1.21 +31 -134 prefer.html updates from Dave Mills ChangeSet@1.1886, 2009-06-18 08:10:30+00:00, davehart@shiny.ad.hartbrothers.com ChangeLog: merge cleanup cleanup ChangeLog@1.348 +2 -2 merge cleanup cleanup ChangeSet@1.1881.4.1, 2009-06-18 03:54:37-04:00, stenn@whimsy.udel.edu [Bug 1229] autokey segfaults in cert_install() ChangeLog@1.343.4.1 +1 -0 [Bug 1229] autokey segfaults in cert_install() ntpd/ntp_crypto.c@1.136.1.1 +7 -8 [Bug 1229] autokey segfaults in cert_install() ChangeSet@1.1881.3.1, 2009-06-17 17:02:49-04:00, clemens@pogo.udel.edu refclock_oncore.c: BUG[no bug report] A bytes available message for the input subsystem (Debug message). BUG[no bug report] Change exit statements to return(0) in ONCORE driver top level program. This signals an error to the calling code. BUG[1218] The comment on where the oncore driver gets its input file does not * agree with the code. Change the comment. BUGS[no bug report] This patch puts back in some code to interpret @@Bl messages on the VP and extract LEAP SECOND information. See the code for a more complete comment. ChangeLog: Add comment re ONCORE changes to message subsystem. refclock_oncore.c: BUG[no bug report] This code adds a message for TRAIM messages. Users often worry about the driver not starting up, and it is often because of signal strength being low. Low signal strength will give TRAIM messages. BUG[1220] OK, big patch, but mostly done mechanically. Change direct calls to write to clockstats to a call to oncore_log, which now calls the old routine plus msyslog. Have to set the LOG_LEVELS of the calls for msyslog, and this was done by hand. New routine oncore_log. BUGS[no bug report] Users often worry that the code is hung when there is no output after a restart. If the receiver does not have battery backup can take up to 30minutes to acuqire an almanac and this is necessary before the driver can start. This message should reasurre the user that the driver has not died. ChangeLog@1.343.3.1 +2 -0 Add comment re ONCORE changes to message subsystem. ntpd/refclock_oncore.c@1.75 +387 -331 BUG[1220] OK, big patch, but mostly done mechanically. Change direct calls to write to clockstats to a call to oncore_log, which now calls the old routine plus msyslog. Have to set the LOG_LEVELS of the calls for msyslog, and this was done by hand. New routine oncore_log. ntpd/refclock_oncore.c@1.74 +6 -2 BUG[1218] The comment on where the oncore driver gets its input file does not * agree with the code. Change the comment. ntpd/refclock_oncore.c@1.73 +11 -6 BUG[no bug report] Change exit statements to return(0) in ONCORE driver top level program. This signals an error to the calling code. ntpd/refclock_oncore.c@1.72 +4 -0 BUG[no bug report] A bytes available message for the input subsystem (Debug message). ntpd/refclock_oncore.c@1.71 +8 -1 BUG[no bug report] This code adds a message for TRAIM messages. Users often worry about the driver not starting up, and it is often because of signal strength being low. Low signal strength will give TRAIM messages. ntpd/refclock_oncore.c@1.70 +11 -4 BUGS[no bug report] Users often worry that the code is hung when there is no output after a restart. If the receiver does not have battery backup can take up to 30minutes to acuqire an almanac and this is necessary before the driver can start. This message should reasurre the user that the driver has not died. ntpd/refclock_oncore.c@1.69 +149 -1 BUGS[no bug report] This patch puts back in some code to interpret @@Bl messages on the VP and extract LEAP SECOND information. See the code for a more complete comment. ChangeSet@1.1881.2.2, 2009-06-16 04:22:15+00:00, davehart@shiny.ad.hartbrothers.com remove netsyslog(), equivalent to msyslog() update ports/winnt/libisc/net.c winnt/include/net.h from BIND 9.6.1b1 to pick up change to call InitSockets (WSAStartup) in net.c initialize_action (used by isc_net_probe...() routines), making it safe to initialize ipv4_works and ipv6_works before init_io() various fixes for build and runtime issues exposed by building on Solaris, FreeBSD and Linux and testing on Linux ChangeLog@1.343.2.2 +1 -0 [Bug 1225] Broadcast address miscalculated on Windows 4.2.5p180 gsoc_sntp/main.c@1.14 +1 -1 close_socket -> closesocket include/ntp.h@1.159 +3 -2 spaces -> tab include/ntp_rfc2553.h@1.31 +7 -7 stay out of system namespace by avoiding leading underscore include/ntp_select.h@1.4 +10 -5 add InitSockets prototype (new with updated win32 libisc net.c) include/ntp_stdlib.h@1.31 +0 -2 remove netsyslog, WSAGetLastError tested equivalent to GetLastError in Windows NT 4.0 and later at least. libntp/lib_strbuf.c@1.5 +3 -2 correct test for isc_net_probeipvX() return value libntp/lib_strbuf.h@1.5 +0 -2 ipv4_works, ipv6_works are in ntp_stdlib.h libntp/msyslog.c@1.22 +0 -51 remove netsyslog, WSAGetLastError tested equivalent to GetLastError in Windows NT 4.0 and later at least. libntp/socktoa.c@1.10 +10 -7 allow AF_UNSPEC again, add missing break to case AF_INET6 ntpd/ntp_intres.c@1.63 +7 -14 remove unused LOCALHOST #define, use ipv6_works instead of isc_net_probeipv6() use estrdup() remove \n from msyslog() format string ntpd/ntp_io.c@1.288 +40 -51 one missed merge cleanup header shuffle to fix unix build a = b = c == d is an assignment but not the one intended itf_flags = -> itf_flags |=, parentheses use isc_net_probe_ipv6only() to decide if we setsockopt(IPV6_V6ONLY) extraneous '&' broke unix recvfrom/recvmsg ntpd/ntpd.c@1.102.1.2 +3 -3 move init_lib() call back to original location remove netsyslog, WSAGetLastError tested equivalent to GetLastError in Windows NT 4.0 and later at least. ntpdate/ntpdate.c@1.67 +24 -34 if (isc_net_probeipv6() != ISC_R_SUCCESS) -> if (!ipv6_works) remove netsyslog, WSAGetLastError tested equivalent to GetLastError in Windows NT 4.0 and later at least. remove explicit WSAStartup() call on Windows, now handled in init_lib() ntpdc/ntpdc.c@1.65 +3 -10 if (isc_net_probeipv6() != ISC_R_SUCCESS) -> if (!ipv6_works) remove Win32InitSockets call, handled by init_lib() now ntpq/ntpq.c@1.87 +2 -8 if (isc_net_probeipv6() != ISC_R_SUCCESS) -> if (!ipv6_works) remove Win32InitSockets call, handled by init_lib() now ports/winnt/include/config.h@1.67.2.2 +0 -2 remove INCLUDE_IPV6_SUPPORT, INCLUDE_IPV6_MULTICAST_SUPPORT, unneeded ports/winnt/include/isc/net.h@1.7 +50 -31 updated from BIND 9.6.1.b1 ports/winnt/libisc/interfaceiter.c@1.9 +6 -6 [Bug 1225] set netmask before using it to calculate broadcast address in internal_current() ports/winnt/libisc/net.c@1.9 +79 -72 updated from BIND 9.6.1.b1 ports/winnt/libntp/libntp.vcproj@1.8 +0 -22 remove dnslookup.c reference, unused code unlikely to be revived ports/winnt/libntp/setpriority.c@1.2 +28 -0 Add InitSockets() to libntp for Windows (needed by updated ports/winnt/libisc/net.c) ports/winnt/ntpd/ntp_iocompletionport.c@1.42.1.2 +1 -13 remove short-lived dummy InitSockets from mixed libisc versions, now lives in libntp (ports/winnt/libntp/setpriority.c) remove netsyslog, WSAGetLastError tested equivalent to GetLastError in Windows NT 4.0 and later at least. ChangeSet@1.1873.1.1, 2009-06-15 03:46:17+00:00, davehart@shiny.ad.hartbrothers.com Use a union for structs sockaddr, sockaddr_storage, sockaddr_in, and sockaddr_in6 to remove casts and enable type checking. Collapse some previously separate IPv4/IPv6 paths into a single codepath. ChangeLog@1.336.1.1 +4 -1 Use a union for structs sockaddr, sockaddr_storage, sockaddr_in, and sockaddr_in6 to remove casts and enable type checking. Collapse some previously separate IPv4/IPv6 paths into a single codepath. gsoc_sntp/main.c@1.13 +5 -5 struct sockaddr_storage -> sockaddr_u use sizeof instead of constant gsoc_sntp/networking.c@1.19 +117 -130 struct sockaddr_storage -> sockaddr_u use sizeof instead of constant gsoc_sntp/networking.h@1.12 +6 -8 struct sockaddr_storage -> sockaddr_u gsoc_sntp/utilities.c@1.6 +5 -3 struct sockaddr_storage -> sockaddr_u gsoc_sntp/utilities.h@1.5 +1 -1 struct sockaddr_storage -> sockaddr_u include/interfaceiter.h@1.4 +0 -0 Rename: BitKeeper/deleted/.del-interfaceiter.h~52531bc -> include/interfaceiter.h BitKeeper/deleted/.del-interfaceiter.h~52531bc@1.3 +0 -0 Rename: include/interfaceiter.h -> BitKeeper/deleted/.del-interfaceiter.h~52531bc include/iosignal.h@1.4 +8 -8 whitespace cleanup include/ntp.h@1.155.2.1 +16 -102 whitespace cleanup, move sockaddr macros to ntp_net.h include/ntp_control.h@1.35 +1 -1 struct sockaddr_storage -> sockaddr_u include/ntp_fp.h@1.15 +10 -12 whitespace cleanup, stay out of system namespace by avoiding leading underscore for identifiers include/ntp_malloc.h@1.3 +5 -5 stay out of system namespace _ntp_malloc_h -> NTP_MALLOC_H include/ntp_net.h@1.2 +189 -0 move sockaddr macros from ntp.h, add more include/ntp_refclock.h@1.23 +2 -2 struct sockaddr_storage -> sockaddr_u include/ntp_request.h@1.35 +5 -5 rename struct info_monitor.lastdrop to restr to reflect its use include/ntp_stdlib.h@1.30 +13 -6 struct sockaddr_storage -> sockaddr_u include/ntpd.h@1.128 +37 -39 struct sockaddr_storage -> sockaddr_u whitespace cleanup include/ntpsim.h@1.11 +2 -2 struct sockaddr_storage -> sockaddr_u include/recvbuff.h@1.16.1.1 +5 -6 struct sockaddr_storage -> sockaddr_u libntp/a_md5encrypt.c@1.19 +4 -4 struct sockaddr_storage -> sockaddr_u libntp/clocktypes.c@1.18 +4 -4 spaces to tabs libntp/decodenetnum.c@1.6.1.1 +2 -2 struct sockaddr_storage -> sockaddr_u libntp/lib_strbuf.c@1.4 +8 -0 IPv6 on Windows (cherry picked and previously committed, [Bug 1200]) libntp/lib_strbuf.h@1.4 +2 -0 IPv6 on Windows (cherry picked and previously committed, [Bug 1200]) libntp/netof.c@1.7 +30 -24 struct sockaddr_storage -> sockaddr_u libntp/numtoa.c@1.4 +5 -3 sprintf -> snprintf libntp/recvbuff.c@1.29.1.1 +2 -7 IPv6 on Windows (cherry picked and previously committed, [Bug 1200]) libntp/refnumtoa.c@1.6 +13 -10 struct sockaddr_storage -> sockaddr_u sprintf -> snprintf libntp/socktoa.c@1.9 +12 -13 struct sockaddr_storage -> sockaddr_u strcpy -> strncpy libntp/socktohost.c@1.6 +4 -4 struct sockaddr_storage -> sockaddr_u ntpd/ntp_config.c@1.192.1.1 +93 -124 struct sockaddr_storage -> sockaddr_u ntpd/ntp_control.c@1.111 +9 -9 struct sockaddr_storage -> sockaddr_u ntpd/ntp_crypto.c@1.137 +15 -23 struct sockaddr_storage -> sockaddr_u use DPRINTF emalloc + strcpy -> estrdup ntpd/ntp_intres.c@1.62 +12 -12 struct sockaddr_storage -> sockaddr_u ntpd/ntp_io.c@1.285.1.1 +1470 -1649 struct sockaddr_storage -> sockaddr_u ntpd/ntp_monitor.c@1.24 +2 -2 struct sockaddr_storage -> sockaddr_u ntpd/ntp_peer.c@1.118.1.1 +45 -50 struct sockaddr_storage -> sockaddr_u ntpd/ntp_proto.c@1.286.1.1 +11 -13 struct sockaddr_storage -> sockaddr_u use DPRINTF ntpd/ntp_refclock.c@1.86.1.1 +2 -14 struct sockaddr_storage -> sockaddr_u ISREFCLOCKADR() no longer assumes address given is IPv4 ntpd/ntp_request.c@1.78.1.1 +323 -339 struct sockaddr_storage -> sockaddr_u ISREFCLOCKADR() no longer assumes address given is IPv4 ntpd/ntp_restrict.c@1.27 +19 -23 struct sockaddr_storage -> sockaddr_u ntpd/ntp_timer.c@1.54 +2 -2 eliminate truncation warning, whitespace ntpd/ntp_util.c@1.72 +14 -14 struct sockaddr_storage -> sockaddr_u ntpd/ntpd.c@1.102.1.1 +18 -15 IPv6 on Windows (cherry picked and previously committed, [Bug 1200]) remove 3rd call to setup_logfile(), only needed once after daemonizing ntpd/ntpsim.c@1.21 +132 -133 struct sockaddr_storage -> sockaddr_u use sizeof(var) not sizeof(typeof(var)) to insulate against breakage whitespace cleanup ntpd/refclock_nmea.c@1.37.1.1 +2 -2 SOCKLEN misuse use struct recvbuff.recv_peer instead of unioned recv_srcclock to avoid cast ntpdate/ntpdate.c@1.66 +28 -45 struct sockaddr_storage -> sockaddr_u ntpdate/ntpdate.h@1.10 +1 -1 struct sockaddr_storage -> sockaddr_u ntpdc/layout.std@1.8 +2 -2 rename monlist lastdrop field to restr as it hold restrict bits not time ntpdc/ntpdc.c@1.62.1.1 +8 -10 struct sockaddr_storage -> sockaddr_u ntpdc/ntpdc.h@1.9 +2 -2 struct sockaddr_storage -> sockaddr_u ntpdc/ntpdc_ops.c@1.56.1.1 +165 -219 struct sockaddr_storage -> sockaddr_u ntpq/libntpq.c@1.3 +4 -4 struct sockaddr_storage -> sockaddr_u ntpq/libntpq.h@1.2 +1 -1 struct sockaddr_storage -> sockaddr_u ntpq/libntpq_subs.c@1.2 +2 -2 struct sockaddr_storage -> sockaddr_u ntpq/ntpq-subs.c@1.31 +23 -26 struct sockaddr_storage -> sockaddr_u ntpq/ntpq.c@1.84.1.1 +8 -11 struct sockaddr_storage -> sockaddr_u ISREFCLOCKADR() includes IS_IPV4 check ntpq/ntpq.h@1.7 +3 -3 struct sockaddr_storage -> sockaddr_u ports/winnt/include/config.h@1.65.1.1 +29 -12 IPv6 on Windows (cherry picked and previously committed, [Bug 1200]) ports/winnt/include/ntp_iocompletionport.h@1.17 +8 -9 struct sockaddr_storage -> sockaddr_u IPv6 on Windows (cherry picked and previously committed, [Bug 1200]) ports/winnt/include/transmitbuff.h@1.6.1.1 +3 -7 IPv6 on Windows (cherry picked and previously committed, [Bug 1200]) ports/winnt/include/win32_io.h@1.9.1.1 +3 -1 groundwork for bug 1016 (refclock_arc.c support on Windows) ports/winnt/libntp/libntp.vcproj@1.5.1.1 +4 -0 add ntp_net.h reference ports/winnt/libntp/transmitbuff.c@1.7.1.1 +10 -6 IPv6 on Windows (cherry picked and previously committed, [Bug 1200]) ports/winnt/ntpd/nt_clockstuff.c@1.29.1.1 +14 -1 abort if SIZEOF_ macros are wrong on DEBUG ports/winnt/ntpd/ntp_iocompletionport.c@1.41.1.1 +68 -67 struct sockaddr_storage -> sockaddr_u IPv6 on Windows (cherry picked and previously committed, [Bug 1200]) ports/winnt/ntpd/ntpd.vcproj@1.5.1.1 +8 -1 add ntp_net.h, ntp_signd.c references no need to exclude refclock_arc.c from build, CLOCK_ARCRON_MSF is not defined in ports/winnt/include/config.h yet ports/winnt/ntpdate/ntpdate.vcproj@1.2.1.1 +52 -0 add references to a bunch of headers ntpdate uses ChangeSet@1.1881.1.2, 2009-06-12 21:05:42+00:00, davehart@shiny.ad.hartbrothers.com document Windows-specific ntpd options -M, --pccfreq, --usepcc html/ntpd.html@1.48 +6 -0 document Windows-specific ntpd options -M, --pccfreq, --usepcc ChangeSet@1.1881.1.1, 2009-06-12 17:53:01+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows ChangeLog@1.343.1.1 +1 -0 [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows ntpd/ntpd-opts.c@1.174 +63 -2 [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows generated by autogen autoopts ntpd/ntpd-opts.h@1.174 +23 -5 [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows generated by autogen autoopts ntpd/ntpd.c@1.103 +2 -2 Switch to configured logfile from syslog just before init_winnt_time() (rather than just after) ntpd/ntpdbase-opts.def@1.17 +24 -0 [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows ports/winnt/ntpd/nt_clockstuff.c@1.32 +10 -5 [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows ChangeSet@1.1880.1.1, 2009-06-09 22:36:51+00:00, davehart@shiny.ad.hartbrothers.com timepps-Solaris.h pps_handle_t changed from pointer to scalar NMEA refclock converted to use common PPSAPI code Spectracom refclock added to Windows port of ntpd ChangeLog@1.342.1.1 +3 -0 timepps-Solaris.h pps_handle_t changed from pointer to scalar NMEA refclock converted to use common PPSAPI code Spectracom refclock added to Windows port of ntpd include/timepps-Solaris.h@1.6 +50 -31 timepps-Solaris.h pps_handle_t changed from pointer to scalar ntpd/refclock_nmea.c@1.39 +77 -242 NMEA refclock converted to use common PPSAPI code ports/winnt/include/config.h@1.67.1.1 +3 -2 Spectracom refclock added to Windows port of ntpd ports/winnt/ntpd/ntpd.vcproj@1.8 +0 -2 Spectracom refclock added to Windows port of ntpd ChangeSet@1.1882, 2009-06-08 17:51:47+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1215] unpeer by association ID ChangeLog@1.344 +1 -0 [Bug 1215] unpeer by association ID include/ntp_config.h@1.53 +7 -6 [Bug 1215] unpeer by association ID libntp/recvbuff.c@1.31 +49 -5 free receive buffers on free, full lists at shutdown on DEBUG ntpd/ntp_config.c@1.195 +43 -7 [Bug 1215] unpeer by association ID ports/winnt/include/config.h@1.68 +1 -0 added commented #define MALLOC_LINT for ease of enabling it ports/winnt/ntpd/ntp_iocompletionport.c@1.43 +79 -19 free receive buffers on free, full lists at shutdown on DEBUG free in-use (receive or send) I/O buffers at shutdown on DEBUG ChangeSet@1.1881, 2009-06-06 07:53:58-04:00, stenn@whimsy.udel.edu NTP_4_2_5P181 TAG: NTP_4_2_5P181 ChangeLog@1.343 +1 -0 NTP_4_2_5P181 gsoc_sntp/sntp-opts.c@1.42 +2 -2 NTP_4_2_5P181 gsoc_sntp/sntp-opts.h@1.42 +3 -3 NTP_4_2_5P181 gsoc_sntp/sntp-opts.texi@1.42 +1 -1 NTP_4_2_5P181 gsoc_sntp/sntp.1@1.42 +2 -2 NTP_4_2_5P181 ntpd/ntpd-opts.c@1.173 +2 -2 NTP_4_2_5P181 ntpd/ntpd-opts.h@1.173 +3 -3 NTP_4_2_5P181 ntpd/ntpd-opts.texi@1.172 +1 -1 NTP_4_2_5P181 ntpd/ntpd.1@1.172 +2 -2 NTP_4_2_5P181 ntpdc/ntpdc-opts.c@1.169 +2 -2 NTP_4_2_5P181 ntpdc/ntpdc-opts.h@1.169 +3 -3 NTP_4_2_5P181 ntpdc/ntpdc-opts.texi@1.168 +1 -1 NTP_4_2_5P181 ntpdc/ntpdc.1@1.168 +2 -2 NTP_4_2_5P181 ntpq/ntpq-opts.c@1.169 +2 -2 NTP_4_2_5P181 ntpq/ntpq-opts.h@1.169 +3 -3 NTP_4_2_5P181 ntpq/ntpq-opts.texi@1.168 +1 -1 NTP_4_2_5P181 ntpq/ntpq.1@1.168 +2 -2 NTP_4_2_5P181 ntpsnmpd/ntpsnmpd-opts.c@1.50 +2 -2 NTP_4_2_5P181 ntpsnmpd/ntpsnmpd-opts.h@1.50 +3 -3 NTP_4_2_5P181 ntpsnmpd/ntpsnmpd-opts.texi@1.50 +1 -1 NTP_4_2_5P181 ntpsnmpd/ntpsnmpd.1@1.50 +2 -2 NTP_4_2_5P181 packageinfo.sh@1.184 +1 -1 NTP_4_2_5P181 sntp/sntp-opts.c@1.169 +2 -2 NTP_4_2_5P181 sntp/sntp-opts.h@1.169 +3 -3 NTP_4_2_5P181 sntp/sntp-opts.texi@1.168 +1 -1 NTP_4_2_5P181 sntp/sntp.1@1.168 +2 -2 NTP_4_2_5P181 util/ntp-keygen-opts.c@1.172 +2 -2 NTP_4_2_5P181 util/ntp-keygen-opts.h@1.172 +3 -3 NTP_4_2_5P181 util/ntp-keygen-opts.texi@1.171 +1 -1 NTP_4_2_5P181 util/ntp-keygen.1@1.171 +2 -2 NTP_4_2_5P181 ChangeSet@1.1877.1.4, 2009-06-06 04:29:46+00:00, davehart@shiny.ad.hartbrothers.com timepps.h: Use FreeLibrary in load_pps_provider failure paths, correct (provtime_pps_destroy) cast, and fix for always returning -1 meaning failure but errno 0 on successful time_pps_destroy() ports/winnt/include/timepps.h@1.2 +10 -2 Use FreeLibrary in load_pps_provider failure paths, correct (provtime_pps_destroy) cast, and fix for always returning -1 meaning failure but errno 0 on successful time_pps_destroy() ChangeSet@1.1877.2.1, 2009-06-05 23:35:04+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1084] PPSAPI for ntpd on Windows with DLL backends [Bug 1204] Unix-style refclock device paths on Windows [Bug 1205] partial fix, disable RDTSC use by default on Windows Enable ONCORE, ARCRON refclocks on Windows (untested) ChangeLog@1.340.2.1 +4 -0 [Bug 1084] PPSAPI for ntpd on Windows with DLL backends [Bug 1204] Unix-style refclock device paths on Windows [Bug 1205] partial fix, disable RDTSC use by default on Windows Enable ONCORE, ARCRON refclocks on Windows (untested) include/ntp_types.h@1.13 +14 -0 [Bug 1204] Unix-style refclock device paths on Windows ntpd/refclock_arc.c@1.20 +4 -2 Enable ONCORE, ARCRON refclocks on Windows (untested) ntpd/refclock_atom.c@1.60 +1 -1 [Bug 1204] Unix-style refclock device paths on Windows ntpd/refclock_hopfser.c@1.13 +1 -4 [Bug 1204] Unix-style refclock device paths on Windows ntpd/refclock_nmea.c@1.38 +12 -12 [Bug 1204] Unix-style refclock device paths on Windows quiet type conversion warning ntpd/refclock_oncore.c@1.68 +12 -4 Enable ONCORE, ARCRON refclocks on Windows (untested) ntpd/refclock_palisade.c@1.25 +2 -4 [Bug 1204] Unix-style refclock device paths on Windows ports/winnt/include/clockstuff.h@1.10 +1 -1 #include "ntp_fp.h" ports/winnt/include/config.h@1.67 +21 -5 Enable ONCORE, ARCRON refclocks on Windows (untested) ports/winnt/include/timepps.h@1.1 +803 -0 [Bug 1084] PPSAPI for ntpd on Windows with DLL backends ports/winnt/include/timepps.h@1.0 +0 -0 ports/winnt/ntpd/nt_clockstuff.c@1.31 +46 -1 [Bug 1205] partial fix, disable RDTSC use by default on Windows ports/winnt/ntpd/ntpd.vcproj@1.7 +0 -3 Enable ONCORE, ARCRON refclocks on Windows (untested) ports/winnt/ntpd/win32_io.c@1.18 +75 -34 [Bug 1204] Unix-style refclock device paths on Windows ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.c@1.1 +382 -0 Sample source for Windows PPSAPI provider DLL implementing interface defined in ports/winnt/include/timepps.h ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.c@1.0 +0 -0 ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.def@1.1 +9 -0 Sample source for Windows PPSAPI provider DLL implementing interface defined in ports/winnt/include/timepps.h ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.def@1.0 +0 -0 ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h@1.1 +22 -0 Sample source for Windows PPSAPI provider DLL implementing interface defined in ports/winnt/include/timepps.h ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h@1.0 +0 -0 ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.sln@1.1 +19 -0 Sample source for Windows PPSAPI provider DLL implementing interface defined in ports/winnt/include/timepps.h ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.sln@1.0 +0 -0 ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.vcproj@1.1 +227 -0 Sample source for Windows PPSAPI provider DLL implementing interface defined in ports/winnt/include/timepps.h ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.vcproj@1.0 +0 -0 ports/winnt/ppsapi/skelprov/sys/time.h@1.1 +18 -0 Sample source for Windows PPSAPI provider DLL implementing interface defined in ports/winnt/include/timepps.h ports/winnt/ppsapi/skelprov/sys/time.h@1.0 +0 -0 ChangeSet@1.1877.1.2, 2009-06-03 01:35:02+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1211] keysdir free()d twice #ifdef DEBUG ChangeLog@1.340.1.2 +1 -0 [Bug 1211] keysdir free()d twice #ifdef DEBUG libntp/decodenetnum.c@1.8 +3 -3 this 1208 fix works ntpd/ntp_config.c@1.194 +10 -32 [Bug 1211] keysdir free()d twice #ifdef DEBUG ports/winnt/ntpd/ntservice.c@1.17 +23 -10 turn on more heap checking on Windows DEBUG build ChangeSet@1.1877.1.1, 2009-06-02 22:04:37+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1208] decodenetnum() buffer overrun on [ with no ] ChangeLog@1.340.1.1 +1 -0 [Bug 1208] decodenetnum() buffer overrun on [ with no ] libntp/decodenetnum.c@1.7 +17 -11 [Bug 1208] decodenetnum() buffer overrun on [ with no ] ChangeSet@1.1878, 2009-06-01 08:52:39-04:00, mayer@pogo.udel.edu [Bug 1206] Required compiler changes for Windows ChangeLog@1.341 +1 -0 [Bug 1206] Required compiler changes for Windows ports/winnt/libntp/libntp.dsp@1.34 +8 -12 [Bug 1206] Required compiler changes for Windows ChangeSet@1.1877, 2009-05-29 07:54:39-04:00, stenn@whimsy.udel.edu NTP_4_2_5P180 TAG: NTP_4_2_5P180 ChangeLog@1.340 +1 -0 NTP_4_2_5P180 gsoc_sntp/sntp-opts.c@1.41 +2 -2 NTP_4_2_5P180 gsoc_sntp/sntp-opts.h@1.41 +3 -3 NTP_4_2_5P180 gsoc_sntp/sntp-opts.texi@1.41 +1 -1 NTP_4_2_5P180 gsoc_sntp/sntp.1@1.41 +2 -2 NTP_4_2_5P180 ntpd/ntpd-opts.c@1.172 +2 -2 NTP_4_2_5P180 ntpd/ntpd-opts.h@1.172 +3 -3 NTP_4_2_5P180 ntpd/ntpd-opts.texi@1.171 +2 -2 NTP_4_2_5P180 ntpd/ntpd.1@1.171 +2 -2 NTP_4_2_5P180 ntpdc/ntpdc-opts.c@1.168 +2 -2 NTP_4_2_5P180 ntpdc/ntpdc-opts.h@1.168 +3 -3 NTP_4_2_5P180 ntpdc/ntpdc-opts.texi@1.167 +2 -2 NTP_4_2_5P180 ntpdc/ntpdc.1@1.167 +2 -2 NTP_4_2_5P180 ntpq/ntpq-opts.c@1.168 +2 -2 NTP_4_2_5P180 ntpq/ntpq-opts.h@1.168 +3 -3 NTP_4_2_5P180 ntpq/ntpq-opts.texi@1.167 +2 -2 NTP_4_2_5P180 ntpq/ntpq.1@1.167 +2 -2 NTP_4_2_5P180 ntpsnmpd/ntpsnmpd-opts.c@1.49 +2 -2 NTP_4_2_5P180 ntpsnmpd/ntpsnmpd-opts.h@1.49 +3 -3 NTP_4_2_5P180 ntpsnmpd/ntpsnmpd-opts.texi@1.49 +1 -1 NTP_4_2_5P180 ntpsnmpd/ntpsnmpd.1@1.49 +2 -2 NTP_4_2_5P180 packageinfo.sh@1.183 +1 -1 NTP_4_2_5P180 sntp/sntp-opts.c@1.168 +2 -2 NTP_4_2_5P180 sntp/sntp-opts.h@1.168 +3 -3 NTP_4_2_5P180 sntp/sntp-opts.texi@1.167 +1 -1 NTP_4_2_5P180 sntp/sntp.1@1.167 +2 -2 NTP_4_2_5P180 util/ntp-keygen-opts.c@1.171 +2 -2 NTP_4_2_5P180 util/ntp-keygen-opts.h@1.171 +3 -3 NTP_4_2_5P180 util/ntp-keygen-opts.texi@1.170 +2 -2 NTP_4_2_5P180 util/ntp-keygen.1@1.170 +2 -2 NTP_4_2_5P180 ChangeSet@1.1874.1.1, 2009-05-29 03:50:53-04:00, stenn@whimsy.udel.edu Lose FLAG_FIXPOLL, from Dave Mills ChangeLog@1.337.1.1 +1 -0 Lose FLAG_FIXPOLL, from Dave Mills include/ntp.h@1.155.1.1 +3 -4 Lose FLAG_FIXPOLL, from Dave Mills ntpd/ntp_config.c@1.193 +2 -2 Lose FLAG_FIXPOLL, from Dave Mills ntpd/ntp_peer.c@1.119 +20 -3 Lose FLAG_FIXPOLL, from Dave Mills ntpd/ntp_proto.c@1.287 +1 -2 Lose FLAG_FIXPOLL, from Dave Mills ntpd/ntp_refclock.c@1.87 +1 -1 Lose FLAG_FIXPOLL, from Dave Mills ntpd/refclock_acts.c@1.35 +0 -1 Lose FLAG_FIXPOLL, from Dave Mills ChangeSet@1.1875, 2009-05-29 04:29:18+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1200] Enable IPv6 in Windows port ChangeLog@1.338 +1 -0 [Bug 1200] Enable IPv6 in Windows port include/isc/interfaceiter.h@1.4 +1 -3 remove unnecessary additions to struct isc_interface, eases future integration of libisc drops include/ntp.h@1.156 +7 -8 [Bug 1200] Enable IPv6 in Windows port remove never used ifindex from struct interface, make phase u_short instead of u_char, move next to u_short family for better packing include/recvbuff.h@1.17 +4 -5 [Bug 1200] Enable IPv6 in Windows port rename Windows-only src_addr_len to recv_srcadr_len to clarify it is associated with recv_srcadr remove wsabuff, send/recv routines can safely put it on stack libntp/recvbuff.c@1.30 +0 -5 recvbuff.wsabuff removal ntpd/ntp_io.c@1.286 +4 -21 [Bug 1200] Enable IPv6 in Windows port remove unused ifindex from struct interface do not initialize unused transmitbuff.c code ntpd/ntp_request.c@1.79 +2 -1 remove unused ifindex from struct interface ntpdc/ntpdc.c@1.63 +9 -1 [Bug 1200] Enable IPv6 in Windows port ntpdc/ntpdc_ops.c@1.57 +4 -5 do not display ifindex in ifstats, was always zero and now removed ntpq/ntpq.c@1.85 +13 -4 [Bug 1200] Enable IPv6 in Windows port ports/winnt/include/config.h@1.66 +39 -14 [Bug 1200] Enable IPv6 in Windows port ports/winnt/include/transmitbuff.h@1.7 +3 -7 remove wsabuff, stack allocation is no problem for it ports/winnt/include/win32_io.h@1.10 +3 -1 prep for future refclock_arc.c support on windows ports/winnt/libisc/interfaceiter.c@1.8 +203 -92 [Bug 1200] Enable IPv6 in Windows port ports/winnt/libisc/net.c@1.8 +8 -18 [Bug 1200] Enable IPv6 in Windows port ports/winnt/libntp/interfaceiter.c@1.3 +188 -68 not used, upstream drop from BIND 9.6.1b1 is baseline for ports/winnt/libisc/interfaceiter.c ports/winnt/libntp/libntp.vcproj@1.6 +4 -0 add ntp_net.h reference ports/winnt/libntp/transmitbuff.c@1.8 +10 -6 remove wsabuf initialization, note the code is dead in top comment ports/winnt/ntpd/nt_clockstuff.c@1.30 +16 -1 complain on DEBUG builds if hardcoded SIZEOF_ macros are wrong ports/winnt/ntpd/ntp_iocompletionport.c@1.42 +86 -79 [Bug 1200] Enable IPv6 on Windows remove wsabuf from transmitbuff_t, recvbuff ports/winnt/ntpd/ntpd.vcproj@1.6 +8 -1 add ntp_signd.c, ntp_net.h references ports/winnt/ntpdate/ntpdate.vcproj@1.3 +52 -0 add a bunch of missing header references (not all by far though) ChangeSet@1.1874, 2009-05-23 07:55:15-04:00, stenn@whimsy.udel.edu NTP_4_2_5P179 TAG: NTP_4_2_5P179 ChangeLog@1.337 +1 -0 NTP_4_2_5P179 gsoc_sntp/sntp-opts.c@1.40 +2 -2 NTP_4_2_5P179 gsoc_sntp/sntp-opts.h@1.40 +3 -3 NTP_4_2_5P179 gsoc_sntp/sntp-opts.texi@1.40 +1 -1 NTP_4_2_5P179 gsoc_sntp/sntp.1@1.40 +2 -2 NTP_4_2_5P179 ntpd/ntpd-opts.c@1.171 +2 -2 NTP_4_2_5P179 ntpd/ntpd-opts.h@1.171 +3 -3 NTP_4_2_5P179 ntpd/ntpd-opts.texi@1.170 +2 -2 NTP_4_2_5P179 ntpd/ntpd.1@1.170 +2 -2 NTP_4_2_5P179 ntpdc/ntpdc-opts.c@1.167 +2 -2 NTP_4_2_5P179 ntpdc/ntpdc-opts.h@1.167 +3 -3 NTP_4_2_5P179 ntpdc/ntpdc-opts.texi@1.166 +2 -2 NTP_4_2_5P179 ntpdc/ntpdc.1@1.166 +2 -2 NTP_4_2_5P179 ntpq/ntpq-opts.c@1.167 +2 -2 NTP_4_2_5P179 ntpq/ntpq-opts.h@1.167 +3 -3 NTP_4_2_5P179 ntpq/ntpq-opts.texi@1.166 +2 -2 NTP_4_2_5P179 ntpq/ntpq.1@1.166 +2 -2 NTP_4_2_5P179 ntpsnmpd/ntpsnmpd-opts.c@1.48 +2 -2 NTP_4_2_5P179 ntpsnmpd/ntpsnmpd-opts.h@1.48 +3 -3 NTP_4_2_5P179 ntpsnmpd/ntpsnmpd-opts.texi@1.48 +1 -1 NTP_4_2_5P179 ntpsnmpd/ntpsnmpd.1@1.48 +2 -2 NTP_4_2_5P179 packageinfo.sh@1.182 +1 -1 NTP_4_2_5P179 sntp/sntp-opts.c@1.167 +2 -2 NTP_4_2_5P179 sntp/sntp-opts.h@1.167 +3 -3 NTP_4_2_5P179 sntp/sntp-opts.texi@1.166 +1 -1 NTP_4_2_5P179 sntp/sntp.1@1.166 +2 -2 NTP_4_2_5P179 util/ntp-keygen-opts.c@1.170 +2 -2 NTP_4_2_5P179 util/ntp-keygen-opts.h@1.170 +3 -3 NTP_4_2_5P179 util/ntp-keygen-opts.texi@1.169 +2 -2 NTP_4_2_5P179 util/ntp-keygen.1@1.169 +2 -2 NTP_4_2_5P179 ChangeSet@1.1871.1.1, 2009-05-22 22:13:36-04:00, stenn@whimsy.udel.edu Dave's latest change fixes a reported bug - update the ChangeLog ChangeLog@1.334.1.1 +3 -2 Dave's latest change fixes a reported bug - update the ChangeLog ChangeSet@1.1872, 2009-05-23 02:02:18+00:00, davehart@shiny.ad.hartbrothers.com Bug [1041] manycastclient fails with 4.2.5p120. (fixed by Dave Mills' prior delta to ntp_peer.c xmt -> aorg) Bug [1196] VC6 winsock2.h does not define SO_EXLUSIVEADDRUSE. ChangeLog@1.335 +3 -1 Bug [1041] manycastclient fails with 4.2.5p120. Bug [1196] VC6 winsock2.h does not define SO_EXLUSIVEADDRUSE. ntpd/ntp_io.c@1.285 +17 -6 disambiguate two identical DPRINTFs in findbcastinter() ports/winnt/include/config.h@1.65 +7 -0 Bug [1196] VC6 winsock2.h does not define SO_EXLUSIVEADDRUSE. ChangeSet@1.1869.1.1, 2009-05-22 21:16:18-04:00, stenn@whimsy.udel.edu xmt/aorg and leap_expire fixes from Dave Mills ChangeLog@1.332.1.2 +1 -0 xmt -> aorg timestamp cleanup from Dave Mills, reported by Dave Hart ChangeLog@1.332.1.1 +1 -0 Leap/expire cleanup from Dave Mills ntpd/ntp_crypto.c@1.136 +1 -0 Leap/expire cleanup from Dave Mills ntpd/ntp_peer.c@1.118 +1 -1 xmt -> aorg timestamp cleanup from Dave Mills, reported by Dave Hart ntpd/ntp_proto.c@1.286 +7 -6 xmt -> aorg timestamp cleanup from Dave Mills, reported by Dave Hart ChangeSet@1.1870, 2009-05-21 18:34:36+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1193] Compile error: conflicting types for emalloc ChangeLog@1.333 +1 -0 [Bug 1193] Compile error: conflicting types for emalloc libntp/emalloc.c@1.8 +3 -3 [Bug 1193] correct emalloc arg type from u_int -> size_t to match header correct printf format specifier mismatch of %d (int) and strlen (size_t) ChangeSet@1.1869, 2009-05-21 07:54:56-04:00, stenn@whimsy.udel.edu NTP_4_2_5P178 TAG: NTP_4_2_5P178 ChangeLog@1.332 +1 -0 NTP_4_2_5P178 gsoc_sntp/sntp-opts.c@1.39 +2 -2 NTP_4_2_5P178 gsoc_sntp/sntp-opts.h@1.39 +3 -3 NTP_4_2_5P178 gsoc_sntp/sntp-opts.texi@1.39 +1 -1 NTP_4_2_5P178 gsoc_sntp/sntp.1@1.39 +2 -2 NTP_4_2_5P178 ntpd/ntpd-opts.c@1.170 +2 -2 NTP_4_2_5P178 ntpd/ntpd-opts.h@1.170 +3 -3 NTP_4_2_5P178 ntpd/ntpd-opts.texi@1.169 +1 -1 NTP_4_2_5P178 ntpd/ntpd.1@1.169 +2 -2 NTP_4_2_5P178 ntpdc/ntpdc-opts.c@1.166 +2 -2 NTP_4_2_5P178 ntpdc/ntpdc-opts.h@1.166 +3 -3 NTP_4_2_5P178 ntpdc/ntpdc-opts.texi@1.165 +1 -1 NTP_4_2_5P178 ntpdc/ntpdc.1@1.165 +2 -2 NTP_4_2_5P178 ntpq/ntpq-opts.c@1.166 +2 -2 NTP_4_2_5P178 ntpq/ntpq-opts.h@1.166 +3 -3 NTP_4_2_5P178 ntpq/ntpq-opts.texi@1.165 +1 -1 NTP_4_2_5P178 ntpq/ntpq.1@1.165 +2 -2 NTP_4_2_5P178 ntpsnmpd/ntpsnmpd-opts.c@1.47 +2 -2 NTP_4_2_5P178 ntpsnmpd/ntpsnmpd-opts.h@1.47 +3 -3 NTP_4_2_5P178 ntpsnmpd/ntpsnmpd-opts.texi@1.47 +1 -1 NTP_4_2_5P178 ntpsnmpd/ntpsnmpd.1@1.47 +2 -2 NTP_4_2_5P178 packageinfo.sh@1.181 +1 -1 NTP_4_2_5P178 sntp/sntp-opts.c@1.166 +2 -2 NTP_4_2_5P178 sntp/sntp-opts.h@1.166 +3 -3 NTP_4_2_5P178 sntp/sntp-opts.texi@1.165 +1 -1 NTP_4_2_5P178 sntp/sntp.1@1.165 +2 -2 NTP_4_2_5P178 util/ntp-keygen-opts.c@1.169 +2 -2 NTP_4_2_5P178 util/ntp-keygen-opts.h@1.169 +3 -3 NTP_4_2_5P178 util/ntp-keygen-opts.texi@1.168 +1 -1 NTP_4_2_5P178 util/ntp-keygen.1@1.168 +2 -2 NTP_4_2_5P178 ChangeSet@1.1868, 2009-05-21 03:03:04-04:00, stenn@whimsy.udel.edu Note fixes for bugs 320 and 1192, and erealloc() and estrdup(), along with better config parser error messages. ChangeLog@1.331 +4 -0 Note fixes for bugs 320 and 1192, and erealloc() and estrdup(), along with better config parser error messages. ChangeSet@1.1867, 2009-05-21 05:30:18+00:00, davehart@shiny.ad.hartbrothers.com [Bug 320] restrict default should apply to both IPv4 and IPv6 [Bug 1192] restrict -4 default / restrict -6 default lost with new ntp.conf parser. Dynamically allocate Windows serial handles array to save 1KB static show column of syntax errors as well as line add erealloc(), estrdup() save column number at start of each token for more precise syntax error messages include/ntp_calendar.h@1.4 +13 -13 whitespace cleanup, parenthesize macro arg include/ntp_config.h@1.52 +1 -1 whitespace include/ntp_filegen.h@1.6 +1 -1 changed prototype for filegen_unregister() include/ntp_stdlib.h@1.29 +10 -5 add erealloc(), estrdup() include/ntp_types.h@1.12 +5 -0 add COUNTOF(array) macro include/ntpd.h@1.127 +1 -1 add comment that fstostr time_t arg isn't a typical time_t libntp/emalloc.c@1.7 +75 -14 add erealloc(), estrdup() libntp/ntp_lineedit.c@1.6 +2 -1 strdup() -> estrdup() ntpd/ntp_config.c@1.192 +310 -244 [Bug 320] restrict default should apply to both IPv4 and IPv6 [Bug 1192] restrict -4 default / restrict -6 default lost with new ntp.conf parser. Remove unnecessary casts, use sizeof(*ptr) instead of sizeof(ptr_type) change switch/case indents to NTP style wrap long lines, remove unneeded casts, silence uninit warning strdup() -> estrdup() ntpd/ntp_filegen.c@1.15 +226 -194 free more malloc()'d memory at shutdown #ifdef DEBUG whitespace cleanup, wrap long lines remove unnecessary casts sprintf()->snprintf() constants on left side of == to catch accidental change to =, and put more informative item first '/' -> DIR_SEP restore DPRINTF()s that gave Alpha compiler fits by using %p printf format ntpd/ntp_parser.c@1.38 +1000 -955 Bison output from ntp_parser.y ntpd/ntp_parser.h@1.22 +225 -225 Bison output from ntp_parser.y ntpd/ntp_parser.y@1.33 +50 -22 [Bug 1192] restrict -4 default / restrict -6 default lost with new ntp.conf parser. correct else block indent in include processing code remove unwanted \n from end of msyslog() in yyerror() strdup() -> estrdup() display line and column numbers in syntax error messages save column number at start of each token for more precise syntax error messages ntpd/ntp_scanner.c@1.21 +110 -118 strdup() -> estrdup() first line number is one not zero save column number at start of each token for more precise syntax error messages clarify reason for -4/-6 hack in yylex() comment ntpd/ntp_scanner.h@1.6 +16 -13 save column number at start of each token for more precise syntax error messages whitespace cleanup ntpd/ntp_util.c@1.71 +42 -52 free() then emalloc() becomes erealloc() thin #ifdef forest ports/winnt/include/win32_io.h@1.9 +95 -85 whitespace and indent cleanup stay out of system namespace (leading _) ports/winnt/ntpd/nt_clockstuff.c@1.29 +0 -3 COUNTOF() macro moved to ntp_types.h ports/winnt/ntpd/win32_io.c@1.17 +420 -202 dynamically allocate serial handles array (saves 1 KB static) change switch/case intents to NTP style add TIOCMGET tty ioctl emulation, improve TIOCMSET emulation correct tcsetattr() & tcgetattr() return values remove superfluous NT_COM: prefix from error texts ChangeSet@1.1866, 2009-05-18 08:14:01-04:00, stenn@whimsy.udel.edu NTP_4_2_5P177 TAG: NTP_4_2_5P177 ChangeLog@1.330 +1 -0 NTP_4_2_5P177 gsoc_sntp/sntp-opts.c@1.38 +2 -2 NTP_4_2_5P177 gsoc_sntp/sntp-opts.h@1.38 +3 -3 NTP_4_2_5P177 gsoc_sntp/sntp-opts.texi@1.38 +1 -1 NTP_4_2_5P177 gsoc_sntp/sntp.1@1.38 +2 -2 NTP_4_2_5P177 ntpd/ntpd-opts.c@1.169 +4 -4 NTP_4_2_5P177 ntpd/ntpd-opts.h@1.169 +4 -4 NTP_4_2_5P177 ntpd/ntpd-opts.texi@1.168 +1 -1 NTP_4_2_5P177 ntpd/ntpd.1@1.168 +2 -2 NTP_4_2_5P177 ntpdc/ntpdc-opts.c@1.165 +4 -4 NTP_4_2_5P177 ntpdc/ntpdc-opts.h@1.165 +4 -4 NTP_4_2_5P177 ntpdc/ntpdc-opts.texi@1.164 +1 -1 NTP_4_2_5P177 ntpdc/ntpdc.1@1.164 +2 -2 NTP_4_2_5P177 ntpq/ntpq-opts.c@1.165 +4 -4 NTP_4_2_5P177 ntpq/ntpq-opts.h@1.165 +4 -4 NTP_4_2_5P177 ntpq/ntpq-opts.texi@1.164 +1 -1 NTP_4_2_5P177 ntpq/ntpq.1@1.164 +2 -2 NTP_4_2_5P177 ntpsnmpd/ntpsnmpd-opts.c@1.46 +4 -4 NTP_4_2_5P177 ntpsnmpd/ntpsnmpd-opts.h@1.46 +4 -4 NTP_4_2_5P177 ntpsnmpd/ntpsnmpd-opts.texi@1.46 +1 -1 NTP_4_2_5P177 ntpsnmpd/ntpsnmpd.1@1.46 +2 -2 NTP_4_2_5P177 packageinfo.sh@1.180 +1 -1 NTP_4_2_5P177 sntp/sntp-opts.c@1.165 +2 -2 NTP_4_2_5P177 sntp/sntp-opts.h@1.165 +3 -3 NTP_4_2_5P177 sntp/sntp-opts.texi@1.164 +1 -1 NTP_4_2_5P177 sntp/sntp.1@1.164 +2 -2 NTP_4_2_5P177 util/ntp-keygen-opts.c@1.168 +4 -4 NTP_4_2_5P177 util/ntp-keygen-opts.h@1.168 +4 -4 NTP_4_2_5P177 util/ntp-keygen-opts.texi@1.167 +1 -1 NTP_4_2_5P177 util/ntp-keygen.1@1.167 +2 -2 NTP_4_2_5P177 ChangeSet@1.1436.15.70, 2009-05-18 05:04:41-04:00, stenn@whimsy.udel.edu NTP_4_2_4P7 TAG: NTP_4_2_4P7 ChangeLog@1.1.1.90 +1 -0 NTP_4_2_4P7 ntpd/ntpd-opts.c@1.50.25.1 +4 -4 NTP_4_2_4P7 ntpd/ntpd-opts.h@1.50.25.1 +4 -4 NTP_4_2_4P7 ntpd/ntpd-opts.texi@1.49.25.1 +1 -1 NTP_4_2_4P7 ntpd/ntpd.1@1.48.25.1 +2 -2 NTP_4_2_4P7 ntpd/ntpdsim-opts.c@1.50.25.1 +4 -4 NTP_4_2_4P7 ntpd/ntpdsim-opts.h@1.50.25.1 +4 -4 NTP_4_2_4P7 ntpd/ntpdsim-opts.texi@1.48.25.1 +1 -1 NTP_4_2_4P7 ntpd/ntpdsim.1@1.48.25.1 +2 -2 NTP_4_2_4P7 ntpdc/ntpdc-opts.c@1.50.25.1 +4 -4 NTP_4_2_4P7 ntpdc/ntpdc-opts.h@1.50.25.1 +4 -4 NTP_4_2_4P7 ntpdc/ntpdc-opts.texi@1.48.25.1 +1 -1 NTP_4_2_4P7 ntpdc/ntpdc.1@1.48.25.1 +2 -2 NTP_4_2_4P7 ntpq/ntpq-opts.c@1.52.25.1 +4 -4 NTP_4_2_4P7 ntpq/ntpq-opts.h@1.52.25.1 +4 -4 NTP_4_2_4P7 ntpq/ntpq-opts.texi@1.49.25.1 +1 -1 NTP_4_2_4P7 ntpq/ntpq.1@1.48.25.1 +2 -2 NTP_4_2_4P7 packageinfo.sh@1.65.33.2 +2 -2 NTP_4_2_4P7 sntp/sntp-opts.c@1.49.25.1 +2 -2 NTP_4_2_4P7 sntp/sntp-opts.h@1.49.25.1 +3 -3 NTP_4_2_4P7 sntp/sntp-opts.texi@1.46.25.1 +1 -1 NTP_4_2_4P7 sntp/sntp.1@1.49.25.1 +2 -2 NTP_4_2_4P7 util/ntp-keygen-opts.c@1.49.25.1 +4 -4 NTP_4_2_4P7 util/ntp-keygen-opts.h@1.49.25.1 +4 -4 NTP_4_2_4P7 util/ntp-keygen-opts.texi@1.47.25.1 +1 -1 NTP_4_2_4P7 util/ntp-keygen.1@1.47.25.1 +2 -2 NTP_4_2_4P7 ChangeSet@1.1436.15.69, 2009-05-18 03:14:59-04:00, stenn@whimsy.udel.edu 4.2.4p7 NEWS@1.86.1.15 +38 -0 4.2.4p7 packageinfo.sh@1.65.33.1 +1 -1 4.2.4p7 ChangeSet@1.1436.15.68, 2009-05-18 02:56:36-04:00, stenn@whimsy.udel.edu [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252 ChangeLog@1.1.1.89 +1 -0 [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252 ntpd/ntp_crypto.c@1.107.1.3 +22 -17 [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252 ChangeSet@1.1436.15.67, 2009-05-18 02:24:31-04:00, stenn@whimsy.udel.edu [Bug 1187] Update the copyright date. ChangeLog@1.1.1.88 +1 -0 [Bug 1187] Update the copyright date. include/copyright.def@1.5.1.3 +1 -1 [Bug 1187] Update the copyright date. ChangeSet@1.1436.15.66, 2009-05-17 08:59:06+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix for [Sec 1149]. ChangeLog@1.1.1.87 +5 -0 [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix for [Sec 1149]. ntpd/ntp_io.c@1.244.2.17 +45 -34 [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix for [Sec 1149]. ChangeSet@1.1860.1.2, 2009-05-15 19:54:46+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1174] nmea_shutdown assumes that nmea has a unit assigned ChangeLog@1.325.1.2 +1 -0 [Bug 1174] nmea_shutdown assumes that nmea has a unit assigned ntpd/refclock_nmea.c@1.37 +6 -2 [Bug 1174] nmea_shutdown assumes that nmea has a unit assigned ChangeSet@1.1860.1.1, 2009-05-15 19:37:17+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1190] NMEA refclock fudge flag4 1 obscures position in timecode Update NMEA documentation for a number of changes over the last year ChangeLog@1.325.1.1 +2 -0 [Bug 1190] NMEA refclock fudge flag4 1 obscures position in timecode Update NMEA documentation for a number of changes over the last year html/drivers/driver20.html@1.18 +18 -21 Update NMEA documentation for a number of changes over the last year ntpd/refclock_nmea.c@1.36 +89 -13 [Bug 1190] NMEA refclock fudge flag4 1 obscures position in timecode ChangeSet@1.1436.15.65, 2009-05-14 04:42:10+00:00, davehart@shiny.ad.hartbrothers.com fix error from BitKeeper/triggers/pre-resolve.licfix triggered (ahem) by recent BitKeeper/etc/config delta updating repologs email address BitKeeper/triggers/pre-resolve.licfix@1.5 +4 -1 bk sccscat has been removed, replaced by bk annotate -R -q grep -> grep -q (untested until recent BitKeeper/etc/config commit changing repologs@ntp.isc.org to repologs@ntp.org ChangeSet@1.1861, 2009-05-14 01:33:16+00:00, davehart@shiny.ad.hartbrothers.com ChangeLog: remove duplicate [Bug 1154] entry from failed first fix ChangeLog@1.326 +0 -2 remove duplicate [Bug 1154] entry from failed first fix ChangeSet@1.1860, 2009-05-13 07:54:55-04:00, stenn@whimsy.udel.edu NTP_4_2_5P176 TAG: NTP_4_2_5P176 ChangeLog@1.325 +1 -0 NTP_4_2_5P176 gsoc_sntp/sntp-opts.c@1.37 +2 -2 NTP_4_2_5P176 gsoc_sntp/sntp-opts.h@1.37 +3 -3 NTP_4_2_5P176 gsoc_sntp/sntp-opts.texi@1.37 +1 -1 NTP_4_2_5P176 gsoc_sntp/sntp.1@1.37 +2 -2 NTP_4_2_5P176 ntpd/ntpd-opts.c@1.168 +2 -2 NTP_4_2_5P176 ntpd/ntpd-opts.h@1.168 +3 -3 NTP_4_2_5P176 ntpd/ntpd-opts.texi@1.167 +1 -1 NTP_4_2_5P176 ntpd/ntpd.1@1.167 +2 -2 NTP_4_2_5P176 ntpdc/ntpdc-opts.c@1.164 +2 -2 NTP_4_2_5P176 ntpdc/ntpdc-opts.h@1.164 +3 -3 NTP_4_2_5P176 ntpdc/ntpdc-opts.texi@1.163 +1 -1 NTP_4_2_5P176 ntpdc/ntpdc.1@1.163 +2 -2 NTP_4_2_5P176 ntpq/ntpq-opts.c@1.164 +2 -2 NTP_4_2_5P176 ntpq/ntpq-opts.h@1.164 +3 -3 NTP_4_2_5P176 ntpq/ntpq-opts.texi@1.163 +1 -1 NTP_4_2_5P176 ntpq/ntpq.1@1.163 +2 -2 NTP_4_2_5P176 ntpsnmpd/ntpsnmpd-opts.c@1.45 +2 -2 NTP_4_2_5P176 ntpsnmpd/ntpsnmpd-opts.h@1.45 +3 -3 NTP_4_2_5P176 ntpsnmpd/ntpsnmpd-opts.texi@1.45 +1 -1 NTP_4_2_5P176 ntpsnmpd/ntpsnmpd.1@1.45 +2 -2 NTP_4_2_5P176 packageinfo.sh@1.179 +1 -1 NTP_4_2_5P176 sntp/sntp-opts.c@1.164 +2 -2 NTP_4_2_5P176 sntp/sntp-opts.h@1.164 +3 -3 NTP_4_2_5P176 sntp/sntp-opts.texi@1.163 +1 -1 NTP_4_2_5P176 sntp/sntp.1@1.163 +2 -2 NTP_4_2_5P176 util/ntp-keygen-opts.c@1.167 +2 -2 NTP_4_2_5P176 util/ntp-keygen-opts.h@1.167 +3 -3 NTP_4_2_5P176 util/ntp-keygen-opts.texi@1.166 +1 -1 NTP_4_2_5P176 util/ntp-keygen.1@1.166 +2 -2 NTP_4_2_5P176 ChangeSet@1.1845.6.2, 2009-05-12 08:57:55-04:00, utterback@pogo.udel.edu ntpd.c: [Bug 1154] mDNS registration should be done later, repeatedly and only if asked for. ntpd/ntpd.c@1.100.1.1 +29 -7 [Bug 1154] mDNS registration should be done later, repeatedly and only if asked for. ChangeSet@1.1845.6.1, 2009-05-12 08:51:48-04:00, utterback@pogo.udel.edu ChangeLog: [Bug 1154] mDNS registration should be done later, repeatedly and only if asked for. ChangeLog@1.310.5.1 +2 -0 [Bug 1154] mDNS registration should be done later, repeatedly and only if asked for. ChangeSet@1.1858, 2009-05-12 08:07:45-04:00, stenn@whimsy.udel.edu NTP_4_2_5P175 TAG: NTP_4_2_5P175 ChangeLog@1.323 +1 -0 NTP_4_2_5P175 gsoc_sntp/sntp-opts.c@1.36 +2 -2 NTP_4_2_5P175 gsoc_sntp/sntp-opts.h@1.36 +3 -3 NTP_4_2_5P175 gsoc_sntp/sntp-opts.texi@1.36 +1 -1 NTP_4_2_5P175 gsoc_sntp/sntp.1@1.36 +2 -2 NTP_4_2_5P175 ntpd/ntpd-opts.c@1.167 +2 -2 NTP_4_2_5P175 ntpd/ntpd-opts.h@1.167 +3 -3 NTP_4_2_5P175 ntpd/ntpd-opts.texi@1.166 +1 -1 NTP_4_2_5P175 ntpd/ntpd.1@1.166 +2 -2 NTP_4_2_5P175 ntpdc/ntpdc-opts.c@1.163 +2 -2 NTP_4_2_5P175 ntpdc/ntpdc-opts.h@1.163 +3 -3 NTP_4_2_5P175 ntpdc/ntpdc-opts.texi@1.162 +1 -1 NTP_4_2_5P175 ntpdc/ntpdc.1@1.162 +2 -2 NTP_4_2_5P175 ntpq/ntpq-opts.c@1.163 +2 -2 NTP_4_2_5P175 ntpq/ntpq-opts.h@1.163 +3 -3 NTP_4_2_5P175 ntpq/ntpq-opts.texi@1.162 +1 -1 NTP_4_2_5P175 ntpq/ntpq.1@1.162 +2 -2 NTP_4_2_5P175 ntpsnmpd/ntpsnmpd-opts.c@1.44 +2 -2 NTP_4_2_5P175 ntpsnmpd/ntpsnmpd-opts.h@1.44 +3 -3 NTP_4_2_5P175 ntpsnmpd/ntpsnmpd-opts.texi@1.44 +1 -1 NTP_4_2_5P175 ntpsnmpd/ntpsnmpd.1@1.44 +2 -2 NTP_4_2_5P175 packageinfo.sh@1.178 +1 -1 NTP_4_2_5P175 sntp/sntp-opts.c@1.163 +2 -2 NTP_4_2_5P175 sntp/sntp-opts.h@1.163 +3 -3 NTP_4_2_5P175 sntp/sntp-opts.texi@1.162 +1 -1 NTP_4_2_5P175 sntp/sntp.1@1.162 +2 -2 NTP_4_2_5P175 util/ntp-keygen-opts.c@1.166 +2 -2 NTP_4_2_5P175 util/ntp-keygen-opts.h@1.166 +3 -3 NTP_4_2_5P175 util/ntp-keygen-opts.texi@1.165 +1 -1 NTP_4_2_5P175 util/ntp-keygen.1@1.165 +2 -2 NTP_4_2_5P175 ChangeSet@1.1857, 2009-05-12 05:37:53-04:00, stenn@whimsy.udel.edu Merge cleanup ChangeLog@1.322 +1 -0 Merge cleanup ChangeSet@1.1436.15.64, 2009-05-12 02:41:56-04:00, stenn@whimsy.udel.edu NTP_4_2_4P7_RC7 TAG: NTP_4_2_4P7_RC7 ChangeLog@1.1.1.86 +1 -0 NTP_4_2_4P7_RC7 ntpd/ntpd-opts.c@1.50.24.1 +3 -3 NTP_4_2_4P7_RC7 ntpd/ntpd-opts.h@1.50.24.1 +3 -3 NTP_4_2_4P7_RC7 ntpd/ntpd-opts.texi@1.49.24.1 +1 -1 NTP_4_2_4P7_RC7 ntpd/ntpd.1@1.48.24.1 +3 -3 NTP_4_2_4P7_RC7 ntpd/ntpdsim-opts.c@1.50.24.1 +3 -3 NTP_4_2_4P7_RC7 ntpd/ntpdsim-opts.h@1.50.24.1 +3 -3 NTP_4_2_4P7_RC7 ntpd/ntpdsim-opts.texi@1.48.24.1 +1 -1 NTP_4_2_4P7_RC7 ntpd/ntpdsim.1@1.48.24.1 +3 -3 NTP_4_2_4P7_RC7 ntpdc/ntpdc-opts.c@1.50.24.1 +3 -3 NTP_4_2_4P7_RC7 ntpdc/ntpdc-opts.h@1.50.24.1 +3 -3 NTP_4_2_4P7_RC7 ntpdc/ntpdc-opts.texi@1.48.24.1 +1 -1 NTP_4_2_4P7_RC7 ntpdc/ntpdc.1@1.48.24.1 +3 -3 NTP_4_2_4P7_RC7 ntpq/ntpq-opts.c@1.52.24.1 +3 -3 NTP_4_2_4P7_RC7 ntpq/ntpq-opts.h@1.52.24.1 +3 -3 NTP_4_2_4P7_RC7 ntpq/ntpq-opts.texi@1.49.24.1 +1 -1 NTP_4_2_4P7_RC7 ntpq/ntpq.1@1.48.24.1 +3 -3 NTP_4_2_4P7_RC7 packageinfo.sh@1.65.32.1 +1 -1 NTP_4_2_4P7_RC7 sntp/sntp-opts.c@1.49.24.1 +3 -3 NTP_4_2_4P7_RC7 sntp/sntp-opts.h@1.49.24.1 +3 -3 NTP_4_2_4P7_RC7 sntp/sntp-opts.texi@1.46.24.1 +1 -1 NTP_4_2_4P7_RC7 sntp/sntp.1@1.49.24.1 +3 -3 NTP_4_2_4P7_RC7 util/ntp-keygen-opts.c@1.49.24.1 +3 -3 NTP_4_2_4P7_RC7 util/ntp-keygen-opts.h@1.49.24.1 +3 -3 NTP_4_2_4P7_RC7 util/ntp-keygen-opts.texi@1.47.24.1 +1 -1 NTP_4_2_4P7_RC7 util/ntp-keygen.1@1.47.24.1 +3 -3 NTP_4_2_4P7_RC7 ChangeSet@1.1436.15.63, 2009-05-12 01:07:37-04:00, stenn@whimsy.udel.edu ntp.isc.org -> ntp.org cleanup BitKeeper/etc/config@1.10 +1 -1 ntp.isc.org -> ntp.org cleanup ChangeLog@1.1.1.85 +1 -0 ntp.isc.org -> ntp.org cleanup README@1.22.1.1 +1 -1 ntp.isc.org -> ntp.org cleanup README.bk@1.18.1.1 +1 -1 ntp.isc.org -> ntp.org cleanup README.patches@1.3.1.1 +1 -1 ntp.isc.org -> ntp.org cleanup WHERE-TO-START@1.6.1.1 +1 -1 ntp.isc.org -> ntp.org cleanup configure.ac@1.400.1.18 +1 -1 ntp.isc.org -> ntp.org cleanup include/copyright.def@1.5.1.2 +1 -1 ntp.isc.org -> ntp.org cleanup sntp/sntp-opts.def@1.10.1.1 +1 -1 ntp.isc.org -> ntp.org cleanup ChangeSet@1.1845.5.1, 2009-05-11 21:43:27-04:00, stenn@whimsy.udel.edu [Bug 1182] Documentation typos and missing bits ChangeLog@1.310.4.1 +1 -0 [Bug 1182] Documentation typos and missing bits html/accopt.html@1.28 +120 -67 [Bug 1182] Documentation typos and missing bits html/decode.html@1.9 +37 -25 [Bug 1182] Documentation typos and missing bits html/monopt.html@1.30 +511 -457 [Bug 1182] Documentation typos and missing bits ChangeSet@1.1845.4.2, 2009-05-12 00:58:59+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1183] COM port support should extend past COM3 ChangeLog@1.310.3.2 +1 -0 [Bug 1183] COM port support should extend past COM3 libisc/sockaddr.c@1.6 +1 -1 silence truncation warning ntpd/ntp_control.c@1.110 +1 -1 silence truncation warning ntpd/ntp_peer.c@1.117 +7 -10 silence truncation warnings, use NULL not 0 for pointers ntpd/ntp_refclock.c@1.86 +57 -81 [Bug 1183] COM port support should extend past COM3 silence a few truncation warnings, clean up indents ntpd/ntp_scanner.c@1.20 +0 -1 remove dead code "return 1" at end of yylex(), silencing warning and allowing the compiler to catch any future change which revives it, as then the compiler would error on the missing "return" ntpd/ntpd.c@1.101 +2 -2 fix leading whitespace, correct #endif comment ports/winnt/include/config.h@1.62.1.1 +1 -1 disable CLOCK_DUMBCLOCK on Windows, it needs work first ports/winnt/ntpd/win32_io.c@1.16 +6 -4 [Bug 1183] COM port support should extend past COM3 ChangeSet@1.1845.2.5, 2009-05-11 19:01:24+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1184] ntpd is deaf when restricted to second IP on the same net ChangeLog@1.310.2.3 +1 -0 [Bug 1184] ntpd is deaf when restricted to second IP on the same net include/ntp.h@1.155 +10 -9 add indents, parentheses to clarify SOCKCMP macro ntpd/ntp_io.c@1.283 +163 -34 [Bug 1184] ntpd is deaf when restricted to second IP on the same net ChangeSet@1.1845.2.4, 2009-05-09 17:54:29+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: correct config.h comment quoting configure.ac@1.441.2.2 +7 -7 correct config.h comment quoting, use AS_HELP_STRING ChangeSet@1.1845.4.1, 2009-05-09 07:55:25-04:00, stenn@whimsy.udel.edu NTP_4_2_5P174 TAG: NTP_4_2_5P174 ChangeLog@1.310.3.1 +1 -0 NTP_4_2_5P174 gsoc_sntp/sntp-opts.c@1.35 +2 -2 NTP_4_2_5P174 gsoc_sntp/sntp-opts.h@1.35 +3 -3 NTP_4_2_5P174 gsoc_sntp/sntp-opts.texi@1.35 +1 -1 NTP_4_2_5P174 gsoc_sntp/sntp.1@1.35 +2 -2 NTP_4_2_5P174 ntpd/ntpd-opts.c@1.166 +2 -2 NTP_4_2_5P174 ntpd/ntpd-opts.h@1.166 +3 -3 NTP_4_2_5P174 ntpd/ntpd-opts.texi@1.165 +1 -1 NTP_4_2_5P174 ntpd/ntpd.1@1.165 +2 -2 NTP_4_2_5P174 ntpdc/ntpdc-opts.c@1.162 +2 -2 NTP_4_2_5P174 ntpdc/ntpdc-opts.h@1.162 +3 -3 NTP_4_2_5P174 ntpdc/ntpdc-opts.texi@1.161 +1 -1 NTP_4_2_5P174 ntpdc/ntpdc.1@1.161 +2 -2 NTP_4_2_5P174 ntpq/ntpq-opts.c@1.162 +2 -2 NTP_4_2_5P174 ntpq/ntpq-opts.h@1.162 +3 -3 NTP_4_2_5P174 ntpq/ntpq-opts.texi@1.161 +1 -1 NTP_4_2_5P174 ntpq/ntpq.1@1.161 +2 -2 NTP_4_2_5P174 ntpsnmpd/ntpsnmpd-opts.c@1.43 +2 -2 NTP_4_2_5P174 ntpsnmpd/ntpsnmpd-opts.h@1.43 +3 -3 NTP_4_2_5P174 ntpsnmpd/ntpsnmpd-opts.texi@1.43 +1 -1 NTP_4_2_5P174 ntpsnmpd/ntpsnmpd.1@1.43 +2 -2 NTP_4_2_5P174 packageinfo.sh@1.177 +1 -1 NTP_4_2_5P174 sntp/sntp-opts.c@1.162 +2 -2 NTP_4_2_5P174 sntp/sntp-opts.h@1.162 +3 -3 NTP_4_2_5P174 sntp/sntp-opts.texi@1.161 +1 -1 NTP_4_2_5P174 sntp/sntp.1@1.161 +2 -2 NTP_4_2_5P174 util/ntp-keygen-opts.c@1.165 +2 -2 NTP_4_2_5P174 util/ntp-keygen-opts.h@1.165 +3 -3 NTP_4_2_5P174 util/ntp-keygen-opts.texi@1.164 +1 -1 NTP_4_2_5P174 util/ntp-keygen.1@1.164 +2 -2 NTP_4_2_5P174 ChangeSet@1.1845.2.3, 2009-05-09 09:00:06+00:00, davehart@shiny.ad.hartbrothers.com add --disable-listen-read-drop configure option for machines with more interfaces than FD_SETSIZE [Bug 1180] ChangeLog@1.310.2.2 +1 -0 [Bug 1180] ntpd won't start with more than ~1000 interfaces configure.ac@1.441.2.1 +18 -0 add --disable-listen-read-drop configure option for machines with more interfaces than FD_SETSIZE [Bug 1180] ntpd/ntp_io.c@1.282 +27 -7 add --disable-listen-read-drop configure option for machines with more interfaces than FD_SETSIZE [Bug 1180] ports/winnt/ntpd/ntpd.vcproj@1.5 +4 -22 relocate cmd_args.c from ntpd header files to ntp source code in VS ChangeSet@1.1845.3.1, 2009-05-08 22:44:33+00:00, davehart@shiny.ad.hartbrothers.com ntp_io.c: make -I override -L, do not listen on unused interfaces ntpd/ntp_io.c@1.281 +9 -16 make -I override -L, do not listen on unused interfaces ChangeSet@1.1845.2.1, 2009-05-08 17:32:49-04:00, stenn@whimsy.udel.edu Stale leapsecond file fixes from Dave Mills ChangeLog@1.310.2.1 +1 -0 Stale leapsecond file fixes from Dave Mills html/decode.html@1.8 +844 -683 Stale leapsecond file fixes from Dave Mills include/ntp.h@1.154 +4 -0 Stale leapsecond file fixes from Dave Mills include/ntpd.h@1.126 +1 -0 Stale leapsecond file fixes from Dave Mills libntp/statestr.c@1.16 +3 -0 Stale leapsecond file fixes from Dave Mills ntpd/ntp_control.c@1.109 +2 -2 Stale leapsecond file fixes from Dave Mills ntpd/ntp_crypto.c@1.134 +8 -1 Stale leapsecond file fixes from Dave Mills ntpd/ntp_timer.c@1.51.1.1 +5 -1 Stale leapsecond file fixes from Dave Mills ntpd/ntp_util.c@1.70 +33 -7 Stale leapsecond file fixes from Dave Mills ChangeSet@1.1436.23.1, 2009-05-08 18:11:36+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: correct help text configure.ac@1.400.2.1 +11 -5 correct help text ChangeSet@1.1436.15.61, 2009-05-08 17:50:37+00:00, davehart@shiny.ad.hartbrothers.com add configure --enable-ignore-dns-errors to retry on any failure ChangeLog@1.1.1.84 +2 -1 add configure --enable-ignore-dns-errors to retry on any failure configure.ac@1.400.1.16 +26 -4 add configure --enable-ignore-dns-errors to retry on any failure ntpd/ntp_intres.c@1.48.1.7 +2 -0 add configure --enable-ignore-dns-errors to retry on any failure ChangeSet@1.1436.15.60, 2009-05-08 15:34:46+00:00, davehart@shiny.ad.hartbrothers.com Do not exceed FD_SETSIZE in ntp_intres.c --- ntp_intres.c: typo --- ntp_intres.c: missing comma typo --- ntp_intres.c: typo ntpd/ntp_intres.c@1.48.1.6 +64 -33 fix typos, refine "host name not found" log message, stay under FD_SETSIZE ntpd/ntp_request.c@1.65.1.2 +21 -3 after ntp_intres adds a server entry, rescan interfaces, to notice the return of connectivity sooner. ntpd/ntp_timer.c@1.33.1.1 +3 -5 indent cleanup ports/winnt/include/config.h@1.46.1.6 +4 -10 remove FORCE_DNSRETRY, no longer used indent cleanup ChangeSet@1.1845.1.8, 2009-05-08 08:07:08-04:00, stenn@whimsy.udel.edu NTP_4_2_5P173 TAG: NTP_4_2_5P173 ChangeLog@1.310.1.6 +1 -0 NTP_4_2_5P173 gsoc_sntp/sntp-opts.c@1.34 +2 -2 NTP_4_2_5P173 gsoc_sntp/sntp-opts.h@1.34 +3 -3 NTP_4_2_5P173 gsoc_sntp/sntp-opts.texi@1.34 +1 -1 NTP_4_2_5P173 gsoc_sntp/sntp.1@1.34 +2 -2 NTP_4_2_5P173 ntpd/ntpd-opts.c@1.165 +2 -2 NTP_4_2_5P173 ntpd/ntpd-opts.h@1.165 +3 -3 NTP_4_2_5P173 ntpd/ntpd-opts.texi@1.164 +2 -2 NTP_4_2_5P173 ntpd/ntpd.1@1.164 +2 -2 NTP_4_2_5P173 ntpdc/ntpdc-opts.c@1.161 +2 -2 NTP_4_2_5P173 ntpdc/ntpdc-opts.h@1.161 +3 -3 NTP_4_2_5P173 ntpdc/ntpdc-opts.texi@1.160 +2 -2 NTP_4_2_5P173 ntpdc/ntpdc.1@1.160 +2 -2 NTP_4_2_5P173 ntpq/ntpq-opts.c@1.161 +2 -2 NTP_4_2_5P173 ntpq/ntpq-opts.h@1.161 +3 -3 NTP_4_2_5P173 ntpq/ntpq-opts.texi@1.160 +2 -2 NTP_4_2_5P173 ntpq/ntpq.1@1.160 +2 -2 NTP_4_2_5P173 ntpsnmpd/ntpsnmpd-opts.c@1.42 +2 -2 NTP_4_2_5P173 ntpsnmpd/ntpsnmpd-opts.h@1.42 +3 -3 NTP_4_2_5P173 ntpsnmpd/ntpsnmpd-opts.texi@1.42 +1 -1 NTP_4_2_5P173 ntpsnmpd/ntpsnmpd.1@1.42 +2 -2 NTP_4_2_5P173 packageinfo.sh@1.176 +1 -1 NTP_4_2_5P173 sntp/sntp-opts.c@1.161 +2 -2 NTP_4_2_5P173 sntp/sntp-opts.h@1.161 +3 -3 NTP_4_2_5P173 sntp/sntp-opts.texi@1.160 +1 -1 NTP_4_2_5P173 sntp/sntp.1@1.160 +2 -2 NTP_4_2_5P173 util/ntp-keygen-opts.c@1.164 +2 -2 NTP_4_2_5P173 util/ntp-keygen-opts.h@1.164 +3 -3 NTP_4_2_5P173 util/ntp-keygen-opts.texi@1.163 +2 -2 NTP_4_2_5P173 util/ntp-keygen.1@1.163 +2 -2 NTP_4_2_5P173 ChangeSet@1.1436.22.1, 2009-05-08 11:24:43+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime ChangeLog@1.1.17.1 +4 -0 [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime ntpd/ntp_intres.c@1.48.1.5 +53 -55 [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime ChangeSet@1.1436.15.58, 2009-05-08 04:42:52-04:00, stenn@whimsy.udel.edu NTP_4_2_4P7_RC6 TAG: NTP_4_2_4P7_RC6 ChangeLog@1.1.1.82 +1 -0 NTP_4_2_4P7_RC6 ntpd/ntpd-opts.c@1.50.23.1 +2 -2 NTP_4_2_4P7_RC6 ntpd/ntpd-opts.h@1.50.23.1 +3 -3 NTP_4_2_4P7_RC6 ntpd/ntpd-opts.texi@1.49.23.1 +2 -2 NTP_4_2_4P7_RC6 ntpd/ntpd.1@1.48.23.1 +2 -2 NTP_4_2_4P7_RC6 ntpd/ntpdsim-opts.c@1.50.23.1 +2 -2 NTP_4_2_4P7_RC6 ntpd/ntpdsim-opts.h@1.50.23.1 +3 -3 NTP_4_2_4P7_RC6 ntpd/ntpdsim-opts.texi@1.48.23.1 +1 -1 NTP_4_2_4P7_RC6 ntpd/ntpdsim.1@1.48.23.1 +2 -2 NTP_4_2_4P7_RC6 ntpdc/ntpdc-opts.c@1.50.23.1 +2 -2 NTP_4_2_4P7_RC6 ntpdc/ntpdc-opts.h@1.50.23.1 +3 -3 NTP_4_2_4P7_RC6 ntpdc/ntpdc-opts.texi@1.48.23.1 +2 -2 NTP_4_2_4P7_RC6 ntpdc/ntpdc.1@1.48.23.1 +2 -2 NTP_4_2_4P7_RC6 ntpq/ntpq-opts.c@1.52.23.1 +2 -2 NTP_4_2_4P7_RC6 ntpq/ntpq-opts.h@1.52.23.1 +3 -3 NTP_4_2_4P7_RC6 ntpq/ntpq-opts.texi@1.49.23.1 +2 -2 NTP_4_2_4P7_RC6 ntpq/ntpq.1@1.48.23.1 +2 -2 NTP_4_2_4P7_RC6 packageinfo.sh@1.65.31.1 +1 -1 NTP_4_2_4P7_RC6 sntp/sntp-opts.c@1.49.23.1 +2 -2 NTP_4_2_4P7_RC6 sntp/sntp-opts.h@1.49.23.1 +3 -3 NTP_4_2_4P7_RC6 sntp/sntp-opts.texi@1.46.23.1 +1 -1 NTP_4_2_4P7_RC6 sntp/sntp.1@1.49.23.1 +2 -2 NTP_4_2_4P7_RC6 util/ntp-keygen-opts.c@1.49.23.1 +2 -2 NTP_4_2_4P7_RC6 util/ntp-keygen-opts.h@1.49.23.1 +3 -3 NTP_4_2_4P7_RC6 util/ntp-keygen-opts.texi@1.47.23.1 +2 -2 NTP_4_2_4P7_RC6 util/ntp-keygen.1@1.47.23.1 +2 -2 NTP_4_2_4P7_RC6 ChangeSet@1.1436.15.57, 2009-05-08 03:29:16-04:00, stenn@pogo.udel.edu typo ChangeLog@1.1.1.81 +1 -1 typo ChangeSet@1.1436.15.56, 2009-05-08 02:13:17+00:00, davehart@shiny.ad.hartbrothers.com Add [Bug 1071] reference to ChangeLog entry ChangeLog@1.1.1.80 +2 -2 [Bug 1071] Log a message and exit before trying to use FD_SET with a descriptor larger than FD_SETSIZE, which will corrupt memory (adds reference to 1071 to existing description) ChangeSet@1.1436.15.55, 2009-05-08 01:23:43+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1179] error messages for -u/--user and -i when built w/o droproot ChangeLog@1.1.1.79 +1 -0 [Bug 1179] error messages for -u/--user and -i when built w/o droproot ntpd/cmd_args.c@1.45.3.4 +39 -19 descriptive error messages for -u/--user and -i without droproot ChangeSet@1.1436.15.54, 2009-05-07 22:15:41+00:00, davehart@shiny.ad.hartbrothers.com ntp_io.c: do not use FD_SET beyond FD_SETSIZE, watch for corruption of inter_list.head ChangeLog@1.1.1.78 +3 -0 do not use FD_SET beyond FD_SETSIZE, watch for corruption of inter_list.head ntpd/ntp_io.c@1.244.2.16 +23 -0 do not use FD_SET beyond FD_SETSIZE, watch for corruption of inter_list.head ChangeSet@1.1436.15.53, 2009-05-07 07:39:41+00:00, davehart@shiny.ad.hartbrothers.com refclock_jjy.c: add missing newline before EOF ntpd/refclock_jjy.c@1.13.1.2 +1 -1 add missing newline before EOF ChangeSet@1.1845.1.2, 2009-05-07 05:58:42+00:00, davehart@shiny.ad.hartbrothers.com refclock_jjy.c merge from stable cleanup ntpd/refclock_jjy.c@1.16 +1 -0 dropped a prototype in merge from stable ports/winnt/ntp.sln@1.3 +4 -4 moving ntpd.vcproj to be listed first should make it the default project ports/winnt/ntpd/ntpd.vcproj@1.4 +4 -0 add refclock_jjy.c reference ChangeSet@1.1436.15.52, 2009-05-07 05:19:36+00:00, davehart@shiny.ad.hartbrothers.com [Bug 784] Make --enable-linuxcaps the default when available add reference to refclock_jjy.c to ports/winnt/ntpd/ntpd.vcproj ChangeLog@1.1.1.77 +1 -0 [Bug 784] Make --enable-linuxcaps the default when available configure.ac@1.400.1.15 +34 -33 [Bug 784] Make --enable-linuxcaps the default when available ports/winnt/ntpd/ntpd.vcproj@1.1.1.1 +4 -0 add reference to refclock_jjy.c to ports/winnt/ntpd/ntpd.vcproj ChangeSet@1.1436.15.51, 2009-05-07 05:10:54+00:00, davehart@shiny.ad.hartbrothers.com Updated JJY reference clock driver from Takao abe Make ntpd the default project in Visual C++/Visual Studio ChangeLog@1.1.1.76 +4 -0 Updated JJY reference clock driver from Takao abe html/drivers/driver40.html@1.14 +103 -48 Updated JJY reference clock driver from Takao abe ntpd/refclock_jjy.c@1.13.1.1 +153 -5 Updated JJY reference clock driver from Takao abe ports/winnt/ntp.sln@1.1.1.1 +4 -4 Make ntpd the default project in Visual C++/Visual Studio ChangeSet@1.1846, 2009-05-06 17:29:45+00:00, davehart@shiny.ad.hartbrothers.com Simplify configure.ac NTP_CACHEVERSION interface, update comments ChangeLog@1.311 +2 -0 Clean up configure.ac NTP_CACHEVERSION interface, display cache version when clearing. Fixes a regression. configure.ac@1.442 +16 -25 Simplify configure.ac NTP_CACHEVERSION interface, update comments gsoc_sntp/configure.ac@1.17 +16 -14 Simplify configure.ac NTP_CACHEVERSION interface, update comments m4/ntp_cacheversion.m4@1.8 +18 -48 Simplify configure.ac NTP_CACHEVERSION interface, display cache version for top configure when clearing due to mismatch (fix regression) sntp/configure.ac@1.23 +19 -17 Simplify configure.ac NTP_CACHEVERSION interface, update comments ChangeSet@1.1845, 2009-05-06 07:55:27-04:00, stenn@whimsy.udel.edu NTP_4_2_5P172 TAG: NTP_4_2_5P172 ChangeLog@1.310 +1 -0 NTP_4_2_5P172 gsoc_sntp/sntp-opts.c@1.33 +2 -2 NTP_4_2_5P172 gsoc_sntp/sntp-opts.h@1.33 +3 -3 NTP_4_2_5P172 gsoc_sntp/sntp-opts.texi@1.33 +1 -1 NTP_4_2_5P172 gsoc_sntp/sntp.1@1.33 +2 -2 NTP_4_2_5P172 ntpd/ntpd-opts.c@1.164 +2 -2 NTP_4_2_5P172 ntpd/ntpd-opts.h@1.164 +3 -3 NTP_4_2_5P172 ntpd/ntpd-opts.texi@1.163 +2 -2 NTP_4_2_5P172 ntpd/ntpd.1@1.163 +2 -2 NTP_4_2_5P172 ntpdc/ntpdc-opts.c@1.160 +2 -2 NTP_4_2_5P172 ntpdc/ntpdc-opts.h@1.160 +3 -3 NTP_4_2_5P172 ntpdc/ntpdc-opts.texi@1.159 +2 -2 NTP_4_2_5P172 ntpdc/ntpdc.1@1.159 +2 -2 NTP_4_2_5P172 ntpq/ntpq-opts.c@1.160 +2 -2 NTP_4_2_5P172 ntpq/ntpq-opts.h@1.160 +3 -3 NTP_4_2_5P172 ntpq/ntpq-opts.texi@1.159 +2 -2 NTP_4_2_5P172 ntpq/ntpq.1@1.159 +2 -2 NTP_4_2_5P172 ntpsnmpd/ntpsnmpd-opts.c@1.41 +2 -2 NTP_4_2_5P172 ntpsnmpd/ntpsnmpd-opts.h@1.41 +3 -3 NTP_4_2_5P172 ntpsnmpd/ntpsnmpd-opts.texi@1.41 +1 -1 NTP_4_2_5P172 ntpsnmpd/ntpsnmpd.1@1.41 +2 -2 NTP_4_2_5P172 packageinfo.sh@1.175 +1 -1 NTP_4_2_5P172 sntp/sntp-opts.c@1.160 +2 -2 NTP_4_2_5P172 sntp/sntp-opts.h@1.160 +3 -3 NTP_4_2_5P172 sntp/sntp-opts.texi@1.159 +1 -1 NTP_4_2_5P172 sntp/sntp.1@1.159 +2 -2 NTP_4_2_5P172 util/ntp-keygen-opts.c@1.163 +2 -2 NTP_4_2_5P172 util/ntp-keygen-opts.h@1.163 +3 -3 NTP_4_2_5P172 util/ntp-keygen-opts.texi@1.162 +2 -2 NTP_4_2_5P172 util/ntp-keygen.1@1.162 +2 -2 NTP_4_2_5P172 ChangeSet@1.1844, 2009-05-06 02:47:31-04:00, stenn@whimsy.udel.edu [Bug 1175] Instability in PLL daemon mode ChangeLog@1.309 +2 -1 [Bug 1175] Instability in PLL daemon mode include/Makefile.am@1.33 +57 -55 typo include/ntpd.h@1.125 +1 -1 [Bug 1175] Instability in PLL daemon mode ntpd/ntp_loopfilter.c@1.150 +14 -12 [Bug 1175] Instability in PLL daemon mode ntpd/ntp_proto.c@1.285 +1 -1 [Bug 1175] Instability in PLL daemon mode ChangeSet@1.1840.1.1, 2009-05-05 21:07:51+00:00, davehart@shiny.ad.hartbrothers.com Makefile.am: add new file ntp_lineedit.h to noinst_HEADERS include/Makefile.am@1.32 +1 -0 add new file ntp_lineedit.h to noinst_HEADERS ChangeSet@1.1842, 2009-05-05 19:19:25+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1176] refclock_parse.c does not compile without PPSAPI ChangeLog@1.308 +1 -0 [Bug 1176] refclock_parse.c does not compile without PPSAPI ntpd/refclock_parse.c@1.51 +2 -0 [Bug 1176] refclock_parse.c does not compile without PPSAPI ChangeSet@1.1841, 2009-05-04 08:02:28-04:00, stenn@whimsy.udel.edu NTP_4_2_5P171 TAG: NTP_4_2_5P171 ChangeLog@1.307 +1 -0 NTP_4_2_5P171 gsoc_sntp/sntp-opts.c@1.32 +2 -2 NTP_4_2_5P171 gsoc_sntp/sntp-opts.h@1.32 +3 -3 NTP_4_2_5P171 gsoc_sntp/sntp-opts.texi@1.32 +1 -1 NTP_4_2_5P171 gsoc_sntp/sntp.1@1.32 +2 -2 NTP_4_2_5P171 ntpd/ntpd-opts.c@1.163 +2 -2 NTP_4_2_5P171 ntpd/ntpd-opts.h@1.163 +3 -3 NTP_4_2_5P171 ntpd/ntpd-opts.texi@1.162 +2 -2 NTP_4_2_5P171 ntpd/ntpd.1@1.162 +2 -2 NTP_4_2_5P171 ntpdc/ntpdc-opts.c@1.159 +2 -2 NTP_4_2_5P171 ntpdc/ntpdc-opts.h@1.159 +3 -3 NTP_4_2_5P171 ntpdc/ntpdc-opts.texi@1.158 +2 -2 NTP_4_2_5P171 ntpdc/ntpdc.1@1.158 +2 -2 NTP_4_2_5P171 ntpq/ntpq-opts.c@1.159 +2 -2 NTP_4_2_5P171 ntpq/ntpq-opts.h@1.159 +3 -3 NTP_4_2_5P171 ntpq/ntpq-opts.texi@1.158 +2 -2 NTP_4_2_5P171 ntpq/ntpq.1@1.158 +2 -2 NTP_4_2_5P171 ntpsnmpd/ntpsnmpd-opts.c@1.40 +2 -2 NTP_4_2_5P171 ntpsnmpd/ntpsnmpd-opts.h@1.40 +3 -3 NTP_4_2_5P171 ntpsnmpd/ntpsnmpd-opts.texi@1.40 +1 -1 NTP_4_2_5P171 ntpsnmpd/ntpsnmpd.1@1.40 +2 -2 NTP_4_2_5P171 packageinfo.sh@1.174 +1 -1 NTP_4_2_5P171 sntp/sntp-opts.c@1.159 +2 -2 NTP_4_2_5P171 sntp/sntp-opts.h@1.159 +3 -3 NTP_4_2_5P171 sntp/sntp-opts.texi@1.158 +1 -1 NTP_4_2_5P171 sntp/sntp.1@1.158 +2 -2 NTP_4_2_5P171 util/ntp-keygen-opts.c@1.162 +2 -2 NTP_4_2_5P171 util/ntp-keygen-opts.h@1.162 +3 -3 NTP_4_2_5P171 util/ntp-keygen-opts.texi@1.161 +2 -2 NTP_4_2_5P171 util/ntp-keygen.1@1.161 +2 -2 NTP_4_2_5P171 ChangeSet@1.1837.1.2, 2009-05-04 06:41:39+00:00, davehart@shiny.ad.hartbrothers.com ntp_cacheversion.m4: iterate to find the quoting problem m4/ntp_cacheversion.m4@1.7 +8 -8 iterate to find the quoting problem ChangeSet@1.1837.1.1, 2009-05-04 06:23:22+00:00, davehart@shiny.ad.hartbrothers.com ntp_cacheversion.m4: m4 goes infinite m4/ntp_cacheversion.m4@1.6 +11 -11 m4 goes infinite ChangeSet@1.1837, 2009-05-04 02:05:29+00:00, davehart@shiny.ad.hartbrothers.com solve occasional sntp link problems with socket APIs by bringing its AC_SEARCH_LIBS for gethostent in line with main and gsoc_sntp configure tests, bump sntp/configure.ac cache version to 20090503 as a result --- ntp_cacheversion.m4: clear even other version stamps when flushing cache iff we are the top configure this invocation. ChangeLog@1.305 +3 -1 Fix msntp link problem on Solaris when configured before parent configure.ac@1.439.1.1 +22 -1 finally an idiom for "default to null not unset" that works --- bump cache version due to changes in sntp and gsoc_sntp gethostent library search order, the result of which is cached and shared with this configure. gsoc_sntp/configure.ac@1.16 +5 -4 make gethostent library search compatible with parent configure, and bump cache version because it is cached. m4/ntp_cacheversion.m4@1.5 +67 -36 clear even other version stamps when flushing cache iff we are the top configure this invocation. Prevents bump of child version stamp and parent version stamp at the same time from causing a useless second flush by the child just after the parent has recreated it from empty. sntp/configure.ac@1.22 +15 -2 solve occasional sntp link problems with socket APIs by bringing its AC_SEARCH_LIBS for gethostent in line with main and gsoc_sntp configure --- bump config.cache version for incompatible gethostent library search ChangeSet@1.1833.2.1, 2009-05-03 15:21:37-04:00, stenn@whimsy.udel.edu Autokey documentation cleanup from Dave Mills ChangeLog@1.302.2.1 +1 -0 Autokey documentation cleanup from Dave Mills html/authopt.html@1.49 +345 -217 Autokey documentation cleanup from Dave Mills html/decode.html@1.7 +8 -8 Autokey documentation cleanup from Dave Mills html/rate.html@1.5 +4 -2 Autokey documentation cleanup from Dave Mills html/xleave.html@1.4 +4 -2 Autokey documentation cleanup from Dave Mills ChangeSet@1.1835, 2009-05-03 14:43:41+00:00, davehart@shiny.ad.hartbrothers.com reliably detect invocation of child configure (NTP_CONFIGURE_PARENT) gsoc_sntp/configure.ac@1.15 +10 -0 reliably detect invocation of child configure (NTP_CONFIGURE_PARENT) m4/ntp_cacheversion.m4@1.4 +44 -17 reliably detect invocation of child configure (NTP_CONFIGURE_PARENT) sntp/configure.ac@1.21 +10 -0 reliably detect invocation of child configure (NTP_CONFIGURE_PARENT) ChangeSet@1.1833.1.5, 2009-05-03 09:15:12+00:00, davehart@shiny.ad.hartbrothers.com ntp_lineedit.c: remove leftover of another approach libntp/ntp_lineedit.c@1.5 +0 -2 remove leftover of another approach ChangeSet@1.1833.1.4, 2009-05-03 08:37:39+00:00, davehart@shiny.ad.hartbrothers.com ntp_lineedit.c: emit newline at interactive EOF to avoid ntpq> osprompt$ --- ntp_lineedit.c: alternating between readline and stone hammers is not good --- ntp_lineedit.c: keep preprocessor # in column one, fix readline path bug libntp/ntp_lineedit.c@1.4 +102 -92 emit newline at interactive EOF to avoid ntpq> osprompt$ --- alternating between readline and stone hammers is not good --- keep preprocessor # in column one, fix readline path bug ChangeSet@1.1833.1.3, 2009-05-03 06:25:51+00:00, davehart@shiny.ad.hartbrothers.com void printf(...) -> int printf(...) quiets gcc warning ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf' libparse/clk_computime.c@1.10 +1 -1 void printf(...) -> int printf(...) quiets gcc warning ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf' libparse/clk_dcf7000.c@1.10 +1 -1 void printf(...) -> int printf(...) quiets gcc warning ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf' libparse/clk_hopf6021.c@1.10 +1 -1 void printf(...) -> int printf(...) quiets gcc warning ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf' libparse/clk_rcc8000.c@1.10 +1 -1 void printf(...) -> int printf(...) quiets gcc warning ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf' libparse/clk_schmid.c@1.10 +1 -1 void printf(...) -> int printf(...) quiets gcc warning ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf' libparse/clk_trimtaip.c@1.10 +1 -1 void printf(...) -> int printf(...) quiets gcc warning ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf' libparse/clk_varitext.c@1.9 +1 -1 void printf(...) -> int printf(...) quiets gcc warning ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf' ports/winnt/ntpd/ntpd.vcproj@1.3 +12 -0 add libparse/clk_varitext.c (excluded from Windows build) ChangeSet@1.1833.1.2, 2009-05-03 05:08:34+00:00, davehart@shiny.ad.hartbrothers.com ../../libparse/parse.c:211: warning: implicit declaration of function 'bcopy' ../../libparse/parse.c:211: warning: incompatible implicit declaration of built- in function 'bcopy' #include in ntp_lineedit.c which uses free() configure.ac@1.440 +1 -0 ../../libparse/parse.c:211: warning: implicit declaration of function 'bcopy' ../../libparse/parse.c:211: warning: incompatible implicit declaration of built- in function 'bcopy' include/ntp_string.h@1.4 +12 -5 ../../libparse/parse.c:211: warning: implicit declaration of function 'bcopy' ../../libparse/parse.c:211: warning: incompatible implicit declaration of built- in function 'bcopy' libntp/ntp_lineedit.c@1.3 +1 -0 implicit free decl warning ChangeSet@1.1833.1.1, 2009-05-03 01:47:51+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1171] line editing in ntpq/ntpdc [Bug 1173] NMEA PPSAPI fails on Solaris ChangeLog@1.302.1.1 +2 -0 [Bug 1171] [Bug 1173] include/ntp_lineedit.h@1.1 +13 -0 centralize ntpq/ntpdc interactive line editing include/ntp_lineedit.h@1.0 +0 -0 libntp/Makefile.am@1.43 +1 -1 add libntp/ntp_lineedit.c libntp/ntp_lineedit.c@1.2 +13 -6 always return a non-empty string or NULL libntp/ntp_lineedit.c@1.1 +227 -0 centralize ntpq/ntpdc interactive line editing libntp/ntp_lineedit.c@1.0 +0 -0 m4/ntp_lineeditlibs.m4@1.6 +53 -53 [Bug 1171] ntpd/refclock_nmea.c@1.35 +1 -0 [Bug 1173] set pps_params.api_version = PPS_API_VERS_1 before calling pps_params ntpdc/ntpdc.c@1.62 +9 -30 [Bug 1171] ntpq/ntpq.c@1.84 +10 -30 [Bug 1171] ports/winnt/libntp/libntp.vcproj@1.5 +8 -0 add ntp_lineedit.c ntp_lineedit.h references ports/winnt/ntpdc/ntpdc.vcproj@1.3 +4 -0 add ntp_lineedit.h reference ports/winnt/ntpq/ntpq.vcproj@1.3 +4 -0 add ntp_lineedit.h reference ChangeSet@1.1833, 2009-05-02 08:06:28-04:00, stenn@whimsy.udel.edu NTP_4_2_5P170 TAG: NTP_4_2_5P170 ChangeLog@1.302 +1 -0 NTP_4_2_5P170 gsoc_sntp/sntp-opts.c@1.31 +2 -2 NTP_4_2_5P170 gsoc_sntp/sntp-opts.h@1.31 +3 -3 NTP_4_2_5P170 gsoc_sntp/sntp-opts.texi@1.31 +1 -1 NTP_4_2_5P170 gsoc_sntp/sntp.1@1.31 +2 -2 NTP_4_2_5P170 ntpd/ntpd-opts.c@1.162 +2 -2 NTP_4_2_5P170 ntpd/ntpd-opts.h@1.162 +3 -3 NTP_4_2_5P170 ntpd/ntpd-opts.texi@1.161 +1 -1 NTP_4_2_5P170 ntpd/ntpd.1@1.161 +2 -2 NTP_4_2_5P170 ntpdc/ntpdc-opts.c@1.158 +2 -2 NTP_4_2_5P170 ntpdc/ntpdc-opts.h@1.158 +3 -3 NTP_4_2_5P170 ntpdc/ntpdc-opts.texi@1.157 +1 -1 NTP_4_2_5P170 ntpdc/ntpdc.1@1.157 +2 -2 NTP_4_2_5P170 ntpq/ntpq-opts.c@1.158 +2 -2 NTP_4_2_5P170 ntpq/ntpq-opts.h@1.158 +3 -3 NTP_4_2_5P170 ntpq/ntpq-opts.texi@1.157 +1 -1 NTP_4_2_5P170 ntpq/ntpq.1@1.157 +2 -2 NTP_4_2_5P170 ntpsnmpd/ntpsnmpd-opts.c@1.39 +2 -2 NTP_4_2_5P170 ntpsnmpd/ntpsnmpd-opts.h@1.39 +3 -3 NTP_4_2_5P170 ntpsnmpd/ntpsnmpd-opts.texi@1.39 +1 -1 NTP_4_2_5P170 ntpsnmpd/ntpsnmpd.1@1.39 +2 -2 NTP_4_2_5P170 packageinfo.sh@1.173 +1 -1 NTP_4_2_5P170 sntp/sntp-opts.c@1.158 +2 -2 NTP_4_2_5P170 sntp/sntp-opts.h@1.158 +3 -3 NTP_4_2_5P170 sntp/sntp-opts.texi@1.157 +1 -1 NTP_4_2_5P170 sntp/sntp.1@1.157 +2 -2 NTP_4_2_5P170 util/ntp-keygen-opts.c@1.161 +2 -2 NTP_4_2_5P170 util/ntp-keygen-opts.h@1.161 +3 -3 NTP_4_2_5P170 util/ntp-keygen-opts.texi@1.160 +1 -1 NTP_4_2_5P170 util/ntp-keygen.1@1.160 +2 -2 NTP_4_2_5P170 ChangeSet@1.1830.4.3, 2009-05-02 10:26:07+00:00, davehart@shiny.ad.hartbrothers.com ntp_cacheversion.m4: remove diagnostic after successful tests m4/ntp_cacheversion.m4@1.3 +0 -1 remove diagnostic after successful tests ChangeSet@1.1830.4.2, 2009-05-02 08:37:14+00:00, davehart@shiny.ad.hartbrothers.com do not clear config.cache immediately after it is created empty ChangeLog@1.299.4.2 +1 -0 do not clear config.cache immediately after it is created empty m4/ntp_cacheversion.m4@1.2 +19 -6 do not clear config.cache immediately after it is created empty ChangeSet@1.1436.15.50, 2009-05-02 02:38:49-04:00, stenn@whimsy.udel.edu NTP_4_2_4P7_RC5 TAG: NTP_4_2_4P7_RC5 ChangeLog@1.1.1.75 +1 -0 NTP_4_2_4P7_RC5 ntpd/ntpd-opts.c@1.50.22.1 +2 -2 NTP_4_2_4P7_RC5 ntpd/ntpd-opts.h@1.50.22.1 +3 -3 NTP_4_2_4P7_RC5 ntpd/ntpd-opts.texi@1.49.22.1 +1 -1 NTP_4_2_4P7_RC5 ntpd/ntpd.1@1.48.22.1 +2 -2 NTP_4_2_4P7_RC5 ntpd/ntpdsim-opts.c@1.50.22.1 +2 -2 NTP_4_2_4P7_RC5 ntpd/ntpdsim-opts.h@1.50.22.1 +3 -3 NTP_4_2_4P7_RC5 ntpd/ntpdsim-opts.texi@1.48.22.1 +1 -1 NTP_4_2_4P7_RC5 ntpd/ntpdsim.1@1.48.22.1 +2 -2 NTP_4_2_4P7_RC5 ntpdc/ntpdc-opts.c@1.50.22.1 +2 -2 NTP_4_2_4P7_RC5 ntpdc/ntpdc-opts.h@1.50.22.1 +3 -3 NTP_4_2_4P7_RC5 ntpdc/ntpdc-opts.texi@1.48.22.1 +1 -1 NTP_4_2_4P7_RC5 ntpdc/ntpdc.1@1.48.22.1 +2 -2 NTP_4_2_4P7_RC5 ntpq/ntpq-opts.c@1.52.22.1 +2 -2 NTP_4_2_4P7_RC5 ntpq/ntpq-opts.h@1.52.22.1 +3 -3 NTP_4_2_4P7_RC5 ntpq/ntpq-opts.texi@1.49.22.1 +1 -1 NTP_4_2_4P7_RC5 ntpq/ntpq.1@1.48.22.1 +2 -2 NTP_4_2_4P7_RC5 packageinfo.sh@1.65.30.1 +1 -1 NTP_4_2_4P7_RC5 sntp/sntp-opts.c@1.49.22.1 +2 -2 NTP_4_2_4P7_RC5 sntp/sntp-opts.h@1.49.22.1 +3 -3 NTP_4_2_4P7_RC5 sntp/sntp-opts.texi@1.46.22.1 +1 -1 NTP_4_2_4P7_RC5 sntp/sntp.1@1.49.22.1 +2 -2 NTP_4_2_4P7_RC5 util/ntp-keygen-opts.c@1.49.22.1 +2 -2 NTP_4_2_4P7_RC5 util/ntp-keygen-opts.h@1.49.22.1 +3 -3 NTP_4_2_4P7_RC5 util/ntp-keygen-opts.texi@1.47.22.1 +1 -1 NTP_4_2_4P7_RC5 util/ntp-keygen.1@1.47.22.1 +2 -2 NTP_4_2_4P7_RC5 ChangeSet@1.1830.3.1, 2009-05-02 00:13:27-04:00, stenn@whimsy.udel.edu Updates from Dave Mills ChangeLog@1.299.3.4 +1 -0 loopfilter FLL/PLL crossover cleanup from Dave Mills ChangeLog@1.299.3.3 +1 -0 Documentation updates from Dave Mills ChangeLog@1.299.3.2 +1 -0 Cleanup from Dave Mills ChangeLog@1.299.3.1 +1 -0 crypto API cleanup from Dave Mills html/authopt.html@1.48 +4 -2 Documentation updates from Dave Mills html/keygen.html@1.15 +20 -63 Documentation updates from Dave Mills include/ntpd.h@1.124 +1 -1 crypto API cleanup from Dave Mills ntpd/ntp_crypto.c@1.133 +38 -55 crypto API cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.149 +12 -19 loopfilter FLL/PLL crossover cleanup from Dave Mills ntpd/ntp_proto.c@1.284 +9 -11 crypto API cleanup from Dave Mills util/ntp-keygen.c@1.57 +2 -6 Cleanup from Dave Mills ChangeSet@1.1830.2.2, 2009-05-02 01:55:12+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: restore -dev version of HAS_ROUTING_SOCKET stuff after merging from -stable un-backporting of same configure.ac@1.437.2.2 +12 -1 restore -dev version of HAS_ROUTING_SOCKET stuff after merging from -stable un-backporting of same ChangeSet@1.1436.15.49, 2009-05-02 01:49:02+00:00, davehart@shiny.ad.hartbrothers.com flock-build: set -m wasn't needed with ssh -tt and caused problems, remove ChangeLog: [Bug 1172] 4.2.4p7-RC{3,4} fail to build on linux. remove unportable 'set -m' from flock-build script configure.ac: reverse accidental backport from -dev of struct rtattr test in configure.ac without corresponding ntp_io.c code for HAVE_RTNETLINK ChangeLog@1.1.1.74 +5 -0 [Bug 1172] 4.2.4p7-RC{3,4} fail to build on linux. remove unportable 'set -m' from flock-build script configure.ac@1.400.1.14 +1 -12 reverse accidental backport from -dev of struct rtattr test in configure.ac without corresponding ntp_io.c code for HAVE_RTNETLINK flock-build@1.39.1.2 +3 -5 set -m wasn't needed with ssh -tt and caused problems, remove ChangeSet@1.1828.1.1, 2009-05-01 20:05:24+00:00, davehart@shiny.ad.hartbrothers.com add NTP_CACHEVERSION to toss config.cache from different version --- enable gcc -Wstrict-overflow for gsoc_sntp ChangeLog@1.297.1.1 +2 -0 Add NTP_CACHEVERSION to configure.ac m4/ntp_cacheversion.m4 configure.ac@1.437.1.1 +21 -5 add NTP_CACHEVERSION() m4 macro to flush incompatible config.cache gsoc_sntp/Makefile.am@1.7 +1 -1 ACLOCAL_AMFLAGS += -I ../m4 gsoc_sntp/configure.ac@1.14 +17 -1 add NTP_CACHEVERSION() m4 macro to flush incompatible config.cache --- enable gcc -Wstrict-overflow include/ntp.h@1.153 +1 -0 references l_fp type, needs #include m4/ntp_cacheversion.m4@1.1 +82 -0 add NTP_CACHEVERSION() m4 macro to flush incompatible config.cache m4/ntp_cacheversion.m4@1.0 +0 -0 ntpd/ntp_refclock.c@1.85 +2 -2 pps_handle_t is properly an opaque scalar, timepps-Solaris.h will be fixed sntp/Makefile.am@1.25 +1 -1 ACLOCAL_AMFLAGS += -I ../m4 sntp/configure.ac@1.20 +17 -1 add NTP_CACHEVERSION() m4 macro to flush incompatible config.cache ChangeSet@1.1831, 2009-05-01 15:05:10+00:00, kardel@pogo.udel.edu configure.ac, refclock_parse.c, ChangeLog: [Bug 1152] adjust PARSE to new refclock_pps logic ChangeLog@1.300 +1 -0 [Bug 1152] adjust PARSE to new refclock_pps logic configure.ac@1.438 +0 -4 [Bug 1152] adjust PARSE to new refclock_pps logic ntpd/refclock_parse.c@1.50 +55 -42 [Bug 1152] adjust PARSE to new refclock_pps logic ChangeSet@1.1830, 2009-04-30 07:58:03-04:00, stenn@whimsy.udel.edu NTP_4_2_5P169 TAG: NTP_4_2_5P169 ChangeLog@1.299 +1 -0 NTP_4_2_5P169 gsoc_sntp/sntp-opts.c@1.30 +2 -2 NTP_4_2_5P169 gsoc_sntp/sntp-opts.h@1.30 +3 -3 NTP_4_2_5P169 gsoc_sntp/sntp-opts.texi@1.30 +1 -1 NTP_4_2_5P169 gsoc_sntp/sntp.1@1.30 +2 -2 NTP_4_2_5P169 ntpd/ntpd-opts.c@1.161 +2 -2 NTP_4_2_5P169 ntpd/ntpd-opts.h@1.161 +3 -3 NTP_4_2_5P169 ntpd/ntpd-opts.texi@1.160 +1 -1 NTP_4_2_5P169 ntpd/ntpd.1@1.160 +2 -2 NTP_4_2_5P169 ntpdc/ntpdc-opts.c@1.157 +2 -2 NTP_4_2_5P169 ntpdc/ntpdc-opts.h@1.157 +3 -3 NTP_4_2_5P169 ntpdc/ntpdc-opts.texi@1.156 +1 -1 NTP_4_2_5P169 ntpdc/ntpdc.1@1.156 +2 -2 NTP_4_2_5P169 ntpq/ntpq-opts.c@1.157 +2 -2 NTP_4_2_5P169 ntpq/ntpq-opts.h@1.157 +3 -3 NTP_4_2_5P169 ntpq/ntpq-opts.texi@1.156 +1 -1 NTP_4_2_5P169 ntpq/ntpq.1@1.156 +2 -2 NTP_4_2_5P169 ntpsnmpd/ntpsnmpd-opts.c@1.38 +2 -2 NTP_4_2_5P169 ntpsnmpd/ntpsnmpd-opts.h@1.38 +3 -3 NTP_4_2_5P169 ntpsnmpd/ntpsnmpd-opts.texi@1.38 +1 -1 NTP_4_2_5P169 ntpsnmpd/ntpsnmpd.1@1.38 +2 -2 NTP_4_2_5P169 packageinfo.sh@1.172 +1 -1 NTP_4_2_5P169 sntp/sntp-opts.c@1.157 +2 -2 NTP_4_2_5P169 sntp/sntp-opts.h@1.157 +3 -3 NTP_4_2_5P169 sntp/sntp-opts.texi@1.156 +1 -1 NTP_4_2_5P169 sntp/sntp.1@1.156 +2 -2 NTP_4_2_5P169 util/ntp-keygen-opts.c@1.160 +2 -2 NTP_4_2_5P169 util/ntp-keygen-opts.h@1.160 +3 -3 NTP_4_2_5P169 util/ntp-keygen-opts.texi@1.159 +1 -1 NTP_4_2_5P169 util/ntp-keygen.1@1.159 +2 -2 NTP_4_2_5P169 ChangeSet@1.1829, 2009-04-30 02:59:43-04:00, stenn@whimsy.udel.edu [Bug 1171] Note that we never look for -lreadline by default ChangeLog@1.298 +1 -0 [Bug 1171] Note that we never look for -lreadline by default m4/ntp_lineeditlibs.m4@1.5 +1 -1 [Bug 1171] Note that we never look for -lreadline by default ChangeSet@1.1826.1.1, 2009-04-29 18:46:50-04:00, stenn@whimsy.udel.edu typo fix on [Bug 1166] entry ChangeLog@1.295.1.1 +1 -1 typo fix on [Bug 1166] entry ChangeSet@1.1826, 2009-04-29 08:04:45-04:00, stenn@whimsy.udel.edu NTP_4_2_5P168 TAG: NTP_4_2_5P168 ChangeLog@1.295 +1 -0 NTP_4_2_5P168 gsoc_sntp/sntp-opts.c@1.29 +2 -2 NTP_4_2_5P168 gsoc_sntp/sntp-opts.h@1.29 +3 -3 NTP_4_2_5P168 gsoc_sntp/sntp-opts.texi@1.29 +1 -1 NTP_4_2_5P168 gsoc_sntp/sntp.1@1.29 +2 -2 NTP_4_2_5P168 ntpd/ntpd-opts.c@1.160 +2 -2 NTP_4_2_5P168 ntpd/ntpd-opts.h@1.160 +3 -3 NTP_4_2_5P168 ntpd/ntpd-opts.texi@1.159 +1 -1 NTP_4_2_5P168 ntpd/ntpd.1@1.159 +2 -2 NTP_4_2_5P168 ntpdc/ntpdc-opts.c@1.156 +2 -2 NTP_4_2_5P168 ntpdc/ntpdc-opts.h@1.156 +3 -3 NTP_4_2_5P168 ntpdc/ntpdc-opts.texi@1.155 +1 -1 NTP_4_2_5P168 ntpdc/ntpdc.1@1.155 +2 -2 NTP_4_2_5P168 ntpq/ntpq-opts.c@1.156 +2 -2 NTP_4_2_5P168 ntpq/ntpq-opts.h@1.156 +3 -3 NTP_4_2_5P168 ntpq/ntpq-opts.texi@1.155 +1 -1 NTP_4_2_5P168 ntpq/ntpq.1@1.155 +2 -2 NTP_4_2_5P168 ntpsnmpd/ntpsnmpd-opts.c@1.37 +2 -2 NTP_4_2_5P168 ntpsnmpd/ntpsnmpd-opts.h@1.37 +3 -3 NTP_4_2_5P168 ntpsnmpd/ntpsnmpd-opts.texi@1.37 +1 -1 NTP_4_2_5P168 ntpsnmpd/ntpsnmpd.1@1.37 +2 -2 NTP_4_2_5P168 packageinfo.sh@1.171 +1 -1 NTP_4_2_5P168 sntp/sntp-opts.c@1.156 +2 -2 NTP_4_2_5P168 sntp/sntp-opts.h@1.156 +3 -3 NTP_4_2_5P168 sntp/sntp-opts.texi@1.155 +1 -1 NTP_4_2_5P168 sntp/sntp.1@1.155 +2 -2 NTP_4_2_5P168 util/ntp-keygen-opts.c@1.159 +2 -2 NTP_4_2_5P168 util/ntp-keygen-opts.h@1.159 +3 -3 NTP_4_2_5P168 util/ntp-keygen-opts.texi@1.158 +1 -1 NTP_4_2_5P168 util/ntp-keygen.1@1.158 +2 -2 NTP_4_2_5P168 ChangeSet@1.1436.15.48, 2009-04-29 04:03:41-04:00, stenn@whimsy.udel.edu NTP_4_2_4P7_RC4 TAG: NTP_4_2_4P7_RC4 ChangeLog@1.1.1.73 +1 -0 NTP_4_2_4P7_RC4 ntpd/ntpd-opts.c@1.50.21.1 +2 -2 NTP_4_2_4P7_RC4 ntpd/ntpd-opts.h@1.50.21.1 +3 -3 NTP_4_2_4P7_RC4 ntpd/ntpd-opts.texi@1.49.21.1 +1 -1 NTP_4_2_4P7_RC4 ntpd/ntpd.1@1.48.21.1 +2 -2 NTP_4_2_4P7_RC4 ntpd/ntpdsim-opts.c@1.50.21.1 +2 -2 NTP_4_2_4P7_RC4 ntpd/ntpdsim-opts.h@1.50.21.1 +3 -3 NTP_4_2_4P7_RC4 ntpd/ntpdsim-opts.texi@1.48.21.1 +1 -1 NTP_4_2_4P7_RC4 ntpd/ntpdsim.1@1.48.21.1 +2 -2 NTP_4_2_4P7_RC4 ntpdc/ntpdc-opts.c@1.50.21.1 +2 -2 NTP_4_2_4P7_RC4 ntpdc/ntpdc-opts.h@1.50.21.1 +3 -3 NTP_4_2_4P7_RC4 ntpdc/ntpdc-opts.texi@1.48.21.1 +1 -1 NTP_4_2_4P7_RC4 ntpdc/ntpdc.1@1.48.21.1 +2 -2 NTP_4_2_4P7_RC4 ntpq/ntpq-opts.c@1.52.21.1 +2 -2 NTP_4_2_4P7_RC4 ntpq/ntpq-opts.h@1.52.21.1 +3 -3 NTP_4_2_4P7_RC4 ntpq/ntpq-opts.texi@1.49.21.1 +1 -1 NTP_4_2_4P7_RC4 ntpq/ntpq.1@1.48.21.1 +2 -2 NTP_4_2_4P7_RC4 packageinfo.sh@1.65.29.1 +1 -1 NTP_4_2_4P7_RC4 sntp/sntp-opts.c@1.49.21.1 +2 -2 NTP_4_2_4P7_RC4 sntp/sntp-opts.h@1.49.21.1 +3 -3 NTP_4_2_4P7_RC4 sntp/sntp-opts.texi@1.46.21.1 +1 -1 NTP_4_2_4P7_RC4 sntp/sntp.1@1.49.21.1 +2 -2 NTP_4_2_4P7_RC4 util/ntp-keygen-opts.c@1.49.21.1 +2 -2 NTP_4_2_4P7_RC4 util/ntp-keygen-opts.h@1.49.21.1 +3 -3 NTP_4_2_4P7_RC4 util/ntp-keygen-opts.texi@1.47.21.1 +1 -1 NTP_4_2_4P7_RC4 util/ntp-keygen.1@1.47.21.1 +2 -2 NTP_4_2_4P7_RC4 ChangeSet@1.1436.15.47, 2009-04-29 01:50:44-04:00, stenn@pogo.udel.edu No need to know the GCC -W items in config.h configure.ac@1.400.1.13 +2 -12 No need to know the GCC -W items in config.h ChangeSet@1.1817.4.1, 2009-04-29 01:40:19-04:00, stenn@whimsy.udel.edu Updates from Dave Mills ChangeLog@1.286.4.6 +1 -0 Updates from Dave Mills ChangeLog@1.286.4.5 +1 -0 updates ChangeLog@1.286.4.4 +1 -0 Fix the error return and syslog function ID in refclock_{param,ppsapi} ChangeLog@1.286.4.3 +1 -0 Make sure syspoll is within the peer's minpoll/maxpoll bounds ChangeLog@1.286.4.2 +1 -0 ntp_crypto.c: Use sign_siglen, not len. sign key filename cleanup. ChangeLog@1.286.4.1 +1 -0 Bump NTP_MAXEXTEN from 1024 to 2048, update values for some field lengths html/keygen.html@1.14 +222 -133 ntp-keygen updates include/ntp.h@1.152 +3 -3 Bump NTP_MAXEXTEN from 1024 to 2048, update values for some field lengths include/ntp_crypto.h@1.45 +1 -1 Bump NTP_MAXEXTEN from 1024 to 2048, update values for some field lengths ntpd/ntp_crypto.c@1.132 +19 -23 ntp_crypto.c: Use sign_siglen, not len. sign key filename cleanup. ntpd/ntp_proto.c@1.283 +18 -2 Make sure syspoll is within the peer's minpoll/maxpoll bounds ntpd/ntp_refclock.c@1.82.1.1 +7 -7 Fix the error return and syslog function ID in refclock_{param,ppsapi} util/ntp-keygen.c@1.54.1.1 +27 -16 updates ChangeSet@1.1817.3.1, 2009-04-28 08:09:13-04:00, murray@pogo.udel.edu refclock_hpgps.c: Fix for bug 1090, bogus leapseconds ChangeLog: Fix for bug 1090, bogus leapseconds in refclock_hpgps ChangeLog@1.286.3.1 +1 -0 Fix for bug 1090, bogus leapseconds in refclock_hpgps ntpd/refclock_hpgps.c@1.9 +12 -5 Fix for bug 1090, bogus leapseconds ChangeSet@1.1817.2.2, 2009-04-28 08:23:30+00:00, davehart@shiny.ad.hartbrothers.com dcfd.c: tvsec -> tv_sec typo parseutil/dcfd.c@1.22 +1 -1 tvsec -> tv_sec typo ChangeSet@1.1816.1.2, 2009-04-28 07:00:17+00:00, davehart@shiny.ad.hartbrothers.com ntp_parser.h, ntp_parser.c: bison 2.4.1 generated files ntpd/ntp_parser.c@1.37 +372 -214 bison 2.4.1 generated files ntpd/ntp_parser.h@1.21 +159 -1 bison 2.4.1 generated files ChangeSet@1.1816.1.1, 2009-04-28 06:59:44+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1169] quiet compiler warnings Re-enable gcc -Wstrict-prototypes when not building with OpenSSL Enable gcc -Wstrict-overflow ntpq/ntpdc emit newline after accepting password on Windows ChangeLog@1.285.1.1 +4 -0 * [Bug 1169] quiet compiler warnings * Re-enable gcc -Wstrict-prototypes when not building with OpenSSL * Enable gcc -Wstrict-overflow * ntpq/ntpdc emit newline after accepting password on Windows configure.ac@1.434.1.1 +40 -26 enable -Wstrict-overflow, use -Wno-strict-prototypes only w/OpenSSL gsoc_sntp/crypto.c@1.5 +3 -3 auth_init() local key_cnt shadowed global of same name --- add const qualifier to auth_init() keyfile argument gsoc_sntp/crypto.h@1.4 +1 -1 add const qualifier to auth_init() keyfile argument gsoc_sntp/kod_management.c@1.8 +2 -2 add const qualifier to kod_db_file, kod_init_kod_db() arg gsoc_sntp/kod_management.h@1.5 +1 -1 add const qualifier to kod_db_file, kod_init_kod_db() arg gsoc_sntp/log.c@1.8 +1 -1 add const qualifier gsoc_sntp/log.h@1.5 +1 -1 add const qualifier gsoc_sntp/main.c@1.12 +4 -3 #include for isc_net_probeipv6 prototype --- remove three casts with const qualifiers fixed gsoc_sntp/networking.c@1.18 +7 -17 remove unused sockaddr_in, sockaddr_in6 --- char *buf shadowed declaration warning, printf %li not %i --- two more char *buf shadowy declarations include/isc/file.h@1.2 +2 -2 change parameter name in prototype from time to mtime to avoid (noisy) warning about shadowing another "time" declaration include/isc/mem.h@1.3 +10 -5 macro away troublesom isc_mem_t incomplete type warnings --- #include (probably redundant with ) include/ntp_config.h@1.51 +1 -0 prototype destroy_address_node() include/ntp_stdlib.h@1.28 +5 -5 indent, whitespace cleanup include/ntpsim.h@1.10 +1 -0 prototype entrypoint ntpsim(argc, argv) libisc/inet_ntop.c@1.5 +6 -0 conditionalize code to match header libisc/inet_pton.c@1.2 +6 -0 conditionalize code to match header libisc/mem.c@1.3 +5 -0 note disuse of mem.c libntp/Makefile.am@1.42 +2 -4 let's see if libisc/log.c is really used --- remove mem.c from build in favor of isc/mem.h macros libntp/machines.c@1.20 +3 -0 emit newline after ntpq/ntpdc passwd prompt on Windows libntp/numtoa.c@1.3 +8 -0 include config.h, netinet/in.h for htonl libntp/numtohost.c@1.4 +8 -0 include config.h, netinet/in.h for htonl libntp/prettydate.c@1.12 +3 -1 prototype common_prettydate() libntp/statestr.c@1.15 +5 -1 flash_codes unused, see ntpq.c tstflagnames libparse/parsesolaris.c@1.8 +12 -12 ctime -> c_time to quiet shadowed declaration warning remove const from pprintf format string to match use ntpd/ntp_config.c@1.191 +6 -0 missed DESTROY_QUEUE(unpeers) in merge into 1165 repo --- quiet compiler warning about unused get_next_address for !SIM ntpd/ntp_intres.c@1.59 +0 -1 ding dong, the bong is dead. (remove unused bong() prototype) ntpd/ntp_parser.y@1.32 +2 -2 missing semicolons on Unpeer, Unconfig trip up original yacc, bison -y ntpd/ntp_refclock.c@1.83 +2 -2 quiet two warnings comparing scalar ap->handle with pointer NULL ntpd/ntp_util.c@1.69 +7 -0 prototype uninit_util() ntpd/ntpsim.c@1.20 +0 -1 prototype entry point ntpsim(argc, argv) moves to ntpdsim.h ntpd/refclock_mx4200.c@1.24 +12 -12 %lu not %ul printf format specifier local leapsec -> leapsec_warn to avoid shadowing global leapsec ntpd/refclock_palisade.c@1.24 +5 -3 wrap dead sendcmd() in #ifdef UNUSED ntpd/refclock_palisade.h@1.11 +2 -0 wrap sendcmd() prototype with #ifdef UNUSED ntpq/ntpq.c@1.83 +181 -162 conditionalize VxWorks-only clear_globals so it doesn't compile others --- quiet warnings building ntpq.c for libntpq, getcmds and abortcmd --- quiet tokenize, getarg defined but not used for libntpq --- quiet xcp possibly uninitialized in help clean up indents, whitespace parseutil/dcfd.c@1.21 +5 -4 use explicit offset test rather than timercmp() to avoid 'simplifying conditional to constant' warning with -Wstrict-overflow from testing if constant 0 max_adj_offset.tv_sec is greater than something else. ports/winnt/libntp/libntp.vcproj@1.4 +0 -22 remove libisc/mem.c from build in favor of isc/mem.h macros ports/winnt/ntpd/ntpd.vcproj@1.2 +4 -0 add reference to ntpsim.h ports/winnt/ntpd/ntservice.c@1.16 +5 -5 correct #ifdefs for leak debugging util/ntp-keygen.c@1.55 +7 -7 use strdup to get non-const copies of string args cast time_t to long/u_long explicitly for 64-bit time_t ChangeSet@1.1436.15.46, 2009-04-27 11:47:49+00:00, davehart@shiny.ad.hartbrothers.com ChangeLog: add [Bug 1167] to ChangeLog entry ChangeLog@1.1.1.72 +1 -1 add [Bug 1167] to ChangeLog entry ChangeSet@1.1817.1.2, 2009-04-26 14:17:47+00:00, davehart@shiny.ad.hartbrothers.com Remove truncation of position (blanking) code in refclock_nmea.c ChangeLog@1.286.1.2 +1 -0 Remove truncation of position (blanking) code in refclock_nmea.c ntpd/refclock_nmea.c@1.34 +1 -71 Remove truncation of position (blanking) code in refclock_nmea.c ChangeSet@1.1817.1.1, 2009-04-26 07:54:41-04:00, stenn@whimsy.udel.edu NTP_4_2_5P167 TAG: NTP_4_2_5P167 ChangeLog@1.286.1.1 +1 -0 NTP_4_2_5P167 gsoc_sntp/sntp-opts.c@1.28 +2 -2 NTP_4_2_5P167 gsoc_sntp/sntp-opts.h@1.28 +3 -3 NTP_4_2_5P167 gsoc_sntp/sntp-opts.texi@1.28 +1 -1 NTP_4_2_5P167 gsoc_sntp/sntp.1@1.28 +2 -2 NTP_4_2_5P167 ntpd/ntpd-opts.c@1.159 +2 -2 NTP_4_2_5P167 ntpd/ntpd-opts.h@1.159 +3 -3 NTP_4_2_5P167 ntpd/ntpd-opts.texi@1.158 +1 -1 NTP_4_2_5P167 ntpd/ntpd.1@1.158 +2 -2 NTP_4_2_5P167 ntpdc/ntpdc-opts.c@1.155 +2 -2 NTP_4_2_5P167 ntpdc/ntpdc-opts.h@1.155 +3 -3 NTP_4_2_5P167 ntpdc/ntpdc-opts.texi@1.154 +1 -1 NTP_4_2_5P167 ntpdc/ntpdc.1@1.154 +2 -2 NTP_4_2_5P167 ntpq/ntpq-opts.c@1.155 +2 -2 NTP_4_2_5P167 ntpq/ntpq-opts.h@1.155 +3 -3 NTP_4_2_5P167 ntpq/ntpq-opts.texi@1.154 +1 -1 NTP_4_2_5P167 ntpq/ntpq.1@1.154 +2 -2 NTP_4_2_5P167 ntpsnmpd/ntpsnmpd-opts.c@1.36 +2 -2 NTP_4_2_5P167 ntpsnmpd/ntpsnmpd-opts.h@1.36 +3 -3 NTP_4_2_5P167 ntpsnmpd/ntpsnmpd-opts.texi@1.36 +1 -1 NTP_4_2_5P167 ntpsnmpd/ntpsnmpd.1@1.36 +2 -2 NTP_4_2_5P167 packageinfo.sh@1.170 +1 -1 NTP_4_2_5P167 sntp/sntp-opts.c@1.155 +2 -2 NTP_4_2_5P167 sntp/sntp-opts.h@1.155 +3 -3 NTP_4_2_5P167 sntp/sntp-opts.texi@1.154 +1 -1 NTP_4_2_5P167 sntp/sntp.1@1.154 +2 -2 NTP_4_2_5P167 util/ntp-keygen-opts.c@1.158 +2 -2 NTP_4_2_5P167 util/ntp-keygen-opts.h@1.158 +3 -3 NTP_4_2_5P167 util/ntp-keygen-opts.texi@1.157 +1 -1 NTP_4_2_5P167 util/ntp-keygen.1@1.157 +2 -2 NTP_4_2_5P167 ChangeSet@1.1819, 2009-04-26 06:18:21+00:00, davehart@shiny.ad.hartbrothers.com NTP_LINEEDITLIBS refinements for Autoconf 2.62 warnings ChangeLog@1.288 +1 -0 NTP_LINEEDITLIBS refinements for Autoconf 2.62 warnings m4/ntp_lineeditlibs.m4@1.4 +46 -40 NTP_LINEEDITLIBS refinements for Autoconf 2.62 warnings ChangeSet@1.1436.15.45, 2009-04-26 06:10:27+00:00, davehart@shiny.ad.hartbrothers.com gcc -Winit-self is used only if it is understood ChangeLog@1.1.1.71 +4 -0 gcc -Winit-self is used only if it is understood configure.ac@1.400.1.12 +34 -2 gcc -Winit-self is used only if it is understood ChangeSet@1.1817, 2009-04-25 20:02:54-04:00, stenn@whimsy.udel.edu Crypto cleanup from Dave Mills ChangeLog@1.286 +1 -0 Crypto cleanup from Dave Mills ntpd/ntp_crypto.c@1.131 +4 -6 Crypto cleanup from Dave Mills ntpd/ntp_proto.c@1.282 +16 -11 Crypto cleanup from Dave Mills ChangeSet@1.1816, 2009-04-25 07:55:55-04:00, stenn@whimsy.udel.edu NTP_4_2_5P166 TAG: NTP_4_2_5P166 ChangeLog@1.285 +1 -0 NTP_4_2_5P166 gsoc_sntp/sntp-opts.c@1.27 +2 -2 NTP_4_2_5P166 gsoc_sntp/sntp-opts.h@1.27 +3 -3 NTP_4_2_5P166 gsoc_sntp/sntp-opts.texi@1.27 +1 -1 NTP_4_2_5P166 gsoc_sntp/sntp.1@1.27 +2 -2 NTP_4_2_5P166 ntpd/ntpd-opts.c@1.158 +2 -2 NTP_4_2_5P166 ntpd/ntpd-opts.h@1.158 +3 -3 NTP_4_2_5P166 ntpd/ntpd-opts.texi@1.157 +1 -1 NTP_4_2_5P166 ntpd/ntpd.1@1.157 +2 -2 NTP_4_2_5P166 ntpdc/ntpdc-opts.c@1.154 +2 -2 NTP_4_2_5P166 ntpdc/ntpdc-opts.h@1.154 +3 -3 NTP_4_2_5P166 ntpdc/ntpdc-opts.texi@1.153 +1 -1 NTP_4_2_5P166 ntpdc/ntpdc.1@1.153 +2 -2 NTP_4_2_5P166 ntpq/ntpq-opts.c@1.154 +2 -2 NTP_4_2_5P166 ntpq/ntpq-opts.h@1.154 +3 -3 NTP_4_2_5P166 ntpq/ntpq-opts.texi@1.153 +1 -1 NTP_4_2_5P166 ntpq/ntpq.1@1.153 +2 -2 NTP_4_2_5P166 ntpsnmpd/ntpsnmpd-opts.c@1.35 +2 -2 NTP_4_2_5P166 ntpsnmpd/ntpsnmpd-opts.h@1.35 +3 -3 NTP_4_2_5P166 ntpsnmpd/ntpsnmpd-opts.texi@1.35 +1 -1 NTP_4_2_5P166 ntpsnmpd/ntpsnmpd.1@1.35 +2 -2 NTP_4_2_5P166 packageinfo.sh@1.169 +1 -1 NTP_4_2_5P166 sntp/sntp-opts.c@1.154 +2 -2 NTP_4_2_5P166 sntp/sntp-opts.h@1.154 +3 -3 NTP_4_2_5P166 sntp/sntp-opts.texi@1.153 +1 -1 NTP_4_2_5P166 sntp/sntp.1@1.153 +2 -2 NTP_4_2_5P166 util/ntp-keygen-opts.c@1.157 +2 -2 NTP_4_2_5P166 util/ntp-keygen-opts.h@1.157 +3 -3 NTP_4_2_5P166 util/ntp-keygen-opts.texi@1.156 +1 -1 NTP_4_2_5P166 util/ntp-keygen.1@1.156 +2 -2 NTP_4_2_5P166 ChangeSet@1.1815, 2009-04-25 08:22:13+00:00, davehart@shiny.ad.hartbrothers.com bison products ntpd/ntp_parser.c@1.36 +649 -373 generated from [Bug 1165] ChangeSet's ntp_parser.y ntpd/ntp_parser.h@1.20 +25 -177 generated from [Bug 1165] ChangeSet's ntp_parser.y ChangeSet@1.1807.2.1, 2009-04-25 08:08:01+00:00, davehart@shiny.ad.hartbrothers.com * [Bug 1165] Clean up small memory leaks in the config file parser * Correct logconfig keyword declaration to MULTIPLE_ARG * Enable filename and line number leak reporting on Windows when built DEBUG for all the typical C runtime allocators such as calloc, malloc, and strdup. Previously only emalloc calls were covered. * Add DEBUG-only code to free dynamically allocated memory that would otherwise remain allocated at ntpd exit, to allow less forgivable leaks to stand out in leaks reported after exit. * Ensure termination of strings in ports/winnt/libisc/isc_strerror.c and quiet compiler warnings. ChangeLog@1.280.2.1 +10 -0 [Bug 1165] config parser leak logconfig keyword correction DEBUG-only freeing of allocated memory at exit Windows CRT leak debugging enhanced isc_strerror compile warnings quieted include/ntp_filegen.h@1.5 +3 -0 DEBUG-only freeing of allocated memory at exit include/ntp_stdlib.h@1.27 +4 -4 Windows CRT leak debugging enhanced include/ntpd.h@1.121.1.1 +1 -1 no const qualifier for ntp_signd_socket matches parser return types libntp/emalloc.c@1.6 +17 -18 Windows CRT leak debugging enhanced libntp/msyslog.c@1.21 +7 -4 use errno for msyslog on Windows if (NO_ERROR == GetLastError()) ntpd/ntp_config.c@1.188.1.1 +152 -60 [Bug 1165] config parser leak logconfig keyword correction DEBUG-only freeing of allocated memory at exit ntpd/ntp_data_structures.c@1.7 +5 -10 C doesn't require casts from void *, emalloc doesn't return NULL ntpd/ntp_filegen.c@1.14 +8 -6 DEBUG-only freeing of allocated memory at exit ntpd/ntp_parser.y@1.29.1.1 +10 -8 [Bug 1165] config parser leak ntpd/ntp_scanner.c@1.19 +1 -1 DEBUG-only freeing of allocated memory at exit ntpd/ntp_scanner.h@1.5 +1 -0 DEBUG-only freeing of allocated memory at exit ntpd/ntp_util.c@1.68 +49 -12 DEBUG-only freeing of allocated memory at exit ports/winnt/include/config.h@1.62 +10 -1 Windows CRT leak debugging enhanced ports/winnt/libisc/isc_strerror.c@1.7 +137 -31 ensure NULL termination of error messages quiet compiler warnings ports/winnt/libntp/randfile.c@1.4 +1 -6 quiet compiler warnings by including config.h ports/winnt/ntpd/ntservice.c@1.15 +22 -7 DEBUG-only freeing of allocated memory at exit ChangeSet@1.1807.1.2, 2009-04-25 00:34:16-04:00, stenn@whimsy.udel.edu PPS and crypto cleanup in ntp_proto.c from Dave Mills ChangeLog@1.280.1.1 +1 -0 PPS and crypto cleanup in ntp_proto.c from Dave Mills ntpd/ntp_proto.c@1.281 +3 -3 PPS and crypto cleanup in ntp_proto.c from Dave Mills ChangeSet@1.1812, 2009-04-24 00:01:08+00:00, davehart@shiny.ad.hartbrothers.com bison-generated files from ntp_parser.y for [Bug 1161] ntpd/ntp_parser.c@1.35 +949 -914 bison-generated files from ntp_parser.y ntpd/ntp_parser.h@1.19 +39 -35 bison-generated files from ntp_parser.y ChangeSet@1.1811, 2009-04-23 23:58:33+00:00, davehart@shiny.ad.hartbrothers.com Many files: [Bug 1161] unpeer AKA unconfig command for ntpq :config ChangeLog@1.282 +1 -0 [Bug 1161] unpeer AKA unconfig command for ntpq :config include/ntp_config.h@1.50 +6 -0 [Bug 1161] unpeer AKA unconfig command for ntpq :config ntpd/ntp_config.c@1.189 +104 -8 [Bug 1161] unpeer AKA unconfig command for ntpq :config ntpd/ntp_parser.y@1.30 +23 -1 [Bug 1161] unpeer AKA unconfig command for ntpq :config ChangeSet@1.1809, 2009-04-23 19:45:43+00:00, davehart@shiny.ad.hartbrothers.com ChangeLog: [Bug 1057] ntpdc unconfig failure ChangeLog@1.279.1.1 +1 -0 [Bug 1057] ntpdc unconfig failure ChangeSet@1.1807.1.1, 2009-04-23 08:03:28-04:00, stenn@whimsy.udel.edu NTP_4_2_5P165 TAG: NTP_4_2_5P165 ChangeLog@1.280 +1 -0 NTP_4_2_5P165 gsoc_sntp/sntp-opts.c@1.26 +2 -2 NTP_4_2_5P165 gsoc_sntp/sntp-opts.h@1.26 +3 -3 NTP_4_2_5P165 gsoc_sntp/sntp-opts.texi@1.26 +1 -1 NTP_4_2_5P165 gsoc_sntp/sntp.1@1.26 +2 -2 NTP_4_2_5P165 ntpd/ntpd-opts.c@1.157 +2 -2 NTP_4_2_5P165 ntpd/ntpd-opts.h@1.157 +3 -3 NTP_4_2_5P165 ntpd/ntpd-opts.texi@1.156 +1 -1 NTP_4_2_5P165 ntpd/ntpd.1@1.156 +2 -2 NTP_4_2_5P165 ntpdc/ntpdc-opts.c@1.153 +2 -2 NTP_4_2_5P165 ntpdc/ntpdc-opts.h@1.153 +3 -3 NTP_4_2_5P165 ntpdc/ntpdc-opts.texi@1.152 +1 -1 NTP_4_2_5P165 ntpdc/ntpdc.1@1.152 +2 -2 NTP_4_2_5P165 ntpq/ntpq-opts.c@1.153 +2 -2 NTP_4_2_5P165 ntpq/ntpq-opts.h@1.153 +3 -3 NTP_4_2_5P165 ntpq/ntpq-opts.texi@1.152 +1 -1 NTP_4_2_5P165 ntpq/ntpq.1@1.152 +2 -2 NTP_4_2_5P165 ntpsnmpd/ntpsnmpd-opts.c@1.34 +2 -2 NTP_4_2_5P165 ntpsnmpd/ntpsnmpd-opts.h@1.34 +3 -3 NTP_4_2_5P165 ntpsnmpd/ntpsnmpd-opts.texi@1.34 +1 -1 NTP_4_2_5P165 ntpsnmpd/ntpsnmpd.1@1.34 +2 -2 NTP_4_2_5P165 packageinfo.sh@1.168 +1 -1 NTP_4_2_5P165 sntp/sntp-opts.c@1.153 +2 -2 NTP_4_2_5P165 sntp/sntp-opts.h@1.153 +3 -3 NTP_4_2_5P165 sntp/sntp-opts.texi@1.152 +1 -1 NTP_4_2_5P165 sntp/sntp.1@1.152 +2 -2 NTP_4_2_5P165 util/ntp-keygen-opts.c@1.156 +2 -2 NTP_4_2_5P165 util/ntp-keygen-opts.h@1.156 +3 -3 NTP_4_2_5P165 util/ntp-keygen-opts.texi@1.155 +1 -1 NTP_4_2_5P165 util/ntp-keygen.1@1.155 +2 -2 NTP_4_2_5P165 ChangeSet@1.1808, 2009-04-23 11:51:56+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1057] partial fix, re-enable ntpdc unconfig include/ntpd.h@1.122 +2 -3 [Bug 1057] partial fix, re-enable ntpdc unconfig ntpd/ntp_peer.c@1.116 +0 -15 [Bug 1057] partial fix, re-enable ntpdc unconfig ntpd/ntp_request.c@1.77 +26 -16 [Bug 1057] partial fix, re-enable ntpdc unconfig ChangeSet@1.1807, 2009-04-23 06:42:56-04:00, stenn@whimsy.udel.edu WWVB refclock cleanup from Dave Mills ChangeLog@1.279 +1 -0 WWVB refclock cleanup from Dave Mills ntpd/refclock_wwvb.c@1.21 +3 -3 WWVB refclock cleanup from Dave Mills ChangeSet@1.1806, 2009-04-23 06:35:25-04:00, stenn@whimsy.udel.edu Code cleanup: requested_key -> request_key ChangeLog@1.278 +1 -0 Code cleanup: requested_key -> request_key include/ntp_config.h@1.49 +1 -1 Code cleanup: requested_key -> request_key ntpd/ntp_config.c@1.188 +4 -4 Code cleanup: requested_key -> request_key ntpd/ntp_parser.c@1.34 +5 -5 Code cleanup: requested_key -> request_key ntpd/ntp_parser.h@1.18 +2 -2 Code cleanup: requested_key -> request_key ntpd/ntp_parser.y@1.29 +1 -1 Code cleanup: requested_key -> request_key ChangeSet@1.1801.1.6, 2009-04-23 08:23:49+00:00, davehart@shiny.ad.hartbrothers.com ChangeLog: belated ntp_parser.y malloc redeclaration entry ChangeLog@1.273.1.2 +1 -0 belated ntp_parser.y malloc redeclaration entry ChangeSet@1.1801.1.5, 2009-04-23 08:18:08+00:00, hart@pogo.udel.edu ntp_parser.c: generated from updated ntp_parser.y by bison 2.3 ntp_parser.h: force a null delta to keep this file newer than ntp_parser.y ntpd/ntp_parser.c@1.33 +365 -355 generated from updated ntp_parser.y by bison 2.3 ntpd/ntp_parser.h@1.17 +0 -0 force a null delta to keep this file newer than ntp_parser.y ChangeSet@1.1801.1.4, 2009-04-23 08:08:30+00:00, davehart@shiny.ad.hartbrothers.com ntp_parser.y: quiet malloc redeclaration warning compiling ntp_parser.c ntpd/ntp_parser.y@1.28 +2 -0 quiet malloc redeclaration warning compiling ntp_parser.c ChangeSet@1.1804, 2009-04-23 03:43:50-04:00, stenn@whimsy.udel.edu cleanup ChangeLog@1.276 +2 -1 cleanup ChangeSet@1.1801.1.3, 2009-04-23 07:31:41+00:00, davehart@shiny.ad.hartbrothers.com allow OpenSSL DLLs' C runtime version to differ from ntpq's and ntpdc's [Bug 833] ignore whitespace at end of remote configuration lines [Bug 1033] ntpdc/ntpq crash prompting for keyid on Windows ChangeLog@1.273.1.1 +2 -0 [Bug 833] ignore whitespace at end of remote configuration lines [Bug 1033] ntpdc/ntpq crash prompting for keyid on Windows ntpd/ntp_scanner.c@1.18 +14 -3 [Bug 833] ignore whitespace at end of remote configuration lines ntpdc/ntpdc.c@1.61 +7 -1 allow OpenSSL DLLs' C runtime version to differ from ntpdc's [Bug 1033] ntpdc/ntpq crash prompting for keyid on Windows ntpq/ntpq.c@1.82 +7 -1 allow OpenSSL DLLs' C runtime version to differ from ntpq's [Bug 1033] ntpdc/ntpq crash prompting for keyid on Windows ChangeSet@1.1801.1.2, 2009-04-23 07:04:18+00:00, davehart@shiny.ad.hartbrothers.com ntp_scanner.c: quiet type conversion warnings, do not push back EOF ntpd/ntp_scanner.c@1.17 +10 -11 quiet type conversion warnings, do not push back EOF ChangeSet@1.1801.1.1, 2009-04-23 06:59:15+00:00, davehart@shiny.ad.hartbrothers.com ntp_parser.y, ntp_scanner.c: whitespace and indent cleanup only ntpd/ntp_parser.y@1.27 +516 -510 whitespace and indent cleanup only ntpd/ntp_scanner.c@1.16 +47 -50 whitespace and indent cleanup only ChangeSet@1.1796.12.31, 2009-04-22 18:33:43-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills html/drivers/driver22.html@1.18 +76 -27 Documentation updates from Dave Mills html/drivers/driver4.html@1.14 +103 -60 Documentation updates from Dave Mills ChangeSet@1.1796.12.30, 2009-04-22 18:26:09-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.268.11.16 +1 -0 Mitigation and PPS/PPSAPI cleanup from Dave Mills ntpd/ntp_proto.c@1.276.1.5 +2 -1 Mitigation and PPS/PPSAPI cleanup from Dave Mills ntpd/refclock_atom.c@1.59 +21 -11 Mitigation and PPS/PPSAPI cleanup from Dave Mills ntpd/refclock_wwvb.c@1.20 +30 -6 Mitigation and PPS/PPSAPI cleanup from Dave Mills ChangeSet@1.1796.12.29, 2009-04-22 18:20:19-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.268.11.15 +1 -0 Documentation updates from Dave Mills html/miscopt.html@1.42 +2 -2 Documentation updates from Dave Mills html/prefer.html@1.20 +36 -11 Documentation updates from Dave Mills ChangeSet@1.1796.12.28, 2009-04-22 18:14:48-04:00, stenn@whimsy.udel.edu timepps-Solaris.h patches from Dave Hart ChangeLog@1.268.11.14 +1 -0 timepps-Solaris.h patches from Dave Hart include/timepps-Solaris.h@1.5 +68 -19 timepps-Solaris.h patches from Dave Hart ChangeSet@1.1796.12.27, 2009-04-22 10:38:59-04:00, stenn@whimsy.udel.edu NTP_4_2_5P164 TAG: NTP_4_2_5P164 ChangeLog@1.268.11.13 +1 -0 NTP_4_2_5P164 gsoc_sntp/sntp-opts.c@1.25 +2 -2 NTP_4_2_5P164 gsoc_sntp/sntp-opts.h@1.25 +3 -3 NTP_4_2_5P164 gsoc_sntp/sntp-opts.texi@1.25 +1 -1 NTP_4_2_5P164 gsoc_sntp/sntp.1@1.25 +2 -2 NTP_4_2_5P164 ntpd/ntpd-opts.c@1.156 +2 -2 NTP_4_2_5P164 ntpd/ntpd-opts.h@1.156 +3 -3 NTP_4_2_5P164 ntpd/ntpd-opts.texi@1.155 +2 -2 NTP_4_2_5P164 ntpd/ntpd.1@1.155 +2 -2 NTP_4_2_5P164 ntpdc/ntpdc-opts.c@1.152 +2 -2 NTP_4_2_5P164 ntpdc/ntpdc-opts.h@1.152 +3 -3 NTP_4_2_5P164 ntpdc/ntpdc-opts.texi@1.151 +2 -2 NTP_4_2_5P164 ntpdc/ntpdc.1@1.151 +2 -2 NTP_4_2_5P164 ntpq/ntpq-opts.c@1.152 +2 -2 NTP_4_2_5P164 ntpq/ntpq-opts.h@1.152 +3 -3 NTP_4_2_5P164 ntpq/ntpq-opts.texi@1.151 +2 -2 NTP_4_2_5P164 ntpq/ntpq.1@1.151 +2 -2 NTP_4_2_5P164 ntpsnmpd/ntpsnmpd-opts.c@1.33 +2 -2 NTP_4_2_5P164 ntpsnmpd/ntpsnmpd-opts.h@1.33 +3 -3 NTP_4_2_5P164 ntpsnmpd/ntpsnmpd-opts.texi@1.33 +1 -1 NTP_4_2_5P164 ntpsnmpd/ntpsnmpd.1@1.33 +2 -2 NTP_4_2_5P164 packageinfo.sh@1.167 +1 -1 NTP_4_2_5P164 sntp/sntp-opts.c@1.152 +2 -2 NTP_4_2_5P164 sntp/sntp-opts.h@1.152 +3 -3 NTP_4_2_5P164 sntp/sntp-opts.texi@1.151 +1 -1 NTP_4_2_5P164 sntp/sntp.1@1.151 +2 -2 NTP_4_2_5P164 util/ntp-keygen-opts.c@1.155 +2 -2 NTP_4_2_5P164 util/ntp-keygen-opts.h@1.155 +3 -3 NTP_4_2_5P164 util/ntp-keygen-opts.texi@1.154 +2 -2 NTP_4_2_5P164 util/ntp-keygen.1@1.154 +2 -2 NTP_4_2_5P164 ChangeSet@1.1436.15.44, 2009-04-22 08:18:29-04:00, stenn@whimsy.udel.edu NTP_4_2_4P7_RC3 TAG: NTP_4_2_4P7_RC3 ChangeLog@1.1.1.70 +1 -0 NTP_4_2_4P7_RC3 ntpd/ntpd-opts.c@1.50.20.1 +2 -2 NTP_4_2_4P7_RC3 ntpd/ntpd-opts.h@1.50.20.1 +3 -3 NTP_4_2_4P7_RC3 ntpd/ntpd-opts.texi@1.49.20.1 +2 -2 NTP_4_2_4P7_RC3 ntpd/ntpd.1@1.48.20.1 +2 -2 NTP_4_2_4P7_RC3 ntpd/ntpdsim-opts.c@1.50.20.1 +2 -2 NTP_4_2_4P7_RC3 ntpd/ntpdsim-opts.h@1.50.20.1 +3 -3 NTP_4_2_4P7_RC3 ntpd/ntpdsim-opts.texi@1.48.20.1 +1 -1 NTP_4_2_4P7_RC3 ntpd/ntpdsim.1@1.48.20.1 +2 -2 NTP_4_2_4P7_RC3 ntpdc/ntpdc-opts.c@1.50.20.1 +2 -2 NTP_4_2_4P7_RC3 ntpdc/ntpdc-opts.h@1.50.20.1 +3 -3 NTP_4_2_4P7_RC3 ntpdc/ntpdc-opts.texi@1.48.20.1 +2 -2 NTP_4_2_4P7_RC3 ntpdc/ntpdc.1@1.48.20.1 +2 -2 NTP_4_2_4P7_RC3 ntpq/ntpq-opts.c@1.52.20.1 +2 -2 NTP_4_2_4P7_RC3 ntpq/ntpq-opts.h@1.52.20.1 +3 -3 NTP_4_2_4P7_RC3 ntpq/ntpq-opts.texi@1.49.20.1 +2 -2 NTP_4_2_4P7_RC3 ntpq/ntpq.1@1.48.20.1 +2 -2 NTP_4_2_4P7_RC3 packageinfo.sh@1.65.28.1 +1 -1 NTP_4_2_4P7_RC3 sntp/sntp-opts.c@1.49.20.1 +2 -2 NTP_4_2_4P7_RC3 sntp/sntp-opts.h@1.49.20.1 +3 -3 NTP_4_2_4P7_RC3 sntp/sntp-opts.texi@1.46.20.1 +1 -1 NTP_4_2_4P7_RC3 sntp/sntp.1@1.49.20.1 +2 -2 NTP_4_2_4P7_RC3 util/ntp-keygen-opts.c@1.49.20.1 +2 -2 NTP_4_2_4P7_RC3 util/ntp-keygen-opts.h@1.49.20.1 +3 -3 NTP_4_2_4P7_RC3 util/ntp-keygen-opts.texi@1.47.20.1 +2 -2 NTP_4_2_4P7_RC3 util/ntp-keygen.1@1.47.20.1 +2 -2 NTP_4_2_4P7_RC3 ChangeSet@1.1436.15.43, 2009-04-22 07:00:20-04:00, stenn@whimsy.udel.edu [Bug 1155] Fix compile problem on Windows with VS2005 ChangeLog@1.1.1.69 +1 -0 [Bug 1155] Fix compile problem on Windows with VS2005 ChangeSet@1.1436.15.42, 2009-04-22 06:06:53-04:00, stenn@whimsy.udel.edu Cleanup ChangeLog@1.1.1.68 +4 -2 Cleanup ChangeSet@1.1796.18.1, 2009-04-22 02:35:47-04:00, stenn@whimsy.udel.edu PPS/PPSAPI cleanup from Dave Mills ChangeLog@1.268.16.2 +1 -0 PPS/PPSAPI cleanup from Dave Mills ChangeLog@1.268.16.1 +1 -0 Documentation updates from Dave Mills html/howto.html@1.21 +54 -41 Documentation updates from Dave Mills html/prefer.html@1.19 +38 -31 Documentation updates from Dave Mills include/Makefile.am@1.31 +1 -0 PPS/PPSAPI cleanup from Dave Mills include/ntp.h@1.148.1.2 +2 -1 PPS/PPSAPI cleanup from Dave Mills include/ntpd.h@1.118.2.1 +0 -1 PPS/PPSAPI cleanup from Dave Mills include/refclock_atom.h@1.2 +1 -1 PPS/PPSAPI cleanup from Dave Mills include/refclock_atom.h@1.1 +15 -0 BitKeeper file /deacon/backroom/ntp-dev/include/refclock_atom.h include/refclock_atom.h@1.0 +0 -0 ntpd/ntp_proto.c@1.276.1.4 +30 -31 PPS/PPSAPI cleanup from Dave Mills ntpd/ntp_refclock.c@1.82 +156 -0 PPS/PPSAPI cleanup from Dave Mills ntpd/ntp_request.c@1.76 +6 -0 PPS/PPSAPI cleanup from Dave Mills ntpd/refclock_atom.c@1.58 +38 -182 PPS/PPSAPI cleanup from Dave Mills ntpd/refclock_wwvb.c@1.19 +30 -1 PPS/PPSAPI cleanup from Dave Mills ChangeSet@1.1436.15.41, 2009-04-20 22:55:13+00:00, davehart@shiny.ad.hartbrothers.com ChangeLog: auto merge not quite right ChangeLog@1.1.1.67 +3 -7 auto merge not quite right ChangeSet@1.1436.15.40, 2009-04-20 22:42:59+00:00, davehart@shiny.ad.hartbrothers.com ntp_iocompletionport.c: revert overlooked CreateEvent naming/sharing change not conditionalized away already ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.11 +2 -2 revert overlooked CreateEvent naming/sharing change not conditionalized away already ChangeSet@1.1796.12.21, 2009-04-20 06:26:09+00:00, davehart@shiny.ad.hartbrothers.com ChangeLog: merge cleanup ChangeLog@1.268.11.7 +1 -3 merge cleanup ChangeSet@1.1436.21.11, 2009-04-20 06:17:21+00:00, davehart@shiny.ad.hartbrothers.com ChangeLog: [Bug 1160] Mac OS X is like BSD regarding F_SETOWN ChangeLog@1.1.16.3 +1 -0 [Bug 1160] Mac OS X is like BSD regarding F_SETOWN ChangeSet@1.1796.12.19, 2009-04-20 06:13:35+00:00, davehart@shiny.ad.hartbrothers.com recvbuff.c: ENSURE that get_free_recv_buffer_alloc does not return NULL libntp/recvbuff.c@1.29 +2 -0 ENSURE that get_free_recv_buffer_alloc does not return NULL ChangeSet@1.1436.21.10, 2009-04-20 06:02:20+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: [Bug 1160] MacOS X is like BSD regarding F_SETOWN configure.ac@1.400.1.11 +3 -0 [Bug 1160] MacOS X is like BSD regarding F_SETOWN ChangeSet@1.1796.17.1, 2009-04-19 17:50:29+00:00, davehart@shiny.ad.hartbrothers.com ntp_intres.c, ntpd.h, ChangeLog, ntp_config.c: [Bug 1125] C runtime per-thread initialization on Windows ChangeLog@1.268.15.1 +1 -0 [Bug 1125] C runtime per-thread initialization on Windows include/ntpd.h@1.118.1.2 +3 -0 [Bug 1125] C runtime per-thread initialization on Windows ntpd/ntp_config.c@1.184.1.2 +12 -11 [Bug 1125] C runtime per-thread initialization on Windows ntpd/ntp_intres.c@1.58 +16 -1 [Bug 1125] C runtime per-thread initialization on Windows ChangeSet@1.1796.16.3, 2009-04-18 14:23:56+00:00, davehart@shiny.ad.hartbrothers.com ntpq.c: fix false positive duplicate detection ntpq/ntpq.c@1.77.1.3 +9 -3 fix false positive duplicate detection ChangeSet@1.1796.16.2, 2009-04-18 13:51:18+00:00, davehart@shiny.ad.hartbrothers.com ntpq.c: quiet gcc, msc type warnings from decodeint calls to [hex|oct]toint ntpq/ntpq.c@1.77.1.2 +2 -2 quiet gcc, msc type warnings from decodeint calls to [hex|oct]toint ChangeSet@1.1796.16.1, 2009-04-18 04:46:01+00:00, davehart@shiny.ad.hartbrothers.com ntpq.c, ChangeLog: [Bug 1159] ntpq overlap diagnostic message test buggy ChangeLog@1.268.14.1 +1 -0 [Bug 1159] ntpq overlap diagnostic message test buggy ntpq/ntpq.c@1.77.1.1 +303 -266 [Bug 1159] ntpq overlap diagnostic message test buggy ChangeSet@1.1796.15.1, 2009-04-16 19:09:05+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: do not disable refclock_true (CLOCK_TRUETIME) due to pps_sample disappearance, relevant code is under CLOCK_PPS720 ifdef which only affects rare systems with pcl720.h present configure.ac@1.424.1.1 +0 -1 do not disable refclock_true (CLOCK_TRUETIME) due to pps_sample disappearance, relevant code is under CLOCK_PPS720 ifdef which only affects rare systems with pcl720.h present ChangeSet@1.1796.12.12, 2009-04-16 09:00:55+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: revert too-long, incorrect option text change configure.ac@1.432 +1 -1 revert too-long, incorrect option text change ChangeSet@1.1436.21.9, 2009-04-16 02:39:01+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: fix for --enable-ntp-signd=/my/path configure.ac@1.400.1.10 +1 -1 fix for --enable-ntp-signd=/my/path ChangeSet@1.1436.21.8, 2009-04-15 12:36:24+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: do not cache options fix configure.ac@1.400.1.9 +1 -1 do not cache options fix ChangeSet@1.1796.12.9, 2009-04-15 11:21:07+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: choosing compilers: use C99 if available, warn if C89 is not configure.ac@1.429 +19 -9 choosing compilers: use C99 if available, warn if C89 is not gsoc_sntp/configure.ac@1.13 +15 -4 choosing compilers: use C99 if available, warn if C89 is not ChangeSet@1.1436.21.7, 2009-04-15 10:43:51+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: Do not cache configure --options, only current values matter Default --enable-wintime when --enable-ntp-signd configure.ac@1.400.1.8 +575 -403 Do not cache configure --options, only current values matter Default --enable-wintime when --enable-ntp-signd ChangeSet@1.1796.12.7, 2009-04-15 01:47:06+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: switch AC_CHECK_LIB to AC_SEARCH_LIBS for sockets to avoid occasional failure to use -lsocket gsoc_sntp/configure.ac@1.12 +4 -5 switch AC_CHECK_LIB to AC_SEARCH_LIBS for sockets to avoid occasional failure to use -lsocket ChangeSet@1.1436.21.6, 2009-04-15 01:32:33+00:00, davehart@shiny.ad.hartbrothers.com use AC_SEARCH_LIBS to avoid problems with sntp configure.ac@1.400.1.7 +12 -20 use AC_SEARCH_LIBS in preference to AC_CHECK_LIB particulary for sockets, use AM_PROG_CC_C_O which supersets prior AC_PROG_CC_C_O sntp/configure.ac@1.15.1.2 +4 -4 use AC_SEARCH_LIBS which is recommended particularly for sockets over the older AC_CHECK_LIB ChangeSet@1.1796.12.5, 2009-04-14 13:56:37+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: merge improvments from configure.ac into gsoc_sntp/configure.ac gsoc_sntp/configure.ac@1.11 +210 -108 merge improvments from configure.ac into gsoc_sntp/configure.ac ChangeSet@1.1436.21.5, 2009-04-14 13:47:29+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: tear off sntp/configure.ac from configure.ac configure.ac@1.400.1.6 +6 -1 tear off sntp/configure.ac from configure.ac ChangeSet@1.1436.15.38, 2009-04-14 07:55:41-04:00, mayer@pogo.udel.edu Added fix for Bug 813 ChangeLog@1.1.1.65 +1 -0 Added fix for Bug 813 ChangeSet@1.1436.15.37, 2009-04-14 07:51:41-04:00, mayer@pogo.udel.edu [Bug 813] Conditional naming of Event ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.10 +7 -1 [Bug 813] Conditional naming of Event ChangeSet@1.1796.14.1, 2009-04-14 09:31:17+00:00, davehart@shiny.ad.hartbrothers.com ntpdc.c, ntpq.c: remove duplicate #define closesocket, in .h now ChangeLog, refclock_nmea.c: [Bug 1153] refclock_nmea should not mix UTC with GPS time ChangeLog@1.268.13.1 +1 -0 [Bug 1153] refclock_nmea should not mix UTC with GPS time ntpd/refclock_nmea.c@1.33 +41 -31 [Bug 1153] refclock_nmea should not mix UTC with GPS time ntpdc/ntpdc.c@1.60 +0 -2 remove duplicate #define closesocket, in .h now ntpq/ntpq.c@1.78 +0 -2 remove duplicate #define closesocket, in .h now ChangeSet@1.1796.13.2, 2009-04-14 08:20:36+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: complete the merge from stable cleanup configure.ac@1.423.1.2 +63 -1 complete the merge from stable cleanup ChangeSet@1.1436.21.4, 2009-04-14 05:21:17+00:00, davehart@shiny.ad.hartbrothers.com configure.ac: use unset for tickadj utility test fix configure.ac@1.400.1.5 +1 -1 use unset for tickadj utility test fix ChangeSet@1.1436.21.3, 2009-04-14 02:59:39+00:00, hart@pogo.udel.edu build: do not require nice build@1.26 +21 -4 do not require nice ChangeSet@1.1436.21.2, 2009-04-14 01:33:01+00:00, davehart@shiny.ad.hartbrothers.com configure.ac, ChangeLog: [Bug 1158] support for aix6.1 ChangeLog@1.1.16.2 +1 -0 [Bug 1158] support for aix6.1 configure.ac@1.400.1.4 +8 -8 [Bug 1158] support for aix6.1 ChangeSet@1.1436.21.1, 2009-04-14 01:28:08+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1157] quiet OpenSSL warnings, clean up configure.ac make flock-build quit before causing harm if another has not completed ChangeLog@1.1.16.1 +4 -0 [Bug 1157] quiet OpenSSL warnings, clean up configure.ac build@1.25 +6 -7 prevent multiple flock-builds from stepping on each others work configure.ac@1.400.1.3 +613 -361 [Bug 1157] quiet OpenSSL warnings, configure.ac cleanup flock-build@1.39.1.1 +76 -20 prevent multiple flock-builds from stepping on each others work sntp/configure.ac@1.15.1.1 +14 -0 bring in line with -dev to ease merges, no functional change ChangeSet@1.1796.12.1, 2009-04-13 20:20:58+00:00, davehart@shiny.ad.hartbrothers.com configure.ac, ChangeLog: [Bug 1152] temporarily disable refclock_parse and refclock_true until maintainers repair pps_sample() build break ChangeLog@1.268.11.1 +2 -0 [Bug 1152] temporarily disable refclock_parse and refclock_true until maintainers repair pps_sample() build break configure.ac@1.424 +5 -2 [Bug 1152] temporarily disable refclock_parse and refclock_true until maintainers repair pps_sample() build break ChangeSet@1.1796.1.36, 2009-04-13 11:10:38-04:00, utterback@pogo.udel.edu ChangeLog: [Bug 1154] mDNS registration should be done later, repeatedly and only if asked for. ChangeLog@1.268.1.36 +1 -0 [Bug 1154] mDNS registration should be done later, repeatedly and only if asked for. ChangeSet@1.1436.15.36, 2009-04-13 00:00:55-04:00, mayer@pogo.udel.edu Forgot the _WIN32_WINNT update ports/winnt/include/config.h@1.46.1.5 +10 -23 Forgot the _WIN32_WINNT update ChangeSet@1.1436.15.35, 2009-04-12 00:55:24-04:00, mayer@pogo.udel.edu Windows bug fixes ChangeLog@1.1.1.64 +7 -2 Windows bug fixes ChangeSet@1.1436.15.34, 2009-04-12 00:45:48-04:00, mayer@pogo.udel.edu [Bug 1156] lock_thread_to_processor() should be declared in header ports/winnt/include/clockstuff.h@1.7.1.1 +1 -0 [Bug 1156] lock_thread_to_processor() should be declared in header ports/winnt/ntpd/nt_clockstuff.c@1.23.1.2 +0 -1 [Bug 1156] lock_thread_to_processor() should be declared in header ChangeSet@1.1436.15.33, 2009-04-12 00:38:47-04:00, mayer@pogo.udel.edu [Bug 1147] System errors should be logged to msyslog() ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.9 +17 -14 [Bug 1147] System errors should be logged to msyslog() ChangeSet@1.1436.15.32, 2009-04-12 00:34:41-04:00, mayer@pogo.udel.edu [Bug 1155] Wrong header included in config.h. Should have been winsock2.h ports/winnt/include/config.h@1.46.1.4 +1 -2 [Bug 1155] Wrong header included in config.h. Should have been winsock2.h ChangeSet@1.1436.15.31, 2009-04-12 00:32:25-04:00, mayer@pogo.udel.edu [Bug 787] Bug fixes for 64-bit time_t on Windows ports/winnt/libntp/SetSystemTime.c@1.3.1.1 +2 -2 [Bug 787] Bug fixes for 64-bit time_t on Windows ChangeSet@1.1796.1.35, 2009-04-10 07:56:46-04:00, stenn@whimsy.udel.edu NTP_4_2_5P163 TAG: NTP_4_2_5P163 ChangeLog@1.268.1.35 +1 -0 NTP_4_2_5P163 gsoc_sntp/sntp-opts.c@1.24 +2 -2 NTP_4_2_5P163 gsoc_sntp/sntp-opts.h@1.24 +3 -3 NTP_4_2_5P163 gsoc_sntp/sntp-opts.texi@1.24 +1 -1 NTP_4_2_5P163 gsoc_sntp/sntp.1@1.24 +2 -2 NTP_4_2_5P163 ntpd/ntpd-opts.c@1.155 +2 -2 NTP_4_2_5P163 ntpd/ntpd-opts.h@1.155 +3 -3 NTP_4_2_5P163 ntpd/ntpd-opts.texi@1.154 +1 -1 NTP_4_2_5P163 ntpd/ntpd.1@1.154 +2 -2 NTP_4_2_5P163 ntpdc/ntpdc-opts.c@1.151 +2 -2 NTP_4_2_5P163 ntpdc/ntpdc-opts.h@1.151 +3 -3 NTP_4_2_5P163 ntpdc/ntpdc-opts.texi@1.150 +1 -1 NTP_4_2_5P163 ntpdc/ntpdc.1@1.150 +2 -2 NTP_4_2_5P163 ntpq/ntpq-opts.c@1.151 +2 -2 NTP_4_2_5P163 ntpq/ntpq-opts.h@1.151 +3 -3 NTP_4_2_5P163 ntpq/ntpq-opts.texi@1.150 +1 -1 NTP_4_2_5P163 ntpq/ntpq.1@1.150 +2 -2 NTP_4_2_5P163 ntpsnmpd/ntpsnmpd-opts.c@1.32 +2 -2 NTP_4_2_5P163 ntpsnmpd/ntpsnmpd-opts.h@1.32 +3 -3 NTP_4_2_5P163 ntpsnmpd/ntpsnmpd-opts.texi@1.32 +1 -1 NTP_4_2_5P163 ntpsnmpd/ntpsnmpd.1@1.32 +2 -2 NTP_4_2_5P163 packageinfo.sh@1.166 +1 -1 NTP_4_2_5P163 sntp/sntp-opts.c@1.151 +2 -2 NTP_4_2_5P163 sntp/sntp-opts.h@1.151 +3 -3 NTP_4_2_5P163 sntp/sntp-opts.texi@1.150 +1 -1 NTP_4_2_5P163 sntp/sntp.1@1.150 +2 -2 NTP_4_2_5P163 util/ntp-keygen-opts.c@1.154 +2 -2 NTP_4_2_5P163 util/ntp-keygen-opts.h@1.154 +3 -3 NTP_4_2_5P163 util/ntp-keygen-opts.texi@1.153 +1 -1 NTP_4_2_5P163 util/ntp-keygen.1@1.153 +2 -2 NTP_4_2_5P163 ChangeSet@1.1796.1.33, 2009-04-09 09:58:19-04:00, stenn@whimsy.udel.edu NTP_4_2_5P162 TAG: NTP_4_2_5P162 ChangeLog@1.268.1.33 +1 -0 NTP_4_2_5P162 gsoc_sntp/sntp-opts.c@1.23 +2 -2 NTP_4_2_5P162 gsoc_sntp/sntp-opts.h@1.23 +3 -3 NTP_4_2_5P162 gsoc_sntp/sntp-opts.texi@1.23 +1 -1 NTP_4_2_5P162 gsoc_sntp/sntp.1@1.23 +2 -2 NTP_4_2_5P162 ntpd/ntpd-opts.c@1.154 +2 -2 NTP_4_2_5P162 ntpd/ntpd-opts.h@1.154 +3 -3 NTP_4_2_5P162 ntpd/ntpd-opts.texi@1.153 +2 -2 NTP_4_2_5P162 ntpd/ntpd.1@1.153 +2 -2 NTP_4_2_5P162 ntpdc/ntpdc-opts.c@1.150 +2 -2 NTP_4_2_5P162 ntpdc/ntpdc-opts.h@1.150 +3 -3 NTP_4_2_5P162 ntpdc/ntpdc-opts.texi@1.149 +2 -2 NTP_4_2_5P162 ntpdc/ntpdc.1@1.149 +2 -2 NTP_4_2_5P162 ntpq/ntpq-opts.c@1.150 +2 -2 NTP_4_2_5P162 ntpq/ntpq-opts.h@1.150 +3 -3 NTP_4_2_5P162 ntpq/ntpq-opts.texi@1.149 +2 -2 NTP_4_2_5P162 ntpq/ntpq.1@1.149 +2 -2 NTP_4_2_5P162 ntpsnmpd/ntpsnmpd-opts.c@1.31 +2 -2 NTP_4_2_5P162 ntpsnmpd/ntpsnmpd-opts.h@1.31 +3 -3 NTP_4_2_5P162 ntpsnmpd/ntpsnmpd-opts.texi@1.31 +1 -1 NTP_4_2_5P162 ntpsnmpd/ntpsnmpd.1@1.31 +2 -2 NTP_4_2_5P162 packageinfo.sh@1.165 +1 -1 NTP_4_2_5P162 sntp/sntp-opts.c@1.150 +2 -2 NTP_4_2_5P162 sntp/sntp-opts.h@1.150 +3 -3 NTP_4_2_5P162 sntp/sntp-opts.texi@1.149 +1 -1 NTP_4_2_5P162 sntp/sntp.1@1.149 +2 -2 NTP_4_2_5P162 util/ntp-keygen-opts.c@1.153 +2 -2 NTP_4_2_5P162 util/ntp-keygen-opts.h@1.153 +3 -3 NTP_4_2_5P162 util/ntp-keygen-opts.texi@1.152 +2 -2 NTP_4_2_5P162 util/ntp-keygen.1@1.152 +2 -2 NTP_4_2_5P162 ChangeSet@1.1436.15.30, 2009-04-09 07:44:06-04:00, stenn@whimsy.udel.edu NTP_4_2_4P7_RC2 TAG: NTP_4_2_4P7_RC2 ChangeLog@1.1.1.63 +1 -0 NTP_4_2_4P7_RC2 ntpd/ntpd-opts.c@1.50.19.1 +2 -2 NTP_4_2_4P7_RC2 ntpd/ntpd-opts.h@1.50.19.1 +3 -3 NTP_4_2_4P7_RC2 ntpd/ntpd-opts.texi@1.49.19.1 +2 -2 NTP_4_2_4P7_RC2 ntpd/ntpd.1@1.48.19.1 +2 -2 NTP_4_2_4P7_RC2 ntpd/ntpdsim-opts.c@1.50.19.1 +2 -2 NTP_4_2_4P7_RC2 ntpd/ntpdsim-opts.h@1.50.19.1 +3 -3 NTP_4_2_4P7_RC2 ntpd/ntpdsim-opts.texi@1.48.19.1 +1 -1 NTP_4_2_4P7_RC2 ntpd/ntpdsim.1@1.48.19.1 +2 -2 NTP_4_2_4P7_RC2 ntpdc/ntpdc-opts.c@1.50.19.1 +2 -2 NTP_4_2_4P7_RC2 ntpdc/ntpdc-opts.h@1.50.19.1 +3 -3 NTP_4_2_4P7_RC2 ntpdc/ntpdc-opts.texi@1.48.19.1 +2 -2 NTP_4_2_4P7_RC2 ntpdc/ntpdc.1@1.48.19.1 +2 -2 NTP_4_2_4P7_RC2 ntpq/ntpq-opts.c@1.52.19.1 +2 -2 NTP_4_2_4P7_RC2 ntpq/ntpq-opts.h@1.52.19.1 +3 -3 NTP_4_2_4P7_RC2 ntpq/ntpq-opts.texi@1.49.19.1 +2 -2 NTP_4_2_4P7_RC2 ntpq/ntpq.1@1.48.19.1 +2 -2 NTP_4_2_4P7_RC2 packageinfo.sh@1.65.27.1 +1 -1 NTP_4_2_4P7_RC2 sntp/sntp-opts.c@1.49.19.1 +2 -2 NTP_4_2_4P7_RC2 sntp/sntp-opts.h@1.49.19.1 +3 -3 NTP_4_2_4P7_RC2 sntp/sntp-opts.texi@1.46.19.1 +1 -1 NTP_4_2_4P7_RC2 sntp/sntp.1@1.49.19.1 +2 -2 NTP_4_2_4P7_RC2 util/ntp-keygen-opts.c@1.49.19.1 +2 -2 NTP_4_2_4P7_RC2 util/ntp-keygen-opts.h@1.49.19.1 +3 -3 NTP_4_2_4P7_RC2 util/ntp-keygen-opts.texi@1.47.19.1 +2 -2 NTP_4_2_4P7_RC2 util/ntp-keygen.1@1.47.19.1 +2 -2 NTP_4_2_4P7_RC2 ChangeSet@1.1796.11.2, 2009-04-09 04:49:27-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.268.10.2 +1 -0 Documentation updates from Dave Mills html/comdex.html@1.2 +4 -2 Documentation updates from Dave Mills html/decode.html@1.6 +5 -3 Documentation updates from Dave Mills html/index.html@1.39 +4 -3 Documentation updates from Dave Mills html/miscopt.html@1.41 +64 -54 Documentation updates from Dave Mills html/monopt.html@1.29 +4 -2 Documentation updates from Dave Mills html/prefer.html@1.18 +123 -58 Documentation updates from Dave Mills html/sitemap.html@1.3 +5 -3 Documentation updates from Dave Mills ChangeSet@1.1796.11.1, 2009-04-09 04:44:58-04:00, stenn@whimsy.udel.edu Mitigation and PPS cleanup from Dave Mills ChangeLog@1.268.10.1 +4 -3 Mitigation and PPS cleanup from Dave Mills include/ntpd.h@1.118.1.1 +1 -2 Mitigation and PPS cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.148 +2 -6 Mitigation and PPS cleanup from Dave Mills ntpd/ntp_proto.c@1.276.1.3 +170 -161 Mitigation and PPS cleanup from Dave Mills ntpd/ntp_timer.c@1.49.1.1 +7 -1 Mitigation and PPS cleanup from Dave Mills ntpd/refclock_atom.c@1.57 +24 -170 Mitigation and PPS cleanup from Dave Mills ntpd/refclock_conf.c@1.27 +1 -1 Mitigation and PPS cleanup from Dave Mills ntpd/refclock_local.c@1.19 +18 -34 Mitigation and PPS cleanup from Dave Mills ChangeSet@1.1436.15.29, 2009-04-09 04:16:50-04:00, stenn@whimsy.udel.edu ChangLog cleanup ChangeLog@1.1.1.62 +1 -0 ChangLog cleanup ChangeSet@1.1436.15.28, 2009-04-09 04:13:41-04:00, stenn@whimsy.udel.edu [Sec 1144] limited buffer overflow in ntpq. CVE-2009-0159 ChangeLog@1.1.1.61 +2 -0 [Sec 1144] limited buffer overflow in ntpq. CVE-2009-0159 ntpq/ntpq.c@1.65.2.1 +2 -2 [Sec 1144] limited buffer overflow in ntpq. CVE-2009-0159 ChangeSet@1.1796.10.2, 2009-04-07 09:37:52+00:00, davehart@shiny.ad.hartbrothers.com libntp.vcproj: add overlooked ntp_debug.h ports/winnt/libntp/libntp.vcproj@1.1.1.1 +4 -0 add overlooked ntp_debug.h ChangeSet@1.1436.15.27, 2009-04-07 09:14:58+00:00, davehart@shiny.ad.hartbrothers.com [Sec 1149] use setsockopt(SO_EXCLUSIVEADDRUSE) on Windows ChangeLog@1.1.1.60 +4 -0 [Sec 1149] use setsockopt(SO_EXCLUSIVEADDRUSE) on Windows ntpd/ntp_io.c@1.244.2.15 +64 -31 [Sec 1149] use setsockopt(SO_EXCLUSIVEADDRUSE) on Windows ports/winnt/libntp/libntp.vcproj@1.1.1.1 +4 -0 add ntp_debug.h ChangeSet@1.1796.9.2, 2009-04-03 19:06:56+00:00, davehart@shiny.ad.hartbrothers.com config.h, nt_clockstuff.c: VC6 compatibility (thanks Martin!) ports/winnt/include/config.h@1.60 +2 -1 VC6 compatibility (thanks Martin!) ports/winnt/ntpd/nt_clockstuff.c@1.27 +27 -16 VC6 compatibility (thanks Martin!) ChangeSet@1.1796.9.1, 2009-04-03 03:49:05+00:00, davehart@shiny.ad.hartbrothers.com new Windows interpolation knocks out 1ms jitter in previous remove dead code thin #ifdef SYS_WINNT forest 64-bit time_t truncation fixes, warnings silenced do not set hardware clock on exit unless system is shutting down BitKeeper/deleted/.del-ntpkeygen.vcproj@1.2 +0 -0 Rename: ports/winnt/ntp-keygen/ntpkeygen.vcproj -> BitKeeper/deleted/.del-ntpkeygen.vcproj ChangeLog@1.268.8.1 +5 -0 [Bug 216] new interpolation, reduce #ifdef SYS_WINNT, 64-bit time_t cleanup, only set Windows CMOS clock at ntpd exit if the computer is shutting down include/ntp_machine.h@1.25 +3 -46 remove SYS_WINNT stuff (redundant with ports/winnt/config.h) include/ntp_stdlib.h@1.26 +0 -1 remove dead humandate() code include/ntp_types.h@1.11 +18 -0 UNUSED_ARG macro definition, used to quiet compiler warnings --- define sock_timeval for Windows 64-bit time_t compatibility include/ntp_unixtime.h@1.6 +0 -3 remove dead code: tvtoa(), utvtoa() declarations libntp/Makefile.am@1.41 +2 -2 remove dead tvtoa.c & utvtoa.c from libntp libntp/buftvtots.c@1.5 +18 -0 Windows has no tty_clock discipline, don't look for timestamp in refclock recvbuff libntp/humandate.c@1.7 +1 -30 remove dead humandate() code libntp/prettydate.c@1.11 +17 -27 fix compiler warning with 64-bit time_t, fold duplicate code into common helper libntp/systime.c@1.47 +1 -1 quiet compiler warning with 64-bit time_t ntpd/ntp_config.c@1.184.1.1 +6 -6 quiet compiler warnings about storing int into u_short with casts ntpd/ntp_crypto.c@1.130 +1 -1 quiet compiler warning with 64-bit time_t ntpd/ntp_intres.c@1.57 +1 -1 struct sock_timeval for 64-bit time_t compatibility on Windows ntpd/ntp_timer.c@1.50 +0 -27 remove redundant code, nt_clockstuff.c enables privs earlier ntpd/ntpd.c@1.100 +0 -4 chop down some #ifdef forest ntpd/refclock_dumbclock.c@1.12 +1 -1 64-bit time_t compiler warning silenced ntpdate/ntpdate.c@1.65 +5 -18 struct sock_timeval for 64-bit time_t compatibility on Windows, more #ifdef SYS_WINNT deforestation ntpdc/ntpdc.c@1.59 +4 -16 struct sock_timeval for 64-bit time_t compatibility on Windows ntpq/ntpq.c@1.76 +5 -5 struct sock_timeval for 64-bit time_t compatibility on Windows ports/winnt/include/clockstuff.h@1.8 +32 -7 new interpolation scheme knocks out 1ms jitter inherent in previous ports/winnt/include/config.h@1.59 +27 -5 struct sock_timeval for 64-bit time_t compatibility on Windows, more #ifdef SYS_WINNT deforestation ports/winnt/include/ntservice.h@1.3 +2 -1 expose ntservice_systemisshuttingdown(), fix calling convention mismatch ports/winnt/include/sys/resource.h@1.4 +10 -4 emulate BSD setpriority() to reduce #ifdef SYS_WINNT ports/winnt/include/sys/time.h@1.5 +14 -6 new interpolation scheme knocks out 1ms jitter inherent in previous ports/winnt/libntp/SetSystemTime.c@1.5 +18 -16 new interpolation scheme knocks out 1ms jitter inherent in previous do not mix C runtime and Windows Gregorian calendar routines ports/winnt/libntp/getclock.c@1.1 +49 -0 emulate BSD getclock() interface ports/winnt/libntp/getclock.c@1.0 +0 -0 ports/winnt/libntp/libntp.dsp@1.33 +8 -0 add getclock.c setpriority.c ports/winnt/libntp/libntp.vcproj@1.2 +13 -59 remove dead tvtoa.c & utvtoa.c from libntp, add getclock.c setpriority.c and util_clockstuff.c ports/winnt/libntp/randfile.c@1.3 +3 -2 buffer overrun protection ports/winnt/libntp/setpriority.c@1.1 +79 -0 emulate BSD setpriority() to thin #ifdef forest in ntpd.c ports/winnt/libntp/setpriority.c@1.0 +0 -0 ports/winnt/libntp/syslog.c@1.4 +2 -1 use strncpy instead of strcpy, force null termination as Windows strncpy doesn't when buffer exceeded ports/winnt/libntp/util_clockstuff.c@1.4 +9 -17 no longer conflicts with ports/winnt/ntpd/nt_clockstuff.c, can be added to libntp library. ports/winnt/ntp-keygen/ntp-keygen.vcproj@1.2 +0 -22 remove util_clockstuff.c from individual projects, it's now in libntp library ports/winnt/ntpd/nt_clockstuff.c@1.26 +1180 -332 new interpolation scheme knocks out 1ms jitter inherent in previous ports/winnt/ntpd/ntp_iocompletionport.c@1.40 +3 -5 move lock_thread_to_processor prototype to clockstuff.h ports/winnt/ntpd/ntservice.c@1.14 +52 -41 ntservice_systemisshuttingdown(), fix mismatched calling convention, remove erroneous SetServiceStatus calls, eliminate unreachable code warning by removing exit() calls from main() ports/winnt/ntpd/win32_io.c@1.15 +0 -12 emulate BSD setpriority() to reduce #ifdef SYS_WINNT ports/winnt/ntpdate/ntpdate.vcproj@1.2 +0 -22 remove util_clockstuff.c from individual projects, it's now in libntp library ports/winnt/ntpdc/ntpdc.vcproj@1.2 +0 -22 remove util_clockstuff.c from individual projects, it's now in libntp library ports/winnt/ntpq/ntpq.vcproj@1.2 +0 -22 remove util_clockstuff.c from individual projects, it's now in libntp library ports/winnt/scripts/mkver.bat@1.10 +4 -4 fix VC++ 2008 parallel build collision on %TEMP%\TZ.TMP by using a different filename for each program util/ntp-keygen.c@1.54 +1 -4 remove #ifdef SYS_WINNT, gettimeofday() prototype on Windows now matches Unix ChangeSet@1.1796.8.2, 2009-04-01 01:13:42+00:00, davehart@shiny.ad.hartbrothers.com bk gone the former gsoc_sntp/utilities.o so that all .o files can be removed without corrupting the repo BitKeeper/etc/gone@1.9 +1 -0 bk gone the former gsoc_sntp/utilities.o so that all .o files can be removed without corrupting the repo ChangeLog@1.268.7.2 +2 -0 bk gone the former gsoc_sntp/utilities.o so that all .o files can be removed without corrupting the repo ChangeSet@1.1796.8.1, 2009-03-31 06:56:41-05:00, stenn@whimsy.udel.edu NTP_4_2_5P161 TAG: NTP_4_2_5P161 ChangeLog@1.268.7.1 +1 -0 NTP_4_2_5P161 gsoc_sntp/sntp-opts.c@1.22 +2 -2 NTP_4_2_5P161 gsoc_sntp/sntp-opts.h@1.22 +3 -3 NTP_4_2_5P161 gsoc_sntp/sntp-opts.texi@1.22 +1 -1 NTP_4_2_5P161 gsoc_sntp/sntp.1@1.22 +2 -2 NTP_4_2_5P161 ntpd/ntpd-opts.c@1.153 +2 -2 NTP_4_2_5P161 ntpd/ntpd-opts.h@1.153 +3 -3 NTP_4_2_5P161 ntpd/ntpd-opts.texi@1.152 +1 -1 NTP_4_2_5P161 ntpd/ntpd.1@1.152 +2 -2 NTP_4_2_5P161 ntpdc/ntpdc-opts.c@1.149 +2 -2 NTP_4_2_5P161 ntpdc/ntpdc-opts.h@1.149 +3 -3 NTP_4_2_5P161 ntpdc/ntpdc-opts.texi@1.148 +1 -1 NTP_4_2_5P161 ntpdc/ntpdc.1@1.148 +2 -2 NTP_4_2_5P161 ntpq/ntpq-opts.c@1.149 +2 -2 NTP_4_2_5P161 ntpq/ntpq-opts.h@1.149 +3 -3 NTP_4_2_5P161 ntpq/ntpq-opts.texi@1.148 +1 -1 NTP_4_2_5P161 ntpq/ntpq.1@1.148 +2 -2 NTP_4_2_5P161 ntpsnmpd/ntpsnmpd-opts.c@1.30 +2 -2 NTP_4_2_5P161 ntpsnmpd/ntpsnmpd-opts.h@1.30 +3 -3 NTP_4_2_5P161 ntpsnmpd/ntpsnmpd-opts.texi@1.30 +1 -1 NTP_4_2_5P161 ntpsnmpd/ntpsnmpd.1@1.30 +2 -2 NTP_4_2_5P161 packageinfo.sh@1.164 +1 -1 NTP_4_2_5P161 sntp/sntp-opts.c@1.149 +2 -2 NTP_4_2_5P161 sntp/sntp-opts.h@1.149 +3 -3 NTP_4_2_5P161 sntp/sntp-opts.texi@1.148 +1 -1 NTP_4_2_5P161 sntp/sntp.1@1.148 +2 -2 NTP_4_2_5P161 util/ntp-keygen-opts.c@1.152 +2 -2 NTP_4_2_5P161 util/ntp-keygen-opts.h@1.152 +3 -3 NTP_4_2_5P161 util/ntp-keygen-opts.texi@1.151 +1 -1 NTP_4_2_5P161 util/ntp-keygen.1@1.151 +2 -2 NTP_4_2_5P161 ChangeSet@1.1796.1.28, 2009-03-31 09:33:53+00:00, davehart@shiny.ad.hartbrothers.com refclock_nmea.c: [Bug 1148] NMEA reference clock improvements ChangeLog@1.268.1.28 +1 -0 [Bug 1148] NMEA reference clock improvements ntpd/refclock_nmea.c@1.32 +377 -222 [Bug 1148] NMEA reference clock improvements ChangeSet@1.1796.1.27, 2009-03-30 14:44:58-05:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.268.1.27 +1 -0 Documentation updates from Dave Mills html/confopt.html@1.44 +194 -89 Documentation updates from Dave Mills html/ntpq.html@1.31 +23 -6 Documentation updates from Dave Mills ChangeSet@1.1796.1.25, 2009-03-30 09:06:35-05:00, stenn@whimsy.udel.edu NTP_4_2_5P160 TAG: NTP_4_2_5P160 ChangeLog@1.268.1.25 +1 -0 NTP_4_2_5P160 gsoc_sntp/sntp-opts.c@1.21 +2 -2 NTP_4_2_5P160 gsoc_sntp/sntp-opts.h@1.21 +3 -3 NTP_4_2_5P160 gsoc_sntp/sntp-opts.texi@1.21 +1 -1 NTP_4_2_5P160 gsoc_sntp/sntp.1@1.21 +2 -2 NTP_4_2_5P160 ntpd/ntpd-opts.c@1.152 +2 -2 NTP_4_2_5P160 ntpd/ntpd-opts.h@1.152 +3 -3 NTP_4_2_5P160 ntpd/ntpd-opts.texi@1.151 +1 -1 NTP_4_2_5P160 ntpd/ntpd.1@1.151 +2 -2 NTP_4_2_5P160 ntpdc/ntpdc-opts.c@1.148 +2 -2 NTP_4_2_5P160 ntpdc/ntpdc-opts.h@1.148 +3 -3 NTP_4_2_5P160 ntpdc/ntpdc-opts.texi@1.147 +1 -1 NTP_4_2_5P160 ntpdc/ntpdc.1@1.147 +2 -2 NTP_4_2_5P160 ntpq/ntpq-opts.c@1.148 +2 -2 NTP_4_2_5P160 ntpq/ntpq-opts.h@1.148 +3 -3 NTP_4_2_5P160 ntpq/ntpq-opts.texi@1.147 +1 -1 NTP_4_2_5P160 ntpq/ntpq.1@1.147 +2 -2 NTP_4_2_5P160 ntpsnmpd/ntpsnmpd-opts.c@1.29 +2 -2 NTP_4_2_5P160 ntpsnmpd/ntpsnmpd-opts.h@1.29 +3 -3 NTP_4_2_5P160 ntpsnmpd/ntpsnmpd-opts.texi@1.29 +1 -1 NTP_4_2_5P160 ntpsnmpd/ntpsnmpd.1@1.29 +2 -2 NTP_4_2_5P160 packageinfo.sh@1.163 +1 -1 NTP_4_2_5P160 sntp/sntp-opts.c@1.148 +2 -2 NTP_4_2_5P160 sntp/sntp-opts.h@1.148 +3 -3 NTP_4_2_5P160 sntp/sntp-opts.texi@1.147 +1 -1 NTP_4_2_5P160 sntp/sntp.1@1.147 +2 -2 NTP_4_2_5P160 util/ntp-keygen-opts.c@1.151 +2 -2 NTP_4_2_5P160 util/ntp-keygen-opts.h@1.151 +3 -3 NTP_4_2_5P160 util/ntp-keygen-opts.texi@1.150 +1 -1 NTP_4_2_5P160 util/ntp-keygen.1@1.150 +2 -2 NTP_4_2_5P160 ChangeSet@1.1436.15.26, 2009-03-30 06:47:41-05:00, stenn@whimsy.udel.edu NTP_4_2_4P7_RC1 TAG: NTP_4_2_4P7_RC1 ChangeLog@1.1.1.59 +1 -0 NTP_4_2_4P7_RC1 ntpd/ntpd-opts.c@1.50.18.1 +2 -2 NTP_4_2_4P7_RC1 ntpd/ntpd-opts.h@1.50.18.1 +3 -3 NTP_4_2_4P7_RC1 ntpd/ntpd-opts.texi@1.49.18.1 +2 -2 NTP_4_2_4P7_RC1 ntpd/ntpd.1@1.48.18.1 +2 -2 NTP_4_2_4P7_RC1 ntpd/ntpdsim-opts.c@1.50.18.1 +2 -2 NTP_4_2_4P7_RC1 ntpd/ntpdsim-opts.h@1.50.18.1 +3 -3 NTP_4_2_4P7_RC1 ntpd/ntpdsim-opts.texi@1.48.18.1 +1 -1 NTP_4_2_4P7_RC1 ntpd/ntpdsim.1@1.48.18.1 +2 -2 NTP_4_2_4P7_RC1 ntpdc/ntpdc-opts.c@1.50.18.1 +2 -2 NTP_4_2_4P7_RC1 ntpdc/ntpdc-opts.h@1.50.18.1 +3 -3 NTP_4_2_4P7_RC1 ntpdc/ntpdc-opts.texi@1.48.18.1 +2 -2 NTP_4_2_4P7_RC1 ntpdc/ntpdc.1@1.48.18.1 +2 -2 NTP_4_2_4P7_RC1 ntpq/ntpq-opts.c@1.52.18.1 +2 -2 NTP_4_2_4P7_RC1 ntpq/ntpq-opts.h@1.52.18.1 +3 -3 NTP_4_2_4P7_RC1 ntpq/ntpq-opts.texi@1.49.18.1 +2 -2 NTP_4_2_4P7_RC1 ntpq/ntpq.1@1.48.18.1 +2 -2 NTP_4_2_4P7_RC1 packageinfo.sh@1.65.26.1 +2 -2 NTP_4_2_4P7_RC1 sntp/sntp-opts.c@1.49.18.1 +2 -2 NTP_4_2_4P7_RC1 sntp/sntp-opts.h@1.49.18.1 +3 -3 NTP_4_2_4P7_RC1 sntp/sntp-opts.texi@1.46.18.1 +1 -1 NTP_4_2_4P7_RC1 sntp/sntp.1@1.49.18.1 +2 -2 NTP_4_2_4P7_RC1 util/ntp-keygen-opts.c@1.49.18.1 +2 -2 NTP_4_2_4P7_RC1 util/ntp-keygen-opts.h@1.49.18.1 +3 -3 NTP_4_2_4P7_RC1 util/ntp-keygen-opts.texi@1.47.18.1 +2 -2 NTP_4_2_4P7_RC1 util/ntp-keygen.1@1.47.18.1 +2 -2 NTP_4_2_4P7_RC1 ChangeSet@1.1436.15.25, 2009-03-30 02:31:49-05:00, stenn@whimsy.udel.edu Release Candidate packageinfo.sh@1.65.25.1 +1 -1 Release Candidate ChangeSet@1.1796.7.2, 2009-03-28 06:55:26-05:00, stenn@whimsy.udel.edu NTP_4_2_5P159 TAG: NTP_4_2_5P159 ChangeLog@1.268.6.2 +1 -0 NTP_4_2_5P159 gsoc_sntp/sntp-opts.c@1.20 +2 -2 NTP_4_2_5P159 gsoc_sntp/sntp-opts.h@1.20 +3 -3 NTP_4_2_5P159 gsoc_sntp/sntp-opts.texi@1.20 +1 -1 NTP_4_2_5P159 gsoc_sntp/sntp.1@1.20 +2 -2 NTP_4_2_5P159 ntpd/ntpd-opts.c@1.151 +2 -2 NTP_4_2_5P159 ntpd/ntpd-opts.h@1.151 +3 -3 NTP_4_2_5P159 ntpd/ntpd-opts.texi@1.150 +2 -2 NTP_4_2_5P159 ntpd/ntpd.1@1.150 +2 -2 NTP_4_2_5P159 ntpdc/ntpdc-opts.c@1.147 +2 -2 NTP_4_2_5P159 ntpdc/ntpdc-opts.h@1.147 +3 -3 NTP_4_2_5P159 ntpdc/ntpdc-opts.texi@1.146 +2 -2 NTP_4_2_5P159 ntpdc/ntpdc.1@1.146 +2 -2 NTP_4_2_5P159 ntpq/ntpq-opts.c@1.147 +2 -2 NTP_4_2_5P159 ntpq/ntpq-opts.h@1.147 +3 -3 NTP_4_2_5P159 ntpq/ntpq-opts.texi@1.146 +2 -2 NTP_4_2_5P159 ntpq/ntpq.1@1.146 +2 -2 NTP_4_2_5P159 ntpsnmpd/ntpsnmpd-opts.c@1.28 +2 -2 NTP_4_2_5P159 ntpsnmpd/ntpsnmpd-opts.h@1.28 +3 -3 NTP_4_2_5P159 ntpsnmpd/ntpsnmpd-opts.texi@1.28 +1 -1 NTP_4_2_5P159 ntpsnmpd/ntpsnmpd.1@1.28 +2 -2 NTP_4_2_5P159 packageinfo.sh@1.162 +1 -1 NTP_4_2_5P159 sntp/sntp-opts.c@1.147 +2 -2 NTP_4_2_5P159 sntp/sntp-opts.h@1.147 +3 -3 NTP_4_2_5P159 sntp/sntp-opts.texi@1.146 +1 -1 NTP_4_2_5P159 sntp/sntp.1@1.146 +2 -2 NTP_4_2_5P159 util/ntp-keygen-opts.c@1.150 +2 -2 NTP_4_2_5P159 util/ntp-keygen-opts.h@1.150 +3 -3 NTP_4_2_5P159 util/ntp-keygen-opts.texi@1.149 +2 -2 NTP_4_2_5P159 util/ntp-keygen.1@1.149 +2 -2 NTP_4_2_5P159 ChangeSet@1.1436.15.23, 2009-03-28 02:46:45-05:00, stenn@whimsy.udel.edu build system email address cleanup BitKeeper/triggers/changelog@1.4 +1 -1 trigger email address cleanup BitKeeper/triggers/commitlogs@1.6 +1 -1 trigger email address cleanup BitKeeper/triggers/delta-changelog@1.8 +2 -2 trigger email address cleanup BitKeeper/triggers/notify@1.4 +1 -1 trigger email address cleanup BitKeeper/triggers/paranoid@1.4 +1 -1 trigger email address cleanup BitKeeper/triggers/post-incoming.license-warn@1.7 +1 -1 trigger email address cleanup BitKeeper/triggers/pre-resolve.licfix@1.4 +1 -1 trigger email address cleanup BitKeeper/triggers/send@1.14 +2 -2 trigger email address cleanup ChangeLog@1.1.1.57 +3 -1 build system email address cleanup ChangeSet@1.1796.7.1, 2009-03-28 02:14:41-05:00, stenn@whimsy.udel.edu "bias" changes from Dave Mills ChangeLog@1.268.6.1 +1 -0 "bias" changes from Dave Mills include/ntp.h@1.148.1.1 +2 -1 "bias" changes from Dave Mills include/ntp_control.h@1.34 +9 -8 "bias" changes from Dave Mills ntpd/ntp_control.c@1.108 +18 -10 "bias" changes from Dave Mills ntpd/ntp_crypto.c@1.129 +13 -11 "bias" changes from Dave Mills ntpd/ntp_proto.c@1.276.1.2 +69 -92 "bias" changes from Dave Mills ChangeSet@1.1796.1.21, 2009-03-28 05:37:50+00:00, davehart@shiny.ad.hartbrothers.com ntp_refclock.c, ChangeLog: [Bug 1141] refclock_report missing braces cause spurious 'peer event: clock clk_unspec' log entries ChangeLog@1.268.1.21 +8 -5 [Bug 1141] refclock_report missing braces cause spurious 'peer event: clock clk_unspec' log entries ntpd/ntp_refclock.c@1.81 +2 -1 [Bug 1141] refclock_report missing braces cause spurious 'peer event: clock clk_unspec' log entries ChangeSet@1.1796.1.20, 2009-03-24 15:23:07+00:00, davehart@shiny.ad.hartbrothers.com config.h: include winsock.h before ws2tcpip.h to fix VS 2005 build ports/winnt/include/config.h@1.57 +8 -5 include winsock.h before ws2tcpip.h to fix VS 2005 build ChangeSet@1.1436.15.22, 2009-03-24 15:22:36+00:00, davehart@shiny.ad.hartbrothers.com config.h: include winsock.h before ws2tcpip.h to fix VS 2005 build ports/winnt/include/config.h@1.46.1.3 +8 -5 include winsock.h before ws2tcpip.h to fix VS 2005 build ChangeSet@1.1436.20.2, 2009-03-24 15:14:36+00:00, davehart@shiny.ad.hartbrothers.com ntp_iocompletionport.c: use one receive per socket to avoid Win2000 afd.sys bugcheck 0x76 ports/winnt/ntpd/ntp_iocompletionport.c@1.21.2.2 +10 -1 use one receive per socket to avoid Win2000 afd.sys bugcheck 0x76 ChangeSet@1.1796.6.2, 2009-03-24 15:04:27+00:00, davehart@shiny.ad.hartbrothers.com ntp_iocompletionport.c: use one receive per socket to avoid Win2000 afd.sys bugcheck 0x76 ports/winnt/ntpd/ntp_iocompletionport.c@1.35.1.2 +10 -1 use one receive per socket to avoid Win2000 afd.sys bugcheck 0x76 ChangeSet@1.1436.15.20, 2009-03-22 21:09:43+00:00, davehart@shiny.ad.hartbrothers.com Makefile.am, ChangeLog: [Bug 774] parsesolaris.c does not compile under the new Solaris ChangeLog@1.1.1.56 +1 -0 [Bug 774] parsesolaris.c does not compile under the new Solaris libparse/Makefile.am@1.8.1.1 +1 -1 [Bug 774] parsesolaris.c does not compile under the new Solaris ChangeSet@1.1436.15.19, 2009-03-20 03:39:26+00:00, hart@pogo.udel.edu ChangeLog: bk for windows isn't converting line endings correctly, remove two blank lines visible only on Unix side ChangeLog@1.1.1.55 +0 -2 bk for windows isn't converting line endings correctly, remove two blank lines visible only on Unix side ChangeSet@1.1796.1.18, 2009-03-20 03:34:09+00:00, davehart@shiny.ad.hartbrothers.com ChangeLog: I'm learning add DPRINTF line omitted accidentally ChangeLog@1.268.1.20 +1 -1 add DPRINTF line omitted accidentally ChangeLog@1.268.1.19 +2 -0 I'm learning ChangeSet@1.1436.15.16, 2009-03-20 03:10:22+00:00, davehart@shiny.ad.hartbrothers.com ChangeLog: remove blank first line ChangeLog@1.1.1.52 +0 -1 remove blank first line ChangeSet@1.1436.20.1, 2009-03-20 01:46:15+00:00, davehart@shiny.ad.hartbrothers.com [Bug 873] Windows serial refclock proper TTY line discipline emulation ChangeLog@1.1.15.1 +2 -0 [Bug 873] Windows serial refclock proper TTY line discipline emulation ntpd/ntp_io.c@1.244.3.1 +26 -23 [Bug 873] Windows serial refclock proper TTY line discipline emulation ntpd/ntpd.c@1.82.2.4 +14 -25 slightly reduce #ifdef SYS_WINNT forest ntpd/refclock_dumbclock.c@1.8.1.1 +6 -5 [Bug 873] Windows serial refclock proper TTY line discipline emulation ntpd/refclock_hopfser.c@1.9.1.1 +6 -5 [Bug 873] Windows serial refclock proper TTY line discipline emulation ntpd/refclock_nmea.c@1.25.1.1 +6 -5 [Bug 873] Windows serial refclock proper TTY line discipline emulation ntpd/refclock_palisade.c@1.18.1.1 +6 -5 [Bug 873] Windows serial refclock proper TTY line discipline emulation ports/winnt/include/ntp_iocompletionport.h@1.13.1.1 +8 -9 [Bug 873] Windows serial refclock proper TTY line discipline emulation ports/winnt/ntpd/ntp_iocompletionport.c@1.21.2.1 +331 -249 [Bug 873] Windows serial refclock proper TTY line discipline emulation ports/winnt/ntpd/win32_io.c@1.12.1.1 +172 -66 [Bug 873] Windows serial refclock proper TTY line discipline emulation ChangeSet@1.1796.6.1, 2009-03-20 01:31:56+00:00, davehart@shiny.ad.hartbrothers.com [Bug 873] Windows serial refclock proper TTY line discipline emulation --- Merge shiny.ad.hartbrothers.com:c:\ntp\ntp-stable-873 into shiny.ad.hartbrothers.com:C:/ntp/ntp-dev-873 ChangeLog@1.268.5.1 +1 -0 [Bug 873] Windows serial refclock proper TTY line discipline emulation ntpd/ntp_io.c@1.275.1.1 +25 -22 [Bug 873] Windows serial refclock proper TTY line discipline emulation ntpd/ntpd.c@1.98 +17 -29 slightly reduce #ifdef SYS_WINNT forest ntpd/refclock_dumbclock.c@1.10 +6 -5 [Bug 873] Windows serial refclock proper TTY line discipline emulation ntpd/refclock_hopfser.c@1.11 +6 -5 [Bug 873] Windows serial refclock proper TTY line discipline emulation ntpd/refclock_nmea.c@1.30 +6 -5 [Bug 873] Windows serial refclock proper TTY line discipline emulation ntpd/refclock_palisade.c@1.22 +6 -5 [Bug 873] Windows serial refclock proper TTY line discipline emulation ports/winnt/include/ntp_iocompletionport.h@1.15 +8 -9 [Bug 873] Windows serial refclock proper TTY line discipline emulation ports/winnt/ntpd/ntp_iocompletionport.c@1.35.1.1 +335 -255 [Bug 873] Windows serial refclock proper TTY line discipline emulation ports/winnt/ntpd/win32_io.c@1.13 +172 -66 [Bug 873] Windows serial refclock proper TTY line discipline emulation ChangeSet@1.1436.19.2, 2009-03-18 11:44:59+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1014] Enable building with VC9 (in Visual Studio 2008, Visual C++ 2008, or SDK) ChangeLog@1.1.14.1 +2 -0 [Bug 1014] Enable building with VC9 (in Visual Studio 2008, Visual C++ 2008, or SDK) ChangeSet@1.1796.5.2, 2009-03-18 11:42:38+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1014] Enable building with VC9 (in Visual Studio 2008, Visual C++ 2008, or SDK) ChangeLog@1.268.4.1 +1 -0 [Bug 1014] Enable building with VC9 (in Visual Studio 2008, Visual C++ 2008, or SDK) ChangeSet@1.1436.17.4, 2009-03-18 10:14:52+00:00, davehart@shiny.ad.hartbrothers.com [Bug 1117] Deferred interface binding under Windows works only correctly if FORCE_DNSRETRY is defined ChangeLog@1.1.12.3 +2 -0 [Bug 1117] Deferred interface binding under Windows works only correctly if FORCE_DNSRETRY is defined ChangeSet@1.1796.5.1, 2009-03-17 19:21:10+00:00, davehart@shiny.ad.hartbrothers.com [bug 1014] compile on VC9 AKA VC++ 2008 EE AKA VS 2008 ports/winnt/instsrv/instsrv.vcproj@1.1 +253 -0 [bug 1014] VC9 equivalent to .dsp ports/winnt/instsrv/instsrv.vcproj@1.0 +0 -0 ports/winnt/libntp/libntp.vcproj@1.1 +2211 -0 [bug 1014] VC9 equivalent to .dsp ports/winnt/libntp/libntp.vcproj@1.0 +0 -0 ports/winnt/ntp-keygen/ntp-keygen.vcproj@1.1 +419 -0 [bug 1014] VC9 equivalent to .dsp ports/winnt/ntp-keygen/ntp-keygen.vcproj@1.0 +0 -0 ports/winnt/ntp.sln@1.2 +1 -1 [bug 1014] VC9 equivalent to ntp.dsw (checkin comment only change) ports/winnt/ntp.sln@1.1 +71 -0 BitKeeper file C:/ntp/ntp-dev-1014/ports/winnt/ntp.sln ports/winnt/ntp.sln@1.0 +0 -0 ports/winnt/ntpd/ntpd.vcproj@1.1 +2218 -0 [bug 1014] VC9 equivalent to .dsp ports/winnt/ntpd/ntpd.vcproj@1.0 +0 -0 ports/winnt/ntpdate/ntpdate.vcproj@1.1 +327 -0 [bug 1014] VC9 equivalent to .dsp ports/winnt/ntpdate/ntpdate.vcproj@1.0 +0 -0 ports/winnt/ntpdc/ntpdc.vcproj@1.1 +376 -0 [bug 1014] VC9 equivalent to .dsp ports/winnt/ntpdc/ntpdc.vcproj@1.0 +0 -0 ports/winnt/ntpq/ntpq.vcproj@1.1 +370 -0 [bug 1014] VC9 equivalent to .dsp ports/winnt/ntpq/ntpq.vcproj@1.0 +0 -0 ChangeSet@1.1436.19.1, 2009-03-17 18:39:09+00:00, davehart@shiny.ad.hartbrothers.com add .sln and .vcproj files for VC9 ports/winnt/instsrv/Instsrv.vcproj@1.1 +253 -0 VC9 equivalent to Instsrv.dsp ports/winnt/instsrv/Instsrv.vcproj@1.0 +0 -0 ports/winnt/libntp/libntp.vcproj@1.1 +2229 -0 VC9 equivalent to libntp.dsp ports/winnt/libntp/libntp.vcproj@1.0 +0 -0 ports/winnt/ntp-keygen/ntpkeygen.vcproj@1.1 +419 -0 VC9 equivalent to ntpkeygen.dsp ports/winnt/ntp-keygen/ntpkeygen.vcproj@1.0 +0 -0 ports/winnt/ntp.sln@1.1 +71 -0 VC9 equivalent to ntp.dsw ports/winnt/ntp.sln@1.0 +0 -0 ports/winnt/ntpd/ntpd.vcproj@1.1 +2198 -0 VC9 equivalent to ntpd.dsp ports/winnt/ntpd/ntpd.vcproj@1.0 +0 -0 ports/winnt/ntpdate/ntpdate.vcproj@1.1 +327 -0 VC9 equivalent to ntpdate.dsp ports/winnt/ntpdate/ntpdate.vcproj@1.0 +0 -0 ports/winnt/ntpdc/ntpdc.vcproj@1.1 +376 -0 VC9 equivalent to ntpdc.dsp ports/winnt/ntpdc/ntpdc.vcproj@1.0 +0 -0 ports/winnt/ntpq/ntpq.vcproj@1.1 +370 -0 VC9 equivalent to ntpq.dsp ports/winnt/ntpq/ntpq.vcproj@1.0 +0 -0 ChangeSet@1.1436.17.3, 2009-03-17 18:18:13+00:00, hart@pogo.udel.edu config.h: now works with VC6 and VC9 compilers, declares DWORD_PTR on VC6 ports/winnt/include/config.h@1.46.1.2 +243 -96 now works with VC6 and VC9 compilers, declares DWORD_PTR on VC6 ChangeSet@1.1796.4.3, 2009-03-17 18:15:41+00:00, hart@pogo.udel.edu config.h: now works with VC6 and VC9 compilers, declares DWORD_PTR for VC6 ports/winnt/include/config.h@1.55 +238 -116 now works with VC6 and VC9 compilers ChangeSet@1.1436.18.1, 2009-02-21 07:45:56-05:00, utterback@pogo.udel.edu configure.ac, ChangeLog: [BUG 1131] UDP sockets should not use SIGPOLL on Solaris. ChangeLog@1.1.13.1 +2 -0 [BUG 1131] UDP sockets should not use SIGPOLL on Solaris. configure.ac@1.400.1.2 +3 -0 [BUG 1131] UDP sockets should not use SIGPOLL on Solaris. ChangeSet@1.1436.17.2, 2009-02-07 21:13:17+00:00, hart@pogo.udel.edu ChangeLog: formatting of newest line ChangeLog@1.1.12.2 +1 -1 formatting of newest line ChangeSet@1.1436.17.1, 2009-02-07 21:05:32+00:00, hart@pogo.udel.edu nt_clockstuff.c, ChangeLog, ntp_iocompletionport.c: [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU ChangeLog@1.1.12.1 +2 -0 [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU ports/winnt/ntpd/nt_clockstuff.c@1.23.1.1 +89 -22 [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.6 +12 -0 [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU ChangeSet@1.1436.15.14, 2009-02-07 14:08:35-05:00, hart@pogo.udel.edu ChangeLog: DPRINTF safer ChangeLog@1.1.1.50 +2 -0 DPRINTF safer ChangeSet@1.1436.15.13, 2009-02-06 19:00:15-05:00, hart@pogo.udel.edu ntp_debug.h: DPRINTF won't eat following else, always evaluates to a statement ntp_io.c: DPRINTF_INTERFACE always evaluates to a statement fix DPRINTF use with misplaced semicolon include/ntp_debug.h@1.2 +6 -4 DPRINTF won't eat following else, always evaluates to a statement ntpd/ntp_io.c@1.244.2.13 +2 -2 DPRINTF_INTERFACE always evaluates to a statement fix DPRINTF use with misplaced semicolon ChangeSet@1.1796.1.13, 2009-01-30 06:54:34-05:00, stenn@whimsy.udel.edu NTP_4_2_5P158 TAG: NTP_4_2_5P158 ChangeLog@1.268.1.13 +1 -0 NTP_4_2_5P158 gsoc_sntp/sntp-opts.c@1.19 +2 -2 NTP_4_2_5P158 gsoc_sntp/sntp-opts.h@1.19 +3 -3 NTP_4_2_5P158 gsoc_sntp/sntp-opts.texi@1.19 +1 -1 NTP_4_2_5P158 gsoc_sntp/sntp.1@1.19 +2 -2 NTP_4_2_5P158 ntpd/ntpd-opts.c@1.150 +2 -2 NTP_4_2_5P158 ntpd/ntpd-opts.h@1.150 +3 -3 NTP_4_2_5P158 ntpd/ntpd-opts.texi@1.149 +1 -1 NTP_4_2_5P158 ntpd/ntpd.1@1.149 +2 -2 NTP_4_2_5P158 ntpdc/ntpdc-opts.c@1.146 +2 -2 NTP_4_2_5P158 ntpdc/ntpdc-opts.h@1.146 +3 -3 NTP_4_2_5P158 ntpdc/ntpdc-opts.texi@1.145 +1 -1 NTP_4_2_5P158 ntpdc/ntpdc.1@1.145 +2 -2 NTP_4_2_5P158 ntpq/ntpq-opts.c@1.146 +2 -2 NTP_4_2_5P158 ntpq/ntpq-opts.h@1.146 +3 -3 NTP_4_2_5P158 ntpq/ntpq-opts.texi@1.145 +1 -1 NTP_4_2_5P158 ntpq/ntpq.1@1.145 +2 -2 NTP_4_2_5P158 ntpsnmpd/ntpsnmpd-opts.c@1.27 +2 -2 NTP_4_2_5P158 ntpsnmpd/ntpsnmpd-opts.h@1.27 +3 -3 NTP_4_2_5P158 ntpsnmpd/ntpsnmpd-opts.texi@1.27 +1 -1 NTP_4_2_5P158 ntpsnmpd/ntpsnmpd.1@1.27 +2 -2 NTP_4_2_5P158 packageinfo.sh@1.161 +1 -1 NTP_4_2_5P158 sntp/sntp-opts.c@1.146 +2 -2 NTP_4_2_5P158 sntp/sntp-opts.h@1.146 +3 -3 NTP_4_2_5P158 sntp/sntp-opts.texi@1.145 +1 -1 NTP_4_2_5P158 sntp/sntp.1@1.145 +2 -2 NTP_4_2_5P158 util/ntp-keygen-opts.c@1.149 +2 -2 NTP_4_2_5P158 util/ntp-keygen-opts.h@1.149 +3 -3 NTP_4_2_5P158 util/ntp-keygen-opts.texi@1.148 +1 -1 NTP_4_2_5P158 util/ntp-keygen.1@1.148 +2 -2 NTP_4_2_5P158 ChangeSet@1.1796.1.12, 2009-01-30 03:47:58-05:00, stenn@whimsy.udel.edu Fix [CID 72], a typo introduced at the latest fix to prettydate.c ChangeLog@1.268.1.12 +1 -0 Fix [CID 72], a typo introduced at the latest fix to prettydate.c libntp/prettydate.c@1.10 +2 -1 Fix [CID 72], a typo introduced at the latest fix to prettydate.c ChangeSet@1.1796.1.11, 2009-01-26 06:55:24-05:00, stenn@whimsy.udel.edu NTP_4_2_5P157 TAG: NTP_4_2_5P157 ChangeLog@1.268.1.11 +1 -0 NTP_4_2_5P157 gsoc_sntp/sntp-opts.c@1.18 +2 -2 NTP_4_2_5P157 gsoc_sntp/sntp-opts.h@1.18 +3 -3 NTP_4_2_5P157 gsoc_sntp/sntp-opts.texi@1.18 +1 -1 NTP_4_2_5P157 gsoc_sntp/sntp.1@1.18 +2 -2 NTP_4_2_5P157 ntpd/ntpd-opts.c@1.149 +2 -2 NTP_4_2_5P157 ntpd/ntpd-opts.h@1.149 +3 -3 NTP_4_2_5P157 ntpd/ntpd-opts.texi@1.148 +2 -2 NTP_4_2_5P157 ntpd/ntpd.1@1.148 +2 -2 NTP_4_2_5P157 ntpdc/ntpdc-opts.c@1.145 +2 -2 NTP_4_2_5P157 ntpdc/ntpdc-opts.h@1.145 +3 -3 NTP_4_2_5P157 ntpdc/ntpdc-opts.texi@1.144 +2 -2 NTP_4_2_5P157 ntpdc/ntpdc.1@1.144 +2 -2 NTP_4_2_5P157 ntpq/ntpq-opts.c@1.145 +2 -2 NTP_4_2_5P157 ntpq/ntpq-opts.h@1.145 +3 -3 NTP_4_2_5P157 ntpq/ntpq-opts.texi@1.144 +2 -2 NTP_4_2_5P157 ntpq/ntpq.1@1.144 +2 -2 NTP_4_2_5P157 ntpsnmpd/ntpsnmpd-opts.c@1.26 +2 -2 NTP_4_2_5P157 ntpsnmpd/ntpsnmpd-opts.h@1.26 +3 -3 NTP_4_2_5P157 ntpsnmpd/ntpsnmpd-opts.texi@1.26 +1 -1 NTP_4_2_5P157 ntpsnmpd/ntpsnmpd.1@1.26 +2 -2 NTP_4_2_5P157 packageinfo.sh@1.160 +1 -1 NTP_4_2_5P157 sntp/sntp-opts.c@1.145 +2 -2 NTP_4_2_5P157 sntp/sntp-opts.h@1.145 +3 -3 NTP_4_2_5P157 sntp/sntp-opts.texi@1.144 +1 -1 NTP_4_2_5P157 sntp/sntp.1@1.144 +2 -2 NTP_4_2_5P157 util/ntp-keygen-opts.c@1.148 +2 -2 NTP_4_2_5P157 util/ntp-keygen-opts.h@1.148 +3 -3 NTP_4_2_5P157 util/ntp-keygen-opts.texi@1.147 +2 -2 NTP_4_2_5P157 util/ntp-keygen.1@1.147 +2 -2 NTP_4_2_5P157 ChangeSet@1.1796.1.10, 2009-01-26 02:08:57-05:00, stenn@whimsy.udel.edu Cleanup/fixes for ntp_proto.c and ntp_crypto.c from Dave Mills ChangeLog@1.268.1.10 +1 -0 Cleanup/fixes for ntp_proto.c and ntp_crypto.c from Dave Mills ntpd/ntp_crypto.c@1.128 +31 -16 Cleanup/fixes for ntp_proto.c and ntp_crypto.c from Dave Mills ntpd/ntp_proto.c@1.276.1.1 +7 -12 Cleanup/fixes for ntp_proto.c and ntp_crypto.c from Dave Mills ChangeSet@1.1796.1.9, 2009-01-19 06:56:21-05:00, stenn@whimsy.udel.edu NTP_4_2_5P156 TAG: NTP_4_2_5P156 ChangeLog@1.268.1.9 +1 -0 NTP_4_2_5P156 gsoc_sntp/sntp-opts.c@1.17 +2 -2 NTP_4_2_5P156 gsoc_sntp/sntp-opts.h@1.17 +3 -3 NTP_4_2_5P156 gsoc_sntp/sntp-opts.texi@1.17 +1 -1 NTP_4_2_5P156 gsoc_sntp/sntp.1@1.17 +2 -2 NTP_4_2_5P156 ntpd/ntpd-opts.c@1.148 +2 -2 NTP_4_2_5P156 ntpd/ntpd-opts.h@1.148 +3 -3 NTP_4_2_5P156 ntpd/ntpd-opts.texi@1.147 +1 -1 NTP_4_2_5P156 ntpd/ntpd.1@1.147 +2 -2 NTP_4_2_5P156 ntpdc/ntpdc-opts.c@1.144 +2 -2 NTP_4_2_5P156 ntpdc/ntpdc-opts.h@1.144 +3 -3 NTP_4_2_5P156 ntpdc/ntpdc-opts.texi@1.143 +1 -1 NTP_4_2_5P156 ntpdc/ntpdc.1@1.143 +2 -2 NTP_4_2_5P156 ntpq/ntpq-opts.c@1.144 +2 -2 NTP_4_2_5P156 ntpq/ntpq-opts.h@1.144 +3 -3 NTP_4_2_5P156 ntpq/ntpq-opts.texi@1.143 +1 -1 NTP_4_2_5P156 ntpq/ntpq.1@1.143 +2 -2 NTP_4_2_5P156 ntpsnmpd/ntpsnmpd-opts.c@1.25 +2 -2 NTP_4_2_5P156 ntpsnmpd/ntpsnmpd-opts.h@1.25 +3 -3 NTP_4_2_5P156 ntpsnmpd/ntpsnmpd-opts.texi@1.25 +1 -1 NTP_4_2_5P156 ntpsnmpd/ntpsnmpd.1@1.25 +2 -2 NTP_4_2_5P156 packageinfo.sh@1.159 +1 -1 NTP_4_2_5P156 sntp/sntp-opts.c@1.144 +2 -2 NTP_4_2_5P156 sntp/sntp-opts.h@1.144 +3 -3 NTP_4_2_5P156 sntp/sntp-opts.texi@1.143 +1 -1 NTP_4_2_5P156 sntp/sntp.1@1.143 +2 -2 NTP_4_2_5P156 util/ntp-keygen-opts.c@1.147 +2 -2 NTP_4_2_5P156 util/ntp-keygen-opts.h@1.147 +3 -3 NTP_4_2_5P156 util/ntp-keygen-opts.texi@1.146 +1 -1 NTP_4_2_5P156 util/ntp-keygen.1@1.146 +2 -2 NTP_4_2_5P156 ChangeSet@1.1796.3.7, 2009-01-19 03:51:58-05:00, stenn@whimsy.udel.edu [Bug 1119] [CID 52] Avoid a possible null-dereference in ntp_crypto.c ChangeLog@1.268.3.7 +1 -0 [Bug 1119] [CID 52] Avoid a possible null-dereference in ntp_crypto.c ntpd/ntp_crypto.c@1.127 +7 -7 [Bug 1119] [CID 52] Avoid a possible null-dereference in ntp_crypto.c ChangeSet@1.1796.3.6, 2009-01-19 03:41:10-05:00, stenn@whimsy.udel.edu [Bug 1120] [CID 51] INSIST that peer is non-null before we dereference it ChangeLog@1.268.3.6 +1 -0 [Bug 1120] [CID 51] INSIST that peer is non-null before we dereference it ntpd/ntp_control.c@1.107 +2 -0 [Bug 1120] [CID 51] INSIST that peer is non-null before we dereference it ChangeSet@1.1796.3.5, 2009-01-19 02:58:27-05:00, stenn@whimsy.udel.edu [Bug 1121] [CID 47] double fclose() in ntp-keygen.c ChangeLog@1.268.3.5 +1 -0 [Bug 1121] [CID 47] double fclose() in ntp-keygen.c util/ntp-keygen.c@1.53 +0 -1 [Bug 1121] [CID 47] double fclose() in ntp-keygen.c ChangeSet@1.1796.3.4, 2009-01-18 06:55:12-05:00, stenn@whimsy.udel.edu NTP_4_2_5P155 TAG: NTP_4_2_5P155 ChangeLog@1.268.3.4 +1 -0 NTP_4_2_5P155 gsoc_sntp/sntp-opts.c@1.16 +2 -2 NTP_4_2_5P155 gsoc_sntp/sntp-opts.h@1.16 +3 -3 NTP_4_2_5P155 gsoc_sntp/sntp-opts.texi@1.16 +1 -1 NTP_4_2_5P155 gsoc_sntp/sntp.1@1.16 +2 -2 NTP_4_2_5P155 ntpd/ntpd-opts.c@1.147 +2 -2 NTP_4_2_5P155 ntpd/ntpd-opts.h@1.147 +3 -3 NTP_4_2_5P155 ntpd/ntpd-opts.texi@1.146 +1 -1 NTP_4_2_5P155 ntpd/ntpd.1@1.146 +2 -2 NTP_4_2_5P155 ntpdc/ntpdc-opts.c@1.143 +2 -2 NTP_4_2_5P155 ntpdc/ntpdc-opts.h@1.143 +3 -3 NTP_4_2_5P155 ntpdc/ntpdc-opts.texi@1.142 +1 -1 NTP_4_2_5P155 ntpdc/ntpdc.1@1.142 +2 -2 NTP_4_2_5P155 ntpq/ntpq-opts.c@1.143 +2 -2 NTP_4_2_5P155 ntpq/ntpq-opts.h@1.143 +3 -3 NTP_4_2_5P155 ntpq/ntpq-opts.texi@1.142 +1 -1 NTP_4_2_5P155 ntpq/ntpq.1@1.142 +2 -2 NTP_4_2_5P155 ntpsnmpd/ntpsnmpd-opts.c@1.24 +2 -2 NTP_4_2_5P155 ntpsnmpd/ntpsnmpd-opts.h@1.24 +3 -3 NTP_4_2_5P155 ntpsnmpd/ntpsnmpd-opts.texi@1.24 +1 -1 NTP_4_2_5P155 ntpsnmpd/ntpsnmpd.1@1.24 +2 -2 NTP_4_2_5P155 packageinfo.sh@1.158 +1 -1 NTP_4_2_5P155 sntp/sntp-opts.c@1.143 +2 -2 NTP_4_2_5P155 sntp/sntp-opts.h@1.143 +3 -3 NTP_4_2_5P155 sntp/sntp-opts.texi@1.142 +1 -1 NTP_4_2_5P155 sntp/sntp.1@1.142 +2 -2 NTP_4_2_5P155 util/ntp-keygen-opts.c@1.146 +2 -2 NTP_4_2_5P155 util/ntp-keygen-opts.h@1.146 +3 -3 NTP_4_2_5P155 util/ntp-keygen-opts.texi@1.145 +1 -1 NTP_4_2_5P155 util/ntp-keygen.1@1.145 +2 -2 NTP_4_2_5P155 ChangeSet@1.1796.3.3, 2009-01-17 19:30:18-05:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.268.3.3 +1 -0 Documentation updates from Dave Mills html/assoc.html@1.27 +6 -1 Documentation updates from Dave Mills html/config.html@1.22 +19 -149 Documentation updates from Dave Mills html/decode.html@1.5 +9 -4 Documentation updates from Dave Mills html/ntpd.html@1.47 +21 -5 Documentation updates from Dave Mills ChangeSet@1.1796.3.2, 2009-01-17 19:25:33-05:00, stenn@whimsy.udel.edu CHU Frequency updates ChangeLog@1.268.3.2 +1 -0 CHU Frequency updates html/drivers/driver7.html@1.27 +11 -2 CHU Frequency updates ntpd/refclock_chu.c@1.45 +4 -4 CHU Frequency updates ChangeSet@1.1796.3.1, 2009-01-17 19:08:44-05:00, stenn@whimsy.udel.edu Design assertion fixes for ntp_crypto.c from Dave Mills ChangeLog@1.268.3.1 +1 -0 Design assertion fixes for ntp_crypto.c from Dave Mills ntpd/ntp_crypto.c@1.126 +3 -6 Design assertion fixes for ntp_crypto.c from Dave Mills ChangeSet@1.1796.1.7, 2009-01-16 15:53:26+01:00, burnicki@pogo.udel.edu Bug 1118: Fixed sign extension for 32 bit time_t in caljulian() and prettydate(). Fixed some compiler warnings about missing prototypes. Fixed some other simple compiler warnings. ChangeLog@1.268.1.7 +3 -0 Bug 1118: Fixed sign extension for 32 bit time_t in caljulian() and prettydate(). Fixed some compiler warnings about missing prototypes. Fixed some other simple compiler warnings. include/recvbuff.h@1.16 +2 -1 Added prototype for get_free_recv_buffer_alloc(). libntp/caljulian.c@1.11 +11 -2 Bug 1118: Fixed sign extension for 32 bit time_t. Added 2 casts to fix compiler warnings. libntp/prettydate.c@1.9 +10 -1 Bug 1118: Fixed sign extension for 32 bit time_t. Fixed a compiler warning. ntpd/ntp_timer.c@1.49 +4 -1 Include openssl/rand.h to have prototypes available. ChangeSet@1.1796.1.6, 2009-01-13 06:57:59-05:00, stenn@whimsy.udel.edu NTP_4_2_5P154 TAG: NTP_4_2_5P154 ChangeLog@1.268.1.6 +1 -0 NTP_4_2_5P154 gsoc_sntp/sntp-opts.c@1.15 +2 -2 NTP_4_2_5P154 gsoc_sntp/sntp-opts.h@1.15 +3 -3 NTP_4_2_5P154 gsoc_sntp/sntp-opts.texi@1.15 +1 -1 NTP_4_2_5P154 gsoc_sntp/sntp.1@1.15 +2 -2 NTP_4_2_5P154 ntpd/ntpd-opts.c@1.146 +2 -2 NTP_4_2_5P154 ntpd/ntpd-opts.h@1.146 +3 -3 NTP_4_2_5P154 ntpd/ntpd-opts.texi@1.145 +1 -1 NTP_4_2_5P154 ntpd/ntpd.1@1.145 +2 -2 NTP_4_2_5P154 ntpdc/ntpdc-opts.c@1.142 +2 -2 NTP_4_2_5P154 ntpdc/ntpdc-opts.h@1.142 +3 -3 NTP_4_2_5P154 ntpdc/ntpdc-opts.texi@1.141 +1 -1 NTP_4_2_5P154 ntpdc/ntpdc.1@1.141 +2 -2 NTP_4_2_5P154 ntpq/ntpq-opts.c@1.142 +2 -2 NTP_4_2_5P154 ntpq/ntpq-opts.h@1.142 +3 -3 NTP_4_2_5P154 ntpq/ntpq-opts.texi@1.141 +1 -1 NTP_4_2_5P154 ntpq/ntpq.1@1.141 +2 -2 NTP_4_2_5P154 ntpsnmpd/ntpsnmpd-opts.c@1.23 +2 -2 NTP_4_2_5P154 ntpsnmpd/ntpsnmpd-opts.h@1.23 +3 -3 NTP_4_2_5P154 ntpsnmpd/ntpsnmpd-opts.texi@1.23 +1 -1 NTP_4_2_5P154 ntpsnmpd/ntpsnmpd.1@1.23 +2 -2 NTP_4_2_5P154 packageinfo.sh@1.157 +1 -1 NTP_4_2_5P154 sntp/sntp-opts.c@1.142 +2 -2 NTP_4_2_5P154 sntp/sntp-opts.h@1.142 +3 -3 NTP_4_2_5P154 sntp/sntp-opts.texi@1.141 +1 -1 NTP_4_2_5P154 sntp/sntp.1@1.141 +2 -2 NTP_4_2_5P154 util/ntp-keygen-opts.c@1.145 +2 -2 NTP_4_2_5P154 util/ntp-keygen-opts.h@1.145 +3 -3 NTP_4_2_5P154 util/ntp-keygen-opts.texi@1.144 +1 -1 NTP_4_2_5P154 util/ntp-keygen.1@1.144 +2 -2 NTP_4_2_5P154 ChangeSet@1.1796.1.5, 2009-01-11 16:53:36+00:00, kardel@pogo.udel.edu ChangeLog: bug 992 - support interface event change on Linux configure.ac, ntp_io.c: support interface event change on Linux ChangeLog@1.268.1.5 +2 -0 bug 992 - support interface event change on Linux configure.ac@1.422 +13 -1 support interface event change on Linux ntpd/ntp_io.c@1.275 +55 -13 support interface event change on Linux ChangeSet@1.1796.1.4, 2009-01-09 07:20:22-05:00, stenn@whimsy.udel.edu NTP_4_2_5P153 TAG: NTP_4_2_5P153 ChangeLog@1.268.1.4 +1 -0 NTP_4_2_5P153 gsoc_sntp/sntp-opts.c@1.14 +2 -2 NTP_4_2_5P153 gsoc_sntp/sntp-opts.h@1.14 +3 -3 NTP_4_2_5P153 gsoc_sntp/sntp-opts.texi@1.14 +1 -1 NTP_4_2_5P153 gsoc_sntp/sntp.1@1.14 +2 -2 NTP_4_2_5P153 ntpd/ntpd-opts.c@1.145 +2 -2 NTP_4_2_5P153 ntpd/ntpd-opts.h@1.145 +3 -3 NTP_4_2_5P153 ntpd/ntpd-opts.texi@1.144 +1 -1 NTP_4_2_5P153 ntpd/ntpd.1@1.144 +2 -2 NTP_4_2_5P153 ntpdc/ntpdc-opts.c@1.141 +2 -2 NTP_4_2_5P153 ntpdc/ntpdc-opts.h@1.141 +3 -3 NTP_4_2_5P153 ntpdc/ntpdc-opts.texi@1.140 +1 -1 NTP_4_2_5P153 ntpdc/ntpdc.1@1.140 +2 -2 NTP_4_2_5P153 ntpq/ntpq-opts.c@1.141 +2 -2 NTP_4_2_5P153 ntpq/ntpq-opts.h@1.141 +3 -3 NTP_4_2_5P153 ntpq/ntpq-opts.texi@1.140 +1 -1 NTP_4_2_5P153 ntpq/ntpq.1@1.140 +2 -2 NTP_4_2_5P153 ntpsnmpd/ntpsnmpd-opts.c@1.22 +2 -2 NTP_4_2_5P153 ntpsnmpd/ntpsnmpd-opts.h@1.22 +3 -3 NTP_4_2_5P153 ntpsnmpd/ntpsnmpd-opts.texi@1.22 +1 -1 NTP_4_2_5P153 ntpsnmpd/ntpsnmpd.1@1.22 +2 -2 NTP_4_2_5P153 packageinfo.sh@1.156 +1 -1 NTP_4_2_5P153 sntp/sntp-opts.c@1.141 +2 -2 NTP_4_2_5P153 sntp/sntp-opts.h@1.141 +3 -3 NTP_4_2_5P153 sntp/sntp-opts.texi@1.140 +1 -1 NTP_4_2_5P153 sntp/sntp.1@1.140 +2 -2 NTP_4_2_5P153 util/ntp-keygen-opts.c@1.144 +2 -2 NTP_4_2_5P153 util/ntp-keygen-opts.h@1.144 +3 -3 NTP_4_2_5P153 util/ntp-keygen-opts.texi@1.143 +1 -1 NTP_4_2_5P153 util/ntp-keygen.1@1.143 +2 -2 NTP_4_2_5P153 ChangeSet@1.1796.2.3, 2009-01-08 09:46:10-05:00, stenn@whimsy.udel.edu NTP_4_2_5P152 TAG: NTP_4_2_5P152 ChangeLog@1.268.2.2 +1 -0 NTP_4_2_5P152 gsoc_sntp/sntp-opts.c@1.13 +2 -2 NTP_4_2_5P152 gsoc_sntp/sntp-opts.h@1.13 +3 -3 NTP_4_2_5P152 gsoc_sntp/sntp-opts.texi@1.13 +1 -1 NTP_4_2_5P152 gsoc_sntp/sntp.1@1.13 +2 -2 NTP_4_2_5P152 ntpd/ntpd-opts.c@1.144 +2 -2 NTP_4_2_5P152 ntpd/ntpd-opts.h@1.144 +3 -3 NTP_4_2_5P152 ntpd/ntpd-opts.texi@1.143 +1 -1 NTP_4_2_5P152 ntpd/ntpd.1@1.143 +2 -2 NTP_4_2_5P152 ntpdc/ntpdc-opts.c@1.140 +2 -2 NTP_4_2_5P152 ntpdc/ntpdc-opts.h@1.140 +3 -3 NTP_4_2_5P152 ntpdc/ntpdc-opts.texi@1.139 +1 -1 NTP_4_2_5P152 ntpdc/ntpdc.1@1.139 +2 -2 NTP_4_2_5P152 ntpq/ntpq-opts.c@1.140 +2 -2 NTP_4_2_5P152 ntpq/ntpq-opts.h@1.140 +3 -3 NTP_4_2_5P152 ntpq/ntpq-opts.texi@1.139 +1 -1 NTP_4_2_5P152 ntpq/ntpq.1@1.139 +2 -2 NTP_4_2_5P152 ntpsnmpd/ntpsnmpd-opts.c@1.21 +2 -2 NTP_4_2_5P152 ntpsnmpd/ntpsnmpd-opts.h@1.21 +3 -3 NTP_4_2_5P152 ntpsnmpd/ntpsnmpd-opts.texi@1.21 +1 -1 NTP_4_2_5P152 ntpsnmpd/ntpsnmpd.1@1.21 +2 -2 NTP_4_2_5P152 packageinfo.sh@1.155 +1 -1 NTP_4_2_5P152 sntp/sntp-opts.c@1.140 +2 -2 NTP_4_2_5P152 sntp/sntp-opts.h@1.140 +3 -3 NTP_4_2_5P152 sntp/sntp-opts.texi@1.139 +1 -1 NTP_4_2_5P152 sntp/sntp.1@1.139 +2 -2 NTP_4_2_5P152 util/ntp-keygen-opts.c@1.143 +2 -2 NTP_4_2_5P152 util/ntp-keygen-opts.h@1.143 +3 -3 NTP_4_2_5P152 util/ntp-keygen-opts.texi@1.142 +1 -1 NTP_4_2_5P152 util/ntp-keygen.1@1.142 +2 -2 NTP_4_2_5P152 ChangeSet@1.1796.2.2, 2009-01-08 08:07:59-05:00, stenn@whimsy.udel.edu merge cleanup ntpd/ntp_crypto.c@1.125 +1 -1 merge cleanup ChangeSet@1.1436.15.12, 2009-01-08 06:21:48-05:00, stenn@whimsy.udel.edu NTP_4_2_4P6 TAG: NTP_4_2_4P6 ChangeLog@1.1.1.49 +1 -2 NTP_4_2_4P6 ntpd/ntpd-opts.c@1.50.17.2 +2 -2 NTP_4_2_4P6 ntpd/ntpd-opts.h@1.50.17.2 +3 -3 NTP_4_2_4P6 ntpd/ntpd-opts.texi@1.49.17.2 +1 -1 NTP_4_2_4P6 ntpd/ntpd.1@1.48.17.2 +2 -2 NTP_4_2_4P6 ntpd/ntpdsim-opts.c@1.50.17.2 +2 -2 NTP_4_2_4P6 ntpd/ntpdsim-opts.h@1.50.17.2 +3 -3 NTP_4_2_4P6 ntpd/ntpdsim-opts.texi@1.48.17.2 +1 -1 NTP_4_2_4P6 ntpd/ntpdsim.1@1.48.17.2 +2 -2 NTP_4_2_4P6 ntpdc/ntpdc-opts.c@1.50.17.2 +2 -2 NTP_4_2_4P6 ntpdc/ntpdc-opts.h@1.50.17.2 +3 -3 NTP_4_2_4P6 ntpdc/ntpdc-opts.texi@1.48.17.2 +1 -1 NTP_4_2_4P6 ntpdc/ntpdc.1@1.48.17.2 +2 -2 NTP_4_2_4P6 ntpq/ntpq-opts.c@1.52.17.2 +2 -2 NTP_4_2_4P6 ntpq/ntpq-opts.h@1.52.17.2 +3 -3 NTP_4_2_4P6 ntpq/ntpq-opts.texi@1.49.17.2 +1 -1 NTP_4_2_4P6 ntpq/ntpq.1@1.48.17.2 +2 -2 NTP_4_2_4P6 packageinfo.sh@1.65.24.4 +1 -1 NTP_4_2_4P6 sntp/sntp-opts.c@1.49.17.2 +2 -2 NTP_4_2_4P6 sntp/sntp-opts.h@1.49.17.2 +3 -3 NTP_4_2_4P6 sntp/sntp-opts.texi@1.46.17.2 +1 -1 NTP_4_2_4P6 sntp/sntp.1@1.49.17.2 +2 -2 NTP_4_2_4P6 util/ntp-keygen-opts.c@1.49.17.2 +2 -2 NTP_4_2_4P6 util/ntp-keygen-opts.h@1.49.17.2 +3 -3 NTP_4_2_4P6 util/ntp-keygen-opts.texi@1.47.17.2 +1 -1 NTP_4_2_4P6 util/ntp-keygen.1@1.47.17.2 +2 -2 NTP_4_2_4P6 ChangeSet@1.1436.15.11, 2009-01-08 04:49:23-05:00, stenn@whimsy.udel.edu NTP_4_2_4P5 TAG: NTP_4_2_4P5 ChangeLog@1.1.1.48 +1 -0 NTP_4_2_4P5 ntpd/ntpd-opts.c@1.50.17.1 +1 -1 NTP_4_2_4P5 ntpd/ntpd-opts.h@1.50.17.1 +1 -1 NTP_4_2_4P5 ntpd/ntpd-opts.texi@1.49.17.1 +2 -2 NTP_4_2_4P5 ntpd/ntpd.1@1.48.17.1 +2 -2 NTP_4_2_4P5 ntpd/ntpdsim-opts.c@1.50.17.1 +1 -1 NTP_4_2_4P5 ntpd/ntpdsim-opts.h@1.50.17.1 +1 -1 NTP_4_2_4P5 ntpd/ntpdsim-opts.texi@1.48.17.1 +1 -1 NTP_4_2_4P5 ntpd/ntpdsim.1@1.48.17.1 +2 -2 NTP_4_2_4P5 ntpdc/ntpdc-opts.c@1.50.17.1 +1 -1 NTP_4_2_4P5 ntpdc/ntpdc-opts.h@1.50.17.1 +1 -1 NTP_4_2_4P5 ntpdc/ntpdc-opts.texi@1.48.17.1 +2 -2 NTP_4_2_4P5 ntpdc/ntpdc.1@1.48.17.1 +2 -2 NTP_4_2_4P5 ntpq/ntpq-opts.c@1.52.17.1 +1 -1 NTP_4_2_4P5 ntpq/ntpq-opts.h@1.52.17.1 +1 -1 NTP_4_2_4P5 ntpq/ntpq-opts.texi@1.49.17.1 +2 -2 NTP_4_2_4P5 ntpq/ntpq.1@1.48.17.1 +2 -2 NTP_4_2_4P5 packageinfo.sh@1.65.24.3 +2 -2 NTP_4_2_4P5 sntp/sntp-opts.c@1.49.17.1 +1 -1 NTP_4_2_4P5 sntp/sntp-opts.h@1.49.17.1 +1 -1 NTP_4_2_4P5 sntp/sntp-opts.texi@1.46.17.1 +1 -1 NTP_4_2_4P5 sntp/sntp.1@1.49.17.1 +2 -2 NTP_4_2_4P5 util/ntp-keygen-opts.c@1.49.17.1 +1 -1 NTP_4_2_4P5 util/ntp-keygen-opts.h@1.49.17.1 +1 -1 NTP_4_2_4P5 util/ntp-keygen-opts.texi@1.47.17.1 +2 -2 NTP_4_2_4P5 util/ntp-keygen.1@1.47.17.1 +2 -2 NTP_4_2_4P5 ChangeSet@1.1436.15.10, 2009-01-08 03:21:09-05:00, stenn@whimsy.udel.edu 4.2.4p6 packageinfo.sh@1.65.24.2 +1 -1 4.2.4p6 ChangeSet@1.1436.15.9, 2009-01-08 03:14:17-05:00, stenn@whimsy.udel.edu merge cleanup ChangeLog@1.1.1.47 +1 -1 merge cleanup ChangeSet@1.1436.16.1, 2009-01-08 02:57:52-05:00, stenn@whimsy.udel.edu 4.2.4p6 ChangeLog@1.1.1.45 +6 -0 Fix incorrect check of EVP_VerifyFinal()'s return value. NEWS@1.86.1.14 +16 -0 4.2.4p6 html/copyright.html@1.36.1.2 +1 -1 Update the copyright year ntpd/ntp_crypto.c@1.107.1.1 +1 -1 Fix incorrect check of EVP_VerifyFinal()'s return value. packageinfo.sh@1.65.24.1 +1 -1 4.2.4p6 ChangeSet@1.1436.15.7, 2009-01-07 18:00:50+01:00, burnicki@pogo.udel.edu [BUG 1113] Fixed build errors with recent versions of openSSL. ChangeLog@1.1.11.1 +1 -0 [BUG 1113] Fixed build errors with recent versions of openSSL. ntpd/ntp_crypto.c@1.107.2.1 +2 -2 [BUG 1113] Fixed build errors with recent versions of openSSL. ChangeSet@1.1796.1.2, 2009-01-07 15:18:18+01:00, burnicki@pogo.udel.edu Renamed gsoc_sntp/:fetch-stubs to gsoc_sntp/fetch-stubs to avoid file name problems under Windows. Removed German umlaut from log msg for 4.2.5p142. ChangeLog@1.268.1.2 +4 -1 Renamed gsoc_sntp/:fetch-stubs to gsoc_sntp/fetch-stubs to avoid file name problems under Windows. Removed German umlaut from log msg for 4.2.5p142. gsoc_sntp/fetch-stubs@1.5 +0 -0 Rename: gsoc_sntp/:fetch-stubs -> gsoc_sntp/fetch-stubs ChangeSet@1.1796.1.1, 2008-12-23 06:53:33-05:00, stenn@whimsy.udel.edu NTP_4_2_5P151 TAG: NTP_4_2_5P151 ChangeLog@1.268.1.1 +1 -0 NTP_4_2_5P151 gsoc_sntp/sntp-opts.c@1.12 +2 -2 NTP_4_2_5P151 gsoc_sntp/sntp-opts.h@1.12 +3 -3 NTP_4_2_5P151 gsoc_sntp/sntp-opts.texi@1.12 +1 -1 NTP_4_2_5P151 gsoc_sntp/sntp.1@1.12 +2 -2 NTP_4_2_5P151 ntpd/ntpd-opts.c@1.143 +2 -2 NTP_4_2_5P151 ntpd/ntpd-opts.h@1.143 +3 -3 NTP_4_2_5P151 ntpd/ntpd-opts.texi@1.142 +1 -1 NTP_4_2_5P151 ntpd/ntpd.1@1.142 +2 -2 NTP_4_2_5P151 ntpdc/ntpdc-opts.c@1.139 +2 -2 NTP_4_2_5P151 ntpdc/ntpdc-opts.h@1.139 +3 -3 NTP_4_2_5P151 ntpdc/ntpdc-opts.texi@1.138 +1 -1 NTP_4_2_5P151 ntpdc/ntpdc.1@1.138 +2 -2 NTP_4_2_5P151 ntpq/ntpq-opts.c@1.139 +2 -2 NTP_4_2_5P151 ntpq/ntpq-opts.h@1.139 +3 -3 NTP_4_2_5P151 ntpq/ntpq-opts.texi@1.138 +1 -1 NTP_4_2_5P151 ntpq/ntpq.1@1.138 +2 -2 NTP_4_2_5P151 ntpsnmpd/ntpsnmpd-opts.c@1.20 +2 -2 NTP_4_2_5P151 ntpsnmpd/ntpsnmpd-opts.h@1.20 +3 -3 NTP_4_2_5P151 ntpsnmpd/ntpsnmpd-opts.texi@1.20 +1 -1 NTP_4_2_5P151 ntpsnmpd/ntpsnmpd.1@1.20 +2 -2 NTP_4_2_5P151 packageinfo.sh@1.154 +1 -1 NTP_4_2_5P151 sntp/sntp-opts.c@1.139 +2 -2 NTP_4_2_5P151 sntp/sntp-opts.h@1.139 +3 -3 NTP_4_2_5P151 sntp/sntp-opts.texi@1.138 +1 -1 NTP_4_2_5P151 sntp/sntp.1@1.138 +2 -2 NTP_4_2_5P151 util/ntp-keygen-opts.c@1.142 +2 -2 NTP_4_2_5P151 util/ntp-keygen-opts.h@1.142 +3 -3 NTP_4_2_5P151 util/ntp-keygen-opts.texi@1.141 +1 -1 NTP_4_2_5P151 util/ntp-keygen.1@1.141 +2 -2 NTP_4_2_5P151 ChangeSet@1.1795.1.1, 2008-12-23 04:34:32-05:00, stenn@whimsy.udel.edu [Bug 1028] Support for W32Time authentication via Samba ChangeLog@1.267.1.1 +1 -0 [Bug 1028] Support for W32Time authentication via Samba include/ntp.h@1.149 +1 -0 [Bug 1028] Support for W32Time authentication via Samba include/ntp_config.h@1.48 +1 -0 [Bug 1028] Support for W32Time authentication via Samba include/ntpd.h@1.119 +14 -0 [Bug 1028] Support for W32Time authentication via Samba ntpd/Makefile.am@1.66 +1 -1 [Bug 1028] Support for W32Time authentication via Samba ntpd/ntp_config.c@1.185 +11 -0 [Bug 1028] Support for W32Time authentication via Samba ntpd/ntp_parser.c@1.32 +908 -889 [Bug 1028] Support for W32Time authentication via Samba ntpd/ntp_parser.h@1.16 +123 -121 [Bug 1028] Support for W32Time authentication via Samba ntpd/ntp_parser.y@1.26 +3 -0 [Bug 1028] Support for W32Time authentication via Samba ntpd/ntp_proto.c@1.277 +53 -11 [Bug 1028] Support for W32Time authentication via Samba ntpd/ntp_signd.c@1.1 +242 -0 BitKeeper file /deacon/backroom/ntp-dev-samba/ntpd/ntp_signd.c ntpd/ntp_signd.c@1.0 +0 -0 ChangeSet@1.1796, 2008-12-23 02:59:12-05:00, stenn@whimsy.udel.edu Stats file logging cleanup from Dave Mills ChangeLog@1.268 +1 -0 Stats file logging cleanup from Dave Mills ntpd/ntp_control.c@1.106 +31 -13 Stats file logging cleanup from Dave Mills ChangeSet@1.1795, 2008-12-15 06:54:36-05:00, stenn@whimsy.udel.edu NTP_4_2_5P150 TAG: NTP_4_2_5P150 ChangeLog@1.267 +1 -0 NTP_4_2_5P150 gsoc_sntp/sntp-opts.c@1.11 +2 -2 NTP_4_2_5P150 gsoc_sntp/sntp-opts.h@1.11 +3 -3 NTP_4_2_5P150 gsoc_sntp/sntp-opts.texi@1.11 +1 -1 NTP_4_2_5P150 gsoc_sntp/sntp.1@1.11 +2 -2 NTP_4_2_5P150 ntpd/ntpd-opts.c@1.142 +2 -2 NTP_4_2_5P150 ntpd/ntpd-opts.h@1.142 +3 -3 NTP_4_2_5P150 ntpd/ntpd-opts.texi@1.141 +1 -1 NTP_4_2_5P150 ntpd/ntpd.1@1.141 +2 -2 NTP_4_2_5P150 ntpdc/ntpdc-opts.c@1.138 +2 -2 NTP_4_2_5P150 ntpdc/ntpdc-opts.h@1.138 +3 -3 NTP_4_2_5P150 ntpdc/ntpdc-opts.texi@1.137 +1 -1 NTP_4_2_5P150 ntpdc/ntpdc.1@1.137 +2 -2 NTP_4_2_5P150 ntpq/ntpq-opts.c@1.138 +2 -2 NTP_4_2_5P150 ntpq/ntpq-opts.h@1.138 +3 -3 NTP_4_2_5P150 ntpq/ntpq-opts.texi@1.137 +1 -1 NTP_4_2_5P150 ntpq/ntpq.1@1.137 +2 -2 NTP_4_2_5P150 ntpsnmpd/ntpsnmpd-opts.c@1.19 +2 -2 NTP_4_2_5P150 ntpsnmpd/ntpsnmpd-opts.h@1.19 +3 -3 NTP_4_2_5P150 ntpsnmpd/ntpsnmpd-opts.texi@1.19 +1 -1 NTP_4_2_5P150 ntpsnmpd/ntpsnmpd.1@1.19 +2 -2 NTP_4_2_5P150 packageinfo.sh@1.153 +1 -1 NTP_4_2_5P150 sntp/sntp-opts.c@1.138 +2 -2 NTP_4_2_5P150 sntp/sntp-opts.h@1.138 +3 -3 NTP_4_2_5P150 sntp/sntp-opts.texi@1.137 +1 -1 NTP_4_2_5P150 sntp/sntp.1@1.137 +2 -2 NTP_4_2_5P150 util/ntp-keygen-opts.c@1.141 +2 -2 NTP_4_2_5P150 util/ntp-keygen-opts.h@1.141 +3 -3 NTP_4_2_5P150 util/ntp-keygen-opts.texi@1.140 +1 -1 NTP_4_2_5P150 util/ntp-keygen.1@1.140 +2 -2 NTP_4_2_5P150 ChangeSet@1.1791.1.3, 2008-12-15 04:12:45-05:00, stenn@pogo.udel.edu [Bug 1103] Fix 64-bit issues in the new calendar code ChangeLog@1.264.1.9 +1 -1 [Bug 1103] Fix 64-bit issues in the new calendar code ChangeSet@1.1791.2.11, 2008-12-05 07:13:56-05:00, stenn@whimsy.udel.edu NTP_4_2_5P149 TAG: NTP_4_2_5P149 ChangeLog@1.264.1.8 +1 -0 NTP_4_2_5P149 gsoc_sntp/sntp-opts.c@1.10 +2 -2 NTP_4_2_5P149 gsoc_sntp/sntp-opts.h@1.10 +3 -3 NTP_4_2_5P149 gsoc_sntp/sntp-opts.texi@1.10 +1 -1 NTP_4_2_5P149 gsoc_sntp/sntp.1@1.10 +2 -2 NTP_4_2_5P149 ntpd/ntpd-opts.c@1.141 +2 -2 NTP_4_2_5P149 ntpd/ntpd-opts.h@1.141 +3 -3 NTP_4_2_5P149 ntpd/ntpd-opts.texi@1.140 +1 -1 NTP_4_2_5P149 ntpd/ntpd.1@1.140 +2 -2 NTP_4_2_5P149 ntpdc/ntpdc-opts.c@1.137 +2 -2 NTP_4_2_5P149 ntpdc/ntpdc-opts.h@1.137 +3 -3 NTP_4_2_5P149 ntpdc/ntpdc-opts.texi@1.136 +1 -1 NTP_4_2_5P149 ntpdc/ntpdc.1@1.136 +2 -2 NTP_4_2_5P149 ntpq/ntpq-opts.c@1.137 +2 -2 NTP_4_2_5P149 ntpq/ntpq-opts.h@1.137 +3 -3 NTP_4_2_5P149 ntpq/ntpq-opts.texi@1.136 +1 -1 NTP_4_2_5P149 ntpq/ntpq.1@1.136 +2 -2 NTP_4_2_5P149 ntpsnmpd/ntpsnmpd-opts.c@1.18 +2 -2 NTP_4_2_5P149 ntpsnmpd/ntpsnmpd-opts.h@1.18 +3 -3 NTP_4_2_5P149 ntpsnmpd/ntpsnmpd-opts.texi@1.18 +1 -1 NTP_4_2_5P149 ntpsnmpd/ntpsnmpd.1@1.18 +2 -2 NTP_4_2_5P149 packageinfo.sh@1.152 +1 -1 NTP_4_2_5P149 sntp/sntp-opts.c@1.137 +2 -2 NTP_4_2_5P149 sntp/sntp-opts.h@1.137 +3 -3 NTP_4_2_5P149 sntp/sntp-opts.texi@1.136 +1 -1 NTP_4_2_5P149 sntp/sntp.1@1.136 +2 -2 NTP_4_2_5P149 util/ntp-keygen-opts.c@1.140 +2 -2 NTP_4_2_5P149 util/ntp-keygen-opts.h@1.140 +3 -3 NTP_4_2_5P149 util/ntp-keygen-opts.texi@1.139 +1 -1 NTP_4_2_5P149 util/ntp-keygen.1@1.139 +2 -2 NTP_4_2_5P149 ChangeSet@1.1791.2.10, 2008-12-05 05:48:37-05:00, stenn@pogo.udel.edu Distribute ntpv4-mib.mib ntpsnmpd/Makefile.am@1.7 +4 -2 Distribute ntpv4-mib.mib ChangeSet@1.1791.2.9, 2008-12-05 11:23:22+01:00, gerstung@pogo.udel.edu * changelog comments added for changes regarding ntpSnmpSubAgent.c and ntpv4-mib.mib ChangeLog@1.264.1.7 +3 -0 * changelog comments added for changes regarding ntpSnmpSubAgent.c and ntpv4-mib.mib ChangeSet@1.1791.2.8, 2008-12-05 11:13:33+01:00, gerstung@pogo.udel.edu * fixed two wrong data types * fixed wrong OID definitions * added preliminaray and unofficial MIB for TESTING PURPOSES ONLY ntpsnmpd/ntpSnmpSubagentObject.c@1.3 +16 -17 * fixed two wrong data types * fixed wrong OID definitions ntpsnmpd/ntpv4-mib.mib@1.1 +1005 -0 * added for testing purposes --- DO NOT USE IN PRODUCTIVE ENVIRONMENTS --- this MIB file will change as soon as the NTPv4 MIB RFC has been approved and the required OID has been registered with IANA ntpsnmpd/ntpv4-mib.mib@1.0 +0 -0 ChangeSet@1.1791.2.7, 2008-12-04 06:53:18-05:00, stenn@whimsy.udel.edu NTP_4_2_5P148 TAG: NTP_4_2_5P148 ChangeLog@1.264.1.6 +1 -0 NTP_4_2_5P148 gsoc_sntp/sntp-opts.c@1.9 +2 -2 NTP_4_2_5P148 gsoc_sntp/sntp-opts.h@1.9 +3 -3 NTP_4_2_5P148 gsoc_sntp/sntp-opts.texi@1.9 +1 -1 NTP_4_2_5P148 gsoc_sntp/sntp.1@1.9 +2 -2 NTP_4_2_5P148 ntpd/ntpd-opts.c@1.140 +2 -2 NTP_4_2_5P148 ntpd/ntpd-opts.h@1.140 +3 -3 NTP_4_2_5P148 ntpd/ntpd-opts.texi@1.139 +1 -1 NTP_4_2_5P148 ntpd/ntpd.1@1.139 +2 -2 NTP_4_2_5P148 ntpdc/ntpdc-opts.c@1.136 +2 -2 NTP_4_2_5P148 ntpdc/ntpdc-opts.h@1.136 +3 -3 NTP_4_2_5P148 ntpdc/ntpdc-opts.texi@1.135 +1 -1 NTP_4_2_5P148 ntpdc/ntpdc.1@1.135 +2 -2 NTP_4_2_5P148 ntpq/ntpq-opts.c@1.136 +2 -2 NTP_4_2_5P148 ntpq/ntpq-opts.h@1.136 +3 -3 NTP_4_2_5P148 ntpq/ntpq-opts.texi@1.135 +1 -1 NTP_4_2_5P148 ntpq/ntpq.1@1.135 +2 -2 NTP_4_2_5P148 ntpsnmpd/ntpsnmpd-opts.c@1.17 +2 -2 NTP_4_2_5P148 ntpsnmpd/ntpsnmpd-opts.h@1.17 +3 -3 NTP_4_2_5P148 ntpsnmpd/ntpsnmpd-opts.texi@1.17 +1 -1 NTP_4_2_5P148 ntpsnmpd/ntpsnmpd.1@1.17 +2 -2 NTP_4_2_5P148 packageinfo.sh@1.151 +1 -1 NTP_4_2_5P148 sntp/sntp-opts.c@1.136 +2 -2 NTP_4_2_5P148 sntp/sntp-opts.h@1.136 +3 -3 NTP_4_2_5P148 sntp/sntp-opts.texi@1.135 +1 -1 NTP_4_2_5P148 sntp/sntp.1@1.135 +2 -2 NTP_4_2_5P148 util/ntp-keygen-opts.c@1.139 +2 -2 NTP_4_2_5P148 util/ntp-keygen-opts.h@1.139 +3 -3 NTP_4_2_5P148 util/ntp-keygen-opts.texi@1.138 +1 -1 NTP_4_2_5P148 util/ntp-keygen.1@1.138 +2 -2 NTP_4_2_5P148 ChangeSet@1.1791.2.6, 2008-12-04 03:33:40-05:00, stenn@pogo.udel.edu [Bug 1070] Fix use of ntpq_parsestring() in ntpsnmpd ChangeLog@1.264.1.5 +1 -0 [Bug 1070] Fix use of ntpq_parsestring() in ntpsnmpd ChangeSet@1.1791.2.5, 2008-12-04 09:08:53+01:00, gerstung@pogo.udel.edu * bug 1070 fixed (call to undefined function ntpq_parsestring) * added new string handler functions for dealing with ntpd responses * fixed handling of SoftwareName entity (unreachable code) * added function prototypes to reduce/remove compiler warnings ntpsnmpd/ntpSnmpSubagentObject.c@1.2 +224 -8 * bug 1070 fixed (call to undefined function ntpq_parsestring) * added new string handler functions for dealing with ntpd responses * fixed handling of SoftwareName entity (unreachable code) ntpsnmpd/ntpSnmpSubagentObject.h@1.2 +4 -1 * added function prototypes to avoid compiler warnings ChangeSet@1.1791.2.4, 2008-11-27 06:54:28-05:00, stenn@whimsy.udel.edu NTP_4_2_5P147 TAG: NTP_4_2_5P147 ChangeLog@1.264.1.4 +1 -0 NTP_4_2_5P147 gsoc_sntp/sntp-opts.c@1.8 +2 -2 NTP_4_2_5P147 gsoc_sntp/sntp-opts.h@1.8 +3 -3 NTP_4_2_5P147 gsoc_sntp/sntp-opts.texi@1.8 +1 -1 NTP_4_2_5P147 gsoc_sntp/sntp.1@1.8 +2 -2 NTP_4_2_5P147 ntpd/ntpd-opts.c@1.139 +2 -2 NTP_4_2_5P147 ntpd/ntpd-opts.h@1.139 +3 -3 NTP_4_2_5P147 ntpd/ntpd-opts.texi@1.138 +1 -1 NTP_4_2_5P147 ntpd/ntpd.1@1.138 +2 -2 NTP_4_2_5P147 ntpdc/ntpdc-opts.c@1.135 +2 -2 NTP_4_2_5P147 ntpdc/ntpdc-opts.h@1.135 +3 -3 NTP_4_2_5P147 ntpdc/ntpdc-opts.texi@1.134 +1 -1 NTP_4_2_5P147 ntpdc/ntpdc.1@1.134 +2 -2 NTP_4_2_5P147 ntpq/ntpq-opts.c@1.135 +2 -2 NTP_4_2_5P147 ntpq/ntpq-opts.h@1.135 +3 -3 NTP_4_2_5P147 ntpq/ntpq-opts.texi@1.134 +1 -1 NTP_4_2_5P147 ntpq/ntpq.1@1.134 +2 -2 NTP_4_2_5P147 ntpsnmpd/ntpsnmpd-opts.c@1.16 +2 -2 NTP_4_2_5P147 ntpsnmpd/ntpsnmpd-opts.h@1.16 +3 -3 NTP_4_2_5P147 ntpsnmpd/ntpsnmpd-opts.texi@1.16 +1 -1 NTP_4_2_5P147 ntpsnmpd/ntpsnmpd.1@1.16 +2 -2 NTP_4_2_5P147 packageinfo.sh@1.150 +1 -1 NTP_4_2_5P147 sntp/sntp-opts.c@1.135 +2 -2 NTP_4_2_5P147 sntp/sntp-opts.h@1.135 +3 -3 NTP_4_2_5P147 sntp/sntp-opts.texi@1.134 +1 -1 NTP_4_2_5P147 sntp/sntp.1@1.134 +2 -2 NTP_4_2_5P147 util/ntp-keygen-opts.c@1.138 +2 -2 NTP_4_2_5P147 util/ntp-keygen-opts.h@1.138 +3 -3 NTP_4_2_5P147 util/ntp-keygen-opts.texi@1.137 +1 -1 NTP_4_2_5P147 util/ntp-keygen.1@1.137 +2 -2 NTP_4_2_5P147 ChangeSet@1.1791.2.3, 2008-11-27 02:56:55-05:00, stenn@whimsy.udel.edu Update gsoc_sntp's GCC warning code ChangeLog@1.264.1.3 +1 -0 Update gsoc_sntp's GCC warning code gsoc_sntp/Makefile.am@1.6 +2 -2 Update gsoc_sntp's GCC warning code gsoc_sntp/configure.ac@1.10 +21 -0 Update gsoc_sntp's GCC warning code ChangeSet@1.1791.2.2, 2008-11-26 07:09:34-05:00, stenn@whimsy.udel.edu NTP_4_2_5P146 TAG: NTP_4_2_5P146 ChangeLog@1.264.1.2 +1 -0 NTP_4_2_5P146 gsoc_sntp/sntp-opts.c@1.7 +2 -2 NTP_4_2_5P146 gsoc_sntp/sntp-opts.h@1.7 +3 -3 NTP_4_2_5P146 gsoc_sntp/sntp-opts.texi@1.7 +1 -1 NTP_4_2_5P146 gsoc_sntp/sntp.1@1.7 +2 -2 NTP_4_2_5P146 ntpd/ntpd-opts.c@1.138 +2 -2 NTP_4_2_5P146 ntpd/ntpd-opts.h@1.138 +3 -3 NTP_4_2_5P146 ntpd/ntpd-opts.texi@1.137 +1 -1 NTP_4_2_5P146 ntpd/ntpd.1@1.137 +2 -2 NTP_4_2_5P146 ntpdc/ntpdc-opts.c@1.134 +2 -2 NTP_4_2_5P146 ntpdc/ntpdc-opts.h@1.134 +3 -3 NTP_4_2_5P146 ntpdc/ntpdc-opts.texi@1.133 +1 -1 NTP_4_2_5P146 ntpdc/ntpdc.1@1.133 +2 -2 NTP_4_2_5P146 ntpq/ntpq-opts.c@1.134 +2 -2 NTP_4_2_5P146 ntpq/ntpq-opts.h@1.134 +3 -3 NTP_4_2_5P146 ntpq/ntpq-opts.texi@1.133 +1 -1 NTP_4_2_5P146 ntpq/ntpq.1@1.133 +2 -2 NTP_4_2_5P146 ntpsnmpd/ntpsnmpd-opts.c@1.15 +2 -2 NTP_4_2_5P146 ntpsnmpd/ntpsnmpd-opts.h@1.15 +3 -3 NTP_4_2_5P146 ntpsnmpd/ntpsnmpd-opts.texi@1.15 +1 -1 NTP_4_2_5P146 ntpsnmpd/ntpsnmpd.1@1.15 +2 -2 NTP_4_2_5P146 packageinfo.sh@1.149 +1 -1 NTP_4_2_5P146 sntp/sntp-opts.c@1.134 +2 -2 NTP_4_2_5P146 sntp/sntp-opts.h@1.134 +3 -3 NTP_4_2_5P146 sntp/sntp-opts.texi@1.133 +1 -1 NTP_4_2_5P146 sntp/sntp.1@1.133 +2 -2 NTP_4_2_5P146 util/ntp-keygen-opts.c@1.137 +2 -2 NTP_4_2_5P146 util/ntp-keygen-opts.h@1.137 +3 -3 NTP_4_2_5P146 util/ntp-keygen-opts.texi@1.136 +1 -1 NTP_4_2_5P146 util/ntp-keygen.1@1.136 +2 -2 NTP_4_2_5P146 ChangeSet@1.1791.2.1, 2008-11-26 06:02:22-05:00, stenn@whimsy.udel.edu Update Solaris CFLAGS for gsoc_sntp ChangeLog@1.264.1.1 +1 -0 Update Solaris CFLAGS for gsoc_sntp gsoc_sntp/configure.ac@1.9 +11 -0 Update Solaris CFLAGS for gsoc_sntp ChangeSet@1.1791.1.1, 2008-11-25 21:23:21+00:00, kuehn@pogo.udel.edu prettydate.c, caljulian.c, calyearstart.c: Added changes from Juergen libntp/caljulian.c@1.10 +13 -10 Added changes from Juergen libntp/calyearstart.c@1.4 +5 -2 Added changes from Juergen libntp/prettydate.c@1.8 +5 -6 Added changes from Juergen ChangeSet@1.1793, 2008-11-22 00:54:08+00:00, kuehn@pogo.udel.edu ChangeLog: Added entry for bug #1099 ChangeLog@1.265 +1 -0 Added entry for bug #1099 ChangeSet@1.1792, 2008-11-22 01:22:42+01:00, Amidamaru@melchior.mxiesoft.com crypto.c: Fixed auth_init to detect empty lines and malformed entries gsoc_sntp/crypto.c@1.4 +25 -15 Fixed auth_init to detect empty lines and malformed entries ChangeSet@1.1791, 2008-11-20 06:54:56-05:00, stenn@whimsy.udel.edu NTP_4_2_5P145 TAG: NTP_4_2_5P145 ChangeLog@1.264 +1 -0 NTP_4_2_5P145 gsoc_sntp/sntp-opts.c@1.6 +2 -2 NTP_4_2_5P145 gsoc_sntp/sntp-opts.h@1.6 +3 -3 NTP_4_2_5P145 gsoc_sntp/sntp-opts.texi@1.6 +1 -1 NTP_4_2_5P145 gsoc_sntp/sntp.1@1.6 +2 -2 NTP_4_2_5P145 ntpd/ntpd-opts.c@1.137 +2 -2 NTP_4_2_5P145 ntpd/ntpd-opts.h@1.137 +3 -3 NTP_4_2_5P145 ntpd/ntpd-opts.texi@1.136 +1 -1 NTP_4_2_5P145 ntpd/ntpd.1@1.136 +2 -2 NTP_4_2_5P145 ntpdc/ntpdc-opts.c@1.133 +2 -2 NTP_4_2_5P145 ntpdc/ntpdc-opts.h@1.133 +3 -3 NTP_4_2_5P145 ntpdc/ntpdc-opts.texi@1.132 +1 -1 NTP_4_2_5P145 ntpdc/ntpdc.1@1.132 +2 -2 NTP_4_2_5P145 ntpq/ntpq-opts.c@1.133 +2 -2 NTP_4_2_5P145 ntpq/ntpq-opts.h@1.133 +3 -3 NTP_4_2_5P145 ntpq/ntpq-opts.texi@1.132 +1 -1 NTP_4_2_5P145 ntpq/ntpq.1@1.132 +2 -2 NTP_4_2_5P145 ntpsnmpd/ntpsnmpd-opts.c@1.14 +2 -2 NTP_4_2_5P145 ntpsnmpd/ntpsnmpd-opts.h@1.14 +3 -3 NTP_4_2_5P145 ntpsnmpd/ntpsnmpd-opts.texi@1.14 +1 -1 NTP_4_2_5P145 ntpsnmpd/ntpsnmpd.1@1.14 +2 -2 NTP_4_2_5P145 packageinfo.sh@1.148 +1 -1 NTP_4_2_5P145 sntp/sntp-opts.c@1.133 +2 -2 NTP_4_2_5P145 sntp/sntp-opts.h@1.133 +3 -3 NTP_4_2_5P145 sntp/sntp-opts.texi@1.132 +1 -1 NTP_4_2_5P145 sntp/sntp.1@1.132 +2 -2 NTP_4_2_5P145 util/ntp-keygen-opts.c@1.136 +2 -2 NTP_4_2_5P145 util/ntp-keygen-opts.h@1.136 +3 -3 NTP_4_2_5P145 util/ntp-keygen-opts.texi@1.135 +1 -1 NTP_4_2_5P145 util/ntp-keygen.1@1.135 +2 -2 NTP_4_2_5P145 ChangeSet@1.1790, 2008-11-20 08:43:08+00:00, stenn@poog.il.thewrittenword.com Deal with time.h for sntp under linux ChangeLog@1.263 +1 -0 Deal with time.h for sntp under linux gsoc_sntp/configure.ac@1.8 +3 -1 Deal with time.h for sntp under linux ChangeSet@1.1789, 2008-11-20 07:09:48+00:00, stenn@poog.il.thewrittenword.com Provide rpl_malloc() for sntp for systems that need it ChangeLog@1.262 +1 -0 Provide rpl_malloc() for sntp for systems that need it gsoc_sntp/main.c@1.11 +10 -0 Provide rpl_malloc() for sntp for systems that need it gsoc_sntp/networking.c@1.17 +3 -3 Handle ss_len and socklen type for sntp ChangeSet@1.1788, 2008-11-20 07:07:09+00:00, stenn@poog.il.thewrittenword.com Handle ss_len and socklen type for sntp ChangeLog@1.261 +1 -0 Handle ss_len and socklen type for sntp gsoc_sntp/configure.ac@1.7 +74 -0 Handle ss_len and socklen type for sntp ChangeSet@1.1787, 2008-11-20 05:42:04+00:00, stenn@poog.il.thewrittenword.com Fixes to the sntp configure.ac script. ChangeLog@1.260 +1 -0 Fixes to the sntp configure.ac script. gsoc_sntp/configure.ac@1.6 +227 -20 Fixes to the sntp configure.ac script. ChangeSet@1.1786, 2008-11-20 05:41:10+00:00, stenn@poog.il.thewrittenword.com Provide INET6_ADDRSTRLEN if it is missing ChangeLog@1.259 +1 -0 Provide INET6_ADDRSTRLEN if it is missing include/ntp_rfc2553.h@1.30 +15 -11 Provide INET6_ADDRSTRLEN if it is missing ChangeSet@1.1785, 2008-11-19 22:18:03+00:00, stenn@poog.il.thewrittenword.com [Bug 1095] overflow in caljulian.c ChangeLog@1.258 +1 -0 [Bug 1095] overflow in caljulian.c libntp/caljulian.c@1.9 +2 -1 [Bug 1095] overflow in caljulian.c ChangeSet@1.1784, 2008-11-19 06:58:01-05:00, stenn@whimsy.udel.edu NTP_4_2_5P144 TAG: NTP_4_2_5P144 ChangeLog@1.257 +1 -0 NTP_4_2_5P144 gsoc_sntp/sntp-opts.c@1.5 +2 -2 NTP_4_2_5P144 gsoc_sntp/sntp-opts.h@1.5 +3 -3 NTP_4_2_5P144 gsoc_sntp/sntp-opts.texi@1.5 +1 -1 NTP_4_2_5P144 gsoc_sntp/sntp.1@1.5 +2 -2 NTP_4_2_5P144 ntpd/ntpd-opts.c@1.136 +2 -2 NTP_4_2_5P144 ntpd/ntpd-opts.h@1.136 +3 -3 NTP_4_2_5P144 ntpd/ntpd-opts.texi@1.135 +1 -1 NTP_4_2_5P144 ntpd/ntpd.1@1.135 +2 -2 NTP_4_2_5P144 ntpdc/ntpdc-opts.c@1.132 +2 -2 NTP_4_2_5P144 ntpdc/ntpdc-opts.h@1.132 +3 -3 NTP_4_2_5P144 ntpdc/ntpdc-opts.texi@1.131 +1 -1 NTP_4_2_5P144 ntpdc/ntpdc.1@1.131 +2 -2 NTP_4_2_5P144 ntpq/ntpq-opts.c@1.132 +2 -2 NTP_4_2_5P144 ntpq/ntpq-opts.h@1.132 +3 -3 NTP_4_2_5P144 ntpq/ntpq-opts.texi@1.131 +1 -1 NTP_4_2_5P144 ntpq/ntpq.1@1.131 +2 -2 NTP_4_2_5P144 ntpsnmpd/ntpsnmpd-opts.c@1.13 +2 -2 NTP_4_2_5P144 ntpsnmpd/ntpsnmpd-opts.h@1.13 +3 -3 NTP_4_2_5P144 ntpsnmpd/ntpsnmpd-opts.texi@1.13 +1 -1 NTP_4_2_5P144 ntpsnmpd/ntpsnmpd.1@1.13 +2 -2 NTP_4_2_5P144 packageinfo.sh@1.147 +1 -1 NTP_4_2_5P144 sntp/sntp-opts.c@1.132 +2 -2 NTP_4_2_5P144 sntp/sntp-opts.h@1.132 +3 -3 NTP_4_2_5P144 sntp/sntp-opts.texi@1.131 +1 -1 NTP_4_2_5P144 sntp/sntp.1@1.131 +2 -2 NTP_4_2_5P144 util/ntp-keygen-opts.c@1.135 +2 -2 NTP_4_2_5P144 util/ntp-keygen-opts.h@1.135 +3 -3 NTP_4_2_5P144 util/ntp-keygen-opts.texi@1.134 +1 -1 NTP_4_2_5P144 util/ntp-keygen.1@1.134 +2 -2 NTP_4_2_5P144 ChangeSet@1.1783, 2008-11-18 23:32:18+00:00, stenn@poog.il.thewrittenword.com Use int32, not int32_t ChangeLog@1.256 +1 -0 Use int32, not int32_t ntpdc/ntpdc_ops.c@1.56 +3 -3 Use int32, not int32_t ChangeSet@1.1782, 2008-11-18 22:33:11+00:00, stenn@poog.il.thewrittenword.com Avoid the sched*() functions under OSF - link problems ChangeLog@1.255 +1 -0 Avoid the sched*() functions under OSF - link problems configure.ac@1.421 +5 -0 Avoid the sched*() functions under OSF - link problems ChangeSet@1.1781, 2008-11-17 06:53:07-05:00, stenn@whimsy.udel.edu NTP_4_2_5P143 TAG: NTP_4_2_5P143 ChangeLog@1.254 +1 -0 NTP_4_2_5P143 gsoc_sntp/sntp-opts.c@1.4 +37 -7 NTP_4_2_5P143 gsoc_sntp/sntp-opts.h@1.4 +77 -6 NTP_4_2_5P143 gsoc_sntp/sntp-opts.texi@1.4 +1 -1 NTP_4_2_5P143 gsoc_sntp/sntp.1@1.4 +7 -2 NTP_4_2_5P143 ntpd/ntpd-opts.c@1.135 +2 -2 NTP_4_2_5P143 ntpd/ntpd-opts.h@1.135 +3 -3 NTP_4_2_5P143 ntpd/ntpd-opts.texi@1.134 +1 -1 NTP_4_2_5P143 ntpd/ntpd.1@1.134 +2 -2 NTP_4_2_5P143 ntpdc/ntpdc-opts.c@1.131 +2 -2 NTP_4_2_5P143 ntpdc/ntpdc-opts.h@1.131 +3 -3 NTP_4_2_5P143 ntpdc/ntpdc-opts.texi@1.130 +1 -1 NTP_4_2_5P143 ntpdc/ntpdc.1@1.130 +2 -2 NTP_4_2_5P143 ntpq/ntpq-opts.c@1.131 +2 -2 NTP_4_2_5P143 ntpq/ntpq-opts.h@1.131 +3 -3 NTP_4_2_5P143 ntpq/ntpq-opts.texi@1.130 +1 -1 NTP_4_2_5P143 ntpq/ntpq.1@1.130 +2 -2 NTP_4_2_5P143 ntpsnmpd/ntpsnmpd-opts.c@1.12 +2 -2 NTP_4_2_5P143 ntpsnmpd/ntpsnmpd-opts.h@1.12 +3 -3 NTP_4_2_5P143 ntpsnmpd/ntpsnmpd-opts.texi@1.12 +1 -1 NTP_4_2_5P143 ntpsnmpd/ntpsnmpd.1@1.12 +2 -2 NTP_4_2_5P143 packageinfo.sh@1.146 +1 -1 NTP_4_2_5P143 sntp/sntp-opts.c@1.131 +2 -2 NTP_4_2_5P143 sntp/sntp-opts.h@1.131 +3 -3 NTP_4_2_5P143 sntp/sntp-opts.texi@1.130 +1 -1 NTP_4_2_5P143 sntp/sntp.1@1.130 +2 -2 NTP_4_2_5P143 util/ntp-keygen-opts.c@1.134 +2 -2 NTP_4_2_5P143 util/ntp-keygen-opts.h@1.134 +3 -3 NTP_4_2_5P143 util/ntp-keygen-opts.texi@1.133 +1 -1 NTP_4_2_5P143 util/ntp-keygen.1@1.133 +2 -2 NTP_4_2_5P143 ChangeSet@1.1780, 2008-11-17 03:29:26-05:00, stenn@whimsy.udel.edu update generated files gsoc_sntp/sntp-opts.c@1.3 +7 -37 update generated files gsoc_sntp/sntp-opts.h@1.3 +7 -78 update generated files gsoc_sntp/sntp-opts.texi@1.3 +3 -3 update generated files gsoc_sntp/sntp.1@1.3 +3 -8 update generated files ChangeSet@1.1779, 2008-11-17 03:18:55-05:00, stenn@pogo.udel.edu sntp cleanup and fixes ChangeLog@1.253 +1 -0 sntp cleanup and fixes ChangeSet@1.1775.1.2, 2008-11-17 01:25:35+01:00, Amidamaru@melchior.mxiesoft.com sntp-opts.def: Set the normalverbose option to -d gsoc_sntp/sntp-opts.def@1.9 +1 -1 Set the normalverbose option to -d ChangeSet@1.1775.1.1, 2008-11-17 01:16:44+01:00, Amidamaru@melchior.mxiesoft.com utilities.h, utilities.c: Added the tv_to_str function which converts a struct timeval to a timestamp string. kod_management.c: Replaced strlcpy with strncpy for compatibility reasons. main.c: Fixed the time difference report part and the set_time call part of bug #1088 gsoc_sntp/kod_management.c@1.7 +1 -1 Replaced strlcpy with strncpy for compatibility reasons. gsoc_sntp/main.c@1.10 +23 -15 Fixed the time difference report part and the set_time call part of bug #1088 gsoc_sntp/networking.c@1.16 +2 -2 gsoc_sntp/utilities.c@1.5 +36 -0 Added the tv_to_str function which converts a struct timeval to a timestamp string. gsoc_sntp/utilities.h@1.4 +1 -0 Added the tv_to_str function which converts a struct timeval to a timestamp string. ChangeSet@1.1777, 2008-11-16 07:03:17-05:00, stenn@whimsy.udel.edu NTP_4_2_5P142 TAG: NTP_4_2_5P142 ChangeLog@1.252 +1 -0 NTP_4_2_5P142 gsoc_sntp/sntp-opts.c@1.2 +2 -2 NTP_4_2_5P142 gsoc_sntp/sntp-opts.h@1.2 +3 -3 NTP_4_2_5P142 gsoc_sntp/sntp-opts.texi@1.2 +1 -1 NTP_4_2_5P142 gsoc_sntp/sntp.1@1.2 +2 -2 NTP_4_2_5P142 ntpd/ntpd-opts.c@1.134 +2 -2 NTP_4_2_5P142 ntpd/ntpd-opts.h@1.134 +3 -3 NTP_4_2_5P142 ntpd/ntpd-opts.texi@1.133 +1 -1 NTP_4_2_5P142 ntpd/ntpd.1@1.133 +2 -2 NTP_4_2_5P142 ntpdc/ntpdc-opts.c@1.130 +2 -2 NTP_4_2_5P142 ntpdc/ntpdc-opts.h@1.130 +3 -3 NTP_4_2_5P142 ntpdc/ntpdc-opts.texi@1.129 +1 -1 NTP_4_2_5P142 ntpdc/ntpdc.1@1.129 +2 -2 NTP_4_2_5P142 ntpq/ntpq-opts.c@1.130 +2 -2 NTP_4_2_5P142 ntpq/ntpq-opts.h@1.130 +3 -3 NTP_4_2_5P142 ntpq/ntpq-opts.texi@1.129 +1 -1 NTP_4_2_5P142 ntpq/ntpq.1@1.129 +2 -2 NTP_4_2_5P142 ntpsnmpd/ntpsnmpd-opts.c@1.11 +2 -2 NTP_4_2_5P142 ntpsnmpd/ntpsnmpd-opts.h@1.11 +3 -3 NTP_4_2_5P142 ntpsnmpd/ntpsnmpd-opts.texi@1.11 +1 -1 NTP_4_2_5P142 ntpsnmpd/ntpsnmpd.1@1.11 +2 -2 NTP_4_2_5P142 packageinfo.sh@1.145 +1 -1 NTP_4_2_5P142 sntp/sntp-opts.c@1.130 +2 -2 NTP_4_2_5P142 sntp/sntp-opts.h@1.130 +3 -3 NTP_4_2_5P142 sntp/sntp-opts.texi@1.129 +1 -1 NTP_4_2_5P142 sntp/sntp.1@1.129 +2 -2 NTP_4_2_5P142 util/ntp-keygen-opts.c@1.133 +2 -2 NTP_4_2_5P142 util/ntp-keygen-opts.h@1.133 +3 -3 NTP_4_2_5P142 util/ntp-keygen-opts.texi@1.132 +1 -1 NTP_4_2_5P142 util/ntp-keygen.1@1.132 +2 -2 NTP_4_2_5P142 ChangeSet@1.1776, 2008-11-16 02:16:42-05:00, stenn@whimsy.udel.edu Imported GSoC SNTP code from Johannes Maximilian Khn .point-changed-filelist@1.5 +4 -0 Add gsoc-sntp files to .point-changed-filelist BitKeeper/deleted/.del-bincheck.mf@1.2 +0 -0 Delete: gsoc_sntp/bincheck.mf gsoc_sntp/bincheck.mf@1.1 +15 -0 BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/bincheck.mf gsoc_sntp/bincheck.mf@1.0 +0 -0 BitKeeper/etc/ignore@1.68 +14 -14 Added gsoc_sntp files to the ignore list ChangeLog@1.251 +1 -0 Imported GSoC SNTP code from Johannes Maximilian Khn bootstrap@1.22 +1 -0 Add gsoc_sntp files t bootstrap ChangeSet@1.1774, 2008-11-15 16:06:12-05:00, stenn@pogo.udel.edu Hack gsoc_sntp for inclusion in the main tree BitKeeper/etc/ignore@1.67 +1 -0 added bincheck.mf BitKeeper/etc/ignore@1.66 +1 -0 added autogen-version.def BitKeeper/etc/ignore@1.65 +1 -0 added version.def gsoc_sntp/COPYRIGHT@1.1 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/COPYRIGHT gsoc_sntp/COPYRIGHT@1.0 +0 -0 gsoc_sntp/Makefile.am@1.5 +44 -16 Hack gsoc_sntp for inclusion in the main tree gsoc_sntp/configure.ac@1.5 +19 -2 Hack gsoc_sntp for inclusion in the main tree gsoc_sntp/ltmain.sh@1.1 +6863 -0 BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/ltmain.sh gsoc_sntp/ltmain.sh@1.0 +0 -0 gsoc_sntp/sntp-opts.c@1.1 +638 -0 BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/sntp-opts.c gsoc_sntp/sntp-opts.c@1.0 +0 -0 gsoc_sntp/sntp-opts.h@1.1 +234 -0 BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/sntp-opts.h gsoc_sntp/sntp-opts.h@1.0 +0 -0 gsoc_sntp/sntp-opts.menu@1.1 +1 -0 BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/sntp-opts.menu gsoc_sntp/sntp-opts.menu@1.0 +0 -0 gsoc_sntp/sntp-opts.texi@1.1 +208 -0 BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/sntp-opts.texi gsoc_sntp/sntp-opts.texi@1.0 +0 -0 gsoc_sntp/sntp.1@1.1 +298 -0 BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/sntp.1 gsoc_sntp/sntp.1@1.0 +0 -0 ChangeSet@1.1771.1.1, 2008-11-14 17:32:58-05:00, stenn@pogo.udel.edu updates gsoc_sntp/:fetch-stubs@1.4 +0 -12 updates ChangeSet@1.1735.1.72, 2008-11-13 06:42:06-05:00, stenn@whimsy.udel.edu NTP_4_2_5P141 TAG: NTP_4_2_5P141 ChangeLog@1.250 +1 -0 NTP_4_2_5P141 ntpd/ntpd-opts.c@1.133 +2 -2 NTP_4_2_5P141 ntpd/ntpd-opts.h@1.133 +3 -3 NTP_4_2_5P141 ntpd/ntpd-opts.texi@1.132 +1 -1 NTP_4_2_5P141 ntpd/ntpd.1@1.132 +2 -2 NTP_4_2_5P141 ntpdc/ntpdc-opts.c@1.129 +2 -2 NTP_4_2_5P141 ntpdc/ntpdc-opts.h@1.129 +3 -3 NTP_4_2_5P141 ntpdc/ntpdc-opts.texi@1.128 +1 -1 NTP_4_2_5P141 ntpdc/ntpdc.1@1.128 +2 -2 NTP_4_2_5P141 ntpq/ntpq-opts.c@1.129 +2 -2 NTP_4_2_5P141 ntpq/ntpq-opts.h@1.129 +3 -3 NTP_4_2_5P141 ntpq/ntpq-opts.texi@1.128 +1 -1 NTP_4_2_5P141 ntpq/ntpq.1@1.128 +2 -2 NTP_4_2_5P141 ntpsnmpd/ntpsnmpd-opts.c@1.10 +2 -2 NTP_4_2_5P141 ntpsnmpd/ntpsnmpd-opts.h@1.10 +3 -3 NTP_4_2_5P141 ntpsnmpd/ntpsnmpd-opts.texi@1.10 +1 -1 NTP_4_2_5P141 ntpsnmpd/ntpsnmpd.1@1.10 +2 -2 NTP_4_2_5P141 packageinfo.sh@1.144 +1 -1 NTP_4_2_5P141 sntp/sntp-opts.c@1.129 +2 -2 NTP_4_2_5P141 sntp/sntp-opts.h@1.129 +3 -3 NTP_4_2_5P141 sntp/sntp-opts.texi@1.128 +1 -1 NTP_4_2_5P141 sntp/sntp.1@1.128 +2 -2 NTP_4_2_5P141 util/ntp-keygen-opts.c@1.132 +2 -2 NTP_4_2_5P141 util/ntp-keygen-opts.h@1.132 +3 -3 NTP_4_2_5P141 util/ntp-keygen-opts.texi@1.131 +1 -1 NTP_4_2_5P141 util/ntp-keygen.1@1.131 +2 -2 NTP_4_2_5P141 ChangeSet@1.1735.1.71, 2008-11-12 16:09:45-05:00, stenn@whimsy.udel.edu New caltontp.c and calyearstart.c from Juergen Perlinger ChangeLog@1.249 +1 -0 New caltontp.c and calyearstart.c from Juergen Perlinger libntp/caltontp.c@1.3 +88 -25 New caltontp.c and calyearstart.c from Juergen Perlinger libntp/calyearstart.c@1.3 +38 -7 New caltontp.c and calyearstart.c from Juergen Perlinger ChangeSet@1.1735.1.70, 2008-11-12 06:43:31-05:00, stenn@whimsy.udel.edu NTP_4_2_5P140 TAG: NTP_4_2_5P140 ChangeLog@1.248 +1 -0 NTP_4_2_5P140 ntpd/ntpd-opts.c@1.132 +2 -2 NTP_4_2_5P140 ntpd/ntpd-opts.h@1.132 +3 -3 NTP_4_2_5P140 ntpd/ntpd-opts.texi@1.131 +1 -1 NTP_4_2_5P140 ntpd/ntpd.1@1.131 +2 -2 NTP_4_2_5P140 ntpdc/ntpdc-opts.c@1.128 +2 -2 NTP_4_2_5P140 ntpdc/ntpdc-opts.h@1.128 +3 -3 NTP_4_2_5P140 ntpdc/ntpdc-opts.texi@1.127 +1 -1 NTP_4_2_5P140 ntpdc/ntpdc.1@1.127 +2 -2 NTP_4_2_5P140 ntpq/ntpq-opts.c@1.128 +2 -2 NTP_4_2_5P140 ntpq/ntpq-opts.h@1.128 +3 -3 NTP_4_2_5P140 ntpq/ntpq-opts.texi@1.127 +1 -1 NTP_4_2_5P140 ntpq/ntpq.1@1.127 +2 -2 NTP_4_2_5P140 ntpsnmpd/ntpsnmpd-opts.c@1.9 +2 -2 NTP_4_2_5P140 ntpsnmpd/ntpsnmpd-opts.h@1.9 +3 -3 NTP_4_2_5P140 ntpsnmpd/ntpsnmpd-opts.texi@1.9 +1 -1 NTP_4_2_5P140 ntpsnmpd/ntpsnmpd.1@1.9 +2 -2 NTP_4_2_5P140 packageinfo.sh@1.143 +1 -1 NTP_4_2_5P140 sntp/sntp-opts.c@1.128 +2 -2 NTP_4_2_5P140 sntp/sntp-opts.h@1.128 +3 -3 NTP_4_2_5P140 sntp/sntp-opts.texi@1.127 +1 -1 NTP_4_2_5P140 sntp/sntp.1@1.127 +2 -2 NTP_4_2_5P140 util/ntp-keygen-opts.c@1.131 +2 -2 NTP_4_2_5P140 util/ntp-keygen-opts.h@1.131 +3 -3 NTP_4_2_5P140 util/ntp-keygen-opts.texi@1.130 +1 -1 NTP_4_2_5P140 util/ntp-keygen.1@1.130 +2 -2 NTP_4_2_5P140 ChangeSet@1.1735.1.69, 2008-11-12 02:36:31-05:00, stenn@whimsy.udel.edu ntp_scanner lint removal ChangeLog@1.247 +1 -0 ntp_scanner lint removal ntpd/ntp_scanner.c@1.15 +2 -1 ntp_scanner lint removal ntpd/ntp_scanner.h@1.4 +1 -1 ntp_scanner lint removal ChangeSet@1.1735.1.68, 2008-11-12 02:18:18-05:00, stenn@pogo.udel.edu Reindent ntp_scanner.c ntpd/ntp_scanner.c@1.14 +109 -65 Reindent ntp_scanner.c ChangeSet@1.1735.1.67, 2008-11-11 16:49:27-05:00, stenn@whimsy.udel.edu [Bug 1011] gmtime() returns NULL on windows where it would not under Unix ChangeLog@1.246 +2 -0 [Bug 1011] gmtime() returns NULL on windows where it would not under Unix libntp/caljulian.c@1.8 +121 -86 [Bug 1011] gmtime() returns NULL on windows where it would not under Unix libntp/prettydate.c@1.7 +107 -39 [Bug 1011] gmtime() returns NULL on windows where it would not under Unix ChangeSet@1.1735.1.66, 2008-11-11 06:42:25-05:00, stenn@whimsy.udel.edu NTP_4_2_5P139 TAG: NTP_4_2_5P139 ChangeLog@1.245 +1 -0 NTP_4_2_5P139 ntpd/ntpd-opts.c@1.131 +2 -2 NTP_4_2_5P139 ntpd/ntpd-opts.h@1.131 +3 -3 NTP_4_2_5P139 ntpd/ntpd-opts.texi@1.130 +1 -1 NTP_4_2_5P139 ntpd/ntpd.1@1.130 +2 -2 NTP_4_2_5P139 ntpdc/ntpdc-opts.c@1.127 +2 -2 NTP_4_2_5P139 ntpdc/ntpdc-opts.h@1.127 +3 -3 NTP_4_2_5P139 ntpdc/ntpdc-opts.texi@1.126 +1 -1 NTP_4_2_5P139 ntpdc/ntpdc.1@1.126 +2 -2 NTP_4_2_5P139 ntpq/ntpq-opts.c@1.127 +2 -2 NTP_4_2_5P139 ntpq/ntpq-opts.h@1.127 +3 -3 NTP_4_2_5P139 ntpq/ntpq-opts.texi@1.126 +1 -1 NTP_4_2_5P139 ntpq/ntpq.1@1.126 +2 -2 NTP_4_2_5P139 ntpsnmpd/ntpsnmpd-opts.c@1.8 +2 -2 NTP_4_2_5P139 ntpsnmpd/ntpsnmpd-opts.h@1.8 +3 -3 NTP_4_2_5P139 ntpsnmpd/ntpsnmpd-opts.texi@1.8 +1 -1 NTP_4_2_5P139 ntpsnmpd/ntpsnmpd.1@1.8 +2 -2 NTP_4_2_5P139 packageinfo.sh@1.142 +1 -1 NTP_4_2_5P139 sntp/sntp-opts.c@1.127 +2 -2 NTP_4_2_5P139 sntp/sntp-opts.h@1.127 +3 -3 NTP_4_2_5P139 sntp/sntp-opts.texi@1.126 +1 -1 NTP_4_2_5P139 sntp/sntp.1@1.126 +2 -2 NTP_4_2_5P139 util/ntp-keygen-opts.c@1.130 +2 -2 NTP_4_2_5P139 util/ntp-keygen-opts.h@1.130 +3 -3 NTP_4_2_5P139 util/ntp-keygen-opts.texi@1.129 +1 -1 NTP_4_2_5P139 util/ntp-keygen.1@1.129 +2 -2 NTP_4_2_5P139 ChangeSet@1.1735.1.65, 2008-11-11 01:39:34-05:00, stenn@whimsy.udel.edu Typo fix to driver20.html ChangeLog@1.244 +1 -0 Typo fix to driver20.html html/drivers/driver20.html@1.17 +1 -1 Typo fix to driver20.html ChangeSet@1.1735.1.64, 2008-11-10 06:44:15-05:00, stenn@whimsy.udel.edu NTP_4_2_5P138 TAG: NTP_4_2_5P138 ChangeLog@1.243 +1 -0 NTP_4_2_5P138 ntpd/ntpd-opts.c@1.130 +2 -2 NTP_4_2_5P138 ntpd/ntpd-opts.h@1.130 +3 -3 NTP_4_2_5P138 ntpd/ntpd-opts.texi@1.129 +1 -1 NTP_4_2_5P138 ntpd/ntpd.1@1.129 +2 -2 NTP_4_2_5P138 ntpdc/ntpdc-opts.c@1.126 +2 -2 NTP_4_2_5P138 ntpdc/ntpdc-opts.h@1.126 +3 -3 NTP_4_2_5P138 ntpdc/ntpdc-opts.texi@1.125 +1 -1 NTP_4_2_5P138 ntpdc/ntpdc.1@1.125 +2 -2 NTP_4_2_5P138 ntpq/ntpq-opts.c@1.126 +2 -2 NTP_4_2_5P138 ntpq/ntpq-opts.h@1.126 +3 -3 NTP_4_2_5P138 ntpq/ntpq-opts.texi@1.125 +1 -1 NTP_4_2_5P138 ntpq/ntpq.1@1.125 +2 -2 NTP_4_2_5P138 ntpsnmpd/ntpsnmpd-opts.c@1.7 +2 -2 NTP_4_2_5P138 ntpsnmpd/ntpsnmpd-opts.h@1.7 +3 -3 NTP_4_2_5P138 ntpsnmpd/ntpsnmpd-opts.texi@1.7 +1 -1 NTP_4_2_5P138 ntpsnmpd/ntpsnmpd.1@1.7 +2 -2 NTP_4_2_5P138 packageinfo.sh@1.141 +1 -1 NTP_4_2_5P138 sntp/sntp-opts.c@1.126 +2 -2 NTP_4_2_5P138 sntp/sntp-opts.h@1.126 +3 -3 NTP_4_2_5P138 sntp/sntp-opts.texi@1.125 +1 -1 NTP_4_2_5P138 sntp/sntp.1@1.125 +2 -2 NTP_4_2_5P138 util/ntp-keygen-opts.c@1.129 +2 -2 NTP_4_2_5P138 util/ntp-keygen-opts.h@1.129 +3 -3 NTP_4_2_5P138 util/ntp-keygen-opts.texi@1.128 +1 -1 NTP_4_2_5P138 util/ntp-keygen.1@1.128 +2 -2 NTP_4_2_5P138 ChangeSet@1.1735.1.63, 2008-11-10 02:00:40-05:00, stenn@whimsy.udel.edu IPv6 interfaces were being looked for twice; fix bug 474 ChangeLog@1.242 +2 -0 IPv6 interfaces were being looked for twice; fix bug 474 ntpd/ntp_io.c@1.274 +1 -8 IPv6 interfaces were being looked for twice; fix bug 474 ChangeSet@1.1735.1.62, 2008-11-09 23:19:25-05:00, stenn@pogo.udel.edu Used ntp-4.2.5p138 instead of the date html/drivers/driver28.html@1.12 +1 -1 Used ntp-4.2.5p138 instead of the date ChangeSet@1.1735.8.7, 2008-11-09 22:38:13-05:00, stenn@whimsy.udel.edu decode.html and driver20.html updates from Dave Mills ChangeLog@1.238.1.5 +1 -0 decode.html and driver20.html updates from Dave Mills html/decode.html@1.4 +12 -6 decode.html and driver20.html updates from Dave Mills html/drivers/driver20.html@1.16 +1 -1 decode.html and driver20.html updates from Dave Mills ChangeSet@1.1735.8.6, 2008-11-01 06:46:41-05:00, stenn@whimsy.udel.edu NTP_4_2_5P137 TAG: NTP_4_2_5P137 ChangeLog@1.238.1.4 +1 -0 NTP_4_2_5P137 ntpd/ntpd-opts.c@1.129 +2 -2 NTP_4_2_5P137 ntpd/ntpd-opts.h@1.129 +3 -3 NTP_4_2_5P137 ntpd/ntpd-opts.texi@1.128 +1 -1 NTP_4_2_5P137 ntpd/ntpd.1@1.128 +2 -2 NTP_4_2_5P137 ntpdc/ntpdc-opts.c@1.125 +2 -2 NTP_4_2_5P137 ntpdc/ntpdc-opts.h@1.125 +3 -3 NTP_4_2_5P137 ntpdc/ntpdc-opts.texi@1.124 +1 -1 NTP_4_2_5P137 ntpdc/ntpdc.1@1.124 +2 -2 NTP_4_2_5P137 ntpq/ntpq-opts.c@1.125 +2 -2 NTP_4_2_5P137 ntpq/ntpq-opts.h@1.125 +3 -3 NTP_4_2_5P137 ntpq/ntpq-opts.texi@1.124 +1 -1 NTP_4_2_5P137 ntpq/ntpq.1@1.124 +2 -2 NTP_4_2_5P137 ntpsnmpd/ntpsnmpd-opts.c@1.6 +2 -2 NTP_4_2_5P137 ntpsnmpd/ntpsnmpd-opts.h@1.6 +3 -3 NTP_4_2_5P137 ntpsnmpd/ntpsnmpd-opts.texi@1.6 +1 -1 NTP_4_2_5P137 ntpsnmpd/ntpsnmpd.1@1.6 +2 -2 NTP_4_2_5P137 packageinfo.sh@1.140 +1 -1 NTP_4_2_5P137 sntp/sntp-opts.c@1.125 +2 -2 NTP_4_2_5P137 sntp/sntp-opts.h@1.125 +3 -3 NTP_4_2_5P137 sntp/sntp-opts.texi@1.124 +1 -1 NTP_4_2_5P137 sntp/sntp.1@1.124 +2 -2 NTP_4_2_5P137 util/ntp-keygen-opts.c@1.128 +2 -2 NTP_4_2_5P137 util/ntp-keygen-opts.h@1.128 +3 -3 NTP_4_2_5P137 util/ntp-keygen-opts.texi@1.127 +1 -1 NTP_4_2_5P137 util/ntp-keygen.1@1.127 +2 -2 NTP_4_2_5P137 ChangeSet@1.1735.8.5, 2008-11-01 00:22:33-05:00, stenn@whimsy.udel.edu netsnmp_daemonize lib check cleanup configure.ac@1.417.1.5 +1 -1 netsnmp_daemonize lib check cleanup ChangeSet@1.1735.8.4, 2008-10-31 23:31:45-05:00, stenn@whimsy.udel.edu [Bug 1069] #undef netsnmp's PACKAGE_* macros ChangeLog@1.238.1.3 +2 -0 [Bug 1069] #undef netsnmp's PACKAGE_* macros ntpsnmpd/ntpsnmpd.c@1.3 +6 -0 [Bug 1069] #undef netsnmp's PACKAGE_* macros ChangeSet@1.1735.8.3, 2008-10-31 23:27:50-05:00, stenn@whimsy.udel.edu [Bug 1068] Older versions of netsnmp do not have netsnmp_daemonize() configure.ac@1.417.1.4 +12 -0 [Bug 1068] Older versions of netsnmp do not have netsnmp_daemonize() ntpsnmpd/Makefile.am@1.6 +1 -1 [Bug 1068] Older versions of netsnmp do not have netsnmp_daemonize() ntpsnmpd/netsnmp_daemonize.c@1.1 +266 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/netsnmp_daemonize.c ntpsnmpd/netsnmp_daemonize.c@1.0 +0 -0 ChangeSet@1.1735.8.2, 2008-10-27 06:43:43-05:00, stenn@whimsy.udel.edu NTP_4_2_5P136 TAG: NTP_4_2_5P136 ChangeLog@1.238.1.2 +1 -0 NTP_4_2_5P136 ntpd/ntpd-opts.c@1.128 +2 -2 NTP_4_2_5P136 ntpd/ntpd-opts.h@1.128 +3 -3 NTP_4_2_5P136 ntpd/ntpd-opts.texi@1.127 +1 -1 NTP_4_2_5P136 ntpd/ntpd.1@1.127 +2 -2 NTP_4_2_5P136 ntpdc/ntpdc-opts.c@1.124 +2 -2 NTP_4_2_5P136 ntpdc/ntpdc-opts.h@1.124 +3 -3 NTP_4_2_5P136 ntpdc/ntpdc-opts.texi@1.123 +1 -1 NTP_4_2_5P136 ntpdc/ntpdc.1@1.123 +2 -2 NTP_4_2_5P136 ntpq/ntpq-opts.c@1.124 +2 -2 NTP_4_2_5P136 ntpq/ntpq-opts.h@1.124 +3 -3 NTP_4_2_5P136 ntpq/ntpq-opts.texi@1.123 +1 -1 NTP_4_2_5P136 ntpq/ntpq.1@1.123 +2 -2 NTP_4_2_5P136 ntpsnmpd/ntpsnmpd-opts.c@1.5 +2 -2 NTP_4_2_5P136 ntpsnmpd/ntpsnmpd-opts.h@1.5 +3 -3 NTP_4_2_5P136 ntpsnmpd/ntpsnmpd-opts.texi@1.5 +1 -1 NTP_4_2_5P136 ntpsnmpd/ntpsnmpd.1@1.5 +2 -2 NTP_4_2_5P136 packageinfo.sh@1.139 +1 -1 NTP_4_2_5P136 sntp/sntp-opts.c@1.124 +2 -2 NTP_4_2_5P136 sntp/sntp-opts.h@1.124 +3 -3 NTP_4_2_5P136 sntp/sntp-opts.texi@1.123 +1 -1 NTP_4_2_5P136 sntp/sntp.1@1.123 +2 -2 NTP_4_2_5P136 util/ntp-keygen-opts.c@1.127 +2 -2 NTP_4_2_5P136 util/ntp-keygen-opts.h@1.127 +3 -3 NTP_4_2_5P136 util/ntp-keygen-opts.texi@1.126 +1 -1 NTP_4_2_5P136 util/ntp-keygen.1@1.126 +2 -2 NTP_4_2_5P136 ChangeSet@1.1735.8.1, 2008-10-27 02:20:45-05:00, stenn@whimsy.udel.edu [Bug 1078] statsdir configuration parsing is broken ChangeLog@1.238.1.1 +1 -0 [Bug 1078] statsdir configuration parsing is broken ntpd/ntp_util.c@1.67 +1 -1 [Bug 1078] statsdir configuration parsing is broken ChangeSet@1.1735.1.59, 2008-10-23 19:21:21-04:00, murray@pogo.udel.edu ChangeLog: SHM fix. driver28.html: Fix to probe once per second rather than once per polling interval. Add clockstats for debugging if flag4 is on. (just counters) refclock_shm.c: Fix to probe once per second rather than once per polling interval. Add clockstats for debugging if flag4 is on. (just counters) ChangeLog@1.239 +1 -0 SHM fix. html/drivers/driver28.html@1.11 +56 -9 Fix to probe once per second rather than once per polling interval. Add clockstats for debugging if flag4 is on. (just counters) ntpd/refclock_shm.c@1.18 +151 -51 Fix to probe once per second rather than once per polling interval. Add clockstats for debugging if flag4 is on. (just counters) ChangeSet@1.1735.1.58, 2008-09-23 07:43:30-04:00, stenn@whimsy.udel.edu NTP_4_2_5P135 TAG: NTP_4_2_5P135 ChangeLog@1.238 +1 -0 NTP_4_2_5P135 ntpd/ntpd-opts.c@1.127 +2 -2 NTP_4_2_5P135 ntpd/ntpd-opts.h@1.127 +3 -3 NTP_4_2_5P135 ntpd/ntpd-opts.texi@1.126 +2 -2 NTP_4_2_5P135 ntpd/ntpd.1@1.126 +2 -2 NTP_4_2_5P135 ntpdc/ntpdc-opts.c@1.123 +2 -2 NTP_4_2_5P135 ntpdc/ntpdc-opts.h@1.123 +3 -3 NTP_4_2_5P135 ntpdc/ntpdc-opts.texi@1.122 +2 -2 NTP_4_2_5P135 ntpdc/ntpdc.1@1.122 +2 -2 NTP_4_2_5P135 ntpq/ntpq-opts.c@1.123 +2 -2 NTP_4_2_5P135 ntpq/ntpq-opts.h@1.123 +3 -3 NTP_4_2_5P135 ntpq/ntpq-opts.texi@1.122 +2 -2 NTP_4_2_5P135 ntpq/ntpq.1@1.122 +2 -2 NTP_4_2_5P135 ntpsnmpd/ntpsnmpd-opts.c@1.4 +2 -2 NTP_4_2_5P135 ntpsnmpd/ntpsnmpd-opts.h@1.4 +3 -3 NTP_4_2_5P135 ntpsnmpd/ntpsnmpd-opts.texi@1.4 +1 -1 NTP_4_2_5P135 ntpsnmpd/ntpsnmpd.1@1.4 +2 -2 NTP_4_2_5P135 packageinfo.sh@1.138 +1 -1 NTP_4_2_5P135 sntp/sntp-opts.c@1.123 +2 -2 NTP_4_2_5P135 sntp/sntp-opts.h@1.123 +3 -3 NTP_4_2_5P135 sntp/sntp-opts.texi@1.122 +1 -1 NTP_4_2_5P135 sntp/sntp.1@1.122 +2 -2 NTP_4_2_5P135 util/ntp-keygen-opts.c@1.126 +2 -2 NTP_4_2_5P135 util/ntp-keygen-opts.h@1.126 +3 -3 NTP_4_2_5P135 util/ntp-keygen-opts.texi@1.125 +2 -2 NTP_4_2_5P135 util/ntp-keygen.1@1.125 +2 -2 NTP_4_2_5P135 ChangeSet@1.1735.1.57, 2008-09-22 20:30:50-04:00, stenn@whimsy.udel.edu [Bug 1072] clock_update should not allow updates older than sys_epoch ChangeLog@1.237 +1 -0 [Bug 1072] clock_update should not allow updates older than sys_epoch ntpd/ntp_proto.c@1.276 +3 -3 [Bug 1072] clock_update should not allow updates older than sys_epoch ChangeSet@1.1735.1.56, 2008-09-17 07:46:56-04:00, stenn@whimsy.udel.edu NTP_4_2_5P134 TAG: NTP_4_2_5P134 ChangeLog@1.236 +1 -0 NTP_4_2_5P134 ntpd/ntpd-opts.c@1.126 +2 -2 NTP_4_2_5P134 ntpd/ntpd-opts.h@1.126 +3 -3 NTP_4_2_5P134 ntpd/ntpd-opts.texi@1.125 +1 -1 NTP_4_2_5P134 ntpd/ntpd.1@1.125 +2 -2 NTP_4_2_5P134 ntpdc/ntpdc-opts.c@1.122 +2 -2 NTP_4_2_5P134 ntpdc/ntpdc-opts.h@1.122 +3 -3 NTP_4_2_5P134 ntpdc/ntpdc-opts.texi@1.121 +1 -1 NTP_4_2_5P134 ntpdc/ntpdc.1@1.121 +2 -2 NTP_4_2_5P134 ntpq/ntpq-opts.c@1.122 +2 -2 NTP_4_2_5P134 ntpq/ntpq-opts.h@1.122 +3 -3 NTP_4_2_5P134 ntpq/ntpq-opts.texi@1.121 +1 -1 NTP_4_2_5P134 ntpq/ntpq.1@1.121 +2 -2 NTP_4_2_5P134 ntpsnmpd/ntpsnmpd-opts.c@1.3 +2 -2 NTP_4_2_5P134 ntpsnmpd/ntpsnmpd-opts.h@1.3 +3 -3 NTP_4_2_5P134 ntpsnmpd/ntpsnmpd-opts.texi@1.3 +1 -1 NTP_4_2_5P134 ntpsnmpd/ntpsnmpd.1@1.3 +2 -2 NTP_4_2_5P134 packageinfo.sh@1.137 +1 -1 NTP_4_2_5P134 sntp/sntp-opts.c@1.122 +2 -2 NTP_4_2_5P134 sntp/sntp-opts.h@1.122 +3 -3 NTP_4_2_5P134 sntp/sntp-opts.texi@1.121 +1 -1 NTP_4_2_5P134 sntp/sntp.1@1.121 +2 -2 NTP_4_2_5P134 util/ntp-keygen-opts.c@1.125 +2 -2 NTP_4_2_5P134 util/ntp-keygen-opts.h@1.125 +3 -3 NTP_4_2_5P134 util/ntp-keygen-opts.texi@1.124 +1 -1 NTP_4_2_5P134 util/ntp-keygen.1@1.124 +2 -2 NTP_4_2_5P134 ChangeSet@1.1735.1.55, 2008-09-16 21:05:36-04:00, stenn@whimsy.udel.edu Clean up build process for ntpsnmpd. ChangeLog@1.235 +1 -0 Clean up build process for ntpsnmpd. Makefile.am@1.76.1.2 +1 -1 Clean up build process for ntpsnmpd. configure.ac@1.417.1.3 +2 -2 Clean up build process for ntpsnmpd. ntpsnmpd/Makefile.am@1.5 +2 -1 Clean up build process for ntpsnmpd. ChangeSet@1.1735.1.54, 2008-09-16 19:12:17-04:00, stenn@whimsy.udel.edu NTP_4_2_5P133 TAG: NTP_4_2_5P133 ChangeLog@1.234 +1 -0 NTP_4_2_5P133 ntpd/ntpd-opts.c@1.125 +2 -2 NTP_4_2_5P133 ntpd/ntpd-opts.h@1.125 +3 -3 NTP_4_2_5P133 ntpd/ntpd-opts.texi@1.124 +1 -1 NTP_4_2_5P133 ntpd/ntpd.1@1.124 +2 -2 NTP_4_2_5P133 ntpdc/ntpdc-opts.c@1.121 +2 -2 NTP_4_2_5P133 ntpdc/ntpdc-opts.h@1.121 +3 -3 NTP_4_2_5P133 ntpdc/ntpdc-opts.texi@1.120 +1 -1 NTP_4_2_5P133 ntpdc/ntpdc.1@1.120 +2 -2 NTP_4_2_5P133 ntpq/ntpq-opts.c@1.121 +2 -2 NTP_4_2_5P133 ntpq/ntpq-opts.h@1.121 +3 -3 NTP_4_2_5P133 ntpq/ntpq-opts.texi@1.120 +1 -1 NTP_4_2_5P133 ntpq/ntpq.1@1.120 +2 -2 NTP_4_2_5P133 ntpsnmpd/ntpsnmpd-opts.c@1.2 +2 -2 NTP_4_2_5P133 ntpsnmpd/ntpsnmpd-opts.h@1.2 +3 -3 NTP_4_2_5P133 ntpsnmpd/ntpsnmpd-opts.texi@1.2 +1 -1 NTP_4_2_5P133 ntpsnmpd/ntpsnmpd.1@1.2 +2 -2 NTP_4_2_5P133 packageinfo.sh@1.136 +1 -1 NTP_4_2_5P133 sntp/sntp-opts.c@1.121 +2 -2 NTP_4_2_5P133 sntp/sntp-opts.h@1.121 +3 -3 NTP_4_2_5P133 sntp/sntp-opts.texi@1.120 +1 -1 NTP_4_2_5P133 sntp/sntp.1@1.120 +2 -2 NTP_4_2_5P133 util/ntp-keygen-opts.c@1.124 +2 -2 NTP_4_2_5P133 util/ntp-keygen-opts.h@1.124 +3 -3 NTP_4_2_5P133 util/ntp-keygen-opts.texi@1.123 +1 -1 NTP_4_2_5P133 util/ntp-keygen.1@1.123 +2 -2 NTP_4_2_5P133 ChangeSet@1.1735.1.53, 2008-09-16 03:34:05-04:00, stenn@whimsy.udel.edu Add options processing to ntpsnmpd. .point-changed-filelist@1.4 +4 -0 Add options processing to ntpsnmpd. ChangeLog@1.233 +1 -0 Add options processing to ntpsnmpd. ntpsnmpd/Makefile.am@1.4 +26 -3 Add options processing to ntpsnmpd. ntpsnmpd/ntpsnmpd-opts.c@1.1 +398 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/ntpsnmpd-opts.c ntpsnmpd/ntpsnmpd-opts.c@1.0 +0 -0 ntpsnmpd/ntpsnmpd-opts.def@1.1 +28 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/ntpsnmpd-opts.def ntpsnmpd/ntpsnmpd-opts.def@1.0 +0 -0 ntpsnmpd/ntpsnmpd-opts.h@1.1 +160 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/ntpsnmpd-opts.h ntpsnmpd/ntpsnmpd-opts.h@1.0 +0 -0 ntpsnmpd/ntpsnmpd-opts.menu@1.1 +1 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/ntpsnmpd-opts.menu ntpsnmpd/ntpsnmpd-opts.menu@1.0 +0 -0 ntpsnmpd/ntpsnmpd-opts.texi@1.1 +52 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/ntpsnmpd-opts.texi ntpsnmpd/ntpsnmpd-opts.texi@1.0 +0 -0 ntpsnmpd/ntpsnmpd.1@1.1 +77 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/ntpsnmpd.1 ntpsnmpd/ntpsnmpd.1@1.0 +0 -0 ntpsnmpd/ntpsnmpd.c@1.2 +24 -8 Add options processing to ntpsnmpd. ChangeSet@1.1735.1.52, 2008-09-16 05:40:31+00:00, stenn@ntp1.isc.org [Bug 1062] Check net-snmp headers before deciding to build ntpsnmpd. ChangeLog@1.232 +1 -0 [Bug 1062] Check net-snmp headers before deciding to build ntpsnmpd. configure.ac@1.417.1.2 +10 -1 [Bug 1062] Check net-snmp headers before deciding to build ntpsnmpd. ChangeSet@1.1735.1.51, 2008-09-15 23:06:04-04:00, stenn@whimsy.udel.edu Clean up the libntpq.a build. ChangeLog@1.231 +1 -0 Clean up the libntpq.a build. ntpq/Makefile.am@1.33 +2 -1 Clean up the libntpq.a build. ChangeSet@1.1735.1.50, 2008-09-15 21:15:48-04:00, stenn@whimsy.udel.edu Regenerate ntp_parser.[ch] from ntp_parser.y ChangeLog@1.230 +1 -0 Regenerate ntp_parser.[ch] from ntp_parser.y ntpd/ntp_parser.c@1.31 +8 -8 Regenerate ntp_parser.[ch] from ntp_parser.y ntpd/ntp_parser.h@1.15 +1 -1 Regenerate ntp_parser.[ch] from ntp_parser.y ChangeSet@1.1735.1.49, 2008-09-15 07:43:30-04:00, stenn@whimsy.udel.edu NTP_4_2_5P132 TAG: NTP_4_2_5P132 ChangeLog@1.229 +1 -0 NTP_4_2_5P132 ntpd/ntpd-opts.c@1.124 +2 -2 NTP_4_2_5P132 ntpd/ntpd-opts.h@1.124 +3 -3 NTP_4_2_5P132 ntpd/ntpd-opts.texi@1.123 +1 -1 NTP_4_2_5P132 ntpd/ntpd.1@1.123 +2 -2 NTP_4_2_5P132 ntpdc/ntpdc-opts.c@1.120 +2 -2 NTP_4_2_5P132 ntpdc/ntpdc-opts.h@1.120 +3 -3 NTP_4_2_5P132 ntpdc/ntpdc-opts.texi@1.119 +1 -1 NTP_4_2_5P132 ntpdc/ntpdc.1@1.119 +2 -2 NTP_4_2_5P132 ntpq/ntpq-opts.c@1.120 +2 -2 NTP_4_2_5P132 ntpq/ntpq-opts.h@1.120 +3 -3 NTP_4_2_5P132 ntpq/ntpq-opts.texi@1.119 +1 -1 NTP_4_2_5P132 ntpq/ntpq.1@1.119 +2 -2 NTP_4_2_5P132 packageinfo.sh@1.135 +1 -1 NTP_4_2_5P132 sntp/sntp-opts.c@1.120 +2 -2 NTP_4_2_5P132 sntp/sntp-opts.h@1.120 +3 -3 NTP_4_2_5P132 sntp/sntp-opts.texi@1.119 +1 -1 NTP_4_2_5P132 sntp/sntp.1@1.119 +2 -2 NTP_4_2_5P132 util/ntp-keygen-opts.c@1.123 +2 -2 NTP_4_2_5P132 util/ntp-keygen-opts.h@1.123 +3 -3 NTP_4_2_5P132 util/ntp-keygen-opts.texi@1.122 +1 -1 NTP_4_2_5P132 util/ntp-keygen.1@1.122 +2 -2 NTP_4_2_5P132 ChangeSet@1.1735.1.48, 2008-09-14 18:41:58-04:00, stenn@whimsy.udel.edu Remove comment made spurious by the fix for [Bug 1067] ntpd/ntpd.c@1.97 +0 -1 Remove comment made spurious by the fix for [Bug 1067] ChangeSet@1.1735.1.47, 2008-09-14 18:32:56-04:00, stenn@pogo.udel.edu tidy a comment ChangeLog@1.228 +3 -2 tidy a comment ChangeSet@1.1735.1.46, 2008-09-14 18:11:27-04:00, utterback@pogo.udel.edu ntpd.c, ChangeLog: Multicast DNS service registration must come after the fork on Solaris. ChangeLog@1.227 +1 -0 Multicast DNS service registration must come after the fork on Solaris. ntpd/ntpd.c@1.96 +8 -8 Multicast DNS service registration must come after the fork on Solaris. ChangeSet@1.1735.1.45, 2008-09-14 10:35:32-04:00, utterback@pogo.udel.edu ChangeLog: Error messages should log as errors. ntp_parser.y, ntp_config.c: Error messages should log as errors. ChangeLog@1.226 +1 -0 Error messages should log as errors ntpd/ntp_config.c@1.184 +1 -1 Error messages should log as errors. ntpd/ntp_parser.y@1.25 +5 -5 Error messages should log as errors. ChangeSet@1.1735.1.44, 2008-09-14 07:43:33-04:00, stenn@whimsy.udel.edu NTP_4_2_5P131 TAG: NTP_4_2_5P131 ChangeLog@1.225 +1 -0 NTP_4_2_5P131 ntpd/ntpd-opts.c@1.123 +2 -2 NTP_4_2_5P131 ntpd/ntpd-opts.h@1.123 +3 -3 NTP_4_2_5P131 ntpd/ntpd-opts.texi@1.122 +1 -1 NTP_4_2_5P131 ntpd/ntpd.1@1.122 +2 -2 NTP_4_2_5P131 ntpdc/ntpdc-opts.c@1.119 +2 -2 NTP_4_2_5P131 ntpdc/ntpdc-opts.h@1.119 +3 -3 NTP_4_2_5P131 ntpdc/ntpdc-opts.texi@1.118 +1 -1 NTP_4_2_5P131 ntpdc/ntpdc.1@1.118 +2 -2 NTP_4_2_5P131 ntpq/ntpq-opts.c@1.119 +2 -2 NTP_4_2_5P131 ntpq/ntpq-opts.h@1.119 +3 -3 NTP_4_2_5P131 ntpq/ntpq-opts.texi@1.118 +1 -1 NTP_4_2_5P131 ntpq/ntpq.1@1.118 +2 -2 NTP_4_2_5P131 packageinfo.sh@1.134 +1 -1 NTP_4_2_5P131 sntp/sntp-opts.c@1.119 +2 -2 NTP_4_2_5P131 sntp/sntp-opts.h@1.119 +3 -3 NTP_4_2_5P131 sntp/sntp-opts.texi@1.118 +1 -1 NTP_4_2_5P131 sntp/sntp.1@1.118 +2 -2 NTP_4_2_5P131 util/ntp-keygen-opts.c@1.122 +2 -2 NTP_4_2_5P131 util/ntp-keygen-opts.h@1.122 +3 -3 NTP_4_2_5P131 util/ntp-keygen-opts.texi@1.121 +1 -1 NTP_4_2_5P131 util/ntp-keygen.1@1.121 +2 -2 NTP_4_2_5P131 ChangeSet@1.1735.1.43, 2008-09-13 23:07:30-04:00, stenn@pogo.udel.edu [Bug 1065] Re-enable support for the timingstats file ChangeLog@1.224 +1 -0 [Bug 1065] Re-enable support for the timingstats file ChangeSet@1.1735.1.42, 2008-09-13 23:03:22-04:00, stenn@pogo.udel.edu rebuild ntp_parser.[ch] with newer bison ntpd/ntp_parser.c@1.30 +2449 -1618 rebuild with newer bison ntpd/ntp_parser.h@1.14 +363 -161 rebuild with newer bison ChangeSet@1.1735.1.41, 2008-09-13 21:42:40-04:00, utterback@pogo.udel.edu ntp_config.c: Reinstate timingstats file ntpd/ntp_config.c@1.183 +1 -0 Reinstate timingstats file ChangeSet@1.1735.7.4, 2008-09-13 07:49:17-04:00, stenn@whimsy.udel.edu NTP_4_2_5P130 TAG: NTP_4_2_5P130 ChangeLog@1.223 +1 -0 NTP_4_2_5P130 ntpd/ntpd-opts.c@1.122 +2 -2 NTP_4_2_5P130 ntpd/ntpd-opts.h@1.122 +3 -3 NTP_4_2_5P130 ntpd/ntpd-opts.texi@1.121 +1 -1 NTP_4_2_5P130 ntpd/ntpd.1@1.121 +2 -2 NTP_4_2_5P130 ntpdc/ntpdc-opts.c@1.118 +2 -2 NTP_4_2_5P130 ntpdc/ntpdc-opts.h@1.118 +3 -3 NTP_4_2_5P130 ntpdc/ntpdc-opts.texi@1.117 +1 -1 NTP_4_2_5P130 ntpdc/ntpdc.1@1.117 +2 -2 NTP_4_2_5P130 ntpq/ntpq-opts.c@1.118 +2 -2 NTP_4_2_5P130 ntpq/ntpq-opts.h@1.118 +3 -3 NTP_4_2_5P130 ntpq/ntpq-opts.texi@1.117 +1 -1 NTP_4_2_5P130 ntpq/ntpq.1@1.117 +2 -2 NTP_4_2_5P130 packageinfo.sh@1.133 +1 -1 NTP_4_2_5P130 sntp/sntp-opts.c@1.118 +2 -2 NTP_4_2_5P130 sntp/sntp-opts.h@1.118 +3 -3 NTP_4_2_5P130 sntp/sntp-opts.texi@1.117 +1 -1 NTP_4_2_5P130 sntp/sntp.1@1.117 +2 -2 NTP_4_2_5P130 util/ntp-keygen-opts.c@1.121 +2 -2 NTP_4_2_5P130 util/ntp-keygen-opts.h@1.121 +3 -3 NTP_4_2_5P130 util/ntp-keygen-opts.texi@1.120 +1 -1 NTP_4_2_5P130 util/ntp-keygen.1@1.120 +2 -2 NTP_4_2_5P130 ChangeSet@1.1735.7.3, 2008-09-13 05:04:00-04:00, stenn@whimsy.udel.edu [Bug 1064] Implement --with-net-snmp-config=progname ChangeLog@1.222 +1 -1 [Bug 1064] Implement --with-net-snmp-config=progname ChangeSet@1.1735.7.2, 2008-09-13 04:58:45-04:00, stenn@whimsy.udel.edu net-snmp-config cleanup ChangeLog@1.221 +1 -0 net-snmp-config cleanup configure.ac@1.417.1.1 +45 -3 net-snmp-config cleanup ntpsnmpd/Makefile.am@1.3 +2 -13 net-snmp-config cleanup ChangeSet@1.1735.7.1, 2008-09-12 15:20:13-04:00, stenn@whimsy.udel.edu [Bug 1063] ntpSnmpSubagentObject.h is missing from the distribution ChangeLog@1.220 +1 -0 [Bug 1063] ntpSnmpSubagentObject.h is missing from the distribution ntpsnmpd/Makefile.am@1.2 +1 -0 [Bug 1063] ntpSnmpSubagentObject.h is missing from the distribution ChangeSet@1.1735.1.39, 2008-09-12 09:39:33-04:00, utterback@pogo.udel.edu ntp_util.c, ntp_parser.y, ntp_parser.h, ntp_parser.c: Reinstate lost timingstats file ntpd/ntp_parser.c@1.29 +1818 -2649 Reinstate lost timingstats file ntpd/ntp_parser.h@1.13 +161 -361 Reinstate lost timingstats file ntpd/ntp_parser.y@1.24 +3 -0 Reinstate lost timingstats file ntpd/ntp_util.c@1.66 +8 -0 Reinstate lost timingstats file ChangeSet@1.1735.1.38, 2008-09-11 07:43:06-04:00, stenn@whimsy.udel.edu NTP_4_2_5P129 TAG: NTP_4_2_5P129 ChangeLog@1.219 +1 -0 NTP_4_2_5P129 ntpd/ntpd-opts.c@1.121 +2 -2 NTP_4_2_5P129 ntpd/ntpd-opts.h@1.121 +3 -3 NTP_4_2_5P129 ntpd/ntpd-opts.texi@1.120 +1 -1 NTP_4_2_5P129 ntpd/ntpd.1@1.120 +2 -2 NTP_4_2_5P129 ntpdc/ntpdc-opts.c@1.117 +2 -2 NTP_4_2_5P129 ntpdc/ntpdc-opts.h@1.117 +3 -3 NTP_4_2_5P129 ntpdc/ntpdc-opts.texi@1.116 +1 -1 NTP_4_2_5P129 ntpdc/ntpdc.1@1.116 +2 -2 NTP_4_2_5P129 ntpq/ntpq-opts.c@1.117 +2 -2 NTP_4_2_5P129 ntpq/ntpq-opts.h@1.117 +3 -3 NTP_4_2_5P129 ntpq/ntpq-opts.texi@1.116 +1 -1 NTP_4_2_5P129 ntpq/ntpq.1@1.116 +2 -2 NTP_4_2_5P129 packageinfo.sh@1.132 +1 -1 NTP_4_2_5P129 sntp/sntp-opts.c@1.117 +2 -2 NTP_4_2_5P129 sntp/sntp-opts.h@1.117 +3 -3 NTP_4_2_5P129 sntp/sntp-opts.texi@1.116 +1 -1 NTP_4_2_5P129 sntp/sntp.1@1.116 +2 -2 NTP_4_2_5P129 util/ntp-keygen-opts.c@1.120 +2 -2 NTP_4_2_5P129 util/ntp-keygen-opts.h@1.120 +3 -3 NTP_4_2_5P129 util/ntp-keygen-opts.texi@1.119 +1 -1 NTP_4_2_5P129 util/ntp-keygen.1@1.119 +2 -2 NTP_4_2_5P129 ChangeSet@1.1735.1.37, 2008-09-11 02:52:01-04:00, stenn@whimsy.udel.edu Quiet some libntpq-related warnings ChangeLog@1.218 +1 -0 Quiet some libntpq-related warnings ntpq/Makefile.am@1.32 +2 -2 Quiet some libntpq-related warnings ntpq/libntpq.c@1.2 +1 -1 Quiet some libntpq-related warnings ChangeSet@1.1771, 2008-09-11 00:35:34-04:00, stenn@pogo.udel.edu No c++ or F77 for libtool, get socket libraries gsoc_sntp/configure.ac@1.4 +13 -0 No c++ or F77 for libtool, get socket libraries ChangeSet@1.1770, 2008-09-11 00:32:37-04:00, stenn@pogo.udel.edu doc strings must be tab-indented, not space gsoc_sntp/sntp-opts.def@1.8 +2 -4 doc strings must be tab-indented, not space ChangeSet@1.1768, 2008-09-10 20:26:26-04:00, stenn@pogo.udel.edu updates gsoc_sntp/Makefile.am@1.4 +1 -0 updates gsoc_sntp/log.c@1.7 +5 -1 updates gsoc_sntp/sntp-opts.def@1.7 +49 -33 updates ChangeSet@1.1767, 2008-09-10 23:37:56+00:00, kuehn@pogo.udel.edu main.c: fixed includes crypto.c, networking.c: Fixed compile errors gsoc_sntp/crypto.c@1.3 +3 -3 Fixed compile errors gsoc_sntp/crypto.h@1.3 +1 -1 gsoc_sntp/main.c@1.9 +2 -2 fixed includes gsoc_sntp/networking.c@1.15 +8 -9 Fixed compile errors gsoc_sntp/networking.h@1.11 +2 -0 ChangeSet@1.1766, 2008-09-10 22:58:04+00:00, kuehn@pogo.udel.edu log.h: fixed missing timestamp for file logging kod_management.c: Fixed the core dump when no kod file is specified networking.c: Some fixes for broadcast mode remove filter reachable (no use for this function) utilities.c: Added a function to convert a struct sockaddr_storage to a string containing its hostname crypto.c: Completeted auth md5 functions BitKeeper/etc/gone@1.8 +14 -0 gsoc_sntp/crypto.c@1.2 +125 -39 Completeted auth md5 functions gsoc_sntp/crypto.h@1.2 +35 -5 gsoc_sntp/header.h@1.3 +5 -3 gsoc_sntp/kod_management.c@1.6 +25 -4 Fixed the core dump when no kod file is specified gsoc_sntp/kod_management.h@1.4 +18 -1 gsoc_sntp/log.c@1.6 +26 -5 gsoc_sntp/log.h@1.4 +20 -2 fixed missing timestamp for file logging gsoc_sntp/main.c@1.8 +18 -11 gsoc_sntp/networking.c@1.14 +457 -94 Some fixes for broadcast mode remove filter reachable (no use for this function) gsoc_sntp/networking.h@1.10 +33 -3 gsoc_sntp/utilities.c@1.4 +46 -0 Added a function to convert a struct sockaddr_storage to a string containing its hostname gsoc_sntp/utilities.h@1.3 +35 -0 ChangeSet@1.1735.1.36, 2008-09-08 07:46:43-04:00, stenn@whimsy.udel.edu NTP_4_2_5P128 TAG: NTP_4_2_5P128 ChangeLog@1.217 +1 -0 NTP_4_2_5P128 ntpd/ntpd-opts.c@1.120 +2 -2 NTP_4_2_5P128 ntpd/ntpd-opts.h@1.120 +3 -3 NTP_4_2_5P128 ntpd/ntpd-opts.texi@1.119 +2 -2 NTP_4_2_5P128 ntpd/ntpd.1@1.119 +2 -2 NTP_4_2_5P128 ntpdc/ntpdc-opts.c@1.116 +2 -2 NTP_4_2_5P128 ntpdc/ntpdc-opts.h@1.116 +3 -3 NTP_4_2_5P128 ntpdc/ntpdc-opts.texi@1.115 +2 -2 NTP_4_2_5P128 ntpdc/ntpdc.1@1.115 +2 -2 NTP_4_2_5P128 ntpq/ntpq-opts.c@1.116 +2 -2 NTP_4_2_5P128 ntpq/ntpq-opts.h@1.116 +3 -3 NTP_4_2_5P128 ntpq/ntpq-opts.texi@1.115 +2 -2 NTP_4_2_5P128 ntpq/ntpq.1@1.115 +2 -2 NTP_4_2_5P128 packageinfo.sh@1.131 +1 -1 NTP_4_2_5P128 sntp/sntp-opts.c@1.116 +2 -2 NTP_4_2_5P128 sntp/sntp-opts.h@1.116 +3 -3 NTP_4_2_5P128 sntp/sntp-opts.texi@1.115 +1 -1 NTP_4_2_5P128 sntp/sntp.1@1.115 +2 -2 NTP_4_2_5P128 util/ntp-keygen-opts.c@1.119 +2 -2 NTP_4_2_5P128 util/ntp-keygen-opts.h@1.119 +3 -3 NTP_4_2_5P128 util/ntp-keygen-opts.texi@1.118 +2 -2 NTP_4_2_5P128 util/ntp-keygen.1@1.118 +2 -2 NTP_4_2_5P128 ChangeSet@1.1735.6.4, 2008-09-08 03:57:36-04:00, stenn@whimsy.udel.edu Cleanup missing ChangeLog message ChangeLog@1.213.1.3 +1 -0 Cleanup missing ChangeLog message ChangeSet@1.1759.1.1, 2008-09-05 00:08:08+00:00, kuehn@pogo.udel.edu kod_management.h, main.c, kod_management.c: Fixes networking.h: fixes + broadcast mode crypto.h: BitKeeper file /pogo/users/kuehn/rsync_repo/ntp-dev/gsoc_sntp/crypto.h crypto.c: BitKeeper file /pogo/users/kuehn/rsync_repo/ntp-dev/gsoc_sntp/crypto.c networking.c: Fixes Broadcast mode sntp-opts.def: Added new options, removed host list gsoc_sntp/crypto.c@1.1 +97 -0 BitKeeper file /pogo/users/kuehn/rsync_repo/ntp-dev/gsoc_sntp/crypto.c gsoc_sntp/crypto.c@1.0 +0 -0 gsoc_sntp/crypto.h@1.1 +19 -0 BitKeeper file /pogo/users/kuehn/rsync_repo/ntp-dev/gsoc_sntp/crypto.h gsoc_sntp/crypto.h@1.0 +0 -0 ChangeSet@1.1735.6.3, 2008-09-01 07:42:29-04:00, stenn@whimsy.udel.edu NTP_4_2_5P127 TAG: NTP_4_2_5P127 ChangeLog@1.213.1.2 +1 -0 NTP_4_2_5P127 ntpd/ntpd-opts.c@1.119 +2 -2 NTP_4_2_5P127 ntpd/ntpd-opts.h@1.119 +3 -3 NTP_4_2_5P127 ntpd/ntpd-opts.texi@1.118 +1 -1 NTP_4_2_5P127 ntpd/ntpd.1@1.118 +2 -2 NTP_4_2_5P127 ntpdc/ntpdc-opts.c@1.115 +2 -2 NTP_4_2_5P127 ntpdc/ntpdc-opts.h@1.115 +3 -3 NTP_4_2_5P127 ntpdc/ntpdc-opts.texi@1.114 +1 -1 NTP_4_2_5P127 ntpdc/ntpdc.1@1.114 +2 -2 NTP_4_2_5P127 ntpq/ntpq-opts.c@1.115 +2 -2 NTP_4_2_5P127 ntpq/ntpq-opts.h@1.115 +3 -3 NTP_4_2_5P127 ntpq/ntpq-opts.texi@1.114 +1 -1 NTP_4_2_5P127 ntpq/ntpq.1@1.114 +2 -2 NTP_4_2_5P127 packageinfo.sh@1.130 +1 -1 NTP_4_2_5P127 sntp/sntp-opts.c@1.115 +2 -2 NTP_4_2_5P127 sntp/sntp-opts.h@1.115 +3 -3 NTP_4_2_5P127 sntp/sntp-opts.texi@1.114 +1 -1 NTP_4_2_5P127 sntp/sntp.1@1.114 +2 -2 NTP_4_2_5P127 util/ntp-keygen-opts.c@1.118 +2 -2 NTP_4_2_5P127 util/ntp-keygen-opts.h@1.118 +3 -3 NTP_4_2_5P127 util/ntp-keygen-opts.texi@1.117 +1 -1 NTP_4_2_5P127 util/ntp-keygen.1@1.117 +2 -2 NTP_4_2_5P127 ChangeSet@1.1735.6.2, 2008-08-31 20:42:07-04:00, stenn@whimsy.udel.edu regenerate ntp_parser.c ntpd/ntp_parser.c@1.28 +802 -851 regenerate ntp_parser.c ChangeSet@1.1735.6.1, 2008-08-31 07:49:04-04:00, stenn@whimsy.udel.edu NTP_4_2_5P126 TAG: NTP_4_2_5P126 ChangeLog@1.213.1.1 +1 -0 NTP_4_2_5P126 ntpd/ntpd-opts.c@1.118 +2 -2 NTP_4_2_5P126 ntpd/ntpd-opts.h@1.118 +3 -3 NTP_4_2_5P126 ntpd/ntpd-opts.texi@1.117 +1 -1 NTP_4_2_5P126 ntpd/ntpd.1@1.117 +2 -2 NTP_4_2_5P126 ntpdc/ntpdc-opts.c@1.114 +2 -2 NTP_4_2_5P126 ntpdc/ntpdc-opts.h@1.114 +3 -3 NTP_4_2_5P126 ntpdc/ntpdc-opts.texi@1.113 +1 -1 NTP_4_2_5P126 ntpdc/ntpdc.1@1.113 +2 -2 NTP_4_2_5P126 ntpq/ntpq-opts.c@1.114 +2 -2 NTP_4_2_5P126 ntpq/ntpq-opts.h@1.114 +3 -3 NTP_4_2_5P126 ntpq/ntpq-opts.texi@1.113 +1 -1 NTP_4_2_5P126 ntpq/ntpq.1@1.113 +2 -2 NTP_4_2_5P126 packageinfo.sh@1.129 +1 -1 NTP_4_2_5P126 sntp/sntp-opts.c@1.114 +2 -2 NTP_4_2_5P126 sntp/sntp-opts.h@1.114 +3 -3 NTP_4_2_5P126 sntp/sntp-opts.texi@1.113 +1 -1 NTP_4_2_5P126 sntp/sntp.1@1.113 +2 -2 NTP_4_2_5P126 util/ntp-keygen-opts.c@1.117 +2 -2 NTP_4_2_5P126 util/ntp-keygen-opts.h@1.117 +3 -3 NTP_4_2_5P126 util/ntp-keygen-opts.texi@1.116 +1 -1 NTP_4_2_5P126 util/ntp-keygen.1@1.116 +2 -2 NTP_4_2_5P126 ChangeSet@1.1764, 2008-08-31 07:15:07-04:00, stenn@pogo.udel.edu portability fixes configure.ac@1.416.1.1 +1 -0 build gsoc_snmp ChangeSet@1.1763, 2008-08-31 05:56:21-04:00, stenn@pogo.udel.edu Have libtool ignore C++ and F77 ChangeSet@1.1735.5.1, 2008-08-31 04:59:46-04:00, stenn@pogo.udel.edu Prepare for GSoC2008 NTP MIB daemon import ChangeLog@1.212.1.1 +1 -0 Prepare for GSoC2008 NTP MIB daemon import Makefile.am@1.76.1.1 +2 -0 Prepare for GSoC2008 NTP MIB daemon import configure.ac@1.415.1.1 +27 -0 Prepare for GSoC2008 NTP MIB daemon import ntpq/Makefile.am@1.31 +6 -5 Prepare for GSoC2008 NTP MIB daemon import ntpq/libntpq.c@1.1 +790 -0 BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpq/libntpq.c ntpq/libntpq.c@1.0 +0 -0 ntpq/libntpq.h@1.1 +108 -0 BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpq/libntpq.h ntpq/libntpq.h@1.0 +0 -0 ntpq/libntpq_subs.c@1.1 +50 -0 BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpq/libntpq_subs.c ntpq/libntpq_subs.c@1.0 +0 -0 ntpq/ntpq.c@1.75 +7 -2 Prepare for GSoC2008 NTP MIB daemon import ntpsnmpd/Makefile.am@1.1 +19 -0 BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpsnmpd/Makefile.am ntpsnmpd/Makefile.am@1.0 +0 -0 ntpsnmpd/README@1.1 +40 -0 BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpsnmpd/README ntpsnmpd/README@1.0 +0 -0 ntpsnmpd/ntpSnmpSubagentObject.c@1.1 +490 -0 BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpsnmpd/ntpSnmpSubagentObject.c ntpsnmpd/ntpSnmpSubagentObject.c@1.0 +0 -0 ntpsnmpd/ntpSnmpSubagentObject.h@1.1 +72 -0 BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpsnmpd/ntpSnmpSubagentObject.h ntpsnmpd/ntpSnmpSubagentObject.h@1.0 +0 -0 ntpsnmpd/ntpsnmpd.c@1.1 +107 -0 BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpsnmpd/ntpsnmpd.c ntpsnmpd/ntpsnmpd.c@1.0 +0 -0 ChangeSet@1.1735.1.32, 2008-08-31 04:43:40-04:00, stenn@whimsy.udel.edu Stop libtool-1.5 from looking for C++ or Fortran sntp/configure.ac@1.17 +3 -0 Stop libtool-1.5 from looking for C++ or Fortran ChangeSet@1.1735.1.31, 2008-08-31 04:33:40-04:00, stenn@whimsy.udel.edu Stop libtool-1.5 from looking for C++ or Fortran ChangeLog@1.213 +1 -0 Stop libtool-1.5 from looking for C++ or Fortran configure.ac@1.416 +4 -0 Stop libtool-1.5 from looking for C++ or Fortran ChangeSet@1.1735.4.4, 2008-08-31 02:06:36-04:00, stenn@whimsy.udel.edu [Bug 828] Fix IPv4/IPv6 address parsing ChangeLog@1.210.1.4 +1 -0 [Bug 828] Fix IPv4/IPv6 address parsing ntpd/ntp_config.c@1.182 +11 -2 [Bug 828] Fix IPv4/IPv6 address parsing ntpd/ntp_parser.y@1.23 +9 -42 [Bug 828] Fix IPv4/IPv6 address parsing ntpd/ntp_scanner.c@1.13 +43 -31 [Bug 828] Fix IPv4/IPv6 address parsing ChangeSet@1.1761, 2008-08-31 01:43:34-04:00, stenn@pogo.udel.edu portability fixes ChangeSet@1.1735.4.3, 2008-08-30 23:19:40-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.210.1.3 +1 -0 Documentation updates from Dave Mills html/confopt.html@1.43 +1 -1 Documentation updates from Dave Mills html/decode.html@1.3 +0 -1 Documentation updates from Dave Mills html/gadget.html@1.3 +3 -3 Documentation updates from Dave Mills html/howto.html@1.20 +3 -2 Documentation updates from Dave Mills html/index.html@1.38 +9 -8 Documentation updates from Dave Mills html/kern.html@1.17 +3 -3 Documentation updates from Dave Mills html/keygen.html@1.13 +65 -20 Documentation updates from Dave Mills html/manyopt.html@1.18 +3 -3 Documentation updates from Dave Mills html/ntp_conf.html@1.3 +10 -9 Documentation updates from Dave Mills html/ntpd.html@1.46 +9 -9 Documentation updates from Dave Mills html/ntpdsim_new.html@1.4 +8 -1 Documentation updates from Dave Mills html/parsenew.html@1.11 +1 -3 Documentation updates from Dave Mills html/pps.html@1.20 +6 -4 Documentation updates from Dave Mills html/prefer.html@1.17 +14 -14 Documentation updates from Dave Mills html/rate.html@1.4 +14 -8 Documentation updates from Dave Mills html/refclock.html@1.34 +47 -47 Documentation updates from Dave Mills html/release.html@1.36 +27 -24 Documentation updates from Dave Mills html/xleave.html@1.3 +3 -2 Documentation updates from Dave Mills ChangeSet@1.1735.4.2, 2008-08-30 23:14:01-04:00, stenn@whimsy.udel.edu Fix a corner case where a frequency update was reported but not set ChangeLog@1.210.1.2 +1 -0 Fix a corner case where a frequency update was reported but not set ntpd/ntp_loopfilter.c@1.147 +6 -5 Fix a corner case where a frequency update was reported but not set ChangeSet@1.1735.4.1, 2008-08-30 22:09:29-04:00, stenn@whimsy.udel.edu When LEAP_NOTINSYNC->LEAP_NOWARNING, call crypto_update() if we have crypto_flags ChangeLog@1.210.1.1 +3 -0 When LEAP_NOTINSYNC->LEAP_NOWARNING, call crypto_update() if we have crypto_flags html/pic/boom4.gif@1.1 +361 -0 BitKeeper file /deacon/backroom/ntp-dev/html/pic/boom4.gif html/pic/boom4.gif@1.0 +0 -0 ntpd/ntp_proto.c@1.275 +6 -1 When LEAP_NOTINSYNC->LEAP_NOWARNING, call crypto_update() if we have crypto_flags ChangeSet@1.1759, 2008-08-22 21:27:59-04:00, stenn@pogo.udel.edu remove bogus .o file BitKeeper/deleted/.del-utilities.o@1.2 +0 -0 Delete: gsoc_sntp/utilities.o ChangeSet@1.1735.1.29, 2008-08-21 05:05:19+00:00, gopal@pogo.udel.edu driver20.html: [BUG 610] Documentation update for NMEA reference clock driver. ChangeLog: Added appropriate comments for documentation update. ChangeLog@1.211 +1 -0 Added appropriate comments for documentation update. html/drivers/driver20.html@1.15 +23 -6 [BUG 610] Documentation update for NMEA reference clock driver. ChangeSet@1.1757, 2008-08-18 21:37:27+09:00, Amidamaru@yumi.mxiesoft.com utilities.c, networking.c: Fixes sntp-opts.def: added broadcast and timeout options log.c: Fixes, one bug with filelogging left main.c: Fixed KOD handling in on_Ãwire gsoc_sntp/log.c@1.5 +2 -4 Fixes, one bug with filelogging left gsoc_sntp/main.c@1.7 +87 -35 Fixed KOD handling in on_Ãwire gsoc_sntp/networking.c@1.13 +85 -75 Fixes gsoc_sntp/networking.h@1.9 +85 -14 gsoc_sntp/sntp-opts.def@1.6 +23 -0 added broadcast and timeout options gsoc_sntp/utilities.c@1.3 +12 -0 Fixes gsoc_sntp/utilities.h@1.2 +1 -0 ChangeSet@1.1735.1.28, 2008-08-18 07:43:18-04:00, stenn@whimsy.udel.edu NTP_4_2_5P125 TAG: NTP_4_2_5P125 ChangeLog@1.210 +1 -0 NTP_4_2_5P125 ntpd/ntpd-opts.c@1.117 +2 -2 NTP_4_2_5P125 ntpd/ntpd-opts.h@1.117 +3 -3 NTP_4_2_5P125 ntpd/ntpd-opts.texi@1.116 +1 -1 NTP_4_2_5P125 ntpd/ntpd.1@1.116 +2 -2 NTP_4_2_5P125 ntpdc/ntpdc-opts.c@1.113 +2 -2 NTP_4_2_5P125 ntpdc/ntpdc-opts.h@1.113 +3 -3 NTP_4_2_5P125 ntpdc/ntpdc-opts.texi@1.112 +1 -1 NTP_4_2_5P125 ntpdc/ntpdc.1@1.112 +2 -2 NTP_4_2_5P125 ntpq/ntpq-opts.c@1.113 +2 -2 NTP_4_2_5P125 ntpq/ntpq-opts.h@1.113 +3 -3 NTP_4_2_5P125 ntpq/ntpq-opts.texi@1.112 +1 -1 NTP_4_2_5P125 ntpq/ntpq.1@1.112 +2 -2 NTP_4_2_5P125 packageinfo.sh@1.128 +1 -1 NTP_4_2_5P125 sntp/sntp-opts.c@1.113 +2 -2 NTP_4_2_5P125 sntp/sntp-opts.h@1.113 +3 -3 NTP_4_2_5P125 sntp/sntp-opts.texi@1.112 +1 -1 NTP_4_2_5P125 sntp/sntp.1@1.112 +2 -2 NTP_4_2_5P125 util/ntp-keygen-opts.c@1.116 +2 -2 NTP_4_2_5P125 util/ntp-keygen-opts.h@1.116 +3 -3 NTP_4_2_5P125 util/ntp-keygen-opts.texi@1.115 +1 -1 NTP_4_2_5P125 util/ntp-keygen.1@1.115 +2 -2 NTP_4_2_5P125 ChangeSet@1.1735.1.27, 2008-08-17 19:38:48-04:00, stenn@pogo.udel.edu [Bug 1052] Add linuxPPS support to ONCORE driver ChangeLog@1.209 +1 -0 [Bug 1052] Add linuxPPS support to ONCORE driver ChangeSet@1.1735.3.3, 2008-08-17 07:52:08-04:00, stenn@whimsy.udel.edu NTP_4_2_5P124 TAG: NTP_4_2_5P124 ChangeLog@1.208 +1 -0 NTP_4_2_5P124 ntpd/ntpd-opts.c@1.116 +2 -2 NTP_4_2_5P124 ntpd/ntpd-opts.h@1.116 +3 -3 NTP_4_2_5P124 ntpd/ntpd-opts.texi@1.115 +1 -1 NTP_4_2_5P124 ntpd/ntpd.1@1.115 +2 -2 NTP_4_2_5P124 ntpdc/ntpdc-opts.c@1.112 +2 -2 NTP_4_2_5P124 ntpdc/ntpdc-opts.h@1.112 +3 -3 NTP_4_2_5P124 ntpdc/ntpdc-opts.texi@1.111 +1 -1 NTP_4_2_5P124 ntpdc/ntpdc.1@1.111 +2 -2 NTP_4_2_5P124 ntpq/ntpq-opts.c@1.112 +2 -2 NTP_4_2_5P124 ntpq/ntpq-opts.h@1.112 +3 -3 NTP_4_2_5P124 ntpq/ntpq-opts.texi@1.111 +1 -1 NTP_4_2_5P124 ntpq/ntpq.1@1.111 +2 -2 NTP_4_2_5P124 packageinfo.sh@1.127 +1 -1 NTP_4_2_5P124 sntp/sntp-opts.c@1.112 +2 -2 NTP_4_2_5P124 sntp/sntp-opts.h@1.112 +3 -3 NTP_4_2_5P124 sntp/sntp-opts.texi@1.111 +1 -1 NTP_4_2_5P124 sntp/sntp.1@1.111 +2 -2 NTP_4_2_5P124 util/ntp-keygen-opts.c@1.115 +2 -2 NTP_4_2_5P124 util/ntp-keygen-opts.h@1.115 +3 -3 NTP_4_2_5P124 util/ntp-keygen-opts.texi@1.114 +1 -1 NTP_4_2_5P124 util/ntp-keygen.1@1.114 +2 -2 NTP_4_2_5P124 ChangeSet@1.1735.3.2, 2008-08-17 06:57:54-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.207 +1 -0 Documentation updates from Dave Mills html/ntpd.html@1.45 +11 -1 Documentation updates from Dave Mills html/xleave.html@1.2 +9 -2 Documentation updates from Dave Mills ChangeSet@1.1436.15.6, 2008-08-17 06:21:39-04:00, stenn@whimsy.udel.edu typo scripts/addChangeLogTag@1.3 +0 -3 typo ChangeSet@1.1436.15.5, 2008-08-17 06:16:19-04:00, stenn@whimsy.udel.edu typo ChangeLog@1.1.1.44 +0 -2 typo ChangeSet@1.1436.15.4, 2008-08-17 05:30:47-04:00, stenn@whimsy.udel.edu NTP_4_2_4P5 TAG: NTP_4_2_4P5 ChangeLog@1.1.1.43 +3 -0 NTP_4_2_4P5 ntpd/ntpd-opts.c@1.50.16.1 +2 -2 NTP_4_2_4P5 ntpd/ntpd-opts.h@1.50.16.1 +3 -3 NTP_4_2_4P5 ntpd/ntpd-opts.texi@1.49.16.1 +1 -1 NTP_4_2_4P5 ntpd/ntpd.1@1.48.16.1 +2 -2 NTP_4_2_4P5 ntpd/ntpdsim-opts.c@1.50.16.1 +2 -2 NTP_4_2_4P5 ntpd/ntpdsim-opts.h@1.50.16.1 +3 -3 NTP_4_2_4P5 ntpd/ntpdsim-opts.texi@1.48.16.1 +1 -1 NTP_4_2_4P5 ntpd/ntpdsim.1@1.48.16.1 +2 -2 NTP_4_2_4P5 ntpdc/ntpdc-opts.c@1.50.16.1 +2 -2 NTP_4_2_4P5 ntpdc/ntpdc-opts.h@1.50.16.1 +3 -3 NTP_4_2_4P5 ntpdc/ntpdc-opts.texi@1.48.16.1 +1 -1 NTP_4_2_4P5 ntpdc/ntpdc.1@1.48.16.1 +2 -2 NTP_4_2_4P5 ntpq/ntpq-opts.c@1.52.16.1 +2 -2 NTP_4_2_4P5 ntpq/ntpq-opts.h@1.52.16.1 +3 -3 NTP_4_2_4P5 ntpq/ntpq-opts.texi@1.49.16.1 +1 -1 NTP_4_2_4P5 ntpq/ntpq.1@1.48.16.1 +2 -2 NTP_4_2_4P5 packageinfo.sh@1.65.23.2 +2 -2 NTP_4_2_4P5 sntp/sntp-opts.c@1.49.16.1 +2 -2 NTP_4_2_4P5 sntp/sntp-opts.h@1.49.16.1 +3 -3 NTP_4_2_4P5 sntp/sntp-opts.texi@1.46.16.1 +1 -1 NTP_4_2_4P5 sntp/sntp.1@1.49.16.1 +2 -2 NTP_4_2_4P5 util/ntp-keygen-opts.c@1.49.16.1 +2 -2 NTP_4_2_4P5 util/ntp-keygen-opts.h@1.49.16.1 +3 -3 NTP_4_2_4P5 util/ntp-keygen-opts.texi@1.47.16.1 +1 -1 NTP_4_2_4P5 util/ntp-keygen.1@1.47.16.1 +2 -2 NTP_4_2_4P5 ChangeSet@1.1436.15.3, 2008-08-17 05:29:47-04:00, stenn@whimsy.udel.edu typo scripts/addChangeLogTag@1.2 +1 -1 typo ChangeSet@1.1436.15.2, 2008-08-17 03:28:53-04:00, stenn@whimsy.udel.edu 4.2.4p5 prep .point-changed-filelist@1.1.1.1 +1 -0 4.2.4p5 prep NEWS@1.86.1.13 +17 -0 4.2.4p5 prep packageinfo.sh@1.65.23.1 +1 -1 4.2.4p5 prep scripts/addChangeLogTag@1.1 +27 -0 BitKeeper file /deacon/backroom/ntp-stable/scripts/addChangeLogTag scripts/addChangeLogTag@1.0 +0 -0 scripts/genChangeLogTag@1.1 +6 -0 BitKeeper file /deacon/backroom/ntp-stable/scripts/genChangeLogTag scripts/genChangeLogTag@1.0 +0 -0 ChangeSet@1.1436.15.1, 2008-08-16 22:42:08-04:00, stenn@whimsy.udel.edu [BUG 1051] Month off by one in leap second message written to clockstats ChangeLog@1.1.1.42 +2 -0 [BUG 1051] Month off by one in leap second message written to clockstats ntpd/refclock_oncore.c@1.60.2.1 +1 -1 [BUG 1051] Month off by one in leap second message written to clockstats ChangeSet@1.1756, 2008-08-17 05:57:54+09:00, Amidamaru@yumi.mxiesoft.com networking.h: Removed useless prototype filter_ntp main.c, utilities.c, networking.c, kod_management.c: Cleaning up gsoc_sntp/kod_management.c@1.5 +2 -4 Cleaning up gsoc_sntp/main.c@1.6 +14 -12 Cleaning up gsoc_sntp/networking.c@1.12 +4 -16 Cleaning up gsoc_sntp/networking.h@1.8 +2 -18 Removed useless prototype filter_ntp gsoc_sntp/utilities.c@1.2 +1 -1 Cleaning up ChangeSet@1.1755, 2008-08-16 06:41:28+09:00, Amidamaru@yumi.mxiesoft.com utilities.h: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/ntp-dev/gsoc_sntp/utilities.h Makefile.am: Added sntp-opts.c to sources + minor fixes main.c: on_wire, timesetting stuff etc. log.c, kod_management.c: Bug fixes utilities.o: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/ntp-dev/gsoc_sntp/utilities.o utilities.c: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/ntp-dev/gsoc_sntp/utilities.c sntp-opts.def: fixed arg-type stuff gsoc_sntp/Makefile.am@1.3 +6 -2 Added sntp-opts.c to sources + minor fixes gsoc_sntp/kod_management.c@1.4 +9 -7 Bug fixes gsoc_sntp/kod_management.h@1.3 +2 -1 gsoc_sntp/log.c@1.4 +10 -11 Bug fixes gsoc_sntp/log.h@1.3 +0 -3 gsoc_sntp/main.c@1.5 +180 -56 on_wire, timesetting stuff etc. gsoc_sntp/networking.c@1.11 +82 -72 gsoc_sntp/networking.h@1.7 +6 -4 gsoc_sntp/sntp-opts.def@1.5 +21 -6 fixed arg-type stuff gsoc_sntp/utilities.c@1.1 +101 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/ntp-dev/gsoc_sntp/utilities.c gsoc_sntp/utilities.c@1.0 +0 -0 gsoc_sntp/utilities.h@1.1 +21 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/ntp-dev/gsoc_sntp/utilities.h gsoc_sntp/utilities.h@1.0 +0 -0 gsoc_sntp/utilities.o@1.1 +177 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/ntp-dev/gsoc_sntp/utilities.o gsoc_sntp/utilities.o@1.0 +0 -0 ChangeSet@1.1436.1.105, 2008-08-10 21:56:17-04:00, clemens@pogo.udel.edu BUG[1052] Minor reordering of previous patch to make it more robust. ntpd/refclock_oncore.c@1.60.1.6 +57 -58 BUG[1052] Minor reordering of previous patch to make it more robust. ChangeSet@1.1436.1.104, 2008-08-10 18:31:13-04:00, clemens@pogo.udel.edu [BUG 1052] Modify ONCORE driver for linuxPPS which uses a line discipline for the PPS source. ntpd/refclock_oncore.c@1.60.1.5 +21 -6 [BUG 1052] Modify ONCORE driver for linuxPPS which uses a line discipline for the PPS source. ChangeSet@1.1436.1.103, 2008-08-10 18:21:32-04:00, clemens@pogo.udel.edu Remove unneeded variable. ntpd/refclock_oncore.c@1.60.1.4 +2 -3 Remove unneeded variable. ChangeSet@1.1436.1.102, 2008-08-10 18:18:56-04:00, clemens@pogo.udel.edu [BUG 1051] Month off by one in leap second message written to clockstats file, fixed. ntpd/refclock_oncore.c@1.60.1.3 +1 -1 [BUG 1051] Month off by one in leap second message written to clockstats file, fixed. ChangeSet@1.1735.1.23, 2008-08-10 09:45:36-04:00, stenn@whimsy.udel.edu NTP_4_2_5P123 TAG: NTP_4_2_5P123 ntpd/ntpd-opts.c@1.115 +2 -2 NTP_4_2_5P123 ntpd/ntpd-opts.h@1.115 +3 -3 NTP_4_2_5P123 ntpd/ntpd-opts.texi@1.114 +1 -1 NTP_4_2_5P123 ntpd/ntpd.1@1.114 +2 -2 NTP_4_2_5P123 ntpdc/ntpdc-opts.c@1.111 +2 -2 NTP_4_2_5P123 ntpdc/ntpdc-opts.h@1.111 +3 -3 NTP_4_2_5P123 ntpdc/ntpdc-opts.texi@1.110 +1 -1 NTP_4_2_5P123 ntpdc/ntpdc.1@1.110 +2 -2 NTP_4_2_5P123 ntpq/ntpq-opts.c@1.111 +2 -2 NTP_4_2_5P123 ntpq/ntpq-opts.h@1.111 +3 -3 NTP_4_2_5P123 ntpq/ntpq-opts.texi@1.110 +1 -1 NTP_4_2_5P123 ntpq/ntpq.1@1.110 +2 -2 NTP_4_2_5P123 packageinfo.sh@1.126 +1 -1 NTP_4_2_5P123 sntp/sntp-opts.c@1.111 +4 -5 NTP_4_2_5P123 sntp/sntp-opts.h@1.111 +5 -6 NTP_4_2_5P123 sntp/sntp-opts.texi@1.110 +2 -3 NTP_4_2_5P123 sntp/sntp.1@1.110 +3 -3 NTP_4_2_5P123 util/ntp-keygen-opts.c@1.114 +2 -2 NTP_4_2_5P123 util/ntp-keygen-opts.h@1.114 +3 -3 NTP_4_2_5P123 util/ntp-keygen-opts.texi@1.113 +1 -1 NTP_4_2_5P123 util/ntp-keygen.1@1.113 +2 -2 NTP_4_2_5P123 ChangeSet@1.1436.1.101, 2008-08-10 07:44:31-04:00, stenn@whimsy.udel.edu NTP_4_2_4P5_RC2 TAG: NTP_4_2_4P5_RC2 ntpd/ntpd-opts.c@1.50.15.1 +2 -2 NTP_4_2_4P5_RC2 ntpd/ntpd-opts.h@1.50.15.1 +3 -3 NTP_4_2_4P5_RC2 ntpd/ntpd-opts.texi@1.49.15.1 +1 -1 NTP_4_2_4P5_RC2 ntpd/ntpd.1@1.48.15.1 +2 -2 NTP_4_2_4P5_RC2 ntpd/ntpdsim-opts.c@1.50.15.1 +2 -2 NTP_4_2_4P5_RC2 ntpd/ntpdsim-opts.h@1.50.15.1 +3 -3 NTP_4_2_4P5_RC2 ntpd/ntpdsim-opts.texi@1.48.15.1 +1 -1 NTP_4_2_4P5_RC2 ntpd/ntpdsim.1@1.48.15.1 +2 -2 NTP_4_2_4P5_RC2 ntpdc/ntpdc-opts.c@1.50.15.1 +2 -2 NTP_4_2_4P5_RC2 ntpdc/ntpdc-opts.h@1.50.15.1 +3 -3 NTP_4_2_4P5_RC2 ntpdc/ntpdc-opts.texi@1.48.15.1 +1 -1 NTP_4_2_4P5_RC2 ntpdc/ntpdc.1@1.48.15.1 +2 -2 NTP_4_2_4P5_RC2 ntpq/ntpq-opts.c@1.52.15.1 +2 -2 NTP_4_2_4P5_RC2 ntpq/ntpq-opts.h@1.52.15.1 +3 -3 NTP_4_2_4P5_RC2 ntpq/ntpq-opts.texi@1.49.15.1 +1 -1 NTP_4_2_4P5_RC2 ntpq/ntpq.1@1.48.15.1 +2 -2 NTP_4_2_4P5_RC2 packageinfo.sh@1.65.22.1 +1 -1 NTP_4_2_4P5_RC2 sntp/sntp-opts.c@1.49.15.1 +4 -5 NTP_4_2_4P5_RC2 sntp/sntp-opts.h@1.49.15.1 +5 -6 NTP_4_2_4P5_RC2 sntp/sntp-opts.texi@1.46.15.1 +2 -3 NTP_4_2_4P5_RC2 sntp/sntp.1@1.49.15.1 +3 -3 NTP_4_2_4P5_RC2 util/ntp-keygen-opts.c@1.49.15.1 +2 -2 NTP_4_2_4P5_RC2 util/ntp-keygen-opts.h@1.49.15.1 +3 -3 NTP_4_2_4P5_RC2 util/ntp-keygen-opts.texi@1.47.15.1 +1 -1 NTP_4_2_4P5_RC2 util/ntp-keygen.1@1.47.15.1 +2 -2 NTP_4_2_4P5_RC2 ChangeSet@1.1735.1.22, 2008-08-10 03:11:51-04:00, stenn@whimsy.udel.edu [Bug 861] leap info was not being transmitted ChangeLog@1.205 +1 -0 [Bug 861] leap info was not being transmitted ntpd/ntp_crypto.c@1.123 +2 -2 [Bug 861] leap info was not being transmitted ntpd/ntp_timer.c@1.48 +1 -1 [Bug 861] leap info was not being transmitted ntpd/refclock_local.c@1.18 +4 -1 [Bug 861] leap info was not being transmitted ChangeSet@1.1436.14.1, 2008-08-10 02:22:22-04:00, stenn@whimsy.udel.edu triggert needs to handle rooted RESYNC paths now BitKeeper/triggers/triggert@1.4.1.1 +3 -2 triggert needs to handle rooted RESYNC paths now ChangeSet@1.1735.1.20, 2008-08-09 20:56:32-04:00, stenn@whimsy.udel.edu cleanup ChangeLog@1.204 +4 -10 cleanup ChangeSet@1.1436.1.98, 2008-08-09 20:05:06-04:00, stenn@whimsy.udel.edu AutoGen'd files must be writable sntp/Makefile.am@1.21.1.2 +2 -2 AutoGen'd files must be writable sntp/sntp-opts.menu@1.2.1.1 +0 -0 Change mode to -rw-rw-r-- ChangeSet@1.1754, 2008-08-09 07:28:37+09:00, Amidamaru@yumi.mxiesoft.com main.c: bug fixes networking.c, kod_management.c: Bug fixes gsoc_sntp/kod_management.c@1.3 +62 -18 Bug fixes gsoc_sntp/log.c@1.3 +27 -6 gsoc_sntp/main.c@1.4 +124 -27 bug fixes gsoc_sntp/networking.c@1.10 +115 -21 Bug fixes ChangeSet@1.1436.13.1, 2008-08-07 20:44:31+02:00, burnicki@pogo.udel.edu [Bug 450] Windows only: Under original Windows NT we must not discard the wildcard socket to workaround a bug in NT's getsockname(). ChangeLog@1.1.10.1 +2 -0 [Bug 450] Windows only: Under original Windows NT we must not discard the wildcard socket to workaround a bug in NT's getsockname(). ntpd/ntp_peer.c@1.97.2.1 +10 -2 [Bug 450] Windows only: Under original Windows NT we must not discard the wildcard socket to workaround a bug in NT's getsockname(). ports/winnt/ntpd/ntservice.c@1.9.1.2 +8 -1 [Bug 450] Windows only: Under original Windows NT we must not discard the wildcard socket to workaround a bug in NT's getsockname(). ChangeSet@1.1753, 2008-08-06 17:05:34+09:00, Amidamaru@yumi.mxiesoft.com networking.c: Fixed resolver and some minor stuff gsoc_sntp/networking.c@1.9 +70 -22 Fixed resolver and some minor stuff ChangeSet@1.1735.1.15, 2008-08-05 19:56:11-04:00, stenn@whimsy.udel.edu NTP_4_2_5P122 TAG: NTP_4_2_5P122 ntpd/ntpd-opts.c@1.114 +2 -2 NTP_4_2_5P122 ntpd/ntpd-opts.h@1.114 +3 -3 NTP_4_2_5P122 ntpd/ntpd-opts.texi@1.113 +1 -1 NTP_4_2_5P122 ntpd/ntpd.1@1.113 +2 -2 NTP_4_2_5P122 ntpdc/ntpdc-opts.c@1.110 +2 -2 NTP_4_2_5P122 ntpdc/ntpdc-opts.h@1.110 +3 -3 NTP_4_2_5P122 ntpdc/ntpdc-opts.texi@1.109 +1 -1 NTP_4_2_5P122 ntpdc/ntpdc.1@1.109 +2 -2 NTP_4_2_5P122 ntpq/ntpq-opts.c@1.110 +2 -2 NTP_4_2_5P122 ntpq/ntpq-opts.h@1.110 +3 -3 NTP_4_2_5P122 ntpq/ntpq-opts.texi@1.109 +1 -1 NTP_4_2_5P122 ntpq/ntpq.1@1.109 +2 -2 NTP_4_2_5P122 packageinfo.sh@1.125 +1 -1 NTP_4_2_5P122 sntp/sntp-opts.c@1.110 +2 -2 NTP_4_2_5P122 sntp/sntp-opts.h@1.110 +3 -3 NTP_4_2_5P122 sntp/sntp-opts.texi@1.109 +1 -1 NTP_4_2_5P122 sntp/sntp.1@1.109 +2 -2 NTP_4_2_5P122 util/ntp-keygen-opts.c@1.113 +2 -2 NTP_4_2_5P122 util/ntp-keygen-opts.h@1.113 +3 -3 NTP_4_2_5P122 util/ntp-keygen-opts.texi@1.112 +1 -1 NTP_4_2_5P122 util/ntp-keygen.1@1.112 +2 -2 NTP_4_2_5P122 ChangeSet@1.1735.1.14, 2008-08-05 06:07:25-04:00, stenn@whimsy.udel.edu [Bug 1046] refnumtoa.c is using the wrong header file ChangeLog@1.199 +1 -0 [Bug 1046] refnumtoa.c is using the wrong header file libntp/refnumtoa.c@1.5 +1 -1 [Bug 1046] refnumtoa.c is using the wrong header file ChangeSet@1.1735.1.13, 2008-08-05 05:00:05-04:00, stenn@whimsy.udel.edu [Bug 1047] enable/disable options processing fix ChangeLog@1.198 +1 -0 [Bug 1047] enable/disable options processing fix ntpd/ntp_config.c@1.180 +12 -15 [Bug 1047] enable/disable options processing fix ChangeSet@1.1436.12.2, 2008-08-05 09:56:08+02:00, burnicki@pogo.udel.edu Removed Windows-specific debug code which has been added in ntp-dev and fails to compile in ntp-stable. ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.5 +0 -8 Removed Windows-specific debug code which has been added in ntp-dev and fails to compile in ntp-stable. ChangeSet@1.1436.12.1, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu [Bug 841] Obsolete the "dynamic" keyword and make deferred binding to local interfaces the default. Emit a warning if that keyword is used for configuration. ChangeLog@1.1.9.1 +3 -0 [Bug 841] Obsolete the "dynamic" keyword and make deferred binding to local interfaces the default. Emit a warning if that keyword is used for configuration. html/confopt.html@1.35.1.1 +0 -2 Bug 841: Obsolete the "dynamic" keyword. html/ntpdc.html@1.26.1.1 +2 -3 Bug 841: Obsolete the "dynamic" keyword. include/ntp.h@1.128.1.1 +0 -1 Bug 841: Obsolete the "dynamic" keyword. include/ntp_request.h@1.30.1.1 +0 -1 Bug 841: Obsolete the "dynamic" keyword. ntpd/ntp_config.c@1.141.1.3 +4 -2 [Bug 841] Obsolete the "dynamic" keyword and make deferred binding to local interfaces the default. Emit a warning if that keyword is used for configuration. ntpd/ntp_intres.c@1.48.1.4 +1 -3 Bug 841: Obsolete the "dynamic" keyword. ntpd/ntp_peer.c@1.97.1.3 +5 -25 [Bug 841] Obsolete the "dynamic" keyword and make deferred binding to local interfaces the default. ntpd/ntp_request.c@1.65.1.1 +1 -3 Bug 841: Obsolete the "dynamic" keyword. ntpdc/ntpdc_ops.c@1.46.1.4 +3 -3 [Bug 841] Obsolete the "dynamic" keyword and make deferred binding to local interfaces the default. ChangeSet@1.1749.1.2, 2008-08-02 07:02:15-04:00, stenn@pogo.udel.edu typo gsoc_sntp/main.c@1.3 +2 -1 typo ChangeSet@1.1749.1.1, 2008-07-29 19:04:34-04:00, stenn@pogo.udel.edu cleanups gsoc_sntp/configure.ac@1.3 +1 -1 cleanups gsoc_sntp/header.h@1.2 +0 -1 cleanups gsoc_sntp/main.c@1.2 +9 -4 cleanups gsoc_sntp/networking.h@1.6 +2 -1 cleanups ChangeSet@1.1747.1.1, 2008-07-28 04:38:59+09:00, Amidamaru@yumi.mxiesoft.com sntp-opts.def: removed unnecessary verbosity flags gsoc_sntp/sntp-opts.def@1.2.1.1 +1 -15 removed unnecessary verbosity flags ChangeSet@1.1749, 2008-07-27 15:10:03-04:00, stenn@pogo.udel.edu Use ntp_machine.h gsoc_sntp/data_formats.h@1.4 +1 -0 Use ntp_machine.h ChangeSet@1.1748, 2008-07-27 15:09:23-04:00, stenn@pogo.udel.edu Fix the "kod" keyword gsoc_sntp/:fetch-stubs@1.3 +1 -1 Fix the "kod" keyword gsoc_sntp/sntp-opts.def@1.3 +2 -3 Fix the "kod" keyword ChangeSet@1.1735.1.12, 2008-07-24 15:28:20-04:00, stenn@whimsy.udel.edu NTP_4_2_5P121 TAG: NTP_4_2_5P121 ntpd/ntpd-opts.c@1.113 +2 -2 NTP_4_2_5P121 ntpd/ntpd-opts.h@1.113 +3 -3 NTP_4_2_5P121 ntpd/ntpd-opts.texi@1.112 +1 -1 NTP_4_2_5P121 ntpd/ntpd.1@1.112 +2 -2 NTP_4_2_5P121 ntpdc/ntpdc-opts.c@1.109 +2 -2 NTP_4_2_5P121 ntpdc/ntpdc-opts.h@1.109 +3 -3 NTP_4_2_5P121 ntpdc/ntpdc-opts.texi@1.108 +1 -1 NTP_4_2_5P121 ntpdc/ntpdc.1@1.108 +2 -2 NTP_4_2_5P121 ntpq/ntpq-opts.c@1.109 +2 -2 NTP_4_2_5P121 ntpq/ntpq-opts.h@1.109 +3 -3 NTP_4_2_5P121 ntpq/ntpq-opts.texi@1.108 +1 -1 NTP_4_2_5P121 ntpq/ntpq.1@1.108 +2 -2 NTP_4_2_5P121 packageinfo.sh@1.124 +1 -1 NTP_4_2_5P121 sntp/sntp-opts.c@1.109 +2 -2 NTP_4_2_5P121 sntp/sntp-opts.h@1.109 +3 -3 NTP_4_2_5P121 sntp/sntp-opts.texi@1.108 +1 -1 NTP_4_2_5P121 sntp/sntp.1@1.108 +2 -2 NTP_4_2_5P121 util/ntp-keygen-opts.c@1.112 +2 -2 NTP_4_2_5P121 util/ntp-keygen-opts.h@1.112 +3 -3 NTP_4_2_5P121 util/ntp-keygen-opts.texi@1.111 +1 -1 NTP_4_2_5P121 util/ntp-keygen.1@1.111 +2 -2 NTP_4_2_5P121 ChangeSet@1.1746, 2008-07-24 17:07:55+09:00, Amidamaru@yumi.mxiesoft.com networking.c: Fixing the mess gsoc_sntp/networking.c@1.7 +3 -1 Fixing the mess gsoc_sntp/networking.c@1.6 +0 -2 ChangeSet@1.1745, 2008-07-24 16:53:33+09:00, Amidamaru@yumi.mxiesoft.com networking.c: redo include gsoc_sntp/networking.c@1.5 +2 -0 redo include ChangeSet@1.1744, 2008-07-24 16:49:34+09:00, Amidamaru@yumi.mxiesoft.com fixed includes gsoc_sntp/networking.c@1.4 +2 -2 ChangeSet@1.1739.1.8, 2008-07-24 03:47:48-04:00, stenn@pogo.udel.edu header cleanup gsoc_sntp/networking.c@1.1.1.3 +2 -1 header cleanup gsoc_sntp/networking.h@1.1.1.3 +3 -1 header cleanup ChangeSet@1.1739.1.7, 2008-07-24 03:45:53-04:00, stenn@pogo.udel.edu reorder headers gsoc_sntp/data_formats.h@1.3 +1 -1 reorder headers ChangeSet@1.1739.1.6, 2008-07-24 03:44:24-04:00, stenn@pogo.udel.edu hack ISC_PLATFORM_HAVEIPV6 gsoc_sntp/configure.ac@1.2 +1 -0 hack ISC_PLATFORM_HAVEIPV6 ChangeSet@1.1739.1.5, 2008-07-24 03:23:31-04:00, stenn@pogo.udel.edu header cleanup gsoc_sntp/networking.c@1.1.1.2 +0 -1 header cleanup ChangeSet@1.1739.1.4, 2008-07-24 03:01:29-04:00, stenn@pogo.udel.edu hacks gsoc_sntp/data_formats.h@1.2 +0 -3 hacks gsoc_sntp/networking.c@1.1.1.1 +1 -1 hacks gsoc_sntp/networking.h@1.1.1.2 +8 -8 hacks ChangeSet@1.1739.1.3, 2008-07-24 02:06:52-04:00, stenn@pogo.udel.edu cleanup gsoc_sntp/networking.h@1.1.1.1 +2 -5 cleanup ChangeSet@1.1735.1.11, 2008-07-24 02:26:46+00:00, stenn@poog.il.thewrittenword.com header file cleanup ChangeLog@1.197 +1 -0 header file cleanup include/Makefile.am@1.30 +1 -0 Added ntp_net.h include/ntp.h@1.147 +4 -2 Header cleanup include/ntp_fp.h@1.14 +0 -6 ntp_fp.h should have *never* been how we pulled in network stuff include/ntp_net.h@1.1 +14 -0 BitKeeper file /home/stenn/ntp-dev/include/ntp_net.h include/ntp_net.h@1.0 +0 -0 include/recvbuff.h@1.15 +0 -1 Header cleanup ChangeSet@1.1739.1.1, 2008-07-22 16:12:19-04:00, stenn@pogo.udel.edu build infrastructure updates gsoc_sntp/:fetch-stubs@1.2 +7 -0 updates gsoc_sntp/configure.ac@1.1 +89 -0 BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/configure.ac gsoc_sntp/configure.ac@1.0 +0 -0 ChangeSet@1.1737.1.1, 2008-07-23 03:52:14+09:00, Amidamaru@yumi.mxiesoft.com log.h, log.c: Changed name of debug output function to avoid name collision with opt flag variable kod_management.c: Changed from fgets to fscanf (easier data extraction) gsoc_sntp/Makefile@1.1.1.1 +16 -19 gsoc_sntp/Makefile.in@1.1.1.1 +3 -6 gsoc_sntp/kod_management.c@1.2 +22 -57 Changed from fgets to fscanf (easier data extraction) gsoc_sntp/kod_management.h@1.2 +1 -1 gsoc_sntp/log.c@1.2 +1 -1 Changed name of debug output function to avoid name collision with opt flag variable gsoc_sntp/log.h@1.2 +1 -1 Changed name of debug output function to avoid name collision with opt flag variable gsoc_sntp/networking.c@1.2 +20 -11 gsoc_sntp/networking.h@1.2 +4 -4 ChangeSet@1.1739, 2008-07-22 14:38:08-04:00, stenn@pogo.udel.edu added :fetch-stubs gsoc_sntp/:fetch-stubs@1.1 +13 -0 BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/:fetch-stubs gsoc_sntp/:fetch-stubs@1.0 +0 -0 ChangeSet@1.1738, 2008-07-22 14:29:55-04:00, stenn@pogo.udel.edu sntp fixes BitKeeper/deleted/.del-Makefile@1.2 +0 -0 Delete: gsoc_sntp/Makefile BitKeeper/deleted/.del-Makefile.in@1.2 +0 -0 Delete: gsoc_sntp/Makefile.in Makefile.am@1.77 +2 -0 Add gsoc_sntp to the build gsoc_sntp/Makefile.am@1.2 +15 -18 autogen stuff gsoc_sntp/libopts/COPYING.lgpl@1.2 +0 -0 bk cp COPYING.lgpl ../gsoc_sntp/libopts/COPYING.lgpl gsoc_sntp/libopts/COPYING.lgpl@1.1, stenn@whimsy.udel.edu +502 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/COPYING.lgpl gsoc_sntp/libopts/COPYING.lgpl@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/COPYING.mbsd@1.2 +0 -0 bk cp COPYING.mbsd ../gsoc_sntp/libopts/COPYING.mbsd gsoc_sntp/libopts/COPYING.mbsd@1.1, stenn@whimsy.udel.edu +26 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/COPYING.mbsd gsoc_sntp/libopts/COPYING.mbsd@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/MakeDefs.inc@1.2 +0 -0 bk cp MakeDefs.inc ../gsoc_sntp/libopts/MakeDefs.inc gsoc_sntp/libopts/MakeDefs.inc@1.1, stenn@whimsy.udel.edu +0 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/MakeDefs.inc gsoc_sntp/libopts/MakeDefs.inc@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/Makefile.am@1.2 +0 -0 bk cp Makefile.am ../gsoc_sntp/libopts/Makefile.am gsoc_sntp/libopts/Makefile.am@1.1, stenn@whimsy.udel.edu +24 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/Makefile.am gsoc_sntp/libopts/Makefile.am@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/README@1.2 +0 -0 bk cp README ../gsoc_sntp/libopts/README gsoc_sntp/libopts/README@1.1, stenn@whimsy.udel.edu +93 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/README gsoc_sntp/libopts/README@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/autoopts.c@1.2 +0 -0 bk cp autoopts.c ../gsoc_sntp/libopts/autoopts.c gsoc_sntp/libopts/autoopts.c@1.1, stenn@whimsy.udel.edu +1120 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts.c gsoc_sntp/libopts/autoopts.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/autoopts.h@1.2 +0 -0 bk cp autoopts.h ../gsoc_sntp/libopts/autoopts.h gsoc_sntp/libopts/autoopts.h@1.1, stenn@whimsy.udel.edu +387 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts.h gsoc_sntp/libopts/autoopts.h@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/autoopts/options.h@1.2 +0 -0 bk cp autoopts/options.h ../gsoc_sntp/libopts/autoopts/options.h gsoc_sntp/libopts/autoopts/options.h@1.1, stenn@whimsy.udel.edu +977 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts/options.h gsoc_sntp/libopts/autoopts/options.h@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/autoopts/usage-txt.h@1.2 +0 -0 bk cp autoopts/usage-txt.h ../gsoc_sntp/libopts/autoopts/usage-txt.h gsoc_sntp/libopts/autoopts/usage-txt.h@1.1, stenn@whimsy.udel.edu +355 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts/usage-txt.h gsoc_sntp/libopts/autoopts/usage-txt.h@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/boolean.c@1.2 +0 -0 bk cp boolean.c ../gsoc_sntp/libopts/boolean.c gsoc_sntp/libopts/boolean.c@1.1, stenn@whimsy.udel.edu +106 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/boolean.c gsoc_sntp/libopts/boolean.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/compat/compat.h@1.2 +0 -0 bk cp compat/compat.h ../gsoc_sntp/libopts/compat/compat.h gsoc_sntp/libopts/compat/compat.h@1.1, stenn@whimsy.udel.edu +319 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/compat.h gsoc_sntp/libopts/compat/compat.h@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/compat/pathfind.c@1.2 +0 -0 bk cp compat/pathfind.c ../gsoc_sntp/libopts/compat/pathfind.c gsoc_sntp/libopts/compat/pathfind.c@1.1, stenn@whimsy.udel.edu +339 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/pathfind.c gsoc_sntp/libopts/compat/pathfind.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/compat/snprintf.c@1.2 +0 -0 bk cp compat/snprintf.c ../gsoc_sntp/libopts/compat/snprintf.c gsoc_sntp/libopts/compat/snprintf.c@1.1, stenn@whimsy.udel.edu +60 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/snprintf.c gsoc_sntp/libopts/compat/snprintf.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/compat/strchr.c@1.2 +0 -0 bk cp compat/strchr.c ../gsoc_sntp/libopts/compat/strchr.c gsoc_sntp/libopts/compat/strchr.c@1.1, stenn@whimsy.udel.edu +60 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/strchr.c gsoc_sntp/libopts/compat/strchr.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/compat/strdup.c@1.2 +0 -0 bk cp compat/strdup.c ../gsoc_sntp/libopts/compat/strdup.c gsoc_sntp/libopts/compat/strdup.c@1.1, stenn@whimsy.udel.edu +19 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/strdup.c gsoc_sntp/libopts/compat/strdup.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/compat/windows-config.h@1.2 +0 -0 bk cp compat/windows-config.h ../gsoc_sntp/libopts/compat/windows-config.h gsoc_sntp/libopts/compat/windows-config.h@1.1, stenn@whimsy.udel.edu +130 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/windows-config.h gsoc_sntp/libopts/compat/windows-config.h@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/configfile.c@1.2 +0 -0 bk cp configfile.c ../gsoc_sntp/libopts/configfile.c gsoc_sntp/libopts/configfile.c@1.1, stenn@whimsy.udel.edu +1290 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/configfile.c gsoc_sntp/libopts/configfile.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/cook.c@1.2 +0 -0 bk cp cook.c ../gsoc_sntp/libopts/cook.c gsoc_sntp/libopts/cook.c@1.1, stenn@whimsy.udel.edu +354 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/cook.c gsoc_sntp/libopts/cook.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/enumeration.c@1.2 +0 -0 bk cp enumeration.c ../gsoc_sntp/libopts/enumeration.c gsoc_sntp/libopts/enumeration.c@1.1, stenn@whimsy.udel.edu +498 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/enumeration.c gsoc_sntp/libopts/enumeration.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/environment.c@1.2 +0 -0 bk cp environment.c ../gsoc_sntp/libopts/environment.c gsoc_sntp/libopts/environment.c@1.1, stenn@whimsy.udel.edu +279 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/environment.c gsoc_sntp/libopts/environment.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/genshell.c@1.2 +0 -0 bk cp genshell.c ../gsoc_sntp/libopts/genshell.c gsoc_sntp/libopts/genshell.c@1.1, stenn@whimsy.udel.edu +354 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/genshell.c gsoc_sntp/libopts/genshell.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/genshell.h@1.2 +0 -0 bk cp genshell.h ../gsoc_sntp/libopts/genshell.h gsoc_sntp/libopts/genshell.h@1.1, stenn@whimsy.udel.edu +149 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/genshell.h gsoc_sntp/libopts/genshell.h@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/libopts.c@1.2 +0 -0 bk cp libopts.c ../gsoc_sntp/libopts/libopts.c gsoc_sntp/libopts/libopts.c@1.1, stenn@whimsy.udel.edu +30 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/libopts.c gsoc_sntp/libopts/libopts.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/load.c@1.2 +0 -0 bk cp load.c ../gsoc_sntp/libopts/load.c gsoc_sntp/libopts/load.c@1.1, stenn@whimsy.udel.edu +563 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/load.c gsoc_sntp/libopts/load.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/m4/libopts.m4@1.2 +0 -0 bk cp m4/libopts.m4 ../gsoc_sntp/libopts/m4/libopts.m4 gsoc_sntp/libopts/m4/libopts.m4@1.1, stenn@whimsy.udel.edu +509 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/m4/libopts.m4 gsoc_sntp/libopts/m4/libopts.m4@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/m4/liboptschk.m4@1.2 +0 -0 bk cp m4/liboptschk.m4 ../gsoc_sntp/libopts/m4/liboptschk.m4 gsoc_sntp/libopts/m4/liboptschk.m4@1.1, stenn@whimsy.udel.edu +42 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/m4/liboptschk.m4 gsoc_sntp/libopts/m4/liboptschk.m4@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/makeshell.c@1.2 +0 -0 bk cp makeshell.c ../gsoc_sntp/libopts/makeshell.c gsoc_sntp/libopts/makeshell.c@1.1, stenn@whimsy.udel.edu +1122 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/makeshell.c gsoc_sntp/libopts/makeshell.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/nested.c@1.2 +0 -0 bk cp nested.c ../gsoc_sntp/libopts/nested.c gsoc_sntp/libopts/nested.c@1.1, stenn@whimsy.udel.edu +733 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/nested.c gsoc_sntp/libopts/nested.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/numeric.c@1.2 +0 -0 bk cp numeric.c ../gsoc_sntp/libopts/numeric.c gsoc_sntp/libopts/numeric.c@1.1, stenn@whimsy.udel.edu +93 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/numeric.c gsoc_sntp/libopts/numeric.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/pgusage.c@1.2 +0 -0 bk cp pgusage.c ../gsoc_sntp/libopts/pgusage.c gsoc_sntp/libopts/pgusage.c@1.1, stenn@whimsy.udel.edu +157 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/pgusage.c gsoc_sntp/libopts/pgusage.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/proto.h@1.2 +0 -0 bk cp proto.h ../gsoc_sntp/libopts/proto.h gsoc_sntp/libopts/proto.h@1.1, stenn@whimsy.udel.edu +91 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/proto.h gsoc_sntp/libopts/proto.h@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/putshell.c@1.2 +0 -0 bk cp putshell.c ../gsoc_sntp/libopts/putshell.c gsoc_sntp/libopts/putshell.c@1.1, stenn@whimsy.udel.edu +335 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/putshell.c gsoc_sntp/libopts/putshell.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/restore.c@1.2 +0 -0 bk cp restore.c ../gsoc_sntp/libopts/restore.c gsoc_sntp/libopts/restore.c@1.1, stenn@whimsy.udel.edu +250 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/restore.c gsoc_sntp/libopts/restore.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/save.c@1.3 +0 -0 bk cp save.c ../gsoc_sntp/libopts/save.c gsoc_sntp/libopts/save.c@1.2, stenn@whimsy.udel.edu +11 -2 [Bug 902] Fix problems with the -6 flag gsoc_sntp/libopts/save.c@1.1, stenn@whimsy.udel.edu +512 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/save.c gsoc_sntp/libopts/save.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/sort.c@1.2 +0 -0 bk cp sort.c ../gsoc_sntp/libopts/sort.c gsoc_sntp/libopts/sort.c@1.1, stenn@whimsy.udel.edu +359 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/sort.c gsoc_sntp/libopts/sort.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/stack.c@1.2 +0 -0 bk cp stack.c ../gsoc_sntp/libopts/stack.c gsoc_sntp/libopts/stack.c@1.1, stenn@whimsy.udel.edu +269 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/stack.c gsoc_sntp/libopts/stack.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/streqvcmp.c@1.2 +0 -0 bk cp streqvcmp.c ../gsoc_sntp/libopts/streqvcmp.c gsoc_sntp/libopts/streqvcmp.c@1.1, stenn@whimsy.udel.edu +289 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/streqvcmp.c gsoc_sntp/libopts/streqvcmp.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/text_mmap.c@1.2 +0 -0 bk cp text_mmap.c ../gsoc_sntp/libopts/text_mmap.c gsoc_sntp/libopts/text_mmap.c@1.1, stenn@whimsy.udel.edu +363 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/text_mmap.c gsoc_sntp/libopts/text_mmap.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/tokenize.c@1.2 +0 -0 bk cp tokenize.c ../gsoc_sntp/libopts/tokenize.c gsoc_sntp/libopts/tokenize.c@1.1, stenn@whimsy.udel.edu +321 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/tokenize.c gsoc_sntp/libopts/tokenize.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/usage.c@1.2 +0 -0 bk cp usage.c ../gsoc_sntp/libopts/usage.c gsoc_sntp/libopts/usage.c@1.1, stenn@whimsy.udel.edu +740 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/usage.c gsoc_sntp/libopts/usage.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/libopts/version.c@1.2 +0 -0 bk cp version.c ../gsoc_sntp/libopts/version.c gsoc_sntp/libopts/version.c@1.1, stenn@whimsy.udel.edu +178 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/version.c gsoc_sntp/libopts/version.c@1.0, stenn@whimsy.udel.edu +0 -0 gsoc_sntp/sntp-opts.def@1.2 +1 -1 Update the copyright year ChangeSet@1.1436.1.96, 2008-07-22 11:41:26+02:00, burnicki@pogo.udel.edu [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG. ChangeLog@1.1.1.39 +1 -0 [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG. libntp/machines.c@1.19 +2 -2 [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG. ChangeSet@1.1735.1.10, 2008-07-16 18:07:06-04:00, stenn@whimsy.udel.edu NTP_4_2_5P120 TAG: NTP_4_2_5P120 ntpd/ntpd-opts.c@1.112 +2 -2 NTP_4_2_5P120 ntpd/ntpd-opts.h@1.112 +3 -3 NTP_4_2_5P120 ntpd/ntpd-opts.texi@1.111 +1 -1 NTP_4_2_5P120 ntpd/ntpd.1@1.111 +2 -2 NTP_4_2_5P120 ntpdc/ntpdc-opts.c@1.108 +2 -2 NTP_4_2_5P120 ntpdc/ntpdc-opts.h@1.108 +3 -3 NTP_4_2_5P120 ntpdc/ntpdc-opts.texi@1.107 +1 -1 NTP_4_2_5P120 ntpdc/ntpdc.1@1.107 +2 -2 NTP_4_2_5P120 ntpq/ntpq-opts.c@1.108 +2 -2 NTP_4_2_5P120 ntpq/ntpq-opts.h@1.108 +3 -3 NTP_4_2_5P120 ntpq/ntpq-opts.texi@1.107 +1 -1 NTP_4_2_5P120 ntpq/ntpq.1@1.107 +2 -2 NTP_4_2_5P120 packageinfo.sh@1.123 +1 -1 NTP_4_2_5P120 sntp/sntp-opts.c@1.108 +2 -2 NTP_4_2_5P120 sntp/sntp-opts.h@1.108 +3 -3 NTP_4_2_5P120 sntp/sntp-opts.texi@1.107 +1 -1 NTP_4_2_5P120 sntp/sntp.1@1.107 +2 -2 NTP_4_2_5P120 util/ntp-keygen-opts.c@1.111 +2 -2 NTP_4_2_5P120 util/ntp-keygen-opts.h@1.111 +3 -3 NTP_4_2_5P120 util/ntp-keygen-opts.texi@1.110 +1 -1 NTP_4_2_5P120 util/ntp-keygen.1@1.110 +2 -2 NTP_4_2_5P120 ChangeSet@1.1735.1.9, 2008-07-16 17:13:00-04:00, stenn@whimsy.udel.edu [Bug 1037]: buffer in subroutine was 1 byte short ChangeLog@1.196 +1 -0 [Bug 1037]: buffer in subroutine was 1 byte short util/ntp-keygen.c@1.52 +1 -1 [Bug 1037]: buffer in subroutine was 1 byte short ChangeSet@1.1735.1.8, 2008-07-16 06:22:25-04:00, stenn@whimsy.udel.edu .del-genkeys.html: Delete: html/genkeys.html BitKeeper/deleted/.del-genkeys.html@1.3 +0 -0 Delete: html/genkeys.html ChangeSet@1.1735.1.7, 2008-07-16 06:17:22-04:00, stenn@whimsy.udel.edu interleave documentation html/xleave.html@1.1 +32 -0 BitKeeper file /deacon/backroom/ntp-dev/html/xleave.html html/xleave.html@1.0 +0 -0 ChangeSet@1.1735.1.6, 2008-07-16 05:32:55-04:00, stenn@whimsy.udel.edu configure.ac: cleanup, added wintime and bug 1028 options ChangeLog@1.195 +2 -0 configure.ac: cleanup, added wintime and bug 1028 options configure.ac@1.415 +46 -6 configure.ac: cleanup, added wintime and bug 1028 options ChangeSet@1.1735.1.5, 2008-07-16 05:26:43-04:00, stenn@whimsy.udel.edu Bias and Interleave stuff from Dave Mills. ChangeLog@1.194 +3 -0 Bias and Interleave stuff from Dave Mills. include/ntp.h@1.146 +12 -3 Bias and Interleave stuff from Dave Mills. include/ntp_config.h@1.47 +1 -0 Bias and Interleave stuff from Dave Mills. libntp/statestr.c@1.14 +2 -0 Bias and Interleave stuff from Dave Mills. ntpd/ntp_config.c@1.179 +5 -0 Bias and Interleave stuff from Dave Mills. ntpd/ntp_control.c@1.105 +13 -8 Bias and Interleave stuff from Dave Mills. ntpd/ntp_loopfilter.c@1.146 +8 -9 separate phase/freq discipline. ntpd/ntp_parser.c@1.27 +1092 -1065 Bias and Interleave stuff from Dave Mills. ntpd/ntp_parser.h@1.12 +289 -285 Bias and Interleave stuff from Dave Mills. ntpd/ntp_parser.y@1.22 +4 -0 Bias and Interleave stuff from Dave Mills. ntpd/ntp_proto.c@1.274 +332 -160 Bias and Interleave stuff from Dave Mills. ntpd/ntp_refclock.c@1.80 +2 -2 Bias and Interleave stuff from Dave Mills. ntpd/ntp_request.c@1.74 +1 -2 Bias and Interleave stuff from Dave Mills. ntpd/ntp_util.c@1.65 +4 -9 Bias and Interleave stuff from Dave Mills. ChangeSet@1.1735.1.4, 2008-07-16 05:12:48-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.193 +1 -0 Documentation updates from Dave Mills html/confopt.html@1.41 +28 -19 Documentation updates from Dave Mills html/copyright.html@1.41 +1 -1 Documentation updates from Dave Mills html/decode.html@1.2 +2 -2 Documentation updates from Dave Mills html/keygen.html@1.12 +3 -2 Documentation updates from Dave Mills html/monopt.html@1.28 +1 -1 Documentation updates from Dave Mills html/ntpd.html@1.44 +2 -1 Documentation updates from Dave Mills html/ntpq.html@1.30 +6 -2 Documentation updates from Dave Mills ChangeSet@1.1735.1.3, 2008-07-16 05:06:03-04:00, stenn@whimsy.udel.edu jitter.c: make NBUF about 10x bigger util/jitter.c@1.9 +1 -1 jitter.c: make NBUF about 10x bigger ChangeSet@1.1735.1.2, 2008-07-15 03:44:23-04:00, stenn@whimsy.udel.edu NTP_4_2_5P119 TAG: NTP_4_2_5P119 ntpd/ntpd-opts.c@1.111 +2 -2 NTP_4_2_5P119 ntpd/ntpd-opts.h@1.111 +3 -3 NTP_4_2_5P119 ntpd/ntpd-opts.texi@1.110 +1 -1 NTP_4_2_5P119 ntpd/ntpd.1@1.110 +2 -2 NTP_4_2_5P119 ntpdc/ntpdc-opts.c@1.107 +2 -2 NTP_4_2_5P119 ntpdc/ntpdc-opts.h@1.107 +3 -3 NTP_4_2_5P119 ntpdc/ntpdc-opts.texi@1.106 +1 -1 NTP_4_2_5P119 ntpdc/ntpdc.1@1.106 +2 -2 NTP_4_2_5P119 ntpq/ntpq-opts.c@1.107 +2 -2 NTP_4_2_5P119 ntpq/ntpq-opts.h@1.107 +3 -3 NTP_4_2_5P119 ntpq/ntpq-opts.texi@1.106 +1 -1 NTP_4_2_5P119 ntpq/ntpq.1@1.106 +2 -2 NTP_4_2_5P119 packageinfo.sh@1.122 +1 -1 NTP_4_2_5P119 sntp/sntp-opts.c@1.107 +2 -2 NTP_4_2_5P119 sntp/sntp-opts.h@1.107 +3 -3 NTP_4_2_5P119 sntp/sntp-opts.texi@1.106 +1 -1 NTP_4_2_5P119 sntp/sntp.1@1.106 +2 -2 NTP_4_2_5P119 util/ntp-keygen-opts.c@1.110 +2 -2 NTP_4_2_5P119 util/ntp-keygen-opts.h@1.110 +3 -3 NTP_4_2_5P119 util/ntp-keygen-opts.texi@1.109 +1 -1 NTP_4_2_5P119 util/ntp-keygen.1@1.109 +2 -2 NTP_4_2_5P119 ChangeSet@1.1735.1.1, 2008-07-14 01:28:14-04:00, stenn@whimsy.udel.edu [Bug 1037] Use all 16 of the MD5 passwords generated by ntp-keygen ChangeLog@1.192 +1 -0 [Bug 1037] Use all 16 of the MD5 passwords generated by ntp-keygen util/ntp-keygen.c@1.51 +1 -1 [Bug 1037] Use all 16 of the MD5 passwords generated by ntp-keygen ChangeSet@1.1737, 2008-07-09 05:45:39+09:00, Amidamaru@yumi.mxiesoft.com networking.h: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/networking.h networking.c: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/networking.c gsoc_sntp/networking.c@1.1 +278 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/networking.c gsoc_sntp/networking.c@1.0 +0 -0 gsoc_sntp/networking.h@1.1 +48 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/networking.h gsoc_sntp/networking.h@1.0 +0 -0 ChangeSet@1.1736, 2008-07-09 05:14:24+09:00, Amidamaru@yumi.mxiesoft.com ignore: added config.guess config.h config.h.in config.log config.status config.sub Makefile.in: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/Makefile.in netutils.c: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/netutils.c header.h: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/header.h sntp-opts.def: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/sntp-opts.def netutils.h: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/netutils.h kod_management.h: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/kod_management.h ignore: added aclocal.m4 kod_management.c: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/kod_management.c Makefile: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/Makefile ignore: added config.h main.c: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/main.c ignore: added test.kod log.c: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/log.c data_formats.h: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/data_formats.h log.h: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/log.h Makefile.am: BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/Makefile.am BitKeeper/etc/ignore@1.64 +1 -0 added test.kod BitKeeper/etc/ignore@1.63 +1 -0 added aclocal.m4 BitKeeper/etc/ignore@1.62 +6 -0 added config.guess config.h config.h.in config.log config.status config.sub BitKeeper/etc/ignore@1.61 +1 -0 added config.h gsoc_sntp/Makefile@1.1 +694 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/Makefile gsoc_sntp/Makefile@1.0 +0 -0 gsoc_sntp/Makefile.am@1.1 +69 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/Makefile.am gsoc_sntp/Makefile.am@1.0 +0 -0 gsoc_sntp/Makefile.in@1.1 +694 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/Makefile.in gsoc_sntp/Makefile.in@1.0 +0 -0 gsoc_sntp/data_formats.h@1.1 +10 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/data_formats.h gsoc_sntp/data_formats.h@1.0 +0 -0 gsoc_sntp/header.h@1.1 +87 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/header.h gsoc_sntp/header.h@1.0 +0 -0 gsoc_sntp/kod_management.c@1.1 +258 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/kod_management.c gsoc_sntp/kod_management.c@1.0 +0 -0 gsoc_sntp/kod_management.h@1.1 +20 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/kod_management.h gsoc_sntp/kod_management.h@1.0 +0 -0 gsoc_sntp/log.c@1.1 +52 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/log.c gsoc_sntp/log.c@1.0 +0 -0 gsoc_sntp/log.h@1.1 +21 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/log.h gsoc_sntp/log.h@1.0 +0 -0 gsoc_sntp/main.c@1.1 +86 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/main.c gsoc_sntp/main.c@1.0 +0 -0 gsoc_sntp/netutils.c@1.1 +320 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/netutils.c gsoc_sntp/netutils.c@1.0 +0 -0 gsoc_sntp/netutils.h@1.1 +10 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/netutils.h gsoc_sntp/netutils.h@1.0 +0 -0 gsoc_sntp/sntp-opts.def@1.1 +293 -0 BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/sntp-opts.def gsoc_sntp/sntp-opts.def@1.0 +0 -0 ChangeSet@1.1735, 2008-06-06 19:56:21-04:00, stenn@whimsy.udel.edu NTP_4_2_5P118 TAG: NTP_4_2_5P118 ntpd/ntpd-opts.c@1.110 +2 -2 NTP_4_2_5P118 ntpd/ntpd-opts.h@1.110 +3 -3 NTP_4_2_5P118 ntpd/ntpd-opts.texi@1.109 +1 -1 NTP_4_2_5P118 ntpd/ntpd.1@1.109 +2 -2 NTP_4_2_5P118 ntpdc/ntpdc-opts.c@1.106 +2 -2 NTP_4_2_5P118 ntpdc/ntpdc-opts.h@1.106 +3 -3 NTP_4_2_5P118 ntpdc/ntpdc-opts.texi@1.105 +1 -1 NTP_4_2_5P118 ntpdc/ntpdc.1@1.105 +2 -2 NTP_4_2_5P118 ntpq/ntpq-opts.c@1.106 +2 -2 NTP_4_2_5P118 ntpq/ntpq-opts.h@1.106 +3 -3 NTP_4_2_5P118 ntpq/ntpq-opts.texi@1.105 +1 -1 NTP_4_2_5P118 ntpq/ntpq.1@1.105 +2 -2 NTP_4_2_5P118 packageinfo.sh@1.121 +1 -1 NTP_4_2_5P118 sntp/sntp-opts.c@1.106 +2 -2 NTP_4_2_5P118 sntp/sntp-opts.h@1.106 +3 -3 NTP_4_2_5P118 sntp/sntp-opts.texi@1.105 +1 -1 NTP_4_2_5P118 sntp/sntp.1@1.105 +2 -2 NTP_4_2_5P118 util/ntp-keygen-opts.c@1.109 +2 -2 NTP_4_2_5P118 util/ntp-keygen-opts.h@1.109 +3 -3 NTP_4_2_5P118 util/ntp-keygen-opts.texi@1.108 +1 -1 NTP_4_2_5P118 util/ntp-keygen.1@1.108 +2 -2 NTP_4_2_5P118 ChangeSet@1.1728.1.4, 2008-05-30 00:54:03-04:00, stenn@whimsy.udel.edu Triggers are fired with an absolute (v. relative) path. BitKeeper/triggers/triggert@1.5 +3 -2 Triggers are fired with an absolute (v. relative) path. ChangeSet@1.1728.1.3, 2008-05-23 03:00:07-04:00, stenn@whimsy.udel.edu Poll time and local refclock documentation updates from Dave Mills ChangeLog@1.186.1.1 +2 -0 Poll time and local refclock documentation updates from Dave Mills html/drivers/driver1.html@1.16 +3 -18 local refclock documentation updates from Dave Mills ntpd/ntp_proto.c@1.273 +11 -2 poll time updates from Dave Mills ChangeSet@1.1728.1.2, 2008-05-21 07:48:20-04:00, stenn@whimsy.udel.edu NTP_4_2_5P117 TAG: NTP_4_2_5P117 ntpd/ntpd-opts.c@1.109 +2 -2 NTP_4_2_5P117 ntpd/ntpd-opts.h@1.109 +3 -3 NTP_4_2_5P117 ntpd/ntpd-opts.texi@1.108 +1 -1 NTP_4_2_5P117 ntpd/ntpd.1@1.108 +2 -2 NTP_4_2_5P117 ntpdc/ntpdc-opts.c@1.105 +2 -2 NTP_4_2_5P117 ntpdc/ntpdc-opts.h@1.105 +3 -3 NTP_4_2_5P117 ntpdc/ntpdc-opts.texi@1.104 +1 -1 NTP_4_2_5P117 ntpdc/ntpdc.1@1.104 +2 -2 NTP_4_2_5P117 ntpq/ntpq-opts.c@1.105 +2 -2 NTP_4_2_5P117 ntpq/ntpq-opts.h@1.105 +3 -3 NTP_4_2_5P117 ntpq/ntpq-opts.texi@1.104 +1 -1 NTP_4_2_5P117 ntpq/ntpq.1@1.104 +2 -2 NTP_4_2_5P117 packageinfo.sh@1.120 +1 -1 NTP_4_2_5P117 sntp/sntp-opts.c@1.105 +2 -2 NTP_4_2_5P117 sntp/sntp-opts.h@1.105 +3 -3 NTP_4_2_5P117 sntp/sntp-opts.texi@1.104 +1 -1 NTP_4_2_5P117 sntp/sntp.1@1.104 +2 -2 NTP_4_2_5P117 util/ntp-keygen-opts.c@1.108 +2 -2 NTP_4_2_5P117 util/ntp-keygen-opts.h@1.108 +3 -3 NTP_4_2_5P117 util/ntp-keygen-opts.texi@1.107 +1 -1 NTP_4_2_5P117 util/ntp-keygen.1@1.107 +2 -2 NTP_4_2_5P117 ChangeSet@1.1731, 2008-05-21 09:32:13+05:30, venu@door.(none) ChangeLog: Corrected the comments for NMEA refclock driver. ChangeLog@1.190 +2 -1 Corrected the comments for NMEA refclock driver. ChangeSet@1.1730, 2008-05-20 18:34:17+05:30, venu@door.(none) ChangeLog: Added comments for fixing the incorrect edge parameter passed to time_pps_kcbind. refclock_nmea.c: Fixed the incorrect edge parameter being passed to time_pps_kcbind. ChangeLog@1.189 +1 -0 Added comments for fixing the incorrect edge parameter passed to time_pps_kcbind. ntpd/refclock_nmea.c@1.29 +1 -1 Fixed the incorrect edge parameter being passed to time_pps_kcbind. ChangeSet@1.1729, 2008-05-20 08:13:42+00:00, gopal@pogo.udel.edu ChangeLog: Added comments for bug 985. refclock_nmea.c: [Bug 399] NMEA refclock driver does not honor time1 offset if flag3 set. [Bug 985] Modifications to NMEA reference clock driver to support Accord GPS Clock. ChangeLog: Added comments for bug 399. ChangeLog@1.188 +1 -0 Added comments for bug 399. ChangeLog@1.187 +1 -0 Added comments for bug 985. ntpd/refclock_nmea.c@1.28 +24 -4 [Bug 399] NMEA refclock driver does not honor time1 offset if flag3 set. ntpd/refclock_nmea.c@1.27 +111 -21 [Bug 985] Modifications to NMEA reference clock driver to support Accord GPS Clock. ChangeSet@1.1436.1.95, 2008-05-20 03:51:01-04:00, stenn@whimsy.udel.edu NTP_4_2_4P5_RC1 TAG: NTP_4_2_4P5_RC1 ntpd/ntpd-opts.c@1.50.14.1 +6 -7 NTP_4_2_4P5_RC1 ntpd/ntpd-opts.h@1.50.14.1 +6 -7 NTP_4_2_4P5_RC1 ntpd/ntpd-opts.texi@1.49.14.1 +8 -11 NTP_4_2_4P5_RC1 ntpd/ntpd.1@1.48.14.1 +4 -4 NTP_4_2_4P5_RC1 ntpd/ntpdsim-opts.c@1.50.14.1 +6 -7 NTP_4_2_4P5_RC1 ntpd/ntpdsim-opts.h@1.50.14.1 +6 -7 NTP_4_2_4P5_RC1 ntpd/ntpdsim-opts.texi@1.48.14.1 +3 -4 NTP_4_2_4P5_RC1 ntpd/ntpdsim.1@1.48.14.1 +4 -4 NTP_4_2_4P5_RC1 ntpdc/ntpdc-opts.c@1.50.14.1 +6 -7 NTP_4_2_4P5_RC1 ntpdc/ntpdc-opts.h@1.50.14.1 +6 -7 NTP_4_2_4P5_RC1 ntpdc/ntpdc-opts.texi@1.48.14.1 +5 -6 NTP_4_2_4P5_RC1 ntpdc/ntpdc.1@1.48.14.1 +3 -3 NTP_4_2_4P5_RC1 ntpq/ntpq-opts.c@1.52.14.1 +6 -7 NTP_4_2_4P5_RC1 ntpq/ntpq-opts.h@1.52.14.1 +6 -7 NTP_4_2_4P5_RC1 ntpq/ntpq-opts.texi@1.49.14.1 +5 -6 NTP_4_2_4P5_RC1 ntpq/ntpq.1@1.48.14.1 +3 -3 NTP_4_2_4P5_RC1 packageinfo.sh@1.65.21.1 +2 -2 NTP_4_2_4P5_RC1 sntp/sntp-opts.c@1.49.14.1 +2 -2 NTP_4_2_4P5_RC1 sntp/sntp-opts.h@1.49.14.1 +3 -3 NTP_4_2_4P5_RC1 sntp/sntp-opts.texi@1.46.14.1 +1 -1 NTP_4_2_4P5_RC1 sntp/sntp.1@1.49.14.1 +2 -2 NTP_4_2_4P5_RC1 util/ntp-keygen-opts.c@1.49.14.1 +6 -7 NTP_4_2_4P5_RC1 util/ntp-keygen-opts.h@1.49.14.1 +6 -7 NTP_4_2_4P5_RC1 util/ntp-keygen-opts.texi@1.47.14.1 +7 -9 NTP_4_2_4P5_RC1 util/ntp-keygen.1@1.47.14.1 +3 -3 NTP_4_2_4P5_RC1 ChangeSet@1.1728, 2008-05-18 07:57:45-04:00, stenn@whimsy.udel.edu NTP_4_2_5P116 TAG: NTP_4_2_5P116 ntpd/ntpd-opts.c@1.108 +4 -4 NTP_4_2_5P116 ntpd/ntpd-opts.h@1.108 +4 -4 NTP_4_2_5P116 ntpd/ntpd-opts.texi@1.107 +1 -1 NTP_4_2_5P116 ntpd/ntpd.1@1.107 +2 -2 NTP_4_2_5P116 ntpdc/ntpdc-opts.c@1.104 +4 -4 NTP_4_2_5P116 ntpdc/ntpdc-opts.h@1.104 +4 -4 NTP_4_2_5P116 ntpdc/ntpdc-opts.texi@1.103 +1 -1 NTP_4_2_5P116 ntpdc/ntpdc.1@1.103 +2 -2 NTP_4_2_5P116 ntpq/ntpq-opts.c@1.104 +4 -4 NTP_4_2_5P116 ntpq/ntpq-opts.h@1.104 +4 -4 NTP_4_2_5P116 ntpq/ntpq-opts.texi@1.103 +1 -1 NTP_4_2_5P116 ntpq/ntpq.1@1.103 +2 -2 NTP_4_2_5P116 packageinfo.sh@1.119 +1 -1 NTP_4_2_5P116 sntp/sntp-opts.c@1.104 +5 -4 NTP_4_2_5P116 sntp/sntp-opts.h@1.104 +6 -5 NTP_4_2_5P116 sntp/sntp-opts.texi@1.103 +3 -2 NTP_4_2_5P116 sntp/sntp.1@1.103 +3 -3 NTP_4_2_5P116 util/ntp-keygen-opts.c@1.107 +4 -4 NTP_4_2_5P116 util/ntp-keygen-opts.h@1.107 +4 -4 NTP_4_2_5P116 util/ntp-keygen-opts.texi@1.106 +1 -1 NTP_4_2_5P116 util/ntp-keygen.1@1.106 +2 -2 NTP_4_2_5P116 ChangeSet@1.1436.1.94, 2008-05-18 05:14:37-04:00, stenn@whimsy.udel.edu Start the 4.2.4p5 release candidate cycle packageinfo.sh@1.65.20.1 +1 -1 Start the 4.2.4p5 release candidate cycle ChangeSet@1.1726, 2008-05-18 04:59:09-04:00, stenn@whimsy.udel.edu fix a merge conflict ntpd/ntp_io.c@1.273 +1 -1 fix a merge conflict ChangeSet@1.1724, 2008-05-15 07:44:36-04:00, stenn@whimsy.udel.edu NTP_4_2_5P115 TAG: NTP_4_2_5P115 ntpd/ntpd-opts.c@1.107 +2 -2 NTP_4_2_5P115 ntpd/ntpd-opts.h@1.107 +3 -3 NTP_4_2_5P115 ntpd/ntpd-opts.texi@1.106 +1 -1 NTP_4_2_5P115 ntpd/ntpd.1@1.106 +2 -2 NTP_4_2_5P115 ntpdc/ntpdc-opts.c@1.103 +2 -2 NTP_4_2_5P115 ntpdc/ntpdc-opts.h@1.103 +3 -3 NTP_4_2_5P115 ntpdc/ntpdc-opts.texi@1.102 +1 -1 NTP_4_2_5P115 ntpdc/ntpdc.1@1.102 +2 -2 NTP_4_2_5P115 ntpq/ntpq-opts.c@1.103 +2 -2 NTP_4_2_5P115 ntpq/ntpq-opts.h@1.103 +3 -3 NTP_4_2_5P115 ntpq/ntpq-opts.texi@1.102 +1 -1 NTP_4_2_5P115 ntpq/ntpq.1@1.102 +2 -2 NTP_4_2_5P115 packageinfo.sh@1.118 +1 -1 NTP_4_2_5P115 sntp/sntp-opts.c@1.103 +2 -2 NTP_4_2_5P115 sntp/sntp-opts.h@1.103 +3 -3 NTP_4_2_5P115 sntp/sntp-opts.texi@1.102 +1 -1 NTP_4_2_5P115 sntp/sntp.1@1.102 +2 -2 NTP_4_2_5P115 util/ntp-keygen-opts.c@1.106 +2 -2 NTP_4_2_5P115 util/ntp-keygen-opts.h@1.106 +3 -3 NTP_4_2_5P115 util/ntp-keygen-opts.texi@1.105 +1 -1 NTP_4_2_5P115 util/ntp-keygen.1@1.105 +2 -2 NTP_4_2_5P115 ChangeSet@1.1723, 2008-05-15 02:03:40-04:00, stenn@whimsy.udel.edu [Bug 1022] Fix compilation problems with yesterday's commit ChangeLog@1.185 +1 -0 [Bug 1022] Fix compilation problems with yesterday's commit include/ntp.h@1.145 +1 -1 [Bug 1022] Fix compilation problems with yesterday's commit ntpd/ntp_intres.c@1.54 +5 -0 [Bug 1022] Fix compilation problems with yesterday's commit ntpd/ntp_peer.c@1.113 +2 -0 [Bug 1022] Fix compilation problems with yesterday's commit ntpd/ntp_request.c@1.73 +5 -1 [Bug 1022] Fix compilation problems with yesterday's commit ntpd/refclock_acts.c@1.34 +1 -1 [Bug 1022] Fix compilation problems with yesterday's commit ChangeSet@1.1722, 2008-05-13 07:49:21-04:00, stenn@whimsy.udel.edu NTP_4_2_5P114 TAG: NTP_4_2_5P114 ntpd/ntpd-opts.c@1.106 +2 -2 NTP_4_2_5P114 ntpd/ntpd-opts.h@1.106 +3 -3 NTP_4_2_5P114 ntpd/ntpd-opts.texi@1.105 +2 -2 NTP_4_2_5P114 ntpd/ntpd.1@1.105 +2 -2 NTP_4_2_5P114 ntpdc/ntpdc-opts.c@1.102 +2 -2 NTP_4_2_5P114 ntpdc/ntpdc-opts.h@1.102 +3 -3 NTP_4_2_5P114 ntpdc/ntpdc-opts.texi@1.101 +2 -2 NTP_4_2_5P114 ntpdc/ntpdc.1@1.101 +2 -2 NTP_4_2_5P114 ntpq/ntpq-opts.c@1.102 +2 -2 NTP_4_2_5P114 ntpq/ntpq-opts.h@1.102 +3 -3 NTP_4_2_5P114 ntpq/ntpq-opts.texi@1.101 +2 -2 NTP_4_2_5P114 ntpq/ntpq.1@1.101 +2 -2 NTP_4_2_5P114 packageinfo.sh@1.117 +1 -1 NTP_4_2_5P114 sntp/sntp-opts.c@1.102 +2 -2 NTP_4_2_5P114 sntp/sntp-opts.h@1.102 +3 -3 NTP_4_2_5P114 sntp/sntp-opts.texi@1.101 +1 -1 NTP_4_2_5P114 sntp/sntp.1@1.101 +2 -2 NTP_4_2_5P114 util/ntp-keygen-opts.c@1.105 +2 -2 NTP_4_2_5P114 util/ntp-keygen-opts.h@1.105 +3 -3 NTP_4_2_5P114 util/ntp-keygen-opts.texi@1.104 +2 -2 NTP_4_2_5P114 util/ntp-keygen.1@1.104 +2 -2 NTP_4_2_5P114 ChangeSet@1.1721, 2008-05-13 05:18:04-04:00, stenn@whimsy.udel.edu Changes from Dave Mills (some backward-incompatible changes) ChangeLog@1.184 +71 -0 Changes from Dave Mills (some backward-incompatible changes) html/accopt.html@1.27 +30 -21 Documentation updated from Dave Mills html/accopt.html@1.26 +4 -5 Documentation updates from Dave Mills html/authopt.html@1.47 +38 -24 Documentation updated from Dave Mills html/bugs.html@1.4 +2 -2 Documentation updated from Dave Mills html/build.html@1.23 +9 -10 Documentation updated from Dave Mills html/clockopt.html@1.21 +5 -5 Documentation updated from Dave Mills html/comdex.html@1.1 +30 -0 BitKeeper file /deacon/backroom/ntp-dev/html/comdex.html html/comdex.html@1.0 +0 -0 html/config.html@1.21 +5 -5 Documentation updated from Dave Mills html/confopt.html@1.40 +7 -6 Documentation updated from Dave Mills html/copyright.html@1.39 +1 -2 Documentation updated from Dave Mills html/debug.html@1.25 +20 -121 Documentation updated from Dave Mills html/decode.html@1.1 +681 -0 BitKeeper file /deacon/backroom/ntp-dev/html/decode.html html/decode.html@1.0 +0 -0 html/genkeys.html@1.2 +1 -1 Documentation updated from Dave Mills html/hints/winnt.html@1.19 +4 -3 Documentation updated from Dave Mills html/index.html@1.37 +5 -4 Documentation updated from Dave Mills html/kern.html@1.16 +2 -2 Documentation updated from Dave Mills html/kernpps.html@1.2 +3 -0 Documentation updated from Dave Mills html/manyopt.html@1.17 +22 -19 Documentation updated from Dave Mills html/miscopt.html@1.40 +47 -69 Documentation updated from Dave Mills html/monopt.html@1.27 +388 -356 Documentation updated from Dave Mills html/monopt.html@1.26 +363 -330 Documentation updates from Dave Mills html/msyslog.html@1.9 +3 -3 Documentation updated from Dave Mills html/msyslog.html@1.8 +5 -2 Documentation updates from Dave Mills html/ntp_conf.html@1.2 +3 -3 Documentation updated from Dave Mills html/ntpd.html@1.43 +50 -71 Documentation updated from Dave Mills html/ntpd.html@1.42 +2 -2 Documentation updates from Dave Mills html/ntpdsim.html@1.7 +3 -3 Documentation updated from Dave Mills html/ntpdsim_new.html@1.3 +3 -3 Documentation updated from Dave Mills html/ntpq.html@1.29 +453 -190 Documentation updated from Dave Mills html/ntptime.html@1.16 +3 -3 Documentation updated from Dave Mills html/pic/alice15.gif@1.1 +587 -0 BitKeeper file /deacon/backroom/ntp-dev/html/pic/alice15.gif html/pic/alice15.gif@1.0 +0 -0 html/pic/flatheads.gif@1.1 +292 -0 BitKeeper file /deacon/backroom/ntp-dev/html/pic/flatheads.gif html/pic/flatheads.gif@1.0 +0 -0 html/pic/pogo7.gif@1.1 +309 -0 BitKeeper file /deacon/backroom/ntp-dev/html/pic/pogo7.gif html/pic/pogo7.gif@1.0 +0 -0 html/pic/tonea.gif@1.2 +251 -347 Documentation updated from Dave Mills html/pic/tribeb.gif@1.1 +675 -0 BitKeeper file /deacon/backroom/ntp-dev/html/pic/tribeb.gif html/pic/tribeb.gif@1.0 +0 -0 html/pic/wingdorothy.gif@1.2 +226 -313 Documentation updated from Dave Mills html/quick.html@1.19 +4 -4 Documentation updated from Dave Mills html/rate.html@1.3 +24 -20 Documentation updated from Dave Mills html/release.html@1.35 +2 -2 Documentation updated from Dave Mills html/scripts/accopt.txt@1.1 +5 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/accopt.txt html/scripts/accopt.txt@1.0 +0 -0 html/scripts/authopt.txt@1.1 +11 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/authopt.txt html/scripts/authopt.txt@1.0 +0 -0 html/scripts/clockopt.txt@1.1 +5 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/clockopt.txt html/scripts/clockopt.txt@1.0 +0 -0 html/scripts/command.txt@1.2 +1 -0 Documentation updated from Dave Mills html/scripts/config.txt@1.2 +1 -1 Documentation updated from Dave Mills html/scripts/confopt.txt@1.1 +11 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/confopt.txt html/scripts/confopt.txt@1.0 +0 -0 html/scripts/external.txt@1.2 +6 -4 Documentation updated from Dave Mills html/scripts/install.txt@1.2 +3 -2 Documentation updated from Dave Mills html/scripts/manual.txt@1.2 +2 -2 Documentation updated from Dave Mills html/scripts/miscopt.txt@1.1 +16 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/miscopt.txt html/scripts/miscopt.txt@1.0 +0 -0 html/scripts/monopt.txt@1.1 +5 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/monopt.txt html/scripts/monopt.txt@1.0 +0 -0 html/sitemap.html@1.2 +4 -4 Documentation updated from Dave Mills html/sntp.html@1.6 +4 -4 Documentation updated from Dave Mills include/ntp.h@1.144 +61 -46 Changes from Dave Mills include/ntp_control.h@1.33 +47 -47 Changes from Dave Mills include/ntp_crypto.h@1.44 +11 -10 Changes from Dave Mills include/ntpd.h@1.117 +22 -24 Changes from Dave Mills libntp/statestr.c@1.13 +120 -105 Changes from Dave Mills (some backward-incompatible changes) ntpd/ntp_config.c@1.177 +4 -3 Changes from Dave Mills ntpd/ntp_control.c@1.104 +98 -123 Changes from Dave Mills ntpd/ntp_crypto.c@1.122 +337 -497 Changes from Dave Mills ntpd/ntp_intres.c@1.53 +3 -6 Changes from Dave Mills ntpd/ntp_loopfilter.c@1.145 +163 -177 Changes from Dave Mills ntpd/ntp_monitor.c@1.23 +45 -35 Changes from Dave Mills ntpd/ntp_parser.c@1.26 +964 -938 Changes from Dave Mills ntpd/ntp_parser.h@1.11 +227 -223 Changes from Dave Mills ntpd/ntp_parser.y@1.21 +7 -2 Changes from Dave Mills ntpd/ntp_peer.c@1.112 +113 -81 Changes from Dave Mills ntpd/ntp_proto.c@1.272 +511 -474 Changes from Dave Mills ntpd/ntp_refclock.c@1.79 +13 -40 Changes from Dave Mills ntpd/ntp_request.c@1.72 +4 -12 Changes from Dave Mills ntpd/ntp_timer.c@1.47 +6 -8 Changes from Dave Mills ntpd/ntp_util.c@1.64 +78 -35 Changes from Dave Mills ntpd/ntpd.c@1.94 +1 -7 Changes from Dave Mills ntpd/refclock_acts.c@1.33 +30 -21 Changes from Dave Mills ntpd/refclock_atom.c@1.56 +4 -3 Changes from Dave Mills ntpd/refclock_local.c@1.17 +11 -17 Changes from Dave Mills ntpq/ntpq-subs.c@1.30 +125 -88 Changes from Dave Mills (some backward-incompatible changes) ntpq/ntpq.c@1.74 +11 -12 Changes from Dave Mills (some backward-incompatible changes) scripts/ntp-wait.in@1.6 +23 -11 handle the new ntpq format ChangeSet@1.1436.1.93, 2008-04-11 18:41:57-04:00, stenn@whimsy.udel.edu Solaris _XOPEN_SOURCE updates configure.ac@1.400.1.1 +5 -1 Solaris _XOPEN_SOURCE updates ChangeSet@1.1436.11.3, 2008-04-10 02:09:52-04:00, stenn@pogo.udel.edu Changelog cleanup ChangeLog@1.1.8.2 +2 -1 ChangeSet@1.1436.11.2, 2008-04-08 12:20:22+02:00, burnicki@pogo.udel.edu Always sleep a little before calling doconfigure() to make sure the network is completely up. ntpd/ntp_intres.c@1.48.1.3 +5 -6 Always sleep a little before calling doconfigure() to make sure the network is completely up. ChangeSet@1.1436.11.1, 2008-04-03 10:19:03-04:00, burnicki@pogo.udel.edu [Bug 987] Wake up the resolver thread/process when a new interface has become available. ChangeLog@1.1.8.1 +1 -0 [Bug 987] Wake up the resolver thread/process when a new interface has become available. include/ntpd.h@1.97.1.1 +5 -0 Added vars used to wake up the resolver process/thread. ntpd/ntp_config.c@1.141.1.2 +34 -1 Initialize synchronization variables when the resolver process/thread is started. ntpd/ntp_intres.c@1.48.1.2 +64 -65 Enable the resolver to be woken up when a new interface has become available. ntpd/ntp_io.c@1.244.2.12 +25 -5 Wake up the resolver thread/process when a new interface has become available. ChangeSet@1.1436.1.91, 2008-03-24 22:12:42-04:00, mayer@pogo.udel.edu bugs 993 a d 959 ChangeLog@1.1.1.37 +2 -0 bugs 993 a d 959 ChangeSet@1.1436.1.90, 2008-03-24 21:41:55-04:00, mayer@pogo.udel.edu [Bug 959] Refclock on Windows not properly releasing recvbuffs ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.4 +25 -13 [Bug 959] Refclock on Windows not properly releasing recvbuffs ChangeSet@1.1436.1.89, 2008-03-24 21:40:32-04:00, mayer@pogo.udel.edu [Bug 993] Windows: Fix memory leak when fetching system messages ports/winnt/libisc/isc_strerror.c@1.4.1.1 +78 -18 [Bug 993] Windows: Fix memory leak when fetching system messages ChangeSet@1.1436.9.5, 2008-03-22 02:12:10-05:00, stenn@whimsy.udel.edu [Bug 977] Fix mismatching #ifdefs for builds without IPv6 ChangeLog@1.1.6.4 +1 -0 [Bug 977] Fix mismatching #ifdefs for builds without IPv6 libisc/net.c@1.8.1.1 +1 -1 [Bug 977] Fix mismatching #ifdefs for builds without IPv6 ChangeSet@1.1436.9.4, 2008-03-22 02:02:36-05:00, stenn@whimsy.udel.edu Update the copyright year ChangeLog@1.1.6.3 +8 -6 Update the copyright year html/copyright.html@1.36.1.1 +1 -1 Update the copyright year include/copyright.def@1.5.1.1 +1 -1 Update the copyright year ChangeSet@1.1436.9.3, 2008-03-22 01:58:52-05:00, stenn@whimsy.udel.edu Make autogen-generated files writable ntpd/Makefile.am@1.52.2.2 +1 -1 Make autogen-generated files writable ntpdc/Makefile.am@1.33.1.2 +1 -1 Make autogen-generated files writable ntpq/Makefile.am@1.25.1.2 +1 -1 Make autogen-generated files writable sntp/Makefile.am@1.21.1.1 +1 -1 Make autogen-generated files writable util/Makefile.am@1.34.1.2 +1 -1 Make autogen-generated files writable ChangeSet@1.1436.10.1, 2008-03-16 09:15:13-04:00, burnicki@pogo.udel.edu [Bug 957] Windows only: Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. ChangeLog@1.1.7.1 +3 -0 [Bug 957] Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. ports/winnt/ntpd/ntservice.c@1.9.1.1 +11 -2 [Bug 957] Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. ChangeSet@1.1436.9.1, 2008-03-03 11:50:50+01:00, martin@pc-martin.py.meinberg.de [Bug 532] nptdate timeout is too long if several servers are supplied [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't [Bug 908] ntpdate crashes sometimes [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908) [Bug 997] ntpdate buffer too small and unsafe Under Windows check whether NTP port in use under same conditions as under other OSs. Fixed some typos and indents (tabs/spaces). ChangeLog@1.1.6.1 +10 -0 [Bug 532] nptdate timeout is too long if several servers are supplied [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't [Bug 908] ntpdate crashes sometimes [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908) [Bug 997] ntpdate buffer too small and unsafe Under Windows check whether NTP port in use under same conditions as under other OSs. Fixed some typos and indents (tabs/spaces). ntpdate/ntpdate.c@1.59.1.3 +101 -82 [Bug 532] nptdate timeout is too long if several servers are supplied [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't [Bug 908] ntpdate crashes sometimes [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908) [Bug 997] ntpdate buffer too small and unsafe Under Windows check whether NTP port in use under same conditions as under other OSs. Fixed some typos and indents (tabs/spaces). ChangeSet@1.1436.8.7, 2008-02-20 12:13:24+01:00, martin@pc-martin4. [Bug 909] Define int32_t for Windows (backport from ntp-dev) ChangeLog@1.1.5.3 +1 -0 [Bug 909] Define int32_t for Windows (backport from ntp-dev) ports/winnt/include/config.h@1.46.1.1 +2 -0 [Bug 909] Define int32_t for Windows (backport from ntp-dev) ChangeSet@1.1436.8.6, 2008-02-19 11:08:55-05:00, burnicki@pogo.udel.edu Fixed indentation. ntpd/ntp_io.c@1.244.2.11 +1 -1 Fixed indentation. ChangeSet@1.1436.8.5, 2008-02-18 09:30:34-05:00, burnicki@pogo.udel.edu Use new get_free_recv_buffer_alloc(). ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.3 +4 -4 Use new get_free_recv_buffer_alloc(). ChangeSet@1.1436.8.4, 2008-02-17 17:48:29+00:00, kardel@pogo.udel.edu recvbuff.c: Bug 1000: add some pico optimizations libntp/recvbuff.c@1.26.1.3 +5 -8 Bug 1000: add some pico optimizations ChangeSet@1.1436.8.3, 2008-02-17 08:38:07+00:00, kardel@pogo.udel.edu ntpd.c: Bug 1000: avoid timer() starvation during high load conditions ChangeLog: Bug 1000: additionally fix timer() starvation during high load ChangeLog@1.1.5.2 +1 -0 Bug 1000: additionally fix timer() starvation during high load ntpd/ntpd.c@1.82.2.3 +11 -0 Bug 1000: avoid timer() starvation during high load conditions ChangeSet@1.1436.8.2, 2008-02-17 08:10:59+00:00, kardel@pogo.udel.edu recvbuff.c: Bug 1000: replenish when having expeirenced empty free lists libntp/recvbuff.c@1.26.1.2 +1 -1 Bug 1000: replenish when having expeirenced empty free lists ChangeSet@1.1436.8.1, 2008-02-17 07:31:29+00:00, kardel@pogo.udel.edu recvbuff.c, recvbuff.h, ntp_io.c, ChangeLog: Bug 1000: Potentially insufficient number of receive buffers at startup ChangeLog@1.1.5.1 +3 -0 Bug 1000: Potentially insufficient number of receive buffers at startup include/recvbuff.h@1.11.1.2 +2 -1 Bug 1000: Potentially insufficient number of receive buffers at startup libntp/recvbuff.c@1.26.1.1 +30 -11 Bug 1000: Potentially insufficient number of receive buffers at startup ntpd/ntp_io.c@1.244.2.10 +6 -2 Bug 1000: Potentially insufficient number of receive buffers at startup ChangeSet@1.1720, 2008-02-08 06:48:48-05:00, stenn@whimsy.udel.edu NTP_4_2_5P113 TAG: NTP_4_2_5P113 ntpd/ntpd-opts.c@1.105 +2 -2 NTP_4_2_5P113 ntpd/ntpd-opts.h@1.105 +3 -3 NTP_4_2_5P113 ntpd/ntpd-opts.texi@1.104 +1 -1 NTP_4_2_5P113 ntpd/ntpd.1@1.104 +2 -2 NTP_4_2_5P113 ntpdc/ntpdc-opts.c@1.101 +2 -2 NTP_4_2_5P113 ntpdc/ntpdc-opts.h@1.101 +3 -3 NTP_4_2_5P113 ntpdc/ntpdc-opts.texi@1.100 +1 -1 NTP_4_2_5P113 ntpdc/ntpdc.1@1.100 +2 -2 NTP_4_2_5P113 ntpq/ntpq-opts.c@1.101 +2 -2 NTP_4_2_5P113 ntpq/ntpq-opts.h@1.101 +3 -3 NTP_4_2_5P113 ntpq/ntpq-opts.texi@1.100 +1 -1 NTP_4_2_5P113 ntpq/ntpq.1@1.100 +2 -2 NTP_4_2_5P113 packageinfo.sh@1.116 +1 -1 NTP_4_2_5P113 sntp/sntp-opts.c@1.101 +2 -2 NTP_4_2_5P113 sntp/sntp-opts.h@1.101 +3 -3 NTP_4_2_5P113 sntp/sntp-opts.texi@1.100 +1 -1 NTP_4_2_5P113 sntp/sntp.1@1.100 +2 -2 NTP_4_2_5P113 util/ntp-keygen-opts.c@1.104 +2 -2 NTP_4_2_5P113 util/ntp-keygen-opts.h@1.104 +3 -3 NTP_4_2_5P113 util/ntp-keygen-opts.texi@1.103 +1 -1 NTP_4_2_5P113 util/ntp-keygen.1@1.103 +2 -2 NTP_4_2_5P113 ChangeSet@1.1719, 2008-02-08 05:59:25-05:00, stenn@whimsy.udel.edu Updates and cleanup from Dave Mills ChangeLog@1.183 +1 -0 Updates and cleanup from Dave Mills html/bugs.html@1.3 +7 -6 Updates and cleanup from Dave Mills html/miscopt.html@1.39 +7 -10 Updates and cleanup from Dave Mills html/monopt.html@1.25 +26 -16 Updates and cleanup from Dave Mills html/rate.html@1.2 +19 -19 Updates and cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.144 +0 -1 Updates and cleanup from Dave Mills ntpd/ntp_proto.c@1.271 +50 -48 Updates and cleanup from Dave Mills ChangeSet@1.1718, 2008-02-07 06:45:57-05:00, stenn@whimsy.udel.edu NTP_4_2_5P112 TAG: NTP_4_2_5P112 ntpd/ntpd-opts.c@1.104 +2 -2 NTP_4_2_5P112 ntpd/ntpd-opts.h@1.104 +3 -3 NTP_4_2_5P112 ntpd/ntpd-opts.texi@1.103 +1 -1 NTP_4_2_5P112 ntpd/ntpd.1@1.103 +2 -2 NTP_4_2_5P112 ntpdc/ntpdc-opts.c@1.100 +2 -2 NTP_4_2_5P112 ntpdc/ntpdc-opts.h@1.100 +3 -3 NTP_4_2_5P112 ntpdc/ntpdc-opts.texi@1.99 +1 -1 NTP_4_2_5P112 ntpdc/ntpdc.1@1.99 +2 -2 NTP_4_2_5P112 ntpq/ntpq-opts.c@1.100 +2 -2 NTP_4_2_5P112 ntpq/ntpq-opts.h@1.100 +3 -3 NTP_4_2_5P112 ntpq/ntpq-opts.texi@1.99 +1 -1 NTP_4_2_5P112 ntpq/ntpq.1@1.99 +2 -2 NTP_4_2_5P112 packageinfo.sh@1.115 +1 -1 NTP_4_2_5P112 sntp/sntp-opts.c@1.100 +2 -2 NTP_4_2_5P112 sntp/sntp-opts.h@1.100 +3 -3 NTP_4_2_5P112 sntp/sntp-opts.texi@1.99 +1 -1 NTP_4_2_5P112 sntp/sntp.1@1.99 +2 -2 NTP_4_2_5P112 util/ntp-keygen-opts.c@1.103 +2 -2 NTP_4_2_5P112 util/ntp-keygen-opts.h@1.103 +3 -3 NTP_4_2_5P112 util/ntp-keygen-opts.texi@1.102 +1 -1 NTP_4_2_5P112 util/ntp-keygen.1@1.102 +2 -2 NTP_4_2_5P112 ChangeSet@1.1717, 2008-02-07 01:30:59-05:00, stenn@whimsy.udel.edu [Bug 995] Remove spurious ; from ntp-keygen.c ChangeLog@1.182 +1 -0 [Bug 995] Remove spurious ; from ntp-keygen.c util/ntp-keygen.c@1.50 +1 -1 [Bug 995] Remove spurious ; from ntp-keygen.c ChangeSet@1.1716, 2008-02-01 06:46:14-05:00, stenn@whimsy.udel.edu NTP_4_2_5P111 TAG: NTP_4_2_5P111 ntpd/ntpd-opts.c@1.103 +2 -2 NTP_4_2_5P111 ntpd/ntpd-opts.h@1.103 +3 -3 NTP_4_2_5P111 ntpd/ntpd-opts.texi@1.102 +2 -2 NTP_4_2_5P111 ntpd/ntpd.1@1.102 +2 -2 NTP_4_2_5P111 ntpdc/ntpdc-opts.c@1.99 +2 -2 NTP_4_2_5P111 ntpdc/ntpdc-opts.h@1.99 +3 -3 NTP_4_2_5P111 ntpdc/ntpdc-opts.texi@1.98 +2 -2 NTP_4_2_5P111 ntpdc/ntpdc.1@1.98 +2 -2 NTP_4_2_5P111 ntpq/ntpq-opts.c@1.99 +2 -2 NTP_4_2_5P111 ntpq/ntpq-opts.h@1.99 +3 -3 NTP_4_2_5P111 ntpq/ntpq-opts.texi@1.98 +2 -2 NTP_4_2_5P111 ntpq/ntpq.1@1.98 +2 -2 NTP_4_2_5P111 packageinfo.sh@1.114 +1 -1 NTP_4_2_5P111 sntp/sntp-opts.c@1.99 +2 -2 NTP_4_2_5P111 sntp/sntp-opts.h@1.99 +3 -3 NTP_4_2_5P111 sntp/sntp-opts.texi@1.98 +1 -1 NTP_4_2_5P111 sntp/sntp.1@1.98 +2 -2 NTP_4_2_5P111 util/ntp-keygen-opts.c@1.102 +2 -2 NTP_4_2_5P111 util/ntp-keygen-opts.h@1.102 +3 -3 NTP_4_2_5P111 util/ntp-keygen-opts.texi@1.101 +2 -2 NTP_4_2_5P111 util/ntp-keygen.1@1.101 +2 -2 NTP_4_2_5P111 ChangeSet@1.1715, 2008-02-01 01:42:27-05:00, stenn@whimsy.udel.edu Cleanup from Dave Mills ChangeLog@1.181 +4 -3 Cleanup from Dave Mills include/ntp.h@1.143 +3 -11 Cleanup from Dave Mills include/ntpd.h@1.116 +1 -1 Cleanup from Dave Mills ntpd/ntp_config.c@1.176 +3 -3 Cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.143 +3 -4 Cleanup from Dave Mills ntpd/ntp_monitor.c@1.22 +11 -6 Cleanup from Dave Mills ntpd/ntp_parser.c@1.25 +1 -1 Cleanup from Dave Mills ntpd/ntp_parser.y@1.20 +1 -1 Cleanup from Dave Mills ntpd/ntp_proto.c@1.270 +79 -116 Cleanup from Dave Mills ntpd/ntp_timer.c@1.46 +0 -1 Cleanup from Dave Mills ntpd/ntp_util.c@1.63 +5 -2 Cleanup from Dave Mills ntpdc/ntpdc_ops.c@1.54 +1 -1 Cleanup from Dave Mills ChangeSet@1.1714, 2008-01-27 21:42:55-05:00, mayer@pogo.udel.edu [Bug #980] Direct ntptrace help to stdout ChangeLog@1.180 +1 -0 [Bug #980] scripts/ntptrace.in@1.6 +1 -0 [Bug #980] Direct help to stdout ChangeSet@1.1713, 2008-01-27 21:39:10-05:00, mayer@pogo.udel.edu [Bug 959] Refclock on Windows not properly releasing recvbuffs ChangeLog@1.179 +1 -0 Bug 959 libntp/recvbuff.c@1.27 +0 -4 [Bug 959] Refclock on Windows not properly releasing recvbuffs ports/winnt/ntpd/ntp_iocompletionport.c@1.33 +5 -9 [Bug 959] Refclock on Windows not properly releasing recvbuffs ChangeSet@1.1712, 2008-01-27 21:06:48-05:00, mayer@pogo.udel.edu Bug 993 ChangeLog@1.178 +1 -0 Bug 993 ChangeSet@1.1711, 2008-01-27 21:05:20-05:00, mayer@pogo.udel.edu [Bug 993] Fix memory leak when fetching system messages ports/winnt/libisc/isc_strerror.c@1.5 +78 -18 [Bug 993] Fix memory leak when fetching system messages ChangeSet@1.1710, 2008-01-26 06:51:10-05:00, stenn@whimsy.udel.edu NTP_4_2_5P110 TAG: NTP_4_2_5P110 ntpd/ntpd-opts.c@1.102 +2 -2 NTP_4_2_5P110 ntpd/ntpd-opts.h@1.102 +3 -3 NTP_4_2_5P110 ntpd/ntpd-opts.texi@1.101 +2 -2 NTP_4_2_5P110 ntpd/ntpd.1@1.101 +2 -2 NTP_4_2_5P110 ntpdc/ntpdc-opts.c@1.98 +2 -2 NTP_4_2_5P110 ntpdc/ntpdc-opts.h@1.98 +3 -3 NTP_4_2_5P110 ntpdc/ntpdc-opts.texi@1.97 +2 -2 NTP_4_2_5P110 ntpdc/ntpdc.1@1.97 +2 -2 NTP_4_2_5P110 ntpq/ntpq-opts.c@1.98 +2 -2 NTP_4_2_5P110 ntpq/ntpq-opts.h@1.98 +3 -3 NTP_4_2_5P110 ntpq/ntpq-opts.texi@1.97 +2 -2 NTP_4_2_5P110 ntpq/ntpq.1@1.97 +2 -2 NTP_4_2_5P110 packageinfo.sh@1.113 +1 -1 NTP_4_2_5P110 sntp/sntp-opts.c@1.98 +2 -2 NTP_4_2_5P110 sntp/sntp-opts.h@1.98 +3 -3 NTP_4_2_5P110 sntp/sntp-opts.texi@1.97 +1 -1 NTP_4_2_5P110 sntp/sntp.1@1.97 +2 -2 NTP_4_2_5P110 util/ntp-keygen-opts.c@1.101 +2 -2 NTP_4_2_5P110 util/ntp-keygen-opts.h@1.101 +3 -3 NTP_4_2_5P110 util/ntp-keygen-opts.texi@1.100 +2 -2 NTP_4_2_5P110 util/ntp-keygen.1@1.100 +2 -2 NTP_4_2_5P110 ChangeSet@1.1709, 2008-01-26 04:02:52-05:00, stenn@whimsy.udel.edu much cleanup, fixes, and changes from Dave Mills ChangeLog@1.177 +1 -0 much cleanup, fixes, and changes from Dave Mills ntpd/ntp_crypto.c@1.121 +156 -177 much cleanup, fixes, and changes from Dave Mills ntpd/ntp_intres.c@1.52 +4 -3 much cleanup, fixes, and changes from Dave Mills ntpd/ntp_loopfilter.c@1.142 +176 -163 much cleanup, fixes, and changes from Dave Mills ntpd/ntp_monitor.c@1.21 +4 -4 much cleanup, fixes, and changes from Dave Mills ntpd/ntp_peer.c@1.111 +1 -2 much cleanup, fixes, and changes from Dave Mills ntpd/ntp_proto.c@1.269 +218 -142 much cleanup, fixes, and changes from Dave Mills ntpd/ntp_timer.c@1.45 +22 -28 much cleanup, fixes, and changes from Dave Mills ntpd/ntp_util.c@1.62 +108 -91 much cleanup, fixes, and changes from Dave Mills ChangeSet@1.1708, 2008-01-26 03:46:39-05:00, stenn@whimsy.udel.edu ntp_control.c: LEAPTAB is a filestamp, not an unsigned. From Dave Mills. ChangeLog@1.176 +1 -0 ntp_control.c: LEAPTAB is a filestamp, not an unsigned. From Dave Mills. ntpd/ntp_control.c@1.103 +1 -1 ntp_control.c: LEAPTAB is a filestamp, not an unsigned. From Dave Mills. ChangeSet@1.1707, 2008-01-26 03:41:54-05:00, stenn@whimsy.udel.edu ntp_config.c: ntp_minpoll fixes from Dave Mills ChangeLog@1.175 +1 -0 ntp_config.c: ntp_minpoll fixes from Dave Mills ntpd/ntp_config.c@1.175 +4 -4 ntp_config.c: ntp_minpoll fixes from Dave Mills ChangeSet@1.1706, 2008-01-26 03:36:11-05:00, stenn@whimsy.udel.edu ntp-keygen updated from Dave Mills ChangeLog@1.174 +1 -0 ntp-keygen updated from Dave Mills util/ntp-keygen.c@1.49 +614 -460 ntp-keygen updated from Dave Mills ChangeSet@1.1705, 2008-01-26 03:30:14-05:00, stenn@whimsy.udel.edu refresh epoch, throttle, and leap cleanup from Dave Mills ChangeLog@1.173 +1 -0 refresh epoch, throttle, and leap cleanup from Dave Mills include/ntp.h@1.142 +9 -14 refresh epoch, throttle, and leap cleanup from Dave Mills include/ntp_crypto.h@1.43 +1 -0 refresh epoch, throttle, and leap cleanup from Dave Mills include/ntpd.h@1.115 +7 -16 refresh epoch, throttle, and leap cleanup from Dave Mills ChangeSet@1.1704, 2008-01-26 03:16:13-05:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills BitKeeper/deleted/.del-footer.txt@1.2 +0 -0 Delete: html/build/scripts/footer.txt BitKeeper/deleted/.del-groups.html@1.2 +0 -0 Delete: html/groups.html BitKeeper/deleted/.del-ldisc.html@1.13 +0 -0 Delete: html/ldisc.html BitKeeper/deleted/.del-links10.txt@1.2 +0 -0 Delete: html/build/scripts/links10.txt BitKeeper/deleted/.del-links10.txt~2eb1ee39ee3ae750@1.3 +0 -0 Delete: html/scripts/links10.txt BitKeeper/deleted/.del-links11.txt@1.2 +0 -0 Delete: html/build/scripts/links11.txt BitKeeper/deleted/.del-links11.txt~6bbb69abc176cdfa@1.3 +0 -0 Delete: html/scripts/links11.txt BitKeeper/deleted/.del-links12.txt@1.2 +0 -0 Delete: html/build/scripts/links12.txt BitKeeper/deleted/.del-links12.txt~44ae7fa96b25e3d8@1.2 +0 -0 Delete: html/scripts/links12.txt BitKeeper/deleted/.del-links7.txt@1.2 +0 -0 Delete: html/build/scripts/links7.txt BitKeeper/deleted/.del-links7.txt~82fadd0532b4ef1f@1.5 +0 -0 Delete: html/scripts/links7.txt BitKeeper/deleted/.del-links8.txt@1.2 +0 -0 Delete: html/build/scripts/links8.txt BitKeeper/deleted/.del-links8.txt~af6a09ad412e8a40@1.3 +0 -0 Delete: html/scripts/links8.txt BitKeeper/deleted/.del-links9.txt@1.2 +0 -0 Delete: html/build/scripts/links9.txt BitKeeper/deleted/.del-links9.txt~8709272ab9515ec0@1.4 +0 -0 Delete: html/scripts/links9.txt BitKeeper/deleted/.del-measure.html@1.12 +0 -0 Delete: html/measure.html BitKeeper/deleted/.del-mx4200data.html@1.12 +0 -0 Delete: html/mx4200data.html BitKeeper/deleted/.del-netbsd@1.4 +0 -0 Delete: html/hints/netbsd html/hints/netbsd@1.3 +0 -0 Rename: html/build/hints/netbsd -> html/hints/netbsd BitKeeper/deleted/.del-notes.html@1.19 +0 -0 Delete: html/notes.html BitKeeper/deleted/.del-patches.html@1.19 +0 -0 Delete: html/patches.html html/patches.html@1.18 +0 -0 Rename: html/build/patches.html -> html/patches.html BitKeeper/deleted/.del-porting.html@1.15 +0 -0 Delete: html/porting.html html/porting.html@1.14 +0 -0 Rename: html/build/porting.html -> html/porting.html BitKeeper/deleted/.del-style.css@1.2 +0 -0 Delete: html/build/scripts/style.css ChangeLog@1.172 +1 -0 Documentation updates from Dave Mills html/accopt.html@1.25 +3 -3 Documentation updates from Dave Mills html/assoc.html@1.26 +9 -9 Documentation updates from Dave Mills html/audio.html@1.20 +3 -2 Documentation updates from Dave Mills html/authopt.html@1.46 +123 -57 Documentation updates from Dave Mills html/bugs.html@1.2 +8 -10 Documentation updates from Dave Mills html/build.html@1.22 +53 -76 Documentation updates from Dave Mills html/build.html@1.21 +0 -0 Rename: html/build/build.html -> html/build.html html/clockopt.html@1.20 +4 -3 Documentation updates from Dave Mills html/config.html@1.20 +48 -47 Documentation updates from Dave Mills html/config.html@1.19 +0 -0 Rename: html/build/config.html -> html/config.html html/confopt.html@1.39 +2 -2 Documentation updates from Dave Mills html/copyright.html@1.38 +3 -4 Documentation updates from Dave Mills html/debug.html@1.24 +2 -2 Documentation updates from Dave Mills html/description_files/description.jpg@1.1 +761 -0 BitKeeper file /deacon/backroom/ntp-dev/html/description_files/description.jpg html/description_files/description.jpg@1.0 +0 -0 html/drivers/driver10.html@1.12 +46 -46 Documentation updates from Dave Mills html/drivers/driver11.html@1.12 +55 -57 Documentation updates from Dave Mills html/drivers/driver18.html@1.16 +2 -2 Documentation updates from Dave Mills html/drivers/driver19.html@1.11 +48 -48 Documentation updates from Dave Mills html/drivers/driver27.html@1.15 +0 -2 Documentation updates from Dave Mills html/drivers/driver34.html@1.12 +67 -105 Documentation updates from Dave Mills html/drivers/driver4.html@1.13 +3 -4 Documentation updates from Dave Mills html/drivers/driver9.html@1.14 +50 -51 Documentation updates from Dave Mills html/drivers/mx4200data.html@1.1 +1074 -0 BitKeeper file /deacon/backroom/ntp-dev/html/drivers/mx4200data.html html/drivers/mx4200data.html@1.0 +0 -0 html/gadget.html@1.2 +2 -1 Documentation updates from Dave Mills html/genkeys.html@1.1 +94 -0 BitKeeper file /deacon/backroom/ntp-dev/html/genkeys.html html/genkeys.html@1.0 +0 -0 html/hints.html@1.17 +17 -16 Documentation updates from Dave Mills html/hints.html@1.16 +0 -0 Rename: html/build/hints.html -> html/hints.html html/hints/a-ux@1.4 +0 -0 Rename: html/build/hints/a-ux -> html/hints/a-ux html/hints/aix@1.4 +0 -0 Rename: html/build/hints/aix -> html/hints/aix html/hints/bsdi@1.4 +0 -0 Rename: html/build/hints/bsdi -> html/hints/bsdi html/hints/changes@1.4 +0 -0 Rename: html/build/hints/changes -> html/hints/changes html/hints/decosf1@1.4 +0 -0 Rename: html/build/hints/decosf1 -> html/hints/decosf1 html/hints/decosf2@1.4 +0 -0 Rename: html/build/hints/decosf2 -> html/hints/decosf2 html/hints/freebsd@1.4 +0 -0 Rename: html/build/hints/freebsd -> html/hints/freebsd html/hints/hpux@1.4 +0 -0 Rename: html/build/hints/hpux -> html/hints/hpux html/hints/linux@1.4 +0 -0 Rename: html/build/hints/linux -> html/hints/linux html/hints/mpeix@1.4 +0 -0 Rename: html/build/hints/mpeix -> html/hints/mpeix html/hints/notes-xntp-v3@1.4 +0 -0 Rename: html/build/hints/notes-xntp-v3 -> html/hints/notes-xntp-v3 html/hints/parse@1.6 +1 -1 Documentation updates from Dave Mills html/hints/parse@1.5 +0 -0 Rename: html/build/hints/parse -> html/hints/parse html/hints/refclocks@1.4 +0 -0 Rename: html/build/hints/refclocks -> html/hints/refclocks html/hints/rs6000@1.4 +0 -0 Rename: html/build/hints/rs6000 -> html/hints/rs6000 html/hints/sco.html@1.10 +10 -9 Documentation updates from Dave Mills html/hints/sco.html@1.9 +0 -0 Rename: html/build/hints/sco.html -> html/hints/sco.html html/hints/sgi@1.4 +0 -0 Rename: html/build/hints/sgi -> html/hints/sgi html/hints/solaris-dosynctodr.html@1.7 +11 -11 Documentation updates from Dave Mills html/hints/solaris-dosynctodr.html@1.6 +0 -0 Rename: html/build/hints/solaris-dosynctodr.html -> html/hints/solaris-dosynctodr.html html/hints/solaris.html@1.10 +1 -1 Documentation updates from Dave Mills html/hints/solaris.html@1.9 +0 -0 Rename: html/build/hints/solaris.html -> html/hints/solaris.html html/hints/solaris.xtra.4023118@1.4 +0 -0 Rename: html/build/hints/solaris.xtra.4023118 -> html/hints/solaris.xtra.4023118 html/hints/solaris.xtra.4095849@1.4 +0 -0 Rename: html/build/hints/solaris.xtra.4095849 -> html/hints/solaris.xtra.4095849 html/hints/solaris.xtra.S99ntpd@1.5 +0 -0 Rename: html/build/hints/solaris.xtra.S99ntpd -> html/hints/solaris.xtra.S99ntpd html/hints/solaris.xtra.patchfreq@1.4 +0 -0 Rename: html/build/hints/solaris.xtra.patchfreq -> html/hints/solaris.xtra.patchfreq html/hints/sun4@1.4 +0 -0 Rename: html/build/hints/sun4 -> html/hints/sun4 html/hints/svr4-dell@1.4 +0 -0 Rename: html/build/hints/svr4-dell -> html/hints/svr4-dell html/hints/svr4_package@1.4 +0 -0 Rename: html/build/hints/svr4_package -> html/hints/svr4_package html/hints/todo@1.4 +0 -0 Rename: html/build/hints/todo -> html/hints/todo html/hints/vxworks.html@1.9 +64 -61 Documentation updates from Dave Mills html/hints/vxworks.html@1.8 +0 -0 Rename: html/build/hints/vxworks.html -> html/hints/vxworks.html html/hints/winnt.html@1.18 +142 -239 Documentation updates from Dave Mills html/hints/winnt.html@1.17 +0 -0 Rename: html/build/hints/winnt.html -> html/hints/winnt.html html/howto.html@1.19 +31 -52 Documentation updates from Dave Mills html/index.html@1.36 +28 -66 Documentation updates from Dave Mills html/kern.html@1.15 +4 -5 Documentation updates from Dave Mills html/kernpps.html@1.1 +47 -0 BitKeeper file /deacon/backroom/ntp-dev/html/kernpps.html html/kernpps.html@1.0 +0 -0 html/keygen.html@1.11 +17 -25 Documentation updates from Dave Mills html/manyopt.html@1.16 +22 -32 Documentation updates from Dave Mills html/miscopt.html@1.38 +8 -3 Documentation updates from Dave Mills html/monopt.html@1.24 +360 -104 Documentation updates from Dave Mills html/msyslog.html@1.7 +2 -2 Documentation updates from Dave Mills html/ntpd.html@1.41 +2 -2 Documentation updates from Dave Mills html/ntpdc.html@1.29 +2 -2 Documentation updates from Dave Mills html/ntpdsim.html@1.6 +2 -2 Documentation updates from Dave Mills html/ntpdsim_new.html@1.2 +4 -4 Documentation updates from Dave Mills html/ntpq.html@1.28 +2 -2 Documentation updates from Dave Mills html/ntptrace.html@1.14 +3 -2 Documentation updates from Dave Mills html/pic/broad.gif@1.1 +129 -0 BitKeeper file /deacon/backroom/ntp-dev/html/pic/broad.gif html/pic/broad.gif@1.0 +0 -0 html/pic/peer.gif@1.1 +111 -0 BitKeeper file /deacon/backroom/ntp-dev/html/pic/peer.gif html/pic/peer.gif@1.0 +0 -0 html/pps.html@1.19 +26 -20 Documentation updates from Dave Mills html/prefer.html@1.16 +2 -10 Documentation updates from Dave Mills html/quick.html@1.18 +26 -23 Documentation updates from Dave Mills html/quick.html@1.17 +0 -0 Rename: html/build/quick.html -> html/quick.html html/rate.html@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/html/rate.html html/rate.html@1.0 +0 -0 html/rdebug.html@1.16 +3 -4 Documentation updates from Dave Mills html/refclock.html@1.33 +17 -30 Documentation updates from Dave Mills html/release.html@1.34 +23 -33 Documentation updates from Dave Mills html/scripts/audio.txt@1.1 +7 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/audio.txt html/scripts/audio.txt@1.0 +0 -0 html/scripts/command.txt@1.1 +10 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/command.txt html/scripts/command.txt@1.0 +0 -0 html/scripts/config.txt@1.1 +7 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/config.txt html/scripts/config.txt@1.0 +0 -0 html/scripts/external.txt@1.1 +13 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/external.txt html/scripts/external.txt@1.0 +0 -0 html/scripts/install.txt@1.1 +11 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/install.txt html/scripts/install.txt@1.0 +0 -0 html/scripts/manual.txt@1.1 +13 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/manual.txt html/scripts/manual.txt@1.0 +0 -0 html/scripts/misc.txt@1.1 +9 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/misc.txt html/scripts/misc.txt@1.0 +0 -0 html/scripts/refclock.txt@1.1 +7 -0 BitKeeper file /deacon/backroom/ntp-dev/html/scripts/refclock.txt html/scripts/refclock.txt@1.0 +0 -0 html/sitemap.html@1.1 +34 -0 BitKeeper file /deacon/backroom/ntp-dev/html/sitemap.html html/sitemap.html@1.0 +0 -0 html/sntp.html@1.5 +2 -3 Documentation updates from Dave Mills html/tickadj.html@1.15 +8 -11 Documentation updates from Dave Mills ChangeSet@1.1436.7.1, 2008-01-26 06:43:33+00:00, kardel@pogo.udel.edu ntpdbase-opts.def, ChangeLog, cmd_args.c: remove minimum interface update interval restriction ChangeLog@1.1.4.1 +2 -0 remove minimum interface update interval restriction ntpd/cmd_args.c@1.45.3.3 +2 -2 remove minimum interface update interval restriction ntpd/ntpdbase-opts.def@1.10.1.1 +1 -1 remove minimum interface update interval restriction ChangeSet@1.1703, 2007-12-19 06:45:26-05:00, stenn@whimsy.udel.edu NTP_4_2_5P109 TAG: NTP_4_2_5P109 ntpd/ntpd-opts.c@1.101 +2 -2 NTP_4_2_5P109 ntpd/ntpd-opts.h@1.101 +3 -3 NTP_4_2_5P109 ntpd/ntpd-opts.texi@1.100 +1 -1 NTP_4_2_5P109 ntpd/ntpd.1@1.100 +2 -2 NTP_4_2_5P109 ntpdc/ntpdc-opts.c@1.97 +2 -2 NTP_4_2_5P109 ntpdc/ntpdc-opts.h@1.97 +3 -3 NTP_4_2_5P109 ntpdc/ntpdc-opts.texi@1.96 +1 -1 NTP_4_2_5P109 ntpdc/ntpdc.1@1.96 +2 -2 NTP_4_2_5P109 ntpq/ntpq-opts.c@1.97 +2 -2 NTP_4_2_5P109 ntpq/ntpq-opts.h@1.97 +3 -3 NTP_4_2_5P109 ntpq/ntpq-opts.texi@1.96 +1 -1 NTP_4_2_5P109 ntpq/ntpq.1@1.96 +2 -2 NTP_4_2_5P109 packageinfo.sh@1.112 +1 -1 NTP_4_2_5P109 sntp/sntp-opts.c@1.97 +2 -2 NTP_4_2_5P109 sntp/sntp-opts.h@1.97 +3 -3 NTP_4_2_5P109 sntp/sntp-opts.texi@1.96 +1 -1 NTP_4_2_5P109 sntp/sntp.1@1.96 +2 -2 NTP_4_2_5P109 util/ntp-keygen-opts.c@1.100 +2 -2 NTP_4_2_5P109 util/ntp-keygen-opts.h@1.100 +3 -3 NTP_4_2_5P109 util/ntp-keygen-opts.texi@1.99 +1 -1 NTP_4_2_5P109 util/ntp-keygen.1@1.99 +2 -2 NTP_4_2_5P109 ChangeSet@1.1702, 2007-12-18 12:05:55-05:00, burnicki@pogo.udel.edu Account for changes due to bug 918. ports/winnt/libntp/libntp.dsp@1.32 +1 -1 Account for changes due to bug 918. ChangeSet@1.1701, 2007-12-18 06:49:15-05:00, stenn@whimsy.udel.edu NTP_4_2_5P108 TAG: NTP_4_2_5P108 ntpd/ntpd-opts.c@1.100 +2 -2 NTP_4_2_5P108 ntpd/ntpd-opts.h@1.100 +3 -3 NTP_4_2_5P108 ntpd/ntpd-opts.texi@1.99 +2 -2 NTP_4_2_5P108 ntpd/ntpd.1@1.99 +2 -2 NTP_4_2_5P108 ntpdc/ntpdc-opts.c@1.96 +2 -2 NTP_4_2_5P108 ntpdc/ntpdc-opts.h@1.96 +3 -3 NTP_4_2_5P108 ntpdc/ntpdc-opts.texi@1.95 +2 -2 NTP_4_2_5P108 ntpdc/ntpdc.1@1.95 +2 -2 NTP_4_2_5P108 ntpq/ntpq-opts.c@1.96 +2 -2 NTP_4_2_5P108 ntpq/ntpq-opts.h@1.96 +3 -3 NTP_4_2_5P108 ntpq/ntpq-opts.texi@1.95 +2 -2 NTP_4_2_5P108 ntpq/ntpq.1@1.95 +2 -2 NTP_4_2_5P108 packageinfo.sh@1.111 +1 -1 NTP_4_2_5P108 sntp/sntp-opts.c@1.96 +2 -2 NTP_4_2_5P108 sntp/sntp-opts.h@1.96 +3 -3 NTP_4_2_5P108 sntp/sntp-opts.texi@1.95 +1 -1 NTP_4_2_5P108 sntp/sntp.1@1.95 +2 -2 NTP_4_2_5P108 util/ntp-keygen-opts.c@1.99 +2 -2 NTP_4_2_5P108 util/ntp-keygen-opts.h@1.99 +3 -3 NTP_4_2_5P108 util/ntp-keygen-opts.texi@1.98 +2 -2 NTP_4_2_5P108 util/ntp-keygen.1@1.98 +2 -2 NTP_4_2_5P108 ChangeSet@1.1700, 2007-12-18 04:02:42-05:00, stenn@whimsy.udel.edu [Bug 918] Only use a native md5.h if MD5Init() is available ChangeLog@1.171 +1 -0 [Bug 918] Only use a native md5.h if MD5Init() is available configure.ac@1.413 +2 -7 [Bug 918] Only use a native md5.h if MD5Init() is available include/ntp_md5.h@1.3 +1 -1 [Bug 918] Only use a native md5.h if MD5Init() is available ChangeSet@1.1689.1.1, 2007-12-16 12:16:08-05:00, mayer@pogo.udel.edu Bug #830 Fix interface count ntpd/ntp_io.c@1.271 +3 -1 Bug #830 Fix interface count ChangeSet@1.1698, 2007-12-16 06:49:22-05:00, stenn@whimsy.udel.edu NTP_4_2_5P107 TAG: NTP_4_2_5P107 ntpd/ntpd-opts.c@1.99 +2 -2 NTP_4_2_5P107 ntpd/ntpd-opts.h@1.99 +3 -3 NTP_4_2_5P107 ntpd/ntpd-opts.texi@1.98 +2 -2 NTP_4_2_5P107 ntpd/ntpd.1@1.98 +2 -2 NTP_4_2_5P107 ntpdc/ntpdc-opts.c@1.95 +2 -2 NTP_4_2_5P107 ntpdc/ntpdc-opts.h@1.95 +3 -3 NTP_4_2_5P107 ntpdc/ntpdc-opts.texi@1.94 +2 -2 NTP_4_2_5P107 ntpdc/ntpdc.1@1.94 +2 -2 NTP_4_2_5P107 ntpq/ntpq-opts.c@1.95 +2 -2 NTP_4_2_5P107 ntpq/ntpq-opts.h@1.95 +3 -3 NTP_4_2_5P107 ntpq/ntpq-opts.texi@1.94 +2 -2 NTP_4_2_5P107 ntpq/ntpq.1@1.94 +2 -2 NTP_4_2_5P107 packageinfo.sh@1.110 +1 -1 NTP_4_2_5P107 sntp/sntp-opts.c@1.95 +2 -2 NTP_4_2_5P107 sntp/sntp-opts.h@1.95 +3 -3 NTP_4_2_5P107 sntp/sntp-opts.texi@1.94 +1 -1 NTP_4_2_5P107 sntp/sntp.1@1.94 +2 -2 NTP_4_2_5P107 util/ntp-keygen-opts.c@1.98 +2 -2 NTP_4_2_5P107 util/ntp-keygen-opts.h@1.98 +3 -3 NTP_4_2_5P107 util/ntp-keygen-opts.texi@1.97 +2 -2 NTP_4_2_5P107 util/ntp-keygen.1@1.97 +2 -2 NTP_4_2_5P107 ChangeSet@1.1697, 2007-12-16 04:51:58-05:00, stenn@whimsy.udel.edu [Bug 979] Provide ntptimeval if it is not otherwise present ChangeLog@1.170 +1 -0 [Bug 979] Provide ntptimeval if it is not otherwise present include/ntp_syscall.h@1.8 +9 -0 [Bug 979] Provide ntptimeval if it is not otherwise present ChangeSet@1.1696, 2007-12-16 02:44:58-05:00, stenn@whimsy.udel.edu code cleanup ntpd/ntpd.c@1.93 +37 -35 code cleanup ChangeSet@1.1695, 2007-12-15 23:29:17-05:00, stenn@whimsy.udel.edu [Bug 634] Re-instantiate syslog() and logfiles after the daemon fork ChangeLog@1.169 +1 -0 [Bug 634] Re-instantiate syslog() and logfiles after the daemon fork ntpd/ntpd.c@1.92 +4 -0 [Bug 634] Re-instantiate syslog() and logfiles after the daemon fork ChangeSet@1.1694, 2007-12-15 22:41:36-05:00, stenn@whimsy.udel.edu We no longer need to check for MD5Init() configure.ac@1.412 +0 -1 We no longer need to check for MD5Init() ChangeSet@1.1693, 2007-12-15 07:33:48-05:00, stenn@whimsy.udel.edu [Bug 952] Use md5 code with a friendlier license BitKeeper/deleted/.del-md5c.c@1.9 +0 -0 Delete: libntp/md5c.c BitKeeper/deleted/.del-rsa_md5.h@1.8 +0 -0 Delete: include/rsa_md5.h include/Makefile.am@1.29 +0 -1 [Bug 952] Use md5 code with a friendlier license include/ntp_md5.h@1.2 +5 -1 [Bug 952] Use md5 code with a friendlier license ChangeSet@1.1692, 2007-12-15 06:18:07-05:00, stenn@whimsy.udel.edu [Bug 952] Use md5 code with a friendlier license ChangeLog@1.168 +1 -0 [Bug 952] Use md5 code with a friendlier license include/isc/Makefile.am@1.7 +1 -0 [Bug 952] Use md5 code with a friendlier license include/isc/md5.h@1.1 +73 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/include/isc/md5.h include/isc/md5.h@1.0 +0 -0 libisc/md5.c@1.1 +251 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libisc/md5.c libisc/md5.c@1.0 +0 -0 libntp/Makefile.am@1.40 +2 -2 [Bug 952] Use md5 code with a friendlier license ChangeSet@1.1691, 2007-12-13 06:46:42-05:00, stenn@whimsy.udel.edu NTP_4_2_5P106 TAG: NTP_4_2_5P106 ntpd/ntpd-opts.c@1.98 +2 -2 NTP_4_2_5P106 ntpd/ntpd-opts.h@1.98 +3 -3 NTP_4_2_5P106 ntpd/ntpd-opts.texi@1.97 +2 -2 NTP_4_2_5P106 ntpd/ntpd.1@1.97 +2 -2 NTP_4_2_5P106 ntpdc/ntpdc-opts.c@1.94 +2 -2 NTP_4_2_5P106 ntpdc/ntpdc-opts.h@1.94 +3 -3 NTP_4_2_5P106 ntpdc/ntpdc-opts.texi@1.93 +2 -2 NTP_4_2_5P106 ntpdc/ntpdc.1@1.93 +2 -2 NTP_4_2_5P106 ntpq/ntpq-opts.c@1.94 +2 -2 NTP_4_2_5P106 ntpq/ntpq-opts.h@1.94 +3 -3 NTP_4_2_5P106 ntpq/ntpq-opts.texi@1.93 +2 -2 NTP_4_2_5P106 ntpq/ntpq.1@1.93 +2 -2 NTP_4_2_5P106 packageinfo.sh@1.109 +1 -1 NTP_4_2_5P106 sntp/sntp-opts.c@1.94 +2 -2 NTP_4_2_5P106 sntp/sntp-opts.h@1.94 +3 -3 NTP_4_2_5P106 sntp/sntp-opts.texi@1.93 +1 -1 NTP_4_2_5P106 sntp/sntp.1@1.93 +2 -2 NTP_4_2_5P106 util/ntp-keygen-opts.c@1.97 +2 -2 NTP_4_2_5P106 util/ntp-keygen-opts.h@1.97 +3 -3 NTP_4_2_5P106 util/ntp-keygen-opts.texi@1.96 +3 -4 NTP_4_2_5P106 util/ntp-keygen.1@1.96 +2 -2 NTP_4_2_5P106 ChangeSet@1.1690, 2007-12-13 04:55:28-05:00, stenn@whimsy.udel.edu [Bug 977] Fix mismatching #ifdefs for builds without IPv6 ChangeLog@1.167 +2 -1 [Bug 977] Fix mismatching #ifdefs for builds without IPv6 libisc/net.c@1.9 +1 -1 [Bug 977] Fix mismatching #ifdefs for builds without IPv6 ChangeSet@1.1689, 2007-12-13 04:22:19-05:00, stenn@whimsy.udel.edu hack around a problem ntpd/ntp_io.c@1.270 +1 -1 hack around a problem ChangeSet@1.1685.1.1, 2007-12-13 03:47:59-05:00, stenn@whimsy.udel.edu Clean up the logfile/syslog setup ChangeLog@1.164.1.1 +1 -0 Clean up the logfile/syslog setup include/ntpd.h@1.114 +2 -0 Cleanup log setup ntpd/ntp_config.c@1.174 +159 -165 Cleanup log setup ntpd/ntpd.c@1.91 +9 -7 Cleanup log setup ChangeSet@1.1687, 2007-12-12 16:59:29-05:00, mayer@pogo.udel.edu [Bug 830] ChangeLog@1.165 +1 -0 [Bug 830] ChangeSet@1.1686, 2007-12-12 16:57:34-05:00, mayer@pogo.udel.edu [Bug #830] Fix the checking order of the interface options ntpd/ntp_io.c@1.269 +15 -39 [Bug #830] Fix the checking order of the interface options ChangeSet@1.1685, 2007-12-05 06:46:56-05:00, stenn@whimsy.udel.edu NTP_4_2_5P105 TAG: NTP_4_2_5P105 ntpd/ntpd-opts.c@1.97 +2 -2 NTP_4_2_5P105 ntpd/ntpd-opts.h@1.97 +3 -3 NTP_4_2_5P105 ntpd/ntpd-opts.texi@1.96 +1 -1 NTP_4_2_5P105 ntpd/ntpd.1@1.96 +2 -2 NTP_4_2_5P105 ntpdc/ntpdc-opts.c@1.93 +2 -2 NTP_4_2_5P105 ntpdc/ntpdc-opts.h@1.93 +3 -3 NTP_4_2_5P105 ntpdc/ntpdc-opts.texi@1.92 +1 -1 NTP_4_2_5P105 ntpdc/ntpdc.1@1.92 +2 -2 NTP_4_2_5P105 ntpq/ntpq-opts.c@1.93 +2 -2 NTP_4_2_5P105 ntpq/ntpq-opts.h@1.93 +3 -3 NTP_4_2_5P105 ntpq/ntpq-opts.texi@1.92 +1 -1 NTP_4_2_5P105 ntpq/ntpq.1@1.92 +2 -2 NTP_4_2_5P105 packageinfo.sh@1.108 +1 -1 NTP_4_2_5P105 sntp/sntp-opts.c@1.93 +2 -2 NTP_4_2_5P105 sntp/sntp-opts.h@1.93 +3 -3 NTP_4_2_5P105 sntp/sntp-opts.texi@1.92 +1 -1 NTP_4_2_5P105 sntp/sntp.1@1.92 +2 -2 NTP_4_2_5P105 util/ntp-keygen-opts.c@1.96 +2 -2 NTP_4_2_5P105 util/ntp-keygen-opts.h@1.96 +3 -3 NTP_4_2_5P105 util/ntp-keygen-opts.texi@1.95 +2 -2 NTP_4_2_5P105 util/ntp-keygen.1@1.95 +2 -2 NTP_4_2_5P105 ChangeSet@1.1684, 2007-12-05 02:21:17-05:00, stenn@whimsy.udel.edu [Bug 970] Lose obsolete -g flag to ntp-keygen ChangeLog@1.164 +1 -0 [Bug 970] Lose obsolete -g flag to ntp-keygen util/ntp-keygen-opts.c@1.95 +28 -58 [Bug 970] Lose obsolete -g flag to ntp-keygen util/ntp-keygen-opts.def@1.11 +0 -12 [Bug 970] Lose obsolete -g flag to ntp-keygen util/ntp-keygen-opts.h@1.95 +20 -29 [Bug 970] Lose obsolete -g flag to ntp-keygen util/ntp-keygen-opts.texi@1.94 +1 -18 [Bug 970] Lose obsolete -g flag to ntp-keygen util/ntp-keygen.1@1.94 +1 -8 [Bug 970] Lose obsolete -g flag to ntp-keygen util/ntp-keygen.c@1.48 +0 -4 [Bug 970] Lose obsolete -g flag to ntp-keygen ChangeSet@1.1683, 2007-12-05 01:57:39-05:00, stenn@whimsy.udel.edu The -e flag to ntp-keygen can write GQ keys now, too. ChangeLog@1.163 +1 -0 The -e flag to ntp-keygen can write GQ keys now, too. util/ntp-keygen-opts.c@1.94 +2 -2 The -e flag to ntp-keygen can write GQ keys now, too. util/ntp-keygen-opts.def@1.10 +19 -19 The -e flag to ntp-keygen can write GQ keys now, too. util/ntp-keygen-opts.h@1.94 +1 -1 The -e flag to ntp-keygen can write GQ keys now, too. util/ntp-keygen-opts.texi@1.93 +4 -4 The -e flag to ntp-keygen can write GQ keys now, too. util/ntp-keygen.1@1.93 +4 -4 The -e flag to ntp-keygen can write GQ keys now, too. ChangeSet@1.1682, 2007-12-05 01:34:40-05:00, stenn@whimsy.udel.edu Fixes from Dave Mills ChangeLog@1.162 +1 -0 sys_survivors and hpoll cleanup from Dave Mills ChangeLog@1.161 +1 -0 sys_poll cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.141 +6 -7 sys_poll cleanup from Dave Mills ntpd/ntp_proto.c@1.268 +9 -6 sys_survivors and hpoll cleanup from Dave Mills ChangeSet@1.1681, 2007-12-05 01:24:01-05:00, stenn@whimsy.udel.edu maximum-likelihood digit and DSYNC fixes from Dave Mills ChangeLog@1.160 +1 -0 maximum-likelihood digit and DSYNC fixes from Dave Mills ntpd/refclock_wwv.c@1.72 +11 -15 maximum-likelihood digit and DSYNC fixes from Dave Mills ChangeSet@1.1680, 2007-11-27 06:45:40-05:00, stenn@whimsy.udel.edu NTP_4_2_5P104 TAG: NTP_4_2_5P104 ntpd/ntpd-opts.c@1.96 +2 -2 NTP_4_2_5P104 ntpd/ntpd-opts.h@1.96 +3 -3 NTP_4_2_5P104 ntpd/ntpd-opts.texi@1.95 +1 -1 NTP_4_2_5P104 ntpd/ntpd.1@1.95 +2 -2 NTP_4_2_5P104 ntpdc/ntpdc-opts.c@1.92 +2 -2 NTP_4_2_5P104 ntpdc/ntpdc-opts.h@1.92 +3 -3 NTP_4_2_5P104 ntpdc/ntpdc-opts.texi@1.91 +1 -1 NTP_4_2_5P104 ntpdc/ntpdc.1@1.91 +2 -2 NTP_4_2_5P104 ntpq/ntpq-opts.c@1.92 +2 -2 NTP_4_2_5P104 ntpq/ntpq-opts.h@1.92 +3 -3 NTP_4_2_5P104 ntpq/ntpq-opts.texi@1.91 +1 -1 NTP_4_2_5P104 ntpq/ntpq.1@1.91 +2 -2 NTP_4_2_5P104 packageinfo.sh@1.107 +1 -1 NTP_4_2_5P104 sntp/sntp-opts.c@1.92 +2 -2 NTP_4_2_5P104 sntp/sntp-opts.h@1.92 +3 -3 NTP_4_2_5P104 sntp/sntp-opts.texi@1.91 +1 -1 NTP_4_2_5P104 sntp/sntp.1@1.91 +2 -2 NTP_4_2_5P104 util/ntp-keygen-opts.c@1.93 +2 -2 NTP_4_2_5P104 util/ntp-keygen-opts.h@1.93 +3 -3 NTP_4_2_5P104 util/ntp-keygen-opts.texi@1.92 +1 -1 NTP_4_2_5P104 util/ntp-keygen.1@1.92 +2 -2 NTP_4_2_5P104 ChangeSet@1.1679, 2007-11-26 17:04:10-05:00, stenn@whimsy.udel.edu [Bug 967] preemptable associations are lost forever on a step ChangeLog@1.159 +1 -0 [Bug 967] preemptable associations are lost forever on a step ntpd/ntp_peer.c@1.110 +0 -3 [Bug 967] preemptable associations are lost forever on a step ChangeSet@1.1678, 2007-11-25 06:45:57-05:00, stenn@whimsy.udel.edu NTP_4_2_5P103 TAG: NTP_4_2_5P103 ntpd/ntpd-opts.c@1.95 +2 -2 NTP_4_2_5P103 ntpd/ntpd-opts.h@1.95 +3 -3 NTP_4_2_5P103 ntpd/ntpd-opts.texi@1.94 +1 -1 NTP_4_2_5P103 ntpd/ntpd.1@1.94 +2 -2 NTP_4_2_5P103 ntpdc/ntpdc-opts.c@1.91 +2 -2 NTP_4_2_5P103 ntpdc/ntpdc-opts.h@1.91 +3 -3 NTP_4_2_5P103 ntpdc/ntpdc-opts.texi@1.90 +1 -1 NTP_4_2_5P103 ntpdc/ntpdc.1@1.90 +2 -2 NTP_4_2_5P103 ntpq/ntpq-opts.c@1.91 +2 -2 NTP_4_2_5P103 ntpq/ntpq-opts.h@1.91 +3 -3 NTP_4_2_5P103 ntpq/ntpq-opts.texi@1.90 +1 -1 NTP_4_2_5P103 ntpq/ntpq.1@1.90 +2 -2 NTP_4_2_5P103 packageinfo.sh@1.106 +1 -1 NTP_4_2_5P103 sntp/sntp-opts.c@1.91 +2 -2 NTP_4_2_5P103 sntp/sntp-opts.h@1.91 +3 -3 NTP_4_2_5P103 sntp/sntp-opts.texi@1.90 +1 -1 NTP_4_2_5P103 sntp/sntp.1@1.90 +2 -2 NTP_4_2_5P103 util/ntp-keygen-opts.c@1.92 +2 -2 NTP_4_2_5P103 util/ntp-keygen-opts.h@1.92 +3 -3 NTP_4_2_5P103 util/ntp-keygen-opts.texi@1.91 +1 -1 NTP_4_2_5P103 util/ntp-keygen.1@1.91 +2 -2 NTP_4_2_5P103 ChangeSet@1.1673.1.2, 2007-11-24 18:52:51-05:00, stenn@whimsy.udel.edu documentation update from Dave Mills html/assoc.html@1.25 +8 -8 documentation update from Dave Mills html/bugs.html@1.1 +30 -0 BitKeeper file /deacon/backroom/ntp-dev/html/bugs.html html/bugs.html@1.0 +0 -0 ChangeSet@1.1676, 2007-11-24 18:50:51-05:00, stenn@pogo.udel.edu [CID 48] missing "else" clause ChangeLog@1.158 +1 -0 [CID 48] missing "else" clause ChangeSet@1.1673.1.1, 2007-11-24 06:45:27-05:00, stenn@whimsy.udel.edu NTP_4_2_5P102 TAG: NTP_4_2_5P102 ntpd/ntpd-opts.c@1.94 +2 -2 NTP_4_2_5P102 ntpd/ntpd-opts.h@1.94 +3 -3 NTP_4_2_5P102 ntpd/ntpd-opts.texi@1.93 +1 -1 NTP_4_2_5P102 ntpd/ntpd.1@1.93 +2 -2 NTP_4_2_5P102 ntpdc/ntpdc-opts.c@1.90 +2 -2 NTP_4_2_5P102 ntpdc/ntpdc-opts.h@1.90 +3 -3 NTP_4_2_5P102 ntpdc/ntpdc-opts.texi@1.89 +1 -1 NTP_4_2_5P102 ntpdc/ntpdc.1@1.89 +2 -2 NTP_4_2_5P102 ntpq/ntpq-opts.c@1.90 +2 -2 NTP_4_2_5P102 ntpq/ntpq-opts.h@1.90 +3 -3 NTP_4_2_5P102 ntpq/ntpq-opts.texi@1.89 +1 -1 NTP_4_2_5P102 ntpq/ntpq.1@1.89 +2 -2 NTP_4_2_5P102 packageinfo.sh@1.105 +1 -1 NTP_4_2_5P102 sntp/sntp-opts.c@1.90 +2 -2 NTP_4_2_5P102 sntp/sntp-opts.h@1.90 +3 -3 NTP_4_2_5P102 sntp/sntp-opts.texi@1.89 +1 -1 NTP_4_2_5P102 sntp/sntp.1@1.89 +2 -2 NTP_4_2_5P102 util/ntp-keygen-opts.c@1.91 +2 -2 NTP_4_2_5P102 util/ntp-keygen-opts.h@1.91 +3 -3 NTP_4_2_5P102 util/ntp-keygen-opts.texi@1.90 +1 -1 NTP_4_2_5P102 util/ntp-keygen.1@1.90 +2 -2 NTP_4_2_5P102 ChangeSet@1.1674, 2007-11-23 20:01:46+00:00, kamboj@pogo.udel.edu ntp_config.c: Fixed a minor bug reported by coverity ntpd/ntp_config.c@1.173 +6 -3 Fixed a minor bug reported by coverity ChangeSet@1.1673, 2007-11-23 14:59:15-05:00, stenn@whimsy.udel.edu ChangeLog: [Bug 833] ntpq "config" keyword is 2ble-quote-mark-unfriendly. Rename the 'config' keyword to ':config'. ChangeLog@1.157 +2 -0 [Bug 833] ntpq "config" keyword is 2ble-quote-mark-unfriendly. Rename the 'config' keyword to ':config'. ntpq/ntpq-subs.c@1.29 +2 -2 ntpq/ntpq.c@1.73 +27 -11 ChangeSet@1.1672, 2007-11-23 06:49:02-05:00, stenn@whimsy.udel.edu NTP_4_2_5P101 TAG: NTP_4_2_5P101 ntpd/ntpd-opts.c@1.93 +2 -2 NTP_4_2_5P101 ntpd/ntpd-opts.h@1.93 +3 -3 NTP_4_2_5P101 ntpd/ntpd-opts.texi@1.92 +3 -3 NTP_4_2_5P101 ntpd/ntpd.1@1.92 +2 -2 NTP_4_2_5P101 ntpdc/ntpdc-opts.c@1.89 +2 -2 NTP_4_2_5P101 ntpdc/ntpdc-opts.h@1.89 +3 -3 NTP_4_2_5P101 ntpdc/ntpdc-opts.texi@1.88 +2 -2 NTP_4_2_5P101 ntpdc/ntpdc.1@1.88 +2 -2 NTP_4_2_5P101 ntpq/ntpq-opts.c@1.89 +2 -2 NTP_4_2_5P101 ntpq/ntpq-opts.h@1.89 +3 -3 NTP_4_2_5P101 ntpq/ntpq-opts.texi@1.88 +2 -2 NTP_4_2_5P101 ntpq/ntpq.1@1.88 +2 -2 NTP_4_2_5P101 packageinfo.sh@1.104 +1 -1 NTP_4_2_5P101 sntp/sntp-opts.c@1.89 +2 -2 NTP_4_2_5P101 sntp/sntp-opts.h@1.89 +3 -3 NTP_4_2_5P101 sntp/sntp-opts.texi@1.88 +1 -1 NTP_4_2_5P101 sntp/sntp.1@1.88 +2 -2 NTP_4_2_5P101 util/ntp-keygen-opts.c@1.90 +2 -2 NTP_4_2_5P101 util/ntp-keygen-opts.h@1.90 +3 -3 NTP_4_2_5P101 util/ntp-keygen-opts.texi@1.89 +2 -2 NTP_4_2_5P101 util/ntp-keygen.1@1.89 +2 -2 NTP_4_2_5P101 ChangeSet@1.1671, 2007-11-23 04:34:06-05:00, stenn@whimsy.udel.edu Dave Mills shifted some orphan processing ChangeLog@1.156 +1 -0 Dave Mills shifted some orphan processing include/ntpd.h@1.113 +3 -0 Dave Mills shifted some orphan processing ntpd/ntp_proto.c@1.267 +2 -17 Dave Mills shifted some orphan processing ntpd/ntp_timer.c@1.44 +18 -0 Dave Mills shifted some orphan processing ChangeSet@1.1670, 2007-11-22 21:30:50-05:00, stenn@whimsy.udel.edu Fix typos in the [Bug 963] patch ChangeLog@1.155 +1 -0 Fix typos in the [Bug 963] patch libntp/systime.c@1.46 +1 -1 Fix typos in the [Bug 963] patch ntpd/ntp_io.c@1.268 +1 -1 Fix typos in the [Bug 963] patch ChangeSet@1.1669, 2007-11-22 16:37:57-05:00, stenn@whimsy.udel.edu bootstrap: squawk if genver fails. Use -f with cp in case Dave does a chown ChangeLog@1.154 +1 -0 bootstrap: squawk if genver fails. Use -f with cp in case Dave does a chown bootstrap@1.21 +2 -2 bootstrap: squawk if genver fails. Use -f with cp in case Dave does a chown ChangeSet@1.1668, 2007-11-22 06:46:46-05:00, stenn@whimsy.udel.edu NTP_4_2_5P100 TAG: NTP_4_2_5P100 ntpd/ntpd-opts.c@1.92 +2 -2 NTP_4_2_5P100 ntpd/ntpd-opts.h@1.92 +3 -3 NTP_4_2_5P100 ntpd/ntpd-opts.texi@1.91 +1 -1 NTP_4_2_5P100 ntpd/ntpd.1@1.91 +2 -2 NTP_4_2_5P100 ntpdc/ntpdc-opts.c@1.88 +2 -2 NTP_4_2_5P100 ntpdc/ntpdc-opts.h@1.88 +3 -3 NTP_4_2_5P100 ntpdc/ntpdc-opts.texi@1.87 +1 -1 NTP_4_2_5P100 ntpdc/ntpdc.1@1.87 +2 -2 NTP_4_2_5P100 ntpq/ntpq-opts.c@1.88 +2 -2 NTP_4_2_5P100 ntpq/ntpq-opts.h@1.88 +3 -3 NTP_4_2_5P100 ntpq/ntpq-opts.texi@1.87 +1 -1 NTP_4_2_5P100 ntpq/ntpq.1@1.87 +2 -2 NTP_4_2_5P100 packageinfo.sh@1.103 +1 -1 NTP_4_2_5P100 sntp/sntp-opts.c@1.88 +2 -2 NTP_4_2_5P100 sntp/sntp-opts.h@1.88 +3 -3 NTP_4_2_5P100 sntp/sntp-opts.texi@1.87 +1 -1 NTP_4_2_5P100 sntp/sntp.1@1.87 +2 -2 NTP_4_2_5P100 util/ntp-keygen-opts.c@1.89 +2 -2 NTP_4_2_5P100 util/ntp-keygen-opts.h@1.89 +3 -3 NTP_4_2_5P100 util/ntp-keygen-opts.texi@1.88 +1 -1 NTP_4_2_5P100 util/ntp-keygen.1@1.88 +2 -2 NTP_4_2_5P100 ChangeSet@1.1667, 2007-11-22 04:19:55-05:00, stenn@whimsy.udel.edu Remove obsolete simulator command-line options ChangeLog@1.153 +1 -0 Remove obsolete simulator command-line options ntpd/ntpd-opts.c@1.91 +50 -329 Remove obsolete simulator command-line options ntpd/ntpd-opts.h@1.91 +31 -112 Remove obsolete simulator command-line options ntpd/ntpd-opts.texi@1.90 +1 -136 Remove obsolete simulator command-line options ntpd/ntpd.1@1.90 +2 -47 Remove obsolete simulator command-line options ntpd/ntpdbase-opts.def@1.15 +0 -90 Remove obsolete simulator command-line options ChangeSet@1.1666, 2007-11-22 03:59:23-05:00, stenn@whimsy.udel.edu [CID 36] zero sin_zero ChangeLog@1.152 +1 -0 [CID 36] zero sin_zero ntpd/ntp_request.c@1.71 +1 -0 [CID 36] zero sin_zero ChangeSet@1.1665, 2007-11-22 02:34:27-05:00, stenn@whimsy.udel.edu [Bug 963] get_systime() is too noisy ChangeLog@1.151 +1 -0 [Bug 963] get_systime() is too noisy libntp/systime.c@1.45 +26 -12 [Bug 963] get_systime() is too noisy ntpd/ntp_io.c@1.267 +2 -1 [Bug 963] get_systime() is too noisy ChangeSet@1.1662.1.3, 2007-11-21 06:49:11-05:00, stenn@whimsy.udel.edu NTP_4_2_5P99 TAG: NTP_4_2_5P99 ntpd/ntpd-opts.c@1.90 +2 -2 NTP_4_2_5P99 ntpd/ntpd-opts.h@1.90 +3 -3 NTP_4_2_5P99 ntpd/ntpd-opts.texi@1.89 +2 -2 NTP_4_2_5P99 ntpd/ntpd.1@1.89 +2 -2 NTP_4_2_5P99 ntpdc/ntpdc-opts.c@1.87 +2 -2 NTP_4_2_5P99 ntpdc/ntpdc-opts.h@1.87 +3 -3 NTP_4_2_5P99 ntpdc/ntpdc-opts.texi@1.86 +2 -2 NTP_4_2_5P99 ntpdc/ntpdc.1@1.86 +2 -2 NTP_4_2_5P99 ntpq/ntpq-opts.c@1.87 +2 -2 NTP_4_2_5P99 ntpq/ntpq-opts.h@1.87 +3 -3 NTP_4_2_5P99 ntpq/ntpq-opts.texi@1.86 +2 -2 NTP_4_2_5P99 ntpq/ntpq.1@1.86 +2 -2 NTP_4_2_5P99 packageinfo.sh@1.102 +1 -1 NTP_4_2_5P99 sntp/sntp-opts.c@1.87 +2 -2 NTP_4_2_5P99 sntp/sntp-opts.h@1.87 +3 -3 NTP_4_2_5P99 sntp/sntp-opts.texi@1.86 +1 -1 NTP_4_2_5P99 sntp/sntp.1@1.86 +2 -2 NTP_4_2_5P99 util/ntp-keygen-opts.c@1.88 +2 -2 NTP_4_2_5P99 util/ntp-keygen-opts.h@1.88 +3 -3 NTP_4_2_5P99 util/ntp-keygen-opts.texi@1.87 +2 -2 NTP_4_2_5P99 util/ntp-keygen.1@1.87 +2 -2 NTP_4_2_5P99 ChangeSet@1.1662.1.2, 2007-11-21 01:26:56-05:00, stenn@deacon.udel.edu [Bug 964] Change *-*-linux* to *-*-*linux* to allow for uclinux ChangeLog@1.148.1.2 +1 -0 [Bug 964] Change *-*-linux* to *-*-*linux* to allow for uclinux configure.ac@1.411 +16 -16 [Bug 964] Change *-*-linux* to *-*-*linux* to allow for uclinux ChangeSet@1.1662.1.1, 2007-11-21 01:12:13-05:00, stenn@deacon.udel.edu ntp_timer.c: ntp_timer.c: watch the non-burst packet rate ntp_monitor.c: ntp_monitor.c: RES_LIMITED cleanup from Dave Mills ntp_config.c: config: average and minimum are ^2 values ntp_peer.c: ntp_peer.c: disallow peer_unconfig() ntpdc_ops.c: Dave Mills: unknownversion is really "declined", not "bad version" ntp_restrict.c: ntp_restrict.c: RES_LIMITED cleanup from Dave Mills ChangeLog: Changes from Dave Mills ntp_crypto.c: ntp_crypto.c: volley -> retry. Cleanup TAI leap message. ntp_request.c: Cleanup from Dave Mills ntp_loopfilter.c: ntp_loopfilter.c: poll interval cleanup from Dave Mills ntp_proto.c: ntp_proto.c: RES_LIMITED, rate bucktes, counters, overall cleanup from Dave Mills ntpd.h, ntp.h: general and packet retry cleanup from Dave Mills ntp_util.c: cleanup ChangeLog@1.148.1.1 +13 -0 Changes from Dave Mills include/ntp.h@1.141 +15 -14 general and packet retry cleanup from Dave Mills include/ntpd.h@1.112 +9 -9 general and packet retry cleanup from Dave Mills ntpd/ntp_config.c@1.170.1.1 +2 -2 config: average and minimum are ^2 values ntpd/ntp_crypto.c@1.120 +9 -6 ntp_crypto.c: volley -> retry. Cleanup TAI leap message. ntpd/ntp_loopfilter.c@1.140 +18 -7 ntp_loopfilter.c: poll interval cleanup from Dave Mills ntpd/ntp_monitor.c@1.20 +66 -31 ntp_monitor.c: RES_LIMITED cleanup from Dave Mills ntpd/ntp_peer.c@1.109 +20 -48 ntp_peer.c: disallow peer_unconfig() ntpd/ntp_proto.c@1.266 +317 -251 ntp_proto.c: RES_LIMITED, rate bucktes, counters, overall cleanup from Dave Mills ntpd/ntp_request.c@1.70 +9 -7 Cleanup from Dave Mills ntpd/ntp_restrict.c@1.26 +33 -60 ntp_restrict.c: RES_LIMITED cleanup from Dave Mills ntpd/ntp_timer.c@1.43 +13 -2 ntp_timer.c: watch the non-burst packet rate ntpd/ntp_util.c@1.61 +5 -5 cleanup ntpdc/ntpdc_ops.c@1.53 +1 -1 Dave Mills: unknownversion is really "declined", not "bad version" ChangeSet@1.1663, 2007-11-20 21:36:27-05:00, neal@pogo.udel.edu ChangeLog: [Bug 960] spurious crypto command ntp_config.c: [Bug 960] spurious crypto command ChangeLog@1.149 +1 -0 [Bug 960] spurious crypto command message ntpd/ntp_config.c@1.171 +3 -1 [Bug 960] spurious crypto command ChangeSet@1.1662, 2007-11-14 06:45:25-05:00, stenn@whimsy.udel.edu NTP_4_2_5P98 TAG: NTP_4_2_5P98 ntpd/ntpd-opts.c@1.89 +2 -2 NTP_4_2_5P98 ntpd/ntpd-opts.h@1.89 +3 -3 NTP_4_2_5P98 ntpd/ntpd-opts.texi@1.88 +2 -2 NTP_4_2_5P98 ntpd/ntpd.1@1.88 +2 -2 NTP_4_2_5P98 ntpdc/ntpdc-opts.c@1.86 +2 -2 NTP_4_2_5P98 ntpdc/ntpdc-opts.h@1.86 +3 -3 NTP_4_2_5P98 ntpdc/ntpdc-opts.texi@1.85 +2 -2 NTP_4_2_5P98 ntpdc/ntpdc.1@1.85 +2 -2 NTP_4_2_5P98 ntpq/ntpq-opts.c@1.86 +2 -2 NTP_4_2_5P98 ntpq/ntpq-opts.h@1.86 +3 -3 NTP_4_2_5P98 ntpq/ntpq-opts.texi@1.85 +2 -2 NTP_4_2_5P98 ntpq/ntpq.1@1.85 +2 -2 NTP_4_2_5P98 packageinfo.sh@1.101 +1 -1 NTP_4_2_5P98 sntp/sntp-opts.c@1.86 +2 -2 NTP_4_2_5P98 sntp/sntp-opts.h@1.86 +3 -3 NTP_4_2_5P98 sntp/sntp-opts.texi@1.85 +1 -1 NTP_4_2_5P98 sntp/sntp.1@1.85 +2 -2 NTP_4_2_5P98 util/ntp-keygen-opts.c@1.87 +2 -2 NTP_4_2_5P98 util/ntp-keygen-opts.h@1.87 +3 -3 NTP_4_2_5P98 util/ntp-keygen-opts.texi@1.86 +2 -2 NTP_4_2_5P98 util/ntp-keygen.1@1.86 +2 -2 NTP_4_2_5P98 ChangeSet@1.1661, 2007-11-13 16:57:44-05:00, stenn@whimsy.udel.edu [Bug 961] refclock_tpro.c:tpro_poll() calls refclock_receive() twice ChangeLog@1.148 +1 -0 [Bug 961] refclock_tpro.c:tpro_poll() calls refclock_receive() twice ntpd/refclock_tpro.c@1.10 +0 -1 [Bug 961] refclock_tpro.c:tpro_poll() calls refclock_receive() twice ChangeSet@1.1660, 2007-11-12 06:46:23-05:00, stenn@whimsy.udel.edu NTP_4_2_5P97 TAG: NTP_4_2_5P97 ntpd/ntpd-opts.c@1.88 +2 -2 NTP_4_2_5P97 ntpd/ntpd-opts.h@1.88 +3 -3 NTP_4_2_5P97 ntpd/ntpd-opts.texi@1.87 +2 -2 NTP_4_2_5P97 ntpd/ntpd.1@1.87 +2 -2 NTP_4_2_5P97 ntpdc/ntpdc-opts.c@1.85 +2 -2 NTP_4_2_5P97 ntpdc/ntpdc-opts.h@1.85 +3 -3 NTP_4_2_5P97 ntpdc/ntpdc-opts.texi@1.84 +2 -2 NTP_4_2_5P97 ntpdc/ntpdc.1@1.84 +2 -2 NTP_4_2_5P97 ntpq/ntpq-opts.c@1.85 +2 -2 NTP_4_2_5P97 ntpq/ntpq-opts.h@1.85 +3 -3 NTP_4_2_5P97 ntpq/ntpq-opts.texi@1.84 +2 -2 NTP_4_2_5P97 ntpq/ntpq.1@1.84 +2 -2 NTP_4_2_5P97 packageinfo.sh@1.100 +1 -1 NTP_4_2_5P97 sntp/sntp-opts.c@1.85 +2 -2 NTP_4_2_5P97 sntp/sntp-opts.h@1.85 +3 -3 NTP_4_2_5P97 sntp/sntp-opts.texi@1.84 +1 -1 NTP_4_2_5P97 sntp/sntp.1@1.84 +2 -2 NTP_4_2_5P97 util/ntp-keygen-opts.c@1.86 +2 -2 NTP_4_2_5P97 util/ntp-keygen-opts.h@1.86 +3 -3 NTP_4_2_5P97 util/ntp-keygen-opts.texi@1.85 +2 -2 NTP_4_2_5P97 util/ntp-keygen.1@1.85 +2 -2 NTP_4_2_5P97 ChangeSet@1.1657.1.2, 2007-11-09 06:48:04-05:00, stenn@whimsy.udel.edu NTP_4_2_5P96 TAG: NTP_4_2_5P96 ntpd/ntpd-opts.c@1.87 +2 -2 NTP_4_2_5P96 ntpd/ntpd-opts.h@1.87 +3 -3 NTP_4_2_5P96 ntpd/ntpd-opts.texi@1.86 +5 -5 NTP_4_2_5P96 ntpd/ntpd.1@1.86 +2 -2 NTP_4_2_5P96 ntpdc/ntpdc-opts.c@1.84 +2 -2 NTP_4_2_5P96 ntpdc/ntpdc-opts.h@1.84 +3 -3 NTP_4_2_5P96 ntpdc/ntpdc-opts.texi@1.83 +3 -3 NTP_4_2_5P96 ntpdc/ntpdc.1@1.83 +2 -2 NTP_4_2_5P96 ntpq/ntpq-opts.c@1.84 +2 -2 NTP_4_2_5P96 ntpq/ntpq-opts.h@1.84 +3 -3 NTP_4_2_5P96 ntpq/ntpq-opts.texi@1.83 +3 -3 NTP_4_2_5P96 ntpq/ntpq.1@1.83 +2 -2 NTP_4_2_5P96 packageinfo.sh@1.99 +1 -1 NTP_4_2_5P96 sntp/sntp-opts.c@1.84 +2 -2 NTP_4_2_5P96 sntp/sntp-opts.h@1.84 +3 -3 NTP_4_2_5P96 sntp/sntp-opts.texi@1.83 +1 -1 NTP_4_2_5P96 sntp/sntp.1@1.83 +2 -2 NTP_4_2_5P96 util/ntp-keygen-opts.c@1.85 +2 -2 NTP_4_2_5P96 util/ntp-keygen-opts.h@1.85 +3 -3 NTP_4_2_5P96 util/ntp-keygen-opts.texi@1.84 +3 -3 NTP_4_2_5P96 util/ntp-keygen.1@1.84 +2 -2 NTP_4_2_5P96 ChangeSet@1.1657.1.1, 2007-11-09 02:10:13-05:00, stenn@whimsy.udel.edu Work around a VPATH difference in FreeBSD's 'make' command ChangeLog@1.145.1.1 +1 -0 Work around a VPATH difference in FreeBSD's 'make' command configure.ac@1.410 +1 -0 Work around a VPATH difference in FreeBSD's 'make' command m4/ntp_vpathhack.m4@1.1 +23 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/m4/ntp_vpathhack.m4 m4/ntp_vpathhack.m4@1.0 +0 -0 ntpd/Makefile.am@1.64 +11 -1 Work around a VPATH difference in FreeBSD's 'make' command ChangeSet@1.1658, 2007-11-08 12:08:38-05:00, burnicki@pogo.udel.edu [Bug 713] Windows only: Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. * Added HAVE_INT32_T to the Windows config.h to avoid duplicate definitions. ChangeLog@1.146 +3 -0 Updated for bug #957. ports/winnt/include/config.h@1.53 +1 -0 Added HAVE_INT32_T to the Windows config.h to avoid duplicate definitions. ports/winnt/ntpd/ntservice.c@1.11 +11 -2 [Bug 957] Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. ChangeSet@1.1657, 2007-11-06 06:46:44-05:00, stenn@whimsy.udel.edu NTP_4_2_5P95 TAG: NTP_4_2_5P95 ntpd/ntpd-opts.c@1.86 +2 -2 NTP_4_2_5P95 ntpd/ntpd-opts.h@1.86 +3 -3 NTP_4_2_5P95 ntpd/ntpd-opts.texi@1.85 +1 -1 NTP_4_2_5P95 ntpd/ntpd.1@1.85 +2 -2 NTP_4_2_5P95 ntpdc/ntpdc-opts.c@1.83 +2 -2 NTP_4_2_5P95 ntpdc/ntpdc-opts.h@1.83 +3 -3 NTP_4_2_5P95 ntpdc/ntpdc-opts.texi@1.82 +2 -2 NTP_4_2_5P95 ntpdc/ntpdc.1@1.82 +2 -2 NTP_4_2_5P95 ntpq/ntpq-opts.c@1.83 +2 -2 NTP_4_2_5P95 ntpq/ntpq-opts.h@1.83 +3 -3 NTP_4_2_5P95 ntpq/ntpq-opts.texi@1.82 +2 -2 NTP_4_2_5P95 ntpq/ntpq.1@1.82 +2 -2 NTP_4_2_5P95 packageinfo.sh@1.98 +1 -1 NTP_4_2_5P95 sntp/sntp-opts.c@1.83 +2 -2 NTP_4_2_5P95 sntp/sntp-opts.h@1.83 +3 -3 NTP_4_2_5P95 sntp/sntp-opts.texi@1.82 +1 -1 NTP_4_2_5P95 sntp/sntp.1@1.82 +2 -2 NTP_4_2_5P95 util/ntp-keygen-opts.c@1.84 +2 -2 NTP_4_2_5P95 util/ntp-keygen-opts.h@1.84 +3 -3 NTP_4_2_5P95 util/ntp-keygen-opts.texi@1.83 +2 -2 NTP_4_2_5P95 util/ntp-keygen.1@1.83 +2 -2 NTP_4_2_5P95 ChangeSet@1.1656, 2007-11-06 01:50:44-05:00, stenn@whimsy.udel.edu Update bugreport URL ChangeLog@1.145 +1 -0 Update bugreport URL README@1.23 +1 -1 Update bugreport URL README.bk@1.19 +1 -1 Update bugreport URL README.patches@1.4 +1 -1 Update bugreport URL WHERE-TO-START@1.7 +1 -1 Update bugreport URL include/copyright.def@1.7 +1 -1 Update bugreport URL ntpd/ntpd-opts.c@1.85 +2 -2 Update bugreport URL ntpd/ntpd-opts.h@1.85 +1 -1 Update bugreport URL ntpd/ntpd-opts.texi@1.84 +1 -1 Update bugreport URL ntpd/ntpd.1@1.84 +2 -2 Update bugreport URL ntpdc/ntpdc-opts.c@1.82 +2 -2 Update bugreport URL ntpdc/ntpdc-opts.h@1.82 +1 -1 Update bugreport URL ntpdc/ntpdc-opts.texi@1.81 +2 -2 Update bugreport URL ntpdc/ntpdc.1@1.81 +3 -3 Update bugreport URL ntpq/ntpq-opts.c@1.82 +2 -2 Update bugreport URL ntpq/ntpq-opts.h@1.82 +1 -1 Update bugreport URL ntpq/ntpq-opts.texi@1.81 +2 -2 Update bugreport URL ntpq/ntpq.1@1.81 +3 -3 Update bugreport URL sntp/sntp-opts.c@1.82 +2 -2 Update bugreport URL sntp/sntp-opts.def@1.11 +1 -1 Update bugreport URL sntp/sntp-opts.h@1.82 +1 -1 Update bugreport URL sntp/sntp-opts.texi@1.81 +1 -1 Update bugreport URL sntp/sntp.1@1.81 +3 -3 Update bugreport URL util/ntp-keygen-opts.c@1.83 +2 -2 Update bugreport URL util/ntp-keygen-opts.h@1.83 +1 -1 Update bugreport URL util/ntp-keygen-opts.texi@1.82 +2 -2 Update bugreport URL util/ntp-keygen.1@1.82 +3 -3 Update bugreport URL ChangeSet@1.1655, 2007-11-06 00:45:47-05:00, stenn@whimsy.udel.edu Update -I documentation ChangeLog@1.144 +1 -0 Update -I documentation ntpd/ntpd-opts.c@1.84 +330 -51 Update -I documentation ntpd/ntpd-opts.h@1.84 +112 -31 Update -I documentation ntpd/ntpd-opts.texi@1.83 +137 -2 Update -I documentation ntpd/ntpd.1@1.83 +48 -3 Update -I documentation ntpd/ntpdbase-opts.def@1.14 +10 -19 Update -I documentation ChangeSet@1.1654, 2007-11-05 21:27:36-05:00, stenn@whimsy.udel.edu [Bug 713] Fix bug reporting information ChangeLog@1.143 +1 -0 [Bug 713] Fix bug reporting information html/index.html@1.35 +2 -2 [Bug 713] Fix bug reporting information html/msyslog.html@1.6 +3 -3 [Bug 713] Fix bug reporting information html/release.html@1.33 +3 -3 [Bug 713] Fix bug reporting information ChangeSet@1.1649.1.2, 2007-11-05 06:45:45-05:00, stenn@whimsy.udel.edu NTP_4_2_5P94 TAG: NTP_4_2_5P94 ntpd/ntpd-opts.c@1.83 +2 -2 NTP_4_2_5P94 ntpd/ntpd-opts.h@1.83 +3 -3 NTP_4_2_5P94 ntpd/ntpd-opts.texi@1.82 +2 -2 NTP_4_2_5P94 ntpd/ntpd.1@1.82 +2 -2 NTP_4_2_5P94 ntpdc/ntpdc-opts.c@1.81 +2 -2 NTP_4_2_5P94 ntpdc/ntpdc-opts.h@1.81 +3 -3 NTP_4_2_5P94 ntpdc/ntpdc-opts.texi@1.80 +2 -2 NTP_4_2_5P94 ntpdc/ntpdc.1@1.80 +2 -2 NTP_4_2_5P94 ntpq/ntpq-opts.c@1.81 +2 -2 NTP_4_2_5P94 ntpq/ntpq-opts.h@1.81 +3 -3 NTP_4_2_5P94 ntpq/ntpq-opts.texi@1.80 +2 -2 NTP_4_2_5P94 ntpq/ntpq.1@1.80 +2 -2 NTP_4_2_5P94 packageinfo.sh@1.97 +1 -1 NTP_4_2_5P94 sntp/sntp-opts.c@1.81 +2 -2 NTP_4_2_5P94 sntp/sntp-opts.h@1.81 +3 -3 NTP_4_2_5P94 sntp/sntp-opts.texi@1.80 +1 -1 NTP_4_2_5P94 sntp/sntp.1@1.80 +2 -2 NTP_4_2_5P94 util/ntp-keygen-opts.c@1.82 +2 -2 NTP_4_2_5P94 util/ntp-keygen-opts.h@1.82 +3 -3 NTP_4_2_5P94 util/ntp-keygen-opts.texi@1.81 +2 -2 NTP_4_2_5P94 util/ntp-keygen.1@1.81 +2 -2 NTP_4_2_5P94 ChangeSet@1.1649.1.1, 2007-11-05 03:12:05-05:00, stenn@whimsy.udel.edu ntp_config.c: reindent ntp-keygen.c: Coverity fixes [CID 33,47] ntp_util.c, ntp_crypto.c, ntp_timer.c: [Bug 861] Leap second cleanups from Dave Mills systime.c: Fuzz cleanup from Dave Mills. ntp.h: Volley cleanup from Dave Mills. ntp_io.c: Fuzz cleanup from Dave Mills ntp_proto.c: [Bug 861] Leap second cleanups from Dave Mills. Volley cleanup from Dave Mills. ntpd.h: Leap second file cleanups from Dave Mills ChangeLog@1.140.1.1 +4 -0 include/ntp.h@1.140 +0 -1 Volley cleanup from Dave Mills. include/ntpd.h@1.111 +0 -1 Leap second file cleanups from Dave Mills libntp/systime.c@1.44 +2 -4 Fuzz cleanup from Dave Mills. ntpd/ntp_config.c@1.170 +6 -6 reindent ntpd/ntp_crypto.c@1.119 +7 -4 [Bug 861] Leap second cleanups from Dave Mills ntpd/ntp_io.c@1.266 +2 -8 Fuzz cleanup from Dave Mills ntpd/ntp_proto.c@1.265 +64 -115 [Bug 861] Leap second cleanups from Dave Mills. Volley cleanup from Dave Mills. ntpd/ntp_timer.c@1.42 +17 -7 [Bug 861] Leap second cleanups from Dave Mills ntpd/ntp_util.c@1.60 +3 -3 [Bug 861] Leap second cleanups from Dave Mills util/ntp-keygen.c@1.47 +9 -10 Coverity fixes [CID 33,47] ChangeSet@1.1436.1.87, 2007-11-01 03:52:00-04:00, clemens@pogo.udel.edu * Negative-sawtooth not applied correctly for oncore 12 channel receiver. Fixed. * Startup code for original LinuxPPS removed. LinuxPPS now conforms to the PPSAPI. ChangeLog@1.1.1.35 +4 -0 * Negative-sawtooth not applied correctly for oncore 12 channel receiver. Fixed. * Startup code for original LinuxPPS removed. LinuxPPS now conforms to the PPSAPI. ChangeSet@1.1652, 2007-11-01 03:49:06-04:00, clemens@pogo.udel.edu * A bug in the application of the negative-sawtoot for 12 channel receivers. * The removal of unneeded startup code used for the original LinuxPPS, it now conforms to the PPSAPI and does not need special code. ChangeLog@1.141 +3 -0 * A bug in the application of the negative-sawtoot for 12 channel receivers. * The removal of unneeded startup code used for the original LinuxPPS, it now conforms to the PPSAPI and does not need special code. ChangeSet@1.1436.1.86, 2007-11-01 03:29:24-04:00, clemens@pogo.udel.edu The original version of LinuxPPS did not comply with the PPSAPI and required some changes to the startup code in refclock_oncore.c . The current version complies, and these changes can be removed. ntpd/refclock_oncore.c@1.60.1.2 +1 -56 The original version of LinuxPPS did not comply with the PPSAPI and required some changes to the startup code in refclock_oncore.c . The current version complies, and these changes can be removed. ChangeSet@1.1651, 2007-11-01 03:24:16-04:00, clemens@pogo.udel.edu The original version of LinuxPPS did not comply with the PPSAPI and required some changes to the startup code in refclock_oncore.c . The current version complies, and these changes can be removed. ntpd/refclock_oncore.c@1.63 +1 -56 The original version of LinuxPPS did not comply with the PPSAPI and required some changes to the startup code in refclock_oncore.c . The current version complies, and these changes can be removed. ChangeSet@1.1436.1.85, 2007-11-01 02:16:36-04:00, clemens@pogo.udel.edu The oncore hardware provides a 'negative saw-tooth' the offset of the PPS signal which is on the zero crossing of its internal clock, from its true value. the refclock_oncore.c driver applies this difference to correct the time of the provided timestamp. This value was being applied correctly for the 6 and 8 channel receivers, but not for the 12 channel. This has been corrected. ntpd/refclock_oncore.c@1.60.1.1 +2 -2 The oncore hardware provides a 'negative saw-tooth' the offset of the PPS signal which is on the zero crossing of its internal clock, from its true value. the refclock_oncore.c driver applies this difference to correct the time of the provided timestamp. This value was being applied correctly for the 6 and 8 channel receivers, but not for the 12 channel. This has been corrected. ChangeSet@1.1650, 2007-11-01 02:13:19-04:00, clemens@pogo.udel.edu ntpd/refclock_oncore.c The oncore hardware provides a 'negative saw-tooth' the offset of the PPS signal which is on the zero crossing of its internal clock, from its true value. the refclock_oncore.c driver applies this difference to correct the time of the provided timestamp. This value was being applied correctly for the 6 and 8 channel receivers, but not for the 12 channel. This has been corrected. ntpd/refclock_oncore.c@1.62 +2 -2 The oncore hardware provides a 'negative saw-tooth' the offset of the PPS signal which is on the zero crossing of its internal clock, from its true value. the refclock_oncore.c driver applies this difference to correct the time of the provided timestamp. This value was being applied correctly for the 6 and 8 channel receivers, but not for the 12 channel. This has been corrected. ChangeSet@1.1649, 2007-10-31 06:46:05-05:00, stenn@whimsy.udel.edu NTP_4_2_5P93 TAG: NTP_4_2_5P93 ntpd/ntpd-opts.c@1.82 +2 -2 NTP_4_2_5P93 ntpd/ntpd-opts.h@1.82 +3 -3 NTP_4_2_5P93 ntpd/ntpd-opts.texi@1.81 +1 -1 NTP_4_2_5P93 ntpd/ntpd.1@1.81 +2 -2 NTP_4_2_5P93 ntpdc/ntpdc-opts.c@1.80 +2 -2 NTP_4_2_5P93 ntpdc/ntpdc-opts.h@1.80 +3 -3 NTP_4_2_5P93 ntpdc/ntpdc-opts.texi@1.79 +1 -1 NTP_4_2_5P93 ntpdc/ntpdc.1@1.79 +2 -2 NTP_4_2_5P93 ntpq/ntpq-opts.c@1.80 +2 -2 NTP_4_2_5P93 ntpq/ntpq-opts.h@1.80 +3 -3 NTP_4_2_5P93 ntpq/ntpq-opts.texi@1.79 +1 -1 NTP_4_2_5P93 ntpq/ntpq.1@1.79 +2 -2 NTP_4_2_5P93 packageinfo.sh@1.96 +1 -1 NTP_4_2_5P93 sntp/sntp-opts.c@1.80 +2 -2 NTP_4_2_5P93 sntp/sntp-opts.h@1.80 +3 -3 NTP_4_2_5P93 sntp/sntp-opts.texi@1.79 +1 -1 NTP_4_2_5P93 sntp/sntp.1@1.79 +2 -2 NTP_4_2_5P93 util/ntp-keygen-opts.c@1.81 +2 -2 NTP_4_2_5P93 util/ntp-keygen-opts.h@1.81 +3 -3 NTP_4_2_5P93 util/ntp-keygen-opts.texi@1.80 +1 -1 NTP_4_2_5P93 util/ntp-keygen.1@1.80 +2 -2 NTP_4_2_5P93 ChangeSet@1.1648, 2007-10-31 01:26:20-05:00, stenn@whimsy.udel.edu Document the reasoning behind the c_d directory variable flock-build@1.41 +2 -0 Document the reasoning behind the c_d directory variable ChangeSet@1.1647, 2007-10-30 06:46:30-05:00, stenn@whimsy.udel.edu NTP_4_2_5P92 TAG: NTP_4_2_5P92 ntpd/ntpd-opts.c@1.81 +2 -2 NTP_4_2_5P92 ntpd/ntpd-opts.h@1.81 +3 -3 NTP_4_2_5P92 ntpd/ntpd-opts.texi@1.80 +3 -3 NTP_4_2_5P92 ntpd/ntpd.1@1.80 +2 -2 NTP_4_2_5P92 ntpdc/ntpdc-opts.c@1.79 +2 -2 NTP_4_2_5P92 ntpdc/ntpdc-opts.h@1.79 +3 -3 NTP_4_2_5P92 ntpdc/ntpdc-opts.texi@1.78 +3 -3 NTP_4_2_5P92 ntpdc/ntpdc.1@1.78 +2 -2 NTP_4_2_5P92 ntpq/ntpq-opts.c@1.79 +2 -2 NTP_4_2_5P92 ntpq/ntpq-opts.h@1.79 +3 -3 NTP_4_2_5P92 ntpq/ntpq-opts.texi@1.78 +3 -3 NTP_4_2_5P92 ntpq/ntpq.1@1.78 +2 -2 NTP_4_2_5P92 packageinfo.sh@1.95 +1 -1 NTP_4_2_5P92 sntp/sntp-opts.c@1.79 +2 -2 NTP_4_2_5P92 sntp/sntp-opts.h@1.79 +3 -3 NTP_4_2_5P92 sntp/sntp-opts.texi@1.78 +1 -1 NTP_4_2_5P92 sntp/sntp.1@1.78 +2 -2 NTP_4_2_5P92 util/ntp-keygen-opts.c@1.80 +2 -2 NTP_4_2_5P92 util/ntp-keygen-opts.h@1.80 +3 -3 NTP_4_2_5P92 util/ntp-keygen-opts.texi@1.79 +3 -3 NTP_4_2_5P92 util/ntp-keygen.1@1.79 +2 -2 NTP_4_2_5P92 ChangeSet@1.1646, 2007-10-30 02:27:06-05:00, stenn@whimsy.udel.edu ntpsim.c: add missing protypes and fix [CID 34], a nit ChangeLog@1.140 +1 -0 ntpsim.c: add missing protypes and fix [CID 34], a nit ntpd/ntpsim.c@1.19 +7 -0 ntpsim.c: add missing protypes and fix [CID 34], a nit ChangeSet@1.1645, 2007-10-30 01:31:05-05:00, stenn@whimsy.udel.edu ntp_scanner.c: reindent ntpd/ntp_scanner.c@1.12 +377 -360 reindent ChangeSet@1.1644, 2007-10-30 01:09:30-05:00, stenn@whimsy.udel.edu ntp_parser.h, ntp_parser.c, ChangeLog: Upgraded bison at UDel br-flock, ChangeLog, flock-build: Update br-flock and flock-build machine lists ChangeLog@1.139 +1 -0 Upgraded bison at UDel ChangeLog@1.138 +1 -0 Update br-flock and flock-build machine lists br-flock@1.12 +1 -1 Update br-flock and flock-build machine lists flock-build@1.40 +6 -5 Update br-flock and flock-build machine lists ntpd/ntp_parser.c@1.24 +1072 -684 Upgraded bison at UDel ntpd/ntp_parser.h@1.10 +29 -20 Upgraded bison at UDel ChangeSet@1.1643, 2007-10-29 17:17:35-04:00, neal@pogo.udel.edu ntp_scanner.c: [Bug 828] use is_ip_address from ntp_io.c in scanner ntpd/ntp_scanner.c@1.11 +5 -43 [Bug 828] use is_ip_address from ntp_io.c in scanner ChangeSet@1.1642, 2007-10-29 10:28:31-04:00, neal@pogo.udel.edu ntp_scanner.c: [Bug 828] correct IPv6 address parsing ntpd/ntp_scanner.c@1.10 +2 -42 [Bug 828] correct IPv6 address parsing ChangeSet@1.1641, 2007-10-28 20:40:12-04:00, neal@pogo.udel.edu copyright.html: add self to copyright notice html/copyright.html@1.37 +1 -0 add self to copyright notice ChangeSet@1.1638.1.1, 2007-10-27 12:27:18-04:00, neal@pogo.udel.edu ntp_io.c: [Bug 752] QoS: add parser/config support. Many files: [Bug 752] QoS: add parser/config support. ChangeLog@1.137 +1 -0 [Bug 752] QoS: add parser/config support. include/ntp_config.h@1.46 +24 -0 [Bug 752] QoS: add parser/config support. ntpd/ntp_config.c@1.169 +67 -1 [Bug 752] QoS: add parser/config support. ntpd/ntp_io.c@1.265 +5 -5 [Bug 752] QoS: add parser/config support. , ntpd/ntp_parser.c@1.23 +2031 -1577 [Bug 752] QoS: add parser/config support. ntpd/ntp_parser.h@1.9 +341 -152 [Bug 752] QoS: add parser/config support. ntpd/ntp_parser.y@1.19 +3 -0 [Bug 752] QoS: add parser/config support. ChangeSet@1.1639, 2007-10-27 07:44:18-04:00, stenn@whimsy.udel.edu NTP_4_2_5P91 TAG: NTP_4_2_5P91 ntpd/ntpd-opts.c@1.80 +2 -2 NTP_4_2_5P91 ntpd/ntpd-opts.h@1.80 +3 -3 NTP_4_2_5P91 ntpd/ntpd-opts.texi@1.79 +1 -1 NTP_4_2_5P91 ntpd/ntpd.1@1.79 +2 -2 NTP_4_2_5P91 ntpdc/ntpdc-opts.c@1.78 +2 -2 NTP_4_2_5P91 ntpdc/ntpdc-opts.h@1.78 +3 -3 NTP_4_2_5P91 ntpdc/ntpdc-opts.texi@1.77 +1 -1 NTP_4_2_5P91 ntpdc/ntpdc.1@1.77 +2 -2 NTP_4_2_5P91 ntpq/ntpq-opts.c@1.78 +2 -2 NTP_4_2_5P91 ntpq/ntpq-opts.h@1.78 +3 -3 NTP_4_2_5P91 ntpq/ntpq-opts.texi@1.77 +1 -1 NTP_4_2_5P91 ntpq/ntpq.1@1.77 +2 -2 NTP_4_2_5P91 packageinfo.sh@1.94 +1 -1 NTP_4_2_5P91 sntp/sntp-opts.c@1.78 +2 -2 NTP_4_2_5P91 sntp/sntp-opts.h@1.78 +3 -3 NTP_4_2_5P91 sntp/sntp-opts.texi@1.77 +1 -1 NTP_4_2_5P91 sntp/sntp.1@1.77 +2 -2 NTP_4_2_5P91 util/ntp-keygen-opts.c@1.79 +2 -2 NTP_4_2_5P91 util/ntp-keygen-opts.h@1.79 +3 -3 NTP_4_2_5P91 util/ntp-keygen-opts.texi@1.78 +1 -1 NTP_4_2_5P91 util/ntp-keygen.1@1.78 +2 -2 NTP_4_2_5P91 ChangeSet@1.1638, 2007-10-26 17:40:27-04:00, stenn@whimsy.udel.edu Fix the #include order in tickadj.c for picky machines ChangeLog@1.136 +1 -0 Fix the #include order in tickadj.c for picky machines util/tickadj.c@1.8 +1 -1 Fix the #include order in tickadj.c for picky machines ChangeSet@1.1637, 2007-10-26 07:43:57-04:00, stenn@whimsy.udel.edu NTP_4_2_5P90 TAG: NTP_4_2_5P90 ntpd/ntpd-opts.c@1.79 +2 -2 NTP_4_2_5P90 ntpd/ntpd-opts.h@1.79 +3 -3 NTP_4_2_5P90 ntpd/ntpd-opts.texi@1.78 +1 -1 NTP_4_2_5P90 ntpd/ntpd.1@1.78 +2 -2 NTP_4_2_5P90 ntpdc/ntpdc-opts.c@1.77 +2 -2 NTP_4_2_5P90 ntpdc/ntpdc-opts.h@1.77 +3 -3 NTP_4_2_5P90 ntpdc/ntpdc-opts.texi@1.76 +1 -1 NTP_4_2_5P90 ntpdc/ntpdc.1@1.76 +2 -2 NTP_4_2_5P90 ntpq/ntpq-opts.c@1.77 +2 -2 NTP_4_2_5P90 ntpq/ntpq-opts.h@1.77 +3 -3 NTP_4_2_5P90 ntpq/ntpq-opts.texi@1.76 +1 -1 NTP_4_2_5P90 ntpq/ntpq.1@1.76 +2 -2 NTP_4_2_5P90 packageinfo.sh@1.93 +1 -1 NTP_4_2_5P90 sntp/sntp-opts.c@1.77 +2 -2 NTP_4_2_5P90 sntp/sntp-opts.h@1.77 +3 -3 NTP_4_2_5P90 sntp/sntp-opts.texi@1.76 +1 -1 NTP_4_2_5P90 sntp/sntp.1@1.76 +2 -2 NTP_4_2_5P90 util/ntp-keygen-opts.c@1.78 +2 -2 NTP_4_2_5P90 util/ntp-keygen-opts.h@1.78 +3 -3 NTP_4_2_5P90 util/ntp-keygen-opts.texi@1.77 +1 -1 NTP_4_2_5P90 util/ntp-keygen.1@1.77 +2 -2 NTP_4_2_5P90 ChangeSet@1.1636, 2007-10-26 00:30:22-04:00, stenn@whimsy.udel.edu [Bug 752] QoS: On some systems, netinet/ip.h needs netinet/ip_systm.h ChangeLog@1.135 +1 -0 [Bug 752] QoS: On some systems, netinet/ip.h needs netinet/ip_systm.h include/ntp_io.h@1.9 +3 -0 [Bug 752] QoS: On some systems, netinet/ip.h needs netinet/ip_systm.h ChangeSet@1.1635, 2007-10-25 07:48:29-04:00, stenn@whimsy.udel.edu NTP_4_2_5P89 TAG: NTP_4_2_5P89 ntpd/ntpd-opts.c@1.78 +2 -2 NTP_4_2_5P89 ntpd/ntpd-opts.h@1.78 +3 -3 NTP_4_2_5P89 ntpd/ntpd-opts.texi@1.77 +1 -1 NTP_4_2_5P89 ntpd/ntpd.1@1.77 +2 -2 NTP_4_2_5P89 ntpdc/ntpdc-opts.c@1.76 +2 -2 NTP_4_2_5P89 ntpdc/ntpdc-opts.h@1.76 +3 -3 NTP_4_2_5P89 ntpdc/ntpdc-opts.texi@1.75 +1 -1 NTP_4_2_5P89 ntpdc/ntpdc.1@1.75 +2 -2 NTP_4_2_5P89 ntpq/ntpq-opts.c@1.76 +2 -2 NTP_4_2_5P89 ntpq/ntpq-opts.h@1.76 +3 -3 NTP_4_2_5P89 ntpq/ntpq-opts.texi@1.75 +1 -1 NTP_4_2_5P89 ntpq/ntpq.1@1.75 +2 -2 NTP_4_2_5P89 packageinfo.sh@1.92 +1 -1 NTP_4_2_5P89 sntp/sntp-opts.c@1.76 +2 -2 NTP_4_2_5P89 sntp/sntp-opts.h@1.76 +3 -3 NTP_4_2_5P89 sntp/sntp-opts.texi@1.75 +1 -1 NTP_4_2_5P89 sntp/sntp.1@1.75 +2 -2 NTP_4_2_5P89 util/ntp-keygen-opts.c@1.77 +2 -2 NTP_4_2_5P89 util/ntp-keygen-opts.h@1.77 +3 -3 NTP_4_2_5P89 util/ntp-keygen-opts.texi@1.76 +1 -1 NTP_4_2_5P89 util/ntp-keygen.1@1.76 +2 -2 NTP_4_2_5P89 ChangeSet@1.1634, 2007-10-25 01:14:55-04:00, stenn@whimsy.udel.edu [Bug 752] Update the QoS tagging (code only - configuration to follow) ChangeLog@1.134 +1 -0 [Bug 752] Update the QoS tagging (code only - configuration to follow) configure.ac@1.409 +18 -0 [Bug 752] Update the QoS tagging (code only - configuration to follow) include/ntp_io.h@1.8 +6 -0 [Bug 752] Update the QoS tagging (code only - configuration to follow) ntpd/ntp_io.c@1.264 +18 -14 [Bug 752] Update the QoS tagging (code only - configuration to follow) ChangeSet@1.1633, 2007-10-24 22:43:04-04:00, stenn@whimsy.udel.edu ntp_proto.c: Orphan mode and other protocol cleanup from Dave Mills manyopt.html, assoc.html: Documentation cleanup from Dave Mills ChangeLog: Documentation cleanup from Dave Mills Orphan mode and other protocol cleanup from Dave Mills ChangeLog@1.133 +2 -0 Documentation cleanup from Dave Mills Orphan mode and other protocol cleanup from Dave Mills html/assoc.html@1.24 +37 -38 Documentation cleanup from Dave Mills html/manyopt.html@1.15 +23 -7 Documentation cleanup from Dave Mills ntpd/ntp_proto.c@1.264 +43 -68 Orphan mode and other protocol cleanup from Dave Mills ChangeSet@1.1632, 2007-10-23 07:44:01-04:00, stenn@whimsy.udel.edu NTP_4_2_5P88 TAG: NTP_4_2_5P88 ntpd/ntpd-opts.c@1.77 +2 -2 NTP_4_2_5P88 ntpd/ntpd-opts.h@1.77 +4 -4 NTP_4_2_5P88 ntpd/ntpd-opts.texi@1.76 +1 -1 NTP_4_2_5P88 ntpd/ntpd.1@1.76 +3 -3 NTP_4_2_5P88 ntpdc/ntpdc-opts.c@1.75 +2 -2 NTP_4_2_5P88 ntpdc/ntpdc-opts.h@1.75 +4 -4 NTP_4_2_5P88 ntpdc/ntpdc-opts.texi@1.74 +1 -1 NTP_4_2_5P88 ntpdc/ntpdc.1@1.74 +3 -3 NTP_4_2_5P88 ntpq/ntpq-opts.c@1.75 +2 -2 NTP_4_2_5P88 ntpq/ntpq-opts.h@1.75 +4 -4 NTP_4_2_5P88 ntpq/ntpq-opts.texi@1.74 +1 -1 NTP_4_2_5P88 ntpq/ntpq.1@1.74 +3 -3 NTP_4_2_5P88 packageinfo.sh@1.91 +1 -1 NTP_4_2_5P88 sntp/sntp-opts.c@1.75 +2 -2 NTP_4_2_5P88 sntp/sntp-opts.h@1.75 +3 -3 NTP_4_2_5P88 sntp/sntp-opts.texi@1.74 +1 -1 NTP_4_2_5P88 sntp/sntp.1@1.74 +2 -2 NTP_4_2_5P88 util/ntp-keygen-opts.c@1.76 +2 -2 NTP_4_2_5P88 util/ntp-keygen-opts.h@1.76 +4 -4 NTP_4_2_5P88 util/ntp-keygen-opts.texi@1.75 +1 -1 NTP_4_2_5P88 util/ntp-keygen.1@1.75 +3 -3 NTP_4_2_5P88 ChangeSet@1.1631, 2007-10-22 21:39:01-04:00, stenn@whimsy.udel.edu [Bug 940] ntp-keygen uses -v. Disallow it as a shortcut for --version ChangeLog@1.132 +1 -0 [Bug 940] ntp-keygen uses -v. Disallow it as a shortcut for --version include/copyright.def@1.6 +2 -0 [Bug 940] ntp-keygen uses -v. Disallow it as a shortcut for --version ChangeSet@1.1630, 2007-10-21 07:47:45-04:00, stenn@whimsy.udel.edu NTP_4_2_5P87 TAG: NTP_4_2_5P87 ntpd/ntpd-opts.c@1.76 +2 -2 NTP_4_2_5P87 ntpd/ntpd-opts.h@1.76 +3 -3 NTP_4_2_5P87 ntpd/ntpd-opts.texi@1.75 +2 -2 NTP_4_2_5P87 ntpd/ntpd.1@1.75 +2 -2 NTP_4_2_5P87 ntpdc/ntpdc-opts.c@1.74 +2 -2 NTP_4_2_5P87 ntpdc/ntpdc-opts.h@1.74 +3 -3 NTP_4_2_5P87 ntpdc/ntpdc-opts.texi@1.73 +2 -2 NTP_4_2_5P87 ntpdc/ntpdc.1@1.73 +2 -2 NTP_4_2_5P87 ntpq/ntpq-opts.c@1.74 +2 -2 NTP_4_2_5P87 ntpq/ntpq-opts.h@1.74 +3 -3 NTP_4_2_5P87 ntpq/ntpq-opts.texi@1.73 +2 -2 NTP_4_2_5P87 ntpq/ntpq.1@1.73 +2 -2 NTP_4_2_5P87 packageinfo.sh@1.90 +1 -1 NTP_4_2_5P87 sntp/sntp-opts.c@1.74 +2 -2 NTP_4_2_5P87 sntp/sntp-opts.h@1.74 +3 -3 NTP_4_2_5P87 sntp/sntp-opts.texi@1.73 +1 -1 NTP_4_2_5P87 sntp/sntp.1@1.73 +2 -2 NTP_4_2_5P87 util/ntp-keygen-opts.c@1.75 +2 -2 NTP_4_2_5P87 util/ntp-keygen-opts.h@1.75 +3 -3 NTP_4_2_5P87 util/ntp-keygen-opts.texi@1.74 +2 -2 NTP_4_2_5P87 util/ntp-keygen.1@1.74 +2 -2 NTP_4_2_5P87 ChangeSet@1.1629, 2007-10-20 18:30:10-04:00, stenn@whimsy.udel.edu more cleanup to ntp_lineeditlibs.m4 ChangeLog@1.131 +1 -0 more cleanup to ntp_lineeditlibs.m4 m4/ntp_lineeditlibs.m4@1.3 +46 -39 more cleanup to ntp_lineeditlibs.m4 ChangeSet@1.1628, 2007-10-20 07:44:48-04:00, stenn@whimsy.udel.edu NTP_4_2_5P86 TAG: NTP_4_2_5P86 ntpd/ntpd-opts.c@1.75 +2 -2 NTP_4_2_5P86 ntpd/ntpd-opts.h@1.75 +3 -3 NTP_4_2_5P86 ntpd/ntpd-opts.texi@1.74 +1 -1 NTP_4_2_5P86 ntpd/ntpd.1@1.74 +2 -2 NTP_4_2_5P86 ntpdc/ntpdc-opts.c@1.73 +2 -2 NTP_4_2_5P86 ntpdc/ntpdc-opts.h@1.73 +3 -3 NTP_4_2_5P86 ntpdc/ntpdc-opts.texi@1.72 +1 -1 NTP_4_2_5P86 ntpdc/ntpdc.1@1.72 +2 -2 NTP_4_2_5P86 ntpq/ntpq-opts.c@1.73 +2 -2 NTP_4_2_5P86 ntpq/ntpq-opts.h@1.73 +3 -3 NTP_4_2_5P86 ntpq/ntpq-opts.texi@1.72 +1 -1 NTP_4_2_5P86 ntpq/ntpq.1@1.72 +2 -2 NTP_4_2_5P86 packageinfo.sh@1.89 +1 -1 NTP_4_2_5P86 sntp/sntp-opts.c@1.73 +2 -2 NTP_4_2_5P86 sntp/sntp-opts.h@1.73 +3 -3 NTP_4_2_5P86 sntp/sntp-opts.texi@1.72 +1 -1 NTP_4_2_5P86 sntp/sntp.1@1.72 +2 -2 NTP_4_2_5P86 util/ntp-keygen-opts.c@1.74 +2 -2 NTP_4_2_5P86 util/ntp-keygen-opts.h@1.74 +3 -3 NTP_4_2_5P86 util/ntp-keygen-opts.texi@1.73 +1 -1 NTP_4_2_5P86 util/ntp-keygen.1@1.73 +2 -2 NTP_4_2_5P86 ChangeSet@1.1627, 2007-10-20 01:32:29-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.130 +1 -0 Documentation updates from Dave Mills html/assoc.html@1.23 +39 -30 Documentation updates from Dave Mills html/confopt.html@1.38 +35 -35 Documentation updates from Dave Mills html/manyopt.html@1.14 +6 -38 Documentation updates from Dave Mills html/miscopt.html@1.37 +22 -1 Documentation updates from Dave Mills html/scripts/links7.txt@1.4 +1 -0 Documentation updates from Dave Mills ChangeSet@1.1626, 2007-10-19 07:44:27-04:00, stenn@whimsy.udel.edu NTP_4_2_5P85 TAG: NTP_4_2_5P85 ntpd/ntpd-opts.c@1.74 +2 -2 NTP_4_2_5P85 ntpd/ntpd-opts.h@1.74 +3 -3 NTP_4_2_5P85 ntpd/ntpd-opts.texi@1.73 +1 -1 NTP_4_2_5P85 ntpd/ntpd.1@1.73 +2 -2 NTP_4_2_5P85 ntpdc/ntpdc-opts.c@1.72 +2 -2 NTP_4_2_5P85 ntpdc/ntpdc-opts.h@1.72 +3 -3 NTP_4_2_5P85 ntpdc/ntpdc-opts.texi@1.71 +1 -1 NTP_4_2_5P85 ntpdc/ntpdc.1@1.71 +2 -2 NTP_4_2_5P85 ntpq/ntpq-opts.c@1.72 +2 -2 NTP_4_2_5P85 ntpq/ntpq-opts.h@1.72 +3 -3 NTP_4_2_5P85 ntpq/ntpq-opts.texi@1.71 +1 -1 NTP_4_2_5P85 ntpq/ntpq.1@1.71 +2 -2 NTP_4_2_5P85 packageinfo.sh@1.88 +1 -1 NTP_4_2_5P85 sntp/sntp-opts.c@1.72 +2 -2 NTP_4_2_5P85 sntp/sntp-opts.h@1.72 +3 -3 NTP_4_2_5P85 sntp/sntp-opts.texi@1.71 +1 -1 NTP_4_2_5P85 sntp/sntp.1@1.71 +2 -2 NTP_4_2_5P85 util/ntp-keygen-opts.c@1.73 +2 -2 NTP_4_2_5P85 util/ntp-keygen-opts.h@1.73 +3 -3 NTP_4_2_5P85 util/ntp-keygen-opts.texi@1.72 +1 -1 NTP_4_2_5P85 util/ntp-keygen.1@1.72 +2 -2 NTP_4_2_5P85 ChangeSet@1.1625, 2007-10-19 06:57:12+00:00, stenn@ntp1.isc.org -ledit cleanup for ntpdc and ntpq. ChangeLog@1.129 +1 -0 -ledit cleanup for ntpdc and ntpq. ntpdc/ntpdc.c@1.58 +3 -3 -ledit cleanup for ntpdc and ntpq. ntpq/ntpq.c@1.72 +3 -3 -ledit cleanup for ntpdc and ntpq. ChangeSet@1.1624, 2007-10-18 07:49:09-04:00, stenn@whimsy.udel.edu NTP_4_2_5P84 TAG: NTP_4_2_5P84 ntpd/ntpd-opts.c@1.73 +2 -2 NTP_4_2_5P84 ntpd/ntpd-opts.h@1.73 +3 -3 NTP_4_2_5P84 ntpd/ntpd-opts.texi@1.72 +1 -1 NTP_4_2_5P84 ntpd/ntpd.1@1.72 +2 -2 NTP_4_2_5P84 ntpdc/ntpdc-opts.c@1.71 +2 -2 NTP_4_2_5P84 ntpdc/ntpdc-opts.h@1.71 +3 -3 NTP_4_2_5P84 ntpdc/ntpdc-opts.texi@1.70 +1 -1 NTP_4_2_5P84 ntpdc/ntpdc.1@1.70 +2 -2 NTP_4_2_5P84 ntpq/ntpq-opts.c@1.71 +2 -2 NTP_4_2_5P84 ntpq/ntpq-opts.h@1.71 +3 -3 NTP_4_2_5P84 ntpq/ntpq-opts.texi@1.70 +1 -1 NTP_4_2_5P84 ntpq/ntpq.1@1.70 +2 -2 NTP_4_2_5P84 packageinfo.sh@1.87 +1 -1 NTP_4_2_5P84 sntp/sntp-opts.c@1.71 +2 -2 NTP_4_2_5P84 sntp/sntp-opts.h@1.71 +3 -3 NTP_4_2_5P84 sntp/sntp-opts.texi@1.70 +1 -1 NTP_4_2_5P84 sntp/sntp.1@1.70 +2 -2 NTP_4_2_5P84 util/ntp-keygen-opts.c@1.72 +2 -2 NTP_4_2_5P84 util/ntp-keygen-opts.h@1.72 +3 -3 NTP_4_2_5P84 util/ntp-keygen-opts.texi@1.71 +1 -1 NTP_4_2_5P84 util/ntp-keygen.1@1.71 +2 -2 NTP_4_2_5P84 ChangeSet@1.1623, 2007-10-18 01:57:55-04:00, stenn@whimsy.udel.edu README.hackers: cleanup README.hackers@1.11 +0 -13 cleanup ChangeSet@1.1622, 2007-10-18 01:52:51-04:00, stenn@whimsy.udel.edu refclock_acts.c, ntp_peer.c, ChangeLog, ntp_proto.c, ntp_config.c: Association and other cleanup from Dave Mills ntp.h: NTP_UNREACH changes from Dave Mills. ChangeLog@1.128 +2 -0 Association and other cleanup from Dave Mills include/ntp.h@1.139 +2 -2 NTP_UNREACH changes from Dave Mills. ntpd/ntp_config.c@1.168 +20 -24 Association and other cleanup from Dave Mills ntpd/ntp_peer.c@1.108 +45 -65 Association and other cleanup from Dave Mills ntpd/ntp_proto.c@1.263 +11 -34 Association and other cleanup from Dave Mills ntpd/refclock_acts.c@1.32 +2 -0 Association and other cleanup from Dave Mills ChangeSet@1.1621, 2007-10-17 20:21:31-04:00, stenn@whimsy.udel.edu Fix the readline history test ChangeLog@1.127 +1 -0 Fix the readline history test m4/ntp_lineeditlibs.m4@1.2 +4 -1 Fix the readline history test ChangeSet@1.1620, 2007-10-15 07:49:05-04:00, stenn@whimsy.udel.edu NTP_4_2_5P83 TAG: NTP_4_2_5P83 ntpd/ntpd-opts.c@1.72 +2 -2 NTP_4_2_5P83 ntpd/ntpd-opts.h@1.72 +3 -3 NTP_4_2_5P83 ntpd/ntpd-opts.texi@1.71 +1 -1 NTP_4_2_5P83 ntpd/ntpd.1@1.71 +2 -2 NTP_4_2_5P83 ntpdc/ntpdc-opts.c@1.70 +2 -2 NTP_4_2_5P83 ntpdc/ntpdc-opts.h@1.70 +3 -3 NTP_4_2_5P83 ntpdc/ntpdc-opts.texi@1.69 +1 -1 NTP_4_2_5P83 ntpdc/ntpdc.1@1.69 +2 -2 NTP_4_2_5P83 ntpq/ntpq-opts.c@1.70 +2 -2 NTP_4_2_5P83 ntpq/ntpq-opts.h@1.70 +3 -3 NTP_4_2_5P83 ntpq/ntpq-opts.texi@1.69 +1 -1 NTP_4_2_5P83 ntpq/ntpq.1@1.69 +2 -2 NTP_4_2_5P83 packageinfo.sh@1.86 +1 -1 NTP_4_2_5P83 sntp/sntp-opts.c@1.70 +2 -2 NTP_4_2_5P83 sntp/sntp-opts.h@1.70 +3 -3 NTP_4_2_5P83 sntp/sntp-opts.texi@1.69 +1 -1 NTP_4_2_5P83 sntp/sntp.1@1.69 +2 -2 NTP_4_2_5P83 util/ntp-keygen-opts.c@1.71 +2 -2 NTP_4_2_5P83 util/ntp-keygen-opts.h@1.71 +3 -3 NTP_4_2_5P83 util/ntp-keygen-opts.texi@1.70 +1 -1 NTP_4_2_5P83 util/ntp-keygen.1@1.70 +2 -2 NTP_4_2_5P83 ChangeSet@1.1619, 2007-10-15 04:52:10-04:00, stenn@whimsy.udel.edu ChangeLog: [Bug 931] Require -lreadline to be asked for explicitly. [Bug 764] When looking for -lreadline support, also try using -lncurses. Use new line edit library autoconf macro. configure.ac: Use the NTP_LINEEDITLIBS macro now. Makefile.am, ntpdc.c, ntpq.c: Use new line editing library detection code ntp_lineeditlibs.m4: BitKeeper file /deacon/backroom/ntp-dev-hms/m4/ntp_lineeditlibs.m4 ChangeLog@1.126 +2 -0 [Bug 931] Require -lreadline to be asked for explicitly. [Bug 764] When looking for -lreadline support, also try using -lncurses. Use new line edit library autoconf macro. configure.ac@1.408 +2 -26 Use the NTP_LINEEDITLIBS macro now. m4/ntp_lineeditlibs.m4@1.1 +86 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/m4/ntp_lineeditlibs.m4 m4/ntp_lineeditlibs.m4@1.0 +0 -0 ntpdc/Makefile.am@1.37 +1 -1 Use new line editing library detection code ntpdc/ntpdc.c@1.57 +6 -2 Use new line editing library detection code ntpq/Makefile.am@1.29 +1 -1 Use new line editing library detection code ntpq/ntpq.c@1.71 +6 -2 Use new line editing library detection code ChangeSet@1.1618, 2007-10-14 07:44:25-04:00, stenn@whimsy.udel.edu NTP_4_2_5P82 TAG: NTP_4_2_5P82 ntpd/ntpd-opts.c@1.71 +2 -2 NTP_4_2_5P82 ntpd/ntpd-opts.h@1.71 +3 -3 NTP_4_2_5P82 ntpd/ntpd-opts.texi@1.70 +1 -1 NTP_4_2_5P82 ntpd/ntpd.1@1.70 +2 -2 NTP_4_2_5P82 ntpdc/ntpdc-opts.c@1.69 +2 -2 NTP_4_2_5P82 ntpdc/ntpdc-opts.h@1.69 +3 -3 NTP_4_2_5P82 ntpdc/ntpdc-opts.texi@1.68 +1 -1 NTP_4_2_5P82 ntpdc/ntpdc.1@1.68 +2 -2 NTP_4_2_5P82 ntpq/ntpq-opts.c@1.69 +2 -2 NTP_4_2_5P82 ntpq/ntpq-opts.h@1.69 +3 -3 NTP_4_2_5P82 ntpq/ntpq-opts.texi@1.68 +1 -1 NTP_4_2_5P82 ntpq/ntpq.1@1.68 +2 -2 NTP_4_2_5P82 packageinfo.sh@1.85 +1 -1 NTP_4_2_5P82 sntp/sntp-opts.c@1.69 +2 -2 NTP_4_2_5P82 sntp/sntp-opts.h@1.69 +3 -3 NTP_4_2_5P82 sntp/sntp-opts.texi@1.68 +1 -1 NTP_4_2_5P82 sntp/sntp.1@1.68 +2 -2 NTP_4_2_5P82 util/ntp-keygen-opts.c@1.70 +2 -2 NTP_4_2_5P82 util/ntp-keygen-opts.h@1.70 +3 -3 NTP_4_2_5P82 util/ntp-keygen-opts.texi@1.69 +1 -1 NTP_4_2_5P82 util/ntp-keygen.1@1.69 +2 -2 NTP_4_2_5P82 ChangeSet@1.1617, 2007-10-14 03:35:11-04:00, stenn@pogo.udel.edu Reformat entries ChangeLog@1.125 +5 -5 Reformat entries ChangeSet@1.1616, 2007-10-13 21:47:27-04:00, mayer@pogo.udel.edu Bug #909 Fix int32_t errors for ntohl() ntpdc/ntpdc_ops.c@1.52 +107 -107 Bug #909 Fix int32_t errors for ntohl() ports/winnt/include/config.h@1.52 +1 -0 Bug #909 Fix int32_t errors for ntohl() ChangeSet@1.1615, 2007-10-08 15:47:23-04:00, mayer@pogo.udel.edu Bug #909 Fix int32_t errors for ntohl() ChangeLog@1.124 +1 -0 Bug #909 Fix int32_t errors for ntohl() ChangeSet@1.1614, 2007-10-08 15:45:47-04:00, mayer@pogo.udel.edu Bug #909 Fix int32_t errors for ntohl() ntpdc/ntpdc_ops.c@1.51 +107 -107 Bug #909 Fix int32_t errors for ntohl() ChangeSet@1.1613, 2007-10-07 20:47:32-04:00, mayer@pogo.udel.edu Bug #376/214 enhancements ChangeLog@1.123 +1 -0 ChangeSet@1.1612, 2007-10-07 12:27:06-04:00, mayer@pogo.udel.edu Bug #376/214 Enhancements to support multiple if names and IP addresses include/ntp_io.h@1.7 +6 -0 Bug #376/214 Enhancements to support multiple if names and IP addresses ntpd/ntp_io.c@1.263 +151 -2 Bug #376/214 Enhancements to support multiple if names and IP addresses ntpd/ntpd.c@1.90 +7 -6 Bug #376/214 Enhancements to support multiple if names and IP addresses ChangeSet@1.1611, 2007-10-05 09:54:42-04:00, mayer@pogo.udel.edu Bug #788 Update macros to support VS 2005 ports/winnt/include/config.h@1.51 +3 -1 Bug #788 Update macros to support VS 2005 ChangeSet@1.1610, 2007-10-05 09:20:49-04:00, mayer@pogo.udel.edu New bug fixes ChangeLog@1.122 +3 -0 New bug fixes ChangeSet@1.1609, 2007-10-05 09:17:12-04:00, mayer@pogo.udel.edu Bug #929 int32_t is undefined on Windows. Casting wrong ntpdc/ntpdc_ops.c@1.50 +4 -4 Bug #929 int32_t is undefined on Windows. Casting wrong ChangeSet@1.1608, 2007-10-05 08:57:08-04:00, mayer@pogo.udel.edu Bug #928 readlink missing braces util/ntp-keygen.c@1.46 +2 -2 Bug #928 readlink missing braces ChangeSet@1.1607, 2007-10-05 08:46:39-04:00, mayer@pogo.udel.edu Bug #788 Update macros to support VS 2005 ports/winnt/instsrv/Instsrv.dsp@1.7 +2 -2 Bug #788 Update macros to support VS 2005 ports/winnt/libntp/libntp.dsp@1.31 +2 -2 Bug #788 Update macros to support VS 2005 ports/winnt/ntp-keygen/ntpkeygen.dsp@1.12 +4 -4 Bug #788 Update macros to support VS 2005 ports/winnt/ntpd/ntpd.dsp@1.31 +2 -2 Bug #788 Update macros to support VS 2005 ports/winnt/ntpdate/ntpdate.dsp@1.16 +2 -2 Bug #788 Update macros to support VS 2005 ports/winnt/ntpdc/ntpdc.dsp@1.19 +2 -2 Bug #788 Update macros to support VS 2005 ports/winnt/ntpq/ntpq.dsp@1.20 +2 -2 Bug #788 Update macros to support VS 2005 ChangeSet@1.1606, 2007-10-04 07:45:47-04:00, stenn@whimsy.udel.edu NTP_4_2_5P81 TAG: NTP_4_2_5P81 ntpd/ntpd-opts.c@1.70 +2 -2 NTP_4_2_5P81 ntpd/ntpd-opts.h@1.70 +3 -3 NTP_4_2_5P81 ntpd/ntpd-opts.texi@1.69 +3 -5 NTP_4_2_5P81 ntpd/ntpd.1@1.69 +2 -2 NTP_4_2_5P81 ntpdc/ntpdc-opts.c@1.68 +2 -2 NTP_4_2_5P81 ntpdc/ntpdc-opts.h@1.68 +3 -3 NTP_4_2_5P81 ntpdc/ntpdc-opts.texi@1.67 +2 -2 NTP_4_2_5P81 ntpdc/ntpdc.1@1.67 +2 -2 NTP_4_2_5P81 ntpq/ntpq-opts.c@1.68 +2 -2 NTP_4_2_5P81 ntpq/ntpq-opts.h@1.68 +3 -3 NTP_4_2_5P81 ntpq/ntpq-opts.texi@1.67 +2 -2 NTP_4_2_5P81 ntpq/ntpq.1@1.67 +2 -2 NTP_4_2_5P81 packageinfo.sh@1.84 +1 -1 NTP_4_2_5P81 sntp/sntp-opts.c@1.68 +2 -2 NTP_4_2_5P81 sntp/sntp-opts.h@1.68 +3 -3 NTP_4_2_5P81 sntp/sntp-opts.texi@1.67 +1 -1 NTP_4_2_5P81 sntp/sntp.1@1.67 +2 -2 NTP_4_2_5P81 util/ntp-keygen-opts.c@1.69 +2 -2 NTP_4_2_5P81 util/ntp-keygen-opts.h@1.69 +3 -3 NTP_4_2_5P81 util/ntp-keygen-opts.texi@1.68 +2 -2 NTP_4_2_5P81 util/ntp-keygen.1@1.68 +2 -2 NTP_4_2_5P81 ChangeSet@1.1605, 2007-10-04 03:02:00-04:00, stenn@whimsy.udel.edu documentation update from Dave Mills html/authopt.html@1.45 +2 -2 documentation update from Dave Mills ChangeSet@1.1599.1.1, 2007-10-03 21:38:31-04:00, stenn@whimsy.udel.edu Many files: Lose obsolete crypto subcommands sco.html, authopt.html: documentation cleanup ChangeLog, ntp_control.c: WWV is an HF source, not an LF source ChangeLog@1.116.1.2 +1 -0 Lose obsolete crypto subcommands ChangeLog@1.116.1.1 +1 -0 WWV is an HF source, not an LF source html/authopt.html@1.44 +2 -3 documentation cleanup html/build/hints/sco.html@1.8 +1 -0 documentation cleanup ntpd/ntp_config.c@1.167 +0 -5 Lose obsolete crypto subcommands ntpd/ntp_control.c@1.102 +1 -1 WWV is an HF source, not an LF source ntpd/ntp_crypto.c@1.118 +0 -25 Lose obsolete crypto subcommands ntpd/ntp_parser.c@1.22 +826 -848 Lose obsolete crypto subcommands ntpd/ntp_parser.h@1.8 +132 -136 Lose obsolete crypto subcommands ntpd/ntp_parser.y@1.18 +9 -14 Lose obsolete crypto subcommands ChangeSet@1.1603, 2007-09-30 16:40:51+00:00, kardel@pogo.udel.edu ChangeLog: ntpd/ntp_timer.c: add missing sys_tai parameter for debug printf ntp_timer.c: add missing sys_tai parameter for debug printf ChangeLog@1.120 +1 -0 ntpd/ntp_timer.c: add missing sys_tai parameter for debug printf ntpd/ntp_timer.c@1.41 +1 -1 add missing sys_tai parameter for debug printf ChangeSet@1.1602, 2007-09-30 16:09:50+00:00, kardel@pogo.udel.edu ChangeLog: [Bug 917] config parse leaves files open ntp_scanner.c: Bug 917: config parse leaves files open ChangeLog@1.119 +1 -0 [Bug 917] config parse leaves files open ntpd/ntp_scanner.c@1.9 +3 -2 Bug 917: config parse leaves files open ChangeSet@1.1601, 2007-09-30 16:05:00+00:00, kardel@pogo.udel.edu ntp_io.c: Bug 912: detect conflicting enable/disable configuration on interfaces sharing an IP address ChangeLog: [Bug 912] detect conflicting enable/disable configuration on interfaces sharing an IP address ChangeLog@1.118 +1 -0 [Bug 912] detect conflicting enable/disable configuration on interfaces sharing an IP address ntpd/ntp_io.c@1.262 +39 -2 Bug 912: detect conflicting enable/disable configuration on interfaces sharing an IP address ChangeSet@1.1600, 2007-09-30 15:57:52+00:00, kardel@pogo.udel.edu ChangeLog: [Bug 771] compare scopeid if available for IPv6 addresses ntp.h: Bug 771: compare scopeid if available for IPv6 addresses ChangeLog@1.117 +1 -0 [Bug 771] compare scopeid if available for IPv6 addresses include/ntp.h@1.138 +7 -1 Bug 771: compare scopeid if available for IPv6 addresses ChangeSet@1.1599, 2007-09-23 07:45:18-04:00, stenn@whimsy.udel.edu NTP_4_2_5P80 TAG: NTP_4_2_5P80 ntpd/ntpd-opts.c@1.69 +2 -2 NTP_4_2_5P80 ntpd/ntpd-opts.h@1.69 +3 -3 NTP_4_2_5P80 ntpd/ntpd-opts.texi@1.68 +1 -1 NTP_4_2_5P80 ntpd/ntpd.1@1.68 +2 -2 NTP_4_2_5P80 ntpdc/ntpdc-opts.c@1.67 +2 -2 NTP_4_2_5P80 ntpdc/ntpdc-opts.h@1.67 +3 -3 NTP_4_2_5P80 ntpdc/ntpdc-opts.texi@1.66 +1 -1 NTP_4_2_5P80 ntpdc/ntpdc.1@1.66 +2 -2 NTP_4_2_5P80 ntpq/ntpq-opts.c@1.67 +2 -2 NTP_4_2_5P80 ntpq/ntpq-opts.h@1.67 +3 -3 NTP_4_2_5P80 ntpq/ntpq-opts.texi@1.66 +1 -1 NTP_4_2_5P80 ntpq/ntpq.1@1.66 +2 -2 NTP_4_2_5P80 packageinfo.sh@1.83 +1 -1 NTP_4_2_5P80 sntp/sntp-opts.c@1.67 +2 -2 NTP_4_2_5P80 sntp/sntp-opts.h@1.67 +3 -3 NTP_4_2_5P80 sntp/sntp-opts.texi@1.66 +1 -1 NTP_4_2_5P80 sntp/sntp.1@1.66 +2 -2 NTP_4_2_5P80 util/ntp-keygen-opts.c@1.68 +2 -2 NTP_4_2_5P80 util/ntp-keygen-opts.h@1.68 +3 -3 NTP_4_2_5P80 util/ntp-keygen-opts.texi@1.67 +1 -1 NTP_4_2_5P80 util/ntp-keygen.1@1.67 +2 -2 NTP_4_2_5P80 ChangeSet@1.1598, 2007-09-23 03:16:18-04:00, stenn@whimsy.udel.edu [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT ChangeLog@1.116 +1 -1 [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT ntpd/ntpd-opts.c@1.68 +40 -31 [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT ntpd/ntpd-opts.h@1.68 +16 -14 [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT ntpd/ntpd-opts.texi@1.67 +19 -12 [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT ntpd/ntpd.1@1.67 +10 -10 [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT ntpd/ntpdbase-opts.def@1.13 +26 -25 [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT ChangeSet@1.1597, 2007-09-23 02:06:55-04:00, stenn@whimsy.udel.edu [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT ChangeLog@1.115 +1 -0 [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT ntpd/ntpd-opts.c@1.67 +10 -1 [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT ntpd/ntpd-opts.h@1.67 +3 -1 [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT ntpd/ntpd-opts.texi@1.66 +8 -1 [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT ntpd/ntpd.1@1.66 +2 -2 [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT ntpd/ntpdbase-opts.def@1.12 +1 -0 [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT ChangeSet@1.1596, 2007-09-20 07:43:57-04:00, stenn@whimsy.udel.edu NTP_4_2_5P79 TAG: NTP_4_2_5P79 ntpd/ntpd-opts.c@1.66 +2 -2 NTP_4_2_5P79 ntpd/ntpd-opts.h@1.66 +3 -3 NTP_4_2_5P79 ntpd/ntpd-opts.texi@1.65 +2 -2 NTP_4_2_5P79 ntpd/ntpd.1@1.65 +2 -2 NTP_4_2_5P79 ntpdc/ntpdc-opts.c@1.66 +2 -2 NTP_4_2_5P79 ntpdc/ntpdc-opts.h@1.66 +3 -3 NTP_4_2_5P79 ntpdc/ntpdc-opts.texi@1.65 +2 -2 NTP_4_2_5P79 ntpdc/ntpdc.1@1.65 +2 -2 NTP_4_2_5P79 ntpq/ntpq-opts.c@1.66 +2 -2 NTP_4_2_5P79 ntpq/ntpq-opts.h@1.66 +3 -3 NTP_4_2_5P79 ntpq/ntpq-opts.texi@1.65 +2 -2 NTP_4_2_5P79 ntpq/ntpq.1@1.65 +2 -2 NTP_4_2_5P79 packageinfo.sh@1.82 +1 -1 NTP_4_2_5P79 sntp/sntp-opts.c@1.66 +2 -2 NTP_4_2_5P79 sntp/sntp-opts.h@1.66 +3 -3 NTP_4_2_5P79 sntp/sntp-opts.texi@1.65 +1 -1 NTP_4_2_5P79 sntp/sntp.1@1.65 +2 -2 NTP_4_2_5P79 util/ntp-keygen-opts.c@1.67 +2 -2 NTP_4_2_5P79 util/ntp-keygen-opts.h@1.67 +3 -3 NTP_4_2_5P79 util/ntp-keygen-opts.texi@1.66 +2 -2 NTP_4_2_5P79 util/ntp-keygen.1@1.66 +2 -2 NTP_4_2_5P79 ChangeSet@1.1595, 2007-09-19 14:40:52-04:00, stenn@whimsy.udel.edu [Bug 916] 'cryptosw' is undefined if built without OpenSSL ntpd/ntp_config.c@1.166 +0 -2 [Bug 916] 'cryptosw' is undefined if built without OpenSSL ChangeSet@1.1594, 2007-09-19 07:45:04-04:00, stenn@whimsy.udel.edu NTP_4_2_5P78 TAG: NTP_4_2_5P78 ntpd/ntpd-opts.c@1.65 +2 -2 NTP_4_2_5P78 ntpd/ntpd-opts.h@1.65 +3 -3 NTP_4_2_5P78 ntpd/ntpd-opts.texi@1.64 +2 -2 NTP_4_2_5P78 ntpd/ntpd.1@1.64 +2 -2 NTP_4_2_5P78 ntpdc/ntpdc-opts.c@1.65 +2 -2 NTP_4_2_5P78 ntpdc/ntpdc-opts.h@1.65 +3 -3 NTP_4_2_5P78 ntpdc/ntpdc-opts.texi@1.64 +2 -2 NTP_4_2_5P78 ntpdc/ntpdc.1@1.64 +2 -2 NTP_4_2_5P78 ntpq/ntpq-opts.c@1.65 +2 -2 NTP_4_2_5P78 ntpq/ntpq-opts.h@1.65 +3 -3 NTP_4_2_5P78 ntpq/ntpq-opts.texi@1.64 +2 -2 NTP_4_2_5P78 ntpq/ntpq.1@1.64 +2 -2 NTP_4_2_5P78 packageinfo.sh@1.81 +1 -1 NTP_4_2_5P78 sntp/sntp-opts.c@1.65 +2 -2 NTP_4_2_5P78 sntp/sntp-opts.h@1.65 +3 -3 NTP_4_2_5P78 sntp/sntp-opts.texi@1.64 +1 -1 NTP_4_2_5P78 sntp/sntp.1@1.64 +2 -2 NTP_4_2_5P78 util/ntp-keygen-opts.c@1.66 +2 -2 NTP_4_2_5P78 util/ntp-keygen-opts.h@1.66 +3 -3 NTP_4_2_5P78 util/ntp-keygen-opts.texi@1.65 +3 -3 NTP_4_2_5P78 util/ntp-keygen.1@1.65 +2 -2 NTP_4_2_5P78 ChangeSet@1.1593, 2007-09-19 06:46:54-04:00, stenn@whimsy.udel.edu [Bug 916] 'cryptosw' is undefined if built without OpenSSL ChangeLog@1.114 +1 -0 [Bug 916] 'cryptosw' is undefined if built without OpenSSL ChangeSet@1.1592, 2007-09-19 04:16:11-04:00, stenn@whimsy.udel.edu Documentation updates html/authopt.html@1.43 +45 -59 Documentation updates html/keygen.html@1.10 +41 -44 Documentation updates ChangeSet@1.1591, 2007-09-19 04:05:50-04:00, stenn@whimsy.udel.edu [Bug 890] the crypto command seems to be required now\n[Bug 891] 'restrict' config file keyword does not work (partial fix) ChangeLog@1.113 +1 -0 [Bug 890] the crypto command seems to be required now\n[Bug 891] 'restrict' config file keyword does not work (partial fix) ChangeLog@1.112 +3 -0 [Bug 890] the crypto command seems to be required now ntpd/ntp_config.c@1.165 +9 -1 [Bug 890] the crypto command seems to be required now\n[Bug 891] 'restrict' config file keyword does not work (partial fix) ntpd/ntp_crypto.c@1.117 +13 -17 [Bug 915] ntpd cores during processing of x509 certificates\nRemove lint. ntpd/ntp_parser.c@1.21 +238 -236 [Bug 890] the crypto command seems to be required now ntpd/ntp_parser.y@1.17 +2 -0 [Bug 890] the crypto command seems to be required now ntpd/ntp_restrict.c@1.25 +6 -1 restrict processing debug information ChangeSet@1.1590, 2007-09-16 07:44:22-04:00, stenn@whimsy.udel.edu NTP_4_2_5P77 TAG: NTP_4_2_5P77 ntpd/ntpd-opts.c@1.64 +2 -2 NTP_4_2_5P77 ntpd/ntpd-opts.h@1.64 +3 -3 NTP_4_2_5P77 ntpd/ntpd-opts.texi@1.63 +1 -1 NTP_4_2_5P77 ntpd/ntpd.1@1.63 +2 -2 NTP_4_2_5P77 ntpdc/ntpdc-opts.c@1.64 +2 -2 NTP_4_2_5P77 ntpdc/ntpdc-opts.h@1.64 +3 -3 NTP_4_2_5P77 ntpdc/ntpdc-opts.texi@1.63 +1 -1 NTP_4_2_5P77 ntpdc/ntpdc.1@1.63 +2 -2 NTP_4_2_5P77 ntpq/ntpq-opts.c@1.64 +2 -2 NTP_4_2_5P77 ntpq/ntpq-opts.h@1.64 +3 -3 NTP_4_2_5P77 ntpq/ntpq-opts.texi@1.63 +1 -1 NTP_4_2_5P77 ntpq/ntpq.1@1.63 +2 -2 NTP_4_2_5P77 packageinfo.sh@1.80 +1 -1 NTP_4_2_5P77 sntp/sntp-opts.c@1.64 +2 -2 NTP_4_2_5P77 sntp/sntp-opts.h@1.64 +3 -3 NTP_4_2_5P77 sntp/sntp-opts.texi@1.63 +1 -1 NTP_4_2_5P77 sntp/sntp.1@1.63 +2 -2 NTP_4_2_5P77 util/ntp-keygen-opts.c@1.65 +2 -2 NTP_4_2_5P77 util/ntp-keygen-opts.h@1.65 +3 -3 NTP_4_2_5P77 util/ntp-keygen-opts.texi@1.64 +1 -1 NTP_4_2_5P77 util/ntp-keygen.1@1.64 +2 -2 NTP_4_2_5P77 ChangeSet@1.1589, 2007-09-15 16:40:14-04:00, stenn@whimsy.udel.edu Crypto cleanup from Dave Mills.\n[Bug 897] Check RAND_status() - we may not need a .rnd file ChangeLog@1.111 +2 -0 Crypto cleanup from Dave Mills.\n[Bug 897] Check RAND_status() - we may not need a .rnd file ntpd/ntp_control.c@1.101 +2 -2 Crypto cleanup from Dave Mills.\n[Bug 897] Check RAND_status() - we may not need a .rnd file ntpd/ntp_crypto.c@1.116 +102 -70 Crypto cleanup from Dave Mills.\n[Bug 897] Check RAND_status() - we may not need a .rnd file util/ntp-keygen.c@1.45 +143 -202 Crypto cleanup from Dave Mills.\n[Bug 897] Check RAND_status() - we may not need a .rnd file ChangeSet@1.1588, 2007-09-13 07:44:43-04:00, stenn@whimsy.udel.edu NTP_4_2_5P76 TAG: NTP_4_2_5P76 ntpd/ntpd-opts.c@1.63 +2 -2 NTP_4_2_5P76 ntpd/ntpd-opts.h@1.63 +3 -3 NTP_4_2_5P76 ntpd/ntpd-opts.texi@1.62 +1 -1 NTP_4_2_5P76 ntpd/ntpd.1@1.62 +2 -2 NTP_4_2_5P76 ntpdc/ntpdc-opts.c@1.63 +2 -2 NTP_4_2_5P76 ntpdc/ntpdc-opts.h@1.63 +3 -3 NTP_4_2_5P76 ntpdc/ntpdc-opts.texi@1.62 +1 -1 NTP_4_2_5P76 ntpdc/ntpdc.1@1.62 +2 -2 NTP_4_2_5P76 ntpq/ntpq-opts.c@1.63 +2 -2 NTP_4_2_5P76 ntpq/ntpq-opts.h@1.63 +3 -3 NTP_4_2_5P76 ntpq/ntpq-opts.texi@1.62 +1 -1 NTP_4_2_5P76 ntpq/ntpq.1@1.62 +2 -2 NTP_4_2_5P76 packageinfo.sh@1.79 +1 -1 NTP_4_2_5P76 sntp/sntp-opts.c@1.63 +2 -2 NTP_4_2_5P76 sntp/sntp-opts.h@1.63 +3 -3 NTP_4_2_5P76 sntp/sntp-opts.texi@1.62 +1 -1 NTP_4_2_5P76 sntp/sntp.1@1.62 +2 -2 NTP_4_2_5P76 util/ntp-keygen-opts.c@1.64 +2 -2 NTP_4_2_5P76 util/ntp-keygen-opts.h@1.64 +3 -3 NTP_4_2_5P76 util/ntp-keygen-opts.texi@1.63 +1 -1 NTP_4_2_5P76 util/ntp-keygen.1@1.63 +2 -2 NTP_4_2_5P76 ChangeSet@1.1587, 2007-09-12 17:22:55-04:00, stenn@whimsy.udel.edu [Bug 911] Fix error message in cmd_args.c ChangeLog@1.110 +1 -0 [Bug 911] Fix error message in cmd_args.c ntpd/cmd_args.c@1.52 +0 -1 [Bug 911] Fix error message in cmd_args.c ChangeSet@1.1586, 2007-09-11 07:47:21-04:00, stenn@whimsy.udel.edu NTP_4_2_5P75 TAG: NTP_4_2_5P75 ntpd/ntpd-opts.c@1.62 +2 -2 NTP_4_2_5P75 ntpd/ntpd-opts.h@1.62 +3 -3 NTP_4_2_5P75 ntpd/ntpd-opts.texi@1.61 +1 -1 NTP_4_2_5P75 ntpd/ntpd.1@1.61 +2 -2 NTP_4_2_5P75 ntpdc/ntpdc-opts.c@1.62 +2 -2 NTP_4_2_5P75 ntpdc/ntpdc-opts.h@1.62 +3 -3 NTP_4_2_5P75 ntpdc/ntpdc-opts.texi@1.61 +1 -1 NTP_4_2_5P75 ntpdc/ntpdc.1@1.61 +2 -2 NTP_4_2_5P75 ntpq/ntpq-opts.c@1.62 +2 -2 NTP_4_2_5P75 ntpq/ntpq-opts.h@1.62 +3 -3 NTP_4_2_5P75 ntpq/ntpq-opts.texi@1.61 +1 -1 NTP_4_2_5P75 ntpq/ntpq.1@1.61 +2 -2 NTP_4_2_5P75 packageinfo.sh@1.78 +1 -1 NTP_4_2_5P75 sntp/sntp-opts.c@1.62 +2 -2 NTP_4_2_5P75 sntp/sntp-opts.h@1.62 +3 -3 NTP_4_2_5P75 sntp/sntp-opts.texi@1.61 +1 -1 NTP_4_2_5P75 sntp/sntp.1@1.61 +2 -2 NTP_4_2_5P75 util/ntp-keygen-opts.c@1.63 +2 -2 NTP_4_2_5P75 util/ntp-keygen-opts.h@1.63 +3 -3 NTP_4_2_5P75 util/ntp-keygen-opts.texi@1.62 +1 -1 NTP_4_2_5P75 util/ntp-keygen.1@1.62 +2 -2 NTP_4_2_5P75 ChangeSet@1.1585, 2007-09-11 04:14:55-04:00, murray@pogo.udel.edu [Bug 895] Log assertion failures via syslog(), not stderr ChangeLog@1.109 +1 -0 [Bug 895] Log assertion failures via syslog(), not stderr ChangeSet@1.1436.1.84, 2007-09-10 20:40:19-04:00, stenn@whimsy.udel.edu NTP_4_2_4P4 TAG: NTP_4_2_4P4 ntpd/ntpd-opts.c@1.50.13.1 +2 -2 NTP_4_2_4P4 ntpd/ntpd-opts.h@1.50.13.1 +3 -3 NTP_4_2_4P4 ntpd/ntpd-opts.texi@1.49.13.1 +1 -1 NTP_4_2_4P4 ntpd/ntpd.1@1.48.13.1 +2 -2 NTP_4_2_4P4 ntpd/ntpdsim-opts.c@1.50.13.1 +2 -2 NTP_4_2_4P4 ntpd/ntpdsim-opts.h@1.50.13.1 +3 -3 NTP_4_2_4P4 ntpd/ntpdsim-opts.texi@1.48.13.1 +1 -1 NTP_4_2_4P4 ntpd/ntpdsim.1@1.48.13.1 +2 -2 NTP_4_2_4P4 ntpdc/ntpdc-opts.c@1.50.13.1 +2 -2 NTP_4_2_4P4 ntpdc/ntpdc-opts.h@1.50.13.1 +3 -3 NTP_4_2_4P4 ntpdc/ntpdc-opts.texi@1.48.13.1 +1 -1 NTP_4_2_4P4 ntpdc/ntpdc.1@1.48.13.1 +2 -2 NTP_4_2_4P4 ntpq/ntpq-opts.c@1.52.13.1 +2 -2 NTP_4_2_4P4 ntpq/ntpq-opts.h@1.52.13.1 +3 -3 NTP_4_2_4P4 ntpq/ntpq-opts.texi@1.49.13.1 +1 -1 NTP_4_2_4P4 ntpq/ntpq.1@1.48.13.1 +2 -2 NTP_4_2_4P4 packageinfo.sh@1.65.19.2 +2 -2 NTP_4_2_4P4 sntp/sntp-opts.c@1.49.13.1 +2 -2 NTP_4_2_4P4 sntp/sntp-opts.h@1.49.13.1 +3 -3 NTP_4_2_4P4 sntp/sntp-opts.texi@1.46.13.1 +1 -1 NTP_4_2_4P4 sntp/sntp.1@1.49.13.1 +2 -2 NTP_4_2_4P4 util/ntp-keygen-opts.c@1.49.13.1 +2 -2 NTP_4_2_4P4 util/ntp-keygen-opts.h@1.49.13.1 +3 -3 NTP_4_2_4P4 util/ntp-keygen-opts.texi@1.47.13.1 +1 -1 NTP_4_2_4P4 util/ntp-keygen.1@1.47.13.1 +2 -2 NTP_4_2_4P4 ChangeSet@1.1436.1.83, 2007-09-10 16:56:09-04:00, stenn@whimsy.udel.edu Release 4.2.4p4 ChangeLog@1.1.1.34 +3 -0 Release 4.2.4p4 NEWS@1.86.1.12 +11 -0 Release 4.2.4p4 packageinfo.sh@1.65.19.1 +1 -1 Release 4.2.4p4 ChangeSet@1.1582.1.7, 2007-09-10 07:56:32-04:00, stenn@whimsy.udel.edu NTP_4_2_5P74 TAG: NTP_4_2_5P74 ntpd/ntpd-opts.c@1.61 +2 -2 NTP_4_2_5P74 ntpd/ntpd-opts.h@1.61 +3 -3 NTP_4_2_5P74 ntpd/ntpd-opts.texi@1.60 +1 -1 NTP_4_2_5P74 ntpd/ntpd.1@1.60 +2 -2 NTP_4_2_5P74 ntpdc/ntpdc-opts.c@1.61 +2 -2 NTP_4_2_5P74 ntpdc/ntpdc-opts.h@1.61 +3 -3 NTP_4_2_5P74 ntpdc/ntpdc-opts.texi@1.60 +1 -1 NTP_4_2_5P74 ntpdc/ntpdc.1@1.60 +2 -2 NTP_4_2_5P74 ntpq/ntpq-opts.c@1.61 +2 -2 NTP_4_2_5P74 ntpq/ntpq-opts.h@1.61 +3 -3 NTP_4_2_5P74 ntpq/ntpq-opts.texi@1.60 +1 -1 NTP_4_2_5P74 ntpq/ntpq.1@1.60 +2 -2 NTP_4_2_5P74 packageinfo.sh@1.77 +1 -1 NTP_4_2_5P74 sntp/sntp-opts.c@1.61 +2 -2 NTP_4_2_5P74 sntp/sntp-opts.h@1.61 +3 -3 NTP_4_2_5P74 sntp/sntp-opts.texi@1.60 +1 -1 NTP_4_2_5P74 sntp/sntp.1@1.60 +2 -2 NTP_4_2_5P74 util/ntp-keygen-opts.c@1.62 +2 -2 NTP_4_2_5P74 util/ntp-keygen-opts.h@1.62 +3 -3 NTP_4_2_5P74 util/ntp-keygen-opts.texi@1.61 +1 -1 NTP_4_2_5P74 util/ntp-keygen.1@1.61 +2 -2 NTP_4_2_5P74 ChangeSet@1.1582.1.6, 2007-09-10 02:32:58-04:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills ChangeLog@1.107 +1 -0 Documentation updates from Dave Mills html/authopt.html@1.42 +56 -54 Documentation updates from Dave Mills html/keygen.html@1.9 +49 -59 Documentation updates from Dave Mills ChangeSet@1.1436.1.82, 2007-09-10 01:57:20-04:00, stenn@whimsy.udel.edu [Bug 902] Fix problems with the -6 flag ChangeLog@1.1.1.33 +1 -0 [Bug 902] Fix problems with the -6 flag libopts/save.c@1.2 +11 -2 [Bug 902] Fix problems with the -6 flag sntp/libopts/save.c@1.2 +11 -2 [Bug 902] Fix problems with the -6 flag ChangeSet@1.1582.1.4, 2007-09-09 07:10:45-04:00, stenn@whimsy.udel.edu crypto fixes from Dave Mills ChangeLog@1.105 +2 -0 crypto fixes from Dave Mills include/ntp.h@1.137 +3 -3 crypto fixes from Dave Mills include/ntp_control.h@1.32 +4 -6 crypto fixes from Dave Mills include/ntpd.h@1.110 +1 -0 crypto fixes from Dave Mills ntpd/ntp_control.c@1.100 +12 -21 crypto fixes from Dave Mills ntpd/ntp_crypto.c@1.115 +472 -540 crypto fixes from Dave Mills ntpd/ntp_peer.c@1.107 +3 -0 crypto fixes from Dave Mills ntpd/ntp_proto.c@1.262 +3 -6 crypto fixes from Dave Mills ChangeSet@1.1582.1.3, 2007-09-09 06:48:21-04:00, stenn@whimsy.udel.edu Avoid double peer stats logging ChangeLog@1.104 +1 -0 Avoid double peer stats logging ntpd/ntp_refclock.c@1.78 +0 -3 Avoid double peer stats logging ChangeSet@1.1582.1.2, 2007-09-09 05:30:21-04:00, stenn@whimsy.udel.edu ntp-keygen cleanup from Dave Mills ChangeLog@1.103 +1 -0 ntp-keygen cleanup from Dave Mills util/ntp-keygen.c@1.44 +187 -146 ntp-keygen cleanup from Dave Mills ChangeSet@1.1582.1.1, 2007-09-09 05:19:17-04:00, stenn@whimsy.udel.edu libopts needs to be built after ElectricFence ChangeLog@1.102 +1 -0 libopts needs to be built after ElectricFence Makefile.am@1.76 +4 -3 libopts needs to be built after ElectricFence ChangeSet@1.1583, 2007-09-06 16:56:06-04:00, murray@pogo.udel.edu Fix for bug 895 ntpd/ntpd.c@1.89 +91 -0 Fix for bug 895 ChangeSet@1.1582, 2007-08-29 07:48:23-04:00, stenn@whimsy.udel.edu NTP_4_2_5P73 TAG: NTP_4_2_5P73 ntpd/ntpd-opts.c@1.60 +2 -2 NTP_4_2_5P73 ntpd/ntpd-opts.h@1.60 +3 -3 NTP_4_2_5P73 ntpd/ntpd-opts.texi@1.59 +1 -1 NTP_4_2_5P73 ntpd/ntpd.1@1.59 +2 -2 NTP_4_2_5P73 ntpdc/ntpdc-opts.c@1.60 +2 -2 NTP_4_2_5P73 ntpdc/ntpdc-opts.h@1.60 +3 -3 NTP_4_2_5P73 ntpdc/ntpdc-opts.texi@1.59 +1 -1 NTP_4_2_5P73 ntpdc/ntpdc.1@1.59 +2 -2 NTP_4_2_5P73 ntpq/ntpq-opts.c@1.60 +2 -2 NTP_4_2_5P73 ntpq/ntpq-opts.h@1.60 +3 -3 NTP_4_2_5P73 ntpq/ntpq-opts.texi@1.59 +1 -1 NTP_4_2_5P73 ntpq/ntpq.1@1.59 +2 -2 NTP_4_2_5P73 packageinfo.sh@1.76 +1 -1 NTP_4_2_5P73 sntp/sntp-opts.c@1.60 +2 -2 NTP_4_2_5P73 sntp/sntp-opts.h@1.60 +3 -3 NTP_4_2_5P73 sntp/sntp-opts.texi@1.59 +1 -1 NTP_4_2_5P73 sntp/sntp.1@1.59 +2 -2 NTP_4_2_5P73 util/ntp-keygen-opts.c@1.61 +2 -2 NTP_4_2_5P73 util/ntp-keygen-opts.h@1.61 +3 -3 NTP_4_2_5P73 util/ntp-keygen-opts.texi@1.60 +1 -1 NTP_4_2_5P73 util/ntp-keygen.1@1.60 +2 -2 NTP_4_2_5P73 ChangeSet@1.1436.1.81, 2007-08-28 15:34:55-04:00, stenn@whimsy.udel.edu NTP_4_2_4P4_RC2 TAG: NTP_4_2_4P4_RC2 ntpd/ntpd-opts.c@1.50.12.1 +4 -4 NTP_4_2_4P4_RC2 ntpd/ntpd-opts.h@1.50.12.1 +4 -4 NTP_4_2_4P4_RC2 ntpd/ntpd-opts.texi@1.49.12.1 +2 -2 NTP_4_2_4P4_RC2 ntpd/ntpd.1@1.48.12.1 +3 -3 NTP_4_2_4P4_RC2 ntpd/ntpdsim-opts.c@1.50.12.1 +4 -4 NTP_4_2_4P4_RC2 ntpd/ntpdsim-opts.h@1.50.12.1 +4 -4 NTP_4_2_4P4_RC2 ntpd/ntpdsim-opts.texi@1.48.12.1 +1 -1 NTP_4_2_4P4_RC2 ntpd/ntpdsim.1@1.48.12.1 +3 -3 NTP_4_2_4P4_RC2 ntpdc/ntpdc-opts.c@1.50.12.1 +4 -4 NTP_4_2_4P4_RC2 ntpdc/ntpdc-opts.h@1.50.12.1 +4 -4 NTP_4_2_4P4_RC2 ntpdc/ntpdc-opts.texi@1.48.12.1 +2 -2 NTP_4_2_4P4_RC2 ntpdc/ntpdc.1@1.48.12.1 +3 -3 NTP_4_2_4P4_RC2 ntpq/ntpq-opts.c@1.52.12.1 +4 -4 NTP_4_2_4P4_RC2 ntpq/ntpq-opts.h@1.52.12.1 +4 -4 NTP_4_2_4P4_RC2 ntpq/ntpq-opts.texi@1.49.12.1 +2 -2 NTP_4_2_4P4_RC2 ntpq/ntpq.1@1.48.12.1 +3 -3 NTP_4_2_4P4_RC2 packageinfo.sh@1.65.18.1 +1 -1 NTP_4_2_4P4_RC2 sntp/sntp-opts.c@1.49.12.1 +2 -2 NTP_4_2_4P4_RC2 sntp/sntp-opts.h@1.49.12.1 +3 -3 NTP_4_2_4P4_RC2 sntp/sntp-opts.texi@1.46.12.1 +1 -1 NTP_4_2_4P4_RC2 sntp/sntp.1@1.49.12.1 +2 -2 NTP_4_2_4P4_RC2 util/ntp-keygen-opts.c@1.49.12.1 +4 -4 NTP_4_2_4P4_RC2 util/ntp-keygen-opts.h@1.49.12.1 +4 -4 NTP_4_2_4P4_RC2 util/ntp-keygen-opts.texi@1.47.12.1 +2 -2 NTP_4_2_4P4_RC2 util/ntp-keygen.1@1.47.12.1 +3 -3 NTP_4_2_4P4_RC2 ChangeSet@1.1580, 2007-08-28 07:52:12-04:00, stenn@whimsy.udel.edu NTP_4_2_5P72 TAG: NTP_4_2_5P72 ntpd/ntpd-opts.c@1.59 +4 -4 NTP_4_2_5P72 ntpd/ntpd-opts.h@1.59 +4 -4 NTP_4_2_5P72 ntpd/ntpd-opts.texi@1.58 +2 -2 NTP_4_2_5P72 ntpd/ntpd.1@1.58 +3 -3 NTP_4_2_5P72 ntpdc/ntpdc-opts.c@1.59 +4 -4 NTP_4_2_5P72 ntpdc/ntpdc-opts.h@1.59 +4 -4 NTP_4_2_5P72 ntpdc/ntpdc-opts.texi@1.58 +2 -2 NTP_4_2_5P72 ntpdc/ntpdc.1@1.58 +3 -3 NTP_4_2_5P72 ntpq/ntpq-opts.c@1.59 +4 -4 NTP_4_2_5P72 ntpq/ntpq-opts.h@1.59 +4 -4 NTP_4_2_5P72 ntpq/ntpq-opts.texi@1.58 +2 -2 NTP_4_2_5P72 ntpq/ntpq.1@1.58 +3 -3 NTP_4_2_5P72 packageinfo.sh@1.75 +1 -1 NTP_4_2_5P72 sntp/sntp-opts.c@1.59 +2 -2 NTP_4_2_5P72 sntp/sntp-opts.h@1.59 +3 -3 NTP_4_2_5P72 sntp/sntp-opts.texi@1.58 +1 -1 NTP_4_2_5P72 sntp/sntp.1@1.58 +2 -2 NTP_4_2_5P72 util/ntp-keygen-opts.c@1.60 +6 -5 NTP_4_2_5P72 util/ntp-keygen-opts.h@1.60 +4 -4 NTP_4_2_5P72 util/ntp-keygen-opts.texi@1.59 +2 -2 NTP_4_2_5P72 util/ntp-keygen.1@1.59 +4 -4 NTP_4_2_5P72 ChangeSet@1.1579, 2007-08-28 00:00:03-04:00, stenn@whimsy.udel.edu [Bug 894] Initialize keysdir before calling crypto_setup() ChangeLog@1.101 +1 -0 [Bug 894] Initialize keysdir before calling crypto_setup() ChangeSet@1.1576.1.2, 2007-08-27 23:42:20-04:00, stenn@whimsy.udel.edu ntp-keygen-opts.def: ntp-keygen -i takes an arg ntpq.c: Calysto cleanup for ntpq. Many files: Cleanup from Dave Mills ChangeLog: Cleanup from Dave Mills. Coverity fix for ntpq. ntp-keygen -i takes an arg. ChangeLog@1.100 +3 -0 Cleanup from Dave Mills. Coverity fix for ntpq. ntp-keygen -i takes an arg. include/ntp.h@1.136 +3 -5 Cleanup from Dave Mills include/ntp_crypto.h@1.42 +20 -14 Cleanup from Dave Mills include/ntpd.h@1.109 +2 -1 Cleanup from Dave Mills ntpd/ntp_control.c@1.99 +23 -28 Cleanup from Dave Mills ntpd/ntp_crypto.c@1.114 +337 -345 Cleanup from Dave Mills ntpd/ntp_parser.c@1.20 +578 -586 Cleanup from Dave Mills ntpd/ntp_parser.y@1.16 +0 -2 Cleanup from Dave Mills ntpd/ntp_proto.c@1.261 +30 -43 Cleanup from Dave Mills ntpq/ntpq.c@1.70 +2 -0 Calysto cleanup for ntpq. util/ntp-keygen-opts.def@1.9 +2 -0 ntp-keygen -i takes an arg util/ntp-keygen.c@1.43 +188 -200 Cleanup from Dave Mills ChangeSet@1.1436.1.80, 2007-08-27 22:38:57-04:00, stenn@whimsy.udel.edu Updated include/copyright.def (owner and year) ChangeLog@1.1.1.32 +1 -0 Updated include/copyright.def (owner and year) include/copyright.def@1.5 +2 -2 Updated include/copyright.def (owner and year) ChangeSet@1.1577, 2007-08-25 13:22:24+00:00, kardel@pogo.udel.edu ntp_config.c: Bug 894: initialize keysdir BEFORE crypto_setup() is called - so it has a fair chance to find the keys. ntpd/ntp_config.c@1.164 +5 -4 Bug 894: initialize keysdir BEFORE crypto_setup() is called - so it has a fair chance to find the keys. ChangeSet@1.1576, 2007-08-19 07:45:24-04:00, stenn@whimsy.udel.edu NTP_4_2_5P71 TAG: NTP_4_2_5P71 ntpd/ntpd-opts.c@1.58 +2 -2 NTP_4_2_5P71 ntpd/ntpd-opts.h@1.58 +3 -3 NTP_4_2_5P71 ntpd/ntpd-opts.texi@1.57 +1 -1 NTP_4_2_5P71 ntpd/ntpd.1@1.57 +2 -2 NTP_4_2_5P71 ntpdc/ntpdc-opts.c@1.58 +2 -2 NTP_4_2_5P71 ntpdc/ntpdc-opts.h@1.58 +3 -3 NTP_4_2_5P71 ntpdc/ntpdc-opts.texi@1.57 +1 -1 NTP_4_2_5P71 ntpdc/ntpdc.1@1.57 +2 -2 NTP_4_2_5P71 ntpq/ntpq-opts.c@1.58 +2 -2 NTP_4_2_5P71 ntpq/ntpq-opts.h@1.58 +3 -3 NTP_4_2_5P71 ntpq/ntpq-opts.texi@1.57 +1 -1 NTP_4_2_5P71 ntpq/ntpq.1@1.57 +2 -2 NTP_4_2_5P71 packageinfo.sh@1.74 +1 -1 NTP_4_2_5P71 sntp/sntp-opts.c@1.58 +2 -2 NTP_4_2_5P71 sntp/sntp-opts.h@1.58 +3 -3 NTP_4_2_5P71 sntp/sntp-opts.texi@1.57 +1 -1 NTP_4_2_5P71 sntp/sntp.1@1.57 +2 -2 NTP_4_2_5P71 util/ntp-keygen-opts.c@1.59 +2 -2 NTP_4_2_5P71 util/ntp-keygen-opts.h@1.59 +3 -3 NTP_4_2_5P71 util/ntp-keygen-opts.texi@1.58 +1 -1 NTP_4_2_5P71 util/ntp-keygen.1@1.58 +2 -2 NTP_4_2_5P71 ChangeSet@1.1436.1.79, 2007-08-19 05:26:13-04:00, dunlop@pogo.udel.edu ntpdc_ops.c, ChangeLog: [BUG 881] Corrected display of pll offset on 64bit systems. [BUG 886] Corrected sign extension of il->compliance on 64 bit systems [BUG 878] Avoid ntpdc use of refid value as unterminated string. ChangeLog@1.1.1.31 +1 -0 [Bug 878] Avoid ntpdc use of refid value as unterminated string. ChangeLog@1.1.1.30 +1 -0 [Bug 881] Corrected display of pll offset on 64bit systems. ChangeLog@1.1.1.29 +1 -0 [BUG 886] Corrected sign extension of il->compliance on 64 bit systems ntpdc/ntpdc_ops.c@1.46.1.3 +1 -3 [Bug 878] Avoid ntpdc use of refid value as unterminated string. ntpdc/ntpdc_ops.c@1.46.1.2 +1 -1 [Bug 881] Corrected display of pll offset on 64bit systems. ntpdc/ntpdc_ops.c@1.46.1.1 +2 -2 [BUG 886] Corrected sign extension of il->compliance on 64 bit systems ChangeSet@1.1575, 2007-08-19 08:35:04+00:00, stenn@ntp1.isc.org [Bug 887] Fix error in ntp_types.h (for sizeof int != 4) ChangeLog@1.98 +1 -0 [Bug 887] Fix error in ntp_types.h (for sizeof int != 4) dot.emacs@1.8 +4 -3 updates include/ntp_types.h@1.10 +2 -2 [Bug 887] Fix error in ntp_types.h (for sizeof int != 4) ChangeSet@1.1574, 2007-08-18 19:14:33-04:00, stenn@whimsy.udel.edu NTP_4_2_5P70 TAG: NTP_4_2_5P70 ntpd/ntpd-opts.c@1.57 +2 -2 NTP_4_2_5P70 ntpd/ntpd-opts.h@1.57 +3 -3 NTP_4_2_5P70 ntpd/ntpd-opts.texi@1.56 +1 -1 NTP_4_2_5P70 ntpd/ntpd.1@1.56 +2 -2 NTP_4_2_5P70 ntpdc/ntpdc-opts.c@1.57 +2 -2 NTP_4_2_5P70 ntpdc/ntpdc-opts.h@1.57 +3 -3 NTP_4_2_5P70 ntpdc/ntpdc-opts.texi@1.56 +1 -1 NTP_4_2_5P70 ntpdc/ntpdc.1@1.56 +2 -2 NTP_4_2_5P70 ntpq/ntpq-opts.c@1.57 +2 -2 NTP_4_2_5P70 ntpq/ntpq-opts.h@1.57 +3 -3 NTP_4_2_5P70 ntpq/ntpq-opts.texi@1.56 +1 -1 NTP_4_2_5P70 ntpq/ntpq.1@1.56 +2 -2 NTP_4_2_5P70 packageinfo.sh@1.73 +1 -1 NTP_4_2_5P70 sntp/sntp-opts.c@1.57 +2 -2 NTP_4_2_5P70 sntp/sntp-opts.h@1.57 +3 -3 NTP_4_2_5P70 sntp/sntp-opts.texi@1.56 +1 -1 NTP_4_2_5P70 sntp/sntp.1@1.56 +2 -2 NTP_4_2_5P70 util/ntp-keygen-opts.c@1.58 +2 -2 NTP_4_2_5P70 util/ntp-keygen-opts.h@1.58 +3 -3 NTP_4_2_5P70 util/ntp-keygen-opts.texi@1.57 +1 -1 NTP_4_2_5P70 util/ntp-keygen.1@1.57 +2 -2 NTP_4_2_5P70 ChangeSet@1.1436.1.78, 2007-08-18 17:11:19-04:00, stenn@whimsy.udel.edu NTP_4_2_4P4_RC1 TAG: NTP_4_2_4P4_RC1 ntpd/ntpd-opts.c@1.50.11.1 +2 -2 NTP_4_2_4P4_RC1 ntpd/ntpd-opts.h@1.50.11.1 +3 -3 NTP_4_2_4P4_RC1 ntpd/ntpd-opts.texi@1.49.11.1 +2 -2 NTP_4_2_4P4_RC1 ntpd/ntpd.1@1.48.11.1 +2 -2 NTP_4_2_4P4_RC1 ntpd/ntpdsim-opts.c@1.50.11.1 +2 -2 NTP_4_2_4P4_RC1 ntpd/ntpdsim-opts.h@1.50.11.1 +3 -3 NTP_4_2_4P4_RC1 ntpd/ntpdsim-opts.texi@1.48.11.1 +1 -1 NTP_4_2_4P4_RC1 ntpd/ntpdsim.1@1.48.11.1 +2 -2 NTP_4_2_4P4_RC1 ntpdc/ntpdc-opts.c@1.50.11.1 +2 -2 NTP_4_2_4P4_RC1 ntpdc/ntpdc-opts.h@1.50.11.1 +3 -3 NTP_4_2_4P4_RC1 ntpdc/ntpdc-opts.texi@1.48.11.1 +2 -2 NTP_4_2_4P4_RC1 ntpdc/ntpdc.1@1.48.11.1 +2 -2 NTP_4_2_4P4_RC1 ntpq/ntpq-opts.c@1.52.11.1 +2 -2 NTP_4_2_4P4_RC1 ntpq/ntpq-opts.h@1.52.11.1 +3 -3 NTP_4_2_4P4_RC1 ntpq/ntpq-opts.texi@1.49.11.1 +2 -2 NTP_4_2_4P4_RC1 ntpq/ntpq.1@1.48.11.1 +2 -2 NTP_4_2_4P4_RC1 packageinfo.sh@1.65.17.2 +2 -2 NTP_4_2_4P4_RC1 sntp/sntp-opts.c@1.49.11.1 +2 -2 NTP_4_2_4P4_RC1 sntp/sntp-opts.h@1.49.11.1 +3 -3 NTP_4_2_4P4_RC1 sntp/sntp-opts.texi@1.46.11.1 +1 -1 NTP_4_2_4P4_RC1 sntp/sntp.1@1.49.11.1 +2 -2 NTP_4_2_4P4_RC1 util/ntp-keygen-opts.c@1.49.11.1 +2 -2 NTP_4_2_4P4_RC1 util/ntp-keygen-opts.h@1.49.11.1 +3 -3 NTP_4_2_4P4_RC1 util/ntp-keygen-opts.texi@1.47.11.1 +2 -2 NTP_4_2_4P4_RC1 util/ntp-keygen.1@1.47.11.1 +2 -2 NTP_4_2_4P4_RC1 ChangeSet@1.1436.1.77, 2007-08-18 16:16:22-04:00, stenn@whimsy.udel.edu 4.2.4p4-RC packageinfo.sh@1.65.17.1 +1 -1 4.2.4p4-RC ChangeSet@1.1436.1.76, 2007-08-18 12:59:45+00:00, kardel@pogo.udel.edu ntp_restrict.c: Bug 885: clarify to allow tools to pick up invariants easier. Use NULL instead of 0 with pointers. ChangeLog: document ntp_restrict.c change ChangeLog@1.1.1.28 +1 -0 document ntp_restrict.c change ntpd/ntp_restrict.c@1.22.1.1 +21 -21 Bug 885: clarify to allow tools to pick up invariants easier. Use NULL instead of 0 with pointers. ChangeSet@1.1436.1.75, 2007-08-18 12:53:35+00:00, kardel@pogo.udel.edu recvbuff.c: Bug 889: avoid malloc() interrupted by SIGIO risk ChangeLog: document Bug 889 ChangeLog@1.1.1.27 +1 -0 document Bug 889 libntp/recvbuff.c@1.26 +28 -21 Bug 889: avoid malloc() interrupted by SIGIO risk ChangeSet@1.1572, 2007-08-18 07:46:58-04:00, stenn@whimsy.udel.edu NTP_4_2_5P69 TAG: NTP_4_2_5P69 ntpd/ntpd-opts.c@1.56 +2 -2 NTP_4_2_5P69 ntpd/ntpd-opts.h@1.56 +3 -3 NTP_4_2_5P69 ntpd/ntpd-opts.texi@1.55 +1 -1 NTP_4_2_5P69 ntpd/ntpd.1@1.55 +2 -2 NTP_4_2_5P69 ntpdc/ntpdc-opts.c@1.56 +2 -2 NTP_4_2_5P69 ntpdc/ntpdc-opts.h@1.56 +3 -3 NTP_4_2_5P69 ntpdc/ntpdc-opts.texi@1.55 +1 -1 NTP_4_2_5P69 ntpdc/ntpdc.1@1.55 +2 -2 NTP_4_2_5P69 ntpq/ntpq-opts.c@1.56 +2 -2 NTP_4_2_5P69 ntpq/ntpq-opts.h@1.56 +3 -3 NTP_4_2_5P69 ntpq/ntpq-opts.texi@1.55 +1 -1 NTP_4_2_5P69 ntpq/ntpq.1@1.55 +2 -2 NTP_4_2_5P69 packageinfo.sh@1.72 +1 -1 NTP_4_2_5P69 sntp/sntp-opts.c@1.56 +2 -2 NTP_4_2_5P69 sntp/sntp-opts.h@1.56 +3 -3 NTP_4_2_5P69 sntp/sntp-opts.texi@1.55 +1 -1 NTP_4_2_5P69 sntp/sntp.1@1.55 +2 -2 NTP_4_2_5P69 util/ntp-keygen-opts.c@1.57 +2 -2 NTP_4_2_5P69 util/ntp-keygen-opts.h@1.57 +3 -3 NTP_4_2_5P69 util/ntp-keygen-opts.texi@1.56 +1 -1 NTP_4_2_5P69 util/ntp-keygen.1@1.56 +2 -2 NTP_4_2_5P69 ChangeSet@1.1436.1.74, 2007-08-18 09:51:41+00:00, kardel@pogo.udel.edu cmd_args.c: Bug 885: fix comparison ntpd/cmd_args.c@1.45.3.2 +1 -1 Bug 885: fix comparison ChangeSet@1.1570, 2007-08-18 04:07:51-04:00, stenn@pogo.udel.edu merge cleanup ChangeLog@1.95.1.2 +13 -0 merge cleanup ChangeSet@1.1564.2.2, 2007-08-17 07:46:18-04:00, stenn@whimsy.udel.edu NTP_4_2_5P68 TAG: NTP_4_2_5P68 ntpd/ntpd-opts.c@1.55 +2 -2 NTP_4_2_5P68 ntpd/ntpd-opts.h@1.55 +3 -3 NTP_4_2_5P68 ntpd/ntpd-opts.texi@1.54 +2 -2 NTP_4_2_5P68 ntpd/ntpd.1@1.54 +2 -2 NTP_4_2_5P68 ntpdc/ntpdc-opts.c@1.55 +2 -2 NTP_4_2_5P68 ntpdc/ntpdc-opts.h@1.55 +3 -3 NTP_4_2_5P68 ntpdc/ntpdc-opts.texi@1.54 +2 -2 NTP_4_2_5P68 ntpdc/ntpdc.1@1.54 +2 -2 NTP_4_2_5P68 ntpq/ntpq-opts.c@1.55 +2 -2 NTP_4_2_5P68 ntpq/ntpq-opts.h@1.55 +3 -3 NTP_4_2_5P68 ntpq/ntpq-opts.texi@1.54 +2 -2 NTP_4_2_5P68 ntpq/ntpq.1@1.54 +2 -2 NTP_4_2_5P68 packageinfo.sh@1.71 +1 -1 NTP_4_2_5P68 sntp/sntp-opts.c@1.55 +2 -2 NTP_4_2_5P68 sntp/sntp-opts.h@1.55 +3 -3 NTP_4_2_5P68 sntp/sntp-opts.texi@1.54 +1 -1 NTP_4_2_5P68 sntp/sntp.1@1.54 +2 -2 NTP_4_2_5P68 util/ntp-keygen-opts.c@1.56 +2 -2 NTP_4_2_5P68 util/ntp-keygen-opts.h@1.56 +3 -3 NTP_4_2_5P68 util/ntp-keygen-opts.texi@1.55 +2 -2 NTP_4_2_5P68 util/ntp-keygen.1@1.55 +2 -2 NTP_4_2_5P68 ChangeSet@1.1436.6.1, 2007-08-17 05:28:07-04:00, stenn@pogo.udel.edu Use autoconf-2.59 and automake-1.9 for building 4.2.4 bootstrap@1.18.1.1 +18 -2 Use autoconf-2.59 and automake-1.9 for building 4.2.4 ChangeSet@1.1564.2.1, 2007-08-17 01:38:48-04:00, stenn@whimsy.udel.edu Cleanup from Dave Mills html/assoc.html@1.22 +22 -13 Cleanup from Dave Mills html/index.html@1.34 +6 -6 Cleanup from Dave Mills html/release.html@1.32 +7 -9 Cleanup from Dave Mills include/ntp.h@1.135 +11 -10 Cleanup from Dave Mills include/ntp_crypto.h@1.41 +21 -17 Cleanup from Dave Mills include/ntp_refclock.h@1.22 +1 -1 Cleanup from Dave Mills include/ntp_request.h@1.33 +2 -2 Cleanup from Dave Mills include/ntpd.h@1.108 +12 -12 Cleanup from Dave Mills libntp/statestr.c@1.12 +1 -1 Cleanup from Dave Mills ntpd/ntp_config.c@1.161.1.1 +6 -9 Cleanup from Dave Mills ntpd/ntp_control.c@1.98 +8 -5 Cleanup from Dave Mills ntpd/ntp_crypto.c@1.113 +175 -101 Cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.139 +85 -77 Cleanup from Dave Mills ntpd/ntp_parser.c@1.19 +239 -261 Cleanup from Dave Mills ntpd/ntp_parser.y@1.15 +1 -23 Cleanup from Dave Mills ntpd/ntp_peer.c@1.106 +4 -14 Cleanup from Dave Mills ntpd/ntp_proto.c@1.260 +390 -490 Cleanup from Dave Mills ntpd/ntp_refclock.c@1.77 +4 -6 Cleanup from Dave Mills ntpd/ntp_request.c@1.69 +4 -4 Cleanup from Dave Mills ntpd/ntp_restrict.c@1.23 +2 -2 Cleanup from Dave Mills ntpd/ntp_timer.c@1.40 +7 -20 Cleanup from Dave Mills ntpd/ntp_util.c@1.59 +1 -3 Cleanup from Dave Mills ntpd/ntpd.c@1.88 +6 -21 Cleanup from Dave Mills ntpd/ntpsim.c@1.18 +1 -1 Cleanup from Dave Mills ntpd/refclock_acts.c@1.31 +1 -3 Cleanup from Dave Mills ntpdate/ntpdate.c@1.63 +2 -2 Cleanup from Dave Mills ntpdate/ntpdate.h@1.9 +1 -1 Cleanup from Dave Mills ntpq/ntpq.c@1.69 +4 -4 Cleanup from Dave Mills ChangeSet@1.1564.1.4, 2007-08-14 23:01:09-04:00, mayer@pogo.udel.edu Bug 880 fixes ChangeLog@1.96 +1 -0 Bug 880 fixes ChangeSet@1.1564.1.3, 2007-08-14 22:55:12-04:00, mayer@pogo.udel.edu Bug 880 bug fixes for Windows build ntpd/ntp_data_structures.c@1.6 +1 -0 Bug 880 Include missing. Needed for emalloc prototype ports/winnt/ntpd/nt_clockstuff.c@1.24 +1 -1 Bug 880 Use leap_sec instead of leap_next ChangeSet@1.1436.1.72, 2007-08-11 17:32:22+00:00, kardel@pogo.udel.edu ChangeLog: document refclock_parse.c fix ChangeLog@1.1.1.26 +1 -0 document refclock_parse.c fix ChangeSet@1.1436.1.71, 2007-08-11 17:30:42+00:00, kardel@pogo.udel.edu ChangeLog: document Bug 885 ntp_io.c: Bug 885: use emalloc() to get a message at the end of the memory cmd_args.c: Bug 885: unsigned types cannot be less than 0 default_ai_family is a short ntp_config.c: Bug 885: lose trailing , from enum list ChangeLog@1.1.1.25 +4 -0 document Bug 885 ntpd/cmd_args.c@1.45.3.1 +2 -2 Bug 885: unsigned types cannot be less than 0 default_ai_family is a short ntpd/ntp_config.c@1.141.1.1 +1 -1 Bug 885: lose trailing , from enum list ntpd/ntp_io.c@1.244.2.9 +1 -1 Bug 885: use emalloc() to get a message at the end of the memory ChangeSet@1.1436.1.70, 2007-08-11 17:19:45+00:00, kardel@pogo.udel.edu refclock_parse.c: remove io binding before io_closeclock() closes the file descriptor ntpd/refclock_parse.c@1.47.1.1 +25 -10 remove io binding before io_closeclock() closes the file descriptor ChangeSet@1.1436.1.69, 2007-08-09 20:30:55+00:00, kardel@pogo.udel.edu ChangeLog: [Bug 882] allow loopback interfaces to share addresses with other interfaces. [Bug 884] don't access recv buffers after having them passed to the free list. ChangeLog@1.1.1.24 +3 -0 [Bug 882] allow loopback interfaces to share addresses with other interfaces. [Bug 884] don't access recv buffers after having them passed to the free list. ChangeSet@1.1436.1.68, 2007-08-09 19:05:17+00:00, kardel@pogo.udel.edu ntp_io.c: Bug 884: no access to recv buffers after they are returned to free pool ntpd/ntp_io.c@1.244.2.8 +9 -7 Bug 884: no access to recv buffers after they are returned to free pool ChangeSet@1.1564.1.2, 2007-08-09 07:43:48-04:00, stenn@whimsy.udel.edu NTP_4_2_5P67 TAG: NTP_4_2_5P67 ntpd/ntpd-opts.c@1.54 +2 -2 NTP_4_2_5P67 ntpd/ntpd-opts.h@1.54 +3 -3 NTP_4_2_5P67 ntpd/ntpd-opts.texi@1.53 +2 -2 NTP_4_2_5P67 ntpd/ntpd.1@1.53 +2 -2 NTP_4_2_5P67 ntpdc/ntpdc-opts.c@1.54 +2 -2 NTP_4_2_5P67 ntpdc/ntpdc-opts.h@1.54 +3 -3 NTP_4_2_5P67 ntpdc/ntpdc-opts.texi@1.53 +2 -2 NTP_4_2_5P67 ntpdc/ntpdc.1@1.53 +2 -2 NTP_4_2_5P67 ntpq/ntpq-opts.c@1.54 +2 -2 NTP_4_2_5P67 ntpq/ntpq-opts.h@1.54 +3 -3 NTP_4_2_5P67 ntpq/ntpq-opts.texi@1.53 +2 -2 NTP_4_2_5P67 ntpq/ntpq.1@1.53 +2 -2 NTP_4_2_5P67 packageinfo.sh@1.70 +1 -1 NTP_4_2_5P67 sntp/sntp-opts.c@1.54 +2 -2 NTP_4_2_5P67 sntp/sntp-opts.h@1.54 +3 -3 NTP_4_2_5P67 sntp/sntp-opts.texi@1.53 +1 -1 NTP_4_2_5P67 sntp/sntp.1@1.53 +2 -2 NTP_4_2_5P67 util/ntp-keygen-opts.c@1.55 +2 -2 NTP_4_2_5P67 util/ntp-keygen-opts.h@1.55 +3 -3 NTP_4_2_5P67 util/ntp-keygen-opts.texi@1.54 +2 -2 NTP_4_2_5P67 util/ntp-keygen.1@1.54 +2 -2 NTP_4_2_5P67 ChangeSet@1.1564.1.1, 2007-08-08 20:33:49-04:00, stenn@whimsy.udel.edu Improve Calysto support ChangeLog@1.95 +1 -0 Improve Calysto support include/ntp_assert.h@1.2 +12 -0 Improve Calysto support ChangeSet@1.1436.1.67, 2007-08-07 18:14:16+00:00, kardel@pogo.udel.edu ntp_io.c: Bug 882: loopback interfaces may share IP addresses with other interfaces thus allow addresses also found on loopback interfaces to be used as local address. ntpd/ntp_io.c@1.244.2.7 +1 -1 Bug 882: loopback interfaces may share IP addresses with other interfaces thus allow addresses also found on loopback interfaces to be used as local address. ChangeSet@1.1564, 2007-08-07 07:44:49-04:00, stenn@whimsy.udel.edu NTP_4_2_5P66 TAG: NTP_4_2_5P66 ntpd/ntpd-opts.c@1.53 +2 -2 NTP_4_2_5P66 ntpd/ntpd-opts.h@1.53 +3 -3 NTP_4_2_5P66 ntpd/ntpd-opts.texi@1.52 +1 -1 NTP_4_2_5P66 ntpd/ntpd.1@1.52 +2 -2 NTP_4_2_5P66 ntpdc/ntpdc-opts.c@1.53 +2 -2 NTP_4_2_5P66 ntpdc/ntpdc-opts.h@1.53 +3 -3 NTP_4_2_5P66 ntpdc/ntpdc-opts.texi@1.52 +1 -1 NTP_4_2_5P66 ntpdc/ntpdc.1@1.52 +2 -2 NTP_4_2_5P66 ntpq/ntpq-opts.c@1.53 +2 -2 NTP_4_2_5P66 ntpq/ntpq-opts.h@1.53 +3 -3 NTP_4_2_5P66 ntpq/ntpq-opts.texi@1.52 +1 -1 NTP_4_2_5P66 ntpq/ntpq.1@1.52 +2 -2 NTP_4_2_5P66 packageinfo.sh@1.69 +1 -1 NTP_4_2_5P66 sntp/sntp-opts.c@1.53 +2 -2 NTP_4_2_5P66 sntp/sntp-opts.h@1.53 +3 -3 NTP_4_2_5P66 sntp/sntp-opts.texi@1.52 +1 -1 NTP_4_2_5P66 sntp/sntp.1@1.52 +2 -2 NTP_4_2_5P66 util/ntp-keygen-opts.c@1.54 +2 -2 NTP_4_2_5P66 util/ntp-keygen-opts.h@1.54 +3 -3 NTP_4_2_5P66 util/ntp-keygen-opts.texi@1.53 +1 -1 NTP_4_2_5P66 util/ntp-keygen.1@1.53 +2 -2 NTP_4_2_5P66 ChangeSet@1.1563, 2007-08-07 03:10:48-04:00, stenn@whimsy.udel.edu The "revoke" parameter is a crypto command ChangeLog@1.94 +1 -0 The "revoke" parameter is a crypto command ntpd/ntp_parser.c@1.18 +183 -193 The "revoke" parameter is a crypto command ntpd/ntp_parser.y@1.14 +11 -11 The "revoke" parameter is a crypto command ChangeSet@1.1562, 2007-08-07 01:21:53-04:00, stenn@whimsy.udel.edu The driftfile wander threshold is a real number ChangeLog@1.93 +1 -0 The driftfile wander threshold is a real number ntpd/ntp_parser.c@1.17 +151 -141 The driftfile wander threshold is a real number ChangeSet@1.1561, 2007-08-05 07:44:12-04:00, stenn@whimsy.udel.edu NTP_4_2_5P65 TAG: NTP_4_2_5P65 ntpd/ntpd-opts.c@1.52 +2 -2 NTP_4_2_5P65 ntpd/ntpd-opts.h@1.52 +3 -3 NTP_4_2_5P65 ntpd/ntpd-opts.texi@1.51 +1 -1 NTP_4_2_5P65 ntpd/ntpd.1@1.51 +2 -2 NTP_4_2_5P65 ntpdc/ntpdc-opts.c@1.52 +2 -2 NTP_4_2_5P65 ntpdc/ntpdc-opts.h@1.52 +3 -3 NTP_4_2_5P65 ntpdc/ntpdc-opts.texi@1.51 +1 -1 NTP_4_2_5P65 ntpdc/ntpdc.1@1.51 +2 -2 NTP_4_2_5P65 ntpq/ntpq-opts.c@1.52 +2 -2 NTP_4_2_5P65 ntpq/ntpq-opts.h@1.52 +3 -3 NTP_4_2_5P65 ntpq/ntpq-opts.texi@1.51 +1 -1 NTP_4_2_5P65 ntpq/ntpq.1@1.51 +2 -2 NTP_4_2_5P65 packageinfo.sh@1.68 +1 -1 NTP_4_2_5P65 sntp/sntp-opts.c@1.52 +2 -2 NTP_4_2_5P65 sntp/sntp-opts.h@1.52 +3 -3 NTP_4_2_5P65 sntp/sntp-opts.texi@1.51 +1 -1 NTP_4_2_5P65 sntp/sntp.1@1.51 +2 -2 NTP_4_2_5P65 util/ntp-keygen-opts.c@1.53 +2 -2 NTP_4_2_5P65 util/ntp-keygen-opts.h@1.53 +3 -3 NTP_4_2_5P65 util/ntp-keygen-opts.texi@1.52 +1 -1 NTP_4_2_5P65 util/ntp-keygen.1@1.52 +2 -2 NTP_4_2_5P65 ChangeSet@1.1560, 2007-08-04 16:51:04-04:00, stenn@whimsy.udel.edu [Bug 850] Fix the wander threshold parameter on the driftfile command ChangeLog@1.92 +1 -0 [Bug 850] Fix the wander threshold parameter on the driftfile command ntpd/ntp_parser.c@1.16 +142 -152 [Bug 850] Fix the wander threshold parameter on the driftfile command ntpd/ntp_parser.y@1.13 +1 -1 [Bug 850] Fix the wander threshold parameter on the driftfile command ChangeSet@1.1559, 2007-07-30 07:45:28-04:00, stenn@whimsy.udel.edu NTP_4_2_5P64 TAG: NTP_4_2_5P64 ntpd/ntpd-opts.c@1.51 +2 -2 NTP_4_2_5P64 ntpd/ntpd-opts.h@1.51 +3 -3 NTP_4_2_5P64 ntpd/ntpd-opts.texi@1.50 +2 -2 NTP_4_2_5P64 ntpd/ntpd.1@1.50 +2 -2 NTP_4_2_5P64 ntpdc/ntpdc-opts.c@1.51 +2 -2 NTP_4_2_5P64 ntpdc/ntpdc-opts.h@1.51 +3 -3 NTP_4_2_5P64 ntpdc/ntpdc-opts.texi@1.50 +2 -2 NTP_4_2_5P64 ntpdc/ntpdc.1@1.50 +2 -2 NTP_4_2_5P64 ntpq/ntpq-opts.c@1.51 +2 -2 NTP_4_2_5P64 ntpq/ntpq-opts.h@1.51 +3 -3 NTP_4_2_5P64 ntpq/ntpq-opts.texi@1.50 +2 -2 NTP_4_2_5P64 ntpq/ntpq.1@1.50 +2 -2 NTP_4_2_5P64 packageinfo.sh@1.67 +1 -1 NTP_4_2_5P64 sntp/sntp-opts.c@1.51 +2 -2 NTP_4_2_5P64 sntp/sntp-opts.h@1.51 +3 -3 NTP_4_2_5P64 sntp/sntp-opts.texi@1.50 +1 -1 NTP_4_2_5P64 sntp/sntp.1@1.50 +2 -2 NTP_4_2_5P64 util/ntp-keygen-opts.c@1.52 +2 -2 NTP_4_2_5P64 util/ntp-keygen-opts.h@1.52 +3 -3 NTP_4_2_5P64 util/ntp-keygen-opts.texi@1.51 +2 -2 NTP_4_2_5P64 util/ntp-keygen.1@1.51 +2 -2 NTP_4_2_5P64 ChangeSet@1.1558, 2007-07-29 15:44:57-04:00, stenn@whimsy.udel.edu ntp_peer.c, ChangeLog: Set peer->srcadr before (not after) calling set_peerdstadr() ntp_util.c, ChangeLog: Leap file related cleanup from Dave Mills ntp_io.c, ChangeLog: Dead code cleanup - Coverity View 19 ChangeLog@1.91 +1 -0 Dead code cleanup - Coverity View 19 ChangeLog@1.90 +1 -0 Leap file related cleanup from Dave Mills ChangeLog@1.89 +1 -0 Set peer->srcadr before (not after) calling set_peerdstadr() ntpd/ntp_io.c@1.259 +0 -13 Dead code cleanup - Coverity View 19 ntpd/ntp_peer.c@1.105 +11 -15 Set peer->srcadr before (not after) calling set_peerdstadr() ntpd/ntp_util.c@1.58 +21 -37 Leap file related cleanup from Dave Mills ChangeSet@1.1557, 2007-07-29 07:44:44-04:00, stenn@whimsy.udel.edu NTP_4_2_5P63 TAG: NTP_4_2_5P63 ntpd/ntpd-opts.c@1.50 +2 -2 NTP_4_2_5P63 ntpd/ntpd-opts.h@1.50 +3 -3 NTP_4_2_5P63 ntpd/ntpd-opts.texi@1.49 +2 -2 NTP_4_2_5P63 ntpd/ntpd.1@1.49 +2 -2 NTP_4_2_5P63 ntpdc/ntpdc-opts.c@1.50 +2 -2 NTP_4_2_5P63 ntpdc/ntpdc-opts.h@1.50 +3 -3 NTP_4_2_5P63 ntpdc/ntpdc-opts.texi@1.49 +2 -2 NTP_4_2_5P63 ntpdc/ntpdc.1@1.49 +2 -2 NTP_4_2_5P63 ntpq/ntpq-opts.c@1.50 +2 -2 NTP_4_2_5P63 ntpq/ntpq-opts.h@1.50 +3 -3 NTP_4_2_5P63 ntpq/ntpq-opts.texi@1.49 +2 -2 NTP_4_2_5P63 ntpq/ntpq.1@1.49 +2 -2 NTP_4_2_5P63 packageinfo.sh@1.66 +1 -1 NTP_4_2_5P63 sntp/sntp-opts.c@1.50 +2 -2 NTP_4_2_5P63 sntp/sntp-opts.h@1.50 +3 -3 NTP_4_2_5P63 sntp/sntp-opts.texi@1.49 +1 -1 NTP_4_2_5P63 sntp/sntp.1@1.49 +2 -2 NTP_4_2_5P63 util/ntp-keygen-opts.c@1.51 +2 -2 NTP_4_2_5P63 util/ntp-keygen-opts.h@1.51 +3 -3 NTP_4_2_5P63 util/ntp-keygen-opts.texi@1.50 +2 -2 NTP_4_2_5P63 util/ntp-keygen.1@1.50 +2 -2 NTP_4_2_5P63 ChangeSet@1.1556, 2007-07-29 02:30:13-04:00, stenn@whimsy.udel.edu Initialize offset in leap_file() - Coverity View 17 ChangeLog@1.88 +1 -0 Initialize offset in leap_file() - Coverity View 17 ntpd/ntp_util.c@1.57 +2 -1 Initialize offset in leap_file() - Coverity View 17 ChangeSet@1.1555, 2007-07-28 07:44:54-04:00, stenn@whimsy.udel.edu NTP_4_2_5P62 TAG: NTP_4_2_5P62 ntpd/ntpd-opts.c@1.49 +2 -2 NTP_4_2_5P62 ntpd/ntpd-opts.h@1.49 +3 -3 NTP_4_2_5P62 ntpd/ntpd-opts.texi@1.48 +1 -1 NTP_4_2_5P62 ntpd/ntpd.1@1.48 +2 -2 NTP_4_2_5P62 ntpdc/ntpdc-opts.c@1.49 +2 -2 NTP_4_2_5P62 ntpdc/ntpdc-opts.h@1.49 +3 -3 NTP_4_2_5P62 ntpdc/ntpdc-opts.texi@1.48 +1 -1 NTP_4_2_5P62 ntpdc/ntpdc.1@1.48 +2 -2 NTP_4_2_5P62 ntpq/ntpq-opts.c@1.49 +2 -2 NTP_4_2_5P62 ntpq/ntpq-opts.h@1.49 +3 -3 NTP_4_2_5P62 ntpq/ntpq-opts.texi@1.48 +1 -1 NTP_4_2_5P62 ntpq/ntpq.1@1.48 +2 -2 NTP_4_2_5P62 packageinfo.sh@1.65 +1 -1 NTP_4_2_5P62 sntp/sntp-opts.c@1.49 +2 -2 NTP_4_2_5P62 sntp/sntp-opts.h@1.49 +3 -3 NTP_4_2_5P62 sntp/sntp-opts.texi@1.48 +1 -1 NTP_4_2_5P62 sntp/sntp.1@1.48 +2 -2 NTP_4_2_5P62 util/ntp-keygen-opts.c@1.50 +2 -2 NTP_4_2_5P62 util/ntp-keygen-opts.h@1.50 +3 -3 NTP_4_2_5P62 util/ntp-keygen-opts.texi@1.49 +1 -1 NTP_4_2_5P62 util/ntp-keygen.1@1.49 +2 -2 NTP_4_2_5P62 ChangeSet@1.1554, 2007-07-28 02:22:13-04:00, stenn@whimsy.udel.edu (ChangeLog entries for previous changeset) ChangeLog@1.87 +3 -0 ChangeSet@1.1553, 2007-07-27 23:47:45-04:00, stenn@whimsy.udel.edu systime.c: fuzz cleanup ntp_loopfilter.c, ntp_proto.c: Show more digits during some debug printfs. Use the correct packet stratum in KISS codes. libntp/systime.c@1.43 +2 -2 fuzz cleanup ntpd/ntp_loopfilter.c@1.138 +1 -1 Show more digits during some debug printfs. Use the correct packet stratum in KISS codes. ntpd/ntp_proto.c@1.259 +2 -2 Show more digits during some debug printfs. Use the correct packet stratum in KISS codes. ChangeSet@1.1552, 2007-07-25 07:44:25-04:00, stenn@whimsy.udel.edu NTP_4_2_5P61 TAG: NTP_4_2_5P61 ntpd/ntpd-opts.c@1.48 +2 -2 NTP_4_2_5P61 ntpd/ntpd-opts.h@1.48 +3 -3 NTP_4_2_5P61 ntpd/ntpd-opts.texi@1.47 +2 -2 NTP_4_2_5P61 ntpd/ntpd.1@1.47 +2 -2 NTP_4_2_5P61 ntpdc/ntpdc-opts.c@1.48 +2 -2 NTP_4_2_5P61 ntpdc/ntpdc-opts.h@1.48 +3 -3 NTP_4_2_5P61 ntpdc/ntpdc-opts.texi@1.47 +2 -2 NTP_4_2_5P61 ntpdc/ntpdc.1@1.47 +2 -2 NTP_4_2_5P61 ntpq/ntpq-opts.c@1.48 +2 -2 NTP_4_2_5P61 ntpq/ntpq-opts.h@1.48 +3 -3 NTP_4_2_5P61 ntpq/ntpq-opts.texi@1.47 +2 -2 NTP_4_2_5P61 ntpq/ntpq.1@1.47 +2 -2 NTP_4_2_5P61 packageinfo.sh@1.64 +1 -1 NTP_4_2_5P61 sntp/sntp-opts.c@1.48 +2 -2 NTP_4_2_5P61 sntp/sntp-opts.h@1.48 +3 -3 NTP_4_2_5P61 sntp/sntp-opts.texi@1.47 +1 -1 NTP_4_2_5P61 sntp/sntp.1@1.47 +2 -2 NTP_4_2_5P61 util/ntp-keygen-opts.c@1.49 +2 -2 NTP_4_2_5P61 util/ntp-keygen-opts.h@1.49 +3 -3 NTP_4_2_5P61 util/ntp-keygen-opts.texi@1.48 +2 -2 NTP_4_2_5P61 util/ntp-keygen.1@1.48 +2 -2 NTP_4_2_5P61 ChangeSet@1.1551, 2007-07-24 15:01:03-04:00, stenn@whimsy.udel.edu internal driftfile write control: drift_file_sw ChangeLog@1.86 +1 -0 internal driftfile write control: drift_file_sw include/ntpd.h@1.107 +1 -0 internal driftfile write control: drift_file_sw ntpd/ntp_config.c@1.161 +3 -1 internal driftfile write control: drift_file_sw ntpd/ntp_loopfilter.c@1.137 +2 -1 internal driftfile write control: drift_file_sw ntpd/ntp_util.c@1.56 +5 -3 internal driftfile write control: drift_file_sw ChangeSet@1.1550, 2007-07-24 07:44:32-04:00, stenn@whimsy.udel.edu NTP_4_2_5P60 TAG: NTP_4_2_5P60 ntpd/ntpd-opts.c@1.47 +2 -2 NTP_4_2_5P60 ntpd/ntpd-opts.h@1.47 +3 -3 NTP_4_2_5P60 ntpd/ntpd-opts.texi@1.46 +1 -1 NTP_4_2_5P60 ntpd/ntpd.1@1.46 +2 -2 NTP_4_2_5P60 ntpdc/ntpdc-opts.c@1.47 +2 -2 NTP_4_2_5P60 ntpdc/ntpdc-opts.h@1.47 +3 -3 NTP_4_2_5P60 ntpdc/ntpdc-opts.texi@1.46 +1 -1 NTP_4_2_5P60 ntpdc/ntpdc.1@1.46 +2 -2 NTP_4_2_5P60 ntpq/ntpq-opts.c@1.47 +2 -2 NTP_4_2_5P60 ntpq/ntpq-opts.h@1.47 +3 -3 NTP_4_2_5P60 ntpq/ntpq-opts.texi@1.46 +1 -1 NTP_4_2_5P60 ntpq/ntpq.1@1.46 +2 -2 NTP_4_2_5P60 packageinfo.sh@1.63 +1 -1 NTP_4_2_5P60 sntp/sntp-opts.c@1.47 +2 -2 NTP_4_2_5P60 sntp/sntp-opts.h@1.47 +3 -3 NTP_4_2_5P60 sntp/sntp-opts.texi@1.46 +1 -1 NTP_4_2_5P60 sntp/sntp.1@1.46 +2 -2 NTP_4_2_5P60 util/ntp-keygen-opts.c@1.48 +2 -2 NTP_4_2_5P60 util/ntp-keygen-opts.h@1.48 +3 -3 NTP_4_2_5P60 util/ntp-keygen-opts.texi@1.47 +1 -1 NTP_4_2_5P60 util/ntp-keygen.1@1.47 +2 -2 NTP_4_2_5P60 ChangeSet@1.1549, 2007-07-24 01:52:29-04:00, stenn@whimsy.udel.edu Implement the wander_threshold option for the driftfile config keyword ChangeLog@1.85 +1 -0 Implement the wander_threshold option for the driftfile config keyword ntpd/ntp_config.c@1.160 +3 -5 Implement the wander_threshold option for the driftfile config keyword ntpd/ntp_parser.c@1.15 +321 -319 Implement the wander_threshold option for the driftfile config keyword ntpd/ntp_parser.h@1.7 +1 -1 Implement the wander_threshold option for the driftfile config keyword ntpd/ntp_parser.y@1.12 +207 -206 Implement the wander_threshold option for the driftfile config keyword ChangeSet@1.1548, 2007-07-24 01:32:19-04:00, stenn@whimsy.udel.edu c++ // comments are not allowed. ChangeLog@1.84 +1 -0 c++ // comments are not allowed. ntpd/ntp_control.c@1.97 +449 -445 c++ // comments are not allowed. ChangeSet@1.1547, 2007-07-23 07:45:57-04:00, stenn@whimsy.udel.edu NTP_4_2_5P59 TAG: NTP_4_2_5P59 ntpd/ntpd-opts.c@1.46 +2 -2 NTP_4_2_5P59 ntpd/ntpd-opts.h@1.46 +3 -3 NTP_4_2_5P59 ntpd/ntpd-opts.texi@1.45 +2 -2 NTP_4_2_5P59 ntpd/ntpd.1@1.45 +2 -2 NTP_4_2_5P59 ntpdc/ntpdc-opts.c@1.46 +2 -2 NTP_4_2_5P59 ntpdc/ntpdc-opts.h@1.46 +3 -3 NTP_4_2_5P59 ntpdc/ntpdc-opts.texi@1.45 +2 -2 NTP_4_2_5P59 ntpdc/ntpdc.1@1.45 +2 -2 NTP_4_2_5P59 ntpq/ntpq-opts.c@1.46 +2 -2 NTP_4_2_5P59 ntpq/ntpq-opts.h@1.46 +3 -3 NTP_4_2_5P59 ntpq/ntpq-opts.texi@1.45 +2 -2 NTP_4_2_5P59 ntpq/ntpq.1@1.45 +2 -2 NTP_4_2_5P59 packageinfo.sh@1.62 +1 -1 NTP_4_2_5P59 sntp/sntp-opts.c@1.46 +2 -2 NTP_4_2_5P59 sntp/sntp-opts.h@1.46 +3 -3 NTP_4_2_5P59 sntp/sntp-opts.texi@1.45 +1 -1 NTP_4_2_5P59 sntp/sntp.1@1.45 +2 -2 NTP_4_2_5P59 util/ntp-keygen-opts.c@1.47 +2 -2 NTP_4_2_5P59 util/ntp-keygen-opts.h@1.47 +3 -3 NTP_4_2_5P59 util/ntp-keygen-opts.texi@1.46 +2 -2 NTP_4_2_5P59 util/ntp-keygen.1@1.46 +2 -2 NTP_4_2_5P59 ChangeSet@1.1541.1.1, 2007-07-23 01:34:01-04:00, stenn@whimsy.udel.edu Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks ChangeLog@1.81.1.1 +2 -0 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks html/confopt.html@1.37 +2 -0 Documentation fixes from Dave Mills html/drivers/driver6.html@1.25 +4 -5 Documentation fixes from Dave Mills html/index.html@1.33 +2 -2 Documentation fixes from Dave Mills html/miscopt.html@1.36 +3 -13 Documentation fixes from Dave Mills html/ntpd.html@1.40 +28 -20 Documentation fixes from Dave Mills html/ntpdc.html@1.28 +3 -2 Documentation fixes from Dave Mills html/scripts/links7.txt@1.3 +4 -1 Documentation fixes from Dave Mills include/ntp.h@1.134 +12 -1 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup include/ntp_control.h@1.31 +21 -19 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup include/ntp_crypto.h@1.40 +3 -3 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup include/ntpd.h@1.106 +10 -8 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup ntpd/ntp_config.c@1.159 +8 -7 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks ntpd/ntp_control.c@1.96 +66 -50 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks ntpd/ntp_crypto.c@1.112 +153 -259 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks ntpd/ntp_loopfilter.c@1.136 +6 -9 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks ntpd/ntp_peer.c@1.104 +70 -71 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks ntpd/ntp_proto.c@1.258 +222 -176 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks ntpd/ntp_timer.c@1.39 +51 -40 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks ntpd/ntp_util.c@1.55 +36 -15 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks ntpd/refclock_acts.c@1.30 +1 -1 Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks ChangeSet@1.1545, 2007-07-18 15:09:31-04:00, mayer@pogo.udel.edu Undo bug #629 fixes as they cause more problems than were being solved ChangeLog@1.82 +1 -0 Undo bug #629 fixes as they cause more problems than were being solved ChangeSet@1.1544, 2007-07-18 15:03:37-04:00, mayer@pogo.udel.edu Undo bug #629 fixes as they cause more problems than were being solved ntpd/ntp_io.c@1.258 +1 -8 Undo bug #629 fixes as they cause more problems than were eing solved ChangeSet@1.1543, 2007-07-18 13:57:51-04:00, mayer@pogo.udel.edu Undo bug #629 fixes as they cause more problems than were being solved ports/winnt/ntpd/ntp_iocompletionport.c@1.32 +2 -4 Undo bug #629 fixes as they cause more problems than were being solved ChangeSet@1.1529.2.12, 2007-07-18 13:53:24-04:00, mayer@pogo.udel.edu Undo bug #629 fixes as they cause more problems than were eing solved ntpd/ntp_io.c@1.257 +1 -8 Undo bug #629 fixes as they cause more problems than were being solved ports/winnt/ntpd/ntp_iocompletionport.c@1.31 +0 -15 Undo bug #629 fixes as they cause more problems than were being solved ChangeSet@1.1541, 2007-06-30 07:46:53-04:00, stenn@whimsy.udel.edu NTP_4_2_5P58 TAG: NTP_4_2_5P58 ntpd/ntpd-opts.c@1.45 +2 -2 NTP_4_2_5P58 ntpd/ntpd-opts.h@1.45 +3 -3 NTP_4_2_5P58 ntpd/ntpd-opts.texi@1.44 +1 -1 NTP_4_2_5P58 ntpd/ntpd.1@1.44 +2 -2 NTP_4_2_5P58 ntpdc/ntpdc-opts.c@1.45 +2 -2 NTP_4_2_5P58 ntpdc/ntpdc-opts.h@1.45 +3 -3 NTP_4_2_5P58 ntpdc/ntpdc-opts.texi@1.44 +1 -1 NTP_4_2_5P58 ntpdc/ntpdc.1@1.44 +2 -2 NTP_4_2_5P58 ntpq/ntpq-opts.c@1.45 +2 -2 NTP_4_2_5P58 ntpq/ntpq-opts.h@1.45 +3 -3 NTP_4_2_5P58 ntpq/ntpq-opts.texi@1.44 +1 -1 NTP_4_2_5P58 ntpq/ntpq.1@1.44 +2 -2 NTP_4_2_5P58 packageinfo.sh@1.61 +1 -1 NTP_4_2_5P58 sntp/sntp-opts.c@1.45 +2 -2 NTP_4_2_5P58 sntp/sntp-opts.h@1.45 +3 -3 NTP_4_2_5P58 sntp/sntp-opts.texi@1.44 +1 -1 NTP_4_2_5P58 sntp/sntp.1@1.44 +2 -2 NTP_4_2_5P58 util/ntp-keygen-opts.c@1.46 +2 -2 NTP_4_2_5P58 util/ntp-keygen-opts.h@1.46 +3 -3 NTP_4_2_5P58 util/ntp-keygen-opts.texi@1.45 +1 -1 NTP_4_2_5P58 util/ntp-keygen.1@1.45 +2 -2 NTP_4_2_5P58 ChangeSet@1.1540, 2007-06-29 21:15:27+00:00, stenn@ntp1.isc.org format cleanup ChangeLog@1.81 +37 -39 format cleanup ChangeSet@1.1539, 2007-06-29 16:23:16-04:00, stenn@whimsy.udel.edu cleanup NEWS@1.100 +1 -0 cleanup ChangeSet@1.1436.1.66, 2007-06-29 15:46:00-04:00, stenn@deacon.udel.edu NTP_4_2_4P3 TAG: NTP_4_2_4P3 ntpd/ntpd-opts.c@1.50.10.1 +2 -2 NTP_4_2_4P3 ntpd/ntpd-opts.h@1.50.10.1 +3 -3 NTP_4_2_4P3 ntpd/ntpd-opts.texi@1.49.10.1 +2 -2 NTP_4_2_4P3 ntpd/ntpd.1@1.48.10.1 +2 -2 NTP_4_2_4P3 ntpd/ntpdsim-opts.c@1.50.10.1 +2 -2 NTP_4_2_4P3 ntpd/ntpdsim-opts.h@1.50.10.1 +3 -3 NTP_4_2_4P3 ntpd/ntpdsim-opts.texi@1.48.10.1 +1 -1 NTP_4_2_4P3 ntpd/ntpdsim.1@1.48.10.1 +2 -2 NTP_4_2_4P3 ntpdc/ntpdc-opts.c@1.50.10.1 +2 -2 NTP_4_2_4P3 ntpdc/ntpdc-opts.h@1.50.10.1 +3 -3 NTP_4_2_4P3 ntpdc/ntpdc-opts.texi@1.48.10.1 +2 -2 NTP_4_2_4P3 ntpdc/ntpdc.1@1.48.10.1 +2 -2 NTP_4_2_4P3 ntpq/ntpq-opts.c@1.52.10.1 +2 -2 NTP_4_2_4P3 ntpq/ntpq-opts.h@1.52.10.1 +3 -3 NTP_4_2_4P3 ntpq/ntpq-opts.texi@1.49.10.1 +2 -2 NTP_4_2_4P3 ntpq/ntpq.1@1.48.10.1 +2 -2 NTP_4_2_4P3 packageinfo.sh@1.65.16.2 +2 -2 NTP_4_2_4P3 sntp/sntp-opts.c@1.49.10.1 +2 -2 NTP_4_2_4P3 sntp/sntp-opts.h@1.49.10.1 +3 -3 NTP_4_2_4P3 sntp/sntp-opts.texi@1.46.10.1 +1 -1 NTP_4_2_4P3 sntp/sntp.1@1.49.10.1 +2 -2 NTP_4_2_4P3 util/ntp-keygen-opts.c@1.49.10.1 +2 -2 NTP_4_2_4P3 util/ntp-keygen-opts.h@1.49.10.1 +3 -3 NTP_4_2_4P3 util/ntp-keygen-opts.texi@1.47.10.1 +2 -2 NTP_4_2_4P3 util/ntp-keygen.1@1.47.10.1 +2 -2 NTP_4_2_4P3 ChangeSet@1.1436.1.65, 2007-06-29 15:31:21-04:00, stenn@deacon.udel.edu Release 4.2.4p3 ChangeLog@1.1.1.23 +1 -1 Release 4.2.4p3 NEWS@1.86.1.11 +1 -1 Release 4.2.4p3 packageinfo.sh@1.65.16.1 +1 -1 Release 4.2.4p3 ChangeSet@1.1436.1.64, 2007-06-29 19:03:39+00:00, stenn@ntp1.isc.org Cosmetic reformatting ChangeLog@1.1.1.22 +70 -16 Cosmetic reformatting NEWS@1.86.1.10 +4 -0 Cosmetic reformatting ChangeSet@1.1537, 2007-06-28 07:47:21-04:00, stenn@whimsy.udel.edu NTP_4_2_5P57 TAG: NTP_4_2_5P57 ntpd/ntpd-opts.c@1.44 +2 -2 NTP_4_2_5P57 ntpd/ntpd-opts.h@1.44 +3 -3 NTP_4_2_5P57 ntpd/ntpd-opts.texi@1.43 +1 -1 NTP_4_2_5P57 ntpd/ntpd.1@1.43 +2 -2 NTP_4_2_5P57 ntpdc/ntpdc-opts.c@1.44 +2 -2 NTP_4_2_5P57 ntpdc/ntpdc-opts.h@1.44 +3 -3 NTP_4_2_5P57 ntpdc/ntpdc-opts.texi@1.43 +1 -1 NTP_4_2_5P57 ntpdc/ntpdc.1@1.43 +2 -2 NTP_4_2_5P57 ntpq/ntpq-opts.c@1.44 +2 -2 NTP_4_2_5P57 ntpq/ntpq-opts.h@1.44 +3 -3 NTP_4_2_5P57 ntpq/ntpq-opts.texi@1.43 +1 -1 NTP_4_2_5P57 ntpq/ntpq.1@1.43 +2 -2 NTP_4_2_5P57 packageinfo.sh@1.60 +1 -1 NTP_4_2_5P57 sntp/sntp-opts.c@1.44 +2 -2 NTP_4_2_5P57 sntp/sntp-opts.h@1.44 +3 -3 NTP_4_2_5P57 sntp/sntp-opts.texi@1.43 +1 -1 NTP_4_2_5P57 sntp/sntp.1@1.43 +2 -2 NTP_4_2_5P57 util/ntp-keygen-opts.c@1.45 +2 -2 NTP_4_2_5P57 util/ntp-keygen-opts.h@1.45 +3 -3 NTP_4_2_5P57 util/ntp-keygen-opts.texi@1.44 +1 -1 NTP_4_2_5P57 util/ntp-keygen.1@1.44 +2 -2 NTP_4_2_5P57 ChangeSet@1.1535, 2007-06-28 04:11:15-04:00, stenn@whimsy.udel.edu More assertion checks and malloc()->emalloc(), courtesy of Calysto ChangeLog@1.78 +1 -0 More assertion checks and malloc()->emalloc(), courtesy of Calysto ntpd/ntp_crypto.c@1.111 +6 -1 More assertion checks and malloc()->emalloc(), courtesy of Calysto ntpd/ntp_data_structures.c@1.5 +2 -2 More assertion checks and malloc()->emalloc(), courtesy of Calysto ChangeSet@1.1534, 2007-06-28 04:05:43-04:00, stenn@whimsy.udel.edu typo ChangeLog@1.77 +1 -1 typo ChangeSet@1.1533, 2007-06-27 09:48:59-04:00, stenn@whimsy.udel.edu NTP_4_2_5P56 TAG: NTP_4_2_5P56 ntpd/ntpd-opts.c@1.43 +2 -2 NTP_4_2_5P56 ntpd/ntpd-opts.h@1.43 +3 -3 NTP_4_2_5P56 ntpd/ntpd-opts.texi@1.42 +1 -1 NTP_4_2_5P56 ntpd/ntpd.1@1.42 +2 -2 NTP_4_2_5P56 ntpdc/ntpdc-opts.c@1.43 +2 -2 NTP_4_2_5P56 ntpdc/ntpdc-opts.h@1.43 +3 -3 NTP_4_2_5P56 ntpdc/ntpdc-opts.texi@1.42 +1 -1 NTP_4_2_5P56 ntpdc/ntpdc.1@1.42 +2 -2 NTP_4_2_5P56 ntpq/ntpq-opts.c@1.43 +2 -2 NTP_4_2_5P56 ntpq/ntpq-opts.h@1.43 +3 -3 NTP_4_2_5P56 ntpq/ntpq-opts.texi@1.42 +1 -1 NTP_4_2_5P56 ntpq/ntpq.1@1.42 +2 -2 NTP_4_2_5P56 packageinfo.sh@1.59 +1 -1 NTP_4_2_5P56 sntp/sntp-opts.c@1.43 +2 -2 NTP_4_2_5P56 sntp/sntp-opts.h@1.43 +3 -3 NTP_4_2_5P56 sntp/sntp-opts.texi@1.42 +1 -1 NTP_4_2_5P56 sntp/sntp.1@1.42 +2 -2 NTP_4_2_5P56 util/ntp-keygen-opts.c@1.44 +2 -2 NTP_4_2_5P56 util/ntp-keygen-opts.h@1.44 +3 -3 NTP_4_2_5P56 util/ntp-keygen-opts.texi@1.43 +1 -1 NTP_4_2_5P56 util/ntp-keygen.1@1.43 +2 -2 NTP_4_2_5P56 ChangeSet@1.1436.1.63, 2007-06-27 07:46:44-04:00, stenn@whimsy.udel.edu NTP_4_2_4P3_RC1 TAG: NTP_4_2_4P3_RC1 ntpd/ntpd-opts.c@1.50.9.1 +2 -2 NTP_4_2_4P3_RC1 ntpd/ntpd-opts.h@1.50.9.1 +3 -3 NTP_4_2_4P3_RC1 ntpd/ntpd-opts.texi@1.49.9.1 +2 -2 NTP_4_2_4P3_RC1 ntpd/ntpd.1@1.48.9.1 +2 -2 NTP_4_2_4P3_RC1 ntpd/ntpdsim-opts.c@1.50.9.1 +2 -2 NTP_4_2_4P3_RC1 ntpd/ntpdsim-opts.h@1.50.9.1 +3 -3 NTP_4_2_4P3_RC1 ntpd/ntpdsim-opts.texi@1.48.9.1 +1 -1 NTP_4_2_4P3_RC1 ntpd/ntpdsim.1@1.48.9.1 +2 -2 NTP_4_2_4P3_RC1 ntpdc/ntpdc-opts.c@1.50.9.1 +2 -2 NTP_4_2_4P3_RC1 ntpdc/ntpdc-opts.h@1.50.9.1 +3 -3 NTP_4_2_4P3_RC1 ntpdc/ntpdc-opts.texi@1.48.9.1 +2 -2 NTP_4_2_4P3_RC1 ntpdc/ntpdc.1@1.48.9.1 +2 -2 NTP_4_2_4P3_RC1 ntpq/ntpq-opts.c@1.52.9.1 +2 -2 NTP_4_2_4P3_RC1 ntpq/ntpq-opts.h@1.52.9.1 +3 -3 NTP_4_2_4P3_RC1 ntpq/ntpq-opts.texi@1.49.9.1 +2 -2 NTP_4_2_4P3_RC1 ntpq/ntpq.1@1.48.9.1 +2 -2 NTP_4_2_4P3_RC1 packageinfo.sh@1.65.15.2 +2 -2 NTP_4_2_4P3_RC1 sntp/sntp-opts.c@1.49.9.1 +2 -2 NTP_4_2_4P3_RC1 sntp/sntp-opts.h@1.49.9.1 +3 -3 NTP_4_2_4P3_RC1 sntp/sntp-opts.texi@1.46.9.1 +1 -1 NTP_4_2_4P3_RC1 sntp/sntp.1@1.49.9.1 +2 -2 NTP_4_2_4P3_RC1 util/ntp-keygen-opts.c@1.49.9.1 +2 -2 NTP_4_2_4P3_RC1 util/ntp-keygen-opts.h@1.49.9.1 +3 -3 NTP_4_2_4P3_RC1 util/ntp-keygen-opts.texi@1.47.9.1 +2 -2 NTP_4_2_4P3_RC1 util/ntp-keygen.1@1.47.9.1 +2 -2 NTP_4_2_4P3_RC1 ChangeSet@1.1529.3.4, 2007-06-27 02:21:23-04:00, stenn@whimsy.udel.edu [Bug 604] ntpd regularly dies on linux/alpha ChangeLog@1.73.3.3 +1 -0 [Bug 604] ntpd regularly dies on linux/alpha ntpd/ntp_proto.c@1.255.1.2 +2 -0 [Bug 604] ntpd regularly dies on linux/alpha ChangeSet@1.1529.3.3, 2007-06-27 02:15:24-04:00, stenn@whimsy.udel.edu More leapsecond table file fixes from Dave Mills ChangeLog@1.73.3.2 +1 -1 More leapsecond table file fixes from Dave Mills include/ntpd.h@1.105 +1 -0 More leapsecond table file fixes from Dave Mills ntpd/ntp_crypto.c@1.110 +18 -6 More leapsecond table file fixes from Dave Mills ntpd/ntp_proto.c@1.255.1.1 +41 -37 More leapsecond table file fixes from Dave Mills ntpd/ntp_util.c@1.54 +16 -6 More leapsecond table file fixes from Dave Mills ChangeSet@1.1529.3.2, 2007-06-27 02:06:19-04:00, stenn@whimsy.udel.edu Notes for release NEWS@1.95.1.1 +2 -0 Notes for release ChangeSet@1.1436.1.62, 2007-06-27 01:42:30-04:00, stenn@whimsy.udel.edu First RC for 4.2.4p3 ChangeLog@1.1.1.21 +2 -1 First RC for 4.2.4p3 NEWS@1.86.1.9 +8 -0 First RC for 4.2.4p3 packageinfo.sh@1.65.15.1 +1 -1 First RC for 4.2.4p3 ChangeSet@1.1529.3.1, 2007-06-26 22:43:22-04:00, stenn@whimsy.udel.edu [Bug 858] recent leapfile changes broke non-OpenSSL builds. ChangeLog@1.73.3.1 +4 -2 [Bug 858] recent leapfile changes broke non-OpenSSL builds. ntpd/ntp_control.c@1.95 +2 -1 [Bug 858] recent leapfile changes broke non-OpenSSL builds. ChangeSet@1.1529.2.8, 2007-06-23 09:19:06-04:00, mayer@pogo.udel.edu Added Bug #863 ChangeLog@1.73.2.2 +2 -0 Added Bug #863 ChangeSet@1.1523.1.2, 2007-06-23 08:50:46-04:00, mayer@pogo.udel.edu Bug #863 Unable to stop ntpd because the handle index changed ports/winnt/include/ntp_iocompletionport.h@1.12.1.1 +3 -0 Bug #863 Unable to stop ntpd because the handle index changed ports/winnt/ntpd/ntp_iocompletionport.c@1.29 +15 -1 Bug #863 Unable to stop ntpd because the handle index changed ports/winnt/ntpd/ntservice.c@1.8.1.1 +9 -5 Bug #863 Unable to stop ntpd because the handle index changed ChangeSet@1.1436.1.61, 2007-06-23 08:47:07-04:00, mayer@pogo.udel.edu Added Bug #863 ChangeLog@1.1.1.20 +2 -0 Added Bug #863 ChangeSet@1.1436.5.1, 2007-06-23 08:42:58-04:00, mayer@pogo.udel.edu Bug #863 Unable to stop ntpd because the handle index changed ports/winnt/include/ntp_iocompletionport.h@1.13 +3 -0 Bug #863 Unable to stop ntpd because the handle index changed ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.2 +15 -1 Bug #863 Unable to stop ntpd because the handle index changed ports/winnt/ntpd/ntservice.c@1.9 +9 -5 Bug #863 Unable to stop ntpd because the handle index changed ChangeSet@1.1529.2.6, 2007-06-23 07:42:56-04:00, stenn@whimsy.udel.edu NTP_4_2_5P55 TAG: NTP_4_2_5P55 ntpd/ntpd-opts.c@1.42 +2 -2 NTP_4_2_5P55 ntpd/ntpd-opts.h@1.42 +3 -3 NTP_4_2_5P55 ntpd/ntpd-opts.texi@1.41 +1 -1 NTP_4_2_5P55 ntpd/ntpd.1@1.41 +2 -2 NTP_4_2_5P55 ntpdc/ntpdc-opts.c@1.42 +2 -2 NTP_4_2_5P55 ntpdc/ntpdc-opts.h@1.42 +3 -3 NTP_4_2_5P55 ntpdc/ntpdc-opts.texi@1.41 +1 -1 NTP_4_2_5P55 ntpdc/ntpdc.1@1.41 +2 -2 NTP_4_2_5P55 ntpq/ntpq-opts.c@1.42 +2 -2 NTP_4_2_5P55 ntpq/ntpq-opts.h@1.42 +3 -3 NTP_4_2_5P55 ntpq/ntpq-opts.texi@1.41 +1 -1 NTP_4_2_5P55 ntpq/ntpq.1@1.41 +2 -2 NTP_4_2_5P55 packageinfo.sh@1.58 +1 -1 NTP_4_2_5P55 sntp/sntp-opts.c@1.42 +2 -2 NTP_4_2_5P55 sntp/sntp-opts.h@1.42 +3 -3 NTP_4_2_5P55 sntp/sntp-opts.texi@1.41 +1 -1 NTP_4_2_5P55 sntp/sntp.1@1.41 +2 -2 NTP_4_2_5P55 util/ntp-keygen-opts.c@1.43 +2 -2 NTP_4_2_5P55 util/ntp-keygen-opts.h@1.43 +3 -3 NTP_4_2_5P55 util/ntp-keygen-opts.texi@1.42 +1 -1 NTP_4_2_5P55 util/ntp-keygen.1@1.42 +2 -2 NTP_4_2_5P55 ChangeSet@1.1529.2.5, 2007-06-23 01:03:58-04:00, stenn@whimsy.udel.edu Add more assertions (Calypso) util/ntp-keygen.c@1.42 +57 -1 Add more assertions (Calypso) ChangeSet@1.1529.2.4, 2007-06-23 00:38:42-04:00, stenn@whimsy.udel.edu Add more assertions (Calypso) util/ntp-keygen.c@1.41 +11 -8 Add more assertions (Calypso) ChangeSet@1.1529.2.3, 2007-06-23 00:30:39-04:00, stenn@whimsy.udel.edu Add more assertions (Calypso) libntp/caljulian.c@1.7 +3 -0 Add more assertions (Calypso) ChangeSet@1.1529.2.2, 2007-06-23 00:18:26-04:00, stenn@whimsy.udel.edu Add more assertions (Calypso) ntpd/ntp_crypto.c@1.109 +4 -1 Add more assertions (Calypso) ChangeSet@1.1529.2.1, 2007-06-22 23:51:03-04:00, stenn@whimsy.udel.edu Use emalloc() instead of malloc() in refclock_datum.c (Calypso). ChangeLog@1.73.2.1 +1 -0 Use emalloc() instead of malloc() in refclock_datum.c (Calypso). ntpd/refclock_datum.c@1.11 +2 -2 Use emalloc() instead of malloc() in refclock_datum.c (Calypso). ChangeSet@1.1529.1.5, 2007-06-22 12:52:24-04:00, utterback@pogo.udel.edu [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris ChangeLog@1.73.1.3 +1 -0 [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris configure.ac@1.407 +7 -1 [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris ntpd/Makefile.am@1.63 +2 -2 [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris ntpd/ntp_proto.c@1.256 +19 -0 [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris ChangeSet@1.1529.1.4, 2007-06-22 07:43:48-04:00, stenn@whimsy.udel.edu NTP_4_2_5P54 TAG: NTP_4_2_5P54 ntpd/ntpd-opts.c@1.41 +2 -2 NTP_4_2_5P54 ntpd/ntpd-opts.h@1.41 +3 -3 NTP_4_2_5P54 ntpd/ntpd-opts.texi@1.40 +2 -2 NTP_4_2_5P54 ntpd/ntpd.1@1.40 +2 -2 NTP_4_2_5P54 ntpdc/ntpdc-opts.c@1.41 +2 -2 NTP_4_2_5P54 ntpdc/ntpdc-opts.h@1.41 +3 -3 NTP_4_2_5P54 ntpdc/ntpdc-opts.texi@1.40 +2 -2 NTP_4_2_5P54 ntpdc/ntpdc.1@1.40 +2 -2 NTP_4_2_5P54 ntpq/ntpq-opts.c@1.41 +2 -2 NTP_4_2_5P54 ntpq/ntpq-opts.h@1.41 +3 -3 NTP_4_2_5P54 ntpq/ntpq-opts.texi@1.40 +2 -2 NTP_4_2_5P54 ntpq/ntpq.1@1.40 +2 -2 NTP_4_2_5P54 packageinfo.sh@1.57 +1 -1 NTP_4_2_5P54 sntp/sntp-opts.c@1.41 +2 -2 NTP_4_2_5P54 sntp/sntp-opts.h@1.41 +3 -3 NTP_4_2_5P54 sntp/sntp-opts.texi@1.40 +1 -1 NTP_4_2_5P54 sntp/sntp.1@1.40 +2 -2 NTP_4_2_5P54 util/ntp-keygen-opts.c@1.42 +2 -2 NTP_4_2_5P54 util/ntp-keygen-opts.h@1.42 +3 -3 NTP_4_2_5P54 util/ntp-keygen-opts.texi@1.41 +2 -2 NTP_4_2_5P54 util/ntp-keygen.1@1.41 +2 -2 NTP_4_2_5P54 ChangeSet@1.1529.1.3, 2007-06-22 02:11:30-04:00, stenn@deacon.udel.edu Leapsecond file support ChangeLog@1.73.1.2 +2 -2 Leapsecond file support include/ntp.h@1.133 +1 -0 Leapsecond file support ntpd/ntp_config.c@1.156.1.2 +6 -1 Leapsecond file support ntpd/ntp_config.c@1.156.1.1 +1 -0 More leapsecond fixes from Dave Mills ntpd/ntp_control.c@1.94 +3 -4 More leapsecond fixes from Dave Mills ntpd/ntp_parser.c@1.14 +684 -675 More leapsecond fixes from Dave Mills ntpd/ntp_parser.h@1.6 +92 -91 More leapsecond fixes from Dave Mills ntpd/ntp_parser.y@1.11 +3 -0 More leapsecond fixes from Dave Mills ntpd/ntp_proto.c@1.255 +65 -68 More leapsecond fixes from Dave Mills ntpd/ntp_timer.c@1.38 +20 -7 More leapsecond fixes from Dave Mills ntpd/ntp_util.c@1.53 +11 -1 Leapsecond file support ntpd/ntp_util.c@1.52 +44 -43 More leapsecond fixes from Dave Mills ChangeSet@1.1529.1.2, 2007-06-22 01:17:17-04:00, stenn@deacon.udel.edu Start using 'design by contract' assertions ntpd/ntp_io.c@1.254.1.1 +3 -0 Start using 'design by contract' assertions ChangeSet@1.1529.1.1, 2007-06-22 01:01:28-04:00, stenn@deacon.udel.edu Start using 'design by contract' assertions ChangeLog@1.73.1.1 +1 -0 Start using 'design by contract' assertions include/Makefile.am@1.28 +1 -0 Start using 'design by contract' assertions include/ntp_assert.h@1.1 +15 -0 BitKeeper file /deacon/backroom/ntp-dev/include/ntp_assert.h include/ntp_assert.h@1.0 +0 -0 libntp/atolfp.c@1.3 +3 -0 Start using 'design by contract' assertions libntp/prettydate.c@1.6 +2 -0 Start using 'design by contract' assertions ChangeSet@1.1530, 2007-06-21 09:10:39-04:00, neal@pogo.udel.edu ChangeLog, ntp_config.c: [Bug 862] includefile nesting; preserve phonelist on reconfig. ntp_scanner.h: [Bug 862] includefile nesting. ChangeLog@1.74 +1 -0 [Bug 862] includefile nesting; preserve phonelist on reconfig. ntpd/ntp_config.c@1.157 +3 -2 [Bug 862] includefile nesting; preserve phonelist on reconfig. ntpd/ntp_scanner.h@1.3 +1 -1 [Bug 862] includefile nesting. ChangeSet@1.1529, 2007-06-20 09:18:36-04:00, stenn@whimsy.udel.edu NTP_4_2_5P53 TAG: NTP_4_2_5P53 ntpd/ntpd-opts.c@1.40 +2 -2 NTP_4_2_5P53 ntpd/ntpd-opts.h@1.40 +3 -3 NTP_4_2_5P53 ntpd/ntpd-opts.texi@1.39 +2 -2 NTP_4_2_5P53 ntpd/ntpd.1@1.39 +2 -2 NTP_4_2_5P53 ntpdc/ntpdc-opts.c@1.40 +2 -2 NTP_4_2_5P53 ntpdc/ntpdc-opts.h@1.40 +3 -3 NTP_4_2_5P53 ntpdc/ntpdc-opts.texi@1.39 +2 -2 NTP_4_2_5P53 ntpdc/ntpdc.1@1.39 +2 -2 NTP_4_2_5P53 ntpq/ntpq-opts.c@1.40 +2 -2 NTP_4_2_5P53 ntpq/ntpq-opts.h@1.40 +3 -3 NTP_4_2_5P53 ntpq/ntpq-opts.texi@1.39 +2 -2 NTP_4_2_5P53 ntpq/ntpq.1@1.39 +2 -2 NTP_4_2_5P53 packageinfo.sh@1.56 +1 -1 NTP_4_2_5P53 sntp/sntp-opts.c@1.40 +2 -2 NTP_4_2_5P53 sntp/sntp-opts.h@1.40 +3 -3 NTP_4_2_5P53 sntp/sntp-opts.texi@1.39 +1 -1 NTP_4_2_5P53 sntp/sntp.1@1.39 +2 -2 NTP_4_2_5P53 util/ntp-keygen-opts.c@1.41 +2 -2 NTP_4_2_5P53 util/ntp-keygen-opts.h@1.41 +3 -3 NTP_4_2_5P53 util/ntp-keygen-opts.texi@1.40 +2 -2 NTP_4_2_5P53 util/ntp-keygen.1@1.40 +2 -2 NTP_4_2_5P53 ChangeSet@1.1436.1.59, 2007-06-20 07:45:57-04:00, stenn@whimsy.udel.edu NTP_4_2_4P2 TAG: NTP_4_2_4P2 ntpd/ntpd-opts.c@1.50.8.1 +2 -2 NTP_4_2_4P2 ntpd/ntpd-opts.h@1.50.8.1 +3 -3 NTP_4_2_4P2 ntpd/ntpd-opts.texi@1.49.8.1 +4 -4 NTP_4_2_4P2 ntpd/ntpd.1@1.48.8.1 +2 -2 NTP_4_2_4P2 ntpd/ntpdsim-opts.c@1.50.8.1 +2 -2 NTP_4_2_4P2 ntpd/ntpdsim-opts.h@1.50.8.1 +3 -3 NTP_4_2_4P2 ntpd/ntpdsim-opts.texi@1.48.8.1 +1 -1 NTP_4_2_4P2 ntpd/ntpdsim.1@1.48.8.1 +2 -2 NTP_4_2_4P2 ntpdc/ntpdc-opts.c@1.50.8.1 +2 -2 NTP_4_2_4P2 ntpdc/ntpdc-opts.h@1.50.8.1 +3 -3 NTP_4_2_4P2 ntpdc/ntpdc-opts.texi@1.48.8.1 +2 -2 NTP_4_2_4P2 ntpdc/ntpdc.1@1.48.8.1 +2 -2 NTP_4_2_4P2 ntpq/ntpq-opts.c@1.52.8.1 +2 -2 NTP_4_2_4P2 ntpq/ntpq-opts.h@1.52.8.1 +3 -3 NTP_4_2_4P2 ntpq/ntpq-opts.texi@1.49.8.1 +2 -2 NTP_4_2_4P2 ntpq/ntpq.1@1.48.8.1 +2 -2 NTP_4_2_4P2 packageinfo.sh@1.65.14.2 +2 -2 NTP_4_2_4P2 sntp/sntp-opts.c@1.49.8.1 +2 -2 NTP_4_2_4P2 sntp/sntp-opts.h@1.49.8.1 +3 -3 NTP_4_2_4P2 sntp/sntp-opts.texi@1.46.8.1 +1 -1 NTP_4_2_4P2 sntp/sntp.1@1.49.8.1 +2 -2 NTP_4_2_4P2 util/ntp-keygen-opts.c@1.49.8.1 +2 -2 NTP_4_2_4P2 util/ntp-keygen-opts.h@1.49.8.1 +3 -3 NTP_4_2_4P2 util/ntp-keygen-opts.texi@1.47.8.1 +2 -2 NTP_4_2_4P2 util/ntp-keygen.1@1.47.8.1 +2 -2 NTP_4_2_4P2 ChangeSet@1.1436.1.58, 2007-06-20 04:07:34-04:00, stenn@deacon.udel.edu 4.2.4p2 ChangeLog@1.1.1.19 +1 -0 4.2.4p2 NEWS@1.86.1.8 +8 -13 4.2.4p2 packageinfo.sh@1.65.14.1 +1 -1 4.2.4p2 ChangeSet@1.1527, 2007-06-20 01:51:36-04:00, stenn@pogo.udel.edu merge cleanup ntpd/ntp_util.c@1.51 +1 -1 merge cleanup ChangeSet@1.1523.2.2, 2007-06-19 18:55:53-04:00, stenn@whimsy.udel.edu leap second cleanup from Dave Mills ChangeLog@1.71.1.1 +1 -0 leap second cleanup from Dave Mills ChangeSet@1.1523.2.1, 2007-06-19 18:50:51-04:00, stenn@whimsy.udel.edu leap second cleanup from Dave Mills include/ntpd.h@1.104 +0 -1 leap second cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.135 +13 -25 leap second cleanup from Dave Mills ntpd/ntp_proto.c@1.254 +44 -19 leap second cleanup from Dave Mills ntpd/ntp_timer.c@1.37 +12 -8 leap second cleanup from Dave Mills ntpd/ntp_util.c@1.47.1.2 +51 -40 leap second cleanup from Dave Mills ChangeSet@1.1519.1.1, 2007-06-19 08:37:26-04:00, mayer@pogo.udel.edu Bug 629 Check for broadcast mode was in wrong place ntpd/ntp_io.c@1.253.1.1 +35 -11 Bug 629 Check for broadcast mode was in wrong place ports/winnt/ntpd/ntp_iocompletionport.c@1.28 +8 -2 Bug 629 Additional debug info ChangeSet@1.1525, 2007-06-19 03:13:46-04:00, stenn@pogo.udel.edu regenerated ntp_parser.c ntpd/ntp_parser.c@1.13 +504 -493 regenerated file ChangeSet@1.1523, 2007-06-17 07:44:01-04:00, stenn@whimsy.udel.edu NTP_4_2_5P52 TAG: NTP_4_2_5P52 ntpd/ntpd-opts.c@1.39 +2 -2 NTP_4_2_5P52 ntpd/ntpd-opts.h@1.39 +3 -3 NTP_4_2_5P52 ntpd/ntpd-opts.texi@1.38 +1 -1 NTP_4_2_5P52 ntpd/ntpd.1@1.38 +2 -2 NTP_4_2_5P52 ntpdc/ntpdc-opts.c@1.39 +2 -2 NTP_4_2_5P52 ntpdc/ntpdc-opts.h@1.39 +3 -3 NTP_4_2_5P52 ntpdc/ntpdc-opts.texi@1.38 +1 -1 NTP_4_2_5P52 ntpdc/ntpdc.1@1.38 +2 -2 NTP_4_2_5P52 ntpq/ntpq-opts.c@1.39 +2 -2 NTP_4_2_5P52 ntpq/ntpq-opts.h@1.39 +3 -3 NTP_4_2_5P52 ntpq/ntpq-opts.texi@1.38 +1 -1 NTP_4_2_5P52 ntpq/ntpq.1@1.38 +2 -2 NTP_4_2_5P52 packageinfo.sh@1.55 +1 -1 NTP_4_2_5P52 sntp/sntp-opts.c@1.39 +2 -2 NTP_4_2_5P52 sntp/sntp-opts.h@1.39 +3 -3 NTP_4_2_5P52 sntp/sntp-opts.texi@1.38 +1 -1 NTP_4_2_5P52 sntp/sntp.1@1.38 +2 -2 NTP_4_2_5P52 util/ntp-keygen-opts.c@1.40 +2 -2 NTP_4_2_5P52 util/ntp-keygen-opts.h@1.40 +3 -3 NTP_4_2_5P52 util/ntp-keygen-opts.texi@1.39 +1 -1 NTP_4_2_5P52 util/ntp-keygen.1@1.39 +2 -2 NTP_4_2_5P52 ChangeSet@1.1522, 2007-06-17 01:24:40-04:00, stenn@whimsy.udel.edu Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES ChangeLog@1.71 +1 -0 Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES ntpd/Makefile.am@1.62 +2 -1 Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES ntpd/ntp_parser.c@1.10.1.1 +1511 -1964 Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES ntpd/ntp_parser.h@1.3.1.1 +155 -345 Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES ntpd/ntp_parser.y@1.8.1.1 +2 -0 Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES ChangeSet@1.1521, 2007-06-16 07:44:30-04:00, stenn@whimsy.udel.edu NTP_4_2_5P51 TAG: NTP_4_2_5P51 ntpd/ntpd-opts.c@1.38 +2 -2 NTP_4_2_5P51 ntpd/ntpd-opts.h@1.38 +3 -3 NTP_4_2_5P51 ntpd/ntpd-opts.texi@1.37 +1 -1 NTP_4_2_5P51 ntpd/ntpd.1@1.37 +2 -2 NTP_4_2_5P51 ntpdc/ntpdc-opts.c@1.38 +2 -2 NTP_4_2_5P51 ntpdc/ntpdc-opts.h@1.38 +3 -3 NTP_4_2_5P51 ntpdc/ntpdc-opts.texi@1.37 +1 -1 NTP_4_2_5P51 ntpdc/ntpdc.1@1.37 +2 -2 NTP_4_2_5P51 ntpq/ntpq-opts.c@1.38 +2 -2 NTP_4_2_5P51 ntpq/ntpq-opts.h@1.38 +3 -3 NTP_4_2_5P51 ntpq/ntpq-opts.texi@1.37 +1 -1 NTP_4_2_5P51 ntpq/ntpq.1@1.37 +2 -2 NTP_4_2_5P51 packageinfo.sh@1.54 +1 -1 NTP_4_2_5P51 sntp/sntp-opts.c@1.38 +2 -2 NTP_4_2_5P51 sntp/sntp-opts.h@1.38 +3 -3 NTP_4_2_5P51 sntp/sntp-opts.texi@1.37 +1 -1 NTP_4_2_5P51 sntp/sntp.1@1.37 +2 -2 NTP_4_2_5P51 util/ntp-keygen-opts.c@1.39 +2 -2 NTP_4_2_5P51 util/ntp-keygen-opts.h@1.39 +3 -3 NTP_4_2_5P51 util/ntp-keygen-opts.texi@1.38 +1 -1 NTP_4_2_5P51 util/ntp-keygen.1@1.38 +2 -2 NTP_4_2_5P51 ChangeSet@1.1520, 2007-06-15 19:36:46-04:00, stenn@deacon.udel.edu typo ntpd/ntp_io.c@1.254 +1 -1 typo ChangeSet@1.1518, 2007-06-15 07:48:47-04:00, mayer@pogo.udel.edu Remove unused variable ntpd/ntp_io.c@1.253 +0 -1 Remove unused variable ChangeSet@1.1512.1.15, 2007-06-15 07:42:58-04:00, stenn@whimsy.udel.edu NTP_4_2_5P50 TAG: NTP_4_2_5P50 ntpd/ntpd-opts.c@1.37 +2 -2 NTP_4_2_5P50 ntpd/ntpd-opts.h@1.37 +3 -3 NTP_4_2_5P50 ntpd/ntpd-opts.texi@1.36 +4 -4 NTP_4_2_5P50 ntpd/ntpd.1@1.36 +2 -2 NTP_4_2_5P50 ntpdc/ntpdc-opts.c@1.37 +2 -2 NTP_4_2_5P50 ntpdc/ntpdc-opts.h@1.37 +3 -3 NTP_4_2_5P50 ntpdc/ntpdc-opts.texi@1.36 +2 -2 NTP_4_2_5P50 ntpdc/ntpdc.1@1.36 +2 -2 NTP_4_2_5P50 ntpq/ntpq-opts.c@1.37 +2 -2 NTP_4_2_5P50 ntpq/ntpq-opts.h@1.37 +3 -3 NTP_4_2_5P50 ntpq/ntpq-opts.texi@1.36 +2 -2 NTP_4_2_5P50 ntpq/ntpq.1@1.36 +2 -2 NTP_4_2_5P50 packageinfo.sh@1.53 +1 -1 NTP_4_2_5P50 sntp/sntp-opts.c@1.37 +2 -2 NTP_4_2_5P50 sntp/sntp-opts.h@1.37 +3 -3 NTP_4_2_5P50 sntp/sntp-opts.texi@1.36 +1 -1 NTP_4_2_5P50 sntp/sntp.1@1.36 +2 -2 NTP_4_2_5P50 util/ntp-keygen-opts.c@1.38 +2 -2 NTP_4_2_5P50 util/ntp-keygen-opts.h@1.38 +3 -3 NTP_4_2_5P50 util/ntp-keygen-opts.texi@1.37 +2 -2 NTP_4_2_5P50 util/ntp-keygen.1@1.37 +2 -2 NTP_4_2_5P50 ChangeSet@1.1517, 2007-06-14 23:22:06-04:00, mayer@pogo.udel.edu Bug #629 changes to ensure broadcast works including on wildcard addresses ChangeLog@1.70 +1 -0 Bug #629 changes to ensure broadcast works including on wildcard addresses ChangeSet@1.1515, 2007-06-14 23:06:42-04:00, mayer@pogo.udel.edu Bug #629 changes to ensure broadcast works including on wildcard addresses ntpd/ntp_io.c@1.252 +22 -17 Bug #629 changes to ensure broadcast works including on wildcard addresses ports/winnt/ntpd/ntp_iocompletionport.c@1.27 +12 -3 Bug #629 changes to ensure broadcast works including on wildcard addresses ChangeSet@1.1512.1.14, 2007-06-14 18:42:17-04:00, stenn@whimsy.udel.edu [Bug 853] get_node() must return a pointer to maximally-aligned memory ChangeLog@1.69 +1 -0 [Bug 853] get_node() must return a pointer to maximally-aligned memory include/ntp_data_structures.h@1.2 +5 -1 [Bug 853] get_node() must return a pointer to maximally-aligned memory ntpd/ntp_data_structures.c@1.4 +7 -7 [Bug 853] get_node() must return a pointer to maximally-aligned memory ChangeSet@1.1512.1.13, 2007-06-14 07:43:15-04:00, stenn@whimsy.udel.edu NTP_4_2_5P49 TAG: NTP_4_2_5P49 ntpd/ntpd-opts.c@1.36 +2 -2 NTP_4_2_5P49 ntpd/ntpd-opts.h@1.36 +3 -3 NTP_4_2_5P49 ntpd/ntpd-opts.texi@1.35 +1 -1 NTP_4_2_5P49 ntpd/ntpd.1@1.35 +2 -2 NTP_4_2_5P49 ntpdc/ntpdc-opts.c@1.36 +2 -2 NTP_4_2_5P49 ntpdc/ntpdc-opts.h@1.36 +3 -3 NTP_4_2_5P49 ntpdc/ntpdc-opts.texi@1.35 +1 -1 NTP_4_2_5P49 ntpdc/ntpdc.1@1.35 +2 -2 NTP_4_2_5P49 ntpq/ntpq-opts.c@1.36 +2 -2 NTP_4_2_5P49 ntpq/ntpq-opts.h@1.36 +3 -3 NTP_4_2_5P49 ntpq/ntpq-opts.texi@1.35 +1 -1 NTP_4_2_5P49 ntpq/ntpq.1@1.35 +2 -2 NTP_4_2_5P49 packageinfo.sh@1.52 +1 -1 NTP_4_2_5P49 sntp/sntp-opts.c@1.36 +2 -2 NTP_4_2_5P49 sntp/sntp-opts.h@1.36 +3 -3 NTP_4_2_5P49 sntp/sntp-opts.texi@1.35 +1 -1 NTP_4_2_5P49 sntp/sntp.1@1.35 +2 -2 NTP_4_2_5P49 util/ntp-keygen-opts.c@1.37 +2 -2 NTP_4_2_5P49 util/ntp-keygen-opts.h@1.37 +3 -3 NTP_4_2_5P49 util/ntp-keygen-opts.texi@1.36 +1 -1 NTP_4_2_5P49 util/ntp-keygen.1@1.36 +2 -2 NTP_4_2_5P49 ChangeSet@1.1512.1.12, 2007-06-14 01:40:14-04:00, stenn@whimsy.udel.edu Leap file fixes from Dave Mills ChangeLog@1.68 +1 -0 Leap file fixes from Dave Mills include/ntpd.h@1.103 +3 -1 Leap file fixes from Dave Mills ntpd/ntp_proto.c@1.253 +35 -12 Leap file fixes from Dave Mills ntpd/ntp_timer.c@1.36 +9 -2 Leap file fixes from Dave Mills ntpd/ntp_util.c@1.47.1.1 +52 -2 Leap file fixes from Dave Mills ChangeSet@1.1512.3.1, 2007-06-12 18:03:45-04:00, neal@pogo.udel.edu Many files: allow null driftfile. ChangeLog@1.66.1.1 +1 -0 allow null driftfile. ntpd/ntp_config.c@1.156 +10 -2 allow null driftfile. ntpd/ntp_parser.c@1.11 +507 -509 allow null driftfile. ntpd/ntp_parser.h@1.4 +1 -1 allow null driftfile. ntpd/ntp_parser.y@1.9 +16 -9 allow null driftfile. ntpd/ntp_scanner.c@1.8 +10 -6 allow null driftfile. ntpd/ntp_util.c@1.48 +1 -1 allow null driftfile. ChangeSet@1.1512.1.11, 2007-06-12 08:00:26-04:00, stenn@whimsy.udel.edu NTP_4_2_5P48 TAG: NTP_4_2_5P48 ntpd/ntpd-opts.c@1.35 +2 -2 NTP_4_2_5P48 ntpd/ntpd-opts.h@1.35 +3 -3 NTP_4_2_5P48 ntpd/ntpd-opts.texi@1.34 +1 -1 NTP_4_2_5P48 ntpd/ntpd.1@1.34 +2 -2 NTP_4_2_5P48 ntpdc/ntpdc-opts.c@1.35 +2 -2 NTP_4_2_5P48 ntpdc/ntpdc-opts.h@1.35 +3 -3 NTP_4_2_5P48 ntpdc/ntpdc-opts.texi@1.34 +1 -1 NTP_4_2_5P48 ntpdc/ntpdc.1@1.34 +2 -2 NTP_4_2_5P48 ntpq/ntpq-opts.c@1.35 +2 -2 NTP_4_2_5P48 ntpq/ntpq-opts.h@1.35 +3 -3 NTP_4_2_5P48 ntpq/ntpq-opts.texi@1.34 +1 -1 NTP_4_2_5P48 ntpq/ntpq.1@1.34 +2 -2 NTP_4_2_5P48 packageinfo.sh@1.51 +1 -1 NTP_4_2_5P48 sntp/sntp-opts.c@1.35 +2 -2 NTP_4_2_5P48 sntp/sntp-opts.h@1.35 +3 -3 NTP_4_2_5P48 sntp/sntp-opts.texi@1.34 +1 -1 NTP_4_2_5P48 sntp/sntp.1@1.34 +2 -2 NTP_4_2_5P48 util/ntp-keygen-opts.c@1.36 +2 -2 NTP_4_2_5P48 util/ntp-keygen-opts.h@1.36 +3 -3 NTP_4_2_5P48 util/ntp-keygen-opts.texi@1.35 +1 -1 NTP_4_2_5P48 util/ntp-keygen.1@1.35 +2 -2 NTP_4_2_5P48 ChangeSet@1.1512.1.10, 2007-06-11 20:40:23-04:00, stenn@deacon.udel.edu [Bug 858] Recent leapfile changes broke without OPENSSL ChangeLog@1.67 +1 -0 [Bug 858] Recent leapfile changes broke without OPENSSL include/ntp_crypto.h@1.39 +1 -2 [Bug 858] Recent leapfile changes broke without OPENSSL include/ntpd.h@1.102 +4 -2 [Bug 858] Recent leapfile changes broke without OPENSSL ChangeSet@1.1512.1.9, 2007-06-10 10:00:31-04:00, stenn@whimsy.udel.edu NTP_4_2_5P47 TAG: NTP_4_2_5P47 ntpd/ntpd-opts.c@1.34 +2 -2 NTP_4_2_5P47 ntpd/ntpd-opts.h@1.34 +3 -3 NTP_4_2_5P47 ntpd/ntpd-opts.texi@1.33 +1 -1 NTP_4_2_5P47 ntpd/ntpd.1@1.33 +2 -2 NTP_4_2_5P47 ntpdc/ntpdc-opts.c@1.34 +2 -2 NTP_4_2_5P47 ntpdc/ntpdc-opts.h@1.34 +3 -3 NTP_4_2_5P47 ntpdc/ntpdc-opts.texi@1.33 +1 -1 NTP_4_2_5P47 ntpdc/ntpdc.1@1.33 +2 -2 NTP_4_2_5P47 ntpq/ntpq-opts.c@1.34 +2 -2 NTP_4_2_5P47 ntpq/ntpq-opts.h@1.34 +3 -3 NTP_4_2_5P47 ntpq/ntpq-opts.texi@1.33 +1 -1 NTP_4_2_5P47 ntpq/ntpq.1@1.33 +2 -2 NTP_4_2_5P47 packageinfo.sh@1.50 +1 -1 NTP_4_2_5P47 sntp/sntp-opts.c@1.34 +2 -2 NTP_4_2_5P47 sntp/sntp-opts.h@1.34 +3 -3 NTP_4_2_5P47 sntp/sntp-opts.texi@1.33 +1 -1 NTP_4_2_5P47 sntp/sntp.1@1.33 +2 -2 NTP_4_2_5P47 util/ntp-keygen-opts.c@1.35 +2 -2 NTP_4_2_5P47 util/ntp-keygen-opts.h@1.35 +3 -3 NTP_4_2_5P47 util/ntp-keygen-opts.texi@1.34 +1 -1 NTP_4_2_5P47 util/ntp-keygen.1@1.34 +2 -2 NTP_4_2_5P47 ChangeSet@1.1436.1.57, 2007-06-10 07:58:59-04:00, stenn@whimsy.udel.edu NTP_4_2_4P2_RC6 TAG: NTP_4_2_4P2_RC6 ntpd/ntpd-opts.c@1.50.7.1 +2 -2 NTP_4_2_4P2_RC6 ntpd/ntpd-opts.h@1.50.7.1 +3 -3 NTP_4_2_4P2_RC6 ntpd/ntpd-opts.texi@1.49.7.1 +1 -1 NTP_4_2_4P2_RC6 ntpd/ntpd.1@1.48.7.1 +2 -2 NTP_4_2_4P2_RC6 ntpd/ntpdsim-opts.c@1.50.7.1 +2 -2 NTP_4_2_4P2_RC6 ntpd/ntpdsim-opts.h@1.50.7.1 +3 -3 NTP_4_2_4P2_RC6 ntpd/ntpdsim-opts.texi@1.48.7.1 +1 -1 NTP_4_2_4P2_RC6 ntpd/ntpdsim.1@1.48.7.1 +2 -2 NTP_4_2_4P2_RC6 ntpdc/ntpdc-opts.c@1.50.7.1 +2 -2 NTP_4_2_4P2_RC6 ntpdc/ntpdc-opts.h@1.50.7.1 +3 -3 NTP_4_2_4P2_RC6 ntpdc/ntpdc-opts.texi@1.48.7.1 +1 -1 NTP_4_2_4P2_RC6 ntpdc/ntpdc.1@1.48.7.1 +2 -2 NTP_4_2_4P2_RC6 ntpq/ntpq-opts.c@1.52.7.1 +2 -2 NTP_4_2_4P2_RC6 ntpq/ntpq-opts.h@1.52.7.1 +3 -3 NTP_4_2_4P2_RC6 ntpq/ntpq-opts.texi@1.49.7.1 +1 -1 NTP_4_2_4P2_RC6 ntpq/ntpq.1@1.48.7.1 +2 -2 NTP_4_2_4P2_RC6 packageinfo.sh@1.65.13.1 +1 -1 NTP_4_2_4P2_RC6 sntp/sntp-opts.c@1.49.7.1 +2 -2 NTP_4_2_4P2_RC6 sntp/sntp-opts.h@1.49.7.1 +3 -3 NTP_4_2_4P2_RC6 sntp/sntp-opts.texi@1.46.7.1 +1 -1 NTP_4_2_4P2_RC6 sntp/sntp.1@1.49.7.1 +2 -2 NTP_4_2_4P2_RC6 util/ntp-keygen-opts.c@1.49.7.1 +2 -2 NTP_4_2_4P2_RC6 util/ntp-keygen-opts.h@1.49.7.1 +3 -3 NTP_4_2_4P2_RC6 util/ntp-keygen-opts.texi@1.47.7.1 +1 -1 NTP_4_2_4P2_RC6 util/ntp-keygen.1@1.47.7.1 +2 -2 NTP_4_2_4P2_RC6 ChangeSet@1.1512.1.8, 2007-06-10 03:26:26-04:00, stenn@deacon.udel.edu ntp_dir_sep.m4, config.h: Use a char for DIR_SEP, not a string ntp_util.c, ntp_loopfilter.c, ntpd.h, ntp.h, ntp_timer.c, ChangeLog: leap file improvements from Dave Mills. ChangeLog@1.66 +1 -0 leap file improvements from Dave Mills. include/ntp.h@1.132 +1 -0 leap file improvements from Dave Mills. include/ntpd.h@1.101 +2 -1 leap file improvements from Dave Mills. m4/ntp_dir_sep.m4@1.2 +3 -3 Use a char for DIR_SEP, not a string ntpd/ntp_loopfilter.c@1.134 +13 -37 leap file improvements from Dave Mills. ntpd/ntp_timer.c@1.35 +6 -0 leap file improvements from Dave Mills. ntpd/ntp_util.c@1.47 +138 -45 leap file improvements from Dave Mills. ports/winnt/include/config.h@1.50 +1 -1 Use a char for DIR_SEP, not a string ChangeSet@1.1512.2.1, 2007-06-07 15:57:08-04:00, stenn@whimsy.udel.edu NTP_4_2_5P46 TAG: NTP_4_2_5P46 ntpd/ntpd-opts.c@1.33 +2 -2 NTP_4_2_5P46 ntpd/ntpd-opts.h@1.33 +3 -3 NTP_4_2_5P46 ntpd/ntpd-opts.texi@1.32 +1 -1 NTP_4_2_5P46 ntpd/ntpd.1@1.32 +2 -2 NTP_4_2_5P46 ntpdc/ntpdc-opts.c@1.33 +2 -2 NTP_4_2_5P46 ntpdc/ntpdc-opts.h@1.33 +3 -3 NTP_4_2_5P46 ntpdc/ntpdc-opts.texi@1.32 +1 -1 NTP_4_2_5P46 ntpdc/ntpdc.1@1.32 +2 -2 NTP_4_2_5P46 ntpq/ntpq-opts.c@1.33 +2 -2 NTP_4_2_5P46 ntpq/ntpq-opts.h@1.33 +3 -3 NTP_4_2_5P46 ntpq/ntpq-opts.texi@1.32 +1 -1 NTP_4_2_5P46 ntpq/ntpq.1@1.32 +2 -2 NTP_4_2_5P46 packageinfo.sh@1.49 +1 -1 NTP_4_2_5P46 sntp/sntp-opts.c@1.33 +2 -2 NTP_4_2_5P46 sntp/sntp-opts.h@1.33 +3 -3 NTP_4_2_5P46 sntp/sntp-opts.texi@1.32 +1 -1 NTP_4_2_5P46 sntp/sntp.1@1.32 +2 -2 NTP_4_2_5P46 util/ntp-keygen-opts.c@1.34 +2 -2 NTP_4_2_5P46 util/ntp-keygen-opts.h@1.34 +3 -3 NTP_4_2_5P46 util/ntp-keygen-opts.texi@1.33 +1 -1 NTP_4_2_5P46 util/ntp-keygen.1@1.33 +2 -2 NTP_4_2_5P46 ChangeSet@1.1512.1.5, 2007-06-07 10:48:26-04:00, neal@pogo.udel.edu ntp_parser.y, ntp_parser.h, ntp_parser.c, ChangeLog, ntp_config.c: [Bug 850] driftfile parsing changes. ChangeLog@1.64 +1 -0 [Bug 850] driftfile parsing changes. ntpd/ntp_config.c@1.155 +3 -0 [Bug 850] driftfile parsing changes. ntpd/ntp_parser.c@1.10 +2040 -1569 [Bug 850] driftfile parsing changes. ntpd/ntp_parser.h@1.3 +345 -154 [Bug 850] driftfile parsing changes. ntpd/ntp_parser.y@1.8 +9 -2 [Bug 850] driftfile parsing changes. ChangeSet@1.1436.1.56, 2007-06-07 09:28:16-04:00, mayer@pogo.udel.edu Bug #854 Broadcast address was not correctly set for interface addresses ChangeLog@1.1.1.18 +1 -0 Bug #854 Broadcast address was not correctly set for interface addresses ChangeSet@1.1436.1.55, 2007-06-07 09:25:17-04:00, mayer@pogo.udel.edu Bug #854 Broadcast address was not correctly set for interface addresses ports/winnt/libisc/interfaceiter.c@1.7 +35 -13 Bug #854 Broadcast address was not correctly set for interface addresses ChangeSet@1.1512.1.4, 2007-06-07 06:40:49-04:00, stenn@deacon.udel.edu driftfile maintenance changes from Dave Mills. Use clock_phi instead of stats_write_tolerance ChangeLog@1.63 +2 -0 driftfile maintenance changes from Dave Mills. Use clock_phi instead of stats_write_tolerance ntpd/ntp_util.c@1.46 +8 -15 driftfile maintenance changes from Dave Mills. Use clock_phi instead of stats_write_tolerance ntpd/ntpd.c@1.87 +1 -1 driftfile maintenance changes from Dave Mills. Use clock_phi instead of stats_write_tolerance ChangeSet@1.1512.1.3, 2007-06-07 01:49:17-04:00, stenn@deacon.udel.edu IRIG refclock improvements from Dave Mills ntpd/refclock_irig.c@1.31 +55 -65 IRIG refclock improvements from Dave Mills ChangeSet@1.1512.1.2, 2007-06-05 07:45:25-04:00, stenn@whimsy.udel.edu NTP_4_2_5P45 TAG: NTP_4_2_5P45 ntpd/ntpd-opts.c@1.32 +2 -2 NTP_4_2_5P45 ntpd/ntpd-opts.h@1.32 +3 -3 NTP_4_2_5P45 ntpd/ntpd-opts.texi@1.31 +1 -1 NTP_4_2_5P45 ntpd/ntpd.1@1.31 +2 -2 NTP_4_2_5P45 ntpdc/ntpdc-opts.c@1.32 +2 -2 NTP_4_2_5P45 ntpdc/ntpdc-opts.h@1.32 +3 -3 NTP_4_2_5P45 ntpdc/ntpdc-opts.texi@1.31 +1 -1 NTP_4_2_5P45 ntpdc/ntpdc.1@1.31 +2 -2 NTP_4_2_5P45 ntpq/ntpq-opts.c@1.32 +2 -2 NTP_4_2_5P45 ntpq/ntpq-opts.h@1.32 +3 -3 NTP_4_2_5P45 ntpq/ntpq-opts.texi@1.31 +1 -1 NTP_4_2_5P45 ntpq/ntpq.1@1.31 +2 -2 NTP_4_2_5P45 packageinfo.sh@1.48 +1 -1 NTP_4_2_5P45 sntp/sntp-opts.c@1.32 +2 -2 NTP_4_2_5P45 sntp/sntp-opts.h@1.32 +3 -3 NTP_4_2_5P45 sntp/sntp-opts.texi@1.31 +1 -1 NTP_4_2_5P45 sntp/sntp.1@1.31 +2 -2 NTP_4_2_5P45 util/ntp-keygen-opts.c@1.33 +2 -2 NTP_4_2_5P45 util/ntp-keygen-opts.h@1.33 +3 -3 NTP_4_2_5P45 util/ntp-keygen-opts.texi@1.32 +1 -1 NTP_4_2_5P45 util/ntp-keygen.1@1.32 +2 -2 NTP_4_2_5P45 ChangeSet@1.1512.1.1, 2007-06-05 02:28:01-04:00, stenn@whimsy.udel.edu indentation cleanup ntpd/ntp_config.c@1.154 +1676 -1559 indentation cleanup ChangeSet@1.1495.1.1, 2007-06-02 18:30:39-04:00, mayer@pogo.udel.edu Bug #629 Allow certain broadcast packets to be received on the wildcard socket include/ntp_io.h@1.6 +3 -0 Bug #629 Allow certain broadcast packets to be received on the wildcard socket include/ntp_request.h@1.32 +7 -0 Bug #629 Allow certain broadcast packets to be received on the wildcard socket ntpd/ntp_io.c@1.249.1.1 +27 -2 Bug #629 Allow certain broadcast packets to be received on the wildcard socket ntpd/ntp_request.c@1.68 +9 -0 Bug #629 Allow certain broadcast packets to be received on the wildcard socket ports/winnt/ntpd/ntp_iocompletionport.c@1.26 +20 -2 Bug #629 Allow certain broadcast packets to be received on the wildcard socket ChangeSet@1.1512, 2007-06-02 07:44:39-04:00, stenn@whimsy.udel.edu NTP_4_2_5P44 TAG: NTP_4_2_5P44 ntpd/ntpd-opts.c@1.31 +2 -2 NTP_4_2_5P44 ntpd/ntpd-opts.h@1.31 +3 -3 NTP_4_2_5P44 ntpd/ntpd-opts.texi@1.30 +1 -1 NTP_4_2_5P44 ntpd/ntpd.1@1.30 +2 -2 NTP_4_2_5P44 ntpdc/ntpdc-opts.c@1.31 +2 -2 NTP_4_2_5P44 ntpdc/ntpdc-opts.h@1.31 +3 -3 NTP_4_2_5P44 ntpdc/ntpdc-opts.texi@1.30 +1 -1 NTP_4_2_5P44 ntpdc/ntpdc.1@1.30 +2 -2 NTP_4_2_5P44 ntpq/ntpq-opts.c@1.31 +2 -2 NTP_4_2_5P44 ntpq/ntpq-opts.h@1.31 +3 -3 NTP_4_2_5P44 ntpq/ntpq-opts.texi@1.30 +1 -1 NTP_4_2_5P44 ntpq/ntpq.1@1.30 +2 -2 NTP_4_2_5P44 packageinfo.sh@1.47 +1 -1 NTP_4_2_5P44 sntp/sntp-opts.c@1.31 +2 -2 NTP_4_2_5P44 sntp/sntp-opts.h@1.31 +3 -3 NTP_4_2_5P44 sntp/sntp-opts.texi@1.30 +1 -1 NTP_4_2_5P44 sntp/sntp.1@1.30 +2 -2 NTP_4_2_5P44 util/ntp-keygen-opts.c@1.32 +2 -2 NTP_4_2_5P44 util/ntp-keygen-opts.h@1.32 +3 -3 NTP_4_2_5P44 util/ntp-keygen-opts.texi@1.31 +1 -1 NTP_4_2_5P44 util/ntp-keygen.1@1.31 +2 -2 NTP_4_2_5P44 ChangeSet@1.1511, 2007-06-02 00:27:35-04:00, stenn@whimsy.udel.edu Updated from the recent change to ntp_parser.y ntpd/ntp_parser.c@1.9 +196 -182 Updated from the recent change to ntp_parser.y ChangeSet@1.1510, 2007-06-01 18:30:18-04:00, neal@pogo.udel.edu ntp_scanner.c, ChangeLog: [Bug 828] refid not being parsed correctly. ChangeLog@1.62 +1 -0 [Bug 828] refid not being parsed correctly. ntpd/ntp_scanner.c@1.7 +8 -6 [Bug 828] refid not being parsed correctly. ChangeSet@1.1506.1.2, 2007-06-01 08:13:55-04:00, neal@pogo.udel.edu commit to correct bk merge problems. ChangeLog@1.59.1.2 +1 -0 ChangeSet@1.1506.1.1, 2007-06-01 07:52:58-04:00, neal@pogo.udel.edu ntp_parser.y, ntp_scanner.c, ChangeLog: [Bug 846] Correct includefile parsing. ChangeLog@1.59.1.1 +1 -0 [Bug 846] Correct includefile parsing. ntpd/ntp_parser.y@1.7 +2 -2 [Bug 846] Correct includefile parsing. ntpd/ntp_scanner.c@1.6 +7 -2 [Bug 846] Correct includefile parsing. ChangeSet@1.1508, 2007-06-01 07:44:04-04:00, stenn@whimsy.udel.edu NTP_4_2_5P43 TAG: NTP_4_2_5P43 ntpd/ntpd-opts.c@1.30 +2 -2 NTP_4_2_5P43 ntpd/ntpd-opts.h@1.30 +3 -3 NTP_4_2_5P43 ntpd/ntpd-opts.texi@1.29 +1 -1 NTP_4_2_5P43 ntpd/ntpd.1@1.29 +2 -2 NTP_4_2_5P43 ntpdc/ntpdc-opts.c@1.30 +2 -2 NTP_4_2_5P43 ntpdc/ntpdc-opts.h@1.30 +3 -3 NTP_4_2_5P43 ntpdc/ntpdc-opts.texi@1.29 +1 -1 NTP_4_2_5P43 ntpdc/ntpdc.1@1.29 +2 -2 NTP_4_2_5P43 ntpq/ntpq-opts.c@1.30 +2 -2 NTP_4_2_5P43 ntpq/ntpq-opts.h@1.30 +3 -3 NTP_4_2_5P43 ntpq/ntpq-opts.texi@1.29 +1 -1 NTP_4_2_5P43 ntpq/ntpq.1@1.29 +2 -2 NTP_4_2_5P43 packageinfo.sh@1.46 +1 -1 NTP_4_2_5P43 sntp/sntp-opts.c@1.30 +2 -2 NTP_4_2_5P43 sntp/sntp-opts.h@1.30 +3 -3 NTP_4_2_5P43 sntp/sntp-opts.texi@1.29 +1 -1 NTP_4_2_5P43 sntp/sntp.1@1.29 +2 -2 NTP_4_2_5P43 util/ntp-keygen-opts.c@1.31 +2 -2 NTP_4_2_5P43 util/ntp-keygen-opts.h@1.31 +3 -3 NTP_4_2_5P43 util/ntp-keygen-opts.texi@1.30 +1 -1 NTP_4_2_5P43 util/ntp-keygen.1@1.30 +2 -2 NTP_4_2_5P43 ChangeSet@1.1507, 2007-06-01 02:17:28-04:00, stenn@whimsy.udel.edu [Bug 827] New parsing code does not handle "fudge" correctly ChangeLog@1.60 +1 -0 [Bug 827] New parsing code does not handle "fudge" correctly ChangeSet@1.1506, 2007-05-31 07:47:43-04:00, stenn@whimsy.udel.edu NTP_4_2_5P42 TAG: NTP_4_2_5P42 ntpd/ntpd-opts.c@1.29 +4 -5 NTP_4_2_5P42 ntpd/ntpd-opts.h@1.29 +5 -6 NTP_4_2_5P42 ntpd/ntpd-opts.texi@1.28 +2 -3 NTP_4_2_5P42 ntpd/ntpd.1@1.28 +3 -3 NTP_4_2_5P42 ntpdc/ntpdc-opts.c@1.29 +4 -5 NTP_4_2_5P42 ntpdc/ntpdc-opts.h@1.29 +5 -6 NTP_4_2_5P42 ntpdc/ntpdc-opts.texi@1.28 +2 -3 NTP_4_2_5P42 ntpdc/ntpdc.1@1.28 +3 -3 NTP_4_2_5P42 ntpq/ntpq-opts.c@1.29 +4 -5 NTP_4_2_5P42 ntpq/ntpq-opts.h@1.29 +5 -6 NTP_4_2_5P42 ntpq/ntpq-opts.texi@1.28 +2 -3 NTP_4_2_5P42 ntpq/ntpq.1@1.28 +3 -3 NTP_4_2_5P42 packageinfo.sh@1.45 +1 -1 NTP_4_2_5P42 sntp/sntp-opts.c@1.29 +4 -5 NTP_4_2_5P42 sntp/sntp-opts.h@1.29 +5 -6 NTP_4_2_5P42 sntp/sntp-opts.texi@1.28 +2 -3 NTP_4_2_5P42 sntp/sntp.1@1.28 +3 -3 NTP_4_2_5P42 util/ntp-keygen-opts.c@1.30 +4 -5 NTP_4_2_5P42 util/ntp-keygen-opts.h@1.30 +5 -6 NTP_4_2_5P42 util/ntp-keygen-opts.texi@1.29 +2 -3 NTP_4_2_5P42 util/ntp-keygen.1@1.29 +3 -3 NTP_4_2_5P42 ChangeSet@1.1505, 2007-05-31 01:32:15-04:00, stenn@whimsy.udel.edu Enable debugging capability in the config parser. ChangeLog@1.59 +1 -0 Enable debugging capability in the config parser. ntpd/Makefile.am@1.61 +1 -1 Enable debugging capability in the config parser. ntpd/ntp_parser.c@1.8 +1 -1 Enable debugging capability in the config parser. ChangeSet@1.1504, 2007-05-30 22:54:36-04:00, stenn@whimsy.udel.edu [Bug 839] Crypto password not read from ntp.conf ChangeLog@1.58 +1 -0 [Bug 839] Crypto password not read from ntp.conf ntpd/ntp_parser.c@1.7 +198 -194 [Bug 839] Crypto password not read from ntp.conf ntpd/ntp_parser.y@1.6 +5 -1 [Bug 839] Crypto password not read from ntp.conf ChangeSet@1.1503, 2007-05-30 22:44:11-04:00, stenn@whimsy.udel.edu Have autogen produce writable output files ChangeLog@1.57 +1 -0 Have autogen produce writable output files ntpd/Makefile.am@1.60 +1 -1 Have autogen produce writable output files ntpdc/Makefile.am@1.36 +1 -1 Have autogen produce writable output files ntpq/Makefile.am@1.28 +1 -1 Have autogen produce writable output files sntp/Makefile.am@1.22 +2 -2 Have autogen produce writable output files util/Makefile.am@1.37 +1 -1 Have autogen produce writable output files ChangeSet@1.1501, 2007-05-30 07:45:27-04:00, stenn@whimsy.udel.edu NTP_4_2_5P41 TAG: NTP_4_2_5P41 ntpd/ntpd-opts.c@1.28 +2 -2 NTP_4_2_5P41 ntpd/ntpd-opts.h@1.28 +3 -3 NTP_4_2_5P41 ntpd/ntpd-opts.texi@1.27 +1 -1 NTP_4_2_5P41 ntpd/ntpd.1@1.27 +2 -2 NTP_4_2_5P41 ntpdc/ntpdc-opts.c@1.28 +2 -2 NTP_4_2_5P41 ntpdc/ntpdc-opts.h@1.28 +3 -3 NTP_4_2_5P41 ntpdc/ntpdc-opts.texi@1.27 +1 -1 NTP_4_2_5P41 ntpdc/ntpdc.1@1.27 +2 -2 NTP_4_2_5P41 ntpq/ntpq-opts.c@1.28 +2 -2 NTP_4_2_5P41 ntpq/ntpq-opts.h@1.28 +3 -3 NTP_4_2_5P41 ntpq/ntpq-opts.texi@1.27 +1 -1 NTP_4_2_5P41 ntpq/ntpq.1@1.27 +2 -2 NTP_4_2_5P41 packageinfo.sh@1.44 +1 -1 NTP_4_2_5P41 sntp/sntp-opts.c@1.28 +2 -2 NTP_4_2_5P41 sntp/sntp-opts.h@1.28 +3 -3 NTP_4_2_5P41 sntp/sntp-opts.texi@1.27 +1 -1 NTP_4_2_5P41 sntp/sntp.1@1.27 +2 -2 NTP_4_2_5P41 util/ntp-keygen-opts.c@1.29 +2 -2 NTP_4_2_5P41 util/ntp-keygen-opts.h@1.29 +3 -3 NTP_4_2_5P41 util/ntp-keygen-opts.texi@1.28 +1 -1 NTP_4_2_5P41 util/ntp-keygen.1@1.28 +2 -2 NTP_4_2_5P41 ChangeSet@1.1500, 2007-05-29 23:39:45-04:00, stenn@pogo.udel.edu ChangeLog: [Bug 825] Correct logconfig -/+ keyword processing. [Bug 828] Correct parsing of " delimited strings. ChangeLog@1.56 +2 -0 [Bug 825] Correct logconfig -/+ keyword processing. [Bug 828] Correct parsing of " delimited strings. ChangeSet@1.1499, 2007-05-29 15:46:00-04:00, neal@pogo.udel.edu ntp_config.c: [Bug 825] Correct logconfig -/+ keyword processing. ntp_scanner.c: [Bug 828] Correct parsing of " delimited strings. ntpd/ntp_config.c@1.153 +1 -1 [Bug 825] Correct logconfig -/+ keyword processing. ntpd/ntp_scanner.c@1.5 +14 -2 [Bug 828] Correct parsing of " delimited strings. ChangeSet@1.1498, 2007-05-29 09:39:55-04:00, stenn@whimsy.udel.edu NTP_4_2_5P40 TAG: NTP_4_2_5P40 ntpd/ntpd-opts.c@1.27 +2 -2 NTP_4_2_5P40 ntpd/ntpd-opts.h@1.27 +3 -3 NTP_4_2_5P40 ntpd/ntpd-opts.texi@1.26 +1 -1 NTP_4_2_5P40 ntpd/ntpd.1@1.26 +2 -2 NTP_4_2_5P40 ntpdc/ntpdc-opts.c@1.27 +2 -2 NTP_4_2_5P40 ntpdc/ntpdc-opts.h@1.27 +3 -3 NTP_4_2_5P40 ntpdc/ntpdc-opts.texi@1.26 +1 -1 NTP_4_2_5P40 ntpdc/ntpdc.1@1.26 +2 -2 NTP_4_2_5P40 ntpq/ntpq-opts.c@1.27 +2 -2 NTP_4_2_5P40 ntpq/ntpq-opts.h@1.27 +3 -3 NTP_4_2_5P40 ntpq/ntpq-opts.texi@1.26 +1 -1 NTP_4_2_5P40 ntpq/ntpq.1@1.26 +2 -2 NTP_4_2_5P40 packageinfo.sh@1.43 +1 -1 NTP_4_2_5P40 sntp/sntp-opts.c@1.27 +2 -2 NTP_4_2_5P40 sntp/sntp-opts.h@1.27 +3 -3 NTP_4_2_5P40 sntp/sntp-opts.texi@1.26 +1 -1 NTP_4_2_5P40 sntp/sntp.1@1.26 +2 -2 NTP_4_2_5P40 util/ntp-keygen-opts.c@1.28 +2 -2 NTP_4_2_5P40 util/ntp-keygen-opts.h@1.28 +3 -3 NTP_4_2_5P40 util/ntp-keygen-opts.texi@1.27 +1 -1 NTP_4_2_5P40 util/ntp-keygen.1@1.27 +2 -2 NTP_4_2_5P40 ChangeSet@1.1436.1.54, 2007-05-29 07:43:58-04:00, stenn@whimsy.udel.edu NTP_4_2_4P2_RC5 TAG: NTP_4_2_4P2_RC5 ntpd/ntpd-opts.c@1.50.6.1 +2 -2 NTP_4_2_4P2_RC5 ntpd/ntpd-opts.h@1.50.6.1 +3 -3 NTP_4_2_4P2_RC5 ntpd/ntpd-opts.texi@1.49.6.1 +1 -1 NTP_4_2_4P2_RC5 ntpd/ntpd.1@1.48.6.1 +2 -2 NTP_4_2_4P2_RC5 ntpd/ntpdsim-opts.c@1.50.6.1 +2 -2 NTP_4_2_4P2_RC5 ntpd/ntpdsim-opts.h@1.50.6.1 +3 -3 NTP_4_2_4P2_RC5 ntpd/ntpdsim-opts.texi@1.48.6.1 +1 -1 NTP_4_2_4P2_RC5 ntpd/ntpdsim.1@1.48.6.1 +2 -2 NTP_4_2_4P2_RC5 ntpdc/ntpdc-opts.c@1.50.6.1 +2 -2 NTP_4_2_4P2_RC5 ntpdc/ntpdc-opts.h@1.50.6.1 +3 -3 NTP_4_2_4P2_RC5 ntpdc/ntpdc-opts.texi@1.48.6.1 +1 -1 NTP_4_2_4P2_RC5 ntpdc/ntpdc.1@1.48.6.1 +2 -2 NTP_4_2_4P2_RC5 ntpq/ntpq-opts.c@1.52.6.1 +2 -2 NTP_4_2_4P2_RC5 ntpq/ntpq-opts.h@1.52.6.1 +3 -3 NTP_4_2_4P2_RC5 ntpq/ntpq-opts.texi@1.49.6.1 +1 -1 NTP_4_2_4P2_RC5 ntpq/ntpq.1@1.48.6.1 +2 -2 NTP_4_2_4P2_RC5 packageinfo.sh@1.65.12.1 +1 -1 NTP_4_2_4P2_RC5 sntp/sntp-opts.c@1.49.6.1 +2 -2 NTP_4_2_4P2_RC5 sntp/sntp-opts.h@1.49.6.1 +3 -3 NTP_4_2_4P2_RC5 sntp/sntp-opts.texi@1.46.6.1 +1 -1 NTP_4_2_4P2_RC5 sntp/sntp.1@1.49.6.1 +2 -2 NTP_4_2_4P2_RC5 util/ntp-keygen-opts.c@1.49.6.1 +2 -2 NTP_4_2_4P2_RC5 util/ntp-keygen-opts.h@1.49.6.1 +3 -3 NTP_4_2_4P2_RC5 util/ntp-keygen-opts.texi@1.47.6.1 +1 -1 NTP_4_2_4P2_RC5 util/ntp-keygen.1@1.47.6.1 +2 -2 NTP_4_2_4P2_RC5 ChangeSet@1.1436.1.53, 2007-05-29 01:32:29-04:00, stenn@whimsy.udel.edu typo cleanup ChangeLog@1.1.1.17 +1 -1 typo cleanup NEWS@1.86.1.7 +1 -2 typo cleanup ChangeSet@1.1496, 2007-05-29 01:07:40-04:00, stenn@whimsy.udel.edu Cleanup FILE * usage after fclose() in ntp_filegen.c ChangeLog@1.54 +5 -3 Cleanup FILE * usage after fclose() in ntp_filegen.c ntpd/ntp_filegen.c@1.13 +27 -19 Cleanup FILE * usage after fclose() in ntp_filegen.c ChangeSet@1.1495, 2007-05-28 07:47:31-04:00, stenn@whimsy.udel.edu NTP_4_2_5P39 TAG: NTP_4_2_5P39 ntpd/ntpd-opts.c@1.26 +2 -2 NTP_4_2_5P39 ntpd/ntpd-opts.h@1.26 +3 -3 NTP_4_2_5P39 ntpd/ntpd-opts.texi@1.25 +1 -1 NTP_4_2_5P39 ntpd/ntpd.1@1.25 +2 -2 NTP_4_2_5P39 ntpdc/ntpdc-opts.c@1.26 +2 -2 NTP_4_2_5P39 ntpdc/ntpdc-opts.h@1.26 +3 -3 NTP_4_2_5P39 ntpdc/ntpdc-opts.texi@1.25 +1 -1 NTP_4_2_5P39 ntpdc/ntpdc.1@1.25 +2 -2 NTP_4_2_5P39 ntpq/ntpq-opts.c@1.26 +2 -2 NTP_4_2_5P39 ntpq/ntpq-opts.h@1.26 +3 -3 NTP_4_2_5P39 ntpq/ntpq-opts.texi@1.25 +1 -1 NTP_4_2_5P39 ntpq/ntpq.1@1.25 +2 -2 NTP_4_2_5P39 packageinfo.sh@1.42 +1 -1 NTP_4_2_5P39 sntp/sntp-opts.c@1.26 +2 -2 NTP_4_2_5P39 sntp/sntp-opts.h@1.26 +3 -3 NTP_4_2_5P39 sntp/sntp-opts.texi@1.25 +1 -1 NTP_4_2_5P39 sntp/sntp.1@1.25 +2 -2 NTP_4_2_5P39 util/ntp-keygen-opts.c@1.27 +2 -2 NTP_4_2_5P39 util/ntp-keygen-opts.h@1.27 +3 -3 NTP_4_2_5P39 util/ntp-keygen-opts.texi@1.26 +1 -1 NTP_4_2_5P39 util/ntp-keygen.1@1.26 +2 -2 NTP_4_2_5P39 ChangeSet@1.1436.1.52, 2007-05-28 10:00:27+00:00, kardel@pogo.udel.edu NEWS, ntp_io.c, ChangeLog: Bug 829: reduce syslog noise, while there fix Enabled/Disable logging to reflect the actual configuration ChangeLog@1.1.1.16 +2 -0 Bug 829: reduce syslog noise, while there fix Enabled/Disable logging to reflect the actual configuration NEWS@1.86.1.6 +3 -0 Bug 829: reduce syslog noise, while there fix Enabled/Disable logging to reflect the actual configuration ntpd/ntp_io.c@1.244.2.6 +58 -44 Bug 829: reduce syslog noise, while there fix Enabled/Disable logging to reflect the actual configuration ChangeSet@1.1493, 2007-05-27 20:13:47-04:00, mayer@pogo.udel.edu Bug #843 Windows Completion port code was incorrectly merged from -stable ChangeLog@1.53 +1 -0 Bug #843 Windows Completion port code was incorrectly merged from -stable ChangeSet@1.1492, 2007-05-27 20:11:03-04:00, mayer@pogo.udel.edu Bug #843 Windows Completion port code was incorrectly merged from -stable ports/winnt/ntpd/ntp_iocompletionport.c@1.25 +0 -15 Bug #843 Windows Completion port code was incorrectly merged from -stable ChangeSet@1.1491, 2007-05-27 09:46:31-04:00, stenn@whimsy.udel.edu NTP_4_2_5P38 TAG: NTP_4_2_5P38 ntpd/ntpd-opts.c@1.25 +2 -2 NTP_4_2_5P38 ntpd/ntpd-opts.h@1.25 +3 -3 NTP_4_2_5P38 ntpd/ntpd-opts.texi@1.24 +1 -1 NTP_4_2_5P38 ntpd/ntpd.1@1.24 +2 -2 NTP_4_2_5P38 ntpdc/ntpdc-opts.c@1.25 +2 -2 NTP_4_2_5P38 ntpdc/ntpdc-opts.h@1.25 +3 -3 NTP_4_2_5P38 ntpdc/ntpdc-opts.texi@1.24 +1 -1 NTP_4_2_5P38 ntpdc/ntpdc.1@1.24 +2 -2 NTP_4_2_5P38 ntpq/ntpq-opts.c@1.25 +2 -2 NTP_4_2_5P38 ntpq/ntpq-opts.h@1.25 +3 -3 NTP_4_2_5P38 ntpq/ntpq-opts.texi@1.24 +1 -1 NTP_4_2_5P38 ntpq/ntpq.1@1.24 +2 -2 NTP_4_2_5P38 packageinfo.sh@1.41 +1 -1 NTP_4_2_5P38 sntp/sntp-opts.c@1.25 +2 -2 NTP_4_2_5P38 sntp/sntp-opts.h@1.25 +3 -3 NTP_4_2_5P38 sntp/sntp-opts.texi@1.24 +1 -1 NTP_4_2_5P38 sntp/sntp.1@1.24 +2 -2 NTP_4_2_5P38 util/ntp-keygen-opts.c@1.26 +2 -2 NTP_4_2_5P38 util/ntp-keygen-opts.h@1.26 +3 -3 NTP_4_2_5P38 util/ntp-keygen-opts.texi@1.25 +1 -1 NTP_4_2_5P38 util/ntp-keygen.1@1.25 +2 -2 NTP_4_2_5P38 ChangeSet@1.1436.1.51, 2007-05-27 07:45:05-04:00, stenn@whimsy.udel.edu NTP_4_2_4P2_RC4 TAG: NTP_4_2_4P2_RC4 ntpd/ntpd-opts.c@1.50.5.1 +2 -2 NTP_4_2_4P2_RC4 ntpd/ntpd-opts.h@1.50.5.1 +3 -3 NTP_4_2_4P2_RC4 ntpd/ntpd-opts.texi@1.49.5.1 +1 -1 NTP_4_2_4P2_RC4 ntpd/ntpd.1@1.48.5.1 +2 -2 NTP_4_2_4P2_RC4 ntpd/ntpdsim-opts.c@1.50.5.1 +2 -2 NTP_4_2_4P2_RC4 ntpd/ntpdsim-opts.h@1.50.5.1 +3 -3 NTP_4_2_4P2_RC4 ntpd/ntpdsim-opts.texi@1.48.5.1 +1 -1 NTP_4_2_4P2_RC4 ntpd/ntpdsim.1@1.48.5.1 +2 -2 NTP_4_2_4P2_RC4 ntpdc/ntpdc-opts.c@1.50.5.1 +2 -2 NTP_4_2_4P2_RC4 ntpdc/ntpdc-opts.h@1.50.5.1 +3 -3 NTP_4_2_4P2_RC4 ntpdc/ntpdc-opts.texi@1.48.5.1 +1 -1 NTP_4_2_4P2_RC4 ntpdc/ntpdc.1@1.48.5.1 +2 -2 NTP_4_2_4P2_RC4 ntpq/ntpq-opts.c@1.52.5.1 +2 -2 NTP_4_2_4P2_RC4 ntpq/ntpq-opts.h@1.52.5.1 +3 -3 NTP_4_2_4P2_RC4 ntpq/ntpq-opts.texi@1.49.5.1 +1 -1 NTP_4_2_4P2_RC4 ntpq/ntpq.1@1.48.5.1 +2 -2 NTP_4_2_4P2_RC4 packageinfo.sh@1.65.11.1 +1 -1 NTP_4_2_4P2_RC4 sntp/sntp-opts.c@1.49.5.1 +2 -2 NTP_4_2_4P2_RC4 sntp/sntp-opts.h@1.49.5.1 +3 -3 NTP_4_2_4P2_RC4 sntp/sntp-opts.texi@1.46.5.1 +1 -1 NTP_4_2_4P2_RC4 sntp/sntp.1@1.49.5.1 +2 -2 NTP_4_2_4P2_RC4 util/ntp-keygen-opts.c@1.49.5.1 +2 -2 NTP_4_2_4P2_RC4 util/ntp-keygen-opts.h@1.49.5.1 +3 -3 NTP_4_2_4P2_RC4 util/ntp-keygen-opts.texi@1.47.5.1 +1 -1 NTP_4_2_4P2_RC4 util/ntp-keygen.1@1.47.5.1 +2 -2 NTP_4_2_4P2_RC4 ChangeSet@1.1436.1.50, 2007-05-27 00:52:52-04:00, stenn@whimsy.udel.edu update NEWS file with new fixes NEWS@1.86.1.5 +6 -0 update NEWS file with new fixes ChangeSet@1.1436.1.49, 2007-05-27 00:31:51-04:00, stenn@deacon.udel.edu Cleanup ChangeLog@1.1.1.15 +2 -2 Cleanup ChangeSet@1.1485.2.2, 2007-05-26 15:10:28+00:00, kardel@pogo.udel.edu Many files: Bug 841: make deferred binding to local interface the default ChangeLog@1.47.2.2 +2 -0 Bug 841: make deferred binding to local interface the default html/confopt.html@1.36 +0 -2 Bug 841: make deferred binding to local interface the default html/ntpdc.html@1.27 +2 -3 Bug 841: make deferred binding to local interface the default include/ntp.h@1.131 +0 -1 Bug 841: make deferred binding to local interface the default include/ntp_request.h@1.31 +0 -1 Bug 841: make deferred binding to local interface the default ntpd/ntp_intres.c@1.51 +1 -3 Bug 841: make deferred binding to local interface the default ntpd/ntp_peer.c@1.101.1.1 +1 -20 Bug 841: make deferred binding to local interface the default ntpd/ntp_request.c@1.67 +1 -3 Bug 841: make deferred binding to local interface the default ntpdc/ntpdc_ops.c@1.48 +2 -4 Bug 841: make deferred binding to local interface the default ChangeSet@1.1485.2.1, 2007-05-26 13:29:05+00:00, kardel@pogo.udel.edu ChangeLog: Bug 840: do fudge configuration AFTER peers (thus refclocks) have been configured ntp_config.c: Bug 840: do fudge configuration AFTER peers (thus refclocks) have been configured ChangeLog@1.47.2.1 +1 -0 Bug 840: do fudge configuration AFTER peers (thus refclocks) have been configured ntpd/ntp_config.c@1.152 +1 -1 Bug 840: do fudge commands AFTER configuring peers (and thus refclocks) ChangeSet@1.1487.1.1, 2007-05-26 08:05:51-04:00, stenn@whimsy.udel.edu NTP_4_2_5P37 TAG: NTP_4_2_5P37 ntpd/ntpd-opts.c@1.24 +2 -2 NTP_4_2_5P37 ntpd/ntpd-opts.h@1.24 +3 -3 NTP_4_2_5P37 ntpd/ntpd-opts.texi@1.23 +1 -1 NTP_4_2_5P37 ntpd/ntpd.1@1.23 +2 -2 NTP_4_2_5P37 ntpdc/ntpdc-opts.c@1.24 +2 -2 NTP_4_2_5P37 ntpdc/ntpdc-opts.h@1.24 +3 -3 NTP_4_2_5P37 ntpdc/ntpdc-opts.texi@1.23 +1 -1 NTP_4_2_5P37 ntpdc/ntpdc.1@1.23 +2 -2 NTP_4_2_5P37 ntpq/ntpq-opts.c@1.24 +2 -2 NTP_4_2_5P37 ntpq/ntpq-opts.h@1.24 +3 -3 NTP_4_2_5P37 ntpq/ntpq-opts.texi@1.23 +1 -1 NTP_4_2_5P37 ntpq/ntpq.1@1.23 +2 -2 NTP_4_2_5P37 packageinfo.sh@1.40 +1 -1 NTP_4_2_5P37 sntp/sntp-opts.c@1.24 +2 -2 NTP_4_2_5P37 sntp/sntp-opts.h@1.24 +3 -3 NTP_4_2_5P37 sntp/sntp-opts.texi@1.23 +1 -1 NTP_4_2_5P37 sntp/sntp.1@1.23 +2 -2 NTP_4_2_5P37 util/ntp-keygen-opts.c@1.25 +2 -2 NTP_4_2_5P37 util/ntp-keygen-opts.h@1.25 +3 -3 NTP_4_2_5P37 util/ntp-keygen-opts.texi@1.24 +1 -1 NTP_4_2_5P37 util/ntp-keygen.1@1.24 +2 -2 NTP_4_2_5P37 ChangeSet@1.1436.1.48, 2007-05-26 08:00:03+00:00, kardel@pogo.udel.edu ntp_io.c: [Bug 795] Moved declaration of variable to top of function. ChangeLog: [Bug 795] Moved declaration of variable to top of function. ChangeLog@1.1.1.14 +1 -0 Bug 795 ntpd/ntp_io.c@1.244.2.5 +4 -1 [Bug 795] Moved declaration of variable to top of function. ChangeSet@1.1436.3.9, 2007-05-25 07:44:43-04:00, stenn@whimsy.udel.edu NTP_4_2_4P2_RC3 TAG: NTP_4_2_4P2_RC3 ntpd/ntpd-opts.c@1.50.4.1 +2 -2 NTP_4_2_4P2_RC3 ntpd/ntpd-opts.h@1.50.4.1 +3 -3 NTP_4_2_4P2_RC3 ntpd/ntpd-opts.texi@1.49.4.1 +1 -1 NTP_4_2_4P2_RC3 ntpd/ntpd.1@1.48.4.1 +2 -2 NTP_4_2_4P2_RC3 ntpd/ntpdsim-opts.c@1.50.4.1 +2 -2 NTP_4_2_4P2_RC3 ntpd/ntpdsim-opts.h@1.50.4.1 +3 -3 NTP_4_2_4P2_RC3 ntpd/ntpdsim-opts.texi@1.48.4.1 +1 -1 NTP_4_2_4P2_RC3 ntpd/ntpdsim.1@1.48.4.1 +2 -2 NTP_4_2_4P2_RC3 ntpdc/ntpdc-opts.c@1.50.4.1 +2 -2 NTP_4_2_4P2_RC3 ntpdc/ntpdc-opts.h@1.50.4.1 +3 -3 NTP_4_2_4P2_RC3 ntpdc/ntpdc-opts.texi@1.48.4.1 +1 -1 NTP_4_2_4P2_RC3 ntpdc/ntpdc.1@1.48.4.1 +2 -2 NTP_4_2_4P2_RC3 ntpq/ntpq-opts.c@1.52.4.1 +2 -2 NTP_4_2_4P2_RC3 ntpq/ntpq-opts.h@1.52.4.1 +3 -3 NTP_4_2_4P2_RC3 ntpq/ntpq-opts.texi@1.49.4.1 +1 -1 NTP_4_2_4P2_RC3 ntpq/ntpq.1@1.48.4.1 +2 -2 NTP_4_2_4P2_RC3 packageinfo.sh@1.65.10.1 +1 -1 NTP_4_2_4P2_RC3 sntp/sntp-opts.c@1.49.4.1 +2 -2 NTP_4_2_4P2_RC3 sntp/sntp-opts.h@1.49.4.1 +3 -3 NTP_4_2_4P2_RC3 sntp/sntp-opts.texi@1.46.4.1 +1 -1 NTP_4_2_4P2_RC3 sntp/sntp.1@1.49.4.1 +2 -2 NTP_4_2_4P2_RC3 util/ntp-keygen-opts.c@1.49.4.1 +2 -2 NTP_4_2_4P2_RC3 util/ntp-keygen-opts.h@1.49.4.1 +3 -3 NTP_4_2_4P2_RC3 util/ntp-keygen-opts.texi@1.47.4.1 +1 -1 NTP_4_2_4P2_RC3 util/ntp-keygen.1@1.47.4.1 +2 -2 NTP_4_2_4P2_RC3 ChangeSet@1.1436.3.8, 2007-05-25 02:18:59-04:00, stenn@whimsy.udel.edu cleanup NEWS@1.86.1.4 +1 -0 cleanup ChangeSet@1.1436.4.1, 2007-05-25 02:06:52-04:00, stenn@whimsy.udel.edu Upgraded autogen and libopts ChangeLog@1.1.3.1 +1 -0 Upgraded autogen and libopts NEWS@1.86.1.3 +1 -0 Upgraded autogen and libopts ChangeSet@1.1436.3.6, 2007-05-25 01:07:59-04:00, stenn@pogo.udel.edu cleanup ChangeLog ChangeLog@1.1.2.3 +1 -1 cleanup ChangeLog ChangeSet@1.1436.3.5, 2007-05-24 08:10:30-04:00, mayer@pogo.udel.edu Bug #527 Don't write from source address length to wrong location ChangeLog@1.1.2.2 +1 -0 Bug #527 Don't write from source address length to wrong location ChangeSet@1.1436.3.4, 2007-05-24 08:08:34-04:00, mayer@pogo.udel.edu Bug #527 Don't write from source address length to wrong location include/recvbuff.h@1.11.1.1 +2 -0 Bug #527 Don't write from source address length to wrong location libntp/recvbuff.c@1.25 +27 -13 Bug #527 Don't write from source address length to wrong location ports/winnt/libntp/transmitbuff.c@1.7 +10 -10 Bug #527 Don't write from source address length to wrong location ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.1 +76 -62 Bug #527 Don't write from source address length to wrong location ChangeSet@1.1485.1.2, 2007-05-24 07:44:46-04:00, stenn@whimsy.udel.edu NTP_4_2_5P36 TAG: NTP_4_2_5P36 ntpd/ntpd-opts.c@1.23 +2 -2 NTP_4_2_5P36 ntpd/ntpd-opts.h@1.23 +3 -3 NTP_4_2_5P36 ntpd/ntpd-opts.texi@1.22 +1 -1 NTP_4_2_5P36 ntpd/ntpd.1@1.22 +2 -2 NTP_4_2_5P36 ntpdc/ntpdc-opts.c@1.23 +2 -2 NTP_4_2_5P36 ntpdc/ntpdc-opts.h@1.23 +3 -3 NTP_4_2_5P36 ntpdc/ntpdc-opts.texi@1.22 +1 -1 NTP_4_2_5P36 ntpdc/ntpdc.1@1.22 +2 -2 NTP_4_2_5P36 ntpq/ntpq-opts.c@1.23 +2 -2 NTP_4_2_5P36 ntpq/ntpq-opts.h@1.23 +3 -3 NTP_4_2_5P36 ntpq/ntpq-opts.texi@1.22 +1 -1 NTP_4_2_5P36 ntpq/ntpq.1@1.22 +2 -2 NTP_4_2_5P36 packageinfo.sh@1.39 +1 -1 NTP_4_2_5P36 sntp/sntp-opts.c@1.23 +2 -2 NTP_4_2_5P36 sntp/sntp-opts.h@1.23 +3 -3 NTP_4_2_5P36 sntp/sntp-opts.texi@1.22 +1 -1 NTP_4_2_5P36 sntp/sntp.1@1.22 +2 -2 NTP_4_2_5P36 util/ntp-keygen-opts.c@1.24 +2 -2 NTP_4_2_5P36 util/ntp-keygen-opts.h@1.24 +3 -3 NTP_4_2_5P36 util/ntp-keygen-opts.texi@1.23 +1 -1 NTP_4_2_5P36 util/ntp-keygen.1@1.23 +2 -2 NTP_4_2_5P36 ChangeSet@1.1485.1.1, 2007-05-24 01:38:12-04:00, stenn@whimsy.udel.edu [Bug 832] Add libisc/log.c headers to the distribution. ChangeLog@1.47.1.1 +1 -0 [Bug 832] Add libisc/log.c headers to the distribution. include/isc/Makefile.am@1.6 +6 -0 [Bug 832] Add libisc/log.c headers to the distribution. ChangeSet@1.1486, 2007-05-22 15:19:42+00:00, burnicki@pogo.udel.edu [Bug 824] Added the new parser modules to the Windows project file. ChangeLog@1.48 +1 -0 Added the new parser modules to the Windows project file. ports/winnt/ntpd/ntpd.dsp@1.30 +12 -0 Added the new parser modules to the Windows project file. ChangeSet@1.1485, 2007-05-21 07:44:27-04:00, stenn@whimsy.udel.edu NTP_4_2_5P35 TAG: NTP_4_2_5P35 ntpd/ntpd-opts.c@1.22 +2 -2 NTP_4_2_5P35 ntpd/ntpd-opts.h@1.22 +3 -3 NTP_4_2_5P35 ntpd/ntpd-opts.texi@1.21 +1 -1 NTP_4_2_5P35 ntpd/ntpd.1@1.21 +2 -2 NTP_4_2_5P35 ntpdc/ntpdc-opts.c@1.22 +2 -2 NTP_4_2_5P35 ntpdc/ntpdc-opts.h@1.22 +3 -3 NTP_4_2_5P35 ntpdc/ntpdc-opts.texi@1.21 +1 -1 NTP_4_2_5P35 ntpdc/ntpdc.1@1.21 +2 -2 NTP_4_2_5P35 ntpq/ntpq-opts.c@1.22 +2 -2 NTP_4_2_5P35 ntpq/ntpq-opts.h@1.22 +3 -3 NTP_4_2_5P35 ntpq/ntpq-opts.texi@1.21 +1 -1 NTP_4_2_5P35 ntpq/ntpq.1@1.21 +2 -2 NTP_4_2_5P35 packageinfo.sh@1.38 +1 -1 NTP_4_2_5P35 sntp/sntp-opts.c@1.22 +2 -2 NTP_4_2_5P35 sntp/sntp-opts.h@1.22 +3 -3 NTP_4_2_5P35 sntp/sntp-opts.texi@1.21 +1 -1 NTP_4_2_5P35 sntp/sntp.1@1.21 +2 -2 NTP_4_2_5P35 util/ntp-keygen-opts.c@1.23 +2 -2 NTP_4_2_5P35 util/ntp-keygen-opts.h@1.23 +3 -3 NTP_4_2_5P35 util/ntp-keygen-opts.texi@1.22 +1 -1 NTP_4_2_5P35 util/ntp-keygen.1@1.22 +2 -2 NTP_4_2_5P35 ChangeSet@1.1484, 2007-05-21 00:29:26-04:00, stenn@whimsy.udel.edu [Bug 808] Only write the drift file if we are in state 4 ChangeLog@1.47 +1 -0 [Bug 808] Only write the drift file if we are in state 4 ntpd/ntp_util.c@1.45 +27 -24 [Bug 808] Only write the drift file if we are in state 4 ChangeSet@1.1483, 2007-05-20 21:52:55-04:00, stenn@whimsy.udel.edu Initial import of libisc/log.c and friends libntp/Makefile.am@1.39 +1 -0 Initial import of libisc/log.c and friends ChangeSet@1.1482, 2007-05-20 16:32:43-04:00, stenn@whimsy.udel.edu Initial import of libisc/log.c and friends ChangeLog@1.46 +1 -0 Initial import of libisc/log.c and friends include/isc/dir.h@1.1 +94 -0 BitKeeper file /deacon/backroom/ntp-dev/include/isc/dir.h include/isc/dir.h@1.0 +0 -0 include/isc/file.h@1.1 +256 -0 BitKeeper file /deacon/backroom/ntp-dev/include/isc/file.h include/isc/file.h@1.0 +0 -0 include/isc/log.h@1.1 +913 -0 BitKeeper file /deacon/backroom/ntp-dev/include/isc/log.h include/isc/log.h@1.0 +0 -0 include/isc/stat.h@1.1 +52 -0 BitKeeper file /deacon/backroom/ntp-dev/include/isc/stat.h include/isc/stat.h@1.0 +0 -0 include/isc/stdio.h@1.1 +77 -0 BitKeeper file /deacon/backroom/ntp-dev/include/isc/stdio.h include/isc/stdio.h@1.0 +0 -0 include/isc/time.h@1.1 +304 -0 BitKeeper file /deacon/backroom/ntp-dev/include/isc/time.h include/isc/time.h@1.0 +0 -0 libisc/log.c@1.1 +1762 -0 BitKeeper file /deacon/backroom/ntp-dev/libisc/log.c libisc/log.c@1.0 +0 -0 ChangeSet@1.1436.3.3, 2007-05-19 07:53:57-04:00, stenn@whimsy.udel.edu NTP_4_2_4P2_RC2 TAG: NTP_4_2_4P2_RC2 ntpd/ntpd-opts.c@1.50.3.2 +4 -4 NTP_4_2_4P2_RC2 ntpd/ntpd-opts.h@1.50.3.2 +3 -3 NTP_4_2_4P2_RC2 ntpd/ntpd-opts.texi@1.49.3.2 +1 -1 NTP_4_2_4P2_RC2 ntpd/ntpd.1@1.48.3.2 +2 -2 NTP_4_2_4P2_RC2 ntpd/ntpdsim-opts.c@1.50.3.2 +4 -4 NTP_4_2_4P2_RC2 ntpd/ntpdsim-opts.h@1.50.3.2 +3 -3 NTP_4_2_4P2_RC2 ntpd/ntpdsim-opts.texi@1.48.3.2 +1 -1 NTP_4_2_4P2_RC2 ntpd/ntpdsim.1@1.48.3.2 +2 -2 NTP_4_2_4P2_RC2 ntpdc/ntpdc-opts.c@1.50.3.2 +4 -4 NTP_4_2_4P2_RC2 ntpdc/ntpdc-opts.h@1.50.3.2 +3 -3 NTP_4_2_4P2_RC2 ntpdc/ntpdc-opts.texi@1.48.3.2 +2 -2 NTP_4_2_4P2_RC2 ntpdc/ntpdc.1@1.48.3.2 +2 -2 NTP_4_2_4P2_RC2 ntpq/ntpq-opts.c@1.52.3.2 +4 -4 NTP_4_2_4P2_RC2 ntpq/ntpq-opts.h@1.52.3.2 +3 -3 NTP_4_2_4P2_RC2 ntpq/ntpq-opts.texi@1.49.3.2 +2 -2 NTP_4_2_4P2_RC2 ntpq/ntpq.1@1.48.3.2 +2 -2 NTP_4_2_4P2_RC2 packageinfo.sh@1.65.9.3 +1 -1 NTP_4_2_4P2_RC2 sntp/sntp-opts.c@1.49.3.2 +2 -2 NTP_4_2_4P2_RC2 sntp/sntp-opts.h@1.49.3.2 +3 -3 NTP_4_2_4P2_RC2 sntp/sntp-opts.texi@1.46.3.2 +1 -1 NTP_4_2_4P2_RC2 sntp/sntp.1@1.49.3.2 +2 -2 NTP_4_2_4P2_RC2 util/ntp-keygen-opts.c@1.49.3.2 +4 -4 NTP_4_2_4P2_RC2 util/ntp-keygen-opts.h@1.49.3.2 +3 -3 NTP_4_2_4P2_RC2 util/ntp-keygen-opts.texi@1.47.3.2 +2 -2 NTP_4_2_4P2_RC2 util/ntp-keygen.1@1.47.3.2 +2 -2 NTP_4_2_4P2_RC2 ChangeSet@1.1436.3.2, 2007-05-19 02:33:04-04:00, stenn@whimsy.udel.edu We need another RC release to be sure the new autogen/libopts works. BitKeeper/deleted/.del-COPYING.lgpl~492b62c9d62ba57a@1.1.1.1 +0 -0 Delete: sntp/libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.lgpl~adfa2ac04d64c0f7@1.1.1.1 +0 -0 Delete: libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.mbsd~7e1baaedfa33c877@1.1.1.1 +0 -0 Delete: libopts/COPYING.mbsd BitKeeper/deleted/.del-COPYING.mbsd~e8244dcf5895b58f@1.1.1.1 +0 -0 Delete: sntp/libopts/COPYING.mbsd BitKeeper/deleted/.del-MakeDefs.inc~3fd54e9b117bfdad@1.1.1.1 +0 -0 Delete: sntp/libopts/MakeDefs.inc BitKeeper/deleted/.del-MakeDefs.inc~511eb438badc27b@1.1.1.1 +0 -0 Delete: libopts/MakeDefs.inc BitKeeper/deleted/.del-Makefile.am~65692661e68a4392@1.1.1.1 +0 -0 Delete: libopts/Makefile.am BitKeeper/deleted/.del-Makefile.am~fdf1a715e04b5f2c@1.1.1.1 +0 -0 Delete: sntp/libopts/Makefile.am BitKeeper/deleted/.del-README~7ed47aff36cc39c@1.1.1.1 +0 -0 Delete: sntp/libopts/README BitKeeper/deleted/.del-README~cec57621589d1ea6@1.1.1.1 +0 -0 Delete: libopts/README BitKeeper/deleted/.del-autoopts.c~7b48d6dc5ca9c3b@1.1.1.1 +0 -0 Delete: sntp/libopts/autoopts.c BitKeeper/deleted/.del-autoopts.c~917f3eb3a2030087@1.1.1.1 +0 -0 Delete: libopts/autoopts.c BitKeeper/deleted/.del-autoopts.h~4184ad33bbb8222@1.1.1.1 +0 -0 Delete: libopts/autoopts.h BitKeeper/deleted/.del-autoopts.h~d0834f397c8a330d@1.1.1.1 +0 -0 Delete: sntp/libopts/autoopts.h BitKeeper/deleted/.del-boolean.c~50ae286fc516eee2@1.1.1.1 +0 -0 Delete: sntp/libopts/boolean.c BitKeeper/deleted/.del-boolean.c~afd23e01a43b9536@1.1.1.1 +0 -0 Delete: libopts/boolean.c BitKeeper/deleted/.del-compat.h~2bcdd381f6a570a1@1.1.1.1 +0 -0 Delete: sntp/libopts/compat/compat.h BitKeeper/deleted/.del-compat.h~e5d9fc11f0b928f2@1.1.1.1 +0 -0 Delete: libopts/compat/compat.h BitKeeper/deleted/.del-configfile.c~53384c73e434a615@1.1.1.1 +0 -0 Delete: libopts/configfile.c BitKeeper/deleted/.del-configfile.c~ee0b7d49d26b4f74@1.1.1.1 +0 -0 Delete: sntp/libopts/configfile.c BitKeeper/deleted/.del-cook.c~760181d2119b672@1.1.1.1 +0 -0 Delete: sntp/libopts/cook.c BitKeeper/deleted/.del-cook.c~84c1af00a5581292@1.1.1.1 +0 -0 Delete: libopts/cook.c BitKeeper/deleted/.del-enumeration.c~551805256cb9068c@1.1.1.1 +0 -0 Delete: libopts/enumeration.c BitKeeper/deleted/.del-enumeration.c~969462e75e3913a3@1.1.1.1 +0 -0 Delete: sntp/libopts/enumeration.c BitKeeper/deleted/.del-environment.c~643ce1e5a16a4f94@1.1.1.1 +0 -0 Delete: sntp/libopts/environment.c BitKeeper/deleted/.del-environment.c~965d8c0fdf1150f5@1.1.1.1 +0 -0 Delete: libopts/environment.c BitKeeper/deleted/.del-genshell.c~20529138c60103c3@1.1.1.1 +0 -0 Delete: libopts/genshell.c BitKeeper/deleted/.del-genshell.c~bd74153097ec640f@1.1.1.1 +0 -0 Delete: sntp/libopts/genshell.c BitKeeper/deleted/.del-genshell.h~7f41539b135f914a@1.1.1.1 +0 -0 Delete: libopts/genshell.h BitKeeper/deleted/.del-genshell.h~b2793e1ea2981ff5@1.1.1.1 +0 -0 Delete: sntp/libopts/genshell.h BitKeeper/deleted/.del-libopts.c~9353e1c3a0c56ad@1.1.1.1 +0 -0 Delete: libopts/libopts.c BitKeeper/deleted/.del-libopts.c~bfc74bb368a309be@1.1.1.1 +0 -0 Delete: sntp/libopts/libopts.c BitKeeper/deleted/.del-libopts.m4~9851dd84df41023b@1.1.1.1 +0 -0 Delete: libopts/m4/libopts.m4 BitKeeper/deleted/.del-libopts.m4~9fa7e371d1cc0426@1.1.1.1 +0 -0 Delete: sntp/libopts/m4/libopts.m4 BitKeeper/deleted/.del-liboptschk.m4~1828e1c4576e5aea@1.1.1.1 +0 -0 Delete: libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-liboptschk.m4~480d5c4f1634a9fa@1.1.1.1 +0 -0 Delete: sntp/libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-load.c~688d4934eb14272@1.1.1.1 +0 -0 Delete: sntp/libopts/load.c BitKeeper/deleted/.del-load.c~b6aa568c6e3eaca1@1.1.1.1 +0 -0 Delete: libopts/load.c BitKeeper/deleted/.del-makeshell.c~8c63bc5a263da752@1.1.1.1 +0 -0 Delete: sntp/libopts/makeshell.c BitKeeper/deleted/.del-makeshell.c~a9cd96c3bfbc0835@1.1.1.1 +0 -0 Delete: libopts/makeshell.c BitKeeper/deleted/.del-nested.c~1670193227f54043@1.1.1.1 +0 -0 Delete: sntp/libopts/nested.c BitKeeper/deleted/.del-nested.c~a8521c8fcff292b6@1.1.1.1 +0 -0 Delete: libopts/nested.c BitKeeper/deleted/.del-numeric.c~eb3fbec29633e61@1.1.1.1 +0 -0 Delete: sntp/libopts/numeric.c BitKeeper/deleted/.del-numeric.c~ec644fa246942cbc@1.1.1.1 +0 -0 Delete: libopts/numeric.c BitKeeper/deleted/.del-options.h~3cb6af32ad01957@1.1.1.1 +0 -0 Delete: sntp/libopts/autoopts/options.h BitKeeper/deleted/.del-options.h~f700d69ce23e3e23@1.1.1.1 +0 -0 Delete: libopts/autoopts/options.h BitKeeper/deleted/.del-pathfind.c~953a96dbc9932@1.1.1.1 +0 -0 Delete: sntp/libopts/compat/pathfind.c BitKeeper/deleted/.del-pathfind.c~c132dab083075929@1.1.1.1 +0 -0 Delete: libopts/compat/pathfind.c BitKeeper/deleted/.del-pgusage.c~5c1f8f132e9a1546@1.1.1.1 +0 -0 Delete: sntp/libopts/pgusage.c BitKeeper/deleted/.del-pgusage.c~cec1309617012832@1.1.1.1 +0 -0 Delete: libopts/pgusage.c BitKeeper/deleted/.del-proto.h~697b4937ff37ca3f@1.1.1.1 +0 -0 Delete: sntp/libopts/proto.h BitKeeper/deleted/.del-proto.h~e2a13f546fbc0d4f@1.1.1.1 +0 -0 Delete: libopts/proto.h BitKeeper/deleted/.del-putshell.c~6845ea506fad6426@1.1.1.1 +0 -0 Delete: sntp/libopts/putshell.c BitKeeper/deleted/.del-putshell.c~6e39e6836261f3f7@1.1.1.1 +0 -0 Delete: libopts/putshell.c BitKeeper/deleted/.del-restore.c~c14d8b96be44c6a8@1.1.1.1 +0 -0 Delete: sntp/libopts/restore.c BitKeeper/deleted/.del-restore.c~e2a155efceab6f0d@1.1.1.1 +0 -0 Delete: libopts/restore.c BitKeeper/deleted/.del-save.c~17e5ac125a404fb0@1.1.1.1 +0 -0 Delete: libopts/save.c BitKeeper/deleted/.del-save.c~e7e7366cd24e1a8f@1.1.1.1 +0 -0 Delete: sntp/libopts/save.c BitKeeper/deleted/.del-snprintf.c~4b42e45647e9ccef@1.1.1.1 +0 -0 Delete: libopts/compat/snprintf.c BitKeeper/deleted/.del-snprintf.c~988df6799c67781f@1.1.1.1 +0 -0 Delete: sntp/libopts/compat/snprintf.c BitKeeper/deleted/.del-sort.c~586535d7d26d958@1.1.1.1 +0 -0 Delete: sntp/libopts/sort.c BitKeeper/deleted/.del-sort.c~bb92da923b5dcb7@1.1.1.1 +0 -0 Delete: libopts/sort.c BitKeeper/deleted/.del-stack.c~202d33ccdfd74ec@1.1.1.1 +0 -0 Delete: sntp/libopts/stack.c BitKeeper/deleted/.del-stack.c~b60d0ab82970f41f@1.1.1.1 +0 -0 Delete: libopts/stack.c BitKeeper/deleted/.del-strchr.c~4a7e412c18f53557@1.1.1.1 +0 -0 Delete: sntp/libopts/compat/strchr.c BitKeeper/deleted/.del-strchr.c~7f4589858587fcc4@1.1.1.1 +0 -0 Delete: libopts/compat/strchr.c BitKeeper/deleted/.del-strdup.c~75e27662f28944b1@1.1.1.1 +0 -0 Delete: sntp/libopts/compat/strdup.c BitKeeper/deleted/.del-strdup.c~b295027011406c46@1.1.1.1 +0 -0 Delete: libopts/compat/strdup.c BitKeeper/deleted/.del-streqvcmp.c~999e9cfa251ea4b3@1.1.1.1 +0 -0 Delete: libopts/streqvcmp.c BitKeeper/deleted/.del-streqvcmp.c~dc5534ffb1c6f28@1.1.1.1 +0 -0 Delete: sntp/libopts/streqvcmp.c BitKeeper/deleted/.del-text_mmap.c~52f2f1dbe57a9743@1.1.1.1 +0 -0 Delete: libopts/text_mmap.c BitKeeper/deleted/.del-text_mmap.c~e5096667484e499a@1.1.1.1 +0 -0 Delete: sntp/libopts/text_mmap.c BitKeeper/deleted/.del-tokenize.c~315c26f9b162f234@1.1.1.1 +0 -0 Delete: sntp/libopts/tokenize.c BitKeeper/deleted/.del-tokenize.c~6a814216fa293c3c@1.1.1.1 +0 -0 Delete: libopts/tokenize.c BitKeeper/deleted/.del-usage-txt.h~3737a7c76813e8c3@1.1.1.1 +0 -0 Delete: libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage-txt.h~b71acc916d68c58c@1.1.1.1 +0 -0 Delete: sntp/libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage.c~f21924faa210bfa9@1.1.1.1 +0 -0 Delete: sntp/libopts/usage.c BitKeeper/deleted/.del-usage.c~fe9a0f55b3cc55e4@1.1.1.1 +0 -0 Delete: libopts/usage.c BitKeeper/deleted/.del-version.c~b69eccbdea7f51d9@1.1.1.1 +0 -0 Delete: sntp/libopts/version.c BitKeeper/deleted/.del-version.c~de7f014d3e2ac91e@1.1.1.1 +0 -0 Delete: libopts/version.c BitKeeper/deleted/.del-windows-config.h~11a9a57b2895598f@1.1.1.1 +0 -0 Delete: sntp/libopts/compat/windows-config.h BitKeeper/deleted/.del-windows-config.h~a6ead462c3d18ff0@1.1.1.1 +0 -0 Delete: libopts/compat/windows-config.h clockstuff/clktest-opts.c@1.9.1.1 +38 -270 We need to use the upgraded autogen/libopts in -stable too. clockstuff/clktest-opts.def@1.5.1.1 +4 -0 We need to use the upgraded autogen/libopts in -stable too. clockstuff/clktest-opts.h@1.9.1.1 +22 -57 We need to use the upgraded autogen/libopts in -stable too. include/autogen-version.def@1.4 +1 -1 We need to use the upgraded autogen/libopts in -stable too. libopts/COPYING.lgpl@1.1 +502 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/COPYING.lgpl libopts/COPYING.lgpl@1.0 +0 -0 libopts/COPYING.mbsd@1.1 +26 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/COPYING.mbsd libopts/COPYING.mbsd@1.0 +0 -0 libopts/MakeDefs.inc@1.1 +0 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/MakeDefs.inc libopts/MakeDefs.inc@1.0 +0 -0 libopts/Makefile.am@1.1 +24 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/Makefile.am libopts/Makefile.am@1.0 +0 -0 libopts/README@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/README libopts/README@1.0 +0 -0 libopts/autoopts.c@1.1 +1120 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts.c libopts/autoopts.c@1.0 +0 -0 libopts/autoopts.h@1.1 +387 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts.h libopts/autoopts.h@1.0 +0 -0 libopts/autoopts/options.h@1.1 +977 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts/options.h libopts/autoopts/options.h@1.0 +0 -0 libopts/autoopts/usage-txt.h@1.1 +355 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts/usage-txt.h libopts/autoopts/usage-txt.h@1.0 +0 -0 libopts/boolean.c@1.1 +106 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/boolean.c libopts/boolean.c@1.0 +0 -0 libopts/compat/compat.h@1.1 +319 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/compat.h libopts/compat/compat.h@1.0 +0 -0 libopts/compat/pathfind.c@1.1 +339 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/pathfind.c libopts/compat/pathfind.c@1.0 +0 -0 libopts/compat/snprintf.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/snprintf.c libopts/compat/snprintf.c@1.0 +0 -0 libopts/compat/strchr.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/strchr.c libopts/compat/strchr.c@1.0 +0 -0 libopts/compat/strdup.c@1.1 +19 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/strdup.c libopts/compat/strdup.c@1.0 +0 -0 libopts/compat/windows-config.h@1.1 +130 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/windows-config.h libopts/compat/windows-config.h@1.0 +0 -0 libopts/configfile.c@1.1 +1290 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/configfile.c libopts/configfile.c@1.0 +0 -0 libopts/cook.c@1.1 +354 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/cook.c libopts/cook.c@1.0 +0 -0 libopts/enumeration.c@1.1 +498 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/enumeration.c libopts/enumeration.c@1.0 +0 -0 libopts/environment.c@1.1 +279 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/environment.c libopts/environment.c@1.0 +0 -0 libopts/genshell.c@1.1 +354 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/genshell.c libopts/genshell.c@1.0 +0 -0 libopts/genshell.h@1.1 +149 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/genshell.h libopts/genshell.h@1.0 +0 -0 libopts/libopts.c@1.1 +30 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/libopts.c libopts/libopts.c@1.0 +0 -0 libopts/load.c@1.1 +563 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/load.c libopts/load.c@1.0 +0 -0 libopts/m4/libopts.m4@1.1 +509 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/m4/libopts.m4 libopts/m4/libopts.m4@1.0 +0 -0 libopts/m4/liboptschk.m4@1.1 +42 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/m4/liboptschk.m4 libopts/m4/liboptschk.m4@1.0 +0 -0 libopts/makeshell.c@1.1 +1122 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/makeshell.c libopts/makeshell.c@1.0 +0 -0 libopts/nested.c@1.1 +733 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/nested.c libopts/nested.c@1.0 +0 -0 libopts/numeric.c@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/numeric.c libopts/numeric.c@1.0 +0 -0 libopts/pgusage.c@1.1 +157 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/pgusage.c libopts/pgusage.c@1.0 +0 -0 libopts/proto.h@1.1 +91 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/proto.h libopts/proto.h@1.0 +0 -0 libopts/putshell.c@1.1 +335 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/putshell.c libopts/putshell.c@1.0 +0 -0 libopts/restore.c@1.1 +250 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/restore.c libopts/restore.c@1.0 +0 -0 libopts/save.c@1.1 +512 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/save.c libopts/save.c@1.0 +0 -0 libopts/sort.c@1.1 +359 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/sort.c libopts/sort.c@1.0 +0 -0 libopts/stack.c@1.1 +269 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/stack.c libopts/stack.c@1.0 +0 -0 libopts/streqvcmp.c@1.1 +289 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/streqvcmp.c libopts/streqvcmp.c@1.0 +0 -0 libopts/text_mmap.c@1.1 +363 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/text_mmap.c libopts/text_mmap.c@1.0 +0 -0 libopts/tokenize.c@1.1 +321 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/tokenize.c libopts/tokenize.c@1.0 +0 -0 libopts/usage.c@1.1 +740 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/usage.c libopts/usage.c@1.0 +0 -0 libopts/version.c@1.1 +178 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/version.c libopts/version.c@1.0 +0 -0 ntpd/ntpd-opts.c@1.50.3.1 +20 -11 We need to use the upgraded autogen/libopts in -stable too. ntpd/ntpd-opts.h@1.50.3.1 +4 -4 We need to use the upgraded autogen/libopts in -stable too. ntpd/ntpd-opts.texi@1.49.3.1 +2 -8 We need to use the upgraded autogen/libopts in -stable too. ntpd/ntpd.1@1.48.3.1 +2 -2 We need to use the upgraded autogen/libopts in -stable too. ntpd/ntpdsim-opts.c@1.50.3.1 +23 -14 We need to use the upgraded autogen/libopts in -stable too. ntpd/ntpdsim-opts.h@1.50.3.1 +6 -6 We need to use the upgraded autogen/libopts in -stable too. ntpd/ntpdsim-opts.texi@1.48.3.1 +1 -1 We need to use the upgraded autogen/libopts in -stable too. ntpd/ntpdsim.1@1.48.3.1 +2 -2 We need to use the upgraded autogen/libopts in -stable too. ntpdc/ntpdc-opts.c@1.50.3.1 +23 -14 We need to use the upgraded autogen/libopts in -stable too. ntpdc/ntpdc-opts.h@1.50.3.1 +6 -6 We need to use the upgraded autogen/libopts in -stable too. ntpdc/ntpdc-opts.texi@1.48.3.1 +3 -3 We need to use the upgraded autogen/libopts in -stable too. ntpdc/ntpdc.1@1.48.3.1 +2 -2 We need to use the upgraded autogen/libopts in -stable too. ntpq/ntpq-opts.c@1.52.3.1 +23 -14 We need to use the upgraded autogen/libopts in -stable too. ntpq/ntpq-opts.h@1.52.3.1 +6 -6 We need to use the upgraded autogen/libopts in -stable too. ntpq/ntpq-opts.texi@1.49.3.1 +3 -3 We need to use the upgraded autogen/libopts in -stable too. ntpq/ntpq.1@1.48.3.1 +2 -2 We need to use the upgraded autogen/libopts in -stable too. packageinfo.sh@1.65.9.2 +1 -1 We need another RC release to be sure the new autogen/libopts works. sntp/libopts/COPYING.lgpl@1.1 +502 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/COPYING.lgpl sntp/libopts/COPYING.lgpl@1.0 +0 -0 sntp/libopts/COPYING.mbsd@1.1 +26 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/COPYING.mbsd sntp/libopts/COPYING.mbsd@1.0 +0 -0 sntp/libopts/MakeDefs.inc@1.1 +0 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/MakeDefs.inc sntp/libopts/MakeDefs.inc@1.0 +0 -0 sntp/libopts/Makefile.am@1.1 +24 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/Makefile.am sntp/libopts/Makefile.am@1.0 +0 -0 sntp/libopts/README@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/README sntp/libopts/README@1.0 +0 -0 sntp/libopts/autoopts.c@1.1 +1120 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/autoopts.c sntp/libopts/autoopts.c@1.0 +0 -0 sntp/libopts/autoopts.h@1.1 +387 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/autoopts.h sntp/libopts/autoopts.h@1.0 +0 -0 sntp/libopts/autoopts/options.h@1.1 +977 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/autoopts/options.h sntp/libopts/autoopts/options.h@1.0 +0 -0 sntp/libopts/autoopts/usage-txt.h@1.1 +355 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/autoopts/usage-txt.h sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0 sntp/libopts/boolean.c@1.1 +106 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/boolean.c sntp/libopts/boolean.c@1.0 +0 -0 sntp/libopts/compat/compat.h@1.1 +319 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/compat/compat.h sntp/libopts/compat/compat.h@1.0 +0 -0 sntp/libopts/compat/pathfind.c@1.1 +339 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/compat/pathfind.c sntp/libopts/compat/pathfind.c@1.0 +0 -0 sntp/libopts/compat/snprintf.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/compat/snprintf.c sntp/libopts/compat/snprintf.c@1.0 +0 -0 sntp/libopts/compat/strchr.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/compat/strchr.c sntp/libopts/compat/strchr.c@1.0 +0 -0 sntp/libopts/compat/strdup.c@1.1 +19 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/compat/strdup.c sntp/libopts/compat/strdup.c@1.0 +0 -0 sntp/libopts/compat/windows-config.h@1.1 +130 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/compat/windows-config.h sntp/libopts/compat/windows-config.h@1.0 +0 -0 sntp/libopts/configfile.c@1.1 +1290 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/configfile.c sntp/libopts/configfile.c@1.0 +0 -0 sntp/libopts/cook.c@1.1 +354 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/cook.c sntp/libopts/cook.c@1.0 +0 -0 sntp/libopts/enumeration.c@1.1 +498 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/enumeration.c sntp/libopts/enumeration.c@1.0 +0 -0 sntp/libopts/environment.c@1.1 +279 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/environment.c sntp/libopts/environment.c@1.0 +0 -0 sntp/libopts/genshell.c@1.1 +354 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/genshell.c sntp/libopts/genshell.c@1.0 +0 -0 sntp/libopts/genshell.h@1.1 +149 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/genshell.h sntp/libopts/genshell.h@1.0 +0 -0 sntp/libopts/libopts.c@1.1 +30 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/libopts.c sntp/libopts/libopts.c@1.0 +0 -0 sntp/libopts/load.c@1.1 +563 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/load.c sntp/libopts/load.c@1.0 +0 -0 sntp/libopts/m4/libopts.m4@1.1 +509 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/m4/libopts.m4 sntp/libopts/m4/libopts.m4@1.0 +0 -0 sntp/libopts/m4/liboptschk.m4@1.1 +42 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/m4/liboptschk.m4 sntp/libopts/m4/liboptschk.m4@1.0 +0 -0 sntp/libopts/makeshell.c@1.1 +1122 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/makeshell.c sntp/libopts/makeshell.c@1.0 +0 -0 sntp/libopts/nested.c@1.1 +733 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/nested.c sntp/libopts/nested.c@1.0 +0 -0 sntp/libopts/numeric.c@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/numeric.c sntp/libopts/numeric.c@1.0 +0 -0 sntp/libopts/pgusage.c@1.1 +157 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/pgusage.c sntp/libopts/pgusage.c@1.0 +0 -0 sntp/libopts/proto.h@1.1 +91 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/proto.h sntp/libopts/proto.h@1.0 +0 -0 sntp/libopts/putshell.c@1.1 +335 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/putshell.c sntp/libopts/putshell.c@1.0 +0 -0 sntp/libopts/restore.c@1.1 +250 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/restore.c sntp/libopts/restore.c@1.0 +0 -0 sntp/libopts/save.c@1.1 +512 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/save.c sntp/libopts/save.c@1.0 +0 -0 sntp/libopts/sort.c@1.1 +359 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/sort.c sntp/libopts/sort.c@1.0 +0 -0 sntp/libopts/stack.c@1.1 +269 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/stack.c sntp/libopts/stack.c@1.0 +0 -0 sntp/libopts/streqvcmp.c@1.1 +289 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/streqvcmp.c sntp/libopts/streqvcmp.c@1.0 +0 -0 sntp/libopts/text_mmap.c@1.1 +363 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/text_mmap.c sntp/libopts/text_mmap.c@1.0 +0 -0 sntp/libopts/tokenize.c@1.1 +321 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/tokenize.c sntp/libopts/tokenize.c@1.0 +0 -0 sntp/libopts/usage.c@1.1 +740 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/usage.c sntp/libopts/usage.c@1.0 +0 -0 sntp/libopts/version.c@1.1 +178 -0 BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/version.c sntp/libopts/version.c@1.0 +0 -0 sntp/sntp-opts.c@1.49.3.1 +21 -12 We need to use the upgraded autogen/libopts in -stable too. sntp/sntp-opts.h@1.49.3.1 +6 -6 We need to use the upgraded autogen/libopts in -stable too. sntp/sntp-opts.texi@1.46.3.1 +1 -1 We need to use the upgraded autogen/libopts in -stable too. sntp/sntp.1@1.49.3.1 +2 -2 We need to use the upgraded autogen/libopts in -stable too. util/ntp-keygen-opts.c@1.49.3.1 +23 -14 We need to use the upgraded autogen/libopts in -stable too. util/ntp-keygen-opts.h@1.49.3.1 +6 -6 We need to use the upgraded autogen/libopts in -stable too. util/ntp-keygen-opts.texi@1.47.3.1 +3 -3 We need to use the upgraded autogen/libopts in -stable too. util/ntp-keygen.1@1.47.3.1 +2 -2 We need to use the upgraded autogen/libopts in -stable too. ChangeSet@1.1436.3.1, 2007-05-18 02:20:56-04:00, stenn@whimsy.udel.edu Release 4.2.4p2 ChangeLog@1.1.2.1 +4 -2 Release 4.2.4p2 NEWS@1.86.1.2 +6 -0 Release 4.2.4p2 packageinfo.sh@1.65.9.1 +1 -1 Release 4.2.4p2 ChangeSet@1.1481, 2007-05-16 07:44:03-04:00, stenn@whimsy.udel.edu NTP_4_2_5P34 TAG: NTP_4_2_5P34 ntpd/ntpd-opts.c@1.21 +2 -2 NTP_4_2_5P34 ntpd/ntpd-opts.h@1.21 +5 -5 NTP_4_2_5P34 ntpd/ntpd-opts.texi@1.20 +5 -5 NTP_4_2_5P34 ntpd/ntpd.1@1.20 +4 -4 NTP_4_2_5P34 ntpdc/ntpdc-opts.c@1.21 +2 -2 NTP_4_2_5P34 ntpdc/ntpdc-opts.h@1.21 +3 -3 NTP_4_2_5P34 ntpdc/ntpdc-opts.texi@1.20 +1 -1 NTP_4_2_5P34 ntpdc/ntpdc.1@1.20 +2 -2 NTP_4_2_5P34 ntpq/ntpq-opts.c@1.21 +2 -2 NTP_4_2_5P34 ntpq/ntpq-opts.h@1.21 +3 -3 NTP_4_2_5P34 ntpq/ntpq-opts.texi@1.20 +1 -1 NTP_4_2_5P34 ntpq/ntpq.1@1.20 +2 -2 NTP_4_2_5P34 packageinfo.sh@1.37 +1 -1 NTP_4_2_5P34 sntp/sntp-opts.c@1.21 +2 -2 NTP_4_2_5P34 sntp/sntp-opts.h@1.21 +3 -3 NTP_4_2_5P34 sntp/sntp-opts.texi@1.20 +1 -1 NTP_4_2_5P34 sntp/sntp.1@1.20 +2 -2 NTP_4_2_5P34 util/ntp-keygen-opts.c@1.22 +2 -2 NTP_4_2_5P34 util/ntp-keygen-opts.h@1.22 +3 -3 NTP_4_2_5P34 util/ntp-keygen-opts.texi@1.21 +1 -1 NTP_4_2_5P34 util/ntp-keygen.1@1.21 +2 -2 NTP_4_2_5P34 ChangeSet@1.1480, 2007-05-16 03:56:15-04:00, stenn@whimsy.udel.edu [Bug 826] Fix redefinition of PI ChangeLog@1.45 +1 -0 [Bug 826] Fix redefinition of PI ChangeSet@1.1479, 2007-05-16 03:47:57-04:00, stenn@whimsy.udel.edu [Bug 825] ntp_scanner.c needs to #include ChangeLog@1.44 +1 -0 [Bug 825] ntp_scanner.c needs to #include ntpd/ntp_scanner.c@1.4 +4 -0 [Bug 825] ntp_scanner.c needs to #include ChangeSet@1.1478, 2007-05-16 03:39:02-04:00, stenn@whimsy.udel.edu [Bug 824] New parser code has some build problems with the SIM code. ChangeLog@1.43 +1 -0 [Bug 824] New parser code has some build problems with the SIM code. include/ntp_config.h@1.45 +1 -5 [Bug 824] New parser code has some build problems with the SIM code. include/ntpsim.h@1.9 +3 -4 [Bug 824] New parser code has some build problems with the SIM code. ntpd/ntp_config.c@1.151 +11 -0 [Bug 824] New parser code has some build problems with the SIM code. ntpd/ntp_data_structures.c@1.3 +1 -1 [Bug 824] New parser code has some build problems with the SIM code. ntpd/ntp_parser.c@1.6 +2 -2 [Bug 824] New parser code has some build problems with the SIM code. ntpd/ntp_parser.y@1.5 +1 -1 [Bug 824] New parser code has some build problems with the SIM code. ntpd/ntpsim.c@1.17 +5 -2 [Bug 824] New parser code has some build problems with the SIM code. ChangeSet@1.1477, 2007-05-16 00:49:12-04:00, stenn@whimsy.udel.edu [Bug 817] Use longnames for setting ntp variables on the command-line ChangeLog@1.42 +3 -0 [Bug 817] Use longnames for setting ntp variables on the command-line NEWS@1.91 +5 -0 [Bug 817] Use longnames for setting ntp variables on the command-line ntpd/ntpdbase-opts.def@1.11 +2 -2 [Bug 817] Use longnames for setting ntp variables on the command-line ChangeSet@1.1476, 2007-05-16 00:26:17-04:00, stenn@whimsy.udel.edu [Bug 822] set progname once, early. ChangeLog@1.41 +1 -0 [Bug 822] set progname once, early. ntpd/ntp_config.c@1.150 +0 -1 [Bug 822] set progname once, early. ChangeSet@1.1475, 2007-05-15 07:43:16-04:00, stenn@whimsy.udel.edu NTP_4_2_5P33 TAG: NTP_4_2_5P33 ntpd/ntpd-opts.c@1.20 +2 -2 NTP_4_2_5P33 ntpd/ntpd-opts.h@1.20 +3 -3 NTP_4_2_5P33 ntpd/ntpd-opts.texi@1.19 +1 -1 NTP_4_2_5P33 ntpd/ntpd.1@1.19 +2 -2 NTP_4_2_5P33 ntpdc/ntpdc-opts.c@1.20 +2 -2 NTP_4_2_5P33 ntpdc/ntpdc-opts.h@1.20 +3 -3 NTP_4_2_5P33 ntpdc/ntpdc-opts.texi@1.19 +1 -1 NTP_4_2_5P33 ntpdc/ntpdc.1@1.19 +2 -2 NTP_4_2_5P33 ntpq/ntpq-opts.c@1.20 +2 -2 NTP_4_2_5P33 ntpq/ntpq-opts.h@1.20 +3 -3 NTP_4_2_5P33 ntpq/ntpq-opts.texi@1.19 +1 -1 NTP_4_2_5P33 ntpq/ntpq.1@1.19 +2 -2 NTP_4_2_5P33 packageinfo.sh@1.36 +1 -1 NTP_4_2_5P33 sntp/sntp-opts.c@1.20 +2 -2 NTP_4_2_5P33 sntp/sntp-opts.h@1.20 +3 -3 NTP_4_2_5P33 sntp/sntp-opts.texi@1.19 +1 -1 NTP_4_2_5P33 sntp/sntp.1@1.19 +2 -2 NTP_4_2_5P33 util/ntp-keygen-opts.c@1.21 +2 -2 NTP_4_2_5P33 util/ntp-keygen-opts.h@1.21 +3 -3 NTP_4_2_5P33 util/ntp-keygen-opts.texi@1.20 +1 -1 NTP_4_2_5P33 util/ntp-keygen.1@1.20 +2 -2 NTP_4_2_5P33 ChangeSet@1.1474, 2007-05-15 06:42:51-04:00, stenn@pogo.udel.edu Correct ChangeLog entry format ChangeLog@1.40 +1 -1 Correct ChangeLog entry format ChangeSet@1.1473, 2007-05-14 16:58:33-04:00, mayer@pogo.udel.edu Bug 819 remove erroneous #if 0 in Windows code ChangeLog@1.39 +1 -0 Bug 819 remove erroneous #if 0 in Windows code ports/winnt/ntpd/ntp_iocompletionport.c@1.23 +0 -2 Bug 819 remove erroneous #if 0 ChangeSet@1.1472, 2007-05-13 07:43:28-04:00, stenn@whimsy.udel.edu NTP_4_2_5P32 TAG: NTP_4_2_5P32 ntpd/ntpd-opts.c@1.19 +2 -2 NTP_4_2_5P32 ntpd/ntpd-opts.h@1.19 +3 -3 NTP_4_2_5P32 ntpd/ntpd-opts.texi@1.18 +1 -1 NTP_4_2_5P32 ntpd/ntpd.1@1.18 +2 -2 NTP_4_2_5P32 ntpdc/ntpdc-opts.c@1.19 +2 -2 NTP_4_2_5P32 ntpdc/ntpdc-opts.h@1.19 +3 -3 NTP_4_2_5P32 ntpdc/ntpdc-opts.texi@1.18 +1 -1 NTP_4_2_5P32 ntpdc/ntpdc.1@1.18 +2 -2 NTP_4_2_5P32 ntpq/ntpq-opts.c@1.19 +2 -2 NTP_4_2_5P32 ntpq/ntpq-opts.h@1.19 +3 -3 NTP_4_2_5P32 ntpq/ntpq-opts.texi@1.18 +1 -1 NTP_4_2_5P32 ntpq/ntpq.1@1.18 +2 -2 NTP_4_2_5P32 packageinfo.sh@1.35 +1 -1 NTP_4_2_5P32 sntp/sntp-opts.c@1.19 +2 -2 NTP_4_2_5P32 sntp/sntp-opts.h@1.19 +3 -3 NTP_4_2_5P32 sntp/sntp-opts.texi@1.18 +1 -1 NTP_4_2_5P32 sntp/sntp.1@1.18 +2 -2 NTP_4_2_5P32 util/ntp-keygen-opts.c@1.20 +2 -2 NTP_4_2_5P32 util/ntp-keygen-opts.h@1.20 +3 -3 NTP_4_2_5P32 util/ntp-keygen-opts.texi@1.19 +1 -1 NTP_4_2_5P32 util/ntp-keygen.1@1.19 +2 -2 NTP_4_2_5P32 ChangeSet@1.1471, 2007-05-13 03:42:41-04:00, stenn@whimsy.udel.edu The new config code missed an #ifdef for building without refclocks ChangeLog@1.38 +1 -0 The new config code missed an #ifdef for building without refclocks ntpd/ntp_config.c@1.149 +4 -0 The new config code missed an #ifdef for building without refclocks ChangeSet@1.1470, 2007-05-13 00:04:25-04:00, stenn@whimsy.udel.edu NTP_4_2_5P31 TAG: NTP_4_2_5P31 ntpd/ntpd-opts.c@1.18 +2 -2 NTP_4_2_5P31 ntpd/ntpd-opts.h@1.18 +3 -3 NTP_4_2_5P31 ntpd/ntpd-opts.texi@1.17 +1 -1 NTP_4_2_5P31 ntpd/ntpd.1@1.17 +2 -2 NTP_4_2_5P31 ntpdc/ntpdc-opts.c@1.18 +2 -2 NTP_4_2_5P31 ntpdc/ntpdc-opts.h@1.18 +3 -3 NTP_4_2_5P31 ntpdc/ntpdc-opts.texi@1.17 +1 -1 NTP_4_2_5P31 ntpdc/ntpdc.1@1.17 +2 -2 NTP_4_2_5P31 ntpq/ntpq-opts.c@1.18 +2 -2 NTP_4_2_5P31 ntpq/ntpq-opts.h@1.18 +3 -3 NTP_4_2_5P31 ntpq/ntpq-opts.texi@1.17 +1 -1 NTP_4_2_5P31 ntpq/ntpq.1@1.17 +2 -2 NTP_4_2_5P31 packageinfo.sh@1.34 +1 -1 NTP_4_2_5P31 sntp/sntp-opts.c@1.18 +2 -2 NTP_4_2_5P31 sntp/sntp-opts.h@1.18 +3 -3 NTP_4_2_5P31 sntp/sntp-opts.texi@1.17 +1 -1 NTP_4_2_5P31 sntp/sntp.1@1.17 +2 -2 NTP_4_2_5P31 util/ntp-keygen-opts.c@1.19 +2 -2 NTP_4_2_5P31 util/ntp-keygen-opts.h@1.19 +3 -3 NTP_4_2_5P31 util/ntp-keygen-opts.texi@1.18 +1 -1 NTP_4_2_5P31 util/ntp-keygen.1@1.18 +2 -2 NTP_4_2_5P31 ChangeSet@1.1469, 2007-05-12 23:13:08-04:00, stenn@whimsy.udel.edu Distribute some files needed by the new config parsing code ChangeLog@1.37 +1 -0 Distribute some files needed by the new config parsing code include/Makefile.am@1.27 +1 -0 Distribute some files needed by the new config parsing code ntpd/Makefile.am@1.59 +2 -1 Distribute some files needed by the new config parsing code ChangeSet@1.1468, 2007-05-12 20:05:36-04:00, stenn@whimsy.udel.edu NTP_4_2_5P30 TAG: NTP_4_2_5P30 ntpd/ntpd-opts.c@1.17 +19 -10 NTP_4_2_5P30 ntpd/ntpd-opts.h@1.17 +6 -6 NTP_4_2_5P30 ntpd/ntpd-opts.texi@1.16 +2 -2 NTP_4_2_5P30 ntpd/ntpd.1@1.16 +2 -2 NTP_4_2_5P30 ntpdc/ntpdc-opts.c@1.17 +22 -13 NTP_4_2_5P30 ntpdc/ntpdc-opts.h@1.17 +8 -8 NTP_4_2_5P30 ntpdc/ntpdc-opts.texi@1.16 +2 -2 NTP_4_2_5P30 ntpdc/ntpdc.1@1.16 +2 -2 NTP_4_2_5P30 ntpq/ntpq-opts.c@1.17 +22 -13 NTP_4_2_5P30 ntpq/ntpq-opts.h@1.17 +8 -8 NTP_4_2_5P30 ntpq/ntpq-opts.texi@1.16 +2 -2 NTP_4_2_5P30 ntpq/ntpq.1@1.16 +2 -2 NTP_4_2_5P30 packageinfo.sh@1.33 +1 -1 NTP_4_2_5P30 sntp/sntp-opts.c@1.17 +22 -13 NTP_4_2_5P30 sntp/sntp-opts.h@1.17 +8 -8 NTP_4_2_5P30 sntp/sntp-opts.texi@1.16 +1 -1 NTP_4_2_5P30 sntp/sntp.1@1.16 +2 -2 NTP_4_2_5P30 util/ntp-keygen-opts.c@1.18 +22 -13 NTP_4_2_5P30 util/ntp-keygen-opts.h@1.18 +8 -8 NTP_4_2_5P30 util/ntp-keygen-opts.texi@1.17 +2 -2 NTP_4_2_5P30 util/ntp-keygen.1@1.17 +2 -2 NTP_4_2_5P30 ChangeSet@1.1467, 2007-05-12 18:51:18-04:00, stenn@whimsy.udel.edu ntpdsim does not need a separate.def file anymore .point-changed-filelist@1.2 +0 -4 ntpdsim does not need a separate.def file anymore ChangeSet@1.1464.1.3, 2007-05-12 15:20:21-04:00, stenn@whimsy.udel.edu update ChangeLog ChangeLog@1.34.1.1 +2 -0 update ChangeSet@1.1464.1.2, 2007-05-12 15:11:16-04:00, stenn@whimsy.udel.edu ntpdsim still needs to be linked with libntpsim.a ntpd/Makefile.am@1.58 +1 -1 ntpdsim still needs to be linked with libntpsim.a ChangeSet@1.1464.1.1, 2007-05-12 15:03:30-04:00, stenn@whimsy.udel.edu The commandline args for clktest are different for CLKLDISC and STREAM BitKeeper/deleted/.del-COPYING.lgpl~10cb8d69d91c1d1a@1.2 +0 -0 Delete: sntp/libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.lgpl~28a379c1d0a7d65b@1.2 +0 -0 Delete: libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.mbsd~533e88f3b3fcf954@1.2 +0 -0 Delete: libopts/COPYING.mbsd BitKeeper/deleted/.del-COPYING.mbsd~b64c211489c98f8f@1.2 +0 -0 Delete: sntp/libopts/COPYING.mbsd BitKeeper/deleted/.del-MakeDefs.inc~1864382369b1f319@1.2 +0 -0 Delete: sntp/libopts/MakeDefs.inc BitKeeper/deleted/.del-MakeDefs.inc~834c15d5a9c89a66@1.2 +0 -0 Delete: libopts/MakeDefs.inc BitKeeper/deleted/.del-Makefile.am~1b934e5bbc1a52da@1.2 +0 -0 Delete: sntp/libopts/Makefile.am BitKeeper/deleted/.del-Makefile.am~6ccd1a00699fb256@1.2 +0 -0 Delete: libopts/Makefile.am BitKeeper/deleted/.del-README~92b3aeada81a2d71@1.2 +0 -0 Delete: sntp/libopts/README BitKeeper/deleted/.del-README~b514dee5178a5580@1.2 +0 -0 Delete: libopts/README BitKeeper/deleted/.del-autoopts.c~a46d961b536d64bf@1.2 +0 -0 Delete: sntp/libopts/autoopts.c BitKeeper/deleted/.del-autoopts.c~bf6955d92ba49ae1@1.2 +0 -0 Delete: libopts/autoopts.c BitKeeper/deleted/.del-autoopts.h~23dbdb3099b1cca4@1.2 +0 -0 Delete: sntp/libopts/autoopts.h BitKeeper/deleted/.del-autoopts.h~747513602f92fac1@1.2 +0 -0 Delete: libopts/autoopts.h BitKeeper/deleted/.del-boolean.c~94ccecb255a48b6e@1.2 +0 -0 Delete: sntp/libopts/boolean.c BitKeeper/deleted/.del-boolean.c~f7c50fbef5ac98e0@1.2 +0 -0 Delete: libopts/boolean.c BitKeeper/deleted/.del-compat.h~304782365980b0a6@1.2 +0 -0 Delete: libopts/compat/compat.h BitKeeper/deleted/.del-compat.h~395225886f65b320@1.2 +0 -0 Delete: sntp/libopts/compat/compat.h BitKeeper/deleted/.del-configfile.c~9bf9a8e83a3bd417@1.2 +0 -0 Delete: sntp/libopts/configfile.c BitKeeper/deleted/.del-configfile.c~c3073ecc386accae@1.2 +0 -0 Delete: libopts/configfile.c BitKeeper/deleted/.del-cook.c~aaac2f8aa56207ea@1.2 +0 -0 Delete: sntp/libopts/cook.c BitKeeper/deleted/.del-cook.c~ab79f9ba24a65414@1.2 +0 -0 Delete: libopts/cook.c BitKeeper/deleted/.del-enumeration.c~712ed026511a4fad@1.2 +0 -0 Delete: libopts/enumeration.c BitKeeper/deleted/.del-enumeration.c~8a49e92b5bc59603@1.2 +0 -0 Delete: sntp/libopts/enumeration.c BitKeeper/deleted/.del-environment.c~8c989df39464c6e6@1.2 +0 -0 Delete: libopts/environment.c BitKeeper/deleted/.del-environment.c~d00f13b319acf94@1.2 +0 -0 Delete: sntp/libopts/environment.c BitKeeper/deleted/.del-genshell.c~8eefb6dfb144e83@1.2 +0 -0 Delete: sntp/libopts/genshell.c BitKeeper/deleted/.del-genshell.c~d7f99fb1e982ee07@1.2 +0 -0 Delete: libopts/genshell.c BitKeeper/deleted/.del-genshell.h~51e39da43a911455@1.2 +0 -0 Delete: sntp/libopts/genshell.h BitKeeper/deleted/.del-genshell.h~d288760f8010eb26@1.2 +0 -0 Delete: libopts/genshell.h BitKeeper/deleted/.del-libopts.c~58110c12582b3028@1.2 +0 -0 Delete: libopts/libopts.c BitKeeper/deleted/.del-libopts.c~752b4eb28ce283b5@1.2 +0 -0 Delete: sntp/libopts/libopts.c BitKeeper/deleted/.del-libopts.m4~3768711f3ababaf6@1.2 +0 -0 Delete: libopts/m4/libopts.m4 BitKeeper/deleted/.del-libopts.m4~3ff78500945f8450@1.2 +0 -0 Delete: sntp/libopts/m4/libopts.m4 BitKeeper/deleted/.del-liboptschk.m4~7fc066e5c8ec737b@1.2 +0 -0 Delete: sntp/libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-liboptschk.m4~874c63212488adfb@1.2 +0 -0 Delete: libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-load.c~5266a52b9cc7c4c@1.2 +0 -0 Delete: libopts/load.c BitKeeper/deleted/.del-load.c~a2d76f9cb0ad15c2@1.2 +0 -0 Delete: sntp/libopts/load.c BitKeeper/deleted/.del-makeshell.c~29fe57c8fbbb00e3@1.2 +0 -0 Delete: libopts/makeshell.c BitKeeper/deleted/.del-makeshell.c~fc83cd9174e79990@1.2 +0 -0 Delete: sntp/libopts/makeshell.c BitKeeper/deleted/.del-nested.c~28f13939b51c52fd@1.2 +0 -0 Delete: sntp/libopts/nested.c BitKeeper/deleted/.del-nested.c~b140b093a1d64d9@1.2 +0 -0 Delete: libopts/nested.c BitKeeper/deleted/.del-numeric.c~65425d5a1d1c4bfe@1.2 +0 -0 Delete: sntp/libopts/numeric.c BitKeeper/deleted/.del-numeric.c~999e8ac5e2da8761@1.2 +0 -0 Delete: libopts/numeric.c BitKeeper/deleted/.del-options.h~5da7e2edf4e59b5a@1.2 +0 -0 Delete: libopts/autoopts/options.h BitKeeper/deleted/.del-options.h~b9d54ea51e67a003@1.2 +0 -0 Delete: sntp/libopts/autoopts/options.h BitKeeper/deleted/.del-pathfind.c~3b1936ad642daffc@1.2 +0 -0 Delete: libopts/compat/pathfind.c BitKeeper/deleted/.del-pathfind.c~a2ca5c6362091a22@1.2 +0 -0 Delete: sntp/libopts/compat/pathfind.c BitKeeper/deleted/.del-pgusage.c~b5c6b4ec94715759@1.2 +0 -0 Delete: sntp/libopts/pgusage.c BitKeeper/deleted/.del-pgusage.c~d5c1858d8398fae@1.2 +0 -0 Delete: libopts/pgusage.c BitKeeper/deleted/.del-proto.h~154b3828fc24cf61@1.2 +0 -0 Delete: libopts/proto.h BitKeeper/deleted/.del-proto.h~a1f40edb75ffe53a@1.2 +0 -0 Delete: sntp/libopts/proto.h BitKeeper/deleted/.del-putshell.c~a5873e4bd316e7ed@1.2 +0 -0 Delete: sntp/libopts/putshell.c BitKeeper/deleted/.del-putshell.c~e6ab712597a00d22@1.2 +0 -0 Delete: libopts/putshell.c BitKeeper/deleted/.del-restore.c~5d8d9d9524a773de@1.2 +0 -0 Delete: sntp/libopts/restore.c BitKeeper/deleted/.del-restore.c~88a5fde95bcff4ab@1.2 +0 -0 Delete: libopts/restore.c BitKeeper/deleted/.del-save.c~be7b0aaf121ec52c@1.2 +0 -0 Delete: sntp/libopts/save.c BitKeeper/deleted/.del-save.c~c6c15efe6c1d79fd@1.2 +0 -0 Delete: libopts/save.c BitKeeper/deleted/.del-snprintf.c~755eb3e8b8fdc776@1.2 +0 -0 Delete: sntp/libopts/compat/snprintf.c BitKeeper/deleted/.del-snprintf.c~bd80dbf654a1386@1.2 +0 -0 Delete: libopts/compat/snprintf.c BitKeeper/deleted/.del-sort.c~3107cfeb6d4410e0@1.2 +0 -0 Delete: libopts/sort.c BitKeeper/deleted/.del-sort.c~fd8c39deb0ab5d4f@1.2 +0 -0 Delete: sntp/libopts/sort.c BitKeeper/deleted/.del-stack.c~311ef6ab451f1f6@1.2 +0 -0 Delete: sntp/libopts/stack.c BitKeeper/deleted/.del-stack.c~63cca8b0f353d8f2@1.2 +0 -0 Delete: libopts/stack.c BitKeeper/deleted/.del-strchr.c~9747020ee65f676@1.2 +0 -0 Delete: libopts/compat/strchr.c BitKeeper/deleted/.del-strchr.c~ee7c33848acad72@1.2 +0 -0 Delete: sntp/libopts/compat/strchr.c BitKeeper/deleted/.del-strdup.c~b372303835eae985@1.2 +0 -0 Delete: sntp/libopts/compat/strdup.c BitKeeper/deleted/.del-strdup.c~f0c4c4c41ddd1a3@1.2 +0 -0 Delete: libopts/compat/strdup.c BitKeeper/deleted/.del-streqvcmp.c~73dcf75bcf91f8b9@1.2 +0 -0 Delete: libopts/streqvcmp.c BitKeeper/deleted/.del-streqvcmp.c~a7f96578aba73fa7@1.2 +0 -0 Delete: sntp/libopts/streqvcmp.c BitKeeper/deleted/.del-text_mmap.c~54ffd8e6a894fd3a@1.2 +0 -0 Delete: libopts/text_mmap.c BitKeeper/deleted/.del-text_mmap.c~a418cd03686e4369@1.2 +0 -0 Delete: sntp/libopts/text_mmap.c BitKeeper/deleted/.del-tokenize.c~383b75d922a43542@1.2 +0 -0 Delete: sntp/libopts/tokenize.c BitKeeper/deleted/.del-tokenize.c~a0a274ef5a23941b@1.2 +0 -0 Delete: libopts/tokenize.c BitKeeper/deleted/.del-usage-txt.h~2e88ec29a506e890@1.2 +0 -0 Delete: libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage-txt.h~d982bb81a1b02298@1.2 +0 -0 Delete: sntp/libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage.c~1108ba561360111a@1.2 +0 -0 Delete: libopts/usage.c BitKeeper/deleted/.del-usage.c~f5dfbb0ffd6bfc47@1.2 +0 -0 Delete: sntp/libopts/usage.c BitKeeper/deleted/.del-version.c~2149af8e100594bb@1.2 +0 -0 Delete: sntp/libopts/version.c BitKeeper/deleted/.del-version.c~d6d1f6f786b289e3@1.2 +0 -0 Delete: libopts/version.c BitKeeper/deleted/.del-windows-config.h~49e33bce6ec73aa9@1.2 +0 -0 Delete: libopts/compat/windows-config.h BitKeeper/deleted/.del-windows-config.h~70a3d851a9350311@1.2 +0 -0 Delete: sntp/libopts/compat/windows-config.h clockstuff/clktest-opts.def@1.6 +4 -0 The commandline args for clktest are different for CLKLDISC and STREAM libopts/COPYING.lgpl@1.1 +502 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.lgpl libopts/COPYING.lgpl@1.0 +0 -0 libopts/COPYING.mbsd@1.1 +26 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.mbsd libopts/COPYING.mbsd@1.0 +0 -0 libopts/MakeDefs.inc@1.1 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/MakeDefs.inc libopts/MakeDefs.inc@1.0 +0 -0 libopts/Makefile.am@1.1 +24 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/Makefile.am libopts/Makefile.am@1.0 +0 -0 libopts/README@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/README libopts/README@1.0 +0 -0 libopts/autoopts.c@1.1 +1120 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts.c libopts/autoopts.c@1.0 +0 -0 libopts/autoopts.h@1.1 +387 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts.h libopts/autoopts.h@1.0 +0 -0 libopts/autoopts/options.h@1.1 +977 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts/options.h libopts/autoopts/options.h@1.0 +0 -0 libopts/autoopts/usage-txt.h@1.1 +355 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts/usage-txt.h libopts/autoopts/usage-txt.h@1.0 +0 -0 libopts/boolean.c@1.1 +106 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/boolean.c libopts/boolean.c@1.0 +0 -0 libopts/compat/compat.h@1.1 +319 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/compat.h libopts/compat/compat.h@1.0 +0 -0 libopts/compat/pathfind.c@1.1 +339 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/pathfind.c libopts/compat/pathfind.c@1.0 +0 -0 libopts/compat/snprintf.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/snprintf.c libopts/compat/snprintf.c@1.0 +0 -0 libopts/compat/strchr.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strchr.c libopts/compat/strchr.c@1.0 +0 -0 libopts/compat/strdup.c@1.1 +19 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strdup.c libopts/compat/strdup.c@1.0 +0 -0 libopts/compat/windows-config.h@1.1 +130 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/windows-config.h libopts/compat/windows-config.h@1.0 +0 -0 libopts/configfile.c@1.1 +1290 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/configfile.c libopts/configfile.c@1.0 +0 -0 libopts/cook.c@1.1 +354 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/cook.c libopts/cook.c@1.0 +0 -0 libopts/enumeration.c@1.1 +498 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/enumeration.c libopts/enumeration.c@1.0 +0 -0 libopts/environment.c@1.1 +279 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/environment.c libopts/environment.c@1.0 +0 -0 libopts/genshell.c@1.1 +354 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/genshell.c libopts/genshell.c@1.0 +0 -0 libopts/genshell.h@1.1 +149 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/genshell.h libopts/genshell.h@1.0 +0 -0 libopts/libopts.c@1.1 +30 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/libopts.c libopts/libopts.c@1.0 +0 -0 libopts/load.c@1.1 +563 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/load.c libopts/load.c@1.0 +0 -0 libopts/m4/libopts.m4@1.1 +509 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/libopts.m4 libopts/m4/libopts.m4@1.0 +0 -0 libopts/m4/liboptschk.m4@1.1 +42 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/liboptschk.m4 libopts/m4/liboptschk.m4@1.0 +0 -0 libopts/makeshell.c@1.1 +1122 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/makeshell.c libopts/makeshell.c@1.0 +0 -0 libopts/nested.c@1.1 +733 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/nested.c libopts/nested.c@1.0 +0 -0 libopts/numeric.c@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/numeric.c libopts/numeric.c@1.0 +0 -0 libopts/pgusage.c@1.1 +157 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/pgusage.c libopts/pgusage.c@1.0 +0 -0 libopts/proto.h@1.1 +91 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/proto.h libopts/proto.h@1.0 +0 -0 libopts/putshell.c@1.1 +335 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/putshell.c libopts/putshell.c@1.0 +0 -0 libopts/restore.c@1.1 +250 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/restore.c libopts/restore.c@1.0 +0 -0 libopts/save.c@1.1 +512 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/save.c libopts/save.c@1.0 +0 -0 libopts/sort.c@1.1 +359 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/sort.c libopts/sort.c@1.0 +0 -0 libopts/stack.c@1.1 +269 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/stack.c libopts/stack.c@1.0 +0 -0 libopts/streqvcmp.c@1.1 +289 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/streqvcmp.c libopts/streqvcmp.c@1.0 +0 -0 libopts/text_mmap.c@1.1 +363 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/text_mmap.c libopts/text_mmap.c@1.0 +0 -0 libopts/tokenize.c@1.1 +321 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/tokenize.c libopts/tokenize.c@1.0 +0 -0 libopts/usage.c@1.1 +740 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/usage.c libopts/usage.c@1.0 +0 -0 libopts/version.c@1.1 +178 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/version.c libopts/version.c@1.0 +0 -0 sntp/libopts/COPYING.lgpl@1.1 +502 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.lgpl sntp/libopts/COPYING.lgpl@1.0 +0 -0 sntp/libopts/COPYING.mbsd@1.1 +26 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.mbsd sntp/libopts/COPYING.mbsd@1.0 +0 -0 sntp/libopts/MakeDefs.inc@1.1 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/MakeDefs.inc sntp/libopts/MakeDefs.inc@1.0 +0 -0 sntp/libopts/Makefile.am@1.1 +24 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/Makefile.am sntp/libopts/Makefile.am@1.0 +0 -0 sntp/libopts/README@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/README sntp/libopts/README@1.0 +0 -0 sntp/libopts/autoopts.c@1.1 +1120 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts.c sntp/libopts/autoopts.c@1.0 +0 -0 sntp/libopts/autoopts.h@1.1 +387 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts.h sntp/libopts/autoopts.h@1.0 +0 -0 sntp/libopts/autoopts/options.h@1.1 +977 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts/options.h sntp/libopts/autoopts/options.h@1.0 +0 -0 sntp/libopts/autoopts/usage-txt.h@1.1 +355 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts/usage-txt.h sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0 sntp/libopts/boolean.c@1.1 +106 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/boolean.c sntp/libopts/boolean.c@1.0 +0 -0 sntp/libopts/compat/compat.h@1.1 +319 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/compat.h sntp/libopts/compat/compat.h@1.0 +0 -0 sntp/libopts/compat/pathfind.c@1.1 +339 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/pathfind.c sntp/libopts/compat/pathfind.c@1.0 +0 -0 sntp/libopts/compat/snprintf.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/snprintf.c sntp/libopts/compat/snprintf.c@1.0 +0 -0 sntp/libopts/compat/strchr.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strchr.c sntp/libopts/compat/strchr.c@1.0 +0 -0 sntp/libopts/compat/strdup.c@1.1 +19 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strdup.c sntp/libopts/compat/strdup.c@1.0 +0 -0 sntp/libopts/compat/windows-config.h@1.1 +130 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/windows-config.h sntp/libopts/compat/windows-config.h@1.0 +0 -0 sntp/libopts/configfile.c@1.1 +1290 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/configfile.c sntp/libopts/configfile.c@1.0 +0 -0 sntp/libopts/cook.c@1.1 +354 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/cook.c sntp/libopts/cook.c@1.0 +0 -0 sntp/libopts/enumeration.c@1.1 +498 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/enumeration.c sntp/libopts/enumeration.c@1.0 +0 -0 sntp/libopts/environment.c@1.1 +279 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/environment.c sntp/libopts/environment.c@1.0 +0 -0 sntp/libopts/genshell.c@1.1 +354 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/genshell.c sntp/libopts/genshell.c@1.0 +0 -0 sntp/libopts/genshell.h@1.1 +149 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/genshell.h sntp/libopts/genshell.h@1.0 +0 -0 sntp/libopts/libopts.c@1.1 +30 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/libopts.c sntp/libopts/libopts.c@1.0 +0 -0 sntp/libopts/load.c@1.1 +563 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/load.c sntp/libopts/load.c@1.0 +0 -0 sntp/libopts/m4/libopts.m4@1.1 +509 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/libopts.m4 sntp/libopts/m4/libopts.m4@1.0 +0 -0 sntp/libopts/m4/liboptschk.m4@1.1 +42 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/liboptschk.m4 sntp/libopts/m4/liboptschk.m4@1.0 +0 -0 sntp/libopts/makeshell.c@1.1 +1122 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/makeshell.c sntp/libopts/makeshell.c@1.0 +0 -0 sntp/libopts/nested.c@1.1 +733 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/nested.c sntp/libopts/nested.c@1.0 +0 -0 sntp/libopts/numeric.c@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/numeric.c sntp/libopts/numeric.c@1.0 +0 -0 sntp/libopts/pgusage.c@1.1 +157 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/pgusage.c sntp/libopts/pgusage.c@1.0 +0 -0 sntp/libopts/proto.h@1.1 +91 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/proto.h sntp/libopts/proto.h@1.0 +0 -0 sntp/libopts/putshell.c@1.1 +335 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/putshell.c sntp/libopts/putshell.c@1.0 +0 -0 sntp/libopts/restore.c@1.1 +250 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/restore.c sntp/libopts/restore.c@1.0 +0 -0 sntp/libopts/save.c@1.1 +512 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/save.c sntp/libopts/save.c@1.0 +0 -0 sntp/libopts/sort.c@1.1 +359 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/sort.c sntp/libopts/sort.c@1.0 +0 -0 sntp/libopts/stack.c@1.1 +269 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/stack.c sntp/libopts/stack.c@1.0 +0 -0 sntp/libopts/streqvcmp.c@1.1 +289 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/streqvcmp.c sntp/libopts/streqvcmp.c@1.0 +0 -0 sntp/libopts/text_mmap.c@1.1 +363 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/text_mmap.c sntp/libopts/text_mmap.c@1.0 +0 -0 sntp/libopts/tokenize.c@1.1 +321 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/tokenize.c sntp/libopts/tokenize.c@1.0 +0 -0 sntp/libopts/usage.c@1.1 +740 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/usage.c sntp/libopts/usage.c@1.0 +0 -0 sntp/libopts/version.c@1.1 +178 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/version.c sntp/libopts/version.c@1.0 +0 -0 ChangeSet@1.1465, 2007-05-12 12:29:54-04:00, mayer@pogo.udel.edu Bug 819 - Timeout for WaitForMultipleObjects was set to 500ms instead of INFINITE ChangeLog@1.35 +1 -0 Bug 819 - Timeout for WaitForMultipleObjects was set to 500ms instead of INFINITE ports/winnt/ntpd/ntp_iocompletionport.c@1.22 +1 -2 Bug 819 - Timeout for WaitForMultipleObjects was set to 500ms instead of INFINITE ChangeSet@1.1464, 2007-05-10 18:45:48-04:00, stenn@whimsy.udel.edu Audio documentation updates from Dave Mills ChangeLog@1.34 +1 -0 Audio documentation updates from Dave Mills html/audio.html@1.19 +5 -6 Audio documentation updates from Dave Mills html/drivers/driver36.html@1.32 +6 -6 Audio documentation updates from Dave Mills html/drivers/driver6.html@1.24 +3 -3 Audio documentation updates from Dave Mills html/drivers/driver7.html@1.26 +4 -5 Audio documentation updates from Dave Mills ChangeSet@1.1463, 2007-05-09 23:39:05-04:00, stenn@whimsy.udel.edu refenerate ntp_parser.c ntpd/ntp_parser.c@1.5 +260 -236 regenerate .y->.c file ChangeSet@1.1462, 2007-05-09 20:42:07-04:00, stenn@pogo.udel.edu Build even if no OPENSSL ntpd/ntp_config.c@1.148 +12 -2 Build even if no OPENSSL ntpd/ntp_parser.y@1.4 +23 -0 Build even if no OPENSSL ChangeSet@1.1440.1.99, 2007-05-09 16:23:14-04:00, stenn@whimsy.udel.edu More fuzz bit cleanup from Dave Mills ChangeLog@1.31.1.2 +2 -1 More fuzz bit cleanup from Dave Mills libntp/systime.c@1.38.1.2 +18 -16 More fuzz bit cleanup from Dave Mills ChangeSet@1.1440.1.98, 2007-05-09 07:42:10-04:00, stenn@whimsy.udel.edu NTP_4_2_5P29 TAG: NTP_4_2_5P29 ntpd/ntpd-opts.c@1.16 +2 -2 NTP_4_2_5P29 ntpd/ntpd-opts.h@1.16 +3 -3 NTP_4_2_5P29 ntpd/ntpd-opts.texi@1.15 +2 -2 NTP_4_2_5P29 ntpd/ntpd.1@1.15 +2 -2 NTP_4_2_5P29 ntpd/ntpdsim-opts.c@1.16 +2 -2 NTP_4_2_5P29 ntpd/ntpdsim-opts.h@1.16 +3 -3 NTP_4_2_5P29 ntpd/ntpdsim-opts.texi@1.15 +1 -1 NTP_4_2_5P29 ntpd/ntpdsim.1@1.15 +2 -2 NTP_4_2_5P29 ntpdc/ntpdc-opts.c@1.16 +2 -2 NTP_4_2_5P29 ntpdc/ntpdc-opts.h@1.16 +3 -3 NTP_4_2_5P29 ntpdc/ntpdc-opts.texi@1.15 +2 -2 NTP_4_2_5P29 ntpdc/ntpdc.1@1.15 +2 -2 NTP_4_2_5P29 ntpq/ntpq-opts.c@1.16 +2 -2 NTP_4_2_5P29 ntpq/ntpq-opts.h@1.16 +3 -3 NTP_4_2_5P29 ntpq/ntpq-opts.texi@1.15 +2 -2 NTP_4_2_5P29 ntpq/ntpq.1@1.15 +2 -2 NTP_4_2_5P29 packageinfo.sh@1.32 +1 -1 NTP_4_2_5P29 sntp/sntp-opts.c@1.16 +2 -2 NTP_4_2_5P29 sntp/sntp-opts.h@1.16 +3 -3 NTP_4_2_5P29 sntp/sntp-opts.texi@1.15 +1 -1 NTP_4_2_5P29 sntp/sntp.1@1.15 +2 -2 NTP_4_2_5P29 util/ntp-keygen-opts.c@1.17 +2 -2 NTP_4_2_5P29 util/ntp-keygen-opts.h@1.17 +3 -3 NTP_4_2_5P29 util/ntp-keygen-opts.texi@1.16 +2 -2 NTP_4_2_5P29 util/ntp-keygen.1@1.16 +2 -2 NTP_4_2_5P29 ChangeSet@1.1440.1.97, 2007-05-09 05:19:46-04:00, stenn@whimsy.udel.edu Added the ChangeLog entry from the previous commit ChangeLog@1.31.1.1 +1 -0 Added the ChangeLog entry from the previous commit ChangeSet@1.1459, 2007-05-08 20:32:56-04:00, stenn@pogo.udel.edu Protect some "debug" references ntpd/ntp_control.c@1.93 +3 -0 Protect some "debug" references ntpd/ntp_scanner.c@1.3 +4 -2 Protect some "debug" references ChangeSet@1.1440.1.96, 2007-05-07 07:42:57-04:00, stenn@whimsy.udel.edu NTP_4_2_5P28 TAG: NTP_4_2_5P28 ntpd/ntpd-opts.c@1.15 +2 -2 NTP_4_2_5P28 ntpd/ntpd-opts.h@1.15 +3 -3 NTP_4_2_5P28 ntpd/ntpd-opts.texi@1.14 +1 -1 NTP_4_2_5P28 ntpd/ntpd.1@1.14 +2 -2 NTP_4_2_5P28 ntpd/ntpdsim-opts.c@1.15 +2 -2 NTP_4_2_5P28 ntpd/ntpdsim-opts.h@1.15 +3 -3 NTP_4_2_5P28 ntpd/ntpdsim-opts.texi@1.14 +1 -1 NTP_4_2_5P28 ntpd/ntpdsim.1@1.14 +2 -2 NTP_4_2_5P28 ntpdc/ntpdc-opts.c@1.15 +2 -2 NTP_4_2_5P28 ntpdc/ntpdc-opts.h@1.15 +3 -3 NTP_4_2_5P28 ntpdc/ntpdc-opts.texi@1.14 +1 -1 NTP_4_2_5P28 ntpdc/ntpdc.1@1.14 +2 -2 NTP_4_2_5P28 ntpq/ntpq-opts.c@1.15 +2 -2 NTP_4_2_5P28 ntpq/ntpq-opts.h@1.15 +3 -3 NTP_4_2_5P28 ntpq/ntpq-opts.texi@1.14 +1 -1 NTP_4_2_5P28 ntpq/ntpq.1@1.14 +2 -2 NTP_4_2_5P28 packageinfo.sh@1.31 +1 -1 NTP_4_2_5P28 sntp/sntp-opts.c@1.15 +2 -2 NTP_4_2_5P28 sntp/sntp-opts.h@1.15 +3 -3 NTP_4_2_5P28 sntp/sntp-opts.texi@1.14 +1 -1 NTP_4_2_5P28 sntp/sntp.1@1.14 +2 -2 NTP_4_2_5P28 util/ntp-keygen-opts.c@1.16 +2 -2 NTP_4_2_5P28 util/ntp-keygen-opts.h@1.16 +3 -3 NTP_4_2_5P28 util/ntp-keygen-opts.texi@1.15 +1 -1 NTP_4_2_5P28 util/ntp-keygen.1@1.15 +2 -2 NTP_4_2_5P28 ChangeSet@1.1440.1.95, 2007-05-07 06:43:34-04:00, stenn@whimsy.udel.edu replay cleanup from Dave Mills ntpd/ntp_proto.c@1.252 +15 -18 replay cleanup from Dave Mills ChangeSet@1.1440.1.94, 2007-05-07 06:35:26-04:00, stenn@whimsy.udel.edu Cleanup random fuzz bits. (Dave Mills) libntp/systime.c@1.38.1.1 +7 -15 Cleanup random fuzz bits. (Dave Mills) ChangeSet@1.1458, 2007-05-05 22:28:37-04:00, stenn@pogo.udel.edu New config file parsing code ChangeLog@1.32 +1 -0 New config file parsing code ChangeSet@1.1457, 2007-05-05 14:29:11-04:00, stenn@pogo.udel.edu bootstrap yacc/bison files bootstrap@1.19 +4 -0 bootstrap yacc/bison files ChangeSet@1.1455, 2007-05-05 14:15:36-04:00, stenn@pogo.udel.edu OPENSSL and DEBUG cleanup ntpd/ntp_config.c@1.147 +6 -0 OPENSSL and DEBUG cleanup ChangeSet@1.1436.1.46, 2007-04-28 10:19:57+00:00, kardel@pogo.udel.edu ntp_peer.c: Bug 789 (backported from ntp-dev): Fix multicast client crypto authentication and make sure arriving multicast packets do not disturb the autokey dance. ChangeLog: Bug 789 (backported from ntp-dev): Fix multicast client crypto authentication and make sure arriving multicast packets do not disturb the autokey dance. ChangeLog@1.1.1.12 +4 -1 Bug 789: Fix multicast client crypto authentication and make sure arriving multicast packets do not disturb the autokey dance. ntpd/ntp_peer.c@1.97.1.2 +21 -12 Bug 789 (backported from ntp-dev): fix multicast client mode by re-setting crypto information only when the local address changes and not for BCLNTs. Addtitionally don't update the local address while a BCLNT is doing the autokey dance. ChangeSet@1.1436.1.45, 2007-04-28 10:03:26+00:00, kardel@pogo.udel.edu ntp_io.c, ChangeLog: bug 785 (backport from ntp-dev): improve handling of multicast interfaces (multicast routers still need to run a multicast routing software/daemon) ntp_peer.c: bug 785 (backport from ntp-dev): clarify debug messages ChangeLog@1.1.1.11 +1 -0 bug 785 (backport from ntp-dev): improve handling of multicast interfaces (multicast routers still need to run a multicast routing software/daemon) ntpd/ntp_io.c@1.244.2.4 +84 -62 bug 785 (backport from ntp-dev): improve handling of multicast interfaces (multicast routers still need to run a multicast routing software/daemon) ntpd/ntp_peer.c@1.97.1.1 +2 -2 bug 785 (backport from ntp-dev): clarify debug messages ChangeSet@1.1440.1.93, 2007-04-25 07:46:23-04:00, stenn@whimsy.udel.edu NTP_4_2_5P27 TAG: NTP_4_2_5P27 ntpd/ntpd-opts.c@1.14 +2 -2 NTP_4_2_5P27 ntpd/ntpd-opts.h@1.14 +3 -3 NTP_4_2_5P27 ntpd/ntpd-opts.texi@1.13 +2 -8 NTP_4_2_5P27 ntpd/ntpd.1@1.13 +2 -2 NTP_4_2_5P27 ntpd/ntpdsim-opts.c@1.14 +2 -2 NTP_4_2_5P27 ntpd/ntpdsim-opts.h@1.14 +3 -3 NTP_4_2_5P27 ntpd/ntpdsim-opts.texi@1.13 +1 -1 NTP_4_2_5P27 ntpd/ntpdsim.1@1.13 +2 -2 NTP_4_2_5P27 ntpdc/ntpdc-opts.c@1.14 +2 -2 NTP_4_2_5P27 ntpdc/ntpdc-opts.h@1.14 +3 -3 NTP_4_2_5P27 ntpdc/ntpdc-opts.texi@1.13 +2 -2 NTP_4_2_5P27 ntpdc/ntpdc.1@1.13 +2 -2 NTP_4_2_5P27 ntpq/ntpq-opts.c@1.14 +2 -2 NTP_4_2_5P27 ntpq/ntpq-opts.h@1.14 +3 -3 NTP_4_2_5P27 ntpq/ntpq-opts.texi@1.13 +2 -2 NTP_4_2_5P27 ntpq/ntpq.1@1.13 +2 -2 NTP_4_2_5P27 packageinfo.sh@1.30 +1 -1 NTP_4_2_5P27 sntp/sntp-opts.c@1.14 +2 -2 NTP_4_2_5P27 sntp/sntp-opts.h@1.14 +3 -3 NTP_4_2_5P27 sntp/sntp-opts.texi@1.13 +1 -1 NTP_4_2_5P27 sntp/sntp.1@1.13 +2 -2 NTP_4_2_5P27 util/ntp-keygen-opts.c@1.15 +2 -2 NTP_4_2_5P27 util/ntp-keygen-opts.h@1.15 +3 -3 NTP_4_2_5P27 util/ntp-keygen-opts.texi@1.14 +2 -2 NTP_4_2_5P27 util/ntp-keygen.1@1.14 +2 -2 NTP_4_2_5P27 ChangeSet@1.1440.1.92, 2007-04-25 03:39:23-04:00, stenn@whimsy.udel.edu The m4/ subdirectory is magically handled. Makefile.am@1.75 +0 -1 The m4/ subdirectory is magically handled. ChangeSet@1.1440.1.91, 2007-04-25 02:45:35-04:00, stenn@whimsy.udel.edu [Bug 542] Tolerate missing directory separator at EO statsdir ChangeLog@1.31 +1 -0 [Bug 542] Tolerate missing directory separator at EO statsdir Makefile.am@1.74 +1 -0 [Bug 542] Tolerate missing directory separator at EO statsdir configure.ac@1.404.1.1 +1 -0 [Bug 542] Tolerate missing directory separator at EO statsdir m4/ntp_dir_sep.m4@1.1 +18 -0 BitKeeper file /deacon/backroom/ntp-dev/m4/ntp_dir_sep.m4 m4/ntp_dir_sep.m4@1.0 +0 -0 ntpd/ntp_util.c@1.44 +20 -1 [Bug 542] Tolerate missing directory separator at EO statsdir ports/winnt/include/config.h@1.49 +10 -7 [Bug 542] Tolerate missing directory separator at EO statsdir ChangeSet@1.1454, 2007-04-23 16:33:49+00:00, kamboj@pogo.udel.edu Includes changes to allow the seperate compilation of ntp_data_structures.c ntp_scanner.c and ntp_parser.y Also includes other minor bugfixes. BitKeeper/etc/ignore@1.60, stenn@pogo.udel.edu +1 -0 added ylwrap configure.ac@1.405 +1 -0 Minor Changes include/ntp_config.h@1.44 +25 -9 Moved some declarations from ntp_scanner.h to this file and vice versa. include/ntpsim.h@1.8 +0 -1 Removed a comment libntp/systime.c@1.40 +2 -1 No changes ntpd/Makefile.am@1.57 +5 -2 Updated SOURCES to include ntp_data_structures.c ntp_scanner.c and ntp_parser.y files ntpd/cmd_args.c@1.49 +1 -1 Minor bugfix ntpd/ntp_config.c@1.146 +8 -58 Removed the direcrt inclusion of source files. Including headers instead. ntpd/ntp_data_structures.c@1.2 +5 -2 Updated to include a header file for the data structures. ntpd/ntp_parser.c@1.4 +683 -650 New file generated from ntp_parser.y ntpd/ntp_parser.c@1.3, stenn@pogo.udel.edu +0 -0 Rename: ntpd/ntp_config.tab.c -> ntpd/ntp_parser.c ntpd/ntp_parser.h@1.2 +4 -3 New file generated from ntp_parser.y ntpd/ntp_parser.h@1.1, stenn@pogo.udel.edu +174 -0 BitKeeper file /pogo/users/kamboj/new-config-bk-repo/ntpd/ntp_parser.h ntpd/ntp_parser.h@1.0, stenn@pogo.udel.edu +0 -0 ntpd/ntp_parser.y@1.3 +38 -1 Added required headers to the code ntpd/ntp_parser.y@1.2, stenn@pogo.udel.edu +0 -0 Rename: ntpd/ntp_config.y -> ntpd/ntp_parser.y ntpd/ntp_scanner.c@1.2 +25 -36 Minor changes: Updated function definitions to conform to ANSI C Moved some data from ntp_scanner.h to this file ntpd/ntp_scanner.h@1.2 +14 -36 Moved some declarations to ntp_config.h ntpd/ntp_scanner.h@1.1, stenn@pogo.udel.edu +97 -0 BitKeeper file /pogo/users/kamboj/new-config-bk-repo/ntpd/ntp_scanner.h ntpd/ntp_scanner.h@1.0, stenn@pogo.udel.edu +0 -0 ntpd/ntpsim.c@1.16 +6 -35 Removed some old redundant comments ChangeSet@1.1440.1.90, 2007-04-22 07:42:54-04:00, stenn@whimsy.udel.edu NTP_4_2_5P26 TAG: NTP_4_2_5P26 ntpd/ntpd-opts.c@1.13 +2 -2 NTP_4_2_5P26 ntpd/ntpd-opts.h@1.13 +3 -3 NTP_4_2_5P26 ntpd/ntpd-opts.texi@1.12 +1 -1 NTP_4_2_5P26 ntpd/ntpd.1@1.12 +2 -2 NTP_4_2_5P26 ntpd/ntpdsim-opts.c@1.13 +2 -2 NTP_4_2_5P26 ntpd/ntpdsim-opts.h@1.13 +3 -3 NTP_4_2_5P26 ntpd/ntpdsim-opts.texi@1.12 +1 -1 NTP_4_2_5P26 ntpd/ntpdsim.1@1.12 +2 -2 NTP_4_2_5P26 ntpdc/ntpdc-opts.c@1.13 +2 -2 NTP_4_2_5P26 ntpdc/ntpdc-opts.h@1.13 +3 -3 NTP_4_2_5P26 ntpdc/ntpdc-opts.texi@1.12 +1 -1 NTP_4_2_5P26 ntpdc/ntpdc.1@1.12 +2 -2 NTP_4_2_5P26 ntpq/ntpq-opts.c@1.13 +2 -2 NTP_4_2_5P26 ntpq/ntpq-opts.h@1.13 +3 -3 NTP_4_2_5P26 ntpq/ntpq-opts.texi@1.12 +1 -1 NTP_4_2_5P26 ntpq/ntpq.1@1.12 +2 -2 NTP_4_2_5P26 packageinfo.sh@1.29 +1 -1 NTP_4_2_5P26 sntp/sntp-opts.c@1.13 +2 -2 NTP_4_2_5P26 sntp/sntp-opts.h@1.13 +3 -3 NTP_4_2_5P26 sntp/sntp-opts.texi@1.12 +1 -1 NTP_4_2_5P26 sntp/sntp.1@1.12 +2 -2 NTP_4_2_5P26 util/ntp-keygen-opts.c@1.14 +2 -2 NTP_4_2_5P26 util/ntp-keygen-opts.h@1.14 +3 -3 NTP_4_2_5P26 util/ntp-keygen-opts.texi@1.13 +1 -1 NTP_4_2_5P26 util/ntp-keygen.1@1.13 +2 -2 NTP_4_2_5P26 ChangeSet@1.1440.1.89, 2007-04-21 13:13:03-04:00, stenn@whimsy.udel.edu [Bug 812] ntpd should drop supplementary groups ChangeLog@1.30 +1 -0 [Bug 812] ntpd should drop supplementary groups ChangeSet@1.1440.1.88, 2007-04-21 07:43:00-04:00, stenn@whimsy.udel.edu NTP_4_2_5P25 TAG: NTP_4_2_5P25 ntpd/ntpd-opts.c@1.12 +2 -2 NTP_4_2_5P25 ntpd/ntpd-opts.h@1.12 +3 -3 NTP_4_2_5P25 ntpd/ntpd-opts.texi@1.11 +1 -1 NTP_4_2_5P25 ntpd/ntpd.1@1.11 +2 -2 NTP_4_2_5P25 ntpd/ntpdsim-opts.c@1.12 +2 -2 NTP_4_2_5P25 ntpd/ntpdsim-opts.h@1.12 +3 -3 NTP_4_2_5P25 ntpd/ntpdsim-opts.texi@1.11 +1 -1 NTP_4_2_5P25 ntpd/ntpdsim.1@1.11 +2 -2 NTP_4_2_5P25 ntpdc/ntpdc-opts.c@1.12 +2 -2 NTP_4_2_5P25 ntpdc/ntpdc-opts.h@1.12 +3 -3 NTP_4_2_5P25 ntpdc/ntpdc-opts.texi@1.11 +1 -1 NTP_4_2_5P25 ntpdc/ntpdc.1@1.11 +2 -2 NTP_4_2_5P25 ntpq/ntpq-opts.c@1.12 +2 -2 NTP_4_2_5P25 ntpq/ntpq-opts.h@1.12 +3 -3 NTP_4_2_5P25 ntpq/ntpq-opts.texi@1.11 +1 -1 NTP_4_2_5P25 ntpq/ntpq.1@1.11 +2 -2 NTP_4_2_5P25 packageinfo.sh@1.28 +1 -1 NTP_4_2_5P25 sntp/sntp-opts.c@1.12 +2 -2 NTP_4_2_5P25 sntp/sntp-opts.h@1.12 +3 -3 NTP_4_2_5P25 sntp/sntp-opts.texi@1.11 +1 -1 NTP_4_2_5P25 sntp/sntp.1@1.11 +2 -2 NTP_4_2_5P25 util/ntp-keygen-opts.c@1.13 +2 -2 NTP_4_2_5P25 util/ntp-keygen-opts.h@1.13 +3 -3 NTP_4_2_5P25 util/ntp-keygen-opts.texi@1.12 +1 -1 NTP_4_2_5P25 util/ntp-keygen.1@1.12 +2 -2 NTP_4_2_5P25 ChangeSet@1.1440.1.87, 2007-04-21 01:14:37-04:00, stenn@whimsy.udel.edu [Bug 812] ntpd should drop supplementary groups ntpd/ntpd.c@1.83.1.3 +24 -2 [Bug 812] ntpd should drop supplementary groups ChangeSet@1.1453, 2007-04-20 16:18:30+00:00, kamboj@pogo.udel.edu Minor Bugfixes include/ntp_config.h@1.43 +1 -1 A minor bugfix to make a prototype ANSI C compliant ntpd/ntp_config.c@1.145 +5 -3 Minor bugfixes ntpd/ntp_config.tab.c@1.2 +1193 -984 Added minor bugfixes to ntp_config.y ChangeSet@1.1440.1.86, 2007-04-20 07:42:36-04:00, stenn@whimsy.udel.edu NTP_4_2_5P24 TAG: NTP_4_2_5P24 ntpd/ntpd-opts.c@1.11 +2 -2 NTP_4_2_5P24 ntpd/ntpd-opts.h@1.11 +3 -3 NTP_4_2_5P24 ntpd/ntpd-opts.texi@1.10 +1 -1 NTP_4_2_5P24 ntpd/ntpd.1@1.10 +2 -2 NTP_4_2_5P24 ntpd/ntpdsim-opts.c@1.11 +2 -2 NTP_4_2_5P24 ntpd/ntpdsim-opts.h@1.11 +3 -3 NTP_4_2_5P24 ntpd/ntpdsim-opts.texi@1.10 +1 -1 NTP_4_2_5P24 ntpd/ntpdsim.1@1.10 +2 -2 NTP_4_2_5P24 ntpdc/ntpdc-opts.c@1.11 +2 -2 NTP_4_2_5P24 ntpdc/ntpdc-opts.h@1.11 +3 -3 NTP_4_2_5P24 ntpdc/ntpdc-opts.texi@1.10 +1 -1 NTP_4_2_5P24 ntpdc/ntpdc.1@1.10 +2 -2 NTP_4_2_5P24 ntpq/ntpq-opts.c@1.11 +2 -2 NTP_4_2_5P24 ntpq/ntpq-opts.h@1.11 +3 -3 NTP_4_2_5P24 ntpq/ntpq-opts.texi@1.10 +1 -1 NTP_4_2_5P24 ntpq/ntpq.1@1.10 +2 -2 NTP_4_2_5P24 packageinfo.sh@1.27 +1 -1 NTP_4_2_5P24 sntp/sntp-opts.c@1.11 +2 -2 NTP_4_2_5P24 sntp/sntp-opts.h@1.11 +3 -3 NTP_4_2_5P24 sntp/sntp-opts.texi@1.10 +1 -1 NTP_4_2_5P24 sntp/sntp.1@1.10 +2 -2 NTP_4_2_5P24 util/ntp-keygen-opts.c@1.12 +2 -2 NTP_4_2_5P24 util/ntp-keygen-opts.h@1.12 +3 -3 NTP_4_2_5P24 util/ntp-keygen-opts.texi@1.11 +1 -1 NTP_4_2_5P24 util/ntp-keygen.1@1.11 +2 -2 NTP_4_2_5P24 ChangeSet@1.1440.1.85, 2007-04-20 01:04:24-04:00, stenn@whimsy.udel.edu [Bug 815] Fix warning compiling 4.2.5p22 under Windows with VC6 ChangeLog@1.29 +1 -0 [Bug 815] Fix warning compiling 4.2.5p22 under Windows with VC6 ChangeSet@1.1440.1.84, 2007-04-20 00:56:48-04:00, stenn@whimsy.udel.edu Fix permissions of sntp/sntp-opts.menu sntp/sntp-opts.menu@1.3 +0 -0 Change mode to -rw-rw-r-- ChangeSet@1.1440.1.83, 2007-04-18 12:53:10+00:00, burnicki@pogo.udel.edu [Bug #815] Define HAVE_UINTPTR_T under Windows to avoid duplicate definition elsewhere. ports/winnt/include/config.h@1.48 +2 -0 [Bug #815] Define HAVE_UINTPTR_T under Windows to avoid duplicate definition elsewhere. ChangeSet@1.1440.1.82, 2007-04-18 08:18:53-04:00, stenn@whimsy.udel.edu NTP_4_2_5P23 TAG: NTP_4_2_5P23 ntpd/ntpd-opts.c@1.10 +7 -50 NTP_4_2_5P23 ntpd/ntpd-opts.h@1.10 +5 -13 NTP_4_2_5P23 ntpd/ntpd-opts.texi@1.9 +1 -1 NTP_4_2_5P23 ntpd/ntpd.1@1.9 +3 -19 NTP_4_2_5P23 ntpd/ntpdsim-opts.c@1.10 +2 -2 NTP_4_2_5P23 ntpd/ntpdsim-opts.h@1.10 +3 -3 NTP_4_2_5P23 ntpd/ntpdsim-opts.texi@1.9 +1 -1 NTP_4_2_5P23 ntpd/ntpdsim.1@1.9 +2 -2 NTP_4_2_5P23 ntpdc/ntpdc-opts.c@1.10 +2 -2 NTP_4_2_5P23 ntpdc/ntpdc-opts.h@1.10 +3 -3 NTP_4_2_5P23 ntpdc/ntpdc-opts.texi@1.9 +1 -1 NTP_4_2_5P23 ntpdc/ntpdc.1@1.9 +2 -2 NTP_4_2_5P23 ntpq/ntpq-opts.c@1.10 +2 -2 NTP_4_2_5P23 ntpq/ntpq-opts.h@1.10 +3 -3 NTP_4_2_5P23 ntpq/ntpq-opts.texi@1.9 +1 -1 NTP_4_2_5P23 ntpq/ntpq.1@1.9 +2 -2 NTP_4_2_5P23 packageinfo.sh@1.26 +1 -1 NTP_4_2_5P23 sntp/sntp-opts.c@1.10 +2 -2 NTP_4_2_5P23 sntp/sntp-opts.h@1.10 +3 -3 NTP_4_2_5P23 sntp/sntp-opts.texi@1.9 +1 -1 NTP_4_2_5P23 sntp/sntp.1@1.9 +2 -2 NTP_4_2_5P23 util/ntp-keygen-opts.c@1.11 +2 -2 NTP_4_2_5P23 util/ntp-keygen-opts.h@1.11 +3 -3 NTP_4_2_5P23 util/ntp-keygen-opts.texi@1.10 +1 -1 NTP_4_2_5P23 util/ntp-keygen.1@1.10 +2 -2 NTP_4_2_5P23 ChangeSet@1.1440.5.1, 2007-04-18 06:05:04-04:00, stenn@deacon.udel.edu [Bug 740] Fix kernel/daemon startup drift anomaly ChangeLog@1.26.1.1 +1 -0 [Bug 740] Fix kernel/daemon startup drift anomaly conf/beauregard.conf@1.3 +1 -1 fix a typo in a comment line ntpd/cmd_args.c@1.45.2.1 +3 -2 [Bug 740] Fix kernel/daemon startup drift anomaly ntpd/ntp_loopfilter.c@1.133 +4 -4 [Bug 740] Fix kernel/daemon startup drift anomaly ntpd/ntp_proto.c@1.251 +0 -8 [Bug 740] Fix kernel/daemon startup drift anomaly ChangeSet@1.1436.1.44, 2007-04-14 19:05:07-04:00, stenn@whimsy.udel.edu NTP_4_2_4P2_RC1 TAG: NTP_4_2_4P2_RC1 ntpd/ntpd-opts.c@1.50.2.3 +2 -2 NTP_4_2_4P2_RC1 ntpd/ntpd-opts.h@1.50.2.3 +3 -3 NTP_4_2_4P2_RC1 ntpd/ntpd-opts.texi@1.49.2.3 +1 -1 NTP_4_2_4P2_RC1 ntpd/ntpd.1@1.48.2.3 +2 -2 NTP_4_2_4P2_RC1 ntpd/ntpdsim-opts.c@1.50.2.3 +2 -2 NTP_4_2_4P2_RC1 ntpd/ntpdsim-opts.h@1.50.2.3 +3 -3 NTP_4_2_4P2_RC1 ntpd/ntpdsim-opts.texi@1.48.2.3 +1 -1 NTP_4_2_4P2_RC1 ntpd/ntpdsim.1@1.48.2.3 +2 -2 NTP_4_2_4P2_RC1 ntpdc/ntpdc-opts.c@1.50.2.3 +2 -2 NTP_4_2_4P2_RC1 ntpdc/ntpdc-opts.h@1.50.2.3 +3 -3 NTP_4_2_4P2_RC1 ntpdc/ntpdc-opts.texi@1.48.2.3 +1 -1 NTP_4_2_4P2_RC1 ntpdc/ntpdc.1@1.48.2.3 +2 -2 NTP_4_2_4P2_RC1 ntpq/ntpq-opts.c@1.52.2.3 +2 -2 NTP_4_2_4P2_RC1 ntpq/ntpq-opts.h@1.52.2.3 +3 -3 NTP_4_2_4P2_RC1 ntpq/ntpq-opts.texi@1.49.2.3 +1 -1 NTP_4_2_4P2_RC1 ntpq/ntpq.1@1.48.2.3 +2 -2 NTP_4_2_4P2_RC1 packageinfo.sh@1.65.8.4 +2 -2 NTP_4_2_4P2_RC1 sntp/sntp-opts.c@1.49.2.2 +2 -2 NTP_4_2_4P2_RC1 sntp/sntp-opts.h@1.49.2.2 +3 -3 NTP_4_2_4P2_RC1 sntp/sntp-opts.texi@1.46.2.2 +1 -1 NTP_4_2_4P2_RC1 sntp/sntp.1@1.49.2.2 +2 -2 NTP_4_2_4P2_RC1 util/ntp-keygen-opts.c@1.49.2.3 +2 -2 NTP_4_2_4P2_RC1 util/ntp-keygen-opts.h@1.49.2.3 +3 -3 NTP_4_2_4P2_RC1 util/ntp-keygen-opts.texi@1.47.2.3 +1 -1 NTP_4_2_4P2_RC1 util/ntp-keygen.1@1.47.2.3 +2 -2 NTP_4_2_4P2_RC1 ChangeSet@1.1436.1.43, 2007-04-14 18:16:04-04:00, stenn@deacon.udel.edu Distribute include/homerc.def include/Makefile.am@1.24.1.1 +1 -1 Distribute include/homerc.def packageinfo.sh@1.65.8.3 +1 -1 restart the RC ChangeSet@1.1436.1.42, 2007-04-14 07:53:43-04:00, stenn@whimsy.udel.edu NTP_4_2_4P1_RC1 TAG: NTP_4_2_4P1_RC1 ntpd/ntpd-opts.c@1.50.2.2 +2 -2 NTP_4_2_4P1_RC1 ntpd/ntpd-opts.h@1.50.2.2 +3 -3 NTP_4_2_4P1_RC1 ntpd/ntpd-opts.texi@1.49.2.2 +2 -2 NTP_4_2_4P1_RC1 ntpd/ntpd.1@1.48.2.2 +2 -2 NTP_4_2_4P1_RC1 ntpd/ntpdsim-opts.c@1.50.2.2 +2 -2 NTP_4_2_4P1_RC1 ntpd/ntpdsim-opts.h@1.50.2.2 +3 -3 NTP_4_2_4P1_RC1 ntpd/ntpdsim-opts.texi@1.48.2.2 +1 -1 NTP_4_2_4P1_RC1 ntpd/ntpdsim.1@1.48.2.2 +2 -2 NTP_4_2_4P1_RC1 ntpdc/ntpdc-opts.c@1.50.2.2 +2 -2 NTP_4_2_4P1_RC1 ntpdc/ntpdc-opts.h@1.50.2.2 +3 -3 NTP_4_2_4P1_RC1 ntpdc/ntpdc-opts.texi@1.48.2.2 +2 -2 NTP_4_2_4P1_RC1 ntpdc/ntpdc.1@1.48.2.2 +2 -2 NTP_4_2_4P1_RC1 ntpq/ntpq-opts.c@1.52.2.2 +2 -2 NTP_4_2_4P1_RC1 ntpq/ntpq-opts.h@1.52.2.2 +3 -3 NTP_4_2_4P1_RC1 ntpq/ntpq-opts.texi@1.49.2.2 +2 -2 NTP_4_2_4P1_RC1 ntpq/ntpq.1@1.48.2.2 +2 -2 NTP_4_2_4P1_RC1 packageinfo.sh@1.65.8.2 +2 -2 NTP_4_2_4P1_RC1 sntp/sntp-opts.c@1.49.2.1 +8 -7 NTP_4_2_4P1_RC1 sntp/sntp-opts.h@1.49.2.1 +8 -14 NTP_4_2_4P1_RC1 sntp/sntp-opts.texi@1.46.2.1 +1 -1 NTP_4_2_4P1_RC1 sntp/sntp.1@1.49.2.1 +2 -2 NTP_4_2_4P1_RC1 util/ntp-keygen-opts.c@1.49.2.2 +2 -2 NTP_4_2_4P1_RC1 util/ntp-keygen-opts.h@1.49.2.2 +3 -3 NTP_4_2_4P1_RC1 util/ntp-keygen-opts.texi@1.47.2.2 +2 -2 NTP_4_2_4P1_RC1 util/ntp-keygen.1@1.47.2.2 +2 -2 NTP_4_2_4P1_RC1 ChangeSet@1.1436.1.41, 2007-04-14 05:13:18-04:00, stenn@whimsy.udel.edu [Bug 811] ntpd should not read a .ntprc file ChangeLog@1.1.1.10 +1 -0 [Bug 811] ntpd should not read a .ntprc file ChangeSet@1.1436.1.40, 2007-04-14 04:47:21-04:00, stenn@whimsy.udel.edu start an RC cycle packageinfo.sh@1.65.8.1 +2 -2 start an RC cycle ChangeSet@1.1436.1.39, 2007-04-14 02:38:03-04:00, stenn@whimsy.udel.edu [Bug 811] ntpd should not read a .ntprc file clockstuff/Makefile.am@1.5.1.1 +1 -1 [Bug 811] ntpd should not read a .ntprc file clockstuff/clktest-opts.def@1.5 +1 -0 [Bug 811] ntpd should not read a .ntprc file include/copyright.def@1.4 +0 -7 [Bug 811] ntpd should not read a .ntprc file include/homerc.def@1.1 +9 -0 BitKeeper file /deacon/backroom/ntp-stable/include/homerc.def include/homerc.def@1.0 +0 -0 ntpd/Makefile.am@1.52.2.1 +3 -3 [Bug 811] ntpd should not read a .ntprc file ntpd/ntpd-opts.c@1.50.2.1 +12 -54 [Bug 811] ntpd should not read a .ntprc file ntpd/ntpd-opts.h@1.50.2.1 +8 -22 [Bug 811] ntpd should not read a .ntprc file ntpd/ntpd-opts.texi@1.49.2.1 +3 -3 [Bug 811] ntpd should not read a .ntprc file ntpd/ntpd.1@1.48.2.1 +3 -19 [Bug 811] ntpd should not read a .ntprc file ntpd/ntpdsim-opts.c@1.50.2.1 +7 -6 [Bug 811] ntpd should not read a .ntprc file ntpd/ntpdsim-opts.def@1.6 +1 -0 [Bug 811] ntpd should not read a .ntprc file ntpd/ntpdsim-opts.h@1.50.2.1 +6 -12 [Bug 811] ntpd should not read a .ntprc file ntpd/ntpdsim-opts.texi@1.48.2.1 +1 -1 [Bug 811] ntpd should not read a .ntprc file ntpd/ntpdsim.1@1.48.2.1 +2 -2 [Bug 811] ntpd should not read a .ntprc file ntpdc/Makefile.am@1.33.1.1 +1 -0 [Bug 811] ntpd should not read a .ntprc file ntpdc/ntpdc-opts.c@1.50.2.1 +7 -6 [Bug 811] ntpd should not read a .ntprc file ntpdc/ntpdc-opts.def@1.13 +1 -0 [Bug 811] ntpd should not read a .ntprc file ntpdc/ntpdc-opts.h@1.50.2.1 +6 -12 [Bug 811] ntpd should not read a .ntprc file ntpdc/ntpdc-opts.texi@1.48.2.1 +3 -3 [Bug 811] ntpd should not read a .ntprc file ntpdc/ntpdc.1@1.48.2.1 +2 -2 [Bug 811] ntpd should not read a .ntprc file ntpq/Makefile.am@1.25.1.1 +1 -0 [Bug 811] ntpd should not read a .ntprc file ntpq/ntpq-opts.c@1.52.2.1 +7 -6 [Bug 811] ntpd should not read a .ntprc file ntpq/ntpq-opts.def@1.12 +1 -0 [Bug 811] ntpd should not read a .ntprc file ntpq/ntpq-opts.h@1.52.2.1 +6 -12 [Bug 811] ntpd should not read a .ntprc file ntpq/ntpq-opts.texi@1.49.2.1 +3 -3 [Bug 811] ntpd should not read a .ntprc file ntpq/ntpq.1@1.48.2.1 +2 -2 [Bug 811] ntpd should not read a .ntprc file util/Makefile.am@1.34.1.1 +1 -0 [Bug 811] ntpd should not read a .ntprc file util/ntp-keygen-opts.c@1.49.2.1 +7 -6 [Bug 811] ntpd should not read a .ntprc file util/ntp-keygen-opts.def@1.6.1.1 +1 -0 [Bug 811] ntpd should not read a .ntprc file util/ntp-keygen-opts.h@1.49.2.1 +6 -12 [Bug 811] ntpd should not read a .ntprc file util/ntp-keygen-opts.texi@1.47.2.1 +3 -3 [Bug 811] ntpd should not read a .ntprc file util/ntp-keygen.1@1.47.2.1 +2 -2 [Bug 811] ntpd should not read a .ntprc file ChangeSet@1.1436.1.38, 2007-04-14 01:11:33-04:00, stenn@whimsy.udel.edu autogen/libopts upgrade BitKeeper/deleted/.del-COPYING.lgpl@1.2.1.1 +0 -0 Delete: libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.lgpl~54a90ba0899593cb@1.1.1.1 +0 -0 Delete: sntp/libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.mbsd@1.1.1.1 +0 -0 Delete: libopts/COPYING.mbsd BitKeeper/deleted/.del-COPYING.mbsd~9b1945bb2136c70b@1.1.1.1 +0 -0 Delete: sntp/libopts/COPYING.mbsd BitKeeper/deleted/.del-MakeDefs.inc@1.1.1.1 +0 -0 Delete: libopts/MakeDefs.inc BitKeeper/deleted/.del-MakeDefs.inc~2b8fdfc9df6d652d@1.1.1.1 +0 -0 Delete: sntp/libopts/MakeDefs.inc BitKeeper/deleted/.del-Makefile.am@1.6.1.1 +0 -0 Delete: libopts/Makefile.am BitKeeper/deleted/.del-Makefile.am~fa9bd87b6045015c@1.4.1.1 +0 -0 Delete: sntp/libopts/Makefile.am BitKeeper/deleted/.del-README@1.1.1.1 +0 -0 Delete: libopts/README BitKeeper/deleted/.del-README~1ae087758ee867d4@1.1.1.1 +0 -0 Delete: sntp/libopts/README BitKeeper/deleted/.del-autoopts.c@1.10.1.1 +0 -0 Delete: libopts/autoopts.c BitKeeper/deleted/.del-autoopts.c~5b417341bc85d7a8@1.7.1.1 +0 -0 Delete: sntp/libopts/autoopts.c BitKeeper/deleted/.del-autoopts.h@1.9.1.1 +0 -0 Delete: libopts/autoopts.h BitKeeper/deleted/.del-autoopts.h~8cdce21b181a1a01@1.7.1.1 +0 -0 Delete: sntp/libopts/autoopts.h BitKeeper/deleted/.del-boolean.c@1.8.1.1 +0 -0 Delete: libopts/boolean.c BitKeeper/deleted/.del-boolean.c~a5d10c8997e6a2e2@1.5.1.1 +0 -0 Delete: sntp/libopts/boolean.c BitKeeper/deleted/.del-compat.h@1.12.1.1 +0 -0 Delete: libopts/compat/compat.h BitKeeper/deleted/.del-compat.h~9682d0ac273ae32@1.8.1.1 +0 -0 Delete: sntp/libopts/compat/compat.h BitKeeper/deleted/.del-configfile.c@1.10.1.1 +0 -0 Delete: libopts/configfile.c BitKeeper/deleted/.del-configfile.c~8194f784686fa804@1.7.1.1 +0 -0 Delete: sntp/libopts/configfile.c BitKeeper/deleted/.del-cook.c@1.9.1.1 +0 -0 Delete: libopts/cook.c BitKeeper/deleted/.del-cook.c~e48d079a438432dc@1.6.1.1 +0 -0 Delete: sntp/libopts/cook.c BitKeeper/deleted/.del-enumeration.c@1.9.1.1 +0 -0 Delete: libopts/enumeration.c BitKeeper/deleted/.del-enumeration.c~5f4e6af2706370ae@1.6.1.1 +0 -0 Delete: sntp/libopts/enumeration.c BitKeeper/deleted/.del-environment.c@1.8.1.1 +0 -0 Delete: libopts/environment.c BitKeeper/deleted/.del-environment.c~2bae2966695067c2@1.5.1.1 +0 -0 Delete: sntp/libopts/environment.c BitKeeper/deleted/.del-genshell.c@1.9.1.1 +0 -0 Delete: libopts/genshell.c BitKeeper/deleted/.del-genshell.c~1fd152b2b52bdab@1.6.1.1 +0 -0 Delete: sntp/libopts/genshell.c BitKeeper/deleted/.del-genshell.h@1.9.1.1 +0 -0 Delete: libopts/genshell.h BitKeeper/deleted/.del-genshell.h~375f0fa5b925f454@1.6.1.1 +0 -0 Delete: sntp/libopts/genshell.h BitKeeper/deleted/.del-libopts.c@1.3.1.1 +0 -0 Delete: libopts/libopts.c BitKeeper/deleted/.del-libopts.c~58b8fbed850e6d5e@1.3.1.1 +0 -0 Delete: sntp/libopts/libopts.c BitKeeper/deleted/.del-libopts.m4@1.14.1.1 +0 -0 Delete: libopts/m4/libopts.m4 BitKeeper/deleted/.del-libopts.m4~9e0f33f57d3a0a9@1.11.1.1 +0 -0 Delete: sntp/libopts/m4/libopts.m4 BitKeeper/deleted/.del-liboptschk.m4@1.3.1.1 +0 -0 Delete: libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-liboptschk.m4~bbeebebe76865058@1.3.1.1 +0 -0 Delete: sntp/libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-libtool.m4@1.1.1.1 +0 -0 Delete: libopts/m4/libtool.m4 BitKeeper/deleted/.del-libtool.m4~db8acbd0fb34597f@1.1.1.1 +0 -0 Delete: sntp/libopts/m4/libtool.m4 BitKeeper/deleted/.del-load.c@1.10.1.1 +0 -0 Delete: libopts/load.c BitKeeper/deleted/.del-load.c~59960aa12bb95bf7@1.7.1.1 +0 -0 Delete: sntp/libopts/load.c BitKeeper/deleted/.del-makeshell.c@1.11.1.1 +0 -0 Delete: libopts/makeshell.c BitKeeper/deleted/.del-makeshell.c~4fcd12fc31c0a4a4@1.8.1.1 +0 -0 Delete: sntp/libopts/makeshell.c BitKeeper/deleted/.del-nested.c@1.9.1.1 +0 -0 Delete: libopts/nested.c BitKeeper/deleted/.del-nested.c~85346d5d12098689@1.6.1.1 +0 -0 Delete: sntp/libopts/nested.c BitKeeper/deleted/.del-numeric.c@1.9.1.1 +0 -0 Delete: libopts/numeric.c BitKeeper/deleted/.del-numeric.c~cdb7deb5cf6f27c2@1.6.1.1 +0 -0 Delete: sntp/libopts/numeric.c BitKeeper/deleted/.del-options.h@1.10.1.1 +0 -0 Delete: libopts/autoopts/options.h BitKeeper/deleted/.del-options.h~6eb465cb95a56bee@1.7.1.1 +0 -0 Delete: sntp/libopts/autoopts/options.h BitKeeper/deleted/.del-pathfind.c@1.9.1.1 +0 -0 Delete: libopts/compat/pathfind.c BitKeeper/deleted/.del-pathfind.c~a0863179d884d4a4@1.6.1.1 +0 -0 Delete: sntp/libopts/compat/pathfind.c BitKeeper/deleted/.del-pgusage.c@1.9.1.1 +0 -0 Delete: libopts/pgusage.c BitKeeper/deleted/.del-pgusage.c~d981c42eb301cfdd@1.5.1.1 +0 -0 Delete: sntp/libopts/pgusage.c BitKeeper/deleted/.del-proto.h@1.11.1.1 +0 -0 Delete: libopts/proto.h BitKeeper/deleted/.del-proto.h~fa076f6dd9d0667e@1.8.1.1 +0 -0 Delete: sntp/libopts/proto.h BitKeeper/deleted/.del-putshell.c@1.10.1.1 +0 -0 Delete: libopts/putshell.c BitKeeper/deleted/.del-putshell.c~24959f5e1ba688e6@1.7.1.1 +0 -0 Delete: sntp/libopts/putshell.c BitKeeper/deleted/.del-restore.c@1.9.1.1 +0 -0 Delete: libopts/restore.c BitKeeper/deleted/.del-restore.c~eada4acbf21cd8bf@1.5.1.1 +0 -0 Delete: sntp/libopts/restore.c BitKeeper/deleted/.del-save.c@1.10.1.1 +0 -0 Delete: libopts/save.c BitKeeper/deleted/.del-save.c~a29f5bd429a568bb@1.7.1.1 +0 -0 Delete: sntp/libopts/save.c BitKeeper/deleted/.del-snprintf.c@1.4.1.1 +0 -0 Delete: libopts/compat/snprintf.c BitKeeper/deleted/.del-snprintf.c~66578c716014cd3d@1.3.1.1 +0 -0 Delete: sntp/libopts/compat/snprintf.c BitKeeper/deleted/.del-sort.c@1.8.1.1 +0 -0 Delete: libopts/sort.c BitKeeper/deleted/.del-sort.c~bec5a7fb6a01a5dc@1.4.1.1 +0 -0 Delete: sntp/libopts/sort.c BitKeeper/deleted/.del-stack.c@1.10.1.1 +0 -0 Delete: libopts/stack.c BitKeeper/deleted/.del-stack.c~e817b57b18b315c1@1.7.1.1 +0 -0 Delete: sntp/libopts/stack.c BitKeeper/deleted/.del-strchr.c@1.3.1.1 +0 -0 Delete: libopts/compat/strchr.c BitKeeper/deleted/.del-strchr.c~80e88afbe7e2209a@1.3.1.1 +0 -0 Delete: sntp/libopts/compat/strchr.c BitKeeper/deleted/.del-strdup.c@1.3.1.1 +0 -0 Delete: libopts/compat/strdup.c BitKeeper/deleted/.del-strdup.c~1f262be5e55c3c4a@1.2.1.1 +0 -0 Delete: sntp/libopts/compat/strdup.c BitKeeper/deleted/.del-streqvcmp.c@1.9.1.1 +0 -0 Delete: libopts/streqvcmp.c BitKeeper/deleted/.del-streqvcmp.c~66420c6082b06827@1.6.1.1 +0 -0 Delete: sntp/libopts/streqvcmp.c BitKeeper/deleted/.del-text_mmap.c@1.8.1.1 +0 -0 Delete: libopts/text_mmap.c BitKeeper/deleted/.del-text_mmap.c~f1915a52b87816ba@1.5.1.1 +0 -0 Delete: sntp/libopts/text_mmap.c BitKeeper/deleted/.del-tokenize.c@1.5.1.1 +0 -0 Delete: libopts/tokenize.c BitKeeper/deleted/.del-tokenize.c~ae2f23dbb2bee589@1.4.1.1 +0 -0 Delete: sntp/libopts/tokenize.c BitKeeper/deleted/.del-usage-txt.h@1.9.1.1 +0 -0 Delete: libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage-txt.h~6ce4dce87430d1b@1.6.1.1 +0 -0 Delete: sntp/libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage.c@1.9.1.1 +0 -0 Delete: libopts/usage.c BitKeeper/deleted/.del-usage.c~c868ef1e661a6eb1@1.7.1.1 +0 -0 Delete: sntp/libopts/usage.c BitKeeper/deleted/.del-version.c@1.9.1.1 +0 -0 Delete: libopts/version.c BitKeeper/deleted/.del-version.c~a426e6b58b20d06@1.6.1.1 +0 -0 Delete: sntp/libopts/version.c BitKeeper/deleted/.del-windows-config.h@1.5.1.1 +0 -0 Delete: libopts/compat/windows-config.h BitKeeper/deleted/.del-windows-config.h~36f7ad2ccf764ad2@1.3.1.1 +0 -0 Delete: sntp/libopts/compat/windows-config.h libopts/COPYING.lgpl@1.1 +502 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/COPYING.lgpl libopts/COPYING.lgpl@1.0 +0 -0 libopts/COPYING.mbsd@1.1 +26 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/COPYING.mbsd libopts/COPYING.mbsd@1.0 +0 -0 libopts/MakeDefs.inc@1.1 +0 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/MakeDefs.inc libopts/MakeDefs.inc@1.0 +0 -0 libopts/Makefile.am@1.1 +24 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/Makefile.am libopts/Makefile.am@1.0 +0 -0 libopts/README@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/README libopts/README@1.0 +0 -0 libopts/autoopts.c@1.1 +1101 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/autoopts.c libopts/autoopts.c@1.0 +0 -0 libopts/autoopts.h@1.1 +377 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/autoopts.h libopts/autoopts.h@1.0 +0 -0 libopts/autoopts/options.h@1.1 +964 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/autoopts/options.h libopts/autoopts/options.h@1.0 +0 -0 libopts/autoopts/usage-txt.h@1.1 +355 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/autoopts/usage-txt.h libopts/autoopts/usage-txt.h@1.0 +0 -0 libopts/boolean.c@1.1 +106 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/boolean.c libopts/boolean.c@1.0 +0 -0 libopts/compat/compat.h@1.1 +314 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/compat/compat.h libopts/compat/compat.h@1.0 +0 -0 libopts/compat/pathfind.c@1.1 +339 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/compat/pathfind.c libopts/compat/pathfind.c@1.0 +0 -0 libopts/compat/snprintf.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/compat/snprintf.c libopts/compat/snprintf.c@1.0 +0 -0 libopts/compat/strchr.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/compat/strchr.c libopts/compat/strchr.c@1.0 +0 -0 libopts/compat/strdup.c@1.1 +19 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/compat/strdup.c libopts/compat/strdup.c@1.0 +0 -0 libopts/compat/windows-config.h@1.1 +129 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/compat/windows-config.h libopts/compat/windows-config.h@1.0 +0 -0 libopts/configfile.c@1.1 +1288 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/configfile.c libopts/configfile.c@1.0 +0 -0 libopts/cook.c@1.1 +354 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/cook.c libopts/cook.c@1.0 +0 -0 libopts/enumeration.c@1.1 +498 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/enumeration.c libopts/enumeration.c@1.0 +0 -0 libopts/environment.c@1.1 +260 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/environment.c libopts/environment.c@1.0 +0 -0 libopts/genshell.c@1.1 +345 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/genshell.c libopts/genshell.c@1.0 +0 -0 libopts/genshell.h@1.1 +149 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/genshell.h libopts/genshell.h@1.0 +0 -0 libopts/libopts.c@1.1 +30 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/libopts.c libopts/libopts.c@1.0 +0 -0 libopts/load.c@1.1 +563 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/load.c libopts/load.c@1.0 +0 -0 libopts/m4/libopts.m4@1.1 +489 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/m4/libopts.m4 libopts/m4/libopts.m4@1.0 +0 -0 libopts/m4/liboptschk.m4@1.1 +42 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/m4/liboptschk.m4 libopts/m4/liboptschk.m4@1.0 +0 -0 libopts/makeshell.c@1.1 +1122 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/makeshell.c libopts/makeshell.c@1.0 +0 -0 libopts/nested.c@1.1 +733 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/nested.c libopts/nested.c@1.0 +0 -0 libopts/numeric.c@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/numeric.c libopts/numeric.c@1.0 +0 -0 libopts/pgusage.c@1.1 +157 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/pgusage.c libopts/pgusage.c@1.0 +0 -0 libopts/proto.h@1.1 +91 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/proto.h libopts/proto.h@1.0 +0 -0 libopts/putshell.c@1.1 +335 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/putshell.c libopts/putshell.c@1.0 +0 -0 libopts/restore.c@1.1 +250 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/restore.c libopts/restore.c@1.0 +0 -0 libopts/save.c@1.1 +512 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/save.c libopts/save.c@1.0 +0 -0 libopts/sort.c@1.1 +359 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/sort.c libopts/sort.c@1.0 +0 -0 libopts/stack.c@1.1 +269 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/stack.c libopts/stack.c@1.0 +0 -0 libopts/streqvcmp.c@1.1 +289 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/streqvcmp.c libopts/streqvcmp.c@1.0 +0 -0 libopts/text_mmap.c@1.1 +363 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/text_mmap.c libopts/text_mmap.c@1.0 +0 -0 libopts/tokenize.c@1.1 +321 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/tokenize.c libopts/tokenize.c@1.0 +0 -0 libopts/usage.c@1.1 +731 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/usage.c libopts/usage.c@1.0 +0 -0 libopts/version.c@1.1 +176 -0 BitKeeper file /deacon/backroom/ntp-stable/libopts/version.c libopts/version.c@1.0 +0 -0 sntp/libopts/COPYING.lgpl@1.1 +502 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/COPYING.lgpl sntp/libopts/COPYING.lgpl@1.0 +0 -0 sntp/libopts/COPYING.mbsd@1.1 +26 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/COPYING.mbsd sntp/libopts/COPYING.mbsd@1.0 +0 -0 sntp/libopts/MakeDefs.inc@1.1 +0 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/MakeDefs.inc sntp/libopts/MakeDefs.inc@1.0 +0 -0 sntp/libopts/Makefile.am@1.1 +24 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/Makefile.am sntp/libopts/Makefile.am@1.0 +0 -0 sntp/libopts/README@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/README sntp/libopts/README@1.0 +0 -0 sntp/libopts/autoopts.c@1.1 +1101 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/autoopts.c sntp/libopts/autoopts.c@1.0 +0 -0 sntp/libopts/autoopts.h@1.1 +377 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/autoopts.h sntp/libopts/autoopts.h@1.0 +0 -0 sntp/libopts/autoopts/options.h@1.1 +964 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/autoopts/options.h sntp/libopts/autoopts/options.h@1.0 +0 -0 sntp/libopts/autoopts/usage-txt.h@1.1 +355 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/autoopts/usage-txt.h sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0 sntp/libopts/boolean.c@1.1 +106 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/boolean.c sntp/libopts/boolean.c@1.0 +0 -0 sntp/libopts/compat/compat.h@1.1 +314 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/compat/compat.h sntp/libopts/compat/compat.h@1.0 +0 -0 sntp/libopts/compat/pathfind.c@1.1 +339 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/compat/pathfind.c sntp/libopts/compat/pathfind.c@1.0 +0 -0 sntp/libopts/compat/snprintf.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/compat/snprintf.c sntp/libopts/compat/snprintf.c@1.0 +0 -0 sntp/libopts/compat/strchr.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/compat/strchr.c sntp/libopts/compat/strchr.c@1.0 +0 -0 sntp/libopts/compat/strdup.c@1.1 +19 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/compat/strdup.c sntp/libopts/compat/strdup.c@1.0 +0 -0 sntp/libopts/compat/windows-config.h@1.1 +129 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/compat/windows-config.h sntp/libopts/compat/windows-config.h@1.0 +0 -0 sntp/libopts/configfile.c@1.1 +1288 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/configfile.c sntp/libopts/configfile.c@1.0 +0 -0 sntp/libopts/cook.c@1.1 +354 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/cook.c sntp/libopts/cook.c@1.0 +0 -0 sntp/libopts/enumeration.c@1.1 +498 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/enumeration.c sntp/libopts/enumeration.c@1.0 +0 -0 sntp/libopts/environment.c@1.1 +260 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/environment.c sntp/libopts/environment.c@1.0 +0 -0 sntp/libopts/genshell.c@1.1 +345 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/genshell.c sntp/libopts/genshell.c@1.0 +0 -0 sntp/libopts/genshell.h@1.1 +149 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/genshell.h sntp/libopts/genshell.h@1.0 +0 -0 sntp/libopts/libopts.c@1.1 +30 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/libopts.c sntp/libopts/libopts.c@1.0 +0 -0 sntp/libopts/load.c@1.1 +563 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/load.c sntp/libopts/load.c@1.0 +0 -0 sntp/libopts/m4/libopts.m4@1.1 +489 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/m4/libopts.m4 sntp/libopts/m4/libopts.m4@1.0 +0 -0 sntp/libopts/m4/liboptschk.m4@1.1 +42 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/m4/liboptschk.m4 sntp/libopts/m4/liboptschk.m4@1.0 +0 -0 sntp/libopts/makeshell.c@1.1 +1122 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/makeshell.c sntp/libopts/makeshell.c@1.0 +0 -0 sntp/libopts/nested.c@1.1 +733 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/nested.c sntp/libopts/nested.c@1.0 +0 -0 sntp/libopts/numeric.c@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/numeric.c sntp/libopts/numeric.c@1.0 +0 -0 sntp/libopts/pgusage.c@1.1 +157 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/pgusage.c sntp/libopts/pgusage.c@1.0 +0 -0 sntp/libopts/proto.h@1.1 +91 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/proto.h sntp/libopts/proto.h@1.0 +0 -0 sntp/libopts/putshell.c@1.1 +335 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/putshell.c sntp/libopts/putshell.c@1.0 +0 -0 sntp/libopts/restore.c@1.1 +250 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/restore.c sntp/libopts/restore.c@1.0 +0 -0 sntp/libopts/save.c@1.1 +512 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/save.c sntp/libopts/save.c@1.0 +0 -0 sntp/libopts/sort.c@1.1 +359 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/sort.c sntp/libopts/sort.c@1.0 +0 -0 sntp/libopts/stack.c@1.1 +269 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/stack.c sntp/libopts/stack.c@1.0 +0 -0 sntp/libopts/streqvcmp.c@1.1 +289 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/streqvcmp.c sntp/libopts/streqvcmp.c@1.0 +0 -0 sntp/libopts/text_mmap.c@1.1 +363 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/text_mmap.c sntp/libopts/text_mmap.c@1.0 +0 -0 sntp/libopts/tokenize.c@1.1 +321 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/tokenize.c sntp/libopts/tokenize.c@1.0 +0 -0 sntp/libopts/usage.c@1.1 +731 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/usage.c sntp/libopts/usage.c@1.0 +0 -0 sntp/libopts/version.c@1.1 +176 -0 BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/version.c sntp/libopts/version.c@1.0 +0 -0 ChangeSet@1.1440.1.79, 2007-04-13 07:42:22-04:00, stenn@whimsy.udel.edu NTP_4_2_5P22 TAG: NTP_4_2_5P22 ntpd/ntpd-opts.c@1.9 +2 -2 NTP_4_2_5P22 ntpd/ntpd-opts.h@1.9 +3 -3 NTP_4_2_5P22 ntpd/ntpd-opts.texi@1.8 +1 -1 NTP_4_2_5P22 ntpd/ntpd.1@1.8 +2 -2 NTP_4_2_5P22 ntpd/ntpdsim-opts.c@1.9 +2 -2 NTP_4_2_5P22 ntpd/ntpdsim-opts.h@1.9 +3 -3 NTP_4_2_5P22 ntpd/ntpdsim-opts.texi@1.8 +1 -1 NTP_4_2_5P22 ntpd/ntpdsim.1@1.8 +2 -2 NTP_4_2_5P22 ntpdc/ntpdc-opts.c@1.9 +2 -2 NTP_4_2_5P22 ntpdc/ntpdc-opts.h@1.9 +3 -3 NTP_4_2_5P22 ntpdc/ntpdc-opts.texi@1.8 +1 -1 NTP_4_2_5P22 ntpdc/ntpdc.1@1.8 +2 -2 NTP_4_2_5P22 ntpq/ntpq-opts.c@1.9 +2 -2 NTP_4_2_5P22 ntpq/ntpq-opts.h@1.9 +3 -3 NTP_4_2_5P22 ntpq/ntpq-opts.texi@1.8 +1 -1 NTP_4_2_5P22 ntpq/ntpq.1@1.8 +2 -2 NTP_4_2_5P22 packageinfo.sh@1.25 +1 -1 NTP_4_2_5P22 sntp/sntp-opts.c@1.9 +2 -2 NTP_4_2_5P22 sntp/sntp-opts.h@1.9 +3 -3 NTP_4_2_5P22 sntp/sntp-opts.texi@1.8 +1 -1 NTP_4_2_5P22 sntp/sntp.1@1.8 +2 -2 NTP_4_2_5P22 util/ntp-keygen-opts.c@1.10 +2 -2 NTP_4_2_5P22 util/ntp-keygen-opts.h@1.10 +3 -3 NTP_4_2_5P22 util/ntp-keygen-opts.texi@1.9 +2 -2 NTP_4_2_5P22 util/ntp-keygen.1@1.9 +2 -2 NTP_4_2_5P22 ChangeSet@1.1440.1.78, 2007-04-13 03:57:20-04:00, stenn@whimsy.udel.edu refclock_wwv.c fixes from Dave Mills ChangeLog@1.26 +1 -0 refclock_wwv.c fixes from Dave Mills ntpd/refclock_wwv.c@1.71 +9 -7 refclock_wwv.c fixes from Dave Mills ChangeSet@1.1440.1.77, 2007-04-13 02:10:55-04:00, stenn@whimsy.udel.edu [Bug 810] Fix ntp-keygen documentation ChangeLog@1.25 +1 -0 [Bug 810] Fix ntp-keygen documentation util/ntp-keygen-opts.c@1.9 +1 -1 [Bug 810] Fix ntp-keygen documentation util/ntp-keygen-opts.def@1.7 +37 -20 [Bug 810] Fix ntp-keygen documentation util/ntp-keygen-opts.h@1.9 +1 -1 [Bug 810] Fix ntp-keygen documentation util/ntp-keygen-opts.texi@1.8 +39 -19 [Bug 810] Fix ntp-keygen documentation util/ntp-keygen.1@1.8 +39 -19 [Bug 810] Fix ntp-keygen documentation ChangeSet@1.1440.1.76, 2007-04-12 08:20:16-04:00, stenn@whimsy.udel.edu NTP_4_2_5P21 TAG: NTP_4_2_5P21 ntpd/ntpd-opts.c@1.8 +4 -4 NTP_4_2_5P21 ntpd/ntpd-opts.h@1.8 +3 -3 NTP_4_2_5P21 ntpd/ntpd-opts.texi@1.7 +2 -2 NTP_4_2_5P21 ntpd/ntpd.1@1.7 +2 -2 NTP_4_2_5P21 ntpd/ntpdsim-opts.c@1.8 +4 -4 NTP_4_2_5P21 ntpd/ntpdsim-opts.h@1.8 +3 -3 NTP_4_2_5P21 ntpd/ntpdsim-opts.texi@1.7 +1 -1 NTP_4_2_5P21 ntpd/ntpdsim.1@1.7 +2 -2 NTP_4_2_5P21 ntpdc/ntpdc-opts.c@1.8 +4 -4 NTP_4_2_5P21 ntpdc/ntpdc-opts.h@1.8 +3 -3 NTP_4_2_5P21 ntpdc/ntpdc-opts.texi@1.7 +2 -2 NTP_4_2_5P21 ntpdc/ntpdc.1@1.7 +2 -2 NTP_4_2_5P21 ntpq/ntpq-opts.c@1.8 +4 -4 NTP_4_2_5P21 ntpq/ntpq-opts.h@1.8 +3 -3 NTP_4_2_5P21 ntpq/ntpq-opts.texi@1.7 +2 -2 NTP_4_2_5P21 ntpq/ntpq.1@1.7 +2 -2 NTP_4_2_5P21 packageinfo.sh@1.24 +1 -1 NTP_4_2_5P21 sntp/sntp-opts.c@1.8 +2 -2 NTP_4_2_5P21 sntp/sntp-opts.h@1.8 +3 -3 NTP_4_2_5P21 sntp/sntp-opts.texi@1.7 +1 -1 NTP_4_2_5P21 sntp/sntp.1@1.7 +2 -2 NTP_4_2_5P21 util/ntp-keygen-opts.c@1.8 +4 -4 NTP_4_2_5P21 util/ntp-keygen-opts.h@1.8 +3 -3 NTP_4_2_5P21 util/ntp-keygen-opts.texi@1.7 +2 -2 NTP_4_2_5P21 util/ntp-keygen.1@1.7 +2 -2 NTP_4_2_5P21 ChangeSet@1.1436.1.37, 2007-04-12 06:32:19-04:00, stenn@whimsy.udel.edu Added ntp2 mirror BitKeeper/triggers/2mirrors@1.4 +1 -0 Added ntp2 mirror ChangeSet@1.1440.1.74, 2007-04-12 05:47:01-04:00, stenn@whimsy.udel.edu autogen upgrade BitKeeper/deleted/.del-COPYING.lgpl@1.3 +0 -0 Delete: libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.lgpl~54a90ba0899593cb@1.2 +0 -0 Delete: sntp/libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.mbsd@1.2 +0 -0 Delete: libopts/COPYING.mbsd BitKeeper/deleted/.del-COPYING.mbsd~9b1945bb2136c70b@1.2 +0 -0 Delete: sntp/libopts/COPYING.mbsd BitKeeper/deleted/.del-MakeDefs.inc@1.2 +0 -0 Delete: libopts/MakeDefs.inc BitKeeper/deleted/.del-MakeDefs.inc~2b8fdfc9df6d652d@1.2 +0 -0 Delete: sntp/libopts/MakeDefs.inc BitKeeper/deleted/.del-Makefile.am@1.7 +0 -0 Delete: libopts/Makefile.am BitKeeper/deleted/.del-Makefile.am~fa9bd87b6045015c@1.5 +0 -0 Delete: sntp/libopts/Makefile.am BitKeeper/deleted/.del-README@1.2 +0 -0 Delete: libopts/README BitKeeper/deleted/.del-README~1ae087758ee867d4@1.2 +0 -0 Delete: sntp/libopts/README BitKeeper/deleted/.del-autoopts.c@1.11 +0 -0 Delete: libopts/autoopts.c BitKeeper/deleted/.del-autoopts.c~5b417341bc85d7a8@1.8 +0 -0 Delete: sntp/libopts/autoopts.c BitKeeper/deleted/.del-autoopts.h@1.10 +0 -0 Delete: libopts/autoopts.h BitKeeper/deleted/.del-autoopts.h~8cdce21b181a1a01@1.8 +0 -0 Delete: sntp/libopts/autoopts.h BitKeeper/deleted/.del-boolean.c@1.9 +0 -0 Delete: libopts/boolean.c BitKeeper/deleted/.del-boolean.c~a5d10c8997e6a2e2@1.6 +0 -0 Delete: sntp/libopts/boolean.c BitKeeper/deleted/.del-compat.h@1.13 +0 -0 Delete: libopts/compat/compat.h BitKeeper/deleted/.del-compat.h~9682d0ac273ae32@1.9 +0 -0 Delete: sntp/libopts/compat/compat.h BitKeeper/deleted/.del-configfile.c@1.11 +0 -0 Delete: libopts/configfile.c BitKeeper/deleted/.del-configfile.c~8194f784686fa804@1.8 +0 -0 Delete: sntp/libopts/configfile.c BitKeeper/deleted/.del-cook.c@1.10 +0 -0 Delete: libopts/cook.c BitKeeper/deleted/.del-cook.c~e48d079a438432dc@1.7 +0 -0 Delete: sntp/libopts/cook.c BitKeeper/deleted/.del-enumeration.c@1.10 +0 -0 Delete: libopts/enumeration.c BitKeeper/deleted/.del-enumeration.c~5f4e6af2706370ae@1.7 +0 -0 Delete: sntp/libopts/enumeration.c BitKeeper/deleted/.del-environment.c@1.9 +0 -0 Delete: libopts/environment.c BitKeeper/deleted/.del-environment.c~2bae2966695067c2@1.6 +0 -0 Delete: sntp/libopts/environment.c BitKeeper/deleted/.del-genshell.c@1.10 +0 -0 Delete: libopts/genshell.c BitKeeper/deleted/.del-genshell.c~1fd152b2b52bdab@1.7 +0 -0 Delete: sntp/libopts/genshell.c BitKeeper/deleted/.del-genshell.h@1.10 +0 -0 Delete: libopts/genshell.h BitKeeper/deleted/.del-genshell.h~375f0fa5b925f454@1.7 +0 -0 Delete: sntp/libopts/genshell.h BitKeeper/deleted/.del-libopts.c@1.4 +0 -0 Delete: libopts/libopts.c BitKeeper/deleted/.del-libopts.c~58b8fbed850e6d5e@1.4 +0 -0 Delete: sntp/libopts/libopts.c BitKeeper/deleted/.del-libopts.m4@1.15 +0 -0 Delete: libopts/m4/libopts.m4 BitKeeper/deleted/.del-libopts.m4~9e0f33f57d3a0a9@1.12 +0 -0 Delete: sntp/libopts/m4/libopts.m4 BitKeeper/deleted/.del-liboptschk.m4@1.4 +0 -0 Delete: libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-liboptschk.m4~bbeebebe76865058@1.4 +0 -0 Delete: sntp/libopts/m4/liboptschk.m4 BitKeeper/deleted/.del-libtool.m4@1.2 +0 -0 Delete: libopts/m4/libtool.m4 BitKeeper/deleted/.del-libtool.m4~db8acbd0fb34597f@1.2 +0 -0 Delete: sntp/libopts/m4/libtool.m4 BitKeeper/deleted/.del-load.c@1.11 +0 -0 Delete: libopts/load.c BitKeeper/deleted/.del-load.c~59960aa12bb95bf7@1.8 +0 -0 Delete: sntp/libopts/load.c BitKeeper/deleted/.del-makeshell.c@1.12 +0 -0 Delete: libopts/makeshell.c BitKeeper/deleted/.del-makeshell.c~4fcd12fc31c0a4a4@1.9 +0 -0 Delete: sntp/libopts/makeshell.c BitKeeper/deleted/.del-nested.c@1.10 +0 -0 Delete: libopts/nested.c BitKeeper/deleted/.del-nested.c~85346d5d12098689@1.7 +0 -0 Delete: sntp/libopts/nested.c BitKeeper/deleted/.del-numeric.c@1.10 +0 -0 Delete: libopts/numeric.c BitKeeper/deleted/.del-numeric.c~cdb7deb5cf6f27c2@1.7 +0 -0 Delete: sntp/libopts/numeric.c BitKeeper/deleted/.del-options.h@1.11 +0 -0 Delete: libopts/autoopts/options.h BitKeeper/deleted/.del-options.h~6eb465cb95a56bee@1.8 +0 -0 Delete: sntp/libopts/autoopts/options.h BitKeeper/deleted/.del-pathfind.c@1.10 +0 -0 Delete: libopts/compat/pathfind.c BitKeeper/deleted/.del-pathfind.c~a0863179d884d4a4@1.7 +0 -0 Delete: sntp/libopts/compat/pathfind.c BitKeeper/deleted/.del-pgusage.c@1.10 +0 -0 Delete: libopts/pgusage.c BitKeeper/deleted/.del-pgusage.c~d981c42eb301cfdd@1.6 +0 -0 Delete: sntp/libopts/pgusage.c BitKeeper/deleted/.del-proto.h@1.12 +0 -0 Delete: libopts/proto.h BitKeeper/deleted/.del-proto.h~fa076f6dd9d0667e@1.9 +0 -0 Delete: sntp/libopts/proto.h BitKeeper/deleted/.del-putshell.c@1.11 +0 -0 Delete: libopts/putshell.c BitKeeper/deleted/.del-putshell.c~24959f5e1ba688e6@1.8 +0 -0 Delete: sntp/libopts/putshell.c BitKeeper/deleted/.del-restore.c@1.10 +0 -0 Delete: libopts/restore.c BitKeeper/deleted/.del-restore.c~eada4acbf21cd8bf@1.6 +0 -0 Delete: sntp/libopts/restore.c BitKeeper/deleted/.del-save.c@1.11 +0 -0 Delete: libopts/save.c BitKeeper/deleted/.del-save.c~a29f5bd429a568bb@1.8 +0 -0 Delete: sntp/libopts/save.c BitKeeper/deleted/.del-snprintf.c@1.5 +0 -0 Delete: libopts/compat/snprintf.c BitKeeper/deleted/.del-snprintf.c~66578c716014cd3d@1.4 +0 -0 Delete: sntp/libopts/compat/snprintf.c BitKeeper/deleted/.del-sort.c@1.9 +0 -0 Delete: libopts/sort.c BitKeeper/deleted/.del-sort.c~bec5a7fb6a01a5dc@1.5 +0 -0 Delete: sntp/libopts/sort.c BitKeeper/deleted/.del-stack.c@1.11 +0 -0 Delete: libopts/stack.c BitKeeper/deleted/.del-stack.c~e817b57b18b315c1@1.8 +0 -0 Delete: sntp/libopts/stack.c BitKeeper/deleted/.del-strchr.c@1.4 +0 -0 Delete: libopts/compat/strchr.c BitKeeper/deleted/.del-strchr.c~80e88afbe7e2209a@1.4 +0 -0 Delete: sntp/libopts/compat/strchr.c BitKeeper/deleted/.del-strdup.c@1.4 +0 -0 Delete: libopts/compat/strdup.c BitKeeper/deleted/.del-strdup.c~1f262be5e55c3c4a@1.3 +0 -0 Delete: sntp/libopts/compat/strdup.c BitKeeper/deleted/.del-streqvcmp.c@1.10 +0 -0 Delete: libopts/streqvcmp.c BitKeeper/deleted/.del-streqvcmp.c~66420c6082b06827@1.7 +0 -0 Delete: sntp/libopts/streqvcmp.c BitKeeper/deleted/.del-text_mmap.c@1.9 +0 -0 Delete: libopts/text_mmap.c BitKeeper/deleted/.del-text_mmap.c~f1915a52b87816ba@1.6 +0 -0 Delete: sntp/libopts/text_mmap.c BitKeeper/deleted/.del-tokenize.c@1.6 +0 -0 Delete: libopts/tokenize.c BitKeeper/deleted/.del-tokenize.c~ae2f23dbb2bee589@1.5 +0 -0 Delete: sntp/libopts/tokenize.c BitKeeper/deleted/.del-usage-txt.h@1.10 +0 -0 Delete: libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage-txt.h~6ce4dce87430d1b@1.7 +0 -0 Delete: sntp/libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage.c@1.10 +0 -0 Delete: libopts/usage.c BitKeeper/deleted/.del-usage.c~c868ef1e661a6eb1@1.8 +0 -0 Delete: sntp/libopts/usage.c BitKeeper/deleted/.del-version.c@1.10 +0 -0 Delete: libopts/version.c BitKeeper/deleted/.del-version.c~a426e6b58b20d06@1.7 +0 -0 Delete: sntp/libopts/version.c BitKeeper/deleted/.del-windows-config.h@1.6 +0 -0 Delete: libopts/compat/windows-config.h BitKeeper/deleted/.del-windows-config.h~36f7ad2ccf764ad2@1.4 +0 -0 Delete: sntp/libopts/compat/windows-config.h clockstuff/clktest-opts.c@1.10 +8 -7 autogen upgrade clockstuff/clktest-opts.h@1.10 +8 -14 autogen upgrade libopts/COPYING.lgpl@1.1 +502 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.lgpl libopts/COPYING.lgpl@1.0 +0 -0 libopts/COPYING.mbsd@1.1 +26 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.mbsd libopts/COPYING.mbsd@1.0 +0 -0 libopts/MakeDefs.inc@1.1 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/MakeDefs.inc libopts/MakeDefs.inc@1.0 +0 -0 libopts/Makefile.am@1.1 +24 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/Makefile.am libopts/Makefile.am@1.0 +0 -0 libopts/README@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/README libopts/README@1.0 +0 -0 libopts/autoopts.c@1.1 +1101 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts.c libopts/autoopts.c@1.0 +0 -0 libopts/autoopts.h@1.1 +377 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts.h libopts/autoopts.h@1.0 +0 -0 libopts/autoopts/options.h@1.1 +964 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts/options.h libopts/autoopts/options.h@1.0 +0 -0 libopts/autoopts/usage-txt.h@1.1 +355 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts/usage-txt.h libopts/autoopts/usage-txt.h@1.0 +0 -0 libopts/boolean.c@1.1 +106 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/boolean.c libopts/boolean.c@1.0 +0 -0 libopts/compat/compat.h@1.1 +314 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/compat.h libopts/compat/compat.h@1.0 +0 -0 libopts/compat/pathfind.c@1.1 +339 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/pathfind.c libopts/compat/pathfind.c@1.0 +0 -0 libopts/compat/snprintf.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/snprintf.c libopts/compat/snprintf.c@1.0 +0 -0 libopts/compat/strchr.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strchr.c libopts/compat/strchr.c@1.0 +0 -0 libopts/compat/strdup.c@1.1 +19 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strdup.c libopts/compat/strdup.c@1.0 +0 -0 libopts/compat/windows-config.h@1.1 +129 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/windows-config.h libopts/compat/windows-config.h@1.0 +0 -0 libopts/configfile.c@1.1 +1288 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/configfile.c libopts/configfile.c@1.0 +0 -0 libopts/cook.c@1.1 +354 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/cook.c libopts/cook.c@1.0 +0 -0 libopts/enumeration.c@1.1 +498 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/enumeration.c libopts/enumeration.c@1.0 +0 -0 libopts/environment.c@1.1 +260 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/environment.c libopts/environment.c@1.0 +0 -0 libopts/genshell.c@1.1 +345 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/genshell.c libopts/genshell.c@1.0 +0 -0 libopts/genshell.h@1.1 +149 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/genshell.h libopts/genshell.h@1.0 +0 -0 libopts/libopts.c@1.1 +30 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/libopts.c libopts/libopts.c@1.0 +0 -0 libopts/load.c@1.1 +563 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/load.c libopts/load.c@1.0 +0 -0 libopts/m4/libopts.m4@1.1 +489 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/libopts.m4 libopts/m4/libopts.m4@1.0 +0 -0 libopts/m4/liboptschk.m4@1.1 +42 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/liboptschk.m4 libopts/m4/liboptschk.m4@1.0 +0 -0 libopts/makeshell.c@1.1 +1122 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/makeshell.c libopts/makeshell.c@1.0 +0 -0 libopts/nested.c@1.1 +733 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/nested.c libopts/nested.c@1.0 +0 -0 libopts/numeric.c@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/numeric.c libopts/numeric.c@1.0 +0 -0 libopts/pgusage.c@1.1 +157 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/pgusage.c libopts/pgusage.c@1.0 +0 -0 libopts/proto.h@1.1 +91 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/proto.h libopts/proto.h@1.0 +0 -0 libopts/putshell.c@1.1 +335 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/putshell.c libopts/putshell.c@1.0 +0 -0 libopts/restore.c@1.1 +250 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/restore.c libopts/restore.c@1.0 +0 -0 libopts/save.c@1.1 +512 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/save.c libopts/save.c@1.0 +0 -0 libopts/sort.c@1.1 +359 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/sort.c libopts/sort.c@1.0 +0 -0 libopts/stack.c@1.1 +269 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/stack.c libopts/stack.c@1.0 +0 -0 libopts/streqvcmp.c@1.1 +289 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/streqvcmp.c libopts/streqvcmp.c@1.0 +0 -0 libopts/text_mmap.c@1.1 +363 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/text_mmap.c libopts/text_mmap.c@1.0 +0 -0 libopts/tokenize.c@1.1 +321 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/tokenize.c libopts/tokenize.c@1.0 +0 -0 libopts/usage.c@1.1 +731 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/usage.c libopts/usage.c@1.0 +0 -0 libopts/version.c@1.1 +176 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/version.c libopts/version.c@1.0 +0 -0 ntpd/ntpd-opts.c@1.7 +9 -8 autogen upgrade ntpd/ntpd-opts.h@1.7 +6 -12 autogen upgrade ntpd/ntpdsim-opts.c@1.7 +9 -8 autogen upgrade ntpd/ntpdsim-opts.h@1.7 +6 -12 autogen upgrade ntpdc/ntpdc-opts.c@1.7 +9 -8 autogen upgrade ntpdc/ntpdc-opts.h@1.7 +6 -12 autogen upgrade ntpq/ntpq-opts.c@1.7 +9 -8 autogen upgrade ntpq/ntpq-opts.h@1.7 +6 -12 autogen upgrade sntp/libopts/COPYING.lgpl@1.1 +502 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.lgpl sntp/libopts/COPYING.lgpl@1.0 +0 -0 sntp/libopts/COPYING.mbsd@1.1 +26 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.mbsd sntp/libopts/COPYING.mbsd@1.0 +0 -0 sntp/libopts/MakeDefs.inc@1.1 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/MakeDefs.inc sntp/libopts/MakeDefs.inc@1.0 +0 -0 sntp/libopts/Makefile.am@1.1 +24 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/Makefile.am sntp/libopts/Makefile.am@1.0 +0 -0 sntp/libopts/README@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/README sntp/libopts/README@1.0 +0 -0 sntp/libopts/autoopts.c@1.1 +1101 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts.c sntp/libopts/autoopts.c@1.0 +0 -0 sntp/libopts/autoopts.h@1.1 +377 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts.h sntp/libopts/autoopts.h@1.0 +0 -0 sntp/libopts/autoopts/options.h@1.1 +964 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts/options.h sntp/libopts/autoopts/options.h@1.0 +0 -0 sntp/libopts/autoopts/usage-txt.h@1.1 +355 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts/usage-txt.h sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0 sntp/libopts/boolean.c@1.1 +106 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/boolean.c sntp/libopts/boolean.c@1.0 +0 -0 sntp/libopts/compat/compat.h@1.1 +314 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/compat.h sntp/libopts/compat/compat.h@1.0 +0 -0 sntp/libopts/compat/pathfind.c@1.1 +339 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/pathfind.c sntp/libopts/compat/pathfind.c@1.0 +0 -0 sntp/libopts/compat/snprintf.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/snprintf.c sntp/libopts/compat/snprintf.c@1.0 +0 -0 sntp/libopts/compat/strchr.c@1.1 +60 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strchr.c sntp/libopts/compat/strchr.c@1.0 +0 -0 sntp/libopts/compat/strdup.c@1.1 +19 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strdup.c sntp/libopts/compat/strdup.c@1.0 +0 -0 sntp/libopts/compat/windows-config.h@1.1 +129 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/windows-config.h sntp/libopts/compat/windows-config.h@1.0 +0 -0 sntp/libopts/configfile.c@1.1 +1288 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/configfile.c sntp/libopts/configfile.c@1.0 +0 -0 sntp/libopts/cook.c@1.1 +354 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/cook.c sntp/libopts/cook.c@1.0 +0 -0 sntp/libopts/enumeration.c@1.1 +498 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/enumeration.c sntp/libopts/enumeration.c@1.0 +0 -0 sntp/libopts/environment.c@1.1 +260 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/environment.c sntp/libopts/environment.c@1.0 +0 -0 sntp/libopts/genshell.c@1.1 +345 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/genshell.c sntp/libopts/genshell.c@1.0 +0 -0 sntp/libopts/genshell.h@1.1 +149 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/genshell.h sntp/libopts/genshell.h@1.0 +0 -0 sntp/libopts/libopts.c@1.1 +30 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/libopts.c sntp/libopts/libopts.c@1.0 +0 -0 sntp/libopts/load.c@1.1 +563 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/load.c sntp/libopts/load.c@1.0 +0 -0 sntp/libopts/m4/libopts.m4@1.1 +489 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/libopts.m4 sntp/libopts/m4/libopts.m4@1.0 +0 -0 sntp/libopts/m4/liboptschk.m4@1.1 +42 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/liboptschk.m4 sntp/libopts/m4/liboptschk.m4@1.0 +0 -0 sntp/libopts/makeshell.c@1.1 +1122 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/makeshell.c sntp/libopts/makeshell.c@1.0 +0 -0 sntp/libopts/nested.c@1.1 +733 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/nested.c sntp/libopts/nested.c@1.0 +0 -0 sntp/libopts/numeric.c@1.1 +93 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/numeric.c sntp/libopts/numeric.c@1.0 +0 -0 sntp/libopts/pgusage.c@1.1 +157 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/pgusage.c sntp/libopts/pgusage.c@1.0 +0 -0 sntp/libopts/proto.h@1.1 +91 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/proto.h sntp/libopts/proto.h@1.0 +0 -0 sntp/libopts/putshell.c@1.1 +335 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/putshell.c sntp/libopts/putshell.c@1.0 +0 -0 sntp/libopts/restore.c@1.1 +250 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/restore.c sntp/libopts/restore.c@1.0 +0 -0 sntp/libopts/save.c@1.1 +512 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/save.c sntp/libopts/save.c@1.0 +0 -0 sntp/libopts/sort.c@1.1 +359 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/sort.c sntp/libopts/sort.c@1.0 +0 -0 sntp/libopts/stack.c@1.1 +269 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/stack.c sntp/libopts/stack.c@1.0 +0 -0 sntp/libopts/streqvcmp.c@1.1 +289 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/streqvcmp.c sntp/libopts/streqvcmp.c@1.0 +0 -0 sntp/libopts/text_mmap.c@1.1 +363 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/text_mmap.c sntp/libopts/text_mmap.c@1.0 +0 -0 sntp/libopts/tokenize.c@1.1 +321 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/tokenize.c sntp/libopts/tokenize.c@1.0 +0 -0 sntp/libopts/usage.c@1.1 +731 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/usage.c sntp/libopts/usage.c@1.0 +0 -0 sntp/libopts/version.c@1.1 +176 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/version.c sntp/libopts/version.c@1.0 +0 -0 sntp/sntp-opts.c@1.7 +7 -6 autogen upgrade sntp/sntp-opts.h@1.7 +6 -12 autogen upgrade util/ntp-keygen-opts.c@1.7 +9 -8 autogen upgrade util/ntp-keygen-opts.h@1.7 +6 -12 autogen upgrade ChangeSet@1.1440.1.73, 2007-03-26 06:42:22-05:00, stenn@whimsy.udel.edu NTP_4_2_5P20 TAG: NTP_4_2_5P20 ntpd/ntpd-opts.c@1.6 +2 -2 NTP_4_2_5P20 ntpd/ntpd-opts.h@1.6 +3 -3 NTP_4_2_5P20 ntpd/ntpd-opts.texi@1.6 +1 -1 NTP_4_2_5P20 ntpd/ntpd.1@1.6 +2 -2 NTP_4_2_5P20 ntpd/ntpdsim-opts.c@1.6 +2 -2 NTP_4_2_5P20 ntpd/ntpdsim-opts.h@1.6 +3 -3 NTP_4_2_5P20 ntpd/ntpdsim-opts.texi@1.6 +1 -1 NTP_4_2_5P20 ntpd/ntpdsim.1@1.6 +2 -2 NTP_4_2_5P20 ntpdc/ntpdc-opts.c@1.6 +2 -2 NTP_4_2_5P20 ntpdc/ntpdc-opts.h@1.6 +3 -3 NTP_4_2_5P20 ntpdc/ntpdc-opts.texi@1.6 +1 -1 NTP_4_2_5P20 ntpdc/ntpdc.1@1.6 +2 -2 NTP_4_2_5P20 ntpq/ntpq-opts.c@1.6 +2 -2 NTP_4_2_5P20 ntpq/ntpq-opts.h@1.6 +3 -3 NTP_4_2_5P20 ntpq/ntpq-opts.texi@1.6 +1 -1 NTP_4_2_5P20 ntpq/ntpq.1@1.6 +2 -2 NTP_4_2_5P20 packageinfo.sh@1.23 +1 -1 NTP_4_2_5P20 sntp/sntp-opts.c@1.6 +2 -2 NTP_4_2_5P20 sntp/sntp-opts.h@1.6 +3 -3 NTP_4_2_5P20 sntp/sntp-opts.texi@1.6 +1 -1 NTP_4_2_5P20 sntp/sntp.1@1.6 +2 -2 NTP_4_2_5P20 util/ntp-keygen-opts.c@1.6 +2 -2 NTP_4_2_5P20 util/ntp-keygen-opts.h@1.6 +3 -3 NTP_4_2_5P20 util/ntp-keygen-opts.texi@1.6 +1 -1 NTP_4_2_5P20 util/ntp-keygen.1@1.6 +2 -2 NTP_4_2_5P20 ChangeSet@1.1440.4.6, 2007-03-25 21:27:11+00:00, kardel@pogo.udel.edu ChangeLog: document fix for [Bug 789] ChangeLog@1.22.1.1 +2 -1 document fix for [Bug 789] ChangeSet@1.1440.1.71, 2007-03-25 16:56:03-04:00, stenn@pogo.udel.edu [Bug 787] Bug fixes for 64-bit time_t on Windows ChangeLog@1.23 +1 -0 [Bug 787] Bug fixes for 64-bit time_t on Windows ChangeSet@1.1440.4.5, 2007-03-25 20:07:31+00:00, kardel@pogo.udel.edu ntp_peer.c: [Bug 789] avoid broadcast/multicast client associations getting confused when multicast packets arrive during the autokey/delay dance ntpd/ntp_peer.c@1.101 +15 -3 [Bug 789] avoid peers getting confused when multicast packets arrive during the autokey/delay dance ChangeSet@1.1440.4.4, 2007-03-20 06:42:12-05:00, stenn@whimsy.udel.edu NTP_4_2_5P19 TAG: NTP_4_2_5P19 ntpd/ntpd-opts.c@1.5 +2 -2 NTP_4_2_5P19 ntpd/ntpd-opts.h@1.5 +3 -3 NTP_4_2_5P19 ntpd/ntpd-opts.texi@1.5 +1 -1 NTP_4_2_5P19 ntpd/ntpd.1@1.5 +2 -2 NTP_4_2_5P19 ntpd/ntpdsim-opts.c@1.5 +2 -2 NTP_4_2_5P19 ntpd/ntpdsim-opts.h@1.5 +3 -3 NTP_4_2_5P19 ntpd/ntpdsim-opts.texi@1.5 +1 -1 NTP_4_2_5P19 ntpd/ntpdsim.1@1.5 +2 -2 NTP_4_2_5P19 ntpdc/ntpdc-opts.c@1.5 +2 -2 NTP_4_2_5P19 ntpdc/ntpdc-opts.h@1.5 +3 -3 NTP_4_2_5P19 ntpdc/ntpdc-opts.texi@1.5 +1 -1 NTP_4_2_5P19 ntpdc/ntpdc.1@1.5 +2 -2 NTP_4_2_5P19 ntpq/ntpq-opts.c@1.5 +2 -2 NTP_4_2_5P19 ntpq/ntpq-opts.h@1.5 +3 -3 NTP_4_2_5P19 ntpq/ntpq-opts.texi@1.5 +1 -1 NTP_4_2_5P19 ntpq/ntpq.1@1.5 +2 -2 NTP_4_2_5P19 packageinfo.sh@1.22 +1 -1 NTP_4_2_5P19 sntp/sntp-opts.c@1.5 +2 -2 NTP_4_2_5P19 sntp/sntp-opts.h@1.5 +3 -3 NTP_4_2_5P19 sntp/sntp-opts.texi@1.5 +1 -1 NTP_4_2_5P19 sntp/sntp.1@1.5 +2 -2 NTP_4_2_5P19 util/ntp-keygen-opts.c@1.5 +2 -2 NTP_4_2_5P19 util/ntp-keygen-opts.h@1.5 +3 -3 NTP_4_2_5P19 util/ntp-keygen-opts.texi@1.5 +1 -1 NTP_4_2_5P19 util/ntp-keygen.1@1.5 +2 -2 NTP_4_2_5P19 ChangeSet@1.1440.4.3, 2007-03-20 02:19:52-05:00, stenn@whimsy.udel.edu Clean up some \\n's on error messages ntpd/ntpd.c@1.83.1.2 +2 -2 Clean up some \\n's on error messages ChangeSet@1.1440.4.2, 2007-03-20 01:00:23-05:00, stenn@whimsy.udel.edu [Bug 796] Clean up duplicate #defines in ntp_control.c ChangeLog@1.22 +1 -0 [Bug 796] Clean up duplicate #defines in ntp_control.c ntpd/ntp_control.c@1.89.1.1 +4 -9 [Bug 796] Clean up duplicate #defines in ntp_control.c ChangeSet@1.1440.4.1, 2007-03-18 06:47:40-05:00, stenn@whimsy.udel.edu NTP_4_2_5P18 TAG: NTP_4_2_5P18 ntpd/ntpd-opts.c@1.4 +2 -2 NTP_4_2_5P18 ntpd/ntpd-opts.h@1.4 +3 -3 NTP_4_2_5P18 ntpd/ntpd-opts.texi@1.4 +1 -1 NTP_4_2_5P18 ntpd/ntpd.1@1.4 +2 -2 NTP_4_2_5P18 ntpd/ntpdsim-opts.c@1.4 +2 -2 NTP_4_2_5P18 ntpd/ntpdsim-opts.h@1.4 +3 -3 NTP_4_2_5P18 ntpd/ntpdsim-opts.texi@1.4 +1 -1 NTP_4_2_5P18 ntpd/ntpdsim.1@1.4 +2 -2 NTP_4_2_5P18 ntpdc/ntpdc-opts.c@1.4 +2 -2 NTP_4_2_5P18 ntpdc/ntpdc-opts.h@1.4 +3 -3 NTP_4_2_5P18 ntpdc/ntpdc-opts.texi@1.4 +1 -1 NTP_4_2_5P18 ntpdc/ntpdc.1@1.4 +2 -2 NTP_4_2_5P18 ntpq/ntpq-opts.c@1.4 +2 -2 NTP_4_2_5P18 ntpq/ntpq-opts.h@1.4 +3 -3 NTP_4_2_5P18 ntpq/ntpq-opts.texi@1.4 +1 -1 NTP_4_2_5P18 ntpq/ntpq.1@1.4 +2 -2 NTP_4_2_5P18 packageinfo.sh@1.21 +1 -1 NTP_4_2_5P18 sntp/sntp-opts.c@1.4 +2 -2 NTP_4_2_5P18 sntp/sntp-opts.h@1.4 +3 -3 NTP_4_2_5P18 sntp/sntp-opts.texi@1.4 +1 -1 NTP_4_2_5P18 sntp/sntp.1@1.4 +2 -2 NTP_4_2_5P18 util/ntp-keygen-opts.c@1.4 +2 -2 NTP_4_2_5P18 util/ntp-keygen-opts.h@1.4 +3 -3 NTP_4_2_5P18 util/ntp-keygen-opts.texi@1.4 +1 -1 NTP_4_2_5P18 util/ntp-keygen.1@1.4 +2 -2 NTP_4_2_5P18 ChangeSet@1.1410.1.1, 2007-03-18 02:35:16-04:00, mayer@pogo.udel.edu Bug #787 Bug fixes for 64-bit time_t on Windows ports/winnt/include/config.h@1.47 +25 -7 Bug #787 Bug fixes for 64-bit time_t on Windows ports/winnt/include/ntp_timer.h@1.3.1.1 +2 -2 Bug #787 Bug fixes for 64-bit time_t on Windows ports/winnt/libntp/SetSystemTime.c@1.4 +2 -2 Bug #787 Bug fixes for 64-bit time_t on Windows ChangeSet@1.1440.1.67, 2007-03-17 19:35:08-05:00, stenn@whimsy.udel.edu [Bug 569] Use the correct precision for the Leitch CSD-5300 ChangeLog@1.21 +1 -0 [Bug 569] Use the correct precision for the Leitch CSD-5300 ntpd/refclock_leitch.c@1.10 +2 -1 [Bug 569] Use the correct precision for the Leitch CSD-5300 ChangeSet@1.1440.1.66, 2007-03-17 15:19:52-05:00, stenn@whimsy.udel.edu [Bug 798] ntpq [p typo crashes ntpdc ChangeLog@1.20 +1 -1 [Bug 798] ntpq [p typo crashes ntpdc ntpdc/ntpdc.c@1.56 +8 -4 [Bug 798] ntpq [p typo crashes ntpdc ChangeSet@1.1440.1.65, 2007-03-17 06:43:30-05:00, stenn@whimsy.udel.edu NTP_4_2_5P17 TAG: NTP_4_2_5P17 ntpd/ntpd-opts.c@1.3 +2 -2 NTP_4_2_5P17 ntpd/ntpd-opts.h@1.3 +3 -3 NTP_4_2_5P17 ntpd/ntpd-opts.texi@1.3 +1 -1 NTP_4_2_5P17 ntpd/ntpd.1@1.3 +2 -2 NTP_4_2_5P17 ntpd/ntpdsim-opts.c@1.3 +2 -2 NTP_4_2_5P17 ntpd/ntpdsim-opts.h@1.3 +3 -3 NTP_4_2_5P17 ntpd/ntpdsim-opts.texi@1.3 +1 -1 NTP_4_2_5P17 ntpd/ntpdsim.1@1.3 +2 -2 NTP_4_2_5P17 ntpdc/ntpdc-opts.c@1.3 +2 -2 NTP_4_2_5P17 ntpdc/ntpdc-opts.h@1.3 +3 -3 NTP_4_2_5P17 ntpdc/ntpdc-opts.texi@1.3 +1 -1 NTP_4_2_5P17 ntpdc/ntpdc.1@1.3 +2 -2 NTP_4_2_5P17 ntpq/ntpq-opts.c@1.3 +2 -2 NTP_4_2_5P17 ntpq/ntpq-opts.h@1.3 +3 -3 NTP_4_2_5P17 ntpq/ntpq-opts.texi@1.3 +1 -1 NTP_4_2_5P17 ntpq/ntpq.1@1.3 +2 -2 NTP_4_2_5P17 packageinfo.sh@1.20 +1 -1 NTP_4_2_5P17 sntp/sntp-opts.c@1.3 +2 -2 NTP_4_2_5P17 sntp/sntp-opts.h@1.3 +3 -3 NTP_4_2_5P17 sntp/sntp-opts.texi@1.3 +1 -1 NTP_4_2_5P17 sntp/sntp.1@1.3 +2 -2 NTP_4_2_5P17 util/ntp-keygen-opts.c@1.3 +2 -2 NTP_4_2_5P17 util/ntp-keygen-opts.h@1.3 +3 -3 NTP_4_2_5P17 util/ntp-keygen-opts.texi@1.3 +1 -1 NTP_4_2_5P17 util/ntp-keygen.1@1.3 +2 -2 NTP_4_2_5P17 ChangeSet@1.1440.1.64, 2007-03-17 06:54:45-04:00, stenn@pogo.udel.edu [Bug 795] Moved declaration of variable to top of function ChangeLog@1.19 +1 -0 [Bug 795] Moved declaration of variable to top of function ChangeSet@1.1440.3.1, 2007-03-17 04:53:50-05:00, stenn@whimsy.udel.edu [Bug 798] ntpq [p typo crashes ntpq ChangeLog@1.18 +1 -0 [Bug 798] ntpq [p typo crashes ntpq ntpq/ntpq.c@1.66.1.1 +8 -4 [Bug 798] ntpq [p typo crashes ntpq ChangeSet@1.1440.1.62, 2007-03-12 09:06:55+00:00, burnicki@pogo.udel.edu [Bug 795] Moved declaration of variable to top of function to avoid build error. ntpd/ntp_io.c@1.245.1.4 +4 -1 Moved declaration of variable to top of function to avoid build error. ChangeSet@1.1436.1.36, 2007-03-07 06:46:09-05:00, stenn@whimsy.udel.edu NTP_4_2_4P0 TAG: NTP_4_2_4P0 ntpd/ntpd-opts.c@1.50.1.6 +2 -2 NTP_4_2_4P0 ntpd/ntpd-opts.h@1.50.1.6 +3 -3 NTP_4_2_4P0 ntpd/ntpd-opts.texi@1.49.1.6 +1 -1 NTP_4_2_4P0 ntpd/ntpd.1@1.48.1.6 +2 -2 NTP_4_2_4P0 ntpd/ntpdsim-opts.c@1.50.1.6 +2 -2 NTP_4_2_4P0 ntpd/ntpdsim-opts.h@1.50.1.6 +3 -3 NTP_4_2_4P0 ntpd/ntpdsim-opts.texi@1.48.1.6 +1 -1 NTP_4_2_4P0 ntpd/ntpdsim.1@1.48.1.6 +2 -2 NTP_4_2_4P0 ntpdc/ntpdc-opts.c@1.50.1.6 +2 -2 NTP_4_2_4P0 ntpdc/ntpdc-opts.h@1.50.1.6 +3 -3 NTP_4_2_4P0 ntpdc/ntpdc-opts.texi@1.48.1.6 +1 -1 NTP_4_2_4P0 ntpdc/ntpdc.1@1.48.1.6 +2 -2 NTP_4_2_4P0 ntpq/ntpq-opts.c@1.52.1.6 +2 -2 NTP_4_2_4P0 ntpq/ntpq-opts.h@1.52.1.6 +3 -3 NTP_4_2_4P0 ntpq/ntpq-opts.texi@1.49.1.6 +1 -1 NTP_4_2_4P0 ntpq/ntpq.1@1.48.1.6 +2 -2 NTP_4_2_4P0 packageinfo.sh@1.65.7.2 +2 -2 NTP_4_2_4P0 sntp/sntp-opts.c@1.49.1.6 +2 -2 NTP_4_2_4P0 sntp/sntp-opts.h@1.49.1.6 +3 -3 NTP_4_2_4P0 sntp/sntp-opts.texi@1.46.1.6 +1 -1 NTP_4_2_4P0 sntp/sntp.1@1.49.1.6 +2 -2 NTP_4_2_4P0 util/ntp-keygen-opts.c@1.49.1.6 +2 -2 NTP_4_2_4P0 util/ntp-keygen-opts.h@1.49.1.6 +3 -3 NTP_4_2_4P0 util/ntp-keygen-opts.texi@1.47.1.6 +1 -1 NTP_4_2_4P0 util/ntp-keygen.1@1.47.1.6 +2 -2 NTP_4_2_4P0 ChangeSet@1.1436.1.35, 2007-03-07 00:53:31-05:00, stenn@whimsy.udel.edu time to release packageinfo.sh@1.65.7.1 +3 -1 time to release ChangeSet@1.1440.1.61, 2007-03-04 07:33:47-05:00, stenn@whimsy.udel.edu NTP_4_2_5P16 TAG: NTP_4_2_5P16 ntpd/ntpd-opts.c@1.2 +2 -2 NTP_4_2_5P16 ntpd/ntpd-opts.h@1.2 +3 -3 NTP_4_2_5P16 ntpd/ntpd-opts.texi@1.2 +1 -1 NTP_4_2_5P16 ntpd/ntpd.1@1.2 +2 -2 NTP_4_2_5P16 ntpd/ntpdsim-opts.c@1.2 +2 -2 NTP_4_2_5P16 ntpd/ntpdsim-opts.h@1.2 +3 -3 NTP_4_2_5P16 ntpd/ntpdsim-opts.texi@1.2 +1 -1 NTP_4_2_5P16 ntpd/ntpdsim.1@1.2 +2 -2 NTP_4_2_5P16 ntpdc/ntpdc-opts.c@1.2 +2 -2 NTP_4_2_5P16 ntpdc/ntpdc-opts.h@1.2 +3 -3 NTP_4_2_5P16 ntpdc/ntpdc-opts.texi@1.2 +1 -1 NTP_4_2_5P16 ntpdc/ntpdc.1@1.2 +2 -2 NTP_4_2_5P16 ntpq/ntpq-opts.c@1.2 +2 -2 NTP_4_2_5P16 ntpq/ntpq-opts.h@1.2 +3 -3 NTP_4_2_5P16 ntpq/ntpq-opts.texi@1.2 +1 -1 NTP_4_2_5P16 ntpq/ntpq.1@1.2 +2 -2 NTP_4_2_5P16 packageinfo.sh@1.19 +1 -1 NTP_4_2_5P16 sntp/sntp-opts.c@1.2 +2 -2 NTP_4_2_5P16 sntp/sntp-opts.h@1.2 +3 -3 NTP_4_2_5P16 sntp/sntp-opts.texi@1.2 +1 -1 NTP_4_2_5P16 sntp/sntp.1@1.2 +2 -2 NTP_4_2_5P16 util/ntp-keygen-opts.c@1.2 +2 -2 NTP_4_2_5P16 util/ntp-keygen-opts.h@1.2 +3 -3 NTP_4_2_5P16 util/ntp-keygen-opts.texi@1.2 +1 -1 NTP_4_2_5P16 util/ntp-keygen.1@1.2 +2 -2 NTP_4_2_5P16 ChangeSet@1.1440.1.60, 2007-03-03 22:41:27-05:00, stenn@whimsy.udel.edu .point-changed-filelist items are distinct between -stable and -dev. BitKeeper/deleted/.del-ntp-keygen-opts.c@1.71 +0 -0 Delete: util/ntp-keygen-opts.c BitKeeper/deleted/.del-ntp-keygen-opts.h@1.71 +0 -0 Delete: util/ntp-keygen-opts.h BitKeeper/deleted/.del-ntp-keygen-opts.texi@1.69 +0 -0 Delete: util/ntp-keygen-opts.texi BitKeeper/deleted/.del-ntp-keygen.1@1.69 +0 -0 Delete: util/ntp-keygen.1 BitKeeper/deleted/.del-ntpd-opts.c@1.72 +0 -0 Delete: ntpd/ntpd-opts.c BitKeeper/deleted/.del-ntpd-opts.h@1.72 +0 -0 Delete: ntpd/ntpd-opts.h BitKeeper/deleted/.del-ntpd-opts.texi@1.71 +0 -0 Delete: ntpd/ntpd-opts.texi BitKeeper/deleted/.del-ntpd.1@1.70 +0 -0 Delete: ntpd/ntpd.1 BitKeeper/deleted/.del-ntpdc-opts.c@1.72 +0 -0 Delete: ntpdc/ntpdc-opts.c BitKeeper/deleted/.del-ntpdc-opts.h@1.72 +0 -0 Delete: ntpdc/ntpdc-opts.h BitKeeper/deleted/.del-ntpdc-opts.texi@1.70 +0 -0 Delete: ntpdc/ntpdc-opts.texi BitKeeper/deleted/.del-ntpdc.1@1.70 +0 -0 Delete: ntpdc/ntpdc.1 BitKeeper/deleted/.del-ntpdsim-opts.c@1.72 +0 -0 Delete: ntpd/ntpdsim-opts.c BitKeeper/deleted/.del-ntpdsim-opts.h@1.72 +0 -0 Delete: ntpd/ntpdsim-opts.h BitKeeper/deleted/.del-ntpdsim-opts.texi@1.70 +0 -0 Delete: ntpd/ntpdsim-opts.texi BitKeeper/deleted/.del-ntpdsim.1@1.70 +0 -0 Delete: ntpd/ntpdsim.1 BitKeeper/deleted/.del-ntpq-opts.c@1.74 +0 -0 Delete: ntpq/ntpq-opts.c BitKeeper/deleted/.del-ntpq-opts.h@1.74 +0 -0 Delete: ntpq/ntpq-opts.h BitKeeper/deleted/.del-ntpq-opts.texi@1.71 +0 -0 Delete: ntpq/ntpq-opts.texi BitKeeper/deleted/.del-ntpq.1@1.70 +0 -0 Delete: ntpq/ntpq.1 BitKeeper/deleted/.del-sntp-opts.c@1.71 +0 -0 Delete: sntp/sntp-opts.c BitKeeper/deleted/.del-sntp-opts.h@1.71 +0 -0 Delete: sntp/sntp-opts.h BitKeeper/deleted/.del-sntp-opts.texi@1.68 +0 -0 Delete: sntp/sntp-opts.texi BitKeeper/deleted/.del-sntp.1@1.71 +0 -0 Delete: sntp/sntp.1 ntpd/ntpd-opts.c@1.1 +1055 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpd-opts.c ntpd/ntpd-opts.c@1.0 +0 -0 ntpd/ntpd-opts.h@1.1 +366 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpd-opts.h ntpd/ntpd-opts.h@1.0 +0 -0 ntpd/ntpd-opts.texi@1.1 +498 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpd-opts.texi ntpd/ntpd-opts.texi@1.0 +0 -0 ntpd/ntpd.1@1.1 +312 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpd.1 ntpd/ntpd.1@1.0 +0 -0 ntpd/ntpdsim-opts.c@1.1 +1253 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpdsim-opts.c ntpd/ntpdsim-opts.c@1.0 +0 -0 ntpd/ntpdsim-opts.h@1.1 +429 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpdsim-opts.h ntpd/ntpdsim-opts.h@1.0 +0 -0 ntpd/ntpdsim-opts.texi@1.1 +510 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpdsim-opts.texi ntpd/ntpdsim-opts.texi@1.0 +0 -0 ntpd/ntpdsim.1@1.1 +357 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpdsim.1 ntpd/ntpdsim.1@1.0 +0 -0 ntpdc/ntpdc-opts.c@1.1 +658 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpdc/ntpdc-opts.c ntpdc/ntpdc-opts.c@1.0 +0 -0 ntpdc/ntpdc-opts.h@1.1 +229 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpdc/ntpdc-opts.h ntpdc/ntpdc-opts.h@1.0 +0 -0 ntpdc/ntpdc-opts.texi@1.1 +276 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpdc/ntpdc-opts.texi ntpdc/ntpdc-opts.texi@1.0 +0 -0 ntpdc/ntpdc.1@1.1 +158 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpdc/ntpdc.1 ntpdc/ntpdc.1@1.0 +0 -0 ntpq/ntpq-opts.c@1.1 +598 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpq/ntpq-opts.c ntpq/ntpq-opts.c@1.0 +0 -0 ntpq/ntpq-opts.h@1.1 +215 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpq/ntpq-opts.h ntpq/ntpq-opts.h@1.0 +0 -0 ntpq/ntpq-opts.texi@1.1 +216 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpq/ntpq-opts.texi ntpq/ntpq-opts.texi@1.0 +0 -0 ntpq/ntpq.1@1.1 +385 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpq/ntpq.1 ntpq/ntpq.1@1.0 +0 -0 sntp/sntp-opts.c@1.1 +682 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/sntp-opts.c sntp/sntp-opts.c@1.0 +0 -0 sntp/sntp-opts.h@1.1 +290 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/sntp-opts.h sntp/sntp-opts.h@1.0 +0 -0 sntp/sntp-opts.texi@1.1 +174 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/sntp-opts.texi sntp/sntp-opts.texi@1.0 +0 -0 sntp/sntp.1@1.1 +400 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/sntp.1 sntp/sntp.1@1.0 +0 -0 util/ntp-keygen-opts.c@1.1 +1035 -0 BitKeeper file /deacon/backroom/ntp-dev/util/ntp-keygen-opts.c util/ntp-keygen-opts.c@1.0 +0 -0 util/ntp-keygen-opts.h@1.1 +325 -0 BitKeeper file /deacon/backroom/ntp-dev/util/ntp-keygen-opts.h util/ntp-keygen-opts.h@1.0 +0 -0 util/ntp-keygen-opts.texi@1.1 +366 -0 BitKeeper file /deacon/backroom/ntp-dev/util/ntp-keygen-opts.texi util/ntp-keygen-opts.texi@1.0 +0 -0 util/ntp-keygen.1@1.1 +176 -0 BitKeeper file /deacon/backroom/ntp-dev/util/ntp-keygen.1 util/ntp-keygen.1@1.0 +0 -0 ChangeSet@1.1436.1.34, 2007-03-03 19:21:29-05:00, stenn@whimsy.udel.edu [Bug 793] Update Hans Lambermont's email address in ntpsweep ChangeLog@1.1.1.9 +1 -0 [Bug 793] Update Hans Lambermont's email address in ntpsweep scripts/ntpsweep.in@1.3 +1 -2 [Bug 793] Update Hans Lambermont's email address in ntpsweep ChangeSet@1.1440.1.58, 2007-03-03 06:43:50-05:00, stenn@whimsy.udel.edu NTP_4_2_5P15 TAG: NTP_4_2_5P15 ntpd/ntpd-opts.c@1.70 +2 -2 NTP_4_2_5P15 ntpd/ntpd-opts.h@1.70 +3 -3 NTP_4_2_5P15 ntpd/ntpd-opts.texi@1.69 +1 -1 NTP_4_2_5P15 ntpd/ntpd.1@1.68 +2 -2 NTP_4_2_5P15 ntpd/ntpdsim-opts.c@1.70 +2 -2 NTP_4_2_5P15 ntpd/ntpdsim-opts.h@1.70 +3 -3 NTP_4_2_5P15 ntpd/ntpdsim-opts.texi@1.68 +1 -1 NTP_4_2_5P15 ntpd/ntpdsim.1@1.68 +2 -2 NTP_4_2_5P15 ntpdc/ntpdc-opts.c@1.70 +2 -2 NTP_4_2_5P15 ntpdc/ntpdc-opts.h@1.70 +3 -3 NTP_4_2_5P15 ntpdc/ntpdc-opts.texi@1.68 +1 -1 NTP_4_2_5P15 ntpdc/ntpdc.1@1.68 +2 -2 NTP_4_2_5P15 ntpq/ntpq-opts.c@1.72 +2 -2 NTP_4_2_5P15 ntpq/ntpq-opts.h@1.72 +3 -3 NTP_4_2_5P15 ntpq/ntpq-opts.texi@1.69 +1 -1 NTP_4_2_5P15 ntpq/ntpq.1@1.68 +2 -2 NTP_4_2_5P15 packageinfo.sh@1.18 +1 -1 NTP_4_2_5P15 sntp/sntp-opts.c@1.69 +2 -2 NTP_4_2_5P15 sntp/sntp-opts.h@1.69 +3 -3 NTP_4_2_5P15 sntp/sntp-opts.texi@1.66 +1 -1 NTP_4_2_5P15 sntp/sntp.1@1.69 +2 -2 NTP_4_2_5P15 util/ntp-keygen-opts.c@1.69 +2 -2 NTP_4_2_5P15 util/ntp-keygen-opts.h@1.69 +3 -3 NTP_4_2_5P15 util/ntp-keygen-opts.texi@1.67 +1 -1 NTP_4_2_5P15 util/ntp-keygen.1@1.67 +2 -2 NTP_4_2_5P15 ChangeSet@1.1440.1.57, 2007-03-03 01:16:11-05:00, stenn@whimsy.udel.edu [Bug 786] Fix refclock_bancomm.c on Solaris ChangeLog@1.16 +1 -0 [Bug 786] Fix refclock_bancomm.c on Solaris ChangeSet@1.1440.1.56, 2007-03-01 10:16:30-05:00, neal@pogo.udel.edu refclock_bancomm.c: [BUG 786] - add Solaris 10 support ntpd/refclock_bancomm.c@1.10 +97 -17 [BUG 786] - add Solaris 10 support ChangeSet@1.1440.1.55, 2007-02-26 06:42:31-05:00, stenn@whimsy.udel.edu NTP_4_2_5P14 TAG: NTP_4_2_5P14 ntpd/ntpd-opts.c@1.69 +2 -2 NTP_4_2_5P14 ntpd/ntpd-opts.h@1.69 +3 -3 NTP_4_2_5P14 ntpd/ntpd-opts.texi@1.68 +1 -1 NTP_4_2_5P14 ntpd/ntpd.1@1.67 +2 -2 NTP_4_2_5P14 ntpd/ntpdsim-opts.c@1.69 +2 -2 NTP_4_2_5P14 ntpd/ntpdsim-opts.h@1.69 +3 -3 NTP_4_2_5P14 ntpd/ntpdsim-opts.texi@1.67 +1 -1 NTP_4_2_5P14 ntpd/ntpdsim.1@1.67 +2 -2 NTP_4_2_5P14 ntpdc/ntpdc-opts.c@1.69 +2 -2 NTP_4_2_5P14 ntpdc/ntpdc-opts.h@1.69 +3 -3 NTP_4_2_5P14 ntpdc/ntpdc-opts.texi@1.67 +1 -1 NTP_4_2_5P14 ntpdc/ntpdc.1@1.67 +2 -2 NTP_4_2_5P14 ntpq/ntpq-opts.c@1.71 +2 -2 NTP_4_2_5P14 ntpq/ntpq-opts.h@1.71 +3 -3 NTP_4_2_5P14 ntpq/ntpq-opts.texi@1.68 +1 -1 NTP_4_2_5P14 ntpq/ntpq.1@1.67 +2 -2 NTP_4_2_5P14 packageinfo.sh@1.17 +1 -1 NTP_4_2_5P14 sntp/sntp-opts.c@1.68 +2 -2 NTP_4_2_5P14 sntp/sntp-opts.h@1.68 +3 -3 NTP_4_2_5P14 sntp/sntp-opts.texi@1.65 +1 -1 NTP_4_2_5P14 sntp/sntp.1@1.68 +2 -2 NTP_4_2_5P14 util/ntp-keygen-opts.c@1.68 +2 -2 NTP_4_2_5P14 util/ntp-keygen-opts.h@1.68 +3 -3 NTP_4_2_5P14 util/ntp-keygen-opts.texi@1.66 +1 -1 NTP_4_2_5P14 util/ntp-keygen.1@1.66 +2 -2 NTP_4_2_5P14 ChangeSet@1.1440.1.54, 2007-02-25 18:42:26-05:00, stenn@whimsy.udel.edu [Bug 789] Fix multicast client crypto authentication ChangeLog@1.15 +1 -0 [Bug 789] Fix multicast client crypto authentication ChangeSet@1.1440.1.53, 2007-02-25 17:21:59+00:00, kardel@pogo.udel.edu ntp_peer.c: Bug 789: insure that crypto information is only cleared when the local address changes. fixes multicast client mode ntpd/ntp_peer.c@1.100 +10 -13 Bug 789: insure that crypto information is only cleared when the local address changes. fixes multicast client mode ChangeSet@1.1440.1.52, 2007-02-25 06:42:44-05:00, stenn@whimsy.udel.edu NTP_4_2_5P13 TAG: NTP_4_2_5P13 ntpd/ntpd-opts.c@1.68 +2 -2 NTP_4_2_5P13 ntpd/ntpd-opts.h@1.68 +3 -3 NTP_4_2_5P13 ntpd/ntpd-opts.texi@1.67 +1 -1 NTP_4_2_5P13 ntpd/ntpd.1@1.66 +2 -2 NTP_4_2_5P13 ntpd/ntpdsim-opts.c@1.68 +2 -2 NTP_4_2_5P13 ntpd/ntpdsim-opts.h@1.68 +3 -3 NTP_4_2_5P13 ntpd/ntpdsim-opts.texi@1.66 +1 -1 NTP_4_2_5P13 ntpd/ntpdsim.1@1.66 +2 -2 NTP_4_2_5P13 ntpdc/ntpdc-opts.c@1.68 +2 -2 NTP_4_2_5P13 ntpdc/ntpdc-opts.h@1.68 +3 -3 NTP_4_2_5P13 ntpdc/ntpdc-opts.texi@1.66 +1 -1 NTP_4_2_5P13 ntpdc/ntpdc.1@1.66 +2 -2 NTP_4_2_5P13 ntpq/ntpq-opts.c@1.70 +2 -2 NTP_4_2_5P13 ntpq/ntpq-opts.h@1.70 +3 -3 NTP_4_2_5P13 ntpq/ntpq-opts.texi@1.67 +1 -1 NTP_4_2_5P13 ntpq/ntpq.1@1.66 +2 -2 NTP_4_2_5P13 packageinfo.sh@1.16 +1 -1 NTP_4_2_5P13 sntp/sntp-opts.c@1.67 +2 -2 NTP_4_2_5P13 sntp/sntp-opts.h@1.67 +3 -3 NTP_4_2_5P13 sntp/sntp-opts.texi@1.64 +1 -1 NTP_4_2_5P13 sntp/sntp.1@1.67 +2 -2 NTP_4_2_5P13 util/ntp-keygen-opts.c@1.67 +2 -2 NTP_4_2_5P13 util/ntp-keygen-opts.h@1.67 +3 -3 NTP_4_2_5P13 util/ntp-keygen-opts.texi@1.65 +1 -1 NTP_4_2_5P13 util/ntp-keygen.1@1.65 +2 -2 NTP_4_2_5P13 ChangeSet@1.1440.1.51, 2007-02-25 00:21:52+00:00, kardel@pogo.udel.edu ntp_io.c: bug 785: improve handling of multicast interfaces (multicast routers still need to run a multicast routing software/daemon) ntp_peer.c: clarify debug messages ntpd/ntp_io.c@1.245.1.3 +84 -62 bug 785: improve handling of multicast interfaces (multicast routers still need to run a multicast routing software/daemon) ntpd/ntp_peer.c@1.99 +2 -2 clarify debug messages ChangeSet@1.1440.1.50, 2007-02-24 08:33:25-05:00, stenn@whimsy.udel.edu NTP_4_2_5P12 TAG: NTP_4_2_5P12 ntpd/ntpd-opts.c@1.67 +2 -2 NTP_4_2_5P12 ntpd/ntpd-opts.h@1.67 +3 -3 NTP_4_2_5P12 ntpd/ntpd-opts.texi@1.66 +1 -1 NTP_4_2_5P12 ntpd/ntpd.1@1.65 +2 -2 NTP_4_2_5P12 ntpd/ntpdsim-opts.c@1.67 +2 -2 NTP_4_2_5P12 ntpd/ntpdsim-opts.h@1.67 +3 -3 NTP_4_2_5P12 ntpd/ntpdsim-opts.texi@1.65 +1 -1 NTP_4_2_5P12 ntpd/ntpdsim.1@1.65 +2 -2 NTP_4_2_5P12 ntpdc/ntpdc-opts.c@1.67 +2 -2 NTP_4_2_5P12 ntpdc/ntpdc-opts.h@1.67 +3 -3 NTP_4_2_5P12 ntpdc/ntpdc-opts.texi@1.65 +1 -1 NTP_4_2_5P12 ntpdc/ntpdc.1@1.65 +2 -2 NTP_4_2_5P12 ntpq/ntpq-opts.c@1.69 +2 -2 NTP_4_2_5P12 ntpq/ntpq-opts.h@1.69 +3 -3 NTP_4_2_5P12 ntpq/ntpq-opts.texi@1.66 +1 -1 NTP_4_2_5P12 ntpq/ntpq.1@1.65 +2 -2 NTP_4_2_5P12 packageinfo.sh@1.15 +1 -1 NTP_4_2_5P12 sntp/sntp-opts.c@1.66 +2 -2 NTP_4_2_5P12 sntp/sntp-opts.h@1.66 +3 -3 NTP_4_2_5P12 sntp/sntp-opts.texi@1.63 +1 -1 NTP_4_2_5P12 sntp/sntp.1@1.66 +2 -2 NTP_4_2_5P12 util/ntp-keygen-opts.c@1.66 +2 -2 NTP_4_2_5P12 util/ntp-keygen-opts.h@1.66 +3 -3 NTP_4_2_5P12 util/ntp-keygen-opts.texi@1.64 +1 -1 NTP_4_2_5P12 util/ntp-keygen.1@1.64 +2 -2 NTP_4_2_5P12 ChangeSet@1.1436.1.33, 2007-02-24 06:42:26-05:00, stenn@whimsy.udel.edu NTP_4_2_4P0_RC5 TAG: NTP_4_2_4P0_RC5 ntpd/ntpd-opts.c@1.50.1.5 +2 -2 NTP_4_2_4P0_RC5 ntpd/ntpd-opts.h@1.50.1.5 +3 -3 NTP_4_2_4P0_RC5 ntpd/ntpd-opts.texi@1.49.1.5 +1 -1 NTP_4_2_4P0_RC5 ntpd/ntpd.1@1.48.1.5 +2 -2 NTP_4_2_4P0_RC5 ntpd/ntpdsim-opts.c@1.50.1.5 +2 -2 NTP_4_2_4P0_RC5 ntpd/ntpdsim-opts.h@1.50.1.5 +3 -3 NTP_4_2_4P0_RC5 ntpd/ntpdsim-opts.texi@1.48.1.5 +1 -1 NTP_4_2_4P0_RC5 ntpd/ntpdsim.1@1.48.1.5 +2 -2 NTP_4_2_4P0_RC5 ntpdc/ntpdc-opts.c@1.50.1.5 +2 -2 NTP_4_2_4P0_RC5 ntpdc/ntpdc-opts.h@1.50.1.5 +3 -3 NTP_4_2_4P0_RC5 ntpdc/ntpdc-opts.texi@1.48.1.5 +1 -1 NTP_4_2_4P0_RC5 ntpdc/ntpdc.1@1.48.1.5 +2 -2 NTP_4_2_4P0_RC5 ntpq/ntpq-opts.c@1.52.1.5 +2 -2 NTP_4_2_4P0_RC5 ntpq/ntpq-opts.h@1.52.1.5 +3 -3 NTP_4_2_4P0_RC5 ntpq/ntpq-opts.texi@1.49.1.5 +1 -1 NTP_4_2_4P0_RC5 ntpq/ntpq.1@1.48.1.5 +2 -2 NTP_4_2_4P0_RC5 packageinfo.sh@1.65.6.1 +1 -1 NTP_4_2_4P0_RC5 sntp/sntp-opts.c@1.49.1.5 +2 -2 NTP_4_2_4P0_RC5 sntp/sntp-opts.h@1.49.1.5 +3 -3 NTP_4_2_4P0_RC5 sntp/sntp-opts.texi@1.46.1.5 +1 -1 NTP_4_2_4P0_RC5 sntp/sntp.1@1.49.1.5 +2 -2 NTP_4_2_4P0_RC5 util/ntp-keygen-opts.c@1.49.1.5 +2 -2 NTP_4_2_4P0_RC5 util/ntp-keygen-opts.h@1.49.1.5 +3 -3 NTP_4_2_4P0_RC5 util/ntp-keygen-opts.texi@1.47.1.5 +1 -1 NTP_4_2_4P0_RC5 util/ntp-keygen.1@1.47.1.5 +2 -2 NTP_4_2_4P0_RC5 ChangeSet@1.1440.1.49, 2007-02-24 05:24:04-05:00, stenn@whimsy.udel.edu Updates to ntp_loopfilter.c from Dave Mills ntpd/ntp_loopfilter.c@1.132 +2 -3 Updates to ntp_loopfilter.c from Dave Mills ChangeSet@1.1436.1.32, 2007-02-24 05:07:16-05:00, stenn@whimsy.udel.edu [Bug 628] Fallback to ntp discipline not working for large offsets ntpd/ntp_loopfilter.c@1.127.1.1 +9 -24 [Bug 628] Fallback to ntp discipline not working for large offsets ChangeSet@1.1440.1.47, 2007-02-23 06:42:48-05:00, stenn@whimsy.udel.edu NTP_4_2_5P11 TAG: NTP_4_2_5P11 ntpd/ntpd-opts.c@1.66 +2 -2 NTP_4_2_5P11 ntpd/ntpd-opts.h@1.66 +3 -3 NTP_4_2_5P11 ntpd/ntpd-opts.texi@1.65 +1 -1 NTP_4_2_5P11 ntpd/ntpd.1@1.64 +2 -2 NTP_4_2_5P11 ntpd/ntpdsim-opts.c@1.66 +2 -2 NTP_4_2_5P11 ntpd/ntpdsim-opts.h@1.66 +3 -3 NTP_4_2_5P11 ntpd/ntpdsim-opts.texi@1.64 +1 -1 NTP_4_2_5P11 ntpd/ntpdsim.1@1.64 +2 -2 NTP_4_2_5P11 ntpdc/ntpdc-opts.c@1.66 +2 -2 NTP_4_2_5P11 ntpdc/ntpdc-opts.h@1.66 +3 -3 NTP_4_2_5P11 ntpdc/ntpdc-opts.texi@1.64 +1 -1 NTP_4_2_5P11 ntpdc/ntpdc.1@1.64 +2 -2 NTP_4_2_5P11 ntpq/ntpq-opts.c@1.68 +2 -2 NTP_4_2_5P11 ntpq/ntpq-opts.h@1.68 +3 -3 NTP_4_2_5P11 ntpq/ntpq-opts.texi@1.65 +1 -1 NTP_4_2_5P11 ntpq/ntpq.1@1.64 +2 -2 NTP_4_2_5P11 packageinfo.sh@1.14 +1 -1 NTP_4_2_5P11 sntp/sntp-opts.c@1.65 +2 -2 NTP_4_2_5P11 sntp/sntp-opts.h@1.65 +3 -3 NTP_4_2_5P11 sntp/sntp-opts.texi@1.62 +1 -1 NTP_4_2_5P11 sntp/sntp.1@1.65 +2 -2 NTP_4_2_5P11 util/ntp-keygen-opts.c@1.65 +2 -2 NTP_4_2_5P11 util/ntp-keygen-opts.h@1.65 +3 -3 NTP_4_2_5P11 util/ntp-keygen-opts.texi@1.63 +1 -1 NTP_4_2_5P11 util/ntp-keygen.1@1.63 +2 -2 NTP_4_2_5P11 ChangeSet@1.1440.1.46, 2007-02-23 03:16:58-05:00, stenn@whimsy.udel.edu [Bug 774] parsesolaris.c does not compile under the new Solaris libparse/Makefile.am@1.11 +1 -1 [Bug 774] parsesolaris.c does not compile under the new Solaris ChangeSet@1.1440.1.45, 2007-02-23 02:47:57-05:00, stenn@whimsy.udel.edu [Bug 774] parsesolaris.c does not compile under the new Solaris ChangeLog@1.14 +1 -0 [Bug 774] parsesolaris.c does not compile under the new Solaris libparse/Makefile.am@1.10 +1 -1 [Bug 774] parsesolaris.c does not compile under the new Solaris ChangeSet@1.1440.1.44, 2007-02-22 06:46:29-05:00, stenn@whimsy.udel.edu NTP_4_2_5P10 TAG: NTP_4_2_5P10 ntpd/ntpd-opts.c@1.65 +2 -2 NTP_4_2_5P10 ntpd/ntpd-opts.h@1.65 +3 -3 NTP_4_2_5P10 ntpd/ntpd-opts.texi@1.64 +1 -1 NTP_4_2_5P10 ntpd/ntpd.1@1.63 +2 -2 NTP_4_2_5P10 ntpd/ntpdsim-opts.c@1.65 +2 -2 NTP_4_2_5P10 ntpd/ntpdsim-opts.h@1.65 +3 -3 NTP_4_2_5P10 ntpd/ntpdsim-opts.texi@1.63 +1 -1 NTP_4_2_5P10 ntpd/ntpdsim.1@1.63 +2 -2 NTP_4_2_5P10 ntpdc/ntpdc-opts.c@1.65 +2 -2 NTP_4_2_5P10 ntpdc/ntpdc-opts.h@1.65 +3 -3 NTP_4_2_5P10 ntpdc/ntpdc-opts.texi@1.63 +1 -1 NTP_4_2_5P10 ntpdc/ntpdc.1@1.63 +2 -2 NTP_4_2_5P10 ntpq/ntpq-opts.c@1.67 +2 -2 NTP_4_2_5P10 ntpq/ntpq-opts.h@1.67 +3 -3 NTP_4_2_5P10 ntpq/ntpq-opts.texi@1.64 +1 -1 NTP_4_2_5P10 ntpq/ntpq.1@1.63 +2 -2 NTP_4_2_5P10 packageinfo.sh@1.13 +1 -1 NTP_4_2_5P10 sntp/sntp-opts.c@1.64 +2 -2 NTP_4_2_5P10 sntp/sntp-opts.h@1.64 +3 -3 NTP_4_2_5P10 sntp/sntp-opts.texi@1.61 +1 -1 NTP_4_2_5P10 sntp/sntp.1@1.64 +2 -2 NTP_4_2_5P10 util/ntp-keygen-opts.c@1.64 +2 -2 NTP_4_2_5P10 util/ntp-keygen-opts.h@1.64 +3 -3 NTP_4_2_5P10 util/ntp-keygen-opts.texi@1.62 +1 -1 NTP_4_2_5P10 util/ntp-keygen.1@1.62 +2 -2 NTP_4_2_5P10 ChangeSet@1.1436.1.31, 2007-02-21 15:16:15-05:00, stenn@whimsy.udel.edu [Bug 776] Remove the obsolete r: from the getopt string in ntpdate ntpdate/ntpdate.c@1.59.1.2 +1 -1 [Bug 776] Remove the obsolete r: from the getopt string in ntpdate ChangeSet@1.1440.1.42, 2007-02-19 08:43:35-05:00, stenn@whimsy.udel.edu NTP_4_2_5P9 TAG: NTP_4_2_5P9 ntpd/ntpd-opts.c@1.63 +2 -2 NTP_4_2_5P9 ntpd/ntpd-opts.h@1.63 +3 -3 NTP_4_2_5P9 ntpd/ntpd-opts.texi@1.62 +2 -2 NTP_4_2_5P9 ntpd/ntpd.1@1.61 +2 -2 NTP_4_2_5P9 ntpd/ntpdsim-opts.c@1.63 +2 -2 NTP_4_2_5P9 ntpd/ntpdsim-opts.h@1.63 +3 -3 NTP_4_2_5P9 ntpd/ntpdsim-opts.texi@1.61 +1 -1 NTP_4_2_5P9 ntpd/ntpdsim.1@1.61 +2 -2 NTP_4_2_5P9 ntpdc/ntpdc-opts.c@1.63 +2 -2 NTP_4_2_5P9 ntpdc/ntpdc-opts.h@1.63 +3 -3 NTP_4_2_5P9 ntpdc/ntpdc-opts.texi@1.61 +2 -2 NTP_4_2_5P9 ntpdc/ntpdc.1@1.61 +2 -2 NTP_4_2_5P9 ntpq/ntpq-opts.c@1.65 +2 -2 NTP_4_2_5P9 ntpq/ntpq-opts.h@1.65 +3 -3 NTP_4_2_5P9 ntpq/ntpq-opts.texi@1.62 +2 -2 NTP_4_2_5P9 ntpq/ntpq.1@1.61 +2 -2 NTP_4_2_5P9 packageinfo.sh@1.12 +1 -1 NTP_4_2_5P9 sntp/sntp-opts.c@1.62 +2 -2 NTP_4_2_5P9 sntp/sntp-opts.h@1.62 +3 -3 NTP_4_2_5P9 sntp/sntp-opts.texi@1.59 +1 -1 NTP_4_2_5P9 sntp/sntp.1@1.62 +2 -2 NTP_4_2_5P9 util/ntp-keygen-opts.c@1.62 +2 -2 NTP_4_2_5P9 util/ntp-keygen-opts.h@1.62 +3 -3 NTP_4_2_5P9 util/ntp-keygen-opts.texi@1.60 +2 -2 NTP_4_2_5P9 util/ntp-keygen.1@1.60 +2 -2 NTP_4_2_5P9 ChangeSet@1.1436.1.30, 2007-02-19 06:46:30-05:00, stenn@whimsy.udel.edu NTP_4_2_4P0_RC4 TAG: NTP_4_2_4P0_RC4 ntpd/ntpd-opts.c@1.50.1.4 +2 -2 NTP_4_2_4P0_RC4 ntpd/ntpd-opts.h@1.50.1.4 +3 -3 NTP_4_2_4P0_RC4 ntpd/ntpd-opts.texi@1.49.1.4 +2 -2 NTP_4_2_4P0_RC4 ntpd/ntpd.1@1.48.1.4 +2 -2 NTP_4_2_4P0_RC4 ntpd/ntpdsim-opts.c@1.50.1.4 +2 -2 NTP_4_2_4P0_RC4 ntpd/ntpdsim-opts.h@1.50.1.4 +3 -3 NTP_4_2_4P0_RC4 ntpd/ntpdsim-opts.texi@1.48.1.4 +1 -1 NTP_4_2_4P0_RC4 ntpd/ntpdsim.1@1.48.1.4 +2 -2 NTP_4_2_4P0_RC4 ntpdc/ntpdc-opts.c@1.50.1.4 +2 -2 NTP_4_2_4P0_RC4 ntpdc/ntpdc-opts.h@1.50.1.4 +3 -3 NTP_4_2_4P0_RC4 ntpdc/ntpdc-opts.texi@1.48.1.4 +2 -2 NTP_4_2_4P0_RC4 ntpdc/ntpdc.1@1.48.1.4 +2 -2 NTP_4_2_4P0_RC4 ntpq/ntpq-opts.c@1.52.1.4 +2 -2 NTP_4_2_4P0_RC4 ntpq/ntpq-opts.h@1.52.1.4 +3 -3 NTP_4_2_4P0_RC4 ntpq/ntpq-opts.texi@1.49.1.4 +2 -2 NTP_4_2_4P0_RC4 ntpq/ntpq.1@1.48.1.4 +2 -2 NTP_4_2_4P0_RC4 packageinfo.sh@1.65.5.1 +3 -3 NTP_4_2_4P0_RC4 sntp/sntp-opts.c@1.49.1.4 +2 -2 NTP_4_2_4P0_RC4 sntp/sntp-opts.h@1.49.1.4 +3 -3 NTP_4_2_4P0_RC4 sntp/sntp-opts.texi@1.46.1.4 +1 -1 NTP_4_2_4P0_RC4 sntp/sntp.1@1.49.1.4 +2 -2 NTP_4_2_4P0_RC4 util/ntp-keygen-opts.c@1.49.1.4 +2 -2 NTP_4_2_4P0_RC4 util/ntp-keygen-opts.h@1.49.1.4 +3 -3 NTP_4_2_4P0_RC4 util/ntp-keygen-opts.texi@1.47.1.4 +2 -2 NTP_4_2_4P0_RC4 util/ntp-keygen.1@1.47.1.4 +2 -2 NTP_4_2_4P0_RC4 ChangeSet@1.1440.1.41, 2007-02-19 05:26:33-05:00, stenn@whimsy.udel.edu [Bug 782] Remove P() macros from Windows files ChangeLog@1.13 +1 -0 [Bug 782] Remove P() macros from Windows files ports/winnt/include/ntp_timer.h@1.4 +3 -5 [Bug 782] Remove P() macros from Windows files ports/winnt/include/transmitbuff.h@1.6 +3 -3 [Bug 782] Remove P() macros from Windows files ports/winnt/include/win32_io.h@1.8 +2 -2 [Bug 782] Remove P() macros from Windows files ChangeSet@1.1436.1.29, 2007-02-19 00:19:22-05:00, stenn@whimsy.udel.edu Ready to go... packageinfo.sh@1.65.4.2 +2 -2 Ready to go... ChangeSet@1.1436.1.28, 2007-02-19 00:14:29-05:00, stenn@whimsy.udel.edu [Bug 776] Remove unimplemented "rate" flag from ntpdate ChangeLog@1.1.1.8 +1 -0 [Bug 776] Remove unimplemented "rate" flag from ntpdate ntpdate/Makefile.am@1.14.1.1 +1 -1 [Bug 776] Remove unimplemented "rate" flag from ntpdate ntpdate/ntpdate.c@1.59.1.1 +1 -21 [Bug 776] Remove unimplemented "rate" flag from ntpdate ChangeSet@1.1440.1.39, 2007-02-17 06:42:34-05:00, stenn@whimsy.udel.edu NTP_4_2_5P8 TAG: NTP_4_2_5P8 ntpd/ntpd-opts.c@1.61 +2 -2 NTP_4_2_5P8 ntpd/ntpd-opts.h@1.61 +3 -3 NTP_4_2_5P8 ntpd/ntpd-opts.texi@1.60 +1 -1 NTP_4_2_5P8 ntpd/ntpd.1@1.59 +2 -2 NTP_4_2_5P8 ntpd/ntpdsim-opts.c@1.61 +2 -2 NTP_4_2_5P8 ntpd/ntpdsim-opts.h@1.61 +3 -3 NTP_4_2_5P8 ntpd/ntpdsim-opts.texi@1.59 +1 -1 NTP_4_2_5P8 ntpd/ntpdsim.1@1.59 +2 -2 NTP_4_2_5P8 ntpdc/ntpdc-opts.c@1.61 +2 -2 NTP_4_2_5P8 ntpdc/ntpdc-opts.h@1.61 +3 -3 NTP_4_2_5P8 ntpdc/ntpdc-opts.texi@1.59 +1 -1 NTP_4_2_5P8 ntpdc/ntpdc.1@1.59 +2 -2 NTP_4_2_5P8 ntpq/ntpq-opts.c@1.63 +2 -2 NTP_4_2_5P8 ntpq/ntpq-opts.h@1.63 +3 -3 NTP_4_2_5P8 ntpq/ntpq-opts.texi@1.60 +1 -1 NTP_4_2_5P8 ntpq/ntpq.1@1.59 +2 -2 NTP_4_2_5P8 packageinfo.sh@1.11 +1 -1 NTP_4_2_5P8 sntp/sntp-opts.c@1.60 +2 -2 NTP_4_2_5P8 sntp/sntp-opts.h@1.60 +3 -3 NTP_4_2_5P8 sntp/sntp-opts.texi@1.57 +1 -1 NTP_4_2_5P8 sntp/sntp.1@1.60 +2 -2 NTP_4_2_5P8 util/ntp-keygen-opts.c@1.60 +2 -2 NTP_4_2_5P8 util/ntp-keygen-opts.h@1.60 +3 -3 NTP_4_2_5P8 util/ntp-keygen-opts.texi@1.58 +1 -1 NTP_4_2_5P8 util/ntp-keygen.1@1.58 +2 -2 NTP_4_2_5P8 ChangeSet@1.1440.1.38, 2007-02-17 04:40:04-05:00, stenn@whimsy.udel.edu ntpd.h: Lose the fabs() and sqrt() declarations because they are in math.h and "lose" on some HP-UX machines. include/ntpd.h@1.100 +0 -3 Lose the fabs() and sqrt() declarations because they are in math.h and "lose" on some HP-UX machines. ChangeSet@1.1440.1.37, 2007-02-16 06:42:39-05:00, stenn@whimsy.udel.edu NTP_4_2_5P7 TAG: NTP_4_2_5P7 ntpd/ntpd-opts.c@1.60 +2 -2 NTP_4_2_5P7 ntpd/ntpd-opts.h@1.60 +3 -3 NTP_4_2_5P7 ntpd/ntpd-opts.texi@1.59 +1 -1 NTP_4_2_5P7 ntpd/ntpd.1@1.58 +2 -2 NTP_4_2_5P7 ntpd/ntpdsim-opts.c@1.60 +2 -2 NTP_4_2_5P7 ntpd/ntpdsim-opts.h@1.60 +3 -3 NTP_4_2_5P7 ntpd/ntpdsim-opts.texi@1.58 +1 -1 NTP_4_2_5P7 ntpd/ntpdsim.1@1.58 +2 -2 NTP_4_2_5P7 ntpdc/ntpdc-opts.c@1.60 +2 -2 NTP_4_2_5P7 ntpdc/ntpdc-opts.h@1.60 +3 -3 NTP_4_2_5P7 ntpdc/ntpdc-opts.texi@1.58 +1 -1 NTP_4_2_5P7 ntpdc/ntpdc.1@1.58 +2 -2 NTP_4_2_5P7 ntpq/ntpq-opts.c@1.62 +2 -2 NTP_4_2_5P7 ntpq/ntpq-opts.h@1.62 +3 -3 NTP_4_2_5P7 ntpq/ntpq-opts.texi@1.59 +1 -1 NTP_4_2_5P7 ntpq/ntpq.1@1.58 +2 -2 NTP_4_2_5P7 packageinfo.sh@1.10 +1 -1 NTP_4_2_5P7 sntp/sntp-opts.c@1.59 +2 -2 NTP_4_2_5P7 sntp/sntp-opts.h@1.59 +3 -3 NTP_4_2_5P7 sntp/sntp-opts.texi@1.56 +1 -1 NTP_4_2_5P7 sntp/sntp.1@1.59 +2 -2 NTP_4_2_5P7 util/ntp-keygen-opts.c@1.59 +2 -2 NTP_4_2_5P7 util/ntp-keygen-opts.h@1.59 +3 -3 NTP_4_2_5P7 util/ntp-keygen-opts.texi@1.57 +1 -1 NTP_4_2_5P7 util/ntp-keygen.1@1.57 +2 -2 NTP_4_2_5P7 ChangeSet@1.1440.1.36, 2007-02-16 03:30:53-05:00, stenn@whimsy.udel.edu [Bug 778] ntpd fails to lock with drift=+500 when started with drift=-500 ChangeLog@1.11 +2 -1 [Bug 778] ntpd fails to lock with drift=+500 when started with drift=-500 ChangeSet@1.1440.1.35, 2007-02-16 03:24:28-05:00, stenn@whimsy.udel.edu ntp_loopfilter.c: Avoid setting the kernel freq if kernel mode is not disabled in the config file and either the step threshold has been set to 0 or -x has been given. (This is Harlan's interpretation of Dave's comment #14 to bug 778: ) refclock_irig.c: Change the max PLL time constant to 10 (Dave Mills) ntpd/ntp_loopfilter.c@1.130 +5 -4 Avoid setting the kernel freq if kernel mode is not disabled in the config file and either the step threshold has been set to 0 or -x has been given. (This is Harlan's interpretation of Dave's comment #14 to bug 778: ) ntpd/refclock_irig.c@1.30 +1 -1 Change the max PLL time constant to 10 (Dave Mills) ChangeSet@1.1440.1.34, 2007-02-05 08:45:44-05:00, stenn@whimsy.udel.edu NTP_4_2_5P6 TAG: NTP_4_2_5P6 ntpd/ntpd-opts.c@1.59 +2 -2 NTP_4_2_5P6 ntpd/ntpd-opts.h@1.59 +3 -3 NTP_4_2_5P6 ntpd/ntpd-opts.texi@1.58 +1 -1 NTP_4_2_5P6 ntpd/ntpd.1@1.57 +2 -2 NTP_4_2_5P6 ntpd/ntpdsim-opts.c@1.59 +2 -2 NTP_4_2_5P6 ntpd/ntpdsim-opts.h@1.59 +3 -3 NTP_4_2_5P6 ntpd/ntpdsim-opts.texi@1.57 +1 -1 NTP_4_2_5P6 ntpd/ntpdsim.1@1.57 +2 -2 NTP_4_2_5P6 ntpdc/ntpdc-opts.c@1.59 +2 -2 NTP_4_2_5P6 ntpdc/ntpdc-opts.h@1.59 +3 -3 NTP_4_2_5P6 ntpdc/ntpdc-opts.texi@1.57 +1 -1 NTP_4_2_5P6 ntpdc/ntpdc.1@1.57 +2 -2 NTP_4_2_5P6 ntpq/ntpq-opts.c@1.61 +2 -2 NTP_4_2_5P6 ntpq/ntpq-opts.h@1.61 +3 -3 NTP_4_2_5P6 ntpq/ntpq-opts.texi@1.58 +1 -1 NTP_4_2_5P6 ntpq/ntpq.1@1.57 +2 -2 NTP_4_2_5P6 packageinfo.sh@1.9 +1 -1 NTP_4_2_5P6 sntp/sntp-opts.c@1.58 +2 -2 NTP_4_2_5P6 sntp/sntp-opts.h@1.58 +3 -3 NTP_4_2_5P6 sntp/sntp-opts.texi@1.55 +1 -1 NTP_4_2_5P6 sntp/sntp.1@1.58 +2 -2 NTP_4_2_5P6 util/ntp-keygen-opts.c@1.58 +2 -2 NTP_4_2_5P6 util/ntp-keygen-opts.h@1.58 +3 -3 NTP_4_2_5P6 util/ntp-keygen-opts.texi@1.56 +1 -1 NTP_4_2_5P6 util/ntp-keygen.1@1.56 +2 -2 NTP_4_2_5P6 ChangeSet@1.1436.1.27, 2007-02-05 06:47:44-05:00, stenn@whimsy.udel.edu NTP_4_2_4_RC3 TAG: NTP_4_2_4_RC3 ntpd/ntpd-opts.c@1.50.1.3 +2 -2 NTP_4_2_4_RC3 ntpd/ntpd-opts.h@1.50.1.3 +3 -3 NTP_4_2_4_RC3 ntpd/ntpd-opts.texi@1.49.1.3 +1 -1 NTP_4_2_4_RC3 ntpd/ntpd.1@1.48.1.3 +2 -2 NTP_4_2_4_RC3 ntpd/ntpdsim-opts.c@1.50.1.3 +2 -2 NTP_4_2_4_RC3 ntpd/ntpdsim-opts.h@1.50.1.3 +3 -3 NTP_4_2_4_RC3 ntpd/ntpdsim-opts.texi@1.48.1.3 +1 -1 NTP_4_2_4_RC3 ntpd/ntpdsim.1@1.48.1.3 +2 -2 NTP_4_2_4_RC3 ntpdc/ntpdc-opts.c@1.50.1.3 +2 -2 NTP_4_2_4_RC3 ntpdc/ntpdc-opts.h@1.50.1.3 +3 -3 NTP_4_2_4_RC3 ntpdc/ntpdc-opts.texi@1.48.1.3 +1 -1 NTP_4_2_4_RC3 ntpdc/ntpdc.1@1.48.1.3 +2 -2 NTP_4_2_4_RC3 ntpq/ntpq-opts.c@1.52.1.3 +2 -2 NTP_4_2_4_RC3 ntpq/ntpq-opts.h@1.52.1.3 +3 -3 NTP_4_2_4_RC3 ntpq/ntpq-opts.texi@1.49.1.3 +1 -1 NTP_4_2_4_RC3 ntpq/ntpq.1@1.48.1.3 +2 -2 NTP_4_2_4_RC3 packageinfo.sh@1.65.4.1 +1 -1 NTP_4_2_4_RC3 sntp/sntp-opts.c@1.49.1.3 +2 -2 NTP_4_2_4_RC3 sntp/sntp-opts.h@1.49.1.3 +3 -3 NTP_4_2_4_RC3 sntp/sntp-opts.texi@1.46.1.3 +1 -1 NTP_4_2_4_RC3 sntp/sntp.1@1.49.1.3 +2 -2 NTP_4_2_4_RC3 util/ntp-keygen-opts.c@1.49.1.3 +2 -2 NTP_4_2_4_RC3 util/ntp-keygen-opts.h@1.49.1.3 +3 -3 NTP_4_2_4_RC3 util/ntp-keygen-opts.texi@1.47.1.3 +1 -1 NTP_4_2_4_RC3 util/ntp-keygen.1@1.47.1.3 +2 -2 NTP_4_2_4_RC3 ChangeSet@1.1440.1.33, 2007-02-05 02:16:55-05:00, stenn@whimsy.udel.edu More CHU, IRIG, WWV, and WWVB fixes from Dave Mills ChangeLog@1.10 +1 -1 More CHU, IRIG, WWV, and WWVB fixes from Dave Mills html/drivers/driver36.html@1.31 +36 -30 More CHU, IRIG, WWV, and WWVB fixes from Dave Mills html/drivers/driver6.html@1.23 +12 -24 More CHU, IRIG, WWV, and WWVB fixes from Dave Mills html/drivers/driver7.html@1.25 +11 -29 More CHU, IRIG, WWV, and WWVB fixes from Dave Mills ntpd/refclock_chu.c@1.44 +39 -31 More CHU, IRIG, WWV, and WWVB fixes from Dave Mills ntpd/refclock_irig.c@1.29 +195 -128 More CHU, IRIG, WWV, and WWVB fixes from Dave Mills ntpd/refclock_wwv.c@1.70 +50 -39 More CHU, IRIG, WWV, and WWVB fixes from Dave Mills ntpd/refclock_wwvb.c@1.18 +0 -2 More CHU, IRIG, WWV, and WWVB fixes from Dave Mills ChangeSet@1.1436.1.26, 2007-02-04 23:08:28-05:00, stenn@whimsy.udel.edu Danny forgot to pull before editing - replace the change he undid. ntpq/ntpq-subs.c@1.25.2.2 +3 -2 Danny forgot to pull before editing - replace the change he undid. ChangeSet@1.1436.1.25, 2007-02-04 22:53:32-05:00, stenn@whimsy.udel.edu [Bug 586] Avoid lookups if AI_NUMERICHOST is set. ChangeLog@1.1.1.7 +1 -0 [Bug 586] Avoid lookups if AI_NUMERICHOST is set. ChangeSet@1.1436.1.24, 2007-02-04 21:51:15-05:00, mayer@pogo.udel.edu Bug #586 Don't do lookups if AI_NUMERICHOST is set libntp/ntp_rfc2553.c@1.36.1.1 +6 -0 Bug #586 Don't do lookups if AI_NUMERICHOST is set ChangeSet@1.1436.1.23, 2007-02-04 21:44:13-05:00, mayer@pogo.udel.edu Bug #586 Check for <4 characters for the refid first ntpq/ntpq-subs.c@1.25.2.1 +9 -10 Bug #586 Check for <4 characters for the refid first ChangeSet@1.1436.1.22, 2007-02-04 17:56:17+00:00, kardel@pogo.udel.edu ntpd.c: comment clarification about capabilities used ntpd/ntpd.c@1.82.2.2 +4 -7 comment clarification about capabilities used ChangeSet@1.1436.2.1, 2007-02-04 17:47:20+00:00, kardel@pogo.udel.edu ntpd.c: Bug 765: use Linux capability mechanism to allow dynamic interface tracking to continue in unprivileged mode. ntpd/ntpd.c@1.82.2.1 +11 -1 Bug 765: use Linux capability mechanism to allow dynamic interface tracking to continue in unprivileged mode. ChangeSet@1.1440.1.29, 2007-01-31 06:42:22-05:00, stenn@whimsy.udel.edu NTP_4_2_5P5 TAG: NTP_4_2_5P5 ntpd/ntpd-opts.c@1.57 +2 -2 NTP_4_2_5P5 ntpd/ntpd-opts.h@1.57 +3 -3 NTP_4_2_5P5 ntpd/ntpd-opts.texi@1.56 +1 -1 NTP_4_2_5P5 ntpd/ntpd.1@1.55 +2 -2 NTP_4_2_5P5 ntpd/ntpdsim-opts.c@1.57 +2 -2 NTP_4_2_5P5 ntpd/ntpdsim-opts.h@1.57 +3 -3 NTP_4_2_5P5 ntpd/ntpdsim-opts.texi@1.55 +1 -1 NTP_4_2_5P5 ntpd/ntpdsim.1@1.55 +2 -2 NTP_4_2_5P5 ntpdc/ntpdc-opts.c@1.57 +2 -2 NTP_4_2_5P5 ntpdc/ntpdc-opts.h@1.57 +3 -3 NTP_4_2_5P5 ntpdc/ntpdc-opts.texi@1.55 +1 -1 NTP_4_2_5P5 ntpdc/ntpdc.1@1.55 +2 -2 NTP_4_2_5P5 ntpq/ntpq-opts.c@1.59 +2 -2 NTP_4_2_5P5 ntpq/ntpq-opts.h@1.59 +3 -3 NTP_4_2_5P5 ntpq/ntpq-opts.texi@1.56 +1 -1 NTP_4_2_5P5 ntpq/ntpq.1@1.55 +2 -2 NTP_4_2_5P5 packageinfo.sh@1.8 +1 -1 NTP_4_2_5P5 sntp/sntp-opts.c@1.56 +2 -2 NTP_4_2_5P5 sntp/sntp-opts.h@1.56 +3 -3 NTP_4_2_5P5 sntp/sntp-opts.texi@1.53 +1 -1 NTP_4_2_5P5 sntp/sntp.1@1.56 +2 -2 NTP_4_2_5P5 util/ntp-keygen-opts.c@1.56 +2 -2 NTP_4_2_5P5 util/ntp-keygen-opts.h@1.56 +3 -3 NTP_4_2_5P5 util/ntp-keygen-opts.texi@1.54 +1 -1 NTP_4_2_5P5 util/ntp-keygen.1@1.54 +2 -2 NTP_4_2_5P5 ChangeSet@1.1440.1.28, 2007-01-30 19:44:35-05:00, stenn@whimsy.udel.edu re-indent/cleanup refclock_palisade.c ntpd/refclock_palisade.c@1.21 +347 -449 re-indent refclock_palisade.c ChangeSet@1.1440.1.27, 2007-01-30 08:41:43-05:00, stenn@whimsy.udel.edu NTP_4_2_5P4 TAG: NTP_4_2_5P4 ntpd/ntpd-opts.c@1.56 +2 -2 NTP_4_2_5P4 ntpd/ntpd-opts.h@1.56 +3 -3 NTP_4_2_5P4 ntpd/ntpd-opts.texi@1.55 +1 -1 NTP_4_2_5P4 ntpd/ntpd.1@1.54 +2 -2 NTP_4_2_5P4 ntpd/ntpdsim-opts.c@1.56 +2 -2 NTP_4_2_5P4 ntpd/ntpdsim-opts.h@1.56 +3 -3 NTP_4_2_5P4 ntpd/ntpdsim-opts.texi@1.54 +1 -1 NTP_4_2_5P4 ntpd/ntpdsim.1@1.54 +2 -2 NTP_4_2_5P4 ntpdc/ntpdc-opts.c@1.56 +2 -2 NTP_4_2_5P4 ntpdc/ntpdc-opts.h@1.56 +3 -3 NTP_4_2_5P4 ntpdc/ntpdc-opts.texi@1.54 +1 -1 NTP_4_2_5P4 ntpdc/ntpdc.1@1.54 +2 -2 NTP_4_2_5P4 ntpq/ntpq-opts.c@1.58 +2 -2 NTP_4_2_5P4 ntpq/ntpq-opts.h@1.58 +3 -3 NTP_4_2_5P4 ntpq/ntpq-opts.texi@1.55 +1 -1 NTP_4_2_5P4 ntpq/ntpq.1@1.54 +2 -2 NTP_4_2_5P4 packageinfo.sh@1.7 +1 -1 NTP_4_2_5P4 sntp/sntp-opts.c@1.55 +2 -2 NTP_4_2_5P4 sntp/sntp-opts.h@1.55 +3 -3 NTP_4_2_5P4 sntp/sntp-opts.texi@1.52 +1 -1 NTP_4_2_5P4 sntp/sntp.1@1.55 +2 -2 NTP_4_2_5P4 util/ntp-keygen-opts.c@1.55 +2 -2 NTP_4_2_5P4 util/ntp-keygen-opts.h@1.55 +3 -3 NTP_4_2_5P4 util/ntp-keygen-opts.texi@1.53 +1 -1 NTP_4_2_5P4 util/ntp-keygen.1@1.53 +2 -2 NTP_4_2_5P4 ChangeSet@1.1436.1.20, 2007-01-30 06:44:11-05:00, stenn@whimsy.udel.edu NTP_4_2_4_RC2 TAG: NTP_4_2_4_RC2 ntpd/ntpd-opts.c@1.50.1.2 +2 -2 NTP_4_2_4_RC2 ntpd/ntpd-opts.h@1.50.1.2 +3 -3 NTP_4_2_4_RC2 ntpd/ntpd-opts.texi@1.49.1.2 +1 -1 NTP_4_2_4_RC2 ntpd/ntpd.1@1.48.1.2 +2 -2 NTP_4_2_4_RC2 ntpd/ntpdsim-opts.c@1.50.1.2 +2 -2 NTP_4_2_4_RC2 ntpd/ntpdsim-opts.h@1.50.1.2 +3 -3 NTP_4_2_4_RC2 ntpd/ntpdsim-opts.texi@1.48.1.2 +1 -1 NTP_4_2_4_RC2 ntpd/ntpdsim.1@1.48.1.2 +2 -2 NTP_4_2_4_RC2 ntpdc/ntpdc-opts.c@1.50.1.2 +2 -2 NTP_4_2_4_RC2 ntpdc/ntpdc-opts.h@1.50.1.2 +3 -3 NTP_4_2_4_RC2 ntpdc/ntpdc-opts.texi@1.48.1.2 +1 -1 NTP_4_2_4_RC2 ntpdc/ntpdc.1@1.48.1.2 +2 -2 NTP_4_2_4_RC2 ntpq/ntpq-opts.c@1.52.1.2 +2 -2 NTP_4_2_4_RC2 ntpq/ntpq-opts.h@1.52.1.2 +3 -3 NTP_4_2_4_RC2 ntpq/ntpq-opts.texi@1.49.1.2 +1 -1 NTP_4_2_4_RC2 ntpq/ntpq.1@1.48.1.2 +2 -2 NTP_4_2_4_RC2 packageinfo.sh@1.65.3.1 +1 -1 NTP_4_2_4_RC2 sntp/sntp-opts.c@1.49.1.2 +2 -2 NTP_4_2_4_RC2 sntp/sntp-opts.h@1.49.1.2 +3 -3 NTP_4_2_4_RC2 sntp/sntp-opts.texi@1.46.1.2 +1 -1 NTP_4_2_4_RC2 sntp/sntp.1@1.49.1.2 +2 -2 NTP_4_2_4_RC2 util/ntp-keygen-opts.c@1.49.1.2 +2 -2 NTP_4_2_4_RC2 util/ntp-keygen-opts.h@1.49.1.2 +3 -3 NTP_4_2_4_RC2 util/ntp-keygen-opts.texi@1.47.1.2 +1 -1 NTP_4_2_4_RC2 util/ntp-keygen.1@1.47.1.2 +2 -2 NTP_4_2_4_RC2 ChangeSet@1.1440.1.26, 2007-01-30 01:09:52-05:00, stenn@whimsy.udel.edu Lose K&R prototype macro libntp/ntp_rfc2553.c@1.37 +2 -2 Lose K&R prototype macro ChangeSet@1.1436.1.19, 2007-01-29 21:20:08-05:00, stenn@whimsy.udel.edu [Bug 770] Fix numeric parameters to ntp-keygen (Alain Guibert). ChangeLog@1.1.1.6 +1 -0 [Bug 770] Fix numeric parameters to ntp-keygen (Alain Guibert). util/ntp-keygen.c@1.37.1.1 +3 -3 [Bug 770] Fix numeric parameters to ntp-keygen (Alain Guibert). ChangeSet@1.1436.1.18, 2007-01-29 17:43:41-05:00, stenn@whimsy.udel.edu More ChangeLog -> CommitLog fixes scripts/genCommitLog@1.4 +2 -2 More ChangeLog -> CommitLog fixes ChangeSet@1.1436.1.17, 2007-01-29 16:52:38-05:00, stenn@whimsy.udel.edu More ChangeLog -> CommitLog fixes Makefile.am@1.70.1.2 +5 -5 More ChangeLog -> CommitLog fixes scripts/Makefile.am@1.15 +1 -1 More ChangeLog -> CommitLog fixes scripts/genCommitLog@1.3 +0 -0 Rename: scripts/genChangeLog -> scripts/genCommitLog ChangeSet@1.1436.1.16, 2007-01-28 23:24:05-05:00, stenn@whimsy.udel.edu Entries for bugs 765 and 768 ChangeLog@1.1.1.5 +2 -0 Entries for bugs 765 and 768 ChangeSet@1.1436.1.15, 2007-01-27 08:54:51+00:00, kardel@pogo.udel.edu ntp_io.c: fix misleading error message when calling io_setbclient() and broadcast sockets are already open and not new sockets need to be opened. Bug 768: fix binding for broadcast client mode (Ulrich Weber) ntpd/ntp_io.c@1.244.2.3 +6 -3 fix misleading error message when calling io_setbclient() and broadcast sockets are already open and not new sockets need to be opened. ntpd/ntp_io.c@1.244.2.2 +2 -2 Bug 768: fix binding for broadcast client mode (Ulrich Weber) ChangeSet@1.1440.1.22, 2007-01-25 19:55:47-05:00, stenn@whimsy.udel.edu CHU, IRIG, and WWV improvements from Dave Mills libntp/audio.c@1.26 +6 -3 CHU, IRIG, and WWV improvements from Dave Mills ntpd/refclock_chu.c@1.43 +25 -22 CHU, IRIG, and WWV improvements from Dave Mills ntpd/refclock_irig.c@1.28 +113 -117 CHU, IRIG, and WWV improvements from Dave Mills ntpd/refclock_wwv.c@1.69 +26 -28 CHU, IRIG, and WWV improvements from Dave Mills ChangeSet@1.1440.1.21, 2007-01-25 18:30:28-05:00, stenn@whimsy.udel.edu NTP_4_2_5P3 TAG: NTP_4_2_5P3 ntpd/ntpd-opts.c@1.55 +2 -2 NTP_4_2_5P3 ntpd/ntpd-opts.h@1.55 +3 -3 NTP_4_2_5P3 ntpd/ntpd-opts.texi@1.54 +2 -2 NTP_4_2_5P3 ntpd/ntpd.1@1.53 +2 -2 NTP_4_2_5P3 ntpd/ntpdsim-opts.c@1.55 +2 -2 NTP_4_2_5P3 ntpd/ntpdsim-opts.h@1.55 +3 -3 NTP_4_2_5P3 ntpd/ntpdsim-opts.texi@1.53 +1 -1 NTP_4_2_5P3 ntpd/ntpdsim.1@1.53 +2 -2 NTP_4_2_5P3 ntpdc/ntpdc-opts.c@1.55 +2 -2 NTP_4_2_5P3 ntpdc/ntpdc-opts.h@1.55 +3 -3 NTP_4_2_5P3 ntpdc/ntpdc-opts.texi@1.53 +2 -2 NTP_4_2_5P3 ntpdc/ntpdc.1@1.53 +2 -2 NTP_4_2_5P3 ntpq/ntpq-opts.c@1.57 +2 -2 NTP_4_2_5P3 ntpq/ntpq-opts.h@1.57 +3 -3 NTP_4_2_5P3 ntpq/ntpq-opts.texi@1.54 +2 -2 NTP_4_2_5P3 ntpq/ntpq.1@1.53 +2 -2 NTP_4_2_5P3 packageinfo.sh@1.6 +1 -1 NTP_4_2_5P3 sntp/sntp-opts.c@1.54 +2 -2 NTP_4_2_5P3 sntp/sntp-opts.h@1.54 +3 -3 NTP_4_2_5P3 sntp/sntp-opts.texi@1.51 +1 -1 NTP_4_2_5P3 sntp/sntp.1@1.54 +2 -2 NTP_4_2_5P3 util/ntp-keygen-opts.c@1.54 +2 -2 NTP_4_2_5P3 util/ntp-keygen-opts.h@1.54 +3 -3 NTP_4_2_5P3 util/ntp-keygen-opts.texi@1.52 +2 -2 NTP_4_2_5P3 util/ntp-keygen.1@1.52 +2 -2 NTP_4_2_5P3 ChangeSet@1.1440.1.20, 2007-01-23 06:44:39-05:00, stenn@whimsy.udel.edu [Bug 592] Trimble Thunderbolt GPS support. ChangeLog@1.6 +1 -0 [Bug 592] Trimble Thunderbolt GPS support. ChangeSet@1.1436.1.14, 2007-01-23 04:47:08-05:00, stenn@whimsy.udel.edu NTP_4_2_4_RC1 TAG: NTP_4_2_4_RC1 ntpd/ntpd-opts.c@1.50.1.1 +2 -2 NTP_4_2_4_RC1 ntpd/ntpd-opts.h@1.50.1.1 +3 -3 NTP_4_2_4_RC1 ntpd/ntpd-opts.texi@1.49.1.1 +2 -2 NTP_4_2_4_RC1 ntpd/ntpd.1@1.48.1.1 +2 -2 NTP_4_2_4_RC1 ntpd/ntpdsim-opts.c@1.50.1.1 +2 -2 NTP_4_2_4_RC1 ntpd/ntpdsim-opts.h@1.50.1.1 +3 -3 NTP_4_2_4_RC1 ntpd/ntpdsim-opts.texi@1.48.1.1 +1 -1 NTP_4_2_4_RC1 ntpd/ntpdsim.1@1.48.1.1 +2 -2 NTP_4_2_4_RC1 ntpdc/ntpdc-opts.c@1.50.1.1 +2 -2 NTP_4_2_4_RC1 ntpdc/ntpdc-opts.h@1.50.1.1 +3 -3 NTP_4_2_4_RC1 ntpdc/ntpdc-opts.texi@1.48.1.1 +2 -2 NTP_4_2_4_RC1 ntpdc/ntpdc.1@1.48.1.1 +2 -2 NTP_4_2_4_RC1 ntpq/ntpq-opts.c@1.52.1.1 +2 -2 NTP_4_2_4_RC1 ntpq/ntpq-opts.h@1.52.1.1 +3 -3 NTP_4_2_4_RC1 ntpq/ntpq-opts.texi@1.49.1.1 +2 -2 NTP_4_2_4_RC1 ntpq/ntpq.1@1.48.1.1 +2 -2 NTP_4_2_4_RC1 packageinfo.sh@1.65.2.1 +3 -3 NTP_4_2_4_RC1 sntp/sntp-opts.c@1.49.1.1 +2 -2 NTP_4_2_4_RC1 sntp/sntp-opts.h@1.49.1.1 +3 -3 NTP_4_2_4_RC1 sntp/sntp-opts.texi@1.46.1.1 +1 -1 NTP_4_2_4_RC1 sntp/sntp.1@1.49.1.1 +2 -2 NTP_4_2_4_RC1 util/ntp-keygen-opts.c@1.49.1.1 +2 -2 NTP_4_2_4_RC1 util/ntp-keygen-opts.h@1.49.1.1 +3 -3 NTP_4_2_4_RC1 util/ntp-keygen-opts.texi@1.47.1.1 +2 -2 NTP_4_2_4_RC1 util/ntp-keygen.1@1.47.1.1 +2 -2 NTP_4_2_4_RC1 ChangeSet@1.1440.1.18, 2007-01-22 01:53:23-05:00, fernandoph@pogo.udel.edu thunderbolt.jpg: BitKeeper file /pogo/users/fernandoph/ntp-dev-592/html/pic/thunderbolt.jpg html/pic/thunderbolt.jpg@1.1 +862 -0 BitKeeper file /pogo/users/fernandoph/ntp-dev-592/html/pic/thunderbolt.jpg html/pic/thunderbolt.jpg@1.0 +0 -0 ChangeSet@1.1440.1.17, 2007-01-22 01:28:51-05:00, fernandoph@pogo.udel.edu refclock_palisade.c, driver29.html, refclock_palisade.h: [BUG 592] Added support for Thunderbolt Receiver (mode 2). html/drivers/driver29.html@1.15 +319 -5 [BUG 592] Added support for Thunderbolt Receiver (mode 2). ntpd/refclock_palisade.c@1.20 +325 -9 [BUG 592] Added support for Thunderbolt Receiver (mode 2). ntpd/refclock_palisade.h@1.10 +29 -0 [BUG 592] Added support for Thunderbolt Receiver (mode 2). ChangeSet@1.1436.1.13, 2007-01-21 12:44:07-05:00, stenn@whimsy.udel.edu Danny fixed bug 360 in 4.2.2 ChangeLog@1.1.1.4 +1 -0 Danny fixed bug 360 in 4.2.2 ChangeSet@1.1436.1.12, 2007-01-21 12:40:23-05:00, stenn@whimsy.udel.edu Danny fixed bug 239 in 4.2.2 ChangeLog@1.1.1.3 +2 -0 Danny fixed bug 239 in 4.2.2 ChangeSet@1.1436.1.11, 2007-01-21 12:33:46-05:00, stenn@pogo.udel.edu Added bug 760 description to the ChangeLog ChangeLog@1.1.1.2 +1 -0 Added bug 760 description to the ChangeLog ChangeSet@1.1436.1.10, 2007-01-21 12:28:04-05:00, stenn@pogo.udel.edu Update the ChangeLog ChangeLog@1.1.1.1 +3 -0 Update the ChangeLog ChangeSet@1.1440.1.15, 2007-01-21 02:51:30-05:00, stenn@whimsy.udel.edu CHU, IRIG, and WWV refclock improvements from Dave Mills. ChangeLog@1.4 +1 -0 CHU, IRIG, and WWV refclock improvements from Dave Mills. html/drivers/driver36.html@1.30 +35 -46 CHU, IRIG, and WWV refclock improvements from Dave Mills. html/drivers/driver6.html@1.22 +18 -18 CHU, IRIG, and WWV refclock improvements from Dave Mills. html/drivers/driver7.html@1.24 +78 -141 CHU, IRIG, and WWV refclock improvements from Dave Mills. ntpd/refclock_chu.c@1.42 +168 -225 CHU, IRIG, and WWV refclock improvements from Dave Mills. ntpd/refclock_irig.c@1.27 +90 -146 CHU, IRIG, and WWV refclock improvements from Dave Mills. ChangeSet@1.1436.1.9, 2007-01-21 07:49:58+00:00, kardel@pogo.udel.edu ntp_io.c: pick the right type for the recv*() length argument (use GETSOCKNAME_SOCKLEN_TYPE config.h define) ntpd/ntp_io.c@1.244.2.1 +1 -1 pick the right type for the recv*() length argument (use GETSOCKNAME_SOCKLEN_TYPE config.h define) ChangeSet@1.1436.1.8, 2007-01-20 14:38:38+00:00, kardel@pogo.udel.edu confopt.html: move description for "dynamic" keyword into the right section html/confopt.html@1.35 +4 -3 move description for "dynamic" keyword into the right section ChangeSet@1.1440.1.14, 2007-01-16 03:45:54-05:00, stenn@pogo.udel.edu AC_PROG_CC_C_O -> AM_PROG_CC_C_O for automake upgrade configure.ac@1.404 +1 -1 AC_PROG_CC_C_O -> AM_PROG_CC_C_O for automake upgrade ChangeSet@1.1447.1.1, 2007-01-16 02:20:41-05:00, skamboj@ferrari.local ntp_control.c: Added configure prototype ntp_control.h: Added opcode for configure. rsa_md5.h: Removed double bracket include/ntp_control.h@1.30 +1 -0 Added opcode for configure. include/rsa_md5.h@1.5.1.1 +3 -3 Removed double bracket ntpd/ntp_control.c@1.88.1.2 +1 -0 Added configure prototype ChangeSet@1.1442.1.1, 2007-01-16 00:27:25-05:00, skamboj@ferrari.local This changeset should now contain the remainder of the changes needed to incorporate the change in the configuration and simulator code. include/ntp_config.h@1.42 +138 -164 Updated ntp_config.c to use a phrase structure grammar include/ntpsim.h@1.5.1.1 +112 -61 Replaced the simulator code to allow the use of multiple servers libntp/systime.c@1.39 +3 -177 Removed the code needed by the simulator and added it to ntpsim.c, where IMHO, it rightfully belonged. ntpd/cmd_args.c@1.45.1.1 +5 -28 Removed command line arguments from the simulator code ntpd/ntp_config.c@1.142.1.1 +1821 -1835 Updated ntp_config.c to use a phrase structure grammar ntpd/ntp_control.c@1.87.1.1 +54 -0 Added a configure option to allow remote configuration of NTP through the use of ntpq ntpd/ntp_io.c@1.244.1.1 +1 -1 Changed the line of code that sent a packet to the simulator. ntpd/ntpsim.c@1.13.1.1 +573 -322 Replaced the simulator code to allow the use of multiple servers ntpq/ntpq-subs.c@1.25.1.1 +90 -0 Added a configure option to allow remote configuration of NTP through the use of ntpq ntpq/ntpq.c@1.65.1.1 +20 -3 Modified tokenize to allow the use of a quoted string. Needed by the new configure command. ChangeSet@1.1436.1.7, 2007-01-14 08:46:00+00:00, kardel@pogo.udel.edu parse.h: Bug 753: make union timestamp anonymous (Philip Prindeville) now there are OSes that claim that name in netinet/ip.h... include/parse.h@1.7.1.1 +8 -4 Bug 753: make union timestamp anonymous (Philip Prindeville) now there are OSes that claim that name in netinet/ip.h... ChangeSet@1.1436.1.6, 2007-01-13 11:36:29+00:00, kardel@pogo.udel.edu ntp_intres.c: support dynamic keyword ntpd/ntp_intres.c@1.48.1.1 +3 -1 support dynamic keyword ChangeSet@1.1440.1.13, 2007-01-08 06:01:47-05:00, stenn@whimsy.udel.edu NTP_4_2_5P2 TAG: NTP_4_2_5P2 ntpd/ntpd-opts.c@1.53 +2 -2 NTP_4_2_5P2 ntpd/ntpd-opts.h@1.53 +3 -3 NTP_4_2_5P2 ntpd/ntpd-opts.texi@1.52 +1 -1 NTP_4_2_5P2 ntpd/ntpd.1@1.51 +2 -2 NTP_4_2_5P2 ntpd/ntpdsim-opts.c@1.53 +2 -2 NTP_4_2_5P2 ntpd/ntpdsim-opts.h@1.53 +3 -3 NTP_4_2_5P2 ntpd/ntpdsim-opts.texi@1.51 +1 -1 NTP_4_2_5P2 ntpd/ntpdsim.1@1.51 +2 -2 NTP_4_2_5P2 ntpdc/ntpdc-opts.c@1.53 +2 -2 NTP_4_2_5P2 ntpdc/ntpdc-opts.h@1.53 +3 -3 NTP_4_2_5P2 ntpdc/ntpdc-opts.texi@1.51 +1 -1 NTP_4_2_5P2 ntpdc/ntpdc.1@1.51 +2 -2 NTP_4_2_5P2 ntpq/ntpq-opts.c@1.55 +2 -2 NTP_4_2_5P2 ntpq/ntpq-opts.h@1.55 +3 -3 NTP_4_2_5P2 ntpq/ntpq-opts.texi@1.52 +1 -1 NTP_4_2_5P2 ntpq/ntpq.1@1.51 +2 -2 NTP_4_2_5P2 packageinfo.sh@1.5 +1 -1 NTP_4_2_5P2 sntp/sntp-opts.c@1.52 +2 -2 NTP_4_2_5P2 sntp/sntp-opts.h@1.52 +3 -3 NTP_4_2_5P2 sntp/sntp-opts.texi@1.49 +1 -1 NTP_4_2_5P2 sntp/sntp.1@1.52 +2 -2 NTP_4_2_5P2 util/ntp-keygen-opts.c@1.52 +2 -2 NTP_4_2_5P2 util/ntp-keygen-opts.h@1.52 +3 -3 NTP_4_2_5P2 util/ntp-keygen-opts.texi@1.50 +1 -1 NTP_4_2_5P2 util/ntp-keygen.1@1.50 +2 -2 NTP_4_2_5P2 ChangeSet@1.1436.1.5, 2007-01-06 18:24:18-05:00, stenn@whimsy.udel.edu Updated copyright year html/copyright.html@1.36 +2 -2 Updated copyright year ChangeSet@1.1440.1.11, 2007-01-06 16:09:45-05:00, stenn@whimsy.udel.edu Documentation updates html/audio.html@1.18 +32 -24 Documentation updates html/drivers/driver36.html@1.29 +20 -14 Documentation updates html/drivers/driver6.html@1.21 +6 -9 Documentation updates html/drivers/driver7.html@1.23 +19 -31 Documentation updates html/pic/description.jpg@1.1 +761 -0 BitKeeper file /deacon/backroom/ntp-dev/html/pic/description.jpg html/pic/description.jpg@1.0 +0 -0 html/pic/freq1211.gif@1.1 +255 -0 BitKeeper file /deacon/backroom/ntp-dev/html/pic/freq1211.gif html/pic/freq1211.gif@1.0 +0 -0 html/pic/offset1211.gif@1.1 +568 -0 BitKeeper file /deacon/backroom/ntp-dev/html/pic/offset1211.gif html/pic/offset1211.gif@1.0 +0 -0 html/pic/pzf509.jpg@1.1 +291 -0 BitKeeper file /deacon/backroom/ntp-dev/html/pic/pzf509.jpg html/pic/pzf509.jpg@1.0 +0 -0 ChangeSet@1.1440.1.10, 2007-01-06 05:35:24-05:00, stenn@whimsy.udel.edu NTP_4_2_5P1 TAG: NTP_4_2_5P1 ntpd/ntpd-opts.c@1.52 +2 -2 NTP_4_2_5P1 ntpd/ntpd-opts.h@1.52 +3 -3 NTP_4_2_5P1 ntpd/ntpd-opts.texi@1.51 +1 -1 NTP_4_2_5P1 ntpd/ntpd.1@1.50 +2 -2 NTP_4_2_5P1 ntpd/ntpdsim-opts.c@1.52 +2 -2 NTP_4_2_5P1 ntpd/ntpdsim-opts.h@1.52 +3 -3 NTP_4_2_5P1 ntpd/ntpdsim-opts.texi@1.50 +1 -1 NTP_4_2_5P1 ntpd/ntpdsim.1@1.50 +2 -2 NTP_4_2_5P1 ntpdc/ntpdc-opts.c@1.52 +2 -2 NTP_4_2_5P1 ntpdc/ntpdc-opts.h@1.52 +3 -3 NTP_4_2_5P1 ntpdc/ntpdc-opts.texi@1.50 +1 -1 NTP_4_2_5P1 ntpdc/ntpdc.1@1.50 +2 -2 NTP_4_2_5P1 ntpq/ntpq-opts.c@1.54 +2 -2 NTP_4_2_5P1 ntpq/ntpq-opts.h@1.54 +3 -3 NTP_4_2_5P1 ntpq/ntpq-opts.texi@1.51 +1 -1 NTP_4_2_5P1 ntpq/ntpq.1@1.50 +2 -2 NTP_4_2_5P1 packageinfo.sh@1.4 +1 -1 NTP_4_2_5P1 sntp/sntp-opts.c@1.51 +2 -2 NTP_4_2_5P1 sntp/sntp-opts.h@1.51 +3 -3 NTP_4_2_5P1 sntp/sntp-opts.texi@1.48 +1 -1 NTP_4_2_5P1 sntp/sntp.1@1.51 +2 -2 NTP_4_2_5P1 util/ntp-keygen-opts.c@1.51 +2 -2 NTP_4_2_5P1 util/ntp-keygen-opts.h@1.51 +3 -3 NTP_4_2_5P1 util/ntp-keygen-opts.texi@1.49 +1 -1 NTP_4_2_5P1 util/ntp-keygen.1@1.49 +2 -2 NTP_4_2_5P1 ChangeSet@1.1440.1.9, 2007-01-06 04:40:47-05:00, stenn@whimsy.udel.edu refclock_chu.c changes from Dave Mills ntpd/refclock_chu.c@1.41 +224 -142 refclock_chu.c changes from Dave Mills ChangeSet@1.1440.1.8, 2007-01-06 04:05:36-05:00, stenn@whimsy.udel.edu [Bug 757] Lose ULONG_CONST() BitKeeper/deleted/.del-hs_ulong_const.m4@1.3 +0 -0 Delete: m4/hs_ulong_const.m4 ChangeLog@1.3 +1 -0 [Bug 757] Lose ULONG_CONST() configure.ac@1.403 +0 -2 [Bug 757] Lose ULONG_CONST() libparse/gpstolfp.c@1.9 +1 -1 [Bug 757] Lose ULONG_CONST() ntpd/ntp_control.c@1.89 +2 -2 [Bug 757] Lose ULONG_CONST() util/ntp-keygen.c@1.39 +1 -1 [Bug 757] Lose ULONG_CONST() ChangeSet@1.1440.1.7, 2007-01-06 03:25:15-05:00, stenn@whimsy.udel.edu [Bug 756] Require function prototypes configure.ac@1.402 +2 -32 [Bug 756] Require function prototypes include/ntp_rfc2553.h@1.29 +6 -6 [Bug 756] Require function prototypes include/ntp_select.h@1.3 +2 -2 [Bug 756] Require function prototypes include/ntp_syscall.h@1.7 +1 -1 [Bug 756] Require function prototypes include/rsa_md5.h@1.6 +3 -4 [Bug 756] Require function prototypes libntp/audio.c@1.25 +2 -2 [Bug 756] Require function prototypes libntp/md5c.c@1.8 +5 -7 [Bug 756] Require function prototypes libntp/syssignal.c@1.9 +1 -1 [Bug 756] Require function prototypes libparse/clk_wharton.c@1.7 +1 -1 [Bug 756] Require function prototypes libparse/parsestreams.c@1.7 +23 -23 [Bug 756] Require function prototypes ntpd/refclock_ripencc.c@1.7 +21 -21 [Bug 756] Require function prototypes ntpd/refclock_tpro.c@1.9 +3 -3 [Bug 756] Require function prototypes ntpd/refclock_tt560.c@1.2 +3 -3 [Bug 756] Require function prototypes sntp/configure.ac@1.16 +1 -1 [Bug 756] Require function prototypes util/hist.c@1.7 +1 -1 [Bug 756] Require function prototypes util/jitter.h@1.3 +16 -16 [Bug 756] Require function prototypes util/tickadj.c@1.7 +4 -4 [Bug 756] Require function prototypes ChangeSet@1.1440.1.6, 2007-01-05 00:41:52-05:00, stenn@whimsy.udel.edu Add in ntp-dev updates to the new ChangeLog ChangeLog@1.2 +3 -0 Add in ntp-dev updates to the new ChangeLog ChangeSet@1.1436.1.4, 2007-01-05 00:27:33-05:00, stenn@whimsy.udel.edu ChangeLog->CommitLog, NEWS->ChangeLog, Release Info->NEWS ChangeLog@1.1 +260 -0 BitKeeper file /deacon/backroom/ntp-stable/ChangeLog ChangeLog@1.0 +0 -0 CommitLog-4.1.0@1.592 +0 -0 Rename: ChangeLog-4.1.0 -> CommitLog-4.1.0 Makefile.am@1.70.1.1 +2 -1 ChangeLog->CommitLog, NEWS->ChangeLog, Release Info->NEWS NEWS@1.86.1.1 +14 -256 ChangeLog->CommitLog, NEWS->ChangeLog, Release Info->NEWS ChangeSet@1.1436.1.3, 2007-01-04 23:41:02-05:00, stenn@whimsy.udel.edu ChangeLog->CommitLog in the ignore file BitKeeper/etc/ignore@1.59 +1 -2 ChangeLog->CommitLog in the ignore file ChangeSet@1.1436.1.2, 2007-01-04 19:31:07-05:00, stenn@whimsy.udel.edu hostname updates for flock-build flock-build@1.39 +15 -19 hostname updates for flock-build ChangeSet@1.1445, 2007-01-04 01:22:19-05:00, stenn@pogo.udel.edu What about ntpdsim.1? ntpd/Makefile.am@1.55 +2 -0 What about ntpdsim.1? ChangeSet@1.1443, 2007-01-03 19:12:30-05:00, stenn@pogo.udel.edu ntpdsim no longer needs special command-line options NEWS@1.87.1.1 +2 -0 ntpdsim no longer needs special command-line options ntpd/Makefile.am@1.52.1.1 +3 -19 ntpdsim no longer needs special command-line options ntpd/cmd_args.c@1.46 +2 -9 ntpdsim no longer needs special command-line options ntpd/ntpd.c@1.82.1.1 +2 -7 ntpdsim no longer needs special command-line options ntpd/ntpsim.c@1.14 +3 -3 ntpdsim no longer needs special command-line options ChangeSet@1.1440.1.1, 2007-01-03 16:46:18-05:00, stenn@whimsy.udel.edu CHU and IRIG changes from Dave Mills ntpd/refclock_chu.c@1.38.1.1 +163 -230 CHU and IRIG changes from Dave Mills ntpd/refclock_irig.c@1.24.1.1 +7 -6 CHU and IRIG changes from Dave Mills ChangeSet@1.1439.1.1, 2007-01-03 16:41:43-05:00, stenn@pogo.udel.edu [Bug 756] Require ANSI C (function prototypes) Makefile.am@1.71 +1 -1 [Bug 756] Require ANSI C (function prototypes) NEWS@1.88 +1 -0 [Bug 756] Require ANSI C (function prototypes) adjtimed/Makefile.am@1.4 +1 -1 [Bug 756] Require ANSI C (function prototypes) arlib/Makefile.am@1.3 +1 -1 [Bug 756] Require ANSI C (function prototypes) clockstuff/Makefile.am@1.6 +1 -1 [Bug 756] Require ANSI C (function prototypes) configure.ac@1.401 +4 -2 [Bug 756] Require ANSI C. For Solaris, lose -D_XOPEN_SOURCE=500 as that conflicts with recent ANSI/POSIX stuff include/Makefile.am@1.25 +1 -1 [Bug 756] Require ANSI C (function prototypes) include/audio.h@1.7 +3 -3 [Bug 756] Require ANSI C (function prototypes) include/binio.h@1.5 +8 -8 [Bug 756] Require ANSI C (function prototypes) include/global.h@1.4 +0 -19 [Bug 756] Require ANSI C (function prototypes) include/icom.h@1.5 +2 -2 [Bug 756] Require ANSI C (function prototypes) include/ieee754io.h@1.5 +2 -2 [Bug 756] Require ANSI C (function prototypes) include/iosignal.h@1.3 +6 -6 [Bug 756] Require ANSI C (function prototypes) include/isc/Makefile.am@1.5 +1 -1 [Bug 756] Require ANSI C (function prototypes) include/l_stdlib.h@1.16 +67 -332 [Bug 756] Require ANSI C (function prototypes) include/mbg_gps166.h@1.9 +24 -24 [Bug 756] Require ANSI C (function prototypes) include/ntp.h@1.130 +1 -1 [Bug 756] Require ANSI C (function prototypes) include/ntp_calendar.h@1.3 +3 -3 [Bug 756] Require ANSI C (function prototypes) include/ntp_cmdargs.h@1.5 +2 -2 [Bug 756] Require ANSI C (function prototypes) include/ntp_filegen.h@1.4 +4 -4 [Bug 756] Require ANSI C (function prototypes) include/ntp_fp.h@1.13 +17 -17 [Bug 756] Require ANSI C (function prototypes) include/ntp_machine.h@1.24 +11 -23 [Bug 756] Require ANSI C (function prototypes) include/ntp_random.h@1.2 +6 -6 [Bug 756] Require ANSI C (function prototypes) include/ntp_refclock.h@1.21 +28 -28 [Bug 756] Require ANSI C (function prototypes) include/ntp_stdlib.h@1.25 +64 -70 [Bug 756] Require ANSI C (function prototypes) include/ntp_string.h@1.3 +1 -1 [Bug 756] Require ANSI C (function prototypes) include/ntp_types.h@1.9 +0 -11 [Bug 756] Require ANSI C (function prototypes) include/ntp_unixtime.h@1.5 +2 -2 [Bug 756] Require ANSI C (function prototypes) include/ntpd.h@1.99 +120 -120 [Bug 756] Require ANSI C (function prototypes) include/ntpsim.h@1.6 +16 -16 [Bug 756] Require ANSI C (function prototypes) include/parse.h@1.8 +32 -32 [Bug 756] Require ANSI C (function prototypes) include/recvbuff.h@1.12 +13 -13 [Bug 756] Require ANSI C (function prototypes) include/trimble.h@1.5 +1 -1 [Bug 756] Require ANSI C (function prototypes) kernel/Makefile.am@1.3 +1 -1 [Bug 756] Require ANSI C (function prototypes) kernel/sys/Makefile.am@1.4 +1 -1 [Bug 756] Require ANSI C (function prototypes) libntp/Makefile.am@1.38 +1 -1 [Bug 756] Require ANSI C (function prototypes) libntp/authreadkeys.c@1.7 +1 -1 [Bug 756] Require ANSI C (function prototypes) libntp/icom.c@1.11 +1 -1 [Bug 756] Require ANSI C (function prototypes) libntp/iosignal.c@1.14 +1 -1 [Bug 756] Require ANSI C (function prototypes) libntp/msyslog.c@1.20 +2 -2 [Bug 756] Require ANSI C (function prototypes) libntp/ntp_random.c@1.6 +1 -1 [Bug 756] Require ANSI C (function prototypes) libntp/statestr.c@1.11 +2 -2 [Bug 756] Require ANSI C (function prototypes) libparse/Makefile.am@1.9 +1 -1 [Bug 756] Require ANSI C (function prototypes) libparse/clk_computime.c@1.9 +3 -3 [Bug 756] Require ANSI C (function prototypes) libparse/clk_dcf7000.c@1.9 +3 -3 [Bug 756] Require ANSI C (function prototypes) libparse/clk_hopf6021.c@1.9 +3 -3 [Bug 756] Require ANSI C (function prototypes) libparse/clk_meinberg.c@1.10 +4 -4 [Bug 756] Require ANSI C (function prototypes) libparse/clk_rawdcf.c@1.15 +3 -3 [Bug 756] Require ANSI C (function prototypes) libparse/clk_rcc8000.c@1.9 +3 -3 [Bug 756] Require ANSI C (function prototypes) libparse/clk_schmid.c@1.9 +3 -3 [Bug 756] Require ANSI C (function prototypes) libparse/clk_trimtaip.c@1.9 +3 -3 [Bug 756] Require ANSI C (function prototypes) libparse/clk_trimtsip.c@1.9 +2 -2 [Bug 756] Require ANSI C (function prototypes) libparse/clk_varitext.c@1.8 +3 -3 [Bug 756] Require ANSI C (function prototypes) libparse/data_mbg.c@1.9 +2 -2 [Bug 756] Require ANSI C (function prototypes) libparse/ieee754io.c@1.9 +2 -2 [Bug 756] Require ANSI C (function prototypes) libparse/parse.c@1.12 +1 -1 [Bug 756] Require ANSI C (function prototypes) libparse/parsesolaris.c@1.7 +13 -13 [Bug 756] Require ANSI C (function prototypes) m4/hs_ulong_const.m4@1.2 +1 -9 [Bug 756] Require ANSI C (function prototypes) m4/os_cflags.m4@1.3 +8 -5 Upgraded to the latest version from am-utils ntpd/Makefile.am@1.53 +1 -1 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_config.c@1.143 +15 -15 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_control.c@1.88 +31 -31 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_crypto.c@1.108 +25 -25 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_filegen.c@1.12 +4 -4 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_intres.c@1.49 +12 -12 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_io.c@1.245 +35 -35 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_loopfilter.c@1.129 +2 -2 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_monitor.c@1.19 +2 -2 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_peer.c@1.98 +2 -2 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_proto.c@1.250 +8 -8 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_refclock.c@1.76 +3 -3 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_request.c@1.66 +50 -50 [Bug 756] Require ANSI C (function prototypes) ntpd/ntp_timer.c@1.34 +1 -1 [Bug 756] Require ANSI C (function prototypes) ntpd/ntpd.c@1.83 +9 -9 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_acts.c@1.29 +9 -9 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_arbiter.c@1.14 +4 -4 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_arc.c@1.19 +7 -7 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_as2201.c@1.10 +4 -4 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_atom.c@1.55 +7 -7 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_chronolog.c@1.7 +4 -4 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_chu.c@1.39 +17 -17 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_datum.c@1.10 +8 -8 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_dumbclock.c@1.9 +4 -4 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_fg.c@1.11 +5 -5 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_heath.c@1.14 +4 -4 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_hopfser.c@1.10 +5 -5 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_hpgps.c@1.8 +4 -4 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_irig.c@1.25 +8 -8 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_jjy.c@1.14 +10 -10 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_jupiter.c@1.21 +19 -19 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_leitch.c@1.9 +11 -11 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_local.c@1.16 +2 -2 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_mx4200.c@1.23 +16 -16 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_neoclock4x.c@1.16 +12 -12 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_nmea.c@1.26 +10 -10 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_oncore.c@1.61 +48 -48 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_palisade.c@1.19 +1 -1 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_palisade.h@1.9 +11 -11 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_parse.c@1.48 +67 -67 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_pcf.c@1.8 +3 -3 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_pst.c@1.9 +4 -4 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_true.c@1.10 +7 -7 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_ulink.c@1.14 +4 -4 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_wwv.c@1.68 +21 -21 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_wwvb.c@1.17 +5 -5 [Bug 756] Require ANSI C (function prototypes) ntpd/refclock_zyfer.c@1.5 +4 -4 [Bug 756] Require ANSI C (function prototypes) ntpdate/Makefile.am@1.15 +1 -1 [Bug 756] Require ANSI C (function prototypes) ntpdate/ntpdate.c@1.60 +19 -19 [Bug 756] Require ANSI C (function prototypes) ntpdate/ntpdate.h@1.8 +1 -1 [Bug 756] Require ANSI C (function prototypes) ntpdc/Makefile.am@1.34 +1 -1 [Bug 756] Require ANSI C (function prototypes) ntpdc/ntpdc.c@1.55 +30 -30 [Bug 756] Require ANSI C (function prototypes) ntpdc/ntpdc.h@1.8 +3 -3 [Bug 756] Require ANSI C (function prototypes) ntpdc/ntpdc_ops.c@1.47 +53 -53 [Bug 756] Require ANSI C (function prototypes) ntpq/Makefile.am@1.26 +1 -1 [Bug 756] Require ANSI C (function prototypes) ntpq/ntpq-subs.c@1.26 +41 -41 [Bug 756] Require ANSI C (function prototypes) ntpq/ntpq.c@1.66 +46 -46 [Bug 756] Require ANSI C (function prototypes) ntpq/ntpq.h@1.6 +13 -13 [Bug 756] Require ANSI C (function prototypes) parseutil/Makefile.am@1.7 +1 -1 [Bug 756] Require ANSI C (function prototypes) parseutil/dcfd.c@1.20 +1 -1 [Bug 756] Require ANSI C (function prototypes) util/Makefile.am@1.35 +1 -1 [Bug 756] Require ANSI C (function prototypes) util/jitter.h@1.2 +0 -11 [Bug 756] Require ANSI C (function prototypes) util/ntp-keygen.c@1.38 +14 -14 [Bug 756] Require ANSI C (function prototypes) util/ntptime.c@1.20 +3 -3 [Bug 756] Require ANSI C (function prototypes) ChangeSet@1.1442, 2007-01-02 23:16:36-05:00, skamboj@ferrari.local ntp_config.y: New BitKeeper file ``ntpd/ntp_config.y'' ntpd/ntp_config.y@1.1 +917 -0 New BitKeeper file ``ntpd/ntp_config.y'' ntpd/ntp_config.y@1.0 +0 -0 ChangeSet@1.1441, 2007-01-02 23:14:13-05:00, skamboj@ferrari.local Added code for: 1. A phrase-structure grammar based NTP configuration file parser 2. A multi-server NTP simulator include/ntp_data_structures.h@1.1 +47 -0 New BitKeeper file ``include/ntp_data_structures.h'' include/ntp_data_structures.h@1.0 +0 -0 ntpd/ntp_config.tab.c@1.1 +2351 -0 New BitKeeper file ``ntpd/ntp_config.tab.c'' ntpd/ntp_config.tab.c@1.0 +0 -0 ntpd/ntp_data_structures.c@1.1 +170 -0 New BitKeeper file ``ntpd/ntp_data_structures.c'' ntpd/ntp_data_structures.c@1.0 +0 -0 ntpd/ntp_scanner.c@1.1 +638 -0 New BitKeeper file ``ntpd/ntp_scanner.c'' ntpd/ntp_scanner.c@1.0 +0 -0 ChangeSet@1.1440, 2006-12-29 06:43:02-05:00, stenn@whimsy.udel.edu NTP_4_2_5P0 TAG: NTP_4_2_5P0 ntpd/ntpd-opts.c@1.49.1.2 +2 -2 NTP_4_2_5P0 ntpd/ntpd-opts.h@1.49.1.2 +3 -3 NTP_4_2_5P0 ntpd/ntpd-opts.texi@1.48.1.2 +1 -1 NTP_4_2_5P0 ntpd/ntpd.1@1.47.1.2 +2 -2 NTP_4_2_5P0 ntpd/ntpdsim-opts.c@1.49.1.2 +2 -2 NTP_4_2_5P0 ntpd/ntpdsim-opts.h@1.49.1.2 +3 -3 NTP_4_2_5P0 ntpd/ntpdsim-opts.texi@1.47.1.2 +1 -1 NTP_4_2_5P0 ntpd/ntpdsim.1@1.47.1.2 +2 -2 NTP_4_2_5P0 ntpdc/ntpdc-opts.c@1.49.1.2 +2 -2 NTP_4_2_5P0 ntpdc/ntpdc-opts.h@1.49.1.2 +3 -3 NTP_4_2_5P0 ntpdc/ntpdc-opts.texi@1.47.1.2 +1 -1 NTP_4_2_5P0 ntpdc/ntpdc.1@1.47.1.2 +2 -2 NTP_4_2_5P0 ntpq/ntpq-opts.c@1.51.1.2 +2 -2 NTP_4_2_5P0 ntpq/ntpq-opts.h@1.51.1.2 +3 -3 NTP_4_2_5P0 ntpq/ntpq-opts.texi@1.48.1.2 +1 -1 NTP_4_2_5P0 ntpq/ntpq.1@1.47.1.2 +2 -2 NTP_4_2_5P0 packageinfo.sh@1.3 +1 -1 NTP_4_2_5P0 sntp/sntp-opts.c@1.48.1.2 +2 -2 NTP_4_2_5P0 sntp/sntp-opts.h@1.48.1.2 +3 -3 NTP_4_2_5P0 sntp/sntp-opts.texi@1.45.1.2 +1 -1 NTP_4_2_5P0 sntp/sntp.1@1.48.1.2 +2 -2 NTP_4_2_5P0 util/ntp-keygen-opts.c@1.48.1.2 +2 -2 NTP_4_2_5P0 util/ntp-keygen-opts.h@1.48.1.2 +3 -3 NTP_4_2_5P0 util/ntp-keygen-opts.texi@1.46.1.2 +1 -1 NTP_4_2_5P0 util/ntp-keygen.1@1.46.1.2 +2 -2 NTP_4_2_5P0 ChangeSet@1.1439, 2006-12-28 22:56:08-05:00, stenn@whimsy.udel.edu codec (audio) and ICOM changes from Dave Mills NEWS@1.87 +2 -0 codec (audio) and ICOM changes from Dave Mills include/ntp.h@1.129 +1 -0 codec (audio) changes from Dave Mills include/ntp_config.h@1.41 +1 -0 codec (audio) changes from Dave Mills include/ntpd.h@1.98 +1 -0 codec (audio) changes from Dave Mills libntp/audio.c@1.24 +2 -1 codec (audio) and ICOM changes from Dave Mills libntp/icom.c@1.10 +33 -218 codec (audio) and ICOM changes from Dave Mills ntpd/ntp_config.c@1.142 +4 -0 codec (audio) and ICOM changes from Dave Mills ntpd/ntp_loopfilter.c@1.128 +5 -10 codec (audio) and ICOM changes from Dave Mills ntpd/refclock_irig.c@1.24 +1 -1 codec (audio) and ICOM changes from Dave Mills ntpd/refclock_wwv.c@1.67 +45 -54 codec (audio) and ICOM changes from Dave Mills ChangeSet@1.1438, 2006-12-28 21:29:25-05:00, stenn@whimsy.udel.edu NTP_4_2_5 TAG: NTP_4_2_5 ntpd/ntpd-opts.c@1.49.1.1 +2 -2 NTP_4_2_5 ntpd/ntpd-opts.h@1.49.1.1 +3 -3 NTP_4_2_5 ntpd/ntpd-opts.texi@1.48.1.1 +1 -1 NTP_4_2_5 ntpd/ntpd.1@1.47.1.1 +2 -2 NTP_4_2_5 ntpd/ntpdsim-opts.c@1.49.1.1 +2 -2 NTP_4_2_5 ntpd/ntpdsim-opts.h@1.49.1.1 +3 -3 NTP_4_2_5 ntpd/ntpdsim-opts.texi@1.47.1.1 +1 -1 NTP_4_2_5 ntpd/ntpdsim.1@1.47.1.1 +2 -2 NTP_4_2_5 ntpdc/ntpdc-opts.c@1.49.1.1 +2 -2 NTP_4_2_5 ntpdc/ntpdc-opts.h@1.49.1.1 +3 -3 NTP_4_2_5 ntpdc/ntpdc-opts.texi@1.47.1.1 +1 -1 NTP_4_2_5 ntpdc/ntpdc.1@1.47.1.1 +2 -2 NTP_4_2_5 ntpq/ntpq-opts.c@1.51.1.1 +2 -2 NTP_4_2_5 ntpq/ntpq-opts.h@1.51.1.1 +3 -3 NTP_4_2_5 ntpq/ntpq-opts.texi@1.48.1.1 +1 -1 NTP_4_2_5 ntpq/ntpq.1@1.47.1.1 +2 -2 NTP_4_2_5 packageinfo.sh@1.2 +1 -1 NTP_4_2_5 sntp/sntp-opts.c@1.48.1.1 +2 -2 NTP_4_2_5 sntp/sntp-opts.h@1.48.1.1 +3 -3 NTP_4_2_5 sntp/sntp-opts.texi@1.45.1.1 +1 -1 NTP_4_2_5 sntp/sntp.1@1.48.1.1 +2 -2 NTP_4_2_5 util/ntp-keygen-opts.c@1.48.1.1 +2 -2 NTP_4_2_5 util/ntp-keygen-opts.h@1.48.1.1 +3 -3 NTP_4_2_5 util/ntp-keygen-opts.texi@1.46.1.1 +1 -1 NTP_4_2_5 util/ntp-keygen.1@1.46.1.1 +2 -2 NTP_4_2_5 ChangeSet@1.1436.1.1, 2006-12-28 19:21:25-05:00, stenn@whimsy.udel.edu NTP_4_2_4 TAG: NTP_4_2_4 ntpd/ntpd-opts.c@1.50 +2 -2 NTP_4_2_4 ntpd/ntpd-opts.h@1.50 +3 -3 NTP_4_2_4 ntpd/ntpd-opts.texi@1.49 +2 -2 NTP_4_2_4 ntpd/ntpd.1@1.48 +2 -2 NTP_4_2_4 ntpd/ntpdsim-opts.c@1.50 +2 -2 NTP_4_2_4 ntpd/ntpdsim-opts.h@1.50 +3 -3 NTP_4_2_4 ntpd/ntpdsim-opts.texi@1.48 +1 -1 NTP_4_2_4 ntpd/ntpdsim.1@1.48 +2 -2 NTP_4_2_4 ntpdc/ntpdc-opts.c@1.50 +2 -2 NTP_4_2_4 ntpdc/ntpdc-opts.h@1.50 +3 -3 NTP_4_2_4 ntpdc/ntpdc-opts.texi@1.48 +2 -2 NTP_4_2_4 ntpdc/ntpdc.1@1.48 +2 -2 NTP_4_2_4 ntpq/ntpq-opts.c@1.52 +2 -2 NTP_4_2_4 ntpq/ntpq-opts.h@1.52 +3 -3 NTP_4_2_4 ntpq/ntpq-opts.texi@1.49 +2 -2 NTP_4_2_4 ntpq/ntpq.1@1.48 +2 -2 NTP_4_2_4 packageinfo.sh@1.65.1.1 +2 -2 NTP_4_2_4 sntp/sntp-opts.c@1.49 +2 -2 NTP_4_2_4 sntp/sntp-opts.h@1.49 +3 -3 NTP_4_2_4 sntp/sntp-opts.texi@1.46 +1 -1 NTP_4_2_4 sntp/sntp.1@1.49 +2 -2 NTP_4_2_4 util/ntp-keygen-opts.c@1.49 +2 -2 NTP_4_2_4 util/ntp-keygen-opts.h@1.49 +3 -3 NTP_4_2_4 util/ntp-keygen-opts.texi@1.47 +2 -2 NTP_4_2_4 util/ntp-keygen.1@1.47 +2 -2 NTP_4_2_4 ChangeSet@1.1435.1.1, 2006-12-28 03:20:53-05:00, stenn@whimsy.udel.edu ntp-4.2.5 BitKeeper/deleted/.del-packageinfo.sh~9547f70d1df81d4@1.64.1.1 +0 -0 Delete: packageinfo.sh packageinfo.sh@1.1 +28 -0 BitKeeper file /deacon/backroom/ntp-dev/packageinfo.sh packageinfo.sh@1.0 +0 -0 ChangeSet@1.1436, 2006-12-28 03:09:12-05:00, stenn@whimsy.udel.edu typo packageinfo.sh@1.65 +1 -1 typo ChangeSet@1.1435, 2006-12-27 21:17:55-05:00, stenn@whimsy.udel.edu updated backroom machine list br-flock@1.11 +1 -1 updated backroom machine list ChangeSet@1.1434, 2006-12-27 20:50:07-05:00, stenn@whimsy.udel.edu ntp-4.2.4 NEWS@1.86 +3 -2 ntp-4.2.4 packageinfo.sh@1.64 +7 -5 ntp-4.2.4 ChangeSet@1.1433, 2006-12-27 02:21:39-05:00, stenn@whimsy.udel.edu monopt.html fixes from Dave Mills. NEWS@1.85 +1 -0 monopt.html fixes from Dave Mills. html/monopt.html@1.23 +2 -2 monopt.html fixes from Dave Mills. ChangeSet@1.1432, 2006-12-27 01:57:20-05:00, stenn@whimsy.udel.edu [Bug 452] Do not report kernel PLL/FLL flips. NEWS@1.84 +1 -0 [Bug 452] Do not report kernel PLL/FLL flips. ntpd/ntp_loopfilter.c@1.127 +5 -7 [Bug 452] Do not report kernel PLL/FLL flips. ChangeSet@1.1431, 2006-12-27 01:45:38-05:00, stenn@whimsy.udel.edu [Bug 746] Expert mouseCLOCK USB v2.0 support added. NEWS@1.83 +1 -0 [Bug 746] Expert mouseCLOCK USB v2.0 support added. ChangeSet@1.1429, 2006-12-27 01:37:16-05:00, stenn@whimsy.udel.edu driver8.html updates from Martin Burnicki NEWS@1.82 +2 -1 driver8.html updates from Martin Burnicki ChangeSet@1.1426.2.1, 2006-12-27 01:22:30-05:00, stenn@whimsy.udel.edu [Bug 747] Drop tags from ntpdc.html NEWS@1.81 +1 -0 [Bug 747] Drop tags from ntpdc.html html/ntpdc.html@1.26 +3 -3 [Bug 747] Drop tags from ntpdc.html ChangeSet@1.1426.1.1, 2006-12-22 20:35:42+00:00, kardel@pogo.udel.edu driver8.html, refclock_parse.c: Bug 746 (RFE): add configuration for Expert mouseCLOCK USB v2.0 as mode 19 html/drivers/driver8.html@1.22.1.1 +5 -1 Bug 746 (RFE): add configuration for Expert mouseCLOCK USB v2.0 as mode 19 ntpd/refclock_parse.c@1.47 +34 -3 Bug 746 (RFE): add configuration for Expert mouseCLOCK USB v2.0 as mode 19 ChangeSet@1.1427, 2006-12-06 12:18:15+00:00, burnicki@pogo.udel.edu Updated Meinberg PZF509 to PZF511. Provided higher quality pictures with background color according to the web page. Removed borders around images. html/drivers/driver8.html@1.23 +5 -5 Removed borders around images. Updated Meinberg PZF509 to PZF511. html/pic/c51.jpg@1.2 +366 -228 Provided higher quality picture with background color according to the web page. html/pic/gps167.jpg@1.2 +347 -270 Provided higher quality picture with background color according to the web page. html/pic/pzf511.jpg@1.3 +453 -290 Provided higher quality picture with background color according to the web page. html/pic/pzf511.jpg@1.2 +0 -0 Rename: html/pic/pzf509.jpg -> html/pic/pzf511.jpg ChangeSet@1.1426, 2006-11-25 06:41:49-05:00, stenn@whimsy.udel.edu NTP_4_2_3P70_RC TAG: NTP_4_2_3P70_RC ntpd/ntpd-opts.c@1.49 +2 -2 NTP_4_2_3P70_RC ntpd/ntpd-opts.h@1.49 +3 -3 NTP_4_2_3P70_RC ntpd/ntpd-opts.texi@1.48 +1 -1 NTP_4_2_3P70_RC ntpd/ntpd.1@1.47 +2 -2 NTP_4_2_3P70_RC ntpd/ntpdsim-opts.c@1.49 +2 -2 NTP_4_2_3P70_RC ntpd/ntpdsim-opts.h@1.49 +3 -3 NTP_4_2_3P70_RC ntpd/ntpdsim-opts.texi@1.47 +1 -1 NTP_4_2_3P70_RC ntpd/ntpdsim.1@1.47 +2 -2 NTP_4_2_3P70_RC ntpdc/ntpdc-opts.c@1.49 +2 -2 NTP_4_2_3P70_RC ntpdc/ntpdc-opts.h@1.49 +3 -3 NTP_4_2_3P70_RC ntpdc/ntpdc-opts.texi@1.47 +1 -1 NTP_4_2_3P70_RC ntpdc/ntpdc.1@1.47 +2 -2 NTP_4_2_3P70_RC ntpq/ntpq-opts.c@1.51 +2 -2 NTP_4_2_3P70_RC ntpq/ntpq-opts.h@1.51 +3 -3 NTP_4_2_3P70_RC ntpq/ntpq-opts.texi@1.48 +1 -1 NTP_4_2_3P70_RC ntpq/ntpq.1@1.47 +2 -2 NTP_4_2_3P70_RC packageinfo.sh@1.63 +1 -1 NTP_4_2_3P70_RC sntp/sntp-opts.c@1.48 +2 -2 NTP_4_2_3P70_RC sntp/sntp-opts.h@1.48 +3 -3 NTP_4_2_3P70_RC sntp/sntp-opts.texi@1.45 +1 -1 NTP_4_2_3P70_RC sntp/sntp.1@1.48 +2 -2 NTP_4_2_3P70_RC util/ntp-keygen-opts.c@1.48 +2 -2 NTP_4_2_3P70_RC util/ntp-keygen-opts.h@1.48 +3 -3 NTP_4_2_3P70_RC util/ntp-keygen-opts.texi@1.46 +1 -1 NTP_4_2_3P70_RC util/ntp-keygen.1@1.46 +2 -2 NTP_4_2_3P70_RC ChangeSet@1.1425, 2006-11-25 02:31:59-05:00, stenn@whimsy.udel.edu sntp now uses the returned precision to control decimal places NEWS@1.80 +1 -0 sntp now uses the returned precision to control decimal places sntp/main.c@1.8 +29 -16 sntp now uses the returned precision to control decimal places ChangeSet@1.1424, 2006-11-24 06:42:33-05:00, stenn@whimsy.udel.edu NTP_4_2_3P69_RC TAG: NTP_4_2_3P69_RC ntpd/ntpd-opts.c@1.48 +2 -2 NTP_4_2_3P69_RC ntpd/ntpd-opts.h@1.48 +3 -3 NTP_4_2_3P69_RC ntpd/ntpd-opts.texi@1.47 +1 -1 NTP_4_2_3P69_RC ntpd/ntpd.1@1.46 +2 -2 NTP_4_2_3P69_RC ntpd/ntpdsim-opts.c@1.48 +2 -2 NTP_4_2_3P69_RC ntpd/ntpdsim-opts.h@1.48 +3 -3 NTP_4_2_3P69_RC ntpd/ntpdsim-opts.texi@1.46 +1 -1 NTP_4_2_3P69_RC ntpd/ntpdsim.1@1.46 +2 -2 NTP_4_2_3P69_RC ntpdc/ntpdc-opts.c@1.48 +2 -2 NTP_4_2_3P69_RC ntpdc/ntpdc-opts.h@1.48 +3 -3 NTP_4_2_3P69_RC ntpdc/ntpdc-opts.texi@1.46 +1 -1 NTP_4_2_3P69_RC ntpdc/ntpdc.1@1.46 +2 -2 NTP_4_2_3P69_RC ntpq/ntpq-opts.c@1.50 +2 -2 NTP_4_2_3P69_RC ntpq/ntpq-opts.h@1.50 +3 -3 NTP_4_2_3P69_RC ntpq/ntpq-opts.texi@1.47 +1 -1 NTP_4_2_3P69_RC ntpq/ntpq.1@1.46 +2 -2 NTP_4_2_3P69_RC packageinfo.sh@1.62 +1 -1 NTP_4_2_3P69_RC sntp/sntp-opts.c@1.47 +34 -13 NTP_4_2_3P69_RC sntp/sntp-opts.h@1.47 +21 -14 NTP_4_2_3P69_RC sntp/sntp-opts.texi@1.44 +9 -1 NTP_4_2_3P69_RC sntp/sntp.1@1.47 +8 -64 NTP_4_2_3P69_RC util/ntp-keygen-opts.c@1.47 +2 -2 NTP_4_2_3P69_RC util/ntp-keygen-opts.h@1.47 +3 -3 NTP_4_2_3P69_RC util/ntp-keygen-opts.texi@1.45 +1 -1 NTP_4_2_3P69_RC util/ntp-keygen.1@1.45 +2 -2 NTP_4_2_3P69_RC ChangeSet@1.1423, 2006-11-23 21:09:08-05:00, stenn@whimsy.udel.edu sntp -u will use an unprivileged port for its queries NEWS@1.79 +1 -0 sntp -u will use an unprivileged port for its queries sntp/main.c@1.7 +13 -2 sntp -u will use an unprivileged port for its queries sntp/sntp-opts.def@1.10 +10 -62 sntp -u will use an unprivileged port for its queries sntp/socket.c@1.8 +4 -2 sntp -u will use an unprivileged port for its queries ChangeSet@1.1422, 2006-11-22 06:42:29-05:00, stenn@whimsy.udel.edu NTP_4_2_3P68_RC TAG: NTP_4_2_3P68_RC ntpd/ntpd-opts.c@1.47 +2 -2 NTP_4_2_3P68_RC ntpd/ntpd-opts.h@1.47 +3 -3 NTP_4_2_3P68_RC ntpd/ntpd-opts.texi@1.46 +3 -3 NTP_4_2_3P68_RC ntpd/ntpd.1@1.45 +2 -2 NTP_4_2_3P68_RC ntpd/ntpdsim-opts.c@1.47 +2 -2 NTP_4_2_3P68_RC ntpd/ntpdsim-opts.h@1.47 +3 -3 NTP_4_2_3P68_RC ntpd/ntpdsim-opts.texi@1.45 +1 -1 NTP_4_2_3P68_RC ntpd/ntpdsim.1@1.45 +2 -2 NTP_4_2_3P68_RC ntpdc/ntpdc-opts.c@1.47 +2 -2 NTP_4_2_3P68_RC ntpdc/ntpdc-opts.h@1.47 +3 -3 NTP_4_2_3P68_RC ntpdc/ntpdc-opts.texi@1.45 +2 -2 NTP_4_2_3P68_RC ntpdc/ntpdc.1@1.45 +2 -2 NTP_4_2_3P68_RC ntpq/ntpq-opts.c@1.49 +2 -2 NTP_4_2_3P68_RC ntpq/ntpq-opts.h@1.49 +3 -3 NTP_4_2_3P68_RC ntpq/ntpq-opts.texi@1.46 +2 -2 NTP_4_2_3P68_RC ntpq/ntpq.1@1.45 +2 -2 NTP_4_2_3P68_RC packageinfo.sh@1.61 +1 -1 NTP_4_2_3P68_RC sntp/sntp-opts.c@1.46 +2 -2 NTP_4_2_3P68_RC sntp/sntp-opts.h@1.46 +3 -3 NTP_4_2_3P68_RC sntp/sntp-opts.texi@1.43 +1 -1 NTP_4_2_3P68_RC sntp/sntp.1@1.46 +2 -2 NTP_4_2_3P68_RC util/ntp-keygen-opts.c@1.46 +2 -2 NTP_4_2_3P68_RC util/ntp-keygen-opts.h@1.46 +3 -3 NTP_4_2_3P68_RC util/ntp-keygen-opts.texi@1.44 +2 -2 NTP_4_2_3P68_RC util/ntp-keygen.1@1.44 +2 -2 NTP_4_2_3P68_RC ChangeSet@1.1421, 2006-11-22 02:15:14-05:00, stenn@whimsy.udel.edu [Bug 741] 'burst' doesn't work with peers NEWS@1.78 +1 -0 [Bug 741] 'burst' doesn't work with !unfit peers ntpd/ntp_proto.c@1.249 +1 -1 [Bug 741] 'burst' doesn't work with !unfit peers ChangeSet@1.1420, 2006-11-21 23:53:23-05:00, stenn@whimsy.udel.edu [Bug 735] Fix a make/gmake VPATH issue on Solaris Makefile.am@1.70 +1 -1 [Bug 735] Fix a make/gmake VPATH issue on Solaris NEWS@1.77 +1 -0 [Bug 735] Fix a make/gmake VPATH issue on Solaris ChangeSet@1.1419, 2006-11-21 06:42:26-05:00, stenn@whimsy.udel.edu NTP_4_2_3P67_RC TAG: NTP_4_2_3P67_RC ntpd/ntpd-opts.c@1.46 +3 -4 NTP_4_2_3P67_RC ntpd/ntpd-opts.h@1.46 +3 -3 NTP_4_2_3P67_RC ntpd/ntpd-opts.texi@1.45 +1 -1 NTP_4_2_3P67_RC ntpd/ntpd.1@1.44 +3 -3 NTP_4_2_3P67_RC ntpd/ntpdsim-opts.c@1.46 +3 -4 NTP_4_2_3P67_RC ntpd/ntpdsim-opts.h@1.46 +3 -3 NTP_4_2_3P67_RC ntpd/ntpdsim-opts.texi@1.44 +1 -1 NTP_4_2_3P67_RC ntpd/ntpdsim.1@1.44 +3 -3 NTP_4_2_3P67_RC ntpdc/ntpdc-opts.c@1.46 +2 -2 NTP_4_2_3P67_RC ntpdc/ntpdc-opts.h@1.46 +3 -3 NTP_4_2_3P67_RC ntpdc/ntpdc-opts.texi@1.44 +1 -1 NTP_4_2_3P67_RC ntpdc/ntpdc.1@1.44 +2 -2 NTP_4_2_3P67_RC ntpq/ntpq-opts.c@1.48 +2 -2 NTP_4_2_3P67_RC ntpq/ntpq-opts.h@1.48 +3 -3 NTP_4_2_3P67_RC ntpq/ntpq-opts.texi@1.45 +1 -1 NTP_4_2_3P67_RC ntpq/ntpq.1@1.44 +2 -2 NTP_4_2_3P67_RC packageinfo.sh@1.60 +1 -1 NTP_4_2_3P67_RC sntp/sntp-opts.c@1.45 +2 -2 NTP_4_2_3P67_RC sntp/sntp-opts.h@1.45 +3 -3 NTP_4_2_3P67_RC sntp/sntp-opts.texi@1.42 +1 -1 NTP_4_2_3P67_RC sntp/sntp.1@1.45 +2 -2 NTP_4_2_3P67_RC util/ntp-keygen-opts.c@1.45 +2 -2 NTP_4_2_3P67_RC util/ntp-keygen-opts.h@1.45 +3 -3 NTP_4_2_3P67_RC util/ntp-keygen-opts.texi@1.43 +1 -1 NTP_4_2_3P67_RC util/ntp-keygen.1@1.43 +2 -2 NTP_4_2_3P67_RC ChangeSet@1.1418, 2006-11-21 09:35:31+00:00, burnicki@pogo.udel.edu Fixed an uppercase typo. html/drivers/driver8.html@1.22 +1 -1 Fixed an uppercase typo. ChangeSet@1.1417, 2006-11-21 02:43:36-05:00, stenn@whimsy.udel.edu [Bug 717] Make sure sntp/*version.def is up-to-date bootstrap@1.18 +5 -0 [Bug 717] Make sure sntp/*version.def is up-to-date ChangeSet@1.1416, 2006-11-20 23:05:54-05:00, stenn@whimsy.udel.edu [Bug 739] ntpd -x should not take an argument NEWS@1.76 +1 -0 [Bug 739] ntpd -x should not take an argument ntpd/ntpdbase-opts.def@1.10 +0 -1 [Bug 739] ntpd -x should not take an argument ChangeSet@1.1415, 2006-11-19 06:45:35-05:00, stenn@whimsy.udel.edu NTP_4_2_3P66_RC TAG: NTP_4_2_3P66_RC ntpd/ntpd-opts.c@1.45 +2 -2 NTP_4_2_3P66_RC ntpd/ntpd-opts.h@1.45 +3 -3 NTP_4_2_3P66_RC ntpd/ntpd-opts.texi@1.44 +2 -2 NTP_4_2_3P66_RC ntpd/ntpd.1@1.43 +2 -2 NTP_4_2_3P66_RC ntpd/ntpdsim-opts.c@1.45 +2 -2 NTP_4_2_3P66_RC ntpd/ntpdsim-opts.h@1.45 +3 -3 NTP_4_2_3P66_RC ntpd/ntpdsim-opts.texi@1.43 +1 -1 NTP_4_2_3P66_RC ntpd/ntpdsim.1@1.43 +2 -2 NTP_4_2_3P66_RC ntpdc/ntpdc-opts.c@1.45 +2 -2 NTP_4_2_3P66_RC ntpdc/ntpdc-opts.h@1.45 +3 -3 NTP_4_2_3P66_RC ntpdc/ntpdc-opts.texi@1.43 +2 -2 NTP_4_2_3P66_RC ntpdc/ntpdc.1@1.43 +2 -2 NTP_4_2_3P66_RC ntpq/ntpq-opts.c@1.47 +2 -2 NTP_4_2_3P66_RC ntpq/ntpq-opts.h@1.47 +3 -3 NTP_4_2_3P66_RC ntpq/ntpq-opts.texi@1.44 +2 -2 NTP_4_2_3P66_RC ntpq/ntpq.1@1.43 +2 -2 NTP_4_2_3P66_RC packageinfo.sh@1.59 +1 -1 NTP_4_2_3P66_RC sntp/sntp-opts.c@1.44 +2 -2 NTP_4_2_3P66_RC sntp/sntp-opts.h@1.44 +3 -3 NTP_4_2_3P66_RC sntp/sntp-opts.texi@1.41 +1 -1 NTP_4_2_3P66_RC sntp/sntp.1@1.44 +2 -2 NTP_4_2_3P66_RC util/ntp-keygen-opts.c@1.44 +2 -2 NTP_4_2_3P66_RC util/ntp-keygen-opts.h@1.44 +3 -3 NTP_4_2_3P66_RC util/ntp-keygen-opts.texi@1.42 +2 -2 NTP_4_2_3P66_RC util/ntp-keygen.1@1.42 +2 -2 NTP_4_2_3P66_RC ChangeSet@1.1412.1.1, 2006-11-18 21:12:41-08:00, harlan@minnie.everett.org * [Bug 737] Some systems need help providing struct iovec. NEWS@1.75 +1 -0 * [Bug 737] Some systems need help providing struct iovec. configure.ac@1.400 +44 -0 * [Bug 737] Some systems need help providing struct iovec. ntpd/ntp_io.c@1.244 +3 -0 * [Bug 737] Some systems need help providing struct iovec. ChangeSet@1.1413, 2006-11-17 08:59:50+00:00, burnicki@pogo.udel.edu [Bug #728] More changes by Paul and Martin. html/drivers/driver8.html@1.21 +93 -44 More changes by Paul and Martin. ChangeSet@1.1412, 2006-11-10 06:41:45-05:00, stenn@whimsy.udel.edu NTP_4_2_3P65_RC TAG: NTP_4_2_3P65_RC ntpd/ntpd-opts.c@1.44 +2 -2 NTP_4_2_3P65_RC ntpd/ntpd-opts.h@1.44 +3 -3 NTP_4_2_3P65_RC ntpd/ntpd-opts.texi@1.43 +1 -1 NTP_4_2_3P65_RC ntpd/ntpd.1@1.42 +2 -2 NTP_4_2_3P65_RC ntpd/ntpdsim-opts.c@1.44 +2 -2 NTP_4_2_3P65_RC ntpd/ntpdsim-opts.h@1.44 +3 -3 NTP_4_2_3P65_RC ntpd/ntpdsim-opts.texi@1.42 +1 -1 NTP_4_2_3P65_RC ntpd/ntpdsim.1@1.42 +2 -2 NTP_4_2_3P65_RC ntpdc/ntpdc-opts.c@1.44 +2 -2 NTP_4_2_3P65_RC ntpdc/ntpdc-opts.h@1.44 +3 -3 NTP_4_2_3P65_RC ntpdc/ntpdc-opts.texi@1.42 +1 -1 NTP_4_2_3P65_RC ntpdc/ntpdc.1@1.42 +2 -2 NTP_4_2_3P65_RC ntpq/ntpq-opts.c@1.46 +2 -2 NTP_4_2_3P65_RC ntpq/ntpq-opts.h@1.46 +3 -3 NTP_4_2_3P65_RC ntpq/ntpq-opts.texi@1.43 +1 -1 NTP_4_2_3P65_RC ntpq/ntpq.1@1.42 +2 -2 NTP_4_2_3P65_RC packageinfo.sh@1.58 +1 -1 NTP_4_2_3P65_RC sntp/sntp-opts.c@1.43 +2 -2 NTP_4_2_3P65_RC sntp/sntp-opts.h@1.43 +3 -3 NTP_4_2_3P65_RC sntp/sntp-opts.texi@1.40 +1 -1 NTP_4_2_3P65_RC sntp/sntp.1@1.43 +2 -2 NTP_4_2_3P65_RC util/ntp-keygen-opts.c@1.43 +2 -2 NTP_4_2_3P65_RC util/ntp-keygen-opts.h@1.43 +3 -3 NTP_4_2_3P65_RC util/ntp-keygen-opts.texi@1.41 +1 -1 NTP_4_2_3P65_RC util/ntp-keygen.1@1.41 +2 -2 NTP_4_2_3P65_RC ChangeSet@1.1411, 2006-11-10 00:24:06-05:00, stenn@whimsy.udel.edu [Bug 717] Fix libopts compile problem for some windows versions NEWS@1.74 +1 -1 [Bug 717] Fix libopts compile problem for some windows versions ChangeSet@1.1398.1.1, 2006-11-09 22:57:09-05:00, mayer@pogo.udel.edu Bug #717 Add uintptr_t typedef for VS 6.0 ports/winnt/include/config.h@1.46 +7 -0 Bug #717 Add uintptr_t typedef for VS 6.0 ChangeSet@1.1409, 2006-11-09 06:42:28-05:00, stenn@whimsy.udel.edu NTP_4_2_3P64_RC TAG: NTP_4_2_3P64_RC ntpd/ntpd-opts.c@1.43 +2 -2 NTP_4_2_3P64_RC ntpd/ntpd-opts.h@1.43 +3 -3 NTP_4_2_3P64_RC ntpd/ntpd-opts.texi@1.42 +1 -1 NTP_4_2_3P64_RC ntpd/ntpd.1@1.41 +2 -2 NTP_4_2_3P64_RC ntpd/ntpdsim-opts.c@1.43 +2 -2 NTP_4_2_3P64_RC ntpd/ntpdsim-opts.h@1.43 +3 -3 NTP_4_2_3P64_RC ntpd/ntpdsim-opts.texi@1.41 +1 -1 NTP_4_2_3P64_RC ntpd/ntpdsim.1@1.41 +2 -2 NTP_4_2_3P64_RC ntpdc/ntpdc-opts.c@1.43 +2 -2 NTP_4_2_3P64_RC ntpdc/ntpdc-opts.h@1.43 +3 -3 NTP_4_2_3P64_RC ntpdc/ntpdc-opts.texi@1.41 +1 -1 NTP_4_2_3P64_RC ntpdc/ntpdc.1@1.41 +2 -2 NTP_4_2_3P64_RC ntpq/ntpq-opts.c@1.45 +2 -2 NTP_4_2_3P64_RC ntpq/ntpq-opts.h@1.45 +3 -3 NTP_4_2_3P64_RC ntpq/ntpq-opts.texi@1.42 +1 -1 NTP_4_2_3P64_RC ntpq/ntpq.1@1.41 +2 -2 NTP_4_2_3P64_RC packageinfo.sh@1.57 +1 -1 NTP_4_2_3P64_RC sntp/sntp-opts.c@1.42 +2 -2 NTP_4_2_3P64_RC sntp/sntp-opts.h@1.42 +3 -3 NTP_4_2_3P64_RC sntp/sntp-opts.texi@1.39 +1 -1 NTP_4_2_3P64_RC sntp/sntp.1@1.42 +2 -2 NTP_4_2_3P64_RC util/ntp-keygen-opts.c@1.42 +2 -2 NTP_4_2_3P64_RC util/ntp-keygen-opts.h@1.42 +3 -3 NTP_4_2_3P64_RC util/ntp-keygen-opts.texi@1.40 +1 -1 NTP_4_2_3P64_RC util/ntp-keygen.1@1.40 +2 -2 NTP_4_2_3P64_RC ChangeSet@1.1408, 2006-11-09 04:29:07-05:00, stenn@whimsy.udel.edu [Bug 728] parse documentation fixes NEWS@1.73 +1 -0 [Bug 728] parse documentation fixes ChangeSet@1.1407, 2006-11-08 18:11:25+00:00, burnicki@pogo.udel.edu [Bug #728] Typo fixes submitted by Paul Croome plus additional updates and fixes for driver8.html and parsedata.html. html/drivers/driver8.html@1.20 +127 -136 Typo fixes submitted by Paul Croome. Updated docs and links. html/parsedata.html@1.12 +92 -80 Updated docs and fixed some errors. ChangeSet@1.1406, 2006-11-06 06:47:05-05:00, stenn@whimsy.udel.edu NTP_4_2_3P63_RC TAG: NTP_4_2_3P63_RC ntpd/ntpd-opts.c@1.42 +2 -2 NTP_4_2_3P63_RC ntpd/ntpd-opts.h@1.42 +3 -3 NTP_4_2_3P63_RC ntpd/ntpd-opts.texi@1.41 +2 -4 NTP_4_2_3P63_RC ntpd/ntpd.1@1.40 +2 -2 NTP_4_2_3P63_RC ntpd/ntpdsim-opts.c@1.42 +2 -2 NTP_4_2_3P63_RC ntpd/ntpdsim-opts.h@1.42 +3 -3 NTP_4_2_3P63_RC ntpd/ntpdsim-opts.texi@1.40 +2 -73 NTP_4_2_3P63_RC ntpd/ntpdsim.1@1.40 +2 -2 NTP_4_2_3P63_RC ntpdc/ntpdc-opts.c@1.42 +2 -2 NTP_4_2_3P63_RC ntpdc/ntpdc-opts.h@1.42 +3 -3 NTP_4_2_3P63_RC ntpdc/ntpdc-opts.texi@1.40 +2 -2 NTP_4_2_3P63_RC ntpdc/ntpdc.1@1.40 +2 -2 NTP_4_2_3P63_RC ntpq/ntpq-opts.c@1.44 +2 -2 NTP_4_2_3P63_RC ntpq/ntpq-opts.h@1.44 +3 -3 NTP_4_2_3P63_RC ntpq/ntpq-opts.texi@1.41 +4 -244 NTP_4_2_3P63_RC ntpq/ntpq.1@1.40 +2 -2 NTP_4_2_3P63_RC packageinfo.sh@1.56 +1 -1 NTP_4_2_3P63_RC sntp/sntp-opts.c@1.41 +2 -2 NTP_4_2_3P63_RC sntp/sntp-opts.h@1.41 +3 -3 NTP_4_2_3P63_RC sntp/sntp-opts.texi@1.38 +1 -1 NTP_4_2_3P63_RC sntp/sntp.1@1.41 +2 -2 NTP_4_2_3P63_RC util/ntp-keygen-opts.c@1.41 +2 -2 NTP_4_2_3P63_RC util/ntp-keygen-opts.h@1.41 +3 -3 NTP_4_2_3P63_RC util/ntp-keygen-opts.texi@1.39 +2 -2 NTP_4_2_3P63_RC util/ntp-keygen.1@1.39 +2 -2 NTP_4_2_3P63_RC ChangeSet@1.1405, 2006-11-06 03:11:36-05:00, stenn@whimsy.udel.edu [Bug 734] setsockopt(..., IP_MULTICAST_IF, ...) fails on 64-bit platforms. NEWS@1.72 +1 -0 [Bug 734] setsockopt(..., IP_MULTICAST_IF, ...) fails on 64-bit platforms. ChangeSet@1.1404, 2006-11-06 03:06:37-05:00, stenn@whimsy.udel.edu Build our libopts by default (static, and without installing it configure.ac@1.399 +17 -0 Build our libopts by default (static, and without installing it sntp/configure.ac@1.15 +18 -0 Build our libopts by default (static, and without installing it ChangeSet@1.1400.1.1, 2006-11-06 02:51:53-05:00, stenn@whimsy.udel.edu [Bug 732] C-DEX JST2000 patch from Hideo Kuramatsu NEWS@1.71 +1 -0 [Bug 732] C-DEX JST2000 patch from Hideo Kuramatsu ntpd/refclock_jjy.c@1.13 +5 -0 [Bug 732] C-DEX JST2000 patch from Hideo Kuramatsu ChangeSet@1.1402, 2006-11-05 08:28:53+00:00, kardel@pogo.udel.edu ntp_io.c: pass correct address length for setsockopt(..., IP_MULTICAST_IF, ...) (sizeof(struct sockaddr_in*) != sizeof(struct in_addr) on 64-bit platforms) ntpd/ntp_io.c@1.243 +1 -1 pass correct address length for setsockopt(..., IP_MULTICAST_IF, ...) (sizeof(struct sockaddr_in*) != sizeof(struct in_addr) on 64 bite platforms) ChangeSet@1.1400, 2006-11-01 06:45:21-05:00, stenn@whimsy.udel.edu NTP_4_2_3P62_RC TAG: NTP_4_2_3P62_RC ntpd/ntpd-opts.c@1.41 +2 -2 NTP_4_2_3P62_RC ntpd/ntpd-opts.h@1.41 +3 -3 NTP_4_2_3P62_RC ntpd/ntpd-opts.texi@1.40 +1 -1 NTP_4_2_3P62_RC ntpd/ntpd.1@1.39 +2 -2 NTP_4_2_3P62_RC ntpd/ntpdsim-opts.c@1.41 +2 -2 NTP_4_2_3P62_RC ntpd/ntpdsim-opts.h@1.41 +3 -3 NTP_4_2_3P62_RC ntpd/ntpdsim-opts.texi@1.39 +1 -1 NTP_4_2_3P62_RC ntpd/ntpdsim.1@1.39 +2 -2 NTP_4_2_3P62_RC ntpdc/ntpdc-opts.c@1.41 +2 -2 NTP_4_2_3P62_RC ntpdc/ntpdc-opts.h@1.41 +3 -3 NTP_4_2_3P62_RC ntpdc/ntpdc-opts.texi@1.39 +1 -1 NTP_4_2_3P62_RC ntpdc/ntpdc.1@1.39 +2 -2 NTP_4_2_3P62_RC ntpq/ntpq-opts.c@1.43 +2 -2 NTP_4_2_3P62_RC ntpq/ntpq-opts.h@1.43 +3 -3 NTP_4_2_3P62_RC ntpq/ntpq-opts.texi@1.40 +1 -1 NTP_4_2_3P62_RC ntpq/ntpq.1@1.39 +2 -2 NTP_4_2_3P62_RC packageinfo.sh@1.55 +1 -1 NTP_4_2_3P62_RC sntp/sntp-opts.c@1.40 +2 -2 NTP_4_2_3P62_RC sntp/sntp-opts.h@1.40 +3 -3 NTP_4_2_3P62_RC sntp/sntp-opts.texi@1.37 +1 -1 NTP_4_2_3P62_RC sntp/sntp.1@1.40 +2 -2 NTP_4_2_3P62_RC util/ntp-keygen-opts.c@1.40 +2 -2 NTP_4_2_3P62_RC util/ntp-keygen-opts.h@1.40 +3 -3 NTP_4_2_3P62_RC util/ntp-keygen-opts.texi@1.38 +1 -1 NTP_4_2_3P62_RC util/ntp-keygen.1@1.38 +2 -2 NTP_4_2_3P62_RC ChangeSet@1.1399, 2006-10-31 23:58:45-05:00, stenn@whimsy.udel.edu [Bug 721] check for __ss_family and __ss_len separately NEWS@1.70 +1 -0 [Bug 721] check for __ss_family and __ss_len separately configure.ac@1.398 +41 -2 [Bug 721] check for __ss_family and __ss_len separately ChangeSet@1.1379.13.1, 2006-10-30 07:24:38-05:00, mayer@pogo.udel.edu Bug #695 Fix to turn off Option warnings for VS 2005 ports/winnt/include/config.h@1.45 +1 -0 Bug #695 Fix to turn off Option warnings for VS 2005 ChangeSet@1.1397, 2006-10-23 07:48:24-04:00, stenn@whimsy.udel.edu NTP_4_2_3P61_RC TAG: NTP_4_2_3P61_RC ntpd/ntpd-opts.c@1.40 +2 -2 NTP_4_2_3P61_RC ntpd/ntpd-opts.h@1.40 +3 -3 NTP_4_2_3P61_RC ntpd/ntpd-opts.texi@1.39 +1 -1 NTP_4_2_3P61_RC ntpd/ntpd.1@1.38 +2 -2 NTP_4_2_3P61_RC ntpd/ntpdsim-opts.c@1.40 +2 -2 NTP_4_2_3P61_RC ntpd/ntpdsim-opts.h@1.40 +3 -3 NTP_4_2_3P61_RC ntpd/ntpdsim-opts.texi@1.38 +1 -1 NTP_4_2_3P61_RC ntpd/ntpdsim.1@1.38 +2 -2 NTP_4_2_3P61_RC ntpdc/ntpdc-opts.c@1.40 +2 -2 NTP_4_2_3P61_RC ntpdc/ntpdc-opts.h@1.40 +3 -3 NTP_4_2_3P61_RC ntpdc/ntpdc-opts.texi@1.38 +1 -1 NTP_4_2_3P61_RC ntpdc/ntpdc.1@1.38 +2 -2 NTP_4_2_3P61_RC ntpq/ntpq-opts.c@1.42 +2 -2 NTP_4_2_3P61_RC ntpq/ntpq-opts.h@1.42 +3 -3 NTP_4_2_3P61_RC ntpq/ntpq-opts.texi@1.39 +1 -1 NTP_4_2_3P61_RC ntpq/ntpq.1@1.38 +2 -2 NTP_4_2_3P61_RC packageinfo.sh@1.54 +1 -1 NTP_4_2_3P61_RC sntp/sntp-opts.c@1.39 +2 -2 NTP_4_2_3P61_RC sntp/sntp-opts.h@1.39 +3 -3 NTP_4_2_3P61_RC sntp/sntp-opts.texi@1.36 +1 -1 NTP_4_2_3P61_RC sntp/sntp.1@1.39 +2 -2 NTP_4_2_3P61_RC util/ntp-keygen-opts.c@1.39 +2 -2 NTP_4_2_3P61_RC util/ntp-keygen-opts.h@1.39 +3 -3 NTP_4_2_3P61_RC util/ntp-keygen-opts.texi@1.37 +1 -1 NTP_4_2_3P61_RC util/ntp-keygen.1@1.37 +2 -2 NTP_4_2_3P61_RC ChangeSet@1.1395, 2006-10-23 00:38:50-04:00, stenn@pogo.udel.edu [Bug 666] ntpq opeers displays jitter rather than dispersion NEWS@1.69 +1 -0 [Bug 666] ntpq opeers displays jitter rather than dispersion ntpq/ntpq-subs.c@1.25 +3 -2 [Bug 666] ntpq opeers displays jitter rather than dispersion ChangeSet@1.1379.12.3, 2006-10-20 07:45:30-04:00, stenn@whimsy.udel.edu NTP_4_2_3P60_RC TAG: NTP_4_2_3P60_RC ntpd/ntpd-opts.c@1.39 +2 -2 NTP_4_2_3P60_RC ntpd/ntpd-opts.h@1.39 +3 -3 NTP_4_2_3P60_RC ntpd/ntpd-opts.texi@1.38 +1 -1 NTP_4_2_3P60_RC ntpd/ntpd.1@1.37 +2 -2 NTP_4_2_3P60_RC ntpd/ntpdsim-opts.c@1.39 +2 -2 NTP_4_2_3P60_RC ntpd/ntpdsim-opts.h@1.39 +3 -3 NTP_4_2_3P60_RC ntpd/ntpdsim-opts.texi@1.37 +1 -1 NTP_4_2_3P60_RC ntpd/ntpdsim.1@1.37 +2 -2 NTP_4_2_3P60_RC ntpdc/ntpdc-opts.c@1.39 +2 -2 NTP_4_2_3P60_RC ntpdc/ntpdc-opts.h@1.39 +3 -3 NTP_4_2_3P60_RC ntpdc/ntpdc-opts.texi@1.37 +1 -1 NTP_4_2_3P60_RC ntpdc/ntpdc.1@1.37 +2 -2 NTP_4_2_3P60_RC ntpq/ntpq-opts.c@1.41 +2 -2 NTP_4_2_3P60_RC ntpq/ntpq-opts.h@1.41 +3 -3 NTP_4_2_3P60_RC ntpq/ntpq-opts.texi@1.38 +1 -1 NTP_4_2_3P60_RC ntpq/ntpq.1@1.37 +2 -2 NTP_4_2_3P60_RC packageinfo.sh@1.53 +1 -1 NTP_4_2_3P60_RC sntp/sntp-opts.c@1.38 +2 -2 NTP_4_2_3P60_RC sntp/sntp-opts.h@1.38 +3 -3 NTP_4_2_3P60_RC sntp/sntp-opts.texi@1.35 +1 -1 NTP_4_2_3P60_RC sntp/sntp.1@1.38 +2 -2 NTP_4_2_3P60_RC util/ntp-keygen-opts.c@1.38 +2 -2 NTP_4_2_3P60_RC util/ntp-keygen-opts.h@1.38 +3 -3 NTP_4_2_3P60_RC util/ntp-keygen-opts.texi@1.36 +1 -1 NTP_4_2_3P60_RC util/ntp-keygen.1@1.36 +2 -2 NTP_4_2_3P60_RC ChangeSet@1.1379.12.2, 2006-10-20 00:49:41-04:00, stenn@whimsy.udel.edu 4.2.4 Release Candidate packageinfo.sh@1.52 +2 -2 4.2.4 Release Candidate ChangeSet@1.1379.12.1, 2006-10-20 00:44:54-04:00, stenn@whimsy.udel.edu refclock_wwv.c fix from Dave Mills ntpd/refclock_wwv.c@1.66 +3 -0 refclock_wwv.c fix from Dave Mills ChangeSet@1.1379.1.53, 2006-10-15 14:25:15+00:00, kardel@pogo.udel.edu dcfd.c: cope with cases where sa_sigaction and sa_handler are in a union parseutil/dcfd.c@1.19 +1 -1 cope with cases where sa_sigaction and sa_handler are in a union ChangeSet@1.1379.1.52, 2006-10-15 07:42:15-04:00, stenn@whimsy.udel.edu NTP_4_2_3P59 TAG: NTP_4_2_3P59 ntpd/ntpd-opts.c@1.38 +2 -2 NTP_4_2_3P59 ntpd/ntpd-opts.h@1.38 +3 -3 NTP_4_2_3P59 ntpd/ntpd-opts.texi@1.37 +1 -1 NTP_4_2_3P59 ntpd/ntpd.1@1.36 +2 -2 NTP_4_2_3P59 ntpd/ntpdsim-opts.c@1.38 +2 -2 NTP_4_2_3P59 ntpd/ntpdsim-opts.h@1.38 +3 -3 NTP_4_2_3P59 ntpd/ntpdsim-opts.texi@1.36 +1 -1 NTP_4_2_3P59 ntpd/ntpdsim.1@1.36 +2 -2 NTP_4_2_3P59 ntpdc/ntpdc-opts.c@1.38 +2 -2 NTP_4_2_3P59 ntpdc/ntpdc-opts.h@1.38 +3 -3 NTP_4_2_3P59 ntpdc/ntpdc-opts.texi@1.36 +1 -1 NTP_4_2_3P59 ntpdc/ntpdc.1@1.36 +2 -2 NTP_4_2_3P59 ntpq/ntpq-opts.c@1.40 +2 -2 NTP_4_2_3P59 ntpq/ntpq-opts.h@1.40 +3 -3 NTP_4_2_3P59 ntpq/ntpq-opts.texi@1.37 +1 -1 NTP_4_2_3P59 ntpq/ntpq.1@1.36 +2 -2 NTP_4_2_3P59 packageinfo.sh@1.51 +1 -1 NTP_4_2_3P59 sntp/sntp-opts.c@1.37 +2 -2 NTP_4_2_3P59 sntp/sntp-opts.h@1.37 +3 -3 NTP_4_2_3P59 sntp/sntp-opts.texi@1.34 +1 -1 NTP_4_2_3P59 sntp/sntp.1@1.37 +2 -2 NTP_4_2_3P59 util/ntp-keygen-opts.c@1.37 +2 -2 NTP_4_2_3P59 util/ntp-keygen-opts.h@1.37 +3 -3 NTP_4_2_3P59 util/ntp-keygen-opts.texi@1.35 +1 -1 NTP_4_2_3P59 util/ntp-keygen.1@1.35 +2 -2 NTP_4_2_3P59 ChangeSet@1.1251.94.61, 2006-10-15 03:47:49-04:00, stenn@whimsy.udel.edu NTP_4_2_2P4 TAG: NTP_4_2_2P4 packageinfo.sh@1.27.20.2 +2 -2 NTP_4_2_2P4 ChangeSet@1.1251.94.60, 2006-10-15 03:14:15-04:00, stenn@whimsy.udel.edu Release 4.2.2p4 packageinfo.sh@1.27.20.1 +1 -1 Release 4.2.2p4 ChangeSet@1.1379.1.51, 2006-10-15 06:03:07+00:00, kardel@pogo.udel.edu ntp_io.c: Bug 715: Fix from Peter Pramberger do not send link scoped multicasts with a glocbal source address (if present on that interface) ntpd/ntp_io.c@1.234.1.16 +9 -2 Bug 715: Fix from Peter Pramberger do not send link scoped multicasts with a glocbal source address (if present on that interface) ChangeSet@1.1379.1.50, 2006-10-14 07:41:41-04:00, stenn@whimsy.udel.edu NTP_4_2_3P58 TAG: NTP_4_2_3P58 ntpd/ntpd-opts.c@1.37 +2 -2 NTP_4_2_3P58 ntpd/ntpd-opts.h@1.37 +3 -3 NTP_4_2_3P58 ntpd/ntpd-opts.texi@1.36 +1 -1 NTP_4_2_3P58 ntpd/ntpd.1@1.35 +2 -2 NTP_4_2_3P58 ntpd/ntpdsim-opts.c@1.37 +2 -2 NTP_4_2_3P58 ntpd/ntpdsim-opts.h@1.37 +3 -3 NTP_4_2_3P58 ntpd/ntpdsim-opts.texi@1.35 +1 -1 NTP_4_2_3P58 ntpd/ntpdsim.1@1.35 +2 -2 NTP_4_2_3P58 ntpdc/ntpdc-opts.c@1.37 +2 -2 NTP_4_2_3P58 ntpdc/ntpdc-opts.h@1.37 +3 -3 NTP_4_2_3P58 ntpdc/ntpdc-opts.texi@1.35 +1 -1 NTP_4_2_3P58 ntpdc/ntpdc.1@1.35 +2 -2 NTP_4_2_3P58 ntpq/ntpq-opts.c@1.39 +2 -2 NTP_4_2_3P58 ntpq/ntpq-opts.h@1.39 +3 -3 NTP_4_2_3P58 ntpq/ntpq-opts.texi@1.36 +1 -1 NTP_4_2_3P58 ntpq/ntpq.1@1.35 +2 -2 NTP_4_2_3P58 packageinfo.sh@1.50 +1 -1 NTP_4_2_3P58 sntp/sntp-opts.c@1.36 +2 -2 NTP_4_2_3P58 sntp/sntp-opts.h@1.36 +3 -3 NTP_4_2_3P58 sntp/sntp-opts.texi@1.33 +1 -1 NTP_4_2_3P58 sntp/sntp.1@1.36 +2 -2 NTP_4_2_3P58 util/ntp-keygen-opts.c@1.36 +2 -2 NTP_4_2_3P58 util/ntp-keygen-opts.h@1.36 +3 -3 NTP_4_2_3P58 util/ntp-keygen-opts.texi@1.34 +1 -1 NTP_4_2_3P58 util/ntp-keygen.1@1.34 +2 -2 NTP_4_2_3P58 ChangeSet@1.1379.1.49, 2006-10-14 08:51:43+00:00, kardel@pogo.udel.edu ntp_io.c: Bug #715 (& dupe 723): findlocalinterface() in update_interface can be replaced by a simple address to interface lookup. This avoids tripping over the Linux strategy to return the localhost address when attempting to send to an IPv6 address of a local interface. Additionally: synchronize debug output with reality avoid adding duplicate address entries to the address list declare more functions static to reduce name space pollution ntpd/ntp_io.c@1.234.1.15 +107 -81 Bug #715 (& dupe 723): findlocalinterface() in update_interface can be replaced by a simple address to interface lookup. This avoids tripping over the Linux strategy to return the localhost address when attempting to send to an IPv6 address of a local interface. Additionally: synchronize debug output with reality avoid adding duplicate address entries to the address list declare more functions static to reduce name space pollution ChangeSet@1.1379.1.48, 2006-10-13 07:48:30-04:00, stenn@whimsy.udel.edu NTP_4_2_3P57 TAG: NTP_4_2_3P57 ntpd/ntpd-opts.c@1.36 +4 -4 NTP_4_2_3P57 ntpd/ntpd-opts.h@1.36 +3 -3 NTP_4_2_3P57 ntpd/ntpd-opts.texi@1.35 +3 -3 NTP_4_2_3P57 ntpd/ntpd.1@1.34 +2 -2 NTP_4_2_3P57 ntpd/ntpdsim-opts.c@1.36 +4 -4 NTP_4_2_3P57 ntpd/ntpdsim-opts.h@1.36 +3 -3 NTP_4_2_3P57 ntpd/ntpdsim-opts.texi@1.34 +3 -3 NTP_4_2_3P57 ntpd/ntpdsim.1@1.34 +2 -2 NTP_4_2_3P57 ntpdc/ntpdc-opts.c@1.36 +4 -4 NTP_4_2_3P57 ntpdc/ntpdc-opts.h@1.36 +3 -3 NTP_4_2_3P57 ntpdc/ntpdc-opts.texi@1.34 +2 -2 NTP_4_2_3P57 ntpdc/ntpdc.1@1.34 +2 -2 NTP_4_2_3P57 ntpq/ntpq-opts.c@1.38 +4 -4 NTP_4_2_3P57 ntpq/ntpq-opts.h@1.38 +3 -3 NTP_4_2_3P57 ntpq/ntpq-opts.texi@1.35 +3 -3 NTP_4_2_3P57 ntpq/ntpq.1@1.34 +2 -2 NTP_4_2_3P57 packageinfo.sh@1.49 +1 -1 NTP_4_2_3P57 sntp/sntp-opts.c@1.35 +2 -2 NTP_4_2_3P57 sntp/sntp-opts.h@1.35 +3 -3 NTP_4_2_3P57 sntp/sntp-opts.texi@1.32 +1 -1 NTP_4_2_3P57 sntp/sntp.1@1.35 +2 -2 NTP_4_2_3P57 util/ntp-keygen-opts.c@1.35 +4 -4 NTP_4_2_3P57 util/ntp-keygen-opts.h@1.35 +3 -3 NTP_4_2_3P57 util/ntp-keygen-opts.texi@1.33 +2 -2 NTP_4_2_3P57 util/ntp-keygen.1@1.33 +2 -2 NTP_4_2_3P57 ChangeSet@1.1379.1.47, 2006-10-12 23:32:07-04:00, stenn@whimsy.udel.edu Autogen-5.8.7 upgrade clockstuff/clktest-opts.c@1.9 +1 -1 Autogen-5.8.7 upgrade clockstuff/clktest-opts.h@1.9 +1 -1 Autogen-5.8.7 upgrade ntpd/ntpd-opts.c@1.35 +1 -1 Autogen-5.8.7 upgrade ntpd/ntpd-opts.h@1.35 +1 -1 Autogen-5.8.7 upgrade ntpd/ntpd-opts.texi@1.34 +3 -3 Autogen-5.8.7 upgrade ntpd/ntpd.1@1.33 +1 -1 Autogen-5.8.7 upgrade ntpd/ntpdsim-opts.c@1.35 +1 -1 Autogen-5.8.7 upgrade ntpd/ntpdsim-opts.h@1.35 +1 -1 Autogen-5.8.7 upgrade ntpd/ntpdsim-opts.texi@1.33 +3 -3 Autogen-5.8.7 upgrade ntpd/ntpdsim.1@1.33 +1 -1 Autogen-5.8.7 upgrade ntpdc/ntpdc-opts.c@1.35 +1 -1 Autogen-5.8.7 upgrade ntpdc/ntpdc-opts.h@1.35 +1 -1 Autogen-5.8.7 upgrade ntpdc/ntpdc-opts.texi@1.33 +2 -2 Autogen-5.8.7 upgrade ntpdc/ntpdc.1@1.33 +1 -1 Autogen-5.8.7 upgrade ntpq/ntpq-opts.c@1.37 +1 -1 Autogen-5.8.7 upgrade ntpq/ntpq-opts.h@1.37 +1 -1 Autogen-5.8.7 upgrade ntpq/ntpq-opts.texi@1.34 +3 -3 Autogen-5.8.7 upgrade ntpq/ntpq.1@1.33 +1 -1 Autogen-5.8.7 upgrade sntp/sntp-opts.c@1.34 +1 -1 Autogen-5.8.7 upgrade sntp/sntp-opts.h@1.34 +1 -1 Autogen-5.8.7 upgrade util/ntp-keygen-opts.c@1.34 +1 -1 Autogen-5.8.7 upgrade util/ntp-keygen-opts.h@1.34 +1 -1 Autogen-5.8.7 upgrade util/ntp-keygen-opts.texi@1.32 +2 -2 Autogen-5.8.7 upgrade util/ntp-keygen.1@1.32 +1 -1 Autogen-5.8.7 upgrade ChangeSet@1.1379.1.46, 2006-10-12 23:29:11-04:00, stenn@whimsy.udel.edu Require autogen-5.8.7 include/autogen-version.def@1.3 +1 -1 Require autogen-5.8.7 ChangeSet@1.1379.1.45, 2006-10-12 22:46:49-04:00, stenn@whimsy.udel.edu Autogen-5.8.7 upgrade clockstuff/clktest-opts.c@1.8 +2 -2 Autogen-5.8.7 upgrade clockstuff/clktest-opts.h@1.8 +3 -3 Autogen-5.8.7 upgrade ntpd/ntpd-opts.c@1.34 +3 -3 Autogen-5.8.7 upgrade ntpd/ntpd-opts.h@1.34 +1 -1 Autogen-5.8.7 upgrade ntpd/ntpdsim-opts.c@1.34 +3 -3 Autogen-5.8.7 upgrade ntpd/ntpdsim-opts.h@1.34 +1 -1 Autogen-5.8.7 upgrade ntpdc/ntpdc-opts.c@1.34 +3 -3 Autogen-5.8.7 upgrade ntpdc/ntpdc-opts.h@1.34 +1 -1 Autogen-5.8.7 upgrade ntpq/ntpq-opts.c@1.36 +3 -3 Autogen-5.8.7 upgrade ntpq/ntpq-opts.h@1.36 +1 -1 Autogen-5.8.7 upgrade sntp/sntp-opts.c@1.33 +1 -1 Autogen-5.8.7 upgrade sntp/sntp-opts.h@1.33 +1 -1 Autogen-5.8.7 upgrade util/ntp-keygen-opts.c@1.33 +3 -3 Autogen-5.8.7 upgrade util/ntp-keygen-opts.h@1.33 +1 -1 Autogen-5.8.7 upgrade ChangeSet@1.1379.1.44, 2006-10-12 22:42:48-04:00, stenn@whimsy.udel.edu autogen-5.8.7 upgrade libopts/autoopts.c@1.10 +1 -1 autogen-5.8.7 upgrade libopts/autoopts.h@1.9 +1 -1 autogen-5.8.7 upgrade libopts/autoopts/options.h@1.10 +2 -2 autogen-5.8.7 upgrade libopts/autoopts/usage-txt.h@1.9 +1 -1 autogen-5.8.7 upgrade libopts/boolean.c@1.8 +1 -1 autogen-5.8.7 upgrade libopts/compat/compat.h@1.12 +1 -1 autogen-5.8.7 upgrade libopts/compat/pathfind.c@1.9 +2 -3 autogen-5.8.7 upgrade libopts/compat/windows-config.h@1.5 +8 -2 autogen-5.8.7 upgrade libopts/configfile.c@1.10 +1 -1 autogen-5.8.7 upgrade libopts/cook.c@1.9 +1 -1 autogen-5.8.7 upgrade libopts/enumeration.c@1.9 +1 -1 autogen-5.8.7 upgrade libopts/environment.c@1.8 +1 -1 autogen-5.8.7 upgrade libopts/genshell.c@1.9 +1 -1 autogen-5.8.7 upgrade libopts/genshell.h@1.9 +1 -1 autogen-5.8.7 upgrade libopts/load.c@1.10 +1 -1 autogen-5.8.7 upgrade libopts/m4/libopts.m4@1.14 +2 -2 autogen-5.8.7 upgrade libopts/m4/liboptschk.m4@1.3 +1 -1 autogen-5.8.7 upgrade libopts/makeshell.c@1.11 +1 -1 autogen-5.8.7 upgrade libopts/nested.c@1.9 +1 -1 autogen-5.8.7 upgrade libopts/numeric.c@1.9 +1 -1 autogen-5.8.7 upgrade libopts/pgusage.c@1.9 +1 -1 autogen-5.8.7 upgrade libopts/proto.h@1.11 +1 -1 autogen-5.8.7 upgrade libopts/putshell.c@1.10 +1 -1 autogen-5.8.7 upgrade libopts/restore.c@1.9 +1 -1 autogen-5.8.7 upgrade libopts/save.c@1.10 +1 -1 autogen-5.8.7 upgrade libopts/sort.c@1.8 +1 -1 autogen-5.8.7 upgrade libopts/stack.c@1.10 +1 -1 autogen-5.8.7 upgrade libopts/streqvcmp.c@1.9 +1 -1 autogen-5.8.7 upgrade libopts/text_mmap.c@1.8 +1 -1 autogen-5.8.7 upgrade libopts/usage.c@1.9 +1 -1 autogen-5.8.7 upgrade libopts/version.c@1.9 +1 -1 autogen-5.8.7 upgrade sntp/libopts/autoopts.c@1.7 +1 -1 autogen-5.8.7 upgrade sntp/libopts/autoopts.h@1.7 +1 -1 autogen-5.8.7 upgrade sntp/libopts/autoopts/options.h@1.7 +2 -2 autogen-5.8.7 upgrade sntp/libopts/autoopts/usage-txt.h@1.6 +1 -1 autogen-5.8.7 upgrade sntp/libopts/boolean.c@1.5 +1 -1 autogen-5.8.7 upgrade sntp/libopts/compat/compat.h@1.8 +1 -1 autogen-5.8.7 upgrade sntp/libopts/compat/pathfind.c@1.6 +2 -3 autogen-5.8.7 upgrade sntp/libopts/compat/windows-config.h@1.3 +8 -2 autogen-5.8.7 upgrade sntp/libopts/configfile.c@1.7 +1 -1 autogen-5.8.7 upgrade sntp/libopts/cook.c@1.6 +1 -1 autogen-5.8.7 upgrade sntp/libopts/enumeration.c@1.6 +1 -1 autogen-5.8.7 upgrade sntp/libopts/environment.c@1.5 +1 -1 autogen-5.8.7 upgrade sntp/libopts/genshell.c@1.6 +1 -1 autogen-5.8.7 upgrade sntp/libopts/genshell.h@1.6 +1 -1 autogen-5.8.7 upgrade sntp/libopts/load.c@1.7 +1 -1 autogen-5.8.7 upgrade sntp/libopts/m4/libopts.m4@1.11 +2 -2 autogen-5.8.7 upgrade sntp/libopts/m4/liboptschk.m4@1.3 +1 -1 autogen-5.8.7 upgrade sntp/libopts/makeshell.c@1.8 +1 -1 autogen-5.8.7 upgrade sntp/libopts/nested.c@1.6 +1 -1 autogen-5.8.7 upgrade sntp/libopts/numeric.c@1.6 +1 -1 autogen-5.8.7 upgrade sntp/libopts/pgusage.c@1.5 +1 -1 autogen-5.8.7 upgrade sntp/libopts/proto.h@1.8 +1 -1 autogen-5.8.7 upgrade sntp/libopts/putshell.c@1.7 +1 -1 autogen-5.8.7 upgrade sntp/libopts/restore.c@1.5 +1 -1 autogen-5.8.7 upgrade sntp/libopts/save.c@1.7 +1 -1 autogen-5.8.7 upgrade sntp/libopts/sort.c@1.4 +1 -1 autogen-5.8.7 upgrade sntp/libopts/stack.c@1.7 +1 -1 autogen-5.8.7 upgrade sntp/libopts/streqvcmp.c@1.6 +1 -1 autogen-5.8.7 upgrade sntp/libopts/text_mmap.c@1.5 +1 -1 autogen-5.8.7 upgrade sntp/libopts/usage.c@1.7 +1 -1 autogen-5.8.7 upgrade sntp/libopts/version.c@1.6 +1 -1 autogen-5.8.7 upgrade ChangeSet@1.1379.1.43, 2006-10-12 19:22:09-04:00, stenn@whimsy.udel.edu Improve the getsockname() arg determination configure.ac@1.388.1.13 +10 -6 Improve the getsockname() arg determination ChangeSet@1.1379.1.42, 2006-10-12 07:40:55-04:00, stenn@whimsy.udel.edu NTP_4_2_3P56 TAG: NTP_4_2_3P56 ntpd/ntpd-opts.c@1.33 +2 -2 NTP_4_2_3P56 ntpd/ntpd-opts.h@1.33 +3 -3 NTP_4_2_3P56 ntpd/ntpd-opts.texi@1.33 +1 -1 NTP_4_2_3P56 ntpd/ntpd.1@1.32 +2 -2 NTP_4_2_3P56 ntpd/ntpdsim-opts.c@1.33 +2 -2 NTP_4_2_3P56 ntpd/ntpdsim-opts.h@1.33 +3 -3 NTP_4_2_3P56 ntpd/ntpdsim-opts.texi@1.32 +1 -1 NTP_4_2_3P56 ntpd/ntpdsim.1@1.32 +2 -2 NTP_4_2_3P56 ntpdc/ntpdc-opts.c@1.33 +2 -2 NTP_4_2_3P56 ntpdc/ntpdc-opts.h@1.33 +3 -3 NTP_4_2_3P56 ntpdc/ntpdc-opts.texi@1.32 +1 -1 NTP_4_2_3P56 ntpdc/ntpdc.1@1.32 +2 -2 NTP_4_2_3P56 ntpq/ntpq-opts.c@1.35 +2 -2 NTP_4_2_3P56 ntpq/ntpq-opts.h@1.35 +3 -3 NTP_4_2_3P56 ntpq/ntpq-opts.texi@1.33 +1 -1 NTP_4_2_3P56 ntpq/ntpq.1@1.32 +2 -2 NTP_4_2_3P56 packageinfo.sh@1.48 +1 -1 NTP_4_2_3P56 sntp/sntp-opts.c@1.32 +2 -2 NTP_4_2_3P56 sntp/sntp-opts.h@1.32 +3 -3 NTP_4_2_3P56 sntp/sntp-opts.texi@1.31 +1 -1 NTP_4_2_3P56 sntp/sntp.1@1.34 +2 -2 NTP_4_2_3P56 util/ntp-keygen-opts.c@1.32 +2 -2 NTP_4_2_3P56 util/ntp-keygen-opts.h@1.32 +3 -3 NTP_4_2_3P56 util/ntp-keygen-opts.texi@1.31 +1 -1 NTP_4_2_3P56 util/ntp-keygen.1@1.31 +2 -2 NTP_4_2_3P56 ChangeSet@1.1379.1.41, 2006-10-12 02:30:52-04:00, stenn@whimsy.udel.edu Update NEWS file NEWS@1.68 +36 -0 Update NEWS file ChangeSet@1.1379.11.2, 2006-10-11 22:40:46-04:00, mayer@pogo.udel.edu Bug #690. Purify memory reference error ports/winnt/libntp/dnslookup.c@1.4.1.4 +4 -3 Bug #690. Purify memory reference error ChangeSet@1.1379.11.1, 2006-10-11 22:39:16-04:00, mayer@pogo.udel.edu Bug #718. Update to config.h to deal with socklen_t ports/winnt/include/config.h@1.44 +13 -0 Bug #718. Update to config.h to deal with socklen_t ChangeSet@1.1379.1.39, 2006-10-11 07:44:18-04:00, stenn@whimsy.udel.edu NTP_4_2_3P55 TAG: NTP_4_2_3P55 ntpd/ntpd-opts.c@1.32 +2 -2 NTP_4_2_3P55 ntpd/ntpd-opts.h@1.32 +3 -3 NTP_4_2_3P55 ntpd/ntpd-opts.texi@1.32 +1 -1 NTP_4_2_3P55 ntpd/ntpd.1@1.31 +2 -2 NTP_4_2_3P55 ntpd/ntpdsim-opts.c@1.32 +2 -2 NTP_4_2_3P55 ntpd/ntpdsim-opts.h@1.32 +3 -3 NTP_4_2_3P55 ntpd/ntpdsim-opts.texi@1.31 +1 -1 NTP_4_2_3P55 ntpd/ntpdsim.1@1.31 +2 -2 NTP_4_2_3P55 ntpdc/ntpdc-opts.c@1.32 +2 -2 NTP_4_2_3P55 ntpdc/ntpdc-opts.h@1.32 +3 -3 NTP_4_2_3P55 ntpdc/ntpdc-opts.texi@1.31 +1 -1 NTP_4_2_3P55 ntpdc/ntpdc.1@1.31 +2 -2 NTP_4_2_3P55 ntpq/ntpq-opts.c@1.34 +2 -2 NTP_4_2_3P55 ntpq/ntpq-opts.h@1.34 +3 -3 NTP_4_2_3P55 ntpq/ntpq-opts.texi@1.32 +1 -1 NTP_4_2_3P55 ntpq/ntpq.1@1.31 +2 -2 NTP_4_2_3P55 packageinfo.sh@1.47 +1 -1 NTP_4_2_3P55 sntp/sntp-opts.c@1.31 +2 -2 NTP_4_2_3P55 sntp/sntp-opts.h@1.31 +3 -3 NTP_4_2_3P55 sntp/sntp-opts.texi@1.30 +1 -1 NTP_4_2_3P55 sntp/sntp.1@1.33 +2 -2 NTP_4_2_3P55 util/ntp-keygen-opts.c@1.31 +2 -2 NTP_4_2_3P55 util/ntp-keygen-opts.h@1.31 +3 -3 NTP_4_2_3P55 util/ntp-keygen-opts.texi@1.30 +1 -1 NTP_4_2_3P55 util/ntp-keygen.1@1.30 +2 -2 NTP_4_2_3P55 ChangeSet@1.1379.1.37, 2006-10-10 19:52:42-04:00, stenn@whimsy.udel.edu [Bug 718] Determine/use the correct type of saddrlen for getsockname() configure.ac@1.388.1.12 +23 -1 [Bug 718] Determine/use the correct type of saddrlen for getsockname() libisc/net.c@1.8 +2 -2 [Bug 718] Determine/use the correct type of saddrlen for getsockname() ntpd/ntp_io.c@1.234.1.14 +1 -1 [Bug 718] Determine/use the correct type of saddrlen for getsockname() ChangeSet@1.1379.10.1, 2006-10-10 16:15:47+00:00, burnicki@pogo.udel.edu [Bug 708] nt_clockstuff.c has unintentionally been messed up with the previous changeset. This is the correct version. ports/winnt/ntpd/nt_clockstuff.c@1.23 +574 -249 Oops, this file has unintentionally been messed up with the previous changeset. This is the correct version. ChangeSet@1.1379.1.36, 2006-10-10 07:46:00-04:00, stenn@whimsy.udel.edu NTP_4_2_3P54 TAG: NTP_4_2_3P54 ntpd/ntpd-opts.c@1.31 +2 -2 NTP_4_2_3P54 ntpd/ntpd-opts.h@1.31 +3 -3 NTP_4_2_3P54 ntpd/ntpd-opts.texi@1.31 +1 -1 NTP_4_2_3P54 ntpd/ntpd.1@1.30 +2 -2 NTP_4_2_3P54 ntpd/ntpdsim-opts.c@1.31 +2 -2 NTP_4_2_3P54 ntpd/ntpdsim-opts.h@1.31 +3 -3 NTP_4_2_3P54 ntpd/ntpdsim-opts.texi@1.30 +1 -1 NTP_4_2_3P54 ntpd/ntpdsim.1@1.30 +2 -2 NTP_4_2_3P54 ntpdc/ntpdc-opts.c@1.31 +2 -2 NTP_4_2_3P54 ntpdc/ntpdc-opts.h@1.31 +3 -3 NTP_4_2_3P54 ntpdc/ntpdc-opts.texi@1.30 +1 -1 NTP_4_2_3P54 ntpdc/ntpdc.1@1.30 +2 -2 NTP_4_2_3P54 ntpq/ntpq-opts.c@1.33 +2 -2 NTP_4_2_3P54 ntpq/ntpq-opts.h@1.33 +3 -3 NTP_4_2_3P54 ntpq/ntpq-opts.texi@1.31 +1 -1 NTP_4_2_3P54 ntpq/ntpq.1@1.30 +2 -2 NTP_4_2_3P54 packageinfo.sh@1.46 +1 -1 NTP_4_2_3P54 sntp/sntp-opts.c@1.30 +2 -2 NTP_4_2_3P54 sntp/sntp-opts.h@1.30 +3 -3 NTP_4_2_3P54 sntp/sntp-opts.texi@1.29 +1 -1 NTP_4_2_3P54 sntp/sntp.1@1.32 +2 -2 NTP_4_2_3P54 util/ntp-keygen-opts.c@1.30 +2 -2 NTP_4_2_3P54 util/ntp-keygen-opts.h@1.30 +3 -3 NTP_4_2_3P54 util/ntp-keygen-opts.texi@1.29 +1 -1 NTP_4_2_3P54 util/ntp-keygen.1@1.29 +2 -2 NTP_4_2_3P54 ChangeSet@1.1379.1.35, 2006-10-10 02:39:26-04:00, stenn@whimsy.udel.edu [Bug 718] Use the recommended type for the saddrlen arg to getsockname() NEWS@1.67 +1 -0 [Bug 718] Use the recommended type for the saddrlen arg to getsockname() ntpd/ntp_io.c@1.234.1.13 +1 -1 [Bug 718] Use the recommended type for the saddrlen arg to getsockname() ChangeSet@1.1379.1.34, 2006-10-10 02:27:12-04:00, stenn@whimsy.udel.edu Use NO_OPTION_NAME_WARNINGS if cc does not support #warning configure.ac@1.388.1.11 +11 -0 Use NO_OPTION_NAME_WARNINGS if cc does not support #warning sntp/configure.ac@1.14 +11 -0 Use NO_OPTION_NAME_WARNINGS if cc does not support #warning ChangeSet@1.1379.1.33, 2006-10-09 07:41:25-04:00, stenn@whimsy.udel.edu NTP_4_2_3P53 TAG: NTP_4_2_3P53 ntpd/ntpd-opts.c@1.30 +2 -2 NTP_4_2_3P53 ntpd/ntpd-opts.h@1.30 +3 -3 NTP_4_2_3P53 ntpd/ntpd-opts.texi@1.30 +1 -1 NTP_4_2_3P53 ntpd/ntpd.1@1.29 +2 -2 NTP_4_2_3P53 ntpd/ntpdsim-opts.c@1.30 +2 -2 NTP_4_2_3P53 ntpd/ntpdsim-opts.h@1.30 +3 -3 NTP_4_2_3P53 ntpd/ntpdsim-opts.texi@1.29 +1 -1 NTP_4_2_3P53 ntpd/ntpdsim.1@1.29 +2 -2 NTP_4_2_3P53 ntpdc/ntpdc-opts.c@1.30 +2 -2 NTP_4_2_3P53 ntpdc/ntpdc-opts.h@1.30 +3 -3 NTP_4_2_3P53 ntpdc/ntpdc-opts.texi@1.29 +1 -1 NTP_4_2_3P53 ntpdc/ntpdc.1@1.29 +2 -2 NTP_4_2_3P53 ntpq/ntpq-opts.c@1.32 +2 -2 NTP_4_2_3P53 ntpq/ntpq-opts.h@1.32 +3 -3 NTP_4_2_3P53 ntpq/ntpq-opts.texi@1.30 +1 -1 NTP_4_2_3P53 ntpq/ntpq.1@1.29 +2 -2 NTP_4_2_3P53 packageinfo.sh@1.45 +1 -1 NTP_4_2_3P53 sntp/sntp-opts.c@1.29 +2 -2 NTP_4_2_3P53 sntp/sntp-opts.h@1.29 +3 -3 NTP_4_2_3P53 sntp/sntp-opts.texi@1.28 +1 -1 NTP_4_2_3P53 sntp/sntp.1@1.31 +2 -2 NTP_4_2_3P53 util/ntp-keygen-opts.c@1.29 +2 -2 NTP_4_2_3P53 util/ntp-keygen-opts.h@1.29 +3 -3 NTP_4_2_3P53 util/ntp-keygen-opts.texi@1.28 +1 -1 NTP_4_2_3P53 util/ntp-keygen.1@1.28 +2 -2 NTP_4_2_3P53 ChangeSet@1.1379.1.32, 2006-10-09 06:35:20-04:00, stenn@whimsy.udel.edu [Bug 715] Fix multicast issues under Linux NEWS@1.66 +1 -0 [Bug 715] Fix multicast issues under Linux libisc/ifiter_ioctl.c@1.25 +45 -7 [Bug 715] Fix multicast issues under Linux ChangeSet@1.1379.1.31, 2006-10-08 19:39:10-04:00, stenn@whimsy.udel.edu NTP_4_2_3P52 TAG: NTP_4_2_3P52 ntpd/ntpd-opts.c@1.29 +4 -4 NTP_4_2_3P52 ntpd/ntpd-opts.h@1.29 +3 -3 NTP_4_2_3P52 ntpd/ntpd-opts.texi@1.29 +3 -3 NTP_4_2_3P52 ntpd/ntpd.1@1.28 +2 -2 NTP_4_2_3P52 ntpd/ntpdsim-opts.c@1.29 +4 -4 NTP_4_2_3P52 ntpd/ntpdsim-opts.h@1.29 +3 -3 NTP_4_2_3P52 ntpd/ntpdsim-opts.texi@1.28 +3 -3 NTP_4_2_3P52 ntpd/ntpdsim.1@1.28 +2 -2 NTP_4_2_3P52 ntpdc/ntpdc-opts.c@1.29 +4 -4 NTP_4_2_3P52 ntpdc/ntpdc-opts.h@1.29 +3 -3 NTP_4_2_3P52 ntpdc/ntpdc-opts.texi@1.28 +2 -2 NTP_4_2_3P52 ntpdc/ntpdc.1@1.28 +2 -2 NTP_4_2_3P52 ntpq/ntpq-opts.c@1.31 +4 -4 NTP_4_2_3P52 ntpq/ntpq-opts.h@1.31 +3 -3 NTP_4_2_3P52 ntpq/ntpq-opts.texi@1.29 +3 -3 NTP_4_2_3P52 ntpq/ntpq.1@1.28 +2 -2 NTP_4_2_3P52 packageinfo.sh@1.44 +1 -1 NTP_4_2_3P52 sntp/sntp-opts.c@1.28 +2 -2 NTP_4_2_3P52 sntp/sntp-opts.h@1.28 +3 -3 NTP_4_2_3P52 sntp/sntp-opts.texi@1.27 +1 -1 NTP_4_2_3P52 sntp/sntp.1@1.30 +2 -2 NTP_4_2_3P52 util/ntp-keygen-opts.c@1.28 +4 -4 NTP_4_2_3P52 util/ntp-keygen-opts.h@1.28 +3 -3 NTP_4_2_3P52 util/ntp-keygen-opts.texi@1.27 +2 -2 NTP_4_2_3P52 util/ntp-keygen.1@1.27 +2 -2 NTP_4_2_3P52 ChangeSet@1.1379.1.30, 2006-10-08 04:32:17-04:00, stenn@whimsy.udel.edu libopts-27.5.3 clockstuff/clktest-opts.c@1.7 +9 -7 libopts-27.5.3 clockstuff/clktest-opts.h@1.7 +6 -4 libopts-27.5.3 libopts/Makefile.am@1.6 +1 -1 libopts-27.5.3 libopts/autoopts.c@1.9 +8 -6 libopts-27.5.3 libopts/autoopts/options.h@1.9 +131 -64 libopts-27.5.3 libopts/autoopts/usage-txt.h@1.8 +1 -1 libopts-27.5.3 libopts/configfile.c@1.9 +1 -1 libopts-27.5.3 libopts/cook.c@1.8 +1 -1 libopts-27.5.3 libopts/enumeration.c@1.8 +4 -4 libopts-27.5.3 libopts/genshell.c@1.8 +3 -1 libopts-27.5.3 libopts/genshell.h@1.8 +5 -3 libopts-27.5.3 libopts/load.c@1.9 +1 -1 libopts-27.5.3 libopts/m4/libopts.m4@1.13 +1 -1 libopts-27.5.3 libopts/makeshell.c@1.10 +13 -4 libopts-27.5.3 libopts/nested.c@1.8 +1 -1 libopts-27.5.3 libopts/numeric.c@1.8 +4 -4 libopts-27.5.3 libopts/proto.h@1.10 +1 -1 libopts-27.5.3 libopts/putshell.c@1.9 +8 -8 libopts-27.5.3 libopts/restore.c@1.8 +2 -2 libopts-27.5.3 libopts/save.c@1.9 +7 -8 libopts-27.5.3 libopts/stack.c@1.9 +3 -3 libopts-27.5.3 ntpd/ntpd-opts.c@1.28 +3 -1 libopts-27.5.3 ntpd/ntpd-opts.h@1.28 +6 -4 libopts-27.5.3 ntpd/ntpdsim-opts.c@1.28 +3 -1 libopts-27.5.3 ntpd/ntpdsim-opts.h@1.28 +6 -4 libopts-27.5.3 ntpdc/ntpdc-opts.c@1.28 +3 -1 libopts-27.5.3 ntpdc/ntpdc-opts.h@1.28 +6 -4 libopts-27.5.3 ntpq/ntpq-opts.c@1.30 +3 -1 libopts-27.5.3 ntpq/ntpq-opts.h@1.30 +6 -4 libopts-27.5.3 ntpq/ntpq-opts.texi@1.28 +1 -1 libopts-27.5.3 sntp/libopts/Makefile.am@1.4 +10 -6 libopts-27.5.3 sntp/libopts/autoopts.c@1.6 +8 -6 libopts-27.5.3 sntp/libopts/autoopts/options.h@1.6 +131 -64 libopts-27.5.3 sntp/libopts/autoopts/usage-txt.h@1.5 +1 -1 libopts-27.5.3 sntp/libopts/configfile.c@1.6 +1 -1 libopts-27.5.3 sntp/libopts/cook.c@1.5 +1 -1 libopts-27.5.3 sntp/libopts/enumeration.c@1.5 +4 -4 libopts-27.5.3 sntp/libopts/genshell.c@1.5 +3 -1 libopts-27.5.3 sntp/libopts/genshell.h@1.5 +5 -3 libopts-27.5.3 sntp/libopts/load.c@1.6 +1 -1 libopts-27.5.3 sntp/libopts/m4/libopts.m4@1.10 +1 -1 libopts-27.5.3 sntp/libopts/makeshell.c@1.7 +13 -4 libopts-27.5.3 sntp/libopts/nested.c@1.5 +1 -1 libopts-27.5.3 sntp/libopts/numeric.c@1.5 +4 -4 libopts-27.5.3 sntp/libopts/proto.h@1.7 +1 -1 libopts-27.5.3 sntp/libopts/putshell.c@1.6 +8 -8 libopts-27.5.3 sntp/libopts/restore.c@1.4 +2 -2 libopts-27.5.3 sntp/libopts/save.c@1.6 +7 -8 libopts-27.5.3 sntp/libopts/stack.c@1.6 +3 -3 libopts-27.5.3 sntp/sntp-opts.c@1.27 +3 -1 libopts-27.5.3 sntp/sntp-opts.h@1.27 +6 -4 libopts-27.5.3 util/ntp-keygen-opts.c@1.27 +5 -3 libopts-27.5.3 util/ntp-keygen-opts.h@1.27 +6 -4 libopts-27.5.3 ChangeSet@1.1379.9.1, 2006-10-07 19:42:28+00:00, kardel@pogo.udel.edu ntp_io.c: allow asyncio_readers to remove themselves when being run ntpd/ntp_io.c@1.234.1.12 +5 -3 allow asyncio_readers to remove themselves when being run ChangeSet@1.1379.1.28, 2006-10-05 10:20:42+00:00, burnicki@pogo.udel.edu [Bug 708] Set the affinity to a specific CPU for the clock interpolation thread only, not for the whole process. ports/winnt/ntpd/nt_clockstuff.c@1.22 +250 -575 Set the affinity to a specific CPU for the clock interpolation thread only, not for the whole process. ports/winnt/ntpd/win32_io.c@1.12 +0 -22 Set the affinity to a specific CPU for the clock interpolation thread only, not for the whole process. ChangeSet@1.1379.1.27, 2006-09-26 23:45:08-04:00, stenn@whimsy.udel.edu update NEWS NEWS@1.65 +2 -0 update ChangeSet@1.1379.8.3, 2006-09-26 22:17:09-04:00, mayer@pogo.udel.edu Unchanged ntpd/refclock_wwv.c@1.63.1.1 +4 -7 Unchanged ChangeSet@1.1379.8.2, 2006-09-26 18:14:39-04:00, mayer@pogo.udel.edu Bug #670: Fix for Transfer Aborted messages on Windows on reconfiguring interfaces ports/winnt/ntpd/ntp_iocompletionport.c@1.21 +98 -38 Bug #670: Fix for Transfer Aborted messages on Windows on reconfiguring interfaces ChangeSet@1.1379.8.1, 2006-09-26 18:11:11-04:00, mayer@pogo.udel.edu Bug #690: Fix for buffer address issue ports/winnt/libntp/dnslookup.c@1.4.1.3 +1 -1 Bug #690: Fix for buffer address issue ChangeSet@1.1379.1.25, 2006-09-26 16:16:30-04:00, stenn@whimsy.udel.edu autogen update clockstuff/clktest-opts.c@1.6 +2 -2 autogen update clockstuff/clktest-opts.h@1.6 +3 -3 autogen update ntpd/ntpd-opts.c@1.27 +3 -3 autogen update ntpd/ntpd-opts.h@1.27 +1 -1 autogen update ntpd/ntpd-opts.texi@1.28 +3 -3 autogen update ntpd/ntpd.1@1.27 +1 -1 autogen update ntpd/ntpdsim-opts.c@1.27 +3 -3 autogen update ntpd/ntpdsim-opts.h@1.27 +1 -1 autogen update ntpd/ntpdsim-opts.texi@1.27 +3 -3 autogen update ntpd/ntpdsim.1@1.27 +1 -1 autogen update ntpdc/ntpdc-opts.c@1.27 +3 -3 autogen update ntpdc/ntpdc-opts.h@1.27 +1 -1 autogen update ntpdc/ntpdc-opts.texi@1.27 +2 -2 autogen update ntpdc/ntpdc.1@1.27 +1 -1 autogen update ntpq/ntpq-opts.c@1.29 +3 -3 autogen update ntpq/ntpq-opts.h@1.29 +1 -1 autogen update ntpq/ntpq-opts.texi@1.27 +3 -3 autogen update ntpq/ntpq.1@1.27 +1 -1 autogen update sntp/sntp-opts.c@1.26 +1 -1 autogen update sntp/sntp-opts.h@1.26 +1 -1 autogen update sntp/sntp-opts.texi@1.26 +1 -1 autogen update sntp/sntp.1@1.29 +1 -1 autogen update util/ntp-keygen-opts.c@1.26 +3 -3 autogen update util/ntp-keygen-opts.h@1.26 +1 -1 autogen update util/ntp-keygen-opts.texi@1.26 +2 -2 autogen update util/ntp-keygen.1@1.26 +1 -1 autogen update ChangeSet@1.1379.1.24, 2006-09-25 07:49:15-04:00, stenn@whimsy.udel.edu NTP_4_2_3P51 TAG: NTP_4_2_3P51 ntpd/ntpd-opts.c@1.26 +4 -4 NTP_4_2_3P51 ntpd/ntpd-opts.h@1.26 +3 -3 NTP_4_2_3P51 ntpd/ntpd-opts.texi@1.27 +3 -3 NTP_4_2_3P51 ntpd/ntpd.1@1.26 +2 -2 NTP_4_2_3P51 ntpd/ntpdsim-opts.c@1.26 +4 -4 NTP_4_2_3P51 ntpd/ntpdsim-opts.h@1.26 +3 -3 NTP_4_2_3P51 ntpd/ntpdsim-opts.texi@1.26 +3 -3 NTP_4_2_3P51 ntpd/ntpdsim.1@1.26 +2 -2 NTP_4_2_3P51 ntpdc/ntpdc-opts.c@1.26 +4 -4 NTP_4_2_3P51 ntpdc/ntpdc-opts.h@1.26 +3 -3 NTP_4_2_3P51 ntpdc/ntpdc-opts.texi@1.26 +2 -2 NTP_4_2_3P51 ntpdc/ntpdc.1@1.26 +2 -2 NTP_4_2_3P51 ntpq/ntpq-opts.c@1.28 +4 -4 NTP_4_2_3P51 ntpq/ntpq-opts.h@1.28 +3 -3 NTP_4_2_3P51 ntpq/ntpq-opts.texi@1.26 +3 -3 NTP_4_2_3P51 ntpq/ntpq.1@1.26 +2 -2 NTP_4_2_3P51 packageinfo.sh@1.43 +1 -1 NTP_4_2_3P51 sntp/sntp-opts.c@1.25 +2 -2 NTP_4_2_3P51 sntp/sntp-opts.h@1.25 +3 -3 NTP_4_2_3P51 sntp/sntp-opts.texi@1.25 +1 -1 NTP_4_2_3P51 sntp/sntp.1@1.28 +2 -2 NTP_4_2_3P51 util/ntp-keygen-opts.c@1.25 +4 -4 NTP_4_2_3P51 util/ntp-keygen-opts.h@1.25 +3 -3 NTP_4_2_3P51 util/ntp-keygen-opts.texi@1.25 +2 -2 NTP_4_2_3P51 util/ntp-keygen.1@1.25 +2 -2 NTP_4_2_3P51 ChangeSet@1.1379.1.23, 2006-09-25 01:53:46-04:00, stenn@whimsy.udel.edu autogen upgrade NEWS@1.64 +6 -5 updates clockstuff/clktest-opts.c@1.5 +6 -3 autogen upgrade clockstuff/clktest-opts.h@1.5 +3 -3 autogen upgrade libopts/autoopts.c@1.8 +1 -2 autogen upgrade libopts/autoopts.h@1.8 +1 -2 autogen upgrade libopts/autoopts/options.h@1.8 +2 -2 autogen upgrade libopts/autoopts/usage-txt.h@1.7 +2 -2 autogen upgrade libopts/boolean.c@1.7 +1 -2 autogen upgrade libopts/compat/compat.h@1.11 +1 -2 autogen upgrade libopts/compat/pathfind.c@1.8 +3 -3 autogen upgrade libopts/compat/strchr.c@1.3 +0 -1 autogen upgrade libopts/compat/windows-config.h@1.4 +6 -0 autogen upgrade libopts/configfile.c@1.8 +34 -35 autogen upgrade libopts/cook.c@1.7 +5 -6 autogen upgrade libopts/enumeration.c@1.7 +1 -2 autogen upgrade libopts/environment.c@1.7 +1 -2 autogen upgrade libopts/genshell.c@1.7 +1 -1 autogen upgrade libopts/genshell.h@1.7 +1 -1 autogen upgrade libopts/load.c@1.8 +10 -11 autogen upgrade libopts/m4/libopts.m4@1.12 +4 -1 autogen upgrade libopts/m4/liboptschk.m4@1.2 +4 -1 autogen upgrade libopts/makeshell.c@1.9 +1 -2 autogen upgrade libopts/nested.c@1.7 +18 -19 autogen upgrade libopts/numeric.c@1.7 +1 -2 autogen upgrade libopts/pgusage.c@1.8 +1 -2 autogen upgrade libopts/proto.h@1.9 +1 -1 autogen upgrade libopts/putshell.c@1.8 +3 -4 autogen upgrade libopts/restore.c@1.7 +1 -2 autogen upgrade libopts/save.c@1.8 +1 -2 autogen upgrade libopts/sort.c@1.7 +1 -2 autogen upgrade libopts/stack.c@1.8 +1 -2 autogen upgrade libopts/streqvcmp.c@1.8 +1 -2 autogen upgrade libopts/text_mmap.c@1.7 +1 -2 autogen upgrade libopts/tokenize.c@1.5 +0 -1 autogen upgrade libopts/usage.c@1.8 +1 -2 autogen upgrade libopts/version.c@1.8 +1 -2 autogen upgrade ntpd/ntpd-opts.c@1.25 +3 -2 autogen upgrade ntpd/ntpd-opts.h@1.25 +1 -1 autogen upgrade ntpd/ntpd-opts.texi@1.26 +3 -3 autogen upgrade ntpd/ntpd.1@1.25 +2 -2 autogen upgrade ntpd/ntpdsim-opts.c@1.25 +3 -2 autogen upgrade ntpd/ntpdsim-opts.h@1.25 +1 -1 autogen upgrade ntpd/ntpdsim-opts.texi@1.25 +3 -3 autogen upgrade ntpd/ntpdsim.1@1.25 +2 -2 autogen upgrade ntpdc/ntpdc-opts.c@1.25 +3 -2 autogen upgrade ntpdc/ntpdc-opts.h@1.25 +1 -1 autogen upgrade ntpdc/ntpdc-opts.texi@1.25 +2 -2 autogen upgrade ntpdc/ntpdc.1@1.25 +2 -2 autogen upgrade ntpq/ntpq-opts.c@1.27 +3 -2 autogen upgrade ntpq/ntpq-opts.h@1.27 +1 -1 autogen upgrade ntpq/ntpq-opts.texi@1.25 +3 -3 autogen upgrade ntpq/ntpq.1@1.25 +2 -2 autogen upgrade sntp/libopts/autoopts.c@1.5 +1 -2 autogen upgrade sntp/libopts/autoopts.h@1.6 +1 -2 autogen upgrade sntp/libopts/autoopts/options.h@1.5 +2 -2 autogen upgrade sntp/libopts/autoopts/usage-txt.h@1.4 +2 -2 autogen upgrade sntp/libopts/boolean.c@1.4 +1 -2 autogen upgrade sntp/libopts/compat/compat.h@1.7 +1 -2 autogen upgrade sntp/libopts/compat/pathfind.c@1.5 +3 -3 autogen upgrade sntp/libopts/compat/strchr.c@1.3 +0 -1 autogen upgrade sntp/libopts/compat/windows-config.h@1.2 +16 -10 autogen upgrade sntp/libopts/configfile.c@1.5 +34 -35 autogen upgrade sntp/libopts/cook.c@1.4 +5 -6 autogen upgrade sntp/libopts/enumeration.c@1.4 +1 -2 autogen upgrade sntp/libopts/environment.c@1.4 +1 -2 autogen upgrade sntp/libopts/genshell.c@1.4 +1 -1 autogen upgrade sntp/libopts/genshell.h@1.4 +1 -1 autogen upgrade sntp/libopts/load.c@1.5 +10 -11 autogen upgrade sntp/libopts/m4/libopts.m4@1.9 +4 -1 autogen upgrade sntp/libopts/m4/liboptschk.m4@1.2 +4 -1 autogen upgrade sntp/libopts/makeshell.c@1.6 +1 -2 autogen upgrade sntp/libopts/nested.c@1.4 +18 -19 autogen upgrade sntp/libopts/numeric.c@1.4 +1 -2 autogen upgrade sntp/libopts/pgusage.c@1.4 +1 -2 autogen upgrade sntp/libopts/proto.h@1.6 +1 -1 autogen upgrade sntp/libopts/putshell.c@1.5 +3 -4 autogen upgrade sntp/libopts/restore.c@1.3 +1 -2 autogen upgrade sntp/libopts/save.c@1.5 +1 -2 autogen upgrade sntp/libopts/sort.c@1.3 +1 -2 autogen upgrade sntp/libopts/stack.c@1.5 +1 -2 autogen upgrade sntp/libopts/streqvcmp.c@1.5 +1 -2 autogen upgrade sntp/libopts/text_mmap.c@1.4 +1 -2 autogen upgrade sntp/libopts/tokenize.c@1.4 +0 -1 autogen upgrade sntp/libopts/usage.c@1.6 +1 -2 autogen upgrade sntp/libopts/version.c@1.5 +1 -2 autogen upgrade sntp/sntp-opts.c@1.24 +1 -1 autogen upgrade sntp/sntp-opts.h@1.24 +1 -1 autogen upgrade sntp/sntp-opts.texi@1.24 +1 -1 autogen upgrade sntp/sntp.1@1.27 +2 -2 autogen upgrade util/ntp-keygen-opts.c@1.24 +3 -2 autogen upgrade util/ntp-keygen-opts.h@1.24 +1 -1 autogen upgrade util/ntp-keygen-opts.texi@1.24 +2 -2 autogen upgrade util/ntp-keygen.1@1.24 +2 -2 autogen upgrade ChangeSet@1.1379.1.22, 2006-09-24 05:30:52-04:00, stenn@whimsy.udel.edu NTP_4_2_3P50 TAG: NTP_4_2_3P50 ntpd/ntpd-opts.c@1.24 +56 -55 NTP_4_2_3P50 ntpd/ntpd-opts.h@1.24 +9 -9 NTP_4_2_3P50 ntpd/ntpd-opts.texi@1.25 +1 -1 NTP_4_2_3P50 ntpd/ntpd.1@1.24 +2 -2 NTP_4_2_3P50 ntpd/ntpdsim-opts.c@1.24 +74 -73 NTP_4_2_3P50 ntpd/ntpdsim-opts.h@1.24 +9 -9 NTP_4_2_3P50 ntpd/ntpdsim-opts.texi@1.24 +1 -1 NTP_4_2_3P50 ntpd/ntpdsim.1@1.24 +2 -2 NTP_4_2_3P50 ntpdc/ntpdc-opts.c@1.24 +22 -21 NTP_4_2_3P50 ntpdc/ntpdc-opts.h@1.24 +7 -7 NTP_4_2_3P50 ntpdc/ntpdc-opts.texi@1.24 +1 -1 NTP_4_2_3P50 ntpdc/ntpdc.1@1.24 +2 -2 NTP_4_2_3P50 ntpq/ntpq-opts.c@1.26 +3 -3 NTP_4_2_3P50 ntpq/ntpq-opts.h@1.26 +3 -3 NTP_4_2_3P50 ntpq/ntpq-opts.texi@1.24 +3 -3 NTP_4_2_3P50 ntpq/ntpq.1@1.24 +2 -2 NTP_4_2_3P50 packageinfo.sh@1.42 +1 -1 NTP_4_2_3P50 sntp/sntp-opts.c@1.23 +17 -16 NTP_4_2_3P50 sntp/sntp-opts.h@1.23 +7 -7 NTP_4_2_3P50 sntp/sntp-opts.texi@1.23 +1 -1 NTP_4_2_3P50 sntp/sntp.1@1.26 +2 -2 NTP_4_2_3P50 util/ntp-keygen-opts.c@1.23 +43 -43 NTP_4_2_3P50 util/ntp-keygen-opts.h@1.23 +10 -10 NTP_4_2_3P50 util/ntp-keygen-opts.texi@1.23 +1 -1 NTP_4_2_3P50 util/ntp-keygen.1@1.23 +2 -2 NTP_4_2_3P50 ChangeSet@1.1379.1.21, 2006-09-24 03:03:52-04:00, stenn@whimsy.udel.edu autogen upgrade clockstuff/clktest-opts.c@1.4 +1 -1 autogen upgrade clockstuff/clktest-opts.c@1.3 +39 -39 new autogen clockstuff/clktest-opts.h@1.4 +1 -1 autogen upgrade clockstuff/clktest-opts.h@1.3 +10 -10 new autogen libopts/autoopts.c@1.7 +7 -7 autogen upgrade libopts/autoopts.h@1.7 +3 -3 autogen upgrade libopts/autoopts/options.h@1.7 +51 -42 autogen upgrade libopts/autoopts/usage-txt.h@1.6 +2 -2 autogen upgrade libopts/boolean.c@1.6 +6 -6 autogen upgrade libopts/compat/compat.h@1.10 +1 -1 autogen upgrade libopts/compat/pathfind.c@1.7 +16 -16 autogen upgrade libopts/compat/snprintf.c@1.4 +2 -2 autogen upgrade libopts/compat/strchr.c@1.2 +5 -5 autogen upgrade libopts/compat/strdup.c@1.3 +1 -1 autogen upgrade libopts/configfile.c@1.7 +23 -23 autogen upgrade libopts/cook.c@1.6 +3 -3 autogen upgrade libopts/enumeration.c@1.6 +23 -23 autogen upgrade libopts/environment.c@1.6 +2 -2 autogen upgrade libopts/genshell.c@1.6 +8 -8 autogen upgrade libopts/genshell.h@1.6 +4 -4 autogen upgrade libopts/load.c@1.7 +4 -4 autogen upgrade libopts/m4/libopts.m4@1.11 +3 -3 autogen upgrade libopts/makeshell.c@1.8 +13 -12 autogen upgrade libopts/nested.c@1.6 +38 -38 autogen upgrade libopts/numeric.c@1.6 +7 -7 autogen upgrade libopts/pgusage.c@1.7 +1 -1 autogen upgrade libopts/proto.h@1.8 +2 -2 autogen upgrade libopts/putshell.c@1.7 +12 -12 autogen upgrade libopts/restore.c@1.6 +1 -1 autogen upgrade libopts/save.c@1.7 +14 -12 autogen upgrade libopts/sort.c@1.6 +1 -1 autogen upgrade libopts/stack.c@1.7 +6 -6 autogen upgrade libopts/streqvcmp.c@1.7 +9 -9 autogen upgrade libopts/text_mmap.c@1.6 +3 -3 autogen upgrade libopts/tokenize.c@1.4 +8 -8 autogen upgrade libopts/usage.c@1.7 +2 -2 autogen upgrade libopts/version.c@1.7 +9 -9 autogen upgrade ntpq/ntpq-opts.c@1.25 +1 -1 autogen upgrade ntpq/ntpq-opts.c@1.24 +17 -17 new autogen ntpq/ntpq-opts.h@1.25 +1 -1 autogen upgrade ntpq/ntpq-opts.h@1.24 +5 -5 new autogen sntp/libopts/autoopts.c@1.4 +51 -7 autogen upgrade sntp/libopts/autoopts.h@1.5 +10 -9 autogen upgrade sntp/libopts/autoopts/options.h@1.4 +60 -51 autogen upgrade sntp/libopts/autoopts/usage-txt.h@1.3 +2 -2 autogen upgrade sntp/libopts/boolean.c@1.3 +5 -5 autogen upgrade sntp/libopts/compat/compat.h@1.6 +7 -7 autogen upgrade sntp/libopts/compat/pathfind.c@1.4 +19 -19 autogen upgrade sntp/libopts/compat/snprintf.c@1.3 +4 -4 autogen upgrade sntp/libopts/compat/strchr.c@1.2 +5 -5 autogen upgrade sntp/libopts/compat/strdup.c@1.2 +3 -3 autogen upgrade sntp/libopts/configfile.c@1.4 +37 -35 autogen upgrade sntp/libopts/cook.c@1.3 +3 -3 autogen upgrade sntp/libopts/enumeration.c@1.3 +23 -23 autogen upgrade sntp/libopts/environment.c@1.3 +2 -2 autogen upgrade sntp/libopts/genshell.c@1.3 +11 -10 autogen upgrade sntp/libopts/genshell.h@1.3 +8 -8 autogen upgrade sntp/libopts/load.c@1.4 +4 -4 autogen upgrade sntp/libopts/m4/libopts.m4@1.8 +8 -3 autogen upgrade sntp/libopts/makeshell.c@1.5 +13 -12 autogen upgrade sntp/libopts/nested.c@1.3 +40 -40 autogen upgrade sntp/libopts/numeric.c@1.3 +6 -6 autogen upgrade sntp/libopts/proto.h@1.5 +14 -2 autogen upgrade sntp/libopts/putshell.c@1.4 +11 -11 autogen upgrade sntp/libopts/save.c@1.4 +14 -12 autogen upgrade sntp/libopts/stack.c@1.4 +5 -5 autogen upgrade sntp/libopts/streqvcmp.c@1.4 +9 -9 autogen upgrade sntp/libopts/text_mmap.c@1.3 +12 -16 autogen upgrade sntp/libopts/tokenize.c@1.3 +16 -16 autogen upgrade sntp/libopts/usage.c@1.5 +2 -2 autogen upgrade sntp/libopts/version.c@1.4 +9 -9 autogen upgrade ChangeSet@1.1379.1.20, 2006-09-23 17:23:36+00:00, kardel@pogo.udel.edu ntpd.h, ntpd.c, ntp_timer.c, ntp_io.c, cmd_args.c: disable dynamic update when giving up the root privilege include/ntpd.h@1.97 +3 -0 disable dynamic update when giving up the root privilege ntpd/cmd_args.c@1.45 +0 -1 disable dynamic update when giving up the root privilege ntpd/ntp_io.c@1.234.1.11 +22 -5 disable dynamic update when giving up the root privilege ntpd/ntp_timer.c@1.33 +1 -1 disable dynamic update when giving up the root privilege ntpd/ntpd.c@1.82 +12 -0 disable dynamic update when giving up the root privilege ChangeSet@1.1379.7.2, 2006-09-22 20:27:38-04:00, stenn@whimsy.udel.edu [Bug 714] ntpq -p should conflict with -i, not -c. NEWS@1.63 +1 -0 update ntpq/ntpq-opts.c@1.23 +5 -4 [Bug 714] ntpq -p should conflict with -i, not -c. ntpq/ntpq-opts.def@1.11 +1 -1 [Bug 714] ntpq -p should conflict with -i, not -c. ntpq/ntpq-opts.h@1.23 +1 -1 [Bug 714] ntpq -p should conflict with -i, not -c. ntpq/ntpq-opts.texi@1.23 +4 -4 [Bug 714] ntpq -p should conflict with -i, not -c. ntpq/ntpq.1@1.23 +3 -3 [Bug 714] ntpq -p should conflict with -i, not -c. ChangeSet@1.1379.7.1, 2006-09-22 19:38:01-04:00, stenn@whimsy.udel.edu Upgrade to libopts-27.4.3 libopts/Makefile.am@1.5 +10 -6 Upgrade to libopts-27.4.3 libopts/autoopts.c@1.6 +1 -1 Upgrade to libopts-27.4.3 libopts/autoopts.h@1.6 +1 -1 Upgrade to libopts-27.4.3 libopts/autoopts/options.h@1.6 +5 -5 Upgrade to libopts-27.4.3 libopts/autoopts/usage-txt.h@1.5 +1 -1 Upgrade to libopts-27.4.3 libopts/boolean.c@1.5 +1 -1 Upgrade to libopts-27.4.3 libopts/compat/compat.h@1.9 +5 -5 Upgrade to libopts-27.4.3 libopts/compat/pathfind.c@1.6 +2 -2 Upgrade to libopts-27.4.3 libopts/compat/snprintf.c@1.3 +2 -2 Upgrade to libopts-27.4.3 libopts/compat/strdup.c@1.2 +2 -2 Upgrade to libopts-27.4.3 libopts/compat/windows-config.h@1.3 +6 -6 Upgrade to libopts-27.4.3 libopts/configfile.c@1.6 +12 -13 Upgrade to libopts-27.4.3 libopts/cook.c@1.5 +1 -1 Upgrade to libopts-27.4.3 libopts/enumeration.c@1.5 +1 -1 Upgrade to libopts-27.4.3 libopts/environment.c@1.5 +1 -1 Upgrade to libopts-27.4.3 libopts/genshell.c@1.5 +4 -3 Upgrade to libopts-27.4.3 libopts/genshell.h@1.5 +1 -1 Upgrade to libopts-27.4.3 libopts/load.c@1.6 +1 -1 Upgrade to libopts-27.4.3 libopts/m4/libopts.m4@1.10 +6 -1 Upgrade to libopts-27.4.3 libopts/makeshell.c@1.7 +1 -1 Upgrade to libopts-27.4.3 libopts/nested.c@1.5 +3 -3 Upgrade to libopts-27.4.3 libopts/numeric.c@1.5 +1 -1 Upgrade to libopts-27.4.3 libopts/pgusage.c@1.6 +1 -1 Upgrade to libopts-27.4.3 libopts/proto.h@1.7 +1 -1 Upgrade to libopts-27.4.3 libopts/putshell.c@1.6 +1 -1 Upgrade to libopts-27.4.3 libopts/restore.c@1.5 +1 -1 Upgrade to libopts-27.4.3 libopts/save.c@1.6 +1 -1 Upgrade to libopts-27.4.3 libopts/sort.c@1.5 +1 -1 Upgrade to libopts-27.4.3 libopts/stack.c@1.6 +1 -1 Upgrade to libopts-27.4.3 libopts/streqvcmp.c@1.6 +1 -1 Upgrade to libopts-27.4.3 libopts/text_mmap.c@1.5 +3 -2 Upgrade to libopts-27.4.3 libopts/tokenize.c@1.3 +14 -14 Upgrade to libopts-27.4.3 libopts/usage.c@1.6 +1 -1 Upgrade to libopts-27.4.3 libopts/version.c@1.6 +1 -1 Upgrade to libopts-27.4.3 ChangeSet@1.1379.1.18, 2006-09-22 22:58:27+00:00, kardel@pogo.udel.edu ntp_io.c: add autoconfig enabled code to temporarily set SO_REUSEADDR on wildcard sockets when binding interface addresses. So OSes need this configure.ac: add configtest for REUSEADDR enable on wildcard sockets to allow binding to interface addresses configure.ac@1.388.1.10 +13 -0 add configtest for REUSEADDR enable on wildcard sockets to allow binding to interface addresses ntpd/ntp_io.c@1.234.1.10 +96 -48 add autoconfig enabled code to temporarily set SO_REUSEADDR on wildcard sockets when binding interface addresses. So OSes need this ChangeSet@1.1379.1.17, 2006-09-22 17:12:19-04:00, stenn@whimsy.udel.edu Dave fixed a bug in the pll/kernel control code, from a report by Joe Harvell ntpd/ntp_loopfilter.c@1.126 +2 -1 Dave fixed a bug in the pll/kernel control code, from a report by Joe Harvell ChangeSet@1.1379.1.16, 2006-09-21 07:42:50-04:00, stenn@whimsy.udel.edu NTP_4_2_3P49 TAG: NTP_4_2_3P49 ntpd/ntpd-opts.c@1.23 +2 -2 NTP_4_2_3P49 ntpd/ntpd-opts.h@1.23 +3 -3 NTP_4_2_3P49 ntpd/ntpd-opts.texi@1.24 +1 -1 NTP_4_2_3P49 ntpd/ntpd.1@1.23 +2 -2 NTP_4_2_3P49 ntpd/ntpdsim-opts.c@1.23 +2 -2 NTP_4_2_3P49 ntpd/ntpdsim-opts.h@1.23 +3 -3 NTP_4_2_3P49 ntpd/ntpdsim-opts.texi@1.23 +1 -1 NTP_4_2_3P49 ntpd/ntpdsim.1@1.23 +2 -2 NTP_4_2_3P49 ntpdc/ntpdc-opts.c@1.23 +2 -2 NTP_4_2_3P49 ntpdc/ntpdc-opts.h@1.23 +3 -3 NTP_4_2_3P49 ntpdc/ntpdc-opts.texi@1.23 +1 -1 NTP_4_2_3P49 ntpdc/ntpdc.1@1.23 +2 -2 NTP_4_2_3P49 ntpq/ntpq-opts.c@1.22 +2 -2 NTP_4_2_3P49 ntpq/ntpq-opts.h@1.22 +3 -3 NTP_4_2_3P49 ntpq/ntpq-opts.texi@1.22 +1 -1 NTP_4_2_3P49 ntpq/ntpq.1@1.22 +2 -2 NTP_4_2_3P49 packageinfo.sh@1.41 +1 -1 NTP_4_2_3P49 sntp/sntp-opts.c@1.22 +2 -2 NTP_4_2_3P49 sntp/sntp-opts.h@1.22 +3 -3 NTP_4_2_3P49 sntp/sntp-opts.texi@1.22 +1 -1 NTP_4_2_3P49 sntp/sntp.1@1.25 +2 -2 NTP_4_2_3P49 util/ntp-keygen-opts.c@1.22 +2 -2 NTP_4_2_3P49 util/ntp-keygen-opts.h@1.22 +3 -3 NTP_4_2_3P49 util/ntp-keygen-opts.texi@1.22 +1 -1 NTP_4_2_3P49 util/ntp-keygen.1@1.22 +2 -2 NTP_4_2_3P49 ChangeSet@1.1379.1.15, 2006-09-20 19:41:43-04:00, stenn@whimsy.udel.edu refclock_wwv.c improvements from Dave Mills NEWS@1.62 +1 -0 refclock_wwv.c improvements from Dave Mills ntpd/refclock_wwv.c@1.64 +50 -40 refclock_wwv.c improvements from Dave Mills ChangeSet@1.1379.1.14, 2006-09-20 19:31:10-04:00, stenn@whimsy.udel.edu [Bug 689] Deprecate HEATH GC-1001 II; the driver never worked. NEWS@1.61 +1 -0 [Bug 689] Deprecate HEATH GC-1001 II; the driver never worked. ntpd/refclock_heath.c@1.13 +39 -10 [Bug 689] Deprecate HEATH GC-1001 II; the driver never worked. ChangeSet@1.1379.1.13, 2006-09-19 07:43:25-04:00, stenn@whimsy.udel.edu NTP_4_2_3P48 TAG: NTP_4_2_3P48 ntpd/ntpd-opts.c@1.22 +2 -2 NTP_4_2_3P48 ntpd/ntpd-opts.h@1.22 +3 -3 NTP_4_2_3P48 ntpd/ntpd-opts.texi@1.23 +1 -1 NTP_4_2_3P48 ntpd/ntpd.1@1.22 +2 -2 NTP_4_2_3P48 ntpd/ntpdsim-opts.c@1.22 +2 -2 NTP_4_2_3P48 ntpd/ntpdsim-opts.h@1.22 +3 -3 NTP_4_2_3P48 ntpd/ntpdsim-opts.texi@1.22 +1 -1 NTP_4_2_3P48 ntpd/ntpdsim.1@1.22 +2 -2 NTP_4_2_3P48 ntpdc/ntpdc-opts.c@1.22 +2 -2 NTP_4_2_3P48 ntpdc/ntpdc-opts.h@1.22 +3 -3 NTP_4_2_3P48 ntpdc/ntpdc-opts.texi@1.22 +1 -1 NTP_4_2_3P48 ntpdc/ntpdc.1@1.22 +2 -2 NTP_4_2_3P48 ntpq/ntpq-opts.c@1.21 +2 -2 NTP_4_2_3P48 ntpq/ntpq-opts.h@1.21 +3 -3 NTP_4_2_3P48 ntpq/ntpq-opts.texi@1.21 +1 -1 NTP_4_2_3P48 ntpq/ntpq.1@1.21 +2 -2 NTP_4_2_3P48 packageinfo.sh@1.40 +1 -1 NTP_4_2_3P48 sntp/sntp-opts.c@1.21 +2 -2 NTP_4_2_3P48 sntp/sntp-opts.h@1.21 +3 -3 NTP_4_2_3P48 sntp/sntp-opts.texi@1.21 +1 -1 NTP_4_2_3P48 sntp/sntp.1@1.24 +2 -2 NTP_4_2_3P48 util/ntp-keygen-opts.c@1.21 +2 -2 NTP_4_2_3P48 util/ntp-keygen-opts.h@1.21 +3 -3 NTP_4_2_3P48 util/ntp-keygen-opts.texi@1.21 +1 -1 NTP_4_2_3P48 util/ntp-keygen.1@1.21 +2 -2 NTP_4_2_3P48 ChangeSet@1.1251.94.59, 2006-09-18 23:55:40-04:00, stenn@whimsy.udel.edu NTP_4_2_2P4_RC4 TAG: NTP_4_2_2P4_RC4 packageinfo.sh@1.27.19.2 +1 -1 NTP_4_2_2P4_RC4 ChangeSet@1.1251.94.58, 2006-09-18 18:06:02-04:00, stenn@whimsy.udel.edu [Bug 710] Backport Danny's latest patch libntp/ntp_rfc2553.c@1.27.1.6 +10 -3 [Bug 710] Backport Danny's latest patch ChangeSet@1.1379.1.11, 2006-09-18 16:23:45-04:00, mayer@pogo.udel.edu Bug #710 Fix new off-by-one error libntp/ntp_rfc2553.c@1.35 +1 -1 Bug #710 Fix new off-by-one error ChangeSet@1.1379.1.10, 2006-09-18 16:17:26-04:00, mayer@pogo.udel.edu Bug #655 Added refid for broadcast mode ntpd/ntp_io.c@1.234.1.9 +1 -0 Bug #655 Added refid for broadcast mode ChangeSet@1.1379.1.9, 2006-09-18 08:46:18-04:00, mayer@pogo.udel.edu Bug #710 fix the length being copied in getnameinfo libntp/ntp_rfc2553.c@1.34 +10 -3 Bug #710 fix the length being copied in getnameinfo ChangeSet@1.1379.2.35, 2006-09-16 18:54:38-04:00, stenn@whimsy.udel.edu NTP_4_2_3P47 TAG: NTP_4_2_3P47 ntpd/ntpd-opts.c@1.21 +2 -2 NTP_4_2_3P47 ntpd/ntpd-opts.h@1.21 +3 -3 NTP_4_2_3P47 ntpd/ntpd-opts.texi@1.22 +1 -1 NTP_4_2_3P47 ntpd/ntpd.1@1.21 +2 -2 NTP_4_2_3P47 ntpd/ntpdsim-opts.c@1.21 +2 -2 NTP_4_2_3P47 ntpd/ntpdsim-opts.h@1.21 +3 -3 NTP_4_2_3P47 ntpd/ntpdsim-opts.texi@1.21 +1 -1 NTP_4_2_3P47 ntpd/ntpdsim.1@1.21 +2 -2 NTP_4_2_3P47 ntpdc/ntpdc-opts.c@1.21 +2 -2 NTP_4_2_3P47 ntpdc/ntpdc-opts.h@1.21 +3 -3 NTP_4_2_3P47 ntpdc/ntpdc-opts.texi@1.21 +1 -1 NTP_4_2_3P47 ntpdc/ntpdc.1@1.21 +2 -2 NTP_4_2_3P47 ntpq/ntpq-opts.c@1.20 +2 -2 NTP_4_2_3P47 ntpq/ntpq-opts.h@1.20 +3 -3 NTP_4_2_3P47 ntpq/ntpq-opts.texi@1.20 +1 -1 NTP_4_2_3P47 ntpq/ntpq.1@1.20 +2 -2 NTP_4_2_3P47 packageinfo.sh@1.39 +1 -1 NTP_4_2_3P47 sntp/sntp-opts.c@1.20 +2 -2 NTP_4_2_3P47 sntp/sntp-opts.h@1.20 +3 -3 NTP_4_2_3P47 sntp/sntp-opts.texi@1.20 +1 -1 NTP_4_2_3P47 sntp/sntp.1@1.23 +2 -2 NTP_4_2_3P47 util/ntp-keygen-opts.c@1.20 +2 -2 NTP_4_2_3P47 util/ntp-keygen-opts.h@1.20 +3 -3 NTP_4_2_3P47 util/ntp-keygen-opts.texi@1.20 +1 -1 NTP_4_2_3P47 util/ntp-keygen.1@1.20 +2 -2 NTP_4_2_3P47 ChangeSet@1.1251.94.57, 2006-09-16 17:32:32-04:00, stenn@whimsy.udel.edu NTP_4_2_2P4_RC3 TAG: NTP_4_2_2P4_RC3 packageinfo.sh@1.27.19.1 +1 -1 NTP_4_2_2P4_RC3 ChangeSet@1.1251.94.56, 2006-09-16 16:52:07-04:00, stenn@whimsy.udel.edu updated NEWS NEWS@1.50.1.6 +4 -0 updated ChangeSet@1.1251.94.55, 2006-09-16 15:00:36-04:00, stenn@whimsy.udel.edu [Bug 710] compat getnameinfo() has off-by-one error libntp/ntp_rfc2553.c@1.27.1.5 +1 -1 [Bug 710] compat getnameinfo() has off-by-one error ChangeSet@1.1379.2.33, 2006-09-13 07:43:13-04:00, stenn@whimsy.udel.edu NTP_4_2_3P46 TAG: NTP_4_2_3P46 ntpd/ntpd-opts.c@1.20 +2 -2 NTP_4_2_3P46 ntpd/ntpd-opts.h@1.20 +3 -3 NTP_4_2_3P46 ntpd/ntpd-opts.texi@1.21 +1 -1 NTP_4_2_3P46 ntpd/ntpd.1@1.20 +2 -2 NTP_4_2_3P46 ntpd/ntpdsim-opts.c@1.20 +2 -2 NTP_4_2_3P46 ntpd/ntpdsim-opts.h@1.20 +3 -3 NTP_4_2_3P46 ntpd/ntpdsim-opts.texi@1.20 +1 -1 NTP_4_2_3P46 ntpd/ntpdsim.1@1.20 +2 -2 NTP_4_2_3P46 ntpdc/ntpdc-opts.c@1.20 +2 -2 NTP_4_2_3P46 ntpdc/ntpdc-opts.h@1.20 +3 -3 NTP_4_2_3P46 ntpdc/ntpdc-opts.texi@1.20 +1 -1 NTP_4_2_3P46 ntpdc/ntpdc.1@1.20 +2 -2 NTP_4_2_3P46 ntpq/ntpq-opts.c@1.19 +2 -2 NTP_4_2_3P46 ntpq/ntpq-opts.h@1.19 +3 -3 NTP_4_2_3P46 ntpq/ntpq-opts.texi@1.19 +1 -1 NTP_4_2_3P46 ntpq/ntpq.1@1.19 +2 -2 NTP_4_2_3P46 packageinfo.sh@1.38 +1 -1 NTP_4_2_3P46 sntp/sntp-opts.c@1.19 +2 -2 NTP_4_2_3P46 sntp/sntp-opts.h@1.19 +3 -3 NTP_4_2_3P46 sntp/sntp-opts.texi@1.19 +1 -1 NTP_4_2_3P46 sntp/sntp.1@1.22 +2 -2 NTP_4_2_3P46 util/ntp-keygen-opts.c@1.19 +2 -2 NTP_4_2_3P46 util/ntp-keygen-opts.h@1.19 +3 -3 NTP_4_2_3P46 util/ntp-keygen-opts.texi@1.19 +1 -1 NTP_4_2_3P46 util/ntp-keygen.1@1.19 +2 -2 NTP_4_2_3P46 ChangeSet@1.1379.2.32, 2006-09-13 04:49:48-04:00, stenn@whimsy.udel.edu WWV documentation fixes from Dave Mills. html/drivers/driver36.html@1.28 +53 -100 WWV documentation fixes from Dave Mills. html/drivers/driver44.html@1.13 +0 -0 Change mode to -rw-rw-r-- ChangeSet@1.1379.2.31, 2006-09-13 04:44:52-04:00, stenn@whimsy.udel.edu [Bug 704] Fix documentation typo html/authopt.html@1.41 +2 -2 [Bug 704] Fix documentation typo ChangeSet@1.1379.2.30, 2006-09-12 21:35:52-04:00, stenn@whimsy.udel.edu [Bug 706] Only 1 instance of ntpd should be running ntpd/ntp_io.c@1.234.1.8 +17 -5 [Bug 706] Only 1 instance of ntpd should be running ChangeSet@1.1379.2.29, 2006-09-12 07:42:34-04:00, stenn@whimsy.udel.edu NTP_4_2_3P45 TAG: NTP_4_2_3P45 ntpd/ntpd-opts.c@1.19 +2 -2 NTP_4_2_3P45 ntpd/ntpd-opts.h@1.19 +3 -3 NTP_4_2_3P45 ntpd/ntpd-opts.texi@1.20 +1 -1 NTP_4_2_3P45 ntpd/ntpd.1@1.19 +2 -2 NTP_4_2_3P45 ntpd/ntpdsim-opts.c@1.19 +2 -2 NTP_4_2_3P45 ntpd/ntpdsim-opts.h@1.19 +3 -3 NTP_4_2_3P45 ntpd/ntpdsim-opts.texi@1.19 +1 -1 NTP_4_2_3P45 ntpd/ntpdsim.1@1.19 +2 -2 NTP_4_2_3P45 ntpdc/ntpdc-opts.c@1.19 +2 -2 NTP_4_2_3P45 ntpdc/ntpdc-opts.h@1.19 +3 -3 NTP_4_2_3P45 ntpdc/ntpdc-opts.texi@1.19 +1 -1 NTP_4_2_3P45 ntpdc/ntpdc.1@1.19 +2 -2 NTP_4_2_3P45 ntpq/ntpq-opts.c@1.18 +2 -2 NTP_4_2_3P45 ntpq/ntpq-opts.h@1.18 +3 -3 NTP_4_2_3P45 ntpq/ntpq-opts.texi@1.18 +1 -1 NTP_4_2_3P45 ntpq/ntpq.1@1.18 +2 -2 NTP_4_2_3P45 packageinfo.sh@1.37 +1 -1 NTP_4_2_3P45 sntp/sntp-opts.c@1.18 +2 -2 NTP_4_2_3P45 sntp/sntp-opts.h@1.18 +3 -3 NTP_4_2_3P45 sntp/sntp-opts.texi@1.18 +1 -1 NTP_4_2_3P45 sntp/sntp.1@1.21 +2 -2 NTP_4_2_3P45 util/ntp-keygen-opts.c@1.18 +2 -2 NTP_4_2_3P45 util/ntp-keygen-opts.h@1.18 +3 -3 NTP_4_2_3P45 util/ntp-keygen-opts.texi@1.18 +1 -1 NTP_4_2_3P45 util/ntp-keygen.1@1.18 +2 -2 NTP_4_2_3P45 ChangeSet@1.1379.6.1, 2006-09-12 08:25:26+00:00, kardel@pogo.udel.edu ntp_peer.c: CID 7: avoid calling broadcast/multicast setup with NULL interface ntpd/ntp_peer.c@1.97 +13 -11 CID 7: avoid calling broadcast/multicast setup with NULL interface ChangeSet@1.1379.2.27, 2006-09-12 04:03:30-04:00, stenn@whimsy.udel.edu WWV refclock fixes from Dave Mills ntpd/refclock_wwv.c@1.63 +7 -4 WWV refclock fixes from Dave Mills ChangeSet@1.1379.2.26, 2006-09-12 06:35:18+00:00, kardel@pogo.udel.edu ntp_io.c: unify output of "Listening in interface..." message add listing of wildcard interface bindings ntpd/ntp_io.c@1.234.1.7 +25 -13 unify output of "Listening in interface..." message add listing of wildcard interface bindings ChangeSet@1.1379.2.25, 2006-09-11 07:47:06-04:00, stenn@whimsy.udel.edu NTP_4_2_3P44 TAG: NTP_4_2_3P44 ntpd/ntpd-opts.c@1.18 +2 -2 NTP_4_2_3P44 ntpd/ntpd-opts.h@1.18 +3 -3 NTP_4_2_3P44 ntpd/ntpd-opts.texi@1.19 +1 -1 NTP_4_2_3P44 ntpd/ntpd.1@1.18 +2 -2 NTP_4_2_3P44 ntpd/ntpdsim-opts.c@1.18 +2 -2 NTP_4_2_3P44 ntpd/ntpdsim-opts.h@1.18 +3 -3 NTP_4_2_3P44 ntpd/ntpdsim-opts.texi@1.18 +1 -1 NTP_4_2_3P44 ntpd/ntpdsim.1@1.18 +2 -2 NTP_4_2_3P44 ntpdc/ntpdc-opts.c@1.18 +2 -2 NTP_4_2_3P44 ntpdc/ntpdc-opts.h@1.18 +3 -3 NTP_4_2_3P44 ntpdc/ntpdc-opts.texi@1.18 +1 -1 NTP_4_2_3P44 ntpdc/ntpdc.1@1.18 +2 -2 NTP_4_2_3P44 ntpq/ntpq-opts.c@1.17 +2 -2 NTP_4_2_3P44 ntpq/ntpq-opts.h@1.17 +3 -3 NTP_4_2_3P44 ntpq/ntpq-opts.texi@1.17 +1 -1 NTP_4_2_3P44 ntpq/ntpq.1@1.17 +2 -2 NTP_4_2_3P44 packageinfo.sh@1.36 +1 -1 NTP_4_2_3P44 sntp/sntp-opts.c@1.17 +2 -2 NTP_4_2_3P44 sntp/sntp-opts.h@1.17 +3 -3 NTP_4_2_3P44 sntp/sntp-opts.texi@1.17 +1 -1 NTP_4_2_3P44 sntp/sntp.1@1.20 +2 -2 NTP_4_2_3P44 util/ntp-keygen-opts.c@1.17 +2 -2 NTP_4_2_3P44 util/ntp-keygen-opts.h@1.17 +3 -3 NTP_4_2_3P44 util/ntp-keygen-opts.texi@1.17 +1 -1 NTP_4_2_3P44 util/ntp-keygen.1@1.17 +2 -2 NTP_4_2_3P44 ChangeSet@1.1379.2.24, 2006-09-10 20:47:32-04:00, stenn@whimsy.udel.edu libopts-27.4.3 updates libopts/autoopts.c@1.5 +46 -2 libopts-27.4.3 updates libopts/autoopts.h@1.5 +8 -7 libopts-27.4.3 updates libopts/autoopts/options.h@1.5 +3 -3 libopts-27.4.3 updates libopts/autoopts/usage-txt.h@1.4 +1 -1 libopts-27.4.3 updates libopts/boolean.c@1.4 +1 -1 libopts-27.4.3 updates libopts/compat/compat.h@1.8 +1 -1 libopts-27.4.3 updates libopts/compat/pathfind.c@1.5 +2 -2 libopts-27.4.3 updates libopts/configfile.c@1.5 +5 -2 libopts-27.4.3 updates libopts/cook.c@1.4 +1 -1 libopts-27.4.3 updates libopts/enumeration.c@1.4 +1 -1 libopts-27.4.3 updates libopts/environment.c@1.4 +1 -1 libopts-27.4.3 updates libopts/genshell.c@1.4 +1 -1 libopts-27.4.3 updates libopts/genshell.h@1.4 +1 -1 libopts-27.4.3 updates libopts/load.c@1.5 +1 -1 libopts-27.4.3 updates libopts/m4/libopts.m4@1.9 +1 -1 libopts-27.4.3 updates libopts/makeshell.c@1.6 +1 -1 libopts-27.4.3 updates libopts/nested.c@1.4 +1 -1 libopts-27.4.3 updates libopts/numeric.c@1.4 +1 -1 libopts-27.4.3 updates libopts/pgusage.c@1.5 +1 -1 libopts-27.4.3 updates libopts/proto.h@1.6 +13 -1 libopts-27.4.3 updates libopts/putshell.c@1.5 +1 -1 libopts-27.4.3 updates libopts/restore.c@1.4 +1 -1 libopts-27.4.3 updates libopts/save.c@1.5 +1 -1 libopts-27.4.3 updates libopts/sort.c@1.4 +1 -1 libopts-27.4.3 updates libopts/stack.c@1.5 +1 -1 libopts-27.4.3 updates libopts/streqvcmp.c@1.5 +1 -1 libopts-27.4.3 updates libopts/text_mmap.c@1.4 +3 -8 libopts-27.4.3 updates libopts/usage.c@1.5 +1 -1 libopts-27.4.3 updates libopts/version.c@1.5 +1 -1 libopts-27.4.3 updates ChangeSet@1.1379.2.23, 2006-09-10 18:03:04-04:00, stenn@whimsy.udel.edu NTP_4_2_3P43 TAG: NTP_4_2_3P43 ntpd/ntpd-opts.c@1.17 +2 -2 NTP_4_2_3P43 ntpd/ntpd-opts.h@1.17 +3 -3 NTP_4_2_3P43 ntpd/ntpd-opts.texi@1.18 +1 -1 NTP_4_2_3P43 ntpd/ntpd.1@1.17 +2 -2 NTP_4_2_3P43 ntpd/ntpdsim-opts.c@1.17 +2 -2 NTP_4_2_3P43 ntpd/ntpdsim-opts.h@1.17 +3 -3 NTP_4_2_3P43 ntpd/ntpdsim-opts.texi@1.17 +1 -1 NTP_4_2_3P43 ntpd/ntpdsim.1@1.17 +2 -2 NTP_4_2_3P43 ntpdc/ntpdc-opts.c@1.17 +2 -2 NTP_4_2_3P43 ntpdc/ntpdc-opts.h@1.17 +3 -3 NTP_4_2_3P43 ntpdc/ntpdc-opts.texi@1.17 +1 -1 NTP_4_2_3P43 ntpdc/ntpdc.1@1.17 +2 -2 NTP_4_2_3P43 ntpq/ntpq-opts.c@1.16 +2 -2 NTP_4_2_3P43 ntpq/ntpq-opts.h@1.16 +3 -3 NTP_4_2_3P43 ntpq/ntpq-opts.texi@1.16 +1 -1 NTP_4_2_3P43 ntpq/ntpq.1@1.16 +2 -2 NTP_4_2_3P43 packageinfo.sh@1.35 +1 -1 NTP_4_2_3P43 sntp/sntp-opts.c@1.16 +2 -2 NTP_4_2_3P43 sntp/sntp-opts.h@1.16 +3 -3 NTP_4_2_3P43 sntp/sntp-opts.texi@1.16 +1 -1 NTP_4_2_3P43 sntp/sntp.1@1.19 +2 -2 NTP_4_2_3P43 util/ntp-keygen-opts.c@1.16 +2 -2 NTP_4_2_3P43 util/ntp-keygen-opts.h@1.16 +3 -3 NTP_4_2_3P43 util/ntp-keygen-opts.texi@1.16 +1 -1 NTP_4_2_3P43 util/ntp-keygen.1@1.16 +2 -2 NTP_4_2_3P43 ChangeSet@1.1379.2.22, 2006-09-10 15:58:36-04:00, stenn@whimsy.udel.edu [CID 3] Not a typo. Rename variables so Harlan can read the code easier libntp/recvbuff.c@1.24 +5 -4 [CID 3] Not a typo. Rename variables so Harlan can read the code easier ChangeSet@1.1379.2.21, 2006-09-10 07:48:06-04:00, stenn@whimsy.udel.edu NTP_4_2_3P42 TAG: NTP_4_2_3P42 ntpd/ntpd-opts.c@1.16 +2 -2 NTP_4_2_3P42 ntpd/ntpd-opts.h@1.16 +142 -171 NTP_4_2_3P42 ntpd/ntpd-opts.texi@1.17 +1 -1 NTP_4_2_3P42 ntpd/ntpd.1@1.16 +2 -2 NTP_4_2_3P42 ntpd/ntpdsim-opts.c@1.16 +2 -2 NTP_4_2_3P42 ntpd/ntpdsim-opts.h@1.16 +178 -216 NTP_4_2_3P42 ntpd/ntpdsim-opts.texi@1.16 +1 -1 NTP_4_2_3P42 ntpd/ntpdsim.1@1.16 +2 -2 NTP_4_2_3P42 ntpdc/ntpdc-opts.c@1.16 +2 -2 NTP_4_2_3P42 ntpdc/ntpdc-opts.h@1.16 +65 -75 NTP_4_2_3P42 ntpdc/ntpdc-opts.texi@1.16 +1 -1 NTP_4_2_3P42 ntpdc/ntpdc.1@1.16 +2 -2 NTP_4_2_3P42 ntpq/ntpq-opts.c@1.15 +2 -2 NTP_4_2_3P42 ntpq/ntpq-opts.h@1.15 +55 -63 NTP_4_2_3P42 ntpq/ntpq-opts.texi@1.15 +1 -1 NTP_4_2_3P42 ntpq/ntpq.1@1.15 +2 -2 NTP_4_2_3P42 packageinfo.sh@1.34 +1 -1 NTP_4_2_3P42 sntp/sntp-opts.c@1.15 +2 -2 NTP_4_2_3P42 sntp/sntp-opts.h@1.15 +50 -57 NTP_4_2_3P42 sntp/sntp-opts.texi@1.15 +1 -1 NTP_4_2_3P42 sntp/sntp.1@1.18 +2 -2 NTP_4_2_3P42 util/ntp-keygen-opts.c@1.15 +2 -2 NTP_4_2_3P42 util/ntp-keygen-opts.h@1.15 +102 -121 NTP_4_2_3P42 util/ntp-keygen-opts.texi@1.15 +1 -1 NTP_4_2_3P42 util/ntp-keygen.1@1.15 +2 -2 NTP_4_2_3P42 ChangeSet@1.1379.2.20, 2006-09-09 20:11:07-04:00, stenn@whimsy.udel.edu Fix a typo. libntp/recvbuff.c@1.23 +1 -1 Fix a typo. ChangeSet@1.1379.2.19, 2006-09-09 18:29:08-04:00, stenn@whimsy.udel.edu autogen upgrade clockstuff/clktest-opts.c@1.2 +53 -36 autogen upgrade clockstuff/clktest-opts.h@1.2 +72 -14 autogen upgrade ChangeSet@1.1379.2.18, 2006-09-09 18:21:20-04:00, stenn@whimsy.udel.edu libopts-27.4.3 libopts/COPYING.lgpl@1.2 +1 -1 libopts-27.4.3 libopts/Makefile.am@1.4 +1 -1 libopts-27.4.3 libopts/autoopts.c@1.4 +1 -1 libopts-27.4.3 libopts/autoopts/options.h@1.4 +5 -5 libopts-27.4.3 libopts/autoopts/usage-txt.h@1.3 +1 -1 libopts-27.4.3 libopts/boolean.c@1.3 +1 -1 libopts-27.4.3 libopts/compat/compat.h@1.7 +3 -3 libopts-27.4.3 libopts/compat/pathfind.c@1.4 +5 -5 libopts-27.4.3 libopts/compat/windows-config.h@1.2 +4 -4 libopts-27.4.3 libopts/configfile.c@1.4 +1 -1 libopts-27.4.3 libopts/cook.c@1.3 +1 -1 libopts-27.4.3 libopts/enumeration.c@1.3 +1 -1 libopts-27.4.3 libopts/environment.c@1.3 +1 -1 libopts-27.4.3 libopts/genshell.c@1.3 +1 -1 libopts-27.4.3 libopts/genshell.h@1.3 +6 -6 libopts-27.4.3 libopts/load.c@1.4 +1 -1 libopts-27.4.3 libopts/m4/libopts.m4@1.8 +1 -1 libopts-27.4.3 libopts/makeshell.c@1.5 +1 -1 libopts-27.4.3 libopts/nested.c@1.3 +1 -1 libopts-27.4.3 libopts/numeric.c@1.3 +1 -1 libopts-27.4.3 libopts/pgusage.c@1.4 +1 -1 libopts-27.4.3 libopts/proto.h@1.5 +1 -1 libopts-27.4.3 libopts/putshell.c@1.4 +1 -1 libopts-27.4.3 libopts/restore.c@1.3 +1 -1 libopts-27.4.3 libopts/save.c@1.4 +1 -1 libopts-27.4.3 libopts/sort.c@1.3 +1 -1 libopts-27.4.3 libopts/stack.c@1.4 +1 -1 libopts-27.4.3 libopts/streqvcmp.c@1.4 +1 -1 libopts-27.4.3 libopts/text_mmap.c@1.3 +7 -7 libopts-27.4.3 libopts/version.c@1.4 +1 -1 libopts-27.4.3 ChangeSet@1.1379.5.1, 2006-09-09 05:19:19-04:00, stenn@whimsy.udel.edu NTP_4_2_3P41 TAG: NTP_4_2_3P41 ntpd/ntpd-opts.c@1.15 +2 -2 NTP_4_2_3P41 ntpd/ntpd-opts.h@1.15 +3 -3 NTP_4_2_3P41 ntpd/ntpd-opts.texi@1.16 +1 -1 NTP_4_2_3P41 ntpd/ntpd.1@1.15 +2 -2 NTP_4_2_3P41 ntpd/ntpdsim-opts.c@1.15 +2 -2 NTP_4_2_3P41 ntpd/ntpdsim-opts.h@1.15 +3 -3 NTP_4_2_3P41 ntpd/ntpdsim-opts.texi@1.15 +1 -1 NTP_4_2_3P41 ntpd/ntpdsim.1@1.15 +2 -2 NTP_4_2_3P41 ntpdc/ntpdc-opts.c@1.15 +2 -2 NTP_4_2_3P41 ntpdc/ntpdc-opts.h@1.15 +3 -3 NTP_4_2_3P41 ntpdc/ntpdc-opts.texi@1.15 +1 -1 NTP_4_2_3P41 ntpdc/ntpdc.1@1.15 +2 -2 NTP_4_2_3P41 ntpq/ntpq-opts.c@1.14 +2 -2 NTP_4_2_3P41 ntpq/ntpq-opts.h@1.14 +3 -3 NTP_4_2_3P41 ntpq/ntpq-opts.texi@1.14 +1 -1 NTP_4_2_3P41 ntpq/ntpq.1@1.14 +2 -2 NTP_4_2_3P41 packageinfo.sh@1.33 +1 -1 NTP_4_2_3P41 sntp/sntp-opts.c@1.14 +2 -2 NTP_4_2_3P41 sntp/sntp-opts.h@1.14 +3 -3 NTP_4_2_3P41 sntp/sntp-opts.texi@1.14 +1 -1 NTP_4_2_3P41 sntp/sntp.1@1.17 +2 -2 NTP_4_2_3P41 util/ntp-keygen-opts.c@1.14 +2 -2 NTP_4_2_3P41 util/ntp-keygen-opts.h@1.14 +3 -3 NTP_4_2_3P41 util/ntp-keygen-opts.texi@1.14 +1 -1 NTP_4_2_3P41 util/ntp-keygen.1@1.14 +2 -2 NTP_4_2_3P41 ChangeSet@1.1379.2.16, 2006-09-09 07:16:37+00:00, kardel@pogo.udel.edu ntp_io.c: remove unnecessary test ntpd/ntp_io.c@1.234.1.6 +1 -1 remove unnecessary test ChangeSet@1.1379.2.15, 2006-09-08 21:33:04-04:00, stenn@whimsy.udel.edu [CID 6] Fix a possible null dereference ntpd/ntp_io.c@1.234.1.5 +3 -3 [CID 6] Fix a possible null dereference ChangeSet@1.1379.2.14, 2006-09-08 19:23:32-04:00, stenn@whimsy.udel.edu [Bug 691] ntp_monitor()/restrictions() interaction fixes include/ntpd.h@1.96 +2 -2 [Bug 691] ntp_monitor()/restrictions() interaction fixes ntpd/ntp_monitor.c@1.18 +7 -4 [Bug 691] ntp_monitor()/restrictions() interaction fixes ntpd/ntp_proto.c@1.248 +3 -2 [Bug 691] ntp_monitor()/restrictions() interaction fixes ntpd/ntp_restrict.c@1.22 +3 -2 [Bug 691] ntp_monitor()/restrictions() interaction fixes ChangeSet@1.1379.4.1, 2006-09-08 17:20:34-04:00, stenn@whimsy.udel.edu autogen dependency cleanup ntpdc/Makefile.am@1.33 +4 -4 autogen dependency cleanup ChangeSet@1.1379.2.12, 2006-09-08 20:42:56+00:00, kardel@pogo.udel.edu configure.ac: add config fragment to conditionally re-bind sockets for OSes that fail to flush cached routes when more specific route are discovered. ntp_io.c: re-bind sockets on OSes that fail to flush cached routes when more specific routes are discovered. configure.ac@1.388.1.9 +13 -0 add config fragment to conditionally re-bind sockets for OSes that fail to flush cached routes when more specific route are discovered. ntpd/ntp_io.c@1.234.1.4 +10 -3 re-bind sockets on OSes that fail to flush cached routes when more specific routes are discovered. ChangeSet@1.1379.2.11, 2006-09-07 21:45:01-04:00, stenn@whimsy.udel.edu NTP_4_2_3P39 TAG: NTP_4_2_3P39 ntpd/ntpd-opts.c@1.14 +2 -2 NTP_4_2_3P39 ntpd/ntpd-opts.h@1.14 +185 -4 NTP_4_2_3P39 ntpd/ntpd-opts.texi@1.15 +1 -1 NTP_4_2_3P39 ntpd/ntpd.1@1.14 +2 -2 NTP_4_2_3P39 ntpd/ntpdsim-opts.c@1.14 +2 -2 NTP_4_2_3P39 ntpd/ntpdsim-opts.h@1.14 +239 -4 NTP_4_2_3P39 ntpd/ntpdsim-opts.texi@1.14 +1 -1 NTP_4_2_3P39 ntpd/ntpdsim.1@1.14 +2 -2 NTP_4_2_3P39 ntpdc/ntpdc-opts.c@1.14 +2 -2 NTP_4_2_3P39 ntpdc/ntpdc-opts.h@1.14 +71 -4 NTP_4_2_3P39 ntpdc/ntpdc-opts.texi@1.14 +1 -1 NTP_4_2_3P39 ntpdc/ntpdc.1@1.14 +2 -2 NTP_4_2_3P39 ntpq/ntpq-opts.c@1.13 +2 -2 NTP_4_2_3P39 ntpq/ntpq-opts.h@1.13 +59 -4 NTP_4_2_3P39 ntpq/ntpq-opts.texi@1.13 +1 -1 NTP_4_2_3P39 ntpq/ntpq.1@1.13 +2 -2 NTP_4_2_3P39 packageinfo.sh@1.32 +1 -1 NTP_4_2_3P39 sntp/sntp-opts.c@1.13 +3 -3 NTP_4_2_3P39 sntp/sntp-opts.h@1.13 +53 -4 NTP_4_2_3P39 sntp/sntp-opts.texi@1.13 +1 -1 NTP_4_2_3P39 sntp/sntp.1@1.16 +2 -2 NTP_4_2_3P39 util/ntp-keygen-opts.c@1.13 +2 -2 NTP_4_2_3P39 util/ntp-keygen-opts.h@1.13 +125 -4 NTP_4_2_3P39 util/ntp-keygen-opts.texi@1.13 +1 -1 NTP_4_2_3P39 util/ntp-keygen.1@1.13 +2 -2 NTP_4_2_3P39 ChangeSet@1.1379.2.10, 2006-09-07 19:12:01-04:00, stenn@whimsy.udel.edu autogen dependency cleanup ntpd/Makefile.am@1.52 +8 -8 autogen dependency cleanup ntpq/Makefile.am@1.25 +4 -4 autogen dependency cleanup util/Makefile.am@1.34 +4 -4 autogen dependency cleanup ChangeSet@1.1379.2.9, 2006-09-07 19:07:52-04:00, stenn@whimsy.udel.edu More WWV cleanup/fixes from Dave Mills ntpd/refclock_wwv.c@1.62 +6 -11 More WWV cleanup/fixes from Dave Mills ChangeSet@1.1379.2.8, 2006-09-07 03:22:04-04:00, stenn@whimsy.udel.edu sntp/autogen-version.def should be ignored by bk BitKeeper/etc/ignore@1.58 +1 -0 added sntp/autogen-version.def ChangeSet@1.1379.2.7, 2006-09-07 02:06:36-04:00, stenn@whimsy.udel.edu [Bug 695] autogen uprgrade: warn/protect macro collisions clockstuff/clktest-opts.def@1.4 +1 -0 [Bug 695] autogen uprgrade: warn/protect macro collisions include/Makefile.am@1.24 +1 -1 [Bug 695] autogen uprgrade: warn/protect macro collisions include/autogen-version.def@1.2 +1 -0 [Bug 695] autogen uprgrade: warn/protect macro collisions ntpd/Makefile.am@1.51 +3 -2 [Bug 695] autogen uprgrade: warn/protect macro collisions ntpdc/Makefile.am@1.32 +3 -2 [Bug 695] autogen uprgrade: warn/protect macro collisions ntpdc/ntpdc-opts.def@1.12 +1 -0 [Bug 695] autogen uprgrade: warn/protect macro collisions ntpq/Makefile.am@1.24 +3 -2 [Bug 695] autogen uprgrade: warn/protect macro collisions ntpq/ntpq-opts.def@1.10 +1 -0 [Bug 695] autogen uprgrade: warn/protect macro collisions sntp/Makefile.am@1.21 +12 -2 [Bug 695] autogen uprgrade: warn/protect macro collisions sntp/sntp-opts.def@1.9 +2 -0 [Bug 695] autogen uprgrade: warn/protect macro collisions util/Makefile.am@1.33 +3 -2 [Bug 695] autogen uprgrade: warn/protect macro collisions util/ntp-keygen-opts.def@1.6 +1 -0 [Bug 695] autogen uprgrade: warn/protect macro collisions ChangeSet@1.1379.2.6, 2006-09-07 01:58:07-04:00, stenn@whimsy.udel.edu WWV refclock changes from Dave Mills ntpd/refclock_wwv.c@1.61 +245 -294 WWV refclock changes from Dave Mills ChangeSet@1.1379.2.5, 2006-09-07 00:48:56-05:00, stenn@poog.il.thewrittenword.com [Bug 693] fix configure when there is __adtimex and no ntp_*time configure.ac@1.388.1.8 +7 -10 [Bug 693] fix configure when there is __adtimex and no ntp_*time ChangeSet@1.1379.2.4, 2006-08-31 02:06:16-04:00, stenn@whimsy.udel.edu NTP_4_2_3P38 TAG: NTP_4_2_3P38 ntpd/ntpd-opts.c@1.13 +2 -2 NTP_4_2_3P38 ntpd/ntpd-opts.h@1.13 +3 -3 NTP_4_2_3P38 ntpd/ntpd-opts.texi@1.14 +1 -1 NTP_4_2_3P38 ntpd/ntpd.1@1.13 +2 -2 NTP_4_2_3P38 ntpd/ntpdsim-opts.c@1.13 +2 -2 NTP_4_2_3P38 ntpd/ntpdsim-opts.h@1.13 +3 -3 NTP_4_2_3P38 ntpd/ntpdsim-opts.texi@1.13 +1 -1 NTP_4_2_3P38 ntpd/ntpdsim.1@1.13 +2 -2 NTP_4_2_3P38 ntpdc/ntpdc-opts.c@1.13 +2 -2 NTP_4_2_3P38 ntpdc/ntpdc-opts.h@1.13 +3 -3 NTP_4_2_3P38 ntpdc/ntpdc-opts.texi@1.13 +1 -1 NTP_4_2_3P38 ntpdc/ntpdc.1@1.13 +2 -2 NTP_4_2_3P38 ntpq/ntpq-opts.c@1.12 +2 -2 NTP_4_2_3P38 ntpq/ntpq-opts.h@1.12 +3 -3 NTP_4_2_3P38 ntpq/ntpq-opts.texi@1.12 +1 -1 NTP_4_2_3P38 ntpq/ntpq.1@1.12 +2 -2 NTP_4_2_3P38 packageinfo.sh@1.31 +1 -1 NTP_4_2_3P38 sntp/sntp-opts.c@1.12 +2 -2 NTP_4_2_3P38 sntp/sntp-opts.h@1.12 +3 -3 NTP_4_2_3P38 sntp/sntp-opts.texi@1.12 +1 -1 NTP_4_2_3P38 sntp/sntp.1@1.15 +2 -2 NTP_4_2_3P38 util/ntp-keygen-opts.c@1.12 +2 -2 NTP_4_2_3P38 util/ntp-keygen-opts.h@1.12 +3 -3 NTP_4_2_3P38 util/ntp-keygen-opts.texi@1.12 +1 -1 NTP_4_2_3P38 util/ntp-keygen.1@1.12 +2 -2 NTP_4_2_3P38 ChangeSet@1.1379.2.3, 2006-08-30 06:28:59-04:00, stenn@whimsy.udel.edu [Bug 340, 342] Deprecate broken TRAK and MSF EES refclocks NEWS@1.59 +2 -0 [Bug 340, 342] Deprecate broken TRAK and MSF EES refclocks configure.ac@1.388.1.7 +20 -18 [Bug 340, 342] Deprecate broken TRAK and MSF EES refclocks ntpd/Makefile.am@1.50 +6 -3 [Bug 340, 342] Deprecate broken TRAK and MSF EES refclocks ntpd/ntp_control.c@1.87 +3 -3 [Bug 340, 342] Deprecate broken TRAK and MSF EES refclocks ntpd/refclock_conf.c@1.26 +4 -4 [Bug 340, 342] Deprecate broken TRAK and MSF EES refclocks ChangeSet@1.1379.3.1, 2006-08-29 23:45:21-04:00, stenn@whimsy.udel.edu Fix dependency order problem sntp/Makefile.am@1.20 +2 -1 Fix dependency order problem ChangeSet@1.1379.2.1, 2006-08-29 16:05:33-04:00, neal@pogo.udel.edu refclock_bancomm.c: [BUG 421] add support for bc637PCI ntpd/refclock_bancomm.c@1.9 +138 -104 [BUG 421] add support for bc637PCI ChangeSet@1.1353.9.51, 2006-08-29 07:55:52-04:00, mayer@pogo.udel.edu Bug #656: Multicast address argument copied incorrectly ntpdate/ntpdate.c@1.59 +1 -1 Bug #656: Multicast address argument copied wrongly ChangeSet@1.1379.1.5, 2006-08-29 06:47:20-04:00, stenn@whimsy.udel.edu loopfilter changes from Dave Mills ntpd/ntp_loopfilter.c@1.125 +12 -15 loopfilter changes from Dave Mills ChangeSet@1.1379.1.4, 2006-08-29 08:16:22+00:00, stenn@ntp1.isc.org [Bug 603] Cleanup the configure patch for the libelf fix configure.ac@1.388.1.6 +12 -9 [Bug 603] Cleanup the configure patch for the libelf fix ChangeSet@1.1379.1.3, 2006-08-28 21:48:10-04:00, stenn@whimsy.udel.edu NTP_4_2_3P37 TAG: NTP_4_2_3P37 ntpd/ntpd-opts.c@1.12 +2 -2 NTP_4_2_3P37 ntpd/ntpd-opts.h@1.12 +3 -3 NTP_4_2_3P37 ntpd/ntpd-opts.texi@1.13 +1 -1 NTP_4_2_3P37 ntpd/ntpd.1@1.12 +2 -2 NTP_4_2_3P37 ntpd/ntpdsim-opts.c@1.12 +2 -2 NTP_4_2_3P37 ntpd/ntpdsim-opts.h@1.12 +3 -3 NTP_4_2_3P37 ntpd/ntpdsim-opts.texi@1.12 +1 -1 NTP_4_2_3P37 ntpd/ntpdsim.1@1.12 +2 -2 NTP_4_2_3P37 ntpdc/ntpdc-opts.c@1.12 +2 -2 NTP_4_2_3P37 ntpdc/ntpdc-opts.h@1.12 +3 -3 NTP_4_2_3P37 ntpdc/ntpdc-opts.texi@1.12 +1 -1 NTP_4_2_3P37 ntpdc/ntpdc.1@1.12 +2 -2 NTP_4_2_3P37 ntpq/ntpq-opts.c@1.11 +2 -2 NTP_4_2_3P37 ntpq/ntpq-opts.h@1.11 +3 -3 NTP_4_2_3P37 ntpq/ntpq-opts.texi@1.11 +1 -1 NTP_4_2_3P37 ntpq/ntpq.1@1.11 +2 -2 NTP_4_2_3P37 packageinfo.sh@1.30 +1 -1 NTP_4_2_3P37 sntp/sntp-opts.c@1.11 +2 -2 NTP_4_2_3P37 sntp/sntp-opts.h@1.11 +3 -3 NTP_4_2_3P37 sntp/sntp-opts.texi@1.11 +1 -1 NTP_4_2_3P37 sntp/sntp.1@1.14 +2 -2 NTP_4_2_3P37 util/ntp-keygen-opts.c@1.11 +2 -2 NTP_4_2_3P37 util/ntp-keygen-opts.h@1.11 +3 -3 NTP_4_2_3P37 util/ntp-keygen-opts.texi@1.11 +1 -1 NTP_4_2_3P37 util/ntp-keygen.1@1.11 +2 -2 NTP_4_2_3P37 ChangeSet@1.1379.1.2, 2006-08-28 05:03:05-04:00, stenn@whimsy.udel.edu [Bug 603] Only link with libelf if we need it. configure.ac@1.388.1.5 +22 -19 [Bug 603] Only link with libelf if we need it. ChangeSet@1.1379.1.1, 2006-08-27 23:47:09-04:00, stenn@whimsy.udel.edu [Bug 692] sys_limitrejected is no longer incremented ntpd/ntp_proto.c@1.247 +1 -0 [Bug 692] sys_limitrejected is no longer incremented ChangeSet@1.1379, 2006-08-27 20:49:57-04:00, stenn@whimsy.udel.edu [Bug 688] Fix documentation typos html/clockopt.html@1.19 +2 -2 [Bug 688] Fix documentation typos html/notes.html@1.18 +10 -10 [Bug 688] Fix documentation typos html/ntpd.html@1.39 +1 -1 [Bug 688] Fix documentation typos html/ntpdate.html@1.18 +3 -1 [Bug 688] Fix documentation typos html/ntpdc.html@1.25 +2 -2 [Bug 688] Fix documentation typos ChangeSet@1.1378, 2006-08-27 23:44:15+00:00, stenn@ntp1.isc.org [Bug 153] Avoid DNS lookups of known netmasks or refclocks ntpd/ntp_config.c@1.141 +30 -4 [Bug 153] Avoid DNS lookups of known netmasks or refclocks ChangeSet@1.1353.21.3, 2006-08-26 15:10:29-04:00, stenn@whimsy.udel.edu NTP_4_2_3P36 TAG: NTP_4_2_3P36 ntpd/ntpd-opts.c@1.11 +2 -2 NTP_4_2_3P36 ntpd/ntpd-opts.h@1.11 +3 -3 NTP_4_2_3P36 ntpd/ntpd-opts.texi@1.12 +1 -1 NTP_4_2_3P36 ntpd/ntpd.1@1.11 +2 -2 NTP_4_2_3P36 ntpd/ntpdsim-opts.c@1.11 +2 -2 NTP_4_2_3P36 ntpd/ntpdsim-opts.h@1.11 +3 -3 NTP_4_2_3P36 ntpd/ntpdsim-opts.texi@1.11 +1 -1 NTP_4_2_3P36 ntpd/ntpdsim.1@1.11 +2 -2 NTP_4_2_3P36 ntpdc/ntpdc-opts.c@1.11 +2 -2 NTP_4_2_3P36 ntpdc/ntpdc-opts.h@1.11 +3 -3 NTP_4_2_3P36 ntpdc/ntpdc-opts.texi@1.11 +1 -1 NTP_4_2_3P36 ntpdc/ntpdc.1@1.11 +2 -2 NTP_4_2_3P36 ntpq/ntpq-opts.c@1.10 +2 -2 NTP_4_2_3P36 ntpq/ntpq-opts.h@1.10 +3 -3 NTP_4_2_3P36 ntpq/ntpq-opts.texi@1.10 +1 -1 NTP_4_2_3P36 ntpq/ntpq.1@1.10 +2 -2 NTP_4_2_3P36 packageinfo.sh@1.29 +1 -1 NTP_4_2_3P36 sntp/sntp-opts.c@1.10 +2 -2 NTP_4_2_3P36 sntp/sntp-opts.h@1.10 +3 -3 NTP_4_2_3P36 sntp/sntp-opts.texi@1.10 +1 -1 NTP_4_2_3P36 sntp/sntp.1@1.13 +2 -2 NTP_4_2_3P36 util/ntp-keygen-opts.c@1.10 +2 -2 NTP_4_2_3P36 util/ntp-keygen-opts.h@1.10 +3 -3 NTP_4_2_3P36 util/ntp-keygen-opts.texi@1.10 +1 -1 NTP_4_2_3P36 util/ntp-keygen.1@1.10 +2 -2 NTP_4_2_3P36 ChangeSet@1.1251.94.54, 2006-08-26 05:34:06-04:00, stenn@whimsy.udel.edu NTP_4_2_2P4_RC2 TAG: NTP_4_2_2P4_RC2 packageinfo.sh@1.27.18.1 +1 -1 NTP_4_2_2P4_RC2 ChangeSet@1.1353.22.1, 2006-08-26 05:05:56-04:00, stenn@whimsy.udel.edu NTP_4_2_3P35 TAG: NTP_4_2_3P35 ntpd/ntpd-opts.c@1.10 +2 -2 NTP_4_2_3P35 ntpd/ntpd-opts.h@1.10 +3 -3 NTP_4_2_3P35 ntpd/ntpd-opts.texi@1.11 +1 -1 NTP_4_2_3P35 ntpd/ntpd.1@1.10 +2 -2 NTP_4_2_3P35 ntpd/ntpdsim-opts.c@1.10 +2 -2 NTP_4_2_3P35 ntpd/ntpdsim-opts.h@1.10 +3 -3 NTP_4_2_3P35 ntpd/ntpdsim-opts.texi@1.10 +1 -1 NTP_4_2_3P35 ntpd/ntpdsim.1@1.10 +2 -2 NTP_4_2_3P35 ntpdc/ntpdc-opts.c@1.10 +2 -2 NTP_4_2_3P35 ntpdc/ntpdc-opts.h@1.10 +3 -3 NTP_4_2_3P35 ntpdc/ntpdc-opts.texi@1.10 +1 -1 NTP_4_2_3P35 ntpdc/ntpdc.1@1.10 +2 -2 NTP_4_2_3P35 ntpq/ntpq-opts.c@1.9 +2 -2 NTP_4_2_3P35 ntpq/ntpq-opts.h@1.9 +3 -3 NTP_4_2_3P35 ntpq/ntpq-opts.texi@1.9 +1 -1 NTP_4_2_3P35 ntpq/ntpq.1@1.9 +2 -2 NTP_4_2_3P35 packageinfo.sh@1.28 +1 -1 NTP_4_2_3P35 sntp/sntp-opts.c@1.9 +2 -2 NTP_4_2_3P35 sntp/sntp-opts.h@1.9 +3 -3 NTP_4_2_3P35 sntp/sntp-opts.texi@1.9 +1 -1 NTP_4_2_3P35 sntp/sntp.1@1.12 +2 -2 NTP_4_2_3P35 util/ntp-keygen-opts.c@1.9 +2 -2 NTP_4_2_3P35 util/ntp-keygen-opts.h@1.9 +3 -3 NTP_4_2_3P35 util/ntp-keygen-opts.texi@1.9 +1 -1 NTP_4_2_3P35 util/ntp-keygen.1@1.9 +2 -2 NTP_4_2_3P35 ChangeSet@1.1251.94.53, 2006-08-25 15:55:51-04:00, stenn@whimsy.udel.edu update README.patches README.patches@1.3 +11 -1 update ChangeSet@1.1251.94.52, 2006-08-25 09:00:40-04:00, mayer@pogo.udel.edu Bug #690: Fix length returned. Prevents buffer overflow ports/winnt/libntp/dnslookup.c@1.3.1.1 +1 -1 Bug #690: Fix length returned. Prevents buffer overflow ChangeSet@1.1353.20.1, 2006-08-25 08:57:39-04:00, mayer@pogo.udel.edu Bug #690: Cleanup fix. Erroneous #define libntp/ntp_rfc2553.c@1.32 +0 -1 Bug #690: Cleanup fix. Erroneous #define ChangeSet@1.1353.9.48, 2006-08-25 02:26:29-04:00, stenn@whimsy.udel.edu Dependency cleanup sntp/Makefile.am@1.19 +6 -6 Dependency cleanup ChangeSet@1.1353.9.47, 2006-08-25 02:24:00-04:00, stenn@whimsy.udel.edu ntp_optind needs a declaration, not a definition ntpdc/ntpdc.c@1.54 +1 -1 ntp_optind needs a declaration, not a definition ChangeSet@1.1251.94.51, 2006-08-24 19:50:32-04:00, stenn@whimsy.udel.edu br-flock: mort lives br-flock@1.10 +1 -1 br-flock: mort lives ChangeSet@1.1353.9.45, 2006-08-24 17:12:32-04:00, stenn@whimsy.udel.edu Changes from Dave Mills: Rename MAXSIG to MAXAMP to avoid a collision, tweak the code ntpd/refclock_chu.c@1.38 +6 -6 Rename MAXSIG to MAXAMP to avoid a collision ntpd/refclock_irig.c@1.23 +6 -6 Rename MAXSIG to MAXAMP to avoid a collision ntpd/refclock_wwv.c@1.60 +124 -119 Rename MAXSIG to MAXAMP to avoid a collision, tweak the code ChangeSet@1.1353.9.44, 2006-08-24 16:04:18-04:00, stenn@whimsy.udel.edu [Bug 638] remove STREAMS_TLI comment from legacy info include/ntp_machine.h@1.23 +0 -2 [Bug 638] remove STREAMS_TLI comment from legacy info ChangeSet@1.1353.19.1, 2006-08-24 09:10:50-04:00, mayer@pogo.udel.edu Bug #690:Proper fix for length issue libntp/ntp_rfc2553.c@1.31 +2 -1 Bug #690:Proper fix for length issue ports/winnt/libntp/dnslookup.c@1.4 +1 -1 Bug #690:Proper fix for length issue ChangeSet@1.1353.9.42, 2006-08-20 20:18:08-04:00, stenn@whimsy.udel.edu NTP_4_2_3P34 TAG: NTP_4_2_3P34 ntpd/ntpd-opts.c@1.9 +19 -19 NTP_4_2_3P34 ntpd/ntpd-opts.h@1.9 +5 -5 NTP_4_2_3P34 ntpd/ntpd-opts.texi@1.10 +7 -7 NTP_4_2_3P34 ntpd/ntpd.1@1.9 +5 -5 NTP_4_2_3P34 ntpd/ntpdsim-opts.c@1.9 +19 -19 NTP_4_2_3P34 ntpd/ntpdsim-opts.h@1.9 +5 -5 NTP_4_2_3P34 ntpd/ntpdsim-opts.texi@1.9 +7 -7 NTP_4_2_3P34 ntpd/ntpdsim.1@1.9 +5 -5 NTP_4_2_3P34 ntpdc/ntpdc-opts.c@1.9 +2 -2 NTP_4_2_3P34 ntpdc/ntpdc-opts.h@1.9 +3 -3 NTP_4_2_3P34 ntpdc/ntpdc-opts.texi@1.9 +1 -1 NTP_4_2_3P34 ntpdc/ntpdc.1@1.9 +2 -2 NTP_4_2_3P34 ntpq/ntpq-opts.c@1.8 +2 -2 NTP_4_2_3P34 ntpq/ntpq-opts.h@1.8 +3 -3 NTP_4_2_3P34 ntpq/ntpq-opts.texi@1.8 +1 -1 NTP_4_2_3P34 ntpq/ntpq.1@1.8 +2 -2 NTP_4_2_3P34 packageinfo.sh@1.27 +1 -1 NTP_4_2_3P34 sntp/sntp-opts.c@1.8 +2 -2 NTP_4_2_3P34 sntp/sntp-opts.h@1.8 +3 -3 NTP_4_2_3P34 sntp/sntp-opts.texi@1.8 +1 -1 NTP_4_2_3P34 sntp/sntp.1@1.11 +2 -2 NTP_4_2_3P34 util/ntp-keygen-opts.c@1.8 +2 -2 NTP_4_2_3P34 util/ntp-keygen-opts.h@1.8 +3 -3 NTP_4_2_3P34 util/ntp-keygen-opts.texi@1.8 +1 -1 NTP_4_2_3P34 util/ntp-keygen.1@1.8 +2 -2 NTP_4_2_3P34 ChangeSet@1.1353.9.41, 2006-08-19 23:55:26-04:00, mayer@pogo.udel.edu Bug #690: don't copy to many bytes when copying the address info libntp/ntp_rfc2553.c@1.30 +1 -1 Bug #690: don't copy to many bytes when copying the address info ChangeSet@1.1353.9.39, 2006-08-19 23:34:01-04:00, stenn@whimsy.udel.edu NTP_4_2_3P33 TAG: NTP_4_2_3P33 ntpd/ntpd-opts.c@1.8 +2 -2 NTP_4_2_3P33 ntpd/ntpd-opts.h@1.8 +3 -3 NTP_4_2_3P33 ntpd/ntpd-opts.texi@1.9 +3 -3 NTP_4_2_3P33 ntpd/ntpd.1@1.8 +2 -2 NTP_4_2_3P33 ntpd/ntpdsim-opts.c@1.8 +2 -2 NTP_4_2_3P33 ntpd/ntpdsim-opts.h@1.8 +3 -3 NTP_4_2_3P33 ntpd/ntpdsim-opts.texi@1.8 +3 -3 NTP_4_2_3P33 ntpd/ntpdsim.1@1.8 +2 -2 NTP_4_2_3P33 ntpdc/ntpdc-opts.c@1.8 +2 -2 NTP_4_2_3P33 ntpdc/ntpdc-opts.h@1.8 +3 -3 NTP_4_2_3P33 ntpdc/ntpdc-opts.texi@1.8 +2 -2 NTP_4_2_3P33 ntpdc/ntpdc.1@1.8 +2 -2 NTP_4_2_3P33 ntpq/ntpq-opts.c@1.7 +2 -2 NTP_4_2_3P33 ntpq/ntpq-opts.h@1.7 +3 -3 NTP_4_2_3P33 ntpq/ntpq-opts.texi@1.7 +3 -3 NTP_4_2_3P33 ntpq/ntpq.1@1.7 +2 -2 NTP_4_2_3P33 packageinfo.sh@1.26 +1 -1 NTP_4_2_3P33 sntp/sntp-opts.c@1.7 +2 -2 NTP_4_2_3P33 sntp/sntp-opts.h@1.7 +3 -3 NTP_4_2_3P33 sntp/sntp-opts.texi@1.7 +1 -1 NTP_4_2_3P33 sntp/sntp.1@1.10 +2 -2 NTP_4_2_3P33 util/ntp-keygen-opts.c@1.7 +2 -2 NTP_4_2_3P33 util/ntp-keygen-opts.h@1.7 +3 -3 NTP_4_2_3P33 util/ntp-keygen-opts.texi@1.7 +2 -2 NTP_4_2_3P33 util/ntp-keygen.1@1.7 +2 -2 NTP_4_2_3P33 ChangeSet@1.1353.18.1, 2006-08-18 07:58:19-04:00, mayer@pogo.udel.edu Bug #685: Changes for MM timer and code cleanup include/ntpd.h@1.95 +0 -3 Bug #685: Changes for MM timer and code cleanup ntpd/cmd_args.c@1.42.1.1 +0 -8 Bug #685: Changes for MM timer and code cleanup ntpd/ntp_timer.c@1.32 +1 -1 Bug #685: Changes for MM timer and code cleanup ntpd/ntpd.c@1.81 +15 -7 Bug #685: Changes for MM timer and code cleanup ntpd/ntpdbase-opts.def@1.7.1.1 +4 -3 Bug #685: Changes for MM timer and code cleanup ports/winnt/include/clockstuff.h@1.7 +11 -0 Bug #685: Changes for MM timer and code cleanup ports/winnt/include/config.h@1.43 +7 -1 Bug #685: Changes for MM timer and code cleanup ports/winnt/ntpd/nt_clockstuff.c@1.21 +4 -4 Bug #685: Changes for MM timer and code cleanup ports/winnt/ntpd/ntpd.dsp@1.29 +102 -2 Bug #685: Changes for MM timer and code cleanup ChangeSet@1.1353.9.38, 2006-08-18 06:37:36-04:00, stenn@whimsy.udel.edu Remove "commented out" items from the bk ignore file BitKeeper/etc/ignore@1.57 +0 -13 Remove "commented out" items from the bk ignore file ChangeSet@1.1353.9.37, 2006-08-18 03:33:56-04:00, stenn@whimsy.udel.edu libopts upgrade libopts/autoopts.h@1.4 +12 -4 libopts upgrade libopts/m4/libopts.m4@1.7 +4 -4 libopts upgrade libopts/usage.c@1.4 +3 -3 libopts upgrade sntp/libopts/autoopts.h@1.4 +12 -4 libopts upgrade sntp/libopts/m4/libopts.m4@1.7 +4 -4 libopts upgrade sntp/libopts/usage.c@1.4 +3 -3 libopts upgrade ChangeSet@1.1353.9.36, 2006-08-17 01:29:37-04:00, stenn@whimsy.udel.edu [Bug 685] cleanup ntpd/ntpd-opts.c@1.7 +58 -28 [Bug 685] use updated autogen-erated files ntpd/ntpd-opts.h@1.7 +24 -20 [Bug 685] use updated autogen-erated files ntpd/ntpd-opts.texi@1.8 +16 -1 [Bug 685] use updated autogen-erated files ntpd/ntpd.1@1.7 +7 -2 [Bug 685] use updated autogen-erated files ntpd/ntpdsim-opts.c@1.7 +70 -40 [Bug 685] use updated autogen-erated files ntpd/ntpdsim-opts.h@1.7 +30 -26 [Bug 685] use updated autogen-erated files ntpd/ntpdsim-opts.texi@1.7 +16 -1 [Bug 685] use updated autogen-erated files ntpd/ntpdsim.1@1.7 +7 -2 [Bug 685] use updated autogen-erated files ChangeSet@1.1353.9.35, 2006-08-17 01:27:04-04:00, stenn@whimsy.udel.edu [Bug 685] cleanup ntpd/cmd_args.c@1.43 +1 -1 [Bug 685] Fix a typo - WINNT -> SYS_WINNT ntpd/ntpdbase-opts.def@1.8 +1 -0 [Bug 685] -M should only accepted if SYS_WINNT is #defined ChangeSet@1.1353.17.1, 2006-08-17 00:52:10-04:00, stenn@whimsy.udel.edu run autogen after point release ntpd/ntpd-opts.c@1.6 +2 -2 run autogen after point release ntpd/ntpd-opts.h@1.6 +3 -3 run autogen after point release ntpd/ntpd-opts.texi@1.7 +1 -1 run autogen after point release ntpd/ntpd.1@1.6 +2 -2 run autogen after point release ntpd/ntpdsim-opts.c@1.6 +2 -2 run autogen after point release ntpd/ntpdsim-opts.h@1.6 +3 -3 run autogen after point release ntpd/ntpdsim-opts.texi@1.6 +1 -1 run autogen after point release ntpd/ntpdsim.1@1.6 +2 -2 run autogen after point release ntpdc/ntpdc-opts.c@1.7 +2 -2 run autogen after point release ntpdc/ntpdc-opts.h@1.7 +3 -3 run autogen after point release ntpdc/ntpdc-opts.texi@1.7 +1 -1 run autogen after point release ntpdc/ntpdc.1@1.7 +2 -2 run autogen after point release ntpq/ntpq-opts.c@1.6 +2 -2 run autogen after point release ntpq/ntpq-opts.h@1.6 +3 -3 run autogen after point release ntpq/ntpq-opts.texi@1.6 +1 -1 run autogen after point release ntpq/ntpq.1@1.6 +2 -2 run autogen after point release sntp/sntp-opts.c@1.6 +2 -2 run autogen after point release sntp/sntp-opts.h@1.6 +3 -3 run autogen after point release sntp/sntp-opts.texi@1.6 +1 -1 run autogen after point release sntp/sntp.1@1.9 +2 -2 run autogen after point release util/ntp-keygen-opts.c@1.6 +2 -2 run autogen after point release util/ntp-keygen-opts.h@1.6 +3 -3 run autogen after point release util/ntp-keygen-opts.texi@1.6 +1 -1 run autogen after point release util/ntp-keygen.1@1.6 +2 -2 run autogen after point release ChangeSet@1.1353.16.2, 2006-08-15 13:14:03-04:00, mayer@pogo.udel.edu Bug #685 and #686: MM timer enhancements and leapsecond fixes ntpd/cmd_args.c@1.42 +8 -0 Bug #685: MM timer enhancement for Windows ntpd/ntpdbase-opts.def@1.5.1.1 +9 -0 Bug #685: MM timer enhancement for Windows ports/winnt/ntpd/nt_clockstuff.c@1.20 +199 -38 Bug #685 and #686: MM timer fixes and leapsecond fixes ports/winnt/ntpd/ntservice.c@1.6.1.1 +13 -12 Bug #685 and #686: MM timer fixes and leapsecond fixes ChangeSet@1.1353.16.1, 2006-08-15 13:04:10-04:00, mayer@pogo.udel.edu Bug #523: exit() was being overridden include/ntpd.h@1.94 +0 -2 Bug #523: exit() was being overridden ChangeSet@1.1353.9.32, 2006-08-15 08:10:21-04:00, stenn@whimsy.udel.edu NTP_4_2_3P31 TAG: NTP_4_2_3P31 packageinfo.sh@1.25 +1 -1 NTP_4_2_3P31 ChangeSet@1.1251.94.50, 2006-08-15 07:02:21-04:00, stenn@whimsy.udel.edu NTP_4_2_2P4_RC1 TAG: NTP_4_2_2P4_RC1 packageinfo.sh@1.27.17.1 +3 -3 NTP_4_2_2P4_RC1 ChangeSet@1.1251.94.49, 2006-08-15 06:09:54-04:00, stenn@whimsy.udel.edu Save the list of files that change if the point-level is updated .point-changed-filelist@1.1 +1 -0 BitKeeper file /deacon/backroom/ntp-stable/.point-changed-filelist .point-changed-filelist@1.0 +0 -0 ChangeSet@1.1353.9.30, 2006-08-15 06:08:03-04:00, stenn@whimsy.udel.edu Save the list of files that change if the point-level is updated .point-changed-filelist@1.1 +25 -0 BitKeeper file /deacon/backroom/ntp-dev/.point-changed-filelist .point-changed-filelist@1.0 +0 -0 ChangeSet@1.1353.9.29, 2006-08-15 05:53:43-04:00, stenn@whimsy.udel.edu [Bug 684] debug command-line options should not be shown if #undef DEBUG include/debug-opt.def@1.4 +2 -0 [Bug 684] debug command-line options should not be shown if #undef DEBUG ntpd/ntpd-opts.c@1.5 +29 -4 regenerate autogen-erated files ntpd/ntpd-opts.h@1.5 +7 -3 regenerate autogen-erated files ntpd/ntpd-opts.texi@1.6 +5 -1 regenerate autogen-erated files ntpd/ntpd.1@1.5 +2 -2 regenerate autogen-erated files ntpd/ntpdbase-opts.def@1.6 +1 -0 Make sure we are using the right version of autogen ntpd/ntpdsim-opts.c@1.5 +29 -4 regenerate autogen-erated files ntpd/ntpdsim-opts.h@1.5 +7 -3 regenerate autogen-erated files ntpd/ntpdsim-opts.texi@1.5 +5 -1 regenerate autogen-erated files ntpd/ntpdsim.1@1.5 +2 -2 regenerate autogen-erated files ntpdc/ntpdc-opts.c@1.6 +29 -4 regenerate autogen-erated files ntpdc/ntpdc-opts.h@1.6 +7 -3 regenerate autogen-erated files ntpdc/ntpdc-opts.texi@1.6 +5 -1 regenerate autogen-erated files ntpdc/ntpdc.1@1.6 +2 -2 regenerate autogen-erated files ntpq/ntpq-opts.c@1.5 +29 -4 regenerate autogen-erated files ntpq/ntpq-opts.h@1.5 +7 -3 regenerate autogen-erated files ntpq/ntpq-opts.texi@1.5 +5 -1 regenerate autogen-erated files ntpq/ntpq.1@1.5 +2 -2 regenerate autogen-erated files sntp/sntp-opts.c@1.5 +2 -2 regenerate autogen-erated files sntp/sntp-opts.h@1.5 +3 -3 regenerate autogen-erated files sntp/sntp-opts.texi@1.5 +1 -1 regenerate autogen-erated files sntp/sntp.1@1.8 +2 -2 regenerate autogen-erated files util/ntp-keygen-opts.c@1.5 +29 -4 regenerate autogen-erated files util/ntp-keygen-opts.h@1.5 +7 -3 regenerate autogen-erated files util/ntp-keygen-opts.texi@1.5 +5 -1 regenerate autogen-erated files util/ntp-keygen.1@1.5 +2 -2 regenerate autogen-erated files ChangeSet@1.1353.9.28, 2006-08-15 05:40:34-04:00, stenn@whimsy.udel.edu test -r seems more portable than test -e sntp/Makefile.am@1.18 +1 -1 test -r seems more portable than test -e ChangeSet@1.1353.9.27, 2006-08-15 05:08:00-04:00, stenn@whimsy.udel.edu Make sure we use the right version of autogen include/autogen-version.def@1.1 +1 -0 BitKeeper file /deacon/backroom/ntp-dev/include/autogen-version.def include/autogen-version.def@1.0 +0 -0 ChangeSet@1.1353.9.26, 2006-08-11 07:04:21-04:00, stenn@whimsy.udel.edu NTP_4_2_3P30 TAG: NTP_4_2_3P30 packageinfo.sh@1.24 +1 -1 NTP_4_2_3P30 ChangeSet@1.1353.15.9, 2006-08-10 21:41:32-04:00, stenn@whimsy.udel.edu NTP_4_2_3P29 ntpd/ntpd-opts.c@1.4 +2 -2 NTP_4_2_3P29 ntpd/ntpd-opts.h@1.4 +3 -3 NTP_4_2_3P29 ntpd/ntpd-opts.texi@1.5 +1 -1 NTP_4_2_3P29 ntpd/ntpd.1@1.4 +2 -2 NTP_4_2_3P29 ntpd/ntpdsim-opts.c@1.4 +2 -2 NTP_4_2_3P29 ntpd/ntpdsim-opts.h@1.4 +3 -3 NTP_4_2_3P29 ntpd/ntpdsim-opts.texi@1.4 +1 -1 NTP_4_2_3P29 ntpd/ntpdsim.1@1.4 +2 -2 NTP_4_2_3P29 ntpdc/ntpdc-opts.c@1.5 +2 -2 NTP_4_2_3P29 ntpdc/ntpdc-opts.h@1.5 +3 -3 NTP_4_2_3P29 ntpdc/ntpdc-opts.texi@1.5 +1 -1 NTP_4_2_3P29 ntpdc/ntpdc.1@1.5 +2 -2 NTP_4_2_3P29 ntpq/ntpq-opts.c@1.4 +2 -2 NTP_4_2_3P29 ntpq/ntpq-opts.h@1.4 +3 -3 NTP_4_2_3P29 ntpq/ntpq-opts.texi@1.4 +1 -1 NTP_4_2_3P29 ntpq/ntpq.1@1.4 +2 -2 NTP_4_2_3P29 sntp/sntp-opts.c@1.4 +140 -4 NTP_4_2_3P29 sntp/sntp-opts.h@1.4 +83 -4 NTP_4_2_3P29 sntp/sntp-opts.texi@1.4 +1 -1 NTP_4_2_3P29 sntp/sntp.1@1.7 +82 -3 NTP_4_2_3P29 util/ntp-keygen-opts.c@1.4 +2 -2 NTP_4_2_3P29 util/ntp-keygen-opts.h@1.4 +3 -3 NTP_4_2_3P29 util/ntp-keygen-opts.texi@1.4 +1 -1 NTP_4_2_3P29 util/ntp-keygen.1@1.4 +2 -2 NTP_4_2_3P29 ChangeSet@1.1251.94.48, 2006-08-10 20:37:44-04:00, stenn@whimsy.udel.edu Choose csets-{in,out} based on daemon/client BitKeeper/triggers/send@1.11.1.1 +3 -1 Choose csets-{in,out} based on daemon/client ChangeSet@1.1353.15.8, 2006-08-10 20:34:50-04:00, stenn@whimsy.udel.edu Choose csets-{in,out} based on daemon/client BitKeeper/triggers/send@1.12 +3 -1 Choose csets-{in,out} based on daemon/client ChangeSet@1.1353.15.7, 2006-08-10 20:29:08-04:00, stenn@whimsy.udel.edu cleanup sntp/Makefile.am@1.17 +2 -1 use a run-ag that is for the sntp subdir sntp/sntp-opts.def@1.8 +1 -1 Fix a typo in sntp-opts.def ChangeSet@1.1353.15.6, 2006-08-10 20:06:04-04:00, stenn@whimsy.udel.edu fix permissions on sntp-opts.menu sntp/sntp-opts.menu@1.2 +0 -0 Change mode to -rw-r--r-- ChangeSet@1.1353.15.5, 2006-08-10 17:45:44-04:00, stenn@whimsy.udel.edu Maintain sntp/version.def more quietly sntp/Makefile.am@1.16 +2 -1 Maintain sntp/version.def more quietly ChangeSet@1.1353.15.4, 2006-08-10 17:24:38-04:00, stenn@whimsy.udel.edu Use the new name of the sntp/COPYRIGHT file sntp/sntp-opts.def@1.7 +1 -1 Use the new name of the sntp/COPYRIGHT file ChangeSet@1.1353.15.3, 2006-08-10 16:53:20-04:00, stenn@whimsy.udel.edu [Bug 683] fix version number string mismatches ntpd/Makefile.am@1.49 +9 -6 [Bug 683] fix version number string mismatches ntpdc/Makefile.am@1.31 +6 -3 [Bug 683] fix version number string mismatches ntpq/Makefile.am@1.23 +6 -3 [Bug 683] fix version number string mismatches sntp/Makefile.am@1.15 +15 -4 [Bug 683] fix version number string mismatches sntp/sntp-opts.def@1.6 +2 -5 [Bug 683] fix version number string mismatches util/Makefile.am@1.32 +6 -3 [Bug 683] fix version number string mismatches ChangeSet@1.1353.15.2, 2006-08-10 16:45:30-04:00, stenn@whimsy.udel.edu Rename sntp/Copyright to sntp/COPYRIGHT sntp/COPYRIGHT@1.2 +0 -0 Rename: sntp/Copyright -> sntp/COPYRIGHT ChangeSet@1.1353.15.1, 2006-08-10 07:03:21-04:00, stenn@whimsy.udel.edu NTP_4_2_3P29 TAG: NTP_4_2_3P29 packageinfo.sh@1.23 +1 -1 NTP_4_2_3P29 ChangeSet@1.1353.14.1, 2006-08-10 09:40:07+00:00, burnicki@pogo.udel.edu Changes by Heiko : Fixed point/rcpoint handling which resulted in wrong version strings. ports/winnt/scripts/mkver.bat@1.9 +32 -4 Changes by Heiko : Fixed point/rcpoint handling which resulted in wrong version strings. ChangeSet@1.1353.9.23, 2006-08-10 08:40:06+00:00, burnicki@pogo.udel.edu Exclude debug features if building without debug. Removed obsolete prototype for ntpd_usage(). include/ntp_cmdargs.h@1.4 +0 -1 Removed ntpd_usage() prototype which is obsolete. ports/winnt/ntpd/ntservice.c@1.7 +2 -0 Exclude debug features if building without debug. ChangeSet@1.1353.13.3, 2006-08-10 01:02:20-04:00, stenn@whimsy.udel.edu [Bug 659] Get the latest windows patches for libopts libopts/compat/compat.h@1.6 +2 -2 [Bug 659] Get the latest windows patches for libopts ChangeSet@1.1353.13.2, 2006-08-10 00:57:53-04:00, stenn@whimsy.udel.edu [Bug 659] Get the latest windows patches for libopts libopts/m4/libopts.m4@1.6 +2 -1 [Bug 659] Get the latest windows patches for liboptslibopts/compat/compat.h sntp/libopts/compat/compat.h@1.5 +1 -1 [Bug 659] Get the latest windows patches for liboptslibopts/compat/compat.h sntp/libopts/m4/libopts.m4@1.6 +2 -1 [Bug 659] Get the latest windows patches for liboptslibopts/compat/compat.h ChangeSet@1.1353.13.1, 2006-08-10 00:53:59-04:00, stenn@whimsy.udel.edu Replace the #ifdef DEBUG that got undone by Danny's recent patch ntpd/ntp_io.c@1.234.1.3 +5 -1 Replace the #ifdef DEBUG that got undone by Danny's recent patch ChangeSet@1.1353.12.1, 2006-08-09 21:57:02-04:00, mayer@pogo.udel.edu Bug #659: to allow --help through and not start services ports/winnt/ntpd/ntservice.c@1.6 +2 -2 Bug #659: to allow --help through and not start services ChangeSet@1.1353.9.19, 2006-08-09 18:28:43-04:00, stenn@whimsy.udel.edu [Bug 682] add --disable-debugging to the test build mix build@1.23 +6 -0 [Bug 682] add --disable-debugging to the test build mix flock-build@1.37 +1 -0 [Bug 682] add --disable-debugging to the test build mix ChangeSet@1.1251.94.47, 2006-08-09 18:24:30-04:00, stenn@whimsy.udel.edu [Bug 682] add --disable-debugging to the test build mix build@1.21.1.1 +6 -0 [Bug 682] add --disable-debugging to the test build mix flock-build@1.35.1.1 +1 -0 [Bug 682] add --disable-debugging to the test build mix ChangeSet@1.1353.9.18, 2006-08-09 07:02:54-04:00, stenn@whimsy.udel.edu NTP_4_2_3P28 TAG: NTP_4_2_3P28 packageinfo.sh@1.22 +1 -1 NTP_4_2_3P28 ChangeSet@1.1353.9.17, 2006-08-08 22:38:19-04:00, mayer@pogo.udel.edu bug #671: setsockopt needs macro for Windows ntpd/ntp_io.c@1.234.1.2 +11 -6 bug #671: setsockopt needs macro for Windows ports/winnt/include/config.h@1.42 +1 -0 bug #671: setsockopt needs macro for Windows ChangeSet@1.1353.11.1, 2006-08-08 11:32:15-04:00, mayer@pogo.udel.edu Bug #659: New include file for windows for handling file stat ports/winnt/include/isc/stat.h@1.1 +66 -0 BitKeeper file /pogo/users/mayer/ntp-dev/ports/winnt/include/isc/stat.h ports/winnt/include/isc/stat.h@1.0 +0 -0 ChangeSet@1.1353.9.15, 2006-08-08 07:03:46-04:00, stenn@whimsy.udel.edu NTP_4_2_3P27 TAG: NTP_4_2_3P27 packageinfo.sh@1.21 +1 -1 NTP_4_2_3P27 ChangeSet@1.1353.9.14, 2006-08-08 04:12:04-04:00, stenn@whimsy.udel.edu [Bug 675]: Make sure we build even when we --disable-debugging ntpd/ntp_intres.c@1.48 +4 -0 [Bug 675]: Make sure we build even when we --disable-debugging ntpd/ntp_io.c@1.234.1.1 +5 -1 [Bug 675]: Make sure we build even when we --disable-debugging ntpd/refclock_jupiter.c@1.20 +2 -0 [Bug 675]: Make sure we build even when we --disable-debugging ntpd/refclock_leitch.c@1.8 +11 -5 [Bug 675]: Make sure we build even when we --disable-debugging ntpd/refclock_msfees.c@1.12 +28 -27 [Bug 675]: Make sure we build even when we --disable-debugging ntpd/refclock_mx4200.c@1.22 +2 -0 [Bug 675]: Make sure we build even when we --disable-debugging ntpd/refclock_oncore.c@1.60 +34 -10 [Bug 675]: Make sure we build even when we --disable-debugging ChangeSet@1.1353.9.13, 2006-08-07 18:41:58-04:00, stenn@whimsy.udel.edu Fix #include breakage libopts/compat/compat.h@1.5 +3 -1 Fix sys/mman.h breakage sntp/libopts/compat/compat.h@1.4 +3 -1 Fix sys/mman.h breakage ChangeSet@1.1353.9.12, 2006-08-07 09:32:49-04:00, mayer@pogo.udel.edu Bug #659 mman.h not always available libopts/compat/compat.h@1.4 +2 -2 Bug #659 mman.h not always available ChangeSet@1.1353.9.11, 2006-08-07 08:51:39-04:00, mayer@pogo.udel.edu bug #659: Changes to support libopts on Windows ports/winnt/include/config.h@1.41 +36 -1 bug #659: Changes to support libopts on Windows ports/winnt/libntp/libntp.dsp@1.30 +6 -2 bug #659: Changes to support libopts on Windows ports/winnt/ntp-keygen/ntpkeygen.dsp@1.11 +8 -4 bug #659: Changes to support libopts on Windows ports/winnt/ntpd/ntpd.dsp@1.28 +6 -2 bug #659: Changes to support libopts on Windows ports/winnt/ntpdc/ntpdc.dsp@1.18 +6 -2 bug #659: Changes to support libopts on Windows ports/winnt/ntpq/ntpq.dsp@1.19 +8 -4 bug #659: Changes to support libopts on Windows ChangeSet@1.1353.9.10, 2006-08-06 07:03:05-04:00, stenn@whimsy.udel.edu NTP_4_2_3P26 TAG: NTP_4_2_3P26 packageinfo.sh@1.20 +1 -1 NTP_4_2_3P26 ChangeSet@1.1353.9.9, 2006-08-05 21:31:02-04:00, stenn@whimsy.udel.edu NEWS: Support separate PPS devices for PARSE refclocks NEWS@1.58 +1 -0 NEWS: Support separate PPS devices for PARSE refclocks ChangeSet@1.1251.94.46, 2006-08-05 15:44:40-04:00, stenn@whimsy.udel.edu NTP_4_2_2P3 TAG: NTP_4_2_2P3 packageinfo.sh@1.27.16.1 +2 -2 NTP_4_2_2P3 ChangeSet@1.1353.10.1, 2006-08-05 07:05:02-04:00, stenn@whimsy.udel.edu NTP_4_2_3P25 TAG: NTP_4_2_3P25 packageinfo.sh@1.19 +1 -1 NTP_4_2_3P25 ChangeSet@1.1353.9.7, 2006-08-05 09:01:42+00:00, kardel@pogo.udel.edu driver8.html: document additional Meinberg clock mode document optionally separate PPS device (/dev/refclockpps-{0..3}) refclock_parse.c: support optionally separate PPS devices via /dev/refclockpps-{0..3} html/drivers/driver8.html@1.19 +12 -9 document additional Meinberg clock mode document optionally separate PPS device (/dev/refclockpps-{0..3}) ntpd/refclock_parse.c@1.46 +57 -29 support optionally separate PPS devices via /dev/refclockpps-{0..3} ChangeSet@1.1353.9.6, 2006-08-05 02:10:36-04:00, stenn@whimsy.udel.edu Fixes from Dave. ntpd/ntp_loopfilter.c@1.124 +22 -22 Dave sez: At cold start (no frequency file) the daemon sets the clock at the first update, then waits 15 minutes, measures and corrects the frequency (usually within 1 PPM) and assumes normal operation. This saves many hours to converge the frequency within 1 PPM, especially if the intrinsic frequency error is large, like 200 PPM. Until the frequency is corrected, the machine can have serious offset and frequency errors that would drive dependent clients nuts. Up to now, the leap bits and stratum were not initialized until the frequency was corrected. However, the clock was set and local clients were free to believe or not believe the clock. After review, the external behavior is only mildly worse than without the initial training period, so the leap bits and stratum are now set at the first update. The billboards should now be consistent with the Principle of Least Astonishment. ntpd/ntp_proto.c@1.246 +19 -15 Dave sez: At cold start (no frequency file) the daemon sets the clock at the first update, then waits 15 minutes, measures and corrects the frequency (usually within 1 PPM) and assumes normal operation. This saves many hours to converge the frequency within 1 PPM, especially if the intrinsic frequency error is large, like 200 PPM. Until the frequency is corrected, the machine can have serious offset and frequency errors that would drive dependent clients nuts. Up to now, the leap bits and stratum were not initialized until the frequency was corrected. However, the clock was set and local clients were free to believe or not believe the clock. After review, the external behavior is only mildly worse than without the initial training period, so the leap bits and stratum are now set at the first update. The billboards should now be consistent with the Principle of Least Astonishment. ChangeSet@1.1353.9.5, 2006-08-05 01:27:50-04:00, stenn@whimsy.udel.edu Added uint_t check to libopts.m4 libopts/m4/libopts.m4@1.5 +1 -1 Added uint_t check to libopts.m4 sntp/libopts/m4/libopts.m4@1.5 +1 -1 Added uint_t check to libopts.m4 ChangeSet@1.1251.94.45, 2006-08-05 00:52:33-04:00, stenn@whimsy.udel.edu Use the new format for the "send" emails BitKeeper/triggers/send@1.11 +1 -4 Use the new format for the "send" emails ChangeSet@1.1353.9.3, 2006-08-05 00:38:57-04:00, stenn@whimsy.udel.edu copy new packageinfo from -stable packageinfo.sh@1.18 +4 -3 copy new packageinfo from -stable ChangeSet@1.1251.94.44, 2006-08-04 21:46:01-04:00, stenn@whimsy.udel.edu ready for release packageinfo.sh@1.27.15.2 +6 -6 ready for release scripts/genChangeLog@1.2 +0 -0 Change mode to -rwxrwxr-x ChangeSet@1.1251.94.43, 2006-08-04 16:00:28-04:00, stenn@whimsy.udel.edu Clean up the ChangeLog generation Makefile.am@1.48.1.7 +3 -5 Clean up the ChangeLog generation scripts/Makefile.am@1.14 +3 -2 Clean up the ChangeLog generation scripts/genChangeLog@1.1 +7 -0 BitKeeper file /deacon/backroom/ntp-stable/scripts/genChangeLog scripts/genChangeLog@1.0 +0 -0 ChangeSet@1.1353.9.1, 2006-08-03 07:03:51-04:00, stenn@whimsy.udel.edu NTP_4_2_3P24 TAG: NTP_4_2_3P24 packageinfo.sh@1.17 +1 -1 NTP_4_2_3P24 ChangeSet@1.1353.1.96, 2006-08-02 20:21:23-04:00, stenn@whimsy.udel.edu autogen upgrade ntpd/ntpd-opts.c@1.3 +37 -15 autogen upgrade ntpd/ntpd-opts.c@1.2 +0 -0 Change mode to -rw-r--r-- ntpd/ntpd-opts.h@1.3 +21 -10 autogen upgrade ntpd/ntpd-opts.h@1.2 +0 -0 Change mode to -rw-r--r-- ntpd/ntpd-opts.texi@1.4 +1 -1 autogen upgrade ntpd/ntpd-opts.texi@1.3 +0 -0 Change mode to -rw-r--r-- ntpd/ntpd.1@1.3 +33 -33 autogen upgrade ntpd/ntpd.1@1.2 +0 -0 Change mode to -rw-r--r-- ntpd/ntpdsim-opts.c@1.3 +37 -15 autogen upgrade ntpd/ntpdsim-opts.c@1.2 +0 -0 Change mode to -rw-r--r-- ntpd/ntpdsim-opts.h@1.3 +21 -10 autogen upgrade ntpd/ntpdsim-opts.h@1.2 +0 -0 Change mode to -rw-r--r-- ntpd/ntpdsim-opts.texi@1.3 +4 -4 autogen upgrade ntpd/ntpdsim-opts.texi@1.2 +0 -0 Change mode to -rw-r--r-- ntpd/ntpdsim.1@1.3 +42 -42 autogen upgrade ntpd/ntpdsim.1@1.2 +0 -0 Change mode to -rw-r--r-- ntpdc/ntpdc-opts.c@1.4 +2 -4 autogen upgrade ntpdc/ntpdc-opts.c@1.3 +0 -0 Change mode to -rw-r--r-- ntpdc/ntpdc-opts.h@1.4 +5 -4 autogen upgrade ntpdc/ntpdc-opts.h@1.3 +0 -0 Change mode to -rw-r--r-- ntpdc/ntpdc-opts.texi@1.4 +3 -3 autogen upgrade ntpdc/ntpdc-opts.texi@1.3 +0 -0 Change mode to -rw-r--r-- ntpdc/ntpdc.1@1.4 +2 -2 autogen upgrade ntpdc/ntpdc.1@1.3 +0 -0 Change mode to -rw-r--r-- ntpq/ntpq-opts.c@1.3 +38 -250 autogen upgrade ntpq/ntpq-opts.c@1.2 +0 -0 Change mode to -rw-r--r-- ntpq/ntpq-opts.h@1.3 +21 -10 autogen upgrade ntpq/ntpq-opts.h@1.2 +0 -0 Change mode to -rw-r--r-- ntpq/ntpq-opts.texi@1.3 +5 -244 autogen upgrade ntpq/ntpq-opts.texi@1.2 +0 -0 Change mode to -rw-r--r-- ntpq/ntpq.1@1.3 +16 -16 autogen upgrade ntpq/ntpq.1@1.2 +0 -0 Change mode to -rw-r--r-- sntp/sntp-opts.c@1.3 +40 -260 autogen upgrade sntp/sntp-opts.c@1.2 +0 -0 Change mode to -rw-r--r-- sntp/sntp-opts.h@1.3 +21 -10 autogen upgrade sntp/sntp-opts.h@1.2 +0 -0 Change mode to -rw-r--r-- sntp/sntp-opts.texi@1.3 +4 -248 autogen upgrade sntp/sntp-opts.texi@1.2 +0 -0 Change mode to -rw-r--r-- sntp/sntp.1@1.6 +129 -64 autogen upgrade sntp/sntp.1@1.5 +0 -0 Change mode to -rw-r--r-- util/ntp-keygen-opts.c@1.3 +54 -36 autogen upgrade util/ntp-keygen-opts.c@1.2 +0 -0 Change mode to -rw-r--r-- util/ntp-keygen-opts.h@1.3 +21 -10 autogen upgrade util/ntp-keygen-opts.h@1.2 +0 -0 Change mode to -rw-r--r-- util/ntp-keygen-opts.texi@1.3 +3 -3 autogen upgrade util/ntp-keygen-opts.texi@1.2 +0 -0 Change mode to -rw-r--r-- util/ntp-keygen.1@1.3 +23 -23 autogen upgrade util/ntp-keygen.1@1.2 +0 -0 Change mode to -rw-r--r-- ChangeSet@1.1353.1.95, 2006-08-01 18:03:38+00:00, kardel@pogo.udel.edu ntp_io.c: Bug 678: make size of control message buffer configurable if needbe. use lower default of 1536 bytes as qnx couldn't cope with 5120 bytes and we are not really expecting long control messages. qnx limit is around 1900 bytes - qnx analysed by Michael Tatarinov - thanks ntpd/ntp_io.c@1.234 +4 -1 Bug 678: make size of control message buffer configurable if needbe. use lower default of 1536 bytes as qnx couldn't cope with 5120 bytes and we are not really expecting long control messages. qnx limit is around 1900 bytes - qnx analysed by Michael Tatarinov - thanks ChangeSet@1.1353.1.94, 2006-08-01 06:41:31+00:00, kardel@pogo.udel.edu ntp_io.c: Bug 676: Correct name buffer size calculation. Found by Michael Tatarinov - thanks! ntpd/ntp_io.c@1.233 +1 -1 Bug 676: Correct name buffer size calculation. Found by Michael Tatarinov - thanks! ChangeSet@1.1353.1.93, 2006-07-29 07:02:56-04:00, stenn@whimsy.udel.edu NTP_4_2_3P23 TAG: NTP_4_2_3P23 packageinfo.sh@1.16 +1 -1 NTP_4_2_3P23 ChangeSet@1.1353.1.92, 2006-07-28 22:30:05-04:00, stenn@whimsy.udel.edu [Bug 659] Move large "detail" description to "prog-man-descrip" ntpq/ntpq-opts.def@1.9 +12 -1 [Bug 659] Move large "detail" description to "prog-man-descrip" sntp/sntp-opts.def@1.5 +15 -4 [Bug 659] Move large "detail" description to "prog-man-descrip" ChangeSet@1.1353.1.91, 2006-07-28 07:42:56-04:00, stenn@whimsy.udel.edu NTP_4_2_3P22 TAG: NTP_4_2_3P22 packageinfo.sh@1.15 +1 -1 NTP_4_2_3P22 ChangeSet@1.1251.94.42, 2006-07-28 07:02:21-04:00, stenn@whimsy.udel.edu NTP_4_2_2P3 TAG: NTP_4_2_2P3 packageinfo.sh@1.27.15.1 +1 -1 NTP_4_2_2P3 ChangeSet@1.1251.94.41, 2006-07-28 01:28:32-04:00, stenn@whimsy.udel.edu Ready for release packageinfo.sh@1.27.14.2 +1 -1 Ready for release ChangeSet@1.1251.94.40, 2006-07-28 01:20:54-04:00, stenn@whimsy.udel.edu Ready for release NEWS@1.50.1.5 +30 -27 Ready for release packageinfo.sh@1.27.14.1 +3 -3 Ready for release ChangeSet@1.1353.1.89, 2006-07-28 00:57:01-04:00, stenn@whimsy.udel.edu libopts-27.4.2 libopts/compat/snprintf.c@1.2 +28 -4 libopts-27.4.2 libopts/m4/libopts.m4@1.4 +1 -1 libopts-27.4.2 libopts/makeshell.c@1.4 +9 -9 libopts-27.4.2 libopts/proto.h@1.4 +1 -1 libopts-27.4.2 libopts/streqvcmp.c@1.3 +3 -5 libopts-27.4.2 libopts/version.c@1.3 +4 -8 libopts-27.4.2 sntp/libopts/compat/snprintf.c@1.2 +28 -4 libopts-27.4.2 sntp/libopts/m4/libopts.m4@1.4 +1 -1 libopts-27.4.2 sntp/libopts/makeshell.c@1.4 +9 -9 libopts-27.4.2 sntp/libopts/proto.h@1.4 +1 -1 libopts-27.4.2 sntp/libopts/streqvcmp.c@1.3 +3 -5 libopts-27.4.2 sntp/libopts/version.c@1.3 +4 -8 libopts-27.4.2 ChangeSet@1.1251.94.39, 2006-07-27 22:13:37-04:00, stenn@whimsy.udel.edu NEWS: updated NEWS@1.50.1.4 +21 -2 NEWS: updated ChangeSet@1.1251.94.38, 2006-07-27 22:07:57-04:00, stenn@whimsy.udel.edu Makefile.am: add a rule to generate the ChangeLog Makefile.am@1.48.1.6 +9 -1 Makefile.am: add a rule to generate the ChangeLog ChangeSet@1.1353.1.87, 2006-07-26 08:19:28-04:00, stenn@whimsy.udel.edu NTP_4_2_3P21 TAG: NTP_4_2_3P21 packageinfo.sh@1.14 +1 -1 NTP_4_2_3P21 ChangeSet@1.1251.94.37, 2006-07-26 07:02:51-04:00, stenn@whimsy.udel.edu NTP_4_2_2P3_RC2 TAG: NTP_4_2_2P3_RC2 packageinfo.sh@1.27.13.1 +1 -1 NTP_4_2_2P3_RC2 ChangeSet@1.1353.1.86, 2006-07-26 06:34:06-04:00, stenn@whimsy.udel.edu [Bug 660] Solaris wants _XOPEN_SOURCE, __EXTENSIONS__, and -lxnet -lsocket configure.ac@1.388.1.4 +10 -3 [Bug 660] Solaris wants _XOPEN_SOURCE, __EXTENSIONS__, and -lxnet -lsocket ChangeSet@1.1353.1.85, 2006-07-26 04:16:13-04:00, stenn@whimsy.udel.edu [Bug 638] STREAMS_TLI is no longer needed configure.ac@1.388.1.3 +0 -20 [Bug 638] STREAMS_TLI is no longer needed ChangeSet@1.1251.94.36, 2006-07-26 03:53:28-04:00, stenn@whimsy.udel.edu [Bug 601] ntpq's decodeint uses an extra level of indiraction ntpq/ntpq.c@1.55.1.7 +2 -2 [Bug 601] ntpq's decodeint uses an extra level of indiraction ChangeSet@1.1251.94.35, 2006-07-26 02:56:32-04:00, stenn@whimsy.udel.edu Don't do anything in a RESYNC repo BitKeeper/triggers/send@1.10 +6 -0 Don't do anything in a RESYNC repo ChangeSet@1.1251.94.34, 2006-07-26 02:34:51-04:00, stenn@whimsy.udel.edu Test the -m option in the send trigger BitKeeper/triggers/send@1.9 +4 -1 Test the -m option in the send trigger ChangeSet@1.1353.1.81, 2006-07-26 01:04:24-04:00, stenn@whimsy.udel.edu [Bug 479] -P needs to set priority_done=0 ntpd/ntpd.c@1.80 +1 -0 [Bug 479] -P needs to set priority_done=0 ChangeSet@1.1353.1.80, 2006-07-26 00:55:28-04:00, stenn@whimsy.udel.edu AutoOpts cleanup - common .def entries are already in copyright.def ntpd/ntpd-opts.def@1.5 +0 -3 common .def entries are already in copyright.def ntpd/ntpd-opts.texi@1.2 +4 -4 Updated ntpd/ntpdsim-opts.def@1.5 +0 -3 common .def entries are already in copyright.def ntpq/ntpq-opts.def@1.8 +0 -3 common .def entries are already in copyright.def util/ntp-keygen-opts.def@1.5 +0 -3 common .def entries are already in copyright.def ChangeSet@1.1353.1.79, 2006-07-23 07:03:50-04:00, stenn@whimsy.udel.edu NTP_4_2_3P20 TAG: NTP_4_2_3P20 packageinfo.sh@1.13 +1 -1 NTP_4_2_3P20 ChangeSet@1.1353.1.78, 2006-07-22 23:35:43-04:00, stenn@whimsy.udel.edu windows-config.h: BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/windows-config.h BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/windows-config.h Many files: Upgrade to libopts-27.4.2 libopts/Makefile.am@1.3 +14 -14 Upgrade to libopts-27.4.2 libopts/autoopts.c@1.3 +7 -9 Upgrade to libopts-27.4.2 libopts/autoopts.h@1.3 +7 -8 Upgrade to libopts-27.4.2 libopts/autoopts/options.h@1.3 +64 -62 Upgrade to libopts-27.4.2 libopts/autoopts/usage-txt.h@1.2 +271 -395 Upgrade to libopts-27.4.2 libopts/compat/compat.h@1.3 +25 -9 Upgrade to libopts-27.4.2 libopts/compat/pathfind.c@1.3 +12 -3 Upgrade to libopts-27.4.2 libopts/compat/windows-config.h@1.1 +118 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/windows-config.h libopts/compat/windows-config.h@1.0 +0 -0 libopts/configfile.c@1.3 +1 -1 Upgrade to libopts-27.4.2 libopts/genshell.c@1.2 +50 -10 Upgrade to libopts-27.4.2 libopts/genshell.h@1.2 +21 -10 Upgrade to libopts-27.4.2 libopts/libopts.c@1.3 +0 -1 Upgrade to libopts-27.4.2 libopts/load.c@1.3 +1 -1 Upgrade to libopts-27.4.2 libopts/m4/libopts.m4@1.3 +1 -1 Upgrade to libopts-27.4.2 libopts/makeshell.c@1.3 +11 -2 Upgrade to libopts-27.4.2 libopts/pgusage.c@1.3 +7 -3 Upgrade to libopts-27.4.2 libopts/proto.h@1.3 +1 -1 Upgrade to libopts-27.4.2 libopts/putshell.c@1.3 +3 -3 Upgrade to libopts-27.4.2 libopts/save.c@1.3 +3 -3 Upgrade to libopts-27.4.2 libopts/stack.c@1.3 +5 -3 Upgrade to libopts-27.4.2 libopts/usage.c@1.3 +1 -1 Upgrade to libopts-27.4.2 sntp/libopts/Makefile.am@1.3 +14 -14 Upgrade to libopts-27.4.2 sntp/libopts/autoopts.c@1.3 +7 -9 Upgrade to libopts-27.4.2 sntp/libopts/autoopts.h@1.3 +7 -8 Upgrade to libopts-27.4.2 sntp/libopts/autoopts/options.h@1.3 +64 -62 Upgrade to libopts-27.4.2 sntp/libopts/autoopts/usage-txt.h@1.2 +271 -395 Upgrade to libopts-27.4.2 sntp/libopts/compat/compat.h@1.3 +25 -9 Upgrade to libopts-27.4.2 sntp/libopts/compat/pathfind.c@1.3 +12 -3 Upgrade to libopts-27.4.2 sntp/libopts/compat/windows-config.h@1.1 +118 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/windows-config.h sntp/libopts/compat/windows-config.h@1.0 +0 -0 sntp/libopts/configfile.c@1.3 +1 -1 Upgrade to libopts-27.4.2 sntp/libopts/genshell.c@1.2 +50 -10 Upgrade to libopts-27.4.2 sntp/libopts/genshell.h@1.2 +21 -10 Upgrade to libopts-27.4.2 sntp/libopts/libopts.c@1.3 +0 -1 Upgrade to libopts-27.4.2 sntp/libopts/load.c@1.3 +1 -1 Upgrade to libopts-27.4.2 sntp/libopts/m4/libopts.m4@1.3 +1 -1 Upgrade to libopts-27.4.2 sntp/libopts/makeshell.c@1.3 +11 -2 Upgrade to libopts-27.4.2 sntp/libopts/pgusage.c@1.3 +7 -3 Upgrade to libopts-27.4.2 sntp/libopts/proto.h@1.3 +1 -1 Upgrade to libopts-27.4.2 sntp/libopts/putshell.c@1.3 +3 -3 Upgrade to libopts-27.4.2 sntp/libopts/save.c@1.3 +3 -3 Upgrade to libopts-27.4.2 sntp/libopts/stack.c@1.3 +5 -3 Upgrade to libopts-27.4.2 sntp/libopts/usage.c@1.3 +1 -1 Upgrade to libopts-27.4.2 ChangeSet@1.1353.1.77, 2006-07-22 10:12:26+00:00, kardel@pogo.udel.edu ntp_io.c: move debug level for most interface based activity up to 3 and 4 3 major steps and decisions, 4 for tracing like events. remove some #ifdef cruft from sendpkt() - remove SILENT exits that don't make sense. ntp_peer.c: move debug level for some interface based activity up to 3 and 4 3 major steps and decisions, 4 for tracing like events. ntpd/ntp_io.c@1.232 +98 -105 move debug level for most interface based activity up to 3 and 4 3 major steps and decisions, 4 for tracing like events. remove some #ifdef cruft from sendpkt() - remove SILENT exits that don't make sense. ntpd/ntp_peer.c@1.96 +4 -4 move debug level for some interface based activity up to 3 and 4 3 major steps and decisions, 4 for tracing like events. ChangeSet@1.1353.1.76, 2006-07-22 10:04:56+00:00, kardel@pogo.udel.edu ntp_request.h: bug 672: rearrange struct info_if_stats to be compacter and pad to a 64 bit size boundary for coexistance with 32 and 64 bit platforms layout.std: bug 672: document changed struct info_if_stats layout include/ntp_request.h@1.30 +3 -2 bug 672: rearrange struct info_if_stats to be compacter and pad to a 64 bit size boundary for coexistance with 32 and 64 bit platforms ntpdc/layout.std@1.7 +16 -15 bug 672: document changed struct info_if_stats layout ChangeSet@1.1353.1.75, 2006-07-21 08:10:58-04:00, stenn@whimsy.udel.edu NTP_4_2_3P19 TAG: NTP_4_2_3P19 packageinfo.sh@1.12 +1 -1 NTP_4_2_3P19 ChangeSet@1.1251.94.33, 2006-07-21 07:02:38-04:00, stenn@whimsy.udel.edu NTP_4_2_2P3_RC1 TAG: NTP_4_2_2P3_RC1 packageinfo.sh@1.27.12.1 +1 -1 NTP_4_2_2P3_RC1 ChangeSet@1.1251.94.32, 2006-07-20 17:22:04-04:00, stenn@whimsy.udel.edu Don't bother trying to mirror a RESYNC repo BitKeeper/triggers/2mirrors@1.3 +6 -0 Don't bother trying to mirror a RESYNC repo ChangeSet@1.1251.94.31, 2006-07-20 15:50:44-04:00, stenn@whimsy.udel.edu [Bug 671] Windows wants TYPEOF_IP_MULTICAST_SPOOL=BOOL configure.ac@1.359.5.3 +4 -1 [Bug 671] Windows wants TYPEOF_IP_MULTICAST_SPOOL=BOOL ChangeSet@1.1353.1.72, 2006-07-20 13:49:44-04:00, stenn@whimsy.udel.edu NTP_4_2_3P18 TAG: NTP_4_2_3P18 packageinfo.sh@1.11 +1 -1 NTP_4_2_3P18 ChangeSet@1.1251.94.30, 2006-07-20 07:20:34-04:00, stenn@whimsy.udel.edu NTP_4_2_2P3_RC0 TAG: NTP_4_2_2P3_RC0 packageinfo.sh@1.27.11.1 +1 -1 NTP_4_2_2P3_RC0 ChangeSet@1.1251.94.29, 2006-07-19 22:22:49-04:00, stenn@deacon.udel.edu Send the diffs before the patch in the send trigger. BitKeeper/triggers/send@1.8 +4 -2 Send the diffs before the patch in the send trigger. ChangeSet@1.1251.94.28, 2006-07-19 22:19:11-04:00, stenn@deacon.udel.edu update the path to the winnt.html file INSTALL@1.8 +1 -1 update the path to the winnt.html file ChangeSet@1.1251.94.27, 2006-07-19 21:55:54-04:00, stenn@deacon.udel.edu Ignore autom4te.cache directories BitKeeper/etc/ignore@1.35.1.4 +2 -1 Ignore autom4te.cache directories ChangeSet@1.1353.1.69, 2006-07-19 21:00:05-04:00, stenn@deacon.udel.edu Run the licfix script quietly BitKeeper/triggers/pre-resolve.licfix@1.3 +1 -1 Run the licfix script quietly ChangeSet@1.1251.94.26, 2006-07-19 05:24:23-04:00, stenn@pogo.udel.edu [Bug 657] netbsd fix for IP_MULTICAST_LOOP test configure.ac@1.359.5.2 +1 -1 [Bug 657] netbsd fix for IP_MULTICAST_LOOP test ChangeSet@1.1251.94.25, 2006-07-19 03:10:22-04:00, stenn@pogo.udel.edu [Bug 657] Different OSes need different sized args for IP_MULTICAST_LOOP configure.ac@1.359.5.1 +15 -1 [Bug 657] Different OSes need different sized args for IP_MULTICAST_LOOP ntpd/ntp_io.c@1.187.1.19 +1 -1 [Bug 657] Different OSes need different sized args for IP_MULTICAST_LOOP ChangeSet@1.1353.1.67, 2006-07-15 09:35:45+00:00, kardel@pogo.udel.edu ntp_io.c: cleanup debug messages add RTM_REDIRECT, RTM_CHANGE as additional interface list scan routing message triggers ntpd.h: select_peerinterface() is comletely private to ntp_peer.c ntp_peer.c: - clear peer crypto when disconnecting from a bound interface - re-arrange initialization for more usable debug output - only bind to non wildcard interfaces even if the OS would offer to send via such an interface include/ntpd.h@1.93 +0 -1 select_peerinterface() is comletely private to ntp_peer.c ntpd/ntp_io.c@1.230 +9 -3 cleanup debug messages add RTM_REDIRECT, RTM_CHANGE as additional interface list scan routing message triggers ntpd/ntp_peer.c@1.95 +43 -31 - clear crypto when leaving a bound interface - re-arrange initialization for more usable debug output - only bind to non wildcard interfaces even if the OS would offer to send via such an interface ChangeSet@1.1353.1.66, 2006-07-10 18:08:35+00:00, kardel@pogo.udel.edu ntp_io.c: fix prototype argument type to match implementation ntpd/ntp_io.c@1.229 +1 -1 fix prototype argument type to match implementation ChangeSet@1.1353.1.65, 2006-07-10 07:42:31-04:00, stenn@whimsy.udel.edu NTP_4_2_3P17 TAG: NTP_4_2_3P17 packageinfo.sh@1.10 +1 -1 NTP_4_2_3P17 ChangeSet@1.1251.97.31, 2006-07-10 07:02:26-04:00, stenn@whimsy.udel.edu NTP_4_2_2P3_RC TAG: NTP_4_2_2P3_RC packageinfo.sh@1.27.9.1 +2 -2 NTP_4_2_2P3_RC ChangeSet@1.1251.97.30, 2006-07-10 03:27:15-04:00, stenn@whimsy.udel.edu cleanup NEWS@1.50.1.3 +1 -1 cleanup ChangeSet@1.1251.97.29, 2006-07-10 03:14:23-04:00, stenn@whimsy.udel.edu Start an RC cycle with the new changes packageinfo.sh@1.27.8.1 +2 -2 Start an RC cycle with the new changes ChangeSet@1.1251.97.28, 2006-07-10 03:07:33-04:00, stenn@whimsy.udel.edu Use a decent Subject: line for the new send trigger BitKeeper/triggers/send@1.7 +2 -1 Use a decent Subject: line for the new send trigger ChangeSet@1.1251.97.27, 2006-07-10 01:54:26-04:00, stenn@whimsy.udel.edu Also use the new "bk changes" command for the "send" emails BitKeeper/triggers/send@1.6 +15 -0 Also use the new "bk changes" command for the "send" emails ChangeSet@1.1251.97.26, 2006-07-10 01:40:48-04:00, stenn@whimsy.udel.edu update README@1.22 +3 -3 update ChangeSet@1.1251.97.25, 2006-07-10 01:32:25-04:00, stenn@whimsy.udel.edu update WHERE-TO-START@1.6 +5 -5 update ChangeSet@1.1251.97.24, 2006-07-10 01:20:12-04:00, stenn@whimsy.udel.edu Note that sntp now builds under AIX 5 NEWS@1.50.1.2 +1 -0 Note that sntp now builds under AIX 5 ChangeSet@1.1251.97.23, 2006-07-10 00:21:34-04:00, stenn@whimsy.udel.edu Have sntp build config.h, and cleanup some quoting sntp/configure.ac@1.8.1.1 +3 -2 Have sntp build config.h, and cleanup some quoting ChangeSet@1.1353.1.62, 2006-07-09 07:25:54-04:00, stenn@whimsy.udel.edu NTP_4_2_3P16 TAG: NTP_4_2_3P16 packageinfo.sh@1.9 +1 -1 NTP_4_2_3P16 ChangeSet@1.1251.97.22, 2006-07-09 07:02:21-04:00, stenn@whimsy.udel.edu NTP_4_2_2P2 TAG: NTP_4_2_2P2 packageinfo.sh@1.27.7.1 +1 -1 NTP_4_2_2P2 ChangeSet@1.1353.1.60, 2006-07-09 00:41:37-04:00, stenn@whimsy.udel.edu socket.c needs stuff from config.h sntp/socket.c@1.6 +2 -0 socket.c needs stuff from config.h ChangeSet@1.1251.97.21, 2006-07-09 00:39:26-04:00, stenn@whimsy.udel.edu socket.c needs stuff from config.h sntp/socket.c@1.5.1.1 +2 -0 socket.c needs stuff from config.h ChangeSet@1.1353.6.1, 2006-07-08 07:26:18-04:00, stenn@whimsy.udel.edu NTP_4_2_3P15 TAG: NTP_4_2_3P15 packageinfo.sh@1.8 +1 -1 NTP_4_2_3P15 ChangeSet@1.1251.97.20, 2006-07-08 07:02:36-04:00, stenn@whimsy.udel.edu NTP_4_2_2P1 TAG: NTP_4_2_2P1 packageinfo.sh@1.27.6.1 +1 -1 NTP_4_2_2P1 ChangeSet@1.1353.1.56, 2006-07-08 06:36:29-04:00, stenn@whimsy.udel.edu [Bug 667] Fix ntpdc's option processing ntpdc/ntpdc-opts.c@1.2 +38 -13 [Bug 667] Fix ntpdc's option processing ntpdc/ntpdc-opts.h@1.2 +20 -10 [Bug 667] Fix ntpdc's option processing ntpdc/ntpdc-opts.texi@1.2 +3 -3 [Bug 667] Fix ntpdc's option processing ntpdc/ntpdc.1@1.2 +17 -16 [Bug 667] Fix ntpdc's option processing ChangeSet@1.1251.97.19, 2006-07-08 06:19:53-04:00, stenn@whimsy.udel.edu Time for the point release packageinfo.sh@1.27.5.2 +3 -3 Time for the point release ChangeSet@1.1251.97.18, 2006-07-08 06:16:07-04:00, stenn@whimsy.udel.edu cleanup the bk ignore file BitKeeper/etc/ignore@1.35.1.3 +34 -34 cleanup the bk ignore file ChangeSet@1.1353.1.55, 2006-07-08 06:06:02-04:00, stenn@whimsy.udel.edu [Bug 667] Fix ntpdc's option processing ntpdc/ntpdc-opts.def@1.11 +1 -0 [Bug 667] Fix ntpdc's option processing ntpdc/ntpdc.c@1.53 +15 -0 [Bug 667] Fix ntpdc's option processing ChangeSet@1.1353.5.1, 2006-07-08 08:22:35+00:00, kardel@pogo.udel.edu ntp_io.c: simplify move_fd() refactor socket level udp paket time stamping by creating fetch_timestamp() for the interfaces we will implement implement the standard interface using the CMSG_* macros only enable socket time stamping when CMSG_* macros are defined cleanup minor signedness issues with pointer target types for length arguments ntpd/ntp_io.c@1.228 +93 -75 simplify move_fd() refactor socket level udp paket time stamping by creating fetch_timestamp() for the interfaces we will implement implement the standard interface using the CMSG_* macros only enable socket time stamping when CMSG_* macros are defined cleanup minor signedness issues with pointer target types for length arguments ChangeSet@1.1353.1.54, 2006-07-08 03:04:02-04:00, stenn@whimsy.udel.edu Fix the hppa2.0-hp-hpux10.20 -H case configure.ac@1.388 +4 -3 Fix the hppa2.0-hp-hpux10.20 -H case sntp/configure.ac@1.12 +4 -3 Fix the hppa2.0-hp-hpux10.20 -H case ChangeSet@1.1353.1.53, 2006-07-07 18:34:28-04:00, stenn@whimsy.udel.edu NTP_4_2_3P14 TAG: NTP_4_2_3P14 packageinfo.sh@1.7 +1 -1 NTP_4_2_3P14 ChangeSet@1.1353.1.52, 2006-07-07 15:20:47-04:00, stenn@whimsy.udel.edu Add the -H stuff for cc under HP-UX to sntp's configure.ac sntp/configure.ac@1.11 +7 -0 Add the -H stuff for cc under HP-UX to sntp's configure.ac ChangeSet@1.1353.1.51, 2006-07-07 06:57:09-04:00, stenn@whimsy.udel.edu we want ltmain.sh now BitKeeper/etc/ignore@1.53 +1 -1 we want ltmain.sh now ChangeSet@1.1353.1.50, 2006-07-07 05:53:15-04:00, stenn@whimsy.udel.edu Make sure .def files are readable, distribute libtool.m4 and ltmain.sh to solve bootstrap problem libopts/m4/libtool.m4@1.1 +6397 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/libtool.m4 libopts/m4/libtool.m4@1.0 +0 -0 ltmain.sh@1.1 +6863 -0 BitKeeper file /deacon/backroom/ntp-dev/ltmain.sh ltmain.sh@1.0 +0 -0 ntpd/ntpd-opts.def@1.4 +0 -0 Change mode to -rw-rw-r-- ntpd/ntpdbase-opts.def@1.5 +0 -0 Change mode to -rw-rw-r-- ntpd/ntpdsim-opts.def@1.4 +0 -0 Change mode to -rw-rw-r-- ntpdc/ntpdc-opts.def@1.10 +0 -0 Change mode to -rw-rw-r-- ntpq/ntpq-opts.def@1.7 +0 -0 Change mode to -rw-rw-r-- sntp/libopts/m4/libtool.m4@1.1 +6397 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/libtool.m4 sntp/libopts/m4/libtool.m4@1.0 +0 -0 sntp/ltmain.sh@1.1 +6863 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/ltmain.sh sntp/ltmain.sh@1.0 +0 -0 sntp/sntp-opts.def@1.4 +0 -0 Change mode to -rw-rw-r-- util/ntp-keygen-opts.def@1.4 +0 -0 Change mode to -rw-rw-r-- ChangeSet@1.1353.1.49, 2006-07-03 21:51:08-04:00, stenn@deacon.udel.edu Make prototype agree with decl libopts/autoopts/options.h@1.2 +1 -1 Make prototype agree with decl sntp/libopts/autoopts/options.h@1.2 +1 -1 Make prototype agree with decl ChangeSet@1.1353.1.48, 2006-07-03 19:05:18-04:00, stenn@deacon.udel.edu Upgrade to libopts-27.3.2 libopts/Makefile.am@1.2 +10 -10 Upgrade to libopts-27.3.2 libopts/autoopts.c@1.2 +9 -5 Upgrade to libopts-27.3.2 libopts/autoopts.h@1.2 +15 -7 Upgrade to libopts-27.3.2 libopts/boolean.c@1.2 +1 -1 Upgrade to libopts-27.3.2 libopts/compat/compat.h@1.2 +5 -2 Upgrade to libopts-27.3.2 libopts/compat/pathfind.c@1.2 +2 -2 Upgrade to libopts-27.3.2 libopts/compat/strchr.c@1.1 +61 -0 libopts/compat/strchr.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strchr.c libopts/configfile.c@1.2 +6 -6 Upgrade to libopts-27.3.2 libopts/cook.c@1.2 +6 -6 Upgrade to libopts-27.3.2 libopts/enumeration.c@1.2 +8 -8 Upgrade to libopts-27.3.2 libopts/environment.c@1.2 +1 -1 Upgrade to libopts-27.3.2 libopts/libopts.c@1.2 +1 -0 Upgrade to libopts-27.3.2 libopts/load.c@1.2 +7 -7 Upgrade to libopts-27.3.2 libopts/m4/libopts.m4@1.2 +6 -13 Upgrade to libopts-27.3.2 libopts/makeshell.c@1.2 +10 -10 Upgrade to libopts-27.3.2 libopts/nested.c@1.2 +1 -1 Upgrade to libopts-27.3.2 libopts/numeric.c@1.2 +1 -1 Upgrade to libopts-27.3.2 libopts/pgusage.c@1.2 +3 -3 Upgrade to libopts-27.3.2 libopts/proto.h@1.2 +2 -2 Upgrade to libopts-27.3.2 libopts/putshell.c@1.2 +8 -8 Upgrade to libopts-27.3.2 libopts/restore.c@1.2 +1 -1 Upgrade to libopts-27.3.2 libopts/save.c@1.2 +7 -7 Upgrade to libopts-27.3.2 libopts/sort.c@1.2 +4 -4 Upgrade to libopts-27.3.2 libopts/stack.c@1.2 +41 -2 Upgrade to libopts-27.3.2 libopts/streqvcmp.c@1.2 +1 -1 Upgrade to libopts-27.3.2 libopts/text_mmap.c@1.2 +3 -3 Upgrade to libopts-27.3.2 libopts/tokenize.c@1.2 +3 -3 Upgrade to libopts-27.3.2 libopts/usage.c@1.2 +11 -11 Upgrade to libopts-27.3.2 libopts/version.c@1.2 +1 -1 Upgrade to libopts-27.3.2 sntp/libopts/Makefile.am@1.2 +10 -10 Upgrade to libopts-27.3.2 sntp/libopts/autoopts.c@1.2 +9 -5 Upgrade to libopts-27.3.2 sntp/libopts/autoopts.h@1.2 +15 -7 Upgrade to libopts-27.3.2 sntp/libopts/boolean.c@1.2 +1 -1 Upgrade to libopts-27.3.2 sntp/libopts/compat/compat.h@1.2 +5 -2 Upgrade to libopts-27.3.2 sntp/libopts/compat/pathfind.c@1.2 +2 -2 Upgrade to libopts-27.3.2 sntp/libopts/compat/strchr.c@1.1 +61 -0 sntp/libopts/compat/strchr.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strchr.c sntp/libopts/configfile.c@1.2 +6 -6 Upgrade to libopts-27.3.2 sntp/libopts/cook.c@1.2 +6 -6 Upgrade to libopts-27.3.2 sntp/libopts/enumeration.c@1.2 +8 -8 Upgrade to libopts-27.3.2 sntp/libopts/environment.c@1.2 +1 -1 Upgrade to libopts-27.3.2 sntp/libopts/libopts.c@1.2 +1 -0 Upgrade to libopts-27.3.2 sntp/libopts/load.c@1.2 +7 -7 Upgrade to libopts-27.3.2 sntp/libopts/m4/libopts.m4@1.2 +6 -13 Upgrade to libopts-27.3.2 sntp/libopts/makeshell.c@1.2 +10 -10 Upgrade to libopts-27.3.2 sntp/libopts/nested.c@1.2 +1 -1 Upgrade to libopts-27.3.2 sntp/libopts/numeric.c@1.2 +1 -1 Upgrade to libopts-27.3.2 sntp/libopts/pgusage.c@1.2 +3 -3 Upgrade to libopts-27.3.2 sntp/libopts/proto.h@1.2 +2 -2 Upgrade to libopts-27.3.2 sntp/libopts/putshell.c@1.2 +8 -8 Upgrade to libopts-27.3.2 sntp/libopts/restore.c@1.2 +1 -1 Upgrade to libopts-27.3.2 sntp/libopts/save.c@1.2 +7 -7 Upgrade to libopts-27.3.2 sntp/libopts/sort.c@1.2 +4 -4 Upgrade to libopts-27.3.2 sntp/libopts/stack.c@1.2 +41 -2 Upgrade to libopts-27.3.2 sntp/libopts/streqvcmp.c@1.2 +1 -1 Upgrade to libopts-27.3.2 sntp/libopts/text_mmap.c@1.2 +3 -3 Upgrade to libopts-27.3.2 sntp/libopts/tokenize.c@1.2 +3 -3 Upgrade to libopts-27.3.2 sntp/libopts/usage.c@1.2 +11 -11 Upgrade to libopts-27.3.2 sntp/libopts/version.c@1.2 +1 -1 Upgrade to libopts-27.3.2 ChangeSet@1.1353.1.47, 2006-07-03 00:18:29-04:00, stenn@deacon.udel.edu typo bootstrap@1.15, stenn@whimsy.udel.edu +1 -1 typo ChangeSet@1.1353.1.46, 2006-07-03 00:13:59-04:00, stenn@deacon.udel.edu touch the files generated by autogen to keep them from needing to be rebuilt. bootstrap@1.14 +38 -14 touch the files generated by autogen to keep them from needing to be rebuilt. ntpd/ntp_proto.c@1.245 +2 -2 Dave reformatted a line ChangeSet@1.1353.1.45, 2006-06-30 01:03:52-04:00, stenn@deacon.udel.edu Check in libopts and autgen-generated files BitKeeper/etc/ignore@1.52 +12 -12 Check in libopts and autgen-generated files bootstrap@1.13 +19 -18 Check in libopts and autgen-generated files clockstuff/clktest-opts.c@1.1 +825 -0 clockstuff/clktest-opts.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/clockstuff/clktest-opts.c clockstuff/clktest-opts.h@1.1 +192 -0 clockstuff/clktest-opts.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/clockstuff/clktest-opts.h libopts/COPYING.lgpl@1.1 +502 -0 libopts/COPYING.lgpl@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/COPYING.lgpl libopts/COPYING.mbsd@1.1 +26 -0 libopts/COPYING.mbsd@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/COPYING.mbsd libopts/MakeDefs.inc@1.1 +0 -0 libopts/MakeDefs.inc@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/MakeDefs.inc libopts/Makefile.am@1.1 +20 -0 libopts/Makefile.am@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/Makefile.am libopts/README@1.1 +93 -0 libopts/README@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/README libopts/autoopts.c@1.1 +1043 -0 libopts/autoopts.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/autoopts.c libopts/autoopts.h@1.1 +321 -0 libopts/autoopts.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/autoopts.h libopts/autoopts/options.h@1.1 +908 -0 libopts/autoopts/options.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/autoopts/options.h libopts/autoopts/usage-txt.h@1.1 +479 -0 libopts/autoopts/usage-txt.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/autoopts/usage-txt.h libopts/boolean.c@1.1 +102 -0 libopts/boolean.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/boolean.c libopts/compat/compat.h@1.1 +292 -0 libopts/compat/compat.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/compat/compat.h libopts/compat/pathfind.c@1.1 +330 -0 libopts/compat/pathfind.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/compat/pathfind.c libopts/compat/snprintf.c@1.1 +36 -0 libopts/compat/snprintf.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/compat/snprintf.c libopts/compat/strdup.c@1.1 +19 -0 libopts/compat/strdup.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/compat/strdup.c libopts/configfile.c@1.1 +1277 -0 libopts/configfile.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/configfile.c libopts/cook.c@1.1 +355 -0 libopts/cook.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/cook.c libopts/enumeration.c@1.1 +485 -0 libopts/enumeration.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/enumeration.c libopts/environment.c@1.1 +261 -0 libopts/environment.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/environment.c libopts/genshell.c@1.1 +301 -0 libopts/genshell.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/genshell.c libopts/genshell.h@1.1 +142 -0 libopts/genshell.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/genshell.h libopts/libopts.c@1.1 +30 -0 libopts/libopts.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/libopts.c libopts/load.c@1.1 +520 -0 libopts/load.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/load.c libopts/m4/libopts.m4@1.1 +487 -0 libopts/m4/libopts.m4@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/m4/libopts.m4 libopts/m4/liboptschk.m4@1.1 +39 -0 libopts/m4/liboptschk.m4@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/m4/liboptschk.m4 libopts/makeshell.c@1.1 +1100 -0 libopts/makeshell.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/makeshell.c libopts/nested.c@1.1 +705 -0 libopts/nested.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/nested.c libopts/numeric.c@1.1 +89 -0 libopts/numeric.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/numeric.c libopts/pgusage.c@1.1 +154 -0 libopts/pgusage.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/pgusage.c libopts/proto.h@1.1 +88 -0 libopts/proto.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/proto.h libopts/putshell.c@1.1 +333 -0 libopts/putshell.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/putshell.c libopts/restore.c@1.1 +207 -0 libopts/restore.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/restore.c libopts/save.c@1.1 +499 -0 libopts/save.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/save.c libopts/sort.c@1.1 +369 -0 libopts/sort.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/sort.c libopts/stack.c@1.1 +224 -0 libopts/stack.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/stack.c libopts/streqvcmp.c@1.1 +292 -0 libopts/streqvcmp.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/streqvcmp.c libopts/text_mmap.c@1.1 +367 -0 libopts/text_mmap.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/text_mmap.c libopts/tokenize.c@1.1 +322 -0 libopts/tokenize.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/tokenize.c libopts/usage.c@1.1 +732 -0 libopts/usage.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/usage.c libopts/version.c@1.1 +181 -0 libopts/version.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/version.c ntpd/ntpd-opts.c@1.1 +975 -0 ntpd/ntpd-opts.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpd-opts.c ntpd/ntpd-opts.h@1.1 +193 -0 ntpd/ntpd-opts.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpd-opts.h ntpd/ntpd-opts.menu@1.1 +1 -0 ntpd/ntpd-opts.menu@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpd-opts.menu ntpd/ntpd-opts.texi@1.1 +481 -0 ntpd/ntpd-opts.texi@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpd-opts.texi ntpd/ntpd.1@1.1 +307 -0 ntpd/ntpd.1@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpd.1 ntpd/ntpdsim-opts.c@1.1 +1173 -0 ntpd/ntpdsim-opts.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpdsim-opts.c ntpd/ntpdsim-opts.h@1.1 +211 -0 ntpd/ntpdsim-opts.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpdsim-opts.h ntpd/ntpdsim-opts.menu@1.1 +1 -0 ntpd/ntpdsim-opts.menu@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpdsim-opts.menu ntpd/ntpdsim-opts.texi@1.1 +562 -0 ntpd/ntpdsim-opts.texi@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpdsim-opts.texi ntpd/ntpdsim.1@1.1 +352 -0 ntpd/ntpdsim.1@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpdsim.1 ntpdc/ntpdc-opts.c@1.1 +606 -0 ntpdc/ntpdc-opts.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpdc/ntpdc-opts.c ntpdc/ntpdc-opts.h@1.1 +155 -0 ntpdc/ntpdc-opts.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpdc/ntpdc-opts.h ntpdc/ntpdc-opts.menu@1.1 +1 -0 ntpdc/ntpdc-opts.menu@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpdc/ntpdc-opts.menu ntpdc/ntpdc-opts.texi@1.1 +272 -0 ntpdc/ntpdc-opts.texi@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpdc/ntpdc-opts.texi ntpdc/ntpdc.1@1.1 +157 -0 ntpdc/ntpdc.1@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpdc/ntpdc.1 ntpq/ntpq-opts.c@1.1 +781 -0 ntpq/ntpq-opts.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpq/ntpq-opts.c ntpq/ntpq-opts.h@1.1 +151 -0 ntpq/ntpq-opts.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpq/ntpq-opts.h ntpq/ntpq-opts.menu@1.1 +1 -0 ntpq/ntpq-opts.menu@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpq/ntpq-opts.menu ntpq/ntpq-opts.texi@1.1 +691 -0 ntpq/ntpq-opts.texi@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpq/ntpq-opts.texi ntpq/ntpq.1@1.1 +385 -0 ntpq/ntpq.1@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/ntpq/ntpq.1 sntp/libopts/COPYING.lgpl@1.1 +502 -0 sntp/libopts/COPYING.lgpl@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/COPYING.lgpl sntp/libopts/COPYING.mbsd@1.1 +26 -0 sntp/libopts/COPYING.mbsd@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/COPYING.mbsd sntp/libopts/MakeDefs.inc@1.1 +0 -0 sntp/libopts/MakeDefs.inc@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/MakeDefs.inc sntp/libopts/Makefile.am@1.1 +20 -0 sntp/libopts/Makefile.am@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/Makefile.am sntp/libopts/README@1.1 +93 -0 sntp/libopts/README@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/README sntp/libopts/autoopts.c@1.1 +1043 -0 sntp/libopts/autoopts.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/autoopts.c sntp/libopts/autoopts.h@1.1 +321 -0 sntp/libopts/autoopts.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/autoopts.h sntp/libopts/autoopts/options.h@1.1 +908 -0 sntp/libopts/autoopts/options.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/autoopts/options.h sntp/libopts/autoopts/usage-txt.h@1.1 +479 -0 sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/autoopts/usage-txt.h sntp/libopts/boolean.c@1.1 +102 -0 sntp/libopts/boolean.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/boolean.c sntp/libopts/compat/compat.h@1.1 +292 -0 sntp/libopts/compat/compat.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/compat/compat.h sntp/libopts/compat/pathfind.c@1.1 +330 -0 sntp/libopts/compat/pathfind.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/compat/pathfind.c sntp/libopts/compat/snprintf.c@1.1 +36 -0 sntp/libopts/compat/snprintf.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/compat/snprintf.c sntp/libopts/compat/strdup.c@1.1 +19 -0 sntp/libopts/compat/strdup.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/compat/strdup.c sntp/libopts/configfile.c@1.1 +1277 -0 sntp/libopts/configfile.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/configfile.c sntp/libopts/cook.c@1.1 +355 -0 sntp/libopts/cook.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/cook.c sntp/libopts/enumeration.c@1.1 +485 -0 sntp/libopts/enumeration.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/enumeration.c sntp/libopts/environment.c@1.1 +261 -0 sntp/libopts/environment.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/environment.c sntp/libopts/genshell.c@1.1 +301 -0 sntp/libopts/genshell.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/genshell.c sntp/libopts/genshell.h@1.1 +142 -0 sntp/libopts/genshell.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/genshell.h sntp/libopts/libopts.c@1.1 +30 -0 sntp/libopts/libopts.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/libopts.c sntp/libopts/load.c@1.1 +520 -0 sntp/libopts/load.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/load.c sntp/libopts/m4/libopts.m4@1.1 +487 -0 sntp/libopts/m4/libopts.m4@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/m4/libopts.m4 sntp/libopts/m4/liboptschk.m4@1.1 +39 -0 sntp/libopts/m4/liboptschk.m4@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/m4/liboptschk.m4 sntp/libopts/makeshell.c@1.1 +1100 -0 sntp/libopts/makeshell.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/makeshell.c sntp/libopts/nested.c@1.1 +705 -0 sntp/libopts/nested.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/nested.c sntp/libopts/numeric.c@1.1 +89 -0 sntp/libopts/numeric.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/numeric.c sntp/libopts/pgusage.c@1.1 +154 -0 sntp/libopts/pgusage.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/pgusage.c sntp/libopts/proto.h@1.1 +88 -0 sntp/libopts/proto.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/proto.h sntp/libopts/putshell.c@1.1 +333 -0 sntp/libopts/putshell.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/putshell.c sntp/libopts/restore.c@1.1 +207 -0 sntp/libopts/restore.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/restore.c sntp/libopts/save.c@1.1 +499 -0 sntp/libopts/save.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/save.c sntp/libopts/sort.c@1.1 +369 -0 sntp/libopts/sort.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/sort.c sntp/libopts/stack.c@1.1 +224 -0 sntp/libopts/stack.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/stack.c sntp/libopts/streqvcmp.c@1.1 +292 -0 sntp/libopts/streqvcmp.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/streqvcmp.c sntp/libopts/text_mmap.c@1.1 +367 -0 sntp/libopts/text_mmap.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/text_mmap.c sntp/libopts/tokenize.c@1.1 +322 -0 sntp/libopts/tokenize.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/tokenize.c sntp/libopts/usage.c@1.1 +732 -0 sntp/libopts/usage.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/usage.c sntp/libopts/version.c@1.1 +181 -0 sntp/libopts/version.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/version.c sntp/sntp-opts.c@1.1 +742 -0 sntp/sntp-opts.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/sntp-opts.c sntp/sntp-opts.h@1.1 +149 -0 sntp/sntp-opts.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/sntp-opts.h sntp/sntp-opts.menu@1.1 +1 -0 sntp/sntp-opts.menu@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/sntp-opts.menu sntp/sntp-opts.texi@1.1 +410 -0 sntp/sntp-opts.texi@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/sntp-opts.texi util/ntp-keygen-opts.c@1.1 +989 -0 util/ntp-keygen-opts.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/util/ntp-keygen-opts.c util/ntp-keygen-opts.h@1.1 +206 -0 util/ntp-keygen-opts.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/util/ntp-keygen-opts.h util/ntp-keygen-opts.menu@1.1 +1 -0 util/ntp-keygen-opts.menu@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/util/ntp-keygen-opts.menu util/ntp-keygen-opts.texi@1.1 +362 -0 util/ntp-keygen-opts.texi@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/util/ntp-keygen-opts.texi util/ntp-keygen.1@1.1 +176 -0 util/ntp-keygen.1@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/util/ntp-keygen.1 ChangeSet@1.1353.1.44, 2006-06-28 07:26:01-04:00, stenn@whimsy.udel.edu NTP_4_2_3P13 TAG: NTP_4_2_3P13 packageinfo.sh@1.6 +1 -1 NTP_4_2_3P13 ChangeSet@1.1251.97.17, 2006-06-28 07:03:07-04:00, stenn@whimsy.udel.edu NTP_4_2_2P0_RC8 TAG: NTP_4_2_2P0_RC8 packageinfo.sh@1.27.5.1 +1 -1 NTP_4_2_2P0_RC8 ChangeSet@1.1251.97.16, 2006-06-27 21:20:21+00:00, burnicki@pogo.udel.edu [BUG 661] Use environment variable to specify the base path to openssl. Updated hints/winnt.html accordingly. html/build/hints/winnt.html@1.16 +42 -20 Added a hint to the build instructions to set up the OPENSSL environment variable. Added the Meinberg link to download the GUI installer. Wrapped some lines. ports/winnt/libntp/libntp.dsp@1.29 +2 -2 Use environment variable to specify the base path to openssl. ports/winnt/ntp-keygen/ntpkeygen.dsp@1.10 +4 -4 Use environment variable to specify the base path to openssl. ports/winnt/ntpd/ntpd.dsp@1.27 +4 -4 Use environment variable to specify the base path to openssl. ports/winnt/ntpdate/ntpdate.dsp@1.15 +2 -2 Use environment variable to specify the base path to openssl. ports/winnt/ntpdc/ntpdc.dsp@1.17 +2 -2 Use environment variable to specify the base path to openssl. ports/winnt/ntpq/ntpq.dsp@1.18 +2 -2 Use environment variable to specify the base path to openssl. ports/winnt/ntptrace/ntptrace.dsp@1.10 +2 -2 Use environment variable to specify the base path to openssl. ChangeSet@1.1353.1.42, 2006-06-27 07:48:03-04:00, stenn@whimsy.udel.edu NTP_4_2_3P12 TAG: NTP_4_2_3P12 packageinfo.sh@1.5 +1 -1 NTP_4_2_3P12 ChangeSet@1.1251.97.15, 2006-06-27 07:02:41-04:00, stenn@whimsy.udel.edu NTP_4_2_2P0_RC7 TAG: NTP_4_2_2P0_RC7 packageinfo.sh@1.27.4.1 +1 -1 NTP_4_2_2P0_RC7 ChangeSet@1.1251.97.14, 2006-06-27 04:19:41-04:00, stenn@whimsy.udel.edu Resolve the ambiguity in the copyright file NEWS@1.50.1.1 +2 -0 Resolve the ambiguity in the copyright file html/copyright.html@1.33.1.1 +4 -4 Resolve the ambiguity in the copyright file ChangeSet@1.1353.1.40, 2006-06-26 07:50:16-04:00, stenn@whimsy.udel.edu NTP_4_2_3P11 TAG: NTP_4_2_3P11 packageinfo.sh@1.4 +1 -1 NTP_4_2_3P11 ChangeSet@1.1251.97.13, 2006-06-26 07:03:11-04:00, stenn@whimsy.udel.edu NTP_4_2_2P0_RC6 TAG: NTP_4_2_2P0_RC6 packageinfo.sh@1.27.3.1 +1 -1 NTP_4_2_2P0_RC6 ChangeSet@1.1251.97.12, 2006-06-26 03:23:59-04:00, stenn@whimsy.udel.edu Documentation updated from Dave Mills html/ntpdsim.html@1.5 +3 -3 Documentation updated from Dave Mills html/scripts/links7.txt@1.2 +1 -0 Documentation updated from Dave Mills html/scripts/links9.txt@1.3 +1 -0 Documentation updated from Dave Mills ChangeSet@1.1251.97.11, 2006-06-26 03:06:50-04:00, stenn@whimsy.udel.edu New documentation files from Dave Mills html/groups.html@1.1 +47 -0 html/groups.html@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-stable/html/groups.html html/ntp_conf.html@1.1 +173 -0 html/ntp_conf.html@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-stable/html/ntp_conf.html html/ntpdsim_new.html@1.1 +102 -0 html/ntpdsim_new.html@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-stable/html/ntpdsim_new.html ChangeSet@1.1251.97.10, 2006-06-26 02:52:54-04:00, stenn@whimsy.udel.edu Fix the ntp-keygen URL (Dave Mills) in authopt.html html/authopt.html@1.40 +2 -2 Fix the ntp-keygen URL (Dave Mills) in authopt.html ChangeSet@1.1353.1.36, 2006-06-26 01:10:19-04:00, stenn@whimsy.udel.edu setsockopt() notes ntpd/ntp_io.c@1.227 +3 -2 setsockopt() notes ChangeSet@1.1353.1.35, 2006-06-26 00:51:09-04:00, stenn@whimsy.udel.edu [Bug 658] hppa2.0-hp-hpux10.20 cc needs a bigger -H for cpp configure.ac@1.387 +8 -0 [Bug 658] hppa2.0-hp-hpux10.20 cc needs a bigger -H for cpp ChangeSet@1.1353.1.34, 2006-06-25 19:52:52-04:00, stenn@whimsy.udel.edu cleanup sntp/Makefile.am@1.14 +2 -3 cleanup ChangeSet@1.1251.97.9, 2006-06-25 19:10:06-04:00, stenn@whimsy.udel.edu [Bug 657]: IP_MULTICAST_LOOP uses a u_char value/size ntpd/ntp_io.c@1.187.1.18 +5 -5 [Bug 657]: IP_MULTICAST_LOOP uses a u_char value/size ChangeSet@1.1251.97.8, 2006-06-25 17:00:47-04:00, stenn@whimsy.udel.edu distcheck fixes BitKeeper/etc/ignore@1.35.1.2 +1 -0 added sntp/bincheck.mf Makefile.am@1.48.1.5 +1 -0 cleanup; distcheck now works from sntp bootstrap@1.4.3.1 +2 -0 cleanup; distcheck now works from sntp sntp/Makefile.am@1.6.1.1 +5 -23 cleanup; distcheck now works from sntp ChangeSet@1.1353.1.31, 2006-06-25 07:51:20-04:00, stenn@whimsy.udel.edu NTP_4_2_3P10 TAG: NTP_4_2_3P10 packageinfo.sh@1.3 +1 -1 NTP_4_2_3P10 ChangeSet@1.1251.97.7, 2006-06-25 07:03:22-04:00, stenn@whimsy.udel.edu NTP_4_2_2P0_RC5 TAG: NTP_4_2_2P0_RC5 packageinfo.sh@1.27.2.1 +1 -1 NTP_4_2_2P0_RC5 ChangeSet@1.1353.1.30, 2006-06-25 04:50:29-04:00, stenn@whimsy.udel.edu Bail on an autogen error bootstrap@1.11 +2 -1 Bail on an autogen error ChangeSet@1.1353.1.28, 2006-06-24 18:12:20-04:00, stenn@deacon.udel.edu fix quoting BitKeeper/triggers/pre-resolve.licfix@1.2 +1 -1 fix quoting ChangeSet@1.1251.98.4, 2006-06-24 18:45:02+00:00, kardel@pogo.udel.edu ntpq_ops.c: fix a type punned pointer issue reported by gcc 4 ntpq/ntpq_ops.c@1.20.3.1 +6 -6 fix a type punned pointer issue reported by gcc 4 ChangeSet@1.1251.98.3, 2006-06-24 18:31:47+00:00, kardel@pogo.udel.edu refclock_shm.c: fix gcc 4 uninitialized warning ntpd/refclock_shm.c@1.17 +4 -0 fix gcc 4 uninitialized warning ChangeSet@1.1251.98.2, 2006-06-24 18:24:35+00:00, kardel@pogo.udel.edu data_mbg.c, refclock_parse.c, mbg_gps166.h, clk_rawdcf.c: fix gcc 4 signedness complaints include/mbg_gps166.h@1.5.1.2 +7 -4 fix gcc 4 signedness complaints libparse/clk_rawdcf.c@1.14 +10 -4 fix gcc 4 signedness complaints libparse/data_mbg.c@1.5.1.2 +17 -14 fix gcc 4 signedness complaints ntpd/refclock_parse.c@1.35.1.14 +14 -7 fix gcc 4 signedness complaints ChangeSet@1.1251.98.1, 2006-06-24 17:39:54+00:00, kardel@pogo.udel.edu refclock_acts.c: NetBSD Coverity CID 3797: bad return code check for open(2) fixed (!fd replaced with fd < 0) ntp_util.c: NetBSD Coverity CID 3804: avoid file pointer leak refclock_parse.c: NetBSD Coverity CID 3796: possible NULL deref ntpq.c: NetBSD Coverity CID 3799: overrun static array (off by one) fixed ntpd/ntp_util.c@1.36.2.2 +1 -0 NetBSD Coverity CID 3804: avoid file pointer leak ntpd/refclock_acts.c@1.25.1.2 +1 -1 NetBSD Coverity CID 3797: bad return code check for open(2) fixed (!fd replaced with fd < 0) ntpd/refclock_parse.c@1.35.1.13 +5 -1 NetBSD Coverity CID 3796: possible NULL deref ntpq/ntpq.c@1.55.1.6 +1 -1 NetBSD Coverity CID 3799: overrun static array (off by one) fixed ChangeSet@1.1353.1.26, 2006-06-24 16:50:45+00:00, kardel@pogo.udel.edu ntp_io.c: implement fix for bug 614 socket fds will be moved out of the stdio reserved area if at all possible ntpd/ntp_io.c@1.224 +106 -27 implement fix for bug 614 socket fds will be moved out of the stdio reserved area if at all possible ChangeSet@1.1251.97.5, 2006-06-24 16:46:25+00:00, kardel@pogo.udel.edu ntp_io.c: implement fix for bug 614 socket fds will be moved out of the stdio reserved space if at all possible ntpd/ntp_io.c@1.187.1.17 +107 -27 implement fix for bug 614 socket fds will be moved out of the stdio reserved space if at all possible ChangeSet@1.1353.1.25, 2006-06-23 07:48:33-04:00, stenn@whimsy.udel.edu NTP_4_2_3P9 TAG: NTP_4_2_3P9 packageinfo.sh@1.2 +1 -1 NTP_4_2_3P9 ChangeSet@1.1251.97.4, 2006-06-23 07:02:47-04:00, stenn@whimsy.udel.edu NTP_4_2_2P0_RC4 TAG: NTP_4_2_2P0_RC4 packageinfo.sh@1.27.1.9 +1 -1 NTP_4_2_2P0_RC4 ChangeSet@1.1251.97.3, 2006-06-22 17:07:33-04:00, stenn@whimsy.udel.edu Remove the license: key from etc/config to make the bk4 upgrade easier. BitKeeper/etc/config@1.7.1.1 +2 -1 Remove the license: key from etc/config to make the bk4 upgrade easier. ChangeSet@1.1353.1.23, 2006-06-22 16:17:02-04:00, stenn@whimsy.udel.edu break the link between -stable and -dev copies of packageinfo.sh BitKeeper/deleted/.del-packageinfo.sh~7f44215e99c0cd03@1.47 +0 -0 Delete: packageinfo.sh packageinfo.sh@1.1 +26 -0 packageinfo.sh@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-632/packageinfo.sh ChangeSet@1.1251.97.2, 2006-06-22 19:28:28+00:00, kardel@pogo.udel.edu refclock_parse.c: bug 632: update kernel PPS offsets when PPS offset is re-configured ntpd/refclock_parse.c@1.35.1.12 +10 -4 bug 632: update kernel PPS offsets when PPS offset is re-configured ChangeSet@1.1353.1.22, 2006-06-22 07:03:29-04:00, stenn@whimsy.udel.edu NTP_4_2_3P8 TAG: NTP_4_2_3P8 packageinfo.sh@1.46 +1 -1 NTP_4_2_3P8 ChangeSet@1.1353.1.21, 2006-06-22 00:29:56-04:00, stenn@whimsy.udel.edu cmd_args.c cleanup ntpd/cmd_args.c@1.41 +3 -153 cleanup ChangeSet@1.1353.1.20, 2006-06-21 07:03:02-04:00, stenn@whimsy.udel.edu NTP_4_2_3P7 TAG: NTP_4_2_3P7 packageinfo.sh@1.45 +1 -1 NTP_4_2_3P7 ChangeSet@1.1353.1.19, 2006-06-21 06:17:57-04:00, stenn@whimsy.udel.edu OSF4 does not have RTM_{NEW,DEL}ADDR ntpd/ntp_io.c@1.223 +4 -0 OSF4 does not have RTM_{NEW,DEL}ADDR ChangeSet@1.1353.1.18, 2006-06-21 03:52:10-04:00, stenn@whimsy.udel.edu Use a pointer to feed the options to optionUsage() to avoid a struct copy ntpd/cmd_args.c@1.40 +4 -4 Use a pointer to feed the options to optionUsage() to avoid a struct copy ChangeSet@1.1353.1.17, 2006-06-20 17:42:13-04:00, stenn@whimsy.udel.edu Protect COMMAND since we use it as an autogen keyword ntpdc/ntpdc.c@1.52 +9 -4 Protect COMMAND since we use it as an autogen keyword ntpq/ntpq.c@1.63 +10 -5 Protect COMMAND since we use it as an autogen keyword ChangeSet@1.1353.1.16, 2006-06-20 07:03:15-04:00, stenn@whimsy.udel.edu NTP_4_2_3P6 TAG: NTP_4_2_3P6 packageinfo.sh@1.44 +1 -1 NTP_4_2_3P6 ChangeSet@1.1353.1.14, 2006-06-20 03:15:38-04:00, stenn@whimsy.udel.edu Fix the configure.ac check for rt_msghdr configure.ac@1.386 +2 -3 Fix the configure.ac check for rt_msghdr ChangeSet@1.1353.1.13, 2006-06-19 07:24:31-04:00, stenn@whimsy.udel.edu NTP_4_2_3P5 TAG: NTP_4_2_3P5 packageinfo.sh@1.42 +1 -1 NTP_4_2_3P5 ChangeSet@1.1251.97.1, 2006-06-19 07:02:56-04:00, stenn@whimsy.udel.edu NTP_4_2_2P0_RC3 TAG: NTP_4_2_2P0_RC3 packageinfo.sh@1.27.1.8 +1 -1 NTP_4_2_2P0_RC3 ChangeSet@1.1353.1.12, 2006-06-19 04:16:30-04:00, stenn@whimsy.udel.edu Update the NEWS file for the dynamic interface scan fix NEWS@1.52 +1 -0 Update the NEWS file for the dynamic interface scan fix ChangeSet@1.1251.96.1, 2006-06-19 02:31:54-04:00, stenn@pogo.udel.edu Avoid hardcoded path to bash for the bootstrap script bootstrap@1.4.2.1 +1 -1 Avoid hardcoded path to bash for the bootstrap script ChangeSet@1.1353.3.8, 2006-06-18 20:14:55-04:00, stenn@deacon.udel.edu Bash might not be in /bin/bash (for bootstrap) bootstrap@1.9 +9 -6 Bash might not be in /bin/bash (for bootstrap) ChangeSet@1.1353.3.7, 2006-06-18 20:12:51-04:00, stenn@deacon.udel.edu ignore: added libopts/* BitKeeper/etc/ignore@1.50 +1 -0 added libopts/* ChangeSet@1.1251.94.19, 2006-06-18 20:09:27-04:00, stenn@deacon.udel.edu bash (for the bootstrap script) might not be /bin/bash bootstrap@1.4.1.1 +1 -1 bash (for the bootstrap script) might not be /bin/bash ChangeSet@1.1353.1.9, 2006-06-18 22:18:50+00:00, kardel@pogo.udel.edu ntp_io.c: import fix for bug 637 ntpd/ntp_io.c@1.221 +22 -9 import fix for bug 637 ChangeSet@1.1353.3.6, 2006-06-18 07:24:11-04:00, stenn@whimsy.udel.edu NTP_4_2_3P4 TAG: NTP_4_2_3P4 packageinfo.sh@1.40 +1 -1 NTP_4_2_3P4 ChangeSet@1.1251.94.18, 2006-06-18 07:03:14-04:00, stenn@whimsy.udel.edu NTP_4_2_2P0_RC2 TAG: NTP_4_2_2P0_RC2 packageinfo.sh@1.27.1.7 +1 -1 NTP_4_2_2P0_RC2 ChangeSet@1.1353.3.5, 2006-06-18 02:18:46-04:00, stenn@whimsy.udel.edu The fix for bug 637 needs work for ntp-dev ntpd/ntp_io.c@1.218.1.1 +2 -0 The fix for bug 637 needs work for ntp-dev ChangeSet@1.1353.3.4, 2006-06-18 02:14:55-04:00, stenn@whimsy.udel.edu ntp-dev uses repotype=dev packageinfo.sh@1.39 +2 -2 ntp-dev uses repotype=dev ChangeSet@1.1251.94.17, 2006-06-18 02:05:42-04:00, stenn@whimsy.udel.edu Make the license check triggers work with bk3 and bk4 BitKeeper/triggers/post-incoming.license-warn@1.6 +9 -3 Make the license check triggers work with bk3 and bk4 BitKeeper/triggers/pre-resolve.license-chk@1.5.1.2 +10 -4 Make the license check triggers work with bk3 and bk4 ChangeSet@1.1251.94.15, 2006-06-17 22:47:38-04:00, stenn@whimsy.udel.edu debug BitKeeper/triggers/post-incoming.license-warn@1.5 +1 -0 debug BitKeeper/triggers/pre-resolve.license-chk@1.5.1.1 +1 -0 debug ChangeSet@1.1353.3.1, 2006-06-17 22:32:24-04:00, stenn@whimsy.udel.edu typo BitKeeper/triggers/pre-resolve.license-chk@1.3.1.1 +0 -1 typo ChangeSet@1.1251.94.14, 2006-06-17 22:05:18-04:00, stenn@whimsy.udel.edu typo BitKeeper/triggers/pre-resolve.license-chk@1.5 +0 -1 typo ChangeSet@1.1353.1.7, 2006-06-18 00:01:22+00:00, kardel@pogo.udel.edu ntp_io.c: skip interfaces that cannot be bound to ntpd/ntp_io.c@1.219 +1 -0 skip interfaces that cannot be bound to ChangeSet@1.1251.94.13, 2006-06-17 19:57:47-04:00, stenn@whimsy.udel.edu More bk-4 license check trigger cleanup BitKeeper/triggers/post-incoming.license-warn@1.4 +2 -0 More bk-4 license check trigger cleanup BitKeeper/triggers/pre-resolve.license-chk@1.4 +2 -0 More bk-4 license check trigger cleanup ChangeSet@1.1251.95.1, 2006-06-17 23:09:55+00:00, kardel@pogo.udel.edu ntp_io.c: move decision into seperate function and insure compilability on non IPv6 platforms ntpd/ntp_io.c@1.187.1.16 +24 -8 move decision into seperate function and insure compilability on non IPv6 platforms ChangeSet@1.1251.94.12, 2006-06-17 18:42:11-04:00, stenn@whimsy.udel.edu More bk-4 license check trigger cleanup BitKeeper/triggers/post-incoming.license-warn@1.3 +11 -4 More bk-4 license check trigger cleanup BitKeeper/triggers/pre-resolve.license-chk@1.3 +12 -4 More bk-4 license check trigger cleanup ChangeSet@1.1251.94.11, 2006-06-17 13:53:20-04:00, stenn@whimsy.udel.edu [Bug 637] Ignore UP in*addr_any interfaces ntpd/ntp_io.c@1.187.1.15 +15 -0 [Bug 637] Ignore UP in*addr_any interfaces ChangeSet@1.1251.94.10, 2006-06-17 13:47:07-04:00, stenn@whimsy.udel.edu Deal with -stable rcpoint packageinfo.sh@1.27.1.6 +1 -0 Deal with -stable rcpoint scripts/VersionName@1.4 +10 -0 Deal with -stable rcpoint ChangeSet@1.1251.94.9, 2006-06-17 12:37:23-04:00, stenn@whimsy.udel.edu bk-3 uses sccscat, bk-4 uses annotate BitKeeper/triggers/post-incoming.license-warn@1.2 +10 -1 bk-3 uses sccscat, bk-4 uses annotate BitKeeper/triggers/pre-resolve.license-chk@1.2 +9 -1 bk-3 uses sccscat, bk-4 uses annotate ChangeSet@1.1353.1.4, 2006-06-17 07:21:46-04:00, stenn@whimsy.udel.edu NTP_4_2_3P3 TAG: NTP_4_2_3P3 packageinfo.sh@1.37 +1 -1 NTP_4_2_3P3 ChangeSet@1.1251.94.8, 2006-06-17 07:02:53-04:00, stenn@whimsy.udel.edu NTP_4_2_2P0_RC TAG: NTP_4_2_2P0_RC packageinfo.sh@1.27.1.5 +1 -1 NTP_4_2_2P0_RC ChangeSet@1.1353.1.2, 2006-06-16 18:33:41-04:00, stenn@pogo.udel.edu Makefile.am: "make distcheck" is now happy with the libopts/ stuff configure.ac, Makefile.am: [Bug 635] get libopts/ properly distributed [Bug 635] Properly distribute libopts/ . Makefile.am: Distribute copyright.def and debug-opt.def debug-opt.def: Change mode to -rw-rw-rw- Makefile.am@1.66 +61 -57 "make distcheck" is now happy with the libopts/ stuff Makefile.am@1.65 +1 -1 [Bug 635] get libopts/ properly distributed Makefile.am@1.64 +6 -3 [Bug 635] Properly distribute libopts/ . configure.ac@1.385 +1 -2 [Bug 635] get libopts/ properly distributed configure.ac@1.384 +1 -0 [Bug 635] Properly distribute libopts/ . include/Makefile.am@1.23 +1 -1 Distribute copyright.def and debug-opt.def include/debug-opt.def@1.3 +0 -0 Change mode to -rw-rw-rw- ChangeSet@1.1251.94.7, 2006-06-16 18:02:54-04:00, stenn@whimsy.udel.edu [Bug 633] Avoid writing files in srcdir scripts/genver@1.4 +8 -8 [Bug 633] Avoid writing files in srcdir ChangeSet@1.1351.1.1, 2006-06-16 02:54:50-04:00, stenn@pogo.udel.edu Use separate copies of libopts for ntp and sntp bootstrap@1.6.1.1 +7 -0 Use separate copies of libopts for ntp and sntp ChangeSet@1.1353, 2006-06-15 07:12:32-04:00, stenn@whimsy.udel.edu NTP_4_2_3P2 TAG: NTP_4_2_3P2 packageinfo.sh@1.35 +1 -1 NTP_4_2_3P2 ChangeSet@1.1352, 2006-06-15 04:46:11-04:00, stenn@whimsy.udel.edu Try harder to get sntp/libopts/Makefile.in to get the correct srcdir path bootstrap@1.7 +4 -0 Try harder to get sntp/libopts/Makefile.in to get the correct srcdir path ChangeSet@1.1347.2.3, 2006-06-13 07:27:18-04:00, stenn@whimsy.udel.edu NTP_4_2_3P1 TAG: NTP_4_2_3P1 packageinfo.sh@1.34 +1 -1 NTP_4_2_3P1 ChangeSet@1.1251.94.6, 2006-06-13 07:02:41-04:00, stenn@whimsy.udel.edu NTP_4_2_2P0_RC TAG: NTP_4_2_2P0_RC packageinfo.sh@1.27.1.4 +1 -1 NTP_4_2_2P0_RC ChangeSet@1.1251.94.5, 2006-06-13 04:43:41-04:00, stenn@whimsy.udel.edu Distribute the bootstrap script Makefile.am@1.48.1.4 +1 -0 Distribute the bootstrap script ChangeSet@1.1347.2.1, 2006-06-12 07:47:44-04:00, stenn@whimsy.udel.edu NTP_4_2_3P0 TAG: NTP_4_2_3P0 packageinfo.sh@1.32 +1 -1 NTP_4_2_3P0 ChangeSet@1.1251.94.4, 2006-06-12 07:03:05-04:00, stenn@whimsy.udel.edu NTP_4_2_2P0_RC TAG: NTP_4_2_2P0_RC packageinfo.sh@1.27.1.3 +2 -2 NTP_4_2_2P0_RC ChangeSet@1.1347.1.10, 2006-06-12 01:42:27-04:00, stenn@whimsy.udel.edu Explain how to disable the trigger stuff BitKeeper/triggers/trigger.README@1.4 +6 -0 Explain how to disable the trigger stuff ChangeSet@1.1347.1.9, 2006-06-12 01:37:08-04:00, stenn@whimsy.udel.edu cleanup packageinfo.sh@1.31 +2 -2 cleanup ChangeSet@1.1251.94.3, 2006-06-11 18:38:11-04:00, stenn@whimsy.udel.edu Install license check triggers. BitKeeper/triggers/post-incoming.license-warn@1.1 +14 -0 BitKeeper/triggers/post-incoming.license-warn@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-stable/BitKeeper/triggers/post-incoming.license-warn BitKeeper/triggers/pre-resolve.license-chk@1.1 +21 -0 BitKeeper/triggers/pre-resolve.license-chk@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-stable/BitKeeper/triggers/pre-resolve.license-chk ChangeSet@1.1251.94.2, 2006-06-11 17:49:08-04:00, stenn@whimsy.udel.edu Add some internal distribution checks packageinfo.sh@1.27.1.2 +3 -3 Add some internal distribution checks ChangeSet@1.1347.1.7, 2006-06-11 01:34:07+00:00, rick@pogo.udel.edu pre-resolve.fixlic: Block bad repos from being pulled into this repo, or if this repo is bad, stops it from being used. Please do a 'bk fix -c' and edit pre-resolve.fixlic to either rename it or make it better. Then bk new them and bk commit. Thanks. -- Rick Smith BitKeeper/triggers/pre-resolve.licfix@1.1 +32 -0 BitKeeper/triggers/pre-resolve.licfix@1.0 +0 -0 BitKeeper file /pogo/users/lm/ntp-fixed.license/BitKeeper/triggers/pre-resolve.licfix ChangeSet@1.1347.1.6, 2006-06-10 01:37:28-04:00, stenn@whimsy.udel.edu bootstrap: there was a libopts dependency name problem with the old autoreconf sequence - change it to something slower that works. flock-build: lose --with-sntp as it is no longer needed bootstrap@1.6 +2 -2 there was a libopts dependency name problem with the old autoreconf sequence - change it to something slower that works. flock-build@1.36 +1 -1 lose --with-sntp as it is no longer needed ChangeSet@1.1347.1.5, 2006-06-09 19:30:12-04:00, stenn@whimsy.udel.edu NTP_4_2_3 TAG: NTP_4_2_3 packageinfo.sh@1.29 +1 -1 NTP_4_2_3 ChangeSet@1.1251.94.1, 2006-06-06 16:19:55-04:00, stenn@whimsy.udel.edu NTP_4_2_2 TAG: NTP_4_2_2 packageinfo.sh@1.27.1.1 +1 -1 NTP_4_2_2 ChangeSet@1.1347.1.4, 2006-06-06 05:05:56-04:00, stenn@whimsy.udel.edu [Bug 500] sntp is now part of the team Makefile.am@1.62 +1 -1 [Bug 500] sntp is now part of the team configure.ac@1.381.1.1 +1 -20 [Bug 500] sntp is now part of the team ChangeSet@1.1350, 2006-06-06 08:47:18+00:00, kardel@pogo.udel.edu ntpdbase-opts.def: add U option for update interval for interface scan cmd_args.c: adjust argument processing to a number ntpd/cmd_args.c@1.39 +5 -5 adjust argument processing to a number ntpd/ntpdbase-opts.def@1.2.1.1 +13 -0 add U option for update interval for interface scan ChangeSet@1.1347.1.3, 2006-06-06 04:44:33-04:00, stenn@deacon.udel.edu Mention autogen in NEWS NEWS@1.51 +2 -0 Mention autogen in NEWS ChangeSet@1.1347.1.2, 2006-06-06 04:21:52-04:00, stenn@deacon.udel.edu Copyright cleanup clockstuff/Makefile.am@1.5 +2 -0 Copyright cleanup clockstuff/clktest-opts.def@1.3 +0 -22 Copyright cleanup include/copyright.def@1.3 +3 -2 Copyright cleanup ntpd/Makefile.am@1.48 +6 -6 Copyright cleanup ntpd/ntpd-opts.def@1.3 +1 -28 Copyright cleanup ntpd/ntpdbase-opts.def@1.3 +0 -13 Copyright cleanup ntpd/ntpdsim-opts.def@1.3 +1 -28 Copyright cleanup ntpdc/Makefile.am@1.30 +3 -3 Copyright cleanup ntpdc/ntpdc-opts.def@1.9 +0 -22 Copyright cleanup ntpq/Makefile.am@1.22 +3 -3 Copyright cleanup ntpq/ntpq-opts.def@1.6 +1 -42 Copyright cleanup sntp/sntp-opts.def@1.3 +3 -24 Copyright cleanup util/Makefile.am@1.31 +3 -3 Copyright cleanup util/ntp-keygen-opts.def@1.3 +3 -32 Copyright cleanup ChangeSet@1.1347.1.1, 2006-06-06 03:06:10-04:00, stenn@whimsy.udel.edu re-enable auto-gen bootstrap@1.5 +14 -14 Re-enable autogen now that we need it. ntpd/ntpd.c@1.77.1.1 +0 -2 lose some old debug output ChangeSet@1.1251.80.72, 2006-06-05 21:31:04-04:00, stenn@whimsy.udel.edu ntp-4.2.3 packageinfo.sh@1.28 +1 -1 ntp-4.2.3 ChangeSet@1.1251.80.71, 2006-06-05 19:53:12-04:00, stenn@whimsy.udel.edu ntp-4.2.2 NEWS@1.50 +6 -1 Release ntp-4.2.2 packageinfo.sh@1.27 +4 -4 Release ntp-4.2.2 scripts/VersionName@1.3 +1 -0 clean up a corner case ChangeSet@1.1251.80.70, 2006-05-29 07:02:40-04:00, stenn@whimsy.udel.edu NTP_4_2_1P257_RC TAG: NTP_4_2_1P257_RC packageinfo.sh@1.26 +1 -1 NTP_4_2_1P257_RC ChangeSet@1.1251.72.45, 2006-05-27 11:04:43+00:00, kardel@pogo.udel.edu monopt.html: document conditional nature of process timing debugging ntpd.c: make process timing debug conditional cleanup conditional compilation ntp_util.c, ntp_io.c: make process timing debug conditional ntpd.h: cleanup conditional compile cruft in ntpd.c by defining a macro configure.ac: make process timing debug code conditional (default off) configure.ac@1.359.1.30 +9 -0 make process timing debug code conditional (default off) html/monopt.html@1.22 +1 -1 document conditional nature of process timing debugging include/ntpd.h@1.82.1.16 +5 -0 cleanup conditional compile cruft in ntpd.c by defining a macro ntpd/ntp_io.c@1.217 +9 -7 make process timing debug conditional ntpd/ntp_util.c@1.41 +3 -3 make process timing debug conditional ntpd/ntpd.c@1.61.1.26 +11 -21 make process timing debug conditional cleanup conditional compilation ChangeSet@1.1251.80.68, 2006-05-27 07:02:40-04:00, stenn@whimsy.udel.edu NTP_4_2_1P256_RC TAG: NTP_4_2_1P256_RC packageinfo.sh@1.25 +1 -1 NTP_4_2_1P256_RC ChangeSet@1.1251.93.1, 2006-05-26 17:08:21+00:00, kardel@pogo.udel.edu ntpdc.h: bug 621 change arg_v to struct, add type field ntpdc.c: bug 621 change arg_v to struct, add type field, initialize string member always as the 'new' parsing code seems to make that previously unfounded assumption. ntpdc/ntpdc.c@1.40.2.6 +9 -2 bug 621 change arg_v to struct, add type field, initialize string member always as the 'new' parsing code seems to make that previously unfounded assumption. ntpdc/ntpdc.h@1.7 +4 -2 bug 621 change arg_v to struct, add type field ChangeSet@1.1251.80.67, 2006-05-26 14:40:03+00:00, kardel@pogo.udel.edu refclock_parse.c: bug 619 delay io_addclock() even further as suggested by Ronan Flood ntpd/refclock_parse.c@1.35.1.11 +25 -19 bug 619 delay io_addclock() even further as suggested by Ronan Flood ChangeSet@1.1251.80.66, 2006-05-26 07:02:46-04:00, stenn@whimsy.udel.edu NTP_4_2_1P255_RC TAG: NTP_4_2_1P255_RC packageinfo.sh@1.24 +1 -1 NTP_4_2_1P255_RC ChangeSet@1.1251.92.3, 2006-05-25 18:25:23+00:00, kardel@pogo.udel.edu refclock_parse.c: bug #619 terminate parse io engine after de-registering from refclock io engine ntpd/refclock_parse.c@1.35.3.3 +12 -7 bug #619 terminate parse io engine after de-registering from refclock io engine ChangeSet@1.1251.92.2, 2006-05-25 18:08:49+00:00, kardel@pogo.udel.edu ntp_io.c: add missing BLOCKIO()/UNBLOCKIO() calls in refclock io handling found during analysis for bug #619 refclock_parse.c: bug #619 complete refclock io structure initialization *before* inserting it into the refclock input machine (avoids null pointer deref) ntpd/ntp_io.c@1.187.1.14 +4 -0 add missing BLOCKIO()/UNBLOCKIO() calls in refclock io handling found during analysis for bug #619 ntpd/refclock_parse.c@1.35.3.2 +19 -12 bug #619 complete refclock io structure initialization *before* inserting it into the refclock input machine (avoids null pointer deref) ChangeSet@1.1251.92.1, 2006-05-25 07:02:50-04:00, stenn@whimsy.udel.edu NTP_4_2_1P254_RC TAG: NTP_4_2_1P254_RC packageinfo.sh@1.23 +1 -1 NTP_4_2_1P254_RC ChangeSet@1.1251.72.42, 2006-05-25 07:55:42+00:00, kardel@pogo.udel.edu monopt.html: document timingstats (only available when daemon is compiled with DEBUG) ntpd.h, ntpd.c, ntp_util.c: support collection of timing data ntp_io.c: implement SO_TIMESTAMP for systems that have it support collection of timing data fix io signal blocking in refclock io handling functions ntp_crypto.c: return OK when interface is not bound html/monopt.html@1.21 +5 -1 document timingstats (only available when daemon is compiled with DEBUG) include/ntpd.h@1.82.1.15 +6 -0 support collection of timing data ntpd/ntp_crypto.c@1.107 +1 -1 return OK when interface is not bound ntpd/ntp_io.c@1.215 +119 -12 implement SO_TIMESTAMP for systems that have it support collection of timing data fix io signal blocking in refclock io handling functions ntpd/ntp_util.c@1.40 +39 -0 support collection of timing data ntpd/ntpd.c@1.61.1.25 +43 -17 support collection of timing data ChangeSet@1.1251.80.62, 2006-05-24 22:01:55-04:00, mayer@pogo.udel.edu Bug #504 Allow forced DNS retry even on failure only if macro FORCE_DNSRETRY is defined ntpd/ntp_intres.c@1.47 +13 -0 Bug #504 Allow forced DNS retry even on failure only if macro FORCE_DNSRETRY is defined ChangeSet@1.1251.80.61, 2006-05-21 14:57:46-04:00, mayer@pogo.udel.edu Bug #614 Remove errno manipulation from move_fd() ntpd/ntp_io.c@1.187.1.13 +1 -3 Bug #614 Remove errno manipulation from move_fd() ChangeSet@1.1251.91.1, 2006-05-21 12:10:13-04:00, mayer@pogo.udel.edu Bug #614 Changed dup_fd to move_fd and remove for Windows ntpd/ntp_io.c@1.187.1.12 +5 -5 Bug #614 Changed dup_fd to move_fd and remove for Windows ChangeSet@1.1251.80.59, 2006-05-21 07:03:00-04:00, stenn@whimsy.udel.edu NTP_4_2_1P253_RC TAG: NTP_4_2_1P253_RC packageinfo.sh@1.22 +1 -1 NTP_4_2_1P253_RC ChangeSet@1.1251.80.57, 2006-05-20 19:15:50-04:00, mayer@pogo.udel.edu Fix Bug #612: Erroneous FAR macro libntp/ntp_rfc2553.c@1.27.1.4 +2 -5 Fix Bug #612: Erroneous FAR macro ports/winnt/libntp/dnslookup.c@1.3 +3 -3 Fix Bug #612: Erroneous FAR macro ChangeSet@1.1251.90.5, 2006-05-20 18:16:07-04:00, stenn@whimsy.udel.edu Update the UDel host lists and handle the PWD better br-flock@1.9 +1 -1 Update the UDel host lists and handle the PWD better flock-build@1.35 +2 -3 Update the UDel host lists and handle the PWD better ChangeSet@1.1251.80.56, 2006-05-20 17:01:51-04:00, mayer@pogo.udel.edu Bug fixes for #611, 612, 614 and 530 libntp/ntp_rfc2553.c@1.27.1.3 +4 -2 Bug #612 Added include for netent structure ntpd/ntp_intres.c@1.46 +1 -1 Bug #611 Check for various EAI_* macros ntpd/ntp_io.c@1.187.1.11 +6 -4 Bug #530 and #614 fixes to add comments ChangeSet@1.1251.80.55, 2006-05-16 07:58:39-04:00, mayer@pogo.udel.edu Bug #614 Add FOPEN_MAX as a parameter for dup_fd() usage. Also this is the fix for Bug #530 ntpd/ntp_io.c@1.187.1.10 +5 -2 Bug #614 Add FOPEN_MAX as a parameter for dup_fd() usage. Also this is the fix for Bug #530 ChangeSet@1.1251.80.54, 2006-05-15 19:45:34-04:00, mayer@pogo.udel.edu Bug #611. Refix to add additional condition for Win32 ntpd/ntp_intres.c@1.45 +2 -0 Bug #611. Refix to add additional condition for Win32 ChangeSet@1.1251.80.53, 2006-05-15 19:30:22-04:00, mayer@pogo.udel.edu Bug #614 Fix duplicate descriptor code and properly handle error conditions ntpd/ntp_io.c@1.187.1.9 +6 -1 Bug #614 Fix duplicate descriptor code and properly handle error conditions ChangeSet@1.1251.90.4, 2006-05-13 07:02:51-04:00, stenn@whimsy.udel.edu NTP_4_2_1P252_RC TAG: NTP_4_2_1P252_RC packageinfo.sh@1.21 +1 -1 NTP_4_2_1P252_RC ChangeSet@1.1251.90.3, 2006-05-12 14:57:38-04:00, stenn@whimsy.udel.edu [Bug 611] Fix based on Danny's comment ntpd/ntp_intres.c@1.44 +2 -0 [Bug 611] Fix based on Danny's comment ChangeSet@1.1251.90.2, 2006-05-12 16:29:02+00:00, kardel@pogo.udel.edu refclock_parse.c: Bug 613: fix spelling ntpd/refclock_parse.c@1.35.3.1 +2 -2 Bug 613: fix spelling ChangeSet@1.1251.90.1, 2006-05-11 13:45:28-04:00, stenn@whimsy.udel.edu NTP_4_2_1P251_RC TAG: NTP_4_2_1P251_RC packageinfo.sh@1.20 +1 -1 NTP_4_2_1P251_RC ChangeSet@1.1251.89.1, 2006-05-11 15:07:05+00:00, kardel@pogo.udel.edu refclock_parse.c: fix spelling ntpd/refclock_parse.c@1.35.1.8 +2 -2 fix spelling ChangeSet@1.1251.80.51, 2006-05-10 23:55:45-04:00, mayer@pogo.udel.edu Bug #611 Fix for EAI_* codes and netent definitions libntp/ntp_rfc2553.c@1.27.1.2 +3 -0 Bug #612 Fix for EAI_* codes and netent definitions - add netdb.h include ChangeSet@1.1251.80.50, 2006-05-10 15:05:24-04:00, stenn@whimsy.udel.edu allow the AUTORECONF envariable to supply the name of autoreconf bootstrap@1.4 +4 -2 allow the AUTORECONF envariable to supply the name of autoreconf ChangeSet@1.1251.80.49, 2006-05-09 06:44:15-04:00, stenn@whimsy.udel.edu NTP_4_2_1P250_RC TAG: NTP_4_2_1P250_RC packageinfo.sh@1.19 +1 -1 NTP_4_2_1P250_RC ChangeSet@1.1251.80.48, 2006-05-09 09:56:16+00:00, kardel@pogo.udel.edu ntpd.c: keep block/unblock calls balanced ntpd/ntpd.c@1.61.1.24 +4 -4 keep block/unblock calls balanced ChangeSet@1.1251.88.1, 2006-05-09 09:30:28+00:00, kardel@pogo.udel.edu ntpd.c: refill of current buffer missing ntpd/ntpd.c@1.61.1.23 +1 -0 refill of current buffer missing ChangeSet@1.1251.87.1, 2006-05-09 03:22:02-04:00, stenn@whimsy.udel.edu prepare for RCs for -stable point releases packageinfo.sh@1.18 +6 -0 prepare for RCs for -stable point releases ChangeSet@1.1251.80.45, 2006-05-09 07:12:14+00:00, kardel@pogo.udel.edu ntpd.c: move freerecvbuf() into block io section test receiver instead of just the rbuf pointer ntpd/ntpd.c@1.61.1.22 +2 -2 move freerecvbuf() into block io section test receiver instead of just the rbuf pointer ChangeSet@1.1251.80.44, 2006-05-08 18:21:44-04:00, stenn@whimsy.udel.edu NTP_4_2_1P249_RC TAG: NTP_4_2_1P249_RC packageinfo.sh@1.17 +1 -1 NTP_4_2_1P249_RC ChangeSet@1.1251.80.43, 2006-05-08 10:52:36+00:00, burnicki@pogo.udel.edu Retrieve version info from packageinfo.sh also under Windows. BitKeeper/etc/logging_ok@1.57.3.3 +1 -0 Logging to repologs@ntp.isc.org accepted ports/winnt/scripts/mkver.bat@1.8 +45 -18 Retrieve version info from packageinfo.sh. ChangeSet@1.1251.80.42, 2006-05-08 05:34:00-04:00, stenn@whimsy.udel.edu NTP_4_2_1P248_RC TAG: NTP_4_2_1P248_RC packageinfo.sh@1.16 +1 -1 NTP_4_2_1P248_RC ChangeSet@1.1251.80.41, 2006-05-08 04:59:17-04:00, stenn@whimsy.udel.edu handle the initial case where no version files exist scripts/genver@1.3 +8 -8 handle the initial case where no version files exist ChangeSet@1.1251.80.40, 2006-05-05 16:40:34-04:00, mayer@pogo.udel.edu Bug #596/527 updates to remove [UN]BLOCKIO() and keep initialization for Windows libntp/recvbuff.c@1.22 +0 -10 Bug #596/527 updates to remove [UN]BLOCKIO() and keep initialization for Windows ChangeSet@1.1251.80.39, 2006-05-05 08:48:59-04:00, mayer@pogo.udel.edu Bug #504 Collection of changes to retry DNS in case unable to get definitive answer libntp/ntp_rfc2553.c@1.27.1.1 +43 -5 Bug #504 Move lookup call to dnslookup() function ntpd/ntp_intres.c@1.43 +22 -8 Bug Retry DNS lookups if DNS unable to give a definitive answer or is unreachable ports/winnt/libntp/dnslookup.c@1.2 +0 -1 Bug #504 Windows only special lookup to fix return error codes ports/winnt/libntp/dnslookup.c@1.1 +197 -0 ports/winnt/libntp/dnslookup.c@1.0 +0 -0 BitKeeper file /pogo/users/mayer/ntp-dev/ports/winnt/libntp/dnslookup.c ports/winnt/libntp/libntp.dsp@1.28 +4 -0 Bug #504 add Windows only dnslookup to dsp file ChangeSet@1.1251.85.14, 2006-05-05 00:52:13-04:00, stenn@whimsy.udel.edu NTP_4_2_1P247_RC TAG: NTP_4_2_1P247_RC packageinfo.sh@1.15 +1 -1 NTP_4_2_1P247_RC ChangeSet@1.1251.85.13, 2006-05-05 00:47:24-04:00, stenn@whimsy.udel.edu NTP_4_2_1P246_RC TAG: NTP_4_2_1P246_RC packageinfo.sh@1.14 +1 -1 NTP_4_2_1P246_RC ChangeSet@1.1251.85.12, 2006-05-05 00:42:27-04:00, stenn@whimsy.udel.edu NTP_4_2_1P245_RC TAG: NTP_4_2_1P245_RC packageinfo.sh@1.13 +1 -1 NTP_4_2_1P245_RC ChangeSet@1.1251.85.11, 2006-05-05 00:37:38-04:00, stenn@whimsy.udel.edu NTP_4_2_1P244_RC TAG: NTP_4_2_1P244_RC packageinfo.sh@1.12 +1 -1 NTP_4_2_1P244_RC ChangeSet@1.1251.85.10, 2006-05-04 22:28:16-04:00, stenn@whimsy.udel.edu Clean up/fix the force code scripts/genver@1.2 +20 -12 Clean up/fix the force code ChangeSet@1.1251.85.9, 2006-05-04 19:50:54-04:00, stenn@whimsy.udel.edu NTP_4_2_1P243_RC TAG: NTP_4_2_1P243_RC packageinfo.sh@1.11 +1 -1 NTP_4_2_1P243_RC ChangeSet@1.1251.85.8, 2006-05-04 07:03:18-04:00, stenn@whimsy.udel.edu NTP_4_2_1P242_RC TAG: NTP_4_2_1P242_RC packageinfo.sh@1.10 +1 -1 NTP_4_2_1P242_RC ChangeSet@1.1251.85.7, 2006-05-04 05:54:17-04:00, stenn@deacon.udel.edu Re-enable signaled I/O configure.ac@1.359.1.29 +2 -6 Re-enable signaled I/O ChangeSet@1.1251.86.1, 2006-05-04 05:38:51-04:00, stenn@deacon.udel.edu clean up the version generation stuff. Makefile.am@1.48.1.3 +12 -2 Deal with packageinfo.sh, version.m4, and include/version.def bootstrap@1.3 +2 -6 Use the new scripts/genver to generate the version files include/Makefile.am@1.19.1.2 +1 -1 distribute inclue/version.def scripts/Makefile.am@1.13 +2 -2 Distribute VersionName and genver. scripts/genver@1.1 +59 -0 scripts/genver@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/scripts/genver ChangeSet@1.1251.85.5, 2006-05-02 09:13:40+00:00, kardel@pogo.udel.edu ntp_crypto.c: handle NULL return from d2i_X509() - NetBSD Run 21 Coverity CID 2979 ntpd/ntp_crypto.c@1.98.1.13 +1 -1 handle NULL return from d2i_X509() - NetBSD Run 21 Coverity CID 2979 ChangeSet@1.1251.85.4, 2006-05-01 18:27:54+00:00, kardel@pogo.udel.edu refclock_parse.c: If an input buffer parses into more than one message do insert the parsed message in a new input buffer instead of processing it directly. This avoids deed complicated processing in signal handling. ntpd.c: re-instate vital io blocking protocol to insure that receive buffer queue is only manipulated when io is blocked recvbuff.c: cleanup get_full_recvbuffer() to decide only the full queue head and simplify code (remove multiple tests) libntp/recvbuff.c@1.19.1.1 +4 -11 cleanup get_full_recvbuffer() to decide only the full queue head and simplify code (remove multiple tests) ntpd/ntpd.c@1.61.5.1 +25 -12 re-instate vital io blocking protocol to insure that receive buffer queue is only manipulated when io is blocked ntpd/refclock_parse.c@1.35.1.7 +33 -18 If an input buffer parses into more than one message do insert the parsed message in a new input buffer instead of processing it directly. This avoids deed complicated processing in signal handling. ChangeSet@1.1251.85.3, 2006-04-21 00:09:43-04:00, stenn@whimsy.udel.edu NTP_4_2_1P241_RC TAG: NTP_4_2_1P241_RC packageinfo.sh@1.9 +1 -1 NTP_4_2_1P241_RC ChangeSet@1.1251.85.2, 2006-04-20 23:59:56-04:00, stenn@whimsy.udel.edu [Bug 527] Lose signalled IO. configure.ac@1.359.1.28 +7 -2 [Bug 527] Losed signalled IO. ChangeSet@1.1251.85.1, 2006-04-18 05:58:13-04:00, stenn@whimsy.udel.edu there are 240 ntp-dev patch releases so far packageinfo.sh@1.8 +1 -1 there are 240 ntp-dev patch releases so far ChangeSet@1.1251.80.37, 2006-04-15 18:33:29-04:00, mayer@pogo.udel.edu Fix Bug #596 and #572 to deal with polling restrictions libntp/recvbuff.c@1.20 +20 -18 Fix Bug #596 and #572 to deal with polling restrictions ChangeSet@1.1251.80.36, 2006-04-15 18:32:57-04:00, mayer@pogo.udel.edu Fix Bug #596 and #572 to deal with polling restrictions ntpd/ntpd.c@1.61.1.20 +3 -1 Fix Bug #596 and #572 to deal with polling restrictions ChangeSet@1.1251.80.35, 2006-04-13 04:14:26-04:00, stenn@whimsy.udel.edu Use ./packageinfo.sh as . may not be in the PATH. Reported by Frank Kardel. bootstrap@1.2 +1 -1 Use ./packageinfo.sh as . may not be in the PATH. Reported by Frank Kardel. scripts/VersionName@1.2 +2 -1 Use ./packageinfo.sh as . may not be in the PATH. Reported by Frank Kardel. ChangeSet@1.1251.80.34, 2006-04-12 06:43:08-04:00, stenn@whimsy.udel.edu fix a typo README.versions@1.4 +1 -1 fix a typo ChangeSet@1.1251.80.33, 2006-04-12 05:57:14-04:00, stenn@whimsy.udel.edu NTP_4_2_1P12_RC TAG: NTP_4_2_1P12_RC packageinfo.sh@1.7 +1 -1 NTP_4_2_1P12_RC ChangeSet@1.1251.80.32, 2006-04-12 05:27:53-04:00, stenn@whimsy.udel.edu NTP_4_2_1P11_RC TAG: NTP_4_2_1P11_RC packageinfo.sh@1.6 +1 -1 NTP_4_2_1P11_RC ChangeSet@1.1251.80.31, 2006-04-12 05:22:34-04:00, stenn@whimsy.udel.edu Update the NEWS file NEWS@1.49 +2 -1 Update the NEWS file ChangeSet@1.1251.80.30, 2006-04-12 05:14:52-04:00, stenn@whimsy.udel.edu cleanup packageinfo.sh@1.5 +1 -1 cleanup ChangeSet@1.1251.80.29, 2006-04-12 04:51:30-04:00, stenn@whimsy.udel.edu NTP_4_2_1P10_RC TAG: NTP_4_2_1P10_RC packageinfo.sh@1.4 +1 -1 NTP_4_2_1P10_RC ChangeSet@1.1251.80.28, 2006-04-12 04:44:14-04:00, stenn@whimsy.udel.edu use a reasonable value for "point". packageinfo.sh@1.3 +1 -1 use a reasonable value for "point". ChangeSet@1.1251.80.27, 2006-04-12 04:39:22-04:00, stenn@whimsy.udel.edu update packageinfo.sh@1.2 +3 -3 update ChangeSet@1.1342, 2006-04-11 18:05:00-07:00, bkorb@bach.veritas.com AutoOpt the clktest program. Move copyright, version and config file stuff into a common file. BitKeeper/etc/config@1.8 +4 -0 New license clockstuff/clktest-opts.def@1.2 +228 -0 clktest option definition file. clockstuff/clktest-opts.def@1.1 +0 -0 clockstuff/clktest-opts.def@1.0 +0 -0 BitKeeper file /home/bkorb/tools/ntp/ntp-dev-ag/clockstuff/clktest-opts.def clockstuff/clktest.c@1.3 +31 -148 Move includes to option definition file so the option code can use them, too. Move option processing to option definition file. Use AutoOpts to parse. include/copyright.def@1.2 +24 -0 version, copyright and rc file stuff for all commands. include/copyright.def@1.1 +0 -0 include/copyright.def@1.0 +0 -0 BitKeeper file /home/bkorb/tools/ntp/ntp-dev-ag/include/copyright.def ntpdc/ntpdc-opts.def@1.8 +1 -24 Move common copyright and ini file stuff to a common "copyright.def" file. ChangeSet@1.1251.84.1, 2006-04-11 04:49:33-04:00, stenn@whimsy.udel.edu release prep bootstrap@1.1 +59 -0 bootstrap@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/bootstrap packageinfo.sh@1.1 +19 -0 packageinfo.sh@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/packageinfo.sh ChangeSet@1.1251.80.25, 2006-04-09 05:25:08-04:00, stenn@whimsy.udel.edu README* updates README@1.21 +1 -1 README* updates README.bk@1.18 +3 -51 README* updates README.versions@1.3 +10 -18 README* updates ChangeSet@1.1251.80.24, 2006-04-09 05:00:52-04:00, stenn@whimsy.udel.edu New release numbering style support BitKeeper/deleted/.del-version.m4~4ef47e5fd0c38ddb@1.3.2.1 +0 -0 Delete: version.m4 BitKeeper/etc/ignore@1.35.1.1 +2 -0 added include/version.def version.m4 bootstrap@1.2 +13 -11 cleanup bootstrap@1.1 +57 -0 bootstrap@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/bootstrap packageinfo.sh@1.1 +17 -0 packageinfo.sh@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/packageinfo.sh scripts/VersionName@1.1 +29 -0 scripts/VersionName@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/scripts/VersionName ChangeSet@1.1341, 2006-04-09 00:16:18-04:00, stenn@pogo.udel.edu update packageinfo.sh@1.4 +4 -1 update ChangeSet@1.1340, 2006-04-08 22:13:54-04:00, stenn@pogo.udel.edu update packageinfo.sh@1.3 +11 -1 update ChangeSet@1.1339, 2006-04-08 22:11:27-04:00, stenn@pogo.udel.edu update bootstrap@1.9 +1 -1 update ChangeSet@1.1338, 2006-04-08 00:50:08-04:00, stenn@pogo.udel.edu Test new release numbering and snapshot method BitKeeper/etc/ignore@1.48 +2 -0 added version.m4 include/version.def packageinfo.sh@1.2 +4 -1 Test new release numbering and snapshot method ChangeSet@1.1251.80.23, 2006-04-04 03:16:32-04:00, stenn@deacon.udel.edu [Bug 588] logfile documentation problems html/miscopt.html@1.35 +5 -5 [Bug 588] logfile documentation problems ChangeSet@1.1251.80.22, 2006-04-01 05:14:27-05:00, stenn@deacon.udel.edu Ignore control characters ntpd/refclock_acts.c@1.25.1.1 +1 -1 Ignore control characters ChangeSet@1.1251.80.21, 2006-03-30 01:43:28-05:00, stenn@deacon.udel.edu [Bug 584] quiet a coverity buffer overrun ntpd/refclock_chu.c@1.37 +1 -1 [Bug 584] quiet a coverity buffer overrun ChangeSet@1.1336, 2006-03-26 06:02:05-05:00, stenn@pogo.udel.edu debug-opts.def cleanup Allow optional hostnames on the command line for ntpq and ntpdc. BitKeeper/etc/ignore@1.47 +1 -1 Fix the ignore for sntp/libopts/ BitKeeper/etc/ignore@1.46 +1 -0 added sntp/libopts ntpd/Makefile.am@1.47 +7 -7 debug-opt.def cleanup ntpdc/Makefile.am@1.29 +4 -4 debug-opts.def cleanup ntpdc/ntpdc-opts.def@1.7 +1 -0 Allow hostnames on the command-line. ntpq/Makefile.am@1.21 +4 -4 debug-opts.def cleanup ntpq/ntpq-opts.def@1.5 +3 -25 Allow hostnames on the command-line. util/Makefile.am@1.30 +4 -4 debug-opts.def cleanup ChangeSet@1.1251.80.20, 2006-03-24 00:27:03-05:00, stenn@deacon.udel.edu [Bug 571] fix a typo that prevents ntpdate from working ntpdate/ntpdate.c@1.58 +1 -1 [Bug 571] fix a typo that prevents ntpdate from working ChangeSet@1.1251.80.18, 2006-03-21 10:43:26+00:00, kardel@pogo.udel.edu ntp_restrict.c: null deref: fix another case of incomplete list handling (Coverity NetBSD Scan 8: CID 986) ntpd/ntp_restrict.c@1.17.1.4 +12 -3 null deref: fix another case of incomplete list handling (Coverity NetBSD Scan 8: CID 986) ChangeSet@1.1251.83.1, 2006-03-21 05:41:41-05:00, stenn@deacon.udel.edu [Bug 584] Fix potential buffer overrun ntpd/refclock_chu.c@1.36 +2 -2 [Bug 584] Fix potential buffer overrun ChangeSet@1.1251.82.1, 2006-03-20 05:56:32+00:00, kardel@pogo.udel.edu refclock_oncore.c, ntp_restrict.c: standardize pointer checks ntpd/ntp_restrict.c@1.17.2.1 +3 -3 standardize pointer checks ntpd/refclock_oncore.c@1.59 +2 -2 standardize pointer checks ChangeSet@1.1251.80.16, 2006-03-19 22:14:48-05:00, mayer@pogo.udel.edu Additional fixes for Coverity items ntpd/ntp_restrict.c@1.17.1.2 +2 -2 Additional fixes for Coverity items ntpdc/ntpdc.c@1.40.2.5 +4 -1 Additional fixes for Coverity items ChangeSet@1.1251.80.15, 2006-03-19 07:23:01+00:00, kardel@pogo.udel.edu refclock_datum.c: error handling: check success of open(2) - bail out early (Coverity CID 1282 NetBSD Scan 5) ntpd/refclock_datum.c@1.9 +13 -5 error handling: check success of open(2) - bail out early (Coverity CID 1282 NetBSD Scan 5) ChangeSet@1.1251.80.14, 2006-03-19 07:04:21+00:00, kardel@pogo.udel.edu ntp_restrict.c: null deref: complete linked list handling beginng condition (Coverity CID 986 NetBSD Scan 5) ntpd/ntp_restrict.c@1.17.1.1 +12 -3 null deref: complete linked list handling beginng condition (Coverity CID 986 NetBSD Scan 5) ChangeSet@1.1251.80.13, 2006-03-18 15:25:00+00:00, kardel@pogo.udel.edu ntpdc.c: mem leak: unreachable code prevented freeing of allocated memory (Coverity CID 612 NetBSD Scan 5) ntpdc/ntpdc.c@1.40.2.4 +1 -2 mem leak: unreachable code prevented freeing of allocated memory (Coverity CID 612 NetBSD Scan 5) ChangeSet@1.1251.80.12, 2006-03-18 14:33:59+00:00, kardel@pogo.udel.edu refclock_oncore.c: null deref: avoid 0 deref (Coverity CID 987 NetBSD Scan 5) ntpd/refclock_oncore.c@1.58 +1 -1 null deref: avoid 0 deref (Coverity CID 987 NetBSD Scan 5) ChangeSet@1.1251.80.11, 2006-03-18 14:20:27+00:00, kardel@pogo.udel.edu refclock_arc.c: buffer bounds: buffer full condition wrong for bounds check (Coverity CID 1508 NetBSD Scan 5) ntpd/refclock_arc.c@1.18 +1 -1 buffer bounds: buffer full condition wrong for bounds check (Coverity CID 1508 NetBSD Scan 5) ChangeSet@1.1251.80.10, 2006-03-18 14:09:32+00:00, kardel@pogo.udel.edu refclock_leitch.c: buffer bounds: correct > - >= error for bounds check (Coverity CID 1511 NetBSD Scan 5) ntpd/refclock_leitch.c@1.7 +1 -1 buffer bounds: correct > - >= error for bounds check (Coverity CID 1511 NetBSD Scan 5) ChangeSet@1.1251.80.9, 2006-03-18 14:08:59+00:00, kardel@pogo.udel.edu refclock_oncore.c: mem leakage: free old malloced buffer on errors (Coverity CID 2056 NetBSD Scan 5) ntpd/refclock_oncore.c@1.57 +6 -0 mem leakage: free old malloced buffer on errors (Coverity CID 2056 NetBSD Scan 5) ChangeSet@1.1251.80.8, 2006-03-18 09:24:46+00:00, kardel@pogo.udel.edu ntp_crypto.c: resource leak (fd/mem): fclose() streams on error (Coverity NetBSD scan CID 2055) ntpd/ntp_crypto.c@1.98.1.12 +6 -0 resource leak (fd/mem): fclose() streams on error (Coverity NetBSD scan CID 2055) ChangeSet@1.1251.80.7, 2006-03-18 08:53:22+00:00, kardel@pogo.udel.edu ntp_crypto.c: close stream when error occur (Coverity NetBSD Scan CID 2054) ntpd/ntp_crypto.c@1.98.1.11 +3 -0 close stream when error occur (Coverity NetBSD Scan CID 2054) ChangeSet@1.1251.80.6, 2006-03-18 08:01:26+00:00, kardel@pogo.udel.edu ntptime.c: resolve potential but not occurring 1-pointer deref (Coverity NetBSD scan, CID 808) util/ntptime.c@1.19 +1 -1 resolve potential but not occurring 1-pointer deref (Coverity NetBSD scan, CID 808) ChangeSet@1.1251.80.5, 2006-03-18 07:55:03+00:00, kardel@pogo.udel.edu ntptime.c: resolve bounds issue (Coverity CID 1466, NetBSD scan) util/ntptime.c@1.18 +1 -1 resolve bounds issue (Coverity CID 1466, NetBSD scan) ChangeSet@1.1251.80.4, 2006-03-18 01:11:42+00:00, kardel@pogo.udel.edu refclock_parse.c: coverity fixes found in NetBSD coverity scan ntpd/refclock_parse.c@1.35.1.6 +14 -7 coverity fixes found in NetBSD coverity scan ChangeSet@1.1251.81.1, 2006-03-17 04:22:39-05:00, stenn@deacon.udel.edu Set c_iflag=0 for RAW mode ntpd/ntp_refclock.c@1.75 +2 -0 Set c_iflag=0 for RAW mode ChangeSet@1.1251.80.2, 2006-03-16 17:55:20-05:00, mayer@pogo.udel.edu [Bug 479] Fix Memory Leak ntpd/ntp_io.c@1.187.1.8 +14 -12 Fix Bug #479 Memory Leak ChangeSet@1.1251.80.1, 2006-03-15 02:29:27-05:00, stenn@deacon.udel.edu [Bug 472] configurable driftfile write frequency html/miscopt.html@1.34 +15 -3 [Bug 472] configurable driftfile write frequency include/ntpd.h@1.82.4.5 +3 -1 [Bug 472] configurable driftfile write frequency ntpd/ntp_config.c@1.129.6.1 +10 -0 [Bug 472] configurable driftfile write frequency ntpd/ntp_timer.c@1.28.1.1 +7 -6 [Bug 472] configurable driftfile write frequency ntpd/ntp_util.c@1.36.2.1 +10 -1 [Bug 472] configurable driftfile write frequency ntpd/ntpd.c@1.61.1.19 +1 -0 [Bug 472] configurable driftfile write frequency ChangeSet@1.1251.72.34, 2006-03-15 06:37:26+00:00, kardel@pogo.udel.edu ntp_peer.c: speling fix copyright.html: obfuscate eMail address document dynamic interface handling html/copyright.html@1.34 +2 -2 obfuscate eMail address document dynamic interface handling ntpd/ntp_peer.c@1.94 +1 -1 speling fix ChangeSet@1.1251.72.33, 2006-03-14 23:09:12+00:00, kardel@pogo.udel.edu ntp_proto.c: peer.{first,last} gone ntpd/ntp_proto.c@1.244 +0 -3 peer.{first,last} gone ChangeSet@1.1333, 2006-03-14 00:51:12-05:00, stenn@pogo.udel.edu cleanup Makefile.am@1.60 +1 -1 cleanup ChangeSet@1.1251.79.2, 2006-03-05 16:34:07-05:00, stenn@deacon.udel.edu [Bug 553] QNX does not want adjtime.h ntpdate/ntpdate.c@1.57 +0 -4 [Bug 553] QNX does not want adjtime.h ChangeSet@1.1251.79.1, 2006-03-05 16:26:53-05:00, stenn@deacon.udel.edu [Bug 576] Use __adjtimex if we have it and not ntp_adjtime include/ntp_machine.h@1.22 +4 -0 [Bug 576] Use __adjtimex if we have it and not ntp_adjtime ChangeSet@1.1251.72.30, 2006-03-02 15:03:35-05:00, clemens@pogo.udel.edu Clean up on exit. ntpd/refclock_oncore.c@1.56 +6 -1 Clean up on exit. ChangeSet@1.1251.72.29, 2006-03-01 04:20:05-05:00, stenn@deacon.udel.edu AUTOMAKE_OPTIONS: We require automake 1.8 or later. Makefile.am@1.48.1.2 +1 -1 AUTOMAKE_OPTIONS: We require automake 1.8 or later. ChangeSet@1.1251.72.28, 2006-02-28 23:43:36-05:00, stenn@deacon.udel.edu RC1 for 4.2.1 TAG: ntp-dev TAG: NTP_4_2_0B_RC1 version.m4@1.3.1.1 +1 -1 RC1 for 4.2.1 ChangeSet@1.1251.78.1, 2006-02-28 09:38:25-05:00, hilbrecht@pogo.udel.edu refclock_neoclock4x.c: update driver to version 1.15 fix bug #499 and #574 BitKeeper/etc/logging_ok@1.57.5.1 +1 -0 Logging to repologs@ntp.isc.org accepted ntpd/refclock_neoclock4x.c@1.13.1.1 +16 -30 update driver to version 1.15 fix bug #499 and #574 ChangeSet@1.1251.77.3, 2006-02-25 19:18:31-05:00, clemens@pogo.udel.edu The following 5 changes were made. (1) Fixes for warnings from the curreng gcc compiler. (2) Fix for a possible segfault if restarting with a damaged shmem file. (3) Change all possible fprintf's to record_clock_stats, to get all output in the same place. (4) [Bug 541] Apply a patch by Russell J. Yount for new (and possibly old) M12+T: UTC not correct immediately after a new Almanac read. (5) Apply patch for new PPS implementation by Rodolfo Giometti . The code can now useither the old Ulrich Windl implementation, or the new one, depending on the timepps.h seen. BitKeeper/etc/logging_ok@1.57.4.1 +1 -0 Logging to repologs@ntp.isc.org accepted ntpd/refclock_oncore.c@1.55 +214 -99 The following 5 changes were made. (1) Fixes for warnings from the curreng gcc compiler. (2) Fix for a possible segfault if restarting with a damaged shmem file. (3) Change all possible fprintf's to record_clock_stats, to get all output in the same place. (4) [Bug 541] Apply a patch by Russell J. Yount for new (and possibly old) M12+T: UTC not correct immediately after a new Almanac read. (5) Apply patch for new PPS implementation by Rodolfo Giometti . The code can now useither the old Ulrich Windl implementation, or the new one, depending on the timepps.h seen. ChangeSet@1.1178.5.9, 2006-02-24 04:24:12-05:00, stenn@deacon.udel.edu mort is gone, replaced by macabre br-flock@1.4.1.2 +1 -1 mort is gone, replaced by macabre ChangeSet@1.1251.77.1, 2006-02-24 04:20:07-05:00, stenn@deacon.udel.edu Let there be fuzz. Make sure sys_precision is visible and present. libntp/systime.c@1.38 +9 -7 Let there be fuzz. Make sure sys_precision is visible and present. ntpdate/ntpdate.c@1.56 +5 -0 Let there be fuzz. Make sure sys_precision is visible and present. ntpdc/ntpdc.c@1.40.3.1 +5 -0 Let there be fuzz. Make sure sys_precision is visible and present. ntpq/ntpq.c@1.55.1.5 +5 -0 Let there be fuzz. Make sure sys_precision is visible and present. ChangeSet@1.1251.72.25, 2006-02-24 02:10:29+00:00, rayvt@pogo.udel.edu ntcdc options update ntpd/ntp_request.c@1.58.1.2 +18 -3 ntcdc options update ntpdc/ntpdc.h@1.6 +2 -1 ntcdc options update ntpdc/ntpdc_ops.c@1.38.1.2 +132 -87 ntcdc options update ChangeSet@1.1251.72.24, 2006-02-24 02:08:52+00:00, rayvt@pogo.udel.edu ntpdc options update BitKeeper/etc/logging_ok@1.57.3.1 +1 -0 Logging to repologs@ntp.isc.org accepted html/ntpdc.html@1.20.1.3 +42 -11 ntcdc options update include/ntp.h@1.120.1.7 +1 -0 ntcdc options update include/ntp_request.h@1.23.1.1 +1 -0 ntcdc options update ntpd/ntp_loopfilter.c@1.123 +18 -0 ntcdc options update ntpd/ntp_peer.c@1.84.1.2 +6 -1 ntcdc options update ntpdc/ntpdc.c@1.40.2.2 +8 -4 ntcdc options update ChangeSet@1.1251.72.23, 2006-02-22 20:01:03-05:00, stenn@deacon.udel.edu Fix a typo. libntp/systime.c@1.37 +1 -1 Fix a typo. ChangeSet@1.1251.72.22, 2006-02-22 19:58:12-05:00, stenn@deacon.udel.edu Copyright updates from Dave Mills html/copyright.html@1.33 +2 -2 Updates from Dave Mills ChangeSet@1.1251.72.21, 2006-02-17 23:50:33-05:00, stenn@deacon.udel.edu Only fuzz the time after we know sys_precision (gettimeofday only) libntp/systime.c@1.36 +10 -2 Only fuzz the time after we know sys_precision (gettimeofday only) ChangeSet@1.1251.72.20, 2006-02-15 23:21:06-05:00, mayer@pogo.udel.edu Fix next references for recvbuf ntpd/ntpsim.c@1.11.1.1 +4 -10 Fix next references for recvbuf ChangeSet@1.1251.72.18, 2006-01-31 21:40:26-05:00, stenn@deacon.udel.edu Added the new RFC4330 spec (SNTP) sntp/RFC4330.TXT@1.1 +1515 -0 sntp/RFC4330.TXT@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/RFC4330.TXT ChangeSet@1.1178.5.8, 2006-01-26 22:18:41-05:00, stenn@deacon.udel.edu Make --enable-simulator part of the flock build br-flock@1.4.1.1 +1 -1 Make --enable-simulator part of the flock build flock-build@1.30.2.1 +7 -7 Make --enable-simulator part of the flock build ChangeSet@1.1251.72.16, 2006-01-26 06:07:05+00:00, kardel@pogo.udel.edu refclock_parse.c: output errno on PPS setup failure ntpd/refclock_parse.c@1.35.1.5 +1 -1 output errno on PPS setup failure ChangeSet@1.1251.72.15, 2006-01-23 01:55:53-05:00, stenn@deacon.udel.edu configure.ac: Cleanup from Ralf Wildenhues authopt.html: typo configure.ac@1.359.1.27 +4 -0 Cleanup from Ralf Wildenhues html/authopt.html@1.39 +2 -2 typo ChangeSet@1.1328, 2006-01-23 01:20:16-05:00, stenn@pogo.udel.edu Cleanup from Ralf Wildenhues include/ntp_stdlib.h@1.24 +1 -1 const cleanup from Ralf Wildenhues include/ntpd.h@1.90 +2 -2 const cleanup from Ralf Wildenhues libntp/ntp_rfc2553.c@1.28 +1 -1 lint cleanup from Ralf Wildenhues ntpd/cmd_args.c@1.37 +15 -15 const and lint cleanup from Ralf Wildenhues ntpd/ntp_control.c@1.79.1.8 +5 -1 const and lint cleanup from Ralf Wildenhues ntpd/ntp_util.c@1.36.1.3 +3 -3 const and lint cleanup from Ralf Wildenhues ntpd/ntpd.c@1.74 +8 -8 const and lint cleanup from Ralf Wildenhues ntpd/refclock_acts.c@1.26 +1 -1 const and lint cleanup from Ralf Wildenhues ntpd/refclock_neoclock4x.c@1.14 +1 -1 const and lint cleanup from Ralf Wildenhues ntpdc/ntpdc.c@1.46 +2 -2 const cleanup from Ralf Wildenhues ntpq/ntpq.c@1.61 +2 -2 const cleanup from Ralf Wildenhues util/ntp-keygen.c@1.37 +1 -1 lint cleanup from Ralf Wildenhues ChangeSet@1.1251.72.13, 2006-01-23 00:47:20-05:00, stenn@deacon.udel.edu Fix from Dave Mills: etemp gets min(), not max() ntpd/ntp_loopfilter.c@1.122 +1 -1 Fix from Dave Mills: etemp gets min(), not max() ChangeSet@1.1251.72.12, 2006-01-23 00:09:50-05:00, stenn@pogo.udel.edu Recover eaten patches ntpd/ntpd.c@1.61.1.18 +21 -0 Recover eaten patches ChangeSet@1.1251.74.11, 2006-01-22 15:58:25+00:00, kardel@pogo.udel.edu clk_rawdcf.c: update version information libparse/clk_rawdcf.c@1.13 +6 -3 update version information ChangeSet@1.1251.74.10, 2006-01-22 15:49:38+00:00, kardel@pogo.udel.edu clk_rawdcf.c: generate reasonable time code output on invalid input libparse/clk_rawdcf.c@1.12 +2 -2 generate reasonable time code output on invalid input ChangeSet@1.1251.74.9, 2006-01-14 17:42:21-05:00, stenn@deacon.udel.edu Fixes from Dave Mills ntpd/refclock_wwv.c@1.59 +7 -4 Fixes from Dave Mills ChangeSet@1.1325, 2006-01-12 18:52:24-05:00, stenn@pogo.udel.edu get libopts.m4 from libopts/m4 Makefile.am@1.58 +1 -1 get libopts.m4 from libopts/m4 sntp/Makefile.am@1.12 +1 -1 get libopts.m4 from libopts/m4 ChangeSet@1.1324, 2006-01-12 18:23:36-05:00, stenn@pogo.udel.edu .del-libopts.m4~ebff9cfbfbe104c8: Delete: sntp/m4/libopts.m4 bootstrap: Leave libopts.m4 in sntp/ Makefile.am: Get libopts.m4 from the sntp/m4 subdir BitKeeper/deleted/.del-libopts.m4~ebff9cfbfbe104c8@1.7 +97 -88 Delete: sntp/m4/libopts.m4 Makefile.am@1.57 +1 -1 Get libopts.m4 from the sntp/m4 subdir bootstrap@1.8 +0 -1 Leave libopts.m4 in sntp/ ChangeSet@1.1323, 2006-01-12 06:00:55-05:00, stenn@pogo.udel.edu libopts.m4 is in m4/ now bootstrap@1.7 +1 -1 libopts.m4 is in m4/ now ChangeSet@1.1319.1.1, 2006-01-12 04:36:58-05:00, stenn@pogo.udel.edu bootstrap wiggles bootstrap@1.4.1.1 +3 -1 autoreconf in sntp first, and avoid -f ChangeSet@1.1251.74.8, 2006-01-10 00:43:36-05:00, stenn@deacon.udel.edu doc changes from Dave Mills html/authopt.html@1.38 +4 -4 doc changes from Dave Mills html/copyright.html@1.32 +1 -1 doc changes from Dave Mills html/miscopt.html@1.33 +2 -3 doc changes from Dave Mills ChangeSet@1.1251.74.7, 2006-01-10 00:34:58-05:00, stenn@deacon.udel.edu Fixes from Dave Mills ntpd/ntp_loopfilter.c@1.121 +72 -48 Fixes from Dave Mills ntpd/ntp_proto.c@1.232.1.16 +0 -1 Fixes from Dave Mills ChangeSet@1.1251.76.3, 2006-01-09 17:55:37-05:00, mayer@pogo.udel.edu Set multicast interface to ignore packets from self ntpd/ntp_io.c@1.187.1.7 +24 -0 Set multicast interface to ignore packets from self ChangeSet@1.1251.76.1, 2006-01-06 16:49:43-05:00, mayer@pogo.udel.edu Fix to have completion ports behave properly ports/winnt/include/ntp_iocompletionport.h@1.12 +0 -19 ports/winnt/ntpd/ntp_iocompletionport.c@1.20 +150 -115 ChangeSet@1.1320, 2005-12-30 16:09:52-08:00, bkorb@bach.veritas.com Warning patrol, mostly. Also ensure that $(top_srcdir)/version is built in those subdirectories that need it. bootstrap@1.5 +1 -1 Correct the directory where the libopts.m4 file is found include/debug-opt.def@1.2 +8 -0 The -D option requires "atoi(3C)". Ensure it is declared. Don't know if ``#ifdef __windows'' is the right guard. Someone needs to correct it.... ntpd/Makefile.am@1.46 +3 -0 The various subdirectories seem to need a rule for making ../version. Provide it by invoking ``$(MAKE) version'' in that directory. ntpd/cmd_args.c@1.36 +1 -0 Declare global variable ntpd/ntpd.c@1.72 +11 -11 Correct "const char" usage. Also, disambiguate local "ntp_optarg" from a global ntpdate/Makefile.am@1.14 +3 -0 The various subdirectories seem to need a rule for making ../version. Provide it by invoking ``$(MAKE) version'' in that directory. ntpdc/Makefile.am@1.28 +3 -0 The various subdirectories seem to need a rule for making ../version. Provide it by invoking ``$(MAKE) version'' in that directory. ntpq/Makefile.am@1.20 +3 -0 The various subdirectories seem to need a rule for making ../version. Provide it by invoking ``$(MAKE) version'' in that directory. ChangeSet@1.1251.74.6, 2005-12-30 14:50:03-05:00, stenn@pogo.udel.edu [Bug 545] Provide needed headers to test for sys/timepps.h configure.ac@1.359.1.26 +16 -2 [Bug 545] Provide needed headers to test for sys/timepps.h ChangeSet@1.1319, 2005-12-30 14:07:38-05:00, stenn@pogo.udel.edu verbose bootstrap, lose m4/libopts.m4 BitKeeper/deleted/.del-libopts.m4~9f04cbceeedbd0cf@1.10 +97 -88 Delete: m4/libopts.m4 bootstrap@1.4 +3 -2 be verbose ChangeSet@1.1318, 2005-12-29 01:38:14-05:00, stenn@pogo.udel.edu wiggles BitKeeper/deleted/.del-version.m4~4ef47e5fd0c38ddb@1.4 +0 -0 Delete: version.m4 Makefile.am@1.56 +16 -1 wiggles bootstrap@1.3 +2 -20 wiggles packageinfo.sh@1.1 +1 -0 packageinfo.sh@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/packageinfo.sh ChangeSet@1.1251.74.5, 2005-12-27 19:50:58-05:00, stenn@deacon.udel.edu [Bug 543] Leap second warning in ONCORE driver, from Luis Batanero Guerrero ntpd/refclock_oncore.c@1.54 +12 -12 [Bug 543] Leap second warning in ONCORE driver, from Luis Batanero Guerrero ChangeSet@1.1251.74.4, 2005-12-25 00:24:24-05:00, stenn@pogo.udel.edu [Bug 536] more filegen cleanup include/ntp_filegen.h@1.3 +1 -1 [Bug 536] more filegen cleanup ntpd/ntp_filegen.c@1.11 +24 -1 [Bug 536] more filegen cleanup ntpd/ntp_util.c@1.36.1.2 +6 -30 [Bug 536] more filegen cleanup ChangeSet@1.1316, 2005-12-23 13:56:31-08:00, bkorb@bach.veritas.com Extract the debug options into a separate file included by all the option files. Place the file in the "include" directory. Modify the makefiles so autogen adds that directory to its search list. BitKeeper/deleted/.del-COPYING.lgpl~a697cd34fe132e8a@1.2 +0 -0 Delete: sntp/libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.mbsd~bfae58672feaeb37@1.2 +0 -0 Delete: sntp/libopts/COPYING.mbsd BitKeeper/deleted/.del-MakeDefs.inc~5e2e772dad68df1a@1.3 +0 -0 Delete: sntp/libopts/MakeDefs.inc BitKeeper/deleted/.del-Makefile.am~6d6a227df4a598ae@1.3 +0 -0 Delete: sntp/libopts/Makefile.am BitKeeper/deleted/.del-README~e3d36052eb50258b@1.3 +0 -0 Delete: sntp/libopts/README BitKeeper/deleted/.del-autoopts.c~85fbb1bcfe1504ac@1.4 +0 -0 Delete: sntp/libopts/autoopts.c BitKeeper/deleted/.del-autoopts.h~4c10cd8f919f6342@1.5 +0 -0 Delete: sntp/libopts/autoopts.h BitKeeper/deleted/.del-boolean.c~2a088bf49e080afe@1.3 +0 -0 Delete: sntp/libopts/boolean.c BitKeeper/deleted/.del-compat.h~1cf561c3e113254d@1.7 +0 -0 Delete: sntp/libopts/compat/compat.h BitKeeper/deleted/.del-configfile.c~bd820799c8dfa50e@1.2 +0 -0 Delete: sntp/libopts/configfile.c BitKeeper/deleted/.del-cook.c~3fdbc751394ee14d@1.3 +0 -0 Delete: sntp/libopts/cook.c BitKeeper/deleted/.del-enumeration.c~e0416dead0d88f06@1.3 +0 -0 Delete: sntp/libopts/enumeration.c BitKeeper/deleted/.del-environment.c~abe99889ca57817e@1.3 +0 -0 Delete: sntp/libopts/environment.c BitKeeper/deleted/.del-genshell.c~9d621c66b4bd754@1.5 +0 -0 Delete: sntp/libopts/genshell.c BitKeeper/deleted/.del-genshell.h~f5d1af5bffb3ba@1.5 +0 -0 Delete: sntp/libopts/genshell.h BitKeeper/deleted/.del-libopts.c~f2125365b6c69db9@1.4 +0 -0 Delete: sntp/libopts/libopts.c BitKeeper/deleted/.del-libopts.m4~11b56b285499781a@1.5 +0 -0 Delete: sntp/libopts/libopts.m4 BitKeeper/deleted/.del-load.c~c55b985b7f4e79cc@1.3 +0 -0 Delete: sntp/libopts/load.c BitKeeper/deleted/.del-makeshell.c~4e0d2f7e41c164dc@1.3 +0 -0 Delete: sntp/libopts/makeshell.c BitKeeper/deleted/.del-nested.c~2ab62bdc3ff6240d@1.3 +0 -0 Delete: sntp/libopts/nested.c BitKeeper/deleted/.del-numeric.c~6f61173230495e21@1.3 +0 -0 Delete: sntp/libopts/numeric.c BitKeeper/deleted/.del-options.h~4ef9db18f2de6a59@1.4 +0 -0 Delete: sntp/libopts/autoopts/options.h BitKeeper/deleted/.del-pathfind.c~4d249636f5082615@1.2 +0 -0 Delete: sntp/libopts/compat/pathfind.c BitKeeper/deleted/.del-pgusage.c~7d50638aa3ccd579@1.3 +0 -0 Delete: sntp/libopts/pgusage.c BitKeeper/deleted/.del-proto.h~93d0676a173a4b6e@1.5 +0 -0 Delete: sntp/libopts/proto.h BitKeeper/deleted/.del-putshell.c~8fdade676545e0ad@1.3 +0 -0 Delete: sntp/libopts/putshell.c BitKeeper/deleted/.del-restore.c~2d36a183c65e46b2@1.3 +0 -0 Delete: sntp/libopts/restore.c BitKeeper/deleted/.del-save.c~1e35dba6263bdb0@1.3 +0 -0 Delete: sntp/libopts/save.c BitKeeper/deleted/.del-snprintf.c~34bb5dbb6f424fa4@1.2 +0 -0 Delete: sntp/libopts/compat/snprintf.c BitKeeper/deleted/.del-sort.c~f2dbbab8aecd13de@1.3 +0 -0 Delete: sntp/libopts/sort.c BitKeeper/deleted/.del-stack.c~66471a39d92bf493@1.3 +0 -0 Delete: sntp/libopts/stack.c BitKeeper/deleted/.del-strdup.c~1ff3ed47354b9cab@1.2 +0 -0 Delete: sntp/libopts/compat/strdup.c BitKeeper/deleted/.del-streqvcmp.c~7d82b266e654e41f@1.3 +0 -0 Delete: sntp/libopts/streqvcmp.c BitKeeper/deleted/.del-text_mmap.c~75102303341e937b@1.4 +0 -0 Delete: sntp/libopts/text_mmap.c BitKeeper/deleted/.del-tokenize.c~f26cbe6a73d13566@1.2 +0 -0 Delete: sntp/libopts/tokenize.c BitKeeper/deleted/.del-usage-txt.h~e22bfd18a5765c49@1.5 +0 -0 Delete: sntp/libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage.c~ce3b6af7dd1009cc@1.3 +0 -0 Delete: sntp/libopts/usage.c BitKeeper/deleted/.del-version.c~bf32cf48f59dabf1@1.3 +0 -0 Delete: sntp/libopts/version.c BitKeeper/etc/logging_ok@1.57.2.1 +1 -0 Logging to repologs@ntp.isc.org accepted Makefile.am@1.55 +1 -16 Move some commands out into the bootstrap script bootstrap@1.2 +12 -0 Add in the commands that were part of Makefile.am bootstrap@1.1 +61 -0 bootstrap@1.0 +0 -0 BitKeeper file /home/bkorb/tools/ntp/ntp-dev-ag/bootstrap include/debug-opt.def@1.1 +24 -0 include/debug-opt.def@1.0 +0 -0 BitKeeper file /home/bkorb/tools/ntp/ntp-dev-ag/include/debug-opt.def ntpd/Makefile.am@1.45 +7 -8 Option def files must include from the ntp/include directory. ntpd/ntpdbase-opts.def@1.2 +1 -24 Move debug options to common file. ntpdc/Makefile.am@1.27 +4 -5 Option def files must include from the ntp/include directory. ntpdc/ntpdc-opts.def@1.6 +1 -24 Move debug options to a common file. ntpq/Makefile.am@1.19 +4 -5 Option def files must include from the ntp/include directory. sntp/Makefile.am@1.11 +4 -4 Option def files must include from the ntp/include directory. util/Makefile.am@1.29 +4 -4 When building option source, be sure to look in the include file for the debug option file. util/ntp-keygen-opts.def@1.2 +3 -27 Move debug options to a common file. util/ntp-keygen.c@1.36 +8 -39 Remove some confusing #ifdef's and replace "iffsw" with "HAVE_OPT(ID_KEY)". ChangeSet@1.1251.71.10, 2005-12-20 23:14:56-05:00, stenn@pogo.udel.edu bail early from get_full_recv_buffer() if there is nothing to do. libntp/recvbuff.c@1.18 +3 -0 bail early from get_full_recv_buffer() if there is nothing to do. ChangeSet@1.1251.72.5, 2005-12-20 22:09:09-05:00, mayer@pogo.udel.edu Fix recvbuff code with missing refetch when needing more buffers libntp/recvbuff.c@1.13.1.2 +10 -5 Fix recvbuff code with missing refetch when needing more buffers ChangeSet@1.1178.5.7, 2005-12-20 22:05:18-05:00, stenn@deacon.udel.edu Send email to ntp.isc.org now BitKeeper/triggers/changelog@1.3 +1 -1 Send email to ntp.isc.org now BitKeeper/triggers/commitlogs@1.5 +2 -1 Send email to ntp.isc.org now BitKeeper/triggers/delta-changelog@1.7 +2 -2 Send email to ntp.isc.org now BitKeeper/triggers/notify@1.3 +2 -1 Send email to ntp.isc.org now BitKeeper/triggers/paranoid@1.3 +1 -1 Send email to ntp.isc.org now BitKeeper/triggers/send@1.5 +1 -1 Send email to ntp.isc.org now ChangeSet@1.1251.74.2, 2005-12-20 21:46:45-05:00, stenn@pogo.udel.edu [Bug 536] Clean up the filegen initialization ntpd/ntp_filegen.c@1.10 +2 -1 reformat comment ntpd/ntp_util.c@1.36.1.1 +36 -71 [Bug 536] Clean up the filegen initialization ChangeSet@1.1251.74.1, 2005-12-20 18:30:52-05:00, stenn@pogo.udel.edu Tolerate leap second notifications in sntp sntp/main.c@1.6 +4 -3 Tolerate leap second notifications in sntp ChangeSet@1.1251.73.4, 2005-12-20 09:26:06-05:00, mayer@pogo.udel.edu Update the way packets are processed ntpd/ntpd.c@1.61.4.1 +8 -5 Update the way packets are processed ChangeSet@1.1251.73.3, 2005-12-20 09:25:05-05:00, mayer@pogo.udel.edu Bug #527 - Fix buffer problems when under load ports/winnt/include/ntp_iocompletionport.h@1.11 +1 -6 Bug #527 - Fix buffer problems when under load ports/winnt/ntpd/ntp_iocompletionport.c@1.19 +150 -83 Bug #527 - Fix buffer problems when under load ChangeSet@1.1251.72.3, 2005-12-19 18:12:59-05:00, stenn@deacon.udel.edu leap change notification cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.120 +0 -8 leap change notification cleanup from Dave Mills ChangeSet@1.1315, 2005-12-16 03:37:46-05:00, stenn@pogo.udel.edu Use AutoOpts util/ntp-keygen.c@1.35 +46 -172 Use AutoOpts ChangeSet@1.1314, 2005-12-15 06:34:59-05:00, stenn@pogo.udel.edu AutoGen stuff m4/libopts.m4@1.9 +15 -17 AutoGen stuff ntpd/Makefile.am@1.44 +10 -10 AutoGen stuff ntpdc/Makefile.am@1.26 +5 -5 AutoGen stuff ntpq/Makefile.am@1.18 +4 -4 AutoGen stuff sntp/Makefile.am@1.10 +4 -4 AutoGen stuff sntp/libopts/compat/compat.h@1.6 +1 -1 AutoGen stuff sntp/libopts/compat/snprintf.c@1.1 +36 -0 sntp/libopts/compat/snprintf.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/compat/snprintf.c sntp/libopts/compat/strdup.c@1.1 +19 -0 sntp/libopts/compat/strdup.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/compat/strdup.c sntp/m4/libopts.m4@1.6 +15 -17 AutoGen stuff ChangeSet@1.1312, 2005-12-15 06:27:57-05:00, stenn@pogo.udel.edu ntp-keygen conversion from Bruce Korb BitKeeper/etc/ignore@1.45 +1 -0 added util/ntp-keygen.1 util/Makefile.am@1.26.1.1 +21 -4 ntp-keygen conversion from Bruce Korb util/ntp-keygen-opts.def@1.1 +263 -0 util/ntp-keygen-opts.def@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/util/ntp-keygen-opts.def ChangeSet@1.1251.71.9, 2005-12-13 05:22:27-05:00, stenn@pogo.udel.edu more full_recvbuf cleanup libntp/recvbuff.c@1.17 +2 -0 more full_recvbuf cleanup ntpd/ntpd.c@1.61.1.16 +2 -3 more full_recvbuf cleanup ChangeSet@1.1251.71.8, 2005-12-13 04:01:10-05:00, stenn@pogo.udel.edu Only call get_full_recv_buffer() if we have something ntpd/ntpd.c@1.61.1.15 +12 -8 Only call get_full_recv_buffer() if we have something ChangeSet@1.1251.73.2, 2005-12-12 23:35:01-05:00, mayer@pogo.udel.edu Fixes for buffer loss and DOS attacks ports/winnt/include/ntp_iocompletionport.h@1.10 +1 -1 Fixes for buffer loss and DOS attacks ports/winnt/ntpd/ntp_iocompletionport.c@1.18 +5 -1 Fixes for buffer loss and DOS attacks ChangeSet@1.1251.73.1, 2005-12-12 23:32:47-05:00, mayer@pogo.udel.edu Make recvbuf unlimited and add check for full buffers include/recvbuff.h@1.11 +6 -0 Make recvbuf unlimited and add check for full buffers libntp/recvbuff.c@1.13.1.1 +24 -15 Make recvbuf unlimited and add check for full buffers ChangeSet@1.1251.72.2, 2005-12-11 18:54:45-05:00, stenn@deacon.udel.edu [Bug 531]: ntpdc limitations on addserver & addpeer (Ray Van Tassle) html/ntpdc.html@1.20.1.2 +27 -5 [Bug 531]: ntpdc limitations on addserver & addpeer (Ray Van Tassle) ntpd/ntp_request.c@1.58.1.1 +23 -5 [Bug 531]: ntpdc limitations on addserver & addpeer (Ray Van Tassle) ntpdc/ntpdc.c@1.40.2.1 +15 -0 [Bug 531]: ntpdc limitations on addserver & addpeer (Ray Van Tassle) ntpdc/ntpdc.h@1.5 +2 -2 [Bug 531]: ntpdc limitations on addserver & addpeer (Ray Van Tassle) ntpdc/ntpdc_ops.c@1.38.1.1 +4 -2 [Bug 531]: ntpdc limitations on addserver & addpeer (Ray Van Tassle) ChangeSet@1.1251.71.6, 2005-12-11 17:16:25-05:00, stenn@maccarony.ntp.org diagnostic cleanup libntp/recvbuff.c@1.15 +2 -3 diagnostic cleanup ChangeSet@1.1251.71.5, 2005-12-11 17:04:21-05:00, stenn@maccarony.ntp.org recvbuf typo fix and diagnostics BitKeeper/etc/logging_ok@1.55.1.2 +1 -0 Logging to repologs@ntp.isc.org accepted libntp/recvbuff.c@1.14 +10 -2 full_recvbuf diagnostics ntpd/ntpd.c@1.61.1.14 +1 -1 Danny's typo fix for checking tot_full_recvbufs ChangeSet@1.1251.71.4, 2005-12-10 23:49:14-05:00, mayer@pogo.udel.edu revbuf rewrite libntp/recvbuff.c@1.13 +26 -11 revbuf rewrite ntpd/ntp_io.c@1.187.1.6 +48 -8 revbuf rewrite ChangeSet@1.1251.72.1, 2005-12-07 23:23:03-05:00, stenn@deacon.udel.edu cleanup from Dave Mills ntpd/refclock_irig.c@1.22 +3 -4 cleanup from Dave Mills ntpd/refclock_wwv.c@1.58 +11 -0 cleanup from Dave Mills ChangeSet@1.1251.1.178, 2005-12-05 18:36:24-05:00, stenn@pogo.udel.edu tg cleanup util/tg.c@1.3 +1 -0 tg cleanup ChangeSet@1.1251.67.29, 2005-12-05 17:37:57-05:00, stenn@deacon.udel.edu Added 'tg' util/Makefile.am@1.27 +1 -1 Added 'tg' util/tg.c@1.2 +5 -4 cleanup util/tg.c@1.1 +650 -0 util/tg.c@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/util/tg.c ChangeSet@1.1251.67.28, 2005-12-05 04:55:50-05:00, stenn@deacon.udel.edu leap second stuff from Dave Mills ntpd/ntp_loopfilter.c@1.119 +11 -11 leap second stuff from Dave Mills ntpd/refclock_wwv.c@1.57 +8 -6 leap second stuff from Dave Mills ChangeSet@1.1251.67.27, 2005-11-28 20:54:35-05:00, stenn@deacon.udel.edu WWV doc updates from Dave Mills html/drivers/driver36.html@1.27 +14 -22 WWV doc updates from Dave Mills ChangeSet@1.1251.71.3, 2005-11-27 18:35:43-05:00, mayer@pogo.udel.edu Name the timer event ports/winnt/ntpd/nt_clockstuff.c@1.19 +2 -2 Name the timer event ChangeSet@1.1251.71.2, 2005-11-27 18:33:06-05:00, mayer@pogo.udel.edu Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists include/recvbuff.h@1.10 +6 -4 Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists libntp/recvbuff.c@1.12 +48 -137 Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists ntpd/ntpd.c@1.61.1.13 +8 -35 Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists ntpd/refclock_parse.c@1.35.1.4 +0 -1 Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists ntpdate/ntpdate.c@1.55 +8 -8 Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists ntpdate/ntptimeset.c@1.13 +7 -13 Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists ports/winnt/include/transmitbuff.h@1.5 +7 -4 Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists ports/winnt/libntp/transmitbuff.c@1.6 +56 -129 Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists ports/winnt/ntpd/ntp_iocompletionport.c@1.17 +45 -21 Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists ChangeSet@1.1251.70.1, 2005-11-27 18:23:40-05:00, mayer@pogo.udel.edu Removed setting next variable in recvbuff ntpd/refclock_parse.c@1.35.2.1 +185 -222 Removed setting next variable in recvbuff ChangeSet@1.1251.67.26, 2005-11-27 17:38:02-05:00, stenn@deacon.udel.edu WWV updates from Dave Mills ntpd/refclock_wwv.c@1.56 +329 -479 WWV updates from Dave Mills ChangeSet@1.1251.67.25, 2005-11-15 04:55:14-05:00, stenn@deacon.udel.edu more tm_mon fixes from Dave Mills ntpd/ntp_loopfilter.c@1.118 +3 -2 more tm_mon fixes from Dave Mills ChangeSet@1.1251.69.1, 2005-11-09 22:13:13+00:00, kardel@pogo.udel.edu refclock_parse.c: utilize full PPS timestamp resolution from PPS API ntpd/refclock_parse.c@1.35.1.2 +23 -13 utilize full PPS timestamp resolution from PPS API ChangeSet@1.1251.67.22, 2005-11-09 00:32:54-05:00, stenn@deacon.udel.edu Documentation fixes from Dave Mills html/authopt.html@1.37 +10 -10 Documentation fixes from Dave Mills html/keygen.html@1.8 +5 -5 Documentation fixes from Dave Mills ChangeSet@1.1251.68.1, 2005-11-08 09:15:35-05:00, mayer@pogo.udel.edu bug 495 - fix for multicasting and reuseaddr got lost ntpd/ntp_io.c@1.187.1.5 +6 -2 bug 495 - fix for multicasting and reuseaddr got lost ChangeSet@1.1251.67.21, 2005-11-07 22:11:10-05:00, stenn@deacon.udel.edu [Bug 481] do not check $build paths for openssl if cross-compiling. Other $build/$host cleanup, too. configure.ac@1.359.1.25 +35 -20 [Bug 481] do not check $build paths for openssl if cross-compiling. Other $build/$host cleanup, too. ChangeSet@1.1251.67.20, 2005-11-07 03:15:55-05:00, stenn@deacon.udel.edu Fixes from Dave Mills html/authopt.html@1.36 +3 -4 Fixes from Dave Mills ntpd/ntp_config.c@1.129.4.2 +4 -4 Fixes from Dave Mills ntpd/ntp_control.c@1.79.1.7 +2 -7 Fixes from Dave Mills ntpd/ntp_crypto.c@1.98.1.10 +12 -23 Fixes from Dave Mills ntpd/ntp_refclock.c@1.74 +2 -9 Fixes from Dave Mills ntpd/refclock_atom.c@1.54 +0 -5 Fixes from Dave Mills ntpd/refclock_fg.c@1.10 +0 -3 Fixes from Dave Mills ntpd/refclock_local.c@1.15 +1 -1 Fixes from Dave Mills ntpd/refclock_wwv.c@1.55 +36 -20 Fixes from Dave Mills util/ntp-keygen.c@1.34 +2 -2 Fixes from Dave Mills ChangeSet@1.1251.67.19, 2005-11-06 17:15:15-05:00, mayer@pogo.udel.edu Fixes from Heiko and Martin for ntpdate on Windows ntpdate/ntpdate.c@1.54 +47 -6 Fixes from Heiko and Martin for ntpdate on Windows ChangeSet@1.1251.67.17, 2005-11-02 06:54:06-05:00, stenn@deacon.udel.edu Updates from Dave Mills html/authopt.html@1.35 +5 -5 Updates from Dave Mills ChangeSet@1.1251.64.4, 2005-11-01 23:40:29-05:00, mayer@pogo.udel.edu Bug fixes to support IPv6 changes for non-IPv6 capable systems include/isc/ipv6.h@1.7 +2 -2 Bug fixes to support IPv6 changes for non-IPv6 capable systems include/isc/net.h@1.8 +2 -2 Bug fixes to support IPv6 changes for non-IPv6 capable systems include/ntp_machine.h@1.21 +1 -0 Bug fixes to support IPv6 changes for non-IPv6 capable systems include/ntp_rfc2553.h@1.28 +21 -16 Bug fixes to support IPv6 changes for non-IPv6 capable systems libisc/net.c@1.7 +0 -1 Bug fixes to support IPv6 changes for non-IPv6 capable systems libisc/sockaddr.c@1.5 +2 -2 Bug fixes to support IPv6 changes for non-IPv6 capable systems libntp/ntp_rfc2553.c@1.27 +7 -1 Bug fixes to support IPv6 changes for non-IPv6 capable systems ntpdate/ntpdate.c@1.53 +41 -18 Bug fixes to support IPv6 changes for non-IPv6 capable systems ChangeSet@1.1251.67.16, 2005-10-31 05:26:54-05:00, stenn@deacon.udel.edu fixes from Dave Mills ntpd/ntp_loopfilter.c@1.117 +10 -5 MOD_NANO fixes from Dave Mills ntpd/refclock_wwv.c@1.54 +1 -1 Bump MAXFREQ from 125 to 187 PPM, from Dave Mills ChangeSet@1.1251.67.15, 2005-10-28 19:05:28-04:00, stenn@deacon.udel.edu Weed-whack NANO stuff from Dave Mills ntpd/ntp_loopfilter.c@1.116 +29 -22 Weed-whack NANO stuff from Dave Mills ChangeSet@1.1251.67.14, 2005-10-27 22:12:21-04:00, stenn@deacon.udel.edu [Bug 521] calleapwhen.c is obsolete BitKeeper/deleted/.del-calleapwhen.c~3e480692@1.3 +0 -0 Delete: libntp/calleapwhen.c include/ntp_stdlib.h@1.23 +0 -1 [Bug 521] calleapwhen.c is obsolete libntp/Makefile.am@1.37 +1 -1 [Bug 521] calleapwhen.c is obsolete ports/winnt/libntp/libntp.dsp@1.27 +0 -4 [Bug 521] calleapwhen.c is obsolete ChangeSet@1.1251.67.13, 2005-10-27 21:59:11-04:00, stenn@deacon.udel.edu More updates from Dave Mills include/ntp.h@1.120.1.6 +0 -4 More updates from Dave Mills ntpd/ntp_crypto.c@1.98.1.9 +64 -23 More updates from Dave Mills ChangeSet@1.1251.67.12, 2005-10-27 21:38:04-04:00, stenn@deacon.udel.edu [Bug 516] unprotected crypto_update() call fix from Dave Mills ntpd/ntp_proto.c@1.232.1.14 +5 -7 [Bug 516] unprotected crypto_update() call fix from Dave Mills ChangeSet@1.1251.67.11, 2005-10-25 20:15:47-04:00, stenn@deacon.udel.edu [Bug 517] Allow dynamic SSL libraries configure.ac@1.359.1.24 +3 -2 [Bug 519] Allow dynamic SSL libraries: also check /usr/sfw/{lib,include} ntpd/ntpd.c@1.61.1.12 +9 -0 [Bug 519] Allow dynamic SSL libraries: check SSLeay() for version info ChangeSet@1.1251.67.10, 2005-10-24 04:35:24-04:00, stenn@deacon.udel.edu Fixes from Dave Mills ntpd/ntp_control.c@1.79.1.6 +2 -2 More 0-11 -> 1-12 month stuff ntpd/ntp_crypto.c@1.98.1.8 +0 -5 Lose the coredumping cinfo-> tests ChangeSet@1.1251.67.9, 2005-10-23 16:43:06-04:00, stenn@deacon.udel.edu Crypto cleanup from Dave Mills include/ntp.h@1.120.1.5 +1 -1 member reorder from Dave Mills ntpd/ntp_crypto.c@1.98.1.7 +143 -157 Crypto cleanup from Dave Mills ntpd/ntp_proto.c@1.232.1.13 +0 -1 Crypto cleanup from Dave Mills ChangeSet@1.1251.64.3, 2005-10-22 23:43:31-04:00, mayer@pogo.udel.edu Bug #411 fix from Marc ntpd/ntp_intres.c@1.40.1.2 +1 -1 Bug #411 fix from Marc ChangeSet@1.1251.67.8, 2005-10-22 00:26:41-04:00, stenn@deacon.udel.edu Crypto cleanup/changes from Dave Mills include/ntp_crypto.h@1.38 +0 -1 Lose CRYPTO_FLAG_INVLD. From Dave Mills ntpd/ntp_crypto.c@1.98.1.6 +72 -58 Crypto cleanup/changes from Dave Mills ntpd/ntp_proto.c@1.232.1.12 +15 -7 Crypto cleanup/changes from Dave Mills ChangeSet@1.1251.67.7, 2005-10-21 23:39:36-04:00, stenn@deacon.udel.edu [Bug 515] ntp_set_tod() displays stale errno libntp/machines.c@1.18 +2 -0 [Bug 515] ntp_set_tod() displays stale errno ChangeSet@1.1251.67.6, 2005-10-21 23:23:52-04:00, stenn@deacon.udel.edu [Bug 512] Reintroduce -m to ntptrace. From Frederic Planchon scripts/ntptrace.in@1.5 +8 -2 [Bug 512] Reintroduce -m to ntptrace. From Frederic Planchon ChangeSet@1.1251.67.5, 2005-10-20 20:22:12-04:00, stenn@deacon.udel.edu Fixes from Dave Mills include/ntp.h@1.120.1.4 +4 -2 cleanup from Dave Mills include/ntp_crypto.h@1.37 +3 -1 cleanup from Dave Mills include/ntpd.h@1.82.4.4 +1 -1 cleanup from Dave Mills libntp/statestr.c@1.10 +2 -1 Dave Mills added "server certificate expired". ntpd/ntp_crypto.c@1.98.1.5 +71 -7 host and server certificate changes from Dave Mills ntpd/ntp_loopfilter.c@1.115 +13 -5 leap second fix plus 0-11 -> 1-12 month fix from Dave Mills ntpd/ntp_proto.c@1.232.1.11 +3 -3 test reorder from Dave Mills ChangeSet@1.1251.64.2, 2005-10-16 18:43:40-04:00, mayer@pogo.udel.edu Fixes from bug #411 Marc de la Gueronniere ntpd/ntp_intres.c@1.40.1.1 +44 -34 Fixes from bug #411 Marc de la Gueronniere ChangeSet@1.1251.67.4, 2005-10-16 03:18:13-04:00, stenn@deacon.udel.edu Fix (unused) reversed tests ntpd/ntp_intres.c@1.41 +2 -2 Fix (unused) reversed tests ChangeSet@1.1251.67.3, 2005-10-16 02:30:43-04:00, stenn@deacon.udel.edu fix quoting in ISC_PLATFORM_NEEDIN6ADDRANY test configure.ac@1.359.1.23 +1 -1 fix quoting in ISC_PLATFORM_NEEDIN6ADDRANY test ChangeSet@1.1251.67.2, 2005-10-15 23:35:54-04:00, stenn@deacon.udel.edu leap and orphan fixes from Dave Mills ntpd/ntp_proto.c@1.232.1.10 +86 -36 leap and orphan fixes from Dave Mills ChangeSet@1.1251.67.1, 2005-10-15 20:39:31-04:00, stenn@deacon.udel.edu Fixes from Dave Mills ntpd/ntp_control.c@1.79.1.5 +4 -4 hostkey->update and ctl_putfs() fixes from Dave Mills ntpd/ntp_crypto.c@1.98.1.4 +2 -3 Cleanup ntpd/ntp_loopfilter.c@1.114 +31 -11 leap second and pll_control/kern_enable fixes from Dave Mills ntpd/ntp_proto.c@1.232.1.9 +90 -41 Comment, crypto_update(), orphan, and leap second fixes from Dave Mills ChangeSet@1.1251.59.9, 2005-10-14 16:08:06-04:00, stenn@deacon.udel.edu Updates from Dave Mills ntpd/ntp_loopfilter.c@1.113 +13 -8 S_SPIK and kern_enable fixes from Dave Mills ntpd/ntp_refclock.c@1.73 +2 -2 cleanup from Dave Mills ntpd/refclock_arbiter.c@1.13 +4 -5 cleanup from Dave Mills ChangeSet@1.1251.59.8, 2005-10-14 15:52:35-04:00, stenn@deacon.udel.edu finish Frank's [] conversion to a block of code configure.ac@1.359.1.22 +1 -1 finish Frank's [] conversion to a block of code ChangeSet@1.1251.61.10, 2005-10-13 00:33:46-04:00, stenn@deacon.udel.edu documentation updates from Dave Mills html/confopt.html@1.31.1.3 +25 -35 documentation updates from Dave Mills html/gadget.html@1.1 +33 -0 html/gadget.html@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/gadget.html html/manyopt.html@1.13 +33 -26 documentation updates from Dave Mills html/release.html@1.31 +20 -9 documentation updates from Dave Mills html/scripts/links11.txt@1.2 +2 -0 documentation updates from Dave Mills ChangeSet@1.1251.61.9, 2005-10-09 23:38:00-04:00, stenn@deacon.udel.edu Fixes from Dave Mills ntpd/ntp_loopfilter.c@1.112 +1 -1 calleapwhen() change from Dave Mills ntpd/ntp_proto.c@1.232.1.8 +11 -3 crypto fixes from Dave Mills ChangeSet@1.1251.59.6, 2005-10-08 10:04:12+00:00, kardel@pogo.udel.edu dolfptoa.c: safeguard against sign extensions and other mishaps on 64 bit platforms libntp/dolfptoa.c@1.6 +11 -0 safeguard against sign extensions and other mishaps on 64 bit platforms ChangeSet@1.1251.66.2, 2005-10-08 02:28:24-04:00, stenn@deacon.udel.edu documentation fixes from Dave Mills html/authopt.html@1.34 +24 -14 documentation fixes from Dave Mills html/confopt.html@1.31.1.2 +2 -2 documentation fixes from Dave Mills html/keygen.html@1.7 +1 -1 documentation fixes from Dave Mills html/manyopt.html@1.12 +4 -3 documentation fixes from Dave Mills html/miscopt.html@1.32 +22 -5 documentation fixes from Dave Mills html/msyslog.html@1.5 +49 -54 documentation fixes from Dave Mills ChangeSet@1.1251.59.4, 2005-10-08 06:06:03+00:00, kardel@pogo.udel.edu refclock_parse.c: avoid unexpected buffer overflows due to sprintf("%f") on strange floats: replace almost all str* and *printf functions by their buffer bounded counterparts data_mbg.c, mbg_gps166.h: bounded buffer implementation dcfd.c: make dcfd.c compile on NetBSD 3.99.9 again (configure/sigvec compatibility fix) include/mbg_gps166.h@1.5.1.1 +10 -4 bounded buffer implementation libparse/data_mbg.c@1.5.1.1 +61 -49 bounded buffer implementation ntpd/refclock_parse.c@1.35.1.1 +221 -185 avoid unexpected buffer overflows due to sprintf("%f") on strange floats: replace almost all str* and *printf functions be their buffer bounded counterparts parseutil/dcfd.c@1.18 +25 -18 make dcfd.c compile on NetBSD 3.99.9 again (configure/sigvec compatibility fix) ChangeSet@1.1251.66.1, 2005-10-08 00:29:29-04:00, stenn@deacon.udel.edu orphan fixes from Dave Mills ntpd/ntp_proto.c@1.232.1.7 +11 -4 orphan fixes from Dave Mills ChangeSet@1.1251.65.1, 2005-10-05 01:38:06-07:00, murray@glypnod.example.com Add support for the HP Z3801 GPS clock. Needs 19200 buad, 7 bits, odd parity. BitKeeper/etc/logging_ok@1.54.2.1 +1 -0 Logging to repologs@ntp.isc.org accepted html/drivers/driver26.html@1.10 +12 -9 Add description of HP Z3801A include/ntp_refclock.h@1.20 +2 -1 Add LDISC_7O1 flag for 7 bit, odd parity ntpd/ntp_refclock.c@1.72 +4 -0 Add support for LDISC_7O1 flag - 7 bit, odd parity. ntpd/refclock_hpgps.c@1.7 +18 -3 Add support for HP Z3810A - 19200, 7bits, odd parity ChangeSet@1.1251.61.6, 2005-10-05 03:02:11-04:00, stenn@deacon.udel.edu orphan fixes from Dave Mills ntpd/ntp_proto.c@1.232.1.6 +18 -16 orphan fixes from Dave Mills ChangeSet@1.1251.64.1, 2005-10-04 12:22:54-04:00, mayer@pogo.udel.edu Fix extra y at beginning of file ntpd/ntp_proto.c@1.232.2.1 +1 -1 Fix extra y at beginning of file ChangeSet@1.1251.61.5, 2005-10-04 02:52:27-04:00, stenn@deacon.udel.edu fixes from Dave Mills include/ntp.h@1.120.1.3 +3 -1 fixes from Dave Mills include/ntpd.h@1.82.4.3 +0 -1 fixes from Dave Mills ntpd/ntp_control.c@1.79.1.4 +1 -1 fixes from Dave Mills ntpd/ntp_proto.c@1.232.1.5 +49 -29 fixes from Dave Mills ntpd/refclock_local.c@1.14 +2 -8 fixes from Dave Mills ChangeSet@1.1251.63.1, 2005-10-02 04:12:05-04:00, stenn@deacon.udel.edu NEWS update; orphan/revoke/expire stuff from Dave Mills NEWS@1.48 +2 -0 updated include/ntp.h@1.120.1.2 +3 -2 orphan and revoke stuff from Dave Mills include/ntp_config.h@1.37.1.2 +1 -0 orphan and revoke stuff from Dave Mills include/ntp_control.h@1.29 +2 -1 orphan and revoke stuff from Dave Mills ntpd/ntp_config.c@1.129.4.1 +5 -0 fixes, and orphan and expire stuff from Dave Mills ntpd/ntp_control.c@1.79.1.3 +50 -20 fixes, and orphan and expire stuff from Dave Mills ntpd/ntp_crypto.c@1.98.1.3 +114 -94 fixes, and orphan and expire stuff from Dave Mills ntpd/ntp_loopfilter.c@1.111 +1 -1 fixes, and orphan and expire stuff from Dave Mills ntpd/ntp_peer.c@1.84.1.1 +0 -1 fixes, and orphan and expire stuff from Dave Mills ntpd/ntp_proto.c@1.232.1.4 +200 -124 fixes, and orphan and expire stuff from Dave Mills ChangeSet@1.1251.61.3, 2005-10-01 01:02:12-04:00, mayer@pogo.udel.edu Fixes for handling IPv6 issues and getaddrinfo() include/isc/net.h@1.7 +2 -2 Fixes for handling IPv6 issues and getaddrinfo)_ libisc/net.c@1.6 +1 -0 Fixes for handling IPv6 issues and getaddrinfo)_ libntp/ntp_rfc2553.c@1.26 +124 -21 Fixes for handling IPv6 issues and getaddrinfo)_ ports/winnt/include/isc/net.h@1.6 +1 -1 Fixes for handling IPv6 issues and getaddrinfo)_ ports/winnt/libisc/net.c@1.7 +1 -1 Fixes for handling IPv6 issues and getaddrinfo)_ ChangeSet@1.1251.61.2, 2005-09-26 02:19:59-04:00, stenn@deacon.udel.edu sntp is now built by default. configure.ac@1.359.4.1 +2 -2 sntp is now built by default. flock-build@1.33 +6 -7 sntp is now built by default. ChangeSet@1.1251.60.4, 2005-09-25 12:21:08+00:00, kardel@pogo.udel.edu ntpdc_ops.c: output broadcast address information when broadcast flag is set ntp_peer.c: re-bind broad and multi cast on re-fresh ntp_io.c: re-bind interfaces on re-scans ntpd/ntp_io.c@1.211 +90 -43 re-bind interfaces on re-scans ntpd/ntp_peer.c@1.91 +18 -1 re-bind broad and multi cast on re-fresh ntpdc/ntpdc_ops.c@1.45 +10 -9 output broadcast address information when broadcast flag is set ChangeSet@1.1251.60.3, 2005-09-25 12:10:35+00:00, kardel@pogo.udel.edu refclock_parse.c: avoid unexpected buffer overflows due to sprintf("%f") on strange floats: replace almost all str* and *printf functions be their buffer bounded counterparts limit re-set rate of trimble clocks data_mbg.c: support fully bounded buffers clk_meinberg.c: cleanup buffer bounds mbg_gps166.h support fully bounded buffers include/mbg_gps166.h@1.6 +7 -4 libparse/clk_meinberg.c@1.9 +7 -4 cleanup buffer bounds libparse/data_mbg.c@1.6 +58 -49 support fully bounded buffers ntpd/refclock_parse.c@1.36 +204 -185 avoid unexpected buffer overflows due to sprintf("%f") on strange floats: replace almost all str* and *printf functions be their buffer bounded counterparts limit re-set rate of trimble clocks ChangeSet@1.1251.61.1, 2005-09-25 04:17:34-04:00, stenn@deacon.udel.edu Add missing ISC_PLATFORM_HAVESCOPEID checks. ntpd/ntp_io.c@1.187.1.4 +12 -1 Add missing ISC_PLATFORM_HAVESCOPEID checks. ChangeSet@1.1251.58.1, 2005-09-25 05:54:32+00:00, stenn@ntp1.isc.org [Bug 467] Reorder #include order to avoid linux collision BitKeeper/etc/logging_ok@1.54.1.1 +1 -0 Logging to repologs@ntp.isc.org accepted ntpd/ntp_config.c@1.129.3.4 +8 -2 [Bug 467] Reorder #include order to avoid linux collision ChangeSet@1.1251.1.153, 2005-09-24 23:18:13-04:00, stenn@deacon.udel.edu [Bug 498] Patches from Miroslaw Pabich include/adjtime.h@1.4 +0 -6 [Bug 498] Patches from Miroslaw Pabich libntp/iosignal.c@1.13 +6 -6 [Bug 498] Patches from Miroslaw Pabich ntpd/refclock_hopfser.c@1.9 +5 -3 [Bug 498] Patches from Miroslaw Pabich ntpd/refclock_neoclock4x.c@1.13 +5 -3 [Bug 498] Patches from Miroslaw Pabich ntpd/refclock_palisade.h@1.8 +2 -0 [Bug 498] Patches from Miroslaw Pabich ntpdate/ntpdate.c@1.52 +0 -4 [Bug 498] Patches from Miroslaw Pabich ChangeSet@1.1251.53.6, 2005-09-24 17:39:29-04:00, mayer@pogo.udel.edu Revamped the code in getaddrinfo libntp/ntp_rfc2553.c@1.25 +31 -37 Revamped the code in getaddrinfo ChangeSet@1.1251.56.1, 2005-09-23 19:27:51-04:00, mayer@pogo.udel.edu Refix for memory leak. Some checks were incorrect libntp/ntp_rfc2553.c@1.24 +19 -15 Refix for memory leak. Some checks were incorrect ChangeSet@1.1251.53.4, 2005-09-22 22:07:15-04:00, stenn@deacon.udel.edu [Bug 496]: Updated adjtime for QNX from Miroslaw Pabich libntp/adjtime.c@1.7 +80 -17 [Bug 496]: Updated adjtime for QNX from Miroslaw Pabich ChangeSet@1.1251.55.1, 2005-09-21 23:23:47-04:00, gunturu@pogo.udel.edu timing.c: unable settimeofday and adjtime as temporary fix until we port utmp. BitKeeper/etc/logging_ok@1.55 +1 -0 Logging to repologs@ntp.isc.org accepted sntp/timing.c@1.3 +4 -4 unable settimeofday and adjtime as temporary fix until we port utmp. ChangeSet@1.1305, 2005-09-21 00:31:27-04:00, stenn@pogo.udel.edu autoopts cleanup ntpd/ntpd.c@1.70 +2 -0 autoopts cleanup ChangeSet@1.1304, 2005-09-21 00:30:39-04:00, stenn@pogo.udel.edu libopts update sntp/libopts/compat/compat.h@1.5 +5 -4 libopts update ChangeSet@1.1303, 2005-09-21 00:28:47-04:00, stenn@pogo.udel.edu libopts upgrade sntp/libopts/autoopts.c@1.3 +9 -1 libopts upgrade sntp/libopts/autoopts.h@1.4 +1 -8 libopts upgrade sntp/libopts/autoopts/options.h@1.3 +30 -5 libopts upgrade sntp/libopts/autoopts/usage-txt.h@1.4 +1 -1 libopts upgrade sntp/libopts/compat/compat.h@1.4 +1 -1 libopts upgrade sntp/libopts/genshell.c@1.4 +1 -1 libopts upgrade sntp/libopts/genshell.h@1.4 +2 -2 libopts upgrade sntp/libopts/libopts.c@1.3 +0 -1 libopts upgrade sntp/libopts/libopts.m4@1.4 +15 -17 libopts upgrade sntp/libopts/proto.h@1.4 +1 -1 libopts upgrade ChangeSet@1.1251.53.3, 2005-09-20 23:35:55-04:00, mayer@pogo.udel.edu bug #486 and Fix memory leak and add heiko's change for hints libntp/ntp_rfc2553.c@1.23 +15 -5 bug #486 and Fix memory leak and add heiko's change for hints ChangeSet@1.1251.54.1, 2005-09-19 18:05:35-04:00, mayer@pogo.udel.edu Frank Kardel's fixes for the flags and broadcast address libisc/ifiter_getifaddrs.c@1.5 +2 -2 Frank Kardel's fixes for the flags and broadcast address libisc/ifiter_sysctl.c@1.12 +1 -1 Frank Kardel's fixes for the flags and broadcast address ChangeSet@1.1251.52.2, 2005-09-17 10:11:26+00:00, kardel@pogo.udel.edu ntp_io.c: cleanup merge fallout ntpd/ntp_io.c@1.209 +6 -5 cleanup merge fallout ChangeSet@1.1301, 2005-09-17 00:45:06-04:00, stenn@pogo.udel.edu libopts upgrade m4/libopts.m4@1.8 +36 -1 libopts upgrade sntp/Makefile.am@1.9 +1 -1 libopts upgrade sntp/libopts/Makefile.am@1.2 +1 -1 libopts upgrade sntp/libopts/autoopts.h@1.3 +1 -21 libopts upgrade sntp/libopts/autoopts/usage-txt.h@1.3 +0 -0 Change mode to -rw-r--r-- sntp/libopts/autoopts/usage-txt.h@1.2 +1 -1 libopts updates sntp/libopts/compat/compat.h@1.3 +5 -4 libopts upgrade sntp/libopts/genshell.c@1.3 +0 -0 Change mode to -rw-r--r-- sntp/libopts/genshell.c@1.2 +1 -1 libopts updates sntp/libopts/genshell.h@1.3 +0 -0 Change mode to -rw-r--r-- sntp/libopts/genshell.h@1.2 +1 -1 libopts updates sntp/libopts/libopts.c@1.2 +1 -0 libopts upgrade sntp/libopts/libopts.m4@1.3 +36 -1 libopts upgrade sntp/libopts/proto.h@1.3 +1 -10 libopts upgrade sntp/libopts/text_mmap.c@1.3 +74 -33 libopts upgrade sntp/m4/libopts.m4@1.5 +36 -1 libopts upgrade sntp/m4/libopts.m4@1.4 +0 -0 Rename: sntp/libopts.m4 -> sntp/m4/libopts.m4 sntp/sntp-opts.def@1.2 +2 -0 libopts upgrade ChangeSet@1.1251.51.6, 2005-09-17 00:34:07-04:00, stenn@deacon.udel.edu more leap stuff from Dave Mills include/ntpd.h@1.82.4.2 +1 -0 more leap stuff from Dave Mills ntpd/ntp_control.c@1.79.1.2 +1 -1 more leap stuff from Dave Mills ntpd/ntp_crypto.c@1.98.1.2 +2 -5 more leap stuff from Dave Mills ntpd/ntp_loopfilter.c@1.110 +11 -13 more leap stuff from Dave Mills ntpd/ntp_proto.c@1.232.1.3 +4 -2 more leap stuff from Dave Mills ChangeSet@1.1251.51.5, 2005-09-16 22:47:54-04:00, mayer@pogo.udel.edu Fix wildcards to return valid socket interface structure addresses - for Heiko's fix bug #450 ntpd/ntp_io.c@1.187.1.3 +10 -18 Fix wildcards to return valid socket interface structure addresses - for Heiko's fix bug #450 ChangeSet@1.1251.51.4, 2005-09-15 02:37:45-04:00, stenn@whimsy.udel.edu strip quotes from filenames in the config file. From Heiko Gerstung ntpd/ntp_config.c@1.129.3.3 +18 -0 strip quotes from filenames in the config file. From Heiko Gerstung ChangeSet@1.1251.51.3, 2005-09-15 02:26:33-04:00, stenn@whimsy.udel.edu Documentation changes from Dave Mills html/accopt.html@1.24 +66 -61 Documentation changes from Dave Mills html/assoc.html@1.21 +52 -51 Documentation changes from Dave Mills html/audio.html@1.17 +48 -47 Documentation changes from Dave Mills html/authopt.html@1.33 +139 -137 Documentation changes from Dave Mills html/clockopt.html@1.18 +61 -60 Documentation changes from Dave Mills html/confopt.html@1.31.1.1 +18 -15 Documentation changes from Dave Mills html/copyright.html@1.31 +72 -71 Documentation changes from Dave Mills html/debug.html@1.23 +119 -118 Documentation changes from Dave Mills html/drivers/driver1.html@1.15 +59 -58 Documentation changes from Dave Mills html/drivers/driver18.html@1.15 +56 -55 Documentation changes from Dave Mills html/drivers/driver20.html@1.14 +59 -65 Documentation changes from Dave Mills html/drivers/driver22.html@1.17 +47 -46 Documentation changes from Dave Mills html/drivers/driver27.html@1.14 +198 -200 Documentation changes from Dave Mills html/drivers/driver29.html@1.14 +769 -790 Documentation changes from Dave Mills html/drivers/driver3.html@1.11 +47 -47 Documentation changes from Dave Mills html/drivers/driver30.html@1.19 +77 -78 Documentation changes from Dave Mills html/drivers/driver31.html@1.2 +52 -50 Documentation changes from Dave Mills html/drivers/driver32.html@1.12 +23 -23 Documentation changes from Dave Mills html/drivers/driver33.html@1.12 +23 -23 Documentation changes from Dave Mills html/drivers/driver34.html@1.11 +44 -50 Documentation changes from Dave Mills html/drivers/driver35.html@1.14 +41 -40 Documentation changes from Dave Mills html/drivers/driver36.html@1.26 +162 -151 Documentation changes from Dave Mills html/drivers/driver37.html@1.12 +44 -43 Documentation changes from Dave Mills html/drivers/driver38.html@1.13 +124 -131 Documentation changes from Dave Mills html/drivers/driver39.html@1.13 +106 -109 Documentation changes from Dave Mills html/drivers/driver4.html@1.12 +59 -58 Documentation changes from Dave Mills html/drivers/driver40.html@1.13 +129 -138 Documentation changes from Dave Mills html/drivers/driver42.html@1.12 +23 -22 Documentation changes from Dave Mills html/drivers/driver43.html@1.10 +35 -34 Documentation changes from Dave Mills html/drivers/driver44.html@1.12 +81 -82 Documentation changes from Dave Mills html/drivers/driver6.html@1.20 +73 -72 Documentation changes from Dave Mills html/drivers/driver7.html@1.22 +207 -206 Documentation changes from Dave Mills html/drivers/driver8.html@1.18 +230 -419 Documentation changes from Dave Mills html/drivers/oncore-shmem.html@1.12 +58 -55 Documentation changes from Dave Mills html/drivers/tf582_4.html@1.2 +57 -58 Documentation changes from Dave Mills html/extern.html@1.14 +26 -25 Documentation changes from Dave Mills html/howto.html@1.18 +89 -88 Documentation changes from Dave Mills html/index.html@1.32 +1 -1 Documentation changes from Dave Mills html/kern.html@1.14 +27 -26 Documentation changes from Dave Mills html/keygen.html@1.6 +109 -105 Documentation changes from Dave Mills html/ldisc.html@1.12 +35 -34 Documentation changes from Dave Mills html/manyopt.html@1.11 +51 -50 Documentation changes from Dave Mills html/measure.html@1.11 +16 -15 Documentation changes from Dave Mills html/miscopt.html@1.31 +87 -83 Documentation changes from Dave Mills html/monopt.html@1.20 +122 -117 Documentation changes from Dave Mills html/msyslog.html@1.4 +120 -118 Documentation changes from Dave Mills html/mx4200data.html@1.11 +1069 -1068 Documentation changes from Dave Mills html/notes.html@1.17 +150 -149 Documentation changes from Dave Mills html/ntpd.html@1.36.1.1 +167 -169 Documentation changes from Dave Mills html/ntpdate.html@1.17 +63 -62 Documentation changes from Dave Mills html/ntpdc.html@1.20.1.1 +153 -152 Documentation changes from Dave Mills html/ntpdsim.html@1.4 +58 -57 Documentation changes from Dave Mills html/ntpq.html@1.27 +1 -1 Documentation changes from Dave Mills html/ntptime.html@1.15 +41 -40 Documentation changes from Dave Mills html/ntptrace.html@1.13 +37 -36 Documentation changes from Dave Mills html/parsedata.html@1.11 +77 -76 Documentation changes from Dave Mills html/parsenew.html@1.10 +50 -47 Documentation changes from Dave Mills html/pps.html@1.18 +34 -33 Documentation changes from Dave Mills html/prefer.html@1.15 +65 -64 Documentation changes from Dave Mills html/rdebug.html@1.15 +26 -25 Documentation changes from Dave Mills html/refclock.html@1.32 +89 -89 Documentation changes from Dave Mills html/release.html@1.30 +52 -50 Documentation changes from Dave Mills html/sntp.html@1.4 +50 -49 Documentation changes from Dave Mills html/tickadj.html@1.14 +36 -35 Documentation changes from Dave Mills ChangeSet@1.1251.51.2, 2005-09-15 01:59:15-04:00, stenn@whimsy.udel.edu "ident" changes from Dave Mills include/ntp_config.h@1.37.1.1 +5 -4 "ident" changes from Dave Mills include/ntp_control.h@1.28 +2 -1 "ident" changes from Dave Mills include/ntp_crypto.h@1.36 +6 -4 "ident" changes from Dave Mills include/ntpd.h@1.82.4.1 +8 -0 "ident" changes from Dave Mills ntpd/ntp_config.c@1.129.3.2 +6 -0 "ident" changes from Dave Mills ntpd/ntp_control.c@1.79.1.1 +21 -4 "ident" changes from Dave Mills ntpd/ntp_crypto.c@1.98.1.1 +57 -63 "ident" changes from Dave Mills ntpd/ntp_loopfilter.c@1.109 +41 -8 "ident" changes from Dave Mills ntpd/ntp_proto.c@1.232.1.2 +4 -8 "ident" changes from Dave Mills ntpd/refclock_wwvb.c@1.16 +1 -1 "ident" changes from Dave Mills ChangeSet@1.1298, 2005-09-11 22:43:01-04:00, stenn@pogo.udel.edu libopts updates build@1.22 +6 -0 libopts updates m4/libopts.m4@1.7 +79 -55 libopts updates ntpd/Makefile.am@1.43 +1 -1 libopts updates ntpd/ntpd-opts.def@1.2 +1 -0 libopts updates ntpd/ntpdsim-opts.def@1.2 +1 -0 libopts updates ntpdc/ntpdc-opts.def@1.5 +1 -0 libopts updates ntpq/ntpq-opts.def@1.4 +1 -0 libopts updates sntp/configure.ac@1.10 +3 -2 libopts updates sntp/libopts.m4@1.3 +79 -55 libopts updates sntp/libopts/MakeDefs.inc@1.2 +0 -5 libopts updates sntp/libopts/README@1.2 +9 -7 libopts updates sntp/libopts/autoopts.c@1.2 +1 -1 libopts updates sntp/libopts/autoopts.h@1.2 +3 -5 libopts updates sntp/libopts/autoopts/options.h@1.2 +4 -4 libopts updates sntp/libopts/boolean.c@1.2 +1 -1 libopts updates sntp/libopts/compat/compat.h@1.2 +51 -10 libopts updates sntp/libopts/cook.c@1.2 +1 -1 libopts updates sntp/libopts/enumeration.c@1.2 +1 -1 libopts updates sntp/libopts/environment.c@1.2 +1 -1 libopts updates sntp/libopts/libopts.m4@1.2 +83 -56 libopts updates sntp/libopts/load.c@1.2 +14 -10 libopts updates sntp/libopts/makeshell.c@1.2 +1 -1 libopts updates sntp/libopts/nested.c@1.2 +1 -1 libopts updates sntp/libopts/numeric.c@1.2 +1 -1 libopts updates sntp/libopts/pgusage.c@1.2 +1 -1 libopts updates sntp/libopts/proto.h@1.2 +1 -28 libopts updates sntp/libopts/putshell.c@1.2 +1 -1 libopts updates sntp/libopts/restore.c@1.2 +1 -1 libopts updates sntp/libopts/save.c@1.2 +1 -1 libopts updates sntp/libopts/sort.c@1.2 +1 -1 libopts updates sntp/libopts/stack.c@1.2 +1 -1 libopts updates sntp/libopts/streqvcmp.c@1.2 +1 -1 libopts updates sntp/libopts/text_mmap.c@1.2 +1 -1 libopts updates sntp/libopts/usage.c@1.2 +1 -1 libopts updates sntp/libopts/version.c@1.2 +1 -1 libopts updates ChangeSet@1.1251.50.1, 2005-09-06 22:16:23-04:00, mayer@pogo.udel.edu Revamped the input_handler code to separate the reading of packets from the selection process and logic ntpd/ntp_io.c@1.187.2.1 +250 -283 Revamped the input_handler code to separate the reading of packets from the selection process and logic ChangeSet@1.1251.38.40, 2005-09-06 19:34:59+00:00, kardel@pogo.udel.edu ntp_io.c: remove address family agnostic port assignment ntp_proto.c: minor debug code cleanup ntp_peer.c: only call peer_crypto_clear() when disconnecting the interface ntpd/ntp_io.c@1.207 +0 -1 remove address family agnostic port assignment ntpd/ntp_peer.c@1.90 +15 -6 only call peer_crypto_clear() when disconnecting the interface ntpd/ntp_proto.c@1.238 +6 -5 minor debug code cleanup ChangeSet@1.1251.1.142, 2005-09-04 15:32:05-05:00, stenn@poog.il.thewrittenword.com scopeid and WANT_IPV6 cleanup ntpd/ntp_io.c@1.187.1.1 +18 -6 scopeid and WANT_IPV6 cleanup ChangeSet@1.1251.49.1, 2005-09-04 06:44:18+00:00, kardel@pogo.udel.edu configure.ac: with NetBSD 3.99.8 the CTTY requirement has been lifted configure.ac@1.359.3.1 +3 -3 with NetBSD 3.99.8 the CTTY requirement has been lifted ChangeSet@1.1251.47.6, 2005-09-01 21:52:27-04:00, stenn@pogo.udel.edu net/route.h fixups configure.ac@1.359.1.19 +5 -1 net/route.h fixups ChangeSet@1.1251.47.5, 2005-09-01 05:11:00-04:00, stenn@pogo.udel.edu look for net/route.h and struct rt_msghdr configure.ac@1.359.1.18 +16 -0 look for net/route.h and struct rt_msghdr ChangeSet@1.1251.38.37, 2005-09-01 08:01:32+00:00, kardel@pogo.udel.edu ntp_proto.c: avoid double free by cleaning up peer_crypto_clear() as the clear_to_zero trick didn't work any more here and also covered up some memory leaks. ntp_crypto.c: mark possible memleak - MUST be verified ntpd/ntp_crypto.c@1.100 +3 -0 mark possible memleak - MUST be verified ntpd/ntp_proto.c@1.237 +35 -7 avoid double free by cleaning up peer_crypto_clear() as the clear_to_zero trick didn't work any more here and also covered up some memory leaks. ChangeSet@1.1178.6.1, 2005-08-31 18:35:44-04:00, stenn@pogo.udel.edu lose snavely flock-build@1.30.1.1 +2 -2 lose snavely ChangeSet@1.1251.38.36, 2005-08-31 08:05:42+00:00, kardel@pogo.udel.edu ntpdc_ops.c, layout.std, ntp_request.c, ntp_io.c, ntp_request.h, ntp.h: output interface life time in log and via ntpdc include/ntp.h@1.125 +1 -0 output interface life time in log and via ntpdc include/ntp_request.h@1.28 +1 -0 output interface life time in log and via ntpdc ntpd/ntp_io.c@1.206 +7 -2 output interface life time in log and via ntpdc ntpd/ntp_request.c@1.64 +1 -0 output interface life time in log and via ntpdc ntpdc/layout.std@1.6 +8 -7 output interface life time in log and via ntpdc ntpdc/ntpdc_ops.c@1.44 +6 -5 output interface life time in log and via ntpdc ChangeSet@1.1251.38.35, 2005-08-29 20:50:15+00:00, kardel@pogo.udel.edu ntp_peer.c: just disconnect from interface when no interface can be found ntp_io.c: rename HAS_BSD_ROUTING_SOCKET to HAS_ROUTING_SOCKET ntpd/ntp_io.c@1.205 +9 -9 rename HAS_BSD_ROUTING_SOCKET to HAS_ROUTING_SOCKET ntpd/ntp_peer.c@1.89 +1 -15 just disconnect from interface when no interface can be found ChangeSet@1.1251.38.34, 2005-08-29 11:36:25+00:00, kardel@pogo.udel.edu ntp_io.c: fix compile conditional for asyncio_readers make RTM_IFINFO also optional make RTM_IFANNOUNCE optional to compile on platforms that that have that message (Solaris) ntpd/ntp_io.c@1.204 +5 -5 fix compile conditional for asyncio_readers ntpd/ntp_io.c@1.203 +2 -0 make RTM_IFINFO also optional ntpd/ntp_io.c@1.202 +2 -0 make RTM_IFANNOUNCE optional to compile on platforms that that have that message (Solaris) ChangeSet@1.1251.38.33, 2005-08-29 10:23:15+00:00, kardel@pogo.udel.edu ntp_io.c: cleanup compilation for HAS_BSD_ROUTING_SOCKET in undefined case move on variable into corresponding conditional block ntpd/ntp_io.c@1.201 +18 -9 cleanup compilation for HAS_BSD_ROUTING_SOCKET in undefined case move on variable into corresponding conditional block ChangeSet@1.1251.38.31, 2005-08-28 15:49:21-04:00, mayer@pogo.udel.edu Remove O/S Specific macro and add conditions for SUPPORT_ASYNCIO_READER that replaced it ntpd/ntp_io.c@1.197.1.1 +6 -3 Remove O/S Specific macro and add conditions for SUPPORT_ASYNCIO_READER that replaced it ChangeSet@1.1295, 2005-08-28 04:51:03-04:00, stenn@pogo.udel.edu libopts cleanup Makefile.am@1.54 +0 -2 libopts cleanup configure.ac@1.374 +1 -1 libopts cleanup m4/libopts.m4@1.6 +8 -5 libopts cleanup sntp/Makefile.am@1.8 +0 -1 libopts cleanup sntp/libopts.m4@1.2 +8 -5 libopts cleanup ChangeSet@1.1251.48.3, 2005-08-28 08:37:28+00:00, kardel@pogo.udel.edu ntp_io.c: more enum cleanup ntpd/ntp_io.c@1.199 +1 -1 more enum cleanup ChangeSet@1.1251.48.2, 2005-08-28 07:37:24+00:00, kardel@pogo.udel.edu ntp_io.c: add FreeBSD for routing socket notification ntpd/ntp_io.c@1.198 +3 -1 add FreeBSD for routing socket notification ChangeSet@1.1251.48.1, 2005-08-28 06:43:17+00:00, kardel@pogo.udel.edu ntpd.h: typoe include/ntpd.h@1.82.1.9 +1 -1 typoe ChangeSet@1.1251.38.30, 2005-08-27 22:03:00-04:00, mayer@pogo.udel.edu Fixed mispelled function include/ntpd.h@1.82.3.1 +1 -1 Fixed mispelled function ChangeSet@1.1251.38.29, 2005-08-27 23:08:36+00:00, kardel@pogo.udel.edu add async io readers (non-refclock, non-socket input) re-factor (simplify) descriptor handling add routing socket listening for quick interface updates include/ntpd.h@1.82.1.8 +2 -0 ntpd/ntp_io.c@1.197 +354 -249 ntpd/ntp_timer.c@1.30 +7 -1 ChangeSet@1.1251.47.2, 2005-08-26 17:47:52-04:00, mayer@pogo.udel.edu add ntp_random.h to include list libntp/systime.c@1.35 +1 -0 add ntp_random.h to include list ChangeSet@1.1251.47.1, 2005-08-26 17:12:27-04:00, mayer@pogo.udel.edu Additional changes to support ntp_random include/Makefile.am@1.19.1.1 +1 -0 Additional changes to support ntp_random util/ntp-keygen.c@1.33 +1 -0 Additional changes to support ntp_random ChangeSet@1.1251.38.26, 2005-08-26 09:17:19-04:00, mayer@pogo.udel.edu Added ntp_debug.h include/Makefile.am@1.20 +2 -0 Added ntp_debug.h ChangeSet@1.1293, 2005-08-26 04:40:05-04:00, stenn@pogo.udel.edu autogen stuff BitKeeper/etc/ignore@1.44 +40 -48 Update the ignore list BitKeeper/etc/ignore@1.43 +3 -0 added ntpd/ntpd.1 ntpd/ntpdsim.1 sntp/sntp.1 BitKeeper/etc/ignore@1.42 +1 -0 added *-opts.texi BitKeeper/etc/ignore@1.41 +1 -0 added *-opts.menu BitKeeper/etc/ignore@1.40 +1 -0 added *-opts.h BitKeeper/etc/ignore@1.39 +1 -0 added *-opts.c Makefile.am@1.53 +3 -3 new libopts stuff configure.ac@1.373 +0 -1 new libopts stuff m4/libopts.m4@1.5 +1 -1 changes for 1 copy of libopts m4/libopts.m4@1.4 +147 -94 new libopts stuff ntpd/ntpd-opts.def@1.1 +42 -0 ntpd/ntpd-opts.def@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/ntpd/ntpd-opts.def ntpd/ntpdbase-opts.def@1.1 +472 -0 ntpd/ntpdbase-opts.def@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/ntpd/ntpdbase-opts.def ntpd/ntpdsim-opts.def@1.1 +43 -0 ntpd/ntpdsim-opts.def@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/ntpd/ntpdsim-opts.def sntp/libopts.m4@1.1 +418 -0 sntp/libopts.m4@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts.m4 sntp/sntp-opts.def@1.1 +388 -0 sntp/sntp-opts.def@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/sntp-opts.def ChangeSet@1.1292, 2005-08-26 04:17:32-04:00, stenn@pogo.udel.edu New sntp/libopts/ sntp/libopts/COPYING.lgpl@1.1 +502 -0 sntp/libopts/COPYING.lgpl@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/COPYING.lgpl sntp/libopts/COPYING.mbsd@1.1 +26 -0 sntp/libopts/COPYING.mbsd@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/COPYING.mbsd sntp/libopts/MakeDefs.inc@1.1 +5 -0 sntp/libopts/MakeDefs.inc@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/MakeDefs.inc sntp/libopts/Makefile.am@1.1 +19 -0 sntp/libopts/Makefile.am@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/Makefile.am sntp/libopts/README@1.1 +89 -0 sntp/libopts/README@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/README sntp/libopts/autoopts.c@1.1 +1033 -0 sntp/libopts/autoopts.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/autoopts.c sntp/libopts/autoopts.h@1.1 +350 -0 sntp/libopts/autoopts.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/autoopts.h sntp/libopts/autoopts/options.h@1.1 +864 -0 sntp/libopts/autoopts/options.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/autoopts/options.h sntp/libopts/autoopts/usage-txt.h@1.1 +479 -0 sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/autoopts/usage-txt.h sntp/libopts/boolean.c@1.1 +102 -0 sntp/libopts/boolean.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/boolean.c sntp/libopts/compat/compat.h@1.1 +249 -0 sntp/libopts/compat/compat.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/compat/compat.h sntp/libopts/compat/pathfind.c@1.1 +330 -0 sntp/libopts/compat/pathfind.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/compat/pathfind.c sntp/libopts/configfile.c@1.1 +1277 -0 sntp/libopts/configfile.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/configfile.c sntp/libopts/cook.c@1.1 +355 -0 sntp/libopts/cook.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/cook.c sntp/libopts/enumeration.c@1.1 +449 -0 sntp/libopts/enumeration.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/enumeration.c sntp/libopts/environment.c@1.1 +261 -0 sntp/libopts/environment.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/environment.c sntp/libopts/genshell.c@1.1 +300 -0 sntp/libopts/genshell.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/genshell.c sntp/libopts/genshell.h@1.1 +143 -0 sntp/libopts/genshell.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/genshell.h sntp/libopts/libopts.c@1.1 +29 -0 sntp/libopts/libopts.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/libopts.c sntp/libopts/libopts.m4@1.1 +418 -0 sntp/libopts/libopts.m4@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/libopts.m4 sntp/libopts/load.c@1.1 +516 -0 sntp/libopts/load.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/load.c sntp/libopts/makeshell.c@1.1 +1100 -0 sntp/libopts/makeshell.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/makeshell.c sntp/libopts/nested.c@1.1 +705 -0 sntp/libopts/nested.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/nested.c sntp/libopts/numeric.c@1.1 +89 -0 sntp/libopts/numeric.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/numeric.c sntp/libopts/pgusage.c@1.1 +154 -0 sntp/libopts/pgusage.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/pgusage.c sntp/libopts/proto.h@1.1 +124 -0 sntp/libopts/proto.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/proto.h sntp/libopts/putshell.c@1.1 +333 -0 sntp/libopts/putshell.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/putshell.c sntp/libopts/restore.c@1.1 +207 -0 sntp/libopts/restore.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/restore.c sntp/libopts/save.c@1.1 +499 -0 sntp/libopts/save.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/save.c sntp/libopts/sort.c@1.1 +369 -0 sntp/libopts/sort.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/sort.c sntp/libopts/stack.c@1.1 +224 -0 sntp/libopts/stack.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/stack.c sntp/libopts/streqvcmp.c@1.1 +292 -0 sntp/libopts/streqvcmp.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/streqvcmp.c sntp/libopts/text_mmap.c@1.1 +312 -0 sntp/libopts/text_mmap.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/text_mmap.c sntp/libopts/tokenize.c@1.1 +322 -0 sntp/libopts/tokenize.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/tokenize.c sntp/libopts/usage.c@1.1 +651 -0 sntp/libopts/usage.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/usage.c sntp/libopts/version.c@1.1 +177 -0 sntp/libopts/version.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/version.c ChangeSet@1.1291, 2005-08-26 04:14:47-04:00, stenn@pogo.udel.edu Remove old libopts/ BitKeeper/deleted/.del-AUTHORS~919220bd6931acb6@1.2 +0 -0 Delete: libopts/AUTHORS BitKeeper/deleted/.del-COPYING.lgpl~853519b5bad8e831@1.2 +0 -0 Delete: libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.mbsd~aff4e32ff033d919@1.2 +0 -0 Delete: libopts/COPYING.mbsd BitKeeper/deleted/.del-COPYING~8c2b7b26f1103860@1.2 +0 -0 Delete: libopts/COPYING BitKeeper/deleted/.del-ChangeLog~c979333e966b22d9@1.2 +0 -0 Delete: libopts/ChangeLog BitKeeper/deleted/.del-INSTALL~ca12b1677cba0915@1.3 +0 -0 Delete: libopts/INSTALL BitKeeper/deleted/.del-MakeDefs.inc~c24ab9f3f0dafc84@1.2 +0 -0 Delete: libopts/MakeDefs.inc BitKeeper/deleted/.del-Makefile.am~11c11bf4e04c9fef@1.2 +0 -0 Delete: libopts/libopts/Makefile.am BitKeeper/deleted/.del-Makefile.am~b09ab3b23945dc7d@1.2 +0 -0 Delete: libopts/Makefile.am BitKeeper/deleted/.del-NEWS~e38f345aacec5424@1.2 +0 -0 Delete: libopts/NEWS BitKeeper/deleted/.del-README~3d9dfae6a0b32f8f@1.2 +0 -0 Delete: libopts/README BitKeeper/deleted/.del-aclocal.m4~a95cc6b1d68ce121@1.2 +0 -0 Delete: libopts/aclocal.m4 BitKeeper/deleted/.del-autoopts.c~4dc696de338cb6ff@1.2 +0 -0 Delete: libopts/autoopts.c BitKeeper/deleted/.del-autoopts.c~7c82dc5b2088549a@1.2 +0 -0 Delete: libopts/libopts/autoopts.c BitKeeper/deleted/.del-autoopts.h~173454953926d863@1.2 +0 -0 Delete: libopts/libopts/autoopts.h BitKeeper/deleted/.del-autoopts.h~fd482d3a2757e6af@1.2 +0 -0 Delete: libopts/autoopts.h BitKeeper/deleted/.del-boolean.c~2652efe8d27b68e9@1.2 +0 -0 Delete: libopts/libopts/boolean.c BitKeeper/deleted/.del-boolean.c~9803ac347fdb027d@1.2 +0 -0 Delete: libopts/boolean.c BitKeeper/deleted/.del-bootstrap~9952937cb65f4e1f@1.2 +0 -0 Delete: libopts/bootstrap BitKeeper/deleted/.del-compat.h~cd9fa19720e0fe1c@1.2 +0 -0 Delete: libopts/compat/compat.h BitKeeper/deleted/.del-compile~f47b1af5aede22b6@1.3 +0 -0 Delete: libopts/m4/compile BitKeeper/deleted/.del-config-h.in~8d2fefd4275dba47@1.2 +0 -0 Delete: libopts/config-h.in BitKeeper/deleted/.del-config-h.in~~fc94cec5e99b4813@1.2 +0 -0 Delete: libopts/config-h.in~ BitKeeper/deleted/.del-config.guess~8473c3316e92525f@1.3 +0 -0 Delete: libopts/m4/config.guess BitKeeper/deleted/.del-config.sub~bf4f78cdfb8642b@1.3 +0 -0 Delete: libopts/m4/config.sub BitKeeper/deleted/.del-configfile.c~87486f85c5694535@1.2 +0 -0 Delete: libopts/libopts/configfile.c BitKeeper/deleted/.del-configfile.c~922a8f1381d4425f@1.2 +0 -0 Delete: libopts/configfile.c BitKeeper/deleted/.del-configure.ac~1f0f0eec3e2cb683@1.2 +0 -0 Delete: libopts/configure.ac BitKeeper/deleted/.del-configure~76f3b0b55a913ee5@1.2 +0 -0 Delete: libopts/configure BitKeeper/deleted/.del-cook.c~288d493179287c2@1.2 +0 -0 Delete: libopts/cook.c BitKeeper/deleted/.del-cook.c~513ed79970fc81b@1.2 +0 -0 Delete: libopts/libopts/cook.c BitKeeper/deleted/.del-depcomp~40528c8625c2eb1f@1.3 +0 -0 Delete: libopts/m4/depcomp BitKeeper/deleted/.del-enumeration.c~680ef3a6fda2472@1.2 +0 -0 Delete: libopts/libopts/enumeration.c BitKeeper/deleted/.del-enumeration.c~741b004a8edc0491@1.2 +0 -0 Delete: libopts/enumeration.c BitKeeper/deleted/.del-environment.c~886b51f1289ec004@1.2 +0 -0 Delete: libopts/environment.c BitKeeper/deleted/.del-environment.c~cbea5891d018489b@1.2 +0 -0 Delete: libopts/libopts/environment.c BitKeeper/deleted/.del-genshell.c~4665114445e930eb@1.2 +0 -0 Delete: libopts/libopts/genshell.c BitKeeper/deleted/.del-genshell.c~d3404cb6e62977d2@1.2 +0 -0 Delete: libopts/genshell.c BitKeeper/deleted/.del-genshell.h~4cbba4ca99e1ce0d@1.2 +0 -0 Delete: libopts/libopts/genshell.h BitKeeper/deleted/.del-genshell.h~9fcd6a369b750dc@1.2 +0 -0 Delete: libopts/genshell.h BitKeeper/deleted/.del-install-sh~5350b467a9780ac5@1.3 +0 -0 Delete: libopts/m4/install-sh BitKeeper/deleted/.del-libopts.c~322a932038fac5bb@1.2 +0 -0 Delete: libopts/libopts.c BitKeeper/deleted/.del-libopts.c~a3b1fda2ee8709ec@1.2 +0 -0 Delete: libopts/libopts/libopts.c BitKeeper/deleted/.del-libopts.m4~71eb82c61ddaa00e@1.2 +0 -0 Delete: libopts/libopts.m4 BitKeeper/deleted/.del-libopts.m4~dba275de2f39a7f7@1.2 +0 -0 Delete: libopts/m4/libopts.m4 BitKeeper/deleted/.del-load.c~7f48d00d8b58104a@1.2 +0 -0 Delete: libopts/libopts/load.c BitKeeper/deleted/.del-load.c~b61a8aee9ce882d5@1.2 +0 -0 Delete: libopts/load.c BitKeeper/deleted/.del-ltmain.sh~1c7887b5d1c077fc@1.3 +0 -0 Delete: libopts/m4/ltmain.sh BitKeeper/deleted/.del-makeshell.c~a1d60647811b3095@1.2 +0 -0 Delete: libopts/libopts/makeshell.c BitKeeper/deleted/.del-makeshell.c~f8b9cf5964d39db3@1.2 +0 -0 Delete: libopts/makeshell.c BitKeeper/deleted/.del-missing~f915814376b31ab6@1.3 +0 -0 Delete: libopts/m4/missing BitKeeper/deleted/.del-nested.c~86ef6834b872d57@1.2 +0 -0 Delete: libopts/libopts/nested.c BitKeeper/deleted/.del-nested.c~96ea01864b196d05@1.2 +0 -0 Delete: libopts/nested.c BitKeeper/deleted/.del-numeric.c~e2c152233ded2202@1.2 +0 -0 Delete: libopts/numeric.c BitKeeper/deleted/.del-numeric.c~f02f2a6d69035d0c@1.2 +0 -0 Delete: libopts/libopts/numeric.c BitKeeper/deleted/.del-options.h~7de16fb1feb01fb9@1.2 +0 -0 Delete: libopts/autoopts/options.h BitKeeper/deleted/.del-pathfind.c~4df984bf91869e5@1.2 +0 -0 Delete: libopts/compat/pathfind.c BitKeeper/deleted/.del-pgusage.c~c9ca334462225a7a@1.2 +0 -0 Delete: libopts/libopts/pgusage.c BitKeeper/deleted/.del-pgusage.c~ca33905e5c7aa1df@1.2 +0 -0 Delete: libopts/pgusage.c BitKeeper/deleted/.del-proto.h~452f423c89ac200e@1.2 +0 -0 Delete: libopts/libopts/proto.h BitKeeper/deleted/.del-proto.h~e8c7a2af94986c41@1.2 +0 -0 Delete: libopts/proto.h BitKeeper/deleted/.del-putshell.c~229e9255825c2699@1.2 +0 -0 Delete: libopts/libopts/putshell.c BitKeeper/deleted/.del-putshell.c~3f90a9637c1cb3f8@1.2 +0 -0 Delete: libopts/putshell.c BitKeeper/deleted/.del-restore.c~786e9e008c497959@1.2 +0 -0 Delete: libopts/libopts/restore.c BitKeeper/deleted/.del-restore.c~c5d1d1e9dde10cf6@1.2 +0 -0 Delete: libopts/restore.c BitKeeper/deleted/.del-save.c~16cdb7b3a7320c91@1.2 +0 -0 Delete: libopts/save.c BitKeeper/deleted/.del-save.c~9ac698c63285dcdf@1.2 +0 -0 Delete: libopts/libopts/save.c BitKeeper/deleted/.del-sort.c~437339de5156edc@1.2 +0 -0 Delete: libopts/libopts/sort.c BitKeeper/deleted/.del-sort.c~b07de2fbf0002b9e@1.2 +0 -0 Delete: libopts/sort.c BitKeeper/deleted/.del-stack.c~23d824507da8a741@1.2 +0 -0 Delete: libopts/stack.c BitKeeper/deleted/.del-stack.c~c65d211fa8d2c6d9@1.2 +0 -0 Delete: libopts/libopts/stack.c BitKeeper/deleted/.del-streqvcmp.c~2b01ea402455a9d5@1.2 +0 -0 Delete: libopts/libopts/streqvcmp.c BitKeeper/deleted/.del-streqvcmp.c~ecb35a72608d3d8c@1.2 +0 -0 Delete: libopts/streqvcmp.c BitKeeper/deleted/.del-text_mmap.c~7e8b2fb878ad6465@1.2 +0 -0 Delete: libopts/libopts/text_mmap.c BitKeeper/deleted/.del-text_mmap.c~8276cd532e35d7d@1.2 +0 -0 Delete: libopts/text_mmap.c BitKeeper/deleted/.del-tokenize.c~994b2aafabe0643a@1.2 +0 -0 Delete: libopts/tokenize.c BitKeeper/deleted/.del-tokenize.c~e1d05f5d9da9f103@1.2 +0 -0 Delete: libopts/libopts/tokenize.c BitKeeper/deleted/.del-usage-txt.h~3f152e2762854446@1.2 +0 -0 Delete: libopts/autoopts/usage-txt.h BitKeeper/deleted/.del-usage.c~35ccdb8f15358479@1.2 +0 -0 Delete: libopts/usage.c BitKeeper/deleted/.del-usage.c~7218cbdb39fe114@1.2 +0 -0 Delete: libopts/libopts/usage.c BitKeeper/deleted/.del-version.c~51a770ed71ec2abe@1.2 +0 -0 Delete: libopts/libopts/version.c BitKeeper/deleted/.del-version.c~f7d51067e17b5364@1.2 +0 -0 Delete: libopts/version.c ChangeSet@1.1251.45.17, 2005-08-25 21:01:42+00:00, kardel@pogo.udel.edu ntpdc_ops.c, ntp_request.c, ntp_peer.c, ntpd.h, ntp_request.h: remove reset pollinterval feature include/ntp_request.h@1.27 +0 -1 remove reset pollinterval feature include/ntpd.h@1.82.2.6 +0 -1 remove reset pollinterval feature ntpd/ntp_peer.c@1.82.1.6 +0 -41 remove reset pollinterval feature ntpd/ntp_request.c@1.63 +0 -107 remove reset pollinterval feature ntpdc/ntpdc_ops.c@1.43 +0 -60 remove reset pollinterval feature ChangeSet@1.1251.45.16, 2005-08-24 21:42:33+00:00, kardel@pogo.udel.edu ntp_io.c: fix interface number log output ntpd/ntp_io.c@1.196 +6 -5 fix interface number log output ChangeSet@1.1251.45.15, 2005-08-24 13:30:29+00:00, kardel@pogo.udel.edu ntp_io.c: keep others out while rebuilding the environment ntpd/ntp_io.c@1.195 +2 -2 keep others out while rebuilding the environment ChangeSet@1.1251.45.14, 2005-08-24 13:09:54+00:00, kardel@pogo.udel.edu ntp_io.c: paren missing ntpd/ntp_io.c@1.194 +1 -0 paren missing ChangeSet@1.1251.45.13, 2005-08-24 09:28:44+00:00, kardel@pogo.udel.edu layout.std: ifnum introduced ntpdc_ops.c: list ifnum and ifindex layout.std: ifnum added ntp_request.c, ntp_peer.c: re-name interface_t to struct interface - _t collides with POSIX system namespaces ntp_io.c: change interface_t to struct interface ad _t typedef pollute POSIX system name space use ifnum for interface numbers (ifindex seems often to be 0 on NetBSD) re-arrange intialization move setting of loopback interface variable out of conversion function to just before inserting the interface structure into the lists make ifindex be the original ntpd.h: change interface_t to struct interface as _t typdef pollute POSIX system name space ntp_request.h: add ifnum as interface instance generation number ntp.h: change interface_t to struct interface as _t typedef pollute POSIX system namespace add ifnum as interface instance generation number include/ntp.h@1.118.1.6 +2 -3 change interface_t to struct interface as _t typedef pollute POSIX system namespace add ifnum as interface instance generation number include/ntp_request.h@1.26 +2 -1 add ifnum as interface instance generation number include/ntpd.h@1.82.2.5 +7 -7 change interface_t to struct interface as _t typdef pollute POSIX system name space ntpd/ntp_io.c@1.193 +172 -179 change interface_t to struct interface ad _t typedef pollute POSIX system name space use ifnum for interface numbers (ifindex seems often to be 0 on NetBSD) re-arrange intialization move setting of loopback interface variable out of conversion function to just before inserting the interface structure into the lists make ifindex be the original ntpd/ntp_peer.c@1.82.1.5 +1 -1 re-name interface_t to struct interface - _t collides with POSIX system namespaces ntpd/ntp_request.c@1.62 +2 -1 re-name interface_t to struct interface - _t collides with POSIX system namespaces ntpdc/layout.std@1.5 +1 -0 ifnum introduced ntpdc/layout.std@1.4 +4 -4 ifnum added ntpdc/ntpdc_ops.c@1.42 +6 -5 list ifnum and ifindex ChangeSet@1.1251.45.12, 2005-08-24 06:24:42+00:00, kardel@pogo.udel.edu ntpdc_ops.c, ntp_request.c: support dynamic modifier support pollreset request ntpdc.c: allow first argument to be optional ntp_peer.c, ntp_config.c, ntp_config.h, ntp.h: support dynamic modifier ntpd.h: support resetting of poll interval on interface changes and manually ntp_request.h: support dynamic modifier add pollreset mode 7 request ntpdc.html, confopt.html: document "dynamic" modifier keyword for peer/server configuration html/confopt.html@1.32 +4 -2 document "dynamic" modifier keyword for peer/server configuration html/ntpdc.html@1.22 +4 -4 document "dynamic" modifier keyword for peer/server configuration include/ntp.h@1.118.1.5 +1 -0 support dynamic modifier include/ntp_config.h@1.38 +1 -0 support dynamic modifier include/ntp_request.h@1.25 +2 -0 support dynamic modifier add pollreset mode 7 request include/ntpd.h@1.82.2.4 +2 -0 support resetting of poll interval on interface changes and manually ntpd/ntp_config.c@1.129.2.4 +6 -0 support dynamic modifier ntpd/ntp_peer.c@1.82.1.4 +96 -53 support dynamic modifier ntpd/ntp_request.c@1.61 +116 -5 support dynamic modifier support pollreset request ntpdc/ntpdc.c@1.40.1.3 +1 -1 allow first argument to be optional ntpdc/ntpdc_ops.c@1.41 +62 -1 support dynamic modifier support pollreset request ChangeSet@1.1251.45.11, 2005-08-23 06:45:17+00:00, kardel@pogo.udel.edu ntp_io.c: cleanup debug output handling ntpd/ntp_io.c@1.192 +10 -5 cleanup debug output handling ChangeSet@1.1251.45.10, 2005-08-23 06:26:45+00:00, kardel@pogo.udel.edu ntp_io.c: fixed crash in debug error message ntpd/ntp_io.c@1.191 +10 -5 fixed crash in debug error message ChangeSet@1.1251.46.1, 2005-08-22 19:45:14-04:00, stenn@whimsy.udel.edu beacon stuff from Dave Mills include/ntp.h@1.118.2.1 +2 -1 beacon stuff from Dave Mills include/ntp_config.h@1.37 +1 -0 beacon stuff from Dave Mills ntpd/ntp_config.c@1.129.2.3 +9 -0 beacon stuff from Dave Mills ntpd/ntp_proto.c@1.232.1.1 +26 -9 beacon stuff from Dave Mills ChangeSet@1.1251.45.8, 2005-08-22 22:43:21+00:00, kardel@pogo.udel.edu ntp_request.c: return clean 0.0.0.0 addresses while a peer has no interface ntp_control.c: return clean 0.0.0.0 addresses while a peer has no interface ntpd.h: cleanup declarations include/ntpd.h@1.82.2.3 +1 -1 cleanup declarations ntpd/ntp_control.c@1.81 +3 -0 return clean 0.0.0.0 addresses while a peer has no interface ntpd/ntp_request.c@1.60 +2 -2 return clean 0.0.0.0 addresses while a peer has no interface ChangeSet@1.1251.45.7, 2005-08-22 21:57:08+00:00, kardel@pogo.udel.edu ntp_proto.c: don't attempt to transmit on peers that currently have not interface ntpd/ntp_proto.c@1.235 +3 -0 don't attempt to transmit on peers that currently have not interface ChangeSet@1.1251.45.6, 2005-08-22 16:19:29+00:00, kardel@pogo.udel.edu ntpdc_ops.c: cleanup output format add enable/disable output ntp_proto.c: as we are re-binding all interfaces on interface list changes a refresh on transmit is not needed ntp_peer.c: re-bind all interfaces when the interface list changes unbind interface when refclock configuration fails correct setting of a new interface for a peer ntp_io.c: re-bind all interfaces when the interface list changes ntpd/ntp_io.c@1.190 +12 -6 re-bind all interfaces when the interface list changes ntpd/ntp_peer.c@1.82.1.3 +42 -21 re-bind all interfaces when the interface list changes unbind interface when refclock configuration fails correct setting of a new interface for a peer ntpd/ntp_proto.c@1.234 +0 -14 as we are re-binding all interfaces on interface list changes a refresh on transmit is not needed ntpdc/ntpdc_ops.c@1.40 +4 -3 cleanup output format add enable/disable output ChangeSet@1.1251.45.5, 2005-08-22 12:05:51+00:00, kardel@pogo.udel.edu ntp_io.c: fix list initialization for interface->peer correct initizalization of loopback_interface global ntpd/ntp_io.c@1.189 +8 -0 fix list initialization for interface->peer correct initizalization of loopback_interface global ChangeSet@1.1251.45.4, 2005-08-21 19:22:34+00:00, kardel@pogo.udel.edu ntpdc_ops.c: add ifstats and ifreload commands layout.std: update with data structure used with ntpdc's ifstats and ifreload commands ntp_debug.h: new file ntpd.h: add support for dynamic interface updates ntp_request.h: define data structure needed for ntpdc's ifstats and ifreload command ntp.h: integrate dynamic interface update support ntp_util.c: prepare for exit logging - not active yet ntp_timer.c: add timeout routine to periodically update ntpd's interface list ntp_restrict.c: support forcefully removing an interface entry (dynamic interface update support) ntp_request.c: add ifstats and ifreload backend implementation ntp_proto.c: cope with peeers that have no interface ntp_peer.c: rework peer management to cope with dynamic interface list updates ntp_monitor.c: remove monitor information when an interface is removed ntp_io.c: rework to support dynamic interface updating array inter_list[] is gone reduce #ifdef DEBUG section with DPRINTF macro ntp_crypto.c, ntp_control.c: cope with peers having no current interface cmd_args.c: add "-U interface_update_interval" option ntpdc.html: document ifstats and ifreload commands ntpd.html: document dynamic interface update interval option (-U ) html/ntpd.html@1.37 +3 -1 document dynamic interface update interval option (-U ) html/ntpdc.html@1.21 +4 -0 document ifstats and ifreload commands include/ntp.h@1.118.1.3 +19 -10 integrate dynamic interface update support include/ntp_debug.h@1.1 +26 -0 include/ntp_debug.h@1.0 +0 -0 BitKeeper file /pogo/users/kardel/ntp-dev/include/ntp_debug.h include/ntp_request.h@1.24 +38 -0 define data structure needed for ntpdc's ifstats and ifreload command include/ntpd.h@1.82.2.2 +21 -7 add support for dynamic interface updates ntpd/cmd_args.c@1.34.1.1 +21 -2 add "-U interface_update_interval" option ntpd/ntp_control.c@1.80 +4 -2 cope with peers having no current interface ntpd/ntp_crypto.c@1.97.1.1 +6 -0 cope with peers having no current interface ntpd/ntp_io.c@1.188 +885 -557 rework to support dynamic interface updating array inter_list[] is gone reduce #ifdef DEBUG section with DPRINTF macro ntpd/ntp_monitor.c@1.15.1.1 +18 -0 remove monitor information when an interface is removed ntpd/ntp_peer.c@1.82.1.2 +159 -40 rework peer management to cope with dynamic interface list updates ntpd/ntp_proto.c@1.233 +117 -92 cope with peeers that have no interface ntpd/ntp_request.c@1.59 +145 -32 add ifstats and ifreload backend implementation ntpd/ntp_restrict.c@1.18 +4 -2 support forcefully removing an interface entry (dynamic interface update support) ntpd/ntp_timer.c@1.29 +16 -0 add timeout routine to periodically update ntpd's interface list ntpd/ntp_util.c@1.37 +15 -3 prepare for exit logging - not active yet ntpdc/layout.std@1.3 +19 -0 update with data structure used with ntpdc's ifstats and ifreload commands ntpdc/ntpdc_ops.c@1.39 +125 -0 add ifstats and ifreload commands ChangeSet@1.1251.45.3, 2005-08-16 20:49:01-04:00, stenn@whimsy.udel.edu preempt stuff from Dave Mills include/ntp.h@1.118.1.2 +1 -2 preempt stuff from Dave Mills ntpd/ntp_proto.c@1.232 +34 -45 preempt stuff from Dave Mills ChangeSet@1.1251.45.2, 2005-08-16 05:34:28-04:00, stenn@whimsy.udel.edu [Bug 478] use "end" keyword to stop config file processing include/ntp_config.h@1.36 +2 -1 [Bug 478] use "end" keyword to stop config file processing ntpd/ntp_config.c@1.129.2.2 +9 -0 [Bug 478] use "end" keyword to stop config file processing ChangeSet@1.1251.45.1, 2005-08-16 02:49:46-04:00, stenn@whimsy.udel.edu preempt stuff from Dave Mills include/ntp.h@1.118.1.1 +6 -5 preempt stuff from Dave Mills include/ntp_config.h@1.35 +1 -1 preempt stuff from Dave Mills include/ntpd.h@1.82.2.1 +0 -1 preempt stuff from Dave Mills ntpd/ntp_config.c@1.129.2.1 +3 -3 preempt stuff from Dave Mills ntpd/ntp_peer.c@1.82.1.1 +5 -32 preempt stuff from Dave Mills ntpd/ntp_proto.c@1.231 +69 -70 preempt stuff from Dave Mills ChangeSet@1.1251.44.1, 2005-08-15 19:41:00-04:00, mayer@pogo.udel.edu Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place include/ntp.h@1.119 +1 -0 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place include/ntp_random.h@1.1 +14 -0 include/ntp_random.h@1.0 +0 -0 BitKeeper file /pogo/users/mayer/ntp-dev/include/ntp_random.h include/ntpd.h@1.82.1.2 +0 -7 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place libntp/Makefile.am@1.36 +1 -1 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place libntp/ntp_random.c@1.5 +5 -2 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place libntp/ntp_random.c@1.4 +0 -0 Rename: libntp/random.c -> libntp/ntp_random.c ntpd/ntp_config.c@1.129.1.2 +1 -0 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place ntpd/ntp_crypto.c@1.98 +1 -0 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place ntpd/ntp_monitor.c@1.16 +1 -0 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place ntpd/ntp_peer.c@1.83 +1 -0 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place ntpd/ntpd.c@1.61.3.1 +1 -0 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place ports/winnt/include/config.h@1.40 +1 -0 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place ports/winnt/libntp/libntp.dsp@1.26 +8 -20 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place ports/winnt/ntp-keygen/ntpkeygen.dsp@1.9 +4 -0 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place ports/winnt/ntpd/ntpd.dsp@1.26 +5 -1 Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place ChangeSet@1.1178.5.6, 2005-08-15 04:01:26-04:00, stenn@whimsy.udel.edu [Bug 477] Linux needs larger RLIM_MEMLOCK, from Cristoph Gysin ntpd/ntpd.c@1.54.1.1 +12 -0 [Bug 477] Linux needs larger RLIM_MEMLOCK, from Cristoph Gysin ChangeSet@1.1288, 2005-08-15 01:27:24-04:00, stenn@pogo.udel.edu Merge pogo.udel.edu:/pogo/users/stenn/ntp-dev-ag into pogo.udel.edu:/pogo/users/stenn/ntp-dev-ag+ [no longer a merge: surgery done] ChangeSet@1.1287, 2005-08-13 22:08:44-04:00, stenn@pogo.udel.edu add to gone file BitKeeper/etc/gone@1.7 +1 -0 ChangeSet@1.1251.38.16, 2005-08-12 04:45:21-04:00, stenn@whimsy.udel.edu preempt stuff from Dave Mills include/ntpd.h@1.82.1.1 +2 -2 preempt stuff from Dave Mills ntpd/ntp_peer.c@1.82 +10 -6 preempt stuff from Dave Mills ntpd/ntp_proto.c@1.230 +18 -17 preempt stuff from Dave Mills ChangeSet@1.1251.38.15, 2005-08-12 04:39:52-04:00, stenn@whimsy.udel.edu typo ntpdate/Makefile.am@1.13 +1 -1 typo ChangeSet@1.1251.38.14, 2005-08-10 10:13:26+00:00, kardel@pogo.udel.edu dcfd.c: output revision information parseutil/dcfd.c@1.17 +8 -3 output revision information ChangeSet@1.1251.38.12, 2005-08-10 06:50:23+00:00, kardel@pogo.udel.edu dcfd.c: cleanup warnings fix setting of baud rate parseutil/dcfd.c@1.16 +14 -4 cleanup warnings fix setting of baud rate ChangeSet@1.1251.42.9, 2005-08-09 17:02:19-04:00, stenn@whimsy.udel.edu cleanup, added "preempt" and "maxclock". From Dave Mills. include/ntp.h@1.118 +19 -16 cleanup, added "preempt". From Dave Mills. include/ntp_config.h@1.34 +9 -7 cleanup, added "preempt". From Dave Mills. ntpd/ntp_config.c@1.129.1.1 +11 -0 cleanup, added "preempt" and "maxclock". From Dave Mills. ntpd/ntp_peer.c@1.81 +6 -8 cleanup, added "preempt" and "maxclock". From Dave Mills. ntpd/ntp_proto.c@1.229 +102 -130 cleanup, added "preempt" and "maxclock". From Dave Mills. ChangeSet@1.1285, 2005-08-08 02:53:55-04:00, stenn@pogo.udel.edu autogen update and more conversion include/ntpd.h@1.78.2.1 +0 -1 autogen update and more conversion libopts/INSTALL@1.2 +8 -3 autogen update and more conversion libopts/m4/compile@1.2 +4 -4 autogen update and more conversion libopts/m4/config.guess@1.2 +234 -270 autogen update and more conversion libopts/m4/config.sub@1.2 +13 -17 autogen update and more conversion libopts/m4/depcomp@1.2 +30 -23 autogen update and more conversion libopts/m4/install-sh@1.2 +3 -3 autogen update and more conversion libopts/m4/ltmain.sh@1.2 +124 -222 autogen update and more conversion libopts/m4/missing@1.2 +10 -6 autogen update and more conversion ntpd/Makefile.am@1.42 +37 -6 autogen update and more conversion ntpd/cmd_args.c@1.35 +169 -216 autogen update and more conversion ntpd/ntp_config.c@1.128.1.1 +1 -3 autogen update and more conversion ntpd/ntpd.c@1.66 +129 -31 autogen update and more conversion ntpd/ntpsim.c@1.9.1.1 +9 -0 autogen update and more conversion ntpdc/ntpdc-opts.def@1.4 +3 -3 autogen update and more conversion ntpq/ntpq-opts.def@1.3 +25 -21 autogen update and more conversion sntp/Makefile.am@1.7 +28 -0 autogen update and more conversion sntp/configure.ac@1.9 +13 -6 autogen update and more conversion ChangeSet@1.1251.42.8, 2005-08-07 18:12:45-04:00, mayer@pogo.udel.edu Fix check for errors when recvfrom() is used ntpd/ntp_io.c@1.187 +4 -5 Fix check for errors when recvfrom() is used ChangeSet@1.1251.38.11, 2005-08-07 15:10:14+00:00, kardel@pogo.udel.edu testdcf.c: cleanup warnings document revision on startup fix setting of baud rate refclock_parse.c, parse.c: cleanup size handling wrt/ to buffer boundaries clk_rawdcf.c: clean log output cleanup size handling wrt/ to buffer boundaries libparse/clk_rawdcf.c@1.11 +44 -36 clean log output cleanup size handling wrt/ to buffer boundaries libparse/parse.c@1.11 +8 -5 cleanup size handling wrt/ to buffer boundaries ntpd/refclock_parse.c@1.35 +7 -4 cleanup size handling wrt/ to buffer boundaries parseutil/testdcf.c@1.7 +24 -7 cleanup warnings document revision on startup fix setting of baud rate ChangeSet@1.1251.42.7, 2005-08-05 19:29:48-04:00, mayer@pogo.udel.edu Fix for systems that do not support MCAST ntpd/ntp_io.c@1.186 +2 -34 Fix for systems that do not support MCAST ChangeSet@1.1251.42.6, 2005-08-02 23:04:57-04:00, stenn@whimsy.udel.edu Lose UDP_WILDCARD_DELIVERY TODO@1.8 +0 -2 Lose UDP_WILDCARD_DELIVERY configure.ac@1.359.1.17 +0 -60 Lose UDP_WILDCARD_DELIVERY include/ntp_machine.h@1.20 +0 -5 Lose UDP_WILDCARD_DELIVERY ports/winnt/include/config.h@1.39 +0 -1 Lose UDP_WILDCARD_DELIVERY ChangeSet@1.1251.42.5, 2005-08-02 21:48:09-04:00, stenn@whimsy.udel.edu Another RANDOM -> ntp_random() libntp/systime.c@1.34 +2 -1 Another RANDOM -> ntp_random() ChangeSet@1.1251.42.4, 2005-08-02 20:19:27-04:00, stenn@whimsy.udel.edu libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. BitKeeper/deleted/.del-ranny.c~3e480692@1.4 +0 -0 Delete: libntp/ranny.c configure.ac@1.359.1.16 +1 -11 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. include/l_stdlib.h@1.15 +0 -13 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. include/ntp.h@1.117 +1 -9 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. include/ntp_machine.h@1.19 +0 -2 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. include/ntpd.h@1.82 +3 -0 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. libntp/Makefile.am@1.35 +2 -2 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. libntp/random.c@1.3 +9 -9 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. ntpd/ntp_config.c@1.129 +1 -1 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. ntpd/ntp_crypto.c@1.97 +1 -1 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. ntpd/ntp_monitor.c@1.15 +2 -1 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. ntpd/ntp_peer.c@1.80 +1 -1 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. ntpd/ntp_proto.c@1.228 +1 -1 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. ntpd/ntpd.c@1.61.1.9 +1 -1 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. ntpd/ntpsim.c@1.11 +1 -1 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. util/Makefile.am@1.26 +1 -1 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. util/ntp-keygen.c@1.32 +2 -2 libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM. ChangeSet@1.1251.43.3, 2005-08-02 03:45:25-04:00, stenn@whimsy.udel.edu Make it easy to distinguish -stable and -dev snapshots version.m4@1.3 +1 -1 Make it easy to distinguish -stable and -dev snapshots ChangeSet@1.1251.43.2, 2005-08-02 03:25:30-04:00, stenn@whimsy.udel.edu Lose libntp/ranny.c include/ntp_stdlib.h@1.22 +0 -1 Lose libntp/ranny.c libntp/Makefile.am@1.34 +1 -1 Lose libntp/ranny.c libntp/systime.c@1.33 +3 -1 Lose libntp/ranny.c ntpd/ntp_peer.c@1.76.1.2 +1 -3 Lose libntp/ranny.c ntpd/ntpd.c@1.61.1.8 +0 -1 Lose libntp/ranny.c ntpd/ntpsim.c@1.10 +0 -1 Lose libntp/ranny.c ChangeSet@1.1251.43.1, 2005-08-01 19:40:14-04:00, stenn@whimsy.udel.edu Dave Mills: change findpeer(), other cleanup include/ntpd.h@1.79.1.1 +1 -1 Dave Mills: change findpeer() ntpd/ntp_peer.c@1.76.1.1 +0 -4 Dave Mills: change findpeer() ntpd/ntp_proto.c@1.227 +4 -4 Dave Mills: change findpeer(), other cleanup ChangeSet@1.1251.41.2, 2005-08-01 12:36:38-04:00, mayer@pogo.udel.edu Missing break in switch selection ports/winnt/ntpd/ntp_iocompletionport.c@1.16 +1 -48 Missing break in switch selection ChangeSet@1.1251.41.1, 2005-08-01 12:34:24-04:00, mayer@pogo.udel.edu Enable IPv6 multicast interface include/ntpd.h@1.78.1.1 +1 -0 Enable IPv6 multicast interface ntpd/ntp_io.c@1.185 +61 -2 Enable IPv6 multicast interface ntpd/ntp_peer.c@1.77 +14 -3 Enable IPv6 multicast interface ChangeSet@1.1251.40.1, 2005-07-27 21:25:59+00:00, kardel@pogo.udel.edu refclock_parse.c: fix a long (> 11 years) misconfiguration wrt/ Meinberg cflag factory default setup. CSTOPB was missing for the 7E2 default data format of the DCF77 clocks. ntpd/refclock_parse.c@1.34 +9 -4 fix a long (> 11 years) misconfiguration wrt/ Meinberg cflag factory default setup. CSTOPB was missing for the 7E2 default data format of the DCF77 clocks. ChangeSet@1.1251.38.7, 2005-07-25 12:46:00-04:00, mayer@pogo.udel.edu Always provide the addr_ismulticast function ntpd/ntp_io.c@1.184 +1 -1 Always provide the addr_ismulticast function ChangeSet@1.1251.38.6, 2005-07-24 16:41:43-04:00, mayer@pogo.udel.edu Fix isaddr_multicast to not be dependent on whether or not MCAST is supported ntpd/ntp_io.c@1.183 +5 -5 Fix isaddr_multicast to not be dependent on whether or not MCAST is supported ChangeSet@1.1251.38.5, 2005-07-24 15:50:24-04:00, mayer@pogo.udel.edu Revamp of I/O Completion ports for Windows include/recvbuff.h@1.9 +0 -2 Revamp of I/O Completion ports for Windows libntp/recvbuff.c@1.11 +22 -17 Revamp of I/O Completion ports for Windows ports/winnt/include/ntp_iocompletionport.h@1.9 +16 -3 Revamp of I/O Completion ports for Windows ports/winnt/include/transmitbuff.h@1.4 +4 -14 Revamp of I/O Completion ports for Windows ports/winnt/libntp/transmitbuff.c@1.5 +113 -43 Revamp of I/O Completion ports for Windows ports/winnt/ntpd/nt_clockstuff.c@1.18 +1 -1 Revamp of I/O Completion ports for Windows ports/winnt/ntpd/ntp_iocompletionport.c@1.15 +182 -61 Revamp of I/O Completion ports for Windows ChangeSet@1.1251.39.4, 2005-07-22 20:32:47-04:00, stenn@pogo.udel.edu Remove binio.c,gpstolfp.c,ieee754io.c,mfp_mul.c from libntp.a libntp/Makefile.am@1.33 +4 -4 Remove binio.c,gpstolfp.c,ieee754io.c,mfp_mul.c from libntp.a ChangeSet@1.1251.39.3, 2005-07-21 19:43:37+00:00, kardel@pogo.udel.edu Makefile.am: support is gone - overaged files .del-sun4.sun4m~3e480692: Delete: scripts/support/conf/sun4.sun4m .del-sun4.sun4m.faui45m~3e480692: Delete: scripts/support/conf/sun4.sun4m.faui45m .del-sun4.sun4m.faui42~3e480692: Delete: scripts/support/conf/sun4.sun4m.faui42 .del-sun4.sun4c~3e480692: Delete: scripts/support/conf/sun4.sun4c .del-sun4.sun4c.Lucifer~3e480692: Delete: scripts/support/conf/sun4.sun4c.Lucifer .del-sun4.sun4.faui45~3e480692: Delete: scripts/support/conf/sun4.sun4.faui45 .del-sun4.sun4.faui10~3e480692: Delete: scripts/support/conf/sun4.sun4.faui10 .del-sun4.sun4.faui01~3e480692: Delete: scripts/support/conf/sun4.sun4.faui01 .del-sun3.sun3~3e480692: Delete: scripts/support/conf/sun3.sun3 .del-hp800.hp800~3e480692: Delete: scripts/support/conf/hp800.hp800 .del-hp700.hp700~3e480692: Delete: scripts/support/conf/hp700.hp700 .del-hp700.hp700.faui47~3e480692: Delete: scripts/support/conf/hp700.hp700.faui47 .del-hp300.hp300~3e480692: Delete: scripts/support/conf/hp300.hp300 refclock_parse.c: fix bug 455: tripping over NULL pointer on cleanup fix shadow storage logic for ppsphaseadjust and trustime wrt/ time2 fix compiler warnings for some platforms wrt/ printf formatstrings and varying structure element sizes reorder assignment in binding to avoid tripping over NULL pointers change contents of version string to include the RCS/CVS Id mfp_mul.c: correct carry propagation implementation Makefile.am: move binio.c, ieee754io.c into libparse .del-setup~3e480692: Delete: scripts/support/etc/setup .del-rc~3e480692: Delete: scripts/support/etc/rc .del-install~3e480692: Delete: scripts/support/etc/install .del-crontab~3e480692: Delete: scripts/support/etc/crontab .del-cron~3e480692: Delete: scripts/support/etc/cron .del-tickconf~3e480692: Delete: scripts/support/conf/tickconf .del-ntp.conf~3e480692: Delete: scripts/support/conf/ntp.conf .del-mvstats~3e480692: Delete: scripts/support/bin/mvstats .del-monl~3e480692: Delete: scripts/support/bin/monl .del-README~3e480692: Delete: scripts/support/README ieee754io.c: Rename: libntp/ieee754io.c -> libparse/ieee754io.c binio.c: Rename: libntp/binio.c -> libparse/binio.c gpstolfp.c: Rename: libntp/gpstolfp.c -> libparse/gpstolfp.c mfp_mul.c: Rename: libntp/mfp_mul.c -> libparse/mfp_mul.c BitKeeper/deleted/.del-README~3e480692@1.3 +0 -73 Delete: scripts/support/README BitKeeper/deleted/.del-crontab~3e480692@1.3 +0 -8 Delete: scripts/support/etc/crontab BitKeeper/deleted/.del-cron~3e480692@1.3 +0 -18 Delete: scripts/support/etc/cron BitKeeper/deleted/.del-hp300.hp300~3e480692@1.3 +0 -0 Delete: scripts/support/conf/hp300.hp300 BitKeeper/deleted/.del-hp700.hp700.faui47~3e480692@1.3 +0 -0 Delete: scripts/support/conf/hp700.hp700.faui47 BitKeeper/deleted/.del-hp700.hp700~3e480692@1.3 +0 -0 Delete: scripts/support/conf/hp700.hp700 BitKeeper/deleted/.del-hp800.hp800~3e480692@1.3 +0 -0 Delete: scripts/support/conf/hp800.hp800 BitKeeper/deleted/.del-install~3e480692@1.3 +0 -67 Delete: scripts/support/etc/install BitKeeper/deleted/.del-monl~3e480692@1.3 +0 -213 Delete: scripts/support/bin/monl BitKeeper/deleted/.del-mvstats~3e480692@1.3 +0 -23 Delete: scripts/support/bin/mvstats BitKeeper/deleted/.del-ntp.conf~3e480692@1.3 +0 -3 Delete: scripts/support/conf/ntp.conf BitKeeper/deleted/.del-rc~3e480692@1.3 +0 -198 Delete: scripts/support/etc/rc BitKeeper/deleted/.del-setup~3e480692@1.3 +0 -72 Delete: scripts/support/etc/setup BitKeeper/deleted/.del-sun3.sun3~3e480692@1.3 +0 -0 Delete: scripts/support/conf/sun3.sun3 BitKeeper/deleted/.del-sun4.sun4.faui01~3e480692@1.3 +0 -0 Delete: scripts/support/conf/sun4.sun4.faui01 BitKeeper/deleted/.del-sun4.sun4.faui10~3e480692@1.3 +0 -0 Delete: scripts/support/conf/sun4.sun4.faui10 BitKeeper/deleted/.del-sun4.sun4.faui45~3e480692@1.3 +0 -0 Delete: scripts/support/conf/sun4.sun4.faui45 BitKeeper/deleted/.del-sun4.sun4c.Lucifer~3e480692@1.3 +0 -0 Delete: scripts/support/conf/sun4.sun4c.Lucifer BitKeeper/deleted/.del-sun4.sun4c~3e480692@1.3 +0 -0 Delete: scripts/support/conf/sun4.sun4c BitKeeper/deleted/.del-sun4.sun4m.faui42~3e480692@1.3 +0 -0 Delete: scripts/support/conf/sun4.sun4m.faui42 BitKeeper/deleted/.del-sun4.sun4m.faui45m~3e480692@1.3 +0 -0 Delete: scripts/support/conf/sun4.sun4m.faui45m BitKeeper/deleted/.del-sun4.sun4m~3e480692@1.3 +0 -0 Delete: scripts/support/conf/sun4.sun4m BitKeeper/deleted/.del-tickconf~3e480692@1.3 +0 -19 Delete: scripts/support/conf/tickconf libparse/Makefile.am@1.8 +23 -2 move binio.c, ieee754io.c into libparse libparse/binio.c@1.6 +0 -0 Rename: libntp/binio.c -> libparse/binio.c libparse/gpstolfp.c@1.8 +0 -0 Rename: libntp/gpstolfp.c -> libparse/gpstolfp.c libparse/ieee754io.c@1.8 +0 -0 Rename: libntp/ieee754io.c -> libparse/ieee754io.c libparse/mfp_mul.c@1.7 +42 -11 correct carry propagation implementation libparse/mfp_mul.c@1.6 +0 -0 Rename: libntp/mfp_mul.c -> libparse/mfp_mul.c ntpd/refclock_parse.c@1.33 +41 -33 fix bug 455: tripping over NULL pointer on cleanup fix shadow storage logic for ppsphaseadjust and trustime wrt/ time2 fix compiler warnings for some platforms wrt/ printf formatstrings and varying structure element sizes reorder assignment in binding to avoid tripping over NULL pointers change contents of version string to include the RCS/CVS Id scripts/Makefile.am@1.12 +1 -1 support is gone - overaged files ChangeSet@1.1178.5.5, 2005-07-19 21:21:45-04:00, stenn@whimsy.udel.edu FreeBSD porting issues Makefile.am@1.46.1.1 +5 -5 FreeBSD porting issues ntpdc/ntpdc.c@1.33.2.1 +5 -1 FreeBSD porting issues ntpq/ntpq.c@1.48.2.1 +5 -1 FreeBSD porting issues ChangeSet@1.1178.5.4, 2005-07-19 21:20:36-04:00, stenn@whimsy.udel.edu [Bug 466] Fix compilation under gcc4 include/ntp_control.h@1.25.1.1 +1 -0 [Bug 466] Fix compilation under gcc4 include/ntp_refclock.h@1.15.1.1 +1 -0 [Bug 466] Fix compilation under gcc4 include/ntp_stdlib.h@1.21 +0 -4 [Bug 466] Fix compilation under gcc4 include/ntpd.h@1.66.1.1 +0 -2 [Bug 466] Fix compilation under gcc4 ChangeSet@1.1178.5.3, 2005-07-19 20:13:43-04:00, stenn@whimsy.udel.edu [Bug 464] building ntp with debugging disabled fails ntpd/ntp_proto.c@1.179.1.1 +1 -1 [Bug 464] building ntp with debugging disabled fails ChangeSet@1.1251.38.4, 2005-07-16 17:30:55-04:00, mayer@pogo.udel.edu Add debug code to print the broadcast interface used ntpd/ntp_peer.c@1.76 +5 -0 Add debug code to print the broadcast interface used ChangeSet@1.1251.38.3, 2005-07-16 17:29:55-04:00, mayer@pogo.udel.edu Fix read loop to skip out if nothing to do and not complain about it ntpd/ntp_io.c@1.182 +143 -146 Fix read loop to skip out if nothing to do and not complain about it ChangeSet@1.1283, 2005-07-04 04:15:16-04:00, stenn@pogo.udel.edu New libopts Makefile.am@1.51 +2 -2 Cleanup configure.ac@1.371 +2 -0 Cleanup libopts/AUTHORS@1.1 +2 -0 libopts/AUTHORS@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/AUTHORS libopts/COPYING@1.1 +502 -0 libopts/COPYING@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/COPYING libopts/COPYING.lgpl@1.1 +502 -0 libopts/COPYING.lgpl@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/COPYING.lgpl libopts/COPYING.mbsd@1.1 +26 -0 libopts/COPYING.mbsd@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/COPYING.mbsd libopts/ChangeLog@1.1 +4 -0 libopts/ChangeLog@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/ChangeLog libopts/INSTALL@1.1 +231 -0 libopts/INSTALL@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/INSTALL libopts/MakeDefs.inc@1.1 +5 -0 libopts/MakeDefs.inc@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/MakeDefs.inc libopts/Makefile.am@1.1 +4 -0 libopts/Makefile.am@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/Makefile.am libopts/NEWS@1.1 +6 -0 libopts/NEWS@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/NEWS libopts/README@1.1 +2 -0 libopts/README@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/README libopts/aclocal.m4@1.1 +6827 -0 libopts/aclocal.m4@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/aclocal.m4 libopts/autoopts.c@1.1 +1033 -0 libopts/autoopts.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/autoopts.c libopts/autoopts.h@1.1 +337 -0 libopts/autoopts.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/autoopts.h libopts/autoopts/options.h@1.1 +864 -0 libopts/autoopts/options.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/autoopts/options.h libopts/autoopts/usage-txt.h@1.1 +479 -0 libopts/autoopts/usage-txt.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/autoopts/usage-txt.h libopts/boolean.c@1.1 +102 -0 libopts/boolean.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/boolean.c libopts/bootstrap@1.1 +34 -0 libopts/bootstrap@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/bootstrap libopts/compat/compat.h@1.1 +249 -0 libopts/compat/compat.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/compat/compat.h libopts/compat/pathfind.c@1.1 +332 -0 libopts/compat/pathfind.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/compat/pathfind.c libopts/config-h.in@1.1 +140 -0 libopts/config-h.in@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/config-h.in libopts/config-h.in~@1.1 +236 -0 libopts/config-h.in~@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/config-h.in~ libopts/configfile.c@1.1 +1282 -0 libopts/configfile.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/configfile.c libopts/configure@1.1 +23905 -0 libopts/configure@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/configure libopts/configure.ac@1.1 +54 -0 libopts/configure.ac@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/configure.ac libopts/cook.c@1.1 +355 -0 libopts/cook.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/cook.c libopts/enumeration.c@1.1 +449 -0 libopts/enumeration.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/enumeration.c libopts/environment.c@1.1 +261 -0 libopts/environment.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/environment.c libopts/genshell.c@1.1 +300 -0 libopts/genshell.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/genshell.c libopts/genshell.h@1.1 +143 -0 libopts/genshell.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/genshell.h libopts/libopts.c@1.1 +29 -0 libopts/libopts.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts.c libopts/libopts.m4@1.1 +387 -0 libopts/libopts.m4@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts.m4 libopts/libopts/Makefile.am@1.1 +12 -0 libopts/libopts/Makefile.am@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/Makefile.am libopts/libopts/autoopts.c@1.1 +1033 -0 libopts/libopts/autoopts.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/autoopts.c libopts/libopts/autoopts.h@1.1 +337 -0 libopts/libopts/autoopts.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/autoopts.h libopts/libopts/boolean.c@1.1 +102 -0 libopts/libopts/boolean.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/boolean.c libopts/libopts/configfile.c@1.1 +1282 -0 libopts/libopts/configfile.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/configfile.c libopts/libopts/cook.c@1.1 +355 -0 libopts/libopts/cook.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/cook.c libopts/libopts/enumeration.c@1.1 +449 -0 libopts/libopts/enumeration.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/enumeration.c libopts/libopts/environment.c@1.1 +261 -0 libopts/libopts/environment.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/environment.c libopts/libopts/genshell.c@1.1 +300 -0 libopts/libopts/genshell.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/genshell.c libopts/libopts/genshell.h@1.1 +143 -0 libopts/libopts/genshell.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/genshell.h libopts/libopts/libopts.c@1.1 +29 -0 libopts/libopts/libopts.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/libopts.c libopts/libopts/load.c@1.1 +470 -0 libopts/libopts/load.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/load.c libopts/libopts/makeshell.c@1.1 +1100 -0 libopts/libopts/makeshell.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/makeshell.c libopts/libopts/nested.c@1.1 +707 -0 libopts/libopts/nested.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/nested.c libopts/libopts/numeric.c@1.1 +89 -0 libopts/libopts/numeric.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/numeric.c libopts/libopts/pgusage.c@1.1 +154 -0 libopts/libopts/pgusage.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/pgusage.c libopts/libopts/proto.h@1.1 +124 -0 libopts/libopts/proto.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/proto.h libopts/libopts/putshell.c@1.1 +333 -0 libopts/libopts/putshell.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/putshell.c libopts/libopts/restore.c@1.1 +207 -0 libopts/libopts/restore.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/restore.c libopts/libopts/save.c@1.1 +499 -0 libopts/libopts/save.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/save.c libopts/libopts/sort.c@1.1 +369 -0 libopts/libopts/sort.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/sort.c libopts/libopts/stack.c@1.1 +224 -0 libopts/libopts/stack.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/stack.c libopts/libopts/streqvcmp.c@1.1 +292 -0 libopts/libopts/streqvcmp.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/streqvcmp.c libopts/libopts/text_mmap.c@1.1 +312 -0 libopts/libopts/text_mmap.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/text_mmap.c libopts/libopts/tokenize.c@1.1 +322 -0 libopts/libopts/tokenize.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/tokenize.c libopts/libopts/usage.c@1.1 +651 -0 libopts/libopts/usage.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/usage.c libopts/libopts/version.c@1.1 +177 -0 libopts/libopts/version.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/version.c libopts/load.c@1.1 +470 -0 libopts/load.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/load.c libopts/m4/compile@1.1 +142 -0 libopts/m4/compile@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/compile libopts/m4/config.guess@1.1 +1495 -0 libopts/m4/config.guess@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/config.guess libopts/m4/config.sub@1.1 +1570 -0 libopts/m4/config.sub@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/config.sub libopts/m4/depcomp@1.1 +522 -0 libopts/m4/depcomp@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/depcomp libopts/m4/install-sh@1.1 +323 -0 libopts/m4/install-sh@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/install-sh libopts/m4/libopts.m4@1.1 +331 -0 libopts/m4/libopts.m4@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/libopts.m4 libopts/m4/ltmain.sh@1.1 +6500 -0 libopts/m4/ltmain.sh@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/ltmain.sh libopts/m4/missing@1.1 +353 -0 libopts/m4/missing@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/missing libopts/makeshell.c@1.1 +1100 -0 libopts/makeshell.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/makeshell.c libopts/nested.c@1.1 +707 -0 libopts/nested.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/nested.c libopts/numeric.c@1.1 +89 -0 libopts/numeric.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/numeric.c libopts/pgusage.c@1.1 +154 -0 libopts/pgusage.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/pgusage.c libopts/proto.h@1.1 +124 -0 libopts/proto.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/proto.h libopts/putshell.c@1.1 +333 -0 libopts/putshell.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/putshell.c libopts/restore.c@1.1 +207 -0 libopts/restore.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/restore.c libopts/save.c@1.1 +499 -0 libopts/save.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/save.c libopts/sort.c@1.1 +369 -0 libopts/sort.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/sort.c libopts/stack.c@1.1 +224 -0 libopts/stack.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/stack.c libopts/streqvcmp.c@1.1 +292 -0 libopts/streqvcmp.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/streqvcmp.c libopts/text_mmap.c@1.1 +312 -0 libopts/text_mmap.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/text_mmap.c libopts/tokenize.c@1.1 +322 -0 libopts/tokenize.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/tokenize.c libopts/usage.c@1.1 +651 -0 libopts/usage.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/usage.c libopts/version.c@1.1 +177 -0 libopts/version.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/version.c ntpdc/ntpdc-opts.def@1.3 +22 -7 Cleanup ntpq/ntpq-opts.def@1.2 +242 -5 Cleanup ChangeSet@1.1282, 2005-07-04 02:40:36-04:00, stenn@pogo.udel.edu Remove old libopts/ BitKeeper/deleted/.del-COPYING.lgpl~446c1c486f21fd2e@1.2 +0 -0 Delete: libopts/COPYING.lgpl BitKeeper/deleted/.del-COPYING.mbsd~7a99797cacd53056@1.2 +0 -0 Delete: libopts/COPYING.mbsd BitKeeper/deleted/.del-MakeDefs.inc~159b003e2ec363b5@1.2 +0 -0 Delete: libopts/MakeDefs.inc BitKeeper/deleted/.del-Makefile.am~fbc0c90887a6abe1@1.3 +0 -0 Delete: libopts/Makefile.am BitKeeper/deleted/.del-README~863ded79da7cd04e@1.2 +0 -0 Delete: libopts/README BitKeeper/deleted/.del-autoopts.c~8d508a4c6d6337a8@1.3 +0 -0 Delete: libopts/autoopts.c BitKeeper/deleted/.del-autoopts.h~24ccfda237b1a4e4@1.3 +0 -0 Delete: libopts/autoopts.h BitKeeper/deleted/.del-boolean.c~76d65cce6791b639@1.3 +0 -0 Delete: libopts/boolean.c BitKeeper/deleted/.del-compat.h~b5311be51765bbc8@1.3 +0 -0 Delete: libopts/compat/compat.h BitKeeper/deleted/.del-enumeration.c~406a20f27bb1e70b@1.3 +0 -0 Delete: libopts/enumeration.c BitKeeper/deleted/.del-environment.c~cb6a850da6dc34bd@1.3 +0 -0 Delete: libopts/environment.c BitKeeper/deleted/.del-genshell.c~f2627aa3ed9ec273@1.3 +0 -0 Delete: libopts/genshell.c BitKeeper/deleted/.del-genshell.h~e70a6981bf25d8d7@1.3 +0 -0 Delete: libopts/genshell.h BitKeeper/deleted/.del-libopts.c~48986232bbeb4a0@1.2 +0 -0 Delete: libopts/libopts.c BitKeeper/deleted/.del-libopts.m4~b877c4d87dcb4b42@1.3 +0 -0 Delete: libopts/libopts.m4 BitKeeper/deleted/.del-load.c~ac03722a64c7070c@1.3 +0 -0 Delete: libopts/load.c BitKeeper/deleted/.del-makeshell.c~83bda01ad08e7d2@1.3 +0 -0 Delete: libopts/makeshell.c BitKeeper/deleted/.del-numeric.c~fb3a05758eeebb76@1.3 +0 -0 Delete: libopts/numeric.c BitKeeper/deleted/.del-options.h~21d498cf4fa940d7@1.3 +0 -0 Delete: libopts/options.h BitKeeper/deleted/.del-pathfind.c~f2717c337308e580@1.3 +0 -0 Delete: libopts/compat/pathfind.c BitKeeper/deleted/.del-pgusage.c~a02c107578a438f@1.3 +0 -0 Delete: libopts/pgusage.c BitKeeper/deleted/.del-putshell.c~cc1d047a2bea9716@1.3 +0 -0 Delete: libopts/putshell.c BitKeeper/deleted/.del-restore.c~9b4b04133eb12966@1.3 +0 -0 Delete: libopts/restore.c BitKeeper/deleted/.del-save.c~d8aaf91115194b06@1.3 +0 -0 Delete: libopts/save.c BitKeeper/deleted/.del-sort.c~a3a8ea89587b8a4@1.3 +0 -0 Delete: libopts/sort.c BitKeeper/deleted/.del-stack.c~b43aa38ab8b08c0d@1.3 +0 -0 Delete: libopts/stack.c BitKeeper/deleted/.del-streqv.h~961ec0971a342cd6@1.3 +0 -0 Delete: libopts/streqv.h BitKeeper/deleted/.del-streqvcmp.c~7ef8826c4cd9bd3f@1.3 +0 -0 Delete: libopts/streqvcmp.c BitKeeper/deleted/.del-tokenize.c~7729f53ebb45f578@1.2 +0 -0 Delete: libopts/tokenize.c BitKeeper/deleted/.del-tokenize.h~cabedf7f2026e66@1.2 +0 -0 Delete: libopts/tokenize.h BitKeeper/deleted/.del-usage-txt.h~53df7a61187840e9@1.3 +0 -0 Delete: libopts/usage-txt.h BitKeeper/deleted/.del-usage.c~d5db6221d54a6f45@1.3 +0 -0 Delete: libopts/usage.c BitKeeper/deleted/.del-version.c~39f34e94894b40d2@1.3 +0 -0 Delete: libopts/version.c ChangeSet@1.1251.38.2, 2005-07-03 08:30:38-04:00, mayer@pogo.udel.edu Additional IPv6 multicasting fixes and fix for size of default_ai_family ntpd/ntp_config.c@1.128 +3 -7 Fix the size of default_ai_family which should have been short ntpd/ntp_io.c@1.181 +32 -10 Additional fixes for IPv6 multicasting ChangeSet@1.1178.5.2, 2005-07-03 01:54:05-04:00, stenn@whimsy.udel.edu Change from openlogging to a list at ntp.isc.org BitKeeper/etc/config@1.7 +2 -1 Change from openlogging to a list at ntp.isc.org ChangeSet@1.1251.36.5, 2005-07-01 10:42:55+02:00, claas@nixfix.(none) refclock_neoclock4x.c: solve AIX problems ntpd/refclock_neoclock4x.c@1.12 +65 -6 solve AIX problems ChangeSet@1.1251.36.4, 2005-06-29 04:31:59-04:00, stenn@whimsy.udel.edu VxWorks cleanup ntpq/ntpq.c@1.55.1.3 +4 -3 VxWorks cleanup ChangeSet@1.1251.37.1, 2005-06-28 20:30:44-04:00, stenn@whimsy.udel.edu Cleanup from Dave Mills ntpd/ntp_proto.c@1.225 +4 -2 Cleanup from Dave Mills ChangeSet@1.1251.36.1, 2005-06-28 04:28:30-04:00, stenn@whimsy.udel.edu Only look for sys/sched.h if sched.h is not found configure.ac@1.359.1.15 +5 -1 Only look for sys/sched.h if sched.h is not found ChangeSet@1.1251.35.1, 2005-06-27 03:23:38-04:00, stenn@whimsy.udel.edu Fixes from Dave Mills ntpd/ntp_loopfilter.c@1.108 +2 -3 Fixes from Dave Mills ntpd/ntp_proto.c@1.224 +1 -1 Fixes from Dave Mills ChangeSet@1.1251.1.129, 2005-06-26 12:34:11-04:00, mayer@pogo.udel.edu Added MULTICAST_NONEWSOCKET to configuration, Windows doesn't allow separate socket for multicast ports/winnt/include/config.h@1.38 +5 -3 Added MULTICAST_NONEWSOCKET to configuration, Windows doesn't allow separate socket for multicast ChangeSet@1.1251.1.127, 2005-06-25 22:13:01-04:00, mayer@pogo.udel.edu Fixes for IPv6 multicast at least for FreeBSD ntpd/ntp_io.c@1.180 +162 -34 Fixes for IPv6 multicast at least for FreeBSD ChangeSet@1.1251.33.8, 2005-06-25 21:28:14+00:00, kardel@pogo.udel.edu refclock_parse.c: fix acceptance of clocks unsync clocks right at start change status reporting to use fixed refclock_report() clarify trust logic collect samples only if samples are ok (sync or trusted flywheel) propagate pps phase adjustment value to kernel via PPSAPI to help HARDPPS en- and dis-able HARDPPS in correlation to receiver sync state sort out log output sequence ntp_refclock.c: complete event to statistic mapping make refclock_report to follow RFC1305 rules for clock.status and event reporting parsestreams.h: update copyright parse_conf.h, parse.h, mbg_gps166.h: add missing log keywords driver8.html: anonymize version number in sample output html/drivers/driver8.html@1.17 +1 -1 anonymize version number in sample output include/mbg_gps166.h@1.5 +7 -2 add missing log keywords include/parse.h@1.7 +6 -3 add missing log keywords include/parse_conf.h@1.5 +12 -3 add missing log keywords kernel/sys/parsestreams.h@1.7 +33 -9 update copyright ntpd/ntp_refclock.c@1.71 +36 -8 complete event to statistic mapping make refclock_report to follow RFC1305 rules for clock.status and event reporting ntpd/refclock_parse.c@1.32 +152 -103 fix acceptance of clocks unsync clocks right at start change status reporting to use fixed refclock_report() clarify trust logic collect samples only if samples are ok (sync or trusted flywheel) propagate pps phase adjustment value to kernel via PPSAPI to help HARDPPS en- and dis-able HARDPPS in correlation to receiver sync state sort out log output sequence ChangeSet@1.1251.33.7, 2005-06-23 21:24:16-04:00, stenn@whimsy.udel.edu Fixes from Dave Mills ntpd/ntp_refclock.c@1.70 +8 -2 Fixes from Dave Mills ChangeSet@1.1251.33.6, 2005-06-23 21:20:53-04:00, stenn@whimsy.udel.edu Bump NBUF to 80k. From Dave Mills util/jitter.c@1.8 +1 -1 Bump NBUF to 80k. From Dave Mills ChangeSet@1.1251.33.5, 2005-06-14 00:56:12-04:00, stenn@whimsy.udel.edu Changes from Dave Mills ntpd/ntp_refclock.c@1.69 +0 -1 Changes from Dave Mills ChangeSet@1.1251.33.4, 2005-06-11 02:35:12-04:00, stenn@whimsy.udel.edu [Bug 448] want_getifaddrs typo fix (from Enrique Perez-Terron) configure.ac@1.359.1.14 +1 -1 [Bug 448] want_getifaddrs typo fix (from Enrique Perez-Terron) ChangeSet@1.1251.34.1, 2005-06-09 21:42:42-04:00, stenn@whimsy.udel.edu [Bug 447] typo in ntpq.html html/ntpq.html@1.26 +2 -2 [Bug 447] typo in ntpq.html ChangeSet@1.1251.33.2, 2005-05-30 13:17:56+02:00, martin@pc-martin4. Added SIZEOF_TIME_T for Windows. BitKeeper/etc/logging_ok@1.54 +1 -0 Logging to logging@openlogging.org accepted ports/winnt/include/config.h@1.37 +1 -0 Added SIZEOF_TIME_T for Windows. ChangeSet@1.1251.33.1, 2005-05-30 01:02:52-04:00, stenn@whimsy.udel.edu [Bug 434] Fix from Dave Mills ntpd/ntp_refclock.c@1.68 +0 -3 [Bug 434] Fix from Dave Mills ChangeSet@1.1251.26.19, 2005-05-28 06:27:19-04:00, stenn@pogo.udel.edu Cleanup building of parse clocks configure.ac@1.359.1.12 +3 -2 Cleanup building of parse clocks ChangeSet@1.1251.26.18, 2005-05-28 10:13:03+00:00, kardel@pogo.udel.edu ntp_refclock.c: We know that peer_leap can be LEAPNOTINSYNC from startup (peer_clear when FLAG_REFCLOCK is not set yet) or when copied from pp->leap. Thus interrogating peer->leap only gives a a false refclock_report from initialization. False in that respect that new knowledge is available (pp->leap) and will be the current information from then on. See Bug 434 ntpd/ntp_refclock.c@1.67 +1 -2 We know that peer_leap can be LEAPNOTINSYNC from startup (peer_clear when FLAG_REFCLOCK is not set yet) or when copied from pp->leap. Thus interrogating peer->leap only gives a a false reclock_report from initialization. False in that respect that new knowledge is available (pp->leap) and will be the current information from then on. ChangeSet@1.1251.32.1, 2005-05-28 04:45:19-04:00, stenn@whimsy.udel.edu sys_clocktime defn/decl cleanup include/ntpd.h@1.78 +1 -0 sys_clocktime defn/decl cleanup ntpd/ntp_proto.c@1.223 +0 -1 sys_clocktime defn/decl cleanup ChangeSet@1.1251.29.14, 2005-05-28 04:36:31-04:00, stenn@pogo.udel.edu [Bug 443] Remove duplicate LDISC_ #defines (from Brian Utterback) include/ntp_tty.h@1.3 +0 -13 [Bug 443] Remove duplicate LDISC_ #defines (from Brian Utterback) ChangeSet@1.1251.29.13, 2005-05-28 04:22:37-04:00, stenn@pogo.udel.edu [Bug 442] some constants should be UL ntpd/ntp_control.c@1.79 +3 -2 [Bug 442] some constants should be UL ChangeSet@1.1251.29.12, 2005-05-28 04:10:30-04:00, stenn@pogo.udel.edu [Bug 441] Treat *-*-solaris2* the same WRT AM_C_PROTOTYPES configure.ac@1.359.2.2 +6 -2 [Bug 441] Treat *-*-solaris2* the same WRT AM_C_PROTOTYPES ChangeSet@1.1251.29.11, 2005-05-27 05:39:09-04:00, stenn@whimsy.udel.edu [Bug 437] Trailing comma in enumeration (fix from Brian Utterback) ntpd/ntp_config.c@1.126 +1 -1 [Bug 437] Trailing comma in enumeration (fix from Brian Utterback) ChangeSet@1.1251.31.3, 2005-05-26 20:51:10-04:00, stenn@pogo.udel.edu [Bug 432] More in6addr_any cleanup libisc/ifiter_ioctl.c@1.22.1.2 +2 -0 [Bug 432] More in6addr_any cleanup ChangeSet@1.1251.26.15, 2005-05-26 22:05:19+00:00, kardel@pogo.udel.edu refclock_parse.c: cleanup status reporting ntp_refclock.c: initialize currentstatus to CEVNT_FAULT to avoid misleading clk_fault report at first successful reception from a refclock driver ntpd/ntp_refclock.c@1.66 +3 -1 initialize currentstatus to CEVNT_FAULT to avoid misleading clk_fault report at first successful reception from a refclock driver ntpd/refclock_parse.c@1.31 +17 -14 cleanup status reporting ChangeSet@1.1251.26.14, 2005-05-26 19:36:08+00:00, kardel@pogo.udel.edu refclock_parse.c: implement fast refclock startup ntpd/refclock_parse.c@1.30 +9 -5 implement fast refclock startup ChangeSet@1.1251.31.2, 2005-05-26 06:28:54-04:00, stenn@pogo.udel.edu [Bug 432] More in6addr_any cleanup libisc/ifiter_ioctl.c@1.22.1.1 +1 -0 [Bug 432] More in6addr_any cleanup ChangeSet@1.1251.29.9, 2005-05-26 06:27:24-04:00, stenn@pogo.udel.edu [Bug 432] More in6addr_any cleanup libisc/ifiter_ioctl.c@1.23 +1 -0 [Bug 432] More in6addr_any cleanup ChangeSet@1.1251.31.1, 2005-05-26 06:23:51-04:00, stenn@pogo.udel.edu [Bug 432] More in6addr_any cleanup libisc/ifiter_ioctl.c@1.22 +1 -0 [Bug 432] More in6addr_any cleanup ChangeSet@1.1251.29.7, 2005-05-26 05:20:13-04:00, stenn@pogo.udel.edu [Bug 432] More in6addr_any cleanup libisc/netaddr.c@1.4 +2 -0 [Bug 432] More in6addr_any cleanup libisc/sockaddr.c@1.4 +2 -0 [Bug 432] More in6addr_any cleanup ChangeSet@1.1251.29.6, 2005-05-25 05:43:34-04:00, stenn@pogo.udel.edu [Bug 432] in6addr_any cleanup libisc/sockaddr.c@1.3 +2 -0 [Bug 432] in6addr_any cleanup ChangeSet@1.1251.29.4, 2005-05-25 05:01:29-04:00, stenn@whimsy.udel.edu [Bug 433] Avoid epoch overflow on 32 bit systems libntp/prettydate.c@1.5 +9 -0 [Bug 433] Avoid epoch overflow on 32 bit systems ChangeSet@1.1251.29.3, 2005-05-25 04:57:45-04:00, stenn@whimsy.udel.edu Try adding mort back in to the br-flock br-flock@1.6 +1 -1 Try adding mort back in to the br-flock ChangeSet@1.1251.29.2, 2005-05-24 04:37:05-04:00, stenn@whimsy.udel.edu [Bug 433] get SIZEOF_TIME_T configure.ac@1.359.2.1 +1 -0 [Bug 433] get SIZEOF_TIME_T ChangeSet@1.1251.28.2, 2005-05-24 03:36:59-04:00, stenn@pogo.udel.edu [Bug 432] clean up in6addrany usage libisc/netaddr.c@1.3 +2 -0 [Bug 432] clean up in6addrany usage libntp/ntp_rfc2553.c@1.22 +0 -12 [Bug 432] clean up in6addrany usage ntpd/ntp_intres.c@1.40 +2 -0 [Bug 432] clean up in6addrany usage ChangeSet@1.1251.28.1, 2005-05-24 03:11:09-04:00, stenn@pogo.udel.edu Added barnstable to the flock list flock-build@1.31 +1 -1 Added barnstable to the flock list ChangeSet@1.1251.27.2, 2005-05-24 01:06:58-04:00, stenn@whimsy.udel.edu [Bug 431] More fixes from Dave Mills ntpd/ntp_proto.c@1.222 +4 -3 [Bug 431] More fixes from Dave Mills ChangeSet@1.1251.27.1, 2005-05-22 04:21:05-04:00, stenn@whimsy.udel.edu [Bug 431]: FLAG_AUTHENABLE/FLAG_AUTHENTIC fixes from Dave Mills ntpd/ntp_config.c@1.125 +0 -1 FLAG_AUTHENABLE/FLAG_AUTHENTIC fixes from Dave Mills ntpd/ntp_proto.c@1.221 +2 -0 FLAG_AUTHENABLE/FLAG_AUTHENTIC fixes from Dave Mills ChangeSet@1.1251.26.12, 2005-05-21 10:53:09+00:00, kardel@pogo.udel.edu refclock_parse.c: add simple timstamp reading Meinberg clock (type 18) for the sake of cooperation in a multi client environment adjust to new pps setup Many files: copyright maintenance driver8.html: document new clock type (Meinberg only time reading) copyright.html: update eMail address configure.ac: NetBSD supports parse fully ChangeLog-4.1.0: obfuscate email addresses BitKeeper/etc/logging_ok@1.53 +1 -0 Logging to logging@openlogging.org accepted ChangeLog-4.1.0@1.591 +14 -14 obfuscate email addresses configure.ac@1.359.1.10 +4 -4 NetBSD supports parse fully html/copyright.html@1.30 +1 -1 update eMail address html/drivers/driver8.html@1.16 +414 -302 document new clock type (Meinberg only time reading) include/ascii.h@1.4 +6 -3 copyright maintenance include/binio.h@1.4 +6 -3 copyright maintenance include/ieee754io.h@1.4 +6 -3 copyright maintenance include/mbg_gps166.h@1.4 +3 -3 copyright maintenance include/parse.h@1.6 +4 -4 copyright maintenance include/parse_conf.h@1.4 +4 -4 copyright maintenance include/trimble.h@1.4 +6 -3 copyright maintenance kernel/sys/parsestreams.h@1.6 +1 -1 copyright maintenance libntp/binio.c@1.5 +3 -3 copyright maintenance libntp/gpstolfp.c@1.7 +6 -3 copyright maintenance libntp/ieee754io.c@1.7 +6 -3 copyright maintenance libntp/mfp_mul.c@1.5 +6 -3 copyright maintenance libparse/clk_computime.c@1.8 +6 -3 copyright maintenance libparse/clk_dcf7000.c@1.8 +6 -3 copyright maintenance libparse/clk_hopf6021.c@1.8 +2 -2 copyright maintenance libparse/clk_meinberg.c@1.8 +6 -3 copyright maintenance libparse/clk_rawdcf.c@1.10 +6 -3 copyright maintenance libparse/clk_rcc8000.c@1.8 +2 -2 copyright maintenance libparse/clk_schmid.c@1.8 +6 -3 copyright maintenance libparse/clk_trimtaip.c@1.8 +6 -3 copyright maintenance libparse/clk_trimtsip.c@1.8 +6 -3 copyright maintenance libparse/clk_varitext.c@1.7 +6 -3 copyright maintenance libparse/clk_wharton.c@1.6 +2 -2 copyright maintenance libparse/data_mbg.c@1.5 +6 -3 copyright maintenance libparse/info_trimble.c@1.4 +6 -4 copyright maintenance libparse/parse.c@1.10 +7 -4 copyright maintenance libparse/parse_conf.c@1.9 +6 -3 copyright maintenance libparse/parsesolaris.c@1.6 +8 -5 copyright maintenance libparse/parsestreams.c@1.6 +9 -6 copyright maintenance libparse/trim_info.c@1.4 +6 -3 copyright maintenance ntpd/refclock_parse.c@1.29 +71 -23 add simple timstamp reading Meinberg clock (type 18) for the sake of cooperation in a multi client environment adjust to new pps setup parseutil/dcfd.c@1.15 +6 -3 copyright maintenance parseutil/testdcf.c@1.6 +7 -4 copyright maintenance scripts/monitoring/ntploopwatch@1.4 +1 -1 copyright maintenance ChangeSet@1.1251.26.11, 2005-05-18 05:36:08-04:00, stenn@whimsy.udel.edu [Bug 408] fix based on proposed patch from cipo ntpq/ntpq.c@1.55.1.2 +10 -4 [Bug 408] fix based on proposed patch from cipo ntpq/ntpq.h@1.5 +1 -1 [Bug 408] fix based on proposed patch from cipo ntpq/ntpq_ops.c@1.20.2.1 +1 -1 [Bug 408] fix based on proposed patch from cipo ChangeSet@1.1251.26.10, 2005-05-17 01:17:18-04:00, stenn@whimsy.udel.edu Stuff from Dave Mills ntpd/ntp_loopfilter.c@1.107 +4 -4 Fixes from Dave Mills ntpd/ntp_proto.c@1.220 +26 -3 Stratum checks from Dave Mills ntpd/refclock_arbiter.c@1.12 +6 -4 Dave Mills: Call refclock_receive() once a second for the first few seconds ntpd/refclock_atom.c@1.53 +8 -0 Dave Mills: flag4 in atom driver records offset to clockstats ntpd/refclock_pst.c@1.8 +2 -1 Dave Mills: Call refclock_receive() once a second for the first few seconds ntpd/refclock_wwvb.c@1.15 +2 -0 Dave Mills: Call refclock_receive() once a second for the first few seconds ChangeSet@1.1251.26.9, 2005-05-06 00:23:53-04:00, stenn@whimsy.udel.edu Changes from Dave Mills BitKeeper/deleted/.del-driver23.html~3aed0663@1.13 +0 -0 Delete: html/drivers/driver23.html BitKeeper/deleted/.del-driver24.html~3e480692@1.10 +0 -0 Delete: html/drivers/driver24.html BitKeeper/deleted/.del-footer.txt~29fb3ec8f08446d2@1.2 +0 -0 Delete: html/drivers/footer.txt html/index.html@1.31 +94 -94 Changes from Dave Mills ChangeSet@1.1251.26.8, 2005-05-05 23:55:29-04:00, stenn@whimsy.udel.edu Changes from Dave Mills include/ntp_refclock.h@1.18 +6 -5 Changes from Dave Mills ntpd/ntp_loopfilter.c@1.106 +2 -1 Changes from Dave Mills ntpd/ntp_refclock.c@1.65 +1 -1 Changes from Dave Mills ntpd/refclock_acts.c@1.25 +30 -18 Changes from Dave Mills ntpd/refclock_heath.c@1.12 +4 -3 Changes from Dave Mills ChangeSet@1.1251.26.7, 2005-04-27 05:53:39-04:00, stenn@whimsy.udel.edu [Bug 401] ntpdc: only ask for keyid once, from Jason Fountain ntpdc/ntpdc.c@1.40.1.1 +10 -6 [Bug 401] ntpdc: only ask for keyid once, from Jason Fountain ChangeSet@1.1251.26.6, 2005-04-27 04:09:54-04:00, stenn@whimsy.udel.edu [Bug 409] Add DNS-SD/Rendezvous to ntpd, from Andre Masella configure.ac@1.359.1.9 +11 -1 [Bug 409] Add DNS-SD/Rendezvous to ntpd, from Andre Masella ntpd/ntpd.c@1.61.2.1 +16 -0 [Bug 409] Add DNS-SD/Rendezvous to ntpd, from Andre Masella ChangeSet@1.1251.1.126, 2005-04-23 16:24:51-04:00, mayer@pogo.udel.edu Added support for -4 and -6 command line options ntpd/cmd_args.c@1.34 +9 -2 Added support for -4 and -6 command line options ntpd/ntp_config.c@1.123.1.1 +6 -21 Added support for -4 and -6 command line options ChangeSet@1.1251.26.5, 2005-04-21 00:27:25-04:00, stenn@whimsy.udel.edu Documentation changes from Dave Mills html/drivers/driver18.html@1.14 +10 -11 Documentation changes from Dave Mills html/drivers/driver36.html@1.25 +4 -88 Documentation changes from Dave Mills html/drivers/driver6.html@1.19 +6 -2 Documentation changes from Dave Mills ChangeSet@1.1251.26.4, 2005-04-21 00:23:40-04:00, stenn@whimsy.udel.edu Documentation changes from Dave Mills html/audio.html@1.16 +95 -3 Documentation changes from Dave Mills html/confopt.html@1.31 +1 -1 Documentation changes from Dave Mills html/ntpd.html@1.36 +4 -4 Documentation changes from Dave Mills html/ntpq.html@1.25 +258 -255 Documentation changes from Dave Mills ChangeSet@1.1251.26.3, 2005-04-21 00:08:47-04:00, stenn@whimsy.udel.edu anti-clockhop changes from Dave Mills include/ntp.h@1.116 +6 -6 anti-clockhop changes from Dave Mills include/ntp_config.h@1.33 +1 -0 anti-clockhop changes from Dave Mills ntpd/ntp_config.c@1.124 +5 -0 anti-clockhop changes from Dave Mills ntpd/ntp_proto.c@1.219 +17 -7 anti-clockhop changes from Dave Mills ChangeSet@1.1251.1.124, 2005-04-20 23:55:08-04:00, mayer@pogo.udel.edu Remove log.* from make files BitKeeper/deleted/.del-log.c~3e480692@1.7 +0 -0 Delete: libntp/log.c BitKeeper/deleted/.del-log.h~3e480692@1.5 +0 -0 Delete: libntp/log.h libntp/Makefile.am@1.32 +2 -2 Remove log.* from make files ChangeSet@1.1251.1.123, 2005-04-20 23:25:01-04:00, mayer@pogo.udel.edu Changes for multicasting libntp/log.c@1.6 +0 -0 Rename: BitKeeper/deleted/.del-log.c~3e480692 -> libntp/log.c BitKeeper/deleted/.del-log.c~3e480692@1.5 +0 -0 Delete: libntp/log.c libntp/log.h@1.4 +0 -0 Rename: BitKeeper/deleted/.del-log.h~3e480692 -> libntp/log.h BitKeeper/deleted/.del-log.h~3e480692@1.3 +0 -0 Delete: libntp/log.h ntpd/ntp_io.c@1.179 +35 -11 Changes for multicasting ChangeSet@1.1251.26.2, 2005-04-18 22:29:49-04:00, stenn@whimsy.udel.edu anti-clockhop changes from Dave Mills include/ntp.h@1.115 +1 -3 anti-clockhop changes from Dave Mills ntpd/ntp_proto.c@1.218 +21 -25 anti-clockhop changes from Dave Mills ChangeSet@1.1251.26.1, 2005-04-18 01:01:32-04:00, stenn@whimsy.udel.edu Changes from Dave Mills include/ntp.h@1.114 +2 -2 Changes from Dave Mills include/ntp_control.h@1.26 +9 -10 Changes from Dave Mills ntpd/ntp_control.c@1.78 +10 -15 Changes from Dave Mills ntpd/ntp_peer.c@1.75 +0 -2 Changes from Dave Mills ntpd/ntp_proto.c@1.217 +37 -43 Changes from Dave Mills ChangeSet@1.1251.18.2, 2005-04-16 23:26:04-04:00, mayer@tecotoo. Martin Burnicki's cleanup of command line options and setting the registry for NTP BitKeeper/deleted/.del-log.c~87fe33f8@1.3 +0 -0 Delete: ports/winnt/libntp/log.c BitKeeper/deleted/.del-log.h~29080509@1.5 +0 -0 Delete: ports/winnt/libntp/log.h include/ntp_cmdargs.h@1.3 +1 -0 Martin Burnicki's changes to fix ntpd usage message libntp/msyslog.c@1.19 +0 -1 Martin Burnicki's changes to remove unnecessary log.h include ntpd/cmd_args.c@1.33 +38 -42 Martin Burnicki's changes to fix ntpd usage message ntpd/ntpd.c@1.61.1.6 +0 -1 Martin Burnicki's changes to remove unnecessary log.h include ports/winnt/instsrv/Instsrv.dsp@1.6 +1 -1 Miscellaneous cleanup ports/winnt/libntp/libntp.dsp@1.25 +0 -8 Remove references to log.c and log.h ports/winnt/ntpd/nt_clockstuff.c@1.17 +0 -2 Martin Burnicki's changes to remove unnecessary registry call ports/winnt/ntpd/ntservice.c@1.5 +11 -5 Martin Burnicki's changes to fix ntpd usage message ChangeSet@1.1251.1.121, 2005-04-12 17:43:36-04:00, stenn@whimsy.udel.edu Documentation changes from Dave Mills (including [Bug 412]) html/accopt.html@1.23 +3 -5 Documentation changes from Dave Mills html/confopt.html@1.30 +2 -2 [Bug 412] multicastclient requires an address (Dave Mills) html/ntpq.html@1.24 +2 -3 Documentation changes from Dave Mills html/refclock.html@1.31 +8 -10 Documentation changes from Dave Mills ChangeSet@1.1251.1.120, 2005-04-12 00:52:34-04:00, stenn@whimsy.udel.edu Changes from Dave Mills ntpd/ntp_loopfilter.c@1.105 +3 -4 Changes from Dave Mills ntpd/ntp_proto.c@1.216 +1 -1 Changes from Dave Mills ChangeSet@1.1251.1.119, 2005-04-07 20:36:24-04:00, stenn@whimsy.udel.edu [Bug 405] and other fixes from Dave Mills ntpd/ntp_loopfilter.c@1.104 +0 -1 Fixes from Dave Mills ntpd/ntp_peer.c@1.74 +1 -1 [Bug 405] Fix from Dave Mills ntpd/ntp_proto.c@1.215 +37 -44 Fixes from Dave Mills ChangeSet@1.1251.1.118, 2005-04-06 23:54:32-04:00, stenn@whimsy.udel.edu Changes from Dave Mills ntpd/ntp_proto.c@1.214 +1 -2 Changes from Dave Mills ChangeSet@1.1251.1.117, 2005-04-06 01:09:48-04:00, stenn@whimsy.udel.edu Changes from Dave Mills ntpd/ntp_peer.c@1.73 +2 -3 Changes from Dave Mills ntpd/ntp_proto.c@1.213 +25 -24 Changes from Dave Mills ChangeSet@1.1251.1.116, 2005-04-04 18:15:45-04:00, stenn@whimsy.udel.edu Changes from Dave Mills include/ntp.h@1.113 +4 -7 Changes from Dave Mills ntpd/ntp_loopfilter.c@1.103 +4 -1 Changes from Dave Mills ntpd/ntp_proto.c@1.212 +1 -0 Changes from Dave Mills ChangeSet@1.1251.1.115, 2005-04-04 00:22:10-04:00, stenn@whimsy.udel.edu Changes from Dave Mills ntpd/ntp_proto.c@1.211 +3 -3 Changes from Dave Mills ChangeSet@1.1251.1.114, 2005-04-03 20:41:23-04:00, stenn@whimsy.udel.edu Changes from Dave Mills include/ntp.h@1.112 +1 -0 Changes from Dave Mills ntpd/ntp_peer.c@1.72 +4 -3 Changes from Dave Mills ntpd/ntp_proto.c@1.210 +98 -93 Changes from Dave Mills ChangeSet@1.1251.25.1, 2005-04-02 19:05:57-05:00, mayer@pogo.udel.edu Use any for the IPv4 join interface for mcast ntpd/ntp_io.c@1.178 +1 -1 Use any for the IPv4 join interface for mcast ChangeSet@1.1251.24.1, 2005-04-02 18:47:52-05:00, stenn@whimsy.udel.edu Changes from Dave Mills include/ntp.h@1.111 +6 -7 Changes from Dave Mills include/ntp_crypto.h@1.35 +3 -2 Changes from Dave Mills include/ntpd.h@1.77 +1 -1 Changes from Dave Mills libntp/statestr.c@1.9 +4 -3 Changes from Dave Mills ntpd/ntp_crypto.c@1.96 +47 -38 Changes from Dave Mills ntpd/ntp_peer.c@1.71 +2 -2 Changes from Dave Mills ntpd/ntp_proto.c@1.209 +49 -81 Changes from Dave Mills ChangeSet@1.1251.1.111, 2005-04-02 18:36:32-05:00, mayer@pogo.udel.edu If unable to create a separate socket for multicast, find a local interface and use that instead of the wildcard sockets ntpd/ntp_io.c@1.177 +46 -25 If unable to create a separate socket for multicast, find a local interface and use that instead of the wildcard sockets ChangeSet@1.1251.1.110, 2005-04-02 03:28:33-05:00, stenn@whimsy.udel.edu Changes from Dave Mills ntpd/ntp_proto.c@1.208 +48 -44 Changes from Dave Mills ChangeSet@1.1251.1.109, 2005-03-31 23:03:22-05:00, stenn@whimsy.udel.edu Changes from Dave Mills include/ntpd.h@1.76 +1 -1 Changes from Dave Mills ntpd/ntp_peer.c@1.70 +7 -5 Changes from Dave Mills ntpd/ntp_proto.c@1.207 +140 -135 Changes from Dave Mills ChangeSet@1.1251.23.1, 2005-03-31 21:57:56-05:00, mayer@pogo.udel.edu Change ignore packet message to only print if debug > 3 ntpd/ntp_io.c@1.176 +1 -1 Change ignore packet message to only print if debug > 3 ChangeSet@1.1251.1.107, 2005-03-31 11:15:14+02:00, root@sonne. Remove quotes from tokens to handle paths with spaces correctly. ntpd/ntp_config.c@1.123 +21 -0 Remove quotes from tokens to handle paths with spaces correctly. ChangeSet@1.1251.1.106, 2005-03-31 11:11:43+02:00, root@sonne. Fixed braces in conditional for OPENSSL. BitKeeper/etc/logging_ok@1.52 +1 -0 Logging to logging@openlogging.org accepted ntpd/ntp_proto.c@1.206 +2 -1 Fixed braces in conditional for OPENSSL. ChangeSet@1.1251.22.2, 2005-03-30 23:41:14-05:00, stenn@whimsy.udel.edu Changes from Dave Mills include/ntp.h@1.108.1.1 +18 -8 Changes from Dave Mills ntpd/ntp_peer.c@1.69 +9 -8 Changes from Dave Mills ntpd/ntp_proto.c@1.203.1.2 +205 -205 Changes from Dave Mills ChangeSet@1.1251.1.104, 2005-03-30 23:07:59-05:00, mayer@pogo.udel.edu Bug #396 Windows-only fix to ignore incoming packets if flag on socket is set ports/winnt/ntpd/ntp_iocompletionport.c@1.14 +1 -1 Bug #396 Windows-only fix to ignore incoming packets if flag on socket is set ChangeSet@1.1251.22.1, 2005-03-27 18:39:02-05:00, stenn@whimsy.udel.edu Changes from Dave Mills ntpd/ntp_proto.c@1.203.1.1 +6 -6 Changes from Dave Mills ChangeSet@1.1251.21.3, 2005-03-27 16:29:59-05:00, mayer@pogo.udel.edu Change in configuration setup prevented multicast packets from being accepted ntpd/ntp_proto.c@1.201.1.1 +17 -16 Change in configuration setup prevented multicast packets from being accepted ChangeSet@1.1251.21.2, 2005-03-27 16:28:44-05:00, mayer@pogo.udel.edu Bug #396: Don't accept broadcast packets if they are not enabled. wildcard socket was accepting them. Bind all sockets but drop any packet arriving on socket not specifically enabled ntpd/ntp_io.c@1.175 +81 -50 Bug #396: Don't accept broadcast packets if they are not enabled. wildcard socket was accepting them. Bind all sockets but drop any packet arriving on socket not specifically enabled ChangeSet@1.1251.21.1, 2005-03-27 16:25:17-05:00, mayer@pogo.udel.edu Added ignore_packets to interface for sockets which will drop all requests include/ntp.h@1.109 +3 -0 Added ignore_packets to interface for sockets which will drop all requests ChangeSet@1.1251.1.102, 2005-03-24 00:54:17-05:00, stenn@whimsy.udel.edu Changes from Dave Mills ntpd/ntp_loopfilter.c@1.102 +1 -2 Changes from Dave Mills ntpd/ntp_proto.c@1.203 +6 -11 Changes from Dave Mills ChangeSet@1.1251.20.1, 2005-03-18 00:43:24-05:00, stenn@whimsy.udel.edu Updates from Dave Mills ntpd/ntp_proto.c@1.202 +15 -15 Updates from Dave Mills ChangeSet@1.1251.1.100, 2005-03-17 15:35:36-05:00, mayer@pogo.udel.edu Bug #396 - Disable wildcards for now to prevent this happening ntpd/ntp_io.c@1.174 +8 -1 Bug #396 - Disable wildcards for now to prevent this happening ChangeSet@1.1251.1.99, 2005-03-15 23:31:42-05:00, stenn@whimsy.udel.edu ntp_proto.c fixes from Dave Mills ntpd/ntp_proto.c@1.201 +111 -116 ntp_proto.c fixes from Dave Mills ChangeSet@1.1251.1.98, 2005-03-15 22:52:55-05:00, stenn@whimsy.udel.edu Only check OpenSSL Major/Minor/Fix/Status, not Patch util/ntp-keygen.c@1.31 +5 -1 Only check OpenSSL Major/Minor/Fix/Status, not Patch ChangeSet@1.1251.19.1, 2005-03-14 19:11:49-05:00, stenn@whimsy.udel.edu Comment fixes from Dave Mills ntpd/ntp_proto.c@1.200 +7 -2 Comment fixes from Dave Mills ChangeSet@1.1251.1.96, 2005-03-14 18:30:20-05:00, mayer@pogo.udel.edu Wrong Macro used should have been PROTO_MULTICAST_ADD instead of PROTO_BROADCLIENT ntpd/ntp_config.c@1.122 +1 -1 Wrong Macro used should have been PROTO_MULTICAST_ADD instead of PROTO_BROADCLIENT ChangeSet@1.1251.1.95, 2005-03-13 17:02:41-05:00, stenn@whimsy.udel.edu Changes from Dave Mills (flash TEST bits changed!) include/ntp.h@1.108 +35 -24 Changes from Dave Mills (flashh TEST bits changed!) include/ntpd.h@1.75 +1 -0 Changes from Dave Mills (flashh TEST bits changed!) ntpd/ntp_control.c@1.77 +3 -1 Changes from Dave Mills (flash TEST bits changed!) ntpd/ntp_crypto.c@1.95 +11 -11 Changes from Dave Mills (flash TEST bits changed!) ntpd/ntp_peer.c@1.68 +6 -18 Changes from Dave Mills (flash TEST bits changed!) ntpd/ntp_proto.c@1.199 +233 -293 Changes from Dave Mills (flash TEST bits changed!) ntpq/ntpq.c@1.55.1.1 +14 -12 Changes from Dave Mills (flash TEST bits changed!) ChangeSet@1.1251.18.1, 2005-03-09 22:23:03-05:00, mayer@tecotoo. Update for UTC information version string - from Heiko Gerstung ports/winnt/scripts/mkver.bat@1.7 +99 -23 Update for UTC information version string - from Heiko Gerstung ChangeSet@1.1251.1.93, 2005-03-09 01:04:51-05:00, stenn@whimsy.udel.edu Lose arbiter debug line. From Dave Mills. ntpd/refclock_arbiter.c@1.11 +0 -2 Lose debug line. From Dave Mills. ChangeSet@1.1251.1.90, 2005-03-08 22:14:49-05:00, mayer@tecotoo. Fix to correctly create version string - from Heiko Gerstung ports/winnt/scripts/mkver.bat@1.6 +265 -50 Fix to correctly create version string - from Heiko Gerstung ChangeSet@1.1251.17.1, 2005-03-07 23:18:40-05:00, mayer@pogo.udel.edu Check for max value of skips before adding ntpd/ntp_io.c@1.169.1.6 +7 -4 Check for max value of skips before adding ChangeSet@1.1271, 2005-03-05 02:03:58-05:00, stenn@pogo.udel.edu cleanup configure.ac@1.366 +0 -33 ChangeSet@1.1251.15.11, 2005-03-05 01:40:18-05:00, stenn@whimsy.udel.edu [Bug 390] Do not run check-layout if cross-compiling configure.ac@1.359.1.8 +46 -33 [Bug 390] Do not run check-layout if cross-compiling ntpdc/Makefile.am@1.23.1.1 +1 -6 [Bug 390] Do not run check-layout if cross-compiling ChangeSet@1.1251.1.88, 2005-03-02 20:52:53-05:00, mayer@tecotoo. Test code ntpd/ntp_io.c@1.171 +1 -1 Test code ChangeSet@1.1178.5.1, 2005-03-02 16:18:07-05:00, stenn@whimsy.udel.edu [Bug 389] Fix from Remi Demis-Courmont, via Loic Minier (http://bugs.debian.org/293793 ntpdate/ntpdate.c@1.47.1.1 +46 -16 [Bug 389] Fix from Remi Demis-Courmont, via Loic Minier (http://bugs.debian.org/293793 ChangeSet@1.1251.15.9, 2005-03-02 15:50:06-05:00, stenn@whimsy.udel.edu Clock filter bugfix from Dave Mills ntpd/ntp_proto.c@1.198 +3 -3 Clock filter bugfix from Dave Mills ChangeSet@1.1251.15.8, 2005-03-02 14:53:27-05:00, mayer@pogo.udel.edu Bug #392 fix group number ntpd/ntpd.c@1.61.1.5 +1 -1 Bug #392 fix group number ChangeSet@1.1251.16.1, 2005-03-02 14:37:49-05:00, mayer@pogo.udel.edu Fix to ignore 0 or less readlengths after the first one ntpd/ntp_io.c@1.169.1.5 +50 -6 Fix to ignore 0 or less readlengths after the first one ChangeSet@1.1251.15.6, 2005-03-01 22:32:42-05:00, stenn@whimsy.udel.edu Changes from Dave Mills include/ntpd.h@1.74 +1 -0 Changes from Dave Mills ntpd/ntp_crypto.c@1.94 +2 -1 Changes from Dave Mills ntpd/ntp_proto.c@1.197 +3 -1 Changes from Dave Mills ntpd/ntp_util.c@1.36 +7 -5 Changes from Dave Mills ntpd/ntpd.c@1.61.1.4 +2 -1 Changes from Dave Mills ntpd/ntpsim.c@1.9 +1 -0 Changes from Dave Mills ChangeSet@1.1251.15.5, 2005-02-28 20:17:40-05:00, mayer@pogo.udel.edu Fixed input_handler loops ntpd/ntp_io.c@1.169.1.4 +29 -38 Fixed input_handler loops ChangeSet@1.1251.15.3, 2005-02-28 13:23:19-05:00, mayer@pogo.udel.edu fixes in input_handler - additional changes required ntpd/ntp_io.c@1.169.1.2 +16 -3 fixes in input_handler - additional changes required ChangeSet@1.1251.15.2, 2005-02-28 13:21:47-05:00, mayer@pogo.udel.edu Bug #392 - using wrong group id for account ntpd/ntpd.c@1.61.1.3 +1 -1 Bug #392 - using wrong group id for account ChangeSet@1.1251.13.3, 2005-02-28 12:52:33-05:00, stenn@whimsy.udel.edu Changes from Dave Mills include/ntp.h@1.107 +1 -1 Changes from Dave Mills ntpd/ntp_config.c@1.121 +1 -1 Changes from Dave Mills ntpd/ntp_io.c@1.167.1.1 +1 -8 Changes from Dave Mills ntpd/ntp_proto.c@1.196 +18 -34 Changes from Dave Mills ntpd/refclock_acts.c@1.21.1.3 +218 -207 Changes from Dave Mills ChangeSet@1.1251.15.1, 2005-02-22 18:10:26-05:00, mayer@pogo.udel.edu Fix loop limits ntpd/ntp_io.c@1.169.1.1 +3 -3 Fix loop limits ChangeSet@1.1251.14.1, 2005-02-21 00:34:25-05:00, mayer@tecotoo. ntp_io.c: Make MAXZEROREADS 1 ntpd/ntp_io.c@1.168.1.1 +4 -4 Make MAXZEROREADS 1 ChangeSet@1.1251.1.86, 2005-02-21 00:26:12-05:00, mayer@pogo.udel.edu Additional changes to input_handler() to correctly break in refclock read loop ntpd/ntp_io.c@1.169 +8 -7 Additional changes to input_handler() to correctly break in refclock read loop ChangeSet@1.1251.13.2, 2005-02-18 23:00:34-05:00, stenn@whimsy.udel.edu changes from Dave Mills libntp/clocktypes.c@1.17 +8 -8 changes from Dave Mills ntpd/ntp_control.c@1.76 +6 -6 changes from Dave Mills ntpd/refclock_acts.c@1.21.1.2 +14 -32 changes from Dave Mills ntpd/refclock_conf.c@1.25 +4 -4 changes from Dave Mills ChangeSet@1.1251.13.1, 2005-02-16 00:37:44-05:00, stenn@whimsy.udel.edu Updates from Dave Mills include/ntp.h@1.106 +6 -3 Updates from Dave Mills include/ntp_config.h@1.32 +3 -1 Updates from Dave Mills ntpd/ntp_config.c@1.120 +9 -0 Updates from Dave Mills ntpd/ntp_proto.c@1.195 +64 -59 Updates from Dave Mills ntpd/ntp_refclock.c@1.64 +2 -6 Updates from Dave Mills ntpd/refclock_acts.c@1.21.1.1 +1 -1 Updates from Dave Mills ntpd/refclock_arbiter.c@1.10 +35 -26 Updates from Dave Mills ntpd/refclock_atom.c@1.52 +12 -23 Updates from Dave Mills ChangeSet@1.1251.1.84, 2005-02-15 22:56:40-05:00, mayer@tecotoo. Make MAXZEROREADS 1 so that the first zero-length read causes code to break and go to next socket ntpd/ntp_io.c@1.168 +1 -1 Make MAXZEROREADS 1 so that the first zero-length read causes code to break and go to next socket ChangeSet@1.1251.12.1, 2005-02-15 19:40:54-05:00, mayer@tecotoo. Refix SMAX to 256 and fix &C0/1 comment - per Greg Dowd's messages ntpd/refclock_acts.c@1.22 +2 -2 Refix SMAX to 256 and fix &C0/1 comment - per Greg Dowd's messages ChangeSet@1.1251.1.82, 2005-02-15 19:31:10-05:00, stenn@whimsy.udel.edu Updates from Dave Mills html/confopt.html@1.29 +3 -2 Updates from Dave Mills html/manyopt.html@1.10 +22 -17 Updates from Dave Mills html/miscopt.html@1.30 +5 -8 Updates from Dave Mills ChangeSet@1.1251.1.81, 2005-02-15 18:09:42-05:00, mayer@pogo.udel.edu Added while look to read the clock until error or number of consecutive 0 len reads exceeds MAXZEROREADS ntpd/ntp_io.c@1.167 +76 -52 Added while look to read the clock until error or number of consecutive 0 len reads exceeds MAXZEROREADS ChangeSet@1.1251.1.80, 2005-02-15 00:18:50-05:00, mayer@tecotoo. Martin Burnicki's fixes to allow Windows to pass command line arguments to a system service ntpd/ntpd.c@1.61.1.2 +3 -1 Martin Burnicki's fixes to allow Windows to pass command line arguments to a system service ports/winnt/ntpd/ntservice.c@1.4 +21 -64 Martin Burnicki's fixes to allow Windows to pass command line arguments to a system service ChangeSet@1.1251.1.79, 2005-02-14 01:15:09-05:00, mayer@tecotoo. Bug #214: Return ISC_FALSE on not equal ntpd/ntp_io.c@1.166 +2 -0 Bug #214: Return ISC_FALSE on not equal ChangeSet@1.1251.1.78, 2005-02-14 00:38:25-05:00, mayer@tecotoo. Bug #214: Use strcasecmp and not stricmp ntpd/ntp_io.c@1.165 +1 -1 Bug #214: Use strcasecmp and not stricmp ports/winnt/include/config.h@1.36 +1 -0 Bug #214: Use strcasecmp and not stricmp ChangeSet@1.1251.1.77, 2005-02-14 00:26:43-05:00, mayer@tecotoo. Bug #214: Allow option on command line to specify specific interface only to be used ntpd/cmd_args.c@1.32 +6 -1 Bug #214: Allow option on command line to specify specific interface only to be used ntpd/ntp_io.c@1.164 +22 -4 Bug #214: Allow option on command line to specify specific interface only to be used ChangeSet@1.1251.1.76, 2005-02-14 00:24:26-05:00, mayer@tecotoo. add stricmp to mapped functions for win32 ports/winnt/include/config.h@1.35 +1 -0 add stricmp to mapped functions ChangeSet@1.1251.1.75, 2005-02-13 00:53:55-05:00, mayer@tecotoo. Clean up code and reorganize input_handler() ntpd/ntp_io.c@1.163 +224 -251 Clean up code and reorganize input_handler() ChangeSet@1.1251.1.74, 2005-02-12 13:29:10-05:00, mayer@pogo.udel.edu Change from &C1 to &C0 for the modem setup ntpd/refclock_acts.c@1.21 +2 -2 Change from &C1 to &C0 for the modem setup ChangeSet@1.1251.1.73, 2005-02-12 13:27:15-05:00, mayer@pogo.udel.edu Remove double loop and continue reading sockets rather than skipping out ntpd/ntp_io.c@1.162 +6 -4 Remove double loop and continue reading sockets rather than skipping out ChangeSet@1.1251.1.72, 2005-02-10 23:28:14-05:00, mayer@tecotoo. Group ID was being obtained incorrectly. See message from Martin Pitt - Debian development ntpd/ntpd.c@1.61.1.1 +1 -1 Group ID was being obtained incorrectly. See message from Martin Pitt - Debian development ChangeSet@1.1251.1.71, 2005-02-10 23:26:16-05:00, mayer@tecotoo. Fix input_handler code to not select again until other I/O read and free buffer if nothing read. (see Bug #341 and messages from cipo) ntpd/ntp_io.c@1.161 +6 -6 Fix input_handler code to not select again until other I/O read and free buffer if nothing read. (see Bug #341 and messages from cipo) ChangeSet@1.1251.1.70, 2005-02-09 00:59:19-05:00, stenn@whimsy.udel.edu Cleanup from Dave Mills ntpd/ntp_config.c@1.119 +1 -1 Cleanup from Dave Mills ntpd/ntp_proto.c@1.194 +1 -1 Cleanup from Dave Mills ntpd/refclock_acts.c@1.20 +1 -1 Cleanup from Dave Mills ChangeSet@1.1268, 2005-02-06 01:41:55-05:00, stenn@pogo.udel.edu ntpdc lint ntpdc/ntpdc.c@1.42 +0 -8 lint ChangeSet@1.1267, 2005-02-06 01:31:47-05:00, stenn@pogo.udel.edu start hacking the ntpdc docs... ntpdc/ntpdc-opts.def@1.2 +2 -5 start hacking the ntpdc docs... ChangeSet@1.1266, 2005-02-06 01:22:40-05:00, stenn@pogo.udel.edu Convert ntpdc to autogen; some cleanup in ntpq BitKeeper/etc/ignore@1.38 +5 -0 added ntpdc-opts.c ntpdc-opts.h ntpdc-opts.menu ntpdc-opts.texi ntpdc.1 ntpdc/Makefile.am@1.24 +20 -4 Convert ntpdc to autogen; some cleanup in ntpq ntpdc/ntpdc-opts.def@1.1 +178 -0 ntpdc/ntpdc-opts.def@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/ntpdc/ntpdc-opts.def ntpdc/ntpdc.c@1.41 +54 -0 Convert ntpdc to autogen; some cleanup in ntpq ntpq/Makefile.am@1.17 +1 -1 Convert ntpdc to autogen; some cleanup in ntpq ChangeSet@1.1251.1.69, 2005-02-05 22:47:46-05:00, stenn@whimsy.udel.edu [Bug 388] Update URLs html/drivers/driver43.html@1.9 +1 -1 [Bug 388] Update URLs ChangeSet@1.1251.1.68, 2005-02-05 22:44:47-05:00, stenn@whimsy.udel.edu Poll updates from Dave Mills. ntpd/ntp_proto.c@1.193 +11 -8 Poll updates from Dave Mills. ChangeSet@1.1251.1.67, 2005-02-03 01:18:23-05:00, stenn@whimsy.udel.edu ntp_config.h, ntp.h, ntp_proto.c, ntp_config.c: Fixes from Dave Mills. In particular, Dave writes: After discovering the situation reported on the newsgroup where misconfigured NTP had the Netgear disease, I put it through some wickedly broken configuration tests and found and fixed a few minor things in ntp-dev (not anything like the PPS oscillator). 1. If a notrust error and iburst are configured, the client did not back off the poll interval. It now does that under all circumstances where the reply is absent or corrupt. 2. An unresponsive server with iburst got hammered with eight messages every poll interval until the unreach counter reaches 12, then backs off sending only a single packet per burst. I changed that to send a burst only the first time after initial start or loss of reach. 3. By popular demand I put in "tos maxdist N", where N is the selection threshold, normally 1. Set N to 16 and the clock will be set upon first receiving a response from any server. Y'know, like SNTP. include/ntp.h@1.105 +2 -1 Fixes from Dave Mills include/ntp_config.h@1.31 +1 -0 Fixes from Dave Mills ntpd/ntp_config.c@1.118 +5 -0 Fixes from Dave Mills ntpd/ntp_proto.c@1.192 +85 -67 Fixes from Dave Mills ChangeSet@1.1251.1.66, 2005-01-23 18:54:35-05:00, mayer@tecotoo. Need reference to address for scope ntpd/ntp_io.c@1.160 +2 -2 Need reference to address for scope ChangeSet@1.1251.1.65, 2005-01-23 14:37:56-05:00, mayer@tecotoo. Wasn't setting scopeid for IPv6 addresses ntpd/ntp_io.c@1.159 +7 -9 Wasn't setting scopeid for IPv6 addresses ChangeSet@1.1251.1.64, 2005-01-18 00:48:54-05:00, mayer@tecotoo. Fix missing parenthesis and remove duplicate CONFIG_CDELAY include/ntp_config.h@1.30 +1 -2 Remove duplicate CONFIG_CDELAY ports/winnt/include/isc/ipv6.h@1.6 +1 -1 Missing parenthesis in Macro ChangeSet@1.1251.11.1, 2005-01-16 19:29:57-05:00, mayer@tecotoo. Added debug code findinterface to see if the connect() fails ntpd/ntp_io.c@1.158 +6 -0 ChangeSet@1.1251.1.62, 2005-01-11 16:15:03-05:00, mayer@pogo.udel.edu Added isc/region.h include/isc/Makefile.am@1.4 +1 -0 Added isc/region.h ChangeSet@1.1251.1.61, 2005-01-11 16:02:59-05:00, mayer@pogo.udel.edu Added isc/buffer.h and isc/netscope.h include/isc/Makefile.am@1.3 +2 -0 Added isc/buffer.h and isc/netscope.h ChangeSet@1.1261, 2005-01-10 04:19:21-05:00, stenn@pogo.udel.edu fixes configure.ac@1.364 +7 -0 disable shared libraries on OSF4.0 m4/libopts.m4@1.3 +2 -5 fix from bkorb ChangeSet@1.1260, 2005-01-09 06:23:02-05:00, stenn@pogo.udel.edu autogen-5.6.5 libopts/Makefile.am@1.2 +1 -1 autogen-5.6.5 libopts/autoopts.c@1.2 +36 -20 autogen-5.6.5 libopts/autoopts.h@1.2 +1 -1 autogen-5.6.5 libopts/boolean.c@1.2 +1 -1 autogen-5.6.5 libopts/compat/compat.h@1.2 +1 -1 autogen-5.6.5 libopts/compat/pathfind.c@1.2 +2 -2 autogen-5.6.5 libopts/enumeration.c@1.2 +1 -1 autogen-5.6.5 libopts/environment.c@1.2 +1 -1 autogen-5.6.5 libopts/genshell.c@1.2 +1 -1 autogen-5.6.5 libopts/genshell.h@1.2 +1 -1 autogen-5.6.5 libopts/libopts.m4@1.2 +2 -29 autogen-5.6.5 libopts/load.c@1.2 +2 -2 autogen-5.6.5 libopts/makeshell.c@1.2 +1 -1 autogen-5.6.5 libopts/numeric.c@1.2 +1 -1 autogen-5.6.5 libopts/options.h@1.2 +3 -3 autogen-5.6.5 libopts/pgusage.c@1.2 +1 -1 autogen-5.6.5 libopts/putshell.c@1.2 +1 -1 autogen-5.6.5 libopts/restore.c@1.2 +1 -1 autogen-5.6.5 libopts/save.c@1.2 +4 -3 autogen-5.6.5 libopts/sort.c@1.2 +1 -1 autogen-5.6.5 libopts/stack.c@1.2 +1 -7 autogen-5.6.5 libopts/streqv.h@1.2 +1 -1 autogen-5.6.5 libopts/streqvcmp.c@1.2 +1 -1 autogen-5.6.5 libopts/usage-txt.h@1.2 +1 -1 autogen-5.6.5 libopts/usage.c@1.2 +1 -1 autogen-5.6.5 libopts/version.c@1.2 +1 -1 autogen-5.6.5 m4/libopts.m4@1.2 +2 -29 autogen-5.6.5 ChangeSet@1.1251.7.31, 2005-01-09 02:05:42-05:00, stenn@whimsy.udel.edu Happy New Year html/copyright.html@1.29 +2 -2 Happy New Year ChangeSet@1.1251.8.12, 2005-01-08 02:23:27-05:00, stenn@whimsy.udel.edu Show more stability data. ntpd/ntp_util.c@1.35 +1 -1 Show more stability data. ChangeSet@1.1251.8.11, 2005-01-08 01:13:32-05:00, stenn@whimsy.udel.edu fencepost error libntp/systime.c@1.32 +1 -1 fencepost error ChangeSet@1.1259, 2005-01-05 16:47:10-05:00, stenn@pogo.udel.edu cleanup configure.ac@1.363 +44 -33 Reorder AC_ARG_WITH to avoid an apparent quoting/redirect problem ntpq/Makefile.am@1.16 +1 -1 Library reorder ChangeSet@1.1251.8.10, 2005-01-05 01:16:04-05:00, stenn@whimsy.udel.edu Don't log 'refclockio structure not found'. From Dave Mills ntpd/ntp_io.c@1.148.1.1 +0 -7 Don't log 'refclockio structure not found'. From Dave Mills ChangeSet@1.1251.1.58, 2005-01-05 00:12:51-05:00, mayer@tecotoo. Rename index to idx ntpd/ntp_io.c@1.156 +4 -4 Rename index to idx ChangeSet@1.1251.1.57, 2005-01-04 21:38:58-05:00, mayer@tecotoo. Remove unnecessary includes ntpd/ntp_io.c@1.155 +7 -17 Remove unnecessary includes ChangeSet@1.1251.1.56, 2005-01-02 21:13:48-05:00, mayer@tecotoo. Remove unnecessary include ntp_if.h ntpd/ntp_io.c@1.154 +0 -1 Remove unnecessary include ntp_if.h ChangeSet@1.1251.1.55, 2005-01-02 18:28:21-05:00, mayer@tecotoo. remove include net/if.h. Some O/S's don't prevent double inclusions. It is already included in isc/net.h libisc/interfaceiter.c@1.15 +0 -1 remove include net/if.h. Some O/S's don't prevent double inclusions. It is already included in isc/net.h ChangeSet@1.1251.1.54, 2005-01-01 22:14:34-05:00, mayer@tecotoo. Remove reference to interface index. Remove isc_log_write references libisc/ifiter_getifaddrs.c@1.4 +0 -1 Remove reference to interface index. Remove isc_log_write references libisc/ifiter_ioctl.c@1.21 +4 -20 Remove reference to interface index. Remove isc_log_write references libisc/ifiter_sysctl.c@1.11 +0 -1 Remove reference to interface index. Remove isc_log_write references ChangeSet@1.1251.1.53, 2005-01-01 18:10:09-05:00, mayer@tecotoo. Updated msg macros include/isc/msgs.h@1.3 +12 -10 Updated msg macros ChangeSet@1.1251.8.9, 2005-01-01 06:17:25-05:00, stenn@pogo.udel.edu Library reorder ntpd/Makefile.am@1.41 +1 -2 Library reorder ChangeSet@1.1251.10.2, 2005-01-01 00:49:42-05:00, mayer@pogo.udel.edu Use macros in buffer routines include/isc/buffer.h@1.2 +1 -1 Use macros in buffer routines ChangeSet@1.1251.10.1, 2005-01-01 00:48:50-05:00, mayer@pogo.udel.edu First upgrade of interfaceiter routines libisc/ifiter_getifaddrs.c@1.1.1.1 +15 -1 First upgrade of interfaceiter routines libisc/ifiter_ioctl.c@1.18.1.1 +393 -157 First upgrade of interfaceiter routines libisc/ifiter_sysctl.c@1.8.1.1 +24 -16 First upgrade of interfaceiter routines libisc/interfaceiter.c@1.12.1.1 +79 -73 First upgrade of interfaceiter routines ChangeSet@1.1251.9.1, 2004-12-30 22:52:08-05:00, mayer@tecotoo. First upgrade of interfaceiter routines libisc/ifiter_getifaddrs.c@1.2 +15 -1 First upgrade of interfaceiter routines libisc/ifiter_ioctl.c@1.19 +393 -157 First upgrade of interfaceiter routines libisc/ifiter_sysctl.c@1.9 +24 -16 First upgrade of interfaceiter routines libisc/interfaceiter.c@1.13 +79 -73 First upgrade of interfaceiter routines ChangeSet@1.1256, 2004-12-30 20:06:10-05:00, stenn@pogo.udel.edu Cleanup Makefile.am@1.50 +3 -3 Fix typos ntpq/Makefile.am@1.15 +1 -1 Missed AM_CPPFLAGS in the merge ChangeSet@1.1255, 2004-12-30 19:47:48-05:00, stenn@pogo.udel.edu cleanup BitKeeper/deleted/.del-Makefile.in~783ae447256d94af@1.2 +0 -0 Delete: libopts/Makefile.in BitKeeper/etc/ignore@1.37 +1 -0 added ntpq/ntpq.1 BitKeeper/etc/ignore@1.36 +5 -0 added ltmain.sh ntpq/ntpq-opts.c ntpq/ntpq-opts.h ntpq/ntpq-opts.menu ntpq/ntpq-opts.texi configure.ac@1.362 +0 -1 Lint removal ntpq/Makefile.am@1.14 +0 -1 Cleanup ChangeSet@1.1253, 2004-12-30 17:53:32-05:00, stenn@pogo.udel.edu AutoOpts conversion - starting with ntpq Makefile.am@1.49 +8 -1 AutoOpts conversion libopts/COPYING.lgpl@1.1 +504 -0 libopts/COPYING.lgpl@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/COPYING.lgpl libopts/COPYING.mbsd@1.1 +26 -0 libopts/COPYING.mbsd@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/COPYING.mbsd libopts/MakeDefs.inc@1.1 +5 -0 libopts/MakeDefs.inc@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/MakeDefs.inc libopts/Makefile.am@1.1 +11 -0 libopts/Makefile.am@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/Makefile.am libopts/Makefile.in@1.1 +496 -0 libopts/Makefile.in@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/Makefile.in libopts/README@1.1 +89 -0 libopts/README@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/README libopts/autoopts.c@1.1 +1136 -0 libopts/autoopts.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/autoopts.c libopts/autoopts.h@1.1 +322 -0 libopts/autoopts.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/autoopts.h libopts/boolean.c@1.1 +104 -0 libopts/boolean.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/boolean.c libopts/compat/compat.h@1.1 +265 -0 libopts/compat/compat.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/compat/compat.h libopts/compat/pathfind.c@1.1 +278 -0 libopts/compat/pathfind.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/compat/pathfind.c libopts/enumeration.c@1.1 +448 -0 libopts/enumeration.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/enumeration.c libopts/environment.c@1.1 +264 -0 libopts/environment.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/environment.c libopts/genshell.c@1.1 +295 -0 libopts/genshell.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/genshell.c libopts/genshell.h@1.1 +122 -0 libopts/genshell.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/genshell.h libopts/libopts.c@1.1 +25 -0 libopts/libopts.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts.c libopts/libopts.m4@1.1 +395 -0 libopts/libopts.m4@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts.m4 libopts/load.c@1.1 +553 -0 libopts/load.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/load.c libopts/makeshell.c@1.1 +1096 -0 libopts/makeshell.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/makeshell.c libopts/numeric.c@1.1 +96 -0 libopts/numeric.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/numeric.c libopts/options.h@1.1 +436 -0 libopts/options.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/options.h libopts/pgusage.c@1.1 +156 -0 libopts/pgusage.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/pgusage.c libopts/putshell.c@1.1 +326 -0 libopts/putshell.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/putshell.c libopts/restore.c@1.1 +173 -0 libopts/restore.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/restore.c libopts/save.c@1.1 +478 -0 libopts/save.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/save.c libopts/sort.c@1.1 +357 -0 libopts/sort.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/sort.c libopts/stack.c@1.1 +238 -0 libopts/stack.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/stack.c libopts/streqv.h@1.1 +115 -0 libopts/streqv.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/streqv.h libopts/streqvcmp.c@1.1 +196 -0 libopts/streqvcmp.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/streqvcmp.c libopts/tokenize.c@1.1 +313 -0 libopts/tokenize.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/tokenize.c libopts/tokenize.h@1.1 +40 -0 libopts/tokenize.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/tokenize.h libopts/usage-txt.h@1.1 +503 -0 libopts/usage-txt.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/usage-txt.h libopts/usage.c@1.1 +646 -0 libopts/usage.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/usage.c libopts/version.c@1.1 +176 -0 libopts/version.c@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/version.c m4/libopts.m4@1.1 +395 -0 m4/libopts.m4@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/m4/libopts.m4 ntpq/Makefile.am@1.11.1.1 +18 -4 AutoOpts conversion ntpq/ntpq-opts.def@1.1 +156 -0 ntpq/ntpq-opts.def@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev-ag/ntpq/ntpq-opts.def ntpq/ntpq.c@1.49.1.1 +48 -8 AutoOpts conversion ChangeSet@1.1251.8.8, 2004-12-28 00:46:27-05:00, stenn@whimsy.udel.edu cleanup from Dave Mills ntpd/refclock_acts.c@1.19 +3 -1 file descriptor close cleanup from Dave Mills ntpd/refclock_atom.c@1.51 +2 -2 corner case cleanup from Dave Mills ntpd/refclock_wwv.c@1.53 +9 -25 wwv cleanup from Dave Mills ChangeSet@1.1251.8.7, 2004-12-27 06:15:13-05:00, stenn@whimsy.udel.edu Added ISC_PLATFORM_{NEEDPORTT,FIXIN6ISADDR} for Danny configure.ac@1.359.1.7 +36 -2 Added ISC_PLATFORM_{NEEDPORTT,FIXIN6ISADDR} for Danny ChangeSet@1.1251.1.49, 2004-12-24 18:25:12-05:00, mayer@tecotoo. IPv6 changes libisc/netaddr.c@1.2 +2 -0 IPv6 changes libisc/sockaddr.c@1.2 +2 -0 IPv6 changes ChangeSet@1.1251.1.48, 2004-12-24 18:21:09-05:00, mayer@tecotoo. IPv6 changes libisc/interfaceiter.c@1.12 +2 -0 IPv6 changes ChangeSet@1.1251.1.47, 2004-12-24 18:16:16-05:00, mayer@tecotoo. IPv6 changes again include/isc/ipv6.h@1.6 +2 -2 IPv6 changes again ChangeSet@1.1251.1.46, 2004-12-24 18:10:50-05:00, mayer@tecotoo. IPv6 changes include/isc/ipv6.h@1.5 +12 -12 IPv6 changes ChangeSet@1.1251.1.45, 2004-12-23 22:59:14-05:00, mayer@tecotoo. Alternate method of getting interface addresses libisc/ifiter_getifaddrs.c@1.1 +178 -0 Alternate method of getting interface addresses libisc/ifiter_getifaddrs.c@1.0 +0 -0 BitKeeper file H:/ntpbk/ntp-dev/libisc/ifiter_getifaddrs.c ChangeSet@1.1251.1.44, 2004-12-23 22:41:22-05:00, mayer@tecotoo. Added new files to build and moved some macros include/ntp_machine.h@1.18 +0 -2 Moved function defines for Win32 from ntp_machine.h to winnt/config.h libntp/Makefile.am@1.31 +2 -1 Added new files to build ports/winnt/include/config.h@1.34 +8 -2 Moved function defines for Win32 from ntp_machine.h to winnt/config.h ports/winnt/libntp/libntp.dsp@1.24 +20 -0 Added new files to build ChangeSet@1.1251.1.43, 2004-12-23 15:24:48-05:00, mayer@pogo.udel.edu Miscellaneous compiler errors from port of BIND 9 code include/isc/net.h@1.6 +2 -3 missing #endifs libisc/net.c@1.5 +4 -16 Don't use the catalog like BIND 9 ChangeSet@1.1251.1.41, 2004-12-23 00:16:06-05:00, mayer@tecotoo. ports from BIND 9.3.0 and reintegrated into ntp libisc xode include/isc/buffer.h@1.1 +800 -0 isc_buffer header file include/isc/buffer.h@1.0 +0 -0 BitKeeper file H:/ntpbk/ntp-dev/include/isc/buffer.h include/isc/net.h@1.5 +56 -10 ports from BIND 9.3.0 and reintegrated into ntp libisc code include/isc/netaddr.h@1.4 +22 -12 ports from BIND 9.3.0 and reintegrated into ntp libisc code include/isc/netscope.h@1.1 +40 -0 isc_netscope header file include/isc/netscope.h@1.0 +0 -0 BitKeeper file H:/ntpbk/ntp-dev/include/isc/netscope.h include/isc/region.h@1.1 +95 -0 isc_region header file include/isc/region.h@1.0 +0 -0 BitKeeper file H:/ntpbk/ntp-dev/include/isc/region.h include/isc/result.h@1.3 +14 -11 ports from BIND 9.3.0 and reintegrated into ntp libisc code include/isc/sockaddr.h@1.3 +6 -0 ports from BIND 9.3.0 and reintegrated into ntp libisc code libisc/net.c@1.4 +210 -10 ports from BIND 9.3.0 and reintegrated into ntp libisc code libisc/netaddr.c@1.1 +357 -0 isc_netaddr functions libisc/netaddr.c@1.0 +0 -0 BitKeeper file H:/ntpbk/ntp-dev/libisc/netaddr.c libisc/netscope.c@1.1 +74 -0 libisc/netscope.c@1.0 +0 -0 BitKeeper file H:/ntpbk/ntp-dev/libisc/netscope.c libisc/sockaddr.c@1.1 +474 -0 isc_sockaddr functions libisc/sockaddr.c@1.0 +0 -0 BitKeeper file H:/ntpbk/ntp-dev/libisc/sockaddr.c ports/winnt/include/isc/ipv6.h@1.5 +16 -12 ports from BIND 9.3.0 and reintegrated into ntp libisc code ports/winnt/include/isc/net.h@1.5 +60 -12 ports from BIND 9.3.0 and reintegrated into ntp libisc code ports/winnt/libisc/net.c@1.6 +206 -10 ports from BIND 9.3.0 and reintegrated into ntp libisc code ChangeSet@1.1251.8.6, 2004-12-22 00:35:41-05:00, stenn@whimsy.udel.edu unused variable cleanup ntpd/cmd_args.c@1.31 +0 -1 unused variable cleanup ChangeSet@1.1251.8.5, 2004-12-20 21:34:16-05:00, stenn@whimsy.udel.edu wwv cleanup from Dave Mills ntpd/refclock_wwv.c@1.52 +6 -5 wwv cleanup from Dave Mills ChangeSet@1.1251.8.4, 2004-12-20 21:01:08-05:00, stenn@whimsy.udel.edu If "prefer" is set, only huffpuff to the preferred peer. From Dave Mills. ntpd/ntp_loopfilter.c@1.101 +5 -1 If "prefer" is set, only huffpuff to the preferred peer. From Dave Mills. ChangeSet@1.1251.8.3, 2004-12-20 20:54:34-05:00, stenn@whimsy.udel.edu Lose -m from ntpd.html html/ntpd.html@1.35 +6 -6 Lose -m from ntpd.html ChangeSet@1.1251.8.2, 2004-12-20 20:41:57-05:00, stenn@whimsy.udel.edu [Bug 374] Always declare atom_shutdown(). ntpd/refclock_atom.c@1.50 +1 -1 [Bug 374] Always declare atom_shutdown(). ChangeSet@1.1251.8.1, 2004-12-20 20:36:18-05:00, stenn@whimsy.udel.edu [Bug 378]: Added macros for Danny configure.ac@1.359.1.6 +84 -1 [Bug 378]: Added macros for Danny ChangeSet@1.1251.7.26, 2004-12-18 04:55:09+00:00, abe@pogo.udel.edu BitKeeper/etc/logging_ok@1.51 +1 -0 Logging to logging@openlogging.org accepted html/drivers/driver40.html@1.12 +46 -4 ntpd/refclock_jjy.c@1.12 +275 -21 ChangeSet@1.1251.7.25, 2004-12-17 04:49:29-05:00, stenn@whimsy.udel.edu atom cleanup from Dave Mills ntpd/refclock_atom.c@1.49 +52 -18 atom cleanup from Dave Mills ChangeSet@1.1251.7.24, 2004-12-17 04:28:23-05:00, stenn@whimsy.udel.edu cleanup ntpdc/ntpdc.c@1.40 +2 -2 cleanup ntpq/ntpq.c@1.55 +2 -4 cleanup ChangeSet@1.1178.4.1, 2004-12-17 03:49:20-05:00, stenn@whimsy.udel.edu [Bug 373] ntpq and ntpdv help menu improvement, from Charles Maier ntpdc/ntpdc.c@1.33.1.1 +33 -37 [Bug 373] ntpq and ntpdv help menu improvement ntpq/ntpq.c@1.48.1.1 +33 -33 [Bug 373] ntpq and ntpdv help menu improvement ChangeSet@1.1251.7.22, 2004-12-17 03:28:27-05:00, stenn@whimsy.udel.edu [Bug 368] Use config.h for jitter.c util/jitter.c@1.7 +4 -0 [Bug 368] Use config.h ChangeSet@1.1251.7.21, 2004-12-17 00:15:55-05:00, stenn@whimsy.udel.edu Lose -m ntpd/cmd_args.c@1.30 +3 -11 Lose -m ChangeSet@1.1251.7.20, 2004-12-16 00:38:18-05:00, stenn@whimsy.udel.edu [Bug 367]: Bump CONNECT to 20, fix typo accessing sys_phone[]. ntpd/refclock_acts.c@1.18 +2 -2 [Bug 367]: Bump CONNECT to 20, fix typo accessing sys_phone[]. ChangeSet@1.1251.7.19, 2004-12-14 00:09:04-05:00, stenn@whimsy.udel.edu netdb.h isnow handled by ntp_rcf2553.h libntp/ntp_rfc2553.c@1.21 +0 -1 netdb.h isnow handled by ntp_rcf2553.h ChangeSet@1.1251.7.18, 2004-12-13 13:53:13-05:00, stenn@whimsy.udel.edu refclock_atom fixes. ntpd/refclock_atom.c@1.48 +28 -25 Call atom_shutdown at shutdown time (Dave Mills). Isolate HAVE_PPSAPI-specific code in atom_shutdown (Dave Mills). [Bug 366] Fix uninitialized pointer (Dave Mills, Martin Burnicki). ChangeSet@1.1251.7.17, 2004-12-13 02:11:09-05:00, stenn@whimsy.udel.edu more wwv cleanup from Dave Mills. ntpd/refclock_wwv.c@1.51 +11 -17 more wwv cleanup from Dave Mills. ChangeSet@1.1251.7.16, 2004-12-11 22:42:45-05:00, stenn@whimsy.udel.edu New pps features from Dave Mills. html/drivers/driver22.html@1.16 +10 -7 documentation updates ntpd/refclock_atom.c@1.47 +42 -35 flag2 controls the on-time edge (assert/clear). flag3 enables or disables kernel PPS support. ppsapi-timepps header cleanup. ChangeSet@1.1251.7.15, 2004-12-11 22:28:49-05:00, stenn@whimsy.udel.edu ppsapi header cleanup ntpd/refclock_jupiter.c@1.19 +3 -1 ppsapi header cleanup ntpd/refclock_mx4200.c@1.21 +3 -7 ppsapi header cleanup ntpd/refclock_nmea.c@1.25 +1 -7 ppsapi header cleanup ntpd/refclock_oncore.c@1.53 +3 -1 ppsapi header cleanup ntpd/refclock_parse.c@1.28 +3 -1 ppsapi header cleanup ntpd/refclock_ripencc.c@1.6 +3 -1 ppsapi header cleanup ChangeSet@1.1251.7.14, 2004-12-11 22:22:10-05:00, stenn@whimsy.udel.edu Lose the "pps" stuff from ntp.conf. From Dave Mills. include/ntp_config.h@1.29 +1 -8 Lose the PPS config stuff. ntpd/ntp_config.c@1.117 +0 -1 Lose the "pps" configuration stuff. ChangeSet@1.1251.7.13, 2004-12-10 23:33:03-05:00, stenn@whimsy.udel.edu More WWV cleanup from Dave Mills. ntpd/refclock_wwv.c@1.50 +2 -2 More wwv cleanup from Dave Mills. ChangeSet@1.1251.7.12, 2004-12-10 18:03:43-05:00, stenn@whimsy.udel.edu refclock_wwv.c fixes from Dave Mills ntpd/refclock_wwv.c@1.49 +85 -129 refclock_wwv.c fixes from Dave Mills ChangeSet@1.1251.7.11, 2004-12-10 18:00:32-05:00, stenn@whimsy.udel.edu FIXPOLL fix from Dave Mills ntpd/ntp_proto.c@1.191 +4 -3 FIXPOLL fix from Dave Mills ChangeSet@1.1251.7.10, 2004-12-09 14:36:18-05:00, stenn@whimsy.udel.edu cleanup configure.ac@1.359.1.5 +2 -2 cleanup ChangeSet@1.1251.7.9, 2004-12-08 22:09:06-05:00, stenn@whimsy.udel.edu [Bug 368] net/if.h needs sys/socket.h configure.ac@1.359.1.4 +2 -0 [Bug 368] net/if.h needs sys/socket.h ChangeSet@1.1251.7.8, 2004-12-08 21:49:05-05:00, stenn@whimsy.udel.edu [Bug 368]: Distribute jitter.h, provide missing stdlib.h, fix LDADD util/Makefile.am@1.25 +3 -0 [Bug 368]: Distribute jitter.h, provide missing stdlib.h, fix LDADD util/jitter.c@1.6 +5 -4 [Bug 368]: Distribute jitter.h, provide missing stdlib.h, fix LDADD ChangeSet@1.1251.1.39, 2004-12-07 20:31:52-05:00, mayer@tecotoo. Renable wildcard for testing ntpd/ntp_io.c@1.153 +2 -1 Renable wildcard for testing ChangeSet@1.1251.1.38, 2004-12-07 19:44:54-05:00, mayer@tecotoo. Add debugging detail for adding mcast group membership- error fix ntpd/ntp_io.c@1.152 +0 -1 Add debugging detail for adding mcast group membership- error fix ChangeSet@1.1251.1.37, 2004-12-07 19:40:34-05:00, mayer@tecotoo. Add debugging detail for adding mcast group membership ntpd/ntp_io.c@1.151 +11 -6 Add debugging detail for adding mcast group membership ChangeSet@1.1251.7.7, 2004-12-06 14:07:32-05:00, stenn@whimsy.udel.edu [Bug 366] Distribute the ppsapi_timepps.h header ntpd/Makefile.am@1.40 +1 -0 [Bug 366] Distribute the ppsapi_timepps.h header ChangeSet@1.1251.7.6, 2004-12-06 03:51:05-05:00, stenn@whimsy.udel.edu timepps.h header cleanup configure.ac@1.359.1.3 +1 -0 timepps.h header cleanup ChangeSet@1.1251.7.5, 2004-12-06 03:41:48-05:00, stenn@whimsy.udel.edu timepps.h header cleanup configure.ac@1.359.1.2 +12 -6 timepps.h header cleanup ntpd/ppsapi_timepps.h@1.1 +26 -0 ntpd/ppsapi_timepps.h@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/ntpd/ppsapi_timepps.h ntpd/refclock_jupiter.c@1.18 +1 -9 timepps.h header cleanup ntpd/refclock_oncore.c@1.52 +1 -30 timepps.h header cleanup ntpd/refclock_parse.c@1.27 +1 -30 timepps.h header cleanup ntpd/refclock_ripencc.c@1.5 +1 -7 timepps.h header cleanup ChangeSet@1.1251.7.4, 2004-12-05 23:38:24-05:00, stenn@whimsy.udel.edu WWV improvements from Dave Mills. html/drivers/driver36.html@1.24 +80 -67 WWV improvements from Dave Mills. ntpd/refclock_wwv.c@1.48 +155 -103 WWV improvements from Dave Mills. ChangeSet@1.1251.7.3, 2004-12-05 23:33:36-05:00, stenn@whimsy.udel.edu [Bug 357] Fixed and additional improvements from Dave Mills html/drivers/driver18.html@1.13 +2 -2 [Bug 357] Fixed and additional improvements from Dave Mills ChangeSet@1.1251.7.2, 2004-12-05 21:12:40-05:00, stenn@whimsy.udel.edu [Bug 357] Fixed and additional improvements from Dave Mills html/miscopt.html@1.29 +3 -2 [Bug 357] Fixed and additional improvements from Dave Mills ChangeSet@1.1251.7.1, 2004-12-05 21:06:26-05:00, stenn@whimsy.udel.edu [Bug 357] Fixed and additional improvements from Dave Mills include/ntpd.h@1.73 +1 -1 [Bug 357] Fixed and additional improvements from Dave Mills ntpd/ntp_config.c@1.116 +7 -7 [Bug 357] Fixed and additional improvements from Dave Mills ntpd/refclock_acts.c@1.17 +11 -9 [Bug 357] Fixed and additional improvements from Dave Mills ChangeSet@1.1251.1.36, 2004-12-03 22:36:37-05:00, mayer@tecotoo. Undefine UDP_WILDCARD_DELIVERY for testing ntpd/ntp_io.c@1.150 +5 -5 Undefine UDP_WILDCARD_DELIVERY for testing ChangeSet@1.1251.1.35, 2004-12-03 22:29:34-05:00, mayer@tecotoo. Undefine UDP_WILDCARD_DELIVERY for testing ntpd/ntp_io.c@1.149 +5 -0 Undefine UDP_WILDCARD_DELIVERY for testing ChangeSet@1.1251.1.34, 2004-12-02 20:58:35-05:00, mayer@tecotoo. Add info on cast_flags in newpeer ntpd/ntp_peer.c@1.67 +5 -0 Add info on cast_flags in newpeer ChangeSet@1.1251.1.33, 2004-11-30 05:20:17-05:00, stenn@pogo.udel.edu netdb.h cleanup include/ntp_fp.h@1.12 +1 -0 netdb.h cleanup include/ntp_rfc2553.h@1.27 +2 -0 netdb.h cleanup libntp/decodenetnum.c@1.6 +0 -1 netdb.h cleanup libntp/numtohost.c@1.3 +0 -1 netdb.h cleanup libntp/socktoa.c@1.8 +0 -1 netdb.h cleanup libntp/socktohost.c@1.5 +0 -1 netdb.h cleanup ntpd/ntp_config.c@1.115 +0 -2 netdb.h cleanup ntpd/ntp_intres.c@1.39 +0 -2 netdb.h cleanup ntpd/ntp_resolver.c@1.18 +0 -1 netdb.h cleanup ntpd/refclock_nmea.c@1.24 +0 -2 netdb.h cleanup ntpdate/ntpdate.c@1.50 +0 -1 netdb.h cleanup ntpdate/ntptimeset.c@1.12 +0 -1 netdb.h cleanup ntpdc/ntpdc.c@1.38 +0 -1 netdb.h cleanup ntpdc/ntpdc_ops.c@1.38 +0 -1 netdb.h cleanup ntpq/ntpq.c@1.53 +0 -1 netdb.h cleanup ntpq/ntpq_ops.c@1.20.1.2 +0 -1 netdb.h cleanup ChangeSet@1.1251.6.1, 2004-11-29 22:45:56-05:00, stenn@pogo.udel.edu findinterface() and findbcastinterf() should ignore wildcard sockets. From Danny Mayer. ntpd/ntp_io.c@1.148 +2 -2 findinterface() and findbcastinterf() should ignore wildcard sockets. From Danny Mayer. ChangeSet@1.1251.5.1, 2004-11-29 22:27:18-05:00, mayer@tecotoo. Fix winioctl warning messages ports/winnt/ntpd/hopf_PCI_io.c@1.6 +5 -4 Fix winioctl warning messages ChangeSet@1.1251.1.30, 2004-11-29 01:09:27-05:00, stenn@whimsy.udel.edu FIXPOLL changes and cleanup from Dave Mills include/ntp.h@1.104 +1 -0 FIXPOLL changes and cleanup from Dave Mills ntpd/ntp_peer.c@1.66 +1 -2 FIXPOLL changes and cleanup from Dave Mills ntpd/ntp_proto.c@1.190 +2 -6 FIXPOLL changes and cleanup from Dave Mills ntpd/ntp_refclock.c@1.63 +1 -1 FIXPOLL changes and cleanup from Dave Mills ntpd/refclock_acts.c@1.16 +1 -0 FIXPOLL changes and cleanup from Dave Mills ntpd/refclock_arbiter.c@1.9 +48 -33 FIXPOLL changes and cleanup from Dave Mills ntpd/refclock_atom.c@1.46 +36 -58 FIXPOLL changes and cleanup from Dave Mills ntpd/refclock_wwv.c@1.47 +145 -139 FIXPOLL changes and cleanup from Dave Mills ntpd/refclock_wwvb.c@1.14 +50 -28 FIXPOLL changes and cleanup from Dave Mills ChangeSet@1.1251.1.29, 2004-11-29 00:45:58-05:00, stenn@whimsy.udel.edu [Bug 363] ntpdate: use -1 to represent an invalid fd (from Rainer Weikusat) ntpdate/ntpdate.c@1.49 +2 -2 [Bug 363] ntpdate: use -1 to represent an invalid fd (from Rainer Weikusat) ChangeSet@1.1251.1.28, 2004-11-28 03:35:01-05:00, stenn@whimsy.udel.edu [Bug 363] ntpdate: use -1 to represent an invalid fd. Fix from Rainer Weikusat. ntpdate/ntpdate.c@1.48 +2 -2 [Bug 363] ntpdate: use -1 to represent an invalid fd ChangeSet@1.1251.1.27, 2004-11-21 21:33:09-05:00, stenn@whimsy.udel.edu [Bug 349] Patches from Takao Abe html/drivers/driver40.html@1.11 +6 -4 [Bug 349] Patches from Takao Abe ntpd/refclock_jjy.c@1.11 +57 -15 [Bug 349] Patches from Takao Abe ChangeSet@1.1251.1.26, 2004-11-21 05:31:43-05:00, stenn@pogo.udel.edu lint ntpd/refclock_parse.c@1.26 +2 -2 lint ChangeSet@1.1251.1.25, 2004-11-21 05:23:35-05:00, stenn@whimsy.udel.edu Stuff from Dave Mills libntp/icom.c@1.9 +1 -0 cleanup ntpd/refclock_wwv.c@1.46 +159 -148 Fixes from Dave Mills ntpd/refclock_wwv.c@1.45 +90 -93 lint ChangeSet@1.1251.1.24, 2004-11-21 04:26:47-05:00, stenn@whimsy.udel.edu [Bug 359] Fix qsort first-arg casting ntpd/ntp_refclock.c@1.62 +7 -2 [Bug 359] Fix qsort first-arg casting ntpd/refclock_msfees.c@1.11 +7 -1 [Bug 359] Fix qsort first-arg casting util/hist.c@1.6 +7 -1 [Bug 359] Fix qsort first-arg casting ChangeSet@1.1251.1.23, 2004-11-21 03:55:29-05:00, stenn@whimsy.udel.edu Lint. ntpd/refclock_mx4200.c@1.20 +3 -3 lint ChangeSet@1.1251.1.22, 2004-11-19 21:44:19-05:00, stenn@www.ntp.org qsort cast cleanup ntpdc/ntpdc.c@1.37 +4 -6 qsort cast cleanup ntpq/ntpq.c@1.52 +4 -6 qsort cast cleanup ChangeSet@1.1251.1.21, 2004-11-19 04:21:49-05:00, stenn@whimsy.udel.edu refclock_parse.c needs ntp_string.h now. ntpd/refclock_parse.c@1.25 +1 -0 refclock_parse.c needs ntp_string.h now. ChangeSet@1.1251.4.1, 2004-11-19 03:04:35-05:00, stenn@whimsy.udel.edu [Bug 341] Patches from Frank Kardel html/build/hints/parse@1.4 +1 -1 [Bug 341] Patches from Frank Kardel html/drivers/driver8.html@1.15 +306 -133 [Bug 341] Patches from Frank Kardel html/parsenew.html@1.9 +1 -1 [Bug 341] Patches from Frank Kardel include/ascii.h@1.3 +34 -2 [Bug 341] Patches from Frank Kardel include/binio.h@1.3 +34 -2 [Bug 341] Patches from Frank Kardel include/ieee754io.h@1.3 +34 -2 [Bug 341] Patches from Frank Kardel include/mbg_gps166.h@1.3 +33 -3 [Bug 341] Patches from Frank Kardel include/parse.h@1.5 +34 -11 [Bug 341] Patches from Frank Kardel include/parse_conf.h@1.3 +29 -9 [Bug 341] Patches from Frank Kardel include/trimble.h@1.3 +34 -2 [Bug 341] Patches from Frank Kardel kernel/chuinit.c@1.3 +0 -2 [Bug 341] Patches from Frank Kardel kernel/clkinit.c@1.3 +0 -2 [Bug 341] Patches from Frank Kardel kernel/sys/parsestreams.h@1.5 +1 -1 [Bug 341] Patches from Frank Kardel libntp/binio.c@1.4 +29 -2 [Bug 341] Patches from Frank Kardel libntp/buftvtots.c@1.4 +12 -83 [Bug 341] Patches from Frank Kardel libntp/gpstolfp.c@1.6 +34 -2 [Bug 341] Patches from Frank Kardel libntp/ieee754io.c@1.6 +34 -2 [Bug 341] Patches from Frank Kardel libntp/mfp_mul.c@1.4 +34 -2 [Bug 341] Patches from Frank Kardel libntp/mktime.c@1.8 +0 -1 [Bug 341] Patches from Frank Kardel libparse/README@1.3 +2 -2 [Bug 341] Patches from Frank Kardel libparse/clk_computime.c@1.7 +32 -9 [Bug 341] Patches from Frank Kardel libparse/clk_dcf7000.c@1.7 +31 -8 [Bug 341] Patches from Frank Kardel libparse/clk_hopf6021.c@1.7 +5 -2 [Bug 341] Patches from Frank Kardel libparse/clk_meinberg.c@1.7 +31 -8 [Bug 341] Patches from Frank Kardel libparse/clk_rawdcf.c@1.9 +31 -8 [Bug 341] Patches from Frank Kardel libparse/clk_rcc8000.c@1.7 +5 -2 [Bug 341] Patches from Frank Kardel libparse/clk_schmid.c@1.7 +32 -8 [Bug 341] Patches from Frank Kardel libparse/clk_trimtaip.c@1.7 +33 -2 [Bug 341] Patches from Frank Kardel libparse/clk_trimtsip.c@1.7 +35 -3 [Bug 341] Patches from Frank Kardel libparse/clk_varitext.c@1.6 +40 -8 [Bug 341] Patches from Frank Kardel libparse/clk_wharton.c@1.5 +2 -2 [Bug 341] Patches from Frank Kardel libparse/data_mbg.c@1.4 +32 -2 [Bug 341] Patches from Frank Kardel libparse/info_trimble.c@1.3 +0 -2 [Bug 341] Patches from Frank Kardel libparse/parse.c@1.9 +35 -9 [Bug 341] Patches from Frank Kardel libparse/parse_conf.c@1.8 +31 -8 [Bug 341] Patches from Frank Kardel libparse/parsesolaris.c@1.5 +36 -12 [Bug 341] Patches from Frank Kardel libparse/parsestreams.c@1.5 +37 -11 [Bug 341] Patches from Frank Kardel libparse/trim_info.c@1.3 +33 -2 [Bug 341] Patches from Frank Kardel ntpd/ntp_config.c@1.114 +1 -1 [Bug 341] Patches from Frank Kardel ntpd/ntp_refclock.c@1.61 +1 -1 [Bug 341] Patches from Frank Kardel ntpd/refclock_atom.c@1.45 +1 -1 [Bug 341] Patches from Frank Kardel ntpd/refclock_parse.c@1.24 +513 -121 [Bug 341] Patches from Frank Kardel parseutil/dcfd.c@1.14 +37 -11 [Bug 341] Patches from Frank Kardel parseutil/testdcf.c@1.5 +38 -11 [Bug 341] Patches from Frank Kardel scripts/monitoring/lr.pl@1.4 +12 -12 [Bug 341] Patches from Frank Kardel scripts/monitoring/ntploopwatch@1.3 +31 -31 [Bug 341] Patches from Frank Kardel ChangeSet@1.1251.1.19, 2004-11-18 23:20:44-05:00, mayer@tecotoo. Miscellaneous Win32 fixes ntpdc/ntpdc.c@1.36 +4 -1 Win32 uses a slightly different prototype for qsort ntpq/ntpq.c@1.51 +4 -1 Win32 uses a slightly different prototype for qsort ports/winnt/include/config.h@1.33 +12 -18 Code cleanup - eliminate duplicate entries ports/winnt/ntpd/ntservice.c@1.3 +3 -3 Use main instead of ntpmain for entry ChangeSet@1.1251.3.3, 2004-11-16 22:16:52-05:00, mayer@tecotoo. Recommit fix ntpd/cmd_args.c@1.28 +1 -1 Recommit fix ntpd/cmd_args.c@1.27 +0 -1 Remove obsolete windows specific code ChangeSet@1.1251.3.2, 2004-11-16 00:13:54-05:00, mayer@tecotoo. cmd_args.c, cmd_Args.c: Remove obsolete windows specific code ntpd/cmd_args.c@1.26 +0 -0 Remove obsolete windows specific code ntpd/cmd_Args.c@1.25 +0 -0 Remove obsolete windows specific code ntpd/cmd_args.c@1.24 +0 -7 Remove obsolete windows specific code ChangeSet@1.1251.1.17, 2004-11-15 23:32:18-05:00, mayer@pogo.udel.edu John Hays burst mode fix for multicast ntpd/ntp_proto.c@1.187.1.1 +2 -0 John Hays burst mode fix for multicast ChangeSet@1.1251.3.1, 2004-11-15 23:24:51-05:00, mayer@tecotoo. John Hays burst mode fix for multicast ntpd/ntp_proto.c@1.188 +2 -0 John Hays burst mode fix for multicast ChangeSet@1.1251.1.16, 2004-11-15 23:14:53-05:00, mayer@pogo.udel.edu Force the update. Refuses on Windows. Remove NoWinService code ntpd/cmd_args.c@1.23.1.1 +0 -8 Force the update. Refuses on Windows. Remove NoWinService code ChangeSet@1.1251.1.15, 2004-11-15 20:45:45-05:00, mayer@tecotoo. findbcastinter should be using INT_BCASTOPEN flag ntpd/ntp_io.c@1.147 +2 -2 findbcastinter should be using INT_BCASTOPEN flag ChangeSet@1.1251.1.14, 2004-11-14 22:42:23-05:00, mayer@tecotoo. Added debugging code to track multicast issues ntpd/ntp_io.c@1.146 +15 -1 Added debugging code to track multicast issues ntpd/ntp_peer.c@1.65 +6 -0 Added debugging code to track multicast issues ChangeSet@1.1251.1.13, 2004-11-12 20:39:57-05:00, mayer@tecotoo. Add debugging information ntpd/ntp_proto.c@1.187 +3 -0 Add debugging information ChangeSet@1.1251.1.12, 2004-11-12 20:39:10-05:00, mayer@tecotoo. Only enable broadcast for servers ntpd/ntp_peer.c@1.64 +1 -1 Only enable broadcast for servers ChangeSet@1.1251.1.11, 2004-11-12 20:34:52-05:00, mayer@tecotoo. Need both windows.h and winsock2.h for VC 6.0 ports/winnt/include/config.h@1.32 +1 -1 Need both windows.h and winsock2.h for VC 6.0 ChangeSet@1.1251.2.2, 2004-11-09 22:05:28-05:00, mayer@tecotoo. Move code to windows specific files ntpd/ntpd.c@1.59.1.1 +3 -56 Remove Windows code from ntpd.c into nt_clockstuff.c ports/winnt/ntpd/nt_clockstuff.c@1.16 +15 -0 Remove Windows code from ntpd.c into nt_clockstuff.c ports/winnt/ntpd/ntpd.dsp@1.25 +0 -5 Remove ntp_iopackets.c from compile list. Not ready ChangeSet@1.1251.1.9, 2004-11-09 04:38:42-05:00, stenn@whimsy.udel.edu re-enable the first call to getstartup() ntpd/ntpd.c@1.60 +1 -1 re-enable the first call to getstartup() ChangeSet@1.1250.1.4, 2004-11-08 23:08:38-05:00, mayer@tecotoo. Fixes forInclude paths and extraneous windows code ports/winnt/ntp-keygen/ntpkeygen.dsp@1.8 +1 -1 Fix include paths ports/winnt/ntpdate/ntpdate.dsp@1.14 +2 -2 Fix include paths ports/winnt/ntpq/ntpq.dsp@1.17 +1 -1 Fix include paths ChangeSet@1.1251.1.7, 2004-11-08 01:02:59-05:00, stenn@pogo.udel.edu [sntp] Lint removal sntp/internet.c@1.4 +10 -22 Lint removal sntp/internet.h@1.3 +2 -2 Lint removal sntp/socket.c@1.5 +4 -8 Lint removal ChangeSet@1.1251.1.5, 2004-11-07 17:14:12-05:00, stenn@whimsy.udel.edu [Bug 344] Handle some corner cases better bincheck.mf@1.2 +3 -2 [Bug 344] Handle some corner cases better ChangeSet@1.1251.1.4, 2004-11-07 04:13:44-05:00, stenn@whimsy.udel.edu AM_CPPFLAGS needed for nl.c ntpdc/Makefile.am@1.23 +2 -2 AM_CPPFLAGS needed for nl.c ChangeSet@1.1251.1.3, 2004-11-07 03:01:26-05:00, stenn@pogo.udel.edu [Bug 344] Allow daemons to be installed in sbin adjtimed/Makefile.am@1.3 +10 -8 [Bug 344] Allow daemons to be installed in sbin bincheck.mf@1.1 +14 -0 bincheck.mf@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev/bincheck.mf configure.ac@1.359.1.1 +21 -2 [Bug 344] Allow daemons to be installed in sbin ntpd/Makefile.am@1.39 +17 -9 [Bug 344] Allow daemons to be installed in sbin ntpdate/Makefile.am@1.12 +15 -12 [Bug 344] Allow daemons to be installed in sbin ntpdc/Makefile.am@1.22 +6 -3 [Bug 344] Allow daemons to be installed in sbin ntpq/Makefile.am@1.12 +10 -10 [Bug 344] Allow daemons to be installed in sbin sntp/Makefile.am@1.6 +4 -1 [Bug 344] Allow daemons to be installed in sbin sntp/configure.ac@1.8 +18 -0 [Bug 344] Allow daemons to be installed in sbin ChangeSet@1.1249.1.11, 2004-11-06 21:43:44-05:00, mayer@tecotoo. Miscellaneous include/recvbuff.h@1.8 +1 -0 Add flags about the received packet ports/winnt/libntp/syslog.c@1.3 +2 -1 modifed variable definition ChangeSet@1.1249.1.10, 2004-11-06 21:36:41-05:00, mayer@tecotoo. Updates to move windows-specific code into the windows-specific files ntpd/ntp_config.c@1.113 +1 -1 Remove obsolete windows specific code ntpd/ntpd.c@1.57.1.1 +16 -155 Remove Windows specific code. Put in other files ports/winnt/include/clockstuff.h@1.6 +1 -0 Move Console setup and service setup to nt_clockstuff.c ports/winnt/include/ntp_iocompletionport.h@1.8 +2 -0 Move completion events from ntpd.c to ntp_iocompletionport.c ports/winnt/include/ntservice.h@1.2 +1 -0 Move Console setup to ntservice ports/winnt/ntpd/nt_clockstuff.c@1.15 +35 -15 Move Console setup and service setup to nt_clockstuff.c ports/winnt/ntpd/ntp_iocompletionport.c@1.13 +46 -0 Move completion events from ntpd.c to ntp_iocompletionport.c ports/winnt/ntpd/ntservice.c@1.2 +70 -17 Move Console setup to ntservice ChangeSet@1.1250.1.2, 2004-11-06 04:13:33-05:00, stenn@whimsy.udel.edu lint ntpd/ntpd.c@1.58 +0 -1 lint ChangeSet@1.1249.1.9, 2004-11-04 00:03:35-05:00, mayer@tecotoo. Prefix constants with NTP_ to avoid collisions with VS.NET ntpdc/ntpdc.c@1.35 +9 -8 Prefix constants with NTP_ to avoid collisions with VS.NET ntpdc/ntpdc.h@1.4 +7 -7 Prefix constants with NTP_ to avoid collisions with VS.NET ntpdc/ntpdc_ops.c@1.37 +21 -21 Prefix constants with NTP_ to avoid collisions with VS.NET ntpq/ntpq.c@1.50 +18 -17 Prefix constants with NTP_ to avoid collisions with VS.NET ntpq/ntpq.h@1.4 +10 -7 Prefix constants with NTP_ to avoid collisions with VS.NET ntpq/ntpq_ops.c@1.20.1.1 +17 -17 Prefix constants with NTP_ to avoid collisions with VS.NET ChangeSet@1.1202.1.47, 2004-11-03 02:43:58-05:00, stenn@pogo.udel.edu autogen configure.ac@1.351.1.10 +2 -0 autogen ntpq/ntpq-subs.c@1.21 +0 -0 Rename: ntpq/ntpq_ops.c -> ntpq/ntpq-subs.c ChangeSet@1.1251, 2004-11-03 01:51:42-05:00, stenn@pogo.udel.edu Disable mlockall() under linux for now - resolver problems. configure.ac@1.359 +3 -0 Disable mlockall() under linux for now - resolver problems. ChangeSet@1.1249.1.8, 2004-11-02 23:25:17-05:00, mayer@tecotoo. Moved NT Services to it's own file ntpd/ntpd.c@1.57 +56 -151 Moved NT Services to it's own file ChangeSet@1.1249.1.7, 2004-11-02 23:23:49-05:00, mayer@tecotoo. Changes to support VS.NET ports/winnt/ntp-keygen/ntpkeygen.dsp@1.7 +4 -4 Changes to support VS.NET ChangeSet@1.1249.1.6, 2004-11-02 23:22:53-05:00, mayer@tecotoo. Changes to support VS.NET ports/winnt/include/isc/ipv6.h@1.4 +15 -3 Changes to support VS.NET ports/winnt/include/isc/net.h@1.4 +4 -2 Changes to support VS.NET ports/winnt/libisc/net.c@1.5 +2 -0 Changes to support VS.NET ChangeSet@1.1249.1.5, 2004-11-02 23:15:30-05:00, mayer@tecotoo. Changes to support VS.NET ports/winnt/include/config.h@1.31 +44 -6 Changes to support VS.NET ChangeSet@1.1249.1.4, 2004-11-02 23:14:21-05:00, mayer@tecotoo. NT Services for NTP ports/winnt/include/ntservice.h@1.1 +34 -0 NT Services for NTP ports/winnt/include/ntservice.h@1.0 +0 -0 BitKeeper file H:/ntpbk/ntp-dev/ports/winnt/include/ntservice.h ports/winnt/ntpd/ntservice.c@1.1 +241 -0 NT Services for NTP ports/winnt/ntpd/ntservice.c@1.0 +0 -0 BitKeeper file H:/ntpbk/ntp-dev/ports/winnt/ntpd/ntservice.c ChangeSet@1.1249.1.3, 2004-11-02 23:07:27-05:00, mayer@tecotoo. Redefine various error functions for win32 ports/winnt/libisc/isc_strerror.c@1.4 +8 -8 Redefine various error functions for win32 ChangeSet@1.1249.1.2, 2004-11-02 23:05:22-05:00, mayer@tecotoo. Remove unnecessary time variable references libntp/mktime.c@1.7 +3 -5 Remove unnecessary time variable references libntp/ranny.c@1.3 +0 -2 Remove unnecessary time variable references ports/winnt/ntpd/nt_clockstuff.c@1.14 +25 -27 Remove unnecessary time variable references ChangeSet@1.1249.1.1, 2004-11-02 23:02:31-05:00, mayer@tecotoo. Updates to support changes required for VS.NET ports/winnt/libntp/libntp.dsp@1.23 +4 -7 Updates to support changes required for VS.NET ports/winnt/ntpd/ntpd.dsp@1.24 +40 -4 Updates to support changes required for VS.NET ports/winnt/ntpdate/ntpdate.dsp@1.13 +2 -2 Updates to support changes required for VS.NET ports/winnt/ntpdc/ntpdc.dsp@1.16 +2 -2 Updates to support changes required for VS.NET ports/winnt/ntpq/ntpq.dsp@1.16 +2 -2 Updates to support changes required for VS.NET ChangeSet@1.1249, 2004-11-01 23:46:20-05:00, mayer@tecotoo. Mulitcast IPv6 check ntpd/ntp_io.c@1.145 +2 -3 Mulitcast IPv6 check ChangeSet@1.1247, 2004-11-01 23:03:40-05:00, mayer@tecotoo. IPv6 fixes and Added dump of interface function include/ntpd.h@1.71 +1 -0 Added dump of interface function ntpd/ntp_config.c@1.109.1.1 +41 -20 Fix for IPv6 ntpd/ntp_intres.c@1.35.1.1 +22 -2 Fix for IPv6 ChangeSet@1.1246, 2004-11-01 22:55:10-05:00, mayer@tecotoo. Fix multicast to open it's own socket. Fall back on wildcard if it fails ntpd/ntp_io.c@1.143 +287 -494 Fix multicast to open it's own socket. Fall back on wildcard if it fails ChangeSet@1.1202.5.10, 2004-10-31 16:23:23-05:00, stenn@whimsy.udel.edu PTB responses are 78 bytes long, not 40. ntpd/refclock_acts.c@1.15 +1 -1 PTB responses are 78 bytes long, not 40. ChangeSet@1.1202.5.8, 2004-10-29 22:56:12-04:00, mayer@pogo.udel.edu Should have used ISC_R_SUCCESS and not ISC_TRUE for return from isc_net_probeipv6(). Don't allow IPv6 addreses when no IPv6 available ntpd/ntp_config.c@1.111 +36 -22 Should have used ISC_R_SUCCESS and not ISC_TRUE for return from isc_net_probeipv6(). Don't allow IPv6 addreses when no IPv6 available ntpd/ntp_intres.c@1.37 +4 -4 Should have used ISC_R_SUCCESS and not ISC_TRUE for return from isc_net_probeipv6() ChangeSet@1.1202.7.1, 2004-10-29 05:52:47-04:00, stenn@whimsy.udel.edu Updates from Dave Mills html/build/hints.html@1.15 +1 -1 Updates from Dave Mills html/build/hints/solaris-dosynctodr.html@1.5 +11 -11 Updates from Dave Mills html/drivers/driver18.html@1.12 +44 -49 Updates from Dave Mills html/drivers/driver29.html@1.13 +1 -1 Updates from Dave Mills html/drivers/driver38.html@1.12 +3 -3 Updates from Dave Mills html/drivers/driver39.html@1.12 +3 -3 Updates from Dave Mills html/drivers/driver44.html@1.11 +3 -6 Updates from Dave Mills html/drivers/driver5.html@1.12 +1 -1 Updates from Dave Mills html/drivers/driver8.html@1.14 +1 -1 Updates from Dave Mills html/ntpd.html@1.34 +5 -8 Updates from Dave Mills ChangeSet@1.1202.6.1, 2004-10-28 20:49:19-04:00, mayer@pogo.udel.edu Ensure that DNS lookups on IPv6-absent systems only look up IPv4 addresses ntpd/ntp_config.c@1.110 +7 -0 Ensure that DNS lookups on IPv6-absent systems only look up IPv4 addresses ntpd/ntp_intres.c@1.36 +21 -1 Ensure that DNS lookups on IPv6-absent systems only look up IPv4 addresses ChangeSet@1.1202.5.6, 2004-10-27 19:52:51-04:00, stenn@whimsy.udel.edu Updates from Dave Mills html/copyright.html@1.28 +2 -2 Updates from Dave Mills html/drivers/footer.txt@1.1 +7 -0 html/drivers/footer.txt@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/drivers/footer.txt html/drivers/tf582_4.html@1.1 +72 -0 html/drivers/tf582_4.html@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/drivers/tf582_4.html html/keygen.html@1.5 +1 -1 Updates from Dave Mills html/ntpd.html@1.33 +1 -1 Updates from Dave Mills html/refclock.html@1.30 +8 -6 Updates from Dave Mills ChangeSet@1.1202.5.5, 2004-10-26 20:25:31-04:00, stenn@whimsy.udel.edu Remove mort from the backroom auto-build list br-flock@1.5 +1 -1 Remove mort from the backroom auto-build list ChangeSet@1.1202.4.5, 2004-10-24 22:46:38-04:00, mayer@pogo.udel.edu Add interface_dump functionality include/ntpd.h@1.69.1.1 +1 -0 Add interface_dump functionality ChangeSet@1.1202.4.4, 2004-10-24 22:45:54-04:00, mayer@pogo.udel.edu Add interface_dump functionality ntpd/ntp_io.c@1.119.1.5 +58 -0 Add interface_dump functionality ChangeSet@1.1202.4.3, 2004-10-24 22:44:25-04:00, mayer@pogo.udel.edu Remove interface_dump ntpd/ntp_control.c@1.70.1.4 +0 -1 Remove interface_dump ChangeSet@1.1202.4.2, 2004-10-24 22:42:51-04:00, mayer@pogo.udel.edu Don't allow null interfaces ntpd/ntp_peer.c@1.60.1.1 +8 -0 Don't allow null interfaces ChangeSet@1.1245, 2004-10-24 22:37:46-04:00, mayer@tecotoo. Don't allow null interfaces ntpd/ntp_peer.c@1.62 +8 -0 Don't allow null interfaces ChangeSet@1.1202.5.3, 2004-10-23 03:25:29-04:00, stenn@whimsy.udel.edu sntp can be installed in sbin sntp/Makefile.am@1.5 +1 -1 sntp can be installed in sbin ChangeSet@1.1202.5.2, 2004-10-23 03:09:05-04:00, stenn@whimsy.udel.edu Lose broadcast and server modes from sntp. sntp/README@1.2 +28 -27 Lose broadcast and server modes. sntp/draft-mills-sntp-v4-00.txt@1.1 +1514 -0 sntp/draft-mills-sntp-v4-00.txt@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/draft-mills-sntp-v4-00.txt sntp/header.h@1.6 +1 -3 Lose broadcast and server modes. sntp/main.c@1.5 +19 -115 Lose broadcast and server modes. sntp/sntp.1@1.4 +0 -23 Lose broadcast and server modes. sntp/socket.c@1.4 +6 -22 Lose broadcast and server modes. ChangeSet@1.1202.5.1, 2004-10-23 00:09:11-04:00, stenn@whimsy.udel.edu Fixes from Dave Mills ntpd/ntp_util.c@1.34 +1 -1 loopstats output cleanup ntpd/refclock_atom.c@1.44 +1 -0 Specify PPS_API_VERS_1 ChangeSet@1.1202.1.42, 2004-10-19 21:26:34-04:00, stenn@pogo.udel.edu select() EINTR and mlockall() under linux problem avoidance. configure.ac@1.351.1.9 +3 -0 Stop using mlockall() under linux ntpd/ntpd.c@1.55.1.1 +1 -1 Only show the select() EINTR reports at debug >5 ChangeSet@1.1202.1.41, 2004-10-18 00:37:02-04:00, stenn@whimsy.udel.edu lint fixes for refclock_mx4200.c ntpd/refclock_mx4200.c@1.19 +3 -3 lint ChangeSet@1.1202.1.40, 2004-10-16 07:30:33-04:00, stenn@www.ntp.org Rename html2man.pl to html2man.in so we can use PATH_PERL. configure.ac@1.351.1.8 +1 -0 Rename html2man.pl to html2man.in so we can use PATH_PERL. scripts/Makefile.am@1.11 +2 -2 Rename html2man.pl to html2man.in so we can use PATH_PERL. scripts/html2man.in@1.5 +4 -6 Rename html2man.pl to html2man.in so we can use PATH_PERL. scripts/html2man.in@1.4 +0 -0 Rename: scripts/html2man.pl -> scripts/html2man.in ChangeSet@1.1202.1.39, 2004-10-16 06:19:50-04:00, stenn@www.ntp.org [Bug 348] genkeys -> keygen, and .htm -> .html scripts/html2man.pl@1.3 +2 -2 [Bug 348] genkeys -> keygen, and .htm -> .html ChangeSet@1.1202.3.1, 2004-10-14 00:35:10-04:00, mayer@pogo.udel.edu Fix to broadcast. broadcast address socket was not being opened ntpd/ntp_io.c@1.119.1.4 +27 -9 Fix to broadcast. broadcast address socket was not being opened ChangeSet@1.1202.1.37, 2004-10-12 21:08:44-04:00, stenn@whimsy.udel.edu Fixes from Dave Mills ntpd/ntp_loopfilter.c@1.100 +9 -15 Dave Mills: kernel cleanup ntpd/ntp_proto.c@1.181.1.5 +1 -1 Dave Mills: If MCAST, turn off BURST as well. ChangeSet@1.1244, 2004-10-10 19:46:59-04:00, mayer@tecotoo. Fix for refclock_open for Windows due to signature change (Again) ports/winnt/include/win32_io.h@1.7 +1 -2 Fix for refclock_open for Windows due to signature change (Again) ChangeSet@1.1243, 2004-10-10 19:46:22-04:00, mayer@tecotoo. Add support for enable_broadcast() call for servers (Again) ntpd/ntp_io.c@1.142 +2 -1 Add support for enable_broadcast() call for servers (Again) ChangeSet@1.1241, 2004-10-10 19:10:18-04:00, mayer@tecotoo. Fix for refclock_open for Windows due to signature change ports/winnt/include/win32_io.h@1.4.1.1 +1 -1 Fix for refclock_open for Windows due to signature change ports/winnt/ntpd/win32_io.c@1.9.1.1 +2 -2 Fix for refclock_open for Windows due to signature change ChangeSet@1.1240, 2004-10-10 19:08:19-04:00, mayer@tecotoo. Add support for enable_broadcast() call for servers include/ntpd.h@1.68.1.1 +4 -4 Add support for enable_broadcast() call for servers ntpd/ntp_io.c@1.139.1.1 +21 -3 Add support for enable_broadcast() call for servers ntpd/ntp_peer.c@1.59.1.1 +8 -0 Add support for enable_broadcast() call for servers ChangeSet@1.1202.1.36, 2004-10-08 22:24:44-04:00, stenn@whimsy.udel.edu Changes/cleanup from Dave Mills ntpd/ntp_control.c@1.70.1.3 +1 -1 Changes/cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.99 +9 -12 Changes/cleanup from Dave Mills ntpd/ntp_util.c@1.33 +2 -2 Changes/cleanup from Dave Mills ChangeSet@1.1202.1.35, 2004-10-08 19:43:05-04:00, stenn@whimsy.udel.edu Dave Mills: No autokey over the wildcard interface ntpd/ntp_proto.c@1.181.1.4 +17 -15 Dave Mills: No autokey over the wildcard interface ChangeSet@1.1202.1.34, 2004-10-07 22:49:19-04:00, mayer@pogo.udel.edu Win32 fix for refclock_open() signature change ports/winnt/include/win32_io.h@1.5 +1 -1 Win32 fix for refclock_open() signature change ports/winnt/ntpd/win32_io.c@1.7.1.2 +2 -2 Win32 fix for refclock_open() signature change ChangeSet@1.1202.1.33, 2004-10-07 22:43:33-04:00, mayer@pogo.udel.edu Modification to have broadcast servers enable the socket for broadcast (missing argument) ntpd/ntp_io.c@1.119.1.3 +1 -1 Modification to have broadcast servers enable the socket for broadcast (missing argument) ChangeSet@1.1202.1.32, 2004-10-07 22:40:57-04:00, mayer@pogo.udel.edu Modification to have broadcast servers enable the socket for broadcast include/ntpd.h@1.69 +4 -4 Modification to have broadcast servers enable the socket for broadcast ntpd/ntp_io.c@1.119.1.2 +18 -0 Modification to have broadcast servers enable the socket for broadcast ntpd/ntp_peer.c@1.60 +8 -0 Modification to have broadcast servers enable the socket for broadcast ChangeSet@1.1202.1.31, 2004-10-06 22:21:10-04:00, stenn@whimsy.udel.edu Remove PTB and USNO lint README.refclocks@1.3 +2 -2 Remove PTB and USNO lint configure.ac@1.351.1.7 +0 -40 Remove PTB and USNO lint ChangeSet@1.1202.1.30, 2004-10-05 18:27:54-04:00, stenn@whimsy.udel.edu Cleanup from Dave Mills ntpd/ntp_control.c@1.70.1.2 +2 -2 Cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.98 +4 -4 Cleanup from Dave Mills ntpd/ntp_request.c@1.58 +1 -1 Cleanup from Dave Mills ntpd/ntp_util.c@1.32 +2 -2 Cleanup from Dave Mills ChangeSet@1.1202.1.29, 2004-10-02 03:56:39-04:00, stenn@whimsy.udel.edu Cleanup from Dave Mills include/ntp_refclock.h@1.17 +6 -4 Cleanup from Dave Mills include/ntpd.h@1.68 +0 -1 Cleanup from Dave Mills ntpd/ntp_config.c@1.109 +4 -1 Cleanup from Dave Mills ntpd/ntp_loopfilter.c@1.97 +37 -31 Cleanup from Dave Mills ntpd/ntp_proto.c@1.181.1.3 +2 -5 Cleanup from Dave Mills ntpd/ntp_refclock.c@1.60 +205 -180 Cleanup from Dave Mills ntpd/ntp_request.c@1.57 +2 -2 Cleanup from Dave Mills ntpd/refclock_acts.c@1.14 +134 -72 Cleanup from Dave Mills ntpd/refclock_wwvb.c@1.13 +4 -11 Cleanup from Dave Mills ChangeSet@1.1202.1.28, 2004-09-22 23:23:06-04:00, mayer@pogo.udel.edu Fix the precompiled header issue ports/winnt/libntp/libntp.dsp@1.18.1.1 +13 -1 Fix the precompiled header issue ports/winnt/ntp-keygen/ntpkeygen.dsp@1.4.1.1 +2 -2 Fix the precompiled header issue ports/winnt/ntpd/ntpd.dsp@1.21.1.1 +6 -2 Fix the precompiled header issue ports/winnt/ntpdc/ntpdc.dsp@1.13.1.1 +2 -2 Fix the precompiled header issue ports/winnt/ntpq/ntpq.dsp@1.13.1.1 +2 -2 Fix the precompiled header issue ChangeSet@1.1202.1.27, 2004-09-22 23:21:56-04:00, mayer@pogo.udel.edu Add support for VS.NET (aka V7) and finally fix the RPC Async header issues ports/winnt/include/config.h@1.26.1.1 +9 -6 Add support for VS.NET (aka V7) and finally fix the RPC Async header issues ChangeSet@1.1202.1.26, 2004-09-22 23:20:39-04:00, mayer@pogo.udel.edu total_buffs() and full_buffs() were returning the wrong value libntp/recvbuff.c@1.8.1.1 +2 -2 total_buffs() and full_buffs() were returning the wrong value ChangeSet@1.1238, 2004-09-22 23:19:14-04:00, mayer@tecotoo. total_buffs() and full_buffs() were returning the wrong value libntp/recvbuff.c@1.9 +2 -2 total_buffs() and full_buffs() were returning the wrong value ChangeSet@1.1237, 2004-09-22 23:09:51-04:00, mayer@tecotoo. Add support for VS.NET (aka V7) and finally fix the RPC Async header issues ports/winnt/include/config.h@1.29 +7 -6 Add support for VS.NET (aka V7) and finally fix the RPC Async header issues ChangeSet@1.1236, 2004-09-22 00:40:32-04:00, mayer@tecotoo. Fix the precompiled header issue ports/winnt/libntp/libntp.dsp@1.21 +1 -1 Fix the precompiled header issue ports/winnt/ntp-keygen/ntpkeygen.dsp@1.5 +2 -2 Fix the precompiled header issue ports/winnt/ntpd/ntpd.dsp@1.22 +6 -2 Fix the precompiled header issue ports/winnt/ntpdc/ntpdc.dsp@1.14 +2 -2 Fix the precompiled header issue ports/winnt/ntpq/ntpq.dsp@1.14 +2 -2 Fix the precompiled header issue ChangeSet@1.1202.1.25, 2004-09-16 22:45:42-04:00, stenn@whimsy.udel.edu look for recvmsg() configure.ac@1.351.1.6 +1 -1 look for recvmsg() ChangeSet@1.1202.1.24, 2004-09-13 22:31:34-04:00, stenn@whimsy.udel.edu Remove #undef UDP_WILDCARD_DELIVERY per Danny Mayer ntpd/ntp_io.c@1.119.1.1 +0 -1 Remove #undef UDP_WILDCARD_DELIVERY per Danny Mayer ChangeSet@1.1202.1.23, 2004-09-13 04:09:52-04:00, stenn@whimsy.udel.edu Dave Mills: flag3 chooses 1200 or 9600 baud. ntpd/refclock_acts.c@1.13 +9 -4 Dave Mills: flag3 chooses 1200 or 9600 baud. ChangeSet@1.1202.1.22, 2004-09-12 16:53:03-04:00, stenn@whimsy.udel.edu more modem cleanup stuff BitKeeper/deleted/.del-refclock_ptbacts.c~3e480692@1.3 +0 -0 Delete: ntpd/refclock_ptbacts.c BitKeeper/deleted/.del-refclock_usno.c~3aed0663@1.9 +0 -0 Delete: ntpd/refclock_usno.c ntpd/Makefile.am@1.38 +2 -2 Remove the old ptbs and usno drivers ntpd/refclock_acts.c@1.12 +23 -34 cleanup and fixes from Dave Mills ports/winnt/ntpd/ntpd.dsp@1.21 +0 -10 Remove the old ptbs and usno drivers ChangeSet@1.1202.2.3, 2004-09-12 01:00:57-04:00, stenn@whimsy.udel.edu Changes from Dave Mills. Combine/simplify the modem driver to handle ACTS, NIST, PTB, and USNO. include/ntp.h@1.101.1.2 +5 -11 Combine the modem refclocks into a single driver. Update the poll randomization stuff. include/ntp_refclock.h@1.16 +2 -1 Added refclock_timer(). include/ntpd.h@1.67 +1 -0 added refclock_timeout(). libntp/clocktypes.c@1.16 +6 -6 Use the new refclock_acts for NIST, PTB, USNO ntpd/ntp_config.c@1.108 +2 -1 phone numbers now need a \r appended. ntpd/ntp_proto.c@1.181.2.1 +92 -99 Cleanup and fixes. ntpd/ntp_refclock.c@1.59 +18 -0 Added refclock_timer(). ntpd/ntp_timer.c@1.28 +9 -0 Call refclock_timer(). ntpd/refclock_acts.c@1.11 +586 -705 Handle NIST/USNO/PTB/NPL over a modem. ntpd/refclock_conf.c@1.24 +3 -15 PTB and USNO now use the common ACTS code. ChangeSet@1.1202.2.2, 2004-09-07 06:41:51-04:00, stenn@whimsy.udel.edu Use SNDCTL_DSP_SETFRAGMENT if available. From Tim Shoppa. libntp/audio.c@1.23 +9 -0 Use SNDCTL_DSP_SETFRAGMENT if available. From Tim Shoppa. ChangeSet@1.1202.2.1, 2004-09-03 22:34:20-04:00, stenn@whimsy.udel.edu Comment improvement from Dave Mills include/ntp.h@1.101.1.1 +1 -1 Comment improvement from Dave Mills ChangeSet@1.1202.1.20, 2004-09-03 22:04:08-04:00, mayer@pogo.udel.edu INT_MULTICAST now INT_MCASTOPEN ntpd/ntp_monitor.c@1.12.1.1 +1 -1 INT_MULTICAST now INT_MCASTOPEN ntpd/ntp_proto.c@1.181.1.1 +2 -2 INT_MULTICAST now INT_MCASTOPEN ChangeSet@1.1233, 2004-09-03 21:56:58-04:00, mayer@tecotoo. INT_MULTICAST now INT_MCASTOPEN ntpd/ntp_monitor.c@1.13 +1 -1 INT_MULTICAST now INT_MCASTOPEN ntpd/ntp_proto.c@1.182 +2 -2 INT_MULTICAST now INT_MCASTOPEN ChangeSet@1.1202.1.19, 2004-09-02 21:41:05-04:00, stenn@whimsy.udel.edu Dave Mills: RSTR kiss+iburst retried too often ntpd/ntp_proto.c@1.181 +24 -33 Dave Mills: RSTR kiss+iburst retried too often ChangeSet@1.1202.1.18, 2004-08-30 04:27:54-04:00, stenn@www.ntp.org [Bug 153] Initial pass at framework to fix bug ntpd/ntp_config.c@1.107 +19 -9 [Bug 153] Initial pass at framework to fix bug ChangeSet@1.1202.1.17, 2004-08-25 21:27:18-04:00, stenn@www.ntp.org avoid overwriting self util/ntp-keygen.c@1.30 +5 -1 avoid overwriting self ChangeSet@1.1202.1.16, 2004-08-25 01:16:52-04:00, stenn@whimsy.udel.edu added sntp.1 and did a little cleanup sntp/Makefile.am@1.4 +5 -1 added sntp.1 and did a little cleanup sntp/header.h@1.5 +2 -2 added sntp.1 and did a little cleanup sntp/main.c@1.4 +8 -8 added sntp.1 and did a little cleanup sntp/sntp.1@1.3 +25 -15 added sntp.1 and did a little cleanup sntp/sntp.1@1.2 +0 -0 Rename: sntp/msntp.1 -> sntp/sntp.1 sntp/msntp.1@1.1 +325 -0 sntp/msntp.1@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/sntp/msntp.1 ChangeSet@1.1202.1.15, 2004-08-23 22:08:55-04:00, stenn@www.ntp.org make propdelay compile/link clockstuff/Makefile.am@1.4 +1 -1 make propdelay compile/link clockstuff/propdelay.c@1.4 +6 -6 make propdelay compile/link ChangeSet@1.1202.1.14, 2004-08-19 23:22:20-04:00, stenn@whimsy.udel.edu [Bug 300] Properly report V3 reslist bits ntpdc/ntpdc_ops.c@1.34.1.1 +25 -7 [Bug 300] Properly report V3 reslist bits ChangeSet@1.1202.1.13, 2004-08-19 23:15:44-04:00, stenn@whimsy.udel.edu typo fix ntpd/ntp_loopfilter.c@1.96 +1 -1 typo fix ChangeSet@1.1229, 2004-08-19 18:34:48-04:00, mayer@pogo.udel.edu Change debug level of interrupted select to 5 ntpd/ntpd.c@1.56 +3 -3 Change debug level of interrupted select to 5 ChangeSet@1.1228, 2004-08-19 18:33:09-04:00, mayer@pogo.udel.edu Fixed IPv6 multicast to use correct scope for interface ntpd/ntp_io.c@1.138 +24 -12 Fixed IPv6 multicast to use correct scope for interface ChangeSet@1.1227, 2004-08-16 19:31:28-04:00, mayer@pogo.udel.edu Miscellaneous fixes for sitelocal and linklocal IPv6 addresses ntpd/ntp_io.c@1.137 +23 -6 Miscellaneous fixes for sitelocal and linklocal IPv6 addresses ChangeSet@1.1226, 2004-08-15 23:32:21-04:00, mayer@tecotoo. Typo, should have checked for INT_MULTICAST instead of INT_BROADCAST ntpd/ntp_io.c@1.136 +1 -1 Typo should have checked for INT_MULTICAST instead of INT_BROADCAST ChangeSet@1.1225, 2004-08-15 23:16:22-04:00, mayer@tecotoo. In IPv6 when looking for a multicast address check if the remote address is multicast ntpd/ntp_io.c@1.135 +21 -2 In IPv6 when looking for a multicast address check if the remote address is multicast ChangeSet@1.1224, 2004-08-15 21:45:50-04:00, mayer@tecotoo. Added more detailed debug print statements ntpd/ntp_io.c@1.134 +18 -18 Added more detailed debug print statements ChangeSet@1.1223, 2004-08-15 12:14:57-04:00, mayer@tecotoo. rewrote adding multicast client and added find_interface_index ntpd/ntp_io.c@1.133 +44 -54 rewrote adding multicast client and added find_interface_index ChangeSet@1.1222, 2004-08-15 01:34:53-04:00, mayer@tecotoo. Use Id of the interface when printing join multicast group failures ntpd/ntp_io.c@1.132 +3 -3 Use Id of the interface when printing join multicast group failures ChangeSet@1.1221, 2004-08-15 01:20:41-04:00, mayer@tecotoo. Added debug print statements ntpd/ntp_io.c@1.131 +12 -6 Added debug print statements ChangeSet@1.1220, 2004-08-14 23:33:00-04:00, mayer@tecotoo. Redid findinterface and findbcastinter to properly find appropriate interface and use the family member from the interface struct include/ntp.h@1.102 +14 -13 Added family to interface struct ntpd/ntp_io.c@1.130 +86 -97 Redid findinterface and findbcastinter to properly find appropriate interface and use the family member from the interface struct ChangeSet@1.1202.1.12, 2004-08-13 05:48:21-04:00, stenn@pogo.udel.edu [Bug 301] ntp-keygen has no usage statement util/ntp-keygen.c@1.29 +44 -4 [Bug 301] ntp-keygen has no usage statement ChangeSet@1.1218, 2004-08-12 16:54:31-04:00, mayer@pogo.udel.edu findbcastinter needs to find a proper broadcast interface ntpd/ntp_io.c@1.129 +236 -5 findbcastinter needs to find a proper broadcast interface ChangeSet@1.1202.1.11, 2004-08-12 05:12:15-04:00, stenn@whimsy.udel.edu Use AC_HELP_STRING in configure.ac configure.ac@1.351.1.5 +35 -20 Use AC_HELP_STRING in configure.ac ChangeSet@1.1217, 2004-08-11 23:06:43-04:00, mayer@tecotoo. Added files for inet_*ton functions ports/winnt/libntp/libntp.dsp@1.20 +4 -0 Added files for inet_*ton functions ChangeSet@1.1202.1.10, 2004-08-11 22:28:30-04:00, stenn@whimsy.udel.edu FreeBSD lint Makefile.am@1.48 +5 -5 FreeBSD lint ntpdc/ntpdc.c@1.34 +5 -1 FreeBSD lint ntpq/ntpq.c@1.49 +5 -1 FreeBSD lint ChangeSet@1.1216, 2004-08-11 18:04:11-04:00, mayer@pogo.udel.edu interfaces are not TCP-specific ports/winnt/libisc/interfaceiter.c@1.4.1.1 +1 -1 interfaces are not TCP-specific ChangeSet@1.1202.1.9, 2004-08-11 18:00:52-04:00, mayer@pogo.udel.edu interfaces are not TCP-specific ports/winnt/libisc/interfaceiter.c@1.5 +1 -1 interfaces are not TCP-specific ChangeSet@1.1202.1.8, 2004-08-10 19:36:31-04:00, mayer@pogo.udel.edu Fix to emit error strings when getting errors from system ports/winnt/ntpd/win32_io.c@1.7.1.1 +8 -8 Fix to emit error strings when getting errors from system ChangeSet@1.1214, 2004-08-10 19:25:24-04:00, mayer@pogo.udel.edu Fix to emit error strings when getting errors from system ports/winnt/ntpd/win32_io.c@1.8 +8 -8 Fix to emit error strings when getting errors from system ChangeSet@1.1202.1.7, 2004-08-10 01:24:58-04:00, stenn@www.ntp.org [Bug 208] Use -R in LDFLAGS when needed. (some other cleanup, too) configure.ac@1.351.1.4 +34 -12 [Bug 208] Use -R in LDFLAGS when needed. (some other cleanup, too) ChangeSet@1.1202.1.6, 2004-08-09 05:39:43-05:00, stenn@poog.il.thewrittenword.com OSF needs sys/time.h to test for sys/timex.h configure.ac@1.351.1.3 +7 -1 OSF needs sys/time.h to test for sys/timex.h ChangeSet@1.1202.1.5, 2004-08-09 05:38:32-05:00, stenn@poog.il.thewrittenword.com OSF cflags cleanup BitKeeper/etc/logging_ok@1.50 +1 -0 Logging to logging@openlogging.org accepted m4/os_cflags.m4@1.2 +23 -22 OSF cflags cleanup ChangeSet@1.1202.1.4, 2004-08-07 07:22:03-04:00, stenn@whimsy.udel.edu [Bug 166] Clean up Irix compile/link flags for 32/64 bits BitKeeper/deleted/.del-acinclude.m4~457f12ef@1.13 +0 -0 Delete: acinclude.m4 Makefile.am@1.47 +5 -2 [Bug 166] Clean up Irix compile/link flags for 32/64 bits configure.ac@1.351.1.2 +1 -19 [Bug 166] Clean up Irix compile/link flags for 32/64 bits configure.ac@1.351.1.1 +0 -0 Rename: configure.in -> configure.ac m4/define_dir.m4@1.1 +26 -0 m4/define_dir.m4@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/m4/define_dir.m4 m4/hs_ulong_const.m4@1.1 +11 -0 m4/hs_ulong_const.m4@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/m4/hs_ulong_const.m4 m4/os_cflags.m4@1.1 +86 -0 m4/os_cflags.m4@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev-hms/m4/os_cflags.m4 ChangeSet@1.1202.1.3, 2004-08-06 03:42:21-04:00, stenn@www.ntp.org [Bug 321] Fix some alpha alignment issues and avoid a possibile DOS BitKeeper/etc/logging_ok@1.49 +1 -0 Logging to logging@openlogging.org accepted ntpd/ntp_control.c@1.70.1.1 +7 -4 [Bug 321] Fix some alpha alignment issues and avoid a possibile DOS ChangeSet@1.1202.1.2, 2004-08-05 23:40:16-04:00, stenn@whimsy.udel.edu No more autokey/rsa for mkver, just openssl now. scripts/mkver.in@1.11 +5 -8 No more autokey/rsa for mkver, just openssl now. ChangeSet@1.1202.1.1, 2004-08-05 23:33:23-04:00, stenn@whimsy.udel.edu [Bug 326] handle MAXTOKEN overflow better. ntpd/ntp_config.c@1.106 +27 -10 [Bug 326] handle MAXTOKEN overflow better. ChangeSet@1.1212, 2004-08-05 00:14:18-04:00, mayer@tecotoo. Look for PPP for interface to the outside ntpd/ntp_io.c@1.128 +18 -0 Look for PPP for interface to the outside ChangeSet@1.1211, 2004-08-04 18:41:17-04:00, mayer@pogo.udel.edu Fix cast in ntohl ntpdc/ntpdc_ops.c@1.35 +23 -23 Fix cast in ntohl ChangeSet@1.1210, 2004-08-04 18:10:22-04:00, mayer@pogo.udel.edu Fixes for scope ID libisc/interfaceiter.c@1.11 +6 -1 Fixes for scope ID ntpd/ntp_io.c@1.127 +3 -2 Fixes for scope ID ChangeSet@1.1209, 2004-08-04 02:28:09-04:00, mayer@tecotoo. Fix setting of only interface code ntpd/ntp_io.c@1.126 +2 -2 Fix setting of only interface code ChangeSet@1.1208, 2004-08-03 18:39:54-04:00, mayer@pogo.udel.edu Linklocal and sitelocal IPv6 changes include/ntp_rfc2553.h@1.26 +14 -0 Add link-local and site-local IPv6 macros ntpd/ntp_io.c@1.125 +18 -0 Add check for link-local and site-local for IPv6 addresses when looking for interfaces ChangeSet@1.1207, 2004-08-02 22:36:39-04:00, mayer@tecotoo. findbcastinter should look for INT_BROADCAST flag ntpd/ntp_io.c@1.124 +1 -1 findbcastinter should look for INT_BROADCAST flag ChangeSet@1.1206, 2004-08-02 22:19:13-04:00, mayer@tecotoo. findinterface cleanup and IPv4/IPv6 fixes configure.in@1.352 +2 -0 Add check for inet_pton and inet_aton libntp/ntp_rfc2553.c@1.20 +8 -2 fix port assignment ntpd/ntp_io.c@1.123 +1 -2 Ongoing findinterface cleanup ChangeSet@1.1205, 2004-08-02 20:44:31-04:00, mayer@pogo.udel.edu Changes for proper IPv4 and IPv6 support libisc/inet_aton.c@1.2 +0 -3 Remove temporary changes to support Winnt libntp/Makefile.am@1.30 +3 -1 Added inet_pton and inet_aton to libisc libntp/ntp_rfc2553.c@1.19 +2 -2 Reorder the includes to prevent warnings libntp/ntp_rfc2553.c@1.18 +20 -15 Change to use inet_pton and cleanly support at least IPv6 addresses ntpd/ntp_io.c@1.122 +2 -15 changes to find the right local interface for outgoing packets ports/winnt/include/config.h@1.28 +1 -0 Added isascii, required for inet_aton ChangeSet@1.1204, 2004-08-02 00:35:56-04:00, mayer@tecotoo. Updates to support finding interfaces and address lookups libisc/inet_aton.c@1.1 +198 -0 libisc/inet_aton.c@1.0 +0 -0 BitKeeper file H:/ntpbk/ntp-dev/libisc/inet_aton.c libisc/inet_pton.c@1.1 +211 -0 libisc/inet_pton.c@1.0 +0 -0 BitKeeper file H:/ntpbk/ntp-dev/libisc/inet_pton.c libntp/ntp_rfc2553.c@1.17 +15 -74 fix the code to properly handle addresses. ntpd/ntp_control.c@1.71 +0 -1 no change ntpd/ntp_io.c@1.121 +82 -3 changes to properly find outgoing interfaces ports/winnt/include/config.h@1.27 +1 -0 Need inet_pton ports/winnt/libntp/libntp.dsp@1.19 +8 -0 Add inet_pton and inet_aton ChangeSet@1.1203, 2004-07-28 23:44:06-04:00, mayer@tecotoo. clean up finding addresses and interfaces ntpd/ntp_io.c@1.120 +37 -50 clean up finding addresses and interfaces ChangeSet@1.1202, 2004-07-27 19:24:53-04:00, mayer@pogo.udel.edu Changes for conditional support of broadcast and multicast on some platforms ntpd/ntp_io.c@1.119 +3 -2 Changes for conditional support of broadcast and multicast on some platforms ChangeSet@1.1201, 2004-07-26 23:12:26-04:00, mayer@tecotoo. Code cleanup and simplification ntpd/ntp_io.c@1.118 +104 -101 Code cleanup and simplification ChangeSet@1.1200, 2004-07-26 10:18:16-04:00, mayer@pogo.udel.edu Not all O/S's support broadcast. Conditionally build the socket_broadcast_* code ntpd/ntp_io.c@1.117 +6 -4 Not all O/S's support broadcast. Conditionally build the socket_broadcast_* code ChangeSet@1.1199, 2004-07-25 23:28:14-04:00, mayer@tecotoo. Not all platforms support Multicast ntpd/ntp_io.c@1.116 +6 -0 Not all platforms support Multicast ChangeSet@1.1198, 2004-07-25 23:07:04-04:00, mayer@tecotoo. Minor bugs in IPv6 codes. Remove unused variables ntpd/ntp_io.c@1.115 +3 -6 Minor bugs in IPv6 codes. Remove unused variables ChangeSet@1.1197, 2004-07-25 22:44:57-04:00, mayer@tecotoo. Rewrite multicast and broadcast routines to remove wildcard requirements, improve flexibility and general code improvements ntpd/ntp_io.c@1.114 +328 -245 Rewrite multicast and broadcast routines to remove wildcard requirements, improve flexibility and general code improvements ChangeSet@1.1192.1.2, 2004-07-22 00:20:36-04:00, mayer@tecotoo. If we can't figure out the address type assume it's IPv4 libntp/socktoa.c@1.7 +3 -0 If we can't figure out the address type assume it's IPv4 ChangeSet@1.1189.1.2, 2004-07-22 00:11:05-04:00, mayer@tecotoo. For Multicast make sure socket can handle multicast ntpd/ntp_io.c@1.113 +16 -10 For Multicast make sure socket can handle multicast ChangeSet@1.1195, 2004-07-20 02:42:59-04:00, stenn@whimsy.udel.edu [Bug 307] Typo fix from Volkmar Grote html/monopt.html@1.19 +2 -2 [Bug 307] Typo fix from Volkmar Grote ChangeSet@1.1194, 2004-07-20 02:26:12-04:00, stenn@whimsy.udel.edu [Bug 233] Apply rest of patch from Matthias Drochner ntpd/refclock_shm.c@1.16 +4 -1 [Bug 233] Apply rest of patch from Matthias Drochner ntpdc/ntpdc_ops.c@1.34 +5 -5 [Bug 233] Apply rest of patch from Matthias Drochner ChangeSet@1.1193, 2004-07-16 01:20:38-04:00, stenn@whimsy.udel.edu [Bug 315] Provide prereq headers for configure.in configure.in@1.351 +28 -2 [Bug 315] Provide prereq headers for configure.in ChangeSet@1.1189.1.1, 2004-07-12 21:57:57-04:00, mayer@tecotoo. IPv6 addresses caused the resultant refid to get it's values swapped on some machines libntp/a_md5encrypt.c@1.18 +1 -1 IPv6 addresses caused the resultant refid to get it's values swapped on some machines ChangeSet@1.1191, 2004-07-12 19:36:51-04:00, stenn@whimsy.udel.edu Use UTC for the date in the version string for mkver.in scripts/mkver.in@1.10 +1 -1 Use UTC for the date in the version string ChangeSet@1.1178.1.13, 2004-07-07 00:52:39-04:00, stenn@whimsy.udel.edu Fix from Dave Mills libntp/systime.c@1.31 +2 -7 Fix from Dave Mills ChangeSet@1.1189, 2004-07-05 23:36:39-04:00, mayer@tecotoo. Multicast modifications and extraneous macro definition removal include/ntp.h@1.101 +2 -1 Flags change to differentiate between mulitcast capable and multicast in use ntpd/ntp_io.c@1.112 +8 -6 Add multicast capable flags when available. Change multicast flag to show socket is being used for multicast ntpd/ntpd.c@1.55 +2 -4 Remove unnecessary macro condition ChangeSet@1.1188, 2004-07-03 18:30:24-04:00, mayer@tecotoo. include updates for winnt ports/winnt/libntp/libntp.dsp@1.18 +4 -0 Added ntp_rfc2553.h to list of includes ports/winnt/ntpd/ntpd.dsp@1.20 +0 -4 map_vme.c not used. ChangeSet@1.1187, 2004-07-03 17:54:02-04:00, mayer@tecotoo. Removed unreachable code ports/winnt/ntpd/ntp_iocompletionport.c@1.12 +0 -1 Removed unreachable code ChangeSet@1.1186, 2004-07-03 17:52:50-04:00, mayer@tecotoo. #endif was in wrong place ntpd/ntp_proto.c@1.180 +1 -1 #endif was in wrong place ChangeSet@1.1183, 2004-07-03 16:56:20-04:00, mayer@tecotoo. handle empty sockets and unknown address family libntp/socktoa.c@1.6 +8 -2 handle empty sockets and unknown address family ChangeSet@1.1178.1.12, 2004-05-06 01:39:49-04:00, stenn@whimsy.udel.edu Cleanup from Dave Mills html/drivers/driver36.html@1.23 +0 -2 Cleanup from Dave Mills html/drivers/driver6.html@1.18 +0 -2 Cleanup from Dave Mills html/drivers/driver7.html@1.21 +0 -2 Cleanup from Dave Mills html/drivers/scripts/footer.txt@1.1 +7 -0 html/drivers/scripts/footer.txt@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/drivers/scripts/footer.txt html/drivers/scripts/style.css@1.1 +64 -0 html/drivers/scripts/style.css@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/drivers/scripts/style.css ChangeSet@1.1178.1.11, 2004-05-04 03:43:00-04:00, stenn@whimsy.udel.edu [Bug 305] More lint ntpd/ntp_refclock.c@1.58 +1 -1 [Bug 305] More lint ChangeSet@1.1178.3.1, 2004-05-04 01:01:59-04:00, stenn@whimsy.udel.edu Cleanup/fixes from Dave Mills. include/ntpd.h@1.66 +1 -0 Cleanup/fixes from Dave Mills. ntpd/ntp_filegen.c@1.9 +5 -0 Cleanup/fixes from Dave Mills. ntpd/ntp_loopfilter.c@1.95 +5 -3 Cleanup/fixes from Dave Mills. ChangeSet@1.1181, 2004-04-25 10:35:51-04:00, mayer@tecotoo. Bug fix ports/winnt/include/config.h@1.24.1.1 +1 -1 ChangeSet@1.1178.1.8, 2004-04-23 19:23:39-04:00, mayer@pogo.udel.edu Modification to correct for type errors include/ntp_rfc2553.h@1.25 +16 -16 Move u_int*_t types to ntp_* to avoid conflicts include/ntp_types.h@1.8 +3 -5 Move u_int*_t types to ntp_* to avoid conflicts ntpd/ntp_io.c@1.110 +4 -0 Modified to add hex value of network address to output for Multicast errors ChangeSet@1.1178.2.3, 2004-04-19 20:20:20-04:00, stenn@whimsy.udel.edu manycast poll bugfix from Dave Mills. ntpd/ntp_proto.c@1.178 +1 -1 manycast poll bugfix from Dave Mills. ChangeSet@1.1178.2.2, 2004-04-17 17:33:32-04:00, stenn@pogo.udel.edu Always see if we need in6addr_any configure.in@1.350 +6 -5 Always see if we need in6addr_any ChangeSet@1.1178.2.1, 2004-04-17 17:32:38-04:00, stenn@pogo.udel.edu Added cowbird to the flock-build flock-build@1.30 +1 -1 Added cowbird to the flock-build ChangeSet@1.1178.1.5, 2004-04-16 20:42:21-04:00, mayer@pogo.udel.edu Fix for AIX to initialize in6addr_any libntp/ntp_rfc2553.c@1.16 +4 -1 Fix for AIX to initialize in6addr_any ports/winnt/include/config.h@1.25 +2 -0 Fix for AIX to initialize in6addr_any ChangeSet@1.1152.34.1, 2004-04-11 18:53:56+01:00, mbrett@rgs16.fordson.demon.co.uk Many files: Changes for type-paranoid MIPSpro compiler. ntpd/ntp_config.c@1.100.1.1 +1 -1 Changes for type-paranoid MIPSpro compiler. ntpd/ntp_intres.c@1.32.1.1 +1 -1 Changes for type-paranoid MIPSpro compiler. ntpd/ntp_io.c@1.105.2.1 +4 -4 Changes for type-paranoid MIPSpro compiler. ntpd/ntp_proto.c@1.172.1.1 +3 -3 Changes for type-paranoid MIPSpro compiler. ntpdc/ntpdc_ops.c@1.29.1.1 +17 -17 Changes for type-paranoid MIPSpro compiler. ntpq/ntpq.c@1.45.1.1 +2 -2 Changes for type-paranoid MIPSpro compiler. ntpq/ntpq_ops.c@1.20 +1 -1 Changes for type-paranoid MIPSpro compiler. ChangeSet@1.1178.1.4, 2004-04-07 20:45:38-04:00, stenn@whimsy.udel.edu refclock_oncore.c cleanup from Reg Clemens ntpd/refclock_oncore.c@1.51 +0 -11 refclock_oncore.c cleanup from Reg Clemens ChangeSet@1.1177.1.5, 2004-04-07 20:38:47-04:00, stenn@whimsy.udel.edu Cleanup from Dave Mills include/ntp.h@1.100 +2 -0 Cleanup from Dave Mills include/ntp_control.h@1.25 +7 -6 Cleanup from Dave Mills include/ntp_crypto.h@1.34 +2 -3 Cleanup from Dave Mills ntpd/ntp_control.c@1.70 +20 -10 Cleanup from Dave Mills ntpd/ntp_crypto.c@1.93 +21 -18 Cleanup from Dave Mills ntpd/ntp_proto.c@1.177 +9 -5 Cleanup from Dave Mills ntpd/refclock_chu.c@1.35 +1 -1 Cleanup from Dave Mills ntpq/ntpq.c@1.47 +1 -1 Cleanup from Dave Mills ChangeSet@1.1178.1.1, 2004-04-07 16:48:52-04:00, mayer@pogo.udel.edu Fix for Windows select timeout ntpdate/ntpdate.c@1.47 +17 -0 Fix for Windows select timeout ChangeSet@1.1177.1.4, 2004-04-07 15:48:32-04:00, stenn@whimsy.udel.edu [Bug 275] Expose needed glue in ntp-keygen util/ntp-keygen.c@1.28 +2 -2 [Bug 275] Expose needed glue in ntp-keygen ChangeSet@1.1177.1.3, 2004-04-06 00:56:17-04:00, stenn@whimsy.udel.edu cleanup include/timepps-Solaris.h@1.4 +0 -1 cleanup ChangeSet@1.1177.2.1, 2004-04-06 00:36:24-04:00, stenn@whimsy.udel.edu Cleanup from Reg Clemens include/timepps-Solaris.h@1.3 +5 -0 Cleanup from Reg Clemens include/timepps-SunOS.h@1.3 +1 -4 Cleanup from Reg Clemens ChangeSet@1.1177.1.1, 2004-04-05 14:11:34-04:00, stenn@whimsy.udel.edu [Bug 299] Distribute timepps-*.h include/Makefile.am@1.19 +3 -0 [Bug 299] Distribute timepps-*.h ChangeSet@1.1177, 2004-04-04 23:00:44-04:00, stenn@whimsy.udel.edu Cleanup from Dave Mills include/ntp_crypto.h@1.33 +1 -0 Cleanup from Dave Mills ntpd/ntp_crypto.c@1.92 +65 -42 Cleanup from Dave Mills ChangeSet@1.1176, 2004-04-04 22:44:03-04:00, stenn@whimsy.udel.edu [Bug 241] Dave agrees the patch is correct. ntpd/ntp_config.c@1.102.1.2 +0 -5 [Bug 241] Dave agrees the patch is correct. ChangeSet@1.1175, 2004-04-03 21:18:24-05:00, stenn@whimsy.udel.edu [Bug 275] Build ntp-keygen even if no OPENSSL. configure.in@1.349 +0 -3 [Bug 275] Build ntp-keygen even if no OPENSSL. util/Makefile.am@1.24 +2 -2 [Bug 275] Build ntp-keygen even if no OPENSSL. util/ntp-keygen.c@1.27 +49 -5 [Bug 275] Build ntp-keygen even if no OPENSSL. ChangeSet@1.1174, 2004-04-03 02:48:23-05:00, stenn@whimsy.udel.edu [Bug 241] Fix from Matthias Drochner ntpd/ntp_config.c@1.102.1.1 +2 -1 [Bug 241] Fix from Matthias Drochner ChangeSet@1.1152.33.2, 2004-04-03 02:17:22-05:00, stenn@whimsy.udel.edu [Bug 277] Ultralink 325 support from Frank Migge ntpd/refclock_ulink.c@1.13 +161 -69 [Bug 277] Ultralink 325 support from Frank Migge ChangeSet@1.1152.33.1, 2004-04-03 01:56:25-05:00, stenn@whimsy.udel.edu [Bug 217] Typo in ntptrace scripts/ntptrace.in@1.4 +1 -1 [Bug 217] Typo in ntptrace ChangeSet@1.1152.1.98, 2004-04-02 16:07:14-05:00, mayer@pogo.udel.edu remove pps_device[] array that crept back in ntpd/ntp_config.c@1.103 +0 -1 remove pps_device[] array that crept back in ChangeSet@1.1152.1.97, 2004-04-02 15:20:54-05:00, stenn@whimsy.udel.edu [Bug 298] Fix typos in configure.in configure.in@1.348 +2 -2 [Bug 298] Fix typos in configure.in ChangeSet@1.1152.32.5, 2004-04-01 15:23:22-05:00, mayer@pogo.udel.edu ntpdc_ops.c: undo all of the changes to the header include order as some systems in the flock had trouble with the reordering ntpdc_ops.c, ntp_intres.c: Undo some of the reordering of includes Many files: reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them ntp_fp.h: change inclusion order of netinet/in.h and ntp_rfc2553.h include/ntp_fp.h@1.11 +1 -1 change inclusion order of netinet/in.h and ntp_rfc2553.h ntpd/ntp_config.c@1.102 +3 -2 reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them ntpd/ntp_intres.c@1.34 +9 -8 Undo some of the reordering of includes ntpd/ntp_intres.c@1.33 +7 -7 reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them ntpd/ntp_resolver.c@1.17 +7 -7 reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them ntpd/refclock_nmea.c@1.23 +5 -5 reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them ntpdc/ntpdc.c@1.33 +5 -5 reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them ntpdc/ntpdc_ops.c@1.32 +6 -7 undo all of the changes to the header include order as some systems in the flock had trouble with the reordering ntpdc/ntpdc_ops.c@1.31 +5 -4 Undo some of the reordering of includes ntpdc/ntpdc_ops.c@1.30 +8 -8 reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them ntpq/ntpq.c@1.46 +7 -6 reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them ChangeSet@1.1152.1.95, 2004-03-29 21:57:51-05:00, stenn@whimsy.udel.edu New irig notes from Dave Mills ntpd/refclock_irig.c@1.21 +14 -14 New notes from Dave Mills ChangeSet@1.1152.32.4, 2004-03-26 20:10:51-05:00, mayer@pogo.udel.edu remove reference to include netdb.h. porkypine doesn't protect itself against multiple includes include/ntp_rfc2553.h@1.24 +0 -1 remove reference to include netdb.h. porkypine doesn't protect itself against multiple includes ChangeSet@1.1152.32.3, 2004-03-26 19:39:33-05:00, mayer@pogo.udel.edu Remove some includes as porkypine complained include/ntp_rfc2553.h@1.23 +1 -13 Remove some includes as porkypine complained ChangeSet@1.1152.32.2, 2004-03-26 17:53:26-05:00, mayer@pogo.udel.edu Fix the macros in ntp_rfc2553.h by including network headers and make ntp_io.c conditionally allow IPv6 multicast only if the macros are defined include/ntp_rfc2553.h@1.22 +13 -0 add includes to ntp_rfc2553.h to ensure that macros are defined in case they don't need to be defined ntpd/ntp_io.c@1.109 +2 -2 Make IPV6 multicast conditional on the inclusion of the IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP ChangeSet@1.1152.32.1, 2004-03-26 09:46:49-05:00, mayer@pogo.udel.edu #endif for DEBUG was one line too far down, causing problems with release builds ntpd/ntp_proto.c@1.176 +1 -1 #endif for DEBUG was one line too far down, causing problems with release builds ChangeSet@1.1152.31.6, 2004-03-25 21:20:54-05:00, stenn@whimsy.udel.edu Fixed from Dave Mills. ntpd/ntp_loopfilter.c@1.94 +3 -3 Fixed from Dave Mills. ChangeSet@1.1152.31.5, 2004-03-25 21:17:21-05:00, stenn@whimsy.udel.edu jitter.c fixes from Dave Mills. util/jitter.c@1.5 +67 -5 fixes from Dave Mills. ChangeSet@1.1152.31.4, 2004-03-25 21:13:54-05:00, stenn@whimsy.udel.edu Documentation cleanup/resync with Dave. html/build/build.html@1.20 +12 -12 Documentation cleanup/resync with Dave. html/build/config.html@1.18 +2 -2 Documentation cleanup/resync with Dave. html/build/hints.html@1.14 +2 -2 Documentation cleanup/resync with Dave. html/build/hints/solaris.html@1.8 +1 -1 Documentation cleanup/resync with Dave. html/build/hints/vxworks.html@1.7 +5 -5 Documentation cleanup/resync with Dave. html/build/hints/winnt.html@1.15 +4 -4 Documentation cleanup/resync with Dave. html/build/patches.html@1.17 +3 -3 Documentation cleanup/resync with Dave. html/build/porting.html@1.13 +2 -2 Documentation cleanup/resync with Dave. html/build/quick.html@1.16 +6 -6 Documentation cleanup/resync with Dave. html/drivers/driver1.html@1.14 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver10.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver11.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver12.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver16.html@1.10 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver18.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver19.html@1.10 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver2.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver20.html@1.13 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver22.html@1.15 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver23.html@1.12 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver24.html@1.9 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver26.html@1.9 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver27.html@1.13 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver28.html@1.10 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver29.html@1.12 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver3.html@1.10 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver30.html@1.18 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver32.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver33.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver34.html@1.10 +80 -45 Documentation cleanup/resync with Dave. html/drivers/driver35.html@1.13 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver36.html@1.22 +3 -3 Documentation cleanup/resync with Dave. html/drivers/driver37.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver38.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver39.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver4.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver40.html@1.10 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver42.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver43.html@1.8 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver44.html@1.10 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver5.html@1.11 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver6.html@1.17 +3 -3 Documentation cleanup/resync with Dave. html/drivers/driver7.html@1.20 +3 -3 Documentation cleanup/resync with Dave. html/drivers/driver8.html@1.13 +2 -2 Documentation cleanup/resync with Dave. html/drivers/driver9.html@1.13 +2 -2 Documentation cleanup/resync with Dave. html/drivers/oncore-shmem.html@1.11 +2 -2 Documentation cleanup/resync with Dave. ChangeSet@1.1152.1.90, 2004-03-25 20:04:11-05:00, mayer@pogo.udel.edu Added conditional macro for scope_id libisc/interfaceiter.c@1.10 +5 -1 Added conditional macro for scope_id ntpd/ntp_io.c@1.108 +4 -0 Added conditional macro for scope_id ChangeSet@1.1152.31.3, 2004-03-24 23:31:23-05:00, stenn@whimsy.udel.edu Resync html/ with the master copy from Dave. html/authopt.html@1.32 +5 -5 Resync html/ with the master copy from Dave. html/build/build.html@1.19 +0 -0 Rename: html/build.html -> html/build/build.html html/build/config.html@1.17 +0 -0 Rename: html/config.html -> html/build/config.html html/build/hints.html@1.13 +0 -0 Rename: html/hints.html -> html/build/hints.html html/build/hints/a-ux@1.3 +0 -0 mvdir html/build/hints/aix@1.3 +0 -0 mvdir html/build/hints/bsdi@1.3 +0 -0 mvdir html/build/hints/changes@1.3 +0 -0 mvdir html/build/hints/decosf1@1.3 +0 -0 mvdir html/build/hints/decosf2@1.3 +0 -0 mvdir html/build/hints/freebsd@1.3 +0 -0 mvdir html/build/hints/hpux@1.3 +0 -0 mvdir html/build/hints/linux@1.3 +0 -0 mvdir html/build/hints/mpeix@1.3 +0 -0 mvdir html/build/hints/netbsd@1.2 +0 -0 mvdir html/build/hints/notes-xntp-v3@1.3 +0 -0 mvdir html/build/hints/parse@1.3 +0 -0 mvdir html/build/hints/refclocks@1.3 +0 -0 mvdir html/build/hints/rs6000@1.3 +0 -0 mvdir html/build/hints/sco.html@1.7 +0 -0 mvdir html/build/hints/sgi@1.3 +0 -0 mvdir html/build/hints/solaris-dosynctodr.html@1.4 +0 -0 mvdir html/build/hints/solaris.html@1.7 +0 -0 mvdir html/build/hints/solaris.xtra.4023118@1.3 +0 -0 mvdir html/build/hints/solaris.xtra.4095849@1.3 +0 -0 mvdir html/build/hints/solaris.xtra.S99ntpd@1.4 +0 -0 mvdir html/build/hints/solaris.xtra.patchfreq@1.3 +0 -0 mvdir html/build/hints/sun4@1.3 +0 -0 mvdir html/build/hints/svr4-dell@1.3 +0 -0 mvdir html/build/hints/svr4_package@1.3 +0 -0 mvdir html/build/hints/todo@1.3 +0 -0 mvdir html/build/hints/vxworks.html@1.6 +0 -0 mvdir html/build/hints/winnt.html@1.14 +0 -0 mvdir html/build/patches.html@1.16 +0 -0 Rename: html/patches.html -> html/build/patches.html html/build/porting.html@1.12 +0 -0 Rename: html/porting.html -> html/build/porting.html html/build/quick.html@1.15 +0 -0 Rename: html/quick.html -> html/build/quick.html html/build/scripts/footer.txt@1.1 +7 -0 html/build/scripts/footer.txt@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/footer.txt html/build/scripts/links10.txt@1.1 +5 -0 html/build/scripts/links10.txt@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/links10.txt html/build/scripts/links11.txt@1.1 +5 -0 html/build/scripts/links11.txt@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/links11.txt html/build/scripts/links12.txt@1.1 +5 -0 html/build/scripts/links12.txt@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/links12.txt html/build/scripts/links7.txt@1.1 +5 -0 html/build/scripts/links7.txt@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/links7.txt html/build/scripts/links8.txt@1.1 +6 -0 html/build/scripts/links8.txt@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/links8.txt html/build/scripts/links9.txt@1.1 +7 -0 html/build/scripts/links9.txt@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/links9.txt html/build/scripts/style.css@1.1 +64 -0 html/build/scripts/style.css@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/style.css html/drivers/driver31.html@1.1 +56 -0 html/drivers/driver31.html@1.0 +0 -0 BitKeeper file /deacon/backroom/ntp-dev/html/drivers/driver31.html html/howto.html@1.17 +2 -2 Resync html/ with the master copy from Dave. html/index.html@1.30 +9 -9 Resync html/ with the master copy from Dave. html/notes.html@1.16 +2 -2 Resync html/ with the master copy from Dave. html/release.html@1.29 +1 -1 Resync html/ with the master copy from Dave. ChangeSet@1.1152.31.2, 2004-03-24 22:04:57-05:00, stenn@whimsy.udel.edu PPS cleanup from Dave Mills. include/ntpd.h@1.65 +1 -2 PPS cleanup from Dave Mills. ntpd/ntp_config.c@1.101 +0 -1 PPS cleanup from Dave Mills. ntpd/ntp_loopfilter.c@1.93 +8 -1 PPS cleanup from Dave Mills. ntpd/ntp_refclock.c@1.57 +7 -15 PPS cleanup from Dave Mills. ntpd/refclock_atom.c@1.43 +11 -13 PPS cleanup from Dave Mills. ChangeSet@1.1152.31.1, 2004-03-24 21:55:36-05:00, stenn@whimsy.udel.edu Have configure look for struct sockaddr_in6.sin6_scope_id configure.in@1.347 +9 -0 Have configure look for struct sockaddr_in6.sin6_scope_id ChangeSet@1.1152.29.3, 2004-03-24 17:27:43-05:00, mayer@pogo.udel.edu Change u_int64_t to ntp_int64_t to avoid O/S problems include/ntp_rfc2553.h@1.21 +2 -2 Change u_int64_t to ntp_int64_t to avoid O/S problems include/ntp_types.h@1.7 +1 -3 Change u_int64_t to ntp_int64_t to avoid O/S problems ChangeSet@1.1152.1.88, 2004-03-24 00:57:20-05:00, stenn@pogo.udel.edu No parse clocks if we disable all clocks flock-build@1.29 +2 -1 No parse clocks if we disable all clocks ChangeSet@1.1152.1.87, 2004-03-23 00:26:24-05:00, stenn@whimsy.udel.edu Do --disable-all-clocks in flock-build, too. build@1.21 +6 -0 Do --disable-all-clocks in flock-build, too. flock-build@1.28 +3 -1 Do --disable-all-clocks in flock-build, too. ChangeSet@1.1152.1.86, 2004-03-23 00:07:02-05:00, stenn@whimsy.udel.edu no refclock fixes from Dave Mills ntpd/ntp_control.c@1.69 +2 -0 no refclock fixes from Dave Mills ntpd/ntp_proto.c@1.175 +4 -1 no refclock fixes from Dave Mills ChangeSet@1.1152.1.85, 2004-03-22 23:59:43-05:00, stenn@whimsy.udel.edu From Dave Mills: remove legacy local_refclock/prefer wrinkle. ntpd/ntp_loopfilter.c@1.92 +0 -13 From Dave Mills: remove legacy local_refclock/prefer wrinkle. ChangeSet@1.1152.1.84, 2004-03-20 01:20:11-05:00, stenn@whimsy.udel.edu [Bug 293] - out of bounds array write: Nathan Hintz util/ntp-keygen.c@1.26 +1 -1 [Bug 293] - out of bounds array write: Nathan Hintz ChangeSet@1.1152.29.2, 2004-03-19 19:11:17-05:00, mayer@pogo.udel.edu Move AI_NUMERICHOST outside of the ISC_PLATFORM_HAVEIPV6 macro to conditionally include it if it's not defined include/ntp_rfc2553.h@1.20 +14 -14 Move AI_NUMERICHOST outside of the ISC_PLATFORM_HAVEIPV6 macro to conditionally include it if it's not defined ChangeSet@1.1152.1.82, 2004-03-19 01:48:58-05:00, stenn@deacon.udel.edu Oncore: Remove obsolete checks BitKeeper/etc/logging_ok@1.48 +1 -0 Logging to logging@openlogging.org accepted ntpd/refclock_oncore.c@1.50 +0 -4 Remove obsolete checks ChangeSet@1.1152.1.81, 2004-03-18 23:54:58-05:00, stenn@whimsy.udel.edu Use "inline" instead of "__inline" so configure can DTRT. include/timepps-SCO.h@1.2 +7 -7 Use "inline" instead of "__inline" so configure can DTRT. include/timepps-Solaris.h@1.2 +7 -7 Use "inline" instead of "__inline" so configure can DTRT. include/timepps-SunOS.h@1.2 +7 -7 Use "inline" instead of "__inline" so configure can DTRT. ChangeSet@1.1152.1.80, 2004-03-18 23:38:17-05:00, stenn@whimsy.udel.edu Documentation updates from Dave Mills html/authopt.html@1.31 +3 -3 Updates from Dave Mills html/howto.html@1.16 +1 -1 Updates from Dave Mills html/index.html@1.29 +3 -3 Updates from Dave Mills html/monopt.html@1.18 +2 -2 Updates from Dave Mills html/refclock.html@1.29 +2 -2 Updates from Dave Mills ChangeSet@1.1152.1.79, 2004-03-18 23:24:57-05:00, stenn@whimsy.udel.edu Cleanup and fixed from Dave Mills include/ntp.h@1.99 +2 -2 Cleanup and fixed from Dave Mills include/ntpd.h@1.64 +2 -1 Cleanup and fixed from Dave Mills libntp/systime.c@1.30 +7 -4 Cleanup and fixed from Dave Mills ntpd/ntp_control.c@1.68 +3 -4 Cleanup and fixed from Dave Mills ntpd/ntp_loopfilter.c@1.91 +26 -43 Cleanup and fixed from Dave Mills ntpd/ntp_proto.c@1.174 +128 -126 Cleanup and fixed from Dave Mills ntpd/ntp_refclock.c@1.56 +72 -36 Cleanup and fixed from Dave Mills ntpd/ntp_request.c@1.56 +0 -18 Cleanup and fixed from Dave Mills ntpd/refclock_arbiter.c@1.8 +20 -20 Cleanup and fixed from Dave Mills ntpd/refclock_wwvb.c@1.12 +4 -3 Cleanup and fixed from Dave Mills ChangeSet@1.1152.1.78, 2004-03-18 23:15:06-05:00, stenn@whimsy.udel.edu Driver36 cleanup from Dave Mills html/drivers/driver36.html@1.21 +4 -3 Cleanup from Dave Mills html/scripts/links8.txt@1.2 +3 -3 Cleanup from Dave Mills ChangeSet@1.1152.1.77, 2004-03-17 17:11:42-05:00, stenn@pogo.udel.edu Pedantic compiler lint sntp/header.h@1.4 +2 -2 Pedantic compiler lint ChangeSet@1.1152.1.76, 2004-03-17 17:10:30-05:00, stenn@pogo.udel.edu oncore fixes from Reg Clemens include/timepps-SCO.h@1.1 +503 -0 include/timepps-SCO.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev/include/timepps-SCO.h include/timepps-Solaris.h@1.1 +497 -0 include/timepps-Solaris.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev/include/timepps-Solaris.h include/timepps-SunOS.h@1.1 +507 -0 include/timepps-SunOS.h@1.0 +0 -0 BitKeeper file /pogo/users/stenn/ntp-dev/include/timepps-SunOS.h ntpd/refclock_oncore.c@1.49 +85 -132 Patches/cleanup from Reg Clemens. Header realignment from Harlan. ChangeSet@1.1152.29.1, 2004-03-15 21:04:56-05:00, mayer@tecotoo. Update to ensure the I/O Completion Ports code checks the various error states and sets the return status correctly ports/winnt/ntpd/ntp_iocompletionport.c@1.11 +20 -6 Update to ensure the I/O Completion Ports code checks the various error states and sets the return status correctly ChangeSet@1.1152.1.72, 2004-03-14 22:04:31-05:00, mayer@tecotoo. LIB_GETBUF only has space for 20 entries and does not zero out the contents. Change the limit to 200 and zero out the contents before returning it libntp/lib_strbuf.h@1.3 +2 -1 LIB_GETBUF only has space for 20 entries and does not zero out the contents. Change the limit to 200 and zero out the contents before returning it ChangeSet@1.1152.1.71, 2004-03-13 22:06:42-05:00, mayer@tecotoo. ntp_types.h needs to include sys/types.h include/ntp_rfc2553.h@1.19 +0 -1 ntp_types.h needs to include sys/types.h include/ntp_types.h@1.6 +1 -0 ntp_types.h needs to include sys/types.h ChangeSet@1.1152.28.1, 2004-03-12 22:17:41-05:00, stenn@whimsy.udel.edu [Bug 283] fix (md5.h header check) configure.in@1.346 +5 -1 [Bug 283] fix (md5.h header check) ChangeSet@1.1152.1.70, 2004-03-11 23:47:33-05:00, mayer@tecotoo. move some conditionals back inside ISC_PLATFORM_HAVEIPV6 to reduce warnings if already defined elsewhere include/ntp_rfc2553.h@1.18 +2 -2 move some conditionals back inside ISC_PLATFORM_HAVEIPV6 to reduce warnings if already defined elsewhere ChangeSet@1.1152.1.69, 2004-03-11 22:55:24-05:00, mayer@tecotoo. move integer type definitions from ntp_rfc2553.h into ntp_types.h where they belong include/ntp_rfc2553.h@1.17 +0 -10 move integer type definitions from ntp_rfc2553.h into ntp_types.h where they belong include/ntp_types.h@1.5 +10 -0 move integer type definitions from ntp_rfc2553.h into ntp_types.h where they belong ChangeSet@1.1152.1.68, 2004-03-10 17:51:29-05:00, mayer@pogo.udel.edu Move some macros outside of ISC_PLATFORM_HAVEIPV6 conditional macro and check for inclusion include/ntp_rfc2553.h@1.16 +16 -8 Move some macros outside of ISC_PLATFORM_HAVEIPV6 conditional macro and check for inclusion ChangeSet@1.1152.1.67, 2004-03-09 22:24:49-05:00, mayer@tecotoo. Fix order of variable declarations to ensure required types are declared first for the following structures include/ntp_rfc2553.h@1.15 +15 -15 Fix order of variable declarations to ensure required types are declared first for the following structures ChangeSet@1.1172, 2004-03-05 12:45:00-08:00, gnu@ring.wraith.sf.ca.us add Ross Alexander's fixes for /etc/ntp.audioX libntp/audio.c@1.22 +15 -9 add Ross Alexander's fixes for /etc/ntp.audioX ChangeSet@1.1152.1.64, 2004-03-03 00:57:05-05:00, stenn@whimsy.udel.edu More cleanup/fixes from Dave Mills ntpd/ntp_loopfilter.c@1.90 +139 -141 More cleanup/fixes from Dave Mills ntpd/ntp_proto.c@1.173 +27 -11 More cleanup/fixes from Dave Mills ChangeSet@1.1152.1.63, 2004-03-03 00:49:55-05:00, stenn@whimsy.udel.edu Fix the sockaddr_storage check configure.in@1.345 +1 -2 Fix the sockaddr_storage check ChangeSet@1.1152.1.62, 2004-03-02 22:21:11-05:00, stenn@whimsy.udel.edu Re-enable support for Reliant & SCO libntp/systime.c@1.29 +5 -1 Re-enable support for Reliant & SCO ChangeSet@1.1152.1.61, 2004-02-18 19:56:01-05:00, stenn@whimsy.udel.edu More cleanup from Dave Mills include/ntpd.h@1.63 +1 -1 More cleanup from Dave Mills ntpd/ntp_proto.c@1.172 +40 -37 More cleanup from Dave Mills ntpd/ntp_refclock.c@1.55 +1 -1 More cleanup from Dave Mills ChangeSet@1.1152.1.60, 2004-02-18 00:56:22-05:00, stenn@whimsy.udel.edu Revert the change that required Recent auto*, to fix bug 230. I will still roll tarballs with these recent releases so folks who get tarballs won't see that bug. Only folks otherwise affected by bug 230 will need the latest auto*. Makefile.am@1.46 +1 -1 Revert the change that required Recent auto*, to fix bug 230. I will still roll tarballs with these recent releases so folks who get tarballs won't see that bug. Only folks otherwise affected by bug 230 will need the latest auto*. configure.in@1.344 +1 -1 Revert the change that required Recent auto*, to fix bug 230. I will still roll tarballs with these recent releases so folks who get tarballs won't see that bug. Only folks otherwise affected by bug 230 will need the latest auto*. ChangeSet@1.1152.26.1, 2004-02-17 01:43:41-05:00, stenn@whimsy.udel.edu Cleanup from Dave Mills. include/ntp.h@1.98 +0 -1 Cleanup from Dave Mills. include/ntpd.h@1.62 +1 -1 Cleanup from Dave Mills. ntpd/ntp_crypto.c@1.91 +9 -9 Cleanup from Dave Mills. ntpd/ntp_loopfilter.c@1.89 +0 -4 Cleanup from Dave Mills. ntpd/ntp_peer.c@1.59 +1 -2 Cleanup from Dave Mills. ntpd/ntp_proto.c@1.171 +98 -84 Cleanup from Dave Mills. ntpd/ntp_refclock.c@1.54 +1 -1 Cleanup from Dave Mills. ntpd/refclock_arbiter.c@1.7 +2 -1 Cleanup from Dave Mills. ChangeSet@1.1152.25.6, 2004-02-16 22:35:20-05:00, stenn@whimsy.udel.edu Let the ONCORE refclock build without PPS. From Reg Clemens. html/drivers/driver30.html@1.17 +2 -2 Let the ONCORE refclock build without PPS. From Reg Clemens. ntpd/refclock_conf.c@1.23 +1 -1 Let the ONCORE refclock build without PPS. From Reg Clemens. ntpd/refclock_oncore.c@1.48 +89 -53 Let the ONCORE refclock build without PPS. From Reg Clemens. ChangeSet@1.1152.25.5, 2004-02-14 22:05:42-05:00, stenn@whimsy.udel.edu Disable check_y2k for now (34 year bug?) configure.in@1.343 +2 -1 Disable check_y2k for now (34 year bug?) ChangeSet@1.1152.25.4, 2004-02-13 23:54:07-05:00, stenn@whimsy.udel.edu Dave's recent patch assumed we had OPENSSL. Handle the other case. ntpd/ntp_proto.c@1.170 +2 -0 Dave's recent patch assumed we had OPENSSL. Handle the other case. ChangeSet@1.1152.25.3, 2004-02-12 04:27:25-05:00, stenn@whimsy.udel.edu Changes from Dave Mills: 1. Servers presented with key IDs they don't have (a common mistake) return a crypt-NAK. This also happens when the server rolls new private values daily without telling the clients. To protect against bad guys tossing an old duplicate over the wall, the client doesn't believe this unless the timestamps pass the loopback check. If the server was previously reachable, the client simply restarts the association without missing a beat. If not, and to protect against a restart loop or later server restart, the client disregards the NAK and continues (while disabling burst mode). If really invalid, the association timeout will eventually expire following which a persistent association is marked permanently disabled or an ephemeral association is demobilized. 2. One of the most common mistakes is to goof up the identity credentials. If the client received these credentials via mail, the script in the message installs the file and link automatically. If done by hand and done wrong, either the server or client will find the error and disable the association. As in all such cases, a server or client ephemeral association is demobilized and the resources recovered. 3. Symmetric modes have always been tricky, much more so with Autokey, and even more so with misconfigured identity keys. It gets even wilder when either peer is restarted in the middle of negotiations. All the evil scenarios I can thing of seem to come out on the other side, although there are a few that have to wait the association timeout to properly close down and recover resources. 4. The association is permanently disabled upon kiss-o'-death or unrecoverable crypto error. So, I re-enabled log reporting for these smooches. At least the offender is notified. 5. When a really tenacious clogger shows up and lights the call-gap, the server puts it in the restrict list. He stays there until the server is restarted. Not only does this discourage the terriot, but evidence is collected for possible further action. What more do we have to do to turn this stuff into a real Secure Timestamping Service? I think the security model, protocols, abuse hardening and time performance are consistent with a bulletproof service assuming, that is, PGP mail is used to get the keys and the server certificates are properly signed. include/ntp.h@1.97 +7 -5 Changes from Dave Mills ntpd/ntp_crypto.c@1.90 +16 -17 Changes from Dave Mills ntpd/ntp_proto.c@1.169 +200 -199 Changes from Dave Mills ntpd/ntp_refclock.c@1.53 +1 -2 Changes from Dave Mills ChangeSet@1.1152.14.12, 2004-02-11 20:02:55-05:00, stenn@whimsy.udel.edu Prepare for move from whimsy to deacon. BitKeeper/triggers/2mirrors@1.2 +1 -0 Prepare for move from whimsy to deacon. BitKeeper/triggers/changelog@1.2 +1 -0 Prepare for move from whimsy to deacon. BitKeeper/triggers/commitlogs@1.4 +1 -0 Prepare for move from whimsy to deacon. BitKeeper/triggers/delta-changelog@1.6 +2 -1 Prepare for move from whimsy to deacon. BitKeeper/triggers/notify@1.2 +2 -1 Prepare for move from whimsy to deacon. BitKeeper/triggers/paranoid@1.2 +4 -1 Prepare for move from whimsy to deacon. BitKeeper/triggers/send@1.4 +1 -0 Prepare for move from whimsy to deacon. ChangeSet@1.1152.14.11, 2004-02-10 20:05:16-05:00, stenn@whimsy.udel.edu Cleanup README.bk@1.17 +3 -11 Cleanup ChangeSet@1.1152.22.10, 2004-02-10 16:42:03-05:00, mayer@pogo.udel.edu Move NT specific add to completion ports inside of the open_socket code ntpd/ntp_io.c@1.105.1.1 +18 -20 Move NT specific add to completion ports inside of the open_socket code ChangeSet@1.1152.24.3, 2004-02-07 17:53:39+00:00, mbrett@rgs16.fordson.demon.co.uk humandate.c, caljulian.c, ntp_fp.h: Syntax changes to allow K&R compilers BitKeeper/etc/logging_ok@1.42.1.2 +1 -0 Logging to logging@openlogging.org accepted include/ntp_fp.h@1.7.1.1 +2 -0 Syntax changes to allow K&R compilers libntp/caljulian.c@1.6 +2 -3 Syntax changes to allow K&R compilers libntp/humandate.c@1.6 +0 -2 Syntax changes to allow K&R compilers ChangeSet@1.1152.22.8, 2004-02-05 19:46:43-05:00, mayer@pogo.udel.edu Fix for sockaddr_storage includes include/ntp_rfc2553.h@1.12.1.1 +45 -31 Fix for sockaddr_storage includes ChangeSet@1.1152.24.2, 2004-01-26 21:43:00-05:00, stenn@whimsy.udel.edu struct sockaddr_storage progress configure.in@1.342 +0 -2 struct sockaddr_storage progress include/ntp_rfc2553.h@1.13 +0 -2 struct sockaddr_storage progress ChangeSet@1.1152.24.1, 2004-01-25 22:14:09-05:00, stenn@whimsy.udel.edu Don't use IPv6 on AIX4. configure.in@1.341 +10 -5 Don't use IPv6 on AIX4. ChangeSet@1.1152.22.6, 2004-01-22 20:59:27-05:00, stenn@whimsy.udel.edu Postpone the stuct sockaddr_storage test for now. configure.in@1.340 +2 -0 Postpone the stuct sockaddr_storage test for now. ChangeSet@1.1152.22.5, 2004-01-22 17:49:57-05:00, stenn@whimsy.udel.edu Use doubles instead of NTP timestamps to work around the 34 year problem. From Dave Mills. ntpd/ntp_proto.c@1.168 +32 -21 Use doubles instead of NTP timestamps to work around the 34 year problem. From Dave Mills. ChangeSet@1.1152.22.4, 2004-01-22 17:45:13-05:00, stenn@whimsy.udel.edu jitter utility fixes from Dave Mills. util/jitter.c@1.4 +15 -16 Fixes from Dave Mills. util/jitter.h@1.1 +412 -0 util/jitter.h@1.0 +0 -0 BitKeeper file /backroom/ntp-dev/util/jitter.h ChangeSet@1.1152.23.2, 2004-01-22 17:35:01-05:00, mayer@pogo.udel.edu L_RSHIFTU was mapped to M_RSHIFT instead of M_RSHIFTU include/ntp_fp.h@1.8 +1 -1 L_RSHIFTU was mapped to M_RSHIFT instead of M_RSHIFTU ChangeSet@1.1152.22.3, 2004-01-22 04:07:41+01:00, blk@frobozz.local nl.pl.in: Better accounting for possible whitespace at the end of C routines (Bug 210). BitKeeper/etc/logging_ok@1.42.1.1 +1 -0 Logging to logging@openlogging.org accepted ntpdc/nl.pl.in@1.8 +1 -1 Better accounting for possible whitespace at the end of C routines (Bug 210). ChangeSet@1.1152.23.1, 2004-01-21 19:35:11-05:00, mayer@pogo.udel.edu eliminate no error select reporting ntpdate/ntpdate.c@1.46 +4 -7 eliminate no error select reporting ChangeSet@1.1152.22.2, 2004-01-10 21:10:11-05:00, stenn@whimsy.udel.edu initial attempt at more rfc2553 cleanup configure.in@1.339 +87 -1 initial attempt at more rfc2553 cleanup include/ntp_rfc2553.h@1.12 +2 -0 initial attempt at more rfc2553 cleanup ChangeSet@1.1152.14.10, 2004-01-10 02:27:07-05:00, stenn@pogo.udel.edu Fixes from Reg Clemens: Cleanup. [Bug 233] [Bug 246] [Bug 260] html/drivers/driver30.html@1.16 +8 -8 Fixes from Reg Clemens: I have changed the documentation page for the ONCORE so it no longer references Flag2/Flag3. ntpd/refclock_oncore.c@1.47 +104 -137 Fixes from Reg Clemens: some (minor) changes: (a) some changes to messages printed. (b) can now find config file in /etc/ntp/ as well as /etc/ Bug 233: New LP64 Patches patch imported from original author Bug 246: 3 issues with the ONCORE driver (1) You can reset the ONCORE driver back to defaults by *reading* the variables from across the net. This bug was introduced when I (foolishly) 'fixed' the code so it would understand the FLAG variables that corresponded to its own input variables from the ntp.ONCORE.x file. Since I do NOT understand all the implications of ntp_control, I will remove this 'fix'. The variables can now only be set in ntp.ONCORE. They can NOT be changed dynamically. The documentation will be changed back. Perhaps at some time in the future I will dig through the ntp code to understand ntp_control. (2) Fudge acted upon AFTER ntp.ONCORE. Fixed by (1) the FUDGE flag/time variables are ignored, use the ntp.ONCORE file. (3) In the driver, ONCORE_start and a few other procedures do not produce any output in the clockstats file. The originator of the bug is running FreeBSD 5.1. I have looked at the output from MY copy of FreeBSD 5.1, and several Linux versions (7.3 -> 9), and Fedora and do NOT see any missing messages. The messages start with an "ONCORE DRIVER -- CONFIGURING" message written when the driver is first entered, and contain all the messages I would expect after that. I have no idea why he is not seeing the messages. No action. Bug 260, Patches for item (1) in the above. The patch purports to fix the problem in Bug 246. As noted I don't understand the details of what is going on behind the curtain, so I would rather remove the offending code, than try to fix it. There is also an increase buffer size so that longer messages can be sent to the clockstats file. Ill leave that for the user to do on his own if he wants to change the messages, but with slightly more effort he could do the same using SHMEM. He found an error in determining the ONCORE M12/M12+T. (thanks) Rather than his #ifdef, I have corrected the code. ChangeSet@1.1152.19.3, 2004-01-08 18:21:43-05:00, mayer@pogo.udel.edu Make call to get_scopeid conditional libisc/ifiter_ioctl.c@1.18 +2 -1 Make call to get_scopeid conditional ChangeSet@1.1152.19.2, 2004-01-08 16:07:57-05:00, mayer@pogo.udel.edu Make fetch of broadcast address conditional on existence of macro libisc/ifiter_ioctl.c@1.17 +2 -1 Make fetch of broadcast address conditional on existence of macro ChangeSet@1.1152.1.56, 2004-01-08 17:55:23+00:00, mbrett@rgs16.fordson.demon.co.uk Makefile.am: Remove $(NULL). It has no effect. util/Makefile.am@1.23 +1 -2 Remove $(NULL). It has no effect. ChangeSet@1.1152.1.55, 2004-01-08 13:36:54+00:00, mbrett@rgs16.fordson.demon.co.uk refclock_arc.c: gcc lint for isdigit() BitKeeper/etc/logging_ok@1.43 +1 -0 Logging to logging@openlogging.org accepted ntpd/refclock_arc.c@1.17 +1 -1 gcc lint for isdigit() ChangeSet@1.1152.19.1, 2004-01-06 20:55:01-05:00, mayer@pogo.udel.edu Broadcast addresses were not being set for systems with IPv6 capability libisc/ifiter_ioctl.c@1.16 +21 -0 Broadcast addresses were not being set for systems with IPv6 capability ChangeSet@1.1152.18.1, 2004-01-06 21:19:51+01:00, a115350@y3111429.nh.ad.hydro.com Fix for NTP Epoch rollover BitKeeper/etc/logging_ok@1.42 +1 -0 Logging to logging@openlogging.org accepted libntp/caljulian.c@1.5 +32 -0 Fix for NTP epoch rollover: Uses time_t and localtime/gmtime for conversion libntp/humandate.c@1.5 +5 -4 Fix for NTP epoch rollover: Uses time_t and localtime/gmtime for conversion libntp/prettydate.c@1.4 +64 -9 Use common helper function ChangeSet@1.1152.1.51, 2004-01-02 16:01:53-05:00, stenn@whimsy.udel.edu manycast fix from Dave Mills. ntpd/ntp_proto.c@1.167 +1 -1 manycast fix from Dave Mills. ChangeSet@1.1152.15.6, 2003-12-31 18:04:38-05:00, mayer@tecotoo.myibg.com Test Changes ntpd/ntp_io.c@1.101.1.4 +8 -4 Test Changes ChangeSet@1.1152.17.1, 2003-12-31 13:44:43-05:00, mayer@pogo.udel.edu Fix Broadcast support for those systems that support IPv6 libisc/ifiter_ioctl.c@1.15 +3 -4 Fix Broadcast support for IPv6 capable queries to ioctl ntpd/ntp_io.c@1.105 +11 -10 Fix io_setbclient to properly use MACROS and add proper error information ChangeSet@1.1152.1.50, 2003-12-26 19:00:43-05:00, stenn@whimsy.udel.edu Dave Mills: Update EOV offset comment. ntpd/ntp_control.c@1.65.1.1 +1 -1 Dave Mills: Update EOV offset comment. ChangeSet@1.1152.15.5, 2003-12-25 18:46:06-05:00, mayer@tecotoo.myibg.com EOV value was not updated when error was added ntpd/ntp_control.c@1.66 +1 -1 EOV value was not updated when error was added ChangeSet@1.1152.14.9, 2003-12-24 00:41:50-05:00, stenn@whimsy.udel.edu Cleanups, fix [Bug 320] Makefile.am@1.45 +1 -1 [Bug 230] Require automake-1.8. acinclude.m4@1.12 +2 -2 Quote auto* stuff properly. configure.in@1.336.1.1 +5 -4 Require autoconf-2.58. Use version.m4. Cleanup. version.m4@1.2 +1 -1 4.2.0a version.m4@1.1 +1 -0 version.m4@1.0 +0 -0 BitKeeper file /backroom/ntp-stable/version.m4 ChangeSet@1.1152.14.8, 2003-12-20 20:28:35-05:00, stenn@whimsy.udel.edu [Bug 259] Marc Brett: lint ntpd/refclock_arc.c@1.16 +2 -2 [Bug 259] Marc Brett: lint ntpd/refclock_neoclock4x.c@1.11 +3 -3 [Bug 259] Marc Brett: lint ChangeSet@1.1152.14.7, 2003-12-20 20:18:51-05:00, stenn@whimsy.udel.edu [Bug 258] sntp cleanup sntp/internet.c@1.3 +0 -2 [Bug 258] Matthias Drochner: sntp lint cleanup (plus IPv6 patch from HMS) sntp/main.c@1.3 +18 -1 [Bug 258] Matthias Drochner: sntp lint cleanup (plus IPv6 patch from HMS) sntp/socket.c@1.3 +7 -1 [Bug 258] Matthias Drochner: sntp lint cleanup (plus IPv6 patch from HMS) sntp/timing.c@1.2 +2 -0 [Bug 258] Marc Brett: more sntp lint cleanup. ChangeSet@1.1152.14.6, 2003-12-20 18:44:12-05:00, stenn@whimsy.udel.edu [Bug 262] Petter Reinholdtsen: Fix gcc3/Mac OS X output regexp for ntpdc/nl.pl ntpdc/nl.pl.in@1.7 +2 -2 [Bug 262] Petter Reinholdtsen: Fix gcc3/Mac OS X output regexp for ntpdc/nl.pl ChangeSet@1.1152.14.5, 2003-12-20 01:03:29-05:00, stenn@whimsy.udel.edu [Bug 263] (NetBSD PR bin/23707) ntpdate/ntpdate.c@1.45 +82 -78 Use #ifdef DEBUG where appropriate. ntpdate/ntpdate.c@1.44 +69 -68 [Bug 263] Mattias Karlsson: ntpdate -s is not silent. From NetBSD PR bin/23707 ChangeSet@1.1152.16.1, 2003-12-19 15:44:14-05:00, stenn@whimsy.udel.edu [Bug 251] Timo Felbinger: Drop root under Linux configure.in@1.337 +20 -2 [Bug 251] Timo Felbinger: Drop root under Linux html/ntpd.html@1.32 +5 -1 [Bug 251] Timo Felbinger: Drop root under Linux include/ntpd.h@1.61 +2 -1 [Bug 251] Timo Felbinger: Drop root under Linux ntpd/cmd_args.c@1.23 +18 -10 [Bug 251] Timo Felbinger: Drop root under Linux ntpd/ntpd.c@1.54 +106 -59 [Bug 251] Timo Felbinger: Drop root under Linux ChangeSet@1.1152.1.43, 2003-12-18 02:50:14-05:00, stenn@whimsy.udel.edu [Bug 256] Fix misleading diagnostic message. ntpd/ntp_config.c@1.100 +2 -2 [Bug 256] Fix misleading diagnostic message. ChangeSet@1.1152.1.42, 2003-12-18 00:36:05-05:00, stenn@whimsy.udel.edu [Bug 158] Alter header inclusion to avoid linux header braindamage. libntp/iosignal.c@1.12 +19 -6 [Bug 158] Alter header inclusion to avoid linux header braindamage. ChangeSet@1.1152.1.41, 2003-12-17 23:35:26-05:00, stenn@whimsy.udel.edu Updates from Dave Mills. html/confopt.html@1.28 +5 -6 Updates from Dave Mills. html/ntpdc.html@1.20 +2 -2 Updates from Dave Mills. ChangeSet@1.1152.1.40, 2003-12-17 23:24:17-05:00, stenn@whimsy.udel.edu Dave Mills: novolley subcommand to the broadcast command. ntpd/ntp_config.c@1.99 +8 -4 Dave Mills: novolley subcommand to the broadcast command. ntpd/ntp_proto.c@1.166 +15 -18 Dave Mills: novolley subcommand to the broadcast command. ChangeSet@1.1152.1.39, 2003-12-16 16:22:11-05:00, stenn@whimsy.udel.edu Typo fix from Marc Brett ntpd/ntp_io.c@1.104 +1 -1 Typo fix from Marc Brett ChangeSet@1.1152.15.4, 2003-12-14 21:45:10-05:00, mayer@tecotoo.myibg.com Unix didn't recognize BOOL in create_wildcard, use isc_boolean_t instead ntpd/ntp_io.c@1.101.1.3 +4 -3 Unix didn't recognize BOOL in create_wildcar, use isc_boolean_t instead ChangeSet@1.1152.15.3, 2003-12-14 11:50:12-05:00, mayer@tecotoo.myibg.com Print no interfaces message if debug is on ntpd/ntp_io.c@1.101.1.2 +7 -3 Print no interfaces message if debug is on ChangeSet@1.1152.15.2, 2003-12-13 22:02:59-05:00, mayer@tecotoo.myibg.com Clean up the open_socket code ntpd/ntp_io.c@1.101.1.1 +13 -8 Clean up the open_socket code ChangeSet@1.1152.15.1, 2003-12-13 21:38:39-05:00, mayer@tecotoo.myibg.com define lifr_index if platform uses if_laddrreq libisc/ifiter_ioctl.c@1.14 +1 -0 define lifr_index if platform uses if_laddrreq ChangeSet@1.1152.1.37, 2003-12-10 01:52:46-05:00, stenn@whimsy.udel.edu *ix doesn't do BOOL. ntpd/ntp_io.c@1.102 +1 -1 *ix doesn't do BOOL. ChangeSet@1.1152.1.36, 2003-12-09 09:59:50-05:00, mayer@tecotoo.myibg.com IPV6_V6ONLY not dependent on IPTOS_LOWDELAY, etc ntpd/ntp_io.c@1.101 +1 -2 IPV6_V6ONLY not dependent on IPTOS_LOWDELAY, etc ChangeSet@1.1152.1.35, 2003-12-08 17:49:41-05:00, mayer@tecotoo.myibg.com Fix to only conditionally create a wildcard socket for IPv4 if IPV6_V6ONLY defined and no IPv4 stack ntpd/ntp_io.c@1.100 +25 -18 Fix to only conditionally create a wildcard socket for IPv4 if IPV6_V6ONLY defined ChangeSet@1.1152.1.34, 2003-12-07 19:09:45-05:00, mayer@tecotoo.myibg.com Fix to only get scope and zero address if Link-local Multicast address. Add scope information for interfaces libisc/interfaceiter.c@1.9 +7 -4 Fix to only get scope and zero address if Link-local Multicast address ntpd/ntp_io.c@1.99 +3 -2 Print scope information so we see it for interfaces we are handling ChangeSet@1.1152.1.33, 2003-12-03 23:33:46-05:00, mayer@tecotoo.myibg.com For KAME we need to fix the zeroing out of a couple of bytes. Fix to do it properly libisc/interfaceiter.c@1.8 +9 -2 For KAME we need to fix the zeroing out of a couple of bytes. Fix to do it properly ChangeSet@1.1152.1.32, 2003-12-03 22:24:47-05:00, mayer@tecotoo.myibg.com For KAME we need to fix the zeroing out of a couple of bytes. The wrong variable name got used libisc/interfaceiter.c@1.7 +2 -2 For KAME we need to fix the zeroing out of a couple of bytes. The wrong variable got used ChangeSet@1.1152.12.7, 2003-12-02 23:46:54-05:00, mayer@tecotoo.myibg.com if_index should have been ifindex libisc/ifiter_sysctl.c@1.8 +1 -1 if_index should have been ifindex ChangeSet@1.1152.1.29, 2003-12-01 04:09:21-05:00, stenn@whimsy.udel.edu Improvements from Dave Mills. include/ntp_control.h@1.24 +15 -14 Improvements from Dave Mills. include/ntpd.h@1.60 +3 -3 Improvements from Dave Mills. ntpd/ntp_control.c@1.65 +20 -14 Improvements from Dave Mills. ntpd/ntp_loopfilter.c@1.88 +24 -30 Improvements from Dave Mills. ntpd/ntp_proto.c@1.165 +6 -6 Improvements from Dave Mills. ntpd/ntp_refclock.c@1.52 +2 -3 Improvements from Dave Mills. ChangeSet@1.1152.12.6, 2003-11-30 22:23:45-05:00, mayer@tecotoo.myibg.com For KAME we need to zero out a couple of bytes in the address libisc/interfaceiter.c@1.6 +2 -0 For KAME we need to zero out a couple of bytes in the address ChangeSet@1.1152.12.5, 2003-11-29 21:24:54-05:00, mayer@tecotoo.myibg.com Fixes for older platforms not returning the interface index and not supporting IPv6 libisc/ifiter_ioctl.c@1.13 +9 -0 Fix complaints about not finding ifr_index on older platforms libisc/interfaceiter.c@1.5 +2 -0 Fix warning on machines not supporting IPv6 to ignore the get_scopeid() function ChangeSet@1.1152.12.4, 2003-11-29 20:52:42-05:00, mayer@tecotoo.myibg.com Use scope id when address is link-local for IPv6 multicast IPV6_JOIN_GROUP ntpd/ntp_io.c@1.98 +9 -2 Use scope id when address is link-local for IPv6 multicast IPV6_JOIN_GROUP ChangeSet@1.1152.14.4, 2003-11-29 20:22:38-05:00, stenn@whimsy.udel.edu [Bug 255] Lint cleanup ntpd/ntp_loopfilter.c@1.87 +5 -1 [Bug 255] Lint cleanup ChangeSet@1.1152.14.3, 2003-11-29 19:18:51-05:00, stenn@whimsy.udel.edu [Bug 255] Lint cleanup ntpd/refclock_hopfpci.c@1.10 +0 -8 [Bug 255] Lint clenaup in hopfpci.c ntpd/refclock_neoclock4x.c@1.10 +0 -2 [Bug 255] Lint cleanup in neoclock4x ntpdc/ntpdc.c@1.32 +2 -2 [Bug 255] Lint cleanup in ntpdc.c ntpq/ntpq.c@1.45 +2 -3 [Bug 255] Lint cleanup in ntpq.c ChangeSet@1.1152.14.2, 2003-11-29 18:53:20-05:00, stenn@whimsy.udel.edu [Bug 255] Lint cleanup (avoid HASH_* name collision) include/ntp.h@1.95 +3 -3 [Bug 255] Lint cleanup (avoid HASH_* name collision) include/ntp_request.h@1.23 +1 -1 [Bug 255] Lint cleanup (avoid HASH_* name collision) ntpd/ntp_control.c@1.64 +2 -2 [Bug 255] Lint cleanup (avoid HASH_* name collision) ntpd/ntp_peer.c@1.58 +17 -17 [Bug 255] Lint cleanup (avoid HASH_* name collision) ntpd/ntp_proto.c@1.162.1.1 +2 -2 [Bug 255] Lint cleanup (avoid HASH_* name collision) ntpd/ntp_request.c@1.55 +4 -4 [Bug 255] Lint cleanup (avoid HASH_* name collision) ntpd/ntp_timer.c@1.27 +1 -1 [Bug 255] Lint cleanup (avoid HASH_* name collision) ntpdc/ntpdc_ops.c@1.29 +2 -2 [Bug 255] Lint cleanup (avoid HASH_* name collision) ChangeSet@1.1152.14.1, 2003-11-29 18:07:18-05:00, stenn@whimsy.udel.edu [Bug 254] Frederick Bruckman: Avoid the OSS emulation layer on NetBSD. configure.in@1.336 +5 -1 [Bug 254] Frederick Bruckman: Avoid the OSS emulation layer on NetBSD. ChangeSet@1.1152.1.25, 2003-11-29 03:43:39-05:00, stenn@whimsy.udel.edu [Bug 241] Dave Mills: Do not respond to multicast if not a manycast server. ntpd/ntp_proto.c@1.163 +9 -3 [Bug 241] Dave Mills: Do not respond to multicast if not a manycast server. ChangeSet@1.1152.1.24, 2003-11-29 03:28:17-05:00, stenn@whimsy.udel.edu [Bug 200] Apparently, variance data is stored squared, so we want to SQRT() it when we report it. ntpd/ntp_request.c@1.54 +1 -1 [Bug 200] Apparently, variance data is stored squared, so we want to SQRT() it when we report it. ChangeSet@1.1152.1.23, 2003-11-29 03:17:47-05:00, stenn@whimsy.udel.edu [Bug 252] Matthias Drochner: uninitialized memory in ntp-keygen can lead to crashes. util/ntp-keygen.c@1.25 +8 -7 [Bug 252] Matthias Drochner: uninitialized memory in ntp-keygen can lead to crashes. ChangeSet@1.1152.1.22, 2003-11-29 03:03:13-05:00, stenn@pogo.udel.edu Use our portable way of getting socklen ntpd/refclock_nmea.c@1.22 +1 -2 Use our portable way of getting socklen ChangeSet@1.1152.12.3, 2003-11-27 22:34:47-05:00, mayer@tecotoo.myibg.com Added support for scopeid and interface index in support of IPV6 multicasting. include/isc/interfaceiter.h@1.3 +2 -0 Added interface index and scope id to interface structure include/ntp.h@1.92.1.2 +2 -0 Added interface index and scope id to interface structure libisc/ifiter_ioctl.c@1.12 +4 -0 Added interface index and scope id to interface structure libisc/ifiter_sysctl.c@1.7 +3 -0 Added interface index and scope id to interface structure libisc/interfaceiter.c@1.4 +31 -0 Added get_scopeid function to fetch the scope and take care of KAME issues. ntpd/ntp_io.c@1.97 +6 -1 Copy the interface index and scope id into the interface structure. Use the scope d to specify the scope and te interface index to join the group. ports/winnt/libisc/interfaceiter.c@1.4 +5 -0 Added interface index and scope id to interface. Zero for now. ChangeSet@1.1152.1.21, 2003-11-26 19:52:29-05:00, stenn@whimsy.udel.edu Document nmead support html/drivers/driver20.html@1.12 +1 -0 Document nmead support ChangeSet@1.1152.13.5, 2003-11-26 19:21:41-05:00, stenn@whimsy.udel.edu [Bug 202] From Jon Miner: nmead support ntpd/refclock_nmea.c@1.21 +50 -2 [Bug 202] From Jon Miner: nmead support ChangeSet@1.1152.13.4, 2003-11-26 19:06:31-05:00, stenn@whimsy.udel.edu [Bug 248] From Nigel Roles: Fix use of tcsetattr() and parsing. ntpd/refclock_arc.c@1.15 +45 -5 [Bug 248] From Nigel Roles: Fix use of tcsetattr() and parsing. ChangeSet@1.1152.13.2, 2003-11-25 04:26:12-05:00, stenn@whimsy.udel.edu [Bug 250] msec->nsec conversion bug to refclock_palisade.c (From Neil Burn) ntpd/refclock_palisade.c@1.16.1.1 +1 -1 [Bug 250] msec->nsec conversion bug to refclock_palisade.c (From Neil Burn) ChangeSet@1.1152.13.1, 2003-11-25 04:17:29-05:00, stenn@whimsy.udel.edu [Bug 243] error handling bug in ntpdc (from Matthias Drochner) ntpdc/ntpdc_ops.c@1.28 +18 -18 [Bug 243] error handling bug in ntpdc (from Matthias Drochner) ChangeSet@1.1152.12.2, 2003-11-24 09:24:33-05:00, mayer@tecotoo.myibg.com Time is in nsecs and not usecs. Multiplier was incorrect ntpd/refclock_palisade.c@1.17 +1 -1 Time is in nsecs and not usecs. Multiplier was incorrect ChangeSet@1.1152.12.1, 2003-11-24 09:18:06-05:00, mayer@tecotoo.myibg.com Fix structure name to use the generic name include/ntp.h@1.92.1.1 +1 -1 Fix structure name to use the generic name ChangeSet@1.1152.11.2, 2003-11-20 04:41:32-05:00, stenn@whimsy.udel.edu [Bug 238] check for vsnprintf configure.in@1.335 +1 -1 [Bug 238] check for vsnprintf ChangeSet@1.1152.9.13, 2003-11-20 03:58:27-05:00, stenn@whimsy.udel.edu [Bug 220] (Frederick Bruckman) The linux resolver needs more stack space. ntpd/ntpd.c@1.53 +1 -1 [Bug 220] (Frederick Bruckman) The linux resolver needs more stack space. ChangeSet@1.1152.9.12, 2003-11-20 03:44:29-05:00, stenn@whimsy.udel.edu [Bug 217] ntptrace should show sync distance, not rootdelay. scripts/ntptrace.in@1.3 +6 -3 [Bug 217] ntptrace should show sync distance, not rootdelay. ChangeSet@1.1152.9.11, 2003-11-20 03:28:03-05:00, stenn@whimsy.udel.edu [Bug 215] Stop looking when we hit a refclock. scripts/ntptrace.in@1.2 +1 -0 [Bug 215] Stop looking when we hit a refclock. ChangeSet@1.1152.9.10, 2003-11-19 21:12:51-05:00, stenn@whimsy.udel.edu Sledgehammer bug 230 util/Makefile.am@1.22 +4 -1 Sledgehammer bug 230 ChangeSet@1.1152.9.9, 2003-11-19 10:07:45+00:00, harlanst@time.usno.navy.mil gpsvme updates from USNO BitKeeper/deleted/.del-map_vme.c~3aed0663@1.5 +0 -133 Delete: ntpd/map_vme.c BitKeeper/etc/logging_ok@1.41 +1 -0 Logging to logging@openlogging.org accepted ntpd/Makefile.am@1.37 +1 -1 map_vme.c is no more... ntpd/refclock_gpsvme.c@1.7 +244 -612 updated version from the USNO folks ChangeSet@1.1152.9.8, 2003-11-18 22:58:33-05:00, stenn@whimsy.udel.edu autoconf cleanup configure.in@1.334 +2 -2 autoconf cleanup sntp/configure.ac@1.7 +1 -1 autoconf cleanup ChangeSet@1.1152.10.2, 2003-11-11 02:55:22-05:00, stenn@whimsy.udel.edu [Bug 177] Fixes from Dave Mills. libntp/systime.c@1.28 +6 -1 [Bug 177] Fixes from Dave Mills ntpd/ntp_loopfilter.c@1.86 +20 -26 [Bug 177] Fixes from Dave Mills: state machine improvements. ntpd/ntp_proto.c@1.162 +15 -7 [Bug 177] Fixes from Dave Mills: freq mgt and poll interval fixes. ChangeSet@1.1152.10.1, 2003-11-10 23:53:42-05:00, stenn@whimsy.udel.edu Stuff from Dave Mills NEWS@1.47 +1 -0 Separate -dev news from -stable news. include/ntp.h@1.93 +5 -5 Cleanup from Dave Mills ChangeSet@1.1152.9.6, 2003-11-08 20:32:39-05:00, mayer@tecotoo.myibg.com Ensure config.h is included in ntp_rfx2553.h before testing macros include/ntp_rfc2553.h@1.11 +6 -0 Ensure config.h is included before testing macros ChangeSet@1.1152.9.5, 2003-11-08 16:49:43-05:00, mayer@tecotoo.myibg.com Fixes to properly support platforms that do not have IPv6 support. include/isc/ipv6.h@1.4 +4 -2 Make IPv6 Macro definitions only if not previously defined. include/ntp_rfc2553.h@1.10 +2 -4 Change to only use the definitions if IPv6 not defined on the platform. This uses the Macros defined during the config process which defines the Macro ISC_PLATFORM_HAVEIPV6 if the platform properly supports IPv6 libntp/ntp_rfc2553.c@1.15 +2 -2 Use ISC_PLATFORM_HAVEIPV6 instead of HAVE_IPV6 which was previously defined in the ntp_rfc2553.h file based on the erroneously assumption about a macro. ports/winnt/include/isc/ipv6.h@1.3 +4 -2 Make IPv6 Macro definitions only if not previously defined. ports/winnt/include/isc/platform.h@1.3 +5 -0 The ISC_PLATFORM_HAVEIPV6 macro should not have been defined here. This was a vestige of the work being done to scan for IPv6 interfaces on Windows platforms. ChangeSet@1.1152.9.4, 2003-11-07 21:27:53-05:00, mayer@pogo.udel.edu Change HAVE_IPV6 macro to ISC_PLATFORM_HAVEIPV6 since BIND 9 does a better job of figuring out what's needed for IPv6 ntpd/ntp_io.c@1.96 +26 -26 Change HAVE_IPV6 macro to ISC_PLATFORM_HAVEIPV6 since BIND 9 does a better job of figuring out what's needed for IPv6 ChangeSet@1.1152.9.3, 2003-11-02 23:18:29-05:00, mayer@tecotoo.myibg.com Fix setsockopt arguments to conform to standard declarations for various arguments ntpd/ntp_io.c@1.95 +4 -2 Fix setsockopt arguments to conform to standard declarations for various arguments ChangeSet@1.1152.9.2, 2003-10-31 23:23:43-05:00, mayer@tecotoo.myibg.com Fix for number of bytes and error message fixes (see Bugs #226 and 227) ntpd/ntp_intres.c@1.32 +13 -3 Need to use GetOverlapped result to get the number of bytes. ports/winnt/ntpd/ntp_iocompletionport.c@1.10 +9 -3 Error message fixes. ChangeSet@1.1152.9.1, 2003-10-26 10:20:36-05:00, mayer@tecotoo.myibg.com Update to OpenSSL 0.9.7c BitKeeper/etc/ignore@1.35 +7 -0 Added {ntpd/ntp_io.c.$$$} {ports/winnt/libntp/libntp.dsp.$$$} {ports/winnt/ntp-keygen/ntpkeygen.dsp.$$$} {ports/winnt/ntpd/ntpd.dsp.$$$} {ports/winnt/ntpdate/ntpdate.dsp.$$$} {ports/winnt/ntpdc/ntpdc.dsp.$$$} {ports/winnt/ntpq/ntpq.dsp.$$$} to the ignore list ports/winnt/libntp/libntp.dsp@1.17 +2 -2 Update to OpenSSL 0.9.7c ports/winnt/ntp-keygen/ntpkeygen.dsp@1.4 +4 -4 Update to OpenSSL 0.9.7c ports/winnt/ntpd/ntpd.dsp@1.19 +4 -4 Update to OpenSSL 0.9.7c ports/winnt/ntpdate/ntpdate.dsp@1.12 +2 -2 Update to OpenSSL 0.9.7c ports/winnt/ntpdc/ntpdc.dsp@1.13 +2 -2 Update to OpenSSL 0.9.7c ports/winnt/ntpq/ntpq.dsp@1.13 +2 -2 Update to OpenSSL 0.9.7c ChangeSet@1.1152.8.1, 2003-10-22 11:13:33-04:00, blu@corwin. ntpq_ops.c, ntpq.c: Change formatting for multiple servers and add assID for multiple association output. ntpq/ntpq.c@1.44 +2 -0 Change formatting for multiple servers and add assID for multiple association output. ntpq/ntpq_ops.c@1.19 +38 -4 Change formatting for multiple servers and add assID for multiple association output. ChangeSet@1.1152.1.13, 2003-10-22 13:16:39+02:00, peda@sectra.se Fixes the bug for big endian machines, instead of killing the warning. ntpd/refclock_jupiter.c@1.17 +5 -5 Fixes the bug for big endian machines, instead of killing the warning. ChangeSet@1.1152.1.12, 2003-10-22 13:12:10+02:00, peda@sectra.se Clean up PPS handling in jupiter driver. Easier to modify source to get hardpps. ntpd/refclock_jupiter.c@1.16 +13 -12 Clean up PPS handling. Easier to modify source to get hardpps. ChangeSet@1.1152.1.11, 2003-10-22 13:08:28+02:00, peda@sectra.se Remove annying newline from syslog in the jupiter refclock. ntpd/refclock_jupiter.c@1.15 +1 -1 Remove annying newline from syslog. ChangeSet@1.1152.1.10, 2003-10-20 15:10:02-04:00, stenn@whimsy.udel.edu Added IPv6 to NEWS file. NEWS@1.46 +1 -0 Added IPv6 ChangeSet@1.1140.1.4, 2003-08-13 10:00:10-07:00, gnu@ring.wraith.sf.ca.us dot-in-path fix ntpdc/Makefile.am@1.16.1.1 +1 -1 no-dot-in-path fix for ntpdc-layout ChangeSet@1.1140.1.1, 2003-08-10 00:13:06-07:00, gnu@ring.wraith.sf.ca.us Merge bk://ntp.bkbits.net/ntp-dev into ring.wraith.sf.ca.us:/home/gnu/src/ntp/ntp-dev BitKeeper/etc/gone@1.6 +1 -0 BitKeeper/etc/gone@1.5 +1 -0